diff --git a/index.php b/index.php new file mode 100755 index 0000000..38112bd --- /dev/null +++ b/index.php @@ -0,0 +1,20 @@ + + + + + +WXC2 EMS R9.1 + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + diff --git a/phpMyAdmin/.editorconfig b/phpMyAdmin/.editorconfig new file mode 100755 index 0000000..c1f1fab --- /dev/null +++ b/phpMyAdmin/.editorconfig @@ -0,0 +1,17 @@ +# EditorConfig.org + +root = true + +[*] +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8 + +[*.{js,php,twig,phtml,json,css}] +indent_style = space +indent_size = 4 + +[{*.sql,package.json,.travis.yml}] +indent_style = space +indent_size = 2 diff --git a/phpMyAdmin/.eslintignore b/phpMyAdmin/.eslintignore new file mode 100755 index 0000000..76a3c05 --- /dev/null +++ b/phpMyAdmin/.eslintignore @@ -0,0 +1,3 @@ +js/vendor/ +tmp/ +vendor/ diff --git a/phpMyAdmin/.eslintrc.json b/phpMyAdmin/.eslintrc.json new file mode 100755 index 0000000..0202573 --- /dev/null +++ b/phpMyAdmin/.eslintrc.json @@ -0,0 +1,42 @@ +{ + "env": { + "browser": true, + "jquery": true + }, + "rules": { + "array-bracket-spacing": "error", + "brace-style": "error", + "camelcase": "warn", + "comma-style": ["error", "last"], + "curly": "error", + "dot-notation": "error", + "eol-last": "error", + "eqeqeq": "error", + "indent": ["error", 4], + "keyword-spacing": "error", + "new-cap": "warn", + "no-array-constructor": "warn", + "no-eval": "warn", + "no-loop-func": "warn", + "no-mixed-spaces-and-tabs": "error", + "no-multiple-empty-lines": "error", + "no-new-func": "error", + "no-new-object": "error", + "no-param-reassign": "warn", + "no-trailing-spaces": "error", + "no-underscore-dangle": "warn", + "no-unneeded-ternary": "error", + "no-useless-escape": "warn", + "object-curly-spacing": ["error", "always"], + "one-var": ["error", "never"], + "padded-blocks": ["error", "never"], + "quotes": ["error", "single"], + "semi": "error", + "space-before-blocks": "error", + "space-before-function-paren": "error", + "space-in-parens": "error", + "space-infix-ops": "error", + "spaced-comment": ["error", "always"], + "wrap-iife": "error" + } +} diff --git a/phpMyAdmin/CODE_OF_CONDUCT.md b/phpMyAdmin/CODE_OF_CONDUCT.md new file mode 100755 index 0000000..dbaab72 --- /dev/null +++ b/phpMyAdmin/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at info@phpmyadmin.net. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/phpMyAdmin/CONTRIBUTING.md b/phpMyAdmin/CONTRIBUTING.md new file mode 100755 index 0000000..d38d5b9 --- /dev/null +++ b/phpMyAdmin/CONTRIBUTING.md @@ -0,0 +1,46 @@ +# Contributing to phpMyAdmin + +As an open-source project, phpMyAdmin welcomes contributions of many forms. + +## Bug reporting + +We appreciate your effort to improve phpMyAdmin by submitting a bug report. Before doing so, please check the following things: + +1. Check whether the bug you face **hasn't been already reported**. Duplicate reports take us time, that we could be used to fix other bugs or make improvements. +2. Specify the phpMyAdmin, server, PHP, MySQL and browser information that may be helpful to fix the problem, especially exact **version numbers**. +3. If you got some error, please **describe what happened** and add an error message. Reports like "I get an error when I clicked on some link." are useless. +4. Provide easy steps to reproduce and if possible include your table structure (``SHOW CREATE TABLE `tbl_name```); if your problem implies specific data, attach a small export file for sample rows. +5. **Security problems** should not be reported here. See [our security page](https://www.phpmyadmin.net/security/). +Thanks for your help! + +Please report [bugs on GitHub][1]. + +[1]: https://github.com/phpmyadmin/phpmyadmin/issues/new + +## Patches submission + +Patches are welcome as [pull requests on GitHub][2]. Please include a +Signed-off-by tag in the commit message (you can do this by passing [`--signoff`][4] +parameter to Git). + +When creating the commit on GitHub or using some other tool which does not have +direct support for this, it is the same as adding +`Signed-off-by: Your name ` +as the last line of the commit message. + +Example: `Signed-off-by: Jane Smith ` + +Note that by submitting patches with the Signed-off-by tag, you are giving +permission to license the patch as GPLv2-or-later. See [the DCO file][3] for +details. + + +[2]: https://github.com/phpmyadmin/phpmyadmin/pulls +[3]: https://github.com/phpmyadmin/phpmyadmin/blob/master/DCO +[4]: https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---signoff + +## More information + +You can find more information on our website: + +https://www.phpmyadmin.net/contribute/ diff --git a/phpMyAdmin/ChangeLog b/phpMyAdmin/ChangeLog new file mode 100755 index 0000000..ac38063 --- /dev/null +++ b/phpMyAdmin/ChangeLog @@ -0,0 +1,270 @@ +phpMyAdmin - ChangeLog +====================== + +4.9.11 (2023-02-07) +- issue [security] Fix an XSS attack through the drag-and-drop upload feature + +4.9.10 (2022-02-10) +- issue #17308 Fix broken pagination links in the navigation sidebar + +4.9.9 (2022-01-22) +- issue #17305 Fix syntax error for PHP 5 +- issue #17307 Fix hide_connection_errors being undefined when a controluser is set + +4.9.8 (2022-01-20) +- issue #14321 Display a correct error page when "$cfg['Servers'][$i]['SignonURL']" is empty for auth_type=signon +- issue #14321 [security] Remove leaked HTML on signon page redirect before login for auth_type=signon +- issue [security] Add configuration directive $cfg['Servers'][$i]['hide_connection_errors'] to allow hiding host names and other error details when login fails +- issue [security] Add configuration directive $cfg['URLQueryEncryption'] to allow encrypting senstive information in the URL +- issue [security] Fix a scenario where an authenticated user can disable two factor authentication + +4.9.7 (2020-10-15) +- issue #16397 Fix compatibility problems with older PHP versions (also issue #16399) +- issue #16396 Fix broken two-factor authentication + +4.9.6 (2020-10-09) +- issue [security] Fix XSS vulnerability with the transformation feature (PMASA-2020-5) +- issue [security] Fix SQL injection vulnerability with search feature (PMASA-2020-6) + +4.9.5 (2020-03-20) +- issue [security] Fix SQL injection with certain usernames (PMASA-2020-2) +- issue [security] Fix SQL injection in particular search situations (PMASA-2020-3) +- issue [security] Fix SQL injection and XSS flaw (PMASA-2020-4) +- issue Deprecate "options" for the external transformation; options must now be hard-coded along with the program name directly in the file. + +4.9.4 (2020-01-07) +- issue #15724 Fix 2FA was disabled by a bug +- issue [security] Fix SQL injection vulnerability on the user accounts page (PMASA-2020-1) + +4.9.3 (2019-12-26) +- issue #15570 Fix page contents go underneath of floating menubar in some cases +- issue #15591 Fix php notice 'Undefined index: foreign_keys_data' on relations view when the user has column access +- issue #15592 Fix php warning "error_reporting() has been disabled for security reasons" +- issue #15434 Fix middle click on table sort column name shows a blank page +- issue Fix php notice "Undefined index table_create_time" when setting displayed columns on results of a view +- issue #15571 Fix fatal error when trying to edit row with row checked and button under the table +- issue #15633 Fix designer set display field broken for php 5.x versions +- issue #15621 Support CloudFront-Forwarded-Proto header for Amazon CloudFront proxy +- issue Fix php 8.0 php notices - Undefined index on login page +- issue #15640 Fix php 7.4 error when trying to access array offset on value of type null on table browse +- issue #15641 Fix replication actions where broken (start slave, stop slave, reset, ...) +- issue #15608 Fix DisableIS is broken when with controluser configured (database list broken) +- issue #15614 Fix undefined offset on index page for MySQL 5.7.8 (server charset) +- issue #15692 Fix JavaScript error when user has not enough privilege to view query statistics. +- issue #14248 Fixed date selection in search menu missing higher Z-index value +- issue Fix Uncaught php TypeError on php 8.0 when adding a column to table create form +- issue #15682 Fix calendar not taking current time as default value +- issue #15636 Fix php error trying to access array offset on value o type null on replication GUI +- issue #15695 Fix input field for the time in datetime picker is disabled + +4.9.2 (2019-11-21) +- issue #14184 Change the cookie name from phpMyAdmin to phpMyAdmin_https for HTTPS, fixes many "Failed to set session cookie" errors +- issue #15304 Fix ssl_use php error +- issue #14804 Fix undefined index: ssl_* variables +- issue #14245 Fix mysql 8.0.3 and above fails on advisor +- issue #15499 Fix unparenthesized php deprecation +- issue #15482 Fix URL encoding plus sign (+) in the table or DB name when configuring foreign keys +- issue #14898 Fixed bottom table in list in left panel blocked by horizontal scroll bar +- issue #15161 Fix text area overflows its parent element on "Query" page +- issue #15511 Fixed exporting users after a delete will delete all selected users on "Users" page +- issue #14598 Fixed checking referencial integrity on "Operations" page +- issue #14433 Fix "You do not have privileges to manipulate with the users!" on root superadmin +- issue #15391 Fix GIS polygon of a geometry field is not drawn on "GIS visualization" +- issue #15311 Fix adjust privileges on copy database fails with MariaDB +- issue #15477 Fix display referential integrity check for InnoDB +- issue #15236 Support phpunit 8 in our test suite to help packaging phpMyAdmin on Debian +- issue #15522 Fix missing image error fills logs, removed ic_b_info icon from icon list +- issue #15537 Fixed some issues with the sort by key selectors +- issue #15546 Fix operators precedence in DatabaseInterface class +- issue #14906 Test test suite on 32-bit systems +- issue Fix Long2IP transformation issue with PHP 7.1 +- issue #14951 Fix moving columns with DEFAULT NULL doesn't work on MariaDB 10.2+ +- issue #14951 Fix moving columns with INT AND DEFAULT CURRENT_TIMESTAMP doesn't work on MariaDB +- issue #12241 Fixed table alias is removed when exporting a query +- issue #15316 Fixed cross join clause is removed on export +- issue #14809 Fix error "is_uploaded_file() expects parameter 1 to be string" when inserting blobs from files +- issue #15127 Fix white square when refreshing designer or browsing other pages +- issue #13912 Detect when phpMyAdmin storage tables are not accessible, help users browse corrupt DBs +- issue #15465 Display profiling when query outputs no rows +- issue Fix setting and removing display field on Designer +- issue Added a warning when trying to set a display field on Designer and configuration storage is not setup +- issue #15327 Fix shift-click in Export misses a checkbox +- issue [security] Fix improperly sanitized data when showing the Git branch (thanks to Ali Hubail for this report) +- issue [security] Fix security weaknesses in Designer feature,including a flaw where an attacker could trigger an SQL injection attack (PMASA-2019-5) + +4.9.1 (2019-09-20) +- issue #15313 Added support for Twig 2 +- issue #15315 Fix cannot edit or export column with default CURRENT_TIMESTAMP in MySQL >= 8.0.13 +- issue Fix a TypeError in Import class with PHP 8 +- issue #14270 Fix Middle-click on foreign key link broken +- issue #14363 Fix broken relational links in tables +- issue #14987 Fix weird error for empty collation +- issue #15334 Fix export of GIS visualisation not working (PNG, PDF, SVG) +- issue #14918 Use hex for the phpMyAdmin session token +- issue Added GB18030 Chinese collations description +- issue Added Russian, Swedish, Slovak and Chinese UCA 9.0.0 collations description +- issue Added description for the _ks (kana-sensitive) collation suffix +- issue Added description for the _nopad (NO PAD) collation suffix +- issue #15404 Remove array/string curly braces access +- issue #15427 Fixed "FilterLanguages" option does not work (configuration) +- issue #15202 Fixed creating user with single quote in password results in no password user +- issue #14950 Fixed left database overview "add column" triggers error +- issue #15363 Fix remove unexpected quotes on text fields (structure and insert) +- issue Fix NULL wrongly checked on field change +- issue #15388 Fix allow to rollback an empty statement +- issue #14291 Fixed incorrect linkage from one table's value to another table +- issue #15446 Fix tables added from other databases are not collapsing in the designer section +- issue #14945 Fix designer page save fails if dB name contains period +- issue Display an error when trying to import in designer a table that's already imported +- issue Fix many bugs when adding new tables to designer +- issue Update CodeMirror to v5.48.4 +- issue Update jQuery Migrate to v3.1.0 +- issue Update jQuery Validation to v1.19.1 +- issue Update jQuery to v3.4.1 +- issue Update js-cookie to v2.2.1 +- issue Remove fieldset closing tag when setting global privileges +- issue #15425 Fix backslash in column name resulting an error in editing +- issue #15380 Fix Status - Advisor error +- issue #15439 Fix designer page status not updated when added a new table from another database +- issue #15440 Fix page number is not being updated in the URL after saving a designer's page +- issue Fix reloading a designer's page +- issue Fix designer full screen mode button and text stuck when exiting full-screen mode +- issue Reduced possibility of causing heavy server traffic between the database and web servers +- issue Fix a situation where a server could be deleted while an administator is using the setup script + +4.9.0.1 (2019-06-04) +- issue #14478 phpMyAdmin no longer streams the export data +- issue #14514 Tables with SYSTEM VERSIONING show up as views instead of tables +- issue #14515 Values cannot be edited in SYSTEM VERSIONING tables with INVISIBLE timestamps +- issue Fix header icon on server plugins page +- issue #14298 Fixed error 500 on MultiTableQuery page when a empty query is passed +- issue #14402 Fixed fatal javascript error while adding index to a new column +- issue #14896 Fixed issue with plus/minus icon when refreshing an expanded database +- issue #14922 Fixed json encode error in export +- issue #13975 Fixed missing query time in German (fix decimal number format issue) +- issue #14503 Fixed JavaScript events not activating on input (sql bookmark issue) +- issue #14898 Fixed Bottom table is blocked in database list (left panel) +- issue #14425 Fixed Null Checkbox automatically unmarked +- issue #14870 Display correct date and time in Zip files +- issue #14763 Fixed the loading symbol not appearing when refreshing the navigation +- issue #14607 Count rows only if needed +- issue #14832 Show Designer combo boxes when adding a constraint +- issue #14948 Fix change password is not showing password strength difference at the second attempt +- issue #14868 Fix edit view +- issue #14943 Fixed loading Forever when creating new view without filling any field +- issue #14843 Fix Bookmark::get() id matching SQL +- issue #14734 Fixed invalid default value for bit field +- issue #14311 Fixed undefined index in setup script +- issue #14991 Fixed TypeError in GIS editor +- issue Fixed GIS data editor for multi server setup +- issue #14312 Fixed type error in setup script when adding new server +- issue #14053 Fix missed padding on query results +- issue #14826 Fixed javascript error PMA_messages is not defined +- issue Show error message if config-set fails and not "loading..." forever +- issue #14359 Prevent multiple error modals, and error-report request spamming from script +- issue Fixed error reporting javascript errors on multi server setup +- issue Fixed wrong property name on TableStructureController +- issue #14811 Fix SHOW FULL TABLES FROM when a table is locked +- issue #14916 Fix bug when creating or editing views +- issue #14931 Fixed php error when using a query like SELECT 1 INTO @a; SELECT @a; in inline query edit +- issue #15074 Make the server logo visible on theme "original" +- issue #15077 Fixed incorrect page numbers +- issue #14205 Fixed "No tables found in database" when you delete all tables from last page +- issue #14957 Virtuality is not selected when editing generated column (added virtuality(stored) option for mariadb) +- issue #14853 Insert page should not allow entering things into virtual columns +- issue #15110 Fixed TypeError e.preventDefaulut is not a function +- issue #15115 Improved label in Settings export, clarifying that it's a JSON file +- issue #14816 Fixed [designer] Cannot read property 'style' of null +- issue Fixed [designer] Add new tables with database/table list modal +- issue Fixed query format on multi server setup +- issue Fixed remove partitioning on multi server setup +- issue Fixed normalization +- issue Fixed 'RESET SLAVE' button on replication slave +- issue Fixed sending a php error report on multi server setup +- issue Fixed downloading of monitor parameters for IE 11, Edge, Chrome and others +- issue #15141 Fixed php notice Undefined index: designer_settings +- issue #12729 Fixed sticky table header over dropdown menu +- issue #15140 Fixed edit link does not work on failed insert +- issue #14334 Fixed export table structure shows rows fields +- issue #15010 Fixed empty SQL preview modal on tbl_relation +- issue #14673 Fixed innodb & MySQL 8: DYNAMIC & COMPRESSED ROW_FORMAT missing +- issue Fixed empty success message when adding a new INDEX from left panel +- issue #15150 Fixed generate password hidden on second open of change password modal +- issue Fixed import XML data with leading zeros +- issue #15036 Fixed missing input fields checks for MaxSizeForInputField +- issue #15119 Fixed uninterpreted HTML on Settings->Export page +- issue #15159 Fixed missing query time and database in console +- issue #13713 Fixed column comments in the floating table header +- issue #15177 Fixed label alignment on login page +- issue #15210 Fixed a typo in the english name of the Albanian language +- issue Fixed issue when resetting charset in import.php +- issue #14460 Fixed forms where submitted multiple times on CTRL + ENTER +- issue #15038 Fixed console height was allowing a negative values +- issue #15219 Fixed 'No Password' option does not switch automatically to 'Use Text Field' in add user account +- issue Fixed importing the exported config on Server status monitor page +- issue #15228 Fixed php notice 'Undefined index: foreign_keys_data' on designer when the user has column access +- issue #12900 Fixed designer page saving gives error when configuration storage is not set up +- issue #15229 Fixed php notice, added support for 'DELETE HISTORY' table privilege (MariaDB >= 10.3.4) +- issue #14527 Fixed import settings function not working +- issue #14908 Fixed uninterpreted HTML on Settings->Import (missing data error descriptions) +- issue #14800 Fixed status->Processes doesn't show full query process list page +- issue #14833 Fixed sort by Time not working in process list page +- issue #14982 Fixed setting "null" keep an "enum" value +- issue #14401 Fixed insert rows keypress Enter behavior +- issue #15146 Fixed error reports can not be sent because they are too large +- issue #15205 Fixed useless backquotes on sql preview modal when deleting an index +- issue #13178 Fixed issues with uppercase table and database names (lower_case_table_names=1) +- issue #14383 Fixed warning when browsing certain tables (GIS data) +- issue #12865 Fixed MySQL 8.0.0 issues with GIS display +- issue #15059 Fixed "Server charset" in "Database server" tab showing wrong information +- issue #14614 Fixed mysql error "#2014 - Commands out of sync; you can't run this command now" on sql query +- issue #15238 Fixed phpMyAdmin 4.8.5 doesn't show privileges of procedures (raw html displayed instead) +- issue #13726 Fixed can not copy user on Percona Server 5.7 +- issue #15239 Fixed javascript error while fetching latest version info and switching pages +- issue #14301 Fixed javascript error when editing a JSON data type column +- issue #15240 Fixed apply a Settings form with errors shows a JSON response after using return back +- issue #15043 Fixed multiple errors printing on Settings page +- issue #15037 Fixed unexpected behavior of reset button on Settings +- issue #15157 Fixed 'Settings' tab not marked as active when browsing 2FA settings +- issue #14934 Fixed all fields readonly on Edit/Insert screens +- issue #14588 Fixed export of geometry objects, GIS objects are now exported as hex +- issue #14412 Better handling of errors with Signon authentication type +- issue Added support for AUTO_INCREMENT when using ROCKSDB, on Operations page +- issue #15276 Fixed partitioning is missing in Structure page UI (MySQL 8.0) +- issue #14252 Fixed DisableIS and database tree list (new database missing when refreshing the list) +- issue #14621 Removed "Propose table structure" on MySQL 8.0 +- issue Fixed editing of virtual columns on PerconaDB +- issue #13854 Fixed column options are ignored for GENERATED/VIRTUAL/STORED columns +- issue #15262 Fixed incorrect display of charset column (raw html) +- issue Added explicit parentheses in nested ternary operators +- issue #15287 Fix auto_increment field is too small +- issue #15283 Fix tries to change collation on views when changing collation on all tables/fields +- issue Fixed empty PMA_gotoWhitelist JavaScript array +- issue #15079 Fixed responsive behaviour of instruction dialog box +- issue #10846 Fixed javascript error when renaming a table +- issue Updated sql-parser to version 4.3.2 +- issue [security] SQL injection in Designer (PMASA-2019-3) +- issue [security] CSRF attack on 'cookie' login form (PMASA-2019-4) + +4.8.5 (2019-01-25) +- issue Developer debug data was saved to the PHP error log +- issue #14217 Fix issue when adding user on MySQL 8.0.11 +- issue #13788 Exporting a view structure based on another view with a sub-query throws no database selected error +- issue #14635 Fix PHP error in GitRevision, error in processing request, error code 200 +- issue #14787 Cannot execute stored procedure +- issue Add Burmese language +- issue #14794 Not responding to click, frozen interface, plugin Text_Plain_Sql error +- issue #14786 Table level Operations functions missing +- issue #14791 PHP warning, db_export.php#L91 urldecode() +- issue #14775 Export to SQL format not available for tables +- issue #14782 Error message shown instead of two-factor QR code when adding 2fa to a user +- issue [security] Arbitrary file read/delete relating to MySQL LOAD DATA LOCAL INFILE and an evil server instance (PMASA-2019-1) +- issue [security] SQL injection in Designer (PMASA-2019-2) + + --- Older ChangeLogs can be found on our project website --- + https://www.phpmyadmin.net/old-stuff/ChangeLogs/ + +# vim: et ts=4 sw=4 sts=4 +# vim: ft=changelog fenc=utf-8 +# vim: fde=getline(v\:lnum-1)=~'^\\s*$'&&getline(v\:lnum)=~'\\S'?'>1'\:1&&v\:lnum>4&&getline(v\:lnum)!~'^#' +# vim: fdn=1 fdm=expr diff --git a/phpMyAdmin/DCO b/phpMyAdmin/DCO new file mode 100755 index 0000000..2ef700e --- /dev/null +++ b/phpMyAdmin/DCO @@ -0,0 +1,44 @@ +If you would like to make a contribution to the phpMyAdmin Project, please +certify to the following: +*** +phpMyAdmin Developer's Certificate of Origin. Version 1.0 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I have the + right to submit it under the license of "GNU General Public License or + any later version" ("GPLv2-or-later"); or + +(b) The contribution is based upon previous work that, to the best of my + knowledge, is covered under an appropriate open source license and I have + the right under that license to submit that work with modifications, + whether created in whole or in part by me, under GPLv2-or-later; or + +(c) The contribution was provided directly to me by some other person who + certified (a) or (b) and I have not modified it. + +(d) I understand and agree that this project and the contribution are public + and that a record of the contribution (including all metadata and + personal information I submit with it, including my sign-off) is + maintained indefinitely and may be redistributed consistent with + phpMyAdmin's policies and the requirements of the GPLv2-or-later where + they are relevant. + +(e) I am granting this work to this project under the terms of the + GPLv2-or-later. + + https://www.gnu.org/licenses/gpl-2.0.html + +*** +*** +And please confirm your certification to the above by adding the following +line to your patch: + + Signed-off-by: Jane Smith + +using your real name (sorry, no pseudonyms or anonymous contributions). + +If you are a developer who is authorized to contribute to phpMyAdmin on +behalf of your employer, then please use your corporate email address in the +Signed-off-by tag. If not, then please use a personal email address. + diff --git a/phpMyAdmin/LICENSE b/phpMyAdmin/LICENSE new file mode 100755 index 0000000..d159169 --- /dev/null +++ b/phpMyAdmin/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/phpMyAdmin/README b/phpMyAdmin/README new file mode 100755 index 0000000..98ae5e9 --- /dev/null +++ b/phpMyAdmin/README @@ -0,0 +1,52 @@ +phpMyAdmin - Readme +=================== + +Version 4.9.11 + +A web interface for MySQL and MariaDB. + +https://www.phpmyadmin.net/ + +Summary +------- + +phpMyAdmin is intended to handle the administration of MySQL over the web. +For a summary of features, list of requirements, and installation instructions, +please see the documentation in the ./doc/ folder or at https://docs.phpmyadmin.net/ + +Copyright +--------- + +Copyright 漏 1998 onwards -- the phpMyAdmin team + +Certain libraries are copyrighted by their respective authors; +see the full copyright list for details. + +For full copyright information, please see ./doc/copyright.rst + +License +------- + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License version 2, as published by the +Free Software Foundation. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Licensing of current contributions +---------------------------------- + +Beginning on 2013-12-01, new contributions to this codebase are all licensed +under terms compatible with GPLv2-or-later. phpMyAdmin is currently +transitioning older code to GPLv2-or-later, but work is not yet complete. + +Enjoy! +------ + +The phpMyAdmin team diff --git a/phpMyAdmin/RELEASE-DATE-4.9.11 b/phpMyAdmin/RELEASE-DATE-4.9.11 new file mode 100755 index 0000000..8d26d58 --- /dev/null +++ b/phpMyAdmin/RELEASE-DATE-4.9.11 @@ -0,0 +1 @@ +Tue Feb 7 19:09:20 UTC 2023 diff --git a/phpMyAdmin/ajax.php b/phpMyAdmin/ajax.php new file mode 100755 index 0000000..7f615a0 --- /dev/null +++ b/phpMyAdmin/ajax.php @@ -0,0 +1,51 @@ +setAJAX(true); + +if (empty($_POST['type'])) { + Core::fatalError(__('Bad type!')); +} + +switch ($_POST['type']) { + case 'list-databases': + $response->addJSON('databases', $GLOBALS['dblist']->databases); + break; + case 'list-tables': + Util::checkParameters(array('db'), true); + $response->addJSON('tables', $GLOBALS['dbi']->getTables($_POST['db'])); + break; + case 'list-columns': + Util::checkParameters(array('db', 'table'), true); + $response->addJSON('columns', $GLOBALS['dbi']->getColumnNames($_POST['db'], $_POST['table'])); + break; + case 'config-get': + Util::checkParameters(array('key'), true); + $response->addJSON('value', $GLOBALS['PMA_Config']->get($_POST['key'])); + break; + case 'config-set': + Util::checkParameters(array('key', 'value'), true); + $result = $GLOBALS['PMA_Config']->setUserValue(null, $_POST['key'], json_decode($_POST['value'])); + if ($result !== true) { + $response = Response::getInstance(); + $response->setRequestStatus(false); + $response->addJSON('message', $result); + } + break; + default: + Core::fatalError(__('Bad type!')); +} diff --git a/phpMyAdmin/browse_foreigners.php b/phpMyAdmin/browse_foreigners.php new file mode 100755 index 0000000..f3c3fab --- /dev/null +++ b/phpMyAdmin/browse_foreigners.php @@ -0,0 +1,74 @@ +getFooter()->setMinimal(); +$header = $response->getHeader(); +$header->disableMenuAndConsole(); +$header->setBodyId('body_browse_foreigners'); + +$relation = new Relation(); + +/** + * Displays the frame + */ +$foreigners = $relation->getForeigners($db, $table); +$browseForeigners = new BrowseForeigners( + $GLOBALS['cfg']['LimitChars'], + $GLOBALS['cfg']['MaxRows'], + $GLOBALS['cfg']['RepeatCells'], + $GLOBALS['cfg']['ShowAll'], + $GLOBALS['pmaThemeImage'] +); +$foreign_limit = $browseForeigners->getForeignLimit( + isset($_POST['foreign_showAll']) ? $_POST['foreign_showAll'] : null +); + +$foreignData = $relation->getForeignData( + $foreigners, $_POST['field'], true, + isset($_POST['foreign_filter']) + ? $_POST['foreign_filter'] + : '', + isset($foreign_limit) ? $foreign_limit : null, + true // for getting value in $foreignData['the_total'] +); + +// HTML output +$html = $browseForeigners->getHtmlForRelationalFieldSelection( + $db, + $table, + $_POST['field'], + $foreignData, + isset($fieldkey) ? $fieldkey : null, + isset($data) ? $data : null +); + +$response->addHtml($html); diff --git a/phpMyAdmin/changelog.php b/phpMyAdmin/changelog.php new file mode 100755 index 0000000..b0f8b01 --- /dev/null +++ b/phpMyAdmin/changelog.php @@ -0,0 +1,117 @@ +disable(); +$response->getHeader()->sendHttpHeaders(); + +$filename = CHANGELOG_FILE; + +/** + * Read changelog. + */ +// Check if the file is available, some distributions remove these. +if (@is_readable($filename)) { + + // Test if the if is in a compressed format + if (substr($filename, -3) == '.gz') { + ob_start(); + readgzfile($filename); + $changelog = ob_get_contents(); + ob_end_clean(); + } else { + $changelog = file_get_contents($filename); + } +} else { + printf( + __( + 'The %s file is not available on this system, please visit ' . + '%s for more information.' + ), + $filename, + 'phpmyadmin.net' + ); + exit; +} + +/** + * Whole changelog in variable. + */ +$changelog = htmlspecialchars($changelog); + +$github_url = 'https://github.com/phpmyadmin/phpmyadmin/'; +$faq_url = 'https://docs.phpmyadmin.net/en/latest/faq.html'; + +$replaces = array( + '@(https?://[./a-zA-Z0-9.-_-]*[/a-zA-Z0-9_])@' + => '\\1', + + // mail address + '/([0-9]{4}-[0-9]{2}-[0-9]{2}) (.+[^ ]) +<(.*@.*)>/i' + => '\\1 \\2', + + // FAQ entries + '/FAQ ([0-9]+)\.([0-9a-z]+)/i' + => 'FAQ \\1.\\2', + + // GitHub issues + '/issue\s*#?([0-9]{4,5}) /i' + => 'issue #\\1 ', + + // CVE/CAN entries + '/((CAN|CVE)-[0-9]+-[0-9]+)/' + => '\\1', + + // PMASAentries + '/(PMASA-[0-9]+-[0-9]+)/' + => '\\1', + + // Highlight releases (with links) + '/([0-9]+)\.([0-9]+)\.([0-9]+)\.0 (\([0-9-]+\))/' + => '' + . '' + . '\\1.\\2.\\3.0 \\4', + '/([0-9]+)\.([0-9]+)\.([0-9]+)\.([1-9][0-9]*) (\([0-9-]+\))/' + => '' + . '' + . '\\1.\\2.\\3.\\4 \\5', + + // Highlight releases (not linkable) + '/( ### )(.*)/' + => '\\1\\2', + + // Links target and rel + '/a href="/' => 'a target="_blank" rel="noopener noreferrer" href="' + +); + +header('Content-type: text/html; charset=utf-8'); +?> + + + + + + phpMyAdmin - ChangeLog + + + +

phpMyAdmin - ChangeLog

+'; +echo preg_replace(array_keys($replaces), $replaces, $changelog); +echo ''; +?> + + diff --git a/phpMyAdmin/chk_rel.php b/phpMyAdmin/chk_rel.php new file mode 100755 index 0000000..fe63953 --- /dev/null +++ b/phpMyAdmin/chk_rel.php @@ -0,0 +1,36 @@ +createPmaDatabase()) { + $relation->fixPmaTables('phpmyadmin'); + } +} + +// If request for creating all PMA tables. +if (isset($_POST['fixall_pmadb'])) { + $relation->fixPmaTables($GLOBALS['db']); +} + +$cfgRelation = $relation->getRelationsParam(); +// If request for creating missing PMA tables. +if (isset($_POST['fix_pmadb'])) { + $relation->fixPmaTables($cfgRelation['db']); +} + +$response = Response::getInstance(); +$response->addHTML( + $relation->getRelationsParamDiagnostic($cfgRelation) +); diff --git a/phpMyAdmin/composer.json b/phpMyAdmin/composer.json new file mode 100755 index 0000000..11ab5e9 --- /dev/null +++ b/phpMyAdmin/composer.json @@ -0,0 +1,113 @@ +{ + "name": "phpmyadmin/phpmyadmin", + "type": "project", + "description": "MySQL web administration tool", + "keywords": ["phpmyadmin","mysql","web"], + "homepage": "https://www.phpmyadmin.net/", + "support": { + "forum": "https://www.phpmyadmin.net/support/", + "issues": "https://github.com/phpmyadmin/phpmyadmin/issues", + "wiki": "https://wiki.phpmyadmin.net/", + "docs": "https://docs.phpmyadmin.net/", + "source": "https://github.com/phpmyadmin/phpmyadmin" + }, + "license": "GPL-2.0-only", + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "non-feature-branches": ["RELEASE_.*"], + "autoload": { + "psr-4": { + "PhpMyAdmin\\": "libraries/classes", + "PhpMyAdmin\\Setup\\": "setup/lib" + } + }, + "autoload-dev": { + "psr-4": { + "PhpMyAdmin\\Tests\\": "test/classes", + "PhpMyAdmin\\Tests\\Selenium\\": "test/selenium/" + } + }, + "repositories": [ + { + "type": "composer", + "url": "https://www.phpmyadmin.net" + } + ], + "require": { + "php": ">=5.5.0", + "ext-mysqli": "*", + "ext-xml": "*", + "ext-pcre": "*", + "ext-json": "*", + "ext-ctype": "*", + "ext-hash": "*", + "phpmyadmin/sql-parser": "^4.3.2", + "phpmyadmin/motranslator": "^4.0", + "phpmyadmin/shapefile": "^2.0", + "phpseclib/phpseclib": "^2.0", + "google/recaptcha": "^1.1", + "psr/container": "^1.0", + "twig/twig": "^1.34 || ^2.0", + "twig/extensions": "~1.5.1", + "symfony/expression-language": "^3.2 || ^2.8", + "symfony/polyfill-mbstring": "^1.3" + }, + "conflict": { + "phpseclib/phpseclib": "2.0.8", + "tecnickcom/tcpdf": "<6.2", + "pragmarx/google2fa": "<3.0.1", + "bacon/bacon-qr-code": "<1.0", + "samyoul/u2f-php-server": "<1.1" + }, + "suggest": { + "ext-openssl": "For encryption performance", + "ext-curl": "Updates checking", + "ext-opcache": "Better performance", + "ext-zlib": "For gz import and export", + "ext-bz2": "For bzip2 import and export", + "ext-zip": "For zip import and export", + "ext-gd2": "For image transformations", + "ext-mbstring": "For best performance", + "tecnickcom/tcpdf": "For PDF support", + "pragmarx/google2fa": "For 2FA authentication", + "bacon/bacon-qr-code": "For 2FA authentication", + "samyoul/u2f-php-server": "For FIDO U2F authentication", + "paragonie/sodium_compat": "For modern encryption support" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^5.7", + "codacy/coverage": "^1.3.0", + "phpunit/phpunit-selenium": "~1.2 || ^3.0", + "squizlabs/php_codesniffer": "^3.0", + "tecnickcom/tcpdf": "^6.3", + "pragmarx/google2fa": "^3.0", + "bacon/bacon-qr-code": "^1.0", + "samyoul/u2f-php-server": "^1.1", + "phpmyadmin/coding-standard": "^0.3", + "paragonie/random_compat": ">=2", + "paragonie/sodium_compat": "^1.17" + }, + "extra": { + "branch-alias": { + "dev-master": "4.9.x-dev" + } + }, + "scripts": { + "test": [ + "phpcs", + "phpunit --color=always" + ] + }, + "config": { + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true, + "composer/package-versions-deprecated": true + } + } +} diff --git a/phpMyAdmin/composer.lock b/phpMyAdmin/composer.lock new file mode 100755 index 0000000..6913e81 --- /dev/null +++ b/phpMyAdmin/composer.lock @@ -0,0 +1,3041 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "c19e584edf44f8d13c8013e33401eeb6", + "packages": [ + { + "name": "bacon/bacon-qr-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/Bacon/BaconQrCode.git", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": "^5.4|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "suggest": { + "ext-gd": "to generate QR code images" + }, + "type": "library", + "autoload": { + "psr-0": { + "BaconQrCode": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "http://www.dasprids.de", + "role": "Developer" + } + ], + "description": "BaconQrCode is a QR code generator for PHP.", + "homepage": "https://github.com/Bacon/BaconQrCode", + "support": { + "issues": "https://github.com/Bacon/BaconQrCode/issues", + "source": "https://github.com/Bacon/BaconQrCode/tree/master" + }, + "time": "2017-10-17T09:59:25+00:00" + }, + { + "name": "google/recaptcha", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/google/recaptcha.git", + "reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/google/recaptcha/zipball/614f25a9038be4f3f2da7cbfd778dc5b357d2419", + "reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.2.20|^2.15", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "ReCaptcha\\": "src/ReCaptcha" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Client library for reCAPTCHA, a free service that protects websites from spam and abuse.", + "homepage": "https://www.google.com/recaptcha/", + "keywords": [ + "Abuse", + "captcha", + "recaptcha", + "spam" + ], + "support": { + "forum": "https://groups.google.com/forum/#!forum/recaptcha", + "issues": "https://github.com/google/recaptcha/issues", + "source": "https://github.com/google/recaptcha" + }, + "time": "2020-03-31T17:50:54+00:00" + }, + { + "name": "paragonie/constant_time_encoding", + "version": "v1.1.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "317718fb438e60151f72b20404f040cb5ae1d494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/317718fb438e60151f72b20404f040cb5ae1d494", + "reference": "317718fb438e60151f72b20404f040cb5ae1d494", + "shasum": "" + }, + "require": { + "php": "^5.3|^7|^8" + }, + "require-dev": { + "paragonie/random_compat": "^1.4|^2", + "phpunit/phpunit": ">= 4" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "time": "2022-01-17T05:23:46+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.21", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "96c132c7f2f7bc3230723b66e89f8f150b29d5ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/96c132c7f2f7bc3230723b66e89f8f150b29d5ae", + "reference": "96c132c7f2f7bc3230723b66e89f8f150b29d5ae", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2022-02-16T17:07:03+00:00" + }, + { + "name": "phpmyadmin/motranslator", + "version": "4.0", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/motranslator.git", + "reference": "fcb370254998fda7eeccfd7c787b4deb71b0d77c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/motranslator/zipball/fcb370254998fda7eeccfd7c787b4deb71b0d77c", + "reference": "fcb370254998fda7eeccfd7c787b4deb71b0d77c", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/expression-language": "^4.0 || ^3.2 || ^2.8" + }, + "require-dev": { + "apigen/apigen": "^4.1", + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpMyAdmin\\MoTranslator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "Translation API for PHP using Gettext MO files", + "homepage": "https://github.com/phpmyadmin/motranslator", + "keywords": [ + "gettext", + "i18n", + "mo", + "translator" + ], + "support": { + "issues": "https://github.com/phpmyadmin/motranslator/issues", + "source": "https://github.com/phpmyadmin/motranslator" + }, + "time": "2018-02-12T13:22:52+00:00" + }, + { + "name": "phpmyadmin/shapefile", + "version": "2.1", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/shapefile.git", + "reference": "e23b767f2a81f61fee3fc09fc062879985f3e224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/shapefile/zipball/e23b767f2a81f61fee3fc09fc062879985f3e224", + "reference": "e23b767f2a81f61fee3fc09fc062879985f3e224", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "~4.8 || ~5.7" + }, + "suggest": { + "ext-dbase": "For dbf files parsing" + }, + "type": "library", + "autoload": { + "psr-4": { + "PhpMyAdmin\\ShapeFile\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "ESRI ShapeFile library for PHP", + "homepage": "https://github.com/phpmyadmin/shapefile", + "keywords": [ + "ESRI", + "Shapefile", + "dbf", + "geo", + "geospatial", + "shape", + "shp" + ], + "support": { + "issues": "https://github.com/phpmyadmin/shapefile/issues", + "source": "https://github.com/phpmyadmin/shapefile" + }, + "time": "2017-05-15T08:31:47+00:00" + }, + { + "name": "phpmyadmin/sql-parser", + "version": "4.7.3", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/sql-parser.git", + "reference": "a88f051b5bd5b336779b30111b26b9cd1fc42013" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/a88f051b5bd5b336779b30111b26b9cd1fc42013", + "reference": "a88f051b5bd5b336779b30111b26b9cd1fc42013", + "shasum": "" + }, + "require": { + "php": "^5.3.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.3" + }, + "conflict": { + "phpmyadmin/motranslator": "<3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5 || ^7.0", + "squizlabs/php_codesniffer": "~2.9 || ~3.4" + }, + "suggest": { + "ext-mbstring": "For best performance", + "phpmyadmin/motranslator": "Translate messages to your favorite locale" + }, + "bin": [ + "bin/highlight-query", + "bin/lint-query", + "bin/tokenize-query" + ], + "type": "library", + "autoload": { + "psr-4": { + "PhpMyAdmin\\SqlParser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "A validating SQL lexer and parser with a focus on MySQL dialect.", + "homepage": "https://github.com/phpmyadmin/sql-parser", + "keywords": [ + "analysis", + "lexer", + "parser", + "sql" + ], + "support": { + "issues": "https://github.com/phpmyadmin/sql-parser/issues", + "source": "https://github.com/phpmyadmin/sql-parser" + }, + "time": "2021-12-09T04:30:40+00:00" + }, + { + "name": "phpseclib/phpseclib", + "version": "2.0.41", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "7e763c6f97ec1fcb37c46aa8ecfc20a2c71d9c1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/7e763c6f97ec1fcb37c46aa8ecfc20a2c71d9c1b", + "reference": "7e763c6f97ec1fcb37c46aa8ecfc20a2c71d9c1b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phing/phing": "~2.7", + "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", + "squizlabs/php_codesniffer": "~2.0" + }, + "suggest": { + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.", + "ext-xml": "Install the XML extension to load XML formatted public keys." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-J眉rgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/2.0.41" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "time": "2022-12-23T16:44:18+00:00" + }, + { + "name": "pragmarx/google2fa", + "version": "v3.0.3", + "source": { + "type": "git", + "url": "https://github.com/antonioribeiro/google2fa.git", + "reference": "6949226739e4424f40031e6f1c96b1fd64047335" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/6949226739e4424f40031e6f1c96b1fd64047335", + "reference": "6949226739e4424f40031e6f1c96b1fd64047335", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "~1.0|~2.0", + "paragonie/random_compat": ">=1", + "php": ">=5.4", + "symfony/polyfill-php56": "~1.2" + }, + "require-dev": { + "bacon/bacon-qr-code": "~1.0", + "phpunit/phpunit": "~4|~5|~6" + }, + "suggest": { + "bacon/bacon-qr-code": "Required to generate inline QR Codes." + }, + "type": "library", + "extra": { + "component": "package", + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "PragmaRX\\Google2FA\\": "src/", + "PragmaRX\\Google2FA\\Tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Carlos Ribeiro", + "email": "acr@antoniocarlosribeiro.com", + "role": "Creator & Designer" + } + ], + "description": "A One Time Password Authentication package, compatible with Google Authenticator.", + "keywords": [ + "2fa", + "Authentication", + "Two Factor Authentication", + "google2fa", + "laravel" + ], + "support": { + "issues": "https://github.com/antonioribeiro/google2fa/issues", + "source": "https://github.com/antonioribeiro/google2fa/tree/master" + }, + "time": "2018-08-29T13:28:06+00:00" + }, + { + "name": "psr/container", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, + "time": "2017-02-14T16:28:37+00:00" + }, + { + "name": "samyoul/u2f-php-server", + "version": "v1.1.4", + "source": { + "type": "git", + "url": "https://github.com/Samyoul/U2F-php-server.git", + "reference": "0625202c79d570e58525ed6c4ae38500ea3f0883" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Samyoul/U2F-php-server/zipball/0625202c79d570e58525ed6c4ae38500ea3f0883", + "reference": "0625202c79d570e58525ed6c4ae38500ea3f0883", + "shasum": "" + }, + "require": { + "ext-openssl": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "Samyoul\\U2F\\U2FServer\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Samuel Hawksby-Robinson", + "email": "samuel@samyoul.com" + } + ], + "description": "Server side handling class for FIDO U2F registration and authentication", + "support": { + "issues": "https://github.com/Samyoul/U2F-php-server/issues", + "source": "https://github.com/Samyoul/U2F-php-server/tree/master" + }, + "time": "2018-10-26T12:43:39+00:00" + }, + { + "name": "symfony/expression-language", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/expression-language.git", + "reference": "fa9be1b831859b56d244137fabbfd01a46dbdb36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/fa9be1b831859b56d244137fabbfd01a46dbdb36", + "reference": "fa9be1b831859b56d244137fabbfd01a46dbdb36", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\ExpressionLanguage\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ExpressionLanguage Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/expression-language/tree/v2.8.50" + }, + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b", + "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T09:01:57+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T09:01:57+00:00" + }, + { + "name": "symfony/polyfill-php56", + "version": "v1.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "ea19621731cbd973a6702cfedef3419768bf3372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/ea19621731cbd973a6702cfedef3419768bf3372", + "reference": "ea19621731cbd973a6702cfedef3419768bf3372", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-util": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php56\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php56/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-23T09:01:57+00:00" + }, + { + "name": "symfony/polyfill-util", + "version": "v1.19.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-util.git", + "reference": "8df0c3e6a4b85df9a5c6f3f2f46fba5c5c47058a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8df0c3e6a4b85df9a5c6f3f2f46fba5c5c47058a", + "reference": "8df0c3e6a4b85df9a5c6f3f2f46fba5c5c47058a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Util\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony utilities for portability of PHP codes", + "homepage": "https://symfony.com", + "keywords": [ + "compat", + "compatibility", + "polyfill", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-util/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2020-10-21T09:57:48+00:00" + }, + { + "name": "tecnickcom/tcpdf", + "version": "6.6.2", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/TCPDF.git", + "reference": "e3cffc9bcbc76e89e167e9eb0bbda0cab7518459" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/e3cffc9bcbc76e89e167e9eb0bbda0cab7518459", + "reference": "e3cffc9bcbc76e89e167e9eb0bbda0cab7518459", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "config", + "include", + "tcpdf.php", + "tcpdf_parser.php", + "tcpdf_import.php", + "tcpdf_barcodes_1d.php", + "tcpdf_barcodes_2d.php", + "include/tcpdf_colors.php", + "include/tcpdf_filters.php", + "include/tcpdf_font_data.php", + "include/tcpdf_fonts.php", + "include/tcpdf_images.php", + "include/tcpdf_static.php", + "include/barcodes/datamatrix.php", + "include/barcodes/pdf417.php", + "include/barcodes/qrcode.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-only" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "homepage": "http://www.tcpdf.org/", + "keywords": [ + "PDFD32000-2008", + "TCPDF", + "barcodes", + "datamatrix", + "pdf", + "pdf417", + "qrcode" + ], + "support": { + "issues": "https://github.com/tecnickcom/TCPDF/issues", + "source": "https://github.com/tecnickcom/TCPDF/tree/6.6.2" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20tcpdf%20project", + "type": "custom" + } + ], + "time": "2022-12-17T10:28:59+00:00" + }, + { + "name": "twig/extensions", + "version": "v1.5.4", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig-extensions.git", + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/57873c8b0c1be51caa47df2cdb824490beb16202", + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202", + "shasum": "" + }, + "require": { + "twig/twig": "^1.27|^2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.4", + "symfony/translation": "^2.7|^3.4" + }, + "suggest": { + "symfony/translation": "Allow the time_diff output to be translated" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_Extensions_": "lib/" + }, + "psr-4": { + "Twig\\Extensions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Common additional features for Twig that do not directly belong in core", + "keywords": [ + "i18n", + "text" + ], + "support": { + "issues": "https://github.com/twigphp/Twig-extensions/issues", + "source": "https://github.com/twigphp/Twig-extensions/tree/master" + }, + "abandoned": true, + "time": "2018-12-05T18:34:18+00:00" + }, + { + "name": "twig/twig", + "version": "v1.42.5", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", + "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4|^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.42-dev" + } + }, + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/1.x" + }, + "time": "2020-02-11T05:59:23+00:00" + } + ], + "packages-dev": [ + { + "name": "codacy/coverage", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/codacy/php-codacy-coverage.git", + "reference": "1852ca987c91ef466ebcfdbdd4e1788b653eaf1d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/codacy/php-codacy-coverage/zipball/1852ca987c91ef466ebcfdbdd4e1788b653eaf1d", + "reference": "1852ca987c91ef466ebcfdbdd4e1788b653eaf1d", + "shasum": "" + }, + "require": { + "gitonomy/gitlib": ">=1.0", + "php": ">=5.3.3", + "symfony/console": "~2.5|~3.0|~4.0|~5.0" + }, + "require-dev": { + "clue/phar-composer": "^1.1", + "phpunit/phpunit": "~6.5" + }, + "bin": [ + "bin/codacycoverage" + ], + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jakob Pupke", + "email": "jakob.pupke@gmail.com" + } + ], + "description": "Sends PHP test coverage information to Codacy.", + "homepage": "https://github.com/codacy/php-codacy-coverage", + "support": { + "issues": "https://github.com/codacy/php-codacy-coverage/issues", + "source": "https://github.com/codacy/php-codacy-coverage/tree/master" + }, + "abandoned": true, + "time": "2020-01-10T10:52:12+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", + "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", + "shasum": "" + }, + "require": { + "php": ">=5.3,<8.0-DEV" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "~4.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/master" + }, + "time": "2015-06-14T21:17:01+00:00" + }, + { + "name": "gitonomy/gitlib", + "version": "v1.0.4", + "source": { + "type": "git", + "url": "https://github.com/gitonomy/gitlib.git", + "reference": "932a960221ae3484a3e82553b3be478e56beb68d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/gitonomy/gitlib/zipball/932a960221ae3484a3e82553b3be478e56beb68d", + "reference": "932a960221ae3484a3e82553b3be478e56beb68d", + "shasum": "" + }, + "require": { + "php": "^5.3 || ^7.0", + "symfony/process": "^2.3|^3.0|^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35|^5.7", + "psr/log": "^1.0" + }, + "suggest": { + "psr/log": "Add some log" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Gitonomy\\Git\\": "src/Gitonomy/Git/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alexandre Salom茅", + "email": "alexandre.salome@gmail.com", + "homepage": "http://alexandre-salome.fr" + }, + { + "name": "Julien DIDIER", + "email": "genzo.wm@gmail.com", + "homepage": "http://www.jdidier.net" + } + ], + "description": "Library for accessing git", + "homepage": "http://gitonomy.com", + "support": { + "issues": "https://github.com/gitonomy/gitlib/issues", + "source": "https://github.com/gitonomy/gitlib/tree/master" + }, + "time": "2018-04-22T19:55:36+00:00" + }, + { + "name": "paragonie/sodium_compat", + "version": "v1.19.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/sodium_compat.git", + "reference": "cb15e403ecbe6a6cc515f855c310eb6b1872a933" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/sodium_compat/zipball/cb15e403ecbe6a6cc515f855c310eb6b1872a933", + "reference": "cb15e403ecbe6a6cc515f855c310eb6b1872a933", + "shasum": "" + }, + "require": { + "paragonie/random_compat": ">=1", + "php": "^5.2.4|^5.3|^5.4|^5.5|^5.6|^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" + }, + "suggest": { + "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", + "ext-sodium": "PHP >= 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security." + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "ISC" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com" + }, + { + "name": "Frank Denis", + "email": "jedisct1@pureftpd.org" + } + ], + "description": "Pure PHP implementation of libsodium; uses the PHP extension if it exists", + "keywords": [ + "Authentication", + "BLAKE2b", + "ChaCha20", + "ChaCha20-Poly1305", + "Chapoly", + "Curve25519", + "Ed25519", + "EdDSA", + "Edwards-curve Digital Signature Algorithm", + "Elliptic Curve Diffie-Hellman", + "Poly1305", + "Pure-PHP cryptography", + "RFC 7748", + "RFC 8032", + "Salpoly", + "Salsa20", + "X25519", + "XChaCha20-Poly1305", + "XSalsa20-Poly1305", + "Xchacha20", + "Xsalsa20", + "aead", + "cryptography", + "ecdh", + "elliptic curve", + "elliptic curve cryptography", + "encryption", + "libsodium", + "php", + "public-key cryptography", + "secret-key cryptography", + "side-channel resistant" + ], + "support": { + "issues": "https://github.com/paragonie/sodium_compat/issues", + "source": "https://github.com/paragonie/sodium_compat/tree/v1.19.0" + }, + "time": "2022-09-26T03:40:35+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" + }, + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "reference": "4aada1f93c72c35e22fb1383b47fee43b8f1d157", + "shasum": "" + }, + "require": { + "php": ">=5.5", + "phpdocumentor/reflection-common": "^1.0@dev", + "phpdocumentor/type-resolver": "^0.3.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^4.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/3.x" + }, + "time": "2017-08-08T06:39:58+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/fb3933512008d8162b3cdf9e18dba9309b7c3773", + "reference": "fb3933512008d8162b3cdf9e18dba9309b7c3773", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/master" + }, + "time": "2017-06-03T08:32:36+00:00" + }, + { + "name": "phpmyadmin/coding-standard", + "version": "0.3", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/coding-standard.git", + "reference": "5ae123e27140a1e16be005432e26a8233524eaf5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/coding-standard/zipball/5ae123e27140a1e16be005432e26a8233524eaf5", + "reference": "5ae123e27140a1e16be005432e26a8233524eaf5", + "shasum": "" + }, + "require": { + "squizlabs/php_codesniffer": "^3.0" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "phpMyAdmin PHP CodeSniffer Coding Standard", + "keywords": [ + "codesniffer", + "phpcs", + "phpmyadmin" + ], + "support": { + "issues": "https://github.com/phpmyadmin/coding-standard/issues", + "source": "https://github.com/phpmyadmin/coding-standard" + }, + "time": "2017-09-28T09:13:00+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "v1.10.3", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "451c3cd1418cf640de218914901e51b064abb093" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", + "reference": "451c3cd1418cf640de218914901e51b064abb093", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", + "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5 || ^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.10.x-dev" + } + }, + "autoload": { + "psr-4": { + "Prophecy\\": "src/Prophecy" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" + }, + "time": "2020-03-05T15:02:03+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "2.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "phpunit/php-file-iterator": "~1.3", + "phpunit/php-text-template": "~1.2", + "phpunit/php-token-stream": "~1.3", + "sebastian/environment": "^1.3.2", + "sebastian/version": "~1.0" + }, + "require-dev": { + "ext-xdebug": ">=2.1.4", + "phpunit/phpunit": "~4" + }, + "suggest": { + "ext-dom": "*", + "ext-xdebug": ">=2.2.1", + "ext-xmlwriter": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/2.2" + }, + "time": "2015-10-06T15:47:00+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" + }, + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" + }, + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/master" + }, + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "1.4.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", + "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", + "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4" + }, + "abandoned": true, + "time": "2017-12-04T08:55:13+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "4.8.36", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/46023de9a91eec7dfb06cc56cb4e260017298517", + "reference": "46023de9a91eec7dfb06cc56cb4e260017298517", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-spl": "*", + "php": ">=5.3.3", + "phpspec/prophecy": "^1.3.1", + "phpunit/php-code-coverage": "~2.1", + "phpunit/php-file-iterator": "~1.4", + "phpunit/php-text-template": "~1.2", + "phpunit/php-timer": "^1.0.6", + "phpunit/phpunit-mock-objects": "~2.3", + "sebastian/comparator": "~1.2.2", + "sebastian/diff": "~1.2", + "sebastian/environment": "~1.3", + "sebastian/exporter": "~1.2", + "sebastian/global-state": "~1.0", + "sebastian/version": "~1.0", + "symfony/yaml": "~2.1|~3.0" + }, + "suggest": { + "phpunit/php-invoker": "~1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.8.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "source": "https://github.com/sebastianbergmann/phpunit/tree/4.8.36" + }, + "time": "2017-06-21T08:07:12+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "2.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": ">=5.3.3", + "phpunit/php-text-template": "~1.2", + "sebastian/exporter": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", + "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/2.3" + }, + "abandoned": true, + "time": "2015-10-02T06:51:40+00:00" + }, + { + "name": "phpunit/phpunit-selenium", + "version": "1.4.2", + "source": { + "type": "git", + "url": "https://github.com/giorgiosironi/phpunit-selenium.git", + "reference": "c84dd7ca214563868ce216123b7ae9c792beb262" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/giorgiosironi/phpunit-selenium/zipball/c84dd7ca214563868ce216123b7ae9c792beb262", + "reference": "c84dd7ca214563868ce216123b7ae9c792beb262", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "ext-dom": "*", + "php": ">=5.3.3", + "phpunit/phpunit": "~3.7|~4.0", + "sebastian/comparator": "~1.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPUnit/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "include-path": [ + "" + ], + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + }, + { + "name": "Giorgio Sironi", + "email": "info@giorgiosironi.com", + "role": "developer" + } + ], + "description": "Selenium Server integration for PHPUnit", + "homepage": "http://www.phpunit.de/", + "keywords": [ + "selenium", + "testing", + "xunit" + ], + "support": { + "irc": "irc://irc.freenode.net/phpunit", + "issues": "https://github.com/sebastianbergmann/phpunit-selenium/issues", + "source": "https://github.com/giorgiosironi/phpunit-selenium/tree/1.4.2" + }, + "time": "2014-11-02T09:23:27+00:00" + }, + { + "name": "psr/log", + "version": "1.1.4", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "time": "2021-05-03T11:20:27+00:00" + }, + { + "name": "sebastian/comparator", + "version": "1.2.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/diff": "~1.2", + "sebastian/exporter": "~1.2 || ~2.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "http://www.github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" + }, + "time": "2017-01-29T09:50:25+00:00" + }, + { + "name": "sebastian/diff", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/1.4" + }, + "time": "2017-05-22T07:24:03+00:00" + }, + { + "name": "sebastian/environment", + "version": "1.3.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/1.3" + }, + "time": "2016-08-18T05:49:44+00:00" + }, + { + "name": "sebastian/exporter", + "version": "1.2.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/master" + }, + "time": "2016-06-17T09:04:28+00:00" + }, + { + "name": "sebastian/global-state", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", + "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" + }, + "time": "2015-10-12T03:26:01+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "reference": "b19cc3298482a335a95f3016d2f8a6950f0fbcd7", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" + }, + "time": "2016-10-03T07:41:43+00:00" + }, + { + "name": "sebastian/version", + "version": "1.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/1.0.6" + }, + "time": "2015-06-21T13:59:46+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.7.1", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", + "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2022-06-18T07:21:10+00:00" + }, + { + "name": "symfony/console", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "reference": "cbcf4b5e233af15cd2bbd50dee1ccc9b7927dc12", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/debug": "^2.7.2|~3.0.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "require-dev": { + "psr/log": "~1.0", + "symfony/event-dispatcher": "~2.1|~3.0.0", + "symfony/process": "~2.1|~3.0.0" + }, + "suggest": { + "psr/log-implementation": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/process": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Console Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/console/tree/v2.8.52" + }, + "time": "2018-11-20T15:55:20+00:00" + }, + { + "name": "symfony/debug", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/debug.git", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/debug/zipball/74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "reference": "74251c8d50dd3be7c4ce0c7b862497cdc641a5d0", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "psr/log": "~1.0" + }, + "conflict": { + "symfony/http-kernel": ">=2.3,<2.3.24|~2.4.0|>=2.5,<2.5.9|>=2.6,<2.6.2" + }, + "require-dev": { + "symfony/class-loader": "~2.2|~3.0.0", + "symfony/http-kernel": "~2.3.24|~2.5.9|^2.6.2|~3.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Debug\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Debug Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/debug/tree/v2.8.50" + }, + "abandoned": "symfony/error-handler", + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/process", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/c3591a09c78639822b0b290d44edb69bf9f05dc8", + "reference": "c3591a09c78639822b0b290d44edb69bf9f05dc8", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Process Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v2.8.50" + }, + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "symfony/yaml", + "version": "v2.8.52", + "source": { + "type": "git", + "url": "https://github.com/symfony/yaml.git", + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/yaml/zipball/02c1859112aa779d9ab394ae4f3381911d84052b", + "reference": "02c1859112aa779d9ab394ae4f3381911d84052b", + "shasum": "" + }, + "require": { + "php": ">=5.3.9", + "symfony/polyfill-ctype": "~1.8" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Yaml\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Yaml Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/yaml/tree/v2.8.52" + }, + "time": "2018-11-11T11:18:13+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.9.1", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", + "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0 || ^8.0", + "symfony/polyfill-ctype": "^1.8" + }, + "conflict": { + "phpstan/phpstan": "<0.12.20", + "vimeo/psalm": "<3.9.1" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^7.5.13" + }, + "type": "library", + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.9.1" + }, + "time": "2020-07-08T17:02:28+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": ">=5.5.0", + "ext-mysqli": "*", + "ext-xml": "*", + "ext-pcre": "*", + "ext-json": "*", + "ext-ctype": "*", + "ext-hash": "*" + }, + "platform-dev": [], + "platform-overrides": { + "php": "5.5" + }, + "plugin-api-version": "2.2.0" +} diff --git a/phpMyAdmin/config.sample.inc.php b/phpMyAdmin/config.sample.inc.php new file mode 100755 index 0000000..48dfdfd --- /dev/null +++ b/phpMyAdmin/config.sample.inc.php @@ -0,0 +1,161 @@ +. + * + * @package PhpMyAdmin + */ + +/** + * This is needed for cookie based authentication to encrypt password in + * cookie. Needs to be 32 chars long. + */ +$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ + +/** + * Servers configuration + */ +$i = 0; + +/** + * First server + */ +$i++; +/* Authentication type */ +$cfg['Servers'][$i]['auth_type'] = 'cookie'; +/* Server parameters */ +$cfg['Servers'][$i]['host'] = 'localhost'; +$cfg['Servers'][$i]['compress'] = false; +$cfg['Servers'][$i]['AllowNoPassword'] = false; + +/** + * phpMyAdmin configuration storage settings. + */ + +/* User used to manipulate with storage */ +// $cfg['Servers'][$i]['controlhost'] = ''; +// $cfg['Servers'][$i]['controlport'] = ''; +// $cfg['Servers'][$i]['controluser'] = 'pma'; +// $cfg['Servers'][$i]['controlpass'] = 'pmapass'; + +/* Storage database and tables */ +// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; +// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark'; +// $cfg['Servers'][$i]['relation'] = 'pma__relation'; +// $cfg['Servers'][$i]['table_info'] = 'pma__table_info'; +// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords'; +// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages'; +// $cfg['Servers'][$i]['column_info'] = 'pma__column_info'; +// $cfg['Servers'][$i]['history'] = 'pma__history'; +// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs'; +// $cfg['Servers'][$i]['tracking'] = 'pma__tracking'; +// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig'; +// $cfg['Servers'][$i]['recent'] = 'pma__recent'; +// $cfg['Servers'][$i]['favorite'] = 'pma__favorite'; +// $cfg['Servers'][$i]['users'] = 'pma__users'; +// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups'; +// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding'; +// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches'; +// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns'; +// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings'; +// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates'; + +/** + * End of servers configuration + */ + +/** + * Directories for saving/loading files from server + */ +$cfg['UploadDir'] = ''; +$cfg['SaveDir'] = ''; + +/** + * Whether to display icons or text or both icons and text in table row + * action segment. Value can be either of 'icons', 'text' or 'both'. + * default = 'both' + */ +//$cfg['RowActionType'] = 'icons'; + +/** + * Defines whether a user should be displayed a "show all (records)" + * button in browse mode or not. + * default = false + */ +//$cfg['ShowAll'] = true; + +/** + * Number of rows displayed when browsing a result set. If the result + * set contains more rows, "Previous" and "Next". + * Possible values: 25, 50, 100, 250, 500 + * default = 25 + */ +//$cfg['MaxRows'] = 50; + +/** + * Disallow editing of binary fields + * valid values are: + * false allow editing + * 'blob' allow editing except for BLOB fields + * 'noblob' disallow editing except for BLOB fields + * 'all' disallow editing + * default = 'blob' + */ +//$cfg['ProtectBinary'] = false; + +/** + * Default language to use, if not browser-defined or user-defined + * (you find all languages in the locale folder) + * uncomment the desired line: + * default = 'en' + */ +//$cfg['DefaultLang'] = 'en'; +//$cfg['DefaultLang'] = 'de'; + +/** + * How many columns should be used for table display of a database? + * (a value larger than 1 results in some information being hidden) + * default = 1 + */ +//$cfg['PropertiesNumColumns'] = 2; + +/** + * Set to true if you want DB-based query history.If false, this utilizes + * JS-routines to display query history (lost by window close) + * + * This requires configuration storage enabled, see above. + * default = false + */ +//$cfg['QueryHistoryDB'] = true; + +/** + * When using DB-based query history, how many entries should be kept? + * default = 25 + */ +//$cfg['QueryHistoryMax'] = 100; + +/** + * Whether or not to query the user before sending the error report to + * the phpMyAdmin team when a JavaScript error occurs + * + * Available options + * ('ask' | 'always' | 'never') + * default = 'ask' + */ +//$cfg['SendErrorReports'] = 'always'; + +/** + * 'URLQueryEncryption' defines whether phpMyAdmin will encrypt sensitive data from the URL query string. + * 'URLQueryEncryptionSecretKey' is a 32 bytes long secret key used to encrypt/decrypt the URL query string. + */ +//$cfg['URLQueryEncryption'] = true; +//$cfg['URLQueryEncryptionSecretKey'] = ''; + +/** + * You can find more configuration options in the documentation + * in the doc/ folder or at . + */ diff --git a/phpMyAdmin/db_central_columns.php b/phpMyAdmin/db_central_columns.php new file mode 100755 index 0000000..6eebb40 --- /dev/null +++ b/phpMyAdmin/db_central_columns.php @@ -0,0 +1,181 @@ +updateOneColumn( + $db, $orig_col_name, $col_name, $col_type, $col_attribute, + $col_length, $col_isNull, $collation, $col_extra, $col_default + ); + exit; + } else { + $tmp_msg = $centralColumns->updateOneColumn( + $db, "", $col_name, $col_type, $col_attribute, + $col_length, $col_isNull, $collation, $col_extra, $col_default + ); + } +} +if (isset($_POST['populateColumns'])) { + $selected_tbl = $_POST['selectedTable']; + echo $centralColumns->getHtmlForColumnDropdown( + $db, + $selected_tbl + ); + exit; +} +if (isset($_POST['getColumnList'])) { + echo $centralColumns->getListRaw( + $db, + $_POST['cur_table'] + ); + exit; +} +if (isset($_POST['add_column'])) { + $selected_col = array(); + $selected_tbl = $_POST['table-select']; + $selected_col[] = $_POST['column-select']; + $tmp_msg = $centralColumns->syncUniqueColumns( + $selected_col, + false, + $selected_tbl + ); +} +$response = Response::getInstance(); +$header = $response->getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('vendor/jquery/jquery.uitablefilter.js'); +$scripts->addFile('vendor/jquery/jquery.tablesorter.js'); +$scripts->addFile('db_central_columns.js'); +$cfgCentralColumns = $centralColumns->getParams(); +$pmadb = $cfgCentralColumns['db']; +$pmatable = $cfgCentralColumns['table']; +$max_rows = intval($GLOBALS['cfg']['MaxRows']); + +if (isset($_POST['edit_central_columns_page'])) { + $selected_fld = $_POST['selected_fld']; + $selected_db = $_POST['db']; + $edit_central_column_page = $centralColumns->getHtmlForEditingPage( + $selected_fld, + $selected_db + ); + $response->addHTML($edit_central_column_page); + exit; +} +if (isset($_POST['multi_edit_central_column_save'])) { + $message = $centralColumns->updateMultipleColumn(); + if (!is_bool($message)) { + $response->setRequestStatus(false); + $response->addJSON('message', $message); + } +} +if (isset($_POST['delete_save'])) { + $col_name = array(); + parse_str($_POST['col_name'], $col_name); + $tmp_msg = $centralColumns->deleteColumnsFromList( + $col_name['selected_fld'], + false + ); +} +if (!empty($_POST['total_rows']) + && Core::isValid($_POST['total_rows'], 'integer') +) { + $total_rows = $_POST['total_rows']; +} else { + $total_rows = $centralColumns->getCount($db); +} +if (Core::isValid($_POST['pos'], 'integer')) { + $pos = intval($_POST['pos']); +} else { + $pos = 0; +} +$addNewColumn = $centralColumns->getHtmlForAddNewColumn($db, $total_rows); +$response->addHTML($addNewColumn); +if ($total_rows <= 0) { + $response->addHTML( + '
' . __( + 'The central list of columns for the current database is empty.' + ) . '
' + ); + $columnAdd = $centralColumns->getHtmlForAddColumn($total_rows, $pos, $db); + $response->addHTML($columnAdd); + exit; +} +$table_navigation_html = $centralColumns->getHtmlForTableNavigation( + $total_rows, + $pos, + $db +); +$response->addHTML($table_navigation_html); +$columnAdd = $centralColumns->getHtmlForAddColumn($total_rows, $pos, $db); +$response->addHTML($columnAdd); +$deleteRowForm = '
' + . Url::getHiddenInputs( + $db + ) + . '' + . '' + . '
'; +$response->addHTML($deleteRowForm); +$table_struct = '
' + . '
' + . ''; +$response->addHTML($table_struct); +$tableheader = $centralColumns->getTableHeader( + 'column_heading', __('Click to sort.'), 2 +); +$response->addHTML($tableheader); +$result = $centralColumns->getColumnsList($db, $pos, $max_rows); +$row_num = 0; +foreach ($result as $row) { + $tableHtmlRow = $centralColumns->getHtmlForTableRow( + $row, + $row_num, + $db + ); + $response->addHTML($tableHtmlRow); + $row_num++; +} +$response->addHTML('
'); +$tablefooter = $centralColumns->getTableFooter($pmaThemeImage, $text_dir); +$response->addHTML($tablefooter); +$response->addHTML('
'); +$message = Message::success( + sprintf(__('Showing rows %1$s - %2$s.'), ($pos + 1), ($pos + count($result))) +); +if (isset($tmp_msg) && $tmp_msg !== true) { + $message = $tmp_msg; +} diff --git a/phpMyAdmin/db_datadict.php b/phpMyAdmin/db_datadict.php new file mode 100755 index 0000000..7a5d7f4 --- /dev/null +++ b/phpMyAdmin/db_datadict.php @@ -0,0 +1,215 @@ +getHeader(); +$header->enablePrintView(); + +$relation = new Relation(); + +/** + * Gets the relations settings + */ +$cfgRelation = $relation->getRelationsParam(); + +/** + * Check parameters + */ +PhpMyAdmin\Util::checkParameters(array('db')); + +/** + * Defines the url to return to in case of error in a sql statement + */ +$err_url = 'db_sql.php' . Url::getCommon(array('db' => $db)); + +if ($cfgRelation['commwork']) { + $comment = $relation->getDbComment($db); + + /** + * Displays DB comment + */ + if ($comment) { + echo '

' , __('Database comment') + , '
' , htmlspecialchars($comment) , '

'; + } // end if +} + +/** + * Selects the database and gets tables names + */ +$GLOBALS['dbi']->selectDb($db); +$tables = $GLOBALS['dbi']->getTables($db); + +$count = 0; +foreach ($tables as $table) { + $comments = $relation->getComments($db, $table); + + echo '
' , "\n"; + + echo '

' , htmlspecialchars($table) , '

' , "\n"; + + /** + * Gets table information + */ + $show_comment = $GLOBALS['dbi']->getTable($db, $table) + ->getStatusInfo('TABLE_COMMENT'); + + /** + * Gets table keys and retains them + */ + $GLOBALS['dbi']->selectDb($db); + $indexes = $GLOBALS['dbi']->getTableIndexes($db, $table); + list($primary, $pk_array, $indexes_info, $indexes_data) + = PhpMyAdmin\Util::processIndexData($indexes); + + /** + * Gets columns properties + */ + $columns = $GLOBALS['dbi']->getColumns($db, $table); + + // Check if we can use Relations + list($res_rel, $have_rel) = $relation->getRelationsAndStatus( + ! empty($cfgRelation['relation']), $db, $table + ); + + /** + * Displays the comments of the table if MySQL >= 3.23 + */ + if (!empty($show_comment)) { + echo __('Table comments:') , ' '; + echo htmlspecialchars($show_comment) , '

'; + } + + /** + * Displays the table structure + */ + + echo ''; + echo ''; + echo ''; + echo ''; + echo ''; + if ($have_rel) { + echo ' ' , "\n"; + } + echo ' ' , "\n"; + if ($cfgRelation['mimework']) { + echo ' ' , "\n"; + } + echo ''; + foreach ($columns as $row) { + + if ($row['Null'] == '') { + $row['Null'] = 'NO'; + } + $extracted_columnspec + = PhpMyAdmin\Util::extractColumnSpec($row['Type']); + + // reformat mysql query output + // set or enum types: slashes single quotes inside options + + $type = htmlspecialchars($extracted_columnspec['print_type']); + $attribute = $extracted_columnspec['attribute']; + if (! isset($row['Default'])) { + if ($row['Null'] != 'NO') { + $row['Default'] = 'NULL'; + } + } else { + $row['Default'] = htmlspecialchars($row['Default']); + } + $column_name = $row['Field']; + + echo ''; + echo ''; + echo '' , $type , ''; + + echo ''; + echo ''; + + if ($have_rel) { + echo ' ' , "\n"; + } + echo ' ' , "\n"; + if ($cfgRelation['mimework']) { + $mime_map = Transformations::getMIME($db, $table, true); + + echo ' ' , "\n"; + } + echo ''; + } // end foreach + $count++; + echo '
' , __('Column') , '' , __('Type') , '' , __('Null') , '' , __('Default') , '' , __('Links to') , '' , __('Comments') , 'MIME
'; + echo htmlspecialchars($column_name); + + if (isset($pk_array[$row['Field']])) { + echo ' (' , __('Primary') , ')'; + } + echo ''; + echo (($row['Null'] == 'NO') ? __('No') : __('Yes')); + echo ''; + if (isset($row['Default'])) { + echo $row['Default']; + } + echo ''; + if ($foreigner = $relation->searchColumnInForeigners($res_rel, $column_name)) { + echo htmlspecialchars( + $foreigner['foreign_table'] + . ' -> ' + . $foreigner['foreign_field'] + ); + } + echo ''; + if (isset($comments[$column_name])) { + echo htmlspecialchars($comments[$column_name]); + } + echo ''; + if (isset($mime_map[$column_name])) { + echo htmlspecialchars( + str_replace('_', '/', $mime_map[$column_name]['mimetype']) + ); + } + echo '
'; + // display indexes information + if (count(PhpMyAdmin\Index::getFromTable($table, $db)) > 0) { + echo PhpMyAdmin\Index::getHtmlForIndexes($table, $db, true); + } + echo '
'; +} //ends main while + +/** + * Displays the footer + */ +echo PhpMyAdmin\Util::getButton(); diff --git a/phpMyAdmin/db_designer.php b/phpMyAdmin/db_designer.php new file mode 100755 index 0000000..ded0e0b --- /dev/null +++ b/phpMyAdmin/db_designer.php @@ -0,0 +1,234 @@ +getHtmlForEditOrDeletePages($_POST['db'], 'editPage'); + } elseif ($_POST['dialog'] == 'delete') { + $html = $databaseDesigner->getHtmlForEditOrDeletePages($_POST['db'], 'deletePage'); + } elseif ($_POST['dialog'] == 'save_as') { + $html = $databaseDesigner->getHtmlForPageSaveAs($_POST['db']); + } elseif ($_POST['dialog'] == 'export') { + $html = $databaseDesigner->getHtmlForSchemaExport( + $_POST['db'], $_POST['selected_page'] + ); + } elseif ($_POST['dialog'] == 'add_table') { + // Pass the db and table to the getTablesInfo so we only have the table we asked for + $script_display_field = $designerCommon->getTablesInfo($_POST['db'], $_POST['table']); + $tab_column = $designerCommon->getColumnsInfo($script_display_field); + $tables_all_keys = $designerCommon->getAllKeys($script_display_field); + $tables_pk_or_unique_keys = $designerCommon->getPkOrUniqueKeys($script_display_field); + + $html = $databaseDesigner->getDatabaseTables( + $_POST['db'], + $script_display_field, + array(), -1, $tab_column, + $tables_all_keys, $tables_pk_or_unique_keys + ); + } + + if (! empty($html)) { + $response->addHTML($html); + } + return; +} + +if (isset($_POST['operation'])) { + + if ($_POST['operation'] == 'deletePage') { + $success = $designerCommon->deletePage($_POST['selected_page']); + $response->setRequestStatus($success); + } elseif ($_POST['operation'] == 'savePage') { + if ($_POST['save_page'] == 'same') { + $page = $_POST['selected_page']; + } else { // new + $page = $designerCommon->createNewPage($_POST['selected_value'], $_POST['db']); + $response->addJSON('id', $page); + } + $success = $designerCommon->saveTablePositions($page); + $response->setRequestStatus($success); + } elseif ($_POST['operation'] == 'setDisplayField') { + list( + $success, + $message, + ) = $designerCommon->saveDisplayField( + $_POST['db'], + $_POST['table'], + $_POST['field'] + ); + $response->setRequestStatus($success); + $response->addJSON('message', $message); + } elseif ($_POST['operation'] == 'addNewRelation') { + list($success, $message) = $designerCommon->addNewRelation( + $_POST['db'], + $_POST['T1'], + $_POST['F1'], + $_POST['T2'], + $_POST['F2'], + $_POST['on_delete'], + $_POST['on_update'], + $_POST['DB1'], + $_POST['DB2'] + ); + $response->setRequestStatus($success); + $response->addJSON('message', $message); + } elseif ($_POST['operation'] == 'removeRelation') { + list($success, $message) = $designerCommon->removeRelation( + $_POST['T1'], + $_POST['F1'], + $_POST['T2'], + $_POST['F2'] + ); + $response->setRequestStatus($success); + $response->addJSON('message', $message); + } elseif ($_POST['operation'] == 'save_setting_value') { + $success = $designerCommon->saveSetting($_POST['index'], $_POST['value']); + $response->setRequestStatus($success); + } + + return; +} + +require 'libraries/db_common.inc.php'; + +$script_display_field = $designerCommon->getTablesInfo(); + +$display_page = -1; +$selected_page = null; + +if (isset($_GET['query'])) { + $display_page = $designerCommon->getDefaultPage($_GET['db']); +} else { + if (! empty($_GET['page'])) { + $display_page = $_GET['page']; + } else { + $display_page = $designerCommon->getLoadingPage($_GET['db']); + } +} +if ($display_page != -1) { + $selected_page = $designerCommon->getPageName($display_page); +} +$tab_pos = $designerCommon->getTablePositions($display_page); + +$fullTableNames = []; + +foreach($script_display_field as $designerTable) { + $fullTableNames[] = $designerTable->getDbTableString(); +} + +foreach($tab_pos as $position) { + if (! in_array($position['dbName'] . '.' . $position['tableName'], $fullTableNames)) { + foreach($designerCommon->getTablesInfo($position['dbName'], $position['tableName']) as $designerTable) { + $script_display_field[] = $designerTable; + } + } +} + + +$tab_column = $designerCommon->getColumnsInfo($script_display_field); +$script_tables = $designerCommon->getScriptTabs($script_display_field); +$tables_pk_or_unique_keys = $designerCommon->getPkOrUniqueKeys($script_display_field); +$tables_all_keys = $designerCommon->getAllKeys($script_display_field); +$classes_side_menu = $databaseDesigner->returnClassNamesFromMenuButtons(); + + +$script_contr = $designerCommon->getScriptContr($script_display_field); + +$params = array('lang' => $GLOBALS['lang']); +if (isset($_GET['db'])) { + $params['db'] = $_GET['db']; +} + +$response = Response::getInstance(); +$response->getFooter()->setMinimal(); +$header = $response->getHeader(); +$header->setBodyId('designer_body'); + +$scripts = $header->getScripts(); +$scripts->addFile('vendor/jquery/jquery.fullscreen.js'); +$scripts->addFile('designer/database.js'); +$scripts->addFile('designer/objects.js'); +$scripts->addFile('designer/page.js'); +$scripts->addFile('designer/history.js'); +$scripts->addFile('designer/move.js'); +$scripts->addFile('designer/init.js'); + +list( + $tables, + $num_tables, + $total_num_tables, + $sub_part, + $is_show_stats, + $db_is_system_schema, + $tooltip_truename, + $tooltip_aliasname, + $pos +) = PhpMyAdmin\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); + +// Embed some data into HTML, later it will be read +// by designer/init.js and converted to JS variables. +$response->addHTML( + $databaseDesigner->getHtmlForJsFields( + $script_tables, $script_contr, $script_display_field, $display_page + ) +); +$response->addHTML( + $databaseDesigner->getPageMenu( + isset($_GET['query']), + $selected_page, + $classes_side_menu + ) +); + + + +$response->addHTML('
'); +$response->addHTML( + '
' +); + +$response->addHTML($databaseDesigner->getHtmlCanvas()); +$response->addHTML($databaseDesigner->getHtmlTableList()); + +$response->addHTML( + $databaseDesigner->getDatabaseTables( + $_GET['db'], + $script_display_field, + $tab_pos, $display_page, $tab_column, + $tables_all_keys, $tables_pk_or_unique_keys + ) +); +$response->addHTML('
'); +$response->addHTML('
'); // end canvas_outer + +$response->addHTML('
'); + +$response->addHTML($databaseDesigner->getNewRelationPanel()); +$response->addHTML($databaseDesigner->getDeleteRelationPanel()); + +if (isset($_GET['query'])) { + $response->addHTML($databaseDesigner->getOptionsPanel()); + $response->addHTML($databaseDesigner->getRenameToPanel()); + $response->addHTML($databaseDesigner->getHavingQueryPanel()); + $response->addHTML($databaseDesigner->getAggregateQueryPanel()); + $response->addHTML($databaseDesigner->getWhereQueryPanel()); + $response->addHTML($databaseDesigner->getQueryDetails($_GET['db'])); +} + +$response->addHTML('
'); diff --git a/phpMyAdmin/db_events.php b/phpMyAdmin/db_events.php new file mode 100755 index 0000000..e13935f --- /dev/null +++ b/phpMyAdmin/db_events.php @@ -0,0 +1,18 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('export.js'); + +// $sub_part is used in Util::getDbInfo() to see if we are coming from +// db_export.php, in which case we don't obey $cfg['MaxTableList'] +$sub_part = '_export'; +require_once 'libraries/db_common.inc.php'; +$url_query .= '&goto=db_export.php'; + +list( + $tables, + $num_tables, + $total_num_tables, + $sub_part, + $is_show_stats, + $db_is_system_schema, + $tooltip_truename, + $tooltip_aliasname, + $pos +) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); + +/** + * Displays the form + */ +$export_page_title = __('View dump (schema) of database'); + +// exit if no tables in db found +if ($num_tables < 1) { + $response->addHTML( + Message::error(__('No tables found in database.'))->getDisplay() + ); + exit; +} // end if + +$multi_values = '
'; +if (isset($_POST['structure_or_data_forced'])) { + $force_val = htmlspecialchars($_POST['structure_or_data_forced']); +} else { + $force_val = 0; +} +$multi_values .= ''; +$multi_values .= '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . ''; +$multi_values .= "\n"; + +// when called by libraries/mult_submits.inc.php +if (!empty($_POST['selected_tbl']) && empty($table_select)) { + $table_select = $_POST['selected_tbl']; +} + +foreach ($tables as $each_table) { + if (isset($_POST['table_select']) && is_array($_POST['table_select'])) { + $is_checked = Export::getCheckedClause( + $each_table['Name'], $_POST['table_select'] + ); + } elseif (isset($table_select)) { + $is_checked = Export::getCheckedClause( + $each_table['Name'], $table_select + ); + } else { + $is_checked = ' checked="checked"'; + } + if (isset($_POST['table_structure']) && is_array($_POST['table_structure'])) { + $structure_checked = Export::getCheckedClause( + $each_table['Name'], $_POST['table_structure'] + ); + } else { + $structure_checked = $is_checked; + } + if (isset($_POST['table_data']) && is_array($_POST['table_data'])) { + $data_checked = Export::getCheckedClause( + $each_table['Name'], $_POST['table_data'] + ); + } else { + $data_checked = $is_checked; + } + $table_html = htmlspecialchars($each_table['Name']); + $multi_values .= ''; + $multi_values .= ''; + $multi_values .= ''; + $multi_values .= ''; + $multi_values .= ''; + $multi_values .= ''; +} // end for + +$multi_values .= "\n"; +$multi_values .= '
' . __('Tables') . '' . __('Structure') . '' . __('Data') . '
' . __('Select all') . '' + . '' + . '
' + . str_replace(' ', ' ', $table_html) . '' + . '' + . '
'; + +if (! isset($sql_query)) { + $sql_query = ''; +} +if (! isset($num_tables)) { + $num_tables = 0; +} +if (! isset($unlim_num_rows)) { + $unlim_num_rows = 0; +} +if (! isset($multi_values)) { + $multi_values = ''; +} +$response = Response::getInstance(); +$displayExport = new DisplayExport(); +$response->addHTML( + $displayExport->getDisplay( + 'database', $db, $table, $sql_query, $num_tables, + $unlim_num_rows, $multi_values + ) +); diff --git a/phpMyAdmin/db_import.php b/phpMyAdmin/db_import.php new file mode 100755 index 0000000..0ec1d49 --- /dev/null +++ b/phpMyAdmin/db_import.php @@ -0,0 +1,44 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('import.js'); + +/** + * Gets tables information and displays top links + */ +require 'libraries/db_common.inc.php'; + +list( + $tables, + $num_tables, + $total_num_tables, + $sub_part, + $is_show_stats, + $db_is_system_schema, + $tooltip_truename, + $tooltip_aliasname, + $pos +) = PhpMyAdmin\Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); + +$response = Response::getInstance(); +$response->addHTML( + Import::get( + 'database', $db, $table, $max_upload_size + ) +); diff --git a/phpMyAdmin/db_multi_table_query.php b/phpMyAdmin/db_multi_table_query.php new file mode 100755 index 0000000..e30f15d --- /dev/null +++ b/phpMyAdmin/db_multi_table_query.php @@ -0,0 +1,38 @@ +getForeignKeyConstrains( + $_REQUEST['db'], + $_GET['tables'] + ); + $response = Response::getInstance(); + $response->addJSON('foreignKeyConstrains',$constrains); +} else { + $response = Response::getInstance(); + + $header = $response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('vendor/jquery/jquery.md5.js'); + $scripts->addFile('db_multi_table_query.js'); + $scripts->addFile('db_query_generator.js'); + + $queryInstance = new MultiTableQuery($GLOBALS['dbi'], $db); + + $response->addHTML($queryInstance->getFormHtml()); +} diff --git a/phpMyAdmin/db_operations.php b/phpMyAdmin/db_operations.php new file mode 100755 index 0000000..c5e9978 --- /dev/null +++ b/phpMyAdmin/db_operations.php @@ -0,0 +1,308 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('db_operations.js'); + +$sql_query = ''; + +$operations = new Operations(); + +/** + * Rename/move or copy database + */ +if (strlen($GLOBALS['db']) > 0 + && (! empty($_POST['db_rename']) || ! empty($_POST['db_copy'])) +) { + if (! empty($_POST['db_rename'])) { + $move = true; + } else { + $move = false; + } + + if (! isset($_POST['newname']) || strlen($_POST['newname']) === 0) { + $message = Message::error(__('The database name is empty!')); + } else { + // lower_case_table_names=1 `DB` becomes `db` + if ($GLOBALS['dbi']->getLowerCaseNames() === '1') { + $_POST['newname'] = mb_strtolower( + $_POST['newname'] + ); + } + + if ($_POST['newname'] === $_REQUEST['db']) { + $message = Message::error( + __('Cannot copy database to the same name. Change the name and try again.') + ); + } else { + $_error = false; + if ($move || ! empty($_POST['create_database_before_copying'])) { + $operations->createDbBeforeCopy(); + } + + // here I don't use DELIMITER because it's not part of the + // language; I have to send each statement one by one + + // to avoid selecting alternatively the current and new db + // we would need to modify the CREATE definitions to qualify + // the db name + $operations->runProcedureAndFunctionDefinitions($GLOBALS['db']); + + // go back to current db, just in case + $GLOBALS['dbi']->selectDb($GLOBALS['db']); + + $tables_full = $GLOBALS['dbi']->getTablesFull($GLOBALS['db']); + + // remove all foreign key constraints, otherwise we can get errors + /* @var $export_sql_plugin ExportSql */ + $export_sql_plugin = Plugins::getPlugin( + "export", + "sql", + 'libraries/classes/Plugins/Export/', + array( + 'single_table' => isset($single_table), + 'export_type' => 'database' + ) + ); + + // create stand-in tables for views + $views = $operations->getViewsAndCreateSqlViewStandIn( + $tables_full, $export_sql_plugin, $GLOBALS['db'] + ); + + // copy tables + $sqlConstratints = $operations->copyTables( + $tables_full, $move, $GLOBALS['db'] + ); + + // handle the views + if (! $_error) { + $operations->handleTheViews($views, $move, $GLOBALS['db']); + } + unset($views); + + // now that all tables exist, create all the accumulated constraints + if (! $_error && count($sqlConstratints) > 0) { + $operations->createAllAccumulatedConstraints($sqlConstratints); + } + unset($sqlConstratints); + + if ($GLOBALS['dbi']->getVersion() >= 50100) { + // here DELIMITER is not used because it's not part of the + // language; each statement is sent one by one + + $operations->runEventDefinitionsForDb($GLOBALS['db']); + } + + // go back to current db, just in case + $GLOBALS['dbi']->selectDb($GLOBALS['db']); + + // Duplicate the bookmarks for this db (done once for each db) + $operations->duplicateBookmarks($_error, $GLOBALS['db']); + + if (! $_error && $move) { + if (isset($_POST['adjust_privileges']) + && ! empty($_POST['adjust_privileges']) + ) { + $operations->adjustPrivilegesMoveDb($GLOBALS['db'], $_POST['newname']); + } + + /** + * cleanup pmadb stuff for this db + */ + RelationCleanup::database($GLOBALS['db']); + + // if someday the RENAME DATABASE reappears, do not DROP + $local_query = 'DROP DATABASE ' + . Util::backquote($GLOBALS['db']) . ';'; + $sql_query .= "\n" . $local_query; + $GLOBALS['dbi']->query($local_query); + + $message = Message::success( + __('Database %1$s has been renamed to %2$s.') + ); + $message->addParam($GLOBALS['db']); + $message->addParam($_POST['newname']); + } elseif (! $_error) { + if (isset($_POST['adjust_privileges']) + && ! empty($_POST['adjust_privileges']) + ) { + $operations->adjustPrivilegesCopyDb($GLOBALS['db'], $_POST['newname']); + } + + $message = Message::success( + __('Database %1$s has been copied to %2$s.') + ); + $message->addParam($GLOBALS['db']); + $message->addParam($_POST['newname']); + } else { + $message = Message::error(); + } + $reload = true; + + /* Change database to be used */ + if (! $_error && $move) { + $GLOBALS['db'] = $_POST['newname']; + } elseif (! $_error) { + if (isset($_POST['switch_to_new']) + && $_POST['switch_to_new'] == 'true' + ) { + $_SESSION['pma_switch_to_new'] = true; + $GLOBALS['db'] = $_POST['newname']; + } else { + $_SESSION['pma_switch_to_new'] = false; + } + } + } + } + + /** + * Database has been successfully renamed/moved. If in an Ajax request, + * generate the output with {@link PhpMyAdmin\Response} and exit + */ + if ($response->isAjax()) { + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('message', $message); + $response->addJSON('newname', $_POST['newname']); + $response->addJSON( + 'sql_query', + Util::getMessage(null, $sql_query) + ); + $response->addJSON('db', $GLOBALS['db']); + exit; + } +} + +/** + * Settings for relations stuff + */ +$relation = new Relation(); + +$cfgRelation = $relation->getRelationsParam(); + +/** + * Check if comments were updated + * (must be done before displaying the menu tabs) + */ +if (isset($_POST['comment'])) { + $relation->setDbComment($GLOBALS['db'], $_POST['comment']); +} + +require 'libraries/db_common.inc.php'; +$url_query .= '&goto=db_operations.php'; + +// Gets the database structure +$sub_part = '_structure'; + +list( + $tables, + $num_tables, + $total_num_tables, + $sub_part, + $is_show_stats, + $db_is_system_schema, + $tooltip_truename, + $tooltip_aliasname, + $pos +) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); + +echo "\n"; + +if (isset($message)) { + echo Util::getMessage($message, $sql_query); + unset($message); +} + +$db_collation = $GLOBALS['dbi']->getDbCollation($GLOBALS['db']); +$is_information_schema = $GLOBALS['dbi']->isSystemSchema($GLOBALS['db']); + +if (!$is_information_schema) { + if ($cfgRelation['commwork']) { + /** + * database comment + */ + $response->addHTML($operations->getHtmlForDatabaseComment($GLOBALS['db'])); + } + + $response->addHTML('
'); + $response->addHTML(CreateTable::getHtml($db)); + $response->addHTML('
'); + + /** + * rename database + */ + if ($GLOBALS['db'] != 'mysql') { + $response->addHTML($operations->getHtmlForRenameDatabase($GLOBALS['db'], $db_collation)); + } + + // Drop link if allowed + // Don't even try to drop information_schema. + // You won't be able to. Believe me. You won't. + // Don't allow to easily drop mysql database, RFE #1327514. + if (($GLOBALS['dbi']->isSuperuser() || $GLOBALS['cfg']['AllowUserDropDatabase']) + && ! $db_is_system_schema + && $GLOBALS['db'] != 'mysql' + ) { + $response->addHTML($operations->getHtmlForDropDatabaseLink($GLOBALS['db'])); + } + /** + * Copy database + */ + $response->addHTML($operations->getHtmlForCopyDatabase($GLOBALS['db'], $db_collation)); + + /** + * Change database charset + */ + $response->addHTML($operations->getHtmlForChangeDatabaseCharset($GLOBALS['db'], $db_collation)); + + if (! $cfgRelation['allworks'] + && $cfg['PmaNoRelation_DisableWarning'] == false + ) { + $message = Message::notice( + __( + 'The phpMyAdmin configuration storage has been deactivated. ' . + '%sFind out why%s.' + ) + ); + $message->addParamHtml(''); + $message->addParamHtml(''); + /* Show error if user has configured something, notice elsewhere */ + if (!empty($cfg['Servers'][$server]['pmadb'])) { + $message->isError(true); + } + } // end if +} // end if (!$is_information_schema) diff --git a/phpMyAdmin/db_qbe.php b/phpMyAdmin/db_qbe.php new file mode 100755 index 0000000..e252687 --- /dev/null +++ b/phpMyAdmin/db_qbe.php @@ -0,0 +1,178 @@ +getRelationsParam(); + +$savedSearchList = array(); +$savedSearch = null; +$currentSearchId = null; +if ($cfgRelation['savedsearcheswork']) { + $header = $response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('db_qbe.js'); + + //Get saved search list. + $savedSearch = new SavedSearches($GLOBALS); + $savedSearch->setUsername($GLOBALS['cfg']['Server']['user']) + ->setDbname($GLOBALS['db']); + + if (!empty($_POST['searchId'])) { + $savedSearch->setId($_POST['searchId']); + } + + //Action field is sent. + if (isset($_POST['action'])) { + $savedSearch->setSearchName($_POST['searchName']); + if ('create' === $_POST['action']) { + $saveResult = $savedSearch->setId(null) + ->setCriterias($_POST) + ->save(); + } elseif ('update' === $_POST['action']) { + $saveResult = $savedSearch->setCriterias($_POST) + ->save(); + } elseif ('delete' === $_POST['action']) { + $deleteResult = $savedSearch->delete(); + //After deletion, reset search. + $savedSearch = new SavedSearches($GLOBALS); + $savedSearch->setUsername($GLOBALS['cfg']['Server']['user']) + ->setDbname($GLOBALS['db']); + $_POST = array(); + } elseif ('load' === $_POST['action']) { + if (empty($_POST['searchId'])) { + //when not loading a search, reset the object. + $savedSearch = new SavedSearches($GLOBALS); + $savedSearch->setUsername($GLOBALS['cfg']['Server']['user']) + ->setDbname($GLOBALS['db']); + $_POST = array(); + } else { + $loadResult = $savedSearch->load(); + } + } + //Else, it's an "update query" + } + + $savedSearchList = $savedSearch->getList(); + $currentSearchId = $savedSearch->getId(); +} + +/** + * A query has been submitted -> (maybe) execute it + */ +$message_to_display = false; +if (isset($_POST['submit_sql']) && ! empty($sql_query)) { + if (! preg_match('@^SELECT@i', $sql_query)) { + $message_to_display = true; + } else { + $goto = 'db_sql.php'; + $sql = new Sql(); + $sql->executeQueryAndSendQueryResponse( + null, // analyzed_sql_results + false, // is_gotofile + $_POST['db'], // db + null, // table + false, // find_real_end + null, // sql_query_for_bookmark + null, // extra_data + null, // message_to_show + null, // message + null, // sql_data + $goto, // goto + $pmaThemeImage, // pmaThemeImage + null, // disp_query + null, // disp_message + null, // query_type + $sql_query, // sql_query + null, // selectedTables + null // complete_query + ); + } +} + +$sub_part = '_qbe'; +require 'libraries/db_common.inc.php'; +$url_query .= '&goto=db_qbe.php'; +$url_params['goto'] = 'db_qbe.php'; + +list( + $tables, + $num_tables, + $total_num_tables, + $sub_part, + $is_show_stats, + $db_is_system_schema, + $tooltip_truename, + $tooltip_aliasname, + $pos +) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); + +if ($message_to_display) { + Message::error( + __('You have to choose at least one column to display!') + ) + ->display(); +} +unset($message_to_display); + +// create new qbe search instance +$db_qbe = new Qbe($GLOBALS['db'], $savedSearchList, $savedSearch); + +$secondaryTabs = [ + 'multi' => [ + 'link' => 'db_multi_table_query.php', + 'text' => __('Multi-table query'), + ], + 'qbe' => [ + 'link' => 'db_qbe.php', + 'text' => __('Query by example'), + ], +]; +$response->addHTML( + Template::get('secondary_tabs')->render([ + 'url_params' => $url_params, + 'sub_tabs' => $secondaryTabs, + ]) +); + +$url = 'db_designer.php' . Url::getCommon( + array_merge( + $url_params, + array('query' => 1) + ) +); +$response->addHTML( + Message::notice( + sprintf( + __('Switch to %svisual builder%s'), + '', + '' + ) + ) +); + +/** + * Displays the Query by example form + */ +$response->addHTML($db_qbe->getSelectionForm()); diff --git a/phpMyAdmin/db_routines.php b/phpMyAdmin/db_routines.php new file mode 100755 index 0000000..5740c35 --- /dev/null +++ b/phpMyAdmin/db_routines.php @@ -0,0 +1,23 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('db_search.js'); +$scripts->addFile('sql.js'); +$scripts->addFile('makegrid.js'); + +require 'libraries/db_common.inc.php'; + +// If config variable $GLOBALS['cfg']['UseDbSearch'] is on false : exit. +if (! $GLOBALS['cfg']['UseDbSearch']) { + Util::mysqlDie( + __('Access denied!'), '', false, $err_url + ); +} // end if +$url_query .= '&goto=db_search.php'; +$url_params['goto'] = 'db_search.php'; + +// Create a database search instance +$db_search = new Search($GLOBALS['db']); + +// Display top links if we are not in an Ajax request +if (! $response->isAjax()) { + list( + $tables, + $num_tables, + $total_num_tables, + $sub_part, + $is_show_stats, + $db_is_system_schema, + $tooltip_truename, + $tooltip_aliasname, + $pos + ) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); +} + +// Main search form has been submitted, get results +if (isset($_POST['submit_search'])) { + $response->addHTML($db_search->getSearchResults()); +} + +// If we are in an Ajax request, we need to exit after displaying all the HTML +if ($response->isAjax() && empty($_REQUEST['ajax_page_request'])) { + exit; +} + +// Display the search form +$response->addHTML($db_search->getSelectionForm()); +$response->addHTML('
'); +$response->addHTML( + '
' +); +$response->addHTML('
'); +$response->addHTML($db_search->getResultDivs()); diff --git a/phpMyAdmin/db_sql.php b/phpMyAdmin/db_sql.php new file mode 100755 index 0000000..aa4d0b3 --- /dev/null +++ b/phpMyAdmin/db_sql.php @@ -0,0 +1,46 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('makegrid.js'); +$scripts->addFile('vendor/jquery/jquery.uitablefilter.js'); +$scripts->addFile('sql.js'); + +require 'libraries/db_common.inc.php'; + +// After a syntax error, we return to this script +// with the typed query in the textarea. +$goto = 'db_sql.php'; +$back = 'db_sql.php'; + +/** + * Query box, bookmark, insert data from textfile + */ +$response->addHTML( + SqlQueryForm::getHtml( + true, false, + isset($_POST['delimiter']) + ? htmlspecialchars($_POST['delimiter']) + : ';' + ) +); diff --git a/phpMyAdmin/db_sql_autocomplete.php b/phpMyAdmin/db_sql_autocomplete.php new file mode 100755 index 0000000..0fe4ae6 --- /dev/null +++ b/phpMyAdmin/db_sql_autocomplete.php @@ -0,0 +1,27 @@ +getTables($db); + foreach ($tableNames as $tableName) { + $sql_autocomplete[$tableName] = $GLOBALS['dbi']->getColumns( + $db, $tableName + ); + } + } +} else { + $sql_autocomplete = true; +} +$response = Response::getInstance(); +$response->addJSON("tables", json_encode($sql_autocomplete)); diff --git a/phpMyAdmin/db_sql_format.php b/phpMyAdmin/db_sql_format.php new file mode 100755 index 0000000..dd3c2b8 --- /dev/null +++ b/phpMyAdmin/db_sql_format.php @@ -0,0 +1,21 @@ +addJSON("sql", $query); diff --git a/phpMyAdmin/db_structure.php b/phpMyAdmin/db_structure.php new file mode 100755 index 0000000..09c4aee --- /dev/null +++ b/phpMyAdmin/db_structure.php @@ -0,0 +1,38 @@ +factory( + 'PhpMyAdmin\Controllers\Database\DatabaseStructureController' +); +$container->alias( + 'DatabaseStructureController', + 'PhpMyAdmin\Controllers\Database\DatabaseStructureController' +); +$container->set('PhpMyAdmin\Response', Response::getInstance()); +$container->alias('response', 'PhpMyAdmin\Response'); + +/* Define dependencies for the concerned controller */ +$dependency_definitions = array( + 'db' => $db, +); + +/** @var DatabaseStructureController $controller */ +$controller = $container->get( + 'DatabaseStructureController', + $dependency_definitions +); +$controller->indexAction(); diff --git a/phpMyAdmin/db_tracking.php b/phpMyAdmin/db_tracking.php new file mode 100755 index 0000000..49e4048 --- /dev/null +++ b/phpMyAdmin/db_tracking.php @@ -0,0 +1,154 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('vendor/jquery/jquery.tablesorter.js'); +$scripts->addFile('db_tracking.js'); + +/** + * If we are not in an Ajax request, then do the common work and show the links etc. + */ +require 'libraries/db_common.inc.php'; +$url_query .= '&goto=tbl_tracking.php&back=db_tracking.php'; +$url_params['goto'] = 'tbl_tracking.php'; +$url_params['back'] = 'db_tracking.php'; + +// Get the database structure +$sub_part = '_structure'; + +list( + $tables, + $num_tables, + $total_num_tables, + $sub_part, + $is_show_stats, + $db_is_system_schema, + $tooltip_truename, + $tooltip_aliasname, + $pos +) = Util::getDbInfo($db, isset($sub_part) ? $sub_part : ''); + +if (isset($_POST['delete_tracking']) && isset($_POST['table'])) { + + Tracker::deleteTracking($GLOBALS['db'], $_POST['table']); + Message::success( + __('Tracking data deleted successfully.') + )->display(); + +} elseif (isset($_POST['submit_create_version'])) { + + Tracking::createTrackingForMultipleTables($_POST['selected']); + Message::success( + sprintf( + __( + 'Version %1$s was created for selected tables,' + . ' tracking is active for them.' + ), + htmlspecialchars($_POST['version']) + ) + )->display(); + +} elseif (isset($_POST['submit_mult'])) { + + if (! empty($_POST['selected_tbl'])) { + if ($_POST['submit_mult'] == 'delete_tracking') { + + foreach ($_POST['selected_tbl'] as $table) { + Tracker::deleteTracking($GLOBALS['db'], $table); + } + Message::success( + __('Tracking data deleted successfully.') + )->display(); + + } elseif ($_POST['submit_mult'] == 'track') { + + echo Tracking::getHtmlForDataDefinitionAndManipulationStatements( + 'db_tracking.php' . $url_query, + 0, + $GLOBALS['db'], + $_POST['selected_tbl'] + ); + exit; + } + } else { + Message::notice( + __('No tables selected.') + )->display(); + } +} + +// Get tracked data about the database +$data = Tracker::getTrackedData($GLOBALS['db'], '', '1'); + +// No tables present and no log exist +if ($num_tables == 0 && count($data['ddlog']) == 0) { + echo '

' , __('No tables found in database.') , '

' , "\n"; + + if (empty($db_is_system_schema)) { + echo CreateTable::getHtml($db); + } + exit; +} + +// --------------------------------------------------------------------------- +$relation = new Relation(); +$cfgRelation = $relation->getRelationsParam(); + +// Prepare statement to get HEAD version +$all_tables_query = ' SELECT table_name, MAX(version) as version FROM ' . + Util::backquote($cfgRelation['db']) . '.' . + Util::backquote($cfgRelation['tracking']) . + ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($GLOBALS['db']) . + '\' ' . + ' GROUP BY table_name' . + ' ORDER BY table_name ASC'; + +$all_tables_result = $relation->queryAsControlUser($all_tables_query); + +// If a HEAD version exists +if (is_object($all_tables_result) + && $GLOBALS['dbi']->numRows($all_tables_result) > 0 +) { + echo Tracking::getHtmlForTrackedTables( + $GLOBALS['db'], $all_tables_result, $url_query, $pmaThemeImage, + $text_dir, $cfgRelation + ); +} + +$untracked_tables = Tracking::getUntrackedTables($GLOBALS['db']); + +// If untracked tables exist +if (count($untracked_tables) > 0) { + echo Tracking::getHtmlForUntrackedTables( + $GLOBALS['db'], $untracked_tables, $url_query, $pmaThemeImage, $text_dir + ); +} +// If available print out database log +if (count($data['ddlog']) > 0) { + $log = ''; + foreach ($data['ddlog'] as $entry) { + $log .= '# ' . $entry['date'] . ' ' . $entry['username'] . "\n" + . $entry['statement'] . "\n"; + } + echo Util::getMessage(__('Database Log'), $log); +} diff --git a/phpMyAdmin/db_triggers.php b/phpMyAdmin/db_triggers.php new file mode 100755 index 0000000..cdd0ebe --- /dev/null +++ b/phpMyAdmin/db_triggers.php @@ -0,0 +1,18 @@ +`_ jQuery library. + +Examples +-------- + +Pie chart ++++++++++ + +Query results for a simple pie chart can be generated with: + +.. code-block:: mysql + + SELECT 'Food' AS 'expense', + 1250 AS 'amount' UNION + SELECT 'Accommodation', 500 UNION + SELECT 'Travel', 720 UNION + SELECT 'Misc', 220 + +And the result of this query is: + ++---------------+--------+ +| expense | amount | ++===============+========+ +| Food | 1250 | ++---------------+--------+ +| Accommodation | 500 | ++---------------+--------+ +| Travel | 720 | ++---------------+--------+ +| Misc | 220 | ++---------------+--------+ + +Choosing expense as the X-axis and amount in series: + +.. image:: images/pie_chart.png + +Bar and column chart +++++++++++++++++++++ + +Both bar charts and column chats support stacking. Upon selecting one of these types a checkbox is displayed to select stacking. + +Query results for a simple bar or column chart can be generated with: + +.. code-block:: mysql + + SELECT + 'ACADEMY DINOSAUR' AS 'title', + 0.99 AS 'rental_rate', + 20.99 AS 'replacement_cost' UNION + SELECT 'ACE GOLDFINGER', 4.99, 12.99 UNION + SELECT 'ADAPTATION HOLES', 2.99, 18.99 UNION + SELECT 'AFFAIR PREJUDICE', 2.99, 26.99 UNION + SELECT 'AFRICAN EGG', 2.99, 22.99 + +And the result of this query is: + ++------------------+--------------+-------------------+ +| title | rental_rate | replacement_cost | ++==================+==============+===================+ +| ACADEMY DINOSAUR | 0.99 | 20.99 | ++------------------+--------------+-------------------+ +| ACE GOLDFINGER | 4.99 | 12.99 | ++------------------+--------------+-------------------+ +| ADAPTATION HOLES | 2.99 | 18.99 | ++------------------+--------------+-------------------+ +| AFFAIR PREJUDICE | 2.99 | 26.99 | ++------------------+--------------+-------------------+ +| AFRICAN EGG | 2.99 | 22.99 | ++------------------+--------------+-------------------+ + +Choosing title as the X-axis and rental_rate and replacement_cost as series: + +.. image:: images/column_chart.png + +Scatter chart ++++++++++++++ + +Scatter charts are useful in identifying the movement of one or more variable(s) compared to another variable. + +Using the same data set from bar and column charts section and choosing replacement_cost as the X-axis and rental_rate in series: + +.. image:: images/scatter_chart.png + +Line, spline and timeline charts +++++++++++++++++++++++++++++++++ + +These charts can be used to illustrate trends in underlying data. Spline charts draw smooth lines while timeline charts draw X-axis taking the distances between the dates/time into consideration. + +Query results for a simple line, spline or timeline chart can be generated with: + +.. code-block:: mysql + + SELECT + DATE('2006-01-08') AS 'date', + 2056 AS 'revenue', + 1378 AS 'cost' UNION + SELECT DATE('2006-01-09'), 1898, 2301 UNION + SELECT DATE('2006-01-15'), 1560, 600 UNION + SELECT DATE('2006-01-17'), 3457, 1565 + +And the result of this query is: + ++------------+---------+------+ +| date | revenue | cost | ++============+=========+======+ +| 2016-01-08 | 2056 | 1378 | ++------------+---------+------+ +| 2006-01-09 | 1898 | 2301 | ++------------+---------+------+ +| 2006-01-15 | 1560 | 600 | ++------------+---------+------+ +| 2006-01-17 | 3457 | 1565 | ++------------+---------+------+ + +.. image:: images/line_chart.png +.. image:: images/spline_chart.png +.. image:: images/timeline_chart.png diff --git a/phpMyAdmin/doc/html/_sources/config.rst.txt b/phpMyAdmin/doc/html/_sources/config.rst.txt new file mode 100755 index 0000000..a8fc5f9 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/config.rst.txt @@ -0,0 +1,3624 @@ +.. index:: config.inc.php + +.. _config: + +Configuration +============= + +All configurable data is placed in :file:`config.inc.php` in phpMyAdmin's +toplevel directory. If this file does not exist, please refer to the +:ref:`setup` section to create one. This file only needs to contain the +parameters you want to change from their corresponding default value in +:file:`libraries/config.default.php` (this file is not inteded for changes). + +.. seealso:: + + :ref:`config-examples` for examples of configurations + +If a directive is missing from your file, you can just add another line with +the file. This file is for over-writing the defaults; if you wish to use the +default value there's no need to add a line here. + +The parameters which relate to design (like colors) are placed in +:file:`themes/themename/layout.inc.php`. You might also want to create +:file:`config.footer.inc.php` and :file:`config.header.inc.php` files to add +your site specific code to be included on start and end of each page. + +.. note:: + + Some distributions (eg. Debian or Ubuntu) store :file:`config.inc.php` in + ``/etc/phpmyadmin`` instead of within phpMyAdmin sources. + +.. warning:: + + :term:`Mac` users should note that if you are on a version before + :term:`Mac OS X`, PHP does not seem to + like :term:`Mac` end of lines character (``\r``). So + ensure you choose the option that allows to use the \*nix end of line + character (``\n``) in your text editor before saving a script you have + modified. + +Basic settings +-------------- + +.. config:option:: $cfg['PmaAbsoluteUri'] + + :type: string + :default: ``''`` + + .. versionchanged:: 4.6.5 + + This setting was not available in phpMyAdmin 4.6.0 - 4.6.4. + + Sets here the complete :term:`URL` (with full path) to your phpMyAdmin + installation's directory. E.g. + ``https://www.example.net/path_to_your_phpMyAdmin_directory/``. Note also + that the :term:`URL` on most of web servers are case sensitive (even on + Windows). Don鈥檛 forget the trailing slash at the end. + + Starting with version 2.3.0, it is advisable to try leaving this blank. In + most cases phpMyAdmin automatically detects the proper setting. Users of + port forwarding or complex reverse proxy setup might need to set this. + + A good test is to browse a table, edit a row and save it. There should be + an error message if phpMyAdmin is having trouble auto鈥揹etecting the correct + value. If you get an error that this must be set or if the autodetect code + fails to detect your path, please post a bug report on our bug tracker so + we can improve the code. + + .. seealso:: :ref:`faq1_40`, :ref:`faq2_5`, :ref:`faq4_7`, :ref:`faq5_16` + +.. config:option:: $cfg['PmaNoRelation_DisableWarning'] + + :type: boolean + :default: false + + Starting with version 2.3.0 phpMyAdmin offers a lot of features to + work with master / foreign 鈥� tables (see :config:option:`$cfg['Servers'][$i]['pmadb']`). + + If you tried to set this + up and it does not work for you, have a look on the :guilabel:`Structure` page + of one database where you would like to use it. You will find a link + that will analyze why those features have been disabled. + + If you do not want to use those features set this variable to ``true`` to + stop this message from appearing. + +.. config:option:: $cfg['AuthLog'] + + :type: string + :default: ``'auto'`` + + .. versionadded:: 4.8.0 + + This is supported since phpMyAdmin 4.8.0. + + Configure authentication logging destination. Failed (or all, depending on + :config:option:`$cfg['AuthLogSuccess']`) authentication attempts will be + logged according to this directive: + + ``auto`` + Let phpMyAdmin automatically choose between ``syslog`` and ``php``. + ``syslog`` + Log using syslog, using AUTH facility, on most systems this ends up + in :file:`/var/log/auth.log`. + ``php`` + Log into PHP error log. + ``sapi`` + Log into PHP SAPI logging. + ``/path/to/file`` + Any other value is treated as a filename and log entries are written there. + + .. note:: + + When logging to a file, make sure its permissions are correctly set + for a web server user, the setup should closely match instructions + described in :config:option:`$cfg['TempDir']`: + +.. config:option:: $cfg['AuthLogSuccess'] + + :type: boolean + :default: false + + .. versionadded:: 4.8.0 + + This is supported since phpMyAdmin 4.8.0. + + Whether to log successful authentication attempts into + :config:option:`$cfg['AuthLog']`. + +.. config:option:: $cfg['SuhosinDisableWarning'] + + :type: boolean + :default: false + + A warning is displayed on the main page if Suhosin is detected. + + You can set this parameter to ``true`` to stop this message from appearing. + +.. config:option:: $cfg['LoginCookieValidityDisableWarning'] + + :type: boolean + :default: false + + A warning is displayed on the main page if the PHP parameter + session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin. + + You can set this parameter to ``true`` to stop this message from appearing. + +.. config:option:: $cfg['ServerLibraryDifference_DisableWarning'] + + :type: boolean + :default: false + + .. deprecated:: 4.7.0 + + This setting was removed as the warning has been removed as well. + + A warning is displayed on the main page if there is a difference + between the MySQL library and server version. + + You can set this parameter to ``true`` to stop this message from appearing. + +.. config:option:: $cfg['ReservedWordDisableWarning'] + + :type: boolean + :default: false + + This warning is displayed on the Structure page of a table if one or more + column names match with words which are MySQL reserved. + + If you want to turn off this warning, you can set it to ``true`` and + warning will no longer be displayed. + +.. config:option:: $cfg['TranslationWarningThreshold'] + + :type: integer + :default: 80 + + Show warning about incomplete translations on certain threshold. + +.. config:option:: $cfg['SendErrorReports'] + + :type: string + :default: ``'ask'`` + + Sets the default behavior for JavaScript error reporting. + + Whenever an error is detected in the JavaScript execution, an error report + may be sent to the phpMyAdmin team if the user agrees. + + The default setting of ``'ask'`` will ask the user everytime there is a new + error report. However you can set this parameter to ``'always'`` to send error + reports without asking for confirmation or you can set it to ``'never'`` to + never send error reports. + + This directive is available both in the configuration file and in users + preferences. If the person in charge of a multi-user installation prefers + to disable this feature for all users, a value of ``'never'`` should be + set, and the :config:option:`$cfg['UserprefsDisallow']` directive should + contain ``'SendErrorReports'`` in one of its array values. + +.. config:option:: $cfg['ConsoleEnterExecutes'] + + :type: boolean + :default: false + + Setting this to ``true`` allows the user to execute queries by pressing Enter + instead of Ctrl+Enter. A new line can be inserted by pressing Shift + Enter. + + The behaviour of the console can be temporarily changed using console's + settings interface. + +.. config:option:: $cfg['AllowThirdPartyFraming'] + + :type: boolean + :default: false + + Setting this to ``true`` allows phpMyAdmin to be included inside a frame, + and is a potential security hole allowing cross-frame scripting attacks or + clickjacking. + +Server connection settings +-------------------------- + +.. config:option:: $cfg['Servers'] + + :type: array + :default: one server array with settings listed below + + Since version 1.4.2, phpMyAdmin supports the administration of multiple + MySQL servers. Therefore, a :config:option:`$cfg['Servers']`-array has been + added which contains the login information for the different servers. The + first :config:option:`$cfg['Servers'][$i]['host']` contains the hostname of + the first server, the second :config:option:`$cfg['Servers'][$i]['host']` + the hostname of the second server, etc. In + :file:`libraries/config.default.php`, there is only one section for server + definition, however you can put as many as you need in + :file:`config.inc.php`, copy that block or needed parts (you don't have to + define all settings, just those you need to change). + + .. note:: + + The :config:option:`$cfg['Servers']` array starts with + $cfg['Servers'][1]. Do not use $cfg['Servers'][0]. If you want more + than one server, just copy following section (including $i + incrementation) serveral times. There is no need to define full server + array, just define values you need to change. + +.. config:option:: $cfg['Servers'][$i]['host'] + + :type: string + :default: ``'localhost'`` + + The hostname or :term:`IP` address of your $i-th MySQL-server. E.g. + ``localhost``. + + Possible values are: + + * hostname, e.g., ``'localhost'`` or ``'mydb.example.org'`` + * IP address, e.g., ``'127.0.0.1'`` or ``'192.168.10.1'`` + * IPv6 address, e.g. ``2001:cdba:0000:0000:0000:0000:3257:9652`` + * dot - ``'.'``, i.e., use named pipes on windows systems + * empty - ``''``, disables this server + + .. note:: + + The hostname ``localhost`` is handled specially by MySQL and it uses + the socket based connection protocol. To use TCP/IP networking, use an + IP address or hostname such as ``127.0.0.1`` or ``db.example.com``. You + can configure the path to the socket with + :config:option:`$cfg['Servers'][$i]['socket']`. + + .. seealso:: + + :config:option:`$cfg['Servers'][$i]['port']`, + + +.. config:option:: $cfg['Servers'][$i]['port'] + + :type: string + :default: ``''`` + + The port-number of your $i-th MySQL-server. Default is 3306 (leave + blank). + + .. note:: + + If you use ``localhost`` as the hostname, MySQL ignores this port number + and connects with the socket, so if you want to connect to a port + different from the default port, use ``127.0.0.1`` or the real hostname + in :config:option:`$cfg['Servers'][$i]['host']`. + + .. seealso:: + + :config:option:`$cfg['Servers'][$i]['host']`, + + +.. config:option:: $cfg['Servers'][$i]['socket'] + + :type: string + :default: ``''`` + + The path to the socket to use. Leave blank for default. To determine + the correct socket, check your MySQL configuration or, using the + :command:`mysql` command鈥搇ine client, issue the ``status`` command. Among the + resulting information displayed will be the socket used. + + .. note:: + + This takes effect only if :config:option:`$cfg['Servers'][$i]['host']` is set + to ``localhost``. + + .. seealso:: + + :config:option:`$cfg['Servers'][$i]['host']`, + + +.. config:option:: $cfg['Servers'][$i]['ssl'] + + :type: boolean + :default: false + + Whether to enable SSL for the connection between phpMyAdmin and the MySQL + server to secure the connection. + + When using the ``'mysql'`` extension, + none of the remaining ``'ssl...'`` configuration options apply. + + We strongly recommend the ``'mysqli'`` extension when using this option. + + .. seealso:: + + :ref:`ssl`, + :ref:`example-google-ssl`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`, + :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +.. config:option:: $cfg['Servers'][$i]['ssl_key'] + + :type: string + :default: NULL + + Path to the client key file when using SSL for connecting to the MySQL + server. This is used to authenticate the client to the server. + + For example: + + .. code-block:: php + + $cfg['Servers'][$i]['ssl_key'] = '/etc/mysql/server-key.pem'; + + .. seealso:: + + :ref:`ssl`, + :ref:`example-google-ssl`, + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`, + :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +.. config:option:: $cfg['Servers'][$i]['ssl_cert'] + + :type: string + :default: NULL + + Path to the client certificate file when using SSL for connecting to the + MySQL server. This is used to authenticate the client to the server. + + .. seealso:: + + :ref:`ssl`, + :ref:`example-google-ssl`, + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`, + :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +.. config:option:: $cfg['Servers'][$i]['ssl_ca'] + + :type: string + :default: NULL + + Path to the CA file when using SSL for connecting to the MySQL server. + + .. seealso:: + + :ref:`ssl`, + :ref:`example-google-ssl`, + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`, + :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +.. config:option:: $cfg['Servers'][$i]['ssl_ca_path'] + + :type: string + :default: NULL + + Directory containing trusted SSL CA certificates in PEM format. + + .. seealso:: + + :ref:`ssl`, + :ref:`example-google-ssl`, + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +.. config:option:: $cfg['Servers'][$i]['ssl_ciphers'] + + :type: string + :default: NULL + + List of allowable ciphers for SSL connections to the MySQL server. + + .. seealso:: + + :ref:`ssl`, + :ref:`example-google-ssl`, + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +.. config:option:: $cfg['Servers'][$i]['ssl_verify'] + + :type: boolean + :default: true + + .. versionadded:: 4.6.0 + + This is supported since phpMyAdmin 4.6.0. + + If your PHP install uses the MySQL Native Driver (mysqlnd), your + MySQL server is 5.6 or later, and your SSL certificate is self-signed, + there is a chance your SSL connection will fail due to validation. + Setting this to ``false`` will disable the validation check. + + Since PHP 5.6.0 it also verifies whether server name matches CN of its + certificate. There is currently no way to disable just this check without + disabling complete SSL verification. + + .. warning:: + + Disabling the certificate verification defeats purpose of using SSL. + This will make the connection vulnerable to man in the middle attacks. + + .. note:: + + This flag only works with PHP 5.6.16 or later. + + .. seealso:: + + :ref:`ssl`, + :ref:`example-google-ssl`, + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`, + :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +.. config:option:: $cfg['Servers'][$i]['connect_type'] + + :type: string + :default: ``'tcp'`` + + .. deprecated:: 4.7.0 + + This setting is no longer used as of 4.7.0, since MySQL decides the + connection type based on host, so it could lead to unexpected results. + Please set :config:option:`$cfg['Servers'][$i]['host']` accordingly + instead. + + What type connection to use with the MySQL server. Your options are + ``'socket'`` and ``'tcp'``. It defaults to tcp as that is nearly guaranteed + to be available on all MySQL servers, while sockets are not supported on + some platforms. To use the socket mode, your MySQL server must be on the + same machine as the Web server. + +.. config:option:: $cfg['Servers'][$i]['compress'] + + :type: boolean + :default: false + + Whether to use a compressed protocol for the MySQL server connection + or not (experimental). + +.. _controlhost: +.. config:option:: $cfg['Servers'][$i]['controlhost'] + + :type: string + :default: ``''`` + + Permits to use an alternate host to hold the configuration storage + data. + + .. seealso:: + + :config:option:`$cfg['Servers'][$i]['control_*']` + +.. _controlport: +.. config:option:: $cfg['Servers'][$i]['controlport'] + + :type: string + :default: ``''`` + + Permits to use an alternate port to connect to the host that + holds the configuration storage. + + .. seealso:: + + :config:option:`$cfg['Servers'][$i]['control_*']` + +.. _controluser: +.. config:option:: $cfg['Servers'][$i]['controluser'] + + :type: string + :default: ``''`` + +.. config:option:: $cfg['Servers'][$i]['controlpass'] + + :type: string + :default: ``''`` + + This special account is used to access :ref:`linked-tables`. + You don't need it in single user case, but if phpMyAdmin is shared it + is recommended to give access to :ref:`linked-tables` only to this user + and configure phpMyAdmin to use it. All users will then be able to use + the features without need to have direct access to :ref:`linked-tables`. + + .. versionchanged:: 2.2.5 + those were called ``stduser`` and ``stdpass`` + + .. seealso:: + + :ref:`setup`, + :ref:`authentication_modes`, + :ref:`linked-tables`, + :config:option:`$cfg['Servers'][$i]['pmadb']`, + :config:option:`$cfg['Servers'][$i]['controlhost']`, + :config:option:`$cfg['Servers'][$i]['controlport']`, + :config:option:`$cfg['Servers'][$i]['control_*']` + +.. config:option:: $cfg['Servers'][$i]['control_*'] + + :type: mixed + + .. versionadded:: 4.7.0 + + You can change any MySQL connection setting for control link (used to + access :ref:`linked-tables`) using configuration prefixed with ``control_``. + + This can be used to change any aspect of the control connection, which by + default uses same parameters as the user one. + + For example you can configure SSL for the control connection: + + .. code-block:: php + + // Enable SSL + $cfg['Servers'][$i]['control_ssl'] = true; + // Client secret key + $cfg['Servers'][$i]['control_ssl_key'] = '../client-key.pem'; + // Client certificate + $cfg['Servers'][$i]['control_ssl_cert'] = '../client-cert.pem'; + // Server certification authority + $cfg['Servers'][$i]['control_ssl_ca'] = '../server-ca.pem'; + + .. seealso:: + + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`, + :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +.. config:option:: $cfg['Servers'][$i]['auth_type'] + + :type: string + :default: ``'cookie'`` + + Whether config or cookie or :term:`HTTP` or signon authentication should be + used for this server. + + * 'config' authentication (``$auth_type = 'config'``) is the plain old + way: username and password are stored in :file:`config.inc.php`. + * 'cookie' authentication mode (``$auth_type = 'cookie'``) allows you to + log in as any valid MySQL user with the help of cookies. + * 'http' authentication allows you to log in as any + valid MySQL user via HTTP-Auth. + * 'signon' authentication mode (``$auth_type = 'signon'``) allows you to + log in from prepared PHP session data or using supplied PHP script. + + .. seealso:: :ref:`authentication_modes` + +.. _servers_auth_http_realm: +.. config:option:: $cfg['Servers'][$i]['auth_http_realm'] + + :type: string + :default: ``''`` + + When using auth\_type = ``http``, this field allows to define a custom + :term:`HTTP` Basic Auth Realm which will be displayed to the user. If not + explicitly specified in your configuration, a string combined of + "phpMyAdmin " and either :config:option:`$cfg['Servers'][$i]['verbose']` or + :config:option:`$cfg['Servers'][$i]['host']` will be used. + +.. _servers_user: +.. config:option:: $cfg['Servers'][$i]['user'] + + :type: string + :default: ``'root'`` + +.. config:option:: $cfg['Servers'][$i]['password'] + + :type: string + :default: ``''`` + + When using :config:option:`$cfg['Servers'][$i]['auth_type']` set to + 'config', this is the user/password-pair which phpMyAdmin will use to + connect to the MySQL server. This user/password pair is not needed when + :term:`HTTP` or cookie authentication is used + and should be empty. + +.. _servers_nopassword: +.. config:option:: $cfg['Servers'][$i]['nopassword'] + + :type: boolean + :default: false + + .. deprecated:: 4.7.0 + + This setting was removed as it can produce unexpected results. + + Allow attempt to log in without password when a login with password + fails. This can be used together with http authentication, when + authentication is done some other way and phpMyAdmin gets user name + from auth and uses empty password for connecting to MySQL. Password + login is still tried first, but as fallback, no password method is + tried. + +.. _servers_only_db: +.. config:option:: $cfg['Servers'][$i]['only_db'] + + :type: string or array + :default: ``''`` + + If set to a (an array of) database name(s), only this (these) + database(s) will be shown to the user. Since phpMyAdmin 2.2.1, + this/these database(s) name(s) may contain MySQL wildcards characters + ("\_" and "%"): if you want to use literal instances of these + characters, escape them (I.E. use ``'my\_db'`` and not ``'my_db'``). + + This setting is an efficient way to lower the server load since the + latter does not need to send MySQL requests to build the available + database list. But **it does not replace the privileges rules of the + MySQL database server**. If set, it just means only these databases + will be displayed but **not that all other databases can't be used.** + + An example of using more that one database: + + .. code-block:: php + + $cfg['Servers'][$i]['only_db'] = array('db1', 'db2'); + + .. versionchanged:: 4.0.0 + Previous versions permitted to specify the display order of + the database names via this directive. + +.. config:option:: $cfg['Servers'][$i]['hide_db'] + + :type: string + :default: ``''`` + + Regular expression for hiding some databases from unprivileged users. + This only hides them from listing, but a user is still able to access + them (using, for example, the SQL query area). To limit access, use + the MySQL privilege system. For example, to hide all databases + starting with the letter "a", use + + .. code-block:: php + + $cfg['Servers'][$i]['hide_db'] = '^a'; + + and to hide both "db1" and "db2" use + + .. code-block:: php + + $cfg['Servers'][$i]['hide_db'] = '^(db1|db2)$'; + + More information on regular expressions can be found in the `PCRE + pattern syntax + `_ portion + of the PHP reference manual. + +.. config:option:: $cfg['Servers'][$i]['verbose'] + + :type: string + :default: ``''`` + + Only useful when using phpMyAdmin with multiple server entries. If + set, this string will be displayed instead of the hostname in the + pull-down menu on the main page. This can be useful if you want to + show only certain databases on your system, for example. For HTTP + auth, all non-US-ASCII characters will be stripped. + +.. config:option:: $cfg['Servers'][$i]['extension'] + + :type: string + :default: ``'mysqli'`` + + The PHP MySQL extension to use (``mysql`` or ``mysqli``). + + It is recommended to use ``mysqli`` in all installations. + +.. config:option:: $cfg['Servers'][$i]['pmadb'] + + :type: string + :default: ``''`` + + The name of the database containing the phpMyAdmin configuration + storage. + + See the :ref:`linked-tables` section in this document to see the benefits of + this feature, and for a quick way of creating this database and the needed + tables. + + If you are the only user of this phpMyAdmin installation, you can use your + current database to store those special tables; in this case, just put your + current database name in :config:option:`$cfg['Servers'][$i]['pmadb']`. For a + multi-user installation, set this parameter to the name of your central + database containing the phpMyAdmin configuration storage. + +.. _bookmark: +.. config:option:: $cfg['Servers'][$i]['bookmarktable'] + + :type: string or false + :default: ``''`` + + Since release 2.2.0 phpMyAdmin allows users to bookmark queries. This + can be useful for queries you often run. To allow the usage of this + functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * enter the table name in :config:option:`$cfg['Servers'][$i]['bookmarktable']` + + This feature can be disabled by setting the configuration to ``false``. + +.. _relation: +.. config:option:: $cfg['Servers'][$i]['relation'] + + :type: string or false + :default: ``''`` + + Since release 2.2.4 you can describe, in a special 'relation' table, + which column is a key in another table (a foreign key). phpMyAdmin + currently uses this to: + + * make clickable, when you browse the master table, the data values that + point to the foreign table; + * display in an optional tool-tip the "display column" when browsing the + master table, if you move the mouse to a column containing a foreign + key (use also the 'table\_info' table); (see :ref:`faqdisplay`) + * in edit/insert mode, display a drop-down list of possible foreign keys + (key value and "display column" are shown) (see :ref:`faq6_21`) + * display links on the table properties page, to check referential + integrity (display missing foreign keys) for each described key; + * in query-by-example, create automatic joins (see :ref:`faq6_6`) + * enable you to get a :term:`PDF` schema of + your database (also uses the table\_coords table). + + The keys can be numeric or character. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the relation table name in :config:option:`$cfg['Servers'][$i]['relation']` + * now as normal user open phpMyAdmin and for each one of your tables + where you want to use this feature, click :guilabel:`Structure/Relation view/` + and choose foreign columns. + + This feature can be disabled by setting the configuration to ``false``. + + .. note:: + + In the current version, ``master_db`` must be the same as ``foreign_db``. + Those columns have been put in future development of the cross-db + relations. + +.. _table_info: +.. config:option:: $cfg['Servers'][$i]['table_info'] + + :type: string or false + :default: ``''`` + + Since release 2.3.0 you can describe, in a special 'table\_info' + table, which column is to be displayed as a tool-tip when moving the + cursor over the corresponding key. This configuration variable will + hold the name of this special table. To allow the usage of this + functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['table\_info']` (e.g. + ``pma__table_info``) + * then for each table where you want to use this feature, click + "Structure/Relation view/Choose column to display" to choose the + column. + + This feature can be disabled by setting the configuration to ``false``. + + .. seealso:: :ref:`faqdisplay` + +.. _table_coords: +.. config:option:: $cfg['Servers'][$i]['table_coords'] + + :type: string or false + :default: ``''`` + + The designer feature can save your page layout; by pressing the "Save page" or "Save page as" + button in the expanding designer menu, you can customize the layout and have it loaded the next + time you use the designer. That layout is stored in this table. Furthermore, this table is also + required for using the PDF relation export feature, see + :config:option:`$cfg['Servers'][$i]['pdf\_pages']` for additional details. + +.. config:option:: $cfg['Servers'][$i]['pdf_pages'] + + :type: string or false + :default: ``''`` + + Since release 2.3.0 you can have phpMyAdmin create :term:`PDF` pages + showing the relations between your tables. Further, the designer interface + permits visually managing the relations. To do this it needs two tables + "pdf\_pages" (storing information about the available :term:`PDF` pages) + and "table\_coords" (storing coordinates where each table will be placed on + a :term:`PDF` schema output). You must be using the "relation" feature. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the correct table names in + :config:option:`$cfg['Servers'][$i]['table\_coords']` and + :config:option:`$cfg['Servers'][$i]['pdf\_pages']` + + This feature can be disabled by setting either of the configurations to ``false``. + + .. seealso:: :ref:`faqpdf`. + +.. _col_com: +.. config:option:: $cfg['Servers'][$i]['column_info'] + + :type: string or false + :default: ``''`` + + This part requires a content update! Since release 2.3.0 you can + store comments to describe each column for each table. These will then + be shown on the "printview". + + Starting with release 2.5.0, comments are consequently used on the table + property pages and table browse view, showing up as tool-tips above the + column name (properties page) or embedded within the header of table in + browse view. They can also be shown in a table dump. Please see the + relevant configuration directives later on. + + Also new in release 2.5.0 is a MIME- transformation system which is also + based on the following table structure. See :ref:`transformations` for + further information. To use the MIME- transformation system, your + column\_info table has to have the three new columns 'mimetype', + 'transformation', 'transformation\_options'. + + Starting with release 4.3.0, a new input-oriented transformation system + has been introduced. Also, backward compatibility code used in the old + transformations system was removed. As a result, an update to column\_info + table is necessary for previous transformations and the new input-oriented + transformation system to work. phpMyAdmin will upgrade it automatically + for you by analyzing your current column\_info table structure. + However, if something goes wrong with the auto-upgrade then you can + use the SQL script found in ``./sql/upgrade_column_info_4_3_0+.sql`` + to upgrade it manually. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['column\_info']` (e.g. + ``pma__column_info``) + * to update your PRE-2.5.0 Column\_comments table use this: and + remember that the Variable in :file:`config.inc.php` has been renamed from + :samp:`$cfg['Servers'][$i]['column\_comments']` to + :config:option:`$cfg['Servers'][$i]['column\_info']` + + .. code-block:: mysql + + ALTER TABLE `pma__column_comments` + ADD `mimetype` VARCHAR( 255 ) NOT NULL, + ADD `transformation` VARCHAR( 255 ) NOT NULL, + ADD `transformation_options` VARCHAR( 255 ) NOT NULL; + * to update your PRE-4.3.0 Column\_info table manually use this + ``./sql/upgrade_column_info_4_3_0+.sql`` SQL script. + + This feature can be disabled by setting the configuration to ``false``. + + .. note:: + + For auto-upgrade functionality to work, your + :config:option:`$cfg['Servers'][$i]['controluser']` must have ALTER privilege on + ``phpmyadmin`` database. See the `MySQL documentation for GRANT + `_ on how to + ``GRANT`` privileges to a user. + +.. _history: +.. config:option:: $cfg['Servers'][$i]['history'] + + :type: string or false + :default: ``''`` + + Since release 2.5.0 you can store your :term:`SQL` history, which means all + queries you entered manually into the phpMyAdmin interface. If you don't + want to use a table-based history, you can use the JavaScript-based + history. + + Using that, all your history items are deleted when closing the window. + Using :config:option:`$cfg['QueryHistoryMax']` you can specify an amount of + history items you want to have on hold. On every login, this list gets cut + to the maximum amount. + + The query history is only available if JavaScript is enabled in + your browser. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['history']` (e.g. + ``pma__history``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _recent: +.. config:option:: $cfg['Servers'][$i]['recent'] + + :type: string or false + :default: ``''`` + + Since release 3.5.0 you can show recently used tables in the + navigation panel. It helps you to jump across table directly, without + the need to select the database, and then select the table. Using + :config:option:`$cfg['NumRecentTables']` you can configure the maximum number + of recent tables shown. When you select a table from the list, it will jump to + the page specified in :config:option:`$cfg['NavigationTreeDefaultTabTable']`. + + Without configuring the storage, you can still access the recently used tables, + but it will disappear after you logout. + + To allow the usage of this functionality persistently: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['recent']` (e.g. + ``pma__recent``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _favorite: +.. config:option:: $cfg['Servers'][$i]['favorite'] + + :type: string or false + :default: ``''`` + + Since release 4.2.0 you can show a list of selected tables in the + navigation panel. It helps you to jump to the table directly, without + the need to select the database, and then select the table. When you + select a table from the list, it will jump to the page specified in + :config:option:`$cfg['NavigationTreeDefaultTabTable']`. + + You can add tables to this list or remove tables from it in database + structure page by clicking on the star icons next to table names. Using + :config:option:`$cfg['NumFavoriteTables']` you can configure the maximum + number of favorite tables shown. + + Without configuring the storage, you can still access the favorite tables, + but it will disappear after you logout. + + To allow the usage of this functionality persistently: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['favorite']` (e.g. + ``pma__favorite``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _table_uiprefs: +.. config:option:: $cfg['Servers'][$i]['table_uiprefs'] + + :type: string or false + :default: ``''`` + + Since release 3.5.0 phpMyAdmin can be configured to remember several + things (sorted column :config:option:`$cfg['RememberSorting']`, column order, + and column visibility from a database table) for browsing tables. Without + configuring the storage, these features still can be used, but the values will + disappear after you logout. + + To allow the usage of these functionality persistently: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['table\_uiprefs']` (e.g. + ``pma__table_uiprefs``) + + This feature can be disabled by setting the configuration to ``false``. + +.. config:option:: $cfg['Servers'][$i]['users'] + + :type: string or false + :default: ``''`` + +.. config:option:: $cfg['Servers'][$i]['usergroups'] + + :type: string or false + :default: ``''`` + + Since release 4.1.0 you can create different user groups with menu items + attached to them. Users can be assigned to these groups and the logged in + user would only see menu items configured to the usergroup he is assigned to. + To do this it needs two tables "usergroups" (storing allowed menu items for each + user group) and "users" (storing users and their assignments to user groups). + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the correct table names in + :config:option:`$cfg['Servers'][$i]['users']` (e.g. ``pma__users``) and + :config:option:`$cfg['Servers'][$i]['usergroups']` (e.g. ``pma__usergroups``) + + This feature can be disabled by setting either of the configurations to ``false``. + + .. seealso:: :ref:`configurablemenus` + +.. _navigationhiding: +.. config:option:: $cfg['Servers'][$i]['navigationhiding'] + + :type: string or false + :default: ``''`` + + Since release 4.1.0 you can hide/show items in the navigation tree. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['navigationhiding']` (e.g. + ``pma__navigationhiding``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _central_columns: +.. config:option:: $cfg['Servers'][$i]['central_columns'] + + :type: string or false + :default: ``''`` + + Since release 4.3.0 you can have a central list of columns per database. + You can add/remove columns to the list as per your requirement. These columns + in the central list will be available to use while you create a new column for + a table or create a table itself. You can select a column from central list + while creating a new column, it will save you from writing the same column definition + over again or from writing different names for similar column. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['central_columns']` (e.g. + ``pma__central_columns``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _designer_settings: +.. config:option:: $cfg['Servers'][$i]['designer_settings'] + + :type: string or false + :default: ``''`` + + Since release 4.5.0 your designer settings can be remembered. + Your choice regarding 'Angular/Direct Links', 'Snap to Grid', 'Toggle Relation Lines', + 'Small/Big All', 'Move Menu' and 'Pin Text' can be remembered persistently. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['designer_settings']` (e.g. + ``pma__designer_settings``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _savedsearches: +.. config:option:: $cfg['Servers'][$i]['savedsearches'] + + :type: string or false + :default: ``''`` + + Since release 4.2.0 you can save and load query-by-example searches from the Database > Query panel. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['savedsearches']` (e.g. + ``pma__savedsearches``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _export_templates: +.. config:option:: $cfg['Servers'][$i]['export_templates'] + + :type: string or false + :default: ``''`` + + Since release 4.5.0 you can save and load export templates. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['export_templates']` (e.g. + ``pma__export_templates``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _tracking: +.. config:option:: $cfg['Servers'][$i]['tracking'] + + :type: string or false + :default: ``''`` + + Since release 3.3.x a tracking mechanism is available. It helps you to + track every :term:`SQL` command which is + executed by phpMyAdmin. The mechanism supports logging of data + manipulation and data definition statements. After enabling it you can + create versions of tables. + + The creation of a version has two effects: + + * phpMyAdmin saves a snapshot of the table, including structure and + indexes. + * phpMyAdmin logs all commands which change the structure and/or data of + the table and links these commands with the version number. + + Of course you can view the tracked changes. On the :guilabel:`Tracking` + page a complete report is available for every version. For the report you + can use filters, for example you can get a list of statements within a date + range. When you want to filter usernames you can enter \* for all names or + you enter a list of names separated by ','. In addition you can export the + (filtered) report to a file or to a temporary database. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['tracking']` (e.g. + ``pma__tracking``) + + This feature can be disabled by setting the configuration to ``false``. + +.. _tracking2: +.. config:option:: $cfg['Servers'][$i]['tracking_version_auto_create'] + + :type: boolean + :default: false + + Whether the tracking mechanism creates versions for tables and views + automatically. + + If this is set to true and you create a table or view with + + * CREATE TABLE ... + * CREATE VIEW ... + + and no version exists for it, the mechanism will create a version for + you automatically. + +.. _tracking3: +.. config:option:: $cfg['Servers'][$i]['tracking_default_statements'] + + :type: string + :default: ``'CREATE TABLE,ALTER TABLE,DROP TABLE,RENAME TABLE,CREATE INDEX,DROP INDEX,INSERT,UPDATE,DELETE,TRUNCATE,REPLACE,CREATE VIEW,ALTER VIEW,DROP VIEW,CREATE DATABASE,ALTER DATABASE,DROP DATABASE'`` + + Defines the list of statements the auto-creation uses for new + versions. + +.. _tracking4: +.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_view'] + + :type: boolean + :default: true + + Whether a DROP VIEW IF EXISTS statement will be added as first line to + the log when creating a view. + +.. _tracking5: +.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_table'] + + :type: boolean + :default: true + + Whether a DROP TABLE IF EXISTS statement will be added as first line + to the log when creating a table. + +.. _tracking6: +.. config:option:: $cfg['Servers'][$i]['tracking_add_drop_database'] + + :type: boolean + :default: true + + Whether a DROP DATABASE IF EXISTS statement will be added as first + line to the log when creating a database. + +.. _userconfig: +.. config:option:: $cfg['Servers'][$i]['userconfig'] + + :type: string or false + :default: ``''`` + + Since release 3.4.x phpMyAdmin allows users to set most preferences by + themselves and store them in the database. + + If you don't allow for storing preferences in + :config:option:`$cfg['Servers'][$i]['pmadb']`, users can still personalize + phpMyAdmin, but settings will be saved in browser's local storage, or, it + is is unavailable, until the end of session. + + To allow the usage of this functionality: + + * set up :config:option:`$cfg['Servers'][$i]['pmadb']` and the phpMyAdmin configuration storage + * put the table name in :config:option:`$cfg['Servers'][$i]['userconfig']` + + This feature can be disabled by setting the configuration to ``false``. + +.. config:option:: $cfg['Servers'][$i]['MaxTableUiprefs'] + + :type: integer + :default: 100 + + Maximum number of rows saved in + :config:option:`$cfg['Servers'][$i]['table_uiprefs']` table. + + When tables are dropped or renamed, + :config:option:`$cfg['Servers'][$i]['table_uiprefs']` may contain invalid data + (referring to tables which no longer exist). We only keep this number of newest + rows in :config:option:`$cfg['Servers'][$i]['table_uiprefs']` and automatically + delete older rows. + +.. config:option:: $cfg['Servers'][$i]['SessionTimeZone'] + + :type: string + :default: ``''`` + + Sets the time zone used by phpMyAdmin. Leave blank to use the time zone of your + database server. Possible values are explained at + https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html + + This is useful when your database server uses a time zone which is different from the + time zone you want to use in phpMyAdmin. + +.. config:option:: $cfg['Servers'][$i]['AllowRoot'] + + :type: boolean + :default: true + + Whether to allow root access. This is just a shortcut for the + :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` below. + +.. config:option:: $cfg['Servers'][$i]['AllowNoPassword'] + + :type: boolean + :default: false + + Whether to allow logins without a password. The default value of + ``false`` for this parameter prevents unintended access to a MySQL + server with was left with an empty password for root or on which an + anonymous (blank) user is defined. + +.. _servers_allowdeny_order: +.. config:option:: $cfg['Servers'][$i]['AllowDeny']['order'] + + :type: string + :default: ``''`` + + If your rule order is empty, then :term:`IP` + authorization is disabled. + + If your rule order is set to + ``'deny,allow'`` then the system applies all deny rules followed by + allow rules. Access is allowed by default. Any client which does not + match a Deny command or does match an Allow command will be allowed + access to the server. + + If your rule order is set to ``'allow,deny'`` + then the system applies all allow rules followed by deny rules. Access + is denied by default. Any client which does not match an Allow + directive or does match a Deny directive will be denied access to the + server. + + If your rule order is set to ``'explicit'``, authorization is + performed in a similar fashion to rule order 'deny,allow', with the + added restriction that your host/username combination **must** be + listed in the *allow* rules, and not listed in the *deny* rules. This + is the **most** secure means of using Allow/Deny rules, and was + available in Apache by specifying allow and deny rules without setting + any order. + + Please also see :config:option:`$cfg['TrustedProxies']` for + detecting IP address behind proxies. + +.. _servers_allowdeny_rules: +.. config:option:: $cfg['Servers'][$i]['AllowDeny']['rules'] + + :type: array of strings + :default: array() + + The general format for the rules is as such: + + .. code-block:: none + + <'allow' | 'deny'> [from] + + If you wish to match all users, it is possible to use a ``'%'`` as a + wildcard in the *username* field. + + There are a few shortcuts you can + use in the *ipmask* field as well (please note that those containing + SERVER\_ADDRESS might not be available on all webservers): + + .. code-block:: none + + 'all' -> 0.0.0.0/0 + 'localhost' -> 127.0.0.1/8 + 'localnetA' -> SERVER_ADDRESS/8 + 'localnetB' -> SERVER_ADDRESS/16 + 'localnetC' -> SERVER_ADDRESS/24 + + Having an empty rule list is equivalent to either using ``'allow % + from all'`` if your rule order is set to ``'deny,allow'`` or ``'deny % + from all'`` if your rule order is set to ``'allow,deny'`` or + ``'explicit'``. + + For the :term:`IP address` matching + system, the following work: + + * ``xxx.xxx.xxx.xxx`` (an exact :term:`IP address`) + * ``xxx.xxx.xxx.[yyy-zzz]`` (an :term:`IP address` range) + * ``xxx.xxx.xxx.xxx/nn`` (CIDR, Classless Inter-Domain Routing type :term:`IP` addresses) + + But the following does not work: + + * ``xxx.xxx.xxx.xx[yyy-zzz]`` (partial :term:`IP` address range) + + For :term:`IPv6` addresses, the following work: + + * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx`` (an exact :term:`IPv6` address) + * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:[yyyy-zzzz]`` (an :term:`IPv6` address range) + * ``xxxx:xxxx:xxxx:xxxx/nn`` (CIDR, Classless Inter-Domain Routing type :term:`IPv6` addresses) + + But the following does not work: + + * ``xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx[yyy-zzz]`` (partial :term:`IPv6` address range) + + Examples: + + .. code-block:: none + + $cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny'; + $cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow bob from all'); + // Allow only 'bob' to connect from any host + + $cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny'; + $cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow mary from 192.168.100.[50-100]'); + // Allow only 'mary' to connect from host 192.168.100.50 through 192.168.100.100 + + $cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny'; + $cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow % from 192.168.[5-6].10'); + // Allow any user to connect from host 192.168.5.10 or 192.168.6.10 + + $cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny'; + $cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow root from 192.168.5.50','allow % from 192.168.6.10'); + // Allow any user to connect from 192.168.6.10, and additionally allow root to connect from 192.168.5.50 + +.. config:option:: $cfg['Servers'][$i]['DisableIS'] + + :type: boolean + :default: false + + Disable using ``INFORMATION_SCHEMA`` to retrieve information (use + ``SHOW`` commands instead), because of speed issues when many + databases are present. + + .. note:: + + Enabling this option might give you a big performance boost on older + MySQL servers. + +.. config:option:: $cfg['Servers'][$i]['SignonScript'] + + :type: string + :default: ``''`` + + .. versionadded:: 3.5.0 + + Name of PHP script to be sourced and executed to obtain login + credentials. This is alternative approach to session based single + signon. The script has to provide a function called + ``get_login_credentials`` which returns list of username and + password, accepting single parameter of existing username (can be + empty). See :file:`examples/signon-script.php` for an example: + + .. literalinclude:: ../examples/signon-script.php + :language: php + + .. seealso:: :ref:`auth_signon` + +.. config:option:: $cfg['Servers'][$i]['SignonSession'] + + :type: string + :default: ``''`` + + Name of session which will be used for signon authentication method. + You should use something different than ``phpMyAdmin``, because this + is session which phpMyAdmin uses internally. Takes effect only if + :config:option:`$cfg['Servers'][$i]['SignonScript']` is not configured. + + .. seealso:: :ref:`auth_signon` + +.. config:option:: $cfg['Servers'][$i]['SignonCookieParams'] + + :type: array + :default: ``array()`` + + .. versionadded:: 4.7.0 + + An associative array of session cookie parameters of other authentication system. + It is not needed if the other system doesn't use session_set_cookie_params(). + Keys should include 'lifetime', 'path', 'domain', 'secure' or 'httponly'. + Valid values are mentioned in `session_get_cookie_params `_, they should be set to same values as the + other application uses. Takes effect only if + :config:option:`$cfg['Servers'][$i]['SignonScript']` is not configured. + + .. seealso:: :ref:`auth_signon` + +.. config:option:: $cfg['Servers'][$i]['SignonURL'] + + :type: string + :default: ``''`` + + :term:`URL` where user will be redirected + to log in for signon authentication method. Should be absolute + including protocol. + + .. seealso:: :ref:`auth_signon` + +.. config:option:: $cfg['Servers'][$i]['LogoutURL'] + + :type: string + :default: ``''`` + + :term:`URL` where user will be redirected + after logout (doesn't affect config authentication method). Should be + absolute including protocol. + +.. config:option:: $cfg['Servers'][$i]['hide_connection_errors'] + + :type: boolean + :default: false + + .. versionadded:: 4.9.8 + + Whether to show or hide detailed MySQL/MariaDB connection errors on the login page. + + .. note:: + + This error message can contain the target database server hostname or IP address, + which may reveal information about your network to an attacker. + +Generic settings +---------------- + +.. config:option:: $cfg['DisableShortcutKeys'] + + :type: boolean + :default: false + + You can disable phpMyAdmin shortcut keys by setting :config:option:`$cfg['DisableShortcutKeys']` to false. + +.. config:option:: $cfg['ServerDefault'] + + :type: integer + :default: 1 + + If you have more than one server configured, you can set + :config:option:`$cfg['ServerDefault']` to any one of them to autoconnect to that + server when phpMyAdmin is started, or set it to 0 to be given a list + of servers without logging in. + + If you have only one server configured, + :config:option:`$cfg['ServerDefault']` MUST be set to that server. + +.. config:option:: $cfg['VersionCheck'] + + :type: boolean + :default: true + + Enables check for latest versions using JavaScript on the main phpMyAdmin + page or by directly accessing :file:`version_check.php`. + + .. note:: + + This setting can be adjusted by your vendor. + +.. config:option:: $cfg['ProxyUrl'] + + :type: string + :default: "" + + The url of the proxy to be used when phpmyadmin needs to access the outside + internet such as when retrieving the latest version info or submitting error + reports. You need this if the server where phpMyAdmin is installed does not + have direct access to the internet. + The format is: "hostname:portnumber" + +.. config:option:: $cfg['ProxyUser'] + + :type: string + :default: "" + + The username for authenticating with the proxy. By default, no + authentication is performed. If a username is supplied, Basic + Authentication will be performed. No other types of authentication + are currently supported. + +.. config:option:: $cfg['ProxyPass'] + + :type: string + :default: "" + + The password for authenticating with the proxy. + +.. config:option:: $cfg['MaxDbList'] + + :type: integer + :default: 100 + + The maximum number of database names to be displayed in the main panel's + database list. + +.. config:option:: $cfg['MaxTableList'] + + :type: integer + :default: 250 + + The maximum number of table names to be displayed in the main panel's + list (except on the Export page). + +.. config:option:: $cfg['ShowHint'] + + :type: boolean + :default: true + + Whether or not to show hints (for example, hints when hovering over + table headers). + +.. config:option:: $cfg['MaxCharactersInDisplayedSQL'] + + :type: integer + :default: 1000 + + The maximum number of characters when a :term:`SQL` query is displayed. The + default limit of 1000 should be correct to avoid the display of tons of + hexadecimal codes that represent BLOBs, but some users have real + :term:`SQL` queries that are longer than 1000 characters. Also, if a + query's length exceeds this limit, this query is not saved in the history. + +.. config:option:: $cfg['PersistentConnections'] + + :type: boolean + :default: false + + Whether `persistent connections `_ should be used or not. Works with + following extensions: + + * mysql (`mysql\_pconnect `_), + * mysqli (requires PHP 5.3.0 or newer, `more information + `_). + +.. config:option:: $cfg['ForceSSL'] + + :type: boolean + :default: false + + .. deprecated:: 4.6.0 + + This setting is no longer available since phpMyAdmin 4.6.0. Please + adjust your webserver instead. + + Whether to force using https while accessing phpMyAdmin. In a reverse + proxy setup, setting this to ``true`` is not supported. + + .. note:: + + In some setups (like separate SSL proxy or load balancer) you might + have to set :config:option:`$cfg['PmaAbsoluteUri']` for correct + redirection. + +.. config:option:: $cfg['ExecTimeLimit'] + + :type: integer [number of seconds] + :default: 300 + + Set the number of seconds a script is allowed to run. If seconds is + set to zero, no time limit is imposed. This setting is used while + importing/exporting dump files but has + no effect when PHP is running in safe mode. + +.. config:option:: $cfg['SessionSavePath'] + + :type: string + :default: ``''`` + + Path for storing session data (`session\_save\_path PHP parameter + `_). + + .. warning:: + + This folder should not be publicly accessible through the webserver, + otherwise you risk leaking private data from your session. + +.. config:option:: $cfg['MemoryLimit'] + + :type: string [number of bytes] + :default: ``'-1'`` + + Set the number of bytes a script is allowed to allocate. If set to + ``'-1'``, no limit is imposed. If set to ``'0'``, no change of the + memory limit is attempted and the :file:`php.ini` ``memory_limit`` is + used. + + This setting is used while importing/exporting dump files + so you definitely don't want to put here a too low + value. It has no effect when PHP is running in safe mode. + + You can also use any string as in :file:`php.ini`, eg. '16M'. Ensure you + don't omit the suffix (16 means 16 bytes!) + +.. config:option:: $cfg['SkipLockedTables'] + + :type: boolean + :default: false + + Mark used tables and make it possible to show databases with locked + tables (since MySQL 3.23.30). + +.. config:option:: $cfg['ShowSQL'] + + :type: boolean + :default: true + + Defines whether :term:`SQL` queries + generated by phpMyAdmin should be displayed or not. + +.. config:option:: $cfg['RetainQueryBox'] + + :type: boolean + :default: false + + Defines whether the :term:`SQL` query box + should be kept displayed after its submission. + +.. config:option:: $cfg['CodemirrorEnable'] + + :type: boolean + :default: true + + Defines whether to use a Javascript code editor for SQL query boxes. + CodeMirror provides syntax highlighting and line numbers. However, + middle-clicking for pasting the clipboard contents in some Linux + distributions (such as Ubuntu) is not supported by all browsers. + +.. config:option:: $cfg['DefaultForeignKeyChecks'] + + :type: string + :default: ``'default'`` + + Default value of the checkbox for foreign key checks, to disable/enable + foreign key checks for certain queries. The possible values are ``'default'``, + ``'enable'`` or ``'disable'``. If set to ``'default'``, the value of the + MySQL variable ``FOREIGN_KEY_CHECKS`` is used. + +.. config:option:: $cfg['AllowUserDropDatabase'] + + :type: boolean + :default: false + + .. warning:: + + This is not a security measure as there will be always ways to + circumvent this. If you want to prohibit users from dropping databases, + revoke their corresponding DROP privilege. + + Defines whether normal users (non-administrator) are allowed to delete + their own database or not. If set as false, the link :guilabel:`Drop + Database` will not be shown, and even a ``DROP DATABASE mydatabase`` will + be rejected. Quite practical for :term:`ISP` 's with many customers. + + This limitation of :term:`SQL` queries is not as strict as when using MySQL + privileges. This is due to nature of :term:`SQL` queries which might be + quite complicated. So this choice should be viewed as help to avoid + accidental dropping rather than strict privilege limitation. + +.. config:option:: $cfg['Confirm'] + + :type: boolean + :default: true + + Whether a warning ("Are your really sure...") should be displayed when + you're about to lose data. + +.. config:option:: $cfg['UseDbSearch'] + + :type: boolean + :default: true + + Define whether the "search string inside database" is enabled or not. + +.. config:option:: $cfg['IgnoreMultiSubmitErrors'] + + :type: boolean + :default: false + + Define whether phpMyAdmin will continue executing a multi-query + statement if one of the queries fails. Default is to abort execution. + +.. config:option:: $cfg['URLQueryEncryption'] + + :type: boolean + :default: false + + .. versionadded:: 4.9.8 + + Define whether phpMyAdmin will encrypt sensitive data (like database name + and table name) from the URL query string. Default is to not encrypt the URL + query string. + +.. config:option:: $cfg['URLQueryEncryptionSecretKey'] + + :type: string + :default: ``''`` + + .. versionadded:: 4.9.8 + + A secret key used to encrypt/decrypt the URL query string. + Should be 32 bytes long. + +Cookie authentication options +----------------------------- + +.. config:option:: $cfg['blowfish_secret'] + + :type: string + :default: ``''`` + + The "cookie" auth\_type uses AES algorithm to encrypt the password. If you + are using the "cookie" auth\_type, enter here a random passphrase of your + choice. It will be used internally by the AES algorithm: you won鈥檛 be + prompted for this passphrase. + + The secret should be 32 characters long. Using shorter will lead to weaker security + of encrypted cookies, using longer will cause no harm. + + .. note:: + + The configuration is called blowfish_secret for historical reasons as + Blowfish algorithm was originally used to do the encryption. + + .. versionchanged:: 3.1.0 + Since version 3.1.0 phpMyAdmin can generate this on the fly, but it + makes a bit weaker security as this generated secret is stored in + session and furthermore it makes impossible to recall user name from + cookie. + +.. config:option:: $cfg['LoginCookieRecall'] + + :type: boolean + :default: true + + Define whether the previous login should be recalled or not in cookie + authentication mode. + + This is automatically disabled if you do not have + configured :config:option:`$cfg['blowfish_secret']`. + +.. config:option:: $cfg['LoginCookieValidity'] + + :type: integer [number of seconds] + :default: 1440 + + Define how long a login cookie is valid. Please note that php + configuration option `session.gc\_maxlifetime + `_ might limit session validity and if the session is lost, + the login cookie is also invalidated. So it is a good idea to set + ``session.gc_maxlifetime`` at least to the same value of + :config:option:`$cfg['LoginCookieValidity']`. + +.. config:option:: $cfg['LoginCookieStore'] + + :type: integer [number of seconds] + :default: 0 + + Define how long login cookie should be stored in browser. Default 0 + means that it will be kept for existing session. This is recommended + for not trusted environments. + +.. config:option:: $cfg['LoginCookieDeleteAll'] + + :type: boolean + :default: true + + If enabled (default), logout deletes cookies for all servers, + otherwise only for current one. Setting this to false makes it easy to + forget to log out from other server, when you are using more of them. + +.. _AllowArbitraryServer: +.. config:option:: $cfg['AllowArbitraryServer'] + + :type: boolean + :default: false + + If enabled, allows you to log in to arbitrary servers using cookie + authentication. + + .. note:: + + Please use this carefully, as this may allow users access to MySQL servers + behind the firewall where your :term:`HTTP` server is placed. + See also :config:option:`$cfg['ArbitraryServerRegexp']`. + +.. config:option:: $cfg['ArbitraryServerRegexp'] + + :type: string + :default: ``''`` + + Restricts the MySQL servers to which the user can log in when + :config:option:`$cfg['AllowArbitraryServer']` is enabled by + matching the :term:`IP` or the hostname of the MySQL server + to the given regular expression. The regular expression must be enclosed + with a delimiter character. + + It is recommended to include start and end symbols in the regullar + expression, so that you can avoid partial matches on the string. + + **Examples:** + + .. code-block:: php + + // Allow connection to three listed servers: + $cfg['ArbitraryServerRegexp'] = '/^(server|another|yetdifferent)$/'; + + // Allow connection to range of IP addresses: + $cfg['ArbitraryServerRegexp'] = '@^192\.168\.0\.[0-9]{1,}$@'; + + // Allow connection to server name ending with -mysql: + $cfg['ArbitraryServerRegexp'] = '@^[^:]\-mysql$@'; + + .. note:: + + The whole server name is matched, it can include port as well. Due to + way MySQL is permissive in connection parameters, it is possible to use + connection strings as ```server:3306-mysql```. This can be used to + bypass regullar expression by the suffix, while connecting to another + server. + +.. config:option:: $cfg['CaptchaLoginPublicKey'] + + :type: string + :default: ``''`` + + The public key for the reCaptcha service that can be obtained from + https://www.google.com/recaptcha/intro/v3.html. + + reCaptcha will be then used in :ref:`cookie`. + +.. config:option:: $cfg['CaptchaLoginPrivateKey'] + + :type: string + :default: ``''`` + + The private key for the reCaptcha service that can be obtain from + https://www.google.com/recaptcha/intro/v3.html. + + reCaptcha will be then used in :ref:`cookie`. + +Navigation panel setup +---------------------- + +.. config:option:: $cfg['ShowDatabasesNavigationAsTree'] + + :type: boolean + :default: true + + In the navigation panel, replaces the database tree with a selector + +.. config:option:: $cfg['FirstLevelNavigationItems'] + + :type: integer + :default: 100 + + The number of first level databases that can be displayed on each page + of navigation tree. + +.. config:option:: $cfg['MaxNavigationItems'] + + :type: integer + :default: 50 + + The number of items (tables, columns, indexes) that can be displayed on each + page of the navigation tree. + +.. config:option:: $cfg['NavigationTreeEnableGrouping'] + + :type: boolean + :default: true + + Defines whether to group the databases based on a common prefix + in their name :config:option:`$cfg['NavigationTreeDbSeparator']`. + +.. config:option:: $cfg['NavigationTreeDbSeparator'] + + :type: string + :default: ``'_'`` + + The string used to separate the parts of the database name when + showing them in a tree. + +.. config:option:: $cfg['NavigationTreeTableSeparator'] + + :type: string or array + :default: ``'__'`` + + Defines a string to be used to nest table spaces. This means if you have + tables like ``first__second__third`` this will be shown as a three-level + hierarchy like: first > second > third. If set to false or empty, the + feature is disabled. NOTE: You should not use this separator at the + beginning or end of a table name or multiple times after another without + any other characters in between. + +.. config:option:: $cfg['NavigationTreeTableLevel'] + + :type: integer + :default: 1 + + Defines how many sublevels should be displayed when splitting up + tables by the above separator. + +.. config:option:: $cfg['NumRecentTables'] + + :type: integer + :default: 10 + + The maximum number of recently used tables shown in the navigation + panel. Set this to 0 (zero) to disable the listing of recent tables. + +.. config:option:: $cfg['NumFavoriteTables'] + + :type: integer + :default: 10 + + The maximum number of favorite tables shown in the navigation + panel. Set this to 0 (zero) to disable the listing of favorite tables. + +.. config:option:: $cfg['ZeroConf'] + + :type: boolean + :default: true + + Enables Zero Configuration mode in which the user will be offered a choice to + create phpMyAdmin configuration storage in the current database + or use the existing one, if already present. + + This setting has no effect if the phpMyAdmin configuration storage database + is properly created and the related configuration directives (such as + :config:option:`$cfg['Servers'][$i]['pmadb']` and so on) are configured. + +.. config:option:: $cfg['NavigationLinkWithMainPanel'] + + :type: boolean + :default: true + + Defines whether or not to link with main panel by highlighting + the current database or table. + +.. config:option:: $cfg['NavigationDisplayLogo'] + + :type: boolean + :default: true + + Defines whether or not to display the phpMyAdmin logo at the top of + the navigation panel. + +.. config:option:: $cfg['NavigationLogoLink'] + + :type: string + :default: ``'index.php'`` + + Enter :term:`URL` where logo in the navigation panel will point to. + For use especially with self made theme which changes this. + For relative/internal URLs, you need to have leading `` ./ `` or trailing characters `` ? `` such as ``'./sql.php?'``. + For external URLs, you should include URL protocol schemes (``http`` or ``https``) with absolute URLs. + +.. config:option:: $cfg['NavigationLogoLinkWindow'] + + :type: string + :default: ``'main'`` + + Whether to open the linked page in the main window (``main``) or in a + new one (``new``). Note: use ``new`` if you are linking to + ``phpmyadmin.net``. + +.. config:option:: $cfg['NavigationTreeDisplayItemFilterMinimum'] + + :type: integer + :default: 30 + + Defines the minimum number of items (tables, views, routines and + events) to display a JavaScript filter box above the list of items in + the navigation tree. + + To disable the filter completely some high number can be used (e.g. 9999) + +.. config:option:: $cfg['NavigationTreeDisplayDbFilterMinimum'] + + :type: integer + :default: 30 + + Defines the minimum number of databases to display a JavaScript filter + box above the list of databases in the navigation tree. + + To disable the filter completely some high number can be used + (e.g. 9999) + +.. config:option:: $cfg['NavigationDisplayServers'] + + :type: boolean + :default: true + + Defines whether or not to display a server choice at the top of the + navigation panel. + +.. config:option:: $cfg['DisplayServersList'] + + :type: boolean + :default: false + + Defines whether to display this server choice as links instead of in a + drop-down. + +.. config:option:: $cfg['NavigationTreeDefaultTabTable'] + + :type: string + :default: ``'structure'`` + + Defines the tab displayed by default when clicking the small icon next + to each table name in the navigation panel. The possible values are the + localized equivalent of: + + * ``structure`` + * ``sql`` + * ``search`` + * ``insert`` + * ``browse`` + +.. config:option:: $cfg['NavigationTreeDefaultTabTable2'] + + :type: string + :default: null + + Defines the tab displayed by default when clicking the second small icon next + to each table name in the navigation panel. The possible values are the + localized equivalent of: + + * ``(empty)`` + * ``structure`` + * ``sql`` + * ``search`` + * ``insert`` + * ``browse`` + +.. config:option:: $cfg['NavigationTreeEnableExpansion'] + + :type: boolean + :default: true + + Whether to offer the possibility of tree expansion in the navigation panel. + +.. config:option:: $cfg['NavigationTreeShowTables'] + + :type: boolean + :default: true + + Whether to show tables under database in the navigation panel. + +.. config:option:: $cfg['NavigationTreeShowViews'] + + :type: boolean + :default: true + + Whether to show views under database in the navigation panel. + +.. config:option:: $cfg['NavigationTreeShowFunctions'] + + :type: boolean + :default: true + + Whether to show functions under database in the navigation panel. + +.. config:option:: $cfg['NavigationTreeShowProcedures'] + + :type: boolean + :default: true + + Whether to show procedures under database in the navigation panel. + +.. config:option:: $cfg['NavigationTreeShowEvents'] + + :type: boolean + :default: true + + Whether to show events under database in the navigation panel. + +.. config:option:: $cfg['NavigationWidth'] + + :type: integer + :default: 240 + + Navigation panel width, set to 0 to collapse it by default. + +Main panel +---------- + +.. config:option:: $cfg['ShowStats'] + + :type: boolean + :default: true + + Defines whether or not to display space usage and statistics about + databases and tables. Note that statistics requires at least MySQL + 3.23.3 and that, at this date, MySQL doesn't return such information + for Berkeley DB tables. + +.. config:option:: $cfg['ShowServerInfo'] + + :type: boolean + :default: true + + Defines whether to display detailed server information on main page. + You can additionally hide more information by using + :config:option:`$cfg['Servers'][$i]['verbose']`. + +.. config:option:: $cfg['ShowPhpInfo'] + + :type: boolean + :default: false + + Defines whether to display the :guilabel:`PHP information` or not at + the starting main (right) frame. + + Please note that to block the usage of ``phpinfo()`` in scripts, you have to + put this in your :file:`php.ini`: + + .. code-block:: ini + + disable_functions = phpinfo() + + .. warning:: + + Enabling phpinfo page will leak quite a lot of information about server + setup. Is it not recommended to enable this on shared installations. + + This might also make easier some remote attacks on your installations, + so enable this only when needed. + +.. config:option:: $cfg['ShowChgPassword'] + + :type: boolean + :default: true + + Defines whether to display the :guilabel:`Change password` link or not at + the starting main (right) frame. This setting does not check MySQL commands + entered directly. + + Please note that enabling the :guilabel:`Change password` link has no effect + with config authentication mode: because of the hard coded password value + in the configuration file, end users can't be allowed to change their + passwords. + +.. config:option:: $cfg['ShowCreateDb'] + + :type: boolean + :default: true + + Defines whether to display the form for creating database or not at the + starting main (right) frame. This setting does not check MySQL commands + entered directly. + +.. config:option:: $cfg['ShowGitRevision'] + + :type: boolean + :default: true + + Defines whether to display informations about the current Git revision (if + applicable) on the main panel. + +.. config:option:: $cfg['MysqlMinVersion'] + + :type: array + + Defines the minimum supported MySQL version. The default is chosen + by the phpMyAdmin team; however this directive was asked by a developer + of the Plesk control panel to ease integration with older MySQL servers + (where most of the phpMyAdmin features work). + +Database structure +------------------ + +.. config:option:: $cfg['ShowDbStructureCreation'] + + :type: boolean + :default: false + + Defines whether the database structure page (tables list) has a + "Creation" column that displays when each table was created. + +.. config:option:: $cfg['ShowDbStructureLastUpdate'] + + :type: boolean + :default: false + + Defines whether the database structure page (tables list) has a "Last + update" column that displays when each table was last updated. + +.. config:option:: $cfg['ShowDbStructureLastCheck'] + + :type: boolean + :default: false + + Defines whether the database structure page (tables list) has a "Last + check" column that displays when each table was last checked. + +.. config:option:: $cfg['HideStructureActions'] + + :type: boolean + :default: true + + Defines whether the table structure actions are hidden under a "More" + drop-down. + +.. config:option:: $cfg['ShowColumnComments'] + + :type: boolean + :default: true + + Defines whether to show column comments as a column in the table structure view. + +Browse mode +----------- + +.. config:option:: $cfg['TableNavigationLinksMode'] + + :type: string + :default: ``'icons'`` + + Defines whether the table navigation links contain ``'icons'``, ``'text'`` + or ``'both'``. + +.. config:option:: $cfg['ActionLinksMode'] + + :type: string + :default: ``'both'`` + + If set to ``icons``, will display icons instead of text for db and table + properties links (like :guilabel:`Browse`, :guilabel:`Select`, + :guilabel:`Insert`, ...). Can be set to ``'both'`` + if you want icons AND text. When set to ``text``, will only show text. + +.. config:option:: $cfg['RowActionType'] + + :type: string + :default: ``'both'`` + + Whether to display icons or text or both icons and text in table row action + segment. Value can be either of ``'icons'``, ``'text'`` or ``'both'``. + +.. config:option:: $cfg['ShowAll'] + + :type: boolean + :default: false + + Defines whether a user should be displayed a "Show all" button in browse + mode or not in all cases. By default it is shown only on small tables (less + than 500 rows) to avoid performance issues while getting too many rows. + +.. config:option:: $cfg['MaxRows'] + + :type: integer + :default: 25 + + Number of rows displayed when browsing a result set and no LIMIT + clause is used. If the result set contains more rows, "Previous" and + "Next" links will be shown. Possible values: 25,50,100,250,500. + +.. config:option:: $cfg['Order'] + + :type: string + :default: ``'SMART'`` + + Defines whether columns are displayed in ascending (``ASC``) order, in + descending (``DESC``) order or in a "smart" (``SMART``) order - I.E. + descending order for columns of type TIME, DATE, DATETIME and + TIMESTAMP, ascending order else- by default. + + .. versionchanged:: 3.4.0 + Since phpMyAdmin 3.4.0 the default value is ``'SMART'``. + +.. config:option:: $cfg['GridEditing'] + + :type: string + :default: ``'double-click'`` + + Defines which action (``double-click`` or ``click``) triggers grid + editing. Can be deactivated with the ``disabled`` value. + +.. config:option:: $cfg['RelationalDisplay'] + + :type: string + :default: ``'K'`` + + Defines the initial behavior for Options > Relational. ``K``, which + is the default, displays the key while ``D`` shows the display column. + +.. config:option:: $cfg['SaveCellsAtOnce'] + + :type: boolean + :default: false + + Defines whether or not to save all edited cells at once for grid + editing. + +Editing mode +------------ + +.. config:option:: $cfg['ProtectBinary'] + + :type: boolean or string + :default: ``'blob'`` + + Defines whether ``BLOB`` or ``BINARY`` columns are protected from + editing when browsing a table's content. Valid values are: + + * ``false`` to allow editing of all columns; + * ``'blob'`` to allow editing of all columns except ``BLOBS``; + * ``'noblob'`` to disallow editing of all columns except ``BLOBS`` (the + opposite of ``'blob'``); + * ``'all'`` to disallow editing of all ``BINARY`` or ``BLOB`` columns. + +.. config:option:: $cfg['ShowFunctionFields'] + + :type: boolean + :default: true + + Defines whether or not MySQL functions fields should be initially + displayed in edit/insert mode. Since version 2.10, the user can toggle + this setting from the interface. + +.. config:option:: $cfg['ShowFieldTypesInDataEditView'] + + :type: boolean + :default: true + + Defines whether or not type fields should be initially displayed in + edit/insert mode. The user can toggle this setting from the interface. + +.. config:option:: $cfg['InsertRows'] + + :type: integer + :default: 2 + + Defines the default number of rows to be entered from the Insert page. + Users can manually change this from the bottom of that page to add or remove + blank rows. + +.. config:option:: $cfg['ForeignKeyMaxLimit'] + + :type: integer + :default: 100 + + If there are fewer items than this in the set of foreign keys, then a + drop-down box of foreign keys is presented, in the style described by + the :config:option:`$cfg['ForeignKeyDropdownOrder']` setting. + +.. config:option:: $cfg['ForeignKeyDropdownOrder'] + + :type: array + :default: array('content-id', 'id-content') + + For the foreign key drop-down fields, there are several methods of + display, offering both the key and value data. The contents of the + array should be one or both of the following strings: ``content-id``, + ``id-content``. + +Export and import settings +-------------------------- + +.. config:option:: $cfg['ZipDump'] + + :type: boolean + :default: true + +.. config:option:: $cfg['GZipDump'] + + :type: boolean + :default: true + +.. config:option:: $cfg['BZipDump'] + + :type: boolean + :default: true + + Defines whether to allow the use of zip/GZip/BZip2 compression when + creating a dump file + +.. config:option:: $cfg['CompressOnFly'] + + :type: boolean + :default: true + + Defines whether to allow on the fly compression for GZip/BZip2 + compressed exports. This doesn't affect smaller dumps and allows users + to create larger dumps that won't otherwise fit in memory due to php + memory limit. Produced files contain more GZip/BZip2 headers, but all + normal programs handle this correctly. + +.. config:option:: $cfg['Export'] + + :type: array + :default: array(...) + + In this array are defined default parameters for export, names of + items are similar to texts seen on export page, so you can easily + identify what they mean. + +.. config:option:: $cfg['Export']['format'] + + :type: string + :default: ``'sql'`` + + Default export format. + +.. config:option:: $cfg['Export']['method'] + + :type: string + :default: ``'quick'`` + + Defines how the export form is displayed when it loads. Valid values + are: + + * ``quick`` to display the minimum number of options to configure + * ``custom`` to display every available option to configure + * ``custom-no-form`` same as ``custom`` but does not display the option + of using quick export + +.. config:option:: $cfg['Export']['charset'] + + :type: string + :default: ``''`` + + Defines charset for generated export. By default no charset conversion is + done assuming UTF-8. + +.. config:option:: $cfg['Export']['file_template_table'] + + :type: string + :default: ``'@TABLE@'`` + + Default filename template for table exports. + + .. seealso:: :ref:`faq6_27` + +.. config:option:: $cfg['Export']['file_template_database'] + + :type: string + :default: ``'@DATABASE@'`` + + Default filename template for database exports. + + .. seealso:: :ref:`faq6_27` + +.. config:option:: $cfg['Export']['file_template_server'] + + :type: string + :default: ``'@SERVER@'`` + + Default filename template for server exports. + + .. seealso:: :ref:`faq6_27` + +.. config:option:: $cfg['Import'] + + :type: array + :default: array(...) + + In this array are defined default parameters for import, names of + items are similar to texts seen on import page, so you can easily + identify what they mean. + +.. config:option:: $cfg['Import']['charset'] + + :type: string + :default: ``''`` + + Defines charset for import. By default no charset conversion is done + assuming UTF-8. + +Tabs display settings +--------------------- + +.. config:option:: $cfg['TabsMode'] + + :type: string + :default: ``'both'`` + + Defines whether the menu tabs contain ``'icons'``, ``'text'`` or ``'both'``. + +.. config:option:: $cfg['PropertiesNumColumns'] + + :type: integer + :default: 1 + + How many columns will be utilized to display the tables on the database + property view? When setting this to a value larger than 1, the type of the + database will be omitted for more display space. + +.. config:option:: $cfg['DefaultTabServer'] + + :type: string + :default: ``'welcome'`` + + Defines the tab displayed by default on server view. The possible values + are the localized equivalent of: + + * ``welcome`` (recommended for multi-user setups) + * ``databases``, + * ``status`` + * ``variables`` + * ``privileges`` + +.. config:option:: $cfg['DefaultTabDatabase'] + + :type: string + :default: ``'structure'`` + + Defines the tab displayed by default on database view. The possible values + are the localized equivalent of: + + * ``structure`` + * ``sql`` + * ``search`` + * ``operations`` + +.. config:option:: $cfg['DefaultTabTable'] + + :type: string + :default: ``'browse'`` + + Defines the tab displayed by default on table view. The possible values + are the localized equivalent of: + + * ``structure`` + * ``sql`` + * ``search`` + * ``insert`` + * ``browse`` + +PDF Options +----------- + +.. config:option:: $cfg['PDFPageSizes'] + + :type: array + :default: ``array('A3', 'A4', 'A5', 'letter', 'legal')`` + + Array of possible paper sizes for creating PDF pages. + + You should never need to change this. + +.. config:option:: $cfg['PDFDefaultPageSize'] + + :type: string + :default: ``'A4'`` + + Default page size to use when creating PDF pages. Valid values are any + listed in :config:option:`$cfg['PDFPageSizes']`. + +Languages +--------- + +.. config:option:: $cfg['DefaultLang'] + + :type: string + :default: ``'en'`` + + Defines the default language to use, if not browser-defined or user- + defined. The corresponding language file needs to be in + locale/*code*/LC\_MESSAGES/phpmyadmin.mo. + +.. config:option:: $cfg['DefaultConnectionCollation'] + + :type: string + :default: ``'utf8mb4_general_ci'`` + + Defines the default connection collation to use, if not user-defined. + See the `MySQL documentation for charsets + `_ + for list of possible values. + +.. config:option:: $cfg['Lang'] + + :type: string + :default: not set + + Force language to use. The corresponding language file needs to be in + locale/*code*/LC\_MESSAGES/phpmyadmin.mo. + +.. config:option:: $cfg['FilterLanguages'] + + :type: string + :default: ``''`` + + Limit list of available languages to those matching the given regular + expression. For example if you want only Czech and English, you should + set filter to ``'^(cs|en)'``. + +.. config:option:: $cfg['RecodingEngine'] + + :type: string + :default: ``'auto'`` + + You can select here which functions will be used for character set + conversion. Possible values are: + + * auto - automatically use available one (first is tested iconv, then + recode) + * iconv - use iconv or libiconv functions + * recode - use recode\_string function + * mb - use :term:`mbstring` extension + * none - disable encoding conversion + + Enabled charset conversion activates a pull-down menu in the Export + and Import pages, to choose the character set when exporting a file. + The default value in this menu comes from + :config:option:`$cfg['Export']['charset']` and :config:option:`$cfg['Import']['charset']`. + +.. config:option:: $cfg['IconvExtraParams'] + + :type: string + :default: ``'//TRANSLIT'`` + + Specify some parameters for iconv used in charset conversion. See + `iconv documentation `_ for details. By default + ``//TRANSLIT`` is used, so that invalid characters will be + transliterated. + +.. config:option:: $cfg['AvailableCharsets'] + + :type: array + :default: array(...) + + Available character sets for MySQL conversion. You can add your own + (any of supported by recode/iconv) or remove these which you don't + use. Character sets will be shown in same order as here listed, so if + you frequently use some of these move them to the top. + +Web server settings +------------------- + +.. config:option:: $cfg['OBGzip'] + + :type: string/boolean + :default: ``'auto'`` + + Defines whether to use GZip output buffering for increased speed in + :term:`HTTP` transfers. Set to + true/false for enabling/disabling. When set to 'auto' (string), + phpMyAdmin tries to enable output buffering and will automatically + disable it if your browser has some problems with buffering. IE6 with + a certain patch is known to cause data corruption when having enabled + buffering. + +.. config:option:: $cfg['TrustedProxies'] + + :type: array + :default: array() + + Lists proxies and HTTP headers which are trusted for + :config:option:`$cfg['Servers'][$i]['AllowDeny']['order']`. This list is by + default empty, you need to fill in some trusted proxy servers if you + want to use rules for IP addresses behind proxy. + + The following example specifies that phpMyAdmin should trust a + HTTP\_X\_FORWARDED\_FOR (``X-Forwarded-For``) header coming from the proxy + 1.2.3.4: + + .. code-block:: php + + $cfg['TrustedProxies'] = array('1.2.3.4' => 'HTTP_X_FORWARDED_FOR'); + + The :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` directive uses the + client's IP address as usual. + +.. config:option:: $cfg['GD2Available'] + + :type: string + :default: ``'auto'`` + + Specifies whether GD >= 2 is available. If yes it can be used for MIME + transformations. Possible values are: + + * auto - automatically detect + * yes - GD 2 functions can be used + * no - GD 2 function cannot be used + +.. config:option:: $cfg['CheckConfigurationPermissions'] + + :type: boolean + :default: true + + We normally check the permissions on the configuration file to ensure + it's not world writable. However, phpMyAdmin could be installed on a + NTFS filesystem mounted on a non-Windows server, in which case the + permissions seems wrong but in fact cannot be detected. In this case a + sysadmin would set this parameter to ``false``. + +.. config:option:: $cfg['LinkLengthLimit'] + + :type: integer + :default: 1000 + + Limit for length of :term:`URL` in links. When length would be above this + limit, it is replaced by form with button. This is required as some web + servers (:term:`IIS`) have problems with long :term:`URL` . + +.. config:option:: $cfg['CSPAllow'] + + :type: string + :default: ``''`` + + Additional string to include in allowed script and image sources in Content + Security Policy header. + + This can be useful when you want to include some external JavaScript files + in :file:`config.footer.inc.php` or :file:`config.header.inc.php`, which + would be normally not allowed by Content Security Policy. + + To allow some sites, just list them within the string: + + .. code-block:: php + + $cfg['CSPAllow'] = 'example.com example.net'; + + .. versionadded:: 4.0.4 + +.. config:option:: $cfg['DisableMultiTableMaintenance'] + + :type: boolean + :default: false + + In the database Structure page, it's possible to mark some tables then + choose an operation like optimizing for many tables. This can slow + down a server; therefore, setting this to ``true`` prevents this kind + of multiple maintenance operation. + +Theme settings +-------------- + + Please directly modify :file:`themes/themename/layout.inc.php`, although + your changes will be overwritten with the next update. + +Design customization +-------------------- + +.. config:option:: $cfg['NavigationTreePointerEnable'] + + :type: boolean + :default: true + + When set to true, hovering over an item in the navigation panel causes that item to be marked + (the background is highlighted). + +.. config:option:: $cfg['BrowsePointerEnable'] + + :type: boolean + :default: true + + When set to true, hovering over a row in the Browse page causes that row to be marked (the background + is highlighted). + +.. config:option:: $cfg['BrowseMarkerEnable'] + + :type: boolean + :default: true + + When set to true, a data row is marked (the background is highlighted) when the row is selected + with the checkbox. + +.. config:option:: $cfg['LimitChars'] + + :type: integer + :default: 50 + + Maximum number of characters shown in any non-numeric field on browse + view. Can be turned off by a toggle button on the browse page. + +.. config:option:: $cfg['RowActionLinks'] + + :type: string + :default: ``'left'`` + + Defines the place where table row links (Edit, Copy, Delete) would be + put when tables contents are displayed (you may have them displayed at + the left side, right side, both sides or nowhere). + +.. config:option:: $cfg['RowActionLinksWithoutUnique'] + + :type: boolean + :default: false + + Defines whether to show row links (Edit, Copy, Delete) and checkboxes + for multiple row operations even when the selection does not have a :term:`unique key`. + Using row actions in the absence of a unique key may result in different/more + rows being affected since there is no guaranteed way to select the exact row(s). + +.. config:option:: $cfg['RememberSorting'] + + :type: boolean + :default: true + + If enabled, remember the sorting of each table when browsing them. + +.. config:option:: $cfg['TablePrimaryKeyOrder'] + + :type: string + :default: ``'NONE'`` + + This defines the default sort order for the tables, having a :term:`primary key`, + when there is no sort order defines externally. + Acceptable values : ['NONE', 'ASC', 'DESC'] + +.. config:option:: $cfg['ShowBrowseComments'] + + :type: boolean + :default: true + +.. config:option:: $cfg['ShowPropertyComments'] + + :type: boolean + :default: true + + By setting the corresponding variable to ``true`` you can enable the + display of column comments in Browse or Property display. In browse + mode, the comments are shown inside the header. In property mode, + comments are displayed using a CSS-formatted dashed-line below the + name of the column. The comment is shown as a tool-tip for that + column. + +Text fields +----------- + +.. config:option:: $cfg['CharEditing'] + + :type: string + :default: ``'input'`` + + Defines which type of editing controls should be used for CHAR and + VARCHAR columns. Applies to data editing and also to the default values + in structure editing. Possible values are: + + * input - this allows to limit size of text to size of columns in MySQL, + but has problems with newlines in columns + * textarea - no problems with newlines in columns, but also no length + limitations + +.. config:option:: $cfg['MinSizeForInputField'] + + :type: integer + :default: 4 + + Defines the minimum size for input fields generated for CHAR and + VARCHAR columns. + +.. config:option:: $cfg['MaxSizeForInputField'] + + :type: integer + :default: 60 + + Defines the maximum size for input fields generated for CHAR and + VARCHAR columns. + +.. config:option:: $cfg['TextareaCols'] + + :type: integer + :default: 40 + +.. config:option:: $cfg['TextareaRows'] + + :type: integer + :default: 15 + +.. config:option:: $cfg['CharTextareaCols'] + + :type: integer + :default: 40 + +.. config:option:: $cfg['CharTextareaRows'] + + :type: integer + :default: 2 + + Number of columns and rows for the textareas. This value will be + emphasized (\*2) for :term:`SQL` query + textareas and (\*1.25) for :term:`SQL` + textareas inside the query window. + + The Char\* values are used for CHAR + and VARCHAR editing (if configured via :config:option:`$cfg['CharEditing']`). + +.. config:option:: $cfg['LongtextDoubleTextarea'] + + :type: boolean + :default: true + + Defines whether textarea for LONGTEXT columns should have double size. + +.. config:option:: $cfg['TextareaAutoSelect'] + + :type: boolean + :default: false + + Defines if the whole textarea of the query box will be selected on + click. + +.. config:option:: $cfg['EnableAutocompleteForTablesAndColumns'] + + :type: boolean + :default: true + + Whether to enable autocomplete for table and column names in any + SQL query box. + +SQL query box settings +---------------------- + +.. config:option:: $cfg['SQLQuery']['Edit'] + + :type: boolean + :default: true + + Whether to display an edit link to change a query in any SQL Query + box. + +.. config:option:: $cfg['SQLQuery']['Explain'] + + :type: boolean + :default: true + + Whether to display a link to explain a SELECT query in any SQL Query + box. + +.. config:option:: $cfg['SQLQuery']['ShowAsPHP'] + + :type: boolean + :default: true + + Whether to display a link to wrap a query in PHP code in any SQL Query + box. + +.. config:option:: $cfg['SQLQuery']['Refresh'] + + :type: boolean + :default: true + + Whether to display a link to refresh a query in any SQL Query box. + +.. _web-dirs: + +Web server upload/save/import directories +----------------------------------------- + +If PHP is running in safe mode, all directories must be owned by the same user +as the owner of the phpMyAdmin scripts. + +If the directory where phpMyAdmin is installed is subject to an +``open_basedir`` restriction, you need to create a temporary directory in some +directory accessible by the PHP interpreter. + +For security reasons, all directories should be outside the tree published by +webserver. If you cannot avoid having this directory published by webserver, +limit access to it either by web server configuration (for example using +.htaccess or web.config files) or place at least an empty :file:`index.html` +file there, so that directory listing is not possible. However as long as the +directory is accessible by web server, an attacker can guess filenames to download +the files. + +.. config:option:: $cfg['UploadDir'] + + :type: string + :default: ``''`` + + The name of the directory where :term:`SQL` files have been uploaded by + other means than phpMyAdmin (for example, ftp). Those files are available + under a drop-down box when you click the database or table name, then the + Import tab. + + If + you want different directory for each user, %u will be replaced with + username. + + Please note that the file names must have the suffix ".sql" + (or ".sql.bz2" or ".sql.gz" if support for compressed formats is + enabled). + + This feature is useful when your file is too big to be + uploaded via :term:`HTTP`, or when file + uploads are disabled in PHP. + + .. warning:: + + Please see top of this chapter (:ref:`web-dirs`) for instructions how + to setup this directory and how to make its usage secure. + + .. seealso:: + + See :ref:`faq1_16` for alternatives. + +.. config:option:: $cfg['SaveDir'] + + :type: string + :default: ``''`` + + The name of the webserver directory where exported files can be saved. + + If you want a different directory for each user, %u will be replaced with the + username. + + Please note that the directory must exist and has to be writable for + the user running webserver. + + .. warning:: + + Please see top of this chapter (:ref:`web-dirs`) for instructions how + to setup this directory and how to make its usage secure. + +.. config:option:: $cfg['TempDir'] + + :type: string + :default: ``'./tmp/'`` + + The name of the directory where temporary files can be stored. It is used + for several purposes, currently: + + * The templates cache which speeds up page loading. + * ESRI Shapefiles import, see :ref:`faq6_30`. + * To work around limitations of ``open_basedir`` for uploaded files, see + :ref:`faq1_11`. + + This directory should have as strict permissions as possible as the only + user required to access this directory is the one who runs the webserver. + If you have root privileges, simply make this user owner of this directory + and make it accessible only by it: + + .. code-block:: sh + + chown www-data:www-data tmp + chmod 700 tmp + + If you cannot change owner of the directory, you can achieve a similar + setup using :term:`ACL`: + + .. code-block:: sh + + chmod 700 tmp + setfacl -m "g:www-data:rwx" tmp + setfacl -d -m "g:www-data:rwx" tmp + + If neither of above works for you, you can still make the directory + :command:`chmod 777`, but it might impose risk of other users on system + reading and writing data in this directory. + + .. warning:: + + Please see top of this chapter (:ref:`web-dirs`) for instructions how + to setup this directory and how to make its usage secure. + +Various display setting +----------------------- + +.. config:option:: $cfg['RepeatCells'] + + :type: integer + :default: 100 + + Repeat the headers every X cells, or 0 to deactivate. + +.. config:option:: $cfg['QueryHistoryDB'] + + :type: boolean + :default: false + +.. config:option:: $cfg['QueryHistoryMax'] + + :type: integer + :default: 25 + + If :config:option:`$cfg['QueryHistoryDB']` is set to ``true``, all your + Queries are logged to a table, which has to be created by you (see + :config:option:`$cfg['Servers'][$i]['history']`). If set to false, all your + queries will be appended to the form, but only as long as your window is + opened they remain saved. + + When using the JavaScript based query window, it will always get updated + when you click on a new table/db to browse and will focus if you click on + :guilabel:`Edit SQL` after using a query. You can suppress updating the + query window by checking the box :guilabel:`Do not overwrite this query + from outside the window` below the query textarea. Then you can browse + tables/databases in the background without losing the contents of the + textarea, so this is especially useful when composing a query with tables + you first have to look in. The checkbox will get automatically checked + whenever you change the contents of the textarea. Please uncheck the button + whenever you definitely want the query window to get updated even though + you have made alterations. + + If :config:option:`$cfg['QueryHistoryDB']` is set to ``true`` you can + specify the amount of saved history items using + :config:option:`$cfg['QueryHistoryMax']`. + +.. config:option:: $cfg['BrowseMIME'] + + :type: boolean + :default: true + + Enable :ref:`transformations`. + +.. config:option:: $cfg['MaxExactCount'] + + :type: integer + :default: 50000 + + For InnoDB tables, determines for how large tables phpMyAdmin should + get the exact row count using ``SELECT COUNT``. If the approximate row + count as returned by ``SHOW TABLE STATUS`` is smaller than this value, + ``SELECT COUNT`` will be used, otherwise the approximate count will be + used. + + .. versionchanged:: 4.8.0 + + The default value was lowered to 50000 for performance reasons. + + .. versionchanged:: 4.2.6 + + The default value was changed to 500000. + + .. seealso:: :ref:`faq3_11` + +.. config:option:: $cfg['MaxExactCountViews'] + + :type: integer + :default: 0 + + For VIEWs, since obtaining the exact count could have an impact on + performance, this value is the maximum to be displayed, using a + ``SELECT COUNT ... LIMIT``. Setting this to 0 bypasses any row + counting. + +.. config:option:: $cfg['NaturalOrder'] + + :type: boolean + :default: true + + Sorts database and table names according to natural order (for + example, t1, t2, t10). Currently implemented in the navigation panel + and in Database view, for the table list. + +.. config:option:: $cfg['InitialSlidersState'] + + :type: string + :default: ``'closed'`` + + If set to ``'closed'``, the visual sliders are initially in a closed + state. A value of ``'open'`` does the reverse. To completely disable + all visual sliders, use ``'disabled'``. + +.. config:option:: $cfg['UserprefsDisallow'] + + :type: array + :default: array() + + Contains names of configuration options (keys in ``$cfg`` array) that + users can't set through user preferences. For possible values, refer + to clases under :file:`libraries/classes/Config/Forms/User/`. + +.. config:option:: $cfg['UserprefsDeveloperTab'] + + :type: boolean + :default: false + + Activates in the user preferences a tab containing options for + developers of phpMyAdmin. + +Page titles +----------- + +.. config:option:: $cfg['TitleTable'] + + :type: string + :default: ``'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@'`` + +.. config:option:: $cfg['TitleDatabase'] + + :type: string + :default: ``'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ | @PHPMYADMIN@'`` + +.. config:option:: $cfg['TitleServer'] + + :type: string + :default: ``'@HTTP_HOST@ / @VSERVER@ | @PHPMYADMIN@'`` + +.. config:option:: $cfg['TitleDefault'] + + :type: string + :default: ``'@HTTP_HOST@ | @PHPMYADMIN@'`` + + Allows you to specify window's title bar. You can use :ref:`faq6_27`. + +Theme manager settings +---------------------- + +.. config:option:: $cfg['ThemeManager'] + + :type: boolean + :default: true + + Enables user-selectable themes. See :ref:`faqthemes`. + +.. config:option:: $cfg['ThemeDefault'] + + :type: string + :default: ``'pmahomme'`` + + The default theme (a subdirectory under :file:`./themes/`). + +.. config:option:: $cfg['ThemePerServer'] + + :type: boolean + :default: false + + Whether to allow different theme for each server. + +.. config:option:: $cfg['FontSize'] + + :type: string + :default: '82%' + + Font size to use, is applied in CSS. + +Default queries +--------------- + +.. config:option:: $cfg['DefaultQueryTable'] + + :type: string + :default: ``'SELECT * FROM @TABLE@ WHERE 1'`` + +.. config:option:: $cfg['DefaultQueryDatabase'] + + :type: string + :default: ``''`` + + Default queries that will be displayed in query boxes when user didn't + specify any. You can use standard :ref:`faq6_27`. + +MySQL settings +-------------- + +.. config:option:: $cfg['DefaultFunctions'] + + :type: array + :default: array(...) + + Functions selected by default when inserting/changing row, Functions + are defined for meta types as (FUNC\_NUMBER, FUNC\_DATE, FUNC\_CHAR, + FUNC\_SPATIAL, FUNC\_UUID) and for ``first_timestamp``, which is used + for first timestamp column in table. + +Default options for Transformations +----------------------------------- + +.. config:option:: $cfg['DefaultTransformations'] + + :type: array + :default: An array with below listed key-values + +.. config:option:: $cfg['DefaultTransformations']['Substring'] + + :type: array + :default: array(0, 'all', '鈥�') + +.. config:option:: $cfg['DefaultTransformations']['Bool2Text'] + + :type: array + :default: array('T', 'F') + +.. config:option:: $cfg['DefaultTransformations']['External'] + + :type: array + :default: array(0, '-f /dev/null -i -wrap -q', 1, 1) + +.. config:option:: $cfg['DefaultTransformations']['PreApPend'] + + :type: array + :default: array('', '') + +.. config:option:: $cfg['DefaultTransformations']['Hex'] + + :type: array + :default: array('2') + +.. config:option:: $cfg['DefaultTransformations']['DateFormat'] + + :type: array + :default: array(0, '', 'local') + +.. config:option:: $cfg['DefaultTransformations']['Inline'] + + :type: array + :default: array('100', 100) + +.. config:option:: $cfg['DefaultTransformations']['TextImageLink'] + + :type: array + :default: array('', 100, 50) + +.. config:option:: $cfg['DefaultTransformations']['TextLink'] + + :type: array + :default: array('', '', '') + +Console settings +---------------- + +.. note:: + + These settings are mostly meant to be changed by user. + +.. config:option:: $cfg['Console']['StartHistory'] + + :type: boolean + :default: false + + Show query history at start + +.. config:option:: $cfg['Console']['AlwaysExpand'] + + :type: boolean + :default: false + + Always expand query messages + +.. config:option:: $cfg['Console']['CurrentQuery'] + + :type: boolean + :default: true + + Show current browsing query + +.. config:option:: $cfg['Console']['EnterExecutes'] + + :type: boolean + :default: false + + Execute queries on Enter and insert new line with Shift + Enter + +.. config:option:: $cfg['Console']['DarkTheme'] + + :type: boolean + :default: false + + Switch to dark theme + +.. config:option:: $cfg['Console']['Mode'] + + :type: string + :default: 'info' + + Console mode + +.. config:option:: $cfg['Console']['Height'] + + :type: integer + :default: 92 + + Console height + +Developer +--------- + +.. warning:: + + These settings might have huge effect on performance or security. + +.. config:option:: $cfg['DBG'] + + :type: array + :default: array(...) + +.. config:option:: $cfg['DBG']['sql'] + + :type: boolean + :default: false + + Enable logging queries and execution times to be + displayed in the console's Debug SQL tab. + +.. config:option:: $cfg['DBG']['sqllog'] + + :type: boolean + :default: false + + Enable logging of queries and execution times to the syslog. + Requires :config:option:`$cfg['DBG']['sql']` to be enabled. + +.. config:option:: $cfg['DBG']['demo'] + + :type: boolean + :default: false + + Enable to let server present itself as demo server. + This is used for `phpMyAdmin demo server `_. + + It currently changes following behavior: + + * There is welcome message on the main page. + * There is footer information about demo server and used git revision. + * The setup script is enabled even with existing configuration. + * The setup does not try to connect to the MySQL server. + +.. config:option:: $cfg['DBG']['simple2fa'] + + :type: boolean + :default: false + + Can be used for testing two-factor authentication using :ref:`simple2fa`. + +.. _config-examples: + +Examples +-------- + +See following configuration snippets for typical setups of phpMyAdmin. + +Basic example ++++++++++++++ + +Example configuration file, which can be copied to :file:`config.inc.php` to +get some core configuration layout; it is distributed with phpMyAdmin as +:file:`config.sample.inc.php`. Please note that it does not contain all +configuration options, only the most frequently used ones. + +.. literalinclude:: ../config.sample.inc.php + :language: php + +.. warning:: + + Don't use the controluser 'pma' if it does not yet exist and don't use 'pmapass' + as password. + +.. _example-signon: + +Example for signon authentication ++++++++++++++++++++++++++++++++++ + +This example uses :file:`examples/signon.php` to demonstrate usage of :ref:`auth_signon`: + +.. code-block:: php + + ` + +Example for IP address limited autologin +++++++++++++++++++++++++++++++++++++++++ + +If you want to automatically login when accessing phpMyAdmin locally while asking +for a password when accessing remotely, you can achieve it using following snippet: + +.. code-block:: php + + if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") { + $cfg['Servers'][$i]['auth_type'] = 'config'; + $cfg['Servers'][$i]['user'] = 'root'; + $cfg['Servers'][$i]['password'] = 'yourpassword'; + } else { + $cfg['Servers'][$i]['auth_type'] = 'cookie'; + } + +.. note:: + + Filtering based on IP addresses isn't reliable over the internet, use it + only for local address. + +Example for using multiple MySQL servers +++++++++++++++++++++++++++++++++++++++++ + +You can configure any number of servers using :config:option:`$cfg['Servers']`, +following example shows two of them: + +.. code-block:: php + + + +.. _example-google-ssl: + +Google Cloud SQL with SSL ++++++++++++++++++++++++++ + +To connect to Google Could SQL, you currently need to disable certificate +verification. This is caused by the certficate being issued for CN matching +your instance name, but you connect to an IP address and PHP tries to match +these two. With verfication you end up with error message like: + +.. code-block:: text + + Peer certificate CN=`api-project-851612429544:pmatest' did not match expected CN=`8.8.8.8' + +.. warning:: + + With disabled verification your traffic is encrypted, but you're open to + man in the middle attacks. + +To connect phpMyAdmin to Google Cloud SQL using SSL download the client and +server certificates and tell phpMyAdmin to use them: + +.. code-block:: php + + // IP address of your instance + $cfg['Servers'][$i]['host'] = '8.8.8.8'; + // Use SSL for connection + $cfg['Servers'][$i]['ssl'] = true; + // Client secret key + $cfg['Servers'][$i]['ssl_key'] = '../client-key.pem'; + // Client certificate + $cfg['Servers'][$i]['ssl_cert'] = '../client-cert.pem'; + // Server certification authority + $cfg['Servers'][$i]['ssl_ca'] = '../server-ca.pem'; + // Disable SSL verification (see above note) + $cfg['Servers'][$i]['ssl_verify'] = false; + +.. seealso:: + + :ref:`ssl`, + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']`, + diff --git a/phpMyAdmin/doc/html/_sources/copyright.rst.txt b/phpMyAdmin/doc/html/_sources/copyright.rst.txt new file mode 100755 index 0000000..ed18723 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/copyright.rst.txt @@ -0,0 +1,42 @@ +.. _copyright: + +Copyright +========= + +.. code-block:: none + + Copyright (C) 1998-2000 Tobias Ratschiller + Copyright (C) 2001-2018 Marc Delisle + Olivier M眉ller + Robin Johnson + Alexander M. Turek + Michal 膶iha艡 + Garvin Hicking + Michael Keck + Sebastian Mendel + [check credits for more details] + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License version 2, as +published by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Third party licenses +++++++++++++++++++++ + +phpMyAdmin includes several third-party libraries which come under their +respective licenses. + +jQuery's license, which is where we got the files under js/vendor/jquery/ is +(MIT|GPL), a copy of each license is available in this repository (GPL +is available as LICENSE, MIT as js/vendor/jquery/MIT-LICENSE.txt). + +The download kit additionally includes several composer libraries. See their +licensing information in the vendor/ directory. diff --git a/phpMyAdmin/doc/html/_sources/credits.rst.txt b/phpMyAdmin/doc/html/_sources/credits.rst.txt new file mode 100755 index 0000000..4dc828c --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/credits.rst.txt @@ -0,0 +1,1043 @@ +.. _credits: + +Credits +======= + +Credits, in chronological order ++++++++++++++++++++++++++++++++ + +* Tobias Ratschiller + + * creator of the phpMyAdmin project + + * maintainer from 1998 to summer 2000 + +* Marc Delisle + + * multi-language version in December 1998 + + * various fixes and improvements + + * first version of the :term:`SQL` analyser (most of it) + + * maintainer from 2001 to 2015 + +* Olivier M眉ller + + * started SourceForge phpMyAdmin project in March 2001 + + * sync'ed different existing CVS trees with new features and bugfixes + + * multi-language improvements, dynamic language selection + + * many bugfixes and improvements + +* Lo茂c Chapeaux + + * rewrote and optimized JavaScript, DHTML and DOM stuff + + * rewrote the scripts so they fit the :term:`PEAR` coding standards and + generate XHTML1.0 and CSS2 compliant codes + + * improved the language detection system + + * many bugfixes and improvements + +* Robin Johnson + + * database maintenance controls + + * table type code + + * Host authentication :term:`IP` Allow/Deny + + * DB-based configuration (Not completed) + + * :term:`SQL` parser and pretty-printer + + * :term:`SQL` validator + + * many bugfixes and improvements + +* Armel Fauveau + + * bookmarks feature + + * multiple dump feature + + * gzip dump feature + + * zip dump feature + +* Geert Lund + + * various fixes + + * moderator of the phpMyAdmin former users forum at phpwizard.net + +* Korakot Chaovavanich + + * "insert as new row" feature + +* Pete Kelly + + * rewrote and fix dump code + + * bugfixes + +* Steve Alberty + + * rewrote dump code for PHP4 + + * mySQL table statistics + + * bugfixes + +* Benjamin Gandon + + * main author of the version 2.1.0.1 + + * bugfixes + +* Alexander M. Turek + + * MySQL 4.0 / 4.1 / 5.0 compatibility + + * abstract database interface (PMA\_DBI) with MySQLi support + + * privileges administration + + * :term:`XML` exports + + * various features and fixes + + * German language file updates + +* Mike Beck + + * automatic joins in QBE + + * links column in printview + + * Relation view + +* Michal 膶iha艡 + + * enhanced index creation/display feature + + * feature to use a different charset for HTML than for MySQL + + * improvements of export feature + + * various features and fixes + + * Czech language file updates + + * created current website for phpMyAdmin + +* Christophe Gesch茅 from the "MySQL Form Generator for PHPMyAdmin" + (https://sourceforge.net/projects/phpmysqlformgen/) + + * suggested the patch for multiple table printviews + +* Garvin Hicking + + * built the patch for vertical display of table rows + + * built the Javascript based Query window + :term:`SQL` history + + * Improvement of column/db comments + + * (MIME)-Transformations for columns + + * Use custom alias names for Databases in left frame + + * hierarchical/nested table display + + * :term:`PDF`-scratchboard for WYSIWYG- + distribution of :term:`PDF` relations + + * new icon sets + + * vertical display of column properties page + + * some bugfixes, features, support, German language additions + +* Yukihiro Kawada + + * japanese kanji encoding conversion feature + +* Piotr Roszatycki and Dan Wilson + + * the Cookie authentication mode + +* Axel Sander + + * table relation-links feature + +* Maxime Delorme + + * :term:`PDF` schema output, thanks also to + Olivier Plathey for the "FPDF" library (see ), Steven + Wittens for the "UFPDF" library and + Nicola Asuni for the "TCPDF" library (see ). + +* Olof Edlund + + * :term:`SQL` validator server + +* Ivan R. Lanin + + * phpMyAdmin logo (until June 2004) + +* Mike Cochrane + + * blowfish library from the Horde project (withdrawn in release 4.0) + +* Marcel Tschopp + + * mysqli support + + * many bugfixes and improvements + +* Nicola Asuni (Tecnick.com) + + * TCPDF library () + +* Michael Keck + + * redesign for 2.6.0 + + * phpMyAdmin sailboat logo (June 2004) + +* Mathias Landh盲u脽er + + * Representation at conferences + +* Sebastian Mendel + + * interface improvements + + * various bugfixes + +* Ivan A Kirillov + + * new relations Designer + +* Raj Kissu Rajandran (Google Summer of Code 2008) + + * BLOBstreaming support (withdrawn in release 4.0) + +* Piotr Przybylski (Google Summer of Code 2008, 2010 and 2011) + + * improved setup script + + * user preferences + + * Drizzle support + +* Derek Schaefer (Google Summer of Code 2009) + + * Improved the import system + +* Alexander Rutkowski (Google Summer of Code 2009) + + * Tracking mechanism + +* Zahra Naeem (Google Summer of Code 2009) + + * Synchronization feature (removed in release 4.0) + +* Tom谩拧 Srnka (Google Summer of Code 2009) + + * Replication support + +* Muhammad Adnan (Google Summer of Code 2010) + + * Relation schema export to multiple formats + +* Lori Lee (Google Summer of Code 2010) + + * User interface improvements + + * ENUM/SET editor + + * Simplified interface for export/import + +* Ninad Pundalik (Google Summer of Code 2010) + + * AJAXifying the interface + +* Martynas Mickevi膷ius (Google Summer of Code 2010) + + * Charts + +* Barrie Leslie + + * BLOBstreaming support with PBMS PHP extension (withdrawn in release + 4.0) + +* Ankit Gupta (Google Summer of Code 2010) + + * Visual query builder + +* Madhura Jayaratne (Google Summer of Code 2011) + + * OpenGIS support + +* Ammar Yasir (Google Summer of Code 2011) + + * Zoom search + +* Aris Feryanto (Google Summer of Code 2011) + + * Browse-mode improvements + +* Thilanka Kaushalya (Google Summer of Code 2011) + + * AJAXification + +* Tyron Madlener (Google Summer of Code 2011) + + * Query statistics and charts for the status page + +* Zarubin Stas (Google Summer of Code 2011) + + * Automated testing + +* Rouslan Placella (Google Summer of Code 2011 and 2012) + + * Improved support for Stored Routines, Triggers and Events + + * Italian translation updates + + * Removal of frames, new navigation + +* Dieter Adriaenssens + + * Various bugfixes + + * Dutch translation updates + +* Alex Marin (Google Summer of Code 2012) + + * New plugins and properties system + +* Thilina Buddika Abeyrathna (Google Summer of Code 2012) + + * Refactoring + +* Atul Pratap Singh (Google Summer of Code 2012) + + * Refactoring + +* Chanaka Indrajith (Google Summer of Code 2012) + + * Refactoring + +* Yasitha Pandithawatta (Google Summer of Code 2012) + + * Automated testing + +* Jim Wigginton (phpseclib.sourceforge.net) + + * phpseclib + +* Bin Zu (Google Summer of Code 2013) + + * Refactoring + +* Supun Nakandala (Google Summer of Code 2013) + + * Refactoring + +* Mohamed Ashraf (Google Summer of Code 2013) + + * AJAX error reporting + +* Adam Kang (Google Summer of Code 2013) + + * Automated testing + +* Ayush Chaudhary (Google Summer of Code 2013) + + * Automated testing + +* Kasun Chathuranga (Google Summer of Code 2013) + + * Interface improvements + +* Hugues Peccatte + + * Load/save query by example (database search bookmarks) + +* Smita Kumari (Google Summer of Code 2014) + + * Central list of columns + + * Improve table structure (normalization) + +* Ashutosh Dhundhara (Google Summer of Code 2014) + + * Interface improvements + +* Dhananjay Nakrani (Google Summer of Code 2014) + + * PHP error reporting + +* Edward Cheng (Google Summer of Code 2014) + + * SQL Query Console + +* Kankanamge Bimal Yashodha (Google Summer of Code 2014) + + * Refactoring: Designer/schema integration + +* Chirayu Chiripal (Google Summer of Code 2014) + + * Custom field handlers (Input based MIME transformations) + + * Export with table/column name changes + +* Dan Ungureanu (Google Summer of Code 2015) + + * New parser and analyzer + +* Nisarg Jhaveri (Google Summer of Code 2015) + + * Page-related settings + + * SQL debugging integration to the Console + + * Other UI improvements + +* Deven Bansod (Google Summer of Code 2015) + + * Print view using CSS + + * Other UI improvements and new features + +* Deven Bansod (Google Summer of Code 2017) + + * Improvements to the Error Reporting Server + + * Improved Selenium testing + +* Manish Bisht (Google Summer of Code 2017) + + * Mobile user interface + + * Remove inline JavaScript code + + * Other UI improvements + +* Raghuram Vadapalli (Google Summer of Code 2017) + + * Multi-table query interface + + * Allow Designer to work with tables from other databases + + * Other UI improvements + +And also to the following people who have contributed minor changes, +enhancements, bugfixes or support for a new language since version +2.1.0: + +Bora Alioglu, Ricardo ?, Sven-Erik Andersen, Alessandro Astarita, +P茅ter Bakondy, Borges Botelho, Olivier Bussier, Neil Darlow, Mats +Engstrom, Ian Davidson, Laurent Dhima, Kristof Hamann, Thomas Kl盲ger, +Lubos Klokner, Martin Marconcini, Girish Nair, David Nordenberg, +Andreas Pauley, Bernard M. Piller, Laurent Haas, "Sakamoto", Yuval +Sarna, www.securereality.com.au, Alexis Soulard, Alvar Soome, Siu Sun, +Peter Svec, Michael Tacelosky, Rachim Tamsjadi, Kositer Uros, Lu铆s V., +Martijn W. van der Lee, Algis Vainauskas, Daniel Villanueva, Vinay, +Ignacio Vazquez-Abrams, Chee Wai, Jakub Wilk, Thomas Michael +Winningham, Vilius Zigmantas, "Manuzhai". + +Translators ++++++++++++ + +Following people have contributed to translation of phpMyAdmin: + +* Albanian + + * Arben 脟okaj + +* Arabic + + * Ahmed Saleh Abd El-Raouf Ismae + * Ahmed Saad + * hassan mokhtari + +* Armenian + + * Andrey Aleksanyants + +* Azerbaijani + + * Mirc蓹lal <01youknowme\_at\_gmail.com> + * Huseyn + * Sevdimali 陌sa + * Jafar + +* Belarusian + + * Viktar Palstsiuk + +* Bulgarian + + * Boyan Kehayov + * Valter Georgiev + * Valentin Mladenov + * P + * krasimir + +* Catalan + + * josep constanti + * Xavier Navarro + +* Chinese (China) + + * Vincent Lau <3092849\_at\_qq.com> + * Zheng Dan + * disorderman + * Rex Lee + * + * popcorner + * Yizhou Qiang + * zz + * Terry Weng + * whh + +* Chinese (Taiwan) + + * Albert Song + * Chien Wei Lin + * Peter Dave Hello + +* Colognian + + * Purodha + +* Czech + + * Ale拧 Hakl + * Dalibor Straka + * Martin Vidner + * Ondra 艩ime膷ek + * Jan Palider + * Petr Kate艡i艌谩k + +* Danish + + * Aputsia母 Niels Janussen + * Dennis Jakobsen + * Jonas + * Claus Svalekjaer + +* Dutch + + * A. Voogt + * dingo thirteen + * Robin van der Vliet + * Dieter Adriaenssens + * Niko Strijbol + +* English (United Kingdom) + + * Dries Verschuere + * Francisco Rocha + * Marc Delisle + * Marek Toma拧t铆k + +* Esperanto + + * Eliovir + * Robin van der Vliet + +* Estonian + + * Kristjan R盲ts + +* Finnish + + * Juha Remes + * Lari Oesch + +* French + + * Marc Delisle + +* Frisian + + * Robin van der Vliet + +* Galician + + * Xos茅 Calvo + +* German + + * Julian Ladisch + * Jan Erik Zassenhaus + * Lasse Goericke + * Matthias Bluthardt + * Michael Koch + * Ann + J.M. + * + * Phillip Rohmberger + * Hauke Henningsen + +* Greek + + * 螤伪谓伪纬喂蠋蟿畏蟼 螤伪蟺维味慰纬位慰蠀 + +* Hebrew + + * Moshe Harush + * Yaron Shahrabani + * Eyal Visoker + +* Hindi + + * Atul Pratap Singh + * Yogeshwar + * Deven Bansod + * Kushagra Pandey + * Nisarg Jhaveri + * Roohan Kazi + * Yugal Pantola + +* Hungarian + + * Akos Eros + * D谩niel T贸th + * Sz谩sz Attila + * Bal谩zs 脷r + +* Indonesian + + * Deky Arifianto + * Andika Triwidada + * Dadan Setia + * Dadan Setia + * Yohanes Edwin + * Fadhiil Rachman + * Benny + * Tommy Surbakti + * Zufar Fathi Suhardi + +* Interlingua + + * Giovanni Sora + +* Italian + + * Francesco Saverio Giacobazzi + * Marco Pozzato + * Stefano Martinelli + +* Japanese + + * k725 + * Hiroshi Chiyokawa + * Masahiko HISAKAWA + * worldwideskier + +* Kannada + + * Robin van der Vliet + * Shameem Ahmed A Mulla + +* Korean + + * Bumsoo Kim + * Kyeong Su Shin + * Dongyoung Kim + * Myung-han Yu + * JongDeok + * Yong Kim + * 鞚搓步欷� + * Seongki Shin + * Yoon Bum-Jong + * Koo Youngmin + +* Kurdish Sorani + + * Alan Hilal + * Aso Naderi + * muhammad + * Zrng Abdulla + +* Latvian + + * Latvian TV + * Edgars Neimanis + * Ukko + +* Limburgish + + * Robin van der Vliet + +* Lithuanian + + * Vytautas Motuzas + +* Malay + + * Amir Hamzah + * diprofinfiniti + +* Nepali + + * Nabin Ghimire + +* Norwegian Bokm氓l + + * B酶rge Holm-Wennberg + * Tor Stokkan + * Espen Fr酶yshov + * Kurt Eilertsen + * Christoffer Haugom + * Sebastian + * Tomas + +* Persian + + * ashkan shirian + * HM + +* Polish + + * Andrzej + * Przemo + * Krystian Biesaga + * Maciej Gryniuk + * Micha艂 VonFlynee + +* Portuguese + + * Alexandre Badalo + * Jo茫o Rodrigues + * Pedro Ribeiro + * Sandro Amaral + +* Portuguese (Brazil) + + * Alex Rohleder + * bruno mendax + * Danilo GUia + * Douglas Rafael Morais Kollar + * Douglas Eccker + * Ed Jr + * Guilherme Souza Silva + * Guilherme Seibt + * Helder Santana + * Junior Zancan + * Luis + * Marcos Algeri + * Marc Delisle + * Renato Rodrigues de Lima J煤nio + * Thiago Casotti + * Victor Laureano + * Vin铆cius Ara煤jo + * Washington Bruno Rodrigues Cav + * Yan Gabriel + +* Punjabi + + * Robin van der Vliet + +* Romanian + + * Alex + * Costel Cocerhan + * Ion Adrian-Ionut + * Raul Molnar + * Deleted User + * Stefan Murariu + +* Russian + + * Andrey Aleksanyants + * + * Robin van der Vliet + * 啸芯屑褍褌芯胁 袠胁邪薪 小械褉谐械械胁懈褔 + * Alexey Rubinov + * 袨谢械谐 袣邪褉锌芯胁 + * Egorov Artyom + +* Serbian + + * Smart Kid + +* Sinhala + + * Madhura Jayaratne + +* Slovak + + * Martin Lacina + * Patrik Kollmann + * Jozef Pistej + +* Slovenian + + * Domen + +* Spanish + + * Luis Garc铆a Sevillano + * Franco + * Luis Ruiz + * Macofe + * Mat铆as Bellone + * Rodrigo A. + * FAMMA TV NOTICIAS MEDIOS DE CO + * Ronnie Simon + +* Swedish + + * Anders Jonsson + +* Tamil + + * 喈曕喁囙喁� 喈曕瘉喈喈班瘝 + * Achchuthan Yogarajah + * Rifthy Ahmed + +* Thai + + * + * Somthanat W. + +* Turkish + + * Burak Yavuz + +* Ukrainian + + * 小械褉谐褨泄 袩械写褜泻芯 + * Igor + * Vitaliy Perekupka + +* Vietnamese + + * Bao Phan + * Xuan Hung + * Bao trinh minh + +* West Flemish + + * Robin van der Vliet + +Documentation translators ++++++++++++++++++++++++++ + +Following people have contributed to translation of phpMyAdmin documentation: + +* Albanian + + * Arben 脟okaj + +* Arabic + + * Ahmed El Azzabi + * Omar Essam + +* Armenian + + * Andrey Aleksanyants + +* Azerbaijani + + * Mirc蓹lal <01youknowme\_at\_gmail.com> + * Sevdimali 陌sa + +* Catalan + + * josep constanti + * Joan Montan茅 + * Xavier Navarro + +* Chinese (China) + + * Vincent Lau <3092849\_at\_qq.com> + * 缃楁攢鐧� <6375lpd\_at\_gmail.com> + * disorderman + * ITXiaoPang + * tunnel213 + * Terry Weng + * whh + +* Chinese (Taiwan) + + * Chien Wei Lin + * Peter Dave Hello + +* Czech + + * Ale拧 Hakl + * Michal 膶iha艡 + * Jan Palider + * Petr Kate艡i艌谩k + +* Danish + + * Aputsia母 Niels Janussen + * Claus Svalekjaer + +* Dutch + + * A. Voogt + * dingo thirteen + * Dries Verschuere + * Robin van der Vliet + * Stefan Koolen + * Ray Borggreve + * Dieter Adriaenssens + * Tom Hofman + +* Estonian + + * Kristjan R盲ts + +* Finnish + + * Juha + +* French + + * C茅dric Corazza + * 脡tienne Gilli + * Marc Delisle + * Donavan_Martin + +* Frisian + + * Robin van der Vliet + +* Galician + + * Xos茅 Calvo + +* German + + * Daniel + * JH M + * Lasse Goericke + * Michael Koch + * Ann + J.M. + * Niemand Jedermann + * Phillip Rohmberger + * Hauke Henningsen + +* Greek + + * 螤伪谓伪纬喂蠋蟿畏蟼 螤伪蟺维味慰纬位慰蠀 + +* Hungarian + + * Bal谩zs 脷r + +* Italian + + * Francesco Saverio Giacobazzi + * Marco Pozzato + * Stefano Martinelli + * TWS + +* Japanese + + * Eshin Kunishima + * Hiroshi Chiyokawa + +* Lithuanian + + * Jur Kis + * Dovydas + +* Norwegian Bokm氓l + + * Tor Stokkan + * Kurt Eilertsen + +* Portuguese (Brazil) + + * Alexandre Moretti + * Douglas Rafael Morais Kollar + * Guilherme Seibt + * Helder Santana + * Michal 膶iha艡 + * Michel Souza + * Danilo Azevedo + * Thiago Casotti + * Vin铆cius Ara煤jo + * Yan Gabriel + +* Slovak + + * Martin Lacina + * Michal 膶iha艡 + * Jozef Pistej + +* Slovenian + + * Domen + +* Spanish + + * Luis Garc铆a Sevillano + * Franco + * Mat铆as Bellone + * Ronnie Simon + +* Turkish + + * Burak Yavuz + +Original Credits of Version 2.1.0 ++++++++++++++++++++++++++++++++++ + +This work is based on Peter Kuppelwieser's MySQL-Webadmin. It was his +idea to create a web-based interface to MySQL using PHP3. Although I +have not used any of his source-code, there are some concepts I've +borrowed from him. phpMyAdmin was created because Peter told me he +wasn't going to further develop his (great) tool. + +Thanks go to + +* Amalesh Kempf who contributed the + code for the check when dropping a table or database. He also + suggested that you should be able to specify the primary key on + tbl\_create.php3. To version 1.1.1 he contributed the ldi\_\*.php3-set + (Import text-files) as well as a bug-report. Plus many smaller + improvements. +* Jan Legenhausen : He made many of the changes that + were introduced in 1.3.0 (including quite significant ones like the + authentication). For 1.4.1 he enhanced the table-dump feature. Plus + bug-fixes and help. +* Marc Delisle made phpMyAdmin + language-independent by outsourcing the strings to a separate file. He + also contributed the French translation. +* Alexandr Bravo who contributed + tbl\_select.php3, a feature to display only some columns from a table. +* Chris Jackson added support for MySQL functions + in tbl\_change.php3. He also added the "Query by Example" feature in + 2.0. +* Dave Walton added support for multiple + servers and is a regular contributor for bug-fixes. +* Gabriel Ash contributed the random access + features for 2.0.6. + +The following people have contributed minor changes, enhancements, +bugfixes or support for a new language: + +Jim Kraai, Jordi Bruguera, Miquel Obrador, Geert Lund, Thomas +Kleemann, Alexander Leidinger, Kiko Albiol, Daniel C. Chao, Pavel +Piankov, Sascha Kettler, Joe Pruett, Renato Lins, Mark Kronsbein, +Jannis Hermanns, G. Wieggers. + +And thanks to everyone else who sent me email with suggestions, bug- +reports and or just some feedback. diff --git a/phpMyAdmin/doc/html/_sources/developers.rst.txt b/phpMyAdmin/doc/html/_sources/developers.rst.txt new file mode 100755 index 0000000..2b2f586 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/developers.rst.txt @@ -0,0 +1,12 @@ +.. _developers: + +Developers Information +====================== + +phpMyAdmin is Open Source, so you're invited to contribute to it. Many +great features have been written by other people and you too can help +to make phpMyAdmin a useful tool. + +You can check out all the possibilities to contribute in the +`contribute section on our website +`_. diff --git a/phpMyAdmin/doc/html/_sources/faq.rst.txt b/phpMyAdmin/doc/html/_sources/faq.rst.txt new file mode 100755 index 0000000..ddb9047 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/faq.rst.txt @@ -0,0 +1,2258 @@ +.. _faq: + +FAQ - Frequently Asked Questions +================================ + +Please have a look at our `Link section +`_ on the official +phpMyAdmin homepage for in-depth coverage of phpMyAdmin's features and +or interface. + +.. _faqserver: + +Server +++++++ + +.. _faq1_1: + +1.1 My server is crashing each time a specific action is required or phpMyAdmin sends a blank page or a page full of cryptic characters to my browser, what can I do? +--------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +Try to set the :config:option:`$cfg['OBGzip']` directive to ``false`` in your +:file:`config.inc.php` file and the ``zlib.output_compression`` directive to +``Off`` in your php configuration file. + +.. _faq1_2: + +1.2 My Apache server crashes when using phpMyAdmin. +--------------------------------------------------- + +You should first try the latest versions of Apache (and possibly MySQL). If +your server keeps crashing, please ask for help in the various Apache support +groups. + +.. seealso:: :ref:`faq1_1` + +.. _faq1_3: + +1.3 (withdrawn). +---------------- + +.. _faq1_4: + +1.4 Using phpMyAdmin on IIS, I'm displayed the error message: "The specified CGI application misbehaved by not returning a complete set of HTTP headers ...". +------------------------------------------------------------------------------------------------------------------------------------------------------------- + +You just forgot to read the *install.txt* file from the PHP +distribution. Have a look at the last message in this `PHP bug report #12061 +`_ from the official PHP bug +database. + +.. _faq1_5: + +1.5 Using phpMyAdmin on IIS, I'm facing crashes and/or many error messages with the HTTP. +----------------------------------------------------------------------------------------- + +This is a known problem with the PHP :term:`ISAPI` filter: it's not so stable. +Please use instead the cookie authentication mode. + +.. _faq1_6: + +1.6 I can't use phpMyAdmin on PWS: nothing is displayed! +-------------------------------------------------------- + +This seems to be a PWS bug. Filippo Simoncini found a workaround (at +this time there is no better fix): remove or comment the ``DOCTYPE`` +declarations (2 lines) from the scripts :file:`libraries/Header.class.php` +and :file:`index.php`. + +.. _faq1_7: + +1.7 How can I gzip a dump or a CSV export? It does not seem to work. +-------------------------------------------------------------------- + +This feature is based on the ``gzencode()`` +PHP function to be more independent of the platform (Unix/Windows, +Safe Mode or not, and so on). So, you must have Zlib support +(``--with-zlib``). + +.. _faq1_8: + +1.8 I cannot insert a text file in a table, and I get an error about safe mode being in effect. +----------------------------------------------------------------------------------------------- + +Your uploaded file is saved by PHP in the "upload dir", as defined in +:file:`php.ini` by the variable ``upload_tmp_dir`` (usually the system +default is */tmp*). We recommend the following setup for Apache +servers running in safe mode, to enable uploads of files while being +reasonably secure: + +* create a separate directory for uploads: :command:`mkdir /tmp/php` +* give ownership to the Apache server's user.group: :command:`chown + apache.apache /tmp/php` +* give proper permission: :command:`chmod 600 /tmp/php` +* put ``upload_tmp_dir = /tmp/php`` in :file:`php.ini` +* restart Apache + +.. _faq1_9: + +1.9 (withdrawn). +---------------- + +.. _faq1_10: + +1.10 I'm having troubles when uploading files with phpMyAdmin running on a secure server. My browser is Internet Explorer and I'm using the Apache server. +---------------------------------------------------------------------------------------------------------------------------------------------------------- + +As suggested by "Rob M" in the phpWizard forum, add this line to your +*httpd.conf*: + +.. code-block:: apache + + SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown + +It seems to clear up many problems between Internet Explorer and SSL. + +.. _faq1_11: + +1.11 I get an 'open\_basedir restriction' while uploading a file from the import tab. +------------------------------------------------------------------------------------- + +Since version 2.2.4, phpMyAdmin supports servers with open\_basedir +restrictions. However you need to create temporary directory and configure it +as :config:option:`$cfg['TempDir']`. The uploaded files will be moved there, +and after execution of your :term:`SQL` commands, removed. + +.. _faq1_12: + +1.12 I have lost my MySQL root password, what can I do? +------------------------------------------------------- + +phpMyAdmin does authenticate against MySQL server you're using, so to recover +from phpMyAdmin password loss, you need to recover at MySQL level. + +The MySQL manual explains how to `reset the permissions +`_. + +If you are using MySQL server installed by your hosting provider, please +contact their support to recover the password for you. + +.. _faq1_13: + +1.13 (withdrawn). +----------------- + +.. _faq1_14: + +1.14 (withdrawn). +----------------- + +.. _faq1_15: + +1.15 I have problems with *mysql.user* column names. +---------------------------------------------------- + +In previous MySQL versions, the ``User`` and ``Password`` columns were +named ``user`` and ``password``. Please modify your column names to +align with current standards. + +.. _faq1_16: + +1.16 I cannot upload big dump files (memory, HTTP or timeout problems). +----------------------------------------------------------------------- + +Starting with version 2.7.0, the import engine has been re鈥搘ritten and +these problems should not occur. If possible, upgrade your phpMyAdmin +to the latest version to take advantage of the new import features. + +The first things to check (or ask your host provider to check) are the values +of ``max_execution_time``, ``upload_max_filesize``, ``memory_limit`` and +``post_max_size`` in the :file:`php.ini` configuration file. All of these three +settings limit the maximum size of data that can be submitted and handled by +PHP. Please note that ``post_max_size`` needs to be larger than +``upload_max_filesize``. There exist several workarounds if your upload is too +big or your hosting provider is unwilling to change the settings: + +* Look at the :config:option:`$cfg['UploadDir']` feature. This allows one to upload a file to the server + via scp, ftp, or your favorite file transfer method. PhpMyAdmin is + then able to import the files from the temporary directory. More + information is available in the :ref:`config` of this document. +* Using a utility (such as `BigDump + `_) to split the files before + uploading. We cannot support this or any third party applications, but + are aware of users having success with it. +* If you have shell (command line) access, use MySQL to import the files + directly. You can do this by issuing the "source" command from within + MySQL: + + .. code-block:: mysql + + source filename.sql; + +.. _faq1_17: + +1.17 Which Database versions does phpMyAdmin support? +----------------------------------------------------- + +For `MySQL `_, versions 5.5 and newer are supported. +For older MySQL versions, our `Downloads `_ page offers older phpMyAdmin versions +(which may have become unsupported). + +For `MariaDB `_, versions 5.5 and newer are supported. + +.. _faq1_17a: + +1.17a I cannot connect to the MySQL server. It always returns the error message, "Client does not support authentication protocol requested by server; consider upgrading MySQL client" +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +You tried to access MySQL with an old MySQL client library. The +version of your MySQL client library can be checked in your phpinfo() +output. In general, it should have at least the same minor version as +your server - as mentioned in :ref:`faq1_17`. This problem is +generally caused by using MySQL version 4.1 or newer. MySQL changed +the authentication hash and your PHP is trying to use the old method. +The proper solution is to use the `mysqli extension +`_ with the proper client library to match +your MySQL installation. More +information (and several workarounds) are located in the `MySQL +Documentation `_. + +.. _faq1_18: + +1.18 (withdrawn). +----------------- + +.. _faq1_19: + +1.19 I can't run the "display relations" feature because the script seems not to know the font face I'm using! +-------------------------------------------------------------------------------------------------------------- + +The :term:`TCPDF` library we're using for this feature requires some special +files to use font faces. Please refers to the `TCPDF manual +`_ to build these files. + +.. _faqmysql: + +1.20 I receive an error about missing mysqli and mysql extensions. +------------------------------------------------------------------ + +To connect to a MySQL server, PHP needs a set of MySQL functions +called "MySQL extension". This extension may be part of the PHP +distribution (compiled-in), otherwise it needs to be loaded +dynamically. Its name is probably *mysqli.so* or *php\_mysqli.dll*. +phpMyAdmin tried to load the extension but failed. Usually, the +problem is solved by installing a software package called "PHP-MySQL" +or something similar. + +There are currently two interfaces PHP provides as MySQL extensions - ``mysql`` +and ``mysqli``. The ``mysqli`` is tried first, because it's the best one. + +This problem can be also caused by wrong paths in the :file:`php.ini` or using +wrong :file:`php.ini`. + +Make sure that the extension files do exist in the folder which the +``extension_dir`` points to and that the corresponding lines in your +:file:`php.ini` are not commented out (you can use ``phpinfo()`` to check +current setup): + +.. code-block:: ini + + [PHP] + + ; Directory in which the loadable extensions (modules) reside. + extension_dir = "C:/Apache2/modules/php/ext" + +The :file:`php.ini` can be loaded from several locations (especially on +Windows), so please check you're updating the correct one. If using Apache, you +can tell it to use specific path for this file using ``PHPIniDir`` directive: + +.. code-block:: apache + + LoadFile "C:/php/php5ts.dll" + LoadModule php5_module "C:/php/php5apache2_2.dll" + + PHPIniDir "C:/PHP" + + AddType text/html .php + AddHandler application/x-httpd-php .php + + + +In some rare cases this problem can be also caused by other extensions loaded +in PHP which prevent MySQL extensions to be loaded. If anything else fails, you +can try commenting out extensions for other databses from :file:`php.ini`. + +.. _faq1_21: + +1.21 I am running the CGI version of PHP under Unix, and I cannot log in using cookie auth. +------------------------------------------------------------------------------------------- + +In :file:`php.ini`, set ``mysql.max_links`` higher than 1. + +.. _faq1_22: + +1.22 I don't see the "Location of text file" field, so I cannot upload. +----------------------------------------------------------------------- + +This is most likely because in :file:`php.ini`, your ``file_uploads`` +parameter is not set to "on". + +.. _faq1_23: + +1.23 I'm running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase! +------------------------------------------------------------------------------------------------------------------------------ + +This happens because the MySQL directive ``lower_case_table_names`` +defaults to 1 (``ON``) in the Win32 version of MySQL. You can change +this behavior by simply changing the directive to 0 (``OFF``): Just +edit your ``my.ini`` file that should be located in your Windows +directory and add the following line to the group [mysqld]: + +.. code-block:: ini + + set-variable = lower_case_table_names=0 + +.. note:: + + Forcing this variable to 0 with --lower-case-table-names=0 on a + case-insensitive filesystem and access MyISAM tablenames using different + lettercases, index corruption may result. + +Next, save the file and restart the MySQL service. You can always +check the value of this directive using the query + +.. code-block:: mysql + + SHOW VARIABLES LIKE 'lower_case_table_names'; + +.. seealso:: `Identifier Case Sensitivity in the MySQL Reference Manual `_ + +.. _faq1_24: + +1.24 (withdrawn). +----------------- + +.. _faq1_25: + +1.25 I am running Apache with mod\_gzip-1.3.26.1a on Windows XP, and I get problems, such as undefined variables when I run a SQL query. +---------------------------------------------------------------------------------------------------------------------------------------- + +A tip from Jose Fandos: put a comment on the following two lines in +httpd.conf, like this: + +.. code-block:: apache + + # mod_gzip_item_include file \.php$ + # mod_gzip_item_include mime "application/x-httpd-php.*" + +as this version of mod\_gzip on Apache (Windows) has problems handling +PHP scripts. Of course you have to restart Apache. + +.. _faq1_26: + +1.26 I just installed phpMyAdmin in my document root of IIS but I get the error "No input file specified" when trying to run phpMyAdmin. +---------------------------------------------------------------------------------------------------------------------------------------- + +This is a permission problem. Right-click on the phpmyadmin folder and +choose properties. Under the tab Security, click on "Add" and select +the user "IUSR\_machine" from the list. Now set his permissions and it +should work. + +.. _faq1_27: + +1.27 I get empty page when I want to view huge page (eg. db\_structure.php with plenty of tables). +-------------------------------------------------------------------------------------------------- + +This was caused by a `PHP bug `_ that occur when +GZIP output buffering is enabled. If you turn off it (by +:config:option:`$cfg['OBGzip']` in :file:`config.inc.php`), it should work. +This bug will has been fixed in PHP 5.0.0. + +.. _faq1_28: + +1.28 My MySQL server sometimes refuses queries and returns the message 'Errorcode: 13'. What does this mean? +------------------------------------------------------------------------------------------------------------ + +This can happen due to a MySQL bug when having database / table names +with upper case characters although ``lower_case_table_names`` is +set to 1. To fix this, turn off this directive, convert all database +and table names to lower case and turn it on again. Alternatively, +there's a bug-fix available starting with MySQL 3.23.56 / +4.0.11-gamma. + +.. _faq1_29: + +1.29 When I create a table or modify a column, I get an error and the columns are duplicated. +--------------------------------------------------------------------------------------------- + +It is possible to configure Apache in such a way that PHP has problems +interpreting .php files. + +The problems occur when two different (and conflicting) set of +directives are used: + +.. code-block:: apache + + SetOutputFilter PHP + SetInputFilter PHP + +and + +.. code-block:: apache + + AddType application/x-httpd-php .php + +In the case we saw, one set of directives was in +``/etc/httpd/conf/httpd.conf``, while the other set was in +``/etc/httpd/conf/addon-modules/php.conf``. The recommended way is +with ``AddType``, so just comment out the first set of lines and +restart Apache: + +.. code-block:: apache + + #SetOutputFilter PHP + #SetInputFilter PHP + +.. _faq1_30: + +1.30 I get the error "navigation.php: Missing hash". +---------------------------------------------------- + +This problem is known to happen when the server is running Turck +MMCache but upgrading MMCache to version 2.3.21 solves the problem. + +.. _faq1_31: + +1.31 Which PHP versions does phpMyAdmin support? +------------------------------------------------ + +Since release 4.5, phpMyAdmin supports only PHP 5.5 and newer. Since release +4.1 phpMyAdmin supports only PHP 5.3 and newer. For PHP 5.2 you can use 4.0.x +releases. + +PHP 7 is supported since phpMyAdmin 4.6, PHP 7.1 is supported since 4.6.5, +PHP 7.2 is supported since 4.7.4. + +phpMyAdmin also works fine with HHVM. + +.. _faq1_32: + +1.32 Can I use HTTP authentication with IIS? +-------------------------------------------- + +Yes. This procedure was tested with phpMyAdmin 2.6.1, PHP 4.3.9 in +:term:`ISAPI` mode under :term:`IIS` 5.1. + +#. In your :file:`php.ini` file, set ``cgi.rfc2616_headers = 0`` +#. In ``Web Site Properties -> File/Directory Security -> Anonymous + Access`` dialog box, check the ``Anonymous access`` checkbox and + uncheck any other checkboxes (i.e. uncheck ``Basic authentication``, + ``Integrated Windows authentication``, and ``Digest`` if it's + enabled.) Click ``OK``. +#. In ``Custom Errors``, select the range of ``401;1`` through ``401;5`` + and click the ``Set to Default`` button. + +.. seealso:: :rfc:`2616` + +.. _faq1_33: + +1.33 (withdrawn). +----------------- + +.. _faq1_34: + +1.34 Can I access directly to database or table pages? +------------------------------------------------------ + +Yes. Out of the box, you can use :term:`URL` like +``http://server/phpMyAdmin/index.php?server=X&db=database&table=table&target=script``. +For ``server`` you use the server number +which refers to the order of the server paragraph in +:file:`config.inc.php`. Table and script parts are optional. If you want +``http://server/phpMyAdmin/database[/table][/script]`` :term:`URL`, you need to do some configuration. Following +lines apply only for `Apache `_ web server. +First make sure, that you have enabled some features within global +configuration. You need ``Options SymLinksIfOwnerMatch`` and ``AllowOverride +FileInfo`` enabled for directory where phpMyAdmin is installed and you +need mod\_rewrite to be enabled. Then you just need to create +following :term:`.htaccess` file in root folder of phpMyAdmin installation (don't +forget to change directory name inside of it): + +.. code-block:: apache + + RewriteEngine On + RewriteBase /path_to_phpMyAdmin + RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R] + RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R] + RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R] + RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R] + +.. _faq1_35: + +1.35 Can I use HTTP authentication with Apache CGI? +--------------------------------------------------- + +Yes. However you need to pass authentication variable to :term:`CGI` using +following rewrite rule: + +.. code-block:: apache + + RewriteEngine On + RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L] + +.. _faq1_36: + +1.36 I get an error "500 Internal Server Error". +------------------------------------------------ + +There can be many explanations to this and a look at your server's +error log file might give a clue. + +.. _faq1_37: + +1.37 I run phpMyAdmin on cluster of different machines and password encryption in cookie auth doesn't work. +----------------------------------------------------------------------------------------------------------- + +If your cluster consist of different architectures, PHP code used for +encryption/decryption won't work correct. This is caused by use of +pack/unpack functions in code. Only solution is to use mcrypt +extension which works fine in this case. + +.. _faq1_38: + +1.38 Can I use phpMyAdmin on a server on which Suhosin is enabled? +------------------------------------------------------------------ + +Yes but the default configuration values of Suhosin are known to cause +problems with some operations, for example editing a table with many +columns and no :term:`primary key` or with textual :term:`primary key`. + +Suhosin configuration might lead to malfunction in some cases and it +can not be fully avoided as phpMyAdmin is kind of application which +needs to transfer big amounts of columns in single HTTP request, what +is something what Suhosin tries to prevent. Generally all +``suhosin.request.*``, ``suhosin.post.*`` and ``suhosin.get.*`` +directives can have negative effect on phpMyAdmin usability. You can +always find in your error logs which limit did cause dropping of +variable, so you can diagnose the problem and adjust matching +configuration variable. + +The default values for most Suhosin configuration options will work in +most scenarios, however you might want to adjust at least following +parameters: + +* `suhosin.request.max\_vars `_ should + be increased (eg. 2048) +* `suhosin.post.max\_vars `_ should be + increased (eg. 2048) +* `suhosin.request.max\_array\_index\_length `_ + should be increased (eg. 256) +* `suhosin.post.max\_array\_index\_length `_ + should be increased (eg. 256) +* `suhosin.request.max\_totalname\_length `_ + should be increased (eg. 8192) +* `suhosin.post.max\_totalname\_length `_ should be + increased (eg. 8192) +* `suhosin.get.max\_value\_length `_ + should be increased (eg. 1024) +* `suhosin.sql.bailout\_on\_error `_ + needs to be disabled (the default) +* `suhosin.log.\* `_ should not + include :term:`SQL`, otherwise you get big + slowdown +* `suhosin.sql.union `_ must be disabled (which is the default). +* `suhosin.sql.multiselect `_ must be disabled (which is the default). +* `suhosin.sql.comment `_ must be disabled (which is the default). + +To further improve security, we also recommend these modifications: + +* `suhosin.executor.include.max\_traversal `_ should be + enabled as a mitigation against local file inclusion attacks. We suggest + setting this to 2 as ``../`` is used with the ReCaptcha library. +* `suhosin.cookie.encrypt `_ should be enabled. +* `suhosin.executor.disable_emodifier `_ should be enabled. + +You can also disable the warning using the :config:option:`$cfg['SuhosinDisableWarning']`. + +.. _faq1_39: + +1.39 When I try to connect via https, I can log in, but then my connection is redirected back to http. What can cause this behavior? +------------------------------------------------------------------------------------------------------------------------------------ + +This is caused by the fact that PHP scripts have no knowledge that the site is +using https. Depending on used webserver, you should configure it to let PHP +know about URL and scheme used to access it. + +For example in Apache ensure that you have enabled ``SSLOptions`` and +``StdEnvVars`` in the configuration. + +.. seealso:: + +.. _faq1_40: + +1.40 When accessing phpMyAdmin via an Apache reverse proxy, cookie login does not work. +--------------------------------------------------------------------------------------- + +To be able to use cookie auth Apache must know that it has to rewrite +the set-cookie headers. Example from the Apache 2.2 documentation: + +.. code-block:: apache + + ProxyPass /mirror/foo/ http://backend.example.com/ + ProxyPassReverse /mirror/foo/ http://backend.example.com/ + ProxyPassReverseCookieDomain backend.example.com public.example.com + ProxyPassReverseCookiePath / /mirror/foo/ + +Note: if the backend url looks like ``http://server/~user/phpmyadmin``, the +tilde (~) must be url encoded as %7E in the ProxyPassReverse\* lines. +This is not specific to phpmyadmin, it's just the behavior of Apache. + +.. code-block:: apache + + ProxyPass /mirror/foo/ http://backend.example.com/~user/phpmyadmin + ProxyPassReverse /mirror/foo/ http://backend.example.com/%7Euser/phpmyadmin + ProxyPassReverseCookiePath /%7Euser/phpmyadmin /mirror/foo + +.. seealso:: , :config:option:`$cfg['PmaAbsoluteUri']` + +.. _faq1_41: + +1.41 When I view a database and ask to see its privileges, I get an error about an unknown column. +-------------------------------------------------------------------------------------------------- + +The MySQL server's privilege tables are not up to date, you need to +run the :command:`mysql_upgrade` command on the server. + +.. _faq1_42: + +1.42 How can I prevent robots from accessing phpMyAdmin? +-------------------------------------------------------- + +You can add various rules to :term:`.htaccess` to filter access based on user agent +field. This is quite easy to circumvent, but could prevent at least +some robots accessing your installation. + +.. code-block:: apache + + RewriteEngine on + + # Allow only GET and POST verbs + RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR] + + # Ban Typical Vulnerability Scanners and others + # Kick out Script Kiddies + RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR] + RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|wkito|pikto|scan|acunetix).* [NC,OR] + RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR] + + # Ban Search Engines, Crawlers to your administrative panel + # No reasons to access from bots + # Ultimately Better than the useless robots.txt + # Did google respect robots.txt? + # Try google: intitle:phpMyAdmin intext:"Welcome to phpMyAdmin *.*.*" intext:"Log in" -wiki -forum -forums -questions intext:"Cookies must be enabled" + RewriteCond %{HTTP_USER_AGENT} ^.*(AdsBot-Google|ia_archiver|Scooter|Ask.Jeeves|Baiduspider|Exabot|FAST.Enterprise.Crawler|FAST-WebCrawler|www\.neomo\.de|Gigabot|Mediapartners-Google|Google.Desktop|Feedfetcher-Google|Googlebot|heise-IT-Markt-Crawler|heritrix|ibm.com\cs/crawler|ICCrawler|ichiro|MJ12bot|MetagerBot|msnbot-NewsBlogs|msnbot|msnbot-media|NG-Search|lucene.apache.org|NutchCVS|OmniExplorer_Bot|online.link.validator|psbot0|Seekbot|Sensis.Web.Crawler|SEO.search.Crawler|Seoma.\[SEO.Crawler\]|SEOsearch|Snappy|www.urltrends.com|www.tkl.iis.u-tokyo.ac.jp/~crawler|SynooBot|crawleradmin.t-info@telekom.de|TurnitinBot|voyager|W3.SiteSearch.Crawler|W3C-checklink|W3C_Validator|www.WISEnutbot.com|yacybot|Yahoo-MMCrawler|Yahoo\!.DE.Slurp|Yahoo\!.Slurp|YahooSeeker).* [NC] + RewriteRule .* - [F] + +.. _faq1_43: + +1.43 Why can't I display the structure of my table containing hundreds of columns? +---------------------------------------------------------------------------------- + +Because your PHP's ``memory_limit`` is too low; adjust it in :file:`php.ini`. + +.. _faq1:44: + +1.44 How can I reduce the installed size of phpMyAdmin on disk? +--------------------------------------------------------------- + +Some users have requested to be able to reduce the size of the phpMyAdmin installation. +This is not recommended and could lead to confusion over missing features, but can be done. +A list of files and corresponding functionality which degrade gracefully when removed include: + +* :file:`./vendor/tecnickcom/tcpdf` folder (exporting to PDF) +* :file:`./locale/` folder, or unused subfolders (interface translations) +* Any unused themes in :file:`./themes/` +* :file:`./js/vendor/jquery/src/` (included for licensing reasons) +* :file:`./js/line_counts.php` (removed in phpMyAdmin 4.8) +* :file:`./doc/` (documentation) +* :file:`./setup/` (setup script) +* :file:`./examples/` +* :file:`./sql/` (SQL scripts to configure advanced functionality) +* :file:`./js/vendor/openlayers/` (GIS visualization) + +.. _faqconfig: + +Configuration ++++++++++++++ + +.. _faq2_1: + +2.1 The error message "Warning: Cannot add header information - headers already sent by ..." is displayed, what's the problem? +------------------------------------------------------------------------------------------------------------------------------ + +Edit your :file:`config.inc.php` file and ensure there is nothing (I.E. no +blank lines, no spaces, no characters...) neither before the ```` tag at the end. + +.. _faq2_2: + +2.2 phpMyAdmin can't connect to MySQL. What's wrong? +---------------------------------------------------- + +Either there is an error with your PHP setup or your username/password +is wrong. Try to make a small script which uses mysql\_connect and see +if it works. If it doesn't, it may be you haven't even compiled MySQL +support into PHP. + +.. _faq2_3: + +2.3 The error message "Warning: MySQL Connection Failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) ..." is displayed. What can I do? +--------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +The error message can also be: :guilabel:`Error #2002 - The server is not +responding (or the local MySQL server's socket is not correctly configured)`. + +First, you need to determine what socket is being used by MySQL. To do this, +connect to your server and go to the MySQL bin directory. In this directory +there should be a file named *mysqladmin*. Type ``./mysqladmin variables``, and +this should give you a bunch of info about your MySQL server, including the +socket (*/tmp/mysql.sock*, for example). You can also ask your ISP for the +connection info or, if you're hosting your own, connect from the 'mysql' +command-line client and type 'status' to get the connection type and socket or +port number. + +Then, you need to tell PHP to use this socket. You can do this for all PHP in +the :file:`php.ini` or for phpMyAdmin only in the :file:`config.inc.php`. For +example: :config:option:`$cfg['Servers'][$i]['socket']` Please also make sure +that the permissions of this file allow to be readable by your webserver. + +On my RedHat-Box the socket of MySQL is */var/lib/mysql/mysql.sock*. +In your :file:`php.ini` you will find a line + +.. code-block:: ini + + mysql.default_socket = /tmp/mysql.sock + +change it to + +.. code-block:: ini + + mysql.default_socket = /var/lib/mysql/mysql.sock + +Then restart apache and it will work. + +Have also a look at the `corresponding section of the MySQL +documentation `_. + +.. _faq2_4: + +2.4 Nothing is displayed by my browser when I try to run phpMyAdmin, what can I do? +----------------------------------------------------------------------------------- + +Try to set the :config:option:`$cfg['OBGzip']` directive to ``false`` in the phpMyAdmin configuration +file. It helps sometime. Also have a look at your PHP version number: +if it contains "b" or "alpha" it means you're running a testing +version of PHP. That's not a so good idea, please upgrade to a plain +revision. + +.. _faq2_5: + +2.5 Each time I want to insert or change a row or drop a database or a table, an error 404 (page not found) is displayed or, with HTTP or cookie authentication, I'm asked to log in again. What's wrong? +--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +Check your webserver setup if it correctly fills in either PHP_SELF or REQUEST_URI variables. + +If you are running phpMyAdmin behind reverse proxy, please set the +:config:option:`$cfg['PmaAbsoluteUri']` directive in the phpMyAdmin +configuration file to match your setup. + +.. _faq2_6: + +2.6 I get an "Access denied for user: 'root@localhost' (Using password: YES)"-error when trying to access a MySQL-Server on a host which is port-forwarded for my localhost. +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +When you are using a port on your localhost, which you redirect via +port-forwarding to another host, MySQL is not resolving the localhost +as expected. Erik Wasser explains: The solution is: if your host is +"localhost" MySQL (the command line tool :command:`mysql` as well) always +tries to use the socket connection for speeding up things. And that +doesn't work in this configuration with port forwarding. If you enter +"127.0.0.1" as hostname, everything is right and MySQL uses the +:term:`TCP` connection. + +.. _faqthemes: + +2.7 Using and creating themes +----------------------------- + +See :ref:`themes`. + +.. _faqmissingparameters: + +2.8 I get "Missing parameters" errors, what can I do? +----------------------------------------------------- + +Here are a few points to check: + +* In :file:`config.inc.php`, try to leave the :config:option:`$cfg['PmaAbsoluteUri']` directive empty. See also + :ref:`faq4_7`. +* Maybe you have a broken PHP installation or you need to upgrade your + Zend Optimizer. See . +* If you are using Hardened PHP with the ini directive + ``varfilter.max_request_variables`` set to the default (200) or + another low value, you could get this error if your table has a high + number of columns. Adjust this setting accordingly. (Thanks to Klaus + Dorninger for the hint). +* In the :file:`php.ini` directive ``arg_separator.input``, a value of ";" + will cause this error. Replace it with "&;". +* If you are using `Suhosin `_, you + might want to increase `request limits `_. +* The directory specified in the :file:`php.ini` directive + ``session.save_path`` does not exist or is read-only (this can be caused + by `bug in the PHP installer `_). + +.. _faq2_9: + +2.9 Seeing an upload progress bar +--------------------------------- + +To be able to see a progress bar during your uploads, your server must +have the `APC `_ extension, the +`uploadprogress `_ one, or +you must be running PHP 5.4.0 or higher. Moreover, the JSON extension +has to be enabled in your PHP. + +If using APC, you must set ``apc.rfc1867`` to ``on`` in your :file:`php.ini`. + +If using PHP 5.4.0 or higher, you must set +``session.upload_progress.enabled`` to ``1`` in your :file:`php.ini`. However, +starting from phpMyAdmin version 4.0.4, session-based upload progress has +been temporarily deactivated due to its problematic behavior. + +.. seealso:: :rfc:`1867` + +.. _faqlimitations: + +Known limitations ++++++++++++++++++ + +.. _login_bug: + +3.1 When using HTTP authentication, a user who logged out can not log in again in with the same nick. +----------------------------------------------------------------------------------------------------- + +This is related to the authentication mechanism (protocol) used by +phpMyAdmin. To bypass this problem: just close all the opened browser +windows and then go back to phpMyAdmin. You should be able to log in +again. + +.. _faq3_2: + +3.2 When dumping a large table in compressed mode, I get a memory limit error or a time limit error. +---------------------------------------------------------------------------------------------------- + +Compressed dumps are built in memory and because of this are limited +to php's memory limit. For gzip/bzip2 exports this can be overcome +since 2.5.4 using :config:option:`$cfg['CompressOnFly']` (enabled by default). +zip exports can not be handled this way, so if you need zip files for larger +dump, you have to use another way. + +.. _faq3_3: + +3.3 With InnoDB tables, I lose foreign key relationships when I rename a table or a column. +------------------------------------------------------------------------------------------- + +This is an InnoDB bug, see . + +.. _faq3_4: + +3.4 I am unable to import dumps I created with the mysqldump tool bundled with the MySQL server distribution. +------------------------------------------------------------------------------------------------------------- + +The problem is that older versions of ``mysqldump`` created invalid +comments like this: + +.. code-block:: mysql + + -- MySQL dump 8.22 + -- + -- Host: localhost Database: database + --------------------------------------------------------- + -- Server version 3.23.54 + +The invalid part of the code is the horizontal line made of dashes +that appears once in every dump created with mysqldump. If you want to +run your dump you have to turn it into valid MySQL. This means, you +have to add a whitespace after the first two dashes of the line or add +a # before it: ``-- -------------------------------------------------------`` or +``#---------------------------------------------------------`` + +.. _faq3_5: + +3.5 When using nested folders, multiple hierarchies are displayed in a wrong manner. +------------------------------------------------------------------------------------ + +Please note that you should not use the separating string multiple +times without any characters between them, or at the beginning/end of +your table name. If you have to, think about using another +TableSeparator or disabling that feature. + +.. seealso:: :config:option:`$cfg['NavigationTreeTableSeparator']` + +.. _faq3_6: + +3.6 (withdrawn). +----------------- + +.. _faq3_7: + +3.7 I have table with many (100+) columns and when I try to browse table I get series of errors like "Warning: unable to parse url". How can this be fixed? +----------------------------------------------------------------------------------------------------------------------------------------------------------- + +Your table neither have a :term:`primary key` nor an :term:`unique key`, so we must +use a long expression to identify this row. This causes problems to +parse\_url function. The workaround is to create a :term:`primary key` +or :term:`unique key`. + +.. _faq3_8: + +3.8 I cannot use (clickable) HTML-forms in columns where I put a MIME-Transformation onto! +------------------------------------------------------------------------------------------ + +Due to a surrounding form-container (for multi-row delete checkboxes), +no nested forms can be put inside the table where phpMyAdmin displays +the results. You can, however, use any form inside of a table if keep +the parent form-container with the target to tbl\_row\_delete.php and +just put your own input-elements inside. If you use a custom submit +input field, the form will submit itself to the displaying page again, +where you can validate the $HTTP\_POST\_VARS in a transformation. For +a tutorial on how to effectively use transformations, see our `Link +section `_ on the +official phpMyAdmin-homepage. + +.. _faq3_9: + +3.9 I get error messages when using "--sql\_mode=ANSI" for the MySQL server. +---------------------------------------------------------------------------- + +When MySQL is running in ANSI-compatibility mode, there are some major +differences in how :term:`SQL` is structured (see +). Most important of all, the +quote-character (") is interpreted as an identifier quote character and not as +a string quote character, which makes many internal phpMyAdmin operations into +invalid :term:`SQL` statements. There is no +workaround to this behaviour. News to this item will be posted in `issue +#7383 `_. + +.. _faq3_10: + +3.10 Homonyms and no primary key: When the results of a SELECT display more that one column with the same value (for example ``SELECT lastname from employees where firstname like 'A%'`` and two "Smith" values are displayed), if I click Edit I cannot be sure that I am editing the intended row. +----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +Please make sure that your table has a :term:`primary key`, so that phpMyAdmin +can use it for the Edit and Delete links. + +.. _faq3_11: + +3.11 The number of rows for InnoDB tables is not correct. +--------------------------------------------------------- + +phpMyAdmin uses a quick method to get the row count, and this method only +returns an approximate count in the case of InnoDB tables. See +:config:option:`$cfg['MaxExactCount']` for a way to modify those results, but +this could have a serious impact on performance. +However, one can easily replace the approximate row count with exact count by +simply clicking on the approximate count. This can also be done for all tables +at once by clicking on the rows sum displayed at the bottom. + +.. seealso:: :config:option:`$cfg['MaxExactCount']` + +.. _faq3_12: + +3.12 (withdrawn). +----------------- + +.. _faq3_13: + +3.13 I get an error when entering ``USE`` followed by a db name containing an hyphen. +------------------------------------------------------------------------------------- + +The tests I have made with MySQL 5.1.49 shows that the API does not +accept this syntax for the USE command. + +.. _faq3_14: + +3.14 I am not able to browse a table when I don't have the right to SELECT one of the columns. +---------------------------------------------------------------------------------------------- + +This has been a known limitation of phpMyAdmin since the beginning and +it's not likely to be solved in the future. + +.. _faq3_15: + +3.15 (withdrawn). +----------------- + +.. _faq3_16: + +3.16 (withdrawn). +----------------- + +.. _faq3_17: + +3.17 (withdrawn). +----------------- + +.. _faq3_18: + +3.18 When I import a CSV file that contains multiple tables, they are lumped together into a single table. +---------------------------------------------------------------------------------------------------------- + +There is no reliable way to differentiate tables in :term:`CSV` format. For the +time being, you will have to break apart :term:`CSV` files containing multiple +tables. + +.. _faq3_19: + +3.19 When I import a file and have phpMyAdmin determine the appropriate data structure it only uses int, decimal, and varchar types. +------------------------------------------------------------------------------------------------------------------------------------ + +Currently, the import type-detection system can only assign these +MySQL types to columns. In future, more will likely be added but for +the time being you will have to edit the structure to your liking +post-import. Also, you should note the fact that phpMyAdmin will use +the size of the largest item in any given column as the column size +for the appropriate type. If you know you will be adding larger items +to that column then you should manually adjust the column sizes +accordingly. This is done for the sake of efficiency. + +.. _faq3_20: + +3.20 After upgrading, some bookmarks are gone or their content cannot be shown. +------------------------------------------------------------------------------- + +At some point, the character set used to store bookmark content has changed. +It's better to recreate your bookmark from the newer phpMyAdmin version. + +.. _faq3_21: + +3.21 I am unable to log in with a username containing unicode characters such as 谩. +----------------------------------------------------------------------------------- + +This can happen if MySQL server is not configured to use utf-8 as default +charset. This is a limitation of how PHP and the MySQL server interact; there +is no way for PHP to set the charset before authenticating. + +.. seealso:: + + `phpMyAdmin issue 12232 `_, + `MySQL documentation note `_ + +.. _faqmultiuser: + +ISPs, multi-user installations +++++++++++++++++++++++++++++++ + +.. _faq4_1: + +4.1 I'm an ISP. Can I setup one central copy of phpMyAdmin or do I need to install it for each customer? +-------------------------------------------------------------------------------------------------------- + +Since version 2.0.3, you can setup a central copy of phpMyAdmin for all your +users. The development of this feature was kindly sponsored by NetCologne GmbH. +This requires a properly setup MySQL user management and phpMyAdmin +:term:`HTTP` or cookie authentication. + +.. seealso:: :ref:`authentication_modes` + +.. _faq4_2: + +4.2 What's the preferred way of making phpMyAdmin secure against evil access? +----------------------------------------------------------------------------- + +This depends on your system. If you're running a server which cannot be +accessed by other people, it's sufficient to use the directory protection +bundled with your webserver (with Apache you can use :term:`.htaccess` files, +for example). If other people have telnet access to your server, you should use +phpMyAdmin's :term:`HTTP` or cookie authentication features. + +Suggestions: + +* Your :file:`config.inc.php` file should be ``chmod 660``. +* All your phpMyAdmin files should be chown -R phpmy.apache, where phpmy + is a user whose password is only known to you, and apache is the group + under which Apache runs. +* Follow security recommendations for PHP and your webserver. + +.. _faq4_3: + +4.3 I get errors about not being able to include a file in */lang* or in */libraries*. +-------------------------------------------------------------------------------------- + +Check :file:`php.ini`, or ask your sysadmin to check it. The +``include_path`` must contain "." somewhere in it, and +``open_basedir``, if used, must contain "." and "./lang" to allow +normal operation of phpMyAdmin. + +.. _faq4_4: + +4.4 phpMyAdmin always gives "Access denied" when using HTTP authentication. +--------------------------------------------------------------------------- + +This could happen for several reasons: + +* :config:option:`$cfg['Servers'][$i]['controluser']` and/or :config:option:`$cfg['Servers'][$i]['controlpass']` are wrong. +* The username/password you specify in the login dialog are invalid. +* You have already setup a security mechanism for the phpMyAdmin- + directory, eg. a :term:`.htaccess` file. This would interfere with phpMyAdmin's + authentication, so remove it. + +.. _faq4_5: + +4.5 Is it possible to let users create their own databases? +----------------------------------------------------------- + +Starting with 2.2.5, in the user management page, you can enter a +wildcard database name for a user (for example "joe%"), and put the +privileges you want. For example, adding ``SELECT, INSERT, UPDATE, +DELETE, CREATE, DROP, INDEX, ALTER`` would let a user create/manage +his/her database(s). + +.. _faq4_6: + +4.6 How can I use the Host-based authentication additions? +---------------------------------------------------------- + +If you have existing rules from an old :term:`.htaccess` file, you can take them and +add a username between the ``'deny'``/``'allow'`` and ``'from'`` +strings. Using the username wildcard of ``'%'`` would be a major +benefit here if your installation is suited to using it. Then you can +just add those updated lines into the +:config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` array. + +If you want a pre-made sample, you can try this fragment. It stops the +'root' user from logging in from any networks other than the private +network :term:`IP` blocks. + +.. code-block:: php + + //block root from logging in except from the private networks + $cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow'; + $cfg['Servers'][$i]['AllowDeny']['rules'] = array( + 'deny root from all', + 'allow root from localhost', + 'allow root from 10.0.0.0/8', + 'allow root from 192.168.0.0/16', + 'allow root from 172.16.0.0/12', + ); + +.. _faq4_7: + +4.7 Authentication window is displayed more than once, why? +----------------------------------------------------------- + +This happens if you are using a :term:`URL` to start phpMyAdmin which is +different than the one set in your :config:option:`$cfg['PmaAbsoluteUri']`. For +example, a missing "www", or entering with an :term:`IP` address while a domain +name is defined in the config file. + +.. _faq4_8: + +4.8 Which parameters can I use in the URL that starts phpMyAdmin? +----------------------------------------------------------------- + +When starting phpMyAdmin, you can use the ``db`` +and ``server`` parameters. This last one can contain +either the numeric host index (from ``$i`` of the configuration file) +or one of the host names present in the configuration file. + +For example, to jump directly to a particular database, a URL can be constructed as +``https://example.com/phpmyadmin/?db=sakila``. + +.. versionchanged:: 4.9.0 + + Support for using the ``pma_username`` and ``pma_password`` parameters was removed + in phpMyAdmin 4.9.0 (see `PMASA-2019-4 `_). + +.. _faqbrowsers: + +Browsers or client OS ++++++++++++++++++++++ + +.. _faq5_1: + +5.1 I get an out of memory error, and my controls are non-functional, when trying to create a table with more than 14 columns. +------------------------------------------------------------------------------------------------------------------------------ + +We could reproduce this problem only under Win98/98SE. Testing under +WinNT4 or Win2K, we could easily create more than 60 columns. A +workaround is to create a smaller number of columns, then come back to +your table properties and add the other columns. + +.. _faq5_2: + +5.2 With Xitami 2.5b4, phpMyAdmin won't process form fields. +------------------------------------------------------------ + +This is not a phpMyAdmin problem but a Xitami known bug: you'll face +it with each script/website that use forms. Upgrade or downgrade your +Xitami server. + +.. _faq5_3: + +5.3 I have problems dumping tables with Konqueror (phpMyAdmin 2.2.2). +--------------------------------------------------------------------- + +With Konqueror 2.1.1: plain dumps, zip and gzip dumps work ok, except +that the proposed file name for the dump is always 'tbl\_dump.php'. +The bzip2 dumps don't seem to work. With Konqueror 2.2.1: plain dumps +work; zip dumps are placed into the user's temporary directory, so +they must be moved before closing Konqueror, or else they disappear. +gzip dumps give an error message. Testing needs to be done for +Konqueror 2.2.2. + +.. _faq5_4: + +5.4 I can't use the cookie authentication mode because Internet Explorer never stores the cookies. +-------------------------------------------------------------------------------------------------- + +MS Internet Explorer seems to be really buggy about cookies, at least +till version 6. + +.. _faq5_5: + +5.5 (withdrawn). +---------------------------------------------------------------------------- + +.. _faq5_6: + +5.6 (withdrawn). +----------------------------------------------------------------------------------------------------------------------------------------------------------------- + +.. _faq5_7: + +5.7 I refresh (reload) my browser, and come back to the welcome page. +--------------------------------------------------------------------- + +Some browsers support right-clicking into the frame you want to +refresh, just do this in the right frame. + +.. _faq5_8: + +5.8 With Mozilla 0.9.7 I have problems sending a query modified in the query box. +--------------------------------------------------------------------------------- + +Looks like a Mozilla bug: 0.9.6 was OK. We will keep an eye on future +Mozilla versions. + +.. _faq5_9: + +5.9 With Mozilla 0.9.? to 1.0 and Netscape 7.0-PR1 I can't type a whitespace in the SQL-Query edit area: the page scrolls down. +------------------------------------------------------------------------------------------------------------------------------- + +This is a Mozilla bug (see bug #26882 at `BugZilla +`_). + +.. _faq5_10: + +5.10 (withdrawn). +----------------------------------------------------------------------------------------- + +.. _faq5_11: + +5.11 Extended-ASCII characters like German umlauts are displayed wrong. +----------------------------------------------------------------------- + +Please ensure that you have set your browser's character set to the +one of the language file you have selected on phpMyAdmin's start page. +Alternatively, you can try the auto detection mode that is supported +by the recent versions of the most browsers. + +.. _faq5_12: + +5.12 Mac OS X Safari browser changes special characters to "?". +--------------------------------------------------------------- + +This issue has been reported by a :term:`Mac OS X` user, who adds that Chimera, +Netscape and Mozilla do not have this problem. + +.. _faq5_13: + +5.13 (withdrawn) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +.. _faq5_14: + +5.14 (withdrawn) +------------------------------------------------------------------------------------------------------------------ + +.. _faq5_15: + +5.15 (withdrawn) +----------------------------------------- + +.. _faq5_16: + +5.16 With Internet Explorer, I get "Access is denied" Javascript errors. Or I cannot make phpMyAdmin work under Windows. +------------------------------------------------------------------------------------------------------------------------ + +Please check the following points: + +* Maybe you have defined your :config:option:`$cfg['PmaAbsoluteUri']` setting in + :file:`config.inc.php` to an :term:`IP` address and you are starting phpMyAdmin + with a :term:`URL` containing a domain name, or the reverse situation. +* Security settings in IE and/or Microsoft Security Center are too high, + thus blocking scripts execution. +* The Windows Firewall is blocking Apache and MySQL. You must allow + :term:`HTTP` ports (80 or 443) and MySQL + port (usually 3306) in the "in" and "out" directions. + +.. _faq5_17: + +5.17 With Firefox, I cannot delete rows of data or drop a database. +------------------------------------------------------------------- + +Many users have confirmed that the Tabbrowser Extensions plugin they +installed in their Firefox is causing the problem. + +.. _faq5_18: + +5.18 (withdrawn) +----------------------------------------------------------------------------------------- + +.. _faq5_19: + +5.19 I get JavaScript errors in my browser. +------------------------------------------- + +Issues have been reported with some combinations of browser +extensions. To troubleshoot, disable all extensions then clear your +browser cache to see if the problem goes away. + +.. _faq5_20: + +5.20 I get errors about violating Content Security Policy. +---------------------------------------------------------- + +If you see errors like: + +.. code-block:: text + + Refused to apply inline style because it violates the following Content Security Policy directive + +This is usually caused by some software, which wrongly rewrites +:mailheader:`Content Security Policy` headers. Usually this is caused by +antivirus proxy or browser addons which are causing such errors. + +If you see these errors, try disabling the HTTP proxy in antivirus or disable +the :mailheader:`Content Security Policy` rewriting in it. If that doesn't +help, try disabling browser extensions. + +Alternatively it can be also server configuration issue (if the webserver is +configured to emit :mailheader:`Content Security Policy` headers, they can +override the ones from phpMyAdmin). + +Programs known to cause these kind of errors: + +* Kaspersky Internet Security + +.. _faq5_21: + +5.21 I get errors about potentially unsafe operation when browsing table or executing SQL query. +------------------------------------------------------------------------------------------------ + +If you see errors like: + +.. code-block:: text + + A potentially unsafe operation has been detected in your request to this site. + +This is usually caused by web application firewall doing requests filtering. It +tries to prevent SQL injection, however phpMyAdmin is tool designed to execute +SQL queries, thus it makes it unusable. + +Please whitelist phpMyAdmin scripts from the web application firewall settings +or disable it completely for phpMyAdmin path. + +Programs known to cause these kind of errors: + +* Wordfence Web Application Firewall + +.. _faqusing: + +Using phpMyAdmin +++++++++++++++++ + +.. _faq6_1: + +6.1 I can't insert new rows into a table / I can't create a table - MySQL brings up a SQL error. +------------------------------------------------------------------------------------------------ + +Examine the :term:`SQL` error with care. +Often the problem is caused by specifying a wrong column-type. Common +errors include: + +* Using ``VARCHAR`` without a size argument +* Using ``TEXT`` or ``BLOB`` with a size argument + +Also, look at the syntax chapter in the MySQL manual to confirm that +your syntax is correct. + +.. _faq6_2: + +6.2 When I create a table, I set an index for two columns and phpMyAdmin generates only one index with those two columns. +------------------------------------------------------------------------------------------------------------------------- + +This is the way to create a multi-columns index. If you want two +indexes, create the first one when creating the table, save, then +display the table properties and click the Index link to create the +other index. + +.. _faq6_3: + +6.3 How can I insert a null value into my table? +------------------------------------------------ + +Since version 2.2.3, you have a checkbox for each column that can be +null. Before 2.2.3, you had to enter "null", without the quotes, as +the column's value. Since version 2.5.5, you have to use the checkbox +to get a real NULL value, so if you enter "NULL" this means you want a +literal NULL in the column, and not a NULL value (this works in PHP4). + +.. _faq6_4: + +6.4 How can I backup my database or table? +------------------------------------------ + +Click on a database or table name in the navigation panel, the properties will +be displayed. Then on the menu, click "Export", you can dump the structure, the +data, or both. This will generate standard :term:`SQL` statements that can be +used to recreate your database/table. You will need to choose "Save as file", +so that phpMyAdmin can transmit the resulting dump to your station. Depending +on your PHP configuration, you will see options to compress the dump. See also +the :config:option:`$cfg['ExecTimeLimit']` configuration variable. For +additional help on this subject, look for the word "dump" in this document. + +.. _faq6_5: + +6.5 How can I restore (upload) my database or table using a dump? How can I run a ".sql" file? +---------------------------------------------------------------------------------------------- + +Click on a database name in the navigation panel, the properties will +be displayed. Select "Import" from the list of tabs in the right鈥揾and +frame (or ":term:`SQL`" if your phpMyAdmin +version is previous to 2.7.0). In the "Location of the text file" +section, type in the path to your dump filename, or use the Browse +button. Then click Go. With version 2.7.0, the import engine has been +re鈥搘ritten, if possible it is suggested that you upgrade to take +advantage of the new features. For additional help on this subject, +look for the word "upload" in this document. + +Note: For errors while importing of dumps exported from older MySQL versions to newer MySQL versions, +please check :ref:`faq6_41`. + +.. _faq6_6: + +6.6 How can I use the relation table in Query-by-example? +--------------------------------------------------------- + +Here is an example with the tables persons, towns and countries, all +located in the database "mydb". If you don't have a ``pma__relation`` +table, create it as explained in the configuration section. Then +create the example tables: + +.. code-block:: mysql + + CREATE TABLE REL_countries ( + country_code char(1) NOT NULL default '', + description varchar(10) NOT NULL default '', + PRIMARY KEY (country_code) + ) ENGINE=MyISAM; + + INSERT INTO REL_countries VALUES ('C', 'Canada'); + + CREATE TABLE REL_persons ( + id tinyint(4) NOT NULL auto_increment, + person_name varchar(32) NOT NULL default '', + town_code varchar(5) default '0', + country_code char(1) NOT NULL default '', + PRIMARY KEY (id) + ) ENGINE=MyISAM; + + INSERT INTO REL_persons VALUES (11, 'Marc', 'S', 'C'); + INSERT INTO REL_persons VALUES (15, 'Paul', 'S', 'C'); + + CREATE TABLE REL_towns ( + town_code varchar(5) NOT NULL default '0', + description varchar(30) NOT NULL default '', + PRIMARY KEY (town_code) + ) ENGINE=MyISAM; + + INSERT INTO REL_towns VALUES ('S', 'Sherbrooke'); + INSERT INTO REL_towns VALUES ('M', 'Montr茅al'); + +To setup appropriate links and display information: + +* on table "REL\_persons" click Structure, then Relation view +* for "town\_code", choose from dropdowns, "mydb", "REL\_towns", "code" + for foreign database, table and column respectively +* for "country\_code", choose from dropdowns, "mydb", "REL\_countries", + "country\_code" for foreign database, table and column respectively +* on table "REL\_towns" click Structure, then Relation view +* in "Choose column to display", choose "description" +* repeat the two previous steps for table "REL\_countries" + +Then test like this: + +* Click on your db name in the navigation panel +* Choose "Query" +* Use tables: persons, towns, countries +* Click "Update query" +* In the columns row, choose persons.person\_name and click the "Show" + tickbox +* Do the same for towns.description and countries.descriptions in the + other 2 columns +* Click "Update query" and you will see in the query box that the + correct joins have been generated +* Click "Submit query" + +.. _faqdisplay: + +6.7 How can I use the "display column" feature? +----------------------------------------------- + +Starting from the previous example, create the ``pma__table_info`` as +explained in the configuration section, then browse your persons +table, and move the mouse over a town code or country code. See also +:ref:`faq6_21` for an additional feature that "display column" +enables: drop-down list of possible values. + +.. _faqpdf: + +6.8 How can I produce a PDF schema of my database? +-------------------------------------------------- + +First the configuration variables "relation", "table\_coords" and +"pdf\_pages" have to be filled in. Then you need to think about your +schema layout. Which tables will go on which pages? + +* Select your database in the navigation panel. +* Choose "Operations" in the navigation bar at the top. +* Choose "Edit :term:`PDF` Pages" near the + bottom of the page. +* Enter a name for the first :term:`PDF` page + and click Go. If you like, you can use the "automatic layout," which + will put all your linked tables onto the new page. +* Select the name of the new page (making sure the Edit radio button is + selected) and click Go. +* Select a table from the list, enter its coordinates and click Save. + Coordinates are relative; your diagram will be automatically scaled to + fit the page. When initially placing tables on the page, just pick any + coordinates -- say, 50x50. After clicking Save, you can then use the + :ref:`wysiwyg` to position the element correctly. +* When you'd like to look at your :term:`PDF`, first be sure to click the Save + button beneath the list of tables and coordinates, to save any changes you + made there. Then scroll all the way down, select the :term:`PDF` options you + want, and click Go. +* Internet Explorer for Windows may suggest an incorrect filename when + you try to save a generated :term:`PDF`. + When saving a generated :term:`PDF`, be + sure that the filename ends in ".pdf", for example "schema.pdf". + Browsers on other operating systems, and other browsers on Windows, do + not have this problem. + +.. seealso:: + + :ref:`relations` + +.. _faq6_9: + +6.9 phpMyAdmin is changing the type of one of my columns! +--------------------------------------------------------- + +No, it's MySQL that is doing `silent column type changing +`_. + +.. _underscore: + +6.10 When creating a privilege, what happens with underscores in the database name? +----------------------------------------------------------------------------------- + +If you do not put a backslash before the underscore, this is a +wildcard grant, and the underscore means "any character". So, if the +database name is "john\_db", the user would get rights to john1db, +john2db ... If you put a backslash before the underscore, it means +that the database name will have a real underscore. + +.. _faq6_11: + +6.11 What is the curious symbol 酶 in the statistics pages? +---------------------------------------------------------- + +It means "average". + +.. _faqexport: + +6.12 I want to understand some Export options. +---------------------------------------------- + +**Structure:** + +* "Add DROP TABLE" will add a line telling MySQL to `drop the table + `_, if it already + exists during the import. It does NOT drop the table after your + export, it only affects the import file. +* "If Not Exists" will only create the table if it doesn't exist. + Otherwise, you may get an error if the table name exists but has a + different structure. +* "Add AUTO\_INCREMENT value" ensures that AUTO\_INCREMENT value (if + any) will be included in backup. +* "Enclose table and column names with backquotes" ensures that column + and table names formed with special characters are protected. +* "Add into comments" includes column comments, relations, and MIME + types set in the pmadb in the dump as :term:`SQL` comments + (*/\* xxx \*/*). + +**Data:** + +* "Complete inserts" adds the column names on every INSERT command, for + better documentation (but resulting file is bigger). +* "Extended inserts" provides a shorter dump file by using only once the + INSERT verb and the table name. +* "Delayed inserts" are best explained in the `MySQL manual - INSERT DELAYED Syntax + `_. +* "Ignore inserts" treats errors as a warning instead. Again, more info + is provided in the `MySQL manual - INSERT Syntax + `_, but basically with + this selected, invalid values are adjusted and inserted rather than + causing the entire statement to fail. + +.. _faq6_13: + +6.13 I would like to create a database with a dot in its name. +-------------------------------------------------------------- + +This is a bad idea, because in MySQL the syntax "database.table" is +the normal way to reference a database and table name. Worse, MySQL +will usually let you create a database with a dot, but then you cannot +work with it, nor delete it. + +.. _faqsqlvalidator: + +6.14 (withdrawn). +----------------- + +.. _faq6_15: + +6.15 I want to add a BLOB column and put an index on it, but MySQL says "BLOB column '...' used in key specification without a key length". +------------------------------------------------------------------------------------------------------------------------------------------- + +The right way to do this, is to create the column without any indexes, +then display the table structure and use the "Create an index" dialog. +On this page, you will be able to choose your BLOB column, and set a +size to the index, which is the condition to create an index on a BLOB +column. + +.. _faq6_16: + +6.16 How can I simply move in page with plenty editing fields? +-------------------------------------------------------------- + +You can use :kbd:`Ctrl+arrows` (:kbd:`Option+Arrows` in Safari) for moving on +most pages with many editing fields (table structure changes, row editing, +etc.). + +.. _faq6_17: + +6.17 Transformations: I can't enter my own mimetype! What is this feature then useful for? +------------------------------------------------------------------------------------------ + +Defining mimetypes is of no use if you can't put +transformations on them. Otherwise you could just put a comment on the +column. Because entering your own mimetype will cause serious syntax +checking issues and validation, this introduces a high-risk false- +user-input situation. Instead you have to initialize mimetypes using +functions or empty mimetype definitions. + +Plus, you have a whole overview of available mimetypes. Who knows all those +mimetypes by heart so he/she can enter it at will? + +.. _faqbookmark: + +6.18 Bookmarks: Where can I store bookmarks? Why can't I see any bookmarks below the query box? What are these variables for? +----------------------------------------------------------------------------------------------------------------------------- + +You need to have configured the :ref:`linked-tables` for using bookmarks +feature. Once you have done that, you can use bookmarks in the :guilabel:`SQL` tab. + +.. seealso:: :ref:`bookmarks` + +.. _faq6_19: + +6.19 How can I create simple LATEX document to include exported table? +---------------------------------------------------------------------- + +You can simply include table in your LATEX documents, +minimal sample document should look like following one (assuming you +have table exported in file :file:`table.tex`): + +.. code-block:: latex + + \documentclass{article} % or any class you want + \usepackage{longtable} % for displaying table + \begin{document} % start of document + \include{table} % including exported table + \end{document} % end of document + +.. _faq6_20: + +6.20 I see a lot of databases which are not mine, and cannot access them. +------------------------------------------------------------------------- + +You have one of these global privileges: CREATE TEMPORARY TABLES, SHOW +DATABASES, LOCK TABLES. Those privileges also enable users to see all the +database names. So if your users do not need those privileges, you can remove +them and their databases list will shorten. + +.. seealso:: + +.. _faq6_21: + +6.21 In edit/insert mode, how can I see a list of possible values for a column, based on some foreign table? +------------------------------------------------------------------------------------------------------------ + +You have to setup appropriate links between the tables, and also setup +the "display column" in the foreign table. See :ref:`faq6_6` for an +example. Then, if there are 100 values or less in the foreign table, a +drop-down list of values will be available. You will see two lists of +values, the first list containing the key and the display column, the +second list containing the display column and the key. The reason for +this is to be able to type the first letter of either the key or the +display column. For 100 values or more, a distinct window will appear, +to browse foreign key values and choose one. To change the default +limit of 100, see :config:option:`$cfg['ForeignKeyMaxLimit']`. + +.. _faq6_22: + +6.22 Bookmarks: Can I execute a default bookmark automatically when entering Browse mode for a table? +----------------------------------------------------------------------------------------------------- + +Yes. If a bookmark has the same label as a table name and it's not a +public bookmark, it will be executed. + +.. seealso:: :ref:`bookmarks` + +.. _faq6_23: + +6.23 Export: I heard phpMyAdmin can export Microsoft Excel files? +----------------------------------------------------------------- + +You can use :term:`CSV` for Microsoft Excel, +which works out of the box. + +.. versionchanged:: 3.4.5 + Since phpMyAdmin 3.4.5 support for direct export to Microsoft Excel version + 97 and newer was dropped. + +.. _faq6_24: + +6.24 Now that phpMyAdmin supports native MySQL 4.1.x column comments, what happens to my column comments stored in pmadb? +------------------------------------------------------------------------------------------------------------------------- + +Automatic migration of a table's pmadb-style column comments to the +native ones is done whenever you enter Structure page for this table. + +.. _faq6_25: + +6.25 (withdrawn). +----------------- + +.. _faq6_26: + +6.26 How can I select a range of rows? +-------------------------------------- + +Click the first row of the range, hold the shift key and click the +last row of the range. This works everywhere you see rows, for example +in Browse mode or on the Structure page. + +.. _faq6_27: + +6.27 What format strings can I use? +----------------------------------- + +In all places where phpMyAdmin accepts format strings, you can use +``@VARIABLE@`` expansion and `strftime `_ +format strings. The expanded variables depend on a context (for +example, if you haven't chosen a table, you can not get the table +name), but the following variables can be used: + +``@HTTP_HOST@`` + HTTP host that runs phpMyAdmin +``@SERVER@`` + MySQL server name +``@VERBOSE@`` + Verbose MySQL server name as defined in :config:option:`$cfg['Servers'][$i]['verbose']` +``@VSERVER@`` + Verbose MySQL server name if set, otherwise normal +``@DATABASE@`` + Currently opened database +``@TABLE@`` + Currently opened table +``@COLUMNS@`` + Columns of the currently opened table +``@PHPMYADMIN@`` + phpMyAdmin with version + +.. _wysiwyg: + +6.28 How can I easily edit relational schema for export? +-------------------------------------------------------- + +By clicking on the button 'toggle scratchboard' on the page where you +edit x/y coordinates of those elements you can activate a scratchboard +where all your elements are placed. By clicking on an element, you can +move them around in the pre-defined area and the x/y coordinates will +get updated dynamically. Likewise, when entering a new position +directly into the input field, the new position in the scratchboard +changes after your cursor leaves the input field. + +You have to click on the 'OK'-button below the tables to save the new +positions. If you want to place a new element, first add it to the +table of elements and then you can drag the new element around. + +By changing the paper size and the orientation you can change the size +of the scratchboard as well. You can do so by just changing the +dropdown field below, and the scratchboard will resize automatically, +without interfering with the current placement of the elements. + +If ever an element gets out of range you can either enlarge the paper +size or click on the 'reset' button to place all elements below each +other. + +.. _faq6_29: + +6.29 Why can't I get a chart from my query result table? +-------------------------------------------------------- + +Not every table can be put to the chart. Only tables with one, two or +three columns can be visualised as a chart. Moreover the table must be +in a special format for chart script to understand it. Currently +supported formats can be found in :ref:`charts`. + +.. _faq6_30: + +6.30 Import: How can I import ESRI Shapefiles? +---------------------------------------------- + +An ESRI Shapefile is actually a set of several files, where .shp file +contains geometry data and .dbf file contains data related to those +geometry data. To read data from .dbf file you need to have PHP +compiled with the dBase extension (--enable-dbase). Otherwise only +geometry data will be imported. + +To upload these set of files you can use either of the following +methods: + +Configure upload directory with :config:option:`$cfg['UploadDir']`, upload both .shp and .dbf files with +the same filename and chose the .shp file from the import page. + +Create a zip archive with .shp and .dbf files and import it. For this +to work, you need to set :config:option:`$cfg['TempDir']` to a place where the web server user can +write (for example ``'./tmp'``). + +To create the temporary directory on a UNIX-based system, you can do: + +.. code-block:: sh + + cd phpMyAdmin + mkdir tmp + chmod o+rwx tmp + +.. _faq6_31: + +6.31 How do I create a relation in designer? +-------------------------------------------- + +To select relation, click: The display column is shown in pink. To +set/unset a column as the display column, click the "Choose column to +display" icon, then click on the appropriate column name. + +.. _faq6_32: + +6.32 How can I use the zoom search feature? +------------------------------------------- + +The Zoom search feature is an alternative to table search feature. It allows +you to explore a table by representing its data in a scatter plot. You can +locate this feature by selecting a table and clicking the :guilabel:`Search` +tab. One of the sub-tabs in the :guilabel:`Table Search` page is +:guilabel:`Zoom Search`. + +Consider the table REL\_persons in :ref:`faq6_6` for +an example. To use zoom search, two columns need to be selected, for +example, id and town\_code. The id values will be represented on one +axis and town\_code values on the other axis. Each row will be +represented as a point in a scatter plot based on its id and +town\_code. You can include two additional search criteria apart from +the two fields to display. + +You can choose which field should be +displayed as label for each point. If a display column has been set +for the table (see :ref:`faqdisplay`), it is taken as the label unless +you specify otherwise. You can also select the maximum number of rows +you want to be displayed in the plot by specifing it in the 'Max rows +to plot' field. Once you have decided over your criteria, click 'Go' +to display the plot. + +After the plot is generated, you can use the +mousewheel to zoom in and out of the plot. In addition, panning +feature is enabled to navigate through the plot. You can zoom-in to a +certain level of detail and use panning to locate your area of +interest. Clicking on a point opens a dialogue box, displaying field +values of the data row represented by the point. You can edit the +values if required and click on submit to issue an update query. Basic +instructions on how to use can be viewed by clicking the 'How to use?' +link located just above the plot. + +.. _faq6_33: + +6.33 When browsing a table, how can I copy a column name? +--------------------------------------------------------- + +Selecting the name of the column within the browse table header cell +for copying is difficult, as the columns support reordering by +dragging the header cells as well as sorting by clicking on the linked +column name. To copy a column name, double-click on the empty area +next to the column name, when the tooltip tells you to do so. This +will show you an input box with the column name. You may right-click +the column name within this input box to copy it to your clipboard. + +.. _faq6_34: + +6.34 How can I use the Favorite Tables feature? +--------------------------------------------------------- + +Favorite Tables feature is very much similar to Recent Tables feature. +It allows you to add a shortcut for the frequently used tables of any +database in the navigation panel . You can easily navigate to any table +in the list by simply choosing it from the list. These tables are stored +in your browser's local storage if you have not configured your +`phpMyAdmin Configuration Storage`. Otherwise these entries are stored in +`phpMyAdmin Configuration Storage`. + +IMPORTANT: In absence of `phpMyAdmin Configuration Storage`, your Favorite +tables may be different in different browsers based on your different +selections in them. + +To add a table to Favorite list simply click on the `Gray` star in front +of a table name in the list of tables of a Database and wait until it +turns to `Yellow`. +To remove a table from list, simply click on the `Yellow` star and +wait until it turns `Gray` again. + +Using :config:option:`$cfg['NumFavoriteTables']` in your :file:`config.inc.php` +file, you can define the maximum number of favorite tables shown in the +navigation panel. Its default value is `10`. + +.. _faq6_35: + +6.35 How can I use the Range search feature? +--------------------------------------------------------- + +With the help of range search feature, one can specify a range of values for +particular column(s) while performing search operation on a table from the `Search` +tab. + +To use this feature simply click on the `BETWEEN` or `NOT BETWEEN` operators +from the operator select list in front of the column name. On choosing one of the +above options, a dialog box will show up asking for the `Minimum` and `Maximum` +value for that column. Only the specified range of values will be included +in case of `BETWEEN` and excluded in case of `NOT BETWEEN` from the final results. + +Note: The Range search feature will work only `Numeric` and `Date` data type columns. + +.. _faq6_36: + +6.36 What is Central columns and how can I use this feature? +------------------------------------------------------------ + +As the name suggests, the Central columns feature enables to maintain a central list of +columns per database to avoid similar name for the same data element and bring consistency +of data type for the same data element. You can use the central list of columns to +add an element to any table structure in that database which will save from writing +similar column name and column definition. + +To add a column to central list, go to table structure page, check the columns you want +to include and then simply click on "Add to central columns". If you want to add all +unique columns from more than one table from a database then go to database structure page, +check the tables you want to include and then select "Add columns to central list". + +To remove a column from central list, go to Table structure page, check the columns you want +to remove and then simply click on "Remove from central columns". If you want to remove all +columns from more than one tables from a database then go to database structure page, +check the tables you want to include and then select "Remove columns from central list". + +To view and manage the central list, select the database you want to manage central columns +for then from the top menu click on "Central columns". You will be taken to a page where +you will have options to edit, delete or add new columns to central list. + +.. _faq6_37: + +6.37 How can I use Improve Table structure feature? +--------------------------------------------------------- + +Improve table structure feature helps to bring the table structure upto +Third Normal Form. A wizard is presented to user which asks questions about the +elements during the various steps for normalization and a new structure is proposed +accordingly to bring the table into the First/Second/Third Normal form. +On startup of the wizard, user gets to select upto what normal form they want to +normalize the table structure. + +Here is an example table which you can use to test all of the three First, Second and +Third Normal Form. + +.. code-block:: mysql + + CREATE TABLE `VetOffice` ( + `petName` varchar(64) NOT NULL, + `petBreed` varchar(64) NOT NULL, + `petType` varchar(64) NOT NULL, + `petDOB` date NOT NULL, + `ownerLastName` varchar(64) NOT NULL, + `ownerFirstName` varchar(64) NOT NULL, + `ownerPhone1` int(12) NOT NULL, + `ownerPhone2` int(12) NOT NULL, + `ownerEmail` varchar(64) NOT NULL, + ); + +The above table is not in First normal Form as no :term:`primary key` exists. Primary key +is supposed to be (`petName`,`ownerLastName`,`ownerFirstName`) . If the :term:`primary key` +is chosen as suggested the resultant table won't be in Second as well as Third Normal +form as the following dependencies exists. + +.. code-block:: mysql + + (OwnerLastName, OwnerFirstName) -> OwnerEmail + (OwnerLastName, OwnerFirstName) -> OwnerPhone + PetBreed -> PetType + +Which says, OwnerEmail depends on OwnerLastName and OwnerFirstName. +OwnerPhone depends on OwnerLastName and OwnerFirstName. +PetType depends on PetBreed. + +.. _faq6_38: + +6.38 How can I reassign auto-incremented values? +------------------------------------------------ + +Some users prefer their AUTO_INCREMENT values to be consecutive; this is not +always the case after row deletion. + +Here are the steps to accomplish this. These are manual steps because they +involve a manual verification at one point. + +* Ensure that you have exclusive access to the table to rearrange + +* On your :term:`primary key` column (i.e. id), remove the AUTO_INCREMENT setting + +* Delete your primary key in Structure > indexes + +* Create a new column future_id as primary key, AUTO_INCREMENT + +* Browse your table and verify that the new increments correspond to what + you're expecting + +* Drop your old id column + +* Rename the future_id column to id + +* Move the new id column via Structure > Move columns + +.. _faq6_39: + +6.39 What is the "Adjust privileges" option when renaming, copying, or moving a database, table, column, or procedure? +---------------------------------------------------------------------------------------------------------------------- + +When renaming/copying/moving a database/table/column/procedure, +MySQL does not adjust the original privileges relating to these objects +on its own. By selecting this option, phpMyAdmin will adjust the privilege +table so that users have the same privileges on the new items. + +For example: A user 'bob'@'localhost' has a 'SELECT' privilege on a +column named 'id'. Now, if this column is renamed to 'id_new', MySQL, +on its own, would **not** adjust the column privileges to the new column name. +phpMyAdmin can make this adjustment for you automatically. + +Notes: + +* While adjusting privileges for a database, the privileges of all + database-related elements (tables, columns and procedures) are also adjusted + to the database's new name. + +* Similarly, while adjusting privileges for a table, the privileges of all + the columns inside the new table are also adjusted. + +* While adjusting privileges, the user performing the operation **must** have the following + privileges: + + * SELECT, INSERT, UPDATE, DELETE privileges on following tables: + `mysql`.`db`, `mysql`.`columns_priv`, `mysql`.`tables_priv`, `mysql`.`procs_priv` + * FLUSH privilege (GLOBAL) + +Thus, if you want to replicate the database/table/column/procedure as it is +while renaming/copying/moving these objects, make sure you have checked this option. + +.. _faq6_40: + +6.40 I see "Bind parameters" checkbox in the "SQL" page. How do I write parameterized SQL queries? +-------------------------------------------------------------------------------------------------- + +From version 4.5, phpMyAdmin allows users to execute parameterized queries in the "SQL" page. +Parameters should be prefixed with a colon(:) and when the "Bind parameters" checkbox is checked +these parameters will be identified and input fields for these parameters will be presented. +Values entered in these field will be substituted in the query before being executed. + +.. _faq6_41: + +6.41 I get import errors while importing the dumps exported from older MySQL versions (pre-5.7.6) into newer MySQL versions (5.7.7+), but they work fine when imported back on same older versions ? +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +If you get errors like *#1031 - Table storage engine for 'table_name' doesn't have this option* +while importing the dumps exported from pre-5.7.7 MySQL servers into new MySQL server versions 5.7.7+, +it might be because ROW_FORMAT=FIXED is not supported with InnoDB tables. Moreover, the value of +`innodb_strict_mode `_ would define if this would be reported as a warning or as an error. + +Since MySQL version 5.7.9, the default value for `innodb_strict_mode` is `ON` and thus would generate +an error when such a CREATE TABLE or ALTER TABLE statement is encountered. + +There are two ways of preventing such errors while importing: + +* Change the value of `innodb_strict_mode` to `OFF` before starting the import and turn it `ON` after + the import is successfully completed. +* This can be achieved in two ways: + + * Go to 'Variables' page and edit the value of `innodb_strict_mode` + * Run the query : `SET GLOBAL `innodb_strict_mode` = '[value]'` + +After the import is done, it is suggested that the value of `innodb_strict_mode` should be reset to the +original value. + +.. _faqproject: + +phpMyAdmin project +++++++++++++++++++ + +.. _faq7_1: + +7.1 I have found a bug. How do I inform developers? +--------------------------------------------------- + +Our issues tracker is located at . +For security issues, please refer to the instructions at to email +the developers directly. + +.. _faq7_2: + +7.2 I want to translate the messages to a new language or upgrade an existing language, where do I start? +--------------------------------------------------------------------------------------------------------- + +Translations are very welcome and all you need to have are the +language skills. The easiest way is to use our `online translation +service `_. You can check +out all the possibilities to translate in the `translate section on +our website `_. + +.. _faq7_3: + +7.3 I would like to help out with the development of phpMyAdmin. How should I proceed? +-------------------------------------------------------------------------------------- + +We welcome every contribution to the development of phpMyAdmin. You +can check out all the possibilities to contribute in the `contribute +section on our website +`_. + +.. seealso:: :ref:`developers` + +.. _faqsecurity: + +Security +++++++++ + +.. _faq8_1: + +8.1 Where can I get information about the security alerts issued for phpMyAdmin? +-------------------------------------------------------------------------------- + +Please refer to . + +.. _faq8_2: + +8.2 How can I protect phpMyAdmin against brute force attacks? +------------------------------------------------------------- + +If you use Apache web server, phpMyAdmin exports information about +authentication to the Apache environment and it can be used in Apache +logs. Currently there are two variables available: + +``userID`` + User name of currently active user (he does not have to be logged in). +``userStatus`` + Status of currently active user, one of ``ok`` (user is logged in), + ``mysql-denied`` (MySQL denied user login), ``allow-denied`` (user denied + by allow/deny rules), ``root-denied`` (root is denied in configuration), + ``empty-denied`` (empty password is denied). + +``LogFormat`` directive for Apache can look like following: + +.. code-block:: apache + + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{userID}n %{userStatus}n" pma_combined + +You can then use any log analyzing tools to detect possible break-in +attempts. + +.. _faq8_3: + +8.3 Why are there path disclosures when directly loading certain files? +----------------------------------------------------------------------- + +This is a server configuration problem. Never enable ``display_errors`` on a production site. + +.. _faq8_4: + +8.4 CSV files exported from phpMyAdmin could allow a formula injection attack. +------------------------------------------------------------------------------ + +It is possible to generate a :term:`CSV` file that, when imported to a spreadsheet program such as Microsoft Excel, +could potentially allow the execution of arbitrary commands. + +The CSV files generated by phpMyAdmin could potentially contain text that would be interpreted by a spreadsheet program as +a formula, but we do not believe escaping those fields is the proper behavior. There is no means to properly escape and +differentiate between a desired text output and a formula that should be escaped, and CSV is a text format where function +definitions should not be interpreted anyway. We have discussed this at length and feel it is the responsibility of the +spreadsheet program to properly parse and sanitize such data on input instead. + +Google also has a `similar view `_. + +.. _faqsynchronization: + +Synchronization ++++++++++++++++ + +.. _faq9_1: + +9.1 (withdrawn). +---------------- + +.. _faq9_2: + +9.2 (withdrawn). +---------------- diff --git a/phpMyAdmin/doc/html/_sources/glossary.rst.txt b/phpMyAdmin/doc/html/_sources/glossary.rst.txt new file mode 100755 index 0000000..08a1509 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/glossary.rst.txt @@ -0,0 +1,426 @@ +.. _glossary: + +Glossary +======== + +From Wikipedia, the free encyclopedia + +.. glossary:: + + .htaccess + the default name of Apache's directory-level configuration file. + + .. seealso:: + + ACL + Access Control List + + Blowfish + a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier. + + .. seealso:: + + Browser + a software application that enables a user to display and interact with text, images, and other information typically located on a web page at a website on the World Wide Web. + + .. seealso:: + + bzip2 + a free software/open-source data compression algorithm and program developed by Julian Seward. + + .. seealso:: + + CGI + Common Gateway Interface is an important World Wide Web technology that + enables a client web browser to request data from a program executed on + the Web server. + + .. seealso:: + + Changelog + a log or record of changes made to a project. + + .. seealso:: + + Client + a computer system that accesses a (remote) service on another computer by some kind of network. + + .. seealso:: + + column + a set of data values of a particularly simple type, one for each row of the table. + + .. seealso:: + + Cookie + a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server. + + .. seealso:: + + CSV + Comma-separated values + + .. seealso:: + + DB + look at :term:`database` + + database + an organized collection of data. + + .. seealso:: + + Engine + look at :term:`storage engines` + + extension + a PHP module that extends PHP with additional functionality. + + .. seealso:: + + FAQ + Frequently Asked Questions is a list of commonly asked question and there + answers. + + .. seealso:: + + Field + one part of divided data/columns. + + .. seealso:: + + foreign key + a column or group of columns in a database row that points to a key column + or group of columns forming a key of another database row in some + (usually different) table. + + .. seealso:: + + GD + Graphics Library by Thomas Boutell and others for dynamically manipulating images. + + .. seealso:: + + GD2 + look at :term:`gd` + + gzip + gzip is short for GNU zip, a GNU free software file compression program. + + .. seealso:: + + host + any machine connected to a computer network, a node that has a hostname. + + .. seealso:: + + hostname + the unique name by which a network-attached device is known on a network. + + .. seealso:: + + HTTP + HyperText Transfer Protocol is the primary method used to transfer or + convey information on the World Wide Web. + + .. seealso:: + + https + a :term:`HTTP`-connection with additional security measures. + + .. seealso:: + + IEC + International Electrotechnical Commission + + IIS + Internet Information Services is a set of Internet-based services for + servers using Microsoft Windows. + + .. seealso:: + + Index + a feature that allows quick access to the rows in a table. + + .. seealso:: + + IP + Internet Protocol is a data-oriented protocol used by source and + destination hosts for communicating data across a packet-switched + internetwork. + + .. seealso:: + + IP Address + a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard. + + .. seealso:: + + IPv6 + IPv6 (Internet Protocol version 6) is the latest revision of the + Internet Protocol (:term:`IP`), designed to deal with the + long-anticipated problem of its predecessor IPv4 running out of addresses. + + .. seealso:: + + ISAPI + Internet Server Application Programming Interface is the API of Internet Information Services (IIS). + + .. seealso:: + + ISP + An Internet service provider is a business or organization that offers users + access to the Internet and related services. + + .. seealso:: + + ISO + International Standards Organisation + + JPEG + a most commonly used standard method of lossy compression for photographic images. + + .. seealso:: + + JPG + look at :term:`jpeg` + + Key + look at :term:`index` + + LATEX + a document preparation system for the TEX typesetting program. + + .. seealso:: + + Mac + Apple Macintosh is a line of personal computers is designed, developed, manufactured, and marketed by Apple Computer. + + .. seealso:: + + Mac OS X + the operating system which is included with all currently shipping Apple Macintosh computers in the consumer and professional markets. + + .. seealso:: + + mbstring + The PHP `mbstring` functions provide support for languages represented by multi-byte character sets, most notably UTF-8. + + If you have troubles installing this extension, please follow :ref:`faqmysql`, it provides useful hints. + + .. seealso:: + + MCrypt + a cryptographic library. + + .. seealso:: + + mcrypt + the MCrypt PHP extension. + + .. seealso:: + + MIME + Multipurpose Internet Mail Extensions is + an Internet Standard for the format of e-mail. + + .. seealso:: + + module + some sort of extension for the Apache Webserver. + + .. seealso:: + + mod_proxy_fcgi + an Apache module implementing a Fast CGI interface; PHP can be run as a CGI module, FastCGI, or + directly as an Apache module. + + MySQL + a multithreaded, multi-user, SQL (Structured Query Language) Database Management System (DBMS). + + .. seealso:: + + mysqli + the improved MySQL client PHP extension. + + .. seealso:: + + mysql + the MySQL client PHP extension. + + .. seealso:: + + OpenDocument + an open standard for office documents. + + .. seealso:: + + OS X + look at :term:`Mac OS X`. + + .. seealso:: + + PDF + Portable Document Format is a file format developed by Adobe Systems for + representing two-dimensional documents in a device-independent and + resolution-independent format. + + .. seealso:: + + PEAR + the PHP Extension and Application Repository. + + .. seealso:: + + PCRE + Perl Compatible Regular Expressions is the perl-compatible regular + expression functions for PHP + + .. seealso:: + + PHP + short for "PHP: Hypertext Preprocessor", is an open-source, reflective + programming language used mainly for developing server-side applications + and dynamic web content, and more recently, a broader range of software + applications. + + .. seealso:: + + port + a connection through which data is sent and received. + + .. seealso:: + + primary key + A primary key is an index over one or more fields in a table with + unique values for every single row in this table. Every table should have + a primary key for easier accessing/identifying data in this table. There + can only be one primary key per table and it is named always **PRIMARY**. + In fact, a primary key is just an :term:`unique key` with the name + **PRIMARY**. If no primary key is defined MySQL will use first *unique + key* as primary key if there is one. + + You can create the primary key when creating the table (in phpMyAdmin + just check the primary key radio buttons for each field you wish to be + part of the primary key). + + You can also add a primary key to an existing table with `ALTER` `TABLE` + or `CREATE` `INDEX` (in phpMyAdmin you can just click on 'add index' on + the table structure page below the listed fields). + + RFC + Request for Comments (RFC) documents are a series of memoranda + encompassing new research, innovations, and methodologies applicable to + Internet technologies. + + .. seealso:: + + RFC 1952 + GZIP file format specification version 4.3 + + .. seealso:: :rfc:`1952` + + Row (record, tuple) + represents a single, implicitly structured data item in a table. + + .. seealso:: + + Server + a computer system that provides services to other computing systems over a network. + + .. seealso:: + + Storage Engines + MySQL can use several different formats for storing data on disk, these + are called storage engines or table types. phpMyAdmin allows a user to + change their storage engine for a particular table through the operations + tab. + + Common table types are InnoDB and MyISAM, though many others exist and + may be desirable in some situations. + + .. seealso:: + + socket + a form of inter-process communication. + + .. seealso:: + + SSL + Secure Sockets Layer is a cryptographic protocol which provides secure + communication on the Internet. + + .. seealso:: + + Stored procedure + a subroutine available to applications accessing a relational database system + + .. seealso:: + + SQL + Structured Query Language + + .. seealso:: + + table + a set of data elements (cells) that is organized, defined and stored as + horizontal rows and vertical columns where each item can be uniquely + identified by a label or key or by it's position in relation to other + items. + + .. seealso:: + + tar + a type of archive file format: the Tape ARchive format. + + .. seealso:: + + TCP + Transmission Control Protocol is one of the core protocols of the + Internet protocol suite. + + .. seealso:: + + TCPDF + PHP library to generate PDF files. + + .. seealso:: + + trigger + a procedural code that is automatically executed in response to certain events on a particular table or view in a database + + .. seealso:: + + unique key + A unique key is an index over one or more fields in a table which has a + unique value for each row. The first unique key will be treated as + :term:`primary key` if there is no *primary key* defined. + + URL + Uniform Resource Locator is a sequence of characters, conforming to a + standardized format, that is used for referring to resources, such as + documents and images on the Internet, by their location. + + .. seealso:: + + Webserver + A computer (program) that is responsible for accepting HTTP requests from clients and serving them Web pages. + + .. seealso:: + + XML + Extensible Markup Language is a W3C-recommended general-purpose markup + language for creating special-purpose markup languages, capable of + describing many different kinds of data. + + .. seealso:: + + ZIP + a popular data compression and archival format. + + .. seealso:: + + zlib + an open-source, cross-platform data compression library by Jean-loup Gailly and Mark Adler. + + .. seealso:: diff --git a/phpMyAdmin/doc/html/_sources/import_export.rst.txt b/phpMyAdmin/doc/html/_sources/import_export.rst.txt new file mode 100755 index 0000000..31f2fa9 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/import_export.rst.txt @@ -0,0 +1,350 @@ +Import and export +================= + +Import +++++++ + +To import data, go to the "Import" tab in phpMyAdmin. To import data into a +specific database or table, open the database or table before going to the +"Import" tab. + +In addition to the standard Import and Export tab, you can also import an SQL +file directly by dragging and dropping it from your local file manager to the +phpMyAdmin interface in your web browser. + +If you are having troubles importing big files, please consult :ref:`faq1_16`. + +You can import using following methods: + +Form based upload + + Can be used with any supported format, also (b|g)zipped files, e.g., mydump.sql.gz . + +Form based SQL Query + + Can be used with valid SQL dumps. + +Using upload directory + + You can specify an upload directory on your web server where phpMyAdmin is installed, after uploading your file into this directory you can select this file in the import dialog of phpMyAdmin, see :config:option:`$cfg['UploadDir']`. + +phpMyAdmin can import from several various commonly used formats. + +CSV +--- + +Comma separated values format which is often used by spreadsheets or various other programs for export/import. + +.. note:: + + When importing data into a table from a CSV file where the table has an + 'auto_increment' field, make the 'auto_increment' value for each record in + the CSV field to be '0' (zero). This allows the 'auto_increment' field to + populate correctly. + +It is now possible to import a CSV file at the server or database level. +Instead of having to create a table to import the CSV file into, a best-fit +structure will be determined for you and the data imported into it, instead. +All other features, requirements, and limitations are as before. + +CSV using LOAD DATA +------------------- + +Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one. + +ESRI Shape File +--------------- + +The ESRI shapefile or simply a shapefile is a popular geospatial vector data +format for geographic information systems software. It is developed and +regulated by Esri as a (mostly) open specification for data interoperability +among Esri and other software products. + +MediaWiki +--------- + +MediaWiki files, which can be exported by phpMyAdmin (version 4.0 or later), +can now also be imported. This is the format used by Wikipedia to display +tables. + +Open Document Spreadsheet (ODS) +------------------------------- + +OpenDocument workbooks containing one or more spreadsheets can now be directly imported. + +When importing an ODS speadsheet, the spreadsheet must be named in a specific way in order to make the +import as simple as possible. + +Table name +~~~~~~~~~~ + +During import, phpMyAdmin uses the sheet name as the table name; you should rename the +sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create, +though this is less of a concern since you could quickly rename the new table from the Operations tab). + +Column names +~~~~~~~~~~~~ + +You should also make the first row of your spreadsheet a header with the names of the columns (this can be +accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the +checkbox for "The first line of the file contains the table column names;" this way your newly imported +data will go to the proper columns. + +.. note:: + + Formulas and calculations will NOT be evaluated, rather, their value from + the most recent save will be loaded. Please ensure that all values in the + spreadsheet are as needed before importing it. + +SQL +--- + +SQL can be used to make any manipulation on data, it is also useful for restoring backed up data. + +XML +--- + +XML files exported by phpMyAdmin (version 3.3.0 or later) can now be imported. +Structures (databases, tables, views, triggers, etc.) and/or data will be +created depending on the contents of the file. + +The supported xml schemas are not yet documented in this wiki. + +Export +++++++ + +phpMyAdmin can export into text files (even compressed) on your local disk (or +a special the webserver :config:option:`$cfg['SaveDir']` folder) in various +commonly used formats: + +CodeGen +------- + +`NHibernate `_ file format. Planned +versions: Java, Hibernate, PHP PDO, JSON, etc. So the preliminary name is +codegen. + +CSV +--- + +Comma separated values format which is often used by spreadsheets or various +other programs for export/import. + +CSV for Microsoft Excel +----------------------- + +This is just preconfigured version of CSV export which can be imported into +most English versions of Microsoft Excel. Some localised versions (like +"Danish") are expecting ";" instead of "," as field separator. + +Microsoft Word 2000 +------------------- + +If you're using Microsoft Word 2000 or newer (or compatible such as +OpenOffice.org), you can use this export. + +JSON +---- + +JSON (JavaScript Object Notation) is a lightweight data-interchange format. It +is easy for humans to read and write and it is easy for machines to parse and +generate. + +.. versionchanged:: 4.7.0 + + The generated JSON structure has been changed in phpMyAdmin 4.7.0 to + produce valid JSON data. + +The generated JSON is list of objects with following attributes: + +.. js:data:: type + + Type of given object, can be one of: + + ``header`` + Export header containing comment and phpMyAdmin version. + ``database`` + Start of a database marker, containing name of database. + ``table`` + Table data export. + +.. js:data:: version + + Used in ``header`` :js:data:`type` and indicates phpMyAdmin version. + +.. js:data:: comment + + Optional textual comment. + +.. js:data:: name + + Object name - either table or database based on :js:data:`type`. + +.. js:data:: database + + Database name for ``table`` :js:data:`type`. + +.. js:data:: data + + Table content for ``table`` :js:data:`type`. + +Sample output: + +.. code-block:: json + + [ + { + "comment": "Export to JSON plugin for PHPMyAdmin", + "type": "header", + "version": "4.7.0-dev" + }, + { + "name": "cars", + "type": "database" + }, + { + "data": [ + { + "car_id": "1", + "description": "Green Chrysler 300", + "make_id": "5", + "mileage": "113688", + "price": "13545.00", + "transmission": "automatic", + "yearmade": "2007" + } + ], + "database": "cars", + "name": "cars", + "type": "table" + }, + { + "data": [ + { + "make": "Chrysler", + "make_id": "5" + } + ], + "database": "cars", + "name": "makes", + "type": "table" + } + ] + +LaTeX +----- + +If you want to embed table data or structure in LaTeX, this is right choice for you. + +LaTeX is a typesetting system that is very suitable for producing scientific +and mathematical documents of high typographical quality. It is also suitable +for producing all sorts of other documents, from simple letters to complete +books. LaTeX uses TeX as its formatting engine. Learn more about TeX and +LaTeX on `the Comprehensive TeX Archive Network `_ +also see the `short description od TeX `_. + +The output needs to be embedded into a LaTeX document before it can be +rendered, for example in following document: + +.. code-block:: latex + + \documentclass{article} + \title{phpMyAdmin SQL output} + \author{} + \usepackage{longtable,lscape} + \date{} + \setlength{\parindent}{0pt} + \usepackage[left=2cm,top=2cm,right=2cm,nohead,nofoot]{geometry} + \pdfpagewidth 210mm + \pdfpageheight 297mm + \begin{document} + \maketitle + + % insert phpMyAdmin LaTeX Dump here + + \end{document} + +MediaWiki +--------- + +Both tables and databases can be exported in the MediaWiki format, which is +used by Wikipedia to display tables. It can export structure, data or both, +including table names or headers. + +OpenDocument Spreadsheet +------------------------ + +Open standard for spreadsheet data, which is being widely adopted. Many recent +spreadsheet programs, such as LibreOffice, OpenOffice, Microsoft Office or +Google Docs can handle this format. + +OpenDocument Text +----------------- + +New standard for text data which is being widely addopted. Most recent word +processors (such as LibreOffice, OpenOffice, Microsoft Word, AbiWord or KWord) +can handle this. + +PDF +--- + +For presentation purposes, non editable PDF might be best choice for you. + +PHP Array +--------- + +You can generate a php file which will declare a multidimensional array with +the contents of the selected table or database. + +SQL +--- + +Export in SQL can be used to restore your database, thus it is useful for +backing up. + +The option 'Maximal length of created query' seems to be undocumented. But +experiments has shown that it splits large extended INSERTS so each one is no +bigger than the given number of bytes (or characters?). Thus when importing the +file, for large tables you avoid the error "Got a packet bigger than +'max_allowed_packet' bytes". + +.. seealso:: + + https://dev.mysql.com/doc/refman/5.7/en/packet-too-large.html + +Data Options +~~~~~~~~~~~~ + +**Complete inserts** adds the column names to the SQL dump. This parameter +improves the readability and reliability of the dump. Adding the column names +increases the size of the dump, but when combined with Extended inserts it's +negligible. + +**Extended inserts** combines multiple rows of data into a single INSERT query. +This will significantly decrease filesize for large SQL dumps, increases the +INSERT speed when imported, and is generally recommended. + +.. seealso:: + + http://www.scriptalicious.com/blog/2009/04/complete-inserts-or-extended-inserts-in-phpmyadmin/ + +Texy! +----- + +`Texy! `_ markup format. You can see example on `Texy! demo +`_. + +XML +--- + +Easily parsable export for use with custom scripts. + +.. versionchanged:: 3.3.0 + + The XML schema used has changed as of version 3.3.0 + +YAML +---- + +YAML is a data serialization format which is both human readable and +computationally powerful ( ). diff --git a/phpMyAdmin/doc/html/_sources/index.rst.txt b/phpMyAdmin/doc/html/_sources/index.rst.txt new file mode 100755 index 0000000..f337241 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/index.rst.txt @@ -0,0 +1,32 @@ +.. phpMyAdmin documentation master file, created by + sphinx-quickstart on Wed Sep 26 14:04:48 2012. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to phpMyAdmin's documentation! +====================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + intro + require + setup + config + user + faq + developers + security + vendors + copyright + credits + glossary + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`search` +* :ref:`glossary` diff --git a/phpMyAdmin/doc/html/_sources/intro.rst.txt b/phpMyAdmin/doc/html/_sources/intro.rst.txt new file mode 100755 index 0000000..d81b00e --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/intro.rst.txt @@ -0,0 +1,79 @@ +.. _intro: + +Introduction +============ + +phpMyAdmin is a free software tool written in PHP that is intended to handle the +administration of a MySQL or MariaDB database server. You can use phpMyAdmin to +perform most administration tasks, including creating a database, running queries, +and adding user accounts. + +Supported features +------------------ + +Currently phpMyAdmin can: + +* create, browse, edit, and drop databases, tables, views, columns, and indexes +* display multiple results sets through stored procedures or queries +* create, copy, drop, rename and alter databases, tables, columns and + indexes +* maintenance server, databases and tables, with proposals on server + configuration +* execute, edit and bookmark any :term:`SQL`-statement, even batch-queries +* load text files into tables +* create [#f1]_ and read dumps of tables +* export [#f1]_ data to various formats: :term:`CSV`, :term:`XML`, :term:`PDF`, + :term:`ISO`/:term:`IEC` 26300 - :term:`OpenDocument` Text and Spreadsheet, Microsoft + Word 2000, and LATEX formats +* import data and :term:`MySQL` structures from :term:`OpenDocument` spreadsheets, as + well as :term:`XML`, :term:`CSV`, and :term:`SQL` files +* administer multiple servers +* add, edit, and remove MySQL user accounts and privileges +* check referential integrity in MyISAM tables +* using Query-by-example (QBE), create complex queries automatically + connecting required tables +* create :term:`PDF` graphics of your + database layout +* search globally in a database or a subset of it +* transform stored data into any format using a set of predefined + functions, like displaying BLOB-data as image or download-link +* track changes on databases, tables and views +* support InnoDB tables and foreign keys +* support mysqli, the improved MySQL extension see :ref:`faq1_17` +* create, edit, call, export and drop stored procedures and functions +* create, edit, export and drop events and triggers +* communicate in `80 different languages + `_ + +Shortcut keys +------------- + +Currently phpMyAdmin supports following shortcuts: + +* k - Toggle console +* h - Go to home page +* s - Open settings +* d + s - Go to database structure (Provided you are in database related page) +* d + f - Search database (Provided you are in database related page) +* t + s - Go to table structure (Provided you are in table related page) +* t + f - Search table (Provided you are in table related page) +* backspace - Takes you to older page. + +A word about users +------------------ + +Many people have difficulty understanding the concept of user +management with regards to phpMyAdmin. When a user logs in to +phpMyAdmin, that username and password are passed directly to MySQL. +phpMyAdmin does no account management on its own (other than allowing +one to manipulate the MySQL user account information); all users must +be valid MySQL users. + +.. rubric:: Footnotes + +.. [#f1] + + phpMyAdmin can compress (:term:`Zip`, :term:`GZip` or :term:`RFC 1952` + formats) dumps and :term:`CSV` exports if you use PHP with + :term:`Zlib` support (``--with-zlib``). + Proper support may also need changes in :file:`php.ini`. diff --git a/phpMyAdmin/doc/html/_sources/other.rst.txt b/phpMyAdmin/doc/html/_sources/other.rst.txt new file mode 100755 index 0000000..98d1dca --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/other.rst.txt @@ -0,0 +1,32 @@ +Other sources of information +============================ + +Printed Book +------------ + +The definitive guide to using phpMyAdmin is the book Mastering phpMyAdmin for +Effective MySQL Management by Marc Delisle. You can get information on that +book and other officially endorsed `books at the phpMyAdmin site`_. + +.. _books at the phpMyAdmin site: https://www.phpmyadmin.net/docs/ + +Tutorials +--------- + +Third party tutorials and articles which you might find interesting: + +膶esky (Czech) ++++++++++++++ + +- `Seri谩l o phpMyAdminovi `_ + +English ++++++++ + +- `Having fun with phpMyAdmin's MIME-transformations & PDF-features `_ +- `Learning SQL Using phpMyAdmin (old tutorial) `_ + +袪褍褋褋泻懈泄 (Russian) ++++++++++++++++++ + +* `Russian server about phpMyAdmin `_ diff --git a/phpMyAdmin/doc/html/_sources/privileges.rst.txt b/phpMyAdmin/doc/html/_sources/privileges.rst.txt new file mode 100755 index 0000000..f3b1779 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/privileges.rst.txt @@ -0,0 +1,74 @@ +User management +=============== + +User management is the process of controlling which users are allowed to +connect to the MySQL server and what permissions they have on each database. +phpMyAdmin does not handle user management, rather it passes the username and +password on to MySQL, which then determines whether a user is permitted to +perform a particular action. Within phpMyAdmin, administrators have full +control over creating users, viewing and editing privileges for existing users, +and removing users. + +Within phpMyAdmin, user management is controlled via the :guilabel:`Users` link +from the main page. Users can be created, edited, and removed. + +Creating a new user +------------------- + +To create a new user, click the :guilabel:`Add a new user` link near the bottom +of the :guilabel:`Users` page (you must be a "superuser", e.g., user "root"). +Use the textboxes and drop-downs to configure the user to your particular +needs. You can then select whether to create a database for that user and grant +specific global privileges. Once you've created the user (by clicking Go), you +can define that user's permissions on a specific database (don't grant global +privileges in that case). In general, users do not need any global privileges +(other than USAGE), only permissions for their specific database. + +Editing an existing user +------------------------ + +To edit an existing user, simply click the pencil icon to the right of that +user in the :guilabel:`Users` page. You can then edit their global- and +database-specific privileges, change their password, or even copy those +privileges to a new user. + +Deleting a user +--------------- + +From the :guilabel:`Users` page, check the checkbox for the user you wish to +remove, select whether or not to also remove any databases of the same name (if +they exist), and click Go. + +Assigning privileges to user for a specific database +---------------------------------------------------- + +Users are assigned to databases by editing the user record (from the +:guilabel:`User accounts` link on the home page). +If you are creating a user specifically for a given table +you will have to create the user first (with no global privileges) and then go +back and edit that user to add the table and privileges for the individual +table. + +.. _configurablemenus: + +Configurable menus and user groups +---------------------------------- + +By enabling :config:option:`$cfg['Servers'][$i]['usergroups']` and +:config:option:`$cfg['Servers'][$i]['usergroups']` you can customize what users +will see in the phpMyAdmin navigation. + +.. warning:: + + This feature only limits what a user sees, he is still able to use all the + functions. So this can not be considered as a security limitation. Should + you want to limit what users can do, use MySQL privileges to achieve that. + +With this feature enabled, the :guilabel:`User accounts` management interface gains +a second tab for managing :guilabel:`User groups`, where you can define what each +group will view (see image below) and you can then assign each user to one of +these groups. Users will be presented with a simplified user interface, which might be +useful for inexperienced users who could be overwhelmed by all the features +phpMyAdmin provides. + +.. image:: images/usergroups.png diff --git a/phpMyAdmin/doc/html/_sources/relations.rst.txt b/phpMyAdmin/doc/html/_sources/relations.rst.txt new file mode 100755 index 0000000..96643de --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/relations.rst.txt @@ -0,0 +1,84 @@ +.. _relations: + +Relations +========= + +phpMyAdmin allows relationships (similar to foreign keys) using MySQL-native +(InnoDB) methods when available and falling back on special phpMyAdmin-only +features when needed. There are two ways of editing these relations, with the +*relation view* and the drag-and-drop *designer* -- both of which are explained +on this page. + +.. note:: + + You need to have configured the :ref:`linked-tables` for using phpMyAdmin + only relations. + +Technical info +-------------- + +Currently the only MySQL table type that natively supports relationships is +InnoDB. When using an InnoDB table, phpMyAdmin will create real InnoDB +relations which will be enforced by MySQL no matter which application accesses +the database. In the case of any other table type, phpMyAdmin enforces the +relations internally and those relations are not applied to any other +application. + +Relation view +------------- + +In order to get it working, you first have to properly create the +[[pmadb|pmadb]]. Once that is setup, select a table's "Structure" page. Below +the table definition, a link called "Relation view" is shown. If you click that +link, a page will be shown that offers you to create a link to another table +for any (most) fields. Only PRIMARY KEYS are shown there, so if the field you +are referring to is not shown, you most likely are doing something wrong. The +drop-down at the bottom is the field which will be used as the name for a +record. + +Relation view example ++++++++++++++++++++++ + +.. image:: images/pma-relations-relation-view-link.png + +.. image:: images/pma-relations-relation-link.png + +Let's say you have categories and links and one category can contain several links. Your table structure would be something like this: + +- `category.category_id` (must be unique) +- `category.name` +- `link.link_id` +- `link.category_id` +- `link.uri`. + +Open the relation view (below the table structure) page for the `link` table and for `category_id` field, you select `category.category_id` as master record. + +If you now browse the link table, the `category_id` field will be a clickable hyperlink to the proper category record. But all you see is just the `category_id`, not the name of the category. + +.. image:: images/pma-relations-relation-name.png + +To fix this, open the relation view of the `category` table and in the drop down at the bottom, select "name". If you now browse the link table again and hover the mouse over the `category_id` hyperlink, the value from the related category will be shown as tooltip. + +.. image:: images/pma-relations-links.png + +Designer +-------- + +The Designer feature is a graphical way of creating, editing, and displaying +phpMyAdmin relations. These relations are compatible with those created in +phpMyAdmin's relation view. + +To use this feature, you need a properly configured :ref:`linked-tables` and +must have the :config:option:`$cfg['Servers'][$i]['table_coords']` configured. + +To use the designer, select a database's structure page, then look for the +:guilabel:`Designer` tab. + +To export the view into PDF, you have to create PDF pages first. The Designer +creates the layout, how the tables shall be displayed. To finally export the +view, you have to create this with a PDF page and select your layout, which you +have created with the designer. + +.. seealso:: + + :ref:`faqpdf` diff --git a/phpMyAdmin/doc/html/_sources/require.rst.txt b/phpMyAdmin/doc/html/_sources/require.rst.txt new file mode 100755 index 0000000..6a2c9eb --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/require.rst.txt @@ -0,0 +1,60 @@ +.. _require: + +Requirements +============ + +Web server +---------- + +Since phpMyAdmin's interface is based entirely in your browser, you'll need a +web server (such as Apache, nginx, :term:`IIS`) to install phpMyAdmin's files into. + +PHP +--- + +* You need PHP 5.5.0 or newer, with ``session`` support, the Standard PHP Library + (SPL) extension, hash, ctype, and JSON support. + +* The ``mbstring`` extension (see :term:`mbstring`) is strongly recommended + for performance reasons. + +* To support uploading of ZIP files, you need the PHP ``zip`` extension. + +* You need GD2 support in PHP to display inline thumbnails of JPEGs + ("image/jpeg: inline") with their original aspect ratio. + +* When using the cookie authentication (the default), the `openssl + `_ extension is strongly suggested. + +* To support upload progress bars, see :ref:`faq2_9`. + +* To support XML and Open Document Spreadsheet importing, you need the + `libxml `_ extension. + +* To support reCAPTCHA on the login page, you need the + `openssl `_ extension. + +* To support displaying phpMyAdmin's latest version, you need to enable + ``allow_url_open`` in your :file:`php.ini` or to have the + `curl `_ extension. + +.. seealso:: :ref:`faq1_31`, :ref:`authentication_modes` + +Database +-------- + +phpMyAdmin supports MySQL-compatible databases. + +* MySQL 5.5 or newer +* MariaDB 5.5 or newer + +.. seealso:: :ref:`faq1_17` + +Web browser +----------- + +To access phpMyAdmin you need a web browser with cookies and JavaScript +enabled. + +You need browser which is supported by jQuery 2.0, see +. diff --git a/phpMyAdmin/doc/html/_sources/security.rst.txt b/phpMyAdmin/doc/html/_sources/security.rst.txt new file mode 100755 index 0000000..d6d93ec --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/security.rst.txt @@ -0,0 +1,113 @@ +Security policy +=============== + +The phpMyAdmin developer team is putting lot of effort to make phpMyAdmin as +secure as possible. But still web application like phpMyAdmin can be vulnerable +to a number of attacks and new ways to exploit are still being explored. + +For every reported vulnerability we issue a phpMyAdmin Security Announcement +(PMASA) and it get's assigne CVE ID as well. We might group similar +vulnerabilities to one PMASA (eg. multiple XSS vulnerabilities can be announced +under one PMASA). + +If you think you've found a vulnerability, please see :ref:`reporting-security`. + +Typical vulnerabilities +----------------------- + +In this secion, we will describe typical vulnerabilities, which can appear in +our code base. This list is by no means complete, it is intended to show +typical attack surface. + +Cross-site scripting (XSS) +++++++++++++++++++++++++++ + +When phpMyAdmin shows a piece of user data, e.g. something inside a user's +database, all html special chars have to be escaped. When this escaping is +missing somewhere a malicious user might fill a database with specially crafted +content to trick an other user of that database into executing something. This +could for example be a piece of JavaScript code that would do any number of +nasty things. + +phpMyAdmin tries to escape all userdata before it is rendered into html for the +browser. + +.. seealso:: + + `Cross-site scripting on Wikipedia `_ + +Cross-site request forgery (CSRF) ++++++++++++++++++++++++++++++++++ + +An attacker would trick a phpMyAdmin user into clicking on a link to provoke +some action in phpMyAdmin. This link could either be sent via email or some +random website. If successful this the attacker would be able to perform some +action with the users privileges. + +To mitigate this phpMyAdmin requires a token to be sent on sensitive requests. +The idea is that an attacker does not poses the currently valid token to +include in the presented link. + +The token is regenerated for every login, so it's generally valid only for +limited time, what makes it harder for attacker to obtain valid one. + +.. seealso:: + + `Cross-site request forgery on Wikipedia `_ + +SQL injection ++++++++++++++ + +As the whole purpose of phpMyAdmin is to preform sql queries, this is not our +first concern. SQL injection is sensitive to us though when it concerns the +mysql control connection. This controlconnection can have additional privileges +which the logged in user does not poses. E.g. access the :ref:`linked-tables`. + +User data that is included in (administrative) queries should always be run +through DatabaseInterface::escapeSring(). + +.. seealso:: + + `SQL injection on Wikipedia `_ + +Brute force attack +++++++++++++++++++ + +phpMyAdmin on its own does not rate limit authentication attempts in any way. +This is caused by need to work in stateless environment, where there is no way +to protect against such kind of things. + +To mitigate this, you can use Captcha or utilize external tools such as +fail2ban, this is more details described in :ref:`securing`. + +.. seealso:: + + `Brute force attack on Wikipedia `_ + +.. _reporting-security: + +Reporting security issues +------------------------- + +Should you find a security issue in the phpMyAdmin programming code, please +contact the `phpMyAdmin security team `_ in +advance before publishing it. This way we can prepare a fix and release the fix together with your +announcement. You will be also given credit in our security announcement. +You can optionally encrypt your report with PGP key ID +``DA68AB39218AB947`` with following fingerprint: + +.. code-block:: console + + pub 4096R/DA68AB39218AB947 2016-08-02 + Key fingerprint = 5BAD 38CF B980 50B9 4BD7 FB5B DA68 AB39 218A B947 + uid phpMyAdmin Security Team <security@phpmyadmin.net> + sub 4096R/5E4176FB497A31F7 2016-08-02 + +The key can be either obtained from the keyserver or is available in +`phpMyAdmin keyring `_ +available on our download server or using `Keybase `_. + +Should you have suggestion on improving phpMyAdmin to make it more secure, please +report that to our `issue tracker `_. +Existing improvement suggestions can be found by +`hardening label `_. diff --git a/phpMyAdmin/doc/html/_sources/settings.rst.txt b/phpMyAdmin/doc/html/_sources/settings.rst.txt new file mode 100755 index 0000000..be36b80 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/settings.rst.txt @@ -0,0 +1,21 @@ +Configuring phpMyAdmin +---------------------- + +There are many configuration settings that can be used to customize the +interface. Those settings are described in +:ref:`config`. There are several layers of the configuration. + +The global settings can be configured in :file:`config.inc.php` as described in +:ref:`config`. This is only way to configure connections to databases and other +system wide settings. + +On top of this there are user settings which can be persistently stored in +:ref:`linked-tables`, possibly automatically configured through +:ref:`zeroconf`. If the :ref:`linked-tables` are not configured, the settings +are temporarily stored in the session data; these are valid only until you +logout. + +You can also save the user configuration for further use, either download them +as a file or to the browser local storage. You can find both those options in +the :guilabel:`Settings` tab. The settings stored in browser local storage will +be automatically offered for loading upon your login to phpMyAdmin. diff --git a/phpMyAdmin/doc/html/_sources/setup.rst.txt b/phpMyAdmin/doc/html/_sources/setup.rst.txt new file mode 100755 index 0000000..5f16cd1 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/setup.rst.txt @@ -0,0 +1,1117 @@ +.. _setup: + +Installation +============ + +phpMyAdmin does not apply any special security methods to the MySQL +database server. It is still the system administrator's job to grant +permissions on the MySQL databases properly. phpMyAdmin's :guilabel:`Users` +page can be used for this. + +.. warning:: + + :term:`Mac` users should note that if you are on a version before + :term:`Mac OS X`, StuffIt unstuffs with :term:`Mac` formats. So you'll have + to resave as in BBEdit to Unix style ALL phpMyAdmin scripts before + uploading them to your server, as PHP seems not to like :term:`Mac`-style + end of lines character ("``\r``"). + +Linux distributions ++++++++++++++++++++ + +phpMyAdmin is included in most Linux distributions. It is recommended to use +distribution packages when possible - they usually provide integration to your +distribution and you will automatically get security updates from your distribution. + +.. _debian-package: + +Debian and Ubuntu +----------------- + +Debian's package repositories include a phpMyAdmin package, but be aware that +the configuration file is maintained in ``/etc/phpmyadmin`` and may differ in +some ways from the official phpMyAdmin documentation. Specifically, it does: + +* Configuration of a web server (works for Apache and lighttpd). +* Creating of :ref:`linked-tables` using dbconfig-common. +* Securing setup script, see :ref:`debian-setup`. + +.. seealso:: + + More information can be found in `README.Debian `_ + (it is installed as :file:`/usr/share/doc/phmyadmin/README.Debian` with the package). + +OpenSUSE +-------- + +OpenSUSE already comes with phpMyAdmin package, just install packages from +the `openSUSE Build Service `_. + +Gentoo +------ + +Gentoo ships the phpMyAdmin package, both in a near-stock configuration as well +as in a ``webapp-config`` configuration. Use ``emerge dev-db/phpmyadmin`` to +install. + +Mandriva +-------- + +Mandriva ships the phpMyAdmin package in their ``contrib`` branch and can be +installed via the usual Control Center. + +Fedora +------ + +Fedora ships the phpMyAdmin package, but be aware that the configuration file +is maintained in ``/etc/phpMyAdmin/`` and may differ in some ways from the +official phpMyAdmin documentation. + +Red Hat Enterprise Linux +------------------------ + +Red Hat Enterprise Linux itself and thus derivatives like CentOS don't +ship phpMyAdmin, but the Fedora-driven repository +`Extra Packages for Enterprise Linux (EPEL) `_ +is doing so, if it's +`enabled `_. +But be aware that the configuration file is maintained in +``/etc/phpMyAdmin/`` and may differ in some ways from the +official phpMyAdmin documentation. + +Installing on Windows ++++++++++++++++++++++ + +The easiest way to get phpMyAdmin on Windows is using third party products +which include phpMyAdmin together with a database and web server such as +`XAMPP `_. + +You can find more of such options at `Wikipedia `_. + +Installing from Git ++++++++++++++++++++ + +You can clone current phpMyAdmin source from +``https://github.com/phpmyadmin/phpmyadmin.git``: + +.. code-block:: sh + + git clone https://github.com/phpmyadmin/phpmyadmin.git + +Additionally you need to install dependencies using the `Composer tool`_: + +.. code-block:: sh + + composer update + +If you do not intend to develop, you can skip the installation of developer tools +by invoking: + +.. code-block:: sh + + composer update --no-dev + +.. _composer: + +Installing using Composer ++++++++++++++++++++++++++ + +You can install phpMyAdmin using the `Composer tool`_, since 4.7.0 the releases +are automatically mirrored to the default `Packagist`_ repository. + +.. note:: + + The content of the Composer repository is automatically generated + separately from the releases, so the content doesn't have to be + 100% same as when you download the tarball. There should be no + functional differences though. + +To install phpMyAdmin simply run: + +.. code-block:: sh + + composer create-project phpmyadmin/phpmyadmin + +Alternatively you can use our own composer repository, which contains +the release tarballs and is available at +: + +.. code-block:: sh + + composer create-project phpmyadmin/phpmyadmin --repository-url=https://www.phpmyadmin.net/packages.json --no-dev + +.. _docker: + +Installing using Docker ++++++++++++++++++++++++ + +phpMyAdmin comes with a `Docker image`_, which you can easily deploy. You can +download it using: + +.. code-block:: sh + + docker pull phpmyadmin/phpmyadmin + +The phpMyAdmin server will listen on port 80. It supports several ways of +configuring the link to the database server, either by Docker's link feature +by linking your database container to ``db`` for phpMyAdmin (by specifying +``--link your_db_host:db``) or by environment variables (in this case it's up +to you to set up networking in Docker to allow the phpMyAdmin container to access +the database container over the network). + +.. _docker-vars: + +Docker environment variables +---------------------------- + +You can configure several phpMyAdmin features using environment variables: + +.. envvar:: PMA_ARBITRARY + + Allows you to enter a database server hostname on login form. + + .. seealso:: :config:option:`$cfg['AllowArbitraryServer']` + +.. envvar:: PMA_HOST + + Hostname or IP address of the database server to use. + + .. seealso:: :config:option:`$cfg['Servers'][$i]['host']` + +.. envvar:: PMA_HOSTS + + Comma-separated hostnames or IP addresses of the database servers to use. + + .. note:: Used only if :envvar:`PMA_HOST` is empty. + +.. envvar:: PMA_VERBOSE + + Verbose name of the database server. + + .. seealso:: :config:option:`$cfg['Servers'][$i]['verbose']` + +.. envvar:: PMA_VERBOSES + + Comma-separated verbose name of the database servers. + + .. note:: Used only if :envvar:`PMA_VERBOSE` is empty. + +.. envvar:: PMA_USER + + User name to use for :ref:`auth_config`. + +.. envvar:: PMA_PASSWORD + + Password to use for :ref:`auth_config`. + +.. envvar:: PMA_PORT + + Port of the database server to use. + +.. envvar:: PMA_PORTS + + Comma-separated ports of the database server to use. + + .. note:: Used only if :envvar:`PMA_PORT` is empty. + +.. envvar:: PMA_ABSOLUTE_URI + + The fully-qualified path (``https://pma.example.net/``) where the reverse + proxy makes phpMyAdmin available. + + .. seealso:: :config:option:`$cfg['PmaAbsoluteUri']` + +By default, :ref:`cookie` is used, but if :envvar:`PMA_USER` and +:envvar:`PMA_PASSWORD` are set, it is switched to :ref:`auth_config`. + +.. note:: + + The credentials you need to log in are stored in the MySQL server, in case + of Docker image, there are various ways to set it (for example + :samp:`MYSQL_ROOT_PASSWORD` when starting the MySQL container). Please check + documentation for `MariaDB container `_ + or `MySQL container `_. + +.. _docker-custom: + +Customizing configuration +------------------------- + +Additionally configuration can be tweaked by :file:`/etc/phpmyadmin/config.user.inc.php`. If +this file exists, it will be loaded after configuration is generated from above +environment variables, so you can override any configuration variable. This +configuration can be added as a volume when invoking docker using +`-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php` parameters. + +Note that the supplied configuration file is applied after :ref:`docker-vars`, +but you can override any of the values. + +For example to change the default behavior of CSV export you can use the following +configuration file: + +.. code-block:: php + + + +You can also use it to define server configuration instead of using the +environment variables listed in :ref:`docker-vars`: + +.. code-block:: php + + [ + 'auth_type' => 'cookie', + 'host' => 'mydb1', + 'port' => 3306, + 'verbose' => 'Verbose name 1', + ], + 2 => [ + 'auth_type' => 'cookie', + 'host' => 'mydb2', + 'port' => 3306, + 'verbose' => 'Verbose name 2', + ], + ]; + +.. seealso:: + + See :ref:`config` for detailed description of configuration options. + +Docker Volumes +-------------- + +You can use the following volumes to customize image behavior: + +:file:`/etc/phpmyadmin/config.user.inc.php` + + Can be used for additional settings, see the previous chapter for more details. + +:file:`/sessions/` + + Directory where PHP sessions are stored. You might want to share this + for example when using :ref:`auth_signon`. + +:file:`/www/themes/` + + Directory where phpMyAdmin looks for themes. By default only those shipped + with phpMyAdmin are included, but you can include additional phpMyAdmin + themes (see :ref:`themes`) by using Docker volumes. + +Docker Examples +--------------- + +To connect phpMyAdmin to a given server use: + +.. code-block:: sh + + docker run --name myadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin/phpmyadmin + +To connect phpMyAdmin to more servers use: + +.. code-block:: sh + + docker run --name myadmin -d -e PMA_HOSTS=dbhost1,dbhost2,dbhost3 -p 8080:80 phpmyadmin/phpmyadmin + +To use arbitrary server option: + +.. code-block:: sh + + docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -e PMA_ARBITRARY=1 phpmyadmin/phpmyadmin + +You can also link the database container using Docker: + +.. code-block:: sh + + docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 phpmyadmin/phpmyadmin + +Running with additional configuration: + +.. code-block:: sh + + docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin/phpmyadmin + +Running with additional themes: + +.. code-block:: sh + + docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /custom/phpmyadmin/theme/:/www/themes/theme/ phpmyadmin/phpmyadmin + +Using docker-compose +-------------------- + +Alternatively, you can also use docker-compose with the docker-compose.yml from +. This will run phpMyAdmin with an +arbitrary server - allowing you to specify MySQL/MariaDB server on the login page. + +.. code-block:: sh + + docker-compose up -d + +Customizing configuration file using docker-compose +--------------------------------------------------- + +You can use an external file to customize phpMyAdmin configuration and pass it +using the volumes directive: + +.. code-block:: yaml + + phpmyadmin: + image: phpmyadmin/phpmyadmin + container_name: phpmyadmin + environment: + - PMA_ARBITRARY=1 + restart: always + ports: + - 8080:80 + volumes: + - /sessions + - ~/docker/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php + - /custom/phpmyadmin/theme/:/www/themes/theme/ + +.. seealso:: :ref:`docker-custom` + +Running behind haproxy in a subdirectory +---------------------------------------- + +When you want to expose phpMyAdmin running in a Docker container in a +subdirectory, you need to rewrite the request path in the server proxying the +requests. + +For example, using haproxy it can be done as: + +.. code-block:: text + + frontend http + bind *:80 + option forwardfor + option http-server-close + + ### NETWORK restriction + acl LOCALNET src 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12 + + # /phpmyadmin + acl phpmyadmin path_dir /phpmyadmin + use_backend phpmyadmin if phpmyadmin LOCALNET + + backend phpmyadmin + mode http + + reqirep ^(GET|POST|HEAD)\ /phpmyadmin/(.*) \1\ /\2 + + # phpMyAdmin container IP + server localhost 172.30.21.21:80 + +When using traefik, something like following should work: + +.. code-block:: text + + defaultEntryPoints = ["http"] + [entryPoints] + [entryPoints.http] + address = ":80" + [entryPoints.http.redirect] + regex = "(http:\\/\\/[^\\/]+\\/([^\\?\\.]+)[^\\/])$" + replacement = "$1/" + + [backends] + [backends.myadmin] + [backends.myadmin.servers.myadmin] + url="http://internal.address.to.pma" + + [frontends] + [frontends.myadmin] + backend = "myadmin" + passHostHeader = true + [frontends.myadmin.routes.default] + rule="PathPrefixStrip:/phpmyadmin/;AddPrefix:/" + +You then should specify :envvar:`PMA_ABSOLUTE_URI` in the docker-compose +configuration: + +.. code-block:: yaml + + version: '2' + + services: + phpmyadmin: + restart: always + image: phpmyadmin/phpmyadmin + container_name: phpmyadmin + hostname: phpmyadmin + domainname: example.com + ports: + - 8000:80 + environment: + - PMA_HOSTS=172.26.36.7,172.26.36.8,172.26.36.9,172.26.36.10 + - PMA_VERBOSES=production-db1,production-db2,dev-db1,dev-db2 + - PMA_USER=root + - PMA_PASSWORD= + - PMA_ABSOLUTE_URI=http://example.com/phpmyadmin/ + +.. _quick_install: + +Quick Install ++++++++++++++ + +#. Choose an appropriate distribution kit from the phpmyadmin.net + Downloads page. Some kits contain only the English messages, others + contain all languages. We'll assume you chose a kit whose name + looks like ``phpMyAdmin-x.x.x -all-languages.tar.gz``. +#. Ensure you have downloaded a genuine archive, see :ref:`verify`. +#. Untar or unzip the distribution (be sure to unzip the subdirectories): + ``tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz`` in your + webserver's document root. If you don't have direct access to your + document root, put the files in a directory on your local machine, + and, after step 4, transfer the directory on your web server using, + for example, ftp. +#. Ensure that all the scripts have the appropriate owner (if PHP is + running in safe mode, having some scripts with an owner different from + the owner of other scripts will be a problem). See :ref:`faq4_2` and + :ref:`faq1_26` for suggestions. +#. Now you must configure your installation. There are two methods that + can be used. Traditionally, users have hand-edited a copy of + :file:`config.inc.php`, but now a wizard-style setup script is provided + for those who prefer a graphical installation. Creating a + :file:`config.inc.php` is still a quick way to get started and needed for + some advanced features. + +Manually creating the file +-------------------------- + +To manually create the file, simply use your text editor to create the +file :file:`config.inc.php` (you can copy :file:`config.sample.inc.php` to get +a minimal configuration file) in the main (top-level) phpMyAdmin +directory (the one that contains :file:`index.php`). phpMyAdmin first +loads :file:`libraries/config.default.php` and then overrides those values +with anything found in :file:`config.inc.php`. If the default value is +okay for a particular setting, there is no need to include it in +:file:`config.inc.php`. You'll probably need only a few directives to get going; a +simple configuration may look like this: + +.. code-block:: xml+php + + + +Or, if you prefer to not be prompted every time you log in: + +.. code-block:: xml+php + + + +.. warning:: + + Storing passwords in the configuration is insecure as anybody can then + manipulate your database. + +For a full explanation of possible configuration values, see the +:ref:`config` of this document. + +.. index:: Setup script + +.. _setup_script: + +Using the Setup script +---------------------- + +Instead of manually editing :file:`config.inc.php`, you can use phpMyAdmin's +setup feature. The file can be generated using the setup and you can download it +for upload to the server. + +Next, open your browser and visit the location where you installed phpMyAdmin, +with the ``/setup`` suffix. The changes are not saved to the server, you need to +use the :guilabel:`Download` button to save them to your computer and then upload +to the server. + +Now the file is ready to be used. You can choose to review or edit the +file with your favorite editor, if you prefer to set some advanced +options that the setup script does not provide. + +#. If you are using the ``auth_type`` "config", it is suggested that you + protect the phpMyAdmin installation directory because using config + does not require a user to enter a password to access the phpMyAdmin + installation. Use of an alternate authentication method is + recommended, for example with HTTP鈥揂UTH in a :term:`.htaccess` file or switch to using + ``auth_type`` cookie or http. See the :ref:`faqmultiuser` + for additional information, especially :ref:`faq4_4`. +#. Open the main phpMyAdmin directory in your browser. + phpMyAdmin should now display a welcome screen and your databases, or + a login dialog if using :term:`HTTP` or + cookie authentication mode. + +.. _debian-setup: + +Setup script on Debian, Ubuntu and derivatives +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Debian and Ubuntu have changed the way in which the setup script is enabled and disabled, in a way +that single command has to be executed for either of these. + +To allow editing configuration invoke: + +.. code-block:: sh + + /usr/sbin/pma-configure + +To block editing configuration invoke: + +.. code-block:: sh + + /usr/sbin/pma-secure + +Setup script on openSUSE +~~~~~~~~~~~~~~~~~~~~~~~~ + +Some openSUSE releases do not include setup script in the package. In case you +want to generate configuration on these you can either download original +package from or use setup script on our demo +server: . + +.. _verify: + +Verifying phpMyAdmin releases ++++++++++++++++++++++++++++++ + +Since July 2015 all phpMyAdmin releases are cryptographically signed by the +releasing developer, who through January 2016 was Marc Delisle. His key id is +0xFEFC65D181AF644A, his PGP fingerprint is: + +.. code-block:: console + + 436F F188 4B1A 0C3F DCBF 0D79 FEFC 65D1 81AF 644A + +and you can get more identification information from . + +Beginning in January 2016, the release manager is Isaac Bennetch. His key id is +0xCE752F178259BD92, and his PGP fingerprint is: + +.. code-block:: console + + 3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92 + +and you can get more identification information from . + +Some additional downloads (for example themes) might be signed by Michal 膶iha艡. His key id is +0x9C27B31342B7511D, and his PGP fingerprint is: + +.. code-block:: console + + 63CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D + +and you can get more identification information from . + +You should verify that the signature matches the archive you have downloaded. +This way you can be sure that you are using the same code that was released. +You should also verify the date of the signature to make sure that you +downloaded the latest version. + +Each archive is accompanied by ``.asc`` files which contain the PGP signature +for it. Once you have both of them in the same folder, you can verify the signature: + +.. code-block:: console + + $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc + gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92 + gpg: Can't check signature: public key not found + +As you can see gpg complains that it does not know the public key. At this +point, you should do one of the following steps: + +* Download the keyring from `our download server `_, then import it with: + +.. code-block:: console + + $ gpg --import phpmyadmin.keyring + +* Download and import the key from one of the key servers: + +.. code-block:: console + + $ gpg --keyserver hkp://pgp.mit.edu --recv-keys 3D06A59ECE730EB71B511C17CE752F178259BD92 + gpg: requesting key 8259BD92 from hkp server pgp.mit.edu + gpg: key 8259BD92: public key "Isaac Bennetch " imported + gpg: no ultimately trusted keys found + gpg: Total number processed: 1 + gpg: imported: 1 (RSA: 1) + +This will improve the situation a bit - at this point, you can verify that the +signature from the given key is correct but you still can not trust the name used +in the key: + +.. code-block:: console + + $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc + gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92 + gpg: Good signature from "Isaac Bennetch " + gpg: aka "Isaac Bennetch " + gpg: WARNING: This key is not certified with a trusted signature! + gpg: There is no indication that the signature belongs to the owner. + Primary key fingerprint: 3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92 + +The problem here is that anybody could issue the key with this name. You need to +ensure that the key is actually owned by the mentioned person. The GNU Privacy +Handbook covers this topic in the chapter `Validating other keys on your public +keyring`_. The most reliable method is to meet the developer in person and +exchange key fingerprints, however, you can also rely on the web of trust. This way +you can trust the key transitively though signatures of others, who have met +the developer in person. For example, you can see how `Isaac's key links to +Linus's key`_. + +Once the key is trusted, the warning will not occur: + +.. code-block:: console + + $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc + gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92 + gpg: Good signature from "Isaac Bennetch " [full] + +Should the signature be invalid (the archive has been changed), you would get a +clear error regardless of the fact that the key is trusted or not: + +.. code-block:: console + + $ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc + gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92 + gpg: BAD signature from "Isaac Bennetch " [unknown] + +.. _Validating other keys on your public keyring: https://www.gnupg.org/gph/en/manual.html#AEN335 + +.. _Isaac's key links to Linus's key: https://pgp.cs.uu.nl/paths/79be3e4300411886/to/ce752f178259bd92.html + +.. index:: + single: Configuration storage + single: phpMyAdmin configuration storage + single: pmadb + +.. _linked-tables: + +phpMyAdmin configuration storage +++++++++++++++++++++++++++++++++ + +.. versionchanged:: 3.4.0 + + Prior to phpMyAdmin 3.4.0 this was called Linked Tables Infrastructure, but + the name was changed due to the extended scope of the storage. + +For a whole set of additional features (:ref:`bookmarks`, comments, :term:`SQL`-history, +tracking mechanism, :term:`PDF`-generation, :ref:`transformations`, :ref:`relations` +etc.) you need to create a set of special tables. Those tables can be located +in your own database, or in a central database for a multi-user installation +(this database would then be accessed by the controluser, so no other user +should have rights to it). + +.. _zeroconf: + +Zero configuration +------------------ + +In many cases, this database structure can be automatically created and +configured. This is called 鈥淶ero Configuration鈥� mode and can be particularly +useful in shared hosting situations. 鈥淶eroconf鈥� mode is on by default, to +disable set :config:option:`$cfg['ZeroConf']` to false. + +The following three scenarios are covered by the Zero Configuration mode: + +* When entering a database where the configuration storage tables are not + present, phpMyAdmin offers to create them from the Operations tab. +* When entering a database where the tables do already exist, the software + automatically detects this and begins using them. This is the most common + situation; after the tables are initially created automatically they are + continually used without disturbing the user; this is also most useful on + shared hosting where the user is not able to edit :file:`config.inc.php` and + usually the user only has access to one database. +* When having access to multiple databases, if the user first enters the + database containing the configuration storage tables then switches to + another database, + phpMyAdmin continues to use the tables from the first database; the user is + not prompted to create more tables in the new database. + +Manual configuration +-------------------- + +Please look at your ``./sql/`` directory, where you should find a +file called *create\_tables.sql*. (If you are using a Windows server, +pay special attention to :ref:`faq1_23`). + +If you already had this infrastructure and: + +* upgraded to MySQL 4.1.2 or newer, please use + :file:`sql/upgrade_tables_mysql_4_1_2+.sql`. +* upgraded to phpMyAdmin 4.3.0 or newer from 2.5.0 or newer (<= 4.2.x), + please use :file:`sql/upgrade_column_info_4_3_0+.sql`. +* upgraded to phpMyAdmin 4.7.0 or newer from 4.3.0 or newer, + please use :file:`sql/upgrade_tables_4_7_0+.sql`. + +and then create new tables by importing :file:`sql/create_tables.sql`. + +You can use your phpMyAdmin to create the tables for you. Please be +aware that you may need special (administrator) privileges to create +the database and tables, and that the script may need some tuning, +depending on the database name. + +After having imported the :file:`sql/create_tables.sql` file, you +should specify the table names in your :file:`config.inc.php` file. The +directives used for that can be found in the :ref:`config`. + +You will also need to have a controluser +(:config:option:`$cfg['Servers'][$i]['controluser']` and +:config:option:`$cfg['Servers'][$i]['controlpass']` settings) +with the proper rights to those tables. For example you can create it +using following statement: + +.. code-block:: mysql + + GRANT SELECT, INSERT, UPDATE, DELETE ON .* TO 'pma'@'localhost' IDENTIFIED BY 'pmapass'; + +.. _upgrading: + +Upgrading from an older version ++++++++++++++++++++++++++++++++ + +.. warning:: + + **Never** extract the new version over an existing installation of + phpMyAdmin, always first remove the old files keeping just the + configuration. + + This way, you will not leave any old or outdated files in the directory, + which can have severe security implications or can cause various breakages. + +Simply copy :file:`config.inc.php` from your previous installation into +the newly unpacked one. Configuration files from old versions may +require some tweaking as some options have been changed or removed. +For compatibility with PHP 5.3 and later, remove a +``set_magic_quotes_runtime(0);`` statement that you might find near +the end of your configuration file. + +You should **not** copy :file:`libraries/config.default.php` over +:file:`config.inc.php` because the default configuration file is version- +specific. + +The complete upgrade can be performed in a few simple steps: + +1. Download the latest phpMyAdmin version from . +2. Rename existing phpMyAdmin folder (for example to ``phpmyadmin-old``). +3. Unpack freshly downloaded phpMyAdmin to the desired location (for example ``phpmyadmin``). +4. Copy :file:`config.inc.php`` from old location (``phpmyadmin-old``) to the new one (``phpmyadmin``). +5. Test that everything works properly. +6. Remove backup of a previous version (``phpmyadmin-old``). + +If you have upgraded your MySQL server from a version previous to 4.1.2 to +version 5.x or newer and if you use the phpMyAdmin configuration storage, you +should run the :term:`SQL` script found in +:file:`sql/upgrade_tables_mysql_4_1_2+.sql`. + +If you have upgraded your phpMyAdmin to 4.3.0 or newer from 2.5.0 or +newer (<= 4.2.x) and if you use the phpMyAdmin configuration storage, you +should run the :term:`SQL` script found in +:file:`sql/upgrade_column_info_4_3_0+.sql`. + +Do not forget to clear the browser cache and to empty the old session by +logging out and logging in again. + +.. index:: Authentication mode + +.. _authentication_modes: + +Using authentication modes +++++++++++++++++++++++++++ + +:term:`HTTP` and cookie authentication modes are recommended in a **multi-user +environment** where you want to give users access to their own database and +don't want them to play around with others. Nevertheless, be aware that MS +Internet Explorer seems to be really buggy about cookies, at least till version +6. Even in a **single-user environment**, you might prefer to use :term:`HTTP` +or cookie mode so that your user/password pair are not in clear in the +configuration file. + +:term:`HTTP` and cookie authentication +modes are more secure: the MySQL login information does not need to be +set in the phpMyAdmin configuration file (except possibly for the +:config:option:`$cfg['Servers'][$i]['controluser']`). +However, keep in mind that the password travels in plain text unless +you are using the HTTPS protocol. In cookie mode, the password is +stored, encrypted with the AES algorithm, in a temporary cookie. + +Then each of the *true* users should be granted a set of privileges +on a set of particular databases. Normally you shouldn't give global +privileges to an ordinary user unless you understand the impact of those +privileges (for example, you are creating a superuser). +For example, to grant the user *real_user* with all privileges on +the database *user_base*: + +.. code-block:: mysql + + GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password'; + +What the user may now do is controlled entirely by the MySQL user management +system. With HTTP or cookie authentication mode, you don't need to fill the +user/password fields inside the :config:option:`$cfg['Servers']`. + +.. seealso:: + + :ref:`faq1_32`, + :ref:`faq1_35`, + :ref:`faq4_1`, + :ref:`faq4_2`, + :ref:`faq4_3` + +.. index:: pair: HTTP; Authentication mode + +.. _auth_http: + +HTTP authentication mode +------------------------ + +* Uses :term:`HTTP` Basic authentication + method and allows you to log in as any valid MySQL user. +* Is supported with most PHP configurations. For :term:`IIS` (:term:`ISAPI`) + support using :term:`CGI` PHP see :ref:`faq1_32`, for using with Apache + :term:`CGI` see :ref:`faq1_35`. +* When PHP is running under Apache's :term:`mod_proxy_fcgi` (e.g. with PHP-FPM), + ``Authorization`` headers are not passed to the underlying FCGI application, + such that your credentials will not reach the application. In this case, you can + add the following configuration directive: + + .. code-block:: apache + + SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 + +* See also :ref:`faq4_4` about not using the :term:`.htaccess` mechanism along with + ':term:`HTTP`' authentication mode. + +.. note:: + + There is no way to do proper logout in HTTP authentication, most browsers + will remember credentials until there is no different successful + authentication. Because of this, this method has a limitation that you can not + login with the same user after logout. + +.. index:: pair: Cookie; Authentication mode + +.. _cookie: + +Cookie authentication mode +-------------------------- + +* Username and password are stored in cookies during the session and password + is deleted when it ends. +* With this mode, the user can truly log out of phpMyAdmin and log + back in with the same username (this is not possible with :ref:`auth_http`). +* If you want to allow users to enter any hostname to connect (rather than only + servers that are configured in :file:`config.inc.php`), + see the :config:option:`$cfg['AllowArbitraryServer']` directive. +* As mentioned in the :ref:`require` section, having the ``openssl`` extension + will speed up access considerably, but is not required. + +.. index:: pair: Signon; Authentication mode + +.. _auth_signon: + +Signon authentication mode +-------------------------- + +* This mode is a convenient way of using credentials from another + application to authenticate to phpMyAdmin to implement a single signon + solution. +* The other application has to store login information into session + data (see :config:option:`$cfg['Servers'][$i]['SignonSession']` and + :config:option:`$cfg['Servers'][$i]['SignonCookieParams']`) or you + need to implement script to return the credentials (see + :config:option:`$cfg['Servers'][$i]['SignonScript']`). +* When no credentials are available, the user is being redirected to + :config:option:`$cfg['Servers'][$i]['SignonURL']`, where you should handle + the login process. + +The very basic example of saving credentials in a session is available as +:file:`examples/signon.php`: + +.. literalinclude:: ../examples/signon.php + :language: php + +Alternatively, you can also use this way to integrate with OpenID as shown +in :file:`examples/openid.php`: + +.. literalinclude:: ../examples/openid.php + :language: php + +If you intend to pass the credentials using some other means than, you have to +implement wrapper in PHP to get that data and set it to +:config:option:`$cfg['Servers'][$i]['SignonScript']`. There is a very minimal example +in :file:`examples/signon-script.php`: + +.. literalinclude:: ../examples/signon-script.php + :language: php + +.. seealso:: + :config:option:`$cfg['Servers'][$i]['auth_type']`, + :config:option:`$cfg['Servers'][$i]['SignonSession']`, + :config:option:`$cfg['Servers'][$i]['SignonCookieParams']`, + :config:option:`$cfg['Servers'][$i]['SignonScript']`, + :config:option:`$cfg['Servers'][$i]['SignonURL']`, + :ref:`example-signon` + +.. index:: pair: Config; Authentication mode + +.. _auth_config: + +Config authentication mode +-------------------------- + +* This mode is sometimes the less secure one because it requires you to fill the + :config:option:`$cfg['Servers'][$i]['user']` and + :config:option:`$cfg['Servers'][$i]['password']` + fields (and as a result, anyone who can read your :file:`config.inc.php` + can discover your username and password). +* In the :ref:`faqmultiuser` section, there is an entry explaining how + to protect your configuration file. +* For additional security in this mode, you may wish to consider the + Host authentication :config:option:`$cfg['Servers'][$i]['AllowDeny']['order']` + and :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` configuration directives. +* Unlike cookie and http, does not require a user to log in when first + loading the phpMyAdmin site. This is by design but could allow any + user to access your installation. Use of some restriction method is + suggested, perhaps a :term:`.htaccess` file with the HTTP-AUTH directive or disallowing + incoming HTTP requests at one鈥檚 router or firewall will suffice (both + of which are beyond the scope of this manual but easily searchable + with Google). + +.. _securing: + +Securing your phpMyAdmin installation ++++++++++++++++++++++++++++++++++++++ + +The phpMyAdmin team tries hard to make the application secure, however there +are always ways to make your installation more secure: + +* Follow our `Security announcements `_ and upgrade + phpMyAdmin whenever new vulnerability is published. +* Serve phpMyAdmin on HTTPS only. Preferably, you should use HSTS as well, so that + you're protected from protocol downgrade attacks. +* Ensure your PHP setup follows recommendations for production sites, for example + `display_errors `_ + should be disabled. +* Remove the ``test`` directory from phpMyAdmin, unless you are developing and need a test suite. +* Remove the ``setup`` directory from phpMyAdmin, you will probably not + use it after the initial setup. +* Properly choose an authentication method - :ref:`cookie` + is probably the best choice for shared hosting. +* Deny access to auxiliary files in :file:`./libraries/` or + :file:`./templates/` subfolders in your webserver configuration. + Such configuration prevents from possible path exposure and cross side + scripting vulnerabilities that might happen to be found in that code. For the + Apache webserver, this is often accomplished with a :term:`.htaccess` file in + those directories. +* Deny access to temporary files, see :config:option:`$cfg['TempDir']` (if that + is placed inside your web root, see also :ref:`web-dirs`. +* It is generally a good idea to protect a public phpMyAdmin installation + against access by robots as they usually can not do anything good there. You + can do this using ``robots.txt`` file in the root of your webserver or limit + access by web server configuration, see :ref:`faq1_42`. +* In case you don't want all MySQL users to be able to access + phpMyAdmin, you can use :config:option:`$cfg['Servers'][$i]['AllowDeny']['rules']` to limit them + or :config:option:`$cfg['Servers'][$i]['AllowRoot']` to deny root user access. +* Enable :ref:`2fa` for your account. +* Consider hiding phpMyAdmin behind an authentication proxy, so that + users need to authenticate prior to providing MySQL credentials + to phpMyAdmin. You can achieve this by configuring your web server to request + HTTP authentication. For example in Apache this can be done with: + + .. code-block:: apache + + AuthType Basic + AuthName "Restricted Access" + AuthUserFile /usr/share/phpmyadmin/passwd + Require valid-user + + Once you have changed the configuration, you need to create a list of users which + can authenticate. This can be done using the :program:`htpasswd` utility: + + .. code-block:: sh + + htpasswd -c /usr/share/phpmyadmin/passwd username + +* If you are afraid of automated attacks, enabling Captcha by + :config:option:`$cfg['CaptchaLoginPublicKey']` and + :config:option:`$cfg['CaptchaLoginPrivateKey']` might be an option. +* Failed login attemps are logged to syslog (if available, see + :config:option:`$cfg['AuthLog']`). This can allow using a tool such as + fail2ban to block brute-force attempts. Note that the log file used by syslog + is not the same as the Apache error or access log files. +* In case you're running phpMyAdmin together with other PHP applications, it is + generally advised to use separate session storage for phpMyAdmin to avoid + possible session-based attacks against it. You can use + :config:option:`$cfg['SessionSavePath']` to achieve this. + +.. _ssl: + +Using SSL for connection to database server ++++++++++++++++++++++++++++++++++++++++++++ + +It is recommended to use SSL when connecting to remote database server. There +are several configuration options involved in the SSL setup: + +:config:option:`$cfg['Servers'][$i]['ssl']` + Defines whether to use SSL at all. If you enable only this, the connection + will be encrypted, but there is not authentication of the connection - you + can not verify that you are talking to the right server. +:config:option:`$cfg['Servers'][$i]['ssl_key']` and :config:option:`$cfg['Servers'][$i]['ssl_cert']` + This is used for authentication of client to the server. +:config:option:`$cfg['Servers'][$i]['ssl_ca']` and :config:option:`$cfg['Servers'][$i]['ssl_ca_path']` + The certificate authorities you trust for server certificates. + This is used to ensure that you are talking to a trusted server. +:config:option:`$cfg['Servers'][$i]['ssl_verify']` + This configuration disables server certificate verification. Use with + caution. + +.. seealso:: + + :ref:`example-google-ssl`, + :config:option:`$cfg['Servers'][$i]['ssl']`, + :config:option:`$cfg['Servers'][$i]['ssl_key']`, + :config:option:`$cfg['Servers'][$i]['ssl_cert']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca']`, + :config:option:`$cfg['Servers'][$i]['ssl_ca_path']`, + :config:option:`$cfg['Servers'][$i]['ssl_ciphers']`, + :config:option:`$cfg['Servers'][$i]['ssl_verify']` + +Known issues +++++++++++++ + +Users with column-specific privileges are unable to "Browse" +------------------------------------------------------------ + +If a user has only column-specific privileges on some (but not all) columns in a table, "Browse" +will fail with an error message. + +As a workaround, a bookmarked query with the same name as the table can be created, this will +run when using the "Browse" link instead. `Issue 11922 `_. + +Trouble logging back in after logging out using 'http' authentication +---------------------------------------------------------------------- + +When using the 'http' ``auth_type``, it can be impossible to log back in (when the logout comes +manually or after a period of inactivity). `Issue 11898 `_. + +.. _Composer tool: https://getcomposer.org/ +.. _Packagist: https://packagist.org/ +.. _Docker image: https://hub.docker.com/r/phpmyadmin/phpmyadmin/ diff --git a/phpMyAdmin/doc/html/_sources/themes.rst.txt b/phpMyAdmin/doc/html/_sources/themes.rst.txt new file mode 100755 index 0000000..1f22521 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/themes.rst.txt @@ -0,0 +1,100 @@ +.. _themes: + +Custom Themes +============= + +phpMyAdmin comes with support for third party themes. You can download +additonal themes from our website at . + +Configuration +------------- + +Themes are configured with :config:option:`$cfg['ThemeManager']` and +:config:option:`$cfg['ThemeDefault']`. Under :file:`./themes/`, you should not +delete the directory ``pmahomme`` or its underlying structure, because this is +the system theme used by phpMyAdmin. ``pmahomme`` contains all images and +styles, for backwards compatibility and for all themes that would not include +images or css-files. If :config:option:`$cfg['ThemeManager']` is enabled, you +can select your favorite theme on the main page. Your selected theme will be +stored in a cookie. + +Creating custom theme +--------------------- + +To create a theme: + +* make a new subdirectory (for example "your\_theme\_name") under :file:`./themes/`. +* copy the files and directories from ``pmahomme`` to "your\_theme\_name" +* edit the css-files in "your\_theme\_name/css" +* put your new images in "your\_theme\_name/img" +* edit :file:`layout.inc.php` in "your\_theme\_name" +* edit :file:`theme.json` in "your\_theme\_name" to contain theme metadata (see below) +* make a new screenshot of your theme and save it under + "your\_theme\_name/screen.png" + +Theme metadata +++++++++++++++ + +.. versionchanged:: 4.8.0 + + Before 4.8.0 the theme metadata was passed in the :file:`info.inc.php` file. + It has been replaced by :file:`theme.json` to allow easier parsing (without + need to handle PHP code) and to support additional features. + +In theme directory there is file :file:`theme.json` which contains theme +metadata. Currently it consists of: + +.. describe:: name + + Display name of the theme. + + **This field is required.** + +.. describe:: version + + Theme version, can be quite arbirary and does not have to match phpMyAdmin version. + + **This field is required.** + +.. describe:: desciption + + Theme description. this will be shown on the website. + + **This field is required.** + +.. describe:: author + + Theme author name. + + **This field is required.** + +.. describe:: url + + Link to theme author website. It's good idea to have way for getting + support there. + +.. describe:: supports + + Array of supported phpMyAdmin major versions. + + **This field is required.** + +For example, the definition for Original theme shipped with phpMyAdnin 4.8: + +.. code-block:: json + + { + "name": "Original", + "version": "4.8", + "description": "Original phpMyAdmin theme", + "author": "phpMyAdmin developers", + "url": "https://www.phpmyadmin.net/", + "supports": ["4.8"] + } + +Sharing images +++++++++++++++ + +If you do not want to use your own symbols and buttons, remove the +directory "img" in "your\_theme\_name". phpMyAdmin will use the +default icons and buttons (from the system-theme ``pmahomme``). diff --git a/phpMyAdmin/doc/html/_sources/transformations.rst.txt b/phpMyAdmin/doc/html/_sources/transformations.rst.txt new file mode 100755 index 0000000..9eeb754 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/transformations.rst.txt @@ -0,0 +1,143 @@ +.. _transformations: + +Transformations +=============== + +.. note:: + + You need to have configured the :ref:`linked-tables` for using transformations + feature. + +.. _transformationsintro: + +Introduction +++++++++++++ + +To enable transformations, you have to setup the ``column_info`` +table and the proper directives. Please see the :ref:`config` on how to do so. + +You can apply different transformations to the contents of each +column. The transformation will take the content of each column and +transform it with certain rules defined in the selected +transformation. + +Say you have a column 'filename' which contains a filename. Normally +you would see in phpMyAdmin only this filename. Using transformations +you can transform that filename into a HTML link, so you can click +inside of the phpMyAdmin structure on the column's link and will see +the file displayed in a new browser window. Using transformation +options you can also specify strings to append/prepend to a string or +the format you want the output stored in. + +For a general overview of all available transformations and their +options, you can consult your *//transformation\_overview.php* installation. + +For a tutorial on how to effectively use transformations, see our +`Link section `_ on the +official phpMyAdmin homepage. + +.. _transformationshowto: + +Usage ++++++ + +Go to your *tbl\_structure.php* page (i.e. reached through clicking on +the 'Structure' link for a table). There click on "Change" (or change +icon) and there you will see three new fields at the end of the line. +They are called 'MIME-type', 'Browser transformation' and +'Transformation options'. + +* The field 'MIME-type' is a drop-down field. Select the MIME-type that + corresponds to the column's contents. Please note that transformations + are inactive as long as no MIME-type is selected. +* The field 'Browser transformation' is a drop-down field. You can + choose from a hopefully growing amount of pre-defined transformations. + See below for information on how to build your own transformation. + There are global transformations and mimetype-bound transformations. + Global transformations can be used for any mimetype. They will take + the mimetype, if necessary, into regard. Mimetype-bound + transformations usually only operate on a certain mimetype. There are + transformations which operate on the main mimetype (like 'image'), + which will most likely take the subtype into regard, and those who + only operate on a specific subtype (like 'image/jpeg'). You can use + transformations on mimetypes for which the function was not defined + for. There is no security check for you selected the right + transformation, so take care of what the output will be like. +* The field 'Transformation options' is a free-type textfield. You have + to enter transform-function specific options here. Usually the + transforms can operate with default options, but it is generally a + good idea to look up the overview to see which options are necessary. + Much like the ENUM/SET-Fields, you have to split up several options + using the format 'a','b','c',...(NOTE THE MISSING BLANKS). This is + because internally the options will be parsed as an array, leaving the + first value the first element in the array, and so forth. If you want + to specify a MIME character set you can define it in the + transformation\_options. You have to put that outside of the pre- + defined options of the specific mime-transform, as the last value of + the set. Use the format "'; charset=XXX'". If you use a transform, for + which you can specify 2 options and you want to append a character + set, enter "'first parameter','second parameter','charset=us-ascii'". + You can, however use the defaults for the parameters: "'','','charset + =us-ascii'". The default options can be configured using + :config:option:`$cfg['DefaultTransformations']` + +.. _transformationsfiles: + +File structure +++++++++++++++ + +All specific transformations for mimetypes are defined through class +files in the directory 'libraries/classes/Plugins/Transformations/'. Each of +them extends a certain transformation abstract class declared in +libraries/classes/Plugins/Transformations/Abs. + +They are stored in files to ease up customization and easy adding of +new transformations. + +Because the user cannot enter own mimetypes, it is kept sure that +transformations always work. It makes no sense to apply a +transformation to a mimetype the transform-function doesn't know to +handle. + +There is a file called '*transformations.lib.php*' that provides some +basic functions which can be included by any other transform function. + +The file name convention is ``[Mimetype]_[Subtype]_[Transformation +Name].class.php``, while the abtract class that it extends has the +name ``[Transformation Name]TransformationsPlugin``. All of the +methods that have to be implemented by a transformations plug-in are: + +#. getMIMEType() and getMIMESubtype() in the main class; +#. getName(), getInfo() and applyTransformation() in the abstract class + it extends. + +The getMIMEType(), getMIMESubtype() and getName() methods return the +name of the MIME type, MIME Subtype and transformation accordingly. +getInfo() returns the transformation's description and possible +options it may receive and applyTransformation() is the method that +does the actual work of the transformation plug-in. + +Please see the libraries/classes/Plugins/Transformations/TEMPLATE and +libraries/classes/Plugins/Transformations/TEMPLATE\_ABSTRACT files for adding +your own transformation plug-in. You can also generate a new +transformation plug-in (with or without the abstract transformation +class), by using +:file:`scripts/transformations_generator_plugin.sh` or +:file:`scripts/transformations_generator_main_class.sh`. + +The applyTransformation() method always gets passed three variables: + +#. **$buffer** - Contains the text inside of the column. This is the + text, you want to transform. +#. **$options** - Contains any user-passed options to a transform + function as an array. +#. **$meta** - Contains an object with information about your column. The + data is drawn from the output of the `mysql\_fetch\_field() + `_ function. This means, all + object properties described on the `manual page + `_ are available in this + variable and can be used to transform a column accordingly to + unsigned/zerofill/not\_null/... properties. The $meta->mimetype + variable contains the original MIME-type of the column (i.e. + 'text/plain', 'image/jpeg' etc.) diff --git a/phpMyAdmin/doc/html/_sources/two_factor.rst.txt b/phpMyAdmin/doc/html/_sources/two_factor.rst.txt new file mode 100755 index 0000000..2ac004e --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/two_factor.rst.txt @@ -0,0 +1,69 @@ +.. _2fa: + +Two-factor authentication +========================= + +.. versionadded:: 4.8.0 + +Since phpMyAdmin 4.8.0 you can configure two-factor authentication to be +used when logging in. To use this, you first need to configure the +:ref:`linked-tables`. Once this is done, every user can opt-in for the second +authentication factor in the :guilabel:`Settings`. + +When running phpMyAdmin from the Git source repository, the dependencies must be installed +manually; the typical way of doing so is with the command: + +.. code-block:: sh + + composer require pragmarx/google2fa bacon/bacon-qr-code + +Or when using a hardware security key with FIDO U2F: + +.. code-block:: sh + + composer require samyoul/u2f-php-server + +Authentication Application (2FA) +-------------------------------- + +Using an application for authentication is a quite common approach based on HOTP and +`TOTP `_. +It is based on transmitting a private key from phpMyAdmin to the authentication +application and the application is then able to generate one time codes based +on this key. The easiest way to enter the key in to the application from phpMyAdmin is +through scanning a QR code. + +There are dozens of applications available for mobile phones to implement these +standards, the most widely used include: + +* `FreeOTP for iOS, Android and Pebble `_ +* `Authy for iOS, Android, Chrome, OS X `_ +* `Google Authenticator for iOS `_ +* `Google Authenticator for Android `_ +* `LastPass Authenticator for iOS, Android, OS X, Windows `_ + +Hardware Security Key (FIDO U2F) +-------------------------------- + +Using hardware tokens is considered to be more secure than a software based +solution. phpMyAdmin supports `FIDO U2F `_ +tokens. + +There are several manufacturers of these tokens, for example: + +* `youbico FIDO U2F Security Key `_ +* `HyperFIDO `_ +* `Trezor Hardware Wallet `_ can act as an `U2F token `_ +* `List of Two Factor Auth (2FA) Dongles `_ + +.. _simple2fa: + +Simple two-factor authentication +-------------------------------- + +This authentication is included for testing and demonstration purposes only as +it really does not provide two-factor authentication, it just asks the user to confirm login by +clicking on the button. + +It should not be used in the production and is disabled unless +:config:option:`$cfg['DBG']['simple2fa']` is set. diff --git a/phpMyAdmin/doc/html/_sources/user.rst.txt b/phpMyAdmin/doc/html/_sources/user.rst.txt new file mode 100755 index 0000000..a98e2cb --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/user.rst.txt @@ -0,0 +1,16 @@ +User Guide +========== + +.. toctree:: + :maxdepth: 2 + + settings + two_factor + transformations + bookmarks + privileges + relations + charts + import_export + themes + other diff --git a/phpMyAdmin/doc/html/_sources/vendors.rst.txt b/phpMyAdmin/doc/html/_sources/vendors.rst.txt new file mode 100755 index 0000000..aaceee3 --- /dev/null +++ b/phpMyAdmin/doc/html/_sources/vendors.rst.txt @@ -0,0 +1,32 @@ +Distributing and packaging phpMyAdmin +===================================== + +This document is intended to give advices to people who want to +redistribute phpMyAdmin inside other software package such as Linux +distribution or some all in one package including web server and MySQL +server. + +Generally you can customize some basic aspects (paths to some files and +behavior) in :file:`libraries/vendor_config.php`. + +For example if you want setup script to generate config file in var, change +``SETUP_CONFIG_FILE`` to :file:`/var/lib/phpmyadmin/config.inc.php` and you +will also probably want to skip directory writable check, so set +``SETUP_DIR_WRITABLE`` to false. + +External libraries +------------------ + +phpMyAdmin includes several external libraries, you might want to +replace them with system ones if they are available, but please note +that you should test whether version you provide is compatible with the +one we ship. + +Currently known list of external libraries: + +js/jquery + jQuery js framework and various jQuery based libraries. + +vendor/ + The download kit includes various Composer packages as + dependencies. diff --git a/phpMyAdmin/doc/html/_static/basic.css b/phpMyAdmin/doc/html/_static/basic.css new file mode 100755 index 0000000..be19270 --- /dev/null +++ b/phpMyAdmin/doc/html/_static/basic.css @@ -0,0 +1,856 @@ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin: 10px 0 0 20px; + padding: 0; +} + +ul.search li { + padding: 5px 0 5px 20px; + background-image: url(file.png); + background-repeat: no-repeat; + background-position: 0 7px; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li div.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 450px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a.brackets:before, +span.brackets > a:before{ + content: "["; +} + +a.brackets:after, +span.brackets > a:after { + content: "]"; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +table.footnote td, table.footnote th { + border: 0 !important; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +dl.footnote > dt, +dl.citation > dt { + float: left; + margin-right: 0.5em; +} + +dl.footnote > dd, +dl.citation > dd { + margin-bottom: 0em; +} + +dl.footnote > dd:after, +dl.citation > dd:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dt:after { + content: ":"; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0.5em; + content: ":"; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.descname { + background-color: transparent; + font-weight: bold; + font-size: 1.2em; +} + +code.descclassname { + background-color: transparent; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/phpMyAdmin/doc/html/_static/classic.css b/phpMyAdmin/doc/html/_static/classic.css new file mode 100755 index 0000000..dcae946 --- /dev/null +++ b/phpMyAdmin/doc/html/_static/classic.css @@ -0,0 +1,266 @@ +/* + * classic.css_t + * ~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- classic theme. + * + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +html { + /* CSS hack for macOS's scrollbar (see #1125) */ + background-color: #FFFFFF; +} + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + background-color: #1c4e63; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + + + +/* -- hyperlink styles ------------------------------------------------------ */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:visited { + color: #355f7c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + + + +/* -- body styles ----------------------------------------------------------- */ + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-bottom: 1px solid #ccc; + margin: 20px -20px 10px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; } +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.admonition p { + margin-bottom: 5px; +} + +div.admonition pre { + margin-bottom: 5px; +} + +div.admonition ul, div.admonition ol { + margin-bottom: 5px; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: unset; + color: unset; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +code { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} + +th, dl.field-list > dt { + background-color: #ede; +} + +.warning code { + background: #efc2c2; +} + +.note code { + background: #d6d6d6; +} + +.viewcode-back { + font-family: sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} + +div.code-block-caption { + color: #efefef; + background-color: #1c4e63; +} \ No newline at end of file diff --git a/phpMyAdmin/doc/html/_static/default.css b/phpMyAdmin/doc/html/_static/default.css new file mode 100755 index 0000000..81b9363 --- /dev/null +++ b/phpMyAdmin/doc/html/_static/default.css @@ -0,0 +1 @@ +@import url("classic.css"); diff --git a/phpMyAdmin/doc/html/_static/doctools.js b/phpMyAdmin/doc/html/_static/doctools.js new file mode 100755 index 0000000..144884e --- /dev/null +++ b/phpMyAdmin/doc/html/_static/doctools.js @@ -0,0 +1,316 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilities for all documentation. + * + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +/** + * select a different prefix for underscore + */ +$u = _.noConflict(); + +/** + * make the code below compatible with browsers without + * an installed firebug like debugger +if (!window.console || !console.firebug) { + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", + "profile", "profileEnd"]; + window.console = {}; + for (var i = 0; i < names.length; ++i) + window.console[names[i]] = function() {}; +} + */ + +/** + * small helper function to urldecode strings + */ +jQuery.urldecode = function(x) { + return decodeURIComponent(x).replace(/\+/g, ' '); +}; + +/** + * small helper function to urlencode strings + */ +jQuery.urlencode = encodeURIComponent; + +/** + * This function returns the parsed url parameters of the + * current request. Multiple values per key are supported, + * it will always return arrays of strings for the value parts. + */ +jQuery.getQueryParameters = function(s) { + if (typeof s === 'undefined') + s = document.location.search; + var parts = s.substr(s.indexOf('?') + 1).split('&'); + var result = {}; + for (var i = 0; i < parts.length; i++) { + var tmp = parts[i].split('=', 2); + var key = jQuery.urldecode(tmp[0]); + var value = jQuery.urldecode(tmp[1]); + if (key in result) + result[key].push(value); + else + result[key] = [value]; + } + return result; +}; + +/** + * highlight a given string on a jquery object by wrapping it in + * span elements with the given class name. + */ +jQuery.fn.highlightText = function(text, className) { + function highlight(node, addItems) { + if (node.nodeType === 3) { + var val = node.nodeValue; + var pos = val.toLowerCase().indexOf(text); + if (pos >= 0 && + !jQuery(node.parentNode).hasClass(className) && + !jQuery(node.parentNode).hasClass("nohighlight")) { + var span; + var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.className = className; + } + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + node.parentNode.insertBefore(span, node.parentNode.insertBefore( + document.createTextNode(val.substr(pos + text.length)), + node.nextSibling)); + node.nodeValue = val.substr(0, pos); + if (isInSVG) { + var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute('class', className); + addItems.push({ + "parent": node.parentNode, + "target": rect}); + } + } + } + else if (!jQuery(node).is("button, select, textarea")) { + jQuery.each(node.childNodes, function() { + highlight(this, addItems); + }); + } + } + var addItems = []; + var result = this.each(function() { + highlight(this, addItems); + }); + for (var i = 0; i < addItems.length; ++i) { + jQuery(addItems[i].parent).before(addItems[i].target); + } + return result; +}; + +/* + * backward compatibility for jQuery.browser + * This will be supported until firefox bug is fixed. + */ +if (!jQuery.browser) { + jQuery.uaMatch = function(ua) { + ua = ua.toLowerCase(); + + var match = /(chrome)[ \/]([\w.]+)/.exec(ua) || + /(webkit)[ \/]([\w.]+)/.exec(ua) || + /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) || + /(msie) ([\w.]+)/.exec(ua) || + ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) || + []; + + return { + browser: match[ 1 ] || "", + version: match[ 2 ] || "0" + }; + }; + jQuery.browser = {}; + jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true; +} + +/** + * Small JavaScript module for the documentation. + */ +var Documentation = { + + init : function() { + this.fixFirefoxAnchorBug(); + this.highlightSearchWords(); + this.initIndexTable(); + if (DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) { + this.initOnKeyListeners(); + } + }, + + /** + * i18n support + */ + TRANSLATIONS : {}, + PLURAL_EXPR : function(n) { return n === 1 ? 0 : 1; }, + LOCALE : 'unknown', + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext : function(string) { + var translated = Documentation.TRANSLATIONS[string]; + if (typeof translated === 'undefined') + return string; + return (typeof translated === 'string') ? translated : translated[0]; + }, + + ngettext : function(singular, plural, n) { + var translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated === 'undefined') + return (n == 1) ? singular : plural; + return translated[Documentation.PLURALEXPR(n)]; + }, + + addTranslations : function(catalog) { + for (var key in catalog.messages) + this.TRANSLATIONS[key] = catalog.messages[key]; + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); + this.LOCALE = catalog.locale; + }, + + /** + * add context elements like header anchor links + */ + addContextElements : function() { + $('div[id] > :header:first').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this headline')). + appendTo(this); + }); + $('dt[id]').each(function() { + $('\u00B6'). + attr('href', '#' + this.id). + attr('title', _('Permalink to this definition')). + appendTo(this); + }); + }, + + /** + * workaround a firefox stupidity + * see: https://bugzilla.mozilla.org/show_bug.cgi?id=645075 + */ + fixFirefoxAnchorBug : function() { + if (document.location.hash && $.browser.mozilla) + window.setTimeout(function() { + document.location.href += ''; + }, 10); + }, + + /** + * highlight the search words provided in the url in the text + */ + highlightSearchWords : function() { + var params = $.getQueryParameters(); + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; + if (terms.length) { + var body = $('div.body'); + if (!body.length) { + body = $('body'); + } + window.setTimeout(function() { + $.each(terms, function() { + body.highlightText(this.toLowerCase(), 'highlighted'); + }); + }, 10); + $('') + .appendTo($('#searchbox')); + } + }, + + /** + * init the domain index toggle buttons + */ + initIndexTable : function() { + var togglers = $('img.toggler').click(function() { + var src = $(this).attr('src'); + var idnum = $(this).attr('id').substr(7); + $('tr.cg-' + idnum).toggle(); + if (src.substr(-9) === 'minus.png') + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); + else + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); + }).css('display', ''); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { + togglers.click(); + } + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords : function() { + $('#searchbox .highlight-link').fadeOut(300); + $('span.highlighted').removeClass('highlighted'); + }, + + /** + * make the url absolute + */ + makeURL : function(relativeURL) { + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; + }, + + /** + * get the current relative url + */ + getCurrentURL : function() { + var path = document.location.pathname; + var parts = path.split(/\//); + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { + if (this === '..') + parts.pop(); + }); + var url = parts.join('/'); + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); + }, + + initOnKeyListeners: function() { + $(document).keydown(function(event) { + var activeElementType = document.activeElement.tagName; + // don't navigate when in search box, textarea, dropdown or button + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' + && activeElementType !== 'BUTTON' && !event.altKey && !event.ctrlKey && !event.metaKey + && !event.shiftKey) { + switch (event.keyCode) { + case 37: // left + var prevHref = $('link[rel="prev"]').prop('href'); + if (prevHref) { + window.location.href = prevHref; + return false; + } + case 39: // right + var nextHref = $('link[rel="next"]').prop('href'); + if (nextHref) { + window.location.href = nextHref; + return false; + } + } + } + }); + } +}; + +// quick alias for translations +_ = Documentation.gettext; + +$(document).ready(function() { + Documentation.init(); +}); diff --git a/phpMyAdmin/doc/html/_static/documentation_options.js b/phpMyAdmin/doc/html/_static/documentation_options.js new file mode 100755 index 0000000..ea80779 --- /dev/null +++ b/phpMyAdmin/doc/html/_static/documentation_options.js @@ -0,0 +1,12 @@ +var DOCUMENTATION_OPTIONS = { + URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'), + VERSION: '4.9.11', + LANGUAGE: 'None', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false +}; \ No newline at end of file diff --git a/phpMyAdmin/doc/html/_static/file.png b/phpMyAdmin/doc/html/_static/file.png new file mode 100755 index 0000000..a858a41 Binary files /dev/null and b/phpMyAdmin/doc/html/_static/file.png differ diff --git a/phpMyAdmin/doc/html/_static/jquery.js b/phpMyAdmin/doc/html/_static/jquery.js new file mode 100755 index 0000000..b8eb73c --- /dev/null +++ b/phpMyAdmin/doc/html/_static/jquery.js @@ -0,0 +1,10870 @@ +/*! + * jQuery JavaScript Library v3.5.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var flat = arr.flat ? function( array ) { + return arr.flat.call( array ); +} : function( array ) { + return arr.concat.apply( [], array ); +}; + + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + +var document = window.document; + + + + var preservedScriptAttributes = { + type: true, + src: true, + nonce: true, + noModule: true + }; + + function DOMEval( code, node, doc ) { + doc = doc || document; + + var i, val, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + + // Support: Firefox 64+, Edge 18+ + // Some browsers don't support the "nonce" property on scripts. + // On the other hand, just using `getAttribute` is not enough as + // the `nonce` attribute is reset to an empty string whenever it + // becomes browsing-context connected. + // See https://github.com/whatwg/html/issues/2369 + // See https://html.spec.whatwg.org/#nonce-attributes + // The `node.getAttribute` check was added for the sake of + // `jQuery.globalEval` so that it can fake a nonce-containing node + // via an object. + val = node[ i ] || node.getAttribute && node.getAttribute( i ); + if ( val ) { + script.setAttribute( i, val ); + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.5.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + copy = options[ name ]; + + // Prevent Object.prototype pollution + // Prevent never-ending loop + if ( name === "__proto__" || target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + src = target[ name ]; + + // Ensure proper type for the source value + if ( copyIsArray && !Array.isArray( src ) ) { + clone = []; + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { + clone = {}; + } else { + clone = src; + } + copyIsArray = false; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a provided context; falls back to the global one + // if not specified. + globalEval: function( code, options, doc ) { + DOMEval( code, { nonce: options && options.nonce }, doc ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return flat( ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.5 + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://js.foundation/ + * + * Date: 2020-03-14 + */ +( function( window ) { +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + nonnativeSelectorCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ( {} ).hasOwnProperty, + arr = [], + pop = arr.pop, + pushNative = arr.push, + push = arr.push, + slice = arr.slice, + + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[ i ] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + + "ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram + identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + + // "Attribute values must be CSS identifiers [capture 5] + // or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + + whitespace + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + + "*" ), + rdescend = new RegExp( whitespace + "|>" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rhtml = /HTML$/i, + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), + funescape = function( escape, nonHex ) { + var high = "0x" + escape.slice( 1 ) - 0x10000; + + return nonHex ? + + // Strip the backslash prefix from a non-hex escape sequence + nonHex : + + // Replace a hexadecimal escape sequence with the encoded Unicode code point + // Support: IE <=11+ + // For values outside the Basic Multilingual Plane (BMP), manually construct a + // surrogate pair + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + inDisabledFieldset = addCombinator( + function( elem ) { + return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + ( arr = slice.call( preferredDoc.childNodes ) ), + preferredDoc.childNodes + ); + + // Support: Android<4.0 + // Detect silently failing push.apply + // eslint-disable-next-line no-unused-expressions + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + pushNative.apply( target, slice.call( els ) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + + // Can't trust NodeList.length + while ( ( target[ j++ ] = els[ i++ ] ) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + setDocument( context ); + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { + + // ID selector + if ( ( m = match[ 1 ] ) ) { + + // Document context + if ( nodeType === 9 ) { + if ( ( elem = context.getElementById( m ) ) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && ( elem = newContext.getElementById( m ) ) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[ 2 ] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !nonnativeSelectorCache[ selector + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && + + // Support: IE 8 only + // Exclude object elements + ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { + + newSelector = selector; + newContext = context; + + // qSA considers elements outside a scoping root when evaluating child or + // descendant combinators, which is not what we want. + // In such cases, we work around the behavior by prefixing every selector in the + // list with an ID selector referencing the scope context. + // The technique has to be used as well when a leading combinator is used + // as such selectors are not recognized by querySelectorAll. + // Thanks to Andrew Dupont for this technique. + if ( nodeType === 1 && + ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + + // We can use :scope instead of the ID hack if the browser + // supports it & if we're not changing the context. + if ( newContext !== context || !support.scope ) { + + // Capture the context ID, setting it first if necessary + if ( ( nid = context.getAttribute( "id" ) ) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", ( nid = expando ) ); + } + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + + toSelector( groups[ i ] ); + } + newSelector = groups.join( "," ); + } + + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + nonnativeSelectorCache( selector, true ); + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return ( cache[ key + " " ] = value ); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement( "fieldset" ); + + try { + return !!fn( el ); + } catch ( e ) { + return false; + } finally { + + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split( "|" ), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[ i ] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( ( cur = cur.nextSibling ) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return ( name === "input" || name === "button" ) && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + inDisabledFieldset( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction( function( argument ) { + argument = +argument; + return markFunction( function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ ( j = matchIndexes[ i ] ) ] ) { + seed[ j ] = !( matches[ j ] = seed[ j ] ); + } + } + } ); + } ); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + var namespace = elem.namespaceURI, + docElem = ( elem.ownerDocument || elem ).documentElement; + + // Support: IE <=8 + // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes + // https://bugs.jquery.com/ticket/4833 + return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9 - 11+, Edge 12 - 18+ + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( preferredDoc != document && + ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, + // Safari 4 - 5 only, Opera <=11.6 - 12.x only + // IE/Edge & older browsers don't support the :scope pseudo-class. + // Support: Safari 6.0 only + // Safari 6.0 supports :scope but it's an alias of :root there. + support.scope = assert( function( el ) { + docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); + return typeof el.querySelectorAll !== "undefined" && + !el.querySelectorAll( ":scope fieldset div" ).length; + } ); + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert( function( el ) { + el.className = "i"; + return !el.getAttribute( "className" ); + } ); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert( function( el ) { + el.appendChild( document.createComment( "" ) ); + return !el.getElementsByTagName( "*" ).length; + } ); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert( function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + } ); + + // ID filter and find + if ( support.getById ) { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute( "id" ) === attrId; + }; + }; + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode( "id" ); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( ( elem = elems[ i++ ] ) ) { + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find[ "TAG" ] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert( function( el ) { + + var input; + + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll( "[selected]" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push( "~=" ); + } + + // Support: IE 11+, Edge 15 - 18+ + // IE 11/Edge don't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + // Interestingly, IE 10 & older don't seem to have the issue. + input = document.createElement( "input" ); + input.setAttribute( "name", "" ); + el.appendChild( input ); + if ( !el.querySelectorAll( "[name='']" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll( ":checked" ).length ) { + rbuggyQSA.push( ":checked" ); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push( ".#.+[+~]" ); + } + + // Support: Firefox <=3.6 - 5 only + // Old Firefox doesn't throw on a badly-escaped identifier. + el.querySelectorAll( "\\\f" ); + rbuggyQSA.push( "[\\r\\n\\f]" ); + } ); + + assert( function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement( "input" ); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll( "[name=d]" ).length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: Opera 10 - 11 only + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll( "*,:x" ); + rbuggyQSA.push( ",.*:" ); + } ); + } + + if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector ) ) ) ) { + + assert( function( el ) { + + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + } ); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + ) ); + } : + function( a, b ) { + if ( b ) { + while ( ( b = b.parentNode ) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { + + // Choose the first element that is related to our preferred document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( a == document || a.ownerDocument == preferredDoc && + contains( preferredDoc, a ) ) { + return -1; + } + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( b == document || b.ownerDocument == preferredDoc && + contains( preferredDoc, b ) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + return a == document ? -1 : + b == document ? 1 : + /* eslint-enable eqeqeq */ + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( ( cur = cur.parentNode ) ) { + ap.unshift( cur ); + } + cur = b; + while ( ( cur = cur.parentNode ) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[ i ] === bp[ i ] ) { + i++; + } + + return i ? + + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[ i ], bp[ i ] ) : + + // Otherwise nodes in our document sort first + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + ap[ i ] == preferredDoc ? -1 : + bp[ i ] == preferredDoc ? 1 : + /* eslint-enable eqeqeq */ + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + setDocument( elem ); + + if ( support.matchesSelector && documentIsHTML && + !nonnativeSelectorCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch ( e ) { + nonnativeSelectorCache( expr, true ); + } + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( context.ownerDocument || context ) != document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( elem.ownerDocument || elem ) != document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + + // If no nodeType, this is expected to be an array + while ( ( node = elem[ i++ ] ) ) { + + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[ 1 ] = match[ 1 ].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[ 3 ] = ( match[ 3 ] || match[ 4 ] || + match[ 5 ] || "" ).replace( runescape, funescape ); + + if ( match[ 2 ] === "~=" ) { + match[ 3 ] = " " + match[ 3 ] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[ 1 ] = match[ 1 ].toLowerCase(); + + if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { + + // nth-* requires argument + if ( !match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[ 4 ] = +( match[ 4 ] ? + match[ 5 ] + ( match[ 6 ] || 1 ) : + 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); + match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); + + // other types prohibit arguments + } else if ( match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[ 6 ] && match[ 2 ]; + + if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[ 3 ] ) { + match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + + // Get excess from tokenize (recursively) + ( excess = tokenize( unquoted, true ) ) && + + // advance to the next closing parenthesis + ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { + + // excess is a negative index + match[ 0 ] = match[ 0 ].slice( 0, excess ); + match[ 2 ] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { + return true; + } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + ( pattern = new RegExp( "(^|" + whitespace + + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( + className, function( elem ) { + return pattern.test( + typeof elem.className === "string" && elem.className || + typeof elem.getAttribute !== "undefined" && + elem.getAttribute( "class" ) || + "" + ); + } ); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + /* eslint-disable max-len */ + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + /* eslint-enable max-len */ + + }; + }, + + "CHILD": function( type, what, _argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, _context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( ( node = node[ dir ] ) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( ( node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + + // Use previously-cached element index if available + if ( useCache ) { + + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + + // Use the same loop as above to seek `elem` from the start + while ( ( node = ++nodeIndex && node && node[ dir ] || + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || + ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction( function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[ i ] ); + seed[ idx ] = !( matches[ idx ] = matched[ i ] ); + } + } ) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + + // Potentially complex pseudos + "not": markFunction( function( selector ) { + + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction( function( seed, matches, _context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( ( elem = unmatched[ i ] ) ) { + seed[ i ] = !( matches[ i ] = elem ); + } + } + } ) : + function( elem, _context, xml ) { + input[ 0 ] = elem; + matcher( input, null, xml, results ); + + // Don't keep the element (issue #299) + input[ 0 ] = null; + return !results.pop(); + }; + } ), + + "has": markFunction( function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + } ), + + "contains": markFunction( function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; + }; + } ), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + + // lang value must be a valid identifier + if ( !ridentifier.test( lang || "" ) ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( ( elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); + return false; + }; + } ), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && + ( !document.hasFocus || document.hasFocus() ) && + !!( elem.type || elem.href || ~elem.tabIndex ); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return ( nodeName === "input" && !!elem.checked ) || + ( nodeName === "option" && !!elem.selected ); + }, + + "selected": function( elem ) { + + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + // eslint-disable-next-line no-unused-expressions + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos[ "empty" ]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( ( attr = elem.getAttribute( "type" ) ) == null || + attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo( function() { + return [ 0 ]; + } ), + + "last": createPositionalPseudo( function( _matchIndexes, length ) { + return [ length - 1 ]; + } ), + + "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + } ), + + "even": createPositionalPseudo( function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "odd": createPositionalPseudo( function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? + argument + length : + argument > length ? + length : + argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ) + } +}; + +Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || ( match = rcomma.exec( soFar ) ) ) { + if ( match ) { + + // Don't consume trailing commas as valid + soFar = soFar.slice( match[ 0 ].length ) || soFar; + } + groups.push( ( tokens = [] ) ); + } + + matched = false; + + // Combinators + if ( ( match = rcombinators.exec( soFar ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + + // Cast descendant combinators to space + type: match[ 0 ].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || + ( match = preFilters[ type ]( match ) ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[ i ].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || + ( outerCache[ elem.uniqueID ] = {} ); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( ( oldCache = uniqueCache[ key ] ) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return ( newCache[ 2 ] = oldCache[ 2 ] ); + } else { + + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[ i ]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[ 0 ]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[ i ], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( ( elem = unmatched[ i ] ) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction( function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( + selector || "*", + context.nodeType ? [ context ] : context, + [] + ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( ( elem = temp[ i ] ) ) { + matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) ) { + + // Restore matcherIn since elem is not yet a final match + temp.push( ( matcherIn[ i ] = elem ) ); + } + } + postFinder( null, ( matcherOut = [] ), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) && + ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { + + seed[ temp ] = !( results[ temp ] = elem ); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + } ); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[ 0 ].type ], + implicitRelative = leadingRelative || Expr.relative[ " " ], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + ( checkContext = context ).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[ j ].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens + .slice( 0, i - 1 ) + .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), + + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), + len = elems.length; + + if ( outermost ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + outermostContext = context == document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( !context && elem.ownerDocument != document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( ( matcher = elementMatchers[ j++ ] ) ) { + if ( matcher( elem, context || document, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + + // They will have gone through all possible matchers + if ( ( elem = !matcher && elem ) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( ( matcher = setMatchers[ j++ ] ) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !( unmatched[ i ] || setMatched[ i ] ) ) { + setMatched[ i ] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[ i ] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( + selector, + matcherFromGroupMatchers( elementMatchers, setMatchers ) + ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( ( selector = compiled.selector || selector ) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[ 0 ] = match[ 0 ].slice( 0 ); + if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { + + context = ( Expr.find[ "ID" ]( token.matches[ 0 ] + .replace( runescape, funescape ), context ) || [] )[ 0 ]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[ i ]; + + // Abort if we hit a combinator + if ( Expr.relative[ ( type = token.type ) ] ) { + break; + } + if ( ( find = Expr.find[ type ] ) ) { + + // Search, expanding context for leading sibling combinators + if ( ( seed = find( + token.matches[ 0 ].replace( runescape, funescape ), + rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || + context + ) ) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert( function( el ) { + + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; +} ); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert( function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute( "href" ) === "#"; +} ) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + } ); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert( function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +} ) ) { + addHandle( "value", function( elem, _name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + } ); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert( function( el ) { + return el.getAttribute( "disabled" ) == null; +} ) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; + } + } ); +} + +return Sizzle; + +} )( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, _i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, _i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, _i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( elem.contentDocument != null && + + // Support: IE 11+ + // elements with no `data` attribute has an object + // `contentDocument` with a `null` prototype. + getProto( elem.contentDocument ) ) { + + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( _i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, _key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + isAttached( elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // Support: IE <=9 only + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, attached, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + attached = isAttached( elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( attached ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 - 11+ +// focus() and blur() are asynchronous, except when they are no-op. +// So expect focus to be synchronous when the element is already active, +// and blur to be synchronous when the element is not already active. +// (focus and blur are always synchronous in other supported browsers, +// this just defines when we can count on it). +function expectSync( elem, type ) { + return ( elem === safeActiveElement() ) === ( type === "focus" ); +} + +// Support: IE <=9 only +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = Object.create( null ); + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", returnTrue ); + } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; + }, + + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack + _default: function( event ) { + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, expectSync ) { + + // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add + if ( !expectSync ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var notAsync, result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + // Saved data should be false in such cases, but might be a leftover capture object + // from an async native handler (gh-4350) + if ( !saved.length ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + // Support: IE <=9 - 11+ + // focus() and blur() are asynchronous + notAsync = expectSync( this, type ); + this[ type ](); + result = dataPriv.get( this, type ); + if ( saved !== result || notAsync ) { + dataPriv.set( this, type, false ); + } else { + result = {}; + } + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + return result.value; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering the + // native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved.length ) { + + // ...and capture the result + dataPriv.set( this, type, { + value: jQuery.event.trigger( + + // Support: IE <=9 - 11+ + // Extend with the prototype to reset the above stopImmediatePropagation() + jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), + saved.slice( 1 ), + this + ) + } ); + + // Abort handling of the native event + event.stopImmediatePropagation(); + } + } + } ); +} + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + code: true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, expectSync ); + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + delegateType: delegateType + }; +} ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.get( src ); + events = pdataOld.events; + + if ( events ) { + dataPriv.remove( dest, "handle events" ); + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = flat( args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && isAttached( node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html; + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = isAttached( elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var swap = function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) + div.style.position = "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableTrDimensionsVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + }, + + // Support: IE 9 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Behavior in IE 9 is more subtle than in newer versions & it passes + // some versions of this test; make sure not to make it pass there! + reliableTrDimensions: function() { + var table, tr, trChild, trStyle; + if ( reliableTrDimensionsVal == null ) { + table = document.createElement( "table" ); + tr = document.createElement( "tr" ); + trChild = document.createElement( "div" ); + + table.style.cssText = "position:absolute;left:-11111px"; + tr.style.height = "1px"; + trChild.style.height = "9px"; + + documentElement + .appendChild( table ) + .appendChild( tr ) + .appendChild( trChild ); + + trStyle = window.getComputedStyle( tr ); + reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; + + documentElement.removeChild( table ); + } + return reliableTrDimensionsVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !isAttached( elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style, + vendorProps = {}; + +// Return a vendor-prefixed property or undefined +function vendorPropName( name ) { + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property +function finalPropName( name ) { + var final = jQuery.cssProps[ name ] || vendorProps[ name ]; + + if ( final ) { + return final; + } + if ( name in emptyStyle ) { + return name; + } + return vendorProps[ name ] = vendorPropName( name ) || name; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }; + +function setPositiveNumber( _elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + + // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter + // Use an explicit zero to avoid NaN (gh-3964) + ) ) || 0; + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). + // Fake content-box until we know it's needed to know the true value. + boxSizingNeeded = !support.boxSizingReliable() || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox, + + val = curCSS( elem, dimension, styles ), + offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + + // Support: IE 9 - 11 only + // Use offsetWidth/offsetHeight for when box sizing is unreliable. + // In those cases, the computed value can be trusted to be border-box. + if ( ( !support.boxSizingReliable() && isBorderBox || + + // Support: IE 10 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Interestingly, in some cases IE 9 doesn't suffer from this issue. + !support.reliableTrDimensions() && nodeName( elem, "tr" ) || + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + val === "auto" || + + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + + // Make sure the element is visible & connected + elem.getClientRects().length ) { + + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Where available, offsetWidth/offsetHeight approximate border box dimensions. + // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the + // retrieved value as a content box dimension. + valueIsBorderBox = offsetProp in elem; + if ( valueIsBorderBox ) { + val = elem[ offsetProp ]; + } + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "gridArea": true, + "gridColumn": true, + "gridColumnEnd": true, + "gridColumnStart": true, + "gridRow": true, + "gridRowEnd": true, + "gridRowStart": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append + // "px" to a few hardcoded values. + if ( type === "number" && !isCustomProp ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( _i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + + // Only read styles.position if the test has a chance to fail + // to avoid forcing a reflow. + scrollboxSizeBuggy = !support.scrollboxSize() && + styles.position === "absolute", + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) + boxSizingNeeded = scrollboxSizeBuggy || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && scrollboxSizeBuggy ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && ( + jQuery.cssHooks[ tween.prop ] || + tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( + dataPriv.get( cur, "events" ) || Object.create( null ) + )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + + // Handle: regular nodes (via `this.ownerDocument`), window + // (via `this.document`) & document (via `this`). + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = { guid: Date.now() }; + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + if ( a == null ) { + return ""; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( _i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() + " " ] = + ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) + .concat( match[ 2 ] ); + } + } + match = responseHeaders[ key.toLowerCase() + " " ]; + } + return match == null ? null : match.join( ", " ); + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Use a noop converter for missing script + if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { + s.converters[ "text script" ] = function() {}; + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( _i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + +jQuery.ajaxPrefilter( function( s ) { + var i; + for ( i in s.headers ) { + if ( i.toLowerCase() === "content-type" ) { + s.contentType = s.headers[ i ] || ""; + } + } +} ); + + +jQuery._evalUrl = function( url, options, doc ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + + // Only evaluate the response if it is successful (gh-4126) + // dataFilter is not invoked for failure responses, so using it instead + // of the default converter is kludgy but it works. + converters: { + "text script": function() {} + }, + dataFilter: function( response ) { + jQuery.globalEval( response, options, doc ); + } + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( " + + + + + + + + + + + + +
+
+
+
+ +
+

Bookmarks露

+
+

Note

+

You need to have configured the phpMyAdmin configuration storage for using bookmarks +feature.

+
+
+

Storing bookmarks露

+

Any query that is executed can be marked as a bookmark on the page +where the results are displayed. You will find a button labeled +Bookmark this query just at the end of the page. As soon as you have +stored a bookmark, that query is linked to the database. +You can now access a bookmark dropdown on each page where the query box appears on for that database.

+
+
+

Variables inside bookmarks露

+

Inside a query, you can also add placeholders for variables. +This is done by inserting into the query SQL comments between /* and +*/. The special string [VARIABLE{variable-number}] is used inside the comments. +Be aware that the whole query minus the SQL comments must be +valid by itself, otherwise you won鈥檛 be able to store it as a bookmark. +Also, note that the text 鈥榁ARIABLE鈥� is case-sensitive.

+

When you execute the bookmark, everything typed into the Variables +input boxes on the query box page will replace the strings /*[VARIABLE{variable-number}]*/ in +your stored query.

+

Also remember, that everything else inside the /*[VARIABLE{variable-number}]*/ string for +your query will remain the way it is, but will be stripped of the /**/ +chars. So you can use:

+
/*, [VARIABLE1] AS myname */
+
+
+

which will be expanded to

+
, VARIABLE1 as myname
+
+
+

in your query, where VARIABLE1 is the string you entered in the Variable 1 input box.

+

A more complex example, say you have stored this query:

+
SELECT Name, Address FROM addresses WHERE 1 /* AND Name LIKE '%[VARIABLE1]%' */
+
+
+

If you wish to enter 鈥減hpMyAdmin鈥� as the variable for the stored query, the full +query will be:

+
SELECT Name, Address FROM addresses WHERE 1 AND Name LIKE '%phpMyAdmin%'
+
+
+

NOTE THE ABSENCE OF SPACES inside the /**/ construct. Any spaces +inserted there will be later also inserted as spaces in your query and may lead +to unexpected results especially when using the variable expansion inside of a +鈥淟IKE 鈥樷�欌�� expression.

+
+
+

Browsing a table using a bookmark露

+

When a bookmark has the same name as the table, it will be used as the query when browsing +this table.

+ +
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/charts.html b/phpMyAdmin/doc/html/charts.html new file mode 100755 index 0000000..94bc00b --- /dev/null +++ b/phpMyAdmin/doc/html/charts.html @@ -0,0 +1,291 @@ + + + + + + + + Charts — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Charts露

+
+

New in version 3.4.0.

+
+

Since phpMyAdmin version 3.4.0, you can easily generate charts from a SQL query +by clicking the 鈥淒isplay chart鈥� link in the 鈥淨uery results operations鈥� area.

+_images/query_result_operations.png +

A window layer 鈥淒isplay chart鈥� is shown in which you can customize the chart with the following options.

+
    +
  • Chart type: Allows you to choose the type of chart. Supported types are bar charts, column charts, line charts, spline charts, area charts, pie charts and timeline charts (only the chart types applicable for current series selection are offered).

  • +
  • X-axis: Allows to choose the field for the main axis.

  • +
  • Series: Allows to choose series for the chart. You can choose multiple series.

  • +
  • Title: Allows specifying a title for the chart which is displayed above the chart.

  • +
  • X-axis and Y-axis labels: Allows specifying labels for axes.

  • +
  • Start row and a number of rows: Allows generating charts only for a specified number of rows of the results set.

  • +
+_images/chart.png +
+

Chart implementation露

+

Charts in phpMyAdmin are drawn using jqPlot jQuery library.

+
+
+

Examples露

+
+

Pie chart露

+

Query results for a simple pie chart can be generated with:

+
SELECT 'Food' AS 'expense',
+   1250 AS 'amount' UNION
+SELECT 'Accommodation', 500 UNION
+SELECT 'Travel', 720 UNION
+SELECT 'Misc', 220
+
+
+

And the result of this query is:

+ ++++ + + + + + + + + + + + + + + + + + + + +

expense

amount

Food

1250

Accommodation

500

Travel

720

Misc

220

+

Choosing expense as the X-axis and amount in series:

+_images/pie_chart.png +
+
+

Bar and column chart露

+

Both bar charts and column chats support stacking. Upon selecting one of these types a checkbox is displayed to select stacking.

+

Query results for a simple bar or column chart can be generated with:

+
SELECT
+   'ACADEMY DINOSAUR' AS 'title',
+   0.99 AS 'rental_rate',
+   20.99 AS 'replacement_cost' UNION
+SELECT 'ACE GOLDFINGER', 4.99, 12.99 UNION
+SELECT 'ADAPTATION HOLES', 2.99, 18.99 UNION
+SELECT 'AFFAIR PREJUDICE', 2.99, 26.99 UNION
+SELECT 'AFRICAN EGG', 2.99, 22.99
+
+
+

And the result of this query is:

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

title

rental_rate

replacement_cost

ACADEMY DINOSAUR

0.99

20.99

ACE GOLDFINGER

4.99

12.99

ADAPTATION HOLES

2.99

18.99

AFFAIR PREJUDICE

2.99

26.99

AFRICAN EGG

2.99

22.99

+

Choosing title as the X-axis and rental_rate and replacement_cost as series:

+_images/column_chart.png +
+
+

Scatter chart露

+

Scatter charts are useful in identifying the movement of one or more variable(s) compared to another variable.

+

Using the same data set from bar and column charts section and choosing replacement_cost as the X-axis and rental_rate in series:

+_images/scatter_chart.png +
+
+

Line, spline and timeline charts露

+

These charts can be used to illustrate trends in underlying data. Spline charts draw smooth lines while timeline charts draw X-axis taking the distances between the dates/time into consideration.

+

Query results for a simple line, spline or timeline chart can be generated with:

+
SELECT
+   DATE('2006-01-08') AS 'date',
+   2056 AS 'revenue',
+   1378 AS 'cost' UNION
+SELECT DATE('2006-01-09'), 1898, 2301 UNION
+SELECT DATE('2006-01-15'), 1560, 600 UNION
+SELECT DATE('2006-01-17'), 3457, 1565
+
+
+

And the result of this query is:

+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + +

date

revenue

cost

2016-01-08

2056

1378

2006-01-09

1898

2301

2006-01-15

1560

600

2006-01-17

3457

1565

+_images/line_chart.png +_images/spline_chart.png +_images/timeline_chart.png +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/config.html b/phpMyAdmin/doc/html/config.html new file mode 100755 index 0000000..00f55ce --- /dev/null +++ b/phpMyAdmin/doc/html/config.html @@ -0,0 +1,5734 @@ + + + + + + + + Configuration — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Configuration露

+

All configurable data is placed in config.inc.php in phpMyAdmin鈥檚 +toplevel directory. If this file does not exist, please refer to the +Installation section to create one. This file only needs to contain the +parameters you want to change from their corresponding default value in +libraries/config.default.php (this file is not inteded for changes).

+
+

See also

+

Examples for examples of configurations

+
+

If a directive is missing from your file, you can just add another line with +the file. This file is for over-writing the defaults; if you wish to use the +default value there鈥檚 no need to add a line here.

+

The parameters which relate to design (like colors) are placed in +themes/themename/layout.inc.php. You might also want to create +config.footer.inc.php and config.header.inc.php files to add +your site specific code to be included on start and end of each page.

+
+

Note

+

Some distributions (eg. Debian or Ubuntu) store config.inc.php in +/etc/phpmyadmin instead of within phpMyAdmin sources.

+
+
+

Warning

+

Mac users should note that if you are on a version before +Mac OS X, PHP does not seem to +like Mac end of lines character (\r). So +ensure you choose the option that allows to use the *nix end of line +character (\n) in your text editor before saving a script you have +modified.

+
+
+

Basic settings露

+
+
+$cfg['PmaAbsoluteUri']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+
+

Changed in version 4.6.5: This setting was not available in phpMyAdmin 4.6.0 - 4.6.4.

+
+

Sets here the complete URL (with full path) to your phpMyAdmin +installation鈥檚 directory. E.g. +https://www.example.net/path_to_your_phpMyAdmin_directory/. Note also +that the URL on most of web servers are case sensitive (even on +Windows). Don鈥檛 forget the trailing slash at the end.

+

Starting with version 2.3.0, it is advisable to try leaving this blank. In +most cases phpMyAdmin automatically detects the proper setting. Users of +port forwarding or complex reverse proxy setup might need to set this.

+

A good test is to browse a table, edit a row and save it. There should be +an error message if phpMyAdmin is having trouble auto鈥揹etecting the correct +value. If you get an error that this must be set or if the autodetect code +fails to detect your path, please post a bug report on our bug tracker so +we can improve the code.

+ +
+ +
+
+$cfg['PmaNoRelation_DisableWarning']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Starting with version 2.3.0 phpMyAdmin offers a lot of features to +work with master / foreign 鈥� tables (see $cfg['Servers'][$i]['pmadb']).

+

If you tried to set this +up and it does not work for you, have a look on the Structure page +of one database where you would like to use it. You will find a link +that will analyze why those features have been disabled.

+

If you do not want to use those features set this variable to true to +stop this message from appearing.

+
+ +
+
+$cfg['AuthLog']露
+
+
Type
+

string

+
+
Default value
+

'auto'

+
+
+
+

New in version 4.8.0: This is supported since phpMyAdmin 4.8.0.

+
+

Configure authentication logging destination. Failed (or all, depending on +$cfg['AuthLogSuccess']) authentication attempts will be +logged according to this directive:

+
+
auto

Let phpMyAdmin automatically choose between syslog and php.

+
+
syslog

Log using syslog, using AUTH facility, on most systems this ends up +in /var/log/auth.log.

+
+
php

Log into PHP error log.

+
+
sapi

Log into PHP SAPI logging.

+
+
/path/to/file

Any other value is treated as a filename and log entries are written there.

+
+
+
+

Note

+

When logging to a file, make sure its permissions are correctly set +for a web server user, the setup should closely match instructions +described in $cfg['TempDir']:

+
+
+ +
+
+$cfg['AuthLogSuccess']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+
+

New in version 4.8.0: This is supported since phpMyAdmin 4.8.0.

+
+

Whether to log successful authentication attempts into +$cfg['AuthLog'].

+
+ +
+
+$cfg['SuhosinDisableWarning']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

A warning is displayed on the main page if Suhosin is detected.

+

You can set this parameter to true to stop this message from appearing.

+
+ +
+
+$cfg['LoginCookieValidityDisableWarning']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

A warning is displayed on the main page if the PHP parameter +session.gc_maxlifetime is lower than cookie validity configured in phpMyAdmin.

+

You can set this parameter to true to stop this message from appearing.

+
+ +
+
+$cfg['ServerLibraryDifference_DisableWarning']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+
+

Deprecated since version 4.7.0: This setting was removed as the warning has been removed as well.

+
+

A warning is displayed on the main page if there is a difference +between the MySQL library and server version.

+

You can set this parameter to true to stop this message from appearing.

+
+ +
+
+$cfg['ReservedWordDisableWarning']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

This warning is displayed on the Structure page of a table if one or more +column names match with words which are MySQL reserved.

+

If you want to turn off this warning, you can set it to true and +warning will no longer be displayed.

+
+ +
+
+$cfg['TranslationWarningThreshold']露
+
+
Type
+

integer

+
+
Default value
+

80

+
+
+

Show warning about incomplete translations on certain threshold.

+
+ +
+
+$cfg['SendErrorReports']露
+
+
Type
+

string

+
+
Default value
+

'ask'

+
+
+

Sets the default behavior for JavaScript error reporting.

+

Whenever an error is detected in the JavaScript execution, an error report +may be sent to the phpMyAdmin team if the user agrees.

+

The default setting of 'ask' will ask the user everytime there is a new +error report. However you can set this parameter to 'always' to send error +reports without asking for confirmation or you can set it to 'never' to +never send error reports.

+

This directive is available both in the configuration file and in users +preferences. If the person in charge of a multi-user installation prefers +to disable this feature for all users, a value of 'never' should be +set, and the $cfg['UserprefsDisallow'] directive should +contain 'SendErrorReports' in one of its array values.

+
+ +
+
+$cfg['ConsoleEnterExecutes']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Setting this to true allows the user to execute queries by pressing Enter +instead of Ctrl+Enter. A new line can be inserted by pressing Shift + Enter.

+

The behaviour of the console can be temporarily changed using console鈥檚 +settings interface.

+
+ +
+
+$cfg['AllowThirdPartyFraming']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Setting this to true allows phpMyAdmin to be included inside a frame, +and is a potential security hole allowing cross-frame scripting attacks or +clickjacking.

+
+ +
+
+

Server connection settings露

+
+
+$cfg['Servers']露
+
+
Type
+

array

+
+
Default value
+

one server array with settings listed below

+
+
+

Since version 1.4.2, phpMyAdmin supports the administration of multiple +MySQL servers. Therefore, a $cfg['Servers']-array has been +added which contains the login information for the different servers. The +first $cfg['Servers'][$i]['host'] contains the hostname of +the first server, the second $cfg['Servers'][$i]['host'] +the hostname of the second server, etc. In +libraries/config.default.php, there is only one section for server +definition, however you can put as many as you need in +config.inc.php, copy that block or needed parts (you don鈥檛 have to +define all settings, just those you need to change).

+
+

Note

+

The $cfg['Servers'] array starts with +$cfg[鈥楽ervers鈥橾[1]. Do not use $cfg[鈥楽ervers鈥橾[0]. If you want more +than one server, just copy following section (including $i +incrementation) serveral times. There is no need to define full server +array, just define values you need to change.

+
+
+ +
+
+$cfg['Servers'][$i]['host']露
+
+
Type
+

string

+
+
Default value
+

'localhost'

+
+
+

The hostname or IP address of your $i-th MySQL-server. E.g. +localhost.

+

Possible values are:

+
    +
  • hostname, e.g., 'localhost' or 'mydb.example.org'

  • +
  • IP address, e.g., '127.0.0.1' or '192.168.10.1'

  • +
  • IPv6 address, e.g. 2001:cdba:0000:0000:0000:0000:3257:9652

  • +
  • dot - '.', i.e., use named pipes on windows systems

  • +
  • empty - '', disables this server

  • +
+
+

Note

+

The hostname localhost is handled specially by MySQL and it uses +the socket based connection protocol. To use TCP/IP networking, use an +IP address or hostname such as 127.0.0.1 or db.example.com. You +can configure the path to the socket with +$cfg['Servers'][$i]['socket'].

+
+ +
+ +
+
+$cfg['Servers'][$i]['port']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

The port-number of your $i-th MySQL-server. Default is 3306 (leave +blank).

+
+

Note

+

If you use localhost as the hostname, MySQL ignores this port number +and connects with the socket, so if you want to connect to a port +different from the default port, use 127.0.0.1 or the real hostname +in $cfg['Servers'][$i]['host'].

+
+ +
+ +
+
+$cfg['Servers'][$i]['socket']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

The path to the socket to use. Leave blank for default. To determine +the correct socket, check your MySQL configuration or, using the +mysql command鈥搇ine client, issue the status command. Among the +resulting information displayed will be the socket used.

+
+

Note

+

This takes effect only if $cfg['Servers'][$i]['host'] is set +to localhost.

+
+ +
+ +
+
+$cfg['Servers'][$i]['ssl']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Whether to enable SSL for the connection between phpMyAdmin and the MySQL +server to secure the connection.

+

When using the 'mysql' extension, +none of the remaining 'ssl...' configuration options apply.

+

We strongly recommend the 'mysqli' extension when using this option.

+ +
+ +
+
+$cfg['Servers'][$i]['ssl_key']露
+
+
Type
+

string

+
+
Default value
+

NULL

+
+
+

Path to the client key file when using SSL for connecting to the MySQL +server. This is used to authenticate the client to the server.

+

For example:

+
$cfg['Servers'][$i]['ssl_key'] = '/etc/mysql/server-key.pem';
+
+
+ +
+ +
+
+$cfg['Servers'][$i]['ssl_cert']露
+
+
Type
+

string

+
+
Default value
+

NULL

+
+
+

Path to the client certificate file when using SSL for connecting to the +MySQL server. This is used to authenticate the client to the server.

+ +
+ +
+
+$cfg['Servers'][$i]['ssl_ca']露
+
+
Type
+

string

+
+
Default value
+

NULL

+
+
+

Path to the CA file when using SSL for connecting to the MySQL server.

+ +
+ +
+
+$cfg['Servers'][$i]['ssl_ca_path']露
+
+
Type
+

string

+
+
Default value
+

NULL

+
+
+

Directory containing trusted SSL CA certificates in PEM format.

+ +
+ +
+
+$cfg['Servers'][$i]['ssl_ciphers']露
+
+
Type
+

string

+
+
Default value
+

NULL

+
+
+

List of allowable ciphers for SSL connections to the MySQL server.

+ +
+ +
+
+$cfg['Servers'][$i]['ssl_verify']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+
+

New in version 4.6.0: This is supported since phpMyAdmin 4.6.0.

+
+

If your PHP install uses the MySQL Native Driver (mysqlnd), your +MySQL server is 5.6 or later, and your SSL certificate is self-signed, +there is a chance your SSL connection will fail due to validation. +Setting this to false will disable the validation check.

+

Since PHP 5.6.0 it also verifies whether server name matches CN of its +certificate. There is currently no way to disable just this check without +disabling complete SSL verification.

+
+

Warning

+

Disabling the certificate verification defeats purpose of using SSL. +This will make the connection vulnerable to man in the middle attacks.

+
+
+

Note

+

This flag only works with PHP 5.6.16 or later.

+
+ +
+ +
+
+$cfg['Servers'][$i]['connect_type']露
+
+
Type
+

string

+
+
Default value
+

'tcp'

+
+
+
+

Deprecated since version 4.7.0: This setting is no longer used as of 4.7.0, since MySQL decides the +connection type based on host, so it could lead to unexpected results. +Please set $cfg['Servers'][$i]['host'] accordingly +instead.

+
+

What type connection to use with the MySQL server. Your options are +'socket' and 'tcp'. It defaults to tcp as that is nearly guaranteed +to be available on all MySQL servers, while sockets are not supported on +some platforms. To use the socket mode, your MySQL server must be on the +same machine as the Web server.

+
+ +
+
+$cfg['Servers'][$i]['compress']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Whether to use a compressed protocol for the MySQL server connection +or not (experimental).

+
+ +
+
+$cfg['Servers'][$i]['controlhost']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Permits to use an alternate host to hold the configuration storage +data.

+ +
+ +
+
+$cfg['Servers'][$i]['controlport']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Permits to use an alternate port to connect to the host that +holds the configuration storage.

+ +
+ +
+
+$cfg['Servers'][$i]['controluser']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+
+ +
+
+$cfg['Servers'][$i]['controlpass']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

This special account is used to access phpMyAdmin configuration storage. +You don鈥檛 need it in single user case, but if phpMyAdmin is shared it +is recommended to give access to phpMyAdmin configuration storage only to this user +and configure phpMyAdmin to use it. All users will then be able to use +the features without need to have direct access to phpMyAdmin configuration storage.

+
+

Changed in version 2.2.5: those were called stduser and stdpass

+
+ +
+ +
+
+$cfg['Servers'][$i]['control_*']露
+
+
Type
+

mixed

+
+
+
+

New in version 4.7.0.

+
+

You can change any MySQL connection setting for control link (used to +access phpMyAdmin configuration storage) using configuration prefixed with control_.

+

This can be used to change any aspect of the control connection, which by +default uses same parameters as the user one.

+

For example you can configure SSL for the control connection:

+
// Enable SSL
+$cfg['Servers'][$i]['control_ssl'] = true;
+// Client secret key
+$cfg['Servers'][$i]['control_ssl_key'] = '../client-key.pem';
+// Client certificate
+$cfg['Servers'][$i]['control_ssl_cert'] = '../client-cert.pem';
+// Server certification authority
+$cfg['Servers'][$i]['control_ssl_ca'] = '../server-ca.pem';
+
+
+ +
+ +
+
+$cfg['Servers'][$i]['auth_type']露
+
+
Type
+

string

+
+
Default value
+

'cookie'

+
+
+

Whether config or cookie or HTTP or signon authentication should be +used for this server.

+
    +
  • 鈥榗onfig鈥� authentication ($auth_type = 'config') is the plain old +way: username and password are stored in config.inc.php.

  • +
  • 鈥榗ookie鈥� authentication mode ($auth_type = 'cookie') allows you to +log in as any valid MySQL user with the help of cookies.

  • +
  • 鈥榟ttp鈥� authentication allows you to log in as any +valid MySQL user via HTTP-Auth.

  • +
  • 鈥榮ignon鈥� authentication mode ($auth_type = 'signon') allows you to +log in from prepared PHP session data or using supplied PHP script.

  • +
+ +
+ +
+
+$cfg['Servers'][$i]['auth_http_realm']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

When using auth_type = http, this field allows to define a custom +HTTP Basic Auth Realm which will be displayed to the user. If not +explicitly specified in your configuration, a string combined of +鈥減hpMyAdmin 鈥� and either $cfg['Servers'][$i]['verbose'] or +$cfg['Servers'][$i]['host'] will be used.

+
+ +
+
+$cfg['Servers'][$i]['user']露
+
+
Type
+

string

+
+
Default value
+

'root'

+
+
+
+ +
+
+$cfg['Servers'][$i]['password']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

When using $cfg['Servers'][$i]['auth_type'] set to +鈥榗onfig鈥�, this is the user/password-pair which phpMyAdmin will use to +connect to the MySQL server. This user/password pair is not needed when +HTTP or cookie authentication is used +and should be empty.

+
+ +
+
+$cfg['Servers'][$i]['nopassword']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+
+

Deprecated since version 4.7.0: This setting was removed as it can produce unexpected results.

+
+

Allow attempt to log in without password when a login with password +fails. This can be used together with http authentication, when +authentication is done some other way and phpMyAdmin gets user name +from auth and uses empty password for connecting to MySQL. Password +login is still tried first, but as fallback, no password method is +tried.

+
+ +
+
+$cfg['Servers'][$i]['only_db']露
+
+
Type
+

string or array

+
+
Default value
+

''

+
+
+

If set to a (an array of) database name(s), only this (these) +database(s) will be shown to the user. Since phpMyAdmin 2.2.1, +this/these database(s) name(s) may contain MySQL wildcards characters +(鈥淿鈥� and 鈥�%鈥�): if you want to use literal instances of these +characters, escape them (I.E. use 'my\_db' and not 'my_db').

+

This setting is an efficient way to lower the server load since the +latter does not need to send MySQL requests to build the available +database list. But it does not replace the privileges rules of the +MySQL database server. If set, it just means only these databases +will be displayed but not that all other databases can鈥檛 be used.

+

An example of using more that one database:

+
$cfg['Servers'][$i]['only_db'] = array('db1', 'db2');
+
+
+
+

Changed in version 4.0.0: Previous versions permitted to specify the display order of +the database names via this directive.

+
+
+ +
+
+$cfg['Servers'][$i]['hide_db']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Regular expression for hiding some databases from unprivileged users. +This only hides them from listing, but a user is still able to access +them (using, for example, the SQL query area). To limit access, use +the MySQL privilege system. For example, to hide all databases +starting with the letter 鈥渁鈥�, use

+
$cfg['Servers'][$i]['hide_db'] = '^a';
+
+
+

and to hide both 鈥渄b1鈥� and 鈥渄b2鈥� use

+
$cfg['Servers'][$i]['hide_db'] = '^(db1|db2)$';
+
+
+

More information on regular expressions can be found in the PCRE +pattern syntax portion +of the PHP reference manual.

+
+ +
+
+$cfg['Servers'][$i]['verbose']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Only useful when using phpMyAdmin with multiple server entries. If +set, this string will be displayed instead of the hostname in the +pull-down menu on the main page. This can be useful if you want to +show only certain databases on your system, for example. For HTTP +auth, all non-US-ASCII characters will be stripped.

+
+ +
+
+$cfg['Servers'][$i]['extension']露
+
+
Type
+

string

+
+
Default value
+

'mysqli'

+
+
+

The PHP MySQL extension to use (mysql or mysqli).

+

It is recommended to use mysqli in all installations.

+
+ +
+
+$cfg['Servers'][$i]['pmadb']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

The name of the database containing the phpMyAdmin configuration +storage.

+

See the phpMyAdmin configuration storage section in this document to see the benefits of +this feature, and for a quick way of creating this database and the needed +tables.

+

If you are the only user of this phpMyAdmin installation, you can use your +current database to store those special tables; in this case, just put your +current database name in $cfg['Servers'][$i]['pmadb']. For a +multi-user installation, set this parameter to the name of your central +database containing the phpMyAdmin configuration storage.

+
+ +
+
+$cfg['Servers'][$i]['bookmarktable']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 2.2.0 phpMyAdmin allows users to bookmark queries. This +can be useful for queries you often run. To allow the usage of this +functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['relation']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 2.2.4 you can describe, in a special 鈥榬elation鈥� table, +which column is a key in another table (a foreign key). phpMyAdmin +currently uses this to:

+ +

The keys can be numeric or character.

+

To allow the usage of this functionality:

+
    +
  • set up $cfg['Servers'][$i]['pmadb'] and the phpMyAdmin configuration storage

  • +
  • put the relation table name in $cfg['Servers'][$i]['relation']

  • +
  • now as normal user open phpMyAdmin and for each one of your tables +where you want to use this feature, click Structure/Relation view/ +and choose foreign columns.

  • +
+

This feature can be disabled by setting the configuration to false.

+
+

Note

+

In the current version, master_db must be the same as foreign_db. +Those columns have been put in future development of the cross-db +relations.

+
+
+ +
+
+$cfg['Servers'][$i]['table_info']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 2.3.0 you can describe, in a special 鈥榯able_info鈥� +table, which column is to be displayed as a tool-tip when moving the +cursor over the corresponding key. This configuration variable will +hold the name of this special table. To allow the usage of this +functionality:

+
    +
  • set up $cfg['Servers'][$i]['pmadb'] and the phpMyAdmin configuration storage

  • +
  • put the table name in $cfg['Servers'][$i]['table_info'] (e.g. +pma__table_info)

  • +
  • then for each table where you want to use this feature, click +鈥淪tructure/Relation view/Choose column to display鈥� to choose the +column.

  • +
+

This feature can be disabled by setting the configuration to false.

+ +
+ +
+
+$cfg['Servers'][$i]['table_coords']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

The designer feature can save your page layout; by pressing the 鈥淪ave page鈥� or 鈥淪ave page as鈥� +button in the expanding designer menu, you can customize the layout and have it loaded the next +time you use the designer. That layout is stored in this table. Furthermore, this table is also +required for using the PDF relation export feature, see +$cfg['Servers'][$i]['pdf_pages'] for additional details.

+
+ +
+
+$cfg['Servers'][$i]['pdf_pages']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 2.3.0 you can have phpMyAdmin create PDF pages +showing the relations between your tables. Further, the designer interface +permits visually managing the relations. To do this it needs two tables +鈥減df_pages鈥� (storing information about the available PDF pages) +and 鈥渢able_coords鈥� (storing coordinates where each table will be placed on +a PDF schema output). You must be using the 鈥渞elation鈥� feature.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting either of the configurations to false.

+ +
+ +
+
+$cfg['Servers'][$i]['column_info']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

This part requires a content update! Since release 2.3.0 you can +store comments to describe each column for each table. These will then +be shown on the 鈥減rintview鈥�.

+

Starting with release 2.5.0, comments are consequently used on the table +property pages and table browse view, showing up as tool-tips above the +column name (properties page) or embedded within the header of table in +browse view. They can also be shown in a table dump. Please see the +relevant configuration directives later on.

+

Also new in release 2.5.0 is a MIME- transformation system which is also +based on the following table structure. See Transformations for +further information. To use the MIME- transformation system, your +column_info table has to have the three new columns 鈥榤imetype鈥�, +鈥榯ransformation鈥�, 鈥榯ransformation_options鈥�.

+

Starting with release 4.3.0, a new input-oriented transformation system +has been introduced. Also, backward compatibility code used in the old +transformations system was removed. As a result, an update to column_info +table is necessary for previous transformations and the new input-oriented +transformation system to work. phpMyAdmin will upgrade it automatically +for you by analyzing your current column_info table structure. +However, if something goes wrong with the auto-upgrade then you can +use the SQL script found in ./sql/upgrade_column_info_4_3_0+.sql +to upgrade it manually.

+

To allow the usage of this functionality:

+
    +
  • set up $cfg['Servers'][$i]['pmadb'] and the phpMyAdmin configuration storage

  • +
  • put the table name in $cfg['Servers'][$i]['column_info'] (e.g. +pma__column_info)

  • +
  • to update your PRE-2.5.0 Column_comments table use this: and +remember that the Variable in config.inc.php has been renamed from +$cfg['Servers'][$i]['column_comments'] to +$cfg['Servers'][$i]['column_info']

    +
    ALTER TABLE `pma__column_comments`
    +ADD `mimetype` VARCHAR( 255 ) NOT NULL,
    +ADD `transformation` VARCHAR( 255 ) NOT NULL,
    +ADD `transformation_options` VARCHAR( 255 ) NOT NULL;
    +
    +
    +
  • +
  • to update your PRE-4.3.0 Column_info table manually use this +./sql/upgrade_column_info_4_3_0+.sql SQL script.

  • +
+

This feature can be disabled by setting the configuration to false.

+
+

Note

+

For auto-upgrade functionality to work, your +$cfg['Servers'][$i]['controluser'] must have ALTER privilege on +phpmyadmin database. See the MySQL documentation for GRANT on how to +GRANT privileges to a user.

+
+
+ +
+
+$cfg['Servers'][$i]['history']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 2.5.0 you can store your SQL history, which means all +queries you entered manually into the phpMyAdmin interface. If you don鈥檛 +want to use a table-based history, you can use the JavaScript-based +history.

+

Using that, all your history items are deleted when closing the window. +Using $cfg['QueryHistoryMax'] you can specify an amount of +history items you want to have on hold. On every login, this list gets cut +to the maximum amount.

+

The query history is only available if JavaScript is enabled in +your browser.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['recent']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 3.5.0 you can show recently used tables in the +navigation panel. It helps you to jump across table directly, without +the need to select the database, and then select the table. Using +$cfg['NumRecentTables'] you can configure the maximum number +of recent tables shown. When you select a table from the list, it will jump to +the page specified in $cfg['NavigationTreeDefaultTabTable'].

+

Without configuring the storage, you can still access the recently used tables, +but it will disappear after you logout.

+

To allow the usage of this functionality persistently:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['favorite']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 4.2.0 you can show a list of selected tables in the +navigation panel. It helps you to jump to the table directly, without +the need to select the database, and then select the table. When you +select a table from the list, it will jump to the page specified in +$cfg['NavigationTreeDefaultTabTable'].

+

You can add tables to this list or remove tables from it in database +structure page by clicking on the star icons next to table names. Using +$cfg['NumFavoriteTables'] you can configure the maximum +number of favorite tables shown.

+

Without configuring the storage, you can still access the favorite tables, +but it will disappear after you logout.

+

To allow the usage of this functionality persistently:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['table_uiprefs']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 3.5.0 phpMyAdmin can be configured to remember several +things (sorted column $cfg['RememberSorting'], column order, +and column visibility from a database table) for browsing tables. Without +configuring the storage, these features still can be used, but the values will +disappear after you logout.

+

To allow the usage of these functionality persistently:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['users']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+
+ +
+
+$cfg['Servers'][$i]['usergroups']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 4.1.0 you can create different user groups with menu items +attached to them. Users can be assigned to these groups and the logged in +user would only see menu items configured to the usergroup he is assigned to. +To do this it needs two tables 鈥渦sergroups鈥� (storing allowed menu items for each +user group) and 鈥渦sers鈥� (storing users and their assignments to user groups).

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting either of the configurations to false.

+ +
+ +
+
+$cfg['Servers'][$i]['navigationhiding']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 4.1.0 you can hide/show items in the navigation tree.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['central_columns']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 4.3.0 you can have a central list of columns per database. +You can add/remove columns to the list as per your requirement. These columns +in the central list will be available to use while you create a new column for +a table or create a table itself. You can select a column from central list +while creating a new column, it will save you from writing the same column definition +over again or from writing different names for similar column.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['designer_settings']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 4.5.0 your designer settings can be remembered. +Your choice regarding 鈥楢ngular/Direct Links鈥�, 鈥楽nap to Grid鈥�, 鈥楾oggle Relation Lines鈥�, +鈥楽mall/Big All鈥�, 鈥楳ove Menu鈥� and 鈥楶in Text鈥� can be remembered persistently.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['savedsearches']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 4.2.0 you can save and load query-by-example searches from the Database > Query panel.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['export_templates']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 4.5.0 you can save and load export templates.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['tracking']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 3.3.x a tracking mechanism is available. It helps you to +track every SQL command which is +executed by phpMyAdmin. The mechanism supports logging of data +manipulation and data definition statements. After enabling it you can +create versions of tables.

+

The creation of a version has two effects:

+
    +
  • phpMyAdmin saves a snapshot of the table, including structure and +indexes.

  • +
  • phpMyAdmin logs all commands which change the structure and/or data of +the table and links these commands with the version number.

  • +
+

Of course you can view the tracked changes. On the Tracking +page a complete report is available for every version. For the report you +can use filters, for example you can get a list of statements within a date +range. When you want to filter usernames you can enter * for all names or +you enter a list of names separated by 鈥�,鈥�. In addition you can export the +(filtered) report to a file or to a temporary database.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['tracking_version_auto_create']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Whether the tracking mechanism creates versions for tables and views +automatically.

+

If this is set to true and you create a table or view with

+
    +
  • CREATE TABLE 鈥�

  • +
  • CREATE VIEW 鈥�

  • +
+

and no version exists for it, the mechanism will create a version for +you automatically.

+
+ +
+
+$cfg['Servers'][$i]['tracking_default_statements']露
+
+
Type
+

string

+
+
Default value
+

'CREATE TABLE,ALTER TABLE,DROP TABLE,RENAME TABLE,CREATE INDEX,DROP INDEX,INSERT,UPDATE,DELETE,TRUNCATE,REPLACE,CREATE VIEW,ALTER VIEW,DROP VIEW,CREATE DATABASE,ALTER DATABASE,DROP DATABASE'

+
+
+

Defines the list of statements the auto-creation uses for new +versions.

+
+ +
+
+$cfg['Servers'][$i]['tracking_add_drop_view']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether a DROP VIEW IF EXISTS statement will be added as first line to +the log when creating a view.

+
+ +
+
+$cfg['Servers'][$i]['tracking_add_drop_table']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether a DROP TABLE IF EXISTS statement will be added as first line +to the log when creating a table.

+
+ +
+
+$cfg['Servers'][$i]['tracking_add_drop_database']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether a DROP DATABASE IF EXISTS statement will be added as first +line to the log when creating a database.

+
+ +
+
+$cfg['Servers'][$i]['userconfig']露
+
+
Type
+

string or false

+
+
Default value
+

''

+
+
+

Since release 3.4.x phpMyAdmin allows users to set most preferences by +themselves and store them in the database.

+

If you don鈥檛 allow for storing preferences in +$cfg['Servers'][$i]['pmadb'], users can still personalize +phpMyAdmin, but settings will be saved in browser鈥檚 local storage, or, it +is is unavailable, until the end of session.

+

To allow the usage of this functionality:

+ +

This feature can be disabled by setting the configuration to false.

+
+ +
+
+$cfg['Servers'][$i]['MaxTableUiprefs']露
+
+
Type
+

integer

+
+
Default value
+

100

+
+
+

Maximum number of rows saved in +$cfg['Servers'][$i]['table_uiprefs'] table.

+

When tables are dropped or renamed, +$cfg['Servers'][$i]['table_uiprefs'] may contain invalid data +(referring to tables which no longer exist). We only keep this number of newest +rows in $cfg['Servers'][$i]['table_uiprefs'] and automatically +delete older rows.

+
+ +
+
+$cfg['Servers'][$i]['SessionTimeZone']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Sets the time zone used by phpMyAdmin. Leave blank to use the time zone of your +database server. Possible values are explained at +https://dev.mysql.com/doc/refman/5.7/en/time-zone-support.html

+

This is useful when your database server uses a time zone which is different from the +time zone you want to use in phpMyAdmin.

+
+ +
+
+$cfg['Servers'][$i]['AllowRoot']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether to allow root access. This is just a shortcut for the +$cfg['Servers'][$i]['AllowDeny']['rules'] below.

+
+ +
+
+$cfg['Servers'][$i]['AllowNoPassword']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Whether to allow logins without a password. The default value of +false for this parameter prevents unintended access to a MySQL +server with was left with an empty password for root or on which an +anonymous (blank) user is defined.

+
+ +
+
+$cfg['Servers'][$i]['AllowDeny']['order']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

If your rule order is empty, then IP +authorization is disabled.

+

If your rule order is set to +'deny,allow' then the system applies all deny rules followed by +allow rules. Access is allowed by default. Any client which does not +match a Deny command or does match an Allow command will be allowed +access to the server.

+

If your rule order is set to 'allow,deny' +then the system applies all allow rules followed by deny rules. Access +is denied by default. Any client which does not match an Allow +directive or does match a Deny directive will be denied access to the +server.

+

If your rule order is set to 'explicit', authorization is +performed in a similar fashion to rule order 鈥榙eny,allow鈥�, with the +added restriction that your host/username combination must be +listed in the allow rules, and not listed in the deny rules. This +is the most secure means of using Allow/Deny rules, and was +available in Apache by specifying allow and deny rules without setting +any order.

+

Please also see $cfg['TrustedProxies'] for +detecting IP address behind proxies.

+
+ +
+
+$cfg['Servers'][$i]['AllowDeny']['rules']露
+
+
Type
+

array of strings

+
+
Default value
+

array()

+
+
+

The general format for the rules is as such:

+
<'allow' | 'deny'> <username> [from] <ipmask>
+
+
+

If you wish to match all users, it is possible to use a '%' as a +wildcard in the username field.

+

There are a few shortcuts you can +use in the ipmask field as well (please note that those containing +SERVER_ADDRESS might not be available on all webservers):

+
'all' -> 0.0.0.0/0
+'localhost' -> 127.0.0.1/8
+'localnetA' -> SERVER_ADDRESS/8
+'localnetB' -> SERVER_ADDRESS/16
+'localnetC' -> SERVER_ADDRESS/24
+
+
+

Having an empty rule list is equivalent to either using 'allow % +from all' if your rule order is set to 'deny,allow' or 'deny % +from all' if your rule order is set to 'allow,deny' or +'explicit'.

+

For the IP address matching +system, the following work:

+
    +
  • xxx.xxx.xxx.xxx (an exact IP address)

  • +
  • xxx.xxx.xxx.[yyy-zzz] (an IP address range)

  • +
  • xxx.xxx.xxx.xxx/nn (CIDR, Classless Inter-Domain Routing type IP addresses)

  • +
+

But the following does not work:

+
    +
  • xxx.xxx.xxx.xx[yyy-zzz] (partial IP address range)

  • +
+

For IPv6 addresses, the following work:

+
    +
  • xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx (an exact IPv6 address)

  • +
  • xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:[yyyy-zzzz] (an IPv6 address range)

  • +
  • xxxx:xxxx:xxxx:xxxx/nn (CIDR, Classless Inter-Domain Routing type IPv6 addresses)

  • +
+

But the following does not work:

+
    +
  • xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx[yyy-zzz] (partial IPv6 address range)

  • +
+

Examples:

+
$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
+$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow bob from all');
+// Allow only 'bob' to connect from any host
+
+$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
+$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow mary from 192.168.100.[50-100]');
+// Allow only 'mary' to connect from host 192.168.100.50 through 192.168.100.100
+
+$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
+$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow % from 192.168.[5-6].10');
+// Allow any user to connect from host 192.168.5.10 or 192.168.6.10
+
+$cfg['Servers'][$i]['AllowDeny']['order'] = 'allow,deny';
+$cfg['Servers'][$i]['AllowDeny']['rules'] = array('allow root from 192.168.5.50','allow % from 192.168.6.10');
+// Allow any user to connect from 192.168.6.10, and additionally allow root to connect from 192.168.5.50
+
+
+
+ +
+
+$cfg['Servers'][$i]['DisableIS']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Disable using INFORMATION_SCHEMA to retrieve information (use +SHOW commands instead), because of speed issues when many +databases are present.

+
+

Note

+

Enabling this option might give you a big performance boost on older +MySQL servers.

+
+
+ +
+
+$cfg['Servers'][$i]['SignonScript']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+
+

New in version 3.5.0.

+
+

Name of PHP script to be sourced and executed to obtain login +credentials. This is alternative approach to session based single +signon. The script has to provide a function called +get_login_credentials which returns list of username and +password, accepting single parameter of existing username (can be +empty). See examples/signon-script.php for an example:

+
<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Single signon for phpMyAdmin
+ *
+ * This is just example how to use script based single signon with
+ * phpMyAdmin, it is not intended to be perfect code and look, only
+ * shows how you can integrate this functionality in your application.
+ *
+ * @package    PhpMyAdmin
+ * @subpackage Example
+ */
+
+
+/**
+ * This function returns username and password.
+ *
+ * It can optionally use configured username as parameter.
+ *
+ * @param string $user User name
+ *
+ * @return array
+ */
+function get_login_credentials($user)
+{
+    /* Optionally we can use passed username */
+    if (!empty($user)) {
+        return array($user, 'password');
+    }
+
+    /* Here we would retrieve the credentials */
+    $credentials = array('root', '');
+
+    return $credentials;
+}
+
+
+ +
+ +
+
+$cfg['Servers'][$i]['SignonSession']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Name of session which will be used for signon authentication method. +You should use something different than phpMyAdmin, because this +is session which phpMyAdmin uses internally. Takes effect only if +$cfg['Servers'][$i]['SignonScript'] is not configured.

+ +
+ +
+
+$cfg['Servers'][$i]['SignonCookieParams']露
+
+
Type
+

array

+
+
Default value
+

array()

+
+
+
+

New in version 4.7.0.

+
+

An associative array of session cookie parameters of other authentication system. +It is not needed if the other system doesn鈥檛 use session_set_cookie_params(). +Keys should include 鈥榣ifetime鈥�, 鈥榩ath鈥�, 鈥榙omain鈥�, 鈥榮ecure鈥� or 鈥榟ttponly鈥�. +Valid values are mentioned in session_get_cookie_params, they should be set to same values as the +other application uses. Takes effect only if +$cfg['Servers'][$i]['SignonScript'] is not configured.

+ +
+ +
+
+$cfg['Servers'][$i]['SignonURL']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

URL where user will be redirected +to log in for signon authentication method. Should be absolute +including protocol.

+ +
+ +
+
+$cfg['Servers'][$i]['LogoutURL']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

URL where user will be redirected +after logout (doesn鈥檛 affect config authentication method). Should be +absolute including protocol.

+
+ +
+
+$cfg['Servers'][$i]['hide_connection_errors']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+
+

New in version 4.9.8.

+
+

Whether to show or hide detailed MySQL/MariaDB connection errors on the login page.

+
+

Note

+

This error message can contain the target database server hostname or IP address, +which may reveal information about your network to an attacker.

+
+
+ +
+
+

Generic settings露

+
+
+$cfg['DisableShortcutKeys']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

You can disable phpMyAdmin shortcut keys by setting $cfg['DisableShortcutKeys'] to false.

+
+ +
+
+$cfg['ServerDefault']露
+
+
Type
+

integer

+
+
Default value
+

1

+
+
+

If you have more than one server configured, you can set +$cfg['ServerDefault'] to any one of them to autoconnect to that +server when phpMyAdmin is started, or set it to 0 to be given a list +of servers without logging in.

+

If you have only one server configured, +$cfg['ServerDefault'] MUST be set to that server.

+
+ +
+
+$cfg['VersionCheck']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Enables check for latest versions using JavaScript on the main phpMyAdmin +page or by directly accessing version_check.php.

+
+

Note

+

This setting can be adjusted by your vendor.

+
+
+ +
+
+$cfg['ProxyUrl']露
+
+
Type
+

string

+
+
Default value
+

鈥濃��

+

+
+
+

The url of the proxy to be used when phpmyadmin needs to access the outside +internet such as when retrieving the latest version info or submitting error +reports. You need this if the server where phpMyAdmin is installed does not +have direct access to the internet. +The format is: 鈥渉ostname:portnumber鈥�

+
+ +
+
+$cfg['ProxyUser']露
+
+
Type
+

string

+
+
Default value
+

鈥濃��

+

+
+
+

The username for authenticating with the proxy. By default, no +authentication is performed. If a username is supplied, Basic +Authentication will be performed. No other types of authentication +are currently supported.

+
+ +
+
+$cfg['ProxyPass']露
+
+
Type
+

string

+
+
Default value
+

鈥濃��

+

+
+
+

The password for authenticating with the proxy.

+
+ +
+
+$cfg['MaxDbList']露
+
+
Type
+

integer

+
+
Default value
+

100

+
+
+

The maximum number of database names to be displayed in the main panel鈥檚 +database list.

+
+ +
+
+$cfg['MaxTableList']露
+
+
Type
+

integer

+
+
Default value
+

250

+
+
+

The maximum number of table names to be displayed in the main panel鈥檚 +list (except on the Export page).

+
+ +
+
+$cfg['ShowHint']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether or not to show hints (for example, hints when hovering over +table headers).

+
+ +
+
+$cfg['MaxCharactersInDisplayedSQL']露
+
+
Type
+

integer

+
+
Default value
+

1000

+
+
+

The maximum number of characters when a SQL query is displayed. The +default limit of 1000 should be correct to avoid the display of tons of +hexadecimal codes that represent BLOBs, but some users have real +SQL queries that are longer than 1000 characters. Also, if a +query鈥檚 length exceeds this limit, this query is not saved in the history.

+
+ +
+
+$cfg['PersistentConnections']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Whether persistent connections should be used or not. Works with +following extensions:

+ +
+ +
+
+$cfg['ForceSSL']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+
+

Deprecated since version 4.6.0: This setting is no longer available since phpMyAdmin 4.6.0. Please +adjust your webserver instead.

+
+

Whether to force using https while accessing phpMyAdmin. In a reverse +proxy setup, setting this to true is not supported.

+
+

Note

+

In some setups (like separate SSL proxy or load balancer) you might +have to set $cfg['PmaAbsoluteUri'] for correct +redirection.

+
+
+ +
+
+$cfg['ExecTimeLimit']露
+
+
Type
+

integer [number of seconds]

+
+
Default value
+

300

+
+
+

Set the number of seconds a script is allowed to run. If seconds is +set to zero, no time limit is imposed. This setting is used while +importing/exporting dump files but has +no effect when PHP is running in safe mode.

+
+ +
+
+$cfg['SessionSavePath']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Path for storing session data (session_save_path PHP parameter).

+
+

Warning

+

This folder should not be publicly accessible through the webserver, +otherwise you risk leaking private data from your session.

+
+
+ +
+
+$cfg['MemoryLimit']露
+
+
Type
+

string [number of bytes]

+
+
Default value
+

'-1'

+
+
+

Set the number of bytes a script is allowed to allocate. If set to +'-1', no limit is imposed. If set to '0', no change of the +memory limit is attempted and the php.ini memory_limit is +used.

+

This setting is used while importing/exporting dump files +so you definitely don鈥檛 want to put here a too low +value. It has no effect when PHP is running in safe mode.

+

You can also use any string as in php.ini, eg. 鈥�16M鈥�. Ensure you +don鈥檛 omit the suffix (16 means 16 bytes!)

+
+ +
+
+$cfg['SkipLockedTables']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Mark used tables and make it possible to show databases with locked +tables (since MySQL 3.23.30).

+
+ +
+
+$cfg['ShowSQL']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether SQL queries +generated by phpMyAdmin should be displayed or not.

+
+ +
+
+$cfg['RetainQueryBox']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines whether the SQL query box +should be kept displayed after its submission.

+
+ +
+
+$cfg['CodemirrorEnable']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether to use a Javascript code editor for SQL query boxes. +CodeMirror provides syntax highlighting and line numbers. However, +middle-clicking for pasting the clipboard contents in some Linux +distributions (such as Ubuntu) is not supported by all browsers.

+
+ +
+
+$cfg['DefaultForeignKeyChecks']露
+
+
Type
+

string

+
+
Default value
+

'default'

+
+
+

Default value of the checkbox for foreign key checks, to disable/enable +foreign key checks for certain queries. The possible values are 'default', +'enable' or 'disable'. If set to 'default', the value of the +MySQL variable FOREIGN_KEY_CHECKS is used.

+
+ +
+
+$cfg['AllowUserDropDatabase']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+
+

Warning

+

This is not a security measure as there will be always ways to +circumvent this. If you want to prohibit users from dropping databases, +revoke their corresponding DROP privilege.

+
+

Defines whether normal users (non-administrator) are allowed to delete +their own database or not. If set as false, the link Drop +Database will not be shown, and even a DROP DATABASE mydatabase will +be rejected. Quite practical for ISP 鈥榮 with many customers.

+

This limitation of SQL queries is not as strict as when using MySQL +privileges. This is due to nature of SQL queries which might be +quite complicated. So this choice should be viewed as help to avoid +accidental dropping rather than strict privilege limitation.

+
+ +
+
+$cfg['Confirm']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether a warning (鈥淎re your really sure鈥︹��) should be displayed when +you鈥檙e about to lose data.

+
+ +
+
+$cfg['UseDbSearch']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Define whether the 鈥渟earch string inside database鈥� is enabled or not.

+
+ +
+
+$cfg['IgnoreMultiSubmitErrors']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Define whether phpMyAdmin will continue executing a multi-query +statement if one of the queries fails. Default is to abort execution.

+
+ +
+
+$cfg['URLQueryEncryption']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+
+

New in version 4.9.8.

+
+

Define whether phpMyAdmin will encrypt sensitive data (like database name +and table name) from the URL query string. Default is to not encrypt the URL +query string.

+
+ +
+
+$cfg['URLQueryEncryptionSecretKey']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+
+

New in version 4.9.8.

+
+

A secret key used to encrypt/decrypt the URL query string. +Should be 32 bytes long.

+
+ +
+ + +
+

Main panel露

+
+
+$cfg['ShowStats']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether or not to display space usage and statistics about +databases and tables. Note that statistics requires at least MySQL +3.23.3 and that, at this date, MySQL doesn鈥檛 return such information +for Berkeley DB tables.

+
+ +
+
+$cfg['ShowServerInfo']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether to display detailed server information on main page. +You can additionally hide more information by using +$cfg['Servers'][$i]['verbose'].

+
+ +
+
+$cfg['ShowPhpInfo']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines whether to display the PHP information or not at +the starting main (right) frame.

+

Please note that to block the usage of phpinfo() in scripts, you have to +put this in your php.ini:

+
disable_functions = phpinfo()
+
+
+
+

Warning

+

Enabling phpinfo page will leak quite a lot of information about server +setup. Is it not recommended to enable this on shared installations.

+

This might also make easier some remote attacks on your installations, +so enable this only when needed.

+
+
+ +
+
+$cfg['ShowChgPassword']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether to display the Change password link or not at +the starting main (right) frame. This setting does not check MySQL commands +entered directly.

+

Please note that enabling the Change password link has no effect +with config authentication mode: because of the hard coded password value +in the configuration file, end users can鈥檛 be allowed to change their +passwords.

+
+ +
+
+$cfg['ShowCreateDb']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether to display the form for creating database or not at the +starting main (right) frame. This setting does not check MySQL commands +entered directly.

+
+ +
+
+$cfg['ShowGitRevision']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether to display informations about the current Git revision (if +applicable) on the main panel.

+
+ +
+
+$cfg['MysqlMinVersion']露
+
+
Type
+

array

+
+
+

Defines the minimum supported MySQL version. The default is chosen +by the phpMyAdmin team; however this directive was asked by a developer +of the Plesk control panel to ease integration with older MySQL servers +(where most of the phpMyAdmin features work).

+
+ +
+
+

Database structure露

+
+
+$cfg['ShowDbStructureCreation']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines whether the database structure page (tables list) has a +鈥淐reation鈥� column that displays when each table was created.

+
+ +
+
+$cfg['ShowDbStructureLastUpdate']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines whether the database structure page (tables list) has a 鈥淟ast +update鈥� column that displays when each table was last updated.

+
+ +
+
+$cfg['ShowDbStructureLastCheck']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines whether the database structure page (tables list) has a 鈥淟ast +check鈥� column that displays when each table was last checked.

+
+ +
+
+$cfg['HideStructureActions']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether the table structure actions are hidden under a 鈥淢ore鈥� +drop-down.

+
+ +
+
+$cfg['ShowColumnComments']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether to show column comments as a column in the table structure view.

+
+ +
+
+

Browse mode露

+
+
+$cfg['TableNavigationLinksMode']露
+
+
Type
+

string

+
+
Default value
+

'icons'

+
+
+

Defines whether the table navigation links contain 'icons', 'text' +or 'both'.

+
+ +
+
+$cfg['ActionLinksMode']露
+
+
Type
+

string

+
+
Default value
+

'both'

+
+
+

If set to icons, will display icons instead of text for db and table +properties links (like Browse, Select, +Insert, 鈥�). Can be set to 'both' +if you want icons AND text. When set to text, will only show text.

+
+ +
+
+$cfg['RowActionType']露
+
+
Type
+

string

+
+
Default value
+

'both'

+
+
+

Whether to display icons or text or both icons and text in table row action +segment. Value can be either of 'icons', 'text' or 'both'.

+
+ +
+
+$cfg['ShowAll']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines whether a user should be displayed a 鈥淪how all鈥� button in browse +mode or not in all cases. By default it is shown only on small tables (less +than 500 rows) to avoid performance issues while getting too many rows.

+
+ +
+
+$cfg['MaxRows']露
+
+
Type
+

integer

+
+
Default value
+

25

+
+
+

Number of rows displayed when browsing a result set and no LIMIT +clause is used. If the result set contains more rows, 鈥淧revious鈥� and +鈥淣ext鈥� links will be shown. Possible values: 25,50,100,250,500.

+
+ +
+
+$cfg['Order']露
+
+
Type
+

string

+
+
Default value
+

'SMART'

+
+
+

Defines whether columns are displayed in ascending (ASC) order, in +descending (DESC) order or in a 鈥渟mart鈥� (SMART) order - I.E. +descending order for columns of type TIME, DATE, DATETIME and +TIMESTAMP, ascending order else- by default.

+
+

Changed in version 3.4.0: Since phpMyAdmin 3.4.0 the default value is 'SMART'.

+
+
+ +
+
+$cfg['GridEditing']露
+
+
Type
+

string

+
+
Default value
+

'double-click'

+
+
+

Defines which action (double-click or click) triggers grid +editing. Can be deactivated with the disabled value.

+
+ +
+
+$cfg['RelationalDisplay']露
+
+
Type
+

string

+
+
Default value
+

'K'

+
+
+

Defines the initial behavior for Options > Relational. K, which +is the default, displays the key while D shows the display column.

+
+ +
+
+$cfg['SaveCellsAtOnce']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines whether or not to save all edited cells at once for grid +editing.

+
+ +
+
+

Editing mode露

+
+
+$cfg['ProtectBinary']露
+
+
Type
+

boolean or string

+
+
Default value
+

'blob'

+
+
+

Defines whether BLOB or BINARY columns are protected from +editing when browsing a table鈥檚 content. Valid values are:

+
    +
  • false to allow editing of all columns;

  • +
  • 'blob' to allow editing of all columns except BLOBS;

  • +
  • 'noblob' to disallow editing of all columns except BLOBS (the +opposite of 'blob');

  • +
  • 'all' to disallow editing of all BINARY or BLOB columns.

  • +
+
+ +
+
+$cfg['ShowFunctionFields']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether or not MySQL functions fields should be initially +displayed in edit/insert mode. Since version 2.10, the user can toggle +this setting from the interface.

+
+ +
+
+$cfg['ShowFieldTypesInDataEditView']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether or not type fields should be initially displayed in +edit/insert mode. The user can toggle this setting from the interface.

+
+ +
+
+$cfg['InsertRows']露
+
+
Type
+

integer

+
+
Default value
+

2

+
+
+

Defines the default number of rows to be entered from the Insert page. +Users can manually change this from the bottom of that page to add or remove +blank rows.

+
+ +
+
+$cfg['ForeignKeyMaxLimit']露
+
+
Type
+

integer

+
+
Default value
+

100

+
+
+

If there are fewer items than this in the set of foreign keys, then a +drop-down box of foreign keys is presented, in the style described by +the $cfg['ForeignKeyDropdownOrder'] setting.

+
+ +
+
+$cfg['ForeignKeyDropdownOrder']露
+
+
Type
+

array

+
+
Default value
+

array(鈥榗ontent-id鈥�, 鈥榠d-content鈥�)

+
+
+

For the foreign key drop-down fields, there are several methods of +display, offering both the key and value data. The contents of the +array should be one or both of the following strings: content-id, +id-content.

+
+ +
+
+

Export and import settings露

+
+
+$cfg['ZipDump']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+
+ +
+
+$cfg['GZipDump']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+
+ +
+
+$cfg['BZipDump']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether to allow the use of zip/GZip/BZip2 compression when +creating a dump file

+
+ +
+
+$cfg['CompressOnFly']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether to allow on the fly compression for GZip/BZip2 +compressed exports. This doesn鈥檛 affect smaller dumps and allows users +to create larger dumps that won鈥檛 otherwise fit in memory due to php +memory limit. Produced files contain more GZip/BZip2 headers, but all +normal programs handle this correctly.

+
+ +
+
+$cfg['Export']露
+
+
Type
+

array

+
+
Default value
+

array(鈥�)

+
+
+

In this array are defined default parameters for export, names of +items are similar to texts seen on export page, so you can easily +identify what they mean.

+
+ +
+
+$cfg['Export']['format']露
+
+
Type
+

string

+
+
Default value
+

'sql'

+
+
+

Default export format.

+
+ +
+
+$cfg['Export']['method']露
+
+
Type
+

string

+
+
Default value
+

'quick'

+
+
+

Defines how the export form is displayed when it loads. Valid values +are:

+
    +
  • quick to display the minimum number of options to configure

  • +
  • custom to display every available option to configure

  • +
  • custom-no-form same as custom but does not display the option +of using quick export

  • +
+
+ +
+
+$cfg['Export']['charset']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Defines charset for generated export. By default no charset conversion is +done assuming UTF-8.

+
+ +
+
+$cfg['Export']['file_template_table']露
+
+
Type
+

string

+
+
Default value
+

'@TABLE@'

+
+
+

Default filename template for table exports.

+ +
+ +
+
+$cfg['Export']['file_template_database']露
+
+
Type
+

string

+
+
Default value
+

'@DATABASE@'

+
+
+

Default filename template for database exports.

+ +
+ +
+
+$cfg['Export']['file_template_server']露
+
+
Type
+

string

+
+
Default value
+

'@SERVER@'

+
+
+

Default filename template for server exports.

+ +
+ +
+
+$cfg['Import']露
+
+
Type
+

array

+
+
Default value
+

array(鈥�)

+
+
+

In this array are defined default parameters for import, names of +items are similar to texts seen on import page, so you can easily +identify what they mean.

+
+ +
+
+$cfg['Import']['charset']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Defines charset for import. By default no charset conversion is done +assuming UTF-8.

+
+ +
+
+

Tabs display settings露

+
+
+$cfg['TabsMode']露
+
+
Type
+

string

+
+
Default value
+

'both'

+
+
+

Defines whether the menu tabs contain 'icons', 'text' or 'both'.

+
+ +
+
+$cfg['PropertiesNumColumns']露
+
+
Type
+

integer

+
+
Default value
+

1

+
+
+

How many columns will be utilized to display the tables on the database +property view? When setting this to a value larger than 1, the type of the +database will be omitted for more display space.

+
+ +
+
+$cfg['DefaultTabServer']露
+
+
Type
+

string

+
+
Default value
+

'welcome'

+
+
+

Defines the tab displayed by default on server view. The possible values +are the localized equivalent of:

+
    +
  • welcome (recommended for multi-user setups)

  • +
  • databases,

  • +
  • status

  • +
  • variables

  • +
  • privileges

  • +
+
+ +
+
+$cfg['DefaultTabDatabase']露
+
+
Type
+

string

+
+
Default value
+

'structure'

+
+
+

Defines the tab displayed by default on database view. The possible values +are the localized equivalent of:

+
    +
  • structure

  • +
  • sql

  • +
  • search

  • +
  • operations

  • +
+
+ +
+
+$cfg['DefaultTabTable']露
+
+
Type
+

string

+
+
Default value
+

'browse'

+
+
+

Defines the tab displayed by default on table view. The possible values +are the localized equivalent of:

+
    +
  • structure

  • +
  • sql

  • +
  • search

  • +
  • insert

  • +
  • browse

  • +
+
+ +
+
+

PDF Options露

+
+
+$cfg['PDFPageSizes']露
+
+
Type
+

array

+
+
Default value
+

array('A3', 'A4', 'A5', 'letter', 'legal')

+
+
+

Array of possible paper sizes for creating PDF pages.

+

You should never need to change this.

+
+ +
+
+$cfg['PDFDefaultPageSize']露
+
+
Type
+

string

+
+
Default value
+

'A4'

+
+
+

Default page size to use when creating PDF pages. Valid values are any +listed in $cfg['PDFPageSizes'].

+
+ +
+
+

Languages露

+
+
+$cfg['DefaultLang']露
+
+
Type
+

string

+
+
Default value
+

'en'

+
+
+

Defines the default language to use, if not browser-defined or user- +defined. The corresponding language file needs to be in +locale/code/LC_MESSAGES/phpmyadmin.mo.

+
+ +
+
+$cfg['DefaultConnectionCollation']露
+
+
Type
+

string

+
+
Default value
+

'utf8mb4_general_ci'

+
+
+

Defines the default connection collation to use, if not user-defined. +See the MySQL documentation for charsets +for list of possible values.

+
+ +
+
+$cfg['Lang']露
+
+
Type
+

string

+
+
Default value
+

not set

+
+
+

Force language to use. The corresponding language file needs to be in +locale/code/LC_MESSAGES/phpmyadmin.mo.

+
+ +
+
+$cfg['FilterLanguages']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Limit list of available languages to those matching the given regular +expression. For example if you want only Czech and English, you should +set filter to '^(cs|en)'.

+
+ +
+
+$cfg['RecodingEngine']露
+
+
Type
+

string

+
+
Default value
+

'auto'

+
+
+

You can select here which functions will be used for character set +conversion. Possible values are:

+
    +
  • auto - automatically use available one (first is tested iconv, then +recode)

  • +
  • iconv - use iconv or libiconv functions

  • +
  • recode - use recode_string function

  • +
  • mb - use mbstring extension

  • +
  • none - disable encoding conversion

  • +
+

Enabled charset conversion activates a pull-down menu in the Export +and Import pages, to choose the character set when exporting a file. +The default value in this menu comes from +$cfg['Export']['charset'] and $cfg['Import']['charset'].

+
+ +
+
+$cfg['IconvExtraParams']露
+
+
Type
+

string

+
+
Default value
+

'//TRANSLIT'

+
+
+

Specify some parameters for iconv used in charset conversion. See +iconv documentation for details. By default +//TRANSLIT is used, so that invalid characters will be +transliterated.

+
+ +
+
+$cfg['AvailableCharsets']露
+
+
Type
+

array

+
+
Default value
+

array(鈥�)

+
+
+

Available character sets for MySQL conversion. You can add your own +(any of supported by recode/iconv) or remove these which you don鈥檛 +use. Character sets will be shown in same order as here listed, so if +you frequently use some of these move them to the top.

+
+ +
+
+

Web server settings露

+
+
+$cfg['OBGzip']露
+
+
Type
+

string/boolean

+
+
Default value
+

'auto'

+
+
+

Defines whether to use GZip output buffering for increased speed in +HTTP transfers. Set to +true/false for enabling/disabling. When set to 鈥榓uto鈥� (string), +phpMyAdmin tries to enable output buffering and will automatically +disable it if your browser has some problems with buffering. IE6 with +a certain patch is known to cause data corruption when having enabled +buffering.

+
+ +
+
+$cfg['TrustedProxies']露
+
+
Type
+

array

+
+
Default value
+

array()

+
+
+

Lists proxies and HTTP headers which are trusted for +$cfg['Servers'][$i]['AllowDeny']['order']. This list is by +default empty, you need to fill in some trusted proxy servers if you +want to use rules for IP addresses behind proxy.

+

The following example specifies that phpMyAdmin should trust a +HTTP_X_FORWARDED_FOR (X-Forwarded-For) header coming from the proxy +1.2.3.4:

+
$cfg['TrustedProxies'] = array('1.2.3.4' => 'HTTP_X_FORWARDED_FOR');
+
+
+

The $cfg['Servers'][$i]['AllowDeny']['rules'] directive uses the +client鈥檚 IP address as usual.

+
+ +
+
+$cfg['GD2Available']露
+
+
Type
+

string

+
+
Default value
+

'auto'

+
+
+

Specifies whether GD >= 2 is available. If yes it can be used for MIME +transformations. Possible values are:

+
    +
  • auto - automatically detect

  • +
  • yes - GD 2 functions can be used

  • +
  • no - GD 2 function cannot be used

  • +
+
+ +
+
+$cfg['CheckConfigurationPermissions']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

We normally check the permissions on the configuration file to ensure +it鈥檚 not world writable. However, phpMyAdmin could be installed on a +NTFS filesystem mounted on a non-Windows server, in which case the +permissions seems wrong but in fact cannot be detected. In this case a +sysadmin would set this parameter to false.

+
+ +
+
+$cfg['LinkLengthLimit']露
+
+
Type
+

integer

+
+
Default value
+

1000

+
+
+

Limit for length of URL in links. When length would be above this +limit, it is replaced by form with button. This is required as some web +servers (IIS) have problems with long URL .

+
+ +
+
+$cfg['CSPAllow']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Additional string to include in allowed script and image sources in Content +Security Policy header.

+

This can be useful when you want to include some external JavaScript files +in config.footer.inc.php or config.header.inc.php, which +would be normally not allowed by Content Security Policy.

+

To allow some sites, just list them within the string:

+
$cfg['CSPAllow'] = 'example.com example.net';
+
+
+
+

New in version 4.0.4.

+
+
+ +
+
+$cfg['DisableMultiTableMaintenance']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

In the database Structure page, it鈥檚 possible to mark some tables then +choose an operation like optimizing for many tables. This can slow +down a server; therefore, setting this to true prevents this kind +of multiple maintenance operation.

+
+ +
+
+

Theme settings露

+
+

Please directly modify themes/themename/layout.inc.php, although +your changes will be overwritten with the next update.

+
+
+
+

Design customization露

+
+
+$cfg['NavigationTreePointerEnable']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

When set to true, hovering over an item in the navigation panel causes that item to be marked +(the background is highlighted).

+
+ +
+
+$cfg['BrowsePointerEnable']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

When set to true, hovering over a row in the Browse page causes that row to be marked (the background +is highlighted).

+
+ +
+
+$cfg['BrowseMarkerEnable']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

When set to true, a data row is marked (the background is highlighted) when the row is selected +with the checkbox.

+
+ +
+
+$cfg['LimitChars']露
+
+
Type
+

integer

+
+
Default value
+

50

+
+
+

Maximum number of characters shown in any non-numeric field on browse +view. Can be turned off by a toggle button on the browse page.

+
+ +
+ +
+
Type
+

string

+
+
Default value
+

'left'

+
+
+

Defines the place where table row links (Edit, Copy, Delete) would be +put when tables contents are displayed (you may have them displayed at +the left side, right side, both sides or nowhere).

+
+ +
+
+$cfg['RowActionLinksWithoutUnique']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines whether to show row links (Edit, Copy, Delete) and checkboxes +for multiple row operations even when the selection does not have a unique key. +Using row actions in the absence of a unique key may result in different/more +rows being affected since there is no guaranteed way to select the exact row(s).

+
+ +
+
+$cfg['RememberSorting']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

If enabled, remember the sorting of each table when browsing them.

+
+ +
+
+$cfg['TablePrimaryKeyOrder']露
+
+
Type
+

string

+
+
Default value
+

'NONE'

+
+
+

This defines the default sort order for the tables, having a primary key, +when there is no sort order defines externally. +Acceptable values : [鈥楴ONE鈥�, 鈥楢SC鈥�, 鈥楧ESC鈥橾

+
+ +
+
+$cfg['ShowBrowseComments']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+
+ +
+
+$cfg['ShowPropertyComments']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

By setting the corresponding variable to true you can enable the +display of column comments in Browse or Property display. In browse +mode, the comments are shown inside the header. In property mode, +comments are displayed using a CSS-formatted dashed-line below the +name of the column. The comment is shown as a tool-tip for that +column.

+
+ +
+
+

Text fields露

+
+
+$cfg['CharEditing']露
+
+
Type
+

string

+
+
Default value
+

'input'

+
+
+

Defines which type of editing controls should be used for CHAR and +VARCHAR columns. Applies to data editing and also to the default values +in structure editing. Possible values are:

+
    +
  • input - this allows to limit size of text to size of columns in MySQL, +but has problems with newlines in columns

  • +
  • textarea - no problems with newlines in columns, but also no length +limitations

  • +
+
+ +
+
+$cfg['MinSizeForInputField']露
+
+
Type
+

integer

+
+
Default value
+

4

+
+
+

Defines the minimum size for input fields generated for CHAR and +VARCHAR columns.

+
+ +
+
+$cfg['MaxSizeForInputField']露
+
+
Type
+

integer

+
+
Default value
+

60

+
+
+

Defines the maximum size for input fields generated for CHAR and +VARCHAR columns.

+
+ +
+
+$cfg['TextareaCols']露
+
+
Type
+

integer

+
+
Default value
+

40

+
+
+
+ +
+
+$cfg['TextareaRows']露
+
+
Type
+

integer

+
+
Default value
+

15

+
+
+
+ +
+
+$cfg['CharTextareaCols']露
+
+
Type
+

integer

+
+
Default value
+

40

+
+
+
+ +
+
+$cfg['CharTextareaRows']露
+
+
Type
+

integer

+
+
Default value
+

2

+
+
+

Number of columns and rows for the textareas. This value will be +emphasized (*2) for SQL query +textareas and (*1.25) for SQL +textareas inside the query window.

+

The Char* values are used for CHAR +and VARCHAR editing (if configured via $cfg['CharEditing']).

+
+ +
+
+$cfg['LongtextDoubleTextarea']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Defines whether textarea for LONGTEXT columns should have double size.

+
+ +
+
+$cfg['TextareaAutoSelect']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Defines if the whole textarea of the query box will be selected on +click.

+
+ +
+
+$cfg['EnableAutocompleteForTablesAndColumns']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether to enable autocomplete for table and column names in any +SQL query box.

+
+ +
+
+

SQL query box settings露

+
+
+$cfg['SQLQuery']['Edit']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether to display an edit link to change a query in any SQL Query +box.

+
+ +
+
+$cfg['SQLQuery']['Explain']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether to display a link to explain a SELECT query in any SQL Query +box.

+
+ +
+
+$cfg['SQLQuery']['ShowAsPHP']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether to display a link to wrap a query in PHP code in any SQL Query +box.

+
+ +
+
+$cfg['SQLQuery']['Refresh']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Whether to display a link to refresh a query in any SQL Query box.

+
+ +
+
+

Web server upload/save/import directories露

+

If PHP is running in safe mode, all directories must be owned by the same user +as the owner of the phpMyAdmin scripts.

+

If the directory where phpMyAdmin is installed is subject to an +open_basedir restriction, you need to create a temporary directory in some +directory accessible by the PHP interpreter.

+

For security reasons, all directories should be outside the tree published by +webserver. If you cannot avoid having this directory published by webserver, +limit access to it either by web server configuration (for example using +.htaccess or web.config files) or place at least an empty index.html +file there, so that directory listing is not possible. However as long as the +directory is accessible by web server, an attacker can guess filenames to download +the files.

+
+
+$cfg['UploadDir']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

The name of the directory where SQL files have been uploaded by +other means than phpMyAdmin (for example, ftp). Those files are available +under a drop-down box when you click the database or table name, then the +Import tab.

+

If +you want different directory for each user, %u will be replaced with +username.

+

Please note that the file names must have the suffix 鈥�.sql鈥� +(or 鈥�.sql.bz2鈥� or 鈥�.sql.gz鈥� if support for compressed formats is +enabled).

+

This feature is useful when your file is too big to be +uploaded via HTTP, or when file +uploads are disabled in PHP.

+
+

Warning

+

Please see top of this chapter (Web server upload/save/import directories) for instructions how +to setup this directory and how to make its usage secure.

+
+ +
+ +
+
+$cfg['SaveDir']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

The name of the webserver directory where exported files can be saved.

+

If you want a different directory for each user, %u will be replaced with the +username.

+

Please note that the directory must exist and has to be writable for +the user running webserver.

+
+

Warning

+

Please see top of this chapter (Web server upload/save/import directories) for instructions how +to setup this directory and how to make its usage secure.

+
+
+ +
+
+$cfg['TempDir']露
+
+
Type
+

string

+
+
Default value
+

'./tmp/'

+
+
+

The name of the directory where temporary files can be stored. It is used +for several purposes, currently:

+ +

This directory should have as strict permissions as possible as the only +user required to access this directory is the one who runs the webserver. +If you have root privileges, simply make this user owner of this directory +and make it accessible only by it:

+
chown www-data:www-data tmp
+chmod 700 tmp
+
+
+

If you cannot change owner of the directory, you can achieve a similar +setup using ACL:

+
chmod 700 tmp
+setfacl -m "g:www-data:rwx" tmp
+setfacl -d -m "g:www-data:rwx" tmp
+
+
+

If neither of above works for you, you can still make the directory +chmod 777, but it might impose risk of other users on system +reading and writing data in this directory.

+
+

Warning

+

Please see top of this chapter (Web server upload/save/import directories) for instructions how +to setup this directory and how to make its usage secure.

+
+
+ +
+
+

Various display setting露

+
+
+$cfg['RepeatCells']露
+
+
Type
+

integer

+
+
Default value
+

100

+
+
+

Repeat the headers every X cells, or 0 to deactivate.

+
+ +
+
+$cfg['QueryHistoryDB']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+
+ +
+
+$cfg['QueryHistoryMax']露
+
+
Type
+

integer

+
+
Default value
+

25

+
+
+

If $cfg['QueryHistoryDB'] is set to true, all your +Queries are logged to a table, which has to be created by you (see +$cfg['Servers'][$i]['history']). If set to false, all your +queries will be appended to the form, but only as long as your window is +opened they remain saved.

+

When using the JavaScript based query window, it will always get updated +when you click on a new table/db to browse and will focus if you click on +Edit SQL after using a query. You can suppress updating the +query window by checking the box Do not overwrite this query +from outside the window below the query textarea. Then you can browse +tables/databases in the background without losing the contents of the +textarea, so this is especially useful when composing a query with tables +you first have to look in. The checkbox will get automatically checked +whenever you change the contents of the textarea. Please uncheck the button +whenever you definitely want the query window to get updated even though +you have made alterations.

+

If $cfg['QueryHistoryDB'] is set to true you can +specify the amount of saved history items using +$cfg['QueryHistoryMax'].

+
+ +
+
+$cfg['BrowseMIME']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Enable Transformations.

+
+ +
+
+$cfg['MaxExactCount']露
+
+
Type
+

integer

+
+
Default value
+

50000

+
+
+

For InnoDB tables, determines for how large tables phpMyAdmin should +get the exact row count using SELECT COUNT. If the approximate row +count as returned by SHOW TABLE STATUS is smaller than this value, +SELECT COUNT will be used, otherwise the approximate count will be +used.

+
+

Changed in version 4.8.0: The default value was lowered to 50000 for performance reasons.

+
+
+

Changed in version 4.2.6: The default value was changed to 500000.

+
+ +
+ +
+
+$cfg['MaxExactCountViews']露
+
+
Type
+

integer

+
+
Default value
+

0

+
+
+

For VIEWs, since obtaining the exact count could have an impact on +performance, this value is the maximum to be displayed, using a +SELECT COUNT ... LIMIT. Setting this to 0 bypasses any row +counting.

+
+ +
+
+$cfg['NaturalOrder']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Sorts database and table names according to natural order (for +example, t1, t2, t10). Currently implemented in the navigation panel +and in Database view, for the table list.

+
+ +
+
+$cfg['InitialSlidersState']露
+
+
Type
+

string

+
+
Default value
+

'closed'

+
+
+

If set to 'closed', the visual sliders are initially in a closed +state. A value of 'open' does the reverse. To completely disable +all visual sliders, use 'disabled'.

+
+ +
+
+$cfg['UserprefsDisallow']露
+
+
Type
+

array

+
+
Default value
+

array()

+
+
+

Contains names of configuration options (keys in $cfg array) that +users can鈥檛 set through user preferences. For possible values, refer +to clases under libraries/classes/Config/Forms/User/.

+
+ +
+
+$cfg['UserprefsDeveloperTab']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Activates in the user preferences a tab containing options for +developers of phpMyAdmin.

+
+ +
+
+

Page titles露

+
+
+$cfg['TitleTable']露
+
+
Type
+

string

+
+
Default value
+

'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ / @TABLE@ | @PHPMYADMIN@'

+
+
+
+ +
+
+$cfg['TitleDatabase']露
+
+
Type
+

string

+
+
Default value
+

'@HTTP_HOST@ / @VSERVER@ / @DATABASE@ | @PHPMYADMIN@'

+
+
+
+ +
+
+$cfg['TitleServer']露
+
+
Type
+

string

+
+
Default value
+

'@HTTP_HOST@ / @VSERVER@ | @PHPMYADMIN@'

+
+
+
+ +
+
+$cfg['TitleDefault']露
+
+
Type
+

string

+
+
Default value
+

'@HTTP_HOST@ | @PHPMYADMIN@'

+
+
+

Allows you to specify window鈥檚 title bar. You can use 6.27 What format strings can I use?.

+
+ +
+
+

Theme manager settings露

+
+
+$cfg['ThemeManager']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Enables user-selectable themes. See 2.7 Using and creating themes.

+
+ +
+
+$cfg['ThemeDefault']露
+
+
Type
+

string

+
+
Default value
+

'pmahomme'

+
+
+

The default theme (a subdirectory under ./themes/).

+
+ +
+
+$cfg['ThemePerServer']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Whether to allow different theme for each server.

+
+ +
+
+$cfg['FontSize']露
+
+
Type
+

string

+
+
Default value
+

鈥�82%鈥�

+
+
+

Font size to use, is applied in CSS.

+
+ +
+
+

Default queries露

+
+
+$cfg['DefaultQueryTable']露
+
+
Type
+

string

+
+
Default value
+

'SELECT * FROM @TABLE@ WHERE 1'

+
+
+
+ +
+
+$cfg['DefaultQueryDatabase']露
+
+
Type
+

string

+
+
Default value
+

''

+
+
+

Default queries that will be displayed in query boxes when user didn鈥檛 +specify any. You can use standard 6.27 What format strings can I use?.

+
+ +
+
+

MySQL settings露

+
+
+$cfg['DefaultFunctions']露
+
+
Type
+

array

+
+
Default value
+

array(鈥�)

+
+
+

Functions selected by default when inserting/changing row, Functions +are defined for meta types as (FUNC_NUMBER, FUNC_DATE, FUNC_CHAR, +FUNC_SPATIAL, FUNC_UUID) and for first_timestamp, which is used +for first timestamp column in table.

+
+ +
+
+

Default options for Transformations露

+
+
+$cfg['DefaultTransformations']露
+
+
Type
+

array

+
+
Default value
+

An array with below listed key-values

+
+
+
+ +
+
+$cfg['DefaultTransformations']['Substring']露
+
+
Type
+

array

+
+
Default value
+

array(0, 鈥榓ll鈥�, 鈥樷�︹��)

+
+
+
+ +
+
+$cfg['DefaultTransformations']['Bool2Text']露
+
+
Type
+

array

+
+
Default value
+

array(鈥楾鈥�, 鈥楩鈥�)

+
+
+
+ +
+
+$cfg['DefaultTransformations']['External']露
+
+
Type
+

array

+
+
Default value
+

array(0, 鈥�-f /dev/null -i -wrap -q鈥�, 1, 1)

+
+
+
+ +
+
+$cfg['DefaultTransformations']['PreApPend']露
+
+
Type
+

array

+
+
Default value
+

array(鈥樷��, 鈥樷��)

+
+
+
+ +
+
+$cfg['DefaultTransformations']['Hex']露
+
+
Type
+

array

+
+
Default value
+

array(鈥�2鈥�)

+
+
+
+ +
+
+$cfg['DefaultTransformations']['DateFormat']露
+
+
Type
+

array

+
+
Default value
+

array(0, 鈥樷��, 鈥榣ocal鈥�)

+
+
+
+ +
+
+$cfg['DefaultTransformations']['Inline']露
+
+
Type
+

array

+
+
Default value
+

array(鈥�100鈥�, 100)

+
+
+
+ +
+ +
+
Type
+

array

+
+
Default value
+

array(鈥樷��, 100, 50)

+
+
+
+ +
+ +
+
Type
+

array

+
+
Default value
+

array(鈥樷��, 鈥樷��, 鈥樷��)

+
+
+
+ +
+
+

Console settings露

+
+

Note

+

These settings are mostly meant to be changed by user.

+
+
+
+$cfg['Console']['StartHistory']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Show query history at start

+
+ +
+
+$cfg['Console']['AlwaysExpand']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Always expand query messages

+
+ +
+
+$cfg['Console']['CurrentQuery']露
+
+
Type
+

boolean

+
+
Default value
+

true

+
+
+

Show current browsing query

+
+ +
+
+$cfg['Console']['EnterExecutes']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Execute queries on Enter and insert new line with Shift + Enter

+
+ +
+
+$cfg['Console']['DarkTheme']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Switch to dark theme

+
+ +
+
+$cfg['Console']['Mode']露
+
+
Type
+

string

+
+
Default value
+

鈥榠nfo鈥�

+
+
+

Console mode

+
+ +
+
+$cfg['Console']['Height']露
+
+
Type
+

integer

+
+
Default value
+

92

+
+
+

Console height

+
+ +
+
+

Developer露

+
+

Warning

+

These settings might have huge effect on performance or security.

+
+
+
+$cfg['DBG']露
+
+
Type
+

array

+
+
Default value
+

array(鈥�)

+
+
+
+ +
+
+$cfg['DBG']['sql']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Enable logging queries and execution times to be +displayed in the console鈥檚 Debug SQL tab.

+
+ +
+
+$cfg['DBG']['sqllog']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Enable logging of queries and execution times to the syslog. +Requires $cfg['DBG']['sql'] to be enabled.

+
+ +
+
+$cfg['DBG']['demo']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Enable to let server present itself as demo server. +This is used for phpMyAdmin demo server.

+

It currently changes following behavior:

+
    +
  • There is welcome message on the main page.

  • +
  • There is footer information about demo server and used git revision.

  • +
  • The setup script is enabled even with existing configuration.

  • +
  • The setup does not try to connect to the MySQL server.

  • +
+
+ +
+
+$cfg['DBG']['simple2fa']露
+
+
Type
+

boolean

+
+
Default value
+

false

+
+
+

Can be used for testing two-factor authentication using Simple two-factor authentication.

+
+ +
+
+

Examples露

+

See following configuration snippets for typical setups of phpMyAdmin.

+
+

Basic example露

+

Example configuration file, which can be copied to config.inc.php to +get some core configuration layout; it is distributed with phpMyAdmin as +config.sample.inc.php. Please note that it does not contain all +configuration options, only the most frequently used ones.

+
<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * phpMyAdmin sample configuration, you can use it as base for
+ * manual configuration. For easier setup you can use setup/
+ *
+ * All directives are explained in documentation in the doc/ folder
+ * or at <https://docs.phpmyadmin.net/>.
+ *
+ * @package PhpMyAdmin
+ */
+
+/**
+ * This is needed for cookie based authentication to encrypt password in
+ * cookie. Needs to be 32 chars long.
+ */
+$cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
+
+/**
+ * Servers configuration
+ */
+$i = 0;
+
+/**
+ * First server
+ */
+$i++;
+/* Authentication type */
+$cfg['Servers'][$i]['auth_type'] = 'cookie';
+/* Server parameters */
+$cfg['Servers'][$i]['host'] = 'localhost';
+$cfg['Servers'][$i]['compress'] = false;
+$cfg['Servers'][$i]['AllowNoPassword'] = false;
+
+/**
+ * phpMyAdmin configuration storage settings.
+ */
+
+/* User used to manipulate with storage */
+// $cfg['Servers'][$i]['controlhost'] = '';
+// $cfg['Servers'][$i]['controlport'] = '';
+// $cfg['Servers'][$i]['controluser'] = 'pma';
+// $cfg['Servers'][$i]['controlpass'] = 'pmapass';
+
+/* Storage database and tables */
+// $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
+// $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
+// $cfg['Servers'][$i]['relation'] = 'pma__relation';
+// $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
+// $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
+// $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
+// $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
+// $cfg['Servers'][$i]['history'] = 'pma__history';
+// $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
+// $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
+// $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
+// $cfg['Servers'][$i]['recent'] = 'pma__recent';
+// $cfg['Servers'][$i]['favorite'] = 'pma__favorite';
+// $cfg['Servers'][$i]['users'] = 'pma__users';
+// $cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
+// $cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
+// $cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
+// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
+// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
+// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
+
+/**
+ * End of servers configuration
+ */
+
+/**
+ * Directories for saving/loading files from server
+ */
+$cfg['UploadDir'] = '';
+$cfg['SaveDir'] = '';
+
+/**
+ * Whether to display icons or text or both icons and text in table row
+ * action segment. Value can be either of 'icons', 'text' or 'both'.
+ * default = 'both'
+ */
+//$cfg['RowActionType'] = 'icons';
+
+/**
+ * Defines whether a user should be displayed a "show all (records)"
+ * button in browse mode or not.
+ * default = false
+ */
+//$cfg['ShowAll'] = true;
+
+/**
+ * Number of rows displayed when browsing a result set. If the result
+ * set contains more rows, "Previous" and "Next".
+ * Possible values: 25, 50, 100, 250, 500
+ * default = 25
+ */
+//$cfg['MaxRows'] = 50;
+
+/**
+ * Disallow editing of binary fields
+ * valid values are:
+ *   false    allow editing
+ *   'blob'   allow editing except for BLOB fields
+ *   'noblob' disallow editing except for BLOB fields
+ *   'all'    disallow editing
+ * default = 'blob'
+ */
+//$cfg['ProtectBinary'] = false;
+
+/**
+ * Default language to use, if not browser-defined or user-defined
+ * (you find all languages in the locale folder)
+ * uncomment the desired line:
+ * default = 'en'
+ */
+//$cfg['DefaultLang'] = 'en';
+//$cfg['DefaultLang'] = 'de';
+
+/**
+ * How many columns should be used for table display of a database?
+ * (a value larger than 1 results in some information being hidden)
+ * default = 1
+ */
+//$cfg['PropertiesNumColumns'] = 2;
+
+/**
+ * Set to true if you want DB-based query history.If false, this utilizes
+ * JS-routines to display query history (lost by window close)
+ *
+ * This requires configuration storage enabled, see above.
+ * default = false
+ */
+//$cfg['QueryHistoryDB'] = true;
+
+/**
+ * When using DB-based query history, how many entries should be kept?
+ * default = 25
+ */
+//$cfg['QueryHistoryMax'] = 100;
+
+/**
+ * Whether or not to query the user before sending the error report to
+ * the phpMyAdmin team when a JavaScript error occurs
+ *
+ * Available options
+ * ('ask' | 'always' | 'never')
+ * default = 'ask'
+ */
+//$cfg['SendErrorReports'] = 'always';
+
+/**
+ * 'URLQueryEncryption' defines whether phpMyAdmin will encrypt sensitive data from the URL query string.
+ * 'URLQueryEncryptionSecretKey' is a 32 bytes long secret key used to encrypt/decrypt the URL query string.
+ */
+//$cfg['URLQueryEncryption'] = true;
+//$cfg['URLQueryEncryptionSecretKey'] = '';
+
+/**
+ * You can find more configuration options in the documentation
+ * in the doc/ folder or at <https://docs.phpmyadmin.net/>.
+ */
+
+
+
+

Warning

+

Don鈥檛 use the controluser 鈥榩ma鈥� if it does not yet exist and don鈥檛 use 鈥榩mapass鈥� +as password.

+
+
+
+

Example for signon authentication露

+

This example uses examples/signon.php to demonstrate usage of Signon authentication mode:

+
<?php
+$i = 0;
+$i++;
+$cfg['Servers'][$i]['extension']     = 'mysqli';
+$cfg['Servers'][$i]['auth_type']     = 'signon';
+$cfg['Servers'][$i]['SignonSession'] = 'SignonSession';
+$cfg['Servers'][$i]['SignonURL']     = 'examples/signon.php';
+?>`
+
+
+
+
+

Example for IP address limited autologin露

+

If you want to automatically login when accessing phpMyAdmin locally while asking +for a password when accessing remotely, you can achieve it using following snippet:

+
if ($_SERVER["REMOTE_ADDR"] == "127.0.0.1") {
+    $cfg['Servers'][$i]['auth_type'] = 'config';
+    $cfg['Servers'][$i]['user'] = 'root';
+    $cfg['Servers'][$i]['password'] = 'yourpassword';
+} else {
+    $cfg['Servers'][$i]['auth_type'] = 'cookie';
+}
+
+
+
+

Note

+

Filtering based on IP addresses isn鈥檛 reliable over the internet, use it +only for local address.

+
+
+
+

Example for using multiple MySQL servers露

+

You can configure any number of servers using $cfg['Servers'], +following example shows two of them:

+
<?php
+$cfg['blowfish_secret']='multiServerExample70518';
+//any string of your choice
+$i = 0;
+
+$i++; // server 1 :
+$cfg['Servers'][$i]['auth_type'] = 'cookie';
+$cfg['Servers'][$i]['verbose']   = 'no1';
+$cfg['Servers'][$i]['host']      = 'localhost';
+$cfg['Servers'][$i]['extension'] = 'mysqli';
+// more options for #1 ...
+
+$i++; // server 2 :
+$cfg['Servers'][$i]['auth_type'] = 'cookie';
+$cfg['Servers'][$i]['verbose']   = 'no2';
+$cfg['Servers'][$i]['host']      = 'remote.host.addr';//or ip:'10.9.8.1'
+// this server must allow remote clients, e.g., host 10.9.8.%
+// not only in mysql.host but also in the startup configuration
+$cfg['Servers'][$i]['extension'] = 'mysqli';
+// more options for #2 ...
+
+// end of server sections
+$cfg['ServerDefault'] = 0; // to choose the server on startup
+
+// further general options ...
+?>
+
+
+
+
+

Google Cloud SQL with SSL露

+

To connect to Google Could SQL, you currently need to disable certificate +verification. This is caused by the certficate being issued for CN matching +your instance name, but you connect to an IP address and PHP tries to match +these two. With verfication you end up with error message like:

+
Peer certificate CN=`api-project-851612429544:pmatest' did not match expected CN=`8.8.8.8'
+
+
+
+

Warning

+

With disabled verification your traffic is encrypted, but you鈥檙e open to +man in the middle attacks.

+
+

To connect phpMyAdmin to Google Cloud SQL using SSL download the client and +server certificates and tell phpMyAdmin to use them:

+
// IP address of your instance
+$cfg['Servers'][$i]['host'] = '8.8.8.8';
+// Use SSL for connection
+$cfg['Servers'][$i]['ssl'] = true;
+// Client secret key
+$cfg['Servers'][$i]['ssl_key'] = '../client-key.pem';
+// Client certificate
+$cfg['Servers'][$i]['ssl_cert'] = '../client-cert.pem';
+// Server certification authority
+$cfg['Servers'][$i]['ssl_ca'] = '../server-ca.pem';
+// Disable SSL verification (see above note)
+$cfg['Servers'][$i]['ssl_verify'] = false;
+
+
+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/copyright.html b/phpMyAdmin/doc/html/copyright.html new file mode 100755 index 0000000..e12a827 --- /dev/null +++ b/phpMyAdmin/doc/html/copyright.html @@ -0,0 +1,143 @@ + + + + + + + + Copyright — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ + + + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/credits.html b/phpMyAdmin/doc/html/credits.html new file mode 100755 index 0000000..74a9717 --- /dev/null +++ b/phpMyAdmin/doc/html/credits.html @@ -0,0 +1,1419 @@ + + + + + + + + Credits — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Credits露

+
+

Credits, in chronological order露

+
    +
  • Tobias Ratschiller <tobias_at_ratschiller.com>

    +
      +
    • creator of the phpMyAdmin project

    • +
    • maintainer from 1998 to summer 2000

    • +
    +
  • +
  • Marc Delisle <marc_at_infomarc.info>

    +
      +
    • multi-language version in December 1998

    • +
    • various fixes and improvements

    • +
    • first version of the SQL analyser (most of it)

    • +
    • maintainer from 2001 to 2015

    • +
    +
  • +
  • Olivier M眉ller <om_at_omnis.ch>

    +
      +
    • started SourceForge phpMyAdmin project in March 2001

    • +
    • sync鈥檈d different existing CVS trees with new features and bugfixes

    • +
    • multi-language improvements, dynamic language selection

    • +
    • many bugfixes and improvements

    • +
    +
  • +
  • Lo茂c Chapeaux <lolo_at_phpheaven.net>

    +
      +
    • rewrote and optimized JavaScript, DHTML and DOM stuff

    • +
    • rewrote the scripts so they fit the PEAR coding standards and +generate XHTML1.0 and CSS2 compliant codes

    • +
    • improved the language detection system

    • +
    • many bugfixes and improvements

    • +
    +
  • +
  • Robin Johnson <robbat2_at_users.sourceforge.net>

    +
      +
    • database maintenance controls

    • +
    • table type code

    • +
    • Host authentication IP Allow/Deny

    • +
    • DB-based configuration (Not completed)

    • +
    • SQL parser and pretty-printer

    • +
    • SQL validator

    • +
    • many bugfixes and improvements

    • +
    +
  • +
  • Armel Fauveau <armel.fauveau_at_globalis-ms.com>

    +
      +
    • bookmarks feature

    • +
    • multiple dump feature

    • +
    • gzip dump feature

    • +
    • zip dump feature

    • +
    +
  • +
  • Geert Lund <glund_at_silversoft.dk>

    +
      +
    • various fixes

    • +
    • moderator of the phpMyAdmin former users forum at phpwizard.net

    • +
    +
  • +
  • Korakot Chaovavanich <korakot_at_iname.com>

    +
      +
    • 鈥渋nsert as new row鈥� feature

    • +
    +
  • +
  • Pete Kelly <webmaster_at_trafficg.com>

    +
      +
    • rewrote and fix dump code

    • +
    • bugfixes

    • +
    +
  • +
  • Steve Alberty <alberty_at_neptunlabs.de>

    +
      +
    • rewrote dump code for PHP4

    • +
    • mySQL table statistics

    • +
    • bugfixes

    • +
    +
  • +
  • Benjamin Gandon <gandon_at_isia.cma.fr>

    +
      +
    • main author of the version 2.1.0.1

    • +
    • bugfixes

    • +
    +
  • +
  • Alexander M. Turek <me_at_derrabus.de>

    +
      +
    • MySQL 4.0 / 4.1 / 5.0 compatibility

    • +
    • abstract database interface (PMA_DBI) with MySQLi support

    • +
    • privileges administration

    • +
    • XML exports

    • +
    • various features and fixes

    • +
    • German language file updates

    • +
    +
  • +
  • Mike Beck <mike.beck_at_web.de>

    +
      +
    • automatic joins in QBE

    • +
    • links column in printview

    • +
    • Relation view

    • +
    +
  • +
  • Michal 膶iha艡 <michal_at_cihar.com>

    +
      +
    • enhanced index creation/display feature

    • +
    • feature to use a different charset for HTML than for MySQL

    • +
    • improvements of export feature

    • +
    • various features and fixes

    • +
    • Czech language file updates

    • +
    • created current website for phpMyAdmin

    • +
    +
  • +
  • Christophe Gesch茅 from the 鈥淢ySQL Form Generator for PHPMyAdmin鈥� +(https://sourceforge.net/projects/phpmysqlformgen/)

    +
      +
    • suggested the patch for multiple table printviews

    • +
    +
  • +
  • Garvin Hicking <me_at_supergarv.de>

    +
      +
    • built the patch for vertical display of table rows

    • +
    • built the Javascript based Query window + SQL history

    • +
    • Improvement of column/db comments

    • +
    • (MIME)-Transformations for columns

    • +
    • Use custom alias names for Databases in left frame

    • +
    • hierarchical/nested table display

    • +
    • PDF-scratchboard for WYSIWYG- +distribution of PDF relations

    • +
    • new icon sets

    • +
    • vertical display of column properties page

    • +
    • some bugfixes, features, support, German language additions

    • +
    +
  • +
  • Yukihiro Kawada <kawada_at_den.fujifilm.co.jp>

    +
      +
    • japanese kanji encoding conversion feature

    • +
    +
  • +
  • Piotr Roszatycki <d3xter_at_users.sourceforge.net> and Dan Wilson

    +
      +
    • the Cookie authentication mode

    • +
    +
  • +
  • Axel Sander <n8falke_at_users.sourceforge.net>

    +
      +
    • table relation-links feature

    • +
    +
  • +
  • Maxime Delorme <delorme.maxime_at_free.fr>

    +
      +
    • PDF schema output, thanks also to +Olivier Plathey for the 鈥淔PDF鈥� library (see <http://www.fpdf.org/>), Steven +Wittens for the 鈥淯FPDF鈥� library and +Nicola Asuni for the 鈥淭CPDF鈥� library (see <https://tcpdf.org/>).

    • +
    +
  • +
  • Olof Edlund <olof.edlund_at_upright.se>

    +
      +
    • SQL validator server

    • +
    +
  • +
  • Ivan R. Lanin <ivanlanin_at_users.sourceforge.net>

    +
      +
    • phpMyAdmin logo (until June 2004)

    • +
    +
  • +
  • Mike Cochrane <mike_at_graftonhall.co.nz>

    +
      +
    • blowfish library from the Horde project (withdrawn in release 4.0)

    • +
    +
  • +
  • Marcel Tschopp <ne0x_at_users.sourceforge.net>

    +
      +
    • mysqli support

    • +
    • many bugfixes and improvements

    • +
    +
  • +
  • Nicola Asuni (Tecnick.com)

    + +
  • +
  • Michael Keck <mkkeck_at_users.sourceforge.net>

    +
      +
    • redesign for 2.6.0

    • +
    • phpMyAdmin sailboat logo (June 2004)

    • +
    +
  • +
  • Mathias Landh盲u脽er

    +
      +
    • Representation at conferences

    • +
    +
  • +
  • Sebastian Mendel <cybot_tm_at_users.sourceforge.net>

    +
      +
    • interface improvements

    • +
    • various bugfixes

    • +
    +
  • +
  • Ivan A Kirillov

    +
      +
    • new relations Designer

    • +
    +
  • +
  • Raj Kissu Rajandran (Google Summer of Code 2008)

    +
      +
    • BLOBstreaming support (withdrawn in release 4.0)

    • +
    +
  • +
  • Piotr Przybylski (Google Summer of Code 2008, 2010 and 2011)

    +
      +
    • improved setup script

    • +
    • user preferences

    • +
    • Drizzle support

    • +
    +
  • +
  • Derek Schaefer (Google Summer of Code 2009)

    +
      +
    • Improved the import system

    • +
    +
  • +
  • Alexander Rutkowski (Google Summer of Code 2009)

    +
      +
    • Tracking mechanism

    • +
    +
  • +
  • Zahra Naeem (Google Summer of Code 2009)

    +
      +
    • Synchronization feature (removed in release 4.0)

    • +
    +
  • +
  • Tom谩拧 Srnka (Google Summer of Code 2009)

    +
      +
    • Replication support

    • +
    +
  • +
  • Muhammad Adnan (Google Summer of Code 2010)

    +
      +
    • Relation schema export to multiple formats

    • +
    +
  • +
  • Lori Lee (Google Summer of Code 2010)

    +
      +
    • User interface improvements

    • +
    • ENUM/SET editor

    • +
    • Simplified interface for export/import

    • +
    +
  • +
  • Ninad Pundalik (Google Summer of Code 2010)

    +
      +
    • AJAXifying the interface

    • +
    +
  • +
  • Martynas Mickevi膷ius (Google Summer of Code 2010)

    +
      +
    • Charts

    • +
    +
  • +
  • Barrie Leslie

    +
      +
    • BLOBstreaming support with PBMS PHP extension (withdrawn in release +4.0)

    • +
    +
  • +
  • Ankit Gupta (Google Summer of Code 2010)

    +
      +
    • Visual query builder

    • +
    +
  • +
  • Madhura Jayaratne (Google Summer of Code 2011)

    +
      +
    • OpenGIS support

    • +
    +
  • +
  • Ammar Yasir (Google Summer of Code 2011)

    +
      +
    • Zoom search

    • +
    +
  • +
  • Aris Feryanto (Google Summer of Code 2011)

    +
      +
    • Browse-mode improvements

    • +
    +
  • +
  • Thilanka Kaushalya (Google Summer of Code 2011)

    +
      +
    • AJAXification

    • +
    +
  • +
  • Tyron Madlener (Google Summer of Code 2011)

    +
      +
    • Query statistics and charts for the status page

    • +
    +
  • +
  • Zarubin Stas (Google Summer of Code 2011)

    +
      +
    • Automated testing

    • +
    +
  • +
  • Rouslan Placella (Google Summer of Code 2011 and 2012)

    +
      +
    • Improved support for Stored Routines, Triggers and Events

    • +
    • Italian translation updates

    • +
    • Removal of frames, new navigation

    • +
    +
  • +
  • Dieter Adriaenssens

    +
      +
    • Various bugfixes

    • +
    • Dutch translation updates

    • +
    +
  • +
  • Alex Marin (Google Summer of Code 2012)

    +
      +
    • New plugins and properties system

    • +
    +
  • +
  • Thilina Buddika Abeyrathna (Google Summer of Code 2012)

    +
      +
    • Refactoring

    • +
    +
  • +
  • Atul Pratap Singh (Google Summer of Code 2012)

    +
      +
    • Refactoring

    • +
    +
  • +
  • Chanaka Indrajith (Google Summer of Code 2012)

    +
      +
    • Refactoring

    • +
    +
  • +
  • Yasitha Pandithawatta (Google Summer of Code 2012)

    +
      +
    • Automated testing

    • +
    +
  • +
  • Jim Wigginton (phpseclib.sourceforge.net)

    +
      +
    • phpseclib

    • +
    +
  • +
  • Bin Zu (Google Summer of Code 2013)

    +
      +
    • Refactoring

    • +
    +
  • +
  • Supun Nakandala (Google Summer of Code 2013)

    +
      +
    • Refactoring

    • +
    +
  • +
  • Mohamed Ashraf (Google Summer of Code 2013)

    +
      +
    • AJAX error reporting

    • +
    +
  • +
  • Adam Kang (Google Summer of Code 2013)

    +
      +
    • Automated testing

    • +
    +
  • +
  • Ayush Chaudhary (Google Summer of Code 2013)

    +
      +
    • Automated testing

    • +
    +
  • +
  • Kasun Chathuranga (Google Summer of Code 2013)

    +
      +
    • Interface improvements

    • +
    +
  • +
  • Hugues Peccatte

    +
      +
    • Load/save query by example (database search bookmarks)

    • +
    +
  • +
  • Smita Kumari (Google Summer of Code 2014)

    +
      +
    • Central list of columns

    • +
    • Improve table structure (normalization)

    • +
    +
  • +
  • Ashutosh Dhundhara (Google Summer of Code 2014)

    +
      +
    • Interface improvements

    • +
    +
  • +
  • Dhananjay Nakrani (Google Summer of Code 2014)

    +
      +
    • PHP error reporting

    • +
    +
  • +
  • Edward Cheng (Google Summer of Code 2014)

    +
      +
    • SQL Query Console

    • +
    +
  • +
  • Kankanamge Bimal Yashodha (Google Summer of Code 2014)

    +
      +
    • Refactoring: Designer/schema integration

    • +
    +
  • +
  • Chirayu Chiripal (Google Summer of Code 2014)

    +
      +
    • Custom field handlers (Input based MIME transformations)

    • +
    • Export with table/column name changes

    • +
    +
  • +
  • Dan Ungureanu (Google Summer of Code 2015)

    +
      +
    • New parser and analyzer

    • +
    +
  • +
  • Nisarg Jhaveri (Google Summer of Code 2015)

    +
      +
    • Page-related settings

    • +
    • SQL debugging integration to the Console

    • +
    • Other UI improvements

    • +
    +
  • +
  • Deven Bansod (Google Summer of Code 2015)

    +
      +
    • Print view using CSS

    • +
    • Other UI improvements and new features

    • +
    +
  • +
  • Deven Bansod (Google Summer of Code 2017)

    +
      +
    • Improvements to the Error Reporting Server

    • +
    • Improved Selenium testing

    • +
    +
  • +
  • Manish Bisht (Google Summer of Code 2017)

    +
      +
    • Mobile user interface

    • +
    • Remove inline JavaScript code

    • +
    • Other UI improvements

    • +
    +
  • +
  • Raghuram Vadapalli (Google Summer of Code 2017)

    +
      +
    • Multi-table query interface

    • +
    • Allow Designer to work with tables from other databases

    • +
    • Other UI improvements

    • +
    +
  • +
+

And also to the following people who have contributed minor changes, +enhancements, bugfixes or support for a new language since version +2.1.0:

+

Bora Alioglu, Ricardo ?, Sven-Erik Andersen, Alessandro Astarita, +P茅ter Bakondy, Borges Botelho, Olivier Bussier, Neil Darlow, Mats +Engstrom, Ian Davidson, Laurent Dhima, Kristof Hamann, Thomas Kl盲ger, +Lubos Klokner, Martin Marconcini, Girish Nair, David Nordenberg, +Andreas Pauley, Bernard M. Piller, Laurent Haas, 鈥淪akamoto鈥�, Yuval +Sarna, www.securereality.com.au, Alexis Soulard, Alvar Soome, Siu Sun, +Peter Svec, Michael Tacelosky, Rachim Tamsjadi, Kositer Uros, Lu铆s V., +Martijn W. van der Lee, Algis Vainauskas, Daniel Villanueva, Vinay, +Ignacio Vazquez-Abrams, Chee Wai, Jakub Wilk, Thomas Michael +Winningham, Vilius Zigmantas, 鈥淢anuzhai鈥�.

+
+
+

Translators露

+

Following people have contributed to translation of phpMyAdmin:

+
    +
  • Albanian

    +
    +
      +
    • Arben 脟okaj <acokaj_at_shkoder.net>

    • +
    +
    +
  • +
  • Arabic

    +
    +
      +
    • Ahmed Saleh Abd El-Raouf Ismae <a.saleh.ismael_at_gmail.com>

    • +
    • Ahmed Saad <egbrave_at_hotmail.com>

    • +
    • hassan mokhtari <persiste1_at_gmail.com>

    • +
    +
    +
  • +
  • Armenian

    +
    +
      +
    • Andrey Aleksanyants <aaleksanyants_at_yahoo.com>

    • +
    +
    +
  • +
  • Azerbaijani

    +
    +
      +
    • Mirc蓹lal <01youknowme_at_gmail.com>

    • +
    • Huseyn <huseyn_esgerov_at_mail.ru>

    • +
    • Sevdimali 陌sa <sevdimaliisayev_at_mail.ru>

    • +
    • Jafar <sharifov_at_programmer.net>

    • +
    +
    +
  • +
  • Belarusian

    +
    +
      +
    • Viktar Palstsiuk <vipals_at_gmail.com>

    • +
    +
    +
  • +
  • Bulgarian

    +
    +
      +
    • Boyan Kehayov <bkehayov_at_gmail.com>

    • +
    • Valter Georgiev <blagynchy_at_gmail.com>

    • +
    • Valentin Mladenov <hudsonvsm_at_gmail.com>

    • +
    • P <plamen_mbx_at_yahoo.com>

    • +
    • krasimir <vip_at_krasio-valia.com>

    • +
    +
    +
  • +
  • Catalan

    +
    +
      +
    • josep constanti <jconstanti_at_yahoo.es>

    • +
    • Xavier Navarro <xvnavarro_at_gmail.com>

    • +
    +
    +
  • +
  • Chinese (China)

    +
    +
      +
    • Vincent Lau <3092849_at_qq.com>

    • +
    • Zheng Dan <clanboy_at_163.com>

    • +
    • disorderman <disorderman_at_qq.com>

    • +
    • Rex Lee <duguying2008_at_gmail.com>

    • +
    • <fundawang_at_gmail.com>

    • +
    • popcorner <memoword_at_163.com>

    • +
    • Yizhou Qiang <qyz.yswy_at_hotmail.com>

    • +
    • zz <tczzjin_at_gmail.com>

    • +
    • Terry Weng <wengshiyu_at_gmail.com>

    • +
    • whh <whhlcj_at_126.com>

    • +
    +
    +
  • +
  • Chinese (Taiwan)

    +
    +
      +
    • Albert Song <albb0920_at_gmail.com>

    • +
    • Chien Wei Lin <cwlin0416_at_gmail.com>

    • +
    • Peter Dave Hello <xs910203_at_gmail.com>

    • +
    +
    +
  • +
  • Colognian

    +
    +
      +
    • Purodha <publi_at_web.de>

    • +
    +
    +
  • +
  • Czech

    +
    +
      +
    • Ale拧 Hakl <ales_at_hakl.net>

    • +
    • Dalibor Straka <dalibor.straka3_at_gmail.com>

    • +
    • Martin Vidner <martin_at_vidner.net>

    • +
    • Ondra 艩ime膷ek <ondrasek.simecek_at_gmail.com>

    • +
    • Jan Palider <palider_at_seznam.cz>

    • +
    • Petr Kate艡i艌谩k <petr.katerinak_at_gmail.com>

    • +
    +
    +
  • +
  • Danish

    +
    +
      +
    • Aputsia母 Niels Janussen <aj_at_isit.gl>

    • +
    • Dennis Jakobsen <dennis.jakobsen_at_gmail.com>

    • +
    • Jonas <jonas.den.smarte_at_gmail.com>

    • +
    • Claus Svalekjaer <just.my.smtp.server_at_gmail.com>

    • +
    +
    +
  • +
  • Dutch

    +
    +
      +
      1. +
      2. Voogt <a.voogt_at_hccnet.nl>

      3. +
      +
    • +
    • dingo thirteen <dingo13_at_gmail.com>

    • +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    • Dieter Adriaenssens <ruleant_at_users.sourceforge.net>

    • +
    • Niko Strijbol <strijbol.niko_at_gmail.com>

    • +
    +
    +
  • +
  • English (United Kingdom)

    +
    +
      +
    • Dries Verschuere <dries.verschuere_at_outlook.com>

    • +
    • Francisco Rocha <j.francisco.o.rocha_at_zoho.com>

    • +
    • Marc Delisle <marc_at_infomarc.info>

    • +
    • Marek Toma拧t铆k <tomastik.m_at_gmail.com>

    • +
    +
    +
  • +
  • Esperanto

    +
    +
      +
    • Eliovir <eliovir_at_gmail.com>

    • +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    +
    +
  • +
  • Estonian

    +
    +
      +
    • Kristjan R盲ts <kristjanrats_at_gmail.com>

    • +
    +
    +
  • +
  • Finnish

    +
    +
      +
    • Juha Remes <jremes_at_outlook.com>

    • +
    • Lari Oesch <lari_at_oesch.me>

    • +
    +
    +
  • +
  • French

    +
    +
      +
    • Marc Delisle <marc_at_infomarc.info>

    • +
    +
    +
  • +
  • Frisian

    +
    +
      +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    +
    +
  • +
  • Galician

    +
    +
      +
    • Xos茅 Calvo <xosecalvo_at_gmail.com>

    • +
    +
    +
  • +
  • German

    +
    +
      +
    • Julian Ladisch <github.com-t3if_at_ladisch.de>

    • +
    • Jan Erik Zassenhaus <jan.zassenhaus_at_jgerman.de>

    • +
    • Lasse Goericke <lasse_at_mydom.de>

    • +
    • Matthias Bluthardt <matthias_at_bluthardt.org>

    • +
    • Michael Koch <michael.koch_at_enough.de>

    • +
    • Ann + J.M. <phpMyAdmin_at_ZweiSteinSoft.de>

    • +
    • <pma_at_sebastianmendel.de>

    • +
    • Phillip Rohmberger <rohmberger_at_hotmail.de>

    • +
    • Hauke Henningsen <sqrt_at_entless.org>

    • +
    +
    +
  • +
  • Greek

    +
    +
      +
    • 螤伪谓伪纬喂蠋蟿畏蟼 螤伪蟺维味慰纬位慰蠀 <papaz_p_at_yahoo.com>

    • +
    +
    +
  • +
  • Hebrew

    +
    +
      +
    • Moshe Harush <mmh15_at_windowslive.com>

    • +
    • Yaron Shahrabani <sh.yaron_at_gmail.com>

    • +
    • Eyal Visoker <visokereyal_at_gmail.com>

    • +
    +
    +
  • +
  • Hindi

    +
    +
      +
    • Atul Pratap Singh <atulpratapsingh05_at_gmail.com>

    • +
    • Yogeshwar <charanyogeshwar_at_gmail.com>

    • +
    • Deven Bansod <devenbansod.bits_at_gmail.com>

    • +
    • Kushagra Pandey <kushagra4296_at_gmail.com>

    • +
    • Nisarg Jhaveri <nisargjhaveri_at_gmail.com>

    • +
    • Roohan Kazi <roohan_cena_at_yahoo.co.in>

    • +
    • Yugal Pantola <yug.scorpio_at_gmail.com>

    • +
    +
    +
  • +
  • Hungarian

    +
    +
      +
    • Akos Eros <erosakos02_at_gmail.com>

    • +
    • D谩niel T贸th <leedermeister_at_gmail.com>

    • +
    • Sz谩sz Attila <undernetangel_at_gmail.com>

    • +
    • Bal谩zs 脷r <urbalazs_at_gmail.com>

    • +
    +
    +
  • +
  • Indonesian

    +
    +
      +
    • Deky Arifianto <Deky40_at_gmail.com>

    • +
    • Andika Triwidada <andika_at_gmail.com>

    • +
    • Dadan Setia <da2n_s_at_yahoo.co.id>

    • +
    • Dadan Setia <dadan.setia_at_gmail.com>

    • +
    • Yohanes Edwin <edwin_at_yohanesedwin.com>

    • +
    • Fadhiil Rachman <fadhiilrachman_at_gmail.com>

    • +
    • Benny <tarzq28_at_gmail.com>

    • +
    • Tommy Surbakti <tommy_at_surbakti.net>

    • +
    • Zufar Fathi Suhardi <zufar.bogor_at_gmail.com>

    • +
    +
    +
  • +
  • Interlingua

    +
    +
      +
    • Giovanni Sora <g.sora_at_tiscali.it>

    • +
    +
    +
  • +
  • Italian

    +
    +
      +
    • Francesco Saverio Giacobazzi <francesco.giacobazzi_at_ferrania.it>

    • +
    • Marco Pozzato <ironpotts_at_gmail.com>

    • +
    • Stefano Martinelli <stefano.ste.martinelli_at_gmail.com>

    • +
    +
    +
  • +
  • Japanese

    +
    +
      +
    • k725 <alexalex.kobayashi_at_gmail.com>

    • +
    • Hiroshi Chiyokawa <hiroshi.chiyokawa_at_gmail.com>

    • +
    • Masahiko HISAKAWA <orzkun_at_ageage.jp>

    • +
    • worldwideskier <worldwideskier_at_yahoo.co.jp>

    • +
    +
    +
  • +
  • Kannada

    +
    +
      +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    • Shameem Ahmed A Mulla <shameem.sam_at_gmail.com>

    • +
    +
    +
  • +
  • Korean

    +
    +
      +
    • Bumsoo Kim <bskim45_at_gmail.com>

    • +
    • Kyeong Su Shin <cdac1234_at_gmail.com>

    • +
    • Dongyoung Kim <dckyoung_at_gmail.com>

    • +
    • Myung-han Yu <greatymh_at_gmail.com>

    • +
    • JongDeok <human.zion_at_gmail.com>

    • +
    • Yong Kim <kim_at_nhn.com>

    • +
    • 鞚搓步欷� <kyungjun2_at_gmail.com>

    • +
    • Seongki Shin <skshin_at_gmail.com>

    • +
    • Yoon Bum-Jong <virusyoon_at_gmail.com>

    • +
    • Koo Youngmin <youngminz.kr_at_gmail.com>

    • +
    +
    +
  • +
  • Kurdish Sorani

    +
    +
      +
    • Alan Hilal <alan.hilal94_at_gmail.com>

    • +
    • Aso Naderi <aso.naderi_at_gmail.com>

    • +
    • muhammad <esy_vb_at_yahoo.com>

    • +
    • Zrng Abdulla <zhyarabdulla94_at_gmail.com>

    • +
    +
    +
  • +
  • Latvian

    +
    +
      +
    • Latvian TV <dnighttv_at_gmail.com>

    • +
    • Edgars Neimanis <edgarsneims5092_at_inbox.lv>

    • +
    • Ukko <perkontevs_at_gmail.com>

    • +
    +
    +
  • +
  • Limburgish

    +
    +
      +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    +
    +
  • +
  • Lithuanian

    +
    +
      +
    • Vytautas Motuzas <v.motuzas_at_gmail.com>

    • +
    +
    +
  • +
  • Malay

    +
    +
      +
    • Amir Hamzah <amir.overlord666_at_gmail.com>

    • +
    • diprofinfiniti <anonynuine-999_at_yahoo.com>

    • +
    +
    +
  • +
  • Nepali

    +
    +
      +
    • Nabin Ghimire <nnabinn_at_hotmail.com>

    • +
    +
    +
  • +
  • Norwegian Bokm氓l

    +
    +
      +
    • B酶rge Holm-Wennberg <borge947_at_gmail.com>

    • +
    • Tor Stokkan <danorse_at_gmail.com>

    • +
    • Espen Fr酶yshov <efroys_at_gmail.com>

    • +
    • Kurt Eilertsen <kurt_at_kheds.com>

    • +
    • Christoffer Haugom <ph3n1x.nobody_at_gmail.com>

    • +
    • Sebastian <sebastian_at_sgundersen.com>

    • +
    • Tomas <tomas_at_tomasruud.com>

    • +
    +
    +
  • +
  • Persian

    +
    +
      +
    • ashkan shirian <ashkan.shirian_at_gmail.com>

    • +
    • HM <goodlinuxuser_at_chmail.ir>

    • +
    +
    +
  • +
  • Polish

    +
    +
      +
    • Andrzej <andrzej_at_kynu.pl>

    • +
    • Przemo <info_at_opsbielany.waw.pl>

    • +
    • Krystian Biesaga <krystian4842_at_gmail.com>

    • +
    • Maciej Gryniuk <maciejka45_at_gmail.com>

    • +
    • Micha艂 VonFlynee <vonflynee_at_gmail.com>

    • +
    +
    +
  • +
  • Portuguese

    +
    +
      +
    • Alexandre Badalo <alexandre.badalo_at_sapo.pt>

    • +
    • Jo茫o Rodrigues <geral_at_jonilive.com>

    • +
    • Pedro Ribeiro <p.m42.ribeiro_at_gmail.com>

    • +
    • Sandro Amaral <sandro123iv_at_gmail.com>

    • +
    +
    +
  • +
  • Portuguese (Brazil)

    +
    +
      +
    • Alex Rohleder <alexrohleder96_at_outlook.com>

    • +
    • bruno mendax <brunomendax_at_gmail.com>

    • +
    • Danilo GUia <danilo.eng_at_globomail.com>

    • +
    • Douglas Rafael Morais Kollar <douglas.kollar_at_pg.df.gov.br>

    • +
    • Douglas Eccker <douglaseccker_at_hotmail.com>

    • +
    • Ed Jr <edjacobjunior_at_gmail.com>

    • +
    • Guilherme Souza Silva <g.szsilva_at_gmail.com>

    • +
    • Guilherme Seibt <gui_at_webseibt.net>

    • +
    • Helder Santana <helder.bs.santana_at_gmail.com>

    • +
    • Junior Zancan <jrzancan_at_hotmail.com>

    • +
    • Luis <luis.eduardo.braschi_at_outlook.com>

    • +
    • Marcos Algeri <malgeri_at_gmail.com>

    • +
    • Marc Delisle <marc_at_infomarc.info>

    • +
    • Renato Rodrigues de Lima J煤nio <renatomdd_at_yahoo.com.br>

    • +
    • Thiago Casotti <thiago.casotti_at_uol.com.br>

    • +
    • Victor Laureano <victor.laureano_at_gmail.com>

    • +
    • Vin铆cius Ara煤jo <vinipitta_at_gmail.com>

    • +
    • Washington Bruno Rodrigues Cav <washingtonbruno_at_msn.com>

    • +
    • Yan Gabriel <yansilvagabriel_at_gmail.com>

    • +
    +
    +
  • +
  • Punjabi

    +
    +
      +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    +
    +
  • +
  • Romanian

    +
    +
      +
    • Alex <amihaita_at_yahoo.com>

    • +
    • Costel Cocerhan <costa1988sv_at_gmail.com>

    • +
    • Ion Adrian-Ionut <john_at_panevo.ro>

    • +
    • Raul Molnar <molnar.raul_at_wservices.eu>

    • +
    • Deleted User <noreply_at_weblate.org>

    • +
    • Stefan Murariu <stefan.murariu_at_yahoo.com>

    • +
    +
    +
  • +
  • Russian

    +
    +
      +
    • Andrey Aleksanyants <aaleksanyants_at_yahoo.com>

    • +
    • <ddrmoscow_at_gmail.com>

    • +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    • 啸芯屑褍褌芯胁 袠胁邪薪 小械褉谐械械胁懈褔 <khomutov.ivan_at_mail.ru>

    • +
    • Alexey Rubinov <orion1979_at_yandex.ru>

    • +
    • 袨谢械谐 袣邪褉锌芯胁 <salvadoporjc_at_gmail.com>

    • +
    • Egorov Artyom <unlucky_at_inbox.ru>

    • +
    +
    +
  • +
  • Serbian

    +
    +
      +
    • Smart Kid <kidsmart33_at_gmail.com>

    • +
    +
    +
  • +
  • Sinhala

    +
    +
      +
    • Madhura Jayaratne <madhura.cj_at_gmail.com>

    • +
    +
    +
  • +
  • Slovak

    +
    +
      +
    • Martin Lacina <martin_at_whistler.sk>

    • +
    • Patrik Kollmann <parkourpotex_at_gmail.com>

    • +
    • Jozef Pistej <pistej2_at_gmail.com>

    • +
    +
    +
  • +
  • Slovenian

    +
    +
      +
    • Domen <mitenem_at_outlook.com>

    • +
    +
    +
  • +
  • Spanish

    +
    +
      +
    • Luis Garc铆a Sevillano <floss.dev_at_gmail.com>

    • +
    • Franco <fulanodetal.github1_at_openaliasbox.org>

    • +
    • Luis Ruiz <luisan00_at_hotmail.com>

    • +
    • Macofe <macofe.languagetool_at_gmail.com>

    • +
    • Mat铆as Bellone <matiasbellone+weblate_at_gmail.com>

    • +
    • Rodrigo A. <ra4_at_openmailbox.org>

    • +
    • FAMMA TV NOTICIAS MEDIOS DE CO <revistafammatvmusic.oficial_at_gmail.com>

    • +
    • Ronnie Simon <ronniesimonf_at_gmail.com>

    • +
    +
    +
  • +
  • Swedish

    +
    +
      +
    • Anders Jonsson <anders.jonsson_at_norsjovallen.se>

    • +
    +
    +
  • +
  • Tamil

    +
    +
      +
    • 喈曕喁囙喁� 喈曕瘉喈喈班瘝 <GANESHTHEONE_at_gmail.com>

    • +
    • Achchuthan Yogarajah <achch1990_at_gmail.com>

    • +
    • Rifthy Ahmed <rifthy456_at_gmail.com>

    • +
    +
    +
  • +
  • Thai

    +
    +
      +
    • <nontawat39_at_gmail.com>

    • +
    • Somthanat W. <somthanat_at_gmail.com>

    • +
    +
    +
  • +
  • Turkish

    +
    +
      +
    • Burak Yavuz <hitowerdigit_at_hotmail.com>

    • +
    +
    +
  • +
  • Ukrainian

    +
    +
      +
    • 小械褉谐褨泄 袩械写褜泻芯 <nitrotoll_at_gmail.com>

    • +
    • Igor <vmta_at_yahoo.com>

    • +
    • Vitaliy Perekupka <vperekupka_at_gmail.com>

    • +
    +
    +
  • +
  • Vietnamese

    +
    +
      +
    • Bao Phan <baophan94_at_icloud.com>

    • +
    • Xuan Hung <mr.hungdx_at_gmail.com>

    • +
    • Bao trinh minh <trinhminhbao_at_gmail.com>

    • +
    +
    +
  • +
  • West Flemish

    +
    +
      +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    +
    +
  • +
+
+
+

Documentation translators露

+

Following people have contributed to translation of phpMyAdmin documentation:

+
    +
  • Albanian

    +
    +
      +
    • Arben 脟okaj <acokaj_at_shkoder.net>

    • +
    +
    +
  • +
  • Arabic

    +
    +
      +
    • Ahmed El Azzabi <ahmedtek1993_at_gmail.com>

    • +
    • Omar Essam <omar_2412_at_live.com>

    • +
    +
    +
  • +
  • Armenian

    +
    +
      +
    • Andrey Aleksanyants <aaleksanyants_at_yahoo.com>

    • +
    +
    +
  • +
  • Azerbaijani

    +
    +
      +
    • Mirc蓹lal <01youknowme_at_gmail.com>

    • +
    • Sevdimali 陌sa <sevdimaliisayev_at_mail.ru>

    • +
    +
    +
  • +
  • Catalan

    +
    +
      +
    • josep constanti <jconstanti_at_yahoo.es>

    • +
    • Joan Montan茅 <joan_at_montane.cat>

    • +
    • Xavier Navarro <xvnavarro_at_gmail.com>

    • +
    +
    +
  • +
  • Chinese (China)

    +
    +
      +
    • Vincent Lau <3092849_at_qq.com>

    • +
    • 缃楁攢鐧� <6375lpd_at_gmail.com>

    • +
    • disorderman <disorderman_at_qq.com>

    • +
    • ITXiaoPang <djh1017555_at_126.com>

    • +
    • tunnel213 <tunnel213_at_aliyun.com>

    • +
    • Terry Weng <wengshiyu_at_gmail.com>

    • +
    • whh <whhlcj_at_126.com>

    • +
    +
    +
  • +
  • Chinese (Taiwan)

    +
    +
      +
    • Chien Wei Lin <cwlin0416_at_gmail.com>

    • +
    • Peter Dave Hello <xs910203_at_gmail.com>

    • +
    +
    +
  • +
  • Czech

    +
    +
      +
    • Ale拧 Hakl <ales_at_hakl.net>

    • +
    • Michal 膶iha艡 <michal_at_cihar.com>

    • +
    • Jan Palider <palider_at_seznam.cz>

    • +
    • Petr Kate艡i艌谩k <petr.katerinak_at_gmail.com>

    • +
    +
    +
  • +
  • Danish

    +
    +
      +
    • Aputsia母 Niels Janussen <aj_at_isit.gl>

    • +
    • Claus Svalekjaer <just.my.smtp.server_at_gmail.com>

    • +
    +
    +
  • +
  • Dutch

    +
    +
      +
      1. +
      2. Voogt <a.voogt_at_hccnet.nl>

      3. +
      +
    • +
    • dingo thirteen <dingo13_at_gmail.com>

    • +
    • Dries Verschuere <dries.verschuere_at_outlook.com>

    • +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    • Stefan Koolen <nast3zz_at_gmail.com>

    • +
    • Ray Borggreve <ray_at_datahuis.net>

    • +
    • Dieter Adriaenssens <ruleant_at_users.sourceforge.net>

    • +
    • Tom Hofman <tom.hofman_at_gmail.com>

    • +
    +
    +
  • +
  • Estonian

    +
    +
      +
    • Kristjan R盲ts <kristjanrats_at_gmail.com>

    • +
    +
    +
  • +
  • Finnish

    +
    +
      +
    • Juha <jremes_at_outlook.com>

    • +
    +
    +
  • +
  • French

    +
    +
      +
    • C茅dric Corazza <cedric.corazza_at_wanadoo.fr>

    • +
    • 脡tienne Gilli <etienne.gilli_at_gmail.com>

    • +
    • Marc Delisle <marc_at_infomarc.info>

    • +
    • Donavan_Martin <mart.donavan_at_hotmail.com>

    • +
    +
    +
  • +
  • Frisian

    +
    +
      +
    • Robin van der Vliet <info_at_robinvandervliet.nl>

    • +
    +
    +
  • +
  • Galician

    +
    +
      +
    • Xos茅 Calvo <xosecalvo_at_gmail.com>

    • +
    +
    +
  • +
  • German

    +
    +
      +
    • Daniel <d.gnauk89_at_googlemail.com>

    • +
    • JH M <janhenrikm_at_yahoo.de>

    • +
    • Lasse Goericke <lasse_at_mydom.de>

    • +
    • Michael Koch <michael.koch_at_enough.de>

    • +
    • Ann + J.M. <phpMyAdmin_at_ZweiSteinSoft.de>

    • +
    • Niemand Jedermann <predatorix_at_web.de>

    • +
    • Phillip Rohmberger <rohmberger_at_hotmail.de>

    • +
    • Hauke Henningsen <sqrt_at_entless.org>

    • +
    +
    +
  • +
  • Greek

    +
    +
      +
    • 螤伪谓伪纬喂蠋蟿畏蟼 螤伪蟺维味慰纬位慰蠀 <papaz_p_at_yahoo.com>

    • +
    +
    +
  • +
  • Hungarian

    +
    +
      +
    • Bal谩zs 脷r <urbalazs_at_gmail.com>

    • +
    +
    +
  • +
  • Italian

    +
    +
      +
    • Francesco Saverio Giacobazzi <francesco.giacobazzi_at_ferrania.it>

    • +
    • Marco Pozzato <ironpotts_at_gmail.com>

    • +
    • Stefano Martinelli <stefano.ste.martinelli_at_gmail.com>

    • +
    • TWS <tablettws_at_gmail.com>

    • +
    +
    +
  • +
  • Japanese

    +
    +
      +
    • Eshin Kunishima <ek_at_luna.miko.im>

    • +
    • Hiroshi Chiyokawa <hiroshi.chiyokawa_at_gmail.com>

    • +
    +
    +
  • +
  • Lithuanian

    +
    +
      +
    • Jur Kis <atvejis_at_gmail.com>

    • +
    • Dovydas <dovy.buz_at_gmail.com>

    • +
    +
    +
  • +
  • Norwegian Bokm氓l

    +
    +
      +
    • Tor Stokkan <danorse_at_gmail.com>

    • +
    • Kurt Eilertsen <kurt_at_kheds.com>

    • +
    +
    +
  • +
  • Portuguese (Brazil)

    +
    +
      +
    • Alexandre Moretti <alemoretti2010_at_hotmail.com>

    • +
    • Douglas Rafael Morais Kollar <douglas.kollar_at_pg.df.gov.br>

    • +
    • Guilherme Seibt <gui_at_webseibt.net>

    • +
    • Helder Santana <helder.bs.santana_at_gmail.com>

    • +
    • Michal 膶iha艡 <michal_at_cihar.com>

    • +
    • Michel Souza <michel.ekio_at_gmail.com>

    • +
    • Danilo Azevedo <mrdaniloazevedo_at_gmail.com>

    • +
    • Thiago Casotti <thiago.casotti_at_uol.com.br>

    • +
    • Vin铆cius Ara煤jo <vinipitta_at_gmail.com>

    • +
    • Yan Gabriel <yansilvagabriel_at_gmail.com>

    • +
    +
    +
  • +
  • Slovak

    +
    +
      +
    • Martin Lacina <martin_at_whistler.sk>

    • +
    • Michal 膶iha艡 <michal_at_cihar.com>

    • +
    • Jozef Pistej <pistej2_at_gmail.com>

    • +
    +
    +
  • +
  • Slovenian

    +
    +
      +
    • Domen <mitenem_at_outlook.com>

    • +
    +
    +
  • +
  • Spanish

    +
    +
      +
    • Luis Garc铆a Sevillano <floss.dev_at_gmail.com>

    • +
    • Franco <fulanodetal.github1_at_openaliasbox.org>

    • +
    • Mat铆as Bellone <matiasbellone+weblate_at_gmail.com>

    • +
    • Ronnie Simon <ronniesimonf_at_gmail.com>

    • +
    +
    +
  • +
  • Turkish

    +
    +
      +
    • Burak Yavuz <hitowerdigit_at_hotmail.com>

    • +
    +
    +
  • +
+
+
+

Original Credits of Version 2.1.0露

+

This work is based on Peter Kuppelwieser鈥檚 MySQL-Webadmin. It was his +idea to create a web-based interface to MySQL using PHP3. Although I +have not used any of his source-code, there are some concepts I鈥檝e +borrowed from him. phpMyAdmin was created because Peter told me he +wasn鈥檛 going to further develop his (great) tool.

+

Thanks go to

+
    +
  • Amalesh Kempf <ak-lsml_at_living-source.com> who contributed the +code for the check when dropping a table or database. He also +suggested that you should be able to specify the primary key on +tbl_create.php3. To version 1.1.1 he contributed the ldi_*.php3-set +(Import text-files) as well as a bug-report. Plus many smaller +improvements.

  • +
  • Jan Legenhausen <jan_at_nrw.net>: He made many of the changes that +were introduced in 1.3.0 (including quite significant ones like the +authentication). For 1.4.1 he enhanced the table-dump feature. Plus +bug-fixes and help.

  • +
  • Marc Delisle <DelislMa_at_CollegeSherbrooke.qc.ca> made phpMyAdmin +language-independent by outsourcing the strings to a separate file. He +also contributed the French translation.

  • +
  • Alexandr Bravo <abravo_at_hq.admiral.ru> who contributed +tbl_select.php3, a feature to display only some columns from a table.

  • +
  • Chris Jackson <chrisj_at_ctel.net> added support for MySQL functions +in tbl_change.php3. He also added the 鈥淨uery by Example鈥� feature in +2.0.

  • +
  • Dave Walton <walton_at_nordicdms.com> added support for multiple +servers and is a regular contributor for bug-fixes.

  • +
  • Gabriel Ash <ga244_at_is8.nyu.edu> contributed the random access +features for 2.0.6.

  • +
+

The following people have contributed minor changes, enhancements, +bugfixes or support for a new language:

+

Jim Kraai, Jordi Bruguera, Miquel Obrador, Geert Lund, Thomas +Kleemann, Alexander Leidinger, Kiko Albiol, Daniel C. Chao, Pavel +Piankov, Sascha Kettler, Joe Pruett, Renato Lins, Mark Kronsbein, +Jannis Hermanns, G. Wieggers.

+

And thanks to everyone else who sent me email with suggestions, bug- +reports and or just some feedback.

+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/developers.html b/phpMyAdmin/doc/html/developers.html new file mode 100755 index 0000000..f778f8b --- /dev/null +++ b/phpMyAdmin/doc/html/developers.html @@ -0,0 +1,109 @@ + + + + + + + + Developers Information — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Developers Information露

+

phpMyAdmin is Open Source, so you鈥檙e invited to contribute to it. Many +great features have been written by other people and you too can help +to make phpMyAdmin a useful tool.

+

You can check out all the possibilities to contribute in the +contribute section on our website.

+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/faq.html b/phpMyAdmin/doc/html/faq.html new file mode 100755 index 0000000..3677fee --- /dev/null +++ b/phpMyAdmin/doc/html/faq.html @@ -0,0 +1,2006 @@ + + + + + + + + FAQ - Frequently Asked Questions — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

FAQ - Frequently Asked Questions露

+

Please have a look at our Link section on the official +phpMyAdmin homepage for in-depth coverage of phpMyAdmin鈥檚 features and +or interface.

+
+

Server露

+
+

1.1 My server is crashing each time a specific action is required or phpMyAdmin sends a blank page or a page full of cryptic characters to my browser, what can I do?露

+

Try to set the $cfg['OBGzip'] directive to false in your +config.inc.php file and the zlib.output_compression directive to +Off in your php configuration file.

+
+
+

1.2 My Apache server crashes when using phpMyAdmin.露

+

You should first try the latest versions of Apache (and possibly MySQL). If +your server keeps crashing, please ask for help in the various Apache support +groups.

+ +
+
+

1.3 (withdrawn).露

+
+
+

1.4 Using phpMyAdmin on IIS, I鈥檓 displayed the error message: 鈥淭he specified CGI application misbehaved by not returning a complete set of HTTP headers 鈥︹��.露

+

You just forgot to read the install.txt file from the PHP +distribution. Have a look at the last message in this PHP bug report #12061 from the official PHP bug +database.

+
+
+

1.5 Using phpMyAdmin on IIS, I鈥檓 facing crashes and/or many error messages with the HTTP.露

+

This is a known problem with the PHP ISAPI filter: it鈥檚 not so stable. +Please use instead the cookie authentication mode.

+
+
+

1.6 I can鈥檛 use phpMyAdmin on PWS: nothing is displayed!露

+

This seems to be a PWS bug. Filippo Simoncini found a workaround (at +this time there is no better fix): remove or comment the DOCTYPE +declarations (2 lines) from the scripts libraries/Header.class.php +and index.php.

+
+
+

1.7 How can I gzip a dump or a CSV export? It does not seem to work.露

+

This feature is based on the gzencode() +PHP function to be more independent of the platform (Unix/Windows, +Safe Mode or not, and so on). So, you must have Zlib support +(--with-zlib).

+
+
+

1.8 I cannot insert a text file in a table, and I get an error about safe mode being in effect.露

+

Your uploaded file is saved by PHP in the 鈥渦pload dir鈥�, as defined in +php.ini by the variable upload_tmp_dir (usually the system +default is /tmp). We recommend the following setup for Apache +servers running in safe mode, to enable uploads of files while being +reasonably secure:

+
    +
  • create a separate directory for uploads: mkdir /tmp/php

  • +
  • give ownership to the Apache server鈥檚 user.group: chown +apache.apache /tmp/php

  • +
  • give proper permission: chmod 600 /tmp/php

  • +
  • put upload_tmp_dir = /tmp/php in php.ini

  • +
  • restart Apache

  • +
+
+
+

1.9 (withdrawn).露

+
+
+

1.10 I鈥檓 having troubles when uploading files with phpMyAdmin running on a secure server. My browser is Internet Explorer and I鈥檓 using the Apache server.露

+

As suggested by 鈥淩ob M鈥� in the phpWizard forum, add this line to your +httpd.conf:

+
SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
+
+
+

It seems to clear up many problems between Internet Explorer and SSL.

+
+
+

1.11 I get an 鈥榦pen_basedir restriction鈥� while uploading a file from the import tab.露

+

Since version 2.2.4, phpMyAdmin supports servers with open_basedir +restrictions. However you need to create temporary directory and configure it +as $cfg['TempDir']. The uploaded files will be moved there, +and after execution of your SQL commands, removed.

+
+
+

1.12 I have lost my MySQL root password, what can I do?露

+

phpMyAdmin does authenticate against MySQL server you鈥檙e using, so to recover +from phpMyAdmin password loss, you need to recover at MySQL level.

+

The MySQL manual explains how to reset the permissions.

+

If you are using MySQL server installed by your hosting provider, please +contact their support to recover the password for you.

+
+
+

1.13 (withdrawn).露

+
+
+

1.14 (withdrawn).露

+
+
+

1.15 I have problems with mysql.user column names.露

+

In previous MySQL versions, the User and Password columns were +named user and password. Please modify your column names to +align with current standards.

+
+
+

1.16 I cannot upload big dump files (memory, HTTP or timeout problems).露

+

Starting with version 2.7.0, the import engine has been re鈥搘ritten and +these problems should not occur. If possible, upgrade your phpMyAdmin +to the latest version to take advantage of the new import features.

+

The first things to check (or ask your host provider to check) are the values +of max_execution_time, upload_max_filesize, memory_limit and +post_max_size in the php.ini configuration file. All of these three +settings limit the maximum size of data that can be submitted and handled by +PHP. Please note that post_max_size needs to be larger than +upload_max_filesize. There exist several workarounds if your upload is too +big or your hosting provider is unwilling to change the settings:

+
    +
  • Look at the $cfg['UploadDir'] feature. This allows one to upload a file to the server +via scp, ftp, or your favorite file transfer method. PhpMyAdmin is +then able to import the files from the temporary directory. More +information is available in the Configuration of this document.

  • +
  • Using a utility (such as BigDump) to split the files before +uploading. We cannot support this or any third party applications, but +are aware of users having success with it.

  • +
  • If you have shell (command line) access, use MySQL to import the files +directly. You can do this by issuing the 鈥渟ource鈥� command from within +MySQL:

    +
    source filename.sql;
    +
    +
    +
  • +
+
+
+

1.17 Which Database versions does phpMyAdmin support?露

+

For MySQL, versions 5.5 and newer are supported. +For older MySQL versions, our Downloads page offers older phpMyAdmin versions +(which may have become unsupported).

+

For MariaDB, versions 5.5 and newer are supported.

+
+
+

1.17a I cannot connect to the MySQL server. It always returns the error message, 鈥淐lient does not support authentication protocol requested by server; consider upgrading MySQL client鈥�露

+

You tried to access MySQL with an old MySQL client library. The +version of your MySQL client library can be checked in your phpinfo() +output. In general, it should have at least the same minor version as +your server - as mentioned in 1.17 Which Database versions does phpMyAdmin support?. This problem is +generally caused by using MySQL version 4.1 or newer. MySQL changed +the authentication hash and your PHP is trying to use the old method. +The proper solution is to use the mysqli extension with the proper client library to match +your MySQL installation. More +information (and several workarounds) are located in the MySQL +Documentation.

+
+
+

1.18 (withdrawn).露

+
+
+

1.19 I can鈥檛 run the 鈥渄isplay relations鈥� feature because the script seems not to know the font face I鈥檓 using!露

+

The TCPDF library we鈥檙e using for this feature requires some special +files to use font faces. Please refers to the TCPDF manual to build these files.

+
+
+

1.20 I receive an error about missing mysqli and mysql extensions.露

+

To connect to a MySQL server, PHP needs a set of MySQL functions +called 鈥淢ySQL extension鈥�. This extension may be part of the PHP +distribution (compiled-in), otherwise it needs to be loaded +dynamically. Its name is probably mysqli.so or php_mysqli.dll. +phpMyAdmin tried to load the extension but failed. Usually, the +problem is solved by installing a software package called 鈥淧HP-MySQL鈥� +or something similar.

+

There are currently two interfaces PHP provides as MySQL extensions - mysql +and mysqli. The mysqli is tried first, because it鈥檚 the best one.

+

This problem can be also caused by wrong paths in the php.ini or using +wrong php.ini.

+

Make sure that the extension files do exist in the folder which the +extension_dir points to and that the corresponding lines in your +php.ini are not commented out (you can use phpinfo() to check +current setup):

+
[PHP]
+
+; Directory in which the loadable extensions (modules) reside.
+extension_dir = "C:/Apache2/modules/php/ext"
+
+
+

The php.ini can be loaded from several locations (especially on +Windows), so please check you鈥檙e updating the correct one. If using Apache, you +can tell it to use specific path for this file using PHPIniDir directive:

+
LoadFile "C:/php/php5ts.dll"
+LoadModule php5_module "C:/php/php5apache2_2.dll"
+<IfModule php5_module>
+    PHPIniDir "C:/PHP"
+    <Location>
+       AddType text/html .php
+       AddHandler application/x-httpd-php .php
+    </Location>
+</IfModule>
+
+
+

In some rare cases this problem can be also caused by other extensions loaded +in PHP which prevent MySQL extensions to be loaded. If anything else fails, you +can try commenting out extensions for other databses from php.ini.

+
+ +
+

1.22 I don鈥檛 see the 鈥淟ocation of text file鈥� field, so I cannot upload.露

+

This is most likely because in php.ini, your file_uploads +parameter is not set to 鈥渙n鈥�.

+
+
+

1.23 I鈥檓 running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase!露

+

This happens because the MySQL directive lower_case_table_names +defaults to 1 (ON) in the Win32 version of MySQL. You can change +this behavior by simply changing the directive to 0 (OFF): Just +edit your my.ini file that should be located in your Windows +directory and add the following line to the group [mysqld]:

+
set-variable = lower_case_table_names=0
+
+
+
+

Note

+

Forcing this variable to 0 with 鈥搇ower-case-table-names=0 on a +case-insensitive filesystem and access MyISAM tablenames using different +lettercases, index corruption may result.

+
+

Next, save the file and restart the MySQL service. You can always +check the value of this directive using the query

+
SHOW VARIABLES LIKE 'lower_case_table_names';
+
+
+ +
+
+

1.24 (withdrawn).露

+
+
+

1.25 I am running Apache with mod_gzip-1.3.26.1a on Windows XP, and I get problems, such as undefined variables when I run a SQL query.露

+

A tip from Jose Fandos: put a comment on the following two lines in +httpd.conf, like this:

+
# mod_gzip_item_include file \.php$
+# mod_gzip_item_include mime "application/x-httpd-php.*"
+
+
+

as this version of mod_gzip on Apache (Windows) has problems handling +PHP scripts. Of course you have to restart Apache.

+
+
+

1.26 I just installed phpMyAdmin in my document root of IIS but I get the error 鈥淣o input file specified鈥� when trying to run phpMyAdmin.露

+

This is a permission problem. Right-click on the phpmyadmin folder and +choose properties. Under the tab Security, click on 鈥淎dd鈥� and select +the user 鈥淚USR_machine鈥� from the list. Now set his permissions and it +should work.

+
+
+

1.27 I get empty page when I want to view huge page (eg. db_structure.php with plenty of tables).露

+

This was caused by a PHP bug that occur when +GZIP output buffering is enabled. If you turn off it (by +$cfg['OBGzip'] in config.inc.php), it should work. +This bug will has been fixed in PHP 5.0.0.

+
+
+

1.28 My MySQL server sometimes refuses queries and returns the message 鈥楨rrorcode: 13鈥�. What does this mean?露

+

This can happen due to a MySQL bug when having database / table names +with upper case characters although lower_case_table_names is +set to 1. To fix this, turn off this directive, convert all database +and table names to lower case and turn it on again. Alternatively, +there鈥檚 a bug-fix available starting with MySQL 3.23.56 / +4.0.11-gamma.

+
+
+

1.29 When I create a table or modify a column, I get an error and the columns are duplicated.露

+

It is possible to configure Apache in such a way that PHP has problems +interpreting .php files.

+

The problems occur when two different (and conflicting) set of +directives are used:

+
SetOutputFilter PHP
+SetInputFilter PHP
+
+
+

and

+
AddType application/x-httpd-php .php
+
+
+

In the case we saw, one set of directives was in +/etc/httpd/conf/httpd.conf, while the other set was in +/etc/httpd/conf/addon-modules/php.conf. The recommended way is +with AddType, so just comment out the first set of lines and +restart Apache:

+
#SetOutputFilter PHP
+#SetInputFilter PHP
+
+
+
+
+

1.30 I get the error 鈥渘avigation.php: Missing hash鈥�.露

+

This problem is known to happen when the server is running Turck +MMCache but upgrading MMCache to version 2.3.21 solves the problem.

+
+
+

1.31 Which PHP versions does phpMyAdmin support?露

+

Since release 4.5, phpMyAdmin supports only PHP 5.5 and newer. Since release +4.1 phpMyAdmin supports only PHP 5.3 and newer. For PHP 5.2 you can use 4.0.x +releases.

+

PHP 7 is supported since phpMyAdmin 4.6, PHP 7.1 is supported since 4.6.5, +PHP 7.2 is supported since 4.7.4.

+

phpMyAdmin also works fine with HHVM.

+
+
+

1.32 Can I use HTTP authentication with IIS?露

+

Yes. This procedure was tested with phpMyAdmin 2.6.1, PHP 4.3.9 in +ISAPI mode under IIS 5.1.

+
    +
  1. In your php.ini file, set cgi.rfc2616_headers = 0

  2. +
  3. In Web Site Properties -> File/Directory Security -> Anonymous +Access dialog box, check the Anonymous access checkbox and +uncheck any other checkboxes (i.e. uncheck Basic authentication, +Integrated Windows authentication, and Digest if it鈥檚 +enabled.) Click OK.

  4. +
  5. In Custom Errors, select the range of 401;1 through 401;5 +and click the Set to Default button.

  6. +
+
+

See also

+

RFC 2616

+
+
+
+

1.33 (withdrawn).露

+
+
+

1.34 Can I access directly to database or table pages?露

+

Yes. Out of the box, you can use URL like +http://server/phpMyAdmin/index.php?server=X&db=database&table=table&target=script. +For server you use the server number +which refers to the order of the server paragraph in +config.inc.php. Table and script parts are optional. If you want +http://server/phpMyAdmin/database[/table][/script] URL, you need to do some configuration. Following +lines apply only for Apache web server. +First make sure, that you have enabled some features within global +configuration. You need Options SymLinksIfOwnerMatch and AllowOverride +FileInfo enabled for directory where phpMyAdmin is installed and you +need mod_rewrite to be enabled. Then you just need to create +following .htaccess file in root folder of phpMyAdmin installation (don鈥檛 +forget to change directory name inside of it):

+
RewriteEngine On
+RewriteBase /path_to_phpMyAdmin
+RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&table=$2&target=$3 [R]
+RewriteRule ^([a-zA-Z0-9_]+)/([a-z_]+\.php)$ index.php?db=$1&target=$2 [R]
+RewriteRule ^([a-zA-Z0-9_]+)/([a-zA-Z0-9_]+)$ index.php?db=$1&table=$2 [R]
+RewriteRule ^([a-zA-Z0-9_]+)$ index.php?db=$1 [R]
+
+
+
+
+

1.35 Can I use HTTP authentication with Apache CGI?露

+

Yes. However you need to pass authentication variable to CGI using +following rewrite rule:

+
RewriteEngine On
+RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization},L]
+
+
+
+
+

1.36 I get an error 鈥�500 Internal Server Error鈥�.露

+

There can be many explanations to this and a look at your server鈥檚 +error log file might give a clue.

+
+ +
+

1.38 Can I use phpMyAdmin on a server on which Suhosin is enabled?露

+

Yes but the default configuration values of Suhosin are known to cause +problems with some operations, for example editing a table with many +columns and no primary key or with textual primary key.

+

Suhosin configuration might lead to malfunction in some cases and it +can not be fully avoided as phpMyAdmin is kind of application which +needs to transfer big amounts of columns in single HTTP request, what +is something what Suhosin tries to prevent. Generally all +suhosin.request.*, suhosin.post.* and suhosin.get.* +directives can have negative effect on phpMyAdmin usability. You can +always find in your error logs which limit did cause dropping of +variable, so you can diagnose the problem and adjust matching +configuration variable.

+

The default values for most Suhosin configuration options will work in +most scenarios, however you might want to adjust at least following +parameters:

+ +

To further improve security, we also recommend these modifications:

+ +

You can also disable the warning using the $cfg['SuhosinDisableWarning'].

+
+
+

1.39 When I try to connect via https, I can log in, but then my connection is redirected back to http. What can cause this behavior?露

+

This is caused by the fact that PHP scripts have no knowledge that the site is +using https. Depending on used webserver, you should configure it to let PHP +know about URL and scheme used to access it.

+

For example in Apache ensure that you have enabled SSLOptions and +StdEnvVars in the configuration.

+ +
+ +
+

1.41 When I view a database and ask to see its privileges, I get an error about an unknown column.露

+

The MySQL server鈥檚 privilege tables are not up to date, you need to +run the mysql_upgrade command on the server.

+
+
+

1.42 How can I prevent robots from accessing phpMyAdmin?露

+

You can add various rules to .htaccess to filter access based on user agent +field. This is quite easy to circumvent, but could prevent at least +some robots accessing your installation.

+
RewriteEngine on
+
+# Allow only GET and POST verbs
+RewriteCond %{REQUEST_METHOD} !^(GET|POST)$ [NC,OR]
+
+# Ban Typical Vulnerability Scanners and others
+# Kick out Script Kiddies
+RewriteCond %{HTTP_USER_AGENT} ^(java|curl|wget).* [NC,OR]
+RewriteCond %{HTTP_USER_AGENT} ^.*(libwww-perl|curl|wget|python|nikto|wkito|pikto|scan|acunetix).* [NC,OR]
+RewriteCond %{HTTP_USER_AGENT} ^.*(winhttp|HTTrack|clshttp|archiver|loader|email|harvest|extract|grab|miner).* [NC,OR]
+
+# Ban Search Engines, Crawlers to your administrative panel
+# No reasons to access from bots
+# Ultimately Better than the useless robots.txt
+# Did google respect robots.txt?
+# Try google: intitle:phpMyAdmin intext:"Welcome to phpMyAdmin *.*.*" intext:"Log in" -wiki -forum -forums -questions intext:"Cookies must be enabled"
+RewriteCond %{HTTP_USER_AGENT} ^.*(AdsBot-Google|ia_archiver|Scooter|Ask.Jeeves|Baiduspider|Exabot|FAST.Enterprise.Crawler|FAST-WebCrawler|www\.neomo\.de|Gigabot|Mediapartners-Google|Google.Desktop|Feedfetcher-Google|Googlebot|heise-IT-Markt-Crawler|heritrix|ibm.com\cs/crawler|ICCrawler|ichiro|MJ12bot|MetagerBot|msnbot-NewsBlogs|msnbot|msnbot-media|NG-Search|lucene.apache.org|NutchCVS|OmniExplorer_Bot|online.link.validator|psbot0|Seekbot|Sensis.Web.Crawler|SEO.search.Crawler|Seoma.\[SEO.Crawler\]|SEOsearch|Snappy|www.urltrends.com|www.tkl.iis.u-tokyo.ac.jp/~crawler|SynooBot|crawleradmin.t-info@telekom.de|TurnitinBot|voyager|W3.SiteSearch.Crawler|W3C-checklink|W3C_Validator|www.WISEnutbot.com|yacybot|Yahoo-MMCrawler|Yahoo\!.DE.Slurp|Yahoo\!.Slurp|YahooSeeker).* [NC]
+RewriteRule .* - [F]
+
+
+
+
+

1.43 Why can鈥檛 I display the structure of my table containing hundreds of columns?露

+

Because your PHP鈥檚 memory_limit is too low; adjust it in php.ini.

+
+
+

1.44 How can I reduce the installed size of phpMyAdmin on disk?露

+

Some users have requested to be able to reduce the size of the phpMyAdmin installation. +This is not recommended and could lead to confusion over missing features, but can be done. +A list of files and corresponding functionality which degrade gracefully when removed include:

+
    +
  • ./vendor/tecnickcom/tcpdf folder (exporting to PDF)

  • +
  • ./locale/ folder, or unused subfolders (interface translations)

  • +
  • Any unused themes in ./themes/

  • +
  • ./js/vendor/jquery/src/ (included for licensing reasons)

  • +
  • ./js/line_counts.php (removed in phpMyAdmin 4.8)

  • +
  • ./doc/ (documentation)

  • +
  • ./setup/ (setup script)

  • +
  • ./examples/

  • +
  • ./sql/ (SQL scripts to configure advanced functionality)

  • +
  • ./js/vendor/openlayers/ (GIS visualization)

  • +
+
+
+
+

Configuration露

+
+

2.1 The error message 鈥淲arning: Cannot add header information - headers already sent by 鈥︹�� is displayed, what鈥檚 the problem?露

+

Edit your config.inc.php file and ensure there is nothing (I.E. no +blank lines, no spaces, no characters鈥�) neither before the <?php tag at +the beginning, neither after the ?> tag at the end.

+
+
+

2.2 phpMyAdmin can鈥檛 connect to MySQL. What鈥檚 wrong?露

+

Either there is an error with your PHP setup or your username/password +is wrong. Try to make a small script which uses mysql_connect and see +if it works. If it doesn鈥檛, it may be you haven鈥檛 even compiled MySQL +support into PHP.

+
+
+

2.3 The error message 鈥淲arning: MySQL Connection Failed: Can鈥檛 connect to local MySQL server through socket 鈥�/tmp/mysql.sock鈥� (111) 鈥︹�� is displayed. What can I do?露

+

The error message can also be: Error #2002 - The server is not +responding (or the local MySQL server鈥檚 socket is not correctly configured).

+

First, you need to determine what socket is being used by MySQL. To do this, +connect to your server and go to the MySQL bin directory. In this directory +there should be a file named mysqladmin. Type ./mysqladmin variables, and +this should give you a bunch of info about your MySQL server, including the +socket (/tmp/mysql.sock, for example). You can also ask your ISP for the +connection info or, if you鈥檙e hosting your own, connect from the 鈥榤ysql鈥� +command-line client and type 鈥榮tatus鈥� to get the connection type and socket or +port number.

+

Then, you need to tell PHP to use this socket. You can do this for all PHP in +the php.ini or for phpMyAdmin only in the config.inc.php. For +example: $cfg['Servers'][$i]['socket'] Please also make sure +that the permissions of this file allow to be readable by your webserver.

+

On my RedHat-Box the socket of MySQL is /var/lib/mysql/mysql.sock. +In your php.ini you will find a line

+
mysql.default_socket = /tmp/mysql.sock
+
+
+

change it to

+
mysql.default_socket = /var/lib/mysql/mysql.sock
+
+
+

Then restart apache and it will work.

+

Have also a look at the corresponding section of the MySQL +documentation.

+
+
+

2.4 Nothing is displayed by my browser when I try to run phpMyAdmin, what can I do?露

+

Try to set the $cfg['OBGzip'] directive to false in the phpMyAdmin configuration +file. It helps sometime. Also have a look at your PHP version number: +if it contains 鈥渂鈥� or 鈥渁lpha鈥� it means you鈥檙e running a testing +version of PHP. That鈥檚 not a so good idea, please upgrade to a plain +revision.

+
+ +
+

2.6 I get an 鈥淎ccess denied for user: 鈥榬oot@localhost鈥� (Using password: YES)鈥�-error when trying to access a MySQL-Server on a host which is port-forwarded for my localhost.露

+

When you are using a port on your localhost, which you redirect via +port-forwarding to another host, MySQL is not resolving the localhost +as expected. Erik Wasser explains: The solution is: if your host is +鈥渓ocalhost鈥� MySQL (the command line tool mysql as well) always +tries to use the socket connection for speeding up things. And that +doesn鈥檛 work in this configuration with port forwarding. If you enter +鈥�127.0.0.1鈥� as hostname, everything is right and MySQL uses the +TCP connection.

+
+
+

2.7 Using and creating themes露

+

See Custom Themes.

+
+
+

2.8 I get 鈥淢issing parameters鈥� errors, what can I do?露

+

Here are a few points to check:

+
    +
  • In config.inc.php, try to leave the $cfg['PmaAbsoluteUri'] directive empty. See also +4.7 Authentication window is displayed more than once, why?.

  • +
  • Maybe you have a broken PHP installation or you need to upgrade your +Zend Optimizer. See <https://bugs.php.net/bug.php?id=31134>.

  • +
  • If you are using Hardened PHP with the ini directive +varfilter.max_request_variables set to the default (200) or +another low value, you could get this error if your table has a high +number of columns. Adjust this setting accordingly. (Thanks to Klaus +Dorninger for the hint).

  • +
  • In the php.ini directive arg_separator.input, a value of 鈥�;鈥� +will cause this error. Replace it with 鈥�&;鈥�.

  • +
  • If you are using Suhosin, you +might want to increase request limits.

  • +
  • The directory specified in the php.ini directive +session.save_path does not exist or is read-only (this can be caused +by bug in the PHP installer).

  • +
+
+
+

2.9 Seeing an upload progress bar露

+

To be able to see a progress bar during your uploads, your server must +have the APC extension, the +uploadprogress one, or +you must be running PHP 5.4.0 or higher. Moreover, the JSON extension +has to be enabled in your PHP.

+

If using APC, you must set apc.rfc1867 to on in your php.ini.

+

If using PHP 5.4.0 or higher, you must set +session.upload_progress.enabled to 1 in your php.ini. However, +starting from phpMyAdmin version 4.0.4, session-based upload progress has +been temporarily deactivated due to its problematic behavior.

+
+

See also

+

RFC 1867

+
+
+
+
+

Known limitations露

+
+

3.1 When using HTTP authentication, a user who logged out can not log in again in with the same nick.露

+

This is related to the authentication mechanism (protocol) used by +phpMyAdmin. To bypass this problem: just close all the opened browser +windows and then go back to phpMyAdmin. You should be able to log in +again.

+
+
+

3.2 When dumping a large table in compressed mode, I get a memory limit error or a time limit error.露

+

Compressed dumps are built in memory and because of this are limited +to php鈥檚 memory limit. For gzip/bzip2 exports this can be overcome +since 2.5.4 using $cfg['CompressOnFly'] (enabled by default). +zip exports can not be handled this way, so if you need zip files for larger +dump, you have to use another way.

+
+
+

3.3 With InnoDB tables, I lose foreign key relationships when I rename a table or a column.露

+

This is an InnoDB bug, see <https://bugs.mysql.com/bug.php?id=21704>.

+
+
+

3.4 I am unable to import dumps I created with the mysqldump tool bundled with the MySQL server distribution.露

+

The problem is that older versions of mysqldump created invalid +comments like this:

+
-- MySQL dump 8.22
+--
+-- Host: localhost Database: database
+---------------------------------------------------------
+-- Server version 3.23.54
+
+
+

The invalid part of the code is the horizontal line made of dashes +that appears once in every dump created with mysqldump. If you want to +run your dump you have to turn it into valid MySQL. This means, you +have to add a whitespace after the first two dashes of the line or add +a # before it: -- ------------------------------------------------------- or +#---------------------------------------------------------

+
+
+

3.5 When using nested folders, multiple hierarchies are displayed in a wrong manner.露

+

Please note that you should not use the separating string multiple +times without any characters between them, or at the beginning/end of +your table name. If you have to, think about using another +TableSeparator or disabling that feature.

+ +
+
+

3.6 (withdrawn).露

+
+
+

3.7 I have table with many (100+) columns and when I try to browse table I get series of errors like 鈥淲arning: unable to parse url鈥�. How can this be fixed?露

+

Your table neither have a primary key nor an unique key, so we must +use a long expression to identify this row. This causes problems to +parse_url function. The workaround is to create a primary key +or unique key.

+
+
+

3.8 I cannot use (clickable) HTML-forms in columns where I put a MIME-Transformation onto!露

+

Due to a surrounding form-container (for multi-row delete checkboxes), +no nested forms can be put inside the table where phpMyAdmin displays +the results. You can, however, use any form inside of a table if keep +the parent form-container with the target to tbl_row_delete.php and +just put your own input-elements inside. If you use a custom submit +input field, the form will submit itself to the displaying page again, +where you can validate the $HTTP_POST_VARS in a transformation. For +a tutorial on how to effectively use transformations, see our Link +section on the +official phpMyAdmin-homepage.

+
+
+

3.9 I get error messages when using 鈥溾�搒ql_mode=ANSI鈥� for the MySQL server.露

+

When MySQL is running in ANSI-compatibility mode, there are some major +differences in how SQL is structured (see +<https://dev.mysql.com/doc/refman/5.7/en/sql-mode.html>). Most important of all, the +quote-character (鈥�) is interpreted as an identifier quote character and not as +a string quote character, which makes many internal phpMyAdmin operations into +invalid SQL statements. There is no +workaround to this behaviour. News to this item will be posted in issue +#7383.

+
+
+

3.10 Homonyms and no primary key: When the results of a SELECT display more that one column with the same value (for example SELECT lastname from employees where firstname like 'A%' and two 鈥淪mith鈥� values are displayed), if I click Edit I cannot be sure that I am editing the intended row.露

+

Please make sure that your table has a primary key, so that phpMyAdmin +can use it for the Edit and Delete links.

+
+
+

3.11 The number of rows for InnoDB tables is not correct.露

+

phpMyAdmin uses a quick method to get the row count, and this method only +returns an approximate count in the case of InnoDB tables. See +$cfg['MaxExactCount'] for a way to modify those results, but +this could have a serious impact on performance. +However, one can easily replace the approximate row count with exact count by +simply clicking on the approximate count. This can also be done for all tables +at once by clicking on the rows sum displayed at the bottom.

+
+

See also

+

$cfg['MaxExactCount']

+
+
+
+

3.12 (withdrawn).露

+
+
+

3.13 I get an error when entering USE followed by a db name containing an hyphen.露

+

The tests I have made with MySQL 5.1.49 shows that the API does not +accept this syntax for the USE command.

+
+
+

3.14 I am not able to browse a table when I don鈥檛 have the right to SELECT one of the columns.露

+

This has been a known limitation of phpMyAdmin since the beginning and +it鈥檚 not likely to be solved in the future.

+
+
+

3.15 (withdrawn).露

+
+
+

3.16 (withdrawn).露

+
+
+

3.17 (withdrawn).露

+
+
+

3.18 When I import a CSV file that contains multiple tables, they are lumped together into a single table.露

+

There is no reliable way to differentiate tables in CSV format. For the +time being, you will have to break apart CSV files containing multiple +tables.

+
+
+

3.19 When I import a file and have phpMyAdmin determine the appropriate data structure it only uses int, decimal, and varchar types.露

+

Currently, the import type-detection system can only assign these +MySQL types to columns. In future, more will likely be added but for +the time being you will have to edit the structure to your liking +post-import. Also, you should note the fact that phpMyAdmin will use +the size of the largest item in any given column as the column size +for the appropriate type. If you know you will be adding larger items +to that column then you should manually adjust the column sizes +accordingly. This is done for the sake of efficiency.

+
+
+

3.20 After upgrading, some bookmarks are gone or their content cannot be shown.露

+

At some point, the character set used to store bookmark content has changed. +It鈥檚 better to recreate your bookmark from the newer phpMyAdmin version.

+
+
+

3.21 I am unable to log in with a username containing unicode characters such as 谩.露

+

This can happen if MySQL server is not configured to use utf-8 as default +charset. This is a limitation of how PHP and the MySQL server interact; there +is no way for PHP to set the charset before authenticating.

+ +
+
+
+

ISPs, multi-user installations露

+
+

4.1 I鈥檓 an ISP. Can I setup one central copy of phpMyAdmin or do I need to install it for each customer?露

+

Since version 2.0.3, you can setup a central copy of phpMyAdmin for all your +users. The development of this feature was kindly sponsored by NetCologne GmbH. +This requires a properly setup MySQL user management and phpMyAdmin +HTTP or cookie authentication.

+ +
+
+

4.2 What鈥檚 the preferred way of making phpMyAdmin secure against evil access?露

+

This depends on your system. If you鈥檙e running a server which cannot be +accessed by other people, it鈥檚 sufficient to use the directory protection +bundled with your webserver (with Apache you can use .htaccess files, +for example). If other people have telnet access to your server, you should use +phpMyAdmin鈥檚 HTTP or cookie authentication features.

+

Suggestions:

+
    +
  • Your config.inc.php file should be chmod 660.

  • +
  • All your phpMyAdmin files should be chown -R phpmy.apache, where phpmy +is a user whose password is only known to you, and apache is the group +under which Apache runs.

  • +
  • Follow security recommendations for PHP and your webserver.

  • +
+
+
+

4.3 I get errors about not being able to include a file in /lang or in /libraries.露

+

Check php.ini, or ask your sysadmin to check it. The +include_path must contain 鈥�.鈥� somewhere in it, and +open_basedir, if used, must contain 鈥�.鈥� and 鈥�./lang鈥� to allow +normal operation of phpMyAdmin.

+
+
+

4.4 phpMyAdmin always gives 鈥淎ccess denied鈥� when using HTTP authentication.露

+

This could happen for several reasons:

+ +
+
+

4.5 Is it possible to let users create their own databases?露

+

Starting with 2.2.5, in the user management page, you can enter a +wildcard database name for a user (for example 鈥渏oe%鈥�), and put the +privileges you want. For example, adding SELECT, INSERT, UPDATE, +DELETE, CREATE, DROP, INDEX, ALTER would let a user create/manage +his/her database(s).

+
+
+

4.6 How can I use the Host-based authentication additions?露

+

If you have existing rules from an old .htaccess file, you can take them and +add a username between the 'deny'/'allow' and 'from' +strings. Using the username wildcard of '%' would be a major +benefit here if your installation is suited to using it. Then you can +just add those updated lines into the +$cfg['Servers'][$i]['AllowDeny']['rules'] array.

+

If you want a pre-made sample, you can try this fragment. It stops the +鈥榬oot鈥� user from logging in from any networks other than the private +network IP blocks.

+
//block root from logging in except from the private networks
+$cfg['Servers'][$i]['AllowDeny']['order'] = 'deny,allow';
+$cfg['Servers'][$i]['AllowDeny']['rules'] = array(
+    'deny root from all',
+    'allow root from localhost',
+    'allow root from 10.0.0.0/8',
+    'allow root from 192.168.0.0/16',
+    'allow root from 172.16.0.0/12',
+);
+
+
+
+
+

4.7 Authentication window is displayed more than once, why?露

+

This happens if you are using a URL to start phpMyAdmin which is +different than the one set in your $cfg['PmaAbsoluteUri']. For +example, a missing 鈥渨ww鈥�, or entering with an IP address while a domain +name is defined in the config file.

+
+
+

4.8 Which parameters can I use in the URL that starts phpMyAdmin?露

+

When starting phpMyAdmin, you can use the db +and server parameters. This last one can contain +either the numeric host index (from $i of the configuration file) +or one of the host names present in the configuration file.

+

For example, to jump directly to a particular database, a URL can be constructed as +https://example.com/phpmyadmin/?db=sakila.

+
+

Changed in version 4.9.0: Support for using the pma_username and pma_password parameters was removed +in phpMyAdmin 4.9.0 (see PMASA-2019-4).

+
+
+
+
+

Browsers or client OS露

+
+

5.1 I get an out of memory error, and my controls are non-functional, when trying to create a table with more than 14 columns.露

+

We could reproduce this problem only under Win98/98SE. Testing under +WinNT4 or Win2K, we could easily create more than 60 columns. A +workaround is to create a smaller number of columns, then come back to +your table properties and add the other columns.

+
+
+

5.2 With Xitami 2.5b4, phpMyAdmin won鈥檛 process form fields.露

+

This is not a phpMyAdmin problem but a Xitami known bug: you鈥檒l face +it with each script/website that use forms. Upgrade or downgrade your +Xitami server.

+
+
+

5.3 I have problems dumping tables with Konqueror (phpMyAdmin 2.2.2).露

+

With Konqueror 2.1.1: plain dumps, zip and gzip dumps work ok, except +that the proposed file name for the dump is always 鈥榯bl_dump.php鈥�. +The bzip2 dumps don鈥檛 seem to work. With Konqueror 2.2.1: plain dumps +work; zip dumps are placed into the user鈥檚 temporary directory, so +they must be moved before closing Konqueror, or else they disappear. +gzip dumps give an error message. Testing needs to be done for +Konqueror 2.2.2.

+
+ +
+

5.5 (withdrawn).露

+
+
+

5.6 (withdrawn).露

+
+
+

5.7 I refresh (reload) my browser, and come back to the welcome page.露

+

Some browsers support right-clicking into the frame you want to +refresh, just do this in the right frame.

+
+
+

5.8 With Mozilla 0.9.7 I have problems sending a query modified in the query box.露

+

Looks like a Mozilla bug: 0.9.6 was OK. We will keep an eye on future +Mozilla versions.

+
+
+

5.9 With Mozilla 0.9.? to 1.0 and Netscape 7.0-PR1 I can鈥檛 type a whitespace in the SQL-Query edit area: the page scrolls down.露

+

This is a Mozilla bug (see bug #26882 at BugZilla).

+
+
+

5.10 (withdrawn).露

+
+
+

5.11 Extended-ASCII characters like German umlauts are displayed wrong.露

+

Please ensure that you have set your browser鈥檚 character set to the +one of the language file you have selected on phpMyAdmin鈥檚 start page. +Alternatively, you can try the auto detection mode that is supported +by the recent versions of the most browsers.

+
+
+

5.12 Mac OS X Safari browser changes special characters to 鈥�?鈥�.露

+

This issue has been reported by a Mac OS X user, who adds that Chimera, +Netscape and Mozilla do not have this problem.

+
+
+

5.13 (withdrawn)露

+
+
+

5.14 (withdrawn)露

+
+
+

5.15 (withdrawn)露

+
+
+

5.16 With Internet Explorer, I get 鈥淎ccess is denied鈥� Javascript errors. Or I cannot make phpMyAdmin work under Windows.露

+

Please check the following points:

+
    +
  • Maybe you have defined your $cfg['PmaAbsoluteUri'] setting in +config.inc.php to an IP address and you are starting phpMyAdmin +with a URL containing a domain name, or the reverse situation.

  • +
  • Security settings in IE and/or Microsoft Security Center are too high, +thus blocking scripts execution.

  • +
  • The Windows Firewall is blocking Apache and MySQL. You must allow +HTTP ports (80 or 443) and MySQL +port (usually 3306) in the 鈥渋n鈥� and 鈥渙ut鈥� directions.

  • +
+
+
+

5.17 With Firefox, I cannot delete rows of data or drop a database.露

+

Many users have confirmed that the Tabbrowser Extensions plugin they +installed in their Firefox is causing the problem.

+
+
+

5.18 (withdrawn)露

+
+
+

5.19 I get JavaScript errors in my browser.露

+

Issues have been reported with some combinations of browser +extensions. To troubleshoot, disable all extensions then clear your +browser cache to see if the problem goes away.

+
+
+

5.20 I get errors about violating Content Security Policy.露

+

If you see errors like:

+
Refused to apply inline style because it violates the following Content Security Policy directive
+
+
+

This is usually caused by some software, which wrongly rewrites +Content Security Policy headers. Usually this is caused by +antivirus proxy or browser addons which are causing such errors.

+

If you see these errors, try disabling the HTTP proxy in antivirus or disable +the Content Security Policy rewriting in it. If that doesn鈥檛 +help, try disabling browser extensions.

+

Alternatively it can be also server configuration issue (if the webserver is +configured to emit Content Security Policy headers, they can +override the ones from phpMyAdmin).

+

Programs known to cause these kind of errors:

+
    +
  • Kaspersky Internet Security

  • +
+
+
+

5.21 I get errors about potentially unsafe operation when browsing table or executing SQL query.露

+

If you see errors like:

+
A potentially unsafe operation has been detected in your request to this site.
+
+
+

This is usually caused by web application firewall doing requests filtering. It +tries to prevent SQL injection, however phpMyAdmin is tool designed to execute +SQL queries, thus it makes it unusable.

+

Please whitelist phpMyAdmin scripts from the web application firewall settings +or disable it completely for phpMyAdmin path.

+

Programs known to cause these kind of errors:

+
    +
  • Wordfence Web Application Firewall

  • +
+
+
+
+

Using phpMyAdmin露

+
+

6.1 I can鈥檛 insert new rows into a table / I can鈥檛 create a table - MySQL brings up a SQL error.露

+

Examine the SQL error with care. +Often the problem is caused by specifying a wrong column-type. Common +errors include:

+
    +
  • Using VARCHAR without a size argument

  • +
  • Using TEXT or BLOB with a size argument

  • +
+

Also, look at the syntax chapter in the MySQL manual to confirm that +your syntax is correct.

+
+
+

6.2 When I create a table, I set an index for two columns and phpMyAdmin generates only one index with those two columns.露

+

This is the way to create a multi-columns index. If you want two +indexes, create the first one when creating the table, save, then +display the table properties and click the Index link to create the +other index.

+
+
+

6.3 How can I insert a null value into my table?露

+

Since version 2.2.3, you have a checkbox for each column that can be +null. Before 2.2.3, you had to enter 鈥渘ull鈥�, without the quotes, as +the column鈥檚 value. Since version 2.5.5, you have to use the checkbox +to get a real NULL value, so if you enter 鈥淣ULL鈥� this means you want a +literal NULL in the column, and not a NULL value (this works in PHP4).

+
+
+

6.4 How can I backup my database or table?露

+

Click on a database or table name in the navigation panel, the properties will +be displayed. Then on the menu, click 鈥淓xport鈥�, you can dump the structure, the +data, or both. This will generate standard SQL statements that can be +used to recreate your database/table. You will need to choose 鈥淪ave as file鈥�, +so that phpMyAdmin can transmit the resulting dump to your station. Depending +on your PHP configuration, you will see options to compress the dump. See also +the $cfg['ExecTimeLimit'] configuration variable. For +additional help on this subject, look for the word 鈥渄ump鈥� in this document.

+
+
+

6.5 How can I restore (upload) my database or table using a dump? How can I run a 鈥�.sql鈥� file?露

+

Click on a database name in the navigation panel, the properties will +be displayed. Select 鈥淚mport鈥� from the list of tabs in the right鈥揾and +frame (or 鈥�SQL鈥� if your phpMyAdmin +version is previous to 2.7.0). In the 鈥淟ocation of the text file鈥� +section, type in the path to your dump filename, or use the Browse +button. Then click Go. With version 2.7.0, the import engine has been +re鈥搘ritten, if possible it is suggested that you upgrade to take +advantage of the new features. For additional help on this subject, +look for the word 鈥渦pload鈥� in this document.

+

Note: For errors while importing of dumps exported from older MySQL versions to newer MySQL versions, +please check 6.41 I get import errors while importing the dumps exported from older MySQL versions (pre-5.7.6) into newer MySQL versions (5.7.7+), but they work fine when imported back on same older versions ?.

+
+
+

6.6 How can I use the relation table in Query-by-example?露

+

Here is an example with the tables persons, towns and countries, all +located in the database 鈥渕ydb鈥�. If you don鈥檛 have a pma__relation +table, create it as explained in the configuration section. Then +create the example tables:

+
CREATE TABLE REL_countries (
+country_code char(1) NOT NULL default '',
+description varchar(10) NOT NULL default '',
+PRIMARY KEY (country_code)
+) ENGINE=MyISAM;
+
+INSERT INTO REL_countries VALUES ('C', 'Canada');
+
+CREATE TABLE REL_persons (
+id tinyint(4) NOT NULL auto_increment,
+person_name varchar(32) NOT NULL default '',
+town_code varchar(5) default '0',
+country_code char(1) NOT NULL default '',
+PRIMARY KEY (id)
+) ENGINE=MyISAM;
+
+INSERT INTO REL_persons VALUES (11, 'Marc', 'S', 'C');
+INSERT INTO REL_persons VALUES (15, 'Paul', 'S', 'C');
+
+CREATE TABLE REL_towns (
+town_code varchar(5) NOT NULL default '0',
+description varchar(30) NOT NULL default '',
+PRIMARY KEY (town_code)
+) ENGINE=MyISAM;
+
+INSERT INTO REL_towns VALUES ('S', 'Sherbrooke');
+INSERT INTO REL_towns VALUES ('M', 'Montr茅al');
+
+
+

To setup appropriate links and display information:

+
    +
  • on table 鈥淩EL_persons鈥� click Structure, then Relation view

  • +
  • for 鈥渢own_code鈥�, choose from dropdowns, 鈥渕ydb鈥�, 鈥淩EL_towns鈥�, 鈥渃ode鈥� +for foreign database, table and column respectively

  • +
  • for 鈥渃ountry_code鈥�, choose from dropdowns, 鈥渕ydb鈥�, 鈥淩EL_countries鈥�, +鈥渃ountry_code鈥� for foreign database, table and column respectively

  • +
  • on table 鈥淩EL_towns鈥� click Structure, then Relation view

  • +
  • in 鈥淐hoose column to display鈥�, choose 鈥渄escription鈥�

  • +
  • repeat the two previous steps for table 鈥淩EL_countries鈥�

  • +
+

Then test like this:

+
    +
  • Click on your db name in the navigation panel

  • +
  • Choose 鈥淨uery鈥�

  • +
  • Use tables: persons, towns, countries

  • +
  • Click 鈥淯pdate query鈥�

  • +
  • In the columns row, choose persons.person_name and click the 鈥淪how鈥� +tickbox

  • +
  • Do the same for towns.description and countries.descriptions in the +other 2 columns

  • +
  • Click 鈥淯pdate query鈥� and you will see in the query box that the +correct joins have been generated

  • +
  • Click 鈥淪ubmit query鈥�

  • +
+
+
+

6.7 How can I use the 鈥渄isplay column鈥� feature?露

+

Starting from the previous example, create the pma__table_info as +explained in the configuration section, then browse your persons +table, and move the mouse over a town code or country code. See also +6.21 In edit/insert mode, how can I see a list of possible values for a column, based on some foreign table? for an additional feature that 鈥渄isplay column鈥� +enables: drop-down list of possible values.

+
+
+

6.8 How can I produce a PDF schema of my database?露

+

First the configuration variables 鈥渞elation鈥�, 鈥渢able_coords鈥� and +鈥減df_pages鈥� have to be filled in. Then you need to think about your +schema layout. Which tables will go on which pages?

+
    +
  • Select your database in the navigation panel.

  • +
  • Choose 鈥淥perations鈥� in the navigation bar at the top.

  • +
  • Choose 鈥淓dit PDF Pages鈥� near the +bottom of the page.

  • +
  • Enter a name for the first PDF page +and click Go. If you like, you can use the 鈥渁utomatic layout,鈥� which +will put all your linked tables onto the new page.

  • +
  • Select the name of the new page (making sure the Edit radio button is +selected) and click Go.

  • +
  • Select a table from the list, enter its coordinates and click Save. +Coordinates are relative; your diagram will be automatically scaled to +fit the page. When initially placing tables on the page, just pick any +coordinates 鈥� say, 50x50. After clicking Save, you can then use the +6.28 How can I easily edit relational schema for export? to position the element correctly.

  • +
  • When you鈥檇 like to look at your PDF, first be sure to click the Save +button beneath the list of tables and coordinates, to save any changes you +made there. Then scroll all the way down, select the PDF options you +want, and click Go.

  • +
  • Internet Explorer for Windows may suggest an incorrect filename when +you try to save a generated PDF. +When saving a generated PDF, be +sure that the filename ends in 鈥�.pdf鈥�, for example 鈥渟chema.pdf鈥�. +Browsers on other operating systems, and other browsers on Windows, do +not have this problem.

  • +
+
+

See also

+

Relations

+
+
+
+

6.9 phpMyAdmin is changing the type of one of my columns!露

+

No, it鈥檚 MySQL that is doing silent column type changing.

+
+
+

6.10 When creating a privilege, what happens with underscores in the database name?露

+

If you do not put a backslash before the underscore, this is a +wildcard grant, and the underscore means 鈥渁ny character鈥�. So, if the +database name is 鈥渏ohn_db鈥�, the user would get rights to john1db, +john2db 鈥� If you put a backslash before the underscore, it means +that the database name will have a real underscore.

+
+
+

6.11 What is the curious symbol 酶 in the statistics pages?露

+

It means 鈥渁verage鈥�.

+
+
+

6.12 I want to understand some Export options.露

+

Structure:

+
    +
  • 鈥淎dd DROP TABLE鈥� will add a line telling MySQL to drop the table, if it already +exists during the import. It does NOT drop the table after your +export, it only affects the import file.

  • +
  • 鈥淚f Not Exists鈥� will only create the table if it doesn鈥檛 exist. +Otherwise, you may get an error if the table name exists but has a +different structure.

  • +
  • 鈥淎dd AUTO_INCREMENT value鈥� ensures that AUTO_INCREMENT value (if +any) will be included in backup.

  • +
  • 鈥淓nclose table and column names with backquotes鈥� ensures that column +and table names formed with special characters are protected.

  • +
  • 鈥淎dd into comments鈥� includes column comments, relations, and MIME +types set in the pmadb in the dump as SQL comments +(/* xxx */).

  • +
+

Data:

+
    +
  • 鈥淐omplete inserts鈥� adds the column names on every INSERT command, for +better documentation (but resulting file is bigger).

  • +
  • 鈥淓xtended inserts鈥� provides a shorter dump file by using only once the +INSERT verb and the table name.

  • +
  • 鈥淒elayed inserts鈥� are best explained in the MySQL manual - INSERT DELAYED Syntax.

  • +
  • 鈥淚gnore inserts鈥� treats errors as a warning instead. Again, more info +is provided in the MySQL manual - INSERT Syntax, but basically with +this selected, invalid values are adjusted and inserted rather than +causing the entire statement to fail.

  • +
+
+
+

6.13 I would like to create a database with a dot in its name.露

+

This is a bad idea, because in MySQL the syntax 鈥渄atabase.table鈥� is +the normal way to reference a database and table name. Worse, MySQL +will usually let you create a database with a dot, but then you cannot +work with it, nor delete it.

+
+
+

6.14 (withdrawn).露

+
+
+

6.15 I want to add a BLOB column and put an index on it, but MySQL says 鈥淏LOB column 鈥樷�︹�� used in key specification without a key length鈥�.露

+

The right way to do this, is to create the column without any indexes, +then display the table structure and use the 鈥淐reate an index鈥� dialog. +On this page, you will be able to choose your BLOB column, and set a +size to the index, which is the condition to create an index on a BLOB +column.

+
+
+

6.16 How can I simply move in page with plenty editing fields?露

+

You can use Ctrl+arrows (Option+Arrows in Safari) for moving on +most pages with many editing fields (table structure changes, row editing, +etc.).

+
+
+

6.17 Transformations: I can鈥檛 enter my own mimetype! What is this feature then useful for?露

+

Defining mimetypes is of no use if you can鈥檛 put +transformations on them. Otherwise you could just put a comment on the +column. Because entering your own mimetype will cause serious syntax +checking issues and validation, this introduces a high-risk false- +user-input situation. Instead you have to initialize mimetypes using +functions or empty mimetype definitions.

+

Plus, you have a whole overview of available mimetypes. Who knows all those +mimetypes by heart so he/she can enter it at will?

+
+
+

6.18 Bookmarks: Where can I store bookmarks? Why can鈥檛 I see any bookmarks below the query box? What are these variables for?露

+

You need to have configured the phpMyAdmin configuration storage for using bookmarks +feature. Once you have done that, you can use bookmarks in the SQL tab.

+
+

See also

+

Bookmarks

+
+
+
+

6.19 How can I create simple LATEX document to include exported table?露

+

You can simply include table in your LATEX documents, +minimal sample document should look like following one (assuming you +have table exported in file table.tex):

+
\documentclass{article} % or any class you want
+\usepackage{longtable}  % for displaying table
+\begin{document}        % start of document
+\include{table}         % including exported table
+\end{document}          % end of document
+
+
+
+
+

6.20 I see a lot of databases which are not mine, and cannot access them.露

+

You have one of these global privileges: CREATE TEMPORARY TABLES, SHOW +DATABASES, LOCK TABLES. Those privileges also enable users to see all the +database names. So if your users do not need those privileges, you can remove +them and their databases list will shorten.

+ +
+
+

6.21 In edit/insert mode, how can I see a list of possible values for a column, based on some foreign table?露

+

You have to setup appropriate links between the tables, and also setup +the 鈥渄isplay column鈥� in the foreign table. See 6.6 How can I use the relation table in Query-by-example? for an +example. Then, if there are 100 values or less in the foreign table, a +drop-down list of values will be available. You will see two lists of +values, the first list containing the key and the display column, the +second list containing the display column and the key. The reason for +this is to be able to type the first letter of either the key or the +display column. For 100 values or more, a distinct window will appear, +to browse foreign key values and choose one. To change the default +limit of 100, see $cfg['ForeignKeyMaxLimit'].

+
+
+

6.22 Bookmarks: Can I execute a default bookmark automatically when entering Browse mode for a table?露

+

Yes. If a bookmark has the same label as a table name and it鈥檚 not a +public bookmark, it will be executed.

+
+

See also

+

Bookmarks

+
+
+
+

6.23 Export: I heard phpMyAdmin can export Microsoft Excel files?露

+

You can use CSV for Microsoft Excel, +which works out of the box.

+
+

Changed in version 3.4.5: Since phpMyAdmin 3.4.5 support for direct export to Microsoft Excel version +97 and newer was dropped.

+
+
+
+

6.24 Now that phpMyAdmin supports native MySQL 4.1.x column comments, what happens to my column comments stored in pmadb?露

+

Automatic migration of a table鈥檚 pmadb-style column comments to the +native ones is done whenever you enter Structure page for this table.

+
+
+

6.25 (withdrawn).露

+
+
+

6.26 How can I select a range of rows?露

+

Click the first row of the range, hold the shift key and click the +last row of the range. This works everywhere you see rows, for example +in Browse mode or on the Structure page.

+
+
+

6.27 What format strings can I use?露

+

In all places where phpMyAdmin accepts format strings, you can use +@VARIABLE@ expansion and strftime +format strings. The expanded variables depend on a context (for +example, if you haven鈥檛 chosen a table, you can not get the table +name), but the following variables can be used:

+
+
@HTTP_HOST@

HTTP host that runs phpMyAdmin

+
+
@SERVER@

MySQL server name

+
+
@VERBOSE@

Verbose MySQL server name as defined in $cfg['Servers'][$i]['verbose']

+
+
@VSERVER@

Verbose MySQL server name if set, otherwise normal

+
+
@DATABASE@

Currently opened database

+
+
@TABLE@

Currently opened table

+
+
@COLUMNS@

Columns of the currently opened table

+
+
@PHPMYADMIN@

phpMyAdmin with version

+
+
+
+
+

6.28 How can I easily edit relational schema for export?露

+

By clicking on the button 鈥榯oggle scratchboard鈥� on the page where you +edit x/y coordinates of those elements you can activate a scratchboard +where all your elements are placed. By clicking on an element, you can +move them around in the pre-defined area and the x/y coordinates will +get updated dynamically. Likewise, when entering a new position +directly into the input field, the new position in the scratchboard +changes after your cursor leaves the input field.

+

You have to click on the 鈥極K鈥�-button below the tables to save the new +positions. If you want to place a new element, first add it to the +table of elements and then you can drag the new element around.

+

By changing the paper size and the orientation you can change the size +of the scratchboard as well. You can do so by just changing the +dropdown field below, and the scratchboard will resize automatically, +without interfering with the current placement of the elements.

+

If ever an element gets out of range you can either enlarge the paper +size or click on the 鈥榬eset鈥� button to place all elements below each +other.

+
+
+

6.29 Why can鈥檛 I get a chart from my query result table?露

+

Not every table can be put to the chart. Only tables with one, two or +three columns can be visualised as a chart. Moreover the table must be +in a special format for chart script to understand it. Currently +supported formats can be found in Charts.

+
+
+

6.30 Import: How can I import ESRI Shapefiles?露

+

An ESRI Shapefile is actually a set of several files, where .shp file +contains geometry data and .dbf file contains data related to those +geometry data. To read data from .dbf file you need to have PHP +compiled with the dBase extension (鈥揺nable-dbase). Otherwise only +geometry data will be imported.

+

To upload these set of files you can use either of the following +methods:

+

Configure upload directory with $cfg['UploadDir'], upload both .shp and .dbf files with +the same filename and chose the .shp file from the import page.

+

Create a zip archive with .shp and .dbf files and import it. For this +to work, you need to set $cfg['TempDir'] to a place where the web server user can +write (for example './tmp').

+

To create the temporary directory on a UNIX-based system, you can do:

+
cd phpMyAdmin
+mkdir tmp
+chmod o+rwx tmp
+
+
+
+
+

6.31 How do I create a relation in designer?露

+

To select relation, click: The display column is shown in pink. To +set/unset a column as the display column, click the 鈥淐hoose column to +display鈥� icon, then click on the appropriate column name.

+
+
+

6.32 How can I use the zoom search feature?露

+

The Zoom search feature is an alternative to table search feature. It allows +you to explore a table by representing its data in a scatter plot. You can +locate this feature by selecting a table and clicking the Search +tab. One of the sub-tabs in the Table Search page is +Zoom Search.

+

Consider the table REL_persons in 6.6 How can I use the relation table in Query-by-example? for +an example. To use zoom search, two columns need to be selected, for +example, id and town_code. The id values will be represented on one +axis and town_code values on the other axis. Each row will be +represented as a point in a scatter plot based on its id and +town_code. You can include two additional search criteria apart from +the two fields to display.

+

You can choose which field should be +displayed as label for each point. If a display column has been set +for the table (see 6.7 How can I use the 鈥渄isplay column鈥� feature?), it is taken as the label unless +you specify otherwise. You can also select the maximum number of rows +you want to be displayed in the plot by specifing it in the 鈥楳ax rows +to plot鈥� field. Once you have decided over your criteria, click 鈥楪o鈥� +to display the plot.

+

After the plot is generated, you can use the +mousewheel to zoom in and out of the plot. In addition, panning +feature is enabled to navigate through the plot. You can zoom-in to a +certain level of detail and use panning to locate your area of +interest. Clicking on a point opens a dialogue box, displaying field +values of the data row represented by the point. You can edit the +values if required and click on submit to issue an update query. Basic +instructions on how to use can be viewed by clicking the 鈥楬ow to use?鈥� +link located just above the plot.

+
+
+

6.33 When browsing a table, how can I copy a column name?露

+

Selecting the name of the column within the browse table header cell +for copying is difficult, as the columns support reordering by +dragging the header cells as well as sorting by clicking on the linked +column name. To copy a column name, double-click on the empty area +next to the column name, when the tooltip tells you to do so. This +will show you an input box with the column name. You may right-click +the column name within this input box to copy it to your clipboard.

+
+
+

6.34 How can I use the Favorite Tables feature?露

+

Favorite Tables feature is very much similar to Recent Tables feature. +It allows you to add a shortcut for the frequently used tables of any +database in the navigation panel . You can easily navigate to any table +in the list by simply choosing it from the list. These tables are stored +in your browser鈥檚 local storage if you have not configured your +phpMyAdmin Configuration Storage. Otherwise these entries are stored in +phpMyAdmin Configuration Storage.

+

IMPORTANT: In absence of phpMyAdmin Configuration Storage, your Favorite +tables may be different in different browsers based on your different +selections in them.

+

To add a table to Favorite list simply click on the Gray star in front +of a table name in the list of tables of a Database and wait until it +turns to Yellow. +To remove a table from list, simply click on the Yellow star and +wait until it turns Gray again.

+

Using $cfg['NumFavoriteTables'] in your config.inc.php +file, you can define the maximum number of favorite tables shown in the +navigation panel. Its default value is 10.

+
+
+

6.35 How can I use the Range search feature?露

+

With the help of range search feature, one can specify a range of values for +particular column(s) while performing search operation on a table from the Search +tab.

+

To use this feature simply click on the BETWEEN or NOT BETWEEN operators +from the operator select list in front of the column name. On choosing one of the +above options, a dialog box will show up asking for the Minimum and Maximum +value for that column. Only the specified range of values will be included +in case of BETWEEN and excluded in case of NOT BETWEEN from the final results.

+

Note: The Range search feature will work only Numeric and Date data type columns.

+
+
+

6.36 What is Central columns and how can I use this feature?露

+

As the name suggests, the Central columns feature enables to maintain a central list of +columns per database to avoid similar name for the same data element and bring consistency +of data type for the same data element. You can use the central list of columns to +add an element to any table structure in that database which will save from writing +similar column name and column definition.

+

To add a column to central list, go to table structure page, check the columns you want +to include and then simply click on 鈥淎dd to central columns鈥�. If you want to add all +unique columns from more than one table from a database then go to database structure page, +check the tables you want to include and then select 鈥淎dd columns to central list鈥�.

+

To remove a column from central list, go to Table structure page, check the columns you want +to remove and then simply click on 鈥淩emove from central columns鈥�. If you want to remove all +columns from more than one tables from a database then go to database structure page, +check the tables you want to include and then select 鈥淩emove columns from central list鈥�.

+

To view and manage the central list, select the database you want to manage central columns +for then from the top menu click on 鈥淐entral columns鈥�. You will be taken to a page where +you will have options to edit, delete or add new columns to central list.

+
+
+

6.37 How can I use Improve Table structure feature?露

+

Improve table structure feature helps to bring the table structure upto +Third Normal Form. A wizard is presented to user which asks questions about the +elements during the various steps for normalization and a new structure is proposed +accordingly to bring the table into the First/Second/Third Normal form. +On startup of the wizard, user gets to select upto what normal form they want to +normalize the table structure.

+

Here is an example table which you can use to test all of the three First, Second and +Third Normal Form.

+
CREATE TABLE `VetOffice` (
+ `petName` varchar(64) NOT NULL,
+ `petBreed` varchar(64) NOT NULL,
+ `petType` varchar(64) NOT NULL,
+ `petDOB` date NOT NULL,
+ `ownerLastName` varchar(64) NOT NULL,
+ `ownerFirstName` varchar(64) NOT NULL,
+ `ownerPhone1` int(12) NOT NULL,
+ `ownerPhone2` int(12) NOT NULL,
+ `ownerEmail` varchar(64) NOT NULL,
+);
+
+
+

The above table is not in First normal Form as no primary key exists. Primary key +is supposed to be (petName,`ownerLastName`,`ownerFirstName`) . If the primary key +is chosen as suggested the resultant table won鈥檛 be in Second as well as Third Normal +form as the following dependencies exists.

+
(OwnerLastName, OwnerFirstName) -> OwnerEmail
+(OwnerLastName, OwnerFirstName) -> OwnerPhone
+PetBreed -> PetType
+
+
+

Which says, OwnerEmail depends on OwnerLastName and OwnerFirstName. +OwnerPhone depends on OwnerLastName and OwnerFirstName. +PetType depends on PetBreed.

+
+
+

6.38 How can I reassign auto-incremented values?露

+

Some users prefer their AUTO_INCREMENT values to be consecutive; this is not +always the case after row deletion.

+

Here are the steps to accomplish this. These are manual steps because they +involve a manual verification at one point.

+
    +
  • Ensure that you have exclusive access to the table to rearrange

  • +
  • On your primary key column (i.e. id), remove the AUTO_INCREMENT setting

  • +
  • Delete your primary key in Structure > indexes

  • +
  • Create a new column future_id as primary key, AUTO_INCREMENT

  • +
  • Browse your table and verify that the new increments correspond to what +you鈥檙e expecting

  • +
  • Drop your old id column

  • +
  • Rename the future_id column to id

  • +
  • Move the new id column via Structure > Move columns

  • +
+
+
+

6.39 What is the 鈥淎djust privileges鈥� option when renaming, copying, or moving a database, table, column, or procedure?露

+

When renaming/copying/moving a database/table/column/procedure, +MySQL does not adjust the original privileges relating to these objects +on its own. By selecting this option, phpMyAdmin will adjust the privilege +table so that users have the same privileges on the new items.

+

For example: A user 鈥榖ob鈥�@鈥檒ocalhost鈥� has a 鈥楽ELECT鈥� privilege on a +column named 鈥榠d鈥�. Now, if this column is renamed to 鈥榠d_new鈥�, MySQL, +on its own, would not adjust the column privileges to the new column name. +phpMyAdmin can make this adjustment for you automatically.

+

Notes:

+
    +
  • While adjusting privileges for a database, the privileges of all +database-related elements (tables, columns and procedures) are also adjusted +to the database鈥檚 new name.

  • +
  • Similarly, while adjusting privileges for a table, the privileges of all +the columns inside the new table are also adjusted.

  • +
  • While adjusting privileges, the user performing the operation must have the following +privileges:

    +
      +
    • SELECT, INSERT, UPDATE, DELETE privileges on following tables: +mysql.`db`, mysql.`columns_priv`, mysql.`tables_priv`, mysql.`procs_priv`

    • +
    • FLUSH privilege (GLOBAL)

    • +
    +
  • +
+

Thus, if you want to replicate the database/table/column/procedure as it is +while renaming/copying/moving these objects, make sure you have checked this option.

+
+
+

6.40 I see 鈥淏ind parameters鈥� checkbox in the 鈥淪QL鈥� page. How do I write parameterized SQL queries?露

+

From version 4.5, phpMyAdmin allows users to execute parameterized queries in the 鈥淪QL鈥� page. +Parameters should be prefixed with a colon(:) and when the 鈥淏ind parameters鈥� checkbox is checked +these parameters will be identified and input fields for these parameters will be presented. +Values entered in these field will be substituted in the query before being executed.

+
+
+

6.41 I get import errors while importing the dumps exported from older MySQL versions (pre-5.7.6) into newer MySQL versions (5.7.7+), but they work fine when imported back on same older versions ?露

+

If you get errors like #1031 - Table storage engine for 鈥榯able_name鈥� doesn鈥檛 have this option +while importing the dumps exported from pre-5.7.7 MySQL servers into new MySQL server versions 5.7.7+, +it might be because ROW_FORMAT=FIXED is not supported with InnoDB tables. Moreover, the value of +innodb_strict_mode would define if this would be reported as a warning or as an error.

+

Since MySQL version 5.7.9, the default value for innodb_strict_mode is ON and thus would generate +an error when such a CREATE TABLE or ALTER TABLE statement is encountered.

+

There are two ways of preventing such errors while importing:

+
    +
  • Change the value of innodb_strict_mode to OFF before starting the import and turn it ON after +the import is successfully completed.

  • +
  • This can be achieved in two ways:

    +
      +
    • Go to 鈥榁ariables鈥� page and edit the value of innodb_strict_mode

    • +
    • Run the query : SET GLOBAL `innodb_strict_mode = 鈥榌value]鈥檂

    • +
    +
  • +
+

After the import is done, it is suggested that the value of innodb_strict_mode should be reset to the +original value.

+
+
+
+

phpMyAdmin project露

+
+

7.1 I have found a bug. How do I inform developers?露

+

Our issues tracker is located at <https://github.com/phpmyadmin/phpmyadmin/issues>. +For security issues, please refer to the instructions at <https://www.phpmyadmin.net/security> to email +the developers directly.

+
+
+

7.2 I want to translate the messages to a new language or upgrade an existing language, where do I start?露

+

Translations are very welcome and all you need to have are the +language skills. The easiest way is to use our online translation +service. You can check +out all the possibilities to translate in the translate section on +our website.

+
+
+

7.3 I would like to help out with the development of phpMyAdmin. How should I proceed?露

+

We welcome every contribution to the development of phpMyAdmin. You +can check out all the possibilities to contribute in the contribute +section on our website.

+ +
+
+
+

Security露

+
+

8.1 Where can I get information about the security alerts issued for phpMyAdmin?露

+

Please refer to <https://www.phpmyadmin.net/security/>.

+
+
+

8.2 How can I protect phpMyAdmin against brute force attacks?露

+

If you use Apache web server, phpMyAdmin exports information about +authentication to the Apache environment and it can be used in Apache +logs. Currently there are two variables available:

+
+
userID

User name of currently active user (he does not have to be logged in).

+
+
userStatus

Status of currently active user, one of ok (user is logged in), +mysql-denied (MySQL denied user login), allow-denied (user denied +by allow/deny rules), root-denied (root is denied in configuration), +empty-denied (empty password is denied).

+
+
+

LogFormat directive for Apache can look like following:

+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %{userID}n %{userStatus}n"   pma_combined
+
+
+

You can then use any log analyzing tools to detect possible break-in +attempts.

+
+
+

8.3 Why are there path disclosures when directly loading certain files?露

+

This is a server configuration problem. Never enable display_errors on a production site.

+
+
+

8.4 CSV files exported from phpMyAdmin could allow a formula injection attack.露

+

It is possible to generate a CSV file that, when imported to a spreadsheet program such as Microsoft Excel, +could potentially allow the execution of arbitrary commands.

+

The CSV files generated by phpMyAdmin could potentially contain text that would be interpreted by a spreadsheet program as +a formula, but we do not believe escaping those fields is the proper behavior. There is no means to properly escape and +differentiate between a desired text output and a formula that should be escaped, and CSV is a text format where function +definitions should not be interpreted anyway. We have discussed this at length and feel it is the responsibility of the +spreadsheet program to properly parse and sanitize such data on input instead.

+

Google also has a similar view.

+
+
+
+

Synchronization露

+
+

9.1 (withdrawn).露

+
+
+

9.2 (withdrawn).露

+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/genindex.html b/phpMyAdmin/doc/html/genindex.html new file mode 100755 index 0000000..96d11a0 --- /dev/null +++ b/phpMyAdmin/doc/html/genindex.html @@ -0,0 +1,2313 @@ + + + + + + + + Index — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + +
+
+
+
+ + +

Index

+ +
+ Symbols + | A + | B + | C + | D + | E + | F + | G + | H + | I + | J + | K + | L + | M + | N + | O + | P + | Q + | R + | S + | T + | U + | V + | W + | X + | Z + +
+

Symbols

+ + + +
+ +

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

J

+ + + +
+ +

K

+ + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

Q

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + + +
+ +

W

+ + +
+ +

X

+ + +
+ +

Z

+ + + +
+ + + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/glossary.html b/phpMyAdmin/doc/html/glossary.html new file mode 100755 index 0000000..d85fb2d --- /dev/null +++ b/phpMyAdmin/doc/html/glossary.html @@ -0,0 +1,563 @@ + + + + + + + + Glossary — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Glossary露

+

From Wikipedia, the free encyclopedia

+
+
.htaccess

the default name of Apache鈥檚 directory-level configuration file.

+ +
+
ACL

Access Control List

+
+
Blowfish

a keyed, symmetric block cipher, designed in 1993 by Bruce Schneier.

+ +
+
Browser

a software application that enables a user to display and interact with text, images, and other information typically located on a web page at a website on the World Wide Web.

+ +
+
bzip2

a free software/open-source data compression algorithm and program developed by Julian Seward.

+ +
+
CGI

Common Gateway Interface is an important World Wide Web technology that +enables a client web browser to request data from a program executed on +the Web server.

+ +
+
Changelog

a log or record of changes made to a project.

+ +
+
Client

a computer system that accesses a (remote) service on another computer by some kind of network.

+ +
+
column

a set of data values of a particularly simple type, one for each row of the table.

+ +
+

a packet of information sent by a server to a World Wide Web browser and then sent back by the browser each time it accesses that server.

+ +
+
CSV

Comma-separated values

+ +
+
DB

look at database

+
+
database

an organized collection of data.

+ +
+
Engine

look at storage engines

+
+
extension

a PHP module that extends PHP with additional functionality.

+ +
+
FAQ

Frequently Asked Questions is a list of commonly asked question and there +answers.

+ +
+
Field

one part of divided data/columns.

+ +
+
foreign key

a column or group of columns in a database row that points to a key column +or group of columns forming a key of another database row in some +(usually different) table.

+ +
+
GD

Graphics Library by Thomas Boutell and others for dynamically manipulating images.

+ +
+
GD2

look at gd

+
+
gzip

gzip is short for GNU zip, a GNU free software file compression program.

+ +
+
host

any machine connected to a computer network, a node that has a hostname.

+ +
+
hostname

the unique name by which a network-attached device is known on a network.

+ +
+
HTTP

HyperText Transfer Protocol is the primary method used to transfer or +convey information on the World Wide Web.

+ +
+
https

a HTTP-connection with additional security measures.

+ +
+
IEC

International Electrotechnical Commission

+
+
IIS

Internet Information Services is a set of Internet-based services for +servers using Microsoft Windows.

+ +
+
Index

a feature that allows quick access to the rows in a table.

+ +
+
IP

Internet Protocol is a data-oriented protocol used by source and +destination hosts for communicating data across a packet-switched +internetwork.

+ +
+
IP Address

a unique number that devices use in order to identify and communicate with each other on a network utilizing the Internet Protocol standard.

+ +
+
IPv6

IPv6 (Internet Protocol version 6) is the latest revision of the +Internet Protocol (IP), designed to deal with the +long-anticipated problem of its predecessor IPv4 running out of addresses.

+ +
+
ISAPI

Internet Server Application Programming Interface is the API of Internet Information Services (IIS).

+ +
+
ISP

An Internet service provider is a business or organization that offers users +access to the Internet and related services.

+ +
+
ISO

International Standards Organisation

+
+
JPEG

a most commonly used standard method of lossy compression for photographic images.

+ +
+
JPG

look at jpeg

+
+
Key

look at index

+
+
LATEX

a document preparation system for the TEX typesetting program.

+ +
+
Mac

Apple Macintosh is a line of personal computers is designed, developed, manufactured, and marketed by Apple Computer.

+

. seealso:: <https://en.wikipedia.org/wiki/Mac>

+
+
Mac OS X

the operating system which is included with all currently shipping Apple Macintosh computers in the consumer and professional markets.

+ +
+
mbstring

The PHP mbstring functions provide support for languages represented by multi-byte character sets, most notably UTF-8.

+

If you have troubles installing this extension, please follow 1.20 I receive an error about missing mysqli and mysql extensions., it provides useful hints.

+ +
+
MCrypt

a cryptographic library.

+ +
+
mcrypt

the MCrypt PHP extension.

+ +
+
MIME

Multipurpose Internet Mail Extensions is +an Internet Standard for the format of e-mail.

+ +
+
module

some sort of extension for the Apache Webserver.

+ +
+
mod_proxy_fcgi

an Apache module implementing a Fast CGI interface; PHP can be run as a CGI module, FastCGI, or +directly as an Apache module.

+
+
MySQL

a multithreaded, multi-user, SQL (Structured Query Language) Database Management System (DBMS).

+ +
+
mysqli

the improved MySQL client PHP extension.

+ +
+
mysql

the MySQL client PHP extension.

+ +
+
OpenDocument

an open standard for office documents.

+ +
+
OS X

look at Mac OS X.

+ +
+
PDF

Portable Document Format is a file format developed by Adobe Systems for +representing two-dimensional documents in a device-independent and +resolution-independent format.

+ +
+
PEAR

the PHP Extension and Application Repository.

+
+

See also

+

<https://pear.php.net/>

+
+
+
PCRE

Perl Compatible Regular Expressions is the perl-compatible regular +expression functions for PHP

+
+

See also

+

<https://www.php.net/pcre>

+
+
+
PHP

short for 鈥淧HP: Hypertext Preprocessor鈥�, is an open-source, reflective +programming language used mainly for developing server-side applications +and dynamic web content, and more recently, a broader range of software +applications.

+ +
+
port

a connection through which data is sent and received.

+ +
+
primary key

A primary key is an index over one or more fields in a table with +unique values for every single row in this table. Every table should have +a primary key for easier accessing/identifying data in this table. There +can only be one primary key per table and it is named always PRIMARY. +In fact, a primary key is just an unique key with the name +PRIMARY. If no primary key is defined MySQL will use first unique +key as primary key if there is one.

+

You can create the primary key when creating the table (in phpMyAdmin +just check the primary key radio buttons for each field you wish to be +part of the primary key).

+

You can also add a primary key to an existing table with ALTER TABLE +or CREATE INDEX (in phpMyAdmin you can just click on 鈥榓dd index鈥� on +the table structure page below the listed fields).

+
+
RFC

Request for Comments (RFC) documents are a series of memoranda +encompassing new research, innovations, and methodologies applicable to +Internet technologies.

+ +
+
RFC 1952

GZIP file format specification version 4.3

+
+

See also

+

RFC 1952

+
+
+
Row (record, tuple)

represents a single, implicitly structured data item in a table.

+ +
+
Server

a computer system that provides services to other computing systems over a network.

+ +
+
Storage Engines

MySQL can use several different formats for storing data on disk, these +are called storage engines or table types. phpMyAdmin allows a user to +change their storage engine for a particular table through the operations +tab.

+

Common table types are InnoDB and MyISAM, though many others exist and +may be desirable in some situations.

+ +
+
socket

a form of inter-process communication.

+ +
+
SSL

Secure Sockets Layer is a cryptographic protocol which provides secure +communication on the Internet.

+ +
+
Stored procedure

a subroutine available to applications accessing a relational database system

+ +
+
SQL

Structured Query Language

+ +
+
table

a set of data elements (cells) that is organized, defined and stored as +horizontal rows and vertical columns where each item can be uniquely +identified by a label or key or by it鈥檚 position in relation to other +items.

+ +
+
tar

a type of archive file format: the Tape ARchive format.

+ +
+
TCP

Transmission Control Protocol is one of the core protocols of the +Internet protocol suite.

+ +
+
TCPDF

PHP library to generate PDF files.

+
+

See also

+

<https://tcpdf.org/>

+
+
+
trigger

a procedural code that is automatically executed in response to certain events on a particular table or view in a database

+ +
+
unique key

A unique key is an index over one or more fields in a table which has a +unique value for each row. The first unique key will be treated as +primary key if there is no primary key defined.

+
+
URL

Uniform Resource Locator is a sequence of characters, conforming to a +standardized format, that is used for referring to resources, such as +documents and images on the Internet, by their location.

+ +
+
Webserver

A computer (program) that is responsible for accepting HTTP requests from clients and serving them Web pages.

+ +
+
XML

Extensible Markup Language is a W3C-recommended general-purpose markup +language for creating special-purpose markup languages, capable of +describing many different kinds of data.

+ +
+
ZIP

a popular data compression and archival format.

+ +
+
zlib

an open-source, cross-platform data compression library by Jean-loup Gailly and Mark Adler.

+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/import_export.html b/phpMyAdmin/doc/html/import_export.html new file mode 100755 index 0000000..cfd6bb4 --- /dev/null +++ b/phpMyAdmin/doc/html/import_export.html @@ -0,0 +1,464 @@ + + + + + + + + Import and export — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Import and export露

+
+

Import露

+

To import data, go to the 鈥淚mport鈥� tab in phpMyAdmin. To import data into a +specific database or table, open the database or table before going to the +鈥淚mport鈥� tab.

+

In addition to the standard Import and Export tab, you can also import an SQL +file directly by dragging and dropping it from your local file manager to the +phpMyAdmin interface in your web browser.

+

If you are having troubles importing big files, please consult 1.16 I cannot upload big dump files (memory, HTTP or timeout problems)..

+

You can import using following methods:

+

Form based upload

+
+

Can be used with any supported format, also (b|g)zipped files, e.g., mydump.sql.gz .

+
+

Form based SQL Query

+
+

Can be used with valid SQL dumps.

+
+

Using upload directory

+
+

You can specify an upload directory on your web server where phpMyAdmin is installed, after uploading your file into this directory you can select this file in the import dialog of phpMyAdmin, see $cfg['UploadDir'].

+
+

phpMyAdmin can import from several various commonly used formats.

+
+

CSV露

+

Comma separated values format which is often used by spreadsheets or various other programs for export/import.

+
+

Note

+

When importing data into a table from a CSV file where the table has an +鈥榓uto_increment鈥� field, make the 鈥榓uto_increment鈥� value for each record in +the CSV field to be 鈥�0鈥� (zero). This allows the 鈥榓uto_increment鈥� field to +populate correctly.

+
+

It is now possible to import a CSV file at the server or database level. +Instead of having to create a table to import the CSV file into, a best-fit +structure will be determined for you and the data imported into it, instead. +All other features, requirements, and limitations are as before.

+
+
+

CSV using LOAD DATA露

+

Similar to CSV, only using the internal MySQL parser and not the phpMyAdmin one.

+
+
+

ESRI Shape File露

+

The ESRI shapefile or simply a shapefile is a popular geospatial vector data +format for geographic information systems software. It is developed and +regulated by Esri as a (mostly) open specification for data interoperability +among Esri and other software products.

+
+
+

MediaWiki露

+

MediaWiki files, which can be exported by phpMyAdmin (version 4.0 or later), +can now also be imported. This is the format used by Wikipedia to display +tables.

+
+
+

Open Document Spreadsheet (ODS)露

+

OpenDocument workbooks containing one or more spreadsheets can now be directly imported.

+

When importing an ODS speadsheet, the spreadsheet must be named in a specific way in order to make the +import as simple as possible.

+
+

Table name露

+

During import, phpMyAdmin uses the sheet name as the table name; you should rename the +sheet in your spreadsheet program in order to match your existing table name (or the table you wish to create, +though this is less of a concern since you could quickly rename the new table from the Operations tab).

+
+
+

Column names露

+

You should also make the first row of your spreadsheet a header with the names of the columns (this can be +accomplished by inserting a new row at the top of your spreadsheet). When on the Import screen, select the +checkbox for 鈥淭he first line of the file contains the table column names;鈥� this way your newly imported +data will go to the proper columns.

+
+

Note

+

Formulas and calculations will NOT be evaluated, rather, their value from +the most recent save will be loaded. Please ensure that all values in the +spreadsheet are as needed before importing it.

+
+
+
+
+

SQL露

+

SQL can be used to make any manipulation on data, it is also useful for restoring backed up data.

+
+
+

XML露

+

XML files exported by phpMyAdmin (version 3.3.0 or later) can now be imported. +Structures (databases, tables, views, triggers, etc.) and/or data will be +created depending on the contents of the file.

+

The supported xml schemas are not yet documented in this wiki.

+
+
+
+

Export露

+

phpMyAdmin can export into text files (even compressed) on your local disk (or +a special the webserver $cfg['SaveDir'] folder) in various +commonly used formats:

+
+

CodeGen露

+

NHibernate file format. Planned +versions: Java, Hibernate, PHP PDO, JSON, etc. So the preliminary name is +codegen.

+
+
+

CSV露

+

Comma separated values format which is often used by spreadsheets or various +other programs for export/import.

+
+
+

CSV for Microsoft Excel露

+

This is just preconfigured version of CSV export which can be imported into +most English versions of Microsoft Excel. Some localised versions (like +鈥淒anish鈥�) are expecting 鈥�;鈥� instead of 鈥�,鈥� as field separator.

+
+
+

Microsoft Word 2000露

+

If you鈥檙e using Microsoft Word 2000 or newer (or compatible such as +OpenOffice.org), you can use this export.

+
+
+

JSON露

+

JSON (JavaScript Object Notation) is a lightweight data-interchange format. It +is easy for humans to read and write and it is easy for machines to parse and +generate.

+
+

Changed in version 4.7.0: The generated JSON structure has been changed in phpMyAdmin 4.7.0 to +produce valid JSON data.

+
+

The generated JSON is list of objects with following attributes:

+
+
+type露
+

Type of given object, can be one of:

+
+
header

Export header containing comment and phpMyAdmin version.

+
+
database

Start of a database marker, containing name of database.

+
+
table

Table data export.

+
+
+
+ +
+
+version露
+

Used in header type and indicates phpMyAdmin version.

+
+ +
+
+comment露
+

Optional textual comment.

+
+ +
+
+name露
+

Object name - either table or database based on type.

+
+ +
+
+database露
+

Database name for table type.

+
+ +
+
+data露
+

Table content for table type.

+
+ +

Sample output:

+
[
+    {
+        "comment": "Export to JSON plugin for PHPMyAdmin",
+        "type": "header",
+        "version": "4.7.0-dev"
+    },
+    {
+        "name": "cars",
+        "type": "database"
+    },
+    {
+        "data": [
+            {
+                "car_id": "1",
+                "description": "Green Chrysler 300",
+                "make_id": "5",
+                "mileage": "113688",
+                "price": "13545.00",
+                "transmission": "automatic",
+                "yearmade": "2007"
+            }
+        ],
+        "database": "cars",
+        "name": "cars",
+        "type": "table"
+    },
+    {
+        "data": [
+            {
+                "make": "Chrysler",
+                "make_id": "5"
+            }
+        ],
+        "database": "cars",
+        "name": "makes",
+        "type": "table"
+    }
+]
+
+
+
+
+

LaTeX露

+

If you want to embed table data or structure in LaTeX, this is right choice for you.

+

LaTeX is a typesetting system that is very suitable for producing scientific +and mathematical documents of high typographical quality. It is also suitable +for producing all sorts of other documents, from simple letters to complete +books. LaTeX uses TeX as its formatting engine. Learn more about TeX and +LaTeX on the Comprehensive TeX Archive Network +also see the short description od TeX.

+

The output needs to be embedded into a LaTeX document before it can be +rendered, for example in following document:

+
\documentclass{article}
+\title{phpMyAdmin SQL output}
+\author{}
+\usepackage{longtable,lscape}
+\date{}
+\setlength{\parindent}{0pt}
+\usepackage[left=2cm,top=2cm,right=2cm,nohead,nofoot]{geometry}
+\pdfpagewidth 210mm
+\pdfpageheight 297mm
+\begin{document}
+\maketitle
+
+% insert phpMyAdmin LaTeX Dump here
+
+\end{document}
+
+
+
+
+

MediaWiki露

+

Both tables and databases can be exported in the MediaWiki format, which is +used by Wikipedia to display tables. It can export structure, data or both, +including table names or headers.

+
+
+

OpenDocument Spreadsheet露

+

Open standard for spreadsheet data, which is being widely adopted. Many recent +spreadsheet programs, such as LibreOffice, OpenOffice, Microsoft Office or +Google Docs can handle this format.

+
+
+

OpenDocument Text露

+

New standard for text data which is being widely addopted. Most recent word +processors (such as LibreOffice, OpenOffice, Microsoft Word, AbiWord or KWord) +can handle this.

+
+
+

PDF露

+

For presentation purposes, non editable PDF might be best choice for you.

+
+
+

PHP Array露

+

You can generate a php file which will declare a multidimensional array with +the contents of the selected table or database.

+
+
+

SQL露

+

Export in SQL can be used to restore your database, thus it is useful for +backing up.

+

The option 鈥楳aximal length of created query鈥� seems to be undocumented. But +experiments has shown that it splits large extended INSERTS so each one is no +bigger than the given number of bytes (or characters?). Thus when importing the +file, for large tables you avoid the error 鈥淕ot a packet bigger than +鈥榤ax_allowed_packet鈥� bytes鈥�.

+ +
+

Data Options露

+

Complete inserts adds the column names to the SQL dump. This parameter +improves the readability and reliability of the dump. Adding the column names +increases the size of the dump, but when combined with Extended inserts it鈥檚 +negligible.

+

Extended inserts combines multiple rows of data into a single INSERT query. +This will significantly decrease filesize for large SQL dumps, increases the +INSERT speed when imported, and is generally recommended.

+ +
+
+
+

Texy!露

+

Texy! markup format. You can see example on Texy! demo.

+
+
+

XML露

+

Easily parsable export for use with custom scripts.

+
+

Changed in version 3.3.0: The XML schema used has changed as of version 3.3.0

+
+
+
+

YAML露

+

YAML is a data serialization format which is both human readable and +computationally powerful ( <https://yaml.org> ).

+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/index.html b/phpMyAdmin/doc/html/index.html new file mode 100755 index 0000000..0eec5cd --- /dev/null +++ b/phpMyAdmin/doc/html/index.html @@ -0,0 +1,220 @@ + + + + + + + + Welcome to phpMyAdmin鈥檚 documentation! — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Welcome to phpMyAdmin鈥檚 documentation!露

+

Contents:

+
+ +
+
+
+

Indices and tables露

+ +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/intro.html b/phpMyAdmin/doc/html/intro.html new file mode 100755 index 0000000..f9b468d --- /dev/null +++ b/phpMyAdmin/doc/html/intro.html @@ -0,0 +1,186 @@ + + + + + + + + Introduction — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Introduction露

+

phpMyAdmin is a free software tool written in PHP that is intended to handle the +administration of a MySQL or MariaDB database server. You can use phpMyAdmin to +perform most administration tasks, including creating a database, running queries, +and adding user accounts.

+
+

Supported features露

+

Currently phpMyAdmin can:

+
    +
  • create, browse, edit, and drop databases, tables, views, columns, and indexes

  • +
  • display multiple results sets through stored procedures or queries

  • +
  • create, copy, drop, rename and alter databases, tables, columns and +indexes

  • +
  • maintenance server, databases and tables, with proposals on server +configuration

  • +
  • execute, edit and bookmark any SQL-statement, even batch-queries

  • +
  • load text files into tables

  • +
  • create 1 and read dumps of tables

  • +
  • export 1 data to various formats: CSV, XML, PDF, +ISO/IEC 26300 - OpenDocument Text and Spreadsheet, Microsoft +Word 2000, and LATEX formats

  • +
  • import data and MySQL structures from OpenDocument spreadsheets, as +well as XML, CSV, and SQL files

  • +
  • administer multiple servers

  • +
  • add, edit, and remove MySQL user accounts and privileges

  • +
  • check referential integrity in MyISAM tables

  • +
  • using Query-by-example (QBE), create complex queries automatically +connecting required tables

  • +
  • create PDF graphics of your +database layout

  • +
  • search globally in a database or a subset of it

  • +
  • transform stored data into any format using a set of predefined +functions, like displaying BLOB-data as image or download-link

  • +
  • track changes on databases, tables and views

  • +
  • support InnoDB tables and foreign keys

  • +
  • support mysqli, the improved MySQL extension see 1.17 Which Database versions does phpMyAdmin support?

  • +
  • create, edit, call, export and drop stored procedures and functions

  • +
  • create, edit, export and drop events and triggers

  • +
  • communicate in 80 different languages

  • +
+
+
+

Shortcut keys露

+

Currently phpMyAdmin supports following shortcuts:

+
    +
  • k - Toggle console

  • +
  • h - Go to home page

  • +
  • s - Open settings

  • +
  • d + s - Go to database structure (Provided you are in database related page)

  • +
  • d + f - Search database (Provided you are in database related page)

  • +
  • t + s - Go to table structure (Provided you are in table related page)

  • +
  • t + f - Search table (Provided you are in table related page)

  • +
  • backspace - Takes you to older page.

  • +
+
+
+

A word about users露

+

Many people have difficulty understanding the concept of user +management with regards to phpMyAdmin. When a user logs in to +phpMyAdmin, that username and password are passed directly to MySQL. +phpMyAdmin does no account management on its own (other than allowing +one to manipulate the MySQL user account information); all users must +be valid MySQL users.

+

Footnotes

+
+
1(1,2)
+

phpMyAdmin can compress (Zip, GZip or RFC 1952 +formats) dumps and CSV exports if you use PHP with +Zlib support (--with-zlib). +Proper support may also need changes in php.ini.

+
+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/other.html b/phpMyAdmin/doc/html/other.html new file mode 100755 index 0000000..56f37f8 --- /dev/null +++ b/phpMyAdmin/doc/html/other.html @@ -0,0 +1,149 @@ + + + + + + + + Other sources of information — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Other sources of information露

+
+

Printed Book露

+

The definitive guide to using phpMyAdmin is the book Mastering phpMyAdmin for +Effective MySQL Management by Marc Delisle. You can get information on that +book and other officially endorsed books at the phpMyAdmin site.

+
+
+

Tutorials露

+

Third party tutorials and articles which you might find interesting:

+
+

膶esky (Czech)露

+ +
+ +
+

袪褍褋褋泻懈泄 (Russian)露

+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/privileges.html b/phpMyAdmin/doc/html/privileges.html new file mode 100755 index 0000000..81cafc5 --- /dev/null +++ b/phpMyAdmin/doc/html/privileges.html @@ -0,0 +1,179 @@ + + + + + + + + User management — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

User management露

+

User management is the process of controlling which users are allowed to +connect to the MySQL server and what permissions they have on each database. +phpMyAdmin does not handle user management, rather it passes the username and +password on to MySQL, which then determines whether a user is permitted to +perform a particular action. Within phpMyAdmin, administrators have full +control over creating users, viewing and editing privileges for existing users, +and removing users.

+

Within phpMyAdmin, user management is controlled via the Users link +from the main page. Users can be created, edited, and removed.

+
+

Creating a new user露

+

To create a new user, click the Add a new user link near the bottom +of the Users page (you must be a 鈥渟uperuser鈥�, e.g., user 鈥渞oot鈥�). +Use the textboxes and drop-downs to configure the user to your particular +needs. You can then select whether to create a database for that user and grant +specific global privileges. Once you鈥檝e created the user (by clicking Go), you +can define that user鈥檚 permissions on a specific database (don鈥檛 grant global +privileges in that case). In general, users do not need any global privileges +(other than USAGE), only permissions for their specific database.

+
+
+

Editing an existing user露

+

To edit an existing user, simply click the pencil icon to the right of that +user in the Users page. You can then edit their global- and +database-specific privileges, change their password, or even copy those +privileges to a new user.

+
+
+

Deleting a user露

+

From the Users page, check the checkbox for the user you wish to +remove, select whether or not to also remove any databases of the same name (if +they exist), and click Go.

+
+
+

Assigning privileges to user for a specific database露

+

Users are assigned to databases by editing the user record (from the +User accounts link on the home page). +If you are creating a user specifically for a given table +you will have to create the user first (with no global privileges) and then go +back and edit that user to add the table and privileges for the individual +table.

+
+
+

Configurable menus and user groups露

+

By enabling $cfg['Servers'][$i]['usergroups'] and +$cfg['Servers'][$i]['usergroups'] you can customize what users +will see in the phpMyAdmin navigation.

+
+

Warning

+

This feature only limits what a user sees, he is still able to use all the +functions. So this can not be considered as a security limitation. Should +you want to limit what users can do, use MySQL privileges to achieve that.

+
+

With this feature enabled, the User accounts management interface gains +a second tab for managing User groups, where you can define what each +group will view (see image below) and you can then assign each user to one of +these groups. Users will be presented with a simplified user interface, which might be +useful for inexperienced users who could be overwhelmed by all the features +phpMyAdmin provides.

+_images/usergroups.png +
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/relations.html b/phpMyAdmin/doc/html/relations.html new file mode 100755 index 0000000..e6d6065 --- /dev/null +++ b/phpMyAdmin/doc/html/relations.html @@ -0,0 +1,185 @@ + + + + + + + + Relations — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Relations露

+

phpMyAdmin allows relationships (similar to foreign keys) using MySQL-native +(InnoDB) methods when available and falling back on special phpMyAdmin-only +features when needed. There are two ways of editing these relations, with the +relation view and the drag-and-drop designer 鈥� both of which are explained +on this page.

+
+

Note

+

You need to have configured the phpMyAdmin configuration storage for using phpMyAdmin +only relations.

+
+
+

Technical info露

+

Currently the only MySQL table type that natively supports relationships is +InnoDB. When using an InnoDB table, phpMyAdmin will create real InnoDB +relations which will be enforced by MySQL no matter which application accesses +the database. In the case of any other table type, phpMyAdmin enforces the +relations internally and those relations are not applied to any other +application.

+
+
+

Relation view露

+

In order to get it working, you first have to properly create the +[[pmadb|pmadb]]. Once that is setup, select a table鈥檚 鈥淪tructure鈥� page. Below +the table definition, a link called 鈥淩elation view鈥� is shown. If you click that +link, a page will be shown that offers you to create a link to another table +for any (most) fields. Only PRIMARY KEYS are shown there, so if the field you +are referring to is not shown, you most likely are doing something wrong. The +drop-down at the bottom is the field which will be used as the name for a +record.

+
+

Relation view example露

+_images/pma-relations-relation-view-link.png +_images/pma-relations-relation-link.png +

Let鈥檚 say you have categories and links and one category can contain several links. Your table structure would be something like this:

+
    +
  • category.category_id (must be unique)

  • +
  • category.name

  • +
  • link.link_id

  • +
  • link.category_id

  • +
  • link.uri.

  • +
+

Open the relation view (below the table structure) page for the link table and for category_id field, you select category.category_id as master record.

+

If you now browse the link table, the category_id field will be a clickable hyperlink to the proper category record. But all you see is just the category_id, not the name of the category.

+_images/pma-relations-relation-name.png +

To fix this, open the relation view of the category table and in the drop down at the bottom, select 鈥渘ame鈥�. If you now browse the link table again and hover the mouse over the category_id hyperlink, the value from the related category will be shown as tooltip.

+_images/pma-relations-links.png +
+
+
+

Designer露

+

The Designer feature is a graphical way of creating, editing, and displaying +phpMyAdmin relations. These relations are compatible with those created in +phpMyAdmin鈥檚 relation view.

+

To use this feature, you need a properly configured phpMyAdmin configuration storage and +must have the $cfg['Servers'][$i]['table_coords'] configured.

+

To use the designer, select a database鈥檚 structure page, then look for the +Designer tab.

+

To export the view into PDF, you have to create PDF pages first. The Designer +creates the layout, how the tables shall be displayed. To finally export the +view, you have to create this with a PDF page and select your layout, which you +have created with the designer.

+ +
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/require.html b/phpMyAdmin/doc/html/require.html new file mode 100755 index 0000000..6653b19 --- /dev/null +++ b/phpMyAdmin/doc/html/require.html @@ -0,0 +1,164 @@ + + + + + + + + Requirements — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Requirements露

+
+

Web server露

+

Since phpMyAdmin鈥檚 interface is based entirely in your browser, you鈥檒l need a +web server (such as Apache, nginx, IIS) to install phpMyAdmin鈥檚 files into.

+
+
+

PHP露

+
    +
  • You need PHP 5.5.0 or newer, with session support, the Standard PHP Library +(SPL) extension, hash, ctype, and JSON support.

  • +
  • The mbstring extension (see mbstring) is strongly recommended +for performance reasons.

  • +
  • To support uploading of ZIP files, you need the PHP zip extension.

  • +
  • You need GD2 support in PHP to display inline thumbnails of JPEGs +(鈥渋mage/jpeg: inline鈥�) with their original aspect ratio.

  • +
  • When using the cookie authentication (the default), the openssl extension is strongly suggested.

  • +
  • To support upload progress bars, see 2.9 Seeing an upload progress bar.

  • +
  • To support XML and Open Document Spreadsheet importing, you need the +libxml extension.

  • +
  • To support reCAPTCHA on the login page, you need the +openssl extension.

  • +
  • To support displaying phpMyAdmin鈥檚 latest version, you need to enable +allow_url_open in your php.ini or to have the +curl extension.

  • +
+ +
+
+

Database露

+

phpMyAdmin supports MySQL-compatible databases.

+
    +
  • MySQL 5.5 or newer

  • +
  • MariaDB 5.5 or newer

  • +
+ +
+
+

Web browser露

+

To access phpMyAdmin you need a web browser with cookies and JavaScript +enabled.

+

You need browser which is supported by jQuery 2.0, see +<https://jquery.com/browser-support/>.

+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/search.html b/phpMyAdmin/doc/html/search.html new file mode 100755 index 0000000..4781eaa --- /dev/null +++ b/phpMyAdmin/doc/html/search.html @@ -0,0 +1,90 @@ + + + + + + + + Search — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Search

+
+ +

+ Please activate JavaScript to enable the search + functionality. +

+
+

+ Searching for multiple words only shows matches that contain + all words. +

+
+ + + +
+ +
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/searchindex.js b/phpMyAdmin/doc/html/searchindex.js new file mode 100755 index 0000000..c95c3af --- /dev/null +++ b/phpMyAdmin/doc/html/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({docnames:["bookmarks","charts","config","copyright","credits","developers","faq","glossary","import_export","index","intro","other","privileges","relations","require","security","settings","setup","themes","transformations","two_factor","user","vendors"],envversion:{"sphinx.domains.c":2,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":3,"sphinx.domains.index":1,"sphinx.domains.javascript":2,"sphinx.domains.math":2,"sphinx.domains.python":2,"sphinx.domains.rst":2,"sphinx.domains.std":1,sphinx:56},filenames:["bookmarks.rst","charts.rst","config.rst","copyright.rst","credits.rst","developers.rst","faq.rst","glossary.rst","import_export.rst","index.rst","intro.rst","other.rst","privileges.rst","relations.rst","require.rst","security.rst","settings.rst","setup.rst","themes.rst","transformations.rst","two_factor.rst","user.rst","vendors.rst"],objects:{"":{"$cfg['ActionLinksMode']":[2,0,1,"cfg_ActionLinksMode"],"$cfg['AllowArbitraryServer']":[2,0,1,"cfg_AllowArbitraryServer"],"$cfg['AllowThirdPartyFraming']":[2,0,1,"cfg_AllowThirdPartyFraming"],"$cfg['AllowUserDropDatabase']":[2,0,1,"cfg_AllowUserDropDatabase"],"$cfg['ArbitraryServerRegexp']":[2,0,1,"cfg_ArbitraryServerRegexp"],"$cfg['AuthLog']":[2,0,1,"cfg_AuthLog"],"$cfg['AuthLogSuccess']":[2,0,1,"cfg_AuthLogSuccess"],"$cfg['AvailableCharsets']":[2,0,1,"cfg_AvailableCharsets"],"$cfg['BZipDump']":[2,0,1,"cfg_BZipDump"],"$cfg['BrowseMIME']":[2,0,1,"cfg_BrowseMIME"],"$cfg['BrowseMarkerEnable']":[2,0,1,"cfg_BrowseMarkerEnable"],"$cfg['BrowsePointerEnable']":[2,0,1,"cfg_BrowsePointerEnable"],"$cfg['CSPAllow']":[2,0,1,"cfg_CSPAllow"],"$cfg['CaptchaLoginPrivateKey']":[2,0,1,"cfg_CaptchaLoginPrivateKey"],"$cfg['CaptchaLoginPublicKey']":[2,0,1,"cfg_CaptchaLoginPublicKey"],"$cfg['CharEditing']":[2,0,1,"cfg_CharEditing"],"$cfg['CharTextareaCols']":[2,0,1,"cfg_CharTextareaCols"],"$cfg['CharTextareaRows']":[2,0,1,"cfg_CharTextareaRows"],"$cfg['CheckConfigurationPermissions']":[2,0,1,"cfg_CheckConfigurationPermissions"],"$cfg['CodemirrorEnable']":[2,0,1,"cfg_CodemirrorEnable"],"$cfg['CompressOnFly']":[2,0,1,"cfg_CompressOnFly"],"$cfg['Confirm']":[2,0,1,"cfg_Confirm"],"$cfg['Console']['AlwaysExpand']":[2,0,1,"cfg_Console_AlwaysExpand"],"$cfg['Console']['CurrentQuery']":[2,0,1,"cfg_Console_CurrentQuery"],"$cfg['Console']['DarkTheme']":[2,0,1,"cfg_Console_DarkTheme"],"$cfg['Console']['EnterExecutes']":[2,0,1,"cfg_Console_EnterExecutes"],"$cfg['Console']['Height']":[2,0,1,"cfg_Console_Height"],"$cfg['Console']['Mode']":[2,0,1,"cfg_Console_Mode"],"$cfg['Console']['StartHistory']":[2,0,1,"cfg_Console_StartHistory"],"$cfg['ConsoleEnterExecutes']":[2,0,1,"cfg_ConsoleEnterExecutes"],"$cfg['DBG']":[2,0,1,"cfg_DBG"],"$cfg['DBG']['demo']":[2,0,1,"cfg_DBG_demo"],"$cfg['DBG']['simple2fa']":[2,0,1,"cfg_DBG_simple2fa"],"$cfg['DBG']['sql']":[2,0,1,"cfg_DBG_sql"],"$cfg['DBG']['sqllog']":[2,0,1,"cfg_DBG_sqllog"],"$cfg['DefaultConnectionCollation']":[2,0,1,"cfg_DefaultConnectionCollation"],"$cfg['DefaultForeignKeyChecks']":[2,0,1,"cfg_DefaultForeignKeyChecks"],"$cfg['DefaultFunctions']":[2,0,1,"cfg_DefaultFunctions"],"$cfg['DefaultLang']":[2,0,1,"cfg_DefaultLang"],"$cfg['DefaultQueryDatabase']":[2,0,1,"cfg_DefaultQueryDatabase"],"$cfg['DefaultQueryTable']":[2,0,1,"cfg_DefaultQueryTable"],"$cfg['DefaultTabDatabase']":[2,0,1,"cfg_DefaultTabDatabase"],"$cfg['DefaultTabServer']":[2,0,1,"cfg_DefaultTabServer"],"$cfg['DefaultTabTable']":[2,0,1,"cfg_DefaultTabTable"],"$cfg['DefaultTransformations']":[2,0,1,"cfg_DefaultTransformations"],"$cfg['DefaultTransformations']['Bool2Text']":[2,0,1,"cfg_DefaultTransformations_Bool2Text"],"$cfg['DefaultTransformations']['DateFormat']":[2,0,1,"cfg_DefaultTransformations_DateFormat"],"$cfg['DefaultTransformations']['External']":[2,0,1,"cfg_DefaultTransformations_External"],"$cfg['DefaultTransformations']['Hex']":[2,0,1,"cfg_DefaultTransformations_Hex"],"$cfg['DefaultTransformations']['Inline']":[2,0,1,"cfg_DefaultTransformations_Inline"],"$cfg['DefaultTransformations']['PreApPend']":[2,0,1,"cfg_DefaultTransformations_PreApPend"],"$cfg['DefaultTransformations']['Substring']":[2,0,1,"cfg_DefaultTransformations_Substring"],"$cfg['DefaultTransformations']['TextImageLink']":[2,0,1,"cfg_DefaultTransformations_TextImageLink"],"$cfg['DefaultTransformations']['TextLink']":[2,0,1,"cfg_DefaultTransformations_TextLink"],"$cfg['DisableMultiTableMaintenance']":[2,0,1,"cfg_DisableMultiTableMaintenance"],"$cfg['DisableShortcutKeys']":[2,0,1,"cfg_DisableShortcutKeys"],"$cfg['DisplayServersList']":[2,0,1,"cfg_DisplayServersList"],"$cfg['EnableAutocompleteForTablesAndColumns']":[2,0,1,"cfg_EnableAutocompleteForTablesAndColumns"],"$cfg['ExecTimeLimit']":[2,0,1,"cfg_ExecTimeLimit"],"$cfg['Export']":[2,0,1,"cfg_Export"],"$cfg['Export']['charset']":[2,0,1,"cfg_Export_charset"],"$cfg['Export']['file_template_database']":[2,0,1,"cfg_Export_file_template_database"],"$cfg['Export']['file_template_server']":[2,0,1,"cfg_Export_file_template_server"],"$cfg['Export']['file_template_table']":[2,0,1,"cfg_Export_file_template_table"],"$cfg['Export']['format']":[2,0,1,"cfg_Export_format"],"$cfg['Export']['method']":[2,0,1,"cfg_Export_method"],"$cfg['FilterLanguages']":[2,0,1,"cfg_FilterLanguages"],"$cfg['FirstLevelNavigationItems']":[2,0,1,"cfg_FirstLevelNavigationItems"],"$cfg['FontSize']":[2,0,1,"cfg_FontSize"],"$cfg['ForceSSL']":[2,0,1,"cfg_ForceSSL"],"$cfg['ForeignKeyDropdownOrder']":[2,0,1,"cfg_ForeignKeyDropdownOrder"],"$cfg['ForeignKeyMaxLimit']":[2,0,1,"cfg_ForeignKeyMaxLimit"],"$cfg['GD2Available']":[2,0,1,"cfg_GD2Available"],"$cfg['GZipDump']":[2,0,1,"cfg_GZipDump"],"$cfg['GridEditing']":[2,0,1,"cfg_GridEditing"],"$cfg['HideStructureActions']":[2,0,1,"cfg_HideStructureActions"],"$cfg['IconvExtraParams']":[2,0,1,"cfg_IconvExtraParams"],"$cfg['IgnoreMultiSubmitErrors']":[2,0,1,"cfg_IgnoreMultiSubmitErrors"],"$cfg['Import']":[2,0,1,"cfg_Import"],"$cfg['Import']['charset']":[2,0,1,"cfg_Import_charset"],"$cfg['InitialSlidersState']":[2,0,1,"cfg_InitialSlidersState"],"$cfg['InsertRows']":[2,0,1,"cfg_InsertRows"],"$cfg['Lang']":[2,0,1,"cfg_Lang"],"$cfg['LimitChars']":[2,0,1,"cfg_LimitChars"],"$cfg['LinkLengthLimit']":[2,0,1,"cfg_LinkLengthLimit"],"$cfg['LoginCookieDeleteAll']":[2,0,1,"cfg_LoginCookieDeleteAll"],"$cfg['LoginCookieRecall']":[2,0,1,"cfg_LoginCookieRecall"],"$cfg['LoginCookieStore']":[2,0,1,"cfg_LoginCookieStore"],"$cfg['LoginCookieValidity']":[2,0,1,"cfg_LoginCookieValidity"],"$cfg['LoginCookieValidityDisableWarning']":[2,0,1,"cfg_LoginCookieValidityDisableWarning"],"$cfg['LongtextDoubleTextarea']":[2,0,1,"cfg_LongtextDoubleTextarea"],"$cfg['MaxCharactersInDisplayedSQL']":[2,0,1,"cfg_MaxCharactersInDisplayedSQL"],"$cfg['MaxDbList']":[2,0,1,"cfg_MaxDbList"],"$cfg['MaxExactCount']":[2,0,1,"cfg_MaxExactCount"],"$cfg['MaxExactCountViews']":[2,0,1,"cfg_MaxExactCountViews"],"$cfg['MaxNavigationItems']":[2,0,1,"cfg_MaxNavigationItems"],"$cfg['MaxRows']":[2,0,1,"cfg_MaxRows"],"$cfg['MaxSizeForInputField']":[2,0,1,"cfg_MaxSizeForInputField"],"$cfg['MaxTableList']":[2,0,1,"cfg_MaxTableList"],"$cfg['MemoryLimit']":[2,0,1,"cfg_MemoryLimit"],"$cfg['MinSizeForInputField']":[2,0,1,"cfg_MinSizeForInputField"],"$cfg['MysqlMinVersion']":[2,0,1,"cfg_MysqlMinVersion"],"$cfg['NaturalOrder']":[2,0,1,"cfg_NaturalOrder"],"$cfg['NavigationDisplayLogo']":[2,0,1,"cfg_NavigationDisplayLogo"],"$cfg['NavigationDisplayServers']":[2,0,1,"cfg_NavigationDisplayServers"],"$cfg['NavigationLinkWithMainPanel']":[2,0,1,"cfg_NavigationLinkWithMainPanel"],"$cfg['NavigationLogoLink']":[2,0,1,"cfg_NavigationLogoLink"],"$cfg['NavigationLogoLinkWindow']":[2,0,1,"cfg_NavigationLogoLinkWindow"],"$cfg['NavigationTreeDbSeparator']":[2,0,1,"cfg_NavigationTreeDbSeparator"],"$cfg['NavigationTreeDefaultTabTable']":[2,0,1,"cfg_NavigationTreeDefaultTabTable"],"$cfg['NavigationTreeDefaultTabTable2']":[2,0,1,"cfg_NavigationTreeDefaultTabTable2"],"$cfg['NavigationTreeDisplayDbFilterMinimum']":[2,0,1,"cfg_NavigationTreeDisplayDbFilterMinimum"],"$cfg['NavigationTreeDisplayItemFilterMinimum']":[2,0,1,"cfg_NavigationTreeDisplayItemFilterMinimum"],"$cfg['NavigationTreeEnableExpansion']":[2,0,1,"cfg_NavigationTreeEnableExpansion"],"$cfg['NavigationTreeEnableGrouping']":[2,0,1,"cfg_NavigationTreeEnableGrouping"],"$cfg['NavigationTreePointerEnable']":[2,0,1,"cfg_NavigationTreePointerEnable"],"$cfg['NavigationTreeShowEvents']":[2,0,1,"cfg_NavigationTreeShowEvents"],"$cfg['NavigationTreeShowFunctions']":[2,0,1,"cfg_NavigationTreeShowFunctions"],"$cfg['NavigationTreeShowProcedures']":[2,0,1,"cfg_NavigationTreeShowProcedures"],"$cfg['NavigationTreeShowTables']":[2,0,1,"cfg_NavigationTreeShowTables"],"$cfg['NavigationTreeShowViews']":[2,0,1,"cfg_NavigationTreeShowViews"],"$cfg['NavigationTreeTableLevel']":[2,0,1,"cfg_NavigationTreeTableLevel"],"$cfg['NavigationTreeTableSeparator']":[2,0,1,"cfg_NavigationTreeTableSeparator"],"$cfg['NavigationWidth']":[2,0,1,"cfg_NavigationWidth"],"$cfg['NumFavoriteTables']":[2,0,1,"cfg_NumFavoriteTables"],"$cfg['NumRecentTables']":[2,0,1,"cfg_NumRecentTables"],"$cfg['OBGzip']":[2,0,1,"cfg_OBGzip"],"$cfg['Order']":[2,0,1,"cfg_Order"],"$cfg['PDFDefaultPageSize']":[2,0,1,"cfg_PDFDefaultPageSize"],"$cfg['PDFPageSizes']":[2,0,1,"cfg_PDFPageSizes"],"$cfg['PersistentConnections']":[2,0,1,"cfg_PersistentConnections"],"$cfg['PmaAbsoluteUri']":[2,0,1,"cfg_PmaAbsoluteUri"],"$cfg['PmaNoRelation_DisableWarning']":[2,0,1,"cfg_PmaNoRelation_DisableWarning"],"$cfg['PropertiesNumColumns']":[2,0,1,"cfg_PropertiesNumColumns"],"$cfg['ProtectBinary']":[2,0,1,"cfg_ProtectBinary"],"$cfg['ProxyPass']":[2,0,1,"cfg_ProxyPass"],"$cfg['ProxyUrl']":[2,0,1,"cfg_ProxyUrl"],"$cfg['ProxyUser']":[2,0,1,"cfg_ProxyUser"],"$cfg['QueryHistoryDB']":[2,0,1,"cfg_QueryHistoryDB"],"$cfg['QueryHistoryMax']":[2,0,1,"cfg_QueryHistoryMax"],"$cfg['RecodingEngine']":[2,0,1,"cfg_RecodingEngine"],"$cfg['RelationalDisplay']":[2,0,1,"cfg_RelationalDisplay"],"$cfg['RememberSorting']":[2,0,1,"cfg_RememberSorting"],"$cfg['RepeatCells']":[2,0,1,"cfg_RepeatCells"],"$cfg['ReservedWordDisableWarning']":[2,0,1,"cfg_ReservedWordDisableWarning"],"$cfg['RetainQueryBox']":[2,0,1,"cfg_RetainQueryBox"],"$cfg['RowActionLinks']":[2,0,1,"cfg_RowActionLinks"],"$cfg['RowActionLinksWithoutUnique']":[2,0,1,"cfg_RowActionLinksWithoutUnique"],"$cfg['RowActionType']":[2,0,1,"cfg_RowActionType"],"$cfg['SQLQuery']['Edit']":[2,0,1,"cfg_SQLQuery_Edit"],"$cfg['SQLQuery']['Explain']":[2,0,1,"cfg_SQLQuery_Explain"],"$cfg['SQLQuery']['Refresh']":[2,0,1,"cfg_SQLQuery_Refresh"],"$cfg['SQLQuery']['ShowAsPHP']":[2,0,1,"cfg_SQLQuery_ShowAsPHP"],"$cfg['SaveCellsAtOnce']":[2,0,1,"cfg_SaveCellsAtOnce"],"$cfg['SaveDir']":[2,0,1,"cfg_SaveDir"],"$cfg['SendErrorReports']":[2,0,1,"cfg_SendErrorReports"],"$cfg['ServerDefault']":[2,0,1,"cfg_ServerDefault"],"$cfg['ServerLibraryDifference_DisableWarning']":[2,0,1,"cfg_ServerLibraryDifference_DisableWarning"],"$cfg['Servers']":[2,0,1,"cfg_Servers"],"$cfg['Servers'][$i]['AllowDeny']['order']":[2,0,1,"cfg_Servers_AllowDeny_order"],"$cfg['Servers'][$i]['AllowDeny']['rules']":[2,0,1,"cfg_Servers_AllowDeny_rules"],"$cfg['Servers'][$i]['AllowNoPassword']":[2,0,1,"cfg_Servers_AllowNoPassword"],"$cfg['Servers'][$i]['AllowRoot']":[2,0,1,"cfg_Servers_AllowRoot"],"$cfg['Servers'][$i]['DisableIS']":[2,0,1,"cfg_Servers_DisableIS"],"$cfg['Servers'][$i]['LogoutURL']":[2,0,1,"cfg_Servers_LogoutURL"],"$cfg['Servers'][$i]['MaxTableUiprefs']":[2,0,1,"cfg_Servers_MaxTableUiprefs"],"$cfg['Servers'][$i]['SessionTimeZone']":[2,0,1,"cfg_Servers_SessionTimeZone"],"$cfg['Servers'][$i]['SignonCookieParams']":[2,0,1,"cfg_Servers_SignonCookieParams"],"$cfg['Servers'][$i]['SignonScript']":[2,0,1,"cfg_Servers_SignonScript"],"$cfg['Servers'][$i]['SignonSession']":[2,0,1,"cfg_Servers_SignonSession"],"$cfg['Servers'][$i]['SignonURL']":[2,0,1,"cfg_Servers_SignonURL"],"$cfg['Servers'][$i]['auth_http_realm']":[2,0,1,"cfg_Servers_auth_http_realm"],"$cfg['Servers'][$i]['auth_type']":[2,0,1,"cfg_Servers_auth_type"],"$cfg['Servers'][$i]['bookmarktable']":[2,0,1,"cfg_Servers_bookmarktable"],"$cfg['Servers'][$i]['central_columns']":[2,0,1,"cfg_Servers_central_columns"],"$cfg['Servers'][$i]['column_info']":[2,0,1,"cfg_Servers_column_info"],"$cfg['Servers'][$i]['compress']":[2,0,1,"cfg_Servers_compress"],"$cfg['Servers'][$i]['connect_type']":[2,0,1,"cfg_Servers_connect_type"],"$cfg['Servers'][$i]['control_*']":[2,0,1,"cfg_Servers_control_*"],"$cfg['Servers'][$i]['controlhost']":[2,0,1,"cfg_Servers_controlhost"],"$cfg['Servers'][$i]['controlpass']":[2,0,1,"cfg_Servers_controlpass"],"$cfg['Servers'][$i]['controlport']":[2,0,1,"cfg_Servers_controlport"],"$cfg['Servers'][$i]['controluser']":[2,0,1,"cfg_Servers_controluser"],"$cfg['Servers'][$i]['designer_settings']":[2,0,1,"cfg_Servers_designer_settings"],"$cfg['Servers'][$i]['export_templates']":[2,0,1,"cfg_Servers_export_templates"],"$cfg['Servers'][$i]['extension']":[2,0,1,"cfg_Servers_extension"],"$cfg['Servers'][$i]['favorite']":[2,0,1,"cfg_Servers_favorite"],"$cfg['Servers'][$i]['hide_connection_errors']":[2,0,1,"cfg_Servers_hide_connection_errors"],"$cfg['Servers'][$i]['hide_db']":[2,0,1,"cfg_Servers_hide_db"],"$cfg['Servers'][$i]['history']":[2,0,1,"cfg_Servers_history"],"$cfg['Servers'][$i]['host']":[2,0,1,"cfg_Servers_host"],"$cfg['Servers'][$i]['navigationhiding']":[2,0,1,"cfg_Servers_navigationhiding"],"$cfg['Servers'][$i]['nopassword']":[2,0,1,"cfg_Servers_nopassword"],"$cfg['Servers'][$i]['only_db']":[2,0,1,"cfg_Servers_only_db"],"$cfg['Servers'][$i]['password']":[2,0,1,"cfg_Servers_password"],"$cfg['Servers'][$i]['pdf_pages']":[2,0,1,"cfg_Servers_pdf_pages"],"$cfg['Servers'][$i]['pmadb']":[2,0,1,"cfg_Servers_pmadb"],"$cfg['Servers'][$i]['port']":[2,0,1,"cfg_Servers_port"],"$cfg['Servers'][$i]['recent']":[2,0,1,"cfg_Servers_recent"],"$cfg['Servers'][$i]['relation']":[2,0,1,"cfg_Servers_relation"],"$cfg['Servers'][$i]['savedsearches']":[2,0,1,"cfg_Servers_savedsearches"],"$cfg['Servers'][$i]['socket']":[2,0,1,"cfg_Servers_socket"],"$cfg['Servers'][$i]['ssl']":[2,0,1,"cfg_Servers_ssl"],"$cfg['Servers'][$i]['ssl_ca']":[2,0,1,"cfg_Servers_ssl_ca"],"$cfg['Servers'][$i]['ssl_ca_path']":[2,0,1,"cfg_Servers_ssl_ca_path"],"$cfg['Servers'][$i]['ssl_cert']":[2,0,1,"cfg_Servers_ssl_cert"],"$cfg['Servers'][$i]['ssl_ciphers']":[2,0,1,"cfg_Servers_ssl_ciphers"],"$cfg['Servers'][$i]['ssl_key']":[2,0,1,"cfg_Servers_ssl_key"],"$cfg['Servers'][$i]['ssl_verify']":[2,0,1,"cfg_Servers_ssl_verify"],"$cfg['Servers'][$i]['table_coords']":[2,0,1,"cfg_Servers_table_coords"],"$cfg['Servers'][$i]['table_info']":[2,0,1,"cfg_Servers_table_info"],"$cfg['Servers'][$i]['table_uiprefs']":[2,0,1,"cfg_Servers_table_uiprefs"],"$cfg['Servers'][$i]['tracking']":[2,0,1,"cfg_Servers_tracking"],"$cfg['Servers'][$i]['tracking_add_drop_database']":[2,0,1,"cfg_Servers_tracking_add_drop_database"],"$cfg['Servers'][$i]['tracking_add_drop_table']":[2,0,1,"cfg_Servers_tracking_add_drop_table"],"$cfg['Servers'][$i]['tracking_add_drop_view']":[2,0,1,"cfg_Servers_tracking_add_drop_view"],"$cfg['Servers'][$i]['tracking_default_statements']":[2,0,1,"cfg_Servers_tracking_default_statements"],"$cfg['Servers'][$i]['tracking_version_auto_create']":[2,0,1,"cfg_Servers_tracking_version_auto_create"],"$cfg['Servers'][$i]['user']":[2,0,1,"cfg_Servers_user"],"$cfg['Servers'][$i]['userconfig']":[2,0,1,"cfg_Servers_userconfig"],"$cfg['Servers'][$i]['usergroups']":[2,0,1,"cfg_Servers_usergroups"],"$cfg['Servers'][$i]['users']":[2,0,1,"cfg_Servers_users"],"$cfg['Servers'][$i]['verbose']":[2,0,1,"cfg_Servers_verbose"],"$cfg['SessionSavePath']":[2,0,1,"cfg_SessionSavePath"],"$cfg['ShowAll']":[2,0,1,"cfg_ShowAll"],"$cfg['ShowBrowseComments']":[2,0,1,"cfg_ShowBrowseComments"],"$cfg['ShowChgPassword']":[2,0,1,"cfg_ShowChgPassword"],"$cfg['ShowColumnComments']":[2,0,1,"cfg_ShowColumnComments"],"$cfg['ShowCreateDb']":[2,0,1,"cfg_ShowCreateDb"],"$cfg['ShowDatabasesNavigationAsTree']":[2,0,1,"cfg_ShowDatabasesNavigationAsTree"],"$cfg['ShowDbStructureCreation']":[2,0,1,"cfg_ShowDbStructureCreation"],"$cfg['ShowDbStructureLastCheck']":[2,0,1,"cfg_ShowDbStructureLastCheck"],"$cfg['ShowDbStructureLastUpdate']":[2,0,1,"cfg_ShowDbStructureLastUpdate"],"$cfg['ShowFieldTypesInDataEditView']":[2,0,1,"cfg_ShowFieldTypesInDataEditView"],"$cfg['ShowFunctionFields']":[2,0,1,"cfg_ShowFunctionFields"],"$cfg['ShowGitRevision']":[2,0,1,"cfg_ShowGitRevision"],"$cfg['ShowHint']":[2,0,1,"cfg_ShowHint"],"$cfg['ShowPhpInfo']":[2,0,1,"cfg_ShowPhpInfo"],"$cfg['ShowPropertyComments']":[2,0,1,"cfg_ShowPropertyComments"],"$cfg['ShowSQL']":[2,0,1,"cfg_ShowSQL"],"$cfg['ShowServerInfo']":[2,0,1,"cfg_ShowServerInfo"],"$cfg['ShowStats']":[2,0,1,"cfg_ShowStats"],"$cfg['SkipLockedTables']":[2,0,1,"cfg_SkipLockedTables"],"$cfg['SuhosinDisableWarning']":[2,0,1,"cfg_SuhosinDisableWarning"],"$cfg['TableNavigationLinksMode']":[2,0,1,"cfg_TableNavigationLinksMode"],"$cfg['TablePrimaryKeyOrder']":[2,0,1,"cfg_TablePrimaryKeyOrder"],"$cfg['TabsMode']":[2,0,1,"cfg_TabsMode"],"$cfg['TempDir']":[2,0,1,"cfg_TempDir"],"$cfg['TextareaAutoSelect']":[2,0,1,"cfg_TextareaAutoSelect"],"$cfg['TextareaCols']":[2,0,1,"cfg_TextareaCols"],"$cfg['TextareaRows']":[2,0,1,"cfg_TextareaRows"],"$cfg['ThemeDefault']":[2,0,1,"cfg_ThemeDefault"],"$cfg['ThemeManager']":[2,0,1,"cfg_ThemeManager"],"$cfg['ThemePerServer']":[2,0,1,"cfg_ThemePerServer"],"$cfg['TitleDatabase']":[2,0,1,"cfg_TitleDatabase"],"$cfg['TitleDefault']":[2,0,1,"cfg_TitleDefault"],"$cfg['TitleServer']":[2,0,1,"cfg_TitleServer"],"$cfg['TitleTable']":[2,0,1,"cfg_TitleTable"],"$cfg['TranslationWarningThreshold']":[2,0,1,"cfg_TranslationWarningThreshold"],"$cfg['TrustedProxies']":[2,0,1,"cfg_TrustedProxies"],"$cfg['URLQueryEncryption']":[2,0,1,"cfg_URLQueryEncryption"],"$cfg['URLQueryEncryptionSecretKey']":[2,0,1,"cfg_URLQueryEncryptionSecretKey"],"$cfg['UploadDir']":[2,0,1,"cfg_UploadDir"],"$cfg['UseDbSearch']":[2,0,1,"cfg_UseDbSearch"],"$cfg['UserprefsDeveloperTab']":[2,0,1,"cfg_UserprefsDeveloperTab"],"$cfg['UserprefsDisallow']":[2,0,1,"cfg_UserprefsDisallow"],"$cfg['VersionCheck']":[2,0,1,"cfg_VersionCheck"],"$cfg['ZeroConf']":[2,0,1,"cfg_ZeroConf"],"$cfg['ZipDump']":[2,0,1,"cfg_ZipDump"],"$cfg['blowfish_secret']":[2,0,1,"cfg_blowfish_secret"],PMA_ABSOLUTE_URI:[17,2,1,"-"],PMA_ARBITRARY:[17,2,1,"-"],PMA_HOST:[17,2,1,"-"],PMA_HOSTS:[17,2,1,"-"],PMA_PASSWORD:[17,2,1,"-"],PMA_PORT:[17,2,1,"-"],PMA_PORTS:[17,2,1,"-"],PMA_USER:[17,2,1,"-"],PMA_VERBOSE:[17,2,1,"-"],PMA_VERBOSES:[17,2,1,"-"],comment:[8,1,1,""],data:[8,1,1,""],database:[8,1,1,""],name:[8,1,1,""],type:[8,1,1,""],version:[8,1,1,""]}},objnames:{"0":["config","option","Config config option"],"1":["js","data","JavaScript data"],"2":["std","envvar","environment variable"]},objtypes:{"0":"config:option","1":"js:data","2":"std:envvar"},terms:{"0000":2,"01youknowme_at_gmail":4,"0c3f":17,"0d79":17,"0eb7":17,"0pt":8,"0x9c27b31342b7511d":17,"0xce752f178259bd92":17,"0xfefc65d181af644a":17,"100":[2,17],"1000":2,"1024":6,"1031":6,"113688":8,"11898":17,"11922":17,"12061":6,"12232":6,"1250":1,"127":[2,6],"13545":8,"1378":1,"1440":2,"1560":1,"1565":1,"168":[2,6,17],"16m":2,"172":[6,17],"179":6,"1867":6,"1898":1,"192":[2,6,17],"1952":[7,10],"1993":7,"1998":[3,4],"1b51":17,"1c17":17,"1df1":17,"200":6,"2000":[3,4,10],"2001":[2,3,4],"2002":6,"2004":4,"2006":1,"2007":8,"2008":4,"2009":[4,8],"2010":4,"2011":4,"2012":4,"2013":4,"2014":4,"2015":[4,17],"2016":[1,15,17],"2017":4,"2018":3,"2019":6,"2048":6,"2056":1,"210mm":8,"21704":6,"218a":15,"220":1,"2301":1,"240":2,"250":2,"255":2,"256":6,"2616":6,"26300":10,"26882":6,"297mm":8,"2cm":8,"2f17":17,"2fa":21,"300":[2,8],"3092849_at_qq":4,"31134":6,"3257":2,"3306":[2,6,17],"3457":1,"38cf":15,"3d06":17,"3d06a59ece730eb71b511c17ce752f178259bd92":17,"401":6,"404":2,"4096r":15,"42b7":17,"436f":17,"443":6,"4b1a":17,"4bd7":15,"500":[1,2],"50000":2,"500000":2,"50b9":15,"50x50":6,"511d":17,"5a32":17,"5bad":15,"5e4176fb497a31f7":15,"5xp_":17,"600":[1,6],"6375lpd_at_gmail":4,"63cb":17,"644a":17,"65d1":17,"660":6,"700":2,"720":1,"72048":2,"7383":6,"777":2,"7euser":6,"8000":17,"8080":17,"8192":6,"81af":17,"8259":17,"8259bd92":17,"851612429544":2,"9652":2,"98se":6,"9999":2,"999_at_yahoo":4,"9c27":17,"\u00e7okaj":4,"\u00e9tienn":4,"\u010diha\u0159":[3,4,17],"\u0161ime\u010dek":4,"\u03c0\u03b1\u03bd\u03b1\u03b3\u03b9\u03ce\u03c4\u03b7\u03c2":4,"\u03c0\u03b1\u03c0\u03ac\u03b6\u03bf\u03b3\u03bb\u03bf\u03c5":4,"\u0438\u0432\u0430\u043d":4,"\u043a\u0430\u0440\u043f\u043e\u0432":4,"\u043e\u043b\u0435\u0433":4,"\u043f\u0435\u0434\u044c\u043a\u043e":4,"\u0441\u0435\u0440\u0433\u0435\u0435\u0432\u0438\u0447":4,"\u0441\u0435\u0440\u0433\u0456\u0439":4,"\u0445\u043e\u043c\u0443\u0442\u043e\u0432":4,"\u0b95":4,"\u0b95\u0ba3":4,"\u0bae":4,"\u0bb0":4,"\u0bb7":4,"\u7f57\u6500\u767b":4,"\uc774\uacbd\uc900":4,"abstract":[4,19],"ale\u0161":4,"aputsia\u0138":4,"ara\u00fajo":4,"b\u00f8rge":4,"bal\u00e1z":4,"bokm\u00e5l":4,"boolean":2,"break":6,"byte":[2,7,8],"c\u00e9dric":4,"case":[0,2,6,12,13,17],"catch":17,"char":[0,2,6,15,17],"class":[2,6,17,19],"d\u00e1niel":4,"default":[0,7,9,14,17,18,19],"enum":[4,19],"export":[4,9,10,13,17,21],"final":[6,13],"fr\u00f8yshov":4,"function":[2,4,7,10,12,17,19],"garc\u00eda":4,"gesch\u00e9":4,"i\u0307sa":4,"import":[4,7,9,10,14,17,21],"j\u00fanio":4,"jo\u00e3o":4,"kate\u0159i\u0148\u00e1k":4,"kl\u00e4ger":4,"landh\u00e4u\u00df":4,"lo\u00efc":4,"long":[2,6,7,17,19],"lu\u00ed":4,"m\u00fcller":[3,4],"mat\u00eda":4,"micha\u0142":4,"mickevi\u010diu":4,"mirc\u0259lal":4,"montan\u00e9":4,"montr\u00e9al":6,"new":[1,2,4,7,8,15,17,18,19,20,21],"null":[2,17],"p\u00e9ter":4,"public":[2,3,6,17],"r\u00e4t":4,"return":[2,17,19],"seri\u00e1l":11,"short":[7,8],"switch":[2,7,17],"sz\u00e1sz":4,"t\u00f3th":4,"tom\u00e1\u0161":4,"toma\u0161t\u00edk":4,"true":[2,17],"try":[2,17],"var":[2,6,22],"vin\u00edciu":4,"void":17,"while":[1,2,19],"xos\u00e9":4,ACE:1,AES:[2,17],AND:[0,2],Abs:19,Adding:8,And:[1,4,6],Are:2,But:[2,8,13,15,17],CVS:4,FOR:[2,3],For:[2,4,6,8,15,17,18,19,22],GIS:6,His:17,IIS:[2,7,14,17],INTO:6,Its:6,Kis:4,NOT:[2,6,8],Not:[4,6],One:6,Such:17,THE:[0,19],TWS:4,That:[2,6],The:[0,2,3,4,7,8,11,13,14,15,16,17,19,20,22],Then:[2,6,17],There:[2,6,7,13,16,17,19,20],These:[1,2,6,13],Use:[2,4,6,12,17,19],Used:[8,17],Uses:17,Using:[1,2,8,9,11,14,19,20],Was:17,With:[2,12,17],Yes:6,_db:2,_get:17,_post:17,_server:[2,17],_session:17,_uri_schem:7,a59:17,aaleksanyants_at_yahoo:4,ab39:15,abd:4,abdulla:4,abeyrathna:4,abiword:8,abl:[0,2,4,12,15,17,20],abort:2,about:[2,7,8,9,11,17,19],abov:[1,2,6,17],abram:4,abravo_at_hq:4,absenc:[0,2,6],absolut:[2,17],abtract:19,academi:1,accept:[2,6,7],access:[0,2,4,7,13,14,15,17],accident:2,accommod:1,accompani:17,accomplish:[6,8,17],accord:2,accordingli:[2,6,19],account:[2,10,12,17],achch1990_at_gmail:4,achchuthan:4,achiev:[2,6,12,17],acl:[2,7,17],acokaj_at_shkod:4,across:[2,7],act:20,action:[2,12,15,17],actionlinksmod:2,activ:[2,6],actual:[6,17,19],acunetix:6,adam:4,adapt:1,add:[0,2,7,8,10,12,17],added:[2,4,6,17],addhandl:6,adding:[6,10,19],addit:[2,4,7,8,15,17,18],addition:[2,3,17],additon:18,addon:6,addopt:8,addprefix:17,addr:2,address:[0,6,7,17],addtyp:6,adjust:2,adler:7,administ:10,administr:[2,4,6,10,12,15,17],admir:4,adnan:4,adob:7,adopt:8,adriaenssen:4,adrian:4,adsbot:6,advanc:[6,15,17],advantag:6,advic:22,advis:[2,17],affair:1,affect:[2,6],afraid:17,african:1,after:[2,8],again:[2,13,17],against:[15,17],agent:6,agre:2,ahm:4,ahmedtek1993_at_gmail:4,aj_at_isit:4,ajax:4,ajaxif:4,ajaxifi:4,aka:17,ako:4,alan:4,albanian:4,albb0920_at_gmail:4,albert:4,alberti:4,alberty_at_neptunlab:4,albiol:4,aleksany:4,alemoretti2010_at_hotmail:4,ales_at_hakl:4,alessandro:4,alex:4,alexalex:4,alexand:[3,4],alexandr:4,alexei:4,alexi:4,alexrohleder96_at_outlook:4,algeri:4,algi:4,algorithm:[2,7,17],alia:4,align:6,alioglu:4,all:[2,5,6,7,8,10,12,13,15,17,18,19,22],alloc:2,allow:[1,2,4,7,8,10,12,13,17,18],allow_url_open:14,allowarbitraryserv:[2,17],allowdeni:[2,6,17],allownopassword:[2,17],allowoverrid:6,allowroot:[2,17],allowthirdpartyfram:2,allowuserdropdatabas:2,along:[3,17],alpha:6,alreadi:[2,17],also:[0,2,4,6,7,8,10,12,15,16,17,19,22],alter:[2,6,7,10],altern:[2,6,17],although:[2,4,6],alvar:4,alwai:[2,7,15,17,19],alwaysexpand:2,amalesh:4,amar:4,amihaita_at_yahoo:4,amir:4,ammar:4,among:[2,8],amount:[1,2,6,19],analys:4,analyz:[2,4,6],ander:4,andersen:4,andika:4,andika_at_gmail:4,andrea:4,andrei:4,android:20,andrzej:4,andrzej_at_kynu:4,angular:2,ani:[0,2,3,4,7,8,10,12,13,15,17,19],ankit:4,ann:4,announc:[15,17],anonym:[2,6],anonynuin:4,anoth:[1,2,6,7,13,17],answer:7,anticip:7,antiviru:6,anybodi:17,anyon:17,anyth:[6,17],anywai:6,apach:[2,7,14,17],apache2:6,apache_http_serv:7,apart:6,apc:6,api:[2,6,7],appear:[0,2,6,15],append:[2,19],appl:7,appli:[2,6,13,17,19],applic:[1,2,7,13,15,17,21],applytransform:19,approach:[2,20],appropri:17,approxim:[2,6],arab:4,arben:4,arbirari:18,arbitrari:[2,6,17],arbitraryserverregexp:2,architectur:6,archiv:[6,7,8,17],area:[1,2],arg_separ:6,argument:6,ari:4,arifianto:4,armel:4,armenian:4,around:[2,6,17],arrai:[2,6,17,18,19],arrow:6,articl:[6,8,11],artyom:4,asc:[2,17],ascend:2,ascii:[2,19],ash:4,ashkan:4,ashraf:4,ashutosh:4,ask:[2,7,9,20],aso:4,aspect:[2,14,22],assign:[2,6,15,21],associ:2,assum:[2,6,17],astarita:4,asuni:4,attach:[2,7],attack:[2,17],attemp:17,attempt:[2,6,15,17],attent:17,attila:4,attribut:8,atul:4,atulpratapsingh05_at_gmail:4,atvejis_at_gmail:4,auth:[2,17,20],auth_http_realm:2,auth_map:17,auth_typ:[2,17],authent:[4,9,14,15,21],authi:20,authlog:[2,17],authlogsuccess:2,authnam:17,author:[2,4,6,8,17,18],authrequest:17,authtyp:17,authuserfil:17,auto:2,auto_incr:[6,8],autocomplet:2,autoconnect:2,autodetect:2,autom:[4,17],automat:[0,2,4,7,8,10,16,17],auxiliari:17,avail:[2,3,6,7,13,15,17,19,20,22],availablecharset:2,averag:6,avoid:[2,6,8,17],awai:6,awar:[0,6,17],axel:4,axes:1,axi:[1,6],ayush:4,azerbaijani:4,azevedo:4,azzabi:4,b313:17,b947:15,b980:15,back:[7,8,12,13],backend:[6,17],background:2,backquot:6,backslash:6,backspac:10,backup:17,backward:[2,18],bacon:20,bad:[6,17],badalo:4,badalo_at_sapo:4,baiduspid:6,bailout_on_error:6,bakondi:4,balanc:2,ban:6,bansod:4,bao:4,baophan94_at_icloud:4,bar:[2,14],barri:4,base:[2,4,7,8,14,15,17,20,22],basic:[6,9,17,19,22],batch:10,bbedit:17,bd92:17,becaus:[2,4,17,18,19],beck:4,beck_at_web:4,becom:6,been:[2,5,6,8,17,18],befor:[2,6,8,15,17,18],begin:[2,6,8,17],behavior:[2,17,22],behaviour:[2,6],behind:[2,6],being:[2,8,15,17],belarusian:4,believ:6,bellon:4,belong:17,below:[0,2,7,12,13,18,19],beneath:6,benefit:[2,6],benjamin:4,bennetch:17,benni:4,berkelei:2,bernard:4,best:[6,8,17],better:6,between:[0,1,2,6],beyond:17,biesaga:4,big:[2,8],bigdump:6,bigger:[6,8],bimal:4,bin:[4,6],binari:2,bind:17,bisht:4,bit:[2,17],bits_at_gmail:4,bkehayov_at_gmail:4,blagynchy_at_gmail:4,blank:[2,19],blob:[2,10],blobstream:4,block:[2,6,7,17],blog:8,blowfish:[2,4,7],blowfish_:7,blowfish_secret:[2,17],bluthardt:4,bob:[2,6],bodi:17,bogor_at_gmail:4,book:[7,8,21],bookmark:[2,4,9,10,17,21],bookmarkt:2,bool2text:2,boost:2,bora:4,borg:4,borge947_at_gmail:4,borggrev:4,borrow:4,bot:6,botelho:4,both:[1,2,6,8,13,16,17],bottom:[2,6,12,13],bound:19,boutel:7,box:[0,9],boyan:4,branch:17,braschi_at_outlook:4,bravo:4,brazil:4,breakag:17,broader:7,broken:6,brows:[4,9,10,13,21],browsemarkeren:2,browsemim:2,browsepointeren:2,browser:[2,7,8,9,15,16,17,19],bruce:7,bruguera:4,bruno:4,brunomendax_at_gmail:4,brute:17,bskim45_at_gmail:4,buddika:4,buffer:[2,6,19],bug:[2,4],bugfix:4,buggi:[6,17],bugzilla:6,build:[2,6,17,19],builder:4,built:[4,6],bulgarian:4,bum:4,bumsoo:4,bunch:6,burak:4,busi:7,bussier:4,button:[0,2,6,7,17,18,20],buz_at_gmail:4,bypass:[2,6],bz2:2,bzip2:[2,6,7],bzipdump:2,c0ee:17,cach:[2,6,17],calcul:8,call:[2,6,7,10,13,17,19],calvo:4,can:[0,1,2,3,5,7,8,10,11,12,13,15,16,17,18,19,20,22],canada:6,cannot:[2,8,19],capabl:7,captcha:[15,17],captchaloginprivatekei:[2,17],captchaloginpublickei:[2,17],car:8,car_id:8,care:[6,19],carefulli:2,casotti:4,casotti_at_uol:4,cat:4,catalan:4,categori:13,category_id:13,caus:[2,15,17],caution:17,cav:4,cbb74bc:17,cdac1234_at_gmail:4,cdba:2,ce73:17,ce75:17,cedric:4,cell:[2,6,7],center:[6,17],cento:17,central:[2,4,17],central_column:2,cert:2,certain:[2,7,19],certfic:2,certif:[2,17],certifi:17,cf2a:17,cfg:[2,6,8,12,13,17,18,19,20],cgi:[7,17],chanaka:4,chanc:2,chang:[2,4,7,8,10,12,17,18,19,22],changelog:7,chao:4,chaovavanich:4,chapeaux:4,chapter:[2,6,17],charact:[2,7,8,17,19],charanyogeshwar_at_gmail:4,charedit:2,charg:2,charset:[2,4,6,17,19],chart:[4,9,21],chartextareacol:2,chartextarearow:2,chat:1,chathuranga:4,chaudhari:4,check:[2,3,4,5,6,7,10,12,17,19,22],checkbox:[1,2,8,12],checkconfigurationpermiss:2,checklink:6,chee:4,cheng:4,chien:4,chimera:6,china:4,chines:4,chirayu:4,chirip:4,chiyokawa:4,chiyokawa_at_gmail:4,chmod:[2,6],choic:[2,8,17],choos:[1,2,6,17,19],chose:[6,17],chosen:[2,6],chown:[2,6],chri:4,chrisj_at_ctel:4,christoff:4,christoph:4,chrome:20,chronolog:9,chrysler:8,cidr:2,cipher:[2,7],circumv:[2,6],cj_at_gmail:4,claimed_id:17,clanboy_at_163:4,clase:2,classless:2,clau:4,claus:2,clear:[6,17],click:[1,2,7,12,13,15,19,20],clickabl:[2,13],clickjack:2,client:[2,7,9,17],client_:7,clipboard:[2,6],clone:17,close:[2,6,17],cloud:17,clshttp:6,clue:6,cma:4,cocerhan:4,cochran:4,code:[2,4,6,7,15,17,18,20],codemirror:2,codemirroren:2,collaps:2,collat:2,collect:7,colognian:4,colon:6,color:2,column:[2,4,7,10,19],column_:7,column_com:2,column_info:[2,19],columns_priv:6,com:[2,3,4,6,7,8,14,17,19],combin:[2,6,8],come:[2,3,17,18],comma:[7,8,17],command:[2,6,17,20],comment:[0,2,4,7,8,17],commiss:7,common:[2,6,7,17,20],common_gateway_interfac:7,commonli:[7,8],commun:[7,10],compar:1,compat:[2,4,6,7,8,13,14,17,18,22],compil:6,complain:17,complet:[2,4,8,15,17],complex:[0,2,10],compliant:4,complic:2,compos:[2,3,9,20,22],comprehens:8,compress:[2,7,8,10],compressonfli:[2,6],comput:[7,17],computation:8,computer_sci:7,concept:[4,10],concern:[8,15],condit:6,conf:6,confer:4,config:[2,6,16,22],configur:[0,4,7,9,10,13,15,19,20,21],confirm:[2,6,20],conflict:6,conform:7,confus:6,connect:[7,9,10,12,15,16],connect_typ:2,consecut:6,consequ:2,consid:[12,17,20],consider:[1,17],consist:[6,18],consol:[4,9,10],consoleenterexecut:2,constanti:4,construct:[0,6],consult:[8,19],consum:7,contact:[6,15],contain:[2,8,13,17,18,19],container_nam:17,content:[2,7,8,9,15,17,19],context:6,continu:[2,17],contrib:17,contribut:[4,5,6],contributor:4,control:[2,4,7,12,15,17],control_:2,control_ssl:2,control_ssl_ca:2,control_ssl_cert:2,control_ssl_kei:2,controlconnect:15,controlhost:2,controlpass:[2,6,17],controlport:2,controlus:[2,6,17],convei:7,conveni:17,convent:19,convers:[2,4],convert:6,cooki:[4,7,9,14,18],coordin:[2,6],copi:[2,3,10,12,17,18],copyright:9,corazza:4,corazza_at_wanadoo:4,core:[2,7],correct:[2,17],correctli:[2,6,8],correspond:[2,6,19],corrupt:[2,6],cost:1,costa1988sv_at_gmail:4,costel:4,could:[2,8,12,15,17],count:[2,6,17],countri:6,country_cod:6,cours:[2,6],cover:17,coverag:6,craft:15,crawler:6,crawleradmin:6,creat:[2,4,7,8,10,13,21],create_t:17,creation:[2,4],creator:4,credenti:[2,17],credit:[3,9,15],criteria:6,cross:[2,7,17],cryptograph:[7,17],cspallow:2,css2:4,css:[2,4,18],csv:[7,10,17],csv_column:17,ctrl:[2,6],ctype:14,curl:[6,14],current:[1,2,4,6,7,10,13,15,17,18,22],currentqueri:2,cursor:[2,6],custom:[1,4,8,9,12,16,19,21,22],cut:2,cve:15,cwlin0416_at_gmail:4,cybot_tm_at_us:[3,4],czech:[2,4],d3xter_at_us:4,da2n_s_at_yahoo:4,da68:15,da68ab39218ab947:15,dadan:4,dalibor:4,dan:4,daniel:4,danilo:4,danish:[4,8],danorse_at_gmail:4,dark:2,darkthem:2,darlow:4,dash:[2,6],data:[1,2,7,10,15,16,17,19],databas:[0,4,7,8,9,10,13,15,16,21],database_trigg:7,databaseinterfac:15,databs:6,date:[1,2,6,8,17],dateformat:2,datetim:2,dave:4,david:4,davidson:4,db1:[2,17],db2:[2,17],dbase:6,dbconfig:17,dbf:6,dbg:[2,20],dbhost1:17,dbhost2:17,dbhost3:17,dbhost:17,dbm:7,dcbf:17,dckyoung_at_gmail:4,dd0:17,ddrmoscow_at_gmail:4,deactiv:[2,6],deal:7,debian:2,debug:[2,4],decemb:4,decid:[2,6],declar:[6,8,19],decreas:8,decrypt:[2,6],default_socket:6,defaultconnectioncol:2,defaultentrypoint:17,defaultforeignkeycheck:2,defaultfunct:2,defaultlang:2,defaultquerydatabas:2,defaultqueryt:2,defaulttabdatabas:2,defaulttabserv:2,defaulttabt:2,defaulttransform:[2,19],defeat:2,defin:[2,6,7,12,17,19],definit:[2,6,11,13,18],degrad:6,deki:4,deky40_at_gmail:4,delai:6,delet:[2,4,17,18,21],delimit:2,delisl:[3,4,11,17],delislma_at_collegesherbrook:4,delorm:4,demo:[2,8,17],demonstr:[2,20],den:4,deni:[2,4,17],denni:4,depend:[2,6,8,17,20,22],deploi:17,deprec:2,depth:6,der:4,derek:4,desc:2,descend:2,descipt:18,describ:[2,7,15,16,19],descript:[6,8,17,18,19],design:[4,7,9,17,21],designer_set:2,desir:[2,6,7,17],desktop:6,destin:[2,7],detail:[2,3,6,15,17],detect:[2,4,6,17],determin:[2,8,12,17],dev:[2,6,7,8,17],dev_at_gmail:4,develop:[4,7,8,9,15,17,18],deven:4,devenbansod:4,devic:7,dhananjai:4,dhima:4,dhtml:4,dhundhara:4,diagnos:6,diagram:6,dialog:[6,8,17],dialogu:6,did:[2,6],didn:2,die_error:17,dieter:4,differ:[2,4,7,10,17,19],differenti:6,difficult:6,difficulti:10,digest:6,dimension:7,dingo13_at_gmail:4,dingo:4,dinosaur:1,diprofinfin:4,dir:[6,17,19],direct:[2,6,17,19],directli:[2,7,8,10],directori:[3,6,7,8,9,17,18,19,22],dirnam:17,disabl:[2,6,17,20],disable_emodifi:6,disable_funct:2,disablei:2,disablemultitablemainten:2,disableshortcutkei:2,disallow:[2,17],disappear:[2,6],discov:17,discuss:6,disk:[7,8],disorderman:4,disorderman_at_qq:4,displai:[0,1,4,7,8,9,10,13,14,17,18,19],display_error:[6,17],displayserverslist:2,distanc:1,distinct:6,distribut:[2,3,4,9],disturb:17,div:17,divid:7,djh1017555_at_126:4,dll:6,dnighttv_at_gmail:4,doc:[2,6,7,8,17],docker:9,doctyp:[6,17],document:[2,7,14,17,22],documentclass:[6,8],doe:[2,10,12,14,15,17,18,19,20],doesn:[2,17,19],doing:[6,13,17,20],dom:4,domain:[2,6],domainnam:17,domen:4,don:[2,12,17],donavan_at_hotmail:4,donavan_martin:4,done:[0,2,6,17,20],dongl:20,dongyoung:4,dorning:6,dot:2,doubl:[2,6],dougla:4,douglaseccker_at_hotmail:4,dovi:4,dovyda:4,down:[2,12,13,19],downgrad:[6,17],download:[2,3,6,10,15,16,17,18,22],dozen:20,drag:[6,8,13],draw:1,drawn:[1,19],dri:4,driven:17,driver:2,drizzl:4,drop:[2,4,8,10,12,13,19],dropdown:[0,6],due:[2,6,17],duguying2008_at_gmail:4,dump:[2,4,8,10],dure:[6,8,17],dutch:4,dynam:[4,6,7],each:[0,2,3,7,8,12,17,19],eas:[2,19],easi:[2,6,8,19],easier:[2,7,18],easiest:[6,17,20],easili:[1,2,8,17],eccker:4,echo:17,edgar:4,edgarsneims5092_at_inbox:4,edit:[8,9,10,13,17,18,21],editor:[2,4,17],edjacobjunior_at_gmail:4,edlund:4,edlund_at_upright:4,edu:[4,17],eduardo:4,edward:4,edwin:4,edwin_at_yohanesedwin:4,eecyh:17,ef12:17,effect:[2,11,19],effici:[2,6],effort:15,efroys_at_gmail:4,egbrave_at_hotmail:4,egg:1,egorov:4,eilertsen:4,either:[2,6,8,15,16,17],ek_at_luna:4,ekio_at_gmail:4,electrotechn:7,element:[6,7,19],eliovir:4,eliovir_at_gmail:4,els:[0,2,4,6,17],elseif:17,email:[4,6,15],emb:8,embed:[2,8],emerg:17,emit:6,emphas:2,empti:[2,17],enabl:[2,7,12,14,17,18,19],enableautocompletefortablesandcolumn:2,enclos:[2,6],encod:[2,4,6,17],encompass:7,encount:6,encrypt:[2,15,17],encyclopedia:7,end:[0,2,6,8,17,19],endors:11,enforc:13,eng_at_globomail:4,engin:[6,7,8],english:[2,4,8,17],engstrom:4,enhanc:4,enlarg:6,ensur:[2,6,8,17],enter:[0,2,17,19,20],enterexecut:2,enterpris:6,entir:[6,14,17],entri:[2,6,17],entrypoint:17,environ:[2,6,15],epel:17,equival:2,erik:[4,6],ero:4,erosakos02_at_gmail:4,error:[2,4,7,8,17],escap:[2,6,15],escapesr:15,eshin:4,especi:[0,2,6,17],espen:4,esperanto:4,esri:2,essam:4,est:17,estonian:4,esy_vb_at_yahoo:4,etc:[2,6,8,17,19],etienn:4,evalu:8,even:[2,3,6,8,10,12,17],event:[2,4,7,10],ever:6,everi:[2,6,7,15,17,20],everyon:4,everyth:[0,6,17],everytim:2,everywher:6,evil:17,exabot:6,exact:[2,6],examin:6,exampl:[0,4,8,9,10,15,18,20,21,22],exce:2,except:[2,6,17],exchang:17,exclud:6,exclus:6,exectimelimit:[2,6],execut:[0,2,7,10,15,17],executor:6,exist:[2,4,7,8,15,17,21],exit:17,expand:[0,2,6],expandtab:[2,17],expans:[0,2,6],expect:[2,6,8],expens:1,experi:8,experiment:2,explain:[2,6,13,17],explan:[6,17],explicit:2,explicitli:2,explod:17,exploit:15,explor:[2,15,17],export_templ:2,expos:17,exposur:17,express:[0,2,6,7],ext:6,extend:[7,8,17,19],extens:[2,4,7,10,14,17],extension_dir:6,extern:[2,9,15,17],extra:17,extract:[6,17],eyal:4,eye:6,f188:17,facil:2,fact:[2,6,7,17],factor:[2,9,17,21],fadhiil:4,fadhiilrachman_at_gmail:4,fail2ban:[15,17],fail:[2,17],fall:13,fallback:2,fals:[2,6,17,22],famma:4,fando:6,faq:[7,9],fashion:2,fast:[6,7],fastcgi:7,fathi:4,fauveau:4,fauveau_at_globali:4,favicon:17,favorit:[2,17,18],fb5b:15,fcgi:17,featur:[0,2,4,5,7,8,9,11,12,13,17,18,19],feedback:4,feedfetch:6,feel:6,fefc:17,feryanto:4,few:[2,6,17],fewer:2,fido:21,field:[1,4,7,8,9,13,17,18,19],field_:7,file:[2,3,4,7,10,14,16,18,21,22],file_format:7,file_get_cont:17,file_template_databas:2,file_template_serv:2,file_template_t:2,file_upload:6,fileinfo:6,filenam:[2,6,19],files:8,filesystem:[2,6],filippo:6,fill:[2,6,15,17],filter:[2,6],filterlanguag:2,find:[0,2,6,11,15,16,17],fingerprint:[15,17],finnish:4,firewal:[2,6,17],first:[2,4,6,7,8,12,13,15,17,19,20],first__second__third:2,first_timestamp:2,firstlevelnavigationitem:2,fit:[2,3,4,6,8],fix:[4,13,15],flag:2,flemish:4,floss:4,flush:6,fly:2,focu:2,folder:[2,8,17],follow:[1,2,4,7,8,10,15,17],font:2,fontsiz:2,foo:6,foobar:17,food:1,footer:2,footnot:10,forc:[2,17],forcessl:2,foreign:[2,7,10,13],foreign_db:2,foreign_kei:7,foreign_key_check:2,foreignkeydropdownord:2,foreignkeymaxlimit:[2,6],forget:[2,6,17],forgot:6,form:[2,4,7,8,17],format:[2,4,7,8,10,17,19],format_http:17,former:4,formula:8,forth:19,forum:[4,6],forward:2,forwardfor:17,found:[2,15,17],foundat:3,fpdf:4,fpm:17,fragment:6,frame:[2,4,6],framework:22,francesco:4,francisco:4,franco:4,free:[3,7,10,19],freeotp:20,french:4,frequent:[2,7,9],freshli:17,fri:17,frisian:4,from:[0,1,2,4,7,8,9,10,12,13,15,18,19,20],front:6,frontend:17,ftp:[2,6,17],fujifilm:4,fulanodet:4,full:[0,2,12,17],fulli:[6,17],fun:11,func_char:2,func_dat:2,func_numb:2,func_spati:2,func_uuid:2,fundawang_at_gmail:4,further:[2,4,6,16],furthermor:2,futur:[2,6],future_id:6,ga244_at_is8:4,gabriel:4,gailli:7,gain:12,galician:4,gamma:6,gandon:4,gandon_at_isia:4,ganeshtheone_at_gmail:4,garvin:[3,4],gatewai:7,gc_maxlifetim:2,gd2:[7,14],gd2avail:2,gd_graphics_librari:7,geert:4,gener:[1,3,4,7,8,9,12,15,17,19,20,22],genuin:17,geograph:8,geometri:[6,8],georgiev:4,geospati:8,geral_at_jonil:4,german:4,get:[2,11,13,15,17,18,19],get_login_credenti:[2,17],getauthorizeurl:17,getinfo:19,getmessag:17,getmimesubtyp:19,getmimetyp:19,getnam:19,ghimir:4,giacobazzi:4,giacobazzi_at_ferrania:4,gigabot:6,gilli:4,gilli_at_gmail:4,giovanni:4,girish:4,git:[2,9,20],github1_at_openaliasbox:4,github:[4,6,17],give:[2,17,22],given:[2,6,8,12,15,17],global:[6,10,12,16,17,19],glossari:9,glund_at_silversoft:4,gmail:17,gmbh:6,gnauk89_at_googlemail:4,gnu:[3,7,17],goe:[2,6],goerick:4,going:[4,8,17],goldfing:1,good:[2,6,17,18,19],goodlinuxuser_at_chmail:4,googl:[4,6,8,17,20],google2fa:20,googlebot:6,got:[3,8],gov:4,gpg:17,gpl:3,grab:[6,17],gracefulli:6,grai:6,grant:[2,6,12,17],graphic:[7,10,13,17],great:[4,5],greatymh_at_gmail:4,greek:4,green:8,grid:2,gridedit:2,group:[2,6,7,15,21],grow:19,gryniuk:4,guarante:2,guess:2,gui_at_webseibt:4,guia:4,guid:[9,11],guilherm:4,gupta:4,gzencod:6,gzip:[2,4,7,10],gzipdump:2,haa:4,had:[6,17],hakl:4,hamann:4,hamzah:4,han:4,hand:[6,17],handbook:17,handl:[2,6,8,10,12,17,18,19],handler:4,happen:17,hard:[2,17],harden:[6,15],harder:15,hardwar:21,harm:2,harush:4,harvest:6,has:[0,2,6,7,8,17,18,19],hash:14,hassan:4,hate:17,haugom:4,hauk:4,have:[0,2,3,4,5,7,8,10,11,12,13,14,15,17,18,19],haven:6,head:17,header:[2,8,17],heart:6,hebrew:4,height:2,heis:6,helder:4,hello:4,help:[2,4,5],henningsen:4,her:6,here:[2,6,8,17,19],heritrix:6,hermann:4,hex:2,hexadecim:2,hhvm:6,hibern:8,hick:[3,4],hidden:2,hide:[2,17],hide_connection_error:2,hide_db:2,hidestructureact:2,hierarch:4,hierarchi:2,high:[2,6,8],higher:6,highlight:2,hilal94_at_gmail:4,hilal:4,him:4,hindi:4,hint:[2,6,7],hiroshi:4,his:[4,6,17],hisakawa:4,histor:2,histori:[2,4,17],hitowerdigit_at_hotmail:4,hkp:17,hofman:4,hofman_at_gmail:4,hold:[2,6],hole:[1,2],holm:4,home:[10,12],homepag:[6,19],hope:3,hopefulli:19,hord:4,horizont:[6,7],host:[2,4,7,17,19],hostnam:[2,6,7,17],hotp:20,hover:[2,13],how:[2,13,17,19],howev:[2,6,17,19],href:17,hst:17,htaccess:[2,6,7,17],html:[2,4,7,8,15,17,19],htmlspecialchar:17,htpasswd:17,http:[2,3,4,7,8,14,18],http_author:17,http_cooki:7,http_host:[2,6],http_post_var:6,http_user_ag:6,http_x_forwarded_for:2,httpd:6,httponli:2,httrack:6,hudsonvsm_at_gmail:4,huge:2,hugu:4,human:[4,8],hung:4,hungarian:4,hungdx_at_gmail:4,huseyn:4,huseyn_esgerov_at_mail:4,hyperfido:20,hyperlink:13,hypertext:7,hypertext_transfer_protocol:7,iOS:20,ia_archiv:6,ian:4,ibennetch:17,ibm:6,iccrawl:6,ichiro:6,ico:17,icon:[2,4,6,12,17,18,19],iconv:2,iconvextraparam:2,id_new:6,idea:[2,4,6,15,17,18,19],identif:17,identifi:[1,2,6,7,17],ie6:2,iec:[7,10],ifmodul:6,ignacio:4,ignor:[2,6],ignoremultisubmiterror:2,igor:4,iis:6,illustr:1,imag:[2,7,10,12,14,17,19],img:18,impact:[2,6,17],implement:[2,7,17,19,20,21],impli:3,implic:17,implicitli:7,impos:2,imposs:[2,17],improv:[2,4,7,8,10,15,17],inact:[17,19],inc:[2,6,16,17,18,22],includ:[2,3,4,7,8,10,15,17,18,19,20,22],include_onc:17,include_path:6,inclus:6,incom:17,incomplet:2,incorrect:6,increas:[2,6,8],increment:2,independ:[4,6,7],index:[2,4,7,9,10,17],index_:7,indic:[8,17],individu:12,indonesian:4,indrajith:4,inexperienc:12,info:[2,3,4,6,18,21],info_at_opsbielani:4,info_at_robinvandervliet:4,inform:[2,3,7,8,9,10,17,19,21],information_schema:2,infrastructur:17,ini:[2,6,10,14],ini_set:17,initi:[2,6,17],initialslidersst:2,inlin:[2,4,6,14],innodb:[2,7,10,13],innodb_strict_mod:6,innov:7,input:[0,2,4,17],insecur:17,insensit:6,insert:[0,2,4,8,17],insertrow:2,insid:[2,6,15,17,19,21,22],insist:17,instal:[2,7,8,9,14,15,19,20],instanc:2,instead:[2,6,8,17],instruct:[2,6],inted:2,integ:2,integr:[2,4,6,10,17],intend:[2,10,15,17,22],inter:[2,7],interact:[6,7],interchang:8,interest:[6,11],interf:6,interfac:[2,4,6,7,8,12,14,16],interfer:6,interlingua:4,intern:[2,7,8,13,17,19],internet:[2,7,17],internet_information_servic:7,internet_protocol:7,internetwork:7,interoper:8,interpret:[2,6],intext:6,intitl:6,intro:2,introduc:[2,4,6],introduct:[9,21],invalid:[2,6,17],invit:5,invok:17,involv:[6,17],ion:4,ionut:4,ip_address:7,ipmask:2,ipv4:7,ipv6:[2,7],ironpotts_at_gmail:4,is_str:17,isaac:17,isapi:[6,7,17],isma:4,ismael_at_gmail:4,isn:2,iso:[7,10],isp:[2,7,9,17],isset:17,issu:[2,9],italian:4,item:[2,6,7],its:[2,7,8,10,15,18],itself:[0,2,6,17],itxiaopang:4,iusr_machin:6,ivan:4,ivan_at_mail:4,ivanlanin_at_us:4,jackson:4,jafar:4,jakobsen:4,jakobsen_at_gmail:4,jakub:4,jan:[4,17],jan_at_nrw:4,janhenrikm_at_yahoo:4,janni:4,januari:17,janussen:4,japanes:4,java:[6,8],javascript:[2,4,8,14,15],jayaratn:4,jconstanti_at_yahoo:4,jean:7,jedermann:4,jeev:6,jhaveri:4,jim:4,joan:4,joan_at_montan:4,job:17,joe:[4,6],john1db:6,john2db:6,john_at_panevo:4,john_db:6,johnson:[3,4],join:[2,4,6],jona:4,jong:4,jongdeok:4,jonsson:4,jonsson_at_norsjovallen:4,jordi:4,jose:6,josep:4,jozef:4,jpeg:[7,14,19],jpg:7,jqplot:1,jqueri:[1,3,6,14,22],jremes_at_outlook:4,jrzancan_at_hotmail:4,json:[6,14,17,18],juha:4,juli:17,julian:[4,7],jump:[2,6],june:4,junior:4,jur:4,just:[0,2,4,7,8,13,17,20],k725:4,kang:4,kanji:4,kankanamg:4,kannada:4,kasperski:6,kasun:4,katerinak_at_gmail:4,kaushalya:4,kawada:4,kawada_at_den:4,kazi:4,keck:[3,4],keep:[2,6,17],kehayov:4,kei:[2,4,7,9,13,15,17,21],kelli:4,kempf:4,kept:[2,19],kettler:4,keybas:[15,17],keyr:[15,17],keyserv:[15,17],khomutov:4,kick:6,kid:4,kiddi:6,kidsmart33_at_gmail:4,kiko:4,kim:4,kim_at_nhn:4,kind:[2,6,7,15],kindli:6,kingdom:4,kirillov:4,kissu:4,kit:[3,17,22],klau:6,kleemann:4,klokner:4,know:[17,19],knowledg:6,known:[2,7,9,22],kobayashi_at_gmail:4,koch:4,koch_at_enough:4,kollar:4,kollar_at_pg:4,kollmann:4,koo:4,koolen:4,korakot:4,korakot_at_inam:4,korean:4,kosit:4,kr_at_gmail:4,kraai:4,krasimir:4,kristjan:4,kristjanrats_at_gmail:4,kristof:4,kronsbein:4,krystian4842_at_gmail:4,krystian:4,kumari:4,kunishima:4,kuppelwies:4,kurdish:4,kurt:4,kurt_at_kh:4,kushagra4296_at_gmail:4,kushagra:4,kword:8,kyeong:4,kyungjun2_at_gmail:4,label:[0,1,6,7,15],lacina:4,ladisch:4,lang:[2,17],languag:[4,7,9,10,17],languagetool_at_gmail:4,lanin:4,larg:[2,8],larger:[2,6],largest:6,lari:4,lari_at_oesch:4,lass:4,lasse_at_mydom:4,last:[2,6,19],lastpass:20,later:[0,2,8,17],latest:[2,6,7,14,17],latex:[7,10],latter:2,latvian:4,lau:4,launchpad:17,laureano:4,laureano_at_gmail:4,laurent:4,layer:[1,7,16],layout:[2,6,10,13,18],lc_messag:2,ldi_:4,lead:[0,2,6],leak:2,learn:[8,11],least:[2,6,17],leav:[2,6,17,19],lee:4,leedermeister_at_gmail:4,left:[2,4,8],legal:2,legenhausen:4,leiding:4,lem9:17,length:[2,8],lesli:4,less:[2,6,8,17],let:[2,13],letter:[2,6,8],lettercas:6,level:[2,6,7,8,17],lib:[6,19,22],libiconv:2,librari:[1,2,3,4,7,9,14,17,19],libreoffic:8,libwww:6,libxml:14,licens:[6,9],lifetim:2,lighttpd:17,lightweight:8,like:[0,2,4,8,10,13,15,17,19],likewis:6,lima:4,limburgish:4,limit:[8,9,12,15,17],limitchar:2,lin:4,line:[2,6,7,8,17,19],line_count:6,link:[0,1,2,4,6,10,12,13,15,17,18,19],link_id:13,linklengthlimit:2,linu:17,linux:[2,9,22],list:[2,4,7,8,15,17,20,22],listen:17,liter:[2,6],lithuanian:4,load:[2,4,10,16,17],loadabl:6,loader:6,loadfil:6,loadmodul:6,local:[2,8,16,17],localhost:[2,17],localis:8,localnet:17,localneta:2,localnetb:2,localnetc:2,locat:[7,17],lock:[2,6],log:[2,7,10,15,20],logformat:6,login:[2,14,15,16,17,20],logincookiedeleteal:2,logincookierecal:2,logincookiestor:2,logincookievalid:2,logincookievaliditydisablewarn:2,logo:[2,4],logout:[2,16,17],logouturl:2,lolo_at_phpheaven:4,longer:2,longtabl:[6,8],longtext:2,longtextdoubletextarea:2,look:[2,6,7,13,17,19],lori:4,lose:2,loss:6,lossi:7,lost:2,lot:[2,15],loup:7,low:[2,6],lower:[2,6],lower_case_table_nam:6,lowercas:17,lscape:8,lsml_at_liv:4,ltr:17,lubo:4,lucen:6,lui:4,luisan00_at_hotmail:4,lund:4,m42:4,m_at_gmail:4,mac:[2,7,17],mac_os_x:7,machin:[2,7,8,17],maciej:4,maciejka45_at_gmail:4,macintosh:7,macof:4,made:[2,4,6,7,17],madhura:4,madlen:4,mai:[0,2,6,7,10,17,19],mail:7,main:[1,4,9,12,17,18,19],mainli:7,maintain:[4,6,17],mainten:[2,4,10],major:[6,18],make:[2,5,8,15,17,18,19],make_id:8,maketitl:8,malai:4,malfunct:6,malgeri_at_gmail:4,malici:15,man:2,manag:[6,7,8,9,10,11,17,21],mani:[2,4,5,7,8,10,16,17],manipul:[2,7,8,10,17],manish:4,manual:[2,6,7,19,20],manufactur:[7,20],manuzhai:4,map:17,marc:[3,4,6,11,17],marc_at_infomarc:[3,4],marcel:4,march:4,marco:4,marconcini:4,marek:4,mari:2,mariadb:[2,6,10,14,17],marin:4,mark:[0,2,4,7],marker:8,market:7,markt:6,markup:[7,8],mart:4,martijn:4,martin:4,martin_at_vidn:4,martin_at_whistl:4,martinelli:4,martinelli_at_gmail:4,martyna:4,masahiko:4,master:[2,11,13,17],master_db:2,mat:4,match:[2,6,8,17,18],mathemat:8,mathia:4,matiasbellon:4,matter:13,matthia:4,matthias_at_bluthardt:4,max:6,max_allowed_packet:8,max_array_index_length:6,max_execution_tim:6,max_link:6,max_request_vari:6,max_totalname_length:6,max_travers:6,max_value_length:6,max_var:6,maxcharactersindisplayedsql:2,maxdblist:2,maxexactcount:[2,6],maxexactcountview:2,maxim:[4,8],maxime_at_fre:4,maximum:[2,6],maxnavigationitem:2,maxrow:2,maxsizeforinputfield:2,maxtablelist:2,maxtableuipref:2,mayb:6,mbstring:[2,7,14],mcrypt:[6,7],me_at_derrabu:[3,4],me_at_supergarv:[3,4],mean:[2,15,17,19],meant:2,measur:[2,7],mechan:[2,4,6,17],media:6,mediapartn:6,medio:4,meet:17,memoranda:7,memori:[2,8],memory_limit:[2,6],memorylimit:2,memoword_at_163:4,mendax:4,mendel:[3,4],mention:[2,6,17],menu:[2,6,21],merchant:3,messag:[2,17],met:17,meta:[2,17,19],metagerbot:6,method:[2,6,7,8,13,17,19],methodolog:7,michael:[3,4],michal:[3,4,17],michal_at_cihar:[3,4],michel:4,microsoft:[7,10],middl:2,might:[2,6,8,11,12,15,17,22],migrat:6,mike:4,mike_at_graftonhal:4,miko:4,mileag:8,mime:[2,4,7,11,19],mimetyp:[2,19],mind:17,miner:6,minh:4,minim:[6,17],minimum:[2,6],minor:[4,6],minsizeforinputfield:2,minu:0,miquel:4,mirror:[6,17],misc:1,miss:[2,7,15,19],mit:[3,17],mitenem_at_outlook:4,mitig:[6,15],mix:2,mj12bot:6,mkdir:6,mkkeck_at_us:[3,4],mladenov:4,mmcach:6,mmcrawler:6,mmh15_at_windowsl:4,mobil:[4,20],mod:6,mod_gzip_item_includ:6,mod_proxi:6,mod_proxy_fcgi:[7,17],mod_rewrit:6,mod_ssl:6,mode:[0,4,9,14],moder:4,modif:6,modifi:[2,3],modul:[6,7],moham:4,mokhtari:4,molnar:4,morai:4,more:[0,1,2,3,7,8,15,17,20],moreov:6,moretti:4,mosh:4,most:[2,4,6,7,8,10,13,17,19,20],mostli:[2,8],motuza:4,motuzas_at_gmail:4,mount:2,mous:[2,6,13],mousewheel:6,move:2,movement:1,mrdaniloazevedo_at_gmail:4,msie:6,msnbot:6,much:[6,19],muhammad:4,mulla:4,multi:[2,4,7,9,17],multidimension:8,multipl:[1,4,8,10,15,17],multipurpos:7,multiselect:6,multiserverexample70518:2,multithread:7,murariu:4,murariu_at_yahoo:4,must:[0,2,6,8,10,12,13,17,20],my_db:2,myadmin:17,mydatabas:2,mydb1:17,mydb2:17,mydb:[2,6],mydump:8,myisam:[6,7,10],mynam:0,mysql:[4,7,8,9,10,11,12,13,14,15,17,22],mysql_connect:6,mysql_db_serv:17,mysql_fetch_field:19,mysql_pconnect:2,mysql_root_password:17,mysql_upgrad:6,mysqladmin:6,mysqld:6,mysqli:[2,4,7,10],mysqlminvers:2,mysqlnd:2,myung:4,n8falke_at_us:4,nabin:4,naderi:4,naderi_at_gmail:4,naeem:4,nair:4,nakandala:4,nakrani:4,name:[0,2,4,7,12,13,17,18,19],nast3zz_at_gmail:4,nasti:15,nativ:[2,13],natur:2,naturalord:2,navarro:4,navig:[4,9,12],navigationdisplaylogo:2,navigationdisplayserv:2,navigationhid:2,navigationlinkwithmainpanel:2,navigationlogolink:2,navigationlogolinkwindow:2,navigationtreedbsepar:2,navigationtreedefaulttabt:2,navigationtreedefaulttabtable2:2,navigationtreedisplaydbfilterminimum:2,navigationtreedisplayitemfilterminimum:2,navigationtreeenableexpans:2,navigationtreeenablegroup:2,navigationtreepointeren:2,navigationtreeshowev:2,navigationtreeshowfunct:2,navigationtreeshowprocedur:2,navigationtreeshowt:2,navigationtreeshowview:2,navigationtreetablelevel:2,navigationtreetablesepar:[2,6],navigationwidth:2,ne0x_at_us:4,nearli:2,necessari:[2,19],need:[0,2,8,10,12,13,14,15,17,18,19,20],neg:6,neglig:8,neil:4,neimani:4,neither:[2,6],neomo:6,nepali:4,nest:[2,4],net:[2,3,4,6,7,15,17,18],netcologn:6,network:[2,6,7,8,17],never:[2,17],nevertheless:17,newer:[2,8,14,17],newest:2,newli:[8,17],newlin:2,newsblog:6,next:[2,6,17],nginx:14,nhibern:8,nicola:4,niel:4,niemand:4,nijel:17,niko:4,niko_at_gmail:4,nikto:6,ninad:4,nisarg:4,nisargjhaveri_at_gmail:4,nitrotoll_at_gmail:4,nix:2,nnabinn_at_hotmail:4,no1:2,no2:2,noblob:2,nobody_at_gmail:4,node:7,nofoot:8,nohead:8,nokeepal:6,non:[2,8],none:2,nontawat39_at_gmail:4,nopassword:2,nor:6,nordenberg:4,noreply_at_webl:4,normal:[2,4,6,17,19],norwegian:4,not_nul:19,notabl:7,notat:8,note:[0,2,6,17,19,22],noticia:4,now:[0,2,8,13,17],nowher:2,ntf:2,number:[0,1,2,7,8,15,17],numer:[2,6],numfavoritet:[2,6],numrecentt:2,nutchcv:6,nyu:4,obgzip:[2,6],object:[6,8,17,19],obrador:4,obtain:[2,15],occur:[2,6,17],oesch:4,off:[2,6],offer:[1,2,6,7,13,16,17],offic:[7,8],offici:[6,11,17,19],oficial_at_gmail:4,often:[2,6,8,17],okai:17,old:[2,6,11,17],older:[2,9,10],olivi:[3,4],olof:4,om_at_omni:[3,4],omar:4,omar_2412_at_l:4,omit:2,omniexplorer_bot:6,onc:[2,12,13,17,20],ondra:4,ondrasek:4,one:[1,2,7,8,10,12,13,15,17,20,22],ones:[2,4,6,22],onli:[1,2,4,7,8,12,13,15,16,17,19,20],onlin:6,only_db:2,open:[2,5,6,7,10,13,14,17],open_basedir:2,opendocu:[7,10],opengi:4,openid:17,openid_messag:17,openid_relyingparti:17,openlay:6,openoffic:8,openssl:[14,17],oper:[1,2,7,8,17,19],opposit:2,opt:20,optim:[2,4,6],option:[1,9,15,16,17,19],order:[2,6,7,8,9,13,17],ordinari:17,org:[2,3,4,6,7,8,17],organ:7,organis:7,orient:[2,6,7],origin:[2,6,9,14,17,18,19],orion1979_at_yandex:4,orzkun_at_ageag:4,os_x:7,other:[2,4,5,6,7,8,9,10,12,13,15,16,17,19,21,22],otherwis:[0,2,6],our:[2,5,6,15,17,18,19],out:[2,5,7],outdat:17,output:[2,4,6,8,19],output_compress:6,outsid:[2,19],outsourc:4,over:[2,6,7,12,13,17],overcom:6,overlord666_at_gmail:4,overrid:[6,17],overview:[6,19],overwhelm:12,overwrit:2,overwritten:2,own:[2,10,15,17,18,19],owner:[2,17],owneremail:6,ownerfirstnam:6,ownerlastnam:6,ownerphon:6,ownerphone1:6,ownerphone2:6,ownership:6,pack:6,packag:[2,6,9,17],packagist:17,packet:[7,8],page:[0,4,7,9,10,12,13,14,17,18,19],pai:17,pair:[2,17],palid:4,palider_at_seznam:4,palstsiuk:4,pan:6,pandei:4,pandithawatta:4,panel:[6,9],pantola:4,papaz_p_at_yahoo:4,paper:[2,6],paragraph:6,param:[2,17],paramet:[2,8,17,19],parent:[6,17],parind:8,parkourpotex_at_gmail:4,pars:[8,18,19],parsabl:8,parse_url:6,parser:[4,8],part:[2,6,7],parti:[6,9,11,17,18],partial:2,particular:[3,6,7,12,17],particularli:[7,17],pass:[2,6,10,12,17,18,19],passhosthead:17,passphras:2,passwd:17,password:[2,10,12,17],past:2,patch:[2,4],path:[2,17,22],path_dir:17,path_to_phpmyadmin:6,path_to_your_phpmyadmin_directori:2,pathprefixstrip:17,patrik:4,pattern:2,paul:6,paulei:4,pavel:4,pbm:4,pcre:[2,7],pdf:[4,7,9,10,11,13,17],pdf_page:[2,6],pdfdefaultpages:2,pdfpageheight:8,pdfpages:2,pdfpagewidth:8,pdo:8,pear:[4,7,17],pebbl:20,peccatt:4,pedro:4,peer:2,pem:2,pencil:12,peopl:[4,5,6,10,22],per:[2,6,7],perekupka:4,perfect:[2,17],perform:[2,6,10,12,14,15,17],perhap:17,period:17,perkontevs_at_gmail:4,perl:[6,7],permiss:[2,6,12,17],permit:[2,12],persian:4,persist:[2,16],persiste1_at_gmail:4,persistentconnect:2,person:[2,6,7,17],person_nam:6,petbre:6,petdob:6,pete:4,peter:4,petnam:6,petr:4,pettyp:6,pgp:[15,17],ph3n1x:4,phan:4,phillip:4,phmyadmin:17,phone:20,photograph:7,php3:4,php4:[4,6],php5_modul:6,php5apache2_2:6,php5t:6,php:[2,4,7,9,10,16,17,18,19,20,22],php_mysqli:6,php_self:[6,17],phpinfo:[2,6],phpinidir:6,phpmy:6,phpmyadmin:[0,1,2,3,4,5,7,8,10,11,12,13,14,15,18,19,20,21],phpmyadmin_at_zweisteinsoft:4,phpmyadmin_x:17,phpmyadminovi:11,phpmyadnin:18,phpmysqlformgen:4,phpseclib:4,phpwizard:[4,6],piankov:4,pick:6,piec:15,pikto:6,piller:4,pin:2,pink:6,piotr:4,pipe:2,pistej2_at_gmail:4,pistej:4,place:[2,6,17],placehold:0,placella:4,placement:6,plai:17,plain:[2,6,17,19],plamen_mbx_at_yahoo:4,plan:8,platform:[2,6,7],plathei:4,pleas:[2,6,7,8,15,17,19,22],plesk:2,plot:6,plu:[4,6],plug:19,plugin:[4,6,8,19],pma:[2,17],pma__bookmark:2,pma__central_column:2,pma__column_com:2,pma__column_info:2,pma__designer_set:2,pma__export_templ:2,pma__favorit:2,pma__histori:2,pma__navigationhid:2,pma__pdf_pag:2,pma__rec:2,pma__rel:[2,6],pma__savedsearch:2,pma__table_coord:2,pma__table_info:[2,6],pma__table_uipref:2,pma__track:2,pma__us:2,pma__userconfig:2,pma__usergroup:2,pma_absolute_uri:17,pma_arbitrari:17,pma_at_sebastianmendel:4,pma_combin:6,pma_db:17,pma_dbi:4,pma_host:17,pma_password:[6,17],pma_port:17,pma_single_signon_cfgupd:17,pma_single_signon_error_messag:17,pma_single_signon_host:17,pma_single_signon_messag:17,pma_single_signon_password:17,pma_single_signon_port:17,pma_single_signon_us:17,pma_us:17,pma_usernam:6,pma_verbos:17,pmaabsoluteuri:[2,6,17],pmadb:[2,13],pmahomm:[2,18],pmanorelation_disablewarn:2,pmapass:[2,17],pmasa:[6,15],pmatest:2,png:18,point:[2,6,7,17],polici:[2,9],polish:4,popcorn:4,popul:8,popular:[7,8],port:[2,7,17],port_:7,portabl:7,portable_document_format:7,portion:2,portnumb:2,portugues:4,pose:15,posit:[6,7],possibl:[2,5,8,15,16,17,19],post:[2,6,17],post_max_s:6,potenti:2,power:8,pozzato:4,practic:2,pragmarx:20,pratap:4,pre:[2,17,19],preappend:2,preconfigur:8,predatorix_at_web:4,predecessor:7,predefin:10,prefer:[2,4,17],prefix:[2,6],preform:15,prejudic:1,preliminari:8,prepar:[2,7,15,17],prepend:19,preprocessor:7,present:[2,6,8,12,15,17],press:2,pretti:4,prevent:[2,17],previou:[2,6,17],price:8,primari:[2,4,7,13,17],print:[4,21],printer:4,printview:[2,4],prior:17,privaci:17,privat:[2,6,20],privileg:[2,4,10,15,21],probabl:[6,17,22],problem:[2,7,8,17],problemat:6,procedur:[2,7,10],process:[7,12,17],processor:8,procs_priv:6,produc:[2,8,13],product:[6,8,17,20],profession:7,program:[2,3,6,7,8,15],progress:14,prohibit:2,project:[2,4,7,9,17],prompt:[2,17],proper:[2,6,8,10,13,17,19],properli:[2,6,13,17],properti:[2,4,6,19],propertiesnumcolumn:2,propos:[6,10],protect:[2,15,17],protectbinari:2,protocol:[2,7,17],provid:[2,6,7,10,12,17,19,20,22],provok:15,proxi:[2,17],proxypass:[2,6],proxypassrevers:6,proxypassreversecookiedomain:6,proxypassreversecookiepath:6,proxyurl:2,proxyus:2,pruett:4,przemo:4,przybylski:4,psbot0:6,pub:15,publi_at_web:4,publicli:2,publish:[2,3,15,17],pull:[2,17],pundalik:4,punjabi:4,purodha:4,purpos:[2,3,7,8,15,20],put:[2,15,17,18,19],python:6,qbe:[4,10],qiang:4,qualifi:17,qualiti:8,queri:[0,1,4,7,8,9,10,15,17],queryhistorydb:2,queryhistorymax:2,querystr:17,question:[7,9],quick:[2,6,7,9],quickli:8,quit:[2,4,6,18,20],quot:6,qyz:4,r9uk:17,ra4_at_openmailbox:4,rachim:4,rachman:4,radio:[6,7],rafael:4,raghuram:4,rai:4,raj:4,rajandran:4,random:[2,4,15],rang:[2,7],raouf:4,rare:6,rate:15,rather:[2,6,8,12,17],ratio:14,ratschil:[3,4],raul:4,raul_at_wservic:4,ray_at_datahui:4,reach:[17,19],read:[2,6,8,10,17],readabl:[6,8],readi:17,readm:17,real:[2,6,13],real_password:17,real_us:17,realli:[2,6,17,20],realm:[2,17],rearrang:6,reason:[2,6,14],recal:2,recaptcha:[2,6,14],receiv:[3,7,19],recent:[2,6,7,8],recod:2,recode_str:2,recodingengin:2,recommend:[2,6,7,8,14,17],record:[2,7,8,12,13],recov:6,recreat:6,recv:17,redesign:4,redhat:6,redirect:[2,17],redistribut:[3,22],refactor:4,refer:[2,6,7,13],referenti:[2,10],reflect:7,refman:[2,6,7,8],refresh:2,regard:[2,10,19],regardless:17,regener:15,regex:17,regul:8,regular:[2,4,7],regullar:2,reject:2,rel:[2,6,17],rel_countri:6,rel_person:6,rel_town:6,relat:[2,4,7,9,10,17,21],relationaldisplai:2,relationship:13,releas:[2,4,6,9,15],relev:2,reli:17,reliabl:[2,6,8,17],relyingparti:17,relyingparty_result:17,remain:[0,2],reme:4,rememb:[0,2,17],remembersort:2,remot:[2,7,17],remote_addr:2,remote_us:6,remov:[2,4,6,10,12,17,18],renam:[2,8,10,17],renato:4,renatomdd_at_yahoo:4,render:[8,15],rental_r:1,reorder:6,repeat:[2,6],repeatcel:2,replac:[0,2,6,17,18,22],replacement_cost:1,repli:17,replic:[4,6],report:[2,4,6,9],repositori:[3,7,17,20],repres:[2,6,7],represent:4,reproduc:6,reqirep:17,request:[2,7,17],request_for_com:7,request_method:6,request_uri:[6,17],requir:[2,8,9,10,15,17,18,20],resav:17,research:7,reserv:2,reservedworddisablewarn:2,reset:6,resid:6,resiz:6,resolut:7,resolv:6,resourc:7,respect:[3,6],respond:6,respons:[6,7],restart:[6,17],restor:8,restrict:[2,17],result:[0,1,2,10,17],retainquerybox:2,retriev:[2,17],return_to:17,returnto:17,reveal:2,revenu:1,revers:[2,17],review:17,revis:[2,6,7],revistafammatvmus:4,revok:2,rewrit:[6,17],rewritebas:6,rewritecond:6,rewriteengin:6,rewriterul:6,rewrot:4,rex:4,rfc1867:6,rfc2616_header:6,rfc:[6,7,10],ribeiro:4,ribeiro_at_gmail:4,ricardo:4,rifthi:4,rifthy456_at_gmail:4,right:[2,8,12,17,19],risk:[2,6],rob:6,robbat2_at_us:[3,4],robin:[3,4],robot:17,rocha:4,rocha_at_zoho:4,rodrigo:4,rodrigu:4,rohled:4,rohmberg:4,rohmberger_at_hotmail:4,romanian:4,ronni:4,ronniesimonf_at_gmail:4,roohan:4,roohan_cena_at_yahoo:4,root:[2,12,17],roszatycki:4,rouslan:4,rout:[2,17],router:17,routin:[2,4],row:[1,2,4,7,8],row_:7,row_format:6,rowactionlink:2,rowactionlinkswithoutuniqu:2,rowactiontyp:2,rsa:17,rubinov:4,ruiz:4,rule:[2,6,17,19],ruleant_at_us:4,run:[2,7,10,15,20],russian:4,rutkowski:4,rwx:[2,6],saad:4,safe:[2,17],sai:[0,13,19],sailboat:4,sakamoto:4,sake:6,sakila:6,saleh:4,salvadoporjc_at_gmail:4,sam_at_gmail:4,same:[0,1,2,12,17],sampl:[2,6,8,17],samyoul:20,sander:4,sandro123iv_at_gmail:4,sandro:4,sanit:6,santana:4,santana_at_gmail:4,sapi:2,sarna:4,sascha:4,save:[4,6,8,9,16,17,18],save_path:6,savecellsatonc:2,savedir:[2,8],savedsearch:2,saverio:4,saw:6,sbin:17,scale:6,scan:[6,20],scanner:6,scatter:6,scenario:[6,17],schaefer:4,schema:[2,4,8,13],scheme:[2,6],schneier:7,scientif:8,scooter:6,scope:17,scorpio_at_gmail:4,scp:6,scratchboard:[4,6],screen:[8,17,18],screenshot:18,script:[2,4,8,19,22],scriptalici:8,search:[2,4,9,10],searchabl:17,sebastian:[3,4],sebastian_at_sgundersen:4,secion:15,second:[2,6,12,19,20],secret:2,section:[1,2,5,6,17,19],secur:[2,7,9,12,19,21],secure_cooki:17,secure_sockets_lay:7,securer:4,see:[0,2,3,4,8,10,12,13,14,15,17,18,19],seealso:7,seekbot:6,seem:[2,8,17],seen:2,segment:2,seibt:4,select:[0,1,2,4,8,12,13,17,18,19],selector:2,selenium:4,self:2,send:2,senderrorreport:2,sens:19,sensi:6,sensit:[0,2,6,15],sent:[2,4,7,15],seo:6,seoma:6,seongki:4,seosearch:6,separ:[2,4,6,7,8,17],separated_valu:7,sequenc:7,serbian:4,seri:[1,7],serial:8,seriou:6,serv:[7,17],server:[4,7,8,9,10,11,12,13,15,20,22],server_:7,server_address:2,server_at_gmail:4,server_nam:17,server_port:17,serverdefault:2,serverlibrarydifference_disablewarn:2,servic:[2,6,7,17],session:[2,6,14,16,17],session_get_cookie_param:2,session_id:17,session_nam:17,session_save_path:[2,17],session_set_cookie_param:[2,17],session_start:17,session_write_clos:17,sessionsavepath:[2,17],sessiontimezon:2,set:[1,4,7,9,10,16,17,19,20,22],set_magic_quotes_runtim:17,setenvif:[6,17],setfacl:2,setia:4,setia_at_gmail:4,setinputfilt:6,setlength:8,setoutputfilt:6,setup:[4,9,13,19,22],setup_config_fil:22,setup_dir_writ:22,sevdimali:4,sevdimaliisayev_at_mail:4,sever:[2,3,6,7,8,13,16,17,19,20,22],sevillano:4,seward:7,shahrabani:4,shall:13,shameem:4,shapefil:[2,8],share:[2,17],sharifov_at_programm:4,she:6,sheet:8,shell:6,sherbrook:6,shift:[2,6],shin:4,ship:[7,17,18,22],shirian:4,shirian_at_gmail:4,shortcut:[2,6,9,17],shorten:6,shorter:[2,6],should:[2,3,4,7,8,12,15,17,18,20,22],shouldn:17,show:[2,6,15,17],show_pag:17,showal:2,showasphp:2,showbrowsecom:2,showchgpassword:2,showcolumncom:2,showcreatedb:2,showdatabasesnavigationastre:2,showdbstructurecr:2,showdbstructurelastcheck:2,showdbstructurelastupd:2,showfieldtypesindataeditview:2,showfunctionfield:2,showgitrevis:2,showhint:2,shown:[1,2,8,13,17,18],showphpinfo:2,showpropertycom:2,showserverinfo:2,showsql:2,showstat:2,shp:6,shutdown:6,side:[2,7,17],sign:[2,17],signatur:17,signific:4,significantli:8,signoncookieparam:[2,17],signonscript:[2,17],signonsess:[2,17],signonurl:[2,17],silent:6,silva:4,simecek_at_gmail:4,similar:[2,6,8,13,15],similarli:6,simon:4,simoncini:6,simpl:[1,2,7,8,17,21],simple2fa:[2,20],simpli:[2,8,12,17],simplifi:[4,12],sinc:[1,2,4,6,8,14,17,20],singh:4,singl:[2,7,8,17],sinhala:4,site:[2,6,11,17],sitesearch:6,situat:[6,7,17],siu:4,size:[2,8],skill:6,skip:[17,22],skiplockedt:2,skshin_at_gmail:4,slash:2,slider:2,slovak:4,slovenian:4,slow:2,slowdown:6,slurp:6,small:[2,6],smaller:[2,4,6],smart:[2,4],smarte_at_gmail:4,smita:4,smooth:1,smtp:4,snap:2,snappi:6,snapshot:2,snippet:2,socket:[2,7],softwar:[3,6,7,8,10,17,20,22],software_extens:7,solut:[6,17,20],solv:6,some:[2,4,7,8,15,17,19,22],someth:[2,6,13,15,17],sometim:17,somewher:[6,15],somthanat:4,somthanat_at_gmail:4,song:4,soom:4,soon:0,sora:4,sora_at_tiscali:4,sorani:4,sort:[2,6,7,8],soulard:4,sourc:[2,4,5,6,7,9,17,20,21],sourceforg:[3,4],souza:4,space:[0,2,6],spanish:4,speadsheet:8,special:[0,2,7,8,13,15,17],specif:[2,7,8,19,21],specifi:[1,2,4,8,17,19],speed:[2,6,8,17],spl:14,split:[2,6,8,19],sponsor:6,spreadsheet:[6,10,14],sql:[0,1,4,7,9,10,11,17],sqllog:2,sqlqueri:2,sqrt_at_entless:4,src:[6,17],srnka:4,ssl:[6,7,9],ssl_ca:[2,17],ssl_ca_path:[2,17],ssl_cert:[2,17],ssl_cipher:[2,17],ssl_kei:[2,17],ssl_verifi:[2,17],ssloption:6,sta:4,stabl:6,stack:1,standard:[2,4,6,7,8,14,20],star:[2,6],start:[1,2,4,8,17],starthistori:2,startup:[2,6],state:2,stateless:15,statement:[2,6,10,17],station:6,statist:[2,4],statu:[2,4,6],stdenvvar:6,stdpass:2,stduser:2,ste:4,stefan:4,stefano:4,step:[6,17],steve:4,steven:4,still:[2,12,15,17],stock:17,stokkan:4,stop:[2,6],storag:[0,2,6,7,9,13,15,16,19,20],store:[2,4,7,10,16,17,18,19,21],stored_procedur:7,straka3_at_gmail:4,straka:4,strftime:6,strict:2,strijbol:4,string:[0,2,4,17,19],strip:[0,2],strlen:17,strongli:[2,14],structur:[4,7,8,9,10,13,17,18,21],sts:[2,17],stuff:4,stuffit:17,style:[2,6,17,18],sub:[6,15],subdirectori:[2,18],subfold:[6,17],subject:[2,6],sublevel:2,submiss:2,submit:[2,6,17],subpackag:[2,17],subroutin:7,subset:10,substitut:6,substr:2,subtyp:19,success:[2,6,15,17],successfulli:6,suffic:17,suffici:6,suffix:[2,17],suggest:[4,6,14,15,17],suhardi:4,suhosin:2,suhosindisablewarn:[2,6],suit:[6,7,17],suitabl:8,sum:6,summer:4,sun:4,superus:[12,17],suppli:[2,17],support:[1,2,4,7,8,9,13,14,17,18,20],suppos:6,suppress:2,supun:4,surbakti:4,sure:[2,17,19],surfac:15,surround:6,svalekja:4,svec:4,sven:4,swedish:4,symbol:[2,18],symlinksifownermatch:6,symmetr:7,sync:4,synchron:[4,9],synoobot:6,syntax:[2,6],sysadmin:[2,6],syslog:[2,17],system:[2,4,6,7,8,16,17,18,22],szsilva_at_gmail:4,t10:2,t3if_at_ladisch:4,tab:[7,8,9,12,13,16,17],tabbrows:6,tabl:[2,4,7,10,12,13,17,19,21],table_:7,table_coord:[2,6,13],table_info:2,table_nam:6,table_uipref:2,tablenam:6,tablenavigationlinksmod:2,tableprimarykeyord:2,tables_priv:6,tablesepar:6,tablettws_at_gmail:4,tabsmod:2,taceloski:4,tag:6,taiwan:4,take:[1,2,6,10,19],taken:6,talk:17,tamil:4,tamsjadi:4,tape:7,tar:[7,17],tar_:7,tarbal:17,target:[2,6],tarzq28_at_gmail:4,task:10,tbl_chang:4,tbl_creat:4,tbl_dump:6,tbl_row_delet:6,tbl_select:4,tbl_structur:19,tcp:[2,6,7],tcpdf:[4,6,7],tczzjin_at_gmail:4,team:[2,15,17],technic:21,technolog:7,tecnick:4,tecnickcom:6,telekom:6,tell:[2,6],telnet:6,tempdir:[2,6,17],templat:[2,17,19],template_abstract:19,temporari:[2,6,17],temporarili:[2,6,16],term:3,terri:4,test:[2,4,6,17,20,22],tex:[6,7,8],text:[0,4,7,9,10,17,19],textarea:2,textareaautoselect:2,textareacol:2,textarearow:2,textbox:12,textfield:19,textimagelink:2,textlink:2,textual:[6,8],thai:4,than:[2,4,8,10,12,17,20],thank:[4,6],thei:[2,4,12,17,19,22],them:[2,7,16,17,19,22],theme:[9,17,21],themedefault:[2,18],thememanag:[2,18],themenam:2,themeperserv:2,themselv:2,therefor:2,thi:[0,1,2,3,4,7,8,12,13,15,16,17,18,19,20,22],thiago:4,thilanka:4,thilina:4,thing:[2,6,15],think:[6,15],third:[2,6,9,11,17,18],thirteen:4,thoma:[4,7],those:[2,12,13,16,17,19],though:[2,7,8,15,17],three:[2,6,17,19],threshold:2,through:[2,7,10,15,16,17,19,20],thu:[6,8,17],thumbnail:14,tickbox:6,tild:6,till:[6,17],time:[1,2,7,15,17,20],timeout:[2,8],timestamp:2,tinyint:6,tip:[2,6],titl:[1,8,9,17],titledatabas:2,titledefault:2,titleserv:2,titlet:2,tkl:6,tmp:2,tobia:[3,4],tobias_at_ratschil:[3,4],togeth:[2,15,17],toggl:[2,6,10],token:[15,20],tokyo:6,told:4,tom:4,toma:4,tomas_at_tomasruud:4,tomastik:4,tommi:4,tommy_at_surbakti:4,ton:2,too:[2,5,6,8],tool:[2,4,5,10,15,17],tooltip:[6,13],top:[2,6,8,16,17],topic:17,toplevel:2,tor:4,total:17,totp:20,town:6,town_cod:6,track:[2,4,10,17],tracker:[2,6,15],tracking_add_drop_databas:2,tracking_add_drop_t:2,tracking_add_drop_view:2,tracking_default_stat:2,tracking_version_auto_cr:2,tradition:17,traefik:17,traffic:2,trail:2,transfer:[2,6,7,17],transform:[4,9,10,11,17,21],transformation_opt:[2,19],transformation_overview:19,transformations_generator_main_class:19,transformations_generator_plugin:19,transformationsplugin:19,transit:17,translat:[2,9],translationwarningthreshold:2,translit:2,transliter:2,transmiss:[7,8],transmit:[6,20],travel:[1,17],treat:[2,6,7],tree:[2,4],trend:1,trezor:20,tri:[2,6,15,17],trick:15,trigger:[2,4,7,8,10],trinh:4,trinhminhbao_at_gmail:4,triwidada:4,troubl:[2,7,8],troubleshoot:6,truli:17,truncat:2,trust:[2,17],trustedproxi:2,tschopp:4,tune:17,tunnel213:4,tunnel213_at_aliyun:4,tupl:7,turck:6,turek:[3,4],turkish:4,turn:[2,6],turnitinbot:6,tutori:[6,19,21],tweak:17,two:[2,7,9,13,17,21],txt:[3,6,17],type:[0,1,2,4,7,8,13,17,19],typeset:[7,8],typic:[2,6,7,9,20],typograph:8,tyron:4,u2f:21,ubuntu:2,ufpdf:4,uid:15,ukko:4,ukrainian:4,ultim:[6,17],unavail:2,uncheck:[2,6],unclean:6,uncom:[2,17],under:[2,3,15,17,18],underli:[1,17,18],undernetangel_at_gmail:4,understand:[10,17],undocu:8,unexpect:[0,2],ungureanu:4,uniform:7,unintend:2,union:[1,6],uniqu:[2,6,7,13],unit:4,unix:17,unix_domain_socket:7,unknown:17,unless:[6,17,20],unlik:17,unlucky_at_inbox:4,unpack:[6,17],unprivileg:2,unset:[6,17],unsign:19,unstuff:17,unsupport:6,untar:17,until:[2,4,6,16,17],unus:6,unwil:6,unzip:17,updat:[2,4,6,17],upgrad:[2,9],upgrade_column_info_4_3_0:[2,17],upgrade_tables_4_7_0:17,upgrade_tables_mysql_4_1_2:17,upload:[8,9,14,17],upload_max_files:6,upload_progress:6,upload_tmp_dir:6,uploaddir:[2,6,8],uploadprogress:6,upon:[1,16],upper:6,upto:6,urbalazs_at_gmail:4,uri:13,url:[2,7,17,18],urlqueryencrypt:2,urlqueryencryptionsecretkei:2,urltrend:6,uro:4,usabl:6,usag:[2,12,21],use:[0,2,4,7,8,10,12,13,15,16,17,18,19,20],use_backend:17,use_cooki:17,used:[0,1,2,4,7,8,13,16,17,18,19,20],usedbsearch:2,useful:[1,2,3,5,7,8,12,17],useless:6,usepackag:[6,8],user:[2,4,7,9,15,16,19,20],user_bas:17,userconfig:2,userdata:15,usergroup:[2,12],userid:6,usernam:[2,10,12,17],userprefsdevelopertab:2,userprefsdisallow:2,userstatu:6,uses:[2,8,17],using:[1,4,7,9,10,11,13,14,15,19,20,21],usr:17,usual:[2,6,7,17,19],utf8mb4_general_ci:2,utf:[2,6,7,17],util:[2,6,7,15,17],vadap:4,vainauska:4,valentin:4,valia:4,valid:[0,2,4,6,8,10,15,16,17],valter:4,valu:[2,7,8,13,17,19],van:4,varchar:2,varfilt:6,variabl:[1,2,19,21],variable1:0,variou:[4,6,8,9,10,17,22],vazquez:4,vector:8,vendor:[2,3,6,22],vendor_config:22,verb:6,verbos:[2,6,17],verfic:2,veri:[6,8,17],verif:[2,6,17],verifi:[2,6,9],verschuer:4,verschuere_at_outlook:4,version:[1,2,3,7,8,9,10,14,18,20,22],version_check:2,versioncheck:2,vertic:[4,7],vetoffic:6,via:[2,12,15,17],victor:4,vidner:4,vietnames:4,view:[2,4,7,8,10,12,21],viktar:4,viliu:4,villanueva:4,vim:[2,17],vinai:4,vincent:4,vinipitta_at_gmail:4,vip_at_krasio:4,vipals_at_gmail:4,virusyoon_at_gmail:4,visibl:[2,17],visit:17,visok:4,visokereyal_at_gmail:4,visual:[2,4,6],visualis:6,vitalii:4,vliet:4,vmta_at_yahoo:4,vonflyne:4,vonflynee_at_gmail:4,voogt:4,voogt_at_hccnet:4,voyag:6,vperekupka_at_gmail:4,vserver:[2,6],vulner:[2,6,9,17],vytauta:4,w3c:[6,7],w3c_valid:6,wai:[0,2,4,8,13,15,16,17,18,20],wait:6,wallet:20,walton:4,walton_at_nordicdm:4,want:[2,8,12,17,18,19,22],warn:[2,17],warranti:3,washington:4,washingtonbruno_at_msn:4,wasn:4,wasser:6,waw:4,weaker:2,web:[4,6,7,8,9,15,17,22],web_brows:7,webadmin:4,webapp:17,webcrawl:6,weblate_at_gmail:4,webmaster_at_trafficg:4,webserv:[2,6,7,8,17],websit:[4,5,6,7,15,18],wei:4,welcom:[2,17],well:[2,4,6,10,15,17],weng:4,wengshiyu_at_gmail:4,wennberg:4,were:[2,4,6],west:4,wget:6,what:[0,2,12,15,17,19],when:[0,2,4,7,8,10,13,14,15,17,20],whenev:[2,6,17],where:[0,2,3,7,8,12,15,17],whether:[2,12,17,22],whh:4,whhlcj_at_126:4,which:[0,1,2,3,7,8,10,11,12,13,14,15,16,17,18,19],whitelist:6,who:[2,4,12,17,19,22],whole:[0,2,6,15,17],whose:[6,17],why:[0,2],wide:[7,8,16,20],width:2,wiegger:4,wigginton:4,wiki:[6,7,8],wikipedia:[7,8,15,17],wildcard:[2,6],wilk:4,wilson:4,win2k:6,win32:17,win98:6,window:[1,2,4,7,9,19,20],winhttp:6,winningham:4,winnt4:6,wisenutbot:6,wish:[0,2,7,8,12,17],withdrawn:4,within:[2,6,12],without:[2,3,17,18,19],witten:4,wizard:[6,17],wkito:6,won:[0,2],word:[2,6,9],wordfenc:6,work:[2,4,13,15,17,19],workaround:[6,17],workbook:8,world:[2,7],worldwideski:4,worldwideskier_at_yahoo:4,wors:6,would:[2,13,15,17,18,19],wrap:2,wrapper:17,writabl:[2,22],write:[2,8],written:[2,5,6,10],wrong:[2,13],wrongli:6,www:[2,3,4,6,7,8,17,18,19],wysiwyg:4,xampp:17,xavier:4,xhtml1:4,xml:[4,7,10,14,17],xosecalvo_at_gmail:4,xs910203_at_gmail:4,xuan:4,xvnavarro_at_gmail:4,xxx:[2,6,19],xxxx:2,xzvf:17,yacybot:6,yahoo:6,yahooseek:6,yan:4,yansilvagabriel_at_gmail:4,yaron:4,yaron_at_gmail:4,yashodha:4,yasir:4,yasitha:4,yavuz:4,yearmad:8,yellow:6,yes:2,yet:[2,8],yetdiffer:2,yizhou:4,yml:17,yogarajah:4,yogeshwar:4,yohan:4,yong:4,yoon:4,you:[0,1,2,3,4,5,6,7,8,10,11,12,13,14,15,16,17,18,19,20,22],youbico:20,youngmin:4,youngminz:4,your:[0,2,6,8,9,10,12,13,14,15,16,18,19],your_db_host:17,your_theme_nam:18,yourpassword:2,yswy_at_hotmail:4,yug:4,yugal:4,yukihiro:4,yuval:4,yyi:2,yyyi:2,zahra:4,zancan:4,zarubin:4,zassenhau:4,zassenhaus_at_jgerman:4,zend:6,zero:[2,8,16],zeroconf:[2,17],zerofil:19,zheng:4,zhyarabdulla94_at_gmail:4,zigmanta:4,zion_at_gmail:4,zip:[2,4,6,7,8,10,14,17],zip_:7,zipdump:2,zlib:[6,7,10],zone:2,zoom:4,zrng:4,zufar:4,zzz:2,zzzz:2},titles:["Bookmarks","Charts","Configuration","Copyright","Credits","Developers Information","FAQ - Frequently Asked Questions","Glossary","Import and export","Welcome to phpMyAdmin\u2019s documentation!","Introduction","Other sources of information","User management","Relations","Requirements","Security policy","Configuring phpMyAdmin","Installation","Custom Themes","Transformations","Two-factor authentication","User Guide","Distributing and packaging phpMyAdmin"],titleterms:{"100":6,"111":6,"17a":6,"2000":8,"2fa":20,"404":6,"500":6,"5b4":6,"\u010deski":11,"\u0440\u0443\u0441\u0441\u043a\u0438\u0439":11,"default":[2,6],"export":[2,6,8],"function":6,"import":[2,6,8],"int":6,"new":[6,12],"null":6,"return":6,"try":6,"while":6,IIS:6,ODS:8,PWS:6,The:6,USE:6,Using:[6,17],With:6,YES:6,abl:6,about:[6,10],access:6,action:6,add:6,addit:6,address:2,adjust:6,after:[6,17],again:6,against:6,alert:6,allow:6,alreadi:6,alwai:6,ani:6,ansi:6,apach:6,applic:[6,20],appropri:6,area:6,arrai:8,ascii:6,ask:6,assign:12,attack:[6,15],auth:6,authent:[2,6,17,20],auto:6,autologin:2,automat:6,back:[6,17],backup:6,bar:[1,6],base:6,basic:2,becaus:6,behavior:6,behind:17,being:6,below:6,big:6,bind:6,blank:6,blob:6,book:11,bookmark:[0,6],box:[2,6],bring:6,brows:[0,2,6,17],browser:[6,14],brute:[6,15],bug:6,bundl:6,can:6,cannot:6,caus:6,central:6,certain:6,cgi:6,chang:6,charact:6,chart:[1,6],checkbox:6,chronolog:4,click:6,clickabl:6,client:6,cloud:2,cluster:6,codegen:8,column:[1,6,8,17],come:6,comment:6,complet:6,compos:17,compress:6,config:17,configur:[2,6,12,16,17,18],connect:[2,6,17],consid:6,consol:2,contain:6,content:6,control:6,cooki:[2,6,17],copi:6,copyright:3,correct:6,could:6,crash:6,creat:[6,12,17,18],credit:4,cross:15,cryptic:6,csrf:15,csv:[6,8],curiou:6,custom:[2,6,17,18],czech:11,data:[6,8],databas:[2,6,12,14,17],db_structur:6,debian:17,decim:6,delet:[6,12],deni:6,deriv:17,design:[2,6,13],determin:6,develop:[2,5,6],differ:6,directli:6,directori:2,disclosur:6,disk:6,displai:[2,6],distribut:[6,17,22],docker:17,document:[4,6,8,9],doe:6,doesn:6,don:6,dot:6,down:6,drop:6,dump:6,duplic:6,each:6,easili:6,edit:[2,6,12],effect:6,employe:6,empti:6,enabl:6,encrypt:6,english:11,enter:6,enterpris:17,environ:17,error:6,errorcod:6,esri:[6,8],evil:6,exampl:[1,2,6,13,17],excel:[6,8],execut:6,exist:[6,12],explor:6,extend:6,extens:6,extern:22,face:6,factor:20,fail:6,faq:6,favorit:6,featur:[6,10],fedora:17,fido:20,field:[2,6],file:[6,8,17,19],fine:6,firefox:6,firstnam:6,fix:6,folder:6,follow:6,font:6,forc:[6,15],foreign:6,forgeri:15,form:6,format:6,formula:6,forward:6,found:6,frequent:6,from:[6,17],full:6,gener:[2,6],gentoo:17,german:6,get:6,git:17,give:6,glossari:7,gone:6,googl:2,group:12,guid:21,gzip:6,happen:6,haproxi:17,hardwar:20,hash:6,hat:17,have:6,header:6,heard:6,help:6,hierarchi:6,homonym:6,host:6,how:6,html:6,http:[6,17],huge:6,hundr:6,hyphen:6,imag:18,implement:1,improv:6,includ:6,increment:6,index:6,indic:9,info:13,inform:[5,6,11],inject:[6,15],innodb:6,input:6,insert:6,insid:0,instal:[6,17],intend:6,intern:6,internet:6,introduct:[10,19],isp:6,issu:[6,15,17],its:6,javascript:6,json:8,just:6,kei:[6,10,20],know:6,known:[6,17],konqueror:6,lang:6,languag:[2,6],larg:6,lastnam:6,latex:[6,8],length:6,let:6,librari:[6,22],licens:3,like:6,limit:[2,6],line:1,linux:17,list:6,load:[6,8],local:6,localhost:6,locat:6,log:[6,17],login:6,lose:6,lost:6,lot:6,lowercas:6,lump:6,mac:6,machin:6,main:2,make:6,manag:[2,12],mandriva:17,mani:6,manner:6,manual:17,mean:6,mediawiki:8,memori:6,menu:12,messag:6,metadata:18,microsoft:[6,8],mime:6,mimetyp:6,mine:6,misbehav:6,miss:6,mod_gzip:6,mode:[2,6,17],modifi:6,more:6,move:6,mozilla:6,multi:6,multipl:[2,6],mysql:[2,6],mysqldump:6,mysqli:6,name:[6,8],nativ:6,navig:[2,6],need:6,nest:6,netscap:6,never:6,newer:6,nick:6,non:6,noth:6,now:6,number:6,older:[6,17],onc:6,one:6,onli:6,onto:6,open:8,open_basedir:6,opendocu:8,opensus:17,oper:6,option:[2,6,8],order:4,origin:4,other:11,out:[6,17],own:6,packag:22,page:[2,6],panel:2,paramet:6,parameter:6,pars:6,parti:3,password:6,path:6,pdf:[2,6,8],php:[6,8,14],phpmyadmin:[6,9,16,17,22],pie:1,plenti:6,pmadb:6,polici:[6,15],port:6,possibl:6,potenti:6,pr1:6,pre:6,prefer:6,prevent:6,primari:6,print:11,privileg:[6,12,17],problem:6,proce:6,procedur:6,process:6,produc:6,progress:6,project:6,protect:6,protocol:6,proxi:6,put:6,queri:[2,6],question:6,quick:17,rang:6,reassign:6,receiv:6,red:17,redirect:6,reduc:6,refresh:6,refus:6,relat:[6,13],relationship:6,releas:17,reload:6,renam:6,report:15,request:[6,15],requir:[6,14],restor:6,restrict:6,result:6,revers:6,right:6,robot:6,root:6,row:6,run:[6,17],russian:11,safari:6,safe:6,sai:6,same:6,save:2,scatter:1,schema:6,script:[6,15,17],scroll:6,search:6,secur:[6,15,17,20],see:6,seem:6,select:6,send:6,sent:6,seri:6,server:[2,6,14,17],set:[2,6],setup:[2,6,17],shape:8,shapefil:6,share:18,shortcut:10,should:6,shown:6,signon:[2,17],simpl:[6,20],simpli:6,singl:6,site:15,size:6,smith:6,sock:6,socket:6,some:6,sometim:6,sourc:11,special:6,specif:[6,12,17],specifi:6,spline:1,spreadsheet:8,sql:[2,6,8,15],sql_mode:6,ssl:[2,17],start:6,statist:6,storag:17,store:[0,6],string:6,structur:[2,6,19],subdirectori:17,suhosin:6,support:[6,10],sure:6,symbol:6,synchron:6,tab:[2,6],tabl:[0,6,8,9],technic:13,texi:8,text:[2,6,8],than:6,thei:6,them:6,theme:[2,6,18],thi:6,third:3,those:6,through:6,time:6,timelin:1,timeout:6,titl:2,tmp:6,togeth:6,tool:6,transform:[2,6,19],translat:[4,6],troubl:[6,17],tutori:11,two:[6,20],type:6,typic:15,u2f:20,ubuntu:17,umlaut:6,unabl:[6,17],undefin:6,under:6,underscor:6,understand:6,unicod:6,unix:6,unknown:6,unsaf:6,upgrad:[6,17],upload:[2,6],url:6,usag:19,use:6,used:6,useful:6,user:[6,10,12,17,21],usernam:6,uses:6,using:[0,2,6,8,17],valu:6,varchar:6,variabl:[0,6,17],variou:2,verifi:17,version:[4,6,17],via:6,view:[6,13],violat:6,volum:17,vulner:15,wai:6,want:6,warn:6,web:[2,14],welcom:[6,9],what:6,when:6,where:6,which:6,whitespac:6,who:6,why:6,win32:6,window:[6,17],withdrawn:6,without:6,won:6,word:[8,10],work:6,would:6,write:6,wrong:6,xitami:6,xml:8,xss:15,yaml:8,your:17,zero:17,zoom:6}}) \ No newline at end of file diff --git a/phpMyAdmin/doc/html/security.html b/phpMyAdmin/doc/html/security.html new file mode 100755 index 0000000..8124e2a --- /dev/null +++ b/phpMyAdmin/doc/html/security.html @@ -0,0 +1,211 @@ + + + + + + + + Security policy — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Security policy露

+

The phpMyAdmin developer team is putting lot of effort to make phpMyAdmin as +secure as possible. But still web application like phpMyAdmin can be vulnerable +to a number of attacks and new ways to exploit are still being explored.

+

For every reported vulnerability we issue a phpMyAdmin Security Announcement +(PMASA) and it get鈥檚 assigne CVE ID as well. We might group similar +vulnerabilities to one PMASA (eg. multiple XSS vulnerabilities can be announced +under one PMASA).

+

If you think you鈥檝e found a vulnerability, please see Reporting security issues.

+
+

Typical vulnerabilities露

+

In this secion, we will describe typical vulnerabilities, which can appear in +our code base. This list is by no means complete, it is intended to show +typical attack surface.

+
+

Cross-site scripting (XSS)露

+

When phpMyAdmin shows a piece of user data, e.g. something inside a user鈥檚 +database, all html special chars have to be escaped. When this escaping is +missing somewhere a malicious user might fill a database with specially crafted +content to trick an other user of that database into executing something. This +could for example be a piece of JavaScript code that would do any number of +nasty things.

+

phpMyAdmin tries to escape all userdata before it is rendered into html for the +browser.

+ +
+
+

Cross-site request forgery (CSRF)露

+

An attacker would trick a phpMyAdmin user into clicking on a link to provoke +some action in phpMyAdmin. This link could either be sent via email or some +random website. If successful this the attacker would be able to perform some +action with the users privileges.

+

To mitigate this phpMyAdmin requires a token to be sent on sensitive requests. +The idea is that an attacker does not poses the currently valid token to +include in the presented link.

+

The token is regenerated for every login, so it鈥檚 generally valid only for +limited time, what makes it harder for attacker to obtain valid one.

+ +
+
+

SQL injection露

+

As the whole purpose of phpMyAdmin is to preform sql queries, this is not our +first concern. SQL injection is sensitive to us though when it concerns the +mysql control connection. This controlconnection can have additional privileges +which the logged in user does not poses. E.g. access the phpMyAdmin configuration storage.

+

User data that is included in (administrative) queries should always be run +through DatabaseInterface::escapeSring().

+ +
+
+

Brute force attack露

+

phpMyAdmin on its own does not rate limit authentication attempts in any way. +This is caused by need to work in stateless environment, where there is no way +to protect against such kind of things.

+

To mitigate this, you can use Captcha or utilize external tools such as +fail2ban, this is more details described in Securing your phpMyAdmin installation.

+ +
+
+
+

Reporting security issues露

+

Should you find a security issue in the phpMyAdmin programming code, please +contact the phpMyAdmin security team in +advance before publishing it. This way we can prepare a fix and release the fix together with your +announcement. You will be also given credit in our security announcement. +You can optionally encrypt your report with PGP key ID +DA68AB39218AB947 with following fingerprint:

+
pub   4096R/DA68AB39218AB947 2016-08-02
+      Key fingerprint = 5BAD 38CF B980 50B9 4BD7  FB5B DA68 AB39 218A B947
+uid                          phpMyAdmin Security Team &lt;security@phpmyadmin.net&gt;
+sub   4096R/5E4176FB497A31F7 2016-08-02
+
+
+

The key can be either obtained from the keyserver or is available in +phpMyAdmin keyring +available on our download server or using Keybase.

+

Should you have suggestion on improving phpMyAdmin to make it more secure, please +report that to our issue tracker. +Existing improvement suggestions can be found by +hardening label.

+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/settings.html b/phpMyAdmin/doc/html/settings.html new file mode 100755 index 0000000..2edf2cc --- /dev/null +++ b/phpMyAdmin/doc/html/settings.html @@ -0,0 +1,121 @@ + + + + + + + + Configuring phpMyAdmin — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Configuring phpMyAdmin露

+

There are many configuration settings that can be used to customize the +interface. Those settings are described in +Configuration. There are several layers of the configuration.

+

The global settings can be configured in config.inc.php as described in +Configuration. This is only way to configure connections to databases and other +system wide settings.

+

On top of this there are user settings which can be persistently stored in +phpMyAdmin configuration storage, possibly automatically configured through +Zero configuration. If the phpMyAdmin configuration storage are not configured, the settings +are temporarily stored in the session data; these are valid only until you +logout.

+

You can also save the user configuration for further use, either download them +as a file or to the browser local storage. You can find both those options in +the Settings tab. The settings stored in browser local storage will +be automatically offered for loading upon your login to phpMyAdmin.

+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/setup.html b/phpMyAdmin/doc/html/setup.html new file mode 100755 index 0000000..f20fef6 --- /dev/null +++ b/phpMyAdmin/doc/html/setup.html @@ -0,0 +1,1420 @@ + + + + + + + + Installation — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Installation露

+

phpMyAdmin does not apply any special security methods to the MySQL +database server. It is still the system administrator鈥檚 job to grant +permissions on the MySQL databases properly. phpMyAdmin鈥檚 Users +page can be used for this.

+
+

Warning

+

Mac users should note that if you are on a version before +Mac OS X, StuffIt unstuffs with Mac formats. So you鈥檒l have +to resave as in BBEdit to Unix style ALL phpMyAdmin scripts before +uploading them to your server, as PHP seems not to like Mac-style +end of lines character (鈥�\r鈥�).

+
+
+

Linux distributions露

+

phpMyAdmin is included in most Linux distributions. It is recommended to use +distribution packages when possible - they usually provide integration to your +distribution and you will automatically get security updates from your distribution.

+
+

Debian and Ubuntu露

+

Debian鈥檚 package repositories include a phpMyAdmin package, but be aware that +the configuration file is maintained in /etc/phpmyadmin and may differ in +some ways from the official phpMyAdmin documentation. Specifically, it does:

+ +
+

See also

+

More information can be found in README.Debian +(it is installed as /usr/share/doc/phmyadmin/README.Debian with the package).

+
+
+
+

OpenSUSE露

+

OpenSUSE already comes with phpMyAdmin package, just install packages from +the openSUSE Build Service.

+
+
+

Gentoo露

+

Gentoo ships the phpMyAdmin package, both in a near-stock configuration as well +as in a webapp-config configuration. Use emerge dev-db/phpmyadmin to +install.

+
+
+

Mandriva露

+

Mandriva ships the phpMyAdmin package in their contrib branch and can be +installed via the usual Control Center.

+
+
+

Fedora露

+

Fedora ships the phpMyAdmin package, but be aware that the configuration file +is maintained in /etc/phpMyAdmin/ and may differ in some ways from the +official phpMyAdmin documentation.

+
+
+

Red Hat Enterprise Linux露

+

Red Hat Enterprise Linux itself and thus derivatives like CentOS don鈥檛 +ship phpMyAdmin, but the Fedora-driven repository +Extra Packages for Enterprise Linux (EPEL) +is doing so, if it鈥檚 +enabled. +But be aware that the configuration file is maintained in +/etc/phpMyAdmin/ and may differ in some ways from the +official phpMyAdmin documentation.

+
+
+
+

Installing on Windows露

+

The easiest way to get phpMyAdmin on Windows is using third party products +which include phpMyAdmin together with a database and web server such as +XAMPP.

+

You can find more of such options at Wikipedia.

+
+
+

Installing from Git露

+

You can clone current phpMyAdmin source from +https://github.com/phpmyadmin/phpmyadmin.git:

+
git clone https://github.com/phpmyadmin/phpmyadmin.git
+
+
+

Additionally you need to install dependencies using the Composer tool:

+
composer update
+
+
+

If you do not intend to develop, you can skip the installation of developer tools +by invoking:

+
composer update --no-dev
+
+
+
+
+

Installing using Composer露

+

You can install phpMyAdmin using the Composer tool, since 4.7.0 the releases +are automatically mirrored to the default Packagist repository.

+
+

Note

+

The content of the Composer repository is automatically generated +separately from the releases, so the content doesn鈥檛 have to be +100% same as when you download the tarball. There should be no +functional differences though.

+
+

To install phpMyAdmin simply run:

+
composer create-project phpmyadmin/phpmyadmin
+
+
+

Alternatively you can use our own composer repository, which contains +the release tarballs and is available at +<https://www.phpmyadmin.net/packages.json>:

+
composer create-project phpmyadmin/phpmyadmin --repository-url=https://www.phpmyadmin.net/packages.json --no-dev
+
+
+
+
+

Installing using Docker露

+

phpMyAdmin comes with a Docker image, which you can easily deploy. You can +download it using:

+
docker pull phpmyadmin/phpmyadmin
+
+
+

The phpMyAdmin server will listen on port 80. It supports several ways of +configuring the link to the database server, either by Docker鈥檚 link feature +by linking your database container to db for phpMyAdmin (by specifying +--link your_db_host:db) or by environment variables (in this case it鈥檚 up +to you to set up networking in Docker to allow the phpMyAdmin container to access +the database container over the network).

+
+

Docker environment variables露

+

You can configure several phpMyAdmin features using environment variables:

+
+
+PMA_ARBITRARY露
+

Allows you to enter a database server hostname on login form.

+ +
+ +
+
+PMA_HOST露
+

Hostname or IP address of the database server to use.

+ +
+ +
+
+PMA_HOSTS露
+

Comma-separated hostnames or IP addresses of the database servers to use.

+
+

Note

+

Used only if PMA_HOST is empty.

+
+
+ +
+
+PMA_VERBOSE露
+

Verbose name of the database server.

+ +
+ +
+
+PMA_VERBOSES露
+

Comma-separated verbose name of the database servers.

+
+

Note

+

Used only if PMA_VERBOSE is empty.

+
+
+ +
+
+PMA_USER露
+

User name to use for Config authentication mode.

+
+ +
+
+PMA_PASSWORD露
+

Password to use for Config authentication mode.

+
+ +
+
+PMA_PORT露
+

Port of the database server to use.

+
+ +
+
+PMA_PORTS露
+

Comma-separated ports of the database server to use.

+
+

Note

+

Used only if PMA_PORT is empty.

+
+
+ +
+
+PMA_ABSOLUTE_URI露
+

The fully-qualified path (https://pma.example.net/) where the reverse +proxy makes phpMyAdmin available.

+ +
+ +

By default, Cookie authentication mode is used, but if PMA_USER and +PMA_PASSWORD are set, it is switched to Config authentication mode.

+
+

Note

+

The credentials you need to log in are stored in the MySQL server, in case +of Docker image, there are various ways to set it (for example +MYSQL_ROOT_PASSWORD when starting the MySQL container). Please check +documentation for MariaDB container +or MySQL container.

+
+
+
+

Customizing configuration露

+

Additionally configuration can be tweaked by /etc/phpmyadmin/config.user.inc.php. If +this file exists, it will be loaded after configuration is generated from above +environment variables, so you can override any configuration variable. This +configuration can be added as a volume when invoking docker using +-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php parameters.

+

Note that the supplied configuration file is applied after Docker environment variables, +but you can override any of the values.

+

For example to change the default behavior of CSV export you can use the following +configuration file:

+
<?php
+$cfg['Export']['csv_columns'] = true;
+?>
+
+
+

You can also use it to define server configuration instead of using the +environment variables listed in Docker environment variables:

+
<?php
+/* Override Servers array */
+$cfg['Servers'] = [
+    1 => [
+        'auth_type' => 'cookie',
+        'host' => 'mydb1',
+        'port' => 3306,
+        'verbose' => 'Verbose name 1',
+    ],
+    2 => [
+        'auth_type' => 'cookie',
+        'host' => 'mydb2',
+        'port' => 3306,
+        'verbose' => 'Verbose name 2',
+    ],
+];
+
+
+
+

See also

+

See Configuration for detailed description of configuration options.

+
+
+
+

Docker Volumes露

+

You can use the following volumes to customize image behavior:

+

/etc/phpmyadmin/config.user.inc.php

+
+

Can be used for additional settings, see the previous chapter for more details.

+
+

/sessions/

+
+

Directory where PHP sessions are stored. You might want to share this +for example when using Signon authentication mode.

+
+

/www/themes/

+
+

Directory where phpMyAdmin looks for themes. By default only those shipped +with phpMyAdmin are included, but you can include additional phpMyAdmin +themes (see Custom Themes) by using Docker volumes.

+
+
+
+

Docker Examples露

+

To connect phpMyAdmin to a given server use:

+
docker run --name myadmin -d -e PMA_HOST=dbhost -p 8080:80 phpmyadmin/phpmyadmin
+
+
+

To connect phpMyAdmin to more servers use:

+
docker run --name myadmin -d -e PMA_HOSTS=dbhost1,dbhost2,dbhost3 -p 8080:80 phpmyadmin/phpmyadmin
+
+
+

To use arbitrary server option:

+
docker run --name myadmin -d --link mysql_db_server:db -p 8080:80 -e PMA_ARBITRARY=1 phpmyadmin/phpmyadmin
+
+
+

You can also link the database container using Docker:

+
docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 phpmyadmin/phpmyadmin
+
+
+

Running with additional configuration:

+
docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin/phpmyadmin
+
+
+

Running with additional themes:

+
docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /custom/phpmyadmin/theme/:/www/themes/theme/ phpmyadmin/phpmyadmin
+
+
+
+
+

Using docker-compose露

+

Alternatively, you can also use docker-compose with the docker-compose.yml from +<https://github.com/phpmyadmin/docker>. This will run phpMyAdmin with an +arbitrary server - allowing you to specify MySQL/MariaDB server on the login page.

+
docker-compose up -d
+
+
+
+
+

Customizing configuration file using docker-compose露

+

You can use an external file to customize phpMyAdmin configuration and pass it +using the volumes directive:

+
phpmyadmin:
+    image: phpmyadmin/phpmyadmin
+    container_name: phpmyadmin
+    environment:
+     - PMA_ARBITRARY=1
+    restart: always
+    ports:
+     - 8080:80
+    volumes:
+     - /sessions
+     - ~/docker/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php
+     - /custom/phpmyadmin/theme/:/www/themes/theme/
+
+
+ +
+
+

Running behind haproxy in a subdirectory露

+

When you want to expose phpMyAdmin running in a Docker container in a +subdirectory, you need to rewrite the request path in the server proxying the +requests.

+

For example, using haproxy it can be done as:

+
frontend http
+    bind *:80
+    option forwardfor
+    option http-server-close
+
+    ### NETWORK restriction
+    acl LOCALNET  src 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12
+
+    # /phpmyadmin
+    acl phpmyadmin  path_dir /phpmyadmin
+    use_backend phpmyadmin if phpmyadmin LOCALNET
+
+backend phpmyadmin
+    mode http
+
+    reqirep  ^(GET|POST|HEAD)\ /phpmyadmin/(.*)     \1\ /\2
+
+    # phpMyAdmin container IP
+    server localhost     172.30.21.21:80
+
+
+

When using traefik, something like following should work:

+
defaultEntryPoints = ["http"]
+[entryPoints]
+  [entryPoints.http]
+  address = ":80"
+    [entryPoints.http.redirect]
+      regex = "(http:\\/\\/[^\\/]+\\/([^\\?\\.]+)[^\\/])$"
+      replacement = "$1/"
+
+[backends]
+  [backends.myadmin]
+    [backends.myadmin.servers.myadmin]
+    url="http://internal.address.to.pma"
+
+[frontends]
+   [frontends.myadmin]
+   backend = "myadmin"
+   passHostHeader = true
+     [frontends.myadmin.routes.default]
+     rule="PathPrefixStrip:/phpmyadmin/;AddPrefix:/"
+
+
+

You then should specify PMA_ABSOLUTE_URI in the docker-compose +configuration:

+
version: '2'
+
+services:
+  phpmyadmin:
+    restart: always
+    image: phpmyadmin/phpmyadmin
+    container_name: phpmyadmin
+    hostname: phpmyadmin
+    domainname: example.com
+    ports:
+      - 8000:80
+    environment:
+      - PMA_HOSTS=172.26.36.7,172.26.36.8,172.26.36.9,172.26.36.10
+      - PMA_VERBOSES=production-db1,production-db2,dev-db1,dev-db2
+      - PMA_USER=root
+      - PMA_PASSWORD=
+      - PMA_ABSOLUTE_URI=http://example.com/phpmyadmin/
+
+
+
+
+
+

Quick Install露

+
    +
  1. Choose an appropriate distribution kit from the phpmyadmin.net +Downloads page. Some kits contain only the English messages, others +contain all languages. We鈥檒l assume you chose a kit whose name +looks like phpMyAdmin-x.x.x -all-languages.tar.gz.

  2. +
  3. Ensure you have downloaded a genuine archive, see Verifying phpMyAdmin releases.

  4. +
  5. Untar or unzip the distribution (be sure to unzip the subdirectories): +tar -xzvf phpMyAdmin_x.x.x-all-languages.tar.gz in your +webserver鈥檚 document root. If you don鈥檛 have direct access to your +document root, put the files in a directory on your local machine, +and, after step 4, transfer the directory on your web server using, +for example, ftp.

  6. +
  7. Ensure that all the scripts have the appropriate owner (if PHP is +running in safe mode, having some scripts with an owner different from +the owner of other scripts will be a problem). See 4.2 What鈥檚 the preferred way of making phpMyAdmin secure against evil access? and +1.26 I just installed phpMyAdmin in my document root of IIS but I get the error 鈥淣o input file specified鈥� when trying to run phpMyAdmin. for suggestions.

  8. +
  9. Now you must configure your installation. There are two methods that +can be used. Traditionally, users have hand-edited a copy of +config.inc.php, but now a wizard-style setup script is provided +for those who prefer a graphical installation. Creating a +config.inc.php is still a quick way to get started and needed for +some advanced features.

  10. +
+
+

Manually creating the file露

+

To manually create the file, simply use your text editor to create the +file config.inc.php (you can copy config.sample.inc.php to get +a minimal configuration file) in the main (top-level) phpMyAdmin +directory (the one that contains index.php). phpMyAdmin first +loads libraries/config.default.php and then overrides those values +with anything found in config.inc.php. If the default value is +okay for a particular setting, there is no need to include it in +config.inc.php. You鈥檒l probably need only a few directives to get going; a +simple configuration may look like this:

+
<?php
+// use here a value of your choice at least 32 chars long
+$cfg['blowfish_secret'] = '1{dd0`<Q),5XP_:R9UK%%8\"EEcyH#{o';
+
+$i=0;
+$i++;
+$cfg['Servers'][$i]['auth_type']     = 'cookie';
+// if you insist on "root" having no password:
+// $cfg['Servers'][$i]['AllowNoPassword'] = true; `
+?>
+
+
+

Or, if you prefer to not be prompted every time you log in:

+
<?php
+
+$i=0;
+$i++;
+$cfg['Servers'][$i]['user']          = 'root';
+$cfg['Servers'][$i]['password']      = 'cbb74bc'; // use here your password
+$cfg['Servers'][$i]['auth_type']     = 'config';
+?>
+
+
+
+

Warning

+

Storing passwords in the configuration is insecure as anybody can then +manipulate your database.

+
+

For a full explanation of possible configuration values, see the +Configuration of this document.

+
+
+

Using the Setup script露

+

Instead of manually editing config.inc.php, you can use phpMyAdmin鈥檚 +setup feature. The file can be generated using the setup and you can download it +for upload to the server.

+

Next, open your browser and visit the location where you installed phpMyAdmin, +with the /setup suffix. The changes are not saved to the server, you need to +use the Download button to save them to your computer and then upload +to the server.

+

Now the file is ready to be used. You can choose to review or edit the +file with your favorite editor, if you prefer to set some advanced +options that the setup script does not provide.

+
    +
  1. If you are using the auth_type 鈥渃onfig鈥�, it is suggested that you +protect the phpMyAdmin installation directory because using config +does not require a user to enter a password to access the phpMyAdmin +installation. Use of an alternate authentication method is +recommended, for example with HTTP鈥揂UTH in a .htaccess file or switch to using +auth_type cookie or http. See the ISPs, multi-user installations +for additional information, especially 4.4 phpMyAdmin always gives 鈥淎ccess denied鈥� when using HTTP authentication..

  2. +
  3. Open the main phpMyAdmin directory in your browser. +phpMyAdmin should now display a welcome screen and your databases, or +a login dialog if using HTTP or +cookie authentication mode.

  4. +
+
+

Setup script on Debian, Ubuntu and derivatives露

+

Debian and Ubuntu have changed the way in which the setup script is enabled and disabled, in a way +that single command has to be executed for either of these.

+

To allow editing configuration invoke:

+
/usr/sbin/pma-configure
+
+
+

To block editing configuration invoke:

+
/usr/sbin/pma-secure
+
+
+
+
+

Setup script on openSUSE露

+

Some openSUSE releases do not include setup script in the package. In case you +want to generate configuration on these you can either download original +package from <https://www.phpmyadmin.net/> or use setup script on our demo +server: <https://demo.phpmyadmin.net/master/setup/>.

+
+
+
+
+

Verifying phpMyAdmin releases露

+

Since July 2015 all phpMyAdmin releases are cryptographically signed by the +releasing developer, who through January 2016 was Marc Delisle. His key id is +0xFEFC65D181AF644A, his PGP fingerprint is:

+
436F F188 4B1A 0C3F DCBF 0D79 FEFC 65D1 81AF 644A
+
+
+

and you can get more identification information from <https://keybase.io/lem9>.

+

Beginning in January 2016, the release manager is Isaac Bennetch. His key id is +0xCE752F178259BD92, and his PGP fingerprint is:

+
3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92
+
+
+

and you can get more identification information from <https://keybase.io/ibennetch>.

+

Some additional downloads (for example themes) might be signed by Michal 膶iha艡. His key id is +0x9C27B31342B7511D, and his PGP fingerprint is:

+
63CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D
+
+
+

and you can get more identification information from <https://keybase.io/nijel>.

+

You should verify that the signature matches the archive you have downloaded. +This way you can be sure that you are using the same code that was released. +You should also verify the date of the signature to make sure that you +downloaded the latest version.

+

Each archive is accompanied by .asc files which contain the PGP signature +for it. Once you have both of them in the same folder, you can verify the signature:

+
$ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
+gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92
+gpg: Can't check signature: public key not found
+
+
+

As you can see gpg complains that it does not know the public key. At this +point, you should do one of the following steps:

+ +
$ gpg --import phpmyadmin.keyring
+
+
+
    +
  • Download and import the key from one of the key servers:

  • +
+
$ gpg --keyserver hkp://pgp.mit.edu --recv-keys 3D06A59ECE730EB71B511C17CE752F178259BD92
+gpg: requesting key 8259BD92 from hkp server pgp.mit.edu
+gpg: key 8259BD92: public key "Isaac Bennetch <bennetch@gmail.com>" imported
+gpg: no ultimately trusted keys found
+gpg: Total number processed: 1
+gpg:               imported: 1  (RSA: 1)
+
+
+

This will improve the situation a bit - at this point, you can verify that the +signature from the given key is correct but you still can not trust the name used +in the key:

+
$ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
+gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92
+gpg: Good signature from "Isaac Bennetch <bennetch@gmail.com>"
+gpg:                 aka "Isaac Bennetch <isaac@bennetch.org>"
+gpg: WARNING: This key is not certified with a trusted signature!
+gpg:          There is no indication that the signature belongs to the owner.
+Primary key fingerprint: 3D06 A59E CE73 0EB7 1B51  1C17 CE75 2F17 8259 BD92
+
+
+

The problem here is that anybody could issue the key with this name. You need to +ensure that the key is actually owned by the mentioned person. The GNU Privacy +Handbook covers this topic in the chapter Validating other keys on your public +keyring. The most reliable method is to meet the developer in person and +exchange key fingerprints, however, you can also rely on the web of trust. This way +you can trust the key transitively though signatures of others, who have met +the developer in person. For example, you can see how Isaac鈥檚 key links to +Linus鈥檚 key.

+

Once the key is trusted, the warning will not occur:

+
$ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
+gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92
+gpg: Good signature from "Isaac Bennetch <bennetch@gmail.com>" [full]
+
+
+

Should the signature be invalid (the archive has been changed), you would get a +clear error regardless of the fact that the key is trusted or not:

+
$ gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
+gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92
+gpg: BAD signature from "Isaac Bennetch <bennetch@gmail.com>" [unknown]
+
+
+
+
+

phpMyAdmin configuration storage露

+
+

Changed in version 3.4.0: Prior to phpMyAdmin 3.4.0 this was called Linked Tables Infrastructure, but +the name was changed due to the extended scope of the storage.

+
+

For a whole set of additional features (Bookmarks, comments, SQL-history, +tracking mechanism, PDF-generation, Transformations, Relations +etc.) you need to create a set of special tables. Those tables can be located +in your own database, or in a central database for a multi-user installation +(this database would then be accessed by the controluser, so no other user +should have rights to it).

+
+

Zero configuration露

+

In many cases, this database structure can be automatically created and +configured. This is called 鈥淶ero Configuration鈥� mode and can be particularly +useful in shared hosting situations. 鈥淶eroconf鈥� mode is on by default, to +disable set $cfg['ZeroConf'] to false.

+

The following three scenarios are covered by the Zero Configuration mode:

+
    +
  • When entering a database where the configuration storage tables are not +present, phpMyAdmin offers to create them from the Operations tab.

  • +
  • When entering a database where the tables do already exist, the software +automatically detects this and begins using them. This is the most common +situation; after the tables are initially created automatically they are +continually used without disturbing the user; this is also most useful on +shared hosting where the user is not able to edit config.inc.php and +usually the user only has access to one database.

  • +
  • When having access to multiple databases, if the user first enters the +database containing the configuration storage tables then switches to +another database, +phpMyAdmin continues to use the tables from the first database; the user is +not prompted to create more tables in the new database.

  • +
+
+
+

Manual configuration露

+

Please look at your ./sql/ directory, where you should find a +file called create_tables.sql. (If you are using a Windows server, +pay special attention to 1.23 I鈥檓 running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase!).

+

If you already had this infrastructure and:

+
    +
  • upgraded to MySQL 4.1.2 or newer, please use +sql/upgrade_tables_mysql_4_1_2+.sql.

  • +
  • upgraded to phpMyAdmin 4.3.0 or newer from 2.5.0 or newer (<= 4.2.x), +please use sql/upgrade_column_info_4_3_0+.sql.

  • +
  • upgraded to phpMyAdmin 4.7.0 or newer from 4.3.0 or newer, +please use sql/upgrade_tables_4_7_0+.sql.

  • +
+

and then create new tables by importing sql/create_tables.sql.

+

You can use your phpMyAdmin to create the tables for you. Please be +aware that you may need special (administrator) privileges to create +the database and tables, and that the script may need some tuning, +depending on the database name.

+

After having imported the sql/create_tables.sql file, you +should specify the table names in your config.inc.php file. The +directives used for that can be found in the Configuration.

+

You will also need to have a controluser +($cfg['Servers'][$i]['controluser'] and +$cfg['Servers'][$i]['controlpass'] settings) +with the proper rights to those tables. For example you can create it +using following statement:

+
GRANT SELECT, INSERT, UPDATE, DELETE ON <pma_db>.* TO 'pma'@'localhost'  IDENTIFIED BY 'pmapass';
+
+
+
+
+
+

Upgrading from an older version露

+
+

Warning

+

Never extract the new version over an existing installation of +phpMyAdmin, always first remove the old files keeping just the +configuration.

+

This way, you will not leave any old or outdated files in the directory, +which can have severe security implications or can cause various breakages.

+
+

Simply copy config.inc.php from your previous installation into +the newly unpacked one. Configuration files from old versions may +require some tweaking as some options have been changed or removed. +For compatibility with PHP 5.3 and later, remove a +set_magic_quotes_runtime(0); statement that you might find near +the end of your configuration file.

+

You should not copy libraries/config.default.php over +config.inc.php because the default configuration file is version- +specific.

+

The complete upgrade can be performed in a few simple steps:

+
    +
  1. Download the latest phpMyAdmin version from <https://www.phpmyadmin.net/downloads/>.

  2. +
  3. Rename existing phpMyAdmin folder (for example to phpmyadmin-old).

  4. +
  5. Unpack freshly downloaded phpMyAdmin to the desired location (for example phpmyadmin).

  6. +
  7. Copy config.inc.php` from old location (phpmyadmin-old) to the new one (phpmyadmin).

  8. +
  9. Test that everything works properly.

  10. +
  11. Remove backup of a previous version (phpmyadmin-old).

  12. +
+

If you have upgraded your MySQL server from a version previous to 4.1.2 to +version 5.x or newer and if you use the phpMyAdmin configuration storage, you +should run the SQL script found in +sql/upgrade_tables_mysql_4_1_2+.sql.

+

If you have upgraded your phpMyAdmin to 4.3.0 or newer from 2.5.0 or +newer (<= 4.2.x) and if you use the phpMyAdmin configuration storage, you +should run the SQL script found in +sql/upgrade_column_info_4_3_0+.sql.

+

Do not forget to clear the browser cache and to empty the old session by +logging out and logging in again.

+
+
+

Using authentication modes露

+

HTTP and cookie authentication modes are recommended in a multi-user +environment where you want to give users access to their own database and +don鈥檛 want them to play around with others. Nevertheless, be aware that MS +Internet Explorer seems to be really buggy about cookies, at least till version +6. Even in a single-user environment, you might prefer to use HTTP +or cookie mode so that your user/password pair are not in clear in the +configuration file.

+

HTTP and cookie authentication +modes are more secure: the MySQL login information does not need to be +set in the phpMyAdmin configuration file (except possibly for the +$cfg['Servers'][$i]['controluser']). +However, keep in mind that the password travels in plain text unless +you are using the HTTPS protocol. In cookie mode, the password is +stored, encrypted with the AES algorithm, in a temporary cookie.

+

Then each of the true users should be granted a set of privileges +on a set of particular databases. Normally you shouldn鈥檛 give global +privileges to an ordinary user unless you understand the impact of those +privileges (for example, you are creating a superuser). +For example, to grant the user real_user with all privileges on +the database user_base:

+
GRANT ALL PRIVILEGES ON user_base.* TO 'real_user'@localhost IDENTIFIED BY 'real_password';
+
+
+

What the user may now do is controlled entirely by the MySQL user management +system. With HTTP or cookie authentication mode, you don鈥檛 need to fill the +user/password fields inside the $cfg['Servers'].

+ +
+

HTTP authentication mode露

+ +
+

Note

+

There is no way to do proper logout in HTTP authentication, most browsers +will remember credentials until there is no different successful +authentication. Because of this, this method has a limitation that you can not +login with the same user after logout.

+
+
+ +
+

Signon authentication mode露

+ +

The very basic example of saving credentials in a session is available as +examples/signon.php:

+
<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Single signon for phpMyAdmin
+ *
+ * This is just example how to use session based single signon with
+ * phpMyAdmin, it is not intended to be perfect code and look, only
+ * shows how you can integrate this functionality in your application.
+ *
+ * @package    PhpMyAdmin
+ * @subpackage Example
+ */
+
+/* Use cookies for session */
+ini_set('session.use_cookies', 'true');
+/* Change this to true if using phpMyAdmin over https */
+$secure_cookie = false;
+/* Need to have cookie visible from parent directory */
+session_set_cookie_params(0, '/', '', $secure_cookie, true);
+/* Create signon session */
+$session_name = 'SignonSession';
+session_name($session_name);
+// Uncomment and change the following line to match your $cfg['SessionSavePath']
+//session_save_path('/foobar');
+@session_start();
+
+/* Was data posted? */
+if (isset($_POST['user'])) {
+    /* Store there credentials */
+    $_SESSION['PMA_single_signon_user'] = $_POST['user'];
+    $_SESSION['PMA_single_signon_password'] = $_POST['password'];
+    $_SESSION['PMA_single_signon_host'] = $_POST['host'];
+    $_SESSION['PMA_single_signon_port'] = $_POST['port'];
+    /* Update another field of server configuration */
+    $_SESSION['PMA_single_signon_cfgupdate'] = array('verbose' => 'Signon test');
+    $id = session_id();
+    /* Close that session */
+    @session_write_close();
+    /* Redirect to phpMyAdmin (should use absolute URL here!) */
+    header('Location: ../index.php');
+} else {
+    /* Show simple form */
+    header('Content-Type: text/html; charset=utf-8');
+    echo '<?xml version="1.0" encoding="utf-8"?>' , "\n";
+    ?>
+    <!DOCTYPE HTML>
+    <html lang="en" dir="ltr">
+    <head>
+    <link rel="icon" href="../favicon.ico" type="image/x-icon" />
+    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
+    <meta charset="utf-8" />
+    <title>phpMyAdmin single signon example</title>
+    </head>
+    <body>
+    <?php
+    if (isset($_SESSION['PMA_single_signon_error_message'])) {
+        echo '<p class="error">';
+        echo $_SESSION['PMA_single_signon_error_message'];
+        echo '</p>';
+    }
+    ?>
+    <form action="signon.php" method="post">
+    Username: <input type="text" name="user" /><br />
+    Password: <input type="password" name="password" /><br />
+    Host: (will use the one from config.inc.php by default)
+    <input type="text" name="host" /><br />
+    Port: (will use the one from config.inc.php by default)
+    <input type="text" name="port" /><br />
+    <input type="submit" />
+    </form>
+    </body>
+    </html>
+    <?php
+}
+?>
+
+
+

Alternatively, you can also use this way to integrate with OpenID as shown +in examples/openid.php:

+
<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Single signon for phpMyAdmin using OpenID
+ *
+ * This is just example how to use single signon with phpMyAdmin, it is
+ * not intended to be perfect code and look, only shows how you can
+ * integrate this functionality in your application.
+ *
+ * It uses OpenID pear package, see https://pear.php.net/package/OpenID
+ *
+ * User first authenticates using OpenID and based on content of $AUTH_MAP
+ * the login information is passed to phpMyAdmin in session data.
+ *
+ * @package    PhpMyAdmin
+ * @subpackage Example
+ */
+
+if (false === @include_once 'OpenID/RelyingParty.php') {
+    exit;
+}
+
+/* Change this to true if using phpMyAdmin over https */
+$secure_cookie = false;
+
+/**
+ * Map of authenticated users to MySQL user/password pairs.
+ */
+$AUTH_MAP = array(
+    'https://launchpad.net/~username' => array(
+        'user' => 'root',
+        'password' => '',
+        ),
+    );
+
+/**
+ * Simple function to show HTML page with given content.
+ *
+ * @param string $contents Content to include in page
+ *
+ * @return void
+ */
+function Show_page($contents)
+{
+    header('Content-Type: text/html; charset=utf-8');
+    echo '<?xml version="1.0" encoding="utf-8"?>' , "\n";
+    ?>
+    <!DOCTYPE HTML>
+    <html lang="en" dir="ltr">
+    <head>
+    <link rel="icon" href="../favicon.ico" type="image/x-icon" />
+    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
+    <meta charset="utf-8" />
+    <title>phpMyAdmin OpenID signon example</title>
+    </head>
+    <body>
+    <?php
+    if (isset($_SESSION) && isset($_SESSION['PMA_single_signon_error_message'])) {
+        echo '<p class="error">' , $_SESSION['PMA_single_signon_message'] , '</p>';
+        unset($_SESSION['PMA_single_signon_message']);
+    }
+    echo $contents;
+    ?>
+    </body>
+    </html>
+    <?php
+}
+
+/**
+ * Display error and exit
+ *
+ * @param Exception $e Exception object
+ *
+ * @return void
+ */
+function Die_error($e)
+{
+    $contents = "<div class='relyingparty_results'>\n";
+    $contents .= "<pre>" . htmlspecialchars($e->getMessage()) . "</pre>\n";
+    $contents .= "</div class='relyingparty_results'>";
+    Show_page($contents);
+    exit;
+}
+
+
+/* Need to have cookie visible from parent directory */
+session_set_cookie_params(0, '/', '', $secure_cookie, true);
+/* Create signon session */
+$session_name = 'SignonSession';
+session_name($session_name);
+@session_start();
+
+// Determine realm and return_to
+$base = 'http';
+if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
+    $base .= 's';
+}
+$base .= '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'];
+
+$realm = $base . '/';
+$returnTo = $base . dirname($_SERVER['PHP_SELF']);
+if ($returnTo[strlen($returnTo) - 1] != '/') {
+    $returnTo .= '/';
+}
+$returnTo .= 'openid.php';
+
+/* Display form */
+if (!count($_GET) && !count($_POST) || isset($_GET['phpMyAdmin'])) {
+    /* Show simple form */
+    $content = '<form action="openid.php" method="post">
+OpenID: <input type="text" name="identifier" /><br />
+<input type="submit" name="start" />
+</form>
+</body>
+</html>';
+    Show_page($content);
+    exit;
+}
+
+/* Grab identifier */
+if (isset($_POST['identifier']) && is_string($_POST['identifier'])) {
+    $identifier = $_POST['identifier'];
+} elseif (isset($_SESSION['identifier']) && is_string($_SESSION['identifier'])) {
+    $identifier = $_SESSION['identifier'];
+} else {
+    $identifier = null;
+}
+
+/* Create OpenID object */
+try {
+    $o = new OpenID_RelyingParty($returnTo, $realm, $identifier);
+} catch (Exception $e) {
+    Die_error($e);
+}
+
+/* Redirect to OpenID provider */
+if (isset($_POST['start'])) {
+    try {
+        $authRequest = $o->prepare();
+    } catch (Exception $e) {
+        Die_error($e);
+    }
+
+    $url = $authRequest->getAuthorizeURL();
+
+    header("Location: $url");
+    exit;
+} else {
+    /* Grab query string */
+    if (!count($_POST)) {
+        list(, $queryString) = explode('?', $_SERVER['REQUEST_URI']);
+    } else {
+        // I hate php sometimes
+        $queryString = file_get_contents('php://input');
+    }
+
+    /* Check reply */
+    try {
+        $message = new OpenID_Message($queryString, OpenID_Message::FORMAT_HTTP);
+    } catch (Exception $e) {
+        Die_error($e);
+    }
+
+    $id = $message->get('openid.claimed_id');
+
+    if (!empty($id) && isset($AUTH_MAP[$id])) {
+        $_SESSION['PMA_single_signon_user'] = $AUTH_MAP[$id]['user'];
+        $_SESSION['PMA_single_signon_password'] = $AUTH_MAP[$id]['password'];
+        session_write_close();
+        /* Redirect to phpMyAdmin (should use absolute URL here!) */
+        header('Location: ../index.php');
+    } else {
+        Show_page('<p>User not allowed!</p>');
+        exit;
+    }
+}
+
+
+

If you intend to pass the credentials using some other means than, you have to +implement wrapper in PHP to get that data and set it to +$cfg['Servers'][$i]['SignonScript']. There is a very minimal example +in examples/signon-script.php:

+
<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ * Single signon for phpMyAdmin
+ *
+ * This is just example how to use script based single signon with
+ * phpMyAdmin, it is not intended to be perfect code and look, only
+ * shows how you can integrate this functionality in your application.
+ *
+ * @package    PhpMyAdmin
+ * @subpackage Example
+ */
+
+
+/**
+ * This function returns username and password.
+ *
+ * It can optionally use configured username as parameter.
+ *
+ * @param string $user User name
+ *
+ * @return array
+ */
+function get_login_credentials($user)
+{
+    /* Optionally we can use passed username */
+    if (!empty($user)) {
+        return array($user, 'password');
+    }
+
+    /* Here we would retrieve the credentials */
+    $credentials = array('root', '');
+
+    return $credentials;
+}
+
+
+ +
+
+

Config authentication mode露

+
    +
  • This mode is sometimes the less secure one because it requires you to fill the +$cfg['Servers'][$i]['user'] and +$cfg['Servers'][$i]['password'] +fields (and as a result, anyone who can read your config.inc.php +can discover your username and password).

  • +
  • In the ISPs, multi-user installations section, there is an entry explaining how +to protect your configuration file.

  • +
  • For additional security in this mode, you may wish to consider the +Host authentication $cfg['Servers'][$i]['AllowDeny']['order'] +and $cfg['Servers'][$i]['AllowDeny']['rules'] configuration directives.

  • +
  • Unlike cookie and http, does not require a user to log in when first +loading the phpMyAdmin site. This is by design but could allow any +user to access your installation. Use of some restriction method is +suggested, perhaps a .htaccess file with the HTTP-AUTH directive or disallowing +incoming HTTP requests at one鈥檚 router or firewall will suffice (both +of which are beyond the scope of this manual but easily searchable +with Google).

  • +
+
+
+
+

Securing your phpMyAdmin installation露

+

The phpMyAdmin team tries hard to make the application secure, however there +are always ways to make your installation more secure:

+
    +
  • Follow our Security announcements and upgrade +phpMyAdmin whenever new vulnerability is published.

  • +
  • Serve phpMyAdmin on HTTPS only. Preferably, you should use HSTS as well, so that +you鈥檙e protected from protocol downgrade attacks.

  • +
  • Ensure your PHP setup follows recommendations for production sites, for example +display_errors +should be disabled.

  • +
  • Remove the test directory from phpMyAdmin, unless you are developing and need a test suite.

  • +
  • Remove the setup directory from phpMyAdmin, you will probably not +use it after the initial setup.

  • +
  • Properly choose an authentication method - Cookie authentication mode +is probably the best choice for shared hosting.

  • +
  • Deny access to auxiliary files in ./libraries/ or +./templates/ subfolders in your webserver configuration. +Such configuration prevents from possible path exposure and cross side +scripting vulnerabilities that might happen to be found in that code. For the +Apache webserver, this is often accomplished with a .htaccess file in +those directories.

  • +
  • Deny access to temporary files, see $cfg['TempDir'] (if that +is placed inside your web root, see also Web server upload/save/import directories.

  • +
  • It is generally a good idea to protect a public phpMyAdmin installation +against access by robots as they usually can not do anything good there. You +can do this using robots.txt file in the root of your webserver or limit +access by web server configuration, see 1.42 How can I prevent robots from accessing phpMyAdmin?.

  • +
  • In case you don鈥檛 want all MySQL users to be able to access +phpMyAdmin, you can use $cfg['Servers'][$i]['AllowDeny']['rules'] to limit them +or $cfg['Servers'][$i]['AllowRoot'] to deny root user access.

  • +
  • Enable Two-factor authentication for your account.

  • +
  • Consider hiding phpMyAdmin behind an authentication proxy, so that +users need to authenticate prior to providing MySQL credentials +to phpMyAdmin. You can achieve this by configuring your web server to request +HTTP authentication. For example in Apache this can be done with:

    +
    AuthType Basic
    +AuthName "Restricted Access"
    +AuthUserFile /usr/share/phpmyadmin/passwd
    +Require valid-user
    +
    +
    +

    Once you have changed the configuration, you need to create a list of users which +can authenticate. This can be done using the htpasswd utility:

    +
    htpasswd -c /usr/share/phpmyadmin/passwd username
    +
    +
    +
  • +
  • If you are afraid of automated attacks, enabling Captcha by +$cfg['CaptchaLoginPublicKey'] and +$cfg['CaptchaLoginPrivateKey'] might be an option.

  • +
  • Failed login attemps are logged to syslog (if available, see +$cfg['AuthLog']). This can allow using a tool such as +fail2ban to block brute-force attempts. Note that the log file used by syslog +is not the same as the Apache error or access log files.

  • +
  • In case you鈥檙e running phpMyAdmin together with other PHP applications, it is +generally advised to use separate session storage for phpMyAdmin to avoid +possible session-based attacks against it. You can use +$cfg['SessionSavePath'] to achieve this.

  • +
+
+
+

Using SSL for connection to database server露

+

It is recommended to use SSL when connecting to remote database server. There +are several configuration options involved in the SSL setup:

+
+
$cfg['Servers'][$i]['ssl']

Defines whether to use SSL at all. If you enable only this, the connection +will be encrypted, but there is not authentication of the connection - you +can not verify that you are talking to the right server.

+
+
$cfg['Servers'][$i]['ssl_key'] and $cfg['Servers'][$i]['ssl_cert']

This is used for authentication of client to the server.

+
+
$cfg['Servers'][$i]['ssl_ca'] and $cfg['Servers'][$i]['ssl_ca_path']

The certificate authorities you trust for server certificates. +This is used to ensure that you are talking to a trusted server.

+
+
$cfg['Servers'][$i]['ssl_verify']

This configuration disables server certificate verification. Use with +caution.

+
+
+ +
+
+

Known issues露

+
+

Users with column-specific privileges are unable to 鈥淏rowse鈥�露

+

If a user has only column-specific privileges on some (but not all) columns in a table, 鈥淏rowse鈥� +will fail with an error message.

+

As a workaround, a bookmarked query with the same name as the table can be created, this will +run when using the 鈥淏rowse鈥� link instead. Issue 11922.

+
+
+

Trouble logging back in after logging out using 鈥榟ttp鈥� authentication露

+

When using the 鈥榟ttp鈥� auth_type, it can be impossible to log back in (when the logout comes +manually or after a period of inactivity). Issue 11898.

+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/themes.html b/phpMyAdmin/doc/html/themes.html new file mode 100755 index 0000000..3285687 --- /dev/null +++ b/phpMyAdmin/doc/html/themes.html @@ -0,0 +1,215 @@ + + + + + + + + Custom Themes — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Custom Themes露

+

phpMyAdmin comes with support for third party themes. You can download +additonal themes from our website at <https://www.phpmyadmin.net/themes/>.

+
+

Configuration露

+

Themes are configured with $cfg['ThemeManager'] and +$cfg['ThemeDefault']. Under ./themes/, you should not +delete the directory pmahomme or its underlying structure, because this is +the system theme used by phpMyAdmin. pmahomme contains all images and +styles, for backwards compatibility and for all themes that would not include +images or css-files. If $cfg['ThemeManager'] is enabled, you +can select your favorite theme on the main page. Your selected theme will be +stored in a cookie.

+
+
+

Creating custom theme露

+

To create a theme:

+
    +
  • make a new subdirectory (for example 鈥測our_theme_name鈥�) under ./themes/.

  • +
  • copy the files and directories from pmahomme to 鈥測our_theme_name鈥�

  • +
  • edit the css-files in 鈥測our_theme_name/css鈥�

  • +
  • put your new images in 鈥測our_theme_name/img鈥�

  • +
  • edit layout.inc.php in 鈥測our_theme_name鈥�

  • +
  • edit theme.json in 鈥測our_theme_name鈥� to contain theme metadata (see below)

  • +
  • make a new screenshot of your theme and save it under +鈥測our_theme_name/screen.png鈥�

  • +
+
+

Theme metadata露

+
+

Changed in version 4.8.0: Before 4.8.0 the theme metadata was passed in the info.inc.php file. +It has been replaced by theme.json to allow easier parsing (without +need to handle PHP code) and to support additional features.

+
+

In theme directory there is file theme.json which contains theme +metadata. Currently it consists of:

+
+
+name
+

Display name of the theme.

+

This field is required.

+
+ +
+
+version
+

Theme version, can be quite arbirary and does not have to match phpMyAdmin version.

+

This field is required.

+
+ +
+
+desciption
+

Theme description. this will be shown on the website.

+

This field is required.

+
+ +
+
+author
+

Theme author name.

+

This field is required.

+
+ +
+
+url
+

Link to theme author website. It鈥檚 good idea to have way for getting +support there.

+
+ +
+
+supports
+

Array of supported phpMyAdmin major versions.

+

This field is required.

+
+ +

For example, the definition for Original theme shipped with phpMyAdnin 4.8:

+
{
+    "name": "Original",
+    "version": "4.8",
+    "description": "Original phpMyAdmin theme",
+    "author": "phpMyAdmin developers",
+    "url": "https://www.phpmyadmin.net/",
+    "supports": ["4.8"]
+}
+
+
+
+
+

Sharing images露

+

If you do not want to use your own symbols and buttons, remove the +directory 鈥渋mg鈥� in 鈥測our_theme_name鈥�. phpMyAdmin will use the +default icons and buttons (from the system-theme pmahomme).

+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/transformations.html b/phpMyAdmin/doc/html/transformations.html new file mode 100755 index 0000000..68bb134 --- /dev/null +++ b/phpMyAdmin/doc/html/transformations.html @@ -0,0 +1,236 @@ + + + + + + + + Transformations — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Transformations露

+
+

Note

+

You need to have configured the phpMyAdmin configuration storage for using transformations +feature.

+
+
+

Introduction露

+

To enable transformations, you have to setup the column_info +table and the proper directives. Please see the Configuration on how to do so.

+

You can apply different transformations to the contents of each +column. The transformation will take the content of each column and +transform it with certain rules defined in the selected +transformation.

+

Say you have a column 鈥榝ilename鈥� which contains a filename. Normally +you would see in phpMyAdmin only this filename. Using transformations +you can transform that filename into a HTML link, so you can click +inside of the phpMyAdmin structure on the column鈥檚 link and will see +the file displayed in a new browser window. Using transformation +options you can also specify strings to append/prepend to a string or +the format you want the output stored in.

+

For a general overview of all available transformations and their +options, you can consult your <www.your-host.com>/<your-install- +dir>/transformation_overview.php installation.

+

For a tutorial on how to effectively use transformations, see our +Link section on the +official phpMyAdmin homepage.

+
+
+

Usage露

+

Go to your tbl_structure.php page (i.e. reached through clicking on +the 鈥楽tructure鈥� link for a table). There click on 鈥淐hange鈥� (or change +icon) and there you will see three new fields at the end of the line. +They are called 鈥楳IME-type鈥�, 鈥楤rowser transformation鈥� and +鈥楾ransformation options鈥�.

+
    +
  • The field 鈥楳IME-type鈥� is a drop-down field. Select the MIME-type that +corresponds to the column鈥檚 contents. Please note that transformations +are inactive as long as no MIME-type is selected.

  • +
  • The field 鈥楤rowser transformation鈥� is a drop-down field. You can +choose from a hopefully growing amount of pre-defined transformations. +See below for information on how to build your own transformation. +There are global transformations and mimetype-bound transformations. +Global transformations can be used for any mimetype. They will take +the mimetype, if necessary, into regard. Mimetype-bound +transformations usually only operate on a certain mimetype. There are +transformations which operate on the main mimetype (like 鈥榠mage鈥�), +which will most likely take the subtype into regard, and those who +only operate on a specific subtype (like 鈥榠mage/jpeg鈥�). You can use +transformations on mimetypes for which the function was not defined +for. There is no security check for you selected the right +transformation, so take care of what the output will be like.

  • +
  • The field 鈥楾ransformation options鈥� is a free-type textfield. You have +to enter transform-function specific options here. Usually the +transforms can operate with default options, but it is generally a +good idea to look up the overview to see which options are necessary. +Much like the ENUM/SET-Fields, you have to split up several options +using the format 鈥榓鈥�,鈥檅鈥�,鈥檆鈥�,鈥�(NOTE THE MISSING BLANKS). This is +because internally the options will be parsed as an array, leaving the +first value the first element in the array, and so forth. If you want +to specify a MIME character set you can define it in the +transformation_options. You have to put that outside of the pre- +defined options of the specific mime-transform, as the last value of +the set. Use the format 鈥溾��; charset=XXX鈥欌��. If you use a transform, for +which you can specify 2 options and you want to append a character +set, enter 鈥溾�榝irst parameter鈥�,鈥檚econd parameter鈥�,鈥檆harset=us-ascii鈥欌��. +You can, however use the defaults for the parameters: 鈥溾�欌��,鈥欌��,鈥檆harset +=us-ascii鈥欌��. The default options can be configured using +$cfg['DefaultTransformations']

  • +
+
+
+

File structure露

+

All specific transformations for mimetypes are defined through class +files in the directory 鈥榣ibraries/classes/Plugins/Transformations/鈥�. Each of +them extends a certain transformation abstract class declared in +libraries/classes/Plugins/Transformations/Abs.

+

They are stored in files to ease up customization and easy adding of +new transformations.

+

Because the user cannot enter own mimetypes, it is kept sure that +transformations always work. It makes no sense to apply a +transformation to a mimetype the transform-function doesn鈥檛 know to +handle.

+

There is a file called 鈥�transformations.lib.php鈥� that provides some +basic functions which can be included by any other transform function.

+

The file name convention is [Mimetype]_[Subtype]_[Transformation +Name].class.php, while the abtract class that it extends has the +name [Transformation Name]TransformationsPlugin. All of the +methods that have to be implemented by a transformations plug-in are:

+
    +
  1. getMIMEType() and getMIMESubtype() in the main class;

  2. +
  3. getName(), getInfo() and applyTransformation() in the abstract class +it extends.

  4. +
+

The getMIMEType(), getMIMESubtype() and getName() methods return the +name of the MIME type, MIME Subtype and transformation accordingly. +getInfo() returns the transformation鈥檚 description and possible +options it may receive and applyTransformation() is the method that +does the actual work of the transformation plug-in.

+

Please see the libraries/classes/Plugins/Transformations/TEMPLATE and +libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT files for adding +your own transformation plug-in. You can also generate a new +transformation plug-in (with or without the abstract transformation +class), by using +scripts/transformations_generator_plugin.sh or +scripts/transformations_generator_main_class.sh.

+

The applyTransformation() method always gets passed three variables:

+
    +
  1. $buffer - Contains the text inside of the column. This is the +text, you want to transform.

  2. +
  3. $options - Contains any user-passed options to a transform +function as an array.

  4. +
  5. $meta - Contains an object with information about your column. The +data is drawn from the output of the mysql_fetch_field() function. This means, all +object properties described on the manual page are available in this +variable and can be used to transform a column accordingly to +unsigned/zerofill/not_null/鈥� properties. The $meta->mimetype +variable contains the original MIME-type of the column (i.e. +鈥榯ext/plain鈥�, 鈥榠mage/jpeg鈥� etc.)

  6. +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/two_factor.html b/phpMyAdmin/doc/html/two_factor.html new file mode 100755 index 0000000..38a9dd7 --- /dev/null +++ b/phpMyAdmin/doc/html/two_factor.html @@ -0,0 +1,171 @@ + + + + + + + + Two-factor authentication — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Two-factor authentication露

+
+

New in version 4.8.0.

+
+

Since phpMyAdmin 4.8.0 you can configure two-factor authentication to be +used when logging in. To use this, you first need to configure the +phpMyAdmin configuration storage. Once this is done, every user can opt-in for the second +authentication factor in the Settings.

+

When running phpMyAdmin from the Git source repository, the dependencies must be installed +manually; the typical way of doing so is with the command:

+
composer require pragmarx/google2fa bacon/bacon-qr-code
+
+
+

Or when using a hardware security key with FIDO U2F:

+
composer require samyoul/u2f-php-server
+
+
+
+

Authentication Application (2FA)露

+

Using an application for authentication is a quite common approach based on HOTP and +TOTP. +It is based on transmitting a private key from phpMyAdmin to the authentication +application and the application is then able to generate one time codes based +on this key. The easiest way to enter the key in to the application from phpMyAdmin is +through scanning a QR code.

+

There are dozens of applications available for mobile phones to implement these +standards, the most widely used include:

+ +
+
+

Hardware Security Key (FIDO U2F)露

+

Using hardware tokens is considered to be more secure than a software based +solution. phpMyAdmin supports FIDO U2F +tokens.

+

There are several manufacturers of these tokens, for example:

+ +
+
+

Simple two-factor authentication露

+

This authentication is included for testing and demonstration purposes only as +it really does not provide two-factor authentication, it just asks the user to confirm login by +clicking on the button.

+

It should not be used in the production and is disabled unless +$cfg['DBG']['simple2fa'] is set.

+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/user.html b/phpMyAdmin/doc/html/user.html new file mode 100755 index 0000000..c5ce8ce --- /dev/null +++ b/phpMyAdmin/doc/html/user.html @@ -0,0 +1,161 @@ + + + + + + + + User Guide — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/phpMyAdmin/doc/html/vendors.html b/phpMyAdmin/doc/html/vendors.html new file mode 100755 index 0000000..696ea5a --- /dev/null +++ b/phpMyAdmin/doc/html/vendors.html @@ -0,0 +1,137 @@ + + + + + + + + Distributing and packaging phpMyAdmin — phpMyAdmin 4.9.11 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

Distributing and packaging phpMyAdmin露

+

This document is intended to give advices to people who want to +redistribute phpMyAdmin inside other software package such as Linux +distribution or some all in one package including web server and MySQL +server.

+

Generally you can customize some basic aspects (paths to some files and +behavior) in libraries/vendor_config.php.

+

For example if you want setup script to generate config file in var, change +SETUP_CONFIG_FILE to /var/lib/phpmyadmin/config.inc.php and you +will also probably want to skip directory writable check, so set +SETUP_DIR_WRITABLE to false.

+
+

External libraries露

+

phpMyAdmin includes several external libraries, you might want to +replace them with system ones if they are available, but please note +that you should test whether version you provide is compatible with the +one we ship.

+

Currently known list of external libraries:

+
+
js/jquery

jQuery js framework and various jQuery based libraries.

+
+
vendor/

The download kit includes various Composer packages as +dependencies.

+
+
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/phpMyAdmin/error_report.php b/phpMyAdmin/error_report.php new file mode 100755 index 0000000..3e9c9a6 --- /dev/null +++ b/phpMyAdmin/error_report.php @@ -0,0 +1,135 @@ += 3 + && ($_SESSION['prev_error_subm_time']-time()) <= 3000 + ) { + $_SESSION['error_subm_count'] = 0; + $_SESSION['prev_errors'] = ''; + $response->addJSON('_stopErrorReportLoop', '1'); + } else { + $_SESSION['prev_error_subm_time'] = time(); + $_SESSION['error_subm_count'] = ( + (isset($_SESSION['error_subm_count'])) + ? ($_SESSION['error_subm_count']+1) + : (0) + ); + } + } + $reportData = $errorReport->getData($_POST['exception_type']); + // report if and only if there were 'actual' errors. + if (count($reportData) > 0) { + $server_response = $errorReport->send($reportData); + if (! is_string($server_response)) { + $success = false; + } else { + $decoded_response = json_decode($server_response, true); + $success = !empty($decoded_response) ? + $decoded_response["success"] : false; + } + + /* Message to show to the user */ + if ($success) { + if ((isset($_POST['automatic']) + && $_POST['automatic'] === "true") + || $GLOBALS['cfg']['SendErrorReports'] == 'always' + ) { + $msg = __( + 'An error has been detected and an error report has been ' + . 'automatically submitted based on your settings.' + ); + } else { + $msg = __('Thank you for submitting this report.'); + } + } else { + $msg = __( + 'An error has been detected and an error report has been ' + . 'generated but failed to be sent.' + ) + . ' ' + . __( + 'If you experience any ' + . 'problems please submit a bug report manually.' + ); + } + $msg .= ' ' . __('You may want to refresh the page.'); + + /* Create message object */ + if ($success) { + $msg = Message::notice($msg); + } else { + $msg = Message::error($msg); + } + + /* Add message to response */ + if ($response->isAjax()) { + if ($_POST['exception_type'] == 'js') { + $response->addJSON('message', $msg); + } else { + $response->addJSON('_errSubmitMsg', $msg); + } + } elseif ($_POST['exception_type'] == 'php') { + $jsCode = 'PMA_ajaxShowMessage("
' + . $msg + . '
", false);'; + $response->getFooter()->getScripts()->addCode($jsCode); + } + + if ($_POST['exception_type'] == 'php') { + // clear previous errors & save new ones. + $GLOBALS['error_handler']->savePreviousErrors(); + } + + /* Persist always send settings */ + if (isset($_POST['always_send']) + && $_POST['always_send'] === "true" + ) { + $userPreferences = new UserPreferences(); + $userPreferences->persistOption("SendErrorReports", "always", "ask"); + } + } +} elseif (! empty($_POST['get_settings'])) { + $response->addJSON('report_setting', $GLOBALS['cfg']['SendErrorReports']); +} else { + if ($_POST['exception_type'] == 'js') { + $response->addHTML($errorReport->getForm()); + } else { + // clear previous errors & save new ones. + $GLOBALS['error_handler']->savePreviousErrors(); + } +} diff --git a/phpMyAdmin/examples/config.manyhosts.inc.php b/phpMyAdmin/examples/config.manyhosts.inc.php new file mode 100755 index 0000000..b6a6a12 --- /dev/null +++ b/phpMyAdmin/examples/config.manyhosts.inc.php @@ -0,0 +1,52 @@ + array( + 'user' => 'root', + 'password' => '', + ), + ); + +/** + * Simple function to show HTML page with given content. + * + * @param string $contents Content to include in page + * + * @return void + */ +function Show_page($contents) +{ + header('Content-Type: text/html; charset=utf-8'); + echo '' , "\n"; + ?> + + + + + + + phpMyAdmin OpenID signon example + + + ' , $_SESSION['PMA_single_signon_message'] , '

'; + unset($_SESSION['PMA_single_signon_message']); + } + echo $contents; + ?> + + + \n"; + $contents .= "
" . htmlspecialchars($e->getMessage()) . "
\n"; + $contents .= ""; + Show_page($contents); + exit; +} + + +/* Need to have cookie visible from parent directory */ +session_set_cookie_params(0, '/', '', $secure_cookie, true); +/* Create signon session */ +$session_name = 'SignonSession'; +session_name($session_name); +@session_start(); + +// Determine realm and return_to +$base = 'http'; +if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') { + $base .= 's'; +} +$base .= '://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']; + +$realm = $base . '/'; +$returnTo = $base . dirname($_SERVER['PHP_SELF']); +if ($returnTo[strlen($returnTo) - 1] != '/') { + $returnTo .= '/'; +} +$returnTo .= 'openid.php'; + +/* Display form */ +if (!count($_GET) && !count($_POST) || isset($_GET['phpMyAdmin'])) { + /* Show simple form */ + $content = '
+OpenID:
+ +
+ +'; + Show_page($content); + exit; +} + +/* Grab identifier */ +if (isset($_POST['identifier']) && is_string($_POST['identifier'])) { + $identifier = $_POST['identifier']; +} elseif (isset($_SESSION['identifier']) && is_string($_SESSION['identifier'])) { + $identifier = $_SESSION['identifier']; +} else { + $identifier = null; +} + +/* Create OpenID object */ +try { + $o = new OpenID_RelyingParty($returnTo, $realm, $identifier); +} catch (Exception $e) { + Die_error($e); +} + +/* Redirect to OpenID provider */ +if (isset($_POST['start'])) { + try { + $authRequest = $o->prepare(); + } catch (Exception $e) { + Die_error($e); + } + + $url = $authRequest->getAuthorizeURL(); + + header("Location: $url"); + exit; +} else { + /* Grab query string */ + if (!count($_POST)) { + list(, $queryString) = explode('?', $_SERVER['REQUEST_URI']); + } else { + // I hate php sometimes + $queryString = file_get_contents('php://input'); + } + + /* Check reply */ + try { + $message = new OpenID_Message($queryString, OpenID_Message::FORMAT_HTTP); + } catch (Exception $e) { + Die_error($e); + } + + $id = $message->get('openid.claimed_id'); + + if (!empty($id) && isset($AUTH_MAP[$id])) { + $_SESSION['PMA_single_signon_user'] = $AUTH_MAP[$id]['user']; + $_SESSION['PMA_single_signon_password'] = $AUTH_MAP[$id]['password']; + session_write_close(); + /* Redirect to phpMyAdmin (should use absolute URL here!) */ + header('Location: ../index.php'); + } else { + Show_page('

User not allowed!

'); + exit; + } +} diff --git a/phpMyAdmin/examples/signon-script.php b/phpMyAdmin/examples/signon-script.php new file mode 100755 index 0000000..7a2b8aa --- /dev/null +++ b/phpMyAdmin/examples/signon-script.php @@ -0,0 +1,35 @@ + 'Signon test'); + $id = session_id(); + /* Close that session */ + @session_write_close(); + /* Redirect to phpMyAdmin (should use absolute URL here!) */ + header('Location: ../index.php'); +} else { + /* Show simple form */ + header('Content-Type: text/html; charset=utf-8'); + echo '' , "\n"; + ?> + + + + + + + phpMyAdmin single signon example + + + '; + echo $_SESSION['PMA_single_signon_error_message']; + echo '

'; + } + ?> +
+ Username:
+ Password:
+ Host: (will use the one from config.inc.php by default) +
+ Port: (will use the one from config.inc.php by default) +
+ +
+ + + diff --git a/phpMyAdmin/export.php b/phpMyAdmin/export.php new file mode 100755 index 0000000..c933833 --- /dev/null +++ b/phpMyAdmin/export.php @@ -0,0 +1,555 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('export_output.js'); + +//check if it's the GET request to check export time out +if (isset($_GET['check_time_out'])) { + if (isset($_SESSION['pma_export_error'])) { + $err = $_SESSION['pma_export_error']; + unset($_SESSION['pma_export_error']); + echo "timeout"; + } else { + echo "success"; + } + exit; +} + +/** + * Sets globals from $_POST + * + * - Please keep the parameters in order of their appearance in the form + * - Some of these parameters are not used, as the code below directly + * verifies from the superglobal $_POST or $_REQUEST + * TODO: this should be removed to avoid passing user input to GLOBALS + * without checking + */ +$post_params = array( + 'db', + 'table', + 'what', + 'single_table', + 'export_type', + 'export_method', + 'quick_or_custom', + 'db_select', + 'table_select', + 'table_structure', + 'table_data', + 'limit_to', + 'limit_from', + 'allrows', + 'lock_tables', + 'output_format', + 'filename_template', + 'maxsize', + 'remember_template', + 'charset', + 'compression', + 'as_separate_files', + 'knjenc', + 'xkana', + 'htmlword_structure_or_data', + 'htmlword_null', + 'htmlword_columns', + 'mediawiki_headers', + 'mediawiki_structure_or_data', + 'mediawiki_caption', + 'pdf_structure_or_data', + 'odt_structure_or_data', + 'odt_relation', + 'odt_comments', + 'odt_mime', + 'odt_columns', + 'odt_null', + 'codegen_structure_or_data', + 'codegen_format', + 'excel_null', + 'excel_removeCRLF', + 'excel_columns', + 'excel_edition', + 'excel_structure_or_data', + 'yaml_structure_or_data', + 'ods_null', + 'ods_structure_or_data', + 'ods_columns', + 'json_structure_or_data', + 'json_pretty_print', + 'json_unicode', + 'xml_structure_or_data', + 'xml_export_events', + 'xml_export_functions', + 'xml_export_procedures', + 'xml_export_tables', + 'xml_export_triggers', + 'xml_export_views', + 'xml_export_contents', + 'texytext_structure_or_data', + 'texytext_columns', + 'texytext_null', + 'phparray_structure_or_data', + 'sql_include_comments', + 'sql_header_comment', + 'sql_dates', + 'sql_relation', + 'sql_mime', + 'sql_use_transaction', + 'sql_disable_fk', + 'sql_compatibility', + 'sql_structure_or_data', + 'sql_create_database', + 'sql_drop_table', + 'sql_procedure_function', + 'sql_create_table', + 'sql_create_view', + 'sql_create_trigger', + 'sql_if_not_exists', + 'sql_auto_increment', + 'sql_backquotes', + 'sql_truncate', + 'sql_delayed', + 'sql_ignore', + 'sql_type', + 'sql_insert_syntax', + 'sql_max_query_size', + 'sql_hex_for_binary', + 'sql_utc_time', + 'sql_drop_database', + 'sql_views_as_tables', + 'sql_metadata', + 'csv_separator', + 'csv_enclosed', + 'csv_escaped', + 'csv_terminated', + 'csv_null', + 'csv_removeCRLF', + 'csv_columns', + 'csv_structure_or_data', + // csv_replace should have been here but we use it directly from $_POST + 'latex_caption', + 'latex_structure_or_data', + 'latex_structure_caption', + 'latex_structure_continued_caption', + 'latex_structure_label', + 'latex_relation', + 'latex_comments', + 'latex_mime', + 'latex_columns', + 'latex_data_caption', + 'latex_data_continued_caption', + 'latex_data_label', + 'latex_null', + 'aliases' +); + +foreach ($post_params as $one_post_param) { + if (isset($_POST[$one_post_param])) { + $GLOBALS[$one_post_param] = $_POST[$one_post_param]; + } +} + +$table = $GLOBALS['table']; + +PhpMyAdmin\Util::checkParameters(array('what', 'export_type')); + +// sanitize this parameter which will be used below in a file inclusion +$what = Core::securePath($_POST['what']); + +// export class instance, not array of properties, as before +/* @var $export_plugin ExportPlugin */ +$export_plugin = Plugins::getPlugin( + "export", + $what, + 'libraries/classes/Plugins/Export/', + array( + 'export_type' => $export_type, + 'single_table' => isset($single_table) + ) +); + +// Check export type +if (empty($export_plugin)) { + Core::fatalError(__('Bad type!')); +} + +/** + * valid compression methods + */ +$compression_methods = array( + 'zip', + 'gzip' +); + +/** + * init and variable checking + */ +$compression = false; +$onserver = false; +$save_on_server = false; +$buffer_needed = false; +$back_button = ''; +$refreshButton = ''; +$save_filename = ''; +$file_handle = ''; +$err_url = ''; +$filename = ''; +$separate_files = ''; + +// Is it a quick or custom export? +if (isset($_POST['quick_or_custom']) + && $_POST['quick_or_custom'] == 'quick' +) { + $quick_export = true; +} else { + $quick_export = false; +} + +if ($_POST['output_format'] == 'astext') { + $asfile = false; +} else { + $asfile = true; + if (isset($_POST['as_separate_files']) + && ! empty($_POST['as_separate_files']) + ) { + if (isset($_POST['compression']) + && ! empty($_POST['compression']) + && $_POST['compression'] == 'zip' + ) { + $separate_files = $_POST['as_separate_files']; + } + } + if (in_array($_POST['compression'], $compression_methods)) { + $compression = $_POST['compression']; + $buffer_needed = true; + } + if (($quick_export && ! empty($_POST['quick_export_onserver'])) + || (! $quick_export && ! empty($_POST['onserver'])) + ) { + if ($quick_export) { + $onserver = $_POST['quick_export_onserver']; + } else { + $onserver = $_POST['onserver']; + } + // Will we save dump on server? + $save_on_server = ! empty($cfg['SaveDir']) && $onserver; + } +} + +/** + * If we are sending the export file (as opposed to just displaying it + * as text), we have to bypass the usual PhpMyAdmin\Response mechanism + */ +if (isset($_POST['output_format']) && $_POST['output_format'] == 'sendit' && ! $save_on_server) { + $response->disable(); + //Disable all active buffers (see: ob_get_status(true) at this point) + while (@ob_end_clean()); +} + +// Generate error url and check for needed variables +if ($export_type == 'server') { + $err_url = 'server_export.php' . Url::getCommon(); +} elseif ($export_type == 'database' && strlen($db) > 0) { + $err_url = 'db_export.php' . Url::getCommon(array('db' => $db)); + // Check if we have something to export + if (isset($table_select)) { + $tables = $table_select; + } else { + $tables = array(); + } +} elseif ($export_type == 'table' && strlen($db) > 0 && strlen($table) > 0) { + $err_url = 'tbl_export.php' . Url::getCommon( + array( + 'db' => $db, 'table' => $table + ) + ); +} else { + Core::fatalError(__('Bad parameters!')); +} + +// Merge SQL Query aliases with Export aliases from +// export page, Export page aliases are given more +// preference over SQL Query aliases. +$parser = new \PhpMyAdmin\SqlParser\Parser($sql_query); +$aliases = array(); +if ((!empty($parser->statements[0])) + && ($parser->statements[0] instanceof \PhpMyAdmin\SqlParser\Statements\SelectStatement) +) { + $aliases = \PhpMyAdmin\SqlParser\Utils\Misc::getAliases($parser->statements[0], $db); +} +if (!empty($_POST['aliases'])) { + $aliases = Export::mergeAliases($aliases, $_POST['aliases']); + $_SESSION['tmpval']['aliases'] = $_POST['aliases']; +} + +/** + * Increase time limit for script execution and initializes some variables + */ +Util::setTimeLimit(); +if (! empty($cfg['MemoryLimit'])) { + ini_set('memory_limit', $cfg['MemoryLimit']); +} +register_shutdown_function('PhpMyAdmin\Export::shutdown'); +// Start with empty buffer +$dump_buffer = ''; +$dump_buffer_len = 0; + +// Array of dump_buffers - used in separate file exports +$dump_buffer_objects = array(); + +// We send fake headers to avoid browser timeout when buffering +$time_start = time(); + +// Defines the default format. +// For SQL always use \n as MySQL wants this on all platforms. +if ($what == 'sql') { + $crlf = "\n"; +} else { + $crlf = PHP_EOL; +} + +$output_kanji_conversion = Encoding::canConvertKanji(); + +// Do we need to convert charset? +$output_charset_conversion = $asfile + && Encoding::isSupported() + && isset($charset) && $charset != 'utf-8'; + +// Use on the fly compression? +$GLOBALS['onfly_compression'] = $GLOBALS['cfg']['CompressOnFly'] + && $compression == 'gzip'; +if ($GLOBALS['onfly_compression']) { + $GLOBALS['memory_limit'] = Export::getMemoryLimit(); +} + +// Generate filename and mime type if needed +if ($asfile) { + if (empty($remember_template)) { + $remember_template = ''; + } + list($filename, $mime_type) = Export::getFilenameAndMimetype( + $export_type, $remember_template, $export_plugin, $compression, + $filename_template + ); +} else { + $mime_type = ''; +} + +// Open file on server if needed +if ($save_on_server) { + list($save_filename, $message, $file_handle) = Export::openFile( + $filename, $quick_export + ); + + // problem opening export file on server? + if (! empty($message)) { + Export::showPage($db, $table, $export_type); + } +} else { + /** + * Send headers depending on whether the user chose to download a dump file + * or not + */ + if ($asfile) { + // Download + // (avoid rewriting data containing HTML with anchors and forms; + // this was reported to happen under Plesk) + ini_set('url_rewriter.tags', ''); + $filename = Sanitize::sanitizeFilename($filename); + + Core::downloadHeader($filename, $mime_type); + } else { + // HTML + if ($export_type == 'database') { + $num_tables = count($tables); + if ($num_tables == 0) { + $message = PhpMyAdmin\Message::error( + __('No tables found in database.') + ); + $active_page = 'db_export.php'; + include 'db_export.php'; + exit(); + } + } + list($html, $back_button, $refreshButton) = Export::getHtmlForDisplayedExportHeader( + $export_type, $db, $table + ); + echo $html; + unset($html); + } // end download +} + +$relation = new Relation(); + +// Fake loop just to allow skip of remain of this code by break, I'd really +// need exceptions here :-) +do { + // Re - initialize + $dump_buffer = ''; + $dump_buffer_len = 0; + + // Add possibly some comments to export + if (! $export_plugin->exportHeader()) { + break; + } + + // Will we need relation & co. setup? + $do_relation = isset($GLOBALS[$what . '_relation']); + $do_comments = isset($GLOBALS[$what . '_include_comments']) + || isset($GLOBALS[$what . '_comments']); + $do_mime = isset($GLOBALS[$what . '_mime']); + if ($do_relation || $do_comments || $do_mime) { + $cfgRelation = $relation->getRelationsParam(); + } + + // Include dates in export? + $do_dates = isset($GLOBALS[$what . '_dates']); + + $whatStrucOrData = $GLOBALS[$what . '_structure_or_data']; + + /** + * Builds the dump + */ + if ($export_type == 'server') { + if (! isset($db_select)) { + $db_select = ''; + } + Export::exportServer( + $db_select, $whatStrucOrData, $export_plugin, $crlf, $err_url, + $export_type, $do_relation, $do_comments, $do_mime, $do_dates, + $aliases, $separate_files + ); + } elseif ($export_type == 'database') { + if (!isset($table_structure) || !is_array($table_structure)) { + $table_structure = array(); + } + if (!isset($table_data) || !is_array($table_data)) { + $table_data = array(); + } + if (!empty($_POST['structure_or_data_forced'])) { + $table_structure = $tables; + $table_data = $tables; + } + if (isset($lock_tables)) { + Export::lockTables($db, $tables, "READ"); + try { + Export::exportDatabase( + $db, $tables, $whatStrucOrData, $table_structure, + $table_data, $export_plugin, $crlf, $err_url, $export_type, + $do_relation, $do_comments, $do_mime, $do_dates, $aliases, + $separate_files + ); + } finally { + Export::unlockTables(); + } + } else { + Export::exportDatabase( + $db, $tables, $whatStrucOrData, $table_structure, $table_data, + $export_plugin, $crlf, $err_url, $export_type, $do_relation, + $do_comments, $do_mime, $do_dates, $aliases, $separate_files + ); + } + } else { + // We export just one table + // $allrows comes from the form when "Dump all rows" has been selected + if (! isset($allrows)) { + $allrows = ''; + } + if (! isset($limit_to)) { + $limit_to = 0; + } + if (! isset($limit_from)) { + $limit_from = 0; + } + if (isset($lock_tables)) { + try { + Export::lockTables($db, array($table), "READ"); + Export::exportTable( + $db, $table, $whatStrucOrData, $export_plugin, $crlf, + $err_url, $export_type, $do_relation, $do_comments, + $do_mime, $do_dates, $allrows, $limit_to, $limit_from, + $sql_query, $aliases + ); + } finally { + Export::unlockTables(); + } + } else { + Export::exportTable( + $db, $table, $whatStrucOrData, $export_plugin, $crlf, $err_url, + $export_type, $do_relation, $do_comments, $do_mime, $do_dates, + $allrows, $limit_to, $limit_from, $sql_query, $aliases + ); + } + } + if (! $export_plugin->exportFooter()) { + break; + } + +} while (false); +// End of fake loop + +if ($save_on_server && ! empty($message)) { + Export::showPage($db, $table, $export_type); +} + +/** + * Send the dump as a file... + */ +if (empty($asfile)) { + echo Export::getHtmlForDisplayedExportFooter($back_button, $refreshButton); + return; +} // end if + +// Convert the charset if required. +if ($output_charset_conversion) { + $dump_buffer = Encoding::convertString( + 'utf-8', + $GLOBALS['charset'], + $dump_buffer + ); +} + +// Compression needed? +if ($compression) { + if (! empty($separate_files)) { + $dump_buffer = Export::compress( + $dump_buffer_objects, $compression, $filename + ); + } else { + $dump_buffer = Export::compress($dump_buffer, $compression, $filename); + } + +} + +/* If we saved on server, we have to close file now */ +if ($save_on_server) { + $message = Export::closeFile( + $file_handle, $dump_buffer, $save_filename + ); + Export::showPage($db, $table, $export_type); +} else { + echo $dump_buffer; +} diff --git a/phpMyAdmin/favicon.ico b/phpMyAdmin/favicon.ico new file mode 100755 index 0000000..fb156b2 Binary files /dev/null and b/phpMyAdmin/favicon.ico differ diff --git a/phpMyAdmin/gis_data_editor.php b/phpMyAdmin/gis_data_editor.php new file mode 100755 index 0000000..f8403f1 --- /dev/null +++ b/phpMyAdmin/gis_data_editor.php @@ -0,0 +1,436 @@ +generateParams($_POST['value']) + ); +} + +// Generate Well Known Text +$srid = (isset($gis_data['srid']) && $gis_data['srid'] != '') + ? htmlspecialchars($gis_data['srid']) : 0; +$wkt = $gis_obj->generateWkt($gis_data, 0); +$wkt_with_zero = $gis_obj->generateWkt($gis_data, 0, '0'); +$result = "'" . $wkt . "'," . $srid; + +// Generate SVG based visualization +$visualizationSettings = array( + 'width' => 450, + 'height' => 300, + 'spatialColumn' => 'wkt', + 'mysqlVersion' => $GLOBALS['dbi']->getVersion() +); +$data = array(array('wkt' => $wkt_with_zero, 'srid' => $srid)); +$visualization = GisVisualization::getByData($data, $visualizationSettings) + ->toImage('svg'); + +$open_layers = GisVisualization::getByData($data, $visualizationSettings) + ->asOl(); + +// If the call is to update the WKT and visualization make an AJAX response +if (isset($_POST['generate']) && $_POST['generate'] == true) { + $extra_data = array( + 'result' => $result, + 'visualization' => $visualization, + 'openLayers' => $open_layers, + ); + $response = Response::getInstance(); + $response->addJSON($extra_data); + exit; +} + +ob_start(); + +echo '
'; +echo ''; +echo '
'; + +echo '

'; +printf( + __('Value for the column "%s"'), + htmlspecialchars($_POST['field']) +); +echo '

'; + +echo ''; +// The input field to which the final result should be added +// and corresponding null checkbox +if (isset($_POST['input_name'])) { + echo ''; +} +echo Url::getHiddenInputs(); + +echo ''; +echo '
'; +echo $visualization; +echo '
'; + +// No not remove inline style or it will cause "Cannot read property 'w' of null" on GIS editor map init +echo '
'; +echo '
'; + +echo '
'; +echo ''; +echo ''; +echo '
'; + +echo ''; +echo ''; + + +echo ''; +echo '
'; +echo ''; +echo '    '; +/* l10n: Spatial Reference System Identifier */ +echo ''; +echo ''; +echo '
'; +echo ''; + +echo ''; +echo '
'; + +$geom_count = 1; +if ($geom_type == 'GEOMETRYCOLLECTION') { + $geom_count = (isset($gis_data[$geom_type]['geom_count'])) + ? intval($gis_data[$geom_type]['geom_count']) : 1; + if (isset($gis_data[$geom_type]['add_geom'])) { + $geom_count++; + } + echo ''; +} + +for ($a = 0; $a < $geom_count; $a++) { + if (! isset($gis_data[$a])) { + continue; + } + + if ($geom_type == 'GEOMETRYCOLLECTION') { + echo '

'; + printf(__('Geometry %d:'), $a + 1); + echo '
'; + if (isset($gis_data[$a]['gis_type'])) { + $type = htmlspecialchars($gis_data[$a]['gis_type']); + } else { + $type = $gis_types[0]; + } + echo ''; + } else { + $type = $geom_type; + } + + if ($type == 'POINT') { + echo '
'; + echo __('Point:'); + echo ''; + echo ''; + echo ''; + echo ''; + + } elseif ($type == 'MULTIPOINT' || $type == 'LINESTRING') { + $no_of_points = isset($gis_data[$a][$type]['no_of_points']) + ? intval($gis_data[$a][$type]['no_of_points']) : 1; + if ($type == 'LINESTRING' && $no_of_points < 2) { + $no_of_points = 2; + } + if ($type == 'MULTIPOINT' && $no_of_points < 1) { + $no_of_points = 1; + } + + if (isset($gis_data[$a][$type]['add_point'])) { + $no_of_points++; + } + echo ''; + + for ($i = 0; $i < $no_of_points; $i++) { + echo '
'; + printf(__('Point %d'), $i + 1); + echo ': '; + echo ''; + echo ''; + echo ''; + echo ''; + } + echo ''; + + } elseif ($type == 'MULTILINESTRING' || $type == 'POLYGON') { + $no_of_lines = isset($gis_data[$a][$type]['no_of_lines']) + ? intval($gis_data[$a][$type]['no_of_lines']) : 1; + if ($no_of_lines < 1) { + $no_of_lines = 1; + } + if (isset($gis_data[$a][$type]['add_line'])) { + $no_of_lines++; + } + echo ''; + + for ($i = 0; $i < $no_of_lines; $i++) { + echo '
'; + if ($type == 'MULTILINESTRING') { + printf(__('Linestring %d:'), $i + 1); + } else { + if ($i == 0) { + echo __('Outer ring:'); + } else { + printf(__('Inner ring %d:'), $i); + } + } + + $no_of_points = isset($gis_data[$a][$type][$i]['no_of_points']) + ? intval($gis_data[$a][$type][$i]['no_of_points']) : 2; + if ($type == 'MULTILINESTRING' && $no_of_points < 2) { + $no_of_points = 2; + } + if ($type == 'POLYGON' && $no_of_points < 4) { + $no_of_points = 4; + } + if (isset($gis_data[$a][$type][$i]['add_point'])) { + $no_of_points++; + } + echo ''; + + for ($j = 0; $j < $no_of_points; $j++) { + echo('
'); + printf(__('Point %d'), $j + 1); + echo ': '; + echo ''; + echo ''; + echo ''; + echo ''; + } + echo ''; + } + $caption = ($type == 'MULTILINESTRING') + ? __('Add a linestring') + : __('Add an inner ring'); + echo '
'; + echo ''; + + } elseif ($type == 'MULTIPOLYGON') { + $no_of_polygons = isset($gis_data[$a][$type]['no_of_polygons']) + ? intval($gis_data[$a][$type]['no_of_polygons']) : 1; + if ($no_of_polygons < 1) { + $no_of_polygons = 1; + } + if (isset($gis_data[$a][$type]['add_polygon'])) { + $no_of_polygons++; + } + echo ''; + + for ($k = 0; $k < $no_of_polygons; $k++) { + echo '
'; + printf(__('Polygon %d:'), $k + 1); + $no_of_lines = isset($gis_data[$a][$type][$k]['no_of_lines']) + ? intval($gis_data[$a][$type][$k]['no_of_lines']) : 1; + if ($no_of_lines < 1) { + $no_of_lines = 1; + } + if (isset($gis_data[$a][$type][$k]['add_line'])) { + $no_of_lines++; + } + echo ''; + + for ($i = 0; $i < $no_of_lines; $i++) { + echo '

'; + if ($i == 0) { + echo __('Outer ring:'); + } else { + printf(__('Inner ring %d:'), $i); + } + + $no_of_points = isset($gis_data[$a][$type][$k][$i]['no_of_points']) + ? intval($gis_data[$a][$type][$k][$i]['no_of_points']) : 4; + if ($no_of_points < 4) { + $no_of_points = 4; + } + if (isset($gis_data[$a][$type][$k][$i]['add_point'])) { + $no_of_points++; + } + echo ''; + + for ($j = 0; $j < $no_of_points; $j++) { + echo '
'; + printf(__('Point %d'), $j + 1); + echo ': '; + echo ''; + echo ''; + echo ''; + echo ''; + } + echo ''; + } + echo '
'; + echo ''; + echo '
'; + } + echo '
'; + echo ''; + } +} +if ($geom_type == 'GEOMETRYCOLLECTION') { + echo '

'; + echo ''; +} +echo '
'; +echo ''; + +echo '
'; +echo ''; + +echo '
'; +echo '

' , __('Output') , '

'; +echo '

'; +echo __( + 'Choose "ST_GeomFromText" from the "Function" column and paste the' + . ' string below into the "Value" field.' +); +echo '

'; +echo ''; +echo '
'; + +echo '
'; +echo '
'; + +Response::getInstance()->addJSON('gis_editor', ob_get_contents()); +ob_end_clean(); diff --git a/phpMyAdmin/import.php b/phpMyAdmin/import.php new file mode 100755 index 0000000..7bd3b8f --- /dev/null +++ b/phpMyAdmin/import.php @@ -0,0 +1,784 @@ +addJSON( + 'console_message_bookmark', PhpMyAdmin\Console::getBookmarkContent() + ); + exit; +} +// If it's a console bookmark add request +if (isset($_POST['console_bookmark_add'])) { + if (isset($_POST['label']) && isset($_POST['db']) + && isset($_POST['bookmark_query']) && isset($_POST['shared']) + ) { + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + $bookmarkFields = array( + 'bkm_database' => $_POST['db'], + 'bkm_user' => $cfgBookmark['user'], + 'bkm_sql_query' => $_POST['bookmark_query'], + 'bkm_label' => $_POST['label'] + ); + $isShared = ($_POST['shared'] == 'true' ? true : false); + $bookmark = Bookmark::createBookmark( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $bookmarkFields, + $isShared + ); + if ($bookmark !== false && $bookmark->save()) { + $response->addJSON('message', __('Succeeded')); + $response->addJSON('data', $bookmarkFields); + $response->addJSON('isShared', $isShared); + } else { + $response->addJSON('message', __('Failed')); + } + die(); + } else { + $response->addJSON('message', __('Incomplete params')); + die(); + } +} + +$format = ''; + +/** + * Sets globals from $_POST + */ +$post_params = array( + 'charset_of_file', + 'format', + 'import_type', + 'is_js_confirmed', + 'MAX_FILE_SIZE', + 'message_to_show', + 'noplugin', + 'skip_queries', + 'local_import_file' +); + +foreach ($post_params as $one_post_param) { + if (isset($_POST[$one_post_param])) { + $GLOBALS[$one_post_param] = $_POST[$one_post_param]; + } +} + +// reset import messages for ajax request +$_SESSION['Import_message']['message'] = null; +$_SESSION['Import_message']['go_back_url'] = null; +// default values +$GLOBALS['reload'] = false; + +// Use to identify current cycle is executing +// a multiquery statement or stored routine +if (!isset($_SESSION['is_multi_query'])) { + $_SESSION['is_multi_query'] = false; +} + +$ajax_reload = array(); +// Are we just executing plain query or sql file? +// (eg. non import, but query box/window run) +if (! empty($sql_query)) { + + // apply values for parameters + if (! empty($_POST['parameterized']) + && ! empty($_POST['parameters']) + && is_array($_POST['parameters']) + ) { + $parameters = $_POST['parameters']; + foreach ($parameters as $parameter => $replacement) { + $quoted = preg_quote($parameter, '/'); + // making sure that :param does not apply values to :param1 + $sql_query = preg_replace( + '/' . $quoted . '([^a-zA-Z0-9_])/', + $GLOBALS['dbi']->escapeString($replacement) . '${1}', + $sql_query + ); + // for parameters the appear at the end of the string + $sql_query = preg_replace( + '/' . $quoted . '$/', + $GLOBALS['dbi']->escapeString($replacement), + $sql_query + ); + } + } + + // run SQL query + $import_text = $sql_query; + $import_type = 'query'; + $format = 'sql'; + $_SESSION['sql_from_query_box'] = true; + + // If there is a request to ROLLBACK when finished. + if (isset($_POST['rollback_query'])) { + Import::handleRollbackRequest($import_text); + } + + // refresh navigation and main panels + if (preg_match('/^(DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', $sql_query)) { + $GLOBALS['reload'] = true; + $ajax_reload['reload'] = true; + } + + // refresh navigation panel only + if (preg_match( + '/^(CREATE|ALTER)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', + $sql_query + )) { + $ajax_reload['reload'] = true; + } + + // do a dynamic reload if table is RENAMED + // (by sending the instruction to the AJAX response handler) + if (preg_match( + '/^RENAME\s+TABLE\s+(.*?)\s+TO\s+(.*?)($|;|\s)/i', + $sql_query, + $rename_table_names + )) { + $ajax_reload['reload'] = true; + $ajax_reload['table_name'] = PhpMyAdmin\Util::unQuote( + $rename_table_names[2] + ); + } + + $sql_query = ''; +} elseif (! empty($sql_file)) { + // run uploaded SQL file + $import_file = $sql_file; + $import_type = 'queryfile'; + $format = 'sql'; + unset($sql_file); +} elseif (! empty($_POST['id_bookmark'])) { + // run bookmark + $import_type = 'query'; + $format = 'sql'; +} + +// If we didn't get any parameters, either user called this directly, or +// upload limit has been reached, let's assume the second possibility. +if ($_POST == array() && $_GET == array()) { + $message = PhpMyAdmin\Message::error( + __( + 'You probably tried to upload a file that is too large. Please refer ' . + 'to %sdocumentation%s for a workaround for this limit.' + ) + ); + $message->addParam('[doc@faq1-16]'); + $message->addParam('[/doc]'); + + // so we can obtain the message + $_SESSION['Import_message']['message'] = $message->getDisplay(); + $_SESSION['Import_message']['go_back_url'] = $GLOBALS['goto']; + + $response->setRequestStatus(false); + $response->addJSON('message', $message); + + exit; // the footer is displayed automatically +} + +// Add console message id to response output +if (isset($_POST['console_message_id'])) { + $response->addJSON('console_message_id', $_POST['console_message_id']); +} + +/** + * Sets globals from $_POST patterns, for import plugins + * We only need to load the selected plugin + */ + +if (! in_array( + $format, + array( + 'csv', + 'ldi', + 'mediawiki', + 'ods', + 'shp', + 'sql', + 'xml' + ) +) +) { + // this should not happen for a normal user + // but only during an attack + Core::fatalError('Incorrect format parameter'); +} + +$post_patterns = array( + '/^force_file_/', + '/^' . $format . '_/' +); + +Core::setPostAsGlobal($post_patterns); + +// Check needed parameters +PhpMyAdmin\Util::checkParameters(array('import_type', 'format')); + +// We don't want anything special in format +$format = Core::securePath($format); + +if (strlen($table) > 0 && strlen($db) > 0) { + $urlparams = array('db' => $db, 'table' => $table); +} elseif (strlen($db) > 0) { + $urlparams = array('db' => $db); +} else { + $urlparams = array(); +} + +// Create error and goto url +if ($import_type == 'table') { + $goto = 'tbl_import.php'; +} elseif ($import_type == 'database') { + $goto = 'db_import.php'; +} elseif ($import_type == 'server') { + $goto = 'server_import.php'; +} else { + if (empty($goto) || !preg_match('@^(server|db|tbl)(_[a-z]*)*\.php$@i', $goto)) { + if (strlen($table) > 0 && strlen($db) > 0) { + $goto = 'tbl_structure.php'; + } elseif (strlen($db) > 0) { + $goto = 'db_structure.php'; + } else { + $goto = 'server_sql.php'; + } + } +} +$err_url = $goto . Url::getCommon($urlparams); +$_SESSION['Import_message']['go_back_url'] = $err_url; +// Avoid setting selflink to 'import.php' +// problem similar to bug 4276 +if (basename($_SERVER['SCRIPT_NAME']) === 'import.php') { + $_SERVER['SCRIPT_NAME'] = $goto; +} + + +if (strlen($db) > 0) { + $GLOBALS['dbi']->selectDb($db); +} + +Util::setTimeLimit(); +if (! empty($cfg['MemoryLimit'])) { + ini_set('memory_limit', $cfg['MemoryLimit']); +} + +$timestamp = time(); +if (isset($_POST['allow_interrupt'])) { + $maximum_time = ini_get('max_execution_time'); +} else { + $maximum_time = 0; +} + +// set default values +$timeout_passed = false; +$error = false; +$read_multiply = 1; +$finished = false; +$offset = 0; +$max_sql_len = 0; +$file_to_unlink = ''; +$sql_query = ''; +$sql_query_disabled = false; +$go_sql = false; +$executed_queries = 0; +$run_query = true; +$charset_conversion = false; +$reset_charset = false; +$bookmark_created = false; +$result = false; +$msg = 'Sorry an unexpected error happened!'; + +// Bookmark Support: get a query back from bookmark if required +if (! empty($_POST['id_bookmark'])) { + $id_bookmark = (int)$_POST['id_bookmark']; + switch ($_POST['action_bookmark']) { + case 0: // bookmarked query that have to be run + $bookmark = Bookmark::get( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $db, + $id_bookmark, + 'id', + isset($_POST['action_bookmark_all']) + ); + + if (! empty($_POST['bookmark_variable'])) { + $import_text = $bookmark->applyVariables( + $_POST['bookmark_variable'] + ); + } else { + $import_text = $bookmark->getQuery(); + } + + // refresh navigation and main panels + if (preg_match( + '/^(DROP)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', + $import_text + )) { + $GLOBALS['reload'] = true; + $ajax_reload['reload'] = true; + } + + // refresh navigation panel only + if (preg_match( + '/^(CREATE|ALTER)\s+(VIEW|TABLE|DATABASE|SCHEMA)\s+/i', + $import_text + ) + ) { + $ajax_reload['reload'] = true; + } + break; + case 1: // bookmarked query that have to be displayed + $bookmark = Bookmark::get( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $db, + $id_bookmark + ); + $import_text = $bookmark->getQuery(); + if ($response->isAjax()) { + $message = PhpMyAdmin\Message::success(__('Showing bookmark')); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('message', $message); + $response->addJSON('sql_query', $import_text); + $response->addJSON('action_bookmark', $_POST['action_bookmark']); + exit; + } else { + $run_query = false; + } + break; + case 2: // bookmarked query that have to be deleted + $bookmark = Bookmark::get( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $db, + $id_bookmark + ); + if (! empty($bookmark)) { + $bookmark->delete(); + if ($response->isAjax()) { + $message = PhpMyAdmin\Message::success( + __('The bookmark has been deleted.') + ); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('message', $message); + $response->addJSON('action_bookmark', $_POST['action_bookmark']); + $response->addJSON('id_bookmark', $id_bookmark); + exit; + } else { + $run_query = false; + $error = true; // this is kind of hack to skip processing the query + } + } + + break; + } +} // end bookmarks reading + +// Do no run query if we show PHP code +if (isset($GLOBALS['show_as_php'])) { + $run_query = false; + $go_sql = true; +} + +// We can not read all at once, otherwise we can run out of memory +$memory_limit = trim(ini_get('memory_limit')); +// 2 MB as default +if (empty($memory_limit)) { + $memory_limit = 2 * 1024 * 1024; +} +// In case no memory limit we work on 10MB chunks +if ($memory_limit == -1) { + $memory_limit = 10 * 1024 * 1024; +} + +// Calculate value of the limit +$memoryUnit = mb_strtolower(substr($memory_limit, -1)); +if ('m' == $memoryUnit) { + $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024; +} elseif ('k' == $memoryUnit) { + $memory_limit = (int)substr($memory_limit, 0, -1) * 1024; +} elseif ('g' == $memoryUnit) { + $memory_limit = (int)substr($memory_limit, 0, -1) * 1024 * 1024 * 1024; +} else { + $memory_limit = (int)$memory_limit; +} + +// Just to be sure, there might be lot of memory needed for uncompression +$read_limit = $memory_limit / 8; + +// handle filenames +if (isset($_FILES['import_file'])) { + $import_file = $_FILES['import_file']['tmp_name']; +} +if (! empty($local_import_file) && ! empty($cfg['UploadDir'])) { + + // sanitize $local_import_file as it comes from a POST + $local_import_file = Core::securePath($local_import_file); + + $import_file = PhpMyAdmin\Util::userDir($cfg['UploadDir']) + . $local_import_file; + + /* + * Do not allow symlinks to avoid security issues + * (user can create symlink to file he can not access, + * but phpMyAdmin can). + */ + if (@is_link($import_file)) { + $import_file = 'none'; + } + +} elseif (empty($import_file) || ! is_uploaded_file($import_file)) { + $import_file = 'none'; +} + +// Do we have file to import? + +if ($import_file != 'none' && ! $error) { + /** + * Handle file compression + */ + $import_handle = new File($import_file); + $import_handle->checkUploadedFile(); + if ($import_handle->isError()) { + Import::stop($import_handle->getError()); + } + $import_handle->setDecompressContent(true); + $import_handle->open(); + if ($import_handle->isError()) { + Import::stop($import_handle->getError()); + } +} elseif (! $error) { + if (! isset($import_text) || empty($import_text)) { + $message = PhpMyAdmin\Message::error( + __( + 'No data was received to import. Either no file name was ' . + 'submitted, or the file size exceeded the maximum size permitted ' . + 'by your PHP configuration. See [doc@faq1-16]FAQ 1.16[/doc].' + ) + ); + Import::stop($message); + } +} + +// so we can obtain the message +//$_SESSION['Import_message'] = $message->getDisplay(); + +// Convert the file's charset if necessary +if (Encoding::isSupported() && isset($charset_of_file)) { + if ($charset_of_file != 'utf-8') { + $charset_conversion = true; + } +} elseif (isset($charset_of_file) && $charset_of_file != 'utf-8') { + $GLOBALS['dbi']->query('SET NAMES \'' . $charset_of_file . '\''); + // We can not show query in this case, it is in different charset + $sql_query_disabled = true; + $reset_charset = true; +} + +// Something to skip? (because timeout has passed) +if (! $error && isset($_POST['skip'])) { + $original_skip = $skip = intval($_POST['skip']); + while ($skip > 0 && ! $finished) { + Import::getNextChunk($skip < $read_limit ? $skip : $read_limit); + // Disable read progressivity, otherwise we eat all memory! + $read_multiply = 1; + $skip -= $read_limit; + } + unset($skip); +} + +// This array contain the data like numberof valid sql queries in the statement +// and complete valid sql statement (which affected for rows) +$sql_data = array('valid_sql' => array(), 'valid_queries' => 0); + +if (! $error) { + /* @var $import_plugin ImportPlugin */ + $import_plugin = Plugins::getPlugin( + "import", + $format, + 'libraries/classes/Plugins/Import/', + $import_type + ); + if ($import_plugin == null) { + $message = PhpMyAdmin\Message::error( + __('Could not load import plugins, please check your installation!') + ); + Import::stop($message); + } else { + // Do the real import + try { + $default_fk_check = PhpMyAdmin\Util::handleDisableFKCheckInit(); + $import_plugin->doImport($sql_data); + PhpMyAdmin\Util::handleDisableFKCheckCleanup($default_fk_check); + } catch (Exception $e) { + PhpMyAdmin\Util::handleDisableFKCheckCleanup($default_fk_check); + throw $e; + } + } +} + +if (isset($import_handle)) { + $import_handle->close(); +} + +// Cleanup temporary file +if ($file_to_unlink != '') { + unlink($file_to_unlink); +} + +// Reset charset back, if we did some changes +if ($reset_charset) { + $GLOBALS['dbi']->query('SET CHARACTER SET ' . $GLOBALS['charset_connection']); + $GLOBALS['dbi']->setCollation($collation_connection); +} + +// Show correct message +if (! empty($id_bookmark) && $_POST['action_bookmark'] == 2) { + $message = PhpMyAdmin\Message::success(__('The bookmark has been deleted.')); + $display_query = $import_text; + $error = false; // unset error marker, it was used just to skip processing +} elseif (! empty($id_bookmark) && $_POST['action_bookmark'] == 1) { + $message = PhpMyAdmin\Message::notice(__('Showing bookmark')); +} elseif ($bookmark_created) { + $special_message = '[br]' . sprintf( + __('Bookmark %s has been created.'), + htmlspecialchars($_POST['bkm_label']) + ); +} elseif ($finished && ! $error) { + // Do not display the query with message, we do it separately + $display_query = ';'; + if ($import_type != 'query') { + $message = PhpMyAdmin\Message::success( + '' + . _ngettext( + 'Import has been successfully finished, %d query executed.', + 'Import has been successfully finished, %d queries executed.', + $executed_queries + ) + . '' + ); + $message->addParam($executed_queries); + + if (! empty($import_notice)) { + $message->addHtml($import_notice); + } + if (! empty($local_import_file)) { + $message->addText('(' . $local_import_file . ')'); + } else { + $message->addText('(' . $_FILES['import_file']['name'] . ')'); + } + } +} + +// Did we hit timeout? Tell it user. +if ($timeout_passed) { + $urlparams['timeout_passed'] = '1'; + $urlparams['offset'] = $GLOBALS['offset']; + if (isset($local_import_file)) { + $urlparams['local_import_file'] = $local_import_file; + } + + $importUrl = $err_url = $goto . Url::getCommon($urlparams); + + $message = PhpMyAdmin\Message::error( + __( + 'Script timeout passed, if you want to finish import,' + . ' please %sresubmit the same file%s and import will resume.' + ) + ); + $message->addParamHtml(''); + $message->addParamHtml(''); + + if ($offset == 0 || (isset($original_skip) && $original_skip == $offset)) { + $message->addText( + __( + 'However on last run no data has been parsed,' + . ' this usually means phpMyAdmin won\'t be able to' + . ' finish this import unless you increase php time limits.' + ) + ); + } +} + +// if there is any message, copy it into $_SESSION as well, +// so we can obtain it by AJAX call +if (isset($message)) { + $_SESSION['Import_message']['message'] = $message->getDisplay(); +} +// Parse and analyze the query, for correct db and table name +// in case of a query typed in the query window +// (but if the query is too large, in case of an imported file, the parser +// can choke on it so avoid parsing) +$sqlLength = mb_strlen($sql_query); +if ($sqlLength <= $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) { + list( + $analyzed_sql_results, + $db, + $table_from_sql + ) = ParseAnalyze::sqlQuery($sql_query, $db); + // @todo: possibly refactor + extract($analyzed_sql_results); + + if ($table != $table_from_sql && !empty($table_from_sql)) { + $table = $table_from_sql; + } +} + +// There was an error? +if (isset($my_die)) { + foreach ($my_die as $key => $die) { + PhpMyAdmin\Util::mysqlDie( + $die['error'], $die['sql'], false, $err_url, $error + ); + } +} + +if ($go_sql) { + + if (! empty($sql_data) && ($sql_data['valid_queries'] > 1)) { + $_SESSION['is_multi_query'] = true; + $sql_queries = $sql_data['valid_sql']; + } else { + $sql_queries = array($sql_query); + } + + $html_output = ''; + + foreach ($sql_queries as $sql_query) { + + // parse sql query + list( + $analyzed_sql_results, + $db, + $table_from_sql + ) = ParseAnalyze::sqlQuery($sql_query, $db); + // @todo: possibly refactor + extract($analyzed_sql_results); + + // Check if User is allowed to issue a 'DROP DATABASE' Statement + if ($sql->hasNoRightsToDropDatabase( + $analyzed_sql_results, $cfg['AllowUserDropDatabase'], $GLOBALS['dbi']->isSuperuser() + )) { + PhpMyAdmin\Util::mysqlDie( + __('"DROP DATABASE" statements are disabled.'), + '', + false, + $_SESSION['Import_message']['go_back_url'] + ); + return; + } // end if + + if ($table != $table_from_sql && !empty($table_from_sql)) { + $table = $table_from_sql; + } + + $html_output .= $sql->executeQueryAndGetQueryResponse( + $analyzed_sql_results, // analyzed_sql_results + false, // is_gotofile + $db, // db + $table, // table + null, // find_real_end + null, // sql_query_for_bookmark - see below + null, // extra_data + null, // message_to_show + null, // message + null, // sql_data + $goto, // goto + $pmaThemeImage, // pmaThemeImage + null, // disp_query + null, // disp_message + null, // query_type + $sql_query, // sql_query + null, // selectedTables + null // complete_query + ); + } + + // sql_query_for_bookmark is not included in Sql::executeQueryAndGetQueryResponse + // since only one bookmark has to be added for all the queries submitted through + // the SQL tab + if (! empty($_POST['bkm_label']) && ! empty($import_text)) { + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + $sql->storeTheQueryAsBookmark( + $db, $cfgBookmark['user'], + $_POST['sql_query'], $_POST['bkm_label'], + isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null + ); + } + + $response->addJSON('ajax_reload', $ajax_reload); + $response->addHTML($html_output); + exit(); + +} elseif ($result) { + // Save a Bookmark with more than one queries (if Bookmark label given). + if (! empty($_POST['bkm_label']) && ! empty($import_text)) { + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + $sql->storeTheQueryAsBookmark( + $db, $cfgBookmark['user'], + $_POST['sql_query'], $_POST['bkm_label'], + isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null + ); + } + + $response->setRequestStatus(true); + $response->addJSON('message', PhpMyAdmin\Message::success($msg)); + $response->addJSON( + 'sql_query', + PhpMyAdmin\Util::getMessage($msg, $sql_query, 'success') + ); +} elseif ($result == false) { + $response->setRequestStatus(false); + $response->addJSON('message', PhpMyAdmin\Message::error($msg)); +} else { + $active_page = $goto; + include '' . $goto; +} + +// If there is request for ROLLBACK in the end. +if (isset($_POST['rollback_query'])) { + $GLOBALS['dbi']->query('ROLLBACK'); +} diff --git a/phpMyAdmin/import_status.php b/phpMyAdmin/import_status.php new file mode 100755 index 0000000..184c3a0 --- /dev/null +++ b/phpMyAdmin/import_status.php @@ -0,0 +1,122 @@ + $value) { + // only copy session-prefixed data + if (substr($key, 0, strlen(UPLOAD_PREFIX)) + == UPLOAD_PREFIX) { + $sessionupload[$key] = $value; + } + } + // PMA will kill all variables, so let's use a constant + define('SESSIONUPLOAD', serialize($sessionupload)); + session_write_close(); + + // The cookie name is not good anymore since PR #15273 + session_name('phpMyAdmin'); + session_id($_COOKIE['phpMyAdmin']); +} + */ + +define('PMA_MINIMUM_COMMON', 1); + +require_once 'libraries/common.inc.php'; +list( + $SESSION_KEY, + $upload_id, + $plugins +) = ImportAjax::uploadProgressSetup(); + +/* +if (defined('SESSIONUPLOAD')) { + // write sessionupload back into the loaded PMA session + + $sessionupload = unserialize(SESSIONUPLOAD); + foreach ($sessionupload as $key => $value) { + $_SESSION[$key] = $value; + } + + // remove session upload data that are not set anymore + foreach ($_SESSION as $key => $value) { + if (substr($key, 0, strlen(UPLOAD_PREFIX)) + == UPLOAD_PREFIX + && ! isset($sessionupload[$key]) + ) { + unset($_SESSION[$key]); + } + } +} + */ + +// $_GET["message"] is used for asking for an import message +if (isset($_GET["message"]) && $_GET["message"]) { + + // AJAX requests can't be cached! + Core::noCacheHeader(); + + header('Content-type: text/html'); + + // wait 0.3 sec before we check for $_SESSION variable, + // which is set inside import.php + usleep(300000); + + $maximumTime = ini_get('max_execution_time'); + $timestamp = time(); + // wait until message is available + while ($_SESSION['Import_message']['message'] == null) { + // close session before sleeping + session_write_close(); + // sleep + usleep(250000); // 0.25 sec + // reopen session + session_start(); + + if ((time() - $timestamp) > $maximumTime) { + $_SESSION['Import_message']['message'] = PhpMyAdmin\Message::error( + __('Could not load the progress of the import.') + )->getDisplay(); + break; + } + } + + echo $_SESSION['Import_message']['message']; + echo '
' , "\n"; + echo ' [ ' , __('Back') , ' ]' , "\n"; + echo '
' , "\n"; + +} else { + ImportAjax::status($_GET["id"]); +} diff --git a/phpMyAdmin/index.php b/phpMyAdmin/index.php new file mode 100755 index 0000000..9ed6010 --- /dev/null +++ b/phpMyAdmin/index.php @@ -0,0 +1,691 @@ +setUserValue( + null, + 'FontSize', + $_POST['set_fontsize'], + '82%' + ); + header('Location: index.php' . Url::getCommonRaw()); + exit(); +} +// if user selected a theme +if (isset($_POST['set_theme'])) { + $tmanager = ThemeManager::getInstance(); + $tmanager->setActiveTheme($_POST['set_theme']); + $tmanager->setThemeCookie(); + + $userPreferences = new UserPreferences(); + $prefs = $userPreferences->load(); + $prefs["config_data"]["ThemeDefault"] = $_POST['set_theme']; + $userPreferences->save($prefs["config_data"]); + + header('Location: index.php' . Url::getCommonRaw()); + exit(); +} +// Change collation connection +if (isset($_POST['collation_connection'])) { + $GLOBALS['PMA_Config']->setUserValue( + null, + 'DefaultConnectionCollation', + $_POST['collation_connection'], + 'utf8mb4_unicode_ci' + ); + header('Location: index.php' . Url::getCommonRaw()); + exit(); +} + + +// See FAQ 1.34 +if (! empty($_REQUEST['db'])) { + $page = null; + if (! empty($_REQUEST['table'])) { + $page = Util::getScriptNameForOption( + $GLOBALS['cfg']['DefaultTabTable'], 'table' + ); + } else { + $page = Util::getScriptNameForOption( + $GLOBALS['cfg']['DefaultTabDatabase'], 'database' + ); + } + include $page; + exit; +} + +$response = Response::getInstance(); +/** + * Check if it is an ajax request to reload the recent tables list. + */ +if ($response->isAjax() && ! empty($_REQUEST['recent_table'])) { + $response->addJSON( + 'list', + RecentFavoriteTable::getInstance('recent')->getHtmlList() + ); + exit; +} + +if ($GLOBALS['PMA_Config']->isGitRevision()) { + // If ajax request to get revision + if (isset($_REQUEST['git_revision']) && $response->isAjax()) { + GitRevision::display(); + exit; + } + // Else show empty html + echo '
'; +} + +// Handles some variables that may have been sent by the calling script +$GLOBALS['db'] = ''; +$GLOBALS['table'] = ''; +$show_query = '1'; + +// Any message to display? +if (! empty($message)) { + echo Util::getMessage($message); + unset($message); +} +if (isset($_SESSION['partial_logout'])) { + Message::success( + __('You were logged out from one server, to logout completely from phpMyAdmin, you need to logout from all servers.') + )->display(); + unset($_SESSION['partial_logout']); +} + +$common_url_query = Url::getCommon(); +$mysql_cur_user_and_host = ''; + +// when $server > 0, a server has been chosen so we can display +// all MySQL-related information +if ($server > 0) { + include 'libraries/server_common.inc.php'; + + // Use the verbose name of the server instead of the hostname + // if a value is set + $server_info = ''; + if (! empty($cfg['Server']['verbose'])) { + $server_info .= htmlspecialchars($cfg['Server']['verbose']); + if ($GLOBALS['cfg']['ShowServerInfo']) { + $server_info .= ' ('; + } + } + if ($GLOBALS['cfg']['ShowServerInfo'] || empty($cfg['Server']['verbose'])) { + $server_info .= $GLOBALS['dbi']->getHostInfo(); + } + if (! empty($cfg['Server']['verbose']) && $GLOBALS['cfg']['ShowServerInfo']) { + $server_info .= ')'; + } + $mysql_cur_user_and_host = $GLOBALS['dbi']->fetchValue('SELECT USER();'); + + // should we add the port info here? + $short_server_info = (!empty($GLOBALS['cfg']['Server']['verbose']) + ? $GLOBALS['cfg']['Server']['verbose'] + : $GLOBALS['cfg']['Server']['host']); +} + +echo '
' , "\n"; +// Anchor for favorite tables synchronization. +echo RecentFavoriteTable::getInstance('favorite')->getHtmlSyncFavoriteTables(); +echo '
'; +if ($server > 0 || count($cfg['Servers']) > 1 +) { + if ($cfg['DBG']['demo']) { + echo '
'; + echo '

' , __('phpMyAdmin Demo Server') , '

'; + echo '

'; + printf( + __( + 'You are using the demo server. You can do anything here, but ' + . 'please do not change root, debian-sys-maint and pma users. ' + . 'More information is available at %s.' + ), + 'demo.phpmyadmin.net' + ); + echo '

'; + echo '
'; + } + echo '
'; + echo '

' , __('General settings') , '

'; + echo '
    '; + + /** + * Displays the MySQL servers choice form + */ + if ($cfg['ServerDefault'] == 0 + || (! $cfg['NavigationDisplayServers'] + && (count($cfg['Servers']) > 1 + || ($server == 0 && count($cfg['Servers']) == 1))) + ) { + echo '
  • '; + echo Util::getImage('s_host') , " " + , Select::render(true, true); + echo '
  • '; + } + + /** + * Displays the mysql server related links + */ + if ($server > 0) { + include_once 'libraries/check_user_privileges.inc.php'; + + // Logout for advanced authentication + if ($cfg['Server']['auth_type'] != 'config') { + if ($cfg['ShowChgPassword']) { + $conditional_class = 'ajax'; + Core::printListItem( + Util::getImage('s_passwd') . " " . __( + 'Change password' + ), + 'li_change_password', + 'user_password.php' . $common_url_query, + null, + null, + 'change_password_anchor', + "no_bullets", + $conditional_class + ); + } + } // end if + echo '
  • '; + echo '
    ' , "\n" + . Url::getHiddenInputs(null, null, 4, 'collation_connection') + . ' ' . "\n" + + . Charsets::getCollationDropdownBox( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['DisableIS'], + 'collation_connection', + 'select_collation_connection', + $collation_connection, + true, + true + ) + . '
    ' . "\n" + . '
  • ' . "\n"; + } // end of if ($server > 0) + echo '
'; + echo '
'; +} + +echo '
'; +echo '

' , __('Appearance settings') , '

'; +echo '
    '; + +// Displays language selection combo +$language_manager = LanguageManager::getInstance(); +if (empty($cfg['Lang']) && $language_manager->hasChoice()) { + echo '
  • '; + + echo Util::getImage('s_lang') , " " + , $language_manager->getSelectorDisplay(); + echo '
  • '; +} + +// ThemeManager if available + +if ($GLOBALS['cfg']['ThemeManager']) { + echo '
  • '; + echo Util::getImage('s_theme') , " " + , ThemeManager::getInstance()->getHtmlSelectBox(); + echo '
  • '; +} +echo '
  • '; +echo Config::getFontsizeForm(); +echo '
  • '; + +echo '
'; + +// User preferences + +if ($server > 0) { + echo '
    '; + Core::printListItem( + Util::getImage('b_tblops') . " " . __( + 'More settings' + ), + 'li_user_preferences', + 'prefs_manage.php' . $common_url_query, + null, + null, + null, + "no_bullets" + ); + echo '
'; +} + +echo '
'; + + +echo '
'; +echo '
'; + + +if ($server > 0 && $GLOBALS['cfg']['ShowServerInfo']) { + + echo '
'; + echo '

' , __('Database server') , '

'; + echo '
    ' , "\n"; + Core::printListItem( + __('Server:') . ' ' . $server_info, + 'li_server_info' + ); + Core::printListItem( + __('Server type:') . ' ' . Util::getServerType(), + 'li_server_type' + ); + Core::printListItem( + __('Server connection:') . ' ' . Util::getServerSSL(), + 'li_server_type' + ); + Core::printListItem( + __('Server version:') + . ' ' + . $GLOBALS['dbi']->getVersionString() . ' - ' . $GLOBALS['dbi']->getVersionComment(), + 'li_server_version' + ); + Core::printListItem( + __('Protocol version:') . ' ' . $GLOBALS['dbi']->getProtoInfo(), + 'li_mysql_proto' + ); + Core::printListItem( + __('User:') . ' ' . htmlspecialchars($mysql_cur_user_and_host), + 'li_user_info' + ); + + echo '
  • '; + echo ' ' , __('Server charset:') , ' ' + . ' '; + + $charset = Charsets::getServerCharset($GLOBALS['dbi']); + $charsets = Charsets::getMySQLCharsetsDescriptions( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['DisableIS'] + ); + + echo ' ' , (isset($charsets[$charset]) ? $charsets[$charset] : '') , ' (' . $charset, ')'; + echo ' ' + . '
  • ' + . '
' + . '
'; +} + +if ($GLOBALS['cfg']['ShowServerInfo'] || $GLOBALS['cfg']['ShowPhpInfo']) { + echo '
'; + echo '

' , __('Web server') , '

'; + echo '
    '; + if ($GLOBALS['cfg']['ShowServerInfo']) { + Core::printListItem($_SERVER['SERVER_SOFTWARE'], 'li_web_server_software'); + + if ($server > 0) { + $client_version_str = $GLOBALS['dbi']->getClientInfo(); + if (preg_match('#\d+\.\d+\.\d+#', $client_version_str)) { + $client_version_str = 'libmysql - ' . $client_version_str; + } + Core::printListItem( + __('Database client version:') . ' ' . $client_version_str, + 'li_mysql_client_version' + ); + + $php_ext_string = __('PHP extension:') . ' '; + + $extensions = Util::listPHPExtensions(); + + foreach ($extensions as $extension) { + $php_ext_string .= ' ' . $extension + . Util::showPHPDocu('book.' . $extension . '.php'); + } + + Core::printListItem( + $php_ext_string, + 'li_used_php_extension' + ); + + $php_version_string = __('PHP version:') . ' ' . phpversion(); + + Core::printListItem( + $php_version_string, + 'li_used_php_version' + ); + } + } + + if ($cfg['ShowPhpInfo']) { + Core::printListItem( + __('Show PHP information'), + 'li_phpinfo', + 'phpinfo.php' . $common_url_query, + null, + '_blank' + ); + } + echo '
'; + echo '
'; +} + +echo '
'; +echo '

phpMyAdmin

'; +echo '
    '; +$class = null; +if ($GLOBALS['cfg']['VersionCheck']) { + $class = 'jsversioncheck'; +} +Core::printListItem( + __('Version information:') . ' ' . PMA_VERSION . '', + 'li_pma_version', + null, + null, + null, + null, + $class +); +Core::printListItem( + __('Documentation'), + 'li_pma_docs', + Util::getDocuLink('index'), + null, + '_blank' +); + +// does not work if no target specified, don't know why +Core::printListItem( + __('Official Homepage'), + 'li_pma_homepage', + Core::linkURL('https://www.phpmyadmin.net/'), + null, + '_blank' +); +Core::printListItem( + __('Contribute'), + 'li_pma_contribute', + Core::linkURL('https://www.phpmyadmin.net/contribute/'), + null, + '_blank' +); +Core::printListItem( + __('Get support'), + 'li_pma_support', + Core::linkURL('https://www.phpmyadmin.net/support/'), + null, + '_blank' +); +Core::printListItem( + __('List of changes'), + 'li_pma_changes', + 'changelog.php' . Url::getCommon(), + null, + '_blank' +); +Core::printListItem( + __('License'), + 'li_pma_license', + 'license.php' . Url::getCommon(), + null, + '_blank' +); +echo '
'; +echo '
'; + +echo '
'; + +echo '
'; + +/** + * mbstring is used for handling multibytes inside parser, so it is good + * to tell user something might be broken without it, see bug #1063149. + */ +if (! extension_loaded('mbstring')) { + trigger_error( + __( + 'The mbstring PHP extension was not found and you seem to be using' + . ' a multibyte charset. Without the mbstring extension phpMyAdmin' + . ' is unable to split strings correctly and it may result in' + . ' unexpected results.' + ), + E_USER_WARNING + ); +} + +/** + * Missing functionality + */ +if (! extension_loaded('curl') && ! ini_get('allow_url_fopen')) { + trigger_error( + __( + 'The curl extension was not found and allow_url_fopen is ' + . 'disabled. Due to this some features such as error reporting ' + . 'or version check are disabled.' + ) + ); +} + +if ($cfg['LoginCookieValidityDisableWarning'] == false) { + /** + * Check whether session.gc_maxlifetime limits session validity. + */ + $gc_time = (int)ini_get('session.gc_maxlifetime'); + if ($gc_time < $GLOBALS['cfg']['LoginCookieValidity'] ) { + trigger_error( + __( + 'Your PHP parameter [a@https://secure.php.net/manual/en/session.' . + 'configuration.php#ini.session.gc-maxlifetime@_blank]session.' . + 'gc_maxlifetime[/a] is lower than cookie validity configured ' . + 'in phpMyAdmin, because of this, your login might expire sooner ' . + 'than configured in phpMyAdmin.' + ), + E_USER_WARNING + ); + } +} + +/** + * Check whether LoginCookieValidity is limited by LoginCookieStore. + */ +if ($GLOBALS['cfg']['LoginCookieStore'] != 0 + && $GLOBALS['cfg']['LoginCookieStore'] < $GLOBALS['cfg']['LoginCookieValidity'] +) { + trigger_error( + __( + 'Login cookie store is lower than cookie validity configured in ' . + 'phpMyAdmin, because of this, your login will expire sooner than ' . + 'configured in phpMyAdmin.' + ), + E_USER_WARNING + ); +} + +/** + * Check if user does not have defined blowfish secret and it is being used. + */ +if (! empty($_SESSION['encryption_key'])) { + if (empty($GLOBALS['cfg']['blowfish_secret'])) { + trigger_error( + __( + 'The configuration file now needs a secret passphrase (blowfish_secret).' + ), + E_USER_WARNING + ); + } elseif (strlen($GLOBALS['cfg']['blowfish_secret']) < 32) { + trigger_error( + __( + 'The secret passphrase in configuration (blowfish_secret) is too short.' + ), + E_USER_WARNING + ); + } +} + +/** + * Check for existence of config directory which should not exist in + * production environment. + */ +if (@file_exists('config')) { + trigger_error( + __( + 'Directory [code]config[/code], which is used by the setup script, ' . + 'still exists in your phpMyAdmin directory. It is strongly ' . + 'recommended to remove it once phpMyAdmin has been configured. ' . + 'Otherwise the security of your server may be compromised by ' . + 'unauthorized people downloading your configuration.' + ), + E_USER_WARNING + ); +} + +$relation = new Relation(); + +if ($server > 0) { + $cfgRelation = $relation->getRelationsParam(); + if (! $cfgRelation['allworks'] + && $cfg['PmaNoRelation_DisableWarning'] == false + ) { + $msg_text = __( + 'The phpMyAdmin configuration storage is not completely ' + . 'configured, some extended features have been deactivated. ' + . '%sFind out why%s. ' + ); + if ($cfg['ZeroConf'] == true) { + $msg_text .= '
' . + __( + 'Or alternately go to \'Operations\' tab of any database ' + . 'to set it up there.' + ); + } + $msg = Message::notice($msg_text); + $msg->addParamHtml(''); + $msg->addParamHtml(''); + /* Show error if user has configured something, notice elsewhere */ + if (!empty($cfg['Servers'][$server]['pmadb'])) { + $msg->isError(true); + } + $msg->display(); + } // end if +} + +/** + * Warning about Suhosin only if its simulation mode is not enabled + */ +if ($cfg['SuhosinDisableWarning'] == false + && ini_get('suhosin.request.max_value_length') + && ini_get('suhosin.simulation') == '0' +) { + trigger_error( + sprintf( + __( + 'Server running with Suhosin. Please refer to %sdocumentation%s ' . + 'for possible issues.' + ), + '[doc@faq1-38]', + '[/doc]' + ), + E_USER_WARNING + ); +} + +/* Missing template cache */ +if (is_null($GLOBALS['PMA_Config']->getTempDir('twig'))) { + trigger_error( + sprintf( + __('The $cfg[\'TempDir\'] (%s) is not accessible. phpMyAdmin is not able to cache templates and will be slow because of this.'), + $GLOBALS['PMA_Config']->get('TempDir') + ), + E_USER_WARNING + ); +} + +/** + * Warning about incomplete translations. + * + * The data file is created while creating release by ./scripts/remove-incomplete-mo + */ +if (@file_exists('libraries/language_stats.inc.php')) { + include 'libraries/language_stats.inc.php'; + /* + * This message is intentionally not translated, because we're + * handling incomplete translations here and focus on english + * speaking users. + */ + if (isset($GLOBALS['language_stats'][$lang]) + && $GLOBALS['language_stats'][$lang] < $cfg['TranslationWarningThreshold'] + ) { + trigger_error( + 'You are using an incomplete translation, please help to make it ' + . 'better by [a@https://www.phpmyadmin.net/translate/' + . '@_blank]contributing[/a].', + E_USER_NOTICE + ); + } +} diff --git a/phpMyAdmin/js/ajax.js b/phpMyAdmin/js/ajax.js new file mode 100755 index 0000000..8197612 --- /dev/null +++ b/phpMyAdmin/js/ajax.js @@ -0,0 +1,834 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * This object handles ajax requests for pages. It also + * handles the reloading of the main menu and scripts. + */ +var AJAX = { + /** + * @var bool active Whether we are busy + */ + active: false, + /** + * @var object source The object whose event initialized the request + */ + source: null, + /** + * @var object xhr A reference to the ajax request that is currently running + */ + xhr: null, + /** + * @var object lockedTargets, list of locked targets + */ + lockedTargets: {}, + /** + * @var function Callback to execute after a successful request + * Used by PMA_commonFunctions from common.js + */ + _callback: function () {}, + /** + * @var bool _debug Makes noise in your Firebug console + */ + _debug: false, + /** + * @var object $msgbox A reference to a jQuery object that links to a message + * box that is generated by PMA_ajaxShowMessage() + */ + $msgbox: null, + /** + * Given the filename of a script, returns a hash to be + * used to refer to all the events registered for the file + * + * @param key string key The filename for which to get the event name + * + * @return int + */ + hash: function (key) { + /* http://burtleburtle.net/bob/hash/doobs.html#one */ + key += ''; + var len = key.length; + var hash = 0; + var i = 0; + for (; i < len; ++i) { + hash += key.charCodeAt(i); + hash += (hash << 10); + hash ^= (hash >> 6); + } + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + return Math.abs(hash); + }, + /** + * Registers an onload event for a file + * + * @param file string file The filename for which to register the event + * @param func function func The function to execute when the page is ready + * + * @return self For chaining + */ + registerOnload: function (file, func) { + var eventName = 'onload_' + AJAX.hash(file); + $(document).on(eventName, func); + if (this._debug) { + console.log( + // no need to translate + 'Registered event ' + eventName + ' for file ' + file + ); + } + return this; + }, + /** + * Registers a teardown event for a file. This is useful to execute functions + * that unbind events for page elements that are about to be removed. + * + * @param string file The filename for which to register the event + * @param function func The function to execute when + * the page is about to be torn down + * + * @return self For chaining + */ + registerTeardown: function (file, func) { + var eventName = 'teardown_' + AJAX.hash(file); + $(document).on(eventName, func); + if (this._debug) { + console.log( + // no need to translate + 'Registered event ' + eventName + ' for file ' + file + ); + } + return this; + }, + /** + * Called when a page has finished loading, once for every + * file that registered to the onload event of that file. + * + * @param string file The filename for which to fire the event + * + * @return void + */ + fireOnload: function (file) { + var eventName = 'onload_' + AJAX.hash(file); + $(document).trigger(eventName); + if (this._debug) { + console.log( + // no need to translate + 'Fired event ' + eventName + ' for file ' + file + ); + } + }, + /** + * Called just before a page is torn down, once for every + * file that registered to the teardown event of that file. + * + * @param string file The filename for which to fire the event + * + * @return void + */ + fireTeardown: function (file) { + var eventName = 'teardown_' + AJAX.hash(file); + $(document).triggerHandler(eventName); + if (this._debug) { + console.log( + // no need to translate + 'Fired event ' + eventName + ' for file ' + file + ); + } + }, + /** + * function to handle lock page mechanism + * + * @param event the event object + * + * @return void + */ + lockPageHandler: function (event) { + var newHash = null; + var oldHash = null; + var lockId; + // CodeMirror lock + if (event.data.value === 3) { + newHash = event.data.content; + oldHash = true; + lockId = 'cm'; + } else { + // Don't lock on enter. + if (0 === event.charCode) { + return; + } + + lockId = $(this).data('lock-id'); + if (typeof lockId === 'undefined') { + return; + } + /* + * @todo Fix Code mirror does not give correct full value (query) + * in textarea, it returns only the change in content. + */ + if (event.data.value === 1) { + newHash = AJAX.hash($(this).val()); + } else { + newHash = AJAX.hash($(this).is(':checked')); + } + oldHash = $(this).data('val-hash'); + } + // Set lock if old value !== new value + // otherwise release lock + if (oldHash !== newHash) { + AJAX.lockedTargets[lockId] = true; + } else { + delete AJAX.lockedTargets[lockId]; + } + // Show lock icon if locked targets is not empty. + // otherwise remove lock icon + if (!jQuery.isEmptyObject(AJAX.lockedTargets)) { + $('#lock_page_icon').html(PMA_getImage('s_lock', PMA_messages.strLockToolTip).toString()); + } else { + $('#lock_page_icon').html(''); + } + }, + /** + * resets the lock + * + * @return void + */ + resetLock: function () { + AJAX.lockedTargets = {}; + $('#lock_page_icon').html(''); + }, + handleMenu: { + replace: function (content) { + $('#floating_menubar').html(content) + // Remove duplicate wrapper + // TODO: don't send it in the response + .children().first().remove(); + $('#topmenu').menuResizer(PMA_mainMenuResizerCallback); + } + }, + /** + * Event handler for clicks on links and form submissions + * + * @param object e Event data + * + * @return void + */ + requestHandler: function (event) { + // In some cases we don't want to handle the request here and either + // leave the browser deal with it natively (e.g: file download) + // or leave an existing ajax event handler present elsewhere deal with it + var href = $(this).attr('href'); + if (typeof event !== 'undefined' && (event.shiftKey || event.ctrlKey)) { + return true; + } else if ($(this).attr('target')) { + return true; + } else if ($(this).hasClass('ajax') || $(this).hasClass('disableAjax')) { + // reset the lockedTargets object, as specified AJAX operation has finished + AJAX.resetLock(); + return true; + } else if (href && href.match(/^#/)) { + return true; + } else if (href && href.match(/^mailto/)) { + return true; + } else if ($(this).hasClass('ui-datepicker-next') || + $(this).hasClass('ui-datepicker-prev') + ) { + return true; + } + + if (typeof event !== 'undefined') { + event.preventDefault(); + event.stopImmediatePropagation(); + } + + // triggers a confirm dialog if: + // the user has performed some operations on loaded page + // the user clicks on some link, (won't trigger for buttons) + // the click event is not triggered by script + if (typeof event !== 'undefined' && event.type === 'click' && + event.isTrigger !== true && + !jQuery.isEmptyObject(AJAX.lockedTargets) && + confirm(PMA_messages.strConfirmNavigation) === false + ) { + return false; + } + AJAX.resetLock(); + var isLink = !! href || false; + var previousLinkAborted = false; + + if (AJAX.active === true) { + // Cancel the old request if abortable, when the user requests + // something else. Otherwise silently bail out, as there is already + // a request well in progress. + if (AJAX.xhr) { + // In case of a link request, attempt aborting + AJAX.xhr.abort(); + if (AJAX.xhr.status === 0 && AJAX.xhr.statusText === 'abort') { + // If aborted + AJAX.$msgbox = PMA_ajaxShowMessage(PMA_messages.strAbortedRequest); + AJAX.active = false; + AJAX.xhr = null; + previousLinkAborted = true; + } else { + // If can't abort + return false; + } + } else { + // In case submitting a form, don't attempt aborting + return false; + } + } + + AJAX.source = $(this); + + $('html, body').animate({ scrollTop: 0 }, 'fast'); + + var url = isLink ? href : $(this).attr('action'); + var argsep = PMA_commonParams.get('arg_separator'); + var params = 'ajax_request=true' + argsep + 'ajax_page_request=true'; + var dataPost = AJAX.source.getPostData(); + if (! isLink) { + params += argsep + $(this).serialize(); + } else if (dataPost) { + params += argsep + dataPost; + isLink = false; + } + if (! (history && history.pushState)) { + // Add a list of menu hashes that we have in the cache to the request + params += PMA_MicroHistory.menus.getRequestParam(); + } + + if (AJAX._debug) { + console.log('Loading: ' + url); // no need to translate + } + + if (isLink) { + AJAX.active = true; + AJAX.$msgbox = PMA_ajaxShowMessage(); + // Save reference for the new link request + AJAX.xhr = $.get(url, params, AJAX.responseHandler); + if (history && history.pushState) { + var state = { + url : href + }; + if (previousLinkAborted) { + // hack: there is already an aborted entry on stack + // so just modify the aborted one + history.replaceState(state, null, href); + } else { + history.pushState(state, null, href); + } + } + } else { + /** + * Manually fire the onsubmit event for the form, if any. + * The event was saved in the jQuery data object by an onload + * handler defined below. Workaround for bug #3583316 + */ + var onsubmit = $(this).data('onsubmit'); + // Submit the request if there is no onsubmit handler + // or if it returns a value that evaluates to true + if (typeof onsubmit !== 'function' || onsubmit.apply(this, [event])) { + AJAX.active = true; + AJAX.$msgbox = PMA_ajaxShowMessage(); + $.post(url, params, AJAX.responseHandler); + } + } + }, + /** + * Called after the request that was initiated by this.requestHandler() + * has completed successfully or with a caught error. For completely + * failed requests or requests with uncaught errors, see the .ajaxError + * handler at the bottom of this file. + * + * To refer to self use 'AJAX', instead of 'this' as this function + * is called in the jQuery context. + * + * @param object e Event data + * + * @return void + */ + responseHandler: function (data) { + if (typeof data === 'undefined' || data === null) { + return; + } + if (typeof data.success !== 'undefined' && data.success) { + $('html, body').animate({ scrollTop: 0 }, 'fast'); + PMA_ajaxRemoveMessage(AJAX.$msgbox); + + if (data._redirect) { + PMA_ajaxShowMessage(data._redirect, false); + AJAX.active = false; + AJAX.xhr = null; + return; + } + + AJAX.scriptHandler.reset(function () { + if (data._reloadNavigation) { + PMA_reloadNavigation(); + } + if (data._title) { + $('title').replaceWith(data._title); + } + if (data._menu) { + if (history && history.pushState) { + var state = { + url : data._selflink, + menu : data._menu + }; + history.replaceState(state, null); + AJAX.handleMenu.replace(data._menu); + } else { + PMA_MicroHistory.menus.replace(data._menu); + PMA_MicroHistory.menus.add(data._menuHash, data._menu); + } + } else if (data._menuHash) { + if (! (history && history.pushState)) { + PMA_MicroHistory.menus.replace(PMA_MicroHistory.menus.get(data._menuHash)); + } + } + if (data._disableNaviSettings) { + PMA_disableNaviSettings(); + } else { + PMA_ensureNaviSettings(data._selflink); + } + + // Remove all containers that may have + // been added outside of #page_content + $('body').children() + .not('#pma_navigation') + .not('#floating_menubar') + .not('#page_nav_icons') + .not('#page_content') + .not('#selflink') + .not('#pma_header') + .not('#pma_footer') + .not('#pma_demo') + .not('#pma_console_container') + .not('#prefs_autoload') + .remove(); + // Replace #page_content with new content + if (data.message && data.message.length > 0) { + $('#page_content').replaceWith( + '
' + data.message + '
' + ); + PMA_highlightSQL($('#page_content')); + checkNumberOfFields(); + } + + if (data._selflink) { + var source = data._selflink.split('?')[0]; + // Check for faulty links + $selflink_replace = { + 'import.php': 'tbl_sql.php', + 'tbl_chart.php': 'sql.php', + 'tbl_gis_visualization.php': 'sql.php' + }; + if ($selflink_replace[source]) { + var replacement = $selflink_replace[source]; + data._selflink = data._selflink.replace(source, replacement); + } + $('#selflink').find('> a').attr('href', data._selflink); + } + if (data._params) { + PMA_commonParams.setAll(data._params); + } + if (data._scripts) { + AJAX.scriptHandler.load(data._scripts); + } + if (data._selflink && data._scripts && data._menuHash && data._params) { + if (! (history && history.pushState)) { + PMA_MicroHistory.add( + data._selflink, + data._scripts, + data._menuHash, + data._params, + AJAX.source.attr('rel') + ); + } + } + if (data._displayMessage) { + $('#page_content').prepend(data._displayMessage); + PMA_highlightSQL($('#page_content')); + } + + $('#pma_errors').remove(); + + var msg = ''; + if (data._errSubmitMsg) { + msg = data._errSubmitMsg; + } + if (data._errors) { + $('
', { id : 'pma_errors', class : 'clearfloat' }) + .insertAfter('#selflink') + .append(data._errors); + // bind for php error reporting forms (bottom) + $('#pma_ignore_errors_bottom').on('click', function (e) { + e.preventDefault(); + PMA_ignorePhpErrors(); + }); + $('#pma_ignore_all_errors_bottom').on('click', function (e) { + e.preventDefault(); + PMA_ignorePhpErrors(false); + }); + // In case of 'sendErrorReport'='always' + // submit the hidden error reporting form. + if (data._sendErrorAlways === '1' && + data._stopErrorReportLoop !== '1' + ) { + $('#pma_report_errors_form').submit(); + PMA_ajaxShowMessage(PMA_messages.phpErrorsBeingSubmitted, false); + $('html, body').animate({ scrollTop:$(document).height() }, 'slow'); + } else if (data._promptPhpErrors) { + // otherwise just prompt user if it is set so. + msg = msg + PMA_messages.phpErrorsFound; + // scroll to bottom where all the errors are displayed. + $('html, body').animate({ scrollTop:$(document).height() }, 'slow'); + } + } + PMA_ajaxShowMessage(msg, false); + // bind for php error reporting forms (popup) + $('#pma_ignore_errors_popup').on('click', function () { + PMA_ignorePhpErrors(); + }); + $('#pma_ignore_all_errors_popup').on('click', function () { + PMA_ignorePhpErrors(false); + }); + + if (typeof AJAX._callback === 'function') { + AJAX._callback.call(); + } + AJAX._callback = function () {}; + }); + } else { + PMA_ajaxShowMessage(data.error, false); + AJAX.active = false; + AJAX.xhr = null; + PMA_handleRedirectAndReload(data); + if (data.fieldWithError) { + $(':input.error').removeClass('error'); + $('#' + data.fieldWithError).addClass('error'); + } + } + }, + /** + * This object is in charge of downloading scripts, + * keeping track of what's downloaded and firing + * the onload event for them when the page is ready. + */ + scriptHandler: { + /** + * @var array _scripts The list of files already downloaded + */ + _scripts: [], + /** + * @var string _scriptsVersion version of phpMyAdmin from which the + * scripts have been loaded + */ + _scriptsVersion: null, + /** + * @var array _scriptsToBeLoaded The list of files that + * need to be downloaded + */ + _scriptsToBeLoaded: [], + /** + * @var array _scriptsToBeFired The list of files for which + * to fire the onload and unload events + */ + _scriptsToBeFired: [], + _scriptsCompleted: false, + /** + * Records that a file has been downloaded + * + * @param string file The filename + * @param string fire Whether this file will be registering + * onload/teardown events + * + * @return self For chaining + */ + add: function (file, fire) { + this._scripts.push(file); + if (fire) { + // Record whether to fire any events for the file + // This is necessary to correctly tear down the initial page + this._scriptsToBeFired.push(file); + } + return this; + }, + /** + * Download a list of js files in one request + * + * @param array files An array of filenames and flags + * + * @return void + */ + load: function (files, callback) { + var self = this; + var i; + // Clear loaded scripts if they are from another version of phpMyAdmin. + // Depends on common params being set before loading scripts in responseHandler + if (self._scriptsVersion === null) { + self._scriptsVersion = PMA_commonParams.get('PMA_VERSION'); + } else if (self._scriptsVersion !== PMA_commonParams.get('PMA_VERSION')) { + self._scripts = []; + self._scriptsVersion = PMA_commonParams.get('PMA_VERSION'); + } + self._scriptsCompleted = false; + self._scriptsToBeFired = []; + // We need to first complete list of files to load + // as next loop will directly fire requests to load them + // and that triggers removal of them from + // self._scriptsToBeLoaded + for (i in files) { + self._scriptsToBeLoaded.push(files[i].name); + if (files[i].fire) { + self._scriptsToBeFired.push(files[i].name); + } + } + for (i in files) { + var script = files[i].name; + // Only for scripts that we don't already have + if ($.inArray(script, self._scripts) === -1) { + this.add(script); + this.appendScript(script, callback); + } else { + self.done(script, callback); + } + } + // Trigger callback if there is nothing else to load + self.done(null, callback); + }, + /** + * Called whenever all files are loaded + * + * @return void + */ + done: function (script, callback) { + if (typeof ErrorReport !== 'undefined') { + ErrorReport.wrap_global_functions(); + } + if ($.inArray(script, this._scriptsToBeFired)) { + AJAX.fireOnload(script); + } + if ($.inArray(script, this._scriptsToBeLoaded)) { + this._scriptsToBeLoaded.splice($.inArray(script, this._scriptsToBeLoaded), 1); + } + if (script === null) { + this._scriptsCompleted = true; + } + /* We need to wait for last signal (with null) or last script load */ + AJAX.active = (this._scriptsToBeLoaded.length > 0) || ! this._scriptsCompleted; + /* Run callback on last script */ + if (! AJAX.active && $.isFunction(callback)) { + callback(); + } + }, + /** + * Appends a script element to the head to load the scripts + * + * @return void + */ + appendScript: function (name, callback) { + var head = document.head || document.getElementsByTagName('head')[0]; + var script = document.createElement('script'); + var self = this; + + script.type = 'text/javascript'; + script.src = 'js/' + name + '?' + 'v=' + encodeURIComponent(PMA_commonParams.get('PMA_VERSION')); + script.async = false; + script.onload = function () { + self.done(name, callback); + }; + head.appendChild(script); + }, + /** + * Fires all the teardown event handlers for the current page + * and rebinds all forms and links to the request handler + * + * @param function callback The callback to call after resetting + * + * @return void + */ + reset: function (callback) { + for (var i in this._scriptsToBeFired) { + AJAX.fireTeardown(this._scriptsToBeFired[i]); + } + this._scriptsToBeFired = []; + /** + * Re-attach a generic event handler to clicks + * on pages and submissions of forms + */ + $(document).off('click', 'a').on('click', 'a', AJAX.requestHandler); + $(document).off('submit', 'form').on('submit', 'form', AJAX.requestHandler); + if (! (history && history.pushState)) { + PMA_MicroHistory.update(); + } + callback(); + } + } +}; + +/** + * Here we register a function that will remove the onsubmit event from all + * forms that will be handled by the generic page loader. We then save this + * event handler in the "jQuery data", so that we can fire it up later in + * AJAX.requestHandler(). + * + * See bug #3583316 + */ +AJAX.registerOnload('functions.js', function () { + // Registering the onload event for functions.js + // ensures that it will be fired for all pages + $('form').not('.ajax').not('.disableAjax').each(function () { + if ($(this).attr('onsubmit')) { + $(this).data('onsubmit', this.onsubmit).attr('onsubmit', ''); + } + }); + + var $page_content = $('#page_content'); + /** + * Workaround for passing submit button name,value on ajax form submit + * by appending hidden element with submit button name and value. + */ + $page_content.on('click', 'form input[type=submit]', function () { + var buttonName = $(this).attr('name'); + if (typeof buttonName === 'undefined') { + return; + } + $(this).closest('form').append($('', { + 'type' : 'hidden', + 'name' : buttonName, + 'value': $(this).val() + })); + }); + + /** + * Attach event listener to events when user modify visible + * Input,Textarea and select fields to make changes in forms + */ + $page_content.on( + 'keyup change', + 'form.lock-page textarea, ' + + 'form.lock-page input[type="text"], ' + + 'form.lock-page input[type="number"], ' + + 'form.lock-page select', + { value:1 }, + AJAX.lockPageHandler + ); + $page_content.on( + 'change', + 'form.lock-page input[type="checkbox"], ' + + 'form.lock-page input[type="radio"]', + { value:2 }, + AJAX.lockPageHandler + ); + /** + * Reset lock when lock-page form reset event is fired + * Note: reset does not bubble in all browser so attach to + * form directly. + */ + $('form.lock-page').on('reset', function (event) { + AJAX.resetLock(); + }); +}); + +/** + * Page load event handler + */ +$(function () { + var menuContent = $('
') + .append($('#serverinfo').clone()) + .append($('#topmenucontainer').clone()) + .html(); + if (history && history.pushState) { + // set initial state reload + var initState = ('state' in window.history && window.history.state !== null); + var initURL = $('#selflink').find('> a').attr('href') || location.href; + var state = { + url : initURL, + menu : menuContent + }; + history.replaceState(state, null); + + $(window).on('popstate', function (event) { + var initPop = (! initState && location.href === initURL); + initState = true; + // check if popstate fired on first page itself + if (initPop) { + return; + } + var state = event.originalEvent.state; + if (state && state.menu) { + AJAX.$msgbox = PMA_ajaxShowMessage(); + var params = 'ajax_request=true' + PMA_commonParams.get('arg_separator') + 'ajax_page_request=true'; + var url = state.url || location.href; + $.get(url, params, AJAX.responseHandler); + // TODO: Check if sometimes menu is not retrieved from server, + // Not sure but it seems menu was missing only for printview which + // been removed lately, so if it's right some dead menu checks/fallbacks + // may need to be removed from this file and Header.php + // AJAX.handleMenu.replace(event.originalEvent.state.menu); + } + }); + } else { + // Fallback to microhistory mechanism + AJAX.scriptHandler + .load([{ 'name' : 'microhistory.js', 'fire' : 1 }], function () { + // The cache primer is set by the footer class + if (PMA_MicroHistory.primer.url) { + PMA_MicroHistory.menus.add( + PMA_MicroHistory.primer.menuHash, + menuContent + ); + } + $(function () { + // Queue up this event twice to make sure that we get a copy + // of the page after all other onload events have been fired + if (PMA_MicroHistory.primer.url) { + PMA_MicroHistory.add( + PMA_MicroHistory.primer.url, + PMA_MicroHistory.primer.scripts, + PMA_MicroHistory.primer.menuHash + ); + } + }); + }); + } +}); + +/** + * Attach a generic event handler to clicks + * on pages and submissions of forms + */ +$(document).on('click', 'a', AJAX.requestHandler); +$(document).on('submit', 'form', AJAX.requestHandler); + +/** + * Gracefully handle fatal server errors + * (e.g: 500 - Internal server error) + */ +$(document).ajaxError(function (event, request, settings) { + if (AJAX._debug) { + console.log('AJAX error: status=' + request.status + ', text=' + request.statusText); + } + // Don't handle aborted requests + if (request.status !== 0 || request.statusText !== 'abort') { + var details = ''; + var state = request.state(); + + if (request.status !== 0) { + details += '
' + escapeHtml(PMA_sprintf(PMA_messages.strErrorCode, request.status)) + '
'; + } + details += '
' + escapeHtml(PMA_sprintf(PMA_messages.strErrorText, request.statusText + ' (' + state + ')')) + '
'; + if (state === 'rejected' || state === 'timeout') { + details += '
' + escapeHtml(PMA_messages.strErrorConnection) + '
'; + } + PMA_ajaxShowMessage( + '
' + + PMA_messages.strErrorProcessingRequest + + details + + '
', + false + ); + AJAX.active = false; + AJAX.xhr = null; + } +}); diff --git a/phpMyAdmin/js/chart.js b/phpMyAdmin/js/chart.js new file mode 100755 index 0000000..8145dac --- /dev/null +++ b/phpMyAdmin/js/chart.js @@ -0,0 +1,676 @@ +/** + * Chart type enumerations + */ +var ChartType = { + LINE : 'line', + SPLINE : 'spline', + AREA : 'area', + BAR : 'bar', + COLUMN : 'column', + PIE : 'pie', + TIMELINE: 'timeline', + SCATTER: 'scatter' +}; + +/** + * Column type enumeration + */ +var ColumnType = { + STRING : 'string', + NUMBER : 'number', + BOOLEAN : 'boolean', + DATE : 'date' +}; + +/** + * Abstract chart factory which defines the contract for chart factories + */ +var ChartFactory = function () { +}; +ChartFactory.prototype = { + createChart : function (type, options) { + throw new Error('createChart must be implemented by a subclass'); + } +}; + +/** + * Abstract chart which defines the contract for charts + * + * @param elementId + * id of the div element the chart is drawn in + */ +var Chart = function (elementId) { + this.elementId = elementId; +}; +Chart.prototype = { + draw : function (data, options) { + throw new Error('draw must be implemented by a subclass'); + }, + redraw : function (options) { + throw new Error('redraw must be implemented by a subclass'); + }, + destroy : function () { + throw new Error('destroy must be implemented by a subclass'); + }, + toImageString : function () { + throw new Error('toImageString must be implemented by a subclass'); + } +}; + +/** + * Abstract representation of charts that operates on DataTable where,
+ *
    + *
  • First column provides index to the data.
  • + *
  • Each subsequent columns are of type + * ColumnType.NUMBER and represents a data series.
  • + *
+ * Line chart, area chart, bar chart, column chart are typical examples. + * + * @param elementId + * id of the div element the chart is drawn in + */ +var BaseChart = function (elementId) { + Chart.call(this, elementId); +}; +BaseChart.prototype = new Chart(); +BaseChart.prototype.constructor = BaseChart; +BaseChart.prototype.validateColumns = function (dataTable) { + var columns = dataTable.getColumns(); + if (columns.length < 2) { + throw new Error('Minimum of two columns are required for this chart'); + } + for (var i = 1; i < columns.length; i++) { + if (columns[i].type !== ColumnType.NUMBER) { + throw new Error('Column ' + (i + 1) + ' should be of type \'Number\''); + } + } + return true; +}; + +/** + * Abstract pie chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var PieChart = function (elementId) { + BaseChart.call(this, elementId); +}; +PieChart.prototype = new BaseChart(); +PieChart.prototype.constructor = PieChart; +PieChart.prototype.validateColumns = function (dataTable) { + var columns = dataTable.getColumns(); + if (columns.length > 2) { + throw new Error('Pie charts can draw only one series'); + } + return BaseChart.prototype.validateColumns.call(this, dataTable); +}; + +/** + * Abstract timeline chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var TimelineChart = function (elementId) { + BaseChart.call(this, elementId); +}; +TimelineChart.prototype = new BaseChart(); +TimelineChart.prototype.constructor = TimelineChart; +TimelineChart.prototype.validateColumns = function (dataTable) { + var result = BaseChart.prototype.validateColumns.call(this, dataTable); + if (result) { + var columns = dataTable.getColumns(); + if (columns[0].type !== ColumnType.DATE) { + throw new Error('First column of timeline chart need to be a date column'); + } + } + return result; +}; + +/** + * Abstract scatter chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var ScatterChart = function (elementId) { + BaseChart.call(this, elementId); +}; +ScatterChart.prototype = new BaseChart(); +ScatterChart.prototype.constructor = ScatterChart; +ScatterChart.prototype.validateColumns = function (dataTable) { + var result = BaseChart.prototype.validateColumns.call(this, dataTable); + if (result) { + var columns = dataTable.getColumns(); + if (columns[0].type !== ColumnType.NUMBER) { + throw new Error('First column of scatter chart need to be a numeric column'); + } + } + return result; +}; + +/** + * The data table contains column information and data for the chart. + */ +var DataTable = function () { + var columns = []; + var data = null; + + this.addColumn = function (type, name) { + columns.push({ + 'type' : type, + 'name' : name + }); + }; + + this.getColumns = function () { + return columns; + }; + + this.setData = function (rows) { + data = rows; + fillMissingValues(); + }; + + this.getData = function () { + return data; + }; + + var fillMissingValues = function () { + if (columns.length === 0) { + throw new Error('Set columns first'); + } + var row; + for (var i = 0; i < data.length; i++) { + row = data[i]; + if (row.length > columns.length) { + row.splice(columns.length - 1, row.length - columns.length); + } else if (row.length < columns.length) { + for (var j = row.length; j < columns.length; j++) { + row.push(null); + } + } + } + }; +}; + +/** ***************************************************************************** + * JQPlot specific code + ******************************************************************************/ + +/** + * Abstract JQplot chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotChart = function (elementId) { + Chart.call(this, elementId); + this.plot = null; + this.validator = null; +}; +JQPlotChart.prototype = new Chart(); +JQPlotChart.prototype.constructor = JQPlotChart; +JQPlotChart.prototype.draw = function (data, options) { + if (this.validator.validateColumns(data)) { + this.plot = $.jqplot(this.elementId, this.prepareData(data), this + .populateOptions(data, options)); + } +}; +JQPlotChart.prototype.destroy = function () { + if (this.plot !== null) { + this.plot.destroy(); + } +}; +JQPlotChart.prototype.redraw = function (options) { + if (this.plot !== null) { + this.plot.replot(options); + } +}; +JQPlotChart.prototype.toImageString = function (options) { + if (this.plot !== null) { + return $('#' + this.elementId).jqplotToImageStr({}); + } +}; +JQPlotChart.prototype.populateOptions = function (dataTable, options) { + throw new Error('populateOptions must be implemented by a subclass'); +}; +JQPlotChart.prototype.prepareData = function (dataTable) { + throw new Error('prepareData must be implemented by a subclass'); +}; + +/** + * JQPlot line chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotLineChart = function (elementId) { + JQPlotChart.call(this, elementId); + this.validator = BaseChart.prototype; +}; +JQPlotLineChart.prototype = new JQPlotChart(); +JQPlotLineChart.prototype.constructor = JQPlotLineChart; + +JQPlotLineChart.prototype.populateOptions = function (dataTable, options) { + var columns = dataTable.getColumns(); + var optional = { + axes : { + xaxis : { + label : columns[0].name, + renderer : $.jqplot.CategoryAxisRenderer, + ticks : [] + }, + yaxis : { + label : (columns.length === 2 ? columns[1].name : 'Values'), + labelRenderer : $.jqplot.CanvasAxisLabelRenderer + } + }, + highlighter: { + show: true, + tooltipAxes: 'y', + formatString:'%d' + }, + series : [] + }; + $.extend(true, optional, options); + + if (optional.series.length === 0) { + for (var i = 1; i < columns.length; i++) { + optional.series.push({ + label : columns[i].name.toString() + }); + } + } + if (optional.axes.xaxis.ticks.length === 0) { + var data = dataTable.getData(); + for (var j = 0; j < data.length; j++) { + optional.axes.xaxis.ticks.push(data[j][0].toString()); + } + } + return optional; +}; + +JQPlotLineChart.prototype.prepareData = function (dataTable) { + var data = dataTable.getData(); + var row; + var retData = []; + var retRow; + for (var i = 0; i < data.length; i++) { + row = data[i]; + for (var j = 1; j < row.length; j++) { + retRow = retData[j - 1]; + if (retRow === undefined) { + retRow = []; + retData[j - 1] = retRow; + } + retRow.push(row[j]); + } + } + return retData; +}; + +/** + * JQPlot spline chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotSplineChart = function (elementId) { + JQPlotLineChart.call(this, elementId); +}; +JQPlotSplineChart.prototype = new JQPlotLineChart(); +JQPlotSplineChart.prototype.constructor = JQPlotSplineChart; + +JQPlotSplineChart.prototype.populateOptions = function (dataTable, options) { + var optional = {}; + var opt = JQPlotLineChart.prototype.populateOptions.call(this, dataTable, + options); + var compulsory = { + seriesDefaults : { + rendererOptions : { + smooth : true + } + } + }; + $.extend(true, optional, opt, compulsory); + return optional; +}; + +/** + * JQPlot scatter chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotScatterChart = function (elementId) { + JQPlotChart.call(this, elementId); + this.validator = ScatterChart.prototype; +}; +JQPlotScatterChart.prototype = new JQPlotChart(); +JQPlotScatterChart.prototype.constructor = JQPlotScatterChart; + +JQPlotScatterChart.prototype.populateOptions = function (dataTable, options) { + var columns = dataTable.getColumns(); + var optional = { + axes : { + xaxis : { + label : columns[0].name + }, + yaxis : { + label : (columns.length === 2 ? columns[1].name : 'Values'), + labelRenderer : $.jqplot.CanvasAxisLabelRenderer + } + }, + highlighter: { + show: true, + tooltipAxes: 'xy', + formatString:'%d, %d' + }, + series : [] + }; + for (var i = 1; i < columns.length; i++) { + optional.series.push({ + label : columns[i].name.toString() + }); + } + + var compulsory = { + seriesDefaults : { + showLine: false, + markerOptions: { + size: 7, + style: 'x' + } + } + }; + + $.extend(true, optional, options, compulsory); + return optional; +}; + +JQPlotScatterChart.prototype.prepareData = function (dataTable) { + var data = dataTable.getData(); + var row; + var retData = []; + var retRow; + for (var i = 0; i < data.length; i++) { + row = data[i]; + if (row[0]) { + for (var j = 1; j < row.length; j++) { + retRow = retData[j - 1]; + if (retRow === undefined) { + retRow = []; + retData[j - 1] = retRow; + } + retRow.push([row[0], row[j]]); + } + } + } + return retData; +}; + +/** + * JQPlot timeline chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotTimelineChart = function (elementId) { + JQPlotLineChart.call(this, elementId); + this.validator = TimelineChart.prototype; +}; +JQPlotTimelineChart.prototype = new JQPlotLineChart(); +JQPlotTimelineChart.prototype.constructor = JQPlotTimelineChart; + +JQPlotTimelineChart.prototype.populateOptions = function (dataTable, options) { + var optional = { + axes : { + xaxis : { + tickOptions : { + formatString: '%b %#d, %y' + } + } + } + }; + var opt = JQPlotLineChart.prototype.populateOptions.call(this, dataTable, options); + var compulsory = { + axes : { + xaxis : { + renderer : $.jqplot.DateAxisRenderer + } + } + }; + $.extend(true, optional, opt, compulsory); + return optional; +}; + +JQPlotTimelineChart.prototype.prepareData = function (dataTable) { + var data = dataTable.getData(); + var row; + var d; + var retData = []; + var retRow; + for (var i = 0; i < data.length; i++) { + row = data[i]; + d = row[0]; + for (var j = 1; j < row.length; j++) { + retRow = retData[j - 1]; + if (retRow === undefined) { + retRow = []; + retData[j - 1] = retRow; + } + if (d !== null) { + retRow.push([d.getTime(), row[j]]); + } + } + } + return retData; +}; + +/** + * JQPlot area chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotAreaChart = function (elementId) { + JQPlotLineChart.call(this, elementId); +}; +JQPlotAreaChart.prototype = new JQPlotLineChart(); +JQPlotAreaChart.prototype.constructor = JQPlotAreaChart; + +JQPlotAreaChart.prototype.populateOptions = function (dataTable, options) { + var optional = { + seriesDefaults : { + fillToZero : true + } + }; + var opt = JQPlotLineChart.prototype.populateOptions.call(this, dataTable, + options); + var compulsory = { + seriesDefaults : { + fill : true + } + }; + $.extend(true, optional, opt, compulsory); + return optional; +}; + +/** + * JQPlot column chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotColumnChart = function (elementId) { + JQPlotLineChart.call(this, elementId); +}; +JQPlotColumnChart.prototype = new JQPlotLineChart(); +JQPlotColumnChart.prototype.constructor = JQPlotColumnChart; + +JQPlotColumnChart.prototype.populateOptions = function (dataTable, options) { + var optional = { + seriesDefaults : { + fillToZero : true + } + }; + var opt = JQPlotLineChart.prototype.populateOptions.call(this, dataTable, + options); + var compulsory = { + seriesDefaults : { + renderer : $.jqplot.BarRenderer + } + }; + $.extend(true, optional, opt, compulsory); + return optional; +}; + +/** + * JQPlot bar chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotBarChart = function (elementId) { + JQPlotLineChart.call(this, elementId); +}; +JQPlotBarChart.prototype = new JQPlotLineChart(); +JQPlotBarChart.prototype.constructor = JQPlotBarChart; + +JQPlotBarChart.prototype.populateOptions = function (dataTable, options) { + var columns = dataTable.getColumns(); + var optional = { + axes : { + yaxis : { + label : columns[0].name, + labelRenderer : $.jqplot.CanvasAxisLabelRenderer, + renderer : $.jqplot.CategoryAxisRenderer, + ticks : [] + }, + xaxis : { + label : (columns.length === 2 ? columns[1].name : 'Values'), + labelRenderer : $.jqplot.CanvasAxisLabelRenderer + } + }, + highlighter: { + show: true, + tooltipAxes: 'x', + formatString:'%d' + }, + series : [], + seriesDefaults : { + fillToZero : true + } + }; + var compulsory = { + seriesDefaults : { + renderer : $.jqplot.BarRenderer, + rendererOptions : { + barDirection : 'horizontal' + } + } + }; + $.extend(true, optional, options, compulsory); + + if (optional.axes.yaxis.ticks.length === 0) { + var data = dataTable.getData(); + for (var i = 0; i < data.length; i++) { + optional.axes.yaxis.ticks.push(data[i][0].toString()); + } + } + if (optional.series.length === 0) { + for (var j = 1; j < columns.length; j++) { + optional.series.push({ + label : columns[j].name.toString() + }); + } + } + return optional; +}; + +/** + * JQPlot pie chart + * + * @param elementId + * id of the div element the chart is drawn in + */ +var JQPlotPieChart = function (elementId) { + JQPlotChart.call(this, elementId); + this.validator = PieChart.prototype; +}; +JQPlotPieChart.prototype = new JQPlotChart(); +JQPlotPieChart.prototype.constructor = JQPlotPieChart; + +JQPlotPieChart.prototype.populateOptions = function (dataTable, options) { + var optional = { + highlighter: { + show: true, + tooltipAxes: 'xy', + formatString:'%s, %d', + useAxesFormatters: false + }, + legend: { + renderer: $.jqplot.EnhancedPieLegendRenderer, + }, + }; + var compulsory = { + seriesDefaults : { + shadow: false, + renderer : $.jqplot.PieRenderer, + rendererOptions: { sliceMargin: 1, showDataLabels: true } + } + }; + $.extend(true, optional, options, compulsory); + return optional; +}; + +JQPlotPieChart.prototype.prepareData = function (dataTable) { + var data = dataTable.getData(); + var row; + var retData = []; + for (var i = 0; i < data.length; i++) { + row = data[i]; + retData.push([row[0], row[1]]); + } + return [retData]; +}; + +/** + * Chart factory that returns JQPlotCharts + */ +var JQPlotChartFactory = function () { +}; +JQPlotChartFactory.prototype = new ChartFactory(); +JQPlotChartFactory.prototype.createChart = function (type, elementId) { + var chart = null; + switch (type) { + case ChartType.LINE: + chart = new JQPlotLineChart(elementId); + break; + case ChartType.SPLINE: + chart = new JQPlotSplineChart(elementId); + break; + case ChartType.TIMELINE: + chart = new JQPlotTimelineChart(elementId); + break; + case ChartType.AREA: + chart = new JQPlotAreaChart(elementId); + break; + case ChartType.BAR: + chart = new JQPlotBarChart(elementId); + break; + case ChartType.COLUMN: + chart = new JQPlotColumnChart(elementId); + break; + case ChartType.PIE: + chart = new JQPlotPieChart(elementId); + break; + case ChartType.SCATTER: + chart = new JQPlotScatterChart(elementId); + break; + } + + return chart; +}; diff --git a/phpMyAdmin/js/codemirror/addon/lint/sql-lint.js b/phpMyAdmin/js/codemirror/addon/lint/sql-lint.js new file mode 100755 index 0000000..800c8d7 --- /dev/null +++ b/phpMyAdmin/js/codemirror/addon/lint/sql-lint.js @@ -0,0 +1,38 @@ +CodeMirror.sqlLint = function (text, updateLinting, options, cm) { + // Skipping check if text box is empty. + if (text.trim() === '') { + updateLinting(cm, []); + return; + } + + function handleResponse (response) { + var found = []; + for (var idx in response) { + found.push({ + from: CodeMirror.Pos( + response[idx].fromLine, response[idx].fromColumn + ), + to: CodeMirror.Pos( + response[idx].toLine, response[idx].toColumn + ), + messageHTML: response[idx].message, + severity : response[idx].severity + }); + } + + updateLinting(cm, found); + } + + $.ajax({ + method: 'POST', + url: 'lint.php', + dataType: 'json', + data: { + sql_query: text, + server: PMA_commonParams.get('server'), + options: options.lintOptions, + no_history: true, + }, + success: handleResponse + }); +}; diff --git a/phpMyAdmin/js/common.js b/phpMyAdmin/js/common.js new file mode 100755 index 0000000..5b8d3da --- /dev/null +++ b/phpMyAdmin/js/common.js @@ -0,0 +1,550 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +$(function () { + checkNumberOfFields(); +}); + +/** + * Holds common parameters such as server, db, table, etc + * + * The content for this is normally loaded from Header.php or + * Response.php and executed by ajax.js + */ +var PMA_commonParams = (function () { + /** + * @var hash params An associative array of key value pairs + * @access private + */ + var params = {}; + // The returned object is the public part of the module + return { + /** + * Saves all the key value pair that + * are provided in the input array + * + * @param obj hash The input array + * + * @return void + */ + setAll: function (obj) { + var reload = false; + var updateNavigation = false; + for (var i in obj) { + if (params[i] !== undefined && params[i] !== obj[i]) { + if (i === 'db' || i === 'table') { + updateNavigation = true; + } + reload = true; + } + params[i] = obj[i]; + } + if (updateNavigation && + $('#pma_navigation_tree').hasClass('synced') + ) { + PMA_showCurrentNavigation(); + } + }, + /** + * Retrieves a value given its key + * Returns empty string for undefined values + * + * @param name string The key + * + * @return string + */ + get: function (name) { + return params[name]; + }, + /** + * Saves a single key value pair + * + * @param name string The key + * @param value string The value + * + * @return self For chainability + */ + set: function (name, value) { + var updateNavigation = false; + if (name === 'db' || name === 'table' && + params[name] !== value + ) { + updateNavigation = true; + } + params[name] = value; + if (updateNavigation && + $('#pma_navigation_tree').hasClass('synced') + ) { + PMA_showCurrentNavigation(); + } + return this; + }, + /** + * Returns the url query string using the saved parameters + * + * @return string + */ + getUrlQuery: function () { + var common = this.get('common_query'); + var separator = '?'; + var argsep = PMA_commonParams.get('arg_separator'); + if (common.length > 0) { + separator = argsep; + } + return PMA_sprintf( + '%s%sserver=%s' + argsep + 'db=%s' + argsep + 'table=%s', + this.get('common_query'), + separator, + encodeURIComponent(this.get('server')), + encodeURIComponent(this.get('db')), + encodeURIComponent(this.get('table')) + ); + } + }; +}()); + +/** + * Holds common parameters such as server, db, table, etc + * + * The content for this is normally loaded from Header.php or + * Response.php and executed by ajax.js + */ +var PMA_commonActions = { + /** + * Saves the database name when it's changed + * and reloads the query window, if necessary + * + * @param new_db string new_db The name of the new database + * + * @return void + */ + setDb: function (new_db) { + if (new_db !== PMA_commonParams.get('db')) { + PMA_commonParams.setAll({ 'db': new_db, 'table': '' }); + } + }, + /** + * Opens a database in the main part of the page + * + * @param new_db string The name of the new database + * + * @return void + */ + openDb: function (new_db) { + PMA_commonParams + .set('db', new_db) + .set('table', ''); + this.refreshMain( + PMA_commonParams.get('opendb_url') + ); + }, + /** + * Refreshes the main frame + * + * @param mixed url Undefined to refresh to the same page + * String to go to a different page, e.g: 'index.php' + * + * @return void + */ + refreshMain: function (url, callback) { + if (! url) { + url = $('#selflink').find('a').attr('href') || window.location.pathname; + url = url.substring(0, url.indexOf('?')); + } + url += PMA_commonParams.getUrlQuery(); + $('', { href: url }) + .appendTo('body') + .click() + .remove(); + AJAX._callback = callback; + } +}; + +/** + * Class to handle PMA Drag and Drop Import + * feature + */ +PMA_DROP_IMPORT = { + /** + * @var int, count of total uploads in this view + */ + uploadCount: 0, + /** + * @var int, count of live uploads + */ + liveUploadCount: 0, + /** + * @var string array, allowed extensions + */ + allowedExtensions: ['sql', 'xml', 'ldi', 'mediawiki', 'shp'], + /** + * @var string array, allowed extensions for compressed files + */ + allowedCompressedExtensions: ['gz', 'bz2', 'zip'], + /** + * @var obj array to store message returned by import_status.php + */ + importStatus: [], + /** + * Checks if any dropped file has valid extension or not + * + * @param file filename + * + * @return string, extension for valid extension, '' otherwise + */ + _getExtension: function (file) { + var arr = file.split('.'); + ext = arr[arr.length - 1]; + + // check if compressed + if (jQuery.inArray(ext.toLowerCase(), + PMA_DROP_IMPORT.allowedCompressedExtensions) !== -1) { + ext = arr[arr.length - 2]; + } + + // Now check for extension + if (jQuery.inArray(ext.toLowerCase(), + PMA_DROP_IMPORT.allowedExtensions) !== -1) { + return ext; + } + return ''; + }, + /** + * Shows upload progress for different sql uploads + * + * @param: hash (string), hash for specific file upload + * @param: percent (float), file upload percentage + * + * @return void + */ + _setProgress: function (hash, percent) { + $('.pma_sql_import_status div li[data-hash="' + hash + '"]') + .children('progress').val(percent); + }, + /** + * Function to upload the file asynchronously + * + * @param formData FormData object for a specific file + * @param hash hash of the current file upload + * + * @return void + */ + _sendFileToServer: function (formData, hash) { + var uploadURL = './import.php'; // Upload URL + var extraData = {}; + var jqXHR = $.ajax({ + xhr: function () { + var xhrobj = $.ajaxSettings.xhr(); + if (xhrobj.upload) { + xhrobj.upload.addEventListener('progress', function (event) { + var percent = 0; + var position = event.loaded || event.position; + var total = event.total; + if (event.lengthComputable) { + percent = Math.ceil(position / total * 100); + } + // Set progress + PMA_DROP_IMPORT._setProgress(hash, percent); + }, false); + } + return xhrobj; + }, + url: uploadURL, + type: 'POST', + contentType:false, + processData: false, + cache: false, + data: formData, + success: function (data) { + PMA_DROP_IMPORT._importFinished(hash, false, data.success); + if (!data.success) { + PMA_DROP_IMPORT.importStatus[PMA_DROP_IMPORT.importStatus.length] = { + hash: hash, + message: data.error + }; + } + } + }); + + // -- provide link to cancel the upload + $('.pma_sql_import_status div li[data-hash="' + hash + + '"] span.filesize').html('' + + PMA_messages.dropImportMessageCancel + ''); + + // -- add event listener to this link to abort upload operation + $('.pma_sql_import_status div li[data-hash="' + hash + + '"] span.filesize span.pma_drop_file_status') + .on('click', function () { + if ($(this).attr('task') === 'cancel') { + jqXHR.abort(); + $(this).html('' + PMA_messages.dropImportMessageAborted + ''); + PMA_DROP_IMPORT._importFinished(hash, true, false); + } else if ($(this).children('span').html() === + PMA_messages.dropImportMessageFailed) { + // -- view information + var $this = $(this); + $.each(PMA_DROP_IMPORT.importStatus, + function (key, value) { + if (value.hash === hash) { + $('.pma_drop_result:visible').remove(); + var filename = $this.parent('span').attr('data-filename'); + $('body').append('

' + + PMA_messages.dropImportImportResultHeader + ' - ' + + escapeHtml(filename) + 'x

' + value.message + '
'); + $('.pma_drop_result').draggable(); // to make this dialog draggable + } + }); + } + }); + }, + /** + * Triggered when an object is dragged into the PMA UI + * + * @param event obj + * + * @return void + */ + _dragenter : function (event) { + // We don't want to prevent users from using + // browser's default drag-drop feature on some page(s) + if ($('.noDragDrop').length !== 0) { + return; + } + + event.stopPropagation(); + event.preventDefault(); + if (!PMA_DROP_IMPORT._hasFiles(event)) { + return; + } + if (PMA_commonParams.get('db') === '') { + $('.pma_drop_handler').html(PMA_messages.dropImportSelectDB); + } else { + $('.pma_drop_handler').html(PMA_messages.dropImportDropFiles); + } + $('.pma_drop_handler').fadeIn(); + }, + /** + * Check if dragged element contains Files + * + * @param event the event object + * + * @return bool + */ + _hasFiles: function (event) { + return !(typeof event.originalEvent.dataTransfer.types === 'undefined' || + $.inArray('Files', event.originalEvent.dataTransfer.types) < 0 || + $.inArray( + 'application/x-moz-nativeimage', + event.originalEvent.dataTransfer.types + ) >= 0); + }, + /** + * Triggered when dragged file is being dragged over PMA UI + * + * @param event obj + * + * @return void + */ + _dragover: function (event) { + // We don't want to prevent users from using + // browser's default drag-drop feature on some page(s) + if ($('.noDragDrop').length !== 0) { + return; + } + + event.stopPropagation(); + event.preventDefault(); + if (!PMA_DROP_IMPORT._hasFiles(event)) { + return; + } + $('.pma_drop_handler').fadeIn(); + }, + /** + * Triggered when dragged objects are left + * + * @param event obj + * + * @return void + */ + _dragleave: function (event) { + // We don't want to prevent users from using + // browser's default drag-drop feature on some page(s) + if ($('.noDragDrop').length !== 0) { + return; + } + event.stopPropagation(); + event.preventDefault(); + var $pma_drop_handler = $('.pma_drop_handler'); + $pma_drop_handler.clearQueue().stop(); + $pma_drop_handler.fadeOut(); + $pma_drop_handler.html(PMA_messages.dropImportDropFiles); + }, + /** + * Called when upload has finished + * + * @param string, unique hash for a certain upload + * @param bool, true if upload was aborted + * @param bool, status of sql upload, as sent by server + * + * @return void + */ + _importFinished: function (hash, aborted, status) { + $('.pma_sql_import_status div li[data-hash="' + hash + '"]') + .children('progress').hide(); + var icon = 'icon ic_s_success'; + // -- provide link to view upload status + if (!aborted) { + if (status) { + $('.pma_sql_import_status div li[data-hash="' + hash + + '"] span.filesize span.pma_drop_file_status') + .html('' + PMA_messages.dropImportMessageSuccess + '
'); + } else { + $('.pma_sql_import_status div li[data-hash="' + hash + + '"] span.filesize span.pma_drop_file_status') + .html('' + PMA_messages.dropImportMessageFailed + + ''); + icon = 'icon ic_s_error'; + } + } else { + icon = 'icon ic_s_notice'; + } + $('.pma_sql_import_status div li[data-hash="' + hash + + '"] span.filesize span.pma_drop_file_status') + .attr('task', 'info'); + + // Set icon + $('.pma_sql_import_status div li[data-hash="' + hash + '"]') + .prepend(' '); + + // Decrease liveUploadCount by one + $('.pma_import_count').html(--PMA_DROP_IMPORT.liveUploadCount); + if (!PMA_DROP_IMPORT.liveUploadCount) { + $('.pma_sql_import_status h2 .close').fadeIn(); + } + }, + /** + * Triggered when dragged objects are dropped to UI + * From this function, the AJAX Upload operation is initiated + * + * @param event object + * + * @return void + */ + _drop: function (event) { + // We don't want to prevent users from using + // browser's default drag-drop feature on some page(s) + if ($('.noDragDrop').length !== 0) { + return; + } + + var dbname = PMA_commonParams.get('db'); + var server = PMA_commonParams.get('server'); + + // if no database is selected -- no + if (dbname !== '') { + var files = event.originalEvent.dataTransfer.files; + if (!files || files.length === 0) { + // No files actually transferred + $('.pma_drop_handler').fadeOut(); + event.stopPropagation(); + event.preventDefault(); + return; + } + $('.pma_sql_import_status').slideDown(); + for (var i = 0; i < files.length; i++) { + var ext = (PMA_DROP_IMPORT._getExtension(files[i].name)); + var hash = AJAX.hash(++PMA_DROP_IMPORT.uploadCount); + + var $pma_sql_import_status_div = $('.pma_sql_import_status div'); + $pma_sql_import_status_div.append('
  • ' + + ((ext !== '') ? '' : ' ') + + escapeHtml(files[i].name) + '' + (files[i].size / 1024).toFixed(2) + + ' kb
  • '); + + // scroll the UI to bottom + $pma_sql_import_status_div.scrollTop( + $pma_sql_import_status_div.scrollTop() + 50 + ); // 50 hardcoded for now + + if (ext !== '') { + // Increment liveUploadCount by one + $('.pma_import_count').html(++PMA_DROP_IMPORT.liveUploadCount); + $('.pma_sql_import_status h2 .close').fadeOut(); + + $('.pma_sql_import_status div li[data-hash="' + hash + '"]') + .append('
    '); + + // uploading + var fd = new FormData(); + fd.append('import_file', files[i]); + fd.append('noplugin', Math.random().toString(36).substring(2, 12)); + fd.append('db', dbname); + fd.append('server', server); + fd.append('token', PMA_commonParams.get('token')); + fd.append('import_type', 'database'); + // todo: method to find the value below + fd.append('MAX_FILE_SIZE', '4194304'); + // todo: method to find the value below + fd.append('charset_of_file','utf-8'); + // todo: method to find the value below + fd.append('allow_interrupt', 'yes'); + fd.append('skip_queries', '0'); + fd.append('format',ext); + fd.append('sql_compatibility','NONE'); + fd.append('sql_no_auto_value_on_zero','something'); + fd.append('ajax_request','true'); + fd.append('hash', hash); + + // init uploading + PMA_DROP_IMPORT._sendFileToServer(fd, hash); + } else if (!PMA_DROP_IMPORT.liveUploadCount) { + $('.pma_sql_import_status h2 .close').fadeIn(); + } + } + } + $('.pma_drop_handler').fadeOut(); + event.stopPropagation(); + event.preventDefault(); + } +}; + +/** + * Called when some user drags, dragover, leave + * a file to the PMA UI + * @param object Event data + * @return void + */ +$(document).on('dragenter', PMA_DROP_IMPORT._dragenter); +$(document).on('dragover', PMA_DROP_IMPORT._dragover); +$(document).on('dragleave', '.pma_drop_handler', PMA_DROP_IMPORT._dragleave); + +// when file is dropped to PMA UI +$(document).on('drop', 'body', PMA_DROP_IMPORT._drop); + +// minimizing-maximising the sql ajax upload status +$(document).on('click', '.pma_sql_import_status h2 .minimize', function () { + if ($(this).attr('toggle') === 'off') { + $('.pma_sql_import_status div').css('height','270px'); + $(this).attr('toggle','on'); + $(this).html('-'); // to minimize + } else { + $('.pma_sql_import_status div').css('height','0px'); + $(this).attr('toggle','off'); + $(this).html('+'); // to maximise + } +}); + +// closing sql ajax upload status +$(document).on('click', '.pma_sql_import_status h2 .close', function () { + $('.pma_sql_import_status').fadeOut(function () { + $('.pma_sql_import_status div').html(''); + PMA_DROP_IMPORT.importStatus = []; // clear the message array + }); +}); + +// Closing the import result box +$(document).on('click', '.pma_drop_result h2 .close', function () { + $(this).parent('h2').parent('div').remove(); +}); diff --git a/phpMyAdmin/js/config.js b/phpMyAdmin/js/config.js new file mode 100755 index 0000000..bd0eab4 --- /dev/null +++ b/phpMyAdmin/js/config.js @@ -0,0 +1,886 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Functions used in configuration forms and on user preferences pages + */ + +/** + * checks whether browser supports web storage + * + * @param type the type of storage i.e. localStorage or sessionStorage + * + * @returns bool + */ +function isStorageSupported (type, warn) { + try { + window[type].setItem('PMATest', 'test'); + // Check whether key-value pair was set successfully + if (window[type].getItem('PMATest') === 'test') { + // Supported, remove test variable from storage + window[type].removeItem('PMATest'); + return true; + } + } catch (error) { + // Not supported + if (warn) { + PMA_ajaxShowMessage(PMA_messages.strNoLocalStorage, false); + } + } + return false; +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('config.js', function () { + $('.optbox input[id], .optbox select[id], .optbox textarea[id]').off('change').off('keyup'); + $('.optbox input[type=button][name=submit_reset]').off('click'); + $('div.tabs_contents').off(); + $('#import_local_storage, #export_local_storage').off('click'); + $('form.prefs-form').off('change').off('submit'); + $(document).off('click', 'div.click-hide-message'); + $('#prefs_autoload').find('a').off('click'); +}); + +AJAX.registerOnload('config.js', function () { + var $topmenu_upt = $('#topmenu2.user_prefs_tabs'); + $topmenu_upt.find('li.active a').attr('rel', 'samepage'); + $topmenu_upt.find('li:not(.active) a').attr('rel', 'newpage'); +}); + +// default values for fields +var defaultValues = {}; + +/** + * Returns field type + * + * @param {Element} field + */ +function getFieldType (field) { + var $field = $(field); + var tagName = $field.prop('tagName'); + if (tagName === 'INPUT') { + return $field.attr('type'); + } else if (tagName === 'SELECT') { + return 'select'; + } else if (tagName === 'TEXTAREA') { + return 'text'; + } + return ''; +} + +/** + * Enables or disables the "restore default value" button + * + * @param {Element} field + * @param {boolean} display + */ +function setRestoreDefaultBtn (field, display) { + var $el = $(field).closest('td').find('.restore-default img'); + $el[display ? 'show' : 'hide'](); +} + +/** + * Marks field depending on its value (system default or custom) + * + * @param {Element} field + */ +function markField (field) { + var $field = $(field); + var type = getFieldType($field); + var isDefault = checkFieldDefault($field, type); + + // checkboxes uses parent for marking + var $fieldMarker = (type === 'checkbox') ? $field.parent() : $field; + setRestoreDefaultBtn($field, !isDefault); + $fieldMarker[isDefault ? 'removeClass' : 'addClass']('custom'); +} + +/** + * Sets field value + * + * value must be of type: + * o undefined (omitted) - restore default value (form default, not PMA default) + * o String - if field_type is 'text' + * o boolean - if field_type is 'checkbox' + * o Array of values - if field_type is 'select' + * + * @param {Element} field + * @param {String} field_type see {@link #getFieldType} + * @param {String|Boolean} value + */ +function setFieldValue (field, field_type, value) { + var $field = $(field); + switch (field_type) { + case 'text': + case 'number': + $field.val(value); + break; + case 'checkbox': + $field.prop('checked', value); + break; + case 'select': + var options = $field.prop('options'); + var i; + var imax = options.length; + var i, imax = options.length; + for (i = 0; i < imax; i++) { + options[i].selected = (value.indexOf(options[i].value) != -1); + } + break; + } + markField($field); +} + +/** + * Gets field value + * + * Will return one of: + * o String - if type is 'text' + * o boolean - if type is 'checkbox' + * o Array of values - if type is 'select' + * + * @param {Element} field + * @param {String} field_type returned by {@link #getFieldType} + * @type Boolean|String|String[] + */ +function getFieldValue (field, field_type) { + var $field = $(field); + switch (field_type) { + case 'text': + case 'number': + return $field.prop('value'); + case 'checkbox': + return $field.prop('checked'); + case 'select': + var options = $field.prop('options'); + var i; + var imax = options.length; + var items = []; + for (i = 0; i < imax; i++) { + if (options[i].selected) { + items.push(options[i].value); + } + } + return items; + } + return null; +} + +/** + * Returns values for all fields in fieldsets + */ +function getAllValues () { + var $elements = $('fieldset input, fieldset select, fieldset textarea'); + var values = {}; + var type; + var value; + for (var i = 0; i < $elements.length; i++) { + type = getFieldType($elements[i]); + value = getFieldValue($elements[i], type); + if (typeof value !== 'undefined') { + // we only have single selects, fatten array + if (type === 'select') { + value = value[0]; + } + values[$elements[i].name] = value; + } + } + return values; +} + +/** + * Checks whether field has its default value + * + * @param {Element} field + * @param {String} type + * @return boolean + */ +function checkFieldDefault (field, type) { + var $field = $(field); + var field_id = $field.attr('id'); + if (typeof defaultValues[field_id] === 'undefined') { + return true; + } + var isDefault = true; + var currentValue = getFieldValue($field, type); + if (type !== 'select') { + isDefault = currentValue === defaultValues[field_id]; + } else { + // compare arrays, will work for our representation of select values + if (currentValue.length !== defaultValues[field_id].length) { + isDefault = false; + } else { + for (var i = 0; i < currentValue.length; i++) { + if (currentValue[i] !== defaultValues[field_id][i]) { + isDefault = false; + break; + } + } + } + } + return isDefault; +} + +/** + * Returns element's id prefix + * @param {Element} element + */ +function getIdPrefix (element) { + return $(element).attr('id').replace(/[^-]+$/, ''); +} + +// ------------------------------------------------------------------ +// Form validation and field operations +// + +// form validator assignments +var validate = {}; + +// form validator list +var validators = { + // regexp: numeric value + _regexp_numeric: /^[0-9]+$/, + // regexp: extract parts from PCRE expression + _regexp_pcre_extract: /(.)(.*)\1(.*)?/, + /** + * Validates positive number + * + * @param {boolean} isKeyUp + */ + PMA_validatePositiveNumber: function (isKeyUp) { + if (isKeyUp && this.value === '') { + return true; + } + var result = this.value !== '0' && validators._regexp_numeric.test(this.value); + return result ? true : PMA_messages.error_nan_p; + }, + /** + * Validates non-negative number + * + * @param {boolean} isKeyUp + */ + PMA_validateNonNegativeNumber: function (isKeyUp) { + if (isKeyUp && this.value === '') { + return true; + } + var result = validators._regexp_numeric.test(this.value); + return result ? true : PMA_messages.error_nan_nneg; + }, + /** + * Validates port number + * + * @param {boolean} isKeyUp + */ + PMA_validatePortNumber: function (isKeyUp) { + if (this.value === '') { + return true; + } + var result = validators._regexp_numeric.test(this.value) && this.value !== '0'; + return result && this.value <= 65535 ? true : PMA_messages.error_incorrect_port; + }, + /** + * Validates value according to given regular expression + * + * @param {boolean} isKeyUp + * @param {string} regexp + */ + PMA_validateByRegex: function (isKeyUp, regexp) { + if (isKeyUp && this.value === '') { + return true; + } + // convert PCRE regexp + var parts = regexp.match(validators._regexp_pcre_extract); + var valid = this.value.match(new RegExp(parts[2], parts[3])) !== null; + return valid ? true : PMA_messages.error_invalid_value; + }, + /** + * Validates upper bound for numeric inputs + * + * @param {boolean} isKeyUp + * @param {int} max_value + */ + PMA_validateUpperBound: function (isKeyUp, max_value) { + var val = parseInt(this.value, 10); + if (isNaN(val)) { + return true; + } + return val <= max_value ? true : PMA_sprintf(PMA_messages.error_value_lte, max_value); + }, + // field validators + _field: { + }, + // fieldset validators + _fieldset: { + } +}; + +/** + * Registers validator for given field + * + * @param {String} id field id + * @param {String} type validator (key in validators object) + * @param {boolean} onKeyUp whether fire on key up + * @param {Array} params validation function parameters + */ +function validateField (id, type, onKeyUp, params) { + if (typeof validators[type] === 'undefined') { + return; + } + if (typeof validate[id] === 'undefined') { + validate[id] = []; + } + if (validate[id].length === 0) { + validate[id].push([type, params, onKeyUp]); + } +} + +/** + * Returns validation functions associated with form field + * + * @param {String} field_id form field id + * @param {boolean} onKeyUpOnly see validateField + * @type Array + * @return array of [function, parameters to be passed to function] + */ +function getFieldValidators (field_id, onKeyUpOnly) { + // look for field bound validator + var name = field_id && field_id.match(/[^-]+$/)[0]; + if (typeof validators._field[name] !== 'undefined') { + return [[validators._field[name], null]]; + } + + // look for registered validators + var functions = []; + if (typeof validate[field_id] !== 'undefined') { + // validate[field_id]: array of [type, params, onKeyUp] + for (var i = 0, imax = validate[field_id].length; i < imax; i++) { + if (onKeyUpOnly && !validate[field_id][i][2]) { + continue; + } + functions.push([validators[validate[field_id][i][0]], validate[field_id][i][1]]); + } + } + + return functions; +} + +/** + * Displays errors for given form fields + * + * WARNING: created DOM elements must be identical with the ones made by + * PhpMyAdmin\Config\FormDisplayTemplate::displayInput()! + * + * @param {Object} error_list list of errors in the form {field id: error array} + */ +function displayErrors (error_list) { + var tempIsEmpty = function (item) { + return item !== ''; + }; + + for (var field_id in error_list) { + var errors = error_list[field_id]; + var $field = $('#' + field_id); + var isFieldset = $field.attr('tagName') === 'FIELDSET'; + var $errorCnt; + if (isFieldset) { + $errorCnt = $field.find('dl.errors'); + } else { + $errorCnt = $field.siblings('.inline_errors'); + } + + // remove empty errors (used to clear error list) + errors = $.grep(errors, tempIsEmpty); + + // CSS error class + if (!isFieldset) { + // checkboxes uses parent for marking + var $fieldMarker = ($field.attr('type') === 'checkbox') ? $field.parent() : $field; + $fieldMarker[errors.length ? 'addClass' : 'removeClass']('field-error'); + } + + if (errors.length) { + // if error container doesn't exist, create it + if ($errorCnt.length === 0) { + if (isFieldset) { + $errorCnt = $('
    '); + $field.find('table').before($errorCnt); + } else { + $errorCnt = $('
    '); + $field.closest('td').append($errorCnt); + } + } + + var html = ''; + for (var i = 0, imax = errors.length; i < imax; i++) { + html += '
    ' + errors[i] + '
    '; + } + $errorCnt.html(html); + } else if ($errorCnt !== null) { + // remove useless error container + $errorCnt.remove(); + } + } +} + +/** + * Validates fields and fieldsets and call displayError function as required + */ +function setDisplayError() { + var elements = $('.optbox input[id], .optbox select[id], .optbox textarea[id]'); + // run all field validators + var errors = {}; + for (var i = 0; i < elements.length; i++) { + validate_field(elements[i], false, errors); + } + // run all fieldset validators + $('fieldset.optbox').each(function () { + validate_fieldset(this, false, errors); + }); + displayErrors(errors); +} + +/** + * Validates fieldset and puts errors in 'errors' object + * + * @param {Element} fieldset + * @param {boolean} isKeyUp + * @param {Object} errors + */ +function validate_fieldset (fieldset, isKeyUp, errors) { + var $fieldset = $(fieldset); + if ($fieldset.length && typeof validators._fieldset[$fieldset.attr('id')] !== 'undefined') { + var fieldset_errors = validators._fieldset[$fieldset.attr('id')].apply($fieldset[0], [isKeyUp]); + for (var field_id in fieldset_errors) { + if (typeof errors[field_id] === 'undefined') { + errors[field_id] = []; + } + if (typeof fieldset_errors[field_id] === 'string') { + fieldset_errors[field_id] = [fieldset_errors[field_id]]; + } + $.merge(errors[field_id], fieldset_errors[field_id]); + } + } +} + +/** + * Validates form field and puts errors in 'errors' object + * + * @param {Element} field + * @param {boolean} isKeyUp + * @param {Object} errors + */ +function validate_field (field, isKeyUp, errors) { + var args; + var result; + var $field = $(field); + var field_id = $field.attr('id'); + errors[field_id] = []; + var functions = getFieldValidators(field_id, isKeyUp); + for (var i = 0; i < functions.length; i++) { + if (typeof functions[i][1] !== 'undefined' && functions[i][1] !== null) { + args = functions[i][1].slice(0); + } else { + args = []; + } + args.unshift(isKeyUp); + result = functions[i][0].apply($field[0], args); + if (result !== true) { + if (typeof result === 'string') { + result = [result]; + } + $.merge(errors[field_id], result); + } + } +} + +/** + * Validates form field and parent fieldset + * + * @param {Element} field + * @param {boolean} isKeyUp + */ +function validate_field_and_fieldset (field, isKeyUp) { + var $field = $(field); + var errors = {}; + validate_field($field, isKeyUp, errors); + validate_fieldset($field.closest('fieldset.optbox'), isKeyUp, errors); + displayErrors(errors); +} + +function loadInlineConfig () { + if (!Array.isArray(configInlineParams)) { + return; + } + for (var i = 0; i < configInlineParams.length; ++i) { + if (typeof configInlineParams[i] === 'function') { + configInlineParams[i](); + } + } +} + +function setupValidation () { + validate = {}; + configScriptLoaded = true; + if (configScriptLoaded && typeof configInlineParams !== 'undefined') { + loadInlineConfig(); + } + // register validators and mark custom values + var $elements = $('.optbox input[id], .optbox select[id], .optbox textarea[id]'); + $elements.each(function () { + markField(this); + var $el = $(this); + $el.on('change', function () { + validate_field_and_fieldset(this, false); + markField(this); + }); + var tagName = $el.attr('tagName'); + // text fields can be validated after each change + if (tagName === 'INPUT' && $el.attr('type') === 'text') { + $el.keyup(function () { + validate_field_and_fieldset($el, true); + markField($el); + }); + } + // disable textarea spellcheck + if (tagName === 'TEXTAREA') { + $el.attr('spellcheck', false); + } + }); + + // check whether we've refreshed a page and browser remembered modified + // form values + var $check_page_refresh = $('#check_page_refresh'); + if ($check_page_refresh.length === 0 || $check_page_refresh.val() === '1') { + // run all field validators + var errors = {}; + for (var i = 0; i < $elements.length; i++) { + validate_field($elements[i], false, errors); + } + // run all fieldset validators + $('fieldset.optbox').each(function () { + validate_fieldset(this, false, errors); + }); + + displayErrors(errors); + } else if ($check_page_refresh) { + $check_page_refresh.val('1'); + } +} + +AJAX.registerOnload('config.js', function () { + setupValidation(); +}); + +// +// END: Form validation and field operations +// ------------------------------------------------------------------ + +// ------------------------------------------------------------------ +// Tabbed forms +// + +/** + * Sets active tab + * + * @param {String} tab_id + */ +function setTab (tab_id) { + $('ul.tabs').each(function () { + var $this = $(this); + if (!$this.find('li a[href="#' + tab_id + '"]').length) { + return; + } + $this.find('li').removeClass('active').find('a[href="#' + tab_id + '"]').parent().addClass('active'); + $this.parent().find('div.tabs_contents fieldset').hide().filter('#' + tab_id).show(); + var hashValue = 'tab_' + tab_id; + location.hash = hashValue; + $this.parent().find('input[name=tab_hash]').val(hashValue); + }); +} + +function setupConfigTabs () { + var forms = $('form.config-form'); + forms.each(function () { + var $this = $(this); + var $tabs = $this.find('ul.tabs'); + if (!$tabs.length) { + return; + } + // add tabs events and activate one tab (the first one or indicated by location hash) + $tabs.find('li').removeClass('active'); + $tabs.find('a') + .click(function (e) { + e.preventDefault(); + setTab($(this).attr('href').substr(1)); + }) + .filter(':first') + .parent() + .addClass('active'); + $this.find('div.tabs_contents fieldset').hide().filter(':first').show(); + }); +} + +function adjustPrefsNotification () { + var $prefsAutoLoad = $('#prefs_autoload'); + var $tableNameControl = $('#table_name_col_no'); + var $prefsAutoShowing = ($prefsAutoLoad.css('display') !== 'none'); + + if ($prefsAutoShowing && $tableNameControl.length) { + $tableNameControl.css('top', '55px'); + } +} + +AJAX.registerOnload('config.js', function () { + setupConfigTabs(); + adjustPrefsNotification(); + + // tab links handling, check each 200ms + // (works with history in FF, further browser support here would be an overkill) + var prev_hash; + var tab_check_fnc = function () { + if (location.hash !== prev_hash) { + prev_hash = location.hash; + if (prev_hash.match(/^#tab_[a-zA-Z0-9_]+$/)) { + // session ID is sometimes appended here + var hash = prev_hash.substr(5).split('&')[0]; + if ($('#' + hash).length) { + setTab(hash); + } + } + } + }; + tab_check_fnc(); + setInterval(tab_check_fnc, 200); +}); + +// +// END: Tabbed forms +// ------------------------------------------------------------------ + +// ------------------------------------------------------------------ +// Form reset buttons +// + +AJAX.registerOnload('config.js', function () { + $('.optbox input[type=button][name=submit_reset]').on('click', function () { + var fields = $(this).closest('fieldset').find('input, select, textarea'); + for (var i = 0, imax = fields.length; i < imax; i++) { + setFieldValue(fields[i], getFieldType(fields[i]), defaultValues[fields[i].id]); + } + setDisplayError(); + }); +}); + +// +// END: Form reset buttons +// ------------------------------------------------------------------ + +// ------------------------------------------------------------------ +// "Restore default" and "set value" buttons +// + +/** + * Restores field's default value + * + * @param {String} field_id + */ +function restoreField (field_id) { + var $field = $('#' + field_id); + if ($field.length === 0 || defaultValues[field_id] === undefined) { + return; + } + setFieldValue($field, getFieldType($field), defaultValues[field_id]); +} + +function setupRestoreField () { + $('div.tabs_contents') + .on('mouseenter', '.restore-default, .set-value', function () { + $(this).css('opacity', 1); + }) + .on('mouseleave', '.restore-default, .set-value', function () { + $(this).css('opacity', 0.25); + }) + .on('click', '.restore-default, .set-value', function (e) { + e.preventDefault(); + var href = $(this).attr('href'); + var field_sel; + if ($(this).hasClass('restore-default')) { + field_sel = href; + restoreField(field_sel.substr(1)); + } else { + field_sel = href.match(/^[^=]+/)[0]; + var value = href.match(/\=(.+)$/)[1]; + setFieldValue($(field_sel), 'text', value); + } + $(field_sel).trigger('change'); + }) + .find('.restore-default, .set-value') + // inline-block for IE so opacity inheritance works + .css({ display: 'inline-block', opacity: 0.25 }); +} + +AJAX.registerOnload('config.js', function () { + setupRestoreField(); +}); + +// +// END: "Restore default" and "set value" buttons +// ------------------------------------------------------------------ + +// ------------------------------------------------------------------ +// User preferences import/export +// + +AJAX.registerOnload('config.js', function () { + offerPrefsAutoimport(); + var $radios = $('#import_local_storage, #export_local_storage'); + if (!$radios.length) { + return; + } + + // enable JavaScript dependent fields + $radios + .prop('disabled', false) + .add('#export_text_file, #import_text_file') + .click(function () { + var enable_id = $(this).attr('id'); + var disable_id; + if (enable_id.match(/local_storage$/)) { + disable_id = enable_id.replace(/local_storage$/, 'text_file'); + } else { + disable_id = enable_id.replace(/text_file$/, 'local_storage'); + } + $('#opts_' + disable_id).addClass('disabled').find('input').prop('disabled', true); + $('#opts_' + enable_id).removeClass('disabled').find('input').prop('disabled', false); + }); + + // detect localStorage state + var ls_supported = isStorageSupported('localStorage', true); + var ls_exists = ls_supported ? (window.localStorage.config || false) : false; + $('div.localStorage-' + (ls_supported ? 'un' : '') + 'supported').hide(); + $('div.localStorage-' + (ls_exists ? 'empty' : 'exists')).hide(); + if (ls_exists) { + updatePrefsDate(); + } + $('form.prefs-form').change(function () { + var $form = $(this); + var disabled = false; + if (!ls_supported) { + disabled = $form.find('input[type=radio][value$=local_storage]').prop('checked'); + } else if (!ls_exists && $form.attr('name') === 'prefs_import' && + $('#import_local_storage')[0].checked + ) { + disabled = true; + } + $form.find('input[type=submit]').prop('disabled', disabled); + }).submit(function (e) { + var $form = $(this); + if ($form.attr('name') === 'prefs_export' && $('#export_local_storage')[0].checked) { + e.preventDefault(); + // use AJAX to read JSON settings and save them + savePrefsToLocalStorage($form); + } else if ($form.attr('name') === 'prefs_import' && $('#import_local_storage')[0].checked) { + // set 'json' input and submit form + $form.find('input[name=json]').val(window.localStorage.config); + } + }); + + $(document).on('click', 'div.click-hide-message', function () { + $(this) + .hide() + .parent('.group') + .css('height', '') + .next('form') + .show(); + }); +}); + +/** + * Saves user preferences to localStorage + * + * @param {Element} form + */ +function savePrefsToLocalStorage (form) { + $form = $(form); + var submit = $form.find('input[type=submit]'); + submit.prop('disabled', true); + $.ajax({ + url: 'prefs_manage.php', + cache: false, + type: 'POST', + data: { + ajax_request: true, + server: PMA_commonParams.get('server'), + submit_get_json: true + }, + success: function (data) { + if (typeof data !== 'undefined' && data.success === true) { + window.localStorage.config = data.prefs; + window.localStorage.config_mtime = data.mtime; + window.localStorage.config_mtime_local = (new Date()).toUTCString(); + updatePrefsDate(); + $('div.localStorage-empty').hide(); + $('div.localStorage-exists').show(); + var group = $form.parent('.group'); + group.css('height', group.height() + 'px'); + $form.hide('fast'); + $form.prev('.click-hide-message').show('fast'); + } else { + PMA_ajaxShowMessage(data.error); + } + }, + complete: function () { + submit.prop('disabled', false); + } + }); +} + +/** + * Updates preferences timestamp in Import form + */ +function updatePrefsDate () { + var d = new Date(window.localStorage.config_mtime_local); + var msg = PMA_messages.strSavedOn.replace( + '@DATE@', + PMA_formatDateTime(d) + ); + $('#opts_import_local_storage').find('div.localStorage-exists').html(msg); +} + +/** + * Prepares message which informs that localStorage preferences are available and can be imported or deleted + */ +function offerPrefsAutoimport () { + var has_config = (isStorageSupported('localStorage')) && (window.localStorage.config || false); + var $cnt = $('#prefs_autoload'); + if (!$cnt.length || !has_config) { + return; + } + $cnt.find('a').click(function (e) { + e.preventDefault(); + var $a = $(this); + if ($a.attr('href') === '#no') { + $cnt.remove(); + $.post('index.php', { + server: PMA_commonParams.get('server'), + prefs_autoload: 'hide' + }, null, 'html'); + return; + } else if ($a.attr('href') === '#delete') { + $cnt.remove(); + localStorage.clear(); + $.post('index.php', { + server: PMA_commonParams.get('server'), + prefs_autoload: 'hide' + }, null, 'html'); + return; + } + $cnt.find('input[name=json]').val(window.localStorage.config); + $cnt.find('form').submit(); + }); + $cnt.show(); +} + +// +// END: User preferences import/export +// ------------------------------------------------------------------ diff --git a/phpMyAdmin/js/console.js b/phpMyAdmin/js/console.js new file mode 100755 index 0000000..74ab018 --- /dev/null +++ b/phpMyAdmin/js/console.js @@ -0,0 +1,1495 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Used in or for console + * + * @package phpMyAdmin-Console + */ + +/** + * Console object + */ +var PMA_console = { + /** + * @var object, jQuery object, selector is '#pma_console>.content' + * @access private + */ + $consoleContent: null, + /** + * @var object, jQuery object, selector is '#pma_console .content', + * used for resizer + * @access private + */ + $consoleAllContents: null, + /** + * @var object, jQuery object, selector is '#pma_console .toolbar' + * @access private + */ + $consoleToolbar: null, + /** + * @var object, jQuery object, selector is '#pma_console .template' + * @access private + */ + $consoleTemplates: null, + /** + * @var object, jQuery object, form for submit + * @access private + */ + $requestForm: null, + /** + * @var object, contain console config + * @access private + */ + config: null, + /** + * @var bool, if console element exist, it'll be true + * @access public + */ + isEnabled: false, + /** + * @var bool, make sure console events bind only once + * @access private + */ + isInitialized: false, + /** + * Used for console initialize, reinit is ok, just some variable assignment + * + * @return void + */ + initialize: function () { + if ($('#pma_console').length === 0) { + return; + } + + PMA_console.config = configGet('Console', false); + + PMA_console.isEnabled = true; + + // Vars init + PMA_console.$consoleToolbar = $('#pma_console').find('>.toolbar'); + PMA_console.$consoleContent = $('#pma_console').find('>.content'); + PMA_console.$consoleAllContents = $('#pma_console').find('.content'); + PMA_console.$consoleTemplates = $('#pma_console').find('>.templates'); + + // Generate a from for post + PMA_console.$requestForm = $('
    ' + + '' + + '' + + '' + + '' + + '' + + '' + + '' + + '
    ' + ); + PMA_console.$requestForm.children('[name=token]').val(PMA_commonParams.get('token')); + PMA_console.$requestForm.on('submit', AJAX.requestHandler); + + // Event binds shouldn't run again + if (PMA_console.isInitialized === false) { + // Load config first + if (PMA_console.config.AlwaysExpand === true) { + $('#pma_console_options input[name=always_expand]').prop('checked', true); + } + if (PMA_console.config.StartHistory === true) { + $('#pma_console_options').find('input[name=start_history]').prop('checked', true); + } + if (PMA_console.config.CurrentQuery === true) { + $('#pma_console_options').find('input[name=current_query]').prop('checked', true); + } + if (PMA_console.config.EnterExecutes === true) { + $('#pma_console_options').find('input[name=enter_executes]').prop('checked', true); + } + if (PMA_console.config.DarkTheme === true) { + $('#pma_console_options').find('input[name=dark_theme]').prop('checked', true); + $('#pma_console').find('>.content').addClass('console_dark_theme'); + } + + PMA_consoleResizer.initialize(); + PMA_consoleInput.initialize(); + PMA_consoleMessages.initialize(); + PMA_consoleBookmarks.initialize(); + PMA_consoleDebug.initialize(); + + PMA_console.$consoleToolbar.children('.console_switch').click(PMA_console.toggle); + + $('#pma_console').find('.toolbar').children().mousedown(function (event) { + event.preventDefault(); + event.stopImmediatePropagation(); + }); + + $('#pma_console').find('.button.clear').click(function () { + PMA_consoleMessages.clear(); + }); + + $('#pma_console').find('.button.history').click(function () { + PMA_consoleMessages.showHistory(); + }); + + $('#pma_console').find('.button.options').click(function () { + PMA_console.showCard('#pma_console_options'); + }); + + $('#pma_console').find('.button.debug').click(function () { + PMA_console.showCard('#debug_console'); + }); + + PMA_console.$consoleContent.click(function (event) { + if (event.target === this) { + PMA_consoleInput.focus(); + } + }); + + $('#pma_console').find('.mid_layer').click(function () { + PMA_console.hideCard($(this).parent().children('.card')); + }); + $('#debug_console').find('.switch_button').click(function () { + PMA_console.hideCard($(this).closest('.card')); + }); + $('#pma_bookmarks').find('.switch_button').click(function () { + PMA_console.hideCard($(this).closest('.card')); + }); + $('#pma_console_options').find('.switch_button').click(function () { + PMA_console.hideCard($(this).closest('.card')); + }); + + $('#pma_console_options').find('input[type=checkbox]').change(function () { + PMA_console.updateConfig(); + }); + + $('#pma_console_options').find('.button.default').click(function () { + $('#pma_console_options input[name=always_expand]').prop('checked', false); + $('#pma_console_options').find('input[name=start_history]').prop('checked', false); + $('#pma_console_options').find('input[name=current_query]').prop('checked', true); + $('#pma_console_options').find('input[name=enter_executes]').prop('checked', false); + $('#pma_console_options').find('input[name=dark_theme]').prop('checked', false); + PMA_console.updateConfig(); + }); + + $('#pma_console_options').find('input[name=enter_executes]').change(function () { + PMA_consoleMessages.showInstructions(PMA_console.config.EnterExecutes); + }); + + $(document).ajaxComplete(function (event, xhr, ajaxOptions) { + if (ajaxOptions.dataType && ajaxOptions.dataType.indexOf('json') !== -1) { + return; + } + if (xhr.status !== 200) { + return; + } + try { + var data = JSON.parse(xhr.responseText); + PMA_console.ajaxCallback(data); + } catch (e) { + console.trace(); + console.log('Failed to parse JSON: ' + e.message); + } + }); + + PMA_console.isInitialized = true; + } + + // Change console mode from cookie + switch (PMA_console.config.Mode) { + case 'collapse': + PMA_console.collapse(); + break; + /* jshint -W086 */// no break needed in default section + default: + PMA_console.setConfig('Mode', 'info'); + case 'info': + /* jshint +W086 */ + PMA_console.info(); + break; + case 'show': + PMA_console.show(true); + PMA_console.scrollBottom(); + break; + } + }, + /** + * Execute query and show results in console + * + * @return void + */ + execute: function (queryString, options) { + if (typeof(queryString) !== 'string' || ! /[a-z]|[A-Z]/.test(queryString)) { + return; + } + PMA_console.$requestForm.children('textarea').val(queryString); + PMA_console.$requestForm.children('[name=server]').attr('value', PMA_commonParams.get('server')); + if (options && options.db) { + PMA_console.$requestForm.children('[name=db]').val(options.db); + if (options.table) { + PMA_console.$requestForm.children('[name=table]').val(options.table); + } else { + PMA_console.$requestForm.children('[name=table]').val(''); + } + } else { + PMA_console.$requestForm.children('[name=db]').val( + (PMA_commonParams.get('db').length > 0 ? PMA_commonParams.get('db') : '')); + } + PMA_console.$requestForm.find('[name=profiling]').remove(); + if (options && options.profiling === true) { + PMA_console.$requestForm.append(''); + } + if (! confirmQuery(PMA_console.$requestForm[0], PMA_console.$requestForm.children('textarea')[0].value)) { + return; + } + PMA_console.$requestForm.children('[name=console_message_id]') + .val(PMA_consoleMessages.appendQuery({ sql_query: queryString }).message_id); + PMA_console.$requestForm.trigger('submit'); + PMA_consoleInput.clear(); + PMA_reloadNavigation(); + }, + ajaxCallback: function (data) { + if (data && data.console_message_id) { + PMA_consoleMessages.updateQuery(data.console_message_id, data.success, + (data._reloadQuerywindow ? data._reloadQuerywindow : false)); + } else if (data && data._reloadQuerywindow) { + if (data._reloadQuerywindow.sql_query.length > 0) { + PMA_consoleMessages.appendQuery(data._reloadQuerywindow, 'successed') + .$message.addClass(PMA_console.config.CurrentQuery ? '' : 'hide'); + } + } + }, + /** + * Change console to collapse mode + * + * @return void + */ + collapse: function () { + PMA_console.setConfig('Mode', 'collapse'); + var pmaConsoleHeight = Math.max(92, PMA_console.config.Height); + + PMA_console.$consoleToolbar.addClass('collapsed'); + PMA_console.$consoleAllContents.height(pmaConsoleHeight); + PMA_console.$consoleContent.stop(); + PMA_console.$consoleContent.animate({ 'margin-bottom': -1 * PMA_console.$consoleContent.outerHeight() + 'px' }, + 'fast', 'easeOutQuart', function () { + PMA_console.$consoleContent.css({ display:'none' }); + $(window).trigger('resize'); + }); + PMA_console.hideCard(); + }, + /** + * Show console + * + * @param bool inputFocus If true, focus the input line after show() + * @return void + */ + show: function (inputFocus) { + PMA_console.setConfig('Mode', 'show'); + + var pmaConsoleHeight = Math.max(92, PMA_console.config.Height); + pmaConsoleHeight = Math.min(PMA_console.config.Height, (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) - 25); + PMA_console.$consoleContent.css({ display:'block' }); + if (PMA_console.$consoleToolbar.hasClass('collapsed')) { + PMA_console.$consoleToolbar.removeClass('collapsed'); + } + PMA_console.$consoleAllContents.height(pmaConsoleHeight); + PMA_console.$consoleContent.stop(); + PMA_console.$consoleContent.animate({ 'margin-bottom': 0 }, + 'fast', 'easeOutQuart', function () { + $(window).trigger('resize'); + if (inputFocus) { + PMA_consoleInput.focus(); + } + }); + }, + /** + * Change console to SQL information mode + * this mode shows current SQL query + * This mode is the default mode + * + * @return void + */ + info: function () { + // Under construction + PMA_console.collapse(); + }, + /** + * Toggle console mode between collapse/show + * Used for toggle buttons and shortcuts + * + * @return void + */ + toggle: function () { + switch (PMA_console.config.Mode) { + case 'collapse': + case 'info': + PMA_console.show(true); + break; + case 'show': + PMA_console.collapse(); + break; + default: + PMA_consoleInitialize(); + } + }, + /** + * Scroll console to bottom + * + * @return void + */ + scrollBottom: function () { + PMA_console.$consoleContent.scrollTop(PMA_console.$consoleContent.prop('scrollHeight')); + }, + /** + * Show card + * + * @param string cardSelector Selector, select string will be "#pma_console " + cardSelector + * this param also can be JQuery object, if you need. + * + * @return void + */ + showCard: function (cardSelector) { + var $card = null; + if (typeof(cardSelector) !== 'string') { + if (cardSelector.length > 0) { + $card = cardSelector; + } else { + return; + } + } else { + $card = $('#pma_console ' + cardSelector); + } + if ($card.length === 0) { + return; + } + $card.parent().children('.mid_layer').show().fadeTo(0, 0.15); + $card.addClass('show'); + PMA_consoleInput.blur(); + if ($card.parents('.card').length > 0) { + PMA_console.showCard($card.parents('.card')); + } + }, + /** + * Scroll console to bottom + * + * @param object $targetCard Target card JQuery object, if it's empty, function will hide all cards + * @return void + */ + hideCard: function ($targetCard) { + if (! $targetCard) { + $('#pma_console').find('.mid_layer').fadeOut(140); + $('#pma_console').find('.card').removeClass('show'); + } else if ($targetCard.length > 0) { + $targetCard.parent().find('.mid_layer').fadeOut(140); + $targetCard.find('.card').removeClass('show'); + $targetCard.removeClass('show'); + } + }, + /** + * Used for update console config + * + * @return void + */ + updateConfig: function () { + PMA_console.setConfig('AlwaysExpand', $('#pma_console_options input[name=always_expand]').prop('checked')); + PMA_console.setConfig('StartHistory', $('#pma_console_options').find('input[name=start_history]').prop('checked')); + PMA_console.setConfig('CurrentQuery', $('#pma_console_options').find('input[name=current_query]').prop('checked')); + PMA_console.setConfig('EnterExecutes', $('#pma_console_options').find('input[name=enter_executes]').prop('checked')); + PMA_console.setConfig('DarkTheme', $('#pma_console_options').find('input[name=dark_theme]').prop('checked')); + /* Setting the dark theme of the console*/ + if (PMA_console.config.DarkTheme) { + $('#pma_console').find('>.content').addClass('console_dark_theme'); + } else { + $('#pma_console').find('>.content').removeClass('console_dark_theme'); + } + }, + setConfig: function (key, value) { + PMA_console.config[key] = value; + configSet('Console/' + key, value); + }, + isSelect: function (queryString) { + var reg_exp = /^SELECT\s+/i; + return reg_exp.test(queryString); + } +}; + +/** + * Resizer object + * Careful: this object UI logics highly related with functions under PMA_console + * Resizing min-height is 32, if small than it, console will collapse + */ +var PMA_consoleResizer = { + _posY: 0, + _height: 0, + _resultHeight: 0, + /** + * Mousedown event handler for bind to resizer + * + * @return void + */ + _mousedown: function (event) { + if (PMA_console.config.Mode !== 'show') { + return; + } + PMA_consoleResizer._posY = event.pageY; + PMA_consoleResizer._height = PMA_console.$consoleContent.height(); + $(document).mousemove(PMA_consoleResizer._mousemove); + $(document).mouseup(PMA_consoleResizer._mouseup); + // Disable text selection while resizing + $(document).on('selectstart', function () { + return false; + }); + }, + /** + * Mousemove event handler for bind to resizer + * + * @return void + */ + _mousemove: function (event) { + if (event.pageY < 35) { + event.pageY = 35; + } + PMA_consoleResizer._resultHeight = PMA_consoleResizer._height + (PMA_consoleResizer._posY - event.pageY); + // Content min-height is 32, if adjusting height small than it we'll move it out of the page + if (PMA_consoleResizer._resultHeight <= 32) { + PMA_console.$consoleAllContents.height(32); + PMA_console.$consoleContent.css('margin-bottom', PMA_consoleResizer._resultHeight - 32); + } else { + // Logic below makes viewable area always at bottom when adjusting height and content already at bottom + if (PMA_console.$consoleContent.scrollTop() + PMA_console.$consoleContent.innerHeight() + 16 + >= PMA_console.$consoleContent.prop('scrollHeight')) { + PMA_console.$consoleAllContents.height(PMA_consoleResizer._resultHeight); + PMA_console.scrollBottom(); + } else { + PMA_console.$consoleAllContents.height(PMA_consoleResizer._resultHeight); + } + } + }, + /** + * Mouseup event handler for bind to resizer + * + * @return void + */ + _mouseup: function () { + PMA_console.setConfig('Height', PMA_consoleResizer._resultHeight); + PMA_console.show(); + $(document).off('mousemove'); + $(document).off('mouseup'); + $(document).off('selectstart'); + }, + /** + * Used for console resizer initialize + * + * @return void + */ + initialize: function () { + $('#pma_console').find('.toolbar').off('mousedown'); + $('#pma_console').find('.toolbar').mousedown(PMA_consoleResizer._mousedown); + } +}; + + +/** + * Console input object + */ +var PMA_consoleInput = { + /** + * @var array, contains Codemirror objects or input jQuery objects + * @access private + */ + _inputs: null, + /** + * @var bool, if codemirror enabled + * @access private + */ + _codemirror: false, + /** + * @var int, count for history navigation, 0 for current input + * @access private + */ + _historyCount: 0, + /** + * @var string, current input when navigating through history + * @access private + */ + _historyPreserveCurrent: null, + /** + * Used for console input initialize + * + * @return void + */ + initialize: function () { + // _cm object can't be reinitialize + if (PMA_consoleInput._inputs !== null) { + return; + } + if (typeof CodeMirror !== 'undefined') { + PMA_consoleInput._codemirror = true; + } + PMA_consoleInput._inputs = []; + if (PMA_consoleInput._codemirror) { + PMA_consoleInput._inputs.console = CodeMirror($('#pma_console').find('.console_query_input')[0], { + theme: 'pma', + mode: 'text/x-sql', + lineWrapping: true, + extraKeys: { 'Ctrl-Space': 'autocomplete' }, + hintOptions: { 'completeSingle': false, 'completeOnSingleClick': true }, + gutters: ['CodeMirror-lint-markers'], + lint: { + 'getAnnotations': CodeMirror.sqlLint, + 'async': true, + } + }); + PMA_consoleInput._inputs.console.on('inputRead', codemirrorAutocompleteOnInputRead); + PMA_consoleInput._inputs.console.on('keydown', function (instance, event) { + PMA_consoleInput._historyNavigate(event); + }); + if ($('#pma_bookmarks').length !== 0) { + PMA_consoleInput._inputs.bookmark = CodeMirror($('#pma_console').find('.bookmark_add_input')[0], { + theme: 'pma', + mode: 'text/x-sql', + lineWrapping: true, + extraKeys: { 'Ctrl-Space': 'autocomplete' }, + hintOptions: { 'completeSingle': false, 'completeOnSingleClick': true }, + gutters: ['CodeMirror-lint-markers'], + lint: { + 'getAnnotations': CodeMirror.sqlLint, + 'async': true, + } + }); + PMA_consoleInput._inputs.bookmark.on('inputRead', codemirrorAutocompleteOnInputRead); + } + } else { + PMA_consoleInput._inputs.console = + $('\n'; + new_content += getForeignKeyCheckboxLoader(); + new_content += '\n'; + new_content += '\n'; + var $editor_area = $('div#inline_editor'); + if ($editor_area.length === 0) { + $editor_area = $('
    '); + $editor_area.insertBefore($inner_sql); + } + $editor_area.html(new_content); + loadForeignKeyCheckbox(); + $inner_sql.hide(); + + bindCodeMirrorToInlineEditor(); + return false; + }); + + $(document).on('click', 'input#sql_query_edit_save', function () { + // hide already existing success message + var sql_query; + if (codemirror_inline_editor) { + codemirror_inline_editor.save(); + sql_query = codemirror_inline_editor.getValue(); + } else { + sql_query = $(this).parent().find('#sql_query_edit').val(); + } + var fk_check = $(this).parent().find('#fk_checks').is(':checked'); + + var $form = $('a.inline_edit_sql').prev('form'); + var $fake_form = $('
    ', { action: 'import.php', method: 'post' }) + .append($form.find('input[name=server], input[name=db], input[name=table], input[name=token]').clone()) + .append($('', { type: 'hidden', name: 'show_query', value: 1 })) + .append($('', { type: 'hidden', name: 'is_js_confirmed', value: 0 })) + .append($('', { type: 'hidden', name: 'sql_query', value: sql_query })) + .append($('', { type: 'hidden', name: 'fk_checks', value: fk_check ? 1 : 0 })); + if (! checkSqlQuery($fake_form[0])) { + return false; + } + $('.success').hide(); + $fake_form.appendTo($('body')).submit(); + }); + + $(document).on('click', 'input#sql_query_edit_discard', function () { + var $divEditor = $('div#inline_editor_outer'); + $divEditor.siblings('code.sql').show(); + $divEditor.remove(); + }); + + $(document).on('click', 'input.sqlbutton', function (evt) { + insertQuery(evt.target.id); + PMA_handleSimulateQueryButton(); + return false; + }); + + $(document).on('change', '#parameterized', updateQueryParameters); + + var $inputUsername = $('#input_username'); + if ($inputUsername) { + if ($inputUsername.val() === '') { + $inputUsername.trigger('focus'); + } else { + $('#input_password').trigger('focus'); + } + } +}); + +/** + * "inputRead" event handler for CodeMirror SQL query editors for autocompletion + */ +function codemirrorAutocompleteOnInputRead (instance) { + if (!sql_autocomplete_in_progress + && (!instance.options.hintOptions.tables || !sql_autocomplete)) { + if (!sql_autocomplete) { + // Reset after teardown + instance.options.hintOptions.tables = false; + instance.options.hintOptions.defaultTable = ''; + + sql_autocomplete_in_progress = true; + + var href = 'db_sql_autocomplete.php'; + var params = { + 'ajax_request': true, + 'server': PMA_commonParams.get('server'), + 'db': PMA_commonParams.get('db'), + 'no_debug': true + }; + + var columnHintRender = function (elem, self, data) { + $('
    ') + .text(data.columnName) + .appendTo(elem); + $('
    ') + .text(data.columnHint) + .appendTo(elem); + }; + + $.ajax({ + type: 'POST', + url: href, + data: params, + success: function (data) { + if (data.success) { + var tables = JSON.parse(data.tables); + sql_autocomplete_default_table = PMA_commonParams.get('table'); + sql_autocomplete = []; + for (var table in tables) { + if (tables.hasOwnProperty(table)) { + var columns = tables[table]; + table = { + text: table, + columns: [] + }; + for (var column in columns) { + if (columns.hasOwnProperty(column)) { + var displayText = columns[column].Type; + if (columns[column].Key === 'PRI') { + displayText += ' | Primary'; + } else if (columns[column].Key === 'UNI') { + displayText += ' | Unique'; + } + table.columns.push({ + text: column, + displayText: column + ' | ' + displayText, + columnName: column, + columnHint: displayText, + render: columnHintRender + }); + } + } + } + sql_autocomplete.push(table); + } + instance.options.hintOptions.tables = sql_autocomplete; + instance.options.hintOptions.defaultTable = sql_autocomplete_default_table; + } + }, + complete: function () { + sql_autocomplete_in_progress = false; + } + }); + } else { + instance.options.hintOptions.tables = sql_autocomplete; + instance.options.hintOptions.defaultTable = sql_autocomplete_default_table; + } + } + if (instance.state.completionActive) { + return; + } + var cur = instance.getCursor(); + var token = instance.getTokenAt(cur); + var string = ''; + if (token.string.match(/^[.`\w@]\w*$/)) { + string = token.string; + } + if (string.length > 0) { + CodeMirror.commands.autocomplete(instance); + } +} + +/** + * Remove autocomplete information before tearing down a page + */ +AJAX.registerTeardown('functions.js', function () { + sql_autocomplete = false; + sql_autocomplete_default_table = ''; +}); + +/** + * Binds the CodeMirror to the text area used to inline edit a query. + */ +function bindCodeMirrorToInlineEditor () { + var $inline_editor = $('#sql_query_edit'); + if ($inline_editor.length > 0) { + if (typeof CodeMirror !== 'undefined') { + var height = $inline_editor.css('height'); + codemirror_inline_editor = PMA_getSQLEditor($inline_editor); + codemirror_inline_editor.getWrapperElement().style.height = height; + codemirror_inline_editor.refresh(); + codemirror_inline_editor.focus(); + $(codemirror_inline_editor.getWrapperElement()) + .on('keydown', catchKeypressesFromSqlInlineEdit); + } else { + $inline_editor + .focus() + .on('keydown', catchKeypressesFromSqlInlineEdit); + } + } +} + +function catchKeypressesFromSqlInlineEdit (event) { + // ctrl-enter is 10 in chrome and ie, but 13 in ff + if ((event.ctrlKey || event.metaKey) && (event.keyCode === 13 || event.keyCode === 10)) { + $('#sql_query_edit_save').trigger('click'); + } +} + +/** + * Adds doc link to single highlighted SQL element + */ +function PMA_doc_add ($elm, params) { + if (typeof mysql_doc_template === 'undefined') { + return; + } + + var url = PMA_sprintf( + decodeURIComponent(mysql_doc_template), + params[0] + ); + if (params.length > 1) { + url += '#' + params[1]; + } + var content = $elm.text(); + $elm.text(''); + $elm.append('' + content + ''); +} + +/** + * Generates doc links for keywords inside highlighted SQL + */ +function PMA_doc_keyword (idx, elm) { + var $elm = $(elm); + /* Skip already processed ones */ + if ($elm.find('a').length > 0) { + return; + } + var keyword = $elm.text().toUpperCase(); + var $next = $elm.next('.cm-keyword'); + if ($next) { + var next_keyword = $next.text().toUpperCase(); + var full = keyword + ' ' + next_keyword; + + var $next2 = $next.next('.cm-keyword'); + if ($next2) { + var next2_keyword = $next2.text().toUpperCase(); + var full2 = full + ' ' + next2_keyword; + if (full2 in mysql_doc_keyword) { + PMA_doc_add($elm, mysql_doc_keyword[full2]); + PMA_doc_add($next, mysql_doc_keyword[full2]); + PMA_doc_add($next2, mysql_doc_keyword[full2]); + return; + } + } + if (full in mysql_doc_keyword) { + PMA_doc_add($elm, mysql_doc_keyword[full]); + PMA_doc_add($next, mysql_doc_keyword[full]); + return; + } + } + if (keyword in mysql_doc_keyword) { + PMA_doc_add($elm, mysql_doc_keyword[keyword]); + } +} + +/** + * Generates doc links for builtins inside highlighted SQL + */ +function PMA_doc_builtin (idx, elm) { + var $elm = $(elm); + var builtin = $elm.text().toUpperCase(); + if (builtin in mysql_doc_builtin) { + PMA_doc_add($elm, mysql_doc_builtin[builtin]); + } +} + +/** + * Higlights SQL using CodeMirror. + */ +function PMA_highlightSQL ($base) { + var $elm = $base.find('code.sql'); + $elm.each(function () { + var $sql = $(this); + var $pre = $sql.find('pre'); + /* We only care about visible elements to avoid double processing */ + if ($pre.is(':visible')) { + var $highlight = $('
    '); + $sql.append($highlight); + if (typeof CodeMirror !== 'undefined') { + CodeMirror.runMode($sql.text(), 'text/x-mysql', $highlight[0]); + $pre.hide(); + $highlight.find('.cm-keyword').each(PMA_doc_keyword); + $highlight.find('.cm-builtin').each(PMA_doc_builtin); + } + } + }); +} + +/** + * Updates an element containing code. + * + * @param jQuery Object $base base element which contains the raw and the + * highlighted code. + * + * @param string htmlValue code in HTML format, displayed if code cannot be + * highlighted + * + * @param string rawValue raw code, used as a parameter for highlighter + * + * @return bool whether content was updated or not + */ +function PMA_updateCode ($base, htmlValue, rawValue) { + var $code = $base.find('code'); + if ($code.length === 0) { + return false; + } + + // Determines the type of the content and appropriate CodeMirror mode. + var type = ''; + var mode = ''; + if ($code.hasClass('json')) { + type = 'json'; + mode = 'application/json'; + } else if ($code.hasClass('sql')) { + type = 'sql'; + mode = 'text/x-mysql'; + } else if ($code.hasClass('xml')) { + type = 'xml'; + mode = 'application/xml'; + } else { + return false; + } + + // Element used to display unhighlighted code. + var $notHighlighted = $('
    ' + htmlValue + '
    '); + + // Tries to highlight code using CodeMirror. + if (typeof CodeMirror !== 'undefined') { + var $highlighted = $('
    '); + CodeMirror.runMode(rawValue, mode, $highlighted[0]); + $notHighlighted.hide(); + $code.html('').append($notHighlighted, $highlighted[0]); + } else { + $code.html('').append($notHighlighted); + } + + return true; +} + +/** + * Show a message on the top of the page for an Ajax request + * + * Sample usage: + * + * 1) var $msg = PMA_ajaxShowMessage(); + * This will show a message that reads "Loading...". Such a message will not + * disappear automatically and cannot be dismissed by the user. To remove this + * message either the PMA_ajaxRemoveMessage($msg) function must be called or + * another message must be show with PMA_ajaxShowMessage() function. + * + * 2) var $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + * This is a special case. The behaviour is same as above, + * just with a different message + * + * 3) var $msg = PMA_ajaxShowMessage('The operation was successful'); + * This will show a message that will disappear automatically and it can also + * be dismissed by the user. + * + * 4) var $msg = PMA_ajaxShowMessage('Some error', false); + * This will show a message that will not disappear automatically, but it + * can be dismissed by the user after he has finished reading it. + * + * @param string message string containing the message to be shown. + * optional, defaults to 'Loading...' + * @param mixed timeout number of milliseconds for the message to be visible + * optional, defaults to 5000. If set to 'false', the + * notification will never disappear + * @param string type string to dictate the type of message shown. + * optional, defaults to normal notification. + * If set to 'error', the notification will show message + * with red background. + * If set to 'success', the notification will show with + * a green background. + * @return jQuery object jQuery Element that holds the message div + * this object can be passed to PMA_ajaxRemoveMessage() + * to remove the notification + */ +function PMA_ajaxShowMessage (message, timeout, type) { + /** + * @var self_closing Whether the notification will automatically disappear + */ + var self_closing = true; + /** + * @var dismissable Whether the user will be able to remove + * the notification by clicking on it + */ + var dismissable = true; + // Handle the case when a empty data.message is passed. + // We don't want the empty message + if (message === '') { + return true; + } else if (! message) { + // If the message is undefined, show the default + message = PMA_messages.strLoading; + dismissable = false; + self_closing = false; + } else if (message === PMA_messages.strProcessingRequest) { + // This is another case where the message should not disappear + dismissable = false; + self_closing = false; + } + // Figure out whether (or after how long) to remove the notification + if (timeout === undefined) { + timeout = 5000; + } else if (timeout === false) { + self_closing = false; + } + // Determine type of message, add styling as required + if (type === 'error') { + message = '
    ' + message + '
    '; + } else if (type === 'success') { + message = '
    ' + message + '
    '; + } + // Create a parent element for the AJAX messages, if necessary + if ($('#loading_parent').length === 0) { + $('
    ') + .prependTo('#page_content'); + } + // Update message count to create distinct message elements every time + ajax_message_count++; + // Remove all old messages, if any + $('span.ajax_notification[id^=ajax_message_num]').remove(); + /** + * @var $retval a jQuery object containing the reference + * to the created AJAX message + */ + var $retval = $( + '' + ) + .hide() + .appendTo('#loading_parent') + .html(message) + .show(); + // If the notification is self-closing we should create a callback to remove it + if (self_closing) { + $retval + .delay(timeout) + .fadeOut('medium', function () { + if ($(this).is(':data(tooltip)')) { + $(this).tooltip('destroy'); + } + // Remove the notification + $(this).remove(); + }); + } + // If the notification is dismissable we need to add the relevant class to it + // and add a tooltip so that the users know that it can be removed + if (dismissable) { + $retval.addClass('dismissable').css('cursor', 'pointer'); + /** + * Add a tooltip to the notification to let the user know that (s)he + * can dismiss the ajax notification by clicking on it. + */ + PMA_tooltip( + $retval, + 'span', + PMA_messages.strDismiss + ); + } + PMA_highlightSQL($retval); + + return $retval; +} + +/** + * Removes the message shown for an Ajax operation when it's completed + * + * @param jQuery object jQuery Element that holds the notification + * + * @return nothing + */ +function PMA_ajaxRemoveMessage ($this_msgbox) { + if ($this_msgbox !== undefined && $this_msgbox instanceof jQuery) { + $this_msgbox + .stop(true, true) + .fadeOut('medium'); + if ($this_msgbox.is(':data(tooltip)')) { + $this_msgbox.tooltip('destroy'); + } else { + $this_msgbox.remove(); + } + } +} + +/** + * Requests SQL for previewing before executing. + * + * @param jQuery Object $form Form containing query data + * + * @return void + */ +function PMA_previewSQL ($form) { + var form_url = $form.attr('action'); + var sep = PMA_commonParams.get('arg_separator'); + var form_data = $form.serialize() + + sep + 'do_save_data=1' + + sep + 'preview_sql=1' + + sep + 'ajax_request=1'; + var $msgbox = PMA_ajaxShowMessage(); + $.ajax({ + type: 'POST', + url: form_url, + data: form_data, + success: function (response) { + PMA_ajaxRemoveMessage($msgbox); + if (response.success) { + var $dialog_content = $('
    ') + .append(response.sql_data); + var button_options = {}; + button_options[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + var $response_dialog = $dialog_content.dialog({ + minWidth: 550, + maxHeight: 400, + modal: true, + buttons: button_options, + title: PMA_messages.strPreviewSQL, + close: function () { + $(this).remove(); + }, + open: function () { + // Pretty SQL printing. + PMA_highlightSQL($(this)); + } + }); + } else { + PMA_ajaxShowMessage(response.message); + } + }, + error: function () { + PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest); + } + }); +} + +/** + * Callback called when submit/"OK" is clicked on sql preview/confirm modal + * + * @callback onSubmitCallback + * @param {string} url The url + */ + +/** + * + * @param {string} sql_data Sql query to preview + * @param {string} url Url to be sent to callback + * @param {onSubmitCallback} callback On submit callback function + * + * @return void + */ +function PMA_confirmPreviewSQL (sql_data, url, callback) { + var $dialog_content = $('
    '
    +        + sql_data
    +        + '
    ' + ); + var button_options = [ + { + text: PMA_messages.strOK, + class: 'submitOK', + click: function () { + callback(url); + } + }, + { + text: PMA_messages.strCancel, + class: 'submitCancel', + click: function () { + $(this).dialog('close'); + } + } + ]; + var $response_dialog = $dialog_content.dialog({ + minWidth: 550, + maxHeight: 400, + modal: true, + buttons: button_options, + title: PMA_messages.strPreviewSQL, + close: function () { + $(this).remove(); + }, + open: function () { + // Pretty SQL printing. + PMA_highlightSQL($(this)); + } + }); +} + +/** + * check for reserved keyword column name + * + * @param jQuery Object $form Form + * + * @returns true|false + */ + +function PMA_checkReservedWordColumns ($form) { + var is_confirmed = true; + $.ajax({ + type: 'POST', + url: 'tbl_structure.php', + data: $form.serialize() + PMA_commonParams.get('arg_separator') + 'reserved_word_check=1', + success: function (data) { + if (typeof data.success !== 'undefined' && data.success === true) { + is_confirmed = confirm(data.message); + } + }, + async:false + }); + return is_confirmed; +} + +// This event only need to be fired once after the initial page load +$(function () { + /** + * Allows the user to dismiss a notification + * created with PMA_ajaxShowMessage() + */ + $(document).on('click', 'span.ajax_notification.dismissable', function () { + PMA_ajaxRemoveMessage($(this)); + }); + /** + * The below two functions hide the "Dismiss notification" tooltip when a user + * is hovering a link or button that is inside an ajax message + */ + $(document).on('mouseover', 'span.ajax_notification a, span.ajax_notification button, span.ajax_notification input', function () { + if ($(this).parents('span.ajax_notification').is(':data(tooltip)')) { + $(this).parents('span.ajax_notification').tooltip('disable'); + } + }); + $(document).on('mouseout', 'span.ajax_notification a, span.ajax_notification button, span.ajax_notification input', function () { + if ($(this).parents('span.ajax_notification').is(':data(tooltip)')) { + $(this).parents('span.ajax_notification').tooltip('enable'); + } + }); +}); + +/** + * Hides/shows the "Open in ENUM/SET editor" message, depending on the data type of the column currently selected + */ +function PMA_showNoticeForEnum (selectElement) { + var enum_notice_id = selectElement.attr('id').split('_')[1]; + enum_notice_id += '_' + (parseInt(selectElement.attr('id').split('_')[2], 10) + 1); + var selectedType = selectElement.val(); + if (selectedType === 'ENUM' || selectedType === 'SET') { + $('p#enum_notice_' + enum_notice_id).show(); + } else { + $('p#enum_notice_' + enum_notice_id).hide(); + } +} + +/** + * Creates a Profiling Chart. Used in sql.js + * and in server_status_monitor.js + */ +function PMA_createProfilingChart (target, data) { + // create the chart + var factory = new JQPlotChartFactory(); + var chart = factory.createChart(ChartType.PIE, target); + + // create the data table and add columns + var dataTable = new DataTable(); + dataTable.addColumn(ColumnType.STRING, ''); + dataTable.addColumn(ColumnType.NUMBER, ''); + dataTable.setData(data); + + var windowWidth = $(window).width(); + var location = 's'; + if (windowWidth > 768) { + var location = 'se'; + } + + // draw the chart and return the chart object + chart.draw(dataTable, { + seriesDefaults: { + rendererOptions: { + showDataLabels: true + } + }, + highlighter: { + tooltipLocation: 'se', + sizeAdjust: 0, + tooltipAxes: 'pieref', + formatString: '%s, %.9Ps' + }, + legend: { + show: true, + location: location, + rendererOptions: { + numberColumns: 2 + } + }, + // from http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines#Color_Palette + seriesColors: [ + '#fce94f', + '#fcaf3e', + '#e9b96e', + '#8ae234', + '#729fcf', + '#ad7fa8', + '#ef2929', + '#888a85', + '#c4a000', + '#ce5c00', + '#8f5902', + '#4e9a06', + '#204a87', + '#5c3566', + '#a40000', + '#babdb6', + '#2e3436' + ] + }); + return chart; +} + +/** + * Formats a profiling duration nicely (in us and ms time). + * Used in server_status_monitor.js + * + * @param integer Number to be formatted, should be in the range of microsecond to second + * @param integer Accuracy, how many numbers right to the comma should be + * @return string The formatted number + */ +function PMA_prettyProfilingNum (num, acc) { + if (!acc) { + acc = 2; + } + acc = Math.pow(10, acc); + if (num * 1000 < 0.1) { + num = Math.round(acc * (num * 1000 * 1000)) / acc + '碌'; + } else if (num < 0.1) { + num = Math.round(acc * (num * 1000)) / acc + 'm'; + } else { + num = Math.round(acc * num) / acc; + } + + return num + 's'; +} + + +/** + * Formats a SQL Query nicely with newlines and indentation. Depends on Codemirror and MySQL Mode! + * + * @param string Query to be formatted + * @return string The formatted query + */ +function PMA_SQLPrettyPrint (string) { + if (typeof CodeMirror === 'undefined') { + return string; + } + + var mode = CodeMirror.getMode({}, 'text/x-mysql'); + var stream = new CodeMirror.StringStream(string); + var state = mode.startState(); + var token; + var tokens = []; + var output = ''; + var tabs = function (cnt) { + var ret = ''; + for (var i = 0; i < 4 * cnt; i++) { + ret += ' '; + } + return ret; + }; + + // "root-level" statements + var statements = { + 'select': ['select', 'from', 'on', 'where', 'having', 'limit', 'order by', 'group by'], + 'update': ['update', 'set', 'where'], + 'insert into': ['insert into', 'values'] + }; + // don't put spaces before these tokens + var spaceExceptionsBefore = { ';': true, ',': true, '.': true, '(': true }; + // don't put spaces after these tokens + var spaceExceptionsAfter = { '.': true }; + + // Populate tokens array + var str = ''; + while (! stream.eol()) { + stream.start = stream.pos; + token = mode.token(stream, state); + if (token !== null) { + tokens.push([token, stream.current().toLowerCase()]); + } + } + + var currentStatement = tokens[0][1]; + + if (! statements[currentStatement]) { + return string; + } + // Holds all currently opened code blocks (statement, function or generic) + var blockStack = []; + // Holds the type of block from last iteration (the current is in blockStack[0]) + var previousBlock; + // If a new code block is found, newBlock contains its type for one iteration and vice versa for endBlock + var newBlock; + var endBlock; + // How much to indent in the current line + var indentLevel = 0; + // Holds the "root-level" statements + var statementPart; + var lastStatementPart = statements[currentStatement][0]; + + blockStack.unshift('statement'); + + // Iterate through every token and format accordingly + for (var i = 0; i < tokens.length; i++) { + previousBlock = blockStack[0]; + + // New block => push to stack + if (tokens[i][1] === '(') { + if (i < tokens.length - 1 && tokens[i + 1][0] === 'statement-verb') { + blockStack.unshift(newBlock = 'statement'); + } else if (i > 0 && tokens[i - 1][0] === 'builtin') { + blockStack.unshift(newBlock = 'function'); + } else { + blockStack.unshift(newBlock = 'generic'); + } + } else { + newBlock = null; + } + + // Block end => pop from stack + if (tokens[i][1] === ')') { + endBlock = blockStack[0]; + blockStack.shift(); + } else { + endBlock = null; + } + + // A subquery is starting + if (i > 0 && newBlock === 'statement') { + indentLevel++; + output += '\n' + tabs(indentLevel) + tokens[i][1] + ' ' + tokens[i + 1][1].toUpperCase() + '\n' + tabs(indentLevel + 1); + currentStatement = tokens[i + 1][1]; + i++; + continue; + } + + // A subquery is ending + if (endBlock === 'statement' && indentLevel > 0) { + output += '\n' + tabs(indentLevel); + indentLevel--; + } + + // One less indentation for statement parts (from, where, order by, etc.) and a newline + statementPart = statements[currentStatement].indexOf(tokens[i][1]); + if (statementPart !== -1) { + if (i > 0) { + output += '\n'; + } + output += tabs(indentLevel) + tokens[i][1].toUpperCase(); + output += '\n' + tabs(indentLevel + 1); + lastStatementPart = tokens[i][1]; + // Normal indentation and spaces for everything else + } else { + if (! spaceExceptionsBefore[tokens[i][1]] && + ! (i > 0 && spaceExceptionsAfter[tokens[i - 1][1]]) && + output.charAt(output.length - 1) !== ' ') { + output += ' '; + } + if (tokens[i][0] === 'keyword') { + output += tokens[i][1].toUpperCase(); + } else { + output += tokens[i][1]; + } + } + + // split columns in select and 'update set' clauses, but only inside statements blocks + if ((lastStatementPart === 'select' || lastStatementPart === 'where' || lastStatementPart === 'set') && + tokens[i][1] === ',' && blockStack[0] === 'statement') { + output += '\n' + tabs(indentLevel + 1); + } + + // split conditions in where clauses, but only inside statements blocks + if (lastStatementPart === 'where' && + (tokens[i][1] === 'and' || tokens[i][1] === 'or' || tokens[i][1] === 'xor')) { + if (blockStack[0] === 'statement') { + output += '\n' + tabs(indentLevel + 1); + } + // Todo: Also split and or blocks in newlines & indentation++ + // if (blockStack[0] === 'generic') + // output += ... + } + } + return output; +} + +/** + * jQuery function that uses jQueryUI's dialogs to confirm with user. Does not + * return a jQuery object yet and hence cannot be chained + * + * @param string question + * @param string url URL to be passed to the callbackFn to make + * an Ajax call to + * @param function callbackFn callback to execute after user clicks on OK + * @param function openCallback optional callback to run when dialog is shown + */ + +jQuery.fn.PMA_confirm = function (question, url, callbackFn, openCallback) { + var confirmState = PMA_commonParams.get('confirm'); + if (! confirmState) { + // user does not want to confirm + if ($.isFunction(callbackFn)) { + callbackFn.call(this, url); + return true; + } + } + if (PMA_messages.strDoYouReally === '') { + return true; + } + + /** + * @var button_options Object that stores the options passed to jQueryUI + * dialog + */ + var button_options = [ + { + text: PMA_messages.strOK, + 'class': 'submitOK', + click: function () { + $(this).dialog('close'); + if ($.isFunction(callbackFn)) { + callbackFn.call(this, url); + } + } + }, + { + text: PMA_messages.strCancel, + 'class': 'submitCancel', + click: function () { + $(this).dialog('close'); + } + } + ]; + + $('
    ', { 'id': 'confirm_dialog', 'title': PMA_messages.strConfirm }) + .prepend(question) + .dialog({ + buttons: button_options, + close: function () { + $(this).remove(); + }, + open: openCallback, + modal: true + }); +}; + +/** + * jQuery function to sort a table's body after a new row has been appended to it. + * + * @param string text_selector string to select the sortKey's text + * + * @return jQuery Object for chaining purposes + */ +jQuery.fn.PMA_sort_table = function (text_selector) { + return this.each(function () { + /** + * @var table_body Object referring to the table's element + */ + var table_body = $(this); + /** + * @var rows Object referring to the collection of rows in {@link table_body} + */ + var rows = $(this).find('tr').get(); + + // get the text of the field that we will sort by + $.each(rows, function (index, row) { + row.sortKey = $.trim($(row).find(text_selector).text().toLowerCase()); + }); + + // get the sorted order + rows.sort(function (a, b) { + if (a.sortKey < b.sortKey) { + return -1; + } + if (a.sortKey > b.sortKey) { + return 1; + } + return 0; + }); + + // pull out each row from the table and then append it according to it's order + $.each(rows, function (index, row) { + $(table_body).append(row); + row.sortKey = null; + }); + }); +}; + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('functions.js', function () { + $(document).off('submit', '#create_table_form_minimal.ajax'); + $(document).off('submit', 'form.create_table_form.ajax'); + $(document).off('click', 'form.create_table_form.ajax input[name=submit_num_fields]'); + $(document).off('keyup', 'form.create_table_form.ajax input'); + $(document).off('change', 'input[name=partition_count],input[name=subpartition_count],select[name=partition_by]'); +}); + +/** + * jQuery coding for 'Create Table'. Used on db_operations.php, + * db_structure.php and db_tracking.php (i.e., wherever + * PhpMyAdmin\Display\CreateTable is used) + * + * Attach Ajax Event handlers for Create Table + */ +AJAX.registerOnload('functions.js', function () { + /** + * Attach event handler for submission of create table form (save) + */ + $(document).on('submit', 'form.create_table_form.ajax', function (event) { + event.preventDefault(); + + /** + * @var the_form object referring to the create table form + */ + var $form = $(this); + + /* + * First validate the form; if there is a problem, avoid submitting it + * + * checkTableEditForm() needs a pure element and not a jQuery object, + * this is why we pass $form[0] as a parameter (the jQuery object + * is actually an array of DOM elements) + */ + + if (checkTableEditForm($form[0], $form.find('input[name=orig_num_fields]').val())) { + PMA_prepareForAjaxRequest($form); + if (PMA_checkReservedWordColumns($form)) { + PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + // User wants to submit the form + $.post($form.attr('action'), $form.serialize() + PMA_commonParams.get('arg_separator') + 'do_save_data=1', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + $('#properties_message') + .removeClass('error') + .html(''); + PMA_ajaxShowMessage(data.message); + // Only if the create table dialog (distinct panel) exists + var $createTableDialog = $('#create_table_dialog'); + if ($createTableDialog.length > 0) { + $createTableDialog.dialog('close').remove(); + } + $('#tableslistcontainer').before(data.formatted_sql); + + /** + * @var tables_table Object referring to the element that holds the list of tables + */ + var tables_table = $('#tablesForm').find('tbody').not('#tbl_summary_row'); + // this is the first table created in this db + if (tables_table.length === 0) { + PMA_commonActions.refreshMain( + PMA_commonParams.get('opendb_url') + ); + } else { + /** + * @var curr_last_row Object referring to the last element in {@link tables_table} + */ + var curr_last_row = $(tables_table).find('tr:last'); + /** + * @var curr_last_row_index_string String containing the index of {@link curr_last_row} + */ + var curr_last_row_index_string = $(curr_last_row).find('input:checkbox').attr('id').match(/\d+/)[0]; + /** + * @var curr_last_row_index Index of {@link curr_last_row} + */ + var curr_last_row_index = parseFloat(curr_last_row_index_string); + /** + * @var new_last_row_index Index of the new row to be appended to {@link tables_table} + */ + var new_last_row_index = curr_last_row_index + 1; + /** + * @var new_last_row_id String containing the id of the row to be appended to {@link tables_table} + */ + var new_last_row_id = 'checkbox_tbl_' + new_last_row_index; + + data.new_table_string = data.new_table_string.replace(/checkbox_tbl_/, new_last_row_id); + // append to table + $(data.new_table_string) + .appendTo(tables_table); + + // Sort the table + $(tables_table).PMA_sort_table('th'); + + // Adjust summary row + PMA_adjustTotals(); + } + + // Refresh navigation as a new table has been added + PMA_reloadNavigation(); + // Redirect to table structure page on creation of new table + var argsep = PMA_commonParams.get('arg_separator'); + var params_12 = 'ajax_request=true' + argsep + 'ajax_page_request=true'; + if (! (history && history.pushState)) { + params_12 += PMA_MicroHistory.menus.getRequestParam(); + } + tblStruct_url = 'tbl_structure.php?server=' + data._params.server + + argsep + 'db=' + data._params.db + argsep + 'token=' + data._params.token + + argsep + 'goto=db_structure.php' + argsep + 'table=' + data._params.table + ''; + $.get(tblStruct_url, params_12, AJAX.responseHandler); + } else { + PMA_ajaxShowMessage( + '
    ' + data.error + '
    ', + false + ); + } + }); // end $.post() + } + } // end if (checkTableEditForm() ) + }); // end create table form (save) + + /** + * Submits the intermediate changes in the table creation form + * to refresh the UI accordingly + */ + function submitChangesInCreateTableForm (actionParam) { + /** + * @var the_form object referring to the create table form + */ + var $form = $('form.create_table_form.ajax'); + + var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + PMA_prepareForAjaxRequest($form); + + // User wants to add more fields to the table + $.post($form.attr('action'), $form.serialize() + '&' + actionParam, function (data) { + if (typeof data !== 'undefined' && data.success) { + var $pageContent = $('#page_content'); + $pageContent.html(data.message); + PMA_highlightSQL($pageContent); + PMA_verifyColumnsProperties(); + PMA_hideShowConnection($('.create_table_form select[name=tbl_storage_engine]')); + PMA_ajaxRemoveMessage($msgbox); + } else { + PMA_ajaxShowMessage(data.error); + } + }); // end $.post() + } + + /** + * Attach event handler for create table form (add fields) + */ + $(document).on('click', 'form.create_table_form.ajax input[name=submit_num_fields]', function (event) { + event.preventDefault(); + submitChangesInCreateTableForm('submit_num_fields=1'); + }); // end create table form (add fields) + + $(document).on('keydown', 'form.create_table_form.ajax input[name=added_fields]', function (event) { + if (event.keyCode === 13) { + event.preventDefault(); + event.stopImmediatePropagation(); + $(this) + .closest('form') + .find('input[name=submit_num_fields]') + .click(); + } + }); + + /** + * Attach event handler to manage changes in number of partitions and subpartitions + */ + $(document).on('change', 'input[name=partition_count],input[name=subpartition_count],select[name=partition_by]', function (event) { + $this = $(this); + $form = $this.parents('form'); + if ($form.is('.create_table_form.ajax')) { + submitChangesInCreateTableForm('submit_partition_change=1'); + } else { + $form.submit(); + } + }); + + $(document).on('change', 'input[value=AUTO_INCREMENT]', function () { + if (this.checked) { + var col = /\d/.exec($(this).attr('name')); + col = col[0]; + var $selectFieldKey = $('select[name="field_key[' + col + ']"]'); + if ($selectFieldKey.val() === 'none_' + col) { + $selectFieldKey.val('primary_' + col).change(); + } + } + }); + $('body') + .off('click', 'input.preview_sql') + .on('click', 'input.preview_sql', function () { + var $form = $(this).closest('form'); + PMA_previewSQL($form); + }); +}); + + +/** + * Validates the password field in a form + * + * @see PMA_messages.strPasswordEmpty + * @see PMA_messages.strPasswordNotSame + * @param object $the_form The form to be validated + * @return bool + */ +function PMA_checkPassword ($the_form) { + // Did the user select 'no password'? + if ($the_form.find('#nopass_1').is(':checked')) { + return true; + } else { + var $pred = $the_form.find('#select_pred_password'); + if ($pred.length && ($pred.val() === 'none' || $pred.val() === 'keep')) { + return true; + } + } + + var $password = $the_form.find('input[name=pma_pw]'); + var $password_repeat = $the_form.find('input[name=pma_pw2]'); + var alert_msg = false; + + if ($password.val() === '') { + alert_msg = PMA_messages.strPasswordEmpty; + } else if ($password.val() !== $password_repeat.val()) { + alert_msg = PMA_messages.strPasswordNotSame; + } + + if (alert_msg) { + alert(alert_msg); + $password.val(''); + $password_repeat.val(''); + $password.focus(); + return false; + } + return true; +} + +/** + * Attach Ajax event handlers for 'Change Password' on index.php + */ +AJAX.registerOnload('functions.js', function () { + /* Handler for hostname type */ + $(document).on('change', '#select_pred_hostname', function () { + var hostname = $('#pma_hostname'); + if (this.value === 'any') { + hostname.val('%'); + } else if (this.value === 'localhost') { + hostname.val('localhost'); + } else if (this.value === 'thishost' && $(this).data('thishost')) { + hostname.val($(this).data('thishost')); + } else if (this.value === 'hosttable') { + hostname.val('').prop('required', false); + } else if (this.value === 'userdefined') { + hostname.focus().select().prop('required', true); + } + }); + + /* Handler for editing hostname */ + $(document).on('change', '#pma_hostname', function () { + $('#select_pred_hostname').val('userdefined'); + $('#pma_hostname').prop('required', true); + }); + + /* Handler for username type */ + $(document).on('change', '#select_pred_username', function () { + if (this.value === 'any') { + $('#pma_username').val('').prop('required', false); + $('#user_exists_warning').css('display', 'none'); + } else if (this.value === 'userdefined') { + $('#pma_username').focus().select().prop('required', true); + } + }); + + /* Handler for editing username */ + $(document).on('change', '#pma_username', function () { + $('#select_pred_username').val('userdefined'); + $('#pma_username').prop('required', true); + }); + + /* Handler for password type */ + $(document).on('change', '#select_pred_password', function () { + if (this.value === 'none') { + $('#text_pma_pw2').prop('required', false).val(''); + $('#text_pma_pw').prop('required', false).val(''); + } else if (this.value === 'userdefined') { + $('#text_pma_pw2').prop('required', true); + $('#text_pma_pw').prop('required', true).focus().select(); + } else { + $('#text_pma_pw2').prop('required', false); + $('#text_pma_pw').prop('required', false); + } + }); + + /* Handler for editing password */ + $(document).on('change', '#text_pma_pw,#text_pma_pw2', function () { + $('#select_pred_password').val('userdefined'); + $('#text_pma_pw2').prop('required', true); + $('#text_pma_pw').prop('required', true); + }); + + /** + * Unbind all event handlers before tearing down a page + */ + $(document).off('click', '#change_password_anchor.ajax'); + + /** + * Attach Ajax event handler on the change password anchor + */ + + $(document).on('click', '#change_password_anchor.ajax', function (event) { + event.preventDefault(); + + var $msgbox = PMA_ajaxShowMessage(); + + /** + * @var button_options Object containing options to be passed to jQueryUI's dialog + */ + var button_options = {}; + button_options[PMA_messages.strGo] = function () { + event.preventDefault(); + + /** + * @var $the_form Object referring to the change password form + */ + var $the_form = $('#change_password_form'); + + if (! PMA_checkPassword($the_form)) { + return false; + } + + /** + * @var this_value String containing the value of the submit button. + * Need to append this for the change password form on Server Privileges + * page to work + */ + var this_value = $(this).val(); + + var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + $the_form.append(''); + + $.post($the_form.attr('action'), $the_form.serialize() + PMA_commonParams.get('arg_separator') + 'change_pw=' + this_value, function (data) { + if (typeof data === 'undefined' || data.success !== true) { + PMA_ajaxShowMessage(data.error, false); + return; + } + + var $pageContent = $('#page_content'); + $pageContent.prepend(data.message); + PMA_highlightSQL($pageContent); + $('#change_password_dialog').hide().remove(); + $('#edit_user_dialog').dialog('close').remove(); + PMA_ajaxRemoveMessage($msgbox); + }); // end $.post() + }; + + button_options[PMA_messages.strCancel] = function () { + $(this).dialog('close'); + }; + $.get($(this).attr('href'), { 'ajax_request': true }, function (data) { + if (typeof data === 'undefined' || !data.success) { + PMA_ajaxShowMessage(data.error, false); + return; + } + + if (data._scripts) { + AJAX.scriptHandler.load(data._scripts); + } + + $('
    ') + .dialog({ + title: PMA_messages.strChangePassword, + width: 600, + close: function (ev, ui) { + $(this).remove(); + }, + buttons: button_options, + modal: true + }) + .append(data.message); + // for this dialog, we remove the fieldset wrapping due to double headings + $('fieldset#fieldset_change_password') + .find('legend').remove().end() + .find('table.noclick').unwrap().addClass('some-margin') + .find('input#text_pma_pw').focus(); + $('#fieldset_change_password_footer').hide(); + PMA_ajaxRemoveMessage($msgbox); + displayPasswordGenerateButton(); + $('#change_password_form').on('submit', function (e) { + e.preventDefault(); + $(this) + .closest('.ui-dialog') + .find('.ui-dialog-buttonpane .ui-button') + .first() + .click(); + }); + }); // end $.get() + }); // end handler for change password anchor +}); // end $() for Change Password + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('functions.js', function () { + $(document).off('change', 'select.column_type'); + $(document).off('change', 'select.default_type'); + $(document).off('change', 'select.virtuality'); + $(document).off('change', 'input.allow_null'); + $(document).off('change', '.create_table_form select[name=tbl_storage_engine]'); +}); +/** + * Toggle the hiding/showing of the "Open in ENUM/SET editor" message when + * the page loads and when the selected data type changes + */ +AJAX.registerOnload('functions.js', function () { + // is called here for normal page loads and also when opening + // the Create table dialog + PMA_verifyColumnsProperties(); + // + // needs on() to work also in the Create Table dialog + $(document).on('change', 'select.column_type', function () { + PMA_showNoticeForEnum($(this)); + }); + $(document).on('change', 'select.default_type', function () { + PMA_hideShowDefaultValue($(this)); + }); + $(document).on('change', 'select.virtuality', function () { + PMA_hideShowExpression($(this)); + }); + $(document).on('change', 'input.allow_null', function () { + PMA_validateDefaultValue($(this)); + }); + $(document).on('change', '.create_table_form select[name=tbl_storage_engine]', function () { + PMA_hideShowConnection($(this)); + }); +}); + +/** + * If the chosen storage engine is FEDERATED show connection field. Hide otherwise + * + * @param $engine_selector storage engine selector + */ +function PMA_hideShowConnection ($engine_selector) { + var $connection = $('.create_table_form input[name=connection]'); + var index = $connection.parent('td').index() + 1; + var $labelTh = $connection.parents('tr').prev('tr').children('th:nth-child(' + index + ')'); + if ($engine_selector.val() !== 'FEDERATED') { + $connection + .prop('disabled', true) + .parent('td').hide(); + $labelTh.hide(); + } else { + $connection + .prop('disabled', false) + .parent('td').show(); + $labelTh.show(); + } +} + +/** + * If the column does not allow NULL values, makes sure that default is not NULL + */ +function PMA_validateDefaultValue ($null_checkbox) { + if (! $null_checkbox.prop('checked')) { + var $default = $null_checkbox.closest('tr').find('.default_type'); + if ($default.val() === 'NULL') { + $default.val('NONE'); + } + } +} + +/** + * function to populate the input fields on picking a column from central list + * + * @param string input_id input id of the name field for the column to be populated + * @param integer offset of the selected column in central list of columns + */ +function autoPopulate (input_id, offset) { + var db = PMA_commonParams.get('db'); + var table = PMA_commonParams.get('table'); + input_id = input_id.substring(0, input_id.length - 1); + $('#' + input_id + '1').val(central_column_list[db + '_' + table][offset].col_name); + var col_type = central_column_list[db + '_' + table][offset].col_type.toUpperCase(); + $('#' + input_id + '2').val(col_type); + var $input3 = $('#' + input_id + '3'); + $input3.val(central_column_list[db + '_' + table][offset].col_length); + if (col_type === 'ENUM' || col_type === 'SET') { + $input3.next().show(); + } else { + $input3.next().hide(); + } + var col_default = central_column_list[db + '_' + table][offset].col_default.toUpperCase(); + var $input4 = $('#' + input_id + '4'); + if (col_default !== '' && col_default !== 'NULL' && col_default !== 'CURRENT_TIMESTAMP' && col_default !== 'CURRENT_TIMESTAMP()') { + $input4.val('USER_DEFINED'); + $input4.next().next().show(); + $input4.next().next().val(central_column_list[db + '_' + table][offset].col_default); + } else { + $input4.val(central_column_list[db + '_' + table][offset].col_default); + $input4.next().next().hide(); + } + $('#' + input_id + '5').val(central_column_list[db + '_' + table][offset].col_collation); + var $input6 = $('#' + input_id + '6'); + $input6.val(central_column_list[db + '_' + table][offset].col_attribute); + if (central_column_list[db + '_' + table][offset].col_extra === 'on update CURRENT_TIMESTAMP') { + $input6.val(central_column_list[db + '_' + table][offset].col_extra); + } + if (central_column_list[db + '_' + table][offset].col_extra.toUpperCase() === 'AUTO_INCREMENT') { + $('#' + input_id + '9').prop('checked',true).change(); + } else { + $('#' + input_id + '9').prop('checked',false); + } + if (central_column_list[db + '_' + table][offset].col_isNull !== '0') { + $('#' + input_id + '7').prop('checked',true); + } else { + $('#' + input_id + '7').prop('checked',false); + } +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('functions.js', function () { + $(document).off('click', 'a.open_enum_editor'); + $(document).off('click', 'input.add_value'); + $(document).off('click', '#enum_editor td.drop'); + $(document).off('click', 'a.central_columns_dialog'); +}); +/** + * @var $enum_editor_dialog An object that points to the jQuery + * dialog of the ENUM/SET editor + */ +var $enum_editor_dialog = null; +/** + * Opens the ENUM/SET editor and controls its functions + */ +AJAX.registerOnload('functions.js', function () { + $(document).on('click', 'a.open_enum_editor', function () { + // Get the name of the column that is being edited + var colname = $(this).closest('tr').find('input:first').val(); + var title; + var i; + // And use it to make up a title for the page + if (colname.length < 1) { + title = PMA_messages.enum_newColumnVals; + } else { + title = PMA_messages.enum_columnVals.replace( + /%s/, + '"' + escapeHtml(decodeURIComponent(colname)) + '"' + ); + } + // Get the values as a string + var inputstring = $(this) + .closest('td') + .find('input') + .val(); + // Escape html entities + inputstring = $('
    ') + .text(inputstring) + .html(); + // Parse the values, escaping quotes and + // slashes on the fly, into an array + var values = []; + var in_string = false; + var curr; + var next; + var buffer = ''; + for (i = 0; i < inputstring.length; i++) { + curr = inputstring.charAt(i); + next = i === inputstring.length ? '' : inputstring.charAt(i + 1); + if (! in_string && curr === '\'') { + in_string = true; + } else if (in_string && curr === '\\' && next === '\\') { + buffer += '\'; + i++; + } else if (in_string && next === '\'' && (curr === '\'' || curr === '\\')) { + buffer += '''; + i++; + } else if (in_string && curr === '\'') { + in_string = false; + values.push(buffer); + buffer = ''; + } else if (in_string) { + buffer += curr; + } + } + if (buffer.length > 0) { + // The leftovers in the buffer are the last value (if any) + values.push(buffer); + } + var fields = ''; + // If there are no values, maybe the user is about to make a + // new list so we add a few for him/her to get started with. + if (values.length === 0) { + values.push('', '', '', ''); + } + // Add the parsed values to the editor + var drop_icon = PMA_getImage('b_drop'); + for (i = 0; i < values.length; i++) { + fields += '' + + '' + + '' + + drop_icon + + ''; + } + /** + * @var dialog HTML code for the ENUM/SET dialog + */ + var dialog = '
    ' + + '
    ' + + '' + title + '' + + '

    ' + PMA_getImage('s_notice') + + PMA_messages.enum_hint + '

    ' + + '' + fields + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '' + + '
    ' + + '
    '; + /** + * @var Defines functions to be called when the buttons in + * the buttonOptions jQuery dialog bar are pressed + */ + var buttonOptions = {}; + buttonOptions[PMA_messages.strGo] = function () { + // When the submit button is clicked, + // put the data back into the original form + var value_array = []; + $(this).find('.values input').each(function (index, elm) { + var val = elm.value.replace(/\\/g, '\\\\').replace(/'/g, '\'\''); + value_array.push('\'' + val + '\''); + }); + // get the Length/Values text field where this value belongs + var values_id = $(this).find('input[type=\'hidden\']').val(); + $('input#' + values_id).val(value_array.join(',')); + $(this).dialog('close'); + }; + buttonOptions[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + // Show the dialog + var width = parseInt( + (parseInt($('html').css('font-size'), 10) / 13) * 340, + 10 + ); + if (! width) { + width = 340; + } + $enum_editor_dialog = $(dialog).dialog({ + minWidth: width, + maxHeight: 450, + modal: true, + title: PMA_messages.enum_editor, + buttons: buttonOptions, + open: function () { + // Focus the "Go" button after opening the dialog + $(this).closest('.ui-dialog').find('.ui-dialog-buttonpane button:first').focus(); + }, + close: function () { + $(this).remove(); + } + }); + // slider for choosing how many fields to add + $enum_editor_dialog.find('.slider').slider({ + animate: true, + range: 'min', + value: 1, + min: 1, + max: 9, + slide: function (event, ui) { + $(this).closest('table').find('input[type=submit]').val( + PMA_sprintf(PMA_messages.enum_addValue, ui.value) + ); + } + }); + // Focus the slider, otherwise it looks nearly transparent + $('a.ui-slider-handle').addClass('ui-state-focus'); + return false; + }); + + $(document).on('click', 'a.central_columns_dialog', function (e) { + var href = 'db_central_columns.php'; + var db = PMA_commonParams.get('db'); + var table = PMA_commonParams.get('table'); + var maxRows = $(this).data('maxrows'); + var pick = $(this).data('pick'); + if (pick !== false) { + pick = true; + } + var params = { + 'ajax_request' : true, + 'server' : PMA_commonParams.get('server'), + 'db' : PMA_commonParams.get('db'), + 'cur_table' : PMA_commonParams.get('table'), + 'getColumnList':true + }; + var colid = $(this).closest('td').find('input').attr('id'); + var fields = ''; + if (! (db + '_' + table in central_column_list)) { + central_column_list.push(db + '_' + table); + $.ajax({ + type: 'POST', + url: href, + data: params, + success: function (data) { + central_column_list[db + '_' + table] = JSON.parse(data.message); + }, + async:false + }); + } + var i = 0; + var list_size = central_column_list[db + '_' + table].length; + var min = (list_size <= maxRows) ? list_size : maxRows; + for (i = 0; i < min; i++) { + fields += '
    ' + + escapeHtml(central_column_list[db + '_' + table][i].col_name) + + '
    ' + central_column_list[db + '_' + table][i].col_type; + + if (central_column_list[db + '_' + table][i].col_attribute !== '') { + fields += '(' + escapeHtml(central_column_list[db + '_' + table][i].col_attribute) + ') '; + } + if (central_column_list[db + '_' + table][i].col_length !== '') { + fields += '(' + escapeHtml(central_column_list[db + '_' + table][i].col_length) + ') '; + } + fields += escapeHtml(central_column_list[db + '_' + table][i].col_extra) + '' + + '
    '; + if (pick) { + fields += ''; + } + fields += ''; + } + var result_pointer = i; + var search_in = ''; + if (fields === '') { + fields = PMA_sprintf(PMA_messages.strEmptyCentralList, '\'' + escapeHtml(db) + '\''); + search_in = ''; + } + var seeMore = ''; + if (list_size > maxRows) { + seeMore = '
    ' + + '' + PMA_messages.seeMore + '
    '; + } + var central_columns_dialog = '
    ' + + '
    ' + + search_in + + '' + fields + '
    ' + + '
    ' + + seeMore + + '
    '; + + var width = parseInt( + (parseInt($('html').css('font-size'), 10) / 13) * 500, + 10 + ); + if (! width) { + width = 500; + } + var buttonOptions = {}; + var $central_columns_dialog = $(central_columns_dialog).dialog({ + minWidth: width, + maxHeight: 450, + modal: true, + title: PMA_messages.pickColumnTitle, + buttons: buttonOptions, + open: function () { + $('#col_list').on('click', '.pick', function () { + $central_columns_dialog.remove(); + }); + $('.filter_rows').on('keyup', function () { + $.uiTableFilter($('#col_list'), $(this).val()); + }); + $('#seeMore').click(function () { + fields = ''; + min = (list_size <= maxRows + result_pointer) ? list_size : maxRows + result_pointer; + for (i = result_pointer; i < min; i++) { + fields += '
    ' + + central_column_list[db + '_' + table][i].col_name + + '
    ' + + central_column_list[db + '_' + table][i].col_type; + + if (central_column_list[db + '_' + table][i].col_attribute !== '') { + fields += '(' + central_column_list[db + '_' + table][i].col_attribute + ') '; + } + if (central_column_list[db + '_' + table][i].col_length !== '') { + fields += '(' + central_column_list[db + '_' + table][i].col_length + ') '; + } + fields += central_column_list[db + '_' + table][i].col_extra + '' + + '
    '; + if (pick) { + fields += ''; + } + fields += ''; + } + $('#col_list').append(fields); + result_pointer = i; + if (result_pointer === list_size) { + $('.tblFooters').hide(); + } + return false; + }); + $(this).closest('.ui-dialog').find('.ui-dialog-buttonpane button:first').focus(); + }, + close: function () { + $('#col_list').off('click', '.pick'); + $('.filter_rows').off('keyup'); + $(this).remove(); + } + }); + return false; + }); + + // $(document).on('click', 'a.show_central_list',function(e) { + + // }); + // When "add a new value" is clicked, append an empty text field + $(document).on('click', 'input.add_value', function (e) { + e.preventDefault(); + var num_new_rows = $enum_editor_dialog.find('div.slider').slider('value'); + while (num_new_rows--) { + $enum_editor_dialog.find('.values') + .append( + '' + + '' + + '' + + PMA_getImage('b_drop') + + '' + ) + .find('tr:last') + .show('fast'); + } + }); + + // Removes the specified row from the enum editor + $(document).on('click', '#enum_editor td.drop', function () { + $(this).closest('tr').hide('fast', function () { + $(this).remove(); + }); + }); +}); + +/** + * Ensures indexes names are valid according to their type and, for a primary + * key, lock index name to 'PRIMARY' + * @param string form_id Variable which parses the form name as + * the input + * @return boolean false if there is no index form, true else + */ +function checkIndexName (form_id) { + if ($('#' + form_id).length === 0) { + return false; + } + + // Gets the elements pointers + var $the_idx_name = $('#input_index_name'); + var $the_idx_choice = $('#select_index_choice'); + + // Index is a primary key + if ($the_idx_choice.find('option:selected').val() === 'PRIMARY') { + $the_idx_name.val('PRIMARY'); + $the_idx_name.prop('disabled', true); + } else { + if ($the_idx_name.val() === 'PRIMARY') { + $the_idx_name.val(''); + } + $the_idx_name.prop('disabled', false); + } + + return true; +} // end of the 'checkIndexName()' function + +AJAX.registerTeardown('functions.js', function () { + $(document).off('click', '#index_frm input[type=submit]'); +}); +AJAX.registerOnload('functions.js', function () { + /** + * Handler for adding more columns to an index in the editor + */ + $(document).on('click', '#index_frm input[type=submit]', function (event) { + event.preventDefault(); + var rows_to_add = $(this) + .closest('fieldset') + .find('.slider') + .slider('value'); + + var tempEmptyVal = function () { + $(this).val(''); + }; + + var tempSetFocus = function () { + if ($(this).find('option:selected').val() === '') { + return true; + } + $(this).closest('tr').find('input').focus(); + }; + + while (rows_to_add--) { + var $indexColumns = $('#index_columns'); + var $newrow = $indexColumns + .find('tbody > tr:first') + .clone() + .appendTo( + $indexColumns.find('tbody') + ); + $newrow.find(':input').each(tempEmptyVal); + // focus index size input on column picked + $newrow.find('select').change(tempSetFocus); + } + }); +}); + +function indexEditorDialog (url, title, callback_success, callback_failure) { + /* Remove the hidden dialogs if there are*/ + var $editIndexDialog = $('#edit_index_dialog'); + if ($editIndexDialog.length !== 0) { + $editIndexDialog.remove(); + } + var $div = $('
    '); + + /** + * @var button_options Object that stores the options + * passed to jQueryUI dialog + */ + var button_options = {}; + button_options[PMA_messages.strGo] = function () { + /** + * @var the_form object referring to the export form + */ + var $form = $('#index_frm'); + var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + PMA_prepareForAjaxRequest($form); + // User wants to submit the form + $.post($form.attr('action'), $form.serialize() + PMA_commonParams.get('arg_separator') + 'do_save_data=1', function (data) { + var $sqlqueryresults = $('.sqlqueryresults'); + if ($sqlqueryresults.length !== 0) { + $sqlqueryresults.remove(); + } + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxShowMessage(data.message); + PMA_highlightSQL($('.result_query')); + $('.result_query .notice').remove(); + /* Reload the field form*/ + $('#table_index').remove(); + $('
    ') + .append(data.index_table) + .find('#table_index') + .insertAfter('#index_header'); + var $editIndexDialog = $('#edit_index_dialog'); + if ($editIndexDialog.length > 0) { + $editIndexDialog.dialog('close'); + } + $('div.no_indexes_defined').hide(); + if (callback_success) { + callback_success(); + } + PMA_reloadNavigation(); + } else { + var $temp_div = $('
    ').append(data.error); + var $error; + if ($temp_div.find('.error code').length !== 0) { + $error = $temp_div.find('.error code').addClass('error'); + } else { + $error = $temp_div; + } + if (callback_failure) { + callback_failure(); + } + PMA_ajaxShowMessage($error, false); + } + }); // end $.post() + }; + button_options[PMA_messages.strPreviewSQL] = function () { + // Function for Previewing SQL + var $form = $('#index_frm'); + PMA_previewSQL($form); + }; + button_options[PMA_messages.strCancel] = function () { + $(this).dialog('close'); + }; + var $msgbox = PMA_ajaxShowMessage(); + $.post('tbl_indexes.php', url, function (data) { + if (typeof data !== 'undefined' && data.success === false) { + // in the case of an error, show the error message returned. + PMA_ajaxShowMessage(data.error, false); + } else { + PMA_ajaxRemoveMessage($msgbox); + // Show dialog if the request was successful + $div + .append(data.message) + .dialog({ + title: title, + width: 'auto', + open: PMA_verifyColumnsProperties, + modal: true, + buttons: button_options, + close: function () { + $(this).remove(); + } + }); + $div.find('.tblFooters').remove(); + showIndexEditDialog($div); + } + }); // end $.get() +} + +function showIndexEditDialog ($outer) { + checkIndexType(); + checkIndexName('index_frm'); + var $indexColumns = $('#index_columns'); + $indexColumns.find('td').each(function () { + $(this).css('width', $(this).width() + 'px'); + }); + $indexColumns.find('tbody').sortable({ + axis: 'y', + containment: $indexColumns.find('tbody'), + tolerance: 'pointer' + }); + PMA_showHints($outer); + PMA_init_slider(); + // Add a slider for selecting how many columns to add to the index + $outer.find('.slider').slider({ + animate: true, + value: 1, + min: 1, + max: 16, + slide: function (event, ui) { + $(this).closest('fieldset').find('input[type=submit]').val( + PMA_sprintf(PMA_messages.strAddToIndex, ui.value) + ); + } + }); + $('div.add_fields').removeClass('hide'); + // focus index size input on column picked + $outer.find('table#index_columns select').change(function () { + if ($(this).find('option:selected').val() === '') { + return true; + } + $(this).closest('tr').find('input').focus(); + }); + // Focus the slider, otherwise it looks nearly transparent + $('a.ui-slider-handle').addClass('ui-state-focus'); + // set focus on index name input, if empty + var input = $outer.find('input#input_index_name'); + if (! input.val()) { + input.focus(); + } +} + +/** + * Function to display tooltips that were + * generated on the PHP side by PhpMyAdmin\Util::showHint() + * + * @param object $div a div jquery object which specifies the + * domain for searching for tooltips. If we + * omit this parameter the function searches + * in the whole body + **/ +function PMA_showHints ($div) { + if ($div === undefined || ! $div instanceof jQuery || $div.length === 0) { + $div = $('body'); + } + $div.find('.pma_hint').each(function () { + PMA_tooltip( + $(this).children('img'), + 'img', + $(this).children('span').html() + ); + }); +} + +AJAX.registerOnload('functions.js', function () { + PMA_showHints(); +}); + +function PMA_mainMenuResizerCallback () { + // 5 px margin for jumping menu in Chrome + return $(document.body).width() - 5; +} +// This must be fired only once after the initial page load +$(function () { + // Initialise the menu resize plugin + $('#topmenu').menuResizer(PMA_mainMenuResizerCallback); + // register resize event + $(window).on('resize', function () { + $('#topmenu').menuResizer('resize'); + }); +}); + +/** + * Get the row number from the classlist (for example, row_1) + */ +function PMA_getRowNumber (classlist) { + return parseInt(classlist.split(/\s+row_/)[1], 10); +} + +/** + * Changes status of slider + */ +function PMA_set_status_label ($element) { + var text; + if ($element.css('display') === 'none') { + text = '+ '; + } else { + text = '- '; + } + $element.closest('.slide-wrapper').prev().find('span').text(text); +} + +/** + * var toggleButton This is a function that creates a toggle + * sliding button given a jQuery reference + * to the correct DOM element + */ +var toggleButton = function ($obj) { + // In rtl mode the toggle switch is flipped horizontally + // so we need to take that into account + var right; + if ($('span.text_direction', $obj).text() === 'ltr') { + right = 'right'; + } else { + right = 'left'; + } + /** + * var h Height of the button, used to scale the + * background image and position the layers + */ + var h = $obj.height(); + $('img', $obj).height(h); + $('table', $obj).css('bottom', h - 1); + /** + * var on Width of the "ON" part of the toggle switch + * var off Width of the "OFF" part of the toggle switch + */ + var on = $('td.toggleOn', $obj).width(); + var off = $('td.toggleOff', $obj).width(); + // Make the "ON" and "OFF" parts of the switch the same size + // + 2 pixels to avoid overflowed + $('td.toggleOn > div', $obj).width(Math.max(on, off) + 2); + $('td.toggleOff > div', $obj).width(Math.max(on, off) + 2); + /** + * var w Width of the central part of the switch + */ + var w = parseInt(($('img', $obj).height() / 16) * 22, 10); + // Resize the central part of the switch on the top + // layer to match the background + $('table td:nth-child(2) > div', $obj).width(w); + /** + * var imgw Width of the background image + * var tblw Width of the foreground layer + * var offset By how many pixels to move the background + * image, so that it matches the top layer + */ + var imgw = $('img', $obj).width(); + var tblw = $('table', $obj).width(); + var offset = parseInt(((imgw - tblw) / 2), 10); + // Move the background to match the layout of the top layer + $obj.find('img').css(right, offset); + /** + * var offw Outer width of the "ON" part of the toggle switch + * var btnw Outer width of the central part of the switch + */ + var offw = $('td.toggleOff', $obj).outerWidth(); + var btnw = $('table td:nth-child(2)', $obj).outerWidth(); + // Resize the main div so that exactly one side of + // the switch plus the central part fit into it. + $obj.width(offw + btnw + 2); + /** + * var move How many pixels to move the + * switch by when toggling + */ + var move = $('td.toggleOff', $obj).outerWidth(); + // If the switch is initialized to the + // OFF state we need to move it now. + if ($('div.container', $obj).hasClass('off')) { + if (right === 'right') { + $('div.container', $obj).animate({ 'left': '-=' + move + 'px' }, 0); + } else { + $('div.container', $obj).animate({ 'left': '+=' + move + 'px' }, 0); + } + } + // Attach an 'onclick' event to the switch + $('div.container', $obj).click(function () { + if ($(this).hasClass('isActive')) { + return false; + } else { + $(this).addClass('isActive'); + } + var $msg = PMA_ajaxShowMessage(); + var $container = $(this); + var callback = $('span.callback', this).text(); + var operator; + var url; + var removeClass; + var addClass; + // Perform the actual toggle + if ($(this).hasClass('on')) { + if (right === 'right') { + operator = '-='; + } else { + operator = '+='; + } + url = $(this).find('td.toggleOff > span').text(); + removeClass = 'on'; + addClass = 'off'; + } else { + if (right === 'right') { + operator = '+='; + } else { + operator = '-='; + } + url = $(this).find('td.toggleOn > span').text(); + removeClass = 'off'; + addClass = 'on'; + } + + var parts = url.split('?'); + $.post(parts[0], parts[1] + '&ajax_request=true', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxRemoveMessage($msg); + $container + .removeClass(removeClass) + .addClass(addClass) + .animate({ 'left': operator + move + 'px' }, function () { + $container.removeClass('isActive'); + }); + eval(callback); + } else { + PMA_ajaxShowMessage(data.error, false); + $container.removeClass('isActive'); + } + }); + }); +}; + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('functions.js', function () { + $('div.container').off('click'); +}); +/** + * Initialise all toggle buttons + */ +AJAX.registerOnload('functions.js', function () { + $('div.toggleAjax').each(function () { + var $button = $(this).show(); + $button.find('img').each(function () { + if (this.complete) { + toggleButton($button); + } else { + $(this).load(function () { + toggleButton($button); + }); + } + }); + }); +}); + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('functions.js', function () { + $(document).off('change', 'select.pageselector'); + $('#update_recent_tables').off('ready'); + $('#sync_favorite_tables').off('ready'); +}); + +AJAX.registerOnload('functions.js', function () { + /** + * Autosubmit page selector + */ + $(document).on('change', 'select.pageselector', function (event) { + event.stopPropagation(); + // Check where to load the new content + if ($(this).closest('#pma_navigation').length === 0) { + // For the main page we don't need to do anything, + $(this).closest('form').submit(); + } else { + // but for the navigation we need to manually replace the content + PMA_navigationTreePagination($(this)); + } + }); + + /** + * Load version information asynchronously. + */ + if ($('li.jsversioncheck').length > 0) { + $.ajax({ + dataType: 'json', + url: 'version_check.php', + method: 'POST', + data: { + 'server': PMA_commonParams.get('server') + }, + success: PMA_current_version + }); + } + + if ($('#is_git_revision').length > 0) { + setTimeout(PMA_display_git_revision, 10); + } + + /** + * Slider effect. + */ + PMA_init_slider(); + + var $updateRecentTables = $('#update_recent_tables'); + if ($updateRecentTables.length) { + $.get( + $updateRecentTables.attr('href'), + { no_debug: true }, + function (data) { + if (typeof data !== 'undefined' && data.success === true) { + $('#pma_recent_list').html(data.list); + } + } + ); + } + + // Sync favorite tables from localStorage to pmadb. + if ($('#sync_favorite_tables').length) { + $.ajax({ + url: $('#sync_favorite_tables').attr('href'), + cache: false, + type: 'POST', + data: { + favorite_tables: (isStorageSupported('localStorage') && typeof window.localStorage.favorite_tables !== 'undefined') + ? window.localStorage.favorite_tables + : '', + server: PMA_commonParams.get('server'), + no_debug: true + }, + success: function (data) { + // Update localStorage. + if (isStorageSupported('localStorage')) { + window.localStorage.favorite_tables = data.favorite_tables; + } + $('#pma_favorite_list').html(data.list); + } + }); + } +}); // end of $() + +/** + * Submits the form placed in place of a link due to the excessive url length + * + * @param $link anchor + * @returns {Boolean} + */ +function submitFormLink ($link) { + if ($link.attr('href').indexOf('=') !== -1) { + var data = $link.attr('href').substr($link.attr('href').indexOf('#') + 1).split('=', 2); + $link.parents('form').append(''); + } + $link.parents('form').submit(); +} + +/** + * Initializes slider effect. + */ +function PMA_init_slider () { + $('div.pma_auto_slider').each(function () { + var $this = $(this); + if ($this.data('slider_init_done')) { + return; + } + var $wrapper = $('
    ', { 'class': 'slide-wrapper' }); + $wrapper.toggle($this.is(':visible')); + $('', { href: '#' + this.id, 'class': 'ajax' }) + .text($this.attr('title')) + .prepend($('')) + .insertBefore($this) + .click(function () { + var $wrapper = $this.closest('.slide-wrapper'); + var visible = $this.is(':visible'); + if (!visible) { + $wrapper.show(); + } + $this[visible ? 'hide' : 'show']('blind', function () { + $wrapper.toggle(!visible); + $wrapper.parent().toggleClass('print_ignore', visible); + PMA_set_status_label($this); + }); + return false; + }); + $this.wrap($wrapper); + $this.removeAttr('title'); + PMA_set_status_label($this); + $this.data('slider_init_done', 1); + }); +} + +/** + * Initializes slider effect. + */ +AJAX.registerOnload('functions.js', function () { + PMA_init_slider(); +}); + +/** + * Restores sliders to the state they were in before initialisation. + */ +AJAX.registerTeardown('functions.js', function () { + $('div.pma_auto_slider').each(function () { + var $this = $(this); + $this.removeData(); + $this.parent().replaceWith($this); + $this.parent().children('a').remove(); + }); +}); + +/** + * Creates a message inside an object with a sliding effect + * + * @param msg A string containing the text to display + * @param $obj a jQuery object containing the reference + * to the element where to put the message + * This is optional, if no element is + * provided, one will be created below the + * navigation links at the top of the page + * + * @return bool True on success, false on failure + */ +function PMA_slidingMessage (msg, $obj) { + if (msg === undefined || msg.length === 0) { + // Don't show an empty message + return false; + } + if ($obj === undefined || ! $obj instanceof jQuery || $obj.length === 0) { + // If the second argument was not supplied, + // we might have to create a new DOM node. + if ($('#PMA_slidingMessage').length === 0) { + $('#page_content').prepend( + '' + ); + } + $obj = $('#PMA_slidingMessage'); + } + if ($obj.has('div').length > 0) { + // If there already is a message inside the + // target object, we must get rid of it + $obj + .find('div') + .first() + .fadeOut(function () { + $obj + .children() + .remove(); + $obj + .append('
    ' + msg + '
    '); + // highlight any sql before taking height; + PMA_highlightSQL($obj); + $obj.find('div') + .first() + .hide(); + $obj + .animate({ + height: $obj.find('div').first().height() + }) + .find('div') + .first() + .fadeIn(); + }); + } else { + // Object does not already have a message + // inside it, so we simply slide it down + $obj.width('100%') + .html('
    ' + msg + '
    '); + // highlight any sql before taking height; + PMA_highlightSQL($obj); + var h = $obj + .find('div') + .first() + .hide() + .height(); + $obj + .find('div') + .first() + .css('height', 0) + .show() + .animate({ + height: h + }, function () { + // Set the height of the parent + // to the height of the child + $obj + .height( + $obj + .find('div') + .first() + .height() + ); + }); + } + return true; +} // end PMA_slidingMessage() + +/** + * Attach CodeMirror2 editor to SQL edit area. + */ +AJAX.registerOnload('functions.js', function () { + var $elm = $('#sqlquery'); + if ($elm.length > 0) { + if (typeof CodeMirror !== 'undefined') { + codemirror_editor = PMA_getSQLEditor($elm); + codemirror_editor.focus(); + codemirror_editor.on('blur', updateQueryParameters); + } else { + // without codemirror + $elm.focus().on('blur', updateQueryParameters); + } + } + PMA_highlightSQL($('body')); +}); +AJAX.registerTeardown('functions.js', function () { + if (codemirror_editor) { + $('#sqlquery').text(codemirror_editor.getValue()); + codemirror_editor.toTextArea(); + codemirror_editor = false; + } +}); +AJAX.registerOnload('functions.js', function () { + // initializes all lock-page elements lock-id and + // val-hash data property + $('#page_content form.lock-page textarea, ' + + '#page_content form.lock-page input[type="text"], ' + + '#page_content form.lock-page input[type="number"], ' + + '#page_content form.lock-page select').each(function (i) { + $(this).data('lock-id', i); + // val-hash is the hash of default value of the field + // so that it can be compared with new value hash + // to check whether field was modified or not. + $(this).data('val-hash', AJAX.hash($(this).val())); + }); + + // initializes lock-page elements (input types checkbox and radio buttons) + // lock-id and val-hash data property + $('#page_content form.lock-page input[type="checkbox"], ' + + '#page_content form.lock-page input[type="radio"]').each(function (i) { + $(this).data('lock-id', i); + $(this).data('val-hash', AJAX.hash($(this).is(':checked'))); + }); +}); + +/** + * jQuery plugin to correctly filter input fields by value, needed + * because some nasty values may break selector syntax + */ +(function ($) { + $.fn.filterByValue = function (value) { + return this.filter(function () { + return $(this).val() === value; + }); + }; +}(jQuery)); + +/** + * Return value of a cell in a table. + */ +function PMA_getCellValue (td) { + var $td = $(td); + if ($td.is('.null')) { + return ''; + } else if ((! $td.is('.to_be_saved') + || $td.is('.set')) + && $td.data('original_data') + ) { + return $td.data('original_data'); + } else { + return $td.text(); + } +} + +$(window).on('popstate', function (event, data) { + $('#printcss').attr('media','print'); + return true; +}); + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('functions.js', function () { + $(document).off('click', 'a.themeselect'); + $(document).off('change', '.autosubmit'); + $('a.take_theme').off('click'); +}); + +AJAX.registerOnload('functions.js', function () { + /** + * Theme selector. + */ + $(document).on('click', 'a.themeselect', function (e) { + window.open( + e.target, + 'themes', + 'left=10,top=20,width=510,height=350,scrollbars=yes,status=yes,resizable=yes' + ); + return false; + }); + + /** + * Automatic form submission on change. + */ + $(document).on('change', '.autosubmit', function (e) { + $(this).closest('form').submit(); + }); + + /** + * Theme changer. + */ + $('a.take_theme').click(function (e) { + var what = this.name; + if (window.opener && window.opener.document.forms.setTheme.elements.set_theme) { + window.opener.document.forms.setTheme.elements.set_theme.value = what; + window.opener.document.forms.setTheme.submit(); + window.close(); + return false; + } + return true; + }); +}); + +/** + * Produce print preview + */ +function printPreview () { + $('#printcss').attr('media','all'); + createPrintAndBackButtons(); +} + +/** + * Create print and back buttons in preview page + */ +function createPrintAndBackButtons () { + var back_button = $('',{ + type: 'button', + value: PMA_messages.back, + id: 'back_button_print_view' + }); + back_button.click(removePrintAndBackButton); + back_button.appendTo('#page_content'); + var print_button = $('',{ + type: 'button', + value: PMA_messages.print, + id: 'print_button_print_view' + }); + print_button.click(printPage); + print_button.appendTo('#page_content'); +} + +/** + * Remove print and back buttons and revert to normal view + */ +function removePrintAndBackButton () { + $('#printcss').attr('media','print'); + $('#back_button_print_view').remove(); + $('#print_button_print_view').remove(); +} + +/** + * Print page + */ +function printPage () { + if (typeof(window.print) !== 'undefined') { + window.print(); + } +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('functions.js', function () { + $('input#print').off('click'); + $(document).off('click', 'a.create_view.ajax'); + $(document).off('keydown', '#createViewDialog input, #createViewDialog select'); + $(document).off('change', '#fkc_checkbox'); +}); + +AJAX.registerOnload('functions.js', function () { + $('input#print').click(printPage); + $('.logout').click(function () { + var form = $( + '
    ' + + '' + + '
    ' + ); + $('body').append(form); + form.submit(); + return false; + }); + /** + * Ajaxification for the "Create View" action + */ + $(document).on('click', 'a.create_view.ajax', function (e) { + e.preventDefault(); + PMA_createViewDialog($(this)); + }); + /** + * Attach Ajax event handlers for input fields in the editor + * and used to submit the Ajax request when the ENTER key is pressed. + */ + if ($('#createViewDialog').length !== 0) { + $(document).on('keydown', '#createViewDialog input, #createViewDialog select', function (e) { + if (e.which === 13) { // 13 is the ENTER key + e.preventDefault(); + + // with preventing default, selection by ' + + '' + + ''; +} + +/** + * Initialize the visualization in the GIS data editor. + */ +function initGISEditorVisualization () { + // Loads either SVG or OSM visualization based on the choice + selectVisualization(); + // Adds necessary styles to the div that coontains the openStreetMap + styleOSM(); + // Loads the SVG element and make a reference to it + loadSVG(); + // Adds controllers for zooming and panning + addZoomPanControllers(); + zoomAndPan(); +} + +/** + * Loads JavaScript files and the GIS editor. + * + * @param value current value of the geometry field + * @param field field name + * @param type geometry type + * @param input_name name of the input field + * @param token token + */ +function loadJSAndGISEditor (value, field, type, input_name) { + var head = document.getElementsByTagName('head')[0]; + var script; + + // Loads a set of small JS file needed for the GIS editor + var smallScripts = ['js/vendor/jquery/jquery.svg.js', + 'js/vendor/jquery/jquery.mousewheel.js', + 'js/vendor/jquery/jquery.event.drag-2.2.js', + 'js/tbl_gis_visualization.js']; + + for (var i = 0; i < smallScripts.length; i++) { + script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = smallScripts[i]; + head.appendChild(script); + } + + // OpenLayers.js is BIG and takes time. So asynchronous loading would not work. + // Load the JS and do a callback to load the content for the GIS Editor. + script = document.createElement('script'); + script.type = 'text/javascript'; + + script.onreadystatechange = function () { + if (this.readyState === 'complete') { + loadGISEditor(value, field, type, input_name); + } + }; + script.onload = function () { + loadGISEditor(value, field, type, input_name); + }; + script.onerror = function () { + loadGISEditor(value, field, type, input_name); + }; + + script.src = 'js/vendor/openlayers/OpenLayers.js'; + head.appendChild(script); + + gisEditorLoaded = true; +} + +/** + * Loads the GIS editor via AJAX + * + * @param value current value of the geometry field + * @param field field name + * @param type geometry type + * @param input_name name of the input field + */ +function loadGISEditor (value, field, type, input_name) { + var $gis_editor = $('#gis_editor'); + $.post('gis_data_editor.php', { + 'field' : field, + 'value' : value, + 'type' : type, + 'input_name' : input_name, + 'get_gis_editor' : true, + 'ajax_request': true, + 'server': PMA_commonParams.get('server') + }, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + $gis_editor.html(data.gis_editor); + initGISEditorVisualization(); + prepareJSVersion(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }, 'json'); +} + +/** + * Opens up the dialog for the GIS data editor. + */ +function openGISEditor () { + // Center the popup + var windowWidth = document.documentElement.clientWidth; + var windowHeight = document.documentElement.clientHeight; + var popupWidth = windowWidth * 0.9; + var popupHeight = windowHeight * 0.9; + var popupOffsetTop = windowHeight / 2 - popupHeight / 2; + var popupOffsetLeft = windowWidth / 2 - popupWidth / 2; + + var $gis_editor = $('#gis_editor'); + var $backgrouond = $('#popup_background'); + + $gis_editor.css({ 'top': popupOffsetTop, 'left': popupOffsetLeft, 'width': popupWidth, 'height': popupHeight }); + $backgrouond.css({ 'opacity' : '0.7' }); + + $gis_editor.append( + '
    ' + + '' + + '
    ' + ); + + // Make it appear + $backgrouond.fadeIn('fast'); + $gis_editor.fadeIn('fast'); +} + +/** + * Prepare and insert the GIS data in Well Known Text format + * to the input field. + */ +function insertDataAndClose () { + var $form = $('form#gis_data_editor_form'); + var input_name = $form.find('input[name=\'input_name\']').val(); + + var argsep = PMA_commonParams.get('arg_separator'); + $.post('gis_data_editor.php', $form.serialize() + argsep + 'generate=true' + argsep + 'ajax_request=true', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + $('input[name=\'' + input_name + '\']').val(data.result); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }, 'json'); + closeGISEditor(); +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('gis_data_editor.js', function () { + $(document).off('click', '#gis_editor input[name=\'gis_data[save]\']'); + $(document).off('submit', '#gis_editor'); + $(document).off('change', '#gis_editor input[type=\'text\']'); + $(document).off('change', '#gis_editor select.gis_type'); + $(document).off('click', '#gis_editor a.close_gis_editor, #gis_editor a.cancel_gis_editor'); + $(document).off('click', '#gis_editor a.addJs.addPoint'); + $(document).off('click', '#gis_editor a.addLine.addJs'); + $(document).off('click', '#gis_editor a.addJs.addPolygon'); + $(document).off('click', '#gis_editor a.addJs.addGeom'); +}); + +AJAX.registerOnload('gis_data_editor.js', function () { + /** + * Prepares and insert the GIS data to the input field on clicking 'copy'. + */ + $(document).on('click', '#gis_editor input[name=\'gis_data[save]\']', function (event) { + event.preventDefault(); + insertDataAndClose(); + }); + + /** + * Prepares and insert the GIS data to the input field on pressing 'enter'. + */ + $(document).on('submit', '#gis_editor', function (event) { + event.preventDefault(); + insertDataAndClose(); + }); + + /** + * Trigger asynchronous calls on data change and update the output. + */ + $(document).on('change', '#gis_editor input[type=\'text\']', function () { + var $form = $('form#gis_data_editor_form'); + var argsep = PMA_commonParams.get('arg_separator'); + $.post('gis_data_editor.php', $form.serialize() + argsep + 'generate=true' + argsep + 'ajax_request=true', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + $('#gis_data_textarea').val(data.result); + $('#placeholder').empty().removeClass('hasSVG').html(data.visualization); + $('#openlayersmap').empty(); + /* TODO: the gis_data_editor should rather return JSON than JS code to eval */ + eval(data.openLayers); + initGISEditorVisualization(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }, 'json'); + }); + + /** + * Update the form on change of the GIS type. + */ + $(document).on('change', '#gis_editor select.gis_type', function (event) { + var $gis_editor = $('#gis_editor'); + var $form = $('form#gis_data_editor_form'); + + var argsep = PMA_commonParams.get('arg_separator'); + $.post('gis_data_editor.php', $form.serialize() + argsep + 'get_gis_editor=true' + argsep + 'ajax_request=true', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + $gis_editor.html(data.gis_editor); + initGISEditorVisualization(); + prepareJSVersion(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }, 'json'); + }); + + /** + * Handles closing of the GIS data editor. + */ + $(document).on('click', '#gis_editor a.close_gis_editor, #gis_editor a.cancel_gis_editor', function () { + closeGISEditor(); + }); + + /** + * Handles adding data points + */ + $(document).on('click', '#gis_editor a.addJs.addPoint', function () { + var $a = $(this); + var name = $a.attr('name'); + // Eg. name = gis_data[0][MULTIPOINT][add_point] => prefix = gis_data[0][MULTIPOINT] + var prefix = name.substr(0, name.length - 11); + // Find the number of points + var $noOfPointsInput = $('input[name=\'' + prefix + '[no_of_points]' + '\']'); + var noOfPoints = parseInt($noOfPointsInput.val(), 10); + // Add the new data point + var html = addDataPoint(noOfPoints, prefix); + $a.before(html); + $noOfPointsInput.val(noOfPoints + 1); + }); + + /** + * Handles adding linestrings and inner rings + */ + $(document).on('click', '#gis_editor a.addLine.addJs', function () { + var $a = $(this); + var name = $a.attr('name'); + + // Eg. name = gis_data[0][MULTILINESTRING][add_line] => prefix = gis_data[0][MULTILINESTRING] + var prefix = name.substr(0, name.length - 10); + var type = prefix.slice(prefix.lastIndexOf('[') + 1, prefix.lastIndexOf(']')); + + // Find the number of lines + var $noOfLinesInput = $('input[name=\'' + prefix + '[no_of_lines]' + '\']'); + var noOfLines = parseInt($noOfLinesInput.val(), 10); + + // Add the new linesting of inner ring based on the type + var html = '
    '; + var noOfPoints; + if (type === 'MULTILINESTRING') { + html += PMA_messages.strLineString + ' ' + (noOfLines + 1) + ':'; + noOfPoints = 2; + } else { + html += PMA_messages.strInnerRing + ' ' + noOfLines + ':'; + noOfPoints = 4; + } + html += ''; + for (var i = 0; i < noOfPoints; i++) { + html += addDataPoint(i, (prefix + '[' + noOfLines + ']')); + } + html += '
    + ' + + PMA_messages.strAddPoint + '
    '; + + $a.before(html); + $noOfLinesInput.val(noOfLines + 1); + }); + + /** + * Handles adding polygons + */ + $(document).on('click', '#gis_editor a.addJs.addPolygon', function () { + var $a = $(this); + var name = $a.attr('name'); + // Eg. name = gis_data[0][MULTIPOLYGON][add_polygon] => prefix = gis_data[0][MULTIPOLYGON] + var prefix = name.substr(0, name.length - 13); + // Find the number of polygons + var $noOfPolygonsInput = $('input[name=\'' + prefix + '[no_of_polygons]' + '\']'); + var noOfPolygons = parseInt($noOfPolygonsInput.val(), 10); + + // Add the new polygon + var html = PMA_messages.strPolygon + ' ' + (noOfPolygons + 1) + ':
    '; + html += '' + + '
    ' + PMA_messages.strOuterRing + ':' + + ''; + for (var i = 0; i < 4; i++) { + html += addDataPoint(i, (prefix + '[' + noOfPolygons + '][0]')); + } + html += '+ ' + + PMA_messages.strAddPoint + '
    ' + + '+ ' + + PMA_messages.strAddInnerRing + '

    '; + + $a.before(html); + $noOfPolygonsInput.val(noOfPolygons + 1); + }); + + /** + * Handles adding geoms + */ + $(document).on('click', '#gis_editor a.addJs.addGeom', function () { + var $a = $(this); + var prefix = 'gis_data[GEOMETRYCOLLECTION]'; + // Find the number of geoms + var $noOfGeomsInput = $('input[name=\'' + prefix + '[geom_count]' + '\']'); + var noOfGeoms = parseInt($noOfGeomsInput.val(), 10); + + var html1 = PMA_messages.strGeometry + ' ' + (noOfGeoms + 1) + ':
    '; + var $geomType = $('select[name=\'gis_data[' + (noOfGeoms - 1) + '][gis_type]\']').clone(); + $geomType.attr('name', 'gis_data[' + noOfGeoms + '][gis_type]').val('POINT'); + var html2 = '
    ' + PMA_messages.strPoint + ' :' + + '' + + '' + + '' + + '' + + '

    '; + + $a.before(html1); + $geomType.insertBefore($a); + $a.before(html2); + $noOfGeomsInput.val(noOfGeoms + 1); + }); +}); diff --git a/phpMyAdmin/js/import.js b/phpMyAdmin/js/import.js new file mode 100755 index 0000000..7bd91a2 --- /dev/null +++ b/phpMyAdmin/js/import.js @@ -0,0 +1,155 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Functions used in the import tab + * + */ + + +/** + * Toggles the hiding and showing of each plugin's options + * according to the currently selected plugin from the dropdown list + */ +function changePluginOpts () { + $('#format_specific_opts').find('div.format_specific_options').each(function () { + $(this).hide(); + }); + var selected_plugin_name = $('#plugins').find('option:selected').val(); + $('#' + selected_plugin_name + '_options').fadeIn('slow'); + if (selected_plugin_name === 'csv') { + $('#import_notification').text(PMA_messages.strImportCSV); + } else { + $('#import_notification').text(''); + } +} + +/** + * Toggles the hiding and showing of each plugin's options and sets the selected value + * in the plugin dropdown list according to the format of the selected file + */ +function matchFile (fname) { + var fname_array = fname.toLowerCase().split('.'); + var len = fname_array.length; + if (len !== 0) { + var extension = fname_array[len - 1]; + if (extension === 'gz' || extension === 'bz2' || extension === 'zip') { + len--; + } + // Only toggle if the format of the file can be imported + if ($('select[name=\'format\'] option').filterByValue(fname_array[len - 1]).length === 1) { + $('select[name=\'format\'] option').filterByValue(fname_array[len - 1]).prop('selected', true); + changePluginOpts(); + } + } +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('import.js', function () { + $('#plugins').off('change'); + $('#input_import_file').off('change'); + $('#select_local_import_file').off('change'); + $('#input_import_file').off('change').off('focus'); + $('#select_local_import_file').off('focus'); + $('#text_csv_enclosed').add('#text_csv_escaped').off('keyup'); +}); + +AJAX.registerOnload('import.js', function () { + // import_file_form validation. + $(document).on('submit', '#import_file_form', function (event) { + var radioLocalImport = $('#radio_local_import_file'); + var radioImport = $('#radio_import_file'); + var fileMsg = '
    ' + PMA_messages.strImportDialogMessage + '
    '; + + if (radioLocalImport.length !== 0) { + // remote upload. + + if (radioImport.is(':checked') && $('#input_import_file').val() === '') { + $('#input_import_file').focus(); + PMA_ajaxShowMessage(fileMsg, false); + return false; + } + + if (radioLocalImport.is(':checked')) { + if ($('#select_local_import_file').length === 0) { + PMA_ajaxShowMessage('
    ' + PMA_messages.strNoImportFile + '
    ', false); + return false; + } + + if ($('#select_local_import_file').val() === '') { + $('#select_local_import_file').focus(); + PMA_ajaxShowMessage(fileMsg, false); + return false; + } + } + } else { + // local upload. + if ($('#input_import_file').val() === '') { + $('#input_import_file').focus(); + PMA_ajaxShowMessage(fileMsg, false); + return false; + } + } + + // show progress bar. + $('#upload_form_status').css('display', 'inline'); + $('#upload_form_status_info').css('display', 'inline'); + }); + + // Initially display the options for the selected plugin + changePluginOpts(); + + // Whenever the selected plugin changes, change the options displayed + $('#plugins').change(function () { + changePluginOpts(); + }); + + $('#input_import_file').change(function () { + matchFile($(this).val()); + }); + + $('#select_local_import_file').change(function () { + matchFile($(this).val()); + }); + + /* + * When the "Browse the server" form is clicked or the "Select from the web server upload directory" + * form is clicked, the radio button beside it becomes selected and the other form becomes disabled. + */ + $('#input_import_file').on('focus change', function () { + $('#radio_import_file').prop('checked', true); + $('#radio_local_import_file').prop('checked', false); + }); + $('#select_local_import_file').focus(function () { + $('#radio_local_import_file').prop('checked', true); + $('#radio_import_file').prop('checked', false); + }); + + /** + * Set up the interface for Javascript-enabled browsers since the default is for + * Javascript-disabled browsers + */ + $('#scroll_to_options_msg').hide(); + $('#format_specific_opts').find('div.format_specific_options') + .css({ + 'border': 0, + 'margin': 0, + 'padding': 0 + }) + .find('h3') + .remove(); + // $("form[name=import] *").unwrap(); + + /** + * for input element text_csv_enclosed and text_csv_escaped allow just one character to enter. + * as mysql allows just one character for these fields, + * if first character is escape then allow two including escape character. + */ + $('#text_csv_enclosed').add('#text_csv_escaped').on('keyup', function () { + if ($(this).val().length === 2 && $(this).val().charAt(0) !== '\\') { + $(this).val($(this).val().substring(0, 1)); + return false; + } + return true; + }); +}); diff --git a/phpMyAdmin/js/indexes.js b/phpMyAdmin/js/indexes.js new file mode 100755 index 0000000..65baec1 --- /dev/null +++ b/phpMyAdmin/js/indexes.js @@ -0,0 +1,761 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview function used for index manipulation pages + * @name Table Structure + * + * @requires jQuery + * @requires jQueryUI + * @required js/functions.js + */ + +/** + * Returns the array of indexes based on the index choice + * + * @param index_choice index choice + */ +function PMA_getIndexArray (index_choice) { + var source_array = null; + + switch (index_choice.toLowerCase()) { + case 'primary': + source_array = primary_indexes; + break; + case 'unique': + source_array = unique_indexes; + break; + case 'index': + source_array = indexes; + break; + case 'fulltext': + source_array = fulltext_indexes; + break; + case 'spatial': + source_array = spatial_indexes; + break; + default: + return null; + } + return source_array; +} + +/** + * Hides/shows the inputs and submits appropriately depending + * on whether the index type chosen is 'SPATIAL' or not. + */ +function checkIndexType () { + /** + * @var Object Dropdown to select the index choice. + */ + var $select_index_choice = $('#select_index_choice'); + /** + * @var Object Dropdown to select the index type. + */ + var $select_index_type = $('#select_index_type'); + /** + * @var Object Table header for the size column. + */ + var $size_header = $('#index_columns').find('thead tr th:nth-child(2)'); + /** + * @var Object Inputs to specify the columns for the index. + */ + var $column_inputs = $('select[name="index[columns][names][]"]'); + /** + * @var Object Inputs to specify sizes for columns of the index. + */ + var $size_inputs = $('input[name="index[columns][sub_parts][]"]'); + /** + * @var Object Footer containg the controllers to add more columns + */ + var $add_more = $('#index_frm').find('.add_more'); + + if ($select_index_choice.val() === 'SPATIAL') { + // Disable and hide the size column + $size_header.hide(); + $size_inputs.each(function () { + $(this) + .prop('disabled', true) + .parent('td').hide(); + }); + + // Disable and hide the columns of the index other than the first one + var initial = true; + $column_inputs.each(function () { + $column_input = $(this); + if (! initial) { + $column_input + .prop('disabled', true) + .parent('td').hide(); + } else { + initial = false; + } + }); + + // Hide controllers to add more columns + $add_more.hide(); + } else { + // Enable and show the size column + $size_header.show(); + $size_inputs.each(function () { + $(this) + .prop('disabled', false) + .parent('td').show(); + }); + + // Enable and show the columns of the index + $column_inputs.each(function () { + $(this) + .prop('disabled', false) + .parent('td').show(); + }); + + // Show controllers to add more columns + $add_more.show(); + } + + if ($select_index_choice.val() === 'SPATIAL' || + $select_index_choice.val() === 'FULLTEXT') { + $select_index_type.val('').prop('disabled', true); + } else { + $select_index_type.prop('disabled', false); + } +} + +/** + * Sets current index information into form parameters. + * + * @param array source_array Array containing index columns + * @param string index_choice Choice of index + * + * @return void + */ +function PMA_setIndexFormParameters (source_array, index_choice) { + if (index_choice === 'index') { + $('input[name="indexes"]').val(JSON.stringify(source_array)); + } else { + $('input[name="' + index_choice + '_indexes"]').val(JSON.stringify(source_array)); + } +} + +/** + * Removes a column from an Index. + * + * @param string col_index Index of column in form + * + * @return void + */ +function PMA_removeColumnFromIndex (col_index) { + // Get previous index details. + var previous_index = $('select[name="field_key[' + col_index + ']"]') + .attr('data-index'); + if (previous_index.length) { + previous_index = previous_index.split(','); + var source_array = PMA_getIndexArray(previous_index[0]); + if (source_array === null) { + return; + } + + // Remove column from index array. + var source_length = source_array[previous_index[1]].columns.length; + for (var i = 0; i < source_length; i++) { + if (source_array[previous_index[1]].columns[i].col_index === col_index) { + source_array[previous_index[1]].columns.splice(i, 1); + } + } + + // Remove index completely if no columns left. + if (source_array[previous_index[1]].columns.length === 0) { + source_array.splice(previous_index[1], 1); + } + + // Update current index details. + $('select[name="field_key[' + col_index + ']"]').attr('data-index', ''); + // Update form index parameters. + PMA_setIndexFormParameters(source_array, previous_index[0].toLowerCase()); + } +} + +/** + * Adds a column to an Index. + * + * @param array source_array Array holding corresponding indexes + * @param string array_index Index of an INDEX in array + * @param string index_choice Choice of Index + * @param string col_index Index of column on form + * + * @return void + */ +function PMA_addColumnToIndex (source_array, array_index, index_choice, col_index) { + if (col_index >= 0) { + // Remove column from other indexes (if any). + PMA_removeColumnFromIndex(col_index); + } + var index_name = $('input[name="index[Key_name]"]').val(); + var index_comment = $('input[name="index[Index_comment]"]').val(); + var key_block_size = $('input[name="index[Key_block_size]"]').val(); + var parser = $('input[name="index[Parser]"]').val(); + var index_type = $('select[name="index[Index_type]"]').val(); + var columns = []; + $('#index_columns').find('tbody').find('tr').each(function () { + // Get columns in particular order. + var col_index = $(this).find('select[name="index[columns][names][]"]').val(); + var size = $(this).find('input[name="index[columns][sub_parts][]"]').val(); + columns.push({ + 'col_index': col_index, + 'size': size + }); + }); + + // Update or create an index. + source_array[array_index] = { + 'Key_name': index_name, + 'Index_comment': index_comment, + 'Index_choice': index_choice.toUpperCase(), + 'Key_block_size': key_block_size, + 'Parser': parser, + 'Index_type': index_type, + 'columns': columns + }; + + // Display index name (or column list) + var displayName = index_name; + if (displayName === '') { + var columnNames = []; + $.each(columns, function () { + columnNames.push($('input[name="field_name[' + this.col_index + ']"]').val()); + }); + displayName = '[' + columnNames.join(', ') + ']'; + } + $.each(columns, function () { + var id = 'index_name_' + this.col_index + '_8'; + var $name = $('#' + id); + if ($name.length === 0) { + $name = $(''); + $name.insertAfter($('select[name="field_key[' + this.col_index + ']"]')); + } + var $text = $('').text(displayName); + $name.html($text); + }); + + if (col_index >= 0) { + // Update index details on form. + $('select[name="field_key[' + col_index + ']"]') + .attr('data-index', index_choice + ',' + array_index); + } + PMA_setIndexFormParameters(source_array, index_choice.toLowerCase()); +} + +/** + * Get choices list for a column to create a composite index with. + * + * @param string index_choice Choice of index + * @param array source_array Array hodling columns for particular index + * + * @return jQuery Object + */ +function PMA_getCompositeIndexList (source_array, col_index) { + // Remove any previous list. + if ($('#composite_index_list').length) { + $('#composite_index_list').remove(); + } + + // Html list. + var $composite_index_list = $( + '
      ' + + '
      ' + PMA_messages.strCompositeWith + '
      ' + + '
    ' + ); + + // Add each column to list available for composite index. + var source_length = source_array.length; + var already_present = false; + for (var i = 0; i < source_length; i++) { + var sub_array_len = source_array[i].columns.length; + var column_names = []; + for (var j = 0; j < sub_array_len; j++) { + column_names.push( + $('input[name="field_name[' + source_array[i].columns[j].col_index + ']"]').val() + ); + + if (col_index === source_array[i].columns[j].col_index) { + already_present = true; + } + } + + $composite_index_list.append( + '
  • ' + + '' + + '
  • ' + ); + } + + return $composite_index_list; +} + +/** + * Shows 'Add Index' dialog. + * + * @param array source_array Array holding particluar index + * @param string array_index Index of an INDEX in array + * @param array target_columns Columns for an INDEX + * @param string col_index Index of column on form + * @param object index Index detail object + * + * @return void + */ +function PMA_showAddIndexDialog (source_array, array_index, target_columns, col_index, index) { + // Prepare post-data. + var $table = $('input[name="table"]'); + var table = $table.length > 0 ? $table.val() : ''; + var post_data = { + server: PMA_commonParams.get('server'), + db: $('input[name="db"]').val(), + table: table, + ajax_request: 1, + create_edit_table: 1, + index: index + }; + + var columns = {}; + for (var i = 0; i < target_columns.length; i++) { + var column_name = $('input[name="field_name[' + target_columns[i] + ']"]').val(); + var column_type = $('select[name="field_type[' + target_columns[i] + ']"]').val().toLowerCase(); + columns[column_name] = [column_type, target_columns[i]]; + } + post_data.columns = JSON.stringify(columns); + + var button_options = {}; + button_options[PMA_messages.strGo] = function () { + var is_missing_value = false; + $('select[name="index[columns][names][]"]').each(function () { + if ($(this).val() === '') { + is_missing_value = true; + } + }); + + if (! is_missing_value) { + PMA_addColumnToIndex( + source_array, + array_index, + index.Index_choice, + col_index + ); + } else { + PMA_ajaxShowMessage( + '
    ' + PMA_messages.strMissingColumn + + '
    ', false + ); + + return false; + } + + $(this).dialog('close'); + }; + button_options[PMA_messages.strCancel] = function () { + if (col_index >= 0) { + // Handle state on 'Cancel'. + var $select_list = $('select[name="field_key[' + col_index + ']"]'); + if (! $select_list.attr('data-index').length) { + $select_list.find('option[value*="none"]').attr('selected', 'selected'); + } else { + var previous_index = $select_list.attr('data-index').split(','); + $select_list.find('option[value*="' + previous_index[0].toLowerCase() + '"]') + .attr('selected', 'selected'); + } + } + $(this).dialog('close'); + }; + var $msgbox = PMA_ajaxShowMessage(); + $.post('tbl_indexes.php', post_data, function (data) { + if (data.success === false) { + // in the case of an error, show the error message returned. + PMA_ajaxShowMessage(data.error, false); + } else { + PMA_ajaxRemoveMessage($msgbox); + // Show dialog if the request was successful + var $div = $('
    '); + $div + .append(data.message) + .dialog({ + title: PMA_messages.strAddIndex, + width: 450, + minHeight: 250, + open: function () { + checkIndexName('index_frm'); + PMA_showHints($div); + PMA_init_slider(); + $('#index_columns').find('td').each(function () { + $(this).css('width', $(this).width() + 'px'); + }); + $('#index_columns').find('tbody').sortable({ + axis: 'y', + containment: $('#index_columns').find('tbody'), + tolerance: 'pointer' + }); + // We dont need the slider at this moment. + $(this).find('fieldset.tblFooters').remove(); + }, + modal: true, + buttons: button_options, + close: function () { + $(this).remove(); + } + }); + } + }); +} + +/** + * Creates a advanced index type selection dialog. + * + * @param array source_array Array holding a particular type of indexes + * @param string index_choice Choice of index + * @param string col_index Index of new column on form + * + * @return void + */ +function PMA_indexTypeSelectionDialog (source_array, index_choice, col_index) { + var $single_column_radio = $('' + + ''); + var $composite_index_radio = $('' + + ''); + var $dialog_content = $('
    '); + $dialog_content.append('' + index_choice.toUpperCase() + ''); + + + // For UNIQUE/INDEX type, show choice for single-column and composite index. + $dialog_content.append($single_column_radio); + $dialog_content.append($composite_index_radio); + + var button_options = {}; + // 'OK' operation. + button_options[PMA_messages.strGo] = function () { + if ($('#single_column').is(':checked')) { + var index = { + 'Key_name': (index_choice === 'primary' ? 'PRIMARY' : ''), + 'Index_choice': index_choice.toUpperCase() + }; + PMA_showAddIndexDialog(source_array, (source_array.length), [col_index], col_index, index); + } + + if ($('#composite_index').is(':checked')) { + if ($('input[name="composite_with"]').length !== 0 && $('input[name="composite_with"]:checked').length === 0 + ) { + PMA_ajaxShowMessage( + '
    ' + + PMA_messages.strFormEmpty + + '
    ', + false + ); + return false; + } + + var array_index = $('input[name="composite_with"]:checked').val(); + var source_length = source_array[array_index].columns.length; + var target_columns = []; + for (var i = 0; i < source_length; i++) { + target_columns.push(source_array[array_index].columns[i].col_index); + } + target_columns.push(col_index); + + PMA_showAddIndexDialog(source_array, array_index, target_columns, col_index, + source_array[array_index]); + } + + $(this).remove(); + }; + button_options[PMA_messages.strCancel] = function () { + // Handle state on 'Cancel'. + var $select_list = $('select[name="field_key[' + col_index + ']"]'); + if (! $select_list.attr('data-index').length) { + $select_list.find('option[value*="none"]').attr('selected', 'selected'); + } else { + var previous_index = $select_list.attr('data-index').split(','); + $select_list.find('option[value*="' + previous_index[0].toLowerCase() + '"]') + .attr('selected', 'selected'); + } + $(this).remove(); + }; + var $dialog = $('
    ').append($dialog_content).dialog({ + minWidth: 525, + minHeight: 200, + modal: true, + title: PMA_messages.strAddIndex, + resizable: false, + buttons: button_options, + open: function () { + $('#composite_index').on('change', function () { + if ($(this).is(':checked')) { + $dialog_content.append(PMA_getCompositeIndexList(source_array, col_index)); + } + }); + $('#single_column').on('change', function () { + if ($(this).is(':checked')) { + if ($('#composite_index_list').length) { + $('#composite_index_list').remove(); + } + } + }); + }, + close: function () { + $('#composite_index').off('change'); + $('#single_column').off('change'); + $(this).remove(); + } + }); +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('indexes.js', function () { + $(document).off('click', '#save_index_frm'); + $(document).off('click', '#preview_index_frm'); + $(document).off('change', '#select_index_choice'); + $(document).off('click', 'a.drop_primary_key_index_anchor.ajax'); + $(document).off('click', '#table_index tbody tr td.edit_index.ajax, #index_div .add_index.ajax'); + $(document).off('click', '#index_frm input[type=submit]'); + $('body').off('change', 'select[name*="field_key"]'); + $(document).off('click', '.show_index_dialog'); +}); + +/** + * @description

    Ajax scripts for table index page

    + * + * Actions ajaxified here: + *
      + *
    • Showing/hiding inputs depending on the index type chosen
    • + *
    • create/edit/drop indexes
    • + *
    + */ +AJAX.registerOnload('indexes.js', function () { + // Re-initialize variables. + primary_indexes = []; + unique_indexes = []; + indexes = []; + fulltext_indexes = []; + spatial_indexes = []; + + // for table creation form + var $engine_selector = $('.create_table_form select[name=tbl_storage_engine]'); + if ($engine_selector.length) { + PMA_hideShowConnection($engine_selector); + } + + var $form = $('#index_frm'); + if ($form.length > 0) { + showIndexEditDialog($form); + } + + $(document).on('click', '#save_index_frm', function (event) { + event.preventDefault(); + var $form = $('#index_frm'); + var argsep = PMA_commonParams.get('arg_separator'); + var submitData = $form.serialize() + argsep + 'do_save_data=1' + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true'; + var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + AJAX.source = $form; + $.post($form.attr('action'), submitData, AJAX.responseHandler); + }); + + $(document).on('click', '#preview_index_frm', function (event) { + event.preventDefault(); + PMA_previewSQL($('#index_frm')); + }); + + $(document).on('change', '#select_index_choice', function (event) { + event.preventDefault(); + checkIndexType(); + checkIndexName('index_frm'); + }); + + /** + * Ajax Event handler for 'Drop Index' + */ + $(document).on('click', 'a.drop_primary_key_index_anchor.ajax', function (event) { + event.preventDefault(); + var $anchor = $(this); + /** + * @var $curr_row Object containing reference to the current field's row + */ + var $curr_row = $anchor.parents('tr'); + /** @var Number of columns in the key */ + var rows = $anchor.parents('td').attr('rowspan') || 1; + /** @var Rows that should be hidden */ + var $rows_to_hide = $curr_row; + for (var i = 1, $last_row = $curr_row.next(); i < rows; i++, $last_row = $last_row.next()) { + $rows_to_hide = $rows_to_hide.add($last_row); + } + + var question = escapeHtml( + $curr_row.children('td') + .children('.drop_primary_key_index_msg') + .val() + ); + + PMA_confirmPreviewSQL(question, $anchor.attr('href'), function (url) { + var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingPrimaryKeyIndex, false); + var params = getJSConfirmCommonParam(this, $anchor.getPostData()); + $.post(url, params, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxRemoveMessage($msg); + var $table_ref = $rows_to_hide.closest('table'); + if ($rows_to_hide.length === $table_ref.find('tbody > tr').length) { + // We are about to remove all rows from the table + $table_ref.hide('medium', function () { + $('div.no_indexes_defined').show('medium'); + $rows_to_hide.remove(); + }); + $table_ref.siblings('div.notice').hide('medium'); + } else { + // We are removing some of the rows only + $rows_to_hide.hide('medium', function () { + $(this).remove(); + }); + } + if ($('.result_query').length) { + $('.result_query').remove(); + } + if (data.sql_query) { + $('
    ') + .html(data.sql_query) + .prependTo('#structure_content'); + PMA_highlightSQL($('#page_content')); + } + PMA_commonActions.refreshMain(false, function () { + $('a.ajax[href^=#indexes]').click(); + }); + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest + ' : ' + data.error, false); + } + }); // end $.post() + }); // end $.PMA_confirm() + }); // end Drop Primary Key/Index + + /** + *Ajax event handler for index edit + **/ + $(document).on('click', '#table_index tbody tr td.edit_index.ajax, #index_div .add_index.ajax', function (event) { + event.preventDefault(); + var url; + var title; + if ($(this).find('a').length === 0) { + // Add index + var valid = checkFormElementInRange( + $(this).closest('form')[0], + 'added_fields', + 'Column count has to be larger than zero.' + ); + if (! valid) { + return; + } + url = $(this).closest('form').serialize(); + title = PMA_messages.strAddIndex; + } else { + // Edit index + url = $(this).find('a').getPostData(); + title = PMA_messages.strEditIndex; + } + url += PMA_commonParams.get('arg_separator') + 'ajax_request=true'; + indexEditorDialog(url, title, function () { + // refresh the page using ajax + PMA_commonActions.refreshMain(false, function () { + $('a.ajax[href^=#indexes]').click(); + }); + }); + }); + + /** + * Ajax event handler for advanced index creation during table creation + * and column addition. + */ + $('body').on('change', 'select[name*="field_key"]', function () { + // Index of column on Table edit and create page. + var col_index = /\d+/.exec($(this).attr('name')); + col_index = col_index[0]; + // Choice of selected index. + var index_choice = /[a-z]+/.exec($(this).val()); + index_choice = index_choice[0]; + // Array containing corresponding indexes. + var source_array = null; + + if (index_choice === 'none') { + PMA_removeColumnFromIndex(col_index); + var id = 'index_name_' + '0' + '_8'; + var $name = $('#' + id); + if ($name.length === 0) { + $name = $(''); + $name.insertAfter($('select[name="field_key[' + '0' + ']"]')); + } + $name.html(''); + return false; + } + + // Select a source array. + source_array = PMA_getIndexArray(index_choice); + if (source_array === null) { + return; + } + + if (source_array.length === 0) { + var index = { + 'Key_name': (index_choice === 'primary' ? 'PRIMARY' : ''), + 'Index_choice': index_choice.toUpperCase() + }; + PMA_showAddIndexDialog(source_array, 0, [col_index], col_index, index); + } else { + if (index_choice === 'primary') { + var array_index = 0; + var source_length = source_array[array_index].columns.length; + var target_columns = []; + for (var i = 0; i < source_length; i++) { + target_columns.push(source_array[array_index].columns[i].col_index); + } + target_columns.push(col_index); + + PMA_showAddIndexDialog(source_array, array_index, target_columns, col_index, + source_array[array_index]); + } else { + // If there are multiple columns selected for an index, show advanced dialog. + PMA_indexTypeSelectionDialog(source_array, index_choice, col_index); + } + } + }); + + $(document).on('click', '.show_index_dialog', function (e) { + e.preventDefault(); + + // Get index details. + var previous_index = $(this).prev('select') + .attr('data-index') + .split(','); + + var index_choice = previous_index[0]; + var array_index = previous_index[1]; + + var source_array = PMA_getIndexArray(index_choice); + if (source_array !== null) { + var source_length = source_array[array_index].columns.length; + + var target_columns = []; + for (var i = 0; i < source_length; i++) { + target_columns.push(source_array[array_index].columns[i].col_index); + } + + PMA_showAddIndexDialog(source_array, array_index, target_columns, -1, source_array[array_index]); + } + }); + + $('#index_frm').on('submit', function () { + if (typeof(this.elements['index[Key_name]'].disabled) !== 'undefined') { + this.elements['index[Key_name]'].disabled = false; + } + }); +}); diff --git a/phpMyAdmin/js/jqplot/plugins/jqplot.byteFormatter.js b/phpMyAdmin/js/jqplot/plugins/jqplot.byteFormatter.js new file mode 100755 index 0000000..610692d --- /dev/null +++ b/phpMyAdmin/js/jqplot/plugins/jqplot.byteFormatter.js @@ -0,0 +1,46 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * jqplot formatter for byte values + * + * @package phpMyAdmin + */ +(function ($) { + 'use strict'; + var formatByte = function (val, index) { + var units = [ + PMA_messages.strB, + PMA_messages.strKiB, + PMA_messages.strMiB, + PMA_messages.strGiB, + PMA_messages.strTiB, + PMA_messages.strPiB, + PMA_messages.strEiB + ]; + while (val >= 1024 && index <= 6) { + val /= 1024; + index++; + } + var format = '%.1f'; + if (Math.floor(val) === val) { + format = '%.0f'; + } + return $.jqplot.sprintf( + format + ' ' + units[index], val + ); + }; + /** + * The index indicates what unit the incoming data will be in. + * 0 for bytes, 1 for kilobytes and so on... + */ + $.jqplot.byteFormatter = function (index) { + index = index || 0; + return function (format, val) { + if (typeof val === 'number') { + val = parseFloat(val) || 0; + return formatByte(val, index); + } else { + return String(val); + } + }; + }; +}(jQuery)); diff --git a/phpMyAdmin/js/keyhandler.js b/phpMyAdmin/js/keyhandler.js new file mode 100755 index 0000000..a5e459f --- /dev/null +++ b/phpMyAdmin/js/keyhandler.js @@ -0,0 +1,140 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +// global var that holds: 0- if ctrl key is not pressed 1- if ctrl key is pressed +var ctrlKeyHistory = 0; + +/** + * Allows moving around inputs/select by Ctrl+arrows + * + * @param object event data + */ +function onKeyDownArrowsHandler (e) { + e = e || window.event; + + var o = (e.srcElement || e.target); + if (!o) { + return; + } + if (o.tagName !== 'TEXTAREA' && o.tagName !== 'INPUT' && o.tagName !== 'SELECT') { + return; + } + if ((e.which !== 17) && (e.which !== 37) && (e.which !== 38) && (e.which !== 39) && (e.which !== 40)) { + return; + } + if (!o.id) { + return; + } + + if (e.type === 'keyup') { + if (e.which === 17) { + ctrlKeyHistory = 0; + } + return; + } else if (e.type === 'keydown') { + if (e.which === 17) { + ctrlKeyHistory = 1; + } + } + + if (ctrlKeyHistory !== 1) { + return; + } + + e.preventDefault(); + + var pos = o.id.split('_'); + if (pos[0] !== 'field' || typeof pos[2] === 'undefined') { + return; + } + + var x = pos[2]; + var y = pos[1]; + + switch (e.keyCode) { + case 38: + // up + y--; + break; + case 40: + // down + y++; + break; + case 37: + // left + x--; + break; + case 39: + // right + x++; + break; + default: + return; + } + + var is_firefox = navigator.userAgent.toLowerCase().indexOf('firefox/') > -1; + + var id = 'field_' + y + '_' + x; + + var nO = document.getElementById(id); + if (! nO) { + id = 'field_' + y + '_' + x + '_0'; + nO = document.getElementById(id); + } + + // skip non existent fields + if (! nO) { + return; + } + + // for firefox select tag + var lvalue = o.selectedIndex; + var nOvalue = nO.selectedIndex; + + nO.focus(); + + if (is_firefox) { + var ffcheck = 0; + var ffversion; + for (ffversion = 3 ; ffversion < 25 ; ffversion++) { + var is_firefox_v_24 = navigator.userAgent.toLowerCase().indexOf('firefox/' + ffversion) > -1; + if (is_firefox_v_24) { + ffcheck = 1; + break; + } + } + if (ffcheck === 1) { + if (e.which === 38 || e.which === 37) { + nOvalue++; + } else if (e.which === 40 || e.which === 39) { + nOvalue--; + } + nO.selectedIndex = nOvalue; + } else { + if (e.which === 38 || e.which === 37) { + lvalue++; + } else if (e.which === 40 || e.which === 39) { + lvalue--; + } + o.selectedIndex = lvalue; + } + } + + if (nO.tagName !== 'SELECT') { + nO.select(); + } + e.returnValue = false; +} + +AJAX.registerTeardown('keyhandler.js', function () { + $(document).off('keydown keyup', '#table_columns'); + $(document).off('keydown keyup', 'table.insertRowTable'); +}); + +AJAX.registerOnload('keyhandler.js', function () { + $(document).on('keydown keyup', '#table_columns', function (event) { + onKeyDownArrowsHandler(event.originalEvent); + }); + $(document).on('keydown keyup', 'table.insertRowTable', function (event) { + onKeyDownArrowsHandler(event.originalEvent); + }); +}); diff --git a/phpMyAdmin/js/makegrid.js b/phpMyAdmin/js/makegrid.js new file mode 100755 index 0000000..08157bc --- /dev/null +++ b/phpMyAdmin/js/makegrid.js @@ -0,0 +1,2301 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Create advanced table (resize, reorder, and show/hide columns; and also grid editing). + * This function is designed mainly for table DOM generated from browsing a table in the database. + * For using this function in other table DOM, you may need to: + * - add "draggable" class in the table header , in order to make it resizable, sortable or hidable + * - have at least one non-"draggable" header in the table DOM for placing column visibility drop-down arrow + * - pass the value "false" for the parameter "enableGridEdit" + * - adjust other parameter value, to select which features that will be enabled + * + * @param t the table DOM element + * @param enableResize Optional, if false, column resizing feature will be disabled + * @param enableReorder Optional, if false, column reordering feature will be disabled + * @param enableVisib Optional, if false, show/hide column feature will be disabled + * @param enableGridEdit Optional, if false, grid editing feature will be disabled + */ +function PMA_makegrid (t, enableResize, enableReorder, enableVisib, enableGridEdit) { + var g = { + /** ********* + * Constant + ***********/ + minColWidth: 15, + + + /** ********* + * Variables, assigned with default value, changed later + ***********/ + actionSpan: 5, // number of colspan in Actions header in a table + tableCreateTime: null, // table creation time, used for saving column order and visibility to server, only available in "Browse tab" + + // Column reordering variables + colOrder: [], // array of column order + + // Column visibility variables + colVisib: [], // array of column visibility + showAllColText: '', // string, text for "show all" button under column visibility list + visibleHeadersCount: 0, // number of visible data headers + + // Table hint variables + reorderHint: '', // string, hint for column reordering + sortHint: '', // string, hint for column sorting + markHint: '', // string, hint for column marking + copyHint: '', // string, hint for copy column name + showReorderHint: false, + showSortHint: false, + showMarkHint: false, + + // Grid editing + isCellEditActive: false, // true if current focus is in edit cell + isEditCellTextEditable: false, // true if current edit cell is editable in the text input box (not textarea) + currentEditCell: null, // reference to that currently being edited + cellEditHint: '', // hint shown when doing grid edit + gotoLinkText: '', // "Go to link" text + wasEditedCellNull: false, // true if last value of the edited cell was NULL + maxTruncatedLen: 0, // number of characters that can be displayed in a cell + saveCellsAtOnce: false, // $cfg[saveCellsAtOnce] + isCellEdited: false, // true if at least one cell has been edited + saveCellWarning: '', // string, warning text when user want to leave a page with unsaved edited data + lastXHR : null, // last XHR object used in AJAX request + isSaving: false, // true when currently saving edited data, used to handle double posting caused by pressing ENTER in grid edit text box in Chrome browser + alertNonUnique: '', // string, alert shown when saving edited nonunique table + + // Common hidden inputs + token: null, + server: null, + db: null, + table: null, + + + /** ********** + * Functions + ************/ + + /** + * Start to resize column. Called when clicking on column separator. + * + * @param e event + * @param obj dragged div object + */ + dragStartRsz: function (e, obj) { + var n = $(g.cRsz).find('div').index(obj); // get the index of separator (i.e., column index) + $(obj).addClass('colborder_active'); + g.colRsz = { + x0: e.pageX, + n: n, + obj: obj, + objLeft: $(obj).position().left, + objWidth: $(g.t).find('th.draggable:visible:eq(' + n + ') span').outerWidth() + }; + $(document.body).css('cursor', 'col-resize').noSelect(); + if (g.isCellEditActive) { + g.hideEditCell(); + } + }, + + /** + * Start to reorder column. Called when clicking on table header. + * + * @param e event + * @param obj table header object + */ + dragStartReorder: function (e, obj) { + // prepare the cCpy (column copy) and cPointer (column pointer) from the dragged column + $(g.cCpy).text($(obj).text()); + var objPos = $(obj).position(); + $(g.cCpy).css({ + top: objPos.top + 20, + left: objPos.left, + height: $(obj).height(), + width: $(obj).width() + }); + $(g.cPointer).css({ + top: objPos.top + }); + + // get the column index, zero-based + var n = g.getHeaderIdx(obj); + + g.colReorder = { + x0: e.pageX, + y0: e.pageY, + n: n, + newn: n, + obj: obj, + objTop: objPos.top, + objLeft: objPos.left + }; + + $(document.body).css('cursor', 'move').noSelect(); + if (g.isCellEditActive) { + g.hideEditCell(); + } + }, + + /** + * Handle mousemove event when dragging. + * + * @param e event + */ + dragMove: function (e) { + if (g.colRsz) { + var dx = e.pageX - g.colRsz.x0; + if (g.colRsz.objWidth + dx > g.minColWidth) { + $(g.colRsz.obj).css('left', g.colRsz.objLeft + dx + 'px'); + } + } else if (g.colReorder) { + // dragged column animation + var dx = e.pageX - g.colReorder.x0; + $(g.cCpy) + .css('left', g.colReorder.objLeft + dx) + .show(); + + // pointer animation + var hoveredCol = g.getHoveredCol(e); + if (hoveredCol) { + var newn = g.getHeaderIdx(hoveredCol); + g.colReorder.newn = newn; + if (newn !== g.colReorder.n) { + // show the column pointer in the right place + var colPos = $(hoveredCol).position(); + var newleft = newn < g.colReorder.n ? + colPos.left : + colPos.left + $(hoveredCol).outerWidth(); + $(g.cPointer) + .css({ + left: newleft, + visibility: 'visible' + }); + } else { + // no movement to other column, hide the column pointer + $(g.cPointer).css('visibility', 'hidden'); + } + } + } + }, + + /** + * Stop the dragging action. + * + * @param e event + */ + dragEnd: function (e) { + if (g.colRsz) { + var dx = e.pageX - g.colRsz.x0; + var nw = g.colRsz.objWidth + dx; + if (nw < g.minColWidth) { + nw = g.minColWidth; + } + var n = g.colRsz.n; + // do the resizing + g.resize(n, nw); + + g.reposRsz(); + g.reposDrop(); + g.colRsz = false; + $(g.cRsz).find('div').removeClass('colborder_active'); + rearrangeStickyColumns($(t).prev('.sticky_columns'), $(t)); + } else if (g.colReorder) { + // shift columns + if (g.colReorder.newn !== g.colReorder.n) { + g.shiftCol(g.colReorder.n, g.colReorder.newn); + // assign new position + var objPos = $(g.colReorder.obj).position(); + g.colReorder.objTop = objPos.top; + g.colReorder.objLeft = objPos.left; + g.colReorder.n = g.colReorder.newn; + // send request to server to remember the column order + if (g.tableCreateTime) { + g.sendColPrefs(); + } + g.refreshRestoreButton(); + } + + // animate new column position + $(g.cCpy).stop(true, true) + .animate({ + top: g.colReorder.objTop, + left: g.colReorder.objLeft + }, 'fast') + .fadeOut(); + $(g.cPointer).css('visibility', 'hidden'); + + g.colReorder = false; + rearrangeStickyColumns($(t).prev('.sticky_columns'), $(t)); + } + $(document.body).css('cursor', 'inherit').noSelect(false); + }, + + /** + * Resize column n to new width "nw" + * + * @param n zero-based column index + * @param nw new width of the column in pixel + */ + resize: function (n, nw) { + $(g.t).find('tr').each(function () { + $(this).find('th.draggable:visible:eq(' + n + ') span,' + + 'td:visible:eq(' + (g.actionSpan + n) + ') span') + .css('width', nw); + }); + }, + + /** + * Reposition column resize bars. + */ + reposRsz: function () { + $(g.cRsz).find('div').hide(); + var $firstRowCols = $(g.t).find('tr:first th.draggable:visible'); + var $resizeHandles = $(g.cRsz).find('div').removeClass('condition'); + $(g.t).find('table.pma_table').find('thead th:first').removeClass('before-condition'); + for (var n = 0, l = $firstRowCols.length; n < l; n++) { + var $col = $($firstRowCols[n]); + var colWidth; + if (navigator.userAgent.toLowerCase().indexOf('safari') !== -1) { + colWidth = $col.outerWidth(); + } else { + colWidth = $col.outerWidth(true); + } + $($resizeHandles[n]).css('left', $col.position().left + colWidth) + .show(); + if ($col.hasClass('condition')) { + $($resizeHandles[n]).addClass('condition'); + if (n > 0) { + $($resizeHandles[n - 1]).addClass('condition'); + } + } + } + if ($($resizeHandles[0]).hasClass('condition')) { + $(g.t).find('thead th:first').addClass('before-condition'); + } + $(g.cRsz).css('height', $(g.t).height()); + }, + + /** + * Shift column from index oldn to newn. + * + * @param oldn old zero-based column index + * @param newn new zero-based column index + */ + shiftCol: function (oldn, newn) { + $(g.t).find('tr').each(function () { + if (newn < oldn) { + $(this).find('th.draggable:eq(' + newn + '),' + + 'td:eq(' + (g.actionSpan + newn) + ')') + .before($(this).find('th.draggable:eq(' + oldn + '),' + + 'td:eq(' + (g.actionSpan + oldn) + ')')); + } else { + $(this).find('th.draggable:eq(' + newn + '),' + + 'td:eq(' + (g.actionSpan + newn) + ')') + .after($(this).find('th.draggable:eq(' + oldn + '),' + + 'td:eq(' + (g.actionSpan + oldn) + ')')); + } + }); + // reposition the column resize bars + g.reposRsz(); + + // adjust the column visibility list + if (newn < oldn) { + $(g.cList).find('.lDiv div:eq(' + newn + ')') + .before($(g.cList).find('.lDiv div:eq(' + oldn + ')')); + } else { + $(g.cList).find('.lDiv div:eq(' + newn + ')') + .after($(g.cList).find('.lDiv div:eq(' + oldn + ')')); + } + // adjust the colOrder + var tmp = g.colOrder[oldn]; + g.colOrder.splice(oldn, 1); + g.colOrder.splice(newn, 0, tmp); + // adjust the colVisib + if (g.colVisib.length > 0) { + tmp = g.colVisib[oldn]; + g.colVisib.splice(oldn, 1); + g.colVisib.splice(newn, 0, tmp); + } + }, + + /** + * Find currently hovered table column's header (excluding actions column). + * + * @param e event + * @return the hovered column's th object or undefined if no hovered column found. + */ + getHoveredCol: function (e) { + var hoveredCol; + $headers = $(g.t).find('th.draggable:visible'); + $headers.each(function () { + var left = $(this).offset().left; + var right = left + $(this).outerWidth(); + if (left <= e.pageX && e.pageX <= right) { + hoveredCol = this; + } + }); + return hoveredCol; + }, + + /** + * Get a zero-based index from a tag in a table. + * + * @param obj table header object + * @return zero-based index of the specified table header in the set of table headers (visible or not) + */ + getHeaderIdx: function (obj) { + return $(obj).parents('tr').find('th.draggable').index(obj); + }, + + /** + * Reposition the columns back to normal order. + */ + restoreColOrder: function () { + // use insertion sort, since we already have shiftCol function + for (var i = 1; i < g.colOrder.length; i++) { + var x = g.colOrder[i]; + var j = i - 1; + while (j >= 0 && x < g.colOrder[j]) { + j--; + } + if (j !== i - 1) { + g.shiftCol(i, j + 1); + } + } + if (g.tableCreateTime) { + // send request to server to remember the column order + g.sendColPrefs(); + } + g.refreshRestoreButton(); + }, + + /** + * Send column preferences (column order and visibility) to the server. + */ + sendColPrefs: function () { + if ($(g.t).is('.ajax')) { // only send preferences if ajax class + var post_params = { + ajax_request: true, + db: g.db, + table: g.table, + token: g.token, + server: g.server, + set_col_prefs: true, + table_create_time: g.tableCreateTime + }; + if (g.colOrder.length > 0) { + $.extend(post_params, { col_order: g.colOrder.toString() }); + } + if (g.colVisib.length > 0) { + $.extend(post_params, { col_visib: g.colVisib.toString() }); + } + $.post('sql.php', post_params, function (data) { + if (data.success !== true) { + var $temp_div = $(document.createElement('div')); + $temp_div.html(data.error); + $temp_div.addClass('error'); + PMA_ajaxShowMessage($temp_div, false); + } + }); + } + }, + + /** + * Refresh restore button state. + * Make restore button disabled if the table is similar with initial state. + */ + refreshRestoreButton: function () { + // check if table state is as initial state + var isInitial = true; + for (var i = 0; i < g.colOrder.length; i++) { + if (g.colOrder[i] !== i) { + isInitial = false; + break; + } + } + // check if only one visible column left + var isOneColumn = g.visibleHeadersCount === 1; + // enable or disable restore button + if (isInitial || isOneColumn) { + $(g.o).find('div.restore_column').hide(); + } else { + $(g.o).find('div.restore_column').show(); + } + }, + + /** + * Update current hint using the boolean values (showReorderHint, showSortHint, etc.). + * + */ + updateHint: function () { + var text = ''; + if (!g.colRsz && !g.colReorder) { // if not resizing or dragging + if (g.visibleHeadersCount > 1) { + g.showReorderHint = true; + } + if ($(t).find('th.marker').length > 0) { + g.showMarkHint = true; + } + if (g.showSortHint && g.sortHint) { + text += text.length > 0 ? '
    ' : ''; + text += '- ' + g.sortHint; + } + if (g.showMultiSortHint && g.strMultiSortHint) { + text += text.length > 0 ? '
    ' : ''; + text += '- ' + g.strMultiSortHint; + } + if (g.showMarkHint && + g.markHint && + ! g.showSortHint && // we do not show mark hint, when sort hint is shown + g.showReorderHint && + g.reorderHint + ) { + text += text.length > 0 ? '
    ' : ''; + text += '- ' + g.reorderHint; + text += text.length > 0 ? '
    ' : ''; + text += '- ' + g.markHint; + text += text.length > 0 ? '
    ' : ''; + text += '- ' + g.copyHint; + } + } + return text; + }, + + /** + * Toggle column's visibility. + * After calling this function and it returns true, afterToggleCol() must be called. + * + * @return boolean True if the column is toggled successfully. + */ + toggleCol: function (n) { + if (g.colVisib[n]) { + // can hide if more than one column is visible + if (g.visibleHeadersCount > 1) { + $(g.t).find('tr').each(function () { + $(this).find('th.draggable:eq(' + n + '),' + + 'td:eq(' + (g.actionSpan + n) + ')') + .hide(); + }); + g.colVisib[n] = 0; + $(g.cList).find('.lDiv div:eq(' + n + ') input').prop('checked', false); + } else { + // cannot hide, force the checkbox to stay checked + $(g.cList).find('.lDiv div:eq(' + n + ') input').prop('checked', true); + return false; + } + } else { // column n is not visible + $(g.t).find('tr').each(function () { + $(this).find('th.draggable:eq(' + n + '),' + + 'td:eq(' + (g.actionSpan + n) + ')') + .show(); + }); + g.colVisib[n] = 1; + $(g.cList).find('.lDiv div:eq(' + n + ') input').prop('checked', true); + } + return true; + }, + + /** + * This must be called if toggleCol() returns is true. + * + * This function is separated from toggleCol because, sometimes, we want to toggle + * some columns together at one time and do just one adjustment after it, e.g. in showAllColumns(). + */ + afterToggleCol: function () { + // some adjustments after hiding column + g.reposRsz(); + g.reposDrop(); + g.sendColPrefs(); + + // check visible first row headers count + g.visibleHeadersCount = $(g.t).find('tr:first th.draggable:visible').length; + g.refreshRestoreButton(); + }, + + /** + * Show columns' visibility list. + * + * @param obj The drop down arrow of column visibility list + */ + showColList: function (obj) { + // only show when not resizing or reordering + if (!g.colRsz && !g.colReorder) { + var pos = $(obj).position(); + // check if the list position is too right + if (pos.left + $(g.cList).outerWidth(true) > $(document).width()) { + pos.left = $(document).width() - $(g.cList).outerWidth(true); + } + $(g.cList).css({ + left: pos.left, + top: pos.top + $(obj).outerHeight(true) + }) + .show(); + $(obj).addClass('coldrop-hover'); + } + }, + + /** + * Hide columns' visibility list. + */ + hideColList: function () { + $(g.cList).hide(); + $(g.cDrop).find('.coldrop-hover').removeClass('coldrop-hover'); + }, + + /** + * Reposition the column visibility drop-down arrow. + */ + reposDrop: function () { + var $th = $(t).find('th:not(.draggable)'); + for (var i = 0; i < $th.length; i++) { + var $cd = $(g.cDrop).find('div:eq(' + i + ')'); // column drop-down arrow + var pos = $($th[i]).position(); + $cd.css({ + left: pos.left + $($th[i]).width() - $cd.width(), + top: pos.top + }); + } + }, + + /** + * Show all hidden columns. + */ + showAllColumns: function () { + for (var i = 0; i < g.colVisib.length; i++) { + if (!g.colVisib[i]) { + g.toggleCol(i); + } + } + g.afterToggleCol(); + }, + + /** + * Show edit cell, if it can be shown + * + * @param cell element to be edited + */ + showEditCell: function (cell) { + if ($(cell).is('.grid_edit') && + !g.colRsz && !g.colReorder) { + if (!g.isCellEditActive) { + var $cell = $(cell); + + if ('string' === $cell.attr('data-type') || + 'blob' === $cell.attr('data-type') || + 'json' === $cell.attr('data-type') + ) { + g.cEdit = g.cEditTextarea; + } else { + g.cEdit = g.cEditStd; + } + + // remove all edit area and hide it + $(g.cEdit).find('.edit_area').empty().hide(); + // reposition the cEdit element + $(g.cEdit).css({ + top: $cell.position().top, + left: $cell.position().left + }) + .show() + .find('.edit_box') + .css({ + width: $cell.outerWidth(), + height: $cell.outerHeight() + }); + // fill the cell edit with text from + var value = PMA_getCellValue(cell); + if ($cell.attr('data-type') === 'json' && $cell.is('.truncated') === false) { + try { + value = JSON.stringify(JSON.parse(value), null, 4); + } catch (e) { + // Show as is + } + } + $(g.cEdit).find('.edit_box').val(value); + + g.currentEditCell = cell; + $(g.cEdit).find('.edit_box').focus(); + moveCursorToEnd($(g.cEdit).find('.edit_box')); + $(g.cEdit).find('*').prop('disabled', false); + } + } + + function moveCursorToEnd (input) { + var originalValue = input.val(); + var originallength = originalValue.length; + input.val(''); + input.blur().focus().val(originalValue); + input[0].setSelectionRange(originallength, originallength); + } + }, + + /** + * Remove edit cell and the edit area, if it is shown. + * + * @param force Optional, force to hide edit cell without saving edited field. + * @param data Optional, data from the POST AJAX request to save the edited field + * or just specify "true", if we want to replace the edited field with the new value. + * @param field Optional, the edited . If not specified, the function will + * use currently edited from g.currentEditCell. + * @param field Optional, this object contains a boolean named move (true, if called from move* functions) + * and a to which the grid_edit should move + */ + hideEditCell: function (force, data, field, options) { + if (g.isCellEditActive && !force) { + // cell is being edited, save or post the edited data + if (options !== undefined) { + g.saveOrPostEditedCell(options); + } else { + g.saveOrPostEditedCell(); + } + return; + } + + // cancel any previous request + if (g.lastXHR !== null) { + g.lastXHR.abort(); + g.lastXHR = null; + } + + if (data) { + if (g.currentEditCell) { // save value of currently edited cell + // replace current edited field with the new value + var $this_field = $(g.currentEditCell); + var is_null = $this_field.data('value') === null; + if (is_null) { + $this_field.find('span').html('NULL'); + $this_field.addClass('null'); + } else { + $this_field.removeClass('null'); + var value = data.isNeedToRecheck + ? data.truncatableFieldValue + : $this_field.data('value'); + + // Truncates the text. + $this_field.removeClass('truncated'); + if (PMA_commonParams.get('pftext') === 'P' && value.length > g.maxTruncatedLen) { + $this_field.addClass('truncated'); + value = value.substring(0, g.maxTruncatedLen) + '...'; + } + + // Add
    before carriage return. + new_html = escapeHtml(value); + new_html = new_html.replace(/\n/g, '
    \n'); + + // remove decimal places if column type not supported + if (($this_field.attr('data-decimals') === 0) && ($this_field.attr('data-type').indexOf('time') !== -1)) { + new_html = new_html.substring(0, new_html.indexOf('.')); + } + + // remove addtional decimal places + if (($this_field.attr('data-decimals') > 0) && ($this_field.attr('data-type').indexOf('time') !== -1)) { + new_html = new_html.substring(0, new_html.length - (6 - $this_field.attr('data-decimals'))); + } + + var selector = 'span'; + if ($this_field.hasClass('hex') && $this_field.find('a').length) { + selector = 'a'; + } + + // Updates the code keeping highlighting (if any). + var $target = $this_field.find(selector); + if (!PMA_updateCode($target, new_html, value)) { + $target.html(new_html); + } + } + if ($this_field.is('.bit')) { + $this_field.find('span').text($this_field.data('value')); + } + } + if (data.transformations !== undefined) { + $.each(data.transformations, function (cell_index, value) { + var $this_field = $(g.t).find('.to_be_saved:eq(' + cell_index + ')'); + $this_field.find('span').html(value); + }); + } + if (data.relations !== undefined) { + $.each(data.relations, function (cell_index, value) { + var $this_field = $(g.t).find('.to_be_saved:eq(' + cell_index + ')'); + $this_field.find('span').html(value); + }); + } + + // refresh the grid + g.reposRsz(); + g.reposDrop(); + } + + // hide the cell editing area + $(g.cEdit).hide(); + $(g.cEdit).find('.edit_box').blur(); + g.isCellEditActive = false; + g.currentEditCell = null; + // destroy datepicker in edit area, if exist + var $dp = $(g.cEdit).find('.hasDatepicker'); + if ($dp.length > 0) { + $(document).bind('mousedown', $.datepicker._checkExternalClick); + $dp.datepicker('destroy'); + // change the cursor in edit box back to normal + // (the cursor become a hand pointer when we add datepicker) + $(g.cEdit).find('.edit_box').css('cursor', 'inherit'); + } + }, + + /** + * Show drop-down edit area when edit cell is focused. + */ + showEditArea: function () { + if (!g.isCellEditActive) { // make sure the edit area has not been shown + g.isCellEditActive = true; + g.isEditCellTextEditable = false; + /** + * @var $td current edited cell + */ + var $td = $(g.currentEditCell); + /** + * @var $editArea the editing area + */ + var $editArea = $(g.cEdit).find('.edit_area'); + /** + * @var where_clause WHERE clause for the edited cell + */ + var where_clause = $td.parent('tr').find('.where_clause').val(); + /** + * @var field_name String containing the name of this field. + * @see getFieldName() + */ + var field_name = getFieldName($(t), $td); + /** + * @var relation_curr_value String current value of the field (for fields that are foreign keyed). + */ + var relation_curr_value = $td.text(); + /** + * @var relation_key_or_display_column String relational key if in 'Relational display column' mode, + * relational display column if in 'Relational key' mode (for fields that are foreign keyed). + */ + var relation_key_or_display_column = $td.find('a').attr('title'); + /** + * @var curr_value String current value of the field (for fields that are of type enum or set). + */ + var curr_value = $td.find('span').text(); + + // empty all edit area, then rebuild it based on $td classes + $editArea.empty(); + + // remember this instead of testing more than once + var is_null = $td.is('.null'); + + // add goto link, if this cell contains a link + if ($td.find('a').length > 0) { + var gotoLink = document.createElement('div'); + gotoLink.className = 'goto_link'; + $(gotoLink).append(g.gotoLinkText + ' ').append($td.find('a').clone()); + $editArea.append(gotoLink); + } + + g.wasEditedCellNull = false; + if ($td.is(':not(.not_null)')) { + // append a null checkbox + $editArea.append('
    '); + + var $checkbox = $editArea.find('.null_div input'); + // check if current is NULL + if (is_null) { + $checkbox.prop('checked', true); + g.wasEditedCellNull = true; + } + + // if the select/editor is changed un-check the 'checkbox_null__'. + if ($td.is('.enum, .set')) { + $editArea.on('change', 'select', function () { + $checkbox.prop('checked', false); + }); + } else if ($td.is('.relation')) { + $editArea.on('change', 'select', function () { + $checkbox.prop('checked', false); + }); + $editArea.on('click', '.browse_foreign', function () { + $checkbox.prop('checked', false); + }); + } else { + $(g.cEdit).on('keypress change paste', '.edit_box', function () { + $checkbox.prop('checked', false); + }); + // Capture ctrl+v (on IE and Chrome) + $(g.cEdit).on('keydown', '.edit_box', function (e) { + if (e.ctrlKey && e.which === 86) { + $checkbox.prop('checked', false); + } + }); + $editArea.on('keydown', 'textarea', function () { + $checkbox.prop('checked', false); + }); + } + // if some text is written in textbox automatically unmark the null checkbox and if it is emptied again mark the checkbox. + $(g.cEdit).find('.edit_box').on('input', function () { + if ($(g.cEdit).find('.edit_box').val() !== '') { + $checkbox.prop('checked', false); + } else { + $checkbox.prop('checked', true); + } + }); + // if null checkbox is clicked empty the corresponding select/editor. + $checkbox.click(function () { + if ($td.is('.enum')) { + $editArea.find('select').val(''); + } else if ($td.is('.set')) { + $editArea.find('select').find('option').each(function () { + var $option = $(this); + $option.prop('selected', false); + }); + } else if ($td.is('.relation')) { + // if the dropdown is there to select the foreign value + if ($editArea.find('select').length > 0) { + $editArea.find('select').val(''); + } + } else { + $editArea.find('textarea').val(''); + } + $(g.cEdit).find('.edit_box').val(''); + }); + } + + // reset the position of the edit_area div after closing datetime picker + $(g.cEdit).find('.edit_area').css({ 'top' :'0','position':'' }); + + if ($td.is('.relation')) { + // handle relations + $editArea.addClass('edit_area_loading'); + + // initialize the original data + $td.data('original_data', null); + + /** + * @var post_params Object containing parameters for the POST request + */ + var post_params = { + 'ajax_request' : true, + 'get_relational_values' : true, + 'server' : g.server, + 'db' : g.db, + 'table' : g.table, + 'column' : field_name, + 'curr_value' : relation_curr_value, + 'relation_key_or_display_column' : relation_key_or_display_column + }; + + g.lastXHR = $.post('sql.php', post_params, function (data) { + g.lastXHR = null; + $editArea.removeClass('edit_area_loading'); + if ($(data.dropdown).is('select')) { + // save original_data + var value = $(data.dropdown).val(); + $td.data('original_data', value); + // update the text input field, in case where the "Relational display column" is checked + $(g.cEdit).find('.edit_box').val(value); + } + + $editArea.append(data.dropdown); + $editArea.append('
    ' + g.cellEditHint + '
    '); + + // for 'Browse foreign values' options, + // hide the value next to 'Browse foreign values' link + $editArea.find('span.curr_value').hide(); + // handle update for new values selected from new window + $editArea.find('span.curr_value').change(function () { + $(g.cEdit).find('.edit_box').val($(this).text()); + }); + }); // end $.post() + + $editArea.show(); + $editArea.on('change', 'select', function () { + $(g.cEdit).find('.edit_box').val($(this).val()); + }); + g.isEditCellTextEditable = true; + } else if ($td.is('.enum')) { + // handle enum fields + $editArea.addClass('edit_area_loading'); + + /** + * @var post_params Object containing parameters for the POST request + */ + var post_params = { + 'ajax_request' : true, + 'get_enum_values' : true, + 'server' : g.server, + 'db' : g.db, + 'table' : g.table, + 'column' : field_name, + 'curr_value' : curr_value + }; + g.lastXHR = $.post('sql.php', post_params, function (data) { + g.lastXHR = null; + $editArea.removeClass('edit_area_loading'); + $editArea.append(data.dropdown); + $editArea.append('
    ' + g.cellEditHint + '
    '); + }); // end $.post() + + $editArea.show(); + $editArea.on('change', 'select', function () { + $(g.cEdit).find('.edit_box').val($(this).val()); + }); + } else if ($td.is('.set')) { + // handle set fields + $editArea.addClass('edit_area_loading'); + + /** + * @var post_params Object containing parameters for the POST request + */ + var post_params = { + 'ajax_request' : true, + 'get_set_values' : true, + 'server' : g.server, + 'db' : g.db, + 'table' : g.table, + 'column' : field_name, + 'curr_value' : curr_value + }; + + // if the data is truncated, get the full data + if ($td.is('.truncated')) { + post_params.get_full_values = true; + post_params.where_clause = where_clause; + } + + g.lastXHR = $.post('sql.php', post_params, function (data) { + g.lastXHR = null; + $editArea.removeClass('edit_area_loading'); + $editArea.append(data.select); + $td.data('original_data', $(data.select).val().join()); + $editArea.append('
    ' + g.cellEditHint + '
    '); + }); // end $.post() + + $editArea.show(); + $editArea.on('change', 'select', function () { + $(g.cEdit).find('.edit_box').val($(this).val()); + }); + } else if ($td.is('.truncated, .transformed')) { + if ($td.is('.to_be_saved')) { // cell has been edited + var value = $td.data('value'); + $(g.cEdit).find('.edit_box').val(value); + $editArea.append(''); + $editArea.find('textarea').val(value); + $editArea + .on('keyup', 'textarea', function () { + $(g.cEdit).find('.edit_box').val($(this).val()); + }); + $(g.cEdit).on('keyup', '.edit_box', function () { + $editArea.find('textarea').val($(this).val()); + }); + $editArea.append('
    ' + g.cellEditHint + '
    '); + } else { + // handle truncated/transformed values values + $editArea.addClass('edit_area_loading'); + + // initialize the original data + $td.data('original_data', null); + + /** + * @var sql_query String containing the SQL query used to retrieve value of truncated/transformed data + */ + var sql_query = 'SELECT `' + field_name + '` FROM `' + g.table + '` WHERE ' + where_clause; + + // Make the Ajax call and get the data, wrap it and insert it + g.lastXHR = $.post('sql.php', { + 'server' : g.server, + 'db' : g.db, + 'ajax_request' : true, + 'sql_query' : sql_query, + 'grid_edit' : true + }, function (data) { + g.lastXHR = null; + $editArea.removeClass('edit_area_loading'); + if (typeof data !== 'undefined' && data.success === true) { + if ($td.attr('data-type') === 'json') { + try { + data.value = JSON.stringify(JSON.parse(data.value), null, 4); + } catch (e) { + // Show as is + } + } + $td.data('original_data', data.value); + $(g.cEdit).find('.edit_box').val(data.value); + $editArea.append(''); + $editArea.find('textarea').val(data.value); + $editArea.on('keyup', 'textarea', function () { + $(g.cEdit).find('.edit_box').val($(this).val()); + }); + $(g.cEdit).on('keyup', '.edit_box', function () { + $editArea.find('textarea').val($(this).val()); + }); + $editArea.append('
    ' + g.cellEditHint + '
    '); + $editArea.show(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + } + g.isEditCellTextEditable = true; + } else if ($td.is('.timefield, .datefield, .datetimefield, .timestampfield')) { + var $input_field = $(g.cEdit).find('.edit_box'); + + // remember current datetime value in $input_field, if it is not null + var datetime_value = !is_null ? $input_field.val() : ''; + + var showMillisec = false; + var showMicrosec = false; + var timeFormat = 'HH:mm:ss'; + // check for decimal places of seconds + if (($td.attr('data-decimals') > 0) && ($td.attr('data-type').indexOf('time') !== -1)) { + if (datetime_value && datetime_value.indexOf('.') === false) { + datetime_value += '.'; + } + if ($td.attr('data-decimals') > 3) { + showMillisec = true; + showMicrosec = true; + timeFormat = 'HH:mm:ss.lc'; + + if (datetime_value) { + datetime_value += '000000'; + var datetime_value = datetime_value.substring(0, datetime_value.indexOf('.') + 7); + $input_field.val(datetime_value); + } + } else { + showMillisec = true; + timeFormat = 'HH:mm:ss.l'; + + if (datetime_value) { + datetime_value += '000'; + var datetime_value = datetime_value.substring(0, datetime_value.indexOf('.') + 4); + $input_field.val(datetime_value); + } + } + } + + // add datetime picker + PMA_addDatepicker($input_field, $td.attr('data-type'), { + showMillisec: showMillisec, + showMicrosec: showMicrosec, + timeFormat: timeFormat + }); + + $input_field.on('keyup', function (e) { + if (e.which === 13) { + // post on pressing "Enter" + e.preventDefault(); + e.stopPropagation(); + g.saveOrPostEditedCell(); + } else if (e.which === 27) { + } else { + toggleDatepickerIfInvalid($td, $input_field); + } + }); + + $input_field.datepicker('show'); + toggleDatepickerIfInvalid($td, $input_field); + + // unbind the mousedown event to prevent the problem of + // datepicker getting closed, needs to be checked for any + // change in names when updating + $(document).off('mousedown', $.datepicker._checkExternalClick); + + // move ui-datepicker-div inside cEdit div + var datepicker_div = $('#ui-datepicker-div'); + datepicker_div.css({ 'top': 0, 'left': 0, 'position': 'relative' }); + $(g.cEdit).append(datepicker_div); + + // cancel any click on the datepicker element + $editArea.find('> *').click(function (e) { + e.stopPropagation(); + }); + + g.isEditCellTextEditable = true; + } else { + g.isEditCellTextEditable = true; + // only append edit area hint if there is a null checkbox + if ($editArea.children().length > 0) { + $editArea.append('
    ' + g.cellEditHint + '
    '); + } + } + if ($editArea.children().length > 0) { + $editArea.show(); + } + } + }, + + /** + * Post the content of edited cell. + * + * @param field Optional, this object contains a boolean named move (true, if called from move* functions) + * and a to which the grid_edit should move + */ + postEditedCell: function (options) { + if (g.isSaving) { + return; + } + g.isSaving = true; + /** + * @var relation_fields Array containing the name/value pairs of relational fields + */ + var relation_fields = {}; + /** + * @var relational_display string 'K' if relational key, 'D' if relational display column + */ + var relational_display = $(g.o).find('input[name=relational_display]:checked').val(); + /** + * @var transform_fields Array containing the name/value pairs for transformed fields + */ + var transform_fields = {}; + /** + * @var transformation_fields Boolean, if there are any transformed fields in the edited cells + */ + var transformation_fields = false; + /** + * @var full_sql_query String containing the complete SQL query to update this table + */ + var full_sql_query = ''; + /** + * @var rel_fields_list String, url encoded representation of {@link relations_fields} + */ + var rel_fields_list = ''; + /** + * @var transform_fields_list String, url encoded representation of {@link transform_fields} + */ + var transform_fields_list = ''; + /** + * @var where_clause Array containing where clause for updated fields + */ + var full_where_clause = []; + /** + * @var is_unique Boolean, whether the rows in this table is unique or not + */ + var is_unique = $(g.t).find('td.edit_row_anchor').is('.nonunique') ? 0 : 1; + /** + * multi edit variables + */ + var me_fields_name = []; + var me_fields_type = []; + var me_fields = []; + var me_fields_null = []; + + // alert user if edited table is not unique + if (!is_unique) { + alert(g.alertNonUnique); + } + + // loop each edited row + $(g.t).find('td.to_be_saved').parents('tr').each(function () { + var $tr = $(this); + var where_clause = $tr.find('.where_clause').val(); + if (typeof where_clause === 'undefined') { + where_clause = ''; + } + full_where_clause.push(where_clause); + var condition_array = JSON.parse($tr.find('.condition_array').val()); + + /** + * multi edit variables, for current row + * @TODO array indices are still not correct, they should be md5 of field's name + */ + var fields_name = []; + var fields_type = []; + var fields = []; + var fields_null = []; + + // loop each edited cell in a row + $tr.find('.to_be_saved').each(function () { + /** + * @var $this_field Object referring to the td that is being edited + */ + var $this_field = $(this); + + /** + * @var field_name String containing the name of this field. + * @see getFieldName() + */ + var field_name = getFieldName($(g.t), $this_field); + + /** + * @var this_field_params Array temporary storage for the name/value of current field + */ + var this_field_params = {}; + + if ($this_field.is('.transformed')) { + transformation_fields = true; + } + this_field_params[field_name] = $this_field.data('value'); + + /** + * @var is_null String capturing whether 'checkbox_null__' is checked. + */ + var is_null = this_field_params[field_name] === null; + + fields_name.push(field_name); + + if (is_null) { + fields_null.push('on'); + fields.push(''); + } else { + if ($this_field.is('.bit')) { + fields_type.push('bit'); + } else if ($this_field.hasClass('hex')) { + fields_type.push('hex'); + } + fields_null.push(''); + // Convert \n to \r\n to be consistent with form submitted value. + // The internal browser representation has to be just \n + // while form submitted value \r\n, see specification: + // https://www.w3.org/TR/html5/forms.html#the-textarea-element + fields.push($this_field.data('value').replace(/\n/g, '\r\n')); + + var cell_index = $this_field.index('.to_be_saved'); + if ($this_field.is(':not(.relation, .enum, .set, .bit)')) { + if ($this_field.is('.transformed')) { + transform_fields[cell_index] = {}; + $.extend(transform_fields[cell_index], this_field_params); + } + } else if ($this_field.is('.relation')) { + relation_fields[cell_index] = {}; + $.extend(relation_fields[cell_index], this_field_params); + } + } + // check if edited field appears in WHERE clause + if (where_clause.indexOf(PMA_urlencode(field_name)) > -1) { + var field_str = '`' + g.table + '`.' + '`' + field_name + '`'; + for (var field in condition_array) { + if (field.indexOf(field_str) > -1) { + condition_array[field] = is_null ? 'IS NULL' : '= \'' + this_field_params[field_name].replace(/'/g, '\'\'') + '\''; + break; + } + } + } + }); // end of loop for every edited cells in a row + + // save new_clause + var new_clause = ''; + for (var field in condition_array) { + new_clause += field + ' ' + condition_array[field] + ' AND '; + } + new_clause = new_clause.substring(0, new_clause.length - 5); // remove the last AND + $tr.data('new_clause', new_clause); + // save condition_array + $tr.find('.condition_array').val(JSON.stringify(condition_array)); + + me_fields_name.push(fields_name); + me_fields_type.push(fields_type); + me_fields.push(fields); + me_fields_null.push(fields_null); + }); // end of loop for every edited rows + + rel_fields_list = $.param(relation_fields); + transform_fields_list = $.param(transform_fields); + + // Make the Ajax post after setting all parameters + /** + * @var post_params Object containing parameters for the POST request + */ + var post_params = { 'ajax_request' : true, + 'sql_query' : full_sql_query, + 'server' : g.server, + 'db' : g.db, + 'table' : g.table, + 'clause_is_unique' : is_unique, + 'where_clause' : full_where_clause, + 'fields[multi_edit]' : me_fields, + 'fields_name[multi_edit]' : me_fields_name, + 'fields_type[multi_edit]' : me_fields_type, + 'fields_null[multi_edit]' : me_fields_null, + 'rel_fields_list' : rel_fields_list, + 'do_transformations' : transformation_fields, + 'transform_fields_list' : transform_fields_list, + 'relational_display' : relational_display, + 'goto' : 'sql.php', + 'submit_type' : 'save' + }; + + if (!g.saveCellsAtOnce) { + $(g.cEdit).find('*').prop('disabled', true); + $(g.cEdit).find('.edit_box').addClass('edit_box_posting'); + } else { + $(g.o).find('div.save_edited').addClass('saving_edited_data') + .find('input').prop('disabled', true); // disable the save button + } + + $.ajax({ + type: 'POST', + url: 'tbl_replace.php', + data: post_params, + success: + function (data) { + g.isSaving = false; + if (!g.saveCellsAtOnce) { + $(g.cEdit).find('*').prop('disabled', false); + $(g.cEdit).find('.edit_box').removeClass('edit_box_posting'); + } else { + $(g.o).find('div.save_edited').removeClass('saving_edited_data') + .find('input').prop('disabled', false); // enable the save button back + } + if (typeof data !== 'undefined' && data.success === true) { + if (typeof options === 'undefined' || ! options.move) { + PMA_ajaxShowMessage(data.message); + } + + // update where_clause related data in each edited row + $(g.t).find('td.to_be_saved').parents('tr').each(function () { + var new_clause = $(this).data('new_clause'); + var $where_clause = $(this).find('.where_clause'); + var old_clause = $where_clause.val(); + var decoded_old_clause = old_clause; + var decoded_new_clause = new_clause; + + $where_clause.val(new_clause); + // update Edit, Copy, and Delete links also + $(this).find('a').each(function () { + $(this).attr('href', $(this).attr('href').replace(old_clause, new_clause)); + // update delete confirmation in Delete link + if ($(this).attr('href').indexOf('DELETE') > -1) { + $(this).removeAttr('onclick') + .off('click') + .on('click', function () { + return confirmLink(this, 'DELETE FROM `' + g.db + '`.`' + g.table + '` WHERE ' + + decoded_new_clause + (is_unique ? '' : ' LIMIT 1')); + }); + } + }); + // update the multi edit checkboxes + $(this).find('input[type=checkbox]').each(function () { + var $checkbox = $(this); + var checkbox_name = $checkbox.attr('name'); + var checkbox_value = $checkbox.val(); + + $checkbox.attr('name', checkbox_name.replace(old_clause, new_clause)); + $checkbox.val(checkbox_value.replace(decoded_old_clause, decoded_new_clause)); + }); + }); + // update the display of executed SQL query command + if (typeof data.sql_query !== 'undefined') { + // extract query box + var $result_query = $($.parseHTML(data.sql_query)); + var sqlOuter = $result_query.find('.sqlOuter').wrap('

    ').parent().html(); + var tools = $result_query.find('.tools').wrap('

    ').parent().html(); + // sqlOuter and tools will not be present if 'Show SQL queries' configuration is off + if (typeof sqlOuter !== 'undefined' && typeof tools !== 'undefined') { + $(g.o).find('.result_query:not(:last)').remove(); + var $existing_query = $(g.o).find('.result_query'); + // If two query box exists update query in second else add a second box + if ($existing_query.find('div.sqlOuter').length > 1) { + $existing_query.children(':nth-child(4)').remove(); + $existing_query.children(':nth-child(4)').remove(); + $existing_query.append(sqlOuter + tools); + } else { + $existing_query.append(sqlOuter + tools); + } + PMA_highlightSQL($existing_query); + } + } + // hide and/or update the successfully saved cells + g.hideEditCell(true, data); + + // remove the "Save edited cells" button + $(g.o).find('div.save_edited').hide(); + // update saved fields + $(g.t).find('.to_be_saved') + .removeClass('to_be_saved') + .data('value', null) + .data('original_data', null); + + g.isCellEdited = false; + } else { + PMA_ajaxShowMessage(data.error, false); + if (!g.saveCellsAtOnce) { + $(g.t).find('.to_be_saved') + .removeClass('to_be_saved'); + } + } + } + }).done(function () { + if (options !== undefined && options.move) { + g.showEditCell(options.cell); + } + }); // end $.ajax() + }, + + /** + * Save edited cell, so it can be posted later. + */ + saveEditedCell: function () { + /** + * @var $this_field Object referring to the td that is being edited + */ + var $this_field = $(g.currentEditCell); + var $test_element = ''; // to test the presence of a element + + var need_to_post = false; + + /** + * @var field_name String containing the name of this field. + * @see getFieldName() + */ + var field_name = getFieldName($(g.t), $this_field); + + /** + * @var this_field_params Array temporary storage for the name/value of current field + */ + var this_field_params = {}; + + /** + * @var is_null String capturing whether 'checkbox_null__' is checked. + */ + var is_null = $(g.cEdit).find('input:checkbox').is(':checked'); + + if ($(g.cEdit).find('.edit_area').is('.edit_area_loading')) { + // the edit area is still loading (retrieving cell data), no need to post + need_to_post = false; + } else if (is_null) { + if (!g.wasEditedCellNull) { + this_field_params[field_name] = null; + need_to_post = true; + } + } else { + if ($this_field.is('.bit')) { + this_field_params[field_name] = $(g.cEdit).find('.edit_box').val(); + } else if ($this_field.is('.set')) { + $test_element = $(g.cEdit).find('select'); + this_field_params[field_name] = $test_element.map(function () { + return $(this).val(); + }).get().join(','); + } else if ($this_field.is('.relation, .enum')) { + // for relation and enumeration, take the results from edit box value, + // because selected value from drop-down, new window or multiple + // selection list will always be updated to the edit box + this_field_params[field_name] = $(g.cEdit).find('.edit_box').val(); + } else if ($this_field.hasClass('hex')) { + if ($(g.cEdit).find('.edit_box').val().match(/^(0x)?[a-f0-9]*$/i) !== null) { + this_field_params[field_name] = $(g.cEdit).find('.edit_box').val(); + } else { + var hexError = '

    ' + PMA_messages.strEnterValidHex + '
    '; + PMA_ajaxShowMessage(hexError, false); + this_field_params[field_name] = PMA_getCellValue(g.currentEditCell); + } + } else { + this_field_params[field_name] = $(g.cEdit).find('.edit_box').val(); + } + if (g.wasEditedCellNull || this_field_params[field_name] !== PMA_getCellValue(g.currentEditCell)) { + need_to_post = true; + } + } + + if (need_to_post) { + $(g.currentEditCell).addClass('to_be_saved') + .data('value', this_field_params[field_name]); + if (g.saveCellsAtOnce) { + $(g.o).find('div.save_edited').show(); + } + g.isCellEdited = true; + } + + return need_to_post; + }, + + /** + * Save or post currently edited cell, depending on the "saveCellsAtOnce" configuration. + * + * @param field Optional, this object contains a boolean named move (true, if called from move* functions) + * and a to which the grid_edit should move + */ + saveOrPostEditedCell: function (options) { + var saved = g.saveEditedCell(); + // Check if $cfg['SaveCellsAtOnce'] is false + if (!g.saveCellsAtOnce) { + // Check if need_to_post is true + if (saved) { + // Check if this function called from 'move' functions + if (options !== undefined && options.move) { + g.postEditedCell(options); + } else { + g.postEditedCell(); + } + // need_to_post is false + } else { + // Check if this function called from 'move' functions + if (options !== undefined && options.move) { + g.hideEditCell(true); + g.showEditCell(options.cell); + // NOT called from 'move' functions + } else { + g.hideEditCell(true); + } + } + // $cfg['SaveCellsAtOnce'] is true + } else { + // If need_to_post + if (saved) { + // If this function called from 'move' functions + if (options !== undefined && options.move) { + g.hideEditCell(true, true, false, options); + g.showEditCell(options.cell); + // NOT called from 'move' functions + } else { + g.hideEditCell(true, true); + } + } else { + // If this function called from 'move' functions + if (options !== undefined && options.move) { + g.hideEditCell(true, false, false, options); + g.showEditCell(options.cell); + // NOT called from 'move' functions + } else { + g.hideEditCell(true); + } + } + } + }, + + /** + * Initialize column resize feature. + */ + initColResize: function () { + // create column resizer div + g.cRsz = document.createElement('div'); + g.cRsz.className = 'cRsz'; + + // get data columns in the first row of the table + var $firstRowCols = $(g.t).find('tr:first th.draggable'); + + // create column borders + $firstRowCols.each(function () { + var cb = document.createElement('div'); // column border + $(cb).addClass('colborder') + .mousedown(function (e) { + g.dragStartRsz(e, this); + }); + $(g.cRsz).append(cb); + }); + g.reposRsz(); + + // attach to global div + $(g.gDiv).prepend(g.cRsz); + }, + + /** + * Initialize column reordering feature. + */ + initColReorder: function () { + g.cCpy = document.createElement('div'); // column copy, to store copy of dragged column header + g.cPointer = document.createElement('div'); // column pointer, used when reordering column + + // adjust g.cCpy + g.cCpy.className = 'cCpy'; + $(g.cCpy).hide(); + + // adjust g.cPointer + g.cPointer.className = 'cPointer'; + $(g.cPointer).css('visibility', 'hidden'); // set visibility to hidden instead of calling hide() to force browsers to cache the image in cPointer class + + // assign column reordering hint + g.reorderHint = PMA_messages.strColOrderHint; + + // get data columns in the first row of the table + var $firstRowCols = $(g.t).find('tr:first th.draggable'); + + // initialize column order + $col_order = $(g.o).find('.col_order'); // check if column order is passed from PHP + if ($col_order.length > 0) { + g.colOrder = $col_order.val().split(','); + for (var i = 0; i < g.colOrder.length; i++) { + g.colOrder[i] = parseInt(g.colOrder[i], 10); + } + } else { + g.colOrder = []; + for (var i = 0; i < $firstRowCols.length; i++) { + g.colOrder.push(i); + } + } + + // register events + $(g.t).find('th.draggable') + .mousedown(function (e) { + $(g.o).addClass('turnOffSelect'); + if (g.visibleHeadersCount > 1) { + g.dragStartReorder(e, this); + } + }) + .mouseenter(function () { + if (g.visibleHeadersCount > 1) { + $(this).css('cursor', 'move'); + } else { + $(this).css('cursor', 'inherit'); + } + }) + .mouseleave(function () { + g.showReorderHint = false; + $(this).tooltip('option', { + content: g.updateHint() + }); + }) + .dblclick(function (e) { + e.preventDefault(); + $('
    ') + .prop('title', PMA_messages.strColNameCopyTitle) + .addClass('modal-copy') + .text(PMA_messages.strColNameCopyText) + .append( + $('') + .prop('readonly', true) + .val($(this).data('column')) + ) + .dialog({ + resizable: false, + modal: true + }) + .find('input').focus().select(); + }); + $(g.t).find('th.draggable a') + .dblclick(function (e) { + e.stopPropagation(); + }); + // restore column order when the restore button is clicked + $(g.o).find('div.restore_column').click(function () { + g.restoreColOrder(); + }); + + // attach to global div + $(g.gDiv).append(g.cPointer); + $(g.gDiv).append(g.cCpy); + + // prevent default "dragstart" event when dragging a link + $(g.t).find('th a').on('dragstart', function () { + return false; + }); + + // refresh the restore column button state + g.refreshRestoreButton(); + }, + + /** + * Initialize column visibility feature. + */ + initColVisib: function () { + g.cDrop = document.createElement('div'); // column drop-down arrows + g.cList = document.createElement('div'); // column visibility list + + // adjust g.cDrop + g.cDrop.className = 'cDrop'; + + // adjust g.cList + g.cList.className = 'cList'; + $(g.cList).hide(); + + // assign column visibility related hints + g.showAllColText = PMA_messages.strShowAllCol; + + // get data columns in the first row of the table + var $firstRowCols = $(g.t).find('tr:first th.draggable'); + + var i; + // initialize column visibility + var $col_visib = $(g.o).find('.col_visib'); // check if column visibility is passed from PHP + if ($col_visib.length > 0) { + g.colVisib = $col_visib.val().split(','); + for (i = 0; i < g.colVisib.length; i++) { + g.colVisib[i] = parseInt(g.colVisib[i], 10); + } + } else { + g.colVisib = []; + for (i = 0; i < $firstRowCols.length; i++) { + g.colVisib.push(1); + } + } + + // make sure we have more than one column + if ($firstRowCols.length > 1) { + var $colVisibTh = $(g.t).find('th:not(.draggable)'); + PMA_tooltip( + $colVisibTh, + 'th', + PMA_messages.strColVisibHint + ); + + // create column visibility drop-down arrow(s) + $colVisibTh.each(function () { + var $th = $(this); + var cd = document.createElement('div'); // column drop-down arrow + var pos = $th.position(); + $(cd).addClass('coldrop') + .click(function () { + if (g.cList.style.display === 'none') { + g.showColList(this); + } else { + g.hideColList(); + } + }); + $(g.cDrop).append(cd); + }); + + // add column visibility control + g.cList.innerHTML = '
    '; + var $listDiv = $(g.cList).find('div'); + + var tempClick = function () { + if (g.toggleCol($(this).index())) { + g.afterToggleCol(); + } + }; + + for (i = 0; i < $firstRowCols.length; i++) { + var currHeader = $firstRowCols[i]; + var listElmt = document.createElement('div'); + $(listElmt).text($(currHeader).text()) + .prepend(''); + $listDiv.append(listElmt); + // add event on click + $(listElmt).click(tempClick); + } + // add "show all column" button + var showAll = document.createElement('div'); + $(showAll).addClass('showAllColBtn') + .text(g.showAllColText); + $(g.cList).append(showAll); + $(showAll).click(function () { + g.showAllColumns(); + }); + // prepend "show all column" button at top if the list is too long + if ($firstRowCols.length > 10) { + var clone = showAll.cloneNode(true); + $(g.cList).prepend(clone); + $(clone).click(function () { + g.showAllColumns(); + }); + } + } + + // hide column visibility list if we move outside the list + $(g.t).find('td, th.draggable').mouseenter(function () { + g.hideColList(); + }); + + // attach to global div + $(g.gDiv).append(g.cDrop); + $(g.gDiv).append(g.cList); + + // some adjustment + g.reposDrop(); + }, + + /** + * Move currently Editing Cell to Up + */ + moveUp: function (e) { + e.preventDefault(); + var $this_field = $(g.currentEditCell); + var field_name = getFieldName($(g.t), $this_field); + + var where_clause = $this_field.parents('tr').first().find('.where_clause').val(); + if (typeof where_clause === 'undefined') { + where_clause = ''; + } + var found = false; + var $found_row; + var $prev_row; + var j = 0; + + $this_field.parents('tr').first().parents('tbody').children().each(function () { + if ($(this).find('.where_clause').val() === where_clause) { + found = true; + $found_row = $(this); + } + if (!found) { + $prev_row = $(this); + } + }); + + var new_cell; + + if (found && $prev_row) { + $prev_row.children('td').each(function () { + if (getFieldName($(g.t), $(this)) === field_name) { + new_cell = this; + } + }); + } + + if (new_cell) { + g.hideEditCell(false, false, false, { move : true, cell : new_cell }); + } + }, + + /** + * Move currently Editing Cell to Down + */ + moveDown: function (e) { + e.preventDefault(); + + var $this_field = $(g.currentEditCell); + var field_name = getFieldName($(g.t), $this_field); + + var where_clause = $this_field.parents('tr').first().find('.where_clause').val(); + if (typeof where_clause === 'undefined') { + where_clause = ''; + } + var found = false; + var $found_row; + var $next_row; + var j = 0; + var next_row_found = false; + $this_field.parents('tr').first().parents('tbody').children().each(function () { + if ($(this).find('.where_clause').val() === where_clause) { + found = true; + $found_row = $(this); + } + if (found) { + if (j >= 1 && ! next_row_found) { + $next_row = $(this); + next_row_found = true; + } else { + j++; + } + } + }); + + var new_cell; + if (found && $next_row) { + $next_row.children('td').each(function () { + if (getFieldName($(g.t), $(this)) === field_name) { + new_cell = this; + } + }); + } + + if (new_cell) { + g.hideEditCell(false, false, false, { move : true, cell : new_cell }); + } + }, + + /** + * Move currently Editing Cell to Left + */ + moveLeft: function (e) { + e.preventDefault(); + + var $this_field = $(g.currentEditCell); + var field_name = getFieldName($(g.t), $this_field); + + var where_clause = $this_field.parents('tr').first().find('.where_clause').val(); + if (typeof where_clause === 'undefined') { + where_clause = ''; + } + var found = false; + var $found_row; + var j = 0; + $this_field.parents('tr').first().parents('tbody').children().each(function () { + if ($(this).find('.where_clause').val() === where_clause) { + found = true; + $found_row = $(this); + } + }); + + var left_cell; + var cell_found = false; + if (found) { + $found_row.children('td.grid_edit').each(function () { + if (getFieldName($(g.t), $(this)) === field_name) { + cell_found = true; + } + if (!cell_found) { + left_cell = this; + } + }); + } + + if (left_cell) { + g.hideEditCell(false, false, false, { move : true, cell : left_cell }); + } + }, + + /** + * Move currently Editing Cell to Right + */ + moveRight: function (e) { + e.preventDefault(); + + var $this_field = $(g.currentEditCell); + var field_name = getFieldName($(g.t), $this_field); + + var where_clause = $this_field.parents('tr').first().find('.where_clause').val(); + if (typeof where_clause === 'undefined') { + where_clause = ''; + } + var found = false; + var $found_row; + var j = 0; + $this_field.parents('tr').first().parents('tbody').children().each(function () { + if ($(this).find('.where_clause').val() === where_clause) { + found = true; + $found_row = $(this); + } + }); + + var right_cell; + var cell_found = false; + var next_cell_found = false; + if (found) { + $found_row.children('td.grid_edit').each(function () { + if (getFieldName($(g.t), $(this)) === field_name) { + cell_found = true; + } + if (cell_found) { + if (j >= 1 && ! next_cell_found) { + right_cell = this; + next_cell_found = true; + } else { + j++; + } + } + }); + } + + if (right_cell) { + g.hideEditCell(false, false, false, { move : true, cell : right_cell }); + } + }, + + /** + * Initialize grid editing feature. + */ + initGridEdit: function () { + function startGridEditing (e, cell) { + if (g.isCellEditActive) { + g.saveOrPostEditedCell(); + } else { + g.showEditCell(cell); + } + e.stopPropagation(); + } + + function handleCtrlNavigation (e) { + if ((e.ctrlKey && e.which === 38) || (e.altKey && e.which === 38)) { + g.moveUp(e); + } else if ((e.ctrlKey && e.which === 40) || (e.altKey && e.which === 40)) { + g.moveDown(e); + } else if ((e.ctrlKey && e.which === 37) || (e.altKey && e.which === 37)) { + g.moveLeft(e); + } else if ((e.ctrlKey && e.which === 39) || (e.altKey && e.which === 39)) { + g.moveRight(e); + } + } + + // create cell edit wrapper element + g.cEditStd = document.createElement('div'); + g.cEdit = g.cEditStd; + g.cEditTextarea = document.createElement('div'); + + // adjust g.cEditStd + g.cEditStd.className = 'cEdit'; + $(g.cEditStd).html('
    '); + $(g.cEditStd).hide(); + + // adjust g.cEdit + g.cEditTextarea.className = 'cEdit'; + $(g.cEditTextarea).html('
    '); + $(g.cEditTextarea).hide(); + + // assign cell editing hint + g.cellEditHint = PMA_messages.strCellEditHint; + g.saveCellWarning = PMA_messages.strSaveCellWarning; + g.alertNonUnique = PMA_messages.strAlertNonUnique; + g.gotoLinkText = PMA_messages.strGoToLink; + + // initialize cell editing configuration + g.saveCellsAtOnce = $(g.o).find('.save_cells_at_once').val(); + g.maxTruncatedLen = PMA_commonParams.get('LimitChars'); + + // register events + $(g.t).find('td.data.click1') + .click(function (e) { + startGridEditing(e, this); + // prevent default action when clicking on "link" in a table + if ($(e.target).is('.grid_edit a')) { + e.preventDefault(); + } + }); + + $(g.t).find('td.data.click2') + .click(function (e) { + var $cell = $(this); + // In the case of relational link, We want single click on the link + // to goto the link and double click to start grid-editing. + var $link = $(e.target); + if ($link.is('.grid_edit.relation a')) { + e.preventDefault(); + // get the click count and increase + var clicks = $cell.data('clicks'); + clicks = (typeof clicks === 'undefined') ? 1 : clicks + 1; + + if (clicks === 1) { + // if there are no previous clicks, + // start the single click timer + var timer = setTimeout(function () { + // temporarily remove ajax class so the page loader will not handle it, + // submit and then add it back + $link.removeClass('ajax'); + AJAX.requestHandler.call($link[0]); + $link.addClass('ajax'); + $cell.data('clicks', 0); + }, 700); + $cell.data('clicks', clicks); + $cell.data('timer', timer); + } else { + // this is a double click, cancel the single click timer + // and make the click count 0 + clearTimeout($cell.data('timer')); + $cell.data('clicks', 0); + // start grid-editing + startGridEditing(e, this); + } + } + }) + .dblclick(function (e) { + if ($(e.target).is('.grid_edit a')) { + e.preventDefault(); + } else { + startGridEditing(e, this); + } + }); + + $(g.cEditStd).on('keydown', 'input.edit_box, select', handleCtrlNavigation); + + $(g.cEditStd).find('.edit_box').focus(function () { + g.showEditArea(); + }); + $(g.cEditStd).on('keydown', '.edit_box, select', function (e) { + if (e.which === 13) { + // post on pressing "Enter" + e.preventDefault(); + g.saveOrPostEditedCell(); + } + }); + $(g.cEditStd).keydown(function (e) { + if (!g.isEditCellTextEditable) { + // prevent text editing + e.preventDefault(); + } + }); + + $(g.cEditTextarea).on('keydown', 'textarea.edit_box, select', handleCtrlNavigation); + + $(g.cEditTextarea).find('.edit_box').focus(function () { + g.showEditArea(); + }); + $(g.cEditTextarea).on('keydown', '.edit_box, select', function (e) { + if (e.which === 13 && !e.shiftKey) { + // post on pressing "Enter" + e.preventDefault(); + g.saveOrPostEditedCell(); + } + }); + $(g.cEditTextarea).keydown(function (e) { + if (!g.isEditCellTextEditable) { + // prevent text editing + e.preventDefault(); + } + }); + $('html').click(function (e) { + // hide edit cell if the click is not fromDat edit area + if ($(e.target).parents().index($(g.cEdit)) === -1 && + !$(e.target).parents('.ui-datepicker-header').length && + !$('.browse_foreign_modal.ui-dialog:visible').length && + !$(e.target).closest('.dismissable').length + ) { + g.hideEditCell(); + } + }).keydown(function (e) { + if (e.which === 27 && g.isCellEditActive) { + // cancel on pressing "Esc" + g.hideEditCell(true); + } + }); + $(g.o).find('div.save_edited').click(function () { + g.hideEditCell(); + g.postEditedCell(); + }); + $(window).on('beforeunload', function () { + if (g.isCellEdited) { + return g.saveCellWarning; + } + }); + + // attach to global div + $(g.gDiv).append(g.cEditStd); + $(g.gDiv).append(g.cEditTextarea); + + // add hint for grid editing feature when hovering "Edit" link in each table row + if (PMA_messages.strGridEditFeatureHint !== undefined) { + PMA_tooltip( + $(g.t).find('.edit_row_anchor a'), + 'a', + PMA_messages.strGridEditFeatureHint + ); + } + } + }; + + /** **************** + * Initialize grid + ******************/ + + // wrap all truncated data cells with span indicating the original length + // todo update the original length after a grid edit + $(t).find('td.data.truncated:not(:has(span))') + .wrapInner(function () { + return ''; + }); + + // wrap remaining cells, except actions cell, with span + $(t).find('th, td:not(:has(span))') + .wrapInner(''); + + // create grid elements + g.gDiv = document.createElement('div'); // create global div + + // initialize the table variable + g.t = t; + + // enclosing .sqlqueryresults div + g.o = $(t).parents('.sqlqueryresults'); + + // get data columns in the first row of the table + var $firstRowCols = $(t).find('tr:first th.draggable'); + + // initialize visible headers count + g.visibleHeadersCount = $firstRowCols.filter(':visible').length; + + // assign first column (actions) span + if (! $(t).find('tr:first th:first').hasClass('draggable')) { // action header exist + g.actionSpan = $(t).find('tr:first th:first').prop('colspan'); + } else { + g.actionSpan = 0; + } + + // assign table create time + // table_create_time will only available if we are in "Browse" tab + g.tableCreateTime = $(g.o).find('.table_create_time').val(); + + // assign the hints + g.sortHint = PMA_messages.strSortHint; + g.strMultiSortHint = PMA_messages.strMultiSortHint; + g.markHint = PMA_messages.strColMarkHint; + g.copyHint = PMA_messages.strColNameCopyHint; + + // assign common hidden inputs + var $common_hidden_inputs = $(g.o).find('div.common_hidden_inputs'); + g.server = $common_hidden_inputs.find('input[name=server]').val(); + g.db = $common_hidden_inputs.find('input[name=db]').val(); + g.table = $common_hidden_inputs.find('input[name=table]').val(); + + // add table class + $(t).addClass('pma_table'); + + // add relative position to global div so that resize handlers are correctly positioned + $(g.gDiv).css('position', 'relative'); + + // link the global div + $(t).before(g.gDiv); + $(g.gDiv).append(t); + + // FEATURES + enableResize = enableResize === undefined ? true : enableResize; + enableReorder = enableReorder === undefined ? true : enableReorder; + enableVisib = enableVisib === undefined ? true : enableVisib; + enableGridEdit = enableGridEdit === undefined ? true : enableGridEdit; + if (enableResize) { + g.initColResize(); + } + // disable reordering for result from EXPLAIN or SHOW syntax, which do not have a table navigation panel + if (enableReorder && + $(g.o).find('table.navigation').length > 0) { + g.initColReorder(); + } + if (enableVisib) { + g.initColVisib(); + } + // make sure we have the ajax class + if (enableGridEdit && + $(t).is('.ajax')) { + g.initGridEdit(); + } + + // create tooltip for each with draggable class + PMA_tooltip( + $(t).find('th.draggable'), + 'th', + g.updateHint() + ); + + // register events for hint tooltip (anchors inside draggable th) + $(t).find('th.draggable a') + .mouseenter(function () { + g.showSortHint = true; + g.showMultiSortHint = true; + $(t).find('th.draggable').tooltip('option', { + content: g.updateHint() + }); + }) + .mouseleave(function () { + g.showSortHint = false; + g.showMultiSortHint = false; + $(t).find('th.draggable').tooltip('option', { + content: g.updateHint() + }); + }); + + // register events for dragging-related feature + if (enableResize || enableReorder) { + $(document).mousemove(function (e) { + g.dragMove(e); + }); + $(document).mouseup(function (e) { + $(g.o).removeClass('turnOffSelect'); + g.dragEnd(e); + }); + } + + // some adjustment + $(t).removeClass('data'); + $(g.gDiv).addClass('data'); +} + +/** + * jQuery plugin to cancel selection in HTML code. + */ +(function ($) { + $.fn.noSelect = function (p) { // no select plugin by Paulo P.Marinas + var prevent = (p === null) ? true : p; + var is_msie = navigator.userAgent.indexOf('MSIE') > -1 || !!window.navigator.userAgent.match(/Trident.*rv\:11\./); + var is_firefox = navigator.userAgent.indexOf('Firefox') > -1; + var is_safari = navigator.userAgent.indexOf('Safari') > -1; + var is_opera = navigator.userAgent.indexOf('Presto') > -1; + if (prevent) { + return this.each(function () { + if (is_msie || is_safari) { + $(this).on('selectstart', false); + } else if (is_firefox) { + $(this).css('MozUserSelect', 'none'); + $('body').trigger('focus'); + } else if (is_opera) { + $(this).on('mousedown', false); + } else { + $(this).attr('unselectable', 'on'); + } + }); + } else { + return this.each(function () { + if (is_msie || is_safari) { + $(this).off('selectstart'); + } else if (is_firefox) { + $(this).css('MozUserSelect', 'inherit'); + } else if (is_opera) { + $(this).off('mousedown'); + } else { + $(this).removeAttr('unselectable'); + } + }); + } + }; // end noSelect +}(jQuery)); diff --git a/phpMyAdmin/js/menu-resizer.js b/phpMyAdmin/js/menu-resizer.js new file mode 100755 index 0000000..d5462fe --- /dev/null +++ b/phpMyAdmin/js/menu-resizer.js @@ -0,0 +1,222 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Handles the resizing of a menu according to the available screen width + * + * Uses themes/original/css/resizable-menu.css.php + * + * To initialise: + * $('#myMenu').menuResizer(function () { + * // This function will be called to find out how much + * // available horizontal space there is for the menu + * return $('body').width() - 5; // Some extra margin for good measure + * }); + * + * To trigger a resize operation: + * $('#myMenu').menuResizer('resize'); // Bind this to $(window).resize() + * + * To restore the menu to a state like before it was initialized: + * $('#myMenu').menuResizer('destroy'); + * + * @package PhpMyAdmin + */ +(function ($) { + function MenuResizer ($container, widthCalculator) { + var self = this; + self.$container = $container; + self.widthCalculator = widthCalculator; + var windowWidth = $(window).width(); + + if (windowWidth < 768) { + $('#pma_navigation_resizer').css({ 'width': '0px' }); + } + // Sets the image for the left and right scroll indicator + $('.scrollindicator--left').html($(PMA_getImage('b_left').toString())); + $('.scrollindicator--right').html($(PMA_getImage('b_right').toString())); + + // Set the width of the navigation bar without scroll indicator + $('.navigationbar').css({ 'width': widthCalculator.call($container) - 60 }); + + // Scroll the navigation bar on click + $('.scrollindicator--right').on('click', function () { + $('.navigationbar').scrollLeft($('.navigationbar').scrollLeft() + 70); + }); + $('.scrollindicator--left').on('click', function () { + $('.navigationbar').scrollLeft($('.navigationbar').scrollLeft() - 70); + }); + + // create submenu container + var link = $('', { href: '#', 'class': 'tab nowrap' }) + .text(PMA_messages.strMore) + .on('click', false); // same as event.preventDefault() + var img = $container.find('li img'); + if (img.length) { + $(PMA_getImage('b_more').toString()).prependTo(link); + } + var $submenu = $('
  • ', { 'class': 'submenu' }) + .append(link) + .append($('
      ')) + .on('mouseenter', function () { + if ($(this).find('ul .tabactive').length === 0) { + $(this) + .addClass('submenuhover') + .find('> a') + .addClass('tabactive'); + } + }) + .on('mouseleave', function () { + if ($(this).find('ul .tabactive').length === 0) { + $(this) + .removeClass('submenuhover') + .find('> a') + .removeClass('tabactive'); + } + }); + $container.children('.clearfloat').remove(); + $container.append($submenu).append('
      '); + setTimeout(function () { + self.resize(); + }, 4); + } + MenuResizer.prototype.resize = function () { + var wmax = this.widthCalculator.call(this.$container); + var windowWidth = $(window).width(); + var $submenu = this.$container.find('.submenu:last'); + var submenu_w = $submenu.outerWidth(true); + var $submenu_ul = $submenu.find('ul'); + var $li = this.$container.find('> li'); + var $li2 = $submenu_ul.find('li'); + var more_shown = $li2.length > 0; + // Calculate the total width used by all the shown tabs + var total_len = more_shown ? submenu_w : 0; + var l = $li.length - 1; + var i; + for (i = 0; i < l; i++) { + total_len += $($li[i]).outerWidth(true); + } + + var hasVScroll = document.body.scrollHeight > document.body.clientHeight; + if (hasVScroll) { + windowWidth += 15; + } + var navigationwidth = wmax; + if (windowWidth < 768) { + wmax = 2000; + } + + // Now hide menu elements that don't fit into the menubar + var hidden = false; // Whether we have hidden any tabs + while (total_len >= wmax && --l >= 0) { // Process the tabs backwards + hidden = true; + var el = $($li[l]); + var el_width = el.outerWidth(true); + el.data('width', el_width); + if (! more_shown) { + total_len -= el_width; + el.prependTo($submenu_ul); + total_len += submenu_w; + more_shown = true; + } else { + total_len -= el_width; + el.prependTo($submenu_ul); + } + } + // If we didn't hide any tabs, then there might be some space to show some + if (! hidden) { + // Show menu elements that do fit into the menubar + for (i = 0, l = $li2.length; i < l; i++) { + total_len += $($li2[i]).data('width'); + // item fits or (it is the last item + // and it would fit if More got removed) + if (total_len < wmax || + (i === $li2.length - 1 && total_len - submenu_w < wmax) + ) { + $($li2[i]).insertBefore($submenu); + } else { + break; + } + } + } + // Show/hide the "More" tab as needed + if (windowWidth < 768) { + $('.navigationbar').css({ 'width': windowWidth - 80 - $('#pma_navigation').width() }); + $submenu.removeClass('shown'); + $('.navigationbar').css({ 'overflow': 'hidden' }); + } else { + $('.navigationbar').css({ 'width': 'auto' }); + $('.navigationbar').css({ 'overflow': 'visible' }); + if ($submenu_ul.find('li').length > 0) { + $submenu.addClass('shown'); + } else { + $submenu.removeClass('shown'); + } + } + if (this.$container.find('> li').length === 1) { + // If there is only the "More" tab left, then we need + // to align the submenu to the left edge of the tab + $submenu_ul.removeClass().addClass('only'); + } else { + // Otherwise we align the submenu to the right edge of the tab + $submenu_ul.removeClass().addClass('notonly'); + } + if ($submenu.find('.tabactive').length) { + $submenu + .addClass('active') + .find('> a') + .removeClass('tab') + .addClass('tabactive'); + } else { + $submenu + .removeClass('active') + .find('> a') + .addClass('tab') + .removeClass('tabactive'); + } + }; + MenuResizer.prototype.destroy = function () { + var $submenu = this.$container.find('li.submenu').removeData(); + $submenu.find('li').appendTo(this.$container); + $submenu.remove(); + }; + + /** Public API */ + var methods = { + init: function (widthCalculator) { + return this.each(function () { + var $this = $(this); + if (! $this.data('menuResizer')) { + $this.data( + 'menuResizer', + new MenuResizer($this, widthCalculator) + ); + } + }); + }, + resize: function () { + return this.each(function () { + var self = $(this).data('menuResizer'); + if (self) { + self.resize(); + } + }); + }, + destroy: function () { + return this.each(function () { + var self = $(this).data('menuResizer'); + if (self) { + self.destroy(); + } + }); + } + }; + + /** Extend jQuery */ + $.fn.menuResizer = function (method) { + if (methods[method]) { + return methods[method].call(this); + } else if (typeof method === 'function') { + return methods.init.apply(this, [method]); + } else { + $.error('Method ' + method + ' does not exist on jQuery.menuResizer'); + } + }; +}(jQuery)); diff --git a/phpMyAdmin/js/messages.php b/phpMyAdmin/js/messages.php new file mode 100755 index 0000000..ba1d6ad --- /dev/null +++ b/phpMyAdmin/js/messages.php @@ -0,0 +1,995 @@ +start(); +if (!defined('TESTSUITE')) { + register_shutdown_function( + function () { + echo PhpMyAdmin\OutputBuffering::getInstance()->getContents(); + } + ); +} + +/* For confirmations */ +$js_messages['strConfirm'] = __('Confirm'); +$js_messages['strDoYouReally'] = __('Do you really want to execute "%s"?'); +$js_messages['strDropDatabaseStrongWarning'] + = __('You are about to DESTROY a complete database!'); +$js_messages['strDatabaseRenameToSameName'] + = __('Cannot rename database to the same name. Change the name and try again'); +$js_messages['strDropTableStrongWarning'] + = __('You are about to DESTROY a complete table!'); +$js_messages['strTruncateTableStrongWarning'] + = __('You are about to TRUNCATE a complete table!'); +$js_messages['strDeleteTrackingData'] = __('Delete tracking data for this table?'); +$js_messages['strDeleteTrackingDataMultiple'] + = __('Delete tracking data for these tables?'); +$js_messages['strDeleteTrackingVersion'] + = __('Delete tracking data for this version?'); +$js_messages['strDeleteTrackingVersionMultiple'] + = __('Delete tracking data for these versions?'); +$js_messages['strDeletingTrackingEntry'] = __('Delete entry from tracking report?'); +$js_messages['strDeletingTrackingData'] = __('Deleting tracking data'); +$js_messages['strDroppingPrimaryKeyIndex'] = __('Dropping Primary Key/Index'); +$js_messages['strDroppingForeignKey'] = __('Dropping Foreign key.'); +$js_messages['strOperationTakesLongTime'] + = __('This operation could take a long time. Proceed anyway?'); +$js_messages['strDropUserGroupWarning'] + = __('Do you really want to delete user group "%s"?'); +$js_messages['strConfirmDeleteQBESearch'] + = __('Do you really want to delete the search "%s"?'); +$js_messages['strConfirmNavigation'] + = __('You have unsaved changes; are you sure you want to leave this page?'); +$js_messages['strConfirmRowChange'] + = __('You are trying to reduce the number of rows, but have already entered data in those rows which will be lost. Do you wish to continue?'); +$js_messages['strDropUserWarning'] + = __('Do you really want to revoke the selected user(s) ?'); +$js_messages['strDeleteCentralColumnWarning'] + = __('Do you really want to delete this central column?'); +$js_messages['strDropRTEitems'] + = __('Do you really want to delete the selected items?'); +$js_messages['strDropPartitionWarning'] = __( + 'Do you really want to DROP the selected partition(s)? This will also DELETE ' . + 'the data related to the selected partition(s)!' +); +$js_messages['strTruncatePartitionWarning'] + = __('Do you really want to TRUNCATE the selected partition(s)?'); +$js_messages['strRemovePartitioningWarning'] + = __('Do you really want to remove partitioning?'); +$js_messages['strResetSlaveWarning'] = __('Do you really want to RESET SLAVE?'); +$js_messages['strChangeColumnCollation'] = __( + 'This operation will attempt to convert your data to the new collation. In ' + . 'rare cases, especially where a character doesn\'t exist in the new ' + . 'collation, this process could cause the data to appear incorrectly under ' + . 'the new collation; in this case we suggest you revert to the original ' + . 'collation and refer to the tips at ' +) + . '
      ' . __('Garbled Data') . '.' + . '

      ' + . __('Are you sure you wish to change the collation and convert the data?'); +$js_messages['strChangeAllColumnCollationsWarning'] = __( + 'Through this operation, MySQL attempts to map the data values between ' + . 'collations. If the character sets are incompatible, there may be data loss ' + . 'and this lost data may NOT be recoverable simply by changing back the ' + . 'column collation(s). To convert existing data, it is suggested to use the ' + . 'column(s) editing feature (the "Change" Link) on the table structure page. ' + . '' +) +. '

      ' +. __( + 'Are you sure you wish to change all the column collations and convert the data?' +); + +/* For modal dialog buttons */ +$js_messages['strSaveAndClose'] = __('Save & close'); +$js_messages['strReset'] = __('Reset'); +$js_messages['strResetAll'] = __('Reset all'); + +/* For indexes */ +$js_messages['strFormEmpty'] = __('Missing value in the form!'); +$js_messages['strRadioUnchecked'] = __('Select at least one of the options!'); +$js_messages['strEnterValidNumber'] = __('Please enter a valid number!'); +$js_messages['strEnterValidLength'] = __('Please enter a valid length!'); +$js_messages['strAddIndex'] = __('Add index'); +$js_messages['strEditIndex'] = __('Edit index'); +$js_messages['strAddToIndex'] = __('Add %s column(s) to index'); +$js_messages['strCreateSingleColumnIndex'] = __('Create single-column index'); +$js_messages['strCreateCompositeIndex'] = __('Create composite index'); +$js_messages['strCompositeWith'] = __('Composite with:'); +$js_messages['strMissingColumn'] = __('Please select column(s) for the index.'); + +/* For Preview SQL*/ +$js_messages['strPreviewSQL'] = __('Preview SQL'); + +/* For Simulate DML*/ +$js_messages['strSimulateDML'] = __('Simulate query'); +$js_messages['strMatchedRows'] = __('Matched rows:'); +$js_messages['strSQLQuery'] = __('SQL query:'); + +/* Charts */ +/* l10n: Default label for the y-Axis of Charts */ +$js_messages['strYValues'] = __('Y values'); + +/* Database multi-table query */ +$js_messages['strEmptyQuery'] = __('Please enter the SQL query first.'); + +/* For server_privileges.js */ +$js_messages['strHostEmpty'] = __('The host name is empty!'); +$js_messages['strUserEmpty'] = __('The user name is empty!'); +$js_messages['strPasswordEmpty'] = __('The password is empty!'); +$js_messages['strPasswordNotSame'] = __('The passwords aren\'t the same!'); +$js_messages['strRemovingSelectedUsers'] = __('Removing Selected Users'); +$js_messages['strClose'] = __('Close'); + +/* For export.js */ +$js_messages['strTemplateCreated'] = __('Template was created.'); +$js_messages['strTemplateLoaded'] = __('Template was loaded.'); +$js_messages['strTemplateUpdated'] = __('Template was updated.'); +$js_messages['strTemplateDeleted'] = __('Template was deleted.'); + +/* l10n: Other, small valued, queries */ +$js_messages['strOther'] = __('Other'); +/* l10n: Thousands separator */ +$js_messages['strThousandsSeparator'] = __(','); +/* l10n: Decimal separator */ +$js_messages['strDecimalSeparator'] = __('.'); + +$js_messages['strChartConnectionsTitle'] = __('Connections / Processes'); + +/* server status monitor */ +$js_messages['strIncompatibleMonitorConfig'] + = __('Local monitor configuration incompatible!'); +$js_messages['strIncompatibleMonitorConfigDescription'] = __( + 'The chart arrangement configuration in your browsers local storage is not ' + . 'compatible anymore to the newer version of the monitor dialog. It is very ' + . 'likely that your current configuration will not work anymore. Please reset ' + . 'your configuration to default in the Settings menu.' +); + +$js_messages['strQueryCacheEfficiency'] = __('Query cache efficiency'); +$js_messages['strQueryCacheUsage'] = __('Query cache usage'); +$js_messages['strQueryCacheUsed'] = __('Query cache used'); + +$js_messages['strSystemCPUUsage'] = __('System CPU usage'); +$js_messages['strSystemMemory'] = __('System memory'); +$js_messages['strSystemSwap'] = __('System swap'); + +$js_messages['strAverageLoad'] = __('Average load'); +$js_messages['strTotalMemory'] = __('Total memory'); +$js_messages['strCachedMemory'] = __('Cached memory'); +$js_messages['strBufferedMemory'] = __('Buffered memory'); +$js_messages['strFreeMemory'] = __('Free memory'); +$js_messages['strUsedMemory'] = __('Used memory'); + +$js_messages['strTotalSwap'] = __('Total swap'); +$js_messages['strCachedSwap'] = __('Cached swap'); +$js_messages['strUsedSwap'] = __('Used swap'); +$js_messages['strFreeSwap'] = __('Free swap'); + +$js_messages['strBytesSent'] = __('Bytes sent'); +$js_messages['strBytesReceived'] = __('Bytes received'); +$js_messages['strConnections'] = __('Connections'); +$js_messages['strProcesses'] = __('Processes'); + +/* summary row */ +$js_messages['strB'] = __('B'); +$js_messages['strKiB'] = __('KiB'); +$js_messages['strMiB'] = __('MiB'); +$js_messages['strGiB'] = __('GiB'); +$js_messages['strTiB'] = __('TiB'); +$js_messages['strPiB'] = __('PiB'); +$js_messages['strEiB'] = __('EiB'); +$js_messages['strNTables'] = __('%d table(s)'); + +/* l10n: Questions is the name of a MySQL Status variable */ +$js_messages['strQuestions'] = __('Questions'); +$js_messages['strTraffic'] = __('Traffic'); +$js_messages['strSettings'] = __('Settings'); +$js_messages['strAddChart'] = __('Add chart to grid'); +$js_messages['strClose'] = __('Close'); +$js_messages['strAddOneSeriesWarning'] + = __('Please add at least one variable to the series!'); +$js_messages['strNone'] = __('None'); +$js_messages['strResumeMonitor'] = __('Resume monitor'); +$js_messages['strPauseMonitor'] = __('Pause monitor'); +$js_messages['strStartRefresh'] = __('Start auto refresh'); +$js_messages['strStopRefresh'] = __('Stop auto refresh'); +/* Monitor: Instructions Dialog */ +$js_messages['strBothLogOn'] = __('general_log and slow_query_log are enabled.'); +$js_messages['strGenLogOn'] = __('general_log is enabled.'); +$js_messages['strSlowLogOn'] = __('slow_query_log is enabled.'); +$js_messages['strBothLogOff'] = __('slow_query_log and general_log are disabled.'); +$js_messages['strLogOutNotTable'] = __('log_output is not set to TABLE.'); +$js_messages['strLogOutIsTable'] = __('log_output is set to TABLE.'); +$js_messages['strSmallerLongQueryTimeAdvice'] = __( + 'slow_query_log is enabled, but the server logs only queries that take longer ' + . 'than %d seconds. It is advisable to set this long_query_time 0-2 seconds, ' + . 'depending on your system.' +); +$js_messages['strLongQueryTimeSet'] = __('long_query_time is set to %d second(s).'); +$js_messages['strSettingsAppliedGlobal'] = __( + 'Following settings will be applied globally and reset to default on server ' + . 'restart:' +); +/* l10n: %s is FILE or TABLE */ +$js_messages['strSetLogOutput'] = __('Set log_output to %s'); +/* l10n: Enable in this context means setting a status variable to ON */ +$js_messages['strEnableVar'] = __('Enable %s'); +/* l10n: Disable in this context means setting a status variable to OFF */ +$js_messages['strDisableVar'] = __('Disable %s'); +/* l10n: %d seconds */ +$js_messages['setSetLongQueryTime'] = __('Set long_query_time to %d seconds.'); +$js_messages['strNoSuperUser'] = __( + 'You can\'t change these variables. Please log in as root or contact' + . ' your database administrator.' +); +$js_messages['strChangeSettings'] = __('Change settings'); +$js_messages['strCurrentSettings'] = __('Current settings'); + +$js_messages['strChartTitle'] = __('Chart title'); +/* l10n: As in differential values */ +$js_messages['strDifferential'] = __('Differential'); +$js_messages['strDividedBy'] = __('Divided by %s'); +$js_messages['strUnit'] = __('Unit'); + +$js_messages['strFromSlowLog'] = __('From slow log'); +$js_messages['strFromGeneralLog'] = __('From general log'); +$js_messages['strServerLogError'] = __( + 'The database name is not known for this query in the server\'s logs.' +); +$js_messages['strAnalysingLogsTitle'] = __('Analysing logs'); +$js_messages['strAnalysingLogs'] + = __('Analysing & loading logs. This may take a while.'); +$js_messages['strCancelRequest'] = __('Cancel request'); +$js_messages['strCountColumnExplanation'] = __( + 'This column shows the amount of identical queries that are grouped together. ' + . 'However only the SQL query itself has been used as a grouping criteria, so ' + . 'the other attributes of queries, such as start time, may differ.' +); +$js_messages['strMoreCountColumnExplanation'] = __( + 'Since grouping of INSERTs queries has been selected, INSERT queries into the ' + . 'same table are also being grouped together, disregarding of the inserted ' + . 'data.' +); +$js_messages['strLogDataLoaded'] + = __('Log data loaded. Queries executed in this time span:'); + +$js_messages['strJumpToTable'] = __('Jump to Log table'); +$js_messages['strNoDataFoundTitle'] = __('No data found'); +$js_messages['strNoDataFound'] + = __('Log analysed, but no data found in this time span.'); + +$js_messages['strAnalyzing'] = __('Analyzing鈥�'); +$js_messages['strExplainOutput'] = __('Explain output'); +$js_messages['strStatus'] = __('Status'); +$js_messages['strTime'] = __('Time'); +$js_messages['strTotalTime'] = __('Total time:'); +$js_messages['strProfilingResults'] = __('Profiling results'); +$js_messages['strTable'] = _pgettext('Display format', 'Table'); +$js_messages['strChart'] = __('Chart'); + +$js_messages['strAliasDatabase'] = _pgettext('Alias', 'Database'); +$js_messages['strAliasTable'] = _pgettext('Alias', 'Table'); +$js_messages['strAliasColumn'] = _pgettext('Alias', 'Column'); + +/* l10n: A collection of available filters */ +$js_messages['strFiltersForLogTable'] = __('Log table filter options'); +/* l10n: Filter as in "Start Filtering" */ +$js_messages['strFilter'] = __('Filter'); +$js_messages['strFilterByWordRegexp'] = __('Filter queries by word/regexp:'); +$js_messages['strIgnoreWhereAndGroup'] + = __('Group queries, ignoring variable data in WHERE clauses'); +$js_messages['strSumRows'] = __('Sum of grouped rows:'); +$js_messages['strTotal'] = __('Total:'); + +$js_messages['strLoadingLogs'] = __('Loading logs'); +$js_messages['strRefreshFailed'] = __('Monitor refresh failed'); +$js_messages['strInvalidResponseExplanation'] = __( + 'While requesting new chart data the server returned an invalid response. This ' + . 'is most likely because your session expired. Reloading the page and ' + . 'reentering your credentials should help.' +); +$js_messages['strReloadPage'] = __('Reload page'); + +$js_messages['strAffectedRows'] = __('Affected rows:'); + +$js_messages['strFailedParsingConfig'] = __( + 'Failed parsing config file. It doesn\'t seem to be valid JSON code.' +); +$js_messages['strFailedBuildingGrid'] = __( + 'Failed building chart grid with imported config. Resetting to default config鈥�' +); +$js_messages['strImport'] = __('Import'); +$js_messages['strImportDialogTitle'] = __('Import monitor configuration'); +$js_messages['strImportDialogMessage'] + = __('Please select the file you want to import.'); +$js_messages['strNoImportFile'] = __('No files available on server for import!'); + +$js_messages['strAnalyzeQuery'] = __('Analyse query'); + +/* Server status advisor */ + +$js_messages['strAdvisorSystem'] = __('Advisor system'); +$js_messages['strPerformanceIssues'] = __('Possible performance issues'); +$js_messages['strIssuse'] = __('Issue'); +$js_messages['strRecommendation'] = __('Recommendation'); +$js_messages['strRuleDetails'] = __('Rule details'); +$js_messages['strJustification'] = __('Justification'); +$js_messages['strFormula'] = __('Used variable / formula'); +$js_messages['strTest'] = __('Test'); + +/* For query editor */ +$js_messages['strFormatting'] = __('Formatting SQL鈥�'); +$js_messages['strNoParam'] = __('No parameters found!'); + +/* For inline query editing */ +$js_messages['strGo'] = __('Go'); +$js_messages['strCancel'] = __('Cancel'); + +/* For page-related settings */ +$js_messages['strPageSettings'] = __('Page-related settings'); +$js_messages['strApply'] = __('Apply'); + +/* For Ajax Notifications */ +$js_messages['strLoading'] = __('Loading鈥�'); +$js_messages['strAbortedRequest'] = __('Request aborted!!'); +$js_messages['strProcessingRequest'] = __('Processing request'); +$js_messages['strRequestFailed'] = __('Request failed!!'); +$js_messages['strErrorProcessingRequest'] = __('Error in processing request'); +$js_messages['strErrorCode'] = __('Error code: %s'); +$js_messages['strErrorText'] = __('Error text: %s'); +$js_messages['strErrorConnection'] = __( + 'It seems that the connection to server has been lost. Please check your ' . + 'network connectivity and server status.' +); +$js_messages['strNoDatabasesSelected'] = __('No databases selected.'); +$js_messages['strNoAccountSelected'] = __('No accounts selected.'); +$js_messages['strDroppingColumn'] = __('Dropping column'); +$js_messages['strAddingPrimaryKey'] = __('Adding primary key'); +$js_messages['strOK'] = __('OK'); +$js_messages['strDismiss'] = __('Click to dismiss this notification'); + +/* For db_operations.js */ +$js_messages['strRenamingDatabases'] = __('Renaming databases'); +$js_messages['strCopyingDatabase'] = __('Copying database'); +$js_messages['strChangingCharset'] = __('Changing charset'); +$js_messages['strNo'] = __('No'); + +/* For Foreign key checks */ +$js_messages['strForeignKeyCheck'] = __('Enable foreign key checks'); + +/* For db_stucture.js */ +$js_messages['strErrorRealRowCount'] = __('Failed to get real row count.'); + +/* For db_search.js */ +$js_messages['strSearching'] = __('Searching'); +$js_messages['strHideSearchResults'] = __('Hide search results'); +$js_messages['strShowSearchResults'] = __('Show search results'); +$js_messages['strBrowsing'] = __('Browsing'); +$js_messages['strDeleting'] = __('Deleting'); +$js_messages['strConfirmDeleteResults'] = __('Delete the matches for the %s table?'); + +/* For db_routines.js */ +$js_messages['MissingReturn'] + = __('The definition of a stored function must contain a RETURN statement!'); +$js_messages['strExport'] = __('Export'); +$js_messages['NoExportable'] + = __('No routine is exportable. Required privileges may be lacking.'); + +/* For ENUM/SET editor*/ +$js_messages['enum_editor'] = __('ENUM/SET editor'); +$js_messages['enum_columnVals'] =__('Values for column %s'); +$js_messages['enum_newColumnVals'] = __('Values for a new column'); +$js_messages['enum_hint'] =__('Enter each value in a separate field.'); +$js_messages['enum_addValue'] =__('Add %d value(s)'); + +/* For import.js */ +$js_messages['strImportCSV'] = __( + 'Note: If the file contains multiple tables, they will be combined into one.' +); + +/* For sql.js */ +$js_messages['strHideQueryBox'] = __('Hide query box'); +$js_messages['strShowQueryBox'] = __('Show query box'); +$js_messages['strEdit'] = __('Edit'); +$js_messages['strDelete'] = __('Delete'); +$js_messages['strNotValidRowNumber'] = __('%d is not valid row number.'); +$js_messages['strBrowseForeignValues'] = __('Browse foreign values'); +$js_messages['strNoAutoSavedQuery'] = __('No auto-saved query'); +$js_messages['strBookmarkVariable'] = __('Variable %d:'); + +/* For Central list of columns */ +$js_messages['pickColumn'] = __('Pick'); +$js_messages['pickColumnTitle'] = __('Column selector'); +$js_messages['searchList'] = __('Search this list'); +$js_messages['strEmptyCentralList'] = __( + 'No columns in the central list. Make sure the Central columns list for ' + . 'database %s has columns that are not present in the current table.' +); +$js_messages['seeMore'] = __('See more'); +$js_messages['confirmTitle'] = __('Are you sure?'); +$js_messages['makeConsistentMessage'] = __( + 'This action may change some of the columns definition.
      Are you sure you ' + . 'want to continue?' +); +$js_messages['strContinue'] = __('Continue'); + +/** For normalization */ +$js_messages['strAddPrimaryKey'] = __('Add primary key'); +$js_messages['strPrimaryKeyAdded'] = __('Primary key added.'); +$js_messages['strToNextStep'] = __('Taking you to next step鈥�'); +$js_messages['strFinishMsg'] + = __("The first step of normalization is complete for table '%s'."); +$js_messages['strEndStep'] = __("End of step"); +$js_messages['str2NFNormalization'] = __('Second step of normalization (2NF)'); +$js_messages['strDone'] = __('Done'); +$js_messages['strConfirmPd'] = __('Confirm partial dependencies'); +$js_messages['strSelectedPd'] = __('Selected partial dependencies are as follows:'); +$js_messages['strPdHintNote'] = __( + 'Note: a, b -> d,f implies values of columns a and b combined together can ' + . 'determine values of column d and column f.' +); +$js_messages['strNoPdSelected'] = __('No partial dependencies selected!'); +$js_messages['strBack'] = __('Back'); +$js_messages['strShowPossiblePd'] + = __('Show me the possible partial dependencies based on data in the table'); +$js_messages['strHidePd'] = __('Hide partial dependencies list'); +$js_messages['strWaitForPd'] = __( + 'Sit tight! It may take few seconds depending on data size and column count of ' + . 'the table.' +); +$js_messages['strStep'] = __('Step'); +$js_messages['strMoveRepeatingGroup'] + = '
        ' . __('The following actions will be performed:') . '' + . '
      1. ' . __('DROP columns %s from the table %s') . '
      2. ' + . '
      3. ' . __('Create the following table') . '
      4. '; +$js_messages['strNewTablePlaceholder'] = 'Enter new table name'; +$js_messages['strNewColumnPlaceholder'] = 'Enter column name'; +$js_messages['str3NFNormalization'] = __('Third step of normalization (3NF)'); +$js_messages['strConfirmTd'] = __('Confirm transitive dependencies'); +$js_messages['strSelectedTd'] = __('Selected dependencies are as follows:'); +$js_messages['strNoTdSelected'] = __('No dependencies selected!'); + +/* For server_variables.js */ +$js_messages['strSave'] = __('Save'); + +/* For tbl_select.js */ +$js_messages['strHideSearchCriteria'] = __('Hide search criteria'); +$js_messages['strShowSearchCriteria'] = __('Show search criteria'); +$js_messages['strRangeSearch'] = __('Range search'); +$js_messages['strColumnMax'] = __('Column maximum:'); +$js_messages['strColumnMin'] = __('Column minimum:'); +$js_messages['strMinValue'] = __('Minimum value:'); +$js_messages['strMaxValue'] = __('Maximum value:'); + +/* For tbl_find_replace.js */ +$js_messages['strHideFindNReplaceCriteria'] = __('Hide find and replace criteria'); +$js_messages['strShowFindNReplaceCriteria'] = __('Show find and replace criteria'); + +/* For tbl_zoom_plot_jqplot.js */ +$js_messages['strDisplayHelp'] = '
        • ' + . __('Each point represents a data row.') + . '
        • ' + . __('Hovering over a point will show its label.') + . '
        • ' + . __('To zoom in, select a section of the plot with the mouse.') + . '
        • ' + . __('Click reset zoom button to come back to original state.') + . '
        • ' + . __('Click a data point to view and possibly edit the data row.') + . '
        • ' + . __('The plot can be resized by dragging it along the bottom right corner.') + . '
        '; +$js_messages['strHelpTitle'] = 'Zoom search instructions'; +$js_messages['strInputNull'] = '' . __('Select two columns') . ''; +$js_messages['strSameInputs'] = '' + . __('Select two different columns') + . ''; +$js_messages['strDataPointContent'] = __('Data point content'); + +/* For tbl_change.js */ +$js_messages['strIgnore'] = __('Ignore'); +$js_messages['strCopy'] = __('Copy'); +$js_messages['strX'] = __('X'); +$js_messages['strY'] = __('Y'); +$js_messages['strPoint'] = __('Point'); +$js_messages['strPointN'] = __('Point %d'); +$js_messages['strLineString'] = __('Linestring'); +$js_messages['strPolygon'] = __('Polygon'); +$js_messages['strGeometry'] = __('Geometry'); +$js_messages['strInnerRing'] = __('Inner ring'); +$js_messages['strOuterRing'] = __('Outer ring'); +$js_messages['strAddPoint'] = __('Add a point'); +$js_messages['strAddInnerRing'] = __('Add an inner ring'); +$js_messages['strYes'] = __('Yes'); +$js_messages['strCopyEncryptionKey'] = __('Do you want to copy encryption key?'); +$js_messages['strEncryptionKey'] = __('Encryption key'); + +/* For Tip to be shown on Time field */ +$js_messages['strMysqlAllowedValuesTipTime'] = __( + 'MySQL accepts additional values not selectable by the slider;' + . ' key in those values directly if desired' +); + +/* For Tip to be shown on Date field */ +$js_messages['strMysqlAllowedValuesTipDate'] = __( + 'MySQL accepts additional values not selectable by the datepicker;' + . ' key in those values directly if desired' +); + +/* For Lock symbol Tooltip */ +$js_messages['strLockToolTip'] = __( + 'Indicates that you have made changes to this page;' + . ' you will be prompted for confirmation before abandoning changes' +); + +/* Designer (js/designer/move.js) */ +$js_messages['strSelectReferencedKey'] = __('Select referenced key'); +$js_messages['strSelectForeignKey'] = __('Select Foreign Key'); +$js_messages['strPleaseSelectPrimaryOrUniqueKey'] + = __('Please select the primary key or a unique key!'); +$js_messages['strChangeDisplay'] = __('Choose column to display'); +$js_messages['strLeavingDesigner'] = __( + 'You haven\'t saved the changes in the layout. They will be lost if you' + . ' don\'t save them. Do you want to continue?' +); +$js_messages['strQueryEmpty'] = __('value/subQuery is empty'); +$js_messages['strAddTables'] = __('Add tables from other databases'); +$js_messages['strPageName'] = __('Page name'); +$js_messages['strSavePage'] = __('Save page'); +$js_messages['strSavePageAs'] = __('Save page as'); +$js_messages['strOpenPage'] = __('Open page'); +$js_messages['strDeletePage'] = __('Delete page'); +$js_messages['strUntitled'] = __('Untitled'); +$js_messages['strSelectPage'] = __('Please select a page to continue'); +$js_messages['strEnterValidPageName'] = __('Please enter a valid page name'); +$js_messages['strLeavingPage'] + = __('Do you want to save the changes to the current page?'); +$js_messages['strSuccessfulPageDelete'] = __('Successfully deleted the page'); +$js_messages['strExportRelationalSchema'] = __('Export relational schema'); +$js_messages['strModificationSaved'] = __('Modifications have been saved'); + +/* Visual query builder (js/designer/move.js) */ +$js_messages['strObjectsCreated'] = __('%d object(s) created.'); +$js_messages['strColumnName'] = __('Column name'); +$js_messages['strSubmit'] = __('Submit'); + +/* For makegrid.js (column reordering, show/hide column, grid editing) */ +$js_messages['strCellEditHint'] = __('Press escape to cancel editing.'); +$js_messages['strSaveCellWarning'] = __( + 'You have edited some data and they have not been saved. Are you sure you want ' + . 'to leave this page before saving the data?' +); +$js_messages['strColOrderHint'] = __('Drag to reorder.'); +$js_messages['strSortHint'] = __('Click to sort results by this column.'); +$js_messages['strMultiSortHint'] = __( + 'Shift+Click to add this column to ORDER BY clause or to toggle ASC/DESC.' + . '
        - Ctrl+Click or Alt+Click (Mac: Shift+Option+Click) to remove column ' + . 'from ORDER BY clause' +); +$js_messages['strColMarkHint'] = __('Click to mark/unmark.'); +$js_messages['strColNameCopyHint'] = __('Double-click to copy column name.'); +$js_messages['strColVisibHint'] = __( + 'Click the drop-down arrow
        to toggle column\'s visibility.' +); +$js_messages['strShowAllCol'] = __('Show all'); +$js_messages['strAlertNonUnique'] = __( + 'This table does not contain a unique column. Features related to the grid ' + . 'edit, checkbox, Edit, Copy and Delete links may not work after saving.' +); +$js_messages['strEnterValidHex'] + = __('Please enter a valid hexadecimal string. Valid characters are 0-9, A-F.'); +$js_messages['strShowAllRowsWarning'] = __( + 'Do you really want to see all of the rows? For a big table this could crash ' + . 'the browser.' +); +$js_messages['strOriginalLength'] = __('Original length'); + +/** Drag & Drop sql import messages */ +$js_messages['dropImportMessageCancel'] = __('cancel'); +$js_messages['dropImportMessageAborted'] = __('Aborted'); +$js_messages['dropImportMessageFailed'] = __('Failed'); +$js_messages['dropImportMessageSuccess'] = __('Success'); +$js_messages['dropImportImportResultHeader'] = __('Import status'); +$js_messages['dropImportDropFiles'] = __('Drop files here'); +$js_messages['dropImportSelectDB'] = __('Select database first'); + +/* For Print view */ +$js_messages['print'] = __('Print'); +$js_messages['back'] = __('Back'); + +// this approach does not work when the parameter is changed via user prefs +switch ($GLOBALS['cfg']['GridEditing']) { +case 'double-click': + $js_messages['strGridEditFeatureHint'] = __( + 'You can also edit most values
        by double-clicking directly on them.' + ); + break; +case 'click': + $js_messages['strGridEditFeatureHint'] = __( + 'You can also edit most values
        by clicking directly on them.' + ); + break; +default: + break; +} +$js_messages['strGoToLink'] = __('Go to link:'); +$js_messages['strColNameCopyTitle'] = __('Copy column name.'); +$js_messages['strColNameCopyText'] + = __('Right-click the column name to copy it to your clipboard.'); + +/* password generation */ +$js_messages['strGeneratePassword'] = __('Generate password'); +$js_messages['strGenerate'] = __('Generate'); +$js_messages['strChangePassword'] = __('Change password'); + +/* navigation tabs */ +$js_messages['strMore'] = __('More'); + +/* navigation panel */ +$js_messages['strShowPanel'] = __('Show panel'); +$js_messages['strHidePanel'] = __('Hide panel'); +$js_messages['strUnhideNavItem'] = __('Show hidden navigation tree items.'); +$js_messages['linkWithMain'] = __('Link with main panel'); +$js_messages['unlinkWithMain'] = __('Unlink from main panel'); + +/* microhistory */ +$js_messages['strInvalidPage'] + = __('The requested page was not found in the history, it may have expired.'); + +/* update */ +$js_messages['strNewerVersion'] = __( + 'A newer version of phpMyAdmin is available and you should consider upgrading. ' + . 'The newest version is %s, released on %s.' +); +/* l10n: Latest available phpMyAdmin version */ +$js_messages['strLatestAvailable'] = __(', latest stable version:'); +$js_messages['strUpToDate'] = __('up to date'); + +$js_messages['strCreateView'] = __('Create view'); + +/* Error Reporting */ +$js_messages['strSendErrorReport'] = __("Send error report"); +$js_messages['strSubmitErrorReport'] = __("Submit error report"); +$js_messages['strErrorOccurred'] = __( + "A fatal JavaScript error has occurred. Would you like to send an error report?" +); +$js_messages['strChangeReportSettings'] = __("Change report settings"); +$js_messages['strShowReportDetails'] = __("Show report details"); +$js_messages['strIgnore'] = __("Ignore"); +$js_messages['strTimeOutError'] = __( + "Your export is incomplete, due to a low execution time limit at the PHP level!" +); + +$js_messages['strTooManyInputs'] = __( + "Warning: a form on this page has more than %d fields. On submission, " + . "some of the fields might be ignored, due to PHP's " + . "max_input_vars configuration." +); + +$js_messages['phpErrorsFound'] = '
        ' + . __('Some errors have been detected on the server!') + . '
        ' + . __('Please look at the bottom of this window.') + . '
        ' + . '' + . '' + . '
        '; + +$js_messages['phpErrorsBeingSubmitted'] = '
        ' + . __('Some errors have been detected on the server!') + . '
        ' + . __( + 'As per your settings, they are being submitted currently, please be ' + . 'patient.' + ) + . '
        ' + . 'ajax clock' + . '
        '; + +// For console +$js_messages['strConsoleRequeryConfirm'] = __('Execute this query again?'); +$js_messages['strConsoleDeleteBookmarkConfirm'] + = __('Do you really want to delete this bookmark?'); +$js_messages['strConsoleDebugError'] + = __('Some error occurred while getting SQL debug info.'); +$js_messages['strConsoleDebugSummary'] + = __('%s queries executed %s times in %s seconds.'); +$js_messages['strConsoleDebugArgsSummary'] = __('%s argument(s) passed'); +$js_messages['strConsoleDebugShowArgs'] = __('Show arguments'); +$js_messages['strConsoleDebugHideArgs'] = __('Hide arguments'); +$js_messages['strConsoleDebugTimeTaken'] = __('Time taken:'); +$js_messages['strNoLocalStorage'] = __('There was a problem accessing your browser storage, some features may not work properly for you. It is likely that the browser doesn\'t support storage or the quota limit has been reached. In Firefox, corrupted storage can also cause such a problem, clearing your "Offline Website Data" might help. In Safari, such problem is commonly caused by "Private Mode Browsing".'); +// For modals in db_structure.php +$js_messages['strCopyTablesTo'] = __('Copy tables to'); +$js_messages['strAddPrefix'] = __('Add table prefix'); +$js_messages['strReplacePrefix'] = __('Replace table with prefix'); +$js_messages['strCopyPrefix'] = __('Copy table with prefix'); + +/* For password strength simulation */ +$js_messages['strExtrWeak'] = __('Extremely weak'); +$js_messages['strVeryWeak'] = __('Very weak'); +$js_messages['strWeak'] = __('Weak'); +$js_messages['strGood'] = __('Good'); +$js_messages['strStrong'] = __('Strong'); + +/* U2F errors */ +$js_messages['strU2FTimeout'] = __('Timed out waiting for security key activation.'); +$js_messages['strU2FError'] = __('Failed security key activation (%s).'); + +/* Designer */ +$js_messages['strTableAlreadyExists'] = _pgettext('The table already exists in the designer and can not be added once more.', 'Table %s already exists!'); +$js_messages['strHide'] = __('Hide'); +$js_messages['strStructure'] = __('Structure'); + +echo "var PMA_messages = new Array();\n"; +foreach ($js_messages as $name => $js_message) { + Sanitize::printJsValue("PMA_messages['" . $name . "']", $js_message); +} + +/* Calendar */ +echo "var themeCalendarImage = '" , $GLOBALS['pmaThemeImage'] + , 'b_calendar.png' , "';\n"; + +/* Image path */ +echo "var pmaThemeImage = '" , $GLOBALS['pmaThemeImage'] , "';\n"; + +echo "var mysql_doc_template = '" , PhpMyAdmin\Util::getMySQLDocuURL('%s') + , "';\n"; + +//Max input vars allowed by PHP. +$maxInputVars = ini_get('max_input_vars'); +echo 'var maxInputVars = ' + , (false === $maxInputVars || '' == $maxInputVars ? 'false' : (int)$maxInputVars) + , ';' . "\n"; + +echo "if ($.datepicker) {\n"; +/* l10n: Display text for calendar close link */ +Sanitize::printJsValue("$.datepicker.regional['']['closeText']", __('Done')); +/* l10n: Display text for previous month link in calendar */ +Sanitize::printJsValue( + "$.datepicker.regional['']['prevText']", + _pgettext('Previous month', 'Prev') +); +/* l10n: Display text for next month link in calendar */ +Sanitize::printJsValue( + "$.datepicker.regional['']['nextText']", + _pgettext('Next month', 'Next') +); +/* l10n: Display text for current month link in calendar */ +Sanitize::printJsValue("$.datepicker.regional['']['currentText']", __('Today')); +Sanitize::printJsValue( + "$.datepicker.regional['']['monthNames']", + array( + __('January'), + __('February'), + __('March'), + __('April'), + __('May'), + __('June'), + __('July'), + __('August'), + __('September'), + __('October'), + __('November'), + __('December') + ) +); +Sanitize::printJsValue( + "$.datepicker.regional['']['monthNamesShort']", + array( + /* l10n: Short month name */ + __('Jan'), + /* l10n: Short month name */ + __('Feb'), + /* l10n: Short month name */ + __('Mar'), + /* l10n: Short month name */ + __('Apr'), + /* l10n: Short month name */ + _pgettext('Short month name', 'May'), + /* l10n: Short month name */ + __('Jun'), + /* l10n: Short month name */ + __('Jul'), + /* l10n: Short month name */ + __('Aug'), + /* l10n: Short month name */ + __('Sep'), + /* l10n: Short month name */ + __('Oct'), + /* l10n: Short month name */ + __('Nov'), + /* l10n: Short month name */ + __('Dec') + ) +); +Sanitize::printJsValue( + "$.datepicker.regional['']['dayNames']", + array( + __('Sunday'), + __('Monday'), + __('Tuesday'), + __('Wednesday'), + __('Thursday'), + __('Friday'), + __('Saturday') + ) +); +Sanitize::printJsValue( + "$.datepicker.regional['']['dayNamesShort']", + array( + /* l10n: Short week day name for Sunday */ + __('Sun'), + /* l10n: Short week day name for Monday */ + __('Mon'), + /* l10n: Short week day name for Tuesday */ + __('Tue'), + /* l10n: Short week day name for Wednesday */ + __('Wed'), + /* l10n: Short week day name for Thursday */ + __('Thu'), + /* l10n: Short week day name for Friday */ + __('Fri'), + /* l10n: Short week day name for Saturday */ + __('Sat') + ) +); +Sanitize::printJsValue( + "$.datepicker.regional['']['dayNamesMin']", + array( + /* l10n: Minimal week day name for Sunday */ + __('Su'), + /* l10n: Minimal week day name for Monday */ + __('Mo'), + /* l10n: Minimal week day name for Tuesday */ + __('Tu'), + /* l10n: Minimal week day name for Wednesday */ + __('We'), + /* l10n: Minimal week day name for Thursday */ + __('Th'), + /* l10n: Minimal week day name for Friday */ + __('Fr'), + /* l10n: Minimal week day name for Saturday */ + __('Sa') + ) +); +/* l10n: Column header for week of the year in calendar */ +Sanitize::printJsValue("$.datepicker.regional['']['weekHeader']", __('Wk')); + +Sanitize::printJsValue( + "$.datepicker.regional['']['showMonthAfterYear']", + /* l10n: Month-year order for calendar, use either "calendar-month-year" + * or "calendar-year-month". + */ + (__('calendar-month-year') == 'calendar-year-month') +); +/* l10n: Year suffix for calendar, "none" is empty. */ +$year_suffix = _pgettext('Year suffix', 'none'); +Sanitize::printJsValue( + "$.datepicker.regional['']['yearSuffix']", + ($year_suffix == 'none' ? '' : $year_suffix) +); +?> +$.extend($.datepicker._defaults, $.datepicker.regional['']); +} /* if ($.datepicker) */ + + +$.extend($.timepicker._defaults, $.timepicker.regional['']); +} /* if ($.timepicker) */ + + diff --git a/phpMyAdmin/js/microhistory.js b/phpMyAdmin/js/microhistory.js new file mode 100755 index 0000000..46c98a8 --- /dev/null +++ b/phpMyAdmin/js/microhistory.js @@ -0,0 +1,335 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * An implementation of a client-side page cache. + * This object also uses the cache to provide a simple microhistory, + * that is the ability to use the back and forward buttons in the browser + */ +PMA_MicroHistory = { + /** + * @var int The maximum number of pages to keep in the cache + */ + MAX: 6, + /** + * @var object A hash used to prime the cache with data about the initially + * loaded page. This is set in the footer, and then loaded + * by a double-queued event further down this file. + */ + primer: {}, + /** + * @var array Stores the content of the cached pages + */ + pages: [], + /** + * @var int The index of the currently loaded page + * This is used to know at which point in the history we are + */ + current: 0, + /** + * Saves a new page in the cache + * + * @param string hash The hash part of the url that is being loaded + * @param array scripts A list of scripts that is required for the page + * @param string menu A hash that links to a menu stored + * in a dedicated menu cache + * @param array params A list of parameters used by PMA_commonParams() + * @param string rel A relationship to the current page: + * 'samepage': Forces the response to be treated as + * the same page as the current one + * 'newpage': Forces the response to be treated as + * a new page + * undefined: Default behaviour, 'samepage' if the + * selflinks of the two pages are the same. + * 'newpage' otherwise + * + * @return void + */ + add: function (hash, scripts, menu, params, rel) { + if (this.pages.length > PMA_MicroHistory.MAX) { + // Trim the cache, to the maximum number of allowed entries + // This way we will have a cached menu for every page + for (var i = 0; i < this.pages.length - this.MAX; i++) { + delete this.pages[i]; + } + } + while (this.current < this.pages.length) { + // trim the cache if we went back in the history + // and are now going forward again + this.pages.pop(); + } + if (rel === 'newpage' || + ( + typeof rel === 'undefined' && ( + typeof this.pages[this.current - 1] === 'undefined' || + this.pages[this.current - 1].hash !== hash + ) + ) + ) { + this.pages.push({ + hash: hash, + content: $('#page_content').html(), + scripts: scripts, + selflink: $('#selflink').html(), + menu: menu, + params: params + }); + PMA_SetUrlHash(this.current, hash); + this.current++; + } + }, + /** + * Restores a page from the cache. This is called when the hash + * part of the url changes and it's structure appears to be valid + * + * @param string index Which page from the history to load + * + * @return void + */ + navigate: function (index) { + if (typeof this.pages[index] === 'undefined' || + typeof this.pages[index].content === 'undefined' || + typeof this.pages[index].menu === 'undefined' || + ! PMA_MicroHistory.menus.get(this.pages[index].menu) + ) { + PMA_ajaxShowMessage( + '
        ' + PMA_messages.strInvalidPage + '
        ', + false + ); + } else { + AJAX.active = true; + var record = this.pages[index]; + AJAX.scriptHandler.reset(function () { + $('#page_content').html(record.content); + $('#selflink').html(record.selflink); + PMA_MicroHistory.menus.replace(PMA_MicroHistory.menus.get(record.menu)); + PMA_commonParams.setAll(record.params); + AJAX.scriptHandler.load(record.scripts); + PMA_MicroHistory.current = ++index; + }); + } + }, + /** + * Resaves the content of the current page in the cache. + * Necessary in order not to show the user some outdated version of the page + * + * @return void + */ + update: function () { + var page = this.pages[this.current - 1]; + if (page) { + page.content = $('#page_content').html(); + } + }, + /** + * @var object Dedicated menu cache + */ + menus: { + /** + * Returns the number of items in an associative array + * + * @return int + */ + size: function (obj) { + var size = 0; + var key; + for (key in obj) { + if (obj.hasOwnProperty(key)) { + size++; + } + } + return size; + }, + /** + * @var hash Stores the content of the cached menus + */ + data: {}, + /** + * Saves a new menu in the cache + * + * @param string hash The hash (trimmed md5) of the menu to be saved + * @param string content The HTML code of the menu to be saved + * + * @return void + */ + add: function (hash, content) { + if (this.size(this.data) > PMA_MicroHistory.MAX) { + // when the cache grows, we remove the oldest entry + var oldest; + var key; + var init = 0; + for (var i in this.data) { + if (this.data[i]) { + if (! init || this.data[i].timestamp.getTime() < oldest.getTime()) { + oldest = this.data[i].timestamp; + key = i; + init = 1; + } + } + } + delete this.data[key]; + } + this.data[hash] = { + content: content, + timestamp: new Date() + }; + }, + /** + * Retrieves a menu given its hash + * + * @param string hash The hash of the menu to be retrieved + * + * @return string + */ + get: function (hash) { + if (this.data[hash]) { + return this.data[hash].content; + } else { + // This should never happen as long as the number of stored menus + // is larger or equal to the number of pages in the page cache + return ''; + } + }, + /** + * Prepares part of the parameter string used during page requests, + * this is necessary to tell the server which menus we have in the cache + * + * @return string + */ + getRequestParam: function () { + var param = ''; + var menuHashes = []; + for (var i in this.data) { + menuHashes.push(i); + } + var menuHashesParam = menuHashes.join('-'); + if (menuHashesParam) { + param = PMA_commonParams.get('arg_separator') + 'menuHashes=' + menuHashesParam; + } + return param; + }, + /** + * Replaces the menu with new content + * + * @return void + */ + replace: function (content) { + $('#floating_menubar').html(content) + // Remove duplicate wrapper + // TODO: don't send it in the response + .children().first().remove(); + $('#topmenu').menuResizer(PMA_mainMenuResizerCallback); + } + } +}; + +/** + * URL hash management module. + * Allows direct bookmarking and microhistory. + */ +PMA_SetUrlHash = (function (jQuery, window) { + 'use strict'; + /** + * Indictaes whether we have already completed + * the initialisation of the hash + * + * @access private + */ + var ready = false; + /** + * Stores a hash that needed to be set when we were not ready + * + * @access private + */ + var savedHash = ''; + /** + * Flag to indicate if the change of hash was triggered + * by a user pressing the back/forward button or if + * the change was triggered internally + * + * @access private + */ + var userChange = true; + + // Fix favicon disappearing in Firefox when setting location.hash + function resetFavicon () { + if (navigator.userAgent.indexOf('Firefox') > -1) { + // Move the link tags for the favicon to the bottom + // of the head element to force a reload of the favicon + $('head > link[href="favicon\\.ico"]').appendTo('head'); + } + } + + /** + * Sets the hash part of the URL + * + * @access public + */ + function setUrlHash (index, hash) { + /* + * Known problem: + * Setting hash leads to reload in webkit: + * http://www.quirksmode.org/bugreports/archives/2005/05/Safari_13_visual_anomaly_with_windowlocationhref.html + * + * so we expect that users are not running an ancient Safari version + */ + + userChange = false; + if (ready) { + window.location.hash = 'PMAURL-' + index + ':' + hash; + resetFavicon(); + } else { + savedHash = 'PMAURL-' + index + ':' + hash; + } + } + /** + * Start initialisation + */ + var urlhash = window.location.hash; + if (urlhash.substring(0, 8) === '#PMAURL-') { + // We have a valid hash, let's redirect the user + // to the page that it's pointing to + var colon_position = urlhash.indexOf(':'); + var questionmark_position = urlhash.indexOf('?'); + if (colon_position !== -1 && questionmark_position !== -1 && colon_position < questionmark_position) { + var hash_url = urlhash.substring(colon_position + 1, questionmark_position); + if (PMA_gotoWhitelist.indexOf(hash_url) !== -1) { + window.location = urlhash.substring( + colon_position + 1 + ); + } + } + } else { + // We don't have a valid hash, so we'll set it up + // when the page finishes loading + jQuery(function () { + /* Check if we should set URL */ + if (savedHash !== '') { + window.location.hash = savedHash; + savedHash = ''; + resetFavicon(); + } + // Indicate that we're done initialising + ready = true; + }); + } + /** + * Register an event handler for when the url hash changes + */ + jQuery(function () { + jQuery(window).hashchange(function () { + if (userChange === false) { + // Ignore internally triggered hash changes + userChange = true; + } else if (/^#PMAURL-\d+:/.test(window.location.hash)) { + // Change page if the hash changed was triggered by a user action + var index = window.location.hash.substring( + 8, window.location.hash.indexOf(':') + ); + PMA_MicroHistory.navigate(index); + } + }); + }); + /** + * Publicly exposes a reference to the otherwise private setUrlHash function + */ + return setUrlHash; +}(jQuery, window)); diff --git a/phpMyAdmin/js/multi_column_sort.js b/phpMyAdmin/js/multi_column_sort.js new file mode 100755 index 0000000..cc9b921 --- /dev/null +++ b/phpMyAdmin/js/multi_column_sort.js @@ -0,0 +1,84 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview Implements the shiftkey + click remove column + * from order by clause funcationality + * @name columndelete + * + * @requires jQuery + */ + +function captureURL (url) { + var URL = {}; + url = '' + url; + // Exclude the url part till HTTP + url = url.substr(url.search('sql.php'), url.length); + // The url part between ORDER BY and &session_max_rows needs to be replaced. + URL.head = url.substr(0, url.indexOf('ORDER+BY') + 9); + URL.tail = url.substr(url.indexOf('&session_max_rows'), url.length); + return URL; +} + +/** + * This function is for navigating to the generated URL + * + * @param object target HTMLAnchor element + * @param object parent HTMLDom Object + */ + +function removeColumnFromMultiSort (target, parent) { + var URL = captureURL(target); + var begin = target.indexOf('ORDER+BY') + 8; + var end = target.indexOf(PMA_commonParams.get('arg_separator') + 'session_max_rows'); + // get the names of the columns involved + var between_part = target.substr(begin, end - begin); + var columns = between_part.split('%2C+'); + // If the given column is not part of the order clause exit from this function + var index = parent.find('small').length ? parent.find('small').text() : ''; + if (index === '') { + return ''; + } + // Remove the current clicked column + columns.splice(index - 1, 1); + // If all the columns have been removed dont submit a query with nothing + // After order by clause. + if (columns.length === 0) { + var head = URL.head; + head = head.slice(0,head.indexOf('ORDER+BY')); + URL.head = head; + // removing the last sort order should have priority over what + // is remembered via the RememberSorting directive + URL.tail += PMA_commonParams.get('arg_separator') + 'discard_remembered_sort=1'; + } + URL.head = URL.head.substring(URL.head.indexOf('?') + 1); + var middle_part = columns.join('%2C+'); + params = URL.head + middle_part + URL.tail; + return params; +} + +AJAX.registerOnload('keyhandler.js', function () { + $('th.draggable.column_heading.pointer.marker a').on('click', function (event) { + var url = $(this).parent().find('input').val(); + var argsep = PMA_commonParams.get('arg_separator'); + if (event.ctrlKey || event.altKey) { + event.preventDefault(); + var params = removeColumnFromMultiSort(url, $(this).parent()); + if (params) { + AJAX.source = $(this); + PMA_ajaxShowMessage(); + params += argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true'; + $.post('sql.php', params, AJAX.responseHandler); + } + } else if (event.shiftKey) { + event.preventDefault(); + AJAX.source = $(this); + PMA_ajaxShowMessage(); + var params = url.substring(url.indexOf('?') + 1); + params += argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true'; + $.post('sql.php', params, AJAX.responseHandler); + } + }); +}); + +AJAX.registerTeardown('keyhandler.js', function () { + $(document).off('click', 'th.draggable.column_heading.pointer.marker a'); +}); diff --git a/phpMyAdmin/js/navigation.js b/phpMyAdmin/js/navigation.js new file mode 100755 index 0000000..136b737 --- /dev/null +++ b/phpMyAdmin/js/navigation.js @@ -0,0 +1,1678 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * function used in or for navigation panel + * + * @package phpMyAdmin-Navigation + */ + +/** + * updates the tree state in sessionStorage + * + * @returns void + */ +function navTreeStateUpdate () { + // update if session storage is supported + if (isStorageSupported('sessionStorage')) { + var storage = window.sessionStorage; + // try catch necessary here to detect whether + // content to be stored exceeds storage capacity + try { + storage.setItem('navTreePaths', JSON.stringify(traverseNavigationForPaths())); + storage.setItem('server', PMA_commonParams.get('server')); + storage.setItem('token', PMA_commonParams.get('token')); + } catch (error) { + // storage capacity exceeded & old navigation tree + // state is no more valid, so remove it + storage.removeItem('navTreePaths'); + storage.removeItem('server'); + storage.removeItem('token'); + } + } +} + + +/** + * updates the filter state in sessionStorage + * + * @returns void + */ +function navFilterStateUpdate (filterName, filterValue) { + if (isStorageSupported('sessionStorage')) { + var storage = window.sessionStorage; + try { + var currentFilter = $.extend({}, JSON.parse(storage.getItem('navTreeSearchFilters'))); + var filter = {}; + filter[filterName] = filterValue; + currentFilter = $.extend(currentFilter, filter); + storage.setItem('navTreeSearchFilters', JSON.stringify(currentFilter)); + } catch (error) { + storage.removeItem('navTreeSearchFilters'); + } + } +} + + +/** + * restores the filter state on navigation reload + * + * @returns void + */ +function navFilterStateRestore () { + if (isStorageSupported('sessionStorage') + && typeof window.sessionStorage.navTreeSearchFilters !== 'undefined' + ) { + var searchClauses = JSON.parse(window.sessionStorage.navTreeSearchFilters); + if (Object.keys(searchClauses).length < 1) { + return; + } + // restore database filter if present and not empty + if (searchClauses.hasOwnProperty('dbFilter') + && searchClauses.dbFilter.length + ) { + $obj = $('#pma_navigation_tree'); + if (! $obj.data('fastFilter')) { + $obj.data( + 'fastFilter', + new PMA_fastFilter.filter($obj, '') + ); + } + $obj.find('li.fast_filter.db_fast_filter input.searchClause') + .val(searchClauses.dbFilter) + .trigger('keyup'); + } + // find all table filters present in the tree + $tableFilters = $('#pma_navigation_tree li.database') + .children('div.list_container') + .find('li.fast_filter input.searchClause'); + // restore table filters + $tableFilters.each(function () { + $obj = $(this).closest('div.list_container'); + // aPath associated with this filter + var filterName = $(this).siblings('input[name=aPath]').val(); + // if this table's filter has a state stored in storage + if (searchClauses.hasOwnProperty(filterName) + && searchClauses[filterName].length + ) { + // clear state if item is not visible, + // happens when table filter becomes invisible + // as db filter has already been applied + if (! $obj.is(':visible')) { + navFilterStateUpdate(filterName, ''); + return true; + } + if (! $obj.data('fastFilter')) { + $obj.data( + 'fastFilter', + new PMA_fastFilter.filter($obj, '') + ); + } + $(this).val(searchClauses[filterName]) + .trigger('keyup'); + } + }); + } +} + +/** + * Loads child items of a node and executes a given callback + * + * @param isNode + * @param $expandElem expander + * @param callback callback function + * + * @returns void + */ +function loadChildNodes (isNode, $expandElem, callback) { + var $destination = null; + var params = null; + + if (isNode) { + if (!$expandElem.hasClass('expander')) { + return; + } + $destination = $expandElem.closest('li'); + params = { + aPath: $expandElem.find('span.aPath').text(), + vPath: $expandElem.find('span.vPath').text(), + pos: $expandElem.find('span.pos').text(), + pos2_name: $expandElem.find('span.pos2_name').text(), + pos2_value: $expandElem.find('span.pos2_value').text(), + searchClause: '', + searchClause2: '' + }; + if ($expandElem.closest('ul').hasClass('search_results')) { + params.searchClause = PMA_fastFilter.getSearchClause(); + params.searchClause2 = PMA_fastFilter.getSearchClause2($expandElem); + } + } else { + $destination = $('#pma_navigation_tree_content'); + params = { + aPath: $expandElem.attr('aPath'), + vPath: $expandElem.attr('vPath'), + pos: $expandElem.attr('pos'), + pos2_name: '', + pos2_value: '', + searchClause: '', + searchClause2: '' + }; + } + + var url = $('#pma_navigation').find('a.navigation_url').attr('href'); + $.post(url, params, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + $destination.find('div.list_container').remove(); // FIXME: Hack, there shouldn't be a list container there + if (isNode) { + $destination.append(data.message); + $expandElem.addClass('loaded'); + } else { + $destination.html(data.message); + $destination.children() + .first() + .css({ + border: '0px', + margin: '0em', + padding : '0em' + }) + .slideDown('slow'); + } + if (data._errors) { + var $errors = $(data._errors); + if ($errors.children().length > 0) { + $('#pma_errors').replaceWith(data._errors); + } + } + if (callback && typeof callback === 'function') { + callback(data); + } + } else if (data.redirect_flag === '1') { + if (window.location.href.indexOf('?') === -1) { + window.location.href += '?session_expired=1'; + } else { + window.location.href += PMA_commonParams.get('arg_separator') + 'session_expired=1'; + } + window.location.reload(); + } else { + var $throbber = $expandElem.find('img.throbber'); + $throbber.hide(); + var $icon = $expandElem.find('img.ic_b_plus'); + $icon.show(); + PMA_ajaxShowMessage(data.error, false); + } + }); +} + +/** + * Collapses a node in navigation tree. + * + * @param $expandElem expander + * + * @returns void + */ +function collapseTreeNode ($expandElem) { + var $children = $expandElem.closest('li').children('div.list_container'); + var $icon = $expandElem.find('img'); + if ($expandElem.hasClass('loaded')) { + if ($icon.is('.ic_b_minus')) { + $icon.removeClass('ic_b_minus').addClass('ic_b_plus'); + $children.slideUp('fast'); + } + } + $expandElem.blur(); + $children.promise().done(navTreeStateUpdate); +} + +/** + * Traverse the navigation tree backwards to generate all the actual + * and virtual paths, as well as the positions in the pagination at + * various levels, if necessary. + * + * @return Object + */ +function traverseNavigationForPaths () { + var params = { + pos: $('#pma_navigation_tree').find('div.dbselector select').val() + }; + if ($('#navi_db_select').length) { + return params; + } + var count = 0; + $('#pma_navigation_tree').find('a.expander:visible').each(function () { + if ($(this).find('img').is('.ic_b_minus') && + $(this).closest('li').find('div.list_container .ic_b_minus').length === 0 + ) { + params['n' + count + '_aPath'] = $(this).find('span.aPath').text(); + params['n' + count + '_vPath'] = $(this).find('span.vPath').text(); + + var pos2_name = $(this).find('span.pos2_name').text(); + if (! pos2_name) { + pos2_name = $(this) + .parent() + .parent() + .find('span.pos2_name:last') + .text(); + } + var pos2_value = $(this).find('span.pos2_value').text(); + if (! pos2_value) { + pos2_value = $(this) + .parent() + .parent() + .find('span.pos2_value:last') + .text(); + } + + params['n' + count + '_pos2_name'] = pos2_name; + params['n' + count + '_pos2_value'] = pos2_value; + + params['n' + count + '_pos3_name'] = $(this).find('span.pos3_name').text(); + params['n' + count + '_pos3_value'] = $(this).find('span.pos3_value').text(); + count++; + } + }); + return params; +} + +/** + * Executed on page load + */ +$(function () { + if (! $('#pma_navigation').length) { + // Don't bother running any code if the navigation is not even on the page + return; + } + + // Do not let the page reload on submitting the fast filter + $(document).on('submit', '.fast_filter', function (event) { + event.preventDefault(); + }); + + // Fire up the resize handlers + new ResizeHandler(); + + /** + * opens/closes (hides/shows) tree elements + * loads data via ajax + */ + $(document).on('click', '#pma_navigation_tree a.expander', function (event) { + event.preventDefault(); + event.stopImmediatePropagation(); + var $icon = $(this).find('img'); + if ($icon.is('.ic_b_plus')) { + expandTreeNode($(this)); + } else { + collapseTreeNode($(this)); + } + }); + + /** + * Register event handler for click on the reload + * navigation icon at the top of the panel + */ + $(document).on('click', '#pma_navigation_reload', function (event) { + event.preventDefault(); + + // Find the loading symbol and show it + var $icon_throbber_src = $('#pma_navigation').find('.throbber'); + $icon_throbber_src.show(); + // TODO Why is a loading symbol both hidden, and invisible? + $icon_throbber_src.css('visibility', ''); + + // Callback to be used to hide the loading symbol when done reloading + function hideNav () { + $icon_throbber_src.hide(); + } + + // Reload the navigation + PMA_reloadNavigation(hideNav); + }); + + $(document).on('change', '#navi_db_select', function (event) { + if (! $(this).val()) { + PMA_commonParams.set('db', ''); + PMA_reloadNavigation(); + } + $(this).closest('form').trigger('submit'); + }); + + /** + * Register event handler for click on the collapse all + * navigation icon at the top of the navigation tree + */ + $(document).on('click', '#pma_navigation_collapse', function (event) { + event.preventDefault(); + $('#pma_navigation_tree').find('a.expander').each(function () { + var $icon = $(this).find('img'); + if ($icon.is('.ic_b_minus')) { + $(this).click(); + } + }); + }); + + /** + * Register event handler to toggle + * the 'link with main panel' icon on mouseenter. + */ + $(document).on('mouseenter', '#pma_navigation_sync', function (event) { + event.preventDefault(); + var synced = $('#pma_navigation_tree').hasClass('synced'); + var $img = $('#pma_navigation_sync').children('img'); + if (synced) { + $img.removeClass('ic_s_link').addClass('ic_s_unlink'); + } else { + $img.removeClass('ic_s_unlink').addClass('ic_s_link'); + } + }); + + /** + * Register event handler to toggle + * the 'link with main panel' icon on mouseout. + */ + $(document).on('mouseout', '#pma_navigation_sync', function (event) { + event.preventDefault(); + var synced = $('#pma_navigation_tree').hasClass('synced'); + var $img = $('#pma_navigation_sync').children('img'); + if (synced) { + $img.removeClass('ic_s_unlink').addClass('ic_s_link'); + } else { + $img.removeClass('ic_s_link').addClass('ic_s_unlink'); + } + }); + + /** + * Register event handler to toggle + * the linking with main panel behavior + */ + $(document).on('click', '#pma_navigation_sync', function (event) { + event.preventDefault(); + var synced = $('#pma_navigation_tree').hasClass('synced'); + var $img = $('#pma_navigation_sync').children('img'); + if (synced) { + $img + .removeClass('ic_s_unlink') + .addClass('ic_s_link') + .attr('alt', PMA_messages.linkWithMain) + .attr('title', PMA_messages.linkWithMain); + $('#pma_navigation_tree') + .removeClass('synced') + .find('li.selected') + .removeClass('selected'); + } else { + $img + .removeClass('ic_s_link') + .addClass('ic_s_unlink') + .attr('alt', PMA_messages.unlinkWithMain) + .attr('title', PMA_messages.unlinkWithMain); + $('#pma_navigation_tree').addClass('synced'); + PMA_showCurrentNavigation(); + } + }); + + /** + * Bind all "fast filter" events + */ + $(document).on('click', '#pma_navigation_tree li.fast_filter span', PMA_fastFilter.events.clear); + $(document).on('focus', '#pma_navigation_tree li.fast_filter input.searchClause', PMA_fastFilter.events.focus); + $(document).on('blur', '#pma_navigation_tree li.fast_filter input.searchClause', PMA_fastFilter.events.blur); + $(document).on('keyup', '#pma_navigation_tree li.fast_filter input.searchClause', PMA_fastFilter.events.keyup); + + /** + * Ajax handler for pagination + */ + $(document).on('click', '#pma_navigation_tree div.pageselector a.ajax', function (event) { + event.preventDefault(); + PMA_navigationTreePagination($(this)); + }); + + /** + * Node highlighting + */ + $(document).on( + 'mouseover', + '#pma_navigation_tree.highlight li:not(.fast_filter)', + function () { + if ($('li:visible', this).length === 0) { + $(this).addClass('activePointer'); + } + } + ); + $(document).on( + 'mouseout', + '#pma_navigation_tree.highlight li:not(.fast_filter)', + function () { + $(this).removeClass('activePointer'); + } + ); + + /** Create a Routine, Trigger or Event */ + $(document).on('click', 'li.new_procedure a.ajax, li.new_function a.ajax', function (event) { + event.preventDefault(); + var dialog = new RTE.object('routine'); + dialog.editorDialog(1, $(this)); + }); + $(document).on('click', 'li.new_trigger a.ajax', function (event) { + event.preventDefault(); + var dialog = new RTE.object('trigger'); + dialog.editorDialog(1, $(this)); + }); + $(document).on('click', 'li.new_event a.ajax', function (event) { + event.preventDefault(); + var dialog = new RTE.object('event'); + dialog.editorDialog(1, $(this)); + }); + + /** Edit Routines, Triggers or Events */ + $(document).on('click', 'li.procedure > a.ajax, li.function > a.ajax', function (event) { + event.preventDefault(); + var dialog = new RTE.object('routine'); + dialog.editorDialog(0, $(this)); + }); + $(document).on('click', 'li.trigger > a.ajax', function (event) { + event.preventDefault(); + var dialog = new RTE.object('trigger'); + dialog.editorDialog(0, $(this)); + }); + $(document).on('click', 'li.event > a.ajax', function (event) { + event.preventDefault(); + var dialog = new RTE.object('event'); + dialog.editorDialog(0, $(this)); + }); + + /** Execute Routines */ + $(document).on('click', 'li.procedure div a.ajax img,' + + ' li.function div a.ajax img', function (event) { + event.preventDefault(); + var dialog = new RTE.object('routine'); + dialog.executeDialog($(this).parent()); + }); + /** Export Triggers and Events */ + $(document).on('click', 'li.trigger div:eq(1) a.ajax img,' + + ' li.event div:eq(1) a.ajax img', function (event) { + event.preventDefault(); + var dialog = new RTE.object(); + dialog.exportDialog($(this).parent()); + }); + + /** New index */ + $(document).on('click', '#pma_navigation_tree li.new_index a.ajax', function (event) { + event.preventDefault(); + var url = $(this).attr('href').substr( + $(this).attr('href').indexOf('?') + 1 + ) + PMA_commonParams.get('arg_separator') + 'ajax_request=true'; + var title = PMA_messages.strAddIndex; + indexEditorDialog(url, title); + }); + + /** Edit index */ + $(document).on('click', 'li.index a.ajax', function (event) { + event.preventDefault(); + var url = $(this).attr('href').substr( + $(this).attr('href').indexOf('?') + 1 + ) + PMA_commonParams.get('arg_separator') + 'ajax_request=true'; + var title = PMA_messages.strEditIndex; + indexEditorDialog(url, title); + }); + + /** New view */ + $(document).on('click', 'li.new_view a.ajax', function (event) { + event.preventDefault(); + PMA_createViewDialog($(this)); + }); + + /** Hide navigation tree item */ + $(document).on('click', 'a.hideNavItem.ajax', function (event) { + event.preventDefault(); + var argSep = PMA_commonParams.get('arg_separator'); + var params = $(this).getPostData(); + params += argSep + 'ajax_request=true' + argSep + 'server=' + PMA_commonParams.get('server'); + $.ajax({ + type: 'POST', + data: params, + url: $(this).attr('href'), + success: function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error); + } + } + }); + }); + + /** Display a dialog to choose hidden navigation items to show */ + $(document).on('click', 'a.showUnhide.ajax', function (event) { + event.preventDefault(); + var $msg = PMA_ajaxShowMessage(); + var argSep = PMA_commonParams.get('arg_separator'); + var params = $(this).getPostData(); + params += argSep + 'ajax_request=true'; + $.post($(this).attr('href'), params, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxRemoveMessage($msg); + var buttonOptions = {}; + buttonOptions[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + $('
        ') + .attr('id', 'unhideNavItemDialog') + .append(data.message) + .dialog({ + width: 400, + minWidth: 200, + modal: true, + buttons: buttonOptions, + title: PMA_messages.strUnhideNavItem, + close: function () { + $(this).remove(); + } + }); + } else { + PMA_ajaxShowMessage(data.error); + } + }); + }); + + /** Show a hidden navigation tree item */ + $(document).on('click', 'a.unhideNavItem.ajax', function (event) { + event.preventDefault(); + var $tr = $(this).parents('tr'); + var $msg = PMA_ajaxShowMessage(); + var argSep = PMA_commonParams.get('arg_separator'); + var params = $(this).getPostData(); + params += argSep + 'ajax_request=true' + argSep + 'server=' + PMA_commonParams.get('server'); + $.ajax({ + type: 'POST', + data: params, + url: $(this).attr('href'), + success: function (data) { + PMA_ajaxRemoveMessage($msg); + if (typeof data !== 'undefined' && data.success === true) { + $tr.remove(); + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error); + } + } + }); + }); + + // Add/Remove favorite table using Ajax. + $(document).on('click', '.favorite_table_anchor', function (event) { + event.preventDefault(); + $self = $(this); + var anchor_id = $self.attr('id'); + if ($self.data('favtargetn') !== null) { + if ($('a[data-favtargets="' + $self.data('favtargetn') + '"]').length > 0) { + $('a[data-favtargets="' + $self.data('favtargetn') + '"]').trigger('click'); + return; + } + } + + $.ajax({ + url: $self.attr('href'), + cache: false, + type: 'POST', + data: { + favorite_tables: (isStorageSupported('localStorage') && typeof window.localStorage.favorite_tables !== 'undefined') + ? window.localStorage.favorite_tables + : '', + server: PMA_commonParams.get('server'), + }, + success: function (data) { + if (data.changes) { + $('#pma_favorite_list').html(data.list); + $('#' + anchor_id).parent().html(data.anchor); + PMA_tooltip( + $('#' + anchor_id), + 'a', + $('#' + anchor_id).attr('title') + ); + // Update localStorage. + if (isStorageSupported('localStorage')) { + window.localStorage.favorite_tables = data.favorite_tables; + } + } else { + PMA_ajaxShowMessage(data.message); + } + } + }); + }); + // Check if session storage is supported + if (isStorageSupported('sessionStorage')) { + var storage = window.sessionStorage; + // remove tree from storage if Navi_panel config form is submitted + $(document).on('submit', 'form.config-form', function (event) { + storage.removeItem('navTreePaths'); + }); + // Initialize if no previous state is defined + if ($('#pma_navigation_tree_content').length && + typeof storage.navTreePaths === 'undefined' + ) { + PMA_reloadNavigation(); + } else if (PMA_commonParams.get('server') === storage.server && + PMA_commonParams.get('token') === storage.token + ) { + // Reload the tree to the state before page refresh + PMA_reloadNavigation(navFilterStateRestore, JSON.parse(storage.navTreePaths)); + } else { + // If the user is different + navTreeStateUpdate(); + } + } +}); + +/** + * Expands a node in navigation tree. + * + * @param $expandElem expander + * @param callback callback function + * + * @returns void + */ +function expandTreeNode ($expandElem, callback) { + var $children = $expandElem.closest('li').children('div.list_container'); + var $icon = $expandElem.find('img'); + if ($expandElem.hasClass('loaded')) { + if ($icon.is('.ic_b_plus')) { + $icon.removeClass('ic_b_plus').addClass('ic_b_minus'); + $children.slideDown('fast'); + } + if (callback && typeof callback === 'function') { + callback.call(); + } + $children.promise().done(navTreeStateUpdate); + } else { + var $throbber = $('#pma_navigation').find('.throbber') + .first() + .clone() + .css({ visibility: 'visible', display: 'block' }) + .click(false); + $icon.hide(); + $throbber.insertBefore($icon); + + loadChildNodes(true, $expandElem, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + var $destination = $expandElem.closest('li'); + $icon.removeClass('ic_b_plus').addClass('ic_b_minus'); + $children = $destination.children('div.list_container'); + $children.slideDown('fast'); + if ($destination.find('ul > li').length === 1) { + $destination.find('ul > li') + .find('a.expander.container') + .click(); + } + if (callback && typeof callback === 'function') { + callback.call(); + } + PMA_showFullName($destination); + } else { + PMA_ajaxShowMessage(data.error, false); + } + $icon.show(); + $throbber.remove(); + $children.promise().done(navTreeStateUpdate); + }); + } + $expandElem.blur(); +} + +/** + * Auto-scrolls the newly chosen database + * + * @param object $element The element to set to view + * @param boolean $forceToTop Whether to force scroll to top + * + */ +function scrollToView ($element, $forceToTop) { + navFilterStateRestore(); + var $container = $('#pma_navigation_tree_content'); + var elemTop = $element.offset().top - $container.offset().top; + var textHeight = 20; + var scrollPadding = 20; // extra padding from top of bottom when scrolling to view + if (elemTop < 0 || $forceToTop) { + $container.stop().animate({ + scrollTop: elemTop + $container.scrollTop() - scrollPadding + }); + } else if (elemTop + textHeight > $container.height()) { + $container.stop().animate({ + scrollTop: elemTop + textHeight - $container.height() + $container.scrollTop() + scrollPadding + }); + } +} + +/** + * Expand the navigation and highlight the current database or table/view + * + * @returns void + */ +function PMA_showCurrentNavigation () { + var db = PMA_commonParams.get('db'); + var table = PMA_commonParams.get('table'); + $('#pma_navigation_tree') + .find('li.selected') + .removeClass('selected'); + if (db) { + var $dbItem = findLoadedItem( + $('#pma_navigation_tree').find('> div'), db, 'database', !table + ); + if ($('#navi_db_select').length && + $('option:selected', $('#navi_db_select')).length + ) { + if (! PMA_selectCurrentDb()) { + return; + } + // If loaded database in navigation is not same as current one + if ($('#pma_navigation_tree_content').find('span.loaded_db:first').text() + !== $('#navi_db_select').val() + ) { + loadChildNodes(false, $('option:selected', $('#navi_db_select')), function (data) { + handleTableOrDb(table, $('#pma_navigation_tree_content')); + var $children = $('#pma_navigation_tree_content').children('div.list_container'); + $children.promise().done(navTreeStateUpdate); + }); + } else { + handleTableOrDb(table, $('#pma_navigation_tree_content')); + } + } else if ($dbItem) { + var $expander = $dbItem.children('div:first').children('a.expander'); + // if not loaded or loaded but collapsed + if (! $expander.hasClass('loaded') || + $expander.find('img').is('.ic_b_plus') + ) { + expandTreeNode($expander, function () { + handleTableOrDb(table, $dbItem); + }); + } else { + handleTableOrDb(table, $dbItem); + } + } + } else if ($('#navi_db_select').length && $('#navi_db_select').val()) { + $('#navi_db_select').val('').hide().trigger('change'); + } + PMA_showFullName($('#pma_navigation_tree')); + + function handleTableOrDb (table, $dbItem) { + if (table) { + loadAndHighlightTableOrView($dbItem, table); + } else { + var $container = $dbItem.children('div.list_container'); + var $tableContainer = $container.children('ul').children('li.tableContainer'); + if ($tableContainer.length > 0) { + var $expander = $tableContainer.children('div:first').children('a.expander'); + $tableContainer.addClass('selected'); + expandTreeNode($expander, function () { + scrollToView($dbItem, true); + }); + } else { + scrollToView($dbItem, true); + } + } + } + + function findLoadedItem ($container, name, clazz, doSelect) { + var ret = false; + $container.children('ul').children('li').each(function () { + var $li = $(this); + // this is a navigation group, recurse + if ($li.is('.navGroup')) { + var $container = $li.children('div.list_container'); + var $childRet = findLoadedItem( + $container, name, clazz, doSelect + ); + if ($childRet) { + ret = $childRet; + return false; + } + } else { // this is a real navigation item + // name and class matches + if (((clazz && $li.is('.' + clazz)) || ! clazz) && + $li.children('a').text() === name) { + if (doSelect) { + $li.addClass('selected'); + } + // taverse up and expand and parent navigation groups + $li.parents('.navGroup').each(function () { + var $cont = $(this).children('div.list_container'); + if (! $cont.is(':visible')) { + $(this) + .children('div:first') + .children('a.expander') + .click(); + } + }); + ret = $li; + return false; + } + } + }); + return ret; + } + + function loadAndHighlightTableOrView ($dbItem, itemName) { + var $container = $dbItem.children('div.list_container'); + var $expander; + var $whichItem = isItemInContainer($container, itemName, 'li.table, li.view'); + // If item already there in some container + if ($whichItem) { + // get the relevant container while may also be a subcontainer + var $relatedContainer = $whichItem.closest('li.subContainer').length + ? $whichItem.closest('li.subContainer') + : $dbItem; + $whichItem = findLoadedItem( + $relatedContainer.children('div.list_container'), + itemName, null, true + ); + // Show directly + showTableOrView($whichItem, $relatedContainer.children('div:first').children('a.expander')); + // else if item not there, try loading once + } else { + var $sub_containers = $dbItem.find('.subContainer'); + // If there are subContainers i.e. tableContainer or viewContainer + if ($sub_containers.length > 0) { + var $containers = []; + $sub_containers.each(function (index) { + $containers[index] = $(this); + $expander = $containers[index] + .children('div:first') + .children('a.expander'); + if (! $expander.hasClass('loaded')) { + loadAndShowTableOrView($expander, $containers[index], itemName); + } + }); + // else if no subContainers + } else { + $expander = $dbItem + .children('div:first') + .children('a.expander'); + if (! $expander.hasClass('loaded')) { + loadAndShowTableOrView($expander, $dbItem, itemName); + } + } + } + } + + function loadAndShowTableOrView ($expander, $relatedContainer, itemName) { + loadChildNodes(true, $expander, function (data) { + var $whichItem = findLoadedItem( + $relatedContainer.children('div.list_container'), + itemName, null, true + ); + if ($whichItem) { + showTableOrView($whichItem, $expander); + } + }); + } + + function showTableOrView ($whichItem, $expander) { + expandTreeNode($expander, function (data) { + if ($whichItem) { + scrollToView($whichItem, false); + } + }); + } + + function isItemInContainer ($container, name, clazz) { + var $whichItem = null; + $items = $container.find(clazz); + var found = false; + $items.each(function () { + if ($(this).children('a').text() === name) { + $whichItem = $(this); + return false; + } + }); + return $whichItem; + } +} + +/** + * Disable navigation panel settings + * + * @return void + */ +function PMA_disableNaviSettings () { + $('#pma_navigation_settings_icon').addClass('hide'); + $('#pma_navigation_settings').remove(); +} + +/** + * Ensure that navigation panel settings is properly setup. + * If not, set it up + * + * @return void + */ +function PMA_ensureNaviSettings (selflink) { + $('#pma_navigation_settings_icon').removeClass('hide'); + + if (!$('#pma_navigation_settings').length) { + var params = { + getNaviSettings: true, + server: PMA_commonParams.get('server'), + }; + var url = $('#pma_navigation').find('a.navigation_url').attr('href'); + $.post(url, params, function (data) { + if (typeof data !== 'undefined' && data.success) { + $('#pma_navi_settings_container').html(data.message); + setupRestoreField(); + setupValidation(); + setupConfigTabs(); + $('#pma_navigation_settings').find('form').attr('action', selflink); + } else { + PMA_ajaxShowMessage(data.error); + } + }); + } else { + $('#pma_navigation_settings').find('form').attr('action', selflink); + } +} + +/** + * Reloads the whole navigation tree while preserving its state + * + * @param function the callback function + * @param Object stored navigation paths + * + * @return void + */ +function PMA_reloadNavigation (callback, paths) { + var params = { + reload: true, + no_debug: true, + server: PMA_commonParams.get('server'), + }; + paths = paths || traverseNavigationForPaths(); + $.extend(params, paths); + if ($('#navi_db_select').length) { + params.db = PMA_commonParams.get('db'); + requestNaviReload(params); + return; + } + requestNaviReload(params); + + function requestNaviReload (params) { + var url = $('#pma_navigation').find('a.navigation_url').attr('href'); + $.post(url, params, function (data) { + if (typeof data !== 'undefined' && data.success) { + $('#pma_navigation_tree').html(data.message).children('div').show(); + if ($('#pma_navigation_tree').hasClass('synced')) { + PMA_selectCurrentDb(); + PMA_showCurrentNavigation(); + } + // Fire the callback, if any + if (typeof callback === 'function') { + callback.call(); + } + navTreeStateUpdate(); + } else { + PMA_ajaxShowMessage(data.error); + } + }); + } +} + +function PMA_selectCurrentDb () { + var $naviDbSelect = $('#navi_db_select'); + + if (!$naviDbSelect.length) { + return false; + } + + if (PMA_commonParams.get('db')) { // db selected + $naviDbSelect.show(); + } + + $naviDbSelect.val(PMA_commonParams.get('db')); + return $naviDbSelect.val() === PMA_commonParams.get('db'); +} + +/** + * Handles any requests to change the page in a branch of a tree + * + * This can be called from link click or select change event handlers + * + * @param object $this A jQuery object that points to the element that + * initiated the action of changing the page + * + * @return void + */ +function PMA_navigationTreePagination ($this) { + var $msgbox = PMA_ajaxShowMessage(); + var isDbSelector = $this.closest('div.pageselector').is('.dbselector'); + var url = 'navigation.php'; + var params = 'ajax_request=true'; + if ($this[0].tagName === 'A') { + params += PMA_commonParams.get('arg_separator') + $this.getPostData(); + } else { // tagName === 'SELECT' + params += PMA_commonParams.get('arg_separator') + $this.closest('form').serialize(); + } + var searchClause = PMA_fastFilter.getSearchClause(); + if (searchClause) { + params += PMA_commonParams.get('arg_separator') + 'searchClause=' + encodeURIComponent(searchClause); + } + if (isDbSelector) { + params += PMA_commonParams.get('arg_separator') + 'full=true'; + } else { + var searchClause2 = PMA_fastFilter.getSearchClause2($this); + if (searchClause2) { + params += PMA_commonParams.get('arg_separator') + 'searchClause2=' + encodeURIComponent(searchClause2); + } + } + $.post(url, params, function (data) { + if (typeof data !== 'undefined' && data.success) { + PMA_ajaxRemoveMessage($msgbox); + if (isDbSelector) { + var val = PMA_fastFilter.getSearchClause(); + $('#pma_navigation_tree') + .html(data.message) + .children('div') + .show(); + if (val) { + $('#pma_navigation_tree') + .find('li.fast_filter input.searchClause') + .val(val); + } + } else { + var $parent = $this.closest('div.list_container').parent(); + var val = PMA_fastFilter.getSearchClause2($this); + $this.closest('div.list_container').html( + $(data.message).children().show() + ); + if (val) { + $parent.find('li.fast_filter input.searchClause').val(val); + } + $parent.find('span.pos2_value:first').text( + $parent.find('span.pos2_value:last').text() + ); + $parent.find('span.pos3_value:first').text( + $parent.find('span.pos3_value:last').text() + ); + } + } else { + PMA_ajaxShowMessage(data.error); + PMA_handleRedirectAndReload(data); + } + navTreeStateUpdate(); + }); +} + +/** + * @var ResizeHandler Custom object that manages the resizing of the navigation + * + * XXX: Must only be ever instanciated once + * XXX: Inside event handlers the 'this' object is accessed as 'event.data.resize_handler' + */ +var ResizeHandler = function () { + /** + * @var int panel_width Used by the collapser to know where to go + * back to when uncollapsing the panel + */ + this.panel_width = 0; + /** + * @var string left Used to provide support for RTL languages + */ + this.left = $('html').attr('dir') === 'ltr' ? 'left' : 'right'; + /** + * Adjusts the width of the navigation panel to the specified value + * + * @param int pos Navigation width in pixels + * + * @return void + */ + this.setWidth = function (pos) { + if (typeof pos !== 'number') { + pos = 240; + } + var $resizer = $('#pma_navigation_resizer'); + var resizer_width = $resizer.width(); + var $collapser = $('#pma_navigation_collapser'); + var windowWidth = $(window).width(); + $('#pma_navigation').width(pos); + $('body').css('margin-' + this.left, pos + 'px'); + // Issue #15127 : Adding fixed positioning to menubar + // Issue #15570 : Panels on homescreen go underneath of floating menubar + $('#floating_menubar') + .css('margin-' + this.left, $('#pma_navigation').width() + $('#pma_navigation_resizer').width()) + .css(this.left, 0) + .css({ + 'position': 'fixed', + 'top': 0, + 'width': '100%', + 'z-index': 99 + }) + .append($('#serverinfo')) + .append($('#topmenucontainer')); + // Allow the DOM to render, then adjust the padding on the body + setTimeout(function () { + $('body').css( + 'padding-top', + $('#floating_menubar').outerHeight(true) + ); + }, 2); + $('#pma_console') + .css('margin-' + this.left, (pos + resizer_width) + 'px'); + $resizer.css(this.left, pos + 'px'); + if (pos === 0) { + $collapser + .css(this.left, pos + resizer_width) + .html(this.getSymbol(pos)) + .prop('title', PMA_messages.strShowPanel); + } else if (windowWidth > 768) { + $collapser + .css(this.left, pos) + .html(this.getSymbol(pos)) + .prop('title', PMA_messages.strHidePanel); + $('#pma_navigation_resizer').css({ 'width': '3px' }); + } else { + $collapser + .css(this.left, windowWidth - 22) + .html(this.getSymbol(100)) + .prop('title', PMA_messages.strHidePanel); + $('#pma_navigation').width(windowWidth); + $('body').css('margin-' + this.left, '0px'); + $('#pma_navigation_resizer').css({ 'width': '0px' }); + } + setTimeout(function () { + $(window).trigger('resize'); + }, 4); + }; + /** + * Returns the horizontal position of the mouse, + * relative to the outer side of the navigation panel + * + * @param int pos Navigation width in pixels + * + * @return void + */ + this.getPos = function (event) { + var pos = event.pageX; + var windowWidth = $(window).width(); + var windowScroll = $(window).scrollLeft(); + pos = pos - windowScroll; + if (this.left !== 'left') { + pos = windowWidth - event.pageX; + } + if (pos < 0) { + pos = 0; + } else if (pos + 100 >= windowWidth) { + pos = windowWidth - 100; + } else { + this.panel_width = 0; + } + return pos; + }; + /** + * Returns the HTML code for the arrow symbol used in the collapser + * + * @param int width The width of the panel + * + * @return string + */ + this.getSymbol = function (width) { + if (this.left === 'left') { + if (width === 0) { + return '→'; + } else { + return '←'; + } + } else { + if (width === 0) { + return '←'; + } else { + return '→'; + } + } + }; + /** + * Event handler for initiating a resize of the panel + * + * @param object e Event data (contains a reference to resizeHandler) + * + * @return void + */ + this.mousedown = function (event) { + event.preventDefault(); + $(document) + .on('mousemove', { 'resize_handler': event.data.resize_handler }, + $.throttle(event.data.resize_handler.mousemove, 4)) + .on('mouseup', { 'resize_handler': event.data.resize_handler }, + event.data.resize_handler.mouseup); + $('body').css('cursor', 'col-resize'); + }; + /** + * Event handler for terminating a resize of the panel + * + * @param object e Event data (contains a reference to resizeHandler) + * + * @return void + */ + this.mouseup = function (event) { + $('body').css('cursor', ''); + configSet('NavigationWidth', event.data.resize_handler.getPos(event)); + $('#topmenu').menuResizer('resize'); + $(document) + .off('mousemove') + .off('mouseup'); + }; + /** + * Event handler for updating the panel during a resize operation + * + * @param object e Event data (contains a reference to resizeHandler) + * + * @return void + */ + this.mousemove = function (event) { + event.preventDefault(); + var pos = event.data.resize_handler.getPos(event); + event.data.resize_handler.setWidth(pos); + if ($('.sticky_columns').length !== 0) { + handleAllStickyColumns(); + } + }; + /** + * Event handler for collapsing the panel + * + * @param object e Event data (contains a reference to resizeHandler) + * + * @return void + */ + this.collapse = function (event) { + event.preventDefault(); + var panel_width = event.data.resize_handler.panel_width; + var width = $('#pma_navigation').width(); + if (width === 0 && panel_width === 0) { + panel_width = 240; + } + configSet('NavigationWidth', panel_width); + event.data.resize_handler.setWidth(panel_width); + event.data.resize_handler.panel_width = width; + }; + /** + * Event handler for resizing the navigation tree height on window resize + * + * @return void + */ + this.treeResize = function (event) { + var $nav = $('#pma_navigation'); + var $nav_tree = $('#pma_navigation_tree'); + var $nav_header = $('#pma_navigation_header'); + var $nav_tree_content = $('#pma_navigation_tree_content'); + $nav_tree.height($nav.height() - $nav_header.height()); + if ($nav_tree_content.length > 0) { + $nav_tree_content.height($nav_tree.height() - $nav_tree_content.position().top); + } else { + // TODO: in fast filter search response there is no #pma_navigation_tree_content, needs to be added in php + $nav_tree.css({ + 'overflow-y': 'auto' + }); + } + // Set content bottom space beacuse of console + $('body').css('margin-bottom', $('#pma_console').height() + 'px'); + }; + // Hide the pma_navigation initially when loaded on mobile + if ($(window).width() < 768) { + this.setWidth(0); + } else { + this.setWidth(configGet('NavigationWidth', false)); + $('#topmenu').menuResizer('resize'); + } + // Register the events for the resizer and the collapser + $(document).on('mousedown', '#pma_navigation_resizer', { 'resize_handler': this }, this.mousedown); + $(document).on('click', '#pma_navigation_collapser', { 'resize_handler': this }, this.collapse); + + // Add the correct arrow symbol to the collapser + $('#pma_navigation_collapser').html(this.getSymbol($('#pma_navigation').width())); + // Fix navigation tree height + $(window).on('resize', this.treeResize); + // need to call this now and then, browser might decide + // to show/hide horizontal scrollbars depending on page content width + setInterval(this.treeResize, 2000); + this.treeResize(); +}; // End of ResizeHandler + +/** + * @var object PMA_fastFilter Handles the functionality that allows filtering + * of the items in a branch of the navigation tree + */ +var PMA_fastFilter = { + /** + * Construct for the asynchronous fast filter functionality + * + * @param object $this A jQuery object pointing to the list container + * which is the nearest parent of the fast filter + * @param string searchClause The query string for the filter + * + * @return new PMA_fastFilter.filter object + */ + filter: function ($this, searchClause) { + /** + * @var object $this A jQuery object pointing to the list container + * which is the nearest parent of the fast filter + */ + this.$this = $this; + /** + * @var bool searchClause The query string for the filter + */ + this.searchClause = searchClause; + /** + * @var object $clone A clone of the original contents + * of the navigation branch before + * the fast filter was applied + */ + this.$clone = $this.clone(); + /** + * @var object xhr A reference to the ajax request that is currently running + */ + this.xhr = null; + /** + * @var int timeout Used to delay the request for asynchronous search + */ + this.timeout = null; + + var $filterInput = $this.find('li.fast_filter input.searchClause'); + if ($filterInput.length !== 0 && + $filterInput.val() !== '' && + $filterInput.val() !== $filterInput[0].defaultValue + ) { + this.request(); + } + }, + /** + * Gets the query string from the database fast filter form + * + * @return string + */ + getSearchClause: function () { + var retval = ''; + var $input = $('#pma_navigation_tree') + .find('li.fast_filter.db_fast_filter input.searchClause'); + if ($input.length && $input.val() !== $input[0].defaultValue) { + retval = $input.val(); + } + return retval; + }, + /** + * Gets the query string from a second level item's fast filter form + * The retrieval is done by trasversing the navigation tree backwards + * + * @return string + */ + getSearchClause2: function ($this) { + var $filterContainer = $this.closest('div.list_container'); + var $filterInput = $([]); + if ($filterContainer + .find('li.fast_filter:not(.db_fast_filter) input.searchClause') + .length !== 0) { + $filterInput = $filterContainer + .find('li.fast_filter:not(.db_fast_filter) input.searchClause'); + } + var searchClause2 = ''; + if ($filterInput.length !== 0 && + $filterInput.first().val() !== $filterInput[0].defaultValue + ) { + searchClause2 = $filterInput.val(); + } + return searchClause2; + }, + /** + * @var hash events A list of functions that are bound to DOM events + * at the top of this file + */ + events: { + focus: function (event) { + var $obj = $(this).closest('div.list_container'); + if (! $obj.data('fastFilter')) { + $obj.data( + 'fastFilter', + new PMA_fastFilter.filter($obj, $(this).val()) + ); + } + if ($(this).val() === this.defaultValue) { + $(this).val(''); + } else { + $(this).select(); + } + }, + blur: function (event) { + if ($(this).val() === '') { + $(this).val(this.defaultValue); + } + var $obj = $(this).closest('div.list_container'); + if ($(this).val() === this.defaultValue && $obj.data('fastFilter')) { + $obj.data('fastFilter').restore(); + } + }, + keyup: function (event) { + var $obj = $(this).closest('div.list_container'); + var str = ''; + if ($(this).val() !== this.defaultValue && $(this).val() !== '') { + $obj.find('div.pageselector').hide(); + str = $(this).val(); + } + + /** + * FIXME at the server level a value match is done while on + * the client side it is a regex match. These two should be aligned + */ + + // regex used for filtering. + var regex; + try { + regex = new RegExp(str, 'i'); + } catch (err) { + return; + } + + // this is the div that houses the items to be filtered by this filter. + var outerContainer; + if ($(this).closest('li.fast_filter').is('.db_fast_filter')) { + outerContainer = $('#pma_navigation_tree_content'); + } else { + outerContainer = $obj; + } + + // filters items that are directly under the div as well as grouped in + // groups. Does not filter child items (i.e. a database search does + // not filter tables) + var item_filter = function ($curr) { + $curr.children('ul').children('li.navGroup').each(function () { + $(this).children('div.list_container').each(function () { + item_filter($(this)); // recursive + }); + }); + $curr.children('ul').children('li').children('a').not('.container').each(function () { + if (regex.test($(this).text())) { + $(this).parent().show().removeClass('hidden'); + } else { + $(this).parent().hide().addClass('hidden'); + } + }); + }; + item_filter(outerContainer); + + // hides containers that does not have any visible children + var container_filter = function ($curr) { + $curr.children('ul').children('li.navGroup').each(function () { + var $group = $(this); + $group.children('div.list_container').each(function () { + container_filter($(this)); // recursive + }); + $group.show().removeClass('hidden'); + if ($group.children('div.list_container').children('ul') + .children('li').not('.hidden').length === 0) { + $group.hide().addClass('hidden'); + } + }); + }; + container_filter(outerContainer); + + if ($(this).val() !== this.defaultValue && $(this).val() !== '') { + if (! $obj.data('fastFilter')) { + $obj.data( + 'fastFilter', + new PMA_fastFilter.filter($obj, $(this).val()) + ); + } else { + if (event.keyCode === 13) { + $obj.data('fastFilter').update($(this).val()); + } + } + } else if ($obj.data('fastFilter')) { + $obj.data('fastFilter').restore(true); + } + // update filter state + var filterName; + if ($(this).attr('name') === 'searchClause2') { + filterName = $(this).siblings('input[name=aPath]').val(); + } else { + filterName = 'dbFilter'; + } + navFilterStateUpdate(filterName, $(this).val()); + }, + clear: function (event) { + event.stopPropagation(); + // Clear the input and apply the fast filter with empty input + var filter = $(this).closest('div.list_container').data('fastFilter'); + if (filter) { + filter.restore(); + } + var value = $(this).prev()[0].defaultValue; + $(this).prev().val(value).trigger('keyup'); + } + } +}; +/** + * Handles a change in the search clause + * + * @param string searchClause The query string for the filter + * + * @return void + */ +PMA_fastFilter.filter.prototype.update = function (searchClause) { + if (this.searchClause !== searchClause) { + this.searchClause = searchClause; + this.request(); + } +}; +/** + * After a delay of 250mS, initiates a request to retrieve search results + * Multiple calls to this function will always abort the previous request + * + * @return void + */ +PMA_fastFilter.filter.prototype.request = function () { + var self = this; + if (self.$this.find('li.fast_filter').find('img.throbber').length === 0) { + self.$this.find('li.fast_filter').append( + $('
        ').append( + $('#pma_navigation_content') + .find('img.throbber') + .clone() + .css({ visibility: 'visible', display: 'block' }) + ) + ); + } + if (self.xhr) { + self.xhr.abort(); + } + var url = $('#pma_navigation').find('a.navigation_url').attr('href'); + var params = self.$this.find('> ul > li > form.fast_filter').first().serialize(); + + if (self.$this.find('> ul > li > form.fast_filter:first input[name=searchClause]').length === 0) { + var $input = $('#pma_navigation_tree').find('li.fast_filter.db_fast_filter input.searchClause'); + if ($input.length && $input.val() !== $input[0].defaultValue) { + params += PMA_commonParams.get('arg_separator') + 'searchClause=' + encodeURIComponent($input.val()); + } + } + self.xhr = $.ajax({ + url: url, + type: 'post', + dataType: 'json', + data: params, + complete: function (jqXHR, status) { + if (status !== 'abort') { + var data = JSON.parse(jqXHR.responseText); + self.$this.find('li.fast_filter').find('div.throbber').remove(); + if (data && data.results) { + self.swap.apply(self, [data.message]); + } + } + } + }); +}; +/** + * Replaces the contents of the navigation branch with the search results + * + * @param string list The search results + * + * @return void + */ +PMA_fastFilter.filter.prototype.swap = function (list) { + this.$this + .html($(list).html()) + .children() + .show() + .end() + .find('li.fast_filter input.searchClause') + .val(this.searchClause); + this.$this.data('fastFilter', this); +}; +/** + * Restores the navigation to the original state after the fast filter is cleared + * + * @param bool focus Whether to also focus the input box of the fast filter + * + * @return void + */ +PMA_fastFilter.filter.prototype.restore = function (focus) { + if (this.$this.children('ul').first().hasClass('search_results')) { + this.$this.html(this.$clone.html()).children().show(); + this.$this.data('fastFilter', this); + if (focus) { + this.$this.find('li.fast_filter input.searchClause').focus(); + } + } + this.searchClause = ''; + this.$this.find('div.pageselector').show(); + this.$this.find('div.throbber').remove(); +}; + +/** + * Show full name when cursor hover and name not shown completely + * + * @param object $containerELem Container element + * + * @return void + */ +function PMA_showFullName ($containerELem) { + $containerELem.find('.hover_show_full').mouseenter(function () { + /** mouseenter */ + var $this = $(this); + var thisOffset = $this.offset(); + if ($this.text() === '') { + return; + } + var $parent = $this.parent(); + if (($parent.offset().left + $parent.outerWidth()) + < (thisOffset.left + $this.outerWidth())) { + var $fullNameLayer = $('#full_name_layer'); + if ($fullNameLayer.length === 0) { + $('body').append('
        '); + $('#full_name_layer').mouseleave(function () { + /** mouseleave */ + $(this).addClass('hide') + .removeClass('hovering'); + }).mouseenter(function () { + /** mouseenter */ + $(this).addClass('hovering'); + }); + $fullNameLayer = $('#full_name_layer'); + } + $fullNameLayer.removeClass('hide'); + $fullNameLayer.css({ left: thisOffset.left, top: thisOffset.top }); + $fullNameLayer.html($this.clone()); + setTimeout(function () { + if (! $fullNameLayer.hasClass('hovering')) { + $fullNameLayer.trigger('mouseleave'); + } + }, 200); + } + }); +} diff --git a/phpMyAdmin/js/normalization.js b/phpMyAdmin/js/normalization.js new file mode 100755 index 0000000..fa486d2 --- /dev/null +++ b/phpMyAdmin/js/normalization.js @@ -0,0 +1,745 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview events handling from normalization page + * @name normalization + * + * @requires jQuery + */ + +/** + * AJAX scripts for normalization.php + * + */ + +var normalizeto = '1nf'; +var primary_key; +var data_parsed = null; +function appendHtmlColumnsList () { + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'getColumns': true + }, + function (data) { + if (data.success === true) { + $('select[name=makeAtomic]').html(data.message); + } + } + ); +} +function goTo3NFStep1 (newTables) { + if (Object.keys(newTables).length === 1) { + newTables = [PMA_commonParams.get('table')]; + } + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'server': PMA_commonParams.get('server'), + 'tables': newTables, + 'step': '3.1' + }, function (data) { + $('#page_content').find('h3').html(PMA_messages.str3NFNormalization); + $('#mainContent').find('legend').html(data.legendText); + $('#mainContent').find('h4').html(data.headText); + $('#mainContent').find('p').html(data.subText); + $('#mainContent').find('#extra').html(data.extra); + $('#extra').find('form').each(function () { + var form_id = $(this).attr('id'); + var colname = $(this).data('colname'); + $('#' + form_id + ' input[value=\'' + colname + '\']').next().remove(); + $('#' + form_id + ' input[value=\'' + colname + '\']').remove(); + }); + $('#mainContent').find('#newCols').html(''); + $('.tblFooters').html(''); + + if (data.subText !== '') { + $('') + .attr({ type: 'button', value: PMA_messages.strDone }) + .on('click', function () { + processDependencies('', true); + }) + .appendTo('.tblFooters'); + } + } + ); +} +function goTo2NFStep1 () { + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'step': '2.1' + }, function (data) { + $('#page_content h3').html(PMA_messages.str2NFNormalization); + $('#mainContent legend').html(data.legendText); + $('#mainContent h4').html(data.headText); + $('#mainContent p').html(data.subText); + $('#mainContent #extra').html(data.extra); + $('#mainContent #newCols').html(''); + if (data.subText !== '') { + var doneButton = $('') + .attr({ type: 'submit', value: PMA_messages.strDone, }) + .on('click', function () { + processDependencies(data.primary_key); + }) + .appendTo('.tblFooters'); + } else { + if (normalizeto === '3nf') { + $('#mainContent #newCols').html(PMA_messages.strToNextStep); + setTimeout(function () { + goTo3NFStep1([PMA_commonParams.get('table')]); + }, 3000); + } + } + }); +} + +function goToFinish1NF () { + if (normalizeto !== '1nf') { + goTo2NFStep1(); + return true; + } + $('#mainContent legend').html(PMA_messages.strEndStep); + $('#mainContent h4').html( + '

        ' + PMA_sprintf(PMA_messages.strFinishMsg, escapeHtml(PMA_commonParams.get('table'))) + '

        ' + ); + $('#mainContent p').html(''); + $('#mainContent #extra').html(''); + $('#mainContent #newCols').html(''); + $('.tblFooters').html(''); +} + +function goToStep4 () { + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'step4': true + }, function (data) { + $('#mainContent legend').html(data.legendText); + $('#mainContent h4').html(data.headText); + $('#mainContent p').html(data.subText); + $('#mainContent #extra').html(data.extra); + $('#mainContent #newCols').html(''); + $('.tblFooters').html(''); + for (var pk in primary_key) { + $('#extra input[value=\'' + escapeJsString(primary_key[pk]) + '\']').attr('disabled','disabled'); + } + } + ); +} + +function goToStep3 () { + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'step3': true + }, function (data) { + $('#mainContent legend').html(data.legendText); + $('#mainContent h4').html(data.headText); + $('#mainContent p').html(data.subText); + $('#mainContent #extra').html(data.extra); + $('#mainContent #newCols').html(''); + $('.tblFooters').html(''); + primary_key = JSON.parse(data.primary_key); + for (var pk in primary_key) { + $('#extra input[value=\'' + escapeJsString(primary_key[pk]) + '\']').attr('disabled','disabled'); + } + } + ); +} + +function goToStep2 (extra) { + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'step2': true + }, function (data) { + $('#mainContent legend').html(data.legendText); + $('#mainContent h4').html(data.headText); + $('#mainContent p').html(data.subText); + $('#mainContent #extra,#mainContent #newCols').html(''); + $('.tblFooters').html(''); + if (data.hasPrimaryKey === '1') { + if (extra === 'goToStep3') { + $('#mainContent h4').html(PMA_messages.strPrimaryKeyAdded); + $('#mainContent p').html(PMA_messages.strToNextStep); + } + if (extra === 'goToFinish1NF') { + goToFinish1NF(); + } else { + setTimeout(function () { + goToStep3(); + }, 3000); + } + } else { + // form to select columns to make primary + $('#mainContent #extra').html(data.extra); + } + } + ); +} + +function goTo2NFFinish (pd) { + var tables = {}; + for (var dependson in pd) { + tables[dependson] = $('#extra input[name="' + dependson + '"]').val(); + } + datastring = { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'pd': JSON.stringify(pd), + 'newTablesName':JSON.stringify(tables), + 'createNewTables2NF':1 }; + $.ajax({ + type: 'POST', + url: 'normalization.php', + data: datastring, + async:false, + success: function (data) { + if (data.success === true) { + if (data.queryError === false) { + if (normalizeto === '3nf') { + $('#pma_navigation_reload').click(); + goTo3NFStep1(tables); + return true; + } + $('#mainContent legend').html(data.legendText); + $('#mainContent h4').html(data.headText); + $('#mainContent p').html(''); + $('#mainContent #extra').html(''); + $('.tblFooters').html(''); + } else { + PMA_ajaxShowMessage(data.extra, false); + } + $('#pma_navigation_reload').click(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + }); +} + +function goTo3NFFinish (newTables) { + for (var table in newTables) { + for (var newtbl in newTables[table]) { + var updatedname = $('#extra input[name="' + newtbl + '"]').val(); + newTables[table][updatedname] = newTables[table][newtbl]; + if (updatedname !== newtbl) { + delete newTables[table][newtbl]; + } + } + } + datastring = { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'server': PMA_commonParams.get('server'), + 'newTables':JSON.stringify(newTables), + 'createNewTables3NF':1 }; + $.ajax({ + type: 'POST', + url: 'normalization.php', + data: datastring, + async:false, + success: function (data) { + if (data.success === true) { + if (data.queryError === false) { + $('#mainContent legend').html(data.legendText); + $('#mainContent h4').html(data.headText); + $('#mainContent p').html(''); + $('#mainContent #extra').html(''); + $('.tblFooters').html(''); + } else { + PMA_ajaxShowMessage(data.extra, false); + } + $('#pma_navigation_reload').click(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + }); +} +var backup = ''; +function goTo2NFStep2 (pd, primary_key) { + $('#newCols').html(''); + $('#mainContent legend').html(PMA_messages.strStep + ' 2.2 ' + PMA_messages.strConfirmPd); + $('#mainContent h4').html(PMA_messages.strSelectedPd); + $('#mainContent p').html(PMA_messages.strPdHintNote); + var extra = '
        '; + var pdFound = false; + for (var dependson in pd) { + if (dependson !== primary_key) { + pdFound = true; + extra += '

        ' + escapeHtml(dependson) + ' -> ' + escapeHtml(pd[dependson].toString()) + '

        '; + } + } + if (!pdFound) { + extra += '

        ' + PMA_messages.strNoPdSelected + '

        '; + extra += '
        '; + } else { + extra += '
        '; + datastring = { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'pd': JSON.stringify(pd), + 'getNewTables2NF':1 }; + $.ajax({ + type: 'POST', + url: 'normalization.php', + data: datastring, + async:false, + success: function (data) { + if (data.success === true) { + extra += data.message; + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + }); + } + $('#mainContent #extra').html(extra); + $('.tblFooters').html(''); + $('#goTo2NFFinish').click(function () { + goTo2NFFinish(pd); + }); +} + +function goTo3NFStep2 (pd, tablesTds) { + $('#newCols').html(''); + $('#mainContent legend').html(PMA_messages.strStep + ' 3.2 ' + PMA_messages.strConfirmTd); + $('#mainContent h4').html(PMA_messages.strSelectedTd); + $('#mainContent p').html(PMA_messages.strPdHintNote); + var extra = '
        '; + var pdFound = false; + for (var table in tablesTds) { + for (var i in tablesTds[table]) { + dependson = tablesTds[table][i]; + if (dependson !== '' && dependson !== table) { + pdFound = true; + extra += '

        ' + escapeHtml(dependson) + ' -> ' + escapeHtml(pd[dependson].toString()) + '

        '; + } + } + } + if (!pdFound) { + extra += '

        ' + PMA_messages.strNoTdSelected + '

        '; + extra += '
        '; + } else { + extra += '
  • '; + datastring = { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'tables': JSON.stringify(tablesTds), + 'server': PMA_commonParams.get('server'), + 'pd': JSON.stringify(pd), + 'getNewTables3NF':1 }; + $.ajax({ + type: 'POST', + url: 'normalization.php', + data: datastring, + async:false, + success: function (data) { + data_parsed = data; + if (data.success === true) { + extra += data_parsed.html; + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + }); + } + $('#mainContent #extra').html(extra); + $('.tblFooters').html(''); + $('#goTo3NFFinish').click(function () { + if (!pdFound) { + goTo3NFFinish([]); + } else { + goTo3NFFinish(data_parsed.newTables); + } + }); +} +function processDependencies (primary_key, isTransitive) { + var pd = {}; + var tablesTds = {}; + var dependsOn; + pd[primary_key] = []; + $('#extra form').each(function () { + var tblname; + if (isTransitive === true) { + tblname = $(this).data('tablename'); + primary_key = tblname; + if (!(tblname in tablesTds)) { + tablesTds[tblname] = []; + } + tablesTds[tblname].push(primary_key); + } + var form_id = $(this).attr('id'); + $('#' + form_id + ' input[type=checkbox]:not(:checked)').prop('checked', false); + dependsOn = ''; + $('#' + form_id + ' input[type=checkbox]:checked').each(function () { + dependsOn += $(this).val() + ', '; + $(this).attr('checked','checked'); + }); + if (dependsOn === '') { + dependsOn = primary_key; + } else { + dependsOn = dependsOn.slice(0, -2); + } + if (! (dependsOn in pd)) { + pd[dependsOn] = []; + } + pd[dependsOn].push($(this).data('colname')); + if (isTransitive === true) { + if (!(tblname in tablesTds)) { + tablesTds[tblname] = []; + } + if ($.inArray(dependsOn, tablesTds[tblname]) === -1) { + tablesTds[tblname].push(dependsOn); + } + } + }); + backup = $('#mainContent').html(); + if (isTransitive === true) { + goTo3NFStep2(pd, tablesTds); + } else { + goTo2NFStep2(pd, primary_key); + } + return false; +} + +function moveRepeatingGroup (repeatingCols) { + var newTable = $('input[name=repeatGroupTable]').val(); + var newColumn = $('input[name=repeatGroupColumn]').val(); + if (!newTable) { + $('input[name=repeatGroupTable]').focus(); + return false; + } + if (!newColumn) { + $('input[name=repeatGroupColumn]').focus(); + return false; + } + datastring = { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'repeatingColumns': repeatingCols, + 'newTable':newTable, + 'newColumn':newColumn, + 'primary_columns':primary_key.toString() + }; + $.ajax({ + type: 'POST', + url: 'normalization.php', + data: datastring, + async:false, + success: function (data) { + if (data.success === true) { + if (data.queryError === false) { + goToStep3(); + } + PMA_ajaxShowMessage(data.message, false); + $('#pma_navigation_reload').click(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + }); +} +AJAX.registerTeardown('normalization.js', function () { + $('#extra').off('click', '#selectNonAtomicCol'); + $('#splitGo').off('click'); + $('.tblFooters').off('click', '#saveSplit'); + $('#extra').off('click', '#addNewPrimary'); + $('.tblFooters').off('click', '#saveNewPrimary'); + $('#extra').off('click', '#removeRedundant'); + $('#mainContent p').off('click', '#createPrimaryKey'); + $('#mainContent').off('click', '#backEditPd'); + $('#mainContent').off('click', '#showPossiblePd'); + $('#mainContent').off('click', '.pickPd'); +}); + +AJAX.registerOnload('normalization.js', function () { + var selectedCol; + normalizeto = $('#mainContent').data('normalizeto'); + $('#extra').on('click', '#selectNonAtomicCol', function () { + if ($(this).val() === 'no_such_col') { + goToStep2(); + } else { + selectedCol = $(this).val(); + } + }); + + $('#splitGo').click(function () { + if (!selectedCol || selectedCol === '') { + return false; + } + var numField = $('#numField').val(); + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'splitColumn': true, + 'numFields': numField + }, + function (data) { + if (data.success === true) { + $('#newCols').html(data.message); + $('.default_value').hide(); + $('.enum_notice').hide(); + + $('') + .attr({ type: 'submit', id: 'saveSplit', value: PMA_messages.strSave }) + .appendTo('.tblFooters'); + + var cancelSplitButton = $('') + .attr({ type: 'submit', id: 'cancelSplit', value: PMA_messages.strCancel }) + .on('click', function () { + $('#newCols').html(''); + $(this).parent().html(''); + }) + .appendTo('.tblFooters'); + } + } + ); + return false; + }); + $('.tblFooters').on('click','#saveSplit', function () { + central_column_list = []; + if ($('#newCols #field_0_1').val() === '') { + $('#newCols #field_0_1').focus(); + return false; + } + var argsep = PMA_commonParams.get('arg_separator'); + datastring = $('#newCols :input').serialize(); + datastring += argsep + 'ajax_request=1' + argsep + 'do_save_data=1' + argsep + 'field_where=last'; + $.post('tbl_addfield.php', datastring, function (data) { + if (data.success) { + $.post( + 'sql.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'dropped_column': selectedCol, + 'purge' : 1, + 'sql_query': 'ALTER TABLE `' + PMA_commonParams.get('table') + '` DROP `' + selectedCol + '`;', + 'is_js_confirmed': 1 + }, + function (data) { + if (data.success === true) { + appendHtmlColumnsList(); + $('#newCols').html(''); + $('.tblFooters').html(''); + } else { + PMA_ajaxShowMessage(data.error, false); + } + selectedCol = ''; + } + ); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); + }); + + $('#extra').on('click', '#addNewPrimary', function () { + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'addNewPrimary': true + }, + function (data) { + if (data.success === true) { + $('#newCols').html(data.message); + $('.default_value').hide(); + $('.enum_notice').hide(); + + $('') + .attr({ type: 'submit', id: 'saveNewPrimary', value: PMA_messages.strSave }) + .appendTo('.tblFooters'); + $('') + .attr({ type: 'submit', id: 'cancelSplit', value: PMA_messages.strCancel }) + .on('click', function () { + $('#newCols').html(''); + $(this).parent().html(''); + }) + .appendTo('.tblFooters'); + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + ); + return false; + }); + $('.tblFooters').on('click', '#saveNewPrimary', function () { + var datastring = $('#newCols :input').serialize(); + var argsep = PMA_commonParams.get('arg_separator'); + datastring += argsep + 'field_key[0]=primary_0' + argsep + 'ajax_request=1' + argsep + 'do_save_data=1' + argsep + 'field_where=last'; + $.post('tbl_addfield.php', datastring, function (data) { + if (data.success === true) { + $('#mainContent h4').html(PMA_messages.strPrimaryKeyAdded); + $('#mainContent p').html(PMA_messages.strToNextStep); + $('#mainContent #extra').html(''); + $('#mainContent #newCols').html(''); + $('.tblFooters').html(''); + setTimeout(function () { + goToStep3(); + }, 2000); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); + }); + $('#extra').on('click', '#removeRedundant', function () { + var dropQuery = 'ALTER TABLE `' + PMA_commonParams.get('table') + '` '; + $('#extra input[type=checkbox]:checked').each(function () { + dropQuery += 'DROP `' + $(this).val() + '`, '; + }); + dropQuery = dropQuery.slice(0, -2); + $.post( + 'sql.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'sql_query': dropQuery, + 'is_js_confirmed': 1 + }, + function (data) { + if (data.success === true) { + goToStep2('goToFinish1NF'); + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + ); + }); + $('#extra').on('click', '#moveRepeatingGroup', function () { + var repeatingCols = ''; + $('#extra input[type=checkbox]:checked').each(function () { + repeatingCols += $(this).val() + ', '; + }); + + if (repeatingCols !== '') { + var newColName = $('#extra input[type=checkbox]:checked:first').val(); + repeatingCols = repeatingCols.slice(0, -2); + var confirmStr = PMA_sprintf(PMA_messages.strMoveRepeatingGroup, escapeHtml(repeatingCols), escapeHtml(PMA_commonParams.get('table'))); + confirmStr += '' + + '( ' + escapeHtml(primary_key.toString()) + ', )' + + ''; + $('#newCols').html(confirmStr); + + $('') + .attr({ type: 'submit', value: PMA_messages.strCancel }) + .on('click', function () { + $('#newCols').html(''); + $('#extra input[type=checkbox]').prop('checked', false); + }) + .appendTo('.tblFooters'); + $('') + .attr({ type: 'submit', value: PMA_messages.strGo }) + .on('click', function () { + moveRepeatingGroup(repeatingCols); + }) + .appendTo('.tblFooters'); + } + }); + $('#mainContent p').on('click', '#createPrimaryKey', function (event) { + event.preventDefault(); + var url = { create_index: 1, + server: PMA_commonParams.get('server'), + db: PMA_commonParams.get('db'), + table: PMA_commonParams.get('table'), + added_fields: 1, + add_fields:1, + index: { Key_name:'PRIMARY' }, + ajax_request: true + }; + var title = PMA_messages.strAddPrimaryKey; + indexEditorDialog(url, title, function () { + // on success + $('.sqlqueryresults').remove(); + $('.result_query').remove(); + $('.tblFooters').html(''); + goToStep2('goToStep3'); + }); + return false; + }); + $('#mainContent').on('click', '#backEditPd', function () { + $('#mainContent').html(backup); + }); + $('#mainContent').on('click', '#showPossiblePd', function () { + if ($(this).hasClass('hideList')) { + $(this).html('+ ' + PMA_messages.strShowPossiblePd); + $(this).removeClass('hideList'); + $('#newCols').slideToggle('slow'); + return false; + } + if ($('#newCols').html() !== '') { + $('#showPossiblePd').html('- ' + PMA_messages.strHidePd); + $('#showPossiblePd').addClass('hideList'); + $('#newCols').slideToggle('slow'); + return false; + } + $('#newCols').insertAfter('#mainContent h4'); + $('#newCols').html('
    ' + PMA_messages.strLoading + '
    ' + PMA_messages.strWaitForPd + '
    '); + $.post( + 'normalization.php', + { + 'ajax_request': true, + 'db': PMA_commonParams.get('db'), + 'table': PMA_commonParams.get('table'), + 'server': PMA_commonParams.get('server'), + 'findPdl': true + }, function (data) { + $('#showPossiblePd').html('- ' + PMA_messages.strHidePd); + $('#showPossiblePd').addClass('hideList'); + $('#newCols').html(data.message); + }); + }); + $('#mainContent').on('click', '.pickPd', function () { + var strColsLeft = $(this).next('.determinants').html(); + var colsLeft = strColsLeft.split(','); + var strColsRight = $(this).next().next().html(); + var colsRight = strColsRight.split(','); + for (var i in colsRight) { + $('form[data-colname="' + colsRight[i].trim() + '"] input[type="checkbox"]').prop('checked', false); + for (var j in colsLeft) { + $('form[data-colname="' + colsRight[i].trim() + '"] input[value="' + colsLeft[j].trim() + '"]').prop('checked', true); + } + } + }); +}); diff --git a/phpMyAdmin/js/page_settings.js b/phpMyAdmin/js/page_settings.js new file mode 100755 index 0000000..7de9c03 --- /dev/null +++ b/phpMyAdmin/js/page_settings.js @@ -0,0 +1,59 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview function used for page-related settings + * @name Page-related settings + * + * @requires jQuery + * @requires jQueryUI + * @required js/functions.js + */ + +function showSettings (selector) { + var buttons = {}; + buttons[PMA_messages.strApply] = function () { + $('.config-form').submit(); + }; + + buttons[PMA_messages.strCancel] = function () { + $(this).dialog('close'); + }; + + // Keeping a clone to restore in case the user cancels the operation + var $clone = $(selector + ' .page_settings').clone(true); + $(selector) + .dialog({ + title: PMA_messages.strPageSettings, + width: 700, + minHeight: 250, + modal: true, + open: function () { + $(this).dialog('option', 'maxHeight', $(window).height() - $(this).offset().top); + }, + close: function () { + $(selector + ' .page_settings').replaceWith($clone); + }, + buttons: buttons + }); +} + +function showPageSettings () { + showSettings('#page_settings_modal'); +} + +function showNaviSettings () { + showSettings('#pma_navigation_settings'); +} + +AJAX.registerTeardown('page_settings.js', function () { + $('#page_settings_icon').css('display', 'none'); + $('#page_settings_icon').off('click'); + $('#pma_navigation_settings_icon').off('click'); +}); + +AJAX.registerOnload('page_settings.js', function () { + if ($('#page_settings_modal').length) { + $('#page_settings_icon').css('display', 'inline'); + $('#page_settings_icon').on('click', showPageSettings); + } + $('#pma_navigation_settings_icon').on('click', showNaviSettings); +}); diff --git a/phpMyAdmin/js/replication.js b/phpMyAdmin/js/replication.js new file mode 100755 index 0000000..602a5a5 --- /dev/null +++ b/phpMyAdmin/js/replication.js @@ -0,0 +1,92 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * for server_replication.php + * + */ + +var random_server_id = Math.floor(Math.random() * 10000000); +var conf_prefix = 'server-id=' + random_server_id + '\nlog_bin=mysql-bin\nlog_error=mysql-bin.err\n'; + +function update_config () { + var conf_ignore = 'binlog_ignore_db='; + var conf_do = 'binlog_do_db='; + var database_list = ''; + + if ($('#db_select option:selected').size() === 0) { + $('#rep').text(conf_prefix); + } else if ($('#db_type option:selected').val() === 'all') { + $('#db_select option:selected').each(function () { + database_list += conf_ignore + $(this).val() + '\n'; + }); + $('#rep').text(conf_prefix + database_list); + } else { + $('#db_select option:selected').each(function () { + database_list += conf_do + $(this).val() + '\n'; + }); + $('#rep').text(conf_prefix + database_list); + } +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('replication.js', function () { + $('#db_type').off('change'); + $('#db_select').off('change'); + $('#master_status_href').off('click'); + $('#master_slaves_href').off('click'); + $('#slave_status_href').off('click'); + $('#slave_control_href').off('click'); + $('#slave_errormanagement_href').off('click'); + $('#slave_synchronization_href').off('click'); + $('#db_reset_href').off('click'); + $('#db_select_href').off('click'); + $('#reset_slave').off('click'); +}); + +AJAX.registerOnload('replication.js', function () { + $('#rep').text(conf_prefix); + $('#db_type').change(update_config); + $('#db_select').change(update_config); + + $('#master_status_href').click(function () { + $('#replication_master_section').toggle(); + }); + $('#master_slaves_href').click(function () { + $('#replication_slaves_section').toggle(); + }); + $('#slave_status_href').click(function () { + $('#replication_slave_section').toggle(); + }); + $('#slave_control_href').click(function () { + $('#slave_control_gui').toggle(); + }); + $('#slave_errormanagement_href').click(function () { + $('#slave_errormanagement_gui').toggle(); + }); + $('#slave_synchronization_href').click(function () { + $('#slave_synchronization_gui').toggle(); + }); + $('#db_reset_href').click(function () { + $('#db_select option:selected').prop('selected', false); + $('#db_select').trigger('change'); + }); + $('#db_select_href').click(function () { + $('#db_select option').prop('selected', true); + $('#db_select').trigger('change'); + }); + $('#reset_slave').click(function (e) { + e.preventDefault(); + var $anchor = $(this); + var question = PMA_messages.strResetSlaveWarning; + $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) { + PMA_ajaxShowMessage(); + AJAX.source = $anchor; + var params = getJSConfirmCommonParam({ + 'ajax_page_request': true, + 'ajax_request': true + }, $anchor.getPostData()); + $.post(url, params, AJAX.responseHandler); + }); + }); +}); diff --git a/phpMyAdmin/js/rte.js b/phpMyAdmin/js/rte.js new file mode 100755 index 0000000..d51538b --- /dev/null +++ b/phpMyAdmin/js/rte.js @@ -0,0 +1,1075 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * JavaScript functionality for Routines, Triggers and Events. + * + * @package PhpMyadmin + */ +/** + * @var RTE Contains all the JavaScript functionality + * for Routines, Triggers and Events + */ +var RTE = { + /** + * Construct for the object that provides the + * functionality for Routines, Triggers and Events + */ + object: function (type) { + $.extend(this, RTE.COMMON); + this.editorType = type; + + switch (type) { + case 'routine': + $.extend(this, RTE.ROUTINE); + break; + case 'trigger': + // nothing extra yet for triggers + break; + case 'event': + $.extend(this, RTE.EVENT); + break; + default: + break; + } + }, + /** + * @var string param_template Template for a row in the routine editor + */ + param_template: '' +}; + +/** + * @var RTE.COMMON a JavaScript namespace containing the functionality + * for Routines, Triggers and Events + * + * This namespace is extended by the functionality required + * to handle a specific item (a routine, trigger or event) + * in the relevant javascript files in this folder + */ +RTE.COMMON = { + /** + * @var $ajaxDialog Query object containing the reference to the + * dialog that contains the editor + */ + $ajaxDialog: null, + /** + * @var syntaxHiglighter Reference to the codemirror editor + */ + syntaxHiglighter: null, + /** + * @var buttonOptions Object containing options for + * the jQueryUI dialog buttons + */ + buttonOptions: {}, + /** + * @var editorType Type of the editor + */ + editorType: null, + /** + * Validate editor form fields. + */ + validate: function () { + /** + * @var $elm a jQuery object containing the reference + * to an element that is being validated + */ + var $elm = null; + // Common validation. At the very least the name + // and the definition must be provided for an item + $elm = $('table.rte_table').last().find('input[name=item_name]'); + if ($elm.val() === '') { + $elm.focus(); + alert(PMA_messages.strFormEmpty); + return false; + } + $elm = $('table.rte_table').find('textarea[name=item_definition]'); + if ($elm.val() === '') { + if (this.syntaxHiglighter !== null) { + this.syntaxHiglighter.focus(); + } else { + $('textarea[name=item_definition]').last().focus(); + } + alert(PMA_messages.strFormEmpty); + return false; + } + // The validation has so far passed, so now + // we can validate item-specific fields. + return this.validateCustom(); + }, // end validate() + /** + * Validate custom editor form fields. + * This function can be overridden by + * other files in this folder + */ + validateCustom: function () { + return true; + }, // end validateCustom() + /** + * Execute some code after the ajax + * dialog for the editor is shown. + * This function can be overridden by + * other files in this folder + */ + postDialogShow: function () { + // Nothing by default + }, // end postDialogShow() + + exportDialog: function ($this) { + var $msg = PMA_ajaxShowMessage(); + if ($this.hasClass('mult_submit')) { + var combined = { + success: true, + title: PMA_messages.strExport, + message: '', + error: '' + }; + // export anchors of all selected rows + var export_anchors = $('input.checkall:checked').parents('tr').find('.export_anchor'); + var count = export_anchors.length; + var returnCount = 0; + + // No routine is exportable (due to privilege issues) + if (count === 0) { + PMA_ajaxShowMessage(PMA_messages.NoExportable); + } + + export_anchors.each(function () { + $.get($(this).attr('href'), { 'ajax_request': true }, function (data) { + returnCount++; + if (data.success === true) { + combined.message += '\n' + data.message + '\n'; + if (returnCount === count) { + showExport(combined); + } + } else { + // complain even if one export is failing + combined.success = false; + combined.error += '\n' + data.error + '\n'; + if (returnCount === count) { + showExport(combined); + } + } + }); + }); + } else { + $.get($this.attr('href'), { 'ajax_request': true }, showExport); + } + PMA_ajaxRemoveMessage($msg); + + function showExport (data) { + if (data.success === true) { + PMA_ajaxRemoveMessage($msg); + /** + * @var button_options Object containing options + * for jQueryUI dialog buttons + */ + var button_options = {}; + button_options[PMA_messages.strClose] = function () { + $(this).dialog('close').remove(); + }; + /** + * Display the dialog to the user + */ + data.message = ''; + var $ajaxDialog = $('
    ' + data.message + '
    ').dialog({ + width: 500, + buttons: button_options, + title: data.title + }); + // Attach syntax highlighted editor to export dialog + /** + * @var $elm jQuery object containing the reference + * to the Export textarea. + */ + var $elm = $ajaxDialog.find('textarea'); + PMA_getSQLEditor($elm); + } else { + PMA_ajaxShowMessage(data.error, false); + } + } // end showExport() + }, // end exportDialog() + editorDialog: function (is_new, $this) { + var that = this; + /** + * @var $edit_row jQuery object containing the reference to + * the row of the the item being edited + * from the list of items + */ + var $edit_row = null; + if ($this.hasClass('edit_anchor')) { + // Remeber the row of the item being edited for later, + // so that if the edit is successful, we can replace the + // row with info about the modified item. + $edit_row = $this.parents('tr'); + } + /** + * @var $msg jQuery object containing the reference to + * the AJAX message shown to the user + */ + var $msg = PMA_ajaxShowMessage(); + $.get($this.attr('href'), { 'ajax_request': true }, function (data) { + if (data.success === true) { + // We have successfully fetched the editor form + PMA_ajaxRemoveMessage($msg); + // Now define the function that is called when + // the user presses the "Go" button + that.buttonOptions[PMA_messages.strGo] = function () { + // Move the data from the codemirror editor back to the + // textarea, where it can be used in the form submission. + if (typeof CodeMirror !== 'undefined') { + that.syntaxHiglighter.save(); + } + // Validate editor and submit request, if passed. + if (that.validate()) { + /** + * @var data Form data to be sent in the AJAX request + */ + var data = $('form.rte_form').last().serialize(); + $msg = PMA_ajaxShowMessage( + PMA_messages.strProcessingRequest + ); + var url = $('form.rte_form').last().attr('action'); + $.post(url, data, function (data) { + if (data.success === true) { + // Item created successfully + PMA_ajaxRemoveMessage($msg); + PMA_slidingMessage(data.message); + that.$ajaxDialog.dialog('close'); + // If we are in 'edit' mode, we must + // remove the reference to the old row. + if (mode === 'edit' && $edit_row !== null) { + $edit_row.remove(); + } + // Sometimes, like when moving a trigger from + // a table to another one, the new row should + // not be inserted into the list. In this case + // "data.insert" will be set to false. + if (data.insert) { + // Insert the new row at the correct + // location in the list of items + /** + * @var text Contains the name of an item from + * the list that is used in comparisons + * to find the correct location where + * to insert a new row. + */ + var text = ''; + /** + * @var inserted Whether a new item has been + * inserted in the list or not + */ + var inserted = false; + $('table.data').find('tr').each(function () { + text = $(this) + .children('td') + .eq(0) + .find('strong') + .text() + .toUpperCase(); + text = $.trim(text); + if (text !== '' && text > data.name) { + $(this).before(data.new_row); + inserted = true; + return false; + } + }); + if (! inserted) { + // If we didn't manage to insert the row yet, + // it must belong at the end of the list, + // so we insert it there. + $('table.data').append(data.new_row); + } + // Fade-in the new row + $('tr.ajaxInsert') + .show('slow') + .removeClass('ajaxInsert'); + } else if ($('table.data').find('tr').has('td').length === 0) { + // If we are not supposed to insert the new row, + // we will now check if the table is empty and + // needs to be hidden. This will be the case if + // we were editing the only item in the list, + // which we removed and will not be inserting + // something else in its place. + $('table.data').hide('slow', function () { + $('#nothing2display').show('slow'); + }); + } + // Now we have inserted the row at the correct + // position, but surely at least some row classes + // are wrong now. So we will itirate throught + // all rows and assign correct classes to them + /** + * @var ct Count of processed rows + */ + var ct = 0; + /** + * @var rowclass Class to be attached to the row + * that is being processed + */ + var rowclass = ''; + $('table.data').find('tr').has('td').each(function () { + rowclass = (ct % 2 === 0) ? 'odd' : 'even'; + $(this).removeClass().addClass(rowclass); + ct++; + }); + // If this is the first item being added, remove + // the "No items" message and show the list. + if ($('table.data').find('tr').has('td').length > 0 && + $('#nothing2display').is(':visible') + ) { + $('#nothing2display').hide('slow', function () { + $('table.data').show('slow'); + }); + } + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + } // end "if (that.validate())" + }; // end of function that handles the submission of the Editor + that.buttonOptions[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + /** + * Display the dialog to the user + */ + that.$ajaxDialog = $('
    ' + data.message + '
    ').dialog({ + width: 700, + minWidth: 500, + maxHeight: $(window).height(), + buttons: that.buttonOptions, + title: data.title, + modal: true, + open: function () { + if ($('#rteDialog').parents('.ui-dialog').height() > $(window).height()) { + $('#rteDialog').dialog('option', 'height', $(window).height()); + } + $(this).find('input[name=item_name]').focus(); + $(this).find('input.datefield').each(function () { + PMA_addDatepicker($(this).css('width', '95%'), 'date'); + }); + $(this).find('input.datetimefield').each(function () { + PMA_addDatepicker($(this).css('width', '95%'), 'datetime'); + }); + $.datepicker.initialized = false; + }, + close: function () { + $(this).remove(); + } + }); + /** + * @var mode Used to remeber whether the editor is in + * "Edit" or "Add" mode + */ + var mode = 'add'; + if ($('input[name=editor_process_edit]').length > 0) { + mode = 'edit'; + } + // Attach syntax highlighted editor to the definition + /** + * @var elm jQuery object containing the reference to + * the Definition textarea. + */ + var $elm = $('textarea[name=item_definition]').last(); + var linterOptions = {}; + linterOptions[that.editorType + '_editor'] = true; + that.syntaxHiglighter = PMA_getSQLEditor($elm, {}, null, linterOptions); + + // Execute item-specific code + that.postDialogShow(data); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.get() + }, + + dropDialog: function ($this) { + /** + * @var $curr_row Object containing reference to the current row + */ + var $curr_row = $this.parents('tr'); + /** + * @var question String containing the question to be asked for confirmation + */ + var question = $('
    ').text( + $curr_row.children('td').children('.drop_sql').html() + ); + // We ask for confirmation first here, before submitting the ajax request + $this.PMA_confirm(question, $this.attr('href'), function (url) { + /** + * @var msg jQuery object containing the reference to + * the AJAX message shown to the user + */ + var $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + var params = getJSConfirmCommonParam(this, $this.getPostData()); + $.post(url, params, function (data) { + if (data.success === true) { + /** + * @var $table Object containing reference + * to the main list of elements + */ + var $table = $curr_row.parent(); + // Check how many rows will be left after we remove + // the one that the user has requested us to remove + if ($table.find('tr').length === 3) { + // If there are two rows left, it means that they are + // the header of the table and the rows that we are + // about to remove, so after the removal there will be + // nothing to show in the table, so we hide it. + $table.hide('slow', function () { + $(this).find('tr.even, tr.odd').remove(); + $('.withSelected').remove(); + $('#nothing2display').show('slow'); + }); + } else { + $curr_row.hide('slow', function () { + $(this).remove(); + // Now we have removed the row from the list, but maybe + // some row classes are wrong now. So we will itirate + // throught all rows and assign correct classes to them. + /** + * @var ct Count of processed rows + */ + var ct = 0; + /** + * @var rowclass Class to be attached to the row + * that is being processed + */ + var rowclass = ''; + $table.find('tr').has('td').each(function () { + rowclass = (ct % 2 === 1) ? 'odd' : 'even'; + $(this).removeClass().addClass(rowclass); + ct++; + }); + }); + } + // Get rid of the "Loading" message + PMA_ajaxRemoveMessage($msg); + // Show the query that we just executed + PMA_slidingMessage(data.sql_query); + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + }); // end $.PMA_confirm() + }, + + dropMultipleDialog: function ($this) { + // We ask for confirmation here + $this.PMA_confirm(PMA_messages.strDropRTEitems, '', function (url) { + /** + * @var msg jQuery object containing the reference to + * the AJAX message shown to the user + */ + var $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + + // drop anchors of all selected rows + var drop_anchors = $('input.checkall:checked').parents('tr').find('.drop_anchor'); + var success = true; + var count = drop_anchors.length; + var returnCount = 0; + + drop_anchors.each(function () { + var $anchor = $(this); + /** + * @var $curr_row Object containing reference to the current row + */ + var $curr_row = $anchor.parents('tr'); + var params = getJSConfirmCommonParam(this, $anchor.getPostData()); + $.post($anchor.attr('href'), params, function (data) { + returnCount++; + if (data.success === true) { + /** + * @var $table Object containing reference + * to the main list of elements + */ + var $table = $curr_row.parent(); + // Check how many rows will be left after we remove + // the one that the user has requested us to remove + if ($table.find('tr').length === 3) { + // If there are two rows left, it means that they are + // the header of the table and the rows that we are + // about to remove, so after the removal there will be + // nothing to show in the table, so we hide it. + $table.hide('slow', function () { + $(this).find('tr.even, tr.odd').remove(); + $('.withSelected').remove(); + $('#nothing2display').show('slow'); + }); + } else { + $curr_row.hide('fast', function () { + $(this).remove(); + // Now we have removed the row from the list, but maybe + // some row classes are wrong now. So we will itirate + // throught all rows and assign correct classes to them. + /** + * @var ct Count of processed rows + */ + var ct = 0; + /** + * @var rowclass Class to be attached to the row + * that is being processed + */ + var rowclass = ''; + $table.find('tr').has('td').each(function () { + rowclass = (ct % 2 === 1) ? 'odd' : 'even'; + $(this).removeClass().addClass(rowclass); + ct++; + }); + }); + } + if (returnCount === count) { + if (success) { + // Get rid of the "Loading" message + PMA_ajaxRemoveMessage($msg); + $('#rteListForm_checkall').prop({ checked: false, indeterminate: false }); + } + PMA_reloadNavigation(); + } + } else { + PMA_ajaxShowMessage(data.error, false); + success = false; + if (returnCount === count) { + PMA_reloadNavigation(); + } + } + }); // end $.post() + }); // end drop_anchors.each() + }); // end $.PMA_confirm() + } +}; // end RTE namespace + +/** + * @var RTE.EVENT JavaScript functionality for events + */ +RTE.EVENT = { + validateCustom: function () { + /** + * @var elm a jQuery object containing the reference + * to an element that is being validated + */ + var $elm = null; + if (this.$ajaxDialog.find('select[name=item_type]').find(':selected').val() === 'RECURRING') { + // The interval field must not be empty for recurring events + $elm = this.$ajaxDialog.find('input[name=item_interval_value]'); + if ($elm.val() === '') { + $elm.focus(); + alert(PMA_messages.strFormEmpty); + return false; + } + } else { + // The execute_at field must not be empty for "once off" events + $elm = this.$ajaxDialog.find('input[name=item_execute_at]'); + if ($elm.val() === '') { + $elm.focus(); + alert(PMA_messages.strFormEmpty); + return false; + } + } + return true; + } +}; + +/** + * @var RTE.ROUTINE JavaScript functionality for routines + */ +RTE.ROUTINE = { + /** + * Overriding the postDialogShow() function defined in common.js + * + * @param data JSON-encoded data from the ajax request + */ + postDialogShow: function (data) { + // Cache the template for a parameter table row + RTE.param_template = data.param_template; + var that = this; + // Make adjustments in the dialog to make it AJAX compatible + $('td.routine_param_remove').show(); + $('input[name=routine_removeparameter]').remove(); + $('input[name=routine_addparameter]').css('width', '100%'); + // Enable/disable the 'options' dropdowns for parameters as necessary + $('table.routine_params_table').last().find('th[colspan=2]').attr('colspan', '1'); + $('table.routine_params_table').last().find('tr').has('td').each(function () { + that.setOptionsForParameter( + $(this).find('select[name^=item_param_type]'), + $(this).find('input[name^=item_param_length]'), + $(this).find('select[name^=item_param_opts_text]'), + $(this).find('select[name^=item_param_opts_num]') + ); + }); + // Enable/disable the 'options' dropdowns for + // function return value as necessary + this.setOptionsForParameter( + $('table.rte_table').last().find('select[name=item_returntype]'), + $('table.rte_table').last().find('input[name=item_returnlength]'), + $('table.rte_table').last().find('select[name=item_returnopts_text]'), + $('table.rte_table').last().find('select[name=item_returnopts_num]') + ); + // Allow changing parameter order + $('.routine_params_table tbody').sortable({ + containment: '.routine_params_table tbody', + handle: '.dragHandle', + stop: function (event, ui) { + that.reindexParameters(); + }, + }); + }, + /** + * Reindexes the parameters after dropping a parameter or reordering parameters + */ + reindexParameters: function () { + /** + * @var index Counter used for reindexing the input + * fields in the routine parameters table + */ + var index = 0; + $('table.routine_params_table tbody').find('tr').each(function () { + $(this).find(':input').each(function () { + /** + * @var inputname The value of the name attribute of + * the input field being reindexed + */ + var inputname = $(this).attr('name'); + if (inputname.substr(0, 14) === 'item_param_dir') { + $(this).attr('name', inputname.substr(0, 14) + '[' + index + ']'); + } else if (inputname.substr(0, 15) === 'item_param_name') { + $(this).attr('name', inputname.substr(0, 15) + '[' + index + ']'); + } else if (inputname.substr(0, 15) === 'item_param_type') { + $(this).attr('name', inputname.substr(0, 15) + '[' + index + ']'); + } else if (inputname.substr(0, 17) === 'item_param_length') { + $(this).attr('name', inputname.substr(0, 17) + '[' + index + ']'); + $(this).attr('id', 'item_param_length_' + index); + } else if (inputname.substr(0, 20) === 'item_param_opts_text') { + $(this).attr('name', inputname.substr(0, 20) + '[' + index + ']'); + } else if (inputname.substr(0, 19) === 'item_param_opts_num') { + $(this).attr('name', inputname.substr(0, 19) + '[' + index + ']'); + } + }); + index++; + }); + }, + /** + * Overriding the validateCustom() function defined in common.js + */ + validateCustom: function () { + /** + * @var isSuccess Stores the outcome of the validation + */ + var isSuccess = true; + /** + * @var inputname The value of the "name" attribute for + * the field that is being processed + */ + var inputname = ''; + this.$ajaxDialog.find('table.routine_params_table').last().find('tr').each(function () { + // Every parameter of a routine must have + // a non-empty direction, name and type + if (isSuccess) { + $(this).find(':input').each(function () { + inputname = $(this).attr('name'); + if (inputname.substr(0, 14) === 'item_param_dir' || + inputname.substr(0, 15) === 'item_param_name' || + inputname.substr(0, 15) === 'item_param_type') { + if ($(this).val() === '') { + $(this).focus(); + isSuccess = false; + return false; + } + } + }); + } else { + return false; + } + }); + if (! isSuccess) { + alert(PMA_messages.strFormEmpty); + return false; + } + this.$ajaxDialog.find('table.routine_params_table').last().find('tr').each(function () { + // SET, ENUM, VARCHAR and VARBINARY fields must have length/values + var $inputtyp = $(this).find('select[name^=item_param_type]'); + var $inputlen = $(this).find('input[name^=item_param_length]'); + if ($inputtyp.length && $inputlen.length) { + if (($inputtyp.val() === 'ENUM' || $inputtyp.val() === 'SET' || $inputtyp.val().substr(0, 3) === 'VAR') && + $inputlen.val() === '' + ) { + $inputlen.focus(); + isSuccess = false; + return false; + } + } + }); + if (! isSuccess) { + alert(PMA_messages.strFormEmpty); + return false; + } + if (this.$ajaxDialog.find('select[name=item_type]').find(':selected').val() === 'FUNCTION') { + // The length/values of return variable for functions must + // be set, if the type is SET, ENUM, VARCHAR or VARBINARY. + var $returntyp = this.$ajaxDialog.find('select[name=item_returntype]'); + var $returnlen = this.$ajaxDialog.find('input[name=item_returnlength]'); + if (($returntyp.val() === 'ENUM' || $returntyp.val() === 'SET' || $returntyp.val().substr(0, 3) === 'VAR') && + $returnlen.val() === '' + ) { + $returnlen.focus(); + alert(PMA_messages.strFormEmpty); + return false; + } + } + if ($('select[name=item_type]').find(':selected').val() === 'FUNCTION') { + // A function must contain a RETURN statement in its definition + if (this.$ajaxDialog.find('table.rte_table').find('textarea[name=item_definition]').val().toUpperCase().indexOf('RETURN') < 0) { + this.syntaxHiglighter.focus(); + alert(PMA_messages.MissingReturn); + return false; + } + } + return true; + }, + /** + * Enable/disable the "options" dropdown and "length" input for + * parameters and the return variable in the routine editor + * as necessary. + * + * @param type a jQuery object containing the reference + * to the "Type" dropdown box + * @param len a jQuery object containing the reference + * to the "Length" input box + * @param text a jQuery object containing the reference + * to the dropdown box with options for + * parameters of text type + * @param num a jQuery object containing the reference + * to the dropdown box with options for + * parameters of numeric type + */ + setOptionsForParameter: function ($type, $len, $text, $num) { + /** + * @var no_opts a jQuery object containing the reference + * to an element to be displayed when no + * options are available + */ + var $no_opts = $text.parent().parent().find('.no_opts'); + /** + * @var no_len a jQuery object containing the reference + * to an element to be displayed when no + * "length/values" field is available + */ + var $no_len = $len.parent().parent().find('.no_len'); + + // Process for parameter options + switch ($type.val()) { + case 'TINYINT': + case 'SMALLINT': + case 'MEDIUMINT': + case 'INT': + case 'BIGINT': + case 'DECIMAL': + case 'FLOAT': + case 'DOUBLE': + case 'REAL': + $text.parent().hide(); + $num.parent().show(); + $no_opts.hide(); + break; + case 'TINYTEXT': + case 'TEXT': + case 'MEDIUMTEXT': + case 'LONGTEXT': + case 'CHAR': + case 'VARCHAR': + case 'SET': + case 'ENUM': + $text.parent().show(); + $num.parent().hide(); + $no_opts.hide(); + break; + default: + $text.parent().hide(); + $num.parent().hide(); + $no_opts.show(); + break; + } + // Process for parameter length + switch ($type.val()) { + case 'DATE': + case 'TINYBLOB': + case 'TINYTEXT': + case 'BLOB': + case 'TEXT': + case 'MEDIUMBLOB': + case 'MEDIUMTEXT': + case 'LONGBLOB': + case 'LONGTEXT': + $text.closest('tr').find('a:first').hide(); + $len.parent().hide(); + $no_len.show(); + break; + default: + if ($type.val() === 'ENUM' || $type.val() === 'SET') { + $text.closest('tr').find('a:first').show(); + } else { + $text.closest('tr').find('a:first').hide(); + } + $len.parent().show(); + $no_len.hide(); + break; + } + }, + executeDialog: function ($this) { + var that = this; + /** + * @var msg jQuery object containing the reference to + * the AJAX message shown to the user + */ + var $msg = PMA_ajaxShowMessage(); + var params = getJSConfirmCommonParam($this[0], $this.getPostData()); + $.post($this.attr('href'), params, function (data) { + if (data.success === true) { + PMA_ajaxRemoveMessage($msg); + // If 'data.dialog' is true we show a dialog with a form + // to get the input parameters for routine, otherwise + // we just show the results of the query + if (data.dialog) { + // Define the function that is called when + // the user presses the "Go" button + that.buttonOptions[PMA_messages.strGo] = function () { + /** + * @var data Form data to be sent in the AJAX request + */ + var data = $('form.rte_form').last().serialize(); + $msg = PMA_ajaxShowMessage( + PMA_messages.strProcessingRequest + ); + $.post('db_routines.php', data, function (data) { + if (data.success === true) { + // Routine executed successfully + PMA_ajaxRemoveMessage($msg); + PMA_slidingMessage(data.message); + $ajaxDialog.dialog('close'); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); + }; + that.buttonOptions[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + /** + * Display the dialog to the user + */ + var $ajaxDialog = $('
    ' + data.message + '
    ').dialog({ + width: 650, + buttons: that.buttonOptions, + title: data.title, + modal: true, + close: function () { + $(this).remove(); + } + }); + $ajaxDialog.find('input[name^=params]').first().focus(); + /** + * Attach the datepickers to the relevant form fields + */ + $ajaxDialog.find('input.datefield, input.datetimefield').each(function () { + PMA_addDatepicker($(this).css('width', '95%')); + }); + /* + * Define the function if the user presses enter + */ + $('form.rte_form').on('keyup', function (event) { + event.preventDefault(); + if (event.keyCode === 13) { + /** + * @var data Form data to be sent in the AJAX request + */ + var data = $(this).serialize(); + $msg = PMA_ajaxShowMessage( + PMA_messages.strProcessingRequest + ); + var url = $(this).attr('action'); + $.post(url, data, function (data) { + if (data.success === true) { + // Routine executed successfully + PMA_ajaxRemoveMessage($msg); + PMA_slidingMessage(data.message); + $('form.rte_form').off('keyup'); + $ajaxDialog.remove(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); + } + }); + } else { + // Routine executed successfully + PMA_slidingMessage(data.message); + } + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + } +}; + +/** + * Attach Ajax event handlers for the Routines, Triggers and Events editor + */ +$(function () { + /** + * Attach Ajax event handlers for the Add/Edit functionality. + */ + $(document).on('click', 'a.ajax.add_anchor, a.ajax.edit_anchor', function (event) { + event.preventDefault(); + var type = $(this).attr('href').substr(0, $(this).attr('href').indexOf('?')); + if (type.indexOf('routine') !== -1) { + type = 'routine'; + } else if (type.indexOf('trigger') !== -1) { + type = 'trigger'; + } else if (type.indexOf('event') !== -1) { + type = 'event'; + } else { + type = ''; + } + var dialog = new RTE.object(type); + dialog.editorDialog($(this).hasClass('add_anchor'), $(this)); + }); // end $(document).on() + + /** + * Attach Ajax event handlers for the Execute routine functionality + */ + $(document).on('click', 'a.ajax.exec_anchor', function (event) { + event.preventDefault(); + var dialog = new RTE.object('routine'); + dialog.executeDialog($(this)); + }); // end $(document).on() + + /** + * Attach Ajax event handlers for Export of Routines, Triggers and Events + */ + $(document).on('click', 'a.ajax.export_anchor', function (event) { + event.preventDefault(); + var dialog = new RTE.object(); + dialog.exportDialog($(this)); + }); // end $(document).on() + + $(document).on('click', '#rteListForm.ajax .mult_submit[value="export"]', function (event) { + event.preventDefault(); + var dialog = new RTE.object(); + dialog.exportDialog($(this)); + }); // end $(document).on() + + /** + * Attach Ajax event handlers for Drop functionality + * of Routines, Triggers and Events. + */ + $(document).on('click', 'a.ajax.drop_anchor', function (event) { + event.preventDefault(); + var dialog = new RTE.object(); + dialog.dropDialog($(this)); + }); // end $(document).on() + + $(document).on('click', '#rteListForm.ajax .mult_submit[value="drop"]', function (event) { + event.preventDefault(); + var dialog = new RTE.object(); + dialog.dropMultipleDialog($(this)); + }); // end $(document).on() + + /** + * Attach Ajax event handlers for the "Change event/routine type" + * functionality in the events editor, so that the correct + * rows are shown in the editor when changing the event type + */ + $(document).on('change', 'select[name=item_type]', function () { + $(this) + .closest('table') + .find('tr.recurring_event_row, tr.onetime_event_row, tr.routine_return_row, .routine_direction_cell') + .toggle(); + }); // end $(document).on() + + /** + * Attach Ajax event handlers for the "Change parameter type" + * functionality in the routines editor, so that the correct + * option/length fields, if any, are shown when changing + * a parameter type + */ + $(document).on('change', 'select[name^=item_param_type]', function () { + /** + * @var row jQuery object containing the reference to + * a row in the routine parameters table + */ + var $row = $(this).parents('tr').first(); + var rte = new RTE.object('routine'); + rte.setOptionsForParameter( + $row.find('select[name^=item_param_type]'), + $row.find('input[name^=item_param_length]'), + $row.find('select[name^=item_param_opts_text]'), + $row.find('select[name^=item_param_opts_num]') + ); + }); // end $(document).on() + + /** + * Attach Ajax event handlers for the "Change the type of return + * variable of function" functionality, so that the correct fields, + * if any, are shown when changing the function return type type + */ + $(document).on('change', 'select[name=item_returntype]', function () { + var rte = new RTE.object('routine'); + var $table = $(this).closest('table.rte_table'); + rte.setOptionsForParameter( + $table.find('select[name=item_returntype]'), + $table.find('input[name=item_returnlength]'), + $table.find('select[name=item_returnopts_text]'), + $table.find('select[name=item_returnopts_num]') + ); + }); // end $(document).on() + + /** + * Attach Ajax event handlers for the "Add parameter to routine" functionality + */ + $(document).on('click', 'input[name=routine_addparameter]', function (event) { + event.preventDefault(); + /** + * @var routine_params_table jQuery object containing the reference + * to the routine parameters table + */ + var $routine_params_table = $(this).closest('div.ui-dialog').find('.routine_params_table'); + /** + * @var new_param_row A string containing the HTML code for the + * new row for the routine parameters table + */ + var new_param_row = RTE.param_template.replace(/%s/g, $routine_params_table.find('tr').length - 1); + // Append the new row to the parameters table + $routine_params_table.append(new_param_row); + // Make sure that the row is correctly shown according to the type of routine + if ($(this).closest('div.ui-dialog').find('table.rte_table select[name=item_type]').val() === 'FUNCTION') { + $('tr.routine_return_row').show(); + $('td.routine_direction_cell').hide(); + } + /** + * @var newrow jQuery object containing the reference to the newly + * inserted row in the routine parameters table + */ + var $newrow = $(this).closest('div.ui-dialog').find('table.routine_params_table').find('tr').has('td').last(); + // Enable/disable the 'options' dropdowns for parameters as necessary + var rte = new RTE.object('routine'); + rte.setOptionsForParameter( + $newrow.find('select[name^=item_param_type]'), + $newrow.find('input[name^=item_param_length]'), + $newrow.find('select[name^=item_param_opts_text]'), + $newrow.find('select[name^=item_param_opts_num]') + ); + }); // end $(document).on() + + /** + * Attach Ajax event handlers for the + * "Remove parameter from routine" functionality + */ + $(document).on('click', 'a.routine_param_remove_anchor', function (event) { + event.preventDefault(); + $(this).parent().parent().remove(); + // After removing a parameter, the indices of the name attributes in + // the input fields lose the correct order and need to be reordered. + RTE.ROUTINE.reindexParameters(); + }); // end $(document).on() +}); // end of $() diff --git a/phpMyAdmin/js/server_databases.js b/phpMyAdmin/js/server_databases.js new file mode 100755 index 0000000..a892ca8 --- /dev/null +++ b/phpMyAdmin/js/server_databases.js @@ -0,0 +1,150 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview functions used on the server databases list page + * @name Server Databases + * + * @requires jQuery + * @requires jQueryUI + * @required js/functions.js + */ + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_databases.js', function () { + $(document).off('submit', '#dbStatsForm'); + $(document).off('submit', '#create_database_form.ajax'); +}); + +/** + * AJAX scripts for server_databases.php + * + * Actions ajaxified here: + * Drop Databases + * + */ +AJAX.registerOnload('server_databases.js', function () { + /** + * Attach Event Handler for 'Drop Databases' + */ + $(document).on('submit', '#dbStatsForm', function (event) { + event.preventDefault(); + + var $form = $(this); + + /** + * @var selected_dbs Array containing the names of the checked databases + */ + var selected_dbs = []; + // loop over all checked checkboxes, except the .checkall_box checkbox + $form.find('input:checkbox:checked:not(.checkall_box)').each(function () { + $(this).closest('tr').addClass('removeMe'); + selected_dbs[selected_dbs.length] = 'DROP DATABASE `' + escapeHtml($(this).val()) + '`;'; + }); + if (! selected_dbs.length) { + PMA_ajaxShowMessage( + $('
    ').text( + PMA_messages.strNoDatabasesSelected + ), + 2000 + ); + return; + } + /** + * @var question String containing the question to be asked for confirmation + */ + var question = PMA_messages.strDropDatabaseStrongWarning + ' ' + + PMA_sprintf(PMA_messages.strDoYouReally, selected_dbs.join('
    ')); + + var argsep = PMA_commonParams.get('arg_separator'); + $(this).PMA_confirm( + question, + $form.prop('action') + '?' + $(this).serialize() + + argsep + 'drop_selected_dbs=1', + function (url) { + PMA_ajaxShowMessage(PMA_messages.strProcessingRequest, false); + + var parts = url.split('?'); + var params = getJSConfirmCommonParam(this, parts[1]); + + $.post(parts[0], params, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxShowMessage(data.message); + + var $rowsToRemove = $form.find('tr.removeMe'); + var $databasesCount = $('#filter-rows-count'); + var newCount = parseInt($databasesCount.text(), 10) - $rowsToRemove.length; + $databasesCount.text(newCount); + + $rowsToRemove.remove(); + $form.find('tbody').PMA_sort_table('.name'); + if ($form.find('tbody').find('tr').length === 0) { + // user just dropped the last db on this page + PMA_commonActions.refreshMain(); + } + PMA_reloadNavigation(); + } else { + $form.find('tr.removeMe').removeClass('removeMe'); + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + } + ); // end $.PMA_confirm() + }); // end of Drop Database action + + /** + * Attach Ajax event handlers for 'Create Database'. + */ + $(document).on('submit', '#create_database_form.ajax', function (event) { + event.preventDefault(); + + var $form = $(this); + + // TODO Remove this section when all browsers support HTML5 "required" property + var newDbNameInput = $form.find('input[name=new_db]'); + if (newDbNameInput.val() === '') { + newDbNameInput.focus(); + alert(PMA_messages.strFormEmpty); + return; + } + // end remove + + PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + PMA_prepareForAjaxRequest($form); + + $.post($form.attr('action'), $form.serialize(), function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxShowMessage(data.message); + + var $databases_count_object = $('#filter-rows-count'); + var databases_count = parseInt($databases_count_object.text(), 10) + 1; + $databases_count_object.text(databases_count); + PMA_reloadNavigation(); + + // make ajax request to load db structure page - taken from ajax.js + var dbStruct_url = data.url_query; + dbStruct_url = dbStruct_url.replace(/amp;/ig, ''); + var params = 'ajax_request=true' + PMA_commonParams.get('arg_separator') + 'ajax_page_request=true'; + if (! (history && history.pushState)) { + params += PMA_MicroHistory.menus.getRequestParam(); + } + $.get(dbStruct_url, params, AJAX.responseHandler); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + }); // end $(document).on() + + /* Don't show filter if number of databases are very few */ + var databasesCount = $('#filter-rows-count').html(); + if (databasesCount <= 10) { + $('#tableFilter').hide(); + } + + var tableRows = $('.server_databases'); + $.each(tableRows, function (index, item) { + $(this).click(function () { + PMA_commonActions.setDb($(this).attr('data')); + }); + }); +}); // end $() diff --git a/phpMyAdmin/js/server_plugins.js b/phpMyAdmin/js/server_plugins.js new file mode 100755 index 0000000..7baadab --- /dev/null +++ b/phpMyAdmin/js/server_plugins.js @@ -0,0 +1,16 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Functions used in server plugins pages + */ +AJAX.registerOnload('server_plugins.js', function () { + // Make columns sortable, but only for tables with more than 1 data row + var $tables = $('#plugins_plugins table:has(tbody tr + tr)'); + $tables.tablesorter({ + sortList: [[0, 0]], + headers: { + 1: { sorter: false } + } + }); + $tables.find('thead th') + .append('
    '); +}); diff --git a/phpMyAdmin/js/server_privileges.js b/phpMyAdmin/js/server_privileges.js new file mode 100755 index 0000000..b55ceb3 --- /dev/null +++ b/phpMyAdmin/js/server_privileges.js @@ -0,0 +1,490 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview functions used in server privilege pages + * @name Server Privileges + * + * @requires jQuery + * @requires jQueryUI + * @requires js/functions.js + * + */ + +/** + * Validates the "add a user" form + * + * @return boolean whether the form is validated or not + */ +function checkAddUser (the_form) { + if (the_form.elements.pred_hostname.value === 'userdefined' && the_form.elements.hostname.value === '') { + alert(PMA_messages.strHostEmpty); + the_form.elements.hostname.focus(); + return false; + } + + if (the_form.elements.pred_username.value === 'userdefined' && the_form.elements.username.value === '') { + alert(PMA_messages.strUserEmpty); + the_form.elements.username.focus(); + return false; + } + + return PMA_checkPassword($(the_form)); +} // end of the 'checkAddUser()' function + +function checkPasswordStrength (value, meter_obj, meter_object_label, username) { + // List of words we don't want to appear in the password + customDict = [ + 'phpmyadmin', + 'mariadb', + 'mysql', + 'php', + 'my', + 'admin', + ]; + if (username !== null) { + customDict.push(username); + } + var zxcvbn_obj = zxcvbn(value, customDict); + var strength = zxcvbn_obj.score; + strength = parseInt(strength); + meter_obj.val(strength); + switch (strength) { + case 0: meter_obj_label.html(PMA_messages.strExtrWeak); + break; + case 1: meter_obj_label.html(PMA_messages.strVeryWeak); + break; + case 2: meter_obj_label.html(PMA_messages.strWeak); + break; + case 3: meter_obj_label.html(PMA_messages.strGood); + break; + case 4: meter_obj_label.html(PMA_messages.strStrong); + } +} + +/** + * AJAX scripts for server_privileges page. + * + * Actions ajaxified here: + * Add user + * Revoke a user + * Edit privileges + * Export privileges + * Paginate table of users + * Flush privileges + * + * @memberOf jQuery + * @name document.ready + */ + + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_privileges.js', function () { + $('#fieldset_add_user_login').off('change', 'input[name=\'username\']'); + $(document).off('click', '#fieldset_delete_user_footer #buttonGo.ajax'); + $(document).off('click', 'a.edit_user_group_anchor.ajax'); + $(document).off('click', 'button.mult_submit[value=export]'); + $(document).off('click', 'a.export_user_anchor.ajax'); + $(document).off('click', '#initials_table a.ajax'); + $('#checkbox_drop_users_db').off('click'); + $(document).off('click', '.checkall_box'); + $(document).off('change', '#checkbox_SSL_priv'); + $(document).off('change', 'input[name="ssl_type"]'); + $(document).off('change', '#select_authentication_plugin'); +}); + +AJAX.registerOnload('server_privileges.js', function () { + /** + * Display a warning if there is already a user by the name entered as the username. + */ + $('#fieldset_add_user_login').on('change', 'input[name=\'username\']', function () { + var username = $(this).val(); + var $warning = $('#user_exists_warning'); + if ($('#select_pred_username').val() === 'userdefined' && username !== '') { + var href = $('form[name=\'usersForm\']').attr('action'); + var params = { + 'ajax_request' : true, + 'server' : PMA_commonParams.get('server'), + 'validate_username' : true, + 'username' : username + }; + $.get(href, params, function (data) { + if (data.user_exists) { + $warning.show(); + } else { + $warning.hide(); + } + }); + } else { + $warning.hide(); + } + }); + + /** + * Indicating password strength + */ + $('#text_pma_pw').on('keyup', function () { + meter_obj = $('#password_strength_meter'); + meter_obj_label = $('#password_strength'); + username = $('input[name="username"]'); + username = username.val(); + checkPasswordStrength($(this).val(), meter_obj, meter_obj_label, username); + }); + + /** + * Automatically switching to 'Use Text field' from 'No password' once start writing in text area + */ + $('#text_pma_pw').on('input', function () { + if ($('#text_pma_pw').val() !== '') { + $('#select_pred_password').val('userdefined'); + } + }); + + $('#text_pma_change_pw').on('keyup', function () { + meter_obj = $('#change_password_strength_meter'); + meter_obj_label = $('#change_password_strength'); + checkPasswordStrength($(this).val(), meter_obj, meter_obj_label, PMA_commonParams.get('user')); + }); + + /** + * Display a notice if sha256_password is selected + */ + $(document).on('change', '#select_authentication_plugin', function () { + var selected_plugin = $(this).val(); + if (selected_plugin === 'sha256_password') { + $('#ssl_reqd_warning').show(); + } else { + $('#ssl_reqd_warning').hide(); + } + }); + + /** + * AJAX handler for 'Revoke User' + * + * @see PMA_ajaxShowMessage() + * @memberOf jQuery + * @name revoke_user_click + */ + $(document).on('click', '#fieldset_delete_user_footer #buttonGo.ajax', function (event) { + event.preventDefault(); + + var $thisButton = $(this); + var $form = $('#usersForm'); + + $thisButton.PMA_confirm(PMA_messages.strDropUserWarning, $form.attr('action'), function (url) { + var $drop_users_db_checkbox = $('#checkbox_drop_users_db'); + if ($drop_users_db_checkbox.is(':checked')) { + var is_confirmed = confirm(PMA_messages.strDropDatabaseStrongWarning + '\n' + PMA_sprintf(PMA_messages.strDoYouReally, 'DROP DATABASE')); + if (! is_confirmed) { + // Uncheck the drop users database checkbox + $drop_users_db_checkbox.prop('checked', false); + } + } + + PMA_ajaxShowMessage(PMA_messages.strRemovingSelectedUsers); + + var argsep = PMA_commonParams.get('arg_separator'); + $.post(url, $form.serialize() + argsep + 'delete=' + $thisButton.val() + argsep + 'ajax_request=true', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxShowMessage(data.message); + // Refresh navigation, if we droppped some databases with the name + // that is the same as the username of the deleted user + if ($('#checkbox_drop_users_db:checked').length) { + PMA_reloadNavigation(); + } + // Remove the revoked user from the users list + $form.find('input:checkbox:checked').parents('tr').slideUp('medium', function () { + var this_user_initial = $(this).find('input:checkbox').val().charAt(0).toUpperCase(); + $(this).remove(); + + // If this is the last user with this_user_initial, remove the link from #initials_table + if ($('#tableuserrights').find('input:checkbox[value^="' + this_user_initial + '"], input:checkbox[value^="' + this_user_initial.toLowerCase() + '"]').length === 0) { + $('#initials_table').find('td > a:contains(' + this_user_initial + ')').parent('td').html(this_user_initial); + } + + // Re-check the classes of each row + $form + .find('tbody').find('tr:odd') + .removeClass('even').addClass('odd') + .end() + .find('tr:even') + .removeClass('odd').addClass('even'); + + // update the checkall checkbox + $(checkboxes_sel).trigger('change'); + }); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + }); + }); // end Revoke User + + $(document).on('click', 'a.edit_user_group_anchor.ajax', function (event) { + event.preventDefault(); + $(this).parents('tr').addClass('current_row'); + var $msg = PMA_ajaxShowMessage(); + $.get( + $(this).attr('href'), + { + 'ajax_request': true, + 'edit_user_group_dialog': true + }, + function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxRemoveMessage($msg); + var buttonOptions = {}; + buttonOptions[PMA_messages.strGo] = function () { + var usrGroup = $('#changeUserGroupDialog') + .find('select[name="userGroup"]') + .val(); + var $message = PMA_ajaxShowMessage(); + var argsep = PMA_commonParams.get('arg_separator'); + $.post( + 'server_privileges.php', + $('#changeUserGroupDialog').find('form').serialize() + argsep + 'ajax_request=1', + function (data) { + PMA_ajaxRemoveMessage($message); + if (typeof data !== 'undefined' && data.success === true) { + $('#usersForm') + .find('.current_row') + .removeClass('current_row') + .find('.usrGroup') + .text(usrGroup); + } else { + PMA_ajaxShowMessage(data.error, false); + $('#usersForm') + .find('.current_row') + .removeClass('current_row'); + } + } + ); + $(this).dialog('close'); + }; + buttonOptions[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + var $dialog = $('
    ') + .attr('id', 'changeUserGroupDialog') + .append(data.message) + .dialog({ + width: 500, + minWidth: 300, + modal: true, + buttons: buttonOptions, + title: $('legend', $(data.message)).text(), + close: function () { + $(this).remove(); + } + }); + $dialog.find('legend').remove(); + } else { + PMA_ajaxShowMessage(data.error, false); + $('#usersForm') + .find('.current_row') + .removeClass('current_row'); + } + } + ); + }); + + /** + * AJAX handler for 'Export Privileges' + * + * @see PMA_ajaxShowMessage() + * @memberOf jQuery + * @name export_user_click + */ + $(document).on('click', 'button.mult_submit[value=export]', function (event) { + event.preventDefault(); + // can't export if no users checked + if ($(this.form).find('input:checked').length === 0) { + PMA_ajaxShowMessage(PMA_messages.strNoAccountSelected, 2000, 'success'); + return; + } + var $msgbox = PMA_ajaxShowMessage(); + var button_options = {}; + button_options[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + var argsep = PMA_commonParams.get('arg_separator'); + var serverId = PMA_commonParams.get('server'); + var selectedUsers = $('#usersForm input[name*=\'selected_usr\']:checkbox').serialize(); + var postStr = selectedUsers + '&submit_mult=export' + argsep + 'ajax_request=true&server=' + serverId; + $.post( + $(this.form).prop('action'), + postStr, + function (data) { + if (typeof data !== 'undefined' && data.success === true) { + var $ajaxDialog = $('
    ') + .append(data.message) + .dialog({ + title: data.title, + width: 500, + buttons: button_options, + close: function () { + $(this).remove(); + } + }); + PMA_ajaxRemoveMessage($msgbox); + // Attach syntax highlighted editor to export dialog + PMA_getSQLEditor($ajaxDialog.find('textarea')); + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + ); // end $.post + }); + // if exporting non-ajax, highlight anyways + PMA_getSQLEditor($('textarea.export')); + + $(document).on('click', 'a.export_user_anchor.ajax', function (event) { + event.preventDefault(); + var $msgbox = PMA_ajaxShowMessage(); + /** + * @var button_options Object containing options for jQueryUI dialog buttons + */ + var button_options = {}; + button_options[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + $.get($(this).attr('href'), { 'ajax_request': true }, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + var $ajaxDialog = $('
    ') + .append(data.message) + .dialog({ + title: data.title, + width: 500, + buttons: button_options, + close: function () { + $(this).remove(); + } + }); + PMA_ajaxRemoveMessage($msgbox); + // Attach syntax highlighted editor to export dialog + PMA_getSQLEditor($ajaxDialog.find('textarea')); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.get + }); // end export privileges + + /** + * AJAX handler to Paginate the Users Table + * + * @see PMA_ajaxShowMessage() + * @name paginate_users_table_click + * @memberOf jQuery + */ + $(document).on('click', '#initials_table a.ajax', function (event) { + event.preventDefault(); + var $msgbox = PMA_ajaxShowMessage(); + $.get($(this).attr('href'), { 'ajax_request' : true }, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxRemoveMessage($msgbox); + // This form is not on screen when first entering Privileges + // if there are more than 50 users + $('div.notice').remove(); + $('#usersForm').hide('medium').remove(); + $('#fieldset_add_user').hide('medium').remove(); + $('#initials_table') + .prop('id', 'initials_table_old') + .after(data.message).show('medium') + .siblings('h2').not(':first').remove(); + // prevent double initials table + $('#initials_table_old').remove(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.get + }); // end of the paginate users table + + $(document).on('change', 'input[name="ssl_type"]', function (e) { + var $div = $('#specified_div'); + if ($('#ssl_type_SPECIFIED').is(':checked')) { + $div.find('input').prop('disabled', false); + } else { + $div.find('input').prop('disabled', true); + } + }); + + $(document).on('change', '#checkbox_SSL_priv', function (e) { + var $div = $('#require_ssl_div'); + if ($(this).is(':checked')) { + $div.find('input').prop('disabled', false); + $('#ssl_type_SPECIFIED').trigger('change'); + } else { + $div.find('input').prop('disabled', true); + } + }); + + $('#checkbox_SSL_priv').trigger('change'); + + /* + * Create submenu for simpler interface + */ + var addOrUpdateSubmenu = function () { + var $topmenu2 = $('#topmenu2'); + var $edit_user_dialog = $('#edit_user_dialog'); + var submenu_label; + var submenu_link; + var link_number; + + // if submenu exists yet, remove it first + if ($topmenu2.length > 0) { + $topmenu2.remove(); + } + + // construct a submenu from the existing fieldsets + $topmenu2 = $('
      ').prop('id', 'topmenu2'); + + $('#edit_user_dialog .submenu-item').each(function () { + submenu_label = $(this).find('legend[data-submenu-label]').data('submenu-label'); + + submenu_link = $('') + .prop('href', '#') + .html(submenu_label); + + $('
    • ') + .append(submenu_link) + .appendTo($topmenu2); + }); + + // click handlers for submenu + $topmenu2.find('a').click(function (e) { + e.preventDefault(); + // if already active, ignore click + if ($(this).hasClass('tabactive')) { + return; + } + $topmenu2.find('a').removeClass('tabactive'); + $(this).addClass('tabactive'); + + // which section to show now? + link_number = $topmenu2.find('a').index($(this)); + // hide all sections but the one to show + $('#edit_user_dialog .submenu-item').hide().eq(link_number).show(); + }); + + // make first menu item active + // TODO: support URL hash history + $topmenu2.find('> :first-child a').addClass('tabactive'); + $edit_user_dialog.prepend($topmenu2); + + // hide all sections but the first + $('#edit_user_dialog .submenu-item').hide().eq(0).show(); + + // scroll to the top + $('html, body').animate({ scrollTop: 0 }, 'fast'); + }; + + $('input.autofocus').focus(); + $(checkboxes_sel).trigger('change'); + displayPasswordGenerateButton(); + if ($('#edit_user_dialog').length > 0) { + addOrUpdateSubmenu(); + } + + var windowwidth = $(window).width(); + $('.jsresponsive').css('max-width', (windowwidth - 35) + 'px'); +}); diff --git a/phpMyAdmin/js/server_status_advisor.js b/phpMyAdmin/js/server_status_advisor.js new file mode 100755 index 0000000..a9f6886 --- /dev/null +++ b/phpMyAdmin/js/server_status_advisor.js @@ -0,0 +1,101 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Server Status Advisor + * + * @package PhpMyAdmin + */ + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_status_advisor.js', function () { + $('a[href="#openAdvisorInstructions"]').off('click'); + $('#statustabs_advisor').html(''); + $('#advisorDialog').remove(); + $('#instructionsDialog').remove(); +}); + +AJAX.registerOnload('server_status_advisor.js', function () { + // if no advisor is loaded + if ($('#advisorData').length === 0) { + return; + } + + /** ** Server config advisor ****/ + var $dialog = $('
      ').attr('id', 'advisorDialog'); + var $instructionsDialog = $('
      ') + .attr('id', 'instructionsDialog') + .html($('#advisorInstructionsDialog').html()); + + $('a[href="#openAdvisorInstructions"]').click(function () { + var dlgBtns = {}; + dlgBtns[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + $instructionsDialog.dialog({ + title: PMA_messages.strAdvisorSystem, + width: '60%', + buttons: dlgBtns + }); + }); + + var $cnt = $('#statustabs_advisor'); + var $tbody; + var $tr; + var str; + var even = true; + + data = JSON.parse($('#advisorData').text()); + $cnt.html(''); + + if (data.parse.errors.length > 0) { + $cnt.append('Rules file not well formed, following errors were found:
      - '); + $cnt.append(data.parse.errors.join('
      - ')); + $cnt.append('

      '); + } + + if (data.run.errors.length > 0) { + $cnt.append('Errors occurred while executing rule expressions:
      - '); + $cnt.append(data.run.errors.join('
      - ')); + $cnt.append('

      '); + } + + if (data.run.fired.length > 0) { + $cnt.append('

      ' + PMA_messages.strPerformanceIssues + '

      '); + $cnt.append('' + + '
      ' + PMA_messages.strIssuse + '' + PMA_messages.strRecommendation + + '
      '); + $tbody = $cnt.find('table#rulesFired'); + + var rc_stripped; + + $.each(data.run.fired, function (key, value) { + // recommendation may contain links, don't show those in overview table (clicking on them redirects the user) + rc_stripped = $.trim($('
      ').html(value.recommendation).text()); + $tbody.append($tr = $('' + + value.issue + '' + rc_stripped + ' ')); + even = !even; + $tr.data('rule', value); + + $tr.click(function () { + var rule = $(this).data('rule'); + $dialog + .dialog({ title: PMA_messages.strRuleDetails }) + .html( + '

      ' + PMA_messages.strIssuse + ':
      ' + rule.issue + '

      ' + + '

      ' + PMA_messages.strRecommendation + ':
      ' + rule.recommendation + '

      ' + + '

      ' + PMA_messages.strJustification + ':
      ' + rule.justification + '

      ' + + '

      ' + PMA_messages.strFormula + ':
      ' + rule.formula + '

      ' + + '

      ' + PMA_messages.strTest + ':
      ' + rule.test + '

      ' + ); + + var dlgBtns = {}; + dlgBtns[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + + $dialog.dialog({ width: 600, buttons: dlgBtns }); + }); + }); + } +}); diff --git a/phpMyAdmin/js/server_status_monitor.js b/phpMyAdmin/js/server_status_monitor.js new file mode 100755 index 0000000..8bff1ce --- /dev/null +++ b/phpMyAdmin/js/server_status_monitor.js @@ -0,0 +1,2197 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +var runtime = {}; +var server_time_diff; +var server_os; +var is_superuser; +var server_db_isLocal; +var chartSize; +AJAX.registerOnload('server_status_monitor.js', function () { + var $js_data_form = $('#js_data'); + server_time_diff = new Date().getTime() - $js_data_form.find('input[name=server_time]').val(); + server_os = $js_data_form.find('input[name=server_os]').val(); + is_superuser = $js_data_form.find('input[name=is_superuser]').val(); + server_db_isLocal = $js_data_form.find('input[name=server_db_isLocal]').val(); +}); + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_status_monitor.js', function () { + $('#emptyDialog').remove(); + $('#addChartDialog').remove(); + $('a.popupLink').off('click'); + $('body').off('click'); +}); +/** + * Popup behaviour + */ +AJAX.registerOnload('server_status_monitor.js', function () { + $('
      ') + .attr('id', 'emptyDialog') + .appendTo('#page_content'); + $('#addChartDialog') + .appendTo('#page_content'); + + $('a.popupLink').click(function () { + var $link = $(this); + $('div.' + $link.attr('href').substr(1)) + .show() + .offset({ top: $link.offset().top + $link.height() + 5, left: $link.offset().left }) + .addClass('openedPopup'); + + return false; + }); + $('body').click(function (event) { + $('div.openedPopup').each(function () { + var $cnt = $(this); + var pos = $cnt.offset(); + // Hide if the mouseclick is outside the popupcontent + if (event.pageX < pos.left || + event.pageY < pos.top || + event.pageX > pos.left + $cnt.outerWidth() || + event.pageY > pos.top + $cnt.outerHeight() + ) { + $cnt.hide().removeClass('openedPopup'); + } + }); + }); +}); + +AJAX.registerTeardown('server_status_monitor.js', function () { + $('a[href="#rearrangeCharts"], a[href="#endChartEditMode"]').off('click'); + $('div.popupContent select[name="chartColumns"]').off('change'); + $('div.popupContent select[name="gridChartRefresh"]').off('change'); + $('a[href="#addNewChart"]').off('click'); + $('a[href="#exportMonitorConfig"]').off('click'); + $('a[href="#importMonitorConfig"]').off('click'); + $('a[href="#clearMonitorConfig"]').off('click'); + $('a[href="#pauseCharts"]').off('click'); + $('a[href="#monitorInstructionsDialog"]').off('click'); + $('input[name="chartType"]').off('click'); + $('input[name="useDivisor"]').off('click'); + $('input[name="useUnit"]').off('click'); + $('select[name="varChartList"]').off('click'); + $('a[href="#kibDivisor"]').off('click'); + $('a[href="#mibDivisor"]').off('click'); + $('a[href="#submitClearSeries"]').off('click'); + $('a[href="#submitAddSeries"]').off('click'); + // $("input#variableInput").destroy(); + $('#chartPreset').off('click'); + $('#chartStatusVar').off('click'); + destroyGrid(); +}); + +AJAX.registerOnload('server_status_monitor.js', function () { + // Show tab links + $('div.tabLinks').show(); + $('#loadingMonitorIcon').remove(); + // Codemirror is loaded on demand so we might need to initialize it + if (! codemirror_editor) { + var $elm = $('#sqlquery'); + if ($elm.length > 0 && typeof CodeMirror !== 'undefined') { + codemirror_editor = CodeMirror.fromTextArea( + $elm[0], + { + lineNumbers: true, + matchBrackets: true, + indentUnit: 4, + mode: 'text/x-mysql', + lineWrapping: true + } + ); + } + } + // Timepicker is loaded on demand so we need to initialize + // datetime fields from the 'load log' dialog + $('#logAnalyseDialog').find('.datetimefield').each(function () { + PMA_addDatepicker($(this)); + }); + + /** ** Monitor charting implementation ****/ + /* Saves the previous ajax response for differential values */ + var oldChartData = null; + // Holds about to be created chart + var newChart = null; + var chartSpacing; + + // Whenever the monitor object (runtime.charts) or the settings object + // (monitorSettings) changes in a way incompatible to the previous version, + // increase this number. It will reset the users monitor and settings object + // in his localStorage to the default configuration + var monitorProtocolVersion = '1.0'; + + // Runtime parameter of the monitor, is being fully set in initGrid() + runtime = { + // Holds all visible charts in the grid + charts: null, + // Stores the timeout handler so it can be cleared + refreshTimeout: null, + // Stores the GET request to refresh the charts + refreshRequest: null, + // Chart auto increment + chartAI: 0, + // To play/pause the monitor + redrawCharts: false, + // Object that contains a list of nodes that need to be retrieved + // from the server for chart updates + dataList: [], + // Current max points per chart (needed for auto calculation) + gridMaxPoints: 20, + // displayed time frame + xmin: -1, + xmax: -1 + }; + var monitorSettings = null; + + var defaultMonitorSettings = { + columns: 3, + chartSize: { width: 295, height: 250 }, + // Max points in each chart. Settings it to 'auto' sets + // gridMaxPoints to (chartwidth - 40) / 12 + gridMaxPoints: 'auto', + /* Refresh rate of all grid charts in ms */ + gridRefresh: 5000 + }; + + // Allows drag and drop rearrange and print/edit icons on charts + var editMode = false; + + /* List of preconfigured charts that the user may select */ + var presetCharts = { + // Query cache efficiency + 'qce': { + title: PMA_messages.strQueryCacheEfficiency, + series: [{ + label: PMA_messages.strQueryCacheEfficiency + }], + nodes: [{ + dataPoints: [{ type: 'statusvar', name: 'Qcache_hits' }, { type: 'statusvar', name: 'Com_select' }], + transformFn: 'qce' + }], + maxYLabel: 0 + }, + // Query cache usage + 'qcu': { + title: PMA_messages.strQueryCacheUsage, + series: [{ + label: PMA_messages.strQueryCacheUsed + }], + nodes: [{ + dataPoints: [{ type: 'statusvar', name: 'Qcache_free_memory' }, { type: 'servervar', name: 'query_cache_size' }], + transformFn: 'qcu' + }], + maxYLabel: 0 + } + }; + + // time span selection + var selectionTimeDiff = []; + var selectionStartX; + var selectionStartY; + var selectionEndX; + var selectionEndY; + var drawTimeSpan = false; + + // chart tooltip + var tooltipBox; + + /* Add OS specific system info charts to the preset chart list */ + switch (server_os) { + case 'WINNT': + $.extend(presetCharts, { + 'cpu': { + title: PMA_messages.strSystemCPUUsage, + series: [{ + label: PMA_messages.strAverageLoad + }], + nodes: [{ + dataPoints: [{ type: 'cpu', name: 'loadavg' }] + }], + maxYLabel: 100 + }, + + 'memory': { + title: PMA_messages.strSystemMemory, + series: [{ + label: PMA_messages.strTotalMemory, + fill: true + }, { + dataType: 'memory', + label: PMA_messages.strUsedMemory, + fill: true + }], + nodes: [{ dataPoints: [{ type: 'memory', name: 'MemTotal' }], valueDivisor: 1024 }, + { dataPoints: [{ type: 'memory', name: 'MemUsed' }], valueDivisor: 1024 } + ], + maxYLabel: 0 + }, + + 'swap': { + title: PMA_messages.strSystemSwap, + series: [{ + label: PMA_messages.strTotalSwap, + fill: true + }, { + label: PMA_messages.strUsedSwap, + fill: true + }], + nodes: [{ dataPoints: [{ type: 'memory', name: 'SwapTotal' }] }, + { dataPoints: [{ type: 'memory', name: 'SwapUsed' }] } + ], + maxYLabel: 0 + } + }); + break; + + case 'Linux': + $.extend(presetCharts, { + 'cpu': { + title: PMA_messages.strSystemCPUUsage, + series: [{ + label: PMA_messages.strAverageLoad + }], + nodes: [{ dataPoints: [{ type: 'cpu', name: 'irrelevant' }], transformFn: 'cpu-linux' }], + maxYLabel: 0 + }, + 'memory': { + title: PMA_messages.strSystemMemory, + series: [ + { label: PMA_messages.strBufferedMemory, fill: true }, + { label: PMA_messages.strUsedMemory, fill: true }, + { label: PMA_messages.strCachedMemory, fill: true }, + { label: PMA_messages.strFreeMemory, fill: true } + ], + nodes: [ + { dataPoints: [{ type: 'memory', name: 'Buffers' }], valueDivisor: 1024 }, + { dataPoints: [{ type: 'memory', name: 'MemUsed' }], valueDivisor: 1024 }, + { dataPoints: [{ type: 'memory', name: 'Cached' }], valueDivisor: 1024 }, + { dataPoints: [{ type: 'memory', name: 'MemFree' }], valueDivisor: 1024 } + ], + maxYLabel: 0 + }, + 'swap': { + title: PMA_messages.strSystemSwap, + series: [ + { label: PMA_messages.strCachedSwap, fill: true }, + { label: PMA_messages.strUsedSwap, fill: true }, + { label: PMA_messages.strFreeSwap, fill: true } + ], + nodes: [ + { dataPoints: [{ type: 'memory', name: 'SwapCached' }], valueDivisor: 1024 }, + { dataPoints: [{ type: 'memory', name: 'SwapUsed' }], valueDivisor: 1024 }, + { dataPoints: [{ type: 'memory', name: 'SwapFree' }], valueDivisor: 1024 } + ], + maxYLabel: 0 + } + }); + break; + + case 'SunOS': + $.extend(presetCharts, { + 'cpu': { + title: PMA_messages.strSystemCPUUsage, + series: [{ + label: PMA_messages.strAverageLoad + }], + nodes: [{ + dataPoints: [{ type: 'cpu', name: 'loadavg' }] + }], + maxYLabel: 0 + }, + 'memory': { + title: PMA_messages.strSystemMemory, + series: [ + { label: PMA_messages.strUsedMemory, fill: true }, + { label: PMA_messages.strFreeMemory, fill: true } + ], + nodes: [ + { dataPoints: [{ type: 'memory', name: 'MemUsed' }], valueDivisor: 1024 }, + { dataPoints: [{ type: 'memory', name: 'MemFree' }], valueDivisor: 1024 } + ], + maxYLabel: 0 + }, + 'swap': { + title: PMA_messages.strSystemSwap, + series: [ + { label: PMA_messages.strUsedSwap, fill: true }, + { label: PMA_messages.strFreeSwap, fill: true } + ], + nodes: [ + { dataPoints: [{ type: 'memory', name: 'SwapUsed' }], valueDivisor: 1024 }, + { dataPoints: [{ type: 'memory', name: 'SwapFree' }], valueDivisor: 1024 } + ], + maxYLabel: 0 + } + }); + break; + } + + // Default setting for the chart grid + var defaultChartGrid = { + 'c0': { + title: PMA_messages.strQuestions, + series: [ + { label: PMA_messages.strQuestions } + ], + nodes: [ + { dataPoints: [{ type: 'statusvar', name: 'Questions' }], display: 'differential' } + ], + maxYLabel: 0 + }, + 'c1': { + title: PMA_messages.strChartConnectionsTitle, + series: [ + { label: PMA_messages.strConnections }, + { label: PMA_messages.strProcesses } + ], + nodes: [ + { dataPoints: [{ type: 'statusvar', name: 'Connections' }], display: 'differential' }, + { dataPoints: [{ type: 'proc', name: 'processes' }] } + ], + maxYLabel: 0 + }, + 'c2': { + title: PMA_messages.strTraffic, + series: [ + { label: PMA_messages.strBytesSent }, + { label: PMA_messages.strBytesReceived } + ], + nodes: [ + { dataPoints: [{ type: 'statusvar', name: 'Bytes_sent' }], display: 'differential', valueDivisor: 1024 }, + { dataPoints: [{ type: 'statusvar', name: 'Bytes_received' }], display: 'differential', valueDivisor: 1024 } + ], + maxYLabel: 0 + } + }; + + // Server is localhost => We can add cpu/memory/swap to the default chart + if (server_db_isLocal && typeof presetCharts.cpu !== 'undefined') { + defaultChartGrid.c3 = presetCharts.cpu; + defaultChartGrid.c4 = presetCharts.memory; + defaultChartGrid.c5 = presetCharts.swap; + } + + $('a[href="#rearrangeCharts"], a[href="#endChartEditMode"]').click(function (event) { + event.preventDefault(); + editMode = !editMode; + if ($(this).attr('href') === '#endChartEditMode') { + editMode = false; + } + + $('a[href="#endChartEditMode"]').toggle(editMode); + + if (editMode) { + // Close the settings popup + $('div.popupContent').hide().removeClass('openedPopup'); + + $('#chartGrid').sortableTable({ + ignoreRect: { + top: 8, + left: chartSize.width - 63, + width: 54, + height: 24 + } + }); + } else { + $('#chartGrid').sortableTable('destroy'); + } + saveMonitor(); // Save settings + return false; + }); + + // global settings + $('div.popupContent select[name="chartColumns"]').change(function () { + monitorSettings.columns = parseInt(this.value, 10); + + calculateChartSize(); + // Empty cells should keep their size so you can drop onto them + $('#chartGrid').find('tr td').css('width', chartSize.width + 'px'); + $('#chartGrid').find('.monitorChart').css({ + width: chartSize.width + 'px', + height: chartSize.height + 'px' + }); + + /* Reorder all charts that it fills all column cells */ + var numColumns; + var $tr = $('#chartGrid').find('tr:first'); + var row = 0; + + var tempManageCols = function () { + if (numColumns > monitorSettings.columns) { + if ($tr.next().length === 0) { + $tr.after(''); + } + $tr.next().prepend($(this)); + } + numColumns++; + }; + + var tempAddCol = function () { + if ($(this).next().length !== 0) { + $(this).append($(this).next().find('td:first')); + } + }; + + while ($tr.length !== 0) { + numColumns = 1; + // To many cells in one row => put into next row + $tr.find('td').each(tempManageCols); + + // To little cells in one row => for each cell to little, + // move all cells backwards by 1 + if ($tr.next().length > 0) { + var cnt = monitorSettings.columns - $tr.find('td').length; + for (var i = 0; i < cnt; i++) { + $tr.append($tr.next().find('td:first')); + $tr.nextAll().each(tempAddCol); + } + } + + $tr = $tr.next(); + row++; + } + + if (monitorSettings.gridMaxPoints === 'auto') { + runtime.gridMaxPoints = Math.round((chartSize.width - 40) / 12); + } + + runtime.xmin = new Date().getTime() - server_time_diff - runtime.gridMaxPoints * monitorSettings.gridRefresh; + runtime.xmax = new Date().getTime() - server_time_diff + monitorSettings.gridRefresh; + + if (editMode) { + $('#chartGrid').sortableTable('refresh'); + } + + refreshChartGrid(); + saveMonitor(); // Save settings + }); + + $('div.popupContent select[name="gridChartRefresh"]').change(function () { + monitorSettings.gridRefresh = parseInt(this.value, 10) * 1000; + clearTimeout(runtime.refreshTimeout); + + if (runtime.refreshRequest) { + runtime.refreshRequest.abort(); + } + + runtime.xmin = new Date().getTime() - server_time_diff - runtime.gridMaxPoints * monitorSettings.gridRefresh; + // fixing chart shift towards left on refresh rate change + // runtime.xmax = new Date().getTime() - server_time_diff + monitorSettings.gridRefresh; + runtime.refreshTimeout = setTimeout(refreshChartGrid, monitorSettings.gridRefresh); + + saveMonitor(); // Save settings + }); + + $('a[href="#addNewChart"]').click(function (event) { + event.preventDefault(); + var dlgButtons = { }; + + dlgButtons[PMA_messages.strAddChart] = function () { + var type = $('input[name="chartType"]:checked').val(); + + if (type === 'preset') { + newChart = presetCharts[$('#addChartDialog').find('select[name="presetCharts"]').prop('value')]; + } else { + // If user builds his own chart, it's being set/updated + // each time he adds a series + // So here we only warn if he didn't add a series yet + if (! newChart || ! newChart.nodes || newChart.nodes.length === 0) { + alert(PMA_messages.strAddOneSeriesWarning); + return; + } + } + + newChart.title = $('input[name="chartTitle"]').val(); + // Add a cloned object to the chart grid + addChart($.extend(true, {}, newChart)); + + newChart = null; + + saveMonitor(); // Save settings + + $(this).dialog('close'); + }; + + dlgButtons[PMA_messages.strClose] = function () { + newChart = null; + $('span#clearSeriesLink').hide(); + $('#seriesPreview').html(''); + $(this).dialog('close'); + }; + + var $presetList = $('#addChartDialog').find('select[name="presetCharts"]'); + if ($presetList.html().length === 0) { + $.each(presetCharts, function (key, value) { + $presetList.append(''); + }); + $presetList.change(function () { + $('input[name="chartTitle"]').val( + $presetList.find(':selected').text() + ); + $('#chartPreset').prop('checked', true); + }); + $('#chartPreset').click(function () { + $('input[name="chartTitle"]').val( + $presetList.find(':selected').text() + ); + }); + $('#chartStatusVar').click(function () { + $('input[name="chartTitle"]').val( + $('#chartSeries').find(':selected').text().replace(/_/g, ' ') + ); + }); + $('#chartSeries').change(function () { + $('input[name="chartTitle"]').val( + $('#chartSeries').find(':selected').text().replace(/_/g, ' ') + ); + }); + } + + $('#addChartDialog').dialog({ + width: 'auto', + height: 'auto', + buttons: dlgButtons + }); + + $('#seriesPreview').html('' + PMA_messages.strNone + ''); + + return false; + }); + + $('a[href="#exportMonitorConfig"]').click(function (event) { + event.preventDefault(); + var gridCopy = {}; + $.each(runtime.charts, function (key, elem) { + gridCopy[key] = {}; + gridCopy[key].nodes = elem.nodes; + gridCopy[key].series = elem.series; + gridCopy[key].settings = elem.settings; + gridCopy[key].title = elem.title; + gridCopy[key].maxYLabel = elem.maxYLabel; + }); + var exportData = { + monitorCharts: gridCopy, + monitorSettings: monitorSettings + }; + + var blob = new Blob([JSON.stringify(exportData)], { type: 'application/octet-stream' }); + var url = null; + var fileName = 'monitor-config.json'; + if (window.navigator && window.navigator.msSaveOrOpenBlob) { + window.navigator.msSaveOrOpenBlob(blob, fileName); + } else { + url = URL.createObjectURL(blob); + window.location.href = url; + } + setTimeout(function () { + // For some browsers it is necessary to delay revoking the ObjectURL + if (url !== null) { + window.URL.revokeObjectURL(url); + } + url = undefined; + blob = undefined; + }, 100); + }); + + $('a[href="#importMonitorConfig"]').click(function (event) { + event.preventDefault(); + $('#emptyDialog').dialog({ title: PMA_messages.strImportDialogTitle }); + $('#emptyDialog').html(PMA_messages.strImportDialogMessage + ':
      ' + + '
      '); + + var dlgBtns = {}; + + dlgBtns[PMA_messages.strImport] = function () { + var input = $('#emptyDialog').find('#import_file')[0]; + var reader = new FileReader(); + + reader.onerror = function (event) { + alert(PMA_messages.strFailedParsingConfig + '\n' + event.target.error.code); + }; + reader.onload = function (e) { + var data = e.target.result; + var json = null; + // Try loading config + try { + json = JSON.parse(data); + } catch (err) { + alert(PMA_messages.strFailedParsingConfig); + $('#emptyDialog').dialog('close'); + return; + } + + // Basic check, is this a monitor config json? + if (!json || ! json.monitorCharts || ! json.monitorCharts) { + alert(PMA_messages.strFailedParsingConfig); + $('#emptyDialog').dialog('close'); + return; + } + + // If json ok, try applying config + try { + if (isStorageSupported('localStorage')) { + window.localStorage.monitorCharts = JSON.stringify(json.monitorCharts); + window.localStorage.monitorSettings = JSON.stringify(json.monitorSettings); + } + rebuildGrid(); + } catch (err) { + alert(PMA_messages.strFailedBuildingGrid); + // If an exception is thrown, load default again + if (isStorageSupported('localStorage')) { + window.localStorage.removeItem('monitorCharts'); + window.localStorage.removeItem('monitorSettings'); + } + rebuildGrid(); + } + + $('#emptyDialog').dialog('close'); + }; + reader.readAsText(input.files[0]); + }; + + dlgBtns[PMA_messages.strCancel] = function () { + $(this).dialog('close'); + }; + + $('#emptyDialog').dialog({ + width: 'auto', + height: 'auto', + buttons: dlgBtns + }); + }); + + $('a[href="#clearMonitorConfig"]').click(function (event) { + event.preventDefault(); + if (isStorageSupported('localStorage')) { + window.localStorage.removeItem('monitorCharts'); + window.localStorage.removeItem('monitorSettings'); + window.localStorage.removeItem('monitorVersion'); + } + $(this).hide(); + rebuildGrid(); + }); + + $('a[href="#pauseCharts"]').click(function (event) { + event.preventDefault(); + runtime.redrawCharts = ! runtime.redrawCharts; + if (! runtime.redrawCharts) { + $(this).html(PMA_getImage('play') + PMA_messages.strResumeMonitor); + } else { + $(this).html(PMA_getImage('pause') + PMA_messages.strPauseMonitor); + if (! runtime.charts) { + initGrid(); + $('a[href="#settingsPopup"]').show(); + } + } + return false; + }); + + $('a[href="#monitorInstructionsDialog"]').click(function (event) { + event.preventDefault(); + + var $dialog = $('#monitorInstructionsDialog'); + + $dialog.dialog({ + width: '60%', + height: 'auto' + }).find('img.ajaxIcon').show(); + + var loadLogVars = function (getvars) { + var vars = { ajax_request: true, logging_vars: true }; + if (getvars) { + $.extend(vars, getvars); + } + + $.post('server_status_monitor.php' + PMA_commonParams.get('common_query'), vars, + function (data) { + var logVars; + if (typeof data !== 'undefined' && data.success === true) { + logVars = data.message; + } else { + return serverResponseError(); + } + var icon = PMA_getImage('s_success'); + var msg = ''; + var str = ''; + + if (logVars.general_log === 'ON') { + if (logVars.slow_query_log === 'ON') { + msg = PMA_messages.strBothLogOn; + } else { + msg = PMA_messages.strGenLogOn; + } + } + + if (msg.length === 0 && logVars.slow_query_log === 'ON') { + msg = PMA_messages.strSlowLogOn; + } + + if (msg.length === 0) { + icon = PMA_getImage('s_error'); + msg = PMA_messages.strBothLogOff; + } + + str = '' + PMA_messages.strCurrentSettings + '
      '; + str += icon + msg + '
      '; + + if (logVars.log_output !== 'TABLE') { + str += PMA_getImage('s_error') + ' ' + PMA_messages.strLogOutNotTable + '
      '; + } else { + str += PMA_getImage('s_success') + ' ' + PMA_messages.strLogOutIsTable + '
      '; + } + + if (logVars.slow_query_log === 'ON') { + if (logVars.long_query_time > 2) { + str += PMA_getImage('s_attention') + ' '; + str += PMA_sprintf(PMA_messages.strSmallerLongQueryTimeAdvice, logVars.long_query_time); + str += '
      '; + } + + if (logVars.long_query_time < 2) { + str += PMA_getImage('s_success') + ' '; + str += PMA_sprintf(PMA_messages.strLongQueryTimeSet, logVars.long_query_time); + str += '
      '; + } + } + + str += '
      '; + + if (is_superuser) { + str += '

      ' + PMA_messages.strChangeSettings + ''; + str += '
      '; + + $dialog.find('div.monitorUse').toggle( + logVars.log_output === 'TABLE' && (logVars.slow_query_log === 'ON' || logVars.general_log === 'ON') + ); + + $dialog.find('div.ajaxContent').html(str); + $dialog.find('img.ajaxIcon').hide(); + $dialog.find('a.set').click(function () { + var nameValue = $(this).attr('href').split('-'); + loadLogVars({ varName: nameValue[0].substr(1), varValue: nameValue[1] }); + $dialog.find('img.ajaxIcon').show(); + }); + } + ); + }; + + + loadLogVars(); + + return false; + }); + + $('input[name="chartType"]').change(function () { + $('#chartVariableSettings').toggle(this.checked && this.value === 'variable'); + var title = $('input[name="chartTitle"]').val(); + if (title === PMA_messages.strChartTitle || + title === $('label[for="' + $('input[name="chartTitle"]').data('lastRadio') + '"]').text() + ) { + $('input[name="chartTitle"]') + .data('lastRadio', $(this).attr('id')) + .val($('label[for="' + $(this).attr('id') + '"]').text()); + } + }); + + $('input[name="useDivisor"]').change(function () { + $('span.divisorInput').toggle(this.checked); + }); + + $('input[name="useUnit"]').change(function () { + $('span.unitInput').toggle(this.checked); + }); + + $('select[name="varChartList"]').change(function () { + if (this.selectedIndex !== 0) { + $('#variableInput').val(this.value); + } + }); + + $('a[href="#kibDivisor"]').click(function (event) { + event.preventDefault(); + $('input[name="valueDivisor"]').val(1024); + $('input[name="valueUnit"]').val(PMA_messages.strKiB); + $('span.unitInput').toggle(true); + $('input[name="useUnit"]').prop('checked', true); + return false; + }); + + $('a[href="#mibDivisor"]').click(function (event) { + event.preventDefault(); + $('input[name="valueDivisor"]').val(1024 * 1024); + $('input[name="valueUnit"]').val(PMA_messages.strMiB); + $('span.unitInput').toggle(true); + $('input[name="useUnit"]').prop('checked', true); + return false; + }); + + $('a[href="#submitClearSeries"]').click(function (event) { + event.preventDefault(); + $('#seriesPreview').html('' + PMA_messages.strNone + ''); + newChart = null; + $('#clearSeriesLink').hide(); + }); + + $('a[href="#submitAddSeries"]').click(function (event) { + event.preventDefault(); + if ($('#variableInput').val() === '') { + return false; + } + + if (newChart === null) { + $('#seriesPreview').html(''); + + newChart = { + title: $('input[name="chartTitle"]').val(), + nodes: [], + series: [], + maxYLabel: 0 + }; + } + + var serie = { + dataPoints: [{ type: 'statusvar', name: $('#variableInput').val() }], + display: $('input[name="differentialValue"]').prop('checked') ? 'differential' : '' + }; + + if (serie.dataPoints[0].name === 'Processes') { + serie.dataPoints[0].type = 'proc'; + } + + if ($('input[name="useDivisor"]').prop('checked')) { + serie.valueDivisor = parseInt($('input[name="valueDivisor"]').val(), 10); + } + + if ($('input[name="useUnit"]').prop('checked')) { + serie.unit = $('input[name="valueUnit"]').val(); + } + + var str = serie.display === 'differential' ? ', ' + PMA_messages.strDifferential : ''; + str += serie.valueDivisor ? (', ' + PMA_sprintf(PMA_messages.strDividedBy, serie.valueDivisor)) : ''; + str += serie.unit ? (', ' + PMA_messages.strUnit + ': ' + serie.unit) : ''; + + var newSeries = { + label: $('#variableInput').val().replace(/_/g, ' ') + }; + newChart.series.push(newSeries); + $('#seriesPreview').append('- ' + escapeHtml(newSeries.label + str) + '
      '); + newChart.nodes.push(serie); + $('#variableInput').val(''); + $('input[name="differentialValue"]').prop('checked', true); + $('input[name="useDivisor"]').prop('checked', false); + $('input[name="useUnit"]').prop('checked', false); + $('input[name="useDivisor"]').trigger('change'); + $('input[name="useUnit"]').trigger('change'); + $('select[name="varChartList"]').get(0).selectedIndex = 0; + + $('#clearSeriesLink').show(); + + return false; + }); + + $('#variableInput').autocomplete({ + source: variableNames + }); + + /* Initializes the monitor, called only once */ + function initGrid () { + var i; + + /* Apply default values & config */ + if (isStorageSupported('localStorage')) { + if (typeof window.localStorage.monitorCharts !== 'undefined') { + runtime.charts = JSON.parse(window.localStorage.monitorCharts); + } + if (typeof window.localStorage.monitorSettings !== 'undefined') { + monitorSettings = JSON.parse(window.localStorage.monitorSettings); + } + + $('a[href="#clearMonitorConfig"]').toggle(runtime.charts !== null); + + if (runtime.charts !== null + && typeof window.localStorage.monitorVersion !== 'undefined' + && monitorProtocolVersion !== window.localStorage.monitorVersion + ) { + $('#emptyDialog').dialog({ title: PMA_messages.strIncompatibleMonitorConfig }); + $('#emptyDialog').html(PMA_messages.strIncompatibleMonitorConfigDescription); + + var dlgBtns = {}; + dlgBtns[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + + $('#emptyDialog').dialog({ + width: 400, + buttons: dlgBtns + }); + } + } + + if (runtime.charts === null) { + runtime.charts = defaultChartGrid; + } + if (monitorSettings === null) { + monitorSettings = defaultMonitorSettings; + } + + $('select[name="gridChartRefresh"]').val(monitorSettings.gridRefresh / 1000); + $('select[name="chartColumns"]').val(monitorSettings.columns); + + if (monitorSettings.gridMaxPoints === 'auto') { + runtime.gridMaxPoints = Math.round((monitorSettings.chartSize.width - 40) / 12); + } else { + runtime.gridMaxPoints = monitorSettings.gridMaxPoints; + } + + runtime.xmin = new Date().getTime() - server_time_diff - runtime.gridMaxPoints * monitorSettings.gridRefresh; + runtime.xmax = new Date().getTime() - server_time_diff + monitorSettings.gridRefresh; + + /* Calculate how much spacing there is between each chart */ + $('#chartGrid').html(''); + chartSpacing = { + width: $('#chartGrid').find('td:nth-child(2)').offset().left - + $('#chartGrid').find('td:nth-child(1)').offset().left, + height: $('#chartGrid').find('tr:nth-child(2) td:nth-child(2)').offset().top - + $('#chartGrid').find('tr:nth-child(1) td:nth-child(1)').offset().top + }; + $('#chartGrid').html(''); + + /* Add all charts - in correct order */ + var keys = []; + $.each(runtime.charts, function (key, value) { + keys.push(key); + }); + keys.sort(); + for (i = 0; i < keys.length; i++) { + addChart(runtime.charts[keys[i]], true); + } + + /* Fill in missing cells */ + var numCharts = $('#chartGrid').find('.monitorChart').length; + var numMissingCells = (monitorSettings.columns - numCharts % monitorSettings.columns) % monitorSettings.columns; + for (i = 0; i < numMissingCells; i++) { + $('#chartGrid').find('tr:last').append(''); + } + + // Empty cells should keep their size so you can drop onto them + calculateChartSize(); + $('#chartGrid').find('tr td').css('width', chartSize.width + 'px'); + + buildRequiredDataList(); + refreshChartGrid(); + } + + /* Calls destroyGrid() and initGrid(), but before doing so it saves the chart + * data from each chart and restores it after the monitor is initialized again */ + function rebuildGrid () { + var oldData = null; + if (runtime.charts) { + oldData = {}; + $.each(runtime.charts, function (key, chartObj) { + for (var i = 0, l = chartObj.nodes.length; i < l; i++) { + oldData[chartObj.nodes[i].dataPoint] = []; + for (var j = 0, ll = chartObj.chart.series[i].data.length; j < ll; j++) { + oldData[chartObj.nodes[i].dataPoint].push([chartObj.chart.series[i].data[j].x, chartObj.chart.series[i].data[j].y]); + } + } + }); + } + + destroyGrid(); + initGrid(); + } + + /* Calculactes the dynamic chart size that depends on the column width */ + function calculateChartSize () { + var panelWidth; + if ($('body').height() > $(window).height()) { // has vertical scroll bar + panelWidth = $('#logTable').innerWidth(); + } else { + panelWidth = $('#logTable').innerWidth() - 10; // leave some space for vertical scroll bar + } + + var wdt = panelWidth; + var windowWidth = $(window).width(); + + if (windowWidth > 768) { + wdt = (panelWidth - monitorSettings.columns * chartSpacing.width) / monitorSettings.columns; + } + + chartSize = { + width: Math.floor(wdt), + height: Math.floor(0.75 * wdt) + }; + } + + /* Adds a chart to the chart grid */ + function addChart (chartObj, initialize) { + var i; + var settings = { + title: escapeHtml(chartObj.title), + grid: { + drawBorder: false, + shadow: false, + background: 'rgba(0,0,0,0)' + }, + axes: { + xaxis: { + renderer: $.jqplot.DateAxisRenderer, + tickOptions: { + formatString: '%H:%M:%S', + showGridline: false + }, + min: runtime.xmin, + max: runtime.xmax + }, + yaxis: { + min: 0, + max: 100, + tickInterval: 20 + } + }, + seriesDefaults: { + rendererOptions: { + smooth: true + }, + showLine: true, + lineWidth: 2, + markerOptions: { + size: 6 + } + }, + highlighter: { + show: true + } + }; + + if (settings.title === PMA_messages.strSystemCPUUsage || + settings.title === PMA_messages.strQueryCacheEfficiency + ) { + settings.axes.yaxis.tickOptions = { + formatString: '%d %%' + }; + } else if (settings.title === PMA_messages.strSystemMemory || + settings.title === PMA_messages.strSystemSwap + ) { + settings.stackSeries = true; + settings.axes.yaxis.tickOptions = { + formatter: $.jqplot.byteFormatter(2) // MiB + }; + } else if (settings.title === PMA_messages.strTraffic) { + settings.axes.yaxis.tickOptions = { + formatter: $.jqplot.byteFormatter(1) // KiB + }; + } else if (settings.title === PMA_messages.strQuestions || + settings.title === PMA_messages.strConnections + ) { + settings.axes.yaxis.tickOptions = { + formatter: function (format, val) { + if (Math.abs(val) >= 1000000) { + return $.jqplot.sprintf('%.3g M', val / 1000000); + } else if (Math.abs(val) >= 1000) { + return $.jqplot.sprintf('%.3g k', val / 1000); + } else { + return $.jqplot.sprintf('%d', val); + } + } + }; + } + + settings.series = chartObj.series; + + if ($('#' + 'gridchart' + runtime.chartAI).length === 0) { + var numCharts = $('#chartGrid').find('.monitorChart').length; + + if (numCharts === 0 || (numCharts % monitorSettings.columns === 0)) { + $('#chartGrid').append(''); + } + + if (!chartSize) { + calculateChartSize(); + } + $('#chartGrid').find('tr:last').append( + '
      ' + + '
      ' + + '
      ' + ); + } + + // Set series' data as [0,0], smooth lines won't plot with data array having null values. + // also chart won't plot initially with no data and data comes on refreshChartGrid() + var series = []; + for (i in chartObj.series) { + series.push([[0, 0]]); + } + + var tempTooltipContentEditor = function (str, seriesIndex, pointIndex, plot) { + var j; + // TODO: move style to theme CSS + var tooltipHtml = '
      '; + // x value i.e. time + var timeValue = str.split(',')[0]; + var seriesValue; + tooltipHtml += 'Time: ' + timeValue; + tooltipHtml += ''; + // Add y values to the tooltip per series + for (j in plot.series) { + // get y value if present + if (plot.series[j].data.length > pointIndex) { + seriesValue = plot.series[j].data[pointIndex][1]; + } else { + return; + } + var seriesLabel = plot.series[j].label; + var seriesColor = plot.series[j].color; + // format y value + if (plot.series[0]._yaxis.tickOptions.formatter) { + // using formatter function + seriesValue = plot.series[0]._yaxis.tickOptions.formatter('%s', seriesValue); + } else if (plot.series[0]._yaxis.tickOptions.formatString) { + // using format string + seriesValue = PMA_sprintf(plot.series[0]._yaxis.tickOptions.formatString, seriesValue); + } + tooltipHtml += '
      ' + + seriesLabel + ': ' + seriesValue + ''; + } + tooltipHtml += '
      '; + return tooltipHtml; + }; + + // set Tooltip for each series + for (i in settings.series) { + settings.series[i].highlighter = { + show: true, + tooltipContentEditor: tempTooltipContentEditor + }; + } + + chartObj.chart = $.jqplot('gridchart' + runtime.chartAI, series, settings); + // remove [0,0] after plotting + for (i in chartObj.chart.series) { + chartObj.chart.series[i].data.shift(); + } + + var $legend = $('
      ').css('padding', '0.5em'); + for (i in chartObj.chart.series) { + $legend.append( + $('
      ').append( + $('
      ').css({ + width: '1em', + height: '1em', + background: chartObj.chart.seriesColors[i] + }).addClass('floatleft') + ).append( + $('
      ').text( + chartObj.chart.series[i].label + ).addClass('floatleft') + ).append( + $('
      ') + ).addClass('floatleft') + ); + } + $('#gridchart' + runtime.chartAI) + .parent() + .append($legend); + + if (initialize !== true) { + runtime.charts['c' + runtime.chartAI] = chartObj; + buildRequiredDataList(); + } + + // time span selection + $('#gridchart' + runtime.chartAI).on('jqplotMouseDown', function (ev, gridpos, datapos, neighbor, plot) { + drawTimeSpan = true; + selectionTimeDiff.push(datapos.xaxis); + if ($('#selection_box').length) { + $('#selection_box').remove(); + } + var selectionBox = $('
      '); + $(document.body).append(selectionBox); + selectionStartX = ev.pageX; + selectionStartY = ev.pageY; + selectionBox + .attr({ id: 'selection_box' }) + .css({ + top: selectionStartY - gridpos.y, + left: selectionStartX + }) + .fadeIn(); + }); + + $('#gridchart' + runtime.chartAI).on('jqplotMouseUp', function (ev, gridpos, datapos, neighbor, plot) { + if (! drawTimeSpan || editMode) { + return; + } + + selectionTimeDiff.push(datapos.xaxis); + + if (selectionTimeDiff[1] <= selectionTimeDiff[0]) { + selectionTimeDiff = []; + return; + } + // get date from timestamp + var min = new Date(Math.ceil(selectionTimeDiff[0])); + var max = new Date(Math.ceil(selectionTimeDiff[1])); + PMA_getLogAnalyseDialog(min, max); + selectionTimeDiff = []; + drawTimeSpan = false; + }); + + $('#gridchart' + runtime.chartAI).on('jqplotMouseMove', function (ev, gridpos, datapos, neighbor, plot) { + if (! drawTimeSpan || editMode) { + return; + } + if (selectionStartX !== undefined) { + $('#selection_box') + .css({ + width: Math.ceil(ev.pageX - selectionStartX) + }) + .fadeIn(); + } + }); + + $('#gridchart' + runtime.chartAI).on('jqplotMouseLeave', function (ev, gridpos, datapos, neighbor, plot) { + drawTimeSpan = false; + }); + + $(document.body).mouseup(function () { + if ($('#selection_box').length) { + $('#selection_box').remove(); + } + }); + + // Edit, Print icon only in edit mode + $('#chartGrid').find('div svg').find('*[zIndex=20], *[zIndex=21], *[zIndex=19]').toggle(editMode); + + runtime.chartAI++; + } + + function PMA_getLogAnalyseDialog (min, max) { + var $logAnalyseDialog = $('#logAnalyseDialog'); + var $dateStart = $logAnalyseDialog.find('input[name="dateStart"]'); + var $dateEnd = $logAnalyseDialog.find('input[name="dateEnd"]'); + $dateStart.prop('readonly', true); + $dateEnd.prop('readonly', true); + + var dlgBtns = { }; + + dlgBtns[PMA_messages.strFromSlowLog] = function () { + loadLog('slow', min, max); + $(this).dialog('close'); + }; + + dlgBtns[PMA_messages.strFromGeneralLog] = function () { + loadLog('general', min, max); + $(this).dialog('close'); + }; + + $logAnalyseDialog.dialog({ + width: 'auto', + height: 'auto', + buttons: dlgBtns + }); + + PMA_addDatepicker($dateStart, 'datetime', { + showMillisec: false, + showMicrosec: false, + timeFormat: 'HH:mm:ss' + }); + PMA_addDatepicker($dateEnd, 'datetime', { + showMillisec: false, + showMicrosec: false, + timeFormat: 'HH:mm:ss' + }); + $dateStart.datepicker('setDate', min); + $dateEnd.datepicker('setDate', max); + } + + function loadLog (type, min, max) { + var dateStart = Date.parse($('#logAnalyseDialog').find('input[name="dateStart"]').datepicker('getDate')) || min; + var dateEnd = Date.parse($('#logAnalyseDialog').find('input[name="dateEnd"]').datepicker('getDate')) || max; + + loadLogStatistics({ + src: type, + start: dateStart, + end: dateEnd, + removeVariables: $('#removeVariables').prop('checked'), + limitTypes: $('#limitTypes').prop('checked') + }); + } + + /* Called in regular intervals, this function updates the values of each chart in the grid */ + function refreshChartGrid () { + /* Send to server */ + runtime.refreshRequest = $.post('server_status_monitor.php' + PMA_commonParams.get('common_query'), { + ajax_request: true, + chart_data: 1, + type: 'chartgrid', + requiredData: JSON.stringify(runtime.dataList), + server: PMA_commonParams.get('server') + }, function (data) { + var chartData; + if (typeof data !== 'undefined' && data.success === true) { + chartData = data.message; + } else { + return serverResponseError(); + } + var value; + var i = 0; + var diff; + var total; + + /* Update values in each graph */ + $.each(runtime.charts, function (orderKey, elem) { + var key = elem.chartID; + // If newly added chart, we have no data for it yet + if (! chartData[key]) { + return; + } + // Draw all series + total = 0; + for (var j = 0; j < elem.nodes.length; j++) { + // Update x-axis + if (i === 0 && j === 0) { + if (oldChartData === null) { + diff = chartData.x - runtime.xmax; + } else { + diff = parseInt(chartData.x - oldChartData.x, 10); + } + + runtime.xmin += diff; + runtime.xmax += diff; + } + + // elem.chart.xAxis[0].setExtremes(runtime.xmin, runtime.xmax, false); + /* Calculate y value */ + + // If transform function given, use it + if (elem.nodes[j].transformFn) { + value = chartValueTransform( + elem.nodes[j].transformFn, + chartData[key][j], + // Check if first iteration (oldChartData==null), or if newly added chart oldChartData[key]==null + ( + oldChartData === null || + oldChartData[key] === null || + oldChartData[key] === undefined ? null : oldChartData[key][j] + ) + ); + + // Otherwise use original value and apply differential and divisor if given, + // in this case we have only one data point per series - located at chartData[key][j][0] + } else { + value = parseFloat(chartData[key][j][0].value); + + if (elem.nodes[j].display === 'differential') { + if (oldChartData === null || + oldChartData[key] === null || + oldChartData[key] === undefined + ) { + continue; + } + value -= oldChartData[key][j][0].value; + } + + if (elem.nodes[j].valueDivisor) { + value = value / elem.nodes[j].valueDivisor; + } + } + + // Set y value, if defined + if (value !== undefined) { + elem.chart.series[j].data.push([chartData.x, value]); + if (value > elem.maxYLabel) { + elem.maxYLabel = value; + } else if (elem.maxYLabel === 0) { + elem.maxYLabel = 0.5; + } + // free old data point values and update maxYLabel + if (elem.chart.series[j].data.length > runtime.gridMaxPoints && + elem.chart.series[j].data[0][0] < runtime.xmin + ) { + // check if the next freeable point is highest + if (elem.maxYLabel <= elem.chart.series[j].data[0][1]) { + elem.chart.series[j].data.splice(0, elem.chart.series[j].data.length - runtime.gridMaxPoints); + elem.maxYLabel = getMaxYLabel(elem.chart.series[j].data); + } else { + elem.chart.series[j].data.splice(0, elem.chart.series[j].data.length - runtime.gridMaxPoints); + } + } + if (elem.title === PMA_messages.strSystemMemory || + elem.title === PMA_messages.strSystemSwap + ) { + total += value; + } + } + } + + // update chart options + // keep ticks number/positioning consistent while refreshrate changes + var tickInterval = (runtime.xmax - runtime.xmin) / 5; + elem.chart.axes.xaxis.ticks = [(runtime.xmax - tickInterval * 4), + (runtime.xmax - tickInterval * 3), (runtime.xmax - tickInterval * 2), + (runtime.xmax - tickInterval), runtime.xmax]; + + if (elem.title !== PMA_messages.strSystemCPUUsage && + elem.title !== PMA_messages.strQueryCacheEfficiency && + elem.title !== PMA_messages.strSystemMemory && + elem.title !== PMA_messages.strSystemSwap + ) { + elem.chart.axes.yaxis.max = Math.ceil(elem.maxYLabel * 1.1); + elem.chart.axes.yaxis.tickInterval = Math.ceil(elem.maxYLabel * 1.1 / 5); + } else if (elem.title === PMA_messages.strSystemMemory || + elem.title === PMA_messages.strSystemSwap + ) { + elem.chart.axes.yaxis.max = Math.ceil(total * 1.1 / 100) * 100; + elem.chart.axes.yaxis.tickInterval = Math.ceil(total * 1.1 / 5); + } + i++; + + if (runtime.redrawCharts) { + elem.chart.replot(); + } + }); + + oldChartData = chartData; + + runtime.refreshTimeout = setTimeout(refreshChartGrid, monitorSettings.gridRefresh); + }); + } + + /* Function to get highest plotted point's y label, to scale the chart, + * TODO: make jqplot's autoscale:true work here + */ + function getMaxYLabel (dataValues) { + var maxY = dataValues[0][1]; + $.each(dataValues, function (k, v) { + maxY = (v[1] > maxY) ? v[1] : maxY; + }); + return maxY; + } + + /* Function that supplies special value transform functions for chart values */ + function chartValueTransform (name, cur, prev) { + switch (name) { + case 'cpu-linux': + if (prev === null) { + return undefined; + } + // cur and prev are datapoint arrays, but containing + // only 1 element for cpu-linux + cur = cur[0]; + prev = prev[0]; + + var diff_total = cur.busy + cur.idle - (prev.busy + prev.idle); + var diff_idle = cur.idle - prev.idle; + return 100 * (diff_total - diff_idle) / diff_total; + + // Query cache efficiency (%) + case 'qce': + if (prev === null) { + return undefined; + } + // cur[0].value is Qcache_hits, cur[1].value is Com_select + var diffQHits = cur[0].value - prev[0].value; + // No NaN please :-) + if (cur[1].value - prev[1].value === 0) { + return 0; + } + + return diffQHits / (cur[1].value - prev[1].value + diffQHits) * 100; + + // Query cache usage (%) + case 'qcu': + if (cur[1].value === 0) { + return 0; + } + // cur[0].value is Qcache_free_memory, cur[1].value is query_cache_size + return 100 - cur[0].value / cur[1].value * 100; + } + return undefined; + } + + /* Build list of nodes that need to be retrieved from server. + * It creates something like a stripped down version of the runtime.charts object. + */ + function buildRequiredDataList () { + runtime.dataList = {}; + // Store an own id, because the property name is subject of reordering, + // thus destroying our mapping with runtime.charts <=> runtime.dataList + var chartID = 0; + $.each(runtime.charts, function (key, chart) { + runtime.dataList[chartID] = []; + for (var i = 0, l = chart.nodes.length; i < l; i++) { + runtime.dataList[chartID][i] = chart.nodes[i].dataPoints; + } + runtime.charts[key].chartID = chartID; + chartID++; + }); + } + + /* Loads the log table data, generates the table and handles the filters */ + function loadLogStatistics (opts) { + var tableStr = ''; + var logRequest = null; + + if (! opts.removeVariables) { + opts.removeVariables = false; + } + if (! opts.limitTypes) { + opts.limitTypes = false; + } + + $('#emptyDialog').dialog({ title: PMA_messages.strAnalysingLogsTitle }); + $('#emptyDialog').html(PMA_messages.strAnalysingLogs + + ' '); + var dlgBtns = {}; + + dlgBtns[PMA_messages.strCancelRequest] = function () { + if (logRequest !== null) { + logRequest.abort(); + } + + $(this).dialog('close'); + }; + + $('#emptyDialog').dialog({ + width: 'auto', + height: 'auto', + buttons: dlgBtns + }); + + logRequest = $.post( + 'server_status_monitor.php' + PMA_commonParams.get('common_query'), + { + ajax_request: true, + log_data: 1, + type: opts.src, + time_start: Math.round(opts.start / 1000), + time_end: Math.round(opts.end / 1000), + removeVariables: opts.removeVariables, + limitTypes: opts.limitTypes + }, + function (data) { + var logData; + var dlgBtns = {}; + if (typeof data !== 'undefined' && data.success === true) { + logData = data.message; + } else { + return serverResponseError(); + } + + if (logData.rows.length === 0) { + $('#emptyDialog').dialog({ title: PMA_messages.strNoDataFoundTitle }); + $('#emptyDialog').html('

      ' + PMA_messages.strNoDataFound + '

      '); + + dlgBtns[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + + $('#emptyDialog').dialog('option', 'buttons', dlgBtns); + return; + } + + runtime.logDataCols = buildLogTable(logData, opts.removeVariables); + + /* Show some stats in the dialog */ + $('#emptyDialog').dialog({ title: PMA_messages.strLoadingLogs }); + $('#emptyDialog').html('

      ' + PMA_messages.strLogDataLoaded + '

      '); + $.each(logData.sum, function (key, value) { + key = key.charAt(0).toUpperCase() + key.slice(1).toLowerCase(); + if (key === 'Total') { + key = '' + key + ''; + } + $('#emptyDialog').append(key + ': ' + value + '
      '); + }); + + /* Add filter options if more than a bunch of rows there to filter */ + if (logData.numRows > 12) { + $('#logTable').prepend( + '
      ' + + ' ' + PMA_messages.strFiltersForLogTable + '' + + '
      ' + + ' ' + + ' ' + + '
      ' + + ((logData.numRows > 250) ? '
      ' : '') + + '
      ' + + ' ' + + ' ' + + ' ' + ); + + $('#noWHEREData').change(function () { + filterQueries(true); + }); + + if (logData.numRows > 250) { + $('#startFilterQueryText').click(filterQueries); + } else { + $('#filterQueryText').keyup(filterQueries); + } + } + + dlgBtns[PMA_messages.strJumpToTable] = function () { + $(this).dialog('close'); + $(document).scrollTop($('#logTable').offset().top); + }; + + $('#emptyDialog').dialog('option', 'buttons', dlgBtns); + } + ); + + /* Handles the actions performed when the user uses any of the + * log table filters which are the filter by name and grouping + * with ignoring data in WHERE clauses + * + * @param boolean Should be true when the users enabled or disabled + * to group queries ignoring data in WHERE clauses + */ + function filterQueries (varFilterChange) { + var cell; + var textFilter; + var val = $('#filterQueryText').val(); + + if (val.length === 0) { + textFilter = null; + } else { + try { + textFilter = new RegExp(val, 'i'); + $('#filterQueryText').removeClass('error'); + } catch (e) { + if (e instanceof SyntaxError) { + $('#filterQueryText').addClass('error'); + textFilter = null; + } + } + } + + var rowSum = 0; + var totalSum = 0; + var i = 0; + var q; + var noVars = $('#noWHEREData').prop('checked'); + var equalsFilter = /([^=]+)=(\d+|((\'|"|).*?[^\\])\4((\s+)|$))/gi; + var functionFilter = /([a-z0-9_]+)\(.+?\)/gi; + var filteredQueries = {}; + var filteredQueriesLines = {}; + var hide = false; + var rowData; + var queryColumnName = runtime.logDataCols[runtime.logDataCols.length - 2]; + var sumColumnName = runtime.logDataCols[runtime.logDataCols.length - 1]; + var isSlowLog = opts.src === 'slow'; + var columnSums = {}; + + // For the slow log we have to count many columns (query_time, lock_time, rows_examined, rows_sent, etc.) + var countRow = function (query, row) { + var cells = row.match(/(.*?)<\/td>/gi); + if (!columnSums[query]) { + columnSums[query] = [0, 0, 0, 0]; + } + + // lock_time and query_time and displayed in timespan format + columnSums[query][0] += timeToSec(cells[2].replace(/(|<\/td>)/gi, '')); + columnSums[query][1] += timeToSec(cells[3].replace(/(|<\/td>)/gi, '')); + // rows_examind and rows_sent are just numbers + columnSums[query][2] += parseInt(cells[4].replace(/(|<\/td>)/gi, ''), 10); + columnSums[query][3] += parseInt(cells[5].replace(/(|<\/td>)/gi, ''), 10); + }; + + // We just assume the sql text is always in the second last column, and that the total count is right of it + $('#logTable').find('table tbody tr td:nth-child(' + (runtime.logDataCols.length - 1) + ')').each(function () { + var $t = $(this); + // If query is a SELECT and user enabled or disabled to group + // queries ignoring data in where statements, we + // need to re-calculate the sums of each row + if (varFilterChange && $t.html().match(/^SELECT/i)) { + if (noVars) { + // Group on => Sum up identical columns, and hide all but 1 + + q = $t.text().replace(equalsFilter, '$1=...$6').trim(); + q = q.replace(functionFilter, ' $1(...)'); + + // Js does not specify a limit on property name length, + // so we can abuse it as index :-) + if (filteredQueries[q]) { + filteredQueries[q] += parseInt($t.next().text(), 10); + totalSum += parseInt($t.next().text(), 10); + hide = true; + } else { + filteredQueries[q] = parseInt($t.next().text(), 10); + filteredQueriesLines[q] = i; + $t.text(q); + } + if (isSlowLog) { + countRow(q, $t.parent().html()); + } + } else { + // Group off: Restore original columns + + rowData = $t.parent().data('query'); + // Restore SQL text + $t.text(rowData[queryColumnName]); + // Restore total count + $t.next().text(rowData[sumColumnName]); + // Restore slow log columns + if (isSlowLog) { + $t.parent().children('td:nth-child(3)').text(rowData.query_time); + $t.parent().children('td:nth-child(4)').text(rowData.lock_time); + $t.parent().children('td:nth-child(5)').text(rowData.rows_sent); + $t.parent().children('td:nth-child(6)').text(rowData.rows_examined); + } + } + } + + // If not required to be hidden, do we need + // to hide because of a not matching text filter? + if (! hide && (textFilter !== null && ! textFilter.exec($t.text()))) { + hide = true; + } + + // Now display or hide this column + if (hide) { + $t.parent().css('display', 'none'); + } else { + totalSum += parseInt($t.next().text(), 10); + rowSum++; + $t.parent().css('display', ''); + } + + hide = false; + i++; + }); + + // We finished summarizing counts => Update count values of all grouped entries + if (varFilterChange) { + if (noVars) { + var numCol; + var row; + var $table = $('#logTable').find('table tbody'); + $.each(filteredQueriesLines, function (key, value) { + if (filteredQueries[key] <= 1) { + return; + } + + row = $table.children('tr:nth-child(' + (value + 1) + ')'); + numCol = row.children(':nth-child(' + (runtime.logDataCols.length) + ')'); + numCol.text(filteredQueries[key]); + + if (isSlowLog) { + row.children('td:nth-child(3)').text(secToTime(columnSums[key][0])); + row.children('td:nth-child(4)').text(secToTime(columnSums[key][1])); + row.children('td:nth-child(5)').text(columnSums[key][2]); + row.children('td:nth-child(6)').text(columnSums[key][3]); + } + }); + } + + $('#logTable').find('table').trigger('update'); + setTimeout(function () { + $('#logTable').find('table').trigger('sorton', [[[runtime.logDataCols.length - 1, 1]]]); + }, 0); + } + + // Display some stats at the bottom of the table + $('#logTable').find('table tfoot tr') + .html('' + + PMA_messages.strSumRows + ' ' + rowSum + '' + + PMA_messages.strTotal + '' + totalSum + ''); + } + } + + /* Turns a timespan (12:12:12) into a number */ + function timeToSec (timeStr) { + var time = timeStr.split(':'); + return (parseInt(time[0], 10) * 3600) + (parseInt(time[1], 10) * 60) + parseInt(time[2], 10); + } + + /* Turns a number into a timespan (100 into 00:01:40) */ + function secToTime (timeInt) { + var hours = Math.floor(timeInt / 3600); + timeInt -= hours * 3600; + var minutes = Math.floor(timeInt / 60); + timeInt -= minutes * 60; + + if (hours < 10) { + hours = '0' + hours; + } + if (minutes < 10) { + minutes = '0' + minutes; + } + if (timeInt < 10) { + timeInt = '0' + timeInt; + } + + return hours + ':' + minutes + ':' + timeInt; + } + + /* Constructs the log table out of the retrieved server data */ + function buildLogTable (data, groupInserts) { + var rows = data.rows; + var cols = []; + var $table = $('
      '); + var $tBody; + var $tRow; + var $tCell; + + $('#logTable').html($table); + + var tempPushKey = function (key, value) { + cols.push(key); + }; + + var formatValue = function (name, value) { + if (name === 'user_host') { + return value.replace(/(\[.*?\])+/g, ''); + } + return escapeHtml(value); + }; + + for (var i = 0, l = rows.length; i < l; i++) { + if (i === 0) { + $.each(rows[0], tempPushKey); + $table.append('' + + '' + cols.join('') + '' + + '' + ); + + $table.append($tBody = $('')); + } + + $tBody.append($tRow = $('')); + var cl = ''; + for (var j = 0, ll = cols.length; j < ll; j++) { + // Assuming the query column is the second last + if (j === cols.length - 2 && rows[i][cols[j]].match(/^SELECT/i)) { + $tRow.append($tCell = $('' + formatValue(cols[j], rows[i][cols[j]]) + '')); + $tCell.click(openQueryAnalyzer); + } else { + $tRow.append('' + formatValue(cols[j], rows[i][cols[j]]) + ''); + } + + $tRow.data('query', rows[i]); + } + } + + $table.append('' + + '' + PMA_messages.strSumRows + + ' ' + data.numRows + '' + PMA_messages.strTotal + + '' + data.sum.TOTAL + ''); + + // Append a tooltip to the count column, if there exist one + if ($('#logTable').find('tr:first th:last').text().indexOf('#') > -1) { + $('#logTable').find('tr:first th:last').append(' ' + PMA_getImage('b_help', '', { 'class': 'qroupedQueryInfoIcon' })); + + var tooltipContent = PMA_messages.strCountColumnExplanation; + if (groupInserts) { + tooltipContent += '

      ' + PMA_messages.strMoreCountColumnExplanation + '

      '; + } + + PMA_tooltip( + $('img.qroupedQueryInfoIcon'), + 'img', + tooltipContent + ); + } + + $('#logTable').find('table').tablesorter({ + sortList: [[cols.length - 1, 1]], + widgets: ['fast-zebra'] + }); + + $('#logTable').find('table thead th') + .append('
      '); + + return cols; + } + + /* Opens the query analyzer dialog */ + function openQueryAnalyzer () { + var rowData = $(this).parent().data('query'); + var query = rowData.argument || rowData.sql_text; + + if (codemirror_editor) { + // TODO: somehow PMA_SQLPrettyPrint messes up the query, needs be fixed + // query = PMA_SQLPrettyPrint(query); + codemirror_editor.setValue(query); + // Codemirror is bugged, it doesn't refresh properly sometimes. + // Following lines seem to fix that + setTimeout(function () { + codemirror_editor.refresh(); + }, 50); + } else { + $('#sqlquery').val(query); + } + + var profilingChart = null; + var dlgBtns = {}; + + dlgBtns[PMA_messages.strAnalyzeQuery] = function () { + loadQueryAnalysis(rowData); + }; + dlgBtns[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + + $('#queryAnalyzerDialog').dialog({ + width: 'auto', + height: 'auto', + resizable: false, + buttons: dlgBtns, + close: function () { + if (profilingChart !== null) { + profilingChart.destroy(); + } + $('#queryAnalyzerDialog').find('div.placeHolder').html(''); + if (codemirror_editor) { + codemirror_editor.setValue(''); + } else { + $('#sqlquery').val(''); + } + } + }); + } + + /* Loads and displays the analyzed query data */ + function loadQueryAnalysis (rowData) { + var db = rowData.db || ''; + + $('#queryAnalyzerDialog').find('div.placeHolder').html( + PMA_messages.strAnalyzing + ' '); + + $.post('server_status_monitor.php' + PMA_commonParams.get('common_query'), { + ajax_request: true, + query_analyzer: true, + query: codemirror_editor ? codemirror_editor.getValue() : $('#sqlquery').val(), + database: db, + server: PMA_commonParams.get('server') + }, function (data) { + var i; + var l; + if (typeof data !== 'undefined' && data.success === true) { + data = data.message; + } + if (data.error) { + if (data.error.indexOf('1146') !== -1 || data.error.indexOf('1046') !== -1) { + data.error = PMA_messages.strServerLogError; + } + $('#queryAnalyzerDialog').find('div.placeHolder').html('
      ' + data.error + '
      '); + return; + } + var totalTime = 0; + // Float sux, I'll use table :( + $('#queryAnalyzerDialog').find('div.placeHolder') + .html('
      '); + + var explain = '' + PMA_messages.strExplainOutput + ' ' + $('#explain_docu').html(); + if (data.explain.length > 1) { + explain += ' ('; + for (i = 0; i < data.explain.length; i++) { + if (i > 0) { + explain += ', '; + } + explain += '' + i + ''; + } + explain += ')'; + } + explain += '

      '; + + var tempExplain = function (key, value) { + value = (value === null) ? 'null' : escapeHtml(value); + + if (key === 'type' && value.toLowerCase() === 'all') { + value = '' + value + ''; + } + if (key === 'Extra') { + value = value.replace(/(using (temporary|filesort))/gi, '$1'); + } + explain += key + ': ' + value + '
      '; + }; + + for (i = 0, l = data.explain.length; i < l; i++) { + explain += '
      0 ? 'style="display:none;"' : '') + '>'; + $.each(data.explain[i], tempExplain); + explain += '
      '; + } + + explain += '

      ' + PMA_messages.strAffectedRows + ' ' + data.affectedRows; + + $('#queryAnalyzerDialog').find('div.placeHolder td.explain').append(explain); + + $('#queryAnalyzerDialog').find('div.placeHolder a[href*="#showExplain"]').click(function () { + var id = $(this).attr('href').split('-')[1]; + $(this).parent().find('div[class*="explain"]').hide(); + $(this).parent().find('div[class*="explain-' + id + '"]').show(); + }); + + if (data.profiling) { + var chartData = []; + var numberTable = ''; + var duration; + var otherTime = 0; + + for (i = 0, l = data.profiling.length; i < l; i++) { + duration = parseFloat(data.profiling[i].duration); + + totalTime += duration; + + numberTable += ''; + } + + // Only put those values in the pie which are > 2% + for (i = 0, l = data.profiling.length; i < l; i++) { + duration = parseFloat(data.profiling[i].duration); + + if (duration / totalTime > 0.02) { + chartData.push([PMA_prettyProfilingNum(duration, 2) + ' ' + data.profiling[i].state, duration]); + } else { + otherTime += duration; + } + } + + if (otherTime > 0) { + chartData.push([PMA_prettyProfilingNum(otherTime, 2) + ' ' + PMA_messages.strOther, otherTime]); + } + + numberTable += ''; + numberTable += '
      ' + PMA_messages.strStatus + '' + PMA_messages.strTime + '
      ' + data.profiling[i].state + ' ' + PMA_prettyProfilingNum(duration, 2) + '
      ' + PMA_messages.strTotalTime + '' + PMA_prettyProfilingNum(totalTime, 2) + '
      '; + + $('#queryAnalyzerDialog').find('div.placeHolder td.chart').append( + '' + PMA_messages.strProfilingResults + ' ' + $('#profiling_docu').html() + ' ' + + '(' + PMA_messages.strTable + ', ' + PMA_messages.strChart + ')
      ' + + numberTable + '

      '); + + $('#queryAnalyzerDialog').find('div.placeHolder a[href="#showNums"]').click(function () { + $('#queryAnalyzerDialog').find('#queryProfiling').hide(); + $('#queryAnalyzerDialog').find('table.queryNums').show(); + return false; + }); + + $('#queryAnalyzerDialog').find('div.placeHolder a[href="#showChart"]').click(function () { + $('#queryAnalyzerDialog').find('#queryProfiling').show(); + $('#queryAnalyzerDialog').find('table.queryNums').hide(); + return false; + }); + + profilingChart = PMA_createProfilingChart( + 'queryProfiling', + chartData + ); + + // $('#queryProfiling').resizable(); + } + }); + } + + /* Saves the monitor to localstorage */ + function saveMonitor () { + var gridCopy = {}; + + $.each(runtime.charts, function (key, elem) { + gridCopy[key] = {}; + gridCopy[key].nodes = elem.nodes; + gridCopy[key].settings = elem.settings; + gridCopy[key].title = elem.title; + gridCopy[key].series = elem.series; + gridCopy[key].maxYLabel = elem.maxYLabel; + }); + + if (isStorageSupported('localStorage')) { + window.localStorage.monitorCharts = JSON.stringify(gridCopy); + window.localStorage.monitorSettings = JSON.stringify(monitorSettings); + window.localStorage.monitorVersion = monitorProtocolVersion; + } + + $('a[href="#clearMonitorConfig"]').show(); + } +}); + +// Run the monitor once loaded +AJAX.registerOnload('server_status_monitor.js', function () { + $('a[href="#pauseCharts"]').trigger('click'); +}); + +function serverResponseError () { + var btns = {}; + btns[PMA_messages.strReloadPage] = function () { + window.location.reload(); + }; + $('#emptyDialog').dialog({ title: PMA_messages.strRefreshFailed }); + $('#emptyDialog').html( + PMA_getImage('s_attention') + + PMA_messages.strInvalidResponseExplanation + ); + $('#emptyDialog').dialog({ buttons: btns }); +} + +/* Destroys all monitor related resources */ +function destroyGrid () { + if (runtime.charts) { + $.each(runtime.charts, function (key, value) { + try { + value.chart.destroy(); + } catch (err) {} + }); + } + + try { + runtime.refreshRequest.abort(); + } catch (err) {} + try { + clearTimeout(runtime.refreshTimeout); + } catch (err) {} + $('#chartGrid').html(''); + runtime.charts = null; + runtime.chartAI = 0; + monitorSettings = null; // TODO:this not global variable +} diff --git a/phpMyAdmin/js/server_status_processes.js b/phpMyAdmin/js/server_status_processes.js new file mode 100755 index 0000000..2865bca --- /dev/null +++ b/phpMyAdmin/js/server_status_processes.js @@ -0,0 +1,189 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Server Status Processes + * + * @package PhpMyAdmin + */ + +// object to store process list state information +var processList = { + + // denotes whether auto refresh is on or off + autoRefresh: false, + // stores the GET request which refresh process list + refreshRequest: null, + // stores the timeout id returned by setTimeout + refreshTimeout: null, + // the refresh interval in seconds + refreshInterval: null, + // the refresh URL (required to save last used option) + // i.e. full or sorting url + refreshUrl: null, + + /** + * Handles killing of a process + * + * @return void + */ + init: function () { + processList.setRefreshLabel(); + if (processList.refreshUrl === null) { + processList.refreshUrl = 'server_status_processes.php' + + PMA_commonParams.get('common_query'); + } + if (processList.refreshInterval === null) { + processList.refreshInterval = $('#id_refreshRate').val(); + } else { + $('#id_refreshRate').val(processList.refreshInterval); + } + }, + + /** + * Handles killing of a process + * + * @param object the event object + * + * @return void + */ + killProcessHandler: function (event) { + event.preventDefault(); + var argSep = PMA_commonParams.get('arg_separator'); + var params = $(this).getPostData(); + params += argSep + 'ajax_request=1' + argSep + 'server=' + PMA_commonParams.get('server'); + // Get row element of the process to be killed. + var $tr = $(this).closest('tr'); + $.post($(this).attr('href'), params, function (data) { + // Check if process was killed or not. + if (data.hasOwnProperty('success') && data.success) { + // remove the row of killed process. + $tr.remove(); + // As we just removed a row, reapply odd-even classes + // to keep table stripes consistent + var $tableProcessListTr = $('#tableprocesslist').find('> tbody > tr'); + $tableProcessListTr.filter(':even').removeClass('odd').addClass('even'); + $tableProcessListTr.filter(':odd').removeClass('even').addClass('odd'); + // Show process killed message + PMA_ajaxShowMessage(data.message, false); + } else { + // Show process error message + PMA_ajaxShowMessage(data.error, false); + } + }, 'json'); + }, + + /** + * Handles Auto Refreshing + * + * @param object the event object + * + * @return void + */ + refresh: function (event) { + // abort any previous pending requests + // this is necessary, it may go into + // multiple loops causing unnecessary + // requests even after leaving the page. + processList.abortRefresh(); + // if auto refresh is enabled + if (processList.autoRefresh) { + var interval = parseInt(processList.refreshInterval, 10) * 1000; + var urlParams = processList.getUrlParams(); + processList.refreshRequest = $.post(processList.refreshUrl, + urlParams, + function (data) { + if (data.hasOwnProperty('success') && data.success) { + $newTable = $(data.message); + $('#tableprocesslist').html($newTable.html()); + PMA_highlightSQL($('#tableprocesslist')); + } + processList.refreshTimeout = setTimeout( + processList.refresh, + interval + ); + }); + } + }, + + /** + * Stop current request and clears timeout + * + * @return void + */ + abortRefresh: function () { + if (processList.refreshRequest !== null) { + processList.refreshRequest.abort(); + processList.refreshRequest = null; + } + clearTimeout(processList.refreshTimeout); + }, + + /** + * Set label of refresh button + * change between play & pause + * + * @return void + */ + setRefreshLabel: function () { + var img = 'play'; + var label = PMA_messages.strStartRefresh; + if (processList.autoRefresh) { + img = 'pause'; + label = PMA_messages.strStopRefresh; + processList.refresh(); + } + $('a#toggleRefresh').html(PMA_getImage(img) + escapeHtml(label)); + }, + + /** + * Return the Url Parameters + * for autorefresh request, + * includes showExecuting if the filter is checked + * + * @return urlParams - url parameters with autoRefresh request + */ + getUrlParams: function () { + var urlParams = { 'ajax_request': true, 'refresh': true }; + if ($('#showExecuting').is(':checked')) { + urlParams.showExecuting = true; + return urlParams; + } + return urlParams; + } +}; + +AJAX.registerOnload('server_status_processes.js', function () { + processList.init(); + // Bind event handler for kill_process + $('#tableprocesslist').on( + 'click', + 'a.kill_process', + processList.killProcessHandler + ); + // Bind event handler for toggling refresh of process list + $('a#toggleRefresh').on('click', function (event) { + event.preventDefault(); + processList.autoRefresh = !processList.autoRefresh; + processList.setRefreshLabel(); + }); + // Bind event handler for change in refresh rate + $('#id_refreshRate').on('change', function (event) { + processList.refreshInterval = $(this).val(); + processList.refresh(); + }); + // Bind event handler for table header links + $('#tableprocesslist').on('click', 'thead a', function () { + processList.refreshUrl = $(this).attr('href'); + }); +}); + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_status_processes.js', function () { + $('#tableprocesslist').off('click', 'a.kill_process'); + $('a#toggleRefresh').off('click'); + $('#id_refreshRate').off('change'); + $('#tableprocesslist').off('click', 'thead a'); + // stop refreshing further + processList.abortRefresh(); +}); diff --git a/phpMyAdmin/js/server_status_queries.js b/phpMyAdmin/js/server_status_queries.js new file mode 100755 index 0000000..a3a7713 --- /dev/null +++ b/phpMyAdmin/js/server_status_queries.js @@ -0,0 +1,38 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + */ + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_status_queries.js', function () { + if (document.getElementById('serverstatusquerieschart') !== null) { + var queryPieChart = $('#serverstatusquerieschart').data('queryPieChart'); + if (queryPieChart) { + queryPieChart.destroy(); + } + } +}); + +AJAX.registerOnload('server_status_queries.js', function () { + // Build query statistics chart + var cdata = []; + try { + if (document.getElementById('serverstatusquerieschart') !== null) { + $.each($('#serverstatusquerieschart').data('chart'), function (key, value) { + cdata.push([key, parseInt(value, 10)]); + }); + $('#serverstatusquerieschart').data( + 'queryPieChart', + PMA_createProfilingChart( + 'serverstatusquerieschart', + cdata + ) + ); + } + } catch (exception) { + // Could not load chart, no big deal... + } + + initTableSorter('statustabs_queries'); +}); diff --git a/phpMyAdmin/js/server_status_sorter.js b/phpMyAdmin/js/server_status_sorter.js new file mode 100755 index 0000000..36c918a --- /dev/null +++ b/phpMyAdmin/js/server_status_sorter.js @@ -0,0 +1,70 @@ +// TODO: tablesorter shouldn't sort already sorted columns +function initTableSorter (tabid) { + var $table; + var opts; + switch (tabid) { + case 'statustabs_queries': + $table = $('#serverstatusqueriesdetails'); + opts = { + sortList: [[3, 1]], + headers: { + 1: { sorter: 'fancyNumber' }, + 2: { sorter: 'fancyNumber' } + } + }; + break; + } + $table.tablesorter(opts); + $table.find('tr:first th') + .append('
      '); +} + +$(function () { + $.tablesorter.addParser({ + id: 'fancyNumber', + is: function (s) { + return (/^[0-9]?[0-9,\.]*\s?(k|M|G|T|%)?$/).test(s); + }, + format: function (s) { + var num = jQuery.tablesorter.formatFloat( + s.replace(PMA_messages.strThousandsSeparator, '') + .replace(PMA_messages.strDecimalSeparator, '.') + ); + + var factor = 1; + switch (s.charAt(s.length - 1)) { + case '%': + factor = -2; + break; + // Todo: Complete this list (as well as in the regexp a few lines up) + case 'k': + factor = 3; + break; + case 'M': + factor = 6; + break; + case 'G': + factor = 9; + break; + case 'T': + factor = 12; + break; + } + + return num * Math.pow(10, factor); + }, + type: 'numeric' + }); + + $.tablesorter.addParser({ + id: 'withinSpanNumber', + is: function (s) { + return (/(.*)?<\/span>/); + return (res && res.length >= 3) ? res[2] : 0; + }, + type: 'numeric' + }); +}); diff --git a/phpMyAdmin/js/server_status_variables.js b/phpMyAdmin/js/server_status_variables.js new file mode 100755 index 0000000..4028bc7 --- /dev/null +++ b/phpMyAdmin/js/server_status_variables.js @@ -0,0 +1,100 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * + * + * @package PhpMyAdmin + */ + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_status_variables.js', function () { + $('#filterAlert').off('change'); + $('#filterText').off('keyup'); + $('#filterCategory').off('change'); + $('#dontFormat').off('change'); +}); + +AJAX.registerOnload('server_status_variables.js', function () { + // Filters for status variables + var textFilter = null; + var alertFilter = $('#filterAlert').prop('checked'); + var categoryFilter = $('#filterCategory').find(':selected').val(); + var text = ''; // Holds filter text + + /* 3 Filtering functions */ + $('#filterAlert').change(function () { + alertFilter = this.checked; + filterVariables(); + }); + + $('#filterCategory').change(function () { + categoryFilter = $(this).val(); + filterVariables(); + }); + + $('#dontFormat').change(function () { + // Hiding the table while changing values speeds up the process a lot + $('#serverstatusvariables').hide(); + $('#serverstatusvariables').find('td.value span.original').toggle(this.checked); + $('#serverstatusvariables').find('td.value span.formatted').toggle(! this.checked); + $('#serverstatusvariables').show(); + }).trigger('change'); + + $('#filterText').keyup(function (e) { + var word = $(this).val().replace(/_/g, ' '); + if (word.length === 0) { + textFilter = null; + } else { + try { + textFilter = new RegExp('(^| )' + word, 'i'); + $(this).removeClass('error'); + } catch (e) { + if (e instanceof SyntaxError) { + $(this).addClass('error'); + textFilter = null; + } + } + } + text = word; + filterVariables(); + }).trigger('keyup'); + + /* Filters the status variables by name/category/alert in the variables tab */ + function filterVariables () { + var useful_links = 0; + var section = text; + + if (categoryFilter.length > 0) { + section = categoryFilter; + } + + if (section.length > 1) { + $('#linkSuggestions').find('span').each(function () { + if ($(this).attr('class').indexOf('status_' + section) !== -1) { + useful_links++; + $(this).css('display', ''); + } else { + $(this).css('display', 'none'); + } + }); + } + + if (useful_links > 0) { + $('#linkSuggestions').css('display', ''); + } else { + $('#linkSuggestions').css('display', 'none'); + } + + $('#serverstatusvariables').find('th.name').each(function () { + if ((textFilter === null || textFilter.exec($(this).text())) && + (! alertFilter || $(this).next().find('span.attention').length > 0) && + (categoryFilter.length === 0 || $(this).parent().hasClass('s_' + categoryFilter)) + ) { + $(this).parent().css('display', ''); + } else { + $(this).parent().css('display', 'none'); + } + }); + } +}); diff --git a/phpMyAdmin/js/server_user_groups.js b/phpMyAdmin/js/server_user_groups.js new file mode 100755 index 0000000..513777a --- /dev/null +++ b/phpMyAdmin/js/server_user_groups.js @@ -0,0 +1,41 @@ +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_user_groups.js', function () { + $(document).off('click', 'a.deleteUserGroup.ajax'); +}); + +/** + * Bind event handlers + */ +AJAX.registerOnload('server_user_groups.js', function () { + // update the checkall checkbox on Edit user group page + $(checkboxes_sel).trigger('change'); + + $(document).on('click', 'a.deleteUserGroup.ajax', function (event) { + event.preventDefault(); + var $link = $(this); + var groupName = $link.parents('tr').find('td:first').text(); + var buttonOptions = {}; + buttonOptions[PMA_messages.strGo] = function () { + $(this).dialog('close'); + $link.removeClass('ajax').trigger('click'); + }; + buttonOptions[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + $('
      ') + .attr('id', 'confirmUserGroupDeleteDialog') + .append(PMA_sprintf(PMA_messages.strDropUserGroupWarning, escapeHtml(groupName))) + .dialog({ + width: 300, + minWidth: 200, + modal: true, + buttons: buttonOptions, + title: PMA_messages.strConfirm, + close: function () { + $(this).remove(); + } + }); + }); +}); diff --git a/phpMyAdmin/js/server_variables.js b/phpMyAdmin/js/server_variables.js new file mode 100755 index 0000000..6b7f01f --- /dev/null +++ b/phpMyAdmin/js/server_variables.js @@ -0,0 +1,112 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('server_variables.js', function () { + $(document).off('click', 'a.editLink'); + $('#serverVariables').find('.var-name').find('a img').remove(); +}); + +AJAX.registerOnload('server_variables.js', function () { + var $editLink = $('a.editLink'); + var $saveLink = $('a.saveLink'); + var $cancelLink = $('a.cancelLink'); + + $('#serverVariables').find('.var-name').find('a').append( + $('#docImage').clone().css('display', 'inline-block') + ); + + /* Launches the variable editor */ + $(document).on('click', 'a.editLink', function (event) { + event.preventDefault(); + editVariable(this); + }); + + /* Allows the user to edit a server variable */ + function editVariable (link) { + var $link = $(link); + var $cell = $link.parent(); + var $valueCell = $link.parents('.var-row').find('.var-value'); + var varName = $link.data('variable'); + + var $mySaveLink = $saveLink.clone().css('display', 'inline-block'); + var $myCancelLink = $cancelLink.clone().css('display', 'inline-block'); + var $msgbox = PMA_ajaxShowMessage(); + var $myEditLink = $cell.find('a.editLink'); + $cell.addClass('edit'); // variable is being edited + $myEditLink.remove(); // remove edit link + + $mySaveLink.click(function () { + var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + $.post($(this).attr('href'), { + ajax_request: true, + type: 'setval', + varName: varName, + varValue: $valueCell.find('input').val() + }, function (data) { + if (data.success) { + $valueCell + .html(data.variable) + .data('content', data.variable); + PMA_ajaxRemoveMessage($msgbox); + } else { + if (data.error === '') { + PMA_ajaxShowMessage(PMA_messages.strRequestFailed, false); + } else { + PMA_ajaxShowMessage(data.error, false); + } + $valueCell.html($valueCell.data('content')); + } + $cell.removeClass('edit').html($myEditLink); + }); + return false; + }); + + $myCancelLink.click(function () { + $valueCell.html($valueCell.data('content')); + $cell.removeClass('edit').html($myEditLink); + return false; + }); + + $.get($mySaveLink.attr('href'), { + ajax_request: true, + type: 'getval', + varName: varName + }, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + var $links = $('
      ') + .append($myCancelLink) + .append('   ') + .append($mySaveLink); + var $editor = $('
      ', { 'class': 'serverVariableEditor' }) + .append( + $('
      ').append( + $('', { type: 'text' }).val(data.message) + ) + ); + // Save and replace content + $cell + .html($links) + .children() + .css('display', 'flex'); + $valueCell + .data('content', $valueCell.html()) + .html($editor) + .find('input') + .focus() + .keydown(function (event) { // Keyboard shortcuts + if (event.keyCode === 13) { // Enter key + $mySaveLink.trigger('click'); + } else if (event.keyCode === 27) { // Escape key + $myCancelLink.trigger('click'); + } + }); + PMA_ajaxRemoveMessage($msgbox); + } else { + $cell.removeClass('edit').html($myEditLink); + PMA_ajaxShowMessage(data.error); + } + }); + } +}); diff --git a/phpMyAdmin/js/shortcuts_handler.js b/phpMyAdmin/js/shortcuts_handler.js new file mode 100755 index 0000000..4fc3c59 --- /dev/null +++ b/phpMyAdmin/js/shortcuts_handler.js @@ -0,0 +1,101 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview Handle shortcuts in various pages + * @name Shortcuts handler + * + * @requires jQuery + * @requires jQueryUI + */ + +/** + * Register key events on load + */ +$(document).ready(function () { + var databaseOp = false; + var tableOp = false; + var keyD = 68; + var keyT = 84; + var keyK = 75; + var keyS = 83; + var keyF = 70; + var keyE = 69; + var keyH = 72; + var keyC = 67; + var keyBackSpace = 8; + $(document).on('keyup', function (e) { + if (e.target.nodeName === 'INPUT' || e.target.nodeName === 'TEXTAREA' || e.target.nodeName === 'SELECT') { + return; + } + + if (e.keyCode === keyD) { + setTimeout(function () { + databaseOp = false; + }, 2000); + } else if (e.keyCode === keyT) { + setTimeout(function () { + tableOp = false; + }, 2000); + } + }); + $(document).on('keydown', function (e) { + if (e.ctrlKey && e.altKey && e.keyCode === keyC) { + PMA_console.toggle(); + } + + if (e.ctrlKey && e.keyCode === keyK) { + e.preventDefault(); + PMA_console.toggle(); + } + + if (e.target.nodeName === 'INPUT' || e.target.nodeName === 'TEXTAREA' || e.target.nodeName === 'SELECT') { + return; + } + + var isTable; + var isDb; + if (e.keyCode === keyD) { + databaseOp = true; + } else if (e.keyCode === keyK) { + e.preventDefault(); + PMA_console.toggle(); + } else if (e.keyCode === keyS) { + if (databaseOp === true) { + isTable = PMA_commonParams.get('table'); + isDb = PMA_commonParams.get('db'); + if (isDb && ! isTable) { + $('.tab .ic_b_props').first().trigger('click'); + } + } else if (tableOp === true) { + isTable = PMA_commonParams.get('table'); + isDb = PMA_commonParams.get('db'); + if (isDb && isTable) { + $('.tab .ic_b_props').first().trigger('click'); + } + } else { + $('#pma_navigation_settings_icon').trigger('click'); + } + } else if (e.keyCode === keyF) { + if (databaseOp === true) { + isTable = PMA_commonParams.get('table'); + isDb = PMA_commonParams.get('db'); + if (isDb && ! isTable) { + $('.tab .ic_b_search').first().trigger('click'); + } + } else if (tableOp === true) { + isTable = PMA_commonParams.get('table'); + isDb = PMA_commonParams.get('db'); + if (isDb && isTable) { + $('.tab .ic_b_search').first().trigger('click'); + } + } + } else if (e.keyCode === keyT) { + tableOp = true; + } else if (e.keyCode === keyE) { + $('.ic_b_export').first().trigger('click'); + } else if (e.keyCode === keyBackSpace) { + window.history.back(); + } else if (e.keyCode === keyH) { + $('.ic_b_home').first().trigger('click'); + } + }); +}); diff --git a/phpMyAdmin/js/sql.js b/phpMyAdmin/js/sql.js new file mode 100755 index 0000000..3d7f8d7 --- /dev/null +++ b/phpMyAdmin/js/sql.js @@ -0,0 +1,1036 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview functions used wherever an sql query form is used + * + * @requires jQuery + * @requires js/functions.js + * + */ + +var $data_a; +var prevScrollX = 0; + +/** + * decode a string URL_encoded + * + * @param string str + * @return string the URL-decoded string + */ +function PMA_urldecode (str) { + if (typeof str !== 'undefined') { + return decodeURIComponent(str.replace(/\+/g, '%20')); + } +} + +/** + * endecode a string URL_decoded + * + * @param string str + * @return string the URL-encoded string + */ +function PMA_urlencode (str) { + if (typeof str !== 'undefined') { + return encodeURIComponent(str).replace(/\%20/g, '+'); + } +} + +/** + * Saves SQL query in local storage or cookie + * + * @param string SQL query + * @return void + */ +function PMA_autosaveSQL (query) { + if (query) { + if (isStorageSupported('localStorage')) { + window.localStorage.auto_saved_sql = query; + } else { + Cookies.set('auto_saved_sql', query); + } + } +} + +/** + * Saves SQL query with sort in local storage or cookie + * + * @param string SQL query + * @return void + */ +function PMA_autosaveSQLSort (query) { + if (query) { + if (isStorageSupported('localStorage')) { + window.localStorage.auto_saved_sql_sort = query; + } else { + Cookies.set('auto_saved_sql_sort', query); + } + } +} + +/** + * Clear saved SQL query with sort in local storage or cookie + * + * @return void + */ +function PMA_clearAutoSavedSQLSort () { + if (isStorageSupported('localStorage')) { + window.localStorage.removeItem('auto_saved_sql_sort'); + } else { + Cookies.set('auto_saved_sql_sort', ''); + } +} + +/** + * Get the field name for the current field. Required to construct the query + * for grid editing + * + * @param $table_results enclosing results table + * @param $this_field jQuery object that points to the current field's tr + */ +function getFieldName ($table_results, $this_field) { + var this_field_index = $this_field.index(); + // ltr or rtl direction does not impact how the DOM was generated + // check if the action column in the left exist + var left_action_exist = !$table_results.find('th:first').hasClass('draggable'); + // number of column span for checkbox and Actions + var left_action_skip = left_action_exist ? $table_results.find('th:first').attr('colspan') - 1 : 0; + + // If this column was sorted, the text of the a element contains something + // like 1 that is useful to indicate the order in case + // of a sort on multiple columns; however, we dont want this as part + // of the column name so we strip it ( .clone() to .end() ) + var field_name = $table_results + .find('thead') + .find('th:eq(' + (this_field_index - left_action_skip) + ') a') + .clone() // clone the element + .children() // select all the children + .remove() // remove all of them + .end() // go back to the selected element + .text(); // grab the text + // happens when just one row (headings contain no a) + if (field_name === '') { + var $heading = $table_results.find('thead').find('th:eq(' + (this_field_index - left_action_skip) + ')').children('span'); + // may contain column comment enclosed in a span - detach it temporarily to read the column name + var $tempColComment = $heading.children().detach(); + field_name = $heading.text(); + // re-attach the column comment + $heading.append($tempColComment); + } + + field_name = $.trim(field_name); + + return field_name; +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('sql.js', function () { + $(document).off('click', 'a.delete_row.ajax'); + $(document).off('submit', '.bookmarkQueryForm'); + $('input#bkm_label').off('input'); + $(document).off('makegrid', '.sqlqueryresults'); + $(document).off('stickycolumns', '.sqlqueryresults'); + $('#togglequerybox').off('click'); + $(document).off('click', '#button_submit_query'); + $(document).off('change', '#id_bookmark'); + $('input[name=\'bookmark_variable\']').off('keypress'); + $(document).off('submit', '#sqlqueryform.ajax'); + $(document).off('click', 'input[name=navig].ajax'); + $(document).off('submit', 'form[name=\'displayOptionsForm\'].ajax'); + $(document).off('mouseenter', 'th.column_heading.pointer'); + $(document).off('mouseleave', 'th.column_heading.pointer'); + $(document).off('click', 'th.column_heading.marker'); + $(window).off('scroll'); + $(document).off('keyup', '.filter_rows'); + $(document).off('click', '#printView'); + if (codemirror_editor) { + codemirror_editor.off('change'); + } else { + $('#sqlquery').off('input propertychange'); + } + $('body').off('click', '.navigation .showAllRows'); + $('body').off('click', 'a.browse_foreign'); + $('body').off('click', '#simulate_dml'); + $('body').off('keyup', '#sqlqueryform'); + $('body').off('click', 'form[name="resultsForm"].ajax button[name="submit_mult"], form[name="resultsForm"].ajax input[name="submit_mult"]'); +}); + +/** + * @description

      Ajax scripts for sql and browse pages

      + * + * Actions ajaxified here: + *
        + *
      • Retrieve results of an SQL query
      • + *
      • Paginate the results table
      • + *
      • Sort the results table
      • + *
      • Change table according to display options
      • + *
      • Grid editing of data
      • + *
      • Saving a bookmark
      • + *
      + * + * @name document.ready + * @memberOf jQuery + */ +AJAX.registerOnload('sql.js', function () { + $(function () { + if (codemirror_editor) { + codemirror_editor.on('change', function () { + PMA_autosaveSQL(codemirror_editor.getValue()); + }); + } else { + $('#sqlquery').on('input propertychange', function () { + PMA_autosaveSQL($('#sqlquery').val()); + }); + var useLocalStorageValue = isStorageSupported('localStorage') && typeof window.localStorage.auto_saved_sql_sort !== 'undefined'; + // Save sql query with sort + if ($('#RememberSorting') !== undefined && $('#RememberSorting').is(':checked')) { + $('select[name="sql_query"]').on('change', function () { + PMA_autosaveSQLSort($(this).val()); + }); + $('.sortlink').on('click', function () { + PMA_clearAutoSavedSQLSort(); + }); + } else { + PMA_clearAutoSavedSQLSort(); + } + // If sql query with sort for current table is stored, change sort by key select value + var sortStoredQuery = useLocalStorageValue ? window.localStorage.auto_saved_sql_sort : Cookies.get('auto_saved_sql_sort'); + if (typeof sortStoredQuery !== 'undefined' && sortStoredQuery !== $('select[name="sql_query"]').val() && $('select[name="sql_query"] option[value="' + sortStoredQuery + '"]').length !== 0) { + $('select[name="sql_query"]').val(sortStoredQuery).change(); + } + } + }); + + // Delete row from SQL results + $(document).on('click', 'a.delete_row.ajax', function (e) { + e.preventDefault(); + var question = PMA_sprintf(PMA_messages.strDoYouReally, escapeHtml($(this).closest('td').find('div').text())); + var $link = $(this); + $link.PMA_confirm(question, $link.attr('href'), function (url) { + $msgbox = PMA_ajaxShowMessage(); + var argsep = PMA_commonParams.get('arg_separator'); + var params = 'ajax_request=1' + argsep + 'is_js_confirmed=1'; + var postData = $link.getPostData(); + if (postData) { + params += argsep + postData; + } + $.post(url, params, function (data) { + if (data.success) { + PMA_ajaxShowMessage(data.message); + $link.closest('tr').remove(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); + }); + }); + + // Ajaxification for 'Bookmark this SQL query' + $(document).on('submit', '.bookmarkQueryForm', function (e) { + e.preventDefault(); + PMA_ajaxShowMessage(); + var argsep = PMA_commonParams.get('arg_separator'); + $.post($(this).attr('action'), 'ajax_request=1' + argsep + $(this).serialize(), function (data) { + if (data.success) { + PMA_ajaxShowMessage(data.message); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); + }); + + /* Hides the bookmarkoptions checkboxes when the bookmark label is empty */ + $('input#bkm_label').on('input', function () { + $('input#id_bkm_all_users, input#id_bkm_replace') + .parent() + .toggle($(this).val().length > 0); + }).trigger('input'); + + /** + * Attach Event Handler for 'Copy to clipbpard + */ + $(document).on('click', '#copyToClipBoard', function (event) { + event.preventDefault(); + + var textArea = document.createElement('textarea'); + + // + // *** This styling is an extra step which is likely not required. *** + // + // Why is it here? To ensure: + // 1. the element is able to have focus and selection. + // 2. if element was to flash render it has minimal visual impact. + // 3. less flakyness with selection and copying which **might** occur if + // the textarea element is not visible. + // + // The likelihood is the element won't even render, not even a flash, + // so some of these are just precautions. However in IE the element + // is visible whilst the popup box asking the user for permission for + // the web page to copy to the clipboard. + // + + // Place in top-left corner of screen regardless of scroll position. + textArea.style.position = 'fixed'; + textArea.style.top = 0; + textArea.style.left = 0; + + // Ensure it has a small width and height. Setting to 1px / 1em + // doesn't work as this gives a negative w/h on some browsers. + textArea.style.width = '2em'; + textArea.style.height = '2em'; + + // We don't need padding, reducing the size if it does flash render. + textArea.style.padding = 0; + + // Clean up any borders. + textArea.style.border = 'none'; + textArea.style.outline = 'none'; + textArea.style.boxShadow = 'none'; + + // Avoid flash of white box if rendered for any reason. + textArea.style.background = 'transparent'; + + textArea.value = ''; + + $('#serverinfo a').each(function () { + textArea.value += $(this).text().split(':')[1].trim() + '/'; + }); + textArea.value += '\t\t' + window.location.href; + textArea.value += '\n'; + $('.success').each(function () { + textArea.value += $(this).text() + '\n\n'; + }); + + $('.sql pre').each(function () { + textArea.value += $(this).text() + '\n\n'; + }); + + $('.table_results .column_heading a').each(function () { + // Don't copy ordering number text within tag + textArea.value += $(this).clone().find('small').remove().end().text() + '\t'; + }); + + textArea.value += '\n'; + $('.table_results tbody tr').each(function () { + $(this).find('.data span').each(function () { + textArea.value += $(this).text() + '\t'; + }); + textArea.value += '\n'; + }); + + document.body.appendChild(textArea); + + textArea.select(); + + try { + document.execCommand('copy'); + } catch (err) { + alert('Sorry! Unable to copy'); + } + + document.body.removeChild(textArea); + }); // end of Copy to Clipboard action + + /** + * Attach Event Handler for 'Print' link + */ + $(document).on('click', '#printView', function (event) { + event.preventDefault(); + + // Take to preview mode + printPreview(); + }); // end of 'Print' action + + /** + * Attach the {@link makegrid} function to a custom event, which will be + * triggered manually everytime the table of results is reloaded + * @memberOf jQuery + */ + $(document).on('makegrid', '.sqlqueryresults', function () { + $('.table_results').each(function () { + PMA_makegrid(this); + }); + }); + + /* + * Attach a custom event for sticky column headings which will be + * triggered manually everytime the table of results is reloaded + * @memberOf jQuery + */ + $(document).on('stickycolumns', '.sqlqueryresults', function () { + $('.sticky_columns').remove(); + $('.table_results').each(function () { + var $table_results = $(this); + // add sticky columns div + var $stick_columns = initStickyColumns($table_results); + rearrangeStickyColumns($stick_columns, $table_results); + // adjust sticky columns on scroll + $(window).on('scroll', function () { + handleStickyColumns($stick_columns, $table_results); + }); + }); + }); + + /** + * Append the "Show/Hide query box" message to the query input form + * + * @memberOf jQuery + * @name appendToggleSpan + */ + // do not add this link more than once + if (! $('#sqlqueryform').find('a').is('#togglequerybox')) { + $('') + .html(PMA_messages.strHideQueryBox) + .appendTo('#sqlqueryform') + // initially hidden because at this point, nothing else + // appears under the link + .hide(); + + // Attach the toggling of the query box visibility to a click + $('#togglequerybox').bind('click', function () { + var $link = $(this); + $link.siblings().slideToggle('fast'); + if ($link.text() === PMA_messages.strHideQueryBox) { + $link.text(PMA_messages.strShowQueryBox); + // cheap trick to add a spacer between the menu tabs + // and "Show query box"; feel free to improve! + $('#togglequerybox_spacer').remove(); + $link.before('
      '); + } else { + $link.text(PMA_messages.strHideQueryBox); + } + // avoid default click action + return false; + }); + } + + + /** + * Event handler for sqlqueryform.ajax button_submit_query + * + * @memberOf jQuery + */ + $(document).on('click', '#button_submit_query', function (event) { + $('.success,.error').hide(); + // hide already existing error or success message + var $form = $(this).closest('form'); + // the Go button related to query submission was clicked, + // instead of the one related to Bookmarks, so empty the + // id_bookmark selector to avoid misinterpretation in + // import.php about what needs to be done + $form.find('select[name=id_bookmark]').val(''); + // let normal event propagation happen + }); + + /** + * Event handler to show appropiate number of variable boxes + * based on the bookmarked query + */ + $(document).on('change', '#id_bookmark', function (event) { + var varCount = $(this).find('option:selected').data('varcount'); + if (typeof varCount === 'undefined') { + varCount = 0; + } + + var $varDiv = $('#bookmark_variables'); + $varDiv.empty(); + for (var i = 1; i <= varCount; i++) { + $varDiv.append($('')); + $varDiv.append($('')); + } + + if (varCount === 0) { + $varDiv.parent('.formelement').hide(); + } else { + $varDiv.parent('.formelement').show(); + } + }); + + /** + * Event handler for hitting enter on sqlqueryform bookmark_variable + * (the Variable textfield in Bookmarked SQL query section) + * + * @memberOf jQuery + */ + $('input[name=bookmark_variable]').on('keypress', function (event) { + // force the 'Enter Key' to implicitly click the #button_submit_bookmark + var keycode = (event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode)); + if (keycode === 13) { // keycode for enter key + // When you press enter in the sqlqueryform, which + // has 2 submit buttons, the default is to run the + // #button_submit_query, because of the tabindex + // attribute. + // This submits #button_submit_bookmark instead, + // because when you are in the Bookmarked SQL query + // section and hit enter, you expect it to do the + // same action as the Go button in that section. + $('#button_submit_bookmark').click(); + return false; + } else { + return true; + } + }); + + /** + * Ajax Event handler for 'SQL Query Submit' + * + * @see PMA_ajaxShowMessage() + * @memberOf jQuery + * @name sqlqueryform_submit + */ + $(document).on('submit', '#sqlqueryform.ajax', function (event) { + event.preventDefault(); + + var $form = $(this); + if (codemirror_editor) { + $form[0].elements.sql_query.value = codemirror_editor.getValue(); + } + if (! checkSqlQuery($form[0])) { + return false; + } + + // remove any div containing a previous error message + $('div.error').remove(); + + var $msgbox = PMA_ajaxShowMessage(); + var $sqlqueryresultsouter = $('#sqlqueryresultsouter'); + + PMA_prepareForAjaxRequest($form); + + var argsep = PMA_commonParams.get('arg_separator'); + $.post($form.attr('action'), $form.serialize() + argsep + 'ajax_page_request=true', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + // success happens if the query returns rows or not + + // show a message that stays on screen + if (typeof data.action_bookmark !== 'undefined') { + // view only + if ('1' === data.action_bookmark) { + $('#sqlquery').text(data.sql_query); + // send to codemirror if possible + setQuery(data.sql_query); + } + // delete + if ('2' === data.action_bookmark) { + $('#id_bookmark option[value=\'' + data.id_bookmark + '\']').remove(); + // if there are no bookmarked queries now (only the empty option), + // remove the bookmark section + if ($('#id_bookmark option').length === 1) { + $('#fieldsetBookmarkOptions').hide(); + $('#fieldsetBookmarkOptionsFooter').hide(); + } + } + } + $sqlqueryresultsouter + .show() + .html(data.message); + PMA_highlightSQL($sqlqueryresultsouter); + + if (data._menu) { + if (history && history.pushState) { + history.replaceState({ + menu : data._menu + }, + null + ); + AJAX.handleMenu.replace(data._menu); + } else { + PMA_MicroHistory.menus.replace(data._menu); + PMA_MicroHistory.menus.add(data._menuHash, data._menu); + } + } else if (data._menuHash) { + if (! (history && history.pushState)) { + PMA_MicroHistory.menus.replace(PMA_MicroHistory.menus.get(data._menuHash)); + } + } + + if (data._params) { + PMA_commonParams.setAll(data._params); + } + + if (typeof data.ajax_reload !== 'undefined') { + if (data.ajax_reload.reload) { + if (data.ajax_reload.table_name) { + PMA_commonParams.set('table', data.ajax_reload.table_name); + PMA_commonActions.refreshMain(); + } else { + PMA_reloadNavigation(); + } + } + } else if (typeof data.reload !== 'undefined') { + // this happens if a USE or DROP command was typed + PMA_commonActions.setDb(data.db); + var url; + if (data.db) { + if (data.table) { + url = 'table_sql.php'; + } else { + url = 'db_sql.php'; + } + } else { + url = 'server_sql.php'; + } + PMA_commonActions.refreshMain(url, function () { + $('#sqlqueryresultsouter') + .show() + .html(data.message); + PMA_highlightSQL($('#sqlqueryresultsouter')); + }); + } + + $('.sqlqueryresults').trigger('makegrid').trigger('stickycolumns'); + $('#togglequerybox').show(); + PMA_init_slider(); + + if (typeof data.action_bookmark === 'undefined') { + if ($('#sqlqueryform input[name="retain_query_box"]').is(':checked') !== true) { + if ($('#togglequerybox').siblings(':visible').length > 0) { + $('#togglequerybox').trigger('click'); + } + } + } + } else if (typeof data !== 'undefined' && data.success === false) { + // show an error message that stays on screen + $sqlqueryresultsouter + .show() + .html(data.error); + } + PMA_ajaxRemoveMessage($msgbox); + }); // end $.post() + }); // end SQL Query submit + + /** + * Ajax Event handler for the display options + * @memberOf jQuery + * @name displayOptionsForm_submit + */ + $(document).on('submit', 'form[name=\'displayOptionsForm\'].ajax', function (event) { + event.preventDefault(); + + $form = $(this); + + var $msgbox = PMA_ajaxShowMessage(); + var argsep = PMA_commonParams.get('arg_separator'); + $.post($form.attr('action'), $form.serialize() + argsep + 'ajax_request=true', function (data) { + PMA_ajaxRemoveMessage($msgbox); + var $sqlqueryresults = $form.parents('.sqlqueryresults'); + $sqlqueryresults + .html(data.message) + .trigger('makegrid') + .trigger('stickycolumns'); + PMA_init_slider(); + PMA_highlightSQL($sqlqueryresults); + }); // end $.post() + }); // end displayOptionsForm handler + + // Filter row handling. --STARTS-- + $(document).on('keyup', '.filter_rows', function () { + var unique_id = $(this).data('for'); + var $target_table = $('.table_results[data-uniqueId=\'' + unique_id + '\']'); + var $header_cells = $target_table.find('th[data-column]'); + var target_columns = Array(); + // To handle colspan=4, in case of edit,copy etc options. + var dummy_th = ($('.edit_row_anchor').length !== 0 ? + '' + : ''); + // Selecting columns that will be considered for filtering and searching. + $header_cells.each(function () { + target_columns.push($.trim($(this).text())); + }); + + var phrase = $(this).val(); + // Set same value to both Filter rows fields. + $('.filter_rows[data-for=\'' + unique_id + '\']').not(this).val(phrase); + // Handle colspan. + $target_table.find('thead > tr').prepend(dummy_th); + $.uiTableFilter($target_table, phrase, target_columns); + $target_table.find('th.dummy_th').remove(); + }); + // Filter row handling. --ENDS-- + + // Prompt to confirm on Show All + $('body').on('click', '.navigation .showAllRows', function (e) { + e.preventDefault(); + var $form = $(this).parents('form'); + + if (! $(this).is(':checked')) { // already showing all rows + submitShowAllForm(); + } else { + $form.PMA_confirm(PMA_messages.strShowAllRowsWarning, $form.attr('action'), function (url) { + submitShowAllForm(); + }); + } + + function submitShowAllForm () { + var argsep = PMA_commonParams.get('arg_separator'); + var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true'; + PMA_ajaxShowMessage(); + AJAX.source = $form; + $.post($form.attr('action'), submitData, AJAX.responseHandler); + } + }); + + $('body').on('keyup', '#sqlqueryform', function () { + PMA_handleSimulateQueryButton(); + }); + + /** + * Ajax event handler for 'Simulate DML'. + */ + $('body').on('click', '#simulate_dml', function () { + var $form = $('#sqlqueryform'); + var query = ''; + var delimiter = $('#id_sql_delimiter').val(); + var db_name = $form.find('input[name="db"]').val(); + + if (codemirror_editor) { + query = codemirror_editor.getValue(); + } else { + query = $('#sqlquery').val(); + } + + if (query.length === 0) { + alert(PMA_messages.strFormEmpty); + $('#sqlquery').focus(); + return false; + } + + var $msgbox = PMA_ajaxShowMessage(); + $.ajax({ + type: 'POST', + url: $form.attr('action'), + data: { + server: PMA_commonParams.get('server'), + db: db_name, + ajax_request: '1', + simulate_dml: '1', + sql_query: query, + sql_delimiter: delimiter + }, + success: function (response) { + PMA_ajaxRemoveMessage($msgbox); + if (response.success) { + var dialog_content = '
      '; + if (response.sql_data) { + var len = response.sql_data.length; + for (var i = 0; i < len; i++) { + dialog_content += '' + PMA_messages.strSQLQuery + + '' + response.sql_data[i].sql_query + + PMA_messages.strMatchedRows + + ' ' + response.sql_data[i].matched_rows + '
      '; + if (i < len - 1) { + dialog_content += '
      '; + } + } + } else { + dialog_content += response.message; + } + dialog_content += '
      '; + var $dialog_content = $(dialog_content); + var button_options = {}; + button_options[PMA_messages.strClose] = function () { + $(this).dialog('close'); + }; + var $response_dialog = $('
      ').append($dialog_content).dialog({ + minWidth: 540, + maxHeight: 400, + modal: true, + buttons: button_options, + title: PMA_messages.strSimulateDML, + open: function () { + PMA_highlightSQL($(this)); + }, + close: function () { + $(this).remove(); + } + }); + } else { + PMA_ajaxShowMessage(response.error); + } + }, + error: function (response) { + PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest); + } + }); + }); + + /** + * Handles multi submits of results browsing page such as edit, delete and export + */ + $('body').on('click', 'form[name="resultsForm"].ajax button[name="submit_mult"], form[name="resultsForm"].ajax input[name="submit_mult"]', function (e) { + e.preventDefault(); + var $button = $(this); + var $form = $button.closest('form'); + var argsep = PMA_commonParams.get('arg_separator'); + var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val(); + PMA_ajaxShowMessage(); + AJAX.source = $form; + $.post($form.attr('action'), submitData, AJAX.responseHandler); + }); +}); // end $() + +/** + * Starting from some th, change the class of all td under it. + * If isAddClass is specified, it will be used to determine whether to add or remove the class. + */ +function PMA_changeClassForColumn ($this_th, newclass, isAddClass) { + // index 0 is the th containing the big T + var th_index = $this_th.index(); + var has_big_t = $this_th.closest('tr').children(':first').hasClass('column_action'); + // .eq() is zero-based + if (has_big_t) { + th_index--; + } + var $table = $this_th.parents('.table_results'); + if (! $table.length) { + $table = $this_th.parents('table').siblings('.table_results'); + } + var $tds = $table.find('tbody tr').find('td.data:eq(' + th_index + ')'); + if (isAddClass === undefined) { + $tds.toggleClass(newclass); + } else { + $tds.toggleClass(newclass, isAddClass); + } +} + +/** + * Handles browse foreign values modal dialog + * + * @param object $this_a reference to the browse foreign value link + */ +function browseForeignDialog ($this_a) { + var formId = '#browse_foreign_form'; + var showAllId = '#foreign_showAll'; + var tableId = '#browse_foreign_table'; + var filterId = '#input_foreign_filter'; + var $dialog = null; + var argSep = PMA_commonParams.get('arg_separator'); + var params = $this_a.getPostData(); + params += argSep + 'ajax_request=true'; + $.post($this_a.attr('href'), params, function (data) { + // Creates browse foreign value dialog + $dialog = $('
      ').append(data.message).dialog({ + title: PMA_messages.strBrowseForeignValues, + width: Math.min($(window).width() - 100, 700), + maxHeight: $(window).height() - 100, + dialogClass: 'browse_foreign_modal', + close: function (ev, ui) { + // remove event handlers attached to elements related to dialog + $(tableId).off('click', 'td a.foreign_value'); + $(formId).off('click', showAllId); + $(formId).off('submit'); + // remove dialog itself + $(this).remove(); + }, + modal: true + }); + }).done(function () { + var showAll = false; + $(tableId).on('click', 'td a.foreign_value', function (e) { + e.preventDefault(); + var $input = $this_a.prev('input[type=text]'); + // Check if input exists or get CEdit edit_box + if ($input.length === 0) { + $input = $this_a.closest('.edit_area').prev('.edit_box'); + } + // Set selected value as input value + $input.val($(this).data('key')); + $dialog.dialog('close'); + }); + $(formId).on('click', showAllId, function () { + showAll = true; + }); + $(formId).on('submit', function (e) { + e.preventDefault(); + // if filter value is not equal to old value + // then reset page number to 1 + if ($(filterId).val() !== $(filterId).data('old')) { + $(formId).find('select[name=pos]').val('0'); + } + var postParams = $(this).serializeArray(); + // if showAll button was clicked to submit form then + // add showAll button parameter to form + if (showAll) { + postParams.push({ + name: $(showAllId).attr('name'), + value: $(showAllId).val() + }); + } + // updates values in dialog + $.post($(this).attr('action') + '?ajax_request=1', postParams, function (data) { + var $obj = $('
      ').html(data.message); + $(formId).html($obj.find(formId).html()); + $(tableId).html($obj.find(tableId).html()); + }); + showAll = false; + }); + }); +} + +AJAX.registerOnload('sql.js', function () { + $('body').on('click', 'a.browse_foreign', function (e) { + e.preventDefault(); + browseForeignDialog($(this)); + }); + + /** + * vertical column highlighting in horizontal mode when hovering over the column header + */ + $(document).on('mouseenter', 'th.column_heading.pointer', function (e) { + PMA_changeClassForColumn($(this), 'hover', true); + }); + $(document).on('mouseleave', 'th.column_heading.pointer', function (e) { + PMA_changeClassForColumn($(this), 'hover', false); + }); + + /** + * vertical column marking in horizontal mode when clicking the column header + */ + $(document).on('click', 'th.column_heading.marker', function () { + PMA_changeClassForColumn($(this), 'marked'); + }); + + /** + * create resizable table + */ + $('.sqlqueryresults').trigger('makegrid').trigger('stickycolumns'); +}); + +/* + * Profiling Chart + */ +function makeProfilingChart () { + if ($('#profilingchart').length === 0 || + $('#profilingchart').html().length !== 0 || + !$.jqplot || !$.jqplot.Highlighter || !$.jqplot.PieRenderer + ) { + return; + } + + var data = []; + $.each(JSON.parse($('#profilingChartData').html()), function (key, value) { + data.push([key, parseFloat(value)]); + }); + + // Remove chart and data divs contents + $('#profilingchart').html('').show(); + $('#profilingChartData').html(''); + + PMA_createProfilingChart('profilingchart', data); +} + +/* + * initialize profiling data tables + */ +function initProfilingTables () { + if (!$.tablesorter) { + return; + } + + $('#profiletable').tablesorter({ + widgets: ['zebra'], + sortList: [[0, 0]], + textExtraction: function (node) { + if (node.children.length > 0) { + return node.children[0].innerHTML; + } else { + return node.innerHTML; + } + } + }); + + $('#profilesummarytable').tablesorter({ + widgets: ['zebra'], + sortList: [[1, 1]], + textExtraction: function (node) { + if (node.children.length > 0) { + return node.children[0].innerHTML; + } else { + return node.innerHTML; + } + } + }); +} + +/* + * Set position, left, top, width of sticky_columns div + */ +function setStickyColumnsPosition ($sticky_columns, $table_results, position, top, left, margin_left) { + $sticky_columns + .css('position', position) + .css('top', top) + .css('left', left ? left : 'auto') + .css('margin-left', margin_left ? margin_left : '0px') + .css('width', $table_results.width()); +} + +/* + * Initialize sticky columns + */ +function initStickyColumns ($table_results) { + return $('
      ') + .insertBefore($table_results) + .css('position', 'fixed') + .css('z-index', '98') + .css('width', $table_results.width()) + .css('margin-left', $('#page_content').css('margin-left')) + .css('top', $('#floating_menubar').height()) + .css('display', 'none'); +} + +/* + * Arrange/Rearrange columns in sticky header + */ +function rearrangeStickyColumns ($sticky_columns, $table_results) { + var $originalHeader = $table_results.find('thead'); + var $originalColumns = $originalHeader.find('tr:first').children(); + var $clonedHeader = $originalHeader.clone(); + // clone width per cell + $clonedHeader.find('tr:first').children().width(function (i,val) { + var width = $originalColumns.eq(i).width(); + var is_firefox = navigator.userAgent.indexOf('Firefox') > -1; + if (! is_firefox) { + width += 1; + } + return width; + }); + $sticky_columns.empty().append($clonedHeader); +} + +/* + * Adjust sticky columns on horizontal/vertical scroll for all tables + */ +function handleAllStickyColumns () { + $('.sticky_columns').each(function () { + handleStickyColumns($(this), $(this).next('.table_results')); + }); +} + +/* + * Adjust sticky columns on horizontal/vertical scroll + */ +function handleStickyColumns ($sticky_columns, $table_results) { + var currentScrollX = $(window).scrollLeft(); + var windowOffset = $(window).scrollTop(); + var tableStartOffset = $table_results.offset().top; + var tableEndOffset = tableStartOffset + $table_results.height(); + if (windowOffset >= tableStartOffset && windowOffset <= tableEndOffset) { + // for horizontal scrolling + if (prevScrollX !== currentScrollX) { + prevScrollX = currentScrollX; + setStickyColumnsPosition($sticky_columns, $table_results, 'absolute', $('#floating_menubar').height() + windowOffset - tableStartOffset); + // for vertical scrolling + } else { + setStickyColumnsPosition($sticky_columns, $table_results, 'fixed', $('#floating_menubar').height(), $('#pma_navigation').width() - currentScrollX, $('#page_content').css('margin-left')); + } + $sticky_columns.show(); + } else { + $sticky_columns.hide(); + } +} + +AJAX.registerOnload('sql.js', function () { + makeProfilingChart(); + initProfilingTables(); +}); diff --git a/phpMyAdmin/js/tbl_change.js b/phpMyAdmin/js/tbl_change.js new file mode 100755 index 0000000..18742fd --- /dev/null +++ b/phpMyAdmin/js/tbl_change.js @@ -0,0 +1,720 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview function used in table data manipulation pages + * + * @requires jQuery + * @requires jQueryUI + * @requires js/functions.js + * + */ + +/** + * Modify form controls when the "NULL" checkbox is checked + * + * @param theType string the MySQL field type + * @param urlField string the urlencoded field name - OBSOLETE + * @param md5Field string the md5 hashed field name + * @param multi_edit string the multi_edit row sequence number + * + * @return boolean always true + */ +function nullify (theType, urlField, md5Field, multi_edit) { + var rowForm = document.forms.insertForm; + + if (typeof(rowForm.elements['funcs' + multi_edit + '[' + md5Field + ']']) !== 'undefined') { + rowForm.elements['funcs' + multi_edit + '[' + md5Field + ']'].selectedIndex = -1; + } + + // "ENUM" field with more than 20 characters + if (Number(theType) === 1) { + rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'][1].selectedIndex = -1; + // Other "ENUM" field + } else if (Number(theType) === 2) { + var elts = rowForm.elements['fields' + multi_edit + '[' + md5Field + ']']; + // when there is just one option in ENUM: + if (elts.checked) { + elts.checked = false; + } else { + var elts_cnt = elts.length; + for (var i = 0; i < elts_cnt; i++) { + elts[i].checked = false; + } // end for + } // end if + // "SET" field + } else if (Number(theType) === 3) { + rowForm.elements['fields' + multi_edit + '[' + md5Field + '][]'].selectedIndex = -1; + // Foreign key field (drop-down) + } else if (Number(theType) === 4) { + rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].selectedIndex = -1; + // foreign key field (with browsing icon for foreign values) + } else if (Number(theType) === 6) { + rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].value = ''; + // Other field types + } else /* if (theType === 5)*/ { + rowForm.elements['fields' + multi_edit + '[' + md5Field + ']'].value = ''; + } // end if... else if... else + + return true; +} // end of the 'nullify()' function + + +/** + * javascript DateTime format validation. + * its used to prevent adding default (0000-00-00 00:00:00) to database when user enter wrong values + * Start of validation part + */ +// function checks the number of days in febuary +function daysInFebruary (year) { + return (((year % 4 === 0) && (((year % 100 !== 0)) || (year % 400 === 0))) ? 29 : 28); +} +// function to convert single digit to double digit +function fractionReplace (num) { + num = parseInt(num, 10); + return num >= 1 && num <= 9 ? '0' + num : '00'; +} + +/* function to check the validity of date +* The following patterns are accepted in this validation (accepted in mysql as well) +* 1) 2001-12-23 +* 2) 2001-1-2 +* 3) 02-12-23 +* 4) And instead of using '-' the following punctuations can be used (+,.,*,^,@,/) All these are accepted by mysql as well. Therefore no issues +*/ +function isDate (val, tmstmp) { + val = val.replace(/[.|*|^|+|//|@]/g, '-'); + var arrayVal = val.split('-'); + for (var a = 0; a < arrayVal.length; a++) { + if (arrayVal[a].length === 1) { + arrayVal[a] = fractionReplace(arrayVal[a]); + } + } + val = arrayVal.join('-'); + var pos = 2; + var dtexp = new RegExp(/^([0-9]{4})-(((01|03|05|07|08|10|12)-((0[0-9])|([1-2][0-9])|(3[0-1])))|((02|04|06|09|11)-((0[0-9])|([1-2][0-9])|30))|((00)-(00)))$/); + if (val.length === 8) { + pos = 0; + } + if (dtexp.test(val)) { + var month = parseInt(val.substring(pos + 3, pos + 5), 10); + var day = parseInt(val.substring(pos + 6, pos + 8), 10); + var year = parseInt(val.substring(0, pos + 2), 10); + if (month === 2 && day > daysInFebruary(year)) { + return false; + } + if (val.substring(0, pos + 2).length === 2) { + year = parseInt('20' + val.substring(0, pos + 2), 10); + } + if (tmstmp === true) { + if (year < 1978) { + return false; + } + if (year > 2038 || (year > 2037 && day > 19 && month >= 1) || (year > 2037 && month > 1)) { + return false; + } + } + } else { + return false; + } + return true; +} + +/* function to check the validity of time +* The following patterns are accepted in this validation (accepted in mysql as well) +* 1) 2:3:4 +* 2) 2:23:43 +* 3) 2:23:43.123456 +*/ +function isTime (val) { + var arrayVal = val.split(':'); + for (var a = 0, l = arrayVal.length; a < l; a++) { + if (arrayVal[a].length === 1) { + arrayVal[a] = fractionReplace(arrayVal[a]); + } + } + val = arrayVal.join(':'); + var tmexp = new RegExp(/^(-)?(([0-7]?[0-9][0-9])|(8[0-2][0-9])|(83[0-8])):((0[0-9])|([1-5][0-9])):((0[0-9])|([1-5][0-9]))(\.[0-9]{1,6}){0,1}$/); + return tmexp.test(val); +} + +/** + * To check whether insert section is ignored or not + */ +function checkForCheckbox (multi_edit) { + if ($('#insert_ignore_' + multi_edit).length) { + return $('#insert_ignore_' + multi_edit).is(':unchecked'); + } + return true; +} + +function verificationsAfterFieldChange (urlField, multi_edit, theType) { + var evt = window.event || arguments.callee.caller.arguments[0]; + var target = evt.target || evt.srcElement; + var $this_input = $(':input[name^=\'fields[multi_edit][' + multi_edit + '][' + + urlField + ']\']'); + // the function drop-down that corresponds to this input field + var $this_function = $('select[name=\'funcs[multi_edit][' + multi_edit + '][' + + urlField + ']\']'); + var function_selected = false; + if (typeof $this_function.val() !== 'undefined' && + $this_function.val() !== null && + $this_function.val().length > 0 + ) { + function_selected = true; + } + + // To generate the textbox that can take the salt + var new_salt_box = '
      '; + + // If encrypting or decrypting functions that take salt as input is selected append the new textbox for salt + if (target.value === 'AES_ENCRYPT' || + target.value === 'AES_DECRYPT' || + target.value === 'DES_ENCRYPT' || + target.value === 'DES_DECRYPT' || + target.value === 'ENCRYPT') { + if (!($('#salt_' + target.id).length)) { + $this_input.after(new_salt_box); + } + } else { + // Remove the textbox for salt + $('#salt_' + target.id).prev('br').remove(); + $('#salt_' + target.id).remove(); + } + + if (target.value === 'AES_DECRYPT' + || target.value === 'AES_ENCRYPT' + || target.value === 'MD5') { + $('#' + target.id).rules('add', { + validationFunctionForFuns: { + param: $this_input, + depends: function () { + return checkForCheckbox(multi_edit); + } + } + }); + } + + // Unchecks the corresponding "NULL" control + $('input[name=\'fields_null[multi_edit][' + multi_edit + '][' + urlField + ']\']').prop('checked', false); + + // Unchecks the Ignore checkbox for the current row + $('input[name=\'insert_ignore_' + multi_edit + '\']').prop('checked', false); + + var charExceptionHandling; + if (theType.substring(0,4) === 'char') { + charExceptionHandling = theType.substring(5,6); + } else if (theType.substring(0,7) === 'varchar') { + charExceptionHandling = theType.substring(8,9); + } + if (function_selected) { + $this_input.removeAttr('min'); + $this_input.removeAttr('max'); + // @todo: put back attributes if corresponding function is deselected + } + + if ($this_input.data('rulesadded') === null && ! function_selected) { + // call validate before adding rules + $($this_input[0].form).validate(); + // validate for date time + if (theType === 'datetime' || theType === 'time' || theType === 'date' || theType === 'timestamp') { + $this_input.rules('add', { + validationFunctionForDateTime: { + param: theType, + depends: function () { + return checkForCheckbox(multi_edit); + } + } + }); + } + // validation for integer type + if ($this_input.data('type') === 'INT') { + var mini = parseInt($this_input.attr('min')); + var maxi = parseInt($this_input.attr('max')); + $this_input.rules('add', { + number: { + param : true, + depends: function () { + return checkForCheckbox(multi_edit); + } + }, + min: { + param: mini, + depends: function () { + if (isNaN($this_input.val())) { + return false; + } else { + return checkForCheckbox(multi_edit); + } + } + }, + max: { + param: maxi, + depends: function () { + if (isNaN($this_input.val())) { + return false; + } else { + return checkForCheckbox(multi_edit); + } + } + } + }); + // validation for CHAR types + } else if ($this_input.data('type') === 'CHAR') { + var maxlen = $this_input.data('maxlength'); + if (typeof maxlen !== 'undefined') { + if (maxlen <= 4) { + maxlen = charExceptionHandling; + } + $this_input.rules('add', { + maxlength: { + param: maxlen, + depends: function () { + return checkForCheckbox(multi_edit); + } + } + }); + } + // validate binary & blob types + } else if ($this_input.data('type') === 'HEX') { + $this_input.rules('add', { + validationFunctionForHex: { + param: true, + depends: function () { + return checkForCheckbox(multi_edit); + } + } + }); + } + $this_input.data('rulesadded', true); + } else if ($this_input.data('rulesadded') === true && function_selected) { + // remove any rules added + $this_input.rules('remove'); + // remove any error messages + $this_input + .removeClass('error') + .removeAttr('aria-invalid') + .siblings('.error') + .remove(); + $this_input.data('rulesadded', null); + } +} +/* End of fields validation*/ + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_change.js', function () { + $(document).off('click', 'span.open_gis_editor'); + $(document).off('click', 'input[name^=\'insert_ignore_\']'); + $(document).off('click', 'input[name=\'gis_data[save]\']'); + $(document).off('click', 'input.checkbox_null'); + $('select[name="submit_type"]').off('change'); + $(document).off('change', '#insert_rows'); +}); + +/** + * Ajax handlers for Change Table page + * + * Actions Ajaxified here: + * Submit Data to be inserted into the table. + * Restart insertion with 'N' rows. + */ +AJAX.registerOnload('tbl_change.js', function () { + if ($('#insertForm').length) { + // validate the comment form when it is submitted + $('#insertForm').validate(); + jQuery.validator.addMethod('validationFunctionForHex', function (value, element) { + return value.match(/^[a-f0-9]*$/i) !== null; + }); + + jQuery.validator.addMethod('validationFunctionForFuns', function (value, element, options) { + if (value.substring(0, 3) === 'AES' && options.data('type') !== 'HEX') { + return false; + } + + return !(value.substring(0, 3) === 'MD5' && + typeof options.data('maxlength') !== 'undefined' && + options.data('maxlength') < 32); + }); + + jQuery.validator.addMethod('validationFunctionForDateTime', function (value, element, options) { + var dt_value = value; + var theType = options; + if (theType === 'date') { + return isDate(dt_value); + } else if (theType === 'time') { + return isTime(dt_value); + } else if (theType === 'datetime' || theType === 'timestamp') { + var tmstmp = false; + dt_value = dt_value.trim(); + if (dt_value === 'CURRENT_TIMESTAMP' || dt_value === 'current_timestamp()') { + return true; + } + if (theType === 'timestamp') { + tmstmp = true; + } + if (dt_value === '0000-00-00 00:00:00') { + return true; + } + var dv = dt_value.indexOf(' '); + if (dv === -1) { // Only the date component, which is valid + return isDate(dt_value, tmstmp); + } + + return isDate(dt_value.substring(0, dv), tmstmp) && + isTime(dt_value.substring(dv + 1)); + } + }); + /* + * message extending script must be run + * after initiation of functions + */ + extendingValidatorMessages(); + } + + $.datepicker.initialized = false; + + $(document).on('click', 'span.open_gis_editor', function (event) { + event.preventDefault(); + + var $span = $(this); + // Current value + var value = $span.parent('td').children('input[type=\'text\']').val(); + // Field name + var field = $span.parents('tr').children('td:first').find('input[type=\'hidden\']').val(); + // Column type + var type = $span.parents('tr').find('span.column_type').text(); + // Names of input field and null checkbox + var input_name = $span.parent('td').children('input[type=\'text\']').attr('name'); + + openGISEditor(); + if (!gisEditorLoaded) { + loadJSAndGISEditor(value, field, type, input_name); + } else { + loadGISEditor(value, field, type, input_name); + } + }); + + /** + * Forced validation check of fields + */ + $(document).on('click','input[name^=\'insert_ignore_\']', function (event) { + $('#insertForm').valid(); + }); + + /** + * Uncheck the null checkbox as geometry data is placed on the input field + */ + $(document).on('click', 'input[name=\'gis_data[save]\']', function (event) { + var input_name = $('form#gis_data_editor_form').find('input[name=\'input_name\']').val(); + var $null_checkbox = $('input[name=\'' + input_name + '\']').parents('tr').find('.checkbox_null'); + $null_checkbox.prop('checked', false); + }); + + /** + * Handles all current checkboxes for Null; this only takes care of the + * checkboxes on currently displayed rows as the rows generated by + * "Continue insertion" are handled in the "Continue insertion" code + * + */ + $(document).on('click', 'input.checkbox_null', function () { + nullify( + // use hidden fields populated by tbl_change.php + $(this).siblings('.nullify_code').val(), + $(this).closest('tr').find('input:hidden').first().val(), + $(this).siblings('.hashed_field').val(), + $(this).siblings('.multi_edit').val() + ); + }); + + /** + * Reset the auto_increment column to 0 when selecting any of the + * insert options in submit_type-dropdown. Only perform the reset + * when we are in edit-mode, and not in insert-mode(no previous value + * available). + */ + $('select[name="submit_type"]').on('change', function () { + var thisElemSubmitTypeVal = $(this).val(); + var $table = $('table.insertRowTable'); + var auto_increment_column = $table.find('input[name^="auto_increment"]'); + auto_increment_column.each(function () { + var $thisElemAIField = $(this); + var thisElemName = $thisElemAIField.attr('name'); + + var prev_value_field = $table.find('input[name="' + thisElemName.replace('auto_increment', 'fields_prev') + '"]'); + var value_field = $table.find('input[name="' + thisElemName.replace('auto_increment', 'fields') + '"]'); + var previous_value = $(prev_value_field).val(); + if (previous_value !== undefined) { + if (thisElemSubmitTypeVal === 'insert' + || thisElemSubmitTypeVal === 'insertignore' + || thisElemSubmitTypeVal === 'showinsert' + ) { + $(value_field).val(0); + } else { + $(value_field).val(previous_value); + } + } + }); + }); + + /** + * Handle ENTER key when press on Continue insert with field + */ + $('#insert_rows').keypress(function (e) { + var key = e.which; + if (key === 13) { + addNewContinueInsertionFiels(e); + } + }); + + /** + * Continue Insertion form + */ + $(document).on('change', '#insert_rows', addNewContinueInsertionFiels); +}); + +function addNewContinueInsertionFiels (event) { + event.preventDefault(); + /** + * @var columnCount Number of number of columns table has. + */ + var columnCount = $('table.insertRowTable:first').find('tr').has('input[name*=\'fields_name\']').length; + /** + * @var curr_rows Number of current insert rows already on page + */ + var curr_rows = $('table.insertRowTable').length; + /** + * @var target_rows Number of rows the user wants + */ + var target_rows = $('#insert_rows').val(); + + // remove all datepickers + $('input.datefield, input.datetimefield').each(function () { + $(this).datepicker('destroy'); + }); + + if (curr_rows < target_rows) { + var tempIncrementIndex = function () { + var $this_element = $(this); + /** + * Extract the index from the name attribute for all input/select fields and increment it + * name is of format funcs[multi_edit][10][] + */ + + /** + * @var this_name String containing name of the input/select elements + */ + var this_name = $this_element.attr('name'); + /** split {@link this_name} at [10], so we have the parts that can be concatenated later */ + var name_parts = this_name.split(/\[\d+\]/); + /** extract the [10] from {@link name_parts} */ + var old_row_index_string = this_name.match(/\[\d+\]/)[0]; + /** extract 10 - had to split into two steps to accomodate double digits */ + var old_row_index = parseInt(old_row_index_string.match(/\d+/)[0], 10); + + /** calculate next index i.e. 11 */ + new_row_index = old_row_index + 1; + /** generate the new name i.e. funcs[multi_edit][11][foobarbaz] */ + var new_name = name_parts[0] + '[' + new_row_index + ']' + name_parts[1]; + + var hashed_field = name_parts[1].match(/\[(.+)\]/)[1]; + $this_element.attr('name', new_name); + + /** If element is select[name*='funcs'], update id */ + if ($this_element.is('select[name*=\'funcs\']')) { + var this_id = $this_element.attr('id'); + var id_parts = this_id.split(/\_/); + var old_id_index = id_parts[1]; + var prevSelectedValue = $('#field_' + old_id_index + '_1').val(); + var new_id_index = parseInt(old_id_index) + columnCount; + var new_id = 'field_' + new_id_index + '_1'; + $this_element.attr('id', new_id); + $this_element.find('option').filter(function () { + return $(this).text() === prevSelectedValue; + }).attr('selected','selected'); + + // If salt field is there then update its id. + var nextSaltInput = $this_element.parent().next('td').next('td').find('input[name*=\'salt\']'); + if (nextSaltInput.length !== 0) { + nextSaltInput.attr('id', 'salt_' + new_id); + } + } + + // handle input text fields and textareas + if ($this_element.is('.textfield') || $this_element.is('.char') || $this_element.is('textarea')) { + // do not remove the 'value' attribute for ENUM columns + // special handling for radio fields after updating ids to unique - see below + if ($this_element.closest('tr').find('span.column_type').html() !== 'enum') { + $this_element.val($this_element.closest('tr').find('span.default_value').html()); + } + $this_element + .off('change') + // Remove onchange attribute that was placed + // by tbl_change.php; it refers to the wrong row index + .attr('onchange', null) + // Keep these values to be used when the element + // will change + .data('hashed_field', hashed_field) + .data('new_row_index', new_row_index) + .on('change', function () { + var $changed_element = $(this); + verificationsAfterFieldChange( + $changed_element.data('hashed_field'), + $changed_element.data('new_row_index'), + $changed_element.closest('tr').find('span.column_type').html() + ); + }); + } + + if ($this_element.is('.checkbox_null')) { + $this_element + // this event was bound earlier by jQuery but + // to the original row, not the cloned one, so unbind() + .off('click') + // Keep these values to be used when the element + // will be clicked + .data('hashed_field', hashed_field) + .data('new_row_index', new_row_index) + .on('click', function () { + var $changed_element = $(this); + nullify( + $changed_element.siblings('.nullify_code').val(), + $this_element.closest('tr').find('input:hidden').first().val(), + $changed_element.data('hashed_field'), + '[multi_edit][' + $changed_element.data('new_row_index') + ']' + ); + }); + } + }; + + var tempReplaceAnchor = function () { + var $anchor = $(this); + var new_value = 'rownumber=' + new_row_index; + // needs improvement in case something else inside + // the href contains this pattern + var new_href = $anchor.attr('href').replace(/rownumber=\d+/, new_value); + $anchor.attr('href', new_href); + }; + + while (curr_rows < target_rows) { + /** + * @var $last_row Object referring to the last row + */ + var $last_row = $('#insertForm').find('.insertRowTable:last'); + + // need to access this at more than one level + // (also needs improvement because it should be calculated + // just once per cloned row, not once per column) + var new_row_index = 0; + + // Clone the insert tables + $last_row + .clone(true, true) + .insertBefore('#actions_panel') + .find('input[name*=multi_edit],select[name*=multi_edit],textarea[name*=multi_edit]') + .each(tempIncrementIndex) + .end() + .find('.foreign_values_anchor') + .each(tempReplaceAnchor); + + // Insert/Clone the ignore checkboxes + if (curr_rows === 1) { + $('') + .insertBefore('table.insertRowTable:last') + .after(''); + } else { + /** + * @var $last_checkbox Object reference to the last checkbox in #insertForm + */ + var $last_checkbox = $('#insertForm').children('input:checkbox:last'); + + /** name of {@link $last_checkbox} */ + var last_checkbox_name = $last_checkbox.attr('name'); + /** index of {@link $last_checkbox} */ + var last_checkbox_index = parseInt(last_checkbox_name.match(/\d+/), 10); + /** name of new {@link $last_checkbox} */ + var new_name = last_checkbox_name.replace(/\d+/, last_checkbox_index + 1); + + $('
      ') + .insertBefore('table.insertRowTable:last'); + + $last_checkbox + .clone() + .attr({ 'id': new_name, 'name': new_name }) + .prop('checked', true) + .insertBefore('table.insertRowTable:last'); + + $('label[for^=insert_ignore]:last') + .clone() + .attr('for', new_name) + .insertBefore('table.insertRowTable:last'); + + $('
      ') + .insertBefore('table.insertRowTable:last'); + } + curr_rows++; + } + // recompute tabindex for text fields and other controls at footer; + // IMO it's not really important to handle the tabindex for + // function and Null + var tabindex = 0; + $('.textfield, .char, textarea') + .each(function () { + tabindex++; + $(this).attr('tabindex', tabindex); + // update the IDs of textfields to ensure that they are unique + $(this).attr('id', 'field_' + tabindex + '_3'); + + // special handling for radio fields after updating ids to unique + if ($(this).closest('tr').find('span.column_type').html() === 'enum') { + if ($(this).val() === $(this).closest('tr').find('span.default_value').html()) { + $(this).prop('checked', true); + } else { + $(this).prop('checked', false); + } + } + }); + $('.control_at_footer') + .each(function () { + tabindex++; + $(this).attr('tabindex', tabindex); + }); + } else if (curr_rows > target_rows) { + /** + * Displays alert if data loss possible on decrease + * of rows. + */ + var checkLock = jQuery.isEmptyObject(AJAX.lockedTargets); + if (checkLock || confirm(PMA_messages.strConfirmRowChange) === true) { + while (curr_rows > target_rows) { + $('input[id^=insert_ignore]:last') + .nextUntil('fieldset') + .addBack() + .remove(); + curr_rows--; + } + } else { + document.getElementById('insert_rows').value = curr_rows; + } + } + // Add all the required datepickers back + addDateTimePicker(); +} + +function changeValueFieldType (elem, searchIndex) { + var fieldsValue = $('select#fieldID_' + searchIndex); + if (0 === fieldsValue.size()) { + return; + } + + var type = $(elem).val(); + if ('IN (...)' === type || + 'NOT IN (...)' === type || + 'BETWEEN' === type || + 'NOT BETWEEN' === type + ) { + $('#fieldID_' + searchIndex).attr('multiple', ''); + } else { + $('#fieldID_' + searchIndex).removeAttr('multiple'); + } +} diff --git a/phpMyAdmin/js/tbl_chart.js b/phpMyAdmin/js/tbl_chart.js new file mode 100755 index 0000000..b43a221 --- /dev/null +++ b/phpMyAdmin/js/tbl_chart.js @@ -0,0 +1,423 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +var chart_data = {}; +var temp_chart_title; + +var currentChart = null; +var currentSettings = null; + +var dateTimeCols = []; +var numericCols = []; + +function extractDate (dateString) { + var matches; + var match; + var dateTimeRegExp = /[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}/; + var dateRegExp = /[0-9]{4}-[0-9]{2}-[0-9]{2}/; + + matches = dateTimeRegExp.exec(dateString); + if (matches !== null && matches.length > 0) { + match = matches[0]; + return new Date(match.substr(0, 4), parseInt(match.substr(5, 2), 10) - 1, match.substr(8, 2), match.substr(11, 2), match.substr(14, 2), match.substr(17, 2)); + } else { + matches = dateRegExp.exec(dateString); + if (matches !== null && matches.length > 0) { + match = matches[0]; + return new Date(match.substr(0, 4), parseInt(match.substr(5, 2), 10) - 1, match.substr(8, 2)); + } + } + return null; +} + +function PMA_queryChart (data, columnNames, settings) { + if ($('#querychart').length === 0) { + return; + } + + var plotSettings = { + title : { + text : settings.title, + escapeHtml: true + }, + grid : { + drawBorder : false, + shadow : false, + background : 'rgba(0,0,0,0)' + }, + legend : { + show : true, + placement : 'outsideGrid', + location : 'e', + rendererOptions: { + numberColumns: 2 + } + }, + axes : { + xaxis : { + label : escapeHtml(settings.xaxisLabel) + }, + yaxis : { + label : settings.yaxisLabel + } + }, + stackSeries : settings.stackSeries + }; + + // create the chart + var factory = new JQPlotChartFactory(); + var chart = factory.createChart(settings.type, 'querychart'); + + // create the data table and add columns + var dataTable = new DataTable(); + if (settings.type === 'timeline') { + dataTable.addColumn(ColumnType.DATE, columnNames[settings.mainAxis]); + } else if (settings.type === 'scatter') { + dataTable.addColumn(ColumnType.NUMBER, columnNames[settings.mainAxis]); + } else { + dataTable.addColumn(ColumnType.STRING, columnNames[settings.mainAxis]); + } + + var i; + if (settings.seriesColumn === null) { + $.each(settings.selectedSeries, function (index, element) { + dataTable.addColumn(ColumnType.NUMBER, columnNames[element]); + }); + + // set data to the data table + var columnsToExtract = [settings.mainAxis]; + $.each(settings.selectedSeries, function (index, element) { + columnsToExtract.push(element); + }); + var values = []; + var newRow; + var row; + var col; + for (i = 0; i < data.length; i++) { + row = data[i]; + newRow = []; + for (var j = 0; j < columnsToExtract.length; j++) { + col = columnNames[columnsToExtract[j]]; + if (j === 0) { + if (settings.type === 'timeline') { // first column is date type + newRow.push(extractDate(row[col])); + } else if (settings.type === 'scatter') { + newRow.push(parseFloat(row[col])); + } else { // first column is string type + newRow.push(row[col]); + } + } else { // subsequent columns are of type, number + newRow.push(parseFloat(row[col])); + } + } + values.push(newRow); + } + dataTable.setData(values); + } else { + var seriesNames = {}; + var seriesNumber = 1; + var seriesColumnName = columnNames[settings.seriesColumn]; + for (i = 0; i < data.length; i++) { + if (! seriesNames[data[i][seriesColumnName]]) { + seriesNames[data[i][seriesColumnName]] = seriesNumber; + seriesNumber++; + } + } + + $.each(seriesNames, function (seriesName, seriesNumber) { + dataTable.addColumn(ColumnType.NUMBER, seriesName); + }); + + var valueMap = {}; + var xValue; + var value; + var mainAxisName = columnNames[settings.mainAxis]; + var valueColumnName = columnNames[settings.valueColumn]; + for (i = 0; i < data.length; i++) { + xValue = data[i][mainAxisName]; + value = valueMap[xValue]; + if (! value) { + value = [xValue]; + valueMap[xValue] = value; + } + seriesNumber = seriesNames[data[i][seriesColumnName]]; + value[seriesNumber] = parseFloat(data[i][valueColumnName]); + } + + var values = []; + $.each(valueMap, function (index, value) { + values.push(value); + }); + dataTable.setData(values); + } + + // draw the chart and return the chart object + chart.draw(dataTable, plotSettings); + return chart; +} + +function drawChart () { + currentSettings.width = $('#resizer').width() - 20; + currentSettings.height = $('#resizer').height() - 20; + + // TODO: a better way using .redraw() ? + if (currentChart !== null) { + currentChart.destroy(); + } + + var columnNames = []; + $('select[name="chartXAxis"] option').each(function () { + columnNames.push(escapeHtml($(this).text())); + }); + try { + currentChart = PMA_queryChart(chart_data, columnNames, currentSettings); + if (currentChart !== null) { + $('#saveChart').attr('href', currentChart.toImageString()); + } + } catch (err) { + PMA_ajaxShowMessage(err.message, false); + } +} + +function getSelectedSeries () { + var val = $('select[name="chartSeries"]').val() || []; + var ret = []; + $.each(val, function (i, v) { + ret.push(parseInt(v, 10)); + }); + return ret; +} + +function onXAxisChange () { + var $xAxisSelect = $('select[name="chartXAxis"]'); + currentSettings.mainAxis = parseInt($xAxisSelect.val(), 10); + if (dateTimeCols.indexOf(currentSettings.mainAxis) !== -1) { + $('span.span_timeline').show(); + } else { + $('span.span_timeline').hide(); + if (currentSettings.type === 'timeline') { + $('input#radio_line').prop('checked', true); + currentSettings.type = 'line'; + } + } + if (numericCols.indexOf(currentSettings.mainAxis) !== -1) { + $('span.span_scatter').show(); + } else { + $('span.span_scatter').hide(); + if (currentSettings.type === 'scatter') { + $('input#radio_line').prop('checked', true); + currentSettings.type = 'line'; + } + } + var xaxis_title = $xAxisSelect.children('option:selected').text(); + $('input[name="xaxis_label"]').val(xaxis_title); + currentSettings.xaxisLabel = xaxis_title; +} + +function onDataSeriesChange () { + var $seriesSelect = $('select[name="chartSeries"]'); + currentSettings.selectedSeries = getSelectedSeries(); + var yaxis_title; + if (currentSettings.selectedSeries.length === 1) { + $('span.span_pie').show(); + yaxis_title = $seriesSelect.children('option:selected').text(); + } else { + $('span.span_pie').hide(); + if (currentSettings.type === 'pie') { + $('input#radio_line').prop('checked', true); + currentSettings.type = 'line'; + } + yaxis_title = PMA_messages.strYValues; + } + $('input[name="yaxis_label"]').val(yaxis_title); + currentSettings.yaxisLabel = yaxis_title; +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_chart.js', function () { + $('input[name="chartType"]').off('click'); + $('input[name="barStacked"]').off('click'); + $('input[name="chkAlternative"]').off('click'); + $('input[name="chartTitle"]').off('focus').off('keyup').off('blur'); + $('select[name="chartXAxis"]').off('change'); + $('select[name="chartSeries"]').off('change'); + $('select[name="chartSeriesColumn"]').off('change'); + $('select[name="chartValueColumn"]').off('change'); + $('input[name="xaxis_label"]').off('keyup'); + $('input[name="yaxis_label"]').off('keyup'); + $('#resizer').off('resizestop'); + $('#tblchartform').off('submit'); +}); + +AJAX.registerOnload('tbl_chart.js', function () { + // handle manual resize + $('#resizer').on('resizestop', function (event, ui) { + // make room so that the handle will still appear + $('#querychart').height($('#resizer').height() * 0.96); + $('#querychart').width($('#resizer').width() * 0.96); + if (currentChart !== null) { + currentChart.redraw({ + resetAxes : true + }); + } + }); + + // handle chart type changes + $('input[name="chartType"]').click(function () { + var type = currentSettings.type = $(this).val(); + if (type === 'bar' || type === 'column' || type === 'area') { + $('span.barStacked').show(); + } else { + $('input[name="barStacked"]').prop('checked', false); + $.extend(true, currentSettings, { stackSeries : false }); + $('span.barStacked').hide(); + } + drawChart(); + }); + + // handle chosing alternative data format + $('input[name="chkAlternative"]').click(function () { + var $seriesColumn = $('select[name="chartSeriesColumn"]'); + var $valueColumn = $('select[name="chartValueColumn"]'); + var $chartSeries = $('select[name="chartSeries"]'); + if ($(this).is(':checked')) { + $seriesColumn.prop('disabled', false); + $valueColumn.prop('disabled', false); + $chartSeries.prop('disabled', true); + currentSettings.seriesColumn = parseInt($seriesColumn.val(), 10); + currentSettings.valueColumn = parseInt($valueColumn.val(), 10); + } else { + $seriesColumn.prop('disabled', true); + $valueColumn.prop('disabled', true); + $chartSeries.prop('disabled', false); + currentSettings.seriesColumn = null; + currentSettings.valueColumn = null; + } + drawChart(); + }); + + // handle stacking for bar, column and area charts + $('input[name="barStacked"]').click(function () { + if ($(this).is(':checked')) { + $.extend(true, currentSettings, { stackSeries : true }); + } else { + $.extend(true, currentSettings, { stackSeries : false }); + } + drawChart(); + }); + + // handle changes in chart title + $('input[name="chartTitle"]') + .focus(function () { + temp_chart_title = $(this).val(); + }) + .keyup(function () { + currentSettings.title = $('input[name="chartTitle"]').val(); + drawChart(); + }) + .blur(function () { + if ($(this).val() !== temp_chart_title) { + drawChart(); + } + }); + + // handle changing the x-axis + $('select[name="chartXAxis"]').change(function () { + onXAxisChange(); + drawChart(); + }); + + // handle changing the selected data series + $('select[name="chartSeries"]').change(function () { + onDataSeriesChange(); + drawChart(); + }); + + // handle changing the series column + $('select[name="chartSeriesColumn"]').change(function () { + currentSettings.seriesColumn = parseInt($(this).val(), 10); + drawChart(); + }); + + // handle changing the value column + $('select[name="chartValueColumn"]').change(function () { + currentSettings.valueColumn = parseInt($(this).val(), 10); + drawChart(); + }); + + // handle manual changes to the chart x-axis labels + $('input[name="xaxis_label"]').keyup(function () { + currentSettings.xaxisLabel = $(this).val(); + drawChart(); + }); + + // handle manual changes to the chart y-axis labels + $('input[name="yaxis_label"]').keyup(function () { + currentSettings.yaxisLabel = $(this).val(); + drawChart(); + }); + + // handler for ajax form submission + $('#tblchartform').submit(function (event) { + var $form = $(this); + if (codemirror_editor) { + $form[0].elements.sql_query.value = codemirror_editor.getValue(); + } + if (!checkSqlQuery($form[0])) { + return false; + } + + var $msgbox = PMA_ajaxShowMessage(); + PMA_prepareForAjaxRequest($form); + $.post($form.attr('action'), $form.serialize(), function (data) { + if (typeof data !== 'undefined' && + data.success === true && + typeof data.chartData !== 'undefined') { + chart_data = JSON.parse(data.chartData); + drawChart(); + PMA_ajaxRemoveMessage($msgbox); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }, 'json'); // end $.post() + + return false; + }); + + // from jQuery UI + $('#resizer').resizable({ + minHeight: 240, + minWidth: 300 + }) + .width($('#div_view_options').width() - 50) + .trigger('resizestop'); + + currentSettings = { + type : 'line', + width : $('#resizer').width() - 20, + height : $('#resizer').height() - 20, + xaxisLabel : $('input[name="xaxis_label"]').val(), + yaxisLabel : $('input[name="yaxis_label"]').val(), + title : $('input[name="chartTitle"]').val(), + stackSeries : false, + mainAxis : parseInt($('select[name="chartXAxis"]').val(), 10), + selectedSeries : getSelectedSeries(), + seriesColumn : null + }; + + var vals = $('input[name="dateTimeCols"]').val().split(' '); + $.each(vals, function (i, v) { + dateTimeCols.push(parseInt(v, 10)); + }); + + vals = $('input[name="numericCols"]').val().split(' '); + $.each(vals, function (i, v) { + numericCols.push(parseInt(v, 10)); + }); + + onXAxisChange(); + onDataSeriesChange(); + + $('#tblchartform').submit(); +}); diff --git a/phpMyAdmin/js/tbl_find_replace.js b/phpMyAdmin/js/tbl_find_replace.js new file mode 100755 index 0000000..8b48e53 --- /dev/null +++ b/phpMyAdmin/js/tbl_find_replace.js @@ -0,0 +1,46 @@ +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_find_replace.js', function () { + $('#find_replace_form').off('submit'); + $('#toggle_find').off('click'); +}); + +/** + * Bind events + */ +AJAX.registerOnload('tbl_find_replace.js', function () { + $('
      ') + .insertAfter('#find_replace_form') + .hide(); + + $('#toggle_find') + .html(PMA_messages.strHideFindNReplaceCriteria) + .click(function () { + var $link = $(this); + $('#find_replace_form').slideToggle(); + if ($link.text() === PMA_messages.strHideFindNReplaceCriteria) { + $link.text(PMA_messages.strShowFindNReplaceCriteria); + } else { + $link.text(PMA_messages.strHideFindNReplaceCriteria); + } + return false; + }); + + $('#find_replace_form').submit(function (e) { + e.preventDefault(); + var findReplaceForm = $('#find_replace_form'); + PMA_prepareForAjaxRequest(findReplaceForm); + var $msgbox = PMA_ajaxShowMessage(); + $.post(findReplaceForm.attr('action'), findReplaceForm.serialize(), function (data) { + PMA_ajaxRemoveMessage($msgbox); + if (data.success === true) { + $('#toggle_find_div').show(); + $('#toggle_find').click(); + $('#sqlqueryresultsouter').html(data.preview); + } else { + $('#sqlqueryresultsouter').html(data.error); + } + }); + }); +}); diff --git a/phpMyAdmin/js/tbl_gis_visualization.js b/phpMyAdmin/js/tbl_gis_visualization.js new file mode 100755 index 0000000..0cb70ab --- /dev/null +++ b/phpMyAdmin/js/tbl_gis_visualization.js @@ -0,0 +1,365 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview functions used for visualizing GIS data + * + * @requires jquery + * @requires vendor/jquery/jquery.svg.js + * @requires vendor/jquery/jquery.mousewheel.js + * @requires vendor/jquery/jquery.event.drag-2.2.js + */ + +// Constants +var zoomFactor = 1.5; +var defaultX = 0; +var defaultY = 0; + +// Variables +var x = 0; +var y = 0; +var scale = 1; + +var svg; + +/** + * Zooms and pans the visualization. + */ +function zoomAndPan () { + var g = svg.getElementById('groupPanel'); + if (!g) { + return; + } + + g.setAttribute('transform', 'translate(' + x + ', ' + y + ') scale(' + scale + ')'); + var id; + var circle; + $('circle.vector').each(function () { + id = $(this).attr('id'); + circle = svg.getElementById(id); + $(svg).change(circle, { + r : (3 / scale), + 'stroke-width' : (2 / scale) + }); + }); + + var line; + $('polyline.vector').each(function () { + id = $(this).attr('id'); + line = svg.getElementById(id); + $(svg).change(line, { + 'stroke-width' : (2 / scale) + }); + }); + + var polygon; + $('path.vector').each(function () { + id = $(this).attr('id'); + polygon = svg.getElementById(id); + $(svg).change(polygon, { + 'stroke-width' : (0.5 / scale) + }); + }); +} + +/** + * Initially loads either SVG or OSM visualization based on the choice. + */ +function selectVisualization () { + if ($('#choice').prop('checked') !== true) { + $('#openlayersmap').hide(); + } else { + $('#placeholder').hide(); + } +} + +/** + * Adds necessary styles to the div that coontains the openStreetMap. + */ +function styleOSM () { + var $placeholder = $('#placeholder'); + var cssObj = { + 'border' : '1px solid #aaa', + 'width' : $placeholder.width(), + 'height' : $placeholder.height(), + 'float' : 'right' + }; + $('#openlayersmap').css(cssObj); +} + +/** + * Loads the SVG element and make a reference to it. + */ +function loadSVG () { + var $placeholder = $('#placeholder'); + + $placeholder.svg({ + onLoad: function (svg_ref) { + svg = svg_ref; + } + }); + + // Removes the second SVG element unnecessarily added due to the above command + $placeholder.find('svg:nth-child(2)').remove(); +} + +/** + * Adds controllers for zooming and panning. + */ +function addZoomPanControllers () { + var $placeholder = $('#placeholder'); + if ($('#placeholder').find('svg').length > 0) { + var pmaThemeImage = $('#pmaThemeImage').val(); + // add panning arrows + $('').appendTo($placeholder); + $('').appendTo($placeholder); + $('').appendTo($placeholder); + $('').appendTo($placeholder); + // add zooming controls + $('').appendTo($placeholder); + $('').appendTo($placeholder); + $('').appendTo($placeholder); + } +} + +/** + * Resizes the GIS visualization to fit into the space available. + */ +function resizeGISVisualization () { + var $placeholder = $('#placeholder'); + var old_width = $placeholder.width(); + var visWidth = $('#div_view_options').width() - 48; + + // Assign new value for width + $placeholder.width(visWidth); + $('svg').attr('width', visWidth); + + // Assign the offset created due to resizing to defaultX and center the svg. + defaultX = (visWidth - old_width) / 2; + x = defaultX; + y = 0; + scale = 1; +} + +/** + * Initialize the GIS visualization. + */ +function initGISVisualization () { + // Loads either SVG or OSM visualization based on the choice + selectVisualization(); + // Resizes the GIS visualization to fit into the space available + resizeGISVisualization(); + if (typeof OpenLayers !== 'undefined') { + // Configure OpenLayers + OpenLayers._getScriptLocation = function () { + return './js/vendor/openlayers/'; + }; + // Adds necessary styles to the div that coontains the openStreetMap + styleOSM(); + // Draws openStreetMap with openLayers + drawOpenLayers(); + } + // Loads the SVG element and make a reference to it + loadSVG(); + // Adds controllers for zooming and panning + addZoomPanControllers(); + zoomAndPan(); +} + +function getRelativeCoords (e) { + var position = $('#placeholder').offset(); + return { + x : e.pageX - position.left, + y : e.pageY - position.top + }; +} + +/** + * Ajax handlers for GIS visualization page + * + * Actions Ajaxified here: + * + * Zooming in and zooming out on mousewheel movement. + * Panning the visualization on dragging. + * Zooming in on double clicking. + * Zooming out on clicking the zoom out button. + * Panning on clicking the arrow buttons. + * Displaying tooltips for GIS objects. + */ + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_gis_visualization.js', function () { + $(document).off('click', '#choice'); + $(document).off('mousewheel', '#placeholder'); + $(document).off('dragstart', 'svg'); + $(document).off('mouseup', 'svg'); + $(document).off('drag', 'svg'); + $(document).off('dblclick', '#placeholder'); + $(document).off('click', '#zoom_in'); + $(document).off('click', '#zoom_world'); + $(document).off('click', '#zoom_out'); + $(document).off('click', '#left_arrow'); + $(document).off('click', '#right_arrow'); + $(document).off('click', '#up_arrow'); + $(document).off('click', '#down_arrow'); + $('.vector').off('mousemove').off('mouseout'); +}); + +AJAX.registerOnload('tbl_gis_visualization.js', function () { + // If we are in GIS visualization, initialize it + if ($('#gis_div').length > 0) { + initGISVisualization(); + } + + if (typeof OpenLayers === 'undefined') { + $('#choice, #labelChoice').hide(); + } + $(document).on('click', '#choice', function () { + if ($(this).prop('checked') === false) { + $('#placeholder').show(); + $('#openlayersmap').hide(); + } else { + $('#placeholder').hide(); + $('#openlayersmap').show(); + } + }); + + $(document).on('mousewheel', '#placeholder', function (event, delta) { + event.preventDefault(); + var relCoords = getRelativeCoords(event); + if (delta > 0) { + // zoom in + scale *= zoomFactor; + // zooming in keeping the position under mouse pointer unmoved. + x = relCoords.x - (relCoords.x - x) * zoomFactor; + y = relCoords.y - (relCoords.y - y) * zoomFactor; + zoomAndPan(); + } else { + // zoom out + scale /= zoomFactor; + // zooming out keeping the position under mouse pointer unmoved. + x = relCoords.x - (relCoords.x - x) / zoomFactor; + y = relCoords.y - (relCoords.y - y) / zoomFactor; + zoomAndPan(); + } + return true; + }); + + var dragX = 0; + var dragY = 0; + + $(document).on('dragstart', 'svg', function (event, dd) { + $('#placeholder').addClass('placeholderDrag'); + dragX = Math.round(dd.offsetX); + dragY = Math.round(dd.offsetY); + }); + + $(document).on('mouseup', 'svg', function (event) { + $('#placeholder').removeClass('placeholderDrag'); + }); + + $(document).on('drag', 'svg', function (event, dd) { + var newX = Math.round(dd.offsetX); + x += newX - dragX; + dragX = newX; + var newY = Math.round(dd.offsetY); + y += newY - dragY; + dragY = newY; + zoomAndPan(); + }); + + $(document).on('dblclick', '#placeholder', function (event) { + scale *= zoomFactor; + // zooming in keeping the position under mouse pointer unmoved. + var relCoords = getRelativeCoords(event); + x = relCoords.x - (relCoords.x - x) * zoomFactor; + y = relCoords.y - (relCoords.y - y) * zoomFactor; + zoomAndPan(); + }); + + $(document).on('click', '#zoom_in', function (e) { + e.preventDefault(); + // zoom in + scale *= zoomFactor; + + var $placeholder = $('#placeholder').find('svg'); + width = $placeholder.attr('width'); + height = $placeholder.attr('height'); + // zooming in keeping the center unmoved. + x = width / 2 - (width / 2 - x) * zoomFactor; + y = height / 2 - (height / 2 - y) * zoomFactor; + zoomAndPan(); + }); + + $(document).on('click', '#zoom_world', function (e) { + e.preventDefault(); + scale = 1; + x = defaultX; + y = defaultY; + zoomAndPan(); + }); + + $(document).on('click', '#zoom_out', function (e) { + e.preventDefault(); + // zoom out + scale /= zoomFactor; + + var $placeholder = $('#placeholder').find('svg'); + width = $placeholder.attr('width'); + height = $placeholder.attr('height'); + // zooming out keeping the center unmoved. + x = width / 2 - (width / 2 - x) / zoomFactor; + y = height / 2 - (height / 2 - y) / zoomFactor; + zoomAndPan(); + }); + + $(document).on('click', '#left_arrow', function (e) { + e.preventDefault(); + x += 100; + zoomAndPan(); + }); + + $(document).on('click', '#right_arrow', function (e) { + e.preventDefault(); + x -= 100; + zoomAndPan(); + }); + + $(document).on('click', '#up_arrow', function (e) { + e.preventDefault(); + y += 100; + zoomAndPan(); + }); + + $(document).on('click', '#down_arrow', function (e) { + e.preventDefault(); + y -= 100; + zoomAndPan(); + }); + + /** + * Detect the mousemove event and show tooltips. + */ + $('.vector').on('mousemove', function (event) { + var contents = $.trim(escapeHtml($(this).attr('name'))); + $('#tooltip').remove(); + if (contents !== '') { + $('
      ' + contents + '
      ').css({ + position : 'absolute', + top : event.pageY + 10, + left : event.pageX + 10, + border : '1px solid #fdd', + padding : '2px', + 'background-color' : '#fee', + opacity : 0.90 + }).appendTo('body').fadeIn(200); + } + }); + + /** + * Detect the mouseout event and hide tooltips. + */ + $('.vector').on('mouseout', function (event) { + $('#tooltip').remove(); + }); +}); diff --git a/phpMyAdmin/js/tbl_operations.js b/phpMyAdmin/js/tbl_operations.js new file mode 100755 index 0000000..cb818a2 --- /dev/null +++ b/phpMyAdmin/js/tbl_operations.js @@ -0,0 +1,323 @@ +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_operations.js', function () { + $(document).off('submit', '#copyTable.ajax'); + $(document).off('submit', '#moveTableForm'); + $(document).off('submit', '#tableOptionsForm'); + $(document).off('submit', '#partitionsForm'); + $(document).off('click', '#tbl_maintenance li a.maintain_action.ajax'); + $(document).off('click', '#drop_tbl_anchor.ajax'); + $(document).off('click', '#drop_view_anchor.ajax'); + $(document).off('click', '#truncate_tbl_anchor.ajax'); +}); + +/** + * jQuery coding for 'Table operations'. Used on tbl_operations.php + * Attach Ajax Event handlers for Table operations + */ +AJAX.registerOnload('tbl_operations.js', function () { + /** + *Ajax action for submitting the "Copy table" + **/ + $(document).on('submit', '#copyTable.ajax', function (event) { + event.preventDefault(); + var $form = $(this); + PMA_prepareForAjaxRequest($form); + var argsep = PMA_commonParams.get('arg_separator'); + $.post($form.attr('action'), $form.serialize() + argsep + 'submit_copy=Go', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + if ($form.find('input[name=\'switch_to_new\']').prop('checked')) { + PMA_commonParams.set( + 'db', + $form.find('select[name=\'target_db\']').val() + ); + PMA_commonParams.set( + 'table', + $form.find('input[name=\'new_name\']').val() + ); + PMA_commonActions.refreshMain(false, function () { + PMA_ajaxShowMessage(data.message); + }); + } else { + PMA_ajaxShowMessage(data.message); + } + // Refresh navigation when the table is copied + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + });// end of copyTable ajax submit + + /** + *Ajax action for submitting the "Move table" + */ + $(document).on('submit', '#moveTableForm', function (event) { + event.preventDefault(); + var $form = $(this); + PMA_prepareForAjaxRequest($form); + var argsep = PMA_commonParams.get('arg_separator'); + $.post($form.attr('action'), $form.serialize() + argsep + 'submit_move=1', function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_commonParams.set('db', data._params.db); + PMA_commonParams.set('table', data._params.table); + PMA_commonActions.refreshMain('tbl_sql.php', function () { + PMA_ajaxShowMessage(data.message); + }); + // Refresh navigation when the table is copied + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + }); + + /** + * Ajax action for submitting the "Table options" + */ + $(document).on('submit', '#tableOptionsForm', function (event) { + event.preventDefault(); + event.stopPropagation(); + var $form = $(this); + var $tblNameField = $form.find('input[name=new_name]'); + var $tblCollationField = $form.find('select[name=tbl_collation]'); + var collationOrigValue = $('select[name="tbl_collation"] option[selected]').val(); + var $changeAllColumnCollationsCheckBox = $('#checkbox_change_all_collations'); + var question = PMA_messages.strChangeAllColumnCollationsWarning; + + if ($tblNameField.val() !== $tblNameField[0].defaultValue) { + // reload page and navigation if the table has been renamed + PMA_prepareForAjaxRequest($form); + + if ($tblCollationField.val() !== collationOrigValue && $changeAllColumnCollationsCheckBox.is(':checked')) { + $form.PMA_confirm(question, $form.attr('action'), function (url) { + submitOptionsForm(); + }); + } else { + submitOptionsForm(); + } + } else { + if ($tblCollationField.val() !== collationOrigValue && $changeAllColumnCollationsCheckBox.is(':checked')) { + $form.PMA_confirm(question, $form.attr('action'), function (url) { + $form.removeClass('ajax').submit().addClass('ajax'); + }); + } else { + $form.removeClass('ajax').submit().addClass('ajax'); + } + } + + function submitOptionsForm () { + $.post($form.attr('action'), $form.serialize(), function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_commonParams.set('table', data._params.table); + PMA_commonActions.refreshMain(false, function () { + $('#page_content').html(data.message); + PMA_highlightSQL($('#page_content')); + }); + // Refresh navigation when the table is renamed + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + } + }); + + /** + *Ajax events for actions in the "Table maintenance" + **/ + $(document).on('click', '#tbl_maintenance li a.maintain_action.ajax', function (event) { + event.preventDefault(); + var $link = $(this); + + if ($('.sqlqueryresults').length !== 0) { + $('.sqlqueryresults').remove(); + } + if ($('.result_query').length !== 0) { + $('.result_query').remove(); + } + // variables which stores the common attributes + var params = $.param({ + ajax_request: 1, + server: PMA_commonParams.get('server') + }); + var postData = $link.getPostData(); + if (postData) { + params += PMA_commonParams.get('arg_separator') + postData; + } + + $.post($link.attr('href'), params, function (data) { + function scrollToTop () { + $('html, body').animate({ scrollTop: 0 }); + } + var $temp_div; + if (typeof data !== 'undefined' && data.success === true && data.sql_query !== undefined) { + PMA_ajaxShowMessage(data.message); + $('
      ').prependTo('#page_content'); + $('.sqlqueryresults').html(data.sql_query); + PMA_highlightSQL($('#page_content')); + scrollToTop(); + } else if (typeof data !== 'undefined' && data.success === true) { + $temp_div = $('
      '); + $temp_div.html(data.message); + var $success = $temp_div.find('.result_query .success'); + PMA_ajaxShowMessage($success); + $('
      ').prependTo('#page_content'); + $('.sqlqueryresults').html(data.message); + PMA_highlightSQL($('#page_content')); + PMA_init_slider(); + $('.sqlqueryresults').children('fieldset,br').remove(); + scrollToTop(); + } else { + $temp_div = $('
      '); + $temp_div.html(data.error); + + var $error; + if ($temp_div.find('.error code').length !== 0) { + $error = $temp_div.find('.error code').addClass('error'); + } else { + $error = $temp_div; + } + + PMA_ajaxShowMessage($error, false); + } + }); // end $.post() + });// end of table maintenance ajax click + + /** + * Ajax action for submitting the "Partition Maintenance" + * Also, asks for confirmation when DROP partition is submitted + */ + $(document).on('submit', '#partitionsForm', function (event) { + event.preventDefault(); + var $form = $(this); + + function submitPartitionMaintenance () { + var argsep = PMA_commonParams.get('arg_separator'); + var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true'; + PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + AJAX.source = $form; + $.post($form.attr('action'), submitData, AJAX.responseHandler); + } + + if ($('#partition_operation_DROP').is(':checked')) { + var question = PMA_messages.strDropPartitionWarning; + $form.PMA_confirm(question, $form.attr('action'), function (url) { + submitPartitionMaintenance(); + }); + } else if ($('#partition_operation_TRUNCATE').is(':checked')) { + var question = PMA_messages.strTruncatePartitionWarning; + $form.PMA_confirm(question, $form.attr('action'), function (url) { + submitPartitionMaintenance(); + }); + } else { + submitPartitionMaintenance(); + } + }); + + $(document).on('click', '#drop_tbl_anchor.ajax', function (event) { + event.preventDefault(); + var $link = $(this); + /** + * @var question String containing the question to be asked for confirmation + */ + var question = PMA_messages.strDropTableStrongWarning + ' '; + question += PMA_sprintf( + PMA_messages.strDoYouReally, + 'DROP TABLE `' + escapeHtml(PMA_commonParams.get('db')) + '`.`' + escapeHtml(PMA_commonParams.get('table') + '`') + ) + getForeignKeyCheckboxLoader(); + + $(this).PMA_confirm(question, $(this).attr('href'), function (url) { + var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + + var params = getJSConfirmCommonParam(this, $link.getPostData()); + + $.post(url, params, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxRemoveMessage($msgbox); + // Table deleted successfully, refresh both the frames + PMA_reloadNavigation(); + PMA_commonParams.set('table', ''); + PMA_commonActions.refreshMain( + PMA_commonParams.get('opendb_url'), + function () { + PMA_ajaxShowMessage(data.message); + } + ); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + }, loadForeignKeyCheckbox); // end $.PMA_confirm() + }); // end of Drop Table Ajax action + + $(document).on('click', '#drop_view_anchor.ajax', function (event) { + event.preventDefault(); + var $link = $(this); + /** + * @var question String containing the question to be asked for confirmation + */ + var question = PMA_messages.strDropTableStrongWarning + ' '; + question += PMA_sprintf( + PMA_messages.strDoYouReally, + 'DROP VIEW `' + escapeHtml(PMA_commonParams.get('table') + '`') + ); + + $(this).PMA_confirm(question, $(this).attr('href'), function (url) { + var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + var params = getJSConfirmCommonParam(this, $link.getPostData()); + $.post(url, params, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxRemoveMessage($msgbox); + // Table deleted successfully, refresh both the frames + PMA_reloadNavigation(); + PMA_commonParams.set('table', ''); + PMA_commonActions.refreshMain( + PMA_commonParams.get('opendb_url'), + function () { + PMA_ajaxShowMessage(data.message); + } + ); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + }); // end $.PMA_confirm() + }); // end of Drop View Ajax action + + $(document).on('click', '#truncate_tbl_anchor.ajax', function (event) { + event.preventDefault(); + var $link = $(this); + /** + * @var question String containing the question to be asked for confirmation + */ + var question = PMA_messages.strTruncateTableStrongWarning + ' '; + question += PMA_sprintf( + PMA_messages.strDoYouReally, + 'TRUNCATE `' + escapeHtml(PMA_commonParams.get('db')) + '`.`' + escapeHtml(PMA_commonParams.get('table') + '`') + ) + getForeignKeyCheckboxLoader(); + $(this).PMA_confirm(question, $(this).attr('href'), function (url) { + PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + + var params = getJSConfirmCommonParam(this, $link.getPostData()); + + $.post(url, params, function (data) { + if ($('.sqlqueryresults').length !== 0) { + $('.sqlqueryresults').remove(); + } + if ($('.result_query').length !== 0) { + $('.result_query').remove(); + } + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxShowMessage(data.message); + $('
      ').prependTo('#page_content'); + $('.sqlqueryresults').html(data.sql_query); + PMA_highlightSQL($('#page_content')); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + }, loadForeignKeyCheckbox); // end $.PMA_confirm() + }); // end of Truncate Table Ajax action +}); // end $(document).ready for 'Table operations' diff --git a/phpMyAdmin/js/tbl_relation.js b/phpMyAdmin/js/tbl_relation.js new file mode 100755 index 0000000..d7e8785 --- /dev/null +++ b/phpMyAdmin/js/tbl_relation.js @@ -0,0 +1,245 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * for tbl_relation.php + * + */ +function show_hide_clauses ($thisDropdown) { + if ($thisDropdown.val() === '') { + $thisDropdown.parent().nextAll('span').hide(); + } else { + if ($thisDropdown.is('select[name^="destination_foreign_column"]')) { + $thisDropdown.parent().nextAll('span').show(); + } + } +} + +/** + * Sets dropdown options to values + */ +function setDropdownValues ($dropdown, values, selectedValue) { + $dropdown.empty(); + var optionsAsString = ''; + // add an empty string to the beginning for empty selection + values.unshift(''); + $.each(values, function () { + optionsAsString += ''; + }); + $dropdown.append($(optionsAsString)); +} + +/** + * Retrieves and populates dropdowns to the left based on the selected value + * + * @param $dropdown the dropdown whose value got changed + */ +function getDropdownValues ($dropdown) { + var foreignDb = null; + var foreignTable = null; + var $databaseDd; + var $tableDd; + var $columnDd; + var foreign = ''; + // if the changed dropdown is for foreign key constraints + if ($dropdown.is('select[name^="destination_foreign"]')) { + $databaseDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_db"]'); + $tableDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_table"]'); + $columnDd = $dropdown.parent().parent().parent().find('select[name^="destination_foreign_column"]'); + foreign = '_foreign'; + } else { // internal relations + $databaseDd = $dropdown.parent().find('select[name^="destination_db"]'); + $tableDd = $dropdown.parent().find('select[name^="destination_table"]'); + $columnDd = $dropdown.parent().find('select[name^="destination_column"]'); + } + + // if the changed dropdown is a database selector + if ($dropdown.is('select[name^="destination' + foreign + '_db"]')) { + foreignDb = $dropdown.val(); + // if no database is selected empty table and column dropdowns + if (foreignDb === '') { + setDropdownValues($tableDd, []); + setDropdownValues($columnDd, []); + return; + } + } else { // if a table selector + foreignDb = $databaseDd.val(); + foreignTable = $dropdown.val(); + // if no table is selected empty the column dropdown + if (foreignTable === '') { + setDropdownValues($columnDd, []); + return; + } + } + var $msgbox = PMA_ajaxShowMessage(); + var $form = $dropdown.parents('form'); + var $db = $form.find('input[name="db"]').val(); + var $table = $form.find('input[name="table"]').val(); + var argsep = PMA_commonParams.get('arg_separator'); + var params = 'getDropdownValues=true' + argsep + 'ajax_request=true' + + argsep + 'db=' + encodeURIComponent($db) + + argsep + 'table=' + encodeURIComponent($table) + + argsep + 'foreign=' + (foreign !== '') + + argsep + 'foreignDb=' + encodeURIComponent(foreignDb) + + (foreignTable !== null ? + argsep + 'foreignTable=' + encodeURIComponent(foreignTable) : '' + ); + var $server = $form.find('input[name="server"]'); + if ($server.length > 0) { + params += argsep + 'server=' + $form.find('input[name="server"]').val(); + } + $.ajax({ + type: 'POST', + url: 'tbl_relation.php', + data: params, + dataType: 'json', + success: function (data) { + PMA_ajaxRemoveMessage($msgbox); + if (typeof data !== 'undefined' && data.success) { + // if the changed dropdown is a database selector + if (foreignTable === null) { + // set values for table and column dropdowns + setDropdownValues($tableDd, data.tables); + setDropdownValues($columnDd, []); + } else { // if a table selector + // set values for the column dropdown + var primary = null; + if (typeof data.primary !== 'undefined' + && 1 === data.primary.length + ) { + primary = data.primary[0]; + } + setDropdownValues($columnDd.first(), data.columns, primary); + setDropdownValues($columnDd.slice(1), data.columns); + } + } else { + PMA_ajaxShowMessage(data.error, false); + } + } + }); +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_relation.js', function () { + $('body').off('change', + 'select[name^="destination_db"], ' + + 'select[name^="destination_table"], ' + + 'select[name^="destination_foreign_db"], ' + + 'select[name^="destination_foreign_table"]' + ); + $('body').off('click', 'a.add_foreign_key_field'); + $('body').off('click', 'a.add_foreign_key'); + $('a.drop_foreign_key_anchor.ajax').off('click'); +}); + +AJAX.registerOnload('tbl_relation.js', function () { + /** + * Ajax event handler to fetch table/column dropdown values. + */ + $('body').on('change', + 'select[name^="destination_db"], ' + + 'select[name^="destination_table"], ' + + 'select[name^="destination_foreign_db"], ' + + 'select[name^="destination_foreign_table"]', + function () { + getDropdownValues($(this)); + } + ); + + /** + * Ajax event handler to add a column to a foreign key constraint. + */ + $('body').on('click', 'a.add_foreign_key_field', function (event) { + event.preventDefault(); + event.stopPropagation(); + + // Add field. + $(this) + .prev('span') + .clone(true, true) + .insertBefore($(this)) + .find('select') + .val(''); + + // Add foreign field. + var $source_elem = $('select[name^="destination_foreign_column[' + + $(this).attr('data-index') + ']"]:last').parent(); + $source_elem + .clone(true, true) + .insertAfter($source_elem) + .find('select') + .val(''); + }); + + /** + * Ajax event handler to add a foreign key constraint. + */ + $('body').on('click', 'a.add_foreign_key', function (event) { + event.preventDefault(); + event.stopPropagation(); + + var $prev_row = $(this).closest('tr').prev('tr'); + var $newRow = $prev_row.clone(true, true); + + // Update serial number. + var curr_index = $newRow + .find('a.add_foreign_key_field') + .attr('data-index'); + var new_index = parseInt(curr_index) + 1; + $newRow.find('a.add_foreign_key_field').attr('data-index', new_index); + + // Update form parameter names. + $newRow.find('select[name^="foreign_key_fields_name"]:not(:first), ' + + 'select[name^="destination_foreign_column"]:not(:first)' + ).each(function () { + $(this).parent().remove(); + }); + $newRow.find('input, select').each(function () { + $(this).attr('name', + $(this).attr('name').replace(/\d/, new_index) + ); + }); + $newRow.find('input[type="text"]').each(function () { + $(this).val(''); + }); + // Finally add the row. + $newRow.insertAfter($prev_row); + }); + + /** + * Ajax Event handler for 'Drop Foreign key' + */ + $('a.drop_foreign_key_anchor.ajax').on('click', function (event) { + event.preventDefault(); + var $anchor = $(this); + + // Object containing reference to the current field's row + var $curr_row = $anchor.parents('tr'); + + var drop_query = escapeHtml( + $curr_row.children('td') + .children('.drop_foreign_key_msg') + .val() + ); + + var question = PMA_sprintf(PMA_messages.strDoYouReally, drop_query); + + $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) { + var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingForeignKey, false); + var params = getJSConfirmCommonParam(this, $anchor.getPostData()); + $.post(url, params, function (data) { + if (data.success === true) { + PMA_ajaxRemoveMessage($msg); + PMA_commonActions.refreshMain(false, function () { + // Do nothing + }); + } else { + PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest + ' : ' + data.error, false); + } + }); // end $.post() + }); // end $.PMA_confirm() + }); // end Drop Foreign key + + var windowwidth = $(window).width(); + $('.jsresponsive').css('max-width', (windowwidth - 35) + 'px'); +}); diff --git a/phpMyAdmin/js/tbl_select.js b/phpMyAdmin/js/tbl_select.js new file mode 100755 index 0000000..1e44db6 --- /dev/null +++ b/phpMyAdmin/js/tbl_select.js @@ -0,0 +1,413 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview JavaScript functions used on tbl_select.php + * + * @requires jQuery + * @requires js/functions.js + */ + +/** + * Ajax event handlers for this page + * + * Actions ajaxified here: + * Table search + */ + +/** + * Checks if given data-type is numeric or date. + * + * @param string data_type Column data-type + * + * @return bool|string + */ +function PMA_checkIfDataTypeNumericOrDate (data_type) { + // To test for numeric data-types. + var numeric_re = new RegExp( + 'TINYINT|SMALLINT|MEDIUMINT|INT|BIGINT|DECIMAL|FLOAT|DOUBLE|REAL', + 'i' + ); + + // To test for date data-types. + var date_re = new RegExp( + 'DATETIME|DATE|TIMESTAMP|TIME|YEAR', + 'i' + ); + + // Return matched data-type + if (numeric_re.test(data_type)) { + return numeric_re.exec(data_type)[0]; + } + + if (date_re.test(data_type)) { + return date_re.exec(data_type)[0]; + } + + return false; +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_select.js', function () { + $('#togglesearchformlink').off('click'); + $(document).off('submit', '#tbl_search_form.ajax'); + $('select.geom_func').off('change'); + $(document).off('click', 'span.open_search_gis_editor'); + $('body').off('change', 'select[name*="criteriaColumnOperators"]'); // Fix for bug #13778, changed 'click' to 'change' +}); + +AJAX.registerOnload('tbl_select.js', function () { + /** + * Prepare a div containing a link, otherwise it's incorrectly displayed + * after a couple of clicks + */ + $('
      ') + .insertAfter('#tbl_search_form') + // don't show it until we have results on-screen + .hide(); + + $('#togglesearchformlink') + .html(PMA_messages.strShowSearchCriteria) + .on('click', function () { + var $link = $(this); + $('#tbl_search_form').slideToggle(); + if ($link.text() === PMA_messages.strHideSearchCriteria) { + $link.text(PMA_messages.strShowSearchCriteria); + } else { + $link.text(PMA_messages.strHideSearchCriteria); + } + // avoid default click action + return false; + }); + + var tableRows = $('#fieldset_table_qbe select'); + $.each(tableRows, function (index, item) { + $(item).on('change', function () { + changeValueFieldType(this, index); + }); + }); + + /** + * Ajax event handler for Table search + */ + $(document).on('submit', '#tbl_search_form.ajax', function (event) { + var unaryFunctions = [ + 'IS NULL', + 'IS NOT NULL', + '= \'\'', + '!= \'\'' + ]; + + var geomUnaryFunctions = [ + 'IsEmpty', + 'IsSimple', + 'IsRing', + 'IsClosed', + ]; + + // jQuery object to reuse + var $search_form = $(this); + event.preventDefault(); + + // empty previous search results while we are waiting for new results + $('#sqlqueryresultsouter').empty(); + var $msgbox = PMA_ajaxShowMessage(PMA_messages.strSearching, false); + + PMA_prepareForAjaxRequest($search_form); + + var values = {}; + $search_form.find(':input').each(function () { + var $input = $(this); + if ($input.attr('type') === 'checkbox' || $input.attr('type') === 'radio') { + if ($input.is(':checked')) { + values[this.name] = $input.val(); + } + } else { + values[this.name] = $input.val(); + } + }); + var columnCount = $('select[name="columnsToDisplay[]"] option').length; + // Submit values only for the columns that have unary column operator or a search criteria + for (var a = 0; a < columnCount; a++) { + if ($.inArray(values['criteriaColumnOperators[' + a + ']'], unaryFunctions) >= 0) { + continue; + } + + if (values['geom_func[' + a + ']'] && + $.isArray(values['geom_func[' + a + ']'], geomUnaryFunctions) >= 0) { + continue; + } + + if (values['criteriaValues[' + a + ']'] === '' || values['criteriaValues[' + a + ']'] === null) { + delete values['criteriaValues[' + a + ']']; + delete values['criteriaColumnOperators[' + a + ']']; + delete values['criteriaColumnNames[' + a + ']']; + delete values['criteriaColumnTypes[' + a + ']']; + delete values['criteriaColumnCollations[' + a + ']']; + } + } + // If all columns are selected, use a single parameter to indicate that + if (values['columnsToDisplay[]'] !== null) { + if (values['columnsToDisplay[]'].length === columnCount) { + delete values['columnsToDisplay[]']; + values.displayAllColumns = true; + } + } else { + values.displayAllColumns = true; + } + + $.post($search_form.attr('action'), values, function (data) { + PMA_ajaxRemoveMessage($msgbox); + if (typeof data !== 'undefined' && data.success === true) { + if (typeof data.sql_query !== 'undefined') { // zero rows + $('#sqlqueryresultsouter').html(data.sql_query); + } else { // results found + $('#sqlqueryresultsouter').html(data.message); + $('.sqlqueryresults').trigger('makegrid').trigger('stickycolumns'); + } + $('#tbl_search_form') + // workaround for bug #3168569 - Issue on toggling the "Hide search criteria" in chrome. + .slideToggle() + .hide(); + $('#togglesearchformlink') + // always start with the Show message + .text(PMA_messages.strShowSearchCriteria); + $('#togglesearchformdiv') + // now it's time to show the div containing the link + .show(); + // needed for the display options slider in the results + PMA_init_slider(); + $('html, body').animate({ scrollTop: 0 }, 'fast'); + } else { + $('#sqlqueryresultsouter').html(data.error); + } + PMA_highlightSQL($('#sqlqueryresultsouter')); + }); // end $.post() + }); + + // Following section is related to the 'function based search' for geometry data types. + // Initialy hide all the open_gis_editor spans + $('span.open_search_gis_editor').hide(); + + $('select.geom_func').bind('change', function () { + var $geomFuncSelector = $(this); + + var binaryFunctions = [ + 'Contains', + 'Crosses', + 'Disjoint', + 'Equals', + 'Intersects', + 'Overlaps', + 'Touches', + 'Within', + 'MBRContains', + 'MBRDisjoint', + 'MBREquals', + 'MBRIntersects', + 'MBROverlaps', + 'MBRTouches', + 'MBRWithin', + 'ST_Contains', + 'ST_Crosses', + 'ST_Disjoint', + 'ST_Equals', + 'ST_Intersects', + 'ST_Overlaps', + 'ST_Touches', + 'ST_Within' + ]; + + var tempArray = [ + 'Envelope', + 'EndPoint', + 'StartPoint', + 'ExteriorRing', + 'Centroid', + 'PointOnSurface' + ]; + var outputGeomFunctions = binaryFunctions.concat(tempArray); + + // If the chosen function takes two geometry objects as parameters + var $operator = $geomFuncSelector.parents('tr').find('td:nth-child(5)').find('select'); + if ($.inArray($geomFuncSelector.val(), binaryFunctions) >= 0) { + $operator.prop('readonly', true); + } else { + $operator.prop('readonly', false); + } + + // if the chosen function's output is a geometry, enable GIS editor + var $editorSpan = $geomFuncSelector.parents('tr').find('span.open_search_gis_editor'); + if ($.inArray($geomFuncSelector.val(), outputGeomFunctions) >= 0) { + $editorSpan.show(); + } else { + $editorSpan.hide(); + } + }); + + $(document).on('click', 'span.open_search_gis_editor', function (event) { + event.preventDefault(); + + var $span = $(this); + // Current value + var value = $span.parent('td').children('input[type=\'text\']').val(); + // Field name + var field = 'Parameter'; + // Column type + var geom_func = $span.parents('tr').find('.geom_func').val(); + var type; + if (geom_func === 'Envelope') { + type = 'polygon'; + } else if (geom_func === 'ExteriorRing') { + type = 'linestring'; + } else { + type = 'point'; + } + // Names of input field and null checkbox + var input_name = $span.parent('td').children('input[type=\'text\']').attr('name'); + // Token + + openGISEditor(); + if (!gisEditorLoaded) { + loadJSAndGISEditor(value, field, type, input_name); + } else { + loadGISEditor(value, field, type, input_name); + } + }); + + /** + * Ajax event handler for Range-Search. + */ + $('body').on('change', 'select[name*="criteriaColumnOperators"]', function () { // Fix for bug #13778, changed 'click' to 'change' + $source_select = $(this); + // Get the column name. + var column_name = $(this) + .closest('tr') + .find('th:first') + .text(); + + // Get the data-type of column excluding size. + var data_type = $(this) + .closest('tr') + .find('td[data-type]') + .attr('data-type'); + data_type = PMA_checkIfDataTypeNumericOrDate(data_type); + + // Get the operator. + var operator = $(this).val(); + + if ((operator === 'BETWEEN' || operator === 'NOT BETWEEN') + && data_type + ) { + var $msgbox = PMA_ajaxShowMessage(); + $.ajax({ + url: 'tbl_select.php', + type: 'POST', + data: { + server: PMA_commonParams.get('server'), + ajax_request: 1, + db: $('input[name="db"]').val(), + table: $('input[name="table"]').val(), + column: column_name, + range_search: 1 + }, + success: function (response) { + PMA_ajaxRemoveMessage($msgbox); + if (response.success) { + // Get the column min value. + var min = response.column_data.min + ? '(' + PMA_messages.strColumnMin + + ' ' + response.column_data.min + ')' + : ''; + // Get the column max value. + var max = response.column_data.max + ? '(' + PMA_messages.strColumnMax + + ' ' + response.column_data.max + ')' + : ''; + var button_options = {}; + button_options[PMA_messages.strGo] = function () { + var min_value = $('#min_value').val(); + var max_value = $('#max_value').val(); + var final_value = ''; + if (min_value.length && max_value.length) { + final_value = min_value + ', ' + + max_value; + } + var $target_field = $source_select.closest('tr') + .find('[name*="criteriaValues"]'); + + // If target field is a select list. + if ($target_field.is('select')) { + $target_field.val(final_value); + var $options = $target_field.find('option'); + var $closest_min = null; + var $closest_max = null; + // Find closest min and max value. + $options.each(function () { + if ( + $closest_min === null + || Math.abs($(this).val() - min_value) < Math.abs($closest_min.val() - min_value) + ) { + $closest_min = $(this); + } + + if ( + $closest_max === null + || Math.abs($(this).val() - max_value) < Math.abs($closest_max.val() - max_value) + ) { + $closest_max = $(this); + } + }); + + $closest_min.attr('selected', 'selected'); + $closest_max.attr('selected', 'selected'); + } else { + $target_field.val(final_value); + } + $(this).dialog('close'); + }; + button_options[PMA_messages.strCancel] = function () { + $(this).dialog('close'); + }; + + // Display dialog box. + $('
      ').append( + '
      ' + + '' + operator + '' + + '' + + '' + '
      ' + + '' + min + '' + '
      ' + + '' + + '' + '
      ' + + '' + max + '' + + '
      ' + ).dialog({ + minWidth: 500, + maxHeight: 400, + modal: true, + buttons: button_options, + title: PMA_messages.strRangeSearch, + open: function () { + // Add datepicker wherever required. + PMA_addDatepicker($('#min_value'), data_type); + PMA_addDatepicker($('#max_value'), data_type); + }, + close: function () { + $(this).remove(); + } + }); + } else { + PMA_ajaxShowMessage(response.error); + } + }, + error: function (response) { + PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest); + } + }); + } + }); + var windowwidth = $(window).width(); + $('.jsresponsive').css('max-width', (windowwidth - 69) + 'px'); +}); diff --git a/phpMyAdmin/js/tbl_structure.js b/phpMyAdmin/js/tbl_structure.js new file mode 100755 index 0000000..3f59c24 --- /dev/null +++ b/phpMyAdmin/js/tbl_structure.js @@ -0,0 +1,500 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview functions used on the table structure page + * @name Table Structure + * + * @requires jQuery + * @requires jQueryUI + * @required js/functions.js + */ + +/** + * AJAX scripts for tbl_structure.php + * + * Actions ajaxified here: + * Drop Column + * Add Primary Key + * Drop Primary Key/Index + * + */ + +/** + * Reload fields table + */ +function reloadFieldForm () { + $.post($('#fieldsForm').attr('action'), $('#fieldsForm').serialize() + PMA_commonParams.get('arg_separator') + 'ajax_request=true', function (form_data) { + var $temp_div = $('
      ').append(form_data.message); + $('#fieldsForm').replaceWith($temp_div.find('#fieldsForm')); + $('#addColumns').replaceWith($temp_div.find('#addColumns')); + $('#move_columns_dialog').find('ul').replaceWith($temp_div.find('#move_columns_dialog ul')); + $('#moveColumns').removeClass('move-active'); + }); + $('#page_content').show(); +} + +function checkFirst () { + if ($('select[name=after_field] option:selected').data('pos') === 'first') { + $('input[name=field_where]').val('first'); + } else { + $('input[name=field_where]').val('after'); + } +} +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_structure.js', function () { + $(document).off('click', 'a.drop_column_anchor.ajax'); + $(document).off('click', 'a.add_key.ajax'); + $(document).off('click', '#move_columns_anchor'); + $(document).off('click', '#printView'); + $(document).off('submit', '.append_fields_form.ajax'); + $('body').off('click', '#fieldsForm.ajax button[name="submit_mult"], #fieldsForm.ajax input[name="submit_mult"]'); + $(document).off('click', 'a[name^=partition_action].ajax'); + $(document).off('click', '#remove_partitioning.ajax'); +}); + +AJAX.registerOnload('tbl_structure.js', function () { + // Re-initialize variables. + primary_indexes = []; + indexes = []; + fulltext_indexes = []; + spatial_indexes = []; + + /** + *Ajax action for submitting the "Column Change" and "Add Column" form + */ + $('.append_fields_form.ajax').off(); + $(document).on('submit', '.append_fields_form.ajax', function (event) { + event.preventDefault(); + /** + * @var the_form object referring to the export form + */ + var $form = $(this); + var field_cnt = $form.find('input[name=orig_num_fields]').val(); + + + function submitForm () { + $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest); + $.post($form.attr('action'), $form.serialize() + PMA_commonParams.get('arg_separator') + 'do_save_data=1', function (data) { + if ($('.sqlqueryresults').length !== 0) { + $('.sqlqueryresults').remove(); + } else if ($('.error:not(.tab)').length !== 0) { + $('.error:not(.tab)').remove(); + } + if (typeof data.success !== 'undefined' && data.success === true) { + $('#page_content') + .empty() + .append(data.message) + .show(); + PMA_highlightSQL($('#page_content')); + $('.result_query .notice').remove(); + reloadFieldForm(); + $form.remove(); + PMA_ajaxRemoveMessage($msg); + PMA_init_slider(); + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // end $.post() + } + + function checkIfConfirmRequired ($form, $field_cnt) { + var i = 0; + var id; + var elm; + var val; + var name_orig; + var elm_orig; + var val_orig; + var checkRequired = false; + for (i = 0; i < field_cnt; i++) { + id = '#field_' + i + '_5'; + elm = $(id); + val = elm.val(); + + name_orig = 'input[name=field_collation_orig\\[' + i + '\\]]'; + elm_orig = $form.find(name_orig); + val_orig = elm_orig.val(); + + if (val && val_orig && val !== val_orig) { + checkRequired = true; + break; + } + } + return checkRequired; + } + + /* + * First validate the form; if there is a problem, avoid submitting it + * + * checkTableEditForm() needs a pure element and not a jQuery object, + * this is why we pass $form[0] as a parameter (the jQuery object + * is actually an array of DOM elements) + */ + if (checkTableEditForm($form[0], field_cnt)) { + // OK, form passed validation step + + PMA_prepareForAjaxRequest($form); + if (PMA_checkReservedWordColumns($form)) { + // User wants to submit the form + + // If Collation is changed, Warn and Confirm + if (checkIfConfirmRequired($form, field_cnt)) { + var question = sprintf( + PMA_messages.strChangeColumnCollation, 'https://wiki.phpmyadmin.net/pma/Garbled_data' + ); + $form.PMA_confirm(question, $form.attr('action'), function (url) { + submitForm(); + }); + } else { + submitForm(); + } + } + } + }); // end change table button "do_save_data" + + /** + * Attach Event Handler for 'Drop Column' + */ + $(document).on('click', 'a.drop_column_anchor.ajax', function (event) { + event.preventDefault(); + /** + * @var curr_table_name String containing the name of the current table + */ + var curr_table_name = $(this).closest('form').find('input[name=table]').val(); + /** + * @var curr_row Object reference to the currently selected row (i.e. field in the table) + */ + var $curr_row = $(this).parents('tr'); + /** + * @var curr_column_name String containing name of the field referred to by {@link curr_row} + */ + var curr_column_name = $curr_row.children('th').children('label').text().trim(); + curr_column_name = escapeHtml(curr_column_name); + /** + * @var $after_field_item Corresponding entry in the 'After' field. + */ + var $after_field_item = $('select[name=\'after_field\'] option[value=\'' + curr_column_name + '\']'); + /** + * @var question String containing the question to be asked for confirmation + */ + var question = PMA_sprintf(PMA_messages.strDoYouReally, 'ALTER TABLE `' + escapeHtml(curr_table_name) + '` DROP `' + escapeHtml(curr_column_name) + '`;'); + var $this_anchor = $(this); + $this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function (url) { + var $msg = PMA_ajaxShowMessage(PMA_messages.strDroppingColumn, false); + var params = getJSConfirmCommonParam(this, $this_anchor.getPostData()); + params += PMA_commonParams.get('arg_separator') + 'ajax_page_request=1'; + $.post(url, params, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + PMA_ajaxRemoveMessage($msg); + if ($('.result_query').length) { + $('.result_query').remove(); + } + if (data.sql_query) { + $('
      ') + .html(data.sql_query) + .prependTo('#structure_content'); + PMA_highlightSQL($('#page_content')); + } + // Adjust the row numbers + for (var $row = $curr_row.next(); $row.length > 0; $row = $row.next()) { + var new_val = parseInt($row.find('td:nth-child(2)').text(), 10) - 1; + $row.find('td:nth-child(2)').text(new_val); + } + $after_field_item.remove(); + $curr_row.hide('medium').remove(); + + // Remove the dropped column from select menu for 'after field' + $('select[name=after_field]').find( + '[value="' + curr_column_name + '"]' + ).remove(); + + // by default select the (new) last option to add new column + // (in case last column is dropped) + $('select[name=after_field] option:last').attr('selected','selected'); + + // refresh table stats + if (data.tableStat) { + $('#tablestatistics').html(data.tableStat); + } + // refresh the list of indexes (comes from sql.php) + $('.index_info').replaceWith(data.indexes_list); + PMA_reloadNavigation(); + } else { + PMA_ajaxShowMessage(PMA_messages.strErrorProcessingRequest + ' : ' + data.error, false); + } + }); // end $.post() + }); // end $.PMA_confirm() + }); // end of Drop Column Anchor action + + /** + * Attach Event Handler for 'Print' link + */ + $(document).on('click', '#printView', function (event) { + event.preventDefault(); + + // Take to preview mode + printPreview(); + }); // end of Print View action + + /** + * Ajax Event handler for adding keys + */ + $(document).on('click', 'a.add_key.ajax', function (event) { + event.preventDefault(); + + var $this = $(this); + var curr_table_name = $this.closest('form').find('input[name=table]').val(); + var curr_column_name = $this.parents('tr').children('th').children('label').text().trim(); + + var add_clause = ''; + if ($this.is('.add_primary_key_anchor')) { + add_clause = 'ADD PRIMARY KEY'; + } else if ($this.is('.add_index_anchor')) { + add_clause = 'ADD INDEX'; + } else if ($this.is('.add_unique_anchor')) { + add_clause = 'ADD UNIQUE'; + } else if ($this.is('.add_spatial_anchor')) { + add_clause = 'ADD SPATIAL'; + } else if ($this.is('.add_fulltext_anchor')) { + add_clause = 'ADD FULLTEXT'; + } + var question = PMA_sprintf(PMA_messages.strDoYouReally, 'ALTER TABLE `' + + escapeHtml(curr_table_name) + '` ' + add_clause + '(`' + escapeHtml(curr_column_name) + '`);'); + + var $this_anchor = $(this); + + $this_anchor.PMA_confirm(question, $this_anchor.attr('href'), function (url) { + PMA_ajaxShowMessage(); + AJAX.source = $this; + + var params = getJSConfirmCommonParam(this, $this_anchor.getPostData()); + params += PMA_commonParams.get('arg_separator') + 'ajax_page_request=1'; + $.post(url, params, AJAX.responseHandler); + }); // end $.PMA_confirm() + }); // end Add key + + /** + * Inline move columns + **/ + $(document).on('click', '#move_columns_anchor', function (e) { + e.preventDefault(); + + if ($(this).hasClass('move-active')) { + return; + } + + /** + * @var button_options Object that stores the options passed to jQueryUI + * dialog + */ + var button_options = {}; + + button_options[PMA_messages.strGo] = function (event) { + event.preventDefault(); + var $msgbox = PMA_ajaxShowMessage(); + var $this = $(this); + var $form = $this.find('form'); + var serialized = $form.serialize(); + + // check if any columns were moved at all + if (serialized === $form.data('serialized-unmoved')) { + PMA_ajaxRemoveMessage($msgbox); + $this.dialog('close'); + return; + } + + $.post($form.prop('action'), serialized + PMA_commonParams.get('arg_separator') + 'ajax_request=true', function (data) { + if (data.success === false) { + PMA_ajaxRemoveMessage($msgbox); + $this + .clone() + .html(data.error) + .dialog({ + title: $(this).prop('title'), + height: 230, + width: 900, + modal: true, + buttons: button_options_error + }); // end dialog options + } else { + // sort the fields table + var $fields_table = $('table#tablestructure tbody'); + // remove all existing rows and remember them + var $rows = $fields_table.find('tr').remove(); + // loop through the correct order + for (var i in data.columns) { + var the_column = data.columns[i]; + var $the_row = $rows + .find('input:checkbox[value=\'' + the_column + '\']') + .closest('tr'); + // append the row for this column to the table + $fields_table.append($the_row); + } + var $firstrow = $fields_table.find('tr').eq(0); + // Adjust the row numbers and colors + for (var $row = $firstrow; $row.length > 0; $row = $row.next()) { + $row + .find('td:nth-child(2)') + .text($row.index() + 1) + .end() + .removeClass('odd even') + .addClass($row.index() % 2 === 0 ? 'odd' : 'even'); + } + PMA_ajaxShowMessage(data.message); + $this.dialog('close'); + } + }); + }; + button_options[PMA_messages.strCancel] = function () { + $(this).dialog('close'); + }; + + var button_options_error = {}; + button_options_error[PMA_messages.strOK] = function () { + $(this).dialog('close').remove(); + }; + + var columns = []; + + $('#tablestructure').find('tbody tr').each(function () { + var col_name = $(this).find('input:checkbox').eq(0).val(); + var hidden_input = $('') + .prop({ + name: 'move_columns[]', + type: 'hidden' + }) + .val(col_name); + columns[columns.length] = $('
    • ') + .addClass('placeholderDrag') + .text(col_name) + .append(hidden_input); + }); + + var col_list = $('#move_columns_dialog').find('ul') + .find('li').remove().end(); + for (var i in columns) { + col_list.append(columns[i]); + } + col_list.sortable({ + axis: 'y', + containment: $('#move_columns_dialog').find('div'), + tolerance: 'pointer' + }).disableSelection(); + var $form = $('#move_columns_dialog').find('form'); + $form.data('serialized-unmoved', $form.serialize()); + + $('#move_columns_dialog').dialog({ + modal: true, + buttons: button_options, + open: function () { + if ($('#move_columns_dialog').parents('.ui-dialog').height() > $(window).height()) { + $('#move_columns_dialog').dialog('option', 'height', $(window).height()); + } + }, + beforeClose: function () { + $('#move_columns_anchor').removeClass('move-active'); + } + }); + }); + + /** + * Handles multi submits in table structure page such as change, browse, drop, primary etc. + */ + $('body').on('click', '#fieldsForm.ajax button[name="submit_mult"], #fieldsForm.ajax input[name="submit_mult"]', function (e) { + e.preventDefault(); + var $button = $(this); + var $form = $button.parents('form'); + var argsep = PMA_commonParams.get('arg_separator'); + var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val(); + PMA_ajaxShowMessage(); + AJAX.source = $form; + $.post($form.attr('action'), submitData, AJAX.responseHandler); + }); + + /** + * Handles clicks on Action links in partition table + */ + $(document).on('click', 'a[name^=partition_action].ajax', function (e) { + e.preventDefault(); + var $link = $(this); + + function submitPartitionAction (url) { + var params = 'ajax_request=true&ajax_page_request=true&' + $link.getPostData(); + PMA_ajaxShowMessage(); + AJAX.source = $link; + $.post(url, params, AJAX.responseHandler); + } + + if ($link.is('#partition_action_DROP')) { + var question = PMA_messages.strDropPartitionWarning; + $link.PMA_confirm(question, $link.attr('href'), function (url) { + submitPartitionAction(url); + }); + } else if ($link.is('#partition_action_TRUNCATE')) { + var question = PMA_messages.strTruncatePartitionWarning; + $link.PMA_confirm(question, $link.attr('href'), function (url) { + submitPartitionAction(url); + }); + } else { + submitPartitionAction($link.attr('href')); + } + }); + + /** + * Handles remove partitioning + */ + $(document).on('click', '#remove_partitioning.ajax', function (e) { + e.preventDefault(); + var $link = $(this); + var question = PMA_messages.strRemovePartitioningWarning; + $link.PMA_confirm(question, $link.attr('href'), function (url) { + var params = getJSConfirmCommonParam({ + 'ajax_request' : true, + 'ajax_page_request' : true + }, $link.getPostData()); + PMA_ajaxShowMessage(); + AJAX.source = $link; + $.post(url, params, AJAX.responseHandler); + }); + }); + + $(document).on('change', 'select[name=after_field]', function () { + checkFirst(); + }); +}); + +/** Handler for "More" dropdown in structure table rows */ +AJAX.registerOnload('tbl_structure.js', function () { + var windowwidth = $(window).width(); + if (windowwidth > 768) { + if (! $('#fieldsForm').hasClass('HideStructureActions')) { + $('.table-structure-actions').width(function () { + var width = 5; + $(this).find('li').each(function () { + width += $(this).outerWidth(true); + }); + return width; + }); + } + } + + $('.jsresponsive').css('max-width', (windowwidth - 35) + 'px'); + var tableRows = $('.central_columns'); + $.each(tableRows, function (index, item) { + if ($(item).hasClass('add_button')) { + $(item).click(function () { + $('input:checkbox').prop('checked', false); + $('#checkbox_row_' + (index + 1)).prop('checked', true); + $('button[value=add_to_central_columns]').click(); + }); + } else { + $(item).click(function () { + $('input:checkbox').prop('checked', false); + $('#checkbox_row_' + (index + 1)).prop('checked', true); + $('button[value=remove_from_central_columns]').click(); + }); + } + }); +}); diff --git a/phpMyAdmin/js/tbl_tracking.js b/phpMyAdmin/js/tbl_tracking.js new file mode 100755 index 0000000..cd08957 --- /dev/null +++ b/phpMyAdmin/js/tbl_tracking.js @@ -0,0 +1,106 @@ +/** + * Unbind all event handlers before tearing down the page + */ +AJAX.registerTeardown('tbl_tracking.js', function () { + $('body').off('click', '#versionsForm.ajax button[name="submit_mult"], #versionsForm.ajax input[name="submit_mult"]'); + $('body').off('click', 'a.delete_version_anchor.ajax'); + $('body').off('click', 'a.delete_entry_anchor.ajax'); +}); + +/** + * Bind event handlers + */ +AJAX.registerOnload('tbl_tracking.js', function () { + $('#versions tr:first th').append($('
      ')); + $('#versions').tablesorter({ + sortList: [[1, 0]], + headers: { + 0: { sorter: false }, + 1: { sorter: 'integer' }, + 5: { sorter: false }, + 6: { sorter: false } + } + }); + + if ($('#ddl_versions tbody tr').length > 0) { + $('#ddl_versions tr:first th').append($('
      ')); + $('#ddl_versions').tablesorter({ + sortList: [[0, 0]], + headers: { + 0: { sorter: 'integer' }, + 3: { sorter: false }, + 4: { sorter: false } + } + }); + } + + if ($('#dml_versions tbody tr').length > 0) { + $('#dml_versions tr:first th').append($('
      ')); + $('#dml_versions').tablesorter({ + sortList: [[0, 0]], + headers: { + 0: { sorter: 'integer' }, + 3: { sorter: false }, + 4: { sorter: false } + } + }); + } + + /** + * Handles multi submit for tracking versions + */ + $('body').on('click', '#versionsForm.ajax button[name="submit_mult"], #versionsForm.ajax input[name="submit_mult"]', function (e) { + e.preventDefault(); + var $button = $(this); + var $form = $button.parent('form'); + var argsep = PMA_commonParams.get('arg_separator'); + var submitData = $form.serialize() + argsep + 'ajax_request=true' + argsep + 'ajax_page_request=true' + argsep + 'submit_mult=' + $button.val(); + + if ($button.val() === 'delete_version') { + var question = PMA_messages.strDeleteTrackingVersionMultiple; + $button.PMA_confirm(question, $form.attr('action'), function (url) { + PMA_ajaxShowMessage(); + AJAX.source = $form; + $.post(url, submitData, AJAX.responseHandler); + }); + } else { + PMA_ajaxShowMessage(); + AJAX.source = $form; + $.post($form.attr('action'), submitData, AJAX.responseHandler); + } + }); + + /** + * Ajax Event handler for 'Delete version' + */ + $('body').on('click', 'a.delete_version_anchor.ajax', function (e) { + e.preventDefault(); + var $anchor = $(this); + var question = PMA_messages.strDeleteTrackingVersion; + $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) { + PMA_ajaxShowMessage(); + AJAX.source = $anchor; + var argSep = PMA_commonParams.get('arg_separator'); + var params = getJSConfirmCommonParam(this, $anchor.getPostData()); + params += argSep + 'ajax_page_request=1'; + $.post(url, params, AJAX.responseHandler); + }); + }); + + /** + * Ajax Event handler for 'Delete tracking report entry' + */ + $('body').on('click', 'a.delete_entry_anchor.ajax', function (e) { + e.preventDefault(); + var $anchor = $(this); + var question = PMA_messages.strDeletingTrackingEntry; + $anchor.PMA_confirm(question, $anchor.attr('href'), function (url) { + PMA_ajaxShowMessage(); + AJAX.source = $anchor; + var argSep = PMA_commonParams.get('arg_separator'); + var params = getJSConfirmCommonParam(this, $anchor.getPostData()); + params += argSep + 'ajax_page_request=1'; + $.post(url, params, AJAX.responseHandler); + }); + }); +}); diff --git a/phpMyAdmin/js/tbl_zoom_plot_jqplot.js b/phpMyAdmin/js/tbl_zoom_plot_jqplot.js new file mode 100755 index 0000000..469c482 --- /dev/null +++ b/phpMyAdmin/js/tbl_zoom_plot_jqplot.js @@ -0,0 +1,630 @@ +// TODO: change the axis +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + ** @fileoverview JavaScript functions used on tbl_select.php + ** + ** @requires jQuery + ** @requires js/functions.js + **/ + + +/** + ** Display Help/Info + **/ +function displayHelp () { + $('
      ') + .append(PMA_messages.strDisplayHelp) + .appendTo('#page_content') + .dialog({ + width: 450, + height: 'auto', + title: PMA_messages.strHelpTitle + }); + return false; +} + +/** + ** Extend the array object for max function + ** @param array + **/ +Array.max = function (array) { + return Math.max.apply(Math, array); +}; + +/** + ** Extend the array object for min function + ** @param array + **/ +Array.min = function (array) { + return Math.min.apply(Math, array); +}; + +/** + ** Checks if a string contains only numeric value + ** @param n: String (to be checked) + **/ +function isNumeric (n) { + return !isNaN(parseFloat(n)) && isFinite(n); +} + +/** + ** Checks if an object is empty + ** @param n: Object (to be checked) + **/ +function isEmpty (obj) { + var name; + for (name in obj) { + return false; + } + return true; +} + +/** + ** Converts a date/time into timestamp + ** @param val String Date + ** @param type Sring Field type(datetime/timestamp/time/date) + **/ +function getTimeStamp (val, type) { + if (type.toString().search(/datetime/i) !== -1 || + type.toString().search(/timestamp/i) !== -1 + ) { + return $.datepicker.parseDateTime('yy-mm-dd', 'HH:mm:ss', val); + } else if (type.toString().search(/time/i) !== -1) { + return $.datepicker.parseDateTime('yy-mm-dd', 'HH:mm:ss', '1970-01-01 ' + val); + } else if (type.toString().search(/date/i) !== -1) { + return $.datepicker.parseDate('yy-mm-dd', val); + } +} + +/** + ** Classifies the field type into numeric,timeseries or text + ** @param field: field type (as in database structure) + **/ +function getType (field) { + if (field.toString().search(/int/i) !== -1 || + field.toString().search(/decimal/i) !== -1 || + field.toString().search(/year/i) !== -1 + ) { + return 'numeric'; + } else if (field.toString().search(/time/i) !== -1 || + field.toString().search(/date/i) !== -1 + ) { + return 'time'; + } else { + return 'text'; + } +} + +/** + ** Scrolls the view to the display section + **/ +function scrollToChart () { + var x = $('#dataDisplay').offset().top - 100; // 100 provides buffer in viewport + $('html,body').animate({ scrollTop: x }, 500); +} + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('tbl_zoom_plot_jqplot.js', function () { + $('#tableid_0').off('change'); + $('#tableid_1').off('change'); + $('#tableid_2').off('change'); + $('#tableid_3').off('change'); + $('#inputFormSubmitId').off('click'); + $('#togglesearchformlink').off('click'); + $(document).off('keydown', '#dataDisplay :input'); + $('button.button-reset').off('click'); + $('div#resizer').off('resizestop'); + $('div#querychart').off('jqplotDataClick'); +}); + +AJAX.registerOnload('tbl_zoom_plot_jqplot.js', function () { + var cursorMode = ($('input[name=\'mode\']:checked').val() === 'edit') ? 'crosshair' : 'pointer'; + var currentChart = null; + var searchedDataKey = null; + var xLabel = $('#tableid_0').val(); + var yLabel = $('#tableid_1').val(); + // will be updated via Ajax + var xType = $('#types_0').val(); + var yType = $('#types_1').val(); + var dataLabel = $('#dataLabel').val(); + var lastX; + var lastY; + var zoomRatio = 1; + + + // Get query result + var searchedData; + try { + searchedData = JSON.parse($('#querydata').html()); + } catch (err) { + searchedData = null; + } + + /** + ** Input form submit on field change + **/ + + // first column choice corresponds to the X axis + $('#tableid_0').change(function () { + // AJAX request for field type, collation, operators, and value field + $.post('tbl_zoom_select.php', { + 'ajax_request' : true, + 'change_tbl_info' : true, + 'server' : PMA_commonParams.get('server'), + 'db' : PMA_commonParams.get('db'), + 'table' : PMA_commonParams.get('table'), + 'field' : $('#tableid_0').val(), + 'it' : 0 + }, function (data) { + $('#tableFieldsId').find('tr:eq(1) td:eq(0)').html(data.field_type); + $('#tableFieldsId').find('tr:eq(1) td:eq(1)').html(data.field_collation); + $('#tableFieldsId').find('tr:eq(1) td:eq(2)').html(data.field_operators); + $('#tableFieldsId').find('tr:eq(1) td:eq(3)').html(data.field_value); + xLabel = $('#tableid_0').val(); + $('#types_0').val(data.field_type); + xType = data.field_type; + $('#collations_0').val(data.field_collations); + addDateTimePicker(); + }); + }); + + // second column choice corresponds to the Y axis + $('#tableid_1').change(function () { + // AJAX request for field type, collation, operators, and value field + $.post('tbl_zoom_select.php', { + 'ajax_request' : true, + 'change_tbl_info' : true, + 'server' : PMA_commonParams.get('server'), + 'db' : PMA_commonParams.get('db'), + 'table' : PMA_commonParams.get('table'), + 'field' : $('#tableid_1').val(), + 'it' : 1 + }, function (data) { + $('#tableFieldsId').find('tr:eq(2) td:eq(0)').html(data.field_type); + $('#tableFieldsId').find('tr:eq(2) td:eq(1)').html(data.field_collation); + $('#tableFieldsId').find('tr:eq(2) td:eq(2)').html(data.field_operators); + $('#tableFieldsId').find('tr:eq(2) td:eq(3)').html(data.field_value); + yLabel = $('#tableid_1').val(); + $('#types_1').val(data.field_type); + yType = data.field_type; + $('#collations_1').val(data.field_collations); + addDateTimePicker(); + }); + }); + + $('#tableid_2').change(function () { + // AJAX request for field type, collation, operators, and value field + $.post('tbl_zoom_select.php', { + 'ajax_request' : true, + 'change_tbl_info' : true, + 'server' : PMA_commonParams.get('server'), + 'db' : PMA_commonParams.get('db'), + 'table' : PMA_commonParams.get('table'), + 'field' : $('#tableid_2').val(), + 'it' : 2 + }, function (data) { + $('#tableFieldsId').find('tr:eq(4) td:eq(0)').html(data.field_type); + $('#tableFieldsId').find('tr:eq(4) td:eq(1)').html(data.field_collation); + $('#tableFieldsId').find('tr:eq(4) td:eq(2)').html(data.field_operators); + $('#tableFieldsId').find('tr:eq(4) td:eq(3)').html(data.field_value); + $('#types_2').val(data.field_type); + $('#collations_2').val(data.field_collations); + addDateTimePicker(); + }); + }); + + $('#tableid_3').change(function () { + // AJAX request for field type, collation, operators, and value field + $.post('tbl_zoom_select.php', { + 'ajax_request' : true, + 'change_tbl_info' : true, + 'server' : PMA_commonParams.get('server'), + 'db' : PMA_commonParams.get('db'), + 'table' : PMA_commonParams.get('table'), + 'field' : $('#tableid_3').val(), + 'it' : 3 + }, function (data) { + $('#tableFieldsId').find('tr:eq(5) td:eq(0)').html(data.field_type); + $('#tableFieldsId').find('tr:eq(5) td:eq(1)').html(data.field_collation); + $('#tableFieldsId').find('tr:eq(5) td:eq(2)').html(data.field_operators); + $('#tableFieldsId').find('tr:eq(5) td:eq(3)').html(data.field_value); + $('#types_3').val(data.field_type); + $('#collations_3').val(data.field_collations); + addDateTimePicker(); + }); + }); + + /** + * Input form validation + **/ + $('#inputFormSubmitId').click(function () { + if ($('#tableid_0').get(0).selectedIndex === 0 || $('#tableid_1').get(0).selectedIndex === 0) { + PMA_ajaxShowMessage(PMA_messages.strInputNull); + } else if (xLabel === yLabel) { + PMA_ajaxShowMessage(PMA_messages.strSameInputs); + } + }); + + /** + ** Prepare a div containing a link, otherwise it's incorrectly displayed + ** after a couple of clicks + **/ + $('
      ') + .insertAfter('#zoom_search_form') + // don't show it until we have results on-screen + .hide(); + + $('#togglesearchformlink') + .html(PMA_messages.strShowSearchCriteria) + .bind('click', function () { + var $link = $(this); + $('#zoom_search_form').slideToggle(); + if ($link.text() === PMA_messages.strHideSearchCriteria) { + $link.text(PMA_messages.strShowSearchCriteria); + } else { + $link.text(PMA_messages.strHideSearchCriteria); + } + // avoid default click action + return false; + }); + + /** + ** Set dialog properties for the data display form + **/ + var buttonOptions = {}; + /* + * Handle saving of a row in the editor + */ + buttonOptions[PMA_messages.strSave] = function () { + // Find changed values by comparing form values with selectedRow Object + var newValues = {};// Stores the values changed from original + var sqlTypes = {}; + var it = 0; + var xChange = false; + var yChange = false; + var key; + var tempGetVal = function () { + return $(this).val(); + }; + for (key in selectedRow) { + var oldVal = selectedRow[key]; + var newVal = ($('#edit_fields_null_id_' + it).prop('checked')) ? null : $('#edit_fieldID_' + it).val(); + if (newVal instanceof Array) { // when the column is of type SET + newVal = $('#edit_fieldID_' + it).map(tempGetVal).get().join(','); + } + if (oldVal !== newVal) { + selectedRow[key] = newVal; + newValues[key] = newVal; + if (key === xLabel) { + xChange = true; + searchedData[searchedDataKey][xLabel] = newVal; + } else if (key === yLabel) { + yChange = true; + searchedData[searchedDataKey][yLabel] = newVal; + } + } + var $input = $('#edit_fieldID_' + it); + if ($input.hasClass('bit')) { + sqlTypes[key] = 'bit'; + } else { + sqlTypes[key] = null; + } + it++; + } // End data update + + // Update the chart series and replot + if (xChange || yChange) { + // Logic similar to plot generation, replot only if xAxis changes or yAxis changes. + // Code includes a lot of checks so as to replot only when necessary + if (xChange) { + xCord[searchedDataKey] = selectedRow[xLabel]; + // [searchedDataKey][0] contains the x value + if (xType === 'numeric') { + series[0][searchedDataKey][0] = selectedRow[xLabel]; + } else if (xType === 'time') { + series[0][searchedDataKey][0] = + getTimeStamp(selectedRow[xLabel], $('#types_0').val()); + } else { + series[0][searchedDataKey][0] = ''; + // TODO: text values + } + currentChart.series[0].data = series[0]; + // TODO: axis changing + currentChart.replot(); + } + if (yChange) { + yCord[searchedDataKey] = selectedRow[yLabel]; + // [searchedDataKey][1] contains the y value + if (yType === 'numeric') { + series[0][searchedDataKey][1] = selectedRow[yLabel]; + } else if (yType === 'time') { + series[0][searchedDataKey][1] = + getTimeStamp(selectedRow[yLabel], $('#types_1').val()); + } else { + series[0][searchedDataKey][1] = ''; + // TODO: text values + } + currentChart.series[0].data = series[0]; + // TODO: axis changing + currentChart.replot(); + } + } // End plot update + + // Generate SQL query for update + if (!isEmpty(newValues)) { + var sql_query = 'UPDATE `' + PMA_commonParams.get('table') + '` SET '; + for (key in newValues) { + sql_query += '`' + key + '`='; + var value = newValues[key]; + + // null + if (value === null) { + sql_query += 'NULL, '; + + // empty + } else if ($.trim(value) === '') { + sql_query += '\'\', '; + + // other + } else { + // type explicitly identified + if (sqlTypes[key] !== null) { + if (sqlTypes[key] === 'bit') { + sql_query += 'b\'' + value + '\', '; + } + // type not explicitly identified + } else { + if (!isNumeric(value)) { + sql_query += '\'' + value + '\', '; + } else { + sql_query += value + ', '; + } + } + } + } + // remove two extraneous characters ', ' + sql_query = sql_query.substring(0, sql_query.length - 2); + sql_query += ' WHERE ' + PMA_urldecode(searchedData[searchedDataKey].where_clause); + + // Post SQL query to sql.php + $.post('sql.php', { + 'server' : PMA_commonParams.get('server'), + 'db' : PMA_commonParams.get('db'), + 'ajax_request' : true, + 'sql_query' : sql_query, + 'inline_edit' : false + }, function (data) { + if (typeof data !== 'undefined' && data.success === true) { + $('#sqlqueryresultsouter').html(data.sql_query); + PMA_highlightSQL($('#sqlqueryresultsouter')); + } else { + PMA_ajaxShowMessage(data.error, false); + } + }); // End $.post + }// End database update + $('#dataDisplay').dialog('close'); + }; + buttonOptions[PMA_messages.strCancel] = function () { + $(this).dialog('close'); + }; + $('#dataDisplay').dialog({ + autoOpen: false, + title: PMA_messages.strDataPointContent, + modal: true, + buttons: buttonOptions, + width: $('#dataDisplay').width() + 80, + open: function () { + $(this).find('input[type=checkbox]').css('margin', '0.5em'); + } + }); + /** + * Attach Ajax event handlers for input fields + * in the dialog. Used to submit the Ajax + * request when the ENTER key is pressed. + */ + $(document).on('keydown', '#dataDisplay :input', function (e) { + if (e.which === 13) { // 13 is the ENTER key + e.preventDefault(); + if (typeof buttonOptions[PMA_messages.strSave] === 'function') { + buttonOptions[PMA_messages.strSave].call(); + } + } + }); + + + /* + * Generate plot using jqplot + */ + + if (searchedData !== null) { + $('#zoom_search_form') + .slideToggle() + .hide(); + $('#togglesearchformlink') + .text(PMA_messages.strShowSearchCriteria); + $('#togglesearchformdiv').show(); + var selectedRow; + var colorCodes = ['#FF0000', '#00FFFF', '#0000FF', '#0000A0', '#FF0080', '#800080', '#FFFF00', '#00FF00', '#FF00FF']; + var series = []; + var xCord = []; + var yCord = []; + var tempX; + var tempY; + var it = 0; + var xMax; // xAxis extreme max + var xMin; // xAxis extreme min + var yMax; // yAxis extreme max + var yMin; // yAxis extreme min + var xVal; + var yVal; + var format; + + var options = { + series: [ + // for a scatter plot + { showLine: false } + ], + grid: { + drawBorder: false, + shadow: false, + background: 'rgba(0,0,0,0)' + }, + axes: { + xaxis: { + label: $('#tableid_0').val(), + labelRenderer: $.jqplot.CanvasAxisLabelRenderer + }, + yaxis: { + label: $('#tableid_1').val(), + labelRenderer: $.jqplot.CanvasAxisLabelRenderer + } + }, + highlighter: { + show: true, + tooltipAxes: 'y', + yvalues: 2, + // hide the first y value + formatString: '%s%s' + }, + cursor: { + show: true, + zoom: true, + showTooltip: false + } + }; + + // If data label is not set, do not show tooltips + if (dataLabel === '') { + options.highlighter.show = false; + } + + // Classify types as either numeric,time,text + xType = getType(xType); + yType = getType(yType); + + // could have multiple series but we'll have just one + series[0] = []; + + if (xType === 'time') { + var originalXType = $('#types_0').val(); + if (originalXType === 'date') { + format = '%Y-%m-%d'; + } + // TODO: does not seem to work + // else if (originalXType === 'time') { + // format = '%H:%M'; + // } else { + // format = '%Y-%m-%d %H:%M'; + // } + $.extend(options.axes.xaxis, { + renderer: $.jqplot.DateAxisRenderer, + tickOptions: { + formatString: format + } + }); + } + if (yType === 'time') { + var originalYType = $('#types_1').val(); + if (originalYType === 'date') { + format = '%Y-%m-%d'; + } + $.extend(options.axes.yaxis, { + renderer: $.jqplot.DateAxisRenderer, + tickOptions: { + formatString: format + } + }); + } + + $.each(searchedData, function (key, value) { + if (xType === 'numeric') { + xVal = parseFloat(value[xLabel]); + } + if (xType === 'time') { + xVal = getTimeStamp(value[xLabel], originalXType); + } + if (yType === 'numeric') { + yVal = parseFloat(value[yLabel]); + } + if (yType === 'time') { + yVal = getTimeStamp(value[yLabel], originalYType); + } + series[0].push([ + xVal, + yVal, + // extra Y values + value[dataLabel], // for highlighter + // (may set an undefined value) + value.where_clause, // for click on point + key, // key from searchedData + value.where_clause_sign + ]); + }); + + // under IE 8, the initial display is mangled; after a manual + // resizing, it's ok + // under IE 9, everything is fine + currentChart = $.jqplot('querychart', series, options); + currentChart.resetZoom(); + + $('button.button-reset').click(function (event) { + event.preventDefault(); + currentChart.resetZoom(); + }); + + $('div#resizer').resizable(); + $('div#resizer').bind('resizestop', function (event, ui) { + // make room so that the handle will still appear + $('div#querychart').height($('div#resizer').height() * 0.96); + $('div#querychart').width($('div#resizer').width() * 0.96); + currentChart.replot({ resetAxes: true }); + }); + + $('div#querychart').bind('jqplotDataClick', + function (event, seriesIndex, pointIndex, data) { + searchedDataKey = data[4]; // key from searchedData (global) + var field_id = 0; + var post_params = { + 'ajax_request' : true, + 'get_data_row' : true, + 'server' : PMA_commonParams.get('server'), + 'db' : PMA_commonParams.get('db'), + 'table' : PMA_commonParams.get('table'), + 'where_clause' : data[3], + 'where_clause_sign' : data[5] + }; + + $.post('tbl_zoom_select.php', post_params, function (data) { + // Row is contained in data.row_info, + // now fill the displayResultForm with row values + var key; + for (key in data.row_info) { + var $field = $('#edit_fieldID_' + field_id); + var $field_null = $('#edit_fields_null_id_' + field_id); + if (data.row_info[key] === null) { + $field_null.prop('checked', true); + $field.val(''); + } else { + $field_null.prop('checked', false); + if ($field.attr('multiple')) { // when the column is of type SET + $field.val(data.row_info[key].split(',')); + } else { + $field.val(data.row_info[key]); + } + } + field_id++; + } + selectedRow = data.row_info; + }); + + $('#dataDisplay').dialog('open'); + } + ); + } + + $('#help_dialog').click(function () { + displayHelp(); + }); +}); diff --git a/phpMyAdmin/js/transformations/image_upload.js b/phpMyAdmin/js/transformations/image_upload.js new file mode 100755 index 0000000..6a08d44 --- /dev/null +++ b/phpMyAdmin/js/transformations/image_upload.js @@ -0,0 +1,28 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Image upload transformations plugin js + * + * @package PhpMyAdmin + */ + +AJAX.registerOnload('transformations/image_upload.js', function () { + // Change thumbnail when image file is selected + // through file upload dialog + $('input.image-upload').on('change', function (event) { + if (this.files && this.files[0]) { + var reader = new FileReader(); + var $input = $(this); + reader.onload = function (e) { + $input.prevAll('img').attr('src', e.target.result); + }; + reader.readAsDataURL(this.files[0]); + } + }); +}); + +/** + * Unbind all event handlers before tearing down a page + */ +AJAX.registerTeardown('transformations/image_upload.js', function () { + $('input.image-upload').off('change'); +}); diff --git a/phpMyAdmin/js/transformations/json.js b/phpMyAdmin/js/transformations/json.js new file mode 100755 index 0000000..81ddaf2 --- /dev/null +++ b/phpMyAdmin/js/transformations/json.js @@ -0,0 +1,18 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * JSON syntax highlighting transformation plugin + */ +AJAX.registerOnload('transformations/json.js', function () { + var $elm = $('#page_content').find('code.json'); + $elm.each(function () { + var $json = $(this); + var $pre = $json.find('pre'); + /* We only care about visible elements to avoid double processing */ + if ($pre.is(':visible')) { + var $highlight = $('
      '); + $json.append($highlight); + CodeMirror.runMode($json.text(), 'application/json', $highlight[0]); + $pre.hide(); + } + }); +}); diff --git a/phpMyAdmin/js/transformations/json_editor.js b/phpMyAdmin/js/transformations/json_editor.js new file mode 100755 index 0000000..affae4b --- /dev/null +++ b/phpMyAdmin/js/transformations/json_editor.js @@ -0,0 +1,17 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * JSON syntax highlighting transformation plugin + * + * @package PhpMyAdmin + */ +AJAX.registerOnload('transformations/json_editor.js', function () { + $('textarea.transform_json_editor').each(function () { + CodeMirror.fromTextArea(this, { + lineNumbers: true, + matchBrackets: true, + indentUnit: 4, + mode: 'application/json', + lineWrapping: true + }); + }); +}); diff --git a/phpMyAdmin/js/transformations/sql_editor.js b/phpMyAdmin/js/transformations/sql_editor.js new file mode 100755 index 0000000..4149b97 --- /dev/null +++ b/phpMyAdmin/js/transformations/sql_editor.js @@ -0,0 +1,11 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * SQL syntax highlighting transformation plugin js + * + * @package PhpMyAdmin + */ +AJAX.registerOnload('transformations/sql_editor.js', function () { + $('textarea.transform_sql_editor').each(function () { + PMA_getSQLEditor($(this), {}, 'both'); + }); +}); diff --git a/phpMyAdmin/js/transformations/xml.js b/phpMyAdmin/js/transformations/xml.js new file mode 100755 index 0000000..3fdf152 --- /dev/null +++ b/phpMyAdmin/js/transformations/xml.js @@ -0,0 +1,18 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * XML syntax highlighting transformation plugin + */ +AJAX.registerOnload('transformations/xml.js', function () { + var $elm = $('#page_content').find('code.xml'); + $elm.each(function () { + var $json = $(this); + var $pre = $json.find('pre'); + /* We only care about visible elements to avoid double processing */ + if ($pre.is(':visible')) { + var $highlight = $('
      '); + $json.append($highlight); + CodeMirror.runMode($json.text(), 'application/xml', $highlight[0]); + $pre.hide(); + } + }); +}); diff --git a/phpMyAdmin/js/transformations/xml_editor.js b/phpMyAdmin/js/transformations/xml_editor.js new file mode 100755 index 0000000..7d2533d --- /dev/null +++ b/phpMyAdmin/js/transformations/xml_editor.js @@ -0,0 +1,16 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * XML editor plugin + * + * @package PhpMyAdmin + */ +AJAX.registerOnload('transformations/xml_editor.js', function () { + $('textarea.transform_xml_editor').each(function () { + CodeMirror.fromTextArea(this, { + lineNumbers: true, + indentUnit: 4, + mode: 'application/xml', + lineWrapping: true + }); + }); +}); diff --git a/phpMyAdmin/js/u2f.js b/phpMyAdmin/js/u2f.js new file mode 100755 index 0000000..47f3e8d --- /dev/null +++ b/phpMyAdmin/js/u2f.js @@ -0,0 +1,59 @@ +/** global: AJAX */ +/** global: PMA_messages */ +/** global: u2f */ +AJAX.registerOnload('u2f.js', function () { + var $inputReg = $('#u2f_registration_response'); + if ($inputReg.length > 0) { + var $formReg = $inputReg.parents('form'); + $formReg.find('input[type=submit]').hide(); + setTimeout(function () { + // A magic JS function that talks to the USB device. This function will keep polling for the USB device until it finds one. + var request = JSON.parse($inputReg.attr('data-request')); + u2f.register(request.appId, [request], JSON.parse($inputReg.attr('data-signatures')), function (data) { + // Handle returning error data + if (data.errorCode && data.errorCode !== 0) { + if (data.errorCode === 5) { + PMA_ajaxShowMessage(PMA_messages.strU2FTimeout, false); + } else { + PMA_ajaxShowMessage( + PMA_sprintf(PMA_messages.strU2FError, data.errorCode), false + ); + } + return; + } + + // Fill and submit form. + $inputReg.val(JSON.stringify(data)); + $formReg.submit(); + }); + }, 1000); + } + var $inputAuth = $('#u2f_authentication_response'); + if ($inputAuth.length > 0) { + var $formAuth = $inputAuth.parents('form'); + $formAuth.find('input[type=submit]').hide(); + setTimeout(function () { + // Magic JavaScript talking to your HID + // appid, challenge, authenticateRequests + var request = JSON.parse($inputAuth.attr('data-request')); + var handles = [request[0].keyHandle]; + u2f.sign(request[0].appId, request[0].challenge, request, function (data) { + // Handle returning error data + if (data.errorCode && data.errorCode !== 0) { + if (data.errorCode === 5) { + PMA_ajaxShowMessage(PMA_messages.strU2FTimeout, false); + } else { + PMA_ajaxShowMessage( + PMA_sprintf(PMA_messages.strU2FError, data.errorCode), false + ); + } + return; + } + + // Fill and submit form. + $inputAuth.val(JSON.stringify(data)); + $formAuth.submit(); + }); + }, 1000); + } +}); diff --git a/phpMyAdmin/js/vendor/codemirror/LICENSE b/phpMyAdmin/js/vendor/codemirror/LICENSE new file mode 100755 index 0000000..ff7db4b --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (C) 2017 by Marijn Haverbeke and others + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/phpMyAdmin/js/vendor/codemirror/addon/hint/show-hint.css b/phpMyAdmin/js/vendor/codemirror/addon/hint/show-hint.css new file mode 100755 index 0000000..5617ccc --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/addon/hint/show-hint.css @@ -0,0 +1,36 @@ +.CodeMirror-hints { + position: absolute; + z-index: 10; + overflow: hidden; + list-style: none; + + margin: 0; + padding: 2px; + + -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); + -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); + box-shadow: 2px 3px 5px rgba(0,0,0,.2); + border-radius: 3px; + border: 1px solid silver; + + background: white; + font-size: 90%; + font-family: monospace; + + max-height: 20em; + overflow-y: auto; +} + +.CodeMirror-hint { + margin: 0; + padding: 0 4px; + border-radius: 2px; + white-space: pre; + color: black; + cursor: pointer; +} + +li.CodeMirror-hint-active { + background: #08f; + color: white; +} diff --git a/phpMyAdmin/js/vendor/codemirror/addon/hint/show-hint.js b/phpMyAdmin/js/vendor/codemirror/addon/hint/show-hint.js new file mode 100755 index 0000000..d70b2ab --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/addon/hint/show-hint.js @@ -0,0 +1,460 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var HINT_ELEMENT_CLASS = "CodeMirror-hint"; + var ACTIVE_HINT_ELEMENT_CLASS = "CodeMirror-hint-active"; + + // This is the old interface, kept around for now to stay + // backwards-compatible. + CodeMirror.showHint = function(cm, getHints, options) { + if (!getHints) return cm.showHint(options); + if (options && options.async) getHints.async = true; + var newOpts = {hint: getHints}; + if (options) for (var prop in options) newOpts[prop] = options[prop]; + return cm.showHint(newOpts); + }; + + CodeMirror.defineExtension("showHint", function(options) { + options = parseOptions(this, this.getCursor("start"), options); + var selections = this.listSelections() + if (selections.length > 1) return; + // By default, don't allow completion when something is selected. + // A hint function can have a `supportsSelection` property to + // indicate that it can handle selections. + if (this.somethingSelected()) { + if (!options.hint.supportsSelection) return; + // Don't try with cross-line selections + for (var i = 0; i < selections.length; i++) + if (selections[i].head.line != selections[i].anchor.line) return; + } + + if (this.state.completionActive) this.state.completionActive.close(); + var completion = this.state.completionActive = new Completion(this, options); + if (!completion.options.hint) return; + + CodeMirror.signal(this, "startCompletion", this); + completion.update(true); + }); + + CodeMirror.defineExtension("closeHint", function() { + if (this.state.completionActive) this.state.completionActive.close() + }) + + function Completion(cm, options) { + this.cm = cm; + this.options = options; + this.widget = null; + this.debounce = 0; + this.tick = 0; + this.startPos = this.cm.getCursor("start"); + this.startLen = this.cm.getLine(this.startPos.line).length - this.cm.getSelection().length; + + var self = this; + cm.on("cursorActivity", this.activityFunc = function() { self.cursorActivity(); }); + } + + var requestAnimationFrame = window.requestAnimationFrame || function(fn) { + return setTimeout(fn, 1000/60); + }; + var cancelAnimationFrame = window.cancelAnimationFrame || clearTimeout; + + Completion.prototype = { + close: function() { + if (!this.active()) return; + this.cm.state.completionActive = null; + this.tick = null; + this.cm.off("cursorActivity", this.activityFunc); + + if (this.widget && this.data) CodeMirror.signal(this.data, "close"); + if (this.widget) this.widget.close(); + CodeMirror.signal(this.cm, "endCompletion", this.cm); + }, + + active: function() { + return this.cm.state.completionActive == this; + }, + + pick: function(data, i) { + var completion = data.list[i]; + if (completion.hint) completion.hint(this.cm, data, completion); + else this.cm.replaceRange(getText(completion), completion.from || data.from, + completion.to || data.to, "complete"); + CodeMirror.signal(data, "pick", completion); + this.close(); + }, + + cursorActivity: function() { + if (this.debounce) { + cancelAnimationFrame(this.debounce); + this.debounce = 0; + } + + var pos = this.cm.getCursor(), line = this.cm.getLine(pos.line); + if (pos.line != this.startPos.line || line.length - pos.ch != this.startLen - this.startPos.ch || + pos.ch < this.startPos.ch || this.cm.somethingSelected() || + (!pos.ch || this.options.closeCharacters.test(line.charAt(pos.ch - 1)))) { + this.close(); + } else { + var self = this; + this.debounce = requestAnimationFrame(function() {self.update();}); + if (this.widget) this.widget.disable(); + } + }, + + update: function(first) { + if (this.tick == null) return + var self = this, myTick = ++this.tick + fetchHints(this.options.hint, this.cm, this.options, function(data) { + if (self.tick == myTick) self.finishUpdate(data, first) + }) + }, + + finishUpdate: function(data, first) { + if (this.data) CodeMirror.signal(this.data, "update"); + + var picked = (this.widget && this.widget.picked) || (first && this.options.completeSingle); + if (this.widget) this.widget.close(); + + this.data = data; + + if (data && data.list.length) { + if (picked && data.list.length == 1) { + this.pick(data, 0); + } else { + this.widget = new Widget(this, data); + CodeMirror.signal(data, "shown"); + } + } + } + }; + + function parseOptions(cm, pos, options) { + var editor = cm.options.hintOptions; + var out = {}; + for (var prop in defaultOptions) out[prop] = defaultOptions[prop]; + if (editor) for (var prop in editor) + if (editor[prop] !== undefined) out[prop] = editor[prop]; + if (options) for (var prop in options) + if (options[prop] !== undefined) out[prop] = options[prop]; + if (out.hint.resolve) out.hint = out.hint.resolve(cm, pos) + return out; + } + + function getText(completion) { + if (typeof completion == "string") return completion; + else return completion.text; + } + + function buildKeyMap(completion, handle) { + var baseMap = { + Up: function() {handle.moveFocus(-1);}, + Down: function() {handle.moveFocus(1);}, + PageUp: function() {handle.moveFocus(-handle.menuSize() + 1, true);}, + PageDown: function() {handle.moveFocus(handle.menuSize() - 1, true);}, + Home: function() {handle.setFocus(0);}, + End: function() {handle.setFocus(handle.length - 1);}, + Enter: handle.pick, + Tab: handle.pick, + Esc: handle.close + }; + + var mac = /Mac/.test(navigator.platform); + + if (mac) { + baseMap["Ctrl-P"] = function() {handle.moveFocus(-1);}; + baseMap["Ctrl-N"] = function() {handle.moveFocus(1);}; + } + + var custom = completion.options.customKeys; + var ourMap = custom ? {} : baseMap; + function addBinding(key, val) { + var bound; + if (typeof val != "string") + bound = function(cm) { return val(cm, handle); }; + // This mechanism is deprecated + else if (baseMap.hasOwnProperty(val)) + bound = baseMap[val]; + else + bound = val; + ourMap[key] = bound; + } + if (custom) + for (var key in custom) if (custom.hasOwnProperty(key)) + addBinding(key, custom[key]); + var extra = completion.options.extraKeys; + if (extra) + for (var key in extra) if (extra.hasOwnProperty(key)) + addBinding(key, extra[key]); + return ourMap; + } + + function getHintElement(hintsElement, el) { + while (el && el != hintsElement) { + if (el.nodeName.toUpperCase() === "LI" && el.parentNode == hintsElement) return el; + el = el.parentNode; + } + } + + function Widget(completion, data) { + this.completion = completion; + this.data = data; + this.picked = false; + var widget = this, cm = completion.cm; + var ownerDocument = cm.getInputField().ownerDocument; + var parentWindow = ownerDocument.defaultView || ownerDocument.parentWindow; + + var hints = this.hints = ownerDocument.createElement("ul"); + var theme = completion.cm.options.theme; + hints.className = "CodeMirror-hints " + theme; + this.selectedHint = data.selectedHint || 0; + + var completions = data.list; + for (var i = 0; i < completions.length; ++i) { + var elt = hints.appendChild(ownerDocument.createElement("li")), cur = completions[i]; + var className = HINT_ELEMENT_CLASS + (i != this.selectedHint ? "" : " " + ACTIVE_HINT_ELEMENT_CLASS); + if (cur.className != null) className = cur.className + " " + className; + elt.className = className; + if (cur.render) cur.render(elt, data, cur); + else elt.appendChild(ownerDocument.createTextNode(cur.displayText || getText(cur))); + elt.hintId = i; + } + + var container = completion.options.container || ownerDocument.body; + var pos = cm.cursorCoords(completion.options.alignWithWord ? data.from : null); + var left = pos.left, top = pos.bottom, below = true; + var offsetLeft = 0, offsetTop = 0; + if (container !== ownerDocument.body) { + // We offset the cursor position because left and top are relative to the offsetParent's top left corner. + var isContainerPositioned = ['absolute', 'relative', 'fixed'].indexOf(parentWindow.getComputedStyle(container).position) !== -1; + var offsetParent = isContainerPositioned ? container : container.offsetParent; + var offsetParentPosition = offsetParent.getBoundingClientRect(); + var bodyPosition = ownerDocument.body.getBoundingClientRect(); + offsetLeft = (offsetParentPosition.left - bodyPosition.left - offsetParent.scrollLeft); + offsetTop = (offsetParentPosition.top - bodyPosition.top - offsetParent.scrollTop); + } + hints.style.left = (left - offsetLeft) + "px"; + hints.style.top = (top - offsetTop) + "px"; + + // If we're at the edge of the screen, then we want the menu to appear on the left of the cursor. + var winW = parentWindow.innerWidth || Math.max(ownerDocument.body.offsetWidth, ownerDocument.documentElement.offsetWidth); + var winH = parentWindow.innerHeight || Math.max(ownerDocument.body.offsetHeight, ownerDocument.documentElement.offsetHeight); + container.appendChild(hints); + var box = hints.getBoundingClientRect(), overlapY = box.bottom - winH; + var scrolls = hints.scrollHeight > hints.clientHeight + 1 + var startScroll = cm.getScrollInfo(); + + if (overlapY > 0) { + var height = box.bottom - box.top, curTop = pos.top - (pos.bottom - box.top); + if (curTop - height > 0) { // Fits above cursor + hints.style.top = (top = pos.top - height - offsetTop) + "px"; + below = false; + } else if (height > winH) { + hints.style.height = (winH - 5) + "px"; + hints.style.top = (top = pos.bottom - box.top - offsetTop) + "px"; + var cursor = cm.getCursor(); + if (data.from.ch != cursor.ch) { + pos = cm.cursorCoords(cursor); + hints.style.left = (left = pos.left - offsetLeft) + "px"; + box = hints.getBoundingClientRect(); + } + } + } + var overlapX = box.right - winW; + if (overlapX > 0) { + if (box.right - box.left > winW) { + hints.style.width = (winW - 5) + "px"; + overlapX -= (box.right - box.left) - winW; + } + hints.style.left = (left = pos.left - overlapX - offsetLeft) + "px"; + } + if (scrolls) for (var node = hints.firstChild; node; node = node.nextSibling) + node.style.paddingRight = cm.display.nativeBarWidth + "px" + + cm.addKeyMap(this.keyMap = buildKeyMap(completion, { + moveFocus: function(n, avoidWrap) { widget.changeActive(widget.selectedHint + n, avoidWrap); }, + setFocus: function(n) { widget.changeActive(n); }, + menuSize: function() { return widget.screenAmount(); }, + length: completions.length, + close: function() { completion.close(); }, + pick: function() { widget.pick(); }, + data: data + })); + + if (completion.options.closeOnUnfocus) { + var closingOnBlur; + cm.on("blur", this.onBlur = function() { closingOnBlur = setTimeout(function() { completion.close(); }, 100); }); + cm.on("focus", this.onFocus = function() { clearTimeout(closingOnBlur); }); + } + + cm.on("scroll", this.onScroll = function() { + var curScroll = cm.getScrollInfo(), editor = cm.getWrapperElement().getBoundingClientRect(); + var newTop = top + startScroll.top - curScroll.top; + var point = newTop - (parentWindow.pageYOffset || (ownerDocument.documentElement || ownerDocument.body).scrollTop); + if (!below) point += hints.offsetHeight; + if (point <= editor.top || point >= editor.bottom) return completion.close(); + hints.style.top = newTop + "px"; + hints.style.left = (left + startScroll.left - curScroll.left) + "px"; + }); + + CodeMirror.on(hints, "dblclick", function(e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) {widget.changeActive(t.hintId); widget.pick();} + }); + + CodeMirror.on(hints, "click", function(e) { + var t = getHintElement(hints, e.target || e.srcElement); + if (t && t.hintId != null) { + widget.changeActive(t.hintId); + if (completion.options.completeOnSingleClick) widget.pick(); + } + }); + + CodeMirror.on(hints, "mousedown", function() { + setTimeout(function(){cm.focus();}, 20); + }); + + CodeMirror.signal(data, "select", completions[this.selectedHint], hints.childNodes[this.selectedHint]); + return true; + } + + Widget.prototype = { + close: function() { + if (this.completion.widget != this) return; + this.completion.widget = null; + this.hints.parentNode.removeChild(this.hints); + this.completion.cm.removeKeyMap(this.keyMap); + + var cm = this.completion.cm; + if (this.completion.options.closeOnUnfocus) { + cm.off("blur", this.onBlur); + cm.off("focus", this.onFocus); + } + cm.off("scroll", this.onScroll); + }, + + disable: function() { + this.completion.cm.removeKeyMap(this.keyMap); + var widget = this; + this.keyMap = {Enter: function() { widget.picked = true; }}; + this.completion.cm.addKeyMap(this.keyMap); + }, + + pick: function() { + this.completion.pick(this.data, this.selectedHint); + }, + + changeActive: function(i, avoidWrap) { + if (i >= this.data.list.length) + i = avoidWrap ? this.data.list.length - 1 : 0; + else if (i < 0) + i = avoidWrap ? 0 : this.data.list.length - 1; + if (this.selectedHint == i) return; + var node = this.hints.childNodes[this.selectedHint]; + if (node) node.className = node.className.replace(" " + ACTIVE_HINT_ELEMENT_CLASS, ""); + node = this.hints.childNodes[this.selectedHint = i]; + node.className += " " + ACTIVE_HINT_ELEMENT_CLASS; + if (node.offsetTop < this.hints.scrollTop) + this.hints.scrollTop = node.offsetTop - 3; + else if (node.offsetTop + node.offsetHeight > this.hints.scrollTop + this.hints.clientHeight) + this.hints.scrollTop = node.offsetTop + node.offsetHeight - this.hints.clientHeight + 3; + CodeMirror.signal(this.data, "select", this.data.list[this.selectedHint], node); + }, + + screenAmount: function() { + return Math.floor(this.hints.clientHeight / this.hints.firstChild.offsetHeight) || 1; + } + }; + + function applicableHelpers(cm, helpers) { + if (!cm.somethingSelected()) return helpers + var result = [] + for (var i = 0; i < helpers.length; i++) + if (helpers[i].supportsSelection) result.push(helpers[i]) + return result + } + + function fetchHints(hint, cm, options, callback) { + if (hint.async) { + hint(cm, callback, options) + } else { + var result = hint(cm, options) + if (result && result.then) result.then(callback) + else callback(result) + } + } + + function resolveAutoHints(cm, pos) { + var helpers = cm.getHelpers(pos, "hint"), words + if (helpers.length) { + var resolved = function(cm, callback, options) { + var app = applicableHelpers(cm, helpers); + function run(i) { + if (i == app.length) return callback(null) + fetchHints(app[i], cm, options, function(result) { + if (result && result.list.length > 0) callback(result) + else run(i + 1) + }) + } + run(0) + } + resolved.async = true + resolved.supportsSelection = true + return resolved + } else if (words = cm.getHelper(cm.getCursor(), "hintWords")) { + return function(cm) { return CodeMirror.hint.fromList(cm, {words: words}) } + } else if (CodeMirror.hint.anyword) { + return function(cm, options) { return CodeMirror.hint.anyword(cm, options) } + } else { + return function() {} + } + } + + CodeMirror.registerHelper("hint", "auto", { + resolve: resolveAutoHints + }); + + CodeMirror.registerHelper("hint", "fromList", function(cm, options) { + var cur = cm.getCursor(), token = cm.getTokenAt(cur) + var term, from = CodeMirror.Pos(cur.line, token.start), to = cur + if (token.start < cur.ch && /\w/.test(token.string.charAt(cur.ch - token.start - 1))) { + term = token.string.substr(0, cur.ch - token.start) + } else { + term = "" + from = cur + } + var found = []; + for (var i = 0; i < options.words.length; i++) { + var word = options.words[i]; + if (word.slice(0, term.length) == term) + found.push(word); + } + + if (found.length) return {list: found, from: from, to: to}; + }); + + CodeMirror.commands.autocomplete = CodeMirror.showHint; + + var defaultOptions = { + hint: CodeMirror.hint.auto, + completeSingle: true, + alignWithWord: true, + closeCharacters: /[\s()\[\]{};:>,]/, + closeOnUnfocus: true, + completeOnSingleClick: true, + container: null, + customKeys: null, + extraKeys: null + }; + + CodeMirror.defineOption("hintOptions", null); +}); diff --git a/phpMyAdmin/js/vendor/codemirror/addon/hint/sql-hint.js b/phpMyAdmin/js/vendor/codemirror/addon/hint/sql-hint.js new file mode 100755 index 0000000..444eba8 --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/addon/hint/sql-hint.js @@ -0,0 +1,304 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../../mode/sql/sql")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../../mode/sql/sql"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + + var tables; + var defaultTable; + var keywords; + var identifierQuote; + var CONS = { + QUERY_DIV: ";", + ALIAS_KEYWORD: "AS" + }; + var Pos = CodeMirror.Pos, cmpPos = CodeMirror.cmpPos; + + function isArray(val) { return Object.prototype.toString.call(val) == "[object Array]" } + + function getKeywords(editor) { + var mode = editor.doc.modeOption; + if (mode === "sql") mode = "text/x-sql"; + return CodeMirror.resolveMode(mode).keywords; + } + + function getIdentifierQuote(editor) { + var mode = editor.doc.modeOption; + if (mode === "sql") mode = "text/x-sql"; + return CodeMirror.resolveMode(mode).identifierQuote || "`"; + } + + function getText(item) { + return typeof item == "string" ? item : item.text; + } + + function wrapTable(name, value) { + if (isArray(value)) value = {columns: value} + if (!value.text) value.text = name + return value + } + + function parseTables(input) { + var result = {} + if (isArray(input)) { + for (var i = input.length - 1; i >= 0; i--) { + var item = input[i] + result[getText(item).toUpperCase()] = wrapTable(getText(item), item) + } + } else if (input) { + for (var name in input) + result[name.toUpperCase()] = wrapTable(name, input[name]) + } + return result + } + + function getTable(name) { + return tables[name.toUpperCase()] + } + + function shallowClone(object) { + var result = {}; + for (var key in object) if (object.hasOwnProperty(key)) + result[key] = object[key]; + return result; + } + + function match(string, word) { + var len = string.length; + var sub = getText(word).substr(0, len); + return string.toUpperCase() === sub.toUpperCase(); + } + + function addMatches(result, search, wordlist, formatter) { + if (isArray(wordlist)) { + for (var i = 0; i < wordlist.length; i++) + if (match(search, wordlist[i])) result.push(formatter(wordlist[i])) + } else { + for (var word in wordlist) if (wordlist.hasOwnProperty(word)) { + var val = wordlist[word] + if (!val || val === true) + val = word + else + val = val.displayText ? {text: val.text, displayText: val.displayText} : val.text + if (match(search, val)) result.push(formatter(val)) + } + } + } + + function cleanName(name) { + // Get rid name from identifierQuote and preceding dot(.) + if (name.charAt(0) == ".") { + name = name.substr(1); + } + // replace doublicated identifierQuotes with single identifierQuotes + // and remove single identifierQuotes + var nameParts = name.split(identifierQuote+identifierQuote); + for (var i = 0; i < nameParts.length; i++) + nameParts[i] = nameParts[i].replace(new RegExp(identifierQuote,"g"), ""); + return nameParts.join(identifierQuote); + } + + function insertIdentifierQuotes(name) { + var nameParts = getText(name).split("."); + for (var i = 0; i < nameParts.length; i++) + nameParts[i] = identifierQuote + + // doublicate identifierQuotes + nameParts[i].replace(new RegExp(identifierQuote,"g"), identifierQuote+identifierQuote) + + identifierQuote; + var escaped = nameParts.join("."); + if (typeof name == "string") return escaped; + name = shallowClone(name); + name.text = escaped; + return name; + } + + function nameCompletion(cur, token, result, editor) { + // Try to complete table, column names and return start position of completion + var useIdentifierQuotes = false; + var nameParts = []; + var start = token.start; + var cont = true; + while (cont) { + cont = (token.string.charAt(0) == "."); + useIdentifierQuotes = useIdentifierQuotes || (token.string.charAt(0) == identifierQuote); + + start = token.start; + nameParts.unshift(cleanName(token.string)); + + token = editor.getTokenAt(Pos(cur.line, token.start)); + if (token.string == ".") { + cont = true; + token = editor.getTokenAt(Pos(cur.line, token.start)); + } + } + + // Try to complete table names + var string = nameParts.join("."); + addMatches(result, string, tables, function(w) { + return useIdentifierQuotes ? insertIdentifierQuotes(w) : w; + }); + + // Try to complete columns from defaultTable + addMatches(result, string, defaultTable, function(w) { + return useIdentifierQuotes ? insertIdentifierQuotes(w) : w; + }); + + // Try to complete columns + string = nameParts.pop(); + var table = nameParts.join("."); + + var alias = false; + var aliasTable = table; + // Check if table is available. If not, find table by Alias + if (!getTable(table)) { + var oldTable = table; + table = findTableByAlias(table, editor); + if (table !== oldTable) alias = true; + } + + var columns = getTable(table); + if (columns && columns.columns) + columns = columns.columns; + + if (columns) { + addMatches(result, string, columns, function(w) { + var tableInsert = table; + if (alias == true) tableInsert = aliasTable; + if (typeof w == "string") { + w = tableInsert + "." + w; + } else { + w = shallowClone(w); + w.text = tableInsert + "." + w.text; + } + return useIdentifierQuotes ? insertIdentifierQuotes(w) : w; + }); + } + + return start; + } + + function eachWord(lineText, f) { + var words = lineText.split(/\s+/) + for (var i = 0; i < words.length; i++) + if (words[i]) f(words[i].replace(/[,;]/g, '')) + } + + function findTableByAlias(alias, editor) { + var doc = editor.doc; + var fullQuery = doc.getValue(); + var aliasUpperCase = alias.toUpperCase(); + var previousWord = ""; + var table = ""; + var separator = []; + var validRange = { + start: Pos(0, 0), + end: Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).length) + }; + + //add separator + var indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV); + while(indexOfSeparator != -1) { + separator.push(doc.posFromIndex(indexOfSeparator)); + indexOfSeparator = fullQuery.indexOf(CONS.QUERY_DIV, indexOfSeparator+1); + } + separator.unshift(Pos(0, 0)); + separator.push(Pos(editor.lastLine(), editor.getLineHandle(editor.lastLine()).text.length)); + + //find valid range + var prevItem = null; + var current = editor.getCursor() + for (var i = 0; i < separator.length; i++) { + if ((prevItem == null || cmpPos(current, prevItem) > 0) && cmpPos(current, separator[i]) <= 0) { + validRange = {start: prevItem, end: separator[i]}; + break; + } + prevItem = separator[i]; + } + + if (validRange.start) { + var query = doc.getRange(validRange.start, validRange.end, false); + + for (var i = 0; i < query.length; i++) { + var lineText = query[i]; + eachWord(lineText, function(word) { + var wordUpperCase = word.toUpperCase(); + if (wordUpperCase === aliasUpperCase && getTable(previousWord)) + table = previousWord; + if (wordUpperCase !== CONS.ALIAS_KEYWORD) + previousWord = word; + }); + if (table) break; + } + } + return table; + } + + CodeMirror.registerHelper("hint", "sql", function(editor, options) { + tables = parseTables(options && options.tables) + var defaultTableName = options && options.defaultTable; + var disableKeywords = options && options.disableKeywords; + defaultTable = defaultTableName && getTable(defaultTableName); + keywords = getKeywords(editor); + identifierQuote = getIdentifierQuote(editor); + + if (defaultTableName && !defaultTable) + defaultTable = findTableByAlias(defaultTableName, editor); + + defaultTable = defaultTable || []; + + if (defaultTable.columns) + defaultTable = defaultTable.columns; + + var cur = editor.getCursor(); + var result = []; + var token = editor.getTokenAt(cur), start, end, search; + if (token.end > cur.ch) { + token.end = cur.ch; + token.string = token.string.slice(0, cur.ch - token.start); + } + + if (token.string.match(/^[.`"\w@]\w*$/)) { + search = token.string; + start = token.start; + end = token.end; + } else { + start = end = cur.ch; + search = ""; + } + if (search.charAt(0) == "." || search.charAt(0) == identifierQuote) { + start = nameCompletion(cur, token, result, editor); + } else { + var objectOrClass = function(w, className) { + if (typeof w === "object") { + w.className = className; + } else { + w = { text: w, className: className }; + } + return w; + }; + addMatches(result, search, defaultTable, function(w) { + return objectOrClass(w, "CodeMirror-hint-table CodeMirror-hint-default-table"); + }); + addMatches( + result, + search, + tables, function(w) { + return objectOrClass(w, "CodeMirror-hint-table"); + } + ); + if (!disableKeywords) + addMatches(result, search, keywords, function(w) { + return objectOrClass(w.toUpperCase(), "CodeMirror-hint-keyword"); + }); + } + + return {list: result, from: Pos(cur.line, start), to: Pos(cur.line, end)}; + }); +}); diff --git a/phpMyAdmin/js/vendor/codemirror/addon/lint/lint.css b/phpMyAdmin/js/vendor/codemirror/addon/lint/lint.css new file mode 100755 index 0000000..f097cfe --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/addon/lint/lint.css @@ -0,0 +1,73 @@ +/* The lint marker gutter */ +.CodeMirror-lint-markers { + width: 16px; +} + +.CodeMirror-lint-tooltip { + background-color: #ffd; + border: 1px solid black; + border-radius: 4px 4px 4px 4px; + color: black; + font-family: monospace; + font-size: 10pt; + overflow: hidden; + padding: 2px 5px; + position: fixed; + white-space: pre; + white-space: pre-wrap; + z-index: 100; + max-width: 600px; + opacity: 0; + transition: opacity .4s; + -moz-transition: opacity .4s; + -webkit-transition: opacity .4s; + -o-transition: opacity .4s; + -ms-transition: opacity .4s; +} + +.CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { + background-position: left bottom; + background-repeat: repeat-x; +} + +.CodeMirror-lint-mark-error { + background-image: + url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==") + ; +} + +.CodeMirror-lint-mark-warning { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); +} + +.CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning { + background-position: center center; + background-repeat: no-repeat; + cursor: pointer; + display: inline-block; + height: 16px; + width: 16px; + vertical-align: middle; + position: relative; +} + +.CodeMirror-lint-message-error, .CodeMirror-lint-message-warning { + padding-left: 18px; + background-position: top left; + background-repeat: no-repeat; +} + +.CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII="); +} + +.CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII="); +} + +.CodeMirror-lint-marker-multiple { + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC"); + background-repeat: no-repeat; + background-position: right bottom; + width: 100%; height: 100%; +} diff --git a/phpMyAdmin/js/vendor/codemirror/addon/lint/lint.js b/phpMyAdmin/js/vendor/codemirror/addon/lint/lint.js new file mode 100755 index 0000000..aa75ba0 --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/addon/lint/lint.js @@ -0,0 +1,252 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { + "use strict"; + var GUTTER_ID = "CodeMirror-lint-markers"; + + function showTooltip(e, content) { + var tt = document.createElement("div"); + tt.className = "CodeMirror-lint-tooltip"; + tt.appendChild(content.cloneNode(true)); + document.body.appendChild(tt); + + function position(e) { + if (!tt.parentNode) return CodeMirror.off(document, "mousemove", position); + tt.style.top = Math.max(0, e.clientY - tt.offsetHeight - 5) + "px"; + tt.style.left = (e.clientX + 5) + "px"; + } + CodeMirror.on(document, "mousemove", position); + position(e); + if (tt.style.opacity != null) tt.style.opacity = 1; + return tt; + } + function rm(elt) { + if (elt.parentNode) elt.parentNode.removeChild(elt); + } + function hideTooltip(tt) { + if (!tt.parentNode) return; + if (tt.style.opacity == null) rm(tt); + tt.style.opacity = 0; + setTimeout(function() { rm(tt); }, 600); + } + + function showTooltipFor(e, content, node) { + var tooltip = showTooltip(e, content); + function hide() { + CodeMirror.off(node, "mouseout", hide); + if (tooltip) { hideTooltip(tooltip); tooltip = null; } + } + var poll = setInterval(function() { + if (tooltip) for (var n = node;; n = n.parentNode) { + if (n && n.nodeType == 11) n = n.host; + if (n == document.body) return; + if (!n) { hide(); break; } + } + if (!tooltip) return clearInterval(poll); + }, 400); + CodeMirror.on(node, "mouseout", hide); + } + + function LintState(cm, options, hasGutter) { + this.marked = []; + this.options = options; + this.timeout = null; + this.hasGutter = hasGutter; + this.onMouseOver = function(e) { onMouseOver(cm, e); }; + this.waitingFor = 0 + } + + function parseOptions(_cm, options) { + if (options instanceof Function) return {getAnnotations: options}; + if (!options || options === true) options = {}; + return options; + } + + function clearMarks(cm) { + var state = cm.state.lint; + if (state.hasGutter) cm.clearGutter(GUTTER_ID); + for (var i = 0; i < state.marked.length; ++i) + state.marked[i].clear(); + state.marked.length = 0; + } + + function makeMarker(labels, severity, multiple, tooltips) { + var marker = document.createElement("div"), inner = marker; + marker.className = "CodeMirror-lint-marker-" + severity; + if (multiple) { + inner = marker.appendChild(document.createElement("div")); + inner.className = "CodeMirror-lint-marker-multiple"; + } + + if (tooltips != false) CodeMirror.on(inner, "mouseover", function(e) { + showTooltipFor(e, labels, inner); + }); + + return marker; + } + + function getMaxSeverity(a, b) { + if (a == "error") return a; + else return b; + } + + function groupByLine(annotations) { + var lines = []; + for (var i = 0; i < annotations.length; ++i) { + var ann = annotations[i], line = ann.from.line; + (lines[line] || (lines[line] = [])).push(ann); + } + return lines; + } + + function annotationTooltip(ann) { + var severity = ann.severity; + if (!severity) severity = "error"; + var tip = document.createElement("div"); + tip.className = "CodeMirror-lint-message-" + severity; + if (typeof ann.messageHTML != 'undefined') { + tip.innerHTML = ann.messageHTML; + } else { + tip.appendChild(document.createTextNode(ann.message)); + } + return tip; + } + + function lintAsync(cm, getAnnotations, passOptions) { + var state = cm.state.lint + var id = ++state.waitingFor + function abort() { + id = -1 + cm.off("change", abort) + } + cm.on("change", abort) + getAnnotations(cm.getValue(), function(annotations, arg2) { + cm.off("change", abort) + if (state.waitingFor != id) return + if (arg2 && annotations instanceof CodeMirror) annotations = arg2 + cm.operation(function() {updateLinting(cm, annotations)}) + }, passOptions, cm); + } + + function startLinting(cm) { + var state = cm.state.lint, options = state.options; + /* + * Passing rules in `options` property prevents JSHint (and other linters) from complaining + * about unrecognized rules like `onUpdateLinting`, `delay`, `lintOnChange`, etc. + */ + var passOptions = options.options || options; + var getAnnotations = options.getAnnotations || cm.getHelper(CodeMirror.Pos(0, 0), "lint"); + if (!getAnnotations) return; + if (options.async || getAnnotations.async) { + lintAsync(cm, getAnnotations, passOptions) + } else { + var annotations = getAnnotations(cm.getValue(), passOptions, cm); + if (!annotations) return; + if (annotations.then) annotations.then(function(issues) { + cm.operation(function() {updateLinting(cm, issues)}) + }); + else cm.operation(function() {updateLinting(cm, annotations)}) + } + } + + function updateLinting(cm, annotationsNotSorted) { + clearMarks(cm); + var state = cm.state.lint, options = state.options; + + var annotations = groupByLine(annotationsNotSorted); + + for (var line = 0; line < annotations.length; ++line) { + var anns = annotations[line]; + if (!anns) continue; + + var maxSeverity = null; + var tipLabel = state.hasGutter && document.createDocumentFragment(); + + for (var i = 0; i < anns.length; ++i) { + var ann = anns[i]; + var severity = ann.severity; + if (!severity) severity = "error"; + maxSeverity = getMaxSeverity(maxSeverity, severity); + + if (options.formatAnnotation) ann = options.formatAnnotation(ann); + if (state.hasGutter) tipLabel.appendChild(annotationTooltip(ann)); + + if (ann.to) state.marked.push(cm.markText(ann.from, ann.to, { + className: "CodeMirror-lint-mark-" + severity, + __annotation: ann + })); + } + + if (state.hasGutter) + cm.setGutterMarker(line, GUTTER_ID, makeMarker(tipLabel, maxSeverity, anns.length > 1, + state.options.tooltips)); + } + if (options.onUpdateLinting) options.onUpdateLinting(annotationsNotSorted, annotations, cm); + } + + function onChange(cm) { + var state = cm.state.lint; + if (!state) return; + clearTimeout(state.timeout); + state.timeout = setTimeout(function(){startLinting(cm);}, state.options.delay || 500); + } + + function popupTooltips(annotations, e) { + var target = e.target || e.srcElement; + var tooltip = document.createDocumentFragment(); + for (var i = 0; i < annotations.length; i++) { + var ann = annotations[i]; + tooltip.appendChild(annotationTooltip(ann)); + } + showTooltipFor(e, tooltip, target); + } + + function onMouseOver(cm, e) { + var target = e.target || e.srcElement; + if (!/\bCodeMirror-lint-mark-/.test(target.className)) return; + var box = target.getBoundingClientRect(), x = (box.left + box.right) / 2, y = (box.top + box.bottom) / 2; + var spans = cm.findMarksAt(cm.coordsChar({left: x, top: y}, "client")); + + var annotations = []; + for (var i = 0; i < spans.length; ++i) { + var ann = spans[i].__annotation; + if (ann) annotations.push(ann); + } + if (annotations.length) popupTooltips(annotations, e); + } + + CodeMirror.defineOption("lint", false, function(cm, val, old) { + if (old && old != CodeMirror.Init) { + clearMarks(cm); + if (cm.state.lint.options.lintOnChange !== false) + cm.off("change", onChange); + CodeMirror.off(cm.getWrapperElement(), "mouseover", cm.state.lint.onMouseOver); + clearTimeout(cm.state.lint.timeout); + delete cm.state.lint; + } + + if (val) { + var gutters = cm.getOption("gutters"), hasLintGutter = false; + for (var i = 0; i < gutters.length; ++i) if (gutters[i] == GUTTER_ID) hasLintGutter = true; + var state = cm.state.lint = new LintState(cm, parseOptions(cm, val), hasLintGutter); + if (state.options.lintOnChange !== false) + cm.on("change", onChange); + if (state.options.tooltips != false && state.options.tooltips != "gutter") + CodeMirror.on(cm.getWrapperElement(), "mouseover", state.onMouseOver); + + startLinting(cm); + } + }); + + CodeMirror.defineExtension("performLint", function() { + if (this.state.lint) startLinting(this); + }); +}); diff --git a/phpMyAdmin/js/vendor/codemirror/addon/runmode/runmode.js b/phpMyAdmin/js/vendor/codemirror/addon/runmode/runmode.js new file mode 100755 index 0000000..eb4cadf --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/addon/runmode/runmode.js @@ -0,0 +1,72 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.runMode = function(string, modespec, callback, options) { + var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); + var ie = /MSIE \d/.test(navigator.userAgent); + var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9); + + if (callback.appendChild) { + var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; + var node = callback, col = 0; + node.innerHTML = ""; + callback = function(text, style) { + if (text == "\n") { + // Emitting LF or CRLF on IE8 or earlier results in an incorrect display. + // Emitting a carriage return makes everything ok. + node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text)); + col = 0; + return; + } + var content = ""; + // replace tabs + for (var pos = 0;;) { + var idx = text.indexOf("\t", pos); + if (idx == -1) { + content += text.slice(pos); + col += text.length - pos; + break; + } else { + col += idx - pos; + content += text.slice(pos, idx); + var size = tabSize - col % tabSize; + col += size; + for (var i = 0; i < size; ++i) content += " "; + pos = idx + 1; + } + } + + if (style) { + var sp = node.appendChild(document.createElement("span")); + sp.className = "cm-" + style.replace(/ +/g, " cm-"); + sp.appendChild(document.createTextNode(content)); + } else { + node.appendChild(document.createTextNode(content)); + } + }; + } + + var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode); + for (var i = 0, e = lines.length; i < e; ++i) { + if (i) callback("\n"); + var stream = new CodeMirror.StringStream(lines[i]); + if (!stream.string && mode.blankLine) mode.blankLine(state); + while (!stream.eol()) { + var style = mode.token(stream, state); + callback(stream.current(), style, i, stream.start, state); + stream.start = stream.pos; + } + } +}; + +}); diff --git a/phpMyAdmin/js/vendor/codemirror/lib/codemirror.css b/phpMyAdmin/js/vendor/codemirror/lib/codemirror.css new file mode 100755 index 0000000..bc910fb --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/lib/codemirror.css @@ -0,0 +1,349 @@ +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; + color: black; + direction: ltr; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre.CodeMirror-line, +.CodeMirror pre.CodeMirror-line-like { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; + white-space: nowrap; +} + +.CodeMirror-guttermarker { color: black; } +.CodeMirror-guttermarker-subtle { color: #999; } + +/* CURSOR */ + +.CodeMirror-cursor { + border-left: 1px solid black; + border-right: none; + width: 0; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.cm-fat-cursor .CodeMirror-cursor { + width: auto; + border: 0 !important; + background: #7e7; +} +.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} +.cm-fat-cursor-mark { + background-color: rgba(20, 255, 20, 0.5); + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; +} +.cm-animate-fat-cursor { + width: auto; + border: 0; + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; + background-color: #7e7; +} +@-moz-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@-webkit-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} + +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror-overwrite .CodeMirror-cursor {} + +.cm-tab { display: inline-block; text-decoration: inherit; } + +.CodeMirror-rulers { + position: absolute; + left: 0; right: 0; top: -50px; bottom: 0; + overflow: hidden; +} +.CodeMirror-ruler { + border-left: 1px solid #ccc; + top: 0; bottom: 0; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.cm-negative {color: #d44;} +.cm-positive {color: #292;} +.cm-header, .cm-strong {font-weight: bold;} +.cm-em {font-style: italic;} +.cm-link {text-decoration: underline;} +.cm-strikethrough {text-decoration: line-through;} + +.cm-s-default .cm-keyword {color: #708;} +.cm-s-default .cm-atom {color: #219;} +.cm-s-default .cm-number {color: #164;} +.cm-s-default .cm-def {color: #00f;} +.cm-s-default .cm-variable, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} +.cm-s-default .cm-comment {color: #a50;} +.cm-s-default .cm-string {color: #a11;} +.cm-s-default .cm-string-2 {color: #f50;} +.cm-s-default .cm-meta {color: #555;} +.cm-s-default .cm-qualifier {color: #555;} +.cm-s-default .cm-builtin {color: #30a;} +.cm-s-default .cm-bracket {color: #997;} +.cm-s-default .cm-tag {color: #170;} +.cm-s-default .cm-attribute {color: #00c;} +.cm-s-default .cm-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +.CodeMirror-composing { border-bottom: 2px solid; } + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} +.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + position: relative; + overflow: hidden; + background: white; +} + +.CodeMirror-scroll { + overflow: scroll !important; /* Things will break if this is overridden */ + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +} +.CodeMirror-sizer { + position: relative; + border-right: 30px solid transparent; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actual scrolling happens, thus preventing shaking and + flickering artifacts. */ +.CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + position: absolute; + z-index: 6; + display: none; +} +.CodeMirror-vscrollbar { + right: 0; top: 0; + overflow-x: hidden; + overflow-y: scroll; +} +.CodeMirror-hscrollbar { + bottom: 0; left: 0; + overflow-y: hidden; + overflow-x: scroll; +} +.CodeMirror-scrollbar-filler { + right: 0; bottom: 0; +} +.CodeMirror-gutter-filler { + left: 0; bottom: 0; +} + +.CodeMirror-gutters { + position: absolute; left: 0; top: 0; + min-height: 100%; + z-index: 3; +} +.CodeMirror-gutter { + white-space: normal; + height: 100%; + display: inline-block; + vertical-align: top; + margin-bottom: -30px; +} +.CodeMirror-gutter-wrapper { + position: absolute; + z-index: 4; + background: none !important; + border: none !important; +} +.CodeMirror-gutter-background { + position: absolute; + top: 0; bottom: 0; + z-index: 4; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} +.CodeMirror-gutter-wrapper ::selection { background-color: transparent } +.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } + +.CodeMirror-lines { + cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ +} +.CodeMirror pre.CodeMirror-line, +.CodeMirror pre.CodeMirror-line-like { + /* Reset some styles that the rest of the page might have set */ + -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; + border-width: 0; + background: transparent; + font-family: inherit; + font-size: inherit; + margin: 0; + white-space: pre; + word-wrap: normal; + line-height: inherit; + color: inherit; + z-index: 2; + position: relative; + overflow: visible; + -webkit-tap-highlight-color: transparent; + -webkit-font-variant-ligatures: contextual; + font-variant-ligatures: contextual; +} +.CodeMirror-wrap pre.CodeMirror-line, +.CodeMirror-wrap pre.CodeMirror-line-like { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + padding: 0.1px; /* Force widget margins to stay inside of the container */ +} + +.CodeMirror-widget {} + +.CodeMirror-rtl pre { direction: rtl; } + +.CodeMirror-code { + outline: none; +} + +/* Force content-box sizing for the elements where we expect it */ +.CodeMirror-scroll, +.CodeMirror-sizer, +.CodeMirror-gutter, +.CodeMirror-gutters, +.CodeMirror-linenumber { + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.CodeMirror-cursor { + position: absolute; + pointer-events: none; +} +.CodeMirror-measure pre { position: static; } + +div.CodeMirror-cursors { + visibility: hidden; + position: relative; + z-index: 3; +} +div.CodeMirror-dragcursors { + visibility: visible; +} + +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } +.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } +.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } + +.cm-searching { + background-color: #ffa; + background-color: rgba(255, 255, 0, .4); +} + +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ +.cm-tab-wrap-hack:after { content: ''; } + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { background: none; } diff --git a/phpMyAdmin/js/vendor/codemirror/lib/codemirror.js b/phpMyAdmin/js/vendor/codemirror/lib/codemirror.js new file mode 100755 index 0000000..076a0b8 --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/lib/codemirror.js @@ -0,0 +1,9765 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +// This is CodeMirror (https://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.CodeMirror = factory()); +}(this, (function () { 'use strict'; + + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + var userAgent = navigator.userAgent; + var platform = navigator.platform; + + var gecko = /gecko\/\d/i.test(userAgent); + var ie_upto10 = /MSIE \d/.test(userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); + var edge = /Edge\/(\d+)/.exec(userAgent); + var ie = ie_upto10 || ie_11up || edge; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); + var webkit = !edge && /WebKit\//.test(userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); + var chrome = !edge && /Chrome\//.test(userAgent); + var presto = /Opera\//.test(userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); + var phantom = /PhantomJS/.test(userAgent); + + var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent); + var android = /Android/.test(userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); + var mac = ios || /Mac/.test(platform); + var chromeOS = /\bCrOS\b/.test(userAgent); + var windows = /win/i.test(platform); + + var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) { presto_version = Number(presto_version[1]); } + if (presto_version && presto_version >= 15) { presto = false; webkit = true; } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || (ie && ie_version >= 9); + + function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } + + var rmClass = function(node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + { e.removeChild(e.firstChild); } + return e + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e) + } + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) { e.className = className; } + if (style) { e.style.cssText = style; } + if (typeof content == "string") { e.appendChild(document.createTextNode(content)); } + else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } } + return e + } + // wrapper for elt, which removes the elt from the accessibility tree + function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style); + e.setAttribute("role", "presentation"); + return e + } + + var range; + if (document.createRange) { range = function(node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r + }; } + else { range = function(node, start, end) { + var r = document.body.createTextRange(); + try { r.moveToElementText(node.parentNode); } + catch(e) { return r } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r + }; } + + function contains(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + { child = child.parentNode; } + if (parent.contains) + { return parent.contains(child) } + do { + if (child.nodeType == 11) { child = child.host; } + if (child == parent) { return true } + } while (child = child.parentNode) + } + + function activeElt() { + // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. + // IE < 10 will throw when accessed while the page is loading or in an iframe. + // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var activeElement; + try { + activeElement = document.activeElement; + } catch(e) { + activeElement = document.body || null; + } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) + { activeElement = activeElement.shadowRoot.activeElement; } + return activeElement + } + + function addClass(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; } + } + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) + { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } } + return b + } + + var selectInput = function(node) { node.select(); }; + if (ios) // Mobile Safari apparently has a bug where select() is broken. + { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; } + else if (ie) // Suppress mysterious IE10 errors + { selectInput = function(node) { try { node.select(); } catch(_e) {} }; } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args)} + } + + function copyObj(obj, target, overwrite) { + if (!target) { target = {}; } + for (var prop in obj) + { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + { target[prop] = obj[prop]; } } + return target + } + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) { end = string.length; } + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) + { return n + (end - i) } + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; + } + } + + var Delayed = function() {this.id = null;}; + Delayed.prototype.set = function (ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; + + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + { if (array[i] == elt) { return i } } + return -1 + } + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = {toString: function(){return "CodeMirror.Pass"}}; + + // Reused option objects for setSelection & friends + var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) { nextTab = string.length; } + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) + { return pos + Math.min(skipped, goal - col) } + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; + if (col >= goal) { return pos } + } + } + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + { spaceStrs.push(lst(spaceStrs) + " "); } + return spaceStrs[n] + } + + function lst(arr) { return arr[arr.length-1] } + + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); } + return out + } + + function insertSorted(array, value, score) { + var pos = 0, priority = score(value); + while (pos < array.length && score(array[pos]) <= priority) { pos++; } + array.splice(pos, 0, value); + } + + function nothing() {} + + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) { copyObj(props, inst); } + return inst + } + + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + function isWordCharBasic(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) + } + function isWordChar(ch, helper) { + if (!helper) { return isWordCharBasic(ch) } + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true } + return helper.test(ch) + } + + function isEmpty(obj) { + for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } } + return true + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; + function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } + + // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. + function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; } + return pos + } + + // Returns the value from the range [`from`; `to`] that satisfies + // `pred` and is closest to `from`. Assumes that at least `to` + // satisfies `pred`. Supports `from` being greater than `to`. + function findFirst(pred, from, to) { + // At any point we are certain `to` satisfies `pred`, don't know + // whether `from` does. + var dir = from > to ? -1 : 1; + for (;;) { + if (from == to) { return from } + var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); + if (mid == from) { return pred(mid) ? from : to } + if (pred(mid)) { to = mid; } + else { from = mid + dir; } + } + } + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) { return f(from, to, "ltr", 0) } + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i); + found = true; + } + } + if (!found) { f(from, to, "ltr"); } + } + + var bidiOther = null; + function getBidiPartAt(order, ch, sticky) { + var found; + bidiOther = null; + for (var i = 0; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < ch && cur.to > ch) { return i } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { found = i; } + else { bidiOther = i; } + } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { found = i; } + else { bidiOther = i; } + } + } + return found != null ? found : bidiOther + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6f9 + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; + function charType(code) { + if (code <= 0xf7) { return lowTypes.charAt(code) } + else if (0x590 <= code && code <= 0x5f4) { return "R" } + else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) } + else if (0x6ee <= code && code <= 0x8ac) { return "r" } + else if (0x2000 <= code && code <= 0x200b) { return "w" } + else if (code == 0x200c) { return "b" } + else { return "L" } + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; this.to = to; + } + + return function(str, direction) { + var outerType = direction == "ltr" ? "L" : "R"; + + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } + var len = str.length, types = []; + for (var i = 0; i < len; ++i) + { types.push(charType(str.charCodeAt(i))); } + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { + var type = types[i$1]; + if (type == "m") { types[i$1] = prev; } + else { prev = type; } + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { + var type$1 = types[i$2]; + if (type$1 == "1" && cur == "r") { types[i$2] = "n"; } + else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R"; } } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { + var type$2 = types[i$3]; + if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1"; } + else if (type$2 == "," && prev$1 == types[i$3+1] && + (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1; } + prev$1 = type$2; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i$4 = 0; i$4 < len; ++i$4) { + var type$3 = types[i$4]; + if (type$3 == ",") { types[i$4] = "N"; } + else if (type$3 == "%") { + var end = (void 0); + for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; + for (var j = i$4; j < end; ++j) { types[j] = replace; } + i$4 = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { + var type$4 = types[i$5]; + if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L"; } + else if (isStrong.test(type$4)) { cur$1 = type$4; } + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i$6 = 0; i$6 < len; ++i$6) { + if (isNeutral.test(types[i$6])) { + var end$1 = (void 0); + for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} + var before = (i$6 ? types[i$6-1] : outerType) == "L"; + var after = (end$1 < len ? types[end$1] : outerType) == "L"; + var replace$1 = before == after ? (before ? "L" : "R") : outerType; + for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; } + i$6 = end$1 - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i$7 = 0; i$7 < len;) { + if (countsAsLeft.test(types[i$7])) { + var start = i$7; + for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} + order.push(new BidiSpan(0, start, i$7)); + } else { + var pos = i$7, at = order.length; + for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} + for (var j$2 = pos; j$2 < i$7;) { + if (countsAsNum.test(types[j$2])) { + if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); } + var nstart = j$2; + for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} + order.splice(at, 0, new BidiSpan(2, nstart, j$2)); + pos = j$2; + } else { ++j$2; } + } + if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); } + } + } + if (direction == "ltr") { + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + } + + return direction == "rtl" ? order.reverse() : order + } + })(); + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line, direction) { + var order = line.order; + if (order == null) { order = line.order = bidiOrdering(line.text, direction); } + return order + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var noHandlers = []; + + var on = function(emitter, type, f) { + if (emitter.addEventListener) { + emitter.addEventListener(type, f, false); + } else if (emitter.attachEvent) { + emitter.attachEvent("on" + type, f); + } else { + var map$$1 = emitter._handlers || (emitter._handlers = {}); + map$$1[type] = (map$$1[type] || noHandlers).concat(f); + } + }; + + function getHandlers(emitter, type) { + return emitter._handlers && emitter._handlers[type] || noHandlers + } + + function off(emitter, type, f) { + if (emitter.removeEventListener) { + emitter.removeEventListener(type, f, false); + } else if (emitter.detachEvent) { + emitter.detachEvent("on" + type, f); + } else { + var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type]; + if (arr) { + var index = indexOf(arr, f); + if (index > -1) + { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); } + } + } + } + + function signal(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type); + if (!handlers.length) { return } + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); } + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; } + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore + } + + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) { return } + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) + { set.push(arr[i]); } } + } + + function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0 + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f);}; + ctor.prototype.off = function(type, f) {off(this, type, f);}; + } + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + function e_preventDefault(e) { + if (e.preventDefault) { e.preventDefault(); } + else { e.returnValue = false; } + } + function e_stopPropagation(e) { + if (e.stopPropagation) { e.stopPropagation(); } + else { e.cancelBubble = true; } + } + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false + } + function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} + + function e_target(e) {return e.target || e.srcElement} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) { b = 1; } + else if (e.button & 2) { b = 3; } + else if (e.button & 4) { b = 2; } + } + if (mac && e.ctrlKey && b == 1) { b = 3; } + return b + } + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) { return false } + var div = elt('div'); + return "draggable" in div || "dragDrop" in div + }(); + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); } + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) { return badBidiRects } + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + var r1 = range(txt, 1, 2).getBoundingClientRect(); + removeChildren(measure); + if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) + return badBidiRects = (r1.right - r0.right < 3) + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) { nl = string.length; } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result + } : function (string) { return string.split(/\r\n?|\n/); }; + + var hasSelection = window.getSelection ? function (te) { + try { return te.selectionStart != te.selectionEnd } + catch(e) { return false } + } : function (te) { + var range$$1; + try {range$$1 = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range$$1 || range$$1.parentElement() != te) { return false } + return range$$1.compareEndPoints("StartToEnd", range$$1) != 0 + }; + + var hasCopyEvent = (function () { + var e = elt("div"); + if ("oncopy" in e) { return true } + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function" + })(); + + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) { return badZoomedRects } + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 + } + + // Known modes, by name and by MIME + var modes = {}, mimeModes = {}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + function defineMode(name, mode) { + if (arguments.length > 2) + { mode.dependencies = Array.prototype.slice.call(arguments, 2); } + modes[name] = mode; + } + + function defineMIME(mime, spec) { + mimeModes[mime] = spec; + } + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + function resolveMode(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") { found = {name: found}; } + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return resolveMode("application/xml") + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return resolveMode("application/json") + } + if (typeof spec == "string") { return {name: spec} } + else { return spec || {name: "null"} } + } + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + function getMode(options, spec) { + spec = resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) { return getMode(options, "text/plain") } + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) { continue } + if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; } + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) { modeObj.helperType = spec.helperType; } + if (spec.modeProps) { for (var prop$1 in spec.modeProps) + { modeObj[prop$1] = spec.modeProps[prop$1]; } } + + return modeObj + } + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = {}; + function extendMode(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); + } + + function copyState(mode, state) { + if (state === true) { return state } + if (mode.copyState) { return mode.copyState(state) } + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) { val = val.concat([]); } + nstate[n] = val; + } + return nstate + } + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + function innerMode(mode, state) { + var info; + while (mode.innerMode) { + info = mode.innerMode(state); + if (!info || info.mode == mode) { break } + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state} + } + + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true + } + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = function(string, tabSize, lineOracle) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + this.lineOracle = lineOracle; + }; + + StringStream.prototype.eol = function () {return this.pos >= this.string.length}; + StringStream.prototype.sol = function () {return this.pos == this.lineStart}; + StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; + StringStream.prototype.next = function () { + if (this.pos < this.string.length) + { return this.string.charAt(this.pos++) } + }; + StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos); + var ok; + if (typeof match == "string") { ok = ch == match; } + else { ok = ch && (match.test ? match.test(ch) : match(ch)); } + if (ok) {++this.pos; return ch} + }; + StringStream.prototype.eatWhile = function (match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start + }; + StringStream.prototype.eatSpace = function () { + var this$1 = this; + + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; } + return this.pos > start + }; + StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;}; + StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true} + }; + StringStream.prototype.backUp = function (n) {this.pos -= n;}; + StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) + }; + StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) + }; + StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) { this.pos += pattern.length; } + return true + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) { return null } + if (match && consume !== false) { this.pos += match[0].length; } + return match + } + }; + StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; + StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n; + try { return inner() } + finally { this.lineStart -= n; } + }; + StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle; + return oracle && oracle.lookAhead(n) + }; + StringStream.prototype.baseToken = function () { + var oracle = this.lineOracle; + return oracle && oracle.baseToken(this.pos) + }; + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } + var chunk = doc; + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break } + n -= sz; + } + } + return chunk.lines[n] + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], n = start.line; + doc.iter(start.line, end.line + 1, function (line) { + var text = line.text; + if (n == end.line) { text = text.slice(0, end.ch); } + if (n == start.line) { text = text.slice(start.ch); } + out.push(text); + ++n; + }); + return out + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value + return out + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } } + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) { return null } + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) { break } + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { + var child = chunk.children[i$1], ch = child.height; + if (h < ch) { chunk = child; continue outer } + h -= ch; + n += child.chunkSize(); + } + return n + } while (!chunk.lines) + var i = 0; + for (; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) { break } + h -= lh; + } + return n + i + } + + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} + + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)) + } + + // A Pos instance represents a position within the text. + function Pos(line, ch, sticky) { + if ( sticky === void 0 ) sticky = null; + + if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } + this.line = line; + this.ch = ch; + this.sticky = sticky; + } + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + function cmp(a, b) { return a.line - b.line || a.ch - b.ch } + + function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } + + function copyPos(x) {return Pos(x.line, x.ch)} + function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } + function minPos(a, b) { return cmp(a, b) < 0 ? a : b } + + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} + function clipPos(doc, pos) { + if (pos.line < doc.first) { return Pos(doc.first, 0) } + var last = doc.first + doc.size - 1; + if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } + return clipToLen(pos, getLine(doc, pos.line).text.length) + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } + else if (ch < 0) { return Pos(pos.line, 0) } + else { return pos } + } + function clipPosArray(doc, array) { + var out = []; + for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); } + return out + } + + var SavedContext = function(state, lookAhead) { + this.state = state; + this.lookAhead = lookAhead; + }; + + var Context = function(doc, state, line, lookAhead) { + this.state = state; + this.doc = doc; + this.line = line; + this.maxLookAhead = lookAhead || 0; + this.baseTokens = null; + this.baseTokenPos = 1; + }; + + Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n); + if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; } + return line + }; + + Context.prototype.baseToken = function (n) { + var this$1 = this; + + if (!this.baseTokens) { return null } + while (this.baseTokens[this.baseTokenPos] <= n) + { this$1.baseTokenPos += 2; } + var type = this.baseTokens[this.baseTokenPos + 1]; + return {type: type && type.replace(/( |^)overlay .*/, ""), + size: this.baseTokens[this.baseTokenPos] - n} + }; + + Context.prototype.nextLine = function () { + this.line++; + if (this.maxLookAhead > 0) { this.maxLookAhead--; } + }; + + Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) + { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } + else + { return new Context(doc, copyState(doc.mode, saved), line) } + }; + + Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state + }; + + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, context, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, + lineClasses, forceToEnd); + var state = context.state; + + // Run overlays, adjust style array. + var loop = function ( o ) { + context.baseTokens = st; + var overlay = cm.state.overlays[o], i = 1, at = 0; + context.state = true; + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) + { st.splice(i, 1, end, st[i+1], i_end); } + i += 2; + at = Math.min(end, i_end); + } + if (!style) { return } + if (overlay.opaque) { + st.splice(start, i - start, end, "overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start+1]; + st[start+1] = (cur ? cur + " " : "") + "overlay " + style; + } + } + }, lineClasses); + context.state = state; + context.baseTokens = null; + context.baseTokenPos = 1; + }; + + for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} + } + + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var context = getContextBefore(cm, lineNo(line)); + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); + var result = highlightLine(cm, line, context); + if (resetState) { context.state = resetState; } + line.stateAfter = context.save(!resetState); + line.styles = result.styles; + if (result.classes) { line.styleClasses = result.classes; } + else if (line.styleClasses) { line.styleClasses = null; } + if (updateFrontier === cm.doc.highlightFrontier) + { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); } + } + return line.styles + } + + function getContextBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) { return new Context(doc, true, n) } + var start = findStartLine(cm, n, precise); + var saved = start > doc.first && getLine(doc, start - 1).stateAfter; + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); + + doc.iter(start, n, function (line) { + processLine(cm, line.text, context); + var pos = context.line; + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; + context.nextLine(); + }); + if (precise) { doc.modeFrontier = context.line; } + return context + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize, context); + stream.start = stream.pos = startAt || 0; + if (text == "") { callBlankLine(mode, context.state); } + while (!stream.eol()) { + readToken(mode, stream, context.state); + stream.start = stream.pos; + } + } + + function callBlankLine(mode, state) { + if (mode.blankLine) { return mode.blankLine(state) } + if (!mode.innerMode) { return } + var inner = innerMode(mode, state); + if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } + } + + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) { inner[0] = innerMode(mode, state).mode; } + var style = mode.token(stream, state); + if (stream.pos > stream.start) { return style } + } + throw new Error("Mode " + mode.name + " failed to advance stream.") + } + + var Token = function(stream, type, state) { + this.start = stream.start; this.end = stream.pos; + this.string = stream.current(); + this.type = type || null; + this.state = state; + }; + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + var doc = cm.doc, mode = doc.mode, style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize, context), tokens; + if (asArray) { tokens = []; } + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, context.state); + if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); } + } + return asArray ? tokens : new Token(stream, style, context.state) + } + + function extractLineClasses(type, output) { + if (type) { for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) { break } + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) + { output[prop] = lineClass[2]; } + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + { output[prop] += " " + lineClass[2]; } + } } + return type + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; } + var curStart = 0, curStyle = null; + var stream = new StringStream(text, cm.options.tabSize, context), style; + var inner = cm.options.addModeClass && [null]; + if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); } + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) { processLine(cm, text, context, stream.pos); } + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) { style = "m-" + (style ? mName + " " + style : mName); } + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 5000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000); + f(pos, curStyle); + curStart = pos; + } + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) { return doc.first } + var line = getLine(doc, search - 1), after = line.stateAfter; + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) + { return search } + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline + } + + function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n); + if (doc.highlightFrontier < n - 10) { return } + var start = doc.first; + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter; + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1; + break + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start); + } + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false, sawCollapsedSpans = false; + + function seeReadOnlySpans() { + sawReadOnlySpans = true; + } + + function seeCollapsedSpans() { + sawCollapsedSpans = true; + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) { return span } + } } + } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + var r; + for (var i = 0; i < spans.length; ++i) + { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } } + return r + } + // Add a span to a line. + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + var nw; + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } } + return nw + } + function markedSpansAfter(old, endCh, isInsert) { + var nw; + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); + } + } } + return nw + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) { return null } + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) { return null } + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) { span.to = startCh; } + else if (sameLine) { span.to = found.to == null ? null : found.to + offset; } + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i$1 = 0; i$1 < last.length; ++i$1) { + var span$1 = last[i$1]; + if (span$1.to != null) { span$1.to += offset; } + if (span$1.from == null) { + var found$1 = getMarkedSpanFor(first, span$1.marker); + if (!found$1) { + span$1.from = offset; + if (sameLine) { (first || (first = [])).push(span$1); } + } + } else { + span$1.from += offset; + if (sameLine) { (first || (first = [])).push(span$1); } + } + } + } + // Make sure we didn't create any zero-length spans + if (first) { first = clearEmptySpans(first); } + if (last && last != first) { last = clearEmptySpans(last); } + + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers; + if (gap > 0 && first) + { for (var i$2 = 0; i$2 < first.length; ++i$2) + { if (first[i$2].to == null) + { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } } + for (var i$3 = 0; i$3 < gap; ++i$3) + { newMarkers.push(gapMarkers); } + newMarkers.push(last); + } + return newMarkers + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + { spans.splice(i--, 1); } + } + if (!spans.length) { return null } + return spans + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function (line) { + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + { (markers || (markers = [])).push(mark); } + } } + }); + if (!markers) { return null } + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + { newParts.push({from: p.from, to: m.from}); } + if (dto > 0 || !mk.inclusiveRight && !dto) + { newParts.push({from: m.to, to: p.to}); } + parts.splice.apply(parts, newParts); + j += newParts.length - 3; + } + } + return parts + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.detachLine(line); } + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.attachLine(line); } + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 } + function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) { return lenDiff } + var aPos = a.find(), bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) { return -fromCmp } + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) { return toCmp } + return b.id - a.id + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + { found = sp.marker; } + } } + return found + } + function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } + function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } + + function collapsedSpanAround(line, ch) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; } + } } + return found + } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) { + var line = getLine(doc, lineNo$$1); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) { continue } + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || + fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) + { return true } + } } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + { line = merged.find(-1, true).line; } + return line + } + + function visualLineEnd(line) { + var merged; + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line; } + return line + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line + ;(lines || (lines = [])).push(line); + } + return lines + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line); + if (line == vis) { return lineN } + return lineNo(vis) + } + + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) { return lineN } + var line = getLine(doc, lineN), merged; + if (!lineIsHidden(doc, line)) { return lineN } + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line; } + return lineNo(line) + 1 + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) { continue } + if (sp.from == null) { return true } + if (sp.marker.widgetNode) { continue } + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + { return true } + } } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) + } + if (span.marker.inclusiveRight && span.to == line.text.length) + { return true } + for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) { return true } + } + } + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) { break } + else { h += line.height; } + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i$1 = 0; i$1 < p.children.length; ++i$1) { + var cur = p.children[i$1]; + if (cur == chunk) { break } + else { h += cur.height; } + } + } + return h + } + + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) { return 0 } + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found$1 = merged.find(0, true); + len -= cur.text.length - found$1.from.ch; + cur = found$1.to.line; + len += cur.text.length - found$1.to.ch; + } + return len + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function (line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = function(text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + + Line.prototype.lineNo = function () { return lineNo(this) }; + eventMixin(Line); + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) { line.stateAfter = null; } + if (line.styles) { line.styles = null; } + if (line.order != null) { line.order = null; } + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) { updateLineHeight(line, estHeight); } + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}, styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) { return null } + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")) + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, + col: 0, pos: 0, cm: cm, + trailingSpace: false, + splitSpaces: cm.getOption("lineWrapping")}; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0); + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) + { builder.addToken = buildTokenBadBidi(builder.addToken, order); } + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) + { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); } + if (line.styleClasses.textClass) + { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); } + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); } + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) + ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild; + if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) + { builder.content.className = "cm-tab-wrap-hack"; } + } + + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) + { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); } + + return builder + } + + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, css, attributes) { + if (!text) { return } + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; + var special = builder.cm.state.specialChars, mustWrap = false; + var content; + if (!special.test(text)) { + builder.col += text.length; + content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) { mustWrap = true; } + builder.pos += text.length; + } else { + content = document.createDocumentFragment(); + var pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); } + else { content.appendChild(txt); } + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) { break } + pos += skipped + 1; + var txt$1 = (void 0); + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt$1.setAttribute("role", "presentation"); + txt$1.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else if (m[0] == "\r" || m[0] == "\n") { + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); + txt$1.setAttribute("cm-text", m[0]); + builder.col += 1; + } else { + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); + txt$1.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); } + else { content.appendChild(txt$1); } + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt$1); + builder.pos++; + } + } + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || ""; + if (startStyle) { fullStyle += startStyle; } + if (endStyle) { fullStyle += endStyle; } + var token = elt("span", [content], fullStyle, css); + if (attributes) { + for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class") + { token.setAttribute(attr, attributes[attr]); } } + } + return builder.content.appendChild(token) + } + builder.content.appendChild(content); + } + + // Change some spaces to NBSP to prevent the browser from collapsing + // trailing spaces at the end of a line when rendering text (issue #1362). + function splitSpaces(text, trailingBefore) { + if (text.length > 1 && !/ /.test(text)) { return text } + var spaceBefore = trailingBefore, result = ""; + for (var i = 0; i < text.length; i++) { + var ch = text.charAt(i); + if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) + { ch = "\u00a0"; } + result += ch; + spaceBefore = ch == " "; + } + return result + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function (builder, text, style, startStyle, endStyle, css, attributes) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + var part = (void 0); + for (var i = 0; i < order.length; i++) { + part = order[i]; + if (part.to > start && part.from <= start) { break } + } + if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) } + inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + } + } + + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); } + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + { widget = builder.content.appendChild(document.createElement("span")); } + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + builder.trailingSpace = false; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0; + if (!spans) { + for (var i$1 = 1; i$1 < styles.length; i$1+=2) + { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); } + return + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = css = ""; + attributes = null; + collapsed = null; nextChange = Infinity; + var foundBookmarks = [], endStyles = (void 0); + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) { spanStyle += " " + m.className; } + if (m.css) { css = (css ? css + ";" : "") + m.css; } + if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } + if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } + // support for the old title property + // https://github.com/codemirror/CodeMirror/pull/5673 + if (m.title) { (attributes || (attributes = {})).title = m.title; } + if (m.attributes) { + for (var attr in m.attributes) + { (attributes || (attributes = {}))[attr] = m.attributes[attr]; } + } + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + { collapsed = sp; } + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) + { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } } + + if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) + { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null); + if (collapsed.to == null) { return } + if (collapsed.to == pos) { collapsed = false; } + } + } + if (pos >= len) { break } + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array + } + + var operationGroup = null; + + function pushOperation(op) { + if (operationGroup) { + operationGroup.ops.push(op); + } else { + op.ownsGroup = operationGroup = { + ops: [op], + delayedCallbacks: [] + }; + } + } + + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0; + do { + for (; i < callbacks.length; i++) + { callbacks[i].call(null); } + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) + { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } } + } + } while (i < callbacks.length) + } + + function finishOperation(op, endCb) { + var group = op.ownsGroup; + if (!group) { return } + + try { fireCallbacksForOps(group); } + finally { + operationGroup = null; + endCb(group); + } + } + + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type); + if (!arr.length) { return } + var args = Array.prototype.slice.call(arguments, 2), list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + var loop = function ( i ) { + list.push(function () { return arr[i].apply(null, args); }); + }; + + for (var i = 0; i < arr.length; ++i) + loop( i ); + } + + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) { delayed[i](); } + } + + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") { updateLineText(cm, lineView); } + else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); } + else if (type == "class") { updateLineClasses(cm, lineView); } + else if (type == "widget") { updateLineWidgets(cm, lineView, dims); } + } + lineView.changes = null; + } + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) + { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); } + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; } + } + return lineView.node + } + + function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) { cls += " CodeMirror-linebackground"; } + if (lineView.background) { + if (cls) { lineView.background.className = cls; } + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + cm.display.input.setUneditable(lineView.background); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built + } + return buildLineContent(cm, lineView) + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) { lineView.node = built.pre; } + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(cm, lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + + function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView); + if (lineView.line.wrapClass) + { ensureLineWrapped(lineView).className = lineView.line.wrapClass; } + else if (lineView.node != lineView.text) + { lineView.node.className = ""; } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground); + lineView.gutterBackground = null; + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView); + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, + ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")); + cm.display.input.setUneditable(lineView.gutterBackground); + wrap.insertBefore(lineView.gutterBackground, lineView.text); + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap$1 = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")); + cm.display.input.setUneditable(gutterWrap); + wrap$1.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) + { gutterWrap.className += " " + lineView.line.gutterClass; } + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + { lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))); } + if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) { + var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id]; + if (found) + { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))); } + } } + } + } + + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) { lineView.alignable = null; } + for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { + next = node.nextSibling; + if (node.className == "CodeMirror-linewidget") + { lineView.node.removeChild(node); } + } + insertLineWidgets(cm, lineView, dims); + } + + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) { lineView.bgClass = built.bgClass; } + if (built.textClass) { lineView.textClass = built.textClass; } + + updateLineClasses(cm, lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node + } + + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } } + } + + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) { return } + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); + if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true"); } + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) + { wrap.insertBefore(node, lineView.gutter || lineView.text); } + else + { wrap.appendChild(node); } + signalLater(widget, "redraw"); + } + } + + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px"; } + } + } + + function widgetHeight(widget) { + if (widget.height != null) { return widget.height } + var cm = widget.doc.cm; + if (!cm) { return 0 } + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; } + if (widget.noHScroll) + { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.parentNode.offsetHeight + } + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + { return true } + } + } + + // POSITION MEASUREMENT + + function paddingTop(display) {return display.lineSpace.offsetTop} + function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} + function paddingH(display) { + if (display.cachedPaddingH) { return display.cachedPaddingH } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; } + return data + } + + function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) + { heights.push((cur.bottom + next.top) / 2 - rect.top); } + } + } + heights.push(rect.bottom - rect.top); + } + } + + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + { return {map: lineView.measure.map, cache: lineView.measure.cache} } + for (var i = 0; i < lineView.rest.length; i++) + { if (lineView.rest[i] == line) + { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } + for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) + { if (lineNo(lineView.rest[i$1]) > lineN) + { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } + } + + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view + } + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias) + } + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + { return cm.display.view[findViewIndex(cm, lineN)] } + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + { return ext } + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) { + view = null; + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + cm.curOp.forceUpdate = true; + } + if (!view) + { view = updateExternalMeasurement(cm, line); } + + var info = mapFromLineView(view, line, lineN); + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + } + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) { ch = -1; } + var key = ch + (bias || ""), found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) + { prepared.rect = prepared.view.text.getBoundingClientRect(); } + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) { prepared.cache[key] = found; } + } + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom} + } + + var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; + + function nodeAndOffsetInLineMap(map$$1, ch, bias) { + var node, start, end, collapse, mStart, mEnd; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map$$1.length; i += 3) { + mStart = map$$1[i]; + mEnd = map$$1[i + 1]; + if (ch < mStart) { + start = 0; end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) { collapse = "right"; } + } + if (start != null) { + node = map$$1[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + { collapse = bias; } + if (bias == "left" && start == 0) + { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) { + node = map$$1[(i -= 3) + 2]; + collapse = "left"; + } } + if (bias == "right" && start == mEnd - mStart) + { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) { + node = map$$1[(i += 3) + 2]; + collapse = "right"; + } } + break + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd} + } + + function getUsefulRect(rects, bias) { + var rect = nullRect; + if (bias == "left") { for (var i = 0; i < rects.length; i++) { + if ((rect = rects[i]).left != rect.right) { break } + } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { + if ((rect = rects[i$1]).left != rect.right) { break } + } } + return rect + } + + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, start = place.start, end = place.end, collapse = place.collapse; + + var rect; + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; } + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) + { rect = node.parentNode.getBoundingClientRect(); } + else + { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); } + if (rect.left || rect.right || start == 0) { break } + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); } + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) { collapse = bias = "right"; } + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + { rect = rects[bias == "right" ? rects.length - 1 : 0]; } + else + { rect = node.getBoundingClientRect(); } + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) + { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; } + else + { rect = nullRect; } + } + + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + var i = 0; + for (; i < heights.length - 1; i++) + { if (mid < heights[i]) { break } } + var top = i ? heights[i - 1] : 0, bot = heights[i]; + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot}; + if (!rect.left && !rect.right) { result.bogus = true; } + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } + + return result + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + { return rect } + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY} + } + + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { lineView.measure.caches[i] = {}; } } + } + } + + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) + { clearLineMeasurementCacheFor(cm.display.view[i]); } + } + + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; } + cm.display.lineNumChars = null; + } + + function pageScrollX() { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) } + return window.pageXOffset || (document.documentElement || document.body).scrollLeft + } + function pageScrollY() { + if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) } + return window.pageYOffset || (document.documentElement || document.body).scrollTop + } + + function widgetTopHeight(lineObj) { + var height = 0; + if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) + { height += widgetHeight(lineObj.widgets[i]); } } } + return height + } + + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"./null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { + if (!includeWidgets) { + var height = widgetTopHeight(lineObj); + rect.top += height; rect.bottom += height; + } + if (context == "line") { return rect } + if (!context) { context = "local"; } + var yOff = heightAtLine(lineObj); + if (context == "local") { yOff += paddingTop(cm.display); } + else { yOff -= cm.display.viewOffset; } + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect + } + + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"./null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") { return coords } + var left = coords.left, top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} + } + + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) { lineObj = getLine(cm.doc, pos.line); } + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + // A cursor Pos(line, char, "before") is on the same visual line as `char - 1` + // and after `char - 1` in writing order of `char - 1` + // A cursor Pos(line, char, "after") is on the same visual line as `char` + // and before `char` in writing order of `char` + // Examples (upper-case letters are RTL, lower-case are LTR): + // Pos(0, 1, ...) + // before after + // ab a|b a|b + // aB a|B aB| + // Ab |Ab A|b + // AB B|A B|A + // Every position after the last character on a line is considered to stick + // to the last character on the line. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) { m.left = m.right; } else { m.right = m.left; } + return intoCoordSystem(cm, lineObj, m, context) + } + var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky; + if (ch >= lineObj.text.length) { + ch = lineObj.text.length; + sticky = "before"; + } else if (ch <= 0) { + ch = 0; + sticky = "after"; + } + if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } + + function getBidi(ch, partPos, invert) { + var part = order[partPos], right = part.level == 1; + return get(invert ? ch - 1 : ch, right != invert) + } + var partPos = getBidiPartAt(order, ch, sticky); + var other = bidiOther; + var val = getBidi(ch, partPos, sticky == "before"); + if (other != null) { val.other = getBidi(ch, other, sticky != "before"); } + return val + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0; + pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; } + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return {left: left, right: left, top: top, bottom: top + lineObj.height} + } + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky); + pos.xRel = xRel; + if (outside) { pos.outside = outside; } + return pos + } + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) } + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineN > last) + { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) } + if (x < 0) { x = 0; } + + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0)); + if (!collapsed) { return found } + var rangeEnd = collapsed.find(1); + if (rangeEnd.line == lineN) { return rangeEnd } + lineObj = getLine(doc, lineN = rangeEnd.line); + } + } + + function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + y -= widgetTopHeight(lineObj); + var end = lineObj.text.length; + var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0); + end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end); + return {begin: begin, end: end} + } + + function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) + } + + // Returns true if the given side of a box is after the given + // coordinates, in top-to-bottom, left-to-right order. + function boxIsAfter(box, x, y, left) { + return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x + } + + function coordsCharInner(cm, lineObj, lineNo$$1, x, y) { + // Move y into line-local coordinate space + y -= heightAtLine(lineObj); + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + // When directly calling `measureCharPrepared`, we have to adjust + // for the widgets at this line. + var widgetHeight$$1 = widgetTopHeight(lineObj); + var begin = 0, end = lineObj.text.length, ltr = true; + + var order = getOrder(lineObj, cm.doc.direction); + // If the line isn't plain left-to-right text, first figure out + // which bidi section the coordinates fall into. + if (order) { + var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) + (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y); + ltr = part.level != 1; + // The awkward -1 offsets are needed because findFirst (called + // on these below) will treat its first bound as inclusive, + // second as exclusive, but we want to actually address the + // characters in the part's range + begin = ltr ? part.from : part.to - 1; + end = ltr ? part.to : part.from - 1; + } + + // A binary search to find the first character whose bounding box + // starts after the coordinates. If we run across any whose box wrap + // the coordinates, store that. + var chAround = null, boxAround = null; + var ch = findFirst(function (ch) { + var box = measureCharPrepared(cm, preparedMeasure, ch); + box.top += widgetHeight$$1; box.bottom += widgetHeight$$1; + if (!boxIsAfter(box, x, y, false)) { return false } + if (box.top <= y && box.left <= x) { + chAround = ch; + boxAround = box; + } + return true + }, begin, end); + + var baseX, sticky, outside = false; + // If a box around the coordinates was found, use that + if (boxAround) { + // Distinguish coordinates nearer to the left or right side of the box + var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr; + ch = chAround + (atStart ? 0 : 1); + sticky = atStart ? "after" : "before"; + baseX = atLeft ? boxAround.left : boxAround.right; + } else { + // (Adjust for extended bound, if necessary.) + if (!ltr && (ch == end || ch == begin)) { ch++; } + // To determine which side to associate with, get the box to the + // left of the character and compare it's vertical position to the + // coordinates + sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : + (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ? + "after" : "before"; + // Now get accurate coordinates for this place, in order to get a + // base X position + var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), "line", lineObj, preparedMeasure); + baseX = coords.left; + outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0; + } + + ch = skipExtendingChars(lineObj.text, ch, 1); + return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX) + } + + function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) { + // Bidi parts are sorted left-to-right, and in a non-line-wrapping + // situation, we can take this ordering to correspond to the visual + // ordering. This finds the first part whose end is after the given + // coordinates. + var index = findFirst(function (i) { + var part = order[i], ltr = part.level != 1; + return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? "before" : "after"), + "line", lineObj, preparedMeasure), x, y, true) + }, 0, order.length - 1); + var part = order[index]; + // If this isn't the first part, the part's start is also after + // the coordinates, and the coordinates aren't on the same line as + // that start, move one part back. + if (index > 0) { + var ltr = part.level != 1; + var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? "after" : "before"), + "line", lineObj, preparedMeasure); + if (boxIsAfter(start, x, y, true) && start.top > y) + { part = order[index - 1]; } + } + return part + } + + function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { + // In a wrapped line, rtl text on wrapping boundaries can do things + // that don't correspond to the ordering in our `order` array at + // all, so a binary search doesn't work, and we want to return a + // part that only spans one line so that the binary search in + // coordsCharInner is safe. As such, we first find the extent of the + // wrapped line, and then do a flat search in which we discard any + // spans that aren't on the line. + var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); + var begin = ref.begin; + var end = ref.end; + if (/\s/.test(lineObj.text.charAt(end - 1))) { end--; } + var part = null, closestDist = null; + for (var i = 0; i < order.length; i++) { + var p = order[i]; + if (p.from >= end || p.to <= begin) { continue } + var ltr = p.level != 1; + var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; + // Weigh against spans ending before this, so that they are only + // picked if nothing ends after + var dist = endX < x ? x - endX + 1e9 : endX - x; + if (!part || closestDist > dist) { + part = p; + closestDist = dist; + } + } + if (!part) { part = order[order.length - 1]; } + // Clip the part to the wrapped line. + if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; } + if (part.to > end) { part = {from: part.from, to: end, level: part.level}; } + return part + } + + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) { return display.cachedTextHeight } + if (measureText == null) { + measureText = elt("pre", null, "CodeMirror-line-like"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) { display.cachedTextHeight = height; } + removeChildren(display.measure); + return height || 1 + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) { return display.cachedCharWidth } + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor], "CodeMirror-line-like"); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; + if (width > 2) { display.cachedCharWidth = width; } + return width || 10 + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + var id = cm.display.gutterSpecs[i].className; + left[id] = n.offsetLeft + n.clientLeft + gutterLeft; + width[id] = n.clientWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth} + } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left + } + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function (line) { + if (lineIsHidden(cm.doc, line)) { return 0 } + + var widgetsHeight = 0; + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; } + } } + + if (wrapping) + { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } + else + { return widgetsHeight + th } + } + } + + function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm); + doc.iter(function (line) { + var estHeight = est(line); + if (estHeight != line.height) { updateLineHeight(line, estHeight); } + }); + } + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } + + var x, y, space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top; } + catch (e) { return null } + var coords = coordsChar(cm, x, y), line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords + } + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) { return null } + n -= cm.display.viewFrom; + if (n < 0) { return null } + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) { return i } + } + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) { from = cm.doc.first; } + if (to == null) { to = cm.doc.first + cm.doc.size; } + if (!lendiff) { lendiff = 0; } + + var display = cm.display; + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + { display.updateLineNumbers = from; } + + cm.curOp.viewChanged = true; + + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + { resetView(cm); } + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut$1 = viewCuttingPoint(cm, from, from, -1); + if (cut$1) { + display.view = display.view.slice(0, cut$1.index); + display.viewTo = cut$1.lineN; + } else { + resetView(cm); + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) + { ext.lineN += lendiff; } + else if (from < ext.lineN + ext.size) + { display.externalMeasured = null; } + } + } + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + { display.externalMeasured = null; } + + if (line < display.viewFrom || line >= display.viewTo) { return } + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) { return } + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) { arr.push(type); } + } + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + { return {index: index, lineN: newN} } + var n = cm.display.viewFrom; + for (var i = 0; i < index; i++) + { n += view[i].size; } + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) { return null } + diff = (n + view[index].size) - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) { return null } + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return {index: index, lineN: newN} + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) + { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); } + else if (display.viewFrom < from) + { display.view = display.view.slice(findViewIndex(cm, from)); } + display.viewFrom = from; + if (display.viewTo < to) + { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); } + else if (display.viewTo > to) + { display.view = display.view.slice(0, findViewIndex(cm, to)); } + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; } + } + return dirty + } + + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + + function prepareSelection(cm, primary) { + if ( primary === void 0 ) primary = true; + + var doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (!primary && i == doc.sel.primIndex) { continue } + var range$$1 = doc.sel.ranges[i]; + if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue } + var collapsed = range$$1.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) + { drawSelectionCursor(cm, range$$1.head, curFragment); } + if (!collapsed) + { drawSelectionRange(cm, range$$1, selFragment); } + } + return result + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + + function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range$$1, output) { + var display = cm.display, doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + var docLTR = doc.direction == "ltr"; + + function add(left, top, width, bottom) { + if (top < 0) { top = 0; } + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))); + } + + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias) + } + + function wrapX(pos, dir, side) { + var extent = wrappedLineExtentChar(cm, lineObj, null, pos); + var prop = (dir == "ltr") == (side == "after") ? "left" : "right"; + var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); + return coords(ch, prop)[prop] + } + + var order = getOrder(lineObj, doc.direction); + iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { + var ltr = dir == "ltr"; + var fromPos = coords(from, ltr ? "left" : "right"); + var toPos = coords(to - 1, ltr ? "right" : "left"); + + var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen; + var first = i == 0, last = !order || i == order.length - 1; + if (toPos.top - fromPos.top <= 3) { // Single line + var openLeft = (docLTR ? openStart : openEnd) && first; + var openRight = (docLTR ? openEnd : openStart) && last; + var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; + var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; + add(left, fromPos.top, right - left, fromPos.bottom); + } else { // Multiple lines + var topLeft, topRight, botLeft, botRight; + if (ltr) { + topLeft = docLTR && openStart && first ? leftSide : fromPos.left; + topRight = docLTR ? rightSide : wrapX(from, dir, "before"); + botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); + botRight = docLTR && openEnd && last ? rightSide : toPos.right; + } else { + topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); + topRight = !docLTR && openStart && first ? rightSide : fromPos.right; + botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; + botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); + } + add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); + if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); } + add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); + } + + if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; } + if (cmpCoords(toPos, start) < 0) { start = toPos; } + if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; } + if (cmpCoords(toPos, end) < 0) { end = toPos; } + }); + return {start: start, end: end} + } + + var sFrom = range$$1.from(), sTo = range$$1.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) + { add(leftSide, leftEnd.bottom, null, rightStart.top); } + } + + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) { return } + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) + { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; }, + cm.options.cursorBlinkRate); } + else if (cm.options.cursorBlinkRate < 0) + { display.cursorDiv.style.visibility = "hidden"; } + } + + function ensureFocus(cm) { + if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } + } + + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function () { if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + onBlur(cm); + } }, 100); + } + + function onFocus(cm, e) { + if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; } + + if (cm.options.readOnly == "nocursor") { return } + if (!cm.state.focused) { + signal(cm, "focus", cm, e); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm, e) { + if (cm.state.delayingBlurEvent) { return } + + if (cm.state.focused) { + signal(cm, "blur", cm, e); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150); + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], wrapping = cm.options.lineWrapping; + var height = (void 0), width = 0; + if (cur.hidden) { continue } + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + // Check that lines don't extend past the right of the current + // editor width + if (!wrapping && cur.text.firstChild) + { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; } + } + var diff = cur.line.height - height; + if (diff > .005 || diff < -.005) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) + { updateWidgetHeight(cur.rest[j]); } } + } + if (width > cm.display.sizerWidth) { + var chWidth = Math.ceil(width / charWidth(cm.display)); + if (chWidth > cm.display.maxLineLength) { + cm.display.maxLineLength = chWidth; + cm.display.maxLine = cur.line; + cm.display.maxLineChanged = true; + } + } + } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { + var w = line.widgets[i], parent = w.node.parentNode; + if (parent) { w.height = parent.offsetHeight; } + } } + } + + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return {from: from, to: Math.max(to, from + 1)} + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + if (rect.top + box.top < 0) { doScroll = true; } + else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { margin = 0; } + var rect; + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; + } + for (var limit = 0; limit < 5; limit++) { + var changed = false; + var coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + rect = {left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin}; + var scrollPos = calculateScrollPos(cm, rect); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; } + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; } + } + if (!changed) { break } + } + return rect + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect); + if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); } + if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); } + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, rect) { + var display = cm.display, snapMargin = textHeight(cm.display); + if (rect.top < 0) { rect.top = 0; } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), result = {}; + if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; } + var docBottom = cm.doc.height + paddingVert(display); + var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin; + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top; + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); + if (newTop != screentop) { result.scrollTop = newTop; } + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = rect.right - rect.left > screenw; + if (tooWide) { rect.right = rect.left + screenw; } + if (rect.left < 10) + { result.scrollLeft = 0; } + else if (rect.left < screenleft) + { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); } + else if (rect.right > screenw + screenleft - 3) + { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } + return result + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollTop(cm, top) { + if (top == null) { return } + resolveScrollToPos(cm); + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(); + cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}; + } + + function scrollToCoords(cm, x, y) { + if (x != null || y != null) { resolveScrollToPos(cm); } + if (x != null) { cm.curOp.scrollLeft = x; } + if (y != null) { cm.curOp.scrollTop = y; } + } + + function scrollToRange(cm, range$$1) { + resolveScrollToPos(cm); + cm.curOp.scrollToPos = range$$1; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range$$1 = cm.curOp.scrollToPos; + if (range$$1) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to); + scrollToCoordsRange(cm, from, to, range$$1.margin); + } + } + + function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }); + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); + } + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { return } + if (!gecko) { updateDisplaySimple(cm, {top: val}); } + setScrollTop(cm, val, true); + if (gecko) { updateDisplaySimple(cm); } + startWorker(cm, 100); + } + + function setScrollTop(cm, val, forceScroll) { + val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val); + if (cm.display.scroller.scrollTop == val && !forceScroll) { return } + cm.doc.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; } + } + + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; } + cm.display.scrollbars.setScrollLeft(val); + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + } + } + + var NativeScrollbars = function(place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + vert.tabIndex = horiz.tabIndex = -1; + place(vert); place(horiz); + + on(vert, "scroll", function () { + if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); } + }); + on(horiz, "scroll", function () { + if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); } + }); + + this.checkedZeroWidth = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; } + }; + + NativeScrollbars.prototype.update = function (measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; + + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } + + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = + Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } + + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) { this.zeroWidthHack(); } + this.checkedZeroWidth = true; + } + + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} + }; + + NativeScrollbars.prototype.setScrollLeft = function (pos) { + if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; } + if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); } + }; + + NativeScrollbars.prototype.setScrollTop = function (pos) { + if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; } + if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); } + }; + + NativeScrollbars.prototype.zeroWidthHack = function () { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.height = this.vert.style.width = w; + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; + this.disableHoriz = new Delayed; + this.disableVert = new Delayed; + }; + + NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { + bar.style.pointerEvents = "auto"; + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // right corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect(); + var elt$$1 = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) + : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); + if (elt$$1 != bar) { bar.style.pointerEvents = "none"; } + else { delay.set(1000, maybeDisable); } + } + delay.set(1000, maybeDisable); + }; + + NativeScrollbars.prototype.clear = function () { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + }; + + var NullScrollbars = function () {}; + + NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} }; + NullScrollbars.prototype.setScrollLeft = function () {}; + NullScrollbars.prototype.setScrollTop = function () {}; + NullScrollbars.prototype.clear = function () {}; + + function updateScrollbars(cm, measure) { + if (!measure) { measure = measureForScrollbars(cm); } + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + { updateHeightsInViewport(cm); } + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; + } + } + + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); + + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; + + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else { d.scrollbarFiller.style.display = ""; } + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else { d.gutterFiller.style.display = ""; } + } + + var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; + + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) + { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); } + } + + cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function () { + if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); } + }); + node.setAttribute("cm-not-content", "true"); + }, function (pos, axis) { + if (axis == "horizontal") { setScrollLeft(cm, pos); } + else { updateScrollTop(cm, pos); } + }, cm); + if (cm.display.scrollbars.addClass) + { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); } + } + + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. + + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: 0, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + }; + pushOperation(cm.curOp); + } + + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp; + if (op) { finishOperation(op, function (group) { + for (var i = 0; i < group.ops.length; i++) + { group.ops[i].cm.curOp = null; } + endOperations(group); + }); } + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) // Read DOM + { endOperation_R1(ops[i]); } + for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) + { endOperation_W1(ops[i$1]); } + for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM + { endOperation_R2(ops[i$2]); } + for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) + { endOperation_W2(ops[i$3]); } + for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM + { endOperation_finish(ops[i$4]); } + } + + function endOperation_R1(op) { + var cm = op.cm, display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) { findMaxLine(cm); } + + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + } + + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + + function endOperation_R2(op) { + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) { updateHeightsInViewport(cm); } + + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } + + if (op.updatedDisplay || op.selectionChanged) + { op.preparedSelection = display.input.prepareSelection(); } + } + + function endOperation_W2(op) { + var cm = op.cm; + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) + { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); } + cm.display.maxLineChanged = false; + } + + var takeFocus = op.focus && op.focus == activeElt(); + if (op.preparedSelection) + { cm.display.input.showSelection(op.preparedSelection, takeFocus); } + if (op.updatedDisplay || op.startHeight != cm.doc.height) + { updateScrollbars(cm, op.barMeasure); } + if (op.updatedDisplay) + { setDocumentHeight(cm, op.barMeasure); } + + if (op.selectionChanged) { restartBlink(cm); } + + if (cm.state.focused && op.updateInput) + { cm.display.input.reset(op.typing); } + if (takeFocus) { ensureFocus(op.cm); } + } + + function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc; + + if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); } + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + { display.wheelStartX = display.wheelStartY = null; } + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); } + + if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + maybeScrollWindow(cm, rect); + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; + if (hidden) { for (var i = 0; i < hidden.length; ++i) + { if (!hidden[i].lines.length) { signal(hidden[i], "hide"); } } } + if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) + { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide"); } } } + + if (display.wrapper.offsetHeight) + { doc.scrollTop = cm.display.scroller.scrollTop; } + + // Fire change events, and delayed event handlers + if (op.changeObjs) + { signal(cm, "changes", cm, op.changeObjs); } + if (op.update) + { op.update.finish(); } + } + + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) { return f() } + startOperation(cm); + try { return f() } + finally { endOperation(cm); } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function() { + if (cm.curOp) { return f.apply(cm, arguments) } + startOperation(cm); + try { return f.apply(cm, arguments) } + finally { endOperation(cm); } + } + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function() { + if (this.curOp) { return f.apply(this, arguments) } + startOperation(this); + try { return f.apply(this, arguments) } + finally { endOperation(this); } + } + } + function docMethodOp(f) { + return function() { + var cm = this.cm; + if (!cm || cm.curOp) { return f.apply(this, arguments) } + startOperation(cm); + try { return f.apply(this, arguments) } + finally { endOperation(cm); } + } + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.highlightFrontier < cm.display.viewTo) + { cm.state.highlight.set(time, bind(highlightWorker, cm)); } + } + + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.highlightFrontier >= cm.display.viewTo) { return } + var end = +new Date + cm.options.workTime; + var context = getContextBefore(cm, doc.highlightFrontier); + var changedLines = []; + + doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { + if (context.line >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles; + var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; + var highlighted = highlightLine(cm, line, context, true); + if (resetState) { context.state = resetState; } + line.styles = highlighted.styles; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) { line.styleClasses = newCls; } + else if (oldCls) { line.styleClasses = null; } + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; } + if (ischange) { changedLines.push(context.line); } + line.stateAfter = context.save(); + context.nextLine(); + } else { + if (line.text.length <= cm.options.maxHighlightLength) + { processLine(cm, line.text, context); } + line.stateAfter = context.line % 5 == 0 ? context.save() : null; + context.nextLine(); + } + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true + } + }); + doc.highlightFrontier = context.line; + doc.modeFrontier = Math.max(doc.modeFrontier, context.line); + if (changedLines.length) { runInOp(cm, function () { + for (var i = 0; i < changedLines.length; i++) + { regLineChange(cm, changedLines[i], "text"); } + }); } + } + + // DISPLAY DRAWING + + var DisplayUpdate = function(cm, viewport, force) { + var display = cm.display; + + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + }; + + DisplayUpdate.prototype.signal = function (emitter, type) { + if (hasHandler(emitter, type)) + { this.events.push(arguments); } + }; + DisplayUpdate.prototype.finish = function () { + var this$1 = this; + + for (var i = 0; i < this.events.length; i++) + { signal.apply(null, this$1.events[i]); } + }; + + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } + + function selectionSnapshot(cm) { + if (cm.hasFocus()) { return null } + var active = activeElt(); + if (!active || !contains(cm.display.lineDiv, active)) { return null } + var result = {activeElt: active}; + if (window.getSelection) { + var sel = window.getSelection(); + if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { + result.anchorNode = sel.anchorNode; + result.anchorOffset = sel.anchorOffset; + result.focusNode = sel.focusNode; + result.focusOffset = sel.focusOffset; + } + } + return result + } + + function restoreSelection(snapshot) { + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return } + snapshot.activeElt.focus(); + if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { + var sel = window.getSelection(), range$$1 = document.createRange(); + range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset); + range$$1.collapse(false); + sel.removeAllRanges(); + sel.addRange(range$$1); + sel.extend(snapshot.focusNode, snapshot.focusOffset); + } + } + + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc; + + if (update.editorIsHidden) { + resetView(cm); + return false + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + { return false } + + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } + if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); + + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; + + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + { return false } + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var selSnapshot = selectionSnapshot(cm); + if (toUpdate > 4) { display.lineDiv.style.display = "none"; } + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) { display.lineDiv.style.display = ""; } + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + restoreSelection(selSnapshot); + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = display.sizer.style.minHeight = 0; + + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } + + display.updateLineNumbers = null; + + return true + } + + function postUpdateDisplay(cm, update) { + var viewport = update.viewport; + + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; } + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + { break } + } + if (!updateDisplayIfNeeded(cm, update)) { break } + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.force = false; + } + + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; + } + } + + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.finish(); + } + } + + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, cur = container.firstChild; + + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + { node.style.display = "none"; } + else + { node.parentNode.removeChild(node); } + return next + } + + var view = display.view, lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { // Already drawn + while (cur != lineView.node) { cur = rm(cur); } + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; } + updateLineForChanges(cm, lineView, lineN, dims); + } + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) { cur = rm(cur); } + } + + function updateGutterSpace(display) { + var width = display.gutters.offsetWidth; + display.sizer.style.marginLeft = width + "px"; + } + + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; + } + + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { + if (cm.options.fixedGutter) { + if (view[i].gutter) + { view[i].gutter.style.left = left; } + if (view[i].gutterBackground) + { view[i].gutterBackground.style.left = left; } + } + var align = view[i].alignable; + if (align) { for (var j = 0; j < align.length; j++) + { align[j].style.left = left; } } + } } + if (cm.options.fixedGutter) + { display.gutters.style.left = (comp + gutterW) + "px"; } + } + + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) { return false } + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm.display); + return true + } + return false + } + + function getGutters(gutters, lineNumbers) { + var result = [], sawLineNumbers = false; + for (var i = 0; i < gutters.length; i++) { + var name = gutters[i], style = null; + if (typeof name != "string") { style = name.style; name = name.className; } + if (name == "CodeMirror-linenumbers") { + if (!lineNumbers) { continue } + else { sawLineNumbers = true; } + } + result.push({className: name, style: style}); + } + if (lineNumbers && !sawLineNumbers) { result.push({className: "CodeMirror-linenumbers", style: null}); } + return result + } + + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function renderGutters(display) { + var gutters = display.gutters, specs = display.gutterSpecs; + removeChildren(gutters); + display.lineGutter = null; + for (var i = 0; i < specs.length; ++i) { + var ref = specs[i]; + var className = ref.className; + var style = ref.style; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + className)); + if (style) { gElt.style.cssText = style; } + if (className == "CodeMirror-linenumbers") { + display.lineGutter = gElt; + gElt.style.width = (display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = specs.length ? "" : "none"; + updateGutterSpace(display); + } + + function updateGutters(cm) { + renderGutters(cm.display); + regChange(cm); + alignHorizontally(cm); + } + + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input, options) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = eltP("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none"); + var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [lines], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; } + + if (place) { + if (place.appendChild) { place.appendChild(d.wrapper); } + else { place(d.wrapper); } + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; + + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; + + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + // True when shift is held down. + d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; + + d.activeTouch = null; + + d.gutterSpecs = getGutters(options.gutters, options.lineNumbers); + renderGutters(d); + + input.init(d); + } + + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. + + var wheelSamples = 0, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) { wheelPixelsPerUnit = -.53; } + else if (gecko) { wheelPixelsPerUnit = 15; } + else if (chrome) { wheelPixelsPerUnit = -.7; } + else if (safari) { wheelPixelsPerUnit = -1/3; } + + function wheelEventDelta(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; } + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; } + else if (dy == null) { dy = e.wheelDelta; } + return {x: dx, y: dy} + } + function wheelEventPixels(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta + } + + function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; + + var display = cm.display, scroll = display.scroller; + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth; + var canScrollY = scroll.scrollHeight > scroll.clientHeight; + if (!(dx && canScrollX || dy && canScrollY)) { return } + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy && canScrollY) + { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); } + setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit)); + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || (dy && canScrollY)) + { e_preventDefault(e); } + display.wheelStartX = null; // Abort measurement, if in progress + return + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) { top = Math.max(0, top + pixels - 50); } + else { bot = Math.min(cm.doc.height, bot + pixels + 50); } + updateDisplaySimple(cm, {top: top, bottom: bot}); + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function () { + if (display.wheelStartX == null) { return } + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) { return } + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } + } + } + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + var Selection = function(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + }; + + Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; + + Selection.prototype.equals = function (other) { + var this$1 = this; + + if (other == this) { return true } + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } + for (var i = 0; i < this.ranges.length; i++) { + var here = this$1.ranges[i], there = other.ranges[i]; + if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } + } + return true + }; + + Selection.prototype.deepCopy = function () { + var this$1 = this; + + var out = []; + for (var i = 0; i < this.ranges.length; i++) + { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); } + return new Selection(out, this.primIndex) + }; + + Selection.prototype.somethingSelected = function () { + var this$1 = this; + + for (var i = 0; i < this.ranges.length; i++) + { if (!this$1.ranges[i].empty()) { return true } } + return false + }; + + Selection.prototype.contains = function (pos, end) { + var this$1 = this; + + if (!end) { end = pos; } + for (var i = 0; i < this.ranges.length; i++) { + var range = this$1.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + { return i } + } + return -1 + }; + + var Range = function(anchor, head) { + this.anchor = anchor; this.head = head; + }; + + Range.prototype.from = function () { return minPos(this.anchor, this.head) }; + Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; + Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(cm, ranges, primIndex) { + var mayTouch = cm && cm.options.selectionsMayTouch; + var prim = ranges[primIndex]; + ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1]; + var diff = cmp(prev.to(), cur.from()); + if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) { --primIndex; } + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex) + } + + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0) + } + + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + function changeEnd(change) { + if (!change.text) { return change.to } + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)) + } + + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) { return pos } + if (cmp(pos, change.to) <= 0) { return changeEnd(change) } + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; } + return Pos(line, ch) + } + + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))); + } + return normalizeSelection(doc.cm, out, doc.sel.primIndex) + } + + function offsetPos(pos, old, nw) { + if (pos.line == old.line) + { return Pos(nw.line, pos.ch - old.ch + nw.ch) } + else + { return Pos(nw.line + (pos.line - old.line), pos.ch) } + } + + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex) + } + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } + + function resetModeState(cm) { + cm.doc.iter(function (line) { + if (line.stateAfter) { line.stateAfter = null; } + if (line.styles) { line.styles = null; } + }); + cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) { regChange(cm); } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore) + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight$$1) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight$$1); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + var result = []; + for (var i = start; i < end; ++i) + { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); } + return result + } + + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) { doc.remove(from.line, nlines); } + if (added.length) { doc.insert(from.line, added); } + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added$1 = linesFor(1, text.length - 1); + added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added$1); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added$2 = linesFor(1, text.length - 1); + if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); } + doc.insert(from.line + 1, added$2); + } + + signalLater(doc, "change", doc, change); + } + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) { continue } + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) { continue } + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) { throw new Error("This document is already in use.") } + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + setDirectionClass(cm); + if (!cm.options.lineWrapping) { findMaxLine(cm); } + cm.options.mode = doc.modeOption; + regChange(cm); + } + + function setDirectionClass(cm) { + (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); + } + + function directionChanged(cm) { + runInOp(cm, function () { + setDirectionClass(cm); + regChange(cm); + }); + } + + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true); + return histChange + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) { array.pop(); } + else { break } + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done) + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done) + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done) + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, or are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur; + var last; + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) + { pushSelectionToHistory(doc.sel, hist.done); } + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation}; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) { hist.done.shift(); } + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + + if (!last) { signal(doc, "historyAdded"); } + } + + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500) + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + { hist.done[hist.done.length - 1] = sel; } + else + { pushSelectionToHistory(sel, hist.done); } + + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) + { clearSelectionEvents(hist.undone); } + } + + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) + { dest.push(sel); } + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { + if (line.markedSpans) + { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; } + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) { return null } + var out; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } } + else if (out) { out.push(spans[i]); } + } + return !out ? spans : out.length ? out : null + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) { return null } + var nw = []; + for (var i = 0; i < change.text.length; ++i) + { nw.push(removeClearedSpans(found[i])); } + return nw + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) { return stretched } + if (!stretched) { return old } + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) + { if (oldCur[k].marker == span.marker) { continue spans } } + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + var copy = []; + for (var i = 0; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue + } + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m = (void 0); + newChanges.push({from: change.from, to: change.to, text: change.text}); + if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } } } + } + } + return copy + } + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(range, head, other, extend) { + if (extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; + } + } + return new Range(anchor, head) + } else { + return new Range(other || head, head) + } + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options, extend) { + if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); } + setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + var out = []; + var extend = doc.cm && (doc.cm.display.shift || doc.extend); + for (var i = 0; i < doc.sel.ranges.length; i++) + { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); } + var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel, options) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + var this$1 = this; + + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); } + }, + origin: options && options.origin + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); } + if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) } + else { return sel } + } + + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + { sel = filterSelectionChange(doc, sel, options); } + + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + + if (!(options && options.scroll === false) && doc.cm) + { ensureCursorVisible(doc.cm); } + } + + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) { return } + + doc.sel = sel; + + if (doc.cm) { + doc.cm.curOp.updateInput = 1; + doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) { out = sel.ranges.slice(0, i); } + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel + } + + function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line); + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + + // Determine if we should prevent the cursor being placed to the left/right of an atomic marker + // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it + // is with selectLeft/Right + var preventCursorLeft = ("selectLeft" in m) ? !m.selectLeft : m.inclusiveLeft; + var preventCursorRight = ("selectRight" in m) ? !m.selectRight : m.inclusiveRight; + + if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && + (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) { break } + else {--i; continue} + } + } + if (!m.atomic) { continue } + + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), diff = (void 0); + if (dir < 0 ? preventCursorRight : preventCursorLeft) + { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); } + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) + { return skipAtomicInner(doc, near, pos, dir, mayClear) } + } + + var far = m.find(dir < 0 ? -1 : 1); + if (dir < 0 ? preventCursorLeft : preventCursorRight) + { far = movePos(doc, far, dir, far.line == pos.line ? line : null); } + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null + } + } } + return pos + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1; + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || + skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); + if (!found) { + doc.cantEdit = true; + return Pos(doc.first, 0) + } + return found + } + + function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) } + else { return null } + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) } + else { return null } + } else { + return new Pos(pos.line, pos.ch + dir) + } + } + + function selectAll(cm) { + cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); + } + + // UPDATING + + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function () { return obj.canceled = true; } + }; + if (update) { obj.update = function (from, to, text, origin) { + if (from) { obj.from = clipPos(doc, from); } + if (to) { obj.to = clipPos(doc, to); } + if (text) { obj.text = text; } + if (origin !== undefined) { obj.origin = origin; } + }; } + signal(doc, "beforeChange", doc, obj); + if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj); } + + if (obj.canceled) { + if (doc.cm) { doc.cm.curOp.updateInput = 2; } + return null + } + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} + } + + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) } + if (doc.cm.state.suppressEdits) { return } + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) { return } + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) + { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); } + } else { + makeChangeInner(doc, change); + } + } + + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + var suppress = doc.cm && doc.cm.state.suppressEdits; + if (suppress && !allowSelectionOnly) { return } + + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + var i = 0; + for (; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + { break } + } + if (i == source.length) { return } + hist.lastOrigin = hist.lastSelOrigin = null; + + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}); + return + } + selAfter = event; + } else if (suppress) { + source.push(event); + return + } else { break } + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); + hist.generation = event.generation || ++hist.maxGeneration; + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + + var loop = function ( i ) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return {} + } + + antiChanges.push(historyChangeFromChange(doc, change)); + + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); } + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + }; + + for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { + var returned = loop( i$1 ); + + if ( returned ) return returned.v; + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) { return } + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( + Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch) + ); }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + { regLineChange(doc.cm, l, "gutter"); } + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return + } + if (change.from.line > doc.lastLine()) { return } + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin}; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin}; + } + + change.removed = getBetween(doc, change.from, change.to); + + if (!selAfter) { selAfter = computeSelAfterChange(doc, change); } + if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); } + else { updateDoc(doc, change, spans); } + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + + if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0))) + { doc.cantEdit = false; } + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function (line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true + } + }); + } + + if (doc.sel.contains(change.from, change.to) > -1) + { signalCursorActivity(cm); } + + updateDoc(doc, change, spans, estimateHeight(cm)); + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function (line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; } + } + + retreatFrontier(doc, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) + { regChange(cm); } + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + { regLineChange(cm, from.line, "text"); } + else + { regChange(cm, from.line, to.line + 1, lendiff); } + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) { signalLater(cm, "change", cm, obj); } + if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); } + } + cm.display.selForContextMenu = null; + } + + function replaceRange(doc, code, from, to, origin) { + var assign; + + if (!to) { to = from; } + if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); } + if (typeof code == "string") { code = doc.splitLines(code); } + makeChange(doc, {from: from, to: to, text: code, origin: origin}); + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true; + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue + } + for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { + var cur = sub.changes[j$1]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + + function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle; + if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)); } + else { no = lineNo(handle); } + if (no == null) { return null } + if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); } + return line + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + var this$1 = this; + + this.lines = lines; + this.parent = null; + var height = 0; + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this$1; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length }, + + // Remove the n lines at offset 'at'. + removeInner: function(at, n) { + var this$1 = this; + + for (var i = at, e = at + n; i < e; ++i) { + var line = this$1.lines[i]; + this$1.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + + // Helper used to collapse a small branch into a single leaf. + collapse: function(lines) { + lines.push.apply(lines, this.lines); + }, + + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function(at, lines, height) { + var this$1 = this; + + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; } + }, + + // Used to iterate over a part of the tree. + iterN: function(at, n, op) { + var this$1 = this; + + for (var e = at + n; at < e; ++at) + { if (op(this$1.lines[at])) { return true } } + } + }; + + function BranchChunk(children) { + var this$1 = this; + + this.children = children; + var size = 0, height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this$1; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size }, + + removeInner: function(at, n) { + var this$1 = this; + + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this$1.height -= oldHeight - child.height; + if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) { break } + at = 0; + } else { at -= sz; } + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + + collapse: function(lines) { + var this$1 = this; + + for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); } + }, + + insertInner: function(at, lines, height) { + var this$1 = this; + + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25; + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); + child.height -= leaf.height; + this$1.children.splice(++i, 0, leaf); + leaf.parent = this$1; + } + child.lines = child.lines.slice(0, remaining); + this$1.maybeSpill(); + } + break + } + at -= sz; + } + }, + + // When a node has grown, check whether it should be split. + maybeSpill: function() { + if (this.children.length <= 10) { return } + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10) + me.parent.maybeSpill(); + }, + + iterN: function(at, n, op) { + var this$1 = this; + + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) { return true } + if ((n -= used) == 0) { break } + at = 0; + } else { at -= sz; } + } + } + }; + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = function(doc, node, options) { + var this$1 = this; + + if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) + { this$1[opt] = options[opt]; } } } + this.doc = doc; + this.node = node; + }; + + LineWidget.prototype.clear = function () { + var this$1 = this; + + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); + if (no == null || !ws) { return } + for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } } + if (!ws.length) { line.widgets = null; } + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) { + runInOp(cm, function () { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + signalLater(cm, "lineWidgetCleared", cm, this, no); + } + }; + + LineWidget.prototype.changed = function () { + var this$1 = this; + + var oldH = this.height, cm = this.doc.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) { return } + if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); } + if (cm) { + runInOp(cm, function () { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)); + }); + } + }; + eventMixin(LineWidget); + + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + { addToScrollTop(cm, diff); } + } + + function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) { cm.display.alignWidgets = true; } + changeLine(doc, handle, "widget", function (line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) { widgets.push(widget); } + else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); } + widget.line = line; + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) { addToScrollTop(cm, widget.height); } + cm.curOp.forceUpdate = true; + } + return true + }); + if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); } + return widget + } + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + + var TextMarker = function(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + + // Clear the marker. + TextMarker.prototype.clear = function () { + var this$1 = this; + + if (this.explicitlyCleared) { return } + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) { startOperation(cm); } + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) { signalLater(this, "clear", found.from, found.to); } + } + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text"); } + else if (cm) { + if (span.to != null) { max = lineNo(line); } + if (span.from != null) { min = lineNo(line); } + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm) + { updateLineHeight(line, textHeight(cm.display)); } + } + if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { + var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } } + + if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); } + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) { reCheckSelection(cm.doc); } + } + if (cm) { signalLater(cm, "markerCleared", cm, this, min, max); } + if (withOp) { endOperation(cm); } + if (this.parent) { this.parent.clear(); } + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function (side, lineObj) { + var this$1 = this; + + if (side == null && this.type == "bookmark") { side = 1; } + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) { return from } + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) { return to } + } + } + return from && {from: from, to: to} + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function () { + var this$1 = this; + + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; + if (!pos || !cm) { return } + runInOp(cm, function () { + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) + { updateLineHeight(line, line.height + dHeight); } + } + signalLater(cm, "markerChanged", cm, this$1); + }); + }; + + TextMarker.prototype.attachLine = function (line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); } + } + this.lines.push(line); + }; + + TextMarker.prototype.detachLine = function (line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp + ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + eventMixin(TextMarker); + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) { return markTextShared(doc, from, to, options, type) } + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } + + var marker = new TextMarker(doc, type), diff = cmp(from, to); + if (options) { copyObj(options, marker, false); } + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + { return marker } + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true"); } + if (options.insertLeft) { marker.widgetNode.insertLeft = true; } + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + { throw new Error("Inserting collapsed marker partially overlapping an existing one") } + seeCollapsedSpans(); + } + + if (marker.addToHistory) + { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); } + + var curLine = from.line, cm = doc.cm, updateMaxLine; + doc.iter(curLine, to.line + 1, function (line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + { updateMaxLine = true; } + if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); } + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { + if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); } + }); } + + if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }); } + + if (marker.readOnly) { + seeReadOnlySpans(); + if (doc.history.done.length || doc.history.undone.length) + { doc.clearHistory(); } + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) { cm.curOp.updateMaxLine = true; } + if (marker.collapsed) + { regChange(cm, from.line, to.line + 1); } + else if (marker.className || marker.startStyle || marker.endStyle || marker.css || + marker.attributes || marker.title) + { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } } + if (marker.atomic) { reCheckSelection(cm.doc); } + signalLater(cm, "markerAdded", cm, marker); + } + return marker + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = function(markers, primary) { + var this$1 = this; + + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) + { markers[i].parent = this$1; } + }; + + SharedTextMarker.prototype.clear = function () { + var this$1 = this; + + if (this.explicitlyCleared) { return } + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) + { this$1.markers[i].clear(); } + signalLater(this, "clear"); + }; + + SharedTextMarker.prototype.find = function (side, lineObj) { + return this.primary.find(side, lineObj) + }; + eventMixin(SharedTextMarker); + + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function (doc) { + if (widget) { options.widgetNode = widget.cloneNode(true); } + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) + { if (doc.linked[i].isParent) { return } } + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary) + } + + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; }) + } + + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + + function detachSharedMarkers(markers) { + var loop = function ( i ) { + var marker = markers[i], linked = [marker.primary.doc]; + linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + }; + + for (var i = 0; i < markers.length; i++) loop( i ); + } + + var nextDocId = 0; + var Doc = function(text, mode, firstLine, lineSep, direction) { + if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } + if (firstLine == null) { firstLine = 0; } + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.modeFrontier = this.highlightFrontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + this.lineSep = lineSep; + this.direction = (direction == "rtl") ? "rtl" : "ltr"; + this.extend = false; + + if (typeof text == "string") { text = this.splitLines(text); } + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) { this.iterN(from - this.first, to - from, op); } + else { this.iterN(this.first, this.first + this.size, from); } + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) { height += lines[i].height; } + this.insertInner(at - this.first, lines, height); + }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep) { + var lines = getLines(this, this.first, this.first + this.size); + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1; + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: this.splitLines(code), origin: "setValue", full: true}, true); + if (this.cm) { scrollToCoords(this.cm, 0, 0); } + setSelection(this, simpleSelection(top), sel_dontScroll); + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text}, + + getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }}, + getLineNumber: function(line) {return lineNo(line)}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") { line = getLine(this, line); } + return visualLine(line) + }, + + lineCount: function() {return this.size}, + firstLine: function() {return this.first}, + lastLine: function() {return this.first + this.size - 1}, + + clipPos: function(pos) {return clipPos(this, pos)}, + + getCursor: function(start) { + var range$$1 = this.sel.primary(), pos; + if (start == null || start == "head") { pos = range$$1.head; } + else if (start == "anchor") { pos = range$$1.anchor; } + else if (start == "end" || start == "to" || start === false) { pos = range$$1.to(); } + else { pos = range$$1.from(); } + return pos + }, + listSelections: function() { return this.sel.ranges }, + somethingSelected: function() {return this.sel.somethingSelected()}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads), options); + }), + extendSelectionsBy: docMethodOp(function(f, options) { + var heads = map(this.sel.ranges, f); + extendSelections(this, clipPosArray(this, heads), options); + }), + setSelections: docMethodOp(function(ranges, primary, options) { + var this$1 = this; + + if (!ranges.length) { return } + var out = []; + for (var i = 0; i < ranges.length; i++) + { out[i] = new Range(clipPos(this$1, ranges[i].anchor), + clipPos(this$1, ranges[i].head)); } + if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); } + setSelection(this, normalizeSelection(this.cm, out, primary), options); + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options); + }), + + getSelection: function(lineSep) { + var this$1 = this; + + var ranges = this.sel.ranges, lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) { return lines } + else { return lines.join(lineSep || this.lineSeparator()) } + }, + getSelections: function(lineSep) { + var this$1 = this; + + var parts = [], ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); } + parts[i] = sel; + } + return parts + }, + replaceSelection: function(code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) + { dup[i] = code; } + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var this$1 = this; + + var changes = [], sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range$$1 = sel.ranges[i]; + changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin}; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) + { makeChange(this$1, changes[i$1]); } + if (newSel) { setSelectionReplaceHistory(this, newSel); } + else if (this.cm) { ensureCursorVisible(this.cm); } + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), + + setExtending: function(val) {this.extend = val;}, + getExtending: function() {return this.extend}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } } + for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } } + return {undo: done, redo: undone} + }, + clearHistory: function() {this.history = new History(this.history.maxGeneration);}, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; } + return this.history.generation + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration) + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)} + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + + setGutterMarker: docMethodOp(function(line, gutterID, value) { + return changeLine(this, line, "gutter", function (line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) { line.gutterMarkers = null; } + return true + }) + }), + + clearGutter: docMethodOp(function(gutterID) { + var this$1 = this; + + this.iter(function (line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + changeLine(this$1, line, "gutter", function () { + line.gutterMarkers[gutterID] = null; + if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; } + return true + }); + } + }); + }), + + lineInfo: function(line) { + var n; + if (typeof line == "number") { + if (!isLine(this, line)) { return null } + n = line; + line = getLine(this, line); + if (!line) { return null } + } else { + n = lineNo(line); + if (n == null) { return null } + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets} + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) { line[prop] = cls; } + else if (classTest(cls).test(line[prop])) { return false } + else { line[prop] += " " + cls; } + return true + }) + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) { return false } + else if (cls == null) { line[prop] = null; } + else { + var found = cur.match(classTest(cls)); + if (!found) { return false } + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true + }) + }), + + addLineWidget: docMethodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options) + }), + removeLineWidget: function(widget) { widget.clear(); }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark") + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + { markers.push(span.marker.parent || span.marker); } + } } + return markers + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo$$1 = from.line; + this.iter(from.line, to.line + 1, function (line) { + var spans = line.markedSpans; + if (spans) { for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to || + span.from == null && lineNo$$1 != from.line || + span.from != null && lineNo$$1 == to.line && span.from >= to.ch) && + (!filter || filter(span.marker))) + { found.push(span.marker.parent || span.marker); } + } } + ++lineNo$$1; + }); + return found + }, + getAllMarks: function() { + var markers = []; + this.iter(function (line) { + var sps = line.markedSpans; + if (sps) { for (var i = 0; i < sps.length; ++i) + { if (sps[i].from != null) { markers.push(sps[i].marker); } } } + }); + return markers + }, + + posFromIndex: function(off) { + var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length; + this.iter(function (line) { + var sz = line.text.length + sepSize; + if (sz > off) { ch = off; return true } + off -= sz; + ++lineNo$$1; + }); + return clipPos(this, Pos(lineNo$$1, ch)) + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) { return 0 } + var sepSize = this.lineSeparator().length; + this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value + index += line.text.length + sepSize; + }); + return index + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), + this.modeOption, this.first, this.lineSep, this.direction); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc + }, + + linkedDoc: function(options) { + if (!options) { options = {}; } + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) { from = options.from; } + if (options.to != null && options.to < to) { to = options.to; } + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); + if (options.sharedHist) { copy.history = this.history + ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy + }, + unlinkDoc: function(other) { + var this$1 = this; + + if (other instanceof CodeMirror) { other = other.doc; } + if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { + var link = this$1.linked[i]; + if (link.doc != other) { continue } + this$1.linked.splice(i, 1); + other.unlinkDoc(this$1); + detachSharedMarkers(findSharedMarkers(this$1)); + break + } } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, + + getMode: function() {return this.mode}, + getEditor: function() {return this.cm}, + + splitLines: function(str) { + if (this.lineSep) { return str.split(this.lineSep) } + return splitLinesAuto(str) + }, + lineSeparator: function() { return this.lineSep || "\n" }, + + setDirection: docMethodOp(function (dir) { + if (dir != "rtl") { dir = "ltr"; } + if (dir == this.direction) { return } + this.direction = dir; + this.iter(function (line) { return line.order = null; }); + if (this.cm) { directionChanged(this.cm); } + }) + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; + + function onDrop(e) { + var cm = this; + clearDragCursor(cm); + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + { return } + e_preventDefault(e); + if (ie) { lastDrop = +new Date; } + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || cm.isReadOnly()) { return } + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var loadFile = function (file, i) { + if (cm.options.allowDropFileTypes && + indexOf(cm.options.allowDropFileTypes, file.type) == -1) + { return } + + var reader = new FileReader; + reader.onload = operation(cm, function () { + var content = reader.result; + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = ""; } + text[i] = content; + if (++read == n) { + pos = clipPos(cm.doc, pos); + var change = {from: pos, to: pos, + text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), + origin: "paste"}; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + } + }); + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) { loadFile(files[i], i); } + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function () { return cm.display.input.focus(); }, 20); + return + } + try { + var text$1 = e.dataTransfer.getData("Text"); + if (text$1) { + var selected; + if (cm.state.draggingText && !cm.state.draggingText.copy) + { selected = cm.listSelections(); } + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) + { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); } } + cm.replaceSelection(text$1, "around", "paste"); + cm.display.input.focus(); + } + } + catch(e){} + } + } + + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } + + e.dataTransfer.setData("Text", cm.getSelection()); + e.dataTransfer.effectAllowed = "copyMove"; + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) { img.parentNode.removeChild(img); } + } + } + + function onDragOver(cm, e) { + var pos = posFromMouse(cm, e); + if (!pos) { return } + var frag = document.createDocumentFragment(); + drawSelectionCursor(cm, pos, frag); + if (!cm.display.dragCursor) { + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); + } + removeChildrenAndAdd(cm.display.dragCursor, frag); + } + + function clearDragCursor(cm) { + if (cm.display.dragCursor) { + cm.display.lineSpace.removeChild(cm.display.dragCursor); + cm.display.dragCursor = null; + } + } + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.getElementsByClassName) { return } + var byClass = document.getElementsByClassName("CodeMirror"), editors = []; + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) { editors.push(cm); } + } + if (editors.length) { editors[0].operation(function () { + for (var i = 0; i < editors.length; i++) { f(editors[i]); } + }); } + } + + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) { return } + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function () { + if (resizeTimer == null) { resizeTimer = setTimeout(function () { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); } + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function () { return forEachCodeMirror(onBlur); }); + } + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } + + var keyNames = { + 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", + 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" + }; + + // Number keys + for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); } + // Alphabetic keys + for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); } + // Function keys + for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; } + + var keyMap = {}; + + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + "fallthrough": "basic" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", + "Ctrl-O": "openLine" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + "fallthrough": ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/); + name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; } + else if (/^a(lt)?$/i.test(mod)) { alt = true; } + else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; } + else if (/^s(hift)?$/i.test(mod)) { shift = true; } + else { throw new Error("Unrecognized modifier name: " + mod) } + } + if (alt) { name = "Alt-" + name; } + if (ctrl) { name = "Ctrl-" + name; } + if (cmd) { name = "Cmd-" + name; } + if (shift) { name = "Shift-" + name; } + return name + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + function normalizeKeyMap(keymap) { + var copy = {}; + for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } + if (value == "...") { delete keymap[keyname]; continue } + + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val = (void 0), name = (void 0); + if (i == keys.length - 1) { + name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) { copy[name] = val; } + else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } + } + delete keymap[keyname]; + } } + for (var prop in copy) { keymap[prop] = copy[prop]; } + return keymap + } + + function lookupKey(key, map$$1, handle, context) { + map$$1 = getKeyMap(map$$1); + var found = map$$1.call ? map$$1.call(key, context) : map$$1[key]; + if (found === false) { return "nothing" } + if (found === "...") { return "multi" } + if (found != null && handle(found)) { return "handled" } + + if (map$$1.fallthrough) { + if (Object.prototype.toString.call(map$$1.fallthrough) != "[object Array]") + { return lookupKey(key, map$$1.fallthrough, handle, context) } + for (var i = 0; i < map$$1.fallthrough.length; i++) { + var result = lookupKey(key, map$$1.fallthrough[i], handle, context); + if (result) { return result } + } + } + } + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + function isModifierKey(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" + } + + function addModifierNames(name, event, noShift) { + var base = name; + if (event.altKey && base != "Alt") { name = "Alt-" + name; } + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; } + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name; } + if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; } + return name + } + + // Look up the name of a key as indicated by an event object. + function keyName(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) { return false } + var name = keyNames[event.keyCode]; + if (name == null || event.altGraphKey) { return false } + // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause, + // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+) + if (event.keyCode == 3 && event.code) { name = event.code; } + return addModifierNames(name, event, noShift) + } + + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function () { + for (var i = kill.length - 1; i >= 0; i--) + { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); } + ensureCursorVisible(cm); + }); + } + + function moveCharLogically(line, ch, dir) { + var target = skipExtendingChars(line.text, ch + dir, dir); + return target < 0 || target > line.text.length ? null : target + } + + function moveLogically(line, start, dir) { + var ch = moveCharLogically(line, start.ch, dir); + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") + } + + function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + var order = getOrder(lineObj, cm.doc.direction); + if (order) { + var part = dir < 0 ? lst(order) : order[0]; + var moveInStorageOrder = (dir < 0) == (part.level == 1); + var sticky = moveInStorageOrder ? "after" : "before"; + var ch; + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0 || cm.doc.direction == "rtl") { + var prep = prepareMeasureForLine(cm, lineObj); + ch = dir < 0 ? lineObj.text.length - 1 : 0; + var targetTop = measureCharPrepared(cm, prep, ch).top; + ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch); + if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); } + } else { ch = dir < 0 ? part.to : part.from; } + return new Pos(lineNo, ch, sticky) + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") + } + + function moveVisually(cm, line, start, dir) { + var bidi = getOrder(line, cm.doc.direction); + if (!bidi) { return moveLogically(line, start, dir) } + if (start.ch >= line.text.length) { + start.ch = line.text.length; + start.sticky = "before"; + } else if (start.ch <= 0) { + start.ch = 0; + start.sticky = "after"; + } + var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]; + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir) + } + + var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }; + var prep; + var getWrappedLineExtent = function (ch) { + if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } + prep = prep || prepareMeasureForLine(cm, line); + return wrappedLineExtentChar(cm, line, prep, ch) + }; + var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); + + if (cm.doc.direction == "rtl" || part.level == 1) { + var moveInStorageOrder = (part.level == 1) == (dir < 0); + var ch = mv(start, moveInStorageOrder ? 1 : -1); + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + var sticky = moveInStorageOrder ? "before" : "after"; + return new Pos(start.line, ch, sticky) + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { + var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder + ? new Pos(start.line, mv(ch, 1), "before") + : new Pos(start.line, ch, "after"); }; + + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + var part = bidi[partPos]; + var moveInStorageOrder = (dir > 0) == (part.level != 1); + var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1); + if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } + ch = moveInStorageOrder ? part.from : mv(part.to, -1); + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } + } + }; + + // Case 3a: Look for other bidi parts on the same visual line + var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent); + if (res) { return res } + + // Case 3b: Look for other bidi parts on the next visual line + var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1); + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); + if (res) { return res } + } + + // Case 4: Nowhere to move + return null + } + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = { + selectAll: selectAll, + singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, + killLine: function (cm) { return deleteNearSelection(cm, function (range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) + { return {from: range.head, to: Pos(range.head.line + 1, 0)} } + else + { return {from: range.head, to: Pos(range.head.line, len)} } + } else { + return {from: range.from(), to: range.to()} + } + }); }, + deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) + }); }); }, + delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), to: range.from() + }); }); }, + delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); + return {from: leftPos, to: range.from()} + }); }, + delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + return {from: range.from(), to: rightPos } + }); }, + undo: function (cm) { return cm.undo(); }, + redo: function (cm) { return cm.redo(); }, + undoSelection: function (cm) { return cm.undoSelection(); }, + redoSelection: function (cm) { return cm.redoSelection(); }, + goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); }, + goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); }, + goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1} + ); }, + goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); }, + {origin: "+move", bias: 1} + ); }, + goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1} + ); }, + goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") + }, sel_move); }, + goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({left: 0, top: top}, "div") + }, sel_move); }, + goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } + return pos + }, sel_move); }, + goLineUp: function (cm) { return cm.moveV(-1, "line"); }, + goLineDown: function (cm) { return cm.moveV(1, "line"); }, + goPageUp: function (cm) { return cm.moveV(-1, "page"); }, + goPageDown: function (cm) { return cm.moveV(1, "page"); }, + goCharLeft: function (cm) { return cm.moveH(-1, "char"); }, + goCharRight: function (cm) { return cm.moveH(1, "char"); }, + goColumnLeft: function (cm) { return cm.moveH(-1, "column"); }, + goColumnRight: function (cm) { return cm.moveH(1, "column"); }, + goWordLeft: function (cm) { return cm.moveH(-1, "word"); }, + goGroupRight: function (cm) { return cm.moveH(1, "group"); }, + goGroupLeft: function (cm) { return cm.moveH(-1, "group"); }, + goWordRight: function (cm) { return cm.moveH(1, "word"); }, + delCharBefore: function (cm) { return cm.deleteH(-1, "char"); }, + delCharAfter: function (cm) { return cm.deleteH(1, "char"); }, + delWordBefore: function (cm) { return cm.deleteH(-1, "word"); }, + delWordAfter: function (cm) { return cm.deleteH(1, "word"); }, + delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); }, + delGroupAfter: function (cm) { return cm.deleteH(1, "group"); }, + indentAuto: function (cm) { return cm.indentSelection("smart"); }, + indentMore: function (cm) { return cm.indentSelection("add"); }, + indentLess: function (cm) { return cm.indentSelection("subtract"); }, + insertTab: function (cm) { return cm.replaceSelection("\t"); }, + insertSoftTab: function (cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(spaceStr(tabSize - col % tabSize)); + } + cm.replaceSelections(spaces); + }, + defaultTab: function (cm) { + if (cm.somethingSelected()) { cm.indentSelection("add"); } + else { cm.execCommand("insertTab"); } + }, + // Swap the two chars left and right of each selection's head. + // Move cursor behind the two swapped characters afterwards. + // + // Doesn't consider line feeds a character. + // Doesn't scan more than one line above to find a character. + // Doesn't do anything on an empty line. + // Doesn't do anything with non-empty selections. + transposeChars: function (cm) { return runInOp(cm, function () { + var ranges = cm.listSelections(), newSel = []; + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) { continue } + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); } + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) { + cur = new Pos(cur.line, 1); + cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); + } + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); }, + newlineAndIndent: function (cm) { return runInOp(cm, function () { + var sels = cm.listSelections(); + for (var i = sels.length - 1; i >= 0; i--) + { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); } + sels = cm.listSelections(); + for (var i$1 = 0; i$1 < sels.length; i$1++) + { cm.indentLine(sels[i$1].from().line, null, true); } + ensureCursorVisible(cm); + }); }, + openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, + toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } + }; + + + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) { lineN = lineNo(visual); } + return endOfLine(true, cm, visual, lineN, 1) + } + function lineEnd(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLineEnd(line); + if (visual != line) { lineN = lineNo(visual); } + return endOfLine(true, cm, line, lineN, -1) + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line, cm.doc.direction); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) + } + return start + } + + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) { return false } + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, done = false; + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true; } + if (dropShift) { cm.display.shift = false; } + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done + } + + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) { return result } + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm) + } + + // Note that, despite the name, this function is also used to check + // for bound mouse clicks. + + var stopSeq = new Delayed; + + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) { return "handled" } + if (/\'$/.test(name)) + { cm.state.keySeq = null; } + else + { stopSeq.set(50, function () { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); } + if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } + } + return dispatchKeyInner(cm, name, e, handle) + } + + function dispatchKeyInner(cm, name, e, handle) { + var result = lookupKeyForEditor(cm, name, handle); + + if (result == "multi") + { cm.state.keySeq = name; } + if (result == "handled") + { signalLater(cm, "keyHandled", cm, name, e); } + + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } + + return !!result + } + + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) { return false } + + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) + || dispatchKey(cm, name, e, function (b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + { return doHandleBinding(cm, b) } + }) + } else { + return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) + } + } + + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) + } + + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + cm.curOp.focus = activeElt(); + if (signalDOMEvent(cm, e)) { return } + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + { cm.replaceSelection("", null, "cut"); } + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + { showCrossHair(cm); } + } + + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + + function onKeyUp(e) { + if (e.keyCode == 16) { this.doc.sel.shift = false; } + signalDOMEvent(this, e); + } + + function onKeyPress(e) { + var cm = this; + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } + var keyCode = e.keyCode, charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + // Some browsers fire keypress events for backspace + if (ch == "\x08") { return } + if (handleCharBinding(cm, e, ch)) { return } + cm.display.input.onKeyPress(e); + } + + var DOUBLECLICK_DELAY = 400; + + var PastClick = function(time, pos, button) { + this.time = time; + this.pos = pos; + this.button = button; + }; + + PastClick.prototype.compare = function (time, pos, button) { + return this.time + DOUBLECLICK_DELAY > time && + cmp(pos, this.pos) == 0 && button == this.button + }; + + var lastClick, lastDoubleClick; + function clickRepeat(pos, button) { + var now = +new Date; + if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { + lastClick = lastDoubleClick = null; + return "triple" + } else if (lastClick && lastClick.compare(now, pos, button)) { + lastDoubleClick = new PastClick(now, pos, button); + lastClick = null; + return "double" + } else { + lastClick = new PastClick(now, pos, button); + lastDoubleClick = null; + return "single" + } + } + + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, display = cm.display; + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } + display.input.ensurePolled(); + display.shift = e.shiftKey; + + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function () { return display.scroller.draggable = true; }, 100); + } + return + } + if (clickInGutter(cm, e)) { return } + var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"; + window.focus(); + + // #3261: make sure, that we're not starting a second selection + if (button == 1 && cm.state.selectingText) + { cm.state.selectingText(e); } + + if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } + + if (button == 1) { + if (pos) { leftButtonDown(cm, pos, repeat, e); } + else if (e_target(e) == display.scroller) { e_preventDefault(e); } + } else if (button == 2) { + if (pos) { extendSelection(cm.doc, pos); } + setTimeout(function () { return display.input.focus(); }, 20); + } else if (button == 3) { + if (captureRightClick) { cm.display.input.onContextMenu(e); } + else { delayBlurEvent(cm); } + } + } + + function handleMappedButton(cm, button, pos, repeat, event) { + var name = "Click"; + if (repeat == "double") { name = "Double" + name; } + else if (repeat == "triple") { name = "Triple" + name; } + name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; + + return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { + if (typeof bound == "string") { bound = commands[bound]; } + if (!bound) { return false } + var done = false; + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true; } + done = bound(cm, pos) != Pass; + } finally { + cm.state.suppressEdits = false; + } + return done + }) + } + + function configureMouse(cm, repeat, event) { + var option = cm.getOption("configureMouse"); + var value = option ? option(cm, repeat, event) : {}; + if (value.unit == null) { + var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; + value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; + } + if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; } + if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; } + if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); } + return value + } + + function leftButtonDown(cm, pos, repeat, event) { + if (ie) { setTimeout(bind(ensureFocus, cm), 0); } + else { cm.curOp.focus = activeElt(); } + + var behavior = configureMouse(cm, repeat, event); + + var sel = cm.doc.sel, contained; + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && + repeat == "single" && (contained = sel.contains(pos)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && + (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) + { leftButtonStartDrag(cm, event, pos, behavior); } + else + { leftButtonSelect(cm, event, pos, behavior); } + } + + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, event, pos, behavior) { + var display = cm.display, moved = false; + var dragEnd = operation(cm, function (e) { + if (webkit) { display.scroller.draggable = false; } + cm.state.draggingText = false; + off(display.wrapper.ownerDocument, "mouseup", dragEnd); + off(display.wrapper.ownerDocument, "mousemove", mouseMove); + off(display.scroller, "dragstart", dragStart); + off(display.scroller, "drop", dragEnd); + if (!moved) { + e_preventDefault(e); + if (!behavior.addNew) + { extendSelection(cm.doc, pos, null, null, behavior.extend); } + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) + { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); } + else + { display.input.focus(); } + } + }); + var mouseMove = function(e2) { + moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; + }; + var dragStart = function () { return moved = true; }; + // Let the drag handler handle this. + if (webkit) { display.scroller.draggable = true; } + cm.state.draggingText = dragEnd; + dragEnd.copy = !behavior.moveOnDrag; + // IE's approach to draggable + if (display.scroller.dragDrop) { display.scroller.dragDrop(); } + on(display.wrapper.ownerDocument, "mouseup", dragEnd); + on(display.wrapper.ownerDocument, "mousemove", mouseMove); + on(display.scroller, "dragstart", dragStart); + on(display.scroller, "drop", dragEnd); + + delayBlurEvent(cm); + setTimeout(function () { return display.input.focus(); }, 20); + } + + function rangeForUnit(cm, pos, unit) { + if (unit == "char") { return new Range(pos, pos) } + if (unit == "word") { return cm.findWordAt(pos) } + if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } + var result = unit(cm, pos); + return new Range(result.from, result.to) + } + + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, event, start, behavior) { + var display = cm.display, doc = cm.doc; + e_preventDefault(event); + + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; + if (behavior.addNew && !behavior.extend) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) + { ourRange = ranges[ourIndex]; } + else + { ourRange = new Range(start, start); } + } else { + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; + } + + if (behavior.unit == "rectangle") { + if (!behavior.addNew) { ourRange = new Range(start, start); } + start = posFromMouse(cm, event, true, true); + ourIndex = -1; + } else { + var range$$1 = rangeForUnit(cm, start, behavior.unit); + if (behavior.extend) + { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); } + else + { ourRange = range$$1; } + } + + if (!behavior.addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { + setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + {scroll: false, origin: "*mouse"}); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } + + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) { return } + lastPos = pos; + + if (behavior.unit == "rectangle") { + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); + if (left == right) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } + else if (text.length > leftPos) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } + } + if (!ranges.length) { ranges.push(new Range(start, start)); } + setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var range$$1 = rangeForUnit(cm, pos, behavior.unit); + var anchor = oldRange.anchor, head; + if (cmp(range$$1.anchor, anchor) > 0) { + head = range$$1.head; + anchor = minPos(oldRange.from(), range$$1.anchor); + } else { + head = range$$1.anchor; + anchor = maxPos(oldRange.to(), range$$1.head); + } + var ranges$1 = startSel.ranges.slice(0); + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); + setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); + } + } + + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); + if (!cur) { return } + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) { setTimeout(operation(cm, function () { + if (counter != curCount) { return } + display.scroller.scrollTop += outside; + extend(e); + }), 50); } + } + } + + function done(e) { + cm.state.selectingText = false; + counter = Infinity; + // If e is null or undefined we interpret this as someone trying + // to explicitly cancel the selection rather than the user + // letting go of the mouse button. + if (e) { + e_preventDefault(e); + display.input.focus(); + } + off(display.wrapper.ownerDocument, "mousemove", move); + off(display.wrapper.ownerDocument, "mouseup", up); + doc.history.lastSelOrigin = null; + } + + var move = operation(cm, function (e) { + if (e.buttons === 0 || !e_button(e)) { done(e); } + else { extend(e); } + }); + var up = operation(cm, done); + cm.state.selectingText = up; + on(display.wrapper.ownerDocument, "mousemove", move); + on(display.wrapper.ownerDocument, "mouseup", up); + } + + // Used when mouse-selecting to adjust the anchor to the proper side + // of a bidi jump depending on the visual position of the head. + function bidiSimplify(cm, range$$1) { + var anchor = range$$1.anchor; + var head = range$$1.head; + var anchorLine = getLine(cm.doc, anchor.line); + if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 } + var order = getOrder(anchorLine); + if (!order) { return range$$1 } + var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index]; + if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 } + var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1); + if (boundary == 0 || boundary == order.length) { return range$$1 } + + // Compute the relative visual position of the head compared to the + // anchor (<0 is to the left, >0 to the right) + var leftSide; + if (head.line != anchor.line) { + leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0; + } else { + var headIndex = getBidiPartAt(order, head.ch, head.sticky); + var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1); + if (headIndex == boundary - 1 || headIndex == boundary) + { leftSide = dir < 0; } + else + { leftSide = dir > 0; } + } + + var usePart = order[boundary + (leftSide ? -1 : 0)]; + var from = leftSide == (usePart.level == 1); + var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before"; + return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head) + } + + + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent) { + var mX, mY; + if (e.touches) { + mX = e.touches[0].clientX; + mY = e.touches[0].clientY; + } else { + try { mX = e.clientX; mY = e.clientY; } + catch(e) { return false } + } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } + if (prevent) { e_preventDefault(e); } + + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); + + if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } + mY -= lineBox.top - display.viewOffset; + + for (var i = 0; i < cm.display.gutterSpecs.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.display.gutterSpecs[i]; + signal(cm, type, cm, line, gutter.className, e); + return e_defaultPrevented(e) + } + } + } + + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true) + } + + // CONTEXT MENU HANDLING + + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } + if (signalDOMEvent(cm, e, "contextmenu")) { return } + if (!captureRightClick) { cm.display.input.onContextMenu(e); } + } + + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) { return false } + return gutterEvent(cm, e, "gutterContextMenu", false) + } + + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + + var Init = {toString: function(){return "CodeMirror.Init"}}; + + var defaults = {}; + var optionHandlers = {}; + + function defineOptions(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) { optionHandlers[name] = + notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; } + } + + CodeMirror.defineOption = option; + + // Passed to option handlers when there is no old value. + CodeMirror.Init = Init; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function (cm, val) { return cm.setValue(val); }, true); + option("mode", null, function (cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function (cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + + option("lineSeparator", null, function (cm, val) { + cm.doc.lineSep = val; + if (!val) { return } + var newBreaks = [], lineNo = cm.doc.first; + cm.doc.iter(function (line) { + for (var pos = 0;;) { + var found = line.text.indexOf(val, pos); + if (found == -1) { break } + pos = found + val.length; + newBreaks.push(Pos(lineNo, found)); + } + lineNo++; + }); + for (var i = newBreaks.length - 1; i >= 0; i--) + { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); } + }); + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != Init) { cm.refresh(); } + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function () { + throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME + }, true); + option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true); + option("autocorrect", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true); + option("autocapitalize", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + + option("theme", "default", function (cm) { + themeChanged(cm); + updateGutters(cm); + }, true); + option("keyMap", "default", function (cm, val, old) { + var next = getKeyMap(val); + var prev = old != Init && getKeyMap(old); + if (prev && prev.detach) { prev.detach(cm, next); } + if (next.attach) { next.attach(cm, prev || null); } + }); + option("extraKeys", null); + option("configureMouse", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function (cm, val) { + cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers); + updateGutters(cm); + }, true); + option("fixedGutter", true, function (cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true); + option("scrollbarStyle", "native", function (cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function (cm, val) { + cm.display.gutterSpecs = getGutters(cm.options.gutters, val); + updateGutters(cm); + }, true); + option("firstLineNumber", 1, updateGutters, true); + option("lineNumberFormatter", function (integer) { return integer; }, updateGutters, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + option("pasteLinesPerSelection", true); + option("selectionsMayTouch", false); + + option("readOnly", false, function (cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + } + cm.display.input.readOnlyChanged(val); + }); + option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true); + option("dragDrop", true, dragDropChanged); + option("allowDropFileTypes", null); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function (cm, val) { + if (!val) { cm.display.input.resetPosition(); } + }); + + option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }); + option("autofocus", null); + option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true); + option("phrases", null); + } + + function dragDropChanged(cm, value, old) { + var wasOn = old && old != Init; + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.enter); + toggle(cm.display.scroller, "dragover", funcs.over); + toggle(cm.display.scroller, "dragleave", funcs.leave); + toggle(cm.display.scroller, "drop", funcs.drop); + } + } + + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function () { return updateScrollbars(cm); }, 100); + } + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. + + function CodeMirror(place, options) { + var this$1 = this; + + if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } + + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + + var doc = options.value; + if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); } + else if (options.mode) { doc.modeOption = options.mode; } + this.doc = doc; + + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input, options); + display.wrapper.CodeMirror = this; + themeChanged(this); + if (options.lineWrapping) + { this.display.wrapper.className += " CodeMirror-wrap"; } + initScrollbars(this); + + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll + selectingText: false, + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null, // Unfinished key sequence + specialChars: null + }; + + if (options.autofocus && !mobile) { display.input.focus(); } + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); } + + registerEventHandlers(this); + ensureGlobalHandlers(); + + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); + + if ((options.autofocus && !mobile) || this.hasFocus()) + { setTimeout(bind(onFocus, this), 20); } + else + { onBlur(this); } + + for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) + { optionHandlers[opt](this$1, options[opt], Init); } } + maybeUpdateLineNumberWidth(this); + if (options.finishInit) { options.finishInit(this); } + for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); } + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + { display.lineDiv.style.textRendering = "auto"; } + } + + // The default configuration options. + CodeMirror.defaults = defaults; + // Functions to run when options are changed. + CodeMirror.optionHandlers = optionHandlers; + + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + { on(d.scroller, "dblclick", operation(cm, function (e) { + if (signalDOMEvent(cm, e)) { return } + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); } + else + { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); } + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }); + + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0}; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date; + } + } + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) { return false } + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1 + } + function farAway(touch, other) { + if (other.left == null) { return true } + var dx = other.left - touch.left, dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20 + } + on(d.scroller, "touchstart", function (e) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { + d.input.ensurePolled(); + clearTimeout(touchFinished); + var now = +new Date; + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null}; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; + } + } + }); + on(d.scroller, "touchmove", function () { + if (d.activeTouch) { d.activeTouch.moved = true; } + }); + on(d.scroller, "touchend", function (e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range; + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + { range = new Range(pos, pos); } + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + { range = cm.findWordAt(pos); } + else // Triple tap + { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); } + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function () { + if (d.scroller.clientHeight) { + updateScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }); + on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }); + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + + d.dragFunctions = { + enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }}, + over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, + start: function (e) { return onDragStart(cm, e); }, + drop: operation(cm, onDrop), + leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} + }; + + var inp = d.input.getField(); + on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", function (e) { return onFocus(cm, e); }); + on(inp, "blur", function (e) { return onBlur(cm, e); }); + } + + var initHooks = []; + CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }; + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state; + if (how == null) { how = "add"; } + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) { how = "prev"; } + else { state = getContextBefore(cm, n).state; } + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) { line.stateAfter = null; } + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) { return } + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); } + else { indentation = 0; } + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} } + if (pos < indentation) { indentString += spaceStr(indentation - pos); } + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + return true + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { + var range = doc.sel.ranges[i$1]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos$1 = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)); + break + } + } + } + } + + // This will be set to a {lineWise: bool, text: [string]} object, so + // that, when pasting, we know what kind of selections the copied + // text was made out of. + var lastCopied = null; + + function setLastCopied(newLastCopied) { + lastCopied = newLastCopied; + } + + function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) { sel = doc.sel; } + + var recent = +new Date - 200; + var paste = origin == "paste" || cm.state.pasteIncoming > recent; + var textLines = splitLinesAuto(inserted), multiPaste = null; + // When pasting N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { + multiPaste = []; + for (var i = 0; i < lastCopied.text.length; i++) + { multiPaste.push(doc.splitLines(lastCopied.text[i])); } + } + } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { + multiPaste = map(textLines, function (l) { return [l]; }); + } + } + + var updateInput = cm.curOp.updateInput; + // Normal behavior is to insert the new text into every selection + for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { + var range$$1 = sel.ranges[i$1]; + var from = range$$1.from(), to = range$$1.to(); + if (range$$1.empty()) { + if (deleted && deleted > 0) // Handle deletion + { from = Pos(from.line, from.ch - deleted); } + else if (cm.state.overwrite && !paste) // Handle overwrite + { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); } + else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) + { from = to = Pos(from.line, 0); } + } + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming > recent ? "cut" : "+input")}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + } + if (inserted && !paste) + { triggerElectric(cm, inserted); } + + ensureCursorVisible(cm); + if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; } + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = -1; + } + + function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("Text"); + if (pasted) { + e.preventDefault(); + if (!cm.isReadOnly() && !cm.options.disableInput) + { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); } + return true + } + } + + function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) { return } + var sel = cm.doc.sel; + + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range$$1 = sel.ranges[i]; + if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue } + var mode = cm.getModeAt(range$$1.head); + var indented = false; + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range$$1.head.line, "smart"); + break + } } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch))) + { indented = indentLine(cm, range$$1.head.line, "smart"); } + } + if (indented) { signalLater(cm, "electricInput", cm, range$$1.head.line); } + } + } + + function copyableRanges(cm) { + var text = [], ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return {text: text, ranges: ranges} + } + + function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { + field.setAttribute("autocorrect", autocorrect ? "" : "off"); + field.setAttribute("autocapitalize", autocapitalize ? "" : "off"); + field.setAttribute("spellcheck", !!spellcheck); + } + + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) { te.style.width = "1000px"; } + else { te.setAttribute("wrap", "off"); } + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) { te.style.border = "1px solid black"; } + disableBrowserMagic(te); + return div + } + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + function addEditorMethods(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + + var helpers = CodeMirror.helpers = {}; + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){window.focus(); this.display.input.focus();}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") { return } + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + { operation(this, optionHandlers[option])(this, value, old); } + signal(this, "optionChange", this, option); + }, + + getOption: function(option) {return this.options[option]}, + getDoc: function() {return this.doc}, + + addKeyMap: function(map$$1, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map$$1)); + }, + removeKeyMap: function(map$$1) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) + { if (maps[i] == map$$1 || maps[i].name == map$$1) { + maps.splice(i, 1); + return true + } } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) { throw new Error("Overlays may not be stateful.") } + insertSorted(this.state.overlays, + {mode: mode, modeSpec: spec, opaque: options && options.opaque, + priority: (options && options.priority) || 0}, + function (overlay) { return overlay.priority; }); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function(spec) { + var this$1 = this; + + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this$1.state.modeGen++; + regChange(this$1); + return + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev"; } + else { dir = dir ? "add" : "subtract"; } + } + if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); } + }), + indentSelection: methodOp(function(how) { + var this$1 = this; + + var ranges = this.doc.sel.ranges, end = -1; + for (var i = 0; i < ranges.length; i++) { + var range$$1 = ranges[i]; + if (!range$$1.empty()) { + var from = range$$1.from(), to = range$$1.to(); + var start = Math.max(end, from.line); + end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) + { indentLine(this$1, j, how); } + var newRanges = this$1.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); } + } else if (range$$1.head.line > end) { + indentLine(this$1, range$$1.head.line, how, true); + end = range$$1.head.line; + if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); } + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise) + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true) + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; + var type; + if (ch == 0) { type = styles[2]; } + else { for (;;) { + var mid = (before + after) >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; } + else if (styles[mid * 2 + 1] < ch) { before = mid + 1; } + else { type = styles[mid * 2 + 2]; break } + } } + var cut = type ? type.indexOf("overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) + }, + + getModeAt: function(pos) { + var mode = this.doc.mode; + if (!mode.innerMode) { return mode } + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0] + }, + + getHelpers: function(pos, type) { + var this$1 = this; + + var found = []; + if (!helpers.hasOwnProperty(type)) { return found } + var help = helpers[type], mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) { found.push(help[mode[type]]); } + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) { found.push(val); } + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i$1 = 0; i$1 < help._global.length; i$1++) { + var cur = help._global[i$1]; + if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1) + { found.push(cur.val); } + } + return found + }, + + getStateAfter: function(line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getContextBefore(this, line + 1, precise).state + }, + + cursorCoords: function(start, mode) { + var pos, range$$1 = this.doc.sel.primary(); + if (start == null) { pos = range$$1.head; } + else if (typeof start == "object") { pos = clipPos(this.doc, start); } + else { pos = start ? range$$1.from() : range$$1.to(); } + return cursorCoords(this, pos, mode || "page") + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page") + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top) + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset) + }, + heightAtLine: function(line, mode, includeWidgets) { + var end = false, lineObj; + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) { line = this.doc.first; } + else if (line > last) { line = last; end = true; } + lineObj = getLine(this.doc, line); + } else { + lineObj = line; + } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + + (end ? this.doc.height - heightAtLine(lineObj) : 0) + }, + + defaultTextHeight: function() { return textHeight(this.display) }, + defaultCharWidth: function() { return charWidth(this.display) }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + { top = pos.top - node.offsetHeight; } + else if (pos.bottom + node.offsetHeight <= vspace) + { top = pos.bottom; } + if (left + node.offsetWidth > hspace) + { left = hspace - node.offsetWidth; } + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") { left = 0; } + else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; } + node.style.left = left + "px"; + } + if (scroll) + { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); } + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + triggerOnMouseDown: methodOp(onMouseDown), + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + { return commands[cmd].call(null, this) } + }, + + triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), + + findPosH: function(from, amount, unit, visually) { + var this$1 = this; + + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + cur = findPosH(this$1.doc, cur, dir, unit, visually); + if (cur.hitSide) { break } + } + return cur + }, + + moveH: methodOp(function(dir, unit) { + var this$1 = this; + + this.extendSelectionsBy(function (range$$1) { + if (this$1.display.shift || this$1.doc.extend || range$$1.empty()) + { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) } + else + { return dir < 0 ? range$$1.from() : range$$1.to() } + }, sel_move); + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc; + if (sel.somethingSelected()) + { doc.replaceSelection("", null, "+delete"); } + else + { deleteNearSelection(this, function (range$$1) { + var other = findPosH(doc, range$$1.head, dir, unit, false); + return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other} + }); } + }), + + findPosV: function(from, amount, unit, goalColumn) { + var this$1 = this; + + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + var coords = cursorCoords(this$1, cur, "div"); + if (x == null) { x = coords.left; } + else { coords.left = x; } + cur = findPosV(this$1, coords, dir, unit); + if (cur.hitSide) { break } + } + return cur + }, + + moveV: methodOp(function(dir, unit) { + var this$1 = this; + + var doc = this.doc, goals = []; + var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function (range$$1) { + if (collapse) + { return dir < 0 ? range$$1.from() : range$$1.to() } + var headPos = cursorCoords(this$1, range$$1.head, "div"); + if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; } + goals.push(headPos.left); + var pos = findPosV(this$1, headPos, dir, unit); + if (unit == "page" && range$$1 == doc.sel.primary()) + { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); } + return pos + }, sel_move); + if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) + { doc.sel.ranges[i].goalColumn = goals[i]; } } + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end; } + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) + ? function (ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } + : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }; + while (start > 0 && check(line.charAt(start - 1))) { --start; } + while (end < line.length && check(line.charAt(end))) { ++end; } + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)) + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) { return } + if (this.state.overwrite = !this.state.overwrite) + { addClass(this.display.cursorDiv, "CodeMirror-overwrite"); } + else + { rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); } + + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function() { return this.display.input.getField() == activeElt() }, + isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, + + scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), + getScrollInfo: function() { + var scroller = this.display.scroller; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)} + }, + + scrollIntoView: methodOp(function(range$$1, margin) { + if (range$$1 == null) { + range$$1 = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) { margin = this.options.cursorScrollMargin; } + } else if (typeof range$$1 == "number") { + range$$1 = {from: Pos(range$$1, 0), to: null}; + } else if (range$$1.from == null) { + range$$1 = {from: range$$1, to: null}; + } + if (!range$$1.to) { range$$1.to = range$$1.from; } + range$$1.margin = margin || 0; + + if (range$$1.from.line != null) { + scrollToRange(this, range$$1); + } else { + scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin); + } + }), + + setSize: methodOp(function(width, height) { + var this$1 = this; + + var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }; + if (width != null) { this.display.wrapper.style.width = interpret(width); } + if (height != null) { this.display.wrapper.style.height = interpret(height); } + if (this.options.lineWrapping) { clearLineMeasurementCache(this); } + var lineNo$$1 = this.display.viewFrom; + this.doc.iter(lineNo$$1, this.display.viewTo, function (line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) + { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, "widget"); break } } } + ++lineNo$$1; + }); + this.curOp.forceUpdate = true; + signal(this, "refresh", this); + }), + + operation: function(f){return runInOp(this, f)}, + startOperation: function(){return startOperation(this)}, + endOperation: function(){return endOperation(this)}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this.display); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) + { estimateLineHeights(this); } + signal(this, "refresh", this); + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc; + old.cm = null; + // Cancel the current text selection if any (#5821) + if (this.state.selectingText) { this.state.selectingText(); } + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + scrollToCoords(this, doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old + }), + + phrase: function(phraseText) { + var phrases = this.options.phrases; + return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText + }, + + getInputField: function(){return this.display.input.getField()}, + getWrapperElement: function(){return this.display.wrapper}, + getScrollerElement: function(){return this.display.scroller}, + getGutterElement: function(){return this.display.gutters} + }; + eventMixin(CodeMirror); + + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; } + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({pred: predicate, val: value}); + }; + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var oldPos = pos; + var origDir = dir; + var lineObj = getLine(doc, pos.line); + function findNextLine() { + var l = pos.line + dir; + if (l < doc.first || l >= doc.first + doc.size) { return false } + pos = new Pos(l, pos.ch, pos.sticky); + return lineObj = getLine(doc, l) + } + function moveOnce(boundToLine) { + var next; + if (visually) { + next = moveVisually(doc.cm, lineObj, pos, dir); + } else { + next = moveLogically(lineObj, pos, dir); + } + if (next == null) { + if (!boundToLine && findNextLine()) + { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); } + else + { return false } + } else { + pos = next; + } + return true + } + + if (unit == "char") { + moveOnce(); + } else if (unit == "column") { + moveOnce(true); + } else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) { break } + var cur = lineObj.text.charAt(pos.ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p"; + if (group && !first && !type) { type = "s"; } + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after";} + break + } + + if (type) { sawType = type; } + if (dir > 0 && !moveOnce(!first)) { break } + } + } + var result = skipAtomic(doc, pos, oldPos, origDir, true); + if (equalCursorPos(oldPos, result)) { result.hitSide = true; } + return result + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; + + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + var target; + for (;;) { + target = coordsChar(cm, x, y); + if (!target.outside) { break } + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } + y += dir * 5; + } + return target + } + + // CONTENTEDITABLE INPUT STYLE + + var ContentEditableInput = function(cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.composing = null; + this.gracePeriod = false; + this.readDOMTimeout = null; + }; + + ContentEditableInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = input.cm; + var div = input.div = display.lineDiv; + disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize); + + on(div, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + // IE doesn't fire input events, so we schedule a read for the pasted content in this way + if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); } + }); + + on(div, "compositionstart", function (e) { + this$1.composing = {data: e.data, done: false}; + }); + on(div, "compositionupdate", function (e) { + if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; } + }); + on(div, "compositionend", function (e) { + if (this$1.composing) { + if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); } + this$1.composing.done = true; + } + }); + + on(div, "touchstart", function () { return input.forceCompositionEnd(); }); + + on(div, "input", function () { + if (!this$1.composing) { this$1.readFromDOMSoon(); } + }); + + function onCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}); + if (e.type == "cut") { cm.replaceSelection("", null, "cut"); } + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm); + setLastCopied({lineWise: true, text: ranges.text}); + if (e.type == "cut") { + cm.operation(function () { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } + } + if (e.clipboardData) { + e.clipboardData.clearData(); + var content = lastCopied.text.join("\n"); + // iOS exposes the clipboard API, but seems to discard content inserted into it + e.clipboardData.setData("Text", content); + if (e.clipboardData.getData("Text") == content) { + e.preventDefault(); + return + } + } + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.text.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function () { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + if (hadFocus == div) { input.showPrimarySelection(); } + }, 50); + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }; + + ContentEditableInput.prototype.prepareSelection = function () { + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; + return result + }; + + ContentEditableInput.prototype.showSelection = function (info, takeFocus) { + if (!info || !this.cm.display.view.length) { return } + if (info.focus || takeFocus) { this.showPrimarySelection(); } + this.showMultipleSelections(info); + }; + + ContentEditableInput.prototype.getSelection = function () { + return this.cm.display.wrapper.ownerDocument.getSelection() + }; + + ContentEditableInput.prototype.showPrimarySelection = function () { + var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary(); + var from = prim.from(), to = prim.to(); + + if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { + sel.removeAllRanges(); + return + } + + var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), from) == 0 && + cmp(maxPos(curAnchor, curFocus), to) == 0) + { return } + + var view = cm.display.view; + var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || + {node: view[0].measure.map[2], offset: 0}; + var end = to.line < cm.display.viewTo && posToDOM(cm, to); + if (!end) { + var measure = view[view.length - 1].measure; + var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]}; + } + + if (!start || !end) { + sel.removeAllRanges(); + return + } + + var old = sel.rangeCount && sel.getRangeAt(0), rng; + try { rng = range(start.node, start.offset, end.offset, end.node); } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + if (!gecko && cm.state.focused) { + sel.collapse(start.node, start.offset); + if (!rng.collapsed) { + sel.removeAllRanges(); + sel.addRange(rng); + } + } else { + sel.removeAllRanges(); + sel.addRange(rng); + } + if (old && sel.anchorNode == null) { sel.addRange(old); } + else if (gecko) { this.startGracePeriod(); } + } + this.rememberSelection(); + }; + + ContentEditableInput.prototype.startGracePeriod = function () { + var this$1 = this; + + clearTimeout(this.gracePeriod); + this.gracePeriod = setTimeout(function () { + this$1.gracePeriod = false; + if (this$1.selectionChanged()) + { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); } + }, 20); + }; + + ContentEditableInput.prototype.showMultipleSelections = function (info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); + }; + + ContentEditableInput.prototype.rememberSelection = function () { + var sel = this.getSelection(); + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; + }; + + ContentEditableInput.prototype.selectionInEditor = function () { + var sel = this.getSelection(); + if (!sel.rangeCount) { return false } + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node) + }; + + ContentEditableInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor") { + if (!this.selectionInEditor()) + { this.showSelection(this.prepareSelection(), true); } + this.div.focus(); + } + }; + ContentEditableInput.prototype.blur = function () { this.div.blur(); }; + ContentEditableInput.prototype.getField = function () { return this.div }; + + ContentEditableInput.prototype.supportsTouch = function () { return true }; + + ContentEditableInput.prototype.receivedFocus = function () { + var input = this; + if (this.selectionInEditor()) + { this.pollSelection(); } + else + { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); } + + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); + }; + + ContentEditableInput.prototype.selectionChanged = function () { + var sel = this.getSelection(); + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset + }; + + ContentEditableInput.prototype.pollSelection = function () { + if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } + var sel = this.getSelection(), cm = this.cm; + // On Android Chrome (version 56, at least), backspacing into an + // uneditable block element will put the cursor in that element, + // and then, because it's not editable, hide the virtual keyboard. + // Because Android doesn't allow us to actually detect backspace + // presses in a sane way, this code checks for when that happens + // and simulates a backspace press in this case. + if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) { + this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}); + this.blur(); + this.focus(); + return + } + if (this.composing) { return } + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) { runInOp(cm, function () { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; } + }); } + }; + + ContentEditableInput.prototype.pollContent = function () { + if (this.readDOMTimeout != null) { + clearTimeout(this.readDOMTimeout); + this.readDOMTimeout = null; + } + + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); + var from = sel.from(), to = sel.to(); + if (from.ch == 0 && from.line > cm.firstLine()) + { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); } + if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) + { to = Pos(to.line + 1, 0); } + if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } + + var fromIndex, fromLine, fromNode; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + fromLine = lineNo(display.view[0].line); + fromNode = display.view[0].node; + } else { + fromLine = lineNo(display.view[fromIndex].line); + fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + var toLine, toNode; + if (toIndex == display.view.length - 1) { + toLine = display.viewTo - 1; + toNode = display.lineDiv.lastChild; + } else { + toLine = lineNo(display.view[toIndex + 1].line) - 1; + toNode = display.view[toIndex + 1].node.previousSibling; + } + + if (!fromNode) { return false } + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } + else { break } + } + + var cutFront = 0, cutEnd = 0; + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + { ++cutFront; } + var newBot = lst(newText), oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + { ++cutEnd; } + // Try to move start of change to start of selection if ambiguous + if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { + while (cutFront && cutFront > from.ch && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + cutFront--; + cutEnd++; + } + } + + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); + newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); + + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true + } + }; + + ContentEditableInput.prototype.ensurePolled = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.reset = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.forceCompositionEnd = function () { + if (!this.composing) { return } + clearTimeout(this.readDOMTimeout); + this.composing = null; + this.updateFromDOM(); + this.div.blur(); + this.div.focus(); + }; + ContentEditableInput.prototype.readFromDOMSoon = function () { + var this$1 = this; + + if (this.readDOMTimeout != null) { return } + this.readDOMTimeout = setTimeout(function () { + this$1.readDOMTimeout = null; + if (this$1.composing) { + if (this$1.composing.done) { this$1.composing = null; } + else { return } + } + this$1.updateFromDOM(); + }, 80); + }; + + ContentEditableInput.prototype.updateFromDOM = function () { + var this$1 = this; + + if (this.cm.isReadOnly() || !this.pollContent()) + { runInOp(this.cm, function () { return regChange(this$1.cm); }); } + }; + + ContentEditableInput.prototype.setUneditable = function (node) { + node.contentEditable = "false"; + }; + + ContentEditableInput.prototype.onKeyPress = function (e) { + if (e.charCode == 0 || this.composing) { return } + e.preventDefault(); + if (!this.cm.isReadOnly()) + { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); } + }; + + ContentEditableInput.prototype.readOnlyChanged = function (val) { + this.div.contentEditable = String(val != "nocursor"); + }; + + ContentEditableInput.prototype.onContextMenu = function () {}; + ContentEditableInput.prototype.resetPosition = function () {}; + + ContentEditableInput.prototype.needsContentAttribute = true; + + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) { return null } + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); + + var order = getOrder(line, cm.doc.direction), side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result + } + + function isInGutter(node) { + for (var scan = node; scan; scan = scan.parentNode) + { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } + return false + } + + function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } + + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false; + function recognizeMarker(id) { return function (marker) { return marker.id == id; } } + function close() { + if (closing) { + text += lineSep; + if (extraLinebreak) { text += lineSep; } + closing = extraLinebreak = false; + } + } + function addText(str) { + if (str) { + close(); + text += str; + } + } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText) { + addText(cmText); + return + } + var markerID = node.getAttribute("cm-marker"), range$$1; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range$$1 = found[0].find(0))) + { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); } + return + } + if (node.getAttribute("contenteditable") == "false") { return } + var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName); + if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return } + + if (isBlock) { close(); } + for (var i = 0; i < node.childNodes.length; i++) + { walk(node.childNodes[i]); } + + if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; } + if (isBlock) { closing = true; } + } else if (node.nodeType == 3) { + addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); + } + } + for (;;) { + walk(from); + if (from == to) { break } + from = from.nextSibling; + extraLinebreak = false; + } + return text + } + + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } + node = null; offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) { return null } + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break } + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) + { return locateNodeInLineView(lineView, node, offset) } + } + } + + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false; + if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad) + } + } + + var textNode = node.nodeType == 3 ? node : null, topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) { offset = textNode.nodeValue.length; } + } + while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; } + var measure = lineView.measure, maps = measure.maps; + + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map$$1 = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map$$1.length; j += 3) { + var curNode = map$$1[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map$$1[j] + offset; + if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; } + return Pos(line, ch) + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) { return badPos(found, bad) } + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) + { return badPos(Pos(found.line, found.ch - dist), bad) } + else + { dist += after.textContent.length; } + } + for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) + { return badPos(Pos(found.line, found.ch + dist$1), bad) } + else + { dist$1 += before.textContent.length; } + } + } + + // TEXTAREA INPUT STYLE + + var TextareaInput = function(cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + this.composing = null; + }; + + TextareaInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = this.cm; + this.createField(display); + var te = this.textarea; + + display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) { te.style.width = "0px"; } + + on(te, "input", function () { + if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; } + input.poll(); + }); + + on(te, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + + cm.state.pasteIncoming = +new Date; + input.fastPoll(); + }); + + function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}); + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm); + setLastCopied({lineWise: true, text: ranges.text}); + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") { cm.state.cutIncoming = +new Date; } + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); + + on(display.scroller, "paste", function (e) { + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } + if (!te.dispatchEvent) { + cm.state.pasteIncoming = +new Date; + input.focus(); + return + } + + // Pass the `paste` event to the textarea so it's handled by its event listener. + var event = new Event("paste"); + event.clipboardData = e.clipboardData; + te.dispatchEvent(event); + }); + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function (e) { + if (!eventInWidget(display, e)) { e_preventDefault(e); } + }); + + on(te, "compositionstart", function () { + var start = cm.getCursor("from"); + if (input.composing) { input.composing.range.clear(); } + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) + }; + }); + on(te, "compositionend", function () { + if (input.composing) { + input.poll(); + input.composing.range.clear(); + input.composing = null; + } + }); + }; + + TextareaInput.prototype.createField = function (_display) { + // Wraps and hides input textarea + this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + this.textarea = this.wrapper.firstChild; + }; + + TextareaInput.prototype.prepareSelection = function () { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc; + var result = prepareSelection(cm); + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); + } + + return result + }; + + TextareaInput.prototype.showSelection = function (drawn) { + var cm = this.cm, display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }; + + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + TextareaInput.prototype.reset = function (typing) { + if (this.contextMenuPending || this.composing) { return } + var cm = this.cm; + if (cm.somethingSelected()) { + this.prevInput = ""; + var content = cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) { selectInput(this.textarea); } + if (ie && ie_version >= 9) { this.hasSelection = content; } + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) { this.hasSelection = null; } + } + }; + + TextareaInput.prototype.getField = function () { return this.textarea }; + + TextareaInput.prototype.supportsTouch = function () { return false }; + + TextareaInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { this.textarea.focus(); } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }; + + TextareaInput.prototype.blur = function () { this.textarea.blur(); }; + + TextareaInput.prototype.resetPosition = function () { + this.wrapper.style.top = this.wrapper.style.left = 0; + }; + + TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); }; + + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + TextareaInput.prototype.slowPoll = function () { + var this$1 = this; + + if (this.pollingFast) { return } + this.polling.set(this.cm.options.pollInterval, function () { + this$1.poll(); + if (this$1.cm.state.focused) { this$1.slowPoll(); } + }); + }; + + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + TextareaInput.prototype.fastPoll = function () { + var missed = false, input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) {missed = true; input.polling.set(60, p);} + else {input.pollingFast = false; input.slowPoll();} + } + input.polling.set(20, p); + }; + + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + TextareaInput.prototype.poll = function () { + var this$1 = this; + + var cm = this.cm, input = this.textarea, prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || + (hasSelection(input) && !prevInput && !this.composing) || + cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) + { return false } + + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) { return false } + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false + } + + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) { prevInput = "\u200b"; } + if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } + } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; } + + runInOp(cm, function () { + applyTextInput(cm, text.slice(same), prevInput.length - same, + null, this$1.composing ? "*compose" : null); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; } + else { this$1.prevInput = text; } + + if (this$1.composing) { + this$1.composing.range.clear(); + this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), + {className: "CodeMirror-composing"}); + } + }); + return true + }; + + TextareaInput.prototype.ensurePolled = function () { + if (this.pollingFast && this.poll()) { this.pollingFast = false; } + }; + + TextareaInput.prototype.onKeyPress = function () { + if (ie && ie_version >= 9) { this.hasSelection = null; } + this.fastPoll(); + }; + + TextareaInput.prototype.onContextMenu = function (e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea; + if (input.contextMenuPending) { input.contextMenuPending(); } + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || presto) { return } // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) + { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); } + + var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; + var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect(); + input.wrapper.style.cssText = "position: static"; + te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + var oldScrollY; + if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) { window.scrollTo(null, oldScrollY); } + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) { te.value = input.prevInput = " "; } + input.contextMenuPending = rehide; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; + } + } + function rehide() { + if (input.contextMenuPending != rehide) { return } + input.contextMenuPending = false; + input.wrapper.style.cssText = oldWrapperCSS; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); } + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); } + var i = 0, poll = function () { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && + te.selectionEnd > 0 && input.prevInput == "\u200b") { + operation(cm, selectAll)(cm); + } else if (i++ < 10) { + display.detectingSelectAll = setTimeout(poll, 500); + } else { + display.selForContextMenu = null; + display.input.reset(); + } + }; + display.detectingSelectAll = setTimeout(poll, 200); + } + } + + if (ie && ie_version >= 9) { prepareSelectAllHack(); } + if (captureRightClick) { + e_stop(e); + var mouseup = function () { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + }; + + TextareaInput.prototype.readOnlyChanged = function (val) { + if (!val) { this.reset(); } + this.textarea.disabled = val == "nocursor"; + }; + + TextareaInput.prototype.setUneditable = function () {}; + + TextareaInput.prototype.needsContentAttribute = false; + + function fromTextArea(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) + { options.tabindex = textarea.tabIndex; } + if (!options.placeholder && textarea.placeholder) + { options.placeholder = textarea.placeholder; } + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(); + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + + var realSubmit; + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form; + realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function () { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + } + + options.finishInit = function (cm) { + cm.save = save; + cm.getTextArea = function () { return textarea; }; + cm.toTextArea = function () { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") + { textarea.form.submit = realSubmit; } + } + }; + }; + + textarea.style.display = "none"; + var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, + options); + return cm + } + + function addLegacyProps(CodeMirror) { + CodeMirror.off = off; + CodeMirror.on = on; + CodeMirror.wheelEventPixels = wheelEventPixels; + CodeMirror.Doc = Doc; + CodeMirror.splitLines = splitLinesAuto; + CodeMirror.countColumn = countColumn; + CodeMirror.findColumn = findColumn; + CodeMirror.isWordChar = isWordCharBasic; + CodeMirror.Pass = Pass; + CodeMirror.signal = signal; + CodeMirror.Line = Line; + CodeMirror.changeEnd = changeEnd; + CodeMirror.scrollbarModel = scrollbarModel; + CodeMirror.Pos = Pos; + CodeMirror.cmpPos = cmp; + CodeMirror.modes = modes; + CodeMirror.mimeModes = mimeModes; + CodeMirror.resolveMode = resolveMode; + CodeMirror.getMode = getMode; + CodeMirror.modeExtensions = modeExtensions; + CodeMirror.extendMode = extendMode; + CodeMirror.copyState = copyState; + CodeMirror.startState = startState; + CodeMirror.innerMode = innerMode; + CodeMirror.commands = commands; + CodeMirror.keyMap = keyMap; + CodeMirror.keyName = keyName; + CodeMirror.isModifierKey = isModifierKey; + CodeMirror.lookupKey = lookupKey; + CodeMirror.normalizeKeyMap = normalizeKeyMap; + CodeMirror.StringStream = StringStream; + CodeMirror.SharedTextMarker = SharedTextMarker; + CodeMirror.TextMarker = TextMarker; + CodeMirror.LineWidget = LineWidget; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + CodeMirror.e_stop = e_stop; + CodeMirror.addClass = addClass; + CodeMirror.contains = contains; + CodeMirror.rmClass = rmClass; + CodeMirror.keyNames = keyNames; + } + + // EDITOR CONSTRUCTOR + + defineOptions(CodeMirror); + + addEditorMethods(CodeMirror); + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); + for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + { CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments)} + })(Doc.prototype[prop]); } } + + eventMixin(Doc); + CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function(name/*, mode, 鈥�*/) { + if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name; } + defineMode.apply(this, arguments); + }; + + CodeMirror.defineMIME = defineMIME; + + // Minimal default mode. + CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }); + CodeMirror.defineMIME("text/plain", "null"); + + // EXTENSIONS + + CodeMirror.defineExtension = function (name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function (name, func) { + Doc.prototype[name] = func; + }; + + CodeMirror.fromTextArea = fromTextArea; + + addLegacyProps(CodeMirror); + + CodeMirror.version = "5.48.4"; + + return CodeMirror; + +}))); diff --git a/phpMyAdmin/js/vendor/codemirror/mode/javascript/javascript.js b/phpMyAdmin/js/vendor/codemirror/mode/javascript/javascript.js new file mode 100755 index 0000000..8055f1b --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/mode/javascript/javascript.js @@ -0,0 +1,927 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var statementIndent = parserConfig.statementIndent; + var jsonldMode = parserConfig.jsonld; + var jsonMode = parserConfig.json || jsonldMode; + var isTS = parserConfig.typescript; + var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + + return { + "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C, + "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, + "this": kw("this"), "class": kw("class"), "super": kw("atom"), + "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, + "await": C + }; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|~^@]/; + var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; + + function readRegexp(stream) { + var escaped = false, next, inSet = false; + while ((next = stream.next()) != null) { + if (!escaped) { + if (next == "/" && !inSet) return; + if (next == "[") inSet = true; + else if (inSet && next == "]") inSet = false; + } + escaped = !escaped && next == "\\"; + } + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) { + return ret("number", "number"); + } else if (ch == "." && stream.match("..")) { + return ret("spread", "meta"); + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return ret(ch); + } else if (ch == "=" && stream.eat(">")) { + return ret("=>", "operator"); + } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) { + return ret("number", "number"); + } else if (/\d/.test(ch)) { + stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/); + return ret("number", "number"); + } else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } else if (expressionAllowed(stream, state, 1)) { + readRegexp(stream); + stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/); + return ret("regexp", "string-2"); + } else { + stream.eat("="); + return ret("operator", "operator", stream.current()); + } + } else if (ch == "`") { + state.tokenize = tokenQuasi; + return tokenQuasi(stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } else if (isOperatorChar.test(ch)) { + if (ch != ">" || !state.lexical || state.lexical.type != ">") { + if (stream.eat("=")) { + if (ch == "!" || ch == "=") stream.eat("=") + } else if (/[<>*+\-]/.test(ch)) { + stream.eat(ch) + if (ch == ">") stream.eat(ch) + } + } + return ret("operator", "operator", stream.current()); + } else if (wordRE.test(ch)) { + stream.eatWhile(wordRE); + var word = stream.current() + if (state.lastType != ".") { + if (keywords.propertyIsEnumerable(word)) { + var kw = keywords[word] + return ret(kw.type, kw.style, word) + } + if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false)) + return ret("async", "keyword", word) + } + return ret("variable", "variable", word) + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next; + if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ + state.tokenize = tokenBase; + return ret("jsonld-keyword", "meta"); + } + while ((next = stream.next()) != null) { + if (next == quote && !escaped) break; + escaped = !escaped && next == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenQuasi(stream, state) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && next == "\\"; + } + return ret("quasi", "string-2", stream.current()); + } + + var brackets = "([{}])"; + // This is a crude lookahead trick to try and notice that we're + // parsing the argument patterns for a fat-arrow function before we + // actually hit the arrow token. It only works if the arrow is on + // the same line as the arguments and there's no strange noise + // (comments) in between. Fallback is to only notice when we hit the + // arrow, and not declare the arguments as locals for the arrow + // body. + function findFatArrow(stream, state) { + if (state.fatArrowAt) state.fatArrowAt = null; + var arrow = stream.string.indexOf("=>", stream.start); + if (arrow < 0) return; + + if (isTS) { // Try to skip TypeScript return type declarations after the arguments + var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow)) + if (m) arrow = m.index + } + + var depth = 0, sawSomething = false; + for (var pos = arrow - 1; pos >= 0; --pos) { + var ch = stream.string.charAt(pos); + var bracket = brackets.indexOf(ch); + if (bracket >= 0 && bracket < 3) { + if (!depth) { ++pos; break; } + if (--depth == 0) { if (ch == "(") sawSomething = true; break; } + } else if (bracket >= 3 && bracket < 6) { + ++depth; + } else if (wordRE.test(ch)) { + sawSomething = true; + } else if (/["'\/`]/.test(ch)) { + for (;; --pos) { + if (pos == 0) return + var next = stream.string.charAt(pos - 1) + if (next == ch && stream.string.charAt(pos - 2) != "\\") { pos--; break } + } + } else if (sawSomething && !depth) { + ++pos; + break; + } + } + if (sawSomething && !depth) state.fatArrowAt = pos; + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + for (var cx = state.context; cx; cx = cx.prev) { + for (var v = cx.vars; v; v = v.next) + if (v.name == varname) return true; + } + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function inList(name, list) { + for (var v = list; v; v = v.next) if (v.name == name) return true + return false; + } + function register(varname) { + var state = cx.state; + cx.marked = "def"; + if (state.context) { + if (state.lexical.info == "var" && state.context && state.context.block) { + // FIXME function decls are also not block scoped + var newContext = registerVarScoped(varname, state.context) + if (newContext != null) { + state.context = newContext + return + } + } else if (!inList(varname, state.localVars)) { + state.localVars = new Var(varname, state.localVars) + return + } + } + // Fall through means this is global + if (parserConfig.globalVars && !inList(varname, state.globalVars)) + state.globalVars = new Var(varname, state.globalVars) + } + function registerVarScoped(varname, context) { + if (!context) { + return null + } else if (context.block) { + var inner = registerVarScoped(varname, context.prev) + if (!inner) return null + if (inner == context.prev) return context + return new Context(inner, context.vars, true) + } else if (inList(varname, context.vars)) { + return context + } else { + return new Context(context.prev, new Var(varname, context.vars), false) + } + } + + function isModifier(name) { + return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly" + } + + // Combinators + + function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block } + function Var(name, next) { this.name = name; this.next = next } + + var defaultVars = new Var("this", new Var("arguments", null)) + function pushcontext() { + cx.state.context = new Context(cx.state.context, cx.state.localVars, false) + cx.state.localVars = defaultVars + } + function pushblockcontext() { + cx.state.context = new Context(cx.state.context, cx.state.localVars, true) + cx.state.localVars = null + } + function popcontext() { + cx.state.localVars = cx.state.context.vars + cx.state.context = cx.state.context.prev + } + popcontext.lex = true + function pushlex(type, info) { + var result = function() { + var state = cx.state, indent = state.indented; + if (state.lexical.type == "stat") indent = state.lexical.indented; + else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) + indent = outer.indented; + state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + function exp(type) { + if (type == wanted) return cont(); + else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass(); + else return cont(exp); + }; + return exp; + } + + function statement(type, value) { + if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex); + if (type == "debugger") return cont(expect(";")); + if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext); + if (type == ";") return cont(); + if (type == "if") { + if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) + cx.state.cc.pop()(); + return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse); + } + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); + if (type == "class" || (isTS && value == "interface")) { + cx.marked = "keyword" + return cont(pushlex("form", type == "class" ? type : value), className, poplex) + } + if (type == "variable") { + if (isTS && value == "declare") { + cx.marked = "keyword" + return cont(statement) + } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) { + cx.marked = "keyword" + if (value == "enum") return cont(enumdef); + else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";")); + else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex) + } else if (isTS && value == "namespace") { + cx.marked = "keyword" + return cont(pushlex("form"), expression, statement, poplex) + } else if (isTS && value == "abstract") { + cx.marked = "keyword" + return cont(statement) + } else { + return cont(pushlex("stat"), maybelabel); + } + } + if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext, + block, poplex, poplex, popcontext); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext); + if (type == "export") return cont(pushlex("stat"), afterExport, poplex); + if (type == "import") return cont(pushlex("stat"), afterImport, poplex); + if (type == "async") return cont(statement) + if (value == "@") return cont(expression, statement) + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function maybeCatchBinding(type) { + if (type == "(") return cont(funarg, expect(")")) + } + function expression(type, value) { + return expressionInner(type, value, false); + } + function expressionNoComma(type, value) { + return expressionInner(type, value, true); + } + function parenExpr(type) { + if (type != "(") return pass() + return cont(pushlex(")"), expression, expect(")"), poplex) + } + function expressionInner(type, value, noComma) { + if (cx.state.fatArrowAt == cx.stream.start) { + var body = noComma ? arrowBodyNoComma : arrowBody; + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext); + else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); + } + + var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; + if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); + if (type == "function") return cont(functiondef, maybeop); + if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); } + if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression); + if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); + if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); + if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); + if (type == "{") return contCommasep(objprop, "}", null, maybeop); + if (type == "quasi") return pass(quasi, maybeop); + if (type == "new") return cont(maybeTarget(noComma)); + if (type == "import") return cont(expression); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + + function maybeoperatorComma(type, value) { + if (type == ",") return cont(expression); + return maybeoperatorNoComma(type, value, false); + } + function maybeoperatorNoComma(type, value, noComma) { + var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; + var expr = noComma == false ? expression : expressionNoComma; + if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); + if (type == "operator") { + if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); + if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false)) + return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); + if (value == "?") return cont(expression, expect(":"), expr); + return cont(expr); + } + if (type == "quasi") { return pass(quasi, me); } + if (type == ";") return; + if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); + if (type == ".") return cont(property, me); + if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); + if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) } + if (type == "regexp") { + cx.state.lastType = cx.marked = "operator" + cx.stream.backUp(cx.stream.pos - cx.stream.start - 1) + return cont(expr) + } + } + function quasi(type, value) { + if (type != "quasi") return pass(); + if (value.slice(value.length - 2) != "${") return cont(quasi); + return cont(expression, continueQuasi); + } + function continueQuasi(type) { + if (type == "}") { + cx.marked = "string-2"; + cx.state.tokenize = tokenQuasi; + return cont(quasi); + } + } + function arrowBody(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expression); + } + function arrowBodyNoComma(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expressionNoComma); + } + function maybeTarget(noComma) { + return function(type) { + if (type == ".") return cont(noComma ? targetNoComma : target); + else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma) + else return pass(noComma ? expressionNoComma : expression); + }; + } + function target(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } + } + function targetNoComma(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperatorComma, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type, value) { + if (type == "async") { + cx.marked = "property"; + return cont(objprop); + } else if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + if (value == "get" || value == "set") return cont(getterSetter); + var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params + if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false))) + cx.state.fatArrowAt = cx.stream.pos + m[0].length + return cont(afterprop); + } else if (type == "number" || type == "string") { + cx.marked = jsonldMode ? "property" : (cx.style + " property"); + return cont(afterprop); + } else if (type == "jsonld-keyword") { + return cont(afterprop); + } else if (isTS && isModifier(value)) { + cx.marked = "keyword" + return cont(objprop) + } else if (type == "[") { + return cont(expression, maybetype, expect("]"), afterprop); + } else if (type == "spread") { + return cont(expressionNoComma, afterprop); + } else if (value == "*") { + cx.marked = "keyword"; + return cont(objprop); + } else if (type == ":") { + return pass(afterprop) + } + } + function getterSetter(type) { + if (type != "variable") return pass(afterprop); + cx.marked = "property"; + return cont(functiondef); + } + function afterprop(type) { + if (type == ":") return cont(expressionNoComma); + if (type == "(") return pass(functiondef); + } + function commasep(what, end, sep) { + function proceed(type, value) { + if (sep ? sep.indexOf(type) > -1 : type == ",") { + var lex = cx.state.lexical; + if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; + return cont(function(type, value) { + if (type == end || value == end) return pass() + return pass(what) + }, proceed); + } + if (type == end || value == end) return cont(); + if (sep && sep.indexOf(";") > -1) return pass(what) + return cont(expect(end)); + } + return function(type, value) { + if (type == end || value == end) return cont(); + return pass(what, proceed); + }; + } + function contCommasep(what, end, info) { + for (var i = 3; i < arguments.length; i++) + cx.cc.push(arguments[i]); + return cont(pushlex(end, info), commasep(what, end), poplex); + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function maybetype(type, value) { + if (isTS) { + if (type == ":") return cont(typeexpr); + if (value == "?") return cont(maybetype); + } + } + function maybetypeOrIn(type, value) { + if (isTS && (type == ":" || value == "in")) return cont(typeexpr) + } + function mayberettype(type) { + if (isTS && type == ":") { + if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr) + else return cont(typeexpr) + } + } + function isKW(_, value) { + if (value == "is") { + cx.marked = "keyword" + return cont() + } + } + function typeexpr(type, value) { + if (value == "keyof" || value == "typeof" || value == "infer") { + cx.marked = "keyword" + return cont(value == "typeof" ? expressionNoComma : typeexpr) + } + if (type == "variable" || value == "void") { + cx.marked = "type" + return cont(afterType) + } + if (value == "|" || value == "&") return cont(typeexpr) + if (type == "string" || type == "number" || type == "atom") return cont(afterType); + if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) + if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType) + if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType) + if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr) + } + function maybeReturnType(type) { + if (type == "=>") return cont(typeexpr) + } + function typeprop(type, value) { + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property" + return cont(typeprop) + } else if (value == "?" || type == "number" || type == "string") { + return cont(typeprop) + } else if (type == ":") { + return cont(typeexpr) + } else if (type == "[") { + return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop) + } else if (type == "(") { + return pass(functiondecl, typeprop) + } + } + function typearg(type, value) { + if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg) + if (type == ":") return cont(typeexpr) + if (type == "spread") return cont(typearg) + return pass(typeexpr) + } + function afterType(type, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) + if (value == "|" || type == "." || value == "&") return cont(typeexpr) + if (type == "[") return cont(typeexpr, expect("]"), afterType) + if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) } + if (value == "?") return cont(typeexpr, expect(":"), typeexpr) + } + function maybeTypeArgs(_, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) + } + function typeparam() { + return pass(typeexpr, maybeTypeDefault) + } + function maybeTypeDefault(_, value) { + if (value == "=") return cont(typeexpr) + } + function vardef(_, value) { + if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)} + return pass(pattern, maybetype, maybeAssign, vardefCont); + } + function pattern(type, value) { + if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) } + if (type == "variable") { register(value); return cont(); } + if (type == "spread") return cont(pattern); + if (type == "[") return contCommasep(eltpattern, "]"); + if (type == "{") return contCommasep(proppattern, "}"); + } + function proppattern(type, value) { + if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { + register(value); + return cont(maybeAssign); + } + if (type == "variable") cx.marked = "property"; + if (type == "spread") return cont(pattern); + if (type == "}") return pass(); + if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern); + return cont(expect(":"), pattern, maybeAssign); + } + function eltpattern() { + return pass(pattern, maybeAssign) + } + function maybeAssign(_type, value) { + if (value == "=") return cont(expressionNoComma); + } + function vardefCont(type) { + if (type == ",") return cont(vardef); + } + function maybeelse(type, value) { + if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); + } + function forspec(type, value) { + if (value == "await") return cont(forspec); + if (type == "(") return cont(pushlex(")"), forspec1, poplex); + } + function forspec1(type) { + if (type == "var") return cont(vardef, forspec2); + if (type == "variable") return cont(forspec2); + return pass(forspec2) + } + function forspec2(type, value) { + if (type == ")") return cont() + if (type == ";") return cont(forspec2) + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) } + return pass(expression, forspec2) + } + function functiondef(type, value) { + if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); + if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef) + } + function functiondecl(type, value) { + if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);} + if (type == "variable") {register(value); return cont(functiondecl);} + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext); + if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl) + } + function typename(type, value) { + if (type == "keyword" || type == "variable") { + cx.marked = "type" + return cont(typename) + } else if (value == "<") { + return cont(pushlex(">"), commasep(typeparam, ">"), poplex) + } + } + function funarg(type, value) { + if (value == "@") cont(expression, funarg) + if (type == "spread") return cont(funarg); + if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); } + if (isTS && type == "this") return cont(maybetype, maybeAssign) + return pass(pattern, maybetype, maybeAssign); + } + function classExpression(type, value) { + // Class expressions may have an optional name. + if (type == "variable") return className(type, value); + return classNameAfter(type, value); + } + function className(type, value) { + if (type == "variable") {register(value); return cont(classNameAfter);} + } + function classNameAfter(type, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter) + if (value == "extends" || value == "implements" || (isTS && type == ",")) { + if (value == "implements") cx.marked = "keyword"; + return cont(isTS ? typeexpr : expression, classNameAfter); + } + if (type == "{") return cont(pushlex("}"), classBody, poplex); + } + function classBody(type, value) { + if (type == "async" || + (type == "variable" && + (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && + cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { + cx.marked = "keyword"; + return cont(classBody); + } + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + return cont(isTS ? classfield : functiondef, classBody); + } + if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody); + if (type == "[") + return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody) + if (value == "*") { + cx.marked = "keyword"; + return cont(classBody); + } + if (isTS && type == "(") return pass(functiondecl, classBody) + if (type == ";" || type == ",") return cont(classBody); + if (type == "}") return cont(); + if (value == "@") return cont(expression, classBody) + } + function classfield(type, value) { + if (value == "?") return cont(classfield) + if (type == ":") return cont(typeexpr, maybeAssign) + if (value == "=") return cont(expressionNoComma) + var context = cx.state.lexical.prev, isInterface = context && context.info == "interface" + return pass(isInterface ? functiondecl : functiondef) + } + function afterExport(type, value) { + if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } + if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } + if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";")); + return pass(statement); + } + function exportField(type, value) { + if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); } + if (type == "variable") return pass(expressionNoComma, exportField); + } + function afterImport(type) { + if (type == "string") return cont(); + if (type == "(") return pass(expression); + return pass(importSpec, maybeMoreImports, maybeFrom); + } + function importSpec(type, value) { + if (type == "{") return contCommasep(importSpec, "}"); + if (type == "variable") register(value); + if (value == "*") cx.marked = "keyword"; + return cont(maybeAs); + } + function maybeMoreImports(type) { + if (type == ",") return cont(importSpec, maybeMoreImports) + } + function maybeAs(_type, value) { + if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } + } + function maybeFrom(_type, value) { + if (value == "from") { cx.marked = "keyword"; return cont(expression); } + } + function arrayLiteral(type) { + if (type == "]") return cont(); + return pass(commasep(expressionNoComma, "]")); + } + function enumdef() { + return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex) + } + function enummember() { + return pass(pattern, maybeAssign); + } + + function isContinuedStatement(state, textAfter) { + return state.lastType == "operator" || state.lastType == "," || + isOperatorChar.test(textAfter.charAt(0)) || + /[,.]/.test(textAfter.charAt(0)); + } + + function expressionAllowed(stream, state, backUp) { + return state.tokenize == tokenBase && + /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || + (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) + } + + // Interface + + return { + startState: function(basecolumn) { + var state = { + tokenize: tokenBase, + lastType: "sof", + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + context: parserConfig.localVars && new Context(null, null, false), + indented: basecolumn || 0 + }; + if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") + state.globalVars = parserConfig.globalVars; + return state; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + findFatArrow(stream, state); + } + if (state.tokenize != tokenComment && stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize == tokenComment) return CodeMirror.Pass; + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top + // Kludge to prevent 'maybelse' from blocking lexical scope pops + if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { + var c = state.cc[i]; + if (c == poplex) lexical = lexical.prev; + else if (c != maybeelse) break; + } + while ((lexical.type == "stat" || lexical.type == "form") && + (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) && + (top == maybeoperatorComma || top == maybeoperatorNoComma) && + !/^[,\.=+\-*:?[\(]/.test(textAfter)))) + lexical = lexical.prev; + if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") + lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0); + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "form") return lexical.indented + indentUnit; + else if (type == "stat") + return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); + else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, + blockCommentStart: jsonMode ? null : "/*", + blockCommentEnd: jsonMode ? null : "*/", + blockCommentContinue: jsonMode ? null : " * ", + lineComment: jsonMode ? null : "//", + fold: "brace", + closeBrackets: "()[]{}''\"\"``", + + helperType: jsonMode ? "json" : "javascript", + jsonldMode: jsonldMode, + jsonMode: jsonMode, + + expressionAllowed: expressionAllowed, + + skipExpression: function(state) { + var top = state.cc[state.cc.length - 1] + if (top == expression || top == expressionNoComma) state.cc.pop() + } + }; +}); + +CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("text/ecmascript", "javascript"); +CodeMirror.defineMIME("application/javascript", "javascript"); +CodeMirror.defineMIME("application/x-javascript", "javascript"); +CodeMirror.defineMIME("application/ecmascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); +CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); +CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); + +}); diff --git a/phpMyAdmin/js/vendor/codemirror/mode/sql/sql.js b/phpMyAdmin/js/vendor/codemirror/mode/sql/sql.js new file mode 100755 index 0000000..35902bb --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/mode/sql/sql.js @@ -0,0 +1,494 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("sql", function(config, parserConfig) { + var client = parserConfig.client || {}, + atoms = parserConfig.atoms || {"false": true, "true": true, "null": true}, + builtin = parserConfig.builtin || set(defaultBuiltin), + keywords = parserConfig.keywords || set(sqlKeywords), + operatorChars = parserConfig.operatorChars || /^[*+\-%<>!=&|~^\/]/, + support = parserConfig.support || {}, + hooks = parserConfig.hooks || {}, + dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}, + backslashStringEscapes = parserConfig.backslashStringEscapes !== false, + brackets = parserConfig.brackets || /^[\{}\(\)\[\]]/, + punctuation = parserConfig.punctuation || /^[;.,:]/ + + function tokenBase(stream, state) { + var ch = stream.next(); + + // call hooks from the mime type + if (hooks[ch]) { + var result = hooks[ch](stream, state); + if (result !== false) return result; + } + + if (support.hexNumber && + ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) + || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { + // hex + // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html + return "number"; + } else if (support.binaryNumber && + (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) + || (ch == "0" && stream.match(/^b[01]+/)))) { + // bitstring + // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html + return "number"; + } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { + // numbers + // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html + stream.match(/^[0-9]*(\.[0-9]+)?([eE][-+]?[0-9]+)?/); + support.decimallessFloat && stream.match(/^\.(?!\.)/); + return "number"; + } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { + // placeholders + return "variable-3"; + } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { + // strings + // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html + state.tokenize = tokenLiteral(ch); + return state.tokenize(stream, state); + } else if ((((support.nCharCast && (ch == "n" || ch == "N")) + || (support.charsetCast && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) + && (stream.peek() == "'" || stream.peek() == '"'))) { + // charset casting: _utf8'str', N'str', n'str' + // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html + return "keyword"; + } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { + // 1-line comment + stream.skipToEnd(); + return "comment"; + } else if ((support.commentHash && ch == "#") + || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { + // 1-line comments + // ref: https://kb.askmonty.org/en/comment-syntax/ + stream.skipToEnd(); + return "comment"; + } else if (ch == "/" && stream.eat("*")) { + // multi-line comments + // ref: https://kb.askmonty.org/en/comment-syntax/ + state.tokenize = tokenComment(1); + return state.tokenize(stream, state); + } else if (ch == ".") { + // .1 for 0.1 + if (support.zerolessFloat && stream.match(/^(?:\d+(?:e[+-]?\d+)?)/i)) + return "number"; + if (stream.match(/^\.+/)) + return null + // .table_name (ODBC) + // // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html + if (support.ODBCdotTable && stream.match(/^[\w\d_]+/)) + return "variable-2"; + } else if (operatorChars.test(ch)) { + // operators + stream.eatWhile(operatorChars); + return "operator"; + } else if (brackets.test(ch)) { + // brackets + return "bracket"; + } else if (punctuation.test(ch)) { + // punctuation + stream.eatWhile(punctuation); + return "punctuation"; + } else if (ch == '{' && + (stream.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/) || stream.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/))) { + // dates (weird ODBC syntax) + // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html + return "number"; + } else { + stream.eatWhile(/^[_\w\d]/); + var word = stream.current().toLowerCase(); + // dates (standard SQL syntax) + // ref: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-literals.html + if (dateSQL.hasOwnProperty(word) && (stream.match(/^( )+'[^']*'/) || stream.match(/^( )+"[^"]*"/))) + return "number"; + if (atoms.hasOwnProperty(word)) return "atom"; + if (builtin.hasOwnProperty(word)) return "builtin"; + if (keywords.hasOwnProperty(word)) return "keyword"; + if (client.hasOwnProperty(word)) return "string-2"; + return null; + } + } + + // 'string', with char specified in quote escaped by '\' + function tokenLiteral(quote) { + return function(stream, state) { + var escaped = false, ch; + while ((ch = stream.next()) != null) { + if (ch == quote && !escaped) { + state.tokenize = tokenBase; + break; + } + escaped = backslashStringEscapes && !escaped && ch == "\\"; + } + return "string"; + }; + } + function tokenComment(depth) { + return function(stream, state) { + var m = stream.match(/^.*?(\/\*|\*\/)/) + if (!m) stream.skipToEnd() + else if (m[1] == "/*") state.tokenize = tokenComment(depth + 1) + else if (depth > 1) state.tokenize = tokenComment(depth - 1) + else state.tokenize = tokenBase + return "comment" + } + } + + function pushContext(stream, state, type) { + state.context = { + prev: state.context, + indent: stream.indentation(), + col: stream.column(), + type: type + }; + } + + function popContext(state) { + state.indent = state.context.indent; + state.context = state.context.prev; + } + + return { + startState: function() { + return {tokenize: tokenBase, context: null}; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (state.context && state.context.align == null) + state.context.align = false; + } + if (state.tokenize == tokenBase && stream.eatSpace()) return null; + + var style = state.tokenize(stream, state); + if (style == "comment") return style; + + if (state.context && state.context.align == null) + state.context.align = true; + + var tok = stream.current(); + if (tok == "(") + pushContext(stream, state, ")"); + else if (tok == "[") + pushContext(stream, state, "]"); + else if (state.context && state.context.type == tok) + popContext(state); + return style; + }, + + indent: function(state, textAfter) { + var cx = state.context; + if (!cx) return CodeMirror.Pass; + var closing = textAfter.charAt(0) == cx.type; + if (cx.align) return cx.col + (closing ? 0 : 1); + else return cx.indent + (closing ? 0 : config.indentUnit); + }, + + blockCommentStart: "/*", + blockCommentEnd: "*/", + lineComment: support.commentSlashSlash ? "//" : support.commentHash ? "#" : "--", + closeBrackets: "()[]{}''\"\"``" + }; +}); + + // `identifier` + function hookIdentifier(stream) { + // MySQL/MariaDB identifiers + // ref: http://dev.mysql.com/doc/refman/5.6/en/identifier-qualifiers.html + var ch; + while ((ch = stream.next()) != null) { + if (ch == "`" && !stream.eat("`")) return "variable-2"; + } + stream.backUp(stream.current().length - 1); + return stream.eatWhile(/\w/) ? "variable-2" : null; + } + + // "identifier" + function hookIdentifierDoublequote(stream) { + // Standard SQL /SQLite identifiers + // ref: http://web.archive.org/web/20160813185132/http://savage.net.au/SQL/sql-99.bnf.html#delimited%20identifier + // ref: http://sqlite.org/lang_keywords.html + var ch; + while ((ch = stream.next()) != null) { + if (ch == "\"" && !stream.eat("\"")) return "variable-2"; + } + stream.backUp(stream.current().length - 1); + return stream.eatWhile(/\w/) ? "variable-2" : null; + } + + // variable token + function hookVar(stream) { + // variables + // @@prefix.varName @varName + // varName can be quoted with ` or ' or " + // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html + if (stream.eat("@")) { + stream.match(/^session\./); + stream.match(/^local\./); + stream.match(/^global\./); + } + + if (stream.eat("'")) { + stream.match(/^.*'/); + return "variable-2"; + } else if (stream.eat('"')) { + stream.match(/^.*"/); + return "variable-2"; + } else if (stream.eat("`")) { + stream.match(/^.*`/); + return "variable-2"; + } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) { + return "variable-2"; + } + return null; + }; + + // short client keyword token + function hookClient(stream) { + // \N means NULL + // ref: http://dev.mysql.com/doc/refman/5.5/en/null-values.html + if (stream.eat("N")) { + return "atom"; + } + // \g, etc + // ref: http://dev.mysql.com/doc/refman/5.5/en/mysql-commands.html + return stream.match(/^[a-zA-Z.#!?]/) ? "variable-2" : null; + } + + // these keywords are used by all SQL dialects (however, a mode can still overwrite it) + var sqlKeywords = "alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit "; + + // turn a space-separated list into an array + function set(str) { + var obj = {}, words = str.split(" "); + for (var i = 0; i < words.length; ++i) obj[words[i]] = true; + return obj; + } + + var defaultBuiltin = "bool boolean bit blob enum long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision real date datetime year unsigned signed decimal numeric" + + // A generic SQL Mode. It's not a standard, it just try to support what is generally supported + CodeMirror.defineMIME("text/x-sql", { + name: "sql", + keywords: set(sqlKeywords + "begin"), + builtin: set(defaultBuiltin), + atoms: set("false true null unknown"), + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") + }); + + CodeMirror.defineMIME("text/x-mssql", { + name: "sql", + client: set("$partition binary_checksum checksum connectionproperty context_info current_request_id error_line error_message error_number error_procedure error_severity error_state formatmessage get_filestream_transaction_context getansinull host_id host_name isnull isnumeric min_active_rowversion newid newsequentialid rowcount_big xact_state object_id"), + keywords: set(sqlKeywords + "begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare exec go if use index holdlock nolock nowait paglock readcommitted readcommittedlock readpast readuncommitted repeatableread rowlock serializable snapshot tablock tablockx updlock with"), + builtin: set("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "), + atoms: set("is not null like and or in left right between inner outer join all any some cross unpivot pivot exists"), + operatorChars: /^[*+\-%<>!=^\&|\/]/, + brackets: /^[\{}\(\)]/, + punctuation: /^[;.,:/]/, + backslashStringEscapes: false, + dateSQL: set("date datetimeoffset datetime2 smalldatetime datetime time"), + hooks: { + "@": hookVar + } + }); + + CodeMirror.defineMIME("text/x-mysql", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), + keywords: set(sqlKeywords + "accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), + builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), + hooks: { + "@": hookVar, + "`": hookIdentifier, + "\\": hookClient + } + }); + + CodeMirror.defineMIME("text/x-mariadb", { + name: "sql", + client: set("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"), + keywords: set(sqlKeywords + "accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"), + builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"), + hooks: { + "@": hookVar, + "`": hookIdentifier, + "\\": hookClient + } + }); + + // provided by the phpLiteAdmin project - phpliteadmin.org + CodeMirror.defineMIME("text/x-sqlite", { + name: "sql", + // commands of the official SQLite client, ref: https://www.sqlite.org/cli.html#dotcmd + client: set("auth backup bail binary changes check clone databases dbinfo dump echo eqp exit explain fullschema headers help import imposter indexes iotrace limit lint load log mode nullvalue once open output print prompt quit read restore save scanstats schema separator session shell show stats system tables testcase timeout timer trace vfsinfo vfslist vfsname width"), + // ref: http://sqlite.org/lang_keywords.html + keywords: set(sqlKeywords + "abort action add after all analyze attach autoincrement before begin cascade case cast check collate column commit conflict constraint cross current_date current_time current_timestamp database default deferrable deferred detach each else end escape except exclusive exists explain fail for foreign full glob if ignore immediate index indexed initially inner instead intersect isnull key left limit match natural no notnull null of offset outer plan pragma primary query raise recursive references regexp reindex release rename replace restrict right rollback row savepoint temp temporary then to transaction trigger unique using vacuum view virtual when with without"), + // SQLite is weakly typed, ref: http://sqlite.org/datatype3.html. This is just a list of some common types. + builtin: set("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text clob bigint int int2 int8 integer float double char varchar date datetime year unsigned signed numeric real"), + // ref: http://sqlite.org/syntax/literal-value.html + atoms: set("null current_date current_time current_timestamp"), + // ref: http://sqlite.org/lang_expr.html#binaryops + operatorChars: /^[*+\-%<>!=&|/~]/, + // SQLite is weakly typed, ref: http://sqlite.org/datatype3.html. This is just a list of some common types. + dateSQL: set("date time timestamp datetime"), + support: set("decimallessFloat zerolessFloat"), + identifierQuote: "\"", //ref: http://sqlite.org/lang_keywords.html + hooks: { + // bind-parameters ref:http://sqlite.org/lang_expr.html#varparam + "@": hookVar, + ":": hookVar, + "?": hookVar, + "$": hookVar, + // The preferred way to escape Identifiers is using double quotes, ref: http://sqlite.org/lang_keywords.html + "\"": hookIdentifierDoublequote, + // there is also support for backtics, ref: http://sqlite.org/lang_keywords.html + "`": hookIdentifier + } + }); + + // the query language used by Apache Cassandra is called CQL, but this mime type + // is called Cassandra to avoid confusion with Contextual Query Language + CodeMirror.defineMIME("text/x-cassandra", { + name: "sql", + client: { }, + keywords: set("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"), + builtin: set("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"), + atoms: set("false true infinity NaN"), + operatorChars: /^[<>=]/, + dateSQL: { }, + support: set("commentSlashSlash decimallessFloat"), + hooks: { } + }); + + // this is based on Peter Raganitsch's 'plsql' mode + CodeMirror.defineMIME("text/x-plsql", { + name: "sql", + client: set("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"), + keywords: set("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), + builtin: set("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"), + operatorChars: /^[*\/+\-%<>!=~]/, + dateSQL: set("date time timestamp"), + support: set("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber") + }); + + // Created to support specific hive keywords + CodeMirror.defineMIME("text/x-hive", { + name: "sql", + keywords: set("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with admin authorization char compact compactions conf cube current current_date current_timestamp day decimal defined dependency directories elem_type exchange file following for grouping hour ignore inner interval jar less logical macro minute month more none noscan over owner partialscan preceding pretty principals protection reload rewrite role roles rollup rows second server sets skewed transactions truncate unbounded unset uri user values window year"), + builtin: set("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype key_type utctimestamp value_type varchar"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=]/, + dateSQL: set("date timestamp"), + support: set("ODBCdotTable doubleQuote binaryNumber hexNumber") + }); + + CodeMirror.defineMIME("text/x-pgsql", { + name: "sql", + client: set("source"), + // For PostgreSQL - https://www.postgresql.org/docs/11/sql-keywords-appendix.html + // For pl/pgsql lang - https://github.com/postgres/postgres/blob/REL_11_2/src/pl/plpgsql/src/pl_scanner.c + keywords: set(sqlKeywords + "a abort abs absent absolute access according action ada add admin after aggregate alias all allocate also alter always analyse analyze and any are array array_agg array_max_cardinality as asc asensitive assert assertion assignment asymmetric at atomic attach attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli between bigint binary bit bit_length blob blocked bom boolean both breadth by c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain char char_length character character_length character_set_catalog character_set_name character_set_schema characteristics characters check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column column_name columns command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constant constraint constraint_catalog constraint_name constraint_schema constraints constructor contains content continue control conversion convert copy corr corresponding cost count covar_pop covar_samp create cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datatype date datetime_interval_code datetime_interval_precision day db deallocate debug dec decimal declare default defaults deferrable deferred defined definer degree delete delimiter delimiters dense_rank depends depth deref derived desc describe descriptor detach detail deterministic diagnostics dictionary disable discard disconnect dispatch distinct dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain double drop dump dynamic dynamic_function dynamic_function_code each element else elseif elsif empty enable encoding encrypted end end_frame end_partition endexec enforced enum equals errcode error escape event every except exception exclude excluding exclusive exec execute exists exit exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreach foreign fortran forward found frame_row free freeze from fs full function functions fusion g general generated get global go goto grant granted greatest group grouping groups handler having header hex hierarchy hint hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import in include including increment indent index indexes indicator info inherit inherits initially inline inner inout input insensitive insert instance instantiable instead int integer integrity intersect intersection interval into invoker is isnull isolation join k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like like_regex limit link listen ln load local localtime localtimestamp location locator lock locked log logged loop lower m map mapping match matched materialized max max_cardinality maxvalue member merge message message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized not nothing notice notify notnull nowait nth_value ntile null nullable nullif nulls number numeric object occurrences_regex octet_length octets of off offset oids old on only open operator option options or order ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parallel parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password path percent percent_rank percentile_cont percentile_disc perform period permission pg_context pg_datatype_name pg_exception_context pg_exception_detail pg_exception_hint placing plans pli policy portion position position_regex power precedes preceding precision prepare prepared preserve primary print_strict_params prior privileges procedural procedure procedures program public publication query quote raise range rank read reads real reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result result_oid return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns reverse revoke right role rollback rollup routine routine_catalog routine_name routine_schema routines row row_count row_number rows rowtype rule savepoint scale schema schema_name schemas scope scope_catalog scope_name scope_schema scroll search second section security select selective self sensitive sequence sequences serializable server server_name session session_user set setof sets share show similar simple size skip slice smallint snapshot some source space specific specific_name specifictype sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable stacked standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset subscription substring substring_regex succeeds sum symmetric sysid system system_time system_user t table table_name tables tablesample tablespace temp template temporary text then ties time timestamp timezone_hour timezone_minute to token top_level_count trailing transaction transaction_active transactions_committed transactions_rolled_back transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted union unique unknown unlink unlisten unlogged unnamed unnest until untyped update upper uri usage use_column use_variable user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of values var_pop var_samp varbinary varchar variable_conflict variadic varying verbose version versioning view views volatile warning when whenever where while whitespace width_bucket window with within without work wrapper write xml xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes zone"), + // https://www.postgresql.org/docs/11/datatype.html + builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"), + atoms: set("false true null unknown"), + operatorChars: /^[*\/+\-%<>!=&|^\/#@?~]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast") + }); + + // Google's SQL-like query language, GQL + CodeMirror.defineMIME("text/x-gql", { + name: "sql", + keywords: set("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"), + atoms: set("false true"), + builtin: set("blob datetime first key __key__ string integer double boolean null"), + operatorChars: /^[*+\-%<>!=]/ + }); + + // Greenplum + CodeMirror.defineMIME("text/x-gpsql", { + name: "sql", + client: set("source"), + //https://github.com/greenplum-db/gpdb/blob/master/src/include/parser/kwlist.h + keywords: set("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"), + builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"), + atoms: set("false true null unknown"), + operatorChars: /^[*+\-%<>!=&|^\/#@?~]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast") + }); + + // Spark SQL + CodeMirror.defineMIME("text/x-sparksql", { + name: "sql", + keywords: set("add after all alter analyze and anti archive array as asc at between bucket buckets by cache cascade case cast change clear cluster clustered codegen collection column columns comment commit compact compactions compute concatenate cost create cross cube current current_date current_timestamp database databases datata dbproperties defined delete delimited deny desc describe dfs directories distinct distribute drop else end escaped except exchange exists explain export extended external false fields fileformat first following for format formatted from full function functions global grant group grouping having if ignore import in index indexes inner inpath inputformat insert intersect interval into is items join keys last lateral lazy left like limit lines list load local location lock locks logical macro map minus msck natural no not null nulls of on optimize option options or order out outer outputformat over overwrite partition partitioned partitions percent preceding principals purge range recordreader recordwriter recover reduce refresh regexp rename repair replace reset restrict revoke right rlike role roles rollback rollup row rows schema schemas select semi separated serde serdeproperties set sets show skewed sort sorted start statistics stored stratify struct table tables tablesample tblproperties temp temporary terminated then to touch transaction transactions transform true truncate unarchive unbounded uncache union unlock unset use using values view when where window with"), + builtin: set("tinyint smallint int bigint boolean float double string binary timestamp decimal array map struct uniontype delimited serde sequencefile textfile rcfile inputformat outputformat"), + atoms: set("false true null"), + operatorChars: /^[*\/+\-%<>!=~&|^]/, + dateSQL: set("date time timestamp"), + support: set("ODBCdotTable doubleQuote zerolessFloat") + }); + + // Esper + CodeMirror.defineMIME("text/x-esper", { + name: "sql", + client: set("source"), + // http://www.espertech.com/esper/release-5.5.0/esper-reference/html/appendix_keywords.html + keywords: set("alter and as asc between by count create delete desc distinct drop from group having in insert into is join like not on or order select set table union update values where limit after all and as at asc avedev avg between by case cast coalesce count create current_timestamp day days delete define desc distinct else end escape events every exists false first from full group having hour hours in inner insert instanceof into irstream is istream join last lastweekday left limit like max match_recognize matches median measures metadatasql min minute minutes msec millisecond milliseconds not null offset on or order outer output partition pattern prev prior regexp retain-union retain-intersection right rstream sec second seconds select set some snapshot sql stddev sum then true unidirectional until update variable weekday when where window"), + builtin: {}, + atoms: set("false true null"), + operatorChars: /^[*+\-%<>!=&|^\/#@?~]/, + dateSQL: set("time"), + support: set("decimallessFloat zerolessFloat binaryNumber hexNumber") + }); +}); + +/* + How Properties of Mime Types are used by SQL Mode + ================================================= + + keywords: + A list of keywords you want to be highlighted. + builtin: + A list of builtin types you want to be highlighted (if you want types to be of class "builtin" instead of "keyword"). + operatorChars: + All characters that must be handled as operators. + client: + Commands parsed and executed by the client (not the server). + support: + A list of supported syntaxes which are not common, but are supported by more than 1 DBMS. + * ODBCdotTable: .tableName + * zerolessFloat: .1 + * doubleQuote + * nCharCast: N'string' + * charsetCast: _utf8'string' + * commentHash: use # char for comments + * commentSlashSlash: use // for comments + * commentSpaceRequired: require a space after -- for comments + atoms: + Keywords that must be highlighted as atoms,. Some DBMS's support more atoms than others: + UNKNOWN, INFINITY, UNDERFLOW, NaN... + dateSQL: + Used for date/time SQL standard syntax, because not all DBMS's support same temporal types. +*/ diff --git a/phpMyAdmin/js/vendor/codemirror/mode/xml/xml.js b/phpMyAdmin/js/vendor/codemirror/mode/xml/xml.js new file mode 100755 index 0000000..b67bf85 --- /dev/null +++ b/phpMyAdmin/js/vendor/codemirror/mode/xml/xml.js @@ -0,0 +1,402 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +var htmlConfig = { + autoSelfClosers: {'area': true, 'base': true, 'br': true, 'col': true, 'command': true, + 'embed': true, 'frame': true, 'hr': true, 'img': true, 'input': true, + 'keygen': true, 'link': true, 'meta': true, 'param': true, 'source': true, + 'track': true, 'wbr': true, 'menuitem': true}, + implicitlyClosed: {'dd': true, 'li': true, 'optgroup': true, 'option': true, 'p': true, + 'rp': true, 'rt': true, 'tbody': true, 'td': true, 'tfoot': true, + 'th': true, 'tr': true}, + contextGrabbers: { + 'dd': {'dd': true, 'dt': true}, + 'dt': {'dd': true, 'dt': true}, + 'li': {'li': true}, + 'option': {'option': true, 'optgroup': true}, + 'optgroup': {'optgroup': true}, + 'p': {'address': true, 'article': true, 'aside': true, 'blockquote': true, 'dir': true, + 'div': true, 'dl': true, 'fieldset': true, 'footer': true, 'form': true, + 'h1': true, 'h2': true, 'h3': true, 'h4': true, 'h5': true, 'h6': true, + 'header': true, 'hgroup': true, 'hr': true, 'menu': true, 'nav': true, 'ol': true, + 'p': true, 'pre': true, 'section': true, 'table': true, 'ul': true}, + 'rp': {'rp': true, 'rt': true}, + 'rt': {'rp': true, 'rt': true}, + 'tbody': {'tbody': true, 'tfoot': true}, + 'td': {'td': true, 'th': true}, + 'tfoot': {'tbody': true}, + 'th': {'td': true, 'th': true}, + 'thead': {'tbody': true, 'tfoot': true}, + 'tr': {'tr': true} + }, + doNotIndent: {"pre": true}, + allowUnquoted: true, + allowMissing: true, + caseFold: true +} + +var xmlConfig = { + autoSelfClosers: {}, + implicitlyClosed: {}, + contextGrabbers: {}, + doNotIndent: {}, + allowUnquoted: false, + allowMissing: false, + allowMissingTagName: false, + caseFold: false +} + +CodeMirror.defineMode("xml", function(editorConf, config_) { + var indentUnit = editorConf.indentUnit + var config = {} + var defaults = config_.htmlMode ? htmlConfig : xmlConfig + for (var prop in defaults) config[prop] = defaults[prop] + for (var prop in config_) config[prop] = config_[prop] + + // Return variables for tokenizers + var type, setStyle; + + function inText(stream, state) { + function chain(parser) { + state.tokenize = parser; + return parser(stream, state); + } + + var ch = stream.next(); + if (ch == "<") { + if (stream.eat("!")) { + if (stream.eat("[")) { + if (stream.match("CDATA[")) return chain(inBlock("atom", "]]>")); + else return null; + } else if (stream.match("--")) { + return chain(inBlock("comment", "-->")); + } else if (stream.match("DOCTYPE", true, true)) { + stream.eatWhile(/[\w\._\-]/); + return chain(doctype(1)); + } else { + return null; + } + } else if (stream.eat("?")) { + stream.eatWhile(/[\w\._\-]/); + state.tokenize = inBlock("meta", "?>"); + return "meta"; + } else { + type = stream.eat("/") ? "closeTag" : "openTag"; + state.tokenize = inTag; + return "tag bracket"; + } + } else if (ch == "&") { + var ok; + if (stream.eat("#")) { + if (stream.eat("x")) { + ok = stream.eatWhile(/[a-fA-F\d]/) && stream.eat(";"); + } else { + ok = stream.eatWhile(/[\d]/) && stream.eat(";"); + } + } else { + ok = stream.eatWhile(/[\w\.\-:]/) && stream.eat(";"); + } + return ok ? "atom" : "error"; + } else { + stream.eatWhile(/[^&<]/); + return null; + } + } + inText.isInText = true; + + function inTag(stream, state) { + var ch = stream.next(); + if (ch == ">" || (ch == "/" && stream.eat(">"))) { + state.tokenize = inText; + type = ch == ">" ? "endTag" : "selfcloseTag"; + return "tag bracket"; + } else if (ch == "=") { + type = "equals"; + return null; + } else if (ch == "<") { + state.tokenize = inText; + state.state = baseState; + state.tagName = state.tagStart = null; + var next = state.tokenize(stream, state); + return next ? next + " tag error" : "tag error"; + } else if (/[\'\"]/.test(ch)) { + state.tokenize = inAttribute(ch); + state.stringStartCol = stream.column(); + return state.tokenize(stream, state); + } else { + stream.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/); + return "word"; + } + } + + function inAttribute(quote) { + var closure = function(stream, state) { + while (!stream.eol()) { + if (stream.next() == quote) { + state.tokenize = inTag; + break; + } + } + return "string"; + }; + closure.isInAttribute = true; + return closure; + } + + function inBlock(style, terminator) { + return function(stream, state) { + while (!stream.eol()) { + if (stream.match(terminator)) { + state.tokenize = inText; + break; + } + stream.next(); + } + return style; + } + } + + function doctype(depth) { + return function(stream, state) { + var ch; + while ((ch = stream.next()) != null) { + if (ch == "<") { + state.tokenize = doctype(depth + 1); + return state.tokenize(stream, state); + } else if (ch == ">") { + if (depth == 1) { + state.tokenize = inText; + break; + } else { + state.tokenize = doctype(depth - 1); + return state.tokenize(stream, state); + } + } + } + return "meta"; + }; + } + + function Context(state, tagName, startOfLine) { + this.prev = state.context; + this.tagName = tagName; + this.indent = state.indented; + this.startOfLine = startOfLine; + if (config.doNotIndent.hasOwnProperty(tagName) || (state.context && state.context.noIndent)) + this.noIndent = true; + } + function popContext(state) { + if (state.context) state.context = state.context.prev; + } + function maybePopContext(state, nextTagName) { + var parentTagName; + while (true) { + if (!state.context) { + return; + } + parentTagName = state.context.tagName; + if (!config.contextGrabbers.hasOwnProperty(parentTagName) || + !config.contextGrabbers[parentTagName].hasOwnProperty(nextTagName)) { + return; + } + popContext(state); + } + } + + function baseState(type, stream, state) { + if (type == "openTag") { + state.tagStart = stream.column(); + return tagNameState; + } else if (type == "closeTag") { + return closeTagNameState; + } else { + return baseState; + } + } + function tagNameState(type, stream, state) { + if (type == "word") { + state.tagName = stream.current(); + setStyle = "tag"; + return attrState; + } else if (config.allowMissingTagName && type == "endTag") { + setStyle = "tag bracket"; + return attrState(type, stream, state); + } else { + setStyle = "error"; + return tagNameState; + } + } + function closeTagNameState(type, stream, state) { + if (type == "word") { + var tagName = stream.current(); + if (state.context && state.context.tagName != tagName && + config.implicitlyClosed.hasOwnProperty(state.context.tagName)) + popContext(state); + if ((state.context && state.context.tagName == tagName) || config.matchClosing === false) { + setStyle = "tag"; + return closeState; + } else { + setStyle = "tag error"; + return closeStateErr; + } + } else if (config.allowMissingTagName && type == "endTag") { + setStyle = "tag bracket"; + return closeState(type, stream, state); + } else { + setStyle = "error"; + return closeStateErr; + } + } + + function closeState(type, _stream, state) { + if (type != "endTag") { + setStyle = "error"; + return closeState; + } + popContext(state); + return baseState; + } + function closeStateErr(type, stream, state) { + setStyle = "error"; + return closeState(type, stream, state); + } + + function attrState(type, _stream, state) { + if (type == "word") { + setStyle = "attribute"; + return attrEqState; + } else if (type == "endTag" || type == "selfcloseTag") { + var tagName = state.tagName, tagStart = state.tagStart; + state.tagName = state.tagStart = null; + if (type == "selfcloseTag" || + config.autoSelfClosers.hasOwnProperty(tagName)) { + maybePopContext(state, tagName); + } else { + maybePopContext(state, tagName); + state.context = new Context(state, tagName, tagStart == state.indented); + } + return baseState; + } + setStyle = "error"; + return attrState; + } + function attrEqState(type, stream, state) { + if (type == "equals") return attrValueState; + if (!config.allowMissing) setStyle = "error"; + return attrState(type, stream, state); + } + function attrValueState(type, stream, state) { + if (type == "string") return attrContinuedState; + if (type == "word" && config.allowUnquoted) {setStyle = "string"; return attrState;} + setStyle = "error"; + return attrState(type, stream, state); + } + function attrContinuedState(type, stream, state) { + if (type == "string") return attrContinuedState; + return attrState(type, stream, state); + } + + return { + startState: function(baseIndent) { + var state = {tokenize: inText, + state: baseState, + indented: baseIndent || 0, + tagName: null, tagStart: null, + context: null} + if (baseIndent != null) state.baseIndent = baseIndent + return state + }, + + token: function(stream, state) { + if (!state.tagName && stream.sol()) + state.indented = stream.indentation(); + + if (stream.eatSpace()) return null; + type = null; + var style = state.tokenize(stream, state); + if ((style || type) && style != "comment") { + setStyle = null; + state.state = state.state(type || style, stream, state); + if (setStyle) + style = setStyle == "error" ? style + " error" : setStyle; + } + return style; + }, + + indent: function(state, textAfter, fullLine) { + var context = state.context; + // Indent multi-line strings (e.g. css). + if (state.tokenize.isInAttribute) { + if (state.tagStart == state.indented) + return state.stringStartCol + 1; + else + return state.indented + indentUnit; + } + if (context && context.noIndent) return CodeMirror.Pass; + if (state.tokenize != inTag && state.tokenize != inText) + return fullLine ? fullLine.match(/^(\s*)/)[0].length : 0; + // Indent the starts of attribute names. + if (state.tagName) { + if (config.multilineTagIndentPastTag !== false) + return state.tagStart + state.tagName.length + 2; + else + return state.tagStart + indentUnit * (config.multilineTagIndentFactor || 1); + } + if (config.alignCDATA && /$/, + blockCommentStart: "", + + configuration: config.htmlMode ? "html" : "xml", + helperType: config.htmlMode ? "html" : "xml", + + skipAttribute: function(state) { + if (state.state == attrValueState) + state.state = attrState + } + }; +}); + +CodeMirror.defineMIME("text/xml", "xml"); +CodeMirror.defineMIME("application/xml", "xml"); +if (!CodeMirror.mimeModes.hasOwnProperty("text/html")) + CodeMirror.defineMIME("text/html", {name: "xml", htmlMode: true}); + +}); diff --git a/phpMyAdmin/js/vendor/jqplot/jquery.jqplot.js b/phpMyAdmin/js/vendor/jqplot/jquery.jqplot.js new file mode 100755 index 0000000..ba069e4 --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/jquery.jqplot.js @@ -0,0 +1,11477 @@ +/** + * Title: jqPlot Charts + * + * Pure JavaScript plotting plugin for jQuery. + * + * About: Version + * + * version: 1.0.9 + * revision: d96a669 + * + * About: Copyright & License + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT and GPL version 2.0 licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * See and contained within this distribution for further information. + * + * The author would appreciate an email letting him know of any substantial + * use of jqPlot. You can reach the author at: chris at jqplot dot com + * or see http://www.jqplot.com/info.php. This is, of course, not required. + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php. + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + * + * About: Introduction + * + * jqPlot requires jQuery (1.4+ required for certain features). jQuery 1.4.2 is included in the distribution. + * To use jqPlot include jQuery, the jqPlot jQuery plugin, the jqPlot css file and optionally + * the excanvas script for IE support in your web page: + * + * > + * > + * > + * > + * + * jqPlot can be customized by overriding the defaults of any of the objects which make + * up the plot. The general usage of jqplot is: + * + * > chart = $.jqplot('targetElemId', [dataArray,...], {optionsObject}); + * + * The options available to jqplot are detailed in in the jqPlotOptions.txt file. + * + * An actual call to $.jqplot() may look like the + * examples below: + * + * > chart = $.jqplot('chartdiv', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]); + * + * or + * + * > dataArray = [34,12,43,55,77]; + * > chart = $.jqplot('targetElemId', [dataArray, ...], {title:'My Plot', axes:{yaxis:{min:20, max:100}}}); + * + * For more inforrmation, see . + * + * About: Usage + * + * See + * + * About: Available Options + * + * See for a list of options available thorugh the options object (not complete yet!) + * + * About: Options Usage + * + * See + * + * About: Changes + * + * See + * + */ + +(function($) { + // make sure undefined is undefined + var undefined; + + $.fn.emptyForce = function() { + for ( var i = 0, elem; (elem = $(this)[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + $.cleanData( elem.getElementsByTagName("*") ); + } + + // Remove any remaining nodes + if ($.jqplot.use_excanvas) { + elem.outerHTML = ""; + } + else { + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + } + + elem = null; + } + + return $(this); + }; + + $.fn.removeChildForce = function(parent) { + while ( parent.firstChild ) { + this.removeChildForce( parent.firstChild ); + parent.removeChild( parent.firstChild ); + } + }; + + $.fn.jqplot = function() { + var datas = []; + var options = []; + // see how many data arrays we have + for (var i=0, l=arguments.length; i'+msg+'
      '); + $('#'+target).addClass('jqplot-error'); + document.getElementById(target).style.background = $.jqplot.config.errorBackground; + document.getElementById(target).style.border = $.jqplot.config.errorBorder; + document.getElementById(target).style.fontFamily = $.jqplot.config.errorFontFamily; + document.getElementById(target).style.fontSize = $.jqplot.config.errorFontSize; + document.getElementById(target).style.fontStyle = $.jqplot.config.errorFontStyle; + document.getElementById(target).style.fontWeight = $.jqplot.config.errorFontWeight; + } + } + else { + plot.init(target, _data, _options); + plot.draw(); + plot.themeEngine.init.call(plot); + return plot; + } + }; + + $.jqplot.version = "1.0.9"; + $.jqplot.revision = "d96a669"; + + $.jqplot.targetCounter = 1; + + // canvas manager to reuse canvases on the plot. + // Should help solve problem of canvases not being freed and + // problem of waiting forever for firefox to decide to free memory. + $.jqplot.CanvasManager = function() { + // canvases are managed globally so that they can be reused + // across plots after they have been freed + if (typeof $.jqplot.CanvasManager.canvases == 'undefined') { + $.jqplot.CanvasManager.canvases = []; + $.jqplot.CanvasManager.free = []; + } + + var myCanvases = []; + + this.getCanvas = function() { + var canvas; + var makeNew = true; + + if (!$.jqplot.use_excanvas) { + for (var i = 0, l = $.jqplot.CanvasManager.canvases.length; i < l; i++) { + if ($.jqplot.CanvasManager.free[i] === true) { + makeNew = false; + canvas = $.jqplot.CanvasManager.canvases[i]; + // $(canvas).removeClass('jqplot-canvasManager-free').addClass('jqplot-canvasManager-inuse'); + $.jqplot.CanvasManager.free[i] = false; + myCanvases.push(i); + break; + } + } + } + + if (makeNew) { + canvas = document.createElement('canvas'); + myCanvases.push($.jqplot.CanvasManager.canvases.length); + $.jqplot.CanvasManager.canvases.push(canvas); + $.jqplot.CanvasManager.free.push(false); + } + + return canvas; + }; + + // this method has to be used after settings the dimesions + // on the element returned by getCanvas() + this.initCanvas = function(canvas) { + if ($.jqplot.use_excanvas) { + return window.G_vmlCanvasManager.initElement(canvas); + } + + var cctx = canvas.getContext('2d'); + + var canvasBackingScale = 1; + if (window.devicePixelRatio > 1 && (cctx.webkitBackingStorePixelRatio === undefined || + cctx.webkitBackingStorePixelRatio < 2)) { + canvasBackingScale = window.devicePixelRatio; + } + var oldWidth = canvas.width; + var oldHeight = canvas.height; + + canvas.width = canvasBackingScale * canvas.width; + canvas.height = canvasBackingScale * canvas.height; + canvas.style.width = oldWidth + 'px'; + canvas.style.height = oldHeight + 'px'; + cctx.save(); + + cctx.scale(canvasBackingScale, canvasBackingScale); + + return canvas; + }; + + this.freeAllCanvases = function() { + for (var i = 0, l=myCanvases.length; i < l; i++) { + this.freeCanvas(myCanvases[i]); + } + myCanvases = []; + }; + + this.freeCanvas = function(idx) { + if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) { + // excanvas can't be reused, but properly unset + window.G_vmlCanvasManager.uninitElement($.jqplot.CanvasManager.canvases[idx]); + $.jqplot.CanvasManager.canvases[idx] = null; + } + else { + var canvas = $.jqplot.CanvasManager.canvases[idx]; + canvas.getContext('2d').clearRect(0, 0, canvas.width, canvas.height); + $(canvas).unbind().removeAttr('class').removeAttr('style'); + // Style attributes seemed to be still hanging around. wierd. Some ticks + // still retained a left: 0px attribute after reusing a canvas. + $(canvas).css({left: '', top: '', position: ''}); + // setting size to 0 may save memory of unused canvases? + canvas.width = 0; + canvas.height = 0; + $.jqplot.CanvasManager.free[idx] = true; + } + }; + + }; + + + // Convienence function that won't hang IE or FF without FireBug. + $.jqplot.log = function() { + if (window.console) { + window.console.log.apply(window.console, arguments); + } + }; + + $.jqplot.config = { + addDomReference: false, + enablePlugins:false, + defaultHeight:300, + defaultWidth:400, + UTCAdjust:false, + timezoneOffset: new Date(new Date().getTimezoneOffset() * 60000), + errorMessage: '', + errorBackground: '', + errorBorder: '', + errorFontFamily: '', + errorFontSize: '', + errorFontStyle: '', + errorFontWeight: '', + catchErrors: false, + defaultTickFormatString: "%.1f", + defaultColors: [ "#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"], + defaultNegativeColors: [ "#498991", "#C08840", "#9F9274", "#546D61", "#646C4A", "#6F6621", "#6E3F5F", "#4F64B0", "#A89050", "#C45923", "#187399", "#945381", "#959E5C", "#C7AF7B", "#478396", "#907294"], + dashLength: 4, + gapLength: 4, + dotGapLength: 2.5, + srcLocation: 'jqplot/src/', + pluginLocation: 'jqplot/src/plugins/' + }; + + + $.jqplot.arrayMax = function( array ){ + return Math.max.apply( Math, array ); + }; + + $.jqplot.arrayMin = function( array ){ + return Math.min.apply( Math, array ); + }; + + $.jqplot.enablePlugins = $.jqplot.config.enablePlugins; + + // canvas related tests taken from modernizer: + // Copyright (c) 2009 - 2010 Faruk Ates. + // http://www.modernizr.com + + $.jqplot.support_canvas = function() { + if (typeof $.jqplot.support_canvas.result == 'undefined') { + $.jqplot.support_canvas.result = !!document.createElement('canvas').getContext; + } + return $.jqplot.support_canvas.result; + }; + + $.jqplot.support_canvas_text = function() { + if (typeof $.jqplot.support_canvas_text.result == 'undefined') { + if (window.G_vmlCanvasManager !== undefined && window.G_vmlCanvasManager._version > 887) { + $.jqplot.support_canvas_text.result = true; + } + else { + $.jqplot.support_canvas_text.result = !!(document.createElement('canvas').getContext && typeof document.createElement('canvas').getContext('2d').fillText == 'function'); + } + + } + return $.jqplot.support_canvas_text.result; + }; + + $.jqplot.use_excanvas = ((!$.support.boxModel || !$.support.objectAll || !$support.leadingWhitespace) && !$.jqplot.support_canvas()) ? true : false; + + /** + * + * Hooks: jqPlot Pugin Hooks + * + * $.jqplot.preInitHooks - called before initialization. + * $.jqplot.postInitHooks - called after initialization. + * $.jqplot.preParseOptionsHooks - called before user options are parsed. + * $.jqplot.postParseOptionsHooks - called after user options are parsed. + * $.jqplot.preDrawHooks - called before plot draw. + * $.jqplot.postDrawHooks - called after plot draw. + * $.jqplot.preDrawSeriesHooks - called before each series is drawn. + * $.jqplot.postDrawSeriesHooks - called after each series is drawn. + * $.jqplot.preDrawLegendHooks - called before the legend is drawn. + * $.jqplot.addLegendRowHooks - called at the end of legend draw, so plugins + * can add rows to the legend table. + * $.jqplot.preSeriesInitHooks - called before series is initialized. + * $.jqplot.postSeriesInitHooks - called after series is initialized. + * $.jqplot.preParseSeriesOptionsHooks - called before series related options + * are parsed. + * $.jqplot.postParseSeriesOptionsHooks - called after series related options + * are parsed. + * $.jqplot.eventListenerHooks - called at the end of plot drawing, binds + * listeners to the event canvas which lays on top of the grid area. + * $.jqplot.preDrawSeriesShadowHooks - called before series shadows are drawn. + * $.jqplot.postDrawSeriesShadowHooks - called after series shadows are drawn. + * + */ + + $.jqplot.preInitHooks = []; + $.jqplot.postInitHooks = []; + $.jqplot.preParseOptionsHooks = []; + $.jqplot.postParseOptionsHooks = []; + $.jqplot.preDrawHooks = []; + $.jqplot.postDrawHooks = []; + $.jqplot.preDrawSeriesHooks = []; + $.jqplot.postDrawSeriesHooks = []; + $.jqplot.preDrawLegendHooks = []; + $.jqplot.addLegendRowHooks = []; + $.jqplot.preSeriesInitHooks = []; + $.jqplot.postSeriesInitHooks = []; + $.jqplot.preParseSeriesOptionsHooks = []; + $.jqplot.postParseSeriesOptionsHooks = []; + $.jqplot.eventListenerHooks = []; + $.jqplot.preDrawSeriesShadowHooks = []; + $.jqplot.postDrawSeriesShadowHooks = []; + + // A superclass holding some common properties and methods. + $.jqplot.ElemContainer = function() { + this._elem; + this._plotWidth; + this._plotHeight; + this._plotDimensions = {height:null, width:null}; + }; + + $.jqplot.ElemContainer.prototype.createElement = function(el, offsets, clss, cssopts, attrib) { + this._offsets = offsets; + var klass = clss || 'jqplot'; + var elem = document.createElement(el); + this._elem = $(elem); + this._elem.addClass(klass); + this._elem.css(cssopts); + this._elem.attr(attrib); + // avoid memory leak; + elem = null; + return this._elem; + }; + + $.jqplot.ElemContainer.prototype.getWidth = function() { + if (this._elem) { + return this._elem.outerWidth(true); + } + else { + return null; + } + }; + + $.jqplot.ElemContainer.prototype.getHeight = function() { + if (this._elem) { + return this._elem.outerHeight(true); + } + else { + return null; + } + }; + + $.jqplot.ElemContainer.prototype.getPosition = function() { + if (this._elem) { + return this._elem.position(); + } + else { + return {top:null, left:null, bottom:null, right:null}; + } + }; + + $.jqplot.ElemContainer.prototype.getTop = function() { + return this.getPosition().top; + }; + + $.jqplot.ElemContainer.prototype.getLeft = function() { + return this.getPosition().left; + }; + + $.jqplot.ElemContainer.prototype.getBottom = function() { + return this._elem.css('bottom'); + }; + + $.jqplot.ElemContainer.prototype.getRight = function() { + return this._elem.css('right'); + }; + + + /** + * Class: Axis + * An individual axis object. Cannot be instantiated directly, but created + * by the Plot object. Axis properties can be set or overridden by the + * options passed in from the user. + * + */ + function Axis(name) { + $.jqplot.ElemContainer.call(this); + // Group: Properties + // + // Axes options are specified within an axes object at the top level of the + // plot options like so: + // > { + // > axes: { + // > xaxis: {min: 5}, + // > yaxis: {min: 2, max: 8, numberTicks:4}, + // > x2axis: {pad: 1.5}, + // > y2axis: {ticks:[22, 44, 66, 88]} + // > } + // > } + // There are 2 x axes, 'xaxis' and 'x2axis', and + // 9 yaxes, 'yaxis', 'y2axis'. 'y3axis', ... Any or all of which may be specified. + this.name = name; + this._series = []; + // prop: show + // Wether to display the axis on the graph. + this.show = false; + // prop: tickRenderer + // A class of a rendering engine for creating the ticks labels displayed on the plot, + // See <$.jqplot.AxisTickRenderer>. + this.tickRenderer = $.jqplot.AxisTickRenderer; + // prop: tickOptions + // Options that will be passed to the tickRenderer, see <$.jqplot.AxisTickRenderer> options. + this.tickOptions = {}; + // prop: labelRenderer + // A class of a rendering engine for creating an axis label. + this.labelRenderer = $.jqplot.AxisLabelRenderer; + // prop: labelOptions + // Options passed to the label renderer. + this.labelOptions = {}; + // prop: label + // Label for the axis + this.label = null; + // prop: showLabel + // true to show the axis label. + this.showLabel = true; + // prop: min + // minimum value of the axis (in data units, not pixels). + this.min = null; + // prop: max + // maximum value of the axis (in data units, not pixels). + this.max = null; + // prop: autoscale + // DEPRECATED + // the default scaling algorithm produces superior results. + this.autoscale = false; + // prop: pad + // Padding to extend the range above and below the data bounds. + // The data range is multiplied by this factor to determine minimum and maximum axis bounds. + // A value of 0 will be interpreted to mean no padding, and pad will be set to 1.0. + this.pad = 1.2; + // prop: padMax + // Padding to extend the range above data bounds. + // The top of the data range is multiplied by this factor to determine maximum axis bounds. + // A value of 0 will be interpreted to mean no padding, and padMax will be set to 1.0. + this.padMax = null; + // prop: padMin + // Padding to extend the range below data bounds. + // The bottom of the data range is multiplied by this factor to determine minimum axis bounds. + // A value of 0 will be interpreted to mean no padding, and padMin will be set to 1.0. + this.padMin = null; + // prop: ticks + // 1D [val, val, ...] or 2D [[val, label], [val, label], ...] array of ticks for the axis. + // If no label is specified, the value is formatted into an appropriate label. + this.ticks = []; + // prop: numberTicks + // Desired number of ticks. Default is to compute automatically. + this.numberTicks; + // prop: tickInterval + // number of units between ticks. Mutually exclusive with numberTicks. + this.tickInterval; + // prop: renderer + // A class of a rendering engine that handles tick generation, + // scaling input data to pixel grid units and drawing the axis element. + this.renderer = $.jqplot.LinearAxisRenderer; + // prop: rendererOptions + // renderer specific options. See <$.jqplot.LinearAxisRenderer> for options. + this.rendererOptions = {}; + // prop: showTicks + // Wether to show the ticks (both marks and labels) or not. + // Will not override showMark and showLabel options if specified on the ticks themselves. + this.showTicks = true; + // prop: showTickMarks + // Wether to show the tick marks (line crossing grid) or not. + // Overridden by showTicks and showMark option of tick itself. + this.showTickMarks = true; + // prop: showMinorTicks + // Wether or not to show minor ticks. This is renderer dependent. + this.showMinorTicks = true; + // prop: drawMajorGridlines + // True to draw gridlines for major axis ticks. + this.drawMajorGridlines = true; + // prop: drawMinorGridlines + // True to draw gridlines for minor ticks. + this.drawMinorGridlines = false; + // prop: drawMajorTickMarks + // True to draw tick marks for major axis ticks. + this.drawMajorTickMarks = true; + // prop: drawMinorTickMarks + // True to draw tick marks for minor ticks. This is renderer dependent. + this.drawMinorTickMarks = true; + // prop: useSeriesColor + // Use the color of the first series associated with this axis for the + // tick marks and line bordering this axis. + this.useSeriesColor = false; + // prop: borderWidth + // width of line stroked at the border of the axis. Defaults + // to the width of the grid boarder. + this.borderWidth = null; + // prop: borderColor + // color of the border adjacent to the axis. Defaults to grid border color. + this.borderColor = null; + // prop: scaleToHiddenSeries + // True to include hidden series when computing axes bounds and scaling. + this.scaleToHiddenSeries = false; + // minimum and maximum values on the axis. + this._dataBounds = {min:null, max:null}; + // statistics (min, max, mean) as well as actual data intervals for each series attached to axis. + // holds collection of {intervals:[], min:, max:, mean: } objects for each series on axis. + this._intervalStats = []; + // pixel position from the top left of the min value and max value on the axis. + this._offsets = {min:null, max:null}; + this._ticks=[]; + this._label = null; + // prop: syncTicks + // true to try and synchronize tick spacing across multiple axes so that ticks and + // grid lines line up. This has an impact on autoscaling algorithm, however. + // In general, autoscaling an individual axis will work better if it does not + // have to sync ticks. + this.syncTicks = null; + // prop: tickSpacing + // Approximate pixel spacing between ticks on graph. Used during autoscaling. + // This number will be an upper bound, actual spacing will be less. + this.tickSpacing = 75; + // Properties to hold the original values for min, max, ticks, tickInterval and numberTicks + // so they can be restored if altered by plugins. + this._min = null; + this._max = null; + this._tickInterval = null; + this._numberTicks = null; + this.__ticks = null; + // hold original user options. + this._options = {}; + } + + Axis.prototype = new $.jqplot.ElemContainer(); + Axis.prototype.constructor = Axis; + + Axis.prototype.init = function() { + if ($.isFunction(this.renderer)) { + this.renderer = new this.renderer(); + } + // set the axis name + this.tickOptions.axis = this.name; + // if showMark or showLabel tick options not specified, use value of axis option. + // showTicks overrides showTickMarks. + if (this.tickOptions.showMark == null) { + this.tickOptions.showMark = this.showTicks; + } + if (this.tickOptions.showMark == null) { + this.tickOptions.showMark = this.showTickMarks; + } + if (this.tickOptions.showLabel == null) { + this.tickOptions.showLabel = this.showTicks; + } + + if (this.label == null || this.label == '') { + this.showLabel = false; + } + else { + this.labelOptions.label = this.label; + } + if (this.showLabel == false) { + this.labelOptions.show = false; + } + // set the default padMax, padMin if not specified + // special check, if no padding desired, padding + // should be set to 1.0 + if (this.pad == 0) { + this.pad = 1.0; + } + if (this.padMax == 0) { + this.padMax = 1.0; + } + if (this.padMin == 0) { + this.padMin = 1.0; + } + if (this.padMax == null) { + this.padMax = (this.pad-1)/2 + 1; + } + if (this.padMin == null) { + this.padMin = (this.pad-1)/2 + 1; + } + // now that padMin and padMax are correctly set, reset pad in case user has supplied + // padMin and/or padMax + this.pad = this.padMax + this.padMin - 1; + if (this.min != null || this.max != null) { + this.autoscale = false; + } + // if not set, sync ticks for y axes but not x by default. + if (this.syncTicks == null && this.name.indexOf('y') > -1) { + this.syncTicks = true; + } + else if (this.syncTicks == null){ + this.syncTicks = false; + } + this.renderer.init.call(this, this.rendererOptions); + + }; + + Axis.prototype.draw = function(ctx, plot) { + // Memory Leaks patch + if (this.__ticks) { + this.__ticks = null; + } + + return this.renderer.draw.call(this, ctx, plot); + + }; + + Axis.prototype.set = function() { + this.renderer.set.call(this); + }; + + Axis.prototype.pack = function(pos, offsets) { + if (this.show) { + this.renderer.pack.call(this, pos, offsets); + } + // these properties should all be available now. + if (this._min == null) { + this._min = this.min; + this._max = this.max; + this._tickInterval = this.tickInterval; + this._numberTicks = this.numberTicks; + this.__ticks = this._ticks; + } + }; + + // reset the axis back to original values if it has been scaled, zoomed, etc. + Axis.prototype.reset = function() { + this.renderer.reset.call(this); + }; + + Axis.prototype.resetScale = function(opts) { + $.extend(true, this, {min: null, max: null, numberTicks: null, tickInterval: null, _ticks: [], ticks: []}, opts); + this.resetDataBounds(); + }; + + Axis.prototype.resetDataBounds = function() { + // Go through all the series attached to this axis and find + // the min/max bounds for this axis. + var db = this._dataBounds; + db.min = null; + db.max = null; + var l, s, d; + // check for when to force min 0 on bar series plots. + var doforce = (this.show) ? true : false; + for (var i=0; i db.max) || db.max == null) { + db.max = d[j][0]; + } + } + else { + if ((d[j][minyidx] != null && d[j][minyidx] < db.min) || db.min == null) { + db.min = d[j][minyidx]; + } + if ((d[j][maxyidx] != null && d[j][maxyidx] > db.max) || db.max == null) { + db.max = d[j][maxyidx]; + } + } + } + + // Hack to not pad out bottom of bar plots unless user has specified a padding. + // every series will have a chance to set doforce to false. once it is set to + // false, it cannot be reset to true. + // If any series attached to axis is not a bar, wont force 0. + if (doforce && s.renderer.constructor !== $.jqplot.BarRenderer) { + doforce = false; + } + + else if (doforce && this._options.hasOwnProperty('forceTickAt0') && this._options.forceTickAt0 == false) { + doforce = false; + } + + else if (doforce && s.renderer.constructor === $.jqplot.BarRenderer) { + if (s.barDirection == 'vertical' && this.name != 'xaxis' && this.name != 'x2axis') { + if (this._options.pad != null || this._options.padMin != null) { + doforce = false; + } + } + + else if (s.barDirection == 'horizontal' && (this.name == 'xaxis' || this.name == 'x2axis')) { + if (this._options.pad != null || this._options.padMin != null) { + doforce = false; + } + } + + } + } + } + + if (doforce && this.renderer.constructor === $.jqplot.LinearAxisRenderer && db.min >= 0) { + this.padMin = 1.0; + this.forceTickAt0 = true; + } + }; + + /** + * Class: Legend + * Legend object. Cannot be instantiated directly, but created + * by the Plot object. Legend properties can be set or overridden by the + * options passed in from the user. + */ + function Legend(options) { + $.jqplot.ElemContainer.call(this); + // Group: Properties + + // prop: show + // Wether to display the legend on the graph. + this.show = false; + // prop: location + // Placement of the legend. one of the compass directions: nw, n, ne, e, se, s, sw, w + this.location = 'ne'; + // prop: labels + // Array of labels to use. By default the renderer will look for labels on the series. + // Labels specified in this array will override labels specified on the series. + this.labels = []; + // prop: showLabels + // true to show the label text on the legend. + this.showLabels = true; + // prop: showSwatch + // true to show the color swatches on the legend. + this.showSwatches = true; + // prop: placement + // "insideGrid" places legend inside the grid area of the plot. + // "outsideGrid" places the legend outside the grid but inside the plot container, + // shrinking the grid to accomodate the legend. + // "inside" synonym for "insideGrid", + // "outside" places the legend ouside the grid area, but does not shrink the grid which + // can cause the legend to overflow the plot container. + this.placement = "insideGrid"; + // prop: xoffset + // DEPRECATED. Set the margins on the legend using the marginTop, marginLeft, etc. + // properties or via CSS margin styling of the .jqplot-table-legend class. + this.xoffset = 0; + // prop: yoffset + // DEPRECATED. Set the margins on the legend using the marginTop, marginLeft, etc. + // properties or via CSS margin styling of the .jqplot-table-legend class. + this.yoffset = 0; + // prop: border + // css spec for the border around the legend box. + this.border; + // prop: background + // css spec for the background of the legend box. + this.background; + // prop: textColor + // css color spec for the legend text. + this.textColor; + // prop: fontFamily + // css font-family spec for the legend text. + this.fontFamily; + // prop: fontSize + // css font-size spec for the legend text. + this.fontSize ; + // prop: rowSpacing + // css padding-top spec for the rows in the legend. + this.rowSpacing = '0.5em'; + // renderer + // A class that will create a DOM object for the legend, + // see <$.jqplot.TableLegendRenderer>. + this.renderer = $.jqplot.TableLegendRenderer; + // prop: rendererOptions + // renderer specific options passed to the renderer. + this.rendererOptions = {}; + // prop: predraw + // Wether to draw the legend before the series or not. + // Used with series specific legend renderers for pie, donut, mekko charts, etc. + this.preDraw = false; + // prop: marginTop + // CSS margin for the legend DOM element. This will set an element + // CSS style for the margin which will override any style sheet setting. + // The default will be taken from the stylesheet. + this.marginTop = null; + // prop: marginRight + // CSS margin for the legend DOM element. This will set an element + // CSS style for the margin which will override any style sheet setting. + // The default will be taken from the stylesheet. + this.marginRight = null; + // prop: marginBottom + // CSS margin for the legend DOM element. This will set an element + // CSS style for the margin which will override any style sheet setting. + // The default will be taken from the stylesheet. + this.marginBottom = null; + // prop: marginLeft + // CSS margin for the legend DOM element. This will set an element + // CSS style for the margin which will override any style sheet setting. + // The default will be taken from the stylesheet. + this.marginLeft = null; + // prop: escapeHtml + // True to escape special characters with their html entity equivalents + // in legend text. "<" becomes < and so on, so html tags are not rendered. + this.escapeHtml = false; + this._series = []; + + $.extend(true, this, options); + } + + Legend.prototype = new $.jqplot.ElemContainer(); + Legend.prototype.constructor = Legend; + + Legend.prototype.setOptions = function(options) { + $.extend(true, this, options); + + // Try to emulate deprecated behaviour + // if user has specified xoffset or yoffset, copy these to + // the margin properties. + + if (this.placement == 'inside') { + this.placement = 'insideGrid'; + } + + if (this.xoffset >0) { + if (this.placement == 'insideGrid') { + switch (this.location) { + case 'nw': + case 'w': + case 'sw': + if (this.marginLeft == null) { + this.marginLeft = this.xoffset + 'px'; + } + this.marginRight = '0px'; + break; + case 'ne': + case 'e': + case 'se': + default: + if (this.marginRight == null) { + this.marginRight = this.xoffset + 'px'; + } + this.marginLeft = '0px'; + break; + } + } + else if (this.placement == 'outside') { + switch (this.location) { + case 'nw': + case 'w': + case 'sw': + if (this.marginRight == null) { + this.marginRight = this.xoffset + 'px'; + } + this.marginLeft = '0px'; + break; + case 'ne': + case 'e': + case 'se': + default: + if (this.marginLeft == null) { + this.marginLeft = this.xoffset + 'px'; + } + this.marginRight = '0px'; + break; + } + } + this.xoffset = 0; + } + + if (this.yoffset >0) { + if (this.placement == 'outside') { + switch (this.location) { + case 'sw': + case 's': + case 'se': + if (this.marginTop == null) { + this.marginTop = this.yoffset + 'px'; + } + this.marginBottom = '0px'; + break; + case 'ne': + case 'n': + case 'nw': + default: + if (this.marginBottom == null) { + this.marginBottom = this.yoffset + 'px'; + } + this.marginTop = '0px'; + break; + } + } + else if (this.placement == 'insideGrid') { + switch (this.location) { + case 'sw': + case 's': + case 'se': + if (this.marginBottom == null) { + this.marginBottom = this.yoffset + 'px'; + } + this.marginTop = '0px'; + break; + case 'ne': + case 'n': + case 'nw': + default: + if (this.marginTop == null) { + this.marginTop = this.yoffset + 'px'; + } + this.marginBottom = '0px'; + break; + } + } + this.yoffset = 0; + } + + // TO-DO: + // Handle case where offsets are < 0. + // + }; + + Legend.prototype.init = function() { + if ($.isFunction(this.renderer)) { + this.renderer = new this.renderer(); + } + this.renderer.init.call(this, this.rendererOptions); + }; + + Legend.prototype.draw = function(offsets, plot) { + for (var i=0; i<$.jqplot.preDrawLegendHooks.length; i++){ + $.jqplot.preDrawLegendHooks[i].call(this, offsets); + } + return this.renderer.draw.call(this, offsets, plot); + }; + + Legend.prototype.pack = function(offsets) { + this.renderer.pack.call(this, offsets); + }; + + /** + * Class: Title + * Plot Title object. Cannot be instantiated directly, but created + * by the Plot object. Title properties can be set or overridden by the + * options passed in from the user. + * + * Parameters: + * text - text of the title. + */ + function Title(text) { + $.jqplot.ElemContainer.call(this); + // Group: Properties + + // prop: text + // text of the title; + this.text = text; + // prop: show + // whether or not to show the title + this.show = true; + // prop: fontFamily + // css font-family spec for the text. + this.fontFamily; + // prop: fontSize + // css font-size spec for the text. + this.fontSize ; + // prop: textAlign + // css text-align spec for the text. + this.textAlign; + // prop: textColor + // css color spec for the text. + this.textColor; + // prop: renderer + // A class for creating a DOM element for the title, + // see <$.jqplot.DivTitleRenderer>. + this.renderer = $.jqplot.DivTitleRenderer; + // prop: rendererOptions + // renderer specific options passed to the renderer. + this.rendererOptions = {}; + // prop: escapeHtml + // True to escape special characters with their html entity equivalents + // in title text. "<" becomes < and so on, so html tags are not rendered. + this.escapeHtml = false; + } + + Title.prototype = new $.jqplot.ElemContainer(); + Title.prototype.constructor = Title; + + Title.prototype.init = function() { + if ($.isFunction(this.renderer)) { + this.renderer = new this.renderer(); + } + this.renderer.init.call(this, this.rendererOptions); + }; + + Title.prototype.draw = function(width) { + return this.renderer.draw.call(this, width); + }; + + Title.prototype.pack = function() { + this.renderer.pack.call(this); + }; + + + /** + * Class: Series + * An individual data series object. Cannot be instantiated directly, but created + * by the Plot object. Series properties can be set or overridden by the + * options passed in from the user. + */ + function Series(options) { + options = options || {}; + $.jqplot.ElemContainer.call(this); + // Group: Properties + // Properties will be assigned from a series array at the top level of the + // options. If you had two series and wanted to change the color and line + // width of the first and set the second to use the secondary y axis with + // no shadow and supply custom labels for each: + // > { + // > series:[ + // > {color: '#ff4466', lineWidth: 5, label:'good line'}, + // > {yaxis: 'y2axis', shadow: false, label:'bad line'} + // > ] + // > } + + // prop: show + // whether or not to draw the series. + this.show = true; + // prop: xaxis + // which x axis to use with this series, either 'xaxis' or 'x2axis'. + this.xaxis = 'xaxis'; + this._xaxis; + // prop: yaxis + // which y axis to use with this series, either 'yaxis' or 'y2axis'. + this.yaxis = 'yaxis'; + this._yaxis; + this.gridBorderWidth = 2.0; + // prop: renderer + // A class of a renderer which will draw the series, + // see <$.jqplot.LineRenderer>. + this.renderer = $.jqplot.LineRenderer; + // prop: rendererOptions + // Options to pass on to the renderer. + this.rendererOptions = {}; + this.data = []; + this.gridData = []; + // prop: label + // Line label to use in the legend. + this.label = ''; + // prop: showLabel + // true to show label for this series in the legend. + this.showLabel = true; + // prop: color + // css color spec for the series + this.color; + // prop: negativeColor + // css color spec used for filled (area) plots that are filled to zero and + // the "useNegativeColors" option is true. + this.negativeColor; + // prop: lineWidth + // width of the line in pixels. May have different meanings depending on renderer. + this.lineWidth = 2.5; + // prop: lineJoin + // Canvas lineJoin style between segments of series. + this.lineJoin = 'round'; + // prop: lineCap + // Canvas lineCap style at ends of line. + this.lineCap = 'round'; + // prop: linePattern + // line pattern 'dashed', 'dotted', 'solid', some combination + // of '-' and '.' characters such as '.-.' or a numerical array like + // [draw, skip, draw, skip, ...] such as [1, 10] to draw a dotted line, + // [1, 10, 20, 10] to draw a dot-dash line, and so on. + this.linePattern = 'solid'; + this.shadow = true; + // prop: shadowAngle + // Shadow angle in degrees + this.shadowAngle = 45; + // prop: shadowOffset + // Shadow offset from line in pixels + this.shadowOffset = 1.25; + // prop: shadowDepth + // Number of times shadow is stroked, each stroke offset shadowOffset from the last. + this.shadowDepth = 3; + // prop: shadowAlpha + // Alpha channel transparency of shadow. 0 = transparent. + this.shadowAlpha = '0.1'; + // prop: breakOnNull + // Wether line segments should be be broken at null value. + // False will join point on either side of line. + this.breakOnNull = false; + // prop: markerRenderer + // A class of a renderer which will draw marker (e.g. circle, square, ...) at the data points, + // see <$.jqplot.MarkerRenderer>. + this.markerRenderer = $.jqplot.MarkerRenderer; + // prop: markerOptions + // renderer specific options to pass to the markerRenderer, + // see <$.jqplot.MarkerRenderer>. + this.markerOptions = {}; + // prop: showLine + // whether to actually draw the line or not. Series will still be renderered, even if no line is drawn. + this.showLine = true; + // prop: showMarker + // whether or not to show the markers at the data points. + this.showMarker = true; + // prop: index + // 0 based index of this series in the plot series array. + this.index; + // prop: fill + // true or false, whether to fill under lines or in bars. + // May not be implemented in all renderers. + this.fill = false; + // prop: fillColor + // CSS color spec to use for fill under line. Defaults to line color. + this.fillColor; + // prop: fillAlpha + // Alpha transparency to apply to the fill under the line. + // Use this to adjust alpha separate from fill color. + this.fillAlpha; + // prop: fillAndStroke + // If true will stroke the line (with color this.color) as well as fill under it. + // Applies only when fill is true. + this.fillAndStroke = false; + // prop: disableStack + // true to not stack this series with other series in the plot. + // To render properly, non-stacked series must come after any stacked series + // in the plot's data series array. So, the plot's data series array would look like: + // > [stackedSeries1, stackedSeries2, ..., nonStackedSeries1, nonStackedSeries2, ...] + // disableStack will put a gap in the stacking order of series, and subsequent + // stacked series will not fill down through the non-stacked series and will + // most likely not stack properly on top of the non-stacked series. + this.disableStack = false; + // _stack is set by the Plot if the plot is a stacked chart. + // will stack lines or bars on top of one another to build a "mountain" style chart. + // May not be implemented in all renderers. + this._stack = false; + // prop: neighborThreshold + // how close or far (in pixels) the cursor must be from a point marker to detect the point. + this.neighborThreshold = 4; + // prop: fillToZero + // true will force bar and filled series to fill toward zero on the fill Axis. + this.fillToZero = false; + // prop: fillToValue + // fill a filled series to this value on the fill axis. + // Works in conjunction with fillToZero, so that must be true. + this.fillToValue = 0; + // prop: fillAxis + // Either 'x' or 'y'. Which axis to fill the line toward if fillToZero is true. + // 'y' means fill up/down to 0 on the y axis for this series. + this.fillAxis = 'y'; + // prop: useNegativeColors + // true to color negative values differently in filled and bar charts. + this.useNegativeColors = true; + this._stackData = []; + // _plotData accounts for stacking. If plots not stacked, _plotData and data are same. If + // stacked, _plotData is accumulation of stacking data. + this._plotData = []; + // _plotValues hold the individual x and y values that will be plotted for this series. + this._plotValues = {x:[], y:[]}; + // statistics about the intervals between data points. Used for auto scaling. + this._intervals = {x:{}, y:{}}; + // data from the previous series, for stacked charts. + this._prevPlotData = []; + this._prevGridData = []; + this._stackAxis = 'y'; + this._primaryAxis = '_xaxis'; + // give each series a canvas to draw on. This should allow for redrawing speedups. + this.canvas = new $.jqplot.GenericCanvas(); + this.shadowCanvas = new $.jqplot.GenericCanvas(); + this.plugins = {}; + // sum of y values in this series. + this._sumy = 0; + this._sumx = 0; + this._type = ''; + this.step = false; + } + + Series.prototype = new $.jqplot.ElemContainer(); + Series.prototype.constructor = Series; + + Series.prototype.init = function(index, gridbw, plot) { + // weed out any null values in the data. + this.index = index; + this.gridBorderWidth = gridbw; + var d = this.data; + var temp = [], i, l; + for (i=0, l=d.length; i. + this.renderer = $.jqplot.CanvasGridRenderer; + // prop: rendererOptions + // Options to pass on to the renderer, + // see <$.jqplot.CanvasGridRenderer>. + this.rendererOptions = {}; + this._offsets = {top:null, bottom:null, left:null, right:null}; + } + + Grid.prototype = new $.jqplot.ElemContainer(); + Grid.prototype.constructor = Grid; + + Grid.prototype.init = function() { + if ($.isFunction(this.renderer)) { + this.renderer = new this.renderer(); + } + this.renderer.init.call(this, this.rendererOptions); + }; + + Grid.prototype.createElement = function(offsets,plot) { + this._offsets = offsets; + return this.renderer.createElement.call(this, plot); + }; + + Grid.prototype.draw = function() { + this.renderer.draw.call(this); + }; + + $.jqplot.GenericCanvas = function() { + $.jqplot.ElemContainer.call(this); + this._ctx; + }; + + $.jqplot.GenericCanvas.prototype = new $.jqplot.ElemContainer(); + $.jqplot.GenericCanvas.prototype.constructor = $.jqplot.GenericCanvas; + + $.jqplot.GenericCanvas.prototype.createElement = function(offsets, clss, plotDimensions, plot) { + this._offsets = offsets; + var klass = 'jqplot'; + if (clss != undefined) { + klass = clss; + } + var elem; + + elem = plot.canvasManager.getCanvas(); + + // if new plotDimensions supplied, use them. + if (plotDimensions != null) { + this._plotDimensions = plotDimensions; + } + + elem.width = this._plotDimensions.width - this._offsets.left - this._offsets.right; + elem.height = this._plotDimensions.height - this._offsets.top - this._offsets.bottom; + this._elem = $(elem); + this._elem.css({ position: 'absolute', left: this._offsets.left, top: this._offsets.top }); + + this._elem.addClass(klass); + + elem = plot.canvasManager.initCanvas(elem); + + elem = null; + return this._elem; + }; + + $.jqplot.GenericCanvas.prototype.setContext = function() { + this._ctx = this._elem.get(0).getContext("2d"); + return this._ctx; + }; + + // Memory Leaks patch + $.jqplot.GenericCanvas.prototype.resetCanvas = function() { + if (this._elem) { + if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) { + window.G_vmlCanvasManager.uninitElement(this._elem.get(0)); + } + + //this._elem.remove(); + this._elem.emptyForce(); + } + + this._ctx = null; + }; + + $.jqplot.HooksManager = function () { + this.hooks =[]; + this.args = []; + }; + + $.jqplot.HooksManager.prototype.addOnce = function(fn, args) { + args = args || []; + var havehook = false; + for (var i=0, l=this.hooks.length; i { + // > axesDefaults:{min:0}, + // > series:[{color:'#6633dd'}], + // > title: 'A Plot' + // > } + // + + // prop: animate + // True to animate the series on initial plot draw (renderer dependent). + // Actual animation functionality must be supported in the renderer. + this.animate = false; + // prop: animateReplot + // True to animate series after a call to the replot() method. + // Use with caution! Replots can happen very frequently under + // certain circumstances (e.g. resizing, dragging points) and + // animation in these situations can cause problems. + this.animateReplot = false; + // prop: axes + // up to 4 axes are supported, each with its own options, + // See for axis specific options. + this.axes = {xaxis: new Axis('xaxis'), yaxis: new Axis('yaxis'), x2axis: new Axis('x2axis'), y2axis: new Axis('y2axis'), y3axis: new Axis('y3axis'), y4axis: new Axis('y4axis'), y5axis: new Axis('y5axis'), y6axis: new Axis('y6axis'), y7axis: new Axis('y7axis'), y8axis: new Axis('y8axis'), y9axis: new Axis('y9axis'), yMidAxis: new Axis('yMidAxis')}; + this.baseCanvas = new $.jqplot.GenericCanvas(); + // true to intercept right click events and fire a 'jqplotRightClick' event. + // this will also block the context menu. + this.captureRightClick = false; + // prop: data + // user's data. Data should *NOT* be specified in the options object, + // but be passed in as the second argument to the $.jqplot() function. + // The data property is described here soley for reference. + // The data should be in the form of an array of 2D or 1D arrays like + // > [ [[x1, y1], [x2, y2],...], [y1, y2, ...] ]. + this.data = []; + // prop: dataRenderer + // A callable which can be used to preprocess data passed into the plot. + // Will be called with 3 arguments: the plot data, a reference to the plot, + // and the value of dataRendererOptions. + this.dataRenderer; + // prop: dataRendererOptions + // Options that will be passed to the dataRenderer. + // Can be of any type. + this.dataRendererOptions; + this.defaults = { + // prop: axesDefaults + // default options that will be applied to all axes. + // see for axes options. + axesDefaults: {}, + axes: {xaxis:{}, yaxis:{}, x2axis:{}, y2axis:{}, y3axis:{}, y4axis:{}, y5axis:{}, y6axis:{}, y7axis:{}, y8axis:{}, y9axis:{}, yMidAxis:{}}, + // prop: seriesDefaults + // default options that will be applied to all series. + // see for series options. + seriesDefaults: {}, + series:[] + }; + // prop: defaultAxisStart + // 1-D data series are internally converted into 2-D [x,y] data point arrays + // by jqPlot. This is the default starting value for the missing x or y value. + // The added data will be a monotonically increasing series (e.g. [1, 2, 3, ...]) + // starting at this value. + this.defaultAxisStart = 1; + // this.doCustomEventBinding = true; + // prop: drawIfHidden + // True to execute the draw method even if the plot target is hidden. + // Generally, this should be false. Most plot elements will not be sized/ + // positioned correclty if renderered into a hidden container. To render into + // a hidden container, call the replot method when the container is shown. + this.drawIfHidden = false; + this.eventCanvas = new $.jqplot.GenericCanvas(); + // prop: fillBetween + // Fill between 2 line series in a plot. + // Options object: + // { + // series1: first index (0 based) of series in fill + // series2: second index (0 based) of series in fill + // color: color of fill [default fillColor of series1] + // baseSeries: fill will be drawn below this series (0 based index) + // fill: false to turn off fill [default true]. + // } + this.fillBetween = { + series1: null, + series2: null, + color: null, + baseSeries: 0, + fill: true + }; + // prop; fontFamily + // css spec for the font-family attribute. Default for the entire plot. + this.fontFamily; + // prop: fontSize + // css spec for the font-size attribute. Default for the entire plot. + this.fontSize; + // prop: grid + // See for grid specific options. + this.grid = new Grid(); + // prop: legend + // see <$.jqplot.TableLegendRenderer> + this.legend = new Legend(); + // prop: noDataIndicator + // Options to set up a mock plot with a data loading indicator if no data is specified. + this.noDataIndicator = { + show: false, + indicator: 'Loading Data...', + axes: { + xaxis: { + min: 0, + max: 10, + tickInterval: 2, + show: true + }, + yaxis: { + min: 0, + max: 12, + tickInterval: 3, + show: true + } + } + }; + // prop: negativeSeriesColors + // colors to use for portions of the line below zero. + this.negativeSeriesColors = $.jqplot.config.defaultNegativeColors; + // container to hold all of the merged options. Convienence for plugins. + this.options = {}; + this.previousSeriesStack = []; + // Namespace to hold plugins. Generally non-renderer plugins add themselves to here. + this.plugins = {}; + // prop: series + // Array of series object options. + // see for series specific options. + this.series = []; + // array of series indices. Keep track of order + // which series canvases are displayed, lowest + // to highest, back to front. + this.seriesStack = []; + // prop: seriesColors + // Ann array of CSS color specifications that will be applied, in order, + // to the series in the plot. Colors will wrap around so, if their + // are more series than colors, colors will be reused starting at the + // beginning. For pie charts, this specifies the colors of the slices. + this.seriesColors = $.jqplot.config.defaultColors; + // prop: sortData + // false to not sort the data passed in by the user. + // Many bar, stacked and other graphs as well as many plugins depend on + // having sorted data. + this.sortData = true; + // prop: stackSeries + // true or false, creates a stack or "mountain" plot. + // Not all series renderers may implement this option. + this.stackSeries = false; + // a shortcut for axis syncTicks options. Not implemented yet. + this.syncXTicks = true; + // a shortcut for axis syncTicks options. Not implemented yet. + this.syncYTicks = true; + // the jquery object for the dom target. + this.target = null; + // The id of the dom element to render the plot into + this.targetId = null; + // prop textColor + // css spec for the css color attribute. Default for the entire plot. + this.textColor; + // prop: title + // Title object. See for specific options. As a shortcut, you + // can specify the title option as just a string like: title: 'My Plot' + // and this will create a new title object with the specified text. + this.title = new Title(); + // Count how many times the draw method has been called while the plot is visible. + // Mostly used to test if plot has never been dran (=0), has been successfully drawn + // into a visible container once (=1) or draw more than once into a visible container. + // Can use this in tests to see if plot has been visibly drawn at least one time. + // After plot has been visibly drawn once, it generally doesn't need redrawing if its + // container is hidden and shown. + this._drawCount = 0; + // sum of y values for all series in plot. + // used in mekko chart. + this._sumy = 0; + this._sumx = 0; + // array to hold the cumulative stacked series data. + // used to ajust the individual series data, which won't have access to other + // series data. + this._stackData = []; + // array that holds the data to be plotted. This will be the series data + // merged with the the appropriate data from _stackData according to the stackAxis. + this._plotData = []; + this._width = null; + this._height = null; + this._plotDimensions = {height:null, width:null}; + this._gridPadding = {top:null, right:null, bottom:null, left:null}; + this._defaultGridPadding = {top:10, right:10, bottom:23, left:10}; + + this._addDomReference = $.jqplot.config.addDomReference; + + this.preInitHooks = new $.jqplot.HooksManager(); + this.postInitHooks = new $.jqplot.HooksManager(); + this.preParseOptionsHooks = new $.jqplot.HooksManager(); + this.postParseOptionsHooks = new $.jqplot.HooksManager(); + this.preDrawHooks = new $.jqplot.HooksManager(); + this.postDrawHooks = new $.jqplot.HooksManager(); + this.preDrawSeriesHooks = new $.jqplot.HooksManager(); + this.postDrawSeriesHooks = new $.jqplot.HooksManager(); + this.preDrawLegendHooks = new $.jqplot.HooksManager(); + this.addLegendRowHooks = new $.jqplot.HooksManager(); + this.preSeriesInitHooks = new $.jqplot.HooksManager(); + this.postSeriesInitHooks = new $.jqplot.HooksManager(); + this.preParseSeriesOptionsHooks = new $.jqplot.HooksManager(); + this.postParseSeriesOptionsHooks = new $.jqplot.HooksManager(); + this.eventListenerHooks = new $.jqplot.EventListenerManager(); + this.preDrawSeriesShadowHooks = new $.jqplot.HooksManager(); + this.postDrawSeriesShadowHooks = new $.jqplot.HooksManager(); + + this.colorGenerator = new $.jqplot.ColorGenerator(); + this.negativeColorGenerator = new $.jqplot.ColorGenerator(); + + this.canvasManager = new $.jqplot.CanvasManager(); + + this.themeEngine = new $.jqplot.ThemeEngine(); + + var seriesColorsIndex = 0; + + // Group: methods + // + // method: init + // sets the plot target, checks data and applies user + // options to plot. + this.init = function(target, data, options) { + options = options || {}; + for (var i=0; i<$.jqplot.preInitHooks.length; i++) { + $.jqplot.preInitHooks[i].call(this, target, data, options); + } + + for (var i=0; i<this.preInitHooks.hooks.length; i++) { + this.preInitHooks.hooks[i].call(this, target, data, options); + } + + this.targetId = '#'+target; + this.target = $('#'+target); + + ////// + // Add a reference to plot + ////// + if (this._addDomReference) { + this.target.data('jqplot', this); + } + // remove any error class that may be stuck on target. + this.target.removeClass('jqplot-error'); + if (!this.target.get(0)) { + throw new Error("No plot target specified"); + } + + // make sure the target is positioned by some means and set css + if (this.target.css('position') == 'static') { + this.target.css('position', 'relative'); + } + if (!this.target.hasClass('jqplot-target')) { + this.target.addClass('jqplot-target'); + } + + // if no height or width specified, use a default. + if (!this.target.height()) { + var h; + if (options && options.height) { + h = parseInt(options.height, 10); + } + else if (this.target.attr('data-height')) { + h = parseInt(this.target.attr('data-height'), 10); + } + else { + h = parseInt($.jqplot.config.defaultHeight, 10); + } + this._height = h; + this.target.css('height', h+'px'); + } + else { + this._height = h = this.target.height(); + } + if (!this.target.width()) { + var w; + if (options && options.width) { + w = parseInt(options.width, 10); + } + else if (this.target.attr('data-width')) { + w = parseInt(this.target.attr('data-width'), 10); + } + else { + w = parseInt($.jqplot.config.defaultWidth, 10); + } + this._width = w; + this.target.css('width', w+'px'); + } + else { + this._width = w = this.target.width(); + } + + for (var i=0, l=_axisNames.length; i<l; i++) { + this.axes[_axisNames[i]] = new Axis(_axisNames[i]); + } + + this._plotDimensions.height = this._height; + this._plotDimensions.width = this._width; + this.grid._plotDimensions = this._plotDimensions; + this.title._plotDimensions = this._plotDimensions; + this.baseCanvas._plotDimensions = this._plotDimensions; + this.eventCanvas._plotDimensions = this._plotDimensions; + this.legend._plotDimensions = this._plotDimensions; + if (this._height <=0 || this._width <=0 || !this._height || !this._width) { + throw new Error("Canvas dimension not set"); + } + + if (options.dataRenderer && $.isFunction(options.dataRenderer)) { + if (options.dataRendererOptions) { + this.dataRendererOptions = options.dataRendererOptions; + } + this.dataRenderer = options.dataRenderer; + data = this.dataRenderer(data, this, this.dataRendererOptions); + } + + if (options.noDataIndicator && $.isPlainObject(options.noDataIndicator)) { + $.extend(true, this.noDataIndicator, options.noDataIndicator); + } + + if (data == null || $.isArray(data) == false || data.length == 0 || $.isArray(data[0]) == false || data[0].length == 0) { + + if (this.noDataIndicator.show == false) { + throw new Error("No data specified"); + } + + else { + // have to be descructive here in order for plot to not try and render series. + // This means that $.jqplot() will have to be called again when there is data. + //delete options.series; + + for (var ax in this.noDataIndicator.axes) { + for (var prop in this.noDataIndicator.axes[ax]) { + this.axes[ax][prop] = this.noDataIndicator.axes[ax][prop]; + } + } + + this.postDrawHooks.add(function() { + var eh = this.eventCanvas.getHeight(); + var ew = this.eventCanvas.getWidth(); + var temp = $('<div class="jqplot-noData-container" style="position:absolute;"></div>'); + this.target.append(temp); + temp.height(eh); + temp.width(ew); + temp.css('top', this.eventCanvas._offsets.top); + temp.css('left', this.eventCanvas._offsets.left); + + var temp2 = $('<div class="jqplot-noData-contents" style="text-align:center; position:relative; margin-left:auto; margin-right:auto;"></div>'); + temp.append(temp2); + temp2.html(this.noDataIndicator.indicator); + var th = temp2.height(); + var tw = temp2.width(); + temp2.height(th); + temp2.width(tw); + temp2.css('top', (eh - th)/2 + 'px'); + }); + + } + } + + // make a copy of the data + this.data = $.extend(true, [], data); + + this.parseOptions(options); + + if (this.textColor) { + this.target.css('color', this.textColor); + } + if (this.fontFamily) { + this.target.css('font-family', this.fontFamily); + } + if (this.fontSize) { + this.target.css('font-size', this.fontSize); + } + + this.title.init(); + this.legend.init(); + this._sumy = 0; + this._sumx = 0; + this.computePlotData(); + for (var i=0; i<this.series.length; i++) { + // set default stacking order for series canvases + this.seriesStack.push(i); + this.previousSeriesStack.push(i); + this.series[i].shadowCanvas._plotDimensions = this._plotDimensions; + this.series[i].canvas._plotDimensions = this._plotDimensions; + for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) { + $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this); + } + for (var j=0; j<this.preSeriesInitHooks.hooks.length; j++) { + this.preSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this); + } + // this.populatePlotData(this.series[i], i); + this.series[i]._plotDimensions = this._plotDimensions; + this.series[i].init(i, this.grid.borderWidth, this); + for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) { + $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this); + } + for (var j=0; j<this.postSeriesInitHooks.hooks.length; j++) { + this.postSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this); + } + this._sumy += this.series[i]._sumy; + this._sumx += this.series[i]._sumx; + } + + var name, + axis; + for (var i=0, l=_axisNames.length; i<l; i++) { + name = _axisNames[i]; + axis = this.axes[name]; + axis._plotDimensions = this._plotDimensions; + axis.init(); + if (this.axes[name].borderColor == null) { + if (name.charAt(0) !== 'x' && axis.useSeriesColor === true && axis.show) { + axis.borderColor = axis._series[0].color; + } + else { + axis.borderColor = this.grid.borderColor; + } + } + } + + if (this.sortData) { + sortData(this.series); + } + this.grid.init(); + this.grid._axes = this.axes; + + this.legend._series = this.series; + + for (var i=0; i<$.jqplot.postInitHooks.length; i++) { + $.jqplot.postInitHooks[i].call(this, target, this.data, options); + } + + for (var i=0; i<this.postInitHooks.hooks.length; i++) { + this.postInitHooks.hooks[i].call(this, target, this.data, options); + } + }; + + // method: resetAxesScale + // Reset the specified axes min, max, numberTicks and tickInterval properties to null + // or reset these properties on all axes if no list of axes is provided. + // + // Parameters: + // axes - Boolean to reset or not reset all axes or an array or object of axis names to reset. + this.resetAxesScale = function(axes, options) { + var opts = options || {}; + var ax = axes || this.axes; + if (ax === true) { + ax = this.axes; + } + if ($.isArray(ax)) { + for (var i = 0; i < ax.length; i++) { + this.axes[ax[i]].resetScale(opts[ax[i]]); + } + } + else if (typeof(ax) === 'object') { + for (var name in ax) { + this.axes[name].resetScale(opts[name]); + } + } + }; + // method: reInitialize + // reinitialize plot for replotting. + // not called directly. + this.reInitialize = function (data, opts) { + // Plot should be visible and have a height and width. + // If plot doesn't have height and width for some + // reason, set it by other means. Plot must not have + // a display:none attribute, however. + + var options = $.extend(true, {}, this.options, opts); + + var target = this.targetId.substr(1); + var tdata = (data == null) ? this.data : data; + + for (var i=0; i<$.jqplot.preInitHooks.length; i++) { + $.jqplot.preInitHooks[i].call(this, target, tdata, options); + } + + for (var i=0; i<this.preInitHooks.hooks.length; i++) { + this.preInitHooks.hooks[i].call(this, target, tdata, options); + } + + this._height = this.target.height(); + this._width = this.target.width(); + + if (this._height <=0 || this._width <=0 || !this._height || !this._width) { + throw new Error("Target dimension not set"); + } + + this._plotDimensions.height = this._height; + this._plotDimensions.width = this._width; + this.grid._plotDimensions = this._plotDimensions; + this.title._plotDimensions = this._plotDimensions; + this.baseCanvas._plotDimensions = this._plotDimensions; + this.eventCanvas._plotDimensions = this._plotDimensions; + this.legend._plotDimensions = this._plotDimensions; + + var name, + t, + j, + axis; + + for (var i=0, l=_axisNames.length; i<l; i++) { + name = _axisNames[i]; + axis = this.axes[name]; + + // Memory Leaks patch : clear ticks elements + t = axis._ticks; + for (var j = 0, tlen = t.length; j < tlen; j++) { + var el = t[j]._elem; + if (el) { + // if canvas renderer + if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) { + window.G_vmlCanvasManager.uninitElement(el.get(0)); + } + el.emptyForce(); + el = null; + t._elem = null; + } + } + t = null; + + delete axis.ticks; + delete axis._ticks; + this.axes[name] = new Axis(name); + this.axes[name]._plotWidth = this._width; + this.axes[name]._plotHeight = this._height; + } + + if (data) { + if (options.dataRenderer && $.isFunction(options.dataRenderer)) { + if (options.dataRendererOptions) { + this.dataRendererOptions = options.dataRendererOptions; + } + this.dataRenderer = options.dataRenderer; + data = this.dataRenderer(data, this, this.dataRendererOptions); + } + + // make a copy of the data + this.data = $.extend(true, [], data); + } + + if (opts) { + this.parseOptions(options); + } + + this.title._plotWidth = this._width; + + if (this.textColor) { + this.target.css('color', this.textColor); + } + if (this.fontFamily) { + this.target.css('font-family', this.fontFamily); + } + if (this.fontSize) { + this.target.css('font-size', this.fontSize); + } + + this.title.init(); + this.legend.init(); + this._sumy = 0; + this._sumx = 0; + + this.seriesStack = []; + this.previousSeriesStack = []; + + this.computePlotData(); + for (var i=0, l=this.series.length; i<l; i++) { + // set default stacking order for series canvases + this.seriesStack.push(i); + this.previousSeriesStack.push(i); + this.series[i].shadowCanvas._plotDimensions = this._plotDimensions; + this.series[i].canvas._plotDimensions = this._plotDimensions; + for (var j=0; j<$.jqplot.preSeriesInitHooks.length; j++) { + $.jqplot.preSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this); + } + for (var j=0; j<this.preSeriesInitHooks.hooks.length; j++) { + this.preSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this); + } + // this.populatePlotData(this.series[i], i); + this.series[i]._plotDimensions = this._plotDimensions; + this.series[i].init(i, this.grid.borderWidth, this); + for (var j=0; j<$.jqplot.postSeriesInitHooks.length; j++) { + $.jqplot.postSeriesInitHooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this); + } + for (var j=0; j<this.postSeriesInitHooks.hooks.length; j++) { + this.postSeriesInitHooks.hooks[j].call(this.series[i], target, this.data, this.options.seriesDefaults, this.options.series[i], this); + } + this._sumy += this.series[i]._sumy; + this._sumx += this.series[i]._sumx; + } + + for (var i=0, l=_axisNames.length; i<l; i++) { + name = _axisNames[i]; + axis = this.axes[name]; + + axis._plotDimensions = this._plotDimensions; + axis.init(); + if (axis.borderColor == null) { + if (name.charAt(0) !== 'x' && axis.useSeriesColor === true && axis.show) { + axis.borderColor = axis._series[0].color; + } + else { + axis.borderColor = this.grid.borderColor; + } + } + } + + if (this.sortData) { + sortData(this.series); + } + this.grid.init(); + this.grid._axes = this.axes; + + this.legend._series = this.series; + + for (var i=0, l=$.jqplot.postInitHooks.length; i<l; i++) { + $.jqplot.postInitHooks[i].call(this, target, this.data, options); + } + + for (var i=0, l=this.postInitHooks.hooks.length; i<l; i++) { + this.postInitHooks.hooks[i].call(this, target, this.data, options); + } + }; + + + + // method: quickInit + // + // Quick reinitialization plot for replotting. + // Does not parse options ore recreate axes and series. + // not called directly. + this.quickInit = function () { + // Plot should be visible and have a height and width. + // If plot doesn't have height and width for some + // reason, set it by other means. Plot must not have + // a display:none attribute, however. + + this._height = this.target.height(); + this._width = this.target.width(); + + if (this._height <=0 || this._width <=0 || !this._height || !this._width) { + throw new Error("Target dimension not set"); + } + + this._plotDimensions.height = this._height; + this._plotDimensions.width = this._width; + this.grid._plotDimensions = this._plotDimensions; + this.title._plotDimensions = this._plotDimensions; + this.baseCanvas._plotDimensions = this._plotDimensions; + this.eventCanvas._plotDimensions = this._plotDimensions; + this.legend._plotDimensions = this._plotDimensions; + + for (var n in this.axes) { + this.axes[n]._plotWidth = this._width; + this.axes[n]._plotHeight = this._height; + } + + this.title._plotWidth = this._width; + + if (this.textColor) { + this.target.css('color', this.textColor); + } + if (this.fontFamily) { + this.target.css('font-family', this.fontFamily); + } + if (this.fontSize) { + this.target.css('font-size', this.fontSize); + } + + this._sumy = 0; + this._sumx = 0; + this.computePlotData(); + for (var i=0; i<this.series.length; i++) { + // this.populatePlotData(this.series[i], i); + if (this.series[i]._type === 'line' && this.series[i].renderer.bands.show) { + this.series[i].renderer.initBands.call(this.series[i], this.series[i].renderer.options, this); + } + this.series[i]._plotDimensions = this._plotDimensions; + this.series[i].canvas._plotDimensions = this._plotDimensions; + //this.series[i].init(i, this.grid.borderWidth); + this._sumy += this.series[i]._sumy; + this._sumx += this.series[i]._sumx; + } + + var name; + + for (var j=0; j<12; j++) { + name = _axisNames[j]; + // Memory Leaks patch : clear ticks elements + var t = this.axes[name]._ticks; + for (var i = 0; i < t.length; i++) { + var el = t[i]._elem; + if (el) { + // if canvas renderer + if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) { + window.G_vmlCanvasManager.uninitElement(el.get(0)); + } + el.emptyForce(); + el = null; + t._elem = null; + } + } + t = null; + + this.axes[name]._plotDimensions = this._plotDimensions; + this.axes[name]._ticks = []; + // this.axes[name].renderer.init.call(this.axes[name], {}); + } + + if (this.sortData) { + sortData(this.series); + } + + this.grid._axes = this.axes; + + this.legend._series = this.series; + }; + + // sort the series data in increasing order. + function sortData(series) { + var d, sd, pd, ppd, ret; + for (var i=0; i<series.length; i++) { + var check; + var bat = [series[i].data, series[i]._stackData, series[i]._plotData, series[i]._prevPlotData]; + for (var n=0; n<4; n++) { + check = true; + d = bat[n]; + if (series[i]._stackAxis == 'x') { + for (var j = 0; j < d.length; j++) { + if (typeof(d[j][1]) != "number") { + check = false; + break; + } + } + if (check) { + d.sort(function(a,b) { return a[1] - b[1]; }); + } + } + else { + for (var j = 0; j < d.length; j++) { + if (typeof(d[j][0]) != "number") { + check = false; + break; + } + } + if (check) { + d.sort(function(a,b) { return a[0] - b[0]; }); + } + } + } + + } + } + + this.computePlotData = function() { + this._plotData = []; + this._stackData = []; + var series, + index, + l; + + + for (index=0, l=this.series.length; index<l; index++) { + series = this.series[index]; + this._plotData.push([]); + this._stackData.push([]); + var cd = series.data; + this._plotData[index] = $.extend(true, [], cd); + this._stackData[index] = $.extend(true, [], cd); + series._plotData = this._plotData[index]; + series._stackData = this._stackData[index]; + var plotValues = {x:[], y:[]}; + + if (this.stackSeries && !series.disableStack) { + series._stack = true; + /////////////////////////// + // have to check for nulls + /////////////////////////// + var sidx = (series._stackAxis === 'x') ? 0 : 1; + + for (var k=0, cdl=cd.length; k<cdl; k++) { + var temp = cd[k][sidx]; + if (temp == null) { + temp = 0; + } + this._plotData[index][k][sidx] = temp; + this._stackData[index][k][sidx] = temp; + + if (index > 0) { + for (var j=index; j--;) { + var prevval = this._plotData[j][k][sidx]; + // only need to sum up the stack axis column of data + // and only sum if it is of same sign. + // if previous series isn't same sign, keep looking + // at earlier series untill we find one of same sign. + if (temp * prevval >= 0) { + this._plotData[index][k][sidx] += prevval; + this._stackData[index][k][sidx] += prevval; + break; + } + } + } + } + + } + else { + for (var i=0; i<series.data.length; i++) { + plotValues.x.push(series.data[i][0]); + plotValues.y.push(series.data[i][1]); + } + this._stackData.push(series.data); + this.series[index]._stackData = series.data; + this._plotData.push(series.data); + series._plotData = series.data; + series._plotValues = plotValues; + } + if (index>0) { + series._prevPlotData = this.series[index-1]._plotData; + } + series._sumy = 0; + series._sumx = 0; + for (i=series.data.length-1; i>-1; i--) { + series._sumy += series.data[i][1]; + series._sumx += series.data[i][0]; + } + } + + }; + + // populate the _stackData and _plotData arrays for the plot and the series. + this.populatePlotData = function(series, index) { + // if a stacked chart, compute the stacked data + this._plotData = []; + this._stackData = []; + series._stackData = []; + series._plotData = []; + var plotValues = {x:[], y:[]}; + if (this.stackSeries && !series.disableStack) { + series._stack = true; + var sidx = (series._stackAxis === 'x') ? 0 : 1; + // var idx = sidx ? 0 : 1; + // push the current data into stackData + //this._stackData.push(this.series[i].data); + var temp = $.extend(true, [], series.data); + // create the data that will be plotted for this series + var plotdata = $.extend(true, [], series.data); + var tempx, tempy, dval, stackval, comparator; + // for first series, nothing to add to stackData. + for (var j=0; j<index; j++) { + var cd = this.series[j].data; + for (var k=0; k<cd.length; k++) { + dval = cd[k]; + tempx = (dval[0] != null) ? dval[0] : 0; + tempy = (dval[1] != null) ? dval[1] : 0; + temp[k][0] += tempx; + temp[k][1] += tempy; + stackval = (sidx) ? tempy : tempx; + // only need to sum up the stack axis column of data + // and only sum if it is of same sign. + if (series.data[k][sidx] * stackval >= 0) { + plotdata[k][sidx] += stackval; + } + } + } + for (var i=0; i<plotdata.length; i++) { + plotValues.x.push(plotdata[i][0]); + plotValues.y.push(plotdata[i][1]); + } + this._plotData.push(plotdata); + this._stackData.push(temp); + series._stackData = temp; + series._plotData = plotdata; + series._plotValues = plotValues; + } + else { + for (var i=0; i<series.data.length; i++) { + plotValues.x.push(series.data[i][0]); + plotValues.y.push(series.data[i][1]); + } + this._stackData.push(series.data); + this.series[index]._stackData = series.data; + this._plotData.push(series.data); + series._plotData = series.data; + series._plotValues = plotValues; + } + if (index>0) { + series._prevPlotData = this.series[index-1]._plotData; + } + series._sumy = 0; + series._sumx = 0; + for (i=series.data.length-1; i>-1; i--) { + series._sumy += series.data[i][1]; + series._sumx += series.data[i][0]; + } + }; + + // function to safely return colors from the color array and wrap around at the end. + this.getNextSeriesColor = (function(t) { + var idx = 0; + var sc = t.seriesColors; + + return function () { + if (idx < sc.length) { + return sc[idx++]; + } + else { + idx = 0; + return sc[idx++]; + } + }; + })(this); + + this.parseOptions = function(options){ + for (var i=0; i<this.preParseOptionsHooks.hooks.length; i++) { + this.preParseOptionsHooks.hooks[i].call(this, options); + } + for (var i=0; i<$.jqplot.preParseOptionsHooks.length; i++) { + $.jqplot.preParseOptionsHooks[i].call(this, options); + } + this.options = $.extend(true, {}, this.defaults, options); + var opts = this.options; + this.animate = opts.animate; + this.animateReplot = opts.animateReplot; + this.stackSeries = opts.stackSeries; + if ($.isPlainObject(opts.fillBetween)) { + + var temp = ['series1', 'series2', 'color', 'baseSeries', 'fill'], + tempi; + + for (var i=0, l=temp.length; i<l; i++) { + tempi = temp[i]; + if (opts.fillBetween[tempi] != null) { + this.fillBetween[tempi] = opts.fillBetween[tempi]; + } + } + } + + if (opts.seriesColors) { + this.seriesColors = opts.seriesColors; + } + if (opts.negativeSeriesColors) { + this.negativeSeriesColors = opts.negativeSeriesColors; + } + if (opts.captureRightClick) { + this.captureRightClick = opts.captureRightClick; + } + this.defaultAxisStart = (options && options.defaultAxisStart != null) ? options.defaultAxisStart : this.defaultAxisStart; + this.colorGenerator.setColors(this.seriesColors); + this.negativeColorGenerator.setColors(this.negativeSeriesColors); + // var cg = new this.colorGenerator(this.seriesColors); + // var ncg = new this.colorGenerator(this.negativeSeriesColors); + // this._gridPadding = this.options.gridPadding; + $.extend(true, this._gridPadding, opts.gridPadding); + this.sortData = (opts.sortData != null) ? opts.sortData : this.sortData; + for (var i=0; i<12; i++) { + var n = _axisNames[i]; + var axis = this.axes[n]; + axis._options = $.extend(true, {}, opts.axesDefaults, opts.axes[n]); + $.extend(true, axis, opts.axesDefaults, opts.axes[n]); + axis._plotWidth = this._width; + axis._plotHeight = this._height; + } + // if (this.data.length == 0) { + // this.data = []; + // for (var i=0; i<this.options.series.length; i++) { + // this.data.push(this.options.series.data); + // } + // } + + var normalizeData = function(data, dir, start) { + // return data as an array of point arrays, + // in form [[x1,y1...], [x2,y2...], ...] + var temp = []; + var i, l; + dir = dir || 'vertical'; + if (!$.isArray(data[0])) { + // we have a series of scalars. One line with just y values. + // turn the scalar list of data into a data array of form: + // [[1, data[0]], [2, data[1]], ...] + for (i=0, l=data.length; i<l; i++) { + if (dir == 'vertical') { + temp.push([start + i, data[i]]); + } + else { + temp.push([data[i], start+i]); + } + } + } + else { + // we have a properly formatted data series, copy it. + $.extend(true, temp, data); + } + return temp; + }; + + var colorIndex = 0; + this.series = []; + for (var i=0; i<this.data.length; i++) { + var sopts = $.extend(true, {index: i}, {seriesColors:this.seriesColors, negativeSeriesColors:this.negativeSeriesColors}, this.options.seriesDefaults, this.options.series[i], {rendererOptions:{animation:{show: this.animate}}}); + // pass in options in case something needs set prior to initialization. + var temp = new Series(sopts); + for (var j=0; j<$.jqplot.preParseSeriesOptionsHooks.length; j++) { + $.jqplot.preParseSeriesOptionsHooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]); + } + for (var j=0; j<this.preParseSeriesOptionsHooks.hooks.length; j++) { + this.preParseSeriesOptionsHooks.hooks[j].call(temp, this.options.seriesDefaults, this.options.series[i]); + } + // Now go back and apply the options to the series. Really should just do this during initializaiton, but don't want to + // mess up preParseSeriesOptionsHooks at this point. + $.extend(true, temp, sopts); + var dir = 'vertical'; + if (temp.renderer === $.jqplot.BarRenderer && temp.rendererOptions && temp.rendererOptions.barDirection == 'horizontal') { + dir = 'horizontal'; + temp._stackAxis = 'x'; + temp._primaryAxis = '_yaxis'; + } + temp.data = normalizeData(this.data[i], dir, this.defaultAxisStart); + switch (temp.xaxis) { + case 'xaxis': + temp._xaxis = this.axes.xaxis; + break; + case 'x2axis': + temp._xaxis = this.axes.x2axis; + break; + default: + break; + } + temp._yaxis = this.axes[temp.yaxis]; + temp._xaxis._series.push(temp); + temp._yaxis._series.push(temp); + if (temp.show) { + temp._xaxis.show = true; + temp._yaxis.show = true; + } + else { + if (temp._xaxis.scaleToHiddenSeries) { + temp._xaxis.show = true; + } + if (temp._yaxis.scaleToHiddenSeries) { + temp._yaxis.show = true; + } + } + + // // parse the renderer options and apply default colors if not provided + // if (!temp.color && temp.show != false) { + // temp.color = cg.next(); + // colorIndex = cg.getIndex() - 1;; + // } + // if (!temp.negativeColor && temp.show != false) { + // temp.negativeColor = ncg.get(colorIndex); + // ncg.setIndex(colorIndex); + // } + if (!temp.label) { + temp.label = 'Series '+ (i+1).toString(); + } + // temp.rendererOptions.show = temp.show; + // $.extend(true, temp.renderer, {color:this.seriesColors[i]}, this.rendererOptions); + this.series.push(temp); + for (var j=0; j<$.jqplot.postParseSeriesOptionsHooks.length; j++) { + $.jqplot.postParseSeriesOptionsHooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]); + } + for (var j=0; j<this.postParseSeriesOptionsHooks.hooks.length; j++) { + this.postParseSeriesOptionsHooks.hooks[j].call(this.series[i], this.options.seriesDefaults, this.options.series[i]); + } + } + + // copy the grid and title options into this object. + $.extend(true, this.grid, this.options.grid); + // if axis border properties aren't set, set default. + for (var i=0, l=_axisNames.length; i<l; i++) { + var n = _axisNames[i]; + var axis = this.axes[n]; + if (axis.borderWidth == null) { + axis.borderWidth =this.grid.borderWidth; + } + } + + if (typeof this.options.title == 'string') { + this.title.text = this.options.title; + } + else if (typeof this.options.title == 'object') { + $.extend(true, this.title, this.options.title); + } + this.title._plotWidth = this._width; + this.legend.setOptions(this.options.legend); + + for (var i=0; i<$.jqplot.postParseOptionsHooks.length; i++) { + $.jqplot.postParseOptionsHooks[i].call(this, options); + } + for (var i=0; i<this.postParseOptionsHooks.hooks.length; i++) { + this.postParseOptionsHooks.hooks[i].call(this, options); + } + }; + + // method: destroy + // Releases all resources occupied by the plot + this.destroy = function() { + this.canvasManager.freeAllCanvases(); + if (this.eventCanvas && this.eventCanvas._elem) { + this.eventCanvas._elem.unbind(); + } + // Couple of posts on Stack Overflow indicate that empty() doesn't + // always cear up the dom and release memory. Sometimes setting + // innerHTML property to null is needed. Particularly on IE, may + // have to directly set it to null, bypassing $. + this.target.empty(); + + this.target[0].innerHTML = ''; + }; + + // method: replot + // Does a reinitialization of the plot followed by + // a redraw. Method could be used to interactively + // change plot characteristics and then replot. + // + // Parameters: + // options - Options used for replotting. + // + // Properties: + // clear - false to not clear (empty) the plot container before replotting (default: true). + // resetAxes - true to reset all axes min, max, numberTicks and tickInterval setting so axes will rescale themselves. + // optionally pass in list of axes to reset (e.g. ['xaxis', 'y2axis']) (default: false). + this.replot = function(options) { + var opts = options || {}; + var data = opts.data || null; + var clear = (opts.clear === false) ? false : true; + var resetAxes = opts.resetAxes || false; + delete opts.data; + delete opts.clear; + delete opts.resetAxes; + + this.target.trigger('jqplotPreReplot'); + + if (clear) { + this.destroy(); + } + // if have data or other options, full reinit. + // otherwise, quickinit. + if (data || !$.isEmptyObject(opts)) { + this.reInitialize(data, opts); + } + else { + this.quickInit(); + } + + if (resetAxes) { + this.resetAxesScale(resetAxes, opts.axes); + } + this.draw(); + this.target.trigger('jqplotPostReplot'); + }; + + // method: redraw + // Empties the plot target div and redraws the plot. + // This enables plot data and properties to be changed + // and then to comletely clear the plot and redraw. + // redraw *will not* reinitialize any plot elements. + // That is, axes will not be autoscaled and defaults + // will not be reapplied to any plot elements. redraw + // is used primarily with zooming. + // + // Parameters: + // clear - false to not clear (empty) the plot container before redrawing (default: true). + this.redraw = function(clear) { + clear = (clear != null) ? clear : true; + this.target.trigger('jqplotPreRedraw'); + if (clear) { + this.canvasManager.freeAllCanvases(); + this.eventCanvas._elem.unbind(); + // Dont think I bind any events to the target, this shouldn't be necessary. + // It will remove user's events. + // this.target.unbind(); + this.target.empty(); + } + for (var ax in this.axes) { + this.axes[ax]._ticks = []; + } + this.computePlotData(); + // for (var i=0; i<this.series.length; i++) { + // this.populatePlotData(this.series[i], i); + // } + this._sumy = 0; + this._sumx = 0; + for (var i=0, tsl = this.series.length; i<tsl; i++) { + this._sumy += this.series[i]._sumy; + this._sumx += this.series[i]._sumx; + } + this.draw(); + this.target.trigger('jqplotPostRedraw'); + }; + + // method: draw + // Draws all elements of the plot into the container. + // Does not clear the container before drawing. + this.draw = function(){ + if (this.drawIfHidden || this.target.is(':visible')) { + this.target.trigger('jqplotPreDraw'); + var i, + j, + l, + tempseries; + for (i=0, l=$.jqplot.preDrawHooks.length; i<l; i++) { + $.jqplot.preDrawHooks[i].call(this); + } + for (i=0, l=this.preDrawHooks.hooks.length; i<l; i++) { + this.preDrawHooks.hooks[i].apply(this, this.preDrawSeriesHooks.args[i]); + } + // create an underlying canvas to be used for special features. + this.target.append(this.baseCanvas.createElement({left:0, right:0, top:0, bottom:0}, 'jqplot-base-canvas', null, this)); + this.baseCanvas.setContext(); + this.target.append(this.title.draw()); + this.title.pack({top:0, left:0}); + + // make room for the legend between the grid and the edge. + // pass a dummy offsets object and a reference to the plot. + var legendElem = this.legend.draw({}, this); + + var gridPadding = {top:0, left:0, bottom:0, right:0}; + + if (this.legend.placement == "outsideGrid") { + // temporarily append the legend to get dimensions + this.target.append(legendElem); + switch (this.legend.location) { + case 'n': + gridPadding.top += this.legend.getHeight(); + break; + case 's': + gridPadding.bottom += this.legend.getHeight(); + break; + case 'ne': + case 'e': + case 'se': + gridPadding.right += this.legend.getWidth(); + break; + case 'nw': + case 'w': + case 'sw': + gridPadding.left += this.legend.getWidth(); + break; + default: // same as 'ne' + gridPadding.right += this.legend.getWidth(); + break; + } + legendElem = legendElem.detach(); + } + + var ax = this.axes; + var name; + // draw the yMidAxis first, so xaxis of pyramid chart can adjust itself if needed. + for (i=0; i<12; i++) { + name = _axisNames[i]; + this.target.append(ax[name].draw(this.baseCanvas._ctx, this)); + ax[name].set(); + } + if (ax.yaxis.show) { + gridPadding.left += ax.yaxis.getWidth(); + } + var ra = ['y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis']; + var rapad = [0, 0, 0, 0, 0, 0, 0, 0]; + var gpr = 0; + var n; + for (n=0; n<8; n++) { + if (ax[ra[n]].show) { + gpr += ax[ra[n]].getWidth(); + rapad[n] = gpr; + } + } + gridPadding.right += gpr; + if (ax.x2axis.show) { + gridPadding.top += ax.x2axis.getHeight(); + } + if (this.title.show) { + gridPadding.top += this.title.getHeight(); + } + if (ax.xaxis.show) { + gridPadding.bottom += ax.xaxis.getHeight(); + } + + // end of gridPadding adjustments. + + // if user passed in gridDimensions option, check against calculated gridPadding + if (this.options.gridDimensions && $.isPlainObject(this.options.gridDimensions)) { + var gdw = parseInt(this.options.gridDimensions.width, 10) || 0; + var gdh = parseInt(this.options.gridDimensions.height, 10) || 0; + var widthAdj = (this._width - gridPadding.left - gridPadding.right - gdw)/2; + var heightAdj = (this._height - gridPadding.top - gridPadding.bottom - gdh)/2; + + if (heightAdj >= 0 && widthAdj >= 0) { + gridPadding.top += heightAdj; + gridPadding.bottom += heightAdj; + gridPadding.left += widthAdj; + gridPadding.right += widthAdj; + } + } + var arr = ['top', 'bottom', 'left', 'right']; + for (var n in arr) { + if (this._gridPadding[arr[n]] == null && gridPadding[arr[n]] > 0) { + this._gridPadding[arr[n]] = gridPadding[arr[n]]; + } + else if (this._gridPadding[arr[n]] == null) { + this._gridPadding[arr[n]] = this._defaultGridPadding[arr[n]]; + } + } + + var legendPadding = this._gridPadding; + + if (this.legend.placement === 'outsideGrid') { + legendPadding = {top:this.title.getHeight(), left: 0, right: 0, bottom: 0}; + if (this.legend.location === 's') { + legendPadding.left = this._gridPadding.left; + legendPadding.right = this._gridPadding.right; + } + } + + ax.xaxis.pack({position:'absolute', bottom:this._gridPadding.bottom - ax.xaxis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right}); + ax.yaxis.pack({position:'absolute', top:0, left:this._gridPadding.left - ax.yaxis.getWidth(), height:this._height}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top}); + ax.x2axis.pack({position:'absolute', top:this._gridPadding.top - ax.x2axis.getHeight(), left:0, width:this._width}, {min:this._gridPadding.left, max:this._width - this._gridPadding.right}); + for (i=8; i>0; i--) { + ax[ra[i-1]].pack({position:'absolute', top:0, right:this._gridPadding.right - rapad[i-1]}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top}); + } + var ltemp = (this._width - this._gridPadding.left - this._gridPadding.right)/2.0 + this._gridPadding.left - ax.yMidAxis.getWidth()/2.0; + ax.yMidAxis.pack({position:'absolute', top:0, left:ltemp, zIndex:9, textAlign: 'center'}, {min:this._height - this._gridPadding.bottom, max: this._gridPadding.top}); + + this.target.append(this.grid.createElement(this._gridPadding, this)); + this.grid.draw(); + + var series = this.series; + var seriesLength = series.length; + // put the shadow canvases behind the series canvases so shadows don't overlap on stacked bars. + for (i=0, l=seriesLength; i<l; i++) { + // draw series in order of stacking. This affects only + // order in which canvases are added to dom. + j = this.seriesStack[i]; + this.target.append(series[j].shadowCanvas.createElement(this._gridPadding, 'jqplot-series-shadowCanvas', null, this)); + series[j].shadowCanvas.setContext(); + series[j].shadowCanvas._elem.data('seriesIndex', j); + } + + for (i=0, l=seriesLength; i<l; i++) { + // draw series in order of stacking. This affects only + // order in which canvases are added to dom. + j = this.seriesStack[i]; + this.target.append(series[j].canvas.createElement(this._gridPadding, 'jqplot-series-canvas', null, this)); + series[j].canvas.setContext(); + series[j].canvas._elem.data('seriesIndex', j); + } + // Need to use filled canvas to capture events in IE. + // Also, canvas seems to block selection of other elements in document on FF. + this.target.append(this.eventCanvas.createElement(this._gridPadding, 'jqplot-event-canvas', null, this)); + this.eventCanvas.setContext(); + this.eventCanvas._ctx.fillStyle = 'rgba(0,0,0,0)'; + this.eventCanvas._ctx.fillRect(0,0,this.eventCanvas._ctx.canvas.width, this.eventCanvas._ctx.canvas.height); + + // bind custom event handlers to regular events. + this.bindCustomEvents(); + + // draw legend before series if the series needs to know the legend dimensions. + if (this.legend.preDraw) { + this.eventCanvas._elem.before(legendElem); + this.legend.pack(legendPadding); + if (this.legend._elem) { + this.drawSeries({legendInfo:{location:this.legend.location, placement:this.legend.placement, width:this.legend.getWidth(), height:this.legend.getHeight(), xoffset:this.legend.xoffset, yoffset:this.legend.yoffset}}); + } + else { + this.drawSeries(); + } + } + else { // draw series before legend + this.drawSeries(); + if (seriesLength) { + $(series[seriesLength-1].canvas._elem).after(legendElem); + } + this.legend.pack(legendPadding); + } + + // register event listeners on the overlay canvas + for (var i=0, l=$.jqplot.eventListenerHooks.length; i<l; i++) { + // in the handler, this will refer to the eventCanvas dom element. + // make sure there are references back into plot objects. + this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]); + } + + // register event listeners on the overlay canvas + for (var i=0, l=this.eventListenerHooks.hooks.length; i<l; i++) { + // in the handler, this will refer to the eventCanvas dom element. + // make sure there are references back into plot objects. + this.eventCanvas._elem.bind(this.eventListenerHooks.hooks[i][0], {plot:this}, this.eventListenerHooks.hooks[i][1]); + } + + var fb = this.fillBetween; + if(typeof fb.series1 == 'number'){ + if(fb.fill&&fb.series1!==fb.series2&&fb.series1<seriesLength&&fb.series2<seriesLength&&series[fb.series1]._type==="line"&&series[fb.series2]._type==="line") + this.doFillBetweenLines(); + } + else{ + if(fb.series1 != null && fb.series2 != null){ + var doFb = false; + if(fb.series1.length === fb.series2.length){ + var tempSeries1 = 0; + var tempSeries2 = 0; + + for(var cnt = 0; cnt < fb.series1.length; cnt++){ + tempSeries1 = fb.series1[cnt]; + tempSeries2 = fb.series2[cnt]; + if(tempSeries1!==tempSeries2&&tempSeries1<seriesLength&&tempSeries2<seriesLength&&series[tempSeries1]._type==="line"&&series[tempSeries2]._type==="line"){ + doFb = true; + } + else{ + doFb = false; + break; + } + } + } + if(fb.fill && doFb){ + this.doFillBetweenLines(); + } + } + } + + for (var i=0, l=$.jqplot.postDrawHooks.length; i<l; i++) { + $.jqplot.postDrawHooks[i].call(this); + } + + for (var i=0, l=this.postDrawHooks.hooks.length; i<l; i++) { + this.postDrawHooks.hooks[i].apply(this, this.postDrawHooks.args[i]); + } + + if (this.target.is(':visible')) { + this._drawCount += 1; + } + + var temps, + tempr, + sel, + _els; + // ughh. ideally would hide all series then show them. + for (i=0, l=seriesLength; i<l; i++) { + temps = series[i]; + tempr = temps.renderer; + sel = '.jqplot-point-label.jqplot-series-'+i; + if (tempr.animation && tempr.animation._supported && tempr.animation.show && (this._drawCount < 2 || this.animateReplot)) { + _els = this.target.find(sel); + _els.stop(true, true).hide(); + temps.canvas._elem.stop(true, true).hide(); + temps.shadowCanvas._elem.stop(true, true).hide(); + temps.canvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed); + temps.shadowCanvas._elem.jqplotEffect('blind', {mode: 'show', direction: tempr.animation.direction}, tempr.animation.speed); + _els.fadeIn(tempr.animation.speed*0.8); + } + } + _els = null; + + this.target.trigger('jqplotPostDraw', [this]); + } + }; + + jqPlot.prototype.doFillBetweenLines = function () { + var fb = this.fillBetween; + var series = this.series; + var sid1 = fb.series1; + var sid2 = fb.series2; + var id1 = 0, id2 = 0; + + function fill(id1, id2){ + var series1 = series[id1]; + var series2 = series[id2]; + if (series2.renderer.smooth) + var tempgd = series2.renderer._smoothedData.slice(0).reverse(); + else + var tempgd = series2.gridData.slice(0).reverse(); + if (series1.renderer.smooth) + var gd = series1.renderer._smoothedData.concat(tempgd); + else + var gd = series1.gridData.concat(tempgd); + var color = fb.color !== null ? fb.color : series[sid1].fillColor; + var baseSeries = fb.baseSeries !== null ? fb.baseSeries : id1; + var sr = + series[baseSeries].renderer.shapeRenderer; + var opts = + { + fillStyle : color, + fill : true, + closePath : true + }; + sr.draw(series1.shadowCanvas._ctx, gd, opts) + } + + if(typeof sid1 == 'number' && typeof sid2 == 'number'){ + id1 = sid1 < sid2 ? sid1 : sid2; + id2 = sid2 > sid1 ? sid2 : sid1; + fill(id1, id2); + } + else{ + for(var cnt = 0; cnt < sid1.length ; cnt++){ + id1 = sid1[cnt] < sid2[cnt] ? sid1[cnt] : sid2[cnt]; + id2 = sid2[cnt] > sid1[cnt] ? sid2[cnt] : sid1[cnt]; + fill(id1, id2); + } + } + }; + + this.bindCustomEvents = function() { + this.eventCanvas._elem.bind('click', {plot:this}, this.onClick); + this.eventCanvas._elem.bind('dblclick', {plot:this}, this.onDblClick); + this.eventCanvas._elem.bind('mousedown', {plot:this}, this.onMouseDown); + this.eventCanvas._elem.bind('mousemove', {plot:this}, this.onMouseMove); + this.eventCanvas._elem.bind('mouseenter', {plot:this}, this.onMouseEnter); + this.eventCanvas._elem.bind('mouseleave', {plot:this}, this.onMouseLeave); + if (this.captureRightClick) { + this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onRightClick); + this.eventCanvas._elem.get(0).oncontextmenu = function() { + return false; + }; + } + else { + this.eventCanvas._elem.bind('mouseup', {plot:this}, this.onMouseUp); + } + }; + + function getEventPosition(ev) { + var plot = ev.data.plot; + var go = plot.eventCanvas._elem.offset(); + var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top}; + var dataPos = {xaxis:null, yaxis:null, x2axis:null, y2axis:null, y3axis:null, y4axis:null, y5axis:null, y6axis:null, y7axis:null, y8axis:null, y9axis:null, yMidAxis:null}; + var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis']; + var ax = plot.axes; + var n, axis; + for (n=11; n>0; n--) { + axis = an[n-1]; + if (ax[axis].show) { + dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]); + } + } + + return {offsets:go, gridPos:gridPos, dataPos:dataPos}; + } + + + // function to check if event location is over a area area + function checkIntersection(gridpos, plot) { + var series = plot.series; + var i, j, k, s, r, x, y, theta, sm, sa, minang, maxang; + var d0, d, p, pp, points, bw, hp; + var threshold, t; + for (k=plot.seriesStack.length-1; k>=0; k--) { + i = plot.seriesStack[k]; + s = series[i]; + hp = s._highlightThreshold; + switch (s.renderer.constructor) { + case $.jqplot.BarRenderer: + x = gridpos.x; + y = gridpos.y; + for (j=0; j<s._barPoints.length; j++) { + points = s._barPoints[j]; + p = s.gridData[j]; + if (x>points[0][0] && x<points[2][0] && (y>points[2][1] && y<points[0][1] || y<points[2][1] && y>points[0][1])) { + return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]}; + } + } + break; + case $.jqplot.PyramidRenderer: + x = gridpos.x; + y = gridpos.y; + for (j=0; j<s._barPoints.length; j++) { + points = s._barPoints[j]; + p = s.gridData[j]; + if (x > points[0][0] + hp[0][0] && x < points[2][0] + hp[2][0] && y > points[2][1] && y < points[0][1]) { + return {seriesIndex:s.index, pointIndex:j, gridData:p, data:s.data[j], points:s._barPoints[j]}; + } + } + break; + + case $.jqplot.DonutRenderer: + sa = s.startAngle/180*Math.PI; + x = gridpos.x - s._center[0]; + y = gridpos.y - s._center[1]; + r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); + if (x > 0 && -y >= 0) { + theta = 2*Math.PI - Math.atan(-y/x); + } + else if (x > 0 && -y < 0) { + theta = -Math.atan(-y/x); + } + else if (x < 0) { + theta = Math.PI - Math.atan(-y/x); + } + else if (x == 0 && -y > 0) { + theta = 3*Math.PI/2; + } + else if (x == 0 && -y < 0) { + theta = Math.PI/2; + } + else if (x == 0 && y == 0) { + theta = 0; + } + if (sa) { + theta -= sa; + if (theta < 0) { + theta += 2*Math.PI; + } + else if (theta > 2*Math.PI) { + theta -= 2*Math.PI; + } + } + + sm = s.sliceMargin/180*Math.PI; + if (r < s._radius && r > s._innerRadius) { + for (j=0; j<s.gridData.length; j++) { + minang = (j>0) ? s.gridData[j-1][1]+sm : sm; + maxang = s.gridData[j][1]; + if (theta > minang && theta < maxang) { + return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]}; + } + } + } + break; + + case $.jqplot.PieRenderer: + sa = s.startAngle/180*Math.PI; + x = gridpos.x - s._center[0]; + y = gridpos.y - s._center[1]; + r = Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); + if (x > 0 && -y >= 0) { + theta = 2*Math.PI - Math.atan(-y/x); + } + else if (x > 0 && -y < 0) { + theta = -Math.atan(-y/x); + } + else if (x < 0) { + theta = Math.PI - Math.atan(-y/x); + } + else if (x == 0 && -y > 0) { + theta = 3*Math.PI/2; + } + else if (x == 0 && -y < 0) { + theta = Math.PI/2; + } + else if (x == 0 && y == 0) { + theta = 0; + } + if (sa) { + theta -= sa; + if (theta < 0) { + theta += 2*Math.PI; + } + else if (theta > 2*Math.PI) { + theta -= 2*Math.PI; + } + } + + sm = s.sliceMargin/180*Math.PI; + if (r < s._radius) { + for (j=0; j<s.gridData.length; j++) { + minang = (j>0) ? s.gridData[j-1][1]+sm : sm; + maxang = s.gridData[j][1]; + if (theta > minang && theta < maxang) { + return {seriesIndex:s.index, pointIndex:j, gridData:[gridpos.x,gridpos.y], data:s.data[j]}; + } + } + } + break; + + case $.jqplot.BubbleRenderer: + x = gridpos.x; + y = gridpos.y; + var ret = null; + + if (s.show) { + for (var j=0; j<s.gridData.length; j++) { + p = s.gridData[j]; + d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) ); + if (d <= p[2] && (d <= d0 || d0 == null)) { + d0 = d; + ret = {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + if (ret != null) { + return ret; + } + } + break; + + case $.jqplot.FunnelRenderer: + x = gridpos.x; + y = gridpos.y; + var v = s._vertices, + vfirst = v[0], + vlast = v[v.length-1], + lex, + rex, + cv; + + // equations of right and left sides, returns x, y values given height of section (y value and 2 points) + + function findedge (l, p1 , p2) { + var m = (p1[1] - p2[1])/(p1[0] - p2[0]); + var b = p1[1] - m*p1[0]; + var y = l + p1[1]; + + return [(y - b)/m, y]; + } + + // check each section + lex = findedge(y, vfirst[0], vlast[3]); + rex = findedge(y, vfirst[1], vlast[2]); + for (j=0; j<v.length; j++) { + cv = v[j]; + if (y >= cv[0][1] && y <= cv[3][1] && x >= lex[0] && x <= rex[0]) { + return {seriesIndex:s.index, pointIndex:j, gridData:null, data:s.data[j]}; + } + } + break; + + case $.jqplot.LineRenderer: + x = gridpos.x; + y = gridpos.y; + r = s.renderer; + if (s.show) { + if ((s.fill || (s.renderer.bands.show && s.renderer.bands.fill)) && (!plot.plugins.highlighter || !plot.plugins.highlighter.show)) { + // first check if it is in bounding box + var inside = false; + if (x>s._boundingBox[0][0] && x<s._boundingBox[1][0] && y>s._boundingBox[1][1] && y<s._boundingBox[0][1]) { + // now check the crossing number + + var numPoints = s._areaPoints.length; + var ii; + var j = numPoints-1; + + for(var ii=0; ii < numPoints; ii++) { + var vertex1 = [s._areaPoints[ii][0], s._areaPoints[ii][1]]; + var vertex2 = [s._areaPoints[j][0], s._areaPoints[j][1]]; + + if (vertex1[1] < y && vertex2[1] >= y || vertex2[1] < y && vertex1[1] >= y) { + if (vertex1[0] + (y - vertex1[1]) / (vertex2[1] - vertex1[1]) * (vertex2[0] - vertex1[0]) < x) { + inside = !inside; + } + } + + j = ii; + } + } + if (inside) { + return {seriesIndex:i, pointIndex:null, gridData:s.gridData, data:s.data, points:s._areaPoints}; + } + break; + + } + + else { + t = s.markerRenderer.size/2+s.neighborThreshold; + threshold = (t > 0) ? t : 0; + for (var j=0; j<s.gridData.length; j++) { + p = s.gridData[j]; + // neighbor looks different to OHLC chart. + if (r.constructor == $.jqplot.OHLCRenderer) { + if (r.candleStick) { + var yp = s._yaxis.series_u2p; + if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) { + return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + // if an open hi low close chart + else if (!r.hlc){ + var yp = s._yaxis.series_u2p; + if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) { + return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + // a hi low close chart + else { + var yp = s._yaxis.series_u2p; + if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) { + return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + + } + else if (p[0] != null && p[1] != null){ + d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) ); + if (d <= threshold && (d <= d0 || d0 == null)) { + d0 = d; + return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + } + } + } + break; + + default: + x = gridpos.x; + y = gridpos.y; + r = s.renderer; + if (s.show) { + t = s.markerRenderer.size/2+s.neighborThreshold; + threshold = (t > 0) ? t : 0; + for (var j=0; j<s.gridData.length; j++) { + p = s.gridData[j]; + // neighbor looks different to OHLC chart. + if (r.constructor == $.jqplot.OHLCRenderer) { + if (r.candleStick) { + var yp = s._yaxis.series_u2p; + if (x >= p[0]-r._bodyWidth/2 && x <= p[0]+r._bodyWidth/2 && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) { + return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + // if an open hi low close chart + else if (!r.hlc){ + var yp = s._yaxis.series_u2p; + if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][2]) && y <= yp(s.data[j][3])) { + return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + // a hi low close chart + else { + var yp = s._yaxis.series_u2p; + if (x >= p[0]-r._tickLength && x <= p[0]+r._tickLength && y >= yp(s.data[j][1]) && y <= yp(s.data[j][2])) { + return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + + } + else { + d = Math.sqrt( (x-p[0]) * (x-p[0]) + (y-p[1]) * (y-p[1]) ); + if (d <= threshold && (d <= d0 || d0 == null)) { + d0 = d; + return {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}; + } + } + } + } + break; + } + } + + return null; + } + + + + this.onClick = function(ev) { + // Event passed in is normalized and will have data attribute. + // Event passed out is unnormalized. + var positions = getEventPosition(ev); + var p = ev.data.plot; + var neighbor = checkIntersection(positions.gridPos, p); + var evt = $.Event('jqplotClick'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]); + }; + + this.onDblClick = function(ev) { + // Event passed in is normalized and will have data attribute. + // Event passed out is unnormalized. + var positions = getEventPosition(ev); + var p = ev.data.plot; + var neighbor = checkIntersection(positions.gridPos, p); + var evt = $.Event('jqplotDblClick'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]); + }; + + this.onMouseDown = function(ev) { + var positions = getEventPosition(ev); + var p = ev.data.plot; + var neighbor = checkIntersection(positions.gridPos, p); + var evt = $.Event('jqplotMouseDown'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]); + }; + + this.onMouseUp = function(ev) { + var positions = getEventPosition(ev); + var evt = $.Event('jqplotMouseUp'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, ev.data.plot]); + }; + + this.onRightClick = function(ev) { + var positions = getEventPosition(ev); + var p = ev.data.plot; + var neighbor = checkIntersection(positions.gridPos, p); + if (p.captureRightClick) { + if (ev.which == 3) { + var evt = $.Event('jqplotRightClick'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]); + } + else { + var evt = $.Event('jqplotMouseUp'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]); + } + } + }; + + this.onMouseMove = function(ev) { + var positions = getEventPosition(ev); + var p = ev.data.plot; + var neighbor = checkIntersection(positions.gridPos, p); + var evt = $.Event('jqplotMouseMove'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, neighbor, p]); + }; + + this.onMouseEnter = function(ev) { + var positions = getEventPosition(ev); + var p = ev.data.plot; + var evt = $.Event('jqplotMouseEnter'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + evt.relatedTarget = ev.relatedTarget; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]); + }; + + this.onMouseLeave = function(ev) { + var positions = getEventPosition(ev); + var p = ev.data.plot; + var evt = $.Event('jqplotMouseLeave'); + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + evt.relatedTarget = ev.relatedTarget; + $(this).trigger(evt, [positions.gridPos, positions.dataPos, null, p]); + }; + + // method: drawSeries + // Redraws all or just one series on the plot. No axis scaling + // is performed and no other elements on the plot are redrawn. + // options is an options object to pass on to the series renderers. + // It can be an empty object {}. idx is the series index + // to redraw if only one series is to be redrawn. + this.drawSeries = function(options, idx){ + var i, series, ctx; + // if only one argument passed in and it is a number, use it ad idx. + idx = (typeof(options) === "number" && idx == null) ? options : idx; + options = (typeof(options) === "object") ? options : {}; + // draw specified series + if (idx != undefined) { + series = this.series[idx]; + ctx = series.shadowCanvas._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + series.drawShadow(ctx, options, this); + ctx = series.canvas._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + series.draw(ctx, options, this); + if (series.renderer.constructor == $.jqplot.BezierCurveRenderer) { + if (idx < this.series.length - 1) { + this.drawSeries(idx+1); + } + } + } + + else { + // if call series drawShadow method first, in case all series shadows + // should be drawn before any series. This will ensure, like for + // stacked bar plots, that shadows don't overlap series. + for (i=0; i<this.series.length; i++) { + // first clear the canvas + series = this.series[i]; + ctx = series.shadowCanvas._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + series.drawShadow(ctx, options, this); + ctx = series.canvas._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + series.draw(ctx, options, this); + } + } + options = idx = i = series = ctx = null; + }; + + // method: moveSeriesToFront + // This method requires jQuery 1.4+ + // Moves the specified series canvas in front of all other series canvases. + // This effectively "draws" the specified series on top of all other series, + // although it is performed through DOM manipulation, no redrawing is performed. + // + // Parameters: + // idx - 0 based index of the series to move. This will be the index of the series + // as it was first passed into the jqplot function. + this.moveSeriesToFront = function (idx) { + idx = parseInt(idx, 10); + var stackIndex = $.inArray(idx, this.seriesStack); + // if already in front, return + if (stackIndex == -1) { + return; + } + if (stackIndex == this.seriesStack.length -1) { + this.previousSeriesStack = this.seriesStack.slice(0); + return; + } + var opidx = this.seriesStack[this.seriesStack.length -1]; + var serelem = this.series[idx].canvas._elem.detach(); + var shadelem = this.series[idx].shadowCanvas._elem.detach(); + this.series[opidx].shadowCanvas._elem.after(shadelem); + this.series[opidx].canvas._elem.after(serelem); + this.previousSeriesStack = this.seriesStack.slice(0); + this.seriesStack.splice(stackIndex, 1); + this.seriesStack.push(idx); + }; + + // method: moveSeriesToBack + // This method requires jQuery 1.4+ + // Moves the specified series canvas behind all other series canvases. + // + // Parameters: + // idx - 0 based index of the series to move. This will be the index of the series + // as it was first passed into the jqplot function. + this.moveSeriesToBack = function (idx) { + idx = parseInt(idx, 10); + var stackIndex = $.inArray(idx, this.seriesStack); + // if already in back, return + if (stackIndex == 0 || stackIndex == -1) { + return; + } + var opidx = this.seriesStack[0]; + var serelem = this.series[idx].canvas._elem.detach(); + var shadelem = this.series[idx].shadowCanvas._elem.detach(); + this.series[opidx].shadowCanvas._elem.before(shadelem); + this.series[opidx].canvas._elem.before(serelem); + this.previousSeriesStack = this.seriesStack.slice(0); + this.seriesStack.splice(stackIndex, 1); + this.seriesStack.unshift(idx); + }; + + // method: restorePreviousSeriesOrder + // This method requires jQuery 1.4+ + // Restore the series canvas order to its previous state. + // Useful to put a series back where it belongs after moving + // it to the front. + this.restorePreviousSeriesOrder = function () { + var i, j, serelem, shadelem, temp, move, keep; + // if no change, return. + if (this.seriesStack == this.previousSeriesStack) { + return; + } + for (i=1; i<this.previousSeriesStack.length; i++) { + move = this.previousSeriesStack[i]; + keep = this.previousSeriesStack[i-1]; + serelem = this.series[move].canvas._elem.detach(); + shadelem = this.series[move].shadowCanvas._elem.detach(); + this.series[keep].shadowCanvas._elem.after(shadelem); + this.series[keep].canvas._elem.after(serelem); + } + temp = this.seriesStack.slice(0); + this.seriesStack = this.previousSeriesStack.slice(0); + this.previousSeriesStack = temp; + }; + + // method: restoreOriginalSeriesOrder + // This method requires jQuery 1.4+ + // Restore the series canvas order to its original order + // when the plot was created. + this.restoreOriginalSeriesOrder = function () { + var i, j, arr=[], serelem, shadelem; + for (i=0; i<this.series.length; i++) { + arr.push(i); + } + if (this.seriesStack == arr) { + return; + } + this.previousSeriesStack = this.seriesStack.slice(0); + this.seriesStack = arr; + for (i=1; i<this.seriesStack.length; i++) { + serelem = this.series[i].canvas._elem.detach(); + shadelem = this.series[i].shadowCanvas._elem.detach(); + this.series[i-1].shadowCanvas._elem.after(shadelem); + this.series[i-1].canvas._elem.after(serelem); + } + }; + + this.activateTheme = function (name) { + this.themeEngine.activate(this, name); + }; + } + + + // conpute a highlight color or array of highlight colors from given colors. + $.jqplot.computeHighlightColors = function(colors) { + var ret; + if ($.isArray(colors)) { + ret = []; + for (var i=0; i<colors.length; i++){ + var rgba = $.jqplot.getColorComponents(colors[i]); + var newrgb = [rgba[0], rgba[1], rgba[2]]; + var sum = newrgb[0] + newrgb[1] + newrgb[2]; + for (var j=0; j<3; j++) { + // when darkening, lowest color component can be is 60. + newrgb[j] = (sum > 660) ? newrgb[j] * 0.85 : 0.73 * newrgb[j] + 90; + newrgb[j] = parseInt(newrgb[j], 10); + (newrgb[j] > 255) ? 255 : newrgb[j]; + } + // newrgb[3] = (rgba[3] > 0.4) ? rgba[3] * 0.4 : rgba[3] * 1.5; + // newrgb[3] = (rgba[3] > 0.5) ? 0.8 * rgba[3] - .1 : rgba[3] + 0.2; + newrgb[3] = 0.3 + 0.35 * rgba[3]; + ret.push('rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+newrgb[3]+')'); + } + } + else { + var rgba = $.jqplot.getColorComponents(colors); + var newrgb = [rgba[0], rgba[1], rgba[2]]; + var sum = newrgb[0] + newrgb[1] + newrgb[2]; + for (var j=0; j<3; j++) { + // when darkening, lowest color component can be is 60. + // newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]); + // newrgb[j] = parseInt(newrgb[j], 10); + newrgb[j] = (sum > 660) ? newrgb[j] * 0.85 : 0.73 * newrgb[j] + 90; + newrgb[j] = parseInt(newrgb[j], 10); + (newrgb[j] > 255) ? 255 : newrgb[j]; + } + // newrgb[3] = (rgba[3] > 0.4) ? rgba[3] * 0.4 : rgba[3] * 1.5; + // newrgb[3] = (rgba[3] > 0.5) ? 0.8 * rgba[3] - .1 : rgba[3] + 0.2; + newrgb[3] = 0.3 + 0.35 * rgba[3]; + ret = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+newrgb[3]+')'; + } + return ret; + }; + + $.jqplot.ColorGenerator = function(colors) { + colors = colors || $.jqplot.config.defaultColors; + var idx = 0; + + this.next = function () { + if (idx < colors.length) { + return colors[idx++]; + } + else { + idx = 0; + return colors[idx++]; + } + }; + + this.previous = function () { + if (idx > 0) { + return colors[idx--]; + } + else { + idx = colors.length-1; + return colors[idx]; + } + }; + + // get a color by index without advancing pointer. + this.get = function(i) { + var idx = i - colors.length * Math.floor(i/colors.length); + return colors[idx]; + }; + + this.setColors = function(c) { + colors = c; + }; + + this.reset = function() { + idx = 0; + }; + + this.getIndex = function() { + return idx; + }; + + this.setIndex = function(index) { + idx = index; + }; + }; + + // convert a hex color string to rgb string. + // h - 3 or 6 character hex string, with or without leading # + // a - optional alpha + $.jqplot.hex2rgb = function(h, a) { + h = h.replace('#', ''); + if (h.length == 3) { + h = h.charAt(0)+h.charAt(0)+h.charAt(1)+h.charAt(1)+h.charAt(2)+h.charAt(2); + } + var rgb; + rgb = 'rgba('+parseInt(h.slice(0,2), 16)+', '+parseInt(h.slice(2,4), 16)+', '+parseInt(h.slice(4,6), 16); + if (a) { + rgb += ', '+a; + } + rgb += ')'; + return rgb; + }; + + // convert an rgb color spec to a hex spec. ignore any alpha specification. + $.jqplot.rgb2hex = function(s) { + var pat = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *(?:, *[0-9.]*)?\)/; + var m = s.match(pat); + var h = '#'; + for (var i=1; i<4; i++) { + var temp; + if (m[i].search(/%/) != -1) { + temp = parseInt(255*m[i]/100, 10).toString(16); + if (temp.length == 1) { + temp = '0'+temp; + } + } + else { + temp = parseInt(m[i], 10).toString(16); + if (temp.length == 1) { + temp = '0'+temp; + } + } + h += temp; + } + return h; + }; + + // given a css color spec, return an rgb css color spec + $.jqplot.normalize2rgb = function(s, a) { + if (s.search(/^ *rgba?\(/) != -1) { + return s; + } + else if (s.search(/^ *#?[0-9a-fA-F]?[0-9a-fA-F]/) != -1) { + return $.jqplot.hex2rgb(s, a); + } + else { + throw new Error('Invalid color spec'); + } + }; + + // extract the r, g, b, a color components out of a css color spec. + $.jqplot.getColorComponents = function(s) { + // check to see if a color keyword. + s = $.jqplot.colorKeywordMap[s] || s; + var rgb = $.jqplot.normalize2rgb(s); + var pat = /rgba?\( *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *, *([0-9]{1,3}\.?[0-9]*%?) *,? *([0-9.]* *)?\)/; + var m = rgb.match(pat); + var ret = []; + for (var i=1; i<4; i++) { + if (m[i].search(/%/) != -1) { + ret[i-1] = parseInt(255*m[i]/100, 10); + } + else { + ret[i-1] = parseInt(m[i], 10); + } + } + ret[3] = parseFloat(m[4]) ? parseFloat(m[4]) : 1.0; + return ret; + }; + + $.jqplot.colorKeywordMap = { + aliceblue: 'rgb(240, 248, 255)', + antiquewhite: 'rgb(250, 235, 215)', + aqua: 'rgb( 0, 255, 255)', + aquamarine: 'rgb(127, 255, 212)', + azure: 'rgb(240, 255, 255)', + beige: 'rgb(245, 245, 220)', + bisque: 'rgb(255, 228, 196)', + black: 'rgb( 0, 0, 0)', + blanchedalmond: 'rgb(255, 235, 205)', + blue: 'rgb( 0, 0, 255)', + blueviolet: 'rgb(138, 43, 226)', + brown: 'rgb(165, 42, 42)', + burlywood: 'rgb(222, 184, 135)', + cadetblue: 'rgb( 95, 158, 160)', + chartreuse: 'rgb(127, 255, 0)', + chocolate: 'rgb(210, 105, 30)', + coral: 'rgb(255, 127, 80)', + cornflowerblue: 'rgb(100, 149, 237)', + cornsilk: 'rgb(255, 248, 220)', + crimson: 'rgb(220, 20, 60)', + cyan: 'rgb( 0, 255, 255)', + darkblue: 'rgb( 0, 0, 139)', + darkcyan: 'rgb( 0, 139, 139)', + darkgoldenrod: 'rgb(184, 134, 11)', + darkgray: 'rgb(169, 169, 169)', + darkgreen: 'rgb( 0, 100, 0)', + darkgrey: 'rgb(169, 169, 169)', + darkkhaki: 'rgb(189, 183, 107)', + darkmagenta: 'rgb(139, 0, 139)', + darkolivegreen: 'rgb( 85, 107, 47)', + darkorange: 'rgb(255, 140, 0)', + darkorchid: 'rgb(153, 50, 204)', + darkred: 'rgb(139, 0, 0)', + darksalmon: 'rgb(233, 150, 122)', + darkseagreen: 'rgb(143, 188, 143)', + darkslateblue: 'rgb( 72, 61, 139)', + darkslategray: 'rgb( 47, 79, 79)', + darkslategrey: 'rgb( 47, 79, 79)', + darkturquoise: 'rgb( 0, 206, 209)', + darkviolet: 'rgb(148, 0, 211)', + deeppink: 'rgb(255, 20, 147)', + deepskyblue: 'rgb( 0, 191, 255)', + dimgray: 'rgb(105, 105, 105)', + dimgrey: 'rgb(105, 105, 105)', + dodgerblue: 'rgb( 30, 144, 255)', + firebrick: 'rgb(178, 34, 34)', + floralwhite: 'rgb(255, 250, 240)', + forestgreen: 'rgb( 34, 139, 34)', + fuchsia: 'rgb(255, 0, 255)', + gainsboro: 'rgb(220, 220, 220)', + ghostwhite: 'rgb(248, 248, 255)', + gold: 'rgb(255, 215, 0)', + goldenrod: 'rgb(218, 165, 32)', + gray: 'rgb(128, 128, 128)', + grey: 'rgb(128, 128, 128)', + green: 'rgb( 0, 128, 0)', + greenyellow: 'rgb(173, 255, 47)', + honeydew: 'rgb(240, 255, 240)', + hotpink: 'rgb(255, 105, 180)', + indianred: 'rgb(205, 92, 92)', + indigo: 'rgb( 75, 0, 130)', + ivory: 'rgb(255, 255, 240)', + khaki: 'rgb(240, 230, 140)', + lavender: 'rgb(230, 230, 250)', + lavenderblush: 'rgb(255, 240, 245)', + lawngreen: 'rgb(124, 252, 0)', + lemonchiffon: 'rgb(255, 250, 205)', + lightblue: 'rgb(173, 216, 230)', + lightcoral: 'rgb(240, 128, 128)', + lightcyan: 'rgb(224, 255, 255)', + lightgoldenrodyellow: 'rgb(250, 250, 210)', + lightgray: 'rgb(211, 211, 211)', + lightgreen: 'rgb(144, 238, 144)', + lightgrey: 'rgb(211, 211, 211)', + lightpink: 'rgb(255, 182, 193)', + lightsalmon: 'rgb(255, 160, 122)', + lightseagreen: 'rgb( 32, 178, 170)', + lightskyblue: 'rgb(135, 206, 250)', + lightslategray: 'rgb(119, 136, 153)', + lightslategrey: 'rgb(119, 136, 153)', + lightsteelblue: 'rgb(176, 196, 222)', + lightyellow: 'rgb(255, 255, 224)', + lime: 'rgb( 0, 255, 0)', + limegreen: 'rgb( 50, 205, 50)', + linen: 'rgb(250, 240, 230)', + magenta: 'rgb(255, 0, 255)', + maroon: 'rgb(128, 0, 0)', + mediumaquamarine: 'rgb(102, 205, 170)', + mediumblue: 'rgb( 0, 0, 205)', + mediumorchid: 'rgb(186, 85, 211)', + mediumpurple: 'rgb(147, 112, 219)', + mediumseagreen: 'rgb( 60, 179, 113)', + mediumslateblue: 'rgb(123, 104, 238)', + mediumspringgreen: 'rgb( 0, 250, 154)', + mediumturquoise: 'rgb( 72, 209, 204)', + mediumvioletred: 'rgb(199, 21, 133)', + midnightblue: 'rgb( 25, 25, 112)', + mintcream: 'rgb(245, 255, 250)', + mistyrose: 'rgb(255, 228, 225)', + moccasin: 'rgb(255, 228, 181)', + navajowhite: 'rgb(255, 222, 173)', + navy: 'rgb( 0, 0, 128)', + oldlace: 'rgb(253, 245, 230)', + olive: 'rgb(128, 128, 0)', + olivedrab: 'rgb(107, 142, 35)', + orange: 'rgb(255, 165, 0)', + orangered: 'rgb(255, 69, 0)', + orchid: 'rgb(218, 112, 214)', + palegoldenrod: 'rgb(238, 232, 170)', + palegreen: 'rgb(152, 251, 152)', + paleturquoise: 'rgb(175, 238, 238)', + palevioletred: 'rgb(219, 112, 147)', + papayawhip: 'rgb(255, 239, 213)', + peachpuff: 'rgb(255, 218, 185)', + peru: 'rgb(205, 133, 63)', + pink: 'rgb(255, 192, 203)', + plum: 'rgb(221, 160, 221)', + powderblue: 'rgb(176, 224, 230)', + purple: 'rgb(128, 0, 128)', + red: 'rgb(255, 0, 0)', + rosybrown: 'rgb(188, 143, 143)', + royalblue: 'rgb( 65, 105, 225)', + saddlebrown: 'rgb(139, 69, 19)', + salmon: 'rgb(250, 128, 114)', + sandybrown: 'rgb(244, 164, 96)', + seagreen: 'rgb( 46, 139, 87)', + seashell: 'rgb(255, 245, 238)', + sienna: 'rgb(160, 82, 45)', + silver: 'rgb(192, 192, 192)', + skyblue: 'rgb(135, 206, 235)', + slateblue: 'rgb(106, 90, 205)', + slategray: 'rgb(112, 128, 144)', + slategrey: 'rgb(112, 128, 144)', + snow: 'rgb(255, 250, 250)', + springgreen: 'rgb( 0, 255, 127)', + steelblue: 'rgb( 70, 130, 180)', + tan: 'rgb(210, 180, 140)', + teal: 'rgb( 0, 128, 128)', + thistle: 'rgb(216, 191, 216)', + tomato: 'rgb(255, 99, 71)', + turquoise: 'rgb( 64, 224, 208)', + violet: 'rgb(238, 130, 238)', + wheat: 'rgb(245, 222, 179)', + white: 'rgb(255, 255, 255)', + whitesmoke: 'rgb(245, 245, 245)', + yellow: 'rgb(255, 255, 0)', + yellowgreen: 'rgb(154, 205, 50)' + }; + + + + + // class: $.jqplot.AxisLabelRenderer + // Renderer to place labels on the axes. + $.jqplot.AxisLabelRenderer = function(options) { + // Group: Properties + $.jqplot.ElemContainer.call(this); + // name of the axis associated with this tick + this.axis; + // prop: show + // whether or not to show the tick (mark and label). + this.show = true; + // prop: label + // The text or html for the label. + this.label = ''; + this.fontFamily = null; + this.fontSize = null; + this.textColor = null; + this._elem; + // prop: escapeHTML + // true to escape HTML entities in the label. + this.escapeHTML = false; + + $.extend(true, this, options); + }; + + $.jqplot.AxisLabelRenderer.prototype = new $.jqplot.ElemContainer(); + $.jqplot.AxisLabelRenderer.prototype.constructor = $.jqplot.AxisLabelRenderer; + + $.jqplot.AxisLabelRenderer.prototype.init = function(options) { + $.extend(true, this, options); + }; + + $.jqplot.AxisLabelRenderer.prototype.draw = function(ctx, plot) { + // Memory Leaks patch + if (this._elem) { + this._elem.emptyForce(); + this._elem = null; + } + + this._elem = $('<div style="position:absolute;" class="jqplot-'+this.axis+'-label"></div>'); + + if (Number(this.label)) { + this._elem.css('white-space', 'nowrap'); + } + + if (!this.escapeHTML) { + this._elem.html(this.label); + } + else { + this._elem.text(this.label); + } + if (this.fontFamily) { + this._elem.css('font-family', this.fontFamily); + } + if (this.fontSize) { + this._elem.css('font-size', this.fontSize); + } + if (this.textColor) { + this._elem.css('color', this.textColor); + } + + return this._elem; + }; + + $.jqplot.AxisLabelRenderer.prototype.pack = function() { + }; + + // class: $.jqplot.AxisTickRenderer + // A "tick" object showing the value of a tick/gridline on the plot. + $.jqplot.AxisTickRenderer = function(options) { + // Group: Properties + $.jqplot.ElemContainer.call(this); + // prop: mark + // tick mark on the axis. One of 'inside', 'outside', 'cross', '' or null. + this.mark = 'outside'; + // name of the axis associated with this tick + this.axis; + // prop: showMark + // whether or not to show the mark on the axis. + this.showMark = true; + // prop: showGridline + // whether or not to draw the gridline on the grid at this tick. + this.showGridline = true; + // prop: isMinorTick + // if this is a minor tick. + this.isMinorTick = false; + // prop: size + // Length of the tick beyond the grid in pixels. + // DEPRECATED: This has been superceeded by markSize + this.size = 4; + // prop: markSize + // Length of the tick marks in pixels. For 'cross' style, length + // will be stoked above and below axis, so total length will be twice this. + this.markSize = 6; + // prop: show + // whether or not to show the tick (mark and label). + // Setting this to false requires more testing. It is recommended + // to set showLabel and showMark to false instead. + this.show = true; + // prop: showLabel + // whether or not to show the label. + this.showLabel = true; + this.label = null; + this.value = null; + this._styles = {}; + // prop: formatter + // A class of a formatter for the tick text. sprintf by default. + this.formatter = $.jqplot.DefaultTickFormatter; + // prop: prefix + // String to prepend to the tick label. + // Prefix is prepended to the formatted tick label. + this.prefix = ''; + // prop: suffix + // String to append to the tick label. + // Suffix is appended to the formatted tick label. + this.suffix = ''; + // prop: formatString + // string passed to the formatter. + this.formatString = ''; + // prop: fontFamily + // css spec for the font-family css attribute. + this.fontFamily; + // prop: fontSize + // css spec for the font-size css attribute. + this.fontSize; + // prop: textColor + // css spec for the color attribute. + this.textColor; + // prop: escapeHTML + // true to escape HTML entities in the label. + this.escapeHTML = false; + this._elem; + this._breakTick = false; + + $.extend(true, this, options); + }; + + $.jqplot.AxisTickRenderer.prototype.init = function(options) { + $.extend(true, this, options); + }; + + $.jqplot.AxisTickRenderer.prototype = new $.jqplot.ElemContainer(); + $.jqplot.AxisTickRenderer.prototype.constructor = $.jqplot.AxisTickRenderer; + + $.jqplot.AxisTickRenderer.prototype.setTick = function(value, axisName, isMinor) { + this.value = value; + this.axis = axisName; + if (isMinor) { + this.isMinorTick = true; + } + return this; + }; + + $.jqplot.AxisTickRenderer.prototype.draw = function() { + if (this.label === null) { + this.label = this.prefix + this.formatter(this.formatString, this.value) + this.suffix; + } + var style = {position: 'absolute'}; + if (Number(this.label)) { + style['whitSpace'] = 'nowrap'; + } + + // Memory Leaks patch + if (this._elem) { + this._elem.emptyForce(); + this._elem = null; + } + + this._elem = $(document.createElement('div')); + this._elem.addClass("jqplot-"+this.axis+"-tick"); + + if (!this.escapeHTML) { + this._elem.html(this.label); + } + else { + this._elem.text(this.label); + } + + this._elem.css(style); + + for (var s in this._styles) { + this._elem.css(s, this._styles[s]); + } + if (this.fontFamily) { + this._elem.css('font-family', this.fontFamily); + } + if (this.fontSize) { + this._elem.css('font-size', this.fontSize); + } + if (this.textColor) { + this._elem.css('color', this.textColor); + } + if (this._breakTick) { + this._elem.addClass('jqplot-breakTick'); + } + + return this._elem; + }; + + $.jqplot.DefaultTickFormatter = function (format, val) { + if (typeof val == 'number') { + if (!format) { + format = $.jqplot.config.defaultTickFormatString; + } + return $.jqplot.sprintf(format, val); + } + else { + return String(val); + } + }; + + $.jqplot.PercentTickFormatter = function (format, val) { + if (typeof val == 'number') { + val = 100 * val; + if (!format) { + format = $.jqplot.config.defaultTickFormatString; + } + return $.jqplot.sprintf(format, val); + } + else { + return String(val); + } + }; + + $.jqplot.AxisTickRenderer.prototype.pack = function() { + }; + + // Class: $.jqplot.CanvasGridRenderer + // The default jqPlot grid renderer, creating a grid on a canvas element. + // The renderer has no additional options beyond the <Grid> class. + $.jqplot.CanvasGridRenderer = function(){ + this.shadowRenderer = new $.jqplot.ShadowRenderer(); + }; + + // called with context of Grid object + $.jqplot.CanvasGridRenderer.prototype.init = function(options) { + this._ctx; + $.extend(true, this, options); + // set the shadow renderer options + var sopts = {lineJoin:'miter', lineCap:'round', fill:false, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, lineWidth:this.shadowWidth, closePath:false, strokeStyle:this.shadowColor}; + this.renderer.shadowRenderer.init(sopts); + }; + + // called with context of Grid. + $.jqplot.CanvasGridRenderer.prototype.createElement = function(plot) { + var elem; + // Memory Leaks patch + if (this._elem) { + if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) { + elem = this._elem.get(0); + window.G_vmlCanvasManager.uninitElement(elem); + elem = null; + } + + this._elem.emptyForce(); + this._elem = null; + } + + elem = plot.canvasManager.getCanvas(); + + var w = this._plotDimensions.width; + var h = this._plotDimensions.height; + elem.width = w; + elem.height = h; + this._elem = $(elem); + this._elem.addClass('jqplot-grid-canvas'); + this._elem.css({ position: 'absolute', left: 0, top: 0 }); + + elem = plot.canvasManager.initCanvas(elem); + + this._top = this._offsets.top; + this._bottom = h - this._offsets.bottom; + this._left = this._offsets.left; + this._right = w - this._offsets.right; + this._width = this._right - this._left; + this._height = this._bottom - this._top; + // avoid memory leak + elem = null; + return this._elem; + }; + + $.jqplot.CanvasGridRenderer.prototype.draw = function() { + this._ctx = this._elem.get(0).getContext("2d"); + var ctx = this._ctx; + var axes = this._axes; + // Add the grid onto the grid canvas. This is the bottom most layer. + ctx.save(); + ctx.clearRect(0, 0, this._plotDimensions.width, this._plotDimensions.height); + ctx.fillStyle = this.backgroundColor || this.background; + ctx.fillRect(this._left, this._top, this._width, this._height); + + ctx.save(); + ctx.lineJoin = 'miter'; + ctx.lineCap = 'butt'; + ctx.lineWidth = this.gridLineWidth; + ctx.strokeStyle = this.gridLineColor; + var b, e, s, m; + var ax = ['xaxis', 'yaxis', 'x2axis', 'y2axis']; + for (var i=4; i>0; i--) { + var name = ax[i-1]; + var axis = axes[name]; + var ticks = axis._ticks; + var numticks = ticks.length; + if (axis.show) { + if (axis.drawBaseline) { + var bopts = {}; + if (axis.baselineWidth !== null) { + bopts.lineWidth = axis.baselineWidth; + } + if (axis.baselineColor !== null) { + bopts.strokeStyle = axis.baselineColor; + } + switch (name) { + case 'xaxis': + drawLine (this._left, this._bottom, this._right, this._bottom, bopts); + break; + case 'yaxis': + drawLine (this._left, this._bottom, this._left, this._top, bopts); + break; + case 'x2axis': + drawLine (this._left, this._bottom, this._right, this._bottom, bopts); + break; + case 'y2axis': + drawLine (this._right, this._bottom, this._right, this._top, bopts); + break; + } + } + for (var j=numticks; j>0; j--) { + var t = ticks[j-1]; + if (t.show) { + var pos = Math.round(axis.u2p(t.value)) + 0.5; + switch (name) { + case 'xaxis': + // draw the grid line if we should + if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) { + drawLine(pos, this._top, pos, this._bottom); + } + // draw the mark + if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) { + s = t.markSize; + m = t.mark; + var pos = Math.round(axis.u2p(t.value)) + 0.5; + switch (m) { + case 'outside': + b = this._bottom; + e = this._bottom+s; + break; + case 'inside': + b = this._bottom-s; + e = this._bottom; + break; + case 'cross': + b = this._bottom-s; + e = this._bottom+s; + break; + default: + b = this._bottom; + e = this._bottom+s; + break; + } + // draw the shadow + if (this.shadow) { + this.renderer.shadowRenderer.draw(ctx, [[pos,b],[pos,e]], {lineCap:'butt', lineWidth:this.gridLineWidth, offset:this.gridLineWidth*0.75, depth:2, fill:false, closePath:false}); + } + // draw the line + drawLine(pos, b, pos, e); + } + break; + case 'yaxis': + // draw the grid line + if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) { + drawLine(this._right, pos, this._left, pos); + } + // draw the mark + if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) { + s = t.markSize; + m = t.mark; + var pos = Math.round(axis.u2p(t.value)) + 0.5; + switch (m) { + case 'outside': + b = this._left-s; + e = this._left; + break; + case 'inside': + b = this._left; + e = this._left+s; + break; + case 'cross': + b = this._left-s; + e = this._left+s; + break; + default: + b = this._left-s; + e = this._left; + break; + } + // draw the shadow + if (this.shadow) { + this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false}); + } + drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor}); + } + break; + case 'x2axis': + // draw the grid line + if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) { + drawLine(pos, this._bottom, pos, this._top); + } + // draw the mark + if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) { + s = t.markSize; + m = t.mark; + var pos = Math.round(axis.u2p(t.value)) + 0.5; + switch (m) { + case 'outside': + b = this._top-s; + e = this._top; + break; + case 'inside': + b = this._top; + e = this._top+s; + break; + case 'cross': + b = this._top-s; + e = this._top+s; + break; + default: + b = this._top-s; + e = this._top; + break; + } + // draw the shadow + if (this.shadow) { + this.renderer.shadowRenderer.draw(ctx, [[pos,b],[pos,e]], {lineCap:'butt', lineWidth:this.gridLineWidth, offset:this.gridLineWidth*0.75, depth:2, fill:false, closePath:false}); + } + drawLine(pos, b, pos, e); + } + break; + case 'y2axis': + // draw the grid line + if (t.showGridline && this.drawGridlines && ((!t.isMinorTick && axis.drawMajorGridlines) || (t.isMinorTick && axis.drawMinorGridlines)) ) { + drawLine(this._left, pos, this._right, pos); + } + // draw the mark + if (t.showMark && t.mark && ((!t.isMinorTick && axis.drawMajorTickMarks) || (t.isMinorTick && axis.drawMinorTickMarks)) ) { + s = t.markSize; + m = t.mark; + var pos = Math.round(axis.u2p(t.value)) + 0.5; + switch (m) { + case 'outside': + b = this._right; + e = this._right+s; + break; + case 'inside': + b = this._right-s; + e = this._right; + break; + case 'cross': + b = this._right-s; + e = this._right+s; + break; + default: + b = this._right; + e = this._right+s; + break; + } + // draw the shadow + if (this.shadow) { + this.renderer.shadowRenderer.draw(ctx, [[b, pos], [e, pos]], {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false}); + } + drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor}); + } + break; + default: + break; + } + } + } + t = null; + } + axis = null; + ticks = null; + } + // Now draw grid lines for additional y axes + ////// + // TO DO: handle yMidAxis + ////// + ax = ['y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis']; + for (var i=7; i>0; i--) { + var axis = axes[ax[i-1]]; + var ticks = axis._ticks; + if (axis.show) { + var tn = ticks[axis.numberTicks-1]; + var t0 = ticks[0]; + var left = axis.getLeft(); + var points = [[left, tn.getTop() + tn.getHeight()/2], [left, t0.getTop() + t0.getHeight()/2 + 1.0]]; + // draw the shadow + if (this.shadow) { + this.renderer.shadowRenderer.draw(ctx, points, {lineCap:'butt', fill:false, closePath:false}); + } + // draw the line + drawLine(points[0][0], points[0][1], points[1][0], points[1][1], {lineCap:'butt', strokeStyle:axis.borderColor, lineWidth:axis.borderWidth}); + // draw the tick marks + for (var j=ticks.length; j>0; j--) { + var t = ticks[j-1]; + s = t.markSize; + m = t.mark; + var pos = Math.round(axis.u2p(t.value)) + 0.5; + if (t.showMark && t.mark) { + switch (m) { + case 'outside': + b = left; + e = left+s; + break; + case 'inside': + b = left-s; + e = left; + break; + case 'cross': + b = left-s; + e = left+s; + break; + default: + b = left; + e = left+s; + break; + } + points = [[b,pos], [e,pos]]; + // draw the shadow + if (this.shadow) { + this.renderer.shadowRenderer.draw(ctx, points, {lineCap:'butt', lineWidth:this.gridLineWidth*1.5, offset:this.gridLineWidth*0.75, fill:false, closePath:false}); + } + // draw the line + drawLine(b, pos, e, pos, {strokeStyle:axis.borderColor}); + } + t = null; + } + t0 = null; + } + axis = null; + ticks = null; + } + + ctx.restore(); + + function drawLine(bx, by, ex, ey, opts) { + ctx.save(); + opts = opts || {}; + if (opts.lineWidth == null || opts.lineWidth != 0){ + $.extend(true, ctx, opts); + ctx.beginPath(); + ctx.moveTo(bx, by); + ctx.lineTo(ex, ey); + ctx.stroke(); + ctx.restore(); + } + } + + if (this.shadow) { + var points = [[this._left, this._bottom], [this._right, this._bottom], [this._right, this._top]]; + this.renderer.shadowRenderer.draw(ctx, points); + } + // Now draw border around grid. Use axis border definitions. start at + // upper left and go clockwise. + if (this.borderWidth != 0 && this.drawBorder) { + drawLine (this._left, this._top, this._right, this._top, {lineCap:'round', strokeStyle:axes.x2axis.borderColor, lineWidth:axes.x2axis.borderWidth}); + drawLine (this._right, this._top, this._right, this._bottom, {lineCap:'round', strokeStyle:axes.y2axis.borderColor, lineWidth:axes.y2axis.borderWidth}); + drawLine (this._right, this._bottom, this._left, this._bottom, {lineCap:'round', strokeStyle:axes.xaxis.borderColor, lineWidth:axes.xaxis.borderWidth}); + drawLine (this._left, this._bottom, this._left, this._top, {lineCap:'round', strokeStyle:axes.yaxis.borderColor, lineWidth:axes.yaxis.borderWidth}); + } + // ctx.lineWidth = this.borderWidth; + // ctx.strokeStyle = this.borderColor; + // ctx.strokeRect(this._left, this._top, this._width, this._height); + + ctx.restore(); + ctx = null; + axes = null; + }; + + // Class: $.jqplot.DivTitleRenderer + // The default title renderer for jqPlot. This class has no options beyond the <Title> class. + $.jqplot.DivTitleRenderer = function() { + }; + + $.jqplot.DivTitleRenderer.prototype.init = function(options) { + $.extend(true, this, options); + }; + + $.jqplot.DivTitleRenderer.prototype.draw = function() { + // Memory Leaks patch + if (this._elem) { + this._elem.emptyForce(); + this._elem = null; + } + + var r = this.renderer; + var elem = document.createElement('div'); + this._elem = $(elem); + this._elem.addClass('jqplot-title'); + + if (!this.text) { + this.show = false; + this._elem.height(0); + this._elem.width(0); + } + else if (this.text) { + var color; + if (this.color) { + color = this.color; + } + else if (this.textColor) { + color = this.textColor; + } + + // don't trust that a stylesheet is present, set the position. + var styles = {position:'absolute', top:'0px', left:'0px'}; + + if (this._plotWidth) { + styles['width'] = this._plotWidth+'px'; + } + if (this.fontSize) { + styles['fontSize'] = this.fontSize; + } + if (typeof this.textAlign === 'string') { + styles['textAlign'] = this.textAlign; + } + else { + styles['textAlign'] = 'center'; + } + if (color) { + styles['color'] = color; + } + if (this.paddingBottom) { + styles['paddingBottom'] = this.paddingBottom; + } + if (this.fontFamily) { + styles['fontFamily'] = this.fontFamily; + } + + this._elem.css(styles); + if (this.escapeHtml) { + this._elem.text(this.text); + } + else { + this._elem.html(this.text); + } + + + // styletext += (this._plotWidth) ? 'width:'+this._plotWidth+'px;' : ''; + // styletext += (this.fontSize) ? 'font-size:'+this.fontSize+';' : ''; + // styletext += (this.textAlign) ? 'text-align:'+this.textAlign+';' : 'text-align:center;'; + // styletext += (color) ? 'color:'+color+';' : ''; + // styletext += (this.paddingBottom) ? 'padding-bottom:'+this.paddingBottom+';' : ''; + // this._elem = $('<div class="jqplot-title" style="'+styletext+'">'+this.text+'</div>'); + // if (this.fontFamily) { + // this._elem.css('font-family', this.fontFamily); + // } + } + + elem = null; + + return this._elem; + }; + + $.jqplot.DivTitleRenderer.prototype.pack = function() { + // nothing to do here + }; + + + var dotlen = 0.1; + + $.jqplot.LinePattern = function (ctx, pattern) { + + var defaultLinePatterns = { + dotted: [ dotlen, $.jqplot.config.dotGapLength ], + dashed: [ $.jqplot.config.dashLength, $.jqplot.config.gapLength ], + solid: null + }; + + if (typeof pattern === 'string') { + if (pattern[0] === '.' || pattern[0] === '-') { + var s = pattern; + pattern = []; + for (var i=0, imax=s.length; i<imax; i++) { + if (s[i] === '.') { + pattern.push( dotlen ); + } + else if (s[i] === '-') { + pattern.push( $.jqplot.config.dashLength ); + } + else { + continue; + } + pattern.push( $.jqplot.config.gapLength ); + } + } + else { + pattern = defaultLinePatterns[pattern]; + } + } + + if (!(pattern && pattern.length)) { + return ctx; + } + + var patternIndex = 0; + var patternDistance = pattern[0]; + var px = 0; + var py = 0; + var pathx0 = 0; + var pathy0 = 0; + + var moveTo = function (x, y) { + ctx.moveTo( x, y ); + px = x; + py = y; + pathx0 = x; + pathy0 = y; + }; + + var lineTo = function (x, y) { + var scale = ctx.lineWidth; + var dx = x - px; + var dy = y - py; + var dist = Math.sqrt(dx*dx+dy*dy); + if ((dist > 0) && (scale > 0)) { + dx /= dist; + dy /= dist; + while (true) { + var dp = scale * patternDistance; + if (dp < dist) { + px += dp * dx; + py += dp * dy; + if ((patternIndex & 1) == 0) { + ctx.lineTo( px, py ); + } + else { + ctx.moveTo( px, py ); + } + dist -= dp; + patternIndex++; + if (patternIndex >= pattern.length) { + patternIndex = 0; + } + patternDistance = pattern[patternIndex]; + } + else { + px = x; + py = y; + if ((patternIndex & 1) == 0) { + ctx.lineTo( px, py ); + } + else { + ctx.moveTo( px, py ); + } + patternDistance -= dist / scale; + break; + } + } + } + }; + + var beginPath = function () { + ctx.beginPath(); + }; + + var closePath = function () { + lineTo( pathx0, pathy0 ); + }; + + return { + moveTo: moveTo, + lineTo: lineTo, + beginPath: beginPath, + closePath: closePath + }; + }; + + // Class: $.jqplot.LineRenderer + // The default line renderer for jqPlot, this class has no options beyond the <Series> class. + // Draws series as a line. + $.jqplot.LineRenderer = function(){ + this.shapeRenderer = new $.jqplot.ShapeRenderer(); + this.shadowRenderer = new $.jqplot.ShadowRenderer(); + }; + + // called with scope of series. + $.jqplot.LineRenderer.prototype.init = function(options, plot) { + // Group: Properties + // + options = options || {}; + this._type='line'; + this.renderer.animation = { + show: false, + direction: 'left', + speed: 2500, + _supported: true + }; + // prop: smooth + // True to draw a smoothed (interpolated) line through the data points + // with automatically computed number of smoothing points. + // Set to an integer number > 2 to specify number of smoothing points + // to use between each data point. + this.renderer.smooth = false; // true or a number > 2 for smoothing. + this.renderer.tension = null; // null to auto compute or a number typically > 6. Fewer points requires higher tension. + // prop: constrainSmoothing + // True to use a more accurate smoothing algorithm that will + // not overshoot any data points. False to allow overshoot but + // produce a smoother looking line. + this.renderer.constrainSmoothing = true; + // this is smoothed data in grid coordinates, like gridData + this.renderer._smoothedData = []; + // this is smoothed data in plot units (plot coordinates), like plotData. + this.renderer._smoothedPlotData = []; + this.renderer._hiBandGridData = []; + this.renderer._lowBandGridData = []; + this.renderer._hiBandSmoothedData = []; + this.renderer._lowBandSmoothedData = []; + + // prop: bandData + // Data used to draw error bands or confidence intervals above/below a line. + // + // bandData can be input in 3 forms. jqPlot will figure out which is the + // low band line and which is the high band line for all forms: + // + // A 2 dimensional array like [[yl1, yl2, ...], [yu1, yu2, ...]] where + // [yl1, yl2, ...] are y values of the lower line and + // [yu1, yu2, ...] are y values of the upper line. + // In this case there must be the same number of y data points as data points + // in the series and the bands will inherit the x values of the series. + // + // A 2 dimensional array like [[[xl1, yl1], [xl2, yl2], ...], [[xh1, yh1], [xh2, yh2], ...]] + // where [xl1, yl1] are x,y data points for the lower line and + // [xh1, yh1] are x,y data points for the high line. + // x values do not have to correspond to the x values of the series and can + // be of any arbitrary length. + // + // Can be of form [[yl1, yu1], [yl2, yu2], [yl3, yu3], ...] where + // there must be 3 or more arrays and there must be the same number of arrays + // as there are data points in the series. In this case, + // [yl1, yu1] specifies the lower and upper y values for the 1st + // data point and so on. The bands will inherit the x + // values from the series. + this.renderer.bandData = []; + + // Group: bands + // Banding around line, e.g error bands or confidence intervals. + this.renderer.bands = { + // prop: show + // true to show the bands. If bandData or interval is + // supplied, show will be set to true by default. + show: false, + hiData: [], + lowData: [], + // prop: color + // color of lines at top and bottom of bands [default: series color]. + color: this.color, + // prop: showLines + // True to show lines at top and bottom of bands [default: false]. + showLines: false, + // prop: fill + // True to fill area between bands [default: true]. + fill: true, + // prop: fillColor + // css color spec for filled area. [default: series color]. + fillColor: null, + _min: null, + _max: null, + // prop: interval + // User specified interval above and below line for bands [default: '3%'']. + // Can be a value like 3 or a string like '3%' + // or an upper/lower array like [1, -2] or ['2%', '-1.5%'] + interval: '3%' + }; + + + var lopts = {highlightMouseOver: options.highlightMouseOver, highlightMouseDown: options.highlightMouseDown, highlightColor: options.highlightColor}; + + delete (options.highlightMouseOver); + delete (options.highlightMouseDown); + delete (options.highlightColor); + + $.extend(true, this.renderer, options); + + this.renderer.options = options; + + // if we are given some band data, and bands aren't explicity set to false in options, turn them on. + if (this.renderer.bandData.length > 1 && (!options.bands || options.bands.show == null)) { + this.renderer.bands.show = true; + } + + // if we are given an interval, and bands aren't explicity set to false in options, turn them on. + else if (options.bands && options.bands.show == null && options.bands.interval != null) { + this.renderer.bands.show = true; + } + + // if plot is filled, turn off bands. + if (this.fill) { + this.renderer.bands.show = false; + } + + if (this.renderer.bands.show) { + this.renderer.initBands.call(this, this.renderer.options, plot); + } + + + // smoothing is not compatible with stacked lines, disable + if (this._stack) { + this.renderer.smooth = false; + } + + // set the shape renderer options + var opts = {lineJoin:this.lineJoin, lineCap:this.lineCap, fill:this.fill, isarc:false, strokeStyle:this.color, fillStyle:this.fillColor, lineWidth:this.lineWidth, linePattern:this.linePattern, closePath:this.fill}; + this.renderer.shapeRenderer.init(opts); + + var shadow_offset = options.shadowOffset; + // set the shadow renderer options + if (shadow_offset == null) { + // scale the shadowOffset to the width of the line. + if (this.lineWidth > 2.5) { + shadow_offset = 1.25 * (1 + (Math.atan((this.lineWidth/2.5))/0.785398163 - 1)*0.6); + // var shadow_offset = this.shadowOffset; + } + // for skinny lines, don't make such a big shadow. + else { + shadow_offset = 1.25 * Math.atan((this.lineWidth/2.5))/0.785398163; + } + } + + var sopts = {lineJoin:this.lineJoin, lineCap:this.lineCap, fill:this.fill, isarc:false, angle:this.shadowAngle, offset:shadow_offset, alpha:this.shadowAlpha, depth:this.shadowDepth, lineWidth:this.lineWidth, linePattern:this.linePattern, closePath:this.fill}; + this.renderer.shadowRenderer.init(sopts); + this._areaPoints = []; + this._boundingBox = [[],[]]; + + if (!this.isTrendline && this.fill || this.renderer.bands.show) { + // Group: Properties + // + // prop: highlightMouseOver + // True to highlight area on a filled plot when moused over. + // This must be false to enable highlightMouseDown to highlight when clicking on an area on a filled plot. + this.highlightMouseOver = true; + // prop: highlightMouseDown + // True to highlight when a mouse button is pressed over an area on a filled plot. + // This will be disabled if highlightMouseOver is true. + this.highlightMouseDown = false; + // prop: highlightColor + // color to use when highlighting an area on a filled plot. + this.highlightColor = null; + // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver + if (lopts.highlightMouseDown && lopts.highlightMouseOver == null) { + lopts.highlightMouseOver = false; + } + + $.extend(true, this, {highlightMouseOver: lopts.highlightMouseOver, highlightMouseDown: lopts.highlightMouseDown, highlightColor: lopts.highlightColor}); + + if (!this.highlightColor) { + var fc = (this.renderer.bands.show) ? this.renderer.bands.fillColor : this.fillColor; + this.highlightColor = $.jqplot.computeHighlightColors(fc); + } + // turn off (disable) the highlighter plugin + if (this.highlighter) { + this.highlighter.show = false; + } + } + + if (!this.isTrendline && plot) { + plot.plugins.lineRenderer = {}; + plot.postInitHooks.addOnce(postInit); + plot.postDrawHooks.addOnce(postPlotDraw); + plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove); + plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown); + plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp); + plot.eventListenerHooks.addOnce('jqplotClick', handleClick); + plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick); + } + + }; + + $.jqplot.LineRenderer.prototype.initBands = function(options, plot) { + // use bandData if no data specified in bands option + //var bd = this.renderer.bandData; + var bd = options.bandData || []; + var bands = this.renderer.bands; + bands.hiData = []; + bands.lowData = []; + var data = this.data; + bands._max = null; + bands._min = null; + // If 2 arrays, and each array greater than 2 elements, assume it is hi and low data bands of y values. + if (bd.length == 2) { + // Do we have an array of x,y values? + // like [[[1,1], [2,4], [3,3]], [[1,3], [2,6], [3,5]]] + if ($.isArray(bd[0][0])) { + // since an arbitrary array of points, spin through all of them to determine max and min lines. + + var p; + var bdminidx = 0, bdmaxidx = 0; + for (var i = 0, l = bd[0].length; i<l; i++) { + p = bd[0][i]; + if ((p[1] != null && p[1] > bands._max) || bands._max == null) { + bands._max = p[1]; + } + if ((p[1] != null && p[1] < bands._min) || bands._min == null) { + bands._min = p[1]; + } + } + for (var i = 0, l = bd[1].length; i<l; i++) { + p = bd[1][i]; + if ((p[1] != null && p[1] > bands._max) || bands._max == null) { + bands._max = p[1]; + bdmaxidx = 1; + } + if ((p[1] != null && p[1] < bands._min) || bands._min == null) { + bands._min = p[1]; + bdminidx = 1; + } + } + + if (bdmaxidx === bdminidx) { + bands.show = false; + } + + bands.hiData = bd[bdmaxidx]; + bands.lowData = bd[bdminidx]; + } + // else data is arrays of y values + // like [[1,4,3], [3,6,5]] + // must have same number of band data points as points in series + else if (bd[0].length === data.length && bd[1].length === data.length) { + var hi = (bd[0][0] > bd[1][0]) ? 0 : 1; + var low = (hi) ? 0 : 1; + for (var i=0, l=data.length; i < l; i++) { + bands.hiData.push([data[i][0], bd[hi][i]]); + bands.lowData.push([data[i][0], bd[low][i]]); + } + } + + // we don't have proper data array, don't show bands. + else { + bands.show = false; + } + } + + // if more than 2 arrays, have arrays of [ylow, yhi] values. + // note, can't distinguish case of [[ylow, yhi], [ylow, yhi]] from [[ylow, ylow], [yhi, yhi]] + // this is assumed to be of the latter form. + else if (bd.length > 2 && !$.isArray(bd[0][0])) { + var hi = (bd[0][0] > bd[0][1]) ? 0 : 1; + var low = (hi) ? 0 : 1; + for (var i=0, l=bd.length; i<l; i++) { + bands.hiData.push([data[i][0], bd[i][hi]]); + bands.lowData.push([data[i][0], bd[i][low]]); + } + } + + // don't have proper data, auto calculate + else { + var intrv = bands.interval; + var a = null; + var b = null; + var afunc = null; + var bfunc = null; + + if ($.isArray(intrv)) { + a = intrv[0]; + b = intrv[1]; + } + else { + a = intrv; + } + + if (isNaN(a)) { + // we have a string + if (a.charAt(a.length - 1) === '%') { + afunc = 'multiply'; + a = parseFloat(a)/100 + 1; + } + } + + else { + a = parseFloat(a); + afunc = 'add'; + } + + if (b !== null && isNaN(b)) { + // we have a string + if (b.charAt(b.length - 1) === '%') { + bfunc = 'multiply'; + b = parseFloat(b)/100 + 1; + } + } + + else if (b !== null) { + b = parseFloat(b); + bfunc = 'add'; + } + + if (a !== null) { + if (b === null) { + b = -a; + bfunc = afunc; + if (bfunc === 'multiply') { + b += 2; + } + } + + // make sure a always applies to hi band. + if (a < b) { + var temp = a; + a = b; + b = temp; + temp = afunc; + afunc = bfunc; + bfunc = temp; + } + + for (var i=0, l = data.length; i < l; i++) { + switch (afunc) { + case 'add': + bands.hiData.push([data[i][0], data[i][1] + a]); + break; + case 'multiply': + bands.hiData.push([data[i][0], data[i][1] * a]); + break; + } + switch (bfunc) { + case 'add': + bands.lowData.push([data[i][0], data[i][1] + b]); + break; + case 'multiply': + bands.lowData.push([data[i][0], data[i][1] * b]); + break; + } + } + } + + else { + bands.show = false; + } + } + + var hd = bands.hiData; + var ld = bands.lowData; + for (var i = 0, l = hd.length; i<l; i++) { + if ((hd[i][1] != null && hd[i][1] > bands._max) || bands._max == null) { + bands._max = hd[i][1]; + } + } + for (var i = 0, l = ld.length; i<l; i++) { + if ((ld[i][1] != null && ld[i][1] < bands._min) || bands._min == null) { + bands._min = ld[i][1]; + } + } + + // one last check for proper data + // these don't apply any more since allowing arbitrary x,y values + // if (bands.hiData.length != bands.lowData.length) { + // bands.show = false; + // } + + // if (bands.hiData.length != this.data.length) { + // bands.show = false; + // } + + if (bands.fillColor === null) { + var c = $.jqplot.getColorComponents(bands.color); + // now adjust alpha to differentiate fill + c[3] = c[3] * 0.5; + bands.fillColor = 'rgba(' + c[0] +', '+ c[1] +', '+ c[2] +', '+ c[3] + ')'; + } + }; + + function getSteps (d, f) { + return (3.4182054+f) * Math.pow(d, -0.3534992); + } + + function computeSteps (d1, d2) { + var s = Math.sqrt(Math.pow((d2[0]- d1[0]), 2) + Math.pow ((d2[1] - d1[1]), 2)); + return 5.7648 * Math.log(s) + 7.4456; + } + + function tanh (x) { + var a = (Math.exp(2*x) - 1) / (Math.exp(2*x) + 1); + return a; + } + + ////////// + // computeConstrainedSmoothedData + // An implementation of the constrained cubic spline interpolation + // method as presented in: + // + // Kruger, CJC, Constrained Cubic Spine Interpolation for Chemical Engineering Applications + // http://www.korf.co.uk/spline.pdf + // + // The implementation below borrows heavily from the sample Visual Basic + // implementation by CJC Kruger found in http://www.korf.co.uk/spline.xls + // + ///////// + + // called with scope of series + function computeConstrainedSmoothedData (gd) { + var smooth = this.renderer.smooth; + var dim = this.canvas.getWidth(); + var xp = this._xaxis.series_p2u; + var yp = this._yaxis.series_p2u; + var steps =null; + var _steps = null; + var dist = gd.length/dim; + var _smoothedData = []; + var _smoothedPlotData = []; + + if (!isNaN(parseFloat(smooth))) { + steps = parseFloat(smooth); + } + else { + steps = getSteps(dist, 0.5); + } + + var yy = []; + var xx = []; + + for (var i=0, l = gd.length; i<l; i++) { + yy.push(gd[i][1]); + xx.push(gd[i][0]); + } + + function dxx(x1, x0) { + if (x1 - x0 == 0) { + return Math.pow(10,10); + } + else { + return x1 - x0; + } + } + + var A, B, C, D; + // loop through each line segment. Have # points - 1 line segments. Nmber segments starting at 1. + var nmax = gd.length - 1; + for (var num = 1, gdl = gd.length; num<gdl; num++) { + var gxx = []; + var ggxx = []; + // point at each end of segment. + for (var j = 0; j < 2; j++) { + var i = num - 1 + j; // point number, 0 to # points. + + if (i == 0 || i == nmax) { + gxx[j] = Math.pow(10, 10); + } + else if (yy[i+1] - yy[i] == 0 || yy[i] - yy[i-1] == 0) { + gxx[j] = 0; + } + else if (((xx[i+1] - xx[i]) / (yy[i+1] - yy[i]) + (xx[i] - xx[i-1]) / (yy[i] - yy[i-1])) == 0 ) { + gxx[j] = 0; + } + else if ( (yy[i+1] - yy[i]) * (yy[i] - yy[i-1]) < 0 ) { + gxx[j] = 0; + } + + else { + gxx[j] = 2 / (dxx(xx[i + 1], xx[i]) / (yy[i + 1] - yy[i]) + dxx(xx[i], xx[i - 1]) / (yy[i] - yy[i - 1])); + } + } + + // Reset first derivative (slope) at first and last point + if (num == 1) { + // First point has 0 2nd derivative + gxx[0] = 3 / 2 * (yy[1] - yy[0]) / dxx(xx[1], xx[0]) - gxx[1] / 2; + } + else if (num == nmax) { + // Last point has 0 2nd derivative + gxx[1] = 3 / 2 * (yy[nmax] - yy[nmax - 1]) / dxx(xx[nmax], xx[nmax - 1]) - gxx[0] / 2; + } + + // Calc second derivative at points + ggxx[0] = -2 * (gxx[1] + 2 * gxx[0]) / dxx(xx[num], xx[num - 1]) + 6 * (yy[num] - yy[num - 1]) / Math.pow(dxx(xx[num], xx[num - 1]), 2); + ggxx[1] = 2 * (2 * gxx[1] + gxx[0]) / dxx(xx[num], xx[num - 1]) - 6 * (yy[num] - yy[num - 1]) / Math.pow(dxx(xx[num], xx[num - 1]), 2); + + // Calc constants for cubic interpolation + D = 1 / 6 * (ggxx[1] - ggxx[0]) / dxx(xx[num], xx[num - 1]); + C = 1 / 2 * (xx[num] * ggxx[0] - xx[num - 1] * ggxx[1]) / dxx(xx[num], xx[num - 1]); + B = (yy[num] - yy[num - 1] - C * (Math.pow(xx[num], 2) - Math.pow(xx[num - 1], 2)) - D * (Math.pow(xx[num], 3) - Math.pow(xx[num - 1], 3))) / dxx(xx[num], xx[num - 1]); + A = yy[num - 1] - B * xx[num - 1] - C * Math.pow(xx[num - 1], 2) - D * Math.pow(xx[num - 1], 3); + + var increment = (xx[num] - xx[num - 1]) / steps; + var temp, tempx; + + for (var j = 0, l = steps; j < l; j++) { + temp = []; + tempx = xx[num - 1] + j * increment; + temp.push(tempx); + temp.push(A + B * tempx + C * Math.pow(tempx, 2) + D * Math.pow(tempx, 3)); + _smoothedData.push(temp); + _smoothedPlotData.push([xp(temp[0]), yp(temp[1])]); + } + } + + _smoothedData.push(gd[i]); + _smoothedPlotData.push([xp(gd[i][0]), yp(gd[i][1])]); + + return [_smoothedData, _smoothedPlotData]; + } + + /////// + // computeHermiteSmoothedData + // A hermite spline smoothing of the plot data. + // This implementation is derived from the one posted + // by krypin on the jqplot-users mailing list: + // + // http://groups.google.com/group/jqplot-users/browse_thread/thread/748be6a445723cea?pli=1 + // + // with a blog post: + // + // http://blog.statscollector.com/a-plugin-renderer-for-jqplot-to-draw-a-hermite-spline/ + // + // and download of the original plugin: + // + // http://blog.statscollector.com/wp-content/uploads/2010/02/jqplot.hermiteSplineRenderer.js + ////////// + + // called with scope of series + function computeHermiteSmoothedData (gd) { + var smooth = this.renderer.smooth; + var tension = this.renderer.tension; + var dim = this.canvas.getWidth(); + var xp = this._xaxis.series_p2u; + var yp = this._yaxis.series_p2u; + var steps =null; + var _steps = null; + var a = null; + var a1 = null; + var a2 = null; + var slope = null; + var slope2 = null; + var temp = null; + var t, s, h1, h2, h3, h4; + var TiX, TiY, Ti1X, Ti1Y; + var pX, pY, p; + var sd = []; + var spd = []; + var dist = gd.length/dim; + var min, max, stretch, scale, shift; + var _smoothedData = []; + var _smoothedPlotData = []; + if (!isNaN(parseFloat(smooth))) { + steps = parseFloat(smooth); + } + else { + steps = getSteps(dist, 0.5); + } + if (!isNaN(parseFloat(tension))) { + tension = parseFloat(tension); + } + + for (var i=0, l = gd.length-1; i < l; i++) { + + if (tension === null) { + slope = Math.abs((gd[i+1][1] - gd[i][1]) / (gd[i+1][0] - gd[i][0])); + + min = 0.3; + max = 0.6; + stretch = (max - min)/2.0; + scale = 2.5; + shift = -1.4; + + temp = slope/scale + shift; + + a1 = stretch * tanh(temp) - stretch * tanh(shift) + min; + + // if have both left and right line segments, will use minimum tension. + if (i > 0) { + slope2 = Math.abs((gd[i][1] - gd[i-1][1]) / (gd[i][0] - gd[i-1][0])); + } + temp = slope2/scale + shift; + + a2 = stretch * tanh(temp) - stretch * tanh(shift) + min; + + a = (a1 + a2)/2.0; + + } + else { + a = tension; + } + for (t=0; t < steps; t++) { + s = t / steps; + h1 = (1 + 2*s)*Math.pow((1-s),2); + h2 = s*Math.pow((1-s),2); + h3 = Math.pow(s,2)*(3-2*s); + h4 = Math.pow(s,2)*(s-1); + + if (gd[i-1]) { + TiX = a * (gd[i+1][0] - gd[i-1][0]); + TiY = a * (gd[i+1][1] - gd[i-1][1]); + } else { + TiX = a * (gd[i+1][0] - gd[i][0]); + TiY = a * (gd[i+1][1] - gd[i][1]); + } + if (gd[i+2]) { + Ti1X = a * (gd[i+2][0] - gd[i][0]); + Ti1Y = a * (gd[i+2][1] - gd[i][1]); + } else { + Ti1X = a * (gd[i+1][0] - gd[i][0]); + Ti1Y = a * (gd[i+1][1] - gd[i][1]); + } + + pX = h1*gd[i][0] + h3*gd[i+1][0] + h2*TiX + h4*Ti1X; + pY = h1*gd[i][1] + h3*gd[i+1][1] + h2*TiY + h4*Ti1Y; + p = [pX, pY]; + + _smoothedData.push(p); + _smoothedPlotData.push([xp(pX), yp(pY)]); + } + } + _smoothedData.push(gd[l]); + _smoothedPlotData.push([xp(gd[l][0]), yp(gd[l][1])]); + + return [_smoothedData, _smoothedPlotData]; + } + + // setGridData + // converts the user data values to grid coordinates and stores them + // in the gridData array. + // Called with scope of a series. + $.jqplot.LineRenderer.prototype.setGridData = function(plot) { + // recalculate the grid data + var xp = this._xaxis.series_u2p; + var yp = this._yaxis.series_u2p; + var data = this._plotData; + var pdata = this._prevPlotData; + this.gridData = []; + this._prevGridData = []; + this.renderer._smoothedData = []; + this.renderer._smoothedPlotData = []; + this.renderer._hiBandGridData = []; + this.renderer._lowBandGridData = []; + this.renderer._hiBandSmoothedData = []; + this.renderer._lowBandSmoothedData = []; + var bands = this.renderer.bands; + var hasNull = false; + for (var i=0, l=data.length; i < l; i++) { + // if not a line series or if no nulls in data, push the converted point onto the array. + if (data[i][0] != null && data[i][1] != null) { + this.gridData.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]); + } + // else if there is a null, preserve it. + else if (data[i][0] == null) { + hasNull = true; + this.gridData.push([null, yp.call(this._yaxis, data[i][1])]); + } + else if (data[i][1] == null) { + hasNull = true; + this.gridData.push([xp.call(this._xaxis, data[i][0]), null]); + } + // if not a line series or if no nulls in data, push the converted point onto the array. + if (pdata[i] != null && pdata[i][0] != null && pdata[i][1] != null) { + this._prevGridData.push([xp.call(this._xaxis, pdata[i][0]), yp.call(this._yaxis, pdata[i][1])]); + } + // else if there is a null, preserve it. + else if (pdata[i] != null && pdata[i][0] == null) { + this._prevGridData.push([null, yp.call(this._yaxis, pdata[i][1])]); + } + else if (pdata[i] != null && pdata[i][0] != null && pdata[i][1] == null) { + this._prevGridData.push([xp.call(this._xaxis, pdata[i][0]), null]); + } + } + + // don't do smoothing or bands on broken lines. + if (hasNull) { + this.renderer.smooth = false; + if (this._type === 'line') { + bands.show = false; + } + } + + if (this._type === 'line' && bands.show) { + for (var i=0, l=bands.hiData.length; i<l; i++) { + this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]); + } + for (var i=0, l=bands.lowData.length; i<l; i++) { + this.renderer._lowBandGridData.push([xp.call(this._xaxis, bands.lowData[i][0]), yp.call(this._yaxis, bands.lowData[i][1])]); + } + } + + // calculate smoothed data if enough points and no nulls + if (this._type === 'line' && this.renderer.smooth && this.gridData.length > 2) { + var ret; + if (this.renderer.constrainSmoothing) { + ret = computeConstrainedSmoothedData.call(this, this.gridData); + this.renderer._smoothedData = ret[0]; + this.renderer._smoothedPlotData = ret[1]; + + if (bands.show) { + ret = computeConstrainedSmoothedData.call(this, this.renderer._hiBandGridData); + this.renderer._hiBandSmoothedData = ret[0]; + ret = computeConstrainedSmoothedData.call(this, this.renderer._lowBandGridData); + this.renderer._lowBandSmoothedData = ret[0]; + } + + ret = null; + } + else { + ret = computeHermiteSmoothedData.call(this, this.gridData); + this.renderer._smoothedData = ret[0]; + this.renderer._smoothedPlotData = ret[1]; + + if (bands.show) { + ret = computeHermiteSmoothedData.call(this, this.renderer._hiBandGridData); + this.renderer._hiBandSmoothedData = ret[0]; + ret = computeHermiteSmoothedData.call(this, this.renderer._lowBandGridData); + this.renderer._lowBandSmoothedData = ret[0]; + } + + ret = null; + } + } + }; + + // makeGridData + // converts any arbitrary data values to grid coordinates and + // returns them. This method exists so that plugins can use a series' + // linerenderer to generate grid data points without overwriting the + // grid data associated with that series. + // Called with scope of a series. + $.jqplot.LineRenderer.prototype.makeGridData = function(data, plot) { + // recalculate the grid data + var xp = this._xaxis.series_u2p; + var yp = this._yaxis.series_u2p; + var gd = []; + var pgd = []; + this.renderer._smoothedData = []; + this.renderer._smoothedPlotData = []; + this.renderer._hiBandGridData = []; + this.renderer._lowBandGridData = []; + this.renderer._hiBandSmoothedData = []; + this.renderer._lowBandSmoothedData = []; + var bands = this.renderer.bands; + var hasNull = false; + for (var i=0; i<data.length; i++) { + // if not a line series or if no nulls in data, push the converted point onto the array. + if (data[i][0] != null && data[i][1] != null) { + if (this.step && i>0) { + gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i-1][1])]); + } + gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]); + } + // else if there is a null, preserve it. + else if (data[i][0] == null) { + hasNull = true; + gd.push([null, yp.call(this._yaxis, data[i][1])]); + } + else if (data[i][1] == null) { + hasNull = true; + gd.push([xp.call(this._xaxis, data[i][0]), null]); + } + } + + // don't do smoothing or bands on broken lines. + if (hasNull) { + this.renderer.smooth = false; + if (this._type === 'line') { + bands.show = false; + } + } + + if (this._type === 'line' && bands.show) { + for (var i=0, l=bands.hiData.length; i<l; i++) { + this.renderer._hiBandGridData.push([xp.call(this._xaxis, bands.hiData[i][0]), yp.call(this._yaxis, bands.hiData[i][1])]); + } + for (var i=0, l=bands.lowData.length; i<l; i++) { + this.renderer._lowBandGridData.push([xp.call(this._xaxis, bands.lowData[i][0]), yp.call(this._yaxis, bands.lowData[i][1])]); + } + } + + if (this._type === 'line' && this.renderer.smooth && gd.length > 2) { + var ret; + if (this.renderer.constrainSmoothing) { + ret = computeConstrainedSmoothedData.call(this, gd); + this.renderer._smoothedData = ret[0]; + this.renderer._smoothedPlotData = ret[1]; + + if (bands.show) { + ret = computeConstrainedSmoothedData.call(this, this.renderer._hiBandGridData); + this.renderer._hiBandSmoothedData = ret[0]; + ret = computeConstrainedSmoothedData.call(this, this.renderer._lowBandGridData); + this.renderer._lowBandSmoothedData = ret[0]; + } + + ret = null; + } + else { + ret = computeHermiteSmoothedData.call(this, gd); + this.renderer._smoothedData = ret[0]; + this.renderer._smoothedPlotData = ret[1]; + + if (bands.show) { + ret = computeHermiteSmoothedData.call(this, this.renderer._hiBandGridData); + this.renderer._hiBandSmoothedData = ret[0]; + ret = computeHermiteSmoothedData.call(this, this.renderer._lowBandGridData); + this.renderer._lowBandSmoothedData = ret[0]; + } + + ret = null; + } + } + return gd; + }; + + + // called within scope of series. + $.jqplot.LineRenderer.prototype.draw = function(ctx, gd, options, plot) { + var i; + // get a copy of the options, so we don't modify the original object. + var opts = $.extend(true, {}, options); + var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; + var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine; + var fill = (opts.fill != undefined) ? opts.fill : this.fill; + var fillAndStroke = (opts.fillAndStroke != undefined) ? opts.fillAndStroke : this.fillAndStroke; + var xmin, ymin, xmax, ymax; + ctx.save(); + if (gd.length) { + if (showLine) { + // if we fill, we'll have to add points to close the curve. + if (fill) { + if (this.fillToZero) { + // have to break line up into shapes at axis crossings + var negativeColor = this.negativeColor; + if (! this.useNegativeColors) { + negativeColor = opts.fillStyle; + } + var isnegative = false; + var posfs = opts.fillStyle; + + // if stoking line as well as filling, get a copy of line data. + if (fillAndStroke) { + var fasgd = gd.slice(0); + } + // if not stacked, fill down to axis + if (this.index == 0 || !this._stack) { + + var tempgd = []; + var pd = (this.renderer.smooth) ? this.renderer._smoothedPlotData : this._plotData; + this._areaPoints = []; + var pyzero = this._yaxis.series_u2p(this.fillToValue); + var pxzero = this._xaxis.series_u2p(this.fillToValue); + + opts.closePath = true; + + if (this.fillAxis == 'y') { + tempgd.push([gd[0][0], pyzero]); + this._areaPoints.push([gd[0][0], pyzero]); + + for (var i=0; i<gd.length-1; i++) { + tempgd.push(gd[i]); + this._areaPoints.push(gd[i]); + // do we have an axis crossing? + if (pd[i][1] * pd[i+1][1] <= 0) { + if (pd[i][1] < 0) { + isnegative = true; + opts.fillStyle = negativeColor; + } + else { + isnegative = false; + opts.fillStyle = posfs; + } + + var xintercept = gd[i][0] + (gd[i+1][0] - gd[i][0]) * (pyzero-gd[i][1])/(gd[i+1][1] - gd[i][1]); + tempgd.push([xintercept, pyzero]); + this._areaPoints.push([xintercept, pyzero]); + // now draw this shape and shadow. + if (shadow) { + this.renderer.shadowRenderer.draw(ctx, tempgd, opts); + } + this.renderer.shapeRenderer.draw(ctx, tempgd, opts); + // now empty temp array and continue + tempgd = [[xintercept, pyzero]]; + // this._areaPoints = [[xintercept, pyzero]]; + } + } + if (pd[gd.length-1][1] < 0) { + isnegative = true; + opts.fillStyle = negativeColor; + } + else { + isnegative = false; + opts.fillStyle = posfs; + } + tempgd.push(gd[gd.length-1]); + this._areaPoints.push(gd[gd.length-1]); + tempgd.push([gd[gd.length-1][0], pyzero]); + this._areaPoints.push([gd[gd.length-1][0], pyzero]); + } + // now draw the last area. + if (shadow) { + this.renderer.shadowRenderer.draw(ctx, tempgd, opts); + } + this.renderer.shapeRenderer.draw(ctx, tempgd, opts); + + + // var gridymin = this._yaxis.series_u2p(0); + // // IE doesn't return new length on unshift + // gd.unshift([gd[0][0], gridymin]); + // len = gd.length; + // gd.push([gd[len - 1][0], gridymin]); + } + // if stacked, fill to line below + else { + var prev = this._prevGridData; + for (var i=prev.length; i>0; i--) { + gd.push(prev[i-1]); + // this._areaPoints.push(prev[i-1]); + } + if (shadow) { + this.renderer.shadowRenderer.draw(ctx, gd, opts); + } + this._areaPoints = gd; + this.renderer.shapeRenderer.draw(ctx, gd, opts); + } + } + ///////////////////////// + // Not filled to zero + //////////////////////// + else { + // if stoking line as well as filling, get a copy of line data. + if (fillAndStroke) { + var fasgd = gd.slice(0); + } + // if not stacked, fill down to axis + if (this.index == 0 || !this._stack) { + // var gridymin = this._yaxis.series_u2p(this._yaxis.min) - this.gridBorderWidth / 2; + var gridymin = ctx.canvas.height; + // IE doesn't return new length on unshift + gd.unshift([gd[0][0], gridymin]); + var len = gd.length; + gd.push([gd[len - 1][0], gridymin]); + } + // if stacked, fill to line below + else { + var prev = this._prevGridData; + for (var i=prev.length; i>0; i--) { + gd.push(prev[i-1]); + } + } + this._areaPoints = gd; + + if (shadow) { + this.renderer.shadowRenderer.draw(ctx, gd, opts); + } + + this.renderer.shapeRenderer.draw(ctx, gd, opts); + } + if (fillAndStroke) { + var fasopts = $.extend(true, {}, opts, {fill:false, closePath:false}); + this.renderer.shapeRenderer.draw(ctx, fasgd, fasopts); + ////////// + // TODO: figure out some way to do shadows nicely + // if (shadow) { + // this.renderer.shadowRenderer.draw(ctx, fasgd, fasopts); + // } + // now draw the markers + if (this.markerRenderer.show) { + if (this.renderer.smooth) { + fasgd = this.gridData; + } + for (i=0; i<fasgd.length; i++) { + this.markerRenderer.draw(fasgd[i][0], fasgd[i][1], ctx, opts.markerOptions); + } + } + } + } + else { + + if (this.renderer.bands.show) { + var bdat; + var bopts = $.extend(true, {}, opts); + if (this.renderer.bands.showLines) { + bdat = (this.renderer.smooth) ? this.renderer._hiBandSmoothedData : this.renderer._hiBandGridData; + this.renderer.shapeRenderer.draw(ctx, bdat, opts); + bdat = (this.renderer.smooth) ? this.renderer._lowBandSmoothedData : this.renderer._lowBandGridData; + this.renderer.shapeRenderer.draw(ctx, bdat, bopts); + } + + if (this.renderer.bands.fill) { + if (this.renderer.smooth) { + bdat = this.renderer._hiBandSmoothedData.concat(this.renderer._lowBandSmoothedData.reverse()); + } + else { + bdat = this.renderer._hiBandGridData.concat(this.renderer._lowBandGridData.reverse()); + } + this._areaPoints = bdat; + bopts.closePath = true; + bopts.fill = true; + bopts.fillStyle = this.renderer.bands.fillColor; + this.renderer.shapeRenderer.draw(ctx, bdat, bopts); + } + } + + if (shadow) { + this.renderer.shadowRenderer.draw(ctx, gd, opts); + } + + this.renderer.shapeRenderer.draw(ctx, gd, opts); + } + } + // calculate the bounding box + var xmin = xmax = ymin = ymax = null; + for (i=0; i<this._areaPoints.length; i++) { + var p = this._areaPoints[i]; + if (xmin > p[0] || xmin == null) { + xmin = p[0]; + } + if (ymax < p[1] || ymax == null) { + ymax = p[1]; + } + if (xmax < p[0] || xmax == null) { + xmax = p[0]; + } + if (ymin > p[1] || ymin == null) { + ymin = p[1]; + } + } + + if (this.type === 'line' && this.renderer.bands.show) { + ymax = this._yaxis.series_u2p(this.renderer.bands._min); + ymin = this._yaxis.series_u2p(this.renderer.bands._max); + } + + this._boundingBox = [[xmin, ymax], [xmax, ymin]]; + + // now draw the markers + if (this.markerRenderer.show && !fill) { + if (this.renderer.smooth) { + gd = this.gridData; + } + for (i=0; i<gd.length; i++) { + if (gd[i][0] != null && gd[i][1] != null) { + this.markerRenderer.draw(gd[i][0], gd[i][1], ctx, opts.markerOptions); + } + } + } + } + + ctx.restore(); + }; + + $.jqplot.LineRenderer.prototype.drawShadow = function(ctx, gd, options) { + // This is a no-op, shadows drawn with lines. + }; + + // called with scope of plot. + // make sure to not leave anything highlighted. + function postInit(target, data, options) { + for (var i=0; i<this.series.length; i++) { + if (this.series[i].renderer.constructor == $.jqplot.LineRenderer) { + // don't allow mouseover and mousedown at same time. + if (this.series[i].highlightMouseOver) { + this.series[i].highlightMouseDown = false; + } + } + } + } + + // called within context of plot + // create a canvas which we can draw on. + // insert it before the eventCanvas, so eventCanvas will still capture events. + function postPlotDraw() { + // Memory Leaks patch + if (this.plugins.lineRenderer && this.plugins.lineRenderer.highlightCanvas) { + this.plugins.lineRenderer.highlightCanvas.resetCanvas(); + this.plugins.lineRenderer.highlightCanvas = null; + } + + this.plugins.lineRenderer.highlightedSeriesIndex = null; + this.plugins.lineRenderer.highlightCanvas = new $.jqplot.GenericCanvas(); + + this.eventCanvas._elem.before(this.plugins.lineRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-lineRenderer-highlight-canvas', this._plotDimensions, this)); + this.plugins.lineRenderer.highlightCanvas.setContext(); + this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); }); + } + + function highlight (plot, sidx, pidx, points) { + var s = plot.series[sidx]; + var canvas = plot.plugins.lineRenderer.highlightCanvas; + canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height); + s._highlightedPoint = pidx; + plot.plugins.lineRenderer.highlightedSeriesIndex = sidx; + var opts = {fillStyle: s.highlightColor}; + if (s.type === 'line' && s.renderer.bands.show) { + opts.fill = true; + opts.closePath = true; + } + s.renderer.shapeRenderer.draw(canvas._ctx, points, opts); + canvas = null; + } + + function unhighlight (plot) { + var canvas = plot.plugins.lineRenderer.highlightCanvas; + canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height); + for (var i=0; i<plot.series.length; i++) { + plot.series[i]._highlightedPoint = null; + } + plot.plugins.lineRenderer.highlightedSeriesIndex = null; + plot.target.trigger('jqplotDataUnhighlight'); + canvas = null; + } + + + function handleMove(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var evt1 = jQuery.Event('jqplotDataMouseOver'); + evt1.pageX = ev.pageX; + evt1.pageY = ev.pageY; + plot.target.trigger(evt1, ins); + if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.lineRenderer.highlightedSeriesIndex)) { + var evt = jQuery.Event('jqplotDataHighlight'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points); + } + } + else if (neighbor == null) { + unhighlight (plot); + } + } + + function handleMouseDown(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.lineRenderer.highlightedSeriesIndex)) { + var evt = jQuery.Event('jqplotDataHighlight'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points); + } + } + else if (neighbor == null) { + unhighlight (plot); + } + } + + function handleMouseUp(ev, gridpos, datapos, neighbor, plot) { + var idx = plot.plugins.lineRenderer.highlightedSeriesIndex; + if (idx != null && plot.series[idx].highlightMouseDown) { + unhighlight(plot); + } + } + + function handleClick(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var evt = jQuery.Event('jqplotDataClick'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + } + } + + function handleRightClick(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var idx = plot.plugins.lineRenderer.highlightedSeriesIndex; + if (idx != null && plot.series[idx].highlightMouseDown) { + unhighlight(plot); + } + var evt = jQuery.Event('jqplotDataRightClick'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + } + } + + + // class: $.jqplot.LinearAxisRenderer + // The default jqPlot axis renderer, creating a numeric axis. + $.jqplot.LinearAxisRenderer = function() { + }; + + // called with scope of axis object. + $.jqplot.LinearAxisRenderer.prototype.init = function(options){ + // prop: breakPoints + // EXPERIMENTAL!! Use at your own risk! + // Works only with linear axes and the default tick renderer. + // Array of [start, stop] points to create a broken axis. + // Broken axes have a "jump" in them, which is an immediate + // transition from a smaller value to a larger value. + // Currently, axis ticks MUST be manually assigned if using breakPoints + // by using the axis ticks array option. + this.breakPoints = null; + // prop: breakTickLabel + // Label to use at the axis break if breakPoints are specified. + this.breakTickLabel = "≈"; + // prop: drawBaseline + // True to draw the axis baseline. + this.drawBaseline = true; + // prop: baselineWidth + // width of the baseline in pixels. + this.baselineWidth = null; + // prop: baselineColor + // CSS color spec for the baseline. + this.baselineColor = null; + // prop: forceTickAt0 + // This will ensure that there is always a tick mark at 0. + // If data range is strictly positive or negative, + // this will force 0 to be inside the axis bounds unless + // the appropriate axis pad (pad, padMin or padMax) is set + // to 0, then this will force an axis min or max value at 0. + // This has know effect when any of the following options + // are set: autoscale, min, max, numberTicks or tickInterval. + this.forceTickAt0 = false; + // prop: forceTickAt100 + // This will ensure that there is always a tick mark at 100. + // If data range is strictly above or below 100, + // this will force 100 to be inside the axis bounds unless + // the appropriate axis pad (pad, padMin or padMax) is set + // to 0, then this will force an axis min or max value at 100. + // This has know effect when any of the following options + // are set: autoscale, min, max, numberTicks or tickInterval. + this.forceTickAt100 = false; + // prop: tickInset + // Controls the amount to inset the first and last ticks from + // the edges of the grid, in multiples of the tick interval. + // 0 is no inset, 0.5 is one half a tick interval, 1 is a full + // tick interval, etc. + this.tickInset = 0; + // prop: minorTicks + // Number of ticks to add between "major" ticks. + // Major ticks are ticks supplied by user or auto computed. + // Minor ticks cannot be created by user. + this.minorTicks = 0; + // prop: alignTicks + // true to align tick marks across opposed axes + // such as from the y2axis to yaxis. + this.alignTicks = false; + this._autoFormatString = ''; + this._overrideFormatString = false; + this._scalefact = 1.0; + $.extend(true, this, options); + if (this.breakPoints) { + if (!$.isArray(this.breakPoints)) { + this.breakPoints = null; + } + else if (this.breakPoints.length < 2 || this.breakPoints[1] <= this.breakPoints[0]) { + this.breakPoints = null; + } + } + if (this.numberTicks != null && this.numberTicks < 2) { + this.numberTicks = 2; + } + this.resetDataBounds(); + }; + + // called with scope of axis + $.jqplot.LinearAxisRenderer.prototype.draw = function(ctx, plot) { + if (this.show) { + // populate the axis label and value properties. + // createTicks is a method on the renderer, but + // call it within the scope of the axis. + this.renderer.createTicks.call(this, plot); + // fill a div with axes labels in the right direction. + // Need to pregenerate each axis to get its bounds and + // position it and the labels correctly on the plot. + var dim=0; + var temp; + // Added for theming. + if (this._elem) { + // Memory Leaks patch + //this._elem.empty(); + this._elem.emptyForce(); + this._elem = null; + } + + this._elem = $(document.createElement('div')); + this._elem.addClass('jqplot-axis jqplot-'+this.name); + this._elem.css('position', 'absolute'); + + + if (this.name == 'xaxis' || this.name == 'x2axis') { + this._elem.width(this._plotDimensions.width); + } + else { + this._elem.height(this._plotDimensions.height); + } + + // create a _label object. + this.labelOptions.axis = this.name; + this._label = new this.labelRenderer(this.labelOptions); + if (this._label.show) { + var elem = this._label.draw(ctx, plot); + elem.appendTo(this._elem); + elem = null; + } + + var t = this._ticks; + var tick; + for (var i=0; i<t.length; i++) { + tick = t[i]; + if (tick.show && tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) { + this._elem.append(tick.draw(ctx, plot)); + } + } + tick = null; + t = null; + } + return this._elem; + }; + + // called with scope of an axis + $.jqplot.LinearAxisRenderer.prototype.reset = function() { + this.min = this._options.min; + this.max = this._options.max; + this.tickInterval = this._options.tickInterval; + this.numberTicks = this._options.numberTicks; + this._autoFormatString = ''; + if (this._overrideFormatString && this.tickOptions && this.tickOptions.formatString) { + this.tickOptions.formatString = ''; + } + + // this._ticks = this.__ticks; + }; + + // called with scope of axis + $.jqplot.LinearAxisRenderer.prototype.set = function() { + var dim = 0; + var temp; + var w = 0; + var h = 0; + var lshow = (this._label == null) ? false : this._label.show; + if (this.show) { + var t = this._ticks; + var tick; + for (var i=0; i<t.length; i++) { + tick = t[i]; + if (!tick._breakTick && tick.show && tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + temp = tick._elem.outerHeight(true); + } + else { + temp = tick._elem.outerWidth(true); + } + if (temp > dim) { + dim = temp; + } + } + } + tick = null; + t = null; + + if (lshow) { + w = this._label._elem.outerWidth(true); + h = this._label._elem.outerHeight(true); + } + if (this.name == 'xaxis') { + dim = dim + h; + this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'}); + } + else if (this.name == 'x2axis') { + dim = dim + h; + this._elem.css({'height':dim+'px', left:'0px', top:'0px'}); + } + else if (this.name == 'yaxis') { + dim = dim + w; + this._elem.css({'width':dim+'px', left:'0px', top:'0px'}); + if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) { + this._label._elem.css('width', w+'px'); + } + } + else { + dim = dim + w; + this._elem.css({'width':dim+'px', right:'0px', top:'0px'}); + if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) { + this._label._elem.css('width', w+'px'); + } + } + } + }; + + // called with scope of axis + $.jqplot.LinearAxisRenderer.prototype.createTicks = function(plot) { + // we're are operating on an axis here + var ticks = this._ticks; + var userTicks = this.ticks; + var name = this.name; + // databounds were set on axis initialization. + var db = this._dataBounds; + var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height; + var interval; + var min, max; + var pos1, pos2; + var tt, i; + // get a copy of user's settings for min/max. + var userMin = this.min; + var userMax = this.max; + var userNT = this.numberTicks; + var userTI = this.tickInterval; + + var threshold = 30; + this._scalefact = (Math.max(dim, threshold+1) - threshold)/300.0; + + // if we already have ticks, use them. + // ticks must be in order of increasing value. + + if (userTicks.length) { + // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed + for (i=0; i<userTicks.length; i++){ + var ut = userTicks[i]; + var t = new this.tickRenderer(this.tickOptions); + if ($.isArray(ut)) { + t.value = ut[0]; + if (this.breakPoints) { + if (ut[0] == this.breakPoints[0]) { + t.label = this.breakTickLabel; + t._breakTick = true; + t.showGridline = false; + t.showMark = false; + } + else if (ut[0] > this.breakPoints[0] && ut[0] <= this.breakPoints[1]) { + t.show = false; + t.showGridline = false; + t.label = ut[1]; + } + else { + t.label = ut[1]; + } + } + else { + t.label = ut[1]; + } + t.setTick(ut[0], this.name); + this._ticks.push(t); + } + + else if ($.isPlainObject(ut)) { + $.extend(true, t, ut); + t.axis = this.name; + this._ticks.push(t); + } + + else { + t.value = ut; + if (this.breakPoints) { + if (ut == this.breakPoints[0]) { + t.label = this.breakTickLabel; + t._breakTick = true; + t.showGridline = false; + t.showMark = false; + } + else if (ut > this.breakPoints[0] && ut <= this.breakPoints[1]) { + t.show = false; + t.showGridline = false; + } + } + t.setTick(ut, this.name); + this._ticks.push(t); + } + } + this.numberTicks = userTicks.length; + this.min = this._ticks[0].value; + this.max = this._ticks[this.numberTicks-1].value; + this.tickInterval = (this.max - this.min) / (this.numberTicks - 1); + } + + // we don't have any ticks yet, let's make some! + else { + if (name == 'xaxis' || name == 'x2axis') { + dim = this._plotDimensions.width; + } + else { + dim = this._plotDimensions.height; + } + + var _numberTicks = this.numberTicks; + + // if aligning this axis, use number of ticks from previous axis. + // Do I need to reset somehow if alignTicks is changed and then graph is replotted?? + if (this.alignTicks) { + if (this.name === 'x2axis' && plot.axes.xaxis.show) { + _numberTicks = plot.axes.xaxis.numberTicks; + } + else if (this.name.charAt(0) === 'y' && this.name !== 'yaxis' && this.name !== 'yMidAxis' && plot.axes.yaxis.show) { + _numberTicks = plot.axes.yaxis.numberTicks; + } + } + + min = ((this.min != null) ? this.min : db.min); + max = ((this.max != null) ? this.max : db.max); + + var range = max - min; + var rmin, rmax; + var temp; + + if (this.tickOptions == null || !this.tickOptions.formatString) { + this._overrideFormatString = true; + } + + // Doing complete autoscaling + if (this.min == null || this.max == null && this.tickInterval == null && !this.autoscale) { + // Check if user must have tick at 0 or 100 and ensure they are in range. + // The autoscaling algorithm will always place ticks at 0 and 100 if they are in range. + if (this.forceTickAt0) { + if (min > 0) { + min = 0; + } + if (max < 0) { + max = 0; + } + } + + if (this.forceTickAt100) { + if (min > 100) { + min = 100; + } + if (max < 100) { + max = 100; + } + } + + var keepMin = false, + keepMax = false; + + if (this.min != null) { + keepMin = true; + } + + else if (this.max != null) { + keepMax = true; + } + + // var threshold = 30; + // var tdim = Math.max(dim, threshold+1); + // this._scalefact = (tdim-threshold)/300.0; + var ret = $.jqplot.LinearTickGenerator(min, max, this._scalefact, _numberTicks, keepMin, keepMax); + // calculate a padded max and min, points should be less than these + // so that they aren't too close to the edges of the plot. + // User can adjust how much padding is allowed with pad, padMin and PadMax options. + // If min or max is set, don't pad that end of axis. + var tumin = (this.min != null) ? min : min + range*(this.padMin - 1); + var tumax = (this.max != null) ? max : max - range*(this.padMax - 1); + + // if they're equal, we shouldn't have to do anything, right? + // if (min <=tumin || max >= tumax) { + if (min <tumin || max > tumax) { + tumin = (this.min != null) ? min : min - range*(this.padMin - 1); + tumax = (this.max != null) ? max : max + range*(this.padMax - 1); + ret = $.jqplot.LinearTickGenerator(tumin, tumax, this._scalefact, _numberTicks, keepMin, keepMax); + } + + this.min = ret[0]; + this.max = ret[1]; + // if numberTicks specified, it should return the same. + this.numberTicks = ret[2]; + this._autoFormatString = ret[3]; + this.tickInterval = ret[4]; + } + + // User has specified some axis scale related option, can use auto algorithm + else { + + // if min and max are same, space them out a bit + if (min == max) { + var adj = 0.05; + if (min > 0) { + adj = Math.max(Math.log(min)/Math.LN10, 0.05); + } + min -= adj; + max += adj; + } + + // autoscale. Can't autoscale if min or max is supplied. + // Will use numberTicks and tickInterval if supplied. Ticks + // across multiple axes may not line up depending on how + // bars are to be plotted. + if (this.autoscale && this.min == null && this.max == null) { + var rrange, ti, margin; + var forceMinZero = false; + var forceZeroLine = false; + var intervals = {min:null, max:null, average:null, stddev:null}; + // if any series are bars, or if any are fill to zero, and if this + // is the axis to fill toward, check to see if we can start axis at zero. + for (var i=0; i<this._series.length; i++) { + var s = this._series[i]; + var faname = (s.fillAxis == 'x') ? s._xaxis.name : s._yaxis.name; + // check to see if this is the fill axis + if (this.name == faname) { + var vals = s._plotValues[s.fillAxis]; + var vmin = vals[0]; + var vmax = vals[0]; + for (var j=1; j<vals.length; j++) { + if (vals[j] < vmin) { + vmin = vals[j]; + } + else if (vals[j] > vmax) { + vmax = vals[j]; + } + } + var dp = (vmax - vmin) / vmax; + // is this sries a bar? + if (s.renderer.constructor == $.jqplot.BarRenderer) { + // if no negative values and could also check range. + if (vmin >= 0 && (s.fillToZero || dp > 0.1)) { + forceMinZero = true; + } + else { + forceMinZero = false; + if (s.fill && s.fillToZero && vmin < 0 && vmax > 0) { + forceZeroLine = true; + } + else { + forceZeroLine = false; + } + } + } + + // if not a bar and filling, use appropriate method. + else if (s.fill) { + if (vmin >= 0 && (s.fillToZero || dp > 0.1)) { + forceMinZero = true; + } + else if (vmin < 0 && vmax > 0 && s.fillToZero) { + forceMinZero = false; + forceZeroLine = true; + } + else { + forceMinZero = false; + forceZeroLine = false; + } + } + + // if not a bar and not filling, only change existing state + // if it doesn't make sense + else if (vmin < 0) { + forceMinZero = false; + } + } + } + + // check if we need make axis min at 0. + if (forceMinZero) { + // compute number of ticks + this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing); + this.min = 0; + userMin = 0; + // what order is this range? + // what tick interval does that give us? + ti = max/(this.numberTicks-1); + temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10))); + if (ti/temp == parseInt(ti/temp, 10)) { + ti += temp; + } + this.tickInterval = Math.ceil(ti/temp) * temp; + this.max = this.tickInterval * (this.numberTicks - 1); + } + + // check if we need to make sure there is a tick at 0. + else if (forceZeroLine) { + // compute number of ticks + this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing); + var ntmin = Math.ceil(Math.abs(min)/range*(this.numberTicks-1)); + var ntmax = this.numberTicks - 1 - ntmin; + ti = Math.max(Math.abs(min/ntmin), Math.abs(max/ntmax)); + temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10))); + this.tickInterval = Math.ceil(ti/temp) * temp; + this.max = this.tickInterval * ntmax; + this.min = -this.tickInterval * ntmin; + } + + // if nothing else, do autoscaling which will try to line up ticks across axes. + else { + if (this.numberTicks == null){ + if (this.tickInterval) { + this.numberTicks = 3 + Math.ceil(range / this.tickInterval); + } + else { + this.numberTicks = 2 + Math.ceil((dim-(this.tickSpacing-1))/this.tickSpacing); + } + } + + if (this.tickInterval == null) { + // get a tick interval + ti = range/(this.numberTicks - 1); + + if (ti < 1) { + temp = Math.pow(10, Math.abs(Math.floor(Math.log(ti)/Math.LN10))); + } + else { + temp = 1; + } + this.tickInterval = Math.ceil(ti*temp*this.pad)/temp; + } + else { + temp = 1 / this.tickInterval; + } + + // try to compute a nicer, more even tick interval + // temp = Math.pow(10, Math.floor(Math.log(ti)/Math.LN10)); + // this.tickInterval = Math.ceil(ti/temp) * temp; + rrange = this.tickInterval * (this.numberTicks - 1); + margin = (rrange - range)/2; + + if (this.min == null) { + this.min = Math.floor(temp*(min-margin))/temp; + } + if (this.max == null) { + this.max = this.min + rrange; + } + } + + // Compute a somewhat decent format string if it is needed. + // get precision of interval and determine a format string. + var sf = $.jqplot.getSignificantFigures(this.tickInterval); + + var fstr; + + // if we have only a whole number, use integer formatting + if (sf.digitsLeft >= sf.significantDigits) { + fstr = '%d'; + } + + else { + var temp = Math.max(0, 5 - sf.digitsLeft); + temp = Math.min(temp, sf.digitsRight); + fstr = '%.'+ temp + 'f'; + } + + this._autoFormatString = fstr; + } + + // Use the default algorithm which pads each axis to make the chart + // centered nicely on the grid. + else { + + rmin = (this.min != null) ? this.min : min - range*(this.padMin - 1); + rmax = (this.max != null) ? this.max : max + range*(this.padMax - 1); + range = rmax - rmin; + + if (this.numberTicks == null){ + // if tickInterval is specified by user, we will ignore computed maximum. + // max will be equal or greater to fit even # of ticks. + if (this.tickInterval != null) { + this.numberTicks = Math.ceil((rmax - rmin)/this.tickInterval)+1; + } + else if (dim > 100) { + this.numberTicks = parseInt(3+(dim-100)/75, 10); + } + else { + this.numberTicks = 2; + } + } + + if (this.tickInterval == null) { + this.tickInterval = range / (this.numberTicks-1); + } + + if (this.max == null) { + rmax = rmin + this.tickInterval*(this.numberTicks - 1); + } + if (this.min == null) { + rmin = rmax - this.tickInterval*(this.numberTicks - 1); + } + + // get precision of interval and determine a format string. + var sf = $.jqplot.getSignificantFigures(this.tickInterval); + + var fstr; + + // if we have only a whole number, use integer formatting + if (sf.digitsLeft >= sf.significantDigits) { + fstr = '%d'; + } + + else { + var temp = Math.max(0, 5 - sf.digitsLeft); + temp = Math.min(temp, sf.digitsRight); + fstr = '%.'+ temp + 'f'; + } + + + this._autoFormatString = fstr; + + this.min = rmin; + this.max = rmax; + } + + if (this.renderer.constructor == $.jqplot.LinearAxisRenderer && this._autoFormatString == '') { + // fix for misleading tick display with small range and low precision. + range = this.max - this.min; + // figure out precision + var temptick = new this.tickRenderer(this.tickOptions); + // use the tick formatString or, the default. + var fs = temptick.formatString || $.jqplot.config.defaultTickFormatString; + var fs = fs.match($.jqplot.sprintf.regex)[0]; + var precision = 0; + if (fs) { + if (fs.search(/[fFeEgGpP]/) > -1) { + var m = fs.match(/\%\.(\d{0,})?[eEfFgGpP]/); + if (m) { + precision = parseInt(m[1], 10); + } + else { + precision = 6; + } + } + else if (fs.search(/[di]/) > -1) { + precision = 0; + } + // fact will be <= 1; + var fact = Math.pow(10, -precision); + if (this.tickInterval < fact) { + // need to correct underrange + if (userNT == null && userTI == null) { + this.tickInterval = fact; + if (userMax == null && userMin == null) { + // this.min = Math.floor((this._dataBounds.min - this.tickInterval)/fact) * fact; + this.min = Math.floor(this._dataBounds.min/fact) * fact; + if (this.min == this._dataBounds.min) { + this.min = this._dataBounds.min - this.tickInterval; + } + // this.max = Math.ceil((this._dataBounds.max + this.tickInterval)/fact) * fact; + this.max = Math.ceil(this._dataBounds.max/fact) * fact; + if (this.max == this._dataBounds.max) { + this.max = this._dataBounds.max + this.tickInterval; + } + var n = (this.max - this.min)/this.tickInterval; + n = n.toFixed(11); + n = Math.ceil(n); + this.numberTicks = n + 1; + } + else if (userMax == null) { + // add one tick for top of range. + var n = (this._dataBounds.max - this.min) / this.tickInterval; + n = n.toFixed(11); + this.numberTicks = Math.ceil(n) + 2; + this.max = this.min + this.tickInterval * (this.numberTicks-1); + } + else if (userMin == null) { + // add one tick for bottom of range. + var n = (this.max - this._dataBounds.min) / this.tickInterval; + n = n.toFixed(11); + this.numberTicks = Math.ceil(n) + 2; + this.min = this.max - this.tickInterval * (this.numberTicks-1); + } + else { + // calculate a number of ticks so max is within axis scale + this.numberTicks = Math.ceil((userMax - userMin)/this.tickInterval) + 1; + // if user's min and max don't fit evenly in ticks, adjust. + // This takes care of cases such as user min set to 0, max set to 3.5 but tick + // format string set to %d (integer ticks) + this.min = Math.floor(userMin*Math.pow(10, precision))/Math.pow(10, precision); + this.max = Math.ceil(userMax*Math.pow(10, precision))/Math.pow(10, precision); + // this.max = this.min + this.tickInterval*(this.numberTicks-1); + this.numberTicks = Math.ceil((this.max - this.min)/this.tickInterval) + 1; + } + } + } + } + } + + } + + if (this._overrideFormatString && this._autoFormatString != '') { + this.tickOptions = this.tickOptions || {}; + this.tickOptions.formatString = this._autoFormatString; + } + + var t, to; + for (var i=0; i<this.numberTicks; i++){ + tt = this.min + i * this.tickInterval; + t = new this.tickRenderer(this.tickOptions); + // var t = new $.jqplot.AxisTickRenderer(this.tickOptions); + + t.setTick(tt, this.name); + this._ticks.push(t); + + if (i < this.numberTicks - 1) { + for (var j=0; j<this.minorTicks; j++) { + tt += this.tickInterval/(this.minorTicks+1); + to = $.extend(true, {}, this.tickOptions, {name:this.name, value:tt, label:'', isMinorTick:true}); + t = new this.tickRenderer(to); + this._ticks.push(t); + } + } + t = null; + } + } + + if (this.tickInset) { + this.min = this.min - this.tickInset * this.tickInterval; + this.max = this.max + this.tickInset * this.tickInterval; + } + + ticks = null; + }; + + // Used to reset just the values of the ticks and then repack, which will + // recalculate the positioning functions. It is assuemd that the + // number of ticks is the same and the values of the new array are at the + // proper interval. + // This method needs to be called with the scope of an axis object, like: + // + // > plot.axes.yaxis.renderer.resetTickValues.call(plot.axes.yaxis, yarr); + // + $.jqplot.LinearAxisRenderer.prototype.resetTickValues = function(opts) { + if ($.isArray(opts) && opts.length == this._ticks.length) { + var t; + for (var i=0; i<opts.length; i++) { + t = this._ticks[i]; + t.value = opts[i]; + t.label = t.formatter(t.formatString, opts[i]); + t.label = t.prefix + t.label; + t._elem.html(t.label); + } + t = null; + this.min = $.jqplot.arrayMin(opts); + this.max = $.jqplot.arrayMax(opts); + this.pack(); + } + // Not implemented yet. + // else if ($.isPlainObject(opts)) { + // + // } + }; + + // called with scope of axis + $.jqplot.LinearAxisRenderer.prototype.pack = function(pos, offsets) { + // Add defaults for repacking from resetTickValues function. + pos = pos || {}; + offsets = offsets || this._offsets; + + var ticks = this._ticks; + var max = this.max; + var min = this.min; + var offmax = offsets.max; + var offmin = offsets.min; + var lshow = (this._label == null) ? false : this._label.show; + + for (var p in pos) { + this._elem.css(p, pos[p]); + } + + this._offsets = offsets; + // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left. + var pixellength = offmax - offmin; + var unitlength = max - min; + + // point to unit and unit to point conversions references to Plot DOM element top left corner. + if (this.breakPoints) { + unitlength = unitlength - this.breakPoints[1] + this.breakPoints[0]; + + this.p2u = function(p){ + return (p - offmin) * unitlength / pixellength + min; + }; + + this.u2p = function(u){ + if (u > this.breakPoints[0] && u < this.breakPoints[1]){ + u = this.breakPoints[0]; + } + if (u <= this.breakPoints[0]) { + return (u - min) * pixellength / unitlength + offmin; + } + else { + return (u - this.breakPoints[1] + this.breakPoints[0] - min) * pixellength / unitlength + offmin; + } + }; + + if (this.name.charAt(0) == 'x'){ + this.series_u2p = function(u){ + if (u > this.breakPoints[0] && u < this.breakPoints[1]){ + u = this.breakPoints[0]; + } + if (u <= this.breakPoints[0]) { + return (u - min) * pixellength / unitlength; + } + else { + return (u - this.breakPoints[1] + this.breakPoints[0] - min) * pixellength / unitlength; + } + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + min; + }; + } + + else { + this.series_u2p = function(u){ + if (u > this.breakPoints[0] && u < this.breakPoints[1]){ + u = this.breakPoints[0]; + } + if (u >= this.breakPoints[1]) { + return (u - max) * pixellength / unitlength; + } + else { + return (u + this.breakPoints[1] - this.breakPoints[0] - max) * pixellength / unitlength; + } + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + max; + }; + } + } + else { + this.p2u = function(p){ + return (p - offmin) * unitlength / pixellength + min; + }; + + this.u2p = function(u){ + return (u - min) * pixellength / unitlength + offmin; + }; + + if (this.name == 'xaxis' || this.name == 'x2axis'){ + this.series_u2p = function(u){ + return (u - min) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + min; + }; + } + + else { + this.series_u2p = function(u){ + return (u - max) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + max; + }; + } + } + + if (this.show) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + for (var i=0; i<ticks.length; i++) { + var t = ticks[i]; + if (t.show && t.showLabel) { + var shim; + + if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) { + // will need to adjust auto positioning based on which axis this is. + var temp = (this.name == 'xaxis') ? 1 : -1; + switch (t.labelPosition) { + case 'auto': + // position at end + if (temp * t.angle < 0) { + shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + } + // position at start + else { + shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2; + } + break; + case 'end': + shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + break; + case 'start': + shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2; + break; + case 'middle': + shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + break; + default: + shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + break; + } + } + else { + shim = -t.getWidth()/2; + } + var val = this.u2p(t.value) + shim + 'px'; + t._elem.css('left', val); + t.pack(); + } + } + if (lshow) { + var w = this._label._elem.outerWidth(true); + this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px'); + if (this.name == 'xaxis') { + this._label._elem.css('bottom', '0px'); + } + else { + this._label._elem.css('top', '0px'); + } + this._label.pack(); + } + } + else { + for (var i=0; i<ticks.length; i++) { + var t = ticks[i]; + if (t.show && t.showLabel) { + var shim; + if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) { + // will need to adjust auto positioning based on which axis this is. + var temp = (this.name == 'yaxis') ? 1 : -1; + switch (t.labelPosition) { + case 'auto': + // position at end + case 'end': + if (temp * t.angle < 0) { + shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2; + } + else { + shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2; + } + break; + case 'start': + if (t.angle > 0) { + shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2; + } + else { + shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2; + } + break; + case 'middle': + // if (t.angle > 0) { + // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + // } + // else { + // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2; + // } + shim = -t.getHeight()/2; + break; + default: + shim = -t.getHeight()/2; + break; + } + } + else { + shim = -t.getHeight()/2; + } + + var val = this.u2p(t.value) + shim + 'px'; + t._elem.css('top', val); + t.pack(); + } + } + if (lshow) { + var h = this._label._elem.outerHeight(true); + this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px'); + if (this.name == 'yaxis') { + this._label._elem.css('left', '0px'); + } + else { + this._label._elem.css('right', '0px'); + } + this._label.pack(); + } + } + } + + ticks = null; + }; + + + /** + * The following code was generaously given to me a while back by Scott Prahl. + * He did a good job at computing axes min, max and number of ticks for the + * case where the user has not set any scale related parameters (tickInterval, + * numberTicks, min or max). I had ignored this use case for a long time, + * focusing on the more difficult case where user has set some option controlling + * tick generation. Anyway, about time I got this into jqPlot. + * Thanks Scott!! + */ + + /** + * Copyright (c) 2010 Scott Prahl + * The next three routines are currently available for use in all personal + * or commercial projects under both the MIT and GPL version 2.0 licenses. + * This means that you can choose the license that best suits your project + * and use it accordingly. + */ + + // A good format string depends on the interval. If the interval is greater + // than 1 then there is no need to show any decimal digits. If it is < 1.0, then + // use the magnitude of the interval to determine the number of digits to show. + function bestFormatString (interval) + { + var fstr; + interval = Math.abs(interval); + if (interval >= 10) { + fstr = '%d'; + } + + else if (interval > 1) { + if (interval === parseInt(interval, 10)) { + fstr = '%d'; + } + else { + fstr = '%.1f'; + } + } + + else { + var expv = -Math.floor(Math.log(interval)/Math.LN10); + fstr = '%.' + expv + 'f'; + } + + return fstr; + } + + var _factors = [0.1, 0.2, 0.3, 0.4, 0.5, 0.8, 1, 2, 3, 4, 5]; + + var _getLowerFactor = function(f) { + var i = _factors.indexOf(f); + if (i > 0) { + return _factors[i-1]; + } + else { + return _factors[_factors.length - 1] / 100; + } + }; + + var _getHigherFactor = function(f) { + var i = _factors.indexOf(f); + if (i < _factors.length-1) { + return _factors[i+1]; + } + else { + return _factors[0] * 100; + } + }; + + // Given a fixed minimum and maximum and a target number ot ticks + // figure out the best interval and + // return min, max, number ticks, format string and tick interval + function bestConstrainedInterval(min, max, nttarget) { + // run through possible number to ticks and see which interval is best + var low = Math.floor(nttarget/2); + var hi = Math.ceil(nttarget*1.5); + var badness = Number.MAX_VALUE; + var r = (max - min); + var temp; + var sd; + var bestNT; + var gsf = $.jqplot.getSignificantFigures; + var fsd; + var fs; + var currentNT; + var bestPrec; + + for (var i=0, l=hi-low+1; i<l; i++) { + currentNT = low + i; + temp = r/(currentNT-1); + sd = gsf(temp); + + temp = Math.abs(nttarget - currentNT) + sd.digitsRight; + if (temp < badness) { + badness = temp; + bestNT = currentNT; + bestPrec = sd.digitsRight; + } + else if (temp === badness) { + // let nicer ticks trump number ot ticks + if (sd.digitsRight < bestPrec) { + bestNT = currentNT; + bestPrec = sd.digitsRight; + } + } + + } + + fsd = Math.max(bestPrec, Math.max(gsf(min).digitsRight, gsf(max).digitsRight)); + if (fsd === 0) { + fs = '%d'; + } + else { + fs = '%.' + fsd + 'f'; + } + temp = r / (bestNT - 1); + // min, max, number ticks, format string, tick interval + return [min, max, bestNT, fs, temp]; + } + + // This will return an interval of form 2 * 10^n, 5 * 10^n or 10 * 10^n + // it is based soley on the range and number of ticks. So if user specifies + // number of ticks, use this. + function bestInterval(range, numberTicks) { + numberTicks = numberTicks || 7; + var minimum = range / (numberTicks - 1); + var magnitude = Math.pow(10, Math.floor(Math.log(minimum) / Math.LN10)); + var residual = minimum / magnitude; + var interval; + // "nicest" ranges are 1, 2, 5 or powers of these. + // for magnitudes below 1, only allow these. + if (magnitude < 1) { + if (residual > 5) { + interval = 10 * magnitude; + } + else if (residual > 2) { + interval = 5 * magnitude; + } + else if (residual > 1) { + interval = 2 * magnitude; + } + else { + interval = magnitude; + } + } + // for large ranges (whole integers), allow intervals like 3, 4 or powers of these. + // this helps a lot with poor choices for number of ticks. + else { + if (residual > 5) { + interval = 10 * magnitude; + } + else if (residual > 4) { + interval = 5 * magnitude; + } + else if (residual > 3) { + interval = 4 * magnitude; + } + else if (residual > 2) { + interval = 3 * magnitude; + } + else if (residual > 1) { + interval = 2 * magnitude; + } + else { + interval = magnitude; + } + } + + return interval; + } + + // This will return an interval of form 2 * 10^n, 5 * 10^n or 10 * 10^n + // it is based soley on the range of data, number of ticks must be computed later. + function bestLinearInterval(range, scalefact) { + scalefact = scalefact || 1; + var expv = Math.floor(Math.log(range)/Math.LN10); + var magnitude = Math.pow(10, expv); + // 0 < f < 10 + var f = range / magnitude; + var fact; + // for large plots, scalefact will decrease f and increase number of ticks. + // for small plots, scalefact will increase f and decrease number of ticks. + f = f/scalefact; + + // for large plots, smaller interval, more ticks. + if (f<=0.38) { + fact = 0.1; + } + else if (f<=1.6) { + fact = 0.2; + } + else if (f<=4.0) { + fact = 0.5; + } + else if (f<=8.0) { + fact = 1.0; + } + // for very small plots, larger interval, less ticks in number ticks + else if (f<=16.0) { + fact = 2; + } + else { + fact = 5; + } + + return fact*magnitude; + } + + function bestLinearComponents(range, scalefact) { + var expv = Math.floor(Math.log(range)/Math.LN10); + var magnitude = Math.pow(10, expv); + // 0 < f < 10 + var f = range / magnitude; + var interval; + var fact; + // for large plots, scalefact will decrease f and increase number of ticks. + // for small plots, scalefact will increase f and decrease number of ticks. + f = f/scalefact; + + // for large plots, smaller interval, more ticks. + if (f<=0.38) { + fact = 0.1; + } + else if (f<=1.6) { + fact = 0.2; + } + else if (f<=4.0) { + fact = 0.5; + } + else if (f<=8.0) { + fact = 1.0; + } + // for very small plots, larger interval, less ticks in number ticks + else if (f<=16.0) { + fact = 2; + } + // else if (f<=20.0) { + // fact = 3; + // } + // else if (f<=24.0) { + // fact = 4; + // } + else { + fact = 5; + } + + interval = fact * magnitude; + + return [interval, fact, magnitude]; + } + + // Given the min and max for a dataset, return suitable endpoints + // for the graphing, a good number for the number of ticks, and a + // format string so that extraneous digits are not displayed. + // returned is an array containing [min, max, nTicks, format] + $.jqplot.LinearTickGenerator = function(axis_min, axis_max, scalefact, numberTicks, keepMin, keepMax) { + // Set to preserve EITHER min OR max. + // If min is preserved, max must be free. + keepMin = (keepMin === null) ? false : keepMin; + keepMax = (keepMax === null || keepMin) ? false : keepMax; + // if endpoints are equal try to include zero otherwise include one + if (axis_min === axis_max) { + axis_max = (axis_max) ? 0 : 1; + } + + scalefact = scalefact || 1.0; + + // make sure range is positive + if (axis_max < axis_min) { + var a = axis_max; + axis_max = axis_min; + axis_min = a; + } + + var r = []; + var ss = bestLinearInterval(axis_max - axis_min, scalefact); + + var gsf = $.jqplot.getSignificantFigures; + + if (numberTicks == null) { + + // Figure out the axis min, max and number of ticks + // the min and max will be some multiple of the tick interval, + // 1*10^n, 2*10^n or 5*10^n. This gaurantees that, if the + // axis min is negative, 0 will be a tick. + if (!keepMin && !keepMax) { + r[0] = Math.floor(axis_min / ss) * ss; // min + r[1] = Math.ceil(axis_max / ss) * ss; // max + r[2] = Math.round((r[1]-r[0])/ss+1.0); // number of ticks + r[3] = bestFormatString(ss); // format string + r[4] = ss; // tick Interval + } + + else if (keepMin) { + r[0] = axis_min; // min + r[2] = Math.ceil((axis_max - axis_min) / ss + 1.0); // number of ticks + r[1] = axis_min + (r[2] - 1) * ss; // max + var digitsMin = gsf(axis_min).digitsRight; + var digitsSS = gsf(ss).digitsRight; + if (digitsMin < digitsSS) { + r[3] = bestFormatString(ss); // format string + } + else { + r[3] = '%.' + digitsMin + 'f'; + } + r[4] = ss; // tick Interval + } + + else if (keepMax) { + r[1] = axis_max; // max + r[2] = Math.ceil((axis_max - axis_min) / ss + 1.0); // number of ticks + r[0] = axis_max - (r[2] - 1) * ss; // min + var digitsMax = gsf(axis_max).digitsRight; + var digitsSS = gsf(ss).digitsRight; + if (digitsMax < digitsSS) { + r[3] = bestFormatString(ss); // format string + } + else { + r[3] = '%.' + digitsMax + 'f'; + } + r[4] = ss; // tick Interval + } + } + + else { + var tempr = []; + + // Figure out the axis min, max and number of ticks + // the min and max will be some multiple of the tick interval, + // 1*10^n, 2*10^n or 5*10^n. This gaurantees that, if the + // axis min is negative, 0 will be a tick. + tempr[0] = Math.floor(axis_min / ss) * ss; // min + tempr[1] = Math.ceil(axis_max / ss) * ss; // max + tempr[2] = Math.round((tempr[1]-tempr[0])/ss+1.0); // number of ticks + tempr[3] = bestFormatString(ss); // format string + tempr[4] = ss; // tick Interval + + // first, see if we happen to get the right number of ticks + if (tempr[2] === numberTicks) { + r = tempr; + } + + else { + + var newti = bestInterval(tempr[1] - tempr[0], numberTicks); + + r[0] = tempr[0]; // min + r[2] = numberTicks; // number of ticks + r[4] = newti; // tick interval + r[3] = bestFormatString(newti); // format string + r[1] = r[0] + (r[2] - 1) * r[4]; // max + } + } + + return r; + }; + + $.jqplot.LinearTickGenerator.bestLinearInterval = bestLinearInterval; + $.jqplot.LinearTickGenerator.bestInterval = bestInterval; + $.jqplot.LinearTickGenerator.bestLinearComponents = bestLinearComponents; + $.jqplot.LinearTickGenerator.bestConstrainedInterval = bestConstrainedInterval; + + + // class: $.jqplot.MarkerRenderer + // The default jqPlot marker renderer, rendering the points on the line. + $.jqplot.MarkerRenderer = function(options){ + // Group: Properties + + // prop: show + // whether or not to show the marker. + this.show = true; + // prop: style + // One of diamond, circle, square, x, plus, dash, filledDiamond, filledCircle, filledSquare + this.style = 'filledCircle'; + // prop: lineWidth + // size of the line for non-filled markers. + this.lineWidth = 2; + // prop: size + // Size of the marker (diameter or circle, length of edge of square, etc.) + this.size = 9.0; + // prop: color + // color of marker. Will be set to color of series by default on init. + this.color = '#666666'; + // prop: shadow + // whether or not to draw a shadow on the line + this.shadow = true; + // prop: shadowAngle + // Shadow angle in degrees + this.shadowAngle = 45; + // prop: shadowOffset + // Shadow offset from line in pixels + this.shadowOffset = 1; + // prop: shadowDepth + // Number of times shadow is stroked, each stroke offset shadowOffset from the last. + this.shadowDepth = 3; + // prop: shadowAlpha + // Alpha channel transparency of shadow. 0 = transparent. + this.shadowAlpha = '0.07'; + // prop: shadowRenderer + // Renderer that will draws the shadows on the marker. + this.shadowRenderer = new $.jqplot.ShadowRenderer(); + // prop: shapeRenderer + // Renderer that will draw the marker. + this.shapeRenderer = new $.jqplot.ShapeRenderer(); + + $.extend(true, this, options); + }; + + $.jqplot.MarkerRenderer.prototype.init = function(options) { + $.extend(true, this, options); + var sdopt = {angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, lineWidth:this.lineWidth, depth:this.shadowDepth, closePath:true}; + if (this.style.indexOf('filled') != -1) { + sdopt.fill = true; + } + if (this.style.indexOf('ircle') != -1) { + sdopt.isarc = true; + sdopt.closePath = false; + } + this.shadowRenderer.init(sdopt); + + var shopt = {fill:false, isarc:false, strokeStyle:this.color, fillStyle:this.color, lineWidth:this.lineWidth, closePath:true}; + if (this.style.indexOf('filled') != -1) { + shopt.fill = true; + } + if (this.style.indexOf('ircle') != -1) { + shopt.isarc = true; + shopt.closePath = false; + } + this.shapeRenderer.init(shopt); + }; + + $.jqplot.MarkerRenderer.prototype.drawDiamond = function(x, y, ctx, fill, options) { + var stretch = 1.2; + var dx = this.size/2/stretch; + var dy = this.size/2*stretch; + var points = [[x-dx, y], [x, y+dy], [x+dx, y], [x, y-dy]]; + if (this.shadow) { + this.shadowRenderer.draw(ctx, points); + } + this.shapeRenderer.draw(ctx, points, options); + }; + + $.jqplot.MarkerRenderer.prototype.drawPlus = function(x, y, ctx, fill, options) { + var stretch = 1.0; + var dx = this.size/2*stretch; + var dy = this.size/2*stretch; + var points1 = [[x, y-dy], [x, y+dy]]; + var points2 = [[x+dx, y], [x-dx, y]]; + var opts = $.extend(true, {}, this.options, {closePath:false}); + if (this.shadow) { + this.shadowRenderer.draw(ctx, points1, {closePath:false}); + this.shadowRenderer.draw(ctx, points2, {closePath:false}); + } + this.shapeRenderer.draw(ctx, points1, opts); + this.shapeRenderer.draw(ctx, points2, opts); + }; + + $.jqplot.MarkerRenderer.prototype.drawX = function(x, y, ctx, fill, options) { + var stretch = 1.0; + var dx = this.size/2*stretch; + var dy = this.size/2*stretch; + var opts = $.extend(true, {}, this.options, {closePath:false}); + var points1 = [[x-dx, y-dy], [x+dx, y+dy]]; + var points2 = [[x-dx, y+dy], [x+dx, y-dy]]; + if (this.shadow) { + this.shadowRenderer.draw(ctx, points1, {closePath:false}); + this.shadowRenderer.draw(ctx, points2, {closePath:false}); + } + this.shapeRenderer.draw(ctx, points1, opts); + this.shapeRenderer.draw(ctx, points2, opts); + }; + + $.jqplot.MarkerRenderer.prototype.drawDash = function(x, y, ctx, fill, options) { + var stretch = 1.0; + var dx = this.size/2*stretch; + var dy = this.size/2*stretch; + var points = [[x-dx, y], [x+dx, y]]; + if (this.shadow) { + this.shadowRenderer.draw(ctx, points); + } + this.shapeRenderer.draw(ctx, points, options); + }; + + $.jqplot.MarkerRenderer.prototype.drawLine = function(p1, p2, ctx, fill, options) { + var points = [p1, p2]; + if (this.shadow) { + this.shadowRenderer.draw(ctx, points); + } + this.shapeRenderer.draw(ctx, points, options); + }; + + $.jqplot.MarkerRenderer.prototype.drawSquare = function(x, y, ctx, fill, options) { + var stretch = 1.0; + var dx = this.size/2/stretch; + var dy = this.size/2*stretch; + var points = [[x-dx, y-dy], [x-dx, y+dy], [x+dx, y+dy], [x+dx, y-dy]]; + if (this.shadow) { + this.shadowRenderer.draw(ctx, points); + } + this.shapeRenderer.draw(ctx, points, options); + }; + + $.jqplot.MarkerRenderer.prototype.drawCircle = function(x, y, ctx, fill, options) { + var radius = this.size/2; + var end = 2*Math.PI; + var points = [x, y, radius, 0, end, true]; + if (this.shadow) { + this.shadowRenderer.draw(ctx, points); + } + this.shapeRenderer.draw(ctx, points, options); + }; + + $.jqplot.MarkerRenderer.prototype.draw = function(x, y, ctx, options) { + options = options || {}; + // hack here b/c shape renderer uses canvas based color style options + // and marker uses css style names. + if (options.show == null || options.show != false) { + if (options.color && !options.fillStyle) { + options.fillStyle = options.color; + } + if (options.color && !options.strokeStyle) { + options.strokeStyle = options.color; + } + switch (this.style) { + case 'diamond': + this.drawDiamond(x,y,ctx, false, options); + break; + case 'filledDiamond': + this.drawDiamond(x,y,ctx, true, options); + break; + case 'circle': + this.drawCircle(x,y,ctx, false, options); + break; + case 'filledCircle': + this.drawCircle(x,y,ctx, true, options); + break; + case 'square': + this.drawSquare(x,y,ctx, false, options); + break; + case 'filledSquare': + this.drawSquare(x,y,ctx, true, options); + break; + case 'x': + this.drawX(x,y,ctx, true, options); + break; + case 'plus': + this.drawPlus(x,y,ctx, true, options); + break; + case 'dash': + this.drawDash(x,y,ctx, true, options); + break; + case 'line': + this.drawLine(x, y, ctx, false, options); + break; + default: + this.drawDiamond(x,y,ctx, false, options); + break; + } + } + }; + + // class: $.jqplot.shadowRenderer + // The default jqPlot shadow renderer, rendering shadows behind shapes. + $.jqplot.ShadowRenderer = function(options){ + // Group: Properties + + // prop: angle + // Angle of the shadow in degrees. Measured counter-clockwise from the x axis. + this.angle = 45; + // prop: offset + // Pixel offset at the given shadow angle of each shadow stroke from the last stroke. + this.offset = 1; + // prop: alpha + // alpha transparency of shadow stroke. + this.alpha = 0.07; + // prop: lineWidth + // width of the shadow line stroke. + this.lineWidth = 1.5; + // prop: lineJoin + // How line segments of the shadow are joined. + this.lineJoin = 'miter'; + // prop: lineCap + // how ends of the shadow line are rendered. + this.lineCap = 'round'; + // prop; closePath + // whether line path segment is closed upon itself. + this.closePath = false; + // prop: fill + // whether to fill the shape. + this.fill = false; + // prop: depth + // how many times the shadow is stroked. Each stroke will be offset by offset at angle degrees. + this.depth = 3; + this.strokeStyle = 'rgba(0,0,0,0.1)'; + // prop: isarc + // whether the shadow is an arc or not. + this.isarc = false; + + $.extend(true, this, options); + }; + + $.jqplot.ShadowRenderer.prototype.init = function(options) { + $.extend(true, this, options); + }; + + // function: draw + // draws an transparent black (i.e. gray) shadow. + // + // ctx - canvas drawing context + // points - array of points or [x, y, radius, start angle (rad), end angle (rad)] + $.jqplot.ShadowRenderer.prototype.draw = function(ctx, points, options) { + ctx.save(); + var opts = (options != null) ? options : {}; + var fill = (opts.fill != null) ? opts.fill : this.fill; + var fillRect = (opts.fillRect != null) ? opts.fillRect : this.fillRect; + var closePath = (opts.closePath != null) ? opts.closePath : this.closePath; + var offset = (opts.offset != null) ? opts.offset : this.offset; + var alpha = (opts.alpha != null) ? opts.alpha : this.alpha; + var depth = (opts.depth != null) ? opts.depth : this.depth; + var isarc = (opts.isarc != null) ? opts.isarc : this.isarc; + var linePattern = (opts.linePattern != null) ? opts.linePattern : this.linePattern; + ctx.lineWidth = (opts.lineWidth != null) ? opts.lineWidth : this.lineWidth; + ctx.lineJoin = (opts.lineJoin != null) ? opts.lineJoin : this.lineJoin; + ctx.lineCap = (opts.lineCap != null) ? opts.lineCap : this.lineCap; + ctx.strokeStyle = opts.strokeStyle || this.strokeStyle || 'rgba(0,0,0,'+alpha+')'; + ctx.fillStyle = opts.fillStyle || this.fillStyle || 'rgba(0,0,0,'+alpha+')'; + for (var j=0; j<depth; j++) { + var ctxPattern = $.jqplot.LinePattern(ctx, linePattern); + ctx.translate(Math.cos(this.angle*Math.PI/180)*offset, Math.sin(this.angle*Math.PI/180)*offset); + ctxPattern.beginPath(); + if (isarc) { + ctx.arc(points[0], points[1], points[2], points[3], points[4], true); + } + else if (fillRect) { + if (fillRect) { + ctx.fillRect(points[0], points[1], points[2], points[3]); + } + } + else if (points && points.length){ + var move = true; + for (var i=0; i<points.length; i++) { + // skip to the first non-null point and move to it. + if (points[i][0] != null && points[i][1] != null) { + if (move) { + ctxPattern.moveTo(points[i][0], points[i][1]); + move = false; + } + else { + ctxPattern.lineTo(points[i][0], points[i][1]); + } + } + else { + move = true; + } + } + + } + if (closePath) { + ctxPattern.closePath(); + } + if (fill) { + ctx.fill(); + } + else { + ctx.stroke(); + } + } + ctx.restore(); + }; + + // class: $.jqplot.shapeRenderer + // The default jqPlot shape renderer. Given a set of points will + // plot them and either stroke a line (fill = false) or fill them (fill = true). + // If a filled shape is desired, closePath = true must also be set to close + // the shape. + $.jqplot.ShapeRenderer = function(options){ + + this.lineWidth = 1.5; + // prop: linePattern + // line pattern 'dashed', 'dotted', 'solid', some combination + // of '-' and '.' characters such as '.-.' or a numerical array like + // [draw, skip, draw, skip, ...] such as [1, 10] to draw a dotted line, + // [1, 10, 20, 10] to draw a dot-dash line, and so on. + this.linePattern = 'solid'; + // prop: lineJoin + // How line segments of the shadow are joined. + this.lineJoin = 'miter'; + // prop: lineCap + // how ends of the shadow line are rendered. + this.lineCap = 'round'; + // prop; closePath + // whether line path segment is closed upon itself. + this.closePath = false; + // prop: fill + // whether to fill the shape. + this.fill = false; + // prop: isarc + // whether the shadow is an arc or not. + this.isarc = false; + // prop: fillRect + // true to draw shape as a filled rectangle. + this.fillRect = false; + // prop: strokeRect + // true to draw shape as a stroked rectangle. + this.strokeRect = false; + // prop: clearRect + // true to cear a rectangle. + this.clearRect = false; + // prop: strokeStyle + // css color spec for the stoke style + this.strokeStyle = '#999999'; + // prop: fillStyle + // css color spec for the fill style. + this.fillStyle = '#999999'; + + $.extend(true, this, options); + }; + + $.jqplot.ShapeRenderer.prototype.init = function(options) { + $.extend(true, this, options); + }; + + // function: draw + // draws the shape. + // + // ctx - canvas drawing context + // points - array of points for shapes or + // [x, y, width, height] for rectangles or + // [x, y, radius, start angle (rad), end angle (rad)] for circles and arcs. + $.jqplot.ShapeRenderer.prototype.draw = function(ctx, points, options) { + ctx.save(); + var opts = (options != null) ? options : {}; + var fill = (opts.fill != null) ? opts.fill : this.fill; + var closePath = (opts.closePath != null) ? opts.closePath : this.closePath; + var fillRect = (opts.fillRect != null) ? opts.fillRect : this.fillRect; + var strokeRect = (opts.strokeRect != null) ? opts.strokeRect : this.strokeRect; + var clearRect = (opts.clearRect != null) ? opts.clearRect : this.clearRect; + var isarc = (opts.isarc != null) ? opts.isarc : this.isarc; + var linePattern = (opts.linePattern != null) ? opts.linePattern : this.linePattern; + var ctxPattern = $.jqplot.LinePattern(ctx, linePattern); + ctx.lineWidth = opts.lineWidth || this.lineWidth; + ctx.lineJoin = opts.lineJoin || this.lineJoin; + ctx.lineCap = opts.lineCap || this.lineCap; + ctx.strokeStyle = (opts.strokeStyle || opts.color) || this.strokeStyle; + ctx.fillStyle = opts.fillStyle || this.fillStyle; + ctx.beginPath(); + if (isarc) { + ctx.arc(points[0], points[1], points[2], points[3], points[4], true); + if (closePath) { + ctx.closePath(); + } + if (fill) { + ctx.fill(); + } + else { + ctx.stroke(); + } + ctx.restore(); + return; + } + else if (clearRect) { + ctx.clearRect(points[0], points[1], points[2], points[3]); + ctx.restore(); + return; + } + else if (fillRect || strokeRect) { + if (fillRect) { + ctx.fillRect(points[0], points[1], points[2], points[3]); + } + if (strokeRect) { + ctx.strokeRect(points[0], points[1], points[2], points[3]); + ctx.restore(); + return; + } + } + else if (points && points.length){ + var move = true; + for (var i=0; i<points.length; i++) { + // skip to the first non-null point and move to it. + if (points[i][0] != null && points[i][1] != null) { + if (move) { + ctxPattern.moveTo(points[i][0], points[i][1]); + move = false; + } + else { + ctxPattern.lineTo(points[i][0], points[i][1]); + } + } + else { + move = true; + } + } + if (closePath) { + ctxPattern.closePath(); + } + if (fill) { + ctx.fill(); + } + else { + ctx.stroke(); + } + } + ctx.restore(); + }; + + // class $.jqplot.TableLegendRenderer + // The default legend renderer for jqPlot. + $.jqplot.TableLegendRenderer = function(){ + // + }; + + $.jqplot.TableLegendRenderer.prototype.init = function(options) { + $.extend(true, this, options); + }; + + $.jqplot.TableLegendRenderer.prototype.addrow = function (label, color, pad, reverse) { + var rs = (pad) ? this.rowSpacing+'px' : '0px'; + var tr; + var td; + var elem; + var div0; + var div1; + elem = document.createElement('tr'); + tr = $(elem); + tr.addClass('jqplot-table-legend'); + elem = null; + + if (reverse){ + tr.prependTo(this._elem); + } + + else{ + tr.appendTo(this._elem); + } + + if (this.showSwatches) { + td = $(document.createElement('td')); + td.addClass('jqplot-table-legend jqplot-table-legend-swatch'); + td.css({textAlign: 'center', paddingTop: rs}); + + div0 = $(document.createElement('div')); + div0.addClass('jqplot-table-legend-swatch-outline'); + div1 = $(document.createElement('div')); + div1.addClass('jqplot-table-legend-swatch'); + div1.css({backgroundColor: color, borderColor: color}); + + tr.append(td.append(div0.append(div1))); + + // $('<td class="jqplot-table-legend" style="text-align:center;padding-top:'+rs+';">'+ + // '<div><div class="jqplot-table-legend-swatch" style="background-color:'+color+';border-color:'+color+';"></div>'+ + // '</div></td>').appendTo(tr); + } + if (this.showLabels) { + td = $(document.createElement('td')); + td.addClass('jqplot-table-legend jqplot-table-legend-label'); + td.css('paddingTop', rs); + tr.append(td); + + // elem = $('<td class="jqplot-table-legend" style="padding-top:'+rs+';"></td>'); + // elem.appendTo(tr); + if (this.escapeHtml) { + td.text(label); + } + else { + td.html(label); + } + } + td = null; + div0 = null; + div1 = null; + tr = null; + elem = null; + }; + + // called with scope of legend + $.jqplot.TableLegendRenderer.prototype.draw = function() { + if (this._elem) { + this._elem.emptyForce(); + this._elem = null; + } + + if (this.show) { + var series = this._series; + // make a table. one line label per row. + var elem = document.createElement('table'); + this._elem = $(elem); + this._elem.addClass('jqplot-table-legend'); + + var ss = {position:'absolute'}; + if (this.background) { + ss['background'] = this.background; + } + if (this.border) { + ss['border'] = this.border; + } + if (this.fontSize) { + ss['fontSize'] = this.fontSize; + } + if (this.fontFamily) { + ss['fontFamily'] = this.fontFamily; + } + if (this.textColor) { + ss['textColor'] = this.textColor; + } + if (this.marginTop != null) { + ss['marginTop'] = this.marginTop; + } + if (this.marginBottom != null) { + ss['marginBottom'] = this.marginBottom; + } + if (this.marginLeft != null) { + ss['marginLeft'] = this.marginLeft; + } + if (this.marginRight != null) { + ss['marginRight'] = this.marginRight; + } + + + var pad = false, + reverse = false, + s; + for (var i = 0; i< series.length; i++) { + s = series[i]; + if (s._stack || s.renderer.constructor == $.jqplot.BezierCurveRenderer){ + reverse = true; + } + if (s.show && s.showLabel) { + var lt = this.labels[i] || s.label.toString(); + if (lt) { + var color = s.color; + if (reverse && i < series.length - 1){ + pad = true; + } + else if (reverse && i == series.length - 1){ + pad = false; + } + this.renderer.addrow.call(this, lt, color, pad, reverse); + pad = true; + } + // let plugins add more rows to legend. Used by trend line plugin. + for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) { + var item = $.jqplot.addLegendRowHooks[j].call(this, s); + if (item) { + this.renderer.addrow.call(this, item.label, item.color, pad); + pad = true; + } + } + lt = null; + } + } + } + return this._elem; + }; + + $.jqplot.TableLegendRenderer.prototype.pack = function(offsets) { + if (this.show) { + if (this.placement == 'insideGrid') { + switch (this.location) { + case 'nw': + var a = offsets.left; + var b = offsets.top; + this._elem.css('left', a); + this._elem.css('top', b); + break; + case 'n': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + var b = offsets.top; + this._elem.css('left', a); + this._elem.css('top', b); + break; + case 'ne': + var a = offsets.right; + var b = offsets.top; + this._elem.css({right:a, top:b}); + break; + case 'e': + var a = offsets.right; + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({right:a, top:b}); + break; + case 'se': + var a = offsets.right; + var b = offsets.bottom; + this._elem.css({right:a, bottom:b}); + break; + case 's': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + var b = offsets.bottom; + this._elem.css({left:a, bottom:b}); + break; + case 'sw': + var a = offsets.left; + var b = offsets.bottom; + this._elem.css({left:a, bottom:b}); + break; + case 'w': + var a = offsets.left; + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({left:a, top:b}); + break; + default: // same as 'se' + var a = offsets.right; + var b = offsets.bottom; + this._elem.css({right:a, bottom:b}); + break; + } + + } + else if (this.placement == 'outside'){ + switch (this.location) { + case 'nw': + var a = this._plotDimensions.width - offsets.left; + var b = offsets.top; + this._elem.css('right', a); + this._elem.css('top', b); + break; + case 'n': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + var b = this._plotDimensions.height - offsets.top; + this._elem.css('left', a); + this._elem.css('bottom', b); + break; + case 'ne': + var a = this._plotDimensions.width - offsets.right; + var b = offsets.top; + this._elem.css({left:a, top:b}); + break; + case 'e': + var a = this._plotDimensions.width - offsets.right; + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({left:a, top:b}); + break; + case 'se': + var a = this._plotDimensions.width - offsets.right; + var b = offsets.bottom; + this._elem.css({left:a, bottom:b}); + break; + case 's': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + var b = this._plotDimensions.height - offsets.bottom; + this._elem.css({left:a, top:b}); + break; + case 'sw': + var a = this._plotDimensions.width - offsets.left; + var b = offsets.bottom; + this._elem.css({right:a, bottom:b}); + break; + case 'w': + var a = this._plotDimensions.width - offsets.left; + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({right:a, top:b}); + break; + default: // same as 'se' + var a = offsets.right; + var b = offsets.bottom; + this._elem.css({right:a, bottom:b}); + break; + } + } + else { + switch (this.location) { + case 'nw': + this._elem.css({left:0, top:offsets.top}); + break; + case 'n': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + this._elem.css({left: a, top:offsets.top}); + break; + case 'ne': + this._elem.css({right:0, top:offsets.top}); + break; + case 'e': + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({right:offsets.right, top:b}); + break; + case 'se': + this._elem.css({right:offsets.right, bottom:offsets.bottom}); + break; + case 's': + var a = (offsets.left + (this._plotDimensions.width - offsets.right))/2 - this.getWidth()/2; + this._elem.css({left: a, bottom:offsets.bottom}); + break; + case 'sw': + this._elem.css({left:offsets.left, bottom:offsets.bottom}); + break; + case 'w': + var b = (offsets.top + (this._plotDimensions.height - offsets.bottom))/2 - this.getHeight()/2; + this._elem.css({left:offsets.left, top:b}); + break; + default: // same as 'se' + this._elem.css({right:offsets.right, bottom:offsets.bottom}); + break; + } + } + } + }; + + /** + * Class: $.jqplot.ThemeEngine + * Theme Engine provides a programatic way to change some of the more + * common jqplot styling options such as fonts, colors and grid options. + * A theme engine instance is created with each plot. The theme engine + * manages a collection of themes which can be modified, added to, or + * applied to the plot. + * + * The themeEngine class is not instantiated directly. + * When a plot is initialized, the current plot options are scanned + * an a default theme named "Default" is created. This theme is + * used as the basis for other themes added to the theme engine and + * is always available. + * + * A theme is a simple javascript object with styling parameters for + * various entities of the plot. A theme has the form: + * + * + * > { + * > _name:f "Default", + * > target: { + * > backgroundColor: "transparent" + * > }, + * > legend: { + * > textColor: null, + * > fontFamily: null, + * > fontSize: null, + * > border: null, + * > background: null + * > }, + * > title: { + * > textColor: "rgb(102, 102, 102)", + * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif", + * > fontSize: "19.2px", + * > textAlign: "center" + * > }, + * > seriesStyles: {}, + * > series: [{ + * > color: "#4bb2c5", + * > lineWidth: 2.5, + * > linePattern: "solid", + * > shadow: true, + * > fillColor: "#4bb2c5", + * > showMarker: true, + * > markerOptions: { + * > color: "#4bb2c5", + * > show: true, + * > style: 'filledCircle', + * > lineWidth: 1.5, + * > size: 4, + * > shadow: true + * > } + * > }], + * > grid: { + * > drawGridlines: true, + * > gridLineColor: "#cccccc", + * > gridLineWidth: 1, + * > backgroundColor: "#fffdf6", + * > borderColor: "#999999", + * > borderWidth: 2, + * > shadow: true + * > }, + * > axesStyles: { + * > label: {}, + * > ticks: {} + * > }, + * > axes: { + * > xaxis: { + * > borderColor: "#999999", + * > borderWidth: 2, + * > ticks: { + * > show: true, + * > showGridline: true, + * > showLabel: true, + * > showMark: true, + * > size: 4, + * > textColor: "", + * > whiteSpace: "nowrap", + * > fontSize: "12px", + * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif" + * > }, + * > label: { + * > textColor: "rgb(102, 102, 102)", + * > whiteSpace: "normal", + * > fontSize: "14.6667px", + * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif", + * > fontWeight: "400" + * > } + * > }, + * > yaxis: { + * > borderColor: "#999999", + * > borderWidth: 2, + * > ticks: { + * > show: true, + * > showGridline: true, + * > showLabel: true, + * > showMark: true, + * > size: 4, + * > textColor: "", + * > whiteSpace: "nowrap", + * > fontSize: "12px", + * > fontFamily: "'Trebuchet MS',Arial,Helvetica,sans-serif" + * > }, + * > label: { + * > textColor: null, + * > whiteSpace: null, + * > fontSize: null, + * > fontFamily: null, + * > fontWeight: null + * > } + * > }, + * > x2axis: {... + * > }, + * > ... + * > y9axis: {... + * > } + * > } + * > } + * + * "seriesStyles" is a style object that will be applied to all series in the plot. + * It will forcibly override any styles applied on the individual series. "axesStyles" is + * a style object that will be applied to all axes in the plot. It will also forcibly + * override any styles on the individual axes. + * + * The example shown above has series options for a line series. Options for other + * series types are shown below: + * + * Bar Series: + * + * > { + * > color: "#4bb2c5", + * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"], + * > lineWidth: 2.5, + * > shadow: true, + * > barPadding: 2, + * > barMargin: 10, + * > barWidth: 15.09375, + * > highlightColors: ["rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)", "rgb(129,201,214)"] + * > } + * + * Pie Series: + * + * > { + * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"], + * > padding: 20, + * > sliceMargin: 0, + * > fill: true, + * > shadow: true, + * > startAngle: 0, + * > lineWidth: 2.5, + * > highlightColors: ["rgb(129,201,214)", "rgb(240,189,104)", "rgb(214,202,165)", "rgb(137,180,158)", "rgb(168,180,137)", "rgb(180,174,89)", "rgb(180,113,161)", "rgb(129,141,236)", "rgb(227,205,120)", "rgb(255,138,76)", "rgb(76,169,219)", "rgb(215,126,190)", "rgb(220,232,135)", "rgb(200,167,96)", "rgb(103,202,235)", "rgb(208,154,215)"] + * > } + * + * Funnel Series: + * + * > { + * > color: "#4bb2c5", + * > lineWidth: 2, + * > shadow: true, + * > padding: { + * > top: 20, + * > right: 20, + * > bottom: 20, + * > left: 20 + * > }, + * > sectionMargin: 6, + * > seriesColors: ["#4bb2c5", "#EAA228", "#c5b47f", "#579575", "#839557", "#958c12", "#953579", "#4b5de4", "#d8b83f", "#ff5800", "#0085cc", "#c747a3", "#cddf54", "#FBD178", "#26B4E3", "#bd70c7"], + * > highlightColors: ["rgb(147,208,220)", "rgb(242,199,126)", "rgb(220,210,178)", "rgb(154,191,172)", "rgb(180,191,154)", "rgb(191,186,112)", "rgb(191,133,174)", "rgb(147,157,238)", "rgb(231,212,139)", "rgb(255,154,102)", "rgb(102,181,224)", "rgb(221,144,199)", "rgb(225,235,152)", "rgb(200,167,96)", "rgb(124,210,238)", "rgb(215,169,221)"] + * > } + * + */ + $.jqplot.ThemeEngine = function(){ + // Group: Properties + // + // prop: themes + // hash of themes managed by the theme engine. + // Indexed by theme name. + this.themes = {}; + // prop: activeTheme + // Pointer to currently active theme + this.activeTheme=null; + + }; + + // called with scope of plot + $.jqplot.ThemeEngine.prototype.init = function() { + // get the Default theme from the current plot settings. + var th = new $.jqplot.Theme({_name:'Default'}); + var n, i, nn; + + for (n in th.target) { + if (n == "textColor") { + th.target[n] = this.target.css('color'); + } + else { + th.target[n] = this.target.css(n); + } + } + + if (this.title.show && this.title._elem) { + for (n in th.title) { + if (n == "textColor") { + th.title[n] = this.title._elem.css('color'); + } + else { + th.title[n] = this.title._elem.css(n); + } + } + } + + for (n in th.grid) { + th.grid[n] = this.grid[n]; + } + if (th.grid.backgroundColor == null && this.grid.background != null) { + th.grid.backgroundColor = this.grid.background; + } + if (this.legend.show && this.legend._elem) { + for (n in th.legend) { + if (n == 'textColor') { + th.legend[n] = this.legend._elem.css('color'); + } + else { + th.legend[n] = this.legend._elem.css(n); + } + } + } + var s; + + for (i=0; i<this.series.length; i++) { + s = this.series[i]; + if (s.renderer.constructor == $.jqplot.LineRenderer) { + th.series.push(new LineSeriesProperties()); + } + else if (s.renderer.constructor == $.jqplot.BarRenderer) { + th.series.push(new BarSeriesProperties()); + } + else if (s.renderer.constructor == $.jqplot.PieRenderer) { + th.series.push(new PieSeriesProperties()); + } + else if (s.renderer.constructor == $.jqplot.DonutRenderer) { + th.series.push(new DonutSeriesProperties()); + } + else if (s.renderer.constructor == $.jqplot.FunnelRenderer) { + th.series.push(new FunnelSeriesProperties()); + } + else if (s.renderer.constructor == $.jqplot.MeterGaugeRenderer) { + th.series.push(new MeterSeriesProperties()); + } + else { + th.series.push({}); + } + for (n in th.series[i]) { + th.series[i][n] = s[n]; + } + } + var a, ax; + for (n in this.axes) { + ax = this.axes[n]; + a = th.axes[n] = new AxisProperties(); + a.borderColor = ax.borderColor; + a.borderWidth = ax.borderWidth; + if (ax._ticks && ax._ticks[0]) { + for (nn in a.ticks) { + if (ax._ticks[0].hasOwnProperty(nn)) { + a.ticks[nn] = ax._ticks[0][nn]; + } + else if (ax._ticks[0]._elem){ + a.ticks[nn] = ax._ticks[0]._elem.css(nn); + } + } + } + if (ax._label && ax._label.show) { + for (nn in a.label) { + // a.label[nn] = ax._label._elem.css(nn); + if (ax._label[nn]) { + a.label[nn] = ax._label[nn]; + } + else if (ax._label._elem){ + if (nn == 'textColor') { + a.label[nn] = ax._label._elem.css('color'); + } + else { + a.label[nn] = ax._label._elem.css(nn); + } + } + } + } + } + this.themeEngine._add(th); + this.themeEngine.activeTheme = this.themeEngine.themes[th._name]; + }; + /** + * Group: methods + * + * method: get + * + * Get and return the named theme or the active theme if no name given. + * + * parameter: + * + * name - name of theme to get. + * + * returns: + * + * Theme instance of given name. + */ + $.jqplot.ThemeEngine.prototype.get = function(name) { + if (!name) { + // return the active theme + return this.activeTheme; + } + else { + return this.themes[name]; + } + }; + + function numericalOrder(a,b) { return a-b; } + + /** + * method: getThemeNames + * + * Return the list of theme names in this manager in alpha-numerical order. + * + * parameter: + * + * None + * + * returns: + * + * A the list of theme names in this manager in alpha-numerical order. + */ + $.jqplot.ThemeEngine.prototype.getThemeNames = function() { + var tn = []; + for (var n in this.themes) { + tn.push(n); + } + return tn.sort(numericalOrder); + }; + + /** + * method: getThemes + * + * Return a list of themes in alpha-numerical order by name. + * + * parameter: + * + * None + * + * returns: + * + * A list of themes in alpha-numerical order by name. + */ + $.jqplot.ThemeEngine.prototype.getThemes = function() { + var tn = []; + var themes = []; + for (var n in this.themes) { + tn.push(n); + } + tn.sort(numericalOrder); + for (var i=0; i<tn.length; i++) { + themes.push(this.themes[tn[i]]); + } + return themes; + }; + + $.jqplot.ThemeEngine.prototype.activate = function(plot, name) { + // sometimes need to redraw whole plot. + var redrawPlot = false; + if (!name && this.activeTheme && this.activeTheme._name) { + name = this.activeTheme._name; + } + if (!this.themes.hasOwnProperty(name)) { + throw new Error("No theme of that name"); + } + else { + var th = this.themes[name]; + this.activeTheme = th; + var val, checkBorderColor = false, checkBorderWidth = false; + var arr = ['xaxis', 'x2axis', 'yaxis', 'y2axis']; + + for (i=0; i<arr.length; i++) { + var ax = arr[i]; + if (th.axesStyles.borderColor != null) { + plot.axes[ax].borderColor = th.axesStyles.borderColor; + } + if (th.axesStyles.borderWidth != null) { + plot.axes[ax].borderWidth = th.axesStyles.borderWidth; + } + } + + for (var axname in plot.axes) { + var axis = plot.axes[axname]; + if (axis.show) { + var thaxis = th.axes[axname] || {}; + var thaxstyle = th.axesStyles; + var thax = $.jqplot.extend(true, {}, thaxis, thaxstyle); + val = (th.axesStyles.borderColor != null) ? th.axesStyles.borderColor : thax.borderColor; + if (thax.borderColor != null) { + axis.borderColor = thax.borderColor; + redrawPlot = true; + } + val = (th.axesStyles.borderWidth != null) ? th.axesStyles.borderWidth : thax.borderWidth; + if (thax.borderWidth != null) { + axis.borderWidth = thax.borderWidth; + redrawPlot = true; + } + if (axis._ticks && axis._ticks[0]) { + for (var nn in thax.ticks) { + // val = null; + // if (th.axesStyles.ticks && th.axesStyles.ticks[nn] != null) { + // val = th.axesStyles.ticks[nn]; + // } + // else if (thax.ticks[nn] != null){ + // val = thax.ticks[nn] + // } + val = thax.ticks[nn]; + if (val != null) { + axis.tickOptions[nn] = val; + axis._ticks = []; + redrawPlot = true; + } + } + } + if (axis._label && axis._label.show) { + for (var nn in thax.label) { + // val = null; + // if (th.axesStyles.label && th.axesStyles.label[nn] != null) { + // val = th.axesStyles.label[nn]; + // } + // else if (thax.label && thax.label[nn] != null){ + // val = thax.label[nn] + // } + val = thax.label[nn]; + if (val != null) { + axis.labelOptions[nn] = val; + redrawPlot = true; + } + } + } + + } + } + + for (var n in th.grid) { + if (th.grid[n] != null) { + plot.grid[n] = th.grid[n]; + } + } + if (!redrawPlot) { + plot.grid.draw(); + } + + if (plot.legend.show) { + for (n in th.legend) { + if (th.legend[n] != null) { + plot.legend[n] = th.legend[n]; + } + } + } + if (plot.title.show) { + for (n in th.title) { + if (th.title[n] != null) { + plot.title[n] = th.title[n]; + } + } + } + + var i; + for (i=0; i<th.series.length; i++) { + var opts = {}; + var redrawSeries = false; + for (n in th.series[i]) { + val = (th.seriesStyles[n] != null) ? th.seriesStyles[n] : th.series[i][n]; + if (val != null) { + opts[n] = val; + if (n == 'color') { + plot.series[i].renderer.shapeRenderer.fillStyle = val; + plot.series[i].renderer.shapeRenderer.strokeStyle = val; + plot.series[i][n] = val; + } + else if ((n == 'lineWidth') || (n == 'linePattern')) { + plot.series[i].renderer.shapeRenderer[n] = val; + plot.series[i][n] = val; + } + else if (n == 'markerOptions') { + merge (plot.series[i].markerOptions, val); + merge (plot.series[i].markerRenderer, val); + } + else { + plot.series[i][n] = val; + } + redrawPlot = true; + } + } + } + + if (redrawPlot) { + plot.target.empty(); + plot.draw(); + } + + for (n in th.target) { + if (th.target[n] != null) { + plot.target.css(n, th.target[n]); + } + } + } + + }; + + $.jqplot.ThemeEngine.prototype._add = function(theme, name) { + if (name) { + theme._name = name; + } + if (!theme._name) { + theme._name = Date.parse(new Date()); + } + if (!this.themes.hasOwnProperty(theme._name)) { + this.themes[theme._name] = theme; + } + else { + throw new Error("jqplot.ThemeEngine Error: Theme already in use"); + } + }; + + // method remove + // Delete the named theme, return true on success, false on failure. + + + /** + * method: remove + * + * Remove the given theme from the themeEngine. + * + * parameters: + * + * name - name of the theme to remove. + * + * returns: + * + * true on success, false on failure. + */ + $.jqplot.ThemeEngine.prototype.remove = function(name) { + if (name == 'Default') { + return false; + } + return delete this.themes[name]; + }; + + /** + * method: newTheme + * + * Create a new theme based on the default theme, adding it the themeEngine. + * + * parameters: + * + * name - name of the new theme. + * obj - optional object of styles to be applied to this new theme. + * + * returns: + * + * new Theme object. + */ + $.jqplot.ThemeEngine.prototype.newTheme = function(name, obj) { + if (typeof(name) == 'object') { + obj = obj || name; + name = null; + } + if (obj && obj._name) { + name = obj._name; + } + else { + name = name || Date.parse(new Date()); + } + // var th = new $.jqplot.Theme(name); + var th = this.copy(this.themes['Default']._name, name); + $.jqplot.extend(th, obj); + return th; + }; + + // function clone(obj) { + // return eval(obj.toSource()); + // } + + function clone(obj){ + if(obj == null || typeof(obj) != 'object'){ + return obj; + } + + var temp = new obj.constructor(); + for(var key in obj){ + temp[key] = clone(obj[key]); + } + return temp; + } + + $.jqplot.clone = clone; + + function merge(obj1, obj2) { + if (obj2 == null || typeof(obj2) != 'object') { + return; + } + for (var key in obj2) { + if (key == 'highlightColors') { + obj1[key] = clone(obj2[key]); + } + if (obj2[key] != null && typeof(obj2[key]) == 'object') { + if (!obj1.hasOwnProperty(key)) { + obj1[key] = {}; + } + merge(obj1[key], obj2[key]); + } + else { + obj1[key] = obj2[key]; + } + } + } + + $.jqplot.merge = merge; + + // Use the jQuery 1.3.2 extend function since behaviour in jQuery 1.4 seems problematic + $.jqplot.extend = function() { + // copy reference to target object + var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !toString.call(target) === "[object Function]" ) { + target = {}; + } + + for ( ; i < length; i++ ){ + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( var name in options ) { + var src = target[ name ], copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging object values + if ( deep && copy && typeof copy === "object" && !copy.nodeType ) { + target[ name ] = $.jqplot.extend( deep, + // Never move original objects, clone them + src || ( copy.length != null ? [ ] : { } ) + , copy ); + } + // Don't bring in undefined values + else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + // Return the modified object + return target; + }; + + /** + * method: rename + * + * Rename a theme. + * + * parameters: + * + * oldName - current name of the theme. + * newName - desired name of the theme. + * + * returns: + * + * new Theme object. + */ + $.jqplot.ThemeEngine.prototype.rename = function (oldName, newName) { + if (oldName == 'Default' || newName == 'Default') { + throw new Error ("jqplot.ThemeEngine Error: Cannot rename from/to Default"); + } + if (this.themes.hasOwnProperty(newName)) { + throw new Error ("jqplot.ThemeEngine Error: New name already in use."); + } + else if (this.themes.hasOwnProperty(oldName)) { + var th = this.copy (oldName, newName); + this.remove(oldName); + return th; + } + throw new Error("jqplot.ThemeEngine Error: Old name or new name invalid"); + }; + + /** + * method: copy + * + * Create a copy of an existing theme in the themeEngine, adding it the themeEngine. + * + * parameters: + * + * sourceName - name of the existing theme. + * targetName - name of the copy. + * obj - optional object of style parameter to apply to the new theme. + * + * returns: + * + * new Theme object. + */ + $.jqplot.ThemeEngine.prototype.copy = function (sourceName, targetName, obj) { + if (targetName == 'Default') { + throw new Error ("jqplot.ThemeEngine Error: Cannot copy over Default theme"); + } + if (!this.themes.hasOwnProperty(sourceName)) { + var s = "jqplot.ThemeEngine Error: Source name invalid"; + throw new Error(s); + } + if (this.themes.hasOwnProperty(targetName)) { + var s = "jqplot.ThemeEngine Error: Target name invalid"; + throw new Error(s); + } + else { + var th = clone(this.themes[sourceName]); + th._name = targetName; + $.jqplot.extend(true, th, obj); + this._add(th); + return th; + } + }; + + + $.jqplot.Theme = function(name, obj) { + if (typeof(name) == 'object') { + obj = obj || name; + name = null; + } + name = name || Date.parse(new Date()); + this._name = name; + this.target = { + backgroundColor: null + }; + this.legend = { + textColor: null, + fontFamily: null, + fontSize: null, + border: null, + background: null + }; + this.title = { + textColor: null, + fontFamily: null, + fontSize: null, + textAlign: null + }; + this.seriesStyles = {}; + this.series = []; + this.grid = { + drawGridlines: null, + gridLineColor: null, + gridLineWidth: null, + backgroundColor: null, + borderColor: null, + borderWidth: null, + shadow: null + }; + this.axesStyles = {label:{}, ticks:{}}; + this.axes = {}; + if (typeof(obj) == 'string') { + this._name = obj; + } + else if(typeof(obj) == 'object') { + $.jqplot.extend(true, this, obj); + } + }; + + var AxisProperties = function() { + this.borderColor = null; + this.borderWidth = null; + this.ticks = new AxisTicks(); + this.label = new AxisLabel(); + }; + + var AxisTicks = function() { + this.show = null; + this.showGridline = null; + this.showLabel = null; + this.showMark = null; + this.size = null; + this.textColor = null; + this.whiteSpace = null; + this.fontSize = null; + this.fontFamily = null; + }; + + var AxisLabel = function() { + this.textColor = null; + this.whiteSpace = null; + this.fontSize = null; + this.fontFamily = null; + this.fontWeight = null; + }; + + var LineSeriesProperties = function() { + this.color=null; + this.lineWidth=null; + this.linePattern=null; + this.shadow=null; + this.fillColor=null; + this.showMarker=null; + this.markerOptions = new MarkerOptions(); + }; + + var MarkerOptions = function() { + this.show = null; + this.style = null; + this.lineWidth = null; + this.size = null; + this.color = null; + this.shadow = null; + }; + + var BarSeriesProperties = function() { + this.color=null; + this.seriesColors=null; + this.lineWidth=null; + this.shadow=null; + this.barPadding=null; + this.barMargin=null; + this.barWidth=null; + this.highlightColors=null; + }; + + var PieSeriesProperties = function() { + this.seriesColors=null; + this.padding=null; + this.sliceMargin=null; + this.fill=null; + this.shadow=null; + this.startAngle=null; + this.lineWidth=null; + this.highlightColors=null; + }; + + var DonutSeriesProperties = function() { + this.seriesColors=null; + this.padding=null; + this.sliceMargin=null; + this.fill=null; + this.shadow=null; + this.startAngle=null; + this.lineWidth=null; + this.innerDiameter=null; + this.thickness=null; + this.ringMargin=null; + this.highlightColors=null; + }; + + var FunnelSeriesProperties = function() { + this.color=null; + this.lineWidth=null; + this.shadow=null; + this.padding=null; + this.sectionMargin=null; + this.seriesColors=null; + this.highlightColors=null; + }; + + var MeterSeriesProperties = function() { + this.padding=null; + this.backgroundColor=null; + this.ringColor=null; + this.tickColor=null; + this.ringWidth=null; + this.intervalColors=null; + this.intervalInnerRadius=null; + this.intervalOuterRadius=null; + this.hubRadius=null; + this.needleThickness=null; + this.needlePad=null; + }; + + + + + $.fn.jqplotChildText = function() { + return $(this).contents().filter(function() { + return this.nodeType == 3; // Node.TEXT_NODE not defined in I7 + }).text(); + }; + + // Returns font style as abbreviation for "font" property. + $.fn.jqplotGetComputedFontStyle = function() { + var css = window.getComputedStyle ? window.getComputedStyle(this[0], "") : this[0].currentStyle; + var attrs = css['font-style'] ? ['font-style', 'font-weight', 'font-size', 'font-family'] : ['fontStyle', 'fontWeight', 'fontSize', 'fontFamily']; + var style = []; + + for (var i=0 ; i < attrs.length; ++i) { + var attr = String(css[attrs[i]]); + + if (attr && attr != 'normal') { + style.push(attr); + } + } + return style.join(' '); + }; + + /** + * Namespace: $.fn + * jQuery namespace to attach functions to jQuery elements. + * + */ + + $.fn.jqplotToImageCanvas = function(options) { + + options = options || {}; + var x_offset = (options.x_offset == null) ? 0 : options.x_offset; + var y_offset = (options.y_offset == null) ? 0 : options.y_offset; + var backgroundColor = (options.backgroundColor == null) ? 'rgb(255,255,255)' : options.backgroundColor; + + if ($(this).width() == 0 || $(this).height() == 0) { + return null; + } + + // excanvas and hence IE < 9 do not support toDataURL and cannot export images. + if ($.jqplot.use_excanvas) { + return null; + } + + var newCanvas = document.createElement("canvas"); + var h = $(this).outerHeight(true); + var w = $(this).outerWidth(true); + var offs = $(this).offset(); + var plotleft = offs.left; + var plottop = offs.top; + var transx = 0, transy = 0; + + // have to check if any elements are hanging outside of plot area before rendering, + // since changing width of canvas will erase canvas. + + var clses = ['jqplot-table-legend', 'jqplot-xaxis-tick', 'jqplot-x2axis-tick', 'jqplot-yaxis-tick', 'jqplot-y2axis-tick', 'jqplot-y3axis-tick', + 'jqplot-y4axis-tick', 'jqplot-y5axis-tick', 'jqplot-y6axis-tick', 'jqplot-y7axis-tick', 'jqplot-y8axis-tick', 'jqplot-y9axis-tick', + 'jqplot-xaxis-label', 'jqplot-x2axis-label', 'jqplot-yaxis-label', 'jqplot-y2axis-label', 'jqplot-y3axis-label', 'jqplot-y4axis-label', + 'jqplot-y5axis-label', 'jqplot-y6axis-label', 'jqplot-y7axis-label', 'jqplot-y8axis-label', 'jqplot-y9axis-label' ]; + + var temptop, templeft, tempbottom, tempright; + + for (var i = 0; i < clses.length; i++) { + $(this).find('.'+clses[i]).each(function() { + temptop = $(this).offset().top - plottop; + templeft = $(this).offset().left - plotleft; + tempright = templeft + $(this).outerWidth(true) + transx; + tempbottom = temptop + $(this).outerHeight(true) + transy; + if (templeft < -transx) { + w = w - transx - templeft; + transx = -templeft; + } + if (temptop < -transy) { + h = h - transy - temptop; + transy = - temptop; + } + if (tempright > w) { + w = tempright; + } + if (tempbottom > h) { + h = tempbottom; + } + }); + } + + newCanvas.width = w + Number(x_offset); + newCanvas.height = h + Number(y_offset); + + var newContext = newCanvas.getContext("2d"); + + newContext.save(); + newContext.fillStyle = backgroundColor; + newContext.fillRect(0,0, newCanvas.width, newCanvas.height); + newContext.restore(); + + newContext.translate(transx, transy); + newContext.textAlign = 'left'; + newContext.textBaseline = 'top'; + + function getLineheight(el) { + var lineheight = parseInt($(el).css('line-height'), 10); + + if (isNaN(lineheight)) { + lineheight = parseInt($(el).css('font-size'), 10) * 1.2; + } + return lineheight; + } + + function writeWrappedText (el, context, text, left, top, canvasWidth) { + var lineheight = getLineheight(el); + var tagwidth = $(el).innerWidth(); + var tagheight = $(el).innerHeight(); + var words = text.split(/\s+/); + var wl = words.length; + var w = ''; + var breaks = []; + var temptop = top; + var templeft = left; + + for (var i=0; i<wl; i++) { + w += words[i]; + if (context.measureText(w).width > tagwidth && w.length > words[i].length) { + breaks.push(i); + w = ''; + i--; + } + } + if (breaks.length === 0) { + // center text if necessary + if ($(el).css('textAlign') === 'center') { + templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx; + } + context.fillText(text, templeft, top); + } + else { + w = words.slice(0, breaks[0]).join(' '); + // center text if necessary + if ($(el).css('textAlign') === 'center') { + templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx; + } + context.fillText(w, templeft, temptop); + temptop += lineheight; + for (var i=1, l=breaks.length; i<l; i++) { + w = words.slice(breaks[i-1], breaks[i]).join(' '); + // center text if necessary + if ($(el).css('textAlign') === 'center') { + templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx; + } + context.fillText(w, templeft, temptop); + temptop += lineheight; + } + w = words.slice(breaks[i-1], words.length).join(' '); + // center text if necessary + if ($(el).css('textAlign') === 'center') { + templeft = left + (canvasWidth - context.measureText(w).width)/2 - transx; + } + context.fillText(w, templeft, temptop); + } + + } + + function _jqpToImage(el, x_offset, y_offset) { + var tagname = el.tagName.toLowerCase(); + var p = $(el).position(); + var css = window.getComputedStyle ? window.getComputedStyle(el, "") : el.currentStyle; // for IE < 9 + var left = x_offset + p.left + parseInt(css.marginLeft, 10) + parseInt(css.borderLeftWidth, 10) + parseInt(css.paddingLeft, 10); + var top = y_offset + p.top + parseInt(css.marginTop, 10) + parseInt(css.borderTopWidth, 10)+ parseInt(css.paddingTop, 10); + var w = newCanvas.width; + // var left = x_offset + p.left + $(el).css('marginLeft') + $(el).css('borderLeftWidth') + + // somehow in here, for divs within divs, the width of the inner div should be used instead of the canvas. + + if ((tagname == 'div' || tagname == 'span') && !$(el).hasClass('jqplot-highlighter-tooltip')) { + $(el).children().each(function() { + _jqpToImage(this, left, top); + }); + var text = $(el).jqplotChildText(); + + if (text) { + newContext.font = $(el).jqplotGetComputedFontStyle(); + newContext.fillStyle = $(el).css('color'); + + writeWrappedText(el, newContext, text, left, top, w); + } + } + + // handle the standard table legend + + else if (tagname === 'table' && $(el).hasClass('jqplot-table-legend')) { + newContext.strokeStyle = $(el).css('border-top-color'); + newContext.fillStyle = $(el).css('background-color'); + newContext.fillRect(left, top, $(el).innerWidth(), $(el).innerHeight()); + if (parseInt($(el).css('border-top-width'), 10) > 0) { + newContext.strokeRect(left, top, $(el).innerWidth(), $(el).innerHeight()); + } + + // find all the swatches + $(el).find('div.jqplot-table-legend-swatch-outline').each(function() { + // get the first div and stroke it + var elem = $(this); + newContext.strokeStyle = elem.css('border-top-color'); + var l = left + elem.position().left; + var t = top + elem.position().top; + newContext.strokeRect(l, t, elem.innerWidth(), elem.innerHeight()); + + // now fill the swatch + + l += parseInt(elem.css('padding-left'), 10); + t += parseInt(elem.css('padding-top'), 10); + var h = elem.innerHeight() - 2 * parseInt(elem.css('padding-top'), 10); + var w = elem.innerWidth() - 2 * parseInt(elem.css('padding-left'), 10); + + var swatch = elem.children('div.jqplot-table-legend-swatch'); + newContext.fillStyle = swatch.css('background-color'); + newContext.fillRect(l, t, w, h); + }); + + // now add text + + $(el).find('td.jqplot-table-legend-label').each(function(){ + var elem = $(this); + var l = left + elem.position().left; + var t = top + elem.position().top + parseInt(elem.css('padding-top'), 10); + newContext.font = elem.jqplotGetComputedFontStyle(); + newContext.fillStyle = elem.css('color'); + writeWrappedText(elem, newContext, elem.text(), l, t, w); + }); + + var elem = null; + } + + else if (tagname == 'canvas') { + newContext.drawImage(el, left, top); + } + } + $(this).children().each(function() { + _jqpToImage(this, x_offset, y_offset); + }); + return newCanvas; + }; + + // return the raw image data string. + // Should work on canvas supporting browsers. + $.fn.jqplotToImageStr = function(options) { + var imgCanvas = $(this).jqplotToImageCanvas(options); + if (imgCanvas) { + return imgCanvas.toDataURL("image/png"); + } + else { + return null; + } + }; + + // return a DOM <img> element and return it. + // Should work on canvas supporting browsers. + $.fn.jqplotToImageElem = function(options) { + var elem = document.createElement("img"); + var str = $(this).jqplotToImageStr(options); + elem.src = str; + return elem; + }; + + // return a string for an <img> element and return it. + // Should work on canvas supporting browsers. + $.fn.jqplotToImageElemStr = function(options) { + var str = '<img src='+$(this).jqplotToImageStr(options)+' />'; + return str; + }; + + // Not guaranteed to work, even on canvas supporting browsers due to + // limitations with location.href and browser support. + $.fn.jqplotSaveImage = function() { + var imgData = $(this).jqplotToImageStr({}); + if (imgData) { + window.location.href = imgData.replace("image/png", "image/octet-stream"); + } + + }; + + // Not guaranteed to work, even on canvas supporting browsers due to + // limitations with window.open and arbitrary data. + $.fn.jqplotViewImage = function() { + var imgStr = $(this).jqplotToImageElemStr({}); + var imgData = $(this).jqplotToImageStr({}); + if (imgStr) { + var w = window.open(''); + w.document.open("image/png"); + w.document.write(imgStr); + w.document.close(); + w = null; + } + }; + + + + + /** + * @description + * <p>Object with extended date parsing and formatting capabilities. + * This library borrows many concepts and ideas from the Date Instance + * Methods by Ken Snyder along with some parts of Ken's actual code.</p> + * + * <p>jsDate takes a different approach by not extending the built-in + * Date Object, improving date parsing, allowing for multiple formatting + * syntaxes and multiple and more easily expandable localization.</p> + * + * @author Chris Leonello + * @date #date# + * @version #VERSION# + * @copyright (c) 2010-2015 Chris Leonello + * jsDate is currently available for use in all personal or commercial projects + * under both the MIT and GPL version 2.0 licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * <p>Ken's original Date Instance Methods and copyright notice:</p> + * <pre> + * Ken Snyder (ken d snyder at gmail dot com) + * 2008-09-10 + * version 2.0.2 (http://kendsnyder.com/sandbox/date/) + * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/) + * </pre> + * + * @class + * @name jsDate + * @param {String | Number | Array | Date Object | Options Object} arguments Optional arguments, either a parsable date/time string, + * a JavaScript timestamp, an array of numbers of form [year, month, day, hours, minutes, seconds, milliseconds], + * a Date object, or an options object of form {syntax: "perl", date:some Date} where all options are optional. + */ + + var jsDate = function () { + + this.syntax = jsDate.config.syntax; + this._type = "jsDate"; + this.proxy = new Date(); + this.options = {}; + this.locale = jsDate.regional.getLocale(); + this.formatString = ''; + this.defaultCentury = jsDate.config.defaultCentury; + + switch ( arguments.length ) { + case 0: + break; + case 1: + // other objects either won't have a _type property or, + // if they do, it shouldn't be set to "jsDate", so + // assume it is an options argument. + if (get_type(arguments[0]) == "[object Object]" && arguments[0]._type != "jsDate") { + var opts = this.options = arguments[0]; + this.syntax = opts.syntax || this.syntax; + this.defaultCentury = opts.defaultCentury || this.defaultCentury; + this.proxy = jsDate.createDate(opts.date); + } + else { + this.proxy = jsDate.createDate(arguments[0]); + } + break; + default: + var a = []; + for ( var i=0; i<arguments.length; i++ ) { + a.push(arguments[i]); + } + // this should be the current date/time? + this.proxy = new Date(); + this.proxy.setFullYear.apply( this.proxy, a.slice(0,3) ); + if ( a.slice(3).length ) { + this.proxy.setHours.apply( this.proxy, a.slice(3) ); + } + break; + } + }; + + /** + * @namespace Configuration options that will be used as defaults for all instances on the page. + * @property {String} defaultLocale The default locale to use [en]. + * @property {String} syntax The default syntax to use [perl]. + * @property {Number} defaultCentury The default centry for 2 digit dates. + */ + jsDate.config = { + defaultLocale: 'en', + syntax: 'perl', + defaultCentury: 1900 + }; + + /** + * Add an arbitrary amount to the currently stored date + * + * @param {Number} number + * @param {String} unit + * @returns {jsDate} + */ + + jsDate.prototype.add = function(number, unit) { + var factor = multipliers[unit] || multipliers.day; + if (typeof factor == 'number') { + this.proxy.setTime(this.proxy.getTime() + (factor * number)); + } else { + factor.add(this, number); + } + return this; + }; + + /** + * Create a new jqplot.date object with the same date + * + * @returns {jsDate} + */ + + jsDate.prototype.clone = function() { + return new jsDate(this.proxy.getTime()); + }; + + /** + * Get the UTC TimeZone Offset of this date in milliseconds. + * + * @returns {Number} + */ + + jsDate.prototype.getUtcOffset = function() { + return this.proxy.getTimezoneOffset() * 60000; + }; + + /** + * Find the difference between this jsDate and another date. + * + * @param {String| Number| Array| jsDate Object| Date Object} dateObj + * @param {String} unit + * @param {Boolean} allowDecimal + * @returns {Number} Number of units difference between dates. + */ + + jsDate.prototype.diff = function(dateObj, unit, allowDecimal) { + // ensure we have a Date object + dateObj = new jsDate(dateObj); + if (dateObj === null) { + return null; + } + // get the multiplying factor integer or factor function + var factor = multipliers[unit] || multipliers.day; + if (typeof factor == 'number') { + // multiply + var unitDiff = (this.proxy.getTime() - dateObj.proxy.getTime()) / factor; + } else { + // run function + var unitDiff = factor.diff(this.proxy, dateObj.proxy); + } + // if decimals are not allowed, round toward zero + return (allowDecimal ? unitDiff : Math[unitDiff > 0 ? 'floor' : 'ceil'](unitDiff)); + }; + + /** + * Get the abbreviated name of the current week day + * + * @returns {String} + */ + + jsDate.prototype.getAbbrDayName = function() { + return jsDate.regional[this.locale]["dayNamesShort"][this.proxy.getDay()]; + }; + + /** + * Get the abbreviated name of the current month + * + * @returns {String} + */ + + jsDate.prototype.getAbbrMonthName = function() { + return jsDate.regional[this.locale]["monthNamesShort"][this.proxy.getMonth()]; + }; + + /** + * Get UPPER CASE AM or PM for the current time + * + * @returns {String} + */ + + jsDate.prototype.getAMPM = function() { + return this.proxy.getHours() >= 12 ? 'PM' : 'AM'; + }; + + /** + * Get lower case am or pm for the current time + * + * @returns {String} + */ + + jsDate.prototype.getAmPm = function() { + return this.proxy.getHours() >= 12 ? 'pm' : 'am'; + }; + + /** + * Get the century (19 for 20th Century) + * + * @returns {Integer} Century (19 for 20th century). + */ + jsDate.prototype.getCentury = function() { + return parseInt(this.proxy.getFullYear()/100, 10); + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getDate = function() { + return this.proxy.getDate(); + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getDay = function() { + return this.proxy.getDay(); + }; + + /** + * Get the Day of week 1 (Monday) thru 7 (Sunday) + * + * @returns {Integer} Day of week 1 (Monday) thru 7 (Sunday) + */ + jsDate.prototype.getDayOfWeek = function() { + var dow = this.proxy.getDay(); + return dow===0?7:dow; + }; + + /** + * Get the day of the year + * + * @returns {Integer} 1 - 366, day of the year + */ + jsDate.prototype.getDayOfYear = function() { + var d = this.proxy; + var ms = d - new Date('' + d.getFullYear() + '/1/1 GMT'); + ms += d.getTimezoneOffset()*60000; + d = null; + return parseInt(ms/60000/60/24, 10)+1; + }; + + /** + * Get the name of the current week day + * + * @returns {String} + */ + + jsDate.prototype.getDayName = function() { + return jsDate.regional[this.locale]["dayNames"][this.proxy.getDay()]; + }; + + /** + * Get the week number of the given year, starting with the first Sunday as the first week + * @returns {Integer} Week number (13 for the 13th full week of the year). + */ + jsDate.prototype.getFullWeekOfYear = function() { + var d = this.proxy; + var doy = this.getDayOfYear(); + var rdow = 6-d.getDay(); + var woy = parseInt((doy+rdow)/7, 10); + return woy; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getFullYear = function() { + return this.proxy.getFullYear(); + }; + + /** + * Get the GMT offset in hours and minutes (e.g. +06:30) + * + * @returns {String} + */ + + jsDate.prototype.getGmtOffset = function() { + // divide the minutes offset by 60 + var hours = this.proxy.getTimezoneOffset() / 60; + // decide if we are ahead of or behind GMT + var prefix = hours < 0 ? '+' : '-'; + // remove the negative sign if any + hours = Math.abs(hours); + // add the +/- to the padded number of hours to : to the padded minutes + return prefix + addZeros(Math.floor(hours), 2) + ':' + addZeros((hours % 1) * 60, 2); + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getHours = function() { + return this.proxy.getHours(); + }; + + /** + * Get the current hour on a 12-hour scheme + * + * @returns {Integer} + */ + + jsDate.prototype.getHours12 = function() { + var hours = this.proxy.getHours(); + return hours > 12 ? hours - 12 : (hours == 0 ? 12 : hours); + }; + + + jsDate.prototype.getIsoWeek = function() { + var d = this.proxy; + var woy = this.getWeekOfYear(); + var dow1_1 = (new Date('' + d.getFullYear() + '/1/1')).getDay(); + // First week is 01 and not 00 as in the case of %U and %W, + // so we add 1 to the final result except if day 1 of the year + // is a Monday (then %W returns 01). + // We also need to subtract 1 if the day 1 of the year is + // Friday-Sunday, so the resulting equation becomes: + var idow = woy + (dow1_1 > 4 || dow1_1 <= 1 ? 0 : 1); + if(idow == 53 && (new Date('' + d.getFullYear() + '/12/31')).getDay() < 4) + { + idow = 1; + } + else if(idow === 0) + { + d = new jsDate(new Date('' + (d.getFullYear()-1) + '/12/31')); + idow = d.getIsoWeek(); + } + d = null; + return idow; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getMilliseconds = function() { + return this.proxy.getMilliseconds(); + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getMinutes = function() { + return this.proxy.getMinutes(); + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getMonth = function() { + return this.proxy.getMonth(); + }; + + /** + * Get the name of the current month + * + * @returns {String} + */ + + jsDate.prototype.getMonthName = function() { + return jsDate.regional[this.locale]["monthNames"][this.proxy.getMonth()]; + }; + + /** + * Get the number of the current month, 1-12 + * + * @returns {Integer} + */ + + jsDate.prototype.getMonthNumber = function() { + return this.proxy.getMonth() + 1; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getSeconds = function() { + return this.proxy.getSeconds(); + }; + + /** + * Return a proper two-digit year integer + * + * @returns {Integer} + */ + + jsDate.prototype.getShortYear = function() { + return this.proxy.getYear() % 100; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getTime = function() { + return this.proxy.getTime(); + }; + + /** + * Get the timezone abbreviation + * + * @returns {String} Abbreviation for the timezone + */ + jsDate.prototype.getTimezoneAbbr = function() { + return this.proxy.toString().replace(/^.*\(([^)]+)\)$/, '$1'); + }; + + /** + * Get the browser-reported name for the current timezone (e.g. MDT, Mountain Daylight Time) + * + * @returns {String} + */ + jsDate.prototype.getTimezoneName = function() { + var match = /(?:\((.+)\)$| ([A-Z]{3}) )/.exec(this.toString()); + return match[1] || match[2] || 'GMT' + this.getGmtOffset(); + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getTimezoneOffset = function() { + return this.proxy.getTimezoneOffset(); + }; + + + /** + * Get the week number of the given year, starting with the first Monday as the first week + * @returns {Integer} Week number (13 for the 13th week of the year). + */ + jsDate.prototype.getWeekOfYear = function() { + var doy = this.getDayOfYear(); + var rdow = 7 - this.getDayOfWeek(); + var woy = parseInt((doy+rdow)/7, 10); + return woy; + }; + + /** + * Get the current date as a Unix timestamp + * + * @returns {Integer} + */ + + jsDate.prototype.getUnix = function() { + return Math.round(this.proxy.getTime() / 1000, 0); + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.getYear = function() { + return this.proxy.getYear(); + }; + + /** + * Return a date one day ahead (or any other unit) + * + * @param {String} unit Optional, year | month | day | week | hour | minute | second | millisecond + * @returns {jsDate} + */ + + jsDate.prototype.next = function(unit) { + unit = unit || 'day'; + return this.clone().add(1, unit); + }; + + /** + * Set the jsDate instance to a new date. + * + * @param {String | Number | Array | Date Object | jsDate Object | Options Object} arguments Optional arguments, + * either a parsable date/time string, + * a JavaScript timestamp, an array of numbers of form [year, month, day, hours, minutes, seconds, milliseconds], + * a Date object, jsDate Object or an options object of form {syntax: "perl", date:some Date} where all options are optional. + */ + jsDate.prototype.set = function() { + switch ( arguments.length ) { + case 0: + this.proxy = new Date(); + break; + case 1: + // other objects either won't have a _type property or, + // if they do, it shouldn't be set to "jsDate", so + // assume it is an options argument. + if (get_type(arguments[0]) == "[object Object]" && arguments[0]._type != "jsDate") { + var opts = this.options = arguments[0]; + this.syntax = opts.syntax || this.syntax; + this.defaultCentury = opts.defaultCentury || this.defaultCentury; + this.proxy = jsDate.createDate(opts.date); + } + else { + this.proxy = jsDate.createDate(arguments[0]); + } + break; + default: + var a = []; + for ( var i=0; i<arguments.length; i++ ) { + a.push(arguments[i]); + } + // this should be the current date/time + this.proxy = new Date(); + this.proxy.setFullYear.apply( this.proxy, a.slice(0,3) ); + if ( a.slice(3).length ) { + this.proxy.setHours.apply( this.proxy, a.slice(3) ); + } + break; + } + return this; + }; + + /** + * Sets the day of the month for a specified date according to local time. + * @param {Integer} dayValue An integer from 1 to 31, representing the day of the month. + */ + jsDate.prototype.setDate = function(n) { + this.proxy.setDate(n); + return this; + }; + + /** + * Sets the full year for a specified date according to local time. + * @param {Integer} yearValue The numeric value of the year, for example, 1995. + * @param {Integer} monthValue Optional, between 0 and 11 representing the months January through December. + * @param {Integer} dayValue Optional, between 1 and 31 representing the day of the month. If you specify the dayValue parameter, you must also specify the monthValue. + */ + jsDate.prototype.setFullYear = function() { + this.proxy.setFullYear.apply(this.proxy, arguments); + return this; + }; + + /** + * Sets the hours for a specified date according to local time. + * + * @param {Integer} hoursValue An integer between 0 and 23, representing the hour. + * @param {Integer} minutesValue Optional, An integer between 0 and 59, representing the minutes. + * @param {Integer} secondsValue Optional, An integer between 0 and 59, representing the seconds. + * If you specify the secondsValue parameter, you must also specify the minutesValue. + * @param {Integer} msValue Optional, A number between 0 and 999, representing the milliseconds. + * If you specify the msValue parameter, you must also specify the minutesValue and secondsValue. + */ + jsDate.prototype.setHours = function() { + this.proxy.setHours.apply(this.proxy, arguments); + return this; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.setMilliseconds = function(n) { + this.proxy.setMilliseconds(n); + return this; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.setMinutes = function() { + this.proxy.setMinutes.apply(this.proxy, arguments); + return this; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.setMonth = function() { + this.proxy.setMonth.apply(this.proxy, arguments); + return this; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.setSeconds = function() { + this.proxy.setSeconds.apply(this.proxy, arguments); + return this; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.setTime = function(n) { + this.proxy.setTime(n); + return this; + }; + + /** + * Implements Date functionality + */ + jsDate.prototype.setYear = function() { + this.proxy.setYear.apply(this.proxy, arguments); + return this; + }; + + /** + * Provide a formatted string representation of this date. + * + * @param {String} formatString A format string. + * See: {@link jsDate.formats}. + * @returns {String} Date String. + */ + + jsDate.prototype.strftime = function(formatString) { + formatString = formatString || this.formatString || jsDate.regional[this.locale]['formatString']; + return jsDate.strftime(this, formatString, this.syntax); + }; + + /** + * Return a String representation of this jsDate object. + * @returns {String} Date string. + */ + + jsDate.prototype.toString = function() { + return this.proxy.toString(); + }; + + /** + * Convert the current date to an 8-digit integer (%Y%m%d) + * + * @returns {Integer} + */ + + jsDate.prototype.toYmdInt = function() { + return (this.proxy.getFullYear() * 10000) + (this.getMonthNumber() * 100) + this.proxy.getDate(); + }; + + /** + * @namespace Holds localizations for month/day names. + * <p>jsDate attempts to detect locale when loaded and defaults to 'en'. + * If a localization is detected which is not available, jsDate defaults to 'en'. + * Additional localizations can be added after jsDate loads. After adding a localization, + * call the jsDate.regional.getLocale() method. Currently, en, fr and de are defined.</p> + * + * <p>Localizations must be an object and have the following properties defined: monthNames, monthNamesShort, dayNames, dayNamesShort and Localizations are added like:</p> + * <pre class="code"> + * jsDate.regional['en'] = { + * monthNames : 'January February March April May June July August September October November December'.split(' '), + * monthNamesShort : 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '), + * dayNames : 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday'.split(' '), + * dayNamesShort : 'Sun Mon Tue Wed Thu Fri Sat'.split(' ') + * }; + * </pre> + * <p>After adding localizations, call <code>jsDate.regional.getLocale();</code> to update the locale setting with the + * new localizations.</p> + */ + + jsDate.regional = { + 'en': { + monthNames: ['January','February','March','April','May','June','July','August','September','October','November','December'], + monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun','Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], + dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], + dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'fr': { + monthNames: ['Janvier','F茅vrier','Mars','Avril','Mai','Juin','Juillet','Ao没t','Septembre','Octobre','Novembre','D茅cembre'], + monthNamesShort: ['Jan','F茅v','Mar','Avr','Mai','Jun','Jul','Ao没','Sep','Oct','Nov','D茅c'], + dayNames: ['Dimanche','Lundi','Mardi','Mercredi','Jeudi','Vendredi','Samedi'], + dayNamesShort: ['Dim','Lun','Mar','Mer','Jeu','Ven','Sam'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'de': { + monthNames: ['Januar','Februar','M盲rz','April','Mai','Juni','Juli','August','September','Oktober','November','Dezember'], + monthNamesShort: ['Jan','Feb','M盲r','Apr','Mai','Jun','Jul','Aug','Sep','Okt','Nov','Dez'], + dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'], + dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'es': { + monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio', 'Julio','Agosto','Septiembre','Octubre','Noviembre','Diciembre'], + monthNamesShort: ['Ene','Feb','Mar','Abr','May','Jun', 'Jul','Ago','Sep','Oct','Nov','Dic'], + dayNames: ['Domingo','Lunes','Martes','Miércoles','Jueves','Viernes','Sábado'], + dayNamesShort: ['Dom','Lun','Mar','Mié','Juv','Vie','Sáb'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'ru': { + monthNames: ['携薪胁邪褉褜','肖械胁褉邪谢褜','袦邪褉褌','袗锌褉械谢褜','袦邪泄','袠褞薪褜','袠褞谢褜','袗胁谐褍褋褌','小械薪褌褟斜褉褜','袨泻褌褟斜褉褜','袧芯褟斜褉褜','袛械泻邪斜褉褜'], + monthNamesShort: ['携薪胁','肖械胁','袦邪褉','袗锌褉','袦邪泄','袠褞薪','袠褞谢','袗胁谐','小械薪','袨泻褌','袧芯褟','袛械泻'], + dayNames: ['胁芯褋泻褉械褋械薪褜械','锌芯薪械写械谢褜薪懈泻','胁褌芯褉薪懈泻','褋褉械写邪','褔械褌胁械褉谐','锌褟褌薪懈褑邪','褋褍斜斜芯褌邪'], + dayNamesShort: ['胁褋泻','锌薪写','胁褌褉','褋褉写','褔褌胁','锌褌薪','褋斜褌'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'ar': { + monthNames: ['賰丕賳賵賳 丕賱孬丕賳賷', '卮亘丕胤', '丌匕丕乇', '賳賷爻丕賳', '丌匕丕乇', '丨夭賷乇丕賳','鬲賲賵夭', '丌亘', '兀賷賱賵賱', '鬲卮乇賷賳 丕賱兀賵賱', '鬲卮乇賷賳 丕賱孬丕賳賷', '賰丕賳賵賳 丕賱兀賵賱'], + monthNamesShort: ['1','2','3','4','5','6','7','8','9','10','11','12'], + dayNames: ['丕賱爻亘鬲', '丕賱兀丨丿', '丕賱丕孬賳賷賳', '丕賱孬賱丕孬丕亍', '丕賱兀乇亘毓丕亍', '丕賱禺賲賷爻', '丕賱噩賲毓丞'], + dayNamesShort: ['爻亘鬲', '兀丨丿', '丕孬賳賷賳', '孬賱丕孬丕亍', '兀乇亘毓丕亍', '禺賲賷爻', '噩賲毓丞'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'pt': { + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'], + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'pt-BR': { + monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho', 'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'], + monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'], + dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'], + dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'pl': { + monthNames: ['Stycze艅','Luty','Marzec','Kwiecie艅','Maj','Czerwiec','Lipiec','Sierpie艅','Wrzesie艅','Pa藕dziernik','Listopad','Grudzie艅'], + monthNamesShort: ['Sty', 'Lut', 'Mar', 'Kwi', 'Maj', 'Cze','Lip', 'Sie', 'Wrz', 'Pa藕', 'Lis', 'Gru'], + dayNames: ['Niedziela', 'Poniedzia艂ek', 'Wtorek', '艢roda', 'Czwartek', 'Pi膮tek', 'Sobota'], + dayNamesShort: ['Ni', 'Pn', 'Wt', '艢r', 'Cz', 'Pt', 'Sb'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'nl': { + monthNames: ['Januari','Februari','Maart','April','Mei','Juni','July','Augustus','September','Oktober','November','December'], + monthNamesShort: ['Jan','Feb','Mar','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec'], + dayNames:','['Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'], + dayNamesShort: ['Zo','Ma','Di','Wo','Do','Vr','Za'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'sv': { + monthNames: ['januari','februari','mars','april','maj','juni','juli','augusti','september','oktober','november','december'], + monthNamesShort: ['jan','feb','mar','apr','maj','jun','jul','aug','sep','okt','nov','dec'], + dayNames: ['s枚ndag','m氓ndag','tisdag','onsdag','torsdag','fredag','l枚rdag'], + dayNamesShort: ['s枚n','m氓n','tis','ons','tor','fre','l枚r'], + formatString: '%Y-%m-%d %H:%M:%S' + }, + + 'it': { + monthNames: ['Gennaio','Febbraio','Marzo','Aprile','Maggio','Giugno','Luglio','Agosto','Settembre','Ottobre','Novembre','Dicembre'], + monthNamesShort: ['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'], + dayNames: ['Domenica','Lunedi','Martedi','Mercoledi','Giovedi','Venerdi','Sabato'], + dayNamesShort: ['Dom','Lun','Mar','Mer','Gio','Ven','Sab'], + formatString: '%d-%m-%Y %H:%M:%S' + } + + }; + + // Set english variants to 'en' + jsDate.regional['en-US'] = jsDate.regional['en-GB'] = jsDate.regional['en']; + + /** + * Try to determine the users locale based on the lang attribute of the html page. Defaults to 'en' + * if it cannot figure out a locale of if the locale does not have a localization defined. + * @returns {String} locale + */ + + jsDate.regional.getLocale = function () { + var l = jsDate.config.defaultLocale; + + if ( document && document.getElementsByTagName('html') && document.getElementsByTagName('html')[0].lang ) { + l = document.getElementsByTagName('html')[0].lang; + if (!jsDate.regional.hasOwnProperty(l)) { + l = jsDate.config.defaultLocale; + } + } + + return l; + }; + + // ms in day + var day = 24 * 60 * 60 * 1000; + + // padd a number with zeros + var addZeros = function(num, digits) { + num = String(num); + var i = digits - num.length; + var s = String(Math.pow(10, i)).slice(1); + return s.concat(num); + }; + + // representations used for calculating differences between dates. + // This borrows heavily from Ken Snyder's work. + var multipliers = { + millisecond: 1, + second: 1000, + minute: 60 * 1000, + hour: 60 * 60 * 1000, + day: day, + week: 7 * day, + month: { + // add a number of months + add: function(d, number) { + // add any years needed (increments of 12) + multipliers.year.add(d, Math[number > 0 ? 'floor' : 'ceil'](number / 12)); + // ensure that we properly wrap betwen December and January + // 11 % 12 = 11 + // 12 % 12 = 0 + var prevMonth = d.getMonth() + (number % 12); + if (prevMonth == 12) { + prevMonth = 0; + d.setYear(d.getFullYear() + 1); + } else if (prevMonth == -1) { + prevMonth = 11; + d.setYear(d.getFullYear() - 1); + } + d.setMonth(prevMonth); + }, + // get the number of months between two Date objects (decimal to the nearest day) + diff: function(d1, d2) { + // get the number of years + var diffYears = d1.getFullYear() - d2.getFullYear(); + // get the number of remaining months + var diffMonths = d1.getMonth() - d2.getMonth() + (diffYears * 12); + // get the number of remaining days + var diffDays = d1.getDate() - d2.getDate(); + // return the month difference with the days difference as a decimal + return diffMonths + (diffDays / 30); + } + }, + year: { + // add a number of years + add: function(d, number) { + d.setYear(d.getFullYear() + Math[number > 0 ? 'floor' : 'ceil'](number)); + }, + // get the number of years between two Date objects (decimal to the nearest day) + diff: function(d1, d2) { + return multipliers.month.diff(d1, d2) / 12; + } + } + }; + // + // Alias each multiplier with an 's' to allow 'year' and 'years' for example. + // This comes from Ken Snyders work. + // + for (var unit in multipliers) { + if (unit.substring(unit.length - 1) != 's') { // IE will iterate newly added properties :| + multipliers[unit + 's'] = multipliers[unit]; + } + } + + // + // take a jsDate instance and a format code and return the formatted value. + // This is a somewhat modified version of Ken Snyder's method. + // + var format = function(d, code, syntax) { + // if shorcut codes are used, recursively expand those. + if (jsDate.formats[syntax]["shortcuts"][code]) { + return jsDate.strftime(d, jsDate.formats[syntax]["shortcuts"][code], syntax); + } else { + // get the format code function and addZeros() argument + var getter = (jsDate.formats[syntax]["codes"][code] || '').split('.'); + var nbr = d['get' + getter[0]] ? d['get' + getter[0]]() : ''; + if (getter[1]) { + nbr = addZeros(nbr, getter[1]); + } + return nbr; + } + }; + + /** + * @static + * Static function for convert a date to a string according to a given format. Also acts as namespace for strftime format codes. + * <p>strftime formatting can be accomplished without creating a jsDate object by calling jsDate.strftime():</p> + * <pre class="code"> + * var formattedDate = jsDate.strftime('Feb 8, 2006 8:48:32', '%Y-%m-%d %H:%M:%S'); + * </pre> + * @param {String | Number | Array | jsDate Object | Date Object} date A parsable date string, JavaScript time stamp, Array of form [year, month, day, hours, minutes, seconds, milliseconds], jsDate Object or Date object. + * @param {String} formatString String with embedded date formatting codes. + * See: {@link jsDate.formats}. + * @param {String} syntax Optional syntax to use [default perl]. + * @param {String} locale Optional locale to use. + * @returns {String} Formatted representation of the date. + */ + // + // Logic as implemented here is very similar to Ken Snyder's Date Instance Methods. + // + jsDate.strftime = function(d, formatString, syntax, locale) { + var syn = 'perl'; + var loc = jsDate.regional.getLocale(); + + // check if syntax and locale are available or reversed + if (syntax && jsDate.formats.hasOwnProperty(syntax)) { + syn = syntax; + } + else if (syntax && jsDate.regional.hasOwnProperty(syntax)) { + loc = syntax; + } + + if (locale && jsDate.formats.hasOwnProperty(locale)) { + syn = locale; + } + else if (locale && jsDate.regional.hasOwnProperty(locale)) { + loc = locale; + } + + if (get_type(d) != "[object Object]" || d._type != "jsDate") { + d = new jsDate(d); + d.locale = loc; + } + if (!formatString) { + formatString = d.formatString || jsDate.regional[loc]['formatString']; + } + // default the format string to year-month-day + var source = formatString || '%Y-%m-%d', + result = '', + match; + // replace each format code + while (source.length > 0) { + if (match = source.match(jsDate.formats[syn].codes.matcher)) { + result += source.slice(0, match.index); + result += (match[1] || '') + format(d, match[2], syn); + source = source.slice(match.index + match[0].length); + } else { + result += source; + source = ''; + } + } + return result; + }; + + /** + * @namespace + * Namespace to hold format codes and format shortcuts. "perl" and "php" format codes + * and shortcuts are defined by default. Additional codes and shortcuts can be + * added like: + * + * <pre class="code"> + * jsDate.formats["perl"] = { + * "codes": { + * matcher: /someregex/, + * Y: "fullYear", // name of "get" method without the "get", + * ..., // more codes + * }, + * "shortcuts": { + * F: '%Y-%m-%d', + * ..., // more shortcuts + * } + * }; + * </pre> + * + * <p>Additionally, ISO and SQL shortcuts are defined and can be accesses via: + * <code>jsDate.formats.ISO</code> and <code>jsDate.formats.SQL</code> + */ + + jsDate.formats = { + ISO:'%Y-%m-%dT%H:%M:%S.%N%G', + SQL:'%Y-%m-%d %H:%M:%S' + }; + + /** + * Perl format codes and shortcuts for strftime. + * + * A hash (object) of codes where each code must be an array where the first member is + * the name of a Date.prototype or jsDate.prototype function to call + * and optionally a second member indicating the number to pass to addZeros() + * + * <p>The following format codes are defined:</p> + * + * <pre class="code"> + * Code Result Description + * == Years == + * %Y 2008 Four-digit year + * %y 08 Two-digit year + * + * == Months == + * %m 09 Two-digit month + * %#m 9 One or two-digit month + * %B September Full month name + * %b Sep Abbreviated month name + * + * == Days == + * %d 05 Two-digit day of month + * %#d 5 One or two-digit day of month + * %e 5 One or two-digit day of month + * %A Sunday Full name of the day of the week + * %a Sun Abbreviated name of the day of the week + * %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday) + * + * == Hours == + * %H 23 Hours in 24-hour format (two digits) + * %#H 3 Hours in 24-hour integer format (one or two digits) + * %I 11 Hours in 12-hour format (two digits) + * %#I 3 Hours in 12-hour integer format (one or two digits) + * %p PM AM or PM + * + * == Minutes == + * %M 09 Minutes (two digits) + * %#M 9 Minutes (one or two digits) + * + * == Seconds == + * %S 02 Seconds (two digits) + * %#S 2 Seconds (one or two digits) + * %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00) + * + * == Milliseconds == + * %N 008 Milliseconds (three digits) + * %#N 8 Milliseconds (one to three digits) + * + * == Timezone == + * %O 360 difference in minutes between local time and GMT + * %Z Mountain Standard Time Name of timezone as reported by browser + * %G 06:00 Hours and minutes between GMT + * + * == Shortcuts == + * %F 2008-03-26 %Y-%m-%d + * %T 05:06:30 %H:%M:%S + * %X 05:06:30 %H:%M:%S + * %x 03/26/08 %m/%d/%y + * %D 03/26/08 %m/%d/%y + * %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y + * %v 3-Sep-2008 %e-%b-%Y + * %R 15:31 %H:%M + * %r 03:31:00 PM %I:%M:%S %p + * + * == Characters == + * %n \n Newline + * %t \t Tab + * %% % Percent Symbol + * </pre> + * + * <p>Formatting shortcuts that will be translated into their longer version. + * Be sure that format shortcuts do not refer to themselves: this will cause an infinite loop.</p> + * + * <p>Format codes and format shortcuts can be redefined after the jsDate + * module is imported.</p> + * + * <p>Note that if you redefine the whole hash (object), you must supply a "matcher" + * regex for the parser. The default matcher is:</p> + * + * <code>/()%(#?(%|[a-z]))/i</code> + * + * <p>which corresponds to the Perl syntax used by default.</p> + * + * <p>By customizing the matcher and format codes, nearly any strftime functionality is possible.</p> + */ + + jsDate.formats.perl = { + codes: { + // + // 2-part regex matcher for format codes + // + // first match must be the character before the code (to account for escaping) + // second match must be the format code character(s) + // + matcher: /()%(#?(%|[a-z]))/i, + // year + Y: 'FullYear', + y: 'ShortYear.2', + // month + m: 'MonthNumber.2', + '#m': 'MonthNumber', + B: 'MonthName', + b: 'AbbrMonthName', + // day + d: 'Date.2', + '#d': 'Date', + e: 'Date', + A: 'DayName', + a: 'AbbrDayName', + w: 'Day', + // hours + H: 'Hours.2', + '#H': 'Hours', + I: 'Hours12.2', + '#I': 'Hours12', + p: 'AMPM', + // minutes + M: 'Minutes.2', + '#M': 'Minutes', + // seconds + S: 'Seconds.2', + '#S': 'Seconds', + s: 'Unix', + // milliseconds + N: 'Milliseconds.3', + '#N': 'Milliseconds', + // timezone + O: 'TimezoneOffset', + Z: 'TimezoneName', + G: 'GmtOffset' + }, + + shortcuts: { + // date + F: '%Y-%m-%d', + // time + T: '%H:%M:%S', + X: '%H:%M:%S', + // local format date + x: '%m/%d/%y', + D: '%m/%d/%y', + // local format extended + '#c': '%a %b %e %H:%M:%S %Y', + // local format short + v: '%e-%b-%Y', + R: '%H:%M', + r: '%I:%M:%S %p', + // tab and newline + t: '\t', + n: '\n', + '%': '%' + } + }; + + /** + * PHP format codes and shortcuts for strftime. + * + * A hash (object) of codes where each code must be an array where the first member is + * the name of a Date.prototype or jsDate.prototype function to call + * and optionally a second member indicating the number to pass to addZeros() + * + * <p>The following format codes are defined:</p> + * + * <pre class="code"> + * Code Result Description + * === Days === + * %a Sun through Sat An abbreviated textual representation of the day + * %A Sunday - Saturday A full textual representation of the day + * %d 01 to 31 Two-digit day of the month (with leading zeros) + * %e 1 to 31 Day of the month, with a space preceding single digits. + * %j 001 to 366 Day of the year, 3 digits with leading zeros + * %u 1 - 7 (Mon - Sun) ISO-8601 numeric representation of the day of the week + * %w 0 - 6 (Sun - Sat) Numeric representation of the day of the week + * + * === Week === + * %U 13 Full Week number, starting with the first Sunday as the first week + * %V 01 through 53 ISO-8601:1988 week number, starting with the first week of the year + * with at least 4 weekdays, with Monday being the start of the week + * %W 46 A numeric representation of the week of the year, + * starting with the first Monday as the first week + * === Month === + * %b Jan through Dec Abbreviated month name, based on the locale + * %B January - December Full month name, based on the locale + * %h Jan through Dec Abbreviated month name, based on the locale (an alias of %b) + * %m 01 - 12 (Jan - Dec) Two digit representation of the month + * + * === Year === + * %C 19 Two digit century (year/100, truncated to an integer) + * %y 09 for 2009 Two digit year + * %Y 2038 Four digit year + * + * === Time === + * %H 00 through 23 Two digit representation of the hour in 24-hour format + * %I 01 through 12 Two digit representation of the hour in 12-hour format + * %l 1 through 12 Hour in 12-hour format, with a space preceeding single digits + * %M 00 through 59 Two digit representation of the minute + * %p AM/PM UPPER-CASE 'AM' or 'PM' based on the given time + * %P am/pm lower-case 'am' or 'pm' based on the given time + * %r 09:34:17 PM Same as %I:%M:%S %p + * %R 00:35 Same as %H:%M + * %S 00 through 59 Two digit representation of the second + * %T 21:34:17 Same as %H:%M:%S + * %X 03:59:16 Preferred time representation based on locale, without the date + * %z -0500 or EST Either the time zone offset from UTC or the abbreviation + * %Z -0500 or EST The time zone offset/abbreviation option NOT given by %z + * + * === Time and Date === + * %D 02/05/09 Same as %m/%d/%y + * %F 2009-02-05 Same as %Y-%m-%d (commonly used in database datestamps) + * %s 305815200 Unix Epoch Time timestamp (same as the time() function) + * %x 02/05/09 Preferred date representation, without the time + * + * === Miscellaneous === + * %n --- A newline character (\n) + * %t --- A Tab character (\t) + * %% --- A literal percentage character (%) + * </pre> + */ + + jsDate.formats.php = { + codes: { + // + // 2-part regex matcher for format codes + // + // first match must be the character before the code (to account for escaping) + // second match must be the format code character(s) + // + matcher: /()%((%|[a-z]))/i, + // day + a: 'AbbrDayName', + A: 'DayName', + d: 'Date.2', + e: 'Date', + j: 'DayOfYear.3', + u: 'DayOfWeek', + w: 'Day', + // week + U: 'FullWeekOfYear.2', + V: 'IsoWeek.2', + W: 'WeekOfYear.2', + // month + b: 'AbbrMonthName', + B: 'MonthName', + m: 'MonthNumber.2', + h: 'AbbrMonthName', + // year + C: 'Century.2', + y: 'ShortYear.2', + Y: 'FullYear', + // time + H: 'Hours.2', + I: 'Hours12.2', + l: 'Hours12', + p: 'AMPM', + P: 'AmPm', + M: 'Minutes.2', + S: 'Seconds.2', + s: 'Unix', + O: 'TimezoneOffset', + z: 'GmtOffset', + Z: 'TimezoneAbbr' + }, + + shortcuts: { + D: '%m/%d/%y', + F: '%Y-%m-%d', + T: '%H:%M:%S', + X: '%H:%M:%S', + x: '%m/%d/%y', + R: '%H:%M', + r: '%I:%M:%S %p', + t: '\t', + n: '\n', + '%': '%' + } + }; + // + // Conceptually, the logic implemented here is similar to Ken Snyder's Date Instance Methods. + // I use his idea of a set of parsers which can be regular expressions or functions, + // iterating through those, and then seeing if Date.parse() will create a date. + // The parser expressions and functions are a little different and some bugs have been + // worked out. Also, a lot of "pre-parsing" is done to fix implementation + // variations of Date.parse() between browsers. + // + jsDate.createDate = function(date) { + // if passing in multiple arguments, try Date constructor + if (date == null) { + return new Date(); + } + // If the passed value is already a date object, return it + if (date instanceof Date) { + return date; + } + // if (typeof date == 'number') return new Date(date * 1000); + // If the passed value is an integer, interpret it as a javascript timestamp + if (typeof date == 'number') { + return new Date(date); + } + + // Before passing strings into Date.parse(), have to normalize them for certain conditions. + // If strings are not formatted staccording to the EcmaScript spec, results from Date parse will be implementation dependent. + // + // For example: + // * FF and Opera assume 2 digit dates are pre y2k, Chome assumes <50 is pre y2k, 50+ is 21st century. + // * Chrome will correctly parse '1984-1-25' into localtime, FF and Opera will not parse. + // * Both FF, Chrome and Opera will parse '1984/1/25' into localtime. + + // remove leading and trailing spaces + var parsable = String(date).replace(/^\s*(.+)\s*$/g, '$1'); + + // replace dahses (-) with slashes (/) in dates like n[nnn]/n[n]/n[nnn] + parsable = parsable.replace(/^([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,4})/, "$1/$2/$3"); + + ///////// + // Need to check for '15-Dec-09' also. + // FF will not parse, but Chrome will. + // Chrome will set date to 2009 as well. + ///////// + + // first check for 'dd-mmm-yyyy' or 'dd/mmm/yyyy' like '15-Dec-2010' + parsable = parsable.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{4})/i, "$1 $2 $3"); + + // Now check for 'dd-mmm-yy' or 'dd/mmm/yy' and normalize years to default century. + var match = parsable.match(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i); + if (match && match.length > 3) { + var m3 = parseFloat(match[3]); + var ny = jsDate.config.defaultCentury + m3; + ny = String(ny); + + // now replace 2 digit year with 4 digit year + parsable = parsable.replace(/^(3[01]|[0-2]?\d)[-\/]([a-z]{3,})[-\/](\d{2})\D*/i, match[1] +' '+ match[2] +' '+ ny); + + } + + // Check for '1/19/70 8:14PM' + // where starts with mm/dd/yy or yy/mm/dd and have something after + // Check if 1st postiion is greater than 31, assume it is year. + // Assme all 2 digit years are 1900's. + // Finally, change them into US style mm/dd/yyyy representations. + match = parsable.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})[^0-9]/); + + function h1(parsable, match) { + var m1 = parseFloat(match[1]); + var m2 = parseFloat(match[2]); + var m3 = parseFloat(match[3]); + var cent = jsDate.config.defaultCentury; + var ny, nd, nm, str; + + if (m1 > 31) { // first number is a year + nd = m3; + nm = m2; + ny = cent + m1; + } + + else { // last number is the year + nd = m2; + nm = m1; + ny = cent + m3; + } + + str = nm+'/'+nd+'/'+ny; + + // now replace 2 digit year with 4 digit year + return parsable.replace(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})/, str); + + } + + if (match && match.length > 3) { + parsable = h1(parsable, match); + } + + // Now check for '1/19/70' with nothing after and do as above + var match = parsable.match(/^([0-9]{1,2})[-\/]([0-9]{1,2})[-\/]([0-9]{1,2})$/); + + if (match && match.length > 3) { + parsable = h1(parsable, match); + } + + + var i = 0; + var length = jsDate.matchers.length; + var pattern, + ms, + current = parsable, + obj; + while (i < length) { + ms = Date.parse(current); + if (!isNaN(ms)) { + return new Date(ms); + } + pattern = jsDate.matchers[i]; + if (typeof pattern == 'function') { + obj = pattern.call(jsDate, current); + if (obj instanceof Date) { + return obj; + } + } else { + current = parsable.replace(pattern[0], pattern[1]); + } + i++; + } + return NaN; + }; + + + /** + * @static + * Handy static utility function to return the number of days in a given month. + * @param {Integer} year Year + * @param {Integer} month Month (1-12) + * @returns {Integer} Number of days in the month. + */ + // + // handy utility method Borrowed right from Ken Snyder's Date Instance Mehtods. + // + jsDate.daysInMonth = function(year, month) { + if (month == 2) { + return new Date(year, 1, 29).getDate() == 29 ? 29 : 28; + } + return [undefined,31,undefined,31,30,31,30,31,31,30,31,30,31][month]; + }; + + + // + // An Array of regular expressions or functions that will attempt to match the date string. + // Functions are called with scope of a jsDate instance. + // + jsDate.matchers = [ + // convert dd.mmm.yyyy to mm/dd/yyyy (world date to US date). + [/(3[01]|[0-2]\d)\s*\.\s*(1[0-2]|0\d)\s*\.\s*([1-9]\d{3})/, '$2/$1/$3'], + // convert yyyy-mm-dd to mm/dd/yyyy (ISO date to US date). + [/([1-9]\d{3})\s*-\s*(1[0-2]|0\d)\s*-\s*(3[01]|[0-2]\d)/, '$2/$3/$1'], + // Handle 12 hour or 24 hour time with milliseconds am/pm and optional date part. + function(str) { + var match = str.match(/^(?:(.+)\s+)?([012]?\d)(?:\s*\:\s*(\d\d))?(?:\s*\:\s*(\d\d(\.\d*)?))?\s*(am|pm)?\s*$/i); + // opt. date hour opt. minute opt. second opt. msec opt. am or pm + if (match) { + if (match[1]) { + var d = this.createDate(match[1]); + if (isNaN(d)) { + return; + } + } else { + var d = new Date(); + d.setMilliseconds(0); + } + var hour = parseFloat(match[2]); + if (match[6]) { + hour = match[6].toLowerCase() == 'am' ? (hour == 12 ? 0 : hour) : (hour == 12 ? 12 : hour + 12); + } + d.setHours(hour, parseInt(match[3] || 0, 10), parseInt(match[4] || 0, 10), ((parseFloat(match[5] || 0)) || 0)*1000); + return d; + } + else { + return str; + } + }, + // Handle ISO timestamp with time zone. + function(str) { + var match = str.match(/^(?:(.+))[T|\s+]([012]\d)(?:\:(\d\d))(?:\:(\d\d))(?:\.\d+)([\+\-]\d\d\:\d\d)$/i); + if (match) { + if (match[1]) { + var d = this.createDate(match[1]); + if (isNaN(d)) { + return; + } + } else { + var d = new Date(); + d.setMilliseconds(0); + } + var hour = parseFloat(match[2]); + d.setHours(hour, parseInt(match[3], 10), parseInt(match[4], 10), parseFloat(match[5])*1000); + return d; + } + else { + return str; + } + }, + // Try to match ambiguous strings like 12/8/22. + // Use FF date assumption that 2 digit years are 20th century (i.e. 1900's). + // This may be redundant with pre processing of date already performed. + function(str) { + var match = str.match(/^([0-3]?\d)\s*[-\/.\s]{1}\s*([a-zA-Z]{3,9})\s*[-\/.\s]{1}\s*([0-3]?\d)$/); + if (match) { + var d = new Date(); + var cent = jsDate.config.defaultCentury; + var m1 = parseFloat(match[1]); + var m3 = parseFloat(match[3]); + var ny, nd, nm; + if (m1 > 31) { // first number is a year + nd = m3; + ny = cent + m1; + } + + else { // last number is the year + nd = m1; + ny = cent + m3; + } + + var nm = inArray(match[2], jsDate.regional[jsDate.regional.getLocale()]["monthNamesShort"]); + + if (nm == -1) { + nm = inArray(match[2], jsDate.regional[jsDate.regional.getLocale()]["monthNames"]); + } + + d.setFullYear(ny, nm, nd); + d.setHours(0,0,0,0); + return d; + } + + else { + return str; + } + } + ]; + + // + // I think John Reisig published this method on his blog, ejohn. + // + function inArray( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + } + + // + // Thanks to Kangax, Christian Sciberras and Stack Overflow for this method. + // + function get_type(thing){ + if(thing===null) return "[object Null]"; // special case + return Object.prototype.toString.call(thing); + } + + $.jsDate = jsDate; + + + /** + * JavaScript printf/sprintf functions. + * + * This code has been adapted from the publicly available sprintf methods + * by Ash Searle. His original header follows: + * + * This code is unrestricted: you are free to use it however you like. + * + * The functions should work as expected, performing left or right alignment, + * truncating strings, outputting numbers with a required precision etc. + * + * For complex cases, these functions follow the Perl implementations of + * (s)printf, allowing arguments to be passed out-of-order, and to set the + * precision or length of the output based on arguments instead of fixed + * numbers. + * + * See http://perldoc.perl.org/functions/sprintf.html for more information. + * + * Implemented: + * - zero and space-padding + * - right and left-alignment, + * - base X prefix (binary, octal and hex) + * - positive number prefix + * - (minimum) width + * - precision / truncation / maximum width + * - out of order arguments + * + * Not implemented (yet): + * - vector flag + * - size (bytes, words, long-words etc.) + * + * Will not implement: + * - %n or %p (no pass-by-reference in JavaScript) + * + * @version 2007.04.27 + * @author Ash Searle + * + * You can see the original work and comments on his blog: + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + */ + + /** + * @Modifications 2009.05.26 + * @author Chris Leonello + * + * Added %p %P specifier + * Acts like %g or %G but will not add more significant digits to the output than present in the input. + * Example: + * Format: '%.3p', Input: 0.012, Output: 0.012 + * Format: '%.3g', Input: 0.012, Output: 0.0120 + * Format: '%.4p', Input: 12.0, Output: 12.0 + * Format: '%.4g', Input: 12.0, Output: 12.00 + * Format: '%.4p', Input: 4.321e-5, Output: 4.321e-5 + * Format: '%.4g', Input: 4.321e-5, Output: 4.3210e-5 + * + * Example: + * >>> $.jqplot.sprintf('%.2f, %d', 23.3452, 43.23) + * "23.35, 43" + * >>> $.jqplot.sprintf("no value: %n, decimal with thousands separator: %'d", 23.3452, 433524) + * "no value: , decimal with thousands separator: 433,524" + */ + $.jqplot.sprintf = function() { + function pad(str, len, chr, leftJustify) { + var padding = (str.length >= len) ? '' : Array(1 + len - str.length >>> 0).join(chr); + return leftJustify ? str + padding : padding + str; + + } + + function thousand_separate(value) { + var value_str = new String(value); + for (var i=10; i>0; i--) { + if (value_str == (value_str = value_str.replace(/^(\d+)(\d{3})/, "$1"+$.jqplot.sprintf.thousandsSeparator+"$2"))) break; + } + return value_str; + } + + function justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace) { + var diff = minWidth - value.length; + if (diff > 0) { + var spchar = ' '; + if (htmlSpace) { spchar = ' '; } + if (leftJustify || !zeroPad) { + value = pad(value, minWidth, spchar, leftJustify); + } else { + value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length); + } + } + return value; + } + + function formatBaseX(value, base, prefix, leftJustify, minWidth, precision, zeroPad, htmlSpace) { + // Note: casts negative numbers to positive ones + var number = value >>> 0; + prefix = prefix && number && {'2': '0b', '8': '0', '16': '0x'}[base] || ''; + value = prefix + pad(number.toString(base), precision || 0, '0', false); + return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace); + } + + function formatString(value, leftJustify, minWidth, precision, zeroPad, htmlSpace) { + if (precision != null) { + value = value.slice(0, precision); + } + return justify(value, '', leftJustify, minWidth, zeroPad, htmlSpace); + } + + var a = arguments, i = 0, format = a[i++]; + + return format.replace($.jqplot.sprintf.regex, function(substring, valueIndex, flags, minWidth, _, precision, type) { + if (substring == '%%') { return '%'; } + + // parse flags + var leftJustify = false, positivePrefix = '', zeroPad = false, prefixBaseX = false, htmlSpace = false, thousandSeparation = false; + for (var j = 0; flags && j < flags.length; j++) switch (flags.charAt(j)) { + case ' ': positivePrefix = ' '; break; + case '+': positivePrefix = '+'; break; + case '-': leftJustify = true; break; + case '0': zeroPad = true; break; + case '#': prefixBaseX = true; break; + case '&': htmlSpace = true; break; + case '\'': thousandSeparation = true; break; + } + + // parameters may be null, undefined, empty-string or real valued + // we want to ignore null, undefined and empty-string values + + if (!minWidth) { + minWidth = 0; + } + else if (minWidth == '*') { + minWidth = +a[i++]; + } + else if (minWidth.charAt(0) == '*') { + minWidth = +a[minWidth.slice(1, -1)]; + } + else { + minWidth = +minWidth; + } + + // Note: undocumented perl feature: + if (minWidth < 0) { + minWidth = -minWidth; + leftJustify = true; + } + + if (!isFinite(minWidth)) { + throw new Error('$.jqplot.sprintf: (minimum-)width must be finite'); + } + + if (!precision) { + precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type == 'd') ? 0 : void(0); + } + else if (precision == '*') { + precision = +a[i++]; + } + else if (precision.charAt(0) == '*') { + precision = +a[precision.slice(1, -1)]; + } + else { + precision = +precision; + } + + // grab value using valueIndex if required? + var value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++]; + + switch (type) { + case 's': { + if (value == null) { + return ''; + } + return formatString(String(value), leftJustify, minWidth, precision, zeroPad, htmlSpace); + } + case 'c': return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad, htmlSpace); + case 'b': return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad,htmlSpace); + case 'o': return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace); + case 'x': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace); + case 'X': return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace).toUpperCase(); + case 'u': return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad, htmlSpace); + case 'i': { + var number = parseInt(+value, 10); + if (isNaN(number)) { + return ''; + } + var prefix = number < 0 ? '-' : positivePrefix; + var number_str = thousandSeparation ? thousand_separate(String(Math.abs(number))): String(Math.abs(number)); + value = prefix + pad(number_str, precision, '0', false); + //value = prefix + pad(String(Math.abs(number)), precision, '0', false); + return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace); + } + case 'd': { + var number = Math.round(+value); + if (isNaN(number)) { + return ''; + } + var prefix = number < 0 ? '-' : positivePrefix; + var number_str = thousandSeparation ? thousand_separate(String(Math.abs(number))): String(Math.abs(number)); + value = prefix + pad(number_str, precision, '0', false); + return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace); + } + case 'e': + case 'E': + case 'f': + case 'F': + case 'g': + case 'G': + { + var number = +value; + if (isNaN(number)) { + return ''; + } + var prefix = number < 0 ? '-' : positivePrefix; + var method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())]; + var textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2]; + var number_str = Math.abs(number)[method](precision); + + // Apply the decimal mark properly by splitting the number by the + // decimalMark, applying thousands separator, and then placing it + // back in. + var parts = number_str.toString().split('.'); + parts[0] = thousandSeparation ? thousand_separate(parts[0]) : parts[0]; + number_str = parts.join($.jqplot.sprintf.decimalMark); + + value = prefix + number_str; + var justified = justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace)[textTransform](); + + return justified; + } + case 'p': + case 'P': + { + // make sure number is a number + var number = +value; + if (isNaN(number)) { + return ''; + } + var prefix = number < 0 ? '-' : positivePrefix; + + var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/); + var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : String(number).length; + var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0; + + if (Math.abs(number) < 1) { + if (sd + zeros <= precision) { + value = prefix + Math.abs(number).toPrecision(sd); + } + else { + if (sd <= precision - 1) { + value = prefix + Math.abs(number).toExponential(sd-1); + } + else { + value = prefix + Math.abs(number).toExponential(precision-1); + } + } + } + else { + var prec = (sd <= precision) ? sd : precision; + value = prefix + Math.abs(number).toPrecision(prec); + } + var textTransform = ['toString', 'toUpperCase']['pP'.indexOf(type) % 2]; + return justify(value, prefix, leftJustify, minWidth, zeroPad, htmlSpace)[textTransform](); + } + case 'n': return ''; + default: return substring; + } + }); + }; + + $.jqplot.sprintf.thousandsSeparator = ','; + // Specifies the decimal mark for floating point values. By default a period '.' + // is used. If you change this value to for example a comma be sure to also + // change the thousands separator or else this won't work since a simple String + // replace is used (replacing all periods with the mark specified here). + $.jqplot.sprintf.decimalMark = '.'; + + $.jqplot.sprintf.regex = /%%|%(\d+\$)?([-+#0&\' ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([nAscboxXuidfegpEGP])/g; + + $.jqplot.getSignificantFigures = function(number) { + var parts = String(Number(Math.abs(number)).toExponential()).split(/e|E/); + // total significant digits + var sd = (parts[0].indexOf('.') != -1) ? parts[0].length - 1 : parts[0].length; + var zeros = (parts[1] < 0) ? -parts[1] - 1 : 0; + // exponent + var expn = parseInt(parts[1], 10); + // digits to the left of the decimal place + var dleft = (expn + 1 > 0) ? expn + 1 : 0; + // digits to the right of the decimal place + var dright = (sd <= dleft) ? 0 : sd - expn - 1; + return {significantDigits: sd, digitsLeft: dleft, digitsRight: dright, zeros: zeros, exponent: expn} ; + }; + + $.jqplot.getPrecision = function(number) { + return $.jqplot.getSignificantFigures(number).digitsRight; + }; + + + + + var backCompat = $.uiBackCompat !== false; + + $.jqplot.effects = { + effect: {} + }; + + // prefix used for storing data on .data() + var dataSpace = "jqplot.storage."; + + /******************************************************************************/ + /*********************************** EFFECTS **********************************/ + /******************************************************************************/ + + $.extend( $.jqplot.effects, { + version: "1.9pre", + + // Saves a set of properties in a data storage + save: function( element, set ) { + for( var i=0; i < set.length; i++ ) { + if ( set[ i ] !== null ) { + element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); + } + } + }, + + // Restores a set of previously saved properties from a data storage + restore: function( element, set ) { + for( var i=0; i < set.length; i++ ) { + if ( set[ i ] !== null ) { + element.css( set[ i ], element.data( dataSpace + set[ i ] ) ); + } + } + }, + + setMode: function( el, mode ) { + if (mode === "toggle") { + mode = el.is( ":hidden" ) ? "show" : "hide"; + } + return mode; + }, + + // Wraps the element around a wrapper that copies position properties + createWrapper: function( element ) { + + // if the element is already wrapped, return it + if ( element.parent().is( ".ui-effects-wrapper" )) { + return element.parent(); + } + + // wrap the element + var props = { + width: element.outerWidth(true), + height: element.outerHeight(true), + "float": element.css( "float" ) + }, + wrapper = $( "<div></div>" ) + .addClass( "ui-effects-wrapper" ) + .css({ + fontSize: "100%", + background: "transparent", + border: "none", + margin: 0, + padding: 0 + }), + // Store the size in case width/height are defined in % - Fixes #5245 + size = { + width: element.width(), + height: element.height() + }, + active = document.activeElement; + + element.wrap( wrapper ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + + wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually loose the reference to the wrapped element + + // transfer positioning properties to the wrapper + if ( element.css( "position" ) === "static" ) { + wrapper.css({ position: "relative" }); + element.css({ position: "relative" }); + } else { + $.extend( props, { + position: element.css( "position" ), + zIndex: element.css( "z-index" ) + }); + $.each([ "top", "left", "bottom", "right" ], function(i, pos) { + props[ pos ] = element.css( pos ); + if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { + props[ pos ] = "auto"; + } + }); + element.css({ + position: "relative", + top: 0, + left: 0, + right: "auto", + bottom: "auto" + }); + } + element.css(size); + + return wrapper.css( props ).show(); + }, + + removeWrapper: function( element ) { + var active = document.activeElement; + + if ( element.parent().is( ".ui-effects-wrapper" ) ) { + element.parent().replaceWith( element ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).focus(); + } + } + + + return element; + } + }); + + // return an effect options object for the given parameters: + function _normalizeArguments( effect, options, speed, callback ) { + + // short path for passing an effect options object: + if ( $.isPlainObject( effect ) ) { + return effect; + } + + // convert to an object + effect = { effect: effect }; + + // catch (effect) + if ( options === undefined ) { + options = {}; + } + + // catch (effect, callback) + if ( $.isFunction( options ) ) { + callback = options; + speed = null; + options = {}; + } + + // catch (effect, speed, ?) + if ( $.type( options ) === "number" || $.fx.speeds[ options ]) { + callback = speed; + speed = options; + options = {}; + } + + // catch (effect, options, callback) + if ( $.isFunction( speed ) ) { + callback = speed; + speed = null; + } + + // add options to effect + if ( options ) { + $.extend( effect, options ); + } + + speed = speed || options.duration; + effect.duration = $.fx.off ? 0 : typeof speed === "number" + ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default; + + effect.complete = callback || options.complete; + + return effect; + } + + function standardSpeed( speed ) { + // valid standard speeds + if ( !speed || typeof speed === "number" || $.fx.speeds[ speed ] ) { + return true; + } + + // invalid strings - treat as "normal" speed + if ( typeof speed === "string" && !$.jqplot.effects.effect[ speed ] ) { + // TODO: remove in 2.0 (#7115) + if ( backCompat && $.jqplot.effects[ speed ] ) { + return false; + } + return true; + } + + return false; + } + + $.fn.extend({ + jqplotEffect: function( effect, options, speed, callback ) { + var args = _normalizeArguments.apply( this, arguments ), + mode = args.mode, + queue = args.queue, + effectMethod = $.jqplot.effects.effect[ args.effect ], + + // DEPRECATED: remove in 2.0 (#7115) + oldEffectMethod = !effectMethod && backCompat && $.jqplot.effects[ args.effect ]; + + if ( $.fx.off || !( effectMethod || oldEffectMethod ) ) { + // delegate to the original method (e.g., .show()) if possible + if ( mode ) { + return this[ mode ]( args.duration, args.complete ); + } else { + return this.each( function() { + if ( args.complete ) { + args.complete.call( this ); + } + }); + } + } + + function run( next ) { + var elem = $( this ), + complete = args.complete, + mode = args.mode; + + function done() { + if ( $.isFunction( complete ) ) { + complete.call( elem[0] ); + } + if ( $.isFunction( next ) ) { + next(); + } + } + + // if the element is hiddden and mode is hide, + // or element is visible and mode is show + if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { + done(); + } else { + effectMethod.call( elem[0], args, done ); + } + } + + // TODO: remove this check in 2.0, effectMethod will always be true + if ( effectMethod ) { + return queue === false ? this.each( run ) : this.queue( queue || "fx", run ); + } else { + // DEPRECATED: remove in 2.0 (#7115) + return oldEffectMethod.call(this, { + options: args, + duration: args.duration, + callback: args.complete, + mode: args.mode + }); + } + } + }); + + + + + var rvertical = /up|down|vertical/, + rpositivemotion = /up|left|vertical|horizontal/; + + $.jqplot.effects.effect.blind = function( o, done ) { + // Create element + var el = $( this ), + props = [ "position", "top", "bottom", "left", "right", "height", "width" ], + mode = $.jqplot.effects.setMode( el, o.mode || "hide" ), + direction = o.direction || "up", + vertical = rvertical.test( direction ), + ref = vertical ? "height" : "width", + ref2 = vertical ? "top" : "left", + motion = rpositivemotion.test( direction ), + animation = {}, + show = mode === "show", + wrapper, distance, top; + + // // if already wrapped, the wrapper's properties are my property. #6245 + if ( el.parent().is( ".ui-effects-wrapper" ) ) { + $.jqplot.effects.save( el.parent(), props ); + } else { + $.jqplot.effects.save( el, props ); + } + el.show(); + top = parseInt(el.css('top'), 10); + wrapper = $.jqplot.effects.createWrapper( el ).css({ + overflow: "hidden" + }); + + distance = vertical ? wrapper[ ref ]() + top : wrapper[ ref ](); + + animation[ ref ] = show ? String(distance) : '0'; + if ( !motion ) { + el + .css( vertical ? "bottom" : "right", 0 ) + .css( vertical ? "top" : "left", "" ) + .css({ position: "absolute" }); + animation[ ref2 ] = show ? '0' : String(distance); + } + + // // start at 0 if we are showing + if ( show ) { + wrapper.css( ref, 0 ); + if ( ! motion ) { + wrapper.css( ref2, distance ); + } + } + + // // Animate + wrapper.animate( animation, { + duration: o.duration, + easing: o.easing, + queue: false, + complete: function() { + if ( mode === "hide" ) { + el.hide(); + } + $.jqplot.effects.restore( el, props ); + $.jqplot.effects.removeWrapper( el ); + done(); + } + }); + + }; + +})(jQuery); diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.barRenderer.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.barRenderer.js new file mode 100755 index 0000000..d56ca19 --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.barRenderer.js @@ -0,0 +1,801 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + + // Class: $.jqplot.BarRenderer + // A plugin renderer for jqPlot to draw a bar plot. + // Draws series as a line. + + $.jqplot.BarRenderer = function(){ + $.jqplot.LineRenderer.call(this); + }; + + $.jqplot.BarRenderer.prototype = new $.jqplot.LineRenderer(); + $.jqplot.BarRenderer.prototype.constructor = $.jqplot.BarRenderer; + + // called with scope of series. + $.jqplot.BarRenderer.prototype.init = function(options, plot) { + // Group: Properties + // + // prop: barPadding + // Number of pixels between adjacent bars at the same axis value. + this.barPadding = 8; + // prop: barMargin + // Number of pixels between groups of bars at adjacent axis values. + this.barMargin = 10; + // prop: barDirection + // 'vertical' = up and down bars, 'horizontal' = side to side bars + this.barDirection = 'vertical'; + // prop: barWidth + // Width of the bar in pixels (auto by devaul). null = calculated automatically. + this.barWidth = null; + // prop: shadowOffset + // offset of the shadow from the slice and offset of + // each succesive stroke of the shadow from the last. + this.shadowOffset = 2; + // prop: shadowDepth + // number of strokes to apply to the shadow, + // each stroke offset shadowOffset from the last. + this.shadowDepth = 5; + // prop: shadowAlpha + // transparency of the shadow (0 = transparent, 1 = opaque) + this.shadowAlpha = 0.08; + // prop: waterfall + // true to enable waterfall plot. + this.waterfall = false; + // prop: groups + // group bars into this many groups + this.groups = 1; + // prop: varyBarColor + // true to color each bar of a series separately rather than + // have every bar of a given series the same color. + // If used for non-stacked multiple series bar plots, user should + // specify a separate 'seriesColors' array for each series. + // Otherwise, each series will set their bars to the same color array. + // This option has no Effect for stacked bar charts and is disabled. + this.varyBarColor = false; + // prop: highlightMouseOver + // True to highlight slice when moused over. + // This must be false to enable highlightMouseDown to highlight when clicking on a slice. + this.highlightMouseOver = true; + // prop: highlightMouseDown + // True to highlight when a mouse button is pressed over a slice. + // This will be disabled if highlightMouseOver is true. + this.highlightMouseDown = false; + // prop: highlightColors + // an array of colors to use when highlighting a bar. + this.highlightColors = []; + // prop: transposedData + // NOT IMPLEMENTED YET. True if this is a horizontal bar plot and + // x and y values are "transposed". Tranposed, or "swapped", data is + // required prior to rev. 894 builds of jqPlot with horizontal bars. + // Allows backward compatability of bar renderer horizontal bars with + // old style data sets. + this.transposedData = true; + this.renderer.animation = { + show: false, + direction: 'down', + speed: 3000, + _supported: true + }; + this._type = 'bar'; + + // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver + if (options.highlightMouseDown && options.highlightMouseOver == null) { + options.highlightMouseOver = false; + } + + ////// + // This is probably wrong here. + // After going back and forth on whether renderer should be the thing + // or extend the thing, it seems that it it best if it is a property + // on the thing. This should be something that is commonized + // among series renderers in the future. + ////// + $.extend(true, this, options); + + // really should probably do this + $.extend(true, this.renderer, options); + // fill is still needed to properly draw the legend. + // bars have to be filled. + this.fill = true; + + // if horizontal bar and animating, reset the default direction + if (this.barDirection === 'horizontal' && this.rendererOptions.animation && this.rendererOptions.animation.direction == null) { + this.renderer.animation.direction = 'left'; + } + + if (this.waterfall) { + this.fillToZero = false; + this.disableStack = true; + } + + if (this.barDirection == 'vertical' ) { + this._primaryAxis = '_xaxis'; + this._stackAxis = 'y'; + this.fillAxis = 'y'; + } + else { + this._primaryAxis = '_yaxis'; + this._stackAxis = 'x'; + this.fillAxis = 'x'; + } + // index of the currenty highlighted point, if any + this._highlightedPoint = null; + // total number of values for all bar series, total number of bar series, and position of this series + this._plotSeriesInfo = null; + // Array of actual data colors used for each data point. + this._dataColors = []; + this._barPoints = []; + + // set the shape renderer options + var opts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, strokeStyle:this.color, fillStyle:this.color, closePath:this.fill}; + this.renderer.shapeRenderer.init(opts); + // set the shadow renderer options + var sopts = {lineJoin:'miter', lineCap:'round', fill:true, isarc:false, angle:this.shadowAngle, offset:this.shadowOffset, alpha:this.shadowAlpha, depth:this.shadowDepth, closePath:this.fill}; + this.renderer.shadowRenderer.init(sopts); + + plot.postInitHooks.addOnce(postInit); + plot.postDrawHooks.addOnce(postPlotDraw); + plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove); + plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown); + plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp); + plot.eventListenerHooks.addOnce('jqplotClick', handleClick); + plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick); + }; + + // called with scope of series + function barPreInit(target, data, seriesDefaults, options) { + if (this.rendererOptions.barDirection == 'horizontal') { + this._stackAxis = 'x'; + this._primaryAxis = '_yaxis'; + } + if (this.rendererOptions.waterfall == true) { + this._data = $.extend(true, [], this.data); + var sum = 0; + var pos = (!this.rendererOptions.barDirection || this.rendererOptions.barDirection === 'vertical' || this.transposedData === false) ? 1 : 0; + for(var i=0; i<this.data.length; i++) { + sum += this.data[i][pos]; + if (i>0) { + this.data[i][pos] += this.data[i-1][pos]; + } + } + this.data[this.data.length] = (pos == 1) ? [this.data.length+1, sum] : [sum, this.data.length+1]; + this._data[this._data.length] = (pos == 1) ? [this._data.length+1, sum] : [sum, this._data.length+1]; + } + if (this.rendererOptions.groups > 1) { + this.breakOnNull = true; + var l = this.data.length; + var skip = parseInt(l/this.rendererOptions.groups, 10); + var count = 0; + for (var i=skip; i<l; i+=skip) { + this.data.splice(i+count, 0, [null, null]); + this._plotData.splice(i+count, 0, [null, null]); + this._stackData.splice(i+count, 0, [null, null]); + count++; + } + for (i=0; i<this.data.length; i++) { + if (this._primaryAxis == '_xaxis') { + this.data[i][0] = i+1; + this._plotData[i][0] = i+1; + this._stackData[i][0] = i+1; + } + else { + this.data[i][1] = i+1; + this._plotData[i][1] = i+1; + this._stackData[i][1] = i+1; + } + } + } + } + + $.jqplot.preSeriesInitHooks.push(barPreInit); + + // needs to be called with scope of series, not renderer. + $.jqplot.BarRenderer.prototype.calcSeriesNumbers = function() { + var nvals = 0; + var nseries = 0; + var paxis = this[this._primaryAxis]; + var s, series, pos; + // loop through all series on this axis + for (var i=0; i < paxis._series.length; i++) { + series = paxis._series[i]; + if (series === this) { + pos = i; + } + // is the series rendered as a bar? + if (series.renderer.constructor == $.jqplot.BarRenderer) { + // gridData may not be computed yet, use data length insted + nvals += series.data.length; + nseries += 1; + } + } + // return total number of values for all bar series, total number of bar series, and position of this series + return [nvals, nseries, pos]; + }; + + $.jqplot.BarRenderer.prototype.setBarWidth = function() { + // need to know how many data values we have on the approprate axis and figure it out. + var i; + var nvals = 0; + var nseries = 0; + var paxis = this[this._primaryAxis]; + var s, series, pos; + var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this); + nvals = temp[0]; + nseries = temp[1]; + var nticks = paxis.numberTicks; + var nbins = (nticks-1)/2; + // so, now we have total number of axis values. + if (paxis.name == 'xaxis' || paxis.name == 'x2axis') { + if (this._stack) { + this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals * nseries - this.barMargin; + } + else { + this.barWidth = ((paxis._offsets.max - paxis._offsets.min)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries; + // this.barWidth = (paxis._offsets.max - paxis._offsets.min) / nvals - this.barPadding - this.barMargin/nseries; + } + } + else { + if (this._stack) { + this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals * nseries - this.barMargin; + } + else { + this.barWidth = ((paxis._offsets.min - paxis._offsets.max)/nbins - this.barPadding * (nseries-1) - this.barMargin*2)/nseries; + // this.barWidth = (paxis._offsets.min - paxis._offsets.max) / nvals - this.barPadding - this.barMargin/nseries; + } + } + return [nvals, nseries]; + }; + + function computeHighlightColors (colors) { + var ret = []; + for (var i=0; i<colors.length; i++){ + var rgba = $.jqplot.getColorComponents(colors[i]); + var newrgb = [rgba[0], rgba[1], rgba[2]]; + var sum = newrgb[0] + newrgb[1] + newrgb[2]; + for (var j=0; j<3; j++) { + // when darkening, lowest color component can be is 60. + newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]); + newrgb[j] = parseInt(newrgb[j], 10); + } + ret.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')'); + } + return ret; + } + + function getStart(sidx, didx, comp, plot, axis) { + // check if sign change + var seriesIndex = sidx, + prevSeriesIndex = sidx - 1, + start, + prevVal, + aidx = (axis === 'x') ? 0 : 1; + + // is this not the first series? + if (seriesIndex > 0) { + prevVal = plot.series[prevSeriesIndex]._plotData[didx][aidx]; + + // is there a sign change + if ((comp * prevVal) < 0) { + start = getStart(prevSeriesIndex, didx, comp, plot, axis); + } + + // no sign change. + else { + start = plot.series[prevSeriesIndex].gridData[didx][aidx]; + } + + } + + // if first series, return value at 0 + else { + + start = (aidx === 0) ? plot.series[seriesIndex]._xaxis.series_u2p(0) : plot.series[seriesIndex]._yaxis.series_u2p(0); + } + + return start; + } + + + $.jqplot.BarRenderer.prototype.draw = function(ctx, gridData, options, plot) { + var i; + // Ughhh, have to make a copy of options b/c it may be modified later. + var opts = $.extend({}, options); + var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; + var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine; + var fill = (opts.fill != undefined) ? opts.fill : this.fill; + var xaxis = this.xaxis; + var yaxis = this.yaxis; + var xp = this._xaxis.series_u2p; + var yp = this._yaxis.series_u2p; + var pointx, pointy; + // clear out data colors. + this._dataColors = []; + this._barPoints = []; + + if (this.barWidth == null || this.rendererOptions.barWidth == null) {//check pull request https://bitbucket.org/cleonello/jqplot/pull-request/61/fix-for-issue-513/diff + this.renderer.setBarWidth.call(this); + } + + var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this); + var nvals = temp[0]; + var nseries = temp[1]; + var pos = temp[2]; + var points = []; + + if (this._stack) { + this._barNudge = 0; + } + else { + this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding); + } + if (showLine) { + var negativeColors = new $.jqplot.ColorGenerator(this.negativeSeriesColors); + var positiveColors = new $.jqplot.ColorGenerator(this.seriesColors); + var negativeColor = negativeColors.get(this.index); + if (! this.useNegativeColors) { + negativeColor = opts.fillStyle; + } + var positiveColor = opts.fillStyle; + var base; + var xstart; + var ystart; + + if (this.barDirection == 'vertical') { + for (var i=0; i<gridData.length; i++) { + if (!this._stack && this.data[i][1] == null) { + continue; + } + points = []; + base = gridData[i][0] + this._barNudge; + + // stacked + if (this._stack && this._prevGridData.length) { + ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y'); + } + + // not stacked + else { + if (this.fillToZero) { + ystart = this._yaxis.series_u2p(0); + } + else if (this.waterfall && i > 0 && i < this.gridData.length-1) { + ystart = this.gridData[i-1][1]; + } + else if (this.waterfall && i == 0 && i < this.gridData.length-1) { + if (this._yaxis.min <= 0 && this._yaxis.max >= 0) { + ystart = this._yaxis.series_u2p(0); + } + else if (this._yaxis.min > 0) { + ystart = ctx.canvas.height; + } + else { + ystart = 0; + } + } + else if (this.waterfall && i == this.gridData.length - 1) { + if (this._yaxis.min <= 0 && this._yaxis.max >= 0) { + ystart = this._yaxis.series_u2p(0); + } + else if (this._yaxis.min > 0) { + ystart = ctx.canvas.height; + } + else { + ystart = 0; + } + } + else { + ystart = ctx.canvas.height; + } + } + if ((this.fillToZero && this._plotData[i][1] < 0) || (this.waterfall && this._data[i][1] < 0)) { + if (this.varyBarColor && !this._stack) { + if (this.useNegativeColors) { + opts.fillStyle = negativeColors.next(); + } + else { + opts.fillStyle = positiveColors.next(); + } + } + else { + opts.fillStyle = negativeColor; + } + } + else { + if (this.varyBarColor && !this._stack) { + opts.fillStyle = positiveColors.next(); + } + else { + opts.fillStyle = positiveColor; + } + } + + if (!this.fillToZero || this._plotData[i][1] >= 0) { + points.push([base-this.barWidth/2, ystart]); + points.push([base-this.barWidth/2, gridData[i][1]]); + points.push([base+this.barWidth/2, gridData[i][1]]); + points.push([base+this.barWidth/2, ystart]); + } + // for negative bars make sure points are always ordered clockwise + else { + points.push([base-this.barWidth/2, gridData[i][1]]); + points.push([base-this.barWidth/2, ystart]); + points.push([base+this.barWidth/2, ystart]); + points.push([base+this.barWidth/2, gridData[i][1]]); + } + this._barPoints.push(points); + // now draw the shadows if not stacked. + // for stacked plots, they are predrawn by drawShadow + if (shadow && !this._stack) { + var sopts = $.extend(true, {}, opts); + // need to get rid of fillStyle on shadow. + delete sopts.fillStyle; + this.renderer.shadowRenderer.draw(ctx, points, sopts); + } + var clr = opts.fillStyle || this.color; + this._dataColors.push(clr); + this.renderer.shapeRenderer.draw(ctx, points, opts); + } + } + + else if (this.barDirection == 'horizontal'){ + for (var i=0; i<gridData.length; i++) { + if (!this._stack && this.data[i][0] == null) { + continue; + } + points = []; + base = gridData[i][1] - this._barNudge; + xstart; + + if (this._stack && this._prevGridData.length) { + xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x'); + } + // not stacked + else { + if (this.fillToZero) { + xstart = this._xaxis.series_u2p(0); + } + else if (this.waterfall && i > 0 && i < this.gridData.length-1) { + xstart = this.gridData[i-1][0]; + } + else if (this.waterfall && i == 0 && i < this.gridData.length-1) { + if (this._xaxis.min <= 0 && this._xaxis.max >= 0) { + xstart = this._xaxis.series_u2p(0); + } + else if (this._xaxis.min > 0) { + xstart = 0; + } + else { + xstart = 0; + } + } + else if (this.waterfall && i == this.gridData.length - 1) { + if (this._xaxis.min <= 0 && this._xaxis.max >= 0) { + xstart = this._xaxis.series_u2p(0); + } + else if (this._xaxis.min > 0) { + xstart = 0; + } + else { + xstart = ctx.canvas.width; + } + } + else { + xstart = 0; + } + } + if ((this.fillToZero && this._plotData[i][0] < 0) || (this.waterfall && this._data[i][0] < 0)) { + if (this.varyBarColor && !this._stack) { + if (this.useNegativeColors) { + opts.fillStyle = negativeColors.next(); + } + else { + opts.fillStyle = positiveColors.next(); + } + } + else { + opts.fillStyle = negativeColor; + } + } + else { + if (this.varyBarColor && !this._stack) { + opts.fillStyle = positiveColors.next(); + } + else { + opts.fillStyle = positiveColor; + } + } + + + if (!this.fillToZero || this._plotData[i][0] >= 0) { + points.push([xstart, base + this.barWidth / 2]); + points.push([xstart, base - this.barWidth / 2]); + points.push([gridData[i][0], base - this.barWidth / 2]); + points.push([gridData[i][0], base + this.barWidth / 2]); + } + else { + points.push([gridData[i][0], base + this.barWidth / 2]); + points.push([gridData[i][0], base - this.barWidth / 2]); + points.push([xstart, base - this.barWidth / 2]); + points.push([xstart, base + this.barWidth / 2]); + } + + this._barPoints.push(points); + // now draw the shadows if not stacked. + // for stacked plots, they are predrawn by drawShadow + if (shadow && !this._stack) { + var sopts = $.extend(true, {}, opts); + delete sopts.fillStyle; + this.renderer.shadowRenderer.draw(ctx, points, sopts); + } + var clr = opts.fillStyle || this.color; + this._dataColors.push(clr); + this.renderer.shapeRenderer.draw(ctx, points, opts); + } + } + } + + if (this.highlightColors.length == 0) { + this.highlightColors = $.jqplot.computeHighlightColors(this._dataColors); + } + + else if (typeof(this.highlightColors) == 'string') { + var temp = this.highlightColors; + this.highlightColors = []; + for (var i=0; i<this._dataColors.length; i++) { + this.highlightColors.push(temp); + } + } + + }; + + + // for stacked plots, shadows will be pre drawn by drawShadow. + $.jqplot.BarRenderer.prototype.drawShadow = function(ctx, gridData, options, plot) { + var i; + var opts = (options != undefined) ? options : {}; + var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; + var showLine = (opts.showLine != undefined) ? opts.showLine : this.showLine; + var fill = (opts.fill != undefined) ? opts.fill : this.fill; + var xaxis = this.xaxis; + var yaxis = this.yaxis; + var xp = this._xaxis.series_u2p; + var yp = this._yaxis.series_u2p; + var pointx, points, pointy, nvals, nseries, pos; + + if (this._stack && this.shadow) { + if (this.barWidth == null) { + this.renderer.setBarWidth.call(this); + } + + var temp = this._plotSeriesInfo = this.renderer.calcSeriesNumbers.call(this); + nvals = temp[0]; + nseries = temp[1]; + pos = temp[2]; + + if (this._stack) { + this._barNudge = 0; + } + else { + this._barNudge = (-Math.abs(nseries/2 - 0.5) + pos) * (this.barWidth + this.barPadding); + } + if (showLine) { + + if (this.barDirection == 'vertical') { + for (var i=0; i<gridData.length; i++) { + if (this.data[i][1] == null) { + continue; + } + points = []; + var base = gridData[i][0] + this._barNudge; + var ystart; + + if (this._stack && this._prevGridData.length) { + ystart = getStart(this.index, i, this._plotData[i][1], plot, 'y'); + } + else { + if (this.fillToZero) { + ystart = this._yaxis.series_u2p(0); + } + else { + ystart = ctx.canvas.height; + } + } + + points.push([base-this.barWidth/2, ystart]); + points.push([base-this.barWidth/2, gridData[i][1]]); + points.push([base+this.barWidth/2, gridData[i][1]]); + points.push([base+this.barWidth/2, ystart]); + this.renderer.shadowRenderer.draw(ctx, points, opts); + } + } + + else if (this.barDirection == 'horizontal'){ + for (var i=0; i<gridData.length; i++) { + if (this.data[i][0] == null) { + continue; + } + points = []; + var base = gridData[i][1] - this._barNudge; + var xstart; + + if (this._stack && this._prevGridData.length) { + xstart = getStart(this.index, i, this._plotData[i][0], plot, 'x'); + } + else { + if (this.fillToZero) { + xstart = this._xaxis.series_u2p(0); + } + else { + xstart = 0; + } + } + + points.push([xstart, base+this.barWidth/2]); + points.push([gridData[i][0], base+this.barWidth/2]); + points.push([gridData[i][0], base-this.barWidth/2]); + points.push([xstart, base-this.barWidth/2]); + this.renderer.shadowRenderer.draw(ctx, points, opts); + } + } + } + + } + }; + + function postInit(target, data, options) { + for (var i=0; i<this.series.length; i++) { + if (this.series[i].renderer.constructor == $.jqplot.BarRenderer) { + // don't allow mouseover and mousedown at same time. + if (this.series[i].highlightMouseOver) { + this.series[i].highlightMouseDown = false; + } + } + } + } + + // called within context of plot + // create a canvas which we can draw on. + // insert it before the eventCanvas, so eventCanvas will still capture events. + function postPlotDraw() { + // Memory Leaks patch + if (this.plugins.barRenderer && this.plugins.barRenderer.highlightCanvas) { + + this.plugins.barRenderer.highlightCanvas.resetCanvas(); + this.plugins.barRenderer.highlightCanvas = null; + } + + this.plugins.barRenderer = {highlightedSeriesIndex:null}; + this.plugins.barRenderer.highlightCanvas = new $.jqplot.GenericCanvas(); + + this.eventCanvas._elem.before(this.plugins.barRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-barRenderer-highlight-canvas', this._plotDimensions, this)); + this.plugins.barRenderer.highlightCanvas.setContext(); + this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); }); + } + + function highlight (plot, sidx, pidx, points) { + var s = plot.series[sidx]; + var canvas = plot.plugins.barRenderer.highlightCanvas; + canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height); + s._highlightedPoint = pidx; + plot.plugins.barRenderer.highlightedSeriesIndex = sidx; + var opts = {fillStyle: s.highlightColors[pidx]}; + s.renderer.shapeRenderer.draw(canvas._ctx, points, opts); + canvas = null; + } + + function unhighlight (plot) { + var canvas = plot.plugins.barRenderer.highlightCanvas; + canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height); + for (var i=0; i<plot.series.length; i++) { + plot.series[i]._highlightedPoint = null; + } + plot.plugins.barRenderer.highlightedSeriesIndex = null; + plot.target.trigger('jqplotDataUnhighlight'); + canvas = null; + } + + + function handleMove(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var evt1 = jQuery.Event('jqplotDataMouseOver'); + evt1.pageX = ev.pageX; + evt1.pageY = ev.pageY; + plot.target.trigger(evt1, ins); + if (plot.series[ins[0]].show && plot.series[ins[0]].highlightMouseOver && + !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) { + var evt = jQuery.Event('jqplotDataHighlight'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points); + } + } + else if (neighbor == null) { + unhighlight (plot); + } + } + + function handleMouseDown(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.barRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) { + var evt = jQuery.Event('jqplotDataHighlight'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + highlight (plot, neighbor.seriesIndex, neighbor.pointIndex, neighbor.points); + } + } + else if (neighbor == null) { + unhighlight (plot); + } + } + + function handleMouseUp(ev, gridpos, datapos, neighbor, plot) { + var idx = plot.plugins.barRenderer.highlightedSeriesIndex; + if (idx != null && plot.series[idx].highlightMouseDown) { + unhighlight(plot); + } + } + + function handleClick(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var evt = jQuery.Event('jqplotDataClick'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + } + } + + function handleRightClick(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var idx = plot.plugins.barRenderer.highlightedSeriesIndex; + if (idx != null && plot.series[idx].highlightMouseDown) { + unhighlight(plot); + } + var evt = jQuery.Event('jqplotDataRightClick'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + } + } + + +})(jQuery); diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js new file mode 100755 index 0000000..bac2fc2 --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js @@ -0,0 +1,203 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + /** + * Class: $.jqplot.CanvasAxisLabelRenderer + * Renderer to draw axis labels with a canvas element to support advanced + * featrues such as rotated text. This renderer uses a separate rendering engine + * to draw the text on the canvas. Two modes of rendering the text are available. + * If the browser has native font support for canvas fonts (currently Mozila 3.5 + * and Safari 4), you can enable text rendering with the canvas fillText method. + * You do so by setting the "enableFontSupport" option to true. + * + * Browsers lacking native font support will have the text drawn on the canvas + * using the Hershey font metrics. Even if the "enableFontSupport" option is true + * non-supporting browsers will still render with the Hershey font. + * + */ + $.jqplot.CanvasAxisLabelRenderer = function(options) { + // Group: Properties + + // prop: angle + // angle of text, measured clockwise from x axis. + this.angle = 0; + // name of the axis associated with this tick + this.axis; + // prop: show + // whether or not to show the tick (mark and label). + this.show = true; + // prop: showLabel + // whether or not to show the label. + this.showLabel = true; + // prop: label + // label for the axis. + this.label = ''; + // prop: fontFamily + // CSS spec for the font-family css attribute. + // Applies only to browsers supporting native font rendering in the + // canvas tag. Currently Mozilla 3.5 and Safari 4. + this.fontFamily = '"Trebuchet MS", Arial, Helvetica, sans-serif'; + // prop: fontSize + // CSS spec for font size. + this.fontSize = '11pt'; + // prop: fontWeight + // CSS spec for fontWeight: normal, bold, bolder, lighter or a number 100 - 900 + this.fontWeight = 'normal'; + // prop: fontStretch + // Multiplier to condense or expand font width. + // Applies only to browsers which don't support canvas native font rendering. + this.fontStretch = 1.0; + // prop: textColor + // css spec for the color attribute. + this.textColor = '#666666'; + // prop: enableFontSupport + // true to turn on native canvas font support in Mozilla 3.5+ and Safari 4+. + // If true, label will be drawn with canvas tag native support for fonts. + // If false, label will be drawn with Hershey font metrics. + this.enableFontSupport = true; + // prop: pt2px + // Point to pixel scaling factor, used for computing height of bounding box + // around a label. The labels text renderer has a default setting of 1.4, which + // should be suitable for most fonts. Leave as null to use default. If tops of + // letters appear clipped, increase this. If bounding box seems too big, decrease. + // This is an issue only with the native font renderering capabilities of Mozilla + // 3.5 and Safari 4 since they do not provide a method to determine the font height. + this.pt2px = null; + + this._elem; + this._ctx; + this._plotWidth; + this._plotHeight; + this._plotDimensions = {height:null, width:null}; + + $.extend(true, this, options); + + if (options.angle == null && this.axis != 'xaxis' && this.axis != 'x2axis') { + this.angle = -90; + } + + var ropts = {fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily}; + if (this.pt2px) { + ropts.pt2px = this.pt2px; + } + + if (this.enableFontSupport) { + if ($.jqplot.support_canvas_text()) { + this._textRenderer = new $.jqplot.CanvasFontRenderer(ropts); + } + + else { + this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts); + } + } + else { + this._textRenderer = new $.jqplot.CanvasTextRenderer(ropts); + } + }; + + $.jqplot.CanvasAxisLabelRenderer.prototype.init = function(options) { + $.extend(true, this, options); + this._textRenderer.init({fontSize:this.fontSize, fontWeight:this.fontWeight, fontStretch:this.fontStretch, fillStyle:this.textColor, angle:this.getAngleRad(), fontFamily:this.fontFamily}); + }; + + // return width along the x axis + // will check first to see if an element exists. + // if not, will return the computed text box width. + $.jqplot.CanvasAxisLabelRenderer.prototype.getWidth = function(ctx) { + if (this._elem) { + return this._elem.outerWidth(true); + } + else { + var tr = this._textRenderer; + var l = tr.getWidth(ctx); + var h = tr.getHeight(ctx); + var w = Math.abs(Math.sin(tr.angle)*h) + Math.abs(Math.cos(tr.angle)*l); + return w; + } + }; + + // return height along the y axis. + $.jqplot.CanvasAxisLabelRenderer.prototype.getHeight = function(ctx) { + if (this._elem) { + return this._elem.outerHeight(true); + } + else { + var tr = this._textRenderer; + var l = tr.getWidth(ctx); + var h = tr.getHeight(ctx); + var w = Math.abs(Math.cos(tr.angle)*h) + Math.abs(Math.sin(tr.angle)*l); + return w; + } + }; + + $.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad = function() { + var a = this.angle * Math.PI/180; + return a; + }; + + $.jqplot.CanvasAxisLabelRenderer.prototype.draw = function(ctx, plot) { + // Memory Leaks patch + if (this._elem) { + if ($.jqplot.use_excanvas && window.G_vmlCanvasManager.uninitElement !== undefined) { + window.G_vmlCanvasManager.uninitElement(this._elem.get(0)); + } + + this._elem.emptyForce(); + this._elem = null; + } + + // create a canvas here, but can't draw on it untill it is appended + // to dom for IE compatability. + var elem = plot.canvasManager.getCanvas(); + + this._textRenderer.setText(this.label, ctx); + var w = this.getWidth(ctx); + var h = this.getHeight(ctx); + elem.width = w; + elem.height = h; + elem.style.width = w; + elem.style.height = h; + + elem = plot.canvasManager.initCanvas(elem); + + this._elem = $(elem); + this._elem.css({ position: 'absolute'}); + this._elem.addClass('jqplot-'+this.axis+'-label'); + + elem = null; + return this._elem; + }; + + $.jqplot.CanvasAxisLabelRenderer.prototype.pack = function() { + this._textRenderer.draw(this._elem.get(0).getContext("2d"), this.label); + }; + +})(jQuery); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.canvasTextRenderer.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.canvasTextRenderer.js new file mode 100755 index 0000000..a74ea4e --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.canvasTextRenderer.js @@ -0,0 +1,449 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + * included jsDate library by Chris Leonello: + * + * Copyright (c) 2010-2015 Chris Leonello + * + * jsDate is currently available for use in all personal or commercial projects + * under both the MIT and GPL version 2.0 licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * jsDate borrows many concepts and ideas from the Date Instance + * Methods by Ken Snyder along with some parts of Ken's actual code. + * + * Ken's original Date Instance Methods and copyright notice: + * + * Ken Snyder (ken d snyder at gmail dot com) + * 2008-09-10 + * version 2.0.2 (http://kendsnyder.com/sandbox/date/) + * Creative Commons Attribution License 3.0 (http://creativecommons.org/licenses/by/3.0/) + * + * jqplotToImage function based on Larry Siden's export-jqplot-to-png.js. + * Larry has generously given permission to adapt his code for inclusion + * into jqPlot. + * + * Larry's original code can be found here: + * + * https://github.com/lsiden/export-jqplot-to-png + * + * + */ + +(function($) { + // This code is a modified version of the canvastext.js code, copyright below: + // + // This code is released to the public domain by Jim Studt, 2007. + // He may keep some sort of up to date copy at http://www.federated.com/~jim/canvastext/ + // + $.jqplot.CanvasTextRenderer = function(options){ + this.fontStyle = 'normal'; // normal, italic, oblique [not implemented] + this.fontVariant = 'normal'; // normal, small caps [not implemented] + this.fontWeight = 'normal'; // normal, bold, bolder, lighter, 100 - 900 + this.fontSize = '10px'; + this.fontFamily = 'sans-serif'; + this.fontStretch = 1.0; + this.fillStyle = '#666666'; + this.angle = 0; + this.textAlign = 'start'; + this.textBaseline = 'alphabetic'; + this.text; + this.width; + this.height; + this.pt2px = 1.28; + + $.extend(true, this, options); + this.normalizedFontSize = this.normalizeFontSize(this.fontSize); + this.setHeight(); + }; + + $.jqplot.CanvasTextRenderer.prototype.init = function(options) { + $.extend(true, this, options); + this.normalizedFontSize = this.normalizeFontSize(this.fontSize); + this.setHeight(); + }; + + // convert css spec into point size + // returns float + $.jqplot.CanvasTextRenderer.prototype.normalizeFontSize = function(sz) { + sz = String(sz); + var n = parseFloat(sz); + if (sz.indexOf('px') > -1) { + return n/this.pt2px; + } + else if (sz.indexOf('pt') > -1) { + return n; + } + else if (sz.indexOf('em') > -1) { + return n*12; + } + else if (sz.indexOf('%') > -1) { + return n*12/100; + } + // default to pixels; + else { + return n/this.pt2px; + } + }; + + + $.jqplot.CanvasTextRenderer.prototype.fontWeight2Float = function(w) { + // w = normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 + // return values adjusted for Hershey font. + if (Number(w)) { + return w/400; + } + else { + switch (w) { + case 'normal': + return 1; + break; + case 'bold': + return 1.75; + break; + case 'bolder': + return 2.25; + break; + case 'lighter': + return 0.75; + break; + default: + return 1; + break; + } + } + }; + + $.jqplot.CanvasTextRenderer.prototype.getText = function() { + return this.text; + }; + + $.jqplot.CanvasTextRenderer.prototype.setText = function(t, ctx) { + this.text = t; + this.setWidth(ctx); + return this; + }; + + $.jqplot.CanvasTextRenderer.prototype.getWidth = function(ctx) { + return this.width; + }; + + $.jqplot.CanvasTextRenderer.prototype.setWidth = function(ctx, w) { + if (!w) { + this.width = this.measure(ctx, this.text); + } + else { + this.width = w; + } + return this; + }; + + // return height in pixels. + $.jqplot.CanvasTextRenderer.prototype.getHeight = function(ctx) { + return this.height; + }; + + // w - height in pt + // set heigh in px + $.jqplot.CanvasTextRenderer.prototype.setHeight = function(w) { + if (!w) { + //height = this.fontSize /0.75; + this.height = this.normalizedFontSize * this.pt2px; + } + else { + this.height = w; + } + return this; + }; + + $.jqplot.CanvasTextRenderer.prototype.letter = function (ch) + { + return this.letters[ch]; + }; + + $.jqplot.CanvasTextRenderer.prototype.ascent = function() + { + return this.normalizedFontSize; + }; + + $.jqplot.CanvasTextRenderer.prototype.descent = function() + { + return 7.0*this.normalizedFontSize/25.0; + }; + + $.jqplot.CanvasTextRenderer.prototype.measure = function(ctx, str) + { + var total = 0; + var len = str.length; + + for (var i = 0; i < len; i++) { + var c = this.letter(str.charAt(i)); + if (c) { + total += c.width * this.normalizedFontSize / 25.0 * this.fontStretch; + } + } + return total; + }; + + $.jqplot.CanvasTextRenderer.prototype.draw = function(ctx,str) + { + var x = 0; + // leave room at bottom for descenders. + var y = this.height*0.72; + var total = 0; + var len = str.length; + var mag = this.normalizedFontSize / 25.0; + + ctx.save(); + var tx, ty; + + // 1st quadrant + if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) { + tx = 0; + ty = -Math.sin(this.angle) * this.width; + } + // 4th quadrant + else if ((0 < this.angle && this.angle <= Math.PI/2) || (-Math.PI*2 <= this.angle && this.angle <= -Math.PI*3/2)) { + tx = Math.sin(this.angle) * this.height; + ty = 0; + } + // 2nd quadrant + else if ((-Math.PI < this.angle && this.angle < -Math.PI/2) || (Math.PI <= this.angle && this.angle <= Math.PI*3/2)) { + tx = -Math.cos(this.angle) * this.width; + ty = -Math.sin(this.angle) * this.width - Math.cos(this.angle) * this.height; + } + // 3rd quadrant + else if ((-Math.PI*3/2 < this.angle && this.angle < Math.PI) || (Math.PI/2 < this.angle && this.angle < Math.PI)) { + tx = Math.sin(this.angle) * this.height - Math.cos(this.angle)*this.width; + ty = -Math.cos(this.angle) * this.height; + } + + ctx.strokeStyle = this.fillStyle; + ctx.fillStyle = this.fillStyle; + ctx.translate(tx, ty); + ctx.rotate(this.angle); + ctx.lineCap = "round"; + // multiplier was 2.0 + var fact = (this.normalizedFontSize > 30) ? 2.0 : 2 + (30 - this.normalizedFontSize)/20; + ctx.lineWidth = fact * mag * this.fontWeight2Float(this.fontWeight); + + for ( var i = 0; i < len; i++) { + var c = this.letter( str.charAt(i)); + if ( !c) { + continue; + } + + ctx.beginPath(); + + var penUp = 1; + var needStroke = 0; + for ( var j = 0; j < c.points.length; j++) { + var a = c.points[j]; + if ( a[0] == -1 && a[1] == -1) { + penUp = 1; + continue; + } + if ( penUp) { + ctx.moveTo( x + a[0]*mag*this.fontStretch, y - a[1]*mag); + penUp = false; + } else { + ctx.lineTo( x + a[0]*mag*this.fontStretch, y - a[1]*mag); + } + } + ctx.stroke(); + x += c.width*mag*this.fontStretch; + } + ctx.restore(); + return total; + }; + + $.jqplot.CanvasTextRenderer.prototype.letters = { + ' ': { width: 16, points: [] }, + '!': { width: 10, points: [[5,21],[5,7],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]] }, + '"': { width: 16, points: [[4,21],[4,14],[-1,-1],[12,21],[12,14]] }, + '#': { width: 21, points: [[11,25],[4,-7],[-1,-1],[17,25],[10,-7],[-1,-1],[4,12],[18,12],[-1,-1],[3,6],[17,6]] }, + '$': { width: 20, points: [[8,25],[8,-4],[-1,-1],[12,25],[12,-4],[-1,-1],[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]] }, + '%': { width: 24, points: [[21,21],[3,0],[-1,-1],[8,21],[10,19],[10,17],[9,15],[7,14],[5,14],[3,16],[3,18],[4,20],[6,21],[8,21],[10,20],[13,19],[16,19],[19,20],[21,21],[-1,-1],[17,7],[15,6],[14,4],[14,2],[16,0],[18,0],[20,1],[21,3],[21,5],[19,7],[17,7]] }, + '&': { width: 26, points: [[23,12],[23,13],[22,14],[21,14],[20,13],[19,11],[17,6],[15,3],[13,1],[11,0],[7,0],[5,1],[4,2],[3,4],[3,6],[4,8],[5,9],[12,13],[13,14],[14,16],[14,18],[13,20],[11,21],[9,20],[8,18],[8,16],[9,13],[11,10],[16,3],[18,1],[20,0],[22,0],[23,1],[23,2]] }, + '\'': { width: 10, points: [[5,19],[4,20],[5,21],[6,20],[6,18],[5,16],[4,15]] }, + '(': { width: 14, points: [[11,25],[9,23],[7,20],[5,16],[4,11],[4,7],[5,2],[7,-2],[9,-5],[11,-7]] }, + ')': { width: 14, points: [[3,25],[5,23],[7,20],[9,16],[10,11],[10,7],[9,2],[7,-2],[5,-5],[3,-7]] }, + '*': { width: 16, points: [[8,21],[8,9],[-1,-1],[3,18],[13,12],[-1,-1],[13,18],[3,12]] }, + '+': { width: 26, points: [[13,18],[13,0],[-1,-1],[4,9],[22,9]] }, + ',': { width: 10, points: [[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]] }, + '-': { width: 18, points: [[6,9],[12,9]] }, + '.': { width: 10, points: [[5,2],[4,1],[5,0],[6,1],[5,2]] }, + '/': { width: 22, points: [[20,25],[2,-7]] }, + '0': { width: 20, points: [[9,21],[6,20],[4,17],[3,12],[3,9],[4,4],[6,1],[9,0],[11,0],[14,1],[16,4],[17,9],[17,12],[16,17],[14,20],[11,21],[9,21]] }, + '1': { width: 20, points: [[6,17],[8,18],[11,21],[11,0]] }, + '2': { width: 20, points: [[4,16],[4,17],[5,19],[6,20],[8,21],[12,21],[14,20],[15,19],[16,17],[16,15],[15,13],[13,10],[3,0],[17,0]] }, + '3': { width: 20, points: [[5,21],[16,21],[10,13],[13,13],[15,12],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]] }, + '4': { width: 20, points: [[13,21],[3,7],[18,7],[-1,-1],[13,21],[13,0]] }, + '5': { width: 20, points: [[15,21],[5,21],[4,12],[5,13],[8,14],[11,14],[14,13],[16,11],[17,8],[17,6],[16,3],[14,1],[11,0],[8,0],[5,1],[4,2],[3,4]] }, + '6': { width: 20, points: [[16,18],[15,20],[12,21],[10,21],[7,20],[5,17],[4,12],[4,7],[5,3],[7,1],[10,0],[11,0],[14,1],[16,3],[17,6],[17,7],[16,10],[14,12],[11,13],[10,13],[7,12],[5,10],[4,7]] }, + '7': { width: 20, points: [[17,21],[7,0],[-1,-1],[3,21],[17,21]] }, + '8': { width: 20, points: [[8,21],[5,20],[4,18],[4,16],[5,14],[7,13],[11,12],[14,11],[16,9],[17,7],[17,4],[16,2],[15,1],[12,0],[8,0],[5,1],[4,2],[3,4],[3,7],[4,9],[6,11],[9,12],[13,13],[15,14],[16,16],[16,18],[15,20],[12,21],[8,21]] }, + '9': { width: 20, points: [[16,14],[15,11],[13,9],[10,8],[9,8],[6,9],[4,11],[3,14],[3,15],[4,18],[6,20],[9,21],[10,21],[13,20],[15,18],[16,14],[16,9],[15,4],[13,1],[10,0],[8,0],[5,1],[4,3]] }, + ':': { width: 10, points: [[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[5,2],[4,1],[5,0],[6,1],[5,2]] }, + ';': { width: 10, points: [[5,14],[4,13],[5,12],[6,13],[5,14],[-1,-1],[6,1],[5,0],[4,1],[5,2],[6,1],[6,-1],[5,-3],[4,-4]] }, + '<': { width: 24, points: [[20,18],[4,9],[20,0]] }, + '=': { width: 26, points: [[4,12],[22,12],[-1,-1],[4,6],[22,6]] }, + '>': { width: 24, points: [[4,18],[20,9],[4,0]] }, + '?': { width: 18, points: [[3,16],[3,17],[4,19],[5,20],[7,21],[11,21],[13,20],[14,19],[15,17],[15,15],[14,13],[13,12],[9,10],[9,7],[-1,-1],[9,2],[8,1],[9,0],[10,1],[9,2]] }, + '@': { width: 27, points: [[18,13],[17,15],[15,16],[12,16],[10,15],[9,14],[8,11],[8,8],[9,6],[11,5],[14,5],[16,6],[17,8],[-1,-1],[12,16],[10,14],[9,11],[9,8],[10,6],[11,5],[-1,-1],[18,16],[17,8],[17,6],[19,5],[21,5],[23,7],[24,10],[24,12],[23,15],[22,17],[20,19],[18,20],[15,21],[12,21],[9,20],[7,19],[5,17],[4,15],[3,12],[3,9],[4,6],[5,4],[7,2],[9,1],[12,0],[15,0],[18,1],[20,2],[21,3],[-1,-1],[19,16],[18,8],[18,6],[19,5]] }, + 'A': { width: 18, points: [[9,21],[1,0],[-1,-1],[9,21],[17,0],[-1,-1],[4,7],[14,7]] }, + 'B': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[-1,-1],[4,11],[13,11],[16,10],[17,9],[18,7],[18,4],[17,2],[16,1],[13,0],[4,0]] }, + 'C': { width: 21, points: [[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5]] }, + 'D': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[11,21],[14,20],[16,18],[17,16],[18,13],[18,8],[17,5],[16,3],[14,1],[11,0],[4,0]] }, + 'E': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11],[-1,-1],[4,0],[17,0]] }, + 'F': { width: 18, points: [[4,21],[4,0],[-1,-1],[4,21],[17,21],[-1,-1],[4,11],[12,11]] }, + 'G': { width: 21, points: [[18,16],[17,18],[15,20],[13,21],[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[18,8],[-1,-1],[13,8],[18,8]] }, + 'H': { width: 22, points: [[4,21],[4,0],[-1,-1],[18,21],[18,0],[-1,-1],[4,11],[18,11]] }, + 'I': { width: 8, points: [[4,21],[4,0]] }, + 'J': { width: 16, points: [[12,21],[12,5],[11,2],[10,1],[8,0],[6,0],[4,1],[3,2],[2,5],[2,7]] }, + 'K': { width: 21, points: [[4,21],[4,0],[-1,-1],[18,21],[4,7],[-1,-1],[9,12],[18,0]] }, + 'L': { width: 17, points: [[4,21],[4,0],[-1,-1],[4,0],[16,0]] }, + 'M': { width: 24, points: [[4,21],[4,0],[-1,-1],[4,21],[12,0],[-1,-1],[20,21],[12,0],[-1,-1],[20,21],[20,0]] }, + 'N': { width: 22, points: [[4,21],[4,0],[-1,-1],[4,21],[18,0],[-1,-1],[18,21],[18,0]] }, + 'O': { width: 22, points: [[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21]] }, + 'P': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,14],[17,12],[16,11],[13,10],[4,10]] }, + 'Q': { width: 22, points: [[9,21],[7,20],[5,18],[4,16],[3,13],[3,8],[4,5],[5,3],[7,1],[9,0],[13,0],[15,1],[17,3],[18,5],[19,8],[19,13],[18,16],[17,18],[15,20],[13,21],[9,21],[-1,-1],[12,4],[18,-2]] }, + 'R': { width: 21, points: [[4,21],[4,0],[-1,-1],[4,21],[13,21],[16,20],[17,19],[18,17],[18,15],[17,13],[16,12],[13,11],[4,11],[-1,-1],[11,11],[18,0]] }, + 'S': { width: 20, points: [[17,18],[15,20],[12,21],[8,21],[5,20],[3,18],[3,16],[4,14],[5,13],[7,12],[13,10],[15,9],[16,8],[17,6],[17,3],[15,1],[12,0],[8,0],[5,1],[3,3]] }, + 'T': { width: 16, points: [[8,21],[8,0],[-1,-1],[1,21],[15,21]] }, + 'U': { width: 22, points: [[4,21],[4,6],[5,3],[7,1],[10,0],[12,0],[15,1],[17,3],[18,6],[18,21]] }, + 'V': { width: 18, points: [[1,21],[9,0],[-1,-1],[17,21],[9,0]] }, + 'W': { width: 24, points: [[2,21],[7,0],[-1,-1],[12,21],[7,0],[-1,-1],[12,21],[17,0],[-1,-1],[22,21],[17,0]] }, + 'X': { width: 20, points: [[3,21],[17,0],[-1,-1],[17,21],[3,0]] }, + 'Y': { width: 18, points: [[1,21],[9,11],[9,0],[-1,-1],[17,21],[9,11]] }, + 'Z': { width: 20, points: [[17,21],[3,0],[-1,-1],[3,21],[17,21],[-1,-1],[3,0],[17,0]] }, + '[': { width: 14, points: [[4,25],[4,-7],[-1,-1],[5,25],[5,-7],[-1,-1],[4,25],[11,25],[-1,-1],[4,-7],[11,-7]] }, + '\\': { width: 14, points: [[0,21],[14,-3]] }, + ']': { width: 14, points: [[9,25],[9,-7],[-1,-1],[10,25],[10,-7],[-1,-1],[3,25],[10,25],[-1,-1],[3,-7],[10,-7]] }, + '^': { width: 16, points: [[6,15],[8,18],[10,15],[-1,-1],[3,12],[8,17],[13,12],[-1,-1],[8,17],[8,0]] }, + '_': { width: 16, points: [[0,-2],[16,-2]] }, + '`': { width: 10, points: [[6,21],[5,20],[4,18],[4,16],[5,15],[6,16],[5,17]] }, + 'a': { width: 19, points: [[15,14],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, + 'b': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]] }, + 'c': { width: 18, points: [[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, + 'd': { width: 19, points: [[15,21],[15,0],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, + 'e': { width: 18, points: [[3,8],[15,8],[15,10],[14,12],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, + 'f': { width: 12, points: [[10,21],[8,21],[6,20],[5,17],[5,0],[-1,-1],[2,14],[9,14]] }, + 'g': { width: 19, points: [[15,14],[15,-2],[14,-5],[13,-6],[11,-7],[8,-7],[6,-6],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, + 'h': { width: 19, points: [[4,21],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]] }, + 'i': { width: 8, points: [[3,21],[4,20],[5,21],[4,22],[3,21],[-1,-1],[4,14],[4,0]] }, + 'j': { width: 10, points: [[5,21],[6,20],[7,21],[6,22],[5,21],[-1,-1],[6,14],[6,-3],[5,-6],[3,-7],[1,-7]] }, + 'k': { width: 17, points: [[4,21],[4,0],[-1,-1],[14,14],[4,4],[-1,-1],[8,8],[15,0]] }, + 'l': { width: 8, points: [[4,21],[4,0]] }, + 'm': { width: 30, points: [[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0],[-1,-1],[15,10],[18,13],[20,14],[23,14],[25,13],[26,10],[26,0]] }, + 'n': { width: 19, points: [[4,14],[4,0],[-1,-1],[4,10],[7,13],[9,14],[12,14],[14,13],[15,10],[15,0]] }, + 'o': { width: 19, points: [[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3],[16,6],[16,8],[15,11],[13,13],[11,14],[8,14]] }, + 'p': { width: 19, points: [[4,14],[4,-7],[-1,-1],[4,11],[6,13],[8,14],[11,14],[13,13],[15,11],[16,8],[16,6],[15,3],[13,1],[11,0],[8,0],[6,1],[4,3]] }, + 'q': { width: 19, points: [[15,14],[15,-7],[-1,-1],[15,11],[13,13],[11,14],[8,14],[6,13],[4,11],[3,8],[3,6],[4,3],[6,1],[8,0],[11,0],[13,1],[15,3]] }, + 'r': { width: 13, points: [[4,14],[4,0],[-1,-1],[4,8],[5,11],[7,13],[9,14],[12,14]] }, + 's': { width: 17, points: [[14,11],[13,13],[10,14],[7,14],[4,13],[3,11],[4,9],[6,8],[11,7],[13,6],[14,4],[14,3],[13,1],[10,0],[7,0],[4,1],[3,3]] }, + 't': { width: 12, points: [[5,21],[5,4],[6,1],[8,0],[10,0],[-1,-1],[2,14],[9,14]] }, + 'u': { width: 19, points: [[4,14],[4,4],[5,1],[7,0],[10,0],[12,1],[15,4],[-1,-1],[15,14],[15,0]] }, + 'v': { width: 16, points: [[2,14],[8,0],[-1,-1],[14,14],[8,0]] }, + 'w': { width: 22, points: [[3,14],[7,0],[-1,-1],[11,14],[7,0],[-1,-1],[11,14],[15,0],[-1,-1],[19,14],[15,0]] }, + 'x': { width: 17, points: [[3,14],[14,0],[-1,-1],[14,14],[3,0]] }, + 'y': { width: 16, points: [[2,14],[8,0],[-1,-1],[14,14],[8,0],[6,-4],[4,-6],[2,-7],[1,-7]] }, + 'z': { width: 17, points: [[14,14],[3,0],[-1,-1],[3,14],[14,14],[-1,-1],[3,0],[14,0]] }, + '{': { width: 14, points: [[9,25],[7,24],[6,23],[5,21],[5,19],[6,17],[7,16],[8,14],[8,12],[6,10],[-1,-1],[7,24],[6,22],[6,20],[7,18],[8,17],[9,15],[9,13],[8,11],[4,9],[8,7],[9,5],[9,3],[8,1],[7,0],[6,-2],[6,-4],[7,-6],[-1,-1],[6,8],[8,6],[8,4],[7,2],[6,1],[5,-1],[5,-3],[6,-5],[7,-6],[9,-7]] }, + '|': { width: 8, points: [[4,25],[4,-7]] }, + '}': { width: 14, points: [[5,25],[7,24],[8,23],[9,21],[9,19],[8,17],[7,16],[6,14],[6,12],[8,10],[-1,-1],[7,24],[8,22],[8,20],[7,18],[6,17],[5,15],[5,13],[6,11],[10,9],[6,7],[5,5],[5,3],[6,1],[7,0],[8,-2],[8,-4],[7,-6],[-1,-1],[8,8],[6,6],[6,4],[7,2],[8,1],[9,-1],[9,-3],[8,-5],[7,-6],[5,-7]] }, + '~': { width: 24, points: [[3,6],[3,8],[4,11],[6,12],[8,12],[10,11],[14,8],[16,7],[18,7],[20,8],[21,10],[-1,-1],[3,8],[4,10],[6,11],[8,11],[10,10],[14,7],[16,6],[18,6],[20,7],[21,10],[21,12]] } + }; + + $.jqplot.CanvasFontRenderer = function(options) { + options = options || {}; + if (!options.pt2px) { + options.pt2px = 1.5; + } + $.jqplot.CanvasTextRenderer.call(this, options); + }; + + $.jqplot.CanvasFontRenderer.prototype = new $.jqplot.CanvasTextRenderer({}); + $.jqplot.CanvasFontRenderer.prototype.constructor = $.jqplot.CanvasFontRenderer; + + $.jqplot.CanvasFontRenderer.prototype.measure = function(ctx, str) + { + // var fstyle = this.fontStyle+' '+this.fontVariant+' '+this.fontWeight+' '+this.fontSize+' '+this.fontFamily; + var fstyle = this.fontSize+' '+this.fontFamily; + ctx.save(); + ctx.font = fstyle; + var w = ctx.measureText(str).width; + ctx.restore(); + return w; + }; + + $.jqplot.CanvasFontRenderer.prototype.draw = function(ctx, str) + { + var x = 0; + // leave room at bottom for descenders. + var y = this.height*0.72; + //var y = 12; + + ctx.save(); + var tx, ty; + + // 1st quadrant + if ((-Math.PI/2 <= this.angle && this.angle <= 0) || (Math.PI*3/2 <= this.angle && this.angle <= Math.PI*2)) { + tx = 0; + ty = -Math.sin(this.angle) * this.width; + } + // 4th quadrant + else if ((0 < this.angle && this.angle <= Math.PI/2) || (-Math.PI*2 <= this.angle && this.angle <= -Math.PI*3/2)) { + tx = Math.sin(this.angle) * this.height; + ty = 0; + } + // 2nd quadrant + else if ((-Math.PI < this.angle && this.angle < -Math.PI/2) || (Math.PI <= this.angle && this.angle <= Math.PI*3/2)) { + tx = -Math.cos(this.angle) * this.width; + ty = -Math.sin(this.angle) * this.width - Math.cos(this.angle) * this.height; + } + // 3rd quadrant + else if ((-Math.PI*3/2 < this.angle && this.angle < Math.PI) || (Math.PI/2 < this.angle && this.angle < Math.PI)) { + tx = Math.sin(this.angle) * this.height - Math.cos(this.angle)*this.width; + ty = -Math.cos(this.angle) * this.height; + } + ctx.strokeStyle = this.fillStyle; + ctx.fillStyle = this.fillStyle; + // var fstyle = this.fontStyle+' '+this.fontVariant+' '+this.fontWeight+' '+this.fontSize+' '+this.fontFamily; + var fstyle = this.fontSize+' '+this.fontFamily; + ctx.font = fstyle; + ctx.translate(tx, ty); + ctx.rotate(this.angle); + ctx.fillText(str, x, y); + // ctx.strokeText(str, x, y); + + ctx.restore(); + }; + +})(jQuery); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.categoryAxisRenderer.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.categoryAxisRenderer.js new file mode 100755 index 0000000..fad19e6 --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.categoryAxisRenderer.js @@ -0,0 +1,679 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + /** + * class: $.jqplot.CategoryAxisRenderer + * A plugin for jqPlot to render a category style axis, with equal pixel spacing between y data values of a series. + * + * To use this renderer, include the plugin in your source + * > <script type="text/javascript" language="javascript" src="plugins/jqplot.categoryAxisRenderer.js"></script> + * + * and supply the appropriate options to your plot + * + * > {axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer}}} + **/ + $.jqplot.CategoryAxisRenderer = function(options) { + $.jqplot.LinearAxisRenderer.call(this); + // prop: sortMergedLabels + // True to sort tick labels when labels are created by merging + // x axis values from multiple series. That is, say you have + // two series like: + // > line1 = [[2006, 4], [2008, 9], [2009, 16]]; + // > line2 = [[2006, 3], [2007, 7], [2008, 6]]; + // If no label array is specified, tick labels will be collected + // from the x values of the series. With sortMergedLabels + // set to true, tick labels will be: + // > [2006, 2007, 2008, 2009] + // With sortMergedLabels set to false, tick labels will be: + // > [2006, 2008, 2009, 2007] + // + // Note, this property is specified on the renderOptions for the + // axes when creating a plot: + // > axes:{xaxis:{renderer:$.jqplot.CategoryAxisRenderer, rendererOptions:{sortMergedLabels:true}}} + this.sortMergedLabels = false; + }; + + $.jqplot.CategoryAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.CategoryAxisRenderer.prototype.constructor = $.jqplot.CategoryAxisRenderer; + + $.jqplot.CategoryAxisRenderer.prototype.init = function(options){ + this.groups = 1; + this.groupLabels = []; + this._groupLabels = []; + this._grouped = false; + this._barsPerGroup = null; + this.reverse = false; + // prop: tickRenderer + // A class of a rendering engine for creating the ticks labels displayed on the plot, + // See <$.jqplot.AxisTickRenderer>. + // this.tickRenderer = $.jqplot.AxisTickRenderer; + // this.labelRenderer = $.jqplot.AxisLabelRenderer; + $.extend(true, this, {tickOptions:{formatString:'%d'}}, options); + var db = this._dataBounds; + // Go through all the series attached to this axis and find + // the min/max bounds for this axis. + for (var i=0; i<this._series.length; i++) { + var s = this._series[i]; + if (s.groups) { + this.groups = s.groups; + } + var d = s.data; + + for (var j=0; j<d.length; j++) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + if (d[j][0] < db.min || db.min == null) { + db.min = d[j][0]; + } + if (d[j][0] > db.max || db.max == null) { + db.max = d[j][0]; + } + } + else { + if (d[j][1] < db.min || db.min == null) { + db.min = d[j][1]; + } + if (d[j][1] > db.max || db.max == null) { + db.max = d[j][1]; + } + } + } + } + + if (this.groupLabels.length) { + this.groups = this.groupLabels.length; + } + }; + + + $.jqplot.CategoryAxisRenderer.prototype.createTicks = function() { + // we're are operating on an axis here + var ticks = this._ticks; + var userTicks = this.ticks; + var name = this.name; + // databounds were set on axis initialization. + var db = this._dataBounds; + var dim, interval; + var min, max; + var pos1, pos2; + var tt, i; + + // if we already have ticks, use them. + if (userTicks.length) { + // adjust with blanks if we have groups + if (this.groups > 1 && !this._grouped) { + var l = userTicks.length; + var skip = parseInt(l/this.groups, 10); + var count = 0; + for (var i=skip; i<l; i+=skip) { + userTicks.splice(i+count, 0, ' '); + count++; + } + this._grouped = true; + } + this.min = 0.5; + this.max = userTicks.length + 0.5; + var range = this.max - this.min; + this.numberTicks = 2*userTicks.length + 1; + for (i=0; i<userTicks.length; i++){ + tt = this.min + 2 * i * range / (this.numberTicks-1); + // need a marker before and after the tick + var t = new this.tickRenderer(this.tickOptions); + t.showLabel = false; + // t.showMark = true; + t.setTick(tt, this.name); + this._ticks.push(t); + var t = new this.tickRenderer(this.tickOptions); + t.label = userTicks[i]; + // t.showLabel = true; + t.showMark = false; + t.showGridline = false; + t.setTick(tt+0.5, this.name); + this._ticks.push(t); + } + // now add the last tick at the end + var t = new this.tickRenderer(this.tickOptions); + t.showLabel = false; + // t.showMark = true; + t.setTick(tt+1, this.name); + this._ticks.push(t); + } + + // we don't have any ticks yet, let's make some! + else { + if (name == 'xaxis' || name == 'x2axis') { + dim = this._plotDimensions.width; + } + else { + dim = this._plotDimensions.height; + } + + // if min, max and number of ticks specified, user can't specify interval. + if (this.min != null && this.max != null && this.numberTicks != null) { + this.tickInterval = null; + } + + // if max, min, and interval specified and interval won't fit, ignore interval. + if (this.min != null && this.max != null && this.tickInterval != null) { + if (parseInt((this.max-this.min)/this.tickInterval, 10) != (this.max-this.min)/this.tickInterval) { + this.tickInterval = null; + } + } + + // find out how many categories are in the lines and collect labels + var labels = []; + var numcats = 0; + var min = 0.5; + var max, val; + var isMerged = false; + for (var i=0; i<this._series.length; i++) { + var s = this._series[i]; + for (var j=0; j<s.data.length; j++) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + val = s.data[j][0]; + } + else { + val = s.data[j][1]; + } + if ($.inArray(val, labels) == -1) { + isMerged = true; + numcats += 1; + labels.push(val); + } + } + } + + if (isMerged && this.sortMergedLabels) { + if (typeof labels[0] == "string") { + labels.sort(); + } else { + labels.sort(function(a,b) { return a - b; }); + } + } + + // keep a reference to these tick labels to use for redrawing plot (see bug #57) + this.ticks = labels; + + // now bin the data values to the right lables. + for (var i=0; i<this._series.length; i++) { + var s = this._series[i]; + for (var j=0; j<s.data.length; j++) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + val = s.data[j][0]; + } + else { + val = s.data[j][1]; + } + // for category axis, force the values into category bins. + // we should have the value in the label array now. + var idx = $.inArray(val, labels)+1; + if (this.name == 'xaxis' || this.name == 'x2axis') { + s.data[j][0] = idx; + } + else { + s.data[j][1] = idx; + } + } + } + + // adjust with blanks if we have groups + if (this.groups > 1 && !this._grouped) { + var l = labels.length; + var skip = parseInt(l/this.groups, 10); + var count = 0; + for (var i=skip; i<l; i+=skip+1) { + labels[i] = ' '; + } + this._grouped = true; + } + + max = numcats + 0.5; + if (this.numberTicks == null) { + this.numberTicks = 2*numcats + 1; + } + + var range = max - min; + this.min = min; + this.max = max; + var track = 0; + + // todo: adjust this so more ticks displayed. + var maxVisibleTicks = parseInt(3+dim/10, 10); + var skip = parseInt(numcats/maxVisibleTicks, 10); + + if (this.tickInterval == null) { + + this.tickInterval = range / (this.numberTicks-1); + + } + // if tickInterval is specified, we will ignore any computed maximum. + for (var i=0; i<this.numberTicks; i++){ + tt = this.min + i * this.tickInterval; + var t = new this.tickRenderer(this.tickOptions); + // if even tick, it isn't a category, it's a divider + if (i/2 == parseInt(i/2, 10)) { + t.showLabel = false; + t.showMark = true; + } + else { + if (skip>0 && track<skip) { + t.showLabel = false; + track += 1; + } + else { + t.showLabel = true; + track = 0; + } + t.label = t.formatter(t.formatString, labels[(i-1)/2]); + t.showMark = false; + t.showGridline = false; + } + t.setTick(tt, this.name); + this._ticks.push(t); + } + } + + }; + + // called with scope of axis + $.jqplot.CategoryAxisRenderer.prototype.draw = function(ctx, plot) { + if (this.show) { + // populate the axis label and value properties. + // createTicks is a method on the renderer, but + // call it within the scope of the axis. + this.renderer.createTicks.call(this); + // fill a div with axes labels in the right direction. + // Need to pregenerate each axis to get its bounds and + // position it and the labels correctly on the plot. + var dim=0; + var temp; + // Added for theming. + if (this._elem) { + // this._elem.empty(); + // Memory Leaks patch + this._elem.emptyForce(); + } + + this._elem = this._elem || $('<div class="jqplot-axis jqplot-'+this.name+'" style="position:absolute;"></div>'); + + if (this.name == 'xaxis' || this.name == 'x2axis') { + this._elem.width(this._plotDimensions.width); + } + else { + this._elem.height(this._plotDimensions.height); + } + + // create a _label object. + this.labelOptions.axis = this.name; + this._label = new this.labelRenderer(this.labelOptions); + if (this._label.show) { + var elem = this._label.draw(ctx, plot); + elem.appendTo(this._elem); + } + + var t = this._ticks; + for (var i=0; i<t.length; i++) { + var tick = t[i]; + if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) { + var elem = tick.draw(ctx, plot); + elem.appendTo(this._elem); + } + } + + this._groupLabels = []; + // now make group labels + for (var i=0; i<this.groupLabels.length; i++) + { + var elem = $('<div style="position:absolute;" class="jqplot-'+this.name+'-groupLabel"></div>'); + elem.html(this.groupLabels[i]); + this._groupLabels.push(elem); + elem.appendTo(this._elem); + } + } + return this._elem; + }; + + // called with scope of axis + $.jqplot.CategoryAxisRenderer.prototype.set = function() { + var dim = 0; + var temp; + var w = 0; + var h = 0; + var lshow = (this._label == null) ? false : this._label.show; + if (this.show) { + var t = this._ticks; + for (var i=0; i<t.length; i++) { + var tick = t[i]; + if (tick.showLabel && (!tick.isMinorTick || this.showMinorTicks)) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + temp = tick._elem.outerHeight(true); + } + else { + temp = tick._elem.outerWidth(true); + } + if (temp > dim) { + dim = temp; + } + } + } + + var dim2 = 0; + for (var i=0; i<this._groupLabels.length; i++) { + var l = this._groupLabels[i]; + if (this.name == 'xaxis' || this.name == 'x2axis') { + temp = l.outerHeight(true); + } + else { + temp = l.outerWidth(true); + } + if (temp > dim2) { + dim2 = temp; + } + } + + if (lshow) { + w = this._label._elem.outerWidth(true); + h = this._label._elem.outerHeight(true); + } + if (this.name == 'xaxis') { + dim += dim2 + h; + this._elem.css({'height':dim+'px', left:'0px', bottom:'0px'}); + } + else if (this.name == 'x2axis') { + dim += dim2 + h; + this._elem.css({'height':dim+'px', left:'0px', top:'0px'}); + } + else if (this.name == 'yaxis') { + dim += dim2 + w; + this._elem.css({'width':dim+'px', left:'0px', top:'0px'}); + if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) { + this._label._elem.css('width', w+'px'); + } + } + else { + dim += dim2 + w; + this._elem.css({'width':dim+'px', right:'0px', top:'0px'}); + if (lshow && this._label.constructor == $.jqplot.AxisLabelRenderer) { + this._label._elem.css('width', w+'px'); + } + } + } + }; + + // called with scope of axis + $.jqplot.CategoryAxisRenderer.prototype.pack = function(pos, offsets) { + var ticks = this._ticks; + var max = this.max; + var min = this.min; + var offmax = offsets.max; + var offmin = offsets.min; + var lshow = (this._label == null) ? false : this._label.show; + var i; + + for (var p in pos) { + this._elem.css(p, pos[p]); + } + + this._offsets = offsets; + // pixellength will be + for x axes and - for y axes becasue pixels always measured from top left. + var pixellength = offmax - offmin; + var unitlength = max - min; + + if (!this.reverse) { + // point to unit and unit to point conversions references to Plot DOM element top left corner. + + this.u2p = function(u){ + return (u - min) * pixellength / unitlength + offmin; + }; + + this.p2u = function(p){ + return (p - offmin) * unitlength / pixellength + min; + }; + + if (this.name == 'xaxis' || this.name == 'x2axis'){ + this.series_u2p = function(u){ + return (u - min) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + min; + }; + } + + else { + this.series_u2p = function(u){ + return (u - max) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + max; + }; + } + } + + else { + // point to unit and unit to point conversions references to Plot DOM element top left corner. + + this.u2p = function(u){ + return offmin + (max - u) * pixellength / unitlength; + }; + + this.p2u = function(p){ + return min + (p - offmin) * unitlength / pixellength; + }; + + if (this.name == 'xaxis' || this.name == 'x2axis'){ + this.series_u2p = function(u){ + return (max - u) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + max; + }; + } + + else { + this.series_u2p = function(u){ + return (min - u) * pixellength / unitlength; + }; + this.series_p2u = function(p){ + return p * unitlength / pixellength + min; + }; + } + + } + + + if (this.show) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + for (i=0; i<ticks.length; i++) { + var t = ticks[i]; + if (t.show && t.showLabel) { + var shim; + + if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) { + // will need to adjust auto positioning based on which axis this is. + var temp = (this.name == 'xaxis') ? 1 : -1; + switch (t.labelPosition) { + case 'auto': + // position at end + if (temp * t.angle < 0) { + shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + } + // position at start + else { + shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2; + } + break; + case 'end': + shim = -t.getWidth() + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + break; + case 'start': + shim = -t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2; + break; + case 'middle': + shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + break; + default: + shim = -t.getWidth()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + break; + } + } + else { + shim = -t.getWidth()/2; + } + var val = this.u2p(t.value) + shim + 'px'; + t._elem.css('left', val); + t.pack(); + } + } + + var labeledge=['bottom', 0]; + if (lshow) { + var w = this._label._elem.outerWidth(true); + this._label._elem.css('left', offmin + pixellength/2 - w/2 + 'px'); + if (this.name == 'xaxis') { + this._label._elem.css('bottom', '0px'); + labeledge = ['bottom', this._label._elem.outerHeight(true)]; + } + else { + this._label._elem.css('top', '0px'); + labeledge = ['top', this._label._elem.outerHeight(true)]; + } + this._label.pack(); + } + + // draw the group labels + var step = parseInt(this._ticks.length/this.groups, 10) + 1; + for (i=0; i<this._groupLabels.length; i++) { + var mid = 0; + var count = 0; + for (var j=i*step; j<(i+1)*step; j++) { + if (j >= this._ticks.length-1) continue; // the last tick does not exist as there is no other group in order to have an empty one. + if (this._ticks[j]._elem && this._ticks[j].label != " ") { + var t = this._ticks[j]._elem; + var p = t.position(); + mid += p.left + t.outerWidth(true)/2; + count++; + } + } + mid = mid/count; + this._groupLabels[i].css({'left':(mid - this._groupLabels[i].outerWidth(true)/2)}); + this._groupLabels[i].css(labeledge[0], labeledge[1]); + } + } + else { + for (i=0; i<ticks.length; i++) { + var t = ticks[i]; + if (t.show && t.showLabel) { + var shim; + if (t.constructor == $.jqplot.CanvasAxisTickRenderer && t.angle) { + // will need to adjust auto positioning based on which axis this is. + var temp = (this.name == 'yaxis') ? 1 : -1; + switch (t.labelPosition) { + case 'auto': + // position at end + case 'end': + if (temp * t.angle < 0) { + shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2; + } + else { + shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2; + } + break; + case 'start': + if (t.angle > 0) { + shim = -t._textRenderer.height * Math.cos(-t._textRenderer.angle) / 2; + } + else { + shim = -t.getHeight() + t._textRenderer.height * Math.cos(t._textRenderer.angle) / 2; + } + break; + case 'middle': + // if (t.angle > 0) { + // shim = -t.getHeight()/2 + t._textRenderer.height * Math.sin(-t._textRenderer.angle) / 2; + // } + // else { + // shim = -t.getHeight()/2 - t._textRenderer.height * Math.sin(t._textRenderer.angle) / 2; + // } + shim = -t.getHeight()/2; + break; + default: + shim = -t.getHeight()/2; + break; + } + } + else { + shim = -t.getHeight()/2; + } + + var val = this.u2p(t.value) + shim + 'px'; + t._elem.css('top', val); + t.pack(); + } + } + + var labeledge=['left', 0]; + if (lshow) { + var h = this._label._elem.outerHeight(true); + this._label._elem.css('top', offmax - pixellength/2 - h/2 + 'px'); + if (this.name == 'yaxis') { + this._label._elem.css('left', '0px'); + labeledge = ['left', this._label._elem.outerWidth(true)]; + } + else { + this._label._elem.css('right', '0px'); + labeledge = ['right', this._label._elem.outerWidth(true)]; + } + this._label.pack(); + } + + // draw the group labels, position top here, do left after label position. + var step = parseInt(this._ticks.length/this.groups, 10) + 1; // step is one more than before as we don't want to have overlaps in loops + for (i=0; i<this._groupLabels.length; i++) { + var mid = 0; + var count = 0; + for (var j=i*step; j<(i+1)*step; j++) { // j must never reach (i+1)*step as we don't want to have overlap between loops + if (j >= this._ticks.length-1) continue; // the last tick does not exist as there is no other group in order to have an empty one. + if (this._ticks[j]._elem && this._ticks[j].label != " ") { + var t = this._ticks[j]._elem; + var p = t.position(); + mid += p.top + t.outerHeight()/2; + count++; + } + } + mid = mid/count; + this._groupLabels[i].css({'top':mid - this._groupLabels[i].outerHeight()/2}); + this._groupLabels[i].css(labeledge[0], labeledge[1]); + + } + } + } + }; + + +})(jQuery); diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.cursor.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.cursor.js new file mode 100755 index 0000000..0b5571b --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.cursor.js @@ -0,0 +1,1108 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + + /** + * Class: $.jqplot.Cursor + * Plugin class representing the cursor as displayed on the plot. + */ + $.jqplot.Cursor = function(options) { + // Group: Properties + // + // prop: style + // CSS spec for cursor style + this.style = 'crosshair'; + this.previousCursor = 'auto'; + // prop: show + // whether to show the cursor or not. + this.show = $.jqplot.config.enablePlugins; + // prop: showTooltip + // show a cursor position tooltip. Location of the tooltip + // will be controlled by followMouse and tooltipLocation. + this.showTooltip = true; + // prop: followMouse + // Tooltip follows the mouse, it is not at a fixed location. + // Tooltip will show on the grid at the location given by + // tooltipLocation, offset from the grid edge by tooltipOffset. + this.followMouse = false; + // prop: tooltipLocation + // Where to position tooltip. If followMouse is true, this is + // relative to the cursor, otherwise, it is relative to the grid. + // One of 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw' + this.tooltipLocation = 'se'; + // prop: tooltipOffset + // Pixel offset of tooltip from the grid boudaries or cursor center. + this.tooltipOffset = 6; + // prop: showTooltipGridPosition + // show the grid pixel coordinates of the mouse. + this.showTooltipGridPosition = false; + // prop: showTooltipUnitPosition + // show the unit (data) coordinates of the mouse. + this.showTooltipUnitPosition = true; + // prop: showTooltipDataPosition + // Used with showVerticalLine to show intersecting data points in the tooltip. + this.showTooltipDataPosition = false; + // prop: tooltipFormatString + // sprintf format string for the tooltip. + // Uses Ash Searle's javascript sprintf implementation + // found here: http://hexmen.com/blog/2007/03/printf-sprintf/ + // See http://perldoc.perl.org/functions/sprintf.html for reference + // Note, if showTooltipDataPosition is true, the default tooltipFormatString + // will be set to the cursorLegendFormatString, not the default given here. + this.tooltipFormatString = '%.4P, %.4P'; + // prop: useAxesFormatters + // Use the x and y axes formatters to format the text in the tooltip. + this.useAxesFormatters = true; + // prop: tooltipAxisGroups + // Show position for the specified axes. + // This is an array like [['xaxis', 'yaxis'], ['xaxis', 'y2axis']] + // Default is to compute automatically for all visible axes. + this.tooltipAxisGroups = []; + // prop: zoom + // Enable plot zooming. + this.zoom = false; + // zoomProxy and zoomTarget properties are not directly set by user. + // They Will be set through call to zoomProxy method. + this.zoomProxy = false; + this.zoomTarget = false; + // prop: looseZoom + // Will expand zoom range to provide more rounded tick values. + // Works only with linear, log and date axes. + this.looseZoom = true; + // prop: clickReset + // Will reset plot zoom if single click on plot without drag. + this.clickReset = false; + // prop: dblClickReset + // Will reset plot zoom if double click on plot without drag. + this.dblClickReset = true; + // prop: showVerticalLine + // draw a vertical line across the plot which follows the cursor. + // When the line is near a data point, a special legend and/or tooltip can + // be updated with the data values. + this.showVerticalLine = false; + // prop: showHorizontalLine + // draw a horizontal line across the plot which follows the cursor. + this.showHorizontalLine = false; + // prop: constrainZoomTo + // 'none', 'x' or 'y' + this.constrainZoomTo = 'none'; + // // prop: autoscaleConstraint + // // when a constrained axis is specified, true will + // // auatoscale the adjacent axis. + // this.autoscaleConstraint = true; + this.shapeRenderer = new $.jqplot.ShapeRenderer(); + this._zoom = {start:[], end:[], started: false, zooming:false, isZoomed:false, axes:{start:{}, end:{}}, gridpos:{}, datapos:{}}; + this._tooltipElem; + this.zoomCanvas; + this.cursorCanvas; + // prop: intersectionThreshold + // pixel distance from data point or marker to consider cursor lines intersecting with point. + // If data point markers are not shown, this should be >= 1 or will often miss point intersections. + this.intersectionThreshold = 2; + // prop: showCursorLegend + // Replace the plot legend with an enhanced legend displaying intersection information. + this.showCursorLegend = false; + // prop: cursorLegendFormatString + // Format string used in the cursor legend. If showTooltipDataPosition is true, + // this will also be the default format string used by tooltipFormatString. + this.cursorLegendFormatString = $.jqplot.Cursor.cursorLegendFormatString; + // whether the cursor is over the grid or not. + this._oldHandlers = {onselectstart: null, ondrag: null, onmousedown: null}; + // prop: constrainOutsideZoom + // True to limit actual zoom area to edges of grid, even when zooming + // outside of plot area. That is, can't zoom out by mousing outside plot. + this.constrainOutsideZoom = true; + // prop: showTooltipOutsideZoom + // True will keep updating the tooltip when zooming of the grid. + this.showTooltipOutsideZoom = false; + // true if mouse is over grid, false if not. + this.onGrid = false; + $.extend(true, this, options); + }; + + $.jqplot.Cursor.cursorLegendFormatString = '%s x:%s, y:%s'; + + // called with scope of plot + $.jqplot.Cursor.init = function (target, data, opts){ + // add a cursor attribute to the plot + var options = opts || {}; + this.plugins.cursor = new $.jqplot.Cursor(options.cursor); + var c = this.plugins.cursor; + + if (c.show) { + $.jqplot.eventListenerHooks.push(['jqplotMouseEnter', handleMouseEnter]); + $.jqplot.eventListenerHooks.push(['jqplotMouseLeave', handleMouseLeave]); + $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMouseMove]); + + if (c.showCursorLegend) { + opts.legend = opts.legend || {}; + opts.legend.renderer = $.jqplot.CursorLegendRenderer; + opts.legend.formatString = this.plugins.cursor.cursorLegendFormatString; + opts.legend.show = true; + } + + if (c.zoom) { + $.jqplot.eventListenerHooks.push(['jqplotMouseDown', handleMouseDown]); + + if (c.clickReset) { + $.jqplot.eventListenerHooks.push(['jqplotClick', handleClick]); + } + + if (c.dblClickReset) { + $.jqplot.eventListenerHooks.push(['jqplotDblClick', handleDblClick]); + } + } + + this.resetZoom = function() { + var axes = this.axes; + if (!c.zoomProxy) { + for (var ax in axes) { + axes[ax].reset(); + axes[ax]._ticks = []; + // fake out tick creation algorithm to make sure original auto + // computed format string is used if _overrideFormatString is true + if (c._zoom.axes[ax] !== undefined) { + axes[ax]._autoFormatString = c._zoom.axes[ax].tickFormatString; + } + } + this.redraw(); + } + else { + var ctx = this.plugins.cursor.zoomCanvas._ctx; + ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); + ctx = null; + } + this.plugins.cursor._zoom.isZoomed = false; + this.target.trigger('jqplotResetZoom', [this, this.plugins.cursor]); + }; + + + if (c.showTooltipDataPosition) { + c.showTooltipUnitPosition = false; + c.showTooltipGridPosition = false; + if (options.cursor.tooltipFormatString == undefined) { + c.tooltipFormatString = $.jqplot.Cursor.cursorLegendFormatString; + } + } + } + }; + + // called with context of plot + $.jqplot.Cursor.postDraw = function() { + var c = this.plugins.cursor; + + // Memory Leaks patch + if (c.zoomCanvas) { + c.zoomCanvas.resetCanvas(); + c.zoomCanvas = null; + } + + if (c.cursorCanvas) { + c.cursorCanvas.resetCanvas(); + c.cursorCanvas = null; + } + + if (c._tooltipElem) { + c._tooltipElem.emptyForce(); + c._tooltipElem = null; + } + + + if (c.zoom) { + c.zoomCanvas = new $.jqplot.GenericCanvas(); + this.eventCanvas._elem.before(c.zoomCanvas.createElement(this._gridPadding, 'jqplot-zoom-canvas', this._plotDimensions, this)); + c.zoomCanvas.setContext(); + } + + var elem = document.createElement('div'); + c._tooltipElem = $(elem); + elem = null; + c._tooltipElem.addClass('jqplot-cursor-tooltip'); + c._tooltipElem.css({position:'absolute', display:'none'}); + + + if (c.zoomCanvas) { + c.zoomCanvas._elem.before(c._tooltipElem); + } + + else { + this.eventCanvas._elem.before(c._tooltipElem); + } + + if (c.showVerticalLine || c.showHorizontalLine) { + c.cursorCanvas = new $.jqplot.GenericCanvas(); + this.eventCanvas._elem.before(c.cursorCanvas.createElement(this._gridPadding, 'jqplot-cursor-canvas', this._plotDimensions, this)); + c.cursorCanvas.setContext(); + } + + // if we are showing the positions in unit coordinates, and no axes groups + // were specified, create a default set. + if (c.showTooltipUnitPosition){ + if (c.tooltipAxisGroups.length === 0) { + var series = this.series; + var s; + var temp = []; + for (var i=0; i<series.length; i++) { + s = series[i]; + var ax = s.xaxis+','+s.yaxis; + if ($.inArray(ax, temp) == -1) { + temp.push(ax); + } + } + for (var i=0; i<temp.length; i++) { + c.tooltipAxisGroups.push(temp[i].split(',')); + } + } + } + }; + + // Group: methods + // + // method: $.jqplot.Cursor.zoomProxy + // links targetPlot to controllerPlot so that plot zooming of + // targetPlot will be controlled by zooming on the controllerPlot. + // controllerPlot will not actually zoom, but acts as an + // overview plot. Note, the zoom options must be set to true for + // zoomProxy to work. + $.jqplot.Cursor.zoomProxy = function(targetPlot, controllerPlot) { + var tc = targetPlot.plugins.cursor; + var cc = controllerPlot.plugins.cursor; + tc.zoomTarget = true; + tc.zoom = true; + tc.style = 'auto'; + tc.dblClickReset = false; + cc.zoom = true; + cc.zoomProxy = true; + + controllerPlot.target.bind('jqplotZoom', plotZoom); + controllerPlot.target.bind('jqplotResetZoom', plotReset); + + function plotZoom(ev, gridpos, datapos, plot, cursor) { + tc.doZoom(gridpos, datapos, targetPlot, cursor); + } + + function plotReset(ev, plot, cursor) { + targetPlot.resetZoom(); + } + }; + + $.jqplot.Cursor.prototype.resetZoom = function(plot, cursor) { + var axes = plot.axes; + var cax = cursor._zoom.axes; + if (!plot.plugins.cursor.zoomProxy && cursor._zoom.isZoomed) { + for (var ax in axes) { + // axes[ax]._ticks = []; + // axes[ax].min = cax[ax].min; + // axes[ax].max = cax[ax].max; + // axes[ax].numberTicks = cax[ax].numberTicks; + // axes[ax].tickInterval = cax[ax].tickInterval; + // // for date axes + // axes[ax].daTickInterval = cax[ax].daTickInterval; + axes[ax].reset(); + axes[ax]._ticks = []; + // fake out tick creation algorithm to make sure original auto + // computed format string is used if _overrideFormatString is true + axes[ax]._autoFormatString = cax[ax].tickFormatString; + } + plot.redraw(); + cursor._zoom.isZoomed = false; + } + else { + var ctx = cursor.zoomCanvas._ctx; + ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); + ctx = null; + } + plot.target.trigger('jqplotResetZoom', [plot, cursor]); + }; + + $.jqplot.Cursor.resetZoom = function(plot) { + plot.resetZoom(); + }; + + $.jqplot.Cursor.prototype.doZoom = function (gridpos, datapos, plot, cursor) { + var c = cursor; + var axes = plot.axes; + var zaxes = c._zoom.axes; + var start = zaxes.start; + var end = zaxes.end; + var min, max, dp, span, + newmin, newmax, curax, _numberTicks, ret; + var ctx = plot.plugins.cursor.zoomCanvas._ctx; + // don't zoom if zoom area is too small (in pixels) + if ((c.constrainZoomTo == 'none' && Math.abs(gridpos.x - c._zoom.start[0]) > 6 && Math.abs(gridpos.y - c._zoom.start[1]) > 6) || (c.constrainZoomTo == 'x' && Math.abs(gridpos.x - c._zoom.start[0]) > 6) || (c.constrainZoomTo == 'y' && Math.abs(gridpos.y - c._zoom.start[1]) > 6)) { + if (!plot.plugins.cursor.zoomProxy) { + for (var ax in datapos) { + // make a copy of the original axes to revert back. + if (c._zoom.axes[ax] == undefined) { + c._zoom.axes[ax] = {}; + c._zoom.axes[ax].numberTicks = axes[ax].numberTicks; + c._zoom.axes[ax].tickInterval = axes[ax].tickInterval; + // for date axes... + c._zoom.axes[ax].daTickInterval = axes[ax].daTickInterval; + c._zoom.axes[ax].min = axes[ax].min; + c._zoom.axes[ax].max = axes[ax].max; + c._zoom.axes[ax].tickFormatString = (axes[ax].tickOptions != null) ? axes[ax].tickOptions.formatString : ''; + } + + + if ((c.constrainZoomTo == 'none') || (c.constrainZoomTo == 'x' && ax.charAt(0) == 'x') || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'y')) { + dp = datapos[ax]; + if (dp != null) { + if (dp > start[ax]) { + newmin = start[ax]; + newmax = dp; + } + else { + span = start[ax] - dp; + newmin = dp; + newmax = start[ax]; + } + + curax = axes[ax]; + + _numberTicks = null; + + // if aligning this axis, use number of ticks from previous axis. + // Do I need to reset somehow if alignTicks is changed and then graph is replotted?? + if (curax.alignTicks) { + if (curax.name === 'x2axis' && plot.axes.xaxis.show) { + _numberTicks = plot.axes.xaxis.numberTicks; + } + else if (curax.name.charAt(0) === 'y' && curax.name !== 'yaxis' && curax.name !== 'yMidAxis' && plot.axes.yaxis.show) { + _numberTicks = plot.axes.yaxis.numberTicks; + } + } + + if (this.looseZoom && (axes[ax].renderer.constructor === $.jqplot.LinearAxisRenderer || axes[ax].renderer.constructor === $.jqplot.LogAxisRenderer )) { //} || axes[ax].renderer.constructor === $.jqplot.DateAxisRenderer)) { + + ret = $.jqplot.LinearTickGenerator(newmin, newmax, curax._scalefact, _numberTicks); + + // if new minimum is less than "true" minimum of axis display, adjust it + if (axes[ax].tickInset && ret[0] < axes[ax].min + axes[ax].tickInset * axes[ax].tickInterval) { + ret[0] += ret[4]; + ret[2] -= 1; + } + + // if new maximum is greater than "true" max of axis display, adjust it + if (axes[ax].tickInset && ret[1] > axes[ax].max - axes[ax].tickInset * axes[ax].tickInterval) { + ret[1] -= ret[4]; + ret[2] -= 1; + } + + // for log axes, don't fall below current minimum, this will look bad and can't have 0 in range anyway. + if (axes[ax].renderer.constructor === $.jqplot.LogAxisRenderer && ret[0] < axes[ax].min) { + // remove a tick and shift min up + ret[0] += ret[4]; + ret[2] -= 1; + } + + axes[ax].min = ret[0]; + axes[ax].max = ret[1]; + axes[ax]._autoFormatString = ret[3]; + axes[ax].numberTicks = ret[2]; + axes[ax].tickInterval = ret[4]; + // for date axes... + axes[ax].daTickInterval = [ret[4]/1000, 'seconds']; + } + else { + axes[ax].min = newmin; + axes[ax].max = newmax; + axes[ax].tickInterval = null; + axes[ax].numberTicks = null; + // for date axes... + axes[ax].daTickInterval = null; + } + + axes[ax]._ticks = []; + } + } + + // if ((c.constrainZoomTo == 'x' && ax.charAt(0) == 'y' && c.autoscaleConstraint) || (c.constrainZoomTo == 'y' && ax.charAt(0) == 'x' && c.autoscaleConstraint)) { + // dp = datapos[ax]; + // if (dp != null) { + // axes[ax].max == null; + // axes[ax].min = null; + // } + // } + } + ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); + plot.redraw(); + c._zoom.isZoomed = true; + ctx = null; + } + plot.target.trigger('jqplotZoom', [gridpos, datapos, plot, cursor]); + } + }; + + $.jqplot.preInitHooks.push($.jqplot.Cursor.init); + $.jqplot.postDrawHooks.push($.jqplot.Cursor.postDraw); + + function updateTooltip(gridpos, datapos, plot) { + var c = plot.plugins.cursor; + var s = ''; + var addbr = false; + if (c.showTooltipGridPosition) { + s = gridpos.x+', '+gridpos.y; + addbr = true; + } + if (c.showTooltipUnitPosition) { + var g; + for (var i=0; i<c.tooltipAxisGroups.length; i++) { + g = c.tooltipAxisGroups[i]; + if (addbr) { + s += '<br />'; + } + if (c.useAxesFormatters) { + for (var j=0; j<g.length; j++) { + if (j) { + s += ', '; + } + var af = plot.axes[g[j]]._ticks[0].formatter; + var afstr = plot.axes[g[j]]._ticks[0].formatString; + s += af(afstr, datapos[g[j]]); + } + } + else { + s += $.jqplot.sprintf(c.tooltipFormatString, datapos[g[0]], datapos[g[1]]); + } + addbr = true; + } + } + + if (c.showTooltipDataPosition) { + var series = plot.series; + var ret = getIntersectingPoints(plot, gridpos.x, gridpos.y); + var addbr = false; + + for (var i = 0; i< series.length; i++) { + if (series[i].show) { + var idx = series[i].index; + var label = series[i].label.toString(); + var cellid = $.inArray(idx, ret.indices); + var sx = undefined; + var sy = undefined; + if (cellid != -1) { + var data = ret.data[cellid].data; + if (c.useAxesFormatters) { + var xf = series[i]._xaxis._ticks[0].formatter; + var yf = series[i]._yaxis._ticks[0].formatter; + var xfstr = series[i]._xaxis._ticks[0].formatString; + var yfstr = series[i]._yaxis._ticks[0].formatString; + sx = xf(xfstr, data[0]); + sy = yf(yfstr, data[1]); + } + else { + sx = data[0]; + sy = data[1]; + } + if (addbr) { + s += '<br />'; + } + s += $.jqplot.sprintf(c.tooltipFormatString, label, sx, sy); + addbr = true; + } + } + } + + } + c._tooltipElem.html(s); + } + + function moveLine(gridpos, plot) { + var c = plot.plugins.cursor; + var ctx = c.cursorCanvas._ctx; + ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); + if (c.showVerticalLine) { + c.shapeRenderer.draw(ctx, [[gridpos.x, 0], [gridpos.x, ctx.canvas.height]]); + } + if (c.showHorizontalLine) { + c.shapeRenderer.draw(ctx, [[0, gridpos.y], [ctx.canvas.width, gridpos.y]]); + } + var ret = getIntersectingPoints(plot, gridpos.x, gridpos.y); + if (c.showCursorLegend) { + var cells = $(plot.targetId + ' td.jqplot-cursor-legend-label'); + for (var i=0; i<cells.length; i++) { + var idx = $(cells[i]).data('seriesIndex'); + var series = plot.series[idx]; + var label = series.label.toString(); + var cellid = $.inArray(idx, ret.indices); + var sx = undefined; + var sy = undefined; + if (cellid != -1) { + var data = ret.data[cellid].data; + if (c.useAxesFormatters) { + var xf = series._xaxis._ticks[0].formatter; + var yf = series._yaxis._ticks[0].formatter; + var xfstr = series._xaxis._ticks[0].formatString; + var yfstr = series._yaxis._ticks[0].formatString; + sx = xf(xfstr, data[0]); + sy = yf(yfstr, data[1]); + } + else { + sx = data[0]; + sy = data[1]; + } + } + if (plot.legend.escapeHtml) { + $(cells[i]).text($.jqplot.sprintf(c.cursorLegendFormatString, label, sx, sy)); + } + else { + $(cells[i]).html($.jqplot.sprintf(c.cursorLegendFormatString, label, sx, sy)); + } + } + } + ctx = null; + } + + function getIntersectingPoints(plot, x, y) { + var ret = {indices:[], data:[]}; + var s, i, d0, d, j, r, p; + var threshold; + var c = plot.plugins.cursor; + for (var i=0; i<plot.series.length; i++) { + s = plot.series[i]; + r = s.renderer; + if (s.show) { + threshold = c.intersectionThreshold; + if (s.showMarker) { + threshold += s.markerRenderer.size/2; + } + for (var j=0; j<s.gridData.length; j++) { + p = s.gridData[j]; + // check vertical line + if (c.showVerticalLine) { + if (Math.abs(x-p[0]) <= threshold) { + ret.indices.push(i); + ret.data.push({seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]}); + } + } + } + } + } + return ret; + } + + function moveTooltip(gridpos, plot) { + var c = plot.plugins.cursor; + var elem = c._tooltipElem; + switch (c.tooltipLocation) { + case 'nw': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset; + var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true); + break; + case 'n': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2; + var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true); + break; + case 'ne': + var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset; + var y = gridpos.y + plot._gridPadding.top - c.tooltipOffset - elem.outerHeight(true); + break; + case 'e': + var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset; + var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2; + break; + case 'se': + var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset; + var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset; + break; + case 's': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2; + var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset; + break; + case 'sw': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset; + var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset; + break; + case 'w': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - c.tooltipOffset; + var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2; + break; + default: + var x = gridpos.x + plot._gridPadding.left + c.tooltipOffset; + var y = gridpos.y + plot._gridPadding.top + c.tooltipOffset; + break; + } + + elem.css('left', x); + elem.css('top', y); + elem = null; + } + + function positionTooltip(plot) { + // fake a grid for positioning + var grid = plot._gridPadding; + var c = plot.plugins.cursor; + var elem = c._tooltipElem; + switch (c.tooltipLocation) { + case 'nw': + var a = grid.left + c.tooltipOffset; + var b = grid.top + c.tooltipOffset; + elem.css('left', a); + elem.css('top', b); + break; + case 'n': + var a = (grid.left + (plot._plotDimensions.width - grid.right))/2 - elem.outerWidth(true)/2; + var b = grid.top + c.tooltipOffset; + elem.css('left', a); + elem.css('top', b); + break; + case 'ne': + var a = grid.right + c.tooltipOffset; + var b = grid.top + c.tooltipOffset; + elem.css({right:a, top:b}); + break; + case 'e': + var a = grid.right + c.tooltipOffset; + var b = (grid.top + (plot._plotDimensions.height - grid.bottom))/2 - elem.outerHeight(true)/2; + elem.css({right:a, top:b}); + break; + case 'se': + var a = grid.right + c.tooltipOffset; + var b = grid.bottom + c.tooltipOffset; + elem.css({right:a, bottom:b}); + break; + case 's': + var a = (grid.left + (plot._plotDimensions.width - grid.right))/2 - elem.outerWidth(true)/2; + var b = grid.bottom + c.tooltipOffset; + elem.css({left:a, bottom:b}); + break; + case 'sw': + var a = grid.left + c.tooltipOffset; + var b = grid.bottom + c.tooltipOffset; + elem.css({left:a, bottom:b}); + break; + case 'w': + var a = grid.left + c.tooltipOffset; + var b = (grid.top + (plot._plotDimensions.height - grid.bottom))/2 - elem.outerHeight(true)/2; + elem.css({left:a, top:b}); + break; + default: // same as 'se' + var a = grid.right - c.tooltipOffset; + var b = grid.bottom + c.tooltipOffset; + elem.css({right:a, bottom:b}); + break; + } + elem = null; + } + + function handleClick (ev, gridpos, datapos, neighbor, plot) { + ev.preventDefault(); + ev.stopImmediatePropagation(); + var c = plot.plugins.cursor; + if (c.clickReset) { + c.resetZoom(plot, c); + } + var sel = window.getSelection; + if (document.selection && document.selection.empty) + { + document.selection.empty(); + } + else if (sel && !sel().isCollapsed) { + sel().collapse(); + } + return false; + } + + function handleDblClick (ev, gridpos, datapos, neighbor, plot) { + ev.preventDefault(); + ev.stopImmediatePropagation(); + var c = plot.plugins.cursor; + if (c.dblClickReset) { + c.resetZoom(plot, c); + } + var sel = window.getSelection; + if (document.selection && document.selection.empty) + { + document.selection.empty(); + } + else if (sel && !sel().isCollapsed) { + sel().collapse(); + } + return false; + } + + function handleMouseLeave(ev, gridpos, datapos, neighbor, plot) { + var c = plot.plugins.cursor; + c.onGrid = false; + if (c.show) { + $(ev.target).css('cursor', c.previousCursor); + if (c.showTooltip && !(c._zoom.zooming && c.showTooltipOutsideZoom && !c.constrainOutsideZoom)) { + c._tooltipElem.empty(); + c._tooltipElem.hide(); + } + if (c.zoom) { + c._zoom.gridpos = gridpos; + c._zoom.datapos = datapos; + } + if (c.showVerticalLine || c.showHorizontalLine) { + var ctx = c.cursorCanvas._ctx; + ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); + ctx = null; + } + if (c.showCursorLegend) { + var cells = $(plot.targetId + ' td.jqplot-cursor-legend-label'); + for (var i=0; i<cells.length; i++) { + var idx = $(cells[i]).data('seriesIndex'); + var series = plot.series[idx]; + var label = series.label.toString(); + if (plot.legend.escapeHtml) { + $(cells[i]).text($.jqplot.sprintf(c.cursorLegendFormatString, label, undefined, undefined)); + } + else { + $(cells[i]).html($.jqplot.sprintf(c.cursorLegendFormatString, label, undefined, undefined)); + } + + } + } + } + } + + function handleMouseEnter(ev, gridpos, datapos, neighbor, plot) { + var c = plot.plugins.cursor; + c.onGrid = true; + if (c.show) { + c.previousCursor = ev.target.style.cursor; + ev.target.style.cursor = c.style; + if (c.showTooltip) { + updateTooltip(gridpos, datapos, plot); + if (c.followMouse) { + moveTooltip(gridpos, plot); + } + else { + positionTooltip(plot); + } + c._tooltipElem.show(); + } + if (c.showVerticalLine || c.showHorizontalLine) { + moveLine(gridpos, plot); + } + } + + } + + function handleMouseMove(ev, gridpos, datapos, neighbor, plot) { + var c = plot.plugins.cursor; + if (c.show) { + if (c.showTooltip) { + updateTooltip(gridpos, datapos, plot); + if (c.followMouse) { + moveTooltip(gridpos, plot); + } + } + if (c.showVerticalLine || c.showHorizontalLine) { + moveLine(gridpos, plot); + } + } + } + + function getEventPosition(ev) { + var plot = ev.data.plot; + var go = plot.eventCanvas._elem.offset(); + var gridPos = {x:ev.pageX - go.left, y:ev.pageY - go.top}; + ////// + // TO DO: handle yMidAxis + ////// + var dataPos = {xaxis:null, yaxis:null, x2axis:null, y2axis:null, y3axis:null, y4axis:null, y5axis:null, y6axis:null, y7axis:null, y8axis:null, y9axis:null, yMidAxis:null}; + var an = ['xaxis', 'yaxis', 'x2axis', 'y2axis', 'y3axis', 'y4axis', 'y5axis', 'y6axis', 'y7axis', 'y8axis', 'y9axis', 'yMidAxis']; + var ax = plot.axes; + var n, axis; + for (n=11; n>0; n--) { + axis = an[n-1]; + if (ax[axis].show) { + dataPos[axis] = ax[axis].series_p2u(gridPos[axis.charAt(0)]); + } + } + + return {offsets:go, gridPos:gridPos, dataPos:dataPos}; + } + + function handleZoomMove(ev) { + var plot = ev.data.plot; + var c = plot.plugins.cursor; + // don't do anything if not on grid. + if (c.show && c.zoom && c._zoom.started && !c.zoomTarget) { + ev.preventDefault(); + var ctx = c.zoomCanvas._ctx; + var positions = getEventPosition(ev); + var gridpos = positions.gridPos; + var datapos = positions.dataPos; + c._zoom.gridpos = gridpos; + c._zoom.datapos = datapos; + c._zoom.zooming = true; + var xpos = gridpos.x; + var ypos = gridpos.y; + var height = ctx.canvas.height; + var width = ctx.canvas.width; + if (c.showTooltip && !c.onGrid && c.showTooltipOutsideZoom) { + updateTooltip(gridpos, datapos, plot); + if (c.followMouse) { + moveTooltip(gridpos, plot); + } + } + if (c.constrainZoomTo == 'x') { + c._zoom.end = [xpos, height]; + } + else if (c.constrainZoomTo == 'y') { + c._zoom.end = [width, ypos]; + } + else { + c._zoom.end = [xpos, ypos]; + } + var sel = window.getSelection; + if (document.selection && document.selection.empty) + { + document.selection.empty(); + } + else if (sel && !sel().isCollapsed) { + sel().collapse(); + } + drawZoomBox.call(c); + ctx = null; + } + } + + function handleMouseDown(ev, gridpos, datapos, neighbor, plot) { + var c = plot.plugins.cursor; + if(plot.plugins.mobile){ + $(document).one('vmouseup.jqplot_cursor', {plot:plot}, handleMouseUp); + } else { + $(document).one('mouseup.jqplot_cursor', {plot:plot}, handleMouseUp); + } + var axes = plot.axes; + if (document.onselectstart != undefined) { + c._oldHandlers.onselectstart = document.onselectstart; + document.onselectstart = function () { return false; }; + } + if (document.ondrag != undefined) { + c._oldHandlers.ondrag = document.ondrag; + document.ondrag = function () { return false; }; + } + if (document.onmousedown != undefined) { + c._oldHandlers.onmousedown = document.onmousedown; + document.onmousedown = function () { return false; }; + } + if (c.zoom) { + if (!c.zoomProxy) { + var ctx = c.zoomCanvas._ctx; + ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); + ctx = null; + } + if (c.constrainZoomTo == 'x') { + c._zoom.start = [gridpos.x, 0]; + } + else if (c.constrainZoomTo == 'y') { + c._zoom.start = [0, gridpos.y]; + } + else { + c._zoom.start = [gridpos.x, gridpos.y]; + } + c._zoom.started = true; + for (var ax in datapos) { + // get zoom starting position. + c._zoom.axes.start[ax] = datapos[ax]; + } + if(plot.plugins.mobile){ + $(document).bind('vmousemove.jqplotCursor', {plot:plot}, handleZoomMove); + } else { + $(document).bind('mousemove.jqplotCursor', {plot:plot}, handleZoomMove); + } + + } + } + + function handleMouseUp(ev) { + var plot = ev.data.plot; + var c = plot.plugins.cursor; + if (c.zoom && c._zoom.zooming && !c.zoomTarget) { + var xpos = c._zoom.gridpos.x; + var ypos = c._zoom.gridpos.y; + var datapos = c._zoom.datapos; + var height = c.zoomCanvas._ctx.canvas.height; + var width = c.zoomCanvas._ctx.canvas.width; + var axes = plot.axes; + + if (c.constrainOutsideZoom && !c.onGrid) { + if (xpos < 0) { xpos = 0; } + else if (xpos > width) { xpos = width; } + if (ypos < 0) { ypos = 0; } + else if (ypos > height) { ypos = height; } + + for (var axis in datapos) { + if (datapos[axis]) { + if (axis.charAt(0) == 'x') { + datapos[axis] = axes[axis].series_p2u(xpos); + } + else { + datapos[axis] = axes[axis].series_p2u(ypos); + } + } + } + } + + if (c.constrainZoomTo == 'x') { + ypos = height; + } + else if (c.constrainZoomTo == 'y') { + xpos = width; + } + c._zoom.end = [xpos, ypos]; + c._zoom.gridpos = {x:xpos, y:ypos}; + + c.doZoom(c._zoom.gridpos, datapos, plot, c); + } + c._zoom.started = false; + c._zoom.zooming = false; + + $(document).unbind('mousemove.jqplotCursor', handleZoomMove); + + if (document.onselectstart != undefined && c._oldHandlers.onselectstart != null){ + document.onselectstart = c._oldHandlers.onselectstart; + c._oldHandlers.onselectstart = null; + } + if (document.ondrag != undefined && c._oldHandlers.ondrag != null){ + document.ondrag = c._oldHandlers.ondrag; + c._oldHandlers.ondrag = null; + } + if (document.onmousedown != undefined && c._oldHandlers.onmousedown != null){ + document.onmousedown = c._oldHandlers.onmousedown; + c._oldHandlers.onmousedown = null; + } + + } + + function drawZoomBox() { + var start = this._zoom.start; + var end = this._zoom.end; + var ctx = this.zoomCanvas._ctx; + var l, t, h, w; + if (end[0] > start[0]) { + l = start[0]; + w = end[0] - start[0]; + } + else { + l = end[0]; + w = start[0] - end[0]; + } + if (end[1] > start[1]) { + t = start[1]; + h = end[1] - start[1]; + } + else { + t = end[1]; + h = start[1] - end[1]; + } + ctx.fillStyle = 'rgba(0,0,0,0.2)'; + ctx.strokeStyle = '#999999'; + ctx.lineWidth = 1.0; + ctx.clearRect(0,0,ctx.canvas.width, ctx.canvas.height); + ctx.fillRect(0,0,ctx.canvas.width, ctx.canvas.height); + ctx.clearRect(l, t, w, h); + // IE won't show transparent fill rect, so stroke a rect also. + ctx.strokeRect(l,t,w,h); + ctx = null; + } + + $.jqplot.CursorLegendRenderer = function(options) { + $.jqplot.TableLegendRenderer.call(this, options); + this.formatString = '%s'; + }; + + $.jqplot.CursorLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); + $.jqplot.CursorLegendRenderer.prototype.constructor = $.jqplot.CursorLegendRenderer; + + // called in context of a Legend + $.jqplot.CursorLegendRenderer.prototype.draw = function() { + if (this._elem) { + this._elem.emptyForce(); + this._elem = null; + } + if (this.show) { + var series = this._series, s; + // make a table. one line label per row. + var elem = document.createElement('table'); + this._elem = $(elem); + elem = null; + this._elem.addClass('jqplot-legend jqplot-cursor-legend'); + this._elem.css('position', 'absolute'); + + var pad = false; + for (var i = 0; i< series.length; i++) { + s = series[i]; + if (s.show && s.showLabel) { + var lt = $.jqplot.sprintf(this.formatString, s.label.toString()); + if (lt) { + var color = s.color; + if (s._stack && !s.fill) { + color = ''; + } + addrow.call(this, lt, color, pad, i); + pad = true; + } + // let plugins add more rows to legend. Used by trend line plugin. + for (var j=0; j<$.jqplot.addLegendRowHooks.length; j++) { + var item = $.jqplot.addLegendRowHooks[j].call(this, s); + if (item) { + addrow.call(this, item.label, item.color, pad); + pad = true; + } + } + } + } + series = s = null; + delete series; + delete s; + } + + function addrow(label, color, pad, idx) { + var rs = (pad) ? this.rowSpacing : '0'; + var tr = $('<tr class="jqplot-legend jqplot-cursor-legend"></tr>').appendTo(this._elem); + tr.data('seriesIndex', idx); + $('<td class="jqplot-legend jqplot-cursor-legend-swatch" style="padding-top:'+rs+';">'+ + '<div style="border:1px solid #cccccc;padding:0.2em;">'+ + '<div class="jqplot-cursor-legend-swatch" style="background-color:'+color+';"></div>'+ + '</div></td>').appendTo(tr); + var td = $('<td class="jqplot-legend jqplot-cursor-legend-label" style="vertical-align:middle;padding-top:'+rs+';"></td>'); + td.appendTo(tr); + td.data('seriesIndex', idx); + if (this.escapeHtml) { + td.text(label); + } + else { + td.html(label); + } + tr = null; + td = null; + } + return this._elem; + }; + +})(jQuery); diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.dateAxisRenderer.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.dateAxisRenderer.js new file mode 100755 index 0000000..ade574e --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.dateAxisRenderer.js @@ -0,0 +1,741 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + /** + * Class: $.jqplot.DateAxisRenderer + * A plugin for a jqPlot to render an axis as a series of date values. + * This renderer has no options beyond those supplied by the <Axis> class. + * It supplies its own tick formatter, so the tickOptions.formatter option + * should not be overridden. + * + * Thanks to Ken Synder for his enhanced Date instance methods which are + * included with this code <http://kendsnyder.com/sandbox/date/>. + * + * To use this renderer, include the plugin in your source + * > <script type="text/javascript" language="javascript" src="plugins/jqplot.dateAxisRenderer.js"></script> + * + * and supply the appropriate options to your plot + * + * > {axes:{xaxis:{renderer:$.jqplot.DateAxisRenderer}}} + * + * Dates can be passed into the axis in almost any recognizable value and + * will be parsed. They will be rendered on the axis in the format + * specified by tickOptions.formatString. e.g. tickOptions.formatString = '%Y-%m-%d'. + * + * Accecptable format codes + * are: + * + * > Code Result Description + * > == Years == + * > %Y 2008 Four-digit year + * > %y 08 Two-digit year + * > == Months == + * > %m 09 Two-digit month + * > %#m 9 One or two-digit month + * > %B September Full month name + * > %b Sep Abbreviated month name + * > == Days == + * > %d 05 Two-digit day of month + * > %#d 5 One or two-digit day of month + * > %e 5 One or two-digit day of month + * > %A Sunday Full name of the day of the week + * > %a Sun Abbreviated name of the day of the week + * > %w 0 Number of the day of the week (0 = Sunday, 6 = Saturday) + * > %o th The ordinal suffix string following the day of the month + * > == Hours == + * > %H 23 Hours in 24-hour format (two digits) + * > %#H 3 Hours in 24-hour integer format (one or two digits) + * > %I 11 Hours in 12-hour format (two digits) + * > %#I 3 Hours in 12-hour integer format (one or two digits) + * > %p PM AM or PM + * > == Minutes == + * > %M 09 Minutes (two digits) + * > %#M 9 Minutes (one or two digits) + * > == Seconds == + * > %S 02 Seconds (two digits) + * > %#S 2 Seconds (one or two digits) + * > %s 1206567625723 Unix timestamp (Seconds past 1970-01-01 00:00:00) + * > == Milliseconds == + * > %N 008 Milliseconds (three digits) + * > %#N 8 Milliseconds (one to three digits) + * > == Timezone == + * > %O 360 difference in minutes between local time and GMT + * > %Z Mountain Standard Time Name of timezone as reported by browser + * > %G -06:00 Hours and minutes between GMT + * > == Shortcuts == + * > %F 2008-03-26 %Y-%m-%d + * > %T 05:06:30 %H:%M:%S + * > %X 05:06:30 %H:%M:%S + * > %x 03/26/08 %m/%d/%y + * > %D 03/26/08 %m/%d/%y + * > %#c Wed Mar 26 15:31:00 2008 %a %b %e %H:%M:%S %Y + * > %v 3-Sep-2008 %e-%b-%Y + * > %R 15:31 %H:%M + * > %r 3:31:00 PM %I:%M:%S %p + * > == Characters == + * > %n \n Newline + * > %t \t Tab + * > %% % Percent Symbol + */ + $.jqplot.DateAxisRenderer = function() { + $.jqplot.LinearAxisRenderer.call(this); + this.date = new $.jsDate(); + }; + + var second = 1000; + var minute = 60 * second; + var hour = 60 * minute; + var day = 24 * hour; + var week = 7 * day; + + // these are less definitive + var month = 30.4368499 * day; + var year = 365.242199 * day; + + var daysInMonths = [31,28,31,30,31,30,31,30,31,30,31,30]; + // array of consistent nice intervals. Longer intervals + // will depend on days in month, days in year, etc. + var niceFormatStrings = ['%M:%S.%#N', '%M:%S.%#N', '%M:%S.%#N', '%M:%S', '%M:%S', '%M:%S', '%M:%S', '%H:%M:%S', '%H:%M:%S', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%H:%M', '%a %H:%M', '%a %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%b %e %H:%M', '%v', '%v', '%v', '%v', '%v', '%v', '%v']; + var niceIntervals = [0.1*second, 0.2*second, 0.5*second, second, 2*second, 5*second, 10*second, 15*second, 30*second, minute, 2*minute, 5*minute, 10*minute, 15*minute, 30*minute, hour, 2*hour, 4*hour, 6*hour, 8*hour, 12*hour, day, 2*day, 3*day, 4*day, 5*day, week, 2*week]; + + var niceMonthlyIntervals = []; + + function bestDateInterval(min, max, titarget) { + // iterate through niceIntervals to find one closest to titarget + var badness = Number.MAX_VALUE; + var temp, bestTi, bestfmt; + for (var i=0, l=niceIntervals.length; i < l; i++) { + temp = Math.abs(titarget - niceIntervals[i]); + if (temp < badness) { + badness = temp; + bestTi = niceIntervals[i]; + bestfmt = niceFormatStrings[i]; + } + } + + return [bestTi, bestfmt]; + } + + $.jqplot.DateAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.DateAxisRenderer.prototype.constructor = $.jqplot.DateAxisRenderer; + + $.jqplot.DateTickFormatter = function(format, val) { + if (!format) { + format = '%Y/%m/%d'; + } + return $.jsDate.strftime(val, format); + }; + + $.jqplot.DateAxisRenderer.prototype.init = function(options){ + // prop: tickRenderer + // A class of a rendering engine for creating the ticks labels displayed on the plot, + // See <$.jqplot.AxisTickRenderer>. + // this.tickRenderer = $.jqplot.AxisTickRenderer; + // this.labelRenderer = $.jqplot.AxisLabelRenderer; + this.tickOptions.formatter = $.jqplot.DateTickFormatter; + // prop: tickInset + // Controls the amount to inset the first and last ticks from + // the edges of the grid, in multiples of the tick interval. + // 0 is no inset, 0.5 is one half a tick interval, 1 is a full + // tick interval, etc. + this.tickInset = 0; + // prop: drawBaseline + // True to draw the axis baseline. + this.drawBaseline = true; + // prop: baselineWidth + // width of the baseline in pixels. + this.baselineWidth = null; + // prop: baselineColor + // CSS color spec for the baseline. + this.baselineColor = null; + this.daTickInterval = null; + this._daTickInterval = null; + + $.extend(true, this, options); + + var db = this._dataBounds, + stats, + sum, + s, + d, + pd, + sd, + intv; + + // Go through all the series attached to this axis and find + // the min/max bounds for this axis. + for (var i=0; i<this._series.length; i++) { + stats = {intervals:[], frequencies:{}, sortedIntervals:[], min:null, max:null, mean:null}; + sum = 0; + s = this._series[i]; + d = s.data; + pd = s._plotData; + sd = s._stackData; + intv = 0; + + for (var j=0; j<d.length; j++) { + if (this.name == 'xaxis' || this.name == 'x2axis') { + d[j][0] = new $.jsDate(d[j][0]).getTime(); + pd[j][0] = new $.jsDate(d[j][0]).getTime(); + sd[j][0] = new $.jsDate(d[j][0]).getTime(); + if ((d[j][0] != null && d[j][0] < db.min) || db.min == null) { + db.min = d[j][0]; + } + if ((d[j][0] != null && d[j][0] > db.max) || db.max == null) { + db.max = d[j][0]; + } + if (j>0) { + intv = Math.abs(d[j][0] - d[j-1][0]); + stats.intervals.push(intv); + if (stats.frequencies.hasOwnProperty(intv)) { + stats.frequencies[intv] += 1; + } + else { + stats.frequencies[intv] = 1; + } + } + sum += intv; + + } + else { + d[j][1] = new $.jsDate(d[j][1]).getTime(); + pd[j][1] = new $.jsDate(d[j][1]).getTime(); + sd[j][1] = new $.jsDate(d[j][1]).getTime(); + if ((d[j][1] != null && d[j][1] < db.min) || db.min == null) { + db.min = d[j][1]; + } + if ((d[j][1] != null && d[j][1] > db.max) || db.max == null) { + db.max = d[j][1]; + } + if (j>0) { + intv = Math.abs(d[j][1] - d[j-1][1]); + stats.intervals.push(intv); + if (stats.frequencies.hasOwnProperty(intv)) { + stats.frequencies[intv] += 1; + } + else { + stats.frequencies[intv] = 1; + } + } + } + sum += intv; + } + + if (s.renderer.bands) { + if (s.renderer.bands.hiData.length) { + var bd = s.renderer.bands.hiData; + for (var j=0, l=bd.length; j < l; j++) { + if (this.name === 'xaxis' || this.name === 'x2axis') { + bd[j][0] = new $.jsDate(bd[j][0]).getTime(); + if ((bd[j][0] != null && bd[j][0] > db.max) || db.max == null) { + db.max = bd[j][0]; + } + } + else { + bd[j][1] = new $.jsDate(bd[j][1]).getTime(); + if ((bd[j][1] != null && bd[j][1] > db.max) || db.max == null) { + db.max = bd[j][1]; + } + } + } + } + if (s.renderer.bands.lowData.length) { + var bd = s.renderer.bands.lowData; + for (var j=0, l=bd.length; j < l; j++) { + if (this.name === 'xaxis' || this.name === 'x2axis') { + bd[j][0] = new $.jsDate(bd[j][0]).getTime(); + if ((bd[j][0] != null && bd[j][0] < db.min) || db.min == null) { + db.min = bd[j][0]; + } + } + else { + bd[j][1] = new $.jsDate(bd[j][1]).getTime(); + if ((bd[j][1] != null && bd[j][1] < db.min) || db.min == null) { + db.min = bd[j][1]; + } + } + } + } + } + + var tempf = 0, + tempn=0; + for (var n in stats.frequencies) { + stats.sortedIntervals.push({interval:n, frequency:stats.frequencies[n]}); + } + stats.sortedIntervals.sort(function(a, b){ + return b.frequency - a.frequency; + }); + + stats.min = $.jqplot.arrayMin(stats.intervals); + stats.max = $.jqplot.arrayMax(stats.intervals); + stats.mean = sum/d.length; + this._intervalStats.push(stats); + stats = sum = s = d = pd = sd = null; + } + db = null; + + }; + + // called with scope of an axis + $.jqplot.DateAxisRenderer.prototype.reset = function() { + this.min = this._options.min; + this.max = this._options.max; + this.tickInterval = this._options.tickInterval; + this.numberTicks = this._options.numberTicks; + this._autoFormatString = ''; + if (this._overrideFormatString && this.tickOptions && this.tickOptions.formatString) { + this.tickOptions.formatString = ''; + } + this.daTickInterval = this._daTickInterval; + // this._ticks = this.__ticks; + }; + + $.jqplot.DateAxisRenderer.prototype.createTicks = function(plot) { + // we're are operating on an axis here + var ticks = this._ticks; + var userTicks = this.ticks; + var name = this.name; + // databounds were set on axis initialization. + var db = this._dataBounds; + var iv = this._intervalStats; + var dim = (this.name.charAt(0) === 'x') ? this._plotDimensions.width : this._plotDimensions.height; + var interval; + var min, max; + var pos1, pos2; + var tt, i; + var threshold = 30; + var insetMult = 1; + var daTickInterval = null; + + // if user specified a tick interval, convert to usable. + if (this.tickInterval != null) + { + // if interval is a number or can be converted to one, use it. + // Assume it is in SECONDS!!! + if (Number(this.tickInterval)) { + daTickInterval = [Number(this.tickInterval), 'seconds']; + } + // else, parse out something we can build from. + else if (typeof this.tickInterval == "string") { + var parts = this.tickInterval.split(' '); + if (parts.length == 1) { + daTickInterval = [1, parts[0]]; + } + else if (parts.length == 2) { + daTickInterval = [parts[0], parts[1]]; + } + } + } + + var tickInterval = this.tickInterval; + + // if we already have ticks, use them. + // ticks must be in order of increasing value. + + min = new $.jsDate((this.min != null) ? this.min : db.min).getTime(); + max = new $.jsDate((this.max != null) ? this.max : db.max).getTime(); + + // see if we're zooming. if we are, don't use the min and max we're given, + // but compute some nice ones. They will be reset later. + + var cursor = plot.plugins.cursor; + + if (cursor && cursor._zoom && cursor._zoom.zooming) { + this.min = null; + this.max = null; + } + + var range = max - min; + + if (this.tickOptions == null || !this.tickOptions.formatString) { + this._overrideFormatString = true; + } + + if (userTicks.length) { + // ticks could be 1D or 2D array of [val, val, ,,,] or [[val, label], [val, label], ...] or mixed + for (i=0; i<userTicks.length; i++){ + var ut = userTicks[i]; + var t = new this.tickRenderer(this.tickOptions); + if (ut.constructor == Array) { + t.value = new $.jsDate(ut[0]).getTime(); + t.label = ut[1]; + if (!this.showTicks) { + t.showLabel = false; + t.showMark = false; + } + else if (!this.showTickMarks) { + t.showMark = false; + } + t.setTick(t.value, this.name); + this._ticks.push(t); + } + + else { + t.value = new $.jsDate(ut).getTime(); + if (!this.showTicks) { + t.showLabel = false; + t.showMark = false; + } + else if (!this.showTickMarks) { + t.showMark = false; + } + t.setTick(t.value, this.name); + this._ticks.push(t); + } + } + this.numberTicks = userTicks.length; + this.min = this._ticks[0].value; + this.max = this._ticks[this.numberTicks-1].value; + this.daTickInterval = [(this.max - this.min) / (this.numberTicks - 1)/1000, 'seconds']; + } + + //////// + // We don't have any ticks yet, let's make some! + //////// + + // special case when there is only one point, make three tick marks to center the point + else if (this.min == null && this.max == null && db.min == db.max) + { + var onePointOpts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null}); + var delta = 300000; + this.min = db.min - delta; + this.max = db.max + delta; + this.numberTicks = 3; + + for(var i=this.min;i<=this.max;i+= delta) + { + onePointOpts.value = i; + + var t = new this.tickRenderer(onePointOpts); + + if (this._overrideFormatString && this._autoFormatString != '') { + t.formatString = this._autoFormatString; + } + + t.showLabel = false; + t.showMark = false; + + this._ticks.push(t); + } + + if(this.showTicks) { + this._ticks[1].showLabel = true; + } + if(this.showTickMarks) { + this._ticks[1].showTickMarks = true; + } + } + // if user specified min and max are null, we set those to make best ticks. + else if (this.min == null && this.max == null) { + + var opts = $.extend(true, {}, this.tickOptions, {name: this.name, value: null}); + + // want to find a nice interval + var nttarget, + titarget; + + // if no tickInterval or numberTicks options specified, make a good guess. + if (!this.tickInterval && !this.numberTicks) { + var tdim = Math.max(dim, threshold+1); + // how many ticks to put on the axis? + // date labels tend to be long. If ticks not rotated, + // don't use too many and have a high spacing factor. + // If we are rotating ticks, use a lower factor. + var spacingFactor = 115; + if (this.tickRenderer === $.jqplot.CanvasAxisTickRenderer && this.tickOptions.angle) { + spacingFactor = 115 - 40 * Math.abs(Math.sin(this.tickOptions.angle/180*Math.PI)); + } + + nttarget = Math.ceil((tdim-threshold)/spacingFactor + 1); + titarget = (max - min) / (nttarget - 1); + } + + // If tickInterval is specified, we'll try to honor it. + // Not guaranteed to get this interval, but we'll get as close as + // we can. + // tickInterval will be used before numberTicks, that is if + // both are specified, numberTicks will be ignored. + else if (this.tickInterval) { + titarget = new $.jsDate(0).add(daTickInterval[0], daTickInterval[1]).getTime(); + } + + // if numberTicks specified, try to honor it. + // Not guaranteed, but will try to get close. + else if (this.numberTicks) { + nttarget = this.numberTicks; + titarget = (max - min) / (nttarget - 1); + } + + // If we can use an interval of 2 weeks or less, pick best one + if (titarget <= 19*day) { + var ret = bestDateInterval(min, max, titarget); + var tempti = ret[0]; + this._autoFormatString = ret[1]; + + min = new $.jsDate(min); + min = Math.floor((min.getTime() - min.getUtcOffset())/tempti) * tempti + min.getUtcOffset(); + + nttarget = Math.ceil((max - min) / tempti) + 1; + this.min = min; + this.max = min + (nttarget - 1) * tempti; + + // if max is less than max, add an interval + if (this.max < max) { + this.max += tempti; + nttarget += 1; + } + this.tickInterval = tempti; + this.numberTicks = nttarget; + + for (var i=0; i<nttarget; i++) { + opts.value = this.min + i * tempti; + t = new this.tickRenderer(opts); + + if (this._overrideFormatString && this._autoFormatString != '') { + t.formatString = this._autoFormatString; + } + if (!this.showTicks) { + t.showLabel = false; + t.showMark = false; + } + else if (!this.showTickMarks) { + t.showMark = false; + } + this._ticks.push(t); + } + + insetMult = this.tickInterval; + } + + // should we use a monthly interval? + else if (titarget <= 9 * month) { + + this._autoFormatString = '%v'; + + // how many months in an interval? + var intv = Math.round(titarget/month); + if (intv < 1) { + intv = 1; + } + else if (intv > 6) { + intv = 6; + } + + // figure out the starting month and ending month. + var mstart = new $.jsDate(min).setDate(1).setHours(0,0,0,0); + + // See if max ends exactly on a month + var tempmend = new $.jsDate(max); + var mend = new $.jsDate(max).setDate(1).setHours(0,0,0,0); + + if (tempmend.getTime() !== mend.getTime()) { + mend = mend.add(1, 'month'); + } + + var nmonths = mend.diff(mstart, 'month'); + + nttarget = Math.ceil(nmonths/intv) + 1; + + this.min = mstart.getTime(); + this.max = mstart.clone().add((nttarget - 1) * intv, 'month').getTime(); + this.numberTicks = nttarget; + + for (var i=0; i<nttarget; i++) { + if (i === 0) { + opts.value = mstart.getTime(); + } + else { + opts.value = mstart.add(intv, 'month').getTime(); + } + t = new this.tickRenderer(opts); + + if (this._overrideFormatString && this._autoFormatString != '') { + t.formatString = this._autoFormatString; + } + if (!this.showTicks) { + t.showLabel = false; + t.showMark = false; + } + else if (!this.showTickMarks) { + t.showMark = false; + } + this._ticks.push(t); + } + + insetMult = intv * month; + } + + // use yearly intervals + else { + + this._autoFormatString = '%v'; + + // how many years in an interval? + var intv = Math.round(titarget/year); + if (intv < 1) { + intv = 1; + } + + // figure out the starting and ending years. + var mstart = new $.jsDate(min).setMonth(0, 1).setHours(0,0,0,0); + var mend = new $.jsDate(max).add(1, 'year').setMonth(0, 1).setHours(0,0,0,0); + + var nyears = mend.diff(mstart, 'year'); + + nttarget = Math.ceil(nyears/intv) + 1; + + this.min = mstart.getTime(); + this.max = mstart.clone().add((nttarget - 1) * intv, 'year').getTime(); + this.numberTicks = nttarget; + + for (var i=0; i<nttarget; i++) { + if (i === 0) { + opts.value = mstart.getTime(); + } + else { + opts.value = mstart.add(intv, 'year').getTime(); + } + t = new this.tickRenderer(opts); + + if (this._overrideFormatString && this._autoFormatString != '') { + t.formatString = this._autoFormatString; + } + if (!this.showTicks) { + t.showLabel = false; + t.showMark = false; + } + else if (!this.showTickMarks) { + t.showMark = false; + } + this._ticks.push(t); + } + + insetMult = intv * year; + } + } + + //////// + // Some option(s) specified, work around that. + //////// + + else { + if (name == 'xaxis' || name == 'x2axis') { + dim = this._plotDimensions.width; + } + else { + dim = this._plotDimensions.height; + } + + // if min, max and number of ticks specified, user can't specify interval. + if (this.min != null && this.max != null && this.numberTicks != null) { + this.tickInterval = null; + } + + if (this.tickInterval != null && daTickInterval != null) { + this.daTickInterval = daTickInterval; + } + + // if min and max are same, space them out a bit + if (min == max) { + var adj = 24*60*60*500; // 1/2 day + min -= adj; + max += adj; + } + + range = max - min; + + var optNumTicks = 2 + parseInt(Math.max(0, dim-100)/100, 10); + + + var rmin, rmax; + + rmin = (this.min != null) ? new $.jsDate(this.min).getTime() : min - range/2*(this.padMin - 1); + rmax = (this.max != null) ? new $.jsDate(this.max).getTime() : max + range/2*(this.padMax - 1); + this.min = rmin; + this.max = rmax; + range = this.max - this.min; + + if (this.numberTicks == null){ + // if tickInterval is specified by user, we will ignore computed maximum. + // max will be equal or greater to fit even # of ticks. + if (this.daTickInterval != null) { + var nc = new $.jsDate(this.max).diff(this.min, this.daTickInterval[1], true); + this.numberTicks = Math.ceil(nc/this.daTickInterval[0]) +1; + // this.max = new $.jsDate(this.min).add(this.numberTicks-1, this.daTickInterval[1]).getTime(); + this.max = new $.jsDate(this.min).add((this.numberTicks-1) * this.daTickInterval[0], this.daTickInterval[1]).getTime(); + } + else if (dim > 200) { + this.numberTicks = parseInt(3+(dim-200)/100, 10); + } + else { + this.numberTicks = 2; + } + } + + insetMult = range / (this.numberTicks-1)/1000; + + if (this.daTickInterval == null) { + this.daTickInterval = [insetMult, 'seconds']; + } + + + for (var i=0; i<this.numberTicks; i++){ + var min = new $.jsDate(this.min); + tt = min.add(i*this.daTickInterval[0], this.daTickInterval[1]).getTime(); + var t = new this.tickRenderer(this.tickOptions); + // var t = new $.jqplot.AxisTickRenderer(this.tickOptions); + if (!this.showTicks) { + t.showLabel = false; + t.showMark = false; + } + else if (!this.showTickMarks) { + t.showMark = false; + } + t.setTick(tt, this.name); + this._ticks.push(t); + } + } + + if (this.tickInset) { + this.min = this.min - this.tickInset * insetMult; + this.max = this.max + this.tickInset * insetMult; + } + + if (this._daTickInterval == null) { + this._daTickInterval = this.daTickInterval; + } + + ticks = null; + }; + +})(jQuery); + diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js new file mode 100755 index 0000000..382f8ea --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js @@ -0,0 +1,261 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . +* + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + // class $.jqplot.EnhancedPieLegendRenderer + // Legend renderer which can specify the number of rows and/or columns in the legend + // Similar to EnhancedLegendRenderer, but for pie charts + $.jqplot.EnhancedPieLegendRenderer = function(){ + $.jqplot.TableLegendRenderer.call(this); + }; + + $.jqplot.EnhancedPieLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); + $.jqplot.EnhancedPieLegendRenderer.prototype.constructor = $.jqplot.EnhancedPieLegendRenderer; + + // called with scope of legend. + $.jqplot.EnhancedPieLegendRenderer.prototype.init = function(options) { + // prop: numberRows + // Maximum number of rows in the legend. 0 or null for unlimited. + this.numberRows = null; + // prop: numberColumns + // Maximum number of columns in the legend. 0 or null for unlimited. + this.numberColumns = null; + // prop: seriesToggle + // false to not enable series on/off toggling on the legend. + // true or a fadein/fadeout speed (number of milliseconds or 'fast', 'normal', 'slow') + // to enable show/hide of series on click of legend item. + this.seriesToggle = 'normal'; + // prop: seriesToggleReplot + // True to replot the chart after toggling series on/off. + // This will set the series show property to false. + // This allows for rescaling or other maniplation of chart. + // Set to an options object (e.g. {resetAxes: true}) for replot options. + this.seriesToggleReplot = false; + // prop: disableIEFading + // true to toggle series with a show/hide method only and not allow fading in/out. + // This is to overcome poor performance of fade in some versions of IE. + this.disableIEFading = true; + // prop: toolTips + // optional array of toolTip text corresponding to each pie slice + this.toolTips = []; + $.extend(true, this, options); + + if (this.seriesToggle) { + $.jqplot.postDrawHooks.push(postDraw); + } + }; + + // called with scope of legend + $.jqplot.EnhancedPieLegendRenderer.prototype.draw = function(offsets, plot) { + var legend = this; + if (this.show) { + var series = this._series; + var s; + var ss = 'position:absolute;'; + ss += (this.background) ? 'background:'+this.background+';' : ''; + ss += (this.border) ? 'border:'+this.border+';' : ''; + ss += (this.fontSize) ? 'font-size:'+this.fontSize+';' : ''; + ss += (this.fontFamily) ? 'font-family:'+this.fontFamily+';' : ''; + ss += (this.textColor) ? 'color:'+this.textColor+';' : ''; + ss += (this.marginTop != null) ? 'margin-top:'+this.marginTop+';' : ''; + ss += (this.marginBottom != null) ? 'margin-bottom:'+this.marginBottom+';' : ''; + ss += (this.marginLeft != null) ? 'margin-left:'+this.marginLeft+';' : ''; + ss += (this.marginRight != null) ? 'margin-right:'+this.marginRight+';' : ''; + this._elem = $('<table class="jqplot-table-legend" style="'+ss+'"></table>'); + if (this.seriesToggle) { + this._elem.css('z-index', '3'); + } + + var pad = false, + reverse = false, + nr, nc; + var s = series[0]; + var slen = s.data.length; + var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors); + + if (this.numberRows) { + nr = this.numberRows; + if (!this.numberColumns){ + nc = Math.ceil(slen/nr); + } + else{ + nc = this.numberColumns; + } + } + else if (this.numberColumns) { + nc = this.numberColumns; + nr = Math.ceil(slen/this.numberColumns); + } + else { + nr = slen; + nc = 1; + } + + var i, j, tr, td1, td2, lt, rs, div, div0, div1; + var idx = 0; + // check to see if we need to reverse + for (i=series.length-1; i>=0; i--) { + if (nc == 1 && series[i]._stack || series[i].renderer.constructor == $.jqplot.BezierCurveRenderer){ + reverse = true; + } + } + + for (i=0; i<nr; i++) { + tr = $(document.createElement('tr')); + tr.addClass('jqplot-table-legend'); + if (reverse){ + tr.prependTo(this._elem); + } + else{ + tr.appendTo(this._elem); + } + for (j=0; j<nc; j++) { + if (idx < slen){ + lt = this.labels[idx] || s.data[idx][0].toString(); + tt = this.toolTips[idx]; + if (lt) { + var color = colorGenerator.next(); + if (!reverse){ + if (i>0){ + pad = true; + } + else{ + pad = false; + } + } + else{ + if (i == nr -1){ + pad = false; + } + else{ + pad = true; + } + } + rs = (pad) ? this.rowSpacing : '0'; + + td1 = $(document.createElement('td')); + td1.addClass('jqplot-table-legend jqplot-table-legend-swatch'); + td1.css({textAlign: 'center', paddingTop: rs}); + + div0 = $(document.createElement('div')); + div0.addClass('jqplot-table-legend-swatch-outline'); + if (tt !== undefined) { + div0.attr("title", tt); + } + + div1 = $(document.createElement('div')); + div1.addClass('jqplot-table-legend-swatch'); + div1.css({backgroundColor: color, borderColor: color}); + + td1.append(div0.append(div1)); + + td2 = $(document.createElement('td')); + td2.addClass('jqplot-table-legend jqplot-table-legend-label'); + td2.css('paddingTop', rs); + if (tt !== undefined) { + td2.attr("title", tt); + } + + if (this.escapeHtml){ + td2.text(lt); + } + else { + td2.html(lt); + } + if (reverse) { + if (this.showLabels) {td2.prependTo(tr);} + if (this.showSwatches) {td1.prependTo(tr);} + } + else { + if (this.showSwatches) {td1.appendTo(tr);} + if (this.showLabels) {td2.appendTo(tr);} + } + + if (this.seriesToggle) { + + var speed; + if (typeof(this.seriesToggle) === 'string' || typeof(this.seriesToggle) === 'number') { + if (!$.jqplot.use_excanvas || !this.disableIEFading) { + speed = this.seriesToggle; + } + } + if (this.showSwatches) { + td1.bind('click', {series:s, index:idx, speed:speed, plot: plot, replot:this.seriesToggleReplot}, handleToggle); + td1.addClass('jqplot-seriesToggle'); + } + if (this.showLabels) { + td2.bind('click', {series:s, index:idx, speed:speed, plot: plot, replot:this.seriesToggleReplot}, handleToggle); + td2.addClass('jqplot-seriesToggle'); + } + + // for slices that are already hidden, add the hidden class + if (s.showSlice[idx] === false && s.showLabel) { + td1.addClass('jqplot-series-hidden'); + td2.addClass('jqplot-series-hidden'); + } + } + + pad = true; + } + } + idx++; + } + + td1 = td2 = div0 = div1 = null; + } + } + return this._elem; + }; + + var handleToggle = function (ev) { + var d = ev.data, + replot = d.replot, + plot = d.plot, + idx = d.index; + + d.series.showSlice[idx] = (d.series.showSlice[idx] === false) ? true : false; + + var opts = {}; + + if ($.isPlainObject(replot)) { + $.extend(true, opts, replot); + } + + plot.replot(opts); + }; + + // called with scope of plot. + var postDraw = function () { + if (this.legend.renderer.constructor == $.jqplot.EnhancedPieLegendRenderer && this.legend.seriesToggle) { + var e = this.legend._elem.detach(); + this.eventCanvas._elem.after(e); + } + }; +})(jQuery); diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.highlighter.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.highlighter.js new file mode 100755 index 0000000..df0dd95 --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.highlighter.js @@ -0,0 +1,465 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + $.jqplot.eventListenerHooks.push(['jqplotMouseMove', handleMove]); + + /** + * Class: $.jqplot.Highlighter + * Plugin which will highlight data points when they are moused over. + * + * To use this plugin, include the js + * file in your source: + * + * > <script type="text/javascript" src="plugins/jqplot.highlighter.js"></script> + * + * A tooltip providing information about the data point is enabled by default. + * To disable the tooltip, set "showTooltip" to false. + * + * You can control what data is displayed in the tooltip with various + * options. The "tooltipAxes" option controls whether the x, y or both + * data values are displayed. + * + * Some chart types (e.g. hi-low-close) have more than one y value per + * data point. To display the additional values in the tooltip, set the + * "yvalues" option to the desired number of y values present (3 for a hlc chart). + * + * By default, data values will be formatted with the same formatting + * specifiers as used to format the axis ticks. A custom format code + * can be supplied with the tooltipFormatString option. This will apply + * to all values in the tooltip. + * + * For more complete control, the "formatString" option can be set. This + * Allows conplete control over tooltip formatting. Values are passed to + * the format string in an order determined by the "tooltipAxes" and "yvalues" + * options. So, if you have a hi-low-close chart and you just want to display + * the hi-low-close values in the tooltip, you could set a formatString like: + * + * > highlighter: { + * > tooltipAxes: 'y', + * > yvalues: 3, + * > formatString:'<table class="jqplot-highlighter"> + * > <tr><td>hi:</td><td>%s</td></tr> + * > <tr><td>low:</td><td>%s</td></tr> + * > <tr><td>close:</td><td>%s</td></tr></table>' + * > } + * + */ + $.jqplot.Highlighter = function(options) { + // Group: Properties + // + //prop: show + // true to show the highlight. + this.show = $.jqplot.config.enablePlugins; + // prop: markerRenderer + // Renderer used to draw the marker of the highlighted point. + // Renderer will assimilate attributes from the data point being highlighted, + // so no attributes need set on the renderer directly. + // Default is to turn off shadow drawing on the highlighted point. + this.markerRenderer = new $.jqplot.MarkerRenderer({shadow:false}); + // prop: showMarker + // true to show the marker + this.showMarker = true; + // prop: lineWidthAdjust + // Pixels to add to the lineWidth of the highlight. + this.lineWidthAdjust = 2.5; + // prop: sizeAdjust + // Pixels to add to the overall size of the highlight. + this.sizeAdjust = 5; + // prop: showTooltip + // Show a tooltip with data point values. + this.showTooltip = true; + // prop: tooltipLocation + // Where to position tooltip, 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw' + this.tooltipLocation = 'nw'; + // prop: fadeTooltip + // true = fade in/out tooltip, flase = show/hide tooltip + this.fadeTooltip = true; + // prop: tooltipFadeSpeed + // 'slow', 'def', 'fast', or number of milliseconds. + this.tooltipFadeSpeed = "fast"; + // prop: tooltipOffset + // Pixel offset of tooltip from the highlight. + this.tooltipOffset = 2; + // prop: tooltipAxes + // Which axes to display in tooltip, 'x', 'y' or 'both', 'xy' or 'yx' + // 'both' and 'xy' are equivalent, 'yx' reverses order of labels. + this.tooltipAxes = 'both'; + // prop; tooltipSeparator + // String to use to separate x and y axes in tooltip. + this.tooltipSeparator = ', '; + // prop; tooltipContentEditor + // Function used to edit/augment/replace the formatted tooltip contents. + // Called as str = tooltipContentEditor(str, seriesIndex, pointIndex) + // where str is the generated tooltip html and seriesIndex and pointIndex identify + // the data point being highlighted. Should return the html for the tooltip contents. + this.tooltipContentEditor = null; + // prop: useAxesFormatters + // Use the x and y axes formatters to format the text in the tooltip. + this.useAxesFormatters = true; + // prop: tooltipFormatString + // sprintf format string for the tooltip. + // Uses Ash Searle's javascript sprintf implementation + // found here: http://hexmen.com/blog/2007/03/printf-sprintf/ + // See http://perldoc.perl.org/functions/sprintf.html for reference. + // Additional "p" and "P" format specifiers added by Chris Leonello. + this.tooltipFormatString = '%.5P'; + // prop: formatString + // alternative to tooltipFormatString + // will format the whole tooltip text, populating with x, y values as + // indicated by tooltipAxes option. So, you could have a tooltip like: + // 'Date: %s, number of cats: %d' to format the whole tooltip at one go. + // If useAxesFormatters is true, values will be formatted according to + // Axes formatters and you can populate your tooltip string with + // %s placeholders. + this.formatString = null; + // prop: yvalues + // Number of y values to expect in the data point array. + // Typically this is 1. Certain plots, like OHLC, will + // have more y values in each data point array. + this.yvalues = 1; + // prop: bringSeriesToFront + // This option requires jQuery 1.4+ + // True to bring the series of the highlighted point to the front + // of other series. + this.bringSeriesToFront = false; + this._tooltipElem; + this.isHighlighting = false; + this.currentNeighbor = null; + + $.extend(true, this, options); + }; + + var locations = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w']; + var locationIndicies = {'nw':0, 'n':1, 'ne':2, 'e':3, 'se':4, 's':5, 'sw':6, 'w':7}; + var oppositeLocations = ['se', 's', 'sw', 'w', 'nw', 'n', 'ne', 'e']; + + // axis.renderer.tickrenderer.formatter + + // called with scope of plot + $.jqplot.Highlighter.init = function (target, data, opts){ + var options = opts || {}; + // add a highlighter attribute to the plot + this.plugins.highlighter = new $.jqplot.Highlighter(options.highlighter); + }; + + // called within scope of series + $.jqplot.Highlighter.parseOptions = function (defaults, options) { + // Add a showHighlight option to the series + // and set it to true by default. + this.showHighlight = true; + }; + + // called within context of plot + // create a canvas which we can draw on. + // insert it before the eventCanvas, so eventCanvas will still capture events. + $.jqplot.Highlighter.postPlotDraw = function() { + // Memory Leaks patch + if (this.plugins.highlighter && this.plugins.highlighter.highlightCanvas) { + this.plugins.highlighter.highlightCanvas.resetCanvas(); + this.plugins.highlighter.highlightCanvas = null; + } + + if (this.plugins.highlighter && this.plugins.highlighter._tooltipElem) { + this.plugins.highlighter._tooltipElem.emptyForce(); + this.plugins.highlighter._tooltipElem = null; + } + + this.plugins.highlighter.highlightCanvas = new $.jqplot.GenericCanvas(); + + this.eventCanvas._elem.before(this.plugins.highlighter.highlightCanvas.createElement(this._gridPadding, 'jqplot-highlight-canvas', this._plotDimensions, this)); + this.plugins.highlighter.highlightCanvas.setContext(); + + var elem = document.createElement('div'); + this.plugins.highlighter._tooltipElem = $(elem); + elem = null; + this.plugins.highlighter._tooltipElem.addClass('jqplot-highlighter-tooltip'); + this.plugins.highlighter._tooltipElem.css({position:'absolute', display:'none'}); + + this.eventCanvas._elem.before(this.plugins.highlighter._tooltipElem); + }; + + $.jqplot.preInitHooks.push($.jqplot.Highlighter.init); + $.jqplot.preParseSeriesOptionsHooks.push($.jqplot.Highlighter.parseOptions); + $.jqplot.postDrawHooks.push($.jqplot.Highlighter.postPlotDraw); + + function draw(plot, neighbor) { + var hl = plot.plugins.highlighter; + var s = plot.series[neighbor.seriesIndex]; + var smr = s.markerRenderer; + var mr = hl.markerRenderer; + mr.style = smr.style; + mr.lineWidth = smr.lineWidth + hl.lineWidthAdjust; + mr.size = smr.size + hl.sizeAdjust; + var rgba = $.jqplot.getColorComponents(smr.color); + var newrgb = [rgba[0], rgba[1], rgba[2]]; + var alpha = (rgba[3] >= 0.6) ? rgba[3]*0.6 : rgba[3]*(2-rgba[3]); + mr.color = 'rgba('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+','+alpha+')'; + mr.init(); + mr.draw(s.gridData[neighbor.pointIndex][0], s.gridData[neighbor.pointIndex][1], hl.highlightCanvas._ctx); + } + + function showTooltip(plot, series, neighbor) { + // neighbor looks like: {seriesIndex: i, pointIndex:j, gridData:p, data:s.data[j]} + // gridData should be x,y pixel coords on the grid. + // add the plot._gridPadding to that to get x,y in the target. + var hl = plot.plugins.highlighter; + var elem = hl._tooltipElem; + var serieshl = series.highlighter || {}; + + var opts = $.extend(true, {}, hl, serieshl); + + if (opts.useAxesFormatters) { + var xf = series._xaxis._ticks[0].formatter; + var yf = series._yaxis._ticks[0].formatter; + var xfstr = series._xaxis._ticks[0].formatString; + var yfstr = series._yaxis._ticks[0].formatString; + var str; + var xstr = xf(xfstr, neighbor.data[0]); + var ystrs = []; + for (var i=1; i<opts.yvalues+1; i++) { + ystrs.push(yf(yfstr, neighbor.data[i])); + } + if (typeof opts.formatString === 'string') { + switch (opts.tooltipAxes) { + case 'both': + case 'xy': + ystrs.unshift(xstr); + ystrs.unshift(opts.formatString); + str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs); + break; + case 'yx': + ystrs.push(xstr); + ystrs.unshift(opts.formatString); + str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs); + break; + case 'x': + str = $.jqplot.sprintf.apply($.jqplot.sprintf, [opts.formatString, xstr]); + break; + case 'y': + ystrs.unshift(opts.formatString); + str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs); + break; + default: // same as xy + ystrs.unshift(xstr); + ystrs.unshift(opts.formatString); + str = $.jqplot.sprintf.apply($.jqplot.sprintf, ystrs); + break; + } + } + else { + switch (opts.tooltipAxes) { + case 'both': + case 'xy': + str = xstr; + for (var i=0; i<ystrs.length; i++) { + str += opts.tooltipSeparator + ystrs[i]; + } + break; + case 'yx': + str = ''; + for (var i=0; i<ystrs.length; i++) { + str += ystrs[i] + opts.tooltipSeparator; + } + str += xstr; + break; + case 'x': + str = xstr; + break; + case 'y': + str = ystrs.join(opts.tooltipSeparator); + break; + default: // same as 'xy' + str = xstr; + for (var i=0; i<ystrs.length; i++) { + str += opts.tooltipSeparator + ystrs[i]; + } + break; + + } + } + } + else { + var str; + if (typeof opts.formatString === 'string') { + str = $.jqplot.sprintf.apply($.jqplot.sprintf, [opts.formatString].concat(neighbor.data)); + } + + else { + if (opts.tooltipAxes == 'both' || opts.tooltipAxes == 'xy') { + str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]) + opts.tooltipSeparator + $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]); + } + else if (opts.tooltipAxes == 'yx') { + str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]) + opts.tooltipSeparator + $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]); + } + else if (opts.tooltipAxes == 'x') { + str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[0]); + } + else if (opts.tooltipAxes == 'y') { + str = $.jqplot.sprintf(opts.tooltipFormatString, neighbor.data[1]); + } + } + } + if ($.isFunction(opts.tooltipContentEditor)) { + // args str, seriesIndex, pointIndex are essential so the hook can look up + // extra data for the point. + str = opts.tooltipContentEditor(str, neighbor.seriesIndex, neighbor.pointIndex, plot); + } + elem.html(str); + var gridpos = {x:neighbor.gridData[0], y:neighbor.gridData[1]}; + var ms = 0; + var fact = 0.707; + if (series.markerRenderer.show == true) { + ms = (series.markerRenderer.size + opts.sizeAdjust)/2; + } + + var loc = locations; + if (series.fillToZero && series.fill && neighbor.data[1] < 0) { + loc = oppositeLocations; + } + + switch (loc[locationIndicies[opts.tooltipLocation]]) { + case 'nw': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms; + var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms; + break; + case 'n': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2; + var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - ms; + break; + case 'ne': + var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + fact * ms; + var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms; + break; + case 'e': + var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + ms; + var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2; + break; + case 'se': + var x = gridpos.x + plot._gridPadding.left + opts.tooltipOffset + fact * ms; + var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + fact * ms; + break; + case 's': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true)/2; + var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + ms; + break; + case 'sw': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms; + var y = gridpos.y + plot._gridPadding.top + opts.tooltipOffset + fact * ms; + break; + case 'w': + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - ms; + var y = gridpos.y + plot._gridPadding.top - elem.outerHeight(true)/2; + break; + default: // same as 'nw' + var x = gridpos.x + plot._gridPadding.left - elem.outerWidth(true) - opts.tooltipOffset - fact * ms; + var y = gridpos.y + plot._gridPadding.top - opts.tooltipOffset - elem.outerHeight(true) - fact * ms; + break; + } + elem.css('left', x); + elem.css('top', y); + if (opts.fadeTooltip) { + // Fix for stacked up animations. Thnanks Trevor! + elem.stop(true,true).fadeIn(opts.tooltipFadeSpeed); + } + else { + elem.show(); + } + elem = null; + + } + + function handleMove(ev, gridpos, datapos, neighbor, plot) { + var hl = plot.plugins.highlighter; + var c = plot.plugins.cursor; + if (hl.show) { + if (neighbor == null && hl.isHighlighting) { + var evt = jQuery.Event('jqplotHighlighterUnhighlight'); + plot.target.trigger(evt); + + var ctx = hl.highlightCanvas._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + if (hl.fadeTooltip) { + hl._tooltipElem.fadeOut(hl.tooltipFadeSpeed); + } + else { + hl._tooltipElem.hide(); + } + if (hl.bringSeriesToFront) { + plot.restorePreviousSeriesOrder(); + } + hl.isHighlighting = false; + hl.currentNeighbor = null; + ctx = null; + } + else if (neighbor != null && plot.series[neighbor.seriesIndex].showHighlight && !hl.isHighlighting) { + var evt = jQuery.Event('jqplotHighlighterHighlight'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data, plot]; + plot.target.trigger(evt, ins); + + hl.isHighlighting = true; + hl.currentNeighbor = neighbor; + if (hl.showMarker) { + draw(plot, neighbor); + } + if (plot.series[neighbor.seriesIndex].show && hl.showTooltip && (!c || !c._zoom.started)) { + showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor); + } + if (hl.bringSeriesToFront) { + plot.moveSeriesToFront(neighbor.seriesIndex); + } + } + // check to see if we're highlighting the wrong point. + else if (neighbor != null && hl.isHighlighting && hl.currentNeighbor != neighbor) { + // highlighting the wrong point. + + // if new series allows highlighting, highlight new point. + if (plot.series[neighbor.seriesIndex].showHighlight) { + var ctx = hl.highlightCanvas._ctx; + ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height); + hl.isHighlighting = true; + hl.currentNeighbor = neighbor; + if (hl.showMarker) { + draw(plot, neighbor); + } + if (plot.series[neighbor.seriesIndex].show && hl.showTooltip && (!c || !c._zoom.started)) { + showTooltip(plot, plot.series[neighbor.seriesIndex], neighbor); + } + if (hl.bringSeriesToFront) { + plot.moveSeriesToFront(neighbor.seriesIndex); + } + } + } + } + } +})(jQuery); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.pieRenderer.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.pieRenderer.js new file mode 100755 index 0000000..46d7301 --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.pieRenderer.js @@ -0,0 +1,964 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + /** + * Class: $.jqplot.PieRenderer + * Plugin renderer to draw a pie chart. + * x values, if present, will be used as slice labels. + * y values give slice size. + * + * To use this renderer, you need to include the + * pie renderer plugin, for example: + * + * > <script type="text/javascript" src="plugins/jqplot.pieRenderer.js"></script> + * + * Properties described here are passed into the $.jqplot function + * as options on the series renderer. For example: + * + * > plot2 = $.jqplot('chart2', [s1, s2], { + * > seriesDefaults: { + * > renderer:$.jqplot.PieRenderer, + * > rendererOptions:{ + * > sliceMargin: 2, + * > startAngle: -90 + * > } + * > } + * > }); + * + * A pie plot will trigger events on the plot target + * according to user interaction. All events return the event object, + * the series index, the point (slice) index, and the point data for + * the appropriate slice. + * + * 'jqplotDataMouseOver' - triggered when user mouseing over a slice. + * 'jqplotDataHighlight' - triggered the first time user mouses over a slice, + * if highlighting is enabled. + * 'jqplotDataUnhighlight' - triggered when a user moves the mouse out of + * a highlighted slice. + * 'jqplotLegendHighlight' - triggered the first time user mouses over a legend, + * if highlighting is enabled. + * 'jqplotLegendUnhighlight' - triggered when a user moves the mouse out of + * a highlighted legend. + * 'jqplotDataClick' - triggered when the user clicks on a slice. + * 'jqplotDataRightClick' - tiggered when the user right clicks on a slice if + * the "captureRightClick" option is set to true on the plot. + */ + $.jqplot.PieRenderer = function(){ + $.jqplot.LineRenderer.call(this); + }; + + $.jqplot.PieRenderer.prototype = new $.jqplot.LineRenderer(); + $.jqplot.PieRenderer.prototype.constructor = $.jqplot.PieRenderer; + + // called with scope of a series + $.jqplot.PieRenderer.prototype.init = function(options, plot) { + // Group: Properties + // + // prop: diameter + // Outer diameter of the pie, auto computed by default + this.diameter = null; + // prop: padding + // padding between the pie and plot edges, legend, etc. + this.padding = 20; + // prop: sliceMargin + // angular spacing between pie slices in degrees. + this.sliceMargin = 0; + // prop: fill + // true or false, whether to fil the slices. + this.fill = true; + // prop: shadowOffset + // offset of the shadow from the slice and offset of + // each succesive stroke of the shadow from the last. + this.shadowOffset = 2; + // prop: shadowAlpha + // transparency of the shadow (0 = transparent, 1 = opaque) + this.shadowAlpha = 0.07; + // prop: shadowDepth + // number of strokes to apply to the shadow, + // each stroke offset shadowOffset from the last. + this.shadowDepth = 5; + // prop: highlightMouseOver + // True to highlight slice when moused over. + // This must be false to enable highlightMouseDown to highlight when clicking on a slice. + this.highlightMouseOver = true; + // prop: highlightMouseDown + // True to highlight when a mouse button is pressed over a slice. + // This will be disabled if highlightMouseOver is true. + this.highlightMouseDown = false; + // prop: highlightColors + // an array of colors to use when highlighting a slice. + this.highlightColors = []; + // prop: dataLabels + // Either 'label', 'value', 'percent' or an array of labels to place on the pie slices. + // Defaults to percentage of each pie slice. + this.dataLabels = 'percent'; + // prop: showDataLabels + // true to show data labels on slices. + this.showDataLabels = false; + // prop: dataLabelFormatString + // Format string for data labels. If none, '%s' is used for "label" and for arrays, '%d' for value and '%d%%' for percentage. + this.dataLabelFormatString = null; + // prop: dataLabelThreshold + // Threshhold in percentage (0-100) of pie area, below which no label will be displayed. + // This applies to all label types, not just to percentage labels. + this.dataLabelThreshold = 2.5; + // prop: dataLabelPositionFactor + // A Multiplier (0-1) of the pie radius which controls position of label on slice. + // Increasing will slide label toward edge of pie, decreasing will slide label toward center of pie. + this.dataLabelPositionFactor = 0.52; + // prop: dataLabelNudge + // Number of pixels to slide the label away from (+) or toward (-) the center of the pie. + this.dataLabelNudge = 2; + // prop: dataLabelCenterOn + // True to center the data label at its position. + // False to set the inside facing edge of the label at its position. + this.dataLabelCenterOn = true; + // prop: startAngle + // Angle to start drawing pie in degrees. + // According to orientation of canvas coordinate system: + // 0 = on the positive x axis + // -90 = on the positive y axis. + // 90 = on the negaive y axis. + // 180 or - 180 = on the negative x axis. + this.startAngle = 0; + this.tickRenderer = $.jqplot.PieTickRenderer; + // prop: showSlice + // Array for whether the pie chart slice for a data element should be displayed. + // Containsg true or false for each data element. If not specified, defaults to true. + this.showSlice = []; + // Used as check for conditions where pie shouldn't be drawn. + this._drawData = true; + this._type = 'pie'; + + // if user has passed in highlightMouseDown option and not set highlightMouseOver, disable highlightMouseOver + if (options.highlightMouseDown && options.highlightMouseOver == null) { + options.highlightMouseOver = false; + } + + $.extend(true, this, options); + + if (this.sliceMargin < 0) { + this.sliceMargin = 0; + } + + this._diameter = null; + this._radius = null; + // array of [start,end] angles arrays, one for each slice. In radians. + this._sliceAngles = []; + // index of the currenty highlighted point, if any + this._highlightedPoint = null; + + // set highlight colors if none provided + if (this.highlightColors.length == 0) { + for (var i=0; i<this.seriesColors.length; i++){ + var rgba = $.jqplot.getColorComponents(this.seriesColors[i]); + var newrgb = [rgba[0], rgba[1], rgba[2]]; + var sum = newrgb[0] + newrgb[1] + newrgb[2]; + for (var j=0; j<3; j++) { + // when darkening, lowest color component can be is 60. + newrgb[j] = (sum > 570) ? newrgb[j] * 0.8 : newrgb[j] + 0.3 * (255 - newrgb[j]); + newrgb[j] = parseInt(newrgb[j], 10); + } + this.highlightColors.push('rgb('+newrgb[0]+','+newrgb[1]+','+newrgb[2]+')'); + } + } + + this.highlightColorGenerator = new $.jqplot.ColorGenerator(this.highlightColors); + + plot.postParseOptionsHooks.addOnce(postParseOptions); + plot.postInitHooks.addOnce(postInit); + plot.eventListenerHooks.addOnce('jqplotMouseMove', handleMove); + plot.eventListenerHooks.addOnce('jqplotMouseDown', handleMouseDown); + plot.eventListenerHooks.addOnce('jqplotMouseUp', handleMouseUp); + plot.eventListenerHooks.addOnce('jqplotClick', handleClick); + plot.eventListenerHooks.addOnce('jqplotRightClick', handleRightClick); + plot.postDrawHooks.addOnce(postPlotDraw); + }; + + $.jqplot.PieRenderer.prototype.setGridData = function(plot) { + // set gridData property. This will hold angle in radians of each data point. + var stack = []; + var td = []; + var sa = this.startAngle/180*Math.PI; + var tot = 0; + // don't know if we have any valid data yet, so set plot to not draw. + this._drawData = false; + for (var i=0; i<this.data.length; i++){ + if (this.data[i][1] != 0) { + // we have data, O.K. to draw. + this._drawData = true; + if (this.showSlice[i] === undefined) { + this.showSlice[i] = true; + } + } + stack.push(this.data[i][1]); + td.push([this.data[i][0]]); + if (i>0) { + stack[i] += stack[i-1]; + } + tot += this.data[i][1]; + } + var fact = Math.PI*2/stack[stack.length - 1]; + + for (var i=0; i<stack.length; i++) { + td[i][1] = stack[i] * fact; + td[i][2] = this.data[i][1]/tot; + } + this.gridData = td; + }; + + $.jqplot.PieRenderer.prototype.makeGridData = function(data, plot) { + + var hdt = document.getElementsByClassName("jqplot-table-legend-label jqplot-seriesToggle jqplot-series-hidden"); + + var ndt = this.data.map(function(arr) { + return arr.slice(); + }); + + if (hdt[0] != null) { + for(i=0;i<hdt.length;i++){ + for(j=0;j<ndt.length;j++){ + if(hdt[i].innerText == ndt[j][0]){ + ndt[j][1] = 0; + } + } + } + } + + var stack = []; + var td = []; + var tot = 0; + var sa = this.startAngle/180*Math.PI; + // don't know if we have any valid data yet, so set plot to not draw. + this._drawData = false; + for (var i=0; i<data.length; i++){ + if (this.data[i][1] != 0) { + // we have data, O.K. to draw. + this._drawData = true; + } + stack.push(ndt[i][1]); + td.push([ndt[i][0]]); + if (i>0) { + stack[i] += stack[i-1]; + } + tot += ndt[i][1]; + } + var fact = Math.PI*2/stack[stack.length - 1]; + + for (var i=0; i<stack.length; i++) { + td[i][1] = stack[i] * fact; + td[i][2] = ndt[i][1]/tot; + } + + return td; + }; + + function calcRadiusAdjustment(ang) { + return Math.sin((ang - (ang-Math.PI) / 8 / Math.PI )/2.0); + } + + function calcRPrime(ang1, ang2, sliceMargin, fill, lineWidth) { + var rprime = 0; + var ang = ang2 - ang1; + var absang = Math.abs(ang); + var sm = sliceMargin; + if (fill == false) { + sm += lineWidth; + } + + if (sm > 0 && absang > 0.01 && absang < 6.282) { + rprime = parseFloat(sm) / 2.0 / calcRadiusAdjustment(ang); + } + + return rprime; + } + + $.jqplot.PieRenderer.prototype.drawSlice = function (ctx, ang1, ang2, color, isShadow) { + if (this._drawData) { + var r = this._radius; + var fill = this.fill; + var lineWidth = this.lineWidth; + var sm = this.sliceMargin; + if (this.fill == false) { + sm += this.lineWidth; + } + ctx.save(); + ctx.translate(this._center[0], this._center[1]); + + var rprime = calcRPrime(ang1, ang2, this.sliceMargin, this.fill, this.lineWidth); + + var transx = rprime * Math.cos((ang1 + ang2) / 2.0); + var transy = rprime * Math.sin((ang1 + ang2) / 2.0); + + if ((ang2 - ang1) <= Math.PI) { + r -= rprime; + } + else { + r += rprime; + } + + ctx.translate(transx, transy); + + if (isShadow) { + for (var i=0, l=this.shadowDepth; i<l; i++) { + ctx.save(); + ctx.translate(this.shadowOffset*Math.cos(this.shadowAngle/180*Math.PI), this.shadowOffset*Math.sin(this.shadowAngle/180*Math.PI)); + doDraw(r); + } + for (var i=0, l=this.shadowDepth; i<l; i++) { + ctx.restore(); + } + } + + else { + doDraw(r); + } + ctx.restore(); + } + + function doDraw (rad) { + // Fix for IE and Chrome that can't seem to draw circles correctly. + // ang2 should always be <= 2 pi since that is the way the data is converted. + // 2Pi = 6.2831853, Pi = 3.1415927 + if (ang2 > 6.282 + this.startAngle) { + ang2 = 6.282 + this.startAngle; + if (ang1 > ang2) { + ang1 = 6.281 + this.startAngle; + } + } + // Fix for IE, where it can't seem to handle 0 degree angles. Also avoids + // ugly line on unfilled pies. + if (ang1 >= ang2) { + return; + } + + ctx.beginPath(); + ctx.fillStyle = color; + ctx.strokeStyle = color; + ctx.lineWidth = lineWidth; + ctx.arc(0, 0, rad, ang1, ang2, false); + ctx.lineTo(0,0); + ctx.closePath(); + + if (fill) { + ctx.fill(); + } + else { + ctx.stroke(); + } + } + }; + + // called with scope of series + $.jqplot.PieRenderer.prototype.draw = function (ctx, gd, options, plot) { + var i; + var opts = (options != undefined) ? options : {}; + // offset and direction of offset due to legend placement + var offx = 0; + var offy = 0; + var trans = 1; + var colorGenerator = new $.jqplot.ColorGenerator(this.seriesColors); + var sliceColor; + + if (options.legendInfo && options.legendInfo.placement == 'insideGrid') { + var li = options.legendInfo; + switch (li.location) { + case 'nw': + offx = li.width + li.xoffset; + break; + case 'w': + offx = li.width + li.xoffset; + break; + case 'sw': + offx = li.width + li.xoffset; + break; + case 'ne': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'e': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'se': + offx = li.width + li.xoffset; + trans = -1; + break; + case 'n': + offy = li.height + li.yoffset; + break; + case 's': + offy = li.height + li.yoffset; + trans = -1; + break; + default: + break; + } + } + + var shadow = (opts.shadow != undefined) ? opts.shadow : this.shadow; + var fill = (opts.fill != undefined) ? opts.fill : this.fill; + + //see http://stackoverflow.com/questions/20221461/hidpi-retina-plot-drawing + var cw = parseInt(ctx.canvas.style.width); + var ch = parseInt(ctx.canvas.style.height); + // + + var w = cw - offx - 2 * this.padding; + var h = ch - offy - 2 * this.padding; + var mindim = Math.min(w,h); + var d = mindim; + + // Fixes issue #272. Thanks hugwijst! + // reset slice angles array. + this._sliceAngles = []; + + var sm = this.sliceMargin; + if (this.fill == false) { + sm += this.lineWidth; + } + + var rprime; + var maxrprime = 0; + + var ang, ang1, ang2, shadowColor; + var sa = this.startAngle / 180 * Math.PI; + + // have to pre-draw shadows, so loop throgh here and calculate some values also. + for (var i=0, l=gd.length; i<l; i++) { + ang1 = (i == 0) ? sa : gd[i-1][1] + sa; + ang2 = gd[i][1] + sa; + + this._sliceAngles.push([ang1, ang2]); + + rprime = calcRPrime(ang1, ang2, this.sliceMargin, this.fill, this.lineWidth); + + if (Math.abs(ang2-ang1) > Math.PI) { + maxrprime = Math.max(rprime, maxrprime); + } + } + + if (this.diameter != null && this.diameter > 0) { + this._diameter = this.diameter - 2*maxrprime; + } + else { + this._diameter = d - 2*maxrprime; + } + + // Need to check for undersized pie. This can happen if + // plot area too small and legend is too big. + if (this._diameter < 6) { + $.jqplot.log('Diameter of pie too small, not rendering.'); + return; + } + + var r = this._radius = this._diameter/2; + + this._center = [(cw - trans * offx)/2 + trans * offx + maxrprime * Math.cos(sa), (ch - trans*offy)/2 + trans * offy + maxrprime * Math.sin(sa)]; + + if (this.shadow) { + for (var i=0, l=gd.length; i<l; i++) { + shadowColor = 'rgba(0,0,0,'+this.shadowAlpha+')'; + this.renderer.drawSlice.call (this, ctx, this._sliceAngles[i][0], this._sliceAngles[i][1], shadowColor, true); + } + } + + for (var i=0; i<gd.length; i++) { + + sliceColor = colorGenerator.next(); + + if (this.showSlice[i]) { + this.renderer.drawSlice.call (this, ctx, this._sliceAngles[i][0], this._sliceAngles[i][1], sliceColor, false); + + if (this.showDataLabels && gd[i][2]*100 >= this.dataLabelThreshold) { + var fstr, avgang = (this._sliceAngles[i][0] + this._sliceAngles[i][1])/2, label; + + if (this.dataLabels == 'label') { + fstr = this.dataLabelFormatString || '%s'; + label = $.jqplot.sprintf(fstr, gd[i][0]); + } + else if (this.dataLabels == 'value') { + fstr = this.dataLabelFormatString || '%d'; + label = $.jqplot.sprintf(fstr, this.data[i][1]); + } + else if (this.dataLabels == 'percent') { + fstr = this.dataLabelFormatString || '%d%%'; + label = $.jqplot.sprintf(fstr, gd[i][2]*100); + } + else if (this.dataLabels.constructor == Array) { + fstr = this.dataLabelFormatString || '%s'; + label = $.jqplot.sprintf(fstr, this.dataLabels[i]); + } + + var fact = (this._radius ) * this.dataLabelPositionFactor + this.sliceMargin + this.dataLabelNudge; + + var x = this._center[0] + Math.cos(avgang) * fact + this.canvas._offsets.left; + var y = this._center[1] + Math.sin(avgang) * fact + this.canvas._offsets.top; + + var labelelem = $('<div class="jqplot-pie-series jqplot-data-label" style="position:absolute;">' + label + '</div>').insertBefore(plot.eventCanvas._elem); + if (this.dataLabelCenterOn) { + x -= labelelem.width()/2; + y -= labelelem.height()/2; + } + else { + x -= labelelem.width() * Math.sin(avgang/2); + y -= labelelem.height()/2; + } + x = Math.round(x); + y = Math.round(y); + labelelem.css({left: x, top: y}); + } + } + } + }; + + $.jqplot.PieAxisRenderer = function() { + $.jqplot.LinearAxisRenderer.call(this); + }; + + $.jqplot.PieAxisRenderer.prototype = new $.jqplot.LinearAxisRenderer(); + $.jqplot.PieAxisRenderer.prototype.constructor = $.jqplot.PieAxisRenderer; + + + // There are no traditional axes on a pie chart. We just need to provide + // dummy objects with properties so the plot will render. + // called with scope of axis object. + $.jqplot.PieAxisRenderer.prototype.init = function(options){ + // + this.tickRenderer = $.jqplot.PieTickRenderer; + $.extend(true, this, options); + // I don't think I'm going to need _dataBounds here. + // have to go Axis scaling in a way to fit chart onto plot area + // and provide u2p and p2u functionality for mouse cursor, etc. + // for convienence set _dataBounds to 0 and 100 and + // set min/max to 0 and 100. + this._dataBounds = {min:0, max:100}; + this.min = 0; + this.max = 100; + this.showTicks = false; + this.ticks = []; + this.showMark = false; + this.show = false; + }; + + + + + $.jqplot.PieLegendRenderer = function(){ + $.jqplot.TableLegendRenderer.call(this); + }; + + $.jqplot.PieLegendRenderer.prototype = new $.jqplot.TableLegendRenderer(); + $.jqplot.PieLegendRenderer.prototype.constructor = $.jqplot.PieLegendRenderer; + + /** + * Class: $.jqplot.PieLegendRenderer + * Legend Renderer specific to pie plots. Set by default + * when user creates a pie plot. + */ + $.jqplot.PieLegendRenderer.prototype.init = function(options) { + // Group: Properties + // + // prop: numberRows + // Maximum number of rows in the legend. 0 or null for unlimited. + this.numberRows = null; + // prop: numberColumns + // Maximum number of columns in the legend. 0 or null for unlimited. + this.numberColumns = null; + // prop: width + // Fixed with of legend. 0 or null for auto size + this.width = null; + $.extend(true, this, options); + }; + + // called with context of legend + $.jqplot.PieLegendRenderer.prototype.draw = function() { + var legend = this; + if (this.show) { + var series = this._series; + + + this._elem = $(document.createElement('table')); + this._elem.addClass('jqplot-table-legend'); + + var ss = {position:'absolute'}; + if (this.background) { + ss['background'] = this.background; + } + if (this.border) { + ss['border'] = this.border; + } + if (this.fontSize) { + ss['fontSize'] = this.fontSize; + } + if (this.fontFamily) { + ss['fontFamily'] = this.fontFamily; + } + if (this.textColor) { + ss['textColor'] = this.textColor; + } + if (this.marginTop != null) { + ss['marginTop'] = this.marginTop; + } + if (this.marginBottom != null) { + ss['marginBottom'] = this.marginBottom; + } + if (this.marginLeft != null) { + ss['marginLeft'] = this.marginLeft; + } + if (this.marginRight != null) { + ss['marginRight'] = this.marginRight; + } + + this._elem.css(ss); + + // Pie charts legends don't go by number of series, but by number of data points + // in the series. Refactor things here for that. + + var pad = false, + reverse = false, + nr, + nc; + var s = series[0]; + var colorGenerator = new $.jqplot.ColorGenerator(s.seriesColors); + + if (s.show) { + var pd = s.data; + if (this.numberRows) { + nr = this.numberRows; + if (!this.numberColumns){ + nc = Math.ceil(pd.length/nr); + } + else{ + nc = this.numberColumns; + } + } + else if (this.numberColumns) { + nc = this.numberColumns; + nr = Math.ceil(pd.length/this.numberColumns); + } + else { + nr = pd.length; + nc = 1; + } + + var i, j; + var tr, td1, td2; + var lt, tt, rs, color; + var idx = 0; + var div0, div1; + + for (i=0; i<nr; i++) { + tr = $(document.createElement('tr')); + tr.addClass('jqplot-table-legend'); + + if (reverse){ + tr.prependTo(this._elem); + } + + else{ + tr.appendTo(this._elem); + } + + for (j=0; j<nc; j++) { + if (idx < pd.length) { + tt = ''; + if (this.labels[idx]) { + lt = this.labels[idx]; + } + else { + if (typeof pd[idx][0] === 'object') { + lt = pd[idx][0][0].toString(); + tt = pd[idx][0][1].toString(); + } + else { + lt = pd[idx][0].toString(); + } + } + //lt = this.labels[idx] || pd[idx][0].toString(); + color = colorGenerator.next(); + if (!reverse){ + if (i>0){ + pad = true; + } + else{ + pad = false; + } + } + else{ + if (i == nr -1){ + pad = false; + } + else{ + pad = true; + } + } + rs = (pad) ? this.rowSpacing : '0'; + + + + td1 = $(document.createElement('td')); + td1.addClass('jqplot-table-legend jqplot-table-legend-swatch'); + td1.css({textAlign: 'center', paddingTop: rs}); + + div0 = $(document.createElement('div')); + div0.addClass('jqplot-table-legend-swatch-outline'); + if (tt !== '') { + div0.attr("title", tt); + } + div1 = $(document.createElement('div')); + div1.addClass('jqplot-table-legend-swatch'); + div1.css({backgroundColor: color, borderColor: color}); + td1.append(div0.append(div1)); + + td2 = $(document.createElement('td')); + td2.addClass('jqplot-table-legend jqplot-table-legend-label'); + td2.css('paddingTop', rs); + + if (this.escapeHtml){ + td2.text(lt); + } + else { + td2.html('<a title="' + tt + '">' + lt + "</a>"); + } + if (reverse) { + td2.prependTo(tr); + td1.prependTo(tr); + } + else { + td1.appendTo(tr); + td2.appendTo(tr); + } + pad = true; + } + idx++; + } + } + } + } + return this._elem; + }; + + $.jqplot.PieRenderer.prototype.handleMove = function(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + plot.target.trigger('jqplotDataMouseOver', ins); + if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) { + plot.target.trigger('jqplotDataHighlight', ins); + highlight (plot, ins[0], ins[1]); + } + } + else if (neighbor == null) { + unhighlight (plot); + } + }; + + + // this.eventCanvas._elem.bind($.jqplot.eventListenerHooks[i][0], {plot:this}, $.jqplot.eventListenerHooks[i][1]); + + // setup default renderers for axes and legend so user doesn't have to + // called with scope of plot + function preInit(target, data, options) { + options = options || {}; + options.axesDefaults = options.axesDefaults || {}; + options.legend = options.legend || {}; + options.seriesDefaults = options.seriesDefaults || {}; + // only set these if there is a pie series + var setopts = false; + if (options.seriesDefaults.renderer == $.jqplot.PieRenderer) { + setopts = true; + } + else if (options.series) { + for (var i=0; i < options.series.length; i++) { + if (options.series[i].renderer == $.jqplot.PieRenderer) { + setopts = true; + } + } + } + + if (setopts) { + options.axesDefaults.renderer = $.jqplot.PieAxisRenderer; + options.legend.renderer = options.legend.renderer || $.jqplot.PieLegendRenderer; + options.legend.preDraw = true; + options.seriesDefaults.pointLabels = {show: false}; + } + } + + function postInit(target, data, options) { + for (var i=0; i<this.series.length; i++) { + if (this.series[i].renderer.constructor == $.jqplot.PieRenderer) { + // don't allow mouseover and mousedown at same time. + if (this.series[i].highlightMouseOver) { + this.series[i].highlightMouseDown = false; + } + } + } + } + + // called with scope of plot + function postParseOptions(options) { + for (var i=0; i<this.series.length; i++) { + this.series[i].seriesColors = this.seriesColors; + this.series[i].colorGenerator = $.jqplot.colorGenerator; + } + } + + function highlight (plot, sidx, pidx) { + if (plot.series[sidx].showSlice[pidx]) { + var s = plot.series[sidx]; + var canvas = plot.plugins.pieRenderer.highlightCanvas; + canvas._ctx.clearRect(0,0,canvas._ctx.canvas.width, canvas._ctx.canvas.height); + s._highlightedPoint = pidx; + plot.plugins.pieRenderer.highlightedSeriesIndex = sidx; + s.renderer.drawSlice.call(s, canvas._ctx, s._sliceAngles[pidx][0], s._sliceAngles[pidx][1], s.highlightColorGenerator.get(pidx), false); + } + } + + function unhighlight (plot) { + var canvas = plot.plugins.pieRenderer.highlightCanvas; + canvas._ctx.clearRect(0,0, canvas._ctx.canvas.width, canvas._ctx.canvas.height); + for (var i=0; i<plot.series.length; i++) { + plot.series[i]._highlightedPoint = null; + } + plot.plugins.pieRenderer.highlightedSeriesIndex = null; + plot.target.trigger('jqplotDataUnhighlight'); + } + + function handleMove(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var evt1 = jQuery.Event('jqplotDataMouseOver'); + evt1.pageX = ev.pageX; + evt1.pageY = ev.pageY; + plot.target.trigger(evt1, ins); + if (plot.series[ins[0]].highlightMouseOver && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) { + var evt = jQuery.Event('jqplotDataHighlight'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + highlight (plot, ins[0], ins[1]); + } + } + else if (neighbor == null) { + unhighlight (plot); + } + } + + function handleMouseDown(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + if (plot.series[ins[0]].highlightMouseDown && !(ins[0] == plot.plugins.pieRenderer.highlightedSeriesIndex && ins[1] == plot.series[ins[0]]._highlightedPoint)) { + var evt = jQuery.Event('jqplotDataHighlight'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + highlight (plot, ins[0], ins[1]); + } + } + else if (neighbor == null) { + unhighlight (plot); + } + } + + function handleMouseUp(ev, gridpos, datapos, neighbor, plot) { + var idx = plot.plugins.pieRenderer.highlightedSeriesIndex; + if (idx != null && plot.series[idx].highlightMouseDown) { + unhighlight(plot); + } + } + + function handleClick(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var evt = jQuery.Event('jqplotDataClick'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + } + } + + function handleRightClick(ev, gridpos, datapos, neighbor, plot) { + if (neighbor) { + var ins = [neighbor.seriesIndex, neighbor.pointIndex, neighbor.data]; + var idx = plot.plugins.pieRenderer.highlightedSeriesIndex; + if (idx != null && plot.series[idx].highlightMouseDown) { + unhighlight(plot); + } + var evt = jQuery.Event('jqplotDataRightClick'); + evt.which = ev.which; + evt.pageX = ev.pageX; + evt.pageY = ev.pageY; + plot.target.trigger(evt, ins); + } + } + + // called within context of plot + // create a canvas which we can draw on. + // insert it before the eventCanvas, so eventCanvas will still capture events. + function postPlotDraw() { + // Memory Leaks patch + if (this.plugins.pieRenderer && this.plugins.pieRenderer.highlightCanvas) { + this.plugins.pieRenderer.highlightCanvas.resetCanvas(); + this.plugins.pieRenderer.highlightCanvas = null; + } + + this.plugins.pieRenderer = {highlightedSeriesIndex:null}; + this.plugins.pieRenderer.highlightCanvas = new $.jqplot.GenericCanvas(); + + // do we have any data labels? if so, put highlight canvas before those + var labels = $(this.targetId+' .jqplot-data-label'); + if (labels.length) { + $(labels[0]).before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this)); + } + // else put highlight canvas before event canvas. + else { + this.eventCanvas._elem.before(this.plugins.pieRenderer.highlightCanvas.createElement(this._gridPadding, 'jqplot-pieRenderer-highlight-canvas', this._plotDimensions, this)); + } + + var hctx = this.plugins.pieRenderer.highlightCanvas.setContext(); + this.eventCanvas._elem.bind('mouseleave', {plot:this}, function (ev) { unhighlight(ev.data.plot); }); + } + + $.jqplot.preInitHooks.push(preInit); + + $.jqplot.PieTickRenderer = function() { + $.jqplot.AxisTickRenderer.call(this); + }; + + $.jqplot.PieTickRenderer.prototype = new $.jqplot.AxisTickRenderer(); + $.jqplot.PieTickRenderer.prototype.constructor = $.jqplot.PieTickRenderer; + +})(jQuery); + + \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.pointLabels.js b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.pointLabels.js new file mode 100755 index 0000000..88ca4f2 --- /dev/null +++ b/phpMyAdmin/js/vendor/jqplot/plugins/jqplot.pointLabels.js @@ -0,0 +1,379 @@ +/** + * jqPlot + * Pure JavaScript plotting plugin using jQuery + * + * Version: 1.0.9 + * Revision: d96a669 + * + * Copyright (c) 2009-2016 Chris Leonello + * jqPlot is currently available for use in all personal or commercial projects + * under both the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL + * version 2.0 (http://www.gnu.org/licenses/gpl-2.0.html) licenses. This means that you can + * choose the license that best suits your project and use it accordingly. + * + * Although not required, the author would appreciate an email letting him + * know of any substantial use of jqPlot. You can reach the author at: + * chris at jqplot dot com or see http://www.jqplot.com/info.php . + * + * If you are feeling kind and generous, consider supporting the project by + * making a donation at: http://www.jqplot.com/donate.php . + * + * sprintf functions contained in jqplot.sprintf.js by Ash Searle: + * + * version 2007.04.27 + * author Ash Searle + * http://hexmen.com/blog/2007/03/printf-sprintf/ + * http://hexmen.com/js/sprintf.js + * The author (Ash Searle) has placed this code in the public domain: + * "This code is unrestricted: you are free to use it however you like." + * + */ +(function($) { + + /** + * Class: $.jqplot.PointLabels + * Plugin for putting labels at the data points. + * + * To use this plugin, include the js + * file in your source: + * + * > <script type="text/javascript" src="plugins/jqplot.pointLabels.js"></script> + * + * By default, the last value in the data ponit array in the data series is used + * for the label. For most series renderers, extra data can be added to the + * data point arrays and the last value will be used as the label. + * + * For instance, + * this series: + * + * > [[1,4], [3,5], [7,2]] + * + * Would, by default, use the y values in the labels. + * Extra data can be added to the series like so: + * + * > [[1,4,'mid'], [3 5,'hi'], [7,2,'low']] + * + * And now the point labels would be 'mid', 'low', and 'hi'. + * + * Options to the point labels and a custom labels array can be passed into the + * "pointLabels" option on the series option like so: + * + * > series:[{pointLabels:{ + * > labels:['mid', 'hi', 'low'], + * > location:'se', + * > ypadding: 12 + * > } + * > }] + * + * A custom labels array in the options takes precendence over any labels + * in the series data. If you have a custom labels array in the options, + * but still want to use values from the series array as labels, set the + * "labelsFromSeries" option to true. + * + * By default, html entities (<, >, etc.) are escaped in point labels. + * If you want to include actual html markup in the labels, + * set the "escapeHTML" option to false. + * + */ + $.jqplot.PointLabels = function(options) { + // Group: Properties + // + // prop: show + // show the labels or not. + this.show = $.jqplot.config.enablePlugins; + // prop: location + // compass location where to position the label around the point. + // 'n', 'ne', 'e', 'se', 's', 'sw', 'w', 'nw' + this.location = 'n'; + // prop: labelsFromSeries + // true to use labels within data point arrays. + this.labelsFromSeries = false; + // prop: seriesLabelIndex + // array index for location of labels within data point arrays. + // if null, will use the last element of the data point array. + this.seriesLabelIndex = null; + // prop: labels + // array of arrays of labels, one array for each series. + this.labels = []; + // actual labels that will get displayed. + // needed to preserve user specified labels in labels array. + this._labels = []; + // prop: stackedValue + // true to display value as stacked in a stacked plot. + // no effect if labels is specified. + this.stackedValue = false; + // prop: ypadding + // vertical padding in pixels between point and label + this.ypadding = 6; + // prop: xpadding + // horizontal padding in pixels between point and label + this.xpadding = 6; + // prop: escapeHTML + // true to escape html entities in the labels. + // If you want to include markup in the labels, set to false. + this.escapeHTML = true; + // prop: edgeTolerance + // Number of pixels that the label must be away from an axis + // boundary in order to be drawn. Negative values will allow overlap + // with the grid boundaries. + this.edgeTolerance = -5; + // prop: formatter + // A class of a formatter for the tick text. sprintf by default. + this.formatter = $.jqplot.DefaultTickFormatter; + // prop: formatString + // string passed to the formatter. + this.formatString = ''; + // prop: hideZeros + // true to not show a label for a value which is 0. + this.hideZeros = false; + this._elems = []; + + $.extend(true, this, options); + }; + + var locations = ['nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'w']; + var locationIndicies = {'nw':0, 'n':1, 'ne':2, 'e':3, 'se':4, 's':5, 'sw':6, 'w':7}; + var oppositeLocations = ['se', 's', 'sw', 'w', 'nw', 'n', 'ne', 'e']; + + // called with scope of a series + $.jqplot.PointLabels.init = function (target, data, seriesDefaults, opts, plot){ + var options = $.extend(true, {}, seriesDefaults, opts); + options.pointLabels = options.pointLabels || {}; + if (this.renderer.constructor === $.jqplot.BarRenderer && this.barDirection === 'horizontal' && !options.pointLabels.location) { + options.pointLabels.location = 'e'; + } + // add a pointLabels attribute to the series plugins + this.plugins.pointLabels = new $.jqplot.PointLabels(options.pointLabels); + this.plugins.pointLabels.setLabels.call(this); + }; + + // called with scope of series + $.jqplot.PointLabels.prototype.setLabels = function() { + var p = this.plugins.pointLabels; + var labelIdx; + if (p.seriesLabelIndex != null) { + labelIdx = p.seriesLabelIndex; + } + else if (this.renderer.constructor === $.jqplot.BarRenderer && this.barDirection === 'horizontal') { + labelIdx = (this._plotData[0].length < 3) ? 0 : this._plotData[0].length -1; + } + else { + labelIdx = (this._plotData.length === 0) ? 0 : this._plotData[0].length -1; + } + p._labels = []; + if (p.labels.length === 0 || p.labelsFromSeries) { + if (p.stackedValue) { + if (this._plotData.length && this._plotData[0].length){ + // var idx = p.seriesLabelIndex || this._plotData[0].length -1; + for (var i=0; i<this._plotData.length; i++) { + p._labels.push(this._plotData[i][labelIdx]); + } + } + } + else { + // var d = this._plotData; + var d = this.data; + if (this.renderer.constructor === $.jqplot.BarRenderer && this.waterfall) { + d = this._data; + } + if (d.length && d[0].length) { + // var idx = p.seriesLabelIndex || d[0].length -1; + for (var i=0; i<d.length; i++) { + p._labels.push(d[i][labelIdx]); + } + } + d = null; + } + } + else if (p.labels.length){ + p._labels = p.labels; + } + }; + + $.jqplot.PointLabels.prototype.xOffset = function(elem, location, padding) { + location = location || this.location; + padding = padding || this.xpadding; + var offset; + + switch (location) { + case 'nw': + offset = -elem.outerWidth(true) - this.xpadding; + break; + case 'n': + offset = -elem.outerWidth(true)/2; + break; + case 'ne': + offset = this.xpadding; + break; + case 'e': + offset = this.xpadding; + break; + case 'se': + offset = this.xpadding; + break; + case 's': + offset = -elem.outerWidth(true)/2; + break; + case 'sw': + offset = -elem.outerWidth(true) - this.xpadding; + break; + case 'w': + offset = -elem.outerWidth(true) - this.xpadding; + break; + default: // same as 'nw' + offset = -elem.outerWidth(true) - this.xpadding; + break; + } + return offset; + }; + + $.jqplot.PointLabels.prototype.yOffset = function(elem, location, padding) { + location = location || this.location; + padding = padding || this.xpadding; + var offset; + + switch (location) { + case 'nw': + offset = -elem.outerHeight(true) - this.ypadding; + break; + case 'n': + offset = -elem.outerHeight(true) - this.ypadding; + break; + case 'ne': + offset = -elem.outerHeight(true) - this.ypadding; + break; + case 'e': + offset = -elem.outerHeight(true)/2; + break; + case 'se': + offset = this.ypadding; + break; + case 's': + offset = this.ypadding; + break; + case 'sw': + offset = this.ypadding; + break; + case 'w': + offset = -elem.outerHeight(true)/2; + break; + default: // same as 'nw' + offset = -elem.outerHeight(true) - this.ypadding; + break; + } + return offset; + }; + + // called with scope of series + $.jqplot.PointLabels.draw = function (sctx, options, plot) { + var p = this.plugins.pointLabels; + // set labels again in case they have changed. + p.setLabels.call(this); + // remove any previous labels + for (var i=0; i<p._elems.length; i++) { + // Memory Leaks patch + // p._elems[i].remove(); + if(p._elems[i]) { + p._elems[i].emptyForce(); + } + } + p._elems.splice(0, p._elems.length); + + if (p.show) { + var ax = '_'+this._stackAxis+'axis'; + + if (!p.formatString) { + p.formatString = this[ax]._ticks[0].formatString; + p.formatter = this[ax]._ticks[0].formatter; + } + + var pd = this._plotData; + var ppd = this._prevPlotData; + var xax = this._xaxis; + var yax = this._yaxis; + var elem, helem; + + for (var i=0, l=p._labels.length; i < l; i++) { + var label = p._labels[i]; + + if (label == null || (p.hideZeros && parseFloat(label) == 0)) { + continue; + } + + label = p.formatter(p.formatString, label); + + helem = document.createElement('div'); + p._elems[i] = $(helem); + + elem = p._elems[i]; + + + elem.addClass('jqplot-point-label jqplot-series-'+this.index+' jqplot-point-'+i); + elem.css('position', 'absolute'); + elem.insertAfter(sctx.canvas); + + if (p.escapeHTML) { + elem.text(label); + } + else { + elem.html(label); + } + var location = p.location; + if ((this.fillToZero && pd[i][1] < 0) || (this.fillToZero && this._type === 'bar' && this.barDirection === 'horizontal' && pd[i][0] < 0) || (this.waterfall && parseInt(label, 10)) < 0) { + location = oppositeLocations[locationIndicies[location]]; + } + + + var ell = xax.u2p(pd[i][0]) + p.xOffset(elem, location); + var elt = yax.u2p(pd[i][1]) + p.yOffset(elem, location); + + // we have stacked chart but are not showing stacked values, + // place labels in center. + if (this._stack && !p.stackedValue) { + if (this.barDirection === "vertical") { + elt = (this._barPoints[i][0][1] + this._barPoints[i][1][1]) / 2 + plot._gridPadding.top - 0.5 * elem.outerHeight(true); + } + else { + ell = (this._barPoints[i][2][0] + this._barPoints[i][0][0]) / 2 + plot._gridPadding.left - 0.5 * elem.outerWidth(true); + } + } + + if (this.renderer.constructor == $.jqplot.BarRenderer) { + if (this.barDirection == "vertical") { + ell += this._barNudge; + } + else { + elt -= this._barNudge; + } + } + elem.css('left', ell); + elem.css('top', elt); + var elr = ell + elem.width(); + var elb = elt + elem.height(); + var et = p.edgeTolerance; + var scl = $(sctx.canvas).position().left; + var sct = $(sctx.canvas).position().top; + var scr = sctx.canvas.width + scl; + var scb = sctx.canvas.height + sct; + // if label is outside of allowed area, remove it + if (ell - et < scl || elt - et < sct || elr + et > scr || elb + et > scb) { + elem.remove(); + } + + elem = null; + helem = null; + } + + // finally, animate them if the series is animated + // if (this.renderer.animation && this.renderer.animation._supported && this.renderer.animation.show && plot._drawCount < 2) { + // var sel = '.jqplot-point-label.jqplot-series-'+this.index; + // $(sel).hide(); + // $(sel).fadeIn(1000); + // } + + } + }; + + $.jqplot.postSeriesInitHooks.push($.jqplot.PointLabels.init); + $.jqplot.postDrawSeriesHooks.push($.jqplot.PointLabels.draw); +})(jQuery); diff --git a/phpMyAdmin/js/vendor/jquery/MIT-LICENSE.txt b/phpMyAdmin/js/vendor/jquery/MIT-LICENSE.txt new file mode 100755 index 0000000..957f26d --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/MIT-LICENSE.txt @@ -0,0 +1,21 @@ +Copyright 2013 jQuery Foundation and other contributors +http://jquery.com/ + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/phpMyAdmin/js/vendor/jquery/additional-methods.js b/phpMyAdmin/js/vendor/jquery/additional-methods.js new file mode 100755 index 0000000..c9e051d --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/additional-methods.js @@ -0,0 +1,1512 @@ +/*! + * jQuery Validation Plugin v1.19.1 + * + * https://jqueryvalidation.org/ + * + * Copyright (c) 2019 J枚rn Zaefferer + * Released under the MIT license + */ +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + define( ["jquery", "./jquery.validate"], factory ); + } else if (typeof module === "object" && module.exports) { + module.exports = factory( require( "jquery" ) ); + } else { + factory( jQuery ); + } +}(function( $ ) { + +( function() { + + function stripHtml( value ) { + + // Remove html tags and space chars + return value.replace( /<.[^<>]*?>/g, " " ).replace( / | /gi, " " ) + + // Remove punctuation + .replace( /[.(),;:!?%#$'\"_+=\/\-鈥溾�濃�橾*/g, "" ); + } + + $.validator.addMethod( "maxWords", function( value, element, params ) { + return this.optional( element ) || stripHtml( value ).match( /\b\w+\b/g ).length <= params; + }, $.validator.format( "Please enter {0} words or less." ) ); + + $.validator.addMethod( "minWords", function( value, element, params ) { + return this.optional( element ) || stripHtml( value ).match( /\b\w+\b/g ).length >= params; + }, $.validator.format( "Please enter at least {0} words." ) ); + + $.validator.addMethod( "rangeWords", function( value, element, params ) { + var valueStripped = stripHtml( value ), + regex = /\b\w+\b/g; + return this.optional( element ) || valueStripped.match( regex ).length >= params[ 0 ] && valueStripped.match( regex ).length <= params[ 1 ]; + }, $.validator.format( "Please enter between {0} and {1} words." ) ); + +}() ); + +/** + * This is used in the United States to process payments, deposits, + * or transfers using the Automated Clearing House (ACH) or Fedwire + * systems. A very common use case would be to validate a form for + * an ACH bill payment. + */ +$.validator.addMethod( "abaRoutingNumber", function( value ) { + var checksum = 0; + var tokens = value.split( "" ); + var length = tokens.length; + + // Length Check + if ( length !== 9 ) { + return false; + } + + // Calc the checksum + // https://en.wikipedia.org/wiki/ABA_routing_transit_number + for ( var i = 0; i < length; i += 3 ) { + checksum += parseInt( tokens[ i ], 10 ) * 3 + + parseInt( tokens[ i + 1 ], 10 ) * 7 + + parseInt( tokens[ i + 2 ], 10 ); + } + + // If not zero and divisible by 10 then valid + if ( checksum !== 0 && checksum % 10 === 0 ) { + return true; + } + + return false; +}, "Please enter a valid routing number." ); + +// Accept a value from a file input based on a required mimetype +$.validator.addMethod( "accept", function( value, element, param ) { + + // Split mime on commas in case we have multiple types we can accept + var typeParam = typeof param === "string" ? param.replace( /\s/g, "" ) : "image/*", + optionalValue = this.optional( element ), + i, file, regex; + + // Element is optional + if ( optionalValue ) { + return optionalValue; + } + + if ( $( element ).attr( "type" ) === "file" ) { + + // Escape string to be used in the regex + // see: https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex + // Escape also "/*" as "/.*" as a wildcard + typeParam = typeParam + .replace( /[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g, "\\$&" ) + .replace( /,/g, "|" ) + .replace( /\/\*/g, "/.*" ); + + // Check if the element has a FileList before checking each file + if ( element.files && element.files.length ) { + regex = new RegExp( ".?(" + typeParam + ")$", "i" ); + for ( i = 0; i < element.files.length; i++ ) { + file = element.files[ i ]; + + // Grab the mimetype from the loaded file, verify it matches + if ( !file.type.match( regex ) ) { + return false; + } + } + } + } + + // Either return true because we've validated each file, or because the + // browser does not support element.files and the FileList feature + return true; +}, $.validator.format( "Please enter a value with a valid mimetype." ) ); + +$.validator.addMethod( "alphanumeric", function( value, element ) { + return this.optional( element ) || /^\w+$/i.test( value ); +}, "Letters, numbers, and underscores only please" ); + +/* + * Dutch bank account numbers (not 'giro' numbers) have 9 digits + * and pass the '11 check'. + * We accept the notation with spaces, as that is common. + * acceptable: 123456789 or 12 34 56 789 + */ +$.validator.addMethod( "bankaccountNL", function( value, element ) { + if ( this.optional( element ) ) { + return true; + } + if ( !( /^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test( value ) ) ) { + return false; + } + + // Now '11 check' + var account = value.replace( / /g, "" ), // Remove spaces + sum = 0, + len = account.length, + pos, factor, digit; + for ( pos = 0; pos < len; pos++ ) { + factor = len - pos; + digit = account.substring( pos, pos + 1 ); + sum = sum + factor * digit; + } + return sum % 11 === 0; +}, "Please specify a valid bank account number" ); + +$.validator.addMethod( "bankorgiroaccountNL", function( value, element ) { + return this.optional( element ) || + ( $.validator.methods.bankaccountNL.call( this, value, element ) ) || + ( $.validator.methods.giroaccountNL.call( this, value, element ) ); +}, "Please specify a valid bank or giro account number" ); + +/** + * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity. + * + * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional) + * + * Validation is case-insensitive. Please make sure to normalize input yourself. + * + * BIC definition in detail: + * - First 4 characters - bank code (only letters) + * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters) + * - Next 2 characters - location code (letters and digits) + * a. shall not start with '0' or '1' + * b. second character must be a letter ('O' is not allowed) or digit ('0' for test (therefore not allowed), '1' denoting passive participant, '2' typically reverse-billing) + * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits) + */ +$.validator.addMethod( "bic", function( value, element ) { + return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value.toUpperCase() ); +}, "Please specify a valid BIC code" ); + +/* + * C贸digo de identificaci贸n fiscal ( CIF ) is the tax identification code for Spanish legal entities + * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal + * + * Spanish CIF structure: + * + * [ T ][ P ][ P ][ N ][ N ][ N ][ N ][ N ][ C ] + * + * Where: + * + * T: 1 character. Kind of Organization Letter: [ABCDEFGHJKLMNPQRSUVW] + * P: 2 characters. Province. + * N: 5 characters. Secuencial Number within the province. + * C: 1 character. Control Digit: [0-9A-J]. + * + * [ T ]: Kind of Organizations. Possible values: + * + * A. Corporations + * B. LLCs + * C. General partnerships + * D. Companies limited partnerships + * E. Communities of goods + * F. Cooperative Societies + * G. Associations + * H. Communities of homeowners in horizontal property regime + * J. Civil Societies + * K. Old format + * L. Old format + * M. Old format + * N. Nonresident entities + * P. Local authorities + * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions + * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008) + * S. Organs of State Administration and regions + * V. Agrarian Transformation + * W. Permanent establishments of non-resident in Spain + * + * [ C ]: Control Digit. It can be a number or a letter depending on T value: + * [ T ] --> [ C ] + * ------ ---------- + * A Number + * B Number + * E Number + * H Number + * K Letter + * P Letter + * Q Letter + * S Letter + * + */ +$.validator.addMethod( "cifES", function( value, element ) { + "use strict"; + + if ( this.optional( element ) ) { + return true; + } + + var cifRegEx = new RegExp( /^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi ); + var letter = value.substring( 0, 1 ), // [ T ] + number = value.substring( 1, 8 ), // [ P ][ P ][ N ][ N ][ N ][ N ][ N ] + control = value.substring( 8, 9 ), // [ C ] + all_sum = 0, + even_sum = 0, + odd_sum = 0, + i, n, + control_digit, + control_letter; + + function isOdd( n ) { + return n % 2 === 0; + } + + // Quick format test + if ( value.length !== 9 || !cifRegEx.test( value ) ) { + return false; + } + + for ( i = 0; i < number.length; i++ ) { + n = parseInt( number[ i ], 10 ); + + // Odd positions + if ( isOdd( i ) ) { + + // Odd positions are multiplied first. + n *= 2; + + // If the multiplication is bigger than 10 we need to adjust + odd_sum += n < 10 ? n : n - 9; + + // Even positions + // Just sum them + } else { + even_sum += n; + } + } + + all_sum = even_sum + odd_sum; + control_digit = ( 10 - ( all_sum ).toString().substr( -1 ) ).toString(); + control_digit = parseInt( control_digit, 10 ) > 9 ? "0" : control_digit; + control_letter = "JABCDEFGHI".substr( control_digit, 1 ).toString(); + + // Control must be a digit + if ( letter.match( /[ABEH]/ ) ) { + return control === control_digit; + + // Control must be a letter + } else if ( letter.match( /[KPQS]/ ) ) { + return control === control_letter; + } + + // Can be either + return control === control_digit || control === control_letter; + +}, "Please specify a valid CIF number." ); + +/* + * Brazillian CNH number (Carteira Nacional de Habilitacao) is the License Driver number. + * CNH numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. + */ +$.validator.addMethod( "cnhBR", function( value ) { + + // Removing special characters from value + value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); + + // Checking value to have 11 digits only + if ( value.length !== 11 ) { + return false; + } + + var sum = 0, dsc = 0, firstChar, + firstCN, secondCN, i, j, v; + + firstChar = value.charAt( 0 ); + + if ( new Array( 12 ).join( firstChar ) === value ) { + return false; + } + + // Step 1 - using first Check Number: + for ( i = 0, j = 9, v = 0; i < 9; ++i, --j ) { + sum += +( value.charAt( i ) * j ); + } + + firstCN = sum % 11; + if ( firstCN >= 10 ) { + firstCN = 0; + dsc = 2; + } + + sum = 0; + for ( i = 0, j = 1, v = 0; i < 9; ++i, ++j ) { + sum += +( value.charAt( i ) * j ); + } + + secondCN = sum % 11; + if ( secondCN >= 10 ) { + secondCN = 0; + } else { + secondCN = secondCN - dsc; + } + + return ( String( firstCN ).concat( secondCN ) === value.substr( -2 ) ); + +}, "Please specify a valid CNH number" ); + +/* + * Brazillian value number (Cadastrado de Pessoas Juridica). + * value numbers have 14 digits in total: 12 numbers followed by 2 check numbers that are being used for validation. + */ +$.validator.addMethod( "cnpjBR", function( value, element ) { + "use strict"; + + if ( this.optional( element ) ) { + return true; + } + + // Removing no number + value = value.replace( /[^\d]+/g, "" ); + + // Checking value to have 14 digits only + if ( value.length !== 14 ) { + return false; + } + + // Elimina values invalidos conhecidos + if ( value === "00000000000000" || + value === "11111111111111" || + value === "22222222222222" || + value === "33333333333333" || + value === "44444444444444" || + value === "55555555555555" || + value === "66666666666666" || + value === "77777777777777" || + value === "88888888888888" || + value === "99999999999999" ) { + return false; + } + + // Valida DVs + var tamanho = ( value.length - 2 ); + var numeros = value.substring( 0, tamanho ); + var digitos = value.substring( tamanho ); + var soma = 0; + var pos = tamanho - 7; + + for ( var i = tamanho; i >= 1; i-- ) { + soma += numeros.charAt( tamanho - i ) * pos--; + if ( pos < 2 ) { + pos = 9; + } + } + + var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; + + if ( resultado !== parseInt( digitos.charAt( 0 ), 10 ) ) { + return false; + } + + tamanho = tamanho + 1; + numeros = value.substring( 0, tamanho ); + soma = 0; + pos = tamanho - 7; + + for ( var il = tamanho; il >= 1; il-- ) { + soma += numeros.charAt( tamanho - il ) * pos--; + if ( pos < 2 ) { + pos = 9; + } + } + + resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; + + if ( resultado !== parseInt( digitos.charAt( 1 ), 10 ) ) { + return false; + } + + return true; + +}, "Please specify a CNPJ value number" ); + +/* + * Brazillian CPF number (Cadastrado de Pessoas F铆sicas) is the equivalent of a Brazilian tax registration number. + * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. + */ +$.validator.addMethod( "cpfBR", function( value, element ) { + "use strict"; + + if ( this.optional( element ) ) { + return true; + } + + // Removing special characters from value + value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); + + // Checking value to have 11 digits only + if ( value.length !== 11 ) { + return false; + } + + var sum = 0, + firstCN, secondCN, checkResult, i; + + firstCN = parseInt( value.substring( 9, 10 ), 10 ); + secondCN = parseInt( value.substring( 10, 11 ), 10 ); + + checkResult = function( sum, cn ) { + var result = ( sum * 10 ) % 11; + if ( ( result === 10 ) || ( result === 11 ) ) { + result = 0; + } + return ( result === cn ); + }; + + // Checking for dump data + if ( value === "" || + value === "00000000000" || + value === "11111111111" || + value === "22222222222" || + value === "33333333333" || + value === "44444444444" || + value === "55555555555" || + value === "66666666666" || + value === "77777777777" || + value === "88888888888" || + value === "99999999999" + ) { + return false; + } + + // Step 1 - using first Check Number: + for ( i = 1; i <= 9; i++ ) { + sum = sum + parseInt( value.substring( i - 1, i ), 10 ) * ( 11 - i ); + } + + // If first Check Number (CN) is valid, move to Step 2 - using second Check Number: + if ( checkResult( sum, firstCN ) ) { + sum = 0; + for ( i = 1; i <= 10; i++ ) { + sum = sum + parseInt( value.substring( i - 1, i ), 10 ) * ( 12 - i ); + } + return checkResult( sum, secondCN ); + } + return false; + +}, "Please specify a valid CPF number" ); + +// https://jqueryvalidation.org/creditcard-method/ +// based on https://en.wikipedia.org/wiki/Luhn_algorithm +$.validator.addMethod( "creditcard", function( value, element ) { + if ( this.optional( element ) ) { + return "dependency-mismatch"; + } + + // Accept only spaces, digits and dashes + if ( /[^0-9 \-]+/.test( value ) ) { + return false; + } + + var nCheck = 0, + nDigit = 0, + bEven = false, + n, cDigit; + + value = value.replace( /\D/g, "" ); + + // Basing min and max length on + // https://dev.ean.com/general-info/valid-card-types/ + if ( value.length < 13 || value.length > 19 ) { + return false; + } + + for ( n = value.length - 1; n >= 0; n-- ) { + cDigit = value.charAt( n ); + nDigit = parseInt( cDigit, 10 ); + if ( bEven ) { + if ( ( nDigit *= 2 ) > 9 ) { + nDigit -= 9; + } + } + + nCheck += nDigit; + bEven = !bEven; + } + + return ( nCheck % 10 ) === 0; +}, "Please enter a valid credit card number." ); + +/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator + * Redistributed under the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 + * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) + */ +$.validator.addMethod( "creditcardtypes", function( value, element, param ) { + if ( /[^0-9\-]+/.test( value ) ) { + return false; + } + + value = value.replace( /\D/g, "" ); + + var validTypes = 0x0000; + + if ( param.mastercard ) { + validTypes |= 0x0001; + } + if ( param.visa ) { + validTypes |= 0x0002; + } + if ( param.amex ) { + validTypes |= 0x0004; + } + if ( param.dinersclub ) { + validTypes |= 0x0008; + } + if ( param.enroute ) { + validTypes |= 0x0010; + } + if ( param.discover ) { + validTypes |= 0x0020; + } + if ( param.jcb ) { + validTypes |= 0x0040; + } + if ( param.unknown ) { + validTypes |= 0x0080; + } + if ( param.all ) { + validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; + } + if ( validTypes & 0x0001 && ( /^(5[12345])/.test( value ) || /^(2[234567])/.test( value ) ) ) { // Mastercard + return value.length === 16; + } + if ( validTypes & 0x0002 && /^(4)/.test( value ) ) { // Visa + return value.length === 16; + } + if ( validTypes & 0x0004 && /^(3[47])/.test( value ) ) { // Amex + return value.length === 15; + } + if ( validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test( value ) ) { // Dinersclub + return value.length === 14; + } + if ( validTypes & 0x0010 && /^(2(014|149))/.test( value ) ) { // Enroute + return value.length === 15; + } + if ( validTypes & 0x0020 && /^(6011)/.test( value ) ) { // Discover + return value.length === 16; + } + if ( validTypes & 0x0040 && /^(3)/.test( value ) ) { // Jcb + return value.length === 16; + } + if ( validTypes & 0x0040 && /^(2131|1800)/.test( value ) ) { // Jcb + return value.length === 15; + } + if ( validTypes & 0x0080 ) { // Unknown + return true; + } + return false; +}, "Please enter a valid credit card number." ); + +/** + * Validates currencies with any given symbols by @jameslouiz + * Symbols can be optional or required. Symbols required by default + * + * Usage examples: + * currency: ["拢", false] - Use false for soft currency validation + * currency: ["$", false] + * currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc + * + * <input class="currencyInput" name="currencyInput"> + * + * Soft symbol checking + * currencyInput: { + * currency: ["$", false] + * } + * + * Strict symbol checking (default) + * currencyInput: { + * currency: "$" + * //OR + * currency: ["$", true] + * } + * + * Multiple Symbols + * currencyInput: { + * currency: "$,拢,垄" + * } + */ +$.validator.addMethod( "currency", function( value, element, param ) { + var isParamString = typeof param === "string", + symbol = isParamString ? param : param[ 0 ], + soft = isParamString ? true : param[ 1 ], + regex; + + symbol = symbol.replace( /,/g, "" ); + symbol = soft ? symbol + "]" : symbol + "]?"; + regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$"; + regex = new RegExp( regex ); + return this.optional( element ) || regex.test( value ); + +}, "Please specify a valid currency" ); + +$.validator.addMethod( "dateFA", function( value, element ) { + return this.optional( element ) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test( value ); +}, $.validator.messages.date ); + +/** + * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. + * + * @example $.validator.methods.date("01/01/1900") + * @result true + * + * @example $.validator.methods.date("01/13/1990") + * @result false + * + * @example $.validator.methods.date("01.01.1900") + * @result false + * + * @example <input name="pippo" class="{dateITA:true}" /> + * @desc Declares an optional input element whose value must be a valid date. + * + * @name $.validator.methods.dateITA + * @type Boolean + * @cat Plugins/Validate/Methods + */ +$.validator.addMethod( "dateITA", function( value, element ) { + var check = false, + re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, + adata, gg, mm, aaaa, xdata; + if ( re.test( value ) ) { + adata = value.split( "/" ); + gg = parseInt( adata[ 0 ], 10 ); + mm = parseInt( adata[ 1 ], 10 ); + aaaa = parseInt( adata[ 2 ], 10 ); + xdata = new Date( Date.UTC( aaaa, mm - 1, gg, 12, 0, 0, 0 ) ); + if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth() === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) { + check = true; + } else { + check = false; + } + } else { + check = false; + } + return this.optional( element ) || check; +}, $.validator.messages.date ); + +$.validator.addMethod( "dateNL", function( value, element ) { + return this.optional( element ) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test( value ); +}, $.validator.messages.date ); + +// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept +$.validator.addMethod( "extension", function( value, element, param ) { + param = typeof param === "string" ? param.replace( /,/g, "|" ) : "png|jpe?g|gif"; + return this.optional( element ) || value.match( new RegExp( "\\.(" + param + ")$", "i" ) ); +}, $.validator.format( "Please enter a value with a valid extension." ) ); + +/** + * Dutch giro account numbers (not bank numbers) have max 7 digits + */ +$.validator.addMethod( "giroaccountNL", function( value, element ) { + return this.optional( element ) || /^[0-9]{1,7}$/.test( value ); +}, "Please specify a valid giro account number" ); + +$.validator.addMethod( "greaterThan", function( value, element, param ) { + var target = $( param ); + + if ( this.settings.onfocusout && target.not( ".validate-greaterThan-blur" ).length ) { + target.addClass( "validate-greaterThan-blur" ).on( "blur.validate-greaterThan", function() { + $( element ).valid(); + } ); + } + + return value > target.val(); +}, "Please enter a greater value." ); + +$.validator.addMethod( "greaterThanEqual", function( value, element, param ) { + var target = $( param ); + + if ( this.settings.onfocusout && target.not( ".validate-greaterThanEqual-blur" ).length ) { + target.addClass( "validate-greaterThanEqual-blur" ).on( "blur.validate-greaterThanEqual", function() { + $( element ).valid(); + } ); + } + + return value >= target.val(); +}, "Please enter a greater value." ); + +/** + * IBAN is the international bank account number. + * It has a country - specific format, that is checked here too + * + * Validation is case-insensitive. Please make sure to normalize input yourself. + */ +$.validator.addMethod( "iban", function( value, element ) { + + // Some quick simple tests to prevent needless work + if ( this.optional( element ) ) { + return true; + } + + // Remove spaces and to upper case + var iban = value.replace( / /g, "" ).toUpperCase(), + ibancheckdigits = "", + leadingZeroes = true, + cRest = "", + cOperator = "", + countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p; + + // Check for IBAN code length. + // It contains: + // country code ISO 3166-1 - two letters, + // two check digits, + // Basic Bank Account Number (BBAN) - up to 30 chars + var minimalIBANlength = 5; + if ( iban.length < minimalIBANlength ) { + return false; + } + + // Check the country code and find the country specific format + countrycode = iban.substring( 0, 2 ); + bbancountrypatterns = { + "AL": "\\d{8}[\\dA-Z]{16}", + "AD": "\\d{8}[\\dA-Z]{12}", + "AT": "\\d{16}", + "AZ": "[\\dA-Z]{4}\\d{20}", + "BE": "\\d{12}", + "BH": "[A-Z]{4}[\\dA-Z]{14}", + "BA": "\\d{16}", + "BR": "\\d{23}[A-Z][\\dA-Z]", + "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}", + "CR": "\\d{17}", + "HR": "\\d{17}", + "CY": "\\d{8}[\\dA-Z]{16}", + "CZ": "\\d{20}", + "DK": "\\d{14}", + "DO": "[A-Z]{4}\\d{20}", + "EE": "\\d{16}", + "FO": "\\d{14}", + "FI": "\\d{14}", + "FR": "\\d{10}[\\dA-Z]{11}\\d{2}", + "GE": "[\\dA-Z]{2}\\d{16}", + "DE": "\\d{18}", + "GI": "[A-Z]{4}[\\dA-Z]{15}", + "GR": "\\d{7}[\\dA-Z]{16}", + "GL": "\\d{14}", + "GT": "[\\dA-Z]{4}[\\dA-Z]{20}", + "HU": "\\d{24}", + "IS": "\\d{22}", + "IE": "[\\dA-Z]{4}\\d{14}", + "IL": "\\d{19}", + "IT": "[A-Z]\\d{10}[\\dA-Z]{12}", + "KZ": "\\d{3}[\\dA-Z]{13}", + "KW": "[A-Z]{4}[\\dA-Z]{22}", + "LV": "[A-Z]{4}[\\dA-Z]{13}", + "LB": "\\d{4}[\\dA-Z]{20}", + "LI": "\\d{5}[\\dA-Z]{12}", + "LT": "\\d{16}", + "LU": "\\d{3}[\\dA-Z]{13}", + "MK": "\\d{3}[\\dA-Z]{10}\\d{2}", + "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}", + "MR": "\\d{23}", + "MU": "[A-Z]{4}\\d{19}[A-Z]{3}", + "MC": "\\d{10}[\\dA-Z]{11}\\d{2}", + "MD": "[\\dA-Z]{2}\\d{18}", + "ME": "\\d{18}", + "NL": "[A-Z]{4}\\d{10}", + "NO": "\\d{11}", + "PK": "[\\dA-Z]{4}\\d{16}", + "PS": "[\\dA-Z]{4}\\d{21}", + "PL": "\\d{24}", + "PT": "\\d{21}", + "RO": "[A-Z]{4}[\\dA-Z]{16}", + "SM": "[A-Z]\\d{10}[\\dA-Z]{12}", + "SA": "\\d{2}[\\dA-Z]{18}", + "RS": "\\d{18}", + "SK": "\\d{20}", + "SI": "\\d{15}", + "ES": "\\d{20}", + "SE": "\\d{20}", + "CH": "\\d{5}[\\dA-Z]{12}", + "TN": "\\d{20}", + "TR": "\\d{5}[\\dA-Z]{17}", + "AE": "\\d{3}\\d{16}", + "GB": "[A-Z]{4}\\d{14}", + "VG": "[\\dA-Z]{4}\\d{16}" + }; + + bbanpattern = bbancountrypatterns[ countrycode ]; + + // As new countries will start using IBAN in the + // future, we only check if the countrycode is known. + // This prevents false negatives, while almost all + // false positives introduced by this, will be caught + // by the checksum validation below anyway. + // Strict checking should return FALSE for unknown + // countries. + if ( typeof bbanpattern !== "undefined" ) { + ibanregexp = new RegExp( "^[A-Z]{2}\\d{2}" + bbanpattern + "$", "" ); + if ( !( ibanregexp.test( iban ) ) ) { + return false; // Invalid country specific format + } + } + + // Now check the checksum, first convert to digits + ibancheck = iban.substring( 4, iban.length ) + iban.substring( 0, 4 ); + for ( i = 0; i < ibancheck.length; i++ ) { + charAt = ibancheck.charAt( i ); + if ( charAt !== "0" ) { + leadingZeroes = false; + } + if ( !leadingZeroes ) { + ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf( charAt ); + } + } + + // Calculate the result of: ibancheckdigits % 97 + for ( p = 0; p < ibancheckdigits.length; p++ ) { + cChar = ibancheckdigits.charAt( p ); + cOperator = "" + cRest + "" + cChar; + cRest = cOperator % 97; + } + return cRest === 1; +}, "Please specify a valid IBAN" ); + +$.validator.addMethod( "integer", function( value, element ) { + return this.optional( element ) || /^-?\d+$/.test( value ); +}, "A positive or negative non-decimal number please" ); + +$.validator.addMethod( "ipv4", function( value, element ) { + return this.optional( element ) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test( value ); +}, "Please enter a valid IP v4 address." ); + +$.validator.addMethod( "ipv6", function( value, element ) { + return this.optional( element ) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test( value ); +}, "Please enter a valid IP v6 address." ); + +$.validator.addMethod( "lessThan", function( value, element, param ) { + var target = $( param ); + + if ( this.settings.onfocusout && target.not( ".validate-lessThan-blur" ).length ) { + target.addClass( "validate-lessThan-blur" ).on( "blur.validate-lessThan", function() { + $( element ).valid(); + } ); + } + + return value < target.val(); +}, "Please enter a lesser value." ); + +$.validator.addMethod( "lessThanEqual", function( value, element, param ) { + var target = $( param ); + + if ( this.settings.onfocusout && target.not( ".validate-lessThanEqual-blur" ).length ) { + target.addClass( "validate-lessThanEqual-blur" ).on( "blur.validate-lessThanEqual", function() { + $( element ).valid(); + } ); + } + + return value <= target.val(); +}, "Please enter a lesser value." ); + +$.validator.addMethod( "lettersonly", function( value, element ) { + return this.optional( element ) || /^[a-z]+$/i.test( value ); +}, "Letters only please" ); + +$.validator.addMethod( "letterswithbasicpunc", function( value, element ) { + return this.optional( element ) || /^[a-z\-.,()'"\s]+$/i.test( value ); +}, "Letters or punctuation only please" ); + +// Limit the number of files in a FileList. +$.validator.addMethod( "maxfiles", function( value, element, param ) { + if ( this.optional( element ) ) { + return true; + } + + if ( $( element ).attr( "type" ) === "file" ) { + if ( element.files && element.files.length > param ) { + return false; + } + } + + return true; +}, $.validator.format( "Please select no more than {0} files." ) ); + +// Limit the size of each individual file in a FileList. +$.validator.addMethod( "maxsize", function( value, element, param ) { + if ( this.optional( element ) ) { + return true; + } + + if ( $( element ).attr( "type" ) === "file" ) { + if ( element.files && element.files.length ) { + for ( var i = 0; i < element.files.length; i++ ) { + if ( element.files[ i ].size > param ) { + return false; + } + } + } + } + + return true; +}, $.validator.format( "File size must not exceed {0} bytes each." ) ); + +// Limit the size of all files in a FileList. +$.validator.addMethod( "maxsizetotal", function( value, element, param ) { + if ( this.optional( element ) ) { + return true; + } + + if ( $( element ).attr( "type" ) === "file" ) { + if ( element.files && element.files.length ) { + var totalSize = 0; + + for ( var i = 0; i < element.files.length; i++ ) { + totalSize += element.files[ i ].size; + if ( totalSize > param ) { + return false; + } + } + } + } + + return true; +}, $.validator.format( "Total size of all files must not exceed {0} bytes." ) ); + + +$.validator.addMethod( "mobileNL", function( value, element ) { + return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test( value ); +}, "Please specify a valid mobile number" ); + +$.validator.addMethod( "mobileRU", function( phone_number, element ) { + var ruPhone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); + return this.optional( element ) || ruPhone_number.length > 9 && /^((\+7|7|8)+([0-9]){10})$/.test( ruPhone_number ); +}, "Please specify a valid mobile number" ); + +/* For UK phone functions, do the following server side processing: + * Compare original input with this RegEx pattern: + * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ + * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' + * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. + * A number of very detailed GB telephone number RegEx patterns can also be found at: + * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers + */ +$.validator.addMethod( "mobileUK", function( phone_number, element ) { + phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); + return this.optional( element ) || phone_number.length > 9 && + phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/ ); +}, "Please specify a valid mobile number" ); + +$.validator.addMethod( "netmask", function( value, element ) { + return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value ); +}, "Please enter a valid netmask." ); + +/* + * The NIE (N煤mero de Identificaci贸n de Extranjero) is a Spanish tax identification number assigned by the Spanish + * authorities to any foreigner. + * + * The NIE is the equivalent of a Spaniards N煤mero de Identificaci贸n Fiscal (NIF) which serves as a fiscal + * identification number. The CIF number (Certificado de Identificaci贸n Fiscal) is equivalent to the NIF, but applies to + * companies rather than individuals. The NIE consists of an 'X' or 'Y' followed by 7 or 8 digits then another letter. + */ +$.validator.addMethod( "nieES", function( value, element ) { + "use strict"; + + if ( this.optional( element ) ) { + return true; + } + + var nieRegEx = new RegExp( /^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi ); + var validChars = "TRWAGMYFPDXBNJZSQVHLCKET", + letter = value.substr( value.length - 1 ).toUpperCase(), + number; + + value = value.toString().toUpperCase(); + + // Quick format test + if ( value.length > 10 || value.length < 9 || !nieRegEx.test( value ) ) { + return false; + } + + // X means same number + // Y means number + 10000000 + // Z means number + 20000000 + value = value.replace( /^[X]/, "0" ) + .replace( /^[Y]/, "1" ) + .replace( /^[Z]/, "2" ); + + number = value.length === 9 ? value.substr( 0, 8 ) : value.substr( 0, 9 ); + + return validChars.charAt( parseInt( number, 10 ) % 23 ) === letter; + +}, "Please specify a valid NIE number." ); + +/* + * The N煤mero de Identificaci贸n Fiscal ( NIF ) is the way tax identification used in Spain for individuals + */ +$.validator.addMethod( "nifES", function( value, element ) { + "use strict"; + + if ( this.optional( element ) ) { + return true; + } + + value = value.toUpperCase(); + + // Basic format test + if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { + return false; + } + + // Test NIF + if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) { + return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) ); + } + + // Test specials NIF (starts with K, L or M) + if ( /^[KLM]{1}/.test( value ) ) { + return ( value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 1 ) % 23 ) ); + } + + return false; + +}, "Please specify a valid NIF number." ); + +/* + * Numer identyfikacji podatkowej ( NIP ) is the way tax identification used in Poland for companies + */ +$.validator.addMethod( "nipPL", function( value ) { + "use strict"; + + value = value.replace( /[^0-9]/g, "" ); + + if ( value.length !== 10 ) { + return false; + } + + var arrSteps = [ 6, 5, 7, 2, 3, 4, 5, 6, 7 ]; + var intSum = 0; + for ( var i = 0; i < 9; i++ ) { + intSum += arrSteps[ i ] * value[ i ]; + } + var int2 = intSum % 11; + var intControlNr = ( int2 === 10 ) ? 0 : int2; + + return ( intControlNr === parseInt( value[ 9 ], 10 ) ); +}, "Please specify a valid NIP number." ); + +/** + * Created for project jquery-validation. + * @Description Brazillian PIS or NIS number (N煤mero de Identifica莽茫o Social Pis ou Pasep) is the equivalent of a + * Brazilian tax registration number NIS of PIS numbers have 11 digits in total: 10 numbers followed by 1 check numbers + * that are being used for validation. + * @copyright (c) 21/08/2018 13:14, Cleiton da Silva Mendon莽a + * @author Cleiton da Silva Mendon莽a <cleiton.mendonca@gmail.com> + * @link http://gitlab.com/csmendonca Gitlab of Cleiton da Silva Mendon莽a + * @link http://github.com/csmendonca Github of Cleiton da Silva Mendon莽a + */ +$.validator.addMethod( "nisBR", function( value ) { + var number; + var cn; + var sum = 0; + var dv; + var count; + var multiplier; + + // Removing special characters from value + value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); + + // Checking value to have 11 digits only + if ( value.length !== 11 ) { + return false; + } + + //Get check number of value + cn = parseInt( value.substring( 10, 11 ), 10 ); + + //Get number with 10 digits of the value + number = parseInt( value.substring( 0, 10 ), 10 ); + + for ( count = 2; count < 12; count++ ) { + multiplier = count; + if ( count === 10 ) { + multiplier = 2; + } + if ( count === 11 ) { + multiplier = 3; + } + sum += ( ( number % 10 ) * multiplier ); + number = parseInt( number / 10, 10 ); + } + dv = ( sum % 11 ); + + if ( dv > 1 ) { + dv = ( 11 - dv ); + } else { + dv = 0; + } + + if ( cn === dv ) { + return true; + } else { + return false; + } +}, "Please specify a valid NIS/PIS number" ); + +$.validator.addMethod( "notEqualTo", function( value, element, param ) { + return this.optional( element ) || !$.validator.methods.equalTo.call( this, value, element, param ); +}, "Please enter a different value, values must not be the same." ); + +$.validator.addMethod( "nowhitespace", function( value, element ) { + return this.optional( element ) || /^\S+$/i.test( value ); +}, "No white space please" ); + +/** +* Return true if the field value matches the given format RegExp +* +* @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/) +* @result true +* +* @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/) +* @result false +* +* @name $.validator.methods.pattern +* @type Boolean +* @cat Plugins/Validate/Methods +*/ +$.validator.addMethod( "pattern", function( value, element, param ) { + if ( this.optional( element ) ) { + return true; + } + if ( typeof param === "string" ) { + param = new RegExp( "^(?:" + param + ")$" ); + } + return param.test( value ); +}, "Invalid format." ); + +/** + * Dutch phone numbers have 10 digits (or 11 and start with +31). + */ +$.validator.addMethod( "phoneNL", function( value, element ) { + return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test( value ); +}, "Please specify a valid phone number." ); + +/** + * Polish telephone numbers have 9 digits. + * + * Mobile phone numbers starts with following digits: + * 45, 50, 51, 53, 57, 60, 66, 69, 72, 73, 78, 79, 88. + * + * Fixed-line numbers starts with area codes: + * 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 29, 32, 33, + * 34, 41, 42, 43, 44, 46, 48, 52, 54, 55, 56, 58, 59, 61, + * 62, 63, 65, 67, 68, 71, 74, 75, 76, 77, 81, 82, 83, 84, + * 85, 86, 87, 89, 91, 94, 95. + * + * Ministry of National Defence numbers and VoIP numbers starts with 26 and 39. + * + * Excludes intelligent networks (premium rate, shared cost, free phone numbers). + * + * Poland National Numbering Plan http://www.itu.int/oth/T02020000A8/en + */ +$.validator.addMethod( "phonePL", function( phone_number, element ) { + phone_number = phone_number.replace( /\s+/g, "" ); + var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/; + return this.optional( element ) || regexp.test( phone_number ); +}, "Please specify a valid phone number" ); + +/* For UK phone functions, do the following server side processing: + * Compare original input with this RegEx pattern: + * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ + * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' + * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. + * A number of very detailed GB telephone number RegEx patterns can also be found at: + * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers + */ + +// Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers +$.validator.addMethod( "phonesUK", function( phone_number, element ) { + phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); + return this.optional( element ) || phone_number.length > 9 && + phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ ); +}, "Please specify a valid uk phone number" ); + +/* For UK phone functions, do the following server side processing: + * Compare original input with this RegEx pattern: + * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ + * Extract $1 and set $prefix to '+44<space>' if $1 is '44', otherwise set $prefix to '0' + * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. + * A number of very detailed GB telephone number RegEx patterns can also be found at: + * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers + */ +$.validator.addMethod( "phoneUK", function( phone_number, element ) { + phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); + return this.optional( element ) || phone_number.length > 9 && + phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/ ); +}, "Please specify a valid phone number" ); + +/** + * Matches US phone number format + * + * where the area code may not start with 1 and the prefix may not start with 1 + * allows '-' or ' ' as a separator and allows parens around area code + * some people may want to put a '1' in front of their number + * + * 1(212)-999-2345 or + * 212 999 2344 or + * 212-999-0983 + * + * but not + * 111-123-5434 + * and not + * 212 123 4567 + */ +$.validator.addMethod( "phoneUS", function( phone_number, element ) { + phone_number = phone_number.replace( /\s+/g, "" ); + return this.optional( element ) || phone_number.length > 9 && + phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/ ); +}, "Please specify a valid phone number" ); + +/* +* Valida CEPs do brasileiros: +* +* Formatos aceitos: +* 99999-999 +* 99.999-999 +* 99999999 +*/ +$.validator.addMethod( "postalcodeBR", function( cep_value, element ) { + return this.optional( element ) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); +}, "Informe um CEP v谩lido." ); + +/** + * Matches a valid Canadian Postal Code + * + * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element ) + * @result true + * + * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element ) + * @result false + * + * @name jQuery.validator.methods.postalCodeCA + * @type Boolean + * @cat Plugins/Validate/Methods + */ +$.validator.addMethod( "postalCodeCA", function( value, element ) { + return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test( value ); +}, "Please specify a valid postal code" ); + +/* Matches Italian postcode (CAP) */ +$.validator.addMethod( "postalcodeIT", function( value, element ) { + return this.optional( element ) || /^\d{5}$/.test( value ); +}, "Please specify a valid postal code" ); + +$.validator.addMethod( "postalcodeNL", function( value, element ) { + return this.optional( element ) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test( value ); +}, "Please specify a valid postal code" ); + +// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK) +$.validator.addMethod( "postcodeUK", function( value, element ) { + return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value ); +}, "Please specify a valid UK postcode" ); + +/* + * Lets you say "at least X inputs that match selector Y must be filled." + * + * The end result is that neither of these inputs: + * + * <input class="productinfo" name="partnumber"> + * <input class="productinfo" name="description"> + * + * ...will validate unless at least one of them is filled. + * + * partnumber: {require_from_group: [1,".productinfo"]}, + * description: {require_from_group: [1,".productinfo"]} + * + * options[0]: number of fields that must be filled in the group + * options[1]: CSS selector that defines the group of conditionally required fields + */ +$.validator.addMethod( "require_from_group", function( value, element, options ) { + var $fields = $( options[ 1 ], element.form ), + $fieldsFirst = $fields.eq( 0 ), + validator = $fieldsFirst.data( "valid_req_grp" ) ? $fieldsFirst.data( "valid_req_grp" ) : $.extend( {}, this ), + isValid = $fields.filter( function() { + return validator.elementValue( this ); + } ).length >= options[ 0 ]; + + // Store the cloned validator for future validation + $fieldsFirst.data( "valid_req_grp", validator ); + + // If element isn't being validated, run each require_from_group field's validation rules + if ( !$( element ).data( "being_validated" ) ) { + $fields.data( "being_validated", true ); + $fields.each( function() { + validator.element( this ); + } ); + $fields.data( "being_validated", false ); + } + return isValid; +}, $.validator.format( "Please fill at least {0} of these fields." ) ); + +/* + * Lets you say "either at least X inputs that match selector Y must be filled, + * OR they must all be skipped (left blank)." + * + * The end result, is that none of these inputs: + * + * <input class="productinfo" name="partnumber"> + * <input class="productinfo" name="description"> + * <input class="productinfo" name="color"> + * + * ...will validate unless either at least two of them are filled, + * OR none of them are. + * + * partnumber: {skip_or_fill_minimum: [2,".productinfo"]}, + * description: {skip_or_fill_minimum: [2,".productinfo"]}, + * color: {skip_or_fill_minimum: [2,".productinfo"]} + * + * options[0]: number of fields that must be filled in the group + * options[1]: CSS selector that defines the group of conditionally required fields + * + */ +$.validator.addMethod( "skip_or_fill_minimum", function( value, element, options ) { + var $fields = $( options[ 1 ], element.form ), + $fieldsFirst = $fields.eq( 0 ), + validator = $fieldsFirst.data( "valid_skip" ) ? $fieldsFirst.data( "valid_skip" ) : $.extend( {}, this ), + numberFilled = $fields.filter( function() { + return validator.elementValue( this ); + } ).length, + isValid = numberFilled === 0 || numberFilled >= options[ 0 ]; + + // Store the cloned validator for future validation + $fieldsFirst.data( "valid_skip", validator ); + + // If element isn't being validated, run each skip_or_fill_minimum field's validation rules + if ( !$( element ).data( "being_validated" ) ) { + $fields.data( "being_validated", true ); + $fields.each( function() { + validator.element( this ); + } ); + $fields.data( "being_validated", false ); + } + return isValid; +}, $.validator.format( "Please either skip these fields or fill at least {0} of them." ) ); + +/* Validates US States and/or Territories by @jdforsythe + * Can be case insensitive or require capitalization - default is case insensitive + * Can include US Territories or not - default does not + * Can include US Military postal abbreviations (AA, AE, AP) - default does not + * + * Note: "States" always includes DC (District of Colombia) + * + * Usage examples: + * + * This is the default - case insensitive, no territories, no military zones + * stateInput: { + * caseSensitive: false, + * includeTerritories: false, + * includeMilitary: false + * } + * + * Only allow capital letters, no territories, no military zones + * stateInput: { + * caseSensitive: false + * } + * + * Case insensitive, include territories but not military zones + * stateInput: { + * includeTerritories: true + * } + * + * Only allow capital letters, include territories and military zones + * stateInput: { + * caseSensitive: true, + * includeTerritories: true, + * includeMilitary: true + * } + * + */ +$.validator.addMethod( "stateUS", function( value, element, options ) { + var isDefault = typeof options === "undefined", + caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive, + includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories, + includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary, + regex; + + if ( !includeTerritories && !includeMilitary ) { + regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; + } else if ( includeTerritories && includeMilitary ) { + regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; + } else if ( includeTerritories ) { + regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; + } else { + regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; + } + + regex = caseSensitive ? new RegExp( regex ) : new RegExp( regex, "i" ); + return this.optional( element ) || regex.test( value ); +}, "Please specify a valid state" ); + +// TODO check if value starts with <, otherwise don't try stripping anything +$.validator.addMethod( "strippedminlength", function( value, element, param ) { + return $( value ).text().length >= param; +}, $.validator.format( "Please enter at least {0} characters" ) ); + +$.validator.addMethod( "time", function( value, element ) { + return this.optional( element ) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test( value ); +}, "Please enter a valid time, between 00:00 and 23:59" ); + +$.validator.addMethod( "time12h", function( value, element ) { + return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value ); +}, "Please enter a valid time in 12-hour am/pm format" ); + +// Same as url, but TLD is optional +$.validator.addMethod( "url2", function( value, element ) { + return this.optional( element ) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( value ); +}, $.validator.messages.url ); + +/** + * Return true, if the value is a valid vehicle identification number (VIN). + * + * Works with all kind of text inputs. + * + * @example <input type="text" size="20" name="VehicleID" class="{required:true,vinUS:true}" /> + * @desc Declares a required input element whose value must be a valid vehicle identification number. + * + * @name $.validator.methods.vinUS + * @type Boolean + * @cat Plugins/Validate/Methods + */ +$.validator.addMethod( "vinUS", function( v ) { + if ( v.length !== 17 ) { + return false; + } + + var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ], + VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ], + FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ], + rs = 0, + i, n, d, f, cd, cdv; + + for ( i = 0; i < 17; i++ ) { + f = FL[ i ]; + d = v.slice( i, i + 1 ); + if ( i === 8 ) { + cdv = d; + } + if ( !isNaN( d ) ) { + d *= f; + } else { + for ( n = 0; n < LL.length; n++ ) { + if ( d.toUpperCase() === LL[ n ] ) { + d = VL[ n ]; + d *= f; + if ( isNaN( cdv ) && n === 8 ) { + cdv = LL[ n ]; + } + break; + } + } + } + rs += d; + } + cd = rs % 11; + if ( cd === 10 ) { + cd = "X"; + } + if ( cd === cdv ) { + return true; + } + return false; +}, "The specified vehicle identification number (VIN) is invalid." ); + +$.validator.addMethod( "zipcodeUS", function( value, element ) { + return this.optional( element ) || /^\d{5}(-\d{4})?$/.test( value ); +}, "The specified US ZIP Code is invalid" ); + +$.validator.addMethod( "ziprange", function( value, element ) { + return this.optional( element ) || /^90[2-5]\d\{2\}-\d{4}$/.test( value ); +}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx" ); +return $; +})); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jquery/jquery-migrate.js b/phpMyAdmin/js/vendor/jquery/jquery-migrate.js new file mode 100755 index 0000000..a3e82b0 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery-migrate.js @@ -0,0 +1,678 @@ +/*! + * jQuery Migrate - v3.1.0 - 2019-06-08 + * Copyright OpenJS Foundation and other contributors + */ +;( function( factory ) { + if ( typeof define === "function" && define.amd ) { + + // AMD. Register as an anonymous module. + define( [ "jquery" ], function ( jQuery ) { + return factory( jQuery, window ); + } ); + } else if ( typeof module === "object" && module.exports ) { + + // Node/CommonJS + // eslint-disable-next-line no-undef + module.exports = factory( require( "jquery" ), window ); + } else { + + // Browser globals + factory( jQuery, window ); + } +} )( function( jQuery, window ) { +"use strict"; + + +jQuery.migrateVersion = "3.1.0"; + +/* exported jQueryVersionSince, compareVersions */ + +// Returns 0 if v1 == v2, -1 if v1 < v2, 1 if v1 > v2 +function compareVersions( v1, v2 ) { + var rVersionParts = /^(\d+)\.(\d+)\.(\d+)/, + v1p = rVersionParts.exec( v1 ) || [ ], + v2p = rVersionParts.exec( v2 ) || [ ]; + + for ( var i = 1; i <= 3; i++ ) { + if ( +v1p[ i ] > +v2p[ i ] ) { + return 1; + } + if ( +v1p[ i ] < +v2p[ i ] ) { + return -1; + } + } + return 0; +} + +function jQueryVersionSince( version ) { + return compareVersions( jQuery.fn.jquery, version ) >= 0; +} + +/* exported migrateWarn, migrateWarnFunc, migrateWarnProp */ + +( function() { + + // Support: IE9 only + // IE9 only creates console object when dev tools are first opened + // IE9 console is a host object, callable but doesn't have .apply() + if ( !window.console || !window.console.log ) { + return; + } + + // Need jQuery 3.0.0+ and no older Migrate loaded + if ( !jQuery || !jQueryVersionSince( "3.0.0" ) ) { + window.console.log( "JQMIGRATE: jQuery 3.0.0+ REQUIRED" ); + } + if ( jQuery.migrateWarnings ) { + window.console.log( "JQMIGRATE: Migrate plugin loaded multiple times" ); + } + + // Show a message on the console so devs know we're active + window.console.log( "JQMIGRATE: Migrate is installed" + + ( jQuery.migrateMute ? "" : " with logging active" ) + + ", version " + jQuery.migrateVersion ); + +} )(); + +var warnedAbout = {}; + +// List of warnings already given; public read only +jQuery.migrateWarnings = []; + +// Set to false to disable traces that appear with warnings +if ( jQuery.migrateTrace === undefined ) { + jQuery.migrateTrace = true; +} + +// Forget any warnings we've already given; public +jQuery.migrateReset = function() { + warnedAbout = {}; + jQuery.migrateWarnings.length = 0; +}; + +function migrateWarn( msg ) { + var console = window.console; + if ( !warnedAbout[ msg ] ) { + warnedAbout[ msg ] = true; + jQuery.migrateWarnings.push( msg ); + if ( console && console.warn && !jQuery.migrateMute ) { + console.warn( "JQMIGRATE: " + msg ); + if ( jQuery.migrateTrace && console.trace ) { + console.trace(); + } + } + } +} + +function migrateWarnProp( obj, prop, value, msg ) { + Object.defineProperty( obj, prop, { + configurable: true, + enumerable: true, + get: function() { + migrateWarn( msg ); + return value; + }, + set: function( newValue ) { + migrateWarn( msg ); + value = newValue; + } + } ); +} + +function migrateWarnFunc( obj, prop, newFunc, msg ) { + obj[ prop ] = function() { + migrateWarn( msg ); + return newFunc.apply( this, arguments ); + }; +} + +if ( window.document.compatMode === "BackCompat" ) { + + // JQuery has never supported or tested Quirks Mode + migrateWarn( "jQuery is not compatible with Quirks Mode" ); +} + + +var oldInit = jQuery.fn.init, + oldIsNumeric = jQuery.isNumeric, + oldFind = jQuery.find, + rattrHashTest = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/, + rattrHashGlob = /\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g; + +jQuery.fn.init = function( arg1 ) { + var args = Array.prototype.slice.call( arguments ); + + if ( typeof arg1 === "string" && arg1 === "#" ) { + + // JQuery( "#" ) is a bogus ID selector, but it returned an empty set before jQuery 3.0 + migrateWarn( "jQuery( '#' ) is not a valid selector" ); + args[ 0 ] = []; + } + + return oldInit.apply( this, args ); +}; +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.find = function( selector ) { + var args = Array.prototype.slice.call( arguments ); + + // Support: PhantomJS 1.x + // String#match fails to match when used with a //g RegExp, only on some strings + if ( typeof selector === "string" && rattrHashTest.test( selector ) ) { + + // The nonstandard and undocumented unquoted-hash was removed in jQuery 1.12.0 + // First see if qS thinks it's a valid selector, if so avoid a false positive + try { + window.document.querySelector( selector ); + } catch ( err1 ) { + + // Didn't *look* valid to qSA, warn and try quoting what we think is the value + selector = selector.replace( rattrHashGlob, function( _, attr, op, value ) { + return "[" + attr + op + "\"" + value + "\"]"; + } ); + + // If the regexp *may* have created an invalid selector, don't update it + // Note that there may be false alarms if selector uses jQuery extensions + try { + window.document.querySelector( selector ); + migrateWarn( "Attribute selector with '#' must be quoted: " + args[ 0 ] ); + args[ 0 ] = selector; + } catch ( err2 ) { + migrateWarn( "Attribute selector with '#' was not fixed: " + args[ 0 ] ); + } + } + } + + return oldFind.apply( this, args ); +}; + +// Copy properties attached to original jQuery.find method (e.g. .attr, .isXML) +var findProp; +for ( findProp in oldFind ) { + if ( Object.prototype.hasOwnProperty.call( oldFind, findProp ) ) { + jQuery.find[ findProp ] = oldFind[ findProp ]; + } +} + +// The number of elements contained in the matched element set +jQuery.fn.size = function() { + migrateWarn( "jQuery.fn.size() is deprecated and removed; use the .length property" ); + return this.length; +}; + +jQuery.parseJSON = function() { + migrateWarn( "jQuery.parseJSON is deprecated; use JSON.parse" ); + return JSON.parse.apply( null, arguments ); +}; + +jQuery.isNumeric = function( val ) { + + // The jQuery 2.2.3 implementation of isNumeric + function isNumeric2( obj ) { + var realStringObj = obj && obj.toString(); + return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; + } + + var newValue = oldIsNumeric( val ), + oldValue = isNumeric2( val ); + + if ( newValue !== oldValue ) { + migrateWarn( "jQuery.isNumeric() should not be called on constructed objects" ); + } + + return oldValue; +}; + +if ( jQueryVersionSince( "3.3.0" ) ) { + migrateWarnFunc( jQuery, "isWindow", + function( obj ) { + return obj != null && obj === obj.window; + }, + "jQuery.isWindow() is deprecated" + ); +} + +migrateWarnFunc( jQuery, "holdReady", jQuery.holdReady, + "jQuery.holdReady is deprecated" ); + +migrateWarnFunc( jQuery, "unique", jQuery.uniqueSort, + "jQuery.unique is deprecated; use jQuery.uniqueSort" ); + +// Now jQuery.expr.pseudos is the standard incantation +migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos, + "jQuery.expr.filters is deprecated; use jQuery.expr.pseudos" ); +migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos, + "jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos" ); + +// Prior to jQuery 3.2 there were internal refs so we don't warn there +if ( jQueryVersionSince( "3.2.0" ) ) { + migrateWarnFunc( jQuery, "nodeName", jQuery.nodeName, + "jQuery.nodeName is deprecated" ); +} + + +var oldAjax = jQuery.ajax; + +jQuery.ajax = function( ) { + var jQXHR = oldAjax.apply( this, arguments ); + + // Be sure we got a jQXHR (e.g., not sync) + if ( jQXHR.promise ) { + migrateWarnFunc( jQXHR, "success", jQXHR.done, + "jQXHR.success is deprecated and removed" ); + migrateWarnFunc( jQXHR, "error", jQXHR.fail, + "jQXHR.error is deprecated and removed" ); + migrateWarnFunc( jQXHR, "complete", jQXHR.always, + "jQXHR.complete is deprecated and removed" ); + } + + return jQXHR; +}; + + +var oldRemoveAttr = jQuery.fn.removeAttr, + oldToggleClass = jQuery.fn.toggleClass, + rmatchNonSpace = /\S+/g; + +jQuery.fn.removeAttr = function( name ) { + var self = this; + + jQuery.each( name.match( rmatchNonSpace ), function( _i, attr ) { + if ( jQuery.expr.match.bool.test( attr ) ) { + migrateWarn( "jQuery.fn.removeAttr no longer sets boolean properties: " + attr ); + self.prop( attr, false ); + } + } ); + + return oldRemoveAttr.apply( this, arguments ); +}; + +jQuery.fn.toggleClass = function( state ) { + + // Only deprecating no-args or single boolean arg + if ( state !== undefined && typeof state !== "boolean" ) { + return oldToggleClass.apply( this, arguments ); + } + + migrateWarn( "jQuery.fn.toggleClass( boolean ) is deprecated" ); + + // Toggle entire class name of each element + return this.each( function() { + var className = this.getAttribute && this.getAttribute( "class" ) || ""; + + if ( className ) { + jQuery.data( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || state === false ? + "" : + jQuery.data( this, "__className__" ) || "" + ); + } + } ); +}; + + +var internalSwapCall = false; + +// If this version of jQuery has .swap(), don't false-alarm on internal uses +if ( jQuery.swap ) { + jQuery.each( [ "height", "width", "reliableMarginRight" ], function( _, name ) { + var oldHook = jQuery.cssHooks[ name ] && jQuery.cssHooks[ name ].get; + + if ( oldHook ) { + jQuery.cssHooks[ name ].get = function() { + var ret; + + internalSwapCall = true; + ret = oldHook.apply( this, arguments ); + internalSwapCall = false; + return ret; + }; + } + } ); +} + +jQuery.swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + if ( !internalSwapCall ) { + migrateWarn( "jQuery.swap() is undocumented and deprecated" ); + } + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + +var oldData = jQuery.data; + +jQuery.data = function( elem, name, value ) { + var curData; + + // Name can be an object, and each entry in the object is meant to be set as data + if ( name && typeof name === "object" && arguments.length === 2 ) { + curData = jQuery.hasData( elem ) && oldData.call( this, elem ); + var sameKeys = {}; + for ( var key in name ) { + if ( key !== jQuery.camelCase( key ) ) { + migrateWarn( "jQuery.data() always sets/gets camelCased names: " + key ); + curData[ key ] = name[ key ]; + } else { + sameKeys[ key ] = name[ key ]; + } + } + + oldData.call( this, elem, sameKeys ); + + return name; + } + + // If the name is transformed, look for the un-transformed name in the data object + if ( name && typeof name === "string" && name !== jQuery.camelCase( name ) ) { + curData = jQuery.hasData( elem ) && oldData.call( this, elem ); + if ( curData && name in curData ) { + migrateWarn( "jQuery.data() always sets/gets camelCased names: " + name ); + if ( arguments.length > 2 ) { + curData[ name ] = value; + } + return curData[ name ]; + } + } + + return oldData.apply( this, arguments ); +}; + +var oldTweenRun = jQuery.Tween.prototype.run; +var linearEasing = function( pct ) { + return pct; + }; + +jQuery.Tween.prototype.run = function( ) { + if ( jQuery.easing[ this.easing ].length > 1 ) { + migrateWarn( + "'jQuery.easing." + this.easing.toString() + "' should use only one argument" + ); + + jQuery.easing[ this.easing ] = linearEasing; + } + + oldTweenRun.apply( this, arguments ); +}; + +var intervalValue = jQuery.fx.interval || 13, + intervalMsg = "jQuery.fx.interval is deprecated"; + +// Support: IE9, Android <=4.4 +// Avoid false positives on browsers that lack rAF +// Don't warn if document is hidden, jQuery uses setTimeout (#292) +if ( window.requestAnimationFrame ) { + Object.defineProperty( jQuery.fx, "interval", { + configurable: true, + enumerable: true, + get: function() { + if ( !window.document.hidden ) { + migrateWarn( intervalMsg ); + } + return intervalValue; + }, + set: function( newValue ) { + migrateWarn( intervalMsg ); + intervalValue = newValue; + } + } ); +} + +var oldLoad = jQuery.fn.load, + oldEventAdd = jQuery.event.add, + originalFix = jQuery.event.fix; + +jQuery.event.props = []; +jQuery.event.fixHooks = {}; + +migrateWarnProp( jQuery.event.props, "concat", jQuery.event.props.concat, + "jQuery.event.props.concat() is deprecated and removed" ); + +jQuery.event.fix = function( originalEvent ) { + var event, + type = originalEvent.type, + fixHook = this.fixHooks[ type ], + props = jQuery.event.props; + + if ( props.length ) { + migrateWarn( "jQuery.event.props are deprecated and removed: " + props.join() ); + while ( props.length ) { + jQuery.event.addProp( props.pop() ); + } + } + + if ( fixHook && !fixHook._migrated_ ) { + fixHook._migrated_ = true; + migrateWarn( "jQuery.event.fixHooks are deprecated and removed: " + type ); + if ( ( props = fixHook.props ) && props.length ) { + while ( props.length ) { + jQuery.event.addProp( props.pop() ); + } + } + } + + event = originalFix.call( this, originalEvent ); + + return fixHook && fixHook.filter ? fixHook.filter( event, originalEvent ) : event; +}; + +jQuery.event.add = function( elem, types ) { + + // This misses the multiple-types case but that seems awfully rare + if ( elem === window && types === "load" && window.document.readyState === "complete" ) { + migrateWarn( "jQuery(window).on('load'...) called after load event occurred" ); + } + return oldEventAdd.apply( this, arguments ); +}; + +jQuery.each( [ "load", "unload", "error" ], function( _, name ) { + + jQuery.fn[ name ] = function() { + var args = Array.prototype.slice.call( arguments, 0 ); + + // If this is an ajax load() the first arg should be the string URL; + // technically this could also be the "Anything" arg of the event .load() + // which just goes to show why this dumb signature has been deprecated! + // jQuery custom builds that exclude the Ajax module justifiably die here. + if ( name === "load" && typeof args[ 0 ] === "string" ) { + return oldLoad.apply( this, args ); + } + + migrateWarn( "jQuery.fn." + name + "() is deprecated" ); + + args.splice( 0, 0, name ); + if ( arguments.length ) { + return this.on.apply( this, args ); + } + + // Use .triggerHandler here because: + // - load and unload events don't need to bubble, only applied to window or image + // - error event should not bubble to window, although it does pre-1.7 + // See http://bugs.jquery.com/ticket/11820 + this.triggerHandler.apply( this, args ); + return this; + }; + +} ); + +jQuery.each( ( "blur focus focusin focusout resize scroll click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup contextmenu" ).split( " " ), + function( _i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + migrateWarn( "jQuery.fn." + name + "() event shorthand is deprecated" ); + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; +} ); + +// Trigger "ready" event only once, on document ready +jQuery( function() { + jQuery( window.document ).triggerHandler( "ready" ); +} ); + +jQuery.event.special.ready = { + setup: function() { + if ( this === window.document ) { + migrateWarn( "'ready' event is deprecated" ); + } + } +}; + +jQuery.fn.extend( { + + bind: function( types, data, fn ) { + migrateWarn( "jQuery.fn.bind() is deprecated" ); + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + migrateWarn( "jQuery.fn.unbind() is deprecated" ); + return this.off( types, null, fn ); + }, + delegate: function( selector, types, data, fn ) { + migrateWarn( "jQuery.fn.delegate() is deprecated" ); + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + migrateWarn( "jQuery.fn.undelegate() is deprecated" ); + return arguments.length === 1 ? + this.off( selector, "**" ) : + this.off( types, selector || "**", fn ); + }, + hover: function( fnOver, fnOut ) { + migrateWarn( "jQuery.fn.hover() is deprecated" ); + return this.on( "mouseenter", fnOver ).on( "mouseleave", fnOut || fnOver ); + } +} ); + + +var oldOffset = jQuery.fn.offset; + +jQuery.fn.offset = function() { + var docElem, + elem = this[ 0 ], + origin = { top: 0, left: 0 }; + + if ( !elem || !elem.nodeType ) { + migrateWarn( "jQuery.fn.offset() requires a valid DOM element" ); + return origin; + } + + docElem = ( elem.ownerDocument || window.document ).documentElement; + if ( !jQuery.contains( docElem, elem ) ) { + migrateWarn( "jQuery.fn.offset() requires an element connected to a document" ); + return origin; + } + + return oldOffset.apply( this, arguments ); +}; + + +var oldParam = jQuery.param; + +jQuery.param = function( data, traditional ) { + var ajaxTraditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; + + if ( traditional === undefined && ajaxTraditional ) { + + migrateWarn( "jQuery.param() no longer uses jQuery.ajaxSettings.traditional" ); + traditional = ajaxTraditional; + } + + return oldParam.call( this, data, traditional ); +}; + +var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack; + +jQuery.fn.andSelf = function() { + migrateWarn( "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" ); + return oldSelf.apply( this, arguments ); +}; + + +var oldDeferred = jQuery.Deferred, + tuples = [ + + // Action, add listener, callbacks, .then handlers, final state + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), "rejected" ], + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ) ] + ]; + +jQuery.Deferred = function( func ) { + var deferred = oldDeferred(), + promise = deferred.promise(); + + deferred.pipe = promise.pipe = function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + migrateWarn( "deferred.pipe() is deprecated" ); + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + + // Deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this === promise ? newDefer.promise() : this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + + }; + + if ( func ) { + func.call( deferred, deferred ); + } + + return deferred; +}; + +// Preserve handler of uncaught exceptions in promise chains +jQuery.Deferred.exceptionHook = oldDeferred.exceptionHook; + +return jQuery; +} ); diff --git a/phpMyAdmin/js/vendor/jquery/jquery-ui-timepicker-addon.js b/phpMyAdmin/js/vendor/jquery/jquery-ui-timepicker-addon.js new file mode 100755 index 0000000..d37bc02 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery-ui-timepicker-addon.js @@ -0,0 +1,2291 @@ +/*! jQuery Timepicker Addon - v1.6.3 - 2016-04-20 +* http://trentrichardson.com/examples/timepicker +* Copyright (c) 2016 Trent Richardson; Licensed MIT */ +(function (factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery', 'jquery-ui'], factory); + } else { + factory(jQuery); + } +}(function ($) { + + /* + * Lets not redefine timepicker, Prevent "Uncaught RangeError: Maximum call stack size exceeded" + */ + $.ui.timepicker = $.ui.timepicker || {}; + if ($.ui.timepicker.version) { + return; + } + + /* + * Extend jQueryUI, get it started with our version number + */ + $.extend($.ui, { + timepicker: { + version: "1.6.3" + } + }); + + /* + * Timepicker manager. + * Use the singleton instance of this class, $.timepicker, to interact with the time picker. + * Settings for (groups of) time pickers are maintained in an instance object, + * allowing multiple different settings on the same page. + */ + var Timepicker = function () { + this.regional = []; // Available regional settings, indexed by language code + this.regional[''] = { // Default regional settings + currentText: 'Now', + closeText: 'Done', + amNames: ['AM', 'A'], + pmNames: ['PM', 'P'], + timeFormat: 'HH:mm', + timeSuffix: '', + timeOnlyTitle: 'Choose Time', + timeText: 'Time', + hourText: 'Hour', + minuteText: 'Minute', + secondText: 'Second', + millisecText: 'Millisecond', + microsecText: 'Microsecond', + timezoneText: 'Time Zone', + isRTL: false + }; + this._defaults = { // Global defaults for all the datetime picker instances + showButtonPanel: true, + timeOnly: false, + timeOnlyShowDate: false, + showHour: null, + showMinute: null, + showSecond: null, + showMillisec: null, + showMicrosec: null, + showTimezone: null, + showTime: true, + stepHour: 1, + stepMinute: 1, + stepSecond: 1, + stepMillisec: 1, + stepMicrosec: 1, + hour: 0, + minute: 0, + second: 0, + millisec: 0, + microsec: 0, + timezone: null, + hourMin: 0, + minuteMin: 0, + secondMin: 0, + millisecMin: 0, + microsecMin: 0, + hourMax: 23, + minuteMax: 59, + secondMax: 59, + millisecMax: 999, + microsecMax: 999, + minDateTime: null, + maxDateTime: null, + maxTime: null, + minTime: null, + onSelect: null, + hourGrid: 0, + minuteGrid: 0, + secondGrid: 0, + millisecGrid: 0, + microsecGrid: 0, + alwaysSetTime: true, + separator: ' ', + altFieldTimeOnly: true, + altTimeFormat: null, + altSeparator: null, + altTimeSuffix: null, + altRedirectFocus: true, + pickerTimeFormat: null, + pickerTimeSuffix: null, + showTimepicker: true, + timezoneList: null, + addSliderAccess: false, + sliderAccessArgs: null, + controlType: 'slider', + oneLine: false, + defaultValue: null, + parse: 'strict', + afterInject: null + }; + $.extend(this._defaults, this.regional['']); + }; + + $.extend(Timepicker.prototype, { + $input: null, + $altInput: null, + $timeObj: null, + inst: null, + hour_slider: null, + minute_slider: null, + second_slider: null, + millisec_slider: null, + microsec_slider: null, + timezone_select: null, + maxTime: null, + minTime: null, + hour: 0, + minute: 0, + second: 0, + millisec: 0, + microsec: 0, + timezone: null, + hourMinOriginal: null, + minuteMinOriginal: null, + secondMinOriginal: null, + millisecMinOriginal: null, + microsecMinOriginal: null, + hourMaxOriginal: null, + minuteMaxOriginal: null, + secondMaxOriginal: null, + millisecMaxOriginal: null, + microsecMaxOriginal: null, + ampm: '', + formattedDate: '', + formattedTime: '', + formattedDateTime: '', + timezoneList: null, + units: ['hour', 'minute', 'second', 'millisec', 'microsec'], + support: {}, + control: null, + + /* + * Override the default settings for all instances of the time picker. + * @param {Object} settings object - the new settings to use as defaults (anonymous object) + * @return {Object} the manager object + */ + setDefaults: function (settings) { + extendRemove(this._defaults, settings || {}); + return this; + }, + + /* + * Create a new Timepicker instance + */ + _newInst: function ($input, opts) { + var tp_inst = new Timepicker(), + inlineSettings = {}, + fns = {}, + overrides, i; + + for (var attrName in this._defaults) { + if (this._defaults.hasOwnProperty(attrName)) { + var attrValue = $input.attr('time:' + attrName); + if (attrValue) { + try { + inlineSettings[attrName] = eval(attrValue); + } catch (err) { + inlineSettings[attrName] = attrValue; + } + } + } + } + + overrides = { + beforeShow: function (input, dp_inst) { + if ($.isFunction(tp_inst._defaults.evnts.beforeShow)) { + return tp_inst._defaults.evnts.beforeShow.call($input[0], input, dp_inst, tp_inst); + } + }, + onChangeMonthYear: function (year, month, dp_inst) { + // Update the time as well : this prevents the time from disappearing from the $input field. + // tp_inst._updateDateTime(dp_inst); + if ($.isFunction(tp_inst._defaults.evnts.onChangeMonthYear)) { + tp_inst._defaults.evnts.onChangeMonthYear.call($input[0], year, month, dp_inst, tp_inst); + } + }, + onClose: function (dateText, dp_inst) { + if (tp_inst.timeDefined === true && $input.val() !== '') { + tp_inst._updateDateTime(dp_inst); + } + if ($.isFunction(tp_inst._defaults.evnts.onClose)) { + tp_inst._defaults.evnts.onClose.call($input[0], dateText, dp_inst, tp_inst); + } + } + }; + for (i in overrides) { + if (overrides.hasOwnProperty(i)) { + fns[i] = opts[i] || this._defaults[i] || null; + } + } + + tp_inst._defaults = $.extend({}, this._defaults, inlineSettings, opts, overrides, { + evnts: fns, + timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); + }); + tp_inst.amNames = $.map(tp_inst._defaults.amNames, function (val) { + return val.toUpperCase(); + }); + tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function (val) { + return val.toUpperCase(); + }); + + // detect which units are supported + tp_inst.support = detectSupport( + tp_inst._defaults.timeFormat + + (tp_inst._defaults.pickerTimeFormat ? tp_inst._defaults.pickerTimeFormat : '') + + (tp_inst._defaults.altTimeFormat ? tp_inst._defaults.altTimeFormat : '')); + + // controlType is string - key to our this._controls + if (typeof(tp_inst._defaults.controlType) === 'string') { + if (tp_inst._defaults.controlType === 'slider' && typeof($.ui.slider) === 'undefined') { + tp_inst._defaults.controlType = 'select'; + } + tp_inst.control = tp_inst._controls[tp_inst._defaults.controlType]; + } + // controlType is an object and must implement create, options, value methods + else { + tp_inst.control = tp_inst._defaults.controlType; + } + + // prep the timezone options + var timezoneList = [-720, -660, -600, -570, -540, -480, -420, -360, -300, -270, -240, -210, -180, -120, -60, + 0, 60, 120, 180, 210, 240, 270, 300, 330, 345, 360, 390, 420, 480, 525, 540, 570, 600, 630, 660, 690, 720, 765, 780, 840]; + if (tp_inst._defaults.timezoneList !== null) { + timezoneList = tp_inst._defaults.timezoneList; + } + var tzl = timezoneList.length, tzi = 0, tzv = null; + if (tzl > 0 && typeof timezoneList[0] !== 'object') { + for (; tzi < tzl; tzi++) { + tzv = timezoneList[tzi]; + timezoneList[tzi] = { value: tzv, label: $.timepicker.timezoneOffsetString(tzv, tp_inst.support.iso8601) }; + } + } + tp_inst._defaults.timezoneList = timezoneList; + + // set the default units + tp_inst.timezone = tp_inst._defaults.timezone !== null ? $.timepicker.timezoneOffsetNumber(tp_inst._defaults.timezone) : + ((new Date()).getTimezoneOffset() * -1); + tp_inst.hour = tp_inst._defaults.hour < tp_inst._defaults.hourMin ? tp_inst._defaults.hourMin : + tp_inst._defaults.hour > tp_inst._defaults.hourMax ? tp_inst._defaults.hourMax : tp_inst._defaults.hour; + tp_inst.minute = tp_inst._defaults.minute < tp_inst._defaults.minuteMin ? tp_inst._defaults.minuteMin : + tp_inst._defaults.minute > tp_inst._defaults.minuteMax ? tp_inst._defaults.minuteMax : tp_inst._defaults.minute; + tp_inst.second = tp_inst._defaults.second < tp_inst._defaults.secondMin ? tp_inst._defaults.secondMin : + tp_inst._defaults.second > tp_inst._defaults.secondMax ? tp_inst._defaults.secondMax : tp_inst._defaults.second; + tp_inst.millisec = tp_inst._defaults.millisec < tp_inst._defaults.millisecMin ? tp_inst._defaults.millisecMin : + tp_inst._defaults.millisec > tp_inst._defaults.millisecMax ? tp_inst._defaults.millisecMax : tp_inst._defaults.millisec; + tp_inst.microsec = tp_inst._defaults.microsec < tp_inst._defaults.microsecMin ? tp_inst._defaults.microsecMin : + tp_inst._defaults.microsec > tp_inst._defaults.microsecMax ? tp_inst._defaults.microsecMax : tp_inst._defaults.microsec; + tp_inst.ampm = ''; + tp_inst.$input = $input; + + if (tp_inst._defaults.altField) { + tp_inst.$altInput = $(tp_inst._defaults.altField); + if (tp_inst._defaults.altRedirectFocus === true) { + tp_inst.$altInput.css({ + cursor: 'pointer' + }).focus(function () { + $input.trigger("focus"); + }); + } + } + + if (tp_inst._defaults.minDate === 0 || tp_inst._defaults.minDateTime === 0) { + tp_inst._defaults.minDate = new Date(); + } + if (tp_inst._defaults.maxDate === 0 || tp_inst._defaults.maxDateTime === 0) { + tp_inst._defaults.maxDate = new Date(); + } + + // datepicker needs minDate/maxDate, timepicker needs minDateTime/maxDateTime.. + if (tp_inst._defaults.minDate !== undefined && tp_inst._defaults.minDate instanceof Date) { + tp_inst._defaults.minDateTime = new Date(tp_inst._defaults.minDate.getTime()); + } + if (tp_inst._defaults.minDateTime !== undefined && tp_inst._defaults.minDateTime instanceof Date) { + tp_inst._defaults.minDate = new Date(tp_inst._defaults.minDateTime.getTime()); + } + if (tp_inst._defaults.maxDate !== undefined && tp_inst._defaults.maxDate instanceof Date) { + tp_inst._defaults.maxDateTime = new Date(tp_inst._defaults.maxDate.getTime()); + } + if (tp_inst._defaults.maxDateTime !== undefined && tp_inst._defaults.maxDateTime instanceof Date) { + tp_inst._defaults.maxDate = new Date(tp_inst._defaults.maxDateTime.getTime()); + } + tp_inst.$input.bind('focus', function () { + tp_inst._onFocus(); + }); + + return tp_inst; + }, + + /* + * add our sliders to the calendar + */ + _addTimePicker: function (dp_inst) { + var currDT = $.trim((this.$altInput && this._defaults.altFieldTimeOnly) ? this.$input.val() + ' ' + this.$altInput.val() : this.$input.val()); + + this.timeDefined = this._parseTime(currDT); + this._limitMinMaxDateTime(dp_inst, false); + this._injectTimePicker(); + this._afterInject(); + }, + + /* + * parse the time string from input value or _setTime + */ + _parseTime: function (timeString, withDate) { + if (!this.inst) { + this.inst = $.datepicker._getInst(this.$input[0]); + } + + if (withDate || !this._defaults.timeOnly) { + var dp_dateFormat = $.datepicker._get(this.inst, 'dateFormat'); + try { + var parseRes = parseDateTimeInternal(dp_dateFormat, this._defaults.timeFormat, timeString, $.datepicker._getFormatConfig(this.inst), this._defaults); + if (!parseRes.timeObj) { + return false; + } + $.extend(this, parseRes.timeObj); + } catch (err) { + $.timepicker.log("Error parsing the date/time string: " + err + + "\ndate/time string = " + timeString + + "\ntimeFormat = " + this._defaults.timeFormat + + "\ndateFormat = " + dp_dateFormat); + return false; + } + return true; + } else { + var timeObj = $.datepicker.parseTime(this._defaults.timeFormat, timeString, this._defaults); + if (!timeObj) { + return false; + } + $.extend(this, timeObj); + return true; + } + }, + + /* + * Handle callback option after injecting timepicker + */ + _afterInject: function() { + var o = this.inst.settings; + if ($.isFunction(o.afterInject)) { + o.afterInject.call(this); + } + }, + + /* + * generate and inject html for timepicker into ui datepicker + */ + _injectTimePicker: function () { + var $dp = this.inst.dpDiv, + o = this.inst.settings, + tp_inst = this, + litem = '', + uitem = '', + show = null, + max = {}, + gridSize = {}, + size = null, + i = 0, + l = 0; + + // Prevent displaying twice + if ($dp.find("div.ui-timepicker-div").length === 0 && o.showTimepicker) { + var noDisplay = ' ui_tpicker_unit_hide', + html = '<div class="ui-timepicker-div' + (o.isRTL ? ' ui-timepicker-rtl' : '') + (o.oneLine && o.controlType === 'select' ? ' ui-timepicker-oneLine' : '') + '"><dl>' + '<dt class="ui_tpicker_time_label' + ((o.showTime) ? '' : noDisplay) + '">' + o.timeText + '</dt>' + + '<dd class="ui_tpicker_time '+ ((o.showTime) ? '' : noDisplay) + '"><input class="ui_tpicker_time_input" ' + (o.timeInput ? '' : 'disabled') + '/></dd>'; + + // Create the markup + for (i = 0, l = this.units.length; i < l; i++) { + litem = this.units[i]; + uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); + show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; + + // Added by Peter Medeiros: + // - Figure out what the hour/minute/second max should be based on the step values. + // - Example: if stepMinute is 15, then minMax is 45. + max[litem] = parseInt((o[litem + 'Max'] - ((o[litem + 'Max'] - o[litem + 'Min']) % o['step' + uitem])), 10); + gridSize[litem] = 0; + + html += '<dt class="ui_tpicker_' + litem + '_label' + (show ? '' : noDisplay) + '">' + o[litem + 'Text'] + '</dt>' + + '<dd class="ui_tpicker_' + litem + (show ? '' : noDisplay) + '"><div class="ui_tpicker_' + litem + '_slider' + (show ? '' : noDisplay) + '"></div>'; + + if (show && o[litem + 'Grid'] > 0) { + html += '<div style="padding-left: 1px"><table class="ui-tpicker-grid-label"><tr>'; + + if (litem === 'hour') { + for (var h = o[litem + 'Min']; h <= max[litem]; h += parseInt(o[litem + 'Grid'], 10)) { + gridSize[litem]++; + var tmph = $.datepicker.formatTime(this.support.ampm ? 'hht' : 'HH', {hour: h}, o); + html += '<td data-for="' + litem + '">' + tmph + '</td>'; + } + } + else { + for (var m = o[litem + 'Min']; m <= max[litem]; m += parseInt(o[litem + 'Grid'], 10)) { + gridSize[litem]++; + html += '<td data-for="' + litem + '">' + ((m < 10) ? '0' : '') + m + '</td>'; + } + } + + html += '</tr></table></div>'; + } + html += '</dd>'; + } + + // Timezone + var showTz = o.showTimezone !== null ? o.showTimezone : this.support.timezone; + html += '<dt class="ui_tpicker_timezone_label' + (showTz ? '' : noDisplay) + '">' + o.timezoneText + '</dt>'; + html += '<dd class="ui_tpicker_timezone' + (showTz ? '' : noDisplay) + '"></dd>'; + + // Create the elements from string + html += '</dl></div>'; + var $tp = $(html); + + // if we only want time picker... + if (o.timeOnly === true) { + $tp.prepend('<div class="ui-widget-header ui-helper-clearfix ui-corner-all">' + '<div class="ui-datepicker-title">' + o.timeOnlyTitle + '</div>' + '</div>'); + $dp.find('.ui-datepicker-header, .ui-datepicker-calendar').hide(); + } + + // add sliders, adjust grids, add events + for (i = 0, l = tp_inst.units.length; i < l; i++) { + litem = tp_inst.units[i]; + uitem = litem.substr(0, 1).toUpperCase() + litem.substr(1); + show = o['show' + uitem] !== null ? o['show' + uitem] : this.support[litem]; + + // add the slider + tp_inst[litem + '_slider'] = tp_inst.control.create(tp_inst, $tp.find('.ui_tpicker_' + litem + '_slider'), litem, tp_inst[litem], o[litem + 'Min'], max[litem], o['step' + uitem]); + + // adjust the grid and add click event + if (show && o[litem + 'Grid'] > 0) { + size = 100 * gridSize[litem] * o[litem + 'Grid'] / (max[litem] - o[litem + 'Min']); + $tp.find('.ui_tpicker_' + litem + ' table').css({ + width: size + "%", + marginLeft: o.isRTL ? '0' : ((size / (-2 * gridSize[litem])) + "%"), + marginRight: o.isRTL ? ((size / (-2 * gridSize[litem])) + "%") : '0', + borderCollapse: 'collapse' + }).find("td").click(function (e) { + var $t = $(this), + h = $t.html(), + n = parseInt(h.replace(/[^0-9]/g), 10), + ap = h.replace(/[^apm]/ig), + f = $t.data('for'); // loses scope, so we use data-for + + if (f === 'hour') { + if (ap.indexOf('p') !== -1 && n < 12) { + n += 12; + } + else { + if (ap.indexOf('a') !== -1 && n === 12) { + n = 0; + } + } + } + + tp_inst.control.value(tp_inst, tp_inst[f + '_slider'], litem, n); + + tp_inst._onTimeChange(); + tp_inst._onSelectHandler(); + }).css({ + cursor: 'pointer', + width: (100 / gridSize[litem]) + '%', + textAlign: 'center', + overflow: 'hidden' + }); + } // end if grid > 0 + } // end for loop + + // Add timezone options + this.timezone_select = $tp.find('.ui_tpicker_timezone').append('<select></select>').find("select"); + $.fn.append.apply(this.timezone_select, + $.map(o.timezoneList, function (val, idx) { + return $("<option />").val(typeof val === "object" ? val.value : val).text(typeof val === "object" ? val.label : val); + })); + if (typeof(this.timezone) !== "undefined" && this.timezone !== null && this.timezone !== "") { + var local_timezone = (new Date(this.inst.selectedYear, this.inst.selectedMonth, this.inst.selectedDay, 12)).getTimezoneOffset() * -1; + if (local_timezone === this.timezone) { + selectLocalTimezone(tp_inst); + } else { + this.timezone_select.val(this.timezone); + } + } else { + if (typeof(this.hour) !== "undefined" && this.hour !== null && this.hour !== "") { + this.timezone_select.val(o.timezone); + } else { + selectLocalTimezone(tp_inst); + } + } + this.timezone_select.change(function () { + tp_inst._onTimeChange(); + tp_inst._onSelectHandler(); + tp_inst._afterInject(); + }); + // End timezone options + + // inject timepicker into datepicker + var $buttonPanel = $dp.find('.ui-datepicker-buttonpane'); + if ($buttonPanel.length) { + $buttonPanel.before($tp); + } else { + $dp.append($tp); + } + + this.$timeObj = $tp.find('.ui_tpicker_time_input'); + this.$timeObj.change(function () { + var timeFormat = tp_inst.inst.settings.timeFormat; + var parsedTime = $.datepicker.parseTime(timeFormat, this.value); + var update = new Date(); + if (parsedTime) { + update.setHours(parsedTime.hour); + update.setMinutes(parsedTime.minute); + update.setSeconds(parsedTime.second); + $.datepicker._setTime(tp_inst.inst, update); + } else { + this.value = tp_inst.formattedTime; + this.blur(); + } + }); + + if (this.inst !== null) { + var timeDefined = this.timeDefined; + this._onTimeChange(); + this.timeDefined = timeDefined; + } + + // slideAccess integration: http://trentrichardson.com/2011/11/11/jquery-ui-sliders-and-touch-accessibility/ + if (this._defaults.addSliderAccess) { + var sliderAccessArgs = this._defaults.sliderAccessArgs, + rtl = this._defaults.isRTL; + sliderAccessArgs.isRTL = rtl; + + setTimeout(function () { // fix for inline mode + if ($tp.find('.ui-slider-access').length === 0) { + $tp.find('.ui-slider:visible').sliderAccess(sliderAccessArgs); + + // fix any grids since sliders are shorter + var sliderAccessWidth = $tp.find('.ui-slider-access:eq(0)').outerWidth(true); + if (sliderAccessWidth) { + $tp.find('table:visible').each(function () { + var $g = $(this), + oldWidth = $g.outerWidth(), + oldMarginLeft = $g.css(rtl ? 'marginRight' : 'marginLeft').toString().replace('%', ''), + newWidth = oldWidth - sliderAccessWidth, + newMarginLeft = ((oldMarginLeft * newWidth) / oldWidth) + '%', + css = { width: newWidth, marginRight: 0, marginLeft: 0 }; + css[rtl ? 'marginRight' : 'marginLeft'] = newMarginLeft; + $g.css(css); + }); + } + } + }, 10); + } + // end slideAccess integration + + tp_inst._limitMinMaxDateTime(this.inst, true); + } + }, + + /* + * This function tries to limit the ability to go outside the + * min/max date range + */ + _limitMinMaxDateTime: function (dp_inst, adjustSliders) { + var o = this._defaults, + dp_date = new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay); + + if (!this._defaults.showTimepicker) { + return; + } // No time so nothing to check here + + if ($.datepicker._get(dp_inst, 'minDateTime') !== null && $.datepicker._get(dp_inst, 'minDateTime') !== undefined && dp_date) { + var minDateTime = $.datepicker._get(dp_inst, 'minDateTime'), + minDateTimeDate = new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), 0, 0, 0, 0); + + if (this.hourMinOriginal === null || this.minuteMinOriginal === null || this.secondMinOriginal === null || this.millisecMinOriginal === null || this.microsecMinOriginal === null) { + this.hourMinOriginal = o.hourMin; + this.minuteMinOriginal = o.minuteMin; + this.secondMinOriginal = o.secondMin; + this.millisecMinOriginal = o.millisecMin; + this.microsecMinOriginal = o.microsecMin; + } + + if (dp_inst.settings.timeOnly || minDateTimeDate.getTime() === dp_date.getTime()) { + this._defaults.hourMin = minDateTime.getHours(); + if (this.hour <= this._defaults.hourMin) { + this.hour = this._defaults.hourMin; + this._defaults.minuteMin = minDateTime.getMinutes(); + if (this.minute <= this._defaults.minuteMin) { + this.minute = this._defaults.minuteMin; + this._defaults.secondMin = minDateTime.getSeconds(); + if (this.second <= this._defaults.secondMin) { + this.second = this._defaults.secondMin; + this._defaults.millisecMin = minDateTime.getMilliseconds(); + if (this.millisec <= this._defaults.millisecMin) { + this.millisec = this._defaults.millisecMin; + this._defaults.microsecMin = minDateTime.getMicroseconds(); + } else { + if (this.microsec < this._defaults.microsecMin) { + this.microsec = this._defaults.microsecMin; + } + this._defaults.microsecMin = this.microsecMinOriginal; + } + } else { + this._defaults.millisecMin = this.millisecMinOriginal; + this._defaults.microsecMin = this.microsecMinOriginal; + } + } else { + this._defaults.secondMin = this.secondMinOriginal; + this._defaults.millisecMin = this.millisecMinOriginal; + this._defaults.microsecMin = this.microsecMinOriginal; + } + } else { + this._defaults.minuteMin = this.minuteMinOriginal; + this._defaults.secondMin = this.secondMinOriginal; + this._defaults.millisecMin = this.millisecMinOriginal; + this._defaults.microsecMin = this.microsecMinOriginal; + } + } else { + this._defaults.hourMin = this.hourMinOriginal; + this._defaults.minuteMin = this.minuteMinOriginal; + this._defaults.secondMin = this.secondMinOriginal; + this._defaults.millisecMin = this.millisecMinOriginal; + this._defaults.microsecMin = this.microsecMinOriginal; + } + } + + if ($.datepicker._get(dp_inst, 'maxDateTime') !== null && $.datepicker._get(dp_inst, 'maxDateTime') !== undefined && dp_date) { + var maxDateTime = $.datepicker._get(dp_inst, 'maxDateTime'), + maxDateTimeDate = new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), 0, 0, 0, 0); + + if (this.hourMaxOriginal === null || this.minuteMaxOriginal === null || this.secondMaxOriginal === null || this.millisecMaxOriginal === null) { + this.hourMaxOriginal = o.hourMax; + this.minuteMaxOriginal = o.minuteMax; + this.secondMaxOriginal = o.secondMax; + this.millisecMaxOriginal = o.millisecMax; + this.microsecMaxOriginal = o.microsecMax; + } + + if (dp_inst.settings.timeOnly || maxDateTimeDate.getTime() === dp_date.getTime()) { + this._defaults.hourMax = maxDateTime.getHours(); + if (this.hour >= this._defaults.hourMax) { + this.hour = this._defaults.hourMax; + this._defaults.minuteMax = maxDateTime.getMinutes(); + if (this.minute >= this._defaults.minuteMax) { + this.minute = this._defaults.minuteMax; + this._defaults.secondMax = maxDateTime.getSeconds(); + if (this.second >= this._defaults.secondMax) { + this.second = this._defaults.secondMax; + this._defaults.millisecMax = maxDateTime.getMilliseconds(); + if (this.millisec >= this._defaults.millisecMax) { + this.millisec = this._defaults.millisecMax; + this._defaults.microsecMax = maxDateTime.getMicroseconds(); + } else { + if (this.microsec > this._defaults.microsecMax) { + this.microsec = this._defaults.microsecMax; + } + this._defaults.microsecMax = this.microsecMaxOriginal; + } + } else { + this._defaults.millisecMax = this.millisecMaxOriginal; + this._defaults.microsecMax = this.microsecMaxOriginal; + } + } else { + this._defaults.secondMax = this.secondMaxOriginal; + this._defaults.millisecMax = this.millisecMaxOriginal; + this._defaults.microsecMax = this.microsecMaxOriginal; + } + } else { + this._defaults.minuteMax = this.minuteMaxOriginal; + this._defaults.secondMax = this.secondMaxOriginal; + this._defaults.millisecMax = this.millisecMaxOriginal; + this._defaults.microsecMax = this.microsecMaxOriginal; + } + } else { + this._defaults.hourMax = this.hourMaxOriginal; + this._defaults.minuteMax = this.minuteMaxOriginal; + this._defaults.secondMax = this.secondMaxOriginal; + this._defaults.millisecMax = this.millisecMaxOriginal; + this._defaults.microsecMax = this.microsecMaxOriginal; + } + } + + if (dp_inst.settings.minTime!==null) { + var tempMinTime=new Date("01/01/1970 " + dp_inst.settings.minTime); + if (this.hour<tempMinTime.getHours()) { + this.hour=this._defaults.hourMin=tempMinTime.getHours(); + this.minute=this._defaults.minuteMin=tempMinTime.getMinutes(); + } else if (this.hour===tempMinTime.getHours() && this.minute<tempMinTime.getMinutes()) { + this.minute=this._defaults.minuteMin=tempMinTime.getMinutes(); + } else { + if (this._defaults.hourMin<tempMinTime.getHours()) { + this._defaults.hourMin=tempMinTime.getHours(); + this._defaults.minuteMin=tempMinTime.getMinutes(); + } else if (this._defaults.hourMin===tempMinTime.getHours()===this.hour && this._defaults.minuteMin<tempMinTime.getMinutes()) { + this._defaults.minuteMin=tempMinTime.getMinutes(); + } else { + this._defaults.minuteMin=0; + } + } + } + + if (dp_inst.settings.maxTime!==null) { + var tempMaxTime=new Date("01/01/1970 " + dp_inst.settings.maxTime); + if (this.hour>tempMaxTime.getHours()) { + this.hour=this._defaults.hourMax=tempMaxTime.getHours(); + this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes(); + } else if (this.hour===tempMaxTime.getHours() && this.minute>tempMaxTime.getMinutes()) { + this.minute=this._defaults.minuteMax=tempMaxTime.getMinutes(); + } else { + if (this._defaults.hourMax>tempMaxTime.getHours()) { + this._defaults.hourMax=tempMaxTime.getHours(); + this._defaults.minuteMax=tempMaxTime.getMinutes(); + } else if (this._defaults.hourMax===tempMaxTime.getHours()===this.hour && this._defaults.minuteMax>tempMaxTime.getMinutes()) { + this._defaults.minuteMax=tempMaxTime.getMinutes(); + } else { + this._defaults.minuteMax=59; + } + } + } + + if (adjustSliders !== undefined && adjustSliders === true) { + var hourMax = parseInt((this._defaults.hourMax - ((this._defaults.hourMax - this._defaults.hourMin) % this._defaults.stepHour)), 10), + minMax = parseInt((this._defaults.minuteMax - ((this._defaults.minuteMax - this._defaults.minuteMin) % this._defaults.stepMinute)), 10), + secMax = parseInt((this._defaults.secondMax - ((this._defaults.secondMax - this._defaults.secondMin) % this._defaults.stepSecond)), 10), + millisecMax = parseInt((this._defaults.millisecMax - ((this._defaults.millisecMax - this._defaults.millisecMin) % this._defaults.stepMillisec)), 10), + microsecMax = parseInt((this._defaults.microsecMax - ((this._defaults.microsecMax - this._defaults.microsecMin) % this._defaults.stepMicrosec)), 10); + + if (this.hour_slider) { + this.control.options(this, this.hour_slider, 'hour', { min: this._defaults.hourMin, max: hourMax, step: this._defaults.stepHour }); + this.control.value(this, this.hour_slider, 'hour', this.hour - (this.hour % this._defaults.stepHour)); + } + if (this.minute_slider) { + this.control.options(this, this.minute_slider, 'minute', { min: this._defaults.minuteMin, max: minMax, step: this._defaults.stepMinute }); + this.control.value(this, this.minute_slider, 'minute', this.minute - (this.minute % this._defaults.stepMinute)); + } + if (this.second_slider) { + this.control.options(this, this.second_slider, 'second', { min: this._defaults.secondMin, max: secMax, step: this._defaults.stepSecond }); + this.control.value(this, this.second_slider, 'second', this.second - (this.second % this._defaults.stepSecond)); + } + if (this.millisec_slider) { + this.control.options(this, this.millisec_slider, 'millisec', { min: this._defaults.millisecMin, max: millisecMax, step: this._defaults.stepMillisec }); + this.control.value(this, this.millisec_slider, 'millisec', this.millisec - (this.millisec % this._defaults.stepMillisec)); + } + if (this.microsec_slider) { + this.control.options(this, this.microsec_slider, 'microsec', { min: this._defaults.microsecMin, max: microsecMax, step: this._defaults.stepMicrosec }); + this.control.value(this, this.microsec_slider, 'microsec', this.microsec - (this.microsec % this._defaults.stepMicrosec)); + } + } + + }, + + /* + * when a slider moves, set the internal time... + * on time change is also called when the time is updated in the text field + */ + _onTimeChange: function () { + if (!this._defaults.showTimepicker) { + return; + } + var hour = (this.hour_slider) ? this.control.value(this, this.hour_slider, 'hour') : false, + minute = (this.minute_slider) ? this.control.value(this, this.minute_slider, 'minute') : false, + second = (this.second_slider) ? this.control.value(this, this.second_slider, 'second') : false, + millisec = (this.millisec_slider) ? this.control.value(this, this.millisec_slider, 'millisec') : false, + microsec = (this.microsec_slider) ? this.control.value(this, this.microsec_slider, 'microsec') : false, + timezone = (this.timezone_select) ? this.timezone_select.val() : false, + o = this._defaults, + pickerTimeFormat = o.pickerTimeFormat || o.timeFormat, + pickerTimeSuffix = o.pickerTimeSuffix || o.timeSuffix; + + if (typeof(hour) === 'object') { + hour = false; + } + if (typeof(minute) === 'object') { + minute = false; + } + if (typeof(second) === 'object') { + second = false; + } + if (typeof(millisec) === 'object') { + millisec = false; + } + if (typeof(microsec) === 'object') { + microsec = false; + } + if (typeof(timezone) === 'object') { + timezone = false; + } + + if (hour !== false) { + hour = parseInt(hour, 10); + } + if (minute !== false) { + minute = parseInt(minute, 10); + } + if (second !== false) { + second = parseInt(second, 10); + } + if (millisec !== false) { + millisec = parseInt(millisec, 10); + } + if (microsec !== false) { + microsec = parseInt(microsec, 10); + } + if (timezone !== false) { + timezone = timezone.toString(); + } + + var ampm = o[hour < 12 ? 'amNames' : 'pmNames'][0]; + + // If the update was done in the input field, the input field should not be updated. + // If the update was done using the sliders, update the input field. + var hasChanged = ( + hour !== parseInt(this.hour,10) || // sliders should all be numeric + minute !== parseInt(this.minute,10) || + second !== parseInt(this.second,10) || + millisec !== parseInt(this.millisec,10) || + microsec !== parseInt(this.microsec,10) || + (this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || + (this.timezone !== null && timezone !== this.timezone.toString()) // could be numeric or "EST" format, so use toString() + ); + + if (hasChanged) { + + if (hour !== false) { + this.hour = hour; + } + if (minute !== false) { + this.minute = minute; + } + if (second !== false) { + this.second = second; + } + if (millisec !== false) { + this.millisec = millisec; + } + if (microsec !== false) { + this.microsec = microsec; + } + if (timezone !== false) { + this.timezone = timezone; + } + + if (!this.inst) { + this.inst = $.datepicker._getInst(this.$input[0]); + } + + this._limitMinMaxDateTime(this.inst, true); + } + if (this.support.ampm) { + this.ampm = ampm; + } + + // Updates the time within the timepicker + this.formattedTime = $.datepicker.formatTime(o.timeFormat, this, o); + if (this.$timeObj) { + if (pickerTimeFormat === o.timeFormat) { + this.$timeObj.val(this.formattedTime + pickerTimeSuffix); + } + else { + this.$timeObj.val($.datepicker.formatTime(pickerTimeFormat, this, o) + pickerTimeSuffix); + } + if (this.$timeObj[0].setSelectionRange) { + var sPos = this.$timeObj[0].selectionStart; + var ePos = this.$timeObj[0].selectionEnd; + this.$timeObj[0].setSelectionRange(sPos, ePos); + } + } + + this.timeDefined = true; + if (hasChanged) { + this._updateDateTime(); + //this.$input.focus(); // may automatically open the picker on setDate + } + }, + + /* + * call custom onSelect. + * bind to sliders slidestop, and grid click. + */ + _onSelectHandler: function () { + var onSelect = this._defaults.onSelect || this.inst.settings.onSelect; + var inputEl = this.$input ? this.$input[0] : null; + if (onSelect && inputEl) { + onSelect.apply(inputEl, [this.formattedDateTime, this]); + } + }, + + /* + * update our input with the new date time.. + */ + _updateDateTime: function (dp_inst) { + dp_inst = this.inst || dp_inst; + var dtTmp = (dp_inst.currentYear > 0? + new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay) : + new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)), + dt = $.datepicker._daylightSavingAdjust(dtTmp), + //dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)), + //dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.currentYear, dp_inst.currentMonth, dp_inst.currentDay)), + dateFmt = $.datepicker._get(dp_inst, 'dateFormat'), + formatCfg = $.datepicker._getFormatConfig(dp_inst), + timeAvailable = dt !== null && this.timeDefined; + this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg); + var formattedDateTime = this.formattedDate; + + // if a slider was changed but datepicker doesn't have a value yet, set it + if (dp_inst.lastVal === "") { + dp_inst.currentYear = dp_inst.selectedYear; + dp_inst.currentMonth = dp_inst.selectedMonth; + dp_inst.currentDay = dp_inst.selectedDay; + } + + /* + * remove following lines to force every changes in date picker to change the input value + * Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker. + * If the user manually empty the value in the input field, the date picker will never change selected value. + */ + //if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) { + // return; + //} + + if (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === false) { + formattedDateTime = this.formattedTime; + } else if ((this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) || (this._defaults.timeOnly === true && this._defaults.timeOnlyShowDate === true)) { + formattedDateTime += this._defaults.separator + this.formattedTime + this._defaults.timeSuffix; + } + + this.formattedDateTime = formattedDateTime; + + if (!this._defaults.showTimepicker) { + this.$input.val(this.formattedDate); + } else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) { + this.$altInput.val(this.formattedTime); + this.$input.val(this.formattedDate); + } else if (this.$altInput) { + this.$input.val(formattedDateTime); + var altFormattedDateTime = '', + altSeparator = this._defaults.altSeparator !== null ? this._defaults.altSeparator : this._defaults.separator, + altTimeSuffix = this._defaults.altTimeSuffix !== null ? this._defaults.altTimeSuffix : this._defaults.timeSuffix; + + if (!this._defaults.timeOnly) { + if (this._defaults.altFormat) { + altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg); + } + else { + altFormattedDateTime = this.formattedDate; + } + + if (altFormattedDateTime) { + altFormattedDateTime += altSeparator; + } + } + + if (this._defaults.altTimeFormat !== null) { + altFormattedDateTime += $.datepicker.formatTime(this._defaults.altTimeFormat, this, this._defaults) + altTimeSuffix; + } + else { + altFormattedDateTime += this.formattedTime + altTimeSuffix; + } + this.$altInput.val(altFormattedDateTime); + } else { + this.$input.val(formattedDateTime); + } + + this.$input.trigger("change"); + }, + + _onFocus: function () { + if (!this.$input.val() && this._defaults.defaultValue) { + this.$input.val(this._defaults.defaultValue); + var inst = $.datepicker._getInst(this.$input.get(0)), + tp_inst = $.datepicker._get(inst, 'timepicker'); + if (tp_inst) { + if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) { + try { + $.datepicker._updateDatepicker(inst); + } catch (err) { + $.timepicker.log(err); + } + } + } + } + }, + + /* + * Small abstraction to control types + * We can add more, just be sure to follow the pattern: create, options, value + */ + _controls: { + // slider methods + slider: { + create: function (tp_inst, obj, unit, val, min, max, step) { + var rtl = tp_inst._defaults.isRTL; // if rtl go -60->0 instead of 0->60 + return obj.prop('slide', null).slider({ + orientation: "horizontal", + value: rtl ? val * -1 : val, + min: rtl ? max * -1 : min, + max: rtl ? min * -1 : max, + step: step, + slide: function (event, ui) { + tp_inst.control.value(tp_inst, $(this), unit, rtl ? ui.value * -1 : ui.value); + tp_inst._onTimeChange(); + }, + stop: function (event, ui) { + tp_inst._onSelectHandler(); + } + }); + }, + options: function (tp_inst, obj, unit, opts, val) { + if (tp_inst._defaults.isRTL) { + if (typeof(opts) === 'string') { + if (opts === 'min' || opts === 'max') { + if (val !== undefined) { + return obj.slider(opts, val * -1); + } + return Math.abs(obj.slider(opts)); + } + return obj.slider(opts); + } + var min = opts.min, + max = opts.max; + opts.min = opts.max = null; + if (min !== undefined) { + opts.max = min * -1; + } + if (max !== undefined) { + opts.min = max * -1; + } + return obj.slider(opts); + } + if (typeof(opts) === 'string' && val !== undefined) { + return obj.slider(opts, val); + } + return obj.slider(opts); + }, + value: function (tp_inst, obj, unit, val) { + if (tp_inst._defaults.isRTL) { + if (val !== undefined) { + return obj.slider('value', val * -1); + } + return Math.abs(obj.slider('value')); + } + if (val !== undefined) { + return obj.slider('value', val); + } + return obj.slider('value'); + } + }, + // select methods + select: { + create: function (tp_inst, obj, unit, val, min, max, step) { + var sel = '<select class="ui-timepicker-select ui-state-default ui-corner-all" data-unit="' + unit + '" data-min="' + min + '" data-max="' + max + '" data-step="' + step + '">', + format = tp_inst._defaults.pickerTimeFormat || tp_inst._defaults.timeFormat; + + for (var i = min; i <= max; i += step) { + sel += '<option value="' + i + '"' + (i === val ? ' selected' : '') + '>'; + if (unit === 'hour') { + sel += $.datepicker.formatTime($.trim(format.replace(/[^ht ]/ig, '')), {hour: i}, tp_inst._defaults); + } + else if (unit === 'millisec' || unit === 'microsec' || i >= 10) { sel += i; } + else {sel += '0' + i.toString(); } + sel += '</option>'; + } + sel += '</select>'; + + obj.children('select').remove(); + + $(sel).appendTo(obj).change(function (e) { + tp_inst._onTimeChange(); + tp_inst._onSelectHandler(); + tp_inst._afterInject(); + }); + + return obj; + }, + options: function (tp_inst, obj, unit, opts, val) { + var o = {}, + $t = obj.children('select'); + if (typeof(opts) === 'string') { + if (val === undefined) { + return $t.data(opts); + } + o[opts] = val; + } + else { o = opts; } + return tp_inst.control.create(tp_inst, obj, $t.data('unit'), $t.val(), o.min>=0 ? o.min : $t.data('min'), o.max || $t.data('max'), o.step || $t.data('step')); + }, + value: function (tp_inst, obj, unit, val) { + var $t = obj.children('select'); + if (val !== undefined) { + return $t.val(val); + } + return $t.val(); + } + } + } // end _controls + + }); + + $.fn.extend({ + /* + * shorthand just to use timepicker. + */ + timepicker: function (o) { + o = o || {}; + var tmp_args = Array.prototype.slice.call(arguments); + + if (typeof o === 'object') { + tmp_args[0] = $.extend(o, { + timeOnly: true + }); + } + + return $(this).each(function () { + $.fn.datetimepicker.apply($(this), tmp_args); + }); + }, + + /* + * extend timepicker to datepicker + */ + datetimepicker: function (o) { + o = o || {}; + var tmp_args = arguments; + + if (typeof(o) === 'string') { + if (o === 'getDate' || (o === 'option' && tmp_args.length === 2 && typeof (tmp_args[1]) === 'string')) { + return $.fn.datepicker.apply($(this[0]), tmp_args); + } else { + return this.each(function () { + var $t = $(this); + $t.datepicker.apply($t, tmp_args); + }); + } + } else { + return this.each(function () { + var $t = $(this); + $t.datepicker($.timepicker._newInst($t, o)._defaults); + }); + } + } + }); + + /* + * Public Utility to parse date and time + */ + $.datepicker.parseDateTime = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) { + var parseRes = parseDateTimeInternal(dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings); + if (parseRes.timeObj) { + var t = parseRes.timeObj; + parseRes.date.setHours(t.hour, t.minute, t.second, t.millisec); + parseRes.date.setMicroseconds(t.microsec); + } + + return parseRes.date; + }; + + /* + * Public utility to parse time + */ + $.datepicker.parseTime = function (timeFormat, timeString, options) { + var o = extendRemove(extendRemove({}, $.timepicker._defaults), options || {}), + iso8601 = (timeFormat.replace(/\'.*?\'/g, '').indexOf('Z') !== -1); + + // Strict parse requires the timeString to match the timeFormat exactly + var strictParse = function (f, s, o) { + + // pattern for standard and localized AM/PM markers + var getPatternAmpm = function (amNames, pmNames) { + var markers = []; + if (amNames) { + $.merge(markers, amNames); + } + if (pmNames) { + $.merge(markers, pmNames); + } + markers = $.map(markers, function (val) { + return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&'); + }); + return '(' + markers.join('|') + ')?'; + }; + + // figure out position of time elements.. cause js cant do named captures + var getFormatPositions = function (timeFormat) { + var finds = timeFormat.toLowerCase().match(/(h{1,2}|m{1,2}|s{1,2}|l{1}|c{1}|t{1,2}|z|'.*?')/g), + orders = { + h: -1, + m: -1, + s: -1, + l: -1, + c: -1, + t: -1, + z: -1 + }; + + if (finds) { + for (var i = 0; i < finds.length; i++) { + if (orders[finds[i].toString().charAt(0)] === -1) { + orders[finds[i].toString().charAt(0)] = i + 1; + } + } + } + return orders; + }; + + var regstr = '^' + f.toString() + .replace(/([hH]{1,2}|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) { + var ml = match.length; + switch (match.charAt(0).toLowerCase()) { + case 'h': + return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})'; + case 'm': + return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})'; + case 's': + return ml === 1 ? '(\\d?\\d)' : '(\\d{' + ml + '})'; + case 'l': + return '(\\d?\\d?\\d)'; + case 'c': + return '(\\d?\\d?\\d)'; + case 'z': + return '(z|[-+]\\d\\d:?\\d\\d|\\S+)?'; + case 't': + return getPatternAmpm(o.amNames, o.pmNames); + default: // literal escaped in quotes + return '(' + match.replace(/\'/g, "").replace(/(\.|\$|\^|\\|\/|\(|\)|\[|\]|\?|\+|\*)/g, function (m) { return "\\" + m; }) + ')?'; + } + }) + .replace(/\s/g, '\\s?') + + o.timeSuffix + '$', + order = getFormatPositions(f), + ampm = '', + treg; + + treg = s.match(new RegExp(regstr, 'i')); + + var resTime = { + hour: 0, + minute: 0, + second: 0, + millisec: 0, + microsec: 0 + }; + + if (treg) { + if (order.t !== -1) { + if (treg[order.t] === undefined || treg[order.t].length === 0) { + ampm = ''; + resTime.ampm = ''; + } else { + ampm = $.inArray(treg[order.t].toUpperCase(), $.map(o.amNames, function (x,i) { return x.toUpperCase(); })) !== -1 ? 'AM' : 'PM'; + resTime.ampm = o[ampm === 'AM' ? 'amNames' : 'pmNames'][0]; + } + } + + if (order.h !== -1) { + if (ampm === 'AM' && treg[order.h] === '12') { + resTime.hour = 0; // 12am = 0 hour + } else { + if (ampm === 'PM' && treg[order.h] !== '12') { + resTime.hour = parseInt(treg[order.h], 10) + 12; // 12pm = 12 hour, any other pm = hour + 12 + } else { + resTime.hour = Number(treg[order.h]); + } + } + } + + if (order.m !== -1) { + resTime.minute = Number(treg[order.m]); + } + if (order.s !== -1) { + resTime.second = Number(treg[order.s]); + } + if (order.l !== -1) { + resTime.millisec = Number(treg[order.l]); + } + if (order.c !== -1) { + resTime.microsec = Number(treg[order.c]); + } + if (order.z !== -1 && treg[order.z] !== undefined) { + resTime.timezone = $.timepicker.timezoneOffsetNumber(treg[order.z]); + } + + + return resTime; + } + return false; + };// end strictParse + + // First try JS Date, if that fails, use strictParse + var looseParse = function (f, s, o) { + try { + var d = new Date('2012-01-01 ' + s); + if (isNaN(d.getTime())) { + d = new Date('2012-01-01T' + s); + if (isNaN(d.getTime())) { + d = new Date('01/01/2012 ' + s); + if (isNaN(d.getTime())) { + throw "Unable to parse time with native Date: " + s; + } + } + } + + return { + hour: d.getHours(), + minute: d.getMinutes(), + second: d.getSeconds(), + millisec: d.getMilliseconds(), + microsec: d.getMicroseconds(), + timezone: d.getTimezoneOffset() * -1 + }; + } + catch (err) { + try { + return strictParse(f, s, o); + } + catch (err2) { + $.timepicker.log("Unable to parse \ntimeString: " + s + "\ntimeFormat: " + f); + } + } + return false; + }; // end looseParse + + if (typeof o.parse === "function") { + return o.parse(timeFormat, timeString, o); + } + if (o.parse === 'loose') { + return looseParse(timeFormat, timeString, o); + } + return strictParse(timeFormat, timeString, o); + }; + + /** + * Public utility to format the time + * @param {string} format format of the time + * @param {Object} time Object not a Date for timezones + * @param {Object} [options] essentially the regional[].. amNames, pmNames, ampm + * @returns {string} the formatted time + */ + $.datepicker.formatTime = function (format, time, options) { + options = options || {}; + options = $.extend({}, $.timepicker._defaults, options); + time = $.extend({ + hour: 0, + minute: 0, + second: 0, + millisec: 0, + microsec: 0, + timezone: null + }, time); + + var tmptime = format, + ampmName = options.amNames[0], + hour = parseInt(time.hour, 10); + + if (hour > 11) { + ampmName = options.pmNames[0]; + } + + tmptime = tmptime.replace(/(?:HH?|hh?|mm?|ss?|[tT]{1,2}|[zZ]|[lc]|'.*?')/g, function (match) { + switch (match) { + case 'HH': + return ('0' + hour).slice(-2); + case 'H': + return hour; + case 'hh': + return ('0' + convert24to12(hour)).slice(-2); + case 'h': + return convert24to12(hour); + case 'mm': + return ('0' + time.minute).slice(-2); + case 'm': + return time.minute; + case 'ss': + return ('0' + time.second).slice(-2); + case 's': + return time.second; + case 'l': + return ('00' + time.millisec).slice(-3); + case 'c': + return ('00' + time.microsec).slice(-3); + case 'z': + return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, false); + case 'Z': + return $.timepicker.timezoneOffsetString(time.timezone === null ? options.timezone : time.timezone, true); + case 'T': + return ampmName.charAt(0).toUpperCase(); + case 'TT': + return ampmName.toUpperCase(); + case 't': + return ampmName.charAt(0).toLowerCase(); + case 'tt': + return ampmName.toLowerCase(); + default: + return match.replace(/'/g, ""); + } + }); + + return tmptime; + }; + + /* + * the bad hack :/ override datepicker so it doesn't close on select + // inspired: http://stackoverflow.com/questions/1252512/jquery-datepicker-prevent-closing-picker-when-clicking-a-date/1762378#1762378 + */ + $.datepicker._base_selectDate = $.datepicker._selectDate; + $.datepicker._selectDate = function (id, dateStr) { + var inst = this._getInst($(id)[0]), + tp_inst = this._get(inst, 'timepicker'), + was_inline; + + if (tp_inst && inst.settings.showTimepicker) { + tp_inst._limitMinMaxDateTime(inst, true); + was_inline = inst.inline; + inst.inline = inst.stay_open = true; + //This way the onSelect handler called from calendarpicker get the full dateTime + this._base_selectDate(id, dateStr); + inst.inline = was_inline; + inst.stay_open = false; + this._notifyChange(inst); + this._updateDatepicker(inst); + } else { + this._base_selectDate(id, dateStr); + } + }; + + /* + * second bad hack :/ override datepicker so it triggers an event when changing the input field + * and does not redraw the datepicker on every selectDate event + */ + $.datepicker._base_updateDatepicker = $.datepicker._updateDatepicker; + $.datepicker._updateDatepicker = function (inst) { + + // don't popup the datepicker if there is another instance already opened + var input = inst.input[0]; + if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) { + return; + } + + if (typeof(inst.stay_open) !== 'boolean' || inst.stay_open === false) { + + this._base_updateDatepicker(inst); + + // Reload the time control when changing something in the input text field. + var tp_inst = this._get(inst, 'timepicker'); + if (tp_inst) { + tp_inst._addTimePicker(inst); + } + } + }; + + /* + * third bad hack :/ override datepicker so it allows spaces and colon in the input field + */ + $.datepicker._base_doKeyPress = $.datepicker._doKeyPress; + $.datepicker._doKeyPress = function (event) { + var inst = $.datepicker._getInst(event.target), + tp_inst = $.datepicker._get(inst, 'timepicker'); + + if (tp_inst) { + if ($.datepicker._get(inst, 'constrainInput')) { + var ampm = tp_inst.support.ampm, + tz = tp_inst._defaults.showTimezone !== null ? tp_inst._defaults.showTimezone : tp_inst.support.timezone, + dateChars = $.datepicker._possibleChars($.datepicker._get(inst, 'dateFormat')), + datetimeChars = tp_inst._defaults.timeFormat.toString() + .replace(/[hms]/g, '') + .replace(/TT/g, ampm ? 'APM' : '') + .replace(/Tt/g, ampm ? 'AaPpMm' : '') + .replace(/tT/g, ampm ? 'AaPpMm' : '') + .replace(/T/g, ampm ? 'AP' : '') + .replace(/tt/g, ampm ? 'apm' : '') + .replace(/t/g, ampm ? 'ap' : '') + + " " + tp_inst._defaults.separator + + tp_inst._defaults.timeSuffix + + (tz ? tp_inst._defaults.timezoneList.join('') : '') + + (tp_inst._defaults.amNames.join('')) + (tp_inst._defaults.pmNames.join('')) + + dateChars, + chr = String.fromCharCode(event.charCode === undefined ? event.keyCode : event.charCode); + return event.ctrlKey || (chr < ' ' || !dateChars || datetimeChars.indexOf(chr) > -1); + } + } + + return $.datepicker._base_doKeyPress(event); + }; + + /* + * Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField + * Update any alternate field to synchronise with the main field. + */ + $.datepicker._base_updateAlternate = $.datepicker._updateAlternate; + $.datepicker._updateAlternate = function (inst) { + var tp_inst = this._get(inst, 'timepicker'); + if (tp_inst) { + var altField = tp_inst._defaults.altField; + if (altField) { // update alternate field too + var altFormat = tp_inst._defaults.altFormat || tp_inst._defaults.dateFormat, + date = this._getDate(inst), + formatCfg = $.datepicker._getFormatConfig(inst), + altFormattedDateTime = '', + altSeparator = tp_inst._defaults.altSeparator ? tp_inst._defaults.altSeparator : tp_inst._defaults.separator, + altTimeSuffix = tp_inst._defaults.altTimeSuffix ? tp_inst._defaults.altTimeSuffix : tp_inst._defaults.timeSuffix, + altTimeFormat = tp_inst._defaults.altTimeFormat !== null ? tp_inst._defaults.altTimeFormat : tp_inst._defaults.timeFormat; + + altFormattedDateTime += $.datepicker.formatTime(altTimeFormat, tp_inst, tp_inst._defaults) + altTimeSuffix; + if (!tp_inst._defaults.timeOnly && !tp_inst._defaults.altFieldTimeOnly && date !== null) { + if (tp_inst._defaults.altFormat) { + altFormattedDateTime = $.datepicker.formatDate(tp_inst._defaults.altFormat, date, formatCfg) + altSeparator + altFormattedDateTime; + } + else { + altFormattedDateTime = tp_inst.formattedDate + altSeparator + altFormattedDateTime; + } + } + $(altField).val( inst.input.val() ? altFormattedDateTime : ""); + } + } + else { + $.datepicker._base_updateAlternate(inst); + } + }; + + /* + * Override key up event to sync manual input changes. + */ + $.datepicker._base_doKeyUp = $.datepicker._doKeyUp; + $.datepicker._doKeyUp = function (event) { + var inst = $.datepicker._getInst(event.target), + tp_inst = $.datepicker._get(inst, 'timepicker'); + + if (tp_inst) { + if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) { + try { + $.datepicker._updateDatepicker(inst); + } catch (err) { + $.timepicker.log(err); + } + } + } + + return $.datepicker._base_doKeyUp(event); + }; + + /* + * override "Today" button to also grab the time and set it to input field. + */ + $.datepicker._base_gotoToday = $.datepicker._gotoToday; + $.datepicker._gotoToday = function (id) { + var inst = this._getInst($(id)[0]); + this._base_gotoToday(id); + var tp_inst = this._get(inst, 'timepicker'); + if (!tp_inst) { + return; + } + + var tzoffset = $.timepicker.timezoneOffsetNumber(tp_inst.timezone); + var now = new Date(); + now.setMinutes(now.getMinutes() + now.getTimezoneOffset() + parseInt(tzoffset, 10)); + this._setTime(inst, now); + this._setDate(inst, now); + tp_inst._onSelectHandler(); + }; + + /* + * Disable & enable the Time in the datetimepicker + */ + $.datepicker._disableTimepickerDatepicker = function (target) { + var inst = this._getInst(target); + if (!inst) { + return; + } + + var tp_inst = this._get(inst, 'timepicker'); + $(target).datepicker('getDate'); // Init selected[Year|Month|Day] + if (tp_inst) { + inst.settings.showTimepicker = false; + tp_inst._defaults.showTimepicker = false; + tp_inst._updateDateTime(inst); + } + }; + + $.datepicker._enableTimepickerDatepicker = function (target) { + var inst = this._getInst(target); + if (!inst) { + return; + } + + var tp_inst = this._get(inst, 'timepicker'); + $(target).datepicker('getDate'); // Init selected[Year|Month|Day] + if (tp_inst) { + inst.settings.showTimepicker = true; + tp_inst._defaults.showTimepicker = true; + tp_inst._addTimePicker(inst); // Could be disabled on page load + tp_inst._updateDateTime(inst); + } + }; + + /* + * Create our own set time function + */ + $.datepicker._setTime = function (inst, date) { + var tp_inst = this._get(inst, 'timepicker'); + if (tp_inst) { + var defaults = tp_inst._defaults; + + // calling _setTime with no date sets time to defaults + tp_inst.hour = date ? date.getHours() : defaults.hour; + tp_inst.minute = date ? date.getMinutes() : defaults.minute; + tp_inst.second = date ? date.getSeconds() : defaults.second; + tp_inst.millisec = date ? date.getMilliseconds() : defaults.millisec; + tp_inst.microsec = date ? date.getMicroseconds() : defaults.microsec; + + //check if within min/max times.. + tp_inst._limitMinMaxDateTime(inst, true); + + tp_inst._onTimeChange(); + tp_inst._updateDateTime(inst); + } + }; + + /* + * Create new public method to set only time, callable as $().datepicker('setTime', date) + */ + $.datepicker._setTimeDatepicker = function (target, date, withDate) { + var inst = this._getInst(target); + if (!inst) { + return; + } + + var tp_inst = this._get(inst, 'timepicker'); + + if (tp_inst) { + this._setDateFromField(inst); + var tp_date; + if (date) { + if (typeof date === "string") { + tp_inst._parseTime(date, withDate); + tp_date = new Date(); + tp_date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec); + tp_date.setMicroseconds(tp_inst.microsec); + } else { + tp_date = new Date(date.getTime()); + tp_date.setMicroseconds(date.getMicroseconds()); + } + if (tp_date.toString() === 'Invalid Date') { + tp_date = undefined; + } + this._setTime(inst, tp_date); + } + } + + }; + + /* + * override setDate() to allow setting time too within Date object + */ + $.datepicker._base_setDateDatepicker = $.datepicker._setDateDatepicker; + $.datepicker._setDateDatepicker = function (target, _date) { + var inst = this._getInst(target); + var date = _date; + if (!inst) { + return; + } + + if (typeof(_date) === 'string') { + date = new Date(_date); + if (!date.getTime()) { + this._base_setDateDatepicker.apply(this, arguments); + date = $(target).datepicker('getDate'); + } + } + + var tp_inst = this._get(inst, 'timepicker'); + var tp_date; + if (date instanceof Date) { + tp_date = new Date(date.getTime()); + tp_date.setMicroseconds(date.getMicroseconds()); + } else { + tp_date = date; + } + + // This is important if you are using the timezone option, javascript's Date + // object will only return the timezone offset for the current locale, so we + // adjust it accordingly. If not using timezone option this won't matter.. + // If a timezone is different in tp, keep the timezone as is + if (tp_inst && tp_date) { + // look out for DST if tz wasn't specified + if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) { + tp_inst.timezone = tp_date.getTimezoneOffset() * -1; + } + date = $.timepicker.timezoneAdjust(date, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset()), tp_inst.timezone); + tp_date = $.timepicker.timezoneAdjust(tp_date, $.timepicker.timezoneOffsetString(-tp_date.getTimezoneOffset()), tp_inst.timezone); + } + + this._updateDatepicker(inst); + this._base_setDateDatepicker.apply(this, arguments); + this._setTimeDatepicker(target, tp_date, true); + }; + + /* + * override getDate() to allow getting time too within Date object + */ + $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker; + $.datepicker._getDateDatepicker = function (target, noDefault) { + var inst = this._getInst(target); + if (!inst) { + return; + } + + var tp_inst = this._get(inst, 'timepicker'); + + if (tp_inst) { + // if it hasn't yet been defined, grab from field + if (inst.lastVal === undefined) { + this._setDateFromField(inst, noDefault); + } + + var date = this._getDate(inst); + + var currDT = null; + + if (tp_inst.$altInput && tp_inst._defaults.altFieldTimeOnly) { + currDT = tp_inst.$input.val() + ' ' + tp_inst.$altInput.val(); + } + else if (tp_inst.$input.get(0).tagName !== 'INPUT' && tp_inst.$altInput) { + /** + * in case the datetimepicker has been applied to a non-input tag for inline UI, + * and the user has not configured the plugin to display only time in altInput, + * pick current date time from the altInput (and hope for the best, for now, until "ER1" is applied) + * + * @todo ER1. Since altInput can have a totally difference format, convert it to standard format by reading input format from "altFormat" and "altTimeFormat" option values + */ + currDT = tp_inst.$altInput.val(); + } + else { + currDT = tp_inst.$input.val(); + } + + if (date && tp_inst._parseTime(currDT, !inst.settings.timeOnly)) { + date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec); + date.setMicroseconds(tp_inst.microsec); + + // This is important if you are using the timezone option, javascript's Date + // object will only return the timezone offset for the current locale, so we + // adjust it accordingly. If not using timezone option this won't matter.. + if (tp_inst.timezone != null) { + // look out for DST if tz wasn't specified + if (!tp_inst.support.timezone && tp_inst._defaults.timezone === null) { + tp_inst.timezone = date.getTimezoneOffset() * -1; + } + date = $.timepicker.timezoneAdjust(date, tp_inst.timezone, $.timepicker.timezoneOffsetString(-date.getTimezoneOffset())); + } + } + return date; + } + return this._base_getDateDatepicker(target, noDefault); + }; + + /* + * override parseDate() because UI 1.8.14 throws an error about "Extra characters" + * An option in datapicker to ignore extra format characters would be nicer. + */ + $.datepicker._base_parseDate = $.datepicker.parseDate; + $.datepicker.parseDate = function (format, value, settings) { + var date; + try { + date = this._base_parseDate(format, value, settings); + } catch (err) { + // Hack! The error message ends with a colon, a space, and + // the "extra" characters. We rely on that instead of + // attempting to perfectly reproduce the parsing algorithm. + if (err.indexOf(":") >= 0) { + date = this._base_parseDate(format, value.substring(0, value.length - (err.length - err.indexOf(':') - 2)), settings); + $.timepicker.log("Error parsing the date string: " + err + "\ndate string = " + value + "\ndate format = " + format); + } else { + throw err; + } + } + return date; + }; + + /* + * override formatDate to set date with time to the input + */ + $.datepicker._base_formatDate = $.datepicker._formatDate; + $.datepicker._formatDate = function (inst, day, month, year) { + var tp_inst = this._get(inst, 'timepicker'); + if (tp_inst) { + tp_inst._updateDateTime(inst); + return tp_inst.$input.val(); + } + return this._base_formatDate(inst); + }; + + /* + * override options setter to add time to maxDate(Time) and minDate(Time). MaxDate + */ + $.datepicker._base_optionDatepicker = $.datepicker._optionDatepicker; + $.datepicker._optionDatepicker = function (target, name, value) { + var inst = this._getInst(target), + name_clone; + if (!inst) { + return null; + } + + var tp_inst = this._get(inst, 'timepicker'); + if (tp_inst) { + var min = null, + max = null, + onselect = null, + overrides = tp_inst._defaults.evnts, + fns = {}, + prop, + ret, + oldVal, + $target; + if (typeof name === 'string') { // if min/max was set with the string + if (name === 'minDate' || name === 'minDateTime') { + min = value; + } else if (name === 'maxDate' || name === 'maxDateTime') { + max = value; + } else if (name === 'onSelect') { + onselect = value; + } else if (overrides.hasOwnProperty(name)) { + if (typeof (value) === 'undefined') { + return overrides[name]; + } + fns[name] = value; + name_clone = {}; //empty results in exiting function after overrides updated + } + } else if (typeof name === 'object') { //if min/max was set with the JSON + if (name.minDate) { + min = name.minDate; + } else if (name.minDateTime) { + min = name.minDateTime; + } else if (name.maxDate) { + max = name.maxDate; + } else if (name.maxDateTime) { + max = name.maxDateTime; + } + for (prop in overrides) { + if (overrides.hasOwnProperty(prop) && name[prop]) { + fns[prop] = name[prop]; + } + } + } + for (prop in fns) { + if (fns.hasOwnProperty(prop)) { + overrides[prop] = fns[prop]; + if (!name_clone) { name_clone = $.extend({}, name); } + delete name_clone[prop]; + } + } + if (name_clone && isEmptyObject(name_clone)) { return; } + if (min) { //if min was set + if (min === 0) { + min = new Date(); + } else { + min = new Date(min); + } + tp_inst._defaults.minDate = min; + tp_inst._defaults.minDateTime = min; + } else if (max) { //if max was set + if (max === 0) { + max = new Date(); + } else { + max = new Date(max); + } + tp_inst._defaults.maxDate = max; + tp_inst._defaults.maxDateTime = max; + } else if (onselect) { + tp_inst._defaults.onSelect = onselect; + } + + // Datepicker will override our date when we call _base_optionDatepicker when + // calling minDate/maxDate, so we will first grab the value, call + // _base_optionDatepicker, then set our value back. + if(min || max){ + $target = $(target); + oldVal = $target.datetimepicker('getDate'); + ret = this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value); + $target.datetimepicker('setDate', oldVal); + return ret; + } + } + if (value === undefined) { + return this._base_optionDatepicker.call($.datepicker, target, name); + } + return this._base_optionDatepicker.call($.datepicker, target, name_clone || name, value); + }; + + /* + * jQuery isEmptyObject does not check hasOwnProperty - if someone has added to the object prototype, + * it will return false for all objects + */ + var isEmptyObject = function (obj) { + var prop; + for (prop in obj) { + if (obj.hasOwnProperty(prop)) { + return false; + } + } + return true; + }; + + /* + * jQuery extend now ignores nulls! + */ + var extendRemove = function (target, props) { + $.extend(target, props); + for (var name in props) { + if (props[name] === null || props[name] === undefined) { + target[name] = props[name]; + } + } + return target; + }; + + /* + * Determine by the time format which units are supported + * Returns an object of booleans for each unit + */ + var detectSupport = function (timeFormat) { + var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals + isIn = function (f, t) { // does the format contain the token? + return f.indexOf(t) !== -1 ? true : false; + }; + return { + hour: isIn(tf, 'h'), + minute: isIn(tf, 'm'), + second: isIn(tf, 's'), + millisec: isIn(tf, 'l'), + microsec: isIn(tf, 'c'), + timezone: isIn(tf, 'z'), + ampm: isIn(tf, 't') && isIn(timeFormat, 'h'), + iso8601: isIn(timeFormat, 'Z') + }; + }; + + /* + * Converts 24 hour format into 12 hour + * Returns 12 hour without leading 0 + */ + var convert24to12 = function (hour) { + hour %= 12; + + if (hour === 0) { + hour = 12; + } + + return String(hour); + }; + + var computeEffectiveSetting = function (settings, property) { + return settings && settings[property] ? settings[property] : $.timepicker._defaults[property]; + }; + + /* + * Splits datetime string into date and time substrings. + * Throws exception when date can't be parsed + * Returns {dateString: dateString, timeString: timeString} + */ + var splitDateTime = function (dateTimeString, timeSettings) { + // The idea is to get the number separator occurrences in datetime and the time format requested (since time has + // fewer unknowns, mostly numbers and am/pm). We will use the time pattern to split. + var separator = computeEffectiveSetting(timeSettings, 'separator'), + format = computeEffectiveSetting(timeSettings, 'timeFormat'), + timeParts = format.split(separator), // how many occurrences of separator may be in our format? + timePartsLen = timeParts.length, + allParts = dateTimeString.split(separator), + allPartsLen = allParts.length; + + if (allPartsLen > 1) { + return { + dateString: allParts.splice(0, allPartsLen - timePartsLen).join(separator), + timeString: allParts.splice(0, timePartsLen).join(separator) + }; + } + + return { + dateString: dateTimeString, + timeString: '' + }; + }; + + /* + * Internal function to parse datetime interval + * Returns: {date: Date, timeObj: Object}, where + * date - parsed date without time (type Date) + * timeObj = {hour: , minute: , second: , millisec: , microsec: } - parsed time. Optional + */ + var parseDateTimeInternal = function (dateFormat, timeFormat, dateTimeString, dateSettings, timeSettings) { + var date, + parts, + parsedTime; + + parts = splitDateTime(dateTimeString, timeSettings); + date = $.datepicker._base_parseDate(dateFormat, parts.dateString, dateSettings); + + if (parts.timeString === '') { + return { + date: date + }; + } + + parsedTime = $.datepicker.parseTime(timeFormat, parts.timeString, timeSettings); + + if (!parsedTime) { + throw 'Wrong time format'; + } + + return { + date: date, + timeObj: parsedTime + }; + }; + + /* + * Internal function to set timezone_select to the local timezone + */ + var selectLocalTimezone = function (tp_inst, date) { + if (tp_inst && tp_inst.timezone_select) { + var now = date || new Date(); + tp_inst.timezone_select.val(-now.getTimezoneOffset()); + } + }; + + /* + * Create a Singleton Instance + */ + $.timepicker = new Timepicker(); + + /** + * Get the timezone offset as string from a date object (eg '+0530' for UTC+5.5) + * @param {number} tzMinutes if not a number, less than -720 (-1200), or greater than 840 (+1400) this value is returned + * @param {boolean} iso8601 if true formats in accordance to iso8601 "+12:45" + * @return {string} + */ + $.timepicker.timezoneOffsetString = function (tzMinutes, iso8601) { + if (isNaN(tzMinutes) || tzMinutes > 840 || tzMinutes < -720) { + return tzMinutes; + } + + var off = tzMinutes, + minutes = off % 60, + hours = (off - minutes) / 60, + iso = iso8601 ? ':' : '', + tz = (off >= 0 ? '+' : '-') + ('0' + Math.abs(hours)).slice(-2) + iso + ('0' + Math.abs(minutes)).slice(-2); + + if (tz === '+00:00') { + return 'Z'; + } + return tz; + }; + + /** + * Get the number in minutes that represents a timezone string + * @param {string} tzString formatted like "+0500", "-1245", "Z" + * @return {number} the offset minutes or the original string if it doesn't match expectations + */ + $.timepicker.timezoneOffsetNumber = function (tzString) { + var normalized = tzString.toString().replace(':', ''); // excuse any iso8601, end up with "+1245" + + if (normalized.toUpperCase() === 'Z') { // if iso8601 with Z, its 0 minute offset + return 0; + } + + if (!/^(\-|\+)\d{4}$/.test(normalized)) { // possibly a user defined tz, so just give it back + return parseInt(tzString, 10); + } + + return ((normalized.substr(0, 1) === '-' ? -1 : 1) * // plus or minus + ((parseInt(normalized.substr(1, 2), 10) * 60) + // hours (converted to minutes) + parseInt(normalized.substr(3, 2), 10))); // minutes + }; + + /** + * No way to set timezone in js Date, so we must adjust the minutes to compensate. (think setDate, getDate) + * @param {Date} date + * @param {string} fromTimezone formatted like "+0500", "-1245" + * @param {string} toTimezone formatted like "+0500", "-1245" + * @return {Date} + */ + $.timepicker.timezoneAdjust = function (date, fromTimezone, toTimezone) { + var fromTz = $.timepicker.timezoneOffsetNumber(fromTimezone); + var toTz = $.timepicker.timezoneOffsetNumber(toTimezone); + if (!isNaN(toTz)) { + date.setMinutes(date.getMinutes() + (-fromTz) - (-toTz)); + } + return date; + }; + + /** + * Calls `timepicker()` on the `startTime` and `endTime` elements, and configures them to + * enforce date range limits. + * n.b. The input value must be correctly formatted (reformatting is not supported) + * @param {Element} startTime + * @param {Element} endTime + * @param {Object} options Options for the timepicker() call + * @return {jQuery} + */ + $.timepicker.timeRange = function (startTime, endTime, options) { + return $.timepicker.handleRange('timepicker', startTime, endTime, options); + }; + + /** + * Calls `datetimepicker` on the `startTime` and `endTime` elements, and configures them to + * enforce date range limits. + * @param {Element} startTime + * @param {Element} endTime + * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`, + * a boolean value that can be used to reformat the input values to the `dateFormat`. + * @param {string} method Can be used to specify the type of picker to be added + * @return {jQuery} + */ + $.timepicker.datetimeRange = function (startTime, endTime, options) { + $.timepicker.handleRange('datetimepicker', startTime, endTime, options); + }; + + /** + * Calls `datepicker` on the `startTime` and `endTime` elements, and configures them to + * enforce date range limits. + * @param {Element} startTime + * @param {Element} endTime + * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`, + * a boolean value that can be used to reformat the input values to the `dateFormat`. + * @return {jQuery} + */ + $.timepicker.dateRange = function (startTime, endTime, options) { + $.timepicker.handleRange('datepicker', startTime, endTime, options); + }; + + /** + * Calls `method` on the `startTime` and `endTime` elements, and configures them to + * enforce date range limits. + * @param {string} method Can be used to specify the type of picker to be added + * @param {Element} startTime + * @param {Element} endTime + * @param {Object} options Options for the `timepicker()` call. Also supports `reformat`, + * a boolean value that can be used to reformat the input values to the `dateFormat`. + * @return {jQuery} + */ + $.timepicker.handleRange = function (method, startTime, endTime, options) { + options = $.extend({}, { + minInterval: 0, // min allowed interval in milliseconds + maxInterval: 0, // max allowed interval in milliseconds + start: {}, // options for start picker + end: {} // options for end picker + }, options); + + // for the mean time this fixes an issue with calling getDate with timepicker() + var timeOnly = false; + if(method === 'timepicker'){ + timeOnly = true; + method = 'datetimepicker'; + } + + function checkDates(changed, other) { + var startdt = startTime[method]('getDate'), + enddt = endTime[method]('getDate'), + changeddt = changed[method]('getDate'); + + if (startdt !== null) { + var minDate = new Date(startdt.getTime()), + maxDate = new Date(startdt.getTime()); + + minDate.setMilliseconds(minDate.getMilliseconds() + options.minInterval); + maxDate.setMilliseconds(maxDate.getMilliseconds() + options.maxInterval); + + if (options.minInterval > 0 && minDate > enddt) { // minInterval check + endTime[method]('setDate', minDate); + } + else if (options.maxInterval > 0 && maxDate < enddt) { // max interval check + endTime[method]('setDate', maxDate); + } + else if (startdt > enddt) { + other[method]('setDate', changeddt); + } + } + } + + function selected(changed, other, option) { + if (!changed.val()) { + return; + } + var date = changed[method].call(changed, 'getDate'); + if (date !== null && options.minInterval > 0) { + if (option === 'minDate') { + date.setMilliseconds(date.getMilliseconds() + options.minInterval); + } + if (option === 'maxDate') { + date.setMilliseconds(date.getMilliseconds() - options.minInterval); + } + } + + if (date.getTime) { + other[method].call(other, 'option', option, date); + } + } + + $.fn[method].call(startTime, $.extend({ + timeOnly: timeOnly, + onClose: function (dateText, inst) { + checkDates($(this), endTime); + }, + onSelect: function (selectedDateTime) { + selected($(this), endTime, 'minDate'); + } + }, options, options.start)); + $.fn[method].call(endTime, $.extend({ + timeOnly: timeOnly, + onClose: function (dateText, inst) { + checkDates($(this), startTime); + }, + onSelect: function (selectedDateTime) { + selected($(this), startTime, 'maxDate'); + } + }, options, options.end)); + + checkDates(startTime, endTime); + + selected(startTime, endTime, 'minDate'); + selected(endTime, startTime, 'maxDate'); + + return $([startTime.get(0), endTime.get(0)]); + }; + + /** + * Log error or data to the console during error or debugging + * @param {Object} err pass any type object to log to the console during error or debugging + * @return {void} + */ + $.timepicker.log = function () { + // Older IE (9, maybe 10) throw error on accessing `window.console.log.apply`, so check first. + if (window.console && window.console.log && window.console.log.apply) { + window.console.log.apply(window.console, Array.prototype.slice.call(arguments)); + } + }; + + /* + * Add util object to allow access to private methods for testability. + */ + $.timepicker._util = { + _extendRemove: extendRemove, + _isEmptyObject: isEmptyObject, + _convert24to12: convert24to12, + _detectSupport: detectSupport, + _selectLocalTimezone: selectLocalTimezone, + _computeEffectiveSetting: computeEffectiveSetting, + _splitDateTime: splitDateTime, + _parseDateTimeInternal: parseDateTimeInternal + }; + + /* + * Microsecond support + */ + if (!Date.prototype.getMicroseconds) { + Date.prototype.microseconds = 0; + Date.prototype.getMicroseconds = function () { return this.microseconds; }; + Date.prototype.setMicroseconds = function (m) { + this.setMilliseconds(this.getMilliseconds() + Math.floor(m / 1000)); + this.microseconds = m % 1000; + return this; + }; + } + + /* + * Keep up with the version + */ + $.timepicker.version = "1.6.3"; + +})); diff --git a/phpMyAdmin/js/vendor/jquery/jquery-ui.min.js b/phpMyAdmin/js/vendor/jquery/jquery-ui.min.js new file mode 100755 index 0000000..5061a73 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery-ui.min.js @@ -0,0 +1,13 @@ +/*! jQuery UI - v1.12.1 - 2016-12-18 +* http://jqueryui.com +* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(p.inline?p.dpDiv.parent()[0]:p.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{},t.ui.version="1.12.1";var h=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},h=e.split(".")[0];e=e.split(".")[1];var l=h+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][l.toLowerCase()]=function(e){return!!t.data(e,l)},t[h]=t[h]||{},n=t[h][e],o=t[h][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:h,widgetName:e,widgetFullName:l}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=h++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.uniqueSort(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var h=s.match(/^([\w:-]*)\s*(.*)$/),l=h[1]+o.eventNamespace,c=h[2];c?n.on(l,c,r):i.on(l,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,h=/top|center|bottom/,l=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):h.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=h.test(i[1])?i[1]:"center",t=l.exec(i[0]),e=l.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,h=t(this),l=h.outerWidth(),c=h.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=l+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),I=e(k.my,h.outerWidth(),h.outerHeight());"right"===n.my[0]?D.left-=l:"center"===n.my[0]&&(D.left-=l/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=I[0],D.top+=I[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:l,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+I[0],u[1]+I[1]],my:n.my,at:n.at,within:b,elem:h})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-l,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:h,left:D.left,top:D.top,width:l,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};l>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),h.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-r-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-r-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-h,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,h,l=i.nodeName.toLowerCase();return"area"===l?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(l)?(r=!i.disabled,r&&(h=t(i).closest("fieldset")[0],h&&(r=!h.disabled))):r="a"===l?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var c=!1;t(document).on("mouseup",function(){c=!1}),t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){return!0===t.data(i.target,e.widgetName+".preventClickEvent")?(t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):void 0}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!c){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,s=1===e.which,n="string"==typeof this.options.cancel&&e.target.nodeName?t(e.target).closest(this.options.cancel).length:!1;return s&&!n&&this._mouseCapture(e)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(e)!==!1,!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),c=!0,!0)):!0}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||9>document.documentMode)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,e)!==!1,this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,c=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,s){var n,o=t.ui[e].prototype;for(n in s)o.plugins[n]=o.plugins[n]||[],o.plugins[n].push([i,s[n]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;o.length>n;n++)t.options[o[n][0]]&&o[n][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")},t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){return(this.helper||this.element).is(".ui-draggable-dragging")?(this.destroyOnClear=!0,void 0):(this._removeHandleClassName(),this._mouseDestroy(),void 0)},_mouseCapture:function(e){var i=this.options;return this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0?!1:(this.handle=this._getHandle(e),this.handle?(this._blurActiveElement(e),this._blockFrames(i.iframeFix===!0?"iframe":i.iframeFix),!0):!1)},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0]),s=t(e.target);s.closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",e)===!1?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",e,s)===!1)return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=s.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,s=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(s=t.ui.ddmanager.drop(this,e)),this.dropped&&(s=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",e)!==!1&&i._clear()}):this._trigger("stop",e)!==!1&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return this.options.handle?!!t(e.target).closest(this.element.find(this.options.handle)).length:!0},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper),n=s?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return n.parents("body").length||n.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s&&n[0]===this.element[0]&&this._setPositionRelative(),n[0]===this.element[0]||/(fixed|absolute)/.test(n.css("position"))||n.css("position","absolute"),n},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options,o=this.document[0];return this.relativeContainer=null,n.containment?"window"===n.containment?(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):"document"===n.containment?(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],void 0):n.containment.constructor===Array?(this.containment=n.containment,void 0):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=t(n.containment),s=i[0],s&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i),void 0):(this.containment=null,void 0) +},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,s=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:s?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:s?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,s,n,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),h=t.pageX,l=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(s=this.relativeContainer.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(h=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(l=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(e,i,s){return s=s||this._uiHash(),t.ui.plugin.call(this,e,[i,s,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,s){var n=t.extend({},i,{item:s.element});s.sortables=[],t(s.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(s.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,n))})},stop:function(e,i,s){var n=t.extend({},i,{item:s.element});s.cancelHelperRemoval=!1,t.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,n))})},drag:function(e,i,s){t.each(s.sortables,function(){var n=!1,o=this;o.positionAbs=s.positionAbs,o.helperProportions=s.helperProportions,o.offset.click=s.offset.click,o._intersectsWith(o.containerCache)&&(n=!0,t.each(s.sortables,function(){return this.positionAbs=s.positionAbs,this.helperProportions=s.helperProportions,this.offset.click=s.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(n=!1),n})),n?(o.isOver||(o.isOver=1,s._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=s.offset.click.top,o.offset.click.left=s.offset.click.left,o.offset.parent.left-=s.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=s.offset.parent.top-o.offset.parent.top,s._trigger("toSortable",e),s.dropped=o.element,t.each(s.sortables,function(){this.refreshPositions()}),s.currentItem=s.element,o.fromOutside=s),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(s._parent),s._refreshOffsets(e),i.position=s._generatePosition(e,!0),s._trigger("fromSortable",e),s.dropped=!1,t.each(s.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,s){var n=t("body"),o=s.options;n.css("cursor")&&(o._cursor=n.css("cursor")),n.css("cursor",o.cursor)},stop:function(e,i,s){var n=s.options;n._cursor&&t("body").css("cursor",n._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("opacity")&&(o._opacity=n.css("opacity")),n.css("opacity",o.opacity)},stop:function(e,i,s){var n=s.options;n._opacity&&t(i.helper).css("opacity",n._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,s){var n=s.options,o=!1,a=s.scrollParentNotHidden[0],r=s.document[0];a!==r&&"HTML"!==a.tagName?(n.axis&&"x"===n.axis||(s.overflowOffset.top+a.offsetHeight-e.pageY<n.scrollSensitivity?a.scrollTop=o=a.scrollTop+n.scrollSpeed:e.pageY-s.overflowOffset.top<n.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-n.scrollSpeed)),n.axis&&"y"===n.axis||(s.overflowOffset.left+a.offsetWidth-e.pageX<n.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+n.scrollSpeed:e.pageX-s.overflowOffset.left<n.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-n.scrollSpeed))):(n.axis&&"x"===n.axis||(e.pageY-t(r).scrollTop()<n.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-n.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<n.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+n.scrollSpeed))),n.axis&&"y"===n.axis||(e.pageX-t(r).scrollLeft()<n.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-n.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<n.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+n.scrollSpeed)))),o!==!1&&t.ui.ddmanager&&!n.dropBehaviour&&t.ui.ddmanager.prepareOffsets(s,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,s){var n=s.options;s.snapElements=[],t(n.snap.constructor!==String?n.snap.items||":data(ui-draggable)":n.snap).each(function(){var e=t(this),i=e.offset();this!==s.element[0]&&s.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,s){var n,o,a,r,h,l,c,u,d,p,f=s.options,g=f.snapTolerance,m=i.offset.left,_=m+s.helperProportions.width,v=i.offset.top,b=v+s.helperProportions.height;for(d=s.snapElements.length-1;d>=0;d--)h=s.snapElements[d].left-s.margins.left,l=h+s.snapElements[d].width,c=s.snapElements[d].top-s.margins.top,u=c+s.snapElements[d].height,h-g>_||m>l+g||c-g>b||v>u+g||!t.contains(s.snapElements[d].item.ownerDocument,s.snapElements[d].item)?(s.snapElements[d].snapping&&s.options.snap.release&&s.options.snap.release.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=!1):("inner"!==f.snapMode&&(n=g>=Math.abs(c-b),o=g>=Math.abs(u-v),a=g>=Math.abs(h-_),r=g>=Math.abs(l-m),n&&(i.position.top=s._convertPositionTo("relative",{top:c-s.helperProportions.height,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h-s.helperProportions.width}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l}).left)),p=n||o||a||r,"outer"!==f.snapMode&&(n=g>=Math.abs(c-v),o=g>=Math.abs(u-b),a=g>=Math.abs(h-m),r=g>=Math.abs(l-_),n&&(i.position.top=s._convertPositionTo("relative",{top:c,left:0}).top),o&&(i.position.top=s._convertPositionTo("relative",{top:u-s.helperProportions.height,left:0}).top),a&&(i.position.left=s._convertPositionTo("relative",{top:0,left:h}).left),r&&(i.position.left=s._convertPositionTo("relative",{top:0,left:l-s.helperProportions.width}).left)),!s.snapElements[d].snapping&&(n||o||a||r||p)&&s.options.snap.snap&&s.options.snap.snap.call(s.element,e,t.extend(s._uiHash(),{snapItem:s.snapElements[d].item})),s.snapElements[d].snapping=n||o||a||r||p)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,s){var n,o=s.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(n=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",n+e)}),this.css("zIndex",n+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,s){var n=t(i.helper),o=s.options;n.css("zIndex")&&(o._zIndex=n.css("zIndex")),n.css("zIndex",o.zIndex)},stop:function(e,i,s){var n=s.options;n._zIndex&&t(i.helper).css("zIndex",n._zIndex)}}),t.ui.draggable,t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,s=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(s)?s:function(t){return t.is(s)},this.proportions=function(){return arguments.length?(e=arguments[0],void 0):e?e:e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;t.length>e;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var s=t.ui.ddmanager.droppables[this.options.scope];this._splice(s),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var s=i||t.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");return i.options.greedy&&!i.options.disabled&&i.options.scope===s.options.scope&&i.accept.call(i.element[0],s.currentItem||s.element)&&u(s,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e)?(n=!0,!1):void 0}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(s)),this.element):!1):!1},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var u=t.ui.intersect=function(){function t(t,e,i){return t>=e&&e+i>t}return function(e,i,s,n){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,r=o+e.helperProportions.width,h=a+e.helperProportions.height,l=i.offset.left,c=i.offset.top,u=l+i.proportions().width,d=c+i.proportions().height;switch(s){case"fit":return o>=l&&u>=r&&a>=c&&d>=h;case"intersect":return o+e.helperProportions.width/2>l&&u>r-e.helperProportions.width/2&&a+e.helperProportions.height/2>c&&d>h-e.helperProportions.height/2;case"pointer":return t(n.pageY,c,i.proportions().height)&&t(n.pageX,l,i.proportions().width);case"touch":return(a>=c&&d>=a||h>=c&&d>=h||c>a&&h>d)&&(o>=l&&u>=o||r>=l&&u>=r||l>o&&r>u);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(e,i){var s,n,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(s=0;o.length>s;s++)if(!(o[s].options.disabled||e&&!o[s].accept.call(o[s].element[0],e.currentItem||e.element))){for(n=0;r.length>n;n++)if(r[n]===o[s].element[0]){o[s].proportions().height=0;continue t}o[s].visible="none"!==o[s].element.css("display"),o[s].visible&&("mousedown"===a&&o[s]._activate.call(o[s],i),o[s].offset=o[s].element.offset(),o[s].proportions({width:o[s].element[0].offsetWidth,height:o[s].element[0].offsetHeight}))}},drop:function(e,i){var s=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&u(e,this,this.options.tolerance,i)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,o,a=u(e,this,this.options.tolerance,i),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===n}),o.length&&(s=t(o[0]).droppable("instance"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},t.uiBackCompat!==!1&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}}),t.ui.droppable,t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",n=!1;return e[s]>0?!0:(e[s]=1,n=e[s]>0,e[s]=0,n)},_create:function(){var e,i=this.options,s=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(s._removeClass("ui-resizable-autohide"),s._handles.show())}).on("mouseleave",function(){i.disabled||s.resizing||(s._addClass("ui-resizable-autohide"),s._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;default:}},_setupHandles:function(){var e,i,s,n,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),s=this.handles.split(","),this.handles={},i=0;s.length>i;i++)e=t.trim(s[i]),n="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+n),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,s,n,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(n,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,s,n=!1;for(i in this.handles)s=t(this.handles[i])[0],(s===e.target||t.contains(s,e.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(e){var i,s,n,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),s=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,s+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:s},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:s},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,n=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===n?this.axis+"-resize":n),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,s,n=this.originalMousePosition,o=this.axis,a=e.pageX-n.left||0,r=e.pageY-n.top||0,h=this._change[o];return this._updatePrevProperties(),h?(i=h.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1):!1},_mouseStop:function(e){this.resizing=!1;var i,s,n,o,a,r,h,l=this.options,c=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&this._hasScroll(i[0],"left")?0:c.sizeDiff.height,o=s?0:c.sizeDiff.width,a={width:c.helper.width()-o,height:c.helper.height()-n},r=parseFloat(c.element.css("left"))+(c.position.left-c.originalPosition.left)||null,h=parseFloat(c.element.css("top"))+(c.position.top-c.originalPosition.top)||null,l.animate||this.element.css(t.extend(a,{top:h,left:r})),c.helper.height(c.size.height),c.helper.width(c.size.width),this._helper&&!l.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),o.maxWidth>i&&(o.maxWidth=i),o.maxHeight>n&&(o.maxHeight=n)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,s=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===s&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===s&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){var e=this._vBoundaries,i=this.axis,s=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,n=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];4>e;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;this._proportionallyResizeElements.length>e;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize,s=this.originalPosition;return{left:s.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},sw:function(e,i,s){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,s]))},ne:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,s]))},nw:function(e,i,s){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,s]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),s=i.options,n=i._proportionallyResizeElements,o=n.length&&/textarea/i.test(n[0].nodeName),a=o&&i._hasScroll(n[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-a},l=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,c=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(h,c&&l?{top:c,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};n&&n.length&&t(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,s,n,o,a,r,h=t(this).resizable("instance"),l=h.options,c=h.element,u=l.containment,d=u instanceof t?u.get(0):/parent/.test(u)?c.parent().get(0):u;d&&(h.containerElement=t(d),/document/.test(u)||u===document?(h.containerOffset={left:0,top:0},h.containerPosition={left:0,top:0},h.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,s){i[t]=h._num(e.css("padding"+s))}),h.containerOffset=e.offset(),h.containerPosition=e.position(),h.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},s=h.containerOffset,n=h.containerSize.height,o=h.containerSize.width,a=h._hasScroll(d,"left")?d.scrollWidth:o,r=h._hasScroll(d)?d.scrollHeight:n,h.parentData={element:d,left:s.left,top:s.top,width:a,height:r}))},resize:function(e){var i,s,n,o,a=t(this).resizable("instance"),r=a.options,h=a.containerOffset,l=a.position,c=a._aspectRatio||e.shiftKey,u={top:0,left:0},d=a.containerElement,p=!0;d[0]!==document&&/static/.test(d.css("position"))&&(u=h),l.left<(a._helper?h.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-h.left:a.position.left-u.left),c&&(a.size.height=a.size.width/a.aspectRatio,p=!1),a.position.left=r.helper?h.left:0),l.top<(a._helper?h.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-h.top:a.position.top),c&&(a.size.width=a.size.height*a.aspectRatio,p=!1),a.position.top=a._helper?h.top:0),n=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),n&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-u.left:a.offset.left-h.left)),s=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-u.top:a.offset.top-h.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,c&&(a.size.height=a.size.width/a.aspectRatio,p=!1)),s+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-s,c&&(a.size.width=a.size.height*a.aspectRatio,p=!1)),p||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),h=a.outerWidth()-e.sizeDiff.width,l=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var s=t(this).resizable("instance"),n=s.options,o=s.originalSize,a=s.originalPosition,r={height:s.size.height-o.height||0,width:s.size.width-o.width||0,top:s.position.top-a.top||0,left:s.position.left-a.left||0}; +t(n.alsoResize).each(function(){var e=t(this),s=t(this).data("ui-resizable-alsoresize"),n={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(s[e]||0)+(r[e]||0);i&&i>=0&&(n[e]=i||null)}),e.css(n)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),t.uiBackCompat!==!1&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),s=i.options,n=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,h="number"==typeof s.grid?[s.grid,s.grid]:s.grid,l=h[0]||1,c=h[1]||1,u=Math.round((n.width-o.width)/l)*l,d=Math.round((n.height-o.height)/c)*c,p=o.width+u,f=o.height+d,g=s.maxWidth&&p>s.maxWidth,m=s.maxHeight&&f>s.maxHeight,_=s.minWidth&&s.minWidth>p,v=s.minHeight&&s.minHeight>f;s.grid=h,_&&(p+=l),v&&(f+=c),g&&(p-=l),m&&(f-=c),/^(se|s|e)$/.test(r)?(i.size.width=p,i.size.height=f):/^(ne)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=p,i.size.height=f,i.position.left=a.left-u):((0>=f-c||0>=p-l)&&(e=i._getPaddingPlusBorderDimensions(this)),f-c>0?(i.size.height=f,i.position.top=a.top-d):(f=c-e.height,i.size.height=f,i.position.top=a.top+o.height-f),p-l>0?(i.size.width=p,i.position.left=a.left-u):(p=l-e.width,i.size.width=p,i.position.left=a.left+o.width-p))}}),t.ui.resizable,t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),s=i.offset(),n={left:s.left-e.elementPos.left,top:s.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:n.left,top:n.top,right:n.left+i.outerWidth(),bottom:n.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,s=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(s.filter,this.element[0]),this._trigger("start",e),t(s.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=t.data(this,"selectable-item");s.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(s.$element,"ui-selected"),s.selected=!1,i._addClass(s.$element,"ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",e,{unselecting:s.element}))}),t(e.target).parents().addBack().each(function(){var s,n=t.data(this,"selectable-item");return n?(s=!e.metaKey&&!e.ctrlKey||!n.$element.hasClass("ui-selected"),i._removeClass(n.$element,s?"ui-unselecting":"ui-selected")._addClass(n.$element,s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",e,{selecting:n.element}):i._trigger("unselecting",e,{unselecting:n.element}),!1):void 0}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,h=e.pageY;return o>r&&(i=r,r=o,o=i),a>h&&(i=h,h=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:h-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),l=!1,c={};i&&i.element!==s.element[0]&&(c.left=i.left+s.elementPos.left,c.right=i.right+s.elementPos.left,c.top=i.top+s.elementPos.top,c.bottom=i.bottom+s.elementPos.top,"touch"===n.tolerance?l=!(c.left>r||o>c.right||c.top>h||a>c.bottom):"fit"===n.tolerance&&(l=c.left>o&&r>c.right&&c.top>a&&h>c.bottom),l?(i.selected&&(s._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(s._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(s._addClass(i.$element,"ui-selecting"),i.selecting=!0,s._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,s._addClass(i.$element,"ui-selected"),i.selected=!0):(s._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(s._removeClass(i.$element,"ui-selected"),i.selected=!1,s._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",e,{unselected:s.element})}),t(".ui-selecting",this.element[0]).each(function(){var s=t.data(this,"selectable-item");i._removeClass(s.$element,"ui-selecting")._addClass(s.$element,"ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",e,{selected:s.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return t>=e&&e+i>t},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var s=null,n=!1,o=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,o.widgetName+"-item")===o?(s=t(this),!1):void 0}),t.data(e.target,o.widgetName+"-item")===o&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),r!==!1&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(s=this.items[i],n=s.item[0],o=this._intersectsWithPointer(s),o&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===o?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>o&&a>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>o&&a>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var e,i,s="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),n="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width),o=s&&n;return o?(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1)):!1},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),s=this._getDragVerticalDirection(),n=this._getDragHorizontalDirection();return this.floating&&n?"right"===n&&i||"left"===n&&!i:s&&("down"===s&&e||"up"===s&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var s,n,o,a,r=[],h=[],l=this._connectWith();if(l&&e)for(s=l.length-1;s>=0;s--)for(o=t(l[s],this.document[0]),n=o.length-1;n>=0;n--)a=t.data(o[n],this.widgetFullName),a&&a!==this&&!a.options.disabled&&h.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(h.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),s=h.length-1;s>=0;s--)h[s][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,o,a,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i],this.document[0]),s=n.length-1;s>=0;s--)o=t.data(n[s],this.widgetFullName),o&&o!==this&&!o.options.disabled&&(u.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=u.length-1;i>=0;i--)for(a=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",a),c.push({item:h,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=this.items.length?"x"===this.options.axis||this._isFloating(this.items[0].item):!1,this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,o;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),o=n.offset(),s.left=o.left,s.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]);return e._addClass(n,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(n,"ui-sortable-helper"),"tbody"===s?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(n)):"tr"===s?e._createTrPlaceholder(e.currentItem,n):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var s=this;e.children().each(function(){t("<td> </td>",s.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,s,n,o,a,r,h,l,c,u,d=null,p=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],p=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[p].containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1);else{for(n=1e4,o=null,c=d.floating||this._isFloating(this.currentItem),a=c?"left":"top",r=c?"width":"height",u=c?"pageX":"pageY",s=this.items.length-1;s>=0;s--)t.contains(this.containers[p].element[0],this.items[s].item[0])&&this.items[s].item[0]!==this.currentItem[0]&&(h=this.items[s].item.offset()[a],l=!1,e[u]-h>this.items[s][r]/2&&(l=!0),n>Math.abs(e[u]-h)&&(n=Math.abs(e[u]-h),o=this.items[s],this.direction=l?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[p])return this.currentContainer.containerCache.over||(this.containers[p]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1),void 0;o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[p].element,!0),this._trigger("change",e,this._uiHash()),this.containers[p]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[p],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[p]._trigger("over",e,this._uiHash(this)),this.containers[p].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===n.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===n.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/n.grid[1])*n.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((o-this.originalPageX)/n.grid[0])*n.grid[0],o=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){function i(t,e,i){return function(s){i._trigger(t,s,e._uiHash(e))}}this.reverting=!1;var s,n=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(s in this._storedCSS)("auto"===this._storedCSS[s]||"static"===this._storedCSS[s])&&(this._storedCSS[s]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&n.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||n.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(n.push(function(t){this._trigger("remove",t,this._uiHash())}),n.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),n.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),s=this.containers.length-1;s>=0;s--)e||n.push(i("deactivate",this,this.containers[s])),this.containers[s].containerCache.over&&(n.push(i("out",this,this.containers[s])),this.containers[s].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(s=0;n.length>s;s++)n[s].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||e.active!==!1&&null!=e.active||(e.active=0),this._processPanels(),0>e.active&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,s=this.options.icons;s&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+s.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,s.header)._addClass(i,null,s.activeHeader)._addClass(this.headers,"ui-accordion-icons")) +},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||this.options.active!==!1||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons()),void 0)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,s=this.headers.length,n=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(n+1)%s];break;case i.LEFT:case i.UP:o=this.headers[(n-1+s)%s];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[s-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),e.active===!1&&e.collapsible===!0||!this.headers.length?(e.active=!1,this.active=t()):e.active===!1?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,s=i.heightStyle,n=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),s=e.next(),n=s.uniqueId().attr("id");e.attr("aria-controls",n),s.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===s?(e=n.height(),this.element.siblings(":visible").each(function(){var i=t(this),s=i.css("position");"absolute"!==s&&"fixed"!==s&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===s&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,s,n=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],h=r&&n.collapsible,l=h?t():a.next(),c=o.next(),u={oldHeader:o,oldPanel:c,newHeader:h?t():a,newPanel:l};e.preventDefault(),r&&!n.collapsible||this._trigger("beforeActivate",e,u)===!1||(n.active=h?!1:this.headers.index(a),this.active=r?t():a,this._toggle(u),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),n.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,n.icons.activeHeader)._addClass(i,null,n.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),n.icons&&(s=a.children(".ui-accordion-header-icon"),this._removeClass(s,null,n.icons.header)._addClass(s,null,n.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,s=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=s,this.options.animate?this._animate(i,s,e):(s.hide(),i.show(),this._toggleComplete(e)),s.attr({"aria-hidden":"true"}),s.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&s.length?s.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!e.length||t.index()<e.index()),c=this.options.animate||{},u=l&&c.down||c,d=function(){a._toggleComplete(i)};return"number"==typeof u&&(o=u),"string"==typeof u&&(n=u),n=n||u.easing||c.easing,o=o||u.duration||c.duration,e.length?t.length?(s=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:n,step:function(t,e){e.now=Math.round(t)}}),t.hide().animate(this.showProps,{duration:o,easing:n,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===h&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(s-e.outerHeight()-r),r=0)}}),void 0):e.animate(this.hideProps,o,n,d):t.animate(this.showProps,o,n,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),s=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&s.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),s=t(e.currentTarget);i[0]===s[0]&&(this._removeClass(s.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,s))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){var i=!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]));i&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,s,n,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,s=this.previousFilter||"",o=!1,n=e.keyCode>=96&&105>=e.keyCode?""+(e.keyCode-96):String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),n===s?o=!0:n=s+n,i=this._filterMenuItems(n),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(n=String.fromCharCode(e.keyCode),i=this._filterMenuItems(n)),i.length?(this.focus(e,i),this.previousFilter=n,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,s,n,o,a=this,r=this.options.icons.submenu,h=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),s=h.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),s=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(s,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(s),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(s,"ui-menu","ui-widget ui-widget-content ui-front"),e=h.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),n=i.not(".ui-menu-item, .ui-menu-divider"),o=n.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(n,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t+""),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),0>n?this.activeMenu.scrollTop(o+n):n+r>a&&this.activeMenu.scrollTop(o+n-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this._removeClass(s.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.find(this.options.items)[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]())),void 0):(this.next(e),void 0)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first())),void 0):(this.next(e),void 0)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),s=RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return s.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}}),t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),o="textarea"===n,a="input"===n;this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,void 0;e=!1,s=!1,i=!1;var o=t.ui.keyCode;switch(n.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",n);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case o.UP:e=!0,this._keyEvent("previous",n);break;case o.DOWN:e=!0,this._keyEvent("next",n);break;case o.ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case o.TAB:this.menu.active&&this.menu.select(n);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),void 0;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),void 0):(this._searchTimeout(t),void 0)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(clearTimeout(this.searching),this.close(t),this._change(t),void 0)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var s,n;return this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type))?(this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),void 0):(n=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:n})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(n.value),s=i.item.attr("aria-label")||n.value,s&&t.trim(s).length&&(this.liveRegion.children().hide(),t("<div>").text(s).appendTo(this.liveRegion)),void 0)},menuselect:function(e,i){var s=i.item.data("ui-autocomplete-item"),n=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n,this.selectedItem=s})),!1!==this._trigger("select",e,{item:s})&&this._value(s.value),this.term=this._value(),this.close(e),this.selectedItem=s}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),s=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;(!e||e&&!i&&!s)&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),this.pending--,this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur(),void 0):(this.menu[t](e),void 0):(this.search(null,e),void 0)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}}),t.ui.autocomplete;var d=/ui-corner-([a-z]){2,6}/g;t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(s,n){var o,a={};return n?"controlgroupLabel"===s?(o=e.element.find(n),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),i=i.concat(o.get()),void 0):(t.fn[s]&&(a=e["_"+s+"Options"]?e["_"+s+"Options"]("middle"):{classes:{}},e.element.find(n).each(function(){var n=t(this),o=n[s]("instance"),r=t.widget.extend({},a);if("button"!==s||!n.parent(".ui-spinner").length){o||(o=n[s]()[s]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),n[s](r);var h=n[s]("widget");t.data(h[0],"ui-controlgroup-data",o?o:n[s]("instance")),i.push(h[0])}})),void 0):void 0}),this.childWidgets=t(t.uniqueSort(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),s=i.data("ui-controlgroup-data");s&&s[e]&&s[e]()})},_updateCornerClass:function(t,e){var i="ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all",s=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,i),this._addClass(t,null,s)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e?"auto":!1,classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var s={};return t.each(e,function(n){var o=i.options.classes[n]||"";o=t.trim(o.replace(d,"")),s[n]=(o+" "+e[n]).replace(/\s+/g," ")}),s},_setOption:function(t,e){return"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?(this._callChildMethod(e?"disable":"enable"),void 0):(this.refresh(),void 0)},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,s){var n=e[s]().data("ui-controlgroup-data");if(n&&i["_"+n.widgetName+"Options"]){var o=i["_"+n.widgetName+"Options"](1===e.length?"only":s);o.classes=i._resolveClassesValues(o.classes,n),n.element[n.widgetName](o)}else i._updateCornerClass(e[s](),s)}),this._callChildMethod("refresh"))}}),t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,s=this,n=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){s.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(n.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(n.disabled=e),n},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,s="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(s):t(s).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){return"label"!==t||e?(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e,void 0):(this.refresh(),void 0)):void 0},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon) +},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),t.ui.checkboxradio,t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var s="iconPosition"!==e,n=s?this.options.iconPosition:i,o="top"===n||"bottom"===n;this.icon?s&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),s&&this._addClass(this.icon,null,i),this._attachIcon(n),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(n))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),t.uiBackCompat!==!1&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){return"text"===t?(this._super("showLabel",e),void 0):("showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments),void 0)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))}),t.ui.button,t.extend(t.ui,{datepicker:{version:"1.12.1"}});var p;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,h,l,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(h=document.documentElement.clientWidth,l=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[h/2-100+c,l/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),p===n&&(p=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,h,l=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):l?"all"===i?t.extend({},l.settings):this._get(l,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),l&&(this._curInst===l&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(l,"min"),h=this._getMinMaxDate(l,"max"),a(l.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(l.settings.minDate=this._formatDate(l,r)),null!==h&&void 0!==n.dateFormat&&void 0===n.maxDate&&(l.settings.maxDate=this._formatDate(l,h)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),l),this._autoSize(l),this._setDate(l,o),this._updateAlternate(l),this._updateDatepicker(l)),void 0)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,h,l,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),h={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),h=t.datepicker._checkOffset(s,h,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:h.left+"px",top:h.top+"px"}),s.inline||(l=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[l]?s.dpDiv.show(l,t.datepicker._get(s,"showOptions"),c):s.dpDiv[l||"show"](l?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s))}},_updateDatepicker:function(e){this.maxRows=4,p=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+o>l&&l>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,o,a,r,h=0,l=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof l?l:(new Date).getFullYear()%100+parseInt(l,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=e.length>n+1&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n="y"===t?s:1,o=RegExp("^\\d{"+n+","+s+"}"),a=i.substring(h).match(o);if(!a)throw"Missing number at position "+h;return h+=a[0].length,parseInt(a[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var s=e[1];return i.substr(h,s.length).toLowerCase()===s.toLowerCase()?(o=e[0],h+=s.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+h},x=function(){if(i.charAt(h)!==e.charAt(n))throw"Unexpected literal at position "+h;h++};for(n=0;e.length>n;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":r=new Date(w("@")),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((w("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(i.length>h&&(a=i.substr(h),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=g?0:-100)),v>-1)for(m=1,_=v;;){if(o=this._getDaysInMonth(g,m-1),o>=_)break;m++,_-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,_)),r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=h("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":r+=parseInt(l[1],10);break;case"w":case"W":r+=7*parseInt(l[1],10);break;case"m":case"M":a+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(l[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}l=h.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,h,l,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,I,T,P,M,S,H,z,O,A,N,W,E,F,L,R=new Date,B=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),$=this._get(t,"stepMonths"),X=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),J=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),J)for(e=this._daylightSavingAdjust(new Date(J.getFullYear(),J.getMonth()-U[0]*U[1]+1,J.getDate())),e=Q&&Q>e?Q:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-$,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+$,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(Y?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",l=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(Y?h:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(Y?"":h)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),I=" ui-corner-all",T="",X){if(T+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:T+=" ui-datepicker-group-first",I=" ui-corner-"+(Y?"right":"left"); +break;case U[1]-1:T+=" ui-datepicker-group-last",I=" ui-corner-"+(Y?"left":"right");break;default:T+=" ui-datepicker-group-middle",I=""}T+="'>"}for(T+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+I+"'>"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,te,Q,J,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",P=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)M=(w+c)%7,P+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[M]+"'>"+p[M]+"</span></th>";for(T+=P+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(te,Z)-c+7)%7,z=Math.ceil((H+S)/7),O=X?this.maxRows>z?this.maxRows:z:z,this.maxRows=O,A=this._daylightSavingAdjust(new Date(te,Z,1-H)),N=0;O>N;N++){for(T+="<tr>",W=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",w=0;7>w;w++)E=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],F=A.getMonth()!==Z,L=F&&!v||!E[0]||Q&&Q>A||J&&A>J,W+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(A.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===A.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+E[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!E[2]?"":" title='"+E[2].replace(/'/g,"'")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(F&&!_?" ":L?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===B.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);T+=W+"</tr>"}Z++,Z>11&&(Z=0,te++),T+="</tbody></table>"+(X?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=T}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!h||c>=s.getMonth())&&(!l||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":" ")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new s,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker,t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;0>i&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var s=!1,n=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,n);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),s=!0),s&&!i&&this._trigger("focus",e),s},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),void 0):(this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"),void 0)},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]),i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),void 0;if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){n.trigger("focus")}),e.preventDefault()):(this._delay(function(){s.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this._removeClass(this.uiDialog,"ui-dialog-buttons"),void 0):(t.each(i,function(i,s){var n,o;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,o={icon:s.icon,iconPosition:s.iconPosition,showLabel:s.showLabel,icons:s.icons,text:s.text},delete s.click,delete s.icon,delete s.iconPosition,delete s.showLabel,delete s.icons,"boolean"==typeof s.text&&delete s.text,t("<button></button>",s).button(o).appendTo(e.uiButtonSet).on("click",function(){n.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),void 0)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){i._addClass(t(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,o){var a=o.offset.left-i.document.scrollLeft(),r=o.offset.top-i.document.scrollTop();s.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" "+"top"+(r>=0?"+":"")+r,of:i.window},i._removeClass(t(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,o=this.uiDialog.css("position"),a="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:a,start:function(s,n){i._addClass(t(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,o){var a=i.uiDialog.offset(),r=a.left-i.document.scrollLeft(),h=a.top-i.document.scrollTop();s.height=i.uiDialog.height(),s.width=i.uiDialog.width(),s.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" "+"top"+(h>=0?"+":"")+h,of:i.window},i._removeClass(t(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,s=!1,n={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(e,i){var s,n,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(s=o.is(":data(ui-draggable)"),s&&!i&&o.draggable("destroy"),!s&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(n=o.is(":data(ui-resizable)"),n&&!i&&o.resizable("destroy"),n&&"string"==typeof i&&o.resizable("option","handles",i),n||i===!1||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),t.ui.dialog,t.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){return void 0===t?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),void 0)},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,s=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(s).appendTo(this.button),this.options.width!==!1&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var s=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&s.index!==e.focusIndex&&(e._trigger("focus",t,{item:s}),e.isOpen||e._select(s,t)),e.focusIndex=s.index,e.button.attr("aria-activedescendant",e.menuItems.eq(s.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var s=this,n="";t.each(i,function(i,o){var a;o.optgroup!==n&&(a=t("<li>",{text:o.optgroup}),s._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),n=o.optgroup),s._renderItemData(e,o)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var s=t("<li>"),n=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(s,null,"ui-state-disabled"),this._setText(n,i.label),s.append(n).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html(" ")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0),s.length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?(t=window.getSelection(),t.removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection(),t.rangeCount&&(this.range=t.getRangeAt(0))):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;return t===!1?(this.button.css("width",""),void 0):(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t),void 0)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,s=[];e.each(function(e,n){s.push(i._parseOption(t(n),e))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle"),o="<span tabindex='0'></span>",a=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)a.push(o);this.handles=n.add(t(a.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),("min"===e.range||"max"===e.range)&&this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null) +},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,o,a,r,h,l,c=this,u=this.options;return u.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-c.values(e));(n>i||n===i&&(e===c._lastChangedValue||c.values(e)===u.min))&&(n=i,o=t(this),a=e)}),r=this._start(e,a),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),h=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-o.width()/2,top:e.pageY-h.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),o=this._valueMin()+s*n,this._trimAlignValue(o)},_uiHash:function(t,e,i){var s={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(s.value=void 0!==e?e:this.values(t),s.values=i||this.values()),s},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var s,n,o=this.value(),a=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),o=this.values(e),2===this.options.values.length&&this.options.range===!0&&(i=0===e?Math.min(n,i):Math.max(n,i)),a[e]=i),i!==o&&(s=this._trigger("slide",t,this._uiHash(e,i,a)),s!==!1&&(this._hasMultipleValues()?this.values(e,i):this.value(i)))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),void 0):this._value()},values:function(e,i){var s,n,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),void 0;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(s=this.options.values,n=arguments[0],o=0;s.length>o;o+=1)s[o]=this._trimAlignValue(n[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=n-1;s>=0;s--)this._change(null,s);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step,s=Math.round((t-e)/i)*i;t=s+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,s,n,o,a=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,c={};this._hasMultipleValues()?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),c["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](c,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),o=this._valueMax(),i=o!==n?100*((s-n)/(o-n)):0,c["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](c,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,s,n,o,a=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),i=this._start(e,a),i===!1))return}switch(o=this.options.step,s=n=this._hasMultipleValues()?this.values(a):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(s+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(s-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(s===this._valueMax())return;n=this._trimAlignValue(s+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(s===this._valueMin())return;n=this._trimAlignValue(s-o)}this._slide(e,a,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}}),t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);null!=n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var e=this.element[0]===t.ui.safeActiveElement(this.document[0]);e||(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,s,n;return"culture"===t||"numberFormat"===t?(i=this._parse(this.element.val()),this.options[t]=e,this.element.val(this._format(i)),void 0):(("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(s=this.buttons.first().find(".ui-icon"),this._removeClass(s,null,this.options.icons.up),this._addClass(s,null,e.up),n=this.buttons.last().find(".ui-icon"),this._removeClass(n,null,this.options.icons.down),this._addClass(n,null,e.down)),this._super(t,e),void 0)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null===t?!1:t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:r(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(r(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}}),t.uiBackCompat!==!1&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}}),t.ui.spinner,t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,s;i=e.href.replace(t,""),s=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(n){}try{s=decodeURIComponent(s)}catch(n){}return e.hash.length>1&&i===s}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.uniqueSort(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,s=location.hash.substring(1);return null===e&&(s&&this.tabs.each(function(i,n){return t(n).attr("aria-controls")===s?(e=i,!1):void 0}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===e||-1===e)&&(e=this.tabs.length?0:!1)),e!==!1&&(e=this.tabs.index(this.tabs.eq(e)),-1===e&&(e=i?!1:0)),!i&&e===!1&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),s=this.tabs.index(i),n=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:s++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:n=!1,s--;break;case t.ui.keyCode.END:s=this.anchors.length-1;break;case t.ui.keyCode.HOME:s=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),this._activate(s),void 0;case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),this._activate(s===this.options.active?!1:s),void 0;default:return}e.preventDefault(),clearTimeout(this.activating),s=this._focusNextTab(s,n),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(s).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",s)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){return"active"===t?(this._activate(e),void 0):(this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e),void 0)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,s=this.anchors,n=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,s){var n,o,a,r=t(s).uniqueId().attr("id"),h=t(s).closest("li"),l=h.attr("aria-controls");e._isLocal(s)?(n=s.hash,a=n.substring(1),o=e.element.find(e._sanitizeSelector(n))):(a=h.attr("aria-controls")||t({}).uniqueId()[0].id,n="#"+a,o=e.element.find(n),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),l&&h.data("ui-tabs-aria-controls",l),h.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(s.not(this.anchors)),this._off(n.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,s,n;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),n=0;s=this.tabs[n];n++)i=t(s),e===!0||-1!==t.inArray(n,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,e===!0)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),o=n.closest("li"),a=o[0]===s[0],r=a&&i.collapsible,h=r?t():this._getPanelForTab(o),l=s.length?this._getPanelForTab(s):t(),c={oldTab:s,oldPanel:l,newTab:r?t():o,newPanel:h};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||this._trigger("beforeActivate",e,c)===!1||(i.active=r?!1:this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(o),e),this._toggle(e,c))},_toggle:function(e,i){function s(){o.running=!1,o._trigger("activate",e,i)}function n(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,s):(a.show(),s())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),n()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;i!==!1&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(i!==!0){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var s=this,n=this.tabs.eq(e),o=n.find(".ui-tabs-anchor"),a=this._getPanelForTab(n),r={tab:n,panel:a},h=function(t,e){"abort"===e&&s.panels.stop(!1,!0),s._removeClass(n,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===s.xhr&&delete s.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(n,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,n){setTimeout(function(){a.html(t),s._trigger("load",i,r),h(n,e)},1)}).fail(function(t,e){setTimeout(function(){h(t,e)},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),t.uiBackCompat!==!1&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),t.ui.tabs,t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var s=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s.element[0],e.close(n,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);return e.is("[title]")?e.data("ui-tooltip-title",e.attr("title")).removeAttr("title"):void 0}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._registerCloseHandlers(e,s),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,o=e?e.type:null;return"string"==typeof s||s.nodeType||s.jquery?this._open(e,t,s):(i=s.call(t[0],function(i){n._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}),i&&this._open(e,t,i),void 0)},_open:function(e,i,s){function n(t){l.of=t,a.is(":hidden")||a.position(l)}var o,a,r,h,l=t.extend({},this.options.position);if(s){if(o=this._find(i))return o.tooltip.find(".ui-tooltip-content").html(s),void 0;i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(s),this.liveRegion.children().hide(),h=t("<div>").html(a.find(".ui-tooltip-content").html()),h.removeAttr("name").find("[name]").removeAttr("name"),h.removeAttr("id").find("[id]").removeAttr("id"),h.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:n}),n(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(n(l.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var s={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var s=t.Event(e);s.currentTarget=i[0],this.close(s,!0)}}};i[0]!==this.element[0]&&(s.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(s.mouseleave="close"),e&&"focusin"!==e.type||(s.focusout="close"),this._on(!0,i,s)},close:function(e){var i,s=this,n=t(e?e.currentTarget:this.element),o=this._find(n);return o?(i=o.tooltip,o.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&!n.attr("title")&&n.attr("title",n.data("ui-tooltip-title")),this._removeDescribedBy(n),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e] +}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1)),void 0):(n.removeData("ui-tooltip-open"),void 0)},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),s=t("<div>").appendTo(i),n=i.uniqueId().attr("id");return this._addClass(s,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[n]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur"),o=s.element;n.target=n.currentTarget=o[0],e.close(n,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),t.uiBackCompat!==!1&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),t.ui.tooltip;var f="ui-effects-",g="ui-effects-style",m="ui-effects-animated",_=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,o){var a,r=o.re.exec(i),h=r&&o.parse(r),l=o.space||"rgba";return h?(a=s[l](h),s[c[l].cache]=a[c[l].cache],n=s._rgba=a._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),s):o[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var o,a="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("<p>")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,a,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(a),a=e);var u=this,d=t.type(n),p=this._rgba=[];return a!==e&&(n=[n,a,r,h],d="array"),"string"===d?this.parse(s(n)||o._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var o=s.cache;f(s.props,function(t,e){if(!u[o]&&s.to){if("alpha"===t||null==n[t])return;u[o]=s.to(u._rgba)}u[o][e.idx]=i(n[t],e,!0)}),u[o]&&0>t.inArray(null,u[o].slice(0,3))&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,o){var a,r=i[o.cache];return r&&(a=n[o.cache]||o.to&&o.to(n._rgba)||[],f(o.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===a[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),o=c[n],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),h=r.slice();return s=s[o.cache],f(o.props,function(t,n){var o=n.idx,a=r[o],l=s[o],c=u[n.type]||{};null!==l&&(null===a?h[o]=l:(c.mod&&(l-a>c.mod/2?a+=c.mod:a-l>c.mod/2&&(a-=c.mod)),h[o]=i((l-a)*e+a,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(s,n,o),h=Math.min(s,n,o),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-o)/l+360:n===r?60*(o-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==a?1:a]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],o=t[3],a=.5>=s?s*(1+i):s+i-s*i,r=2*s-a;return[Math.round(255*n(r,a,e+1/3)),Math.round(255*n(r,a,e)),Math.round(255*n(r,a,e-1/3)),o]},f(c,function(s,n){var o=n.props,a=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[a]&&(this[a]=h(this._rgba)),s===e)return this[a].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[a].slice();return f(o,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[a]=d,n):l(d)},f(o,function(e,i){l.fn[e]||(l.fn[e]=function(n){var o,a=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===a?c:("function"===a&&(n=n.call(this,c),a=t.type(n)),null==n&&i.empty?this:("string"===a&&(o=r.exec(n),o&&(n=c+parseFloat(o[2])*("+"===o[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var o,a,r="";if("transparent"!==n&&("string"!==t.type(n)||(o=s(n)))){if(n=l(o||n),!d.rgba&&1!==n._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(a),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(_),function(){function e(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(o[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(o[i]=n[i]);return o}function i(e,i){var s,o,a={};for(s in i)o=i[s],e[s]!==o&&(n[s]||(t.fx.step[s]||!isNaN(parseFloat(o)))&&(a[s]=o));return a}var s=["add","remove","toggle"],n={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(_.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(n,o,a,r){var h=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",l=h.children?a.find("*").addBack():a;l=l.map(function(){var i=t(this);return{el:i,start:e(this)}}),o=function(){t.each(s,function(t,e){n[e]&&a[e+"Class"](n[e])})},o(),l=l.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,o){return s?t.effects.animateClass.call(this,{add:i},s,n,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,s,n,o,a){return"boolean"==typeof s||void 0===s?n?t.effects.animateClass.call(this,s?{add:i}:{remove:i},n,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},s,n,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,o){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,o)}})}(),function(){function e(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function i(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}function s(t,e){var i=e.outerWidth(),s=e.outerHeight(),n=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=n.exec(t)||["",0,i,s,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?s:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(m)||e(i)}}(t.expr.filters.animated)),t.uiBackCompat!==!1&&t.extend(t.effects,{save:function(t,e){for(var i=0,s=e.length;s>i;i++)null!==e[i]&&t.data(f+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,s=0,n=e.length;n>s;s++)null!==e[s]&&(i=t.data(f+e[s]),t.css(e[s],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(a){o=document.body}return e.wrap(s),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,s){return s||(s=i,i="effect"),t.effects.effect[e]=s,t.effects.effect[e].mode=i,s},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();e>1&&s.splice.apply(s,[1,0].concat(s.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data(g,t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data(g)||"",t.removeData(g)},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createPlaceholder:function(e){var i,s=e.css("position"),n=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(s)&&(s="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),"float":e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data(f+"placeholder",i)),e.css({position:s,left:n.left,top:n.top}),i},removePlaceholder:function(t){var e=f+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(n[i]=o[0]*s+o[1])}),n}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(m),t.effects.cleanUp(r),"hide"===s.mode&&r.hide(),a()}function a(){t.isFunction(h)&&h.call(r[0]),t.isFunction(e)&&e()}var r=t(this);s.mode=c.shift(),t.uiBackCompat===!1||o?"none"===s.mode?(r[l](),a()):n.call(r[0],s,i):(r.is(":hidden")?"hide"===l:"show"===l)?(r[l](),a()):n.call(r[0],s,a)}var s=e.apply(this,arguments),n=t.effects.effect[s.effect],o=n.mode,a=s.queue,r=a||"fx",h=s.complete,l=s.mode,c=[],u=function(e){var i=t(this),s=t.effects.mode(i,l)||o;i.data(m,!0),c.push(s),o&&("show"===s||s===o&&"hide"===s)&&i.show(),o&&"none"===s||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!n?l?this[l](s.duration,h):this.each(function(){h&&h.call(this)}):a===!1?this.each(u).each(i):this.queue(r,u).queue(r,i)},show:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="show",this.effect.call(this,n)}}(t.fn.show),hide:function(t){return function(s){if(i(s))return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="hide",this.effect.call(this,n)}}(t.fn.hide),toggle:function(t){return function(s){if(i(s)||"boolean"==typeof s)return t.apply(this,arguments);var n=e.apply(this,arguments);return n.mode="toggle",this.effect.call(this,n)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):s(this.css("clip"),this)},transfer:function(e,i){var s=t(this),n=t(e.to),o="fixed"===n.css("position"),a=t("body"),r=o?a.scrollTop():0,h=o?a.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:o?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=s(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}();var v=t.effects;t.effects.define("blind","hide",function(e,i){var s={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},n=t(this),o=e.direction||"up",a=n.cssClip(),r={clip:t.extend({},a)},h=t.effects.createPlaceholder(n);r.clip[s[o][0]]=r.clip[s[o][1]],"show"===e.mode&&(n.cssClip(r.clip),h&&h.css(t.effects.clipToBox(r)),r.clip=a),h&&h.animate(t.effects.clipToBox(r),e.duration,e.easing),n.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var s,n,o,a=t(this),r=e.mode,h="hide"===r,l="show"===r,c=e.direction||"up",u=e.distance,d=e.times||5,p=2*d+(l||h?1:0),f=e.duration/p,g=e.easing,m="up"===c||"down"===c?"top":"left",_="up"===c||"left"===c,v=0,b=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),u||(u=a["top"===m?"outerHeight":"outerWidth"]()/3),l&&(n={opacity:1},n[m]=o,a.css("opacity",0).css(m,_?2*-u:2*u).animate(n,f,g)),h&&(u/=Math.pow(2,d-1)),n={},n[m]=o;d>v;v++)s={},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g).animate(n,f,g),u=h?2*u:u/2;h&&(s={opacity:0},s[m]=(_?"-=":"+=")+u,a.animate(s,f,g)),a.queue(i),t.effects.unshift(a,b,p+1)}),t.effects.define("clip","hide",function(e,i){var s,n={},o=t(this),a=e.direction||"vertical",r="both"===a,h=r||"horizontal"===a,l=r||"vertical"===a;s=o.cssClip(),n.clip={top:l?(s.bottom-s.top)/2:s.top,right:h?(s.right-s.left)/2:s.right,bottom:l?(s.bottom-s.top)/2:s.bottom,left:h?(s.right-s.left)/2:s.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(n.clip),n.clip=s),o.animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var s,n=t(this),o=e.mode,a="show"===o,r=e.direction||"left",h="up"===r||"down"===r?"top":"left",l="up"===r||"left"===r?"-=":"+=",c="+="===l?"-=":"+=",u={opacity:0};t.effects.createPlaceholder(n),s=e.distance||n["top"===h?"outerHeight":"outerWidth"](!0)/2,u[h]=l+s,a&&(n.css(u),u[h]=c+s,u.opacity=1),n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),i()}var o,a,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=e.mode,g="show"===f,m=p.show().css("visibility","hidden").offset(),_=Math.ceil(p.outerWidth()/d),v=Math.ceil(p.outerHeight()/u),b=[];for(o=0;u>o;o++)for(h=m.top+o*v,c=o-(u-1)/2,a=0;d>a;a++)r=m.left+a*_,l=a-(d-1)/2,p.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*_,top:-o*v}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:_,height:v,left:r+(g?l*_:0),top:h+(g?c*v:0),opacity:g?0:1}).animate({left:r+(g?0:l*_),top:h+(g?0:c*v),opacity:g?1:0},e.duration||500,e.easing,s)}),t.effects.define("fade","toggle",function(e,i){var s="show"===e.mode;t(this).css("opacity",s?0:1).animate({opacity:s?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=e.size||15,h=/([0-9]+)%/.exec(r),l=!!e.horizFirst,c=l?["right","bottom"]:["bottom","right"],u=e.duration/2,d=t.effects.createPlaceholder(s),p=s.cssClip(),f={clip:t.extend({},p)},g={clip:t.extend({},p)},m=[p[c[0]],p[c[1]]],_=s.queue().length;h&&(r=parseInt(h[1],10)/100*m[a?0:1]),f.clip[c[0]]=r,g.clip[c[0]]=r,g.clip[c[1]]=0,o&&(s.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=p),s.queue(function(i){d&&d.animate(t.effects.clipToBox(f),u,e.easing).animate(t.effects.clipToBox(g),u,e.easing),i()}).animate(f,u,e.easing).animate(g,u,e.easing).queue(i),t.effects.unshift(s,_,4)}),t.effects.define("highlight","show",function(e,i){var s=t(this),n={backgroundColor:s.css("backgroundColor")};"hide"===e.mode&&(n.opacity=0),t.effects.saveStyle(s),s.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(n,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var s,n,o,a=t(this),r=["fontSize"],h=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],l=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],c=e.mode,u="effect"!==c,d=e.scale||"both",p=e.origin||["middle","center"],f=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),_=e.from||m,v=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===c&&(o=_,_=v,v=o),n={from:{y:_.height/m.height,x:_.width/m.width},to:{y:v.height/m.height,x:v.width/m.width}},("box"===d||"both"===d)&&(n.from.y!==n.to.y&&(_=t.effects.setTransition(a,h,n.from.y,_),v=t.effects.setTransition(a,h,n.to.y,v)),n.from.x!==n.to.x&&(_=t.effects.setTransition(a,l,n.from.x,_),v=t.effects.setTransition(a,l,n.to.x,v))),("content"===d||"both"===d)&&n.from.y!==n.to.y&&(_=t.effects.setTransition(a,r,n.from.y,_),v=t.effects.setTransition(a,r,n.to.y,v)),p&&(s=t.effects.getBaseline(p,m),_.top=(m.outerHeight-_.outerHeight)*s.y+g.top,_.left=(m.outerWidth-_.outerWidth)*s.x+g.left,v.top=(m.outerHeight-v.outerHeight)*s.y+g.top,v.left=(m.outerWidth-v.outerWidth)*s.x+g.left),a.css(_),("content"===d||"both"===d)&&(h=h.concat(["marginTop","marginBottom"]).concat(r),l=l.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),s=t.effects.scaledDimensions(i),o={height:s.height*n.from.y,width:s.width*n.from.x,outerHeight:s.outerHeight*n.from.y,outerWidth:s.outerWidth*n.from.x},a={height:s.height*n.to.y,width:s.width*n.to.x,outerHeight:s.height*n.to.y,outerWidth:s.width*n.to.x};n.from.y!==n.to.y&&(o=t.effects.setTransition(i,h,n.from.y,o),a=t.effects.setTransition(i,h,n.to.y,a)),n.from.x!==n.to.x&&(o=t.effects.setTransition(i,l,n.from.x,o),a=t.effects.setTransition(i,l,n.to.x,a)),u&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){u&&t.effects.restoreStyle(i)})})),a.animate(v,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===v.opacity&&a.css("opacity",_.opacity),u||(a.css("position","static"===f?"relative":f).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var s=t(this),n=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==n?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(s),to:t.effects.scaledDimensions(s,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var s=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,s,i)}),t.effects.define("pulsate","show",function(e,i){var s=t(this),n=e.mode,o="show"===n,a="hide"===n,r=o||a,h=2*(e.times||5)+(r?1:0),l=e.duration/h,c=0,u=1,d=s.queue().length;for((o||!s.is(":visible"))&&(s.css("opacity",0).show(),c=1);h>u;u++)s.animate({opacity:c},l,e.easing),c=1-c;s.animate({opacity:c},l,e.easing),s.queue(i),t.effects.unshift(s,d,h+1)}),t.effects.define("shake",function(e,i){var s=1,n=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,h=2*r+1,l=Math.round(e.duration/h),c="up"===o||"down"===o?"top":"left",u="up"===o||"left"===o,d={},p={},f={},g=n.queue().length;for(t.effects.createPlaceholder(n),d[c]=(u?"-=":"+=")+a,p[c]=(u?"+=":"-=")+2*a,f[c]=(u?"-=":"+=")+2*a,n.animate(d,l,e.easing);r>s;s++)n.animate(p,l,e.easing).animate(f,l,e.easing);n.animate(p,l,e.easing).animate(d,l/2,e.easing).queue(i),t.effects.unshift(n,g,h+1)}),t.effects.define("slide","show",function(e,i){var s,n,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u=e.distance||o["top"===l?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),s=o.cssClip(),n=o.position()[l],d[l]=(c?-1:1)*u+n,d.clip=o.cssClip(),d.clip[a[h][1]]=d.clip[a[h][0]],"show"===r&&(o.cssClip(d.clip),o.css(l,d[l]),d.clip=s,d[l]=n),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});var v;t.uiBackCompat!==!1&&(v=t.effects.define("transfer",function(e,i){t(this).transfer(e,i)}))}); diff --git a/phpMyAdmin/js/vendor/jquery/jquery.ba-hashchange-1.3.js b/phpMyAdmin/js/vendor/jquery/jquery.ba-hashchange-1.3.js new file mode 100755 index 0000000..59bfd4a --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.ba-hashchange-1.3.js @@ -0,0 +1,390 @@ +/*! + * jQuery hashchange event - v1.3 - 7/21/2010 + * http://benalman.com/projects/jquery-hashchange-plugin/ + * + * Copyright (c) 2010 "Cowboy" Ben Alman + * Dual licensed under the MIT and GPL licenses. + * http://benalman.com/about/license/ + */ + +// Script: jQuery hashchange event +// +// *Version: 1.3, Last updated: 7/21/2010* +// +// Project Home - http://benalman.com/projects/jquery-hashchange-plugin/ +// GitHub - http://github.com/cowboy/jquery-hashchange/ +// Source - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.js +// (Minified) - http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.min.js (0.8kb gzipped) +// +// About: License +// +// Copyright (c) 2010 "Cowboy" Ben Alman, +// Dual licensed under the MIT and GPL licenses. +// http://benalman.com/about/license/ +// +// About: Examples +// +// These working examples, complete with fully commented code, illustrate a few +// ways in which this plugin can be used. +// +// hashchange event - http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/ +// document.domain - http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/ +// +// About: Support and Testing +// +// Information about what version or versions of jQuery this plugin has been +// tested with, what browsers it has been tested in, and where the unit tests +// reside (so you can test it yourself). +// +// jQuery Versions - 1.2.6, 1.3.2, 1.4.1, 1.4.2 +// Browsers Tested - Internet Explorer 6-8, Firefox 2-4, Chrome 5-6, Safari 3.2-5, +// Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5. +// Unit Tests - http://benalman.com/code/projects/jquery-hashchange/unit/ +// +// About: Known issues +// +// While this jQuery hashchange event implementation is quite stable and +// robust, there are a few unfortunate browser bugs surrounding expected +// hashchange event-based behaviors, independent of any JavaScript +// window.onhashchange abstraction. See the following examples for more +// information: +// +// Chrome: Back Button - http://benalman.com/code/projects/jquery-hashchange/examples/bug-chrome-back-button/ +// Firefox: Remote XMLHttpRequest - http://benalman.com/code/projects/jquery-hashchange/examples/bug-firefox-remote-xhr/ +// WebKit: Back Button in an Iframe - http://benalman.com/code/projects/jquery-hashchange/examples/bug-webkit-hash-iframe/ +// Safari: Back Button from a different domain - http://benalman.com/code/projects/jquery-hashchange/examples/bug-safari-back-from-diff-domain/ +// +// Also note that should a browser natively support the window.onhashchange +// event, but not report that it does, the fallback polling loop will be used. +// +// About: Release History +// +// 1.3 - (7/21/2010) Reorganized IE6/7 Iframe code to make it more +// "removable" for mobile-only development. Added IE6/7 document.title +// support. Attempted to make Iframe as hidden as possible by using +// techniques from http://www.paciellogroup.com/blog/?p=604. Added +// support for the "shortcut" format $(window).hashchange( fn ) and +// $(window).hashchange() like jQuery provides for built-in events. +// Renamed jQuery.hashchangeDelay to <jQuery.fn.hashchange.delay> and +// lowered its default value to 50. Added <jQuery.fn.hashchange.domain> +// and <jQuery.fn.hashchange.src> properties plus document-domain.html +// file to address access denied issues when setting document.domain in +// IE6/7. +// 1.2 - (2/11/2010) Fixed a bug where coming back to a page using this plugin +// from a page on another domain would cause an error in Safari 4. Also, +// IE6/7 Iframe is now inserted after the body (this actually works), +// which prevents the page from scrolling when the event is first bound. +// Event can also now be bound before DOM ready, but it won't be usable +// before then in IE6/7. +// 1.1 - (1/21/2010) Incorporated document.documentMode test to fix IE8 bug +// where browser version is incorrectly reported as 8.0, despite +// inclusion of the X-UA-Compatible IE=EmulateIE7 meta tag. +// 1.0 - (1/9/2010) Initial Release. Broke out the jQuery BBQ event.special +// window.onhashchange functionality into a separate plugin for users +// who want just the basic event & back button support, without all the +// extra awesomeness that BBQ provides. This plugin will be included as +// part of jQuery BBQ, but also be available separately. + +(function($,window,undefined){ + '$:nomunge'; // Used by YUI compressor. + + // Reused string. + var str_hashchange = 'hashchange', + + // Method / object references. + doc = document, + fake_onhashchange, + special = $.event.special, + + // Does the browser support window.onhashchange? Note that IE8 running in + // IE7 compatibility mode reports true for 'onhashchange' in window, even + // though the event isn't supported, so also test document.documentMode. + doc_mode = doc.documentMode, + supports_onhashchange = 'on' + str_hashchange in window && ( doc_mode === undefined || doc_mode > 7 ); + + // Get location.hash (or what you'd expect location.hash to be) sans any + // leading #. Thanks for making this necessary, Firefox! + function get_fragment( url ) { + url = url || location.href; + return '#' + url.replace( /^[^#]*#?(.*)$/, '$1' ); + }; + + // Method: jQuery.fn.hashchange + // + // Bind a handler to the window.onhashchange event or trigger all bound + // window.onhashchange event handlers. This behavior is consistent with + // jQuery's built-in event handlers. + // + // Usage: + // + // > jQuery(window).hashchange( [ handler ] ); + // + // Arguments: + // + // handler - (Function) Optional handler to be bound to the hashchange + // event. This is a "shortcut" for the more verbose form: + // jQuery(window).bind( 'hashchange', handler ). If handler is omitted, + // all bound window.onhashchange event handlers will be triggered. This + // is a shortcut for the more verbose + // jQuery(window).trigger( 'hashchange' ). These forms are described in + // the <hashchange event> section. + // + // Returns: + // + // (jQuery) The initial jQuery collection of elements. + + // Allow the "shortcut" format $(elem).hashchange( fn ) for binding and + // $(elem).hashchange() for triggering, like jQuery does for built-in events. + $.fn[ str_hashchange ] = function( fn ) { + return fn ? this.bind( str_hashchange, fn ) : this.trigger( str_hashchange ); + }; + + // Property: jQuery.fn.hashchange.delay + // + // The numeric interval (in milliseconds) at which the <hashchange event> + // polling loop executes. Defaults to 50. + + // Property: jQuery.fn.hashchange.domain + // + // If you're setting document.domain in your JavaScript, and you want hash + // history to work in IE6/7, not only must this property be set, but you must + // also set document.domain BEFORE jQuery is loaded into the page. This + // property is only applicable if you are supporting IE6/7 (or IE8 operating + // in "IE7 compatibility" mode). + // + // In addition, the <jQuery.fn.hashchange.src> property must be set to the + // path of the included "document-domain.html" file, which can be renamed or + // modified if necessary (note that the document.domain specified must be the + // same in both your main JavaScript as well as in this file). + // + // Usage: + // + // jQuery.fn.hashchange.domain = document.domain; + + // Property: jQuery.fn.hashchange.src + // + // If, for some reason, you need to specify an Iframe src file (for example, + // when setting document.domain as in <jQuery.fn.hashchange.domain>), you can + // do so using this property. Note that when using this property, history + // won't be recorded in IE6/7 until the Iframe src file loads. This property + // is only applicable if you are supporting IE6/7 (or IE8 operating in "IE7 + // compatibility" mode). + // + // Usage: + // + // jQuery.fn.hashchange.src = 'path/to/file.html'; + + $.fn[ str_hashchange ].delay = 50; + /* + $.fn[ str_hashchange ].domain = null; + $.fn[ str_hashchange ].src = null; + */ + + // Event: hashchange event + // + // Fired when location.hash changes. In browsers that support it, the native + // HTML5 window.onhashchange event is used, otherwise a polling loop is + // initialized, running every <jQuery.fn.hashchange.delay> milliseconds to + // see if the hash has changed. In IE6/7 (and IE8 operating in "IE7 + // compatibility" mode), a hidden Iframe is created to allow the back button + // and hash-based history to work. + // + // Usage as described in <jQuery.fn.hashchange>: + // + // > // Bind an event handler. + // > jQuery(window).hashchange( function(e) { + // > var hash = location.hash; + // > ... + // > }); + // > + // > // Manually trigger the event handler. + // > jQuery(window).hashchange(); + // + // A more verbose usage that allows for event namespacing: + // + // > // Bind an event handler. + // > jQuery(window).bind( 'hashchange', function(e) { + // > var hash = location.hash; + // > ... + // > }); + // > + // > // Manually trigger the event handler. + // > jQuery(window).trigger( 'hashchange' ); + // + // Additional Notes: + // + // * The polling loop and Iframe are not created until at least one handler + // is actually bound to the 'hashchange' event. + // * If you need the bound handler(s) to execute immediately, in cases where + // a location.hash exists on page load, via bookmark or page refresh for + // example, use jQuery(window).hashchange() or the more verbose + // jQuery(window).trigger( 'hashchange' ). + // * The event can be bound before DOM ready, but since it won't be usable + // before then in IE6/7 (due to the necessary Iframe), recommended usage is + // to bind it inside a DOM ready handler. + + // Override existing $.event.special.hashchange methods (allowing this plugin + // to be defined after jQuery BBQ in BBQ's source code). + special[ str_hashchange ] = $.extend( special[ str_hashchange ], { + + // Called only when the first 'hashchange' event is bound to window. + setup: function() { + // If window.onhashchange is supported natively, there's nothing to do.. + if ( supports_onhashchange ) { return false; } + + // Otherwise, we need to create our own. And we don't want to call this + // until the user binds to the event, just in case they never do, since it + // will create a polling loop and possibly even a hidden Iframe. + $( fake_onhashchange.start ); + }, + + // Called only when the last 'hashchange' event is unbound from window. + teardown: function() { + // If window.onhashchange is supported natively, there's nothing to do.. + if ( supports_onhashchange ) { return false; } + + // Otherwise, we need to stop ours (if possible). + $( fake_onhashchange.stop ); + } + + }); + + // fake_onhashchange does all the work of triggering the window.onhashchange + // event for browsers that don't natively support it, including creating a + // polling loop to watch for hash changes and in IE 6/7 creating a hidden + // Iframe to enable back and forward. + fake_onhashchange = (function(){ + var self = {}, + timeout_id, + + // Remember the initial hash so it doesn't get triggered immediately. + last_hash = get_fragment(), + + fn_retval = function(val){ return val; }, + history_set = fn_retval, + history_get = fn_retval; + + // Start the polling loop. + self.start = function() { + timeout_id || poll(); + }; + + // Stop the polling loop. + self.stop = function() { + timeout_id && clearTimeout( timeout_id ); + timeout_id = undefined; + }; + + // This polling loop checks every $.fn.hashchange.delay milliseconds to see + // if location.hash has changed, and triggers the 'hashchange' event on + // window when necessary. + function poll() { + var hash = get_fragment(), + history_hash = history_get( last_hash ); + + if ( hash !== last_hash ) { + history_set( last_hash = hash, history_hash ); + + $(window).trigger( str_hashchange ); + + } else if ( history_hash !== last_hash ) { + location.href = location.href.replace( /#.*/, '' ) + history_hash; + } + + timeout_id = setTimeout( poll, $.fn[ str_hashchange ].delay ); + }; + + // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + // vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv + // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv + (window.navigator.userAgent.indexOf("MSIE ") > -1 || !!window.navigator.userAgent.match(/Trident.*rv\:11\./)) && !supports_onhashchange && (function(){ + // Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8 + // when running in "IE7 compatibility" mode. + + var iframe, + iframe_src; + + // When the event is bound and polling starts in IE 6/7, create a hidden + // Iframe for history handling. + self.start = function(){ + if ( !iframe ) { + iframe_src = $.fn[ str_hashchange ].src; + iframe_src = iframe_src && iframe_src + get_fragment(); + + // Create hidden Iframe. Attempt to make Iframe as hidden as possible + // by using techniques from http://www.paciellogroup.com/blog/?p=604. + iframe = $('<iframe tabindex="-1" title="empty"/>').hide() + + // When Iframe has completely loaded, initialize the history and + // start polling. + .one( 'load', function(){ + iframe_src || history_set( get_fragment() ); + poll(); + }) + + // Load Iframe src if specified, otherwise nothing. + .attr( 'src', iframe_src || 'javascript:0' ) + + // Append Iframe after the end of the body to prevent unnecessary + // initial page scrolling (yes, this works). + .insertAfter( 'body' )[0].contentWindow; + + // Whenever `document.title` changes, update the Iframe's title to + // prettify the back/next history menu entries. Since IE sometimes + // errors with "Unspecified error" the very first time this is set + // (yes, very useful) wrap this with a try/catch block. + doc.onpropertychange = function(){ + try { + if ( event.propertyName === 'title' ) { + iframe.document.title = doc.title; + } + } catch(e) {} + }; + + } + }; + + // Override the "stop" method since an IE6/7 Iframe was created. Even + // if there are no longer any bound event handlers, the polling loop + // is still necessary for back/next to work at all! + self.stop = fn_retval; + + // Get history by looking at the hidden Iframe's location.hash. + history_get = function() { + return get_fragment( iframe.location.href ); + }; + + // Set a new history item by opening and then closing the Iframe + // document, *then* setting its location.hash. If document.domain has + // been set, update that as well. + history_set = function( hash, history_hash ) { + var iframe_doc = iframe.document, + domain = $.fn[ str_hashchange ].domain; + + if ( hash !== history_hash ) { + // Update Iframe with any initial `document.title` that might be set. + iframe_doc.title = doc.title; + + // Opening the Iframe's document after it has been closed is what + // actually adds a history entry. + iframe_doc.open(); + + // Set document.domain for the Iframe document as well, if necessary. + domain && iframe_doc.write( '<script>document.domain="' + domain + '"</script>' ); + + iframe_doc.close(); + + // Update the Iframe's hash, for great justice. + iframe.location.hash = hash; + } + }; + + })(); + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + // ^^^^^^^^^^^^^^^^^^^ REMOVE IF NOT SUPPORTING IE6/7/8 ^^^^^^^^^^^^^^^^^^^ + // ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + return self; + })(); + +})(jQuery,this); diff --git a/phpMyAdmin/js/vendor/jquery/jquery.debounce-1.0.5.js b/phpMyAdmin/js/vendor/jquery/jquery.debounce-1.0.5.js new file mode 100755 index 0000000..020128c --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.debounce-1.0.5.js @@ -0,0 +1,71 @@ +/** + * Debounce and throttle function's decorator plugin 1.0.5 + * + * Copyright (c) 2009 Filatov Dmitry (alpha@zforms.ru) + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ + +(function($) { + +$.extend({ + + debounce : function(fn, timeout, invokeAsap, ctx) { + + if(arguments.length == 3 && typeof invokeAsap != 'boolean') { + ctx = invokeAsap; + invokeAsap = false; + } + + var timer; + + return function() { + + var args = arguments; + ctx = ctx || this; + + invokeAsap && !timer && fn.apply(ctx, args); + + clearTimeout(timer); + + timer = setTimeout(function() { + !invokeAsap && fn.apply(ctx, args); + timer = null; + }, timeout); + + }; + + }, + + throttle : function(fn, timeout, ctx) { + + var timer, args, needInvoke; + + return function() { + + args = arguments; + needInvoke = true; + ctx = ctx || this; + + if(!timer) { + (function() { + if(needInvoke) { + fn.apply(ctx, args); + needInvoke = false; + timer = setTimeout(arguments.callee, timeout); + } + else { + timer = null; + } + })(); + } + + }; + + } + +}); + +})(jQuery); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jquery/jquery.event.drag-2.2.js b/phpMyAdmin/js/vendor/jquery/jquery.event.drag-2.2.js new file mode 100755 index 0000000..1cda0e2 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.event.drag-2.2.js @@ -0,0 +1,402 @@ +/*! + * jquery.event.drag - v 2.2 + * Copyright (c) 2010 Three Dub Media - http://threedubmedia.com + * Open Source MIT License - http://threedubmedia.com/code/license + */ +// Created: 2008-06-04 +// Updated: 2012-05-21 +// REQUIRES: jquery 1.7.x + +;(function( $ ){ + +// add the jquery instance method +$.fn.drag = function( str, arg, opts ){ + // figure out the event type + var type = typeof str == "string" ? str : "", + // figure out the event handler... + fn = $.isFunction( str ) ? str : $.isFunction( arg ) ? arg : null; + // fix the event type + if ( type.indexOf("drag") !== 0 ) + type = "drag"+ type; + // were options passed + opts = ( str == fn ? arg : opts ) || {}; + // trigger or bind event handler + return fn ? this.bind( type, opts, fn ) : this.trigger( type ); +}; + +// local refs (increase compression) +var $event = $.event, +$special = $event.special, +// configure the drag special event +drag = $special.drag = { + + // these are the default settings + defaults: { + which: 1, // mouse button pressed to start drag sequence + distance: 0, // distance dragged before dragstart + not: ':input', // selector to suppress dragging on target elements + handle: null, // selector to match handle target elements + relative: false, // true to use "position", false to use "offset" + drop: true, // false to suppress drop events, true or selector to allow + click: false // false to suppress click events after dragend (no proxy) + }, + + // the key name for stored drag data + datakey: "dragdata", + + // prevent bubbling for better performance + noBubble: true, + + // count bound related events + add: function( obj ){ + // read the interaction data + var data = $.data( this, drag.datakey ), + // read any passed options + opts = obj.data || {}; + // count another realted event + data.related += 1; + // extend data options bound with this event + // don't iterate "opts" in case it is a node + $.each( drag.defaults, function( key, def ){ + if ( opts[ key ] !== undefined ) + data[ key ] = opts[ key ]; + }); + }, + + // forget unbound related events + remove: function(){ + $.data( this, drag.datakey ).related -= 1; + }, + + // configure interaction, capture settings + setup: function(){ + // check for related events + if ( $.data( this, drag.datakey ) ) + return; + // initialize the drag data with copied defaults + var data = $.extend({ related:0 }, drag.defaults ); + // store the interaction data + $.data( this, drag.datakey, data ); + // bind the mousedown event, which starts drag interactions + $event.add( this, "touchstart mousedown", drag.init, data ); + // prevent image dragging in IE... + if ( this.attachEvent ) + this.attachEvent("ondragstart", drag.dontstart ); + }, + + // destroy configured interaction + teardown: function(){ + var data = $.data( this, drag.datakey ) || {}; + // check for related events + if ( data.related ) + return; + // remove the stored data + $.removeData( this, drag.datakey ); + // remove the mousedown event + $event.remove( this, "touchstart mousedown", drag.init ); + // enable text selection + drag.textselect( true ); + // un-prevent image dragging in IE... + if ( this.detachEvent ) + this.detachEvent("ondragstart", drag.dontstart ); + }, + + // initialize the interaction + init: function( event ){ + // sorry, only one touch at a time + if ( drag.touched ) + return; + // the drag/drop interaction data + var dd = event.data, results; + // check the which directive + if ( event.which != 0 && dd.which > 0 && event.which != dd.which ) + return; + // check for suppressed selector + if ( $( event.target ).is( dd.not ) ) + return; + // check for handle selector + if ( dd.handle && !$( event.target ).closest( dd.handle, event.currentTarget ).length ) + return; + + drag.touched = event.type == 'touchstart' ? this : null; + dd.propagates = 1; + dd.mousedown = this; + dd.interactions = [ drag.interaction( this, dd ) ]; + dd.target = event.target; + dd.pageX = event.pageX; + dd.pageY = event.pageY; + dd.dragging = null; + // handle draginit event... + results = drag.hijack( event, "draginit", dd ); + // early cancel + if ( !dd.propagates ) + return; + // flatten the result set + results = drag.flatten( results ); + // insert new interaction elements + if ( results && results.length ){ + dd.interactions = []; + $.each( results, function(){ + dd.interactions.push( drag.interaction( this, dd ) ); + }); + } + // remember how many interactions are propagating + dd.propagates = dd.interactions.length; + // locate and init the drop targets + if ( dd.drop !== false && $special.drop ) + $special.drop.handler( event, dd ); + // disable text selection + drag.textselect( false ); + // bind additional events... + if ( drag.touched ) + $event.add( drag.touched, "touchmove touchend", drag.handler, dd ); + else + $event.add( document, "mousemove mouseup", drag.handler, dd ); + // helps prevent text selection or scrolling + if ( !drag.touched || dd.live ) + return false; + }, + + // returns an interaction object + interaction: function( elem, dd ){ + var offset = $( elem )[ dd.relative ? "position" : "offset" ]() || { top:0, left:0 }; + return { + drag: elem, + callback: new drag.callback(), + droppable: [], + offset: offset + }; + }, + + // handle drag-releatd DOM events + handler: function( event ){ + // read the data before hijacking anything + var dd = event.data; + // handle various events + switch ( event.type ){ + // mousemove, check distance, start dragging + case !dd.dragging && 'touchmove': + event.preventDefault(); + case !dd.dragging && 'mousemove': + // drag tolerance, x� + y� = distance� + if ( Math.pow( event.pageX-dd.pageX, 2 ) + Math.pow( event.pageY-dd.pageY, 2 ) < Math.pow( dd.distance, 2 ) ) + break; // distance tolerance not reached + event.target = dd.target; // force target from "mousedown" event (fix distance issue) + drag.hijack( event, "dragstart", dd ); // trigger "dragstart" + if ( dd.propagates ) // "dragstart" not rejected + dd.dragging = true; // activate interaction + // mousemove, dragging + case 'touchmove': + event.preventDefault(); + case 'mousemove': + if ( dd.dragging ){ + // trigger "drag" + drag.hijack( event, "drag", dd ); + if ( dd.propagates ){ + // manage drop events + if ( dd.drop !== false && $special.drop ) + $special.drop.handler( event, dd ); // "dropstart", "dropend" + break; // "drag" not rejected, stop + } + event.type = "mouseup"; // helps "drop" handler behave + } + // mouseup, stop dragging + case 'touchend': + case 'mouseup': + default: + if ( drag.touched ) + $event.remove( drag.touched, "touchmove touchend", drag.handler ); // remove touch events + else + $event.remove( document, "mousemove mouseup", drag.handler ); // remove page events + if ( dd.dragging ){ + if ( dd.drop !== false && $special.drop ) + $special.drop.handler( event, dd ); // "drop" + drag.hijack( event, "dragend", dd ); // trigger "dragend" + } + drag.textselect( true ); // enable text selection + // if suppressing click events... + if ( dd.click === false && dd.dragging ) + $.data( dd.mousedown, "suppress.click", new Date().getTime() + 5 ); + dd.dragging = drag.touched = false; // deactivate element + break; + } + }, + + // re-use event object for custom events + hijack: function( event, type, dd, x, elem ){ + // not configured + if ( !dd ) + return; + // remember the original event and type + var orig = { event:event.originalEvent, type:event.type }, + // is the event drag related or drog related? + mode = type.indexOf("drop") ? "drag" : "drop", + // iteration vars + result, i = x || 0, ia, $elems, callback, + len = !isNaN( x ) ? x : dd.interactions.length; + // modify the event type + event.type = type; + // remove the original event + event.originalEvent = null; + // initialize the results + dd.results = []; + // handle each interacted element + do if ( ia = dd.interactions[ i ] ){ + // validate the interaction + if ( type !== "dragend" && ia.cancelled ) + continue; + // set the dragdrop properties on the event object + callback = drag.properties( event, dd, ia ); + // prepare for more results + ia.results = []; + // handle each element + $( elem || ia[ mode ] || dd.droppable ).each(function( p, subject ){ + // identify drag or drop targets individually + callback.target = subject; + // force propagtion of the custom event + event.isPropagationStopped = function(){ return false; }; + // handle the event + result = subject ? $event.dispatch.call( subject, event, callback ) : null; + // stop the drag interaction for this element + if ( result === false ){ + if ( mode == "drag" ){ + ia.cancelled = true; + dd.propagates -= 1; + } + if ( type == "drop" ){ + ia[ mode ][p] = null; + } + } + // assign any dropinit elements + else if ( type == "dropinit" ) + ia.droppable.push( drag.element( result ) || subject ); + // accept a returned proxy element + if ( type == "dragstart" ) + ia.proxy = $( drag.element( result ) || ia.drag )[0]; + // remember this result + ia.results.push( result ); + // forget the event result, for recycling + delete event.result; + // break on cancelled handler + if ( type !== "dropinit" ) + return result; + }); + // flatten the results + dd.results[ i ] = drag.flatten( ia.results ); + // accept a set of valid drop targets + if ( type == "dropinit" ) + ia.droppable = drag.flatten( ia.droppable ); + // locate drop targets + if ( type == "dragstart" && !ia.cancelled ) + callback.update(); + } + while ( ++i < len ) + // restore the original event & type + event.type = orig.type; + event.originalEvent = orig.event; + // return all handler results + return drag.flatten( dd.results ); + }, + + // extend the callback object with drag/drop properties... + properties: function( event, dd, ia ){ + var obj = ia.callback; + // elements + obj.drag = ia.drag; + obj.proxy = ia.proxy || ia.drag; + // starting mouse position + obj.startX = dd.pageX; + obj.startY = dd.pageY; + // current distance dragged + obj.deltaX = event.pageX - dd.pageX; + obj.deltaY = event.pageY - dd.pageY; + // original element position + obj.originalX = ia.offset.left; + obj.originalY = ia.offset.top; + // adjusted element position + obj.offsetX = obj.originalX + obj.deltaX; + obj.offsetY = obj.originalY + obj.deltaY; + // assign the drop targets information + obj.drop = drag.flatten( ( ia.drop || [] ).slice() ); + obj.available = drag.flatten( ( ia.droppable || [] ).slice() ); + return obj; + }, + + // determine is the argument is an element or jquery instance + element: function( arg ){ + if ( arg && ( arg.jquery || arg.nodeType == 1 ) ) + return arg; + }, + + // flatten nested jquery objects and arrays into a single dimension array + flatten: function( arr ){ + return $.map( arr, function( member ){ + return member && member.jquery ? $.makeArray( member ) : + member && member.length ? drag.flatten( member ) : member; + }); + }, + + // toggles text selection attributes ON (true) or OFF (false) + textselect: function( bool ){ + $( document )[ bool ? "unbind" : "bind" ]("selectstart", drag.dontstart ) + .css("MozUserSelect", bool ? "" : "none" ); + // .attr("unselectable", bool ? "off" : "on" ) + document.unselectable = bool ? "off" : "on"; + }, + + // suppress "selectstart" and "ondragstart" events + dontstart: function(){ + return false; + }, + + // a callback instance contructor + callback: function(){} + +}; + +// callback methods +drag.callback.prototype = { + update: function(){ + if ( $special.drop && this.available.length ) + $.each( this.available, function( i ){ + $special.drop.locate( this, i ); + }); + } +}; + +// patch $.event.$dispatch to allow suppressing clicks +var $dispatch = $event.dispatch; +$event.dispatch = function( event ){ + if ( $.data( this, "suppress."+ event.type ) - new Date().getTime() > 0 ){ + $.removeData( this, "suppress."+ event.type ); + return; + } + return $dispatch.apply( this, arguments ); +}; + +// event fix hooks for touch events... +var touchHooks = +$event.fixHooks.touchstart = +$event.fixHooks.touchmove = +$event.fixHooks.touchend = +$event.fixHooks.touchcancel = { + props: "clientX clientY pageX pageY screenX screenY".split( " " ), + filter: function( event, orig ) { + if ( orig ){ + var touched = ( orig.touches && orig.touches[0] ) + || ( orig.changedTouches && orig.changedTouches[0] ) + || null; + // iOS webkit: touchstart, touchmove, touchend + if ( touched ) + $.each( touchHooks.props, function( i, prop ){ + event[ prop ] = touched[ prop ]; + }); + } + return event; + } +}; + +// share the same special event configuration with related events... +$special.draginit = $special.dragstart = $special.dragend = drag; + +})( jQuery ); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jquery/jquery.fullscreen.js b/phpMyAdmin/js/vendor/jquery/jquery.fullscreen.js new file mode 100755 index 0000000..a9ada18 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.fullscreen.js @@ -0,0 +1,184 @@ +/** + * @preserve jquery.fullscreen 1.1.5 + * https://github.com/kayahr/jquery-fullscreen-plugin + * Copyright (C) 2012-2013 Klaus Reimer <k@ailis.de> + * Licensed under the MIT license + * (See http://www.opensource.org/licenses/mit-license) + */ + +(function(jQuery) { + +/** + * Sets or gets the fullscreen state. + * + * @param {boolean=} state + * True to enable fullscreen mode, false to disable it. If not + * specified then the current fullscreen state is returned. + * @return {boolean|Element|jQuery|null} + * When querying the fullscreen state then the current fullscreen + * element (or true if browser doesn't support it) is returned + * when browser is currently in full screen mode. False is returned + * if browser is not in full screen mode. Null is returned if + * browser doesn't support fullscreen mode at all. When setting + * the fullscreen state then the current jQuery selection is + * returned for chaining. + * @this {jQuery} + */ +function fullScreen(state) +{ + var e, func, doc; + + // Do nothing when nothing was selected + if (!this.length) return this; + + // We only use the first selected element because it doesn't make sense + // to fullscreen multiple elements. + e = (/** @type {Element} */ this[0]); + + // Find the real element and the document (Depends on whether the + // document itself or a HTML element was selected) + if (e.ownerDocument) + { + doc = e.ownerDocument; + } + else + { + doc = e; + e = doc.documentElement; + } + + // When no state was specified then return the current state. + if (state == null) + { + // When fullscreen mode is not supported then return null + if (!((/** @type {?Function} */ doc["exitFullscreen"]) + || (/** @type {?Function} */ doc["webkitExitFullscreen"]) + || (/** @type {?Function} */ doc["webkitCancelFullScreen"]) + || (/** @type {?Function} */ doc["msExitFullscreen"]) + || (/** @type {?Function} */ doc["mozCancelFullScreen"]))) + { + return null; + } + + // Check fullscreen state + state = !!doc["fullscreenElement"] + || !!doc["msFullscreenElement"] + || !!doc["webkitIsFullScreen"] + || !!doc["mozFullScreen"]; + if (!state) return state; + + // Return current fullscreen element or "true" if browser doesn't + // support this + return (/** @type {?Element} */ doc["fullscreenElement"]) + || (/** @type {?Element} */ doc["webkitFullscreenElement"]) + || (/** @type {?Element} */ doc["webkitCurrentFullScreenElement"]) + || (/** @type {?Element} */ doc["msFullscreenElement"]) + || (/** @type {?Element} */ doc["mozFullScreenElement"]) + || state; + } + + // When state was specified then enter or exit fullscreen mode. + if (state) + { + // Enter fullscreen + func = (/** @type {?Function} */ e["requestFullscreen"]) + || (/** @type {?Function} */ e["webkitRequestFullscreen"]) + || (/** @type {?Function} */ e["webkitRequestFullScreen"]) + || (/** @type {?Function} */ e["msRequestFullscreen"]) + || (/** @type {?Function} */ e["mozRequestFullScreen"]); + if (func) + { + func.call(e); + } + return this; + } + else + { + // Exit fullscreen + func = (/** @type {?Function} */ doc["exitFullscreen"]) + || (/** @type {?Function} */ doc["webkitExitFullscreen"]) + || (/** @type {?Function} */ doc["webkitCancelFullScreen"]) + || (/** @type {?Function} */ doc["msExitFullscreen"]) + || (/** @type {?Function} */ doc["mozCancelFullScreen"]); + if (func) func.call(doc); + return this; + } +} + +/** + * Toggles the fullscreen mode. + * + * @return {!jQuery} + * The jQuery selection for chaining. + * @this {jQuery} + */ +function toggleFullScreen() +{ + return (/** @type {!jQuery} */ fullScreen.call(this, + !fullScreen.call(this))); +} + +/** + * Handles the browser-specific fullscreenchange event and triggers + * a jquery event for it. + * + * @param {?Event} event + * The fullscreenchange event. + */ +function fullScreenChangeHandler(event) +{ + jQuery(document).trigger(new jQuery.Event("fullscreenchange")); +} + +/** + * Handles the browser-specific fullscreenerror event and triggers + * a jquery event for it. + * + * @param {?Event} event + * The fullscreenerror event. + */ +function fullScreenErrorHandler(event) +{ + jQuery(document).trigger(new jQuery.Event("fullscreenerror")); +} + +/** + * Installs the fullscreenchange event handler. + */ +function installFullScreenHandlers() +{ + var e, change, error; + + // Determine event name + e = document; + if (e["webkitCancelFullScreen"]) + { + change = "webkitfullscreenchange"; + error = "webkitfullscreenerror"; + } + else if (e["msExitFullscreen"]) + { + change = "MSFullscreenChange"; + error = "MSFullscreenError"; + } + else if (e["mozCancelFullScreen"]) + { + change = "mozfullscreenchange"; + error = "mozfullscreenerror"; + } + else + { + change = "fullscreenchange"; + error = "fullscreenerror"; + } + + // Install the event handlers + jQuery(document).bind(change, fullScreenChangeHandler); + jQuery(document).bind(error, fullScreenErrorHandler); +} + +jQuery.fn["fullScreen"] = fullScreen; +jQuery.fn["toggleFullScreen"] = toggleFullScreen; +installFullScreenHandlers(); + +})(jQuery); diff --git a/phpMyAdmin/js/vendor/jquery/jquery.md5.js b/phpMyAdmin/js/vendor/jquery/jquery.md5.js new file mode 100755 index 0000000..83273f7 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.md5.js @@ -0,0 +1,269 @@ +/* + * jQuery MD5 Plugin 1.2.1 + * https://github.com/blueimp/jQuery-MD5 + * + * Copyright 2010, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * http://creativecommons.org/licenses/MIT/ + * + * Based on + * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message + * Digest Algorithm, as defined in RFC 1321. + * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for more info. + */ + +/*jslint bitwise: true */ +/*global unescape, jQuery */ + +(function ($) { + 'use strict'; + + /* + * Add integers, wrapping at 2^32. This uses 16-bit operations internally + * to work around bugs in some JS interpreters. + */ + function safe_add(x, y) { + var lsw = (x & 0xFFFF) + (y & 0xFFFF), + msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xFFFF); + } + + /* + * Bitwise rotate a 32-bit number to the left. + */ + function bit_rol(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); + } + + /* + * These functions implement the four basic operations the algorithm uses. + */ + function md5_cmn(q, a, b, x, s, t) { + return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); + } + function md5_ff(a, b, c, d, x, s, t) { + return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t); + } + function md5_gg(a, b, c, d, x, s, t) { + return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t); + } + function md5_hh(a, b, c, d, x, s, t) { + return md5_cmn(b ^ c ^ d, a, b, x, s, t); + } + function md5_ii(a, b, c, d, x, s, t) { + return md5_cmn(c ^ (b | (~d)), a, b, x, s, t); + } + + /* + * Calculate the MD5 of an array of little-endian words, and a bit length. + */ + function binl_md5(x, len) { + /* append padding */ + x[len >> 5] |= 0x80 << ((len) % 32); + x[(((len + 64) >>> 9) << 4) + 14] = len; + + var i, olda, oldb, oldc, oldd, + a = 1732584193, + b = -271733879, + c = -1732584194, + d = 271733878; + + for (i = 0; i < x.length; i += 16) { + olda = a; + oldb = b; + oldc = c; + oldd = d; + + a = md5_ff(a, b, c, d, x[i], 7, -680876936); + d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5_ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329); + + a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5_gg(b, c, d, a, x[i], 20, -373897302); + a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734); + + a = md5_hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5_hh(d, a, b, c, x[i], 11, -358537222); + c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651); + + a = md5_ii(a, b, c, d, x[i], 6, -198630844); + d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551); + + a = safe_add(a, olda); + b = safe_add(b, oldb); + c = safe_add(c, oldc); + d = safe_add(d, oldd); + } + return [a, b, c, d]; + } + + /* + * Convert an array of little-endian words to a string + */ + function binl2rstr(input) { + var i, + output = ''; + for (i = 0; i < input.length * 32; i += 8) { + output += String.fromCharCode((input[i >> 5] >>> (i % 32)) & 0xFF); + } + return output; + } + + /* + * Convert a raw string to an array of little-endian words + * Characters >255 have their high-byte silently ignored. + */ + function rstr2binl(input) { + var i, + output = []; + output[(input.length >> 2) - 1] = undefined; + for (i = 0; i < output.length; i += 1) { + output[i] = 0; + } + for (i = 0; i < input.length * 8; i += 8) { + output[i >> 5] |= (input.charCodeAt(i / 8) & 0xFF) << (i % 32); + } + return output; + } + + /* + * Calculate the MD5 of a raw string + */ + function rstr_md5(s) { + return binl2rstr(binl_md5(rstr2binl(s), s.length * 8)); + } + + /* + * Calculate the HMAC-MD5, of a key and some data (raw strings) + */ + function rstr_hmac_md5(key, data) { + var i, + bkey = rstr2binl(key), + ipad = [], + opad = [], + hash; + ipad[15] = opad[15] = undefined; + if (bkey.length > 16) { + bkey = binl_md5(bkey, key.length * 8); + } + for (i = 0; i < 16; i += 1) { + ipad[i] = bkey[i] ^ 0x36363636; + opad[i] = bkey[i] ^ 0x5C5C5C5C; + } + hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8); + return binl2rstr(binl_md5(opad.concat(hash), 512 + 128)); + } + + /* + * Convert a raw string to a hex string + */ + function rstr2hex(input) { + var hex_tab = '0123456789abcdef', + output = '', + x, + i; + for (i = 0; i < input.length; i += 1) { + x = input.charCodeAt(i); + output += hex_tab.charAt((x >>> 4) & 0x0F) + + hex_tab.charAt(x & 0x0F); + } + return output; + } + + /* + * Encode a string as utf-8 + */ + function str2rstr_utf8(input) { + return unescape(encodeURIComponent(input)); + } + + /* + * Take string arguments and return either raw or hex encoded strings + */ + function raw_md5(s) { + return rstr_md5(str2rstr_utf8(s)); + } + function hex_md5(s) { + return rstr2hex(raw_md5(s)); + } + function raw_hmac_md5(k, d) { + return rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)); + } + function hex_hmac_md5(k, d) { + return rstr2hex(raw_hmac_md5(k, d)); + } + + $.md5 = function (string, key, raw) { + if (!key) { + if (!raw) { + return hex_md5(string); + } else { + return raw_md5(string); + } + } + if (!raw) { + return hex_hmac_md5(key, string); + } else { + return raw_hmac_md5(key, string); + } + }; + +}(typeof jQuery === 'function' ? jQuery : this)); diff --git a/phpMyAdmin/js/vendor/jquery/jquery.min.js b/phpMyAdmin/js/vendor/jquery/jquery.min.js new file mode 100755 index 0000000..a1c07fd --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.min.js @@ -0,0 +1,2 @@ +/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0<t&&t-1 in e)}k.fn=k.prototype={jquery:f,constructor:k,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=k.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return k.each(this,e)},map:function(n){return this.pushStack(k.map(this,function(e,t){return n.call(e,t,e)}))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(0<=n&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:u,sort:t.sort,splice:t.splice},k.extend=k.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||m(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(l&&r&&(k.isPlainObject(r)||(i=Array.isArray(r)))?(n=a[t],o=i&&!Array.isArray(n)?[]:i||k.isPlainObject(n)?n:{},i=!1,a[t]=k.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},k.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==o.call(e))&&(!(t=r(e))||"function"==typeof(n=v.call(t,"constructor")&&t.constructor)&&a.call(n)===l)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t){b(e,{nonce:t&&t.nonce})},each:function(e,t){var n,r=0;if(d(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(p,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(d(Object(e))?k.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:i.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r=[],i=0,o=e.length,a=!n;i<o;i++)!t(e[i],i)!==a&&r.push(e[i]);return r},map:function(e,t,n){var r,i,o=0,a=[];if(d(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&a.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&a.push(i);return g.apply([],a)},guid:1,support:y}),"function"==typeof Symbol&&(k.fn[Symbol.iterator]=t[Symbol.iterator]),k.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){n["[object "+t+"]"]=t.toLowerCase()});var h=function(n){var e,d,b,o,i,h,f,g,w,u,l,T,C,a,E,v,s,c,y,k="sizzle"+1*new Date,m=n.document,S=0,r=0,p=ue(),x=ue(),N=ue(),A=ue(),D=function(e,t){return e===t&&(l=!0),0},j={}.hasOwnProperty,t=[],q=t.pop,L=t.push,H=t.push,O=t.slice,P=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},R="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",I="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",W="\\["+M+"*("+I+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+I+"))|)"+M+"*\\]",$=":("+I+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+W+")*)|.*)\\)|)",F=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),_=new RegExp("^"+M+"*,"+M+"*"),z=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="<a id='"+k+"'></a><select id='"+k+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0<se(t,C,null,[e]).length},se.contains=function(e,t){return(e.ownerDocument||e)!==C&&T(e),y(e,t)},se.attr=function(e,t){(e.ownerDocument||e)!==C&&T(e);var n=b.attrHandle[t.toLowerCase()],r=n&&j.call(b.attrHandle,t.toLowerCase())?n(e,t,!E):void 0;return void 0!==r?r:d.attributes||!E?e.getAttribute(t):(r=e.getAttributeNode(t))&&r.specified?r.value:null},se.escape=function(e){return(e+"").replace(re,ie)},se.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},se.uniqueSort=function(e){var t,n=[],r=0,i=0;if(l=!d.detectDuplicates,u=!d.sortStable&&e.slice(0),e.sort(D),l){while(t=e[i++])t===e[i]&&(r=n.push(i));while(r--)e.splice(n[r],1)}return u=null,e},o=se.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else while(t=e[r++])n+=o(t);return n},(b=se.selectors={cacheLength:50,createPseudo:le,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1<t.indexOf(i):"$="===r?i&&t.slice(-i.length)===i:"~="===r?-1<(" "+t.replace(F," ")+" ").indexOf(i):"|="===r&&(t===i||t.slice(0,i.length+1)===i+"-"))}},CHILD:function(h,e,t,g,v){var y="nth"!==h.slice(0,3),m="last"!==h.slice(-4),x="of-type"===e;return 1===g&&0===v?function(e){return!!e.parentNode}:function(e,t,n){var r,i,o,a,s,u,l=y!==m?"nextSibling":"previousSibling",c=e.parentNode,f=x&&e.nodeName.toLowerCase(),p=!n&&!x,d=!1;if(c){if(y){while(l){a=e;while(a=a[l])if(x?a.nodeName.toLowerCase()===f:1===a.nodeType)return!1;u=l="only"===h&&!u&&"nextSibling"}return!0}if(u=[m?c.firstChild:c.lastChild],m&&p){d=(s=(r=(i=(o=(a=c)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1])&&r[2],a=s&&c.childNodes[s];while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if(1===a.nodeType&&++d&&a===e){i[h]=[S,s,d];break}}else if(p&&(d=s=(r=(i=(o=(a=e)[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]||[])[0]===S&&r[1]),!1===d)while(a=++s&&a&&a[l]||(d=s=0)||u.pop())if((x?a.nodeName.toLowerCase()===f:1===a.nodeType)&&++d&&(p&&((i=(o=a[k]||(a[k]={}))[a.uniqueID]||(o[a.uniqueID]={}))[h]=[S,d]),a===e))break;return(d-=v)===g||d%g==0&&0<=d/g}}},PSEUDO:function(e,o){var t,a=b.pseudos[e]||b.setFilters[e.toLowerCase()]||se.error("unsupported pseudo: "+e);return a[k]?a(o):1<a.length?(t=[e,e,"",o],b.setFilters.hasOwnProperty(e.toLowerCase())?le(function(e,t){var n,r=a(e,o),i=r.length;while(i--)e[n=P(e,r[i])]=!(t[n]=r[i])}):function(e){return a(e,0,t)}):a}},pseudos:{not:le(function(e){var r=[],i=[],s=f(e.replace(B,"$1"));return s[k]?le(function(e,t,n,r){var i,o=s(e,null,r,[]),a=e.length;while(a--)(i=o[a])&&(e[a]=!(t[a]=i))}):function(e,t,n){return r[0]=e,s(r,null,n,i),r[0]=null,!i.pop()}}),has:le(function(t){return function(e){return 0<se(t,e).length}}),contains:le(function(t){return t=t.replace(te,ne),function(e){return-1<(e.textContent||o(e)).indexOf(t)}}),lang:le(function(n){return V.test(n||"")||se.error("unsupported lang: "+n),n=n.replace(te,ne).toLowerCase(),function(e){var t;do{if(t=E?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(t=t.toLowerCase())===n||0===t.indexOf(n+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var t=n.location&&n.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===a},focus:function(e){return e===C.activeElement&&(!C.hasFocus||C.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:ge(!1),disabled:ge(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!b.pseudos.empty(e)},header:function(e){return J.test(e.nodeName)},input:function(e){return Q.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ve(function(){return[0]}),last:ve(function(e,t){return[t-1]}),eq:ve(function(e,t,n){return[n<0?n+t:n]}),even:ve(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:ve(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:ve(function(e,t,n){for(var r=n<0?n+t:t<n?t:n;0<=--r;)e.push(r);return e}),gt:ve(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=b.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})b.pseudos[e]=de(e);for(e in{submit:!0,reset:!0})b.pseudos[e]=he(e);function me(){}function xe(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function be(s,e,t){var u=e.dir,l=e.next,c=l||u,f=t&&"parentNode"===c,p=r++;return e.first?function(e,t,n){while(e=e[u])if(1===e.nodeType||f)return s(e,t,n);return!1}:function(e,t,n){var r,i,o,a=[S,p];if(n){while(e=e[u])if((1===e.nodeType||f)&&s(e,t,n))return!0}else while(e=e[u])if(1===e.nodeType||f)if(i=(o=e[k]||(e[k]={}))[e.uniqueID]||(o[e.uniqueID]={}),l&&l===e.nodeName.toLowerCase())e=e[u]||e;else{if((r=i[c])&&r[0]===S&&r[1]===p)return a[2]=r[2];if((i[c]=a)[2]=s(e,t,n))return!0}return!1}}function we(i){return 1<i.length?function(e,t,n){var r=i.length;while(r--)if(!i[r](e,t,n))return!1;return!0}:i[0]}function Te(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Ce(d,h,g,v,y,e){return v&&!v[k]&&(v=Ce(v)),y&&!y[k]&&(y=Ce(y,e)),le(function(e,t,n,r){var i,o,a,s=[],u=[],l=t.length,c=e||function(e,t,n){for(var r=0,i=t.length;r<i;r++)se(e,t[r],n);return n}(h||"*",n.nodeType?[n]:n,[]),f=!d||!e&&h?c:Te(c,s,d,n,r),p=g?y||(e?d:l||v)?[]:t:f;if(g&&g(f,p,n,r),v){i=Te(p,u),v(i,[],n,r),o=i.length;while(o--)(a=i[o])&&(p[u[o]]=!(f[u[o]]=a))}if(e){if(y||d){if(y){i=[],o=p.length;while(o--)(a=p[o])&&i.push(f[o]=a);y(null,p=[],i,r)}o=p.length;while(o--)(a=p[o])&&-1<(i=y?P(e,a):s[o])&&(e[i]=!(t[i]=a))}}else p=Te(p===t?p.splice(l,p.length):p),y?y(null,t,p,r):H.apply(t,p)})}function Ee(e){for(var i,t,n,r=e.length,o=b.relative[e[0].type],a=o||b.relative[" "],s=o?1:0,u=be(function(e){return e===i},a,!0),l=be(function(e){return-1<P(i,e)},a,!0),c=[function(e,t,n){var r=!o&&(n||t!==w)||((i=t).nodeType?u(e,t,n):l(e,t,n));return i=null,r}];s<r;s++)if(t=b.relative[e[s].type])c=[be(we(c),t)];else{if((t=b.filter[e[s].type].apply(null,e[s].matches))[k]){for(n=++s;n<r;n++)if(b.relative[e[n].type])break;return Ce(1<s&&we(c),1<s&&xe(e.slice(0,s-1).concat({value:" "===e[s-2].type?"*":""})).replace(B,"$1"),t,s<n&&Ee(e.slice(s,n)),n<r&&Ee(e=e.slice(n)),n<r&&xe(e))}c.push(t)}return we(c)}return me.prototype=b.filters=b.pseudos,b.setFilters=new me,h=se.tokenize=function(e,t){var n,r,i,o,a,s,u,l=x[e+" "];if(l)return t?0:l.slice(0);a=e,s=[],u=b.preFilter;while(a){for(o in n&&!(r=_.exec(a))||(r&&(a=a.slice(r[0].length)||a),s.push(i=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(B," ")}),a=a.slice(n.length)),b.filter)!(r=G[o].exec(a))||u[o]&&!(r=u[o](r))||(n=r.shift(),i.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?se.error(e):x(e,s).slice(0)},f=se.compile=function(e,t){var n,v,y,m,x,r,i=[],o=[],a=N[e+" "];if(!a){t||(t=h(e)),n=t.length;while(n--)(a=Ee(t[n]))[k]?i.push(a):o.push(a);(a=N(e,(v=o,m=0<(y=i).length,x=0<v.length,r=function(e,t,n,r,i){var o,a,s,u=0,l="0",c=e&&[],f=[],p=w,d=e||x&&b.find.TAG("*",i),h=S+=null==p?1:Math.random()||.1,g=d.length;for(i&&(w=t===C||t||i);l!==g&&null!=(o=d[l]);l++){if(x&&o){a=0,t||o.ownerDocument===C||(T(o),n=!E);while(s=v[a++])if(s(o,t||C,n)){r.push(o);break}i&&(S=h)}m&&((o=!s&&o)&&u--,e&&c.push(o))}if(u+=l,m&&l!==u){a=0;while(s=y[a++])s(c,f,t,n);if(e){if(0<u)while(l--)c[l]||f[l]||(f[l]=q.call(r));f=Te(f)}H.apply(r,f),i&&!e&&0<f.length&&1<u+y.length&&se.uniqueSort(r)}return i&&(S=h,w=p),c},m?le(r):r))).selector=e}return a},g=se.select=function(e,t,n,r){var i,o,a,s,u,l="function"==typeof e&&e,c=!r&&h(e=l.selector||e);if(n=n||[],1===c.length){if(2<(o=c[0]=c[0].slice(0)).length&&"ID"===(a=o[0]).type&&9===t.nodeType&&E&&b.relative[o[1].type]){if(!(t=(b.find.ID(a.matches[0].replace(te,ne),t)||[])[0]))return n;l&&(t=t.parentNode),e=e.slice(o.shift().value.length)}i=G.needsContext.test(e)?0:o.length;while(i--){if(a=o[i],b.relative[s=a.type])break;if((u=b.find[s])&&(r=u(a.matches[0].replace(te,ne),ee.test(o[0].type)&&ye(t.parentNode)||t))){if(o.splice(i,1),!(e=r.length&&xe(o)))return H.apply(n,r),n;break}}}return(l||f(e,c))(r,t,!E,n,!t||ee.test(e)&&ye(t.parentNode)||t),n},d.sortStable=k.split("").sort(D).join("")===k,d.detectDuplicates=!!l,T(),d.sortDetached=ce(function(e){return 1&e.compareDocumentPosition(C.createElement("fieldset"))}),ce(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||fe("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),d.attributes&&ce(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||fe("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ce(function(e){return null==e.getAttribute("disabled")})||fe(R,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),se}(C);k.find=h,k.expr=h.selectors,k.expr[":"]=k.expr.pseudos,k.uniqueSort=k.unique=h.uniqueSort,k.text=h.getText,k.isXMLDoc=h.isXML,k.contains=h.contains,k.escapeSelector=h.escape;var T=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&k(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},N=k.expr.match.needsContext;function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1<i.call(n,e)!==r}):k.filter(n,e,r)}k.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?k.find.matchesSelector(r,e)?[r]:[]:k.find.matches(e,k.grep(t,function(e){return 1===e.nodeType}))},k.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(k(e).filter(function(){for(t=0;t<r;t++)if(k.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)k.find(e,i[t],n);return 1<r?k.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&N.test(e)?k(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(k.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&k(e);if(!N.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?-1<a.index(n):1===n.nodeType&&k.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(1<o.length?k.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?i.call(k(e),this[0]):i.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(k.uniqueSort(k.merge(this.get(),k(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),k.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return T(e,"parentNode")},parentsUntil:function(e,t,n){return T(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return T(e,"nextSibling")},prevAll:function(e){return T(e,"previousSibling")},nextUntil:function(e,t,n){return T(e,"nextSibling",n)},prevUntil:function(e,t,n){return T(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return"undefined"!=typeof e.contentDocument?e.contentDocument:(A(e,"template")&&(e=e.content||e),k.merge([],e.childNodes))}},function(r,i){k.fn[r]=function(e,t){var n=k.map(this,i,e);return"Until"!==r.slice(-5)&&(t=e),t&&"string"==typeof t&&(n=k.filter(t,n)),1<this.length&&(O[r]||k.uniqueSort(n),H.test(r)&&n.reverse()),this.pushStack(n)}});var R=/[^\x20\t\r\n\f]+/g;function M(e){return e}function I(e){throw e}function W(e,t,n,r){var i;try{e&&m(i=e.promise)?i.call(e).done(t).fail(n):e&&m(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}k.Callbacks=function(r){var e,n;r="string"==typeof r?(e=r,n={},k.each(e.match(R)||[],function(e,t){n[t]=!0}),n):k.extend({},r);var i,t,o,a,s=[],u=[],l=-1,c=function(){for(a=a||r.once,o=i=!0;u.length;l=-1){t=u.shift();while(++l<s.length)!1===s[l].apply(t[0],t[1])&&r.stopOnFalse&&(l=s.length,t=!1)}r.memory||(t=!1),i=!1,a&&(s=t?[]:"")},f={add:function(){return s&&(t&&!i&&(l=s.length-1,u.push(t)),function n(e){k.each(e,function(e,t){m(t)?r.unique&&f.has(t)||s.push(t):t&&t.length&&"string"!==w(t)&&n(t)})}(arguments),t&&!i&&c()),this},remove:function(){return k.each(arguments,function(e,t){var n;while(-1<(n=k.inArray(t,s,n)))s.splice(n,1),n<=l&&l--}),this},has:function(e){return e?-1<k.inArray(e,s):0<s.length},empty:function(){return s&&(s=[]),this},disable:function(){return a=u=[],s=t="",this},disabled:function(){return!s},lock:function(){return a=u=[],t||i||(s=t=""),this},locked:function(){return!!a},fireWith:function(e,t){return a||(t=[e,(t=t||[]).slice?t.slice():t],u.push(t),i||c()),this},fire:function(){return f.fireWith(this,arguments),this},fired:function(){return!!o}};return f},k.extend({Deferred:function(e){var o=[["notify","progress",k.Callbacks("memory"),k.Callbacks("memory"),2],["resolve","done",k.Callbacks("once memory"),k.Callbacks("once memory"),0,"resolved"],["reject","fail",k.Callbacks("once memory"),k.Callbacks("once memory"),1,"rejected"]],i="pending",a={state:function(){return i},always:function(){return s.done(arguments).fail(arguments),this},"catch":function(e){return a.then(null,e)},pipe:function(){var i=arguments;return k.Deferred(function(r){k.each(o,function(e,t){var n=m(i[t[4]])&&i[t[4]];s[t[1]](function(){var e=n&&n.apply(this,arguments);e&&m(e.promise)?e.promise().progress(r.notify).done(r.resolve).fail(r.reject):r[t[0]+"With"](this,n?[e]:arguments)})}),i=null}).promise()},then:function(t,n,r){var u=0;function l(i,o,a,s){return function(){var n=this,r=arguments,e=function(){var e,t;if(!(i<u)){if((e=a.apply(n,r))===o.promise())throw new TypeError("Thenable self-resolution");t=e&&("object"==typeof e||"function"==typeof e)&&e.then,m(t)?s?t.call(e,l(u,o,M,s),l(u,o,I,s)):(u++,t.call(e,l(u,o,M,s),l(u,o,I,s),l(u,o,M,o.notifyWith))):(a!==M&&(n=void 0,r=[e]),(s||o.resolveWith)(n,r))}},t=s?e:function(){try{e()}catch(e){k.Deferred.exceptionHook&&k.Deferred.exceptionHook(e,t.stackTrace),u<=i+1&&(a!==I&&(n=void 0,r=[e]),o.rejectWith(n,r))}};i?t():(k.Deferred.getStackHook&&(t.stackTrace=k.Deferred.getStackHook()),C.setTimeout(t))}}return k.Deferred(function(e){o[0][3].add(l(0,e,m(r)?r:M,e.notifyWith)),o[1][3].add(l(0,e,m(t)?t:M)),o[2][3].add(l(0,e,m(n)?n:I))}).promise()},promise:function(e){return null!=e?k.extend(e,a):a}},s={};return k.each(o,function(e,t){var n=t[2],r=t[5];a[t[1]]=n.add,r&&n.add(function(){i=r},o[3-e][2].disable,o[3-e][3].disable,o[0][2].lock,o[0][3].lock),n.add(t[3].fire),s[t[0]]=function(){return s[t[0]+"With"](this===s?void 0:this,arguments),this},s[t[0]+"With"]=n.fireWith}),a.promise(s),e&&e.call(s,s),s},when:function(e){var n=arguments.length,t=n,r=Array(t),i=s.call(arguments),o=k.Deferred(),a=function(t){return function(e){r[t]=this,i[t]=1<arguments.length?s.call(arguments):e,--n||o.resolveWith(r,i)}};if(n<=1&&(W(e,o.done(a(t)).resolve,o.reject,!n),"pending"===o.state()||m(i[t]&&i[t].then)))return o.then();while(t--)W(i[t],a(t),o.reject);return o.promise()}});var $=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;k.Deferred.exceptionHook=function(e,t){C.console&&C.console.warn&&e&&$.test(e.name)&&C.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},k.readyException=function(e){C.setTimeout(function(){throw e})};var F=k.Deferred();function B(){E.removeEventListener("DOMContentLoaded",B),C.removeEventListener("load",B),k.ready()}k.fn.ready=function(e){return F.then(e)["catch"](function(e){k.readyException(e)}),this},k.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--k.readyWait:k.isReady)||(k.isReady=!0)!==e&&0<--k.readyWait||F.resolveWith(E,[k])}}),k.ready.then=F.then,"complete"===E.readyState||"loading"!==E.readyState&&!E.documentElement.doScroll?C.setTimeout(k.ready):(E.addEventListener("DOMContentLoaded",B),C.addEventListener("load",B));var _=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===w(n))for(s in i=!0,n)_(e,t,s,n[s],!0,o,a);else if(void 0!==r&&(i=!0,m(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(k(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},z=/^-ms-/,U=/-([a-z])/g;function X(e,t){return t.toUpperCase()}function V(e){return e.replace(z,"ms-").replace(U,X)}var G=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Y(){this.expando=k.expando+Y.uid++}Y.uid=1,Y.prototype={cache:function(e){var t=e[this.expando];return t||(t={},G(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[V(t)]=n;else for(r in t)i[V(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][V(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(V):(t=V(t))in r?[t]:t.match(R)||[]).length;while(n--)delete r[t[n]]}(void 0===t||k.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!k.isEmptyObject(t)}};var Q=new Y,J=new Y,K=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,Z=/[A-Z]/g;function ee(e,t,n){var r,i;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(Z,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n="true"===(i=n)||"false"!==i&&("null"===i?null:i===+i+""?+i:K.test(i)?JSON.parse(i):i)}catch(e){}J.set(e,t,n)}else n=void 0;return n}k.extend({hasData:function(e){return J.hasData(e)||Q.hasData(e)},data:function(e,t,n){return J.access(e,t,n)},removeData:function(e,t){J.remove(e,t)},_data:function(e,t,n){return Q.access(e,t,n)},_removeData:function(e,t){Q.remove(e,t)}}),k.fn.extend({data:function(n,e){var t,r,i,o=this[0],a=o&&o.attributes;if(void 0===n){if(this.length&&(i=J.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){t=a.length;while(t--)a[t]&&0===(r=a[t].name).indexOf("data-")&&(r=V(r.slice(5)),ee(o,r,i[r]));Q.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof n?this.each(function(){J.set(this,n)}):_(this,function(e){var t;if(o&&void 0===e)return void 0!==(t=J.get(o,n))?t:void 0!==(t=ee(o,n))?t:void 0;this.each(function(){J.set(this,n,e)})},null,e,1<arguments.length,null,!0)},removeData:function(e){return this.each(function(){J.remove(this,e)})}}),k.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=Q.get(e,t),n&&(!r||Array.isArray(n)?r=Q.access(e,t,k.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=k.queue(e,t),r=n.length,i=n.shift(),o=k._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,function(){k.dequeue(e,t)},o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return Q.get(e,n)||Q.access(e,n,{empty:k.Callbacks("once memory").add(function(){Q.remove(e,[t+"queue",n])})})}}),k.fn.extend({queue:function(t,n){var e=2;return"string"!=typeof t&&(n=t,t="fx",e--),arguments.length<e?k.queue(this[0],t):void 0===n?this:this.each(function(){var e=k.queue(this,t,n);k._queueHooks(this,t),"fx"===t&&"inprogress"!==e[0]&&k.dequeue(this,t)})},dequeue:function(e){return this.each(function(){k.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=k.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=Q.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var te=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ne=new RegExp("^(?:([+-])=|)("+te+")([a-z%]*)$","i"),re=["Top","Right","Bottom","Left"],ie=E.documentElement,oe=function(e){return k.contains(e.ownerDocument,e)},ae={composed:!0};ie.getRootNode&&(oe=function(e){return k.contains(e.ownerDocument,e)||e.getRootNode(ae)===e.ownerDocument});var se=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&oe(e)&&"none"===k.css(e,"display")},ue=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];for(o in i=n.apply(e,r||[]),t)e.style[o]=a[o];return i};function le(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return k.css(e,t,"")},u=s(),l=n&&n[3]||(k.cssNumber[t]?"":"px"),c=e.nodeType&&(k.cssNumber[t]||"px"!==l&&+u)&&ne.exec(k.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)k.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,k.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var ce={};function fe(e,t){for(var n,r,i,o,a,s,u,l=[],c=0,f=e.length;c<f;c++)(r=e[c]).style&&(n=r.style.display,t?("none"===n&&(l[c]=Q.get(r,"display")||null,l[c]||(r.style.display="")),""===r.style.display&&se(r)&&(l[c]=(u=a=o=void 0,a=(i=r).ownerDocument,s=i.nodeName,(u=ce[s])||(o=a.body.appendChild(a.createElement(s)),u=k.css(o,"display"),o.parentNode.removeChild(o),"none"===u&&(u="block"),ce[s]=u)))):"none"!==n&&(l[c]="none",Q.set(r,"display",n)));for(c=0;c<f;c++)null!=l[c]&&(e[c].style.display=l[c]);return e}k.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){se(this)?k(this).show():k(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n<r;n++)Q.set(e[n],"globalEval",!t||Q.get(t[n],"globalEval"))}ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;var me,xe,be=/<|&#?\w+;/;function we(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===w(o))k.merge(p,o.nodeType?[o]:o);else if(be.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+k.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;k.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&-1<k.inArray(o,r))i&&i.push(o);else if(l=oe(o),a=ve(f.appendChild(o),"script"),l&&ye(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}me=E.createDocumentFragment().appendChild(E.createElement("div")),(xe=E.createElement("input")).setAttribute("type","radio"),xe.setAttribute("checked","checked"),xe.setAttribute("name","t"),me.appendChild(xe),y.checkClone=me.cloneNode(!0).cloneNode(!0).lastChild.checked,me.innerHTML="<textarea>x</textarea>",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t<arguments.length;t++)u[t]=arguments[t];if(s.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,s)){a=k.event.handlers.call(this,s,l),t=0;while((i=a[t++])&&!s.isPropagationStopped()){s.currentTarget=i.elem,n=0;while((o=i.handlers[n++])&&!s.isImmediatePropagationStopped())s.rnamespace&&!1!==o.namespace&&!s.rnamespace.test(o.namespace)||(s.handleObj=o,s.data=o.data,void 0!==(r=((k.event.special[o.origType]||{}).handle||o.handler).apply(i.elem,u))&&!1===(s.result=r)&&(s.preventDefault(),s.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,s),s.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&1<=e.button))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?-1<k(i,this).index(l):k.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(t,e){Object.defineProperty(k.Event.prototype,t,{enumerable:!0,configurable:!0,get:m(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(e){return e[k.expando]?e:new k.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click",ke),!1},trigger:function(e){var t=this||e;return pe.test(t.type)&&t.click&&A(t,"input")&&De(t,"click"),!0},_default:function(e){var t=e.target;return pe.test(t.type)&&t.click&&A(t,"input")&&Q.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},k.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},k.Event=function(e,t){if(!(this instanceof k.Event))return new k.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?ke:Se,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&k.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[k.expando]=!0},k.Event.prototype={constructor:k.Event,isDefaultPrevented:Se,isPropagationStopped:Se,isImmediatePropagationStopped:Se,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=ke,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=ke,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=ke,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},k.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&Te.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Ce.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},k.event.addProp),k.each({focus:"focusin",blur:"focusout"},function(e,t){k.event.special[e]={setup:function(){return De(this,e,Ne),!1},trigger:function(){return De(this,e),!0},delegateType:t}}),k.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,i){k.event.special[e]={delegateType:i,bindType:i,handle:function(e){var t,n=e.relatedTarget,r=e.handleObj;return n&&(n===this||k.contains(this,n))||(e.type=r.origType,t=r.handler.apply(this,arguments),e.type=i),t}}}),k.fn.extend({on:function(e,t,n,r){return Ae(this,e,t,n,r)},one:function(e,t,n,r){return Ae(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,k(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=Se),this.each(function(){k.event.remove(this,e,n,t)})}});var je=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/<script|<style|<link/i,Le=/checked\s*(?:[^=]|=\s*.checked.)/i,He=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n<r;n++)k.event.add(t,i,l[i][n]);J.hasData(e)&&(s=J.access(e),u=k.extend({},s),J.set(t,u))}}function Ie(n,r,i,o){r=g.apply([],r);var e,t,a,s,u,l,c=0,f=n.length,p=f-1,d=r[0],h=m(d);if(h||1<f&&"string"==typeof d&&!y.checkClone&&Le.test(d))return n.each(function(e){var t=n.eq(e);h&&(r[0]=d.call(this,e,t.html())),Ie(t,r,i,o)});if(f&&(t=(e=we(r,n[0].ownerDocument,!1,n,o)).firstChild,1===e.childNodes.length&&(e=t),t||o)){for(s=(a=k.map(ve(e,"script"),Pe)).length;c<f;c++)u=e,c!==p&&(u=k.clone(u,!0,!0),s&&k.merge(a,ve(u,"script"))),i.call(n[c],u,c);if(s)for(l=a[a.length-1].ownerDocument,k.map(a,Re),c=0;c<s;c++)u=a[c],he.test(u.type||"")&&!Q.access(u,"globalEval")&&k.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?k._evalUrl&&!u.noModule&&k._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")}):b(u.textContent.replace(He,""),u,l))}return n}function We(e,t,n){for(var r,i=t?k.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||k.cleanData(ve(r)),r.parentNode&&(n&&oe(r)&&ye(ve(r,"script")),r.parentNode.removeChild(r));return e}k.extend({htmlPrefilter:function(e){return e.replace(je,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r<i;r++)s=o[r],u=a[r],void 0,"input"===(l=u.nodeName.toLowerCase())&&pe.test(s.type)?u.checked=s.checked:"input"!==l&&"textarea"!==l||(u.defaultValue=s.defaultValue);if(t)if(n)for(o=o||ve(e),a=a||ve(c),r=0,i=o.length;r<i;r++)Me(o[r],a[r]);else Me(e,c);return 0<(a=ve(c,"script")).length&&ye(a,!f&&ve(e,"script")),c},cleanData:function(e){for(var t,n,r,i=k.event.special,o=0;void 0!==(n=e[o]);o++)if(G(n)){if(t=n[Q.expando]){if(t.events)for(r in t.events)i[r]?k.event.remove(n,r):k.removeEvent(n,r,t.handle);n[Q.expando]=void 0}n[J.expando]&&(n[J.expando]=void 0)}}}),k.fn.extend({detach:function(e){return We(this,e,!0)},remove:function(e){return We(this,e)},text:function(e){return _(this,function(e){return void 0===e?k.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Ie(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Oe(this,e).appendChild(e)})},prepend:function(){return Ie(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Oe(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Ie(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(k.cleanData(ve(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return k.clone(this,e,t)})},html:function(e){return _(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!qe.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=k.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(k.cleanData(ve(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var n=[];return Ie(this,arguments,function(e){var t=this.parentNode;k.inArray(this,n)<0&&(k.cleanData(ve(this)),t&&t.replaceChild(e,this))},n)}}),k.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,a){k.fn[e]=function(e){for(var t,n=[],r=k(e),i=r.length-1,o=0;o<=i;o++)t=o===i?this:this.clone(!0),k(r[o])[a](t),u.apply(n,t.get());return this.pushStack(n)}});var $e=new RegExp("^("+te+")(?!px)[a-z%]+$","i"),Fe=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=C),t.getComputedStyle(e)},Be=new RegExp(re.join("|"),"i");function _e(e,t,n){var r,i,o,a,s=e.style;return(n=n||Fe(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||oe(e)||(a=k.style(e,t)),!y.pixelBoxStyles()&&$e.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(u){s.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",u.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",ie.appendChild(s).appendChild(u);var e=C.getComputedStyle(u);n="1%"!==e.top,a=12===t(e.marginLeft),u.style.right="60%",o=36===t(e.right),r=36===t(e.width),u.style.position="absolute",i=12===t(u.offsetWidth/3),ie.removeChild(s),u=null}}function t(e){return Math.round(parseFloat(e))}var n,r,i,o,a,s=E.createElement("div"),u=E.createElement("div");u.style&&(u.style.backgroundClip="content-box",u.cloneNode(!0).style.backgroundClip="",y.clearCloneStyle="content-box"===u.style.backgroundClip,k.extend(y,{boxSizingReliable:function(){return e(),r},pixelBoxStyles:function(){return e(),o},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),a},scrollboxSize:function(){return e(),i}}))}();var Ue=["Webkit","Moz","ms"],Xe=E.createElement("div").style,Ve={};function Ge(e){var t=k.cssProps[e]||Ve[e];return t||(e in Xe?e:Ve[e]=function(e){var t=e[0].toUpperCase()+e.slice(1),n=Ue.length;while(n--)if((e=Ue[n]+t)in Xe)return e}(e)||e)}var Ye=/^(none|table(?!-c[ea]).+)/,Qe=/^--/,Je={position:"absolute",visibility:"hidden",display:"block"},Ke={letterSpacing:"0",fontWeight:"400"};function Ze(e,t,n){var r=ne.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function et(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=k.css(e,n+re[a],!0,i)),r?("content"===n&&(u-=k.css(e,"padding"+re[a],!0,i)),"margin"!==n&&(u-=k.css(e,"border"+re[a]+"Width",!0,i))):(u+=k.css(e,"padding"+re[a],!0,i),"padding"!==n?u+=k.css(e,"border"+re[a]+"Width",!0,i):s+=k.css(e,"border"+re[a]+"Width",!0,i));return!r&&0<=o&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))||0),u}function tt(e,t,n){var r=Fe(e),i=(!y.boxSizingReliable()||n)&&"border-box"===k.css(e,"boxSizing",!1,r),o=i,a=_e(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if($e.test(a)){if(!n)return a;a="auto"}return(!y.boxSizingReliable()&&i||"auto"===a||!parseFloat(a)&&"inline"===k.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===k.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+et(e,t,n||(i?"border":"content"),o,r,a)+"px"}function nt(e,t,n,r,i){return new nt.prototype.init(e,t,n,r,i)}k.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=_e(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=V(t),u=Qe.test(t),l=e.style;if(u||(t=Ge(s)),a=k.cssHooks[t]||k.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"===(o=typeof n)&&(i=ne.exec(n))&&i[1]&&(n=le(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=i&&i[3]||(k.cssNumber[s]?"":"px")),y.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=V(t);return Qe.test(t)||(t=Ge(s)),(a=k.cssHooks[t]||k.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=_e(e,t,r)),"normal"===i&&t in Ke&&(i=Ke[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),k.each(["height","width"],function(e,u){k.cssHooks[u]={get:function(e,t,n){if(t)return!Ye.test(k.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?tt(e,u,n):ue(e,Je,function(){return tt(e,u,n)})},set:function(e,t,n){var r,i=Fe(e),o=!y.scrollboxSize()&&"absolute"===i.position,a=(o||n)&&"border-box"===k.css(e,"boxSizing",!1,i),s=n?et(e,u,n,a,i):0;return a&&o&&(s-=Math.ceil(e["offset"+u[0].toUpperCase()+u.slice(1)]-parseFloat(i[u])-et(e,u,"border",!1,i)-.5)),s&&(r=ne.exec(t))&&"px"!==(r[3]||"px")&&(e.style[u]=t,t=k.css(e,u)),Ze(0,t,s)}}}),k.cssHooks.marginLeft=ze(y.reliableMarginLeft,function(e,t){if(t)return(parseFloat(_e(e,"marginLeft"))||e.getBoundingClientRect().left-ue(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),k.each({margin:"",padding:"",border:"Width"},function(i,o){k.cssHooks[i+o]={expand:function(e){for(var t=0,n={},r="string"==typeof e?e.split(" "):[e];t<4;t++)n[i+re[t]+o]=r[t]||r[t-2]||r[0];return n}},"margin"!==i&&(k.cssHooks[i+o].set=Ze)}),k.fn.extend({css:function(e,t){return _(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Fe(e),i=t.length;a<i;a++)o[t[a]]=k.css(e,t[a],!1,r);return o}return void 0!==n?k.style(e,t,n):k.css(e,t)},e,t,1<arguments.length)}}),((k.Tween=nt).prototype={constructor:nt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||k.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(k.cssNumber[n]?"":"px")},cur:function(){var e=nt.propHooks[this.prop];return e&&e.get?e.get(this):nt.propHooks._default.get(this)},run:function(e){var t,n=nt.propHooks[this.prop];return this.options.duration?this.pos=t=k.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):nt.propHooks._default.set(this),this}}).init.prototype=nt.prototype,(nt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=k.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){k.fx.step[e.prop]?k.fx.step[e.prop](e):1!==e.elem.nodeType||!k.cssHooks[e.prop]&&null==e.elem.style[Ge(e.prop)]?e.elem[e.prop]=e.now:k.style(e.elem,e.prop,e.now+e.unit)}}}).scrollTop=nt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},k.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},k.fx=nt.prototype.init,k.fx.step={};var rt,it,ot,at,st=/^(?:toggle|show|hide)$/,ut=/queueHooks$/;function lt(){it&&(!1===E.hidden&&C.requestAnimationFrame?C.requestAnimationFrame(lt):C.setTimeout(lt,k.fx.interval),k.fx.tick())}function ct(){return C.setTimeout(function(){rt=void 0}),rt=Date.now()}function ft(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=re[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function pt(e,t,n){for(var r,i=(dt.tweeners[t]||[]).concat(dt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function dt(o,e,t){var n,a,r=0,i=dt.prefilters.length,s=k.Deferred().always(function(){delete u.elem}),u=function(){if(a)return!1;for(var e=rt||ct(),t=Math.max(0,l.startTime+l.duration-e),n=1-(t/l.duration||0),r=0,i=l.tweens.length;r<i;r++)l.tweens[r].run(n);return s.notifyWith(o,[l,n,t]),n<1&&i?t:(i||s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l]),!1)},l=s.promise({elem:o,props:k.extend({},e),opts:k.extend(!0,{specialEasing:{},easing:k.easing._default},t),originalProperties:e,originalOptions:t,startTime:rt||ct(),duration:t.duration,tweens:[],createTween:function(e,t){var n=k.Tween(o,l.opts,e,t,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var t=0,n=e?l.tweens.length:0;if(a)return this;for(a=!0;t<n;t++)l.tweens[t].run(1);return e?(s.notifyWith(o,[l,1,0]),s.resolveWith(o,[l,e])):s.rejectWith(o,[l,e]),this}}),c=l.props;for(!function(e,t){var n,r,i,o,a;for(n in e)if(i=t[r=V(n)],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=k.cssHooks[r])&&"expand"in a)for(n in o=a.expand(o),delete e[r],o)n in e||(e[n]=o[n],t[n]=i);else t[r]=i}(c,l.opts.specialEasing);r<i;r++)if(n=dt.prefilters[r].call(l,o,c,l.opts))return m(n.stop)&&(k._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return k.map(c,pt,l),m(l.opts.start)&&l.opts.start.call(o,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),k.fx.timer(k.extend(u,{elem:o,anim:l,queue:l.opts.queue})),l}k.Animation=k.extend(dt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return le(n.elem,e,ne.exec(t),n),n}]},tweener:function(e,t){m(e)?(t=e,e=["*"]):e=e.match(R);for(var n,r=0,i=e.length;r<i;r++)n=e[r],dt.tweeners[n]=dt.tweeners[n]||[],dt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&se(e),v=Q.get(e,"fxshow");for(r in n.queue||(null==(a=k._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,k.queue(e,"fx").length||a.empty.fire()})})),t)if(i=t[r],st.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!v||void 0===v[r])continue;g=!0}d[r]=v&&v[r]||k.style(e,r)}if((u=!k.isEmptyObject(t))||!k.isEmptyObject(d))for(r in f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=v&&v.display)&&(l=Q.get(e,"display")),"none"===(c=k.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=k.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===k.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1,d)u||(v?"hidden"in v&&(g=v.hidden):v=Q.access(e,"fxshow",{display:l}),o&&(v.hidden=!g),g&&fe([e],!0),p.done(function(){for(r in g||fe([e]),Q.remove(e,"fxshow"),d)k.style(e,r,d[r])})),u=pt(g?v[r]:0,r,p),r in v||(v[r]=u.start,g&&(u.end=u.start,u.start=0))}],prefilter:function(e,t){t?dt.prefilters.unshift(e):dt.prefilters.push(e)}}),k.speed=function(e,t,n){var r=e&&"object"==typeof e?k.extend({},e):{complete:n||!n&&t||m(e)&&e,duration:e,easing:n&&t||t&&!m(t)&&t};return k.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in k.fx.speeds?r.duration=k.fx.speeds[r.duration]:r.duration=k.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){m(r.old)&&r.old.call(this),r.queue&&k.dequeue(this,r.queue)},r},k.fn.extend({fadeTo:function(e,t,n,r){return this.filter(se).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(t,e,n,r){var i=k.isEmptyObject(t),o=k.speed(e,n,r),a=function(){var e=dt(this,k.extend({},t),o);(i||Q.get(this,"finish"))&&e.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(i,e,o){var a=function(e){var t=e.stop;delete e.stop,t(o)};return"string"!=typeof i&&(o=e,e=i,i=void 0),e&&!1!==i&&this.queue(i||"fx",[]),this.each(function(){var e=!0,t=null!=i&&i+"queueHooks",n=k.timers,r=Q.get(this);if(t)r[t]&&r[t].stop&&a(r[t]);else for(t in r)r[t]&&r[t].stop&&ut.test(t)&&a(r[t]);for(t=n.length;t--;)n[t].elem!==this||null!=i&&n[t].queue!==i||(n[t].anim.stop(o),e=!1,n.splice(t,1));!e&&o||k.dequeue(this,i)})},finish:function(a){return!1!==a&&(a=a||"fx"),this.each(function(){var e,t=Q.get(this),n=t[a+"queue"],r=t[a+"queueHooks"],i=k.timers,o=n?n.length:0;for(t.finish=!0,k.queue(this,a,[]),r&&r.stop&&r.stop.call(this,!0),e=i.length;e--;)i[e].elem===this&&i[e].queue===a&&(i[e].anim.stop(!0),i.splice(e,1));for(e=0;e<o;e++)n[e]&&n[e].finish&&n[e].finish.call(this);delete t.finish})}}),k.each(["toggle","show","hide"],function(e,r){var i=k.fn[r];k.fn[r]=function(e,t,n){return null==e||"boolean"==typeof e?i.apply(this,arguments):this.animate(ft(r,!0),e,t,n)}}),k.each({slideDown:ft("show"),slideUp:ft("hide"),slideToggle:ft("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,r){k.fn[e]=function(e,t,n){return this.animate(r,e,t,n)}}),k.timers=[],k.fx.tick=function(){var e,t=0,n=k.timers;for(rt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||k.fx.stop(),rt=void 0},k.fx.timer=function(e){k.timers.push(e),k.fx.start()},k.fx.interval=13,k.fx.start=function(){it||(it=!0,lt())},k.fx.stop=function(){it=null},k.fx.speeds={slow:600,fast:200,_default:400},k.fn.delay=function(r,e){return r=k.fx&&k.fx.speeds[r]||r,e=e||"fx",this.queue(e,function(e,t){var n=C.setTimeout(e,r);t.stop=function(){C.clearTimeout(n)}})},ot=E.createElement("input"),at=E.createElement("select").appendChild(E.createElement("option")),ot.type="checkbox",y.checkOn=""!==ot.value,y.optSelected=at.selected,(ot=E.createElement("input")).value="t",ot.type="radio",y.radioValue="t"===ot.value;var ht,gt=k.expr.attrHandle;k.fn.extend({attr:function(e,t){return _(this,k.attr,e,t,1<arguments.length)},removeAttr:function(e){return this.each(function(){k.removeAttr(this,e)})}}),k.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?k.prop(e,t,n):(1===o&&k.isXMLDoc(e)||(i=k.attrHooks[t.toLowerCase()]||(k.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void k.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=k.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!y.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(R);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),ht={set:function(e,t,n){return!1===t?k.removeAttr(e,n):e.setAttribute(n,n),n}},k.each(k.expr.match.bool.source.match(/\w+/g),function(e,t){var a=gt[t]||k.find.attr;gt[t]=function(e,t,n){var r,i,o=t.toLowerCase();return n||(i=gt[o],gt[o]=r,r=null!=a(e,t,n)?o:null,gt[o]=i),r}});var vt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;function mt(e){return(e.match(R)||[]).join(" ")}function xt(e){return e.getAttribute&&e.getAttribute("class")||""}function bt(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(R)||[]}k.fn.extend({prop:function(e,t){return _(this,k.prop,e,t,1<arguments.length)},removeProp:function(e){return this.each(function(){delete this[k.propFix[e]||e]})}}),k.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&k.isXMLDoc(e)||(t=k.propFix[t]||t,i=k.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=k.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),y.optSelected||(k.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),k.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){k.propFix[this.toLowerCase()]=this}),k.fn.extend({addClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).addClass(t.call(this,e,xt(this)))});if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},removeClass:function(t){var e,n,r,i,o,a,s,u=0;if(m(t))return this.each(function(e){k(this).removeClass(t.call(this,e,xt(this)))});if(!arguments.length)return this.attr("class","");if((e=bt(t)).length)while(n=this[u++])if(i=xt(n),r=1===n.nodeType&&" "+mt(i)+" "){a=0;while(o=e[a++])while(-1<r.indexOf(" "+o+" "))r=r.replace(" "+o+" "," ");i!==(s=mt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(i,t){var o=typeof i,a="string"===o||Array.isArray(i);return"boolean"==typeof t&&a?t?this.addClass(i):this.removeClass(i):m(i)?this.each(function(e){k(this).toggleClass(i.call(this,e,xt(this),t),t)}):this.each(function(){var e,t,n,r;if(a){t=0,n=k(this),r=bt(i);while(e=r[t++])n.hasClass(e)?n.removeClass(e):n.addClass(e)}else void 0!==i&&"boolean"!==o||((e=xt(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===i?"":Q.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&-1<(" "+mt(xt(n))+" ").indexOf(t))return!0;return!1}});var wt=/\r/g;k.fn.extend({val:function(n){var r,e,i,t=this[0];return arguments.length?(i=m(n),this.each(function(e){var t;1===this.nodeType&&(null==(t=i?n.call(this,e,k(this).val()):n)?t="":"number"==typeof t?t+="":Array.isArray(t)&&(t=k.map(t,function(e){return null==e?"":e+""})),(r=k.valHooks[this.type]||k.valHooks[this.nodeName.toLowerCase()])&&"set"in r&&void 0!==r.set(this,t,"value")||(this.value=t))})):t?(r=k.valHooks[t.type]||k.valHooks[t.nodeName.toLowerCase()])&&"get"in r&&void 0!==(e=r.get(t,"value"))?e:"string"==typeof(e=t.value)?e.replace(wt,""):null==e?"":e:void 0}}),k.extend({valHooks:{option:{get:function(e){var t=k.find.attr(e,"value");return null!=t?t:mt(k.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=k(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=k.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=-1<k.inArray(k.valHooks.option.get(r),o))&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),k.each(["radio","checkbox"],function(){k.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=-1<k.inArray(k(e).val(),t)}},y.checkOn||(k.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),y.focusin="onfocusin"in C;var Tt=/^(?:focusinfocus|focusoutblur)$/,Ct=function(e){e.stopPropagation()};k.extend(k.event,{trigger:function(e,t,n,r){var i,o,a,s,u,l,c,f,p=[n||E],d=v.call(e,"type")?e.type:e,h=v.call(e,"namespace")?e.namespace.split("."):[];if(o=f=a=n=n||E,3!==n.nodeType&&8!==n.nodeType&&!Tt.test(d+k.event.triggered)&&(-1<d.indexOf(".")&&(d=(h=d.split(".")).shift(),h.sort()),u=d.indexOf(":")<0&&"on"+d,(e=e[k.expando]?e:new k.Event(d,"object"==typeof e&&e)).isTrigger=r?2:3,e.namespace=h.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:k.makeArray(t,[e]),c=k.event.special[d]||{},r||!c.trigger||!1!==c.trigger.apply(n,t))){if(!r&&!c.noBubble&&!x(n)){for(s=c.delegateType||d,Tt.test(s+d)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(n.ownerDocument||E)&&p.push(a.defaultView||a.parentWindow||C)}i=0;while((o=p[i++])&&!e.isPropagationStopped())f=o,e.type=1<i?s:c.bindType||d,(l=(Q.get(o,"events")||{})[e.type]&&Q.get(o,"handle"))&&l.apply(o,t),(l=u&&o[u])&&l.apply&&G(o)&&(e.result=l.apply(o,t),!1===e.result&&e.preventDefault());return e.type=d,r||e.isDefaultPrevented()||c._default&&!1!==c._default.apply(p.pop(),t)||!G(n)||u&&m(n[d])&&!x(n)&&((a=n[u])&&(n[u]=null),k.event.triggered=d,e.isPropagationStopped()&&f.addEventListener(d,Ct),n[d](),e.isPropagationStopped()&&f.removeEventListener(d,Ct),k.event.triggered=void 0,a&&(n[u]=a)),e.result}},simulate:function(e,t,n){var r=k.extend(new k.Event,n,{type:e,isSimulated:!0});k.event.trigger(r,null,t)}}),k.fn.extend({trigger:function(e,t){return this.each(function(){k.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return k.event.trigger(e,t,n,!0)}}),y.focusin||k.each({focus:"focusin",blur:"focusout"},function(n,r){var i=function(e){k.event.simulate(r,e.target,k.event.fix(e))};k.event.special[r]={setup:function(){var e=this.ownerDocument||this,t=Q.access(e,r);t||e.addEventListener(n,i,!0),Q.access(e,r,(t||0)+1)},teardown:function(){var e=this.ownerDocument||this,t=Q.access(e,r)-1;t?Q.access(e,r,t):(e.removeEventListener(n,i,!0),Q.remove(e,r))}}});var Et=C.location,kt=Date.now(),St=/\?/;k.parseXML=function(e){var t;if(!e||"string"!=typeof e)return null;try{t=(new C.DOMParser).parseFromString(e,"text/xml")}catch(e){t=void 0}return t&&!t.getElementsByTagName("parsererror").length||k.error("Invalid XML: "+e),t};var Nt=/\[\]$/,At=/\r?\n/g,Dt=/^(?:submit|button|image|reset|file)$/i,jt=/^(?:input|select|textarea|keygen)/i;function qt(n,e,r,i){var t;if(Array.isArray(e))k.each(e,function(e,t){r||Nt.test(n)?i(n,t):qt(n+"["+("object"==typeof t&&null!=t?e:"")+"]",t,r,i)});else if(r||"object"!==w(e))i(n,e);else for(t in e)qt(n+"["+t+"]",e[t],r,i)}k.param=function(e,t){var n,r=[],i=function(e,t){var n=m(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!k.isPlainObject(e))k.each(e,function(){i(this.name,this.value)});else for(n in e)qt(n,e[n],t,i);return r.join("&")},k.fn.extend({serialize:function(){return k.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=k.prop(this,"elements");return e?k.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!k(this).is(":disabled")&&jt.test(this.nodeName)&&!Dt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=k(this).val();return null==n?null:Array.isArray(n)?k.map(n,function(e){return{name:t.name,value:e.replace(At,"\r\n")}}):{name:t.name,value:n.replace(At,"\r\n")}}).get()}});var Lt=/%20/g,Ht=/#.*$/,Ot=/([?&])_=[^&]*/,Pt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Mt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Ft=E.createElement("a");function Bt(o){return function(e,t){"string"!=typeof e&&(t=e,e="*");var n,r=0,i=e.toLowerCase().match(R)||[];if(m(t))while(n=i[r++])"+"===n[0]?(n=n.slice(1)||"*",(o[n]=o[n]||[]).unshift(t)):(o[n]=o[n]||[]).push(t)}}function _t(t,i,o,a){var s={},u=t===Wt;function l(e){var r;return s[e]=!0,k.each(t[e]||[],function(e,t){var n=t(i,o,a);return"string"!=typeof n||u||s[n]?u?!(r=n):void 0:(i.dataTypes.unshift(n),l(n),!1)}),r}return l(i.dataTypes[0])||!s["*"]&&l("*")}function zt(e,t){var n,r,i=k.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&k.extend(!0,e,r),e}Ft.href=Et.href,k.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":k.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,k.ajaxSettings),t):zt(k.ajaxSettings,e)},ajaxPrefilter:Bt(It),ajaxTransport:Bt(Wt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var c,f,p,n,d,r,h,g,i,o,v=k.ajaxSetup({},t),y=v.context||v,m=v.context&&(y.nodeType||y.jquery)?k(y):k.event,x=k.Deferred(),b=k.Callbacks("once memory"),w=v.statusCode||{},a={},s={},u="canceled",T={readyState:0,getResponseHeader:function(e){var t;if(h){if(!n){n={};while(t=Pt.exec(p))n[t[1].toLowerCase()+" "]=(n[t[1].toLowerCase()+" "]||[]).concat(t[2])}t=n[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return h?p:null},setRequestHeader:function(e,t){return null==h&&(e=s[e.toLowerCase()]=s[e.toLowerCase()]||e,a[e]=t),this},overrideMimeType:function(e){return null==h&&(v.mimeType=e),this},statusCode:function(e){var t;if(e)if(h)T.always(e[T.status]);else for(t in e)w[t]=[w[t],e[t]];return this},abort:function(e){var t=e||u;return c&&c.abort(t),l(0,t),this}};if(x.promise(T),v.url=((e||v.url||Et.href)+"").replace(Mt,Et.protocol+"//"),v.type=t.method||t.type||v.method||v.type,v.dataTypes=(v.dataType||"*").toLowerCase().match(R)||[""],null==v.crossDomain){r=E.createElement("a");try{r.href=v.url,r.href=r.href,v.crossDomain=Ft.protocol+"//"+Ft.host!=r.protocol+"//"+r.host}catch(e){v.crossDomain=!0}}if(v.data&&v.processData&&"string"!=typeof v.data&&(v.data=k.param(v.data,v.traditional)),_t(It,v,t,T),h)return T;for(i in(g=k.event&&v.global)&&0==k.active++&&k.event.trigger("ajaxStart"),v.type=v.type.toUpperCase(),v.hasContent=!Rt.test(v.type),f=v.url.replace(Ht,""),v.hasContent?v.data&&v.processData&&0===(v.contentType||"").indexOf("application/x-www-form-urlencoded")&&(v.data=v.data.replace(Lt,"+")):(o=v.url.slice(f.length),v.data&&(v.processData||"string"==typeof v.data)&&(f+=(St.test(f)?"&":"?")+v.data,delete v.data),!1===v.cache&&(f=f.replace(Ot,"$1"),o=(St.test(f)?"&":"?")+"_="+kt+++o),v.url=f+o),v.ifModified&&(k.lastModified[f]&&T.setRequestHeader("If-Modified-Since",k.lastModified[f]),k.etag[f]&&T.setRequestHeader("If-None-Match",k.etag[f])),(v.data&&v.hasContent&&!1!==v.contentType||t.contentType)&&T.setRequestHeader("Content-Type",v.contentType),T.setRequestHeader("Accept",v.dataTypes[0]&&v.accepts[v.dataTypes[0]]?v.accepts[v.dataTypes[0]]+("*"!==v.dataTypes[0]?", "+$t+"; q=0.01":""):v.accepts["*"]),v.headers)T.setRequestHeader(i,v.headers[i]);if(v.beforeSend&&(!1===v.beforeSend.call(y,T,v)||h))return T.abort();if(u="abort",b.add(v.complete),T.done(v.success),T.fail(v.error),c=_t(Wt,v,t,T)){if(T.readyState=1,g&&m.trigger("ajaxSend",[T,v]),h)return T;v.async&&0<v.timeout&&(d=C.setTimeout(function(){T.abort("timeout")},v.timeout));try{h=!1,c.send(a,l)}catch(e){if(h)throw e;l(-1,e)}}else l(-1,"No Transport");function l(e,t,n,r){var i,o,a,s,u,l=t;h||(h=!0,d&&C.clearTimeout(d),c=void 0,p=r||"",T.readyState=0<e?4:0,i=200<=e&&e<300||304===e,n&&(s=function(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}(v,T,n)),s=function(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}(v,s,T,i),i?(v.ifModified&&((u=T.getResponseHeader("Last-Modified"))&&(k.lastModified[f]=u),(u=T.getResponseHeader("etag"))&&(k.etag[f]=u)),204===e||"HEAD"===v.type?l="nocontent":304===e?l="notmodified":(l=s.state,o=s.data,i=!(a=s.error))):(a=l,!e&&l||(l="error",e<0&&(e=0))),T.status=e,T.statusText=(t||l)+"",i?x.resolveWith(y,[o,l,T]):x.rejectWith(y,[T,l,a]),T.statusCode(w),w=void 0,g&&m.trigger(i?"ajaxSuccess":"ajaxError",[T,v,i?o:a]),b.fireWith(y,[T,l]),g&&(m.trigger("ajaxComplete",[T,v]),--k.active||k.event.trigger("ajaxStop")))}return T},getJSON:function(e,t,n){return k.get(e,t,n,"json")},getScript:function(e,t){return k.get(e,void 0,t,"script")}}),k.each(["get","post"],function(e,i){k[i]=function(e,t,n,r){return m(t)&&(r=r||n,n=t,t=void 0),k.ajax(k.extend({url:e,type:i,dataType:r,data:t,success:n},k.isPlainObject(e)&&e))}}),k._evalUrl=function(e,t){return k.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){k.globalEval(e,t)}})},k.fn.extend({wrapAll:function(e){var t;return this[0]&&(m(e)&&(e=e.call(this[0])),t=k(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(n){return m(n)?this.each(function(e){k(this).wrapInner(n.call(this,e))}):this.each(function(){var e=k(this),t=e.contents();t.length?t.wrapAll(n):e.append(n)})},wrap:function(t){var n=m(t);return this.each(function(e){k(this).wrapAll(n?t.call(this,e):t)})},unwrap:function(e){return this.parent(e).not("body").each(function(){k(this).replaceWith(this.childNodes)}),this}}),k.expr.pseudos.hidden=function(e){return!k.expr.pseudos.visible(e)},k.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},k.ajaxSettings.xhr=function(){try{return new C.XMLHttpRequest}catch(e){}};var Ut={0:200,1223:204},Xt=k.ajaxSettings.xhr();y.cors=!!Xt&&"withCredentials"in Xt,y.ajax=Xt=!!Xt,k.ajaxTransport(function(i){var o,a;if(y.cors||Xt&&!i.crossDomain)return{send:function(e,t){var n,r=i.xhr();if(r.open(i.type,i.url,i.async,i.username,i.password),i.xhrFields)for(n in i.xhrFields)r[n]=i.xhrFields[n];for(n in i.mimeType&&r.overrideMimeType&&r.overrideMimeType(i.mimeType),i.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest"),e)r.setRequestHeader(n,e[n]);o=function(e){return function(){o&&(o=a=r.onload=r.onerror=r.onabort=r.ontimeout=r.onreadystatechange=null,"abort"===e?r.abort():"error"===e?"number"!=typeof r.status?t(0,"error"):t(r.status,r.statusText):t(Ut[r.status]||r.status,r.statusText,"text"!==(r.responseType||"text")||"string"!=typeof r.responseText?{binary:r.response}:{text:r.responseText},r.getAllResponseHeaders()))}},r.onload=o(),a=r.onerror=r.ontimeout=o("error"),void 0!==r.onabort?r.onabort=a:r.onreadystatechange=function(){4===r.readyState&&C.setTimeout(function(){o&&a()})},o=o("abort");try{r.send(i.hasContent&&i.data||null)}catch(e){if(o)throw e}},abort:function(){o&&o()}}}),k.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),k.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return k.globalEval(e),e}}}),k.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),k.ajaxTransport("script",function(n){var r,i;if(n.crossDomain||n.scriptAttrs)return{send:function(e,t){r=k("<script>").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1<s&&(r=mt(e.slice(s)),e=e.slice(0,s)),m(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),0<a.length&&k.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?k("<div>").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0<arguments.length?this.on(n,null,e,t):this.trigger(n)}}),k.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),k.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),k.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),m(e))return r=s.call(arguments,2),(i=function(){return e.apply(t||this,r.concat(s.call(arguments)))}).guid=e.guid=e.guid||k.guid++,i},k.holdReady=function(e){e?k.readyWait++:k.ready(!0)},k.isArray=Array.isArray,k.parseJSON=JSON.parse,k.nodeName=A,k.isFunction=m,k.isWindow=x,k.camelCase=V,k.type=w,k.now=Date.now,k.isNumeric=function(e){var t=k.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return k});var Qt=C.jQuery,Jt=C.$;return k.noConflict=function(e){return C.$===k&&(C.$=Jt),e&&C.jQuery===k&&(C.jQuery=Qt),k},e||(C.jQuery=C.$=k),k}); diff --git a/phpMyAdmin/js/vendor/jquery/jquery.mousewheel.js b/phpMyAdmin/js/vendor/jquery/jquery.mousewheel.js new file mode 100755 index 0000000..3eadb7e --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.mousewheel.js @@ -0,0 +1,221 @@ +/*! + * jQuery Mousewheel 3.1.13 + * + * Copyright jQuery Foundation and other contributors + * Released under the MIT license + * http://jquery.org/license + */ + +(function (factory) { + if ( typeof define === 'function' && define.amd ) { + // AMD. Register as an anonymous module. + define(['jquery'], factory); + } else if (typeof exports === 'object') { + // Node/CommonJS style for Browserify + module.exports = factory; + } else { + // Browser globals + factory(jQuery); + } +}(function ($) { + + var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'], + toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ? + ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'], + slice = Array.prototype.slice, + nullLowestDeltaTimeout, lowestDelta; + + if ( $.event.fixHooks ) { + for ( var i = toFix.length; i; ) { + $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks; + } + } + + var special = $.event.special.mousewheel = { + version: '3.1.12', + + setup: function() { + if ( this.addEventListener ) { + for ( var i = toBind.length; i; ) { + this.addEventListener( toBind[--i], handler, false ); + } + } else { + this.onmousewheel = handler; + } + // Store the line height and page height for this particular element + $.data(this, 'mousewheel-line-height', special.getLineHeight(this)); + $.data(this, 'mousewheel-page-height', special.getPageHeight(this)); + }, + + teardown: function() { + if ( this.removeEventListener ) { + for ( var i = toBind.length; i; ) { + this.removeEventListener( toBind[--i], handler, false ); + } + } else { + this.onmousewheel = null; + } + // Clean up the data we added to the element + $.removeData(this, 'mousewheel-line-height'); + $.removeData(this, 'mousewheel-page-height'); + }, + + getLineHeight: function(elem) { + var $elem = $(elem), + $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent'](); + if (!$parent.length) { + $parent = $('body'); + } + return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16; + }, + + getPageHeight: function(elem) { + return $(elem).height(); + }, + + settings: { + adjustOldDeltas: true, // see shouldAdjustOldDeltas() below + normalizeOffset: true // calls getBoundingClientRect for each event + } + }; + + $.fn.extend({ + mousewheel: function(fn) { + return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel'); + }, + + unmousewheel: function(fn) { + return this.unbind('mousewheel', fn); + } + }); + + + function handler(event) { + var orgEvent = event || window.event, + args = slice.call(arguments, 1), + delta = 0, + deltaX = 0, + deltaY = 0, + absDelta = 0, + offsetX = 0, + offsetY = 0; + event = $.event.fix(orgEvent); + event.type = 'mousewheel'; + + // Old school scrollwheel delta + if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; } + if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; } + if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; } + if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; } + + // Firefox < 17 horizontal scrolling related to DOMMouseScroll event + if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) { + deltaX = deltaY * -1; + deltaY = 0; + } + + // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy + delta = deltaY === 0 ? deltaX : deltaY; + + // New school wheel delta (wheel event) + if ( 'deltaY' in orgEvent ) { + deltaY = orgEvent.deltaY * -1; + delta = deltaY; + } + if ( 'deltaX' in orgEvent ) { + deltaX = orgEvent.deltaX; + if ( deltaY === 0 ) { delta = deltaX * -1; } + } + + // No change actually happened, no reason to go any further + if ( deltaY === 0 && deltaX === 0 ) { return; } + + // Need to convert lines and pages to pixels if we aren't already in pixels + // There are three delta modes: + // * deltaMode 0 is by pixels, nothing to do + // * deltaMode 1 is by lines + // * deltaMode 2 is by pages + if ( orgEvent.deltaMode === 1 ) { + var lineHeight = $.data(this, 'mousewheel-line-height'); + delta *= lineHeight; + deltaY *= lineHeight; + deltaX *= lineHeight; + } else if ( orgEvent.deltaMode === 2 ) { + var pageHeight = $.data(this, 'mousewheel-page-height'); + delta *= pageHeight; + deltaY *= pageHeight; + deltaX *= pageHeight; + } + + // Store lowest absolute delta to normalize the delta values + absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) ); + + if ( !lowestDelta || absDelta < lowestDelta ) { + lowestDelta = absDelta; + + // Adjust older deltas if necessary + if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { + lowestDelta /= 40; + } + } + + // Adjust older deltas if necessary + if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) { + // Divide all the things by 40! + delta /= 40; + deltaX /= 40; + deltaY /= 40; + } + + // Get a whole, normalized value for the deltas + delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta); + deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta); + deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta); + + // Normalise offsetX and offsetY properties + if ( special.settings.normalizeOffset && this.getBoundingClientRect ) { + var boundingRect = this.getBoundingClientRect(); + offsetX = event.clientX - boundingRect.left; + offsetY = event.clientY - boundingRect.top; + } + + // Add information to the event object + event.deltaX = deltaX; + event.deltaY = deltaY; + event.deltaFactor = lowestDelta; + event.offsetX = offsetX; + event.offsetY = offsetY; + // Go ahead and set deltaMode to 0 since we converted to pixels + // Although this is a little odd since we overwrite the deltaX/Y + // properties with normalized deltas. + event.deltaMode = 0; + + // Add event and delta to the front of the arguments + args.unshift(event, delta, deltaX, deltaY); + + // Clearout lowestDelta after sometime to better + // handle multiple device types that give different + // a different lowestDelta + // Ex: trackpad = 3 and mouse wheel = 120 + if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); } + nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200); + + return ($.event.dispatch || $.event.handle).apply(this, args); + } + + function nullLowestDelta() { + lowestDelta = null; + } + + function shouldAdjustOldDeltas(orgEvent, absDelta) { + // If this is an older event and the delta is divisable by 120, + // then we are assuming that the browser is treating this as an + // older mouse wheel event and that we should divide the deltas + // by 40 to try and get a more usable deltaFactor. + // Side note, this actually impacts the reported scroll distance + // in older browsers and can cause scrolling to be slower than native. + // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false. + return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0; + } + +})); diff --git a/phpMyAdmin/js/vendor/jquery/jquery.sortableTable.js b/phpMyAdmin/js/vendor/jquery/jquery.sortableTable.js new file mode 100755 index 0000000..1f4fc91 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.sortableTable.js @@ -0,0 +1,272 @@ +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * @fileoverview A jquery plugin that allows drag&drop sorting in tables. + * Coded because JQuery UI sortable doesn't support tables. Also it has no animation + * + * @name Sortable Table JQuery plugin + * + * @requires jQuery + * + */ + +/* Options: + +$('table').sortableTable({ + ignoreRect: { top, left, width, height } - relative coordinates on each element. If the user clicks + in this area, it is not seen as a drag&drop request. Useful for toolbars etc. + events: { + start: callback function when the user starts dragging + drop: callback function after an element has been dropped + } +}) +*/ + +/* Commands: + +$('table').sortableTable('init') - equivalent to $('table').sortableTable() +$('table').sortableTable('refresh') - if the table has been changed, refresh correctly assigns all events again +$('table').sortableTable('destroy') - removes all events from the table + +*/ + +/* Setup: + + Can be applied on any table, there is just one convention. + Each cell (<td>) has to contain one and only one element (preferably div or span) + which is the actually draggable element. +*/ +(function($) { + jQuery.fn.sortableTable = function(method) { + + var methods = { + init : function(options) { + var tb = new sortableTableInstance(this, options); + tb.init(); + $(this).data('sortableTable',tb); + }, + refresh : function( ) { + $(this).data('sortableTable').refresh(); + }, + destroy : function( ) { + $(this).data('sortableTable').destroy(); + } + }; + + if ( methods[method] ) { + return methods[method].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object' || ! method ) { + return methods.init.apply( this, arguments ); + } else { + $.error( 'Method ' + method + ' does not exist on jQuery.sortableTable' ); + } + + function sortableTableInstance(table, options) { + var down = false; + var $draggedEl, oldCell, previewMove, id; + + if(!options) options = {}; + + /* Mouse handlers on the child elements */ + var onMouseUp = function(e) { + dropAt(e.pageX, e.pageY); + } + + var onMouseDown = function(e) { + $draggedEl = $(this).children(); + if($draggedEl.length == 0) return; + if(options.ignoreRect && insideRect({x: e.pageX - $draggedEl.offset().left, y: e.pageY - $draggedEl.offset().top}, options.ignoreRect)) return; + + down = true; + oldCell = this; + //move(e.pageX,e.pageY); + + if(options.events && options.events.start) + options.events.start(this); + + return false; + } + + var globalMouseMove = function(e) { + if(down) { + move(e.pageX,e.pageY); + + if(inside($(oldCell), e.pageX, e.pageY)) { + if(previewMove != null) { + moveTo(previewMove); + previewMove = null; + } + } else + $(table).find('td').each(function() { + if(inside($(this), e.pageX, e.pageY)) { + if($(previewMove).attr('class') != $(this).children().first().attr('class')) { + if(previewMove != null) moveTo(previewMove); + previewMove = $(this).children().first(); + if(previewMove.length > 0) + moveTo($(previewMove), { pos: { + top: $(oldCell).offset().top - $(previewMove).parent().offset().top, + left: $(oldCell).offset().left - $(previewMove).parent().offset().left + } }); + } + + return false; + } + }); + } + + return false; + } + + var globalMouseOut = function() { + if(down) { + down = false; + if(previewMove) moveTo(previewMove); + moveTo($draggedEl); + previewMove = null; + } + } + + // Initialize sortable table + this.init = function() { + id = 1; + // Add some required css to each child element in the <td>s + $(table).find('td').children().each(function() { + // Remove any old occurences of our added draggable-num class + $(this).attr('class',$(this).attr('class').replace(/\s*draggable\-\d+/g,'')); + $(this).addClass('draggable-' + (id++)); + }); + + // Mouse events + $(table).find('td').bind('mouseup',onMouseUp); + $(table).find('td').bind('mousedown',onMouseDown); + + $(document).mousemove(globalMouseMove); + $(document).bind('mouseleave', globalMouseOut); + } + + // Call this when the table has been updated + this.refresh = function() { + this.destroy(); + this.init(); + } + + this.destroy = function() { + // Add some required css to each child element in the <td>s + $(table).find('td').children().each(function() { + // Remove any old occurences of our added draggable-num class + $(this).attr('class',$(this).attr('class').replace(/\s*draggable\-\d+/g,'')); + }); + + // Mouse events + $(table).find('td').unbind('mouseup',onMouseUp) + $(table).find('td').unbind('mousedown',onMouseDown); + + $(document).unbind('mousemove',globalMouseMove); + $(document).unbind('mouseleave',globalMouseOut); + } + + function switchElement(drag, dropTo) { + var dragPosDiff = { + left: $(drag).children().first().offset().left - $(dropTo).offset().left, + top: $(drag).children().first().offset().top - $(dropTo).offset().top + }; + + var dropPosDiff = null; + if($(dropTo).children().length > 0) { + dropPosDiff = { + left: $(dropTo).children().first().offset().left - $(drag).offset().left, + top: $(dropTo).children().first().offset().top - $(drag).offset().top + }; + } + + /* I love you append(). It moves the DOM Elements so gracefully <3 */ + // Put the element in the way to old place + $(drag).append($(dropTo).children().first()).children() + .stop(true,true) + .bind('mouseup',onMouseUp); + + if(dropPosDiff) + $(drag).append($(dropTo).children().first()).children() + .css('left',dropPosDiff.left + 'px') + .css('top',dropPosDiff.top + 'px'); + + // Put our dragged element into the space we just freed up + $(dropTo).append($(drag).children().first()).children() + .bind('mouseup',onMouseUp) + .css('left',dragPosDiff.left + 'px') + .css('top',dragPosDiff.top + 'px'); + + moveTo($(dropTo).children().first(), { duration: 100 }); + moveTo($(drag).children().first(), { duration: 100 }); + + if(options.events && options.events.drop) { + // Drop event. The drag child element is moved into the drop element + // and vice versa. So the parameters are switched. + + // Calculate row and column index + colIdx = $(dropTo).prevAll().length; + rowIdx = $(dropTo).parent().prevAll().length; + + options.events.drop(drag,dropTo, { col: colIdx, row: rowIdx }); + } + } + + function move(x,y) { + $draggedEl.offset({ + top: Math.min($(document).height(), Math.max(0, y - $draggedEl.height()/2)), + left: Math.min($(document).width(), Math.max(0, x - $draggedEl.width()/2)) + }); + } + + function inside($el, x,y) { + var off = $el.offset(); + return y >= off.top && x >= off.left && x < off.left + $el.width() && y < off.top + $el.height(); + } + + function insideRect(pos, r) { + return pos.y > r.top && pos.x > r.left && pos.y < r.top + r.height && pos.x < r.left + r.width; + } + + function dropAt(x,y) { + if(!down) return; + down = false; + + var switched = false; + + $(table).find('td').each(function() { + if($(this).children().first().attr('class') != $(oldCell).children().first().attr('class') && inside($(this), x, y)) { + switchElement(oldCell, this); + switched = true; + return; + } + }); + + if(!switched) { + if(previewMove) moveTo(previewMove); + moveTo($draggedEl); + } + + previewMove = null; + } + + function moveTo(elem, opts) { + if(!opts) opts = {}; + if(!opts.pos) opts.pos = { left: 0, top: 0 }; + if(!opts.duration) opts.duration = 200; + + $(elem).css('position','relative'); + $(elem).animate({ top: opts.pos.top, left: opts.pos.left }, { + duration: opts.duration, + complete: function() { + if(opts.pos.left == 0 && opts.pos.top == 0) { + $(elem) + .css('position','') + .css('left','') + .css('top',''); + } + } + }); + } + } + } + +})( jQuery ); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jquery/jquery.svg.js b/phpMyAdmin/js/vendor/jquery/jquery.svg.js new file mode 100755 index 0000000..acb4db1 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.svg.js @@ -0,0 +1,1352 @@ +锘�/* http://keith-wood.name/svg.html + SVG for jQuery v1.5.0. + Written by Keith Wood (kbwood{at}iinet.com.au) August 2007. + Available under the MIT (http://keith-wood.name/licence.html) license. + Please attribute the author if you use it. */ + +(function($) { // Hide scope, no $ conflict + +/** The SVG manager. + <p>Use the singleton instance of this class, $.svg, + to interact with the SVG functionality.</p> + <p>Expects HTML like:</p> + <pre><div></div></pre> + @module SVGManager */ +function SVGManager() { + this._settings = []; // Settings to be remembered per SVG object + this._extensions = []; // List of SVG extensions added to SVGWrapper + // for each entry [0] is extension name, [1] is extension class (function) + // the function takes one parameter - the SVGWrapper instance + this.regional = []; // Localisations, indexed by language, '' for default (English) + this.regional[''] = {errorLoadingText: 'Error loading'}; + this.local = this.regional['']; // Current localisation + this._uuid = new Date().getTime(); + this._ie = !!window.ActiveXObject; +} + +$.extend(SVGManager.prototype, { + /** Class name added to elements to indicate already configured with SVG. */ + markerClassName: 'hasSVG', + /** Name of the data property for instance settings. */ + propertyName: 'svgwrapper', + + /** SVG namespace. */ + svgNS: 'http://www.w3.org/2000/svg', + /** XLink namespace. */ + xlinkNS: 'http://www.w3.org/1999/xlink', + + /** SVG wrapper class. */ + _wrapperClass: SVGWrapper, + + /* Camel-case versions of attribute names containing dashes or are reserved words. */ + _attrNames: {class_: 'class', in_: 'in', + alignmentBaseline: 'alignment-baseline', baselineShift: 'baseline-shift', + clipPath: 'clip-path', clipRule: 'clip-rule', + colorInterpolation: 'color-interpolation', + colorInterpolationFilters: 'color-interpolation-filters', + colorRendering: 'color-rendering', dominantBaseline: 'dominant-baseline', + enableBackground: 'enable-background', fillOpacity: 'fill-opacity', + fillRule: 'fill-rule', floodColor: 'flood-color', + floodOpacity: 'flood-opacity', fontFamily: 'font-family', + fontSize: 'font-size', fontSizeAdjust: 'font-size-adjust', + fontStretch: 'font-stretch', fontStyle: 'font-style', + fontVariant: 'font-variant', fontWeight: 'font-weight', + glyphOrientationHorizontal: 'glyph-orientation-horizontal', + glyphOrientationVertical: 'glyph-orientation-vertical', + horizAdvX: 'horiz-adv-x', horizOriginX: 'horiz-origin-x', + imageRendering: 'image-rendering', letterSpacing: 'letter-spacing', + lightingColor: 'lighting-color', markerEnd: 'marker-end', + markerMid: 'marker-mid', markerStart: 'marker-start', + stopColor: 'stop-color', stopOpacity: 'stop-opacity', + strikethroughPosition: 'strikethrough-position', + strikethroughThickness: 'strikethrough-thickness', + strokeDashArray: 'stroke-dasharray', strokeDashOffset: 'stroke-dashoffset', + strokeLineCap: 'stroke-linecap', strokeLineJoin: 'stroke-linejoin', + strokeMiterLimit: 'stroke-miterlimit', strokeOpacity: 'stroke-opacity', + strokeWidth: 'stroke-width', textAnchor: 'text-anchor', + textDecoration: 'text-decoration', textRendering: 'text-rendering', + underlinePosition: 'underline-position', underlineThickness: 'underline-thickness', + vertAdvY: 'vert-adv-y', vertOriginY: 'vert-origin-y', + wordSpacing: 'word-spacing', writingMode: 'writing-mode'}, + + /* Add the SVG object to its container. */ + _attachSVG: function(container, settings) { + var svg = (container.namespaceURI === this.svgNS ? container : null); + var container = (svg ? null : container); + if ($(container || svg).hasClass(this.markerClassName)) { + return; + } + if (typeof settings === 'string') { + settings = {loadURL: settings}; + } + else if (typeof settings === 'function') { + settings = {onLoad: settings}; + } + $(container || svg).addClass(this.markerClassName); + try { + if (!svg) { + svg = document.createElementNS(this.svgNS, 'svg'); + svg.setAttribute('version', '1.1'); + if (container.clientWidth > 0) { + svg.setAttribute('width', container.clientWidth); + } + if (container.clientHeight > 0) { + svg.setAttribute('height', container.clientHeight); + } + container.appendChild(svg); + } + this._afterLoad(container, svg, settings || {}); + } + catch (e) { + $(container).html('<p>SVG is not supported natively on this browser</p>'); + } + }, + + /* Post-processing once loaded. */ + _afterLoad: function(container, svg, settings) { + var settings = settings || this._settings[container.id]; + this._settings[container ? container.id : ''] = null; + var wrapper = new this._wrapperClass(svg, container); + $.data(container || svg, $.svg.propertyName, wrapper); + try { + if (settings.loadURL) { // Load URL + wrapper.load(settings.loadURL, settings); + } + if (settings.settings) { // Additional settings + wrapper.configure(settings.settings); + } + if (settings.onLoad && !settings.loadURL) { // Onload callback + settings.onLoad.apply(container || svg, [wrapper]); + } + } + catch (e) { + alert(e); + } + }, + + /** Return the SVG wrapper created for a given container. + @param container {string|Element|jQuery} Selector for the container or + the container for the SVG object or jQuery collection where first entry is the container. + @return {SVGWrapper} The corresponding SVG wrapper element, or <code>null</code> if not attached. */ + _getSVG: function(container) { + return $(container).data(this.propertyName); + }, + + /** Remove the SVG functionality from a div. + @param container {Element} The container for the SVG object. */ + _destroySVG: function(container) { + container = $(container); + if (!container.hasClass(this.markerClassName)) { + return; + } + container.removeClass(this.markerClassName).removeData(this.propertyName); + if (container[0].namespaceURI !== this.svgNS) { + container.empty(); + } + }, + + /** Extend the SVGWrapper object with an embedded class. + <p>The constructor function must take a single parameter that is + a reference to the owning SVG root object. This allows the + extension to access the basic SVG functionality.</p> + @param name {string} The name of the <code>SVGWrapper</code> attribute to access the new class. + @param extClass {function} The extension class constructor. */ + addExtension: function(name, extClass) { + this._extensions.push([name, extClass]); + }, + + /** Does this node belong to SVG? + @param node {Element} The node to be tested. + @return {boolean} <code>true</code> if an SVG node, <code>false</code> if not. */ + isSVGElem: function(node) { + return (node.nodeType === 1 && node.namespaceURI === $.svg.svgNS); + } +}); + +/** The main SVG interface, which encapsulates the SVG element. + <p>Obtain a reference from $().svg('get')</p> + @module SVGWrapper */ +function SVGWrapper(svg, container) { + this._svg = svg; // The SVG root node + this._container = container; // The containing div + for (var i = 0; i < $.svg._extensions.length; i++) { + var extension = $.svg._extensions[i]; + this[extension[0]] = new extension[1](this); + } +} + +$.extend(SVGWrapper.prototype, { + + /** Retrieve the width of the SVG object. + @return {number} The width of the SVG canvas. */ + width: function() { + return (this._container ? this._container.clientWidth : this._svg.width); + }, + + /** Retrieve the height of the SVG object. + @return {number} The height of the SVG canvas. */ + height: function() { + return (this._container ? this._container.clientHeight : this._svg.height); + }, + + /** Retrieve the root SVG element. + @return {SVGElement} The top-level SVG element. */ + root: function() { + return this._svg; + }, + + /** Configure a SVG node. + @param [node] {SVGElement} The node to configure, or the SVG root if not specified. + @param settings {object} Additional settings for the root. + @param [clear=false] {boolean} <code>true</code> to remove existing attributes first, + <code>false</code> to add to what is already there. + @return {SVGWrapper} This wrapper. */ + configure: function(node, settings, clear) { + if (!node.nodeName) { + clear = settings; + settings = node; + node = this._svg; + } + if (clear) { + for (var i = node.attributes.length - 1; i >= 0; i--) { + var attr = node.attributes.item(i); + if (!(attr.nodeName === 'onload' || attr.nodeName === 'version' || + attr.nodeName.substring(0, 5) === 'xmlns')) { + node.attributes.removeNamedItem(attr.nodeName); + } + } + } + for (var attrName in settings) { + node.setAttribute($.svg._attrNames[attrName] || attrName, settings[attrName]); + } + return this; + }, + + /** Locate a specific element in the SVG document. + @param id {string} The element's identifier. + @return {SVGElement} The element reference, or <code>null</code> if not found. */ + getElementById: function(id) { + return this._svg.ownerDocument.getElementById(id); + }, + + /** Change the attributes for a SVG node. + @param element {SVGElement} The node to change. + @param settings {object} The new settings. + @return {SVGWrapper} This wrapper. */ + change: function(element, settings) { + if (element) { + for (var name in settings) { + if (settings[name] == null) { + element.removeAttribute($.svg._attrNames[name] || name); + } + else { + element.setAttribute($.svg._attrNames[name] || name, settings[name]); + } + } + } + return this; + }, + + /** Check for parent being absent and adjust arguments accordingly. + @private + @param values {string[]} The given parameters. + @param names {string[]} The names of the parameters in order. + @param optSettings {string[]} The names of optional parameters. + @return {object} An object representing the named parameters. */ + _args: function(values, names, optSettings) { + names.splice(0, 0, 'parent'); + names.splice(names.length, 0, 'settings'); + var args = {}; + var offset = 0; + if (values[0] != null && values[0].jquery) { + values[0] = values[0][0]; + } + if (values[0] != null && !(typeof values[0] === 'object' && values[0].nodeName)) { + args['parent'] = null; + offset = 1; + } + for (var i = 0; i < values.length; i++) { + args[names[i + offset]] = values[i]; + } + if (optSettings) { + $.each(optSettings, function(i, value) { + if (typeof args[value] === 'object') { + args.settings = args[value]; + args[value] = null; + } + }); + } + return args; + }, + + /** Add a title. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param text {string} The text of the title. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new title node. */ + title: function(parent, text, settings) { + var args = this._args(arguments, ['text']); + var node = this._makeNode(args.parent, 'title', args.settings || {}); + node.appendChild(this._svg.ownerDocument.createTextNode(args.text)); + return node; + }, + + /** Add a description. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param text {string} The text of the description. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new description node. */ + describe: function(parent, text, settings) { + var args = this._args(arguments, ['text']); + var node = this._makeNode(args.parent, 'desc', args.settings || {}); + node.appendChild(this._svg.ownerDocument.createTextNode(args.text)); + return node; + }, + + /** Add a definitions node. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param [id] {string} The ID of this definitions (optional). + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new definitions node. */ + defs: function(parent, id, settings) { + var args = this._args(arguments, ['id'], ['id']); + return this._makeNode(args.parent, 'defs', $.extend((args.id ? {id: args.id} : {}), args.settings || {})); + }, + + /** Add a symbol definition. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param id {string} The ID of this symbol. + @param x1 {number} The left coordinate for this symbol. + @param y1 {number} The top coordinate for this symbol. + @param width {number} The width of this symbol. + @param height {number} The height of this symbol. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new symbol node. */ + symbol: function(parent, id, x1, y1, width, height, settings) { + var args = this._args(arguments, ['id', 'x1', 'y1', 'width', 'height']); + return this._makeNode(args.parent, 'symbol', $.extend({id: args.id, + viewBox: args.x1 + ' ' + args.y1 + ' ' + args.width + ' ' + args.height}, args.settings || {})); + }, + + /** Add a marker definition. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param id {string} The ID of this marker. + @param refX {number} The x-coordinate for the reference point. + @param refY {number} The y-coordinate for the reference point. + @param mWidth {number} The marker viewport width. + @param mHeight {number} The marker viewport height. + @param [orient] {string|number} 'auto' or angle (degrees). + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new marker node. */ + marker: function(parent, id, refX, refY, mWidth, mHeight, orient, settings) { + var args = this._args(arguments, ['id', 'refX', 'refY', 'mWidth', 'mHeight', 'orient'], ['orient']); + return this._makeNode(args.parent, 'marker', $.extend( + {id: args.id, refX: args.refX, refY: args.refY, markerWidth: args.mWidth, + markerHeight: args.mHeight, orient: args.orient || 'auto'}, args.settings || {})); + }, + + /** Add a style node. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param styles {string} The CSS styles. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new style node. */ + style: function(parent, styles, settings) { + var args = this._args(arguments, ['styles']); + var node = this._makeNode(args.parent, 'style', $.extend({type: 'text/css'}, args.settings || {})); + node.appendChild(this._svg.ownerDocument.createTextNode(args.styles)); + return node; + }, + + /** Add a script node. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param script {string} The JavaScript code. + @param [type='text/javascript'] {string} The MIME type for the code. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new script node. */ + script: function(parent, script, type, settings) { + var args = this._args(arguments, ['script', 'type'], ['type']); + var node = this._makeNode(args.parent, 'script', $.extend( + {type: args.type || 'text/javascript'}, args.settings || {})); + node.appendChild(this._svg.ownerDocument.createTextNode(args.script)); + if ($.svg._ie) { + $.globalEval(args.script); + } + return node; + }, + + /** Add a linear gradient definition. + <p>Specify all of <code>x1</code>, <code>y1</code>, <code>x2</code>, <code>y2</code> or none of them.</p> + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param id {string} The ID for this gradient. + @param stops {string[][]} The gradient stops, each entry is [0] is offset (0.0-1.0 or 0%-100%), + [1] is colour, [2] is opacity (optional). + @param [x1] {number} The x-coordinate of the gradient start. + @param [y1] {number} The y-coordinate of the gradient start. + @param [x2] {number} The x-coordinate of the gradient end. + @param [y2] {number} The y-coordinate of the gradient end. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new linear gradient node. */ + linearGradient: function(parent, id, stops, x1, y1, x2, y2, settings) { + var args = this._args(arguments, ['id', 'stops', 'x1', 'y1', 'x2', 'y2'], ['x1']); + var sets = $.extend({id: args.id}, + (args.x1 != null ? {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2} : {})); + return this._gradient(args.parent, 'linearGradient', $.extend(sets, args.settings || {}), args.stops); + }, + + /** Add a radial gradient definition. + <p>Specify all of <code>cx</code>, <code>cy</code>, <code>r</code>, + <code>fx</code>, <code>fy</code> or none of them.</p> + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param id {string} The ID for this gradient. + @param stops {string[][]} The gradient stops, each entry [0] is offset (0.0-1.0 or 0%-100%), + [1] is colour, [2] is opacity (optional). + @param [cx] {number} The x-coordinate of the largest circle centre. + @param [cy] {number} The y-coordinate of the largest circle centre. + @param [r] {number} The radius of the largest circle. + @param [fx] {number} The x-coordinate of the gradient focus. + @param [fy] {number} The y-coordinate of the gradient focus. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new radial gradient node. */ + radialGradient: function(parent, id, stops, cx, cy, r, fx, fy, settings) { + var args = this._args(arguments, ['id', 'stops', 'cx', 'cy', 'r', 'fx', 'fy'], ['cx']); + var sets = $.extend({id: args.id}, + (args.cx != null ? {cx: args.cx, cy: args.cy, r: args.r, fx: args.fx, fy: args.fy} : {})); + return this._gradient(args.parent, 'radialGradient', $.extend(sets, args.settings || {}), args.stops); + }, + + /** Add a gradient node. + @private + @param parent {SVGElement|jQuery} The parent node for the new node. + @param name {string} The type of gradient node to create. + @param settings {object} The settings for this node. + @param stops {string[][]} The gradient stops. + @return {SVGElement} The new gradient node. */ + _gradient: function(parent, name, settings, stops) { + var node = this._makeNode(parent, name, settings); + for (var i = 0; i < stops.length; i++) { + var stop = stops[i]; + this._makeNode(node, 'stop', $.extend({offset: stop[0], stopColor: stop[1]}, + (stop[2] != null ? {stopOpacity: stop[2]} : {}))); + } + return node; + }, + + /** Add a pattern definition. + <p>Specify all of <code>vx</code>, <code>vy</code>, <code>xwidth</code>, + <code>vheight</code> or none of them.</p> + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param id {string} The ID for this pattern. + @param x {number} The x-coordinate for the left edge of the pattern. + @param y {number} The y-coordinate for the top edge of the pattern. + @param width {number} The width of the pattern. + @param height {number} The height of the pattern. + @param [vx] {number} The minimum x-coordinate for view box. + @param [vy] {number} The minimum y-coordinate for the view box. + @param [vwidth] {number} The width of the view box. + @param [vheight] {number} The height of the view box. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new pattern definition node. */ + pattern: function(parent, id, x, y, width, height, vx, vy, vwidth, vheight, settings) { + var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height', 'vx', 'vy', 'vwidth', 'vheight'], ['vx']); + var sets = $.extend({id: args.id, x: args.x, y: args.y, width: args.width, height: args.height}, + (args.vx != null ? {viewBox: args.vx + ' ' + args.vy + ' ' + args.vwidth + ' ' + args.vheight} : {})); + return this._makeNode(args.parent, 'pattern', $.extend(sets, args.settings || {})); + }, + + /** Add a clip path definition. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param id {string} The ID for this path. + @param [units='userSpaceOnUse'] {string} Either 'userSpaceOnUse' or 'objectBoundingBox'. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new clip path definition node. */ + clipPath: function(parent, id, units, settings) { + var args = this._args(arguments, ['id', 'units']); + args.units = args.units || 'userSpaceOnUse'; + return this._makeNode(args.parent, 'clipPath', $.extend( + {id: args.id, clipPathUnits: args.units}, args.settings || {})); + }, + + /** Add a mask definition. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param id {string} The ID for this mask. + @param x {number} The x-coordinate for the left edge of the mask. + @param y {number} The y-coordinate for the top edge of the mask. + @param width {number} The width of the mask. + @param height {number} The height of the mask. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new mask definition node. */ + mask: function(parent, id, x, y, width, height, settings) { + var args = this._args(arguments, ['id', 'x', 'y', 'width', 'height']); + return this._makeNode(args.parent, 'mask', $.extend( + {id: args.id, x: args.x, y: args.y, width: args.width, height: args.height}, args.settings || {})); + }, + + /** Create a new path object. + @return {SVGPath} A new path object. */ + createPath: function() { + return new SVGPath(); + }, + + /** Create a new text object. + @return {SVGText} A new text object. */ + createText: function() { + return new SVGText(); + }, + + /** Add an embedded SVG element. + <p>Specify all of <code>vx</code>, <code>vy</code>, + <code>vwidth</code>, <code>vheight</code> or none of them.</p> + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param x {number} The x-coordinate for the left edge of the node. + @param y {number} The y-coordinate for the top edge of the node. + @param width {number} The width of the node. + @param height {number} The height of the node. + @param [vx] {number} The minimum x-coordinate for view box. + @param [vy] {number} The minimum y-coordinate for the view box. + @param [vwidth] {number} The width of the view box. + @param [vheight] {number} The height of the view box. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new svg node. */ + svg: function(parent, x, y, width, height, vx, vy, vwidth, vheight, settings) { + var args = this._args(arguments, ['x', 'y', 'width', 'height', 'vx', 'vy', 'vwidth', 'vheight'], ['vx']); + var sets = $.extend({x: args.x, y: args.y, width: args.width, height: args.height}, + (args.vx != null ? {viewBox: args.vx + ' ' + args.vy + ' ' + args.vwidth + ' ' + args.vheight} : {})); + return this._makeNode(args.parent, 'svg', $.extend(sets, args.settings || {})); + }, + + /** Create a group. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param [id] {string} The ID of this group. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new group node. */ + group: function(parent, id, settings) { + var args = this._args(arguments, ['id'], ['id']); + return this._makeNode(args.parent, 'g', $.extend({id: args.id}, args.settings || {})); + }, + + /** Add a usage reference. + <p>Specify all of <code>x</code>, <code>y</code>, <code>width</code>, <code>height</code> or none of them.</p> + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param [x] {number} The x-coordinate for the left edge of the node. + @param [y] {number} The y-coordinate for the top edge of the node. + @param [width] {number} The width of the node. + @param [height] {number} The height of the node. + @param ref {string} The ID of the definition node. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new usage reference node. */ + use: function(parent, x, y, width, height, ref, settings) { + var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']); + if (typeof args.x === 'string') { + args.ref = args.x; + args.settings = args.y; + args.x = args.y = args.width = args.height = null; + } + var node = this._makeNode(args.parent, 'use', $.extend( + {x: args.x, y: args.y, width: args.width, height: args.height}, args.settings || {})); + node.setAttributeNS($.svg.xlinkNS, 'href', args.ref); + return node; + }, + + /** Add a link, which applies to all child elements. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param ref {string} The target URL. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new link node. */ + link: function(parent, ref, settings) { + var args = this._args(arguments, ['ref']); + var node = this._makeNode(args.parent, 'a', args.settings); + node.setAttributeNS($.svg.xlinkNS, 'href', args.ref); + return node; + }, + + /** Add an image. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param x {number} The x-coordinate for the left edge of the image. + @param y {number} The y-coordinate for the top edge of the image. + @param width {number} The width of the image. + @param height {number} The height of the image. + @param ref {string} The path to the image. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new image node. */ + image: function(parent, x, y, width, height, ref, settings) { + var args = this._args(arguments, ['x', 'y', 'width', 'height', 'ref']); + var node = this._makeNode(args.parent, 'image', $.extend( + {x: args.x, y: args.y, width: args.width, height: args.height}, args.settings || {})); + node.setAttributeNS($.svg.xlinkNS, 'href', args.ref); + return node; + }, + + /** Draw a path. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param path {string|SVGPath} The path to draw. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new path node. */ + path: function(parent, path, settings) { + var args = this._args(arguments, ['path']); + return this._makeNode(args.parent, 'path', $.extend( + {d: (args.path.path ? args.path.path() : args.path)}, args.settings || {})); + }, + + /** Draw a rectangle. + <p>Specify both of <code>rx</code> and <code>ry</code> or neither.</p> + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param x {number} The x-coordinate for the left edge of the rectangle. + @param y {number} The y-coordinate for the top edge of the rectangle. + @param width {number} The width of the rectangle. + @param height {number} The height of the rectangle. + @param [rx] {number} The x-radius of the ellipse for the rounded corners. + @param [ry] {number} The y-radius of the ellipse for the rounded corners. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new rectangle node. */ + rect: function(parent, x, y, width, height, rx, ry, settings) { + var args = this._args(arguments, ['x', 'y', 'width', 'height', 'rx', 'ry'], ['rx']); + return this._makeNode(args.parent, 'rect', $.extend( + {x: args.x, y: args.y, width: args.width, height: args.height}, + (args.rx ? {rx: args.rx, ry: args.ry} : {}), args.settings || {})); + }, + + /** Draw a circle. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param cx {number} The x-coordinate for the centre of the circle. + @param cy {number} The y-coordinate for the centre of the circle. + @param r {number} The radius of the circle. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new circle node. */ + circle: function(parent, cx, cy, r, settings) { + var args = this._args(arguments, ['cx', 'cy', 'r']); + return this._makeNode(args.parent, 'circle', $.extend( + {cx: args.cx, cy: args.cy, r: args.r}, args.settings || {})); + }, + + /** Draw an ellipse. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param cx {number} The x-coordinate for the centre of the ellipse. + @param cy {number} The y-coordinate for the centre of the ellipse. + @param rx {number} The x-radius of the ellipse. + @param ry {number} The y-radius of the ellipse. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new ellipse node. */ + ellipse: function(parent, cx, cy, rx, ry, settings) { + var args = this._args(arguments, ['cx', 'cy', 'rx', 'ry']); + return this._makeNode(args.parent, 'ellipse', $.extend( + {cx: args.cx, cy: args.cy, rx: args.rx, ry: args.ry}, args.settings || {})); + }, + + /** Draw a line. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param x1 {number} The x-coordinate for the start of the line. + @param y1 {number} The y-coordinate for the start of the line. + @param x2 {number} The x-coordinate for the end of the line. + @param y2 {number} The y-coordinate for the end of the line. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new line node. */ + line: function(parent, x1, y1, x2, y2, settings) { + var args = this._args(arguments, ['x1', 'y1', 'x2', 'y2']); + return this._makeNode(args.parent, 'line', $.extend( + {x1: args.x1, y1: args.y1, x2: args.x2, y2: args.y2}, args.settings || {})); + }, + + /** Draw a polygonal line. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param points {number[][]} The x-/y-coordinates for the points on the line. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new polygonal line node. */ + polyline: function(parent, points, settings) { + var args = this._args(arguments, ['points']); + return this._poly(args.parent, 'polyline', args.points, args.settings); + }, + + /** Draw a polygonal shape. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param points {number[][]} The x-/y-coordinates for the points on the shape. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new polygonal shape node. */ + polygon: function(parent, points, settings) { + var args = this._args(arguments, ['points']); + return this._poly(args.parent, 'polygon', args.points, args.settings); + }, + + /** Draw a polygonal line or shape. + @private + @param parent {SVGElement|jQuery} The parent node for the new node. + @param name {string} The type of polygon to create. + @param points {number[][]} The x-/y-coordinates for the points on the shape. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new polygon node. */ + _poly: function(parent, name, points, settings) { + var ps = ''; + for (var i = 0; i < points.length; i++) { + ps += points[i].join() + ' '; + } + return this._makeNode(parent, name, $.extend({points: $.trim(ps)}, settings || {})); + }, + + /** Draw text. + <p>Specify both of <code>x</code> and <code>y</code> or neither of them.</p> + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param [x] {number|number[]} The x-coordinate(s) for the text. + @param [y] {number|number[]} The y-coordinate(s) for the text. + @param value {string|SVGText} The text content or text with spans and references. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new text node. */ + text: function(parent, x, y, value, settings) { + var args = this._args(arguments, ['x', 'y', 'value']); + if (typeof args.x === 'string' && arguments.length < 4) { + args.value = args.x; + args.settings = args.y; + args.x = args.y = null; + } + return this._text(args.parent, 'text', args.value, $.extend( + {x: (args.x && $.isArray(args.x) ? args.x.join(' ') : args.x), + y: (args.y && $.isArray(args.y) ? args.y.join(' ') : args.y)}, args.settings || {})); + }, + + /** Draw text along a path. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param path {string} The ID of the path. + @param value {string|SVGText} The text content or text with spans and references. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new textpath node. */ + textpath: function(parent, path, value, settings) { + var args = this._args(arguments, ['path', 'value']); + var node = this._text(args.parent, 'textPath', args.value, args.settings || {}); + node.setAttributeNS($.svg.xlinkNS, 'href', args.path); + return node; + }, + + /** Draw text. + @private + @param parent {SVGElement|jQuery} The parent node for the new node. + @param name {string} The type of text to create. + @param value {string|SVGText} The text content or text with spans and references. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new text node. */ + _text: function(parent, name, value, settings) { + var node = this._makeNode(parent, name, settings); + if (typeof value === 'string') { + node.appendChild(node.ownerDocument.createTextNode(value)); + } + else { + for (var i = 0; i < value._parts.length; i++) { + var part = value._parts[i]; + if (part[0] === 'tspan') { + var child = this._makeNode(node, part[0], part[2]); + child.appendChild(node.ownerDocument.createTextNode(part[1])); + node.appendChild(child); + } + else if (part[0] === 'tref') { + var child = this._makeNode(node, part[0], part[2]); + child.setAttributeNS($.svg.xlinkNS, 'href', part[1]); + node.appendChild(child); + } + else if (part[0] === 'textpath') { + var set = $.extend({}, part[2]); + set.href = null; + var child = this._makeNode(node, part[0], set); + child.setAttributeNS($.svg.xlinkNS, 'href', part[2].href); + child.appendChild(node.ownerDocument.createTextNode(part[1])); + node.appendChild(child); + } + else { // straight text + node.appendChild(node.ownerDocument.createTextNode(part[1])); + } + } + } + return node; + }, + + /** Add a custom SVG element. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param name {string} The name of the element. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new custom node. */ + other: function(parent, name, settings) { + var args = this._args(arguments, ['name']); + return this._makeNode(args.parent, args.name, args.settings || {}); + }, + + /** Create a SVG node with the given settings. + @private + @param parent {SVGElement|jQuery} The parent node for the new node, or SVG root if <code>null</code>. + @param name {string} The name of the element. + @param [settings] {object} Additional settings for this node. + @return {SVGElement} The new node. */ + _makeNode: function(parent, name, settings) { + parent = parent || this._svg; + var node = this._svg.ownerDocument.createElementNS($.svg.svgNS, name); + for (var name in settings) { + var value = settings[name]; + if (value != null && (typeof value !== 'string' || value !== '')) { + node.setAttribute($.svg._attrNames[name] || name, value); + } + } + parent.appendChild(node); + return node; + }, + + /** Add an existing SVG node to the document. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param node {SVGElement|string|jQuery} The new node to add or + the jQuery selector for the node or the set of nodes to add. + @return {SVGWrapper} This wrapper. */ + add: function(parent, node) { + var args = this._args((arguments.length === 1 ? [null, parent] : arguments), ['node']); + var svg = this; + args.parent = args.parent || this._svg; + args.node = (args.node.jquery ? args.node : $(args.node)); + try { + args.parent.appendChild(args.node.cloneNode(true)); + } + catch (e) { + args.node.each(function() { + var child = svg._cloneAsSVG(this); + if (child) { + args.parent.appendChild(child); + } + }); + } + return this; + }, + + /** Clone an existing SVG node and add it to the document. + @param [parent] {SVGElement|jQuery} The parent node for the new node, or SVG root if not specified. + @param node {SVGEelement|string|jQuery} The new node to add or + the jQuery selector for the node or the set of nodes to clone. + @return {SVGElement[]} The collection of new nodes. */ + clone: function(parent, node) { + var svg = this; + var args = this._args((arguments.length === 1 ? [null, parent] : arguments), ['node']); + args.parent = args.parent || this._svg; + args.node = (args.node.jquery ? args.node : $(args.node)); + var newNodes = []; + args.node.each(function() { + var child = svg._cloneAsSVG(this); + if (child) { + child.id = ''; + args.parent.appendChild(child); + newNodes.push(child); + } + }); + return newNodes; + }, + + /** SVG nodes must belong to the SVG namespace, so clone and ensure this is so. + @private + @param node {SVGElement} The SVG node to clone. + @return {SVGElement} The cloned node. */ + _cloneAsSVG: function(node) { + var newNode = null; + if (node.nodeType === 1) { // element + newNode = this._svg.ownerDocument.createElementNS($.svg.svgNS, this._checkName(node.nodeName)); + for (var i = 0; i < node.attributes.length; i++) { + var attr = node.attributes.item(i); + if (attr.nodeName !== 'xmlns' && attr.nodeValue) { + if (attr.prefix === 'xlink') { + newNode.setAttributeNS($.svg.xlinkNS, attr.localName || attr.baseName, attr.nodeValue); + } + else { + newNode.setAttribute(this._checkName(attr.nodeName), attr.nodeValue); + } + } + } + for (var i = 0; i < node.childNodes.length; i++) { + var child = this._cloneAsSVG(node.childNodes[i]); + if (child) { + newNode.appendChild(child); + } + } + } + else if (node.nodeType === 3) { // text + if ($.trim(node.nodeValue)) { + newNode = this._svg.ownerDocument.createTextNode(node.nodeValue); + } + } + else if (node.nodeType === 4) { // CDATA + if ($.trim(node.nodeValue)) { + try { + newNode = this._svg.ownerDocument.createCDATASection(node.nodeValue); + } + catch (e) { + newNode = this._svg.ownerDocument.createTextNode( + node.nodeValue.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')); + } + } + } + return newNode; + }, + + /** Node names must be lower case and without SVG namespace prefix. + @private + @param name {string} The name to check. + @return {string} The corrected name. */ + _checkName: function(name) { + name = (name.substring(0, 1) >= 'A' && name.substring(0, 1) <= 'Z' ? name.toLowerCase() : name); + return (name.substring(0, 4) === 'svg:' ? name.substring(4) : name); + }, + + /** Load an external SVG document. + @param url {string} The location of the SVG document or + the actual SVG content (starting with '<code><svg</code>'. + @param settings {boolean|function|object} Either <code>addTo</code> below or <code>onLoad</code> below or + additional settings for the load with attributes below: + <code>addTo</code> {boolean} <code>true</code> to add to what's already there, + or <code>false</code> to clear the canvas first, + <code>changeSize</code> {boolean} <code>true</code> to allow the canvas size to change, + or <code>false</code> to retain the original, + <code>onLoad</code> {function} callback after the document has loaded, + '<code>this</code>' is the container, receives SVG object and optional error message as a parameter, + <code>parent</code> {string|SVGElement|jQuery} the parent to load into, + defaults to top-level svg element. + @return {SVGWrapper} This wrapper. */ + load: function(url, settings) { + settings = (typeof settings === 'boolean' ? {addTo: settings} : + (typeof settings === 'function' ? {onLoad: settings} : + (typeof settings === 'string' ? {parent: settings} : + (typeof settings === 'object' && settings.nodeName ? {parent: settings} : + (typeof settings === 'object' && settings.jquery ? {parent: settings} : settings || {}))))); + if (!settings.parent && !settings.addTo) { + this.clear(false); + } + var size = [this._svg.getAttribute('width'), this._svg.getAttribute('height')]; + var wrapper = this; + // Report a problem with the load + var reportError = function(message) { + message = $.svg.local.errorLoadingText + ': ' + message; + if (settings.onLoad) { + settings.onLoad.apply(wrapper._container || wrapper._svg, [wrapper, message]); + } + else { + wrapper.text(null, 10, 20, message); + } + }; + // Create a DOM from SVG content + var loadXML4IE = function(data) { + var xml = new ActiveXObject('Microsoft.XMLDOM'); + xml.validateOnParse = false; + xml.resolveExternals = false; + xml.async = false; + xml.loadXML(data); + if (xml.parseError.errorCode !== 0) { + reportError(xml.parseError.reason); + return null; + } + return xml; + }; + // Load the SVG DOM + var loadSVG = function(data) { + if (!data) { + return; + } + if (data.documentElement.nodeName !== 'svg') { + var errors = data.getElementsByTagName('parsererror'); + var messages = (errors.length ? errors[0].getElementsByTagName('div') : []); // Safari + reportError(!errors.length ? '???' : (messages.length ? messages[0] : errors[0]).firstChild.nodeValue); + return; + } + var parent = (settings.parent ? $(settings.parent)[0] : wrapper._svg); + var attrs = {}; + for (var i = 0; i < data.documentElement.attributes.length; i++) { + var attr = data.documentElement.attributes.item(i); + if (!(attr.nodeName === 'version' || attr.nodeName.substring(0, 5) === 'xmlns')) { + attrs[attr.nodeName] = attr.nodeValue; + } + } + wrapper.configure(parent, attrs, !settings.parent); + var nodes = data.documentElement.childNodes; + for (var i = 0; i < nodes.length; i++) { + try { + parent.appendChild(wrapper._svg.ownerDocument.importNode(nodes[i], true)); + if (nodes[i].nodeName === 'script') { + $.globalEval(nodes[i].textContent); + } + } + catch (e) { + wrapper.add(parent, nodes[i]); + } + } + if (!settings.keepRelativeLinks && url.match('/')) { + var base = url.replace(/\/[^\/]*$/, '/'); + $('*', parent).each(function() { + var href = $(this).attr('xlink:href'); + if (href && !href.match(/(^[a-z][-a-z0-9+.]*:.*$)|(^\/.*$)|(^#.*$)/i)) { + $(this).attr('xlink:href', base + href); + } + }); + } + if (!settings.changeSize) { + wrapper.configure(parent, {width: size[0], height: size[1]}); + } + if (settings.onLoad) { + settings.onLoad.apply(wrapper._container || wrapper._svg, [wrapper]); + } + }; + if (url.match('<svg')) { // Inline SVG + try { + loadSVG(new DOMParser().parseFromString(url, 'text/xml')); + } catch (e) { + reportError(e); + } + } + else { // Remote SVG + $.ajax({url: url, dataType: 'xml', + success: function(xml) { + loadSVG(xml); + }, error: function(http, message, exc) { + reportError(message + (exc ? ' ' + exc.message : '')); + }}); + } + return this; + }, + + /** Delete a specified node. + @param node {SVGElement|jQuery} The drawing node to remove. + @return {SVGWrapper} This wrapper. */ + remove: function(node) { + node = (node.jquery ? node[0] : node); + node.parentNode.removeChild(node); + return this; + }, + + /** Delete everything in the current document. + @param [attrsToo=false] {boolean} <code>true</code> to clear any root attributes as well, + <code>false</code> to leave them. + @return {SVGWrapper} This wrapper. */ + clear: function(attrsToo) { + if (attrsToo) { + this.configure({}, true); + } + while (this._svg.firstChild) { + this._svg.removeChild(this._svg.firstChild); + } + return this; + }, + + /** Serialise the current diagram into an SVG text document. + @param [node] {SVGElement} The starting node, or SVG root if not specified . + @return {string} The SVG as text. */ + toSVG: function(node) { + node = node || this._svg; + return (typeof XMLSerializer === 'undefined' ? this._toSVG(node) : new XMLSerializer().serializeToString(node)); + }, + + /** Serialise one node in the SVG hierarchy. + @private + @param node {SVGElement} The current node to serialise. + @return {string} The serialised SVG. */ + _toSVG: function(node) { + var svgDoc = ''; + if (!node) { + return svgDoc; + } + if (node.nodeType === 3) { // Text + svgDoc = node.nodeValue; + } + else if (node.nodeType === 4) { // CDATA + svgDoc = '<![CDATA[' + node.nodeValue + ']]>'; + } + else { // Element + svgDoc = '<' + node.nodeName; + if (node.attributes) { + for (var i = 0; i < node.attributes.length; i++) { + var attr = node.attributes.item(i); + if (!($.trim(attr.nodeValue) === '' || attr.nodeValue.match(/^\[object/) || + attr.nodeValue.match(/^function/))) { + svgDoc += ' ' + (attr.namespaceURI === $.svg.xlinkNS ? 'xlink:' : '') + + attr.nodeName + '="' + attr.nodeValue + '"'; + } + } + } + if (node.firstChild) { + svgDoc += '>'; + var child = node.firstChild; + while (child) { + svgDoc += this._toSVG(child); + child = child.nextSibling; + } + svgDoc += '</' + node.nodeName + '>'; + } + else { + svgDoc += '/>'; + } + } + return svgDoc; + } +}); + +/** Helper to generate an SVG path. + <p>Obtain an instance from the SVGWrapper object.</p> + <p>String calls together to generate the path and use its value:</p> + @module SVGPath + @example var path = root.createPath(); + root.path(null, path.move(100, 100).line(300, 100).line(200, 300).close(), {fill: 'red'}); + // or + root.path(null, path.move(100, 100).line([[300, 100], [200, 300]]).close(), {fill: 'red'}); */ +function SVGPath() { + this._path = ''; +} + +$.extend(SVGPath.prototype, { + /** Prepare to create a new path. + @return {SVGPath} This path. */ + reset: function() { + this._path = ''; + return this; + }, + + /** Move the pointer to a position. + @param x {number|number[][]} x-coordinate to move to or x-/y-coordinates to move to. + @param [y] {number} y-coordinate to move to (omitted if <code>x</code> is array). + @param [relative=false] {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + move: function(x, y, relative) { + relative = ($.isArray(x) ? y : relative); + return this._coords((relative ? 'm' : 'M'), x, y); + }, + + /** Draw a line to a position. + @param x {number|number[][]} x-coordinate to move to or x-/y-coordinates to move to. + @param [y] {number} y-coordinate to move to (omitted if <code>x</code> is array). + @param [relative=false] {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + line: function(x, y, relative) { + relative = ($.isArray(x) ? y : relative); + return this._coords((relative ? 'l' : 'L'), x, y); + }, + + /** Draw a horizontal line to a position. + @param x {number|number[]} x-coordinate to draw to or x-coordinates to draw to. + @param relative {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + horiz: function(x, relative) { + this._path += (relative ? 'h' : 'H') + ($.isArray(x) ? x.join(' ') : x); + return this; + }, + + /** Draw a vertical line to a position. + @param y {number|number[]} y-coordinate to draw to or y-coordinates to draw to. + @param [relative=false] {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + vert: function(y, relative) { + this._path += (relative ? 'v' : 'V') + ($.isArray(y) ? y.join(' ') : y); + return this; + }, + + /** Draw a cubic B茅zier curve. + @param x1 {number|number[][]} x-coordinate of beginning control point or + x-/y-coordinates of control and end points to draw to. + @param [y1] {number} y-coordinate of beginning control point (omitted if <code>x1</code> is array). + @param [x2] {number} x-coordinate of ending control point (omitted if <code>x1</code> is array). + @param [y2] {number} y-coordinate of ending control point (omitted if <code>x1</code> is array). + @param [x] {number} x-coordinate of curve end (omitted if <code>x1</code> is array). + @param [y] {number} y-coordinate of curve end (omitted if <code>x1</code> is array). + @param [relative=false] {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + curveC: function(x1, y1, x2, y2, x, y, relative) { + relative = ($.isArray(x1) ? y1 : relative); + return this._coords((relative ? 'c' : 'C'), x1, y1, x2, y2, x, y); + }, + + /** Continue a cubic B茅zier curve. + <p>Starting control point is the reflection of the previous end control point.</p> + @param x2 {number|number[][]} x-coordinate of ending control point or + x-/y-coordinates of control and end points to draw to. + @param [y2] {number} y-coordinate of ending control point (omitted if <code>x2</code> is array). + @param [x] {number} x-coordinate of curve end (omitted if <code>x2</code> is array). + @param [y] {number} y-coordinate of curve end (omitted if <code>x2</code> is array). + @param [relative=false] {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + smoothC: function(x2, y2, x, y, relative) { + relative = ($.isArray(x2) ? y2 : relative); + return this._coords((relative ? 's' : 'S'), x2, y2, x, y); + }, + + /** Draw a quadratic B茅zier curve. + @param x1 {number|number[][]} x-coordinate of control point or + x-/y-coordinates of control and end points to draw to. + @param [y1] {number} y-coordinate of control point (omitted if <code>x1</code> is array). + @param [x] {number} x-coordinate of curve end (omitted if <code>x1</code> is array). + @param [y] {number} y-coordinate of curve end (omitted if <code>x1</code> is array). + @param [relative=false] {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + curveQ: function(x1, y1, x, y, relative) { + relative = ($.isArray(x1) ? y1 : relative); + return this._coords((relative ? 'q' : 'Q'), x1, y1, x, y); + }, + + /** Continue a quadratic B茅zier curve. + <p>Control point is the reflection of the previous control point.</p> + @param x {number|number[][]} x-coordinate of curve end or x-/y-coordinates of points to draw to. + @param [y] {number} y-coordinate of curve end (omitted if <code>x</code> is array). + @param [relative=false] {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + smoothQ: function(x, y, relative) { + relative = ($.isArray(x) ? y : relative); + return this._coords((relative ? 't' : 'T'), x, y); + }, + + /** Generate a path command with (a list of) coordinates. + @private + @param cmd {string} The command for the path element. + @param x1 {number} The first x-coordinate. + @param y1 {number} The first y-coordinate. + @param [x2] {number} The second x-coordinate. + @param [y2] {number} The second y-coordinate. + @param [x3] {number} The third x-coordinate. + @param [y3] {number} The third y-coordinate. + @return {SVGPath} This path. */ + _coords: function(cmd, x1, y1, x2, y2, x3, y3) { + if ($.isArray(x1)) { + for (var i = 0; i < x1.length; i++) { + var cs = x1[i]; + this._path += (i === 0 ? cmd : ' ') + cs[0] + ',' + cs[1] + (cs.length < 4 ? '' : + ' ' + cs[2] + ',' + cs[3] + (cs.length < 6 ? '': ' ' + cs[4] + ',' + cs[5])); + } + } + else { + this._path += cmd + x1 + ',' + y1 + + (x2 == null ? '' : ' ' + x2 + ',' + y2 + (x3 == null ? '' : ' ' + x3 + ',' + y3)); + } + return this; + }, + + /** Draw an arc to a position. + @param rx {number|any[][]} x-radius of arc or x-/y-coordinates and flags for points to draw to. + @param [ry] {number} y-radius of arc (omitted if <code>rx</code> is array). + @param [xRotate] {number} x-axis rotation (degrees, clockwise) (omitted if <code>rx</code> is array). + @param [large] {boolean} <code>true</code> to draw the large part of the arc, + <code>false</code> to draw the small part (omitted if <code>rx</code> is array). + @param [clockwise] {boolean} <code>true</code> to draw the clockwise arc, + <code>false</code> to draw the anti-clockwise arc (omitted if <code>rx</code> is array). + @param [x] {number} x-coordinate of arc end (omitted if <code>rx</code> is array). + @param [y] {number} y-coordinate of arc end (omitted if <code>rx</code> is array). + @param [relative=false] {boolean} <code>true</code> for coordinates relative to the current point, + <code>false</code> for coordinates being absolute. + @return {SVGPath} This path. */ + arc: function(rx, ry, xRotate, large, clockwise, x, y, relative) { + relative = ($.isArray(rx) ? ry : relative); + this._path += (relative ? 'a' : 'A'); + if ($.isArray(rx)) { + for (var i = 0; i < rx.length; i++) { + var cs = rx[i]; + this._path += (i === 0 ? '' : ' ') + cs[0] + ',' + cs[1] + ' ' + + cs[2] + ' ' + (cs[3] ? '1' : '0') + ',' + (cs[4] ? '1' : '0') + ' ' + cs[5] + ',' + cs[6]; + } + } + else { + this._path += rx + ',' + ry + ' ' + xRotate + ' ' + + (large ? '1' : '0') + ',' + (clockwise ? '1' : '0') + ' ' + x + ',' + y; + } + return this; + }, + + /** Close the current path. + @return {SVGPath} This path. */ + close: function() { + this._path += 'z'; + return this; + }, + + /** Return the string rendering of the specified path. + @return {string} The stringified path. */ + path: function() { + return this._path; + } +}); + +SVGPath.prototype.moveTo = SVGPath.prototype.move; +SVGPath.prototype.lineTo = SVGPath.prototype.line; +SVGPath.prototype.horizTo = SVGPath.prototype.horiz; +SVGPath.prototype.vertTo = SVGPath.prototype.vert; +SVGPath.prototype.curveCTo = SVGPath.prototype.curveC; +SVGPath.prototype.smoothCTo = SVGPath.prototype.smoothC; +SVGPath.prototype.curveQTo = SVGPath.prototype.curveQ; +SVGPath.prototype.smoothQTo = SVGPath.prototype.smoothQ; +SVGPath.prototype.arcTo = SVGPath.prototype.arc; + +/** Helper to generate an SVG text object. + <p>Obtain an instance from the SVGWrapper object.</p> + <p>String calls together to generate the text and use its value:</p> + @module SVGText + @example var text = root.createText(); + root.text(null, x, y, text.string('This is '). + span('red', {fill: 'red'}).string('!'), {fill: 'blue'}); */ +function SVGText() { + this._parts = []; // The components of the text object +} + +$.extend(SVGText.prototype, { + /** Prepare to create a new text object. + @return {SVGText} This text object. */ + reset: function() { + this._parts = []; + return this; + }, + + /** Add a straight string value. + @param value {string} The actual text. + @return {SVGText} This text object. */ + string: function(value) { + this._parts.push(['text', value]); + return this; + }, + + /** Add a separate text span that has its own settings. + @param value {string} The actual text. + @param settings {object} The settings for this text. + @return {SVGText} This text object. */ + span: function(value, settings) { + this._parts.push(['tspan', value, settings]); + return this; + }, + + /** Add a reference to a previously defined text string. + @param id {string} The ID of the actual text. + @param settings {object} The settings for this text. + @return {SVGText} This text object. */ + ref: function(id, settings) { + this._parts.push(['tref', id, settings]); + return this; + }, + + /** Add text drawn along a path. + @param id {string} The ID of the path. + @param value {string} The actual text. + @param settings {object} The settings for this text. + @return {SVGText} This text object. */ + path: function(id, value, settings) { + this._parts.push(['textpath', value, $.extend({href: id}, settings || {})]); + return this; + } +}); + +/** Attach the SVG functionality to a jQuery selection. + @param [command] {string} The command to run. + @param [options] {object} The new settings to use for these SVG instances. + @return {jQuery} For chaining further calls. */ +$.fn.svg = function(options) { + var otherArgs = Array.prototype.slice.call(arguments, 1); + if (typeof options === 'string' && options === 'get') { + return $.svg['_' + options + 'SVG'].apply($.svg, [this[0]].concat(otherArgs)); + } + return this.each(function() { + if (typeof options === 'string') { + $.svg['_' + options + 'SVG'].apply($.svg, [this].concat(otherArgs)); + } + else { + $.svg._attachSVG(this, options || {}); + } + }); +}; + +// Singleton primary SVG interface +$.svg = new SVGManager(); + +})(jQuery); diff --git a/phpMyAdmin/js/vendor/jquery/jquery.tablesorter.js b/phpMyAdmin/js/vendor/jquery/jquery.tablesorter.js new file mode 100755 index 0000000..2adc595 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.tablesorter.js @@ -0,0 +1,1033 @@ +/* + * + * TableSorter 2.0 - Client-side table sorting with ease! + * Version 2.0.5b + * @requires jQuery v1.2.3 + * + * Copyright (c) 2007 Christian Bach + * Examples and docs at: http://tablesorter.com + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + * + */ +/** + * + * @description Create a sortable table with multi-column sorting capabilitys + * + * @example $('table').tablesorter(); + * @desc Create a simple tablesorter interface. + * + * @example $('table').tablesorter({ sortList:[[0,0],[1,0]] }); + * @desc Create a tablesorter interface and sort on the first and secound column column headers. + * + * @example $('table').tablesorter({ headers: { 0: { sorter: false}, 1: {sorter: false} } }); + * + * @desc Create a tablesorter interface and disableing the first and second column headers. + * + * + * @example $('table').tablesorter({ headers: { 0: {sorter:"integer"}, 1: {sorter:"currency"} } }); + * + * @desc Create a tablesorter interface and set a column parser for the first + * and second column. + * + * + * @param Object + * settings An object literal containing key/value pairs to provide + * optional settings. + * + * + * @option String cssHeader (optional) A string of the class name to be appended + * to sortable tr elements in the thead of the table. Default value: + * "header" + * + * @option String cssAsc (optional) A string of the class name to be appended to + * sortable tr elements in the thead on a ascending sort. Default value: + * "headerSortUp" + * + * @option String cssDesc (optional) A string of the class name to be appended + * to sortable tr elements in the thead on a descending sort. Default + * value: "headerSortDown" + * + * @option String sortInitialOrder (optional) A string of the inital sorting + * order can be asc or desc. Default value: "asc" + * + * @option String sortMultisortKey (optional) A string of the multi-column sort + * key. Default value: "shiftKey" + * + * @option String textExtraction (optional) A string of the text-extraction + * method to use. For complex html structures inside td cell set this + * option to "complex", on large tables the complex option can be slow. + * Default value: "simple" + * + * @option Object headers (optional) An array containing the forces sorting + * rules. This option let's you specify a default sorting rule. Default + * value: null + * + * @option Array sortList (optional) An array containing the forces sorting + * rules. This option let's you specify a default sorting rule. Default + * value: null + * + * @option Array sortForce (optional) An array containing forced sorting rules. + * This option let's you specify a default sorting rule, which is + * prepended to user-selected rules. Default value: null + * + * @option Boolean sortLocaleCompare (optional) Boolean flag indicating whatever + * to use String.localeCampare method or not. Default set to true. + * + * + * @option Array sortAppend (optional) An array containing forced sorting rules. + * This option let's you specify a default sorting rule, which is + * appended to user-selected rules. Default value: null + * + * @option Boolean widthFixed (optional) Boolean flag indicating if tablesorter + * should apply fixed widths to the table columns. This is usefull when + * using the pager companion plugin. This options requires the dimension + * jquery plugin. Default value: false + * + * @option Boolean cancelSelection (optional) Boolean flag indicating if + * tablesorter should cancel selection of the table headers text. + * Default value: true + * + * @option Boolean debug (optional) Boolean flag indicating if tablesorter + * should display debuging information usefull for development. + * + * @type jQuery + * + * @name tablesorter + * + * @cat Plugins/Tablesorter + * + * @author Christian Bach/christian.bach@polyester.se + */ + +(function ($) { + $.extend({ + tablesorter: new + function () { + + var parsers = [], + widgets = []; + + this.defaults = { + cssHeader: "header", + cssAsc: "headerSortUp", + cssDesc: "headerSortDown", + cssChildRow: "expand-child", + sortInitialOrder: "asc", + sortMultiSortKey: "shiftKey", + sortForce: null, + sortAppend: null, + sortLocaleCompare: true, + textExtraction: "simple", + parsers: {}, widgets: [], + widgetZebra: { + css: ["even", "odd"] + }, headers: {}, widthFixed: false, + cancelSelection: true, + sortList: [], + headerList: [], + dateFormat: "us", + decimal: '/\.|\,/g', + onRenderHeader: null, + selectorHeaders: 'thead th', + debug: false + }; + + /* debuging utils */ + + function benchmark(s, d) { + log(s + "," + (new Date().getTime() - d.getTime()) + "ms"); + } + + this.benchmark = benchmark; + + function log(s) { + if (typeof console != "undefined" && typeof console.debug != "undefined") { + console.log(s); + } else { + alert(s); + } + } + + /* parsers utils */ + + function buildParserCache(table, $headers) { + + if (table.config.debug) { + var parsersDebug = ""; + } + + if (table.tBodies.length == 0) return; // In the case of empty tables + var rows = table.tBodies[0].rows; + + if (rows[0]) { + + var list = [], + cells = rows[0].cells, + l = cells.length; + + for (var i = 0; i < l; i++) { + + var p = false; + + if ($.metadata && ($($headers[i]).metadata() && $($headers[i]).metadata().sorter)) { + + p = getParserById($($headers[i]).metadata().sorter); + + } else if ((table.config.headers[i] && table.config.headers[i].sorter)) { + + p = getParserById(table.config.headers[i].sorter); + } + if (!p) { + + p = detectParserForColumn(table, rows, -1, i); + } + + if (table.config.debug) { + parsersDebug += "column:" + i + " parser:" + p.id + "\n"; + } + + list.push(p); + } + } + + if (table.config.debug) { + log(parsersDebug); + } + + return list; + }; + + function detectParserForColumn(table, rows, rowIndex, cellIndex) { + var l = parsers.length, + node = false, + nodeValue = false, + keepLooking = true; + while (nodeValue == '' && keepLooking) { + rowIndex++; + if (rows[rowIndex]) { + node = getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex); + nodeValue = trimAndGetNodeText(table.config, node); + if (table.config.debug) { + log('Checking if value was empty on row:' + rowIndex); + } + } else { + keepLooking = false; + } + } + for (var i = 1; i < l; i++) { + if (parsers[i].is(nodeValue, table, node)) { + return parsers[i]; + } + } + // 0 is always the generic parser (text) + return parsers[0]; + } + + function getNodeFromRowAndCellIndex(rows, rowIndex, cellIndex) { + return rows[rowIndex].cells[cellIndex]; + } + + function trimAndGetNodeText(config, node) { + return $.trim(getElementText(config, node)); + } + + function getParserById(name) { + var l = parsers.length; + for (var i = 0; i < l; i++) { + if (parsers[i].id.toLowerCase() == name.toLowerCase()) { + return parsers[i]; + } + } + return false; + } + + /* utils */ + + function buildCache(table) { + + if (table.config.debug) { + var cacheTime = new Date(); + } + + var totalRows = (table.tBodies[0] && table.tBodies[0].rows.length) || 0, + totalCells = (table.tBodies[0].rows[0] && table.tBodies[0].rows[0].cells.length) || 0, + parsers = table.config.parsers, + cache = { + row: [], + normalized: [] + }; + + for (var i = 0; i < totalRows; ++i) { + + /** Add the table data to main data array */ + var c = $(table.tBodies[0].rows[i]), + cols = []; + + // if this is a child row, add it to the last row's children and + // continue to the next row + if (c.hasClass(table.config.cssChildRow)) { + cache.row[cache.row.length - 1] = cache.row[cache.row.length - 1].add(c); + // go to the next for loop + continue; + } + + cache.row.push(c); + + for (var j = 0; j < totalCells; ++j) { + cols.push(parsers[j].format(getElementText(table.config, c[0].cells[j]), table, c[0].cells[j])); + } + + cols.push(cache.normalized.length); // add position for rowCache + cache.normalized.push(cols); + cols = null; + }; + + if (table.config.debug) { + benchmark("Building cache for " + totalRows + " rows:", cacheTime); + } + + return cache; + }; + + function getElementText(config, node) { + + var text = ""; + + if (!node) return ""; + + if (!config.supportsTextContent) config.supportsTextContent = node.textContent || false; + + if (config.textExtraction == "simple") { + if (config.supportsTextContent) { + text = node.textContent; + } else { + if (node.childNodes[0] && node.childNodes[0].hasChildNodes()) { + text = node.childNodes[0].innerHTML; + } else { + text = node.innerHTML; + } + } + } else { + if (typeof(config.textExtraction) == "function") { + text = config.textExtraction(node); + } else { + text = $(node).text(); + } + } + return text; + } + + function appendToTable(table, cache) { + + if (table.config.debug) { + var appendTime = new Date() + } + + var c = cache, + r = c.row, + n = c.normalized, + totalRows = n.length, + checkCell = (n[0].length - 1), + tableBody = $(table.tBodies[0]), + rows = []; + + + for (var i = 0; i < totalRows; i++) { + var pos = n[i][checkCell]; + + rows.push(r[pos]); + + if (!table.config.appender) { + + //var o = ; + var l = r[pos].length; + for (var j = 0; j < l; j++) { + tableBody[0].appendChild(r[pos][j]); + } + + // + } + } + + + + if (table.config.appender) { + + table.config.appender(table, rows); + } + + rows = null; + + if (table.config.debug) { + benchmark("Rebuilt table:", appendTime); + } + + // apply table widgets + applyWidget(table); + + // trigger sortend + setTimeout(function () { + $(table).trigger("sortEnd"); + }, 0); + + }; + + function buildHeaders(table) { + + if (table.config.debug) { + var time = new Date(); + } + + var meta = ($.metadata) ? true : false; + + var header_index = computeTableHeaderCellIndexes(table); + + $tableHeaders = $(table.config.selectorHeaders, table).each(function (index) { + + this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex]; + // this.column = index; + this.order = formatSortingOrder(table.config.sortInitialOrder); + + + this.count = this.order; + + if (checkHeaderMetadata(this) || checkHeaderOptions(table, index)) this.sortDisabled = true; + if (checkHeaderOptionsSortingLocked(table, index)) this.order = this.lockedOrder = checkHeaderOptionsSortingLocked(table, index); + + if (!this.sortDisabled) { + var $th = $(this).addClass(table.config.cssHeader); + if (table.config.onRenderHeader) table.config.onRenderHeader.apply($th); + } + + // add cell to headerList + table.config.headerList[index] = this; + }); + + if (table.config.debug) { + benchmark("Built headers:", time); + log($tableHeaders); + } + + return $tableHeaders; + + }; + + // from: + // http://www.javascripttoolbox.com/lib/table/examples.php + // http://www.javascripttoolbox.com/temp/table_cellindex.html + + + function computeTableHeaderCellIndexes(t) { + var matrix = []; + var lookup = {}; + var thead = t.getElementsByTagName('THEAD')[0]; + var trs = thead.getElementsByTagName('TR'); + + for (var i = 0; i < trs.length; i++) { + var cells = trs[i].cells; + for (var j = 0; j < cells.length; j++) { + var c = cells[j]; + + var rowIndex = c.parentNode.rowIndex; + var cellId = rowIndex + "-" + c.cellIndex; + var rowSpan = c.rowSpan || 1; + var colSpan = c.colSpan || 1 + var firstAvailCol; + if (typeof(matrix[rowIndex]) == "undefined") { + matrix[rowIndex] = []; + } + // Find first available column in the first row + for (var k = 0; k < matrix[rowIndex].length + 1; k++) { + if (typeof(matrix[rowIndex][k]) == "undefined") { + firstAvailCol = k; + break; + } + } + lookup[cellId] = firstAvailCol; + for (var k = rowIndex; k < rowIndex + rowSpan; k++) { + if (typeof(matrix[k]) == "undefined") { + matrix[k] = []; + } + var matrixrow = matrix[k]; + for (var l = firstAvailCol; l < firstAvailCol + colSpan; l++) { + matrixrow[l] = "x"; + } + } + } + } + return lookup; + } + + function checkCellColSpan(table, rows, row) { + var arr = [], + r = table.tHead.rows, + c = r[row].cells; + + for (var i = 0; i < c.length; i++) { + var cell = c[i]; + + if (cell.colSpan > 1) { + arr = arr.concat(checkCellColSpan(table, headerArr, row++)); + } else { + if (table.tHead.length == 1 || (cell.rowSpan > 1 || !r[row + 1])) { + arr.push(cell); + } + // headerArr[row] = (i+row); + } + } + return arr; + }; + + function checkHeaderMetadata(cell) { + if (($.metadata) && ($(cell).metadata().sorter === false)) { + return true; + }; + return false; + } + + function checkHeaderOptions(table, i) { + if ((table.config.headers[i]) && (table.config.headers[i].sorter === false)) { + return true; + }; + return false; + } + + function checkHeaderOptionsSortingLocked(table, i) { + if ((table.config.headers[i]) && (table.config.headers[i].lockedOrder)) return table.config.headers[i].lockedOrder; + return false; + } + + function applyWidget(table) { + var c = table.config.widgets; + var l = c.length; + for (var i = 0; i < l; i++) { + + getWidgetById(c[i]).format(table); + } + + } + + function getWidgetById(name) { + var l = widgets.length; + for (var i = 0; i < l; i++) { + if (widgets[i].id.toLowerCase() == name.toLowerCase()) { + return widgets[i]; + } + } + }; + + function formatSortingOrder(v) { + if (typeof(v) != "Number") { + return (v.toLowerCase() == "desc") ? 1 : 0; + } else { + return (v == 1) ? 1 : 0; + } + } + + function isValueInArray(v, a) { + var l = a.length; + for (var i = 0; i < l; i++) { + if (a[i][0] == v) { + return true; + } + } + return false; + } + + function setHeadersCss(table, $headers, list, css) { + // remove all header information + $headers.removeClass(css[0]).removeClass(css[1]); + + var h = []; + $headers.each(function (offset) { + if (!this.sortDisabled) { + h[this.column] = $(this); + } + }); + + var l = list.length; + for (var i = 0; i < l; i++) { + h[list[i][0]].addClass(css[list[i][1]]); + } + } + + function fixColumnWidth(table, $headers) { + var c = table.config; + if (c.widthFixed) { + var colgroup = $('<colgroup>'); + $("tr:first td", table.tBodies[0]).each(function () { + colgroup.append($('<col>').css('width', $(this).width())); + }); + $(table).prepend(colgroup); + }; + } + + function updateHeaderSortCount(table, sortList) { + var c = table.config, + l = sortList.length; + for (var i = 0; i < l; i++) { + var s = sortList[i], + o = c.headerList[s[0]]; + o.count = s[1]; + o.count++; + } + } + + /* sorting methods */ + + function multisort(table, sortList, cache) { + + if (table.config.debug) { + var sortTime = new Date(); + } + + var dynamicExp = "var sortWrapper = function(a,b) {", + l = sortList.length; + + // TODO: inline functions. + for (var i = 0; i < l; i++) { + + var c = sortList[i][0]; + var order = sortList[i][1]; + // var s = (getCachedSortType(table.config.parsers,c) == "text") ? + // ((order == 0) ? "sortText" : "sortTextDesc") : ((order == 0) ? + // "sortNumeric" : "sortNumericDesc"); + // var s = (table.config.parsers[c].type == "text") ? ((order == 0) + // ? makeSortText(c) : makeSortTextDesc(c)) : ((order == 0) ? + // makeSortNumeric(c) : makeSortNumericDesc(c)); + var s = (table.config.parsers[c].type == "text") ? ((order == 0) ? makeSortFunction("text", "asc", c) : makeSortFunction("text", "desc", c)) : ((order == 0) ? makeSortFunction("numeric", "asc", c) : makeSortFunction("numeric", "desc", c)); + var e = "e" + i; + + dynamicExp += "var " + e + " = " + s; // + "(a[" + c + "],b[" + c + // + "]); "; + dynamicExp += "if(" + e + ") { return " + e + "; } "; + dynamicExp += "else { "; + + } + + // if value is the same keep orignal order + var orgOrderCol = cache.normalized[0].length - 1; + dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];"; + + for (var i = 0; i < l; i++) { + dynamicExp += "}; "; + } + + dynamicExp += "return 0; "; + dynamicExp += "}; "; + + if (table.config.debug) { + benchmark("Evaling expression:" + dynamicExp, new Date()); + } + + eval(dynamicExp); + + cache.normalized.sort(sortWrapper); + + if (table.config.debug) { + benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time:", sortTime); + } + + return cache; + }; + + function makeSortFunction(type, direction, index) { + var a = "a[" + index + "]", + b = "b[" + index + "]"; + if (type == 'text' && direction == 'asc') { + return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + a + " < " + b + ") ? -1 : 1 )));"; + } else if (type == 'text' && direction == 'desc') { + return "(" + a + " == " + b + " ? 0 : (" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : (" + b + " < " + a + ") ? -1 : 1 )));"; + } else if (type == 'numeric' && direction == 'asc') { + return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + a + " - " + b + "));"; + } else if (type == 'numeric' && direction == 'desc') { + return "(" + a + " === null && " + b + " === null) ? 0 :(" + a + " === null ? Number.POSITIVE_INFINITY : (" + b + " === null ? Number.NEGATIVE_INFINITY : " + b + " - " + a + "));"; + } + }; + + function makeSortText(i) { + return "((a[" + i + "] < b[" + i + "]) ? -1 : ((a[" + i + "] > b[" + i + "]) ? 1 : 0));"; + }; + + function makeSortTextDesc(i) { + return "((b[" + i + "] < a[" + i + "]) ? -1 : ((b[" + i + "] > a[" + i + "]) ? 1 : 0));"; + }; + + function makeSortNumeric(i) { + return "a[" + i + "]-b[" + i + "];"; + }; + + function makeSortNumericDesc(i) { + return "b[" + i + "]-a[" + i + "];"; + }; + + function sortText(a, b) { + if (table.config.sortLocaleCompare) return a.localeCompare(b); + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); + }; + + function sortTextDesc(a, b) { + if (table.config.sortLocaleCompare) return b.localeCompare(a); + return ((b < a) ? -1 : ((b > a) ? 1 : 0)); + }; + + function sortNumeric(a, b) { + return a - b; + }; + + function sortNumericDesc(a, b) { + return b - a; + }; + + function getCachedSortType(parsers, i) { + return parsers[i].type; + }; /* public methods */ + this.construct = function (settings) { + return this.each(function () { + // if no thead or tbody quit. + if (!this.tHead || !this.tBodies) return; + // declare + var $this, $document, $headers, cache, config, shiftDown = 0, + sortOrder; + // new blank config object + this.config = {}; + // merge and extend. + config = $.extend(this.config, $.tablesorter.defaults, settings); + // store common expression for speed + $this = $(this); + // save the settings where they read + $.data(this, "tablesorter", config); + // build headers + $headers = buildHeaders(this); + // try to auto detect column type, and store in tables config + this.config.parsers = buildParserCache(this, $headers); + // build the cache for the tbody cells + cache = buildCache(this); + // get the css class names, could be done else where. + var sortCSS = [config.cssDesc, config.cssAsc]; + // fixate columns if the users supplies the fixedWidth option + fixColumnWidth(this); + // apply event handling to headers + // this is to big, perhaps break it out? + $headers.click( + + function (e) { + var totalRows = ($this[0].tBodies[0] && $this[0].tBodies[0].rows.length) || 0; + if (!this.sortDisabled && totalRows > 0) { + // Only call sortStart if sorting is + // enabled. + $this.trigger("sortStart"); + // store exp, for speed + var $cell = $(this); + // get current column index + var i = this.column; + // get current column sort order + this.order = this.count++ % 2; + // always sort on the locked order. + if(this.lockedOrder) this.order = this.lockedOrder; + + // user only whants to sort on one + // column + if (!e[config.sortMultiSortKey]) { + // flush the sort list + config.sortList = []; + if (config.sortForce != null) { + var a = config.sortForce; + for (var j = 0; j < a.length; j++) { + if (a[j][0] != i) { + config.sortList.push(a[j]); + } + } + } + // add column to sort list + config.sortList.push([i, this.order]); + // multi column sorting + } else { + // the user has clicked on an all + // ready sortet column. + if (isValueInArray(i, config.sortList)) { + // revers the sorting direction + // for all tables. + for (var j = 0; j < config.sortList.length; j++) { + var s = config.sortList[j], + o = config.headerList[s[0]]; + if (s[0] == i) { + o.count = s[1]; + o.count++; + s[1] = o.count % 2; + } + } + } else { + // add column to sort list array + config.sortList.push([i, this.order]); + } + }; + setTimeout(function () { + // set css for headers + setHeadersCss($this[0], $headers, config.sortList, sortCSS); + appendToTable( + $this[0], multisort( + $this[0], config.sortList, cache) + ); + }, 1); + // stop normal event by returning false + return false; + } + // cancel selection + }).mousedown(function () { + if (config.cancelSelection) { + this.onselectstart = function () { + return false + }; + return false; + } + }); + // apply easy methods that trigger binded events + $this.bind("update", function () { + var me = this; + setTimeout(function () { + // rebuild parsers. + me.config.parsers = buildParserCache( + me, $headers); + // rebuild the cache map + cache = buildCache(me); + }, 1); + }).bind("updateCell", function (e, cell) { + var config = this.config; + // get position from the dom. + var pos = [(cell.parentNode.rowIndex - 1), cell.cellIndex]; + // update cache + cache.normalized[pos[0]][pos[1]] = config.parsers[pos[1]].format( + getElementText(config, cell), cell); + }).bind("sorton", function (e, list) { + $(this).trigger("sortStart"); + config.sortList = list; + // update and store the sortlist + var sortList = config.sortList; + // update header count index + updateHeaderSortCount(this, sortList); + // set css for headers + setHeadersCss(this, $headers, sortList, sortCSS); + // sort the table and append it to the dom + appendToTable(this, multisort(this, sortList, cache)); + }).bind("appendCache", function () { + appendToTable(this, cache); + }).bind("applyWidgetId", function (e, id) { + getWidgetById(id).format(this); + }).bind("applyWidgets", function () { + // apply widgets + applyWidget(this); + }); + if ($.metadata && ($(this).metadata() && $(this).metadata().sortlist)) { + config.sortList = $(this).metadata().sortlist; + } + // if user has supplied a sort list to constructor. + if (config.sortList.length > 0) { + $this.trigger("sorton", [config.sortList]); + } else { + // appendToTable used in sorton event already calls applyWidget + // apply widgets + applyWidget(this); + } + }); + }; + this.addParser = function (parser) { + var l = parsers.length, + a = true; + for (var i = 0; i < l; i++) { + if (parsers[i].id.toLowerCase() == parser.id.toLowerCase()) { + a = false; + } + } + if (a) { + parsers.push(parser); + }; + }; + this.addWidget = function (widget) { + widgets.push(widget); + }; + this.formatFloat = function (s) { + var i = parseFloat(s); + return (isNaN(i)) ? 0 : i; + }; + this.formatInt = function (s) { + var i = parseInt(s); + return (isNaN(i)) ? 0 : i; + }; + this.isDigit = function (s, config) { + // replace all an wanted chars and match. + return /^[-+]?\d*$/.test($.trim(s.replace(/[,.']/g, ''))); + }; + this.clearTableBody = function (table) { + if (window.navigator.userAgent.indexOf("MSIE ") > -1 || !!window.navigator.userAgent.match(/Trident.*rv\:11\./)) { + function empty() { + while (this.firstChild) + this.removeChild(this.firstChild); + } + empty.apply(table.tBodies[0]); + } else { + table.tBodies[0].innerHTML = ""; + } + }; + } + }); + + // extend plugin scope + $.fn.extend({ + tablesorter: $.tablesorter.construct + }); + + // make shortcut + var ts = $.tablesorter; + + // add default parsers + ts.addParser({ + id: "text", + is: function (s) { + return true; + }, format: function (s) { + return $.trim(s.toLocaleLowerCase()); + }, type: "text" + }); + + ts.addParser({ + id: "digit", + is: function (s, table) { + var c = table.config; + return $.tablesorter.isDigit(s, c); + }, format: function (s) { + return $.tablesorter.formatFloat(s); + }, type: "numeric" + }); + + ts.addParser({ + id: "currency", + is: function (s) { + return /^[拢$鈧�?.]/.test(s); + }, format: function (s) { + return $.tablesorter.formatFloat(s.replace(new RegExp(/[拢$鈧琞/g), "")); + }, type: "numeric" + }); + + ts.addParser({ + id: "ipAddress", + is: function (s) { + return /^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/.test(s); + }, format: function (s) { + var a = s.split("."), + r = "", + l = a.length; + for (var i = 0; i < l; i++) { + var item = a[i]; + if (item.length == 2) { + r += "0" + item; + } else { + r += item; + } + } + return $.tablesorter.formatFloat(r); + }, type: "numeric" + }); + + ts.addParser({ + id: "url", + is: function (s) { + return /^(https?|ftp|file):\/\/$/.test(s); + }, format: function (s) { + return jQuery.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//), '')); + }, type: "text" + }); + + ts.addParser({ + id: "isoDate", + is: function (s) { + return /^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(s); + }, format: function (s) { + return $.tablesorter.formatFloat((s != "") ? new Date(s.replace( + new RegExp(/-/g), "/")).getTime() : "0"); + }, type: "numeric" + }); + + ts.addParser({ + id: "percent", + is: function (s) { + return /\%$/.test($.trim(s)); + }, format: function (s) { + return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g), "")); + }, type: "numeric" + }); + + ts.addParser({ + id: "usLongDate", + is: function (s) { + return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/)); + }, format: function (s) { + return $.tablesorter.formatFloat(new Date(s).getTime()); + }, type: "numeric" + }); + + ts.addParser({ + id: "shortDate", + is: function (s) { + return /\d{1,2}[\/\-]\d{1,2}[\/\-]\d{2,4}/.test(s); + }, format: function (s, table) { + var c = table.config; + s = s.replace(/\-/g, "/"); + if (c.dateFormat == "us") { + // reformat the string in ISO format + s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$1/$2"); + } else if (c.dateFormat == "uk") { + // reformat the string in ISO format + s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{4})/, "$3/$2/$1"); + } else if (c.dateFormat == "dd/mm/yy" || c.dateFormat == "dd-mm-yy") { + s = s.replace(/(\d{1,2})[\/\-](\d{1,2})[\/\-](\d{2})/, "$1/$2/$3"); + } + return $.tablesorter.formatFloat(new Date(s).getTime()); + }, type: "numeric" + }); + ts.addParser({ + id: "time", + is: function (s) { + return /^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/.test(s); + }, format: function (s) { + return $.tablesorter.formatFloat(new Date("2000/01/01 " + s).getTime()); + }, type: "numeric" + }); + ts.addParser({ + id: "metadata", + is: function (s) { + return false; + }, format: function (s, table, cell) { + var c = table.config, + p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName; + return $(cell).metadata()[p]; + }, type: "numeric" + }); + // add default widgets + ts.addWidget({ + id: "zebra", + format: function (table) { + if (table.config.debug) { + var time = new Date(); + } + var $tr, row = -1, + odd; + // loop through the visible rows + $("tr:visible", table.tBodies[0]).each(function (i) { + $tr = $(this); + // style children rows the same way the parent + // row was styled + if (!$tr.hasClass(table.config.cssChildRow)) row++; + odd = (row % 2 == 0); + $tr.removeClass( + table.config.widgetZebra.css[odd ? 0 : 1]).addClass( + table.config.widgetZebra.css[odd ? 1 : 0]) + }); + if (table.config.debug) { + $.tablesorter.benchmark("Applying Zebra widget", time); + } + } + }); +})(jQuery); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/jquery/jquery.uitablefilter.js b/phpMyAdmin/js/vendor/jquery/jquery.uitablefilter.js new file mode 100755 index 0000000..700c0f2 --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.uitablefilter.js @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2008 Greg Weber greg at gregweber.info + * Dual licensed under the MIT and GPLv2 licenses just as jQuery is: + * http://jquery.org/license + * + * Multi-columns fork by natinusala + * + * documentation at http://gregweber.info/projects/uitablefilter + * https://github.com/natinusala/jquery-uitablefilter + * + * allows table rows to be filtered (made invisible) + * <code> + * t = $('table') + * $.uiTableFilter( t, phrase ) + * </code> + * arguments: + * jQuery object containing table rows + * phrase to search for + * optional arguments: + * array of columns to limit search too (the column title in the table header) + * ifHidden - callback to execute if one or more elements was hidden + * tdElem - specific element within <td> to be considered for searching or to limit search to, + * default:whole <td>. useful if <td> has more than one elements inside but want to + * limit search within only some of elements or only visible elements. eg tdElem can be "td span" + */ +(function($) { + $.uiTableFilter = function(jq, phrase, column, ifHidden, tdElem){ + if(!tdElem) tdElem = "td"; + var new_hidden = false; + if( this.last_phrase === phrase ) return false; + + var phrase_length = phrase.length; + var words = phrase.toLowerCase().split(" "); + + // these function pointers may change + var matches = function(elem) { elem.show() } + var noMatch = function(elem) { elem.hide(); new_hidden = true } + var getText = function(elem) { return elem.text() } + + if( column ) + { + if (!$.isArray(column)) + { + column = new Array(column); + } + + var index = new Array(); + + jq.find("thead > tr:last > th").each(function(i) + { + for (var j = 0; j < column.length; j++) + { + if ($.trim($(this).text()) == column[j]) + { + index[j] = i; + break; + } + } + + }); + + getText = function(elem) { + var selector = ""; + for (var i = 0; i < index.length; i++) + { + if (i != 0) {selector += ",";} + selector += tdElem + ":eq(" + index[i] + ")"; + } + return $(elem.find((selector))).text(); + } + } + + // if added one letter to last time, + // just check newest word and only need to hide + if( (words.size > 1) && (phrase.substr(0, phrase_length - 1) === + this.last_phrase) ) { + + if( phrase[-1] === " " ) + { this.last_phrase = phrase; return false; } + + var words = words[-1]; // just search for the newest word + + // only hide visible rows + matches = function(elem) {;} + var elems = jq.find("tbody:first > tr:visible") + } + else { + new_hidden = true; + var elems = jq.find("tbody:first > tr") + } + + elems.each(function(){ + var elem = $(this); + $.uiTableFilter.has_words( getText(elem), words, false ) ? + matches(elem) : noMatch(elem); + }); + + last_phrase = phrase; + if( ifHidden && new_hidden ) ifHidden(); + return jq; + }; + + // caching for speedup + $.uiTableFilter.last_phrase = "" + + // not jQuery dependent + // "" [""] -> Boolean + // "" [""] Boolean -> Boolean + $.uiTableFilter.has_words = function( str, words, caseSensitive ) + { + var text = caseSensitive ? str : str.toLowerCase(); + for (var i=0; i < words.length; i++) { + if (text.indexOf(words[i]) === -1) return false; + } + return true; + } +}) (jQuery); diff --git a/phpMyAdmin/js/vendor/jquery/jquery.validate.js b/phpMyAdmin/js/vendor/jquery/jquery.validate.js new file mode 100755 index 0000000..70297bd --- /dev/null +++ b/phpMyAdmin/js/vendor/jquery/jquery.validate.js @@ -0,0 +1,1650 @@ +/*! + * jQuery Validation Plugin v1.19.1 + * + * https://jqueryvalidation.org/ + * + * Copyright (c) 2019 J枚rn Zaefferer + * Released under the MIT license + */ +(function( factory ) { + if ( typeof define === "function" && define.amd ) { + define( ["jquery"], factory ); + } else if (typeof module === "object" && module.exports) { + module.exports = factory( require( "jquery" ) ); + } else { + factory( jQuery ); + } +}(function( $ ) { + +$.extend( $.fn, { + + // https://jqueryvalidation.org/validate/ + validate: function( options ) { + + // If nothing is selected, return nothing; can't chain anyway + if ( !this.length ) { + if ( options && options.debug && window.console ) { + console.warn( "Nothing selected, can't validate, returning nothing." ); + } + return; + } + + // Check if a validator for this form was already created + var validator = $.data( this[ 0 ], "validator" ); + if ( validator ) { + return validator; + } + + // Add novalidate tag if HTML5. + this.attr( "novalidate", "novalidate" ); + + validator = new $.validator( options, this[ 0 ] ); + $.data( this[ 0 ], "validator", validator ); + + if ( validator.settings.onsubmit ) { + + this.on( "click.validate", ":submit", function( event ) { + + // Track the used submit button to properly handle scripted + // submits later. + validator.submitButton = event.currentTarget; + + // Allow suppressing validation by adding a cancel class to the submit button + if ( $( this ).hasClass( "cancel" ) ) { + validator.cancelSubmit = true; + } + + // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button + if ( $( this ).attr( "formnovalidate" ) !== undefined ) { + validator.cancelSubmit = true; + } + } ); + + // Validate the form on submit + this.on( "submit.validate", function( event ) { + if ( validator.settings.debug ) { + + // Prevent form submit to be able to see console output + event.preventDefault(); + } + + function handle() { + var hidden, result; + + // Insert a hidden input as a replacement for the missing submit button + // The hidden input is inserted in two cases: + // - A user defined a `submitHandler` + // - There was a pending request due to `remote` method and `stopRequest()` + // was called to submit the form in case it's valid + if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) { + hidden = $( "<input type='hidden'/>" ) + .attr( "name", validator.submitButton.name ) + .val( $( validator.submitButton ).val() ) + .appendTo( validator.currentForm ); + } + + if ( validator.settings.submitHandler && !validator.settings.debug ) { + result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); + if ( hidden ) { + + // And clean up afterwards; thanks to no-block-scope, hidden can be referenced + hidden.remove(); + } + if ( result !== undefined ) { + return result; + } + return false; + } + return true; + } + + // Prevent submit for invalid forms or custom submit handlers + if ( validator.cancelSubmit ) { + validator.cancelSubmit = false; + return handle(); + } + if ( validator.form() ) { + if ( validator.pendingRequest ) { + validator.formSubmitted = true; + return false; + } + return handle(); + } else { + validator.focusInvalid(); + return false; + } + } ); + } + + return validator; + }, + + // https://jqueryvalidation.org/valid/ + valid: function() { + var valid, validator, errorList; + + if ( $( this[ 0 ] ).is( "form" ) ) { + valid = this.validate().form(); + } else { + errorList = []; + valid = true; + validator = $( this[ 0 ].form ).validate(); + this.each( function() { + valid = validator.element( this ) && valid; + if ( !valid ) { + errorList = errorList.concat( validator.errorList ); + } + } ); + validator.errorList = errorList; + } + return valid; + }, + + // https://jqueryvalidation.org/rules/ + rules: function( command, argument ) { + var element = this[ 0 ], + isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false", + settings, staticRules, existingRules, data, param, filtered; + + // If nothing is selected, return empty object; can't chain anyway + if ( element == null ) { + return; + } + + if ( !element.form && isContentEditable ) { + element.form = this.closest( "form" )[ 0 ]; + element.name = this.attr( "name" ); + } + + if ( element.form == null ) { + return; + } + + if ( command ) { + settings = $.data( element.form, "validator" ).settings; + staticRules = settings.rules; + existingRules = $.validator.staticRules( element ); + switch ( command ) { + case "add": + $.extend( existingRules, $.validator.normalizeRule( argument ) ); + + // Remove messages from rules, but allow them to be set separately + delete existingRules.messages; + staticRules[ element.name ] = existingRules; + if ( argument.messages ) { + settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); + } + break; + case "remove": + if ( !argument ) { + delete staticRules[ element.name ]; + return existingRules; + } + filtered = {}; + $.each( argument.split( /\s/ ), function( index, method ) { + filtered[ method ] = existingRules[ method ]; + delete existingRules[ method ]; + } ); + return filtered; + } + } + + data = $.validator.normalizeRules( + $.extend( + {}, + $.validator.classRules( element ), + $.validator.attributeRules( element ), + $.validator.dataRules( element ), + $.validator.staticRules( element ) + ), element ); + + // Make sure required is at front + if ( data.required ) { + param = data.required; + delete data.required; + data = $.extend( { required: param }, data ); + } + + // Make sure remote is at back + if ( data.remote ) { + param = data.remote; + delete data.remote; + data = $.extend( data, { remote: param } ); + } + + return data; + } +} ); + +// Custom selectors +$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support + + // https://jqueryvalidation.org/blank-selector/ + blank: function( a ) { + return !$.trim( "" + $( a ).val() ); + }, + + // https://jqueryvalidation.org/filled-selector/ + filled: function( a ) { + var val = $( a ).val(); + return val !== null && !!$.trim( "" + val ); + }, + + // https://jqueryvalidation.org/unchecked-selector/ + unchecked: function( a ) { + return !$( a ).prop( "checked" ); + } +} ); + +// Constructor for validator +$.validator = function( options, form ) { + this.settings = $.extend( true, {}, $.validator.defaults, options ); + this.currentForm = form; + this.init(); +}; + +// https://jqueryvalidation.org/jQuery.validator.format/ +$.validator.format = function( source, params ) { + if ( arguments.length === 1 ) { + return function() { + var args = $.makeArray( arguments ); + args.unshift( source ); + return $.validator.format.apply( this, args ); + }; + } + if ( params === undefined ) { + return source; + } + if ( arguments.length > 2 && params.constructor !== Array ) { + params = $.makeArray( arguments ).slice( 1 ); + } + if ( params.constructor !== Array ) { + params = [ params ]; + } + $.each( params, function( i, n ) { + source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { + return n; + } ); + } ); + return source; +}; + +$.extend( $.validator, { + + defaults: { + messages: {}, + groups: {}, + rules: {}, + errorClass: "error", + pendingClass: "pending", + validClass: "valid", + errorElement: "label", + focusCleanup: false, + focusInvalid: true, + errorContainer: $( [] ), + errorLabelContainer: $( [] ), + onsubmit: true, + ignore: ":hidden", + ignoreTitle: false, + onfocusin: function( element ) { + this.lastActive = element; + + // Hide error label and remove error class on focus if enabled + if ( this.settings.focusCleanup ) { + if ( this.settings.unhighlight ) { + this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); + } + this.hideThese( this.errorsFor( element ) ); + } + }, + onfocusout: function( element ) { + if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { + this.element( element ); + } + }, + onkeyup: function( element, event ) { + + // Avoid revalidate the field when pressing one of the following keys + // Shift => 16 + // Ctrl => 17 + // Alt => 18 + // Caps lock => 20 + // End => 35 + // Home => 36 + // Left arrow => 37 + // Up arrow => 38 + // Right arrow => 39 + // Down arrow => 40 + // Insert => 45 + // Num lock => 144 + // AltGr key => 225 + var excludedKeys = [ + 16, 17, 18, 20, 35, 36, 37, + 38, 39, 40, 45, 144, 225 + ]; + + if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { + return; + } else if ( element.name in this.submitted || element.name in this.invalid ) { + this.element( element ); + } + }, + onclick: function( element ) { + + // Click on selects, radiobuttons and checkboxes + if ( element.name in this.submitted ) { + this.element( element ); + + // Or option elements, check parent select in that case + } else if ( element.parentNode.name in this.submitted ) { + this.element( element.parentNode ); + } + }, + highlight: function( element, errorClass, validClass ) { + if ( element.type === "radio" ) { + this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); + } else { + $( element ).addClass( errorClass ).removeClass( validClass ); + } + }, + unhighlight: function( element, errorClass, validClass ) { + if ( element.type === "radio" ) { + this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); + } else { + $( element ).removeClass( errorClass ).addClass( validClass ); + } + } + }, + + // https://jqueryvalidation.org/jQuery.validator.setDefaults/ + setDefaults: function( settings ) { + $.extend( $.validator.defaults, settings ); + }, + + messages: { + required: "This field is required.", + remote: "Please fix this field.", + email: "Please enter a valid email address.", + url: "Please enter a valid URL.", + date: "Please enter a valid date.", + dateISO: "Please enter a valid date (ISO).", + number: "Please enter a valid number.", + digits: "Please enter only digits.", + equalTo: "Please enter the same value again.", + maxlength: $.validator.format( "Please enter no more than {0} characters." ), + minlength: $.validator.format( "Please enter at least {0} characters." ), + rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), + range: $.validator.format( "Please enter a value between {0} and {1}." ), + max: $.validator.format( "Please enter a value less than or equal to {0}." ), + min: $.validator.format( "Please enter a value greater than or equal to {0}." ), + step: $.validator.format( "Please enter a multiple of {0}." ) + }, + + autoCreateRanges: false, + + prototype: { + + init: function() { + this.labelContainer = $( this.settings.errorLabelContainer ); + this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); + this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); + this.submitted = {}; + this.valueCache = {}; + this.pendingRequest = 0; + this.pending = {}; + this.invalid = {}; + this.reset(); + + var currentForm = this.currentForm, + groups = ( this.groups = {} ), + rules; + $.each( this.settings.groups, function( key, value ) { + if ( typeof value === "string" ) { + value = value.split( /\s/ ); + } + $.each( value, function( index, name ) { + groups[ name ] = key; + } ); + } ); + rules = this.settings.rules; + $.each( rules, function( key, value ) { + rules[ key ] = $.validator.normalizeRule( value ); + } ); + + function delegate( event ) { + var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; + + // Set form expando on contenteditable + if ( !this.form && isContentEditable ) { + this.form = $( this ).closest( "form" )[ 0 ]; + this.name = $( this ).attr( "name" ); + } + + // Ignore the element if it belongs to another form. This will happen mainly + // when setting the `form` attribute of an input to the id of another form. + if ( currentForm !== this.form ) { + return; + } + + var validator = $.data( this.form, "validator" ), + eventType = "on" + event.type.replace( /^validate/, "" ), + settings = validator.settings; + if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { + settings[ eventType ].call( validator, this, event ); + } + } + + $( this.currentForm ) + .on( "focusin.validate focusout.validate keyup.validate", + ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + + "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + + "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + + "[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate ) + + // Support: Chrome, oldIE + // "select" is provided as event.target when clicking a option + .on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate ); + + if ( this.settings.invalidHandler ) { + $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); + } + }, + + // https://jqueryvalidation.org/Validator.form/ + form: function() { + this.checkForm(); + $.extend( this.submitted, this.errorMap ); + this.invalid = $.extend( {}, this.errorMap ); + if ( !this.valid() ) { + $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); + } + this.showErrors(); + return this.valid(); + }, + + checkForm: function() { + this.prepareForm(); + for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { + this.check( elements[ i ] ); + } + return this.valid(); + }, + + // https://jqueryvalidation.org/Validator.element/ + element: function( element ) { + var cleanElement = this.clean( element ), + checkElement = this.validationTargetFor( cleanElement ), + v = this, + result = true, + rs, group; + + if ( checkElement === undefined ) { + delete this.invalid[ cleanElement.name ]; + } else { + this.prepareElement( checkElement ); + this.currentElements = $( checkElement ); + + // If this element is grouped, then validate all group elements already + // containing a value + group = this.groups[ checkElement.name ]; + if ( group ) { + $.each( this.groups, function( name, testgroup ) { + if ( testgroup === group && name !== checkElement.name ) { + cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) ); + if ( cleanElement && cleanElement.name in v.invalid ) { + v.currentElements.push( cleanElement ); + result = v.check( cleanElement ) && result; + } + } + } ); + } + + rs = this.check( checkElement ) !== false; + result = result && rs; + if ( rs ) { + this.invalid[ checkElement.name ] = false; + } else { + this.invalid[ checkElement.name ] = true; + } + + if ( !this.numberOfInvalids() ) { + + // Hide error containers on last error + this.toHide = this.toHide.add( this.containers ); + } + this.showErrors(); + + // Add aria-invalid status for screen readers + $( element ).attr( "aria-invalid", !rs ); + } + + return result; + }, + + // https://jqueryvalidation.org/Validator.showErrors/ + showErrors: function( errors ) { + if ( errors ) { + var validator = this; + + // Add items to error list and map + $.extend( this.errorMap, errors ); + this.errorList = $.map( this.errorMap, function( message, name ) { + return { + message: message, + element: validator.findByName( name )[ 0 ] + }; + } ); + + // Remove items from success list + this.successList = $.grep( this.successList, function( element ) { + return !( element.name in errors ); + } ); + } + if ( this.settings.showErrors ) { + this.settings.showErrors.call( this, this.errorMap, this.errorList ); + } else { + this.defaultShowErrors(); + } + }, + + // https://jqueryvalidation.org/Validator.resetForm/ + resetForm: function() { + if ( $.fn.resetForm ) { + $( this.currentForm ).resetForm(); + } + this.invalid = {}; + this.submitted = {}; + this.prepareForm(); + this.hideErrors(); + var elements = this.elements() + .removeData( "previousValue" ) + .removeAttr( "aria-invalid" ); + + this.resetElements( elements ); + }, + + resetElements: function( elements ) { + var i; + + if ( this.settings.unhighlight ) { + for ( i = 0; elements[ i ]; i++ ) { + this.settings.unhighlight.call( this, elements[ i ], + this.settings.errorClass, "" ); + this.findByName( elements[ i ].name ).removeClass( this.settings.validClass ); + } + } else { + elements + .removeClass( this.settings.errorClass ) + .removeClass( this.settings.validClass ); + } + }, + + numberOfInvalids: function() { + return this.objectLength( this.invalid ); + }, + + objectLength: function( obj ) { + /* jshint unused: false */ + var count = 0, + i; + for ( i in obj ) { + + // This check allows counting elements with empty error + // message as invalid elements + if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) { + count++; + } + } + return count; + }, + + hideErrors: function() { + this.hideThese( this.toHide ); + }, + + hideThese: function( errors ) { + errors.not( this.containers ).text( "" ); + this.addWrapper( errors ).hide(); + }, + + valid: function() { + return this.size() === 0; + }, + + size: function() { + return this.errorList.length; + }, + + focusInvalid: function() { + if ( this.settings.focusInvalid ) { + try { + $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] ) + .filter( ":visible" ) + .trigger( "focus" ) + + // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find + .trigger( "focusin" ); + } catch ( e ) { + + // Ignore IE throwing errors when focusing hidden elements + } + } + }, + + findLastActive: function() { + var lastActive = this.lastActive; + return lastActive && $.grep( this.errorList, function( n ) { + return n.element.name === lastActive.name; + } ).length === 1 && lastActive; + }, + + elements: function() { + var validator = this, + rulesCache = {}; + + // Select all valid inputs inside the form (no submit or reset buttons) + return $( this.currentForm ) + .find( "input, select, textarea, [contenteditable]" ) + .not( ":submit, :reset, :image, :disabled" ) + .not( this.settings.ignore ) + .filter( function() { + var name = this.name || $( this ).attr( "name" ); // For contenteditable + var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; + + if ( !name && validator.settings.debug && window.console ) { + console.error( "%o has no name assigned", this ); + } + + // Set form expando on contenteditable + if ( isContentEditable ) { + this.form = $( this ).closest( "form" )[ 0 ]; + this.name = name; + } + + // Ignore elements that belong to other/nested forms + if ( this.form !== validator.currentForm ) { + return false; + } + + // Select only the first element for each name, and only those with rules specified + if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { + return false; + } + + rulesCache[ name ] = true; + return true; + } ); + }, + + clean: function( selector ) { + return $( selector )[ 0 ]; + }, + + errors: function() { + var errorClass = this.settings.errorClass.split( " " ).join( "." ); + return $( this.settings.errorElement + "." + errorClass, this.errorContext ); + }, + + resetInternals: function() { + this.successList = []; + this.errorList = []; + this.errorMap = {}; + this.toShow = $( [] ); + this.toHide = $( [] ); + }, + + reset: function() { + this.resetInternals(); + this.currentElements = $( [] ); + }, + + prepareForm: function() { + this.reset(); + this.toHide = this.errors().add( this.containers ); + }, + + prepareElement: function( element ) { + this.reset(); + this.toHide = this.errorsFor( element ); + }, + + elementValue: function( element ) { + var $element = $( element ), + type = element.type, + isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false", + val, idx; + + if ( type === "radio" || type === "checkbox" ) { + return this.findByName( element.name ).filter( ":checked" ).val(); + } else if ( type === "number" && typeof element.validity !== "undefined" ) { + return element.validity.badInput ? "NaN" : $element.val(); + } + + if ( isContentEditable ) { + val = $element.text(); + } else { + val = $element.val(); + } + + if ( type === "file" ) { + + // Modern browser (chrome & safari) + if ( val.substr( 0, 12 ) === "C:\\fakepath\\" ) { + return val.substr( 12 ); + } + + // Legacy browsers + // Unix-based path + idx = val.lastIndexOf( "/" ); + if ( idx >= 0 ) { + return val.substr( idx + 1 ); + } + + // Windows-based path + idx = val.lastIndexOf( "\\" ); + if ( idx >= 0 ) { + return val.substr( idx + 1 ); + } + + // Just the file name + return val; + } + + if ( typeof val === "string" ) { + return val.replace( /\r/g, "" ); + } + return val; + }, + + check: function( element ) { + element = this.validationTargetFor( this.clean( element ) ); + + var rules = $( element ).rules(), + rulesCount = $.map( rules, function( n, i ) { + return i; + } ).length, + dependencyMismatch = false, + val = this.elementValue( element ), + result, method, rule, normalizer; + + // Prioritize the local normalizer defined for this element over the global one + // if the former exists, otherwise user the global one in case it exists. + if ( typeof rules.normalizer === "function" ) { + normalizer = rules.normalizer; + } else if ( typeof this.settings.normalizer === "function" ) { + normalizer = this.settings.normalizer; + } + + // If normalizer is defined, then call it to retreive the changed value instead + // of using the real one. + // Note that `this` in the normalizer is `element`. + if ( normalizer ) { + val = normalizer.call( element, val ); + + // Delete the normalizer from rules to avoid treating it as a pre-defined method. + delete rules.normalizer; + } + + for ( method in rules ) { + rule = { method: method, parameters: rules[ method ] }; + try { + result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); + + // If a method indicates that the field is optional and therefore valid, + // don't mark it as valid when there are no other rules + if ( result === "dependency-mismatch" && rulesCount === 1 ) { + dependencyMismatch = true; + continue; + } + dependencyMismatch = false; + + if ( result === "pending" ) { + this.toHide = this.toHide.not( this.errorsFor( element ) ); + return; + } + + if ( !result ) { + this.formatAndAdd( element, rule ); + return false; + } + } catch ( e ) { + if ( this.settings.debug && window.console ) { + console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); + } + if ( e instanceof TypeError ) { + e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; + } + + throw e; + } + } + if ( dependencyMismatch ) { + return; + } + if ( this.objectLength( rules ) ) { + this.successList.push( element ); + } + return true; + }, + + // Return the custom message for the given element and validation method + // specified in the element's HTML5 data attribute + // return the generic message if present and no method specific message is present + customDataMessage: function( element, method ) { + return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + + method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); + }, + + // Return the custom message for the given element name and validation method + customMessage: function( name, method ) { + var m = this.settings.messages[ name ]; + return m && ( m.constructor === String ? m : m[ method ] ); + }, + + // Return the first defined argument, allowing empty strings + findDefined: function() { + for ( var i = 0; i < arguments.length; i++ ) { + if ( arguments[ i ] !== undefined ) { + return arguments[ i ]; + } + } + return undefined; + }, + + // The second parameter 'rule' used to be a string, and extended to an object literal + // of the following form: + // rule = { + // method: "method name", + // parameters: "the given method parameters" + // } + // + // The old behavior still supported, kept to maintain backward compatibility with + // old code, and will be removed in the next major release. + defaultMessage: function( element, rule ) { + if ( typeof rule === "string" ) { + rule = { method: rule }; + } + + var message = this.findDefined( + this.customMessage( element.name, rule.method ), + this.customDataMessage( element, rule.method ), + + // 'title' is never undefined, so handle empty string as undefined + !this.settings.ignoreTitle && element.title || undefined, + $.validator.messages[ rule.method ], + "<strong>Warning: No message defined for " + element.name + "</strong>" + ), + theregex = /\$?\{(\d+)\}/g; + if ( typeof message === "function" ) { + message = message.call( this, rule.parameters, element ); + } else if ( theregex.test( message ) ) { + message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); + } + + return message; + }, + + formatAndAdd: function( element, rule ) { + var message = this.defaultMessage( element, rule ); + + this.errorList.push( { + message: message, + element: element, + method: rule.method + } ); + + this.errorMap[ element.name ] = message; + this.submitted[ element.name ] = message; + }, + + addWrapper: function( toToggle ) { + if ( this.settings.wrapper ) { + toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); + } + return toToggle; + }, + + defaultShowErrors: function() { + var i, elements, error; + for ( i = 0; this.errorList[ i ]; i++ ) { + error = this.errorList[ i ]; + if ( this.settings.highlight ) { + this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); + } + this.showLabel( error.element, error.message ); + } + if ( this.errorList.length ) { + this.toShow = this.toShow.add( this.containers ); + } + if ( this.settings.success ) { + for ( i = 0; this.successList[ i ]; i++ ) { + this.showLabel( this.successList[ i ] ); + } + } + if ( this.settings.unhighlight ) { + for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { + this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); + } + } + this.toHide = this.toHide.not( this.toShow ); + this.hideErrors(); + this.addWrapper( this.toShow ).show(); + }, + + validElements: function() { + return this.currentElements.not( this.invalidElements() ); + }, + + invalidElements: function() { + return $( this.errorList ).map( function() { + return this.element; + } ); + }, + + showLabel: function( element, message ) { + var place, group, errorID, v, + error = this.errorsFor( element ), + elementID = this.idOrName( element ), + describedBy = $( element ).attr( "aria-describedby" ); + + if ( error.length ) { + + // Refresh error/success class + error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); + + // Replace message on existing label + error.html( message ); + } else { + + // Create error element + error = $( "<" + this.settings.errorElement + ">" ) + .attr( "id", elementID + "-error" ) + .addClass( this.settings.errorClass ) + .html( message || "" ); + + // Maintain reference to the element to be placed into the DOM + place = error; + if ( this.settings.wrapper ) { + + // Make sure the element is visible, even in IE + // actually showing the wrapped element is handled elsewhere + place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); + } + if ( this.labelContainer.length ) { + this.labelContainer.append( place ); + } else if ( this.settings.errorPlacement ) { + this.settings.errorPlacement.call( this, place, $( element ) ); + } else { + place.insertAfter( element ); + } + + // Link error back to the element + if ( error.is( "label" ) ) { + + // If the error is a label, then associate using 'for' + error.attr( "for", elementID ); + + // If the element is not a child of an associated label, then it's necessary + // to explicitly apply aria-describedby + } else if ( error.parents( "label[for='" + this.escapeCssMeta( elementID ) + "']" ).length === 0 ) { + errorID = error.attr( "id" ); + + // Respect existing non-error aria-describedby + if ( !describedBy ) { + describedBy = errorID; + } else if ( !describedBy.match( new RegExp( "\\b" + this.escapeCssMeta( errorID ) + "\\b" ) ) ) { + + // Add to end of list if not already present + describedBy += " " + errorID; + } + $( element ).attr( "aria-describedby", describedBy ); + + // If this element is grouped, then assign to all elements in the same group + group = this.groups[ element.name ]; + if ( group ) { + v = this; + $.each( v.groups, function( name, testgroup ) { + if ( testgroup === group ) { + $( "[name='" + v.escapeCssMeta( name ) + "']", v.currentForm ) + .attr( "aria-describedby", error.attr( "id" ) ); + } + } ); + } + } + } + if ( !message && this.settings.success ) { + error.text( "" ); + if ( typeof this.settings.success === "string" ) { + error.addClass( this.settings.success ); + } else { + this.settings.success( error, element ); + } + } + this.toShow = this.toShow.add( error ); + }, + + errorsFor: function( element ) { + var name = this.escapeCssMeta( this.idOrName( element ) ), + describer = $( element ).attr( "aria-describedby" ), + selector = "label[for='" + name + "'], label[for='" + name + "'] *"; + + // 'aria-describedby' should directly reference the error element + if ( describer ) { + selector = selector + ", #" + this.escapeCssMeta( describer ) + .replace( /\s+/g, ", #" ); + } + + return this + .errors() + .filter( selector ); + }, + + // See https://api.jquery.com/category/selectors/, for CSS + // meta-characters that should be escaped in order to be used with JQuery + // as a literal part of a name/id or any selector. + escapeCssMeta: function( string ) { + return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" ); + }, + + idOrName: function( element ) { + return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name ); + }, + + validationTargetFor: function( element ) { + + // If radio/checkbox, validate first element in group instead + if ( this.checkable( element ) ) { + element = this.findByName( element.name ); + } + + // Always apply ignore filter + return $( element ).not( this.settings.ignore )[ 0 ]; + }, + + checkable: function( element ) { + return ( /radio|checkbox/i ).test( element.type ); + }, + + findByName: function( name ) { + return $( this.currentForm ).find( "[name='" + this.escapeCssMeta( name ) + "']" ); + }, + + getLength: function( value, element ) { + switch ( element.nodeName.toLowerCase() ) { + case "select": + return $( "option:selected", element ).length; + case "input": + if ( this.checkable( element ) ) { + return this.findByName( element.name ).filter( ":checked" ).length; + } + } + return value.length; + }, + + depend: function( param, element ) { + return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true; + }, + + dependTypes: { + "boolean": function( param ) { + return param; + }, + "string": function( param, element ) { + return !!$( param, element.form ).length; + }, + "function": function( param, element ) { + return param( element ); + } + }, + + optional: function( element ) { + var val = this.elementValue( element ); + return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; + }, + + startRequest: function( element ) { + if ( !this.pending[ element.name ] ) { + this.pendingRequest++; + $( element ).addClass( this.settings.pendingClass ); + this.pending[ element.name ] = true; + } + }, + + stopRequest: function( element, valid ) { + this.pendingRequest--; + + // Sometimes synchronization fails, make sure pendingRequest is never < 0 + if ( this.pendingRequest < 0 ) { + this.pendingRequest = 0; + } + delete this.pending[ element.name ]; + $( element ).removeClass( this.settings.pendingClass ); + if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { + $( this.currentForm ).submit(); + + // Remove the hidden input that was used as a replacement for the + // missing submit button. The hidden input is added by `handle()` + // to ensure that the value of the used submit button is passed on + // for scripted submits triggered by this method + if ( this.submitButton ) { + $( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove(); + } + + this.formSubmitted = false; + } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) { + $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); + this.formSubmitted = false; + } + }, + + previousValue: function( element, method ) { + method = typeof method === "string" && method || "remote"; + + return $.data( element, "previousValue" ) || $.data( element, "previousValue", { + old: null, + valid: true, + message: this.defaultMessage( element, { method: method } ) + } ); + }, + + // Cleans up all forms and elements, removes validator-specific events + destroy: function() { + this.resetForm(); + + $( this.currentForm ) + .off( ".validate" ) + .removeData( "validator" ) + .find( ".validate-equalTo-blur" ) + .off( ".validate-equalTo" ) + .removeClass( "validate-equalTo-blur" ) + .find( ".validate-lessThan-blur" ) + .off( ".validate-lessThan" ) + .removeClass( "validate-lessThan-blur" ) + .find( ".validate-lessThanEqual-blur" ) + .off( ".validate-lessThanEqual" ) + .removeClass( "validate-lessThanEqual-blur" ) + .find( ".validate-greaterThanEqual-blur" ) + .off( ".validate-greaterThanEqual" ) + .removeClass( "validate-greaterThanEqual-blur" ) + .find( ".validate-greaterThan-blur" ) + .off( ".validate-greaterThan" ) + .removeClass( "validate-greaterThan-blur" ); + } + + }, + + classRuleSettings: { + required: { required: true }, + email: { email: true }, + url: { url: true }, + date: { date: true }, + dateISO: { dateISO: true }, + number: { number: true }, + digits: { digits: true }, + creditcard: { creditcard: true } + }, + + addClassRules: function( className, rules ) { + if ( className.constructor === String ) { + this.classRuleSettings[ className ] = rules; + } else { + $.extend( this.classRuleSettings, className ); + } + }, + + classRules: function( element ) { + var rules = {}, + classes = $( element ).attr( "class" ); + + if ( classes ) { + $.each( classes.split( " " ), function() { + if ( this in $.validator.classRuleSettings ) { + $.extend( rules, $.validator.classRuleSettings[ this ] ); + } + } ); + } + return rules; + }, + + normalizeAttributeRule: function( rules, type, method, value ) { + + // Convert the value to a number for number inputs, and for text for backwards compability + // allows type="date" and others to be compared as strings + if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { + value = Number( value ); + + // Support Opera Mini, which returns NaN for undefined minlength + if ( isNaN( value ) ) { + value = undefined; + } + } + + if ( value || value === 0 ) { + rules[ method ] = value; + } else if ( type === method && type !== "range" ) { + + // Exception: the jquery validate 'range' method + // does not test for the html5 'range' type + rules[ method ] = true; + } + }, + + attributeRules: function( element ) { + var rules = {}, + $element = $( element ), + type = element.getAttribute( "type" ), + method, value; + + for ( method in $.validator.methods ) { + + // Support for <input required> in both html5 and older browsers + if ( method === "required" ) { + value = element.getAttribute( method ); + + // Some browsers return an empty string for the required attribute + // and non-HTML5 browsers might have required="" markup + if ( value === "" ) { + value = true; + } + + // Force non-HTML5 browsers to return bool + value = !!value; + } else { + value = $element.attr( method ); + } + + this.normalizeAttributeRule( rules, type, method, value ); + } + + // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs + if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { + delete rules.maxlength; + } + + return rules; + }, + + dataRules: function( element ) { + var rules = {}, + $element = $( element ), + type = element.getAttribute( "type" ), + method, value; + + for ( method in $.validator.methods ) { + value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); + + // Cast empty attributes like `data-rule-required` to `true` + if ( value === "" ) { + value = true; + } + + this.normalizeAttributeRule( rules, type, method, value ); + } + return rules; + }, + + staticRules: function( element ) { + var rules = {}, + validator = $.data( element.form, "validator" ); + + if ( validator.settings.rules ) { + rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; + } + return rules; + }, + + normalizeRules: function( rules, element ) { + + // Handle dependency check + $.each( rules, function( prop, val ) { + + // Ignore rule when param is explicitly false, eg. required:false + if ( val === false ) { + delete rules[ prop ]; + return; + } + if ( val.param || val.depends ) { + var keepRule = true; + switch ( typeof val.depends ) { + case "string": + keepRule = !!$( val.depends, element.form ).length; + break; + case "function": + keepRule = val.depends.call( element, element ); + break; + } + if ( keepRule ) { + rules[ prop ] = val.param !== undefined ? val.param : true; + } else { + $.data( element.form, "validator" ).resetElements( $( element ) ); + delete rules[ prop ]; + } + } + } ); + + // Evaluate parameters + $.each( rules, function( rule, parameter ) { + rules[ rule ] = $.isFunction( parameter ) && rule !== "normalizer" ? parameter( element ) : parameter; + } ); + + // Clean number parameters + $.each( [ "minlength", "maxlength" ], function() { + if ( rules[ this ] ) { + rules[ this ] = Number( rules[ this ] ); + } + } ); + $.each( [ "rangelength", "range" ], function() { + var parts; + if ( rules[ this ] ) { + if ( $.isArray( rules[ this ] ) ) { + rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ]; + } else if ( typeof rules[ this ] === "string" ) { + parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ ); + rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ]; + } + } + } ); + + if ( $.validator.autoCreateRanges ) { + + // Auto-create ranges + if ( rules.min != null && rules.max != null ) { + rules.range = [ rules.min, rules.max ]; + delete rules.min; + delete rules.max; + } + if ( rules.minlength != null && rules.maxlength != null ) { + rules.rangelength = [ rules.minlength, rules.maxlength ]; + delete rules.minlength; + delete rules.maxlength; + } + } + + return rules; + }, + + // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} + normalizeRule: function( data ) { + if ( typeof data === "string" ) { + var transformed = {}; + $.each( data.split( /\s/ ), function() { + transformed[ this ] = true; + } ); + data = transformed; + } + return data; + }, + + // https://jqueryvalidation.org/jQuery.validator.addMethod/ + addMethod: function( name, method, message ) { + $.validator.methods[ name ] = method; + $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; + if ( method.length < 3 ) { + $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); + } + }, + + // https://jqueryvalidation.org/jQuery.validator.methods/ + methods: { + + // https://jqueryvalidation.org/required-method/ + required: function( value, element, param ) { + + // Check if dependency is met + if ( !this.depend( param, element ) ) { + return "dependency-mismatch"; + } + if ( element.nodeName.toLowerCase() === "select" ) { + + // Could be an array for select-multiple or a string, both are fine this way + var val = $( element ).val(); + return val && val.length > 0; + } + if ( this.checkable( element ) ) { + return this.getLength( value, element ) > 0; + } + return value !== undefined && value !== null && value.length > 0; + }, + + // https://jqueryvalidation.org/email-method/ + email: function( value, element ) { + + // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address + // Retrieved 2014-01-14 + // If you have a problem with this implementation, report a bug against the above spec + // Or use custom methods to implement your own email validation + return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); + }, + + // https://jqueryvalidation.org/url-method/ + url: function( value, element ) { + + // Copyright (c) 2010-2013 Diego Perini, MIT licensed + // https://gist.github.com/dperini/729294 + // see also https://mathiasbynens.be/demo/url-regex + // modified to allow protocol-relative URLs + return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); + }, + + // https://jqueryvalidation.org/date-method/ + date: ( function() { + var called = false; + + return function( value, element ) { + if ( !called ) { + called = true; + if ( this.settings.debug && window.console ) { + console.warn( + "The `date` method is deprecated and will be removed in version '2.0.0'.\n" + + "Please don't use it, since it relies on the Date constructor, which\n" + + "behaves very differently across browsers and locales. Use `dateISO`\n" + + "instead or one of the locale specific methods in `localizations/`\n" + + "and `additional-methods.js`." + ); + } + } + + return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); + }; + }() ), + + // https://jqueryvalidation.org/dateISO-method/ + dateISO: function( value, element ) { + return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); + }, + + // https://jqueryvalidation.org/number-method/ + number: function( value, element ) { + return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); + }, + + // https://jqueryvalidation.org/digits-method/ + digits: function( value, element ) { + return this.optional( element ) || /^\d+$/.test( value ); + }, + + // https://jqueryvalidation.org/minlength-method/ + minlength: function( value, element, param ) { + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + return this.optional( element ) || length >= param; + }, + + // https://jqueryvalidation.org/maxlength-method/ + maxlength: function( value, element, param ) { + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + return this.optional( element ) || length <= param; + }, + + // https://jqueryvalidation.org/rangelength-method/ + rangelength: function( value, element, param ) { + var length = $.isArray( value ) ? value.length : this.getLength( value, element ); + return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); + }, + + // https://jqueryvalidation.org/min-method/ + min: function( value, element, param ) { + return this.optional( element ) || value >= param; + }, + + // https://jqueryvalidation.org/max-method/ + max: function( value, element, param ) { + return this.optional( element ) || value <= param; + }, + + // https://jqueryvalidation.org/range-method/ + range: function( value, element, param ) { + return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); + }, + + // https://jqueryvalidation.org/step-method/ + step: function( value, element, param ) { + var type = $( element ).attr( "type" ), + errorMessage = "Step attribute on input type " + type + " is not supported.", + supportedTypes = [ "text", "number", "range" ], + re = new RegExp( "\\b" + type + "\\b" ), + notSupported = type && !re.test( supportedTypes.join() ), + decimalPlaces = function( num ) { + var match = ( "" + num ).match( /(?:\.(\d+))?$/ ); + if ( !match ) { + return 0; + } + + // Number of digits right of decimal point. + return match[ 1 ] ? match[ 1 ].length : 0; + }, + toInt = function( num ) { + return Math.round( num * Math.pow( 10, decimals ) ); + }, + valid = true, + decimals; + + // Works only for text, number and range input types + // TODO find a way to support input types date, datetime, datetime-local, month, time and week + if ( notSupported ) { + throw new Error( errorMessage ); + } + + decimals = decimalPlaces( param ); + + // Value can't have too many decimals + if ( decimalPlaces( value ) > decimals || toInt( value ) % toInt( param ) !== 0 ) { + valid = false; + } + + return this.optional( element ) || valid; + }, + + // https://jqueryvalidation.org/equalTo-method/ + equalTo: function( value, element, param ) { + + // Bind to the blur event of the target in order to revalidate whenever the target field is updated + var target = $( param ); + if ( this.settings.onfocusout && target.not( ".validate-equalTo-blur" ).length ) { + target.addClass( "validate-equalTo-blur" ).on( "blur.validate-equalTo", function() { + $( element ).valid(); + } ); + } + return value === target.val(); + }, + + // https://jqueryvalidation.org/remote-method/ + remote: function( value, element, param, method ) { + if ( this.optional( element ) ) { + return "dependency-mismatch"; + } + + method = typeof method === "string" && method || "remote"; + + var previous = this.previousValue( element, method ), + validator, data, optionDataString; + + if ( !this.settings.messages[ element.name ] ) { + this.settings.messages[ element.name ] = {}; + } + previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ]; + this.settings.messages[ element.name ][ method ] = previous.message; + + param = typeof param === "string" && { url: param } || param; + optionDataString = $.param( $.extend( { data: value }, param.data ) ); + if ( previous.old === optionDataString ) { + return previous.valid; + } + + previous.old = optionDataString; + validator = this; + this.startRequest( element ); + data = {}; + data[ element.name ] = value; + $.ajax( $.extend( true, { + mode: "abort", + port: "validate" + element.name, + dataType: "json", + data: data, + context: validator.currentForm, + success: function( response ) { + var valid = response === true || response === "true", + errors, message, submitted; + + validator.settings.messages[ element.name ][ method ] = previous.originalMessage; + if ( valid ) { + submitted = validator.formSubmitted; + validator.resetInternals(); + validator.toHide = validator.errorsFor( element ); + validator.formSubmitted = submitted; + validator.successList.push( element ); + validator.invalid[ element.name ] = false; + validator.showErrors(); + } else { + errors = {}; + message = response || validator.defaultMessage( element, { method: method, parameters: value } ); + errors[ element.name ] = previous.message = message; + validator.invalid[ element.name ] = true; + validator.showErrors( errors ); + } + previous.valid = valid; + validator.stopRequest( element, valid ); + } + }, param ) ); + return "pending"; + } + } + +} ); + +// Ajax mode: abort +// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); +// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() + +var pendingRequests = {}, + ajax; + +// Use a prefilter if available (1.5+) +if ( $.ajaxPrefilter ) { + $.ajaxPrefilter( function( settings, _, xhr ) { + var port = settings.port; + if ( settings.mode === "abort" ) { + if ( pendingRequests[ port ] ) { + pendingRequests[ port ].abort(); + } + pendingRequests[ port ] = xhr; + } + } ); +} else { + + // Proxy ajax + ajax = $.ajax; + $.ajax = function( settings ) { + var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, + port = ( "port" in settings ? settings : $.ajaxSettings ).port; + if ( mode === "abort" ) { + if ( pendingRequests[ port ] ) { + pendingRequests[ port ].abort(); + } + pendingRequests[ port ] = ajax.apply( this, arguments ); + return pendingRequests[ port ]; + } + return ajax.apply( this, arguments ); + }; +} +return $; +})); \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/js.cookie.js b/phpMyAdmin/js/vendor/js.cookie.js new file mode 100755 index 0000000..80a7551 --- /dev/null +++ b/phpMyAdmin/js/vendor/js.cookie.js @@ -0,0 +1,163 @@ +/*! + * JavaScript Cookie v2.2.1 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */ +;(function (factory) { + var registeredInModuleLoader; + if (typeof define === 'function' && define.amd) { + define(factory); + registeredInModuleLoader = true; + } + if (typeof exports === 'object') { + module.exports = factory(); + registeredInModuleLoader = true; + } + if (!registeredInModuleLoader) { + var OldCookies = window.Cookies; + var api = window.Cookies = factory(); + api.noConflict = function () { + window.Cookies = OldCookies; + return api; + }; + } +}(function () { + function extend () { + var i = 0; + var result = {}; + for (; i < arguments.length; i++) { + var attributes = arguments[ i ]; + for (var key in attributes) { + result[key] = attributes[key]; + } + } + return result; + } + + function decode (s) { + return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent); + } + + function init (converter) { + function api() {} + + function set (key, value, attributes) { + if (typeof document === 'undefined') { + return; + } + + attributes = extend({ + path: '/' + }, api.defaults, attributes); + + if (typeof attributes.expires === 'number') { + attributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5); + } + + // We're using "expires" because "max-age" is not supported by IE + attributes.expires = attributes.expires ? attributes.expires.toUTCString() : ''; + + try { + var result = JSON.stringify(value); + if (/^[\{\[]/.test(result)) { + value = result; + } + } catch (e) {} + + value = converter.write ? + converter.write(value, key) : + encodeURIComponent(String(value)) + .replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent); + + key = encodeURIComponent(String(key)) + .replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent) + .replace(/[\(\)]/g, escape); + + var stringifiedAttributes = ''; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; + } + stringifiedAttributes += '; ' + attributeName; + if (attributes[attributeName] === true) { + continue; + } + + // Considers RFC 6265 section 5.2: + // ... + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + // Consume the characters of the unparsed-attributes up to, + // not including, the first %x3B (";") character. + // ... + stringifiedAttributes += '=' + attributes[attributeName].split(';')[0]; + } + + return (document.cookie = key + '=' + value + stringifiedAttributes); + } + + function get (key, json) { + if (typeof document === 'undefined') { + return; + } + + var jar = {}; + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. + var cookies = document.cookie ? document.cookie.split('; ') : []; + var i = 0; + + for (; i < cookies.length; i++) { + var parts = cookies[i].split('='); + var cookie = parts.slice(1).join('='); + + if (!json && cookie.charAt(0) === '"') { + cookie = cookie.slice(1, -1); + } + + try { + var name = decode(parts[0]); + cookie = (converter.read || converter)(cookie, name) || + decode(cookie); + + if (json) { + try { + cookie = JSON.parse(cookie); + } catch (e) {} + } + + jar[name] = cookie; + + if (key === name) { + break; + } + } catch (e) {} + } + + return key ? jar[key] : jar; + } + + api.set = set; + api.get = function (key) { + return get(key, false /* read as raw */); + }; + api.getJSON = function (key) { + return get(key, true /* read as json */); + }; + api.remove = function (key, attributes) { + set(key, '', extend(attributes, { + expires: -1 + })); + }; + + api.defaults = {}; + + api.withConverter = init; + + return api; + } + + return init(function () {}); +})); diff --git a/phpMyAdmin/js/vendor/openlayers/OpenLayers.js b/phpMyAdmin/js/vendor/openlayers/OpenLayers.js new file mode 100755 index 0000000..669778d --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/OpenLayers.js @@ -0,0 +1,1443 @@ +/* + + OpenLayers.js -- OpenLayers Map Viewer Library + + Copyright (c) 2006-2013 by OpenLayers Contributors + Published under the 2-clause BSD license. + See http://openlayers.org/dev/license.txt for the full text of the license, and http://openlayers.org/dev/authors.txt for full list of contributors. + + Includes compressed code under the following licenses: + + (For uncompressed versions of the code used, please see the + OpenLayers Github repository: <https://github.com/openlayers/openlayers>) + +*/ + +/** + * Contains XMLHttpRequest.js <http://code.google.com/p/xmlhttprequest/> + * Copyright 2007 Sergey Ilinsky (http://www.ilinsky.com) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +/** + * OpenLayers.Util.pagePosition is based on Yahoo's getXY method, which is + * Copyright (c) 2006, Yahoo! Inc. + * All rights reserved. + * + * Redistribution and use of this software in source and binary forms, with or + * without modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * * Neither the name of Yahoo! Inc. nor the names of its contributors may be + * used to endorse or promote products derived from this software without + * specific prior written permission of Yahoo! Inc. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +var OpenLayers={VERSION_NUMBER:"Release 2.13.1",singleFile:!0,_getScriptLocation:function(){for(var a=/(^|(.*?\/))(OpenLayers[^\/]*?\.js)(\?|$)/,b=document.getElementsByTagName("script"),c,d="",e=0,f=b.length;e<f;e++)if(c=b[e].getAttribute("src"))if(c=c.match(a)){d=c[1];break}return function(){return d}}(),ImgPath:""};OpenLayers.Class=function(){var a=arguments.length,b=arguments[0],c=arguments[a-1],d="function"==typeof c.initialize?c.initialize:function(){b.prototype.initialize.apply(this,arguments)};1<a?(a=[d,b].concat(Array.prototype.slice.call(arguments).slice(1,a-1),c),OpenLayers.inherit.apply(null,a)):d.prototype=c;return d}; +OpenLayers.inherit=function(a,b){var c=function(){};c.prototype=b.prototype;a.prototype=new c;var d,e,c=2;for(d=arguments.length;c<d;c++)e=arguments[c],"function"===typeof e&&(e=e.prototype),OpenLayers.Util.extend(a.prototype,e)};OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.extend=function(a,b){a=a||{};if(b){for(var c in b){var d=b[c];void 0!==d&&(a[c]=d)}"function"==typeof window.Event&&b instanceof window.Event||(!b.hasOwnProperty||!b.hasOwnProperty("toString"))||(a.toString=b.toString)}return a};OpenLayers.String={startsWith:function(a,b){return 0==a.indexOf(b)},contains:function(a,b){return-1!=a.indexOf(b)},trim:function(a){return a.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},camelize:function(a){a=a.split("-");for(var b=a[0],c=1,d=a.length;c<d;c++)var e=a[c],b=b+(e.charAt(0).toUpperCase()+e.substring(1));return b},format:function(a,b,c){b||(b=window);return a.replace(OpenLayers.String.tokenRegEx,function(a,e){for(var f,g=e.split(/\.+/),h=0;h<g.length;h++){0==h&&(f=b);if(void 0===f)break; +f=f[g[h]]}"function"==typeof f&&(f=c?f.apply(null,c):f());return"undefined"==typeof f?"undefined":f})},tokenRegEx:/\$\{([\w.]+?)\}/g,numberRegEx:/^([+-]?)(?=\d|\.\d)\d*(\.\d*)?([Ee]([+-]?\d+))?$/,isNumeric:function(a){return OpenLayers.String.numberRegEx.test(a)},numericIf:function(a,b){var c=a;!0===b&&(null!=a&&a.replace)&&(a=a.replace(/^\s*|\s*$/g,""));return OpenLayers.String.isNumeric(a)?parseFloat(a):c}}; +OpenLayers.Number={decimalSeparator:".",thousandsSeparator:",",limitSigDigs:function(a,b){var c=0;0<b&&(c=parseFloat(a.toPrecision(b)));return c},format:function(a,b,c,d){b="undefined"!=typeof b?b:0;c="undefined"!=typeof c?c:OpenLayers.Number.thousandsSeparator;d="undefined"!=typeof d?d:OpenLayers.Number.decimalSeparator;null!=b&&(a=parseFloat(a.toFixed(b)));var e=a.toString().split(".");1==e.length&&null==b&&(b=0);a=e[0];if(c)for(var f=/(-?[0-9]+)([0-9]{3})/;f.test(a);)a=a.replace(f,"$1"+c+"$2"); +0==b?b=a:(c=1<e.length?e[1]:"0",null!=b&&(c+=Array(b-c.length+1).join("0")),b=a+d+c);return b},zeroPad:function(a,b,c){for(a=a.toString(c||10);a.length<b;)a="0"+a;return a}}; +OpenLayers.Function={bind:function(a,b){var c=Array.prototype.slice.apply(arguments,[2]);return function(){var d=c.concat(Array.prototype.slice.apply(arguments,[0]));return a.apply(b,d)}},bindAsEventListener:function(a,b){return function(c){return a.call(b,c||window.event)}},False:function(){return!1},True:function(){return!0},Void:function(){}}; +OpenLayers.Array={filter:function(a,b,c){var d=[];if(Array.prototype.filter)d=a.filter(b,c);else{var e=a.length;if("function"!=typeof b)throw new TypeError;for(var f=0;f<e;f++)if(f in a){var g=a[f];b.call(c,g,f,a)&&d.push(g)}}return d}};OpenLayers.Bounds=OpenLayers.Class({left:null,bottom:null,right:null,top:null,centerLonLat:null,initialize:function(a,b,c,d){OpenLayers.Util.isArray(a)&&(d=a[3],c=a[2],b=a[1],a=a[0]);null!=a&&(this.left=OpenLayers.Util.toFloat(a));null!=b&&(this.bottom=OpenLayers.Util.toFloat(b));null!=c&&(this.right=OpenLayers.Util.toFloat(c));null!=d&&(this.top=OpenLayers.Util.toFloat(d))},clone:function(){return new OpenLayers.Bounds(this.left,this.bottom,this.right,this.top)},equals:function(a){var b=!1;null!= +a&&(b=this.left==a.left&&this.right==a.right&&this.top==a.top&&this.bottom==a.bottom);return b},toString:function(){return[this.left,this.bottom,this.right,this.top].join()},toArray:function(a){return!0===a?[this.bottom,this.left,this.top,this.right]:[this.left,this.bottom,this.right,this.top]},toBBOX:function(a,b){null==a&&(a=6);var c=Math.pow(10,a),d=Math.round(this.left*c)/c,e=Math.round(this.bottom*c)/c,f=Math.round(this.right*c)/c,c=Math.round(this.top*c)/c;return!0===b?e+","+d+","+c+","+f:d+ +","+e+","+f+","+c},toGeometry:function(){return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(this.left,this.bottom),new OpenLayers.Geometry.Point(this.right,this.bottom),new OpenLayers.Geometry.Point(this.right,this.top),new OpenLayers.Geometry.Point(this.left,this.top)])])},getWidth:function(){return this.right-this.left},getHeight:function(){return this.top-this.bottom},getSize:function(){return new OpenLayers.Size(this.getWidth(),this.getHeight())}, +getCenterPixel:function(){return new OpenLayers.Pixel((this.left+this.right)/2,(this.bottom+this.top)/2)},getCenterLonLat:function(){this.centerLonLat||(this.centerLonLat=new OpenLayers.LonLat((this.left+this.right)/2,(this.bottom+this.top)/2));return this.centerLonLat},scale:function(a,b){null==b&&(b=this.getCenterLonLat());var c,d;"OpenLayers.LonLat"==b.CLASS_NAME?(c=b.lon,d=b.lat):(c=b.x,d=b.y);return new OpenLayers.Bounds((this.left-c)*a+c,(this.bottom-d)*a+d,(this.right-c)*a+c,(this.top-d)*a+ +d)},add:function(a,b){if(null==a||null==b)throw new TypeError("Bounds.add cannot receive null values");return new OpenLayers.Bounds(this.left+a,this.bottom+b,this.right+a,this.top+b)},extend:function(a){if(a)switch(a.CLASS_NAME){case "OpenLayers.LonLat":this.extendXY(a.lon,a.lat);break;case "OpenLayers.Geometry.Point":this.extendXY(a.x,a.y);break;case "OpenLayers.Bounds":this.centerLonLat=null;if(null==this.left||a.left<this.left)this.left=a.left;if(null==this.bottom||a.bottom<this.bottom)this.bottom= +a.bottom;if(null==this.right||a.right>this.right)this.right=a.right;if(null==this.top||a.top>this.top)this.top=a.top}},extendXY:function(a,b){this.centerLonLat=null;if(null==this.left||a<this.left)this.left=a;if(null==this.bottom||b<this.bottom)this.bottom=b;if(null==this.right||a>this.right)this.right=a;if(null==this.top||b>this.top)this.top=b},containsLonLat:function(a,b){"boolean"===typeof b&&(b={inclusive:b});b=b||{};var c=this.contains(a.lon,a.lat,b.inclusive),d=b.worldBounds;d&&!c&&(c=d.getWidth(), +d=Math.round((a.lon-(d.left+d.right)/2)/c),c=this.containsLonLat({lon:a.lon-d*c,lat:a.lat},{inclusive:b.inclusive}));return c},containsPixel:function(a,b){return this.contains(a.x,a.y,b)},contains:function(a,b,c){null==c&&(c=!0);if(null==a||null==b)return!1;a=OpenLayers.Util.toFloat(a);b=OpenLayers.Util.toFloat(b);var d=!1;return d=c?a>=this.left&&a<=this.right&&b>=this.bottom&&b<=this.top:a>this.left&&a<this.right&&b>this.bottom&&b<this.top},intersectsBounds:function(a,b){"boolean"===typeof b&&(b= +{inclusive:b});b=b||{};if(b.worldBounds){var c=this.wrapDateLine(b.worldBounds);a=a.wrapDateLine(b.worldBounds)}else c=this;null==b.inclusive&&(b.inclusive=!0);var d=!1,e=c.left==a.right||c.right==a.left||c.top==a.bottom||c.bottom==a.top;if(b.inclusive||!e)var d=a.top>=c.bottom&&a.top<=c.top||c.top>a.bottom&&c.top<a.top,e=a.left>=c.left&&a.left<=c.right||c.left>=a.left&&c.left<=a.right,f=a.right>=c.left&&a.right<=c.right||c.right>=a.left&&c.right<=a.right,d=(a.bottom>=c.bottom&&a.bottom<=c.top||c.bottom>= +a.bottom&&c.bottom<=a.top||d)&&(e||f);if(b.worldBounds&&!d){var g=b.worldBounds,e=g.getWidth(),f=!g.containsBounds(c),g=!g.containsBounds(a);f&&!g?(a=a.add(-e,0),d=c.intersectsBounds(a,{inclusive:b.inclusive})):g&&!f&&(c=c.add(-e,0),d=a.intersectsBounds(c,{inclusive:b.inclusive}))}return d},containsBounds:function(a,b,c){null==b&&(b=!1);null==c&&(c=!0);var d=this.contains(a.left,a.bottom,c),e=this.contains(a.right,a.bottom,c),f=this.contains(a.left,a.top,c);a=this.contains(a.right,a.top,c);return b? +d||e||f||a:d&&e&&f&&a},determineQuadrant:function(a){var b="",c=this.getCenterLonLat(),b=b+(a.lat<c.lat?"b":"t");return b+=a.lon<c.lon?"l":"r"},transform:function(a,b){this.centerLonLat=null;var c=OpenLayers.Projection.transform({x:this.left,y:this.bottom},a,b),d=OpenLayers.Projection.transform({x:this.right,y:this.bottom},a,b),e=OpenLayers.Projection.transform({x:this.left,y:this.top},a,b),f=OpenLayers.Projection.transform({x:this.right,y:this.top},a,b);this.left=Math.min(c.x,e.x);this.bottom=Math.min(c.y, +d.y);this.right=Math.max(d.x,f.x);this.top=Math.max(e.y,f.y);return this},wrapDateLine:function(a,b){b=b||{};var c=b.leftTolerance||0,d=b.rightTolerance||0,e=this.clone();if(a){for(var f=a.getWidth();e.left<a.left&&e.right-d<=a.left;)e=e.add(f,0);for(;e.left+c>=a.right&&e.right>a.right;)e=e.add(-f,0);c=e.left+c;c<a.right&&(c>a.left&&e.right-d>a.right)&&(e=e.add(-f,0))}return e},CLASS_NAME:"OpenLayers.Bounds"}); +OpenLayers.Bounds.fromString=function(a,b){var c=a.split(",");return OpenLayers.Bounds.fromArray(c,b)};OpenLayers.Bounds.fromArray=function(a,b){return!0===b?new OpenLayers.Bounds(a[1],a[0],a[3],a[2]):new OpenLayers.Bounds(a[0],a[1],a[2],a[3])};OpenLayers.Bounds.fromSize=function(a){return new OpenLayers.Bounds(0,a.h,a.w,0)};OpenLayers.Bounds.oppositeQuadrant=function(a){var b;b=""+("t"==a.charAt(0)?"b":"t");return b+="l"==a.charAt(1)?"r":"l"};OpenLayers.Element={visible:function(a){return"none"!=OpenLayers.Util.getElement(a).style.display},toggle:function(){for(var a=0,b=arguments.length;a<b;a++){var c=OpenLayers.Util.getElement(arguments[a]),d=OpenLayers.Element.visible(c)?"none":"";c.style.display=d}},remove:function(a){a=OpenLayers.Util.getElement(a);a.parentNode.removeChild(a)},getHeight:function(a){a=OpenLayers.Util.getElement(a);return a.offsetHeight},hasClass:function(a,b){var c=a.className;return!!c&&RegExp("(^|\\s)"+b+"(\\s|$)").test(c)}, +addClass:function(a,b){OpenLayers.Element.hasClass(a,b)||(a.className+=(a.className?" ":"")+b);return a},removeClass:function(a,b){var c=a.className;c&&(a.className=OpenLayers.String.trim(c.replace(RegExp("(^|\\s+)"+b+"(\\s+|$)")," ")));return a},toggleClass:function(a,b){OpenLayers.Element.hasClass(a,b)?OpenLayers.Element.removeClass(a,b):OpenLayers.Element.addClass(a,b);return a},getStyle:function(a,b){a=OpenLayers.Util.getElement(a);var c=null;if(a&&a.style){c=a.style[OpenLayers.String.camelize(b)]; +c||(document.defaultView&&document.defaultView.getComputedStyle?c=(c=document.defaultView.getComputedStyle(a,null))?c.getPropertyValue(b):null:a.currentStyle&&(c=a.currentStyle[OpenLayers.String.camelize(b)]));var d=["left","top","right","bottom"];window.opera&&(-1!=OpenLayers.Util.indexOf(d,b)&&"static"==OpenLayers.Element.getStyle(a,"position"))&&(c="auto")}return"auto"==c?null:c}};OpenLayers.LonLat=OpenLayers.Class({lon:0,lat:0,initialize:function(a,b){OpenLayers.Util.isArray(a)&&(b=a[1],a=a[0]);this.lon=OpenLayers.Util.toFloat(a);this.lat=OpenLayers.Util.toFloat(b)},toString:function(){return"lon="+this.lon+",lat="+this.lat},toShortString:function(){return this.lon+", "+this.lat},clone:function(){return new OpenLayers.LonLat(this.lon,this.lat)},add:function(a,b){if(null==a||null==b)throw new TypeError("LonLat.add cannot receive null values");return new OpenLayers.LonLat(this.lon+ +OpenLayers.Util.toFloat(a),this.lat+OpenLayers.Util.toFloat(b))},equals:function(a){var b=!1;null!=a&&(b=this.lon==a.lon&&this.lat==a.lat||isNaN(this.lon)&&isNaN(this.lat)&&isNaN(a.lon)&&isNaN(a.lat));return b},transform:function(a,b){var c=OpenLayers.Projection.transform({x:this.lon,y:this.lat},a,b);this.lon=c.x;this.lat=c.y;return this},wrapDateLine:function(a){var b=this.clone();if(a){for(;b.lon<a.left;)b.lon+=a.getWidth();for(;b.lon>a.right;)b.lon-=a.getWidth()}return b},CLASS_NAME:"OpenLayers.LonLat"}); +OpenLayers.LonLat.fromString=function(a){a=a.split(",");return new OpenLayers.LonLat(a[0],a[1])};OpenLayers.LonLat.fromArray=function(a){var b=OpenLayers.Util.isArray(a);return new OpenLayers.LonLat(b&&a[0],b&&a[1])};OpenLayers.Pixel=OpenLayers.Class({x:0,y:0,initialize:function(a,b){this.x=parseFloat(a);this.y=parseFloat(b)},toString:function(){return"x="+this.x+",y="+this.y},clone:function(){return new OpenLayers.Pixel(this.x,this.y)},equals:function(a){var b=!1;null!=a&&(b=this.x==a.x&&this.y==a.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y));return b},distanceTo:function(a){return Math.sqrt(Math.pow(this.x-a.x,2)+Math.pow(this.y-a.y,2))},add:function(a,b){if(null==a||null==b)throw new TypeError("Pixel.add cannot receive null values"); +return new OpenLayers.Pixel(this.x+a,this.y+b)},offset:function(a){var b=this.clone();a&&(b=this.add(a.x,a.y));return b},CLASS_NAME:"OpenLayers.Pixel"});OpenLayers.Size=OpenLayers.Class({w:0,h:0,initialize:function(a,b){this.w=parseFloat(a);this.h=parseFloat(b)},toString:function(){return"w="+this.w+",h="+this.h},clone:function(){return new OpenLayers.Size(this.w,this.h)},equals:function(a){var b=!1;null!=a&&(b=this.w==a.w&&this.h==a.h||isNaN(this.w)&&isNaN(this.h)&&isNaN(a.w)&&isNaN(a.h));return b},CLASS_NAME:"OpenLayers.Size"});OpenLayers.Console={log:function(){},debug:function(){},info:function(){},warn:function(){},error:function(){},userError:function(a){alert(a)},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){},CLASS_NAME:"OpenLayers.Console"}; +(function(){for(var a=document.getElementsByTagName("script"),b=0,c=a.length;b<c;++b)if(-1!=a[b].src.indexOf("firebug.js")&&console){OpenLayers.Util.extend(OpenLayers.Console,console);break}})();OpenLayers.Lang={code:null,defaultCode:"en",getCode:function(){OpenLayers.Lang.code||OpenLayers.Lang.setCode();return OpenLayers.Lang.code},setCode:function(a){var b;a||(a="msie"==OpenLayers.BROWSER_NAME?navigator.userLanguage:navigator.language);a=a.split("-");a[0]=a[0].toLowerCase();"object"==typeof OpenLayers.Lang[a[0]]&&(b=a[0]);if(a[1]){var c=a[0]+"-"+a[1].toUpperCase();"object"==typeof OpenLayers.Lang[c]&&(b=c)}b||(OpenLayers.Console.warn("Failed to find OpenLayers.Lang."+a.join("-")+" dictionary, falling back to default language"), +b=OpenLayers.Lang.defaultCode);OpenLayers.Lang.code=b},translate:function(a,b){var c=OpenLayers.Lang[OpenLayers.Lang.getCode()];(c=c&&c[a])||(c=a);b&&(c=OpenLayers.String.format(c,b));return c}};OpenLayers.i18n=OpenLayers.Lang.translate;OpenLayers.Util=OpenLayers.Util||{};OpenLayers.Util.getElement=function(){for(var a=[],b=0,c=arguments.length;b<c;b++){var d=arguments[b];"string"==typeof d&&(d=document.getElementById(d));if(1==arguments.length)return d;a.push(d)}return a};OpenLayers.Util.isElement=function(a){return!(!a||1!==a.nodeType)};OpenLayers.Util.isArray=function(a){return"[object Array]"===Object.prototype.toString.call(a)};OpenLayers.Util.removeItem=function(a,b){for(var c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1);return a}; +OpenLayers.Util.indexOf=function(a,b){if("function"==typeof a.indexOf)return a.indexOf(b);for(var c=0,d=a.length;c<d;c++)if(a[c]==b)return c;return-1};OpenLayers.Util.dotless=/\./g; +OpenLayers.Util.modifyDOMElement=function(a,b,c,d,e,f,g,h){b&&(a.id=b.replace(OpenLayers.Util.dotless,"_"));c&&(a.style.left=c.x+"px",a.style.top=c.y+"px");d&&(a.style.width=d.w+"px",a.style.height=d.h+"px");e&&(a.style.position=e);f&&(a.style.border=f);g&&(a.style.overflow=g);0<=parseFloat(h)&&1>parseFloat(h)?(a.style.filter="alpha(opacity="+100*h+")",a.style.opacity=h):1==parseFloat(h)&&(a.style.filter="",a.style.opacity="")}; +OpenLayers.Util.createDiv=function(a,b,c,d,e,f,g,h){var k=document.createElement("div");d&&(k.style.backgroundImage="url("+d+")");a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));e||(e="absolute");OpenLayers.Util.modifyDOMElement(k,a,b,c,e,f,g,h);return k}; +OpenLayers.Util.createImage=function(a,b,c,d,e,f,g,h){var k=document.createElement("img");a||(a=OpenLayers.Util.createUniqueID("OpenLayersDiv"));e||(e="relative");OpenLayers.Util.modifyDOMElement(k,a,b,c,e,f,null,g);h&&(k.style.display="none",b=function(){k.style.display="";OpenLayers.Event.stopObservingElement(k)},OpenLayers.Event.observe(k,"load",b),OpenLayers.Event.observe(k,"error",b));k.style.alt=a;k.galleryImg="no";d&&(k.src=d);return k};OpenLayers.IMAGE_RELOAD_ATTEMPTS=0; +OpenLayers.Util.alphaHackNeeded=null;OpenLayers.Util.alphaHack=function(){if(null==OpenLayers.Util.alphaHackNeeded){var a=navigator.appVersion.split("MSIE"),a=parseFloat(a[1]),b=!1;try{b=!!document.body.filters}catch(c){}OpenLayers.Util.alphaHackNeeded=b&&5.5<=a&&7>a}return OpenLayers.Util.alphaHackNeeded}; +OpenLayers.Util.modifyAlphaImageDiv=function(a,b,c,d,e,f,g,h,k){OpenLayers.Util.modifyDOMElement(a,b,c,d,f,null,null,k);b=a.childNodes[0];e&&(b.src=e);OpenLayers.Util.modifyDOMElement(b,a.id+"_innerImage",null,d,"relative",g);OpenLayers.Util.alphaHack()&&("none"!=a.style.display&&(a.style.display="inline-block"),null==h&&(h="scale"),a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+b.src+"', sizingMethod='"+h+"')",0<=parseFloat(a.style.opacity)&&1>parseFloat(a.style.opacity)&& +(a.style.filter+=" alpha(opacity="+100*a.style.opacity+")"),b.style.filter="alpha(opacity=0)")};OpenLayers.Util.createAlphaImageDiv=function(a,b,c,d,e,f,g,h,k){var l=OpenLayers.Util.createDiv();k=OpenLayers.Util.createImage(null,null,null,null,null,null,null,k);k.className="olAlphaImg";l.appendChild(k);OpenLayers.Util.modifyAlphaImageDiv(l,a,b,c,d,e,f,g,h);return l};OpenLayers.Util.upperCaseObject=function(a){var b={},c;for(c in a)b[c.toUpperCase()]=a[c];return b}; +OpenLayers.Util.applyDefaults=function(a,b){a=a||{};var c="function"==typeof window.Event&&b instanceof window.Event,d;for(d in b)if(void 0===a[d]||!c&&b.hasOwnProperty&&b.hasOwnProperty(d)&&!a.hasOwnProperty(d))a[d]=b[d];!c&&(b&&b.hasOwnProperty&&b.hasOwnProperty("toString")&&!a.hasOwnProperty("toString"))&&(a.toString=b.toString);return a}; +OpenLayers.Util.getParameterString=function(a){var b=[],c;for(c in a){var d=a[c];if(null!=d&&"function"!=typeof d){if("object"==typeof d&&d.constructor==Array){for(var e=[],f,g=0,h=d.length;g<h;g++)f=d[g],e.push(encodeURIComponent(null===f||void 0===f?"":f));d=e.join(",")}else d=encodeURIComponent(d);b.push(encodeURIComponent(c)+"="+d)}}return b.join("&")};OpenLayers.Util.urlAppend=function(a,b){var c=a;if(b)var d=(a+" ").split(/[?&]/),c=c+(" "===d.pop()?b:d.length?"&"+b:"?"+b);return c}; +OpenLayers.Util.getImagesLocation=function(){return OpenLayers.ImgPath||OpenLayers._getScriptLocation()+"img/"};OpenLayers.Util.getImageLocation=function(a){return OpenLayers.Util.getImagesLocation()+a};OpenLayers.Util.Try=function(){for(var a=null,b=0,c=arguments.length;b<c;b++){var d=arguments[b];try{a=d();break}catch(e){}}return a}; +OpenLayers.Util.getXmlNodeValue=function(a){var b=null;OpenLayers.Util.Try(function(){b=a.text;b||(b=a.textContent);b||(b=a.firstChild.nodeValue)},function(){b=a.textContent});return b};OpenLayers.Util.mouseLeft=function(a,b){for(var c=a.relatedTarget?a.relatedTarget:a.toElement;c!=b&&null!=c;)c=c.parentNode;return c!=b};OpenLayers.Util.DEFAULT_PRECISION=14;OpenLayers.Util.toFloat=function(a,b){null==b&&(b=OpenLayers.Util.DEFAULT_PRECISION);"number"!==typeof a&&(a=parseFloat(a));return 0===b?a:parseFloat(a.toPrecision(b))}; +OpenLayers.Util.rad=function(a){return a*Math.PI/180};OpenLayers.Util.deg=function(a){return 180*a/Math.PI};OpenLayers.Util.VincentyConstants={a:6378137,b:6356752.3142,f:1/298.257223563}; +OpenLayers.Util.distVincenty=function(a,b){for(var c=OpenLayers.Util.VincentyConstants,d=c.a,e=c.b,c=c.f,f=OpenLayers.Util.rad(b.lon-a.lon),g=Math.atan((1-c)*Math.tan(OpenLayers.Util.rad(a.lat))),h=Math.atan((1-c)*Math.tan(OpenLayers.Util.rad(b.lat))),k=Math.sin(g),g=Math.cos(g),l=Math.sin(h),h=Math.cos(h),m=f,n=2*Math.PI,p=20;1E-12<Math.abs(m-n)&&0<--p;){var q=Math.sin(m),r=Math.cos(m),s=Math.sqrt(h*q*h*q+(g*l-k*h*r)*(g*l-k*h*r));if(0==s)return 0;var r=k*l+g*h*r,t=Math.atan2(s,r),u=Math.asin(g*h* +q/s),v=Math.cos(u)*Math.cos(u),q=r-2*k*l/v,w=c/16*v*(4+c*(4-3*v)),n=m,m=f+(1-w)*c*Math.sin(u)*(t+w*s*(q+w*r*(-1+2*q*q)))}if(0==p)return NaN;d=v*(d*d-e*e)/(e*e);c=d/1024*(256+d*(-128+d*(74-47*d)));return(e*(1+d/16384*(4096+d*(-768+d*(320-175*d))))*(t-c*s*(q+c/4*(r*(-1+2*q*q)-c/6*q*(-3+4*s*s)*(-3+4*q*q))))).toFixed(3)/1E3}; +OpenLayers.Util.destinationVincenty=function(a,b,c){var d=OpenLayers.Util,e=d.VincentyConstants,f=e.a,g=e.b,h=e.f,e=a.lon;a=a.lat;var k=d.rad(b);b=Math.sin(k);k=Math.cos(k);a=(1-h)*Math.tan(d.rad(a));var l=1/Math.sqrt(1+a*a),m=a*l,n=Math.atan2(a,k);a=l*b;for(var p=1-a*a,f=p*(f*f-g*g)/(g*g),q=1+f/16384*(4096+f*(-768+f*(320-175*f))),r=f/1024*(256+f*(-128+f*(74-47*f))),f=c/(g*q),s=2*Math.PI;1E-12<Math.abs(f-s);)var t=Math.cos(2*n+f),u=Math.sin(f),v=Math.cos(f),w=r*u*(t+r/4*(v*(-1+2*t*t)-r/6*t*(-3+4* +u*u)*(-3+4*t*t))),s=f,f=c/(g*q)+w;c=m*u-l*v*k;g=Math.atan2(m*v+l*u*k,(1-h)*Math.sqrt(a*a+c*c));b=Math.atan2(u*b,l*v-m*u*k);k=h/16*p*(4+h*(4-3*p));t=b-(1-k)*h*a*(f+k*u*(t+k*v*(-1+2*t*t)));Math.atan2(a,-c);return new OpenLayers.LonLat(e+d.deg(t),d.deg(g))}; +OpenLayers.Util.getParameters=function(a,b){b=b||{};a=null===a||void 0===a?window.location.href:a;var c="";if(OpenLayers.String.contains(a,"?"))var d=a.indexOf("?")+1,c=OpenLayers.String.contains(a,"#")?a.indexOf("#"):a.length,c=a.substring(d,c);for(var d={},c=c.split(/[&;]/),e=0,f=c.length;e<f;++e){var g=c[e].split("=");if(g[0]){var h=g[0];try{h=decodeURIComponent(h)}catch(k){h=unescape(h)}g=(g[1]||"").replace(/\+/g," ");try{g=decodeURIComponent(g)}catch(l){g=unescape(g)}!1!==b.splitArgs&&(g=g.split(",")); +1==g.length&&(g=g[0]);d[h]=g}}return d};OpenLayers.Util.lastSeqID=0;OpenLayers.Util.createUniqueID=function(a){a=null==a?"id_":a.replace(OpenLayers.Util.dotless,"_");OpenLayers.Util.lastSeqID+=1;return a+OpenLayers.Util.lastSeqID};OpenLayers.INCHES_PER_UNIT={inches:1,ft:12,mi:63360,m:39.37,km:39370,dd:4374754,yd:36};OpenLayers.INCHES_PER_UNIT["in"]=OpenLayers.INCHES_PER_UNIT.inches;OpenLayers.INCHES_PER_UNIT.degrees=OpenLayers.INCHES_PER_UNIT.dd;OpenLayers.INCHES_PER_UNIT.nmi=1852*OpenLayers.INCHES_PER_UNIT.m; +OpenLayers.METERS_PER_INCH=0.0254000508001016; +OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{Inch:OpenLayers.INCHES_PER_UNIT.inches,Meter:1/OpenLayers.METERS_PER_INCH,Foot:0.3048006096012192/OpenLayers.METERS_PER_INCH,IFoot:0.3048/OpenLayers.METERS_PER_INCH,ClarkeFoot:0.3047972651151/OpenLayers.METERS_PER_INCH,SearsFoot:0.30479947153867626/OpenLayers.METERS_PER_INCH,GoldCoastFoot:0.3047997101815088/OpenLayers.METERS_PER_INCH,IInch:0.0254/OpenLayers.METERS_PER_INCH,MicroInch:2.54E-5/OpenLayers.METERS_PER_INCH,Mil:2.54E-8/OpenLayers.METERS_PER_INCH, +Centimeter:0.01/OpenLayers.METERS_PER_INCH,Kilometer:1E3/OpenLayers.METERS_PER_INCH,Yard:0.9144018288036576/OpenLayers.METERS_PER_INCH,SearsYard:0.914398414616029/OpenLayers.METERS_PER_INCH,IndianYard:0.9143985307444408/OpenLayers.METERS_PER_INCH,IndianYd37:0.91439523/OpenLayers.METERS_PER_INCH,IndianYd62:0.9143988/OpenLayers.METERS_PER_INCH,IndianYd75:0.9143985/OpenLayers.METERS_PER_INCH,IndianFoot:0.30479951/OpenLayers.METERS_PER_INCH,IndianFt37:0.30479841/OpenLayers.METERS_PER_INCH,IndianFt62:0.3047996/ +OpenLayers.METERS_PER_INCH,IndianFt75:0.3047995/OpenLayers.METERS_PER_INCH,Mile:1609.3472186944373/OpenLayers.METERS_PER_INCH,IYard:0.9144/OpenLayers.METERS_PER_INCH,IMile:1609.344/OpenLayers.METERS_PER_INCH,NautM:1852/OpenLayers.METERS_PER_INCH,"Lat-66":110943.31648893273/OpenLayers.METERS_PER_INCH,"Lat-83":110946.25736872235/OpenLayers.METERS_PER_INCH,Decimeter:0.1/OpenLayers.METERS_PER_INCH,Millimeter:0.001/OpenLayers.METERS_PER_INCH,Dekameter:10/OpenLayers.METERS_PER_INCH,Decameter:10/OpenLayers.METERS_PER_INCH, +Hectometer:100/OpenLayers.METERS_PER_INCH,GermanMeter:1.0000135965/OpenLayers.METERS_PER_INCH,CaGrid:0.999738/OpenLayers.METERS_PER_INCH,ClarkeChain:20.1166194976/OpenLayers.METERS_PER_INCH,GunterChain:20.11684023368047/OpenLayers.METERS_PER_INCH,BenoitChain:20.116782494375872/OpenLayers.METERS_PER_INCH,SearsChain:20.11676512155/OpenLayers.METERS_PER_INCH,ClarkeLink:0.201166194976/OpenLayers.METERS_PER_INCH,GunterLink:0.2011684023368047/OpenLayers.METERS_PER_INCH,BenoitLink:0.20116782494375873/OpenLayers.METERS_PER_INCH, +SearsLink:0.2011676512155/OpenLayers.METERS_PER_INCH,Rod:5.02921005842012/OpenLayers.METERS_PER_INCH,IntnlChain:20.1168/OpenLayers.METERS_PER_INCH,IntnlLink:0.201168/OpenLayers.METERS_PER_INCH,Perch:5.02921005842012/OpenLayers.METERS_PER_INCH,Pole:5.02921005842012/OpenLayers.METERS_PER_INCH,Furlong:201.1684023368046/OpenLayers.METERS_PER_INCH,Rood:3.778266898/OpenLayers.METERS_PER_INCH,CapeFoot:0.3047972615/OpenLayers.METERS_PER_INCH,Brealey:375/OpenLayers.METERS_PER_INCH,ModAmFt:0.304812252984506/ +OpenLayers.METERS_PER_INCH,Fathom:1.8288/OpenLayers.METERS_PER_INCH,"NautM-UK":1853.184/OpenLayers.METERS_PER_INCH,"50kilometers":5E4/OpenLayers.METERS_PER_INCH,"150kilometers":15E4/OpenLayers.METERS_PER_INCH}); +OpenLayers.Util.extend(OpenLayers.INCHES_PER_UNIT,{mm:OpenLayers.INCHES_PER_UNIT.Meter/1E3,cm:OpenLayers.INCHES_PER_UNIT.Meter/100,dm:100*OpenLayers.INCHES_PER_UNIT.Meter,km:1E3*OpenLayers.INCHES_PER_UNIT.Meter,kmi:OpenLayers.INCHES_PER_UNIT.nmi,fath:OpenLayers.INCHES_PER_UNIT.Fathom,ch:OpenLayers.INCHES_PER_UNIT.IntnlChain,link:OpenLayers.INCHES_PER_UNIT.IntnlLink,"us-in":OpenLayers.INCHES_PER_UNIT.inches,"us-ft":OpenLayers.INCHES_PER_UNIT.Foot,"us-yd":OpenLayers.INCHES_PER_UNIT.Yard,"us-ch":OpenLayers.INCHES_PER_UNIT.GunterChain, +"us-mi":OpenLayers.INCHES_PER_UNIT.Mile,"ind-yd":OpenLayers.INCHES_PER_UNIT.IndianYd37,"ind-ft":OpenLayers.INCHES_PER_UNIT.IndianFt37,"ind-ch":20.11669506/OpenLayers.METERS_PER_INCH});OpenLayers.DOTS_PER_INCH=72;OpenLayers.Util.normalizeScale=function(a){return 1<a?1/a:a};OpenLayers.Util.getResolutionFromScale=function(a,b){var c;a&&(null==b&&(b="degrees"),c=1/(OpenLayers.Util.normalizeScale(a)*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH));return c}; +OpenLayers.Util.getScaleFromResolution=function(a,b){null==b&&(b="degrees");return a*OpenLayers.INCHES_PER_UNIT[b]*OpenLayers.DOTS_PER_INCH}; +OpenLayers.Util.pagePosition=function(a){var b=[0,0],c=OpenLayers.Util.getViewportElement();if(!a||a==window||a==c)return b;var d=OpenLayers.IS_GECKO&&document.getBoxObjectFor&&"absolute"==OpenLayers.Element.getStyle(a,"position")&&(""==a.style.top||""==a.style.left),e=null;if(a.getBoundingClientRect)a=a.getBoundingClientRect(),e=window.pageYOffset||c.scrollTop,b[0]=a.left+(window.pageXOffset||c.scrollLeft),b[1]=a.top+e;else if(document.getBoxObjectFor&&!d)a=document.getBoxObjectFor(a),c=document.getBoxObjectFor(c), +b[0]=a.screenX-c.screenX,b[1]=a.screenY-c.screenY;else{b[0]=a.offsetLeft;b[1]=a.offsetTop;e=a.offsetParent;if(e!=a)for(;e;)b[0]+=e.offsetLeft,b[1]+=e.offsetTop,e=e.offsetParent;c=OpenLayers.BROWSER_NAME;if("opera"==c||"safari"==c&&"absolute"==OpenLayers.Element.getStyle(a,"position"))b[1]-=document.body.offsetTop;for(e=a.offsetParent;e&&e!=document.body;){b[0]-=e.scrollLeft;if("opera"!=c||"TR"!=e.tagName)b[1]-=e.scrollTop;e=e.offsetParent}}return b}; +OpenLayers.Util.getViewportElement=function(){var a=arguments.callee.viewportElement;void 0==a&&(a="msie"==OpenLayers.BROWSER_NAME&&"CSS1Compat"!=document.compatMode?document.body:document.documentElement,arguments.callee.viewportElement=a);return a}; +OpenLayers.Util.isEquivalentUrl=function(a,b,c){c=c||{};OpenLayers.Util.applyDefaults(c,{ignoreCase:!0,ignorePort80:!0,ignoreHash:!0,splitArgs:!1});a=OpenLayers.Util.createUrlObject(a,c);b=OpenLayers.Util.createUrlObject(b,c);for(var d in a)if("args"!==d&&a[d]!=b[d])return!1;for(d in a.args){if(a.args[d]!=b.args[d])return!1;delete b.args[d]}for(d in b.args)return!1;return!0}; +OpenLayers.Util.createUrlObject=function(a,b){b=b||{};if(!/^\w+:\/\//.test(a)){var c=window.location,d=c.port?":"+c.port:"",d=c.protocol+"//"+c.host.split(":").shift()+d;0===a.indexOf("/")?a=d+a:(c=c.pathname.split("/"),c.pop(),a=d+c.join("/")+"/"+a)}b.ignoreCase&&(a=a.toLowerCase());c=document.createElement("a");c.href=a;d={};d.host=c.host.split(":").shift();d.protocol=c.protocol;d.port=b.ignorePort80?"80"==c.port||"0"==c.port?"":c.port:""==c.port||"0"==c.port?"80":c.port;d.hash=b.ignoreHash||"#"=== +c.hash?"":c.hash;var e=c.search;e||(e=a.indexOf("?"),e=-1!=e?a.substr(e):"");d.args=OpenLayers.Util.getParameters(e,{splitArgs:b.splitArgs});d.pathname="/"==c.pathname.charAt(0)?c.pathname:"/"+c.pathname;return d};OpenLayers.Util.removeTail=function(a){var b=null,b=a.indexOf("?"),c=a.indexOf("#");return b=-1==b?-1!=c?a.substr(0,c):a:-1!=c?a.substr(0,Math.min(b,c)):a.substr(0,b)};OpenLayers.IS_GECKO=function(){var a=navigator.userAgent.toLowerCase();return-1==a.indexOf("webkit")&&-1!=a.indexOf("gecko")}(); +OpenLayers.CANVAS_SUPPORTED=function(){var a=document.createElement("canvas");return!(!a.getContext||!a.getContext("2d"))}();OpenLayers.BROWSER_NAME=function(){var a="",b=navigator.userAgent.toLowerCase();-1!=b.indexOf("opera")?a="opera":-1!=b.indexOf("msie")?a="msie":-1!=b.indexOf("safari")?a="safari":-1!=b.indexOf("mozilla")&&(a=-1!=b.indexOf("firefox")?"firefox":"mozilla");return a}();OpenLayers.Util.getBrowserName=function(){return OpenLayers.BROWSER_NAME}; +OpenLayers.Util.getRenderedDimensions=function(a,b,c){var d,e,f=document.createElement("div");f.style.visibility="hidden";for(var g=c&&c.containerElement?c.containerElement:document.body,h=!1,k=null,l=g;l&&"body"!=l.tagName.toLowerCase();){var m=OpenLayers.Element.getStyle(l,"position");if("absolute"==m){h=!0;break}else if(m&&"static"!=m)break;l=l.parentNode}!h||0!==g.clientHeight&&0!==g.clientWidth||(k=document.createElement("div"),k.style.visibility="hidden",k.style.position="absolute",k.style.overflow= +"visible",k.style.width=document.body.clientWidth+"px",k.style.height=document.body.clientHeight+"px",k.appendChild(f));f.style.position="absolute";b&&(b.w?(d=b.w,f.style.width=d+"px"):b.h&&(e=b.h,f.style.height=e+"px"));c&&c.displayClass&&(f.className=c.displayClass);b=document.createElement("div");b.innerHTML=a;b.style.overflow="visible";if(b.childNodes)for(a=0,c=b.childNodes.length;a<c;a++)b.childNodes[a].style&&(b.childNodes[a].style.overflow="visible");f.appendChild(b);k?g.appendChild(k):g.appendChild(f); +d||(d=parseInt(b.scrollWidth),f.style.width=d+"px");e||(e=parseInt(b.scrollHeight));f.removeChild(b);k?(k.removeChild(f),g.removeChild(k)):g.removeChild(f);return new OpenLayers.Size(d,e)}; +OpenLayers.Util.getScrollbarWidth=function(){var a=OpenLayers.Util._scrollbarWidth;if(null==a){var b=null,c=null,b=a=0,b=document.createElement("div");b.style.position="absolute";b.style.top="-1000px";b.style.left="-1000px";b.style.width="100px";b.style.height="50px";b.style.overflow="hidden";c=document.createElement("div");c.style.width="100%";c.style.height="200px";b.appendChild(c);document.body.appendChild(b);a=c.offsetWidth;b.style.overflow="scroll";b=c.offsetWidth;document.body.removeChild(document.body.lastChild); +OpenLayers.Util._scrollbarWidth=a-b;a=OpenLayers.Util._scrollbarWidth}return a}; +OpenLayers.Util.getFormattedLonLat=function(a,b,c){c||(c="dms");a=(a+540)%360-180;var d=Math.abs(a),e=Math.floor(d),f=d=(d-e)/(1/60),d=Math.floor(d),f=Math.round(10*((f-d)/(1/60))),f=f/10;60<=f&&(f-=60,d+=1,60<=d&&(d-=60,e+=1));10>e&&(e="0"+e);e+="\u00b0";0<=c.indexOf("dm")&&(10>d&&(d="0"+d),e+=d+"'",0<=c.indexOf("dms")&&(10>f&&(f="0"+f),e+=f+'"'));return e="lon"==b?e+(0>a?OpenLayers.i18n("W"):OpenLayers.i18n("E")):e+(0>a?OpenLayers.i18n("S"):OpenLayers.i18n("N"))};OpenLayers.Format=OpenLayers.Class({options:null,externalProjection:null,internalProjection:null,data:null,keepData:!1,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a},destroy:function(){},read:function(a){throw Error("Read not implemented.");},write:function(a){throw Error("Write not implemented.");},CLASS_NAME:"OpenLayers.Format"});OpenLayers.Format.CSWGetRecords=function(a){a=OpenLayers.Util.applyDefaults(a,OpenLayers.Format.CSWGetRecords.DEFAULTS);var b=OpenLayers.Format.CSWGetRecords["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported CSWGetRecords version: "+a.version;return new b(a)};OpenLayers.Format.CSWGetRecords.DEFAULTS={version:"2.0.2"};OpenLayers.Control=OpenLayers.Class({id:null,map:null,div:null,type:null,allowSelection:!1,displayClass:"",title:"",autoActivate:!1,active:null,handlerOptions:null,handler:null,eventListeners:null,events:null,initialize:function(a){this.displayClass=this.CLASS_NAME.replace("OpenLayers.","ol").replace(/\./g,"");OpenLayers.Util.extend(this,a);this.events=new OpenLayers.Events(this);if(this.eventListeners instanceof Object)this.events.on(this.eventListeners);null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+ +"_"))},destroy:function(){this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy(),this.events=null);this.eventListeners=null;this.handler&&(this.handler.destroy(),this.handler=null);if(this.handlers){for(var a in this.handlers)this.handlers.hasOwnProperty(a)&&"function"==typeof this.handlers[a].destroy&&this.handlers[a].destroy();this.handlers=null}this.map&&(this.map.removeControl(this),this.map=null);this.div=null},setMap:function(a){this.map=a;this.handler&& +this.handler.setMap(a)},draw:function(a){null==this.div&&(this.div=OpenLayers.Util.createDiv(this.id),this.div.className=this.displayClass,this.allowSelection||(this.div.className+=" olControlNoSelect",this.div.setAttribute("unselectable","on",0),this.div.onselectstart=OpenLayers.Function.False),""!=this.title&&(this.div.title=this.title));null!=a&&(this.position=a.clone());this.moveTo(this.position);return this.div},moveTo:function(a){null!=a&&null!=this.div&&(this.div.style.left=a.x+"px",this.div.style.top= +a.y+"px")},activate:function(){if(this.active)return!1;this.handler&&this.handler.activate();this.active=!0;this.map&&OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active");this.events.triggerEvent("activate");return!0},deactivate:function(){return this.active?(this.handler&&this.handler.deactivate(),this.active=!1,this.map&&OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass.replace(/ /g,"")+"Active"),this.events.triggerEvent("deactivate"), +!0):!1},CLASS_NAME:"OpenLayers.Control"});OpenLayers.Control.TYPE_BUTTON=1;OpenLayers.Control.TYPE_TOGGLE=2;OpenLayers.Control.TYPE_TOOL=3;OpenLayers.Event={observers:!1,KEY_SPACE:32,KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,element:function(a){return a.target||a.srcElement},isSingleTouch:function(a){return a.touches&&1==a.touches.length},isMultiTouch:function(a){return a.touches&&1<a.touches.length},isLeftClick:function(a){return a.which&&1==a.which||a.button&&1==a.button},isRightClick:function(a){return a.which&&3==a.which||a.button&&2==a.button},stop:function(a, +b){b||OpenLayers.Event.preventDefault(a);a.stopPropagation?a.stopPropagation():a.cancelBubble=!0},preventDefault:function(a){a.preventDefault?a.preventDefault():a.returnValue=!1},findElement:function(a,b){for(var c=OpenLayers.Event.element(a);c.parentNode&&(!c.tagName||c.tagName.toUpperCase()!=b.toUpperCase());)c=c.parentNode;return c},observe:function(a,b,c,d){a=OpenLayers.Util.getElement(a);d=d||!1;"keypress"==b&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.attachEvent)&&(b="keydown"); +this.observers||(this.observers={});if(!a._eventCacheID){var e="eventCacheID_";a.id&&(e=a.id+"_"+e);a._eventCacheID=OpenLayers.Util.createUniqueID(e)}e=a._eventCacheID;this.observers[e]||(this.observers[e]=[]);this.observers[e].push({element:a,name:b,observer:c,useCapture:d});a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},stopObservingElement:function(a){a=OpenLayers.Util.getElement(a)._eventCacheID;this._removeElementObservers(OpenLayers.Event.observers[a])}, +_removeElementObservers:function(a){if(a)for(var b=a.length-1;0<=b;b--){var c=a[b];OpenLayers.Event.stopObserving.apply(this,[c.element,c.name,c.observer,c.useCapture])}},stopObserving:function(a,b,c,d){d=d||!1;a=OpenLayers.Util.getElement(a);var e=a._eventCacheID;"keypress"==b&&(navigator.appVersion.match(/Konqueror|Safari|KHTML/)||a.detachEvent)&&(b="keydown");var f=!1,g=OpenLayers.Event.observers[e];if(g)for(var h=0;!f&&h<g.length;){var k=g[h];if(k.name==b&&k.observer==c&&k.useCapture==d){g.splice(h, +1);0==g.length&&delete OpenLayers.Event.observers[e];f=!0;break}h++}f&&(a.removeEventListener?a.removeEventListener(b,c,d):a&&a.detachEvent&&a.detachEvent("on"+b,c));return f},unloadCache:function(){if(OpenLayers.Event&&OpenLayers.Event.observers){for(var a in OpenLayers.Event.observers)OpenLayers.Event._removeElementObservers.apply(this,[OpenLayers.Event.observers[a]]);OpenLayers.Event.observers=!1}},CLASS_NAME:"OpenLayers.Event"}; +OpenLayers.Event.observe(window,"unload",OpenLayers.Event.unloadCache,!1); +OpenLayers.Events=OpenLayers.Class({BROWSER_EVENTS:"mouseover mouseout mousedown mouseup mousemove click dblclick rightclick dblrightclick resize focus blur touchstart touchmove touchend keydown".split(" "),listeners:null,object:null,element:null,eventHandler:null,fallThrough:null,includeXY:!1,extensions:null,extensionCount:null,clearMouseListener:null,initialize:function(a,b,c,d,e){OpenLayers.Util.extend(this,e);this.object=a;this.fallThrough=d;this.listeners={};this.extensions={};this.extensionCount= +{};this._msTouches=[];null!=b&&this.attachToElement(b)},destroy:function(){for(var a in this.extensions)"boolean"!==typeof this.extensions[a]&&this.extensions[a].destroy();this.extensions=null;this.element&&(OpenLayers.Event.stopObservingElement(this.element),this.element.hasScrollEvent&&OpenLayers.Event.stopObserving(window,"scroll",this.clearMouseListener));this.eventHandler=this.fallThrough=this.object=this.listeners=this.element=null},addEventType:function(a){},attachToElement:function(a){this.element? +OpenLayers.Event.stopObservingElement(this.element):(this.eventHandler=OpenLayers.Function.bindAsEventListener(this.handleBrowserEvent,this),this.clearMouseListener=OpenLayers.Function.bind(this.clearMouseCache,this));this.element=a;for(var b=!!window.navigator.msMaxTouchPoints,c,d=0,e=this.BROWSER_EVENTS.length;d<e;d++)c=this.BROWSER_EVENTS[d],OpenLayers.Event.observe(a,c,this.eventHandler),b&&0===c.indexOf("touch")&&this.addMsTouchListener(a,c,this.eventHandler);OpenLayers.Event.observe(a,"dragstart", +OpenLayers.Event.stop)},on:function(a){for(var b in a)"scope"!=b&&a.hasOwnProperty(b)&&this.register(b,a.scope,a[b])},register:function(a,b,c,d){a in OpenLayers.Events&&!this.extensions[a]&&(this.extensions[a]=new OpenLayers.Events[a](this));if(null!=c){null==b&&(b=this.object);var e=this.listeners[a];e||(e=[],this.listeners[a]=e,this.extensionCount[a]=0);b={obj:b,func:c};d?(e.splice(this.extensionCount[a],0,b),"object"===typeof d&&d.extension&&this.extensionCount[a]++):e.push(b)}},registerPriority:function(a, +b,c){this.register(a,b,c,!0)},un:function(a){for(var b in a)"scope"!=b&&a.hasOwnProperty(b)&&this.unregister(b,a.scope,a[b])},unregister:function(a,b,c){null==b&&(b=this.object);a=this.listeners[a];if(null!=a)for(var d=0,e=a.length;d<e;d++)if(a[d].obj==b&&a[d].func==c){a.splice(d,1);break}},remove:function(a){null!=this.listeners[a]&&(this.listeners[a]=[])},triggerEvent:function(a,b){var c=this.listeners[a];if(c&&0!=c.length){null==b&&(b={});b.object=this.object;b.element=this.element;b.type||(b.type= +a);for(var c=c.slice(),d,e=0,f=c.length;e<f&&(d=c[e],d=d.func.apply(d.obj,[b]),void 0==d||!1!=d);e++);this.fallThrough||OpenLayers.Event.stop(b,!0);return d}},handleBrowserEvent:function(a){var b=a.type,c=this.listeners[b];if(c&&0!=c.length){if((c=a.touches)&&c[0]){for(var d=0,e=0,f=c.length,g,h=0;h<f;++h)g=this.getTouchClientXY(c[h]),d+=g.clientX,e+=g.clientY;a.clientX=d/f;a.clientY=e/f}this.includeXY&&(a.xy=this.getMousePosition(a));this.triggerEvent(b,a)}},getTouchClientXY:function(a){var b=window.olMockWin|| +window,c=b.pageXOffset,b=b.pageYOffset,d=a.clientX,e=a.clientY;if(0===a.pageY&&Math.floor(e)>Math.floor(a.pageY)||0===a.pageX&&Math.floor(d)>Math.floor(a.pageX))d-=c,e-=b;else if(e<a.pageY-b||d<a.pageX-c)d=a.pageX-c,e=a.pageY-b;a.olClientX=d;a.olClientY=e;return{clientX:d,clientY:e}},clearMouseCache:function(){this.element.scrolls=null;this.element.lefttop=null;this.element.offsets=null},getMousePosition:function(a){this.includeXY?this.element.hasScrollEvent||(OpenLayers.Event.observe(window,"scroll", +this.clearMouseListener),this.element.hasScrollEvent=!0):this.clearMouseCache();if(!this.element.scrolls){var b=OpenLayers.Util.getViewportElement();this.element.scrolls=[window.pageXOffset||b.scrollLeft,window.pageYOffset||b.scrollTop]}this.element.lefttop||(this.element.lefttop=[document.documentElement.clientLeft||0,document.documentElement.clientTop||0]);this.element.offsets||(this.element.offsets=OpenLayers.Util.pagePosition(this.element));return new OpenLayers.Pixel(a.clientX+this.element.scrolls[0]- +this.element.offsets[0]-this.element.lefttop[0],a.clientY+this.element.scrolls[1]-this.element.offsets[1]-this.element.lefttop[1])},addMsTouchListener:function(a,b,c){function d(a){c(OpenLayers.Util.applyDefaults({stopPropagation:function(){for(var a=e.length-1;0<=a;--a)e[a].stopPropagation()},preventDefault:function(){for(var a=e.length-1;0<=a;--a)e[a].preventDefault()},type:b},a))}var e=this._msTouches;switch(b){case "touchstart":return this.addMsTouchListenerStart(a,b,d);case "touchend":return this.addMsTouchListenerEnd(a, +b,d);case "touchmove":return this.addMsTouchListenerMove(a,b,d);default:throw"Unknown touch event type";}},addMsTouchListenerStart:function(a,b,c){var d=this._msTouches;OpenLayers.Event.observe(a,"MSPointerDown",function(a){for(var b=!1,g=0,h=d.length;g<h;++g)if(d[g].pointerId==a.pointerId){b=!0;break}b||d.push(a);a.touches=d.slice();c(a)});OpenLayers.Event.observe(a,"MSPointerUp",function(a){for(var b=0,c=d.length;b<c;++b)if(d[b].pointerId==a.pointerId){d.splice(b,1);break}})},addMsTouchListenerMove:function(a, +b,c){var d=this._msTouches;OpenLayers.Event.observe(a,"MSPointerMove",function(a){if(a.pointerType!=a.MSPOINTER_TYPE_MOUSE||0!=a.buttons)if(1!=d.length||d[0].pageX!=a.pageX||d[0].pageY!=a.pageY){for(var b=0,g=d.length;b<g;++b)if(d[b].pointerId==a.pointerId){d[b]=a;break}a.touches=d.slice();c(a)}})},addMsTouchListenerEnd:function(a,b,c){var d=this._msTouches;OpenLayers.Event.observe(a,"MSPointerUp",function(a){for(var b=0,g=d.length;b<g;++b)if(d[b].pointerId==a.pointerId){d.splice(b,1);break}a.touches= +d.slice();c(a)})},CLASS_NAME:"OpenLayers.Events"});OpenLayers.Events.buttonclick=OpenLayers.Class({target:null,events:"mousedown mouseup click dblclick touchstart touchmove touchend keydown".split(" "),startRegEx:/^mousedown|touchstart$/,cancelRegEx:/^touchmove$/,completeRegEx:/^mouseup|touchend$/,initialize:function(a){this.target=a;for(a=this.events.length-1;0<=a;--a)this.target.register(this.events[a],this,this.buttonClick,{extension:!0})},destroy:function(){for(var a=this.events.length-1;0<=a;--a)this.target.unregister(this.events[a],this,this.buttonClick); +delete this.target},getPressedButton:function(a){var b=3,c;do{if(OpenLayers.Element.hasClass(a,"olButton")){c=a;break}a=a.parentNode}while(0<--b&&a);return c},ignore:function(a){var b=3,c=!1;do{if("a"===a.nodeName.toLowerCase()){c=!0;break}a=a.parentNode}while(0<--b&&a);return c},buttonClick:function(a){var b=!0,c=OpenLayers.Event.element(a);if(c&&(OpenLayers.Event.isLeftClick(a)||!~a.type.indexOf("mouse")))if(c=this.getPressedButton(c)){if("keydown"===a.type)switch(a.keyCode){case OpenLayers.Event.KEY_RETURN:case OpenLayers.Event.KEY_SPACE:this.target.triggerEvent("buttonclick", +{buttonElement:c}),OpenLayers.Event.stop(a),b=!1}else if(this.startEvt){if(this.completeRegEx.test(a.type)){var b=OpenLayers.Util.pagePosition(c),d=OpenLayers.Util.getViewportElement(),e=window.pageYOffset||d.scrollTop;b[0]-=window.pageXOffset||d.scrollLeft;b[1]-=e;this.target.triggerEvent("buttonclick",{buttonElement:c,buttonXY:{x:this.startEvt.clientX-b[0],y:this.startEvt.clientY-b[1]}})}this.cancelRegEx.test(a.type)&&delete this.startEvt;OpenLayers.Event.stop(a);b=!1}this.startRegEx.test(a.type)&& +(this.startEvt=a,OpenLayers.Event.stop(a),b=!1)}else b=!this.ignore(OpenLayers.Event.element(a)),delete this.startEvt;return b}});OpenLayers.Util=OpenLayers.Util||{}; +OpenLayers.Util.vendorPrefix=function(){function a(a){return a?a.replace(/([A-Z])/g,function(a){return"-"+a.toLowerCase()}).replace(/^ms-/,"-ms-"):null}function b(a,b){if(void 0===g[b]){var c,e=0,f=d.length,p="undefined"!==typeof a.cssText;for(g[b]=null;e<f;e++)if((c=d[e])?(p||(c=c.toLowerCase()),c=c+b.charAt(0).toUpperCase()+b.slice(1)):c=b,void 0!==a[c]){g[b]=c;break}}return g[b]}function c(a){return b(e,a)}var d=["","O","ms","Moz","Webkit"],e=document.createElement("div").style,f={},g={};return{css:function(b){if(void 0=== +f[b]){var d=b.replace(/(-[\s\S])/g,function(a){return a.charAt(1).toUpperCase()}),d=c(d);f[b]=a(d)}return f[b]},js:b,style:c,cssCache:f,jsCache:g}}();OpenLayers.Animation=function(a){var b=OpenLayers.Util.vendorPrefix.js(a,"requestAnimationFrame"),c=!!b,d=function(){var c=a[b]||function(b,c){a.setTimeout(b,16)};return function(b,d){c.apply(a,[b,d])}}(),e=0,f={};return{isNative:c,requestFrame:d,start:function(a,b,c){b=0<b?b:Number.POSITIVE_INFINITY;var l=++e,m=+new Date;f[l]=function(){f[l]&&+new Date-m<=b?(a(),f[l]&&d(f[l],c)):delete f[l]};d(f[l],c);return l},stop:function(a){delete f[a]}}}(window);OpenLayers.Tween=OpenLayers.Class({easing:null,begin:null,finish:null,duration:null,callbacks:null,time:null,minFrameRate:null,startTime:null,animationId:null,playing:!1,initialize:function(a){this.easing=a?a:OpenLayers.Easing.Expo.easeOut},start:function(a,b,c,d){this.playing=!0;this.begin=a;this.finish=b;this.duration=c;this.callbacks=d.callbacks;this.minFrameRate=d.minFrameRate||30;this.time=0;this.startTime=(new Date).getTime();OpenLayers.Animation.stop(this.animationId);this.animationId=null; +this.callbacks&&this.callbacks.start&&this.callbacks.start.call(this,this.begin);this.animationId=OpenLayers.Animation.start(OpenLayers.Function.bind(this.play,this))},stop:function(){this.playing&&(this.callbacks&&this.callbacks.done&&this.callbacks.done.call(this,this.finish),OpenLayers.Animation.stop(this.animationId),this.animationId=null,this.playing=!1)},play:function(){var a={},b;for(b in this.begin){var c=this.begin[b],d=this.finish[b];if(null==c||null==d||isNaN(c)||isNaN(d))throw new TypeError("invalid value for Tween"); +a[b]=this.easing.apply(this,[this.time,c,d-c,this.duration])}this.time++;this.callbacks&&this.callbacks.eachStep&&((new Date).getTime()-this.startTime)/this.time<=1E3/this.minFrameRate&&this.callbacks.eachStep.call(this,a);this.time>this.duration&&this.stop()},CLASS_NAME:"OpenLayers.Tween"});OpenLayers.Easing={CLASS_NAME:"OpenLayers.Easing"};OpenLayers.Easing.Linear={easeIn:function(a,b,c,d){return c*a/d+b},easeOut:function(a,b,c,d){return c*a/d+b},easeInOut:function(a,b,c,d){return c*a/d+b},CLASS_NAME:"OpenLayers.Easing.Linear"}; +OpenLayers.Easing.Expo={easeIn:function(a,b,c,d){return 0==a?b:c*Math.pow(2,10*(a/d-1))+b},easeOut:function(a,b,c,d){return a==d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b},easeInOut:function(a,b,c,d){return 0==a?b:a==d?b+c:1>(a/=d/2)?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b},CLASS_NAME:"OpenLayers.Easing.Expo"}; +OpenLayers.Easing.Quad={easeIn:function(a,b,c,d){return c*(a/=d)*a+b},easeOut:function(a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOut:function(a,b,c,d){return 1>(a/=d/2)?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},CLASS_NAME:"OpenLayers.Easing.Quad"};OpenLayers.Projection=OpenLayers.Class({proj:null,projCode:null,titleRegEx:/\+title=[^\+]*/,initialize:function(a,b){OpenLayers.Util.extend(this,b);this.projCode=a;"object"==typeof Proj4js&&(this.proj=new Proj4js.Proj(a))},getCode:function(){return this.proj?this.proj.srsCode:this.projCode},getUnits:function(){return this.proj?this.proj.units:null},toString:function(){return this.getCode()},equals:function(a){var b=!1;a&&(a instanceof OpenLayers.Projection||(a=new OpenLayers.Projection(a)),"object"== +typeof Proj4js&&this.proj.defData&&a.proj.defData?b=this.proj.defData.replace(this.titleRegEx,"")==a.proj.defData.replace(this.titleRegEx,""):a.getCode&&(b=this.getCode(),a=a.getCode(),b=b==a||!!OpenLayers.Projection.transforms[b]&&OpenLayers.Projection.transforms[b][a]===OpenLayers.Projection.nullTransform));return b},destroy:function(){delete this.proj;delete this.projCode},CLASS_NAME:"OpenLayers.Projection"});OpenLayers.Projection.transforms={}; +OpenLayers.Projection.defaults={"EPSG:4326":{units:"degrees",maxExtent:[-180,-90,180,90],yx:!0},"CRS:84":{units:"degrees",maxExtent:[-180,-90,180,90]},"EPSG:900913":{units:"m",maxExtent:[-2.003750834E7,-2.003750834E7,2.003750834E7,2.003750834E7]}}; +OpenLayers.Projection.addTransform=function(a,b,c){if(c===OpenLayers.Projection.nullTransform){var d=OpenLayers.Projection.defaults[a];d&&!OpenLayers.Projection.defaults[b]&&(OpenLayers.Projection.defaults[b]=d)}OpenLayers.Projection.transforms[a]||(OpenLayers.Projection.transforms[a]={});OpenLayers.Projection.transforms[a][b]=c}; +OpenLayers.Projection.transform=function(a,b,c){if(b&&c)if(b instanceof OpenLayers.Projection||(b=new OpenLayers.Projection(b)),c instanceof OpenLayers.Projection||(c=new OpenLayers.Projection(c)),b.proj&&c.proj)a=Proj4js.transform(b.proj,c.proj,a);else{b=b.getCode();c=c.getCode();var d=OpenLayers.Projection.transforms;if(d[b]&&d[b][c])d[b][c](a)}return a};OpenLayers.Projection.nullTransform=function(a){return a}; +(function(){function a(a){a.x=180*a.x/d;a.y=180/Math.PI*(2*Math.atan(Math.exp(a.y/d*Math.PI))-Math.PI/2);return a}function b(a){a.x=a.x*d/180;var b=Math.log(Math.tan((90+a.y)*Math.PI/360))/Math.PI*d;a.y=Math.max(-2.003750834E7,Math.min(b,2.003750834E7));return a}function c(c,d){var e=OpenLayers.Projection.addTransform,f=OpenLayers.Projection.nullTransform,g,p,q,r,s;g=0;for(p=d.length;g<p;++g)for(q=d[g],e(c,q,b),e(q,c,a),s=g+1;s<p;++s)r=d[s],e(q,r,f),e(r,q,f)}var d=2.003750834E7,e=["EPSG:900913","EPSG:3857", +"EPSG:102113","EPSG:102100"],f=["CRS:84","urn:ogc:def:crs:EPSG:6.6:4326","EPSG:4326"],g;for(g=e.length-1;0<=g;--g)c(e[g],f);for(g=f.length-1;0<=g;--g)c(f[g],e)})();OpenLayers.Map=OpenLayers.Class({Z_INDEX_BASE:{BaseLayer:100,Overlay:325,Feature:725,Popup:750,Control:1E3},id:null,fractionalZoom:!1,events:null,allOverlays:!1,div:null,dragging:!1,size:null,viewPortDiv:null,layerContainerOrigin:null,layerContainerDiv:null,layers:null,controls:null,popups:null,baseLayer:null,center:null,resolution:null,zoom:0,panRatio:1.5,options:null,tileSize:null,projection:"EPSG:4326",units:null,resolutions:null,maxResolution:null,minResolution:null,maxScale:null,minScale:null, +maxExtent:null,minExtent:null,restrictedExtent:null,numZoomLevels:16,theme:null,displayProjection:null,fallThrough:!1,autoUpdateSize:!0,eventListeners:null,panTween:null,panMethod:OpenLayers.Easing.Expo.easeOut,panDuration:50,zoomTween:null,zoomMethod:OpenLayers.Easing.Quad.easeOut,zoomDuration:20,paddingForPopups:null,layerContainerOriginPx:null,minPx:null,maxPx:null,initialize:function(a,b){1===arguments.length&&"object"===typeof a&&(a=(b=a)&&b.div);this.tileSize=new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH, +OpenLayers.Map.TILE_HEIGHT);this.paddingForPopups=new OpenLayers.Bounds(15,15,15,15);this.theme=OpenLayers._getScriptLocation()+"theme/default/style.css";this.options=OpenLayers.Util.extend({},b);OpenLayers.Util.extend(this,b);OpenLayers.Util.applyDefaults(this,OpenLayers.Projection.defaults[this.projection instanceof OpenLayers.Projection?this.projection.projCode:this.projection]);!this.maxExtent||this.maxExtent instanceof OpenLayers.Bounds||(this.maxExtent=new OpenLayers.Bounds(this.maxExtent)); +!this.minExtent||this.minExtent instanceof OpenLayers.Bounds||(this.minExtent=new OpenLayers.Bounds(this.minExtent));!this.restrictedExtent||this.restrictedExtent instanceof OpenLayers.Bounds||(this.restrictedExtent=new OpenLayers.Bounds(this.restrictedExtent));!this.center||this.center instanceof OpenLayers.LonLat||(this.center=new OpenLayers.LonLat(this.center));this.layers=[];this.id=OpenLayers.Util.createUniqueID("OpenLayers.Map_");this.div=OpenLayers.Util.getElement(a);this.div||(this.div=document.createElement("div"), +this.div.style.height="1px",this.div.style.width="1px");OpenLayers.Element.addClass(this.div,"olMap");var c=this.id+"_OpenLayers_ViewPort";this.viewPortDiv=OpenLayers.Util.createDiv(c,null,null,null,"relative",null,"hidden");this.viewPortDiv.style.width="100%";this.viewPortDiv.style.height="100%";this.viewPortDiv.className="olMapViewport";this.div.appendChild(this.viewPortDiv);this.events=new OpenLayers.Events(this,this.viewPortDiv,null,this.fallThrough,{includeXY:!0});OpenLayers.TileManager&&null!== +this.tileManager&&(this.tileManager instanceof OpenLayers.TileManager||(this.tileManager=new OpenLayers.TileManager(this.tileManager)),this.tileManager.addMap(this));c=this.id+"_OpenLayers_Container";this.layerContainerDiv=OpenLayers.Util.createDiv(c);this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE.Popup-1;this.layerContainerOriginPx={x:0,y:0};this.applyTransform();this.viewPortDiv.appendChild(this.layerContainerDiv);this.updateSize();if(this.eventListeners instanceof Object)this.events.on(this.eventListeners); +!0===this.autoUpdateSize&&(this.updateSizeDestroy=OpenLayers.Function.bind(this.updateSize,this),OpenLayers.Event.observe(window,"resize",this.updateSizeDestroy));if(this.theme){for(var c=!0,d=document.getElementsByTagName("link"),e=0,f=d.length;e<f;++e)if(OpenLayers.Util.isEquivalentUrl(d.item(e).href,this.theme)){c=!1;break}c&&(c=document.createElement("link"),c.setAttribute("rel","stylesheet"),c.setAttribute("type","text/css"),c.setAttribute("href",this.theme),document.getElementsByTagName("head")[0].appendChild(c))}null== +this.controls&&(this.controls=[],null!=OpenLayers.Control&&(OpenLayers.Control.Navigation?this.controls.push(new OpenLayers.Control.Navigation):OpenLayers.Control.TouchNavigation&&this.controls.push(new OpenLayers.Control.TouchNavigation),OpenLayers.Control.Zoom?this.controls.push(new OpenLayers.Control.Zoom):OpenLayers.Control.PanZoom&&this.controls.push(new OpenLayers.Control.PanZoom),OpenLayers.Control.ArgParser&&this.controls.push(new OpenLayers.Control.ArgParser),OpenLayers.Control.Attribution&& +this.controls.push(new OpenLayers.Control.Attribution)));e=0;for(f=this.controls.length;e<f;e++)this.addControlToMap(this.controls[e]);this.popups=[];this.unloadDestroy=OpenLayers.Function.bind(this.destroy,this);OpenLayers.Event.observe(window,"unload",this.unloadDestroy);b&&b.layers&&(delete this.center,delete this.zoom,this.addLayers(b.layers),b.center&&!this.getCenter()&&this.setCenter(b.center,b.zoom));this.panMethod&&(this.panTween=new OpenLayers.Tween(this.panMethod));this.zoomMethod&&this.applyTransform.transform&& +(this.zoomTween=new OpenLayers.Tween(this.zoomMethod))},getViewport:function(){return this.viewPortDiv},render:function(a){this.div=OpenLayers.Util.getElement(a);OpenLayers.Element.addClass(this.div,"olMap");this.viewPortDiv.parentNode.removeChild(this.viewPortDiv);this.div.appendChild(this.viewPortDiv);this.updateSize()},unloadDestroy:null,updateSizeDestroy:null,destroy:function(){if(!this.unloadDestroy)return!1;this.panTween&&(this.panTween.stop(),this.panTween=null);this.zoomTween&&(this.zoomTween.stop(), +this.zoomTween=null);OpenLayers.Event.stopObserving(window,"unload",this.unloadDestroy);this.unloadDestroy=null;this.updateSizeDestroy&&OpenLayers.Event.stopObserving(window,"resize",this.updateSizeDestroy);this.paddingForPopups=null;if(null!=this.controls){for(var a=this.controls.length-1;0<=a;--a)this.controls[a].destroy();this.controls=null}if(null!=this.layers){for(a=this.layers.length-1;0<=a;--a)this.layers[a].destroy(!1);this.layers=null}this.viewPortDiv&&this.viewPortDiv.parentNode&&this.viewPortDiv.parentNode.removeChild(this.viewPortDiv); +this.viewPortDiv=null;this.tileManager&&(this.tileManager.removeMap(this),this.tileManager=null);this.eventListeners&&(this.events.un(this.eventListeners),this.eventListeners=null);this.events.destroy();this.options=this.events=null},setOptions:function(a){var b=this.minPx&&a.restrictedExtent!=this.restrictedExtent;OpenLayers.Util.extend(this,a);b&&this.moveTo(this.getCachedCenter(),this.zoom,{forceZoomChange:!0})},getTileSize:function(){return this.tileSize},getBy:function(a,b,c){var d="function"== +typeof c.test;return OpenLayers.Array.filter(this[a],function(a){return a[b]==c||d&&c.test(a[b])})},getLayersBy:function(a,b){return this.getBy("layers",a,b)},getLayersByName:function(a){return this.getLayersBy("name",a)},getLayersByClass:function(a){return this.getLayersBy("CLASS_NAME",a)},getControlsBy:function(a,b){return this.getBy("controls",a,b)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},getLayer:function(a){for(var b=null,c=0,d=this.layers.length;c<d;c++){var e= +this.layers[c];if(e.id==a){b=e;break}}return b},setLayerZIndex:function(a,b){a.setZIndex(this.Z_INDEX_BASE[a.isBaseLayer?"BaseLayer":"Overlay"]+5*b)},resetLayersZIndex:function(){for(var a=0,b=this.layers.length;a<b;a++)this.setLayerZIndex(this.layers[a],a)},addLayer:function(a){for(var b=0,c=this.layers.length;b<c;b++)if(this.layers[b]==a)return!1;if(!1===this.events.triggerEvent("preaddlayer",{layer:a}))return!1;this.allOverlays&&(a.isBaseLayer=!1);a.div.className="olLayerDiv";a.div.style.overflow= +"";this.setLayerZIndex(a,this.layers.length);a.isFixed?this.viewPortDiv.appendChild(a.div):this.layerContainerDiv.appendChild(a.div);this.layers.push(a);a.setMap(this);a.isBaseLayer||this.allOverlays&&!this.baseLayer?null==this.baseLayer?this.setBaseLayer(a):a.setVisibility(!1):a.redraw();this.events.triggerEvent("addlayer",{layer:a});a.events.triggerEvent("added",{map:this,layer:a});a.afterAdd();return!0},addLayers:function(a){for(var b=0,c=a.length;b<c;b++)this.addLayer(a[b])},removeLayer:function(a, +b){if(!1!==this.events.triggerEvent("preremovelayer",{layer:a})){null==b&&(b=!0);a.isFixed?this.viewPortDiv.removeChild(a.div):this.layerContainerDiv.removeChild(a.div);OpenLayers.Util.removeItem(this.layers,a);a.removeMap(this);a.map=null;if(this.baseLayer==a&&(this.baseLayer=null,b))for(var c=0,d=this.layers.length;c<d;c++){var e=this.layers[c];if(e.isBaseLayer||this.allOverlays){this.setBaseLayer(e);break}}this.resetLayersZIndex();this.events.triggerEvent("removelayer",{layer:a});a.events.triggerEvent("removed", +{map:this,layer:a})}},getNumLayers:function(){return this.layers.length},getLayerIndex:function(a){return OpenLayers.Util.indexOf(this.layers,a)},setLayerIndex:function(a,b){var c=this.getLayerIndex(a);0>b?b=0:b>this.layers.length&&(b=this.layers.length);if(c!=b){this.layers.splice(c,1);this.layers.splice(b,0,a);for(var c=0,d=this.layers.length;c<d;c++)this.setLayerZIndex(this.layers[c],c);this.events.triggerEvent("changelayer",{layer:a,property:"order"});this.allOverlays&&(0===b?this.setBaseLayer(a): +this.baseLayer!==this.layers[0]&&this.setBaseLayer(this.layers[0]))}},raiseLayer:function(a,b){var c=this.getLayerIndex(a)+b;this.setLayerIndex(a,c)},setBaseLayer:function(a){if(a!=this.baseLayer&&-1!=OpenLayers.Util.indexOf(this.layers,a)){var b=this.getCachedCenter(),c=OpenLayers.Util.getResolutionFromScale(this.getScale(),a.units);null==this.baseLayer||this.allOverlays||this.baseLayer.setVisibility(!1);this.baseLayer=a;if(!this.allOverlays||this.baseLayer.visibility)this.baseLayer.setVisibility(!0), +!1===this.baseLayer.inRange&&this.baseLayer.redraw();null!=b&&(a=this.getZoomForResolution(c||this.resolution,!0),this.setCenter(b,a,!1,!0));this.events.triggerEvent("changebaselayer",{layer:this.baseLayer})}},addControl:function(a,b){this.controls.push(a);this.addControlToMap(a,b)},addControls:function(a,b){for(var c=1===arguments.length?[]:b,d=0,e=a.length;d<e;d++)this.addControl(a[d],c[d]?c[d]:null)},addControlToMap:function(a,b){a.outsideViewport=null!=a.div;this.displayProjection&&!a.displayProjection&& +(a.displayProjection=this.displayProjection);a.setMap(this);var c=a.draw(b);c&&!a.outsideViewport&&(c.style.zIndex=this.Z_INDEX_BASE.Control+this.controls.length,this.viewPortDiv.appendChild(c));a.autoActivate&&a.activate()},getControl:function(a){for(var b=null,c=0,d=this.controls.length;c<d;c++){var e=this.controls[c];if(e.id==a){b=e;break}}return b},removeControl:function(a){a&&a==this.getControl(a.id)&&(a.div&&a.div.parentNode==this.viewPortDiv&&this.viewPortDiv.removeChild(a.div),OpenLayers.Util.removeItem(this.controls, +a))},addPopup:function(a,b){if(b)for(var c=this.popups.length-1;0<=c;--c)this.removePopup(this.popups[c]);a.map=this;this.popups.push(a);if(c=a.draw())c.style.zIndex=this.Z_INDEX_BASE.Popup+this.popups.length,this.layerContainerDiv.appendChild(c)},removePopup:function(a){OpenLayers.Util.removeItem(this.popups,a);if(a.div)try{this.layerContainerDiv.removeChild(a.div)}catch(b){}a.map=null},getSize:function(){var a=null;null!=this.size&&(a=this.size.clone());return a},updateSize:function(){var a=this.getCurrentSize(); +if(a&&!isNaN(a.h)&&!isNaN(a.w)){this.events.clearMouseCache();var b=this.getSize();null==b&&(this.size=b=a);if(!a.equals(b)){this.size=a;a=0;for(b=this.layers.length;a<b;a++)this.layers[a].onMapResize();a=this.getCachedCenter();null!=this.baseLayer&&null!=a&&(b=this.getZoom(),this.zoom=null,this.setCenter(a,b))}}this.events.triggerEvent("updatesize")},getCurrentSize:function(){var a=new OpenLayers.Size(this.div.clientWidth,this.div.clientHeight);if(0==a.w&&0==a.h||isNaN(a.w)&&isNaN(a.h))a.w=this.div.offsetWidth, +a.h=this.div.offsetHeight;if(0==a.w&&0==a.h||isNaN(a.w)&&isNaN(a.h))a.w=parseInt(this.div.style.width),a.h=parseInt(this.div.style.height);return a},calculateBounds:function(a,b){var c=null;null==a&&(a=this.getCachedCenter());null==b&&(b=this.getResolution());if(null!=a&&null!=b)var c=this.size.w*b/2,d=this.size.h*b/2,c=new OpenLayers.Bounds(a.lon-c,a.lat-d,a.lon+c,a.lat+d);return c},getCenter:function(){var a=null,b=this.getCachedCenter();b&&(a=b.clone());return a},getCachedCenter:function(){!this.center&& +this.size&&(this.center=this.getLonLatFromViewPortPx({x:this.size.w/2,y:this.size.h/2}));return this.center},getZoom:function(){return this.zoom},pan:function(a,b,c){c=OpenLayers.Util.applyDefaults(c,{animate:!0,dragging:!1});if(c.dragging)0==a&&0==b||this.moveByPx(a,b);else{var d=this.getViewPortPxFromLonLat(this.getCachedCenter());a=d.add(a,b);if(this.dragging||!a.equals(d))d=this.getLonLatFromViewPortPx(a),c.animate?this.panTo(d):(this.moveTo(d),this.dragging&&(this.dragging=!1,this.events.triggerEvent("moveend")))}}, +panTo:function(a){if(this.panTween&&this.getExtent().scale(this.panRatio).containsLonLat(a)){var b=this.getCachedCenter();if(!a.equals(b)){var b=this.getPixelFromLonLat(b),c=this.getPixelFromLonLat(a),d=0,e=0;this.panTween.start({x:0,y:0},{x:c.x-b.x,y:c.y-b.y},this.panDuration,{callbacks:{eachStep:OpenLayers.Function.bind(function(a){this.moveByPx(a.x-d,a.y-e);d=Math.round(a.x);e=Math.round(a.y)},this),done:OpenLayers.Function.bind(function(b){this.moveTo(a);this.dragging=!1;this.events.triggerEvent("moveend")}, +this)}})}}else this.setCenter(a)},setCenter:function(a,b,c,d){this.panTween&&this.panTween.stop();this.zoomTween&&this.zoomTween.stop();this.moveTo(a,b,{dragging:c,forceZoomChange:d})},moveByPx:function(a,b){var c=this.size.w/2,d=this.size.h/2,e=c+a,f=d+b,g=this.baseLayer.wrapDateLine,h=0,k=0;this.restrictedExtent&&(h=c,k=d,g=!1);a=g||e<=this.maxPx.x-h&&e>=this.minPx.x+h?Math.round(a):0;b=f<=this.maxPx.y-k&&f>=this.minPx.y+k?Math.round(b):0;if(a||b){this.dragging||(this.dragging=!0,this.events.triggerEvent("movestart")); +this.center=null;a&&(this.layerContainerOriginPx.x-=a,this.minPx.x-=a,this.maxPx.x-=a);b&&(this.layerContainerOriginPx.y-=b,this.minPx.y-=b,this.maxPx.y-=b);this.applyTransform();d=0;for(e=this.layers.length;d<e;++d)c=this.layers[d],c.visibility&&(c===this.baseLayer||c.inRange)&&(c.moveByPx(a,b),c.events.triggerEvent("move"));this.events.triggerEvent("move")}},adjustZoom:function(a){if(this.baseLayer&&this.baseLayer.wrapDateLine){var b=this.baseLayer.resolutions,c=this.getMaxExtent().getWidth()/this.size.w; +if(this.getResolutionForZoom(a)>c)if(this.fractionalZoom)a=this.getZoomForResolution(c);else for(var d=a|0,e=b.length;d<e;++d)if(b[d]<=c){a=d;break}}return a},getMinZoom:function(){return this.adjustZoom(0)},moveTo:function(a,b,c){null==a||a instanceof OpenLayers.LonLat||(a=new OpenLayers.LonLat(a));c||(c={});null!=b&&(b=parseFloat(b),this.fractionalZoom||(b=Math.round(b)));var d=b;b=this.adjustZoom(b);b!==d&&(a=this.getCenter());var d=c.dragging||this.dragging,e=c.forceZoomChange;this.getCachedCenter()|| +this.isValidLonLat(a)||(a=this.maxExtent.getCenterLonLat(),this.center=a.clone());if(null!=this.restrictedExtent){null==a&&(a=this.center);null==b&&(b=this.getZoom());var f=this.getResolutionForZoom(b),f=this.calculateBounds(a,f);if(!this.restrictedExtent.containsBounds(f)){var g=this.restrictedExtent.getCenterLonLat();f.getWidth()>this.restrictedExtent.getWidth()?a=new OpenLayers.LonLat(g.lon,a.lat):f.left<this.restrictedExtent.left?a=a.add(this.restrictedExtent.left-f.left,0):f.right>this.restrictedExtent.right&& +(a=a.add(this.restrictedExtent.right-f.right,0));f.getHeight()>this.restrictedExtent.getHeight()?a=new OpenLayers.LonLat(a.lon,g.lat):f.bottom<this.restrictedExtent.bottom?a=a.add(0,this.restrictedExtent.bottom-f.bottom):f.top>this.restrictedExtent.top&&(a=a.add(0,this.restrictedExtent.top-f.top))}}e=e||this.isValidZoomLevel(b)&&b!=this.getZoom();f=this.isValidLonLat(a)&&!a.equals(this.center);if(e||f||d){d||this.events.triggerEvent("movestart",{zoomChanged:e});f&&(!e&&this.center&&this.centerLayerContainer(a), +this.center=a.clone());a=e?this.getResolutionForZoom(b):this.getResolution();if(e||null==this.layerContainerOrigin){this.layerContainerOrigin=this.getCachedCenter();this.layerContainerOriginPx.x=0;this.layerContainerOriginPx.y=0;this.applyTransform();var f=this.getMaxExtent({restricted:!0}),h=f.getCenterLonLat(),g=this.center.lon-h.lon,h=h.lat-this.center.lat,k=Math.round(f.getWidth()/a),l=Math.round(f.getHeight()/a);this.minPx={x:(this.size.w-k)/2-g/a,y:(this.size.h-l)/2-h/a};this.maxPx={x:this.minPx.x+ +Math.round(f.getWidth()/a),y:this.minPx.y+Math.round(f.getHeight()/a)}}e&&(this.zoom=b,this.resolution=a);a=this.getExtent();this.baseLayer.visibility&&(this.baseLayer.moveTo(a,e,c.dragging),c.dragging||this.baseLayer.events.triggerEvent("moveend",{zoomChanged:e}));a=this.baseLayer.getExtent();for(b=this.layers.length-1;0<=b;--b)f=this.layers[b],f===this.baseLayer||f.isBaseLayer||(g=f.calculateInRange(),f.inRange!=g&&((f.inRange=g)||f.display(!1),this.events.triggerEvent("changelayer",{layer:f,property:"visibility"})), +g&&f.visibility&&(f.moveTo(a,e,c.dragging),c.dragging||f.events.triggerEvent("moveend",{zoomChanged:e})));this.events.triggerEvent("move");d||this.events.triggerEvent("moveend");if(e){b=0;for(c=this.popups.length;b<c;b++)this.popups[b].updatePosition();this.events.triggerEvent("zoomend")}}},centerLayerContainer:function(a){var b=this.getViewPortPxFromLonLat(this.layerContainerOrigin),c=this.getViewPortPxFromLonLat(a);if(null!=b&&null!=c){var d=this.layerContainerOriginPx.x;a=this.layerContainerOriginPx.y; +var e=Math.round(b.x-c.x),b=Math.round(b.y-c.y);this.applyTransform(this.layerContainerOriginPx.x=e,this.layerContainerOriginPx.y=b);d-=e;a-=b;this.minPx.x-=d;this.maxPx.x-=d;this.minPx.y-=a;this.maxPx.y-=a}},isValidZoomLevel:function(a){return null!=a&&0<=a&&a<this.getNumZoomLevels()},isValidLonLat:function(a){var b=!1;null!=a&&(b=this.getMaxExtent(),b=b.containsLonLat(a,{worldBounds:this.baseLayer.wrapDateLine&&b}));return b},getProjection:function(){var a=this.getProjectionObject();return a?a.getCode(): +null},getProjectionObject:function(){var a=null;null!=this.baseLayer&&(a=this.baseLayer.projection);return a},getMaxResolution:function(){var a=null;null!=this.baseLayer&&(a=this.baseLayer.maxResolution);return a},getMaxExtent:function(a){var b=null;a&&a.restricted&&this.restrictedExtent?b=this.restrictedExtent:null!=this.baseLayer&&(b=this.baseLayer.maxExtent);return b},getNumZoomLevels:function(){var a=null;null!=this.baseLayer&&(a=this.baseLayer.numZoomLevels);return a},getExtent:function(){var a= +null;null!=this.baseLayer&&(a=this.baseLayer.getExtent());return a},getResolution:function(){var a=null;null!=this.baseLayer?a=this.baseLayer.getResolution():!0===this.allOverlays&&0<this.layers.length&&(a=this.layers[0].getResolution());return a},getUnits:function(){var a=null;null!=this.baseLayer&&(a=this.baseLayer.units);return a},getScale:function(){var a=null;null!=this.baseLayer&&(a=this.getResolution(),a=OpenLayers.Util.getScaleFromResolution(a,this.baseLayer.units));return a},getZoomForExtent:function(a, +b){var c=null;null!=this.baseLayer&&(c=this.baseLayer.getZoomForExtent(a,b));return c},getResolutionForZoom:function(a){var b=null;this.baseLayer&&(b=this.baseLayer.getResolutionForZoom(a));return b},getZoomForResolution:function(a,b){var c=null;null!=this.baseLayer&&(c=this.baseLayer.getZoomForResolution(a,b));return c},zoomTo:function(a,b){var c=this;if(c.isValidZoomLevel(a))if(c.baseLayer.wrapDateLine&&(a=c.adjustZoom(a)),c.zoomTween){var d=c.getResolution(),e=c.getResolutionForZoom(a),f={scale:1}, +d={scale:d/e};c.zoomTween.playing&&c.zoomTween.duration<3*c.zoomDuration?c.zoomTween.finish={scale:c.zoomTween.finish.scale*d.scale}:(b||(e=c.getSize(),b={x:e.w/2,y:e.h/2}),c.zoomTween.start(f,d,c.zoomDuration,{minFrameRate:50,callbacks:{eachStep:function(a){var d=c.layerContainerOriginPx;a=a.scale;c.applyTransform(d.x+((a-1)*(d.x-b.x)|0),d.y+((a-1)*(d.y-b.y)|0),a)},done:function(a){c.applyTransform();a=c.getResolution()/a.scale;var d=c.getZoomForResolution(a,!0);c.moveTo(c.getZoomTargetCenter(b, +a),d,!0)}}}))}else f=b?c.getZoomTargetCenter(b,c.getResolutionForZoom(a)):null,c.setCenter(f,a)},zoomIn:function(){this.zoomTo(this.getZoom()+1)},zoomOut:function(){this.zoomTo(this.getZoom()-1)},zoomToExtent:function(a,b){a instanceof OpenLayers.Bounds||(a=new OpenLayers.Bounds(a));var c=a.getCenterLonLat();if(this.baseLayer.wrapDateLine){c=this.getMaxExtent();for(a=a.clone();a.right<a.left;)a.right+=c.getWidth();c=a.getCenterLonLat().wrapDateLine(c)}this.setCenter(c,this.getZoomForExtent(a,b))}, +zoomToMaxExtent:function(a){a=this.getMaxExtent({restricted:a?a.restricted:!0});this.zoomToExtent(a)},zoomToScale:function(a,b){var c=OpenLayers.Util.getResolutionFromScale(a,this.baseLayer.units),d=this.size.w*c/2,c=this.size.h*c/2,e=this.getCachedCenter(),d=new OpenLayers.Bounds(e.lon-d,e.lat-c,e.lon+d,e.lat+c);this.zoomToExtent(d,b)},getLonLatFromViewPortPx:function(a){var b=null;null!=this.baseLayer&&(b=this.baseLayer.getLonLatFromViewPortPx(a));return b},getViewPortPxFromLonLat:function(a){var b= +null;null!=this.baseLayer&&(b=this.baseLayer.getViewPortPxFromLonLat(a));return b},getZoomTargetCenter:function(a,b){var c=null,d=this.getSize(),e=d.w/2-a.x,d=a.y-d.h/2,f=this.getLonLatFromPixel(a);f&&(c=new OpenLayers.LonLat(f.lon+e*b,f.lat+d*b));return c},getLonLatFromPixel:function(a){return this.getLonLatFromViewPortPx(a)},getPixelFromLonLat:function(a){a=this.getViewPortPxFromLonLat(a);a.x=Math.round(a.x);a.y=Math.round(a.y);return a},getGeodesicPixelSize:function(a){var b=a?this.getLonLatFromPixel(a): +this.getCachedCenter()||new OpenLayers.LonLat(0,0),c=this.getResolution();a=b.add(-c/2,0);var d=b.add(c/2,0),e=b.add(0,-c/2),b=b.add(0,c/2),c=new OpenLayers.Projection("EPSG:4326"),f=this.getProjectionObject()||c;f.equals(c)||(a.transform(f,c),d.transform(f,c),e.transform(f,c),b.transform(f,c));return new OpenLayers.Size(OpenLayers.Util.distVincenty(a,d),OpenLayers.Util.distVincenty(e,b))},getViewPortPxFromLayerPx:function(a){var b=null;null!=a&&(b=a.add(this.layerContainerOriginPx.x,this.layerContainerOriginPx.y)); +return b},getLayerPxFromViewPortPx:function(a){var b=null;null!=a&&(b=a.add(-this.layerContainerOriginPx.x,-this.layerContainerOriginPx.y),isNaN(b.x)||isNaN(b.y))&&(b=null);return b},getLonLatFromLayerPx:function(a){a=this.getViewPortPxFromLayerPx(a);return this.getLonLatFromViewPortPx(a)},getLayerPxFromLonLat:function(a){a=this.getPixelFromLonLat(a);return this.getLayerPxFromViewPortPx(a)},applyTransform:function(a,b,c){c=c||1;var d=this.layerContainerOriginPx,e=1!==c;a=a||d.x;b=b||d.y;var f=this.layerContainerDiv.style, +g=this.applyTransform.transform,h=this.applyTransform.template;if(void 0===g&&(g=OpenLayers.Util.vendorPrefix.style("transform"),this.applyTransform.transform=g)){var k=OpenLayers.Element.getStyle(this.viewPortDiv,OpenLayers.Util.vendorPrefix.css("transform"));k&&"none"===k||(h=["translate3d(",",0) ","scale3d(",",1)"],f[g]=[h[0],"0,0",h[1]].join(""));h&&~f[g].indexOf(h[0])||(h=["translate(",") ","scale(",")"]);this.applyTransform.template=h}null===g||"translate3d("!==h[0]&&!0!==e?(f.left=a+"px",f.top= +b+"px",null!==g&&(f[g]="")):(!0===e&&"translate("===h[0]&&(a-=d.x,b-=d.y,f.left=d.x+"px",f.top=d.y+"px"),f[g]=[h[0],a,"px,",b,"px",h[1],h[2],c,",",c,h[3]].join(""))},CLASS_NAME:"OpenLayers.Map"});OpenLayers.Map.TILE_WIDTH=256;OpenLayers.Map.TILE_HEIGHT=256;OpenLayers.Handler=OpenLayers.Class({id:null,control:null,map:null,keyMask:null,active:!1,evt:null,touch:!1,initialize:function(a,b,c){OpenLayers.Util.extend(this,c);this.control=a;this.callbacks=b;(a=this.map||a.map)&&this.setMap(a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},setMap:function(a){this.map=a},checkModifiers:function(a){return null==this.keyMask?!0:((a.shiftKey?OpenLayers.Handler.MOD_SHIFT:0)|(a.ctrlKey?OpenLayers.Handler.MOD_CTRL:0)|(a.altKey?OpenLayers.Handler.MOD_ALT: +0)|(a.metaKey?OpenLayers.Handler.MOD_META:0))==this.keyMask},activate:function(){if(this.active)return!1;for(var a=OpenLayers.Events.prototype.BROWSER_EVENTS,b=0,c=a.length;b<c;b++)this[a[b]]&&this.register(a[b],this[a[b]]);return this.active=!0},deactivate:function(){if(!this.active)return!1;for(var a=OpenLayers.Events.prototype.BROWSER_EVENTS,b=0,c=a.length;b<c;b++)this[a[b]]&&this.unregister(a[b],this[a[b]]);this.active=this.touch=!1;return!0},startTouch:function(){if(!this.touch){this.touch=!0; +for(var a="mousedown mouseup mousemove click dblclick mouseout".split(" "),b=0,c=a.length;b<c;b++)this[a[b]]&&this.unregister(a[b],this[a[b]])}},callback:function(a,b){a&&this.callbacks[a]&&this.callbacks[a].apply(this.control,b)},register:function(a,b){this.map.events.registerPriority(a,this,b);this.map.events.registerPriority(a,this,this.setEvent)},unregister:function(a,b){this.map.events.unregister(a,this,b);this.map.events.unregister(a,this,this.setEvent)},setEvent:function(a){this.evt=a;return!0}, +destroy:function(){this.deactivate();this.control=this.map=null},CLASS_NAME:"OpenLayers.Handler"});OpenLayers.Handler.MOD_NONE=0;OpenLayers.Handler.MOD_SHIFT=1;OpenLayers.Handler.MOD_CTRL=2;OpenLayers.Handler.MOD_ALT=4;OpenLayers.Handler.MOD_META=8;OpenLayers.Handler.Click=OpenLayers.Class(OpenLayers.Handler,{delay:300,single:!0,"double":!1,pixelTolerance:0,dblclickTolerance:13,stopSingle:!1,stopDouble:!1,timerId:null,down:null,last:null,first:null,rightclickTimerId:null,touchstart:function(a){this.startTouch();this.down=this.getEventInfo(a);this.last=this.getEventInfo(a);return!0},touchmove:function(a){this.last=this.getEventInfo(a);return!0},touchend:function(a){this.down&&(a.xy=this.last.xy,a.lastTouches=this.last.touches,this.handleSingle(a), +this.down=null);return!0},mousedown:function(a){this.down=this.getEventInfo(a);this.last=this.getEventInfo(a);return!0},mouseup:function(a){var b=!0;this.checkModifiers(a)&&(this.control.handleRightClicks&&OpenLayers.Event.isRightClick(a))&&(b=this.rightclick(a));return b},rightclick:function(a){if(this.passesTolerance(a)){if(null!=this.rightclickTimerId)return this.clearTimer(),this.callback("dblrightclick",[a]),!this.stopDouble;a=this["double"]?OpenLayers.Util.extend({},a):this.callback("rightclick", +[a]);a=OpenLayers.Function.bind(this.delayedRightCall,this,a);this.rightclickTimerId=window.setTimeout(a,this.delay)}return!this.stopSingle},delayedRightCall:function(a){this.rightclickTimerId=null;a&&this.callback("rightclick",[a])},click:function(a){this.last||(this.last=this.getEventInfo(a));this.handleSingle(a);return!this.stopSingle},dblclick:function(a){this.handleDouble(a);return!this.stopDouble},handleDouble:function(a){this.passesDblclickTolerance(a)&&(this["double"]&&this.callback("dblclick", +[a]),this.clearTimer())},handleSingle:function(a){this.passesTolerance(a)&&(null!=this.timerId?(this.last.touches&&1===this.last.touches.length&&(this["double"]&&OpenLayers.Event.preventDefault(a),this.handleDouble(a)),this.last.touches&&2===this.last.touches.length||this.clearTimer()):(this.first=this.getEventInfo(a),a=this.single?OpenLayers.Util.extend({},a):null,this.queuePotentialClick(a)))},queuePotentialClick:function(a){this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall, +this,a),this.delay)},passesTolerance:function(a){var b=!0;if(null!=this.pixelTolerance&&this.down&&this.down.xy&&(b=this.pixelTolerance>=this.down.xy.distanceTo(a.xy))&&this.touch&&this.down.touches.length===this.last.touches.length){a=0;for(var c=this.down.touches.length;a<c;++a)if(this.getTouchDistance(this.down.touches[a],this.last.touches[a])>this.pixelTolerance){b=!1;break}}return b},getTouchDistance:function(a,b){return Math.sqrt(Math.pow(a.clientX-b.clientX,2)+Math.pow(a.clientY-b.clientY, +2))},passesDblclickTolerance:function(a){a=!0;this.down&&this.first&&(a=this.down.xy.distanceTo(this.first.xy)<=this.dblclickTolerance);return a},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null);null!=this.rightclickTimerId&&(window.clearTimeout(this.rightclickTimerId),this.rightclickTimerId=null)},delayedCall:function(a){this.timerId=null;a&&this.callback("click",[a])},getEventInfo:function(a){var b;if(a.touches){var c=a.touches.length;b=Array(c);for(var d, +e=0;e<c;e++)d=a.touches[e],b[e]={clientX:d.olClientX,clientY:d.olClientY}}return{xy:a.xy,touches:b}},deactivate:function(){var a=!1;OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),this.last=this.first=this.down=null,a=!0);return a},CLASS_NAME:"OpenLayers.Handler.Click"});OpenLayers.Handler.Drag=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!0,dragging:!1,last:null,start:null,lastMoveEvt:null,oldOnselectstart:null,interval:0,timeoutId:null,documentDrag:!1,documentEvents:null,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);if(!0===this.documentDrag){var d=this;this._docMove=function(a){d.mousemove({xy:{x:a.clientX,y:a.clientY},element:document})};this._docUp=function(a){d.mouseup({xy:{x:a.clientX,y:a.clientY}})}}}, +dragstart:function(a){var b=!0;this.dragging=!1;this.checkModifiers(a)&&(OpenLayers.Event.isLeftClick(a)||OpenLayers.Event.isSingleTouch(a))?(this.started=!0,this.last=this.start=a.xy,OpenLayers.Element.addClass(this.map.viewPortDiv,"olDragDown"),this.down(a),this.callback("down",[a.xy]),OpenLayers.Event.preventDefault(a),this.oldOnselectstart||(this.oldOnselectstart=document.onselectstart?document.onselectstart:OpenLayers.Function.True),document.onselectstart=OpenLayers.Function.False,b=!this.stopDown): +(this.started=!1,this.last=this.start=null);return b},dragmove:function(a){this.lastMoveEvt=a;!this.started||(this.timeoutId||a.xy.x==this.last.x&&a.xy.y==this.last.y)||(!0===this.documentDrag&&this.documentEvents&&(a.element===document?(this.adjustXY(a),this.setEvent(a)):this.removeDocumentEvents()),0<this.interval&&(this.timeoutId=setTimeout(OpenLayers.Function.bind(this.removeTimeout,this),this.interval)),this.dragging=!0,this.move(a),this.callback("move",[a.xy]),this.oldOnselectstart||(this.oldOnselectstart= +document.onselectstart,document.onselectstart=OpenLayers.Function.False),this.last=a.xy);return!0},dragend:function(a){if(this.started){!0===this.documentDrag&&this.documentEvents&&(this.adjustXY(a),this.removeDocumentEvents());var b=this.start!=this.last;this.dragging=this.started=!1;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.up(a);this.callback("up",[a.xy]);b&&this.callback("done",[a.xy]);document.onselectstart=this.oldOnselectstart}return!0},down:function(a){},move:function(a){}, +up:function(a){},out:function(a){},mousedown:function(a){return this.dragstart(a)},touchstart:function(a){this.startTouch();return this.dragstart(a)},mousemove:function(a){return this.dragmove(a)},touchmove:function(a){return this.dragmove(a)},removeTimeout:function(){this.timeoutId=null;this.dragging&&this.mousemove(this.lastMoveEvt)},mouseup:function(a){return this.dragend(a)},touchend:function(a){a.xy=this.last;return this.dragend(a)},mouseout:function(a){if(this.started&&OpenLayers.Util.mouseLeft(a, +this.map.viewPortDiv))if(!0===this.documentDrag)this.addDocumentEvents();else{var b=this.start!=this.last;this.dragging=this.started=!1;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown");this.out(a);this.callback("out",[]);b&&this.callback("done",[a.xy]);document.onselectstart&&(document.onselectstart=this.oldOnselectstart)}return!0},click:function(a){return this.start==this.last},activate:function(){var a=!1;OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.dragging= +!1,a=!0);return a},deactivate:function(){var a=!1;OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.dragging=this.started=!1,this.last=this.start=null,a=!0,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDragDown"));return a},adjustXY:function(a){var b=OpenLayers.Util.pagePosition(this.map.viewPortDiv);a.xy.x-=b[0];a.xy.y-=b[1]},addDocumentEvents:function(){OpenLayers.Element.addClass(document.body,"olDragDown");this.documentEvents=!0;OpenLayers.Event.observe(document,"mousemove", +this._docMove);OpenLayers.Event.observe(document,"mouseup",this._docUp)},removeDocumentEvents:function(){OpenLayers.Element.removeClass(document.body,"olDragDown");this.documentEvents=!1;OpenLayers.Event.stopObserving(document,"mousemove",this._docMove);OpenLayers.Event.stopObserving(document,"mouseup",this._docUp)},CLASS_NAME:"OpenLayers.Handler.Drag"});OpenLayers.Control.OverviewMap=OpenLayers.Class(OpenLayers.Control,{element:null,ovmap:null,size:{w:180,h:90},layers:null,minRectSize:15,minRectDisplayClass:"RectReplacement",minRatio:8,maxRatio:32,mapOptions:null,autoPan:!1,handlers:null,resolutionFactor:1,maximized:!1,maximizeTitle:"",minimizeTitle:"",initialize:function(a){this.layers=[];this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,[a])},destroy:function(){this.mapDiv&&(this.handlers.click&&this.handlers.click.destroy(), +this.handlers.drag&&this.handlers.drag.destroy(),this.ovmap&&this.ovmap.viewPortDiv.removeChild(this.extentRectangle),this.extentRectangle=null,this.rectEvents&&(this.rectEvents.destroy(),this.rectEvents=null),this.ovmap&&(this.ovmap.destroy(),this.ovmap=null),this.element.removeChild(this.mapDiv),this.mapDiv=null,this.div.removeChild(this.element),this.element=null,this.maximizeDiv&&(this.div.removeChild(this.maximizeDiv),this.maximizeDiv=null),this.minimizeDiv&&(this.div.removeChild(this.minimizeDiv), +this.minimizeDiv=null),this.map.events.un({buttonclick:this.onButtonClick,moveend:this.update,changebaselayer:this.baseLayerDraw,scope:this}),OpenLayers.Control.prototype.destroy.apply(this,arguments))},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(0===this.layers.length)if(this.map.baseLayer)this.layers=[this.map.baseLayer.clone()];else return this.map.events.register("changebaselayer",this,this.baseLayerDraw),this.div;this.element=document.createElement("div");this.element.className= +this.displayClass+"Element";this.element.style.display="none";this.mapDiv=document.createElement("div");this.mapDiv.style.width=this.size.w+"px";this.mapDiv.style.height=this.size.h+"px";this.mapDiv.style.position="relative";this.mapDiv.style.overflow="hidden";this.mapDiv.id=OpenLayers.Util.createUniqueID("overviewMap");this.extentRectangle=document.createElement("div");this.extentRectangle.style.position="absolute";this.extentRectangle.style.zIndex=1E3;this.extentRectangle.className=this.displayClass+ +"ExtentRectangle";this.element.appendChild(this.mapDiv);this.div.appendChild(this.element);if(this.outsideViewport)this.element.style.display="";else{this.div.className+=" "+this.displayClass+"Container";var a=OpenLayers.Util.getImageLocation("layer-switcher-maximize.png");this.maximizeDiv=OpenLayers.Util.createAlphaImageDiv(this.displayClass+"MaximizeButton",null,null,a,"absolute");this.maximizeDiv.style.display="none";this.maximizeDiv.className=this.displayClass+"MaximizeButton olButton";this.maximizeTitle&& +(this.maximizeDiv.title=this.maximizeTitle);this.div.appendChild(this.maximizeDiv);a=OpenLayers.Util.getImageLocation("layer-switcher-minimize.png");this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_minimizeDiv",null,null,a,"absolute");this.minimizeDiv.style.display="none";this.minimizeDiv.className=this.displayClass+"MinimizeButton olButton";this.minimizeTitle&&(this.minimizeDiv.title=this.minimizeTitle);this.div.appendChild(this.minimizeDiv);this.minimizeControl()}this.map.getExtent()&& +this.update();this.map.events.on({buttonclick:this.onButtonClick,moveend:this.update,scope:this});this.maximized&&this.maximizeControl();return this.div},baseLayerDraw:function(){this.draw();this.map.events.unregister("changebaselayer",this,this.baseLayerDraw)},rectDrag:function(a){var b=this.handlers.drag.last.x-a.x,c=this.handlers.drag.last.y-a.y;if(0!=b||0!=c){var d=this.rectPxBounds.top,e=this.rectPxBounds.left;a=Math.abs(this.rectPxBounds.getHeight());var f=this.rectPxBounds.getWidth(),c=Math.max(0, +d-c),c=Math.min(c,this.ovmap.size.h-this.hComp-a),b=Math.max(0,e-b),b=Math.min(b,this.ovmap.size.w-this.wComp-f);this.setRectPxBounds(new OpenLayers.Bounds(b,c+a,b+f,c))}},mapDivClick:function(a){var b=this.rectPxBounds.getCenterPixel(),c=a.xy.x-b.x,d=a.xy.y-b.y,e=this.rectPxBounds.top,f=this.rectPxBounds.left;a=Math.abs(this.rectPxBounds.getHeight());b=this.rectPxBounds.getWidth();d=Math.max(0,e+d);d=Math.min(d,this.ovmap.size.h-a);c=Math.max(0,f+c);c=Math.min(c,this.ovmap.size.w-b);this.setRectPxBounds(new OpenLayers.Bounds(c, +d+a,c+b,d));this.updateMapToRect()},onButtonClick:function(a){a.buttonElement===this.minimizeDiv?this.minimizeControl():a.buttonElement===this.maximizeDiv&&this.maximizeControl()},maximizeControl:function(a){this.element.style.display="";this.showToggle(!1);null!=a&&OpenLayers.Event.stop(a)},minimizeControl:function(a){this.element.style.display="none";this.showToggle(!0);null!=a&&OpenLayers.Event.stop(a)},showToggle:function(a){this.maximizeDiv&&(this.maximizeDiv.style.display=a?"":"none");this.minimizeDiv&& +(this.minimizeDiv.style.display=a?"none":"")},update:function(){null==this.ovmap&&this.createMap();!this.autoPan&&this.isSuitableOverview()||this.updateOverview();this.updateRectToMap()},isSuitableOverview:function(){var a=this.map.getExtent(),b=this.map.getMaxExtent(),a=new OpenLayers.Bounds(Math.max(a.left,b.left),Math.max(a.bottom,b.bottom),Math.min(a.right,b.right),Math.min(a.top,b.top));this.ovmap.getProjection()!=this.map.getProjection()&&(a=a.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())); +b=this.ovmap.getResolution()/this.map.getResolution();return b>this.minRatio&&b<=this.maxRatio&&this.ovmap.getExtent().containsBounds(a)},updateOverview:function(){var a=this.map.getResolution(),b=this.ovmap.getResolution(),c=b/a;c>this.maxRatio?b=this.minRatio*a:c<=this.minRatio&&(b=this.maxRatio*a);this.ovmap.getProjection()!=this.map.getProjection()?(a=this.map.center.clone(),a.transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject())):a=this.map.center;this.ovmap.setCenter(a, +this.ovmap.getZoomForResolution(b*this.resolutionFactor));this.updateRectToMap()},createMap:function(){var a=OpenLayers.Util.extend({controls:[],maxResolution:"auto",fallThrough:!1},this.mapOptions);this.ovmap=new OpenLayers.Map(this.mapDiv,a);this.ovmap.viewPortDiv.appendChild(this.extentRectangle);OpenLayers.Event.stopObserving(window,"unload",this.ovmap.unloadDestroy);this.ovmap.addLayers(this.layers);this.ovmap.zoomToMaxExtent();this.wComp=(this.wComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle, +"border-left-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-right-width")))?this.wComp:2;this.hComp=(this.hComp=parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-top-width"))+parseInt(OpenLayers.Element.getStyle(this.extentRectangle,"border-bottom-width")))?this.hComp:2;this.handlers.drag=new OpenLayers.Handler.Drag(this,{move:this.rectDrag,done:this.updateMapToRect},{map:this.ovmap});this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.mapDivClick}, +{single:!0,"double":!1,stopSingle:!0,stopDouble:!0,pixelTolerance:1,map:this.ovmap});this.handlers.click.activate();this.rectEvents=new OpenLayers.Events(this,this.extentRectangle,null,!0);this.rectEvents.register("mouseover",this,function(a){this.handlers.drag.active||this.map.dragging||this.handlers.drag.activate()});this.rectEvents.register("mouseout",this,function(a){this.handlers.drag.dragging||this.handlers.drag.deactivate()});if(this.ovmap.getProjection()!=this.map.getProjection()){var a=this.map.getProjectionObject().getUnits()|| +this.map.units||this.map.baseLayer.units,b=this.ovmap.getProjectionObject().getUnits()||this.ovmap.units||this.ovmap.baseLayer.units;this.resolutionFactor=a&&b?OpenLayers.INCHES_PER_UNIT[a]/OpenLayers.INCHES_PER_UNIT[b]:1}},updateRectToMap:function(){var a;a=this.ovmap.getProjection()!=this.map.getProjection()?this.map.getExtent().transform(this.map.getProjectionObject(),this.ovmap.getProjectionObject()):this.map.getExtent();(a=this.getRectBoundsFromMapBounds(a))&&this.setRectPxBounds(a)},updateMapToRect:function(){var a= +this.getMapBoundsFromRectBounds(this.rectPxBounds);this.ovmap.getProjection()!=this.map.getProjection()&&(a=a.transform(this.ovmap.getProjectionObject(),this.map.getProjectionObject()));this.map.panTo(a.getCenterLonLat())},setRectPxBounds:function(a){var b=Math.max(a.top,0),c=Math.max(a.left,0),d=Math.min(a.top+Math.abs(a.getHeight()),this.ovmap.size.h-this.hComp);a=Math.min(a.left+a.getWidth(),this.ovmap.size.w-this.wComp);var e=Math.max(a-c,0),f=Math.max(d-b,0);e<this.minRectSize||f<this.minRectSize? +(this.extentRectangle.className=this.displayClass+this.minRectDisplayClass,e=c+e/2-this.minRectSize/2,this.extentRectangle.style.top=Math.round(b+f/2-this.minRectSize/2)+"px",this.extentRectangle.style.left=Math.round(e)+"px",this.extentRectangle.style.height=this.minRectSize+"px",this.extentRectangle.style.width=this.minRectSize+"px"):(this.extentRectangle.className=this.displayClass+"ExtentRectangle",this.extentRectangle.style.top=Math.round(b)+"px",this.extentRectangle.style.left=Math.round(c)+ +"px",this.extentRectangle.style.height=Math.round(f)+"px",this.extentRectangle.style.width=Math.round(e)+"px");this.rectPxBounds=new OpenLayers.Bounds(Math.round(c),Math.round(d),Math.round(a),Math.round(b))},getRectBoundsFromMapBounds:function(a){var b=this.getOverviewPxFromLonLat({lon:a.left,lat:a.bottom});a=this.getOverviewPxFromLonLat({lon:a.right,lat:a.top});var c=null;b&&a&&(c=new OpenLayers.Bounds(b.x,b.y,a.x,a.y));return c},getMapBoundsFromRectBounds:function(a){var b=this.getLonLatFromOverviewPx({x:a.left, +y:a.bottom});a=this.getLonLatFromOverviewPx({x:a.right,y:a.top});return new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat)},getLonLatFromOverviewPx:function(a){var b=this.ovmap.size,c=this.ovmap.getResolution(),d=this.ovmap.getExtent().getCenterLonLat();return{lon:d.lon+(a.x-b.w/2)*c,lat:d.lat-(a.y-b.h/2)*c}},getOverviewPxFromLonLat:function(a){var b=this.ovmap.getResolution(),c=this.ovmap.getExtent();if(c)return{x:Math.round(1/b*(a.lon-c.left)),y:Math.round(1/b*(c.top-a.lat))}},CLASS_NAME:"OpenLayers.Control.OverviewMap"});OpenLayers.Layer=OpenLayers.Class({id:null,name:null,div:null,opacity:1,alwaysInRange:null,RESOLUTION_PROPERTIES:"scales resolutions maxScale minScale maxResolution minResolution numZoomLevels maxZoomLevel".split(" "),events:null,map:null,isBaseLayer:!1,alpha:!1,displayInLayerSwitcher:!0,visibility:!0,attribution:null,inRange:!1,imageSize:null,options:null,eventListeners:null,gutter:0,projection:null,units:null,scales:null,resolutions:null,maxExtent:null,minExtent:null,maxResolution:null,minResolution:null, +numZoomLevels:null,minScale:null,maxScale:null,displayOutsideMaxExtent:!1,wrapDateLine:!1,metadata:null,initialize:function(a,b){this.metadata={};b=OpenLayers.Util.extend({},b);null!=this.alwaysInRange&&(b.alwaysInRange=this.alwaysInRange);this.addOptions(b);this.name=a;if(null==this.id&&(this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"),this.div=OpenLayers.Util.createDiv(this.id),this.div.style.width="100%",this.div.style.height="100%",this.div.dir="ltr",this.events=new OpenLayers.Events(this, +this.div),this.eventListeners instanceof Object))this.events.on(this.eventListeners)},destroy:function(a){null==a&&(a=!0);null!=this.map&&this.map.removeLayer(this,a);this.options=this.div=this.name=this.map=this.projection=null;this.events&&(this.eventListeners&&this.events.un(this.eventListeners),this.events.destroy());this.events=this.eventListeners=null},clone:function(a){null==a&&(a=new OpenLayers.Layer(this.name,this.getOptions()));OpenLayers.Util.applyDefaults(a,this);a.map=null;return a}, +getOptions:function(){var a={},b;for(b in this.options)a[b]=this[b];return a},setName:function(a){a!=this.name&&(this.name=a,null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"name"}))},addOptions:function(a,b){null==this.options&&(this.options={});a&&("string"==typeof a.projection&&(a.projection=new OpenLayers.Projection(a.projection)),a.projection&&OpenLayers.Util.applyDefaults(a,OpenLayers.Projection.defaults[a.projection.getCode()]),!a.maxExtent||a.maxExtent instanceof +OpenLayers.Bounds||(a.maxExtent=new OpenLayers.Bounds(a.maxExtent)),!a.minExtent||a.minExtent instanceof OpenLayers.Bounds||(a.minExtent=new OpenLayers.Bounds(a.minExtent)));OpenLayers.Util.extend(this.options,a);OpenLayers.Util.extend(this,a);this.projection&&this.projection.getUnits()&&(this.units=this.projection.getUnits());if(this.map){var c=this.map.getResolution(),d=this.RESOLUTION_PROPERTIES.concat(["projection","units","minExtent","maxExtent"]),e;for(e in a)if(a.hasOwnProperty(e)&&0<=OpenLayers.Util.indexOf(d, +e)){this.initResolutions();b&&this.map.baseLayer===this&&(this.map.setCenter(this.map.getCenter(),this.map.getZoomForResolution(c),!1,!0),this.map.events.triggerEvent("changebaselayer",{layer:this}));break}}},onMapResize:function(){},redraw:function(){var a=!1;if(this.map){this.inRange=this.calculateInRange();var b=this.getExtent();b&&(this.inRange&&this.visibility)&&(this.moveTo(b,!0,!1),this.events.triggerEvent("moveend",{zoomChanged:!0}),a=!0)}return a},moveTo:function(a,b,c){a=this.visibility; +this.isBaseLayer||(a=a&&this.inRange);this.display(a)},moveByPx:function(a,b){},setMap:function(a){null==this.map&&(this.map=a,this.maxExtent=this.maxExtent||this.map.maxExtent,this.minExtent=this.minExtent||this.map.minExtent,this.projection=this.projection||this.map.projection,"string"==typeof this.projection&&(this.projection=new OpenLayers.Projection(this.projection)),this.units=this.projection.getUnits()||this.units||this.map.units,this.initResolutions(),this.isBaseLayer||(this.inRange=this.calculateInRange(), +this.div.style.display=this.visibility&&this.inRange?"":"none"),this.setTileSize())},afterAdd:function(){},removeMap:function(a){},getImageSize:function(a){return this.imageSize||this.tileSize},setTileSize:function(a){this.tileSize=a=a?a:this.tileSize?this.tileSize:this.map.getTileSize();this.gutter&&(this.imageSize=new OpenLayers.Size(a.w+2*this.gutter,a.h+2*this.gutter))},getVisibility:function(){return this.visibility},setVisibility:function(a){a!=this.visibility&&(this.visibility=a,this.display(a), +this.redraw(),null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"visibility"}),this.events.triggerEvent("visibilitychanged"))},display:function(a){a!=("none"!=this.div.style.display)&&(this.div.style.display=a&&this.calculateInRange()?"block":"none")},calculateInRange:function(){var a=!1;this.alwaysInRange?a=!0:this.map&&(a=this.map.getResolution(),a=a>=this.minResolution&&a<=this.maxResolution);return a},setIsBaseLayer:function(a){a!=this.isBaseLayer&&(this.isBaseLayer= +a,null!=this.map&&this.map.events.triggerEvent("changebaselayer",{layer:this}))},initResolutions:function(){var a,b,c,d={},e=!0;a=0;for(b=this.RESOLUTION_PROPERTIES.length;a<b;a++)c=this.RESOLUTION_PROPERTIES[a],d[c]=this.options[c],e&&this.options[c]&&(e=!1);null==this.options.alwaysInRange&&(this.alwaysInRange=e);null==d.resolutions&&(d.resolutions=this.resolutionsFromScales(d.scales));null==d.resolutions&&(d.resolutions=this.calculateResolutions(d));if(null==d.resolutions){a=0;for(b=this.RESOLUTION_PROPERTIES.length;a< +b;a++)c=this.RESOLUTION_PROPERTIES[a],d[c]=null!=this.options[c]?this.options[c]:this.map[c];null==d.resolutions&&(d.resolutions=this.resolutionsFromScales(d.scales));null==d.resolutions&&(d.resolutions=this.calculateResolutions(d))}var f;this.options.maxResolution&&"auto"!==this.options.maxResolution&&(f=this.options.maxResolution);this.options.minScale&&(f=OpenLayers.Util.getResolutionFromScale(this.options.minScale,this.units));var g;this.options.minResolution&&"auto"!==this.options.minResolution&& +(g=this.options.minResolution);this.options.maxScale&&(g=OpenLayers.Util.getResolutionFromScale(this.options.maxScale,this.units));d.resolutions&&(d.resolutions.sort(function(a,b){return b-a}),f||(f=d.resolutions[0]),g||(g=d.resolutions[d.resolutions.length-1]));if(this.resolutions=d.resolutions){b=this.resolutions.length;this.scales=Array(b);for(a=0;a<b;a++)this.scales[a]=OpenLayers.Util.getScaleFromResolution(this.resolutions[a],this.units);this.numZoomLevels=b}if(this.minResolution=g)this.maxScale= +OpenLayers.Util.getScaleFromResolution(g,this.units);if(this.maxResolution=f)this.minScale=OpenLayers.Util.getScaleFromResolution(f,this.units)},resolutionsFromScales:function(a){if(null!=a){var b,c,d;d=a.length;b=Array(d);for(c=0;c<d;c++)b[c]=OpenLayers.Util.getResolutionFromScale(a[c],this.units);return b}},calculateResolutions:function(a){var b,c,d=a.maxResolution;null!=a.minScale?d=OpenLayers.Util.getResolutionFromScale(a.minScale,this.units):"auto"==d&&null!=this.maxExtent&&(b=this.map.getSize(), +c=this.maxExtent.getWidth()/b.w,b=this.maxExtent.getHeight()/b.h,d=Math.max(c,b));c=a.minResolution;null!=a.maxScale?c=OpenLayers.Util.getResolutionFromScale(a.maxScale,this.units):"auto"==a.minResolution&&null!=this.minExtent&&(b=this.map.getSize(),c=this.minExtent.getWidth()/b.w,b=this.minExtent.getHeight()/b.h,c=Math.max(c,b));"number"!==typeof d&&("number"!==typeof c&&null!=this.maxExtent)&&(d=this.map.getTileSize(),d=Math.max(this.maxExtent.getWidth()/d.w,this.maxExtent.getHeight()/d.h));b=a.maxZoomLevel; +a=a.numZoomLevels;"number"===typeof c&&"number"===typeof d&&void 0===a?a=Math.floor(Math.log(d/c)/Math.log(2))+1:void 0===a&&null!=b&&(a=b+1);if(!("number"!==typeof a||0>=a||"number"!==typeof d&&"number"!==typeof c)){b=Array(a);var e=2;"number"==typeof c&&"number"==typeof d&&(e=Math.pow(d/c,1/(a-1)));var f;if("number"===typeof d)for(f=0;f<a;f++)b[f]=d/Math.pow(e,f);else for(f=0;f<a;f++)b[a-1-f]=c*Math.pow(e,f);return b}},getResolution:function(){var a=this.map.getZoom();return this.getResolutionForZoom(a)}, +getExtent:function(){return this.map.calculateBounds()},getZoomForExtent:function(a,b){var c=this.map.getSize(),c=Math.max(a.getWidth()/c.w,a.getHeight()/c.h);return this.getZoomForResolution(c,b)},getDataExtent:function(){},getResolutionForZoom:function(a){a=Math.max(0,Math.min(a,this.resolutions.length-1));if(this.map.fractionalZoom){var b=Math.floor(a),c=Math.ceil(a);a=this.resolutions[b]-(a-b)*(this.resolutions[b]-this.resolutions[c])}else a=this.resolutions[Math.round(a)];return a},getZoomForResolution:function(a, +b){var c,d;if(this.map.fractionalZoom){var e=0,f=this.resolutions[e],g=this.resolutions[this.resolutions.length-1],h;c=0;for(d=this.resolutions.length;c<d;++c)if(h=this.resolutions[c],h>=a&&(f=h,e=c),h<=a){g=h;break}c=f-g;c=0<c?e+(f-a)/c:e}else{f=Number.POSITIVE_INFINITY;c=0;for(d=this.resolutions.length;c<d;c++)if(b){e=Math.abs(this.resolutions[c]-a);if(e>f)break;f=e}else if(this.resolutions[c]<a)break;c=Math.max(0,c-1)}return c},getLonLatFromViewPortPx:function(a){var b=null,c=this.map;if(null!= +a&&c.minPx){var b=c.getResolution(),d=c.getMaxExtent({restricted:!0}),b=new OpenLayers.LonLat((a.x-c.minPx.x)*b+d.left,(c.minPx.y-a.y)*b+d.top);this.wrapDateLine&&(b=b.wrapDateLine(this.maxExtent))}return b},getViewPortPxFromLonLat:function(a,b){var c=null;null!=a&&(b=b||this.map.getResolution(),c=this.map.calculateBounds(null,b),c=new OpenLayers.Pixel(1/b*(a.lon-c.left),1/b*(c.top-a.lat)));return c},setOpacity:function(a){if(a!=this.opacity){this.opacity=a;for(var b=this.div.childNodes,c=0,d=b.length;c< +d;++c){var e=b[c].firstChild||b[c],f=b[c].lastChild;f&&"iframe"===f.nodeName.toLowerCase()&&(e=f.parentNode);OpenLayers.Util.modifyDOMElement(e,null,null,null,null,null,null,a)}null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"})}},getZIndex:function(){return this.div.style.zIndex},setZIndex:function(a){this.div.style.zIndex=a},adjustBounds:function(a){if(this.gutter){var b=this.gutter*this.map.getResolution();a=new OpenLayers.Bounds(a.left-b,a.bottom-b,a.right+ +b,a.top+b)}this.wrapDateLine&&(b={rightTolerance:this.getResolution(),leftTolerance:this.getResolution()},a=a.wrapDateLine(this.maxExtent,b));return a},CLASS_NAME:"OpenLayers.Layer"});OpenLayers.Layer.SphericalMercator={getExtent:function(){var a=null;return a=this.sphericalMercator?this.map.calculateBounds():OpenLayers.Layer.FixedZoomLevels.prototype.getExtent.apply(this)},getLonLatFromViewPortPx:function(a){return OpenLayers.Layer.prototype.getLonLatFromViewPortPx.apply(this,arguments)},getViewPortPxFromLonLat:function(a){return OpenLayers.Layer.prototype.getViewPortPxFromLonLat.apply(this,arguments)},initMercatorParameters:function(){this.RESOLUTIONS=[];for(var a=0;a<=this.MAX_ZOOM_LEVEL;++a)this.RESOLUTIONS[a]= +156543.03390625/Math.pow(2,a);this.units="m";this.projection=this.projection||"EPSG:900913"},forwardMercator:function(){var a=new OpenLayers.Projection("EPSG:4326"),b=new OpenLayers.Projection("EPSG:900913");return function(c,d){var e=OpenLayers.Projection.transform({x:c,y:d},a,b);return new OpenLayers.LonLat(e.x,e.y)}}(),inverseMercator:function(){var a=new OpenLayers.Projection("EPSG:4326"),b=new OpenLayers.Projection("EPSG:900913");return function(c,d){var e=OpenLayers.Projection.transform({x:c, +y:d},b,a);return new OpenLayers.LonLat(e.x,e.y)}}()};OpenLayers.Layer.EventPane=OpenLayers.Class(OpenLayers.Layer,{smoothDragPan:!0,isBaseLayer:!0,isFixed:!0,pane:null,mapObject:null,initialize:function(a,b){OpenLayers.Layer.prototype.initialize.apply(this,arguments);null==this.pane&&(this.pane=OpenLayers.Util.createDiv(this.div.id+"_EventPane"))},destroy:function(){this.pane=this.mapObject=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this,arguments);this.pane.style.zIndex= +parseInt(this.div.style.zIndex)+1;this.pane.style.display=this.div.style.display;this.pane.style.width="100%";this.pane.style.height="100%";"msie"==OpenLayers.BROWSER_NAME&&(this.pane.style.background="url("+OpenLayers.Util.getImageLocation("blank.gif")+")");this.isFixed?this.map.viewPortDiv.appendChild(this.pane):this.map.layerContainerDiv.appendChild(this.pane);this.loadMapObject();null==this.mapObject&&this.loadWarningMessage()},removeMap:function(a){this.pane&&this.pane.parentNode&&this.pane.parentNode.removeChild(this.pane); +OpenLayers.Layer.prototype.removeMap.apply(this,arguments)},loadWarningMessage:function(){this.div.style.backgroundColor="darkblue";var a=this.map.getSize(),b=Math.min(a.w,300),c=Math.min(a.h,200),b=new OpenLayers.Size(b,c),a=(new OpenLayers.Pixel(a.w/2,a.h/2)).add(-b.w/2,-b.h/2),a=OpenLayers.Util.createDiv(this.name+"_warning",a,b,null,null,null,"auto");a.style.padding="7px";a.style.backgroundColor="yellow";a.innerHTML=this.getWarningHTML();this.div.appendChild(a)},getWarningHTML:function(){return""}, +display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);this.pane.style.display=this.div.style.display},setZIndex:function(a){OpenLayers.Layer.prototype.setZIndex.apply(this,arguments);this.pane.style.zIndex=parseInt(this.div.style.zIndex)+1},moveByPx:function(a,b){OpenLayers.Layer.prototype.moveByPx.apply(this,arguments);this.dragPanMapObject?this.dragPanMapObject(a,-b):this.moveTo(this.map.getCachedCenter())},moveTo:function(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this, +arguments);if(null!=this.mapObject){var d=this.map.getCenter(),e=this.map.getZoom();if(null!=d){var f=this.getMapObjectCenter(),f=this.getOLLonLatFromMapObjectLonLat(f),g=this.getMapObjectZoom(),g=this.getOLZoomFromMapObjectZoom(g);d.equals(f)&&e==g||(!b&&f&&this.dragPanMapObject&&this.smoothDragPan?(e=this.map.getViewPortPxFromLonLat(f),d=this.map.getViewPortPxFromLonLat(d),this.dragPanMapObject(d.x-e.x,e.y-d.y)):(d=this.getMapObjectLonLatFromOLLonLat(d),e=this.getMapObjectZoomFromOLZoom(e),this.setMapObjectCenter(d, +e,c)))}}},getLonLatFromViewPortPx:function(a){var b=null;null!=this.mapObject&&null!=this.getMapObjectCenter()&&(a=this.getMapObjectPixelFromOLPixel(a),a=this.getMapObjectLonLatFromMapObjectPixel(a),b=this.getOLLonLatFromMapObjectLonLat(a));return b},getViewPortPxFromLonLat:function(a){var b=null;null!=this.mapObject&&null!=this.getMapObjectCenter()&&(a=this.getMapObjectLonLatFromOLLonLat(a),a=this.getMapObjectPixelFromMapObjectLonLat(a),b=this.getOLPixelFromMapObjectPixel(a));return b},getOLLonLatFromMapObjectLonLat:function(a){var b= +null;null!=a&&(b=this.getLongitudeFromMapObjectLonLat(a),a=this.getLatitudeFromMapObjectLonLat(a),b=new OpenLayers.LonLat(b,a));return b},getMapObjectLonLatFromOLLonLat:function(a){var b=null;null!=a&&(b=this.getMapObjectLonLatFromLonLat(a.lon,a.lat));return b},getOLPixelFromMapObjectPixel:function(a){var b=null;null!=a&&(b=this.getXFromMapObjectPixel(a),a=this.getYFromMapObjectPixel(a),b=new OpenLayers.Pixel(b,a));return b},getMapObjectPixelFromOLPixel:function(a){var b=null;null!=a&&(b=this.getMapObjectPixelFromXY(a.x, +a.y));return b},CLASS_NAME:"OpenLayers.Layer.EventPane"});OpenLayers.Layer.FixedZoomLevels=OpenLayers.Class({initialize:function(){},initResolutions:function(){for(var a=["minZoomLevel","maxZoomLevel","numZoomLevels"],b=0,c=a.length;b<c;b++){var d=a[b];this[d]=null!=this.options[d]?this.options[d]:this.map[d]}if(null==this.minZoomLevel||this.minZoomLevel<this.MIN_ZOOM_LEVEL)this.minZoomLevel=this.MIN_ZOOM_LEVEL;a=this.MAX_ZOOM_LEVEL-this.minZoomLevel+1;b=null==this.options.numZoomLevels&&null!=this.options.maxZoomLevel||null==this.numZoomLevels&&null!=this.maxZoomLevel? +this.maxZoomLevel-this.minZoomLevel+1:this.numZoomLevels;this.numZoomLevels=null!=b?Math.min(b,a):a;this.maxZoomLevel=this.minZoomLevel+this.numZoomLevels-1;if(null!=this.RESOLUTIONS){a=0;this.resolutions=[];for(b=this.minZoomLevel;b<=this.maxZoomLevel;b++)this.resolutions[a++]=this.RESOLUTIONS[b];this.maxResolution=this.resolutions[0];this.minResolution=this.resolutions[this.resolutions.length-1]}},getResolution:function(){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getResolution.apply(this, +arguments);var a=null,b=this.map.getSize(),c=this.getExtent();null!=b&&null!=c&&(a=Math.max(c.getWidth()/b.w,c.getHeight()/b.h));return a},getExtent:function(){var a=this.map.getSize(),b=this.getLonLatFromViewPortPx({x:0,y:0}),a=this.getLonLatFromViewPortPx({x:a.w,y:a.h});return null!=b&&null!=a?new OpenLayers.Bounds(b.lon,a.lat,a.lon,b.lat):null},getZoomForResolution:function(a){if(null!=this.resolutions)return OpenLayers.Layer.prototype.getZoomForResolution.apply(this,arguments);var b=OpenLayers.Layer.prototype.getExtent.apply(this, +[]);return this.getZoomForExtent(b)},getOLZoomFromMapObjectZoom:function(a){var b=null;null!=a&&(b=a-this.minZoomLevel,this.map.baseLayer!==this&&(b=this.map.baseLayer.getZoomForResolution(this.getResolutionForZoom(b))));return b},getMapObjectZoomFromOLZoom:function(a){var b=null;null!=a&&(b=a+this.minZoomLevel,this.map.baseLayer!==this&&(b=this.getZoomForResolution(this.map.baseLayer.getResolutionForZoom(b))));return b},CLASS_NAME:"OpenLayers.Layer.FixedZoomLevels"});OpenLayers.Layer.Google=OpenLayers.Class(OpenLayers.Layer.EventPane,OpenLayers.Layer.FixedZoomLevels,{MIN_ZOOM_LEVEL:0,MAX_ZOOM_LEVEL:21,RESOLUTIONS:[1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.001373291015625,6.866455078125E-4,3.4332275390625E-4,1.71661376953125E-4,8.58306884765625E-5,4.291534423828125E-5,2.145767211914062E-5,1.072883605957031E-5,5.36441802978515E-6,2.68220901489257E-6,1.341104507446289E-6,6.705522537231445E-7], +type:null,wrapDateLine:!0,sphericalMercator:!1,version:null,initialize:function(a,b){b=b||{};b.version||(b.version="function"===typeof GMap2?"2":"3");var c=OpenLayers.Layer.Google["v"+b.version.replace(/\./g,"_")];if(c)OpenLayers.Util.applyDefaults(b,c);else throw"Unsupported Google Maps API version: "+b.version;OpenLayers.Util.applyDefaults(b,c.DEFAULTS);b.maxExtent&&(b.maxExtent=b.maxExtent.clone());OpenLayers.Layer.EventPane.prototype.initialize.apply(this,[a,b]);OpenLayers.Layer.FixedZoomLevels.prototype.initialize.apply(this, +[a,b]);this.sphericalMercator&&(OpenLayers.Util.extend(this,OpenLayers.Layer.SphericalMercator),this.initMercatorParameters())},clone:function(){return new OpenLayers.Layer.Google(this.name,this.getOptions())},setVisibility:function(a){var b=null==this.opacity?1:this.opacity;OpenLayers.Layer.EventPane.prototype.setVisibility.apply(this,arguments);this.setOpacity(b)},display:function(a){this._dragging||this.setGMapVisibility(a);OpenLayers.Layer.EventPane.prototype.display.apply(this,arguments)},moveTo:function(a, +b,c){this._dragging=c;OpenLayers.Layer.EventPane.prototype.moveTo.apply(this,arguments);delete this._dragging},setOpacity:function(a){a!==this.opacity&&(null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"opacity"}),this.opacity=a);if(this.getVisibility()){var b=this.getMapContainer();OpenLayers.Util.modifyDOMElement(b,null,null,null,null,null,null,a)}},destroy:function(){if(this.map){this.setGMapVisibility(!1);var a=OpenLayers.Layer.Google.cache[this.map.id];a&&1>=a.count&& +this.removeGMapElements()}OpenLayers.Layer.EventPane.prototype.destroy.apply(this,arguments)},removeGMapElements:function(){var a=OpenLayers.Layer.Google.cache[this.map.id];if(a){var b=this.mapObject&&this.getMapContainer();b&&b.parentNode&&b.parentNode.removeChild(b);(b=a.termsOfUse)&&b.parentNode&&b.parentNode.removeChild(b);(a=a.poweredBy)&&a.parentNode&&a.parentNode.removeChild(a);this.mapObject&&(window.google&&google.maps&&google.maps.event&&google.maps.event.clearListeners)&&google.maps.event.clearListeners(this.mapObject, +"tilesloaded")}},removeMap:function(a){this.visibility&&this.mapObject&&this.setGMapVisibility(!1);var b=OpenLayers.Layer.Google.cache[a.id];b&&(1>=b.count?(this.removeGMapElements(),delete OpenLayers.Layer.Google.cache[a.id]):--b.count);delete this.termsOfUse;delete this.poweredBy;delete this.mapObject;delete this.dragObject;OpenLayers.Layer.EventPane.prototype.removeMap.apply(this,arguments)},getOLBoundsFromMapObjectBounds:function(a){var b=null;null!=a&&(b=a.getSouthWest(),a=a.getNorthEast(),this.sphericalMercator? +(b=this.forwardMercator(b.lng(),b.lat()),a=this.forwardMercator(a.lng(),a.lat())):(b=new OpenLayers.LonLat(b.lng(),b.lat()),a=new OpenLayers.LonLat(a.lng(),a.lat())),b=new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat));return b},getWarningHTML:function(){return OpenLayers.i18n("googleWarning")},getMapObjectCenter:function(){return this.mapObject.getCenter()},getMapObjectZoom:function(){return this.mapObject.getZoom()},getLongitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lng(), +a.lat()).lon:a.lng()},getLatitudeFromMapObjectLonLat:function(a){return this.sphericalMercator?this.forwardMercator(a.lng(),a.lat()).lat:a.lat()},getXFromMapObjectPixel:function(a){return a.x},getYFromMapObjectPixel:function(a){return a.y},CLASS_NAME:"OpenLayers.Layer.Google"});OpenLayers.Layer.Google.cache={}; +OpenLayers.Layer.Google.v2={termsOfUse:null,poweredBy:null,dragObject:null,loadMapObject:function(){this.type||(this.type=G_NORMAL_MAP);var a,b,c,d=OpenLayers.Layer.Google.cache[this.map.id];if(d)a=d.mapObject,b=d.termsOfUse,c=d.poweredBy,++d.count;else{var d=this.map.viewPortDiv,e=document.createElement("div");e.id=this.map.id+"_GMap2Container";e.style.position="absolute";e.style.width="100%";e.style.height="100%";d.appendChild(e);try{a=new GMap2(e),b=e.lastChild,d.appendChild(b),b.style.zIndex= +"1100",b.style.right="",b.style.bottom="",b.className="olLayerGoogleCopyright",c=e.lastChild,d.appendChild(c),c.style.zIndex="1100",c.style.right="",c.style.bottom="",c.className="olLayerGooglePoweredBy gmnoprint"}catch(f){throw f;}OpenLayers.Layer.Google.cache[this.map.id]={mapObject:a,termsOfUse:b,poweredBy:c,count:1}}this.mapObject=a;this.termsOfUse=b;this.poweredBy=c;-1===OpenLayers.Util.indexOf(this.mapObject.getMapTypes(),this.type)&&this.mapObject.addMapType(this.type);"function"==typeof a.getDragObject? +this.dragObject=a.getDragObject():this.dragPanMapObject=null;!1===this.isBaseLayer&&this.setGMapVisibility("none"!==this.div.style.display)},onMapResize:function(){if(this.visibility&&this.mapObject.isLoaded())this.mapObject.checkResize();else{if(!this._resized)var a=this,b=GEvent.addListener(this.mapObject,"load",function(){GEvent.removeListener(b);delete a._resized;a.mapObject.checkResize();a.moveTo(a.map.getCenter(),a.map.getZoom())});this._resized=!0}},setGMapVisibility:function(a){var b=OpenLayers.Layer.Google.cache[this.map.id]; +if(b){var c=this.mapObject.getContainer();!0===a?(this.mapObject.setMapType(this.type),c.style.display="",this.termsOfUse.style.left="",this.termsOfUse.style.display="",this.poweredBy.style.display="",b.displayed=this.id):(b.displayed===this.id&&delete b.displayed,b.displayed||(c.style.display="none",this.termsOfUse.style.display="none",this.termsOfUse.style.left="-9999px",this.poweredBy.style.display="none"))}},getMapContainer:function(){return this.mapObject.getContainer()},getMapObjectBoundsFromOLBounds:function(a){var b= +null;null!=a&&(b=this.sphericalMercator?this.inverseMercator(a.bottom,a.left):new OpenLayers.LonLat(a.bottom,a.left),a=this.sphericalMercator?this.inverseMercator(a.top,a.right):new OpenLayers.LonLat(a.top,a.right),b=new GLatLngBounds(new GLatLng(b.lat,b.lon),new GLatLng(a.lat,a.lon)));return b},setMapObjectCenter:function(a,b){this.mapObject.setCenter(a,b)},dragPanMapObject:function(a,b){this.dragObject.moveBy(new GSize(-a,b))},getMapObjectLonLatFromMapObjectPixel:function(a){return this.mapObject.fromContainerPixelToLatLng(a)}, +getMapObjectPixelFromMapObjectLonLat:function(a){return this.mapObject.fromLatLngToContainerPixel(a)},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getMapObjectLonLatFromLonLat:function(a,b){var c;this.sphericalMercator?(c=this.inverseMercator(a,b),c=new GLatLng(c.lat,c.lon)):c=new GLatLng(b,a);return c},getMapObjectPixelFromXY:function(a,b){return new GPoint(a,b)}};OpenLayers.Format.XML=OpenLayers.Class(OpenLayers.Format,{namespaces:null,namespaceAlias:null,defaultPrefix:null,readers:{},writers:{},xmldom:null,initialize:function(a){window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM"));OpenLayers.Format.prototype.initialize.apply(this,[a]);this.namespaces=OpenLayers.Util.extend({},this.namespaces);this.namespaceAlias={};for(var b in this.namespaces)this.namespaceAlias[this.namespaces[b]]=b},destroy:function(){this.xmldom=null;OpenLayers.Format.prototype.destroy.apply(this, +arguments)},setNamespace:function(a,b){this.namespaces[a]=b;this.namespaceAlias[b]=a},read:function(a){var b=a.indexOf("<");0<b&&(a=a.substring(b));b=OpenLayers.Util.Try(OpenLayers.Function.bind(function(){var b;b=window.ActiveXObject&&!this.xmldom?new ActiveXObject("Microsoft.XMLDOM"):this.xmldom;b.loadXML(a);return b},this),function(){return(new DOMParser).parseFromString(a,"text/xml")},function(){var b=new XMLHttpRequest;b.open("GET","data:text/xml;charset=utf-8,"+encodeURIComponent(a),!1);b.overrideMimeType&& +b.overrideMimeType("text/xml");b.send(null);return b.responseXML});this.keepData&&(this.data=b);return b},write:function(a){if(this.xmldom)a=a.xml;else{var b=new XMLSerializer;if(1==a.nodeType){var c=document.implementation.createDocument("","",null);c.importNode&&(a=c.importNode(a,!0));c.appendChild(a);a=b.serializeToString(c)}else a=b.serializeToString(a)}return a},createElementNS:function(a,b){return this.xmldom?"string"==typeof a?this.xmldom.createNode(1,b,a):this.xmldom.createNode(1,b,""):document.createElementNS(a, +b)},createDocumentFragment:function(){return this.xmldom?this.xmldom.createDocumentFragment():document.createDocumentFragment()},createTextNode:function(a){"string"!==typeof a&&(a=String(a));return this.xmldom?this.xmldom.createTextNode(a):document.createTextNode(a)},getElementsByTagNameNS:function(a,b,c){var d=[];if(a.getElementsByTagNameNS)d=a.getElementsByTagNameNS(b,c);else{a=a.getElementsByTagName("*");for(var e,f,g=0,h=a.length;g<h;++g)if(e=a[g],f=e.prefix?e.prefix+":"+c:c,"*"==c||f==e.nodeName)"*"!= +b&&b!=e.namespaceURI||d.push(e)}return d},getAttributeNodeNS:function(a,b,c){var d=null;if(a.getAttributeNodeNS)d=a.getAttributeNodeNS(b,c);else{a=a.attributes;for(var e,f,g=0,h=a.length;g<h;++g)if(e=a[g],e.namespaceURI==b&&(f=e.prefix?e.prefix+":"+c:c,f==e.nodeName)){d=e;break}}return d},getAttributeNS:function(a,b,c){var d="";if(a.getAttributeNS)d=a.getAttributeNS(b,c)||"";else if(a=this.getAttributeNodeNS(a,b,c))d=a.nodeValue;return d},getChildValue:function(a,b){var c=b||"";if(a)for(var d=a.firstChild;d;d= +d.nextSibling)switch(d.nodeType){case 3:case 4:c+=d.nodeValue}return c},isSimpleContent:function(a){var b=!0;for(a=a.firstChild;a;a=a.nextSibling)if(1===a.nodeType){b=!1;break}return b},contentType:function(a){var b=!1,c=!1,d=OpenLayers.Format.XML.CONTENT_TYPE.EMPTY;for(a=a.firstChild;a;a=a.nextSibling){switch(a.nodeType){case 1:c=!0;break;case 8:break;default:b=!0}if(c&&b)break}if(c&&b)d=OpenLayers.Format.XML.CONTENT_TYPE.MIXED;else{if(c)return OpenLayers.Format.XML.CONTENT_TYPE.COMPLEX;if(b)return OpenLayers.Format.XML.CONTENT_TYPE.SIMPLE}return d}, +hasAttributeNS:function(a,b,c){var d=!1;return d=a.hasAttributeNS?a.hasAttributeNS(b,c):!!this.getAttributeNodeNS(a,b,c)},setAttributeNS:function(a,b,c,d){if(a.setAttributeNS)a.setAttributeNS(b,c,d);else if(this.xmldom)b?(b=a.ownerDocument.createNode(2,c,b),b.nodeValue=d,a.setAttributeNode(b)):a.setAttribute(c,d);else throw"setAttributeNS not implemented";},createElementNSPlus:function(a,b){b=b||{};var c=b.uri||this.namespaces[b.prefix];c||(c=a.indexOf(":"),c=this.namespaces[a.substring(0,c)]);c|| +(c=this.namespaces[this.defaultPrefix]);c=this.createElementNS(c,a);b.attributes&&this.setAttributes(c,b.attributes);var d=b.value;null!=d&&c.appendChild(this.createTextNode(d));return c},setAttributes:function(a,b){var c,d,e;for(e in b)null!=b[e]&&b[e].toString&&(c=b[e].toString(),d=this.namespaces[e.substring(0,e.indexOf(":"))]||null,this.setAttributeNS(a,d,e,c))},readNode:function(a,b){b||(b={});var c=this.readers[a.namespaceURI?this.namespaceAlias[a.namespaceURI]:this.defaultPrefix];if(c){var d= +a.localName||a.nodeName.split(":").pop();(c=c[d]||c["*"])&&c.apply(this,[a,b])}return b},readChildNodes:function(a,b){b||(b={});for(var c=a.childNodes,d,e=0,f=c.length;e<f;++e)d=c[e],1==d.nodeType&&this.readNode(d,b);return b},writeNode:function(a,b,c){var d,e=a.indexOf(":");0<e?(d=a.substring(0,e),a=a.substring(e+1)):d=c?this.namespaceAlias[c.namespaceURI]:this.defaultPrefix;b=this.writers[d][a].apply(this,[b]);c&&c.appendChild(b);return b},getChildEl:function(a,b,c){return a&&this.getThisOrNextEl(a.firstChild, +b,c)},getNextEl:function(a,b,c){return a&&this.getThisOrNextEl(a.nextSibling,b,c)},getThisOrNextEl:function(a,b,c){a:for(;a;a=a.nextSibling)switch(a.nodeType){case 1:if(!(b&&b!==(a.localName||a.nodeName.split(":").pop())||c&&c!==a.namespaceURI))break a;a=null;break a;case 3:if(/^\s*$/.test(a.nodeValue))break;case 4:case 6:case 12:case 10:case 11:a=null;break a}return a||null},lookupNamespaceURI:function(a,b){var c=null;if(a)if(a.lookupNamespaceURI)c=a.lookupNamespaceURI(b);else a:switch(a.nodeType){case 1:if(null!== +a.namespaceURI&&a.prefix===b){c=a.namespaceURI;break a}if(c=a.attributes.length)for(var d,e=0;e<c;++e)if(d=a.attributes[e],"xmlns"===d.prefix&&d.name==="xmlns:"+b){c=d.value||null;break a}else if("xmlns"===d.name&&null===b){c=d.value||null;break a}c=this.lookupNamespaceURI(a.parentNode,b);break a;case 2:c=this.lookupNamespaceURI(a.ownerElement,b);break a;case 9:c=this.lookupNamespaceURI(a.documentElement,b);break a;case 6:case 12:case 10:case 11:break a;default:c=this.lookupNamespaceURI(a.parentNode, +b)}return c},getXMLDoc:function(){OpenLayers.Format.XML.document||this.xmldom||(document.implementation&&document.implementation.createDocument?OpenLayers.Format.XML.document=document.implementation.createDocument("","",null):!this.xmldom&&window.ActiveXObject&&(this.xmldom=new ActiveXObject("Microsoft.XMLDOM")));return OpenLayers.Format.XML.document||this.xmldom},CLASS_NAME:"OpenLayers.Format.XML"});OpenLayers.Format.XML.CONTENT_TYPE={EMPTY:0,SIMPLE:1,COMPLEX:2,MIXED:3}; +OpenLayers.Format.XML.lookupNamespaceURI=OpenLayers.Function.bind(OpenLayers.Format.XML.prototype.lookupNamespaceURI,OpenLayers.Format.XML.prototype);OpenLayers.Format.XML.document=null;OpenLayers.Format.WFST=function(a){a=OpenLayers.Util.applyDefaults(a,OpenLayers.Format.WFST.DEFAULTS);var b=OpenLayers.Format.WFST["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported WFST version: "+a.version;return new b(a)};OpenLayers.Format.WFST.DEFAULTS={version:"1.0.0"};OpenLayers.Feature=OpenLayers.Class({layer:null,id:null,lonlat:null,data:null,marker:null,popupClass:null,popup:null,initialize:function(a,b,c){this.layer=a;this.lonlat=b;this.data=null!=c?c:{};this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){null!=this.layer&&null!=this.layer.map&&null!=this.popup&&this.layer.map.removePopup(this.popup);null!=this.layer&&null!=this.marker&&this.layer.removeMarker(this.marker);this.data=this.lonlat=this.id=this.layer=null;null!=this.marker&& +(this.destroyMarker(this.marker),this.marker=null);null!=this.popup&&(this.destroyPopup(this.popup),this.popup=null)},onScreen:function(){var a=!1;null!=this.layer&&null!=this.layer.map&&(a=this.layer.map.getExtent().containsLonLat(this.lonlat));return a},createMarker:function(){null!=this.lonlat&&(this.marker=new OpenLayers.Marker(this.lonlat,this.data.icon));return this.marker},destroyMarker:function(){this.marker.destroy()},createPopup:function(a){null!=this.lonlat&&(this.popup||(this.popup=new (this.popupClass? +this.popupClass:OpenLayers.Popup.Anchored)(this.id+"_popup",this.lonlat,this.data.popupSize,this.data.popupContentHTML,this.marker?this.marker.icon:null,a)),null!=this.data.overflow&&(this.popup.contentDiv.style.overflow=this.data.overflow),this.popup.feature=this);return this.popup},destroyPopup:function(){this.popup&&(this.popup.feature=null,this.popup.destroy(),this.popup=null)},CLASS_NAME:"OpenLayers.Feature"});OpenLayers.State={UNKNOWN:"Unknown",INSERT:"Insert",UPDATE:"Update",DELETE:"Delete"}; +OpenLayers.Feature.Vector=OpenLayers.Class(OpenLayers.Feature,{fid:null,geometry:null,attributes:null,bounds:null,state:null,style:null,url:null,renderIntent:"default",modified:null,initialize:function(a,b,c){OpenLayers.Feature.prototype.initialize.apply(this,[null,null,b]);this.lonlat=null;this.geometry=a?a:null;this.state=null;this.attributes={};b&&(this.attributes=OpenLayers.Util.extend(this.attributes,b));this.style=c?c:null},destroy:function(){this.layer&&(this.layer.removeFeatures(this),this.layer= +null);this.modified=this.geometry=null;OpenLayers.Feature.prototype.destroy.apply(this,arguments)},clone:function(){return new OpenLayers.Feature.Vector(this.geometry?this.geometry.clone():null,this.attributes,this.style)},onScreen:function(a){var b=!1;this.layer&&this.layer.map&&(b=this.layer.map.getExtent(),a?(a=this.geometry.getBounds(),b=b.intersectsBounds(a)):b=b.toGeometry().intersects(this.geometry));return b},getVisibility:function(){return!(this.style&&"none"==this.style.display||!this.layer|| +this.layer&&this.layer.styleMap&&"none"==this.layer.styleMap.createSymbolizer(this,this.renderIntent).display||this.layer&&!this.layer.getVisibility())},createMarker:function(){return null},destroyMarker:function(){},createPopup:function(){return null},atPoint:function(a,b,c){var d=!1;this.geometry&&(d=this.geometry.atPoint(a,b,c));return d},destroyPopup:function(){},move:function(a){if(this.layer&&this.geometry.move){a="OpenLayers.LonLat"==a.CLASS_NAME?this.layer.getViewPortPxFromLonLat(a):a;var b= +this.layer.getViewPortPxFromLonLat(this.geometry.getBounds().getCenterLonLat()),c=this.layer.map.getResolution();this.geometry.move(c*(a.x-b.x),c*(b.y-a.y));this.layer.drawFeature(this);return b}},toState:function(a){if(a==OpenLayers.State.UPDATE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.DELETE:this.state=a}else if(a==OpenLayers.State.INSERT)switch(this.state){case OpenLayers.State.UNKNOWN:break;default:this.state=a}else if(a==OpenLayers.State.DELETE)switch(this.state){case OpenLayers.State.UNKNOWN:case OpenLayers.State.UPDATE:this.state= +a}else a==OpenLayers.State.UNKNOWN&&(this.state=a)},CLASS_NAME:"OpenLayers.Feature.Vector"}); +OpenLayers.Feature.Vector.style={"default":{fillColor:"#ee9900",fillOpacity:0.4,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#ee9900",strokeOpacity:1,strokeWidth:1,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},select:{fillColor:"blue",fillOpacity:0.4, +hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"blue",strokeOpacity:1,strokeWidth:2,strokeLinecap:"round",strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"pointer",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},temporary:{fillColor:"#66cccc",fillOpacity:0.2,hoverFillColor:"white",hoverFillOpacity:0.8,strokeColor:"#66cccc",strokeOpacity:1, +strokeLinecap:"round",strokeWidth:2,strokeDashstyle:"solid",hoverStrokeColor:"red",hoverStrokeOpacity:1,hoverStrokeWidth:0.2,pointRadius:6,hoverPointRadius:1,hoverPointUnit:"%",pointerEvents:"visiblePainted",cursor:"inherit",fontColor:"#000000",labelAlign:"cm",labelOutlineColor:"white",labelOutlineWidth:3},"delete":{display:"none"}};OpenLayers.Style=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,context:null,defaultStyle:null,defaultsPerSymbolizer:!1,propertyStyles:null,initialize:function(a,b){OpenLayers.Util.extend(this,b);this.rules=[];b&&b.rules&&this.addRules(b.rules);this.setDefaultStyle(a||OpenLayers.Feature.Vector.style["default"]);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a=0,b=this.rules.length;a<b;a++)this.rules[a].destroy(), +this.rules[a]=null;this.defaultStyle=this.rules=null},createSymbolizer:function(a){for(var b=this.defaultsPerSymbolizer?{}:this.createLiterals(OpenLayers.Util.extend({},this.defaultStyle),a),c=this.rules,d,e=[],f=!1,g=0,h=c.length;g<h;g++)d=c[g],d.evaluate(a)&&(d instanceof OpenLayers.Rule&&d.elseFilter?e.push(d):(f=!0,this.applySymbolizer(d,b,a)));if(!1==f&&0<e.length)for(f=!0,g=0,h=e.length;g<h;g++)this.applySymbolizer(e[g],b,a);0<c.length&&!1==f&&(b.display="none");null!=b.label&&"string"!==typeof b.label&& +(b.label=String(b.label));return b},applySymbolizer:function(a,b,c){var d=c.geometry?this.getSymbolizerPrefix(c.geometry):OpenLayers.Style.SYMBOLIZER_PREFIXES[0];a=a.symbolizer[d]||a.symbolizer;!0===this.defaultsPerSymbolizer&&(d=this.defaultStyle,OpenLayers.Util.applyDefaults(a,{pointRadius:d.pointRadius}),!0!==a.stroke&&!0!==a.graphic||OpenLayers.Util.applyDefaults(a,{strokeWidth:d.strokeWidth,strokeColor:d.strokeColor,strokeOpacity:d.strokeOpacity,strokeDashstyle:d.strokeDashstyle,strokeLinecap:d.strokeLinecap}), +!0!==a.fill&&!0!==a.graphic||OpenLayers.Util.applyDefaults(a,{fillColor:d.fillColor,fillOpacity:d.fillOpacity}),!0===a.graphic&&OpenLayers.Util.applyDefaults(a,{pointRadius:this.defaultStyle.pointRadius,externalGraphic:this.defaultStyle.externalGraphic,graphicName:this.defaultStyle.graphicName,graphicOpacity:this.defaultStyle.graphicOpacity,graphicWidth:this.defaultStyle.graphicWidth,graphicHeight:this.defaultStyle.graphicHeight,graphicXOffset:this.defaultStyle.graphicXOffset,graphicYOffset:this.defaultStyle.graphicYOffset})); +return this.createLiterals(OpenLayers.Util.extend(b,a),c)},createLiterals:function(a,b){var c=OpenLayers.Util.extend({},b.attributes||b.data);OpenLayers.Util.extend(c,this.context);for(var d in this.propertyStyles)a[d]=OpenLayers.Style.createLiteral(a[d],c,b,d);return a},findPropertyStyles:function(){var a={};this.addPropertyStyles(a,this.defaultStyle);for(var b=this.rules,c,d,e=0,f=b.length;e<f;e++){c=b[e].symbolizer;for(var g in c)if(d=c[g],"object"==typeof d)this.addPropertyStyles(a,d);else{this.addPropertyStyles(a, +c);break}}return a},addPropertyStyles:function(a,b){var c,d;for(d in b)c=b[d],"string"==typeof c&&c.match(/\$\{\w+\}/)&&(a[d]=!0);return a},addRules:function(a){Array.prototype.push.apply(this.rules,a);this.propertyStyles=this.findPropertyStyles()},setDefaultStyle:function(a){this.defaultStyle=a;this.propertyStyles=this.findPropertyStyles()},getSymbolizerPrefix:function(a){for(var b=OpenLayers.Style.SYMBOLIZER_PREFIXES,c=0,d=b.length;c<d;c++)if(-1!=a.CLASS_NAME.indexOf(b[c]))return b[c]},clone:function(){var a= +OpenLayers.Util.extend({},this);if(this.rules){a.rules=[];for(var b=0,c=this.rules.length;b<c;++b)a.rules.push(this.rules[b].clone())}a.context=this.context&&OpenLayers.Util.extend({},this.context);b=OpenLayers.Util.extend({},this.defaultStyle);return new OpenLayers.Style(b,a)},CLASS_NAME:"OpenLayers.Style"});OpenLayers.Style.createLiteral=function(a,b,c,d){"string"==typeof a&&-1!=a.indexOf("${")&&(a=OpenLayers.String.format(a,b,[c,d]),a=isNaN(a)||!a?a:parseFloat(a));return a}; +OpenLayers.Style.SYMBOLIZER_PREFIXES=["Point","Line","Polygon","Text","Raster"];OpenLayers.Filter=OpenLayers.Class({initialize:function(a){OpenLayers.Util.extend(this,a)},destroy:function(){},evaluate:function(a){return!0},clone:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.CQL?OpenLayers.Format.CQL.prototype.write(this):Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Filter"});OpenLayers.Filter.Spatial=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,distance:null,distanceUnits:null,evaluate:function(a){var b=!1;switch(this.type){case OpenLayers.Filter.Spatial.BBOX:case OpenLayers.Filter.Spatial.INTERSECTS:if(a.geometry){var c=this.value;"OpenLayers.Bounds"==this.value.CLASS_NAME&&(c=this.value.toGeometry());a.geometry.intersects(c)&&(b=!0)}break;default:throw Error("evaluate is not implemented for this filter type.");}return b},clone:function(){var a= +OpenLayers.Util.applyDefaults({value:this.value&&this.value.clone&&this.value.clone()},this);return new OpenLayers.Filter.Spatial(a)},CLASS_NAME:"OpenLayers.Filter.Spatial"});OpenLayers.Filter.Spatial.BBOX="BBOX";OpenLayers.Filter.Spatial.INTERSECTS="INTERSECTS";OpenLayers.Filter.Spatial.DWITHIN="DWITHIN";OpenLayers.Filter.Spatial.WITHIN="WITHIN";OpenLayers.Filter.Spatial.CONTAINS="CONTAINS";OpenLayers.Filter.FeatureId=OpenLayers.Class(OpenLayers.Filter,{fids:null,type:"FID",initialize:function(a){this.fids=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},evaluate:function(a){for(var b=0,c=this.fids.length;b<c;b++)if((a.fid||a.id)==this.fids[b])return!0;return!1},clone:function(){var a=new OpenLayers.Filter.FeatureId;OpenLayers.Util.extend(a,this);a.fids=this.fids.slice();return a},CLASS_NAME:"OpenLayers.Filter.FeatureId"});OpenLayers.Format.WFST.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs",gml:"http://www.opengis.net/gml",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows"},defaultPrefix:"wfs",version:null,schemaLocations:null,srsName:null,extractAttributes:!0,xy:!0,stateName:null,initialize:function(a){this.stateName={};this.stateName[OpenLayers.State.INSERT]="wfs:Insert";this.stateName[OpenLayers.State.UPDATE]= +"wfs:Update";this.stateName[OpenLayers.State.DELETE]="wfs:Delete";OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},getSrsName:function(a,b){var c=b&&b.srsName;c||(c=a&&a.layer?a.layer.projection.getCode():this.srsName);return c},read:function(a,b){b=b||{};OpenLayers.Util.applyDefaults(b,{output:"features"});"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var c={};a&&this.readNode(a,c,!0);c.features&&"features"===b.output&& +(c=c.features);return c},readers:{wfs:{FeatureCollection:function(a,b){b.features=[];this.readChildNodes(a,b)}}},write:function(a,b){var c=this.writeNode("wfs:Transaction",{features:a,options:b}),d=this.schemaLocationAttr();d&&this.setAttributeNS(c,this.namespaces.xsi,"xsi:schemaLocation",d);return OpenLayers.Format.XML.prototype.write.apply(this,[c])},writers:{wfs:{GetFeature:function(a){var b=this.createElementNSPlus("wfs:GetFeature",{attributes:{service:"WFS",version:this.version,handle:a&&a.handle, +outputFormat:a&&a.outputFormat,maxFeatures:a&&a.maxFeatures,"xsi:schemaLocation":this.schemaLocationAttr(a)}});if("string"==typeof this.featureType)this.writeNode("Query",a,b);else for(var c=0,d=this.featureType.length;c<d;c++)a.featureType=this.featureType[c],this.writeNode("Query",a,b);return b},Transaction:function(a){a=a||{};var b=a.options||{},c=this.createElementNSPlus("wfs:Transaction",{attributes:{service:"WFS",version:this.version,handle:b.handle}}),d,e=a.features;if(e){!0===b.multi&&OpenLayers.Util.extend(this.geometryTypes, +{"OpenLayers.Geometry.Point":"MultiPoint","OpenLayers.Geometry.LineString":!0===this.multiCurve?"MultiCurve":"MultiLineString","OpenLayers.Geometry.Polygon":!0===this.multiSurface?"MultiSurface":"MultiPolygon"});var f,g;a=0;for(d=e.length;a<d;++a)g=e[a],(f=this.stateName[g.state])&&this.writeNode(f,{feature:g,options:b},c);!0===b.multi&&this.setGeometryTypes()}if(b.nativeElements)for(a=0,d=b.nativeElements.length;a<d;++a)this.writeNode("wfs:Native",b.nativeElements[a],c);return c},Native:function(a){return this.createElementNSPlus("wfs:Native", +{attributes:{vendorId:a.vendorId,safeToIgnore:a.safeToIgnore},value:a.value})},Insert:function(a){var b=a.feature;a=a.options;a=this.createElementNSPlus("wfs:Insert",{attributes:{handle:a&&a.handle}});this.srsName=this.getSrsName(b);this.writeNode("feature:_typeName",b,a);return a},Update:function(a){var b=a.feature;a=a.options;a=this.createElementNSPlus("wfs:Update",{attributes:{handle:a&&a.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});this.featureNS&&a.setAttribute("xmlns:"+ +this.featurePrefix,this.featureNS);var c=b.modified;null===this.geometryName||c&&void 0===c.geometry||(this.srsName=this.getSrsName(b),this.writeNode("Property",{name:this.geometryName,value:b.geometry},a));for(var d in b.attributes)void 0===b.attributes[d]||c&&c.attributes&&(!c.attributes||void 0===c.attributes[d])||this.writeNode("Property",{name:d,value:b.attributes[d]},a);this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[b.fid]}),a);return a},Property:function(a){var b=this.createElementNSPlus("wfs:Property"); +this.writeNode("Name",a.name,b);null!==a.value&&this.writeNode("Value",a.value,b);return b},Name:function(a){return this.createElementNSPlus("wfs:Name",{value:a})},Value:function(a){var b;a instanceof OpenLayers.Geometry?(b=this.createElementNSPlus("wfs:Value"),a=this.writeNode("feature:_geometry",a).firstChild,b.appendChild(a)):b=this.createElementNSPlus("wfs:Value",{value:a});return b},Delete:function(a){var b=a.feature;a=a.options;a=this.createElementNSPlus("wfs:Delete",{attributes:{handle:a&& +a.handle,typeName:(this.featureNS?this.featurePrefix+":":"")+this.featureType}});this.featureNS&&a.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);this.writeNode("ogc:Filter",new OpenLayers.Filter.FeatureId({fids:[b.fid]}),a);return a}}},schemaLocationAttr:function(a){a=OpenLayers.Util.extend({featurePrefix:this.featurePrefix,schema:this.schema},a);var b=OpenLayers.Util.extend({},this.schemaLocations);a.schema&&(b[a.featurePrefix]=a.schema);a=[];var c,d;for(d in b)(c=this.namespaces[d])&& +a.push(c+" "+b[d]);return a.join(" ")||void 0},setFilterProperty:function(a){if(a.filters)for(var b=0,c=a.filters.length;b<c;++b)OpenLayers.Format.WFST.v1.prototype.setFilterProperty.call(this,a.filters[b]);else a instanceof OpenLayers.Filter.Spatial&&!a.property&&(a.property=this.geometryName)},CLASS_NAME:"OpenLayers.Format.WFST.v1"});OpenLayers.Format.OGCExceptionReport=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},defaultPrefix:"ogc",read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b={exceptionReport:null};a.documentElement&&(this.readChildNodes(a,b),null===b.exceptionReport&&(b=(new OpenLayers.Format.OWSCommon).read(a)));return b},readers:{ogc:{ServiceExceptionReport:function(a, +b){b.exceptionReport={exceptions:[]};this.readChildNodes(a,b.exceptionReport)},ServiceException:function(a,b){var c={code:a.getAttribute("code"),locator:a.getAttribute("locator"),text:this.getChildValue(a)};b.exceptions.push(c)}}},CLASS_NAME:"OpenLayers.Format.OGCExceptionReport"});OpenLayers.Format.XML.VersionedOGC=OpenLayers.Class(OpenLayers.Format.XML,{defaultVersion:null,version:null,profile:null,allowFallback:!1,name:null,stringifyOutput:!1,parser:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);a=this.CLASS_NAME;this.name=a.substring(a.lastIndexOf(".")+1)},getVersion:function(a,b){var c;a?(c=this.version,c||(c=a.getAttribute("version"),c||(c=this.defaultVersion))):c=b&&b.version||this.version||this.defaultVersion;return c},getParser:function(a){a= +a||this.defaultVersion;var b=this.profile?"_"+this.profile:"";if(!this.parser||this.parser.VERSION!=a){var c=OpenLayers.Format[this.name]["v"+a.replace(/\./g,"_")+b];if(!c&&(""!==b&&this.allowFallback&&(b="",c=OpenLayers.Format[this.name]["v"+a.replace(/\./g,"_")]),!c))throw"Can't find a "+this.name+" parser for version "+a+b;this.parser=new c(this.options)}return this.parser},write:function(a,b){var c=this.getVersion(null,b);this.parser=this.getParser(c);c=this.parser.write(a,b);return!1===this.stringifyOutput? +c:OpenLayers.Format.XML.prototype.write.apply(this,[c])},read:function(a,b){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var c=this.getVersion(a.documentElement);this.parser=this.getParser(c);var d=this.parser.read(a,b),e=this.parser.errorProperty||null;null!==e&&void 0===d[e]&&(e=new OpenLayers.Format.OGCExceptionReport,d.error=e.read(a));d.version=c;return d},CLASS_NAME:"OpenLayers.Format.XML.VersionedOGC"});OpenLayers.Filter.Logical=OpenLayers.Class(OpenLayers.Filter,{filters:null,type:null,initialize:function(a){this.filters=[];OpenLayers.Filter.prototype.initialize.apply(this,[a])},destroy:function(){this.filters=null;OpenLayers.Filter.prototype.destroy.apply(this)},evaluate:function(a){var b,c;switch(this.type){case OpenLayers.Filter.Logical.AND:b=0;for(c=this.filters.length;b<c;b++)if(!1==this.filters[b].evaluate(a))return!1;return!0;case OpenLayers.Filter.Logical.OR:b=0;for(c=this.filters.length;b< +c;b++)if(!0==this.filters[b].evaluate(a))return!0;return!1;case OpenLayers.Filter.Logical.NOT:return!this.filters[0].evaluate(a)}},clone:function(){for(var a=[],b=0,c=this.filters.length;b<c;++b)a.push(this.filters[b].clone());return new OpenLayers.Filter.Logical({type:this.type,filters:a})},CLASS_NAME:"OpenLayers.Filter.Logical"});OpenLayers.Filter.Logical.AND="&&";OpenLayers.Filter.Logical.OR="||";OpenLayers.Filter.Logical.NOT="!";OpenLayers.Filter.Comparison=OpenLayers.Class(OpenLayers.Filter,{type:null,property:null,value:null,matchCase:!0,lowerBoundary:null,upperBoundary:null,initialize:function(a){OpenLayers.Filter.prototype.initialize.apply(this,[a]);this.type===OpenLayers.Filter.Comparison.LIKE&&void 0===a.matchCase&&(this.matchCase=null)},evaluate:function(a){a instanceof OpenLayers.Feature.Vector&&(a=a.attributes);var b=!1;a=a[this.property];switch(this.type){case OpenLayers.Filter.Comparison.EQUAL_TO:b=this.value; +b=this.matchCase||"string"!=typeof a||"string"!=typeof b?a==b:a.toUpperCase()==b.toUpperCase();break;case OpenLayers.Filter.Comparison.NOT_EQUAL_TO:b=this.value;b=this.matchCase||"string"!=typeof a||"string"!=typeof b?a!=b:a.toUpperCase()!=b.toUpperCase();break;case OpenLayers.Filter.Comparison.LESS_THAN:b=a<this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN:b=a>this.value;break;case OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO:b=a<=this.value;break;case OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO:b= +a>=this.value;break;case OpenLayers.Filter.Comparison.BETWEEN:b=a>=this.lowerBoundary&&a<=this.upperBoundary;break;case OpenLayers.Filter.Comparison.LIKE:b=RegExp(this.value,"gi").test(a);break;case OpenLayers.Filter.Comparison.IS_NULL:b=null===a}return b},value2regex:function(a,b,c){if("."==a)throw Error("'.' is an unsupported wildCard character for OpenLayers.Filter.Comparison");a=a?a:"*";b=b?b:".";this.value=this.value.replace(RegExp("\\"+(c?c:"!")+"(.|$)","g"),"\\$1");this.value=this.value.replace(RegExp("\\"+ +b,"g"),".");this.value=this.value.replace(RegExp("\\"+a,"g"),".*");this.value=this.value.replace(RegExp("\\\\.\\*","g"),"\\"+a);return this.value=this.value.replace(RegExp("\\\\\\.","g"),"\\"+b)},regex2value:function(){var a=this.value,a=a.replace(/!/g,"!!"),a=a.replace(/(\\)?\\\./g,function(a,c){return c?a:"!."}),a=a.replace(/(\\)?\\\*/g,function(a,c){return c?a:"!*"}),a=a.replace(/\\\\/g,"\\");return a=a.replace(/\.\*/g,"*")},clone:function(){return OpenLayers.Util.extend(new OpenLayers.Filter.Comparison, +this)},CLASS_NAME:"OpenLayers.Filter.Comparison"});OpenLayers.Filter.Comparison.EQUAL_TO="==";OpenLayers.Filter.Comparison.NOT_EQUAL_TO="!=";OpenLayers.Filter.Comparison.LESS_THAN="<";OpenLayers.Filter.Comparison.GREATER_THAN=">";OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO="<=";OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO=">=";OpenLayers.Filter.Comparison.BETWEEN="..";OpenLayers.Filter.Comparison.LIKE="~";OpenLayers.Filter.Comparison.IS_NULL="NULL";OpenLayers.Format.Filter=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.Filter"});OpenLayers.Filter.Function=OpenLayers.Class(OpenLayers.Filter,{name:null,params:null,CLASS_NAME:"OpenLayers.Filter.Function"});OpenLayers.Date={dateRegEx:/^(?:(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?)?(?:(?:T(\d{1,2}):(\d{2}):(\d{2}(?:\.\d+)?)(Z|(?:[+-]\d{1,2}(?::(\d{2}))?)))|Z)?$/,toISOString:function(){return"toISOString"in Date.prototype?function(a){return a.toISOString()}:function(a){return isNaN(a.getTime())?"Invalid Date":a.getUTCFullYear()+"-"+OpenLayers.Number.zeroPad(a.getUTCMonth()+1,2)+"-"+OpenLayers.Number.zeroPad(a.getUTCDate(),2)+"T"+OpenLayers.Number.zeroPad(a.getUTCHours(),2)+":"+OpenLayers.Number.zeroPad(a.getUTCMinutes(), +2)+":"+OpenLayers.Number.zeroPad(a.getUTCSeconds(),2)+"."+OpenLayers.Number.zeroPad(a.getUTCMilliseconds(),3)+"Z"}}(),parse:function(a){var b;if((a=a.match(this.dateRegEx))&&(a[1]||a[7])){b=parseInt(a[1],10)||0;var c=parseInt(a[2],10)-1||0,d=parseInt(a[3],10)||1;b=new Date(Date.UTC(b,c,d));if(c=a[7]){var d=parseInt(a[4],10),e=parseInt(a[5],10),f=parseFloat(a[6]),g=f|0,f=Math.round(1E3*(f-g));b.setUTCHours(d,e,g,f);"Z"!==c&&(c=parseInt(c,10),a=parseInt(a[8],10)||0,a=-1E3*(60*60*c+60*a),b=new Date(b.getTime()+ +a))}}else b=new Date("invalid");return b}};OpenLayers.Format.Filter.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"ogc",schemaLocation:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){var b={};this.readers.ogc.Filter.apply(this,[a,b]);return b.filter},readers:{ogc:{_expression:function(a){for(var b="",c=a.firstChild;c;c= +c.nextSibling)switch(c.nodeType){case 1:a=this.readNode(c);a.property?b+="${"+a.property+"}":void 0!==a.value&&(b+=a.value);break;case 3:case 4:b+=c.nodeValue}return b},Filter:function(a,b){var c={fids:[],filters:[]};this.readChildNodes(a,c);0<c.fids.length?b.filter=new OpenLayers.Filter.FeatureId({fids:c.fids}):0<c.filters.length&&(b.filter=c.filters[0])},FeatureId:function(a,b){var c=a.getAttribute("fid");c&&b.fids.push(c)},And:function(a,b){var c=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND}); +this.readChildNodes(a,c);b.filters.push(c)},Or:function(a,b){var c=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.OR});this.readChildNodes(a,c);b.filters.push(c)},Not:function(a,b){var c=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.NOT});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsLessThan:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsGreaterThan:function(a, +b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsLessThanOrEqualTo:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsGreaterThanOrEqualTo:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO});this.readChildNodes(a,c);b.filters.push(c)}, +PropertyIsBetween:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN});this.readChildNodes(a,c);b.filters.push(c)},Literal:function(a,b){b.value=OpenLayers.String.numericIf(this.getChildValue(a),!0)},PropertyName:function(a,b){b.property=this.getChildValue(a)},LowerBoundary:function(a,b){b.lowerBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this,a),!0)},UpperBoundary:function(a,b){b.upperBoundary=OpenLayers.String.numericIf(this.readers.ogc._expression.call(this, +a),!0)},Intersects:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.INTERSECTS)},Within:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.WITHIN)},Contains:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.CONTAINS)},DWithin:function(a,b){this.readSpatial(a,b,OpenLayers.Filter.Spatial.DWITHIN)},Distance:function(a,b){b.distance=parseInt(this.getChildValue(a));b.distanceUnits=a.getAttribute("units")},Function:function(a,b){},PropertyIsNull:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.IS_NULL}); +this.readChildNodes(a,c);b.filters.push(c)}}},readSpatial:function(a,b,c){c=new OpenLayers.Filter.Spatial({type:c});this.readChildNodes(a,c);c.value=c.components[0];delete c.components;b.filters.push(c)},encodeLiteral:function(a){a instanceof Date&&(a=OpenLayers.Date.toISOString(a));return a},writeOgcExpression:function(a,b){a instanceof OpenLayers.Filter.Function?this.writeNode("Function",a,b):this.writeNode("Literal",a,b);return b},write:function(a){return this.writers.ogc.Filter.apply(this,[a])}, +writers:{ogc:{Filter:function(a){var b=this.createElementNSPlus("ogc:Filter");this.writeNode(this.getFilterType(a),a,b);return b},_featureIds:function(a){for(var b=this.createDocumentFragment(),c=0,d=a.fids.length;c<d;++c)this.writeNode("ogc:FeatureId",a.fids[c],b);return b},FeatureId:function(a){return this.createElementNSPlus("ogc:FeatureId",{attributes:{fid:a}})},And:function(a){for(var b=this.createElementNSPlus("ogc:And"),c,d=0,e=a.filters.length;d<e;++d)c=a.filters[d],this.writeNode(this.getFilterType(c), +c,b);return b},Or:function(a){for(var b=this.createElementNSPlus("ogc:Or"),c,d=0,e=a.filters.length;d<e;++d)c=a.filters[d],this.writeNode(this.getFilterType(c),c,b);return b},Not:function(a){var b=this.createElementNSPlus("ogc:Not");a=a.filters[0];this.writeNode(this.getFilterType(a),a,b);return b},PropertyIsLessThan:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLessThan");this.writeNode("PropertyName",a,b);this.writeOgcExpression(a.value,b);return b},PropertyIsGreaterThan:function(a){var b= +this.createElementNSPlus("ogc:PropertyIsGreaterThan");this.writeNode("PropertyName",a,b);this.writeOgcExpression(a.value,b);return b},PropertyIsLessThanOrEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLessThanOrEqualTo");this.writeNode("PropertyName",a,b);this.writeOgcExpression(a.value,b);return b},PropertyIsGreaterThanOrEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsGreaterThanOrEqualTo");this.writeNode("PropertyName",a,b);this.writeOgcExpression(a.value,b); +return b},PropertyIsBetween:function(a){var b=this.createElementNSPlus("ogc:PropertyIsBetween");this.writeNode("PropertyName",a,b);this.writeNode("LowerBoundary",a,b);this.writeNode("UpperBoundary",a,b);return b},PropertyName:function(a){return this.createElementNSPlus("ogc:PropertyName",{value:a.property})},Literal:function(a){return this.createElementNSPlus("ogc:Literal",{value:(this.encodeLiteral||OpenLayers.Format.Filter.v1.prototype.encodeLiteral)(a)})},LowerBoundary:function(a){var b=this.createElementNSPlus("ogc:LowerBoundary"); +this.writeOgcExpression(a.lowerBoundary,b);return b},UpperBoundary:function(a){var b=this.createElementNSPlus("ogc:UpperBoundary");this.writeNode("Literal",a.upperBoundary,b);return b},INTERSECTS:function(a){return this.writeSpatial(a,"Intersects")},WITHIN:function(a){return this.writeSpatial(a,"Within")},CONTAINS:function(a){return this.writeSpatial(a,"Contains")},DWITHIN:function(a){var b=this.writeSpatial(a,"DWithin");this.writeNode("Distance",a,b);return b},Distance:function(a){return this.createElementNSPlus("ogc:Distance", +{attributes:{units:a.distanceUnits},value:a.distance})},Function:function(a){var b=this.createElementNSPlus("ogc:Function",{attributes:{name:a.name}});a=a.params;for(var c=0,d=a.length;c<d;c++)this.writeOgcExpression(a[c],b);return b},PropertyIsNull:function(a){var b=this.createElementNSPlus("ogc:PropertyIsNull");this.writeNode("PropertyName",a,b);return b}}},getFilterType:function(a){var b=this.filterMap[a.type];if(!b)throw"Filter writing not supported for rule type: "+a.type;return b},filterMap:{"&&":"And", +"||":"Or","!":"Not","==":"PropertyIsEqualTo","!=":"PropertyIsNotEqualTo","<":"PropertyIsLessThan",">":"PropertyIsGreaterThan","<=":"PropertyIsLessThanOrEqualTo",">=":"PropertyIsGreaterThanOrEqualTo","..":"PropertyIsBetween","~":"PropertyIsLike",NULL:"PropertyIsNull",BBOX:"BBOX",DWITHIN:"DWITHIN",WITHIN:"WITHIN",CONTAINS:"CONTAINS",INTERSECTS:"INTERSECTS",FID:"_featureIds"},CLASS_NAME:"OpenLayers.Format.Filter.v1"});OpenLayers.Geometry=OpenLayers.Class({id:null,parent:null,bounds:null,initialize:function(){this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){this.bounds=this.id=null},clone:function(){return new OpenLayers.Geometry},setBounds:function(a){a&&(this.bounds=a.clone())},clearBounds:function(){this.bounds=null;this.parent&&this.parent.clearBounds()},extendBounds:function(a){this.getBounds()?this.bounds.extend(a):this.setBounds(a)},getBounds:function(){null==this.bounds&&this.calculateBounds(); +return this.bounds},calculateBounds:function(){},distanceTo:function(a,b){},getVertices:function(a){},atPoint:function(a,b,c){var d=!1;null!=this.getBounds()&&null!=a&&(b=null!=b?b:0,c=null!=c?c:0,d=(new OpenLayers.Bounds(this.bounds.left-b,this.bounds.bottom-c,this.bounds.right+b,this.bounds.top+c)).containsLonLat(a));return d},getLength:function(){return 0},getArea:function(){return 0},getCentroid:function(){return null},toString:function(){return OpenLayers.Format&&OpenLayers.Format.WKT?OpenLayers.Format.WKT.prototype.write(new OpenLayers.Feature.Vector(this)): +Object.prototype.toString.call(this)},CLASS_NAME:"OpenLayers.Geometry"});OpenLayers.Geometry.fromWKT=function(a){var b;if(OpenLayers.Format&&OpenLayers.Format.WKT){var c=OpenLayers.Geometry.fromWKT.format;c||(c=new OpenLayers.Format.WKT,OpenLayers.Geometry.fromWKT.format=c);a=c.read(a);if(a instanceof OpenLayers.Feature.Vector)b=a.geometry;else if(OpenLayers.Util.isArray(a)){b=a.length;for(var c=Array(b),d=0;d<b;++d)c[d]=a[d].geometry;b=new OpenLayers.Geometry.Collection(c)}}return b}; +OpenLayers.Geometry.segmentsIntersect=function(a,b,c){var d=c&&c.point;c=c&&c.tolerance;var e=!1,f=a.x1-b.x1,g=a.y1-b.y1,h=a.x2-a.x1,k=a.y2-a.y1,l=b.y2-b.y1,m=b.x2-b.x1,n=l*h-m*k,l=m*g-l*f,g=h*g-k*f;0==n?0==l&&0==g&&(e=!0):(f=l/n,n=g/n,0<=f&&(1>=f&&0<=n&&1>=n)&&(d?(h=a.x1+f*h,n=a.y1+f*k,e=new OpenLayers.Geometry.Point(h,n)):e=!0));if(c)if(e){if(d)a:for(a=[a,b],b=0;2>b;++b)for(f=a[b],k=1;3>k;++k)if(h=f["x"+k],n=f["y"+k],d=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(n-e.y,2)),d<c){e.x=h;e.y=n;break a}}else a:for(a= +[a,b],b=0;2>b;++b)for(h=a[b],n=a[(b+1)%2],k=1;3>k;++k)if(f={x:h["x"+k],y:h["y"+k]},g=OpenLayers.Geometry.distanceToSegment(f,n),g.distance<c){e=d?new OpenLayers.Geometry.Point(f.x,f.y):!0;break a}return e};OpenLayers.Geometry.distanceToSegment=function(a,b){var c=OpenLayers.Geometry.distanceSquaredToSegment(a,b);c.distance=Math.sqrt(c.distance);return c}; +OpenLayers.Geometry.distanceSquaredToSegment=function(a,b){var c=a.x,d=a.y,e=b.x1,f=b.y1,g=b.x2,h=b.y2,k=g-e,l=h-f,m=(k*(c-e)+l*(d-f))/(Math.pow(k,2)+Math.pow(l,2));0>=m||(1<=m?(e=g,f=h):(e+=m*k,f+=m*l));return{distance:Math.pow(e-c,2)+Math.pow(f-d,2),x:e,y:f,along:m}};OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry,{x:null,y:null,initialize:function(a,b){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.x=parseFloat(a);this.y=parseFloat(b)},clone:function(a){null==a&&(a=new OpenLayers.Geometry.Point(this.x,this.y));OpenLayers.Util.applyDefaults(a,this);return a},calculateBounds:function(){this.bounds=new OpenLayers.Bounds(this.x,this.y,this.x,this.y)},distanceTo:function(a,b){var c=!(b&&!1===b.edge)&&b&&b.details,d,e,f,g,h;a instanceof +OpenLayers.Geometry.Point?(e=this.x,f=this.y,g=a.x,h=a.y,d=Math.sqrt(Math.pow(e-g,2)+Math.pow(f-h,2)),d=c?{x0:e,y0:f,x1:g,y1:h,distance:d}:d):(d=a.distanceTo(this,b),c&&(d={x0:d.x1,y0:d.y1,x1:d.x0,y1:d.y0,distance:d.distance}));return d},equals:function(a){var b=!1;null!=a&&(b=this.x==a.x&&this.y==a.y||isNaN(this.x)&&isNaN(this.y)&&isNaN(a.x)&&isNaN(a.y));return b},toShortString:function(){return this.x+", "+this.y},move:function(a,b){this.x+=a;this.y+=b;this.clearBounds()},rotate:function(a,b){a*= +Math.PI/180;var c=this.distanceTo(b),d=a+Math.atan2(this.y-b.y,this.x-b.x);this.x=b.x+c*Math.cos(d);this.y=b.y+c*Math.sin(d);this.clearBounds()},getCentroid:function(){return new OpenLayers.Geometry.Point(this.x,this.y)},resize:function(a,b,c){this.x=b.x+a*(void 0==c?1:c)*(this.x-b.x);this.y=b.y+a*(this.y-b.y);this.clearBounds();return this},intersects:function(a){var b=!1;return b="OpenLayers.Geometry.Point"==a.CLASS_NAME?this.equals(a):a.intersects(this)},transform:function(a,b){a&&b&&(OpenLayers.Projection.transform(this, +a,b),this.bounds=null);return this},getVertices:function(a){return[this]},CLASS_NAME:"OpenLayers.Geometry.Point"});OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry,{components:null,componentTypes:null,initialize:function(a){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];null!=a&&this.addComponents(a)},destroy:function(){this.components.length=0;this.components=null;OpenLayers.Geometry.prototype.destroy.apply(this,arguments)},clone:function(){for(var a=eval("new "+this.CLASS_NAME+"()"),b=0,c=this.components.length;b<c;b++)a.addComponent(this.components[b].clone()); +OpenLayers.Util.applyDefaults(a,this);return a},getComponentsString:function(){for(var a=[],b=0,c=this.components.length;b<c;b++)a.push(this.components[b].toShortString());return a.join(",")},calculateBounds:function(){this.bounds=null;var a=new OpenLayers.Bounds,b=this.components;if(b)for(var c=0,d=b.length;c<d;c++)a.extend(b[c].getBounds());null!=a.left&&(null!=a.bottom&&null!=a.right&&null!=a.top)&&this.setBounds(a)},addComponents:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=0,c=a.length;b< +c;b++)this.addComponent(a[b])},addComponent:function(a,b){var c=!1;if(a&&(null==this.componentTypes||-1<OpenLayers.Util.indexOf(this.componentTypes,a.CLASS_NAME))){if(null!=b&&b<this.components.length){var c=this.components.slice(0,b),d=this.components.slice(b,this.components.length);c.push(a);this.components=c.concat(d)}else this.components.push(a);a.parent=this;this.clearBounds();c=!0}return c},removeComponents:function(a){var b=!1;OpenLayers.Util.isArray(a)||(a=[a]);for(var c=a.length-1;0<=c;--c)b= +this.removeComponent(a[c])||b;return b},removeComponent:function(a){OpenLayers.Util.removeItem(this.components,a);this.clearBounds();return!0},getLength:function(){for(var a=0,b=0,c=this.components.length;b<c;b++)a+=this.components[b].getLength();return a},getArea:function(){for(var a=0,b=0,c=this.components.length;b<c;b++)a+=this.components[b].getArea();return a},getGeodesicArea:function(a){for(var b=0,c=0,d=this.components.length;c<d;c++)b+=this.components[c].getGeodesicArea(a);return b},getCentroid:function(a){if(!a)return this.components.length&& +this.components[0].getCentroid();a=this.components.length;if(!a)return!1;for(var b=[],c=[],d=0,e=Number.MAX_VALUE,f,g=0;g<a;++g){f=this.components[g];var h=f.getArea();f=f.getCentroid(!0);isNaN(h)||(isNaN(f.x)||isNaN(f.y))||(b.push(h),d+=h,e=h<e&&0<h?h:e,c.push(f))}a=b.length;if(0===d){for(g=0;g<a;++g)b[g]=1;d=b.length}else{for(g=0;g<a;++g)b[g]/=e;d/=e}for(var k=e=0,g=0;g<a;++g)f=c[g],h=b[g],e+=f.x*h,k+=f.y*h;return new OpenLayers.Geometry.Point(e/d,k/d)},getGeodesicLength:function(a){for(var b=0, +c=0,d=this.components.length;c<d;c++)b+=this.components[c].getGeodesicLength(a);return b},move:function(a,b){for(var c=0,d=this.components.length;c<d;c++)this.components[c].move(a,b)},rotate:function(a,b){for(var c=0,d=this.components.length;c<d;++c)this.components[c].rotate(a,b)},resize:function(a,b,c){for(var d=0;d<this.components.length;++d)this.components[d].resize(a,b,c);return this},distanceTo:function(a,b){for(var c=!(b&&!1===b.edge)&&b&&b.details,d,e,f,g=Number.POSITIVE_INFINITY,h=0,k=this.components.length;h< +k&&!(d=this.components[h].distanceTo(a,b),f=c?d.distance:d,f<g&&(g=f,e=d,0==g));++h);return e},equals:function(a){var b=!0;if(a&&a.CLASS_NAME&&this.CLASS_NAME==a.CLASS_NAME)if(OpenLayers.Util.isArray(a.components)&&a.components.length==this.components.length)for(var c=0,d=this.components.length;c<d;++c){if(!this.components[c].equals(a.components[c])){b=!1;break}}else b=!1;else b=!1;return b},transform:function(a,b){if(a&&b){for(var c=0,d=this.components.length;c<d;c++)this.components[c].transform(a, +b);this.bounds=null}return this},intersects:function(a){for(var b=!1,c=0,d=this.components.length;c<d&&!(b=a.intersects(this.components[c]));++c);return b},getVertices:function(a){for(var b=[],c=0,d=this.components.length;c<d;++c)Array.prototype.push.apply(b,this.components[c].getVertices(a));return b},CLASS_NAME:"OpenLayers.Geometry.Collection"});OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Point"],addPoint:function(a,b){this.addComponent(a,b)},removePoint:function(a){this.removeComponent(a)},CLASS_NAME:"OpenLayers.Geometry.MultiPoint"});OpenLayers.Geometry.Curve=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,{componentTypes:["OpenLayers.Geometry.Point"],getLength:function(){var a=0;if(this.components&&1<this.components.length)for(var b=1,c=this.components.length;b<c;b++)a+=this.components[b-1].distanceTo(this.components[b]);return a},getGeodesicLength:function(a){var b=this;if(a){var c=new OpenLayers.Projection("EPSG:4326");c.equals(a)||(b=this.clone().transform(a,c))}a=0;if(b.components&&1<b.components.length)for(var d,e=1,f=b.components.length;e< +f;e++)c=b.components[e-1],d=b.components[e],a+=OpenLayers.Util.distVincenty({lon:c.x,lat:c.y},{lon:d.x,lat:d.y});return 1E3*a},CLASS_NAME:"OpenLayers.Geometry.Curve"});OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.Curve,{removeComponent:function(a){var b=this.components&&2<this.components.length;b&&OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this,arguments);return b},intersects:function(a){var b=!1,c=a.CLASS_NAME;if("OpenLayers.Geometry.LineString"==c||"OpenLayers.Geometry.LinearRing"==c||"OpenLayers.Geometry.Point"==c){var d=this.getSortedSegments();a="OpenLayers.Geometry.Point"==c?[{x1:a.x,y1:a.y,x2:a.x,y2:a.y}]:a.getSortedSegments(); +var e,f,g,h,k,l,m,n=0,p=d.length;a:for(;n<p;++n){c=d[n];e=c.x1;f=c.x2;g=c.y1;h=c.y2;var q=0,r=a.length;for(;q<r;++q){k=a[q];if(k.x1>f)break;if(!(k.x2<e||(l=k.y1,m=k.y2,Math.min(l,m)>Math.max(g,h)||Math.max(l,m)<Math.min(g,h)||!OpenLayers.Geometry.segmentsIntersect(c,k)))){b=!0;break a}}}}else b=a.intersects(this);return b},getSortedSegments:function(){for(var a=this.components.length-1,b=Array(a),c,d,e=0;e<a;++e)c=this.components[e],d=this.components[e+1],b[e]=c.x<d.x?{x1:c.x,y1:c.y,x2:d.x,y2:d.y}: +{x1:d.x,y1:d.y,x2:c.x,y2:c.y};return b.sort(function(a,b){return a.x1-b.x1})},splitWithSegment:function(a,b){for(var c=!(b&&!1===b.edge),d=b&&b.tolerance,e=[],f=this.getVertices(),g=[],h=[],k=!1,l,m,n,p={point:!0,tolerance:d},q=null,r=0,s=f.length-2;r<=s;++r)if(d=f[r],g.push(d.clone()),l=f[r+1],m={x1:d.x,y1:d.y,x2:l.x,y2:l.y},m=OpenLayers.Geometry.segmentsIntersect(a,m,p),m instanceof OpenLayers.Geometry.Point&&((n=m.x===a.x1&&m.y===a.y1||m.x===a.x2&&m.y===a.y2||m.equals(d)||m.equals(l)?!0:!1)||c))m.equals(h[h.length- +1])||h.push(m.clone()),0===r&&m.equals(d)||m.equals(l)||(k=!0,m.equals(d)||g.push(m),e.push(new OpenLayers.Geometry.LineString(g)),g=[m.clone()]);k&&(g.push(l.clone()),e.push(new OpenLayers.Geometry.LineString(g)));if(0<h.length)var t=a.x1<a.x2?1:-1,u=a.y1<a.y2?1:-1,q={lines:e,points:h.sort(function(a,b){return t*a.x-t*b.x||u*a.y-u*b.y})};return q},split:function(a,b){var c=null,d=b&&b.mutual,e,f,g,h;if(a instanceof OpenLayers.Geometry.LineString){var k=this.getVertices(),l,m,n,p,q,r=[];g=[];for(var s= +0,t=k.length-2;s<=t;++s){l=k[s];m=k[s+1];n={x1:l.x,y1:l.y,x2:m.x,y2:m.y};h=h||[a];d&&r.push(l.clone());for(var u=0;u<h.length;++u)if(p=h[u].splitWithSegment(n,b))if(q=p.lines,0<q.length&&(q.unshift(u,1),Array.prototype.splice.apply(h,q),u+=q.length-2),d)for(var v=0,w=p.points.length;v<w;++v)q=p.points[v],q.equals(l)||(r.push(q),g.push(new OpenLayers.Geometry.LineString(r)),r=q.equals(m)?[]:[q.clone()])}d&&(0<g.length&&0<r.length)&&(r.push(m.clone()),g.push(new OpenLayers.Geometry.LineString(r)))}else c= +a.splitWith(this,b);h&&1<h.length?f=!0:h=[];g&&1<g.length?e=!0:g=[];if(f||e)c=d?[g,h]:h;return c},splitWith:function(a,b){return a.split(this,b)},getVertices:function(a){return!0===a?[this.components[0],this.components[this.components.length-1]]:!1===a?this.components.slice(1,this.components.length-1):this.components.slice()},distanceTo:function(a,b){var c=!(b&&!1===b.edge)&&b&&b.details,d,e={},f=Number.POSITIVE_INFINITY;if(a instanceof OpenLayers.Geometry.Point){for(var g=this.getSortedSegments(), +h=a.x,k=a.y,l,m=0,n=g.length;m<n;++m)if(l=g[m],d=OpenLayers.Geometry.distanceToSegment(a,l),d.distance<f){if(f=d.distance,e=d,0===f)break}else if(l.x2>h&&(k>l.y1&&k<l.y2||k<l.y1&&k>l.y2))break;e=c?{distance:e.distance,x0:e.x,y0:e.y,x1:h,y1:k}:e.distance}else if(a instanceof OpenLayers.Geometry.LineString){var g=this.getSortedSegments(),h=a.getSortedSegments(),p,q,r=h.length,s={point:!0},m=0,n=g.length;a:for(;m<n;++m){k=g[m];l=k.x1;q=k.y1;for(var t=0;t<r;++t)if(d=h[t],p=OpenLayers.Geometry.segmentsIntersect(k, +d,s)){f=0;e={distance:0,x0:p.x,y0:p.y,x1:p.x,y1:p.y};break a}else d=OpenLayers.Geometry.distanceToSegment({x:l,y:q},d),d.distance<f&&(f=d.distance,e={distance:f,x0:l,y0:q,x1:d.x,y1:d.y})}c||(e=e.distance);0!==f&&k&&(d=a.distanceTo(new OpenLayers.Geometry.Point(k.x2,k.y2),b),m=c?d.distance:d,m<f&&(e=c?{distance:f,x0:d.x1,y0:d.y1,x1:d.x0,y1:d.y0}:m))}else e=a.distanceTo(this,b),c&&(e={distance:e.distance,x0:e.x1,y0:e.y1,x1:e.x0,y1:e.y0});return e},simplify:function(a){if(this&&null!==this){var b=this.getVertices(); +if(3>b.length)return this;var c=function(a,b,d,k){for(var l=0,m=0,n=b,p;n<d;n++){p=a[b];var q=a[d],r=a[n],r=Math.abs(0.5*(p.x*q.y+q.x*r.y+r.x*p.y-q.x*p.y-r.x*q.y-p.x*r.y));p=Math.sqrt(Math.pow(p.x-q.x,2)+Math.pow(p.y-q.y,2));p=2*(r/p);p>l&&(l=p,m=n)}l>k&&m!=b&&(e.push(m),c(a,b,m,k),c(a,m,d,k))},d=b.length-1,e=[];e.push(0);for(e.push(d);b[0].equals(b[d]);)d--,e.push(d);c(b,0,d,a);a=[];e.sort(function(a,b){return a-b});for(d=0;d<e.length;d++)a.push(b[e[d]]);return new OpenLayers.Geometry.LineString(a)}return this}, +CLASS_NAME:"OpenLayers.Geometry.LineString"});OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LineString"],split:function(a,b){for(var c=null,d=b&&b.mutual,e,f,g,h,k=[],l=[a],m=0,n=this.components.length;m<n;++m){f=this.components[m];g=!1;for(var p=0;p<l.length;++p)if(e=f.split(l[p],b)){if(d){g=e[0];for(var q=0,r=g.length;q<r;++q)0===q&&k.length?k[k.length-1].addComponent(g[q]):k.push(new OpenLayers.Geometry.MultiLineString([g[q]]));g=!0;e=e[1]}if(e.length){e.unshift(p, +1);Array.prototype.splice.apply(l,e);break}}g||(k.length?k[k.length-1].addComponent(f.clone()):k=[new OpenLayers.Geometry.MultiLineString(f.clone())])}k&&1<k.length?g=!0:k=[];l&&1<l.length?h=!0:l=[];if(g||h)c=d?[k,l]:l;return c},splitWith:function(a,b){var c=null,d=b&&b.mutual,e,f,g,h,k,l;if(a instanceof OpenLayers.Geometry.LineString){l=[];k=[a];for(var m=0,n=this.components.length;m<n;++m){g=!1;f=this.components[m];for(var p=0;p<k.length;++p)if(e=k[p].split(f,b)){d&&(g=e[0],g.length&&(g.unshift(p, +1),Array.prototype.splice.apply(k,g),p+=g.length-2),e=e[1],0===e.length&&(e=[f.clone()]));g=0;for(var q=e.length;g<q;++g)0===g&&l.length?l[l.length-1].addComponent(e[g]):l.push(new OpenLayers.Geometry.MultiLineString([e[g]]));g=!0}g||(l.length?l[l.length-1].addComponent(f.clone()):l=[new OpenLayers.Geometry.MultiLineString([f.clone()])])}}else c=a.split(this);k&&1<k.length?h=!0:k=[];l&&1<l.length?g=!0:l=[];if(h||g)c=d?[k,l]:l;return c},CLASS_NAME:"OpenLayers.Geometry.MultiLineString"});OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LineString,{componentTypes:["OpenLayers.Geometry.Point"],addComponent:function(a,b){var c=!1,d=this.components.pop();null==b&&a.equals(d)||(c=OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,arguments));OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]]);return c},removeComponent:function(a){var b=this.components&&3<this.components.length;b&&(this.components.pop(),OpenLayers.Geometry.Collection.prototype.removeComponent.apply(this, +arguments),OpenLayers.Geometry.Collection.prototype.addComponent.apply(this,[this.components[0]]));return b},move:function(a,b){for(var c=0,d=this.components.length;c<d-1;c++)this.components[c].move(a,b)},rotate:function(a,b){for(var c=0,d=this.components.length;c<d-1;++c)this.components[c].rotate(a,b)},resize:function(a,b,c){for(var d=0,e=this.components.length;d<e-1;++d)this.components[d].resize(a,b,c);return this},transform:function(a,b){if(a&&b){for(var c=0,d=this.components.length;c<d-1;c++)this.components[c].transform(a, +b);this.bounds=null}return this},getCentroid:function(){if(this.components){var a=this.components.length;if(0<a&&2>=a)return this.components[0].clone();if(2<a){var b=0,c=0,d=this.components[0].x,e=this.components[0].y,f=-1*this.getArea();if(0!=f){for(var g=0;g<a-1;g++)var h=this.components[g],k=this.components[g+1],b=b+(h.x+k.x-2*d)*((h.x-d)*(k.y-e)-(k.x-d)*(h.y-e)),c=c+(h.y+k.y-2*e)*((h.x-d)*(k.y-e)-(k.x-d)*(h.y-e));b=d+b/(6*f);a=e+c/(6*f)}else{for(g=0;g<a-1;g++)b+=this.components[g].x,c+=this.components[g].y; +b/=a-1;a=c/(a-1)}return new OpenLayers.Geometry.Point(b,a)}return null}},getArea:function(){var a=0;if(this.components&&2<this.components.length){for(var b=a=0,c=this.components.length;b<c-1;b++)var d=this.components[b],e=this.components[b+1],a=a+(d.x+e.x)*(e.y-d.y);a=-a/2}return a},getGeodesicArea:function(a){var b=this;if(a){var c=new OpenLayers.Projection("EPSG:4326");c.equals(a)||(b=this.clone().transform(a,c))}a=0;c=b.components&&b.components.length;if(2<c){for(var d,e,f=0;f<c-1;f++)d=b.components[f], +e=b.components[f+1],a+=OpenLayers.Util.rad(e.x-d.x)*(2+Math.sin(OpenLayers.Util.rad(d.y))+Math.sin(OpenLayers.Util.rad(e.y)));a=40680631590769*a/2}return a},containsPoint:function(a){var b=OpenLayers.Number.limitSigDigs,c=b(a.x,14);a=b(a.y,14);for(var d=this.components.length-1,e,f,g,h,k,l=0,m=0;m<d;++m)if(e=this.components[m],g=b(e.x,14),e=b(e.y,14),f=this.components[m+1],h=b(f.x,14),f=b(f.y,14),e==f){if(a==e&&(g<=h&&c>=g&&c<=h||g>=h&&c<=g&&c>=h)){l=-1;break}}else{k=b((a-f)*((h-g)/(f-e))+h,14);if(k== +c&&(e<f&&a>=e&&a<=f||e>f&&a<=e&&a>=f)){l=-1;break}k<=c||g!=h&&(k<Math.min(g,h)||k>Math.max(g,h))||(e<f&&a>=e&&a<f||e>f&&a<e&&a>=f)&&++l}return-1==l?1:!!(l&1)},intersects:function(a){var b=!1;if("OpenLayers.Geometry.Point"==a.CLASS_NAME)b=this.containsPoint(a);else if("OpenLayers.Geometry.LineString"==a.CLASS_NAME)b=a.intersects(this);else if("OpenLayers.Geometry.LinearRing"==a.CLASS_NAME)b=OpenLayers.Geometry.LineString.prototype.intersects.apply(this,[a]);else for(var c=0,d=a.components.length;c< +d&&!(b=a.components[c].intersects(this));++c);return b},getVertices:function(a){return!0===a?[]:this.components.slice(0,this.components.length-1)},CLASS_NAME:"OpenLayers.Geometry.LinearRing"});OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.LinearRing"],getArea:function(){var a=0;if(this.components&&0<this.components.length)for(var a=a+Math.abs(this.components[0].getArea()),b=1,c=this.components.length;b<c;b++)a-=Math.abs(this.components[b].getArea());return a},getGeodesicArea:function(a){var b=0;if(this.components&&0<this.components.length)for(var b=b+Math.abs(this.components[0].getGeodesicArea(a)),c=1,d=this.components.length;c< +d;c++)b-=Math.abs(this.components[c].getGeodesicArea(a));return b},containsPoint:function(a){var b=this.components.length,c=!1;if(0<b&&(c=this.components[0].containsPoint(a),1!==c&&c&&1<b))for(var d,e=1;e<b;++e)if(d=this.components[e].containsPoint(a)){c=1===d?1:!1;break}return c},intersects:function(a){var b=!1,c,d;if("OpenLayers.Geometry.Point"==a.CLASS_NAME)b=this.containsPoint(a);else if("OpenLayers.Geometry.LineString"==a.CLASS_NAME||"OpenLayers.Geometry.LinearRing"==a.CLASS_NAME){c=0;for(d= +this.components.length;c<d&&!(b=a.intersects(this.components[c]));++c);if(!b)for(c=0,d=a.components.length;c<d&&!(b=this.containsPoint(a.components[c]));++c);}else for(c=0,d=a.components.length;c<d&&!(b=this.intersects(a.components[c]));++c);if(!b&&"OpenLayers.Geometry.Polygon"==a.CLASS_NAME){var e=this.components[0];c=0;for(d=e.components.length;c<d&&!(b=a.containsPoint(e.components[c]));++c);}return b},distanceTo:function(a,b){return b&&!1===b.edge&&this.intersects(a)?0:OpenLayers.Geometry.Collection.prototype.distanceTo.apply(this, +[a,b])},CLASS_NAME:"OpenLayers.Geometry.Polygon"});OpenLayers.Geometry.Polygon.createRegularPolygon=function(a,b,c,d){var e=Math.PI*(1/c-0.5);d&&(e+=d/180*Math.PI);for(var f,g=[],h=0;h<c;++h)f=e+2*h*Math.PI/c,d=a.x+b*Math.cos(f),f=a.y+b*Math.sin(f),g.push(new OpenLayers.Geometry.Point(d,f));a=new OpenLayers.Geometry.LinearRing(g);return new OpenLayers.Geometry.Polygon([a])};OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.Collection,{componentTypes:["OpenLayers.Geometry.Polygon"],CLASS_NAME:"OpenLayers.Geometry.MultiPolygon"});OpenLayers.Format.GML=OpenLayers.Class(OpenLayers.Format.XML,{featureNS:"http://mapserver.gis.umn.edu/mapserver",featurePrefix:"feature",featureName:"featureMember",layerName:"features",geometryName:"geometry",collectionName:"FeatureCollection",gmlns:"http://www.opengis.net/gml",extractAttributes:!0,xy:!0,initialize:function(a){this.regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g};OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){"string"== +typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a=this.getElementsByTagNameNS(a.documentElement,this.gmlns,this.featureName);for(var b=[],c=0;c<a.length;c++){var d=this.parseFeature(a[c]);d&&b.push(d)}return b},parseFeature:function(a){for(var b="MultiPolygon Polygon MultiLineString LineString MultiPoint Point Envelope".split(" "),c,d,e,f=0;f<b.length;++f)if(c=b[f],d=this.getElementsByTagNameNS(a,this.gmlns,c),0<d.length){if(e=this.parseGeometry[c.toLowerCase()])e=e.apply(this, +[d[0]]),this.internalProjection&&this.externalProjection&&e.transform(this.externalProjection,this.internalProjection);else throw new TypeError("Unsupported geometry type: "+c);break}var g;c=this.getElementsByTagNameNS(a,this.gmlns,"Box");for(f=0;f<c.length;++f)b=c[f],d=this.parseGeometry.box.apply(this,[b]),b=b.parentNode,"boundedBy"===(b.localName||b.nodeName.split(":").pop())?g=d:e=d.toGeometry();var h;this.extractAttributes&&(h=this.parseAttributes(a));h=new OpenLayers.Feature.Vector(e,h);h.bounds= +g;h.gml={featureType:a.firstChild.nodeName.split(":")[1],featureNS:a.firstChild.namespaceURI,featureNSPrefix:a.firstChild.prefix};a=a.firstChild;for(var k;a&&(1!=a.nodeType||!(k=a.getAttribute("fid")||a.getAttribute("id")));)a=a.nextSibling;h.fid=k;return h},parseGeometry:{point:function(a){var b,c;c=[];b=this.getElementsByTagNameNS(a,this.gmlns,"pos");0<b.length&&(c=b[0].firstChild.nodeValue,c=c.replace(this.regExes.trimSpace,""),c=c.split(this.regExes.splitSpace));0==c.length&&(b=this.getElementsByTagNameNS(a, +this.gmlns,"coordinates"),0<b.length&&(c=b[0].firstChild.nodeValue,c=c.replace(this.regExes.removeSpace,""),c=c.split(",")));0==c.length&&(b=this.getElementsByTagNameNS(a,this.gmlns,"coord"),0<b.length&&(a=this.getElementsByTagNameNS(b[0],this.gmlns,"X"),b=this.getElementsByTagNameNS(b[0],this.gmlns,"Y"),0<a.length&&0<b.length&&(c=[a[0].firstChild.nodeValue,b[0].firstChild.nodeValue])));2==c.length&&(c[2]=null);return this.xy?new OpenLayers.Geometry.Point(c[0],c[1],c[2]):new OpenLayers.Geometry.Point(c[1], +c[0],c[2])},multipoint:function(a){a=this.getElementsByTagNameNS(a,this.gmlns,"Point");var b=[];if(0<a.length)for(var c,d=0;d<a.length;++d)(c=this.parseGeometry.point.apply(this,[a[d]]))&&b.push(c);return new OpenLayers.Geometry.MultiPoint(b)},linestring:function(a,b){var c,d;d=[];var e=[];c=this.getElementsByTagNameNS(a,this.gmlns,"posList");if(0<c.length){d=this.getChildValue(c[0]);d=d.replace(this.regExes.trimSpace,"");d=d.split(this.regExes.splitSpace);var f=parseInt(c[0].getAttribute("dimension")), +g,h,k;for(c=0;c<d.length/f;++c)g=c*f,h=d[g],k=d[g+1],g=2==f?null:d[g+2],this.xy?e.push(new OpenLayers.Geometry.Point(h,k,g)):e.push(new OpenLayers.Geometry.Point(k,h,g))}if(0==d.length&&(c=this.getElementsByTagNameNS(a,this.gmlns,"coordinates"),0<c.length))for(d=this.getChildValue(c[0]),d=d.replace(this.regExes.trimSpace,""),d=d.replace(this.regExes.trimComma,","),f=d.split(this.regExes.splitSpace),c=0;c<f.length;++c)d=f[c].split(","),2==d.length&&(d[2]=null),this.xy?e.push(new OpenLayers.Geometry.Point(d[0], +d[1],d[2])):e.push(new OpenLayers.Geometry.Point(d[1],d[0],d[2]));d=null;0!=e.length&&(d=b?new OpenLayers.Geometry.LinearRing(e):new OpenLayers.Geometry.LineString(e));return d},multilinestring:function(a){a=this.getElementsByTagNameNS(a,this.gmlns,"LineString");var b=[];if(0<a.length)for(var c,d=0;d<a.length;++d)(c=this.parseGeometry.linestring.apply(this,[a[d]]))&&b.push(c);return new OpenLayers.Geometry.MultiLineString(b)},polygon:function(a){a=this.getElementsByTagNameNS(a,this.gmlns,"LinearRing"); +var b=[];if(0<a.length)for(var c,d=0;d<a.length;++d)(c=this.parseGeometry.linestring.apply(this,[a[d],!0]))&&b.push(c);return new OpenLayers.Geometry.Polygon(b)},multipolygon:function(a){a=this.getElementsByTagNameNS(a,this.gmlns,"Polygon");var b=[];if(0<a.length)for(var c,d=0;d<a.length;++d)(c=this.parseGeometry.polygon.apply(this,[a[d]]))&&b.push(c);return new OpenLayers.Geometry.MultiPolygon(b)},envelope:function(a){var b=[],c,d,e=this.getElementsByTagNameNS(a,this.gmlns,"lowerCorner");if(0<e.length){c= +[];0<e.length&&(c=e[0].firstChild.nodeValue,c=c.replace(this.regExes.trimSpace,""),c=c.split(this.regExes.splitSpace));2==c.length&&(c[2]=null);var f=this.xy?new OpenLayers.Geometry.Point(c[0],c[1],c[2]):new OpenLayers.Geometry.Point(c[1],c[0],c[2])}a=this.getElementsByTagNameNS(a,this.gmlns,"upperCorner");if(0<a.length){c=[];0<a.length&&(c=a[0].firstChild.nodeValue,c=c.replace(this.regExes.trimSpace,""),c=c.split(this.regExes.splitSpace));2==c.length&&(c[2]=null);var g=this.xy?new OpenLayers.Geometry.Point(c[0], +c[1],c[2]):new OpenLayers.Geometry.Point(c[1],c[0],c[2])}f&&g&&(b.push(new OpenLayers.Geometry.Point(f.x,f.y)),b.push(new OpenLayers.Geometry.Point(g.x,f.y)),b.push(new OpenLayers.Geometry.Point(g.x,g.y)),b.push(new OpenLayers.Geometry.Point(f.x,g.y)),b.push(new OpenLayers.Geometry.Point(f.x,f.y)),b=new OpenLayers.Geometry.LinearRing(b),d=new OpenLayers.Geometry.Polygon([b]));return d},box:function(a){var b=this.getElementsByTagNameNS(a,this.gmlns,"coordinates"),c=a=null;0<b.length&&(b=b[0].firstChild.nodeValue, +b=b.split(" "),2==b.length&&(a=b[0].split(","),c=b[1].split(",")));if(null!==a&&null!==c)return new OpenLayers.Bounds(parseFloat(a[0]),parseFloat(a[1]),parseFloat(c[0]),parseFloat(c[1]))}},parseAttributes:function(a){var b={};a=a.firstChild;for(var c,d,e;a;){if(1==a.nodeType){a=a.childNodes;for(c=0;c<a.length;++c)if(d=a[c],1==d.nodeType)if(e=d.childNodes,1==e.length){if(e=e[0],3==e.nodeType||4==e.nodeType)d=d.prefix?d.nodeName.split(":")[1]:d.nodeName,e=e.nodeValue.replace(this.regExes.trimSpace, +""),b[d]=e}else b[d.nodeName.split(":").pop()]=null;break}a=a.nextSibling}return b},write:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=this.createElementNS("http://www.opengis.net/wfs","wfs:"+this.collectionName),c=0;c<a.length;c++)b.appendChild(this.createFeatureXML(a[c]));return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFeatureXML:function(a){var b=this.buildGeometryNode(a.geometry),c=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.geometryName);c.appendChild(b); +var b=this.createElementNS(this.gmlns,"gml:"+this.featureName),d=this.createElementNS(this.featureNS,this.featurePrefix+":"+this.layerName);d.setAttribute("fid",a.fid||a.id);d.appendChild(c);for(var e in a.attributes){var c=this.createTextNode(a.attributes[e]),f=e.substring(e.lastIndexOf(":")+1),f=this.createElementNS(this.featureNS,this.featurePrefix+":"+f);f.appendChild(c);d.appendChild(f)}b.appendChild(d);return b},buildGeometryNode:function(a){this.externalProjection&&this.internalProjection&& +(a=a.clone(),a.transform(this.internalProjection,this.externalProjection));var b=a.CLASS_NAME,b=b.substring(b.lastIndexOf(".")+1);return this.buildGeometry[b.toLowerCase()].apply(this,[a])},buildGeometry:{point:function(a){var b=this.createElementNS(this.gmlns,"gml:Point");b.appendChild(this.buildCoordinatesNode(a));return b},multipoint:function(a){var b=this.createElementNS(this.gmlns,"gml:MultiPoint");a=a.components;for(var c,d,e=0;e<a.length;e++)c=this.createElementNS(this.gmlns,"gml:pointMember"), +d=this.buildGeometry.point.apply(this,[a[e]]),c.appendChild(d),b.appendChild(c);return b},linestring:function(a){var b=this.createElementNS(this.gmlns,"gml:LineString");b.appendChild(this.buildCoordinatesNode(a));return b},multilinestring:function(a){var b=this.createElementNS(this.gmlns,"gml:MultiLineString");a=a.components;for(var c,d,e=0;e<a.length;++e)c=this.createElementNS(this.gmlns,"gml:lineStringMember"),d=this.buildGeometry.linestring.apply(this,[a[e]]),c.appendChild(d),b.appendChild(c); +return b},linearring:function(a){var b=this.createElementNS(this.gmlns,"gml:LinearRing");b.appendChild(this.buildCoordinatesNode(a));return b},polygon:function(a){var b=this.createElementNS(this.gmlns,"gml:Polygon");a=a.components;for(var c,d,e=0;e<a.length;++e)c=0==e?"outerBoundaryIs":"innerBoundaryIs",c=this.createElementNS(this.gmlns,"gml:"+c),d=this.buildGeometry.linearring.apply(this,[a[e]]),c.appendChild(d),b.appendChild(c);return b},multipolygon:function(a){var b=this.createElementNS(this.gmlns, +"gml:MultiPolygon");a=a.components;for(var c,d,e=0;e<a.length;++e)c=this.createElementNS(this.gmlns,"gml:polygonMember"),d=this.buildGeometry.polygon.apply(this,[a[e]]),c.appendChild(d),b.appendChild(c);return b},bounds:function(a){var b=this.createElementNS(this.gmlns,"gml:Box");b.appendChild(this.buildCoordinatesNode(a));return b}},buildCoordinatesNode:function(a){var b=this.createElementNS(this.gmlns,"gml:coordinates");b.setAttribute("decimal",".");b.setAttribute("cs",",");b.setAttribute("ts", +" ");var c=[];if(a instanceof OpenLayers.Bounds)c.push(a.left+","+a.bottom),c.push(a.right+","+a.top);else{a=a.components?a.components:[a];for(var d=0;d<a.length;d++)c.push(a[d].x+","+a[d].y)}c=this.createTextNode(c.join(" "));b.appendChild(c);return b},CLASS_NAME:"OpenLayers.Format.GML"});OpenLayers.Format.GML||(OpenLayers.Format.GML={}); +OpenLayers.Format.GML.Base=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",wfs:"http://www.opengis.net/wfs"},defaultPrefix:"gml",schemaLocation:null,featureType:null,featureNS:null,geometryName:"geometry",extractAttributes:!0,srsName:null,xy:!0,geometryTypes:null,singleFeatureType:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g,featureMember:/^(.*:)?featureMembers?$/}, +initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.setGeometryTypes();a&&a.featureNS&&this.setNamespace("feature",a.featureNS);this.singleFeatureType=!a||"string"===typeof a.featureType},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b=[];this.readNode(a,{features:b},!0);if(0==b.length){var c=this.getElementsByTagNameNS(a,this.namespaces.gml,"featureMember");if(c.length){a= +0;for(var d=c.length;a<d;++a)this.readNode(c[a],{features:b},!0)}else c=this.getElementsByTagNameNS(a,this.namespaces.gml,"featureMembers"),c.length&&this.readNode(c[0],{features:b},!0)}return b},readNode:function(a,b,c){!0===c&&!0===this.autoConfig&&(this.featureType=null,delete this.namespaceAlias[this.featureNS],delete this.namespaces.feature,this.featureNS=null);this.featureNS||(a.prefix in this.namespaces||a.parentNode.namespaceURI!=this.namespaces.gml||!this.regExes.featureMember.test(a.parentNode.nodeName))|| +(this.featureType=a.nodeName.split(":").pop(),this.setNamespace("feature",a.namespaceURI),this.featureNS=a.namespaceURI,this.autoConfig=!0);return OpenLayers.Format.XML.prototype.readNode.apply(this,[a,b])},readers:{gml:{_inherit:function(a,b,c){},featureMember:function(a,b){this.readChildNodes(a,b)},featureMembers:function(a,b){this.readChildNodes(a,b)},name:function(a,b){b.name=this.getChildValue(a)},boundedBy:function(a,b){var c={};this.readChildNodes(a,c);c.components&&0<c.components.length&& +(b.bounds=c.components[0])},Point:function(a,b){var c={points:[]};this.readChildNodes(a,c);b.components||(b.components=[]);b.components.push(c.points[0])},coordinates:function(a,b){for(var c=this.getChildValue(a).replace(this.regExes.trimSpace,""),c=c.replace(this.regExes.trimComma,","),c=c.split(this.regExes.splitSpace),d,e=c.length,f=Array(e),g=0;g<e;++g)d=c[g].split(","),f[g]=this.xy?new OpenLayers.Geometry.Point(d[0],d[1],d[2]):new OpenLayers.Geometry.Point(d[1],d[0],d[2]);b.points=f},coord:function(a, +b){var c={};this.readChildNodes(a,c);b.points||(b.points=[]);b.points.push(new OpenLayers.Geometry.Point(c.x,c.y,c.z))},X:function(a,b){b.x=this.getChildValue(a)},Y:function(a,b){b.y=this.getChildValue(a)},Z:function(a,b){b.z=this.getChildValue(a)},MultiPoint:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.MultiPoint(c.components)]},pointMember:function(a,b){this.readChildNodes(a,b)},LineString:function(a, +b){var c={};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components||(b.components=[]);b.components.push(new OpenLayers.Geometry.LineString(c.points))},MultiLineString:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.MultiLineString(c.components)]},lineStringMember:function(a,b){this.readChildNodes(a,b)},Polygon:function(a,b){var c={outer:null,inner:[]};this.readers.gml._inherit.apply(this, +[a,c,b]);this.readChildNodes(a,c);c.inner.unshift(c.outer);b.components||(b.components=[]);b.components.push(new OpenLayers.Geometry.Polygon(c.inner))},LinearRing:function(a,b){var c={};this.readers.gml._inherit.apply(this,[a,c]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.LinearRing(c.points)]},MultiPolygon:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.MultiPolygon(c.components)]}, +polygonMember:function(a,b){this.readChildNodes(a,b)},GeometryCollection:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components=[new OpenLayers.Geometry.Collection(c.components)]},geometryMember:function(a,b){this.readChildNodes(a,b)}},feature:{"*":function(a,b){var c,d=a.localName||a.nodeName.split(":").pop();b.features?this.singleFeatureType||-1===OpenLayers.Util.indexOf(this.featureType,d)?d===this.featureType&&(c="_typeName"):c= +"_typeName":0==a.childNodes.length||1==a.childNodes.length&&3==a.firstChild.nodeType?this.extractAttributes&&(c="_attribute"):c="_geometry";c&&this.readers.feature[c].apply(this,[a,b])},_typeName:function(a,b){var c={components:[],attributes:{}};this.readChildNodes(a,c);c.name&&(c.attributes.name=c.name);var d=new OpenLayers.Feature.Vector(c.components[0],c.attributes);this.singleFeatureType||(d.type=a.nodeName.split(":").pop(),d.namespace=a.namespaceURI);var e=a.getAttribute("fid")||this.getAttributeNS(a, +this.namespaces.gml,"id");e&&(d.fid=e);this.internalProjection&&(this.externalProjection&&d.geometry)&&d.geometry.transform(this.externalProjection,this.internalProjection);c.bounds&&(d.bounds=c.bounds);b.features.push(d)},_geometry:function(a,b){this.geometryName||(this.geometryName=a.nodeName.split(":").pop());this.readChildNodes(a,b)},_attribute:function(a,b){var c=a.localName||a.nodeName.split(":").pop(),d=this.getChildValue(a);b.attributes[c]=d}},wfs:{FeatureCollection:function(a,b){this.readChildNodes(a, +b)}}},write:function(a){var b;b=OpenLayers.Util.isArray(a)?"featureMembers":"featureMember";a=this.writeNode("gml:"+b,a);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:{featureMember:function(a){var b=this.createElementNSPlus("gml:featureMember");this.writeNode("feature:_typeName",a,b);return b},MultiPoint:function(a){var b=this.createElementNSPlus("gml:MultiPoint");a=a.components||[a]; +for(var c=0,d=a.length;c<d;++c)this.writeNode("pointMember",a[c],b);return b},pointMember:function(a){var b=this.createElementNSPlus("gml:pointMember");this.writeNode("Point",a,b);return b},MultiLineString:function(a){var b=this.createElementNSPlus("gml:MultiLineString");a=a.components||[a];for(var c=0,d=a.length;c<d;++c)this.writeNode("lineStringMember",a[c],b);return b},lineStringMember:function(a){var b=this.createElementNSPlus("gml:lineStringMember");this.writeNode("LineString",a,b);return b}, +MultiPolygon:function(a){var b=this.createElementNSPlus("gml:MultiPolygon");a=a.components||[a];for(var c=0,d=a.length;c<d;++c)this.writeNode("polygonMember",a[c],b);return b},polygonMember:function(a){var b=this.createElementNSPlus("gml:polygonMember");this.writeNode("Polygon",a,b);return b},GeometryCollection:function(a){for(var b=this.createElementNSPlus("gml:GeometryCollection"),c=0,d=a.components.length;c<d;++c)this.writeNode("geometryMember",a.components[c],b);return b},geometryMember:function(a){var b= +this.createElementNSPlus("gml:geometryMember");a=this.writeNode("feature:_geometry",a);b.appendChild(a.firstChild);return b}},feature:{_typeName:function(a){var b=this.createElementNSPlus("feature:"+this.featureType,{attributes:{fid:a.fid}});a.geometry&&this.writeNode("feature:_geometry",a.geometry,b);for(var c in a.attributes){var d=a.attributes[c];null!=d&&this.writeNode("feature:_attribute",{name:c,value:d},b)}return b},_geometry:function(a){this.externalProjection&&this.internalProjection&&(a= +a.clone().transform(this.internalProjection,this.externalProjection));var b=this.createElementNSPlus("feature:"+this.geometryName);a=this.writeNode("gml:"+this.geometryTypes[a.CLASS_NAME],a,b);this.srsName&&a.setAttribute("srsName",this.srsName);return b},_attribute:function(a){return this.createElementNSPlus("feature:"+a.name,{value:a.value})}},wfs:{FeatureCollection:function(a){for(var b=this.createElementNSPlus("wfs:FeatureCollection"),c=0,d=a.length;c<d;++c)this.writeNode("gml:featureMember", +a[c],b);return b}}},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":"LineString","OpenLayers.Geometry.MultiLineString":"MultiLineString","OpenLayers.Geometry.Polygon":"Polygon","OpenLayers.Geometry.MultiPolygon":"MultiPolygon","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.Base"});OpenLayers.Format.GML.v3=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",curve:!1,multiCurve:!0,surface:!1,multiSurface:!0,initialize:function(a){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[a])},readers:{gml:OpenLayers.Util.applyDefaults({_inherit:function(a,b,c){if(a=parseInt(a.getAttribute("srsDimension"),10)||c&&c.srsDimension)b.srsDimension=a},featureMembers:function(a, +b){this.readChildNodes(a,b)},Curve:function(a,b){var c={points:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);b.components||(b.components=[]);b.components.push(new OpenLayers.Geometry.LineString(c.points))},segments:function(a,b){this.readChildNodes(a,b)},LineStringSegment:function(a,b){var c={};this.readChildNodes(a,c);c.points&&Array.prototype.push.apply(b.points,c.points)},pos:function(a,b){var c=this.getChildValue(a).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace), +c=this.xy?new OpenLayers.Geometry.Point(c[0],c[1],c[2]):new OpenLayers.Geometry.Point(c[1],c[0],c[2]);b.points=[c]},posList:function(a,b){for(var c=this.getChildValue(a).replace(this.regExes.trimSpace,"").split(this.regExes.splitSpace),d=b.srsDimension||parseInt(a.getAttribute("srsDimension")||a.getAttribute("dimension"),10)||2,e,f,g,h=Array(c.length/d),k=0,l=c.length;k<l;k+=d)e=c[k],f=c[k+1],g=2==d?void 0:c[k+2],h[k/d]=this.xy?new OpenLayers.Geometry.Point(e,f,g):new OpenLayers.Geometry.Point(f, +e,g);b.points=h},Surface:function(a,b){this.readChildNodes(a,b)},patches:function(a,b){this.readChildNodes(a,b)},PolygonPatch:function(a,b){this.readers.gml.Polygon.apply(this,[a,b])},exterior:function(a,b){var c={};this.readChildNodes(a,c);b.outer=c.components[0]},interior:function(a,b){var c={};this.readChildNodes(a,c);b.inner.push(c.components[0])},MultiCurve:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);0<c.components.length&&(b.components= +[new OpenLayers.Geometry.MultiLineString(c.components)])},curveMember:function(a,b){this.readChildNodes(a,b)},MultiSurface:function(a,b){var c={components:[]};this.readers.gml._inherit.apply(this,[a,c,b]);this.readChildNodes(a,c);0<c.components.length&&(b.components=[new OpenLayers.Geometry.MultiPolygon(c.components)])},surfaceMember:function(a,b){this.readChildNodes(a,b)},surfaceMembers:function(a,b){this.readChildNodes(a,b)},pointMembers:function(a,b){this.readChildNodes(a,b)},lineStringMembers:function(a, +b){this.readChildNodes(a,b)},polygonMembers:function(a,b){this.readChildNodes(a,b)},geometryMembers:function(a,b){this.readChildNodes(a,b)},Envelope:function(a,b){var c={points:Array(2)};this.readChildNodes(a,c);b.components||(b.components=[]);var d=c.points[0],c=c.points[1];b.components.push(new OpenLayers.Bounds(d.x,d.y,c.x,c.y))},lowerCorner:function(a,b){var c={};this.readers.gml.pos.apply(this,[a,c]);b.points[0]=c.points[0]},upperCorner:function(a,b){var c={};this.readers.gml.pos.apply(this, +[a,c]);b.points[1]=c.points[0]}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(a){var b;b=OpenLayers.Util.isArray(a)?"featureMembers":"featureMember";a=this.writeNode("gml:"+b,a);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:OpenLayers.Util.applyDefaults({featureMembers:function(a){for(var b= +this.createElementNSPlus("gml:featureMembers"),c=0,d=a.length;c<d;++c)this.writeNode("feature:_typeName",a[c],b);return b},Point:function(a){var b=this.createElementNSPlus("gml:Point");this.writeNode("pos",a,b);return b},pos:function(a){return this.createElementNSPlus("gml:pos",{value:this.xy?a.x+" "+a.y:a.y+" "+a.x})},LineString:function(a){var b=this.createElementNSPlus("gml:LineString");this.writeNode("posList",a.components,b);return b},Curve:function(a){var b=this.createElementNSPlus("gml:Curve"); +this.writeNode("segments",a,b);return b},segments:function(a){var b=this.createElementNSPlus("gml:segments");this.writeNode("LineStringSegment",a,b);return b},LineStringSegment:function(a){var b=this.createElementNSPlus("gml:LineStringSegment");this.writeNode("posList",a.components,b);return b},posList:function(a){for(var b=a.length,c=Array(b),d,e=0;e<b;++e)d=a[e],c[e]=this.xy?d.x+" "+d.y:d.y+" "+d.x;return this.createElementNSPlus("gml:posList",{value:c.join(" ")})},Surface:function(a){var b=this.createElementNSPlus("gml:Surface"); +this.writeNode("patches",a,b);return b},patches:function(a){var b=this.createElementNSPlus("gml:patches");this.writeNode("PolygonPatch",a,b);return b},PolygonPatch:function(a){var b=this.createElementNSPlus("gml:PolygonPatch",{attributes:{interpolation:"planar"}});this.writeNode("exterior",a.components[0],b);for(var c=1,d=a.components.length;c<d;++c)this.writeNode("interior",a.components[c],b);return b},Polygon:function(a){var b=this.createElementNSPlus("gml:Polygon");this.writeNode("exterior",a.components[0], +b);for(var c=1,d=a.components.length;c<d;++c)this.writeNode("interior",a.components[c],b);return b},exterior:function(a){var b=this.createElementNSPlus("gml:exterior");this.writeNode("LinearRing",a,b);return b},interior:function(a){var b=this.createElementNSPlus("gml:interior");this.writeNode("LinearRing",a,b);return b},LinearRing:function(a){var b=this.createElementNSPlus("gml:LinearRing");this.writeNode("posList",a.components,b);return b},MultiCurve:function(a){var b=this.createElementNSPlus("gml:MultiCurve"); +a=a.components||[a];for(var c=0,d=a.length;c<d;++c)this.writeNode("curveMember",a[c],b);return b},curveMember:function(a){var b=this.createElementNSPlus("gml:curveMember");this.curve?this.writeNode("Curve",a,b):this.writeNode("LineString",a,b);return b},MultiSurface:function(a){var b=this.createElementNSPlus("gml:MultiSurface");a=a.components||[a];for(var c=0,d=a.length;c<d;++c)this.writeNode("surfaceMember",a[c],b);return b},surfaceMember:function(a){var b=this.createElementNSPlus("gml:surfaceMember"); +this.surface?this.writeNode("Surface",a,b):this.writeNode("Polygon",a,b);return b},Envelope:function(a){var b=this.createElementNSPlus("gml:Envelope");this.writeNode("lowerCorner",a,b);this.writeNode("upperCorner",a,b);this.srsName&&b.setAttribute("srsName",this.srsName);return b},lowerCorner:function(a){return this.createElementNSPlus("gml:lowerCorner",{value:this.xy?a.left+" "+a.bottom:a.bottom+" "+a.left})},upperCorner:function(a){return this.createElementNSPlus("gml:upperCorner",{value:this.xy? +a.right+" "+a.top:a.top+" "+a.right})}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs},setGeometryTypes:function(){this.geometryTypes={"OpenLayers.Geometry.Point":"Point","OpenLayers.Geometry.MultiPoint":"MultiPoint","OpenLayers.Geometry.LineString":!0===this.curve?"Curve":"LineString","OpenLayers.Geometry.MultiLineString":!1===this.multiCurve?"MultiLineString":"MultiCurve","OpenLayers.Geometry.Polygon":!0=== +this.surface?"Surface":"Polygon","OpenLayers.Geometry.MultiPolygon":!1===this.multiSurface?"MultiPolygon":"MultiSurface","OpenLayers.Geometry.Collection":"GeometryCollection"}},CLASS_NAME:"OpenLayers.Format.GML.v3"});OpenLayers.Format.Filter.v1_1_0=OpenLayers.Class(OpenLayers.Format.GML.v3,OpenLayers.Format.Filter.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.1.0/filter.xsd",initialize:function(a){OpenLayers.Format.GML.v3.prototype.initialize.apply(this,[a])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(a,b){var c=a.getAttribute("matchCase"),c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,matchCase:!("false"===c||"0"===c)});this.readChildNodes(a, +c);b.filters.push(c)},PropertyIsNotEqualTo:function(a,b){var c=a.getAttribute("matchCase"),c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO,matchCase:!("false"===c||"0"===c)});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsLike:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(a,c);var d=a.getAttribute("wildCard"),e=a.getAttribute("singleChar"),f=a.getAttribute("escapeChar");c.value2regex(d,e, +f);b.filters.push(c)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v3.prototype.readers.gml,feature:OpenLayers.Format.GML.v3.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsEqualTo",{attributes:{matchCase:a.matchCase}});this.writeNode("PropertyName",a,b);this.writeOgcExpression(a.value,b);return b},PropertyIsNotEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsNotEqualTo", +{attributes:{matchCase:a.matchCase}});this.writeNode("PropertyName",a,b);this.writeOgcExpression(a.value,b);return b},PropertyIsLike:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLike",{attributes:{matchCase:a.matchCase,wildCard:"*",singleChar:".",escapeChar:"!"}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.regex2value(),b);return b},BBOX:function(a){var b=this.createElementNSPlus("ogc:BBOX");a.property&&this.writeNode("PropertyName",a,b);var c=this.writeNode("gml:Envelope", +a.value);a.projection&&c.setAttribute("srsName",a.projection);b.appendChild(c);return b},SortBy:function(a){for(var b=this.createElementNSPlus("ogc:SortBy"),c=0,d=a.length;c<d;c++)this.writeNode("ogc:SortProperty",a[c],b);return b},SortProperty:function(a){var b=this.createElementNSPlus("ogc:SortProperty");this.writeNode("ogc:PropertyName",a,b);this.writeNode("ogc:SortOrder","DESC"==a.order?"DESC":"ASC",b);return b},SortOrder:function(a){return this.createElementNSPlus("ogc:SortOrder",{value:a})}}, +OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature},writeSpatial:function(a,b){var c=this.createElementNSPlus("ogc:"+b);this.writeNode("PropertyName",a,c);if(a.value instanceof OpenLayers.Filter.Function)this.writeNode("Function",a.value,c);else{var d;d=a.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",a.value).firstChild:this.writeNode("gml:Envelope",a.value);a.projection&& +d.setAttribute("srsName",a.projection);c.appendChild(d)}return c},CLASS_NAME:"OpenLayers.Format.Filter.v1_1_0"});OpenLayers.Format.OWSCommon=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",getVersion:function(a,b){var c=this.version;if(!c){var d=a.getAttribute("xmlns:ows");d&&"1.1"===d.substring(d.lastIndexOf("/")+1)&&(c="1.1.0");c||(c=this.defaultVersion)}return c},CLASS_NAME:"OpenLayers.Format.OWSCommon"});OpenLayers.Format.OWSCommon.v1=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(a,b){OpenLayers.Util.applyDefaults(b,this.options);var c={};this.readChildNodes(a,c);return c},readers:{ows:{Exception:function(a,b){var c={code:a.getAttribute("exceptionCode"),locator:a.getAttribute("locator"),texts:[]};b.exceptions.push(c);this.readChildNodes(a,c)},ExceptionText:function(a,b){var c=this.getChildValue(a);b.texts.push(c)}, +ServiceIdentification:function(a,b){b.serviceIdentification={};this.readChildNodes(a,b.serviceIdentification)},Title:function(a,b){b.title=this.getChildValue(a)},Abstract:function(a,b){b["abstract"]=this.getChildValue(a)},Keywords:function(a,b){b.keywords={};this.readChildNodes(a,b.keywords)},Keyword:function(a,b){b[this.getChildValue(a)]=!0},ServiceType:function(a,b){b.serviceType={codeSpace:a.getAttribute("codeSpace"),value:this.getChildValue(a)}},ServiceTypeVersion:function(a,b){b.serviceTypeVersion= +this.getChildValue(a)},Fees:function(a,b){b.fees=this.getChildValue(a)},AccessConstraints:function(a,b){b.accessConstraints=this.getChildValue(a)},ServiceProvider:function(a,b){b.serviceProvider={};this.readChildNodes(a,b.serviceProvider)},ProviderName:function(a,b){b.providerName=this.getChildValue(a)},ProviderSite:function(a,b){b.providerSite=this.getAttributeNS(a,this.namespaces.xlink,"href")},ServiceContact:function(a,b){b.serviceContact={};this.readChildNodes(a,b.serviceContact)},IndividualName:function(a, +b){b.individualName=this.getChildValue(a)},PositionName:function(a,b){b.positionName=this.getChildValue(a)},ContactInfo:function(a,b){b.contactInfo={};this.readChildNodes(a,b.contactInfo)},Phone:function(a,b){b.phone={};this.readChildNodes(a,b.phone)},Voice:function(a,b){b.voice=this.getChildValue(a)},Address:function(a,b){b.address={};this.readChildNodes(a,b.address)},DeliveryPoint:function(a,b){b.deliveryPoint=this.getChildValue(a)},City:function(a,b){b.city=this.getChildValue(a)},AdministrativeArea:function(a, +b){b.administrativeArea=this.getChildValue(a)},PostalCode:function(a,b){b.postalCode=this.getChildValue(a)},Country:function(a,b){b.country=this.getChildValue(a)},ElectronicMailAddress:function(a,b){b.electronicMailAddress=this.getChildValue(a)},Role:function(a,b){b.role=this.getChildValue(a)},OperationsMetadata:function(a,b){b.operationsMetadata={};this.readChildNodes(a,b.operationsMetadata)},Operation:function(a,b){var c=a.getAttribute("name");b[c]={};this.readChildNodes(a,b[c])},DCP:function(a, +b){b.dcp={};this.readChildNodes(a,b.dcp)},HTTP:function(a,b){b.http={};this.readChildNodes(a,b.http)},Get:function(a,b){b.get||(b.get=[]);var c={url:this.getAttributeNS(a,this.namespaces.xlink,"href")};this.readChildNodes(a,c);b.get.push(c)},Post:function(a,b){b.post||(b.post=[]);var c={url:this.getAttributeNS(a,this.namespaces.xlink,"href")};this.readChildNodes(a,c);b.post.push(c)},Parameter:function(a,b){b.parameters||(b.parameters={});var c=a.getAttribute("name");b.parameters[c]={};this.readChildNodes(a, +b.parameters[c])},Constraint:function(a,b){b.constraints||(b.constraints={});var c=a.getAttribute("name");b.constraints[c]={};this.readChildNodes(a,b.constraints[c])},Value:function(a,b){b[this.getChildValue(a)]=!0},OutputFormat:function(a,b){b.formats.push({value:this.getChildValue(a)});this.readChildNodes(a,b)},WGS84BoundingBox:function(a,b){var c={};c.crs=a.getAttribute("crs");b.BoundingBox?b.BoundingBox.push(c):(b.projection=c.crs,c=b);this.readChildNodes(a,c)},BoundingBox:function(a,b){this.readers.ows.WGS84BoundingBox.apply(this, +[a,b])},LowerCorner:function(a,b){var c=this.getChildValue(a).replace(this.regExes.trimSpace,""),c=c.replace(this.regExes.trimComma,","),c=c.split(this.regExes.splitSpace);b.left=c[0];b.bottom=c[1]},UpperCorner:function(a,b){var c=this.getChildValue(a).replace(this.regExes.trimSpace,""),c=c.replace(this.regExes.trimComma,","),c=c.split(this.regExes.splitSpace);b.right=c[0];b.top=c[1];b.bounds=new OpenLayers.Bounds(b.left,b.bottom,b.right,b.top);delete b.left;delete b.bottom;delete b.right;delete b.top}, +Language:function(a,b){b.language=this.getChildValue(a)}}},writers:{ows:{BoundingBox:function(a,b){var c=this.createElementNSPlus(b||"ows:BoundingBox",{attributes:{crs:a.projection}});this.writeNode("ows:LowerCorner",a,c);this.writeNode("ows:UpperCorner",a,c);return c},LowerCorner:function(a){return this.createElementNSPlus("ows:LowerCorner",{value:a.bounds.left+" "+a.bounds.bottom})},UpperCorner:function(a){return this.createElementNSPlus("ows:UpperCorner",{value:a.bounds.right+" "+a.bounds.top})}, +Identifier:function(a){return this.createElementNSPlus("ows:Identifier",{value:a})},Title:function(a){return this.createElementNSPlus("ows:Title",{value:a})},Abstract:function(a){return this.createElementNSPlus("ows:Abstract",{value:a})},OutputFormat:function(a){return this.createElementNSPlus("ows:OutputFormat",{value:a})}}},CLASS_NAME:"OpenLayers.Format.OWSCommon.v1"});OpenLayers.Format.OWSCommon.v1_0_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1,{namespaces:{ows:"http://www.opengis.net/ows",xlink:"http://www.w3.org/1999/xlink"},readers:{ows:OpenLayers.Util.applyDefaults({ExceptionReport:function(a,b){b.success=!1;b.exceptionReport={version:a.getAttribute("version"),language:a.getAttribute("language"),exceptions:[]};this.readChildNodes(a,b.exceptionReport)}},OpenLayers.Format.OWSCommon.v1.prototype.readers.ows)},writers:{ows:OpenLayers.Format.OWSCommon.v1.prototype.writers.ows}, +CLASS_NAME:"OpenLayers.Format.OWSCommon.v1_0_0"});OpenLayers.Format.WFST.v1_1_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_1_0,OpenLayers.Format.WFST.v1,{version:"1.1.0",schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.1.0/wfs.xsd"},initialize:function(a){OpenLayers.Format.Filter.v1_1_0.prototype.initialize.apply(this,[a]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[a])},readNode:function(a,b,c){return OpenLayers.Format.GML.v3.prototype.readNode.apply(this,arguments)},readers:{wfs:OpenLayers.Util.applyDefaults({FeatureCollection:function(a, +b){b.numberOfFeatures=parseInt(a.getAttribute("numberOfFeatures"));OpenLayers.Format.WFST.v1.prototype.readers.wfs.FeatureCollection.apply(this,arguments)},TransactionResponse:function(a,b){b.insertIds=[];b.success=!1;this.readChildNodes(a,b)},TransactionSummary:function(a,b){b.success=!0},InsertResults:function(a,b){this.readChildNodes(a,b)},Feature:function(a,b){var c={fids:[]};this.readChildNodes(a,c);b.insertIds.push(c.fids[0])}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v3.prototype.readers.gml, +feature:OpenLayers.Format.GML.v3.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.readers.ogc,ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows},writers:{wfs:OpenLayers.Util.applyDefaults({GetFeature:function(a){var b=OpenLayers.Format.WFST.v1.prototype.writers.wfs.GetFeature.apply(this,arguments);a&&this.setAttributes(b,{resultType:a.resultType,startIndex:a.startIndex,count:a.count});return b},Query:function(a){a=OpenLayers.Util.extend({featureNS:this.featureNS, +featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName},a);var b=a.featurePrefix,c=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b?b+":":"")+a.featureType,srsName:a.srsName}});a.featureNS&&c.setAttribute("xmlns:"+b,a.featureNS);if(a.propertyNames)for(var b=0,d=a.propertyNames.length;b<d;b++)this.writeNode("wfs:PropertyName",{property:a.propertyNames[b]},c);a.filter&&(OpenLayers.Format.WFST.v1_1_0.prototype.setFilterProperty.call(this,a.filter),this.writeNode("ogc:Filter", +a.filter,c));return c},PropertyName:function(a){return this.createElementNSPlus("wfs:PropertyName",{value:a.property})}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v3.prototype.writers.gml,feature:OpenLayers.Format.GML.v3.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_1_0"});OpenLayers.Protocol=OpenLayers.Class({format:null,options:null,autoDestroy:!0,defaultFilter:null,initialize:function(a){a=a||{};OpenLayers.Util.extend(this,a);this.options=a},mergeWithDefaultFilter:function(a){return a&&this.defaultFilter?new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND,filters:[this.defaultFilter,a]}):a||this.defaultFilter||void 0},destroy:function(){this.format=this.options=null},read:function(a){a=a||{};a.filter=this.mergeWithDefaultFilter(a.filter)},create:function(){}, +update:function(){},"delete":function(){},commit:function(){},abort:function(a){},createCallback:function(a,b,c){return OpenLayers.Function.bind(function(){a.apply(this,[b,c])},this)},CLASS_NAME:"OpenLayers.Protocol"});OpenLayers.Protocol.Response=OpenLayers.Class({code:null,requestType:null,last:!0,features:null,data:null,reqFeatures:null,priv:null,error:null,initialize:function(a){OpenLayers.Util.extend(this,a)},success:function(){return 0<this.code},CLASS_NAME:"OpenLayers.Protocol.Response"}); +OpenLayers.Protocol.Response.SUCCESS=1;OpenLayers.Protocol.Response.FAILURE=0;OpenLayers.Format.JSON=OpenLayers.Class(OpenLayers.Format,{indent:" ",space:" ",newline:"\n",level:0,pretty:!1,nativeJSON:function(){return!(!window.JSON||"function"!=typeof JSON.parse||"function"!=typeof JSON.stringify)}(),read:function(a,b){var c;if(this.nativeJSON)c=JSON.parse(a,b);else try{if(/^[\],:{}\s]*$/.test(a.replace(/\\["\\\/bfnrtu]/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))&&(c=eval("("+a+")"),"function"=== +typeof b)){var d=function(a,c){if(c&&"object"===typeof c)for(var e in c)c.hasOwnProperty(e)&&(c[e]=d(e,c[e]));return b(a,c)};c=d("",c)}}catch(e){}this.keepData&&(this.data=c);return c},write:function(a,b){this.pretty=!!b;var c=null,d=typeof a;if(this.serialize[d])try{c=!this.pretty&&this.nativeJSON?JSON.stringify(a):this.serialize[d].apply(this,[a])}catch(e){OpenLayers.Console.error("Trouble serializing: "+e)}return c},writeIndent:function(){var a=[];if(this.pretty)for(var b=0;b<this.level;++b)a.push(this.indent); +return a.join("")},writeNewline:function(){return this.pretty?this.newline:""},writeSpace:function(){return this.pretty?this.space:""},serialize:{object:function(a){if(null==a)return"null";if(a.constructor==Date)return this.serialize.date.apply(this,[a]);if(a.constructor==Array)return this.serialize.array.apply(this,[a]);var b=["{"];this.level+=1;var c,d,e,f=!1;for(c in a)a.hasOwnProperty(c)&&(d=OpenLayers.Format.JSON.prototype.write.apply(this,[c,this.pretty]),e=OpenLayers.Format.JSON.prototype.write.apply(this, +[a[c],this.pretty]),null!=d&&null!=e&&(f&&b.push(","),b.push(this.writeNewline(),this.writeIndent(),d,":",this.writeSpace(),e),f=!0));this.level-=1;b.push(this.writeNewline(),this.writeIndent(),"}");return b.join("")},array:function(a){var b,c=["["];this.level+=1;for(var d=0,e=a.length;d<e;++d)b=OpenLayers.Format.JSON.prototype.write.apply(this,[a[d],this.pretty]),null!=b&&(0<d&&c.push(","),c.push(this.writeNewline(),this.writeIndent(),b));this.level-=1;c.push(this.writeNewline(),this.writeIndent(), +"]");return c.join("")},string:function(a){var b={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(a)?'"'+a.replace(/([\x00-\x1f\\"])/g,function(a,d){var e=b[d];if(e)return e;e=d.charCodeAt();return"\\u00"+Math.floor(e/16).toString(16)+(e%16).toString(16)})+'"':'"'+a+'"'},number:function(a){return isFinite(a)?String(a):"null"},"boolean":function(a){return String(a)},date:function(a){function b(a){return 10>a?"0"+a:a}return'"'+a.getFullYear()+ +"-"+b(a.getMonth()+1)+"-"+b(a.getDate())+"T"+b(a.getHours())+":"+b(a.getMinutes())+":"+b(a.getSeconds())+'"'}},CLASS_NAME:"OpenLayers.Format.JSON"});OpenLayers.Format.GeoJSON=OpenLayers.Class(OpenLayers.Format.JSON,{ignoreExtraDims:!1,read:function(a,b,c){b=b?b:"FeatureCollection";var d=null,e=null,e="string"==typeof a?OpenLayers.Format.JSON.prototype.read.apply(this,[a,c]):a;if(!e)OpenLayers.Console.error("Bad JSON: "+a);else if("string"!=typeof e.type)OpenLayers.Console.error("Bad GeoJSON - no type: "+a);else if(this.isValidType(e,b))switch(b){case "Geometry":try{d=this.parseGeometry(e)}catch(f){OpenLayers.Console.error(f)}break;case "Feature":try{d= +this.parseFeature(e),d.type="Feature"}catch(g){OpenLayers.Console.error(g)}break;case "FeatureCollection":switch(d=[],e.type){case "Feature":try{d.push(this.parseFeature(e))}catch(h){d=null,OpenLayers.Console.error(h)}break;case "FeatureCollection":a=0;for(b=e.features.length;a<b;++a)try{d.push(this.parseFeature(e.features[a]))}catch(k){d=null,OpenLayers.Console.error(k)}break;default:try{var l=this.parseGeometry(e);d.push(new OpenLayers.Feature.Vector(l))}catch(m){d=null,OpenLayers.Console.error(m)}}}return d}, +isValidType:function(a,b){var c=!1;switch(b){case "Geometry":-1==OpenLayers.Util.indexOf("Point MultiPoint LineString MultiLineString Polygon MultiPolygon Box GeometryCollection".split(" "),a.type)?OpenLayers.Console.error("Unsupported geometry type: "+a.type):c=!0;break;case "FeatureCollection":c=!0;break;default:a.type==b?c=!0:OpenLayers.Console.error("Cannot convert types from "+a.type+" to "+b)}return c},parseFeature:function(a){var b,c,d;c=a.properties?a.properties:{};d=a.geometry&&a.geometry.bbox|| +a.bbox;try{b=this.parseGeometry(a.geometry)}catch(e){throw e;}b=new OpenLayers.Feature.Vector(b,c);d&&(b.bounds=OpenLayers.Bounds.fromArray(d));a.id&&(b.fid=a.id);return b},parseGeometry:function(a){if(null==a)return null;var b,c=!1;if("GeometryCollection"==a.type){if(!OpenLayers.Util.isArray(a.geometries))throw"GeometryCollection must have geometries array: "+a;b=a.geometries.length;for(var c=Array(b),d=0;d<b;++d)c[d]=this.parseGeometry.apply(this,[a.geometries[d]]);b=new OpenLayers.Geometry.Collection(c); +c=!0}else{if(!OpenLayers.Util.isArray(a.coordinates))throw"Geometry must have coordinates array: "+a;if(!this.parseCoords[a.type.toLowerCase()])throw"Unsupported geometry type: "+a.type;try{b=this.parseCoords[a.type.toLowerCase()].apply(this,[a.coordinates])}catch(e){throw e;}}this.internalProjection&&(this.externalProjection&&!c)&&b.transform(this.externalProjection,this.internalProjection);return b},parseCoords:{point:function(a){if(!1==this.ignoreExtraDims&&2!=a.length)throw"Only 2D points are supported: "+ +a;return new OpenLayers.Geometry.Point(a[0],a[1])},multipoint:function(a){for(var b=[],c=null,d=0,e=a.length;d<e;++d){try{c=this.parseCoords.point.apply(this,[a[d]])}catch(f){throw f;}b.push(c)}return new OpenLayers.Geometry.MultiPoint(b)},linestring:function(a){for(var b=[],c=null,d=0,e=a.length;d<e;++d){try{c=this.parseCoords.point.apply(this,[a[d]])}catch(f){throw f;}b.push(c)}return new OpenLayers.Geometry.LineString(b)},multilinestring:function(a){for(var b=[],c=null,d=0,e=a.length;d<e;++d){try{c= +this.parseCoords.linestring.apply(this,[a[d]])}catch(f){throw f;}b.push(c)}return new OpenLayers.Geometry.MultiLineString(b)},polygon:function(a){for(var b=[],c,d,e=0,f=a.length;e<f;++e){try{d=this.parseCoords.linestring.apply(this,[a[e]])}catch(g){throw g;}c=new OpenLayers.Geometry.LinearRing(d.components);b.push(c)}return new OpenLayers.Geometry.Polygon(b)},multipolygon:function(a){for(var b=[],c=null,d=0,e=a.length;d<e;++d){try{c=this.parseCoords.polygon.apply(this,[a[d]])}catch(f){throw f;}b.push(c)}return new OpenLayers.Geometry.MultiPolygon(b)}, +box:function(a){if(2!=a.length)throw"GeoJSON box coordinates must have 2 elements";return new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing([new OpenLayers.Geometry.Point(a[0][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[0][1]),new OpenLayers.Geometry.Point(a[1][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[1][1]),new OpenLayers.Geometry.Point(a[0][0],a[0][1])])])}},write:function(a,b){var c={type:null};if(OpenLayers.Util.isArray(a)){c.type="FeatureCollection";var d= +a.length;c.features=Array(d);for(var e=0;e<d;++e){var f=a[e];if(!f instanceof OpenLayers.Feature.Vector)throw"FeatureCollection only supports collections of features: "+f;c.features[e]=this.extract.feature.apply(this,[f])}}else 0==a.CLASS_NAME.indexOf("OpenLayers.Geometry")?c=this.extract.geometry.apply(this,[a]):a instanceof OpenLayers.Feature.Vector&&(c=this.extract.feature.apply(this,[a]),a.layer&&a.layer.projection&&(c.crs=this.createCRSObject(a)));return OpenLayers.Format.JSON.prototype.write.apply(this, +[c,b])},createCRSObject:function(a){a=a.layer.projection.toString();var b={};a.match(/epsg:/i)&&(a=parseInt(a.substring(a.indexOf(":")+1)),b=4326==a?{type:"name",properties:{name:"urn:ogc:def:crs:OGC:1.3:CRS84"}}:{type:"name",properties:{name:"EPSG:"+a}});return b},extract:{feature:function(a){var b=this.extract.geometry.apply(this,[a.geometry]),b={type:"Feature",properties:a.attributes,geometry:b};null!=a.fid&&(b.id=a.fid);return b},geometry:function(a){if(null==a)return null;this.internalProjection&& +this.externalProjection&&(a=a.clone(),a.transform(this.internalProjection,this.externalProjection));var b=a.CLASS_NAME.split(".")[2];a=this.extract[b.toLowerCase()].apply(this,[a]);return"Collection"==b?{type:"GeometryCollection",geometries:a}:{type:b,coordinates:a}},point:function(a){return[a.x,a.y]},multipoint:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.point.apply(this,[a.components[c]]));return b},linestring:function(a){for(var b=[],c=0,d=a.components.length;c< +d;++c)b.push(this.extract.point.apply(this,[a.components[c]]));return b},multilinestring:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.linestring.apply(this,[a.components[c]]));return b},polygon:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.linestring.apply(this,[a.components[c]]));return b},multipolygon:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.polygon.apply(this,[a.components[c]]));return b},collection:function(a){for(var b= +a.components.length,c=Array(b),d=0;d<b;++d)c[d]=this.extract.geometry.apply(this,[a.components[d]]);return c}},CLASS_NAME:"OpenLayers.Format.GeoJSON"});OpenLayers.Protocol.Script=OpenLayers.Class(OpenLayers.Protocol,{url:null,params:null,callback:null,callbackTemplate:"OpenLayers.Protocol.Script.registry.${id}",callbackKey:"callback",callbackPrefix:"",scope:null,format:null,pendingRequests:null,srsInBBOX:!1,initialize:function(a){a=a||{};this.params={};this.pendingRequests={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments);this.format||(this.format=new OpenLayers.Format.GeoJSON);if(!this.filterToParams&&OpenLayers.Format.QueryStringFilter){var b= +new OpenLayers.Format.QueryStringFilter({srsInBBOX:this.srsInBBOX});this.filterToParams=function(a,d){return b.write(a,d)}}},read:function(a){OpenLayers.Protocol.prototype.read.apply(this,arguments);a=OpenLayers.Util.applyDefaults(a,this.options);a.params=OpenLayers.Util.applyDefaults(a.params,this.options.params);a.filter&&this.filterToParams&&(a.params=this.filterToParams(a.filter,a.params));var b=new OpenLayers.Protocol.Response({requestType:"read"}),c=this.createRequest(a.url,a.params,OpenLayers.Function.bind(function(c){b.data= +c;this.handleRead(b,a)},this));b.priv=c;return b},createRequest:function(a,b,c){c=OpenLayers.Protocol.Script.register(c);var d=OpenLayers.String.format(this.callbackTemplate,{id:c});b=OpenLayers.Util.extend({},b);b[this.callbackKey]=this.callbackPrefix+d;a=OpenLayers.Util.urlAppend(a,OpenLayers.Util.getParameterString(b));b=document.createElement("script");b.type="text/javascript";b.src=a;b.id="OpenLayers_Protocol_Script_"+c;this.pendingRequests[b.id]=b;document.getElementsByTagName("head")[0].appendChild(b); +return b},destroyRequest:function(a){OpenLayers.Protocol.Script.unregister(a.id.split("_").pop());delete this.pendingRequests[a.id];a.parentNode&&a.parentNode.removeChild(a)},handleRead:function(a,b){this.handleResponse(a,b)},handleResponse:function(a,b){b.callback&&(a.data?(a.features=this.parseFeatures(a.data),a.code=OpenLayers.Protocol.Response.SUCCESS):a.code=OpenLayers.Protocol.Response.FAILURE,this.destroyRequest(a.priv),b.callback.call(b.scope,a))},parseFeatures:function(a){return this.format.read(a)}, +abort:function(a){if(a)this.destroyRequest(a.priv);else for(var b in this.pendingRequests)this.destroyRequest(this.pendingRequests[b])},destroy:function(){this.abort();delete this.params;delete this.format;OpenLayers.Protocol.prototype.destroy.apply(this)},CLASS_NAME:"OpenLayers.Protocol.Script"});(function(){var a=OpenLayers.Protocol.Script,b=0;a.registry={};a.register=function(c){var d="c"+ ++b;a.registry[d]=function(){c.apply(this,arguments)};return d};a.unregister=function(b){delete a.registry[b]}})();OpenLayers.Format.EncodedPolyline=OpenLayers.Class(OpenLayers.Format,{geometryType:"linestring",initialize:function(a){OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(a){var b;if("linestring"==this.geometryType)b=OpenLayers.Geometry.LineString;else if("linearring"==this.geometryType)b=OpenLayers.Geometry.LinearRing;else if("multipoint"==this.geometryType)b=OpenLayers.Geometry.MultiPoint;else if("point"!=this.geometryType&&"polygon"!=this.geometryType)return null;a=this.decodeDeltas(a, +2);for(var c=a.length,d=[],e=0;e+1<c;){var f=a[e++],g=a[e++];d.push(new OpenLayers.Geometry.Point(g,f))}return"point"==this.geometryType?new OpenLayers.Feature.Vector(d[0]):"polygon"==this.geometryType?new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(d)])):new OpenLayers.Feature.Vector(new b(d))},decode:function(a,b,c){a=this.decodeDeltas(a,b,c||1E5);c=a.length;for(var d=[],e=0;e+(b-1)<c;){for(var f=[],g=0;g<b;++g)f.push(a[e++]);d.push(f)}return d}, +write:function(a){a=(a.constructor==Array?a[0]:a).geometry;var b=a.CLASS_NAME.split(".")[2].toLowerCase();if("point"==b)a=Array(a);else if("linestring"==b||"linearring"==b||"multipoint"==b)a=a.components;else if("polygon"==b)a=a.components[0].components;else return null;for(var b=[],c=a.length,d=0;d<c;++d){var e=a[d];b.push(e.y);b.push(e.x)}return this.encodeDeltas(b,2)},encode:function(a,b,c){c=c||1E5;for(var d=[],e=a.length,f=0;f<e;++f)for(var g=a[f],h=0;h<b;++h)d.push(g[h]);return this.encodeDeltas(d, +b,c)},encodeDeltas:function(a,b,c){var d,e=Array(b);for(d=0;d<b;++d)e[d]=0;for(var f=a.length,g=0;g<f;)for(d=0;d<b;++d,++g){var h=a[g],k=h-e[d];e[d]=h;a[g]=k}return this.encodeFloats(a,c||1E5)},decodeDeltas:function(a,b,c){var d,e=Array(b);for(d=0;d<b;++d)e[d]=0;a=this.decodeFloats(a,c||1E5);c=a.length;for(var f=0;f<c;)for(d=0;d<b;++d,++f)e[d]+=a[f],a[f]=e[d];return a},encodeFloats:function(a,b){for(var c=b||1E5,d=a.length,e=0;e<d;++e)a[e]=Math.round(a[e]*c);return this.encodeSignedIntegers(a)},decodeFloats:function(a, +b){for(var c=b||1E5,d=this.decodeSignedIntegers(a),e=d.length,f=0;f<e;++f)d[f]/=c;return d},encodeSignedIntegers:function(a){for(var b=a.length,c=0;c<b;++c){var d=a[c],e=d<<1;0>d&&(e=~e);a[c]=e}return this.encodeUnsignedIntegers(a)},decodeSignedIntegers:function(a){a=this.decodeUnsignedIntegers(a);for(var b=a.length,c=0;c<b;++c){var d=a[c];a[c]=d&1?~(d>>1):d>>1}return a},encodeUnsignedIntegers:function(a){for(var b="",c=a.length,d=0;d<c;++d)b+=this.encodeUnsignedInteger(a[d]);return b},decodeUnsignedIntegers:function(a){for(var b= +[],c=0,d=0,e=a.length,f=0;f<e;++f){var g=a.charCodeAt(f)-63,c=c|(g&31)<<d;32>g?(b.push(c),d=c=0):d+=5}return b},encodeFloat:function(a,b){a=Math.round(a*(b||1E5));return this.encodeSignedInteger(a)},decodeFloat:function(a,b){return this.decodeSignedInteger(a)/(b||1E5)},encodeSignedInteger:function(a){var b=a<<1;0>a&&(b=~b);return this.encodeUnsignedInteger(b)},decodeSignedInteger:function(a){a=this.decodeUnsignedInteger(a);return a&1?~(a>>1):a>>1},encodeUnsignedInteger:function(a){for(var b,c="";32<= +a;)b=(32|a&31)+63,c+=String.fromCharCode(b),a>>=5;return c+=String.fromCharCode(a+63)},decodeUnsignedInteger:function(a){for(var b=0,c=0,d=a.length,e=0;e<d;++e){var f=a.charCodeAt(e)-63,b=b|(f&31)<<c;if(32>f)break;c+=5}return b},CLASS_NAME:"OpenLayers.Format.EncodedPolyline"});OpenLayers.Control.Panel=OpenLayers.Class(OpenLayers.Control,{controls:null,autoActivate:!0,defaultControl:null,saveState:!1,allowDepress:!1,activeState:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.controls=[];this.activeState={}},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onButtonClick);OpenLayers.Control.prototype.destroy.apply(this,arguments);for(var a,b=this.controls.length-1;0<=b;b--)a=this.controls[b],a.events&& +a.events.un({activate:this.iconOn,deactivate:this.iconOff}),a.panel_div=null;this.activeState=null},activate:function(){if(OpenLayers.Control.prototype.activate.apply(this,arguments)){for(var a,b=0,c=this.controls.length;b<c;b++)a=this.controls[b],(a===this.defaultControl||this.saveState&&this.activeState[a.id])&&a.activate();!0===this.saveState&&(this.defaultControl=null);this.redraw();return!0}return!1},deactivate:function(){if(OpenLayers.Control.prototype.deactivate.apply(this,arguments)){for(var a, +b=0,c=this.controls.length;b<c;b++)a=this.controls[b],this.activeState[a.id]=a.deactivate();this.redraw();return!0}return!1},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.outsideViewport?(this.events.attachToElement(this.div),this.events.register("buttonclick",this,this.onButtonClick)):this.map.events.register("buttonclick",this,this.onButtonClick);this.addControlsToMap(this.controls);return this.div},redraw:function(){for(var a=this.div.childNodes.length-1;0<=a;a--)this.div.removeChild(this.div.childNodes[a]); +this.div.innerHTML="";if(this.active)for(var a=0,b=this.controls.length;a<b;a++)this.div.appendChild(this.controls[a].panel_div)},activateControl:function(a){if(!this.active)return!1;if(a.type==OpenLayers.Control.TYPE_BUTTON)a.trigger();else if(a.type==OpenLayers.Control.TYPE_TOGGLE)a.active?a.deactivate():a.activate();else if(this.allowDepress&&a.active)a.deactivate();else{for(var b,c=0,d=this.controls.length;c<d;c++)b=this.controls[c],b==a||b.type!==OpenLayers.Control.TYPE_TOOL&&null!=b.type||b.deactivate(); +a.activate()}},addControls:function(a){OpenLayers.Util.isArray(a)||(a=[a]);this.controls=this.controls.concat(a);for(var b=0,c=a.length;b<c;b++){var d=a[b],e=this.createControlMarkup(d);OpenLayers.Element.addClass(e,d.displayClass+"ItemInactive");OpenLayers.Element.addClass(e,"olButton");""==d.title||e.title||(e.title=d.title);d.panel_div=e}this.map&&(this.addControlsToMap(a),this.redraw())},createControlMarkup:function(a){return document.createElement("div")},addControlsToMap:function(a){for(var b, +c=0,d=a.length;c<d;c++)b=a[c],!0===b.autoActivate?(b.autoActivate=!1,this.map.addControl(b),b.autoActivate=!0):(this.map.addControl(b),b.deactivate()),b.events.on({activate:this.iconOn,deactivate:this.iconOff})},iconOn:function(){var a=this.panel_div;a.className=a.className.replace(RegExp("\\b("+this.displayClass+"Item)Inactive\\b"),"$1Active")},iconOff:function(){var a=this.panel_div;a.className=a.className.replace(RegExp("\\b("+this.displayClass+"Item)Active\\b"),"$1Inactive")},onButtonClick:function(a){var b= +this.controls;a=a.buttonElement;for(var c=b.length-1;0<=c;--c)if(b[c].panel_div===a){this.activateControl(b[c]);break}},getControlsBy:function(a,b){var c="function"==typeof b.test;return OpenLayers.Array.filter(this.controls,function(d){return d[a]==b||c&&b.test(d[a])})},getControlsByName:function(a){return this.getControlsBy("name",a)},getControlsByClass:function(a){return this.getControlsBy("CLASS_NAME",a)},CLASS_NAME:"OpenLayers.Control.Panel"});OpenLayers.Control.Button=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_BUTTON,trigger:function(){},CLASS_NAME:"OpenLayers.Control.Button"});OpenLayers.Control.ZoomIn=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomIn()},CLASS_NAME:"OpenLayers.Control.ZoomIn"});OpenLayers.Control.ZoomOut=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomOut()},CLASS_NAME:"OpenLayers.Control.ZoomOut"});OpenLayers.Control.ZoomToMaxExtent=OpenLayers.Class(OpenLayers.Control.Button,{trigger:function(){this.map&&this.map.zoomToMaxExtent()},CLASS_NAME:"OpenLayers.Control.ZoomToMaxExtent"});OpenLayers.Control.ZoomPanel=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.ZoomIn,new OpenLayers.Control.ZoomToMaxExtent,new OpenLayers.Control.ZoomOut])},CLASS_NAME:"OpenLayers.Control.ZoomPanel"});OpenLayers.Layer.HTTPRequest=OpenLayers.Class(OpenLayers.Layer,{URL_HASH_FACTOR:(Math.sqrt(5)-1)/2,url:null,params:null,reproject:!1,initialize:function(a,b,c,d){OpenLayers.Layer.prototype.initialize.apply(this,[a,d]);this.url=b;this.params||(this.params=OpenLayers.Util.extend({},c))},destroy:function(){this.params=this.url=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){null==a&&(a=new OpenLayers.Layer.HTTPRequest(this.name,this.url,this.params,this.getOptions())); +return a=OpenLayers.Layer.prototype.clone.apply(this,[a])},setUrl:function(a){this.url=a},mergeNewParams:function(a){this.params=OpenLayers.Util.extend(this.params,a);a=this.redraw();null!=this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"params"});return a},redraw:function(a){return a?this.mergeNewParams({_olSalt:Math.random()}):OpenLayers.Layer.prototype.redraw.apply(this,[])},selectUrl:function(a,b){for(var c=1,d=0,e=a.length;d<e;d++)c*=a.charCodeAt(d)*this.URL_HASH_FACTOR, +c-=Math.floor(c);return b[Math.floor(c*b.length)]},getFullRequestString:function(a,b){var c=b||this.url,d=OpenLayers.Util.extend({},this.params),d=OpenLayers.Util.extend(d,a),e=OpenLayers.Util.getParameterString(d);OpenLayers.Util.isArray(c)&&(c=this.selectUrl(e,c));var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c)),f;for(f in d)f.toUpperCase()in e&&delete d[f];e=OpenLayers.Util.getParameterString(d);return OpenLayers.Util.urlAppend(c,e)},CLASS_NAME:"OpenLayers.Layer.HTTPRequest"});OpenLayers.Tile=OpenLayers.Class({events:null,eventListeners:null,id:null,layer:null,url:null,bounds:null,size:null,position:null,isLoading:!1,initialize:function(a,b,c,d,e,f){this.layer=a;this.position=b.clone();this.setBounds(c);this.url=d;e&&(this.size=e.clone());this.id=OpenLayers.Util.createUniqueID("Tile_");OpenLayers.Util.extend(this,f);this.events=new OpenLayers.Events(this);if(this.eventListeners instanceof Object)this.events.on(this.eventListeners)},unload:function(){this.isLoading&&(this.isLoading= +!1,this.events.triggerEvent("unload"))},destroy:function(){this.position=this.size=this.bounds=this.layer=null;this.eventListeners&&this.events.un(this.eventListeners);this.events.destroy();this.events=this.eventListeners=null},draw:function(a){a||this.clear();var b=this.shouldDraw();b&&(!a&&!1===this.events.triggerEvent("beforedraw"))&&(b=null);return b},shouldDraw:function(){var a=!1,b=this.layer.maxExtent;if(b){var c=this.layer.map,c=c.baseLayer.wrapDateLine&&c.getMaxExtent();this.bounds.intersectsBounds(b, +{inclusive:!1,worldBounds:c})&&(a=!0)}return a||this.layer.displayOutsideMaxExtent},setBounds:function(a){a=a.clone();if(this.layer.map.baseLayer.wrapDateLine){var b=this.layer.map.getMaxExtent(),c=this.layer.map.getResolution();a=a.wrapDateLine(b,{leftTolerance:c,rightTolerance:c})}this.bounds=a},moveTo:function(a,b,c){null==c&&(c=!0);this.setBounds(a);this.position=b.clone();c&&this.draw()},clear:function(a){},CLASS_NAME:"OpenLayers.Tile"});OpenLayers.Tile.Image=OpenLayers.Class(OpenLayers.Tile,{url:null,imgDiv:null,frame:null,imageReloadAttempts:null,layerAlphaHack:null,asyncRequestId:null,maxGetUrlLength:null,canvasContext:null,crossOriginKeyword:null,initialize:function(a,b,c,d,e,f){OpenLayers.Tile.prototype.initialize.apply(this,arguments);this.url=d;this.layerAlphaHack=this.layer.alpha&&OpenLayers.Util.alphaHack();if(null!=this.maxGetUrlLength||this.layer.gutter||this.layerAlphaHack)this.frame=document.createElement("div"),this.frame.style.position= +"absolute",this.frame.style.overflow="hidden";null!=this.maxGetUrlLength&&OpenLayers.Util.extend(this,OpenLayers.Tile.Image.IFrame)},destroy:function(){this.imgDiv&&(this.clear(),this.frame=this.imgDiv=null);this.asyncRequestId=null;OpenLayers.Tile.prototype.destroy.apply(this,arguments)},draw:function(){var a=OpenLayers.Tile.prototype.draw.apply(this,arguments);a?(this.layer!=this.layer.map.baseLayer&&this.layer.reproject&&(this.bounds=this.getBoundsFromBaseLayer(this.position)),this.isLoading?this._loadEvent= +"reload":(this.isLoading=!0,this._loadEvent="loadstart"),this.renderTile(),this.positionTile()):!1===a&&this.unload();return a},renderTile:function(){if(this.layer.async){var a=this.asyncRequestId=(this.asyncRequestId||0)+1;this.layer.getURLasync(this.bounds,function(b){a==this.asyncRequestId&&(this.url=b,this.initImage())},this)}else this.url=this.layer.getURL(this.bounds),this.initImage()},positionTile:function(){var a=this.getTile().style,b=this.frame?this.size:this.layer.getImageSize(this.bounds), +c=1;this.layer instanceof OpenLayers.Layer.Grid&&(c=this.layer.getServerResolution()/this.layer.map.getResolution());a.left=this.position.x+"px";a.top=this.position.y+"px";a.width=Math.round(c*b.w)+"px";a.height=Math.round(c*b.h)+"px"},clear:function(){OpenLayers.Tile.prototype.clear.apply(this,arguments);var a=this.imgDiv;if(a){var b=this.getTile();b.parentNode===this.layer.div&&this.layer.div.removeChild(b);this.setImgSrc();!0===this.layerAlphaHack&&(a.style.filter="");OpenLayers.Element.removeClass(a, +"olImageLoadError")}this.canvasContext=null},getImage:function(){if(!this.imgDiv){this.imgDiv=OpenLayers.Tile.Image.IMAGE.cloneNode(!1);var a=this.imgDiv.style;if(this.frame){var b=0,c=0;this.layer.gutter&&(b=100*(this.layer.gutter/this.layer.tileSize.w),c=100*(this.layer.gutter/this.layer.tileSize.h));a.left=-b+"%";a.top=-c+"%";a.width=2*b+100+"%";a.height=2*c+100+"%"}a.visibility="hidden";a.opacity=0;1>this.layer.opacity&&(a.filter="alpha(opacity="+100*this.layer.opacity+")");a.position="absolute"; +this.layerAlphaHack&&(a.paddingTop=a.height,a.height="0",a.width="100%");this.frame&&this.frame.appendChild(this.imgDiv)}return this.imgDiv},setImage:function(a){this.imgDiv=a},initImage:function(){if(this.url||this.imgDiv){this.events.triggerEvent("beforeload");this.layer.div.appendChild(this.getTile());this.events.triggerEvent(this._loadEvent);var a=this.getImage(),b=a.getAttribute("src")||"";this.url&&OpenLayers.Util.isEquivalentUrl(b,this.url)?this._loadTimeout=window.setTimeout(OpenLayers.Function.bind(this.onImageLoad, +this),0):(this.stopLoading(),this.crossOriginKeyword&&a.removeAttribute("crossorigin"),OpenLayers.Event.observe(a,"load",OpenLayers.Function.bind(this.onImageLoad,this)),OpenLayers.Event.observe(a,"error",OpenLayers.Function.bind(this.onImageError,this)),this.imageReloadAttempts=0,this.setImgSrc(this.url))}else this.isLoading=!1},setImgSrc:function(a){var b=this.imgDiv;a?(b.style.visibility="hidden",b.style.opacity=0,this.crossOriginKeyword&&("data:"!==a.substr(0,5)?b.setAttribute("crossorigin",this.crossOriginKeyword): +b.removeAttribute("crossorigin")),b.src=a):(this.stopLoading(),this.imgDiv=null,b.parentNode&&b.parentNode.removeChild(b))},getTile:function(){return this.frame?this.frame:this.getImage()},createBackBuffer:function(){if(this.imgDiv&&!this.isLoading){var a;this.frame?(a=this.frame.cloneNode(!1),a.appendChild(this.imgDiv)):a=this.imgDiv;this.imgDiv=null;return a}},onImageLoad:function(){var a=this.imgDiv;this.stopLoading();a.style.visibility="inherit";a.style.opacity=this.layer.opacity;this.isLoading= +!1;this.canvasContext=null;this.events.triggerEvent("loadend");!0===this.layerAlphaHack&&(a.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+a.src+"', sizingMethod='scale')")},onImageError:function(){var a=this.imgDiv;null!=a.src&&(this.imageReloadAttempts++,this.imageReloadAttempts<=OpenLayers.IMAGE_RELOAD_ATTEMPTS?this.setImgSrc(this.layer.getURL(this.bounds)):(OpenLayers.Element.addClass(a,"olImageLoadError"),this.events.triggerEvent("loaderror"),this.onImageLoad()))},stopLoading:function(){OpenLayers.Event.stopObservingElement(this.imgDiv); +window.clearTimeout(this._loadTimeout);delete this._loadTimeout},getCanvasContext:function(){if(OpenLayers.CANVAS_SUPPORTED&&this.imgDiv&&!this.isLoading){if(!this.canvasContext){var a=document.createElement("canvas");a.width=this.size.w;a.height=this.size.h;this.canvasContext=a.getContext("2d");this.canvasContext.drawImage(this.imgDiv,0,0)}return this.canvasContext}},CLASS_NAME:"OpenLayers.Tile.Image"}); +OpenLayers.Tile.Image.IMAGE=function(){var a=new Image;a.className="olTileImage";a.galleryImg="no";return a}();OpenLayers.Layer.Grid=OpenLayers.Class(OpenLayers.Layer.HTTPRequest,{tileSize:null,tileOriginCorner:"bl",tileOrigin:null,tileOptions:null,tileClass:OpenLayers.Tile.Image,grid:null,singleTile:!1,ratio:1.5,buffer:0,transitionEffect:"resize",numLoadingTiles:0,serverResolutions:null,loading:!1,backBuffer:null,gridResolution:null,backBufferResolution:null,backBufferLonLat:null,backBufferTimerId:null,removeBackBufferDelay:null,className:null,gridLayout:null,rowSign:null,transitionendEvents:["transitionend", +"webkitTransitionEnd","otransitionend","oTransitionEnd"],initialize:function(a,b,c,d){OpenLayers.Layer.HTTPRequest.prototype.initialize.apply(this,arguments);this.grid=[];this._removeBackBuffer=OpenLayers.Function.bind(this.removeBackBuffer,this);this.initProperties();this.rowSign="t"===this.tileOriginCorner.substr(0,1)?1:-1},initProperties:function(){void 0===this.options.removeBackBufferDelay&&(this.removeBackBufferDelay=this.singleTile?0:2500);void 0===this.options.className&&(this.className=this.singleTile? +"olLayerGridSingleTile":"olLayerGrid")},setMap:function(a){OpenLayers.Layer.HTTPRequest.prototype.setMap.call(this,a);OpenLayers.Element.addClass(this.div,this.className)},removeMap:function(a){this.removeBackBuffer()},destroy:function(){this.removeBackBuffer();this.clearGrid();this.tileSize=this.grid=null;OpenLayers.Layer.HTTPRequest.prototype.destroy.apply(this,arguments)},clearGrid:function(){if(this.grid){for(var a=0,b=this.grid.length;a<b;a++)for(var c=this.grid[a],d=0,e=c.length;d<e;d++)this.destroyTile(c[d]); +this.grid=[];this.gridLayout=this.gridResolution=null}},addOptions:function(a,b){var c=void 0!==a.singleTile&&a.singleTile!==this.singleTile;OpenLayers.Layer.HTTPRequest.prototype.addOptions.apply(this,arguments);this.map&&c&&(this.initProperties(),this.clearGrid(),this.tileSize=this.options.tileSize,this.setTileSize(),this.moveTo(null,!0))},clone:function(a){null==a&&(a=new OpenLayers.Layer.Grid(this.name,this.url,this.params,this.getOptions()));a=OpenLayers.Layer.HTTPRequest.prototype.clone.apply(this, +[a]);null!=this.tileSize&&(a.tileSize=this.tileSize.clone());a.grid=[];a.gridResolution=null;a.backBuffer=null;a.backBufferTimerId=null;a.loading=!1;a.numLoadingTiles=0;return a},moveTo:function(a,b,c){OpenLayers.Layer.HTTPRequest.prototype.moveTo.apply(this,arguments);a=a||this.map.getExtent();if(null!=a){var d=!this.grid.length||b,e=this.getTilesBounds(),f=this.map.getResolution();this.getServerResolution(f);if(this.singleTile){if(d||!c&&!e.containsBounds(a))b&&"resize"!==this.transitionEffect&& +this.removeBackBuffer(),b&&"resize"!==this.transitionEffect||this.applyBackBuffer(f),this.initSingleTile(a)}else(d=d||!e.intersectsBounds(a,{worldBounds:this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent()}))?(!b||"resize"!==this.transitionEffect&&this.gridResolution!==f||this.applyBackBuffer(f),this.initGriddedTiles(a)):this.moveGriddedTiles()}},getTileData:function(a){var b=null,c=a.lon,d=a.lat,e=this.grid.length;if(this.map&&e){var f=this.map.getResolution();a=this.tileSize.w;var g=this.tileSize.h, +h=this.grid[0][0].bounds,k=h.left,h=h.top;if(c<k&&this.map.baseLayer.wrapDateLine)var l=this.map.getMaxExtent().getWidth(),m=Math.ceil((k-c)/l),c=c+l*m;c=(c-k)/(f*a);d=(h-d)/(f*g);f=Math.floor(c);k=Math.floor(d);0<=k&&k<e&&(e=this.grid[k][f])&&(b={tile:e,i:Math.floor((c-f)*a),j:Math.floor((d-k)*g)})}return b},destroyTile:function(a){this.removeTileMonitoringHooks(a);a.destroy()},getServerResolution:function(a){var b=Number.POSITIVE_INFINITY;a=a||this.map.getResolution();if(this.serverResolutions&& +-1===OpenLayers.Util.indexOf(this.serverResolutions,a)){var c,d,e,f;for(c=this.serverResolutions.length-1;0<=c;c--){e=this.serverResolutions[c];d=Math.abs(e-a);if(d>b)break;b=d;f=e}a=f}return a},getServerZoom:function(){var a=this.getServerResolution();return this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,a):this.map.getZoomForResolution(a)+(this.zoomOffset||0)},applyBackBuffer:function(a){null!==this.backBufferTimerId&&this.removeBackBuffer();var b=this.backBuffer;if(!b){b= +this.createBackBuffer();if(!b)return;a===this.gridResolution?this.div.insertBefore(b,this.div.firstChild):this.map.baseLayer.div.parentNode.insertBefore(b,this.map.baseLayer.div);this.backBuffer=b;var c=this.grid[0][0].bounds;this.backBufferLonLat={lon:c.left,lat:c.top};this.backBufferResolution=this.gridResolution}for(var c=this.backBufferResolution/a,d=b.childNodes,e,f=d.length-1;0<=f;--f)e=d[f],e.style.top=(c*e._i*e._h|0)+"px",e.style.left=(c*e._j*e._w|0)+"px",e.style.width=Math.round(c*e._w)+ +"px",e.style.height=Math.round(c*e._h)+"px";a=this.getViewPortPxFromLonLat(this.backBufferLonLat,a);c=this.map.layerContainerOriginPx.y;b.style.left=Math.round(a.x-this.map.layerContainerOriginPx.x)+"px";b.style.top=Math.round(a.y-c)+"px"},createBackBuffer:function(){var a;if(0<this.grid.length){a=document.createElement("div");a.id=this.div.id+"_bb";a.className="olBackBuffer";a.style.position="absolute";var b=this.map;a.style.zIndex="resize"===this.transitionEffect?this.getZIndex()-1:b.Z_INDEX_BASE.BaseLayer- +(b.getNumLayers()-b.getLayerIndex(this));for(var b=0,c=this.grid.length;b<c;b++)for(var d=0,e=this.grid[b].length;d<e;d++){var f=this.grid[b][d],g=this.grid[b][d].createBackBuffer();g&&(g._i=b,g._j=d,g._w=f.size.w,g._h=f.size.h,g.id=f.id+"_bb",a.appendChild(g))}}return a},removeBackBuffer:function(){if(this._transitionElement){for(var a=this.transitionendEvents.length-1;0<=a;--a)OpenLayers.Event.stopObserving(this._transitionElement,this.transitionendEvents[a],this._removeBackBuffer);delete this._transitionElement}this.backBuffer&& +(this.backBuffer.parentNode&&this.backBuffer.parentNode.removeChild(this.backBuffer),this.backBufferResolution=this.backBuffer=null,null!==this.backBufferTimerId&&(window.clearTimeout(this.backBufferTimerId),this.backBufferTimerId=null))},moveByPx:function(a,b){this.singleTile||this.moveGriddedTiles()},setTileSize:function(a){this.singleTile&&(a=this.map.getSize(),a.h=parseInt(a.h*this.ratio,10),a.w=parseInt(a.w*this.ratio,10));OpenLayers.Layer.HTTPRequest.prototype.setTileSize.apply(this,[a])},getTilesBounds:function(){var a= +null,b=this.grid.length;if(b)var a=this.grid[b-1][0].bounds,b=this.grid[0].length*a.getWidth(),c=this.grid.length*a.getHeight(),a=new OpenLayers.Bounds(a.left,a.bottom,a.left+b,a.bottom+c);return a},initSingleTile:function(a){this.events.triggerEvent("retile");var b=a.getCenterLonLat(),c=a.getWidth()*this.ratio;a=a.getHeight()*this.ratio;b=new OpenLayers.Bounds(b.lon-c/2,b.lat-a/2,b.lon+c/2,b.lat+a/2);c=this.map.getLayerPxFromLonLat({lon:b.left,lat:b.top});this.grid.length||(this.grid[0]=[]);(a=this.grid[0][0])? +a.moveTo(b,c):(a=this.addTile(b,c),this.addTileMonitoringHooks(a),a.draw(),this.grid[0][0]=a);this.removeExcessTiles(1,1);this.gridResolution=this.getServerResolution()},calculateGridLayout:function(a,b,c){var d=c*this.tileSize.w;c*=this.tileSize.h;var e=Math.floor((a.left-b.lon)/d)-this.buffer,f=this.rowSign;a=Math[~f?"floor":"ceil"](f*(b.lat-a.top+c)/c)-this.buffer*f;return{tilelon:d,tilelat:c,startcol:e,startrow:a}},getTileOrigin:function(){var a=this.tileOrigin;if(!a)var a=this.getMaxExtent(), +b={tl:["left","top"],tr:["right","top"],bl:["left","bottom"],br:["right","bottom"]}[this.tileOriginCorner],a=new OpenLayers.LonLat(a[b[0]],a[b[1]]);return a},getTileBoundsForGridIndex:function(a,b){var c=this.getTileOrigin(),d=this.gridLayout,e=d.tilelon,f=d.tilelat,g=d.startcol,d=d.startrow,h=this.rowSign;return new OpenLayers.Bounds(c.lon+(g+b)*e,c.lat-(d+a*h)*f*h,c.lon+(g+b+1)*e,c.lat-(d+(a-1)*h)*f*h)},initGriddedTiles:function(a){this.events.triggerEvent("retile");var b=this.map.getSize(),c=this.getTileOrigin(), +d=this.map.getResolution(),e=this.getServerResolution(),f=d/e,d=this.tileSize.w/f,f=this.tileSize.h/f,g=Math.ceil(b.h/f)+2*this.buffer+1,b=Math.ceil(b.w/d)+2*this.buffer+1;this.gridLayout=e=this.calculateGridLayout(a,c,e);var c=e.tilelon,h=e.tilelat,e=this.map.layerContainerOriginPx.x,k=this.map.layerContainerOriginPx.y,l=this.getTileBoundsForGridIndex(0,0),m=this.map.getViewPortPxFromLonLat(new OpenLayers.LonLat(l.left,l.top));m.x=Math.round(m.x)-e;m.y=Math.round(m.y)-k;var e=[],k=this.map.getCenter(), +n=0;do{var p=this.grid[n];p||(p=[],this.grid.push(p));var q=0;do{var l=this.getTileBoundsForGridIndex(n,q),r=m.clone();r.x+=q*Math.round(d);r.y+=n*Math.round(f);var s=p[q];s?s.moveTo(l,r,!1):(s=this.addTile(l,r),this.addTileMonitoringHooks(s),p.push(s));r=l.getCenterLonLat();e.push({tile:s,distance:Math.pow(r.lon-k.lon,2)+Math.pow(r.lat-k.lat,2)});q+=1}while(l.right<=a.right+c*this.buffer||q<b);n+=1}while(l.bottom>=a.bottom-h*this.buffer||n<g);this.removeExcessTiles(n,q);this.gridResolution=d=this.getServerResolution(); +e.sort(function(a,b){return a.distance-b.distance});a=0;for(d=e.length;a<d;++a)e[a].tile.draw()},getMaxExtent:function(){return this.maxExtent},addTile:function(a,b){var c=new this.tileClass(this,b,a,null,this.tileSize,this.tileOptions);this.events.triggerEvent("addtile",{tile:c});return c},addTileMonitoringHooks:function(a){a.onLoadStart=function(){!1===this.loading&&(this.loading=!0,this.events.triggerEvent("loadstart"));this.events.triggerEvent("tileloadstart",{tile:a});this.numLoadingTiles++; +!this.singleTile&&(this.backBuffer&&this.gridResolution===this.backBufferResolution)&&OpenLayers.Element.addClass(a.getTile(),"olTileReplacing")};a.onLoadEnd=function(b){this.numLoadingTiles--;b="unload"===b.type;this.events.triggerEvent("tileloaded",{tile:a,aborted:b});if(!this.singleTile&&!b&&this.backBuffer&&this.gridResolution===this.backBufferResolution){var c=a.getTile();if("none"===OpenLayers.Element.getStyle(c,"display")){var d=document.getElementById(a.id+"_bb");d&&d.parentNode.removeChild(d)}OpenLayers.Element.removeClass(c, +"olTileReplacing")}if(0===this.numLoadingTiles){if(this.backBuffer)if(0===this.backBuffer.childNodes.length)this.removeBackBuffer();else{this._transitionElement=b?this.div.lastChild:a.imgDiv;b=this.transitionendEvents;for(c=b.length-1;0<=c;--c)OpenLayers.Event.observe(this._transitionElement,b[c],this._removeBackBuffer);this.backBufferTimerId=window.setTimeout(this._removeBackBuffer,this.removeBackBufferDelay)}this.loading=!1;this.events.triggerEvent("loadend")}};a.onLoadError=function(){this.events.triggerEvent("tileerror", +{tile:a})};a.events.on({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,loaderror:a.onLoadError,scope:this})},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,loaderror:a.onLoadError,scope:this})},moveGriddedTiles:function(){for(var a=this.buffer+1;;){var b=this.grid[0][0],c=b.position.x+this.map.layerContainerOriginPx.x,b=b.position.y+this.map.layerContainerOriginPx.y,d=this.getServerResolution()/this.map.getResolution(), +d={w:Math.round(this.tileSize.w*d),h:Math.round(this.tileSize.h*d)};if(c>-d.w*(a-1))this.shiftColumn(!0,d);else if(c<-d.w*a)this.shiftColumn(!1,d);else if(b>-d.h*(a-1))this.shiftRow(!0,d);else if(b<-d.h*a)this.shiftRow(!1,d);else break}},shiftRow:function(a,b){var c=this.grid,d=a?0:c.length-1,e=a?-1:1;this.gridLayout.startrow+=e*this.rowSign;for(var f=c[d],g=c[a?"pop":"shift"](),h=0,k=g.length;h<k;h++){var l=g[h],m=f[h].position.clone();m.y+=b.h*e;l.moveTo(this.getTileBoundsForGridIndex(d,h),m)}c[a? +"unshift":"push"](g)},shiftColumn:function(a,b){var c=this.grid,d=a?0:c[0].length-1,e=a?-1:1;this.gridLayout.startcol+=e;for(var f=0,g=c.length;f<g;f++){var h=c[f],k=h[d].position.clone(),l=h[a?"pop":"shift"]();k.x+=b.w*e;l.moveTo(this.getTileBoundsForGridIndex(f,d),k);h[a?"unshift":"push"](l)}},removeExcessTiles:function(a,b){for(var c,d;this.grid.length>a;){var e=this.grid.pop();c=0;for(d=e.length;c<d;c++){var f=e[c];this.destroyTile(f)}}c=0;for(d=this.grid.length;c<d;c++)for(;this.grid[c].length> +b;)e=this.grid[c],f=e.pop(),this.destroyTile(f)},onMapResize:function(){this.singleTile&&(this.clearGrid(),this.setTileSize())},getTileBounds:function(a){var b=this.maxExtent,c=this.getResolution(),d=c*this.tileSize.w,c=c*this.tileSize.h,e=this.getLonLatFromViewPortPx(a);a=b.left+d*Math.floor((e.lon-b.left)/d);b=b.bottom+c*Math.floor((e.lat-b.bottom)/c);return new OpenLayers.Bounds(a,b,a+d,b+c)},CLASS_NAME:"OpenLayers.Layer.Grid"});OpenLayers.Format.ArcXML=OpenLayers.Class(OpenLayers.Format.XML,{fontStyleKeys:"antialiasing blockout font fontcolor fontsize fontstyle glowing interval outline printmode shadow transparency".split(" "),request:null,response:null,initialize:function(a){this.request=new OpenLayers.Format.ArcXML.Request;this.response=new OpenLayers.Format.ArcXML.Response;if(a)if("feature"==a.requesttype){this.request.get_image=null;var b=this.request.get_feature.query;this.addCoordSys(b.featurecoordsys,a.featureCoordSys); +this.addCoordSys(b.filtercoordsys,a.filterCoordSys);a.polygon?(b.isspatial=!0,b.spatialfilter.polygon=a.polygon):a.envelope&&(b.isspatial=!0,b.spatialfilter.envelope={minx:0,miny:0,maxx:0,maxy:0},this.parseEnvelope(b.spatialfilter.envelope,a.envelope))}else"image"==a.requesttype?(this.request.get_feature=null,b=this.request.get_image.properties,this.parseEnvelope(b.envelope,a.envelope),this.addLayers(b.layerlist,a.layers),this.addImageSize(b.imagesize,a.tileSize),this.addCoordSys(b.featurecoordsys, +a.featureCoordSys),this.addCoordSys(b.filtercoordsys,a.filterCoordSys)):this.request=null;OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},parseEnvelope:function(a,b){b&&4==b.length&&(a.minx=b[0],a.miny=b[1],a.maxx=b[2],a.maxy=b[3])},addLayers:function(a,b){for(var c=0,d=b.length;c<d;c++)a.push(b[c])},addImageSize:function(a,b){null!==b&&(a.width=b.w,a.height=b.h,a.printwidth=b.w,a.printheight=b.h)},addCoordSys:function(a,b){"string"==typeof b?(a.id=parseInt(b),a.string=b):"object"==typeof b&& +null!==b.proj&&(a.id=b.proj.srsProjNumber,a.string=b.proj.srsCode)},iserror:function(a){var b=null;a?(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]),a=a.documentElement.getElementsByTagName("ERROR"),b=null!==a&&0<a.length):b=""!==this.response.error;return b},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=null;a&&a.documentElement&&(b="ARCXML"==a.documentElement.nodeName?a.documentElement:a.documentElement.getElementsByTagName("ARCXML")[0]); +if(!b||"parsererror"===b.firstChild.nodeName){var c,d;try{c=a.firstChild.nodeValue,d=a.firstChild.childNodes[1].firstChild.nodeValue}catch(e){}throw{message:"Error parsing the ArcXML request",error:c,source:d};}return this.parseResponse(b)},write:function(a){a||(a=this.request);var b=this.createElementNS("","ARCXML");b.setAttribute("version","1.1");var c=this.createElementNS("","REQUEST");if(null!=a.get_image){var d=this.createElementNS("","GET_IMAGE");c.appendChild(d);var e=this.createElementNS("", +"PROPERTIES");d.appendChild(e);a=a.get_image.properties;null!=a.featurecoordsys&&(d=this.createElementNS("","FEATURECOORDSYS"),e.appendChild(d),0===a.featurecoordsys.id?d.setAttribute("string",a.featurecoordsys.string):d.setAttribute("id",a.featurecoordsys.id));null!=a.filtercoordsys&&(d=this.createElementNS("","FILTERCOORDSYS"),e.appendChild(d),0===a.filtercoordsys.id?d.setAttribute("string",a.filtercoordsys.string):d.setAttribute("id",a.filtercoordsys.id));null!=a.envelope&&(d=this.createElementNS("", +"ENVELOPE"),e.appendChild(d),d.setAttribute("minx",a.envelope.minx),d.setAttribute("miny",a.envelope.miny),d.setAttribute("maxx",a.envelope.maxx),d.setAttribute("maxy",a.envelope.maxy));d=this.createElementNS("","IMAGESIZE");e.appendChild(d);d.setAttribute("height",a.imagesize.height);d.setAttribute("width",a.imagesize.width);if(a.imagesize.height!=a.imagesize.printheight||a.imagesize.width!=a.imagesize.printwidth)d.setAttribute("printheight",a.imagesize.printheight),d.setArrtibute("printwidth",a.imagesize.printwidth); +null!=a.background&&(d=this.createElementNS("","BACKGROUND"),e.appendChild(d),d.setAttribute("color",a.background.color.r+","+a.background.color.g+","+a.background.color.b),null!==a.background.transcolor&&d.setAttribute("transcolor",a.background.transcolor.r+","+a.background.transcolor.g+","+a.background.transcolor.b));if(null!=a.layerlist&&0<a.layerlist.length)for(d=this.createElementNS("","LAYERLIST"),e.appendChild(d),e=0;e<a.layerlist.length;e++){var f=this.createElementNS("","LAYERDEF");d.appendChild(f); +f.setAttribute("id",a.layerlist[e].id);f.setAttribute("visible",a.layerlist[e].visible);if("object"==typeof a.layerlist[e].query){var g=a.layerlist[e].query;if(0>g.where.length)continue;var h=null,h="boolean"==typeof g.spatialfilter&&g.spatialfilter?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY");h.setAttribute("where",g.where);"number"==typeof g.accuracy&&0<g.accuracy&&h.setAttribute("accuracy",g.accuracy);"number"==typeof g.featurelimit&&2E3>g.featurelimit&&h.setAttribute("featurelimit", +g.featurelimit);"string"==typeof g.subfields&&"#ALL#"!=g.subfields&&h.setAttribute("subfields",g.subfields);"string"==typeof g.joinexpression&&0<g.joinexpression.length&&h.setAttribute("joinexpression",g.joinexpression);"string"==typeof g.jointables&&0<g.jointables.length&&h.setAttribute("jointables",g.jointables);f.appendChild(h)}"object"==typeof a.layerlist[e].renderer&&this.addRenderer(f,a.layerlist[e].renderer)}}else null!=a.get_feature&&(d=this.createElementNS("","GET_FEATURES"),d.setAttribute("outputmode", +"newxml"),d.setAttribute("checkesc","true"),a.get_feature.geometry?d.setAttribute("geometry",a.get_feature.geometry):d.setAttribute("geometry","false"),a.get_feature.compact&&d.setAttribute("compact",a.get_feature.compact),"number"==a.get_feature.featurelimit&&d.setAttribute("featurelimit",a.get_feature.featurelimit),d.setAttribute("globalenvelope","true"),c.appendChild(d),null!=a.get_feature.layer&&0<a.get_feature.layer.length&&(e=this.createElementNS("","LAYER"),e.setAttribute("id",a.get_feature.layer), +d.appendChild(e)),a=a.get_feature.query,null!=a&&(e=null,e=a.isspatial?this.createElementNS("","SPATIALQUERY"):this.createElementNS("","QUERY"),d.appendChild(e),"number"==typeof a.accuracy&&e.setAttribute("accuracy",a.accuracy),null!=a.featurecoordsys&&(d=this.createElementNS("","FEATURECOORDSYS"),0==a.featurecoordsys.id?d.setAttribute("string",a.featurecoordsys.string):d.setAttribute("id",a.featurecoordsys.id),e.appendChild(d)),null!=a.filtercoordsys&&(d=this.createElementNS("","FILTERCOORDSYS"), +0===a.filtercoordsys.id?d.setAttribute("string",a.filtercoordsys.string):d.setAttribute("id",a.filtercoordsys.id),e.appendChild(d)),0<a.buffer&&(d=this.createElementNS("","BUFFER"),d.setAttribute("distance",a.buffer),e.appendChild(d)),a.isspatial&&(d=this.createElementNS("","SPATIALFILTER"),d.setAttribute("relation",a.spatialfilter.relation),e.appendChild(d),a.spatialfilter.envelope?(f=this.createElementNS("","ENVELOPE"),f.setAttribute("minx",a.spatialfilter.envelope.minx),f.setAttribute("miny",a.spatialfilter.envelope.miny), +f.setAttribute("maxx",a.spatialfilter.envelope.maxx),f.setAttribute("maxy",a.spatialfilter.envelope.maxy),d.appendChild(f)):"object"==typeof a.spatialfilter.polygon&&d.appendChild(this.writePolygonGeometry(a.spatialfilter.polygon))),null!=a.where&&0<a.where.length&&e.setAttribute("where",a.where)));b.appendChild(c);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},addGroupRenderer:function(a,b){var c=this.createElementNS("","GROUPRENDERER");a.appendChild(c);for(var d=0;d<b.length;d++)this.addRenderer(c, +b[d])},addRenderer:function(a,b){if(OpenLayers.Util.isArray(b))this.addGroupRenderer(a,b);else{var c=this.createElementNS("",b.type.toUpperCase()+"RENDERER");a.appendChild(c);"VALUEMAPRENDERER"==c.tagName?this.addValueMapRenderer(c,b):"VALUEMAPLABELRENDERER"==c.tagName?this.addValueMapLabelRenderer(c,b):"SIMPLELABELRENDERER"==c.tagName?this.addSimpleLabelRenderer(c,b):"SCALEDEPENDENTRENDERER"==c.tagName&&this.addScaleDependentRenderer(c,b)}},addScaleDependentRenderer:function(a,b){"string"!=typeof b.lower&& +"number"!=typeof b.lower||a.setAttribute("lower",b.lower);"string"!=typeof b.upper&&"number"!=typeof b.upper||a.setAttribute("upper",b.upper);this.addRenderer(a,b.renderer)},addValueMapLabelRenderer:function(a,b){a.setAttribute("lookupfield",b.lookupfield);a.setAttribute("labelfield",b.labelfield);if("object"==typeof b.exacts)for(var c=0,d=b.exacts.length;c<d;c++){var e=b.exacts[c],f=this.createElementNS("","EXACT");"string"==typeof e.value&&f.setAttribute("value",e.value);"string"==typeof e.label&& +f.setAttribute("label",e.label);"string"==typeof e.method&&f.setAttribute("method",e.method);a.appendChild(f);if("object"==typeof e.symbol){var g=null;"text"==e.symbol.type&&(g=this.createElementNS("","TEXTSYMBOL"));if(null!=g){for(var h=this.fontStyleKeys,k=0,l=h.length;k<l;k++){var m=h[k];e.symbol[m]&&g.setAttribute(m,e.symbol[m])}f.appendChild(g)}}}},addValueMapRenderer:function(a,b){a.setAttribute("lookupfield",b.lookupfield);if("object"==typeof b.ranges)for(var c=0,d=b.ranges.length;c<d;c++){var e= +b.ranges[c],f=this.createElementNS("","RANGE");f.setAttribute("lower",e.lower);f.setAttribute("upper",e.upper);a.appendChild(f);if("object"==typeof e.symbol){var g=null;"simplepolygon"==e.symbol.type&&(g=this.createElementNS("","SIMPLEPOLYGONSYMBOL"));null!=g&&("string"==typeof e.symbol.boundarycolor&&g.setAttribute("boundarycolor",e.symbol.boundarycolor),"string"==typeof e.symbol.fillcolor&&g.setAttribute("fillcolor",e.symbol.fillcolor),"number"==typeof e.symbol.filltransparency&&g.setAttribute("filltransparency", +e.symbol.filltransparency),f.appendChild(g))}}else if("object"==typeof b.exacts)for(c=0,d=b.exacts.length;c<d;c++)e=b.exacts[c],f=this.createElementNS("","EXACT"),"string"==typeof e.value&&f.setAttribute("value",e.value),"string"==typeof e.label&&f.setAttribute("label",e.label),"string"==typeof e.method&&f.setAttribute("method",e.method),a.appendChild(f),"object"==typeof e.symbol&&(g=null,"simplemarker"==e.symbol.type&&(g=this.createElementNS("","SIMPLEMARKERSYMBOL")),null!=g&&("string"==typeof e.symbol.antialiasing&& +g.setAttribute("antialiasing",e.symbol.antialiasing),"string"==typeof e.symbol.color&&g.setAttribute("color",e.symbol.color),"string"==typeof e.symbol.outline&&g.setAttribute("outline",e.symbol.outline),"string"==typeof e.symbol.overlap&&g.setAttribute("overlap",e.symbol.overlap),"string"==typeof e.symbol.shadow&&g.setAttribute("shadow",e.symbol.shadow),"number"==typeof e.symbol.transparency&&g.setAttribute("transparency",e.symbol.transparency),"string"==typeof e.symbol.usecentroid&&g.setAttribute("usecentroid", +e.symbol.usecentroid),"number"==typeof e.symbol.width&&g.setAttribute("width",e.symbol.width),f.appendChild(g)))},addSimpleLabelRenderer:function(a,b){a.setAttribute("field",b.field);for(var c="featureweight howmanylabels labelbufferratio labelpriorities labelweight linelabelposition rotationalangles".split(" "),d=0,e=c.length;d<e;d++){var f=c[d];b[f]&&a.setAttribute(f,b[f])}if("text"==b.symbol.type){var g=b.symbol,h=this.createElementNS("","TEXTSYMBOL");a.appendChild(h);c=this.fontStyleKeys;d=0; +for(e=c.length;d<e;d++)f=c[d],g[f]&&h.setAttribute(f,b[f])}},writePolygonGeometry:function(a){if(!(a instanceof OpenLayers.Geometry.Polygon))throw{message:"Cannot write polygon geometry to ArcXML with an "+a.CLASS_NAME+" object.",geometry:a};for(var b=this.createElementNS("","POLYGON"),c=0,d=a.components.length;c<d;c++){for(var e=a.components[c],f=this.createElementNS("","RING"),g=0,h=e.components.length;g<h;g++){var k=e.components[g],l=this.createElementNS("","POINT");l.setAttribute("x",k.x);l.setAttribute("y", +k.y);f.appendChild(l)}b.appendChild(f)}return b},parseResponse:function(a){"string"==typeof a&&(a=(new OpenLayers.Format.XML).read(a));var b=new OpenLayers.Format.ArcXML.Response,c=a.getElementsByTagName("ERROR");if(null!=c&&0<c.length)b.error=this.getChildValue(c,"Unknown error.");else{c=a.getElementsByTagName("RESPONSE");if(null==c||0==c.length)return b.error="No RESPONSE tag found in ArcXML response.",b;var d=c[0].firstChild.nodeName;"#text"==d&&(d=c[0].firstChild.nextSibling.nodeName);if("IMAGE"== +d)c=a.getElementsByTagName("ENVELOPE"),a=a.getElementsByTagName("OUTPUT"),null==c||0==c.length?b.error="No ENVELOPE tag found in ArcXML response.":null==a||0==a.length?b.error="No OUTPUT tag found in ArcXML response.":(c=this.parseAttributes(c[0]),d=this.parseAttributes(a[0]),b.image="string"==typeof d.type?{envelope:c,output:{type:d.type,data:this.getChildValue(a[0])}}:{envelope:c,output:d});else if("FEATURES"==d){if(a=c[0].getElementsByTagName("FEATURES"),c=a[0].getElementsByTagName("FEATURECOUNT"), +b.features.featurecount=c[0].getAttribute("count"),0<b.features.featurecount)for(c=a[0].getElementsByTagName("ENVELOPE"),b.features.envelope=this.parseAttributes(c[0],"number"),a=a[0].getElementsByTagName("FEATURE"),c=0;c<a.length;c++){for(var d=new OpenLayers.Feature.Vector,e=a[c].getElementsByTagName("FIELD"),f=0;f<e.length;f++){var g=e[f].getAttribute("name"),h=e[f].getAttribute("value");d.attributes[g]=h}e=a[c].getElementsByTagName("POLYGON");if(0<e.length){e=e[0].getElementsByTagName("RING"); +f=[];for(g=0;g<e.length;g++){h=[];h.push(this.parsePointGeometry(e[g]));for(var k=e[g].getElementsByTagName("HOLE"),l=0;l<k.length;l++)h.push(this.parsePointGeometry(k[l]));f.push(new OpenLayers.Geometry.Polygon(h))}d.geometry=1==f.length?f[0]:new OpenLayers.Geometry.MultiPolygon(f)}b.features.feature.push(d)}}else b.error="Unidentified response type."}return b},parseAttributes:function(a,b){for(var c={},d=0;d<a.attributes.length;d++)c[a.attributes[d].nodeName]="number"==b?parseFloat(a.attributes[d].nodeValue): +a.attributes[d].nodeValue;return c},parsePointGeometry:function(a){var b=[],c=a.getElementsByTagName("COORDS");if(0<c.length)for(a=this.getChildValue(c[0]),a=a.split(/;/),c=0;c<a.length;c++){var d=a[c].split(/ /);b.push(new OpenLayers.Geometry.Point(d[0],d[1]))}else if(a=a.getElementsByTagName("POINT"),0<a.length)for(c=0;c<a.length;c++)b.push(new OpenLayers.Geometry.Point(parseFloat(a[c].getAttribute("x")),parseFloat(a[c].getAttribute("y"))));return new OpenLayers.Geometry.LinearRing(b)},CLASS_NAME:"OpenLayers.Format.ArcXML"}); +OpenLayers.Format.ArcXML.Request=OpenLayers.Class({initialize:function(a){return OpenLayers.Util.extend(this,{get_image:{properties:{background:null,draw:!0,envelope:{minx:0,miny:0,maxx:0,maxy:0},featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},imagesize:{height:0,width:0,dpi:96,printheight:0,printwidth:0,scalesymbols:!1},layerlist:[],output:{baseurl:"",legendbaseurl:"",legendname:"",legendpath:"", +legendurl:"",name:"",path:"",type:"jpg",url:""}}},get_feature:{layer:"",query:{isspatial:!1,featurecoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},filtercoordsys:{id:0,string:"",datumtransformid:0,datumtransformstring:""},buffer:0,where:"",spatialfilter:{relation:"envelope_intersection",envelope:null}}},environment:{separators:{cs:" ",ts:";"}},layer:[],workspaces:[]})},CLASS_NAME:"OpenLayers.Format.ArcXML.Request"}); +OpenLayers.Format.ArcXML.Response=OpenLayers.Class({initialize:function(a){return OpenLayers.Util.extend(this,{image:{envelope:null,output:""},features:{featurecount:0,envelope:null,feature:[]},error:""})},CLASS_NAME:"OpenLayers.Format.ArcXML.Response"});(function(){function a(){this._object=f&&!k?new f:new window.ActiveXObject("Microsoft.XMLHTTP");this._listeners=[]}function b(){return new a}function c(a){b.onreadystatechange&&b.onreadystatechange.apply(a);a.dispatchEvent({type:"readystatechange",bubbles:!1,cancelable:!1,timeStamp:new Date+0})}function d(a){try{a.responseText=a._object.responseText}catch(b){}try{var c;var d=a._object,e=d.responseXML,f=d.responseText;h&&(f&&e&&!e.documentElement&&d.getResponseHeader("Content-Type").match(/[^\/]+\/[^\+]+\+xml/))&& +(e=new window.ActiveXObject("Microsoft.XMLDOM"),e.async=!1,e.validateOnParse=!1,e.loadXML(f));c=e&&(h&&0!=e.parseError||!e.documentElement||e.documentElement&&"parsererror"==e.documentElement.tagName)?null:e;a.responseXML=c}catch(g){}try{a.status=a._object.status}catch(k){}try{a.statusText=a._object.statusText}catch(u){}}function e(a){a._object.onreadystatechange=new window.Function}var f=window.XMLHttpRequest,g=!!window.controllers,h=window.document.all&&!window.opera,k=h&&window.navigator.userAgent.match(/MSIE 7.0/); +b.prototype=a.prototype;g&&f.wrapped&&(b.wrapped=f.wrapped);b.UNSENT=0;b.OPENED=1;b.HEADERS_RECEIVED=2;b.LOADING=3;b.DONE=4;b.prototype.readyState=b.UNSENT;b.prototype.responseText="";b.prototype.responseXML=null;b.prototype.status=0;b.prototype.statusText="";b.prototype.priority="NORMAL";b.prototype.onreadystatechange=null;b.onreadystatechange=null;b.onopen=null;b.onsend=null;b.onabort=null;b.prototype.open=function(a,f,k,p,q){delete this._headers;3>arguments.length&&(k=!0);this._async=k;var r=this, +s=this.readyState,t;h&&k&&(t=function(){s!=b.DONE&&(e(r),r.abort())},window.attachEvent("onunload",t));b.onopen&&b.onopen.apply(this,arguments);4<arguments.length?this._object.open(a,f,k,p,q):3<arguments.length?this._object.open(a,f,k,p):this._object.open(a,f,k);this.readyState=b.OPENED;c(this);this._object.onreadystatechange=function(){if(!g||k)r.readyState=r._object.readyState,d(r),r._aborted?r.readyState=b.UNSENT:(r.readyState==b.DONE&&(delete r._data,e(r),h&&k&&window.detachEvent("onunload",t)), +s!=r.readyState&&c(r),s=r.readyState)}};b.prototype.send=function(a){b.onsend&&b.onsend.apply(this,arguments);arguments.length||(a=null);a&&a.nodeType&&(a=window.XMLSerializer?(new window.XMLSerializer).serializeToString(a):a.xml,this._headers["Content-Type"]||this._object.setRequestHeader("Content-Type","application/xml"));this._data=a;a:if(this._object.send(this._data),g&&!this._async)for(this.readyState=b.OPENED,d(this);this.readyState<b.DONE;)if(this.readyState++,c(this),this._aborted)break a}; +b.prototype.abort=function(){b.onabort&&b.onabort.apply(this,arguments);this.readyState>b.UNSENT&&(this._aborted=!0);this._object.abort();e(this);this.readyState=b.UNSENT;delete this._data};b.prototype.getAllResponseHeaders=function(){return this._object.getAllResponseHeaders()};b.prototype.getResponseHeader=function(a){return this._object.getResponseHeader(a)};b.prototype.setRequestHeader=function(a,b){this._headers||(this._headers={});this._headers[a]=b;return this._object.setRequestHeader(a,b)}; +b.prototype.addEventListener=function(a,b,c){for(var d=0,e;e=this._listeners[d];d++)if(e[0]==a&&e[1]==b&&e[2]==c)return;this._listeners.push([a,b,c])};b.prototype.removeEventListener=function(a,b,c){for(var d=0,e;(e=this._listeners[d])&&(e[0]!=a||e[1]!=b||e[2]!=c);d++);e&&this._listeners.splice(d,1)};b.prototype.dispatchEvent=function(a){a={type:a.type,target:this,currentTarget:this,eventPhase:2,bubbles:a.bubbles,cancelable:a.cancelable,timeStamp:a.timeStamp,stopPropagation:function(){},preventDefault:function(){}, +initEvent:function(){}};"readystatechange"==a.type&&this.onreadystatechange&&(this.onreadystatechange.handleEvent||this.onreadystatechange).apply(this,[a]);for(var b=0,c;c=this._listeners[b];b++)c[0]!=a.type||c[2]||(c[1].handleEvent||c[1]).apply(this,[a])};b.prototype.toString=function(){return"[object XMLHttpRequest]"};b.toString=function(){return"[XMLHttpRequest]"};window.Function.prototype.apply||(window.Function.prototype.apply=function(a,b){b||(b=[]);a.__func=this;a.__func(b[0],b[1],b[2],b[3], +b[4]);delete a.__func});OpenLayers.Request||(OpenLayers.Request={});OpenLayers.Request.XMLHttpRequest=b})();OpenLayers.ProxyHost="";OpenLayers.Request||(OpenLayers.Request={}); +OpenLayers.Util.extend(OpenLayers.Request,{DEFAULT_CONFIG:{method:"GET",url:window.location.href,async:!0,user:void 0,password:void 0,params:null,proxy:OpenLayers.ProxyHost,headers:{},data:null,callback:function(){},success:null,failure:null,scope:null},URL_SPLIT_REGEX:/([^:]*:)\/\/([^:]*:?[^@]*@)?([^:\/\?]*):?([^\/\?]*)/,events:new OpenLayers.Events(this),makeSameOrigin:function(a,b){var c=0!==a.indexOf("http"),d=!c&&a.match(this.URL_SPLIT_REGEX);if(d){var e=window.location,c=d[1]==e.protocol&&d[3]== +e.hostname,d=d[4],e=e.port;if(80!=d&&""!=d||"80"!=e&&""!=e)c=c&&d==e}c||b&&(a="function"==typeof b?b(a):b+encodeURIComponent(a));return a},issue:function(a){var b=OpenLayers.Util.extend(this.DEFAULT_CONFIG,{proxy:OpenLayers.ProxyHost});a=a||{};a.headers=a.headers||{};a=OpenLayers.Util.applyDefaults(a,b);a.headers=OpenLayers.Util.applyDefaults(a.headers,b.headers);var b=!1,c;for(c in a.headers)a.headers.hasOwnProperty(c)&&"x-requested-with"===c.toLowerCase()&&(b=!0);!1===b&&(a.headers["X-Requested-With"]= +"XMLHttpRequest");var d=new OpenLayers.Request.XMLHttpRequest,e=OpenLayers.Util.urlAppend(a.url,OpenLayers.Util.getParameterString(a.params||{})),e=OpenLayers.Request.makeSameOrigin(e,a.proxy);d.open(a.method,e,a.async,a.user,a.password);for(var f in a.headers)d.setRequestHeader(f,a.headers[f]);var g=this.events,h=this;d.onreadystatechange=function(){d.readyState==OpenLayers.Request.XMLHttpRequest.DONE&&!1!==g.triggerEvent("complete",{request:d,config:a,requestUrl:e})&&h.runCallbacks({request:d,config:a, +requestUrl:e})};!1===a.async?d.send(a.data):window.setTimeout(function(){0!==d.readyState&&d.send(a.data)},0);return d},runCallbacks:function(a){var b=a.request,c=a.config,d=c.scope?OpenLayers.Function.bind(c.callback,c.scope):c.callback,e;c.success&&(e=c.scope?OpenLayers.Function.bind(c.success,c.scope):c.success);var f;c.failure&&(f=c.scope?OpenLayers.Function.bind(c.failure,c.scope):c.failure);"file:"==OpenLayers.Util.createUrlObject(c.url).protocol&&b.responseText&&(b.status=200);d(b);if(!b.status|| +200<=b.status&&300>b.status)this.events.triggerEvent("success",a),e&&e(b);b.status&&(200>b.status||300<=b.status)&&(this.events.triggerEvent("failure",a),f&&f(b))},GET:function(a){a=OpenLayers.Util.extend(a,{method:"GET"});return OpenLayers.Request.issue(a)},POST:function(a){a=OpenLayers.Util.extend(a,{method:"POST"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},PUT:function(a){a= +OpenLayers.Util.extend(a,{method:"PUT"});a.headers=a.headers?a.headers:{};"CONTENT-TYPE"in OpenLayers.Util.upperCaseObject(a.headers)||(a.headers["Content-Type"]="application/xml");return OpenLayers.Request.issue(a)},DELETE:function(a){a=OpenLayers.Util.extend(a,{method:"DELETE"});return OpenLayers.Request.issue(a)},HEAD:function(a){a=OpenLayers.Util.extend(a,{method:"HEAD"});return OpenLayers.Request.issue(a)},OPTIONS:function(a){a=OpenLayers.Util.extend(a,{method:"OPTIONS"});return OpenLayers.Request.issue(a)}});OpenLayers.Layer.ArcIMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{ClientVersion:"9.2",ServiceName:""},featureCoordSys:"4326",filterCoordSys:"4326",layers:null,async:!0,name:"ArcIMS",isBaseLayer:!0,DEFAULT_OPTIONS:{tileSize:new OpenLayers.Size(512,512),featureCoordSys:"4326",filterCoordSys:"4326",layers:null,isBaseLayer:!0,async:!0,name:"ArcIMS"},initialize:function(a,b,c){this.tileSize=new OpenLayers.Size(512,512);this.params=OpenLayers.Util.applyDefaults({ServiceName:c.serviceName}, +this.DEFAULT_PARAMS);this.options=OpenLayers.Util.applyDefaults(c,this.DEFAULT_OPTIONS);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a,b,this.params,c]);this.transparent&&(this.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.format&&(this.format=OpenLayers.Util.alphaHack()?"image/gif":"image/png"));null===this.options.layers&&(this.options.layers=[])},getURL:function(a){var b="";a=this.adjustBounds(a);a=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image", +envelope:a.toArray(),tileSize:this.tileSize}));a=new OpenLayers.Request.POST({url:this.getFullRequestString(),data:a.write(),async:!1});null!=a&&(b=a.responseXML,b&&b.documentElement||(b=a.responseText),b=(new OpenLayers.Format.ArcXML).read(b),b=this.getUrlOrImage(b.image.output));return b},getURLasync:function(a,b,c){a=this.adjustBounds(a);a=new OpenLayers.Format.ArcXML(OpenLayers.Util.extend(this.options,{requesttype:"image",envelope:a.toArray(),tileSize:this.tileSize}));OpenLayers.Request.POST({url:this.getFullRequestString(), +async:!0,data:a.write(),callback:function(a){var e=a.responseXML;e&&e.documentElement||(e=a.responseText);a=(new OpenLayers.Format.ArcXML).read(e);b.call(c,this.getUrlOrImage(a.image.output))},scope:this})},getUrlOrImage:function(a){var b="";a.url?b=a.url:a.data&&(b="data:image/"+a.type+";base64,"+a.data);return b},setLayerQuery:function(a,b){for(var c=0;c<this.options.layers.length;c++)if(a==this.options.layers[c].id){this.options.layers[c].query=b;return}this.options.layers.push({id:a,visible:!0, +query:b})},getFeatureInfo:function(a,b,c){var d=c.buffer||1,e=c.callback||function(){},f=c.scope||window,g={};OpenLayers.Util.extend(g,this.options);g.requesttype="feature";a instanceof OpenLayers.LonLat?(g.polygon=null,g.envelope=[a.lon-d,a.lat-d,a.lon+d,a.lat+d]):a instanceof OpenLayers.Geometry.Polygon&&(g.envelope=null,g.polygon=a);var h=new OpenLayers.Format.ArcXML(g);OpenLayers.Util.extend(h.request.get_feature,c);h.request.get_feature.layer=b.id;"number"==typeof b.query.accuracy?h.request.get_feature.query.accuracy= +b.query.accuracy:(a=this.map.getCenter(),c=this.map.getViewPortPxFromLonLat(a),c.x++,c=this.map.getLonLatFromPixel(c),h.request.get_feature.query.accuracy=c.lon-a.lon);h.request.get_feature.query.where=b.query.where;h.request.get_feature.query.spatialfilter.relation="area_intersection";OpenLayers.Request.POST({url:this.getFullRequestString({CustomService:"Query"}),data:h.write(),callback:function(a){a=h.parseResponse(a.responseText);h.iserror()?e.call(f,null):e.call(f,a.features)}})},clone:function(a){null== +a&&(a=new OpenLayers.Layer.ArcIMS(this.name,this.url,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},CLASS_NAME:"OpenLayers.Layer.ArcIMS"});OpenLayers.Control.PanZoom=OpenLayers.Class(OpenLayers.Control,{slideFactor:50,slideRatio:null,buttons:null,position:null,initialize:function(a){this.position=new OpenLayers.Pixel(OpenLayers.Control.PanZoom.X,OpenLayers.Control.PanZoom.Y);OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onButtonClick);this.removeButtons();this.position=this.buttons=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)}, +setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.register("buttonclick",this,this.onButtonClick)},draw:function(a){OpenLayers.Control.prototype.draw.apply(this,arguments);a=this.position;this.buttons=[];var b={w:18,h:18},c=new OpenLayers.Pixel(a.x+b.w/2,a.y);this._addButton("panup","north-mini.png",c,b);a.y=c.y+b.h;this._addButton("panleft","west-mini.png",a,b);this._addButton("panright","east-mini.png",a.add(b.w,0),b);this._addButton("pandown","south-mini.png", +c.add(0,2*b.h),b);this._addButton("zoomin","zoom-plus-mini.png",c.add(0,3*b.h+5),b);this._addButton("zoomworld","zoom-world-mini.png",c.add(0,4*b.h+5),b);this._addButton("zoomout","zoom-minus-mini.png",c.add(0,5*b.h+5),b);return this.div},_addButton:function(a,b,c,d){b=OpenLayers.Util.getImageLocation(b);c=OpenLayers.Util.createAlphaImageDiv(this.id+"_"+a,c,d,b,"absolute");c.style.cursor="pointer";this.div.appendChild(c);c.action=a;c.className="olButton";this.buttons.push(c);return c},_removeButton:function(a){this.div.removeChild(a); +OpenLayers.Util.removeItem(this.buttons,a)},removeButtons:function(){for(var a=this.buttons.length-1;0<=a;--a)this._removeButton(this.buttons[a])},onButtonClick:function(a){switch(a.buttonElement.action){case "panup":this.map.pan(0,-this.getSlideFactor("h"));break;case "pandown":this.map.pan(0,this.getSlideFactor("h"));break;case "panleft":this.map.pan(-this.getSlideFactor("w"),0);break;case "panright":this.map.pan(this.getSlideFactor("w"),0);break;case "zoomin":this.map.zoomIn();break;case "zoomout":this.map.zoomOut(); +break;case "zoomworld":this.map.zoomToMaxExtent()}},getSlideFactor:function(a){return this.slideRatio?this.map.getSize()[a]*this.slideRatio:this.slideFactor},CLASS_NAME:"OpenLayers.Control.PanZoom"});OpenLayers.Control.PanZoom.X=4;OpenLayers.Control.PanZoom.Y=4;OpenLayers.Control.PanZoomBar=OpenLayers.Class(OpenLayers.Control.PanZoom,{zoomStopWidth:18,zoomStopHeight:11,slider:null,sliderEvents:null,zoombarDiv:null,zoomWorldIcon:!1,panIcons:!0,forceFixedZoomLevel:!1,mouseDragStart:null,deltaY:null,zoomStart:null,destroy:function(){this._removeZoomBar();this.map.events.un({changebaselayer:this.redraw,updatesize:this.redraw,scope:this});OpenLayers.Control.PanZoom.prototype.destroy.apply(this,arguments);delete this.mouseDragStart;delete this.zoomStart},setMap:function(a){OpenLayers.Control.PanZoom.prototype.setMap.apply(this, +arguments);this.map.events.on({changebaselayer:this.redraw,updatesize:this.redraw,scope:this})},redraw:function(){null!=this.div&&(this.removeButtons(),this._removeZoomBar());this.draw()},draw:function(a){OpenLayers.Control.prototype.draw.apply(this,arguments);a=this.position.clone();this.buttons=[];var b={w:18,h:18};if(this.panIcons){var c=new OpenLayers.Pixel(a.x+b.w/2,a.y),d=b.w;this.zoomWorldIcon&&(c=new OpenLayers.Pixel(a.x+b.w,a.y));this._addButton("panup","north-mini.png",c,b);a.y=c.y+b.h; +this._addButton("panleft","west-mini.png",a,b);this.zoomWorldIcon&&(this._addButton("zoomworld","zoom-world-mini.png",a.add(b.w,0),b),d*=2);this._addButton("panright","east-mini.png",a.add(d,0),b);this._addButton("pandown","south-mini.png",c.add(0,2*b.h),b);this._addButton("zoomin","zoom-plus-mini.png",c.add(0,3*b.h+5),b);c=this._addZoomBar(c.add(0,4*b.h+5));this._addButton("zoomout","zoom-minus-mini.png",c,b)}else this._addButton("zoomin","zoom-plus-mini.png",a,b),c=this._addZoomBar(a.add(0,b.h)), +this._addButton("zoomout","zoom-minus-mini.png",c,b),this.zoomWorldIcon&&(c=c.add(0,b.h+3),this._addButton("zoomworld","zoom-world-mini.png",c,b));return this.div},_addZoomBar:function(a){var b=OpenLayers.Util.getImageLocation("slider.png"),c=this.id+"_"+this.map.id,d=this.map.getMinZoom(),e=this.map.getNumZoomLevels()-1-this.map.getZoom(),e=OpenLayers.Util.createAlphaImageDiv(c,a.add(-1,e*this.zoomStopHeight),{w:20,h:9},b,"absolute");e.style.cursor="move";this.slider=e;this.sliderEvents=new OpenLayers.Events(this, +e,null,!0,{includeXY:!0});this.sliderEvents.on({touchstart:this.zoomBarDown,touchmove:this.zoomBarDrag,touchend:this.zoomBarUp,mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp});var f={w:this.zoomStopWidth,h:this.zoomStopHeight*(this.map.getNumZoomLevels()-d)},b=OpenLayers.Util.getImageLocation("zoombar.png"),c=null;OpenLayers.Util.alphaHack()?(c=this.id+"_"+this.map.id,c=OpenLayers.Util.createAlphaImageDiv(c,a,{w:f.w,h:this.zoomStopHeight},b,"absolute",null,"crop"),c.style.height= +f.h+"px"):c=OpenLayers.Util.createDiv("OpenLayers_Control_PanZoomBar_Zoombar"+this.map.id,a,f,b);c.style.cursor="pointer";c.className="olButton";this.zoombarDiv=c;this.div.appendChild(c);this.startTop=parseInt(c.style.top);this.div.appendChild(e);this.map.events.register("zoomend",this,this.moveZoomBar);return a=a.add(0,this.zoomStopHeight*(this.map.getNumZoomLevels()-d))},_removeZoomBar:function(){this.sliderEvents.un({touchstart:this.zoomBarDown,touchmove:this.zoomBarDrag,touchend:this.zoomBarUp, +mousedown:this.zoomBarDown,mousemove:this.zoomBarDrag,mouseup:this.zoomBarUp});this.sliderEvents.destroy();this.div.removeChild(this.zoombarDiv);this.zoombarDiv=null;this.div.removeChild(this.slider);this.slider=null;this.map.events.unregister("zoomend",this,this.moveZoomBar)},onButtonClick:function(a){OpenLayers.Control.PanZoom.prototype.onButtonClick.apply(this,arguments);if(a.buttonElement===this.zoombarDiv){var b=a.buttonXY.y/this.zoomStopHeight;if(this.forceFixedZoomLevel||!this.map.fractionalZoom)b= +Math.floor(b);b=this.map.getNumZoomLevels()-1-b;b=Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1);this.map.zoomTo(b)}},passEventToSlider:function(a){this.sliderEvents.handleBrowserEvent(a)},zoomBarDown:function(a){if(OpenLayers.Event.isLeftClick(a)||OpenLayers.Event.isSingleTouch(a))this.map.events.on({touchmove:this.passEventToSlider,mousemove:this.passEventToSlider,mouseup:this.passEventToSlider,scope:this}),this.mouseDragStart=a.xy.clone(),this.zoomStart=a.xy.clone(),this.div.style.cursor= +"move",this.zoombarDiv.offsets=null,OpenLayers.Event.stop(a)},zoomBarDrag:function(a){if(null!=this.mouseDragStart){var b=this.mouseDragStart.y-a.xy.y,c=OpenLayers.Util.pagePosition(this.zoombarDiv);0<a.clientY-c[1]&&a.clientY-c[1]<parseInt(this.zoombarDiv.style.height)-2&&(b=parseInt(this.slider.style.top)-b,this.slider.style.top=b+"px",this.mouseDragStart=a.xy.clone());this.deltaY=this.zoomStart.y-a.xy.y;OpenLayers.Event.stop(a)}},zoomBarUp:function(a){if((OpenLayers.Event.isLeftClick(a)||"touchend"=== +a.type)&&this.mouseDragStart){this.div.style.cursor="";this.map.events.un({touchmove:this.passEventToSlider,mouseup:this.passEventToSlider,mousemove:this.passEventToSlider,scope:this});var b=this.map.zoom;!this.forceFixedZoomLevel&&this.map.fractionalZoom?(b+=this.deltaY/this.zoomStopHeight,b=Math.min(Math.max(b,0),this.map.getNumZoomLevels()-1)):(b+=this.deltaY/this.zoomStopHeight,b=Math.max(Math.round(b),0));this.map.zoomTo(b);this.zoomStart=this.mouseDragStart=null;this.deltaY=0;OpenLayers.Event.stop(a)}}, +moveZoomBar:function(){var a=(this.map.getNumZoomLevels()-1-this.map.getZoom())*this.zoomStopHeight+this.startTop+1;this.slider.style.top=a+"px"},CLASS_NAME:"OpenLayers.Control.PanZoomBar"});OpenLayers.Format.WFSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",CLASS_NAME:"OpenLayers.Format.WFSCapabilities"});OpenLayers.Format.WFSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{wfs:"http://www.opengis.net/wfs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows"},errorProperty:"featureTypeList",defaultPrefix:"wfs",read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b},readers:{wfs:{WFS_Capabilities:function(a, +b){this.readChildNodes(a,b)},FeatureTypeList:function(a,b){b.featureTypeList={featureTypes:[]};this.readChildNodes(a,b.featureTypeList)},FeatureType:function(a,b){var c={};this.readChildNodes(a,c);b.featureTypes.push(c)},Name:function(a,b){var c=this.getChildValue(a);c&&(c=c.split(":"),b.name=c.pop(),0<c.length&&(b.featureNS=this.lookupNamespaceURI(a,c[0])))},Title:function(a,b){var c=this.getChildValue(a);c&&(b.title=c)},Abstract:function(a,b){var c=this.getChildValue(a);c&&(b["abstract"]=c)}}}, +CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1"});OpenLayers.Format.WFSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},readers:{wfs:OpenLayers.Util.applyDefaults({DefaultSRS:function(a,b){var c=this.getChildValue(a);c&&(b.srs=c)}},OpenLayers.Format.WFSCapabilities.v1.prototype.readers.wfs),ows:OpenLayers.Format.OWSCommon.v1.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_1_0"});OpenLayers.Layer.Image=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!0,url:null,extent:null,size:null,tile:null,aspectRatio:null,initialize:function(a,b,c,d,e){this.url=b;this.maxExtent=this.extent=c;this.size=d;OpenLayers.Layer.prototype.initialize.apply(this,[a,e]);this.aspectRatio=this.extent.getHeight()/this.size.h/(this.extent.getWidth()/this.size.w)},destroy:function(){this.tile&&(this.removeTileMonitoringHooks(this.tile),this.tile.destroy(),this.tile=null);OpenLayers.Layer.prototype.destroy.apply(this, +arguments)},clone:function(a){null==a&&(a=new OpenLayers.Layer.Image(this.name,this.url,this.extent,this.size,this.getOptions()));return a=OpenLayers.Layer.prototype.clone.apply(this,[a])},setMap:function(a){null==this.options.maxResolution&&(this.options.maxResolution=this.aspectRatio*this.extent.getWidth()/this.size.w);OpenLayers.Layer.prototype.setMap.apply(this,arguments)},moveTo:function(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var d=null==this.tile;if(b||d){this.setTileSize(); +var e=this.map.getLayerPxFromLonLat({lon:this.extent.left,lat:this.extent.top});d?(this.tile=new OpenLayers.Tile.Image(this,e,this.extent,null,this.tileSize),this.addTileMonitoringHooks(this.tile)):(this.tile.size=this.tileSize.clone(),this.tile.position=e.clone());this.tile.draw()}},setTileSize:function(){var a=this.extent.getWidth()/this.map.getResolution(),b=this.extent.getHeight()/this.map.getResolution();this.tileSize=new OpenLayers.Size(a,b)},addTileMonitoringHooks:function(a){a.onLoadStart= +function(){this.events.triggerEvent("loadstart")};a.events.register("loadstart",this,a.onLoadStart);a.onLoadEnd=function(){this.events.triggerEvent("loadend")};a.events.register("loadend",this,a.onLoadEnd);a.events.register("unload",this,a.onLoadEnd)},removeTileMonitoringHooks:function(a){a.unload();a.events.un({loadstart:a.onLoadStart,loadend:a.onLoadEnd,unload:a.onLoadEnd,scope:this})},setUrl:function(a){this.url=a;this.tile.draw()},getURL:function(a){return this.url},CLASS_NAME:"OpenLayers.Layer.Image"});OpenLayers.Strategy=OpenLayers.Class({layer:null,options:null,active:null,autoActivate:!0,autoDestroy:!0,initialize:function(a){OpenLayers.Util.extend(this,a);this.options=a;this.active=!1},destroy:function(){this.deactivate();this.options=this.layer=null},setLayer:function(a){this.layer=a},activate:function(){return this.active?!1:this.active=!0},deactivate:function(){return this.active?(this.active=!1,!0):!1},CLASS_NAME:"OpenLayers.Strategy"});OpenLayers.Strategy.Save=OpenLayers.Class(OpenLayers.Strategy,{events:null,auto:!1,timer:null,initialize:function(a){OpenLayers.Strategy.prototype.initialize.apply(this,[a]);this.events=new OpenLayers.Events(this)},activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a&&this.auto)if("number"===typeof this.auto)this.timer=window.setInterval(OpenLayers.Function.bind(this.save,this),1E3*this.auto);else this.layer.events.on({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave, +scope:this});return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);a&&this.auto&&("number"===typeof this.auto?window.clearInterval(this.timer):this.layer.events.un({featureadded:this.triggerSave,afterfeaturemodified:this.triggerSave,scope:this}));return a},triggerSave:function(a){var b=a.feature;b.state!==OpenLayers.State.INSERT&&b.state!==OpenLayers.State.UPDATE&&b.state!==OpenLayers.State.DELETE||this.save([a.feature])},save:function(a){a||(a=this.layer.features); +this.events.triggerEvent("start",{features:a});var b=this.layer.projection,c=this.layer.map.getProjectionObject();if(!c.equals(b)){for(var d=a.length,e=Array(d),f,g,h=0;h<d;++h)f=a[h],g=f.clone(),g.fid=f.fid,g.state=f.state,f.url&&(g.url=f.url),g._original=f,g.geometry.transform(c,b),e[h]=g;a=e}this.layer.protocol.commit(a,{callback:this.onCommit,scope:this})},onCommit:function(a){var b={response:a};if(a.success()){for(var c=a.reqFeatures,d,e=[],f=a.insertIds||[],g=0,h=0,k=c.length;h<k;++h)if(d=c[h], +d=d._original||d,a=d.state)a==OpenLayers.State.DELETE?e.push(d):a==OpenLayers.State.INSERT&&(d.fid=f[g],++g),d.state=null;0<e.length&&this.layer.destroyFeatures(e);this.events.triggerEvent("success",b)}else this.events.triggerEvent("fail",b)},CLASS_NAME:"OpenLayers.Strategy.Save"});OpenLayers.Events.featureclick=OpenLayers.Class({cache:null,map:null,provides:["featureclick","nofeatureclick","featureover","featureout"],initialize:function(a){this.target=a;if(a.object instanceof OpenLayers.Map)this.setMap(a.object);else if(a.object instanceof OpenLayers.Layer.Vector)a.object.map?this.setMap(a.object.map):a.object.events.register("added",this,function(b){this.setMap(a.object.map)});else throw"Listeners for '"+this.provides.join("', '")+"' events can only be registered for OpenLayers.Layer.Vector or OpenLayers.Map instances"; +for(var b=this.provides.length-1;0<=b;--b)a.extensions[this.provides[b]]=!0},setMap:function(a){this.map=a;this.cache={};a.events.register("mousedown",this,this.start,{extension:!0});a.events.register("mouseup",this,this.onClick,{extension:!0});a.events.register("touchstart",this,this.start,{extension:!0});a.events.register("touchmove",this,this.cancel,{extension:!0});a.events.register("touchend",this,this.onClick,{extension:!0});a.events.register("mousemove",this,this.onMousemove,{extension:!0})}, +start:function(a){this.startEvt=a},cancel:function(a){delete this.startEvt},onClick:function(a){if(this.startEvt&&("touchend"===a.type||OpenLayers.Event.isLeftClick(a))){a=this.getFeatures(this.startEvt);delete this.startEvt;for(var b,c,d={},e=0,f=a.length;e<f&&(b=a[e],c=b.layer,d[c.id]=!0,b=this.triggerEvent("featureclick",{feature:b}),!1!==b);++e);e=0;for(f=this.map.layers.length;e<f;++e)c=this.map.layers[e],c instanceof OpenLayers.Layer.Vector&&!d[c.id]&&this.triggerEvent("nofeatureclick",{layer:c})}}, +onMousemove:function(a){delete this.startEvt;var b=this.getFeatures(a),c={};a=[];for(var d,e=0,f=b.length;e<f;++e)d=b[e],c[d.id]=d,this.cache[d.id]||a.push(d);var b=[],g;for(g in this.cache)d=this.cache[g],d.layer&&d.layer.map?c[d.id]||b.push(d):delete this.cache[g];e=0;for(f=a.length;e<f&&(d=a[e],this.cache[d.id]=d,g=this.triggerEvent("featureover",{feature:d}),!1!==g);++e);e=0;for(f=b.length;e<f&&(d=b[e],delete this.cache[d.id],g=this.triggerEvent("featureout",{feature:d}),!1!==g);++e);},triggerEvent:function(a, +b){var c=b.feature?b.feature.layer:b.layer,d=this.target.object;if(d instanceof OpenLayers.Map||d===c)return this.target.triggerEvent(a,b)},getFeatures:function(a){var b=a.clientX,c=a.clientY,d=[],e=[],f=[],g,h,k,l;for(l=this.map.layers.length-1;0<=l;--l)if(g=this.map.layers[l],"none"!==g.div.style.display)if(g.renderer instanceof OpenLayers.Renderer.Elements){if(g instanceof OpenLayers.Layer.Vector)for(h=document.elementFromPoint(b,c);h&&h._featureId;)(k=g.getFeatureById(h._featureId))?(d.push(k), +h.style.display="none",e.push(h),h=document.elementFromPoint(b,c)):h=!1;f.push(g);g.div.style.display="none"}else g.renderer instanceof OpenLayers.Renderer.Canvas&&(k=g.renderer.getFeatureIdFromEvent(a))&&(d.push(k),f.push(g));l=0;for(a=e.length;l<a;++l)e[l].style.display="";for(l=f.length-1;0<=l;--l)f[l].div.style.display="block";return d},destroy:function(){for(var a=this.provides.length-1;0<=a;--a)delete this.target.extensions[this.provides[a]];this.map.events.un({mousemove:this.onMousemove,mousedown:this.start, +mouseup:this.onClick,touchstart:this.start,touchmove:this.cancel,touchend:this.onClick,scope:this});delete this.cache;delete this.map;delete this.target}});OpenLayers.Events.nofeatureclick=OpenLayers.Events.featureclick;OpenLayers.Events.featureover=OpenLayers.Events.featureclick;OpenLayers.Events.featureout=OpenLayers.Events.featureclick;OpenLayers.Format.GPX=OpenLayers.Class(OpenLayers.Format.XML,{defaultDesc:"No description available",extractWaypoints:!0,extractTracks:!0,extractRoutes:!0,extractAttributes:!0,namespaces:{gpx:"http://www.topografix.com/GPX/1/1",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd",creator:"OpenLayers",initialize:function(a){this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this, +[a])},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=[];if(this.extractTracks)for(var c=a.getElementsByTagName("trk"),d=0,e=c.length;d<e;d++){var f={};this.extractAttributes&&(f=this.parseAttributes(c[d]));for(var g=this.getElementsByTagNameNS(c[d],c[d].namespaceURI,"trkseg"),h=0,k=g.length;h<k;h++){var l=this.extractSegment(g[h],"trkpt");b.push(new OpenLayers.Feature.Vector(l,f))}}if(this.extractRoutes)for(e=a.getElementsByTagName("rte"),c=0,d= +e.length;c<d;c++)f={},this.extractAttributes&&(f=this.parseAttributes(e[c])),g=this.extractSegment(e[c],"rtept"),b.push(new OpenLayers.Feature.Vector(g,f));if(this.extractWaypoints)for(a=a.getElementsByTagName("wpt"),c=0,e=a.length;c<e;c++)f={},this.extractAttributes&&(f=this.parseAttributes(a[c])),d=new OpenLayers.Geometry.Point(a[c].getAttribute("lon"),a[c].getAttribute("lat")),b.push(new OpenLayers.Feature.Vector(d,f));if(this.internalProjection&&this.externalProjection)for(f=0,a=b.length;f<a;f++)b[f].geometry.transform(this.externalProjection, +this.internalProjection);return b},extractSegment:function(a,b){for(var c=this.getElementsByTagNameNS(a,a.namespaceURI,b),d=[],e=0,f=c.length;e<f;e++)d.push(new OpenLayers.Geometry.Point(c[e].getAttribute("lon"),c[e].getAttribute("lat")));return new OpenLayers.Geometry.LineString(d)},parseAttributes:function(a){var b={};a=a.firstChild;for(var c,d;a;)1==a.nodeType&&a.firstChild&&(c=a.firstChild,3==c.nodeType||4==c.nodeType)&&(d=a.prefix?a.nodeName.split(":")[1]:a.nodeName,"trkseg"!=d&&"rtept"!=d&& +(b[d]=c.nodeValue)),a=a.nextSibling;return b},write:function(a,b){a=OpenLayers.Util.isArray(a)?a:[a];var c=this.createElementNS(this.namespaces.gpx,"gpx");c.setAttribute("version","1.1");c.setAttribute("creator",this.creator);this.setAttributes(c,{"xsi:schemaLocation":this.schemaLocation});b&&"object"==typeof b&&c.appendChild(this.buildMetadataNode(b));for(var d=0,e=a.length;d<e;d++)c.appendChild(this.buildFeatureNode(a[d]));return OpenLayers.Format.XML.prototype.write.apply(this,[c])},buildMetadataNode:function(a){for(var b= +["name","desc","author"],c=this.createElementNS(this.namespaces.gpx,"metadata"),d=0;d<b.length;d++){var e=b[d];if(a[e]){var f=this.createElementNS(this.namespaces.gpx,e);f.appendChild(this.createTextNode(a[e]));c.appendChild(f)}}return c},buildFeatureNode:function(a){var b=a.geometry,b=b.clone();this.internalProjection&&this.externalProjection&&b.transform(this.internalProjection,this.externalProjection);if("OpenLayers.Geometry.Point"==b.CLASS_NAME){var c=this.buildWptNode(b);this.appendAttributesNode(c, +a);return c}c=this.createElementNS(this.namespaces.gpx,"trk");this.appendAttributesNode(c,a);a=this.buildTrkSegNode(b);a=OpenLayers.Util.isArray(a)?a:[a];for(var b=0,d=a.length;b<d;b++)c.appendChild(a[b]);return c},buildTrkSegNode:function(a){var b,c,d,e;if("OpenLayers.Geometry.LineString"==a.CLASS_NAME||"OpenLayers.Geometry.LinearRing"==a.CLASS_NAME){b=this.createElementNS(this.namespaces.gpx,"trkseg");c=0;for(d=a.components.length;c<d;c++)e=a.components[c],b.appendChild(this.buildTrkPtNode(e)); +return b}b=[];c=0;for(d=a.components.length;c<d;c++)b.push(this.buildTrkSegNode(a.components[c]));return b},buildTrkPtNode:function(a){var b=this.createElementNS(this.namespaces.gpx,"trkpt");b.setAttribute("lon",a.x);b.setAttribute("lat",a.y);return b},buildWptNode:function(a){var b=this.createElementNS(this.namespaces.gpx,"wpt");b.setAttribute("lon",a.x);b.setAttribute("lat",a.y);return b},appendAttributesNode:function(a,b){var c=this.createElementNS(this.namespaces.gpx,"name");c.appendChild(this.createTextNode(b.attributes.name|| +b.id));a.appendChild(c);c=this.createElementNS(this.namespaces.gpx,"desc");c.appendChild(this.createTextNode(b.attributes.description||this.defaultDesc));a.appendChild(c)},CLASS_NAME:"OpenLayers.Format.GPX"});OpenLayers.Format.WMSDescribeLayer=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer"});OpenLayers.Format.WMSDescribeLayer.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSDescribeLayer,{initialize:function(a){OpenLayers.Format.WMSDescribeLayer.prototype.initialize.apply(this,[a])},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));for(var b=a.documentElement.childNodes,c={layerDescriptions:[]},d,e,f=0;f<b.length;++f)if(d=b[f],e=d.nodeName,"LayerDescription"==e){e=d.getAttribute("name");var g="",h="",k="";d.getAttribute("owsType")?(g=d.getAttribute("owsType"), +h=d.getAttribute("owsURL")):""!=d.getAttribute("wfs")?(g="WFS",h=d.getAttribute("wfs")):""!=d.getAttribute("wcs")&&(g="WCS",h=d.getAttribute("wcs"));d=d.getElementsByTagName("Query");0<d.length&&((k=d[0].getAttribute("typeName"))||(k=d[0].getAttribute("typename")));d={layerName:e,owsType:g,owsURL:h,typeName:k};c.layerDescriptions.push(d);c.length=c.layerDescriptions.length;c[c.length-1]=d}else if("ServiceException"==e)return{error:(new OpenLayers.Format.OGCExceptionReport).read(a)};return c},CLASS_NAME:"OpenLayers.Format.WMSDescribeLayer.v1_1_1"}); +OpenLayers.Format.WMSDescribeLayer.v1_1_0=OpenLayers.Format.WMSDescribeLayer.v1_1_1;OpenLayers.Layer.XYZ=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,sphericalMercator:!1,zoomOffset:0,serverResolutions:null,initialize:function(a,b,c){if(c&&c.sphericalMercator||this.sphericalMercator)c=OpenLayers.Util.extend({projection:"EPSG:900913",numZoomLevels:19},c);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a||this.name,b||this.url,{},c])},clone:function(a){null==a&&(a=new OpenLayers.Layer.XYZ(this.name,this.url,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this, +[a])},getURL:function(a){a=this.getXYZ(a);var b=this.url;OpenLayers.Util.isArray(b)&&(b=this.selectUrl(""+a.x+a.y+a.z,b));return OpenLayers.String.format(b,a)},getXYZ:function(a){var b=this.getServerResolution(),c=Math.round((a.left-this.maxExtent.left)/(b*this.tileSize.w));a=Math.round((this.maxExtent.top-a.top)/(b*this.tileSize.h));b=this.getServerZoom();if(this.wrapDateLine)var d=Math.pow(2,b),c=(c%d+d)%d;return{x:c,y:a,z:b}},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this, +arguments);this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.XYZ"});OpenLayers.Layer.OSM=OpenLayers.Class(OpenLayers.Layer.XYZ,{name:"OpenStreetMap",url:["http://a.tile.openstreetmap.org/${z}/${x}/${y}.png","http://b.tile.openstreetmap.org/${z}/${x}/${y}.png","http://c.tile.openstreetmap.org/${z}/${x}/${y}.png"],attribution:"© <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a> contributors",sphericalMercator:!0,wrapDateLine:!0,tileOptions:null,initialize:function(a,b,c){OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments);this.tileOptions= +OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options&&this.options.tileOptions)},clone:function(a){null==a&&(a=new OpenLayers.Layer.OSM(this.name,this.url,this.getOptions()));return a=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[a])},CLASS_NAME:"OpenLayers.Layer.OSM"});OpenLayers.Renderer=OpenLayers.Class({container:null,root:null,extent:null,locked:!1,size:null,resolution:null,map:null,featureDx:0,initialize:function(a,b){this.container=OpenLayers.Util.getElement(a);OpenLayers.Util.extend(this,b)},destroy:function(){this.map=this.resolution=this.size=this.extent=this.container=null},supported:function(){return!1},setExtent:function(a,b){this.extent=a.clone();if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var c=a.getWidth()/this.map.getExtent().getWidth(); +a=a.scale(1/c);this.extent=a.wrapDateLine(this.map.getMaxExtent()).scale(c)}b&&(this.resolution=null);return!0},setSize:function(a){this.size=a.clone();this.resolution=null},getResolution:function(){return this.resolution=this.resolution||this.map.getResolution()},drawFeature:function(a,b){null==b&&(b=a.style);if(a.geometry){var c=a.geometry.getBounds();if(c){var d;this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(d=this.map.getMaxExtent());c.intersectsBounds(this.extent,{worldBounds:d})?this.calculateFeatureDx(c, +d):b={display:"none"};c=this.drawGeometry(a.geometry,b,a.id);if("none"!=b.display&&b.label&&!1!==c){d=a.geometry.getCentroid();if(b.labelXOffset||b.labelYOffset){var e=isNaN(b.labelXOffset)?0:b.labelXOffset,f=isNaN(b.labelYOffset)?0:b.labelYOffset,g=this.getResolution();d.move(e*g,f*g)}this.drawText(a.id,b,d)}else this.removeText(a.id);return c}}},calculateFeatureDx:function(a,b){this.featureDx=0;if(b){var c=b.getWidth();this.featureDx=Math.round(((a.left+a.right)/2-(this.extent.left+this.extent.right)/ +2)/c)*c}},drawGeometry:function(a,b,c){},drawText:function(a,b,c){},removeText:function(a){},clear:function(){},getFeatureIdFromEvent:function(a){},eraseFeatures:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=0,c=a.length;b<c;++b){var d=a[b];this.eraseGeometry(d.geometry,d.id);this.removeText(d.id)}},eraseGeometry:function(a,b){},moveRoot:function(a){},getRenderLayerId:function(){return this.container.id},applyDefaultSymbolizer:function(a){var b=OpenLayers.Util.extend({},OpenLayers.Renderer.defaultSymbolizer); +!1===a.stroke&&(delete b.strokeWidth,delete b.strokeColor);!1===a.fill&&delete b.fillColor;OpenLayers.Util.extend(b,a);return b},CLASS_NAME:"OpenLayers.Renderer"});OpenLayers.Renderer.defaultSymbolizer={fillColor:"#000000",strokeColor:"#000000",strokeWidth:2,fillOpacity:1,strokeOpacity:1,pointRadius:0,labelAlign:"cm"}; +OpenLayers.Renderer.symbol={star:[350,75,379,161,469,161,397,215,423,301,350,250,277,301,303,215,231,161,321,161,350,75],cross:[4,0,6,0,6,4,10,4,10,6,6,6,6,10,4,10,4,6,0,6,0,4,4,4,4,0],x:[0,0,25,0,50,35,75,0,100,0,65,50,100,100,75,100,50,65,25,100,0,100,35,50,0,0],square:[0,0,0,1,1,1,1,0,0,0],triangle:[0,10,10,10,5,0,0,10]};OpenLayers.Renderer.Canvas=OpenLayers.Class(OpenLayers.Renderer,{hitDetection:!0,hitOverflow:0,canvas:null,features:null,pendingRedraw:!1,cachedSymbolBounds:{},initialize:function(a,b){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.root=document.createElement("canvas");this.container.appendChild(this.root);this.canvas=this.root.getContext("2d");this.features={};this.hitDetection&&(this.hitCanvas=document.createElement("canvas"),this.hitContext=this.hitCanvas.getContext("2d"))}, +setExtent:function(){OpenLayers.Renderer.prototype.setExtent.apply(this,arguments);return!1},eraseGeometry:function(a,b){this.eraseFeatures(this.features[b][0])},supported:function(){return OpenLayers.CANVAS_SUPPORTED},setSize:function(a){this.size=a.clone();var b=this.root;b.style.width=a.w+"px";b.style.height=a.h+"px";b.width=a.w;b.height=a.h;this.resolution=null;this.hitDetection&&(b=this.hitCanvas,b.style.width=a.w+"px",b.style.height=a.h+"px",b.width=a.w,b.height=a.h)},drawFeature:function(a, +b){var c;if(a.geometry){b=this.applyDefaultSymbolizer(b||a.style);c=a.geometry.getBounds();var d;this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&(d=this.map.getMaxExtent());d=c&&c.intersectsBounds(this.extent,{worldBounds:d});(c="none"!==b.display&&!!c&&d)?this.features[a.id]=[a,b]:delete this.features[a.id];this.pendingRedraw=!0}this.pendingRedraw&&!this.locked&&(this.redraw(),this.pendingRedraw=!1);return c},drawGeometry:function(a,b,c){var d=a.CLASS_NAME;if("OpenLayers.Geometry.Collection"== +d||"OpenLayers.Geometry.MultiPoint"==d||"OpenLayers.Geometry.MultiLineString"==d||"OpenLayers.Geometry.MultiPolygon"==d)for(d=0;d<a.components.length;d++)this.drawGeometry(a.components[d],b,c);else switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":this.drawPoint(a,b,c);break;case "OpenLayers.Geometry.LineString":this.drawLineString(a,b,c);break;case "OpenLayers.Geometry.LinearRing":this.drawLinearRing(a,b,c);break;case "OpenLayers.Geometry.Polygon":this.drawPolygon(a,b,c)}},drawExternalGraphic:function(a, +b,c){var d=new Image,e=b.title||b.graphicTitle;e&&(d.title=e);var f=b.graphicWidth||b.graphicHeight,g=b.graphicHeight||b.graphicWidth,f=f?f:2*b.pointRadius,g=g?g:2*b.pointRadius,h=void 0!=b.graphicXOffset?b.graphicXOffset:-(0.5*f),k=void 0!=b.graphicYOffset?b.graphicYOffset:-(0.5*g),l=b.graphicOpacity||b.fillOpacity;d.onload=OpenLayers.Function.bind(function(){if(this.features[c]){var b=this.getLocalXY(a),e=b[0],b=b[1];if(!isNaN(e)&&!isNaN(b)){var e=e+h|0,b=b+k|0,p=this.canvas;p.globalAlpha=l;var q= +OpenLayers.Renderer.Canvas.drawImageScaleFactor||(OpenLayers.Renderer.Canvas.drawImageScaleFactor=/android 2.1/.test(navigator.userAgent.toLowerCase())?320/window.screen.width:1);p.drawImage(d,e*q,b*q,f*q,g*q);this.hitDetection&&(this.setHitContextStyle("fill",c),this.hitContext.fillRect(e,b,f,g))}}},this);d.src=b.externalGraphic},drawNamedSymbol:function(a,b,c){var d,e,f,g;f=Math.PI/180;var h=OpenLayers.Renderer.symbol[b.graphicName];if(!h)throw Error(b.graphicName+" is not a valid symbol name"); +if(!(!h.length||2>h.length||(a=this.getLocalXY(a),e=a[0],g=a[1],isNaN(e)||isNaN(g)))){this.canvas.lineCap="round";this.canvas.lineJoin="round";this.hitDetection&&(this.hitContext.lineCap="round",this.hitContext.lineJoin="round");if(b.graphicName in this.cachedSymbolBounds)d=this.cachedSymbolBounds[b.graphicName];else{d=new OpenLayers.Bounds;for(a=0;a<h.length;a+=2)d.extend(new OpenLayers.LonLat(h[a],h[a+1]));this.cachedSymbolBounds[b.graphicName]=d}this.canvas.save();this.hitDetection&&this.hitContext.save(); +this.canvas.translate(e,g);this.hitDetection&&this.hitContext.translate(e,g);a=f*b.rotation;isNaN(a)||(this.canvas.rotate(a),this.hitDetection&&this.hitContext.rotate(a));f=2*b.pointRadius/Math.max(d.getWidth(),d.getHeight());this.canvas.scale(f,f);this.hitDetection&&this.hitContext.scale(f,f);a=d.getCenterLonLat().lon;d=d.getCenterLonLat().lat;this.canvas.translate(-a,-d);this.hitDetection&&this.hitContext.translate(-a,-d);g=b.strokeWidth;b.strokeWidth=g/f;if(!1!==b.fill){this.setCanvasStyle("fill", +b);this.canvas.beginPath();for(a=0;a<h.length;a+=2)d=h[a],e=h[a+1],0==a&&this.canvas.moveTo(d,e),this.canvas.lineTo(d,e);this.canvas.closePath();this.canvas.fill();if(this.hitDetection){this.setHitContextStyle("fill",c,b);this.hitContext.beginPath();for(a=0;a<h.length;a+=2)d=h[a],e=h[a+1],0==a&&this.canvas.moveTo(d,e),this.hitContext.lineTo(d,e);this.hitContext.closePath();this.hitContext.fill()}}if(!1!==b.stroke){this.setCanvasStyle("stroke",b);this.canvas.beginPath();for(a=0;a<h.length;a+=2)d=h[a], +e=h[a+1],0==a&&this.canvas.moveTo(d,e),this.canvas.lineTo(d,e);this.canvas.closePath();this.canvas.stroke();if(this.hitDetection){this.setHitContextStyle("stroke",c,b,f);this.hitContext.beginPath();for(a=0;a<h.length;a+=2)d=h[a],e=h[a+1],0==a&&this.hitContext.moveTo(d,e),this.hitContext.lineTo(d,e);this.hitContext.closePath();this.hitContext.stroke()}}b.strokeWidth=g;this.canvas.restore();this.hitDetection&&this.hitContext.restore();this.setCanvasStyle("reset")}},setCanvasStyle:function(a,b){"fill"=== +a?(this.canvas.globalAlpha=b.fillOpacity,this.canvas.fillStyle=b.fillColor):"stroke"===a?(this.canvas.globalAlpha=b.strokeOpacity,this.canvas.strokeStyle=b.strokeColor,this.canvas.lineWidth=b.strokeWidth):(this.canvas.globalAlpha=0,this.canvas.lineWidth=1)},featureIdToHex:function(a){a=Number(a.split("_").pop())+1;16777216<=a&&(this.hitOverflow=a-16777215,a=a%16777216+1);a="000000"+a.toString(16);var b=a.length;return a="#"+a.substring(b-6,b)},setHitContextStyle:function(a,b,c,d){b=this.featureIdToHex(b); +"fill"==a?(this.hitContext.globalAlpha=1,this.hitContext.fillStyle=b):"stroke"==a?(this.hitContext.globalAlpha=1,this.hitContext.strokeStyle=b,"undefined"===typeof d?this.hitContext.lineWidth=c.strokeWidth+2:isNaN(d)||(this.hitContext.lineWidth=c.strokeWidth+2/d)):(this.hitContext.globalAlpha=0,this.hitContext.lineWidth=1)},drawPoint:function(a,b,c){if(!1!==b.graphic)if(b.externalGraphic)this.drawExternalGraphic(a,b,c);else if(b.graphicName&&"circle"!=b.graphicName)this.drawNamedSymbol(a,b,c);else{var d= +this.getLocalXY(a);a=d[0];d=d[1];if(!isNaN(a)&&!isNaN(d)){var e=2*Math.PI,f=b.pointRadius;!1!==b.fill&&(this.setCanvasStyle("fill",b),this.canvas.beginPath(),this.canvas.arc(a,d,f,0,e,!0),this.canvas.fill(),this.hitDetection&&(this.setHitContextStyle("fill",c,b),this.hitContext.beginPath(),this.hitContext.arc(a,d,f,0,e,!0),this.hitContext.fill()));!1!==b.stroke&&(this.setCanvasStyle("stroke",b),this.canvas.beginPath(),this.canvas.arc(a,d,f,0,e,!0),this.canvas.stroke(),this.hitDetection&&(this.setHitContextStyle("stroke", +c,b),this.hitContext.beginPath(),this.hitContext.arc(a,d,f,0,e,!0),this.hitContext.stroke()),this.setCanvasStyle("reset"))}}},drawLineString:function(a,b,c){b=OpenLayers.Util.applyDefaults({fill:!1},b);this.drawLinearRing(a,b,c)},drawLinearRing:function(a,b,c){!1!==b.fill&&(this.setCanvasStyle("fill",b),this.renderPath(this.canvas,a,b,c,"fill"),this.hitDetection&&(this.setHitContextStyle("fill",c,b),this.renderPath(this.hitContext,a,b,c,"fill")));!1!==b.stroke&&(this.setCanvasStyle("stroke",b),this.renderPath(this.canvas, +a,b,c,"stroke"),this.hitDetection&&(this.setHitContextStyle("stroke",c,b),this.renderPath(this.hitContext,a,b,c,"stroke")));this.setCanvasStyle("reset")},renderPath:function(a,b,c,d,e){b=b.components;c=b.length;a.beginPath();d=this.getLocalXY(b[0]);var f=d[1];if(!isNaN(d[0])&&!isNaN(f)){a.moveTo(d[0],d[1]);for(d=1;d<c;++d)f=this.getLocalXY(b[d]),a.lineTo(f[0],f[1]);"fill"===e?a.fill():a.stroke()}},drawPolygon:function(a,b,c){a=a.components;var d=a.length;this.drawLinearRing(a[0],b,c);for(var e=1;e< +d;++e)this.canvas.globalCompositeOperation="destination-out",this.hitDetection&&(this.hitContext.globalCompositeOperation="destination-out"),this.drawLinearRing(a[e],OpenLayers.Util.applyDefaults({stroke:!1,fillOpacity:1},b),c),this.canvas.globalCompositeOperation="source-over",this.hitDetection&&(this.hitContext.globalCompositeOperation="source-over"),this.drawLinearRing(a[e],OpenLayers.Util.applyDefaults({fill:!1},b),c)},drawText:function(a,b){var c=this.getLocalXY(a);this.setCanvasStyle("reset"); +this.canvas.fillStyle=b.fontColor;this.canvas.globalAlpha=b.fontOpacity||1;var d=[b.fontStyle?b.fontStyle:"normal","normal",b.fontWeight?b.fontWeight:"normal",b.fontSize?b.fontSize:"1em",b.fontFamily?b.fontFamily:"sans-serif"].join(" "),e=b.label.split("\n"),f=e.length;if(this.canvas.fillText){this.canvas.font=d;this.canvas.textAlign=OpenLayers.Renderer.Canvas.LABEL_ALIGN[b.labelAlign[0]]||"center";this.canvas.textBaseline=OpenLayers.Renderer.Canvas.LABEL_ALIGN[b.labelAlign[1]]||"middle";var g=OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[1]]; +null==g&&(g=-0.5);d=this.canvas.measureText("Mg").height||this.canvas.measureText("xx").width;c[1]+=d*g*(f-1);for(g=0;g<f;g++)b.labelOutlineWidth&&(this.canvas.save(),this.canvas.globalAlpha=b.labelOutlineOpacity||b.fontOpacity||1,this.canvas.strokeStyle=b.labelOutlineColor,this.canvas.lineWidth=b.labelOutlineWidth,this.canvas.strokeText(e[g],c[0],c[1]+d*g+1),this.canvas.restore()),this.canvas.fillText(e[g],c[0],c[1]+d*g)}else if(this.canvas.mozDrawText){this.canvas.mozTextStyle=d;var h=OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[0]]; +null==h&&(h=-0.5);g=OpenLayers.Renderer.Canvas.LABEL_FACTOR[b.labelAlign[1]];null==g&&(g=-0.5);d=this.canvas.mozMeasureText("xx");c[1]+=d*(1+g*f);for(g=0;g<f;g++){var k=c[0]+h*this.canvas.mozMeasureText(e[g]),l=c[1]+g*d;this.canvas.translate(k,l);this.canvas.mozDrawText(e[g]);this.canvas.translate(-k,-l)}}this.setCanvasStyle("reset")},getLocalXY:function(a){var b=this.getResolution(),c=this.extent;return[(a.x-this.featureDx)/b+-c.left/b,c.top/b-a.y/b]},clear:function(){var a=this.root.height,b=this.root.width; +this.canvas.clearRect(0,0,b,a);this.features={};this.hitDetection&&this.hitContext.clearRect(0,0,b,a)},getFeatureIdFromEvent:function(a){var b;if(this.hitDetection&&"none"!==this.root.style.display&&!this.map.dragging&&(a=a.xy,a=this.hitContext.getImageData(a.x|0,a.y|0,1,1).data,255===a[3]&&(a=a[2]+256*(a[1]+256*a[0])))){a="OpenLayers_Feature_Vector_"+(a-1+this.hitOverflow);try{b=this.features[a][0]}catch(c){}}return b},eraseFeatures:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=0;b<a.length;++b)delete this.features[a[b].id]; +this.redraw()},redraw:function(){if(!this.locked){var a=this.root.height,b=this.root.width;this.canvas.clearRect(0,0,b,a);this.hitDetection&&this.hitContext.clearRect(0,0,b,a);var a=[],c,d,e=this.map.baseLayer&&this.map.baseLayer.wrapDateLine&&this.map.getMaxExtent(),f;for(f in this.features)this.features.hasOwnProperty(f)&&(b=this.features[f][0],c=b.geometry,this.calculateFeatureDx(c.getBounds(),e),d=this.features[f][1],this.drawGeometry(c,d,b.id),d.label&&a.push([b,d]));b=0;for(c=a.length;b<c;++b)f= +a[b],this.drawText(f[0].geometry.getCentroid(),f[1])}},CLASS_NAME:"OpenLayers.Renderer.Canvas"});OpenLayers.Renderer.Canvas.LABEL_ALIGN={l:"left",r:"right",t:"top",b:"bottom"};OpenLayers.Renderer.Canvas.LABEL_FACTOR={l:0,r:-1,t:0,b:-1};OpenLayers.Renderer.Canvas.drawImageScaleFactor=null;OpenLayers.Format.OSM=OpenLayers.Class(OpenLayers.Format.XML,{checkTags:!1,interestingTagsExclude:null,areaTags:null,initialize:function(a){var b={interestingTagsExclude:"source source_ref source:ref history attribution created_by".split(" "),areaTags:"area building leisure tourism ruins historic landuse military natural sport".split(" ")},b=OpenLayers.Util.extend(b,a),c={};for(a=0;a<b.interestingTagsExclude.length;a++)c[b.interestingTagsExclude[a]]=!0;b.interestingTagsExclude=c;c={};for(a=0;a<b.areaTags.length;a++)c[b.areaTags[a]]= +!0;b.areaTags=c;this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[b])},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=this.getNodes(a),c=this.getWays(a);a=Array(c.length);for(var d=0;d<c.length;d++){for(var e=Array(c[d].nodes.length),f=this.isWayArea(c[d])?1:0,g=0;g<c[d].nodes.length;g++){var h=b[c[d].nodes[g]],k=new OpenLayers.Geometry.Point(h.lon,h.lat);k.osm_id=parseInt(c[d].nodes[g]); +e[g]=k;h.used=!0}h=null;h=f?new OpenLayers.Geometry.Polygon(new OpenLayers.Geometry.LinearRing(e)):new OpenLayers.Geometry.LineString(e);this.internalProjection&&this.externalProjection&&h.transform(this.externalProjection,this.internalProjection);e=new OpenLayers.Feature.Vector(h,c[d].tags);e.osm_id=parseInt(c[d].id);e.fid="way."+e.osm_id;a[d]=e}for(var l in b){h=b[l];if(!h.used||this.checkTags){c=null;if(this.checkTags){c=this.getTags(h.node,!0);if(h.used&&!c[1])continue;c=c[0]}else c=this.getTags(h.node); +e=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(h.lon,h.lat),c);this.internalProjection&&this.externalProjection&&e.geometry.transform(this.externalProjection,this.internalProjection);e.osm_id=parseInt(l);e.fid="node."+e.osm_id;a.push(e)}h.node=null}return a},getNodes:function(a){a=a.getElementsByTagName("node");for(var b={},c=0;c<a.length;c++){var d=a[c],e=d.getAttribute("id");b[e]={lat:d.getAttribute("lat"),lon:d.getAttribute("lon"),node:d}}return b},getWays:function(a){a=a.getElementsByTagName("way"); +for(var b=[],c=0;c<a.length;c++){var d=a[c],e={id:d.getAttribute("id")};e.tags=this.getTags(d);d=d.getElementsByTagName("nd");e.nodes=Array(d.length);for(var f=0;f<d.length;f++)e.nodes[f]=d[f].getAttribute("ref");b.push(e)}return b},getTags:function(a,b){for(var c=a.getElementsByTagName("tag"),d={},e=!1,f=0;f<c.length;f++){var g=c[f].getAttribute("k");d[g]=c[f].getAttribute("v");b&&(this.interestingTagsExclude[g]||(e=!0))}return b?[d,e]:d},isWayArea:function(a){var b=!1,c=!1;a.nodes[0]==a.nodes[a.nodes.length- +1]&&(b=!0);if(this.checkTags)for(var d in a.tags)if(this.areaTags[d]){c=!0;break}return b&&(this.checkTags?c:!0)},write:function(a){OpenLayers.Util.isArray(a)||(a=[a]);this.osm_id=1;this.created_nodes={};var b=this.createElementNS(null,"osm");b.setAttribute("version","0.5");b.setAttribute("generator","OpenLayers "+OpenLayers.VERSION_NUMBER);for(var c=a.length-1;0<=c;c--)for(var d=this.createFeatureNodes(a[c]),e=0;e<d.length;e++)b.appendChild(d[e]);return OpenLayers.Format.XML.prototype.write.apply(this, +[b])},createFeatureNodes:function(a){var b=[],c=a.geometry.CLASS_NAME,c=c.substring(c.lastIndexOf(".")+1),c=c.toLowerCase();(c=this.createXML[c])&&(b=c.apply(this,[a]));return b},createXML:{point:function(a){var b=null,c=a.geometry?a.geometry:a;this.internalProjection&&this.externalProjection&&(c=c.clone(),c.transform(this.internalProjection,this.externalProjection));var d=!1;a.osm_id?(b=a.osm_id,this.created_nodes[b]&&(d=!0)):(b=-this.osm_id,this.osm_id++);var e=d?this.created_nodes[b]:this.createElementNS(null, +"node");this.created_nodes[b]=e;e.setAttribute("id",b);e.setAttribute("lon",c.x);e.setAttribute("lat",c.y);a.attributes&&this.serializeTags(a,e);this.setState(a,e);return d?[]:[e]},linestring:function(a){var b,c=[],d=a.geometry;a.osm_id?b=a.osm_id:(b=-this.osm_id,this.osm_id++);var e=this.createElementNS(null,"way");e.setAttribute("id",b);for(b=0;b<d.components.length;b++){var f=this.createXML.point.apply(this,[d.components[b]]);if(f.length){var f=f[0],g=f.getAttribute("id");c.push(f)}else g=d.components[b].osm_id, +f=this.created_nodes[g];this.setState(a,f);f=this.createElementNS(null,"nd");f.setAttribute("ref",g);e.appendChild(f)}this.serializeTags(a,e);c.push(e);return c},polygon:function(a){var b=OpenLayers.Util.extend({area:"yes"},a.attributes),b=new OpenLayers.Feature.Vector(a.geometry.components[0],b);b.osm_id=a.osm_id;return this.createXML.linestring.apply(this,[b])}},serializeTags:function(a,b){for(var c in a.attributes){var d=this.createElementNS(null,"tag");d.setAttribute("k",c);d.setAttribute("v", +a.attributes[c]);b.appendChild(d)}},setState:function(a,b){if(a.state){var c=null;switch(a.state){case OpenLayers.State.UPDATE:case OpenLayers.State.DELETE:c="delete"}c&&b.setAttribute("action",c)}},CLASS_NAME:"OpenLayers.Format.OSM"});OpenLayers.Handler.Keyboard=OpenLayers.Class(OpenLayers.Handler,{KEY_EVENTS:["keydown","keyup"],eventListener:null,observeElement:null,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.eventListener=OpenLayers.Function.bindAsEventListener(this.handleKeyEvent,this)},destroy:function(){this.deactivate();this.eventListener=null;OpenLayers.Handler.prototype.destroy.apply(this,arguments)},activate:function(){if(OpenLayers.Handler.prototype.activate.apply(this, +arguments)){this.observeElement=this.observeElement||document;for(var a=0,b=this.KEY_EVENTS.length;a<b;a++)OpenLayers.Event.observe(this.observeElement,this.KEY_EVENTS[a],this.eventListener);return!0}return!1},deactivate:function(){var a=!1;if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){for(var a=0,b=this.KEY_EVENTS.length;a<b;a++)OpenLayers.Event.stopObserving(this.observeElement,this.KEY_EVENTS[a],this.eventListener);a=!0}return a},handleKeyEvent:function(a){this.checkModifiers(a)&& +this.callback(a.type,[a])},CLASS_NAME:"OpenLayers.Handler.Keyboard"});OpenLayers.Control.ModifyFeature=OpenLayers.Class(OpenLayers.Control,{documentDrag:!1,geometryTypes:null,clickout:!0,toggle:!0,standalone:!1,layer:null,feature:null,vertex:null,vertices:null,virtualVertices:null,handlers:null,deleteCodes:null,virtualStyle:null,vertexRenderIntent:null,mode:null,createVertices:!0,modified:!1,radiusHandle:null,dragHandle:null,onModificationStart:function(){},onModification:function(){},onModificationEnd:function(){},initialize:function(a,b){b=b||{};this.layer=a;this.vertices= +[];this.virtualVertices=[];this.virtualStyle=OpenLayers.Util.extend({},this.layer.style||this.layer.styleMap.createSymbolizer(null,b.vertexRenderIntent));this.virtualStyle.fillOpacity=0.3;this.virtualStyle.strokeOpacity=0.3;this.deleteCodes=[46,68];this.mode=OpenLayers.Control.ModifyFeature.RESHAPE;OpenLayers.Control.prototype.initialize.apply(this,[b]);OpenLayers.Util.isArray(this.deleteCodes)||(this.deleteCodes=[this.deleteCodes]);var c={documentDrag:this.documentDrag,stopDown:!1};this.handlers= +{keyboard:new OpenLayers.Handler.Keyboard(this,{keydown:this.handleKeypress}),drag:new OpenLayers.Handler.Drag(this,{down:function(a){this.vertex=null;(a=this.layer.getFeatureFromEvent(this.handlers.drag.evt))?this.dragStart(a):this.clickout&&(this._unselect=this.feature)},move:function(a){delete this._unselect;this.vertex&&this.dragVertex(this.vertex,a)},up:function(){this.handlers.drag.stopDown=!1;this._unselect&&(this.unselectFeature(this._unselect),delete this._unselect)},done:function(a){this.vertex&& +this.dragComplete(this.vertex)}},c)}},destroy:function(){this.map&&this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){this.moveLayerToTop();this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this});return this.handlers.keyboard.activate()&&this.handlers.drag.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)}, +deactivate:function(){var a=!1;OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.moveLayerBack(),this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),this.layer.removeFeatures(this.vertices,{silent:!0}),this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.vertices=[],this.handlers.drag.deactivate(),this.handlers.keyboard.deactivate(),(a=this.feature)&&(a.geometry&&a.layer)&&this.unselectFeature(a),a=!0);return a},beforeSelectFeature:function(a){return this.layer.events.triggerEvent("beforefeaturemodified", +{feature:a})},selectFeature:function(a){if(!(this.feature===a||this.geometryTypes&&-1==OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME))){!1!==this.beforeSelectFeature(a)&&(this.feature&&this.unselectFeature(this.feature),this.feature=a,this.layer.selectedFeatures.push(a),this.layer.drawFeature(a,"select"),this.modified=!1,this.resetVertices(),this.onModificationStart(this.feature));var b=a.modified;!a.geometry||b&&b.geometry||(this._originalGeometry=a.geometry.clone())}},unselectFeature:function(a){this.layer.removeFeatures(this.vertices, +{silent:!0});this.vertices=[];this.layer.destroyFeatures(this.virtualVertices,{silent:!0});this.virtualVertices=[];this.dragHandle&&(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),delete this.dragHandle);this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),delete this.radiusHandle);this.layer.drawFeature(this.feature,"default");this.feature=null;OpenLayers.Util.removeItem(this.layer.selectedFeatures,a);this.onModificationEnd(a);this.layer.events.triggerEvent("afterfeaturemodified", +{feature:a,modified:this.modified});this.modified=!1},dragStart:function(a){var b="OpenLayers.Geometry.Point"==a.geometry.CLASS_NAME;this.standalone||(a._sketch||!b)&&a._sketch||(this.toggle&&this.feature===a&&(this._unselect=a),this.selectFeature(a));if(a._sketch||b)this.vertex=a,this.handlers.drag.stopDown=!0},dragVertex:function(a,b){var c=this.map.getLonLatFromViewPortPx(b),d=a.geometry;d.move(c.lon-d.x,c.lat-d.y);this.modified=!0;"OpenLayers.Geometry.Point"==this.feature.geometry.CLASS_NAME? +this.layer.events.triggerEvent("vertexmodified",{vertex:a.geometry,feature:this.feature,pixel:b}):(a._index?(a.geometry.parent.addComponent(a.geometry,a._index),delete a._index,OpenLayers.Util.removeItem(this.virtualVertices,a),this.vertices.push(a)):a==this.dragHandle?(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[],this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null)):a!==this.radiusHandle&&this.layer.events.triggerEvent("vertexmodified", +{vertex:a.geometry,feature:this.feature,pixel:b}),0<this.virtualVertices.length&&(this.layer.destroyFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]),this.layer.drawFeature(this.feature,this.standalone?void 0:"select"));this.layer.drawFeature(a)},dragComplete:function(a){this.resetVertices();this.setFeatureState();this.onModification(this.feature);this.layer.events.triggerEvent("featuremodified",{feature:this.feature})},setFeatureState:function(){if(this.feature.state!=OpenLayers.State.INSERT&& +this.feature.state!=OpenLayers.State.DELETE&&(this.feature.state=OpenLayers.State.UPDATE,this.modified&&this._originalGeometry)){var a=this.feature;a.modified=OpenLayers.Util.extend(a.modified,{geometry:this._originalGeometry});delete this._originalGeometry}},resetVertices:function(){0<this.vertices.length&&(this.layer.removeFeatures(this.vertices,{silent:!0}),this.vertices=[]);0<this.virtualVertices.length&&(this.layer.removeFeatures(this.virtualVertices,{silent:!0}),this.virtualVertices=[]);this.dragHandle&& +(this.layer.destroyFeatures([this.dragHandle],{silent:!0}),this.dragHandle=null);this.radiusHandle&&(this.layer.destroyFeatures([this.radiusHandle],{silent:!0}),this.radiusHandle=null);this.feature&&"OpenLayers.Geometry.Point"!=this.feature.geometry.CLASS_NAME&&(this.mode&OpenLayers.Control.ModifyFeature.DRAG&&this.collectDragHandle(),this.mode&(OpenLayers.Control.ModifyFeature.ROTATE|OpenLayers.Control.ModifyFeature.RESIZE)&&this.collectRadiusHandle(),this.mode&OpenLayers.Control.ModifyFeature.RESHAPE&& +(this.mode&OpenLayers.Control.ModifyFeature.RESIZE||this.collectVertices()))},handleKeypress:function(a){var b=a.keyCode;this.feature&&-1!=OpenLayers.Util.indexOf(this.deleteCodes,b)&&(b=this.layer.getFeatureFromEvent(this.handlers.drag.evt))&&(-1!=OpenLayers.Util.indexOf(this.vertices,b)&&!this.handlers.drag.dragging&&b.geometry.parent)&&(b.geometry.parent.removeComponent(b.geometry),this.layer.events.triggerEvent("vertexremoved",{vertex:b.geometry,feature:this.feature,pixel:a.xy}),this.layer.drawFeature(this.feature, +this.standalone?void 0:"select"),this.modified=!0,this.resetVertices(),this.setFeatureState(),this.onModification(this.feature),this.layer.events.triggerEvent("featuremodified",{feature:this.feature}))},collectVertices:function(){function a(c){var d,e,f;if("OpenLayers.Geometry.Point"==c.CLASS_NAME)e=new OpenLayers.Feature.Vector(c),e._sketch=!0,e.renderIntent=b.vertexRenderIntent,b.vertices.push(e);else{f=c.components.length;"OpenLayers.Geometry.LinearRing"==c.CLASS_NAME&&(f-=1);for(d=0;d<f;++d)e= +c.components[d],"OpenLayers.Geometry.Point"==e.CLASS_NAME?(e=new OpenLayers.Feature.Vector(e),e._sketch=!0,e.renderIntent=b.vertexRenderIntent,b.vertices.push(e)):a(e);if(b.createVertices&&"OpenLayers.Geometry.MultiPoint"!=c.CLASS_NAME)for(d=0,f=c.components.length;d<f-1;++d){e=c.components[d];var g=c.components[d+1];"OpenLayers.Geometry.Point"==e.CLASS_NAME&&"OpenLayers.Geometry.Point"==g.CLASS_NAME&&(e=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point((e.x+g.x)/2,(e.y+g.y)/2),null,b.virtualStyle), +e.geometry.parent=c,e._index=d+1,e._sketch=!0,b.virtualVertices.push(e))}}}this.vertices=[];this.virtualVertices=[];var b=this;a.call(this,this.feature.geometry);this.layer.addFeatures(this.virtualVertices,{silent:!0});this.layer.addFeatures(this.vertices,{silent:!0})},collectDragHandle:function(){var a=this.feature.geometry,b=a.getBounds().getCenterLonLat(),b=new OpenLayers.Geometry.Point(b.lon,b.lat),c=new OpenLayers.Feature.Vector(b);b.move=function(b,c){OpenLayers.Geometry.Point.prototype.move.call(this, +b,c);a.move(b,c)};c._sketch=!0;this.dragHandle=c;this.dragHandle.renderIntent=this.vertexRenderIntent;this.layer.addFeatures([this.dragHandle],{silent:!0})},collectRadiusHandle:function(){var a=this.feature.geometry,b=a.getBounds(),c=b.getCenterLonLat(),d=new OpenLayers.Geometry.Point(c.lon,c.lat),b=new OpenLayers.Geometry.Point(b.right,b.bottom),c=new OpenLayers.Feature.Vector(b),e=this.mode&OpenLayers.Control.ModifyFeature.RESIZE,f=this.mode&OpenLayers.Control.ModifyFeature.RESHAPE,g=this.mode& +OpenLayers.Control.ModifyFeature.ROTATE;b.move=function(b,c){OpenLayers.Geometry.Point.prototype.move.call(this,b,c);var l=this.x-d.x,m=this.y-d.y,n=l-b,p=m-c;if(g){var q=Math.atan2(p,n),q=Math.atan2(m,l)-q,q=q*(180/Math.PI);a.rotate(q,d)}if(e){var r;f?(m/=p,r=l/n/m):(n=Math.sqrt(n*n+p*p),m=Math.sqrt(l*l+m*m)/n);a.resize(m,d,r)}};c._sketch=!0;this.radiusHandle=c;this.radiusHandle.renderIntent=this.vertexRenderIntent;this.layer.addFeatures([this.radiusHandle],{silent:!0})},setMap:function(a){this.handlers.drag.setMap(a); +OpenLayers.Control.prototype.setMap.apply(this,arguments)},handleMapEvents:function(a){"removelayer"!=a.type&&"order"!=a.property||this.moveLayerToTop()},moveLayerToTop:function(){var a=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(a)},moveLayerBack:function(){var a=this.layer.getZIndex()-1;a>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(a):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Control.ModifyFeature"}); +OpenLayers.Control.ModifyFeature.RESHAPE=1;OpenLayers.Control.ModifyFeature.RESIZE=2;OpenLayers.Control.ModifyFeature.ROTATE=4;OpenLayers.Control.ModifyFeature.DRAG=8;OpenLayers.Layer.Bing=OpenLayers.Class(OpenLayers.Layer.XYZ,{key:null,serverResolutions:[156543.03390625,78271.516953125,39135.7584765625,19567.87923828125,9783.939619140625,4891.9698095703125,2445.9849047851562,1222.9924523925781,611.4962261962891,305.74811309814453,152.87405654907226,76.43702827453613,38.218514137268066,19.109257068634033,9.554628534317017,4.777314267158508,2.388657133579254,1.194328566789627,0.5971642833948135,0.29858214169740677,0.14929107084870338,0.07464553542435169],attributionTemplate:'<span class="olBingAttribution ${type}"><div><a target="_blank" href="http://www.bing.com/maps/"><img src="${logo}" /></a></div>${copyrights}<a style="white-space: nowrap" target="_blank" href="http://www.microsoft.com/maps/product/terms.html">Terms of Use</a></span>', +metadata:null,protocolRegex:/^http:/i,type:"Road",culture:"en-US",metadataParams:null,tileOptions:null,protocol:~window.location.href.indexOf("http")?"":"http:",initialize:function(a){a=OpenLayers.Util.applyDefaults({sphericalMercator:!0},a);OpenLayers.Layer.XYZ.prototype.initialize.apply(this,[a.name||"Bing "+(a.type||this.type),null,a]);this.tileOptions=OpenLayers.Util.extend({crossOriginKeyword:"anonymous"},this.options.tileOptions);this.loadMetadata()},loadMetadata:function(){this._callbackId= +"_callback_"+this.id.replace(/\./g,"_");window[this._callbackId]=OpenLayers.Function.bind(OpenLayers.Layer.Bing.processMetadata,this);var a=OpenLayers.Util.applyDefaults({key:this.key,jsonp:this._callbackId,include:"ImageryProviders"},this.metadataParams),a=this.protocol+"//dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.type+"?"+OpenLayers.Util.getParameterString(a),b=document.createElement("script");b.type="text/javascript";b.src=a;b.id=this._callbackId;document.getElementsByTagName("head")[0].appendChild(b)}, +initLayer:function(){var a=this.metadata.resourceSets[0].resources[0],b=a.imageUrl.replace("{quadkey}","${quadkey}"),b=b.replace("{culture}",this.culture),b=b.replace(this.protocolRegex,this.protocol);this.url=[];for(var c=0;c<a.imageUrlSubdomains.length;++c)this.url.push(b.replace("{subdomain}",a.imageUrlSubdomains[c]));this.addOptions({maxResolution:Math.min(this.serverResolutions[a.zoomMin],this.maxResolution||Number.POSITIVE_INFINITY),numZoomLevels:Math.min(a.zoomMax+1-a.zoomMin,this.numZoomLevels)}, +!0);this.isBaseLayer||this.redraw();this.updateAttribution()},getURL:function(a){if(this.url){var b=this.getXYZ(a);a=b.x;for(var c=b.y,b=b.z,d=[],e=b;0<e;--e){var f="0",g=1<<e-1;0!=(a&g)&&f++;0!=(c&g)&&(f++,f++);d.push(f)}d=d.join("");a=this.selectUrl(""+a+c+b,this.url);return OpenLayers.String.format(a,{quadkey:d})}},updateAttribution:function(){var a=this.metadata;if(a.resourceSets&&this.map&&this.map.center){var b=a.resourceSets[0].resources[0],c=this.map.getExtent().transform(this.map.getProjectionObject(), +new OpenLayers.Projection("EPSG:4326")),d=b.imageryProviders||[],e=OpenLayers.Util.indexOf(this.serverResolutions,this.getServerResolution()),b="",f,g,h,k,l,m,n;g=0;for(h=d.length;g<h;++g)for(f=d[g],k=0,l=f.coverageAreas.length;k<l;++k)n=f.coverageAreas[k],m=OpenLayers.Bounds.fromArray(n.bbox,!0),c.intersectsBounds(m)&&(e<=n.zoomMax&&e>=n.zoomMin)&&(b+=f.attribution+" ");a=a.brandLogoUri.replace(this.protocolRegex,this.protocol);this.attribution=OpenLayers.String.format(this.attributionTemplate,{type:this.type.toLowerCase(), +logo:a,copyrights:b});this.map&&this.map.events.triggerEvent("changelayer",{layer:this,property:"attribution"})}},setMap:function(){OpenLayers.Layer.XYZ.prototype.setMap.apply(this,arguments);this.map.events.register("moveend",this,this.updateAttribution)},clone:function(a){null==a&&(a=new OpenLayers.Layer.Bing(this.options));return a=OpenLayers.Layer.XYZ.prototype.clone.apply(this,[a])},destroy:function(){this.map&&this.map.events.unregister("moveend",this,this.updateAttribution);OpenLayers.Layer.XYZ.prototype.destroy.apply(this, +arguments)},CLASS_NAME:"OpenLayers.Layer.Bing"});OpenLayers.Layer.Bing.processMetadata=function(a){this.metadata=a;this.initLayer();a=document.getElementById(this._callbackId);a.parentNode.removeChild(a);window[this._callbackId]=void 0;delete this._callbackId};OpenLayers.StyleMap=OpenLayers.Class({styles:null,extendDefault:!0,initialize:function(a,b){this.styles={"default":new OpenLayers.Style(OpenLayers.Feature.Vector.style["default"]),select:new OpenLayers.Style(OpenLayers.Feature.Vector.style.select),temporary:new OpenLayers.Style(OpenLayers.Feature.Vector.style.temporary),"delete":new OpenLayers.Style(OpenLayers.Feature.Vector.style["delete"])};if(a instanceof OpenLayers.Style)this.styles["default"]=a,this.styles.select=a,this.styles.temporary=a,this.styles["delete"]= +a;else if("object"==typeof a)for(var c in a)if(a[c]instanceof OpenLayers.Style)this.styles[c]=a[c];else if("object"==typeof a[c])this.styles[c]=new OpenLayers.Style(a[c]);else{this.styles["default"]=new OpenLayers.Style(a);this.styles.select=new OpenLayers.Style(a);this.styles.temporary=new OpenLayers.Style(a);this.styles["delete"]=new OpenLayers.Style(a);break}OpenLayers.Util.extend(this,b)},destroy:function(){for(var a in this.styles)this.styles[a].destroy();this.styles=null},createSymbolizer:function(a, +b){a||(a=new OpenLayers.Feature.Vector);this.styles[b]||(b="default");a.renderIntent=b;var c={};this.extendDefault&&"default"!=b&&(c=this.styles["default"].createSymbolizer(a));return OpenLayers.Util.extend(c,this.styles[b].createSymbolizer(a))},addUniqueValueRules:function(a,b,c,d){var e=[],f;for(f in c)e.push(new OpenLayers.Rule({symbolizer:c[f],context:d,filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO,property:b,value:f})}));this.styles[a].addRules(e)},CLASS_NAME:"OpenLayers.StyleMap"});OpenLayers.Layer.Vector=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,isFixed:!1,features:null,filter:null,selectedFeatures:null,unrenderedFeatures:null,reportError:!0,style:null,styleMap:null,strategies:null,protocol:null,renderers:["SVG","VML","Canvas"],renderer:null,rendererOptions:null,geometryType:null,drawn:!1,ratio:1,initialize:function(a,b){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.renderer&&this.renderer.supported()||this.assignRenderer();this.renderer&&this.renderer.supported()|| +(this.renderer=null,this.displayError());this.styleMap||(this.styleMap=new OpenLayers.StyleMap);this.features=[];this.selectedFeatures=[];this.unrenderedFeatures={};if(this.strategies)for(var c=0,d=this.strategies.length;c<d;c++)this.strategies[c].setLayer(this)},destroy:function(){if(this.strategies){var a,b,c;b=0;for(c=this.strategies.length;b<c;b++)a=this.strategies[b],a.autoDestroy&&a.destroy();this.strategies=null}this.protocol&&(this.protocol.autoDestroy&&this.protocol.destroy(),this.protocol= +null);this.destroyFeatures();this.unrenderedFeatures=this.selectedFeatures=this.features=null;this.renderer&&this.renderer.destroy();this.drawn=this.geometryType=this.renderer=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},clone:function(a){null==a&&(a=new OpenLayers.Layer.Vector(this.name,this.getOptions()));a=OpenLayers.Layer.prototype.clone.apply(this,[a]);for(var b=this.features,c=b.length,d=Array(c),e=0;e<c;++e)d[e]=b[e].clone();a.features=d;return a},refresh:function(a){this.calculateInRange()&& +this.visibility&&this.events.triggerEvent("refresh",a)},assignRenderer:function(){for(var a=0,b=this.renderers.length;a<b;a++){var c=this.renderers[a];if((c="function"==typeof c?c:OpenLayers.Renderer[c])&&c.prototype.supported()){this.renderer=new c(this.div,this.rendererOptions);break}}},displayError:function(){this.reportError&&OpenLayers.Console.userError(OpenLayers.i18n("browserNotSupported",{renderers:this.renderers.join("\n")}))},setMap:function(a){OpenLayers.Layer.prototype.setMap.apply(this, +arguments);if(this.renderer){this.renderer.map=this.map;var b=this.map.getSize();b.w*=this.ratio;b.h*=this.ratio;this.renderer.setSize(b)}else this.map.removeLayer(this)},afterAdd:function(){if(this.strategies){var a,b,c;b=0;for(c=this.strategies.length;b<c;b++)a=this.strategies[b],a.autoActivate&&a.activate()}},removeMap:function(a){this.drawn=!1;if(this.strategies){var b,c;b=0;for(c=this.strategies.length;b<c;b++)a=this.strategies[b],a.autoActivate&&a.deactivate()}},onMapResize:function(){OpenLayers.Layer.prototype.onMapResize.apply(this, +arguments);var a=this.map.getSize();a.w*=this.ratio;a.h*=this.ratio;this.renderer.setSize(a)},moveTo:function(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this,arguments);var d=!0;if(!c){this.renderer.root.style.visibility="hidden";var d=this.map.getSize(),e=d.w,d=d.h,e=e/2*this.ratio-e/2,d=d/2*this.ratio-d/2,e=e+this.map.layerContainerOriginPx.x,e=-Math.round(e),d=d+this.map.layerContainerOriginPx.y,d=-Math.round(d);this.div.style.left=e+"px";this.div.style.top=d+"px";e=this.map.getExtent().scale(this.ratio); +d=this.renderer.setExtent(e,b);this.renderer.root.style.visibility="visible";!0===OpenLayers.IS_GECKO&&(this.div.scrollLeft=this.div.scrollLeft);if(!b&&d)for(var f in this.unrenderedFeatures)e=this.unrenderedFeatures[f],this.drawFeature(e)}if(!this.drawn||b||!d)for(this.drawn=!0,f=0,d=this.features.length;f<d;f++)this.renderer.locked=f!==d-1,e=this.features[f],this.drawFeature(e)},display:function(a){OpenLayers.Layer.prototype.display.apply(this,arguments);var b=this.div.style.display;b!=this.renderer.root.style.display&& +(this.renderer.root.style.display=b)},addFeatures:function(a,b){OpenLayers.Util.isArray(a)||(a=[a]);var c=!b||!b.silent;if(c){var d={features:a};if(!1===this.events.triggerEvent("beforefeaturesadded",d))return;a=d.features}for(var d=[],e=0,f=a.length;e<f;e++){this.renderer.locked=e!=a.length-1?!0:!1;var g=a[e];if(this.geometryType&&!(g.geometry instanceof this.geometryType))throw new TypeError("addFeatures: component should be an "+this.geometryType.prototype.CLASS_NAME);g.layer=this;!g.style&&this.style&& +(g.style=OpenLayers.Util.extend({},this.style));if(c){if(!1===this.events.triggerEvent("beforefeatureadded",{feature:g}))continue;this.preFeatureInsert(g)}d.push(g);this.features.push(g);this.drawFeature(g);c&&(this.events.triggerEvent("featureadded",{feature:g}),this.onFeatureInsert(g))}c&&this.events.triggerEvent("featuresadded",{features:d})},removeFeatures:function(a,b){if(a&&0!==a.length){if(a===this.features)return this.removeAllFeatures(b);OpenLayers.Util.isArray(a)||(a=[a]);a===this.selectedFeatures&& +(a=a.slice());var c=!b||!b.silent;c&&this.events.triggerEvent("beforefeaturesremoved",{features:a});for(var d=a.length-1;0<=d;d--){this.renderer.locked=0!=d&&a[d-1].geometry?!0:!1;var e=a[d];delete this.unrenderedFeatures[e.id];c&&this.events.triggerEvent("beforefeatureremoved",{feature:e});this.features=OpenLayers.Util.removeItem(this.features,e);e.layer=null;e.geometry&&this.renderer.eraseFeatures(e);-1!=OpenLayers.Util.indexOf(this.selectedFeatures,e)&&OpenLayers.Util.removeItem(this.selectedFeatures, +e);c&&this.events.triggerEvent("featureremoved",{feature:e})}c&&this.events.triggerEvent("featuresremoved",{features:a})}},removeAllFeatures:function(a){a=!a||!a.silent;var b=this.features;a&&this.events.triggerEvent("beforefeaturesremoved",{features:b});for(var c,d=b.length-1;0<=d;d--)c=b[d],a&&this.events.triggerEvent("beforefeatureremoved",{feature:c}),c.layer=null,a&&this.events.triggerEvent("featureremoved",{feature:c});this.renderer.clear();this.features=[];this.unrenderedFeatures={};this.selectedFeatures= +[];a&&this.events.triggerEvent("featuresremoved",{features:b})},destroyFeatures:function(a,b){void 0==a&&(a=this.features);if(a){this.removeFeatures(a,b);for(var c=a.length-1;0<=c;c--)a[c].destroy()}},drawFeature:function(a,b){if(this.drawn){if("object"!=typeof b){b||a.state!==OpenLayers.State.DELETE||(b="delete");var c=b||a.renderIntent;(b=a.style||this.style)||(b=this.styleMap.createSymbolizer(a,c))}c=this.renderer.drawFeature(a,b);!1===c||null===c?this.unrenderedFeatures[a.id]=a:delete this.unrenderedFeatures[a.id]}}, +eraseFeatures:function(a){this.renderer.eraseFeatures(a)},getFeatureFromEvent:function(a){if(!this.renderer)throw Error("getFeatureFromEvent called on layer with no renderer. This usually means you destroyed a layer, but not some handler which is associated with it.");var b=null;(a=this.renderer.getFeatureIdFromEvent(a))&&(b="string"===typeof a?this.getFeatureById(a):a);return b},getFeatureBy:function(a,b){for(var c=null,d=0,e=this.features.length;d<e;++d)if(this.features[d][a]==b){c=this.features[d]; +break}return c},getFeatureById:function(a){return this.getFeatureBy("id",a)},getFeatureByFid:function(a){return this.getFeatureBy("fid",a)},getFeaturesByAttribute:function(a,b){var c,d,e=this.features.length,f=[];for(c=0;c<e;c++)(d=this.features[c])&&d.attributes&&d.attributes[a]===b&&f.push(d);return f},onFeatureInsert:function(a){},preFeatureInsert:function(a){},getDataExtent:function(){var a=null,b=this.features;if(b&&0<b.length)for(var c=null,d=0,e=b.length;d<e;d++)if(c=b[d].geometry)null===a&& +(a=new OpenLayers.Bounds),a.extend(c.getBounds());return a},CLASS_NAME:"OpenLayers.Layer.Vector"});OpenLayers.Layer.PointGrid=OpenLayers.Class(OpenLayers.Layer.Vector,{dx:null,dy:null,ratio:1.5,maxFeatures:250,rotation:0,origin:null,gridBounds:null,initialize:function(a){a=a||{};OpenLayers.Layer.Vector.prototype.initialize.apply(this,[a.name,a])},setMap:function(a){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);a.events.register("moveend",this,this.onMoveEnd)},removeMap:function(a){a.events.unregister("moveend",this,this.onMoveEnd);OpenLayers.Layer.Vector.prototype.removeMap.apply(this, +arguments)},setRatio:function(a){this.ratio=a;this.updateGrid(!0)},setMaxFeatures:function(a){this.maxFeatures=a;this.updateGrid(!0)},setSpacing:function(a,b){this.dx=a;this.dy=b||a;this.updateGrid(!0)},setOrigin:function(a){this.origin=a;this.updateGrid(!0)},getOrigin:function(){this.origin||(this.origin=this.map.getExtent().getCenterLonLat());return this.origin},setRotation:function(a){this.rotation=a;this.updateGrid(!0)},onMoveEnd:function(){this.updateGrid()},getViewBounds:function(){var a=this.map.getExtent(); +if(this.rotation){var b=this.getOrigin(),b=new OpenLayers.Geometry.Point(b.lon,b.lat),a=a.toGeometry();a.rotate(-this.rotation,b);a=a.getBounds()}return a},updateGrid:function(a){if(a||this.invalidBounds()){var b=this.getViewBounds(),c=this.getOrigin();a=new OpenLayers.Geometry.Point(c.lon,c.lat);var d=b.getWidth(),e=b.getHeight(),f=d/e,g=Math.sqrt(this.dx*this.dy*this.maxFeatures/f),d=Math.min(d*this.ratio,g*f),e=Math.min(e*this.ratio,g),b=b.getCenterLonLat();this.gridBounds=new OpenLayers.Bounds(b.lon- +d/2,b.lat-e/2,b.lon+d/2,b.lat+e/2);for(var b=Math.floor(e/this.dy),d=Math.floor(d/this.dx),e=c.lon+this.dx*Math.ceil((this.gridBounds.left-c.lon)/this.dx),c=c.lat+this.dy*Math.ceil((this.gridBounds.bottom-c.lat)/this.dy),g=Array(b*d),h,k=0;k<d;++k)for(var f=e+k*this.dx,l=0;l<b;++l)h=c+l*this.dy,h=new OpenLayers.Geometry.Point(f,h),this.rotation&&h.rotate(this.rotation,a),g[k*b+l]=new OpenLayers.Feature.Vector(h);this.destroyFeatures(this.features,{silent:!0});this.addFeatures(g,{silent:!0})}},invalidBounds:function(){return!this.gridBounds|| +!this.gridBounds.containsBounds(this.getViewBounds())},CLASS_NAME:"OpenLayers.Layer.PointGrid"});OpenLayers.Handler.MouseWheel=OpenLayers.Class(OpenLayers.Handler,{wheelListener:null,interval:0,maxDelta:Number.POSITIVE_INFINITY,delta:0,cumulative:!0,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.wheelListener=OpenLayers.Function.bindAsEventListener(this.onWheelEvent,this)},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.wheelListener=null},onWheelEvent:function(a){if(this.map&&this.checkModifiers(a)){for(var b= +!1,c=!1,d=!1,e=OpenLayers.Event.element(a);null!=e&&!d&&!b;){if(!b)try{var f,b=(f=e.currentStyle?e.currentStyle.overflow:document.defaultView.getComputedStyle(e,null).getPropertyValue("overflow"))&&"auto"==f||"scroll"==f}catch(g){}if(!c&&(c=OpenLayers.Element.hasClass(e,"olScrollable"),!c))for(var d=0,h=this.map.layers.length;d<h;d++){var k=this.map.layers[d];if(e==k.div||e==k.pane){c=!0;break}}d=e==this.map.div;e=e.parentNode}if(!b&&d){if(c)if(b=0,a.wheelDelta?(b=a.wheelDelta,0===b%160&&(b*=0.75), +b/=120):a.detail&&(b=-(a.detail/Math.abs(a.detail))),this.delta+=b,window.clearTimeout(this._timeoutId),this.interval&&Math.abs(this.delta)<this.maxDelta){var l=OpenLayers.Util.extend({},a);this._timeoutId=window.setTimeout(OpenLayers.Function.bind(function(){this.wheelZoom(l)},this),this.interval)}else this.wheelZoom(a);OpenLayers.Event.stop(a)}}},wheelZoom:function(a){var b=this.delta;this.delta=0;b&&(a.xy=this.map.events.getMousePosition(a),0>b?this.callback("down",[a,this.cumulative?Math.max(-this.maxDelta, +b):-1]):this.callback("up",[a,this.cumulative?Math.min(this.maxDelta,b):1]))},activate:function(a){if(OpenLayers.Handler.prototype.activate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.observe(window,"DOMMouseScroll",b);OpenLayers.Event.observe(window,"mousewheel",b);OpenLayers.Event.observe(document,"mousewheel",b);return!0}return!1},deactivate:function(a){if(OpenLayers.Handler.prototype.deactivate.apply(this,arguments)){var b=this.wheelListener;OpenLayers.Event.stopObserving(window, +"DOMMouseScroll",b);OpenLayers.Event.stopObserving(window,"mousewheel",b);OpenLayers.Event.stopObserving(document,"mousewheel",b);return!0}return!1},CLASS_NAME:"OpenLayers.Handler.MouseWheel"});OpenLayers.Symbolizer=OpenLayers.Class({zIndex:0,initialize:function(a){OpenLayers.Util.extend(this,a)},clone:function(){return new (eval(this.CLASS_NAME))(OpenLayers.Util.extend({},this))},CLASS_NAME:"OpenLayers.Symbolizer"});OpenLayers.Symbolizer.Raster=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(a){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Raster"});OpenLayers.Rule=OpenLayers.Class({id:null,name:null,title:null,description:null,context:null,filter:null,elseFilter:!1,symbolizer:null,symbolizers:null,minScaleDenominator:null,maxScaleDenominator:null,initialize:function(a){this.symbolizer={};OpenLayers.Util.extend(this,a);this.symbolizers&&delete this.symbolizer;this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a in this.symbolizer)this.symbolizer[a]=null;this.symbolizer=null;delete this.symbolizers},evaluate:function(a){var b= +this.getContext(a),c=!0;if(this.minScaleDenominator||this.maxScaleDenominator)var d=a.layer.map.getScale();this.minScaleDenominator&&(c=d>=OpenLayers.Style.createLiteral(this.minScaleDenominator,b));c&&this.maxScaleDenominator&&(c=d<OpenLayers.Style.createLiteral(this.maxScaleDenominator,b));c&&this.filter&&(c="OpenLayers.Filter.FeatureId"==this.filter.CLASS_NAME?this.filter.evaluate(a):this.filter.evaluate(b));return c},getContext:function(a){var b=this.context;b||(b=a.attributes||a.data);"function"== +typeof this.context&&(b=this.context(a));return b},clone:function(){var a=OpenLayers.Util.extend({},this);if(this.symbolizers){var b=this.symbolizers.length;a.symbolizers=Array(b);for(var c=0;c<b;++c)a.symbolizers[c]=this.symbolizers[c].clone()}else{a.symbolizer={};for(var d in this.symbolizer)b=this.symbolizer[d],c=typeof b,"object"===c?a.symbolizer[d]=OpenLayers.Util.extend({},b):"string"===c&&(a.symbolizer[d]=b)}a.filter=this.filter&&this.filter.clone();a.context=this.context&&OpenLayers.Util.extend({}, +this.context);return new OpenLayers.Rule(a)},CLASS_NAME:"OpenLayers.Rule"});OpenLayers.Format.SLD=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{profile:null,defaultVersion:"1.0.0",stringifyOutput:!0,namedLayersAsArray:!1,CLASS_NAME:"OpenLayers.Format.SLD"});OpenLayers.Symbolizer.Polygon=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(a){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Polygon"});OpenLayers.Format.GML.v2=OpenLayers.Class(OpenLayers.Format.GML.Base,{schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd",initialize:function(a){OpenLayers.Format.GML.Base.prototype.initialize.apply(this,[a])},readers:{gml:OpenLayers.Util.applyDefaults({outerBoundaryIs:function(a,b){var c={};this.readChildNodes(a,c);b.outer=c.components[0]},innerBoundaryIs:function(a,b){var c={};this.readChildNodes(a,c);b.inner.push(c.components[0])},Box:function(a,b){var c= +{};this.readChildNodes(a,c);b.components||(b.components=[]);var d=c.points[0],c=c.points[1];b.components.push(new OpenLayers.Bounds(d.x,d.y,c.x,c.y))}},OpenLayers.Format.GML.Base.prototype.readers.gml),feature:OpenLayers.Format.GML.Base.prototype.readers.feature,wfs:OpenLayers.Format.GML.Base.prototype.readers.wfs},write:function(a){var b;b=OpenLayers.Util.isArray(a)?"wfs:FeatureCollection":"gml:featureMember";a=this.writeNode(b,a);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation); +return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{gml:OpenLayers.Util.applyDefaults({Point:function(a){var b=this.createElementNSPlus("gml:Point");this.writeNode("coordinates",[a],b);return b},coordinates:function(a){for(var b=a.length,c=Array(b),d,e=0;e<b;++e)d=a[e],c[e]=this.xy?d.x+","+d.y:d.y+","+d.x,void 0!=d.z&&(c[e]+=","+d.z);return this.createElementNSPlus("gml:coordinates",{attributes:{decimal:".",cs:",",ts:" "},value:1==b?c[0]:c.join(" ")})},LineString:function(a){var b= +this.createElementNSPlus("gml:LineString");this.writeNode("coordinates",a.components,b);return b},Polygon:function(a){var b=this.createElementNSPlus("gml:Polygon");this.writeNode("outerBoundaryIs",a.components[0],b);for(var c=1;c<a.components.length;++c)this.writeNode("innerBoundaryIs",a.components[c],b);return b},outerBoundaryIs:function(a){var b=this.createElementNSPlus("gml:outerBoundaryIs");this.writeNode("LinearRing",a,b);return b},innerBoundaryIs:function(a){var b=this.createElementNSPlus("gml:innerBoundaryIs"); +this.writeNode("LinearRing",a,b);return b},LinearRing:function(a){var b=this.createElementNSPlus("gml:LinearRing");this.writeNode("coordinates",a.components,b);return b},Box:function(a){var b=this.createElementNSPlus("gml:Box");this.writeNode("coordinates",[{x:a.left,y:a.bottom},{x:a.right,y:a.top}],b);this.srsName&&b.setAttribute("srsName",this.srsName);return b}},OpenLayers.Format.GML.Base.prototype.writers.gml),feature:OpenLayers.Format.GML.Base.prototype.writers.feature,wfs:OpenLayers.Format.GML.Base.prototype.writers.wfs}, +CLASS_NAME:"OpenLayers.Format.GML.v2"});OpenLayers.Format.Filter.v1_0_0=OpenLayers.Class(OpenLayers.Format.GML.v2,OpenLayers.Format.Filter.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/ogc/filter/1.0.0/filter.xsd",initialize:function(a){OpenLayers.Format.GML.v2.prototype.initialize.apply(this,[a])},readers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.EQUAL_TO});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsNotEqualTo:function(a, +b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.NOT_EQUAL_TO});this.readChildNodes(a,c);b.filters.push(c)},PropertyIsLike:function(a,b){var c=new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LIKE});this.readChildNodes(a,c);var d=a.getAttribute("wildCard"),e=a.getAttribute("singleChar"),f=a.getAttribute("escape");c.value2regex(d,e,f);b.filters.push(c)}},OpenLayers.Format.Filter.v1.prototype.readers.ogc),gml:OpenLayers.Format.GML.v2.prototype.readers.gml, +feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{ogc:OpenLayers.Util.applyDefaults({PropertyIsEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsEqualTo");this.writeNode("PropertyName",a,b);this.writeOgcExpression(a.value,b);return b},PropertyIsNotEqualTo:function(a){var b=this.createElementNSPlus("ogc:PropertyIsNotEqualTo");this.writeNode("PropertyName",a,b);this.writeOgcExpression(a.value,b);return b},PropertyIsLike:function(a){var b=this.createElementNSPlus("ogc:PropertyIsLike", +{attributes:{wildCard:"*",singleChar:".",escape:"!"}});this.writeNode("PropertyName",a,b);this.writeNode("Literal",a.regex2value(),b);return b},BBOX:function(a){var b=this.createElementNSPlus("ogc:BBOX");a.property&&this.writeNode("PropertyName",a,b);var c=this.writeNode("gml:Box",a.value,b);a.projection&&c.setAttribute("srsName",a.projection);return b}},OpenLayers.Format.Filter.v1.prototype.writers.ogc),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature}, +writeSpatial:function(a,b){var c=this.createElementNSPlus("ogc:"+b);this.writeNode("PropertyName",a,c);if(a.value instanceof OpenLayers.Filter.Function)this.writeNode("Function",a.value,c);else{var d;d=a.value instanceof OpenLayers.Geometry?this.writeNode("feature:_geometry",a.value).firstChild:this.writeNode("gml:Box",a.value);a.projection&&d.setAttribute("srsName",a.projection);c.appendChild(d)}return c},CLASS_NAME:"OpenLayers.Format.Filter.v1_0_0"});OpenLayers.Format.WFST.v1_0_0=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,OpenLayers.Format.WFST.v1,{version:"1.0.0",srsNameInQuery:!1,schemaLocations:{wfs:"http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd"},initialize:function(a){OpenLayers.Format.Filter.v1_0_0.prototype.initialize.apply(this,[a]);OpenLayers.Format.WFST.v1.prototype.initialize.apply(this,[a])},readNode:function(a,b,c){return OpenLayers.Format.GML.v2.prototype.readNode.apply(this,arguments)},readers:{wfs:OpenLayers.Util.applyDefaults({WFS_TransactionResponse:function(a, +b){b.insertIds=[];b.success=!1;this.readChildNodes(a,b)},InsertResult:function(a,b){var c={fids:[]};this.readChildNodes(a,c);b.insertIds=b.insertIds.concat(c.fids)},TransactionResult:function(a,b){this.readChildNodes(a,b)},Status:function(a,b){this.readChildNodes(a,b)},SUCCESS:function(a,b){b.success=!0}},OpenLayers.Format.WFST.v1.prototype.readers.wfs),gml:OpenLayers.Format.GML.v2.prototype.readers.gml,feature:OpenLayers.Format.GML.v2.prototype.readers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.readers.ogc}, +writers:{wfs:OpenLayers.Util.applyDefaults({Query:function(a){a=OpenLayers.Util.extend({featureNS:this.featureNS,featurePrefix:this.featurePrefix,featureType:this.featureType,srsName:this.srsName,srsNameInQuery:this.srsNameInQuery},a);var b=a.featurePrefix,c=this.createElementNSPlus("wfs:Query",{attributes:{typeName:(b?b+":":"")+a.featureType}});a.srsNameInQuery&&a.srsName&&c.setAttribute("srsName",a.srsName);a.featureNS&&c.setAttribute("xmlns:"+b,a.featureNS);if(a.propertyNames)for(var b=0,d=a.propertyNames.length;b< +d;b++)this.writeNode("ogc:PropertyName",{property:a.propertyNames[b]},c);a.filter&&(this.setFilterProperty(a.filter),this.writeNode("ogc:Filter",a.filter,c));return c}},OpenLayers.Format.WFST.v1.prototype.writers.wfs),gml:OpenLayers.Format.GML.v2.prototype.writers.gml,feature:OpenLayers.Format.GML.v2.prototype.writers.feature,ogc:OpenLayers.Format.Filter.v1_0_0.prototype.writers.ogc},CLASS_NAME:"OpenLayers.Format.WFST.v1_0_0"});OpenLayers.ElementsIndexer=OpenLayers.Class({maxZIndex:null,order:null,indices:null,compare:null,initialize:function(a){this.compare=a?OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_Y_ORDER:OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER_DRAWING_ORDER;this.clear()},insert:function(a){this.exists(a)&&this.remove(a);var b=a.id;this.determineZIndex(a);for(var c=-1,d=this.order.length,e;1<d-c;)e=parseInt((c+d)/2),0<this.compare(this,a,OpenLayers.Util.getElement(this.order[e]))?c=e:d=e;this.order.splice(d, +0,b);this.indices[b]=this.getZIndex(a);return this.getNextElement(d)},remove:function(a){a=a.id;var b=OpenLayers.Util.indexOf(this.order,a);0<=b&&(this.order.splice(b,1),delete this.indices[a],this.maxZIndex=0<this.order.length?this.indices[this.order[this.order.length-1]]:0)},clear:function(){this.order=[];this.indices={};this.maxZIndex=0},exists:function(a){return null!=this.indices[a.id]},getZIndex:function(a){return a._style.graphicZIndex},determineZIndex:function(a){var b=a._style.graphicZIndex; +null==b?(b=this.maxZIndex,a._style.graphicZIndex=b):b>this.maxZIndex&&(this.maxZIndex=b)},getNextElement:function(a){a+=1;if(a<this.order.length){var b=OpenLayers.Util.getElement(this.order[a]);void 0==b&&(b=this.getNextElement(a));return b}return null},CLASS_NAME:"OpenLayers.ElementsIndexer"}); +OpenLayers.ElementsIndexer.IndexingMethods={Z_ORDER:function(a,b,c){b=a.getZIndex(b);var d=0;c&&(a=a.getZIndex(c),d=b-a);return d},Z_ORDER_DRAWING_ORDER:function(a,b,c){a=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,b,c);c&&0==a&&(a=1);return a},Z_ORDER_Y_ORDER:function(a,b,c){a=OpenLayers.ElementsIndexer.IndexingMethods.Z_ORDER(a,b,c);c&&0===a&&(b=c._boundsBottom-b._boundsBottom,a=0===b?1:b);return a}}; +OpenLayers.Renderer.Elements=OpenLayers.Class(OpenLayers.Renderer,{rendererRoot:null,root:null,vectorRoot:null,textRoot:null,xmlns:null,xOffset:0,indexer:null,BACKGROUND_ID_SUFFIX:"_background",LABEL_ID_SUFFIX:"_label",LABEL_OUTLINE_SUFFIX:"_outline",initialize:function(a,b){OpenLayers.Renderer.prototype.initialize.apply(this,arguments);this.rendererRoot=this.createRenderRoot();this.root=this.createRoot("_root");this.vectorRoot=this.createRoot("_vroot");this.textRoot=this.createRoot("_troot");this.root.appendChild(this.vectorRoot); +this.root.appendChild(this.textRoot);this.rendererRoot.appendChild(this.root);this.container.appendChild(this.rendererRoot);b&&(b.zIndexing||b.yOrdering)&&(this.indexer=new OpenLayers.ElementsIndexer(b.yOrdering))},destroy:function(){this.clear();this.xmlns=this.root=this.rendererRoot=null;OpenLayers.Renderer.prototype.destroy.apply(this,arguments)},clear:function(){var a,b=this.vectorRoot;if(b)for(;a=b.firstChild;)b.removeChild(a);if(b=this.textRoot)for(;a=b.firstChild;)b.removeChild(a);this.indexer&& +this.indexer.clear()},setExtent:function(a,b){var c=OpenLayers.Renderer.prototype.setExtent.apply(this,arguments),d=this.getResolution();if(this.map.baseLayer&&this.map.baseLayer.wrapDateLine){var e,f=a.getWidth()/this.map.getExtent().getWidth();a=a.scale(1/f);f=this.map.getMaxExtent();f.right>a.left&&f.right<a.right?e=!0:f.left>a.left&&f.left<a.right&&(e=!1);if(e!==this.rightOfDateLine||b)c=!1,this.xOffset=!0===e?f.getWidth()/d:0;this.rightOfDateLine=e}return c},getNodeType:function(a,b){},drawGeometry:function(a, +b,c){var d=a.CLASS_NAME,e=!0;if("OpenLayers.Geometry.Collection"==d||"OpenLayers.Geometry.MultiPoint"==d||"OpenLayers.Geometry.MultiLineString"==d||"OpenLayers.Geometry.MultiPolygon"==d){for(var d=0,f=a.components.length;d<f;d++)e=this.drawGeometry(a.components[d],b,c)&&e;return e}d=e=!1;"none"!=b.display&&(b.backgroundGraphic?this.redrawBackgroundNode(a.id,a,b,c):d=!0,e=this.redrawNode(a.id,a,b,c));!1==e&&(b=document.getElementById(a.id))&&(b._style.backgroundGraphic&&(d=!0),b.parentNode.removeChild(b)); +d&&(b=document.getElementById(a.id+this.BACKGROUND_ID_SUFFIX))&&b.parentNode.removeChild(b);return e},redrawNode:function(a,b,c,d){c=this.applyDefaultSymbolizer(c);a=this.nodeFactory(a,this.getNodeType(b,c));a._featureId=d;a._boundsBottom=b.getBounds().bottom;a._geometryClass=b.CLASS_NAME;a._style=c;b=this.drawGeometryNode(a,b,c);if(!1===b)return!1;a=b.node;this.indexer?(c=this.indexer.insert(a))?this.vectorRoot.insertBefore(a,c):this.vectorRoot.appendChild(a):a.parentNode!==this.vectorRoot&&this.vectorRoot.appendChild(a); +this.postDraw(a);return b.complete},redrawBackgroundNode:function(a,b,c,d){c=OpenLayers.Util.extend({},c);c.externalGraphic=c.backgroundGraphic;c.graphicXOffset=c.backgroundXOffset;c.graphicYOffset=c.backgroundYOffset;c.graphicZIndex=c.backgroundGraphicZIndex;c.graphicWidth=c.backgroundWidth||c.graphicWidth;c.graphicHeight=c.backgroundHeight||c.graphicHeight;c.backgroundGraphic=null;c.backgroundXOffset=null;c.backgroundYOffset=null;c.backgroundGraphicZIndex=null;return this.redrawNode(a+this.BACKGROUND_ID_SUFFIX, +b,c,null)},drawGeometryNode:function(a,b,c){c=c||a._style;var d={isFilled:void 0===c.fill?!0:c.fill,isStroked:void 0===c.stroke?!!c.strokeWidth:c.stroke},e;switch(b.CLASS_NAME){case "OpenLayers.Geometry.Point":!1===c.graphic&&(d.isFilled=!1,d.isStroked=!1);e=this.drawPoint(a,b);break;case "OpenLayers.Geometry.LineString":d.isFilled=!1;e=this.drawLineString(a,b);break;case "OpenLayers.Geometry.LinearRing":e=this.drawLinearRing(a,b);break;case "OpenLayers.Geometry.Polygon":e=this.drawPolygon(a,b);break; +case "OpenLayers.Geometry.Rectangle":e=this.drawRectangle(a,b)}a._options=d;return!1!=e?{node:this.setStyle(a,c,d,b),complete:e}:!1},postDraw:function(a){},drawPoint:function(a,b){},drawLineString:function(a,b){},drawLinearRing:function(a,b){},drawPolygon:function(a,b){},drawRectangle:function(a,b){},drawCircle:function(a,b){},removeText:function(a){var b=document.getElementById(a+this.LABEL_ID_SUFFIX);b&&this.textRoot.removeChild(b);(a=document.getElementById(a+this.LABEL_OUTLINE_SUFFIX))&&this.textRoot.removeChild(a)}, +getFeatureIdFromEvent:function(a){var b=a.target,c=b&&b.correspondingUseElement;return(c?c:b||a.srcElement)._featureId},eraseGeometry:function(a,b){if("OpenLayers.Geometry.MultiPoint"==a.CLASS_NAME||"OpenLayers.Geometry.MultiLineString"==a.CLASS_NAME||"OpenLayers.Geometry.MultiPolygon"==a.CLASS_NAME||"OpenLayers.Geometry.Collection"==a.CLASS_NAME)for(var c=0,d=a.components.length;c<d;c++)this.eraseGeometry(a.components[c],b);else(c=OpenLayers.Util.getElement(a.id))&&c.parentNode&&(c.geometry&&(c.geometry.destroy(), +c.geometry=null),c.parentNode.removeChild(c),this.indexer&&this.indexer.remove(c),c._style.backgroundGraphic&&(c=OpenLayers.Util.getElement(a.id+this.BACKGROUND_ID_SUFFIX))&&c.parentNode&&c.parentNode.removeChild(c))},nodeFactory:function(a,b){var c=OpenLayers.Util.getElement(a);c?this.nodeTypeCompare(c,b)||(c.parentNode.removeChild(c),c=this.nodeFactory(a,b)):c=this.createNode(b,a);return c},nodeTypeCompare:function(a,b){},createNode:function(a,b){},moveRoot:function(a){var b=this.root;a.root.parentNode== +this.rendererRoot&&(b=a.root);b.parentNode.removeChild(b);a.rendererRoot.appendChild(b)},getRenderLayerId:function(){return this.root.parentNode.parentNode.id},isComplexSymbol:function(a){return"circle"!=a&&!!a},CLASS_NAME:"OpenLayers.Renderer.Elements"});OpenLayers.Control.ArgParser=OpenLayers.Class(OpenLayers.Control,{center:null,zoom:null,layers:null,displayProjection:null,getParameters:function(a){a=a||window.location.href;var b=OpenLayers.Util.getParameters(a),c=a.indexOf("#");0<c&&(a="?"+a.substring(c+1,a.length),OpenLayers.Util.extend(b,OpenLayers.Util.getParameters(a)));return b},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var b=0,c=this.map.controls.length;b<c;b++){var d=this.map.controls[b];if(d!=this&& +"OpenLayers.Control.ArgParser"==d.CLASS_NAME){d.displayProjection!=this.displayProjection&&(this.displayProjection=d.displayProjection);break}}b==this.map.controls.length&&(b=this.getParameters(),b.layers&&(this.layers=b.layers,this.map.events.register("addlayer",this,this.configureLayers),this.configureLayers()),b.lat&&b.lon&&(this.center=new OpenLayers.LonLat(parseFloat(b.lon),parseFloat(b.lat)),b.zoom&&(this.zoom=parseFloat(b.zoom)),this.map.events.register("changebaselayer",this,this.setCenter), +this.setCenter()))},setCenter:function(){this.map.baseLayer&&(this.map.events.unregister("changebaselayer",this,this.setCenter),this.displayProjection&&this.center.transform(this.displayProjection,this.map.getProjectionObject()),this.map.setCenter(this.center,this.zoom))},configureLayers:function(){if(this.layers.length==this.map.layers.length){this.map.events.unregister("addlayer",this,this.configureLayers);for(var a=0,b=this.layers.length;a<b;a++){var c=this.map.layers[a],d=this.layers.charAt(a); +"B"==d?this.map.setBaseLayer(c):"T"!=d&&"F"!=d||c.setVisibility("T"==d)}}},CLASS_NAME:"OpenLayers.Control.ArgParser"});OpenLayers.Control.Permalink=OpenLayers.Class(OpenLayers.Control,{argParserClass:OpenLayers.Control.ArgParser,element:null,anchor:!1,base:"",displayProjection:null,initialize:function(a,b,c){null===a||"object"!=typeof a||OpenLayers.Util.isElement(a)?(OpenLayers.Control.prototype.initialize.apply(this,[c]),this.element=OpenLayers.Util.getElement(a),this.base=b||document.location.href):(this.base=document.location.href,OpenLayers.Control.prototype.initialize.apply(this,[a]),null!=this.element&&(this.element= +OpenLayers.Util.getElement(this.element)))},destroy:function(){this.element&&this.element.parentNode==this.div&&(this.div.removeChild(this.element),this.element=null);this.map&&this.map.events.unregister("moveend",this,this.updateLink);OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);for(var b=0,c=this.map.controls.length;b<c;b++){var d=this.map.controls[b];if(d.CLASS_NAME==this.argParserClass.CLASS_NAME){d.displayProjection!= +this.displayProjection&&(this.displayProjection=d.displayProjection);break}}b==this.map.controls.length&&this.map.addControl(new this.argParserClass({displayProjection:this.displayProjection}))},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.element||this.anchor||(this.element=document.createElement("a"),this.element.innerHTML=OpenLayers.i18n("Permalink"),this.element.href="",this.div.appendChild(this.element));this.map.events.on({moveend:this.updateLink,changelayer:this.updateLink, +changebaselayer:this.updateLink,scope:this});this.updateLink();return this.div},updateLink:function(){var a=this.anchor?"#":"?",b=this.base,c=null;-1!=b.indexOf("#")&&!1==this.anchor&&(c=b.substring(b.indexOf("#"),b.length));-1!=b.indexOf(a)&&(b=b.substring(0,b.indexOf(a)));b=b.split("#")[0]+a+OpenLayers.Util.getParameterString(this.createParams());c&&(b+=c);this.anchor&&!this.element?window.location.href=b:this.element.href=b},createParams:function(a,b,c){a=a||this.map.getCenter();var d=OpenLayers.Util.getParameters(this.base); +if(a)for(d.zoom=b||this.map.getZoom(),b=a.lat,a=a.lon,this.displayProjection&&(b=OpenLayers.Projection.transform({x:a,y:b},this.map.getProjectionObject(),this.displayProjection),a=b.x,b=b.y),d.lat=Math.round(1E5*b)/1E5,d.lon=Math.round(1E5*a)/1E5,c=c||this.map.layers,d.layers="",a=0,b=c.length;a<b;a++){var e=c[a];d.layers=e.isBaseLayer?d.layers+(e==this.map.baseLayer?"B":"0"):d.layers+(e.getVisibility()?"T":"F")}return d},CLASS_NAME:"OpenLayers.Control.Permalink"});OpenLayers.Layer.TMS=OpenLayers.Class(OpenLayers.Layer.Grid,{serviceVersion:"1.0.0",layername:null,type:null,isBaseLayer:!0,tileOrigin:null,serverResolutions:null,zoomOffset:0,initialize:function(a,b,c){var d=[];d.push(a,b,{},c);OpenLayers.Layer.Grid.prototype.initialize.apply(this,d)},clone:function(a){null==a&&(a=new OpenLayers.Layer.TMS(this.name,this.url,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getURL:function(a){a=this.adjustBounds(a);var b=this.getServerResolution(), +c=Math.round((a.left-this.tileOrigin.lon)/(b*this.tileSize.w));a=Math.round((a.bottom-this.tileOrigin.lat)/(b*this.tileSize.h));b=this.getServerZoom();c=this.serviceVersion+"/"+this.layername+"/"+b+"/"+c+"/"+a+"."+this.type;a=this.url;OpenLayers.Util.isArray(a)&&(a=this.selectUrl(c,a));return a+c},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left,this.map.maxExtent.bottom))},CLASS_NAME:"OpenLayers.Layer.TMS"});OpenLayers.Format.WCSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",CLASS_NAME:"OpenLayers.Format.WCSCapabilities"});OpenLayers.Format.WCSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g,splitSpace:/\s+/},defaultPrefix:"wcs",read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1"});OpenLayers.Format.WCSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WCSCapabilities.v1,{namespaces:{wcs:"http://www.opengis.net/wcs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows"},errorProperty:"service",readers:{wcs:{WCS_Capabilities:function(a,b){this.readChildNodes(a,b)},Service:function(a,b){b.service={};this.readChildNodes(a,b.service)},name:function(a,b){b.name=this.getChildValue(a)},label:function(a,b){b.label= +this.getChildValue(a)},keywords:function(a,b){b.keywords=[];this.readChildNodes(a,b.keywords)},keyword:function(a,b){b.push(this.getChildValue(a))},responsibleParty:function(a,b){b.responsibleParty={};this.readChildNodes(a,b.responsibleParty)},individualName:function(a,b){b.individualName=this.getChildValue(a)},organisationName:function(a,b){b.organisationName=this.getChildValue(a)},positionName:function(a,b){b.positionName=this.getChildValue(a)},contactInfo:function(a,b){b.contactInfo={};this.readChildNodes(a, +b.contactInfo)},phone:function(a,b){b.phone={};this.readChildNodes(a,b.phone)},voice:function(a,b){b.voice=this.getChildValue(a)},facsimile:function(a,b){b.facsimile=this.getChildValue(a)},address:function(a,b){b.address={};this.readChildNodes(a,b.address)},deliveryPoint:function(a,b){b.deliveryPoint=this.getChildValue(a)},city:function(a,b){b.city=this.getChildValue(a)},postalCode:function(a,b){b.postalCode=this.getChildValue(a)},country:function(a,b){b.country=this.getChildValue(a)},electronicMailAddress:function(a, +b){b.electronicMailAddress=this.getChildValue(a)},fees:function(a,b){b.fees=this.getChildValue(a)},accessConstraints:function(a,b){b.accessConstraints=this.getChildValue(a)},ContentMetadata:function(a,b){b.contentMetadata=[];this.readChildNodes(a,b.contentMetadata)},CoverageOfferingBrief:function(a,b){var c={};this.readChildNodes(a,c);b.push(c)},name:function(a,b){b.name=this.getChildValue(a)},label:function(a,b){b.label=this.getChildValue(a)},lonLatEnvelope:function(a,b){var c=this.getElementsByTagNameNS(a, +"http://www.opengis.net/gml","pos");if(2==c.length){var d={},e={};OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[c[0],d]);OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[c[1],e]);b.lonLatEnvelope={};b.lonLatEnvelope.srsName=a.getAttribute("srsName");b.lonLatEnvelope.min=d.points[0];b.lonLatEnvelope.max=e.points[0]}}}},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1_0_0"});OpenLayers.Strategy.Fixed=OpenLayers.Class(OpenLayers.Strategy,{preload:!1,activate:function(){var a=OpenLayers.Strategy.prototype.activate.apply(this,arguments);if(a)if(this.layer.events.on({refresh:this.load,scope:this}),!0==this.layer.visibility||this.preload)this.load();else this.layer.events.on({visibilitychanged:this.load,scope:this});return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);a&&this.layer.events.un({refresh:this.load,visibilitychanged:this.load, +scope:this});return a},load:function(a){var b=this.layer;b.events.triggerEvent("loadstart",{filter:b.filter});b.protocol.read(OpenLayers.Util.applyDefaults({callback:this.merge,filter:b.filter,scope:this},a));b.events.un({visibilitychanged:this.load,scope:this})},merge:function(a){var b=this.layer;b.destroyFeatures();var c=a.features;if(c&&0<c.length){var d=b.projection,e=b.map.getProjectionObject();if(!e.equals(d))for(var f,g=0,h=c.length;g<h;++g)(f=c[g].geometry)&&f.transform(d,e);b.addFeatures(c)}b.events.triggerEvent("loadend", +{response:a})},CLASS_NAME:"OpenLayers.Strategy.Fixed"});OpenLayers.Control.Zoom=OpenLayers.Class(OpenLayers.Control,{zoomInText:"+",zoomInId:"olZoomInLink",zoomOutText:"\u2212",zoomOutId:"olZoomOutLink",draw:function(){var a=OpenLayers.Control.prototype.draw.apply(this),b=this.getOrCreateLinks(a),c=b.zoomIn,b=b.zoomOut,d=this.map.events;b.parentNode!==a&&(d=this.events,d.attachToElement(b.parentNode));d.register("buttonclick",this,this.onZoomClick);this.zoomInLink=c;this.zoomOutLink=b;return a},getOrCreateLinks:function(a){var b=document.getElementById(this.zoomInId), +c=document.getElementById(this.zoomOutId);b||(b=document.createElement("a"),b.href="#zoomIn",b.appendChild(document.createTextNode(this.zoomInText)),b.className="olControlZoomIn",a.appendChild(b));OpenLayers.Element.addClass(b,"olButton");c||(c=document.createElement("a"),c.href="#zoomOut",c.appendChild(document.createTextNode(this.zoomOutText)),c.className="olControlZoomOut",a.appendChild(c));OpenLayers.Element.addClass(c,"olButton");return{zoomIn:b,zoomOut:c}},onZoomClick:function(a){a=a.buttonElement; +a===this.zoomInLink?this.map.zoomIn():a===this.zoomOutLink&&this.map.zoomOut()},destroy:function(){this.map&&this.map.events.unregister("buttonclick",this,this.onZoomClick);delete this.zoomInLink;delete this.zoomOutLink;OpenLayers.Control.prototype.destroy.apply(this)},CLASS_NAME:"OpenLayers.Control.Zoom"});OpenLayers.Layer.PointTrack=OpenLayers.Class(OpenLayers.Layer.Vector,{dataFrom:null,styleFrom:null,addNodes:function(a,b){if(2>a.length)throw Error("At least two point features have to be added to create a line from");for(var c=Array(a.length-1),d,e,f,g=0,h=a.length;g<h;g++){d=a[g];f=d.geometry;if(!f)f=d.lonlat,f=new OpenLayers.Geometry.Point(f.lon,f.lat);else if("OpenLayers.Geometry.Point"!=f.CLASS_NAME)throw new TypeError("Only features with point geometries are supported.");if(0<g){d=null!=this.dataFrom? +a[g+this.dataFrom].data||a[g+this.dataFrom].attributes:null;var k=null!=this.styleFrom?a[g+this.styleFrom].style:null;e=new OpenLayers.Geometry.LineString([e,f]);c[g-1]=new OpenLayers.Feature.Vector(e,d,k)}e=f}this.addFeatures(c,b)},CLASS_NAME:"OpenLayers.Layer.PointTrack"});OpenLayers.Layer.PointTrack.SOURCE_NODE=-1;OpenLayers.Layer.PointTrack.TARGET_NODE=0;OpenLayers.Layer.PointTrack.dataFrom={SOURCE_NODE:-1,TARGET_NODE:0};OpenLayers.Protocol.WFS=function(a){a=OpenLayers.Util.applyDefaults(a,OpenLayers.Protocol.WFS.DEFAULTS);var b=OpenLayers.Protocol.WFS["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported WFS version: "+a.version;return new b(a)}; +OpenLayers.Protocol.WFS.fromWMSLayer=function(a,b){var c,d;c=a.params.LAYERS;c=(OpenLayers.Util.isArray(c)?c[0]:c).split(":");1<c.length&&(d=c[0]);c=c.pop();d={url:a.url,featureType:c,featurePrefix:d,srsName:a.projection&&a.projection.getCode()||a.map&&a.map.getProjectionObject().getCode(),version:"1.1.0"};return new OpenLayers.Protocol.WFS(OpenLayers.Util.applyDefaults(b,d))};OpenLayers.Protocol.WFS.DEFAULTS={version:"1.0.0"};OpenLayers.Layer.Markers=OpenLayers.Class(OpenLayers.Layer,{isBaseLayer:!1,markers:null,drawn:!1,initialize:function(a,b){OpenLayers.Layer.prototype.initialize.apply(this,arguments);this.markers=[]},destroy:function(){this.clearMarkers();this.markers=null;OpenLayers.Layer.prototype.destroy.apply(this,arguments)},setOpacity:function(a){if(a!=this.opacity){this.opacity=a;a=0;for(var b=this.markers.length;a<b;a++)this.markers[a].setOpacity(this.opacity)}},moveTo:function(a,b,c){OpenLayers.Layer.prototype.moveTo.apply(this, +arguments);if(b||!this.drawn){for(var d=0,e=this.markers.length;d<e;d++)this.drawMarker(this.markers[d]);this.drawn=!0}},addMarker:function(a){this.markers.push(a);1>this.opacity&&a.setOpacity(this.opacity);this.map&&this.map.getExtent()&&(a.map=this.map,this.drawMarker(a))},removeMarker:function(a){this.markers&&this.markers.length&&(OpenLayers.Util.removeItem(this.markers,a),a.erase())},clearMarkers:function(){if(null!=this.markers)for(;0<this.markers.length;)this.removeMarker(this.markers[0])}, +drawMarker:function(a){var b=this.map.getLayerPxFromLonLat(a.lonlat);null==b?a.display(!1):a.isDrawn()?a.icon&&a.icon.moveTo(b):(a=a.draw(b),this.div.appendChild(a))},getDataExtent:function(){var a=null;if(this.markers&&0<this.markers.length)for(var a=new OpenLayers.Bounds,b=0,c=this.markers.length;b<c;b++)a.extend(this.markers[b].lonlat);return a},CLASS_NAME:"OpenLayers.Layer.Markers"});OpenLayers.Control.Pan=OpenLayers.Class(OpenLayers.Control.Button,{slideFactor:50,slideRatio:null,direction:null,initialize:function(a,b){this.direction=a;this.CLASS_NAME+=this.direction;OpenLayers.Control.prototype.initialize.apply(this,[b])},trigger:function(){if(this.map){var a=OpenLayers.Function.bind(function(a){return this.slideRatio?this.map.getSize()[a]*this.slideRatio:this.slideFactor},this);switch(this.direction){case OpenLayers.Control.Pan.NORTH:this.map.pan(0,-a("h"));break;case OpenLayers.Control.Pan.SOUTH:this.map.pan(0, +a("h"));break;case OpenLayers.Control.Pan.WEST:this.map.pan(-a("w"),0);break;case OpenLayers.Control.Pan.EAST:this.map.pan(a("w"),0)}}},CLASS_NAME:"OpenLayers.Control.Pan"});OpenLayers.Control.Pan.NORTH="North";OpenLayers.Control.Pan.SOUTH="South";OpenLayers.Control.Pan.EAST="East";OpenLayers.Control.Pan.WEST="West";OpenLayers.Format.CSWGetDomain=function(a){a=OpenLayers.Util.applyDefaults(a,OpenLayers.Format.CSWGetDomain.DEFAULTS);var b=OpenLayers.Format.CSWGetDomain["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported CSWGetDomain version: "+a.version;return new b(a)};OpenLayers.Format.CSWGetDomain.DEFAULTS={version:"2.0.2"};OpenLayers.Format.CSWGetDomain.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",csw:"http://www.opengis.net/cat/csw/2.0.2"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd",PropertyName:null,ParameterName:null,read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9== +a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b},readers:{csw:{GetDomainResponse:function(a,b){this.readChildNodes(a,b)},DomainValues:function(a,b){OpenLayers.Util.isArray(b.DomainValues)||(b.DomainValues=[]);for(var c=a.attributes,d={},e=0,f=c.length;e<f;++e)d[c[e].name]=c[e].nodeValue;this.readChildNodes(a,d);b.DomainValues.push(d)},PropertyName:function(a,b){b.PropertyName=this.getChildValue(a)},ParameterName:function(a,b){b.ParameterName=this.getChildValue(a)},ListOfValues:function(a, +b){OpenLayers.Util.isArray(b.ListOfValues)||(b.ListOfValues=[]);this.readChildNodes(a,b.ListOfValues)},Value:function(a,b){for(var c=a.attributes,d={},e=0,f=c.length;e<f;++e)d[c[e].name]=c[e].nodeValue;d.value=this.getChildValue(a);b.push({Value:d})},ConceptualScheme:function(a,b){b.ConceptualScheme={};this.readChildNodes(a,b.ConceptualScheme)},Name:function(a,b){b.Name=this.getChildValue(a)},Document:function(a,b){b.Document=this.getChildValue(a)},Authority:function(a,b){b.Authority=this.getChildValue(a)}, +RangeOfValues:function(a,b){b.RangeOfValues={};this.readChildNodes(a,b.RangeOfValues)},MinValue:function(a,b){for(var c=a.attributes,d={},e=0,f=c.length;e<f;++e)d[c[e].name]=c[e].nodeValue;d.value=this.getChildValue(a);b.MinValue=d},MaxValue:function(a,b){for(var c=a.attributes,d={},e=0,f=c.length;e<f;++e)d[c[e].name]=c[e].nodeValue;d.value=this.getChildValue(a);b.MaxValue=d}}},write:function(a){a=this.writeNode("csw:GetDomain",a);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{csw:{GetDomain:function(a){var b= +this.createElementNSPlus("csw:GetDomain",{attributes:{service:"CSW",version:this.version}});a.PropertyName||this.PropertyName?this.writeNode("csw:PropertyName",a.PropertyName||this.PropertyName,b):(a.ParameterName||this.ParameterName)&&this.writeNode("csw:ParameterName",a.ParameterName||this.ParameterName,b);this.readChildNodes(b,a);return b},PropertyName:function(a){return this.createElementNSPlus("csw:PropertyName",{value:a})},ParameterName:function(a){return this.createElementNSPlus("csw:ParameterName", +{value:a})}}},CLASS_NAME:"OpenLayers.Format.CSWGetDomain.v2_0_2"});OpenLayers.Format.ArcXML.Features=OpenLayers.Class(OpenLayers.Format.XML,{read:function(a){return(new OpenLayers.Format.ArcXML).read(a).features.feature}});OpenLayers.Control.Snapping=OpenLayers.Class(OpenLayers.Control,{DEFAULTS:{tolerance:10,node:!0,edge:!0,vertex:!0},greedy:!0,precedence:["node","vertex","edge"],resolution:null,geoToleranceCache:null,layer:null,feature:null,point:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};this.options.layer&&this.setLayer(this.options.layer);a=OpenLayers.Util.extend({},this.options.defaults);this.defaults=OpenLayers.Util.applyDefaults(a,this.DEFAULTS);this.setTargets(this.options.targets); +0===this.targets.length&&this.layer&&this.addTargetLayer(this.layer);this.geoToleranceCache={}},setLayer:function(a){this.active?(this.deactivate(),this.layer=a,this.activate()):this.layer=a},setTargets:function(a){this.targets=[];if(a&&a.length)for(var b,c=0,d=a.length;c<d;++c)b=a[c],b instanceof OpenLayers.Layer.Vector?this.addTargetLayer(b):this.addTarget(b)},addTargetLayer:function(a){this.addTarget({layer:a})},addTarget:function(a){a=OpenLayers.Util.applyDefaults(a,this.defaults);a.nodeTolerance= +a.nodeTolerance||a.tolerance;a.vertexTolerance=a.vertexTolerance||a.tolerance;a.edgeTolerance=a.edgeTolerance||a.tolerance;this.targets.push(a)},removeTargetLayer:function(a){for(var b,c=this.targets.length-1;0<=c;--c)b=this.targets[c],b.layer===a&&this.removeTarget(b)},removeTarget:function(a){return OpenLayers.Util.removeItem(this.targets,a)},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a&&this.layer&&this.layer.events)this.layer.events.on({sketchstarted:this.onSketchModified, +sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this});return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this);a&&this.layer&&this.layer.events&&this.layer.events.un({sketchstarted:this.onSketchModified,sketchmodified:this.onSketchModified,vertexmodified:this.onVertexModified,scope:this});this.point=this.feature=null;return a},onSketchModified:function(a){this.feature=a.feature;this.considerSnapping(a.vertex,a.vertex)},onVertexModified:function(a){this.feature= +a.feature;var b=this.layer.map.getLonLatFromViewPortPx(a.pixel);this.considerSnapping(a.vertex,new OpenLayers.Geometry.Point(b.lon,b.lat))},considerSnapping:function(a,b){for(var c={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY,x:null,y:null},d=!1,e,f,g=0,h=this.targets.length;g<h;++g)if(f=this.targets[g],e=this.testTarget(f,b))if(this.greedy){c=e;c.target=f;d=!0;break}else if(e.rank<c.rank||e.rank===c.rank&&e.dist<c.dist)c=e,c.target=f,d=!0;d&&(!1!==this.events.triggerEvent("beforesnap", +{point:a,x:c.x,y:c.y,distance:c.dist,layer:c.target.layer,snapType:this.precedence[c.rank]})?(a.x=c.x,a.y=c.y,this.point=a,this.events.triggerEvent("snap",{point:a,snapType:this.precedence[c.rank],layer:c.target.layer,distance:c.dist})):d=!1);this.point&&!d&&(a.x=b.x,a.y=b.y,this.point=null,this.events.triggerEvent("unsnap",{point:a}))},testTarget:function(a,b){var c=this.layer.map.getResolution();if("minResolution"in a&&c<a.minResolution||"maxResolution"in a&&c>=a.maxResolution)return null;for(var c= +{node:this.getGeoTolerance(a.nodeTolerance,c),vertex:this.getGeoTolerance(a.vertexTolerance,c),edge:this.getGeoTolerance(a.edgeTolerance,c)},d=Math.max(c.node,c.vertex,c.edge),e={rank:Number.POSITIVE_INFINITY,dist:Number.POSITIVE_INFINITY},f=!1,g=a.layer.features,h,k,l,m,n,p,q=this.precedence.length,r=new OpenLayers.LonLat(b.x,b.y),s=0,t=g.length;s<t;++s)if(h=g[s],h!==this.feature&&(!h._sketch&&h.state!==OpenLayers.State.DELETE&&(!a.filter||a.filter.evaluate(h)))&&h.atPoint(r,d,d))for(var u=0,v=Math.min(e.rank+ +1,q);u<v;++u)if(k=this.precedence[u],a[k])if("edge"===k){if(l=h.geometry.distanceTo(b,{details:!0}),n=l.distance,n<=c[k]&&n<e.dist){e={rank:u,dist:n,x:l.x0,y:l.y0};f=!0;break}}else{l=h.geometry.getVertices("node"===k);p=!1;for(var w=0,x=l.length;w<x;++w)m=l[w],n=m.distanceTo(b),n<=c[k]&&(u<e.rank||u===e.rank&&n<e.dist)&&(e={rank:u,dist:n,x:m.x,y:m.y},p=f=!0);if(p)break}return f?e:null},getGeoTolerance:function(a,b){b!==this.resolution&&(this.resolution=b,this.geoToleranceCache={});var c=this.geoToleranceCache[a]; +void 0===c&&(c=a*b,this.geoToleranceCache[a]=c);return c},destroy:function(){this.active&&this.deactivate();delete this.layer;delete this.targets;OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Snapping"});OpenLayers.Format.OWSCommon.v1_1_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1,{namespaces:{ows:"http://www.opengis.net/ows/1.1",xlink:"http://www.w3.org/1999/xlink"},readers:{ows:OpenLayers.Util.applyDefaults({ExceptionReport:function(a,b){b.exceptionReport={version:a.getAttribute("version"),language:a.getAttribute("xml:lang"),exceptions:[]};this.readChildNodes(a,b.exceptionReport)},AllowedValues:function(a,b){b.allowedValues={};this.readChildNodes(a,b.allowedValues)},AnyValue:function(a,b){b.anyValue= +!0},DataType:function(a,b){b.dataType=this.getChildValue(a)},Range:function(a,b){b.range={};this.readChildNodes(a,b.range)},MinimumValue:function(a,b){b.minValue=this.getChildValue(a)},MaximumValue:function(a,b){b.maxValue=this.getChildValue(a)},Identifier:function(a,b){b.identifier=this.getChildValue(a)},SupportedCRS:function(a,b){b.supportedCRS=this.getChildValue(a)}},OpenLayers.Format.OWSCommon.v1.prototype.readers.ows)},writers:{ows:OpenLayers.Util.applyDefaults({Range:function(a){var b=this.createElementNSPlus("ows:Range", +{attributes:{"ows:rangeClosure":a.closure}});this.writeNode("ows:MinimumValue",a.minValue,b);this.writeNode("ows:MaximumValue",a.maxValue,b);return b},MinimumValue:function(a){return this.createElementNSPlus("ows:MinimumValue",{value:a})},MaximumValue:function(a){return this.createElementNSPlus("ows:MaximumValue",{value:a})},Value:function(a){return this.createElementNSPlus("ows:Value",{value:a})}},OpenLayers.Format.OWSCommon.v1.prototype.writers.ows)},CLASS_NAME:"OpenLayers.Format.OWSCommon.v1_1_0"});OpenLayers.Format.WCSGetCoverage=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows/1.1",wcs:"http://www.opengis.net/wcs/1.1",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.1.2",schemaLocation:"http://www.opengis.net/wcs/1.1 http://schemas.opengis.net/wcs/1.1/wcsGetCoverage.xsd",write:function(a){a=this.writeNode("wcs:GetCoverage", +a);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},writers:{wcs:{GetCoverage:function(a){var b=this.createElementNSPlus("wcs:GetCoverage",{attributes:{version:a.version||this.VERSION,service:"WCS"}});this.writeNode("ows:Identifier",a.identifier,b);this.writeNode("wcs:DomainSubset",a.domainSubset,b);this.writeNode("wcs:Output",a.output,b);return b},DomainSubset:function(a){var b=this.createElementNSPlus("wcs:DomainSubset", +{});this.writeNode("ows:BoundingBox",a.boundingBox,b);a.temporalSubset&&this.writeNode("wcs:TemporalSubset",a.temporalSubset,b);return b},TemporalSubset:function(a){for(var b=this.createElementNSPlus("wcs:TemporalSubset",{}),c=0,d=a.timePeriods.length;c<d;++c)this.writeNode("wcs:TimePeriod",a.timePeriods[c],b);return b},TimePeriod:function(a){var b=this.createElementNSPlus("wcs:TimePeriod",{});this.writeNode("wcs:BeginPosition",a.begin,b);this.writeNode("wcs:EndPosition",a.end,b);a.resolution&&this.writeNode("wcs:TimeResolution", +a.resolution,b);return b},BeginPosition:function(a){return this.createElementNSPlus("wcs:BeginPosition",{value:a})},EndPosition:function(a){return this.createElementNSPlus("wcs:EndPosition",{value:a})},TimeResolution:function(a){return this.createElementNSPlus("wcs:TimeResolution",{value:a})},Output:function(a){var b=this.createElementNSPlus("wcs:Output",{attributes:{format:a.format,store:a.store}});a.gridCRS&&this.writeNode("wcs:GridCRS",a.gridCRS,b);return b},GridCRS:function(a){var b=this.createElementNSPlus("wcs:GridCRS", +{});this.writeNode("wcs:GridBaseCRS",a.baseCRS,b);a.type&&this.writeNode("wcs:GridType",a.type,b);a.origin&&this.writeNode("wcs:GridOrigin",a.origin,b);this.writeNode("wcs:GridOffsets",a.offsets,b);a.CS&&this.writeNode("wcs:GridCS",a.CS,b);return b},GridBaseCRS:function(a){return this.createElementNSPlus("wcs:GridBaseCRS",{value:a})},GridOrigin:function(a){return this.createElementNSPlus("wcs:GridOrigin",{value:a})},GridType:function(a){return this.createElementNSPlus("wcs:GridType",{value:a})},GridOffsets:function(a){return this.createElementNSPlus("wcs:GridOffsets", +{value:a})},GridCS:function(a){return this.createElementNSPlus("wcs:GridCS",{value:a})}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},CLASS_NAME:"OpenLayers.Format.WCSGetCoverage"});OpenLayers.Format.KML=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{kml:"http://www.opengis.net/kml/2.2",gx:"http://www.google.com/kml/ext/2.2"},kmlns:"http://earth.google.com/kml/2.0",placemarksDesc:"No description available",foldersName:"OpenLayers export",foldersDesc:"Exported on "+new Date,extractAttributes:!0,kvpAttributes:!1,extractStyles:!1,extractTracks:!1,trackAttributes:null,internalns:null,features:null,styles:null,styleBaseUrl:"",fetched:null,maxDepth:0,initialize:function(a){this.regExes= +{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g,kmlColor:/(\w{2})(\w{2})(\w{2})(\w{2})/,kmlIconPalette:/root:\/\/icons\/palette-(\d+)(\.\w+)/,straightBracket:/\$\[(.*?)\]/g};this.externalProjection=new OpenLayers.Projection("EPSG:4326");OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){this.features=[];this.styles={};this.fetched={};return this.parseData(a,{depth:0,styleBaseUrl:this.styleBaseUrl})},parseData:function(a,b){"string"==typeof a&& +(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));for(var c=["Link","NetworkLink","Style","StyleMap","Placemark"],d=0,e=c.length;d<e;++d){var f=c[d],g=this.getElementsByTagNameNS(a,"*",f);if(0!=g.length)switch(f.toLowerCase()){case "link":case "networklink":this.parseLinks(g,b);break;case "style":this.extractStyles&&this.parseStyles(g,b);break;case "stylemap":this.extractStyles&&this.parseStyleMaps(g,b);break;case "placemark":this.parseFeatures(g,b)}}return this.features},parseLinks:function(a, +b){if(b.depth>=this.maxDepth)return!1;var c=OpenLayers.Util.extend({},b);c.depth++;for(var d=0,e=a.length;d<e;d++){var f=this.parseProperty(a[d],"*","href");f&&!this.fetched[f]&&(this.fetched[f]=!0,(f=this.fetchLink(f))&&this.parseData(f,c))}},fetchLink:function(a){if(a=OpenLayers.Request.GET({url:a,async:!1}))return a.responseText},parseStyles:function(a,b){for(var c=0,d=a.length;c<d;c++){var e=this.parseStyle(a[c]);e&&(this.styles[(b.styleBaseUrl||"")+"#"+e.id]=e)}},parseKmlColor:function(a){var b= +null;a&&(a=a.match(this.regExes.kmlColor))&&(b={color:"#"+a[4]+a[3]+a[2],opacity:parseInt(a[1],16)/255});return b},parseStyle:function(a){for(var b={},c=["LineStyle","PolyStyle","IconStyle","BalloonStyle","LabelStyle"],d,e,f=0,g=c.length;f<g;++f)if(d=c[f],e=this.getElementsByTagNameNS(a,"*",d)[0])switch(d.toLowerCase()){case "linestyle":d=this.parseProperty(e,"*","color");if(d=this.parseKmlColor(d))b.strokeColor=d.color,b.strokeOpacity=d.opacity;(d=this.parseProperty(e,"*","width"))&&(b.strokeWidth= +d);break;case "polystyle":d=this.parseProperty(e,"*","color");if(d=this.parseKmlColor(d))b.fillOpacity=d.opacity,b.fillColor=d.color;"0"==this.parseProperty(e,"*","fill")&&(b.fillColor="none");"0"==this.parseProperty(e,"*","outline")&&(b.strokeWidth="0");break;case "iconstyle":var h=parseFloat(this.parseProperty(e,"*","scale")||1);d=32*h;var k=32*h,l=this.getElementsByTagNameNS(e,"*","Icon")[0];if(l){var m=this.parseProperty(l,"*","href");if(m){var n=this.parseProperty(l,"*","w"),p=this.parseProperty(l, +"*","h");!OpenLayers.String.startsWith(m,"http://maps.google.com/mapfiles/kml")||(n||p)||(p=n=64,h/=2);n=n||p;p=p||n;n&&(d=parseInt(n)*h);p&&(k=parseInt(p)*h);if(p=m.match(this.regExes.kmlIconPalette))n=p[1],p=p[2],m=this.parseProperty(l,"*","x"),l=this.parseProperty(l,"*","y"),m="http://maps.google.com/mapfiles/kml/pal"+n+"/icon"+(8*(l?7-l/32:7)+(m?m/32:0))+p;b.graphicOpacity=1;b.externalGraphic=m}}if(e=this.getElementsByTagNameNS(e,"*","hotSpot")[0])m=parseFloat(e.getAttribute("x")),l=parseFloat(e.getAttribute("y")), +n=e.getAttribute("xunits"),"pixels"==n?b.graphicXOffset=-m*h:"insetPixels"==n?b.graphicXOffset=-d+m*h:"fraction"==n&&(b.graphicXOffset=-d*m),e=e.getAttribute("yunits"),"pixels"==e?b.graphicYOffset=-k+l*h+1:"insetPixels"==e?b.graphicYOffset=-(l*h)+1:"fraction"==e&&(b.graphicYOffset=-k*(1-l)+1);b.graphicWidth=d;b.graphicHeight=k;break;case "balloonstyle":(e=OpenLayers.Util.getXmlNodeValue(e))&&(b.balloonStyle=e.replace(this.regExes.straightBracket,"${$1}"));break;case "labelstyle":if(d=this.parseProperty(e, +"*","color"),d=this.parseKmlColor(d))b.fontColor=d.color,b.fontOpacity=d.opacity}!b.strokeColor&&b.fillColor&&(b.strokeColor=b.fillColor);(a=a.getAttribute("id"))&&b&&(b.id=a);return b},parseStyleMaps:function(a,b){for(var c=0,d=a.length;c<d;c++)for(var e=a[c],f=this.getElementsByTagNameNS(e,"*","Pair"),e=e.getAttribute("id"),g=0,h=f.length;g<h;g++){var k=f[g],l=this.parseProperty(k,"*","key");(k=this.parseProperty(k,"*","styleUrl"))&&"normal"==l&&(this.styles[(b.styleBaseUrl||"")+"#"+e]=this.styles[(b.styleBaseUrl|| +"")+k])}},parseFeatures:function(a,b){for(var c=[],d=0,e=a.length;d<e;d++){var f=a[d],g=this.parseFeature.apply(this,[f]);if(g){this.extractStyles&&(g.attributes&&g.attributes.styleUrl)&&(g.style=this.getStyle(g.attributes.styleUrl,b));if(this.extractStyles){var h=this.getElementsByTagNameNS(f,"*","Style")[0];h&&(h=this.parseStyle(h))&&(g.style=OpenLayers.Util.extend(g.style,h))}this.extractTracks?(f=this.getElementsByTagNameNS(f,this.namespaces.gx,"Track"))&&0<f.length&&(g={features:[],feature:g}, +this.readNode(f[0],g),0<g.features.length&&c.push.apply(c,g.features)):c.push(g)}else throw"Bad Placemark: "+d;}this.features=this.features.concat(c)},readers:{kml:{when:function(a,b){b.whens.push(OpenLayers.Date.parse(this.getChildValue(a)))},_trackPointAttribute:function(a,b){var c=a.nodeName.split(":").pop();b.attributes[c].push(this.getChildValue(a))}},gx:{Track:function(a,b){var c={whens:[],points:[],angles:[]};if(this.trackAttributes){var d;c.attributes={};for(var e=0,f=this.trackAttributes.length;e< +f;++e)d=this.trackAttributes[e],c.attributes[d]=[],d in this.readers.kml||(this.readers.kml[d]=this.readers.kml._trackPointAttribute)}this.readChildNodes(a,c);if(c.whens.length!==c.points.length)throw Error("gx:Track with unequal number of when ("+c.whens.length+") and gx:coord ("+c.points.length+") elements.");var g=0<c.angles.length;if(g&&c.whens.length!==c.angles.length)throw Error("gx:Track with unequal number of when ("+c.whens.length+") and gx:angles ("+c.angles.length+") elements.");for(var h, +e=0,f=c.whens.length;e<f;++e){h=b.feature.clone();h.fid=b.feature.fid||b.feature.id;d=c.points[e];h.geometry=d;"z"in d&&(h.attributes.altitude=d.z);this.internalProjection&&this.externalProjection&&h.geometry.transform(this.externalProjection,this.internalProjection);if(this.trackAttributes)for(var k=0,l=this.trackAttributes.length;k<l;++k)d=this.trackAttributes[k],h.attributes[d]=c.attributes[d][e];h.attributes.when=c.whens[e];h.attributes.trackId=b.feature.id;g&&(d=c.angles[e],h.attributes.heading= +parseFloat(d[0]),h.attributes.tilt=parseFloat(d[1]),h.attributes.roll=parseFloat(d[2]));b.features.push(h)}},coord:function(a,b){var c=this.getChildValue(a).replace(this.regExes.trimSpace,"").split(/\s+/),d=new OpenLayers.Geometry.Point(c[0],c[1]);2<c.length&&(d.z=parseFloat(c[2]));b.points.push(d)},angles:function(a,b){var c=this.getChildValue(a).replace(this.regExes.trimSpace,"").split(/\s+/);b.angles.push(c)}}},parseFeature:function(a){for(var b=["MultiGeometry","Polygon","LineString","Point"], +c,d,e,f=0,g=b.length;f<g;++f)if(c=b[f],this.internalns=a.namespaceURI?a.namespaceURI:this.kmlns,d=this.getElementsByTagNameNS(a,this.internalns,c),0<d.length){if(b=this.parseGeometry[c.toLowerCase()])e=b.apply(this,[d[0]]),this.internalProjection&&this.externalProjection&&e.transform(this.externalProjection,this.internalProjection);else throw new TypeError("Unsupported geometry type: "+c);break}var h;this.extractAttributes&&(h=this.parseAttributes(a));c=new OpenLayers.Feature.Vector(e,h);a=a.getAttribute("id")|| +a.getAttribute("name");null!=a&&(c.fid=a);return c},getStyle:function(a,b){var c=OpenLayers.Util.removeTail(a),d=OpenLayers.Util.extend({},b);d.depth++;d.styleBaseUrl=c;!this.styles[a]&&!OpenLayers.String.startsWith(a,"#")&&d.depth<=this.maxDepth&&!this.fetched[c]&&(c=this.fetchLink(c))&&this.parseData(c,d);return OpenLayers.Util.extend({},this.styles[a])},parseGeometry:{point:function(a){var b=this.getElementsByTagNameNS(a,this.internalns,"coordinates");a=[];if(0<b.length){var c=b[0].firstChild.nodeValue, +c=c.replace(this.regExes.removeSpace,"");a=c.split(",")}b=null;if(1<a.length)2==a.length&&(a[2]=null),b=new OpenLayers.Geometry.Point(a[0],a[1],a[2]);else throw"Bad coordinate string: "+c;return b},linestring:function(a,b){var c=this.getElementsByTagNameNS(a,this.internalns,"coordinates"),d=null;if(0<c.length){for(var c=this.getChildValue(c[0]),c=c.replace(this.regExes.trimSpace,""),c=c.replace(this.regExes.trimComma,","),d=c.split(this.regExes.splitSpace),e=d.length,f=Array(e),g,h,k=0;k<e;++k)if(g= +d[k].split(","),h=g.length,1<h)2==g.length&&(g[2]=null),f[k]=new OpenLayers.Geometry.Point(g[0],g[1],g[2]);else throw"Bad LineString point coordinates: "+d[k];if(e)d=b?new OpenLayers.Geometry.LinearRing(f):new OpenLayers.Geometry.LineString(f);else throw"Bad LineString coordinates: "+c;}return d},polygon:function(a){a=this.getElementsByTagNameNS(a,this.internalns,"LinearRing");var b=a.length,c=Array(b);if(0<b)for(var d=0,e=a.length;d<e;++d)if(b=this.parseGeometry.linestring.apply(this,[a[d],!0]))c[d]= +b;else throw"Bad LinearRing geometry: "+d;return new OpenLayers.Geometry.Polygon(c)},multigeometry:function(a){for(var b,c=[],d=a.childNodes,e=0,f=d.length;e<f;++e)a=d[e],1==a.nodeType&&(b=a.prefix?a.nodeName.split(":")[1]:a.nodeName,(b=this.parseGeometry[b.toLowerCase()])&&c.push(b.apply(this,[a])));return new OpenLayers.Geometry.Collection(c)}},parseAttributes:function(a){var b={},c=a.getElementsByTagName("ExtendedData");c.length&&(b=this.parseExtendedData(c[0]));var d,e,f;a=a.childNodes;for(var c= +0,g=a.length;c<g;++c)if(d=a[c],1==d.nodeType&&(e=d.childNodes,1<=e.length&&3>=e.length)){switch(e.length){case 1:f=e[0];break;case 2:f=e[0];e=e[1];f=3==f.nodeType||4==f.nodeType?f:e;break;default:f=e[1]}if(3==f.nodeType||4==f.nodeType)if(d=d.prefix?d.nodeName.split(":")[1]:d.nodeName,f=OpenLayers.Util.getXmlNodeValue(f))f=f.replace(this.regExes.trimSpace,""),b[d]=f}return b},parseExtendedData:function(a){var b={},c,d,e,f,g=a.getElementsByTagName("Data");c=0;for(d=g.length;c<d;c++){e=g[c];f=e.getAttribute("name"); +var h={},k=e.getElementsByTagName("value");k.length&&(h.value=this.getChildValue(k[0]));this.kvpAttributes?b[f]=h.value:(e=e.getElementsByTagName("displayName"),e.length&&(h.displayName=this.getChildValue(e[0])),b[f]=h)}a=a.getElementsByTagName("SimpleData");c=0;for(d=a.length;c<d;c++)h={},e=a[c],f=e.getAttribute("name"),h.value=this.getChildValue(e),this.kvpAttributes?b[f]=h.value:(h.displayName=f,b[f]=h);return b},parseProperty:function(a,b,c){var d;a=this.getElementsByTagNameNS(a,b,c);try{d=OpenLayers.Util.getXmlNodeValue(a[0])}catch(e){d= +null}return d},write:function(a){OpenLayers.Util.isArray(a)||(a=[a]);for(var b=this.createElementNS(this.kmlns,"kml"),c=this.createFolderXML(),d=0,e=a.length;d<e;++d)c.appendChild(this.createPlacemarkXML(a[d]));b.appendChild(c);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFolderXML:function(){var a=this.createElementNS(this.kmlns,"Folder");if(this.foldersName){var b=this.createElementNS(this.kmlns,"name"),c=this.createTextNode(this.foldersName);b.appendChild(c);a.appendChild(b)}this.foldersDesc&& +(b=this.createElementNS(this.kmlns,"description"),c=this.createTextNode(this.foldersDesc),b.appendChild(c),a.appendChild(b));return a},createPlacemarkXML:function(a){var b=this.createElementNS(this.kmlns,"name"),c=a.style&&a.style.label?a.style.label:a.id;b.appendChild(this.createTextNode(a.attributes.name||c));var d=this.createElementNS(this.kmlns,"description");d.appendChild(this.createTextNode(a.attributes.description||this.placemarksDesc));c=this.createElementNS(this.kmlns,"Placemark");null!= +a.fid&&c.setAttribute("id",a.fid);c.appendChild(b);c.appendChild(d);b=this.buildGeometryNode(a.geometry);c.appendChild(b);a.attributes&&(a=this.buildExtendedData(a.attributes))&&c.appendChild(a);return c},buildGeometryNode:function(a){var b=a.CLASS_NAME,b=b.substring(b.lastIndexOf(".")+1),b=this.buildGeometry[b.toLowerCase()],c=null;b&&(c=b.apply(this,[a]));return c},buildGeometry:{point:function(a){var b=this.createElementNS(this.kmlns,"Point");b.appendChild(this.buildCoordinatesNode(a));return b}, +multipoint:function(a){return this.buildGeometry.collection.apply(this,[a])},linestring:function(a){var b=this.createElementNS(this.kmlns,"LineString");b.appendChild(this.buildCoordinatesNode(a));return b},multilinestring:function(a){return this.buildGeometry.collection.apply(this,[a])},linearring:function(a){var b=this.createElementNS(this.kmlns,"LinearRing");b.appendChild(this.buildCoordinatesNode(a));return b},polygon:function(a){var b=this.createElementNS(this.kmlns,"Polygon");a=a.components; +for(var c,d,e=0,f=a.length;e<f;++e)c=0==e?"outerBoundaryIs":"innerBoundaryIs",c=this.createElementNS(this.kmlns,c),d=this.buildGeometry.linearring.apply(this,[a[e]]),c.appendChild(d),b.appendChild(c);return b},multipolygon:function(a){return this.buildGeometry.collection.apply(this,[a])},collection:function(a){for(var b=this.createElementNS(this.kmlns,"MultiGeometry"),c,d=0,e=a.components.length;d<e;++d)(c=this.buildGeometryNode.apply(this,[a.components[d]]))&&b.appendChild(c);return b}},buildCoordinatesNode:function(a){var b= +this.createElementNS(this.kmlns,"coordinates"),c;if(c=a.components){for(var d=c.length,e=Array(d),f=0;f<d;++f)a=c[f],e[f]=this.buildCoordinates(a);c=e.join(" ")}else c=this.buildCoordinates(a);c=this.createTextNode(c);b.appendChild(c);return b},buildCoordinates:function(a){this.internalProjection&&this.externalProjection&&(a=a.clone(),a.transform(this.internalProjection,this.externalProjection));return a.x+","+a.y},buildExtendedData:function(a){var b=this.createElementNS(this.kmlns,"ExtendedData"), +c;for(c in a)if(a[c]&&"name"!=c&&"description"!=c&&"styleUrl"!=c){var d=this.createElementNS(this.kmlns,"Data");d.setAttribute("name",c);var e=this.createElementNS(this.kmlns,"value");if("object"==typeof a[c]){if(a[c].value&&e.appendChild(this.createTextNode(a[c].value)),a[c].displayName){var f=this.createElementNS(this.kmlns,"displayName");f.appendChild(this.getXMLDoc().createCDATASection(a[c].displayName));d.appendChild(f)}}else e.appendChild(this.createTextNode(a[c]));d.appendChild(e);b.appendChild(d)}return this.isSimpleContent(b)? +null:b},CLASS_NAME:"OpenLayers.Format.KML"});OpenLayers.Format.WMSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.1",profile:null,CLASS_NAME:"OpenLayers.Format.WMSCapabilities"});OpenLayers.Format.WMSCapabilities.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{wms:"http://www.opengis.net/wms",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"wms",read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=a;a&&9==a.nodeType&&(a=a.documentElement);var c={};this.readNode(a,c);void 0===c.service&&(a=new OpenLayers.Format.OGCExceptionReport,c.error=a.read(b));return c},readers:{wms:{Service:function(a, +b){b.service={};this.readChildNodes(a,b.service)},Name:function(a,b){b.name=this.getChildValue(a)},Title:function(a,b){b.title=this.getChildValue(a)},Abstract:function(a,b){b["abstract"]=this.getChildValue(a)},BoundingBox:function(a,b){var c={};c.bbox=[parseFloat(a.getAttribute("minx")),parseFloat(a.getAttribute("miny")),parseFloat(a.getAttribute("maxx")),parseFloat(a.getAttribute("maxy"))];var d={x:parseFloat(a.getAttribute("resx")),y:parseFloat(a.getAttribute("resy"))};isNaN(d.x)&&isNaN(d.y)||(c.res= +d);return c},OnlineResource:function(a,b){b.href=this.getAttributeNS(a,this.namespaces.xlink,"href")},ContactInformation:function(a,b){b.contactInformation={};this.readChildNodes(a,b.contactInformation)},ContactPersonPrimary:function(a,b){b.personPrimary={};this.readChildNodes(a,b.personPrimary)},ContactPerson:function(a,b){b.person=this.getChildValue(a)},ContactOrganization:function(a,b){b.organization=this.getChildValue(a)},ContactPosition:function(a,b){b.position=this.getChildValue(a)},ContactAddress:function(a, +b){b.contactAddress={};this.readChildNodes(a,b.contactAddress)},AddressType:function(a,b){b.type=this.getChildValue(a)},Address:function(a,b){b.address=this.getChildValue(a)},City:function(a,b){b.city=this.getChildValue(a)},StateOrProvince:function(a,b){b.stateOrProvince=this.getChildValue(a)},PostCode:function(a,b){b.postcode=this.getChildValue(a)},Country:function(a,b){b.country=this.getChildValue(a)},ContactVoiceTelephone:function(a,b){b.phone=this.getChildValue(a)},ContactFacsimileTelephone:function(a, +b){b.fax=this.getChildValue(a)},ContactElectronicMailAddress:function(a,b){b.email=this.getChildValue(a)},Fees:function(a,b){var c=this.getChildValue(a);c&&"none"!=c.toLowerCase()&&(b.fees=c)},AccessConstraints:function(a,b){var c=this.getChildValue(a);c&&"none"!=c.toLowerCase()&&(b.accessConstraints=c)},Capability:function(a,b){b.capability={nestedLayers:[],layers:[]};this.readChildNodes(a,b.capability)},Request:function(a,b){b.request={};this.readChildNodes(a,b.request)},GetCapabilities:function(a, +b){b.getcapabilities={formats:[]};this.readChildNodes(a,b.getcapabilities)},Format:function(a,b){OpenLayers.Util.isArray(b.formats)?b.formats.push(this.getChildValue(a)):b.format=this.getChildValue(a)},DCPType:function(a,b){this.readChildNodes(a,b)},HTTP:function(a,b){this.readChildNodes(a,b)},Get:function(a,b){b.get={};this.readChildNodes(a,b.get);b.href||(b.href=b.get.href)},Post:function(a,b){b.post={};this.readChildNodes(a,b.post);b.href||(b.href=b.get.href)},GetMap:function(a,b){b.getmap={formats:[]}; +this.readChildNodes(a,b.getmap)},GetFeatureInfo:function(a,b){b.getfeatureinfo={formats:[]};this.readChildNodes(a,b.getfeatureinfo)},Exception:function(a,b){b.exception={formats:[]};this.readChildNodes(a,b.exception)},Layer:function(a,b){var c,d;b.capability?(d=b.capability,c=b):d=b;var e=a.getAttributeNode("queryable"),f=e&&e.specified?a.getAttribute("queryable"):null,g=(e=a.getAttributeNode("cascaded"))&&e.specified?a.getAttribute("cascaded"):null,e=(e=a.getAttributeNode("opaque"))&&e.specified? +a.getAttribute("opaque"):null,h=a.getAttribute("noSubsets"),k=a.getAttribute("fixedWidth"),l=a.getAttribute("fixedHeight"),m=c||{},n=OpenLayers.Util.extend;c={nestedLayers:[],styles:c?[].concat(c.styles):[],srs:c?n({},m.srs):{},metadataURLs:[],bbox:c?n({},m.bbox):{},llbbox:m.llbbox,dimensions:c?n({},m.dimensions):{},authorityURLs:c?n({},m.authorityURLs):{},identifiers:{},keywords:[],queryable:f&&""!==f?"1"===f||"true"===f:m.queryable||!1,cascaded:null!==g?parseInt(g):m.cascaded||0,opaque:e?"1"=== +e||"true"===e:m.opaque||!1,noSubsets:null!==h?"1"===h||"true"===h:m.noSubsets||!1,fixedWidth:null!=k?parseInt(k):m.fixedWidth||0,fixedHeight:null!=l?parseInt(l):m.fixedHeight||0,minScale:m.minScale,maxScale:m.maxScale,attribution:m.attribution};b.nestedLayers.push(c);c.capability=d;this.readChildNodes(a,c);delete c.capability;c.name&&(f=c.name.split(":"),g=d.request,e=g.getfeatureinfo,0<f.length&&(c.prefix=f[0]),d.layers.push(c),void 0===c.formats&&(c.formats=g.getmap.formats),void 0===c.infoFormats&& +e&&(c.infoFormats=e.formats))},Attribution:function(a,b){b.attribution={};this.readChildNodes(a,b.attribution)},LogoURL:function(a,b){b.logo={width:a.getAttribute("width"),height:a.getAttribute("height")};this.readChildNodes(a,b.logo)},Style:function(a,b){var c={};b.styles.push(c);this.readChildNodes(a,c)},LegendURL:function(a,b){var c={width:a.getAttribute("width"),height:a.getAttribute("height")};b.legend=c;this.readChildNodes(a,c)},MetadataURL:function(a,b){var c={type:a.getAttribute("type")}; +b.metadataURLs.push(c);this.readChildNodes(a,c)},DataURL:function(a,b){b.dataURL={};this.readChildNodes(a,b.dataURL)},FeatureListURL:function(a,b){b.featureListURL={};this.readChildNodes(a,b.featureListURL)},AuthorityURL:function(a,b){var c=a.getAttribute("name"),d={};this.readChildNodes(a,d);b.authorityURLs[c]=d.href},Identifier:function(a,b){var c=a.getAttribute("authority");b.identifiers[c]=this.getChildValue(a)},KeywordList:function(a,b){this.readChildNodes(a,b)},SRS:function(a,b){b.srs[this.getChildValue(a)]= +!0}}},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1"});OpenLayers.Format.WMSCapabilities.v1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMT_MS_Capabilities:function(a,b){this.readChildNodes(a,b)},Keyword:function(a,b){b.keywords&&b.keywords.push(this.getChildValue(a))},DescribeLayer:function(a,b){b.describelayer={formats:[]};this.readChildNodes(a,b.describelayer)},GetLegendGraphic:function(a,b){b.getlegendgraphic={formats:[]};this.readChildNodes(a,b.getlegendgraphic)},GetStyles:function(a,b){b.getstyles= +{formats:[]};this.readChildNodes(a,b.getstyles)},PutStyles:function(a,b){b.putstyles={formats:[]};this.readChildNodes(a,b.putstyles)},UserDefinedSymbolization:function(a,b){var c={supportSLD:1==parseInt(a.getAttribute("SupportSLD")),userLayer:1==parseInt(a.getAttribute("UserLayer")),userStyle:1==parseInt(a.getAttribute("UserStyle")),remoteWFS:1==parseInt(a.getAttribute("RemoteWFS"))};b.userSymbols=c},LatLonBoundingBox:function(a,b){b.llbbox=[parseFloat(a.getAttribute("minx")),parseFloat(a.getAttribute("miny")), +parseFloat(a.getAttribute("maxx")),parseFloat(a.getAttribute("maxy"))]},BoundingBox:function(a,b){var c=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this,[a,b]);c.srs=a.getAttribute("SRS");b.bbox[c.srs]=c},ScaleHint:function(a,b){var c=a.getAttribute("min"),d=a.getAttribute("max"),e=Math.pow(2,0.5),f=OpenLayers.INCHES_PER_UNIT.m;0!=c&&(b.maxScale=parseFloat((c/e*f*OpenLayers.DOTS_PER_INCH).toPrecision(13)));d!=Number.POSITIVE_INFINITY&&(b.minScale=parseFloat((d/e*f* +OpenLayers.DOTS_PER_INCH).toPrecision(13)))},Dimension:function(a,b){var c={name:a.getAttribute("name").toLowerCase(),units:a.getAttribute("units"),unitsymbol:a.getAttribute("unitSymbol")};b.dimensions[c.name]=c},Extent:function(a,b){var c=a.getAttribute("name").toLowerCase();if(c in b.dimensions){c=b.dimensions[c];c.nearestVal="1"===a.getAttribute("nearestValue");c.multipleVal="1"===a.getAttribute("multipleValues");c.current="1"===a.getAttribute("current");c["default"]=a.getAttribute("default")|| +"";var d=this.getChildValue(a);c.values=d.split(",")}}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1"});OpenLayers.Format.WMSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.0",readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(a,b){for(var c=this.getChildValue(a).split(/ +/),d=0,e=c.length;d<e;d++)b.srs[c[d]]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_0"});OpenLayers.Protocol.WFS.v1=OpenLayers.Class(OpenLayers.Protocol,{version:null,srsName:"EPSG:4326",featureType:null,featureNS:null,geometryName:"the_geom",schema:null,featurePrefix:"feature",formatOptions:null,readFormat:null,readOptions:null,initialize:function(a){OpenLayers.Protocol.prototype.initialize.apply(this,[a]);a.format||(this.format=OpenLayers.Format.WFST(OpenLayers.Util.extend({version:this.version,featureType:this.featureType,featureNS:this.featureNS,featurePrefix:this.featurePrefix,geometryName:this.geometryName, +srsName:this.srsName,schema:this.schema},this.formatOptions)));!a.geometryName&&1<parseFloat(this.format.version)&&this.setGeometryName(null)},destroy:function(){this.options&&!this.options.format&&this.format.destroy();this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(a){OpenLayers.Protocol.prototype.read.apply(this,arguments);a=OpenLayers.Util.extend({},a);OpenLayers.Util.applyDefaults(a,this.options||{});var b=new OpenLayers.Protocol.Response({requestType:"read"}), +c=OpenLayers.Format.XML.prototype.write.apply(this.format,[this.format.writeNode("wfs:GetFeature",a)]);b.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,b,a),params:a.params,headers:a.headers,data:c});return b},setFeatureType:function(a){this.featureType=a;this.format.featureType=a},setGeometryName:function(a){this.geometryName=a;this.format.geometryName=a},handleRead:function(a,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);if(b.callback){var c= +a.priv;200<=c.status&&300>c.status?(c=this.parseResponse(c,b.readOptions))&&!1!==c.success?(b.readOptions&&"object"==b.readOptions.output?OpenLayers.Util.extend(a,c):a.features=c,a.code=OpenLayers.Protocol.Response.SUCCESS):(a.code=OpenLayers.Protocol.Response.FAILURE,a.error=c):a.code=OpenLayers.Protocol.Response.FAILURE;b.callback.call(b.scope,a)}},parseResponse:function(a,b){var c=a.responseXML;c&&c.documentElement||(c=a.responseText);if(!c||0>=c.length)return null;c=null!==this.readFormat?this.readFormat.read(c): +this.format.read(c,b);if(!this.featureNS){var d=this.readFormat||this.format;this.featureNS=d.featureNS;d.autoConfig=!1;this.geometryName||this.setGeometryName(d.geometryName)}return c},commit:function(a,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);var c=new OpenLayers.Protocol.Response({requestType:"commit",reqFeatures:a});c.priv=OpenLayers.Request.POST({url:b.url,headers:b.headers,data:this.format.write(a,b),callback:this.createCallback(this.handleCommit,c,b)}); +return c},handleCommit:function(a,b){if(b.callback){var c=a.priv,d=c.responseXML;d&&d.documentElement||(d=c.responseText);c=this.format.read(d)||{};a.insertIds=c.insertIds||[];c.success?a.code=OpenLayers.Protocol.Response.SUCCESS:(a.code=OpenLayers.Protocol.Response.FAILURE,a.error=c);b.callback.call(b.scope,a)}},filterDelete:function(a,b){b=OpenLayers.Util.extend({},b);OpenLayers.Util.applyDefaults(b,this.options);new OpenLayers.Protocol.Response({requestType:"commit"});var c=this.format.createElementNSPlus("wfs:Transaction", +{attributes:{service:"WFS",version:this.version}}),d=this.format.createElementNSPlus("wfs:Delete",{attributes:{typeName:(b.featureNS?this.featurePrefix+":":"")+b.featureType}});b.featureNS&&d.setAttribute("xmlns:"+this.featurePrefix,b.featureNS);var e=this.format.writeNode("ogc:Filter",a);d.appendChild(e);c.appendChild(d);c=OpenLayers.Format.XML.prototype.write.apply(this.format,[c]);return OpenLayers.Request.POST({url:this.url,callback:b.callback||function(){},data:c})},abort:function(a){a&&a.priv.abort()}, +CLASS_NAME:"OpenLayers.Protocol.WFS.v1"});OpenLayers.Handler.Feature=OpenLayers.Class(OpenLayers.Handler,{EVENTMAP:{click:{"in":"click",out:"clickout"},mousemove:{"in":"over",out:"out"},dblclick:{"in":"dblclick",out:null},mousedown:{"in":null,out:null},mouseup:{"in":null,out:null},touchstart:{"in":"click",out:"clickout"}},feature:null,lastFeature:null,down:null,up:null,clickTolerance:4,geometryTypes:null,stopClick:!0,stopDown:!0,stopUp:!1,initialize:function(a,b,c,d){OpenLayers.Handler.prototype.initialize.apply(this,[a,c,d]);this.layer= +b},touchstart:function(a){this.startTouch();return OpenLayers.Event.isMultiTouch(a)?!0:this.mousedown(a)},touchmove:function(a){OpenLayers.Event.preventDefault(a)},mousedown:function(a){if(OpenLayers.Event.isLeftClick(a)||OpenLayers.Event.isSingleTouch(a))this.down=a.xy;return this.handle(a)?!this.stopDown:!0},mouseup:function(a){this.up=a.xy;return this.handle(a)?!this.stopUp:!0},click:function(a){return this.handle(a)?!this.stopClick:!0},mousemove:function(a){if(!this.callbacks.over&&!this.callbacks.out)return!0; +this.handle(a);return!0},dblclick:function(a){return!this.handle(a)},geometryTypeMatches:function(a){return null==this.geometryTypes||-1<OpenLayers.Util.indexOf(this.geometryTypes,a.geometry.CLASS_NAME)},handle:function(a){this.feature&&!this.feature.layer&&(this.feature=null);var b=a.type,c=!1,d=!!this.feature,e="click"==b||"dblclick"==b||"touchstart"==b;(this.feature=this.layer.getFeatureFromEvent(a))&&!this.feature.layer&&(this.feature=null);this.lastFeature&&!this.lastFeature.layer&&(this.lastFeature= +null);this.feature?("touchstart"===b&&OpenLayers.Event.preventDefault(a),a=this.feature!=this.lastFeature,this.geometryTypeMatches(this.feature)?(d&&a?(this.lastFeature&&this.triggerCallback(b,"out",[this.lastFeature]),this.triggerCallback(b,"in",[this.feature])):d&&!e||this.triggerCallback(b,"in",[this.feature]),this.lastFeature=this.feature,c=!0):(this.lastFeature&&(d&&a||e)&&this.triggerCallback(b,"out",[this.lastFeature]),this.feature=null)):this.lastFeature&&(d||e)&&this.triggerCallback(b,"out", +[this.lastFeature]);return c},triggerCallback:function(a,b,c){if(b=this.EVENTMAP[a][b])"click"==a&&this.up&&this.down?(Math.sqrt(Math.pow(this.up.x-this.down.x,2)+Math.pow(this.up.y-this.down.y,2))<=this.clickTolerance&&this.callback(b,c),this.up=this.down=null):this.callback(b,c)},activate:function(){var a=!1;OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.moveLayerToTop(),this.map.events.on({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),a=!0); +return a},deactivate:function(){var a=!1;OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.moveLayerBack(),this.up=this.down=this.lastFeature=this.feature=null,this.map.events.un({removelayer:this.handleMapEvents,changelayer:this.handleMapEvents,scope:this}),a=!0);return a},handleMapEvents:function(a){"removelayer"!=a.type&&"order"!=a.property||this.moveLayerToTop()},moveLayerToTop:function(){var a=Math.max(this.map.Z_INDEX_BASE.Feature-1,this.layer.getZIndex())+1;this.layer.setZIndex(a)}, +moveLayerBack:function(){var a=this.layer.getZIndex()-1;a>=this.map.Z_INDEX_BASE.Feature?this.layer.setZIndex(a):this.map.setLayerZIndex(this.layer,this.map.getLayerIndex(this.layer))},CLASS_NAME:"OpenLayers.Handler.Feature"});OpenLayers.Layer.Vector.RootContainer=OpenLayers.Class(OpenLayers.Layer.Vector,{displayInLayerSwitcher:!1,layers:null,display:function(){},getFeatureFromEvent:function(a){for(var b=this.layers,c,d=0;d<b.length;d++)if(c=b[d].getFeatureFromEvent(a))return c},setMap:function(a){OpenLayers.Layer.Vector.prototype.setMap.apply(this,arguments);this.collectRoots();a.events.register("changelayer",this,this.handleChangeLayer)},removeMap:function(a){a.events.unregister("changelayer",this,this.handleChangeLayer); +this.resetRoots();OpenLayers.Layer.Vector.prototype.removeMap.apply(this,arguments)},collectRoots:function(){for(var a,b=0;b<this.map.layers.length;++b)a=this.map.layers[b],-1!=OpenLayers.Util.indexOf(this.layers,a)&&a.renderer.moveRoot(this.renderer)},resetRoots:function(){for(var a,b=0;b<this.layers.length;++b)a=this.layers[b],this.renderer&&a.renderer.getRenderLayerId()==this.id&&this.renderer.moveRoot(a.renderer)},handleChangeLayer:function(a){var b=a.layer;"order"==a.property&&-1!=OpenLayers.Util.indexOf(this.layers, +b)&&(this.resetRoots(),this.collectRoots())},CLASS_NAME:"OpenLayers.Layer.Vector.RootContainer"});OpenLayers.Control.SelectFeature=OpenLayers.Class(OpenLayers.Control,{multipleKey:null,toggleKey:null,multiple:!1,clickout:!0,toggle:!1,hover:!1,highlightOnly:!1,box:!1,onBeforeSelect:function(){},onSelect:function(){},onUnselect:function(){},scope:null,geometryTypes:null,layer:null,layers:null,callbacks:null,selectStyle:null,renderIntent:"select",handlers:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);null===this.scope&&(this.scope=this);this.initLayer(a);var c= +{click:this.clickFeature,clickout:this.clickoutFeature};this.hover&&(c.over=this.overFeature,c.out=this.outFeature);this.callbacks=OpenLayers.Util.extend(c,this.callbacks);this.handlers={feature:new OpenLayers.Handler.Feature(this,this.layer,this.callbacks,{geometryTypes:this.geometryTypes})};this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},{boxDivClassName:"olHandlerBoxSelectFeature"}))},initLayer:function(a){OpenLayers.Util.isArray(a)?(this.layers=a,this.layer= +new OpenLayers.Layer.Vector.RootContainer(this.id+"_container",{layers:a})):this.layer=a},destroy:function(){this.active&&this.layers&&this.map.removeLayer(this.layer);OpenLayers.Control.prototype.destroy.apply(this,arguments);this.layers&&this.layer.destroy()},activate:function(){this.active||(this.layers&&this.map.addLayer(this.layer),this.handlers.feature.activate(),this.box&&this.handlers.box&&this.handlers.box.activate());return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.active&& +(this.handlers.feature.deactivate(),this.handlers.box&&this.handlers.box.deactivate(),this.layers&&this.map.removeLayer(this.layer));return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},unselectAll:function(a){var b=this.layers||[this.layer],c,d,e,f;for(e=0;e<b.length;++e)if(c=b[e],f=0,null!=c.selectedFeatures)for(;c.selectedFeatures.length>f;)d=c.selectedFeatures[f],a&&a.except==d?++f:this.unselect(d)},clickFeature:function(a){this.hover||(-1<OpenLayers.Util.indexOf(a.layer.selectedFeatures, +a)?this.toggleSelect()?this.unselect(a):this.multipleSelect()||this.unselectAll({except:a}):(this.multipleSelect()||this.unselectAll({except:a}),this.select(a)))},multipleSelect:function(){return this.multiple||this.handlers.feature.evt&&this.handlers.feature.evt[this.multipleKey]},toggleSelect:function(){return this.toggle||this.handlers.feature.evt&&this.handlers.feature.evt[this.toggleKey]},clickoutFeature:function(a){!this.hover&&this.clickout&&this.unselectAll()},overFeature:function(a){var b= +a.layer;this.hover&&(this.highlightOnly?this.highlight(a):-1==OpenLayers.Util.indexOf(b.selectedFeatures,a)&&this.select(a))},outFeature:function(a){if(this.hover)if(this.highlightOnly){if(a._lastHighlighter==this.id)if(a._prevHighlighter&&a._prevHighlighter!=this.id){delete a._lastHighlighter;var b=this.map.getControl(a._prevHighlighter);b&&b.highlight(a)}else this.unhighlight(a)}else this.unselect(a)},highlight:function(a){var b=a.layer;!1!==this.events.triggerEvent("beforefeaturehighlighted",{feature:a})&& +(a._prevHighlighter=a._lastHighlighter,a._lastHighlighter=this.id,b.drawFeature(a,this.selectStyle||this.renderIntent),this.events.triggerEvent("featurehighlighted",{feature:a}))},unhighlight:function(a){var b=a.layer;void 0==a._prevHighlighter?delete a._lastHighlighter:(a._prevHighlighter!=this.id&&(a._lastHighlighter=a._prevHighlighter),delete a._prevHighlighter);b.drawFeature(a,a.style||a.layer.style||"default");this.events.triggerEvent("featureunhighlighted",{feature:a})},select:function(a){var b= +this.onBeforeSelect.call(this.scope,a),c=a.layer;!1!==b&&(b=c.events.triggerEvent("beforefeatureselected",{feature:a}),!1!==b&&(c.selectedFeatures.push(a),this.highlight(a),this.handlers.feature.lastFeature||(this.handlers.feature.lastFeature=c.selectedFeatures[0]),c.events.triggerEvent("featureselected",{feature:a}),this.onSelect.call(this.scope,a)))},unselect:function(a){var b=a.layer;this.unhighlight(a);OpenLayers.Util.removeItem(b.selectedFeatures,a);b.events.triggerEvent("featureunselected", +{feature:a});this.onUnselect.call(this.scope,a)},selectBox:function(a){if(a instanceof OpenLayers.Bounds){var b=this.map.getLonLatFromPixel({x:a.left,y:a.bottom});a=this.map.getLonLatFromPixel({x:a.right,y:a.top});b=new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat);this.multipleSelect()||this.unselectAll();a=this.multiple;this.multiple=!0;var c=this.layers||[this.layer];this.events.triggerEvent("boxselectionstart",{layers:c});for(var d,e=0;e<c.length;++e){d=c[e];for(var f=0,g=d.features.length;f<g;++f){var h= +d.features[f];h.getVisibility()&&(null==this.geometryTypes||-1<OpenLayers.Util.indexOf(this.geometryTypes,h.geometry.CLASS_NAME))&&b.toGeometry().intersects(h.geometry)&&-1==OpenLayers.Util.indexOf(d.selectedFeatures,h)&&this.select(h)}}this.multiple=a;this.events.triggerEvent("boxselectionend",{layers:c})}},setMap:function(a){this.handlers.feature.setMap(a);this.box&&this.handlers.box.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},setLayer:function(a){var b=this.active;this.unselectAll(); +this.deactivate();this.layers&&(this.layer.destroy(),this.layers=null);this.initLayer(a);this.handlers.feature.layer=this.layer;b&&this.activate()},CLASS_NAME:"OpenLayers.Control.SelectFeature"});OpenLayers.Handler.Point=OpenLayers.Class(OpenLayers.Handler,{point:null,layer:null,multi:!1,citeCompliant:!1,mouseDown:!1,stoppedDown:null,lastDown:null,lastUp:null,persist:!1,stopDown:!1,stopUp:!1,layerOptions:null,pixelTolerance:5,lastTouchPx:null,initialize:function(a,b,c){c&&c.layerOptions&&c.layerOptions.styleMap||(this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{}));OpenLayers.Handler.prototype.initialize.apply(this,arguments)},activate:function(){if(!OpenLayers.Handler.prototype.activate.apply(this, +arguments))return!1;var a=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions);this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,a);this.map.addLayer(this.layer);return!0},createFeature:function(a){a=this.layer.getLonLatFromViewPortPx(a);a=new OpenLayers.Geometry.Point(a.lon,a.lat);this.point=new OpenLayers.Feature.Vector(a);this.callback("create",[this.point.geometry,this.point]);this.point.geometry.clearBounds(); +this.layer.addFeatures([this.point],{silent:!0})},deactivate:function(){if(!OpenLayers.Handler.prototype.deactivate.apply(this,arguments))return!1;this.cancel();null!=this.layer.map&&(this.destroyFeature(!0),this.layer.destroy(!1));this.layer=null;return!0},destroyFeature:function(a){!this.layer||!a&&this.persist||this.layer.destroyFeatures();this.point=null},destroyPersistedFeature:function(){var a=this.layer;a&&1<a.features.length&&this.layer.features[0].destroy()},finalize:function(a){this.mouseDown= +!1;this.lastTouchPx=this.lastUp=this.lastDown=null;this.callback(a?"cancel":"done",[this.geometryClone()]);this.destroyFeature(a)},cancel:function(){this.finalize(!0)},click:function(a){OpenLayers.Event.stop(a);return!1},dblclick:function(a){OpenLayers.Event.stop(a);return!1},modifyFeature:function(a){this.point||this.createFeature(a);a=this.layer.getLonLatFromViewPortPx(a);this.point.geometry.x=a.lon;this.point.geometry.y=a.lat;this.callback("modify",[this.point.geometry,this.point,!1]);this.point.geometry.clearBounds(); +this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.point,this.style)},getGeometry:function(){var a=this.point&&this.point.geometry;a&&this.multi&&(a=new OpenLayers.Geometry.MultiPoint([a]));return a},geometryClone:function(){var a=this.getGeometry();return a&&a.clone()},mousedown:function(a){return this.down(a)},touchstart:function(a){this.startTouch();this.lastTouchPx=a.xy;return this.down(a)},mousemove:function(a){return this.move(a)},touchmove:function(a){this.lastTouchPx=a.xy; +return this.move(a)},mouseup:function(a){return this.up(a)},touchend:function(a){a.xy=this.lastTouchPx;return this.up(a)},down:function(a){this.mouseDown=!0;this.lastDown=a.xy;this.touch||this.modifyFeature(a.xy);this.stoppedDown=this.stopDown;return!this.stopDown},move:function(a){this.touch||this.mouseDown&&!this.stoppedDown||this.modifyFeature(a.xy);return!0},up:function(a){this.mouseDown=!1;this.stoppedDown=this.stopDown;if(!this.checkModifiers(a)||this.lastUp&&this.lastUp.equals(a.xy)||!this.lastDown|| +!this.passesTolerance(this.lastDown,a.xy,this.pixelTolerance))return!0;this.touch&&this.modifyFeature(a.xy);this.persist&&this.destroyPersistedFeature();this.lastUp=a.xy;this.finalize();return!this.stopUp},mouseout:function(a){OpenLayers.Util.mouseLeft(a,this.map.viewPortDiv)&&(this.stoppedDown=this.stopDown,this.mouseDown=!1)},passesTolerance:function(a,b,c){var d=!0;null!=c&&a&&b&&a.distanceTo(b)>c&&(d=!1);return d},CLASS_NAME:"OpenLayers.Handler.Point"});OpenLayers.Handler.Path=OpenLayers.Class(OpenLayers.Handler.Point,{line:null,maxVertices:null,doubleTouchTolerance:20,freehand:!1,freehandToggle:"shiftKey",timerId:null,redoStack:null,createFeature:function(a){a=this.layer.getLonLatFromViewPortPx(a);a=new OpenLayers.Geometry.Point(a.lon,a.lat);this.point=new OpenLayers.Feature.Vector(a);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([this.point.geometry]));this.callback("create",[this.point.geometry,this.getSketch()]); +this.point.geometry.clearBounds();this.layer.addFeatures([this.line,this.point],{silent:!0})},destroyFeature:function(a){OpenLayers.Handler.Point.prototype.destroyFeature.call(this,a);this.line=null},destroyPersistedFeature:function(){var a=this.layer;a&&2<a.features.length&&this.layer.features[0].destroy()},removePoint:function(){this.point&&this.layer.removeFeatures([this.point])},addPoint:function(a){this.layer.removeFeatures([this.point]);a=this.layer.getLonLatFromViewPortPx(a);this.point=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a.lon, +a.lat));this.line.geometry.addComponent(this.point.geometry,this.line.geometry.components.length);this.layer.addFeatures([this.point]);this.callback("point",[this.point.geometry,this.getGeometry()]);this.callback("modify",[this.point.geometry,this.getSketch()]);this.drawFeature();delete this.redoStack},insertXY:function(a,b){this.line.geometry.addComponent(new OpenLayers.Geometry.Point(a,b),this.getCurrentPointIndex());this.drawFeature();delete this.redoStack},insertDeltaXY:function(a,b){var c=this.getCurrentPointIndex()- +1,c=this.line.geometry.components[c];!c||(isNaN(c.x)||isNaN(c.y))||this.insertXY(c.x+a,c.y+b)},insertDirectionLength:function(a,b){a*=Math.PI/180;var c=b*Math.cos(a),d=b*Math.sin(a);this.insertDeltaXY(c,d)},insertDeflectionLength:function(a,b){var c=this.getCurrentPointIndex()-1;if(0<c){var d=this.line.geometry.components[c],c=this.line.geometry.components[c-1],d=Math.atan2(d.y-c.y,d.x-c.x);this.insertDirectionLength(180*d/Math.PI+a,b)}},getCurrentPointIndex:function(){return this.line.geometry.components.length- +1},undo:function(){var a=this.line.geometry,b=a.components,c=this.getCurrentPointIndex()-1,d=b[c],e=a.removeComponent(d);e&&(this.touch&&0<c&&(b=a.components,a=b[c-1],c=this.getCurrentPointIndex(),b=b[c],b.x=a.x,b.y=a.y),this.redoStack||(this.redoStack=[]),this.redoStack.push(d),this.drawFeature());return e},redo:function(){var a=this.redoStack&&this.redoStack.pop();a&&(this.line.geometry.addComponent(a,this.getCurrentPointIndex()),this.drawFeature());return!!a},freehandMode:function(a){return this.freehandToggle&& +a[this.freehandToggle]?!this.freehand:this.freehand},modifyFeature:function(a,b){this.line||this.createFeature(a);var c=this.layer.getLonLatFromViewPortPx(a);this.point.geometry.x=c.lon;this.point.geometry.y=c.lat;this.callback("modify",[this.point.geometry,this.getSketch(),b]);this.point.geometry.clearBounds();this.drawFeature()},drawFeature:function(){this.layer.drawFeature(this.line,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.line},getGeometry:function(){var a= +this.line&&this.line.geometry;a&&this.multi&&(a=new OpenLayers.Geometry.MultiLineString([a]));return a},touchstart:function(a){if(this.timerId&&this.passesTolerance(this.lastTouchPx,a.xy,this.doubleTouchTolerance))return this.finishGeometry(),window.clearTimeout(this.timerId),this.timerId=null,!1;this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null);this.timerId=window.setTimeout(OpenLayers.Function.bind(function(){this.timerId=null},this),300);return OpenLayers.Handler.Point.prototype.touchstart.call(this, +a)},down:function(a){var b=this.stopDown;this.freehandMode(a)&&(b=!0,this.touch&&(this.modifyFeature(a.xy,!!this.lastUp),OpenLayers.Event.stop(a)));this.touch||this.lastDown&&this.passesTolerance(this.lastDown,a.xy,this.pixelTolerance)||this.modifyFeature(a.xy,!!this.lastUp);this.mouseDown=!0;this.lastDown=a.xy;this.stoppedDown=b;return!b},move:function(a){if(this.stoppedDown&&this.freehandMode(a))return this.persist&&this.destroyPersistedFeature(),this.maxVertices&&this.line&&this.line.geometry.components.length=== +this.maxVertices?(this.removePoint(),this.finalize()):this.addPoint(a.xy),!1;this.touch||this.mouseDown&&!this.stoppedDown||this.modifyFeature(a.xy,!!this.lastUp);return!0},up:function(a){!this.mouseDown||this.lastUp&&this.lastUp.equals(a.xy)||(this.stoppedDown&&this.freehandMode(a)?(this.persist&&this.destroyPersistedFeature(),this.removePoint(),this.finalize()):this.passesTolerance(this.lastDown,a.xy,this.pixelTolerance)&&(this.touch&&this.modifyFeature(a.xy),null==this.lastUp&&this.persist&&this.destroyPersistedFeature(), +this.addPoint(a.xy),this.lastUp=a.xy,this.line.geometry.components.length===this.maxVertices+1&&this.finishGeometry()));this.stoppedDown=this.stopDown;this.mouseDown=!1;return!this.stopUp},finishGeometry:function(){this.line.geometry.removeComponent(this.line.geometry.components[this.line.geometry.components.length-1]);this.removePoint();this.finalize()},dblclick:function(a){this.freehandMode(a)||this.finishGeometry();return!1},CLASS_NAME:"OpenLayers.Handler.Path"});OpenLayers.Spherical=OpenLayers.Spherical||{};OpenLayers.Spherical.DEFAULT_RADIUS=6378137;OpenLayers.Spherical.computeDistanceBetween=function(a,b,c){c=c||OpenLayers.Spherical.DEFAULT_RADIUS;var d=Math.sin(Math.PI*(b.lon-a.lon)/360),e=Math.sin(Math.PI*(b.lat-a.lat)/360);a=e*e+d*d*Math.cos(Math.PI*a.lat/180)*Math.cos(Math.PI*b.lat/180);return 2*c*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}; +OpenLayers.Spherical.computeHeading=function(a,b){var c=Math.sin(Math.PI*(a.lon-b.lon)/180)*Math.cos(Math.PI*b.lat/180),d=Math.cos(Math.PI*a.lat/180)*Math.sin(Math.PI*b.lat/180)-Math.sin(Math.PI*a.lat/180)*Math.cos(Math.PI*b.lat/180)*Math.cos(Math.PI*(a.lon-b.lon)/180);return 180*Math.atan2(c,d)/Math.PI};OpenLayers.Control.CacheWrite=OpenLayers.Class(OpenLayers.Control,{layers:null,imageFormat:"image/png",quotaRegEx:/quota/i,setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);var b,c=this.layers||a.layers;for(b=c.length-1;0<=b;--b)this.addLayer({layer:c[b]});if(!this.layers)a.events.on({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this})},addLayer:function(a){a.layer.events.on({tileloadstart:this.makeSameOrigin,tileloaded:this.onTileLoaded,scope:this})},removeLayer:function(a){a.layer.events.un({tileloadstart:this.makeSameOrigin, +tileloaded:this.onTileLoaded,scope:this})},makeSameOrigin:function(a){if(this.active&&(a=a.tile,a instanceof OpenLayers.Tile.Image&&!a.crossOriginKeyword&&"data:"!==a.url.substr(0,5))){var b=OpenLayers.Request.makeSameOrigin(a.url,OpenLayers.ProxyHost);OpenLayers.Control.CacheWrite.urlMap[b]=a.url;a.url=b}},onTileLoaded:function(a){this.active&&(!a.aborted&&a.tile instanceof OpenLayers.Tile.Image&&"data:"!==a.tile.url.substr(0,5))&&(this.cache({tile:a.tile}),delete OpenLayers.Control.CacheWrite.urlMap[a.tile.url])}, +cache:function(a){if(window.localStorage){a=a.tile;try{var b=a.getCanvasContext();b&&window.localStorage.setItem("olCache_"+(OpenLayers.Control.CacheWrite.urlMap[a.url]||a.url),b.canvas.toDataURL(this.imageFormat))}catch(c){(b=c.name||c.message)&&this.quotaRegEx.test(b)?this.events.triggerEvent("cachefull",{tile:a}):OpenLayers.Console.error(c.toString())}}},destroy:function(){if(this.layers||this.map){var a,b=this.layers||this.map.layers;for(a=b.length-1;0<=a;--a)this.removeLayer({layer:b[a]})}this.map&& +this.map.events.un({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.CacheWrite"});OpenLayers.Control.CacheWrite.clearCache=function(){if(window.localStorage){var a,b;for(a=window.localStorage.length-1;0<=a;--a)b=window.localStorage.key(a),"olCache_"===b.substr(0,8)&&window.localStorage.removeItem(b)}};OpenLayers.Control.CacheWrite.urlMap={};OpenLayers.Format.Context=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{layerOptions:null,layerParams:null,read:function(a,b){var c=OpenLayers.Format.XML.VersionedOGC.prototype.read.apply(this,arguments);if(b&&b.map)if(this.context=c,b.map instanceof OpenLayers.Map)c=this.mergeContextToMap(c,b.map);else{var d=b.map;if(OpenLayers.Util.isElement(d)||"string"==typeof d)d={div:d};c=this.contextToMap(c,d)}return c},getLayerFromContext:function(a){var b,c,d={queryable:a.queryable,visibility:a.visibility, +maxExtent:a.maxExtent,metadata:OpenLayers.Util.applyDefaults(a.metadata,{styles:a.styles,formats:a.formats,"abstract":a["abstract"],dataURL:a.dataURL}),numZoomLevels:a.numZoomLevels,units:a.units,isBaseLayer:a.isBaseLayer,opacity:a.opacity,displayInLayerSwitcher:a.displayInLayerSwitcher,singleTile:a.singleTile,tileSize:a.tileSize?new OpenLayers.Size(a.tileSize.width,a.tileSize.height):void 0,minScale:a.minScale||a.maxScaleDenominator,maxScale:a.maxScale||a.minScaleDenominator,srs:a.srs,dimensions:a.dimensions, +metadataURL:a.metadataURL};this.layerOptions&&OpenLayers.Util.applyDefaults(d,this.layerOptions);var e={layers:a.name,transparent:a.transparent,version:a.version};if(a.formats&&0<a.formats.length)for(e.format=a.formats[0].value,b=0,c=a.formats.length;b<c;b++){var f=a.formats[b];if(!0==f.current){e.format=f.value;break}}if(a.styles&&0<a.styles.length)for(b=0,c=a.styles.length;b<c;b++)if(f=a.styles[b],!0==f.current){f.href?e.sld=f.href:f.body?e.sld_body=f.body:e.styles=f.name;break}this.layerParams&& +OpenLayers.Util.applyDefaults(e,this.layerParams);b=null;c=a.service;c==OpenLayers.Format.Context.serviceTypes.WFS?(d.strategies=[new OpenLayers.Strategy.BBOX],d.protocol=new OpenLayers.Protocol.WFS({url:a.url,featurePrefix:a.name.split(":")[0],featureType:a.name.split(":").pop()}),b=new OpenLayers.Layer.Vector(a.title||a.name,d)):c==OpenLayers.Format.Context.serviceTypes.KML?(d.strategies=[new OpenLayers.Strategy.Fixed],d.protocol=new OpenLayers.Protocol.HTTP({url:a.url,format:new OpenLayers.Format.KML}), +b=new OpenLayers.Layer.Vector(a.title||a.name,d)):c==OpenLayers.Format.Context.serviceTypes.GML?(d.strategies=[new OpenLayers.Strategy.Fixed],d.protocol=new OpenLayers.Protocol.HTTP({url:a.url,format:new OpenLayers.Format.GML}),b=new OpenLayers.Layer.Vector(a.title||a.name,d)):a.features?(b=new OpenLayers.Layer.Vector(a.title||a.name,d),b.addFeatures(a.features)):!0!==a.categoryLayer&&(b=new OpenLayers.Layer.WMS(a.title||a.name,a.url,e,d));return b},getLayersFromContext:function(a){for(var b=[],c= +0,d=a.length;c<d;c++){var e=this.getLayerFromContext(a[c]);null!==e&&b.push(e)}return b},contextToMap:function(a,b){b=OpenLayers.Util.applyDefaults({maxExtent:a.maxExtent,projection:a.projection,units:a.units},b);b.maxExtent&&(b.maxResolution=b.maxExtent.getWidth()/OpenLayers.Map.TILE_WIDTH);b.metadata={contactInformation:a.contactInformation,"abstract":a["abstract"],keywords:a.keywords,logo:a.logo,descriptionURL:a.descriptionURL};var c=new OpenLayers.Map(b);c.addLayers(this.getLayersFromContext(a.layersContext)); +c.setCenter(a.bounds.getCenterLonLat(),c.getZoomForExtent(a.bounds,!0));return c},mergeContextToMap:function(a,b){b.addLayers(this.getLayersFromContext(a.layersContext));return b},write:function(a,b){a=this.toContext(a);return OpenLayers.Format.XML.VersionedOGC.prototype.write.apply(this,arguments)},CLASS_NAME:"OpenLayers.Format.Context"}); +OpenLayers.Format.Context.serviceTypes={WMS:"urn:ogc:serviceType:WMS",WFS:"urn:ogc:serviceType:WFS",WCS:"urn:ogc:serviceType:WCS",GML:"urn:ogc:serviceType:GML",SLD:"urn:ogc:serviceType:SLD",FES:"urn:ogc:serviceType:FES",KML:"urn:ogc:serviceType:KML"};OpenLayers.Format.WMC=OpenLayers.Class(OpenLayers.Format.Context,{defaultVersion:"1.1.0",layerToContext:function(a){var b=this.getParser(),c={queryable:a.queryable,visibility:a.visibility,name:a.params.LAYERS,title:a.name,"abstract":a.metadata["abstract"],dataURL:a.metadata.dataURL,metadataURL:a.metadataURL,server:{version:a.params.VERSION,url:a.url},maxExtent:a.maxExtent,transparent:a.params.TRANSPARENT,numZoomLevels:a.numZoomLevels,units:a.units,isBaseLayer:a.isBaseLayer,opacity:1==a.opacity?void 0: +a.opacity,displayInLayerSwitcher:a.displayInLayerSwitcher,singleTile:a.singleTile,tileSize:a.singleTile||!a.tileSize?void 0:{width:a.tileSize.w,height:a.tileSize.h},minScale:a.options.resolutions||a.options.scales||a.options.maxResolution||a.options.minScale?a.minScale:void 0,maxScale:a.options.resolutions||a.options.scales||a.options.minResolution||a.options.maxScale?a.maxScale:void 0,formats:[],styles:[],srs:a.srs,dimensions:a.dimensions};a.metadata.servertitle&&(c.server.title=a.metadata.servertitle); +if(a.metadata.formats&&0<a.metadata.formats.length)for(var d=0,e=a.metadata.formats.length;d<e;d++){var f=a.metadata.formats[d];c.formats.push({value:f.value,current:f.value==a.params.FORMAT})}else c.formats.push({value:a.params.FORMAT,current:!0});if(a.metadata.styles&&0<a.metadata.styles.length)for(d=0,e=a.metadata.styles.length;d<e;d++)b=a.metadata.styles[d],b.current=b.href==a.params.SLD||b.body==a.params.SLD_BODY||b.name==a.params.STYLES?!0:!1,c.styles.push(b);else c.styles.push({href:a.params.SLD, +body:a.params.SLD_BODY,name:a.params.STYLES||b.defaultStyleName,title:b.defaultStyleTitle,current:!0});return c},toContext:function(a){var b={},c=a.layers;if("OpenLayers.Map"==a.CLASS_NAME){var d=a.metadata||{};b.size=a.getSize();b.bounds=a.getExtent();b.projection=a.projection;b.title=a.title;b.keywords=d.keywords;b["abstract"]=d["abstract"];b.logo=d.logo;b.descriptionURL=d.descriptionURL;b.contactInformation=d.contactInformation;b.maxExtent=a.maxExtent}else OpenLayers.Util.applyDefaults(b,a),void 0!= +b.layers&&delete b.layers;void 0==b.layersContext&&(b.layersContext=[]);if(void 0!=c&&OpenLayers.Util.isArray(c))for(a=0,d=c.length;a<d;a++){var e=c[a];e instanceof OpenLayers.Layer.WMS&&b.layersContext.push(this.layerToContext(e))}return b},CLASS_NAME:"OpenLayers.Format.WMC"});OpenLayers.Format.WMC.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ol:"http://openlayers.org/context",wmc:"http://www.opengis.net/context",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"",getNamespacePrefix:function(a){var b=null;if(null==a)b=this.namespaces[this.defaultPrefix];else for(b in this.namespaces)if(this.namespaces[b]==a)break;return b},defaultPrefix:"wmc",rootPrefix:null,defaultStyleName:"", +defaultStyleTitle:"Default",initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a=a.documentElement;this.rootPrefix=a.prefix;var b={version:a.getAttribute("version")};this.runChildNodes(b,a);return b},runChildNodes:function(a,b){for(var c=b.childNodes,d,e,f,g=0,h=c.length;g<h;++g)d=c[g],1==d.nodeType&&(e=this.getNamespacePrefix(d.namespaceURI),f=d.nodeName.split(":").pop(), +(e=this["read_"+e+"_"+f])&&e.apply(this,[a,d]))},read_wmc_General:function(a,b){this.runChildNodes(a,b)},read_wmc_BoundingBox:function(a,b){a.projection=b.getAttribute("SRS");a.bounds=new OpenLayers.Bounds(b.getAttribute("minx"),b.getAttribute("miny"),b.getAttribute("maxx"),b.getAttribute("maxy"))},read_wmc_LayerList:function(a,b){a.layersContext=[];this.runChildNodes(a,b)},read_wmc_Layer:function(a,b){var c={visibility:"1"!=b.getAttribute("hidden"),queryable:"1"==b.getAttribute("queryable"),formats:[], +styles:[],metadata:{}};this.runChildNodes(c,b);a.layersContext.push(c)},read_wmc_Extension:function(a,b){this.runChildNodes(a,b)},read_ol_units:function(a,b){a.units=this.getChildValue(b)},read_ol_maxExtent:function(a,b){var c=new OpenLayers.Bounds(b.getAttribute("minx"),b.getAttribute("miny"),b.getAttribute("maxx"),b.getAttribute("maxy"));a.maxExtent=c},read_ol_transparent:function(a,b){a.transparent=this.getChildValue(b)},read_ol_numZoomLevels:function(a,b){a.numZoomLevels=parseInt(this.getChildValue(b))}, +read_ol_opacity:function(a,b){a.opacity=parseFloat(this.getChildValue(b))},read_ol_singleTile:function(a,b){a.singleTile="true"==this.getChildValue(b)},read_ol_tileSize:function(a,b){var c={width:b.getAttribute("width"),height:b.getAttribute("height")};a.tileSize=c},read_ol_isBaseLayer:function(a,b){a.isBaseLayer="true"==this.getChildValue(b)},read_ol_displayInLayerSwitcher:function(a,b){a.displayInLayerSwitcher="true"==this.getChildValue(b)},read_wmc_Server:function(a,b){a.version=b.getAttribute("version"); +a.url=this.getOnlineResource_href(b);a.metadata.servertitle=b.getAttribute("title")},read_wmc_FormatList:function(a,b){this.runChildNodes(a,b)},read_wmc_Format:function(a,b){var c={value:this.getChildValue(b)};"1"==b.getAttribute("current")&&(c.current=!0);a.formats.push(c)},read_wmc_StyleList:function(a,b){this.runChildNodes(a,b)},read_wmc_Style:function(a,b){var c={};this.runChildNodes(c,b);"1"==b.getAttribute("current")&&(c.current=!0);a.styles.push(c)},read_wmc_SLD:function(a,b){this.runChildNodes(a, +b)},read_sld_StyledLayerDescriptor:function(a,b){var c=OpenLayers.Format.XML.prototype.write.apply(this,[b]);a.body=c},read_sld_FeatureTypeStyle:function(a,b){var c=OpenLayers.Format.XML.prototype.write.apply(this,[b]);a.body=c},read_wmc_OnlineResource:function(a,b){a.href=this.getAttributeNS(b,this.namespaces.xlink,"href")},read_wmc_Name:function(a,b){var c=this.getChildValue(b);c&&(a.name=c)},read_wmc_Title:function(a,b){var c=this.getChildValue(b);c&&(a.title=c)},read_wmc_MetadataURL:function(a, +b){a.metadataURL=this.getOnlineResource_href(b)},read_wmc_KeywordList:function(a,b){a.keywords=[];this.runChildNodes(a.keywords,b)},read_wmc_Keyword:function(a,b){a.push(this.getChildValue(b))},read_wmc_Abstract:function(a,b){var c=this.getChildValue(b);c&&(a["abstract"]=c)},read_wmc_LogoURL:function(a,b){a.logo={width:b.getAttribute("width"),height:b.getAttribute("height"),format:b.getAttribute("format"),href:this.getOnlineResource_href(b)}},read_wmc_DescriptionURL:function(a,b){a.descriptionURL= +this.getOnlineResource_href(b)},read_wmc_ContactInformation:function(a,b){var c={};this.runChildNodes(c,b);a.contactInformation=c},read_wmc_ContactPersonPrimary:function(a,b){var c={};this.runChildNodes(c,b);a.personPrimary=c},read_wmc_ContactPerson:function(a,b){var c=this.getChildValue(b);c&&(a.person=c)},read_wmc_ContactOrganization:function(a,b){var c=this.getChildValue(b);c&&(a.organization=c)},read_wmc_ContactPosition:function(a,b){var c=this.getChildValue(b);c&&(a.position=c)},read_wmc_ContactAddress:function(a, +b){var c={};this.runChildNodes(c,b);a.contactAddress=c},read_wmc_AddressType:function(a,b){var c=this.getChildValue(b);c&&(a.type=c)},read_wmc_Address:function(a,b){var c=this.getChildValue(b);c&&(a.address=c)},read_wmc_City:function(a,b){var c=this.getChildValue(b);c&&(a.city=c)},read_wmc_StateOrProvince:function(a,b){var c=this.getChildValue(b);c&&(a.stateOrProvince=c)},read_wmc_PostCode:function(a,b){var c=this.getChildValue(b);c&&(a.postcode=c)},read_wmc_Country:function(a,b){var c=this.getChildValue(b); +c&&(a.country=c)},read_wmc_ContactVoiceTelephone:function(a,b){var c=this.getChildValue(b);c&&(a.phone=c)},read_wmc_ContactFacsimileTelephone:function(a,b){var c=this.getChildValue(b);c&&(a.fax=c)},read_wmc_ContactElectronicMailAddress:function(a,b){var c=this.getChildValue(b);c&&(a.email=c)},read_wmc_DataURL:function(a,b){a.dataURL=this.getOnlineResource_href(b)},read_wmc_LegendURL:function(a,b){var c={width:b.getAttribute("width"),height:b.getAttribute("height"),format:b.getAttribute("format"), +href:this.getOnlineResource_href(b)};a.legend=c},read_wmc_DimensionList:function(a,b){a.dimensions={};this.runChildNodes(a.dimensions,b)},read_wmc_Dimension:function(a,b){var c={name:b.getAttribute("name").toLowerCase(),units:b.getAttribute("units")||"",unitSymbol:b.getAttribute("unitSymbol")||"",userValue:b.getAttribute("userValue")||"",nearestValue:"1"===b.getAttribute("nearestValue"),multipleValues:"1"===b.getAttribute("multipleValues"),current:"1"===b.getAttribute("current"),"default":b.getAttribute("default")|| +""},d=this.getChildValue(b);c.values=d.split(",");a[c.name]=c},write:function(a,b){var c=this.createElementDefaultNS("ViewContext");this.setAttributes(c,{version:this.VERSION,id:b&&"string"==typeof b.id?b.id:OpenLayers.Util.createUniqueID("OpenLayers_Context_")});this.setAttributeNS(c,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);c.appendChild(this.write_wmc_General(a));c.appendChild(this.write_wmc_LayerList(a));return OpenLayers.Format.XML.prototype.write.apply(this,[c])},createElementDefaultNS:function(a, +b,c){a=this.createElementNS(this.namespaces[this.defaultPrefix],a);b&&a.appendChild(this.createTextNode(b));c&&this.setAttributes(a,c);return a},setAttributes:function(a,b){var c,d;for(d in b)c=b[d].toString(),c.match(/[A-Z]/)?this.setAttributeNS(a,null,d,c):a.setAttribute(d,c)},write_wmc_General:function(a){var b=this.createElementDefaultNS("General");a.size&&b.appendChild(this.createElementDefaultNS("Window",null,{width:a.size.w,height:a.size.h}));var c=a.bounds;b.appendChild(this.createElementDefaultNS("BoundingBox", +null,{minx:c.left.toPrecision(18),miny:c.bottom.toPrecision(18),maxx:c.right.toPrecision(18),maxy:c.top.toPrecision(18),SRS:a.projection}));b.appendChild(this.createElementDefaultNS("Title",a.title));a.keywords&&b.appendChild(this.write_wmc_KeywordList(a.keywords));a["abstract"]&&b.appendChild(this.createElementDefaultNS("Abstract",a["abstract"]));a.logo&&b.appendChild(this.write_wmc_URLType("LogoURL",a.logo.href,a.logo));a.descriptionURL&&b.appendChild(this.write_wmc_URLType("DescriptionURL",a.descriptionURL)); +a.contactInformation&&b.appendChild(this.write_wmc_ContactInformation(a.contactInformation));b.appendChild(this.write_ol_MapExtension(a));return b},write_wmc_KeywordList:function(a){for(var b=this.createElementDefaultNS("KeywordList"),c=0,d=a.length;c<d;c++)b.appendChild(this.createElementDefaultNS("Keyword",a[c]));return b},write_wmc_ContactInformation:function(a){var b=this.createElementDefaultNS("ContactInformation");a.personPrimary&&b.appendChild(this.write_wmc_ContactPersonPrimary(a.personPrimary)); +a.position&&b.appendChild(this.createElementDefaultNS("ContactPosition",a.position));a.contactAddress&&b.appendChild(this.write_wmc_ContactAddress(a.contactAddress));a.phone&&b.appendChild(this.createElementDefaultNS("ContactVoiceTelephone",a.phone));a.fax&&b.appendChild(this.createElementDefaultNS("ContactFacsimileTelephone",a.fax));a.email&&b.appendChild(this.createElementDefaultNS("ContactElectronicMailAddress",a.email));return b},write_wmc_ContactPersonPrimary:function(a){var b=this.createElementDefaultNS("ContactPersonPrimary"); +a.person&&b.appendChild(this.createElementDefaultNS("ContactPerson",a.person));a.organization&&b.appendChild(this.createElementDefaultNS("ContactOrganization",a.organization));return b},write_wmc_ContactAddress:function(a){var b=this.createElementDefaultNS("ContactAddress");a.type&&b.appendChild(this.createElementDefaultNS("AddressType",a.type));a.address&&b.appendChild(this.createElementDefaultNS("Address",a.address));a.city&&b.appendChild(this.createElementDefaultNS("City",a.city));a.stateOrProvince&& +b.appendChild(this.createElementDefaultNS("StateOrProvince",a.stateOrProvince));a.postcode&&b.appendChild(this.createElementDefaultNS("PostCode",a.postcode));a.country&&b.appendChild(this.createElementDefaultNS("Country",a.country));return b},write_ol_MapExtension:function(a){var b=this.createElementDefaultNS("Extension");if(a=a.maxExtent){var c=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(c,{minx:a.left.toPrecision(18),miny:a.bottom.toPrecision(18),maxx:a.right.toPrecision(18), +maxy:a.top.toPrecision(18)});b.appendChild(c)}return b},write_wmc_LayerList:function(a){for(var b=this.createElementDefaultNS("LayerList"),c=0,d=a.layersContext.length;c<d;++c)b.appendChild(this.write_wmc_Layer(a.layersContext[c]));return b},write_wmc_Layer:function(a){var b=this.createElementDefaultNS("Layer",null,{queryable:a.queryable?"1":"0",hidden:a.visibility?"0":"1"});b.appendChild(this.write_wmc_Server(a));b.appendChild(this.createElementDefaultNS("Name",a.name));b.appendChild(this.createElementDefaultNS("Title", +a.title));a["abstract"]&&b.appendChild(this.createElementDefaultNS("Abstract",a["abstract"]));a.dataURL&&b.appendChild(this.write_wmc_URLType("DataURL",a.dataURL));a.metadataURL&&b.appendChild(this.write_wmc_URLType("MetadataURL",a.metadataURL));return b},write_wmc_LayerExtension:function(a){var b=this.createElementDefaultNS("Extension"),c=a.maxExtent,d=this.createElementNS(this.namespaces.ol,"ol:maxExtent");this.setAttributes(d,{minx:c.left.toPrecision(18),miny:c.bottom.toPrecision(18),maxx:c.right.toPrecision(18), +maxy:c.top.toPrecision(18)});b.appendChild(d);a.tileSize&&!a.singleTile&&(c=this.createElementNS(this.namespaces.ol,"ol:tileSize"),this.setAttributes(c,a.tileSize),b.appendChild(c));for(var c="transparent numZoomLevels units isBaseLayer opacity displayInLayerSwitcher singleTile".split(" "),e=0,f=c.length;e<f;++e)(d=this.createOLPropertyNode(a,c[e]))&&b.appendChild(d);return b},createOLPropertyNode:function(a,b){var c=null;null!=a[b]&&(c=this.createElementNS(this.namespaces.ol,"ol:"+b),c.appendChild(this.createTextNode(a[b].toString()))); +return c},write_wmc_Server:function(a){a=a.server;var b=this.createElementDefaultNS("Server"),c={service:"OGC:WMS",version:a.version};a.title&&(c.title=a.title);this.setAttributes(b,c);b.appendChild(this.write_wmc_OnlineResource(a.url));return b},write_wmc_URLType:function(a,b,c){a=this.createElementDefaultNS(a);a.appendChild(this.write_wmc_OnlineResource(b));if(c){b=["width","height","format"];for(var d=0;d<b.length;d++)b[d]in c&&a.setAttribute(b[d],c[b[d]])}return a},write_wmc_DimensionList:function(a){var b= +this.createElementDefaultNS("DimensionList"),c;for(c in a.dimensions){var d={},e=a.dimensions[c],f;for(f in e)d[f]="boolean"==typeof e[f]?Number(e[f]):e[f];e="";d.values&&(e=d.values.join(","),delete d.values);b.appendChild(this.createElementDefaultNS("Dimension",e,d))}return b},write_wmc_FormatList:function(a){for(var b=this.createElementDefaultNS("FormatList"),c=0,d=a.formats.length;c<d;c++){var e=a.formats[c];b.appendChild(this.createElementDefaultNS("Format",e.value,e.current&&!0==e.current?{current:"1"}: +null))}return b},write_wmc_StyleList:function(a){var b=this.createElementDefaultNS("StyleList");if((a=a.styles)&&OpenLayers.Util.isArray(a))for(var c,d=0,e=a.length;d<e;d++){var f=a[d],g=this.createElementDefaultNS("Style",null,f.current&&!0==f.current?{current:"1"}:null);f.href?(c=this.createElementDefaultNS("SLD"),f.name&&c.appendChild(this.createElementDefaultNS("Name",f.name)),f.title&&c.appendChild(this.createElementDefaultNS("Title",f.title)),f.legend&&c.appendChild(this.write_wmc_URLType("LegendURL", +f.legend.href,f.legend)),f=this.write_wmc_OnlineResource(f.href),c.appendChild(f),g.appendChild(c)):f.body?(c=this.createElementDefaultNS("SLD"),f.name&&c.appendChild(this.createElementDefaultNS("Name",f.name)),f.title&&c.appendChild(this.createElementDefaultNS("Title",f.title)),f.legend&&c.appendChild(this.write_wmc_URLType("LegendURL",f.legend.href,f.legend)),f=OpenLayers.Format.XML.prototype.read.apply(this,[f.body]).documentElement,c.ownerDocument&&c.ownerDocument.importNode&&(f=c.ownerDocument.importNode(f, +!0)),c.appendChild(f),g.appendChild(c)):(g.appendChild(this.createElementDefaultNS("Name",f.name)),g.appendChild(this.createElementDefaultNS("Title",f.title)),f["abstract"]&&g.appendChild(this.createElementDefaultNS("Abstract",f["abstract"])),f.legend&&g.appendChild(this.write_wmc_URLType("LegendURL",f.legend.href,f.legend)));b.appendChild(g)}return b},write_wmc_OnlineResource:function(a){var b=this.createElementDefaultNS("OnlineResource");this.setAttributeNS(b,this.namespaces.xlink,"xlink:type", +"simple");this.setAttributeNS(b,this.namespaces.xlink,"xlink:href",a);return b},getOnlineResource_href:function(a){var b={};a=a.getElementsByTagName("OnlineResource");0<a.length&&this.read_wmc_OnlineResource(b,a[0]);return b.href},CLASS_NAME:"OpenLayers.Format.WMC.v1"});OpenLayers.Control.PanPanel=OpenLayers.Class(OpenLayers.Control.Panel,{slideFactor:50,slideRatio:null,initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);a={slideFactor:this.slideFactor,slideRatio:this.slideRatio};this.addControls([new OpenLayers.Control.Pan(OpenLayers.Control.Pan.NORTH,a),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.SOUTH,a),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.EAST,a),new OpenLayers.Control.Pan(OpenLayers.Control.Pan.WEST,a)])}, +CLASS_NAME:"OpenLayers.Control.PanPanel"});OpenLayers.Control.Attribution=OpenLayers.Class(OpenLayers.Control,{separator:", ",template:"${layers}",destroy:function(){this.map.events.un({removelayer:this.updateAttribution,addlayer:this.updateAttribution,changelayer:this.updateAttribution,changebaselayer:this.updateAttribution,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.map.events.on({changebaselayer:this.updateAttribution,changelayer:this.updateAttribution, +addlayer:this.updateAttribution,removelayer:this.updateAttribution,scope:this});this.updateAttribution();return this.div},updateAttribution:function(){var a=[];if(this.map&&this.map.layers){for(var b=0,c=this.map.layers.length;b<c;b++){var d=this.map.layers[b];d.attribution&&d.getVisibility()&&-1===OpenLayers.Util.indexOf(a,d.attribution)&&a.push(d.attribution)}this.div.innerHTML=OpenLayers.String.format(this.template,{layers:a.join(this.separator)})}},CLASS_NAME:"OpenLayers.Control.Attribution"});OpenLayers.Kinetic=OpenLayers.Class({threshold:0,deceleration:0.0035,nbPoints:100,delay:200,points:void 0,timerId:void 0,initialize:function(a){OpenLayers.Util.extend(this,a)},begin:function(){OpenLayers.Animation.stop(this.timerId);this.timerId=void 0;this.points=[]},update:function(a){this.points.unshift({xy:a,tick:(new Date).getTime()});this.points.length>this.nbPoints&&this.points.pop()},end:function(a){for(var b,c=(new Date).getTime(),d=0,e=this.points.length,f;d<e;d++){f=this.points[d];if(c- +f.tick>this.delay)break;b=f}if(b&&(d=(new Date).getTime()-b.tick,c=Math.sqrt(Math.pow(a.x-b.xy.x,2)+Math.pow(a.y-b.xy.y,2)),d=c/d,!(0==d||d<this.threshold)))return c=Math.asin((a.y-b.xy.y)/c),b.xy.x<=a.x&&(c=Math.PI-c),{speed:d,theta:c}},move:function(a,b){var c=a.speed,d=Math.cos(a.theta),e=-Math.sin(a.theta),f=(new Date).getTime(),g=0,h=0;this.timerId=OpenLayers.Animation.start(OpenLayers.Function.bind(function(){if(null!=this.timerId){var a=(new Date).getTime()-f,l=-this.deceleration*Math.pow(a, +2)/2+c*a,m=l*d,l=l*e,n,p;n=!1;0>=-this.deceleration*a+c&&(OpenLayers.Animation.stop(this.timerId),this.timerId=null,n=!0);a=m-g;p=l-h;g=m;h=l;b(a,p,n)}},this))},CLASS_NAME:"OpenLayers.Kinetic"});OpenLayers.Format.WPSExecute=OpenLayers.Class(OpenLayers.Format.XML,OpenLayers.Format.Filter.v1_1_0,{namespaces:{ows:"http://www.opengis.net/ows/1.1",gml:"http://www.opengis.net/gml",wps:"http://www.opengis.net/wps/1.0.0",wfs:"http://www.opengis.net/wfs",ogc:"http://www.opengis.net/ogc",wcs:"http://www.opengis.net/wcs",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.0.0", +schemaLocation:"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",schemaLocationAttr:function(a){},write:function(a){var b;window.ActiveXObject?this.xmldom=b=new ActiveXObject("Microsoft.XMLDOM"):b=document.implementation.createDocument("","",null);a=this.writeNode("wps:Execute",a,b);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[a])},read:function(a){"string"==typeof a&&(a= +OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b},writers:{wps:{Execute:function(a){var b=this.createElementNSPlus("wps:Execute",{attributes:{version:this.VERSION,service:"WPS"}});this.writeNode("ows:Identifier",a.identifier,b);this.writeNode("wps:DataInputs",a.dataInputs,b);this.writeNode("wps:ResponseForm",a.responseForm,b);return b},ResponseForm:function(a){var b=this.createElementNSPlus("wps:ResponseForm",{});a.rawDataOutput&& +this.writeNode("wps:RawDataOutput",a.rawDataOutput,b);a.responseDocument&&this.writeNode("wps:ResponseDocument",a.responseDocument,b);return b},ResponseDocument:function(a){var b=this.createElementNSPlus("wps:ResponseDocument",{attributes:{storeExecuteResponse:a.storeExecuteResponse,lineage:a.lineage,status:a.status}});if(a.outputs)for(var c=0,d=a.outputs.length;c<d;c++)this.writeNode("wps:Output",a.outputs[c],b);return b},Output:function(a){var b=this.createElementNSPlus("wps:Output",{attributes:{asReference:a.asReference, +mimeType:a.mimeType,encoding:a.encoding,schema:a.schema}});this.writeNode("ows:Identifier",a.identifier,b);this.writeNode("ows:Title",a.title,b);this.writeNode("ows:Abstract",a["abstract"],b);return b},RawDataOutput:function(a){var b=this.createElementNSPlus("wps:RawDataOutput",{attributes:{mimeType:a.mimeType,encoding:a.encoding,schema:a.schema}});this.writeNode("ows:Identifier",a.identifier,b);return b},DataInputs:function(a){for(var b=this.createElementNSPlus("wps:DataInputs",{}),c=0,d=a.length;c< +d;++c)this.writeNode("wps:Input",a[c],b);return b},Input:function(a){var b=this.createElementNSPlus("wps:Input",{});this.writeNode("ows:Identifier",a.identifier,b);a.title&&this.writeNode("ows:Title",a.title,b);a.data&&this.writeNode("wps:Data",a.data,b);a.reference&&this.writeNode("wps:Reference",a.reference,b);a.boundingBoxData&&this.writeNode("wps:BoundingBoxData",a.boundingBoxData,b);return b},Data:function(a){var b=this.createElementNSPlus("wps:Data",{});a.literalData?this.writeNode("wps:LiteralData", +a.literalData,b):a.complexData?this.writeNode("wps:ComplexData",a.complexData,b):a.boundingBoxData&&this.writeNode("ows:BoundingBox",a.boundingBoxData,b);return b},LiteralData:function(a){return this.createElementNSPlus("wps:LiteralData",{attributes:{uom:a.uom},value:a.value})},ComplexData:function(a){var b=this.createElementNSPlus("wps:ComplexData",{attributes:{mimeType:a.mimeType,encoding:a.encoding,schema:a.schema}}),c=a.value;"string"===typeof c?b.appendChild(this.getXMLDoc().createCDATASection(a.value)): +b.appendChild(c);return b},Reference:function(a){var b=this.createElementNSPlus("wps:Reference",{attributes:{mimeType:a.mimeType,"xlink:href":a.href,method:a.method,encoding:a.encoding,schema:a.schema}});a.body&&this.writeNode("wps:Body",a.body,b);return b},BoundingBoxData:function(a,b){this.writers.ows.BoundingBox.apply(this,[a,b,"wps:BoundingBoxData"])},Body:function(a){var b=this.createElementNSPlus("wps:Body",{});a.wcs?this.writeNode("wcs:GetCoverage",a.wcs,b):a.wfs?(this.featureType=a.wfs.featureType, +this.version=a.wfs.version,this.writeNode("wfs:GetFeature",a.wfs,b)):this.writeNode("wps:Execute",a,b);return b}},wcs:OpenLayers.Format.WCSGetCoverage.prototype.writers.wcs,wfs:OpenLayers.Format.WFST.v1_1_0.prototype.writers.wfs,ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc,ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.writers.ows},readers:{wps:{ExecuteResponse:function(a,b){b.executeResponse={lang:a.getAttribute("lang"),statusLocation:a.getAttribute("statusLocation"),serviceInstance:a.getAttribute("serviceInstance"), +service:a.getAttribute("service")};this.readChildNodes(a,b.executeResponse)},Process:function(a,b){b.process={};this.readChildNodes(a,b.process)},Status:function(a,b){b.status={creationTime:a.getAttribute("creationTime")};this.readChildNodes(a,b.status)},ProcessSucceeded:function(a,b){b.processSucceeded=!0},ProcessOutputs:function(a,b){b.processOutputs=[];this.readChildNodes(a,b.processOutputs)},Output:function(a,b){var c={};this.readChildNodes(a,c);b.push(c)},Reference:function(a,b){b.reference= +{href:a.getAttribute("href"),mimeType:a.getAttribute("mimeType"),encoding:a.getAttribute("encoding"),schema:a.getAttribute("schema")}},Data:function(a,b){b.data={};this.readChildNodes(a,b)},LiteralData:function(a,b){b.literalData={dataType:a.getAttribute("dataType"),uom:a.getAttribute("uom"),value:this.getChildValue(a)}},ComplexData:function(a,b){b.complexData={mimeType:a.getAttribute("mimeType"),schema:a.getAttribute("schema"),encoding:a.getAttribute("encoding"),value:""};if(this.isSimpleContent(a)){var c; +for(c=a.firstChild;c;c=c.nextSibling)switch(c.nodeType){case 3:case 4:b.complexData.value+=c.nodeValue}}else for(c=a.firstChild;c;c=c.nextSibling)1==c.nodeType&&(b.complexData.value=c)},BoundingBox:function(a,b){b.boundingBoxData={dimensions:a.getAttribute("dimensions"),crs:a.getAttribute("crs")};this.readChildNodes(a,b.boundingBoxData)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSExecute"});OpenLayers.Layer.GeoRSS=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,icon:null,popupSize:null,useFeedTitle:!0,initialize:function(a,b,c){OpenLayers.Layer.Markers.prototype.initialize.apply(this,[a,c]);this.location=b;this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadRSS:function(){this.loaded||(this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.location, +success:this.parseData,scope:this}),this.loaded=!0)},moveTo:function(a,b,c){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);this.visibility&&!this.loaded&&this.loadRSS()},parseData:function(a){var b=a.responseXML;b&&b.documentElement||(b=OpenLayers.Format.XML.prototype.read(a.responseText));if(this.useFeedTitle){a=null;try{a=b.getElementsByTagNameNS("*","title")[0].firstChild.nodeValue}catch(c){a=b.getElementsByTagName("title")[0].firstChild.nodeValue}a&&this.setName(a)}a={};OpenLayers.Util.extend(a, +this.formatOptions);this.map&&!this.projection.equals(this.map.getProjectionObject())&&(a.externalProjection=this.projection,a.internalProjection=this.map.getProjectionObject());b=(new OpenLayers.Format.GeoRSS(a)).read(b);a=0;for(var d=b.length;a<d;a++){var e={},f=b[a];if(f.geometry){var g=f.attributes.title?f.attributes.title:"Untitled",h=f.attributes.description?f.attributes.description:"No description.",k=f.attributes.link?f.attributes.link:"",f=f.geometry.getBounds().getCenterLonLat();e.icon= +null==this.icon?OpenLayers.Marker.defaultIcon():this.icon.clone();e.popupSize=this.popupSize?this.popupSize.clone():new OpenLayers.Size(250,120);if(g||h){e.title=g;e.description=h;var l='<div class="olLayerGeoRSSClose">[x]</div>',l=l+'<div class="olLayerGeoRSSTitle">';k&&(l+='<a class="link" href="'+k+'" target="_blank">');l+=g;k&&(l+="</a>");l+="</div>";l+='<div style="" class="olLayerGeoRSSDescription">';l+=h;l+="</div>";e.popupContentHTML=l}f=new OpenLayers.Feature(this,f,e);this.features.push(f); +e=f.createMarker();e.events.register("click",f,this.markerClick);this.addMarker(e)}}this.events.triggerEvent("loadend")},markerClick:function(a){var b=this==this.layer.selectedFeature;this.layer.selectedFeature=b?null:this;for(var c=0,d=this.layer.map.popups.length;c<d;c++)this.layer.map.removePopup(this.layer.map.popups[c]);b||(b=this.createPopup(),OpenLayers.Event.observe(b.div,"click",OpenLayers.Function.bind(function(){for(var a=0,b=this.layer.map.popups.length;a<b;a++)this.layer.map.removePopup(this.layer.map.popups[a])}, +this)),this.layer.map.addPopup(b));OpenLayers.Event.stop(a)},clearFeatures:function(){if(null!=this.features)for(;0<this.features.length;){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}},CLASS_NAME:"OpenLayers.Layer.GeoRSS"});OpenLayers.Symbolizer.Point=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(a){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Point"});OpenLayers.Symbolizer.Line=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(a){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Line"});OpenLayers.Symbolizer.Text=OpenLayers.Class(OpenLayers.Symbolizer,{initialize:function(a){OpenLayers.Symbolizer.prototype.initialize.apply(this,arguments)},CLASS_NAME:"OpenLayers.Symbolizer.Text"});OpenLayers.Format.SLD.v1=OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0,{namespaces:{sld:"http://www.opengis.net/sld",ogc:"http://www.opengis.net/ogc",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"sld",schemaLocation:null,multipleSymbolizers:!1,featureTypeCounter:null,defaultSymbolizer:{fillColor:"#808080",fillOpacity:1,strokeColor:"#000000",strokeOpacity:1,strokeWidth:1,strokeDashstyle:"solid",pointRadius:3, +graphicName:"square"},read:function(a,b){b=OpenLayers.Util.applyDefaults(b,this.options);var c={namedLayers:!0===b.namedLayersAsArray?[]:{}};this.readChildNodes(a,c);return c},readers:OpenLayers.Util.applyDefaults({sld:{StyledLayerDescriptor:function(a,b){b.version=a.getAttribute("version");this.readChildNodes(a,b)},Name:function(a,b){b.name=this.getChildValue(a)},Title:function(a,b){b.title=this.getChildValue(a)},Abstract:function(a,b){b.description=this.getChildValue(a)},NamedLayer:function(a,b){var c= +{userStyles:[],namedStyles:[]};this.readChildNodes(a,c);for(var d=0,e=c.userStyles.length;d<e;++d)c.userStyles[d].layerName=c.name;OpenLayers.Util.isArray(b.namedLayers)?b.namedLayers.push(c):b.namedLayers[c.name]=c},NamedStyle:function(a,b){b.namedStyles.push(this.getChildName(a.firstChild))},UserStyle:function(a,b){var c={defaultsPerSymbolizer:!0,rules:[]};this.featureTypeCounter=-1;this.readChildNodes(a,c);this.multipleSymbolizers?(delete c.defaultsPerSymbolizer,c=new OpenLayers.Style2(c)):c=new OpenLayers.Style(this.defaultSymbolizer, +c);b.userStyles.push(c)},IsDefault:function(a,b){"1"==this.getChildValue(a)&&(b.isDefault=!0)},FeatureTypeStyle:function(a,b){++this.featureTypeCounter;var c={rules:this.multipleSymbolizers?b.rules:[]};this.readChildNodes(a,c);this.multipleSymbolizers||(b.rules=c.rules)},Rule:function(a,b){var c;this.multipleSymbolizers&&(c={symbolizers:[]});c=new OpenLayers.Rule(c);this.readChildNodes(a,c);b.rules.push(c)},ElseFilter:function(a,b){b.elseFilter=!0},MinScaleDenominator:function(a,b){b.minScaleDenominator= +parseFloat(this.getChildValue(a))},MaxScaleDenominator:function(a,b){b.maxScaleDenominator=parseFloat(this.getChildValue(a))},TextSymbolizer:function(a,b){var c={};this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Text(c))):b.symbolizer.Text=OpenLayers.Util.applyDefaults(c,b.symbolizer.Text)},LabelPlacement:function(a,b){this.readChildNodes(a,b)},PointPlacement:function(a,b){var c={};this.readChildNodes(a,c);c.labelRotation= +c.rotation;delete c.rotation;var d,e=b.labelAnchorPointX,f=b.labelAnchorPointY;e<=1/3?d="l":e>1/3&&e<2/3?d="c":e>=2/3&&(d="r");f<=1/3?d+="b":f>1/3&&f<2/3?d+="m":f>=2/3&&(d+="t");c.labelAlign=d;OpenLayers.Util.applyDefaults(b,c)},AnchorPoint:function(a,b){this.readChildNodes(a,b)},AnchorPointX:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelAnchorPointX=c)},AnchorPointY:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelAnchorPointY=c)},Displacement:function(a, +b){this.readChildNodes(a,b)},DisplacementX:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelXOffset=c)},DisplacementY:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelYOffset=c)},LinePlacement:function(a,b){this.readChildNodes(a,b)},PerpendicularOffset:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.labelPerpendicularOffset=c)},Label:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.label=c)},Font:function(a,b){this.readChildNodes(a, +b)},Halo:function(a,b){var c={};this.readChildNodes(a,c);b.haloRadius=c.haloRadius;b.haloColor=c.fillColor;b.haloOpacity=c.fillOpacity},Radius:function(a,b){var c=this.readers.ogc._expression.call(this,a);null!=c&&(b.haloRadius=c)},RasterSymbolizer:function(a,b){var c={};this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Raster(c))):b.symbolizer.Raster=OpenLayers.Util.applyDefaults(c,b.symbolizer.Raster)},Geometry:function(a, +b){b.geometry={};this.readChildNodes(a,b.geometry)},ColorMap:function(a,b){b.colorMap=[];this.readChildNodes(a,b.colorMap)},ColorMapEntry:function(a,b){var c=a.getAttribute("quantity"),d=a.getAttribute("opacity");b.push({color:a.getAttribute("color"),quantity:null!==c?parseFloat(c):void 0,label:a.getAttribute("label")||void 0,opacity:null!==d?parseFloat(d):void 0})},LineSymbolizer:function(a,b){var c={};this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Line(c))): +b.symbolizer.Line=OpenLayers.Util.applyDefaults(c,b.symbolizer.Line)},PolygonSymbolizer:function(a,b){var c={fill:!1,stroke:!1};this.multipleSymbolizers||(c=b.symbolizer.Polygon||c);this.readChildNodes(a,c);this.multipleSymbolizers?(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Polygon(c))):b.symbolizer.Polygon=c},PointSymbolizer:function(a,b){var c={fill:!1,stroke:!1,graphic:!1};this.multipleSymbolizers||(c=b.symbolizer.Point||c);this.readChildNodes(a,c);this.multipleSymbolizers? +(c.zIndex=this.featureTypeCounter,b.symbolizers.push(new OpenLayers.Symbolizer.Point(c))):b.symbolizer.Point=c},Stroke:function(a,b){b.stroke=!0;this.readChildNodes(a,b)},Fill:function(a,b){b.fill=!0;this.readChildNodes(a,b)},CssParameter:function(a,b){var c=a.getAttribute("name"),d=this.cssMap[c];b.label&&("fill"===c?d="fontColor":"fill-opacity"===c&&(d="fontOpacity"));d&&(c=this.readers.ogc._expression.call(this,a))&&(b[d]=c)},Graphic:function(a,b){b.graphic=!0;var c={};this.readChildNodes(a,c); +for(var d="stroke strokeColor strokeWidth strokeOpacity strokeLinecap fill fillColor fillOpacity graphicName rotation graphicFormat".split(" "),e,f,g=0,h=d.length;g<h;++g)e=d[g],f=c[e],void 0!=f&&(b[e]=f);void 0!=c.opacity&&(b.graphicOpacity=c.opacity);void 0!=c.size&&(isNaN(c.size/2)?b.graphicWidth=c.size:b.pointRadius=c.size/2);void 0!=c.href&&(b.externalGraphic=c.href);void 0!=c.rotation&&(b.rotation=c.rotation)},ExternalGraphic:function(a,b){this.readChildNodes(a,b)},Mark:function(a,b){this.readChildNodes(a, +b)},WellKnownName:function(a,b){b.graphicName=this.getChildValue(a)},Opacity:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.opacity=c)},Size:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.size=c)},Rotation:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.rotation=c)},OnlineResource:function(a,b){b.href=this.getAttributeNS(a,this.namespaces.xlink,"href")},Format:function(a,b){b.graphicFormat=this.getChildValue(a)}}},OpenLayers.Format.Filter.v1_0_0.prototype.readers), +cssMap:{stroke:"strokeColor","stroke-opacity":"strokeOpacity","stroke-width":"strokeWidth","stroke-linecap":"strokeLinecap","stroke-dasharray":"strokeDashstyle",fill:"fillColor","fill-opacity":"fillOpacity","font-family":"fontFamily","font-size":"fontSize","font-weight":"fontWeight","font-style":"fontStyle"},getCssProperty:function(a){var b=null,c;for(c in this.cssMap)if(this.cssMap[c]==a){b=c;break}return b},getGraphicFormat:function(a){var b,c;for(c in this.graphicFormats)if(this.graphicFormats[c].test(a)){b= +c;break}return b||this.defaultGraphicFormat},defaultGraphicFormat:"image/png",graphicFormats:{"image/jpeg":/\.jpe?g$/i,"image/gif":/\.gif$/i,"image/png":/\.png$/i},write:function(a){return this.writers.sld.StyledLayerDescriptor.apply(this,[a])},writers:OpenLayers.Util.applyDefaults({sld:{_OGCExpression:function(a,b){var c=this.createElementNSPlus(a),d="string"==typeof b?b.split("${"):[b];c.appendChild(this.createTextNode(d[0]));for(var e,f,g=1,h=d.length;g<h;g++)e=d[g],f=e.indexOf("}"),0<f?(this.writeNode("ogc:PropertyName", +{property:e.substring(0,f)},c),c.appendChild(this.createTextNode(e.substring(++f)))):c.appendChild(this.createTextNode("${"+e));return c},StyledLayerDescriptor:function(a){var b=this.createElementNSPlus("sld:StyledLayerDescriptor",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}});b.setAttribute("xmlns:ogc",this.namespaces.ogc);b.setAttribute("xmlns:gml",this.namespaces.gml);a.name&&this.writeNode("Name",a.name,b);a.title&&this.writeNode("Title",a.title,b);a.description&& +this.writeNode("Abstract",a.description,b);if(OpenLayers.Util.isArray(a.namedLayers))for(var c=0,d=a.namedLayers.length;c<d;++c)this.writeNode("NamedLayer",a.namedLayers[c],b);else for(c in a.namedLayers)this.writeNode("NamedLayer",a.namedLayers[c],b);return b},Name:function(a){return this.createElementNSPlus("sld:Name",{value:a})},Title:function(a){return this.createElementNSPlus("sld:Title",{value:a})},Abstract:function(a){return this.createElementNSPlus("sld:Abstract",{value:a})},NamedLayer:function(a){var b= +this.createElementNSPlus("sld:NamedLayer");this.writeNode("Name",a.name,b);if(a.namedStyles)for(var c=0,d=a.namedStyles.length;c<d;++c)this.writeNode("NamedStyle",a.namedStyles[c],b);if(a.userStyles)for(c=0,d=a.userStyles.length;c<d;++c)this.writeNode("UserStyle",a.userStyles[c],b);return b},NamedStyle:function(a){var b=this.createElementNSPlus("sld:NamedStyle");this.writeNode("Name",a,b);return b},UserStyle:function(a){var b=this.createElementNSPlus("sld:UserStyle");a.name&&this.writeNode("Name", +a.name,b);a.title&&this.writeNode("Title",a.title,b);a.description&&this.writeNode("Abstract",a.description,b);a.isDefault&&this.writeNode("IsDefault",a.isDefault,b);if(this.multipleSymbolizers&&a.rules){for(var c={0:[]},d=[0],e,f,g,h,k,l=0,m=a.rules.length;l<m;++l)if(e=a.rules[l],e.symbolizers){f={};for(var n=0,p=e.symbolizers.length;n<p;++n)g=e.symbolizers[n],h=g.zIndex,h in f||(k=e.clone(),k.symbolizers=[],f[h]=k),f[h].symbolizers.push(g.clone());for(h in f)h in c||(d.push(h),c[h]=[]),c[h].push(f[h])}else c[0].push(e.clone()); +d.sort();l=0;for(m=d.length;l<m;++l)e=c[d[l]],0<e.length&&(k=a.clone(),k.rules=c[d[l]],this.writeNode("FeatureTypeStyle",k,b))}else this.writeNode("FeatureTypeStyle",a,b);return b},IsDefault:function(a){return this.createElementNSPlus("sld:IsDefault",{value:a?"1":"0"})},FeatureTypeStyle:function(a){for(var b=this.createElementNSPlus("sld:FeatureTypeStyle"),c=0,d=a.rules.length;c<d;++c)this.writeNode("Rule",a.rules[c],b);return b},Rule:function(a){var b=this.createElementNSPlus("sld:Rule");a.name&& +this.writeNode("Name",a.name,b);a.title&&this.writeNode("Title",a.title,b);a.description&&this.writeNode("Abstract",a.description,b);a.elseFilter?this.writeNode("ElseFilter",null,b):a.filter&&this.writeNode("ogc:Filter",a.filter,b);void 0!=a.minScaleDenominator&&this.writeNode("MinScaleDenominator",a.minScaleDenominator,b);void 0!=a.maxScaleDenominator&&this.writeNode("MaxScaleDenominator",a.maxScaleDenominator,b);var c,d;if(this.multipleSymbolizers&&a.symbolizers)for(var e=0,f=a.symbolizers.length;e< +f;++e)d=a.symbolizers[e],c=d.CLASS_NAME.split(".").pop(),this.writeNode(c+"Symbolizer",d,b);else for(var f=OpenLayers.Style.SYMBOLIZER_PREFIXES,e=0,g=f.length;e<g;++e)c=f[e],(d=a.symbolizer[c])&&this.writeNode(c+"Symbolizer",d,b);return b},ElseFilter:function(){return this.createElementNSPlus("sld:ElseFilter")},MinScaleDenominator:function(a){return this.createElementNSPlus("sld:MinScaleDenominator",{value:a})},MaxScaleDenominator:function(a){return this.createElementNSPlus("sld:MaxScaleDenominator", +{value:a})},LineSymbolizer:function(a){var b=this.createElementNSPlus("sld:LineSymbolizer");this.writeNode("Stroke",a,b);return b},Stroke:function(a){var b=this.createElementNSPlus("sld:Stroke");void 0!=a.strokeColor&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeColor"},b);void 0!=a.strokeOpacity&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeOpacity"},b);void 0!=a.strokeWidth&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeWidth"},b);void 0!=a.strokeDashstyle&&"solid"!== +a.strokeDashstyle&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeDashstyle"},b);void 0!=a.strokeLinecap&&this.writeNode("CssParameter",{symbolizer:a,key:"strokeLinecap"},b);return b},CssParameter:function(a){return this.createElementNSPlus("sld:CssParameter",{attributes:{name:this.getCssProperty(a.key)},value:a.symbolizer[a.key]})},TextSymbolizer:function(a){var b=this.createElementNSPlus("sld:TextSymbolizer");null!=a.label&&this.writeNode("Label",a.label,b);null==a.fontFamily&&null==a.fontSize&& +null==a.fontWeight&&null==a.fontStyle||this.writeNode("Font",a,b);null==a.labelAnchorPointX&&null==a.labelAnchorPointY&&null==a.labelAlign&&null==a.labelXOffset&&null==a.labelYOffset&&null==a.labelRotation&&null==a.labelPerpendicularOffset||this.writeNode("LabelPlacement",a,b);null==a.haloRadius&&null==a.haloColor&&null==a.haloOpacity||this.writeNode("Halo",a,b);null==a.fontColor&&null==a.fontOpacity||this.writeNode("Fill",{fillColor:a.fontColor,fillOpacity:a.fontOpacity},b);return b},LabelPlacement:function(a){var b= +this.createElementNSPlus("sld:LabelPlacement");null==a.labelAnchorPointX&&null==a.labelAnchorPointY&&null==a.labelAlign&&null==a.labelXOffset&&null==a.labelYOffset&&null==a.labelRotation||null!=a.labelPerpendicularOffset||this.writeNode("PointPlacement",a,b);null!=a.labelPerpendicularOffset&&this.writeNode("LinePlacement",a,b);return b},LinePlacement:function(a){var b=this.createElementNSPlus("sld:LinePlacement");this.writeNode("PerpendicularOffset",a.labelPerpendicularOffset,b);return b},PerpendicularOffset:function(a){return this.createElementNSPlus("sld:PerpendicularOffset", +{value:a})},PointPlacement:function(a){var b=this.createElementNSPlus("sld:PointPlacement");null==a.labelAnchorPointX&&null==a.labelAnchorPointY&&null==a.labelAlign||this.writeNode("AnchorPoint",a,b);null==a.labelXOffset&&null==a.labelYOffset||this.writeNode("Displacement",a,b);null!=a.labelRotation&&this.writeNode("Rotation",a.labelRotation,b);return b},AnchorPoint:function(a){var b=this.createElementNSPlus("sld:AnchorPoint"),c=a.labelAnchorPointX,d=a.labelAnchorPointY;null!=c&&this.writeNode("AnchorPointX", +c,b);null!=d&&this.writeNode("AnchorPointY",d,b);if(null==c&&null==d){var e=a.labelAlign.substr(0,1);a=a.labelAlign.substr(1,1);"l"===e?c=0:"c"===e?c=0.5:"r"===e&&(c=1);"b"===a?d=0:"m"===a?d=0.5:"t"===a&&(d=1);this.writeNode("AnchorPointX",c,b);this.writeNode("AnchorPointY",d,b)}return b},AnchorPointX:function(a){return this.createElementNSPlus("sld:AnchorPointX",{value:a})},AnchorPointY:function(a){return this.createElementNSPlus("sld:AnchorPointY",{value:a})},Displacement:function(a){var b=this.createElementNSPlus("sld:Displacement"); +null!=a.labelXOffset&&this.writeNode("DisplacementX",a.labelXOffset,b);null!=a.labelYOffset&&this.writeNode("DisplacementY",a.labelYOffset,b);return b},DisplacementX:function(a){return this.createElementNSPlus("sld:DisplacementX",{value:a})},DisplacementY:function(a){return this.createElementNSPlus("sld:DisplacementY",{value:a})},Font:function(a){var b=this.createElementNSPlus("sld:Font");a.fontFamily&&this.writeNode("CssParameter",{symbolizer:a,key:"fontFamily"},b);a.fontSize&&this.writeNode("CssParameter", +{symbolizer:a,key:"fontSize"},b);a.fontWeight&&this.writeNode("CssParameter",{symbolizer:a,key:"fontWeight"},b);a.fontStyle&&this.writeNode("CssParameter",{symbolizer:a,key:"fontStyle"},b);return b},Label:function(a){return this.writers.sld._OGCExpression.call(this,"sld:Label",a)},Halo:function(a){var b=this.createElementNSPlus("sld:Halo");a.haloRadius&&this.writeNode("Radius",a.haloRadius,b);(a.haloColor||a.haloOpacity)&&this.writeNode("Fill",{fillColor:a.haloColor,fillOpacity:a.haloOpacity},b); +return b},Radius:function(a){return this.createElementNSPlus("sld:Radius",{value:a})},RasterSymbolizer:function(a){var b=this.createElementNSPlus("sld:RasterSymbolizer");a.geometry&&this.writeNode("Geometry",a.geometry,b);a.opacity&&this.writeNode("Opacity",a.opacity,b);a.colorMap&&this.writeNode("ColorMap",a.colorMap,b);return b},Geometry:function(a){var b=this.createElementNSPlus("sld:Geometry");a.property&&this.writeNode("ogc:PropertyName",a,b);return b},ColorMap:function(a){for(var b=this.createElementNSPlus("sld:ColorMap"), +c=0,d=a.length;c<d;++c)this.writeNode("ColorMapEntry",a[c],b);return b},ColorMapEntry:function(a){var b=this.createElementNSPlus("sld:ColorMapEntry");b.setAttribute("color",a.color);void 0!==a.opacity&&b.setAttribute("opacity",parseFloat(a.opacity));void 0!==a.quantity&&b.setAttribute("quantity",parseFloat(a.quantity));void 0!==a.label&&b.setAttribute("label",a.label);return b},PolygonSymbolizer:function(a){var b=this.createElementNSPlus("sld:PolygonSymbolizer");!1!==a.fill&&this.writeNode("Fill", +a,b);!1!==a.stroke&&this.writeNode("Stroke",a,b);return b},Fill:function(a){var b=this.createElementNSPlus("sld:Fill");a.fillColor&&this.writeNode("CssParameter",{symbolizer:a,key:"fillColor"},b);null!=a.fillOpacity&&this.writeNode("CssParameter",{symbolizer:a,key:"fillOpacity"},b);return b},PointSymbolizer:function(a){var b=this.createElementNSPlus("sld:PointSymbolizer");this.writeNode("Graphic",a,b);return b},Graphic:function(a){var b=this.createElementNSPlus("sld:Graphic");void 0!=a.externalGraphic? +this.writeNode("ExternalGraphic",a,b):this.writeNode("Mark",a,b);void 0!=a.graphicOpacity&&this.writeNode("Opacity",a.graphicOpacity,b);void 0!=a.pointRadius?this.writeNode("Size",2*a.pointRadius,b):void 0!=a.graphicWidth&&this.writeNode("Size",a.graphicWidth,b);void 0!=a.rotation&&this.writeNode("Rotation",a.rotation,b);return b},ExternalGraphic:function(a){var b=this.createElementNSPlus("sld:ExternalGraphic");this.writeNode("OnlineResource",a.externalGraphic,b);a=a.graphicFormat||this.getGraphicFormat(a.externalGraphic); +this.writeNode("Format",a,b);return b},Mark:function(a){var b=this.createElementNSPlus("sld:Mark");a.graphicName&&this.writeNode("WellKnownName",a.graphicName,b);!1!==a.fill&&this.writeNode("Fill",a,b);!1!==a.stroke&&this.writeNode("Stroke",a,b);return b},WellKnownName:function(a){return this.createElementNSPlus("sld:WellKnownName",{value:a})},Opacity:function(a){return this.createElementNSPlus("sld:Opacity",{value:a})},Size:function(a){return this.writers.sld._OGCExpression.call(this,"sld:Size", +a)},Rotation:function(a){return this.createElementNSPlus("sld:Rotation",{value:a})},OnlineResource:function(a){return this.createElementNSPlus("sld:OnlineResource",{attributes:{"xlink:type":"simple","xlink:href":a}})},Format:function(a){return this.createElementNSPlus("sld:Format",{value:a})}}},OpenLayers.Format.Filter.v1_0_0.prototype.writers),CLASS_NAME:"OpenLayers.Format.SLD.v1"});OpenLayers.Layer.WMS=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"},isBaseLayer:!0,encodeBBOX:!1,noMagic:!1,yx:{},initialize:function(a,b,c,d){var e=[];c=OpenLayers.Util.upperCaseObject(c);1.3<=parseFloat(c.VERSION)&&!c.EXCEPTIONS&&(c.EXCEPTIONS="INIMAGE");e.push(a,b,c,d);OpenLayers.Layer.Grid.prototype.initialize.apply(this,e);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS)); +!this.noMagic&&(this.params.TRANSPARENT&&"true"==this.params.TRANSPARENT.toString().toLowerCase())&&(null!=d&&d.isBaseLayer||(this.isBaseLayer=!1),"image/jpeg"==this.params.FORMAT&&(this.params.FORMAT=OpenLayers.Util.alphaHack()?"image/gif":"image/png"))},clone:function(a){null==a&&(a=new OpenLayers.Layer.WMS(this.name,this.url,this.params,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},reverseAxisOrder:function(){var a=this.projection.getCode();return 1.3<=parseFloat(this.params.VERSION)&& +!!(this.yx[a]||OpenLayers.Projection.defaults[a]&&OpenLayers.Projection.defaults[a].yx)},getURL:function(a){a=this.adjustBounds(a);var b=this.getImageSize(),c={},d=this.reverseAxisOrder();c.BBOX=this.encodeBBOX?a.toBBOX(null,d):a.toArray(d);c.WIDTH=b.w;c.HEIGHT=b.h;return this.getFullRequestString(c)},mergeNewParams:function(a){a=[OpenLayers.Util.upperCaseObject(a)];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},getFullRequestString:function(a,b){var c=this.map.getProjectionObject(), +c=this.projection&&this.projection.equals(c)?this.projection.getCode():c.getCode(),c="none"==c?null:c;1.3<=parseFloat(this.params.VERSION)?this.params.CRS=c:this.params.SRS=c;"boolean"==typeof this.params.TRANSPARENT&&(a.TRANSPARENT=this.params.TRANSPARENT?"TRUE":"FALSE");return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,arguments)},CLASS_NAME:"OpenLayers.Layer.WMS"});OpenLayers.Layer.KaMap=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,DEFAULT_PARAMS:{i:"jpeg",map:""},initialize:function(a,b,c,d){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getURL:function(a){a=this.adjustBounds(a);var b=this.map.getResolution(),c=Math.round(1E4*this.map.getScale())/1E4,d=Math.round(a.left/b);a=-Math.round(a.top/b);return this.getFullRequestString({t:a,l:d,s:c})},calculateGridLayout:function(a, +b,c){b=c*this.tileSize.w;c*=this.tileSize.h;return{tilelon:b,tilelat:c,startcol:Math.floor(a.left/b)-this.buffer,startrow:Math.floor(a.top/c)+this.buffer}},getTileBoundsForGridIndex:function(a,b){this.getTileOrigin();var c=this.gridLayout,d=c.tilelon,e=c.tilelat,f=(c.startcol+b)*d,c=(c.startrow-a)*e;return new OpenLayers.Bounds(f,c,f+d,c+e)},clone:function(a){null==a&&(a=new OpenLayers.Layer.KaMap(this.name,this.url,this.params,this.getOptions()));a=OpenLayers.Layer.Grid.prototype.clone.apply(this, +[a]);null!=this.tileSize&&(a.tileSize=this.tileSize.clone());a.grid=[];return a},getTileBounds:function(a){var b=this.getResolution(),c=b*this.tileSize.w,b=b*this.tileSize.h,d=this.getLonLatFromViewPortPx(a);a=c*Math.floor(d.lon/c);d=b*Math.floor(d.lat/b);return new OpenLayers.Bounds(a,d,a+c,d+b)},CLASS_NAME:"OpenLayers.Layer.KaMap"});OpenLayers.Format.WMC.v1_1_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.1.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.1.0/context.xsd",initialize:function(a){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[a])},read_sld_MinScaleDenominator:function(a,b){var c=parseFloat(this.getChildValue(b));0<c&&(a.maxScale=c)},read_sld_MaxScaleDenominator:function(a,b){a.minScale=parseFloat(this.getChildValue(b))},read_wmc_SRS:function(a,b){"srs"in +a||(a.srs={});a.srs[this.getChildValue(b)]=!0},write_wmc_Layer:function(a){var b=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this,[a]);if(a.maxScale){var c=this.createElementNS(this.namespaces.sld,"sld:MinScaleDenominator");c.appendChild(this.createTextNode(a.maxScale.toPrecision(16)));b.appendChild(c)}a.minScale&&(c=this.createElementNS(this.namespaces.sld,"sld:MaxScaleDenominator"),c.appendChild(this.createTextNode(a.minScale.toPrecision(16))),b.appendChild(c));if(a.srs)for(var d in a.srs)b.appendChild(this.createElementDefaultNS("SRS", +d));b.appendChild(this.write_wmc_FormatList(a));b.appendChild(this.write_wmc_StyleList(a));a.dimensions&&b.appendChild(this.write_wmc_DimensionList(a));b.appendChild(this.write_wmc_LayerExtension(a));return b},CLASS_NAME:"OpenLayers.Format.WMC.v1_1_0"});OpenLayers.Format.XLS=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.1.0",stringifyOutput:!0,CLASS_NAME:"OpenLayers.Format.XLS"});OpenLayers.Format.XLS.v1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{xls:"http://www.opengis.net/xls",gml:"http://www.opengis.net/gml",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},xy:!0,defaultPrefix:"xls",schemaLocation:null,read:function(a,b){OpenLayers.Util.applyDefaults(b,this.options);var c={};this.readChildNodes(a,c);return c},readers:{xls:{XLS:function(a,b){b.version=a.getAttribute("version"); +this.readChildNodes(a,b)},Response:function(a,b){this.readChildNodes(a,b)},GeocodeResponse:function(a,b){b.responseLists=[];this.readChildNodes(a,b)},GeocodeResponseList:function(a,b){var c={features:[],numberOfGeocodedAddresses:parseInt(a.getAttribute("numberOfGeocodedAddresses"))};b.responseLists.push(c);this.readChildNodes(a,c)},GeocodedAddress:function(a,b){var c=new OpenLayers.Feature.Vector;b.features.push(c);this.readChildNodes(a,c);c.geometry=c.components[0]},GeocodeMatchCode:function(a,b){b.attributes.matchCode= +{accuracy:parseFloat(a.getAttribute("accuracy")),matchType:a.getAttribute("matchType")}},Address:function(a,b){var c={countryCode:a.getAttribute("countryCode"),addressee:a.getAttribute("addressee"),street:[],place:[]};b.attributes.address=c;this.readChildNodes(a,c)},freeFormAddress:function(a,b){b.freeFormAddress=this.getChildValue(a)},StreetAddress:function(a,b){this.readChildNodes(a,b)},Building:function(a,b){b.building={number:a.getAttribute("number"),subdivision:a.getAttribute("subdivision"), +buildingName:a.getAttribute("buildingName")}},Street:function(a,b){b.street.push(this.getChildValue(a))},Place:function(a,b){b.place[a.getAttribute("type")]=this.getChildValue(a)},PostalCode:function(a,b){b.postalCode=this.getChildValue(a)}},gml:OpenLayers.Format.GML.v3.prototype.readers.gml},write:function(a){return this.writers.xls.XLS.apply(this,[a])},writers:{xls:{XLS:function(a){var b=this.createElementNSPlus("xls:XLS",{attributes:{version:this.VERSION,"xsi:schemaLocation":this.schemaLocation}}); +this.writeNode("RequestHeader",a.header,b);this.writeNode("Request",a,b);return b},RequestHeader:function(a){return this.createElementNSPlus("xls:RequestHeader")},Request:function(a){var b=this.createElementNSPlus("xls:Request",{attributes:{methodName:"GeocodeRequest",requestID:a.requestID||"",version:this.VERSION}});this.writeNode("GeocodeRequest",a.addresses,b);return b},GeocodeRequest:function(a){for(var b=this.createElementNSPlus("xls:GeocodeRequest"),c=0,d=a.length;c<d;c++)this.writeNode("Address", +a[c],b);return b},Address:function(a){var b=this.createElementNSPlus("xls:Address",{attributes:{countryCode:a.countryCode}});a.freeFormAddress?this.writeNode("freeFormAddress",a.freeFormAddress,b):(a.street&&this.writeNode("StreetAddress",a,b),a.municipality&&this.writeNode("Municipality",a.municipality,b),a.countrySubdivision&&this.writeNode("CountrySubdivision",a.countrySubdivision,b),a.postalCode&&this.writeNode("PostalCode",a.postalCode,b));return b},freeFormAddress:function(a){return this.createElementNSPlus("freeFormAddress", +{value:a})},StreetAddress:function(a){var b=this.createElementNSPlus("xls:StreetAddress");a.building&&this.writeNode(b,"Building",a.building);a=a.street;OpenLayers.Util.isArray(a)||(a=[a]);for(var c=0,d=a.length;c<d;c++)this.writeNode("Street",a[c],b);return b},Building:function(a){return this.createElementNSPlus("xls:Building",{attributes:{number:a.number,subdivision:a.subdivision,buildingName:a.buildingName}})},Street:function(a){return this.createElementNSPlus("xls:Street",{value:a})},Municipality:function(a){return this.createElementNSPlus("xls:Place", +{attributes:{type:"Municipality"},value:a})},CountrySubdivision:function(a){return this.createElementNSPlus("xls:Place",{attributes:{type:"CountrySubdivision"},value:a})},PostalCode:function(a){return this.createElementNSPlus("xls:PostalCode",{value:a})}}},CLASS_NAME:"OpenLayers.Format.XLS.v1"});OpenLayers.Format.XLS.v1_1_0=OpenLayers.Class(OpenLayers.Format.XLS.v1,{VERSION:"1.1",schemaLocation:"http://www.opengis.net/xls http://schemas.opengis.net/ols/1.1.0/LocationUtilityService.xsd",CLASS_NAME:"OpenLayers.Format.XLS.v1_1_0"});OpenLayers.Format.XLS.v1_1=OpenLayers.Format.XLS.v1_1_0;OpenLayers.Renderer.SVG=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"http://www.w3.org/2000/svg",xlinkns:"http://www.w3.org/1999/xlink",MAX_PIXEL:15E3,translationParameters:null,symbolMetrics:null,initialize:function(a){this.supported()&&(OpenLayers.Renderer.Elements.prototype.initialize.apply(this,arguments),this.translationParameters={x:0,y:0},this.symbolMetrics={})},supported:function(){return document.implementation&&(document.implementation.hasFeature("org.w3c.svg","1.0")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#SVG", +"1.1")||document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1"))},inValidRange:function(a,b,c){a+=c?0:this.translationParameters.x;b+=c?0:this.translationParameters.y;return a>=-this.MAX_PIXEL&&a<=this.MAX_PIXEL&&b>=-this.MAX_PIXEL&&b<=this.MAX_PIXEL},setExtent:function(a,b){var c=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),d=this.getResolution(),e=-a.left/d,d=a.top/d;if(b)return this.left=e,this.top=d,this.rendererRoot.setAttributeNS(null, +"viewBox","0 0 "+this.size.w+" "+this.size.h),this.translate(this.xOffset,0),!0;(e=this.translate(e-this.left+this.xOffset,d-this.top))||this.setExtent(a,!0);return c&&e},translate:function(a,b){if(this.inValidRange(a,b,!0)){var c="";if(a||b)c="translate("+a+","+b+")";this.root.setAttributeNS(null,"transform",c);this.translationParameters={x:a,y:b};return!0}return!1},setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);this.rendererRoot.setAttributeNS(null,"width",this.size.w); +this.rendererRoot.setAttributeNS(null,"height",this.size.h)},getNodeType:function(a,b){var c=null;switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":c=b.externalGraphic?"image":this.isComplexSymbol(b.graphicName)?"svg":"circle";break;case "OpenLayers.Geometry.Rectangle":c="rect";break;case "OpenLayers.Geometry.LineString":c="polyline";break;case "OpenLayers.Geometry.LinearRing":c="polygon";break;case "OpenLayers.Geometry.Polygon":case "OpenLayers.Geometry.Curve":c="path"}return c},setStyle:function(a, +b,c){b=b||a._style;c=c||a._options;var d=b.title||b.graphicTitle;if(d){a.setAttributeNS(null,"title",d);var e=a.getElementsByTagName("title");0<e.length?e[0].firstChild.textContent=d:(e=this.nodeFactory(null,"title"),e.textContent=d,a.appendChild(e))}var e=parseFloat(a.getAttributeNS(null,"r")),d=1,f;if("OpenLayers.Geometry.Point"==a._geometryClass&&e){a.style.visibility="";if(!1===b.graphic)a.style.visibility="hidden";else if(b.externalGraphic){f=this.getPosition(a);b.graphicWidth&&b.graphicHeight&& +a.setAttributeNS(null,"preserveAspectRatio","none");var e=b.graphicWidth||b.graphicHeight,g=b.graphicHeight||b.graphicWidth,e=e?e:2*b.pointRadius,g=g?g:2*b.pointRadius,h=void 0!=b.graphicYOffset?b.graphicYOffset:-(0.5*g),k=b.graphicOpacity||b.fillOpacity;a.setAttributeNS(null,"x",(f.x+(void 0!=b.graphicXOffset?b.graphicXOffset:-(0.5*e))).toFixed());a.setAttributeNS(null,"y",(f.y+h).toFixed());a.setAttributeNS(null,"width",e);a.setAttributeNS(null,"height",g);a.setAttributeNS(this.xlinkns,"xlink:href", +b.externalGraphic);a.setAttributeNS(null,"style","opacity: "+k);a.onclick=OpenLayers.Event.preventDefault}else if(this.isComplexSymbol(b.graphicName)){var e=3*b.pointRadius,g=2*e,l=this.importSymbol(b.graphicName);f=this.getPosition(a);d=3*this.symbolMetrics[l.id][0]/g;h=a.parentNode;k=a.nextSibling;h&&h.removeChild(a);a.firstChild&&a.removeChild(a.firstChild);a.appendChild(l.firstChild.cloneNode(!0));a.setAttributeNS(null,"viewBox",l.getAttributeNS(null,"viewBox"));a.setAttributeNS(null,"width", +g);a.setAttributeNS(null,"height",g);a.setAttributeNS(null,"x",f.x-e);a.setAttributeNS(null,"y",f.y-e);k?h.insertBefore(a,k):h&&h.appendChild(a)}else a.setAttributeNS(null,"r",b.pointRadius);e=b.rotation;void 0===e&&void 0===a._rotation||!f||(a._rotation=e,e|=0,"svg"!==a.nodeName?a.setAttributeNS(null,"transform","rotate("+e+" "+f.x+" "+f.y+")"):(f=this.symbolMetrics[l.id],a.firstChild.setAttributeNS(null,"transform","rotate("+e+" "+f[1]+" "+f[2]+")")))}c.isFilled?(a.setAttributeNS(null,"fill",b.fillColor), +a.setAttributeNS(null,"fill-opacity",b.fillOpacity)):a.setAttributeNS(null,"fill","none");c.isStroked?(a.setAttributeNS(null,"stroke",b.strokeColor),a.setAttributeNS(null,"stroke-opacity",b.strokeOpacity),a.setAttributeNS(null,"stroke-width",b.strokeWidth*d),a.setAttributeNS(null,"stroke-linecap",b.strokeLinecap||"round"),a.setAttributeNS(null,"stroke-linejoin","round"),b.strokeDashstyle&&a.setAttributeNS(null,"stroke-dasharray",this.dashStyle(b,d))):a.setAttributeNS(null,"stroke","none");b.pointerEvents&& +a.setAttributeNS(null,"pointer-events",b.pointerEvents);null!=b.cursor&&a.setAttributeNS(null,"cursor",b.cursor);return a},dashStyle:function(a,b){var c=a.strokeWidth*b,d=a.strokeDashstyle;switch(d){case "solid":return"none";case "dot":return[1,4*c].join();case "dash":return[4*c,4*c].join();case "dashdot":return[4*c,4*c,1,4*c].join();case "longdash":return[8*c,4*c].join();case "longdashdot":return[8*c,4*c,1,4*c].join();default:return OpenLayers.String.trim(d).replace(/\s+/g,",")}},createNode:function(a, +b){var c=document.createElementNS(this.xmlns,a);b&&c.setAttributeNS(null,"id",b);return c},nodeTypeCompare:function(a,b){return b==a.nodeName},createRenderRoot:function(){var a=this.nodeFactory(this.container.id+"_svgRoot","svg");a.style.display="block";return a},createRoot:function(a){return this.nodeFactory(this.container.id+a,"g")},createDefs:function(){var a=this.nodeFactory(this.container.id+"_defs","defs");this.rendererRoot.appendChild(a);return a},drawPoint:function(a,b){return this.drawCircle(a, +b,1)},drawCircle:function(a,b,c){var d=this.getResolution(),e=(b.x-this.featureDx)/d+this.left;b=this.top-b.y/d;return this.inValidRange(e,b)?(a.setAttributeNS(null,"cx",e),a.setAttributeNS(null,"cy",b),a.setAttributeNS(null,"r",c),a):!1},drawLineString:function(a,b){var c=this.getComponentsString(b.components);return c.path?(a.setAttributeNS(null,"points",c.path),c.complete?a:null):!1},drawLinearRing:function(a,b){var c=this.getComponentsString(b.components);return c.path?(a.setAttributeNS(null, +"points",c.path),c.complete?a:null):!1},drawPolygon:function(a,b){for(var c="",d=!0,e=!0,f,g,h=0,k=b.components.length;h<k;h++)c+=" M",f=this.getComponentsString(b.components[h].components," "),(g=f.path)?(c+=" "+g,e=f.complete&&e):d=!1;return d?(a.setAttributeNS(null,"d",c+" z"),a.setAttributeNS(null,"fill-rule","evenodd"),e?a:null):!1},drawRectangle:function(a,b){var c=this.getResolution(),d=(b.x-this.featureDx)/c+this.left,e=this.top-b.y/c;return this.inValidRange(d,e)?(a.setAttributeNS(null,"x", +d),a.setAttributeNS(null,"y",e),a.setAttributeNS(null,"width",b.width/c),a.setAttributeNS(null,"height",b.height/c),a):!1},drawText:function(a,b,c){var d=!!b.labelOutlineWidth;if(d){var e=OpenLayers.Util.extend({},b);e.fontColor=e.labelOutlineColor;e.fontStrokeColor=e.labelOutlineColor;e.fontStrokeWidth=b.labelOutlineWidth;b.labelOutlineOpacity&&(e.fontOpacity=b.labelOutlineOpacity);delete e.labelOutlineWidth;this.drawText(a,e,c)}var f=this.getResolution(),e=(c.x-this.featureDx)/f+this.left,g=c.y/ +f-this.top,d=d?this.LABEL_OUTLINE_SUFFIX:this.LABEL_ID_SUFFIX,f=this.nodeFactory(a+d,"text");f.setAttributeNS(null,"x",e);f.setAttributeNS(null,"y",-g);b.fontColor&&f.setAttributeNS(null,"fill",b.fontColor);b.fontStrokeColor&&f.setAttributeNS(null,"stroke",b.fontStrokeColor);b.fontStrokeWidth&&f.setAttributeNS(null,"stroke-width",b.fontStrokeWidth);b.fontOpacity&&f.setAttributeNS(null,"opacity",b.fontOpacity);b.fontFamily&&f.setAttributeNS(null,"font-family",b.fontFamily);b.fontSize&&f.setAttributeNS(null, +"font-size",b.fontSize);b.fontWeight&&f.setAttributeNS(null,"font-weight",b.fontWeight);b.fontStyle&&f.setAttributeNS(null,"font-style",b.fontStyle);!0===b.labelSelect?(f.setAttributeNS(null,"pointer-events","visible"),f._featureId=a):f.setAttributeNS(null,"pointer-events","none");g=b.labelAlign||OpenLayers.Renderer.defaultSymbolizer.labelAlign;f.setAttributeNS(null,"text-anchor",OpenLayers.Renderer.SVG.LABEL_ALIGN[g[0]]||"middle");!0===OpenLayers.IS_GECKO&&f.setAttributeNS(null,"dominant-baseline", +OpenLayers.Renderer.SVG.LABEL_ALIGN[g[1]]||"central");for(var h=b.label.split("\n"),k=h.length;f.childNodes.length>k;)f.removeChild(f.lastChild);for(var l=0;l<k;l++){var m=this.nodeFactory(a+d+"_tspan_"+l,"tspan");!0===b.labelSelect&&(m._featureId=a,m._geometry=c,m._geometryClass=c.CLASS_NAME);!1===OpenLayers.IS_GECKO&&m.setAttributeNS(null,"baseline-shift",OpenLayers.Renderer.SVG.LABEL_VSHIFT[g[1]]||"-35%");m.setAttribute("x",e);if(0==l){var n=OpenLayers.Renderer.SVG.LABEL_VFACTOR[g[1]];null==n&& +(n=-0.5);m.setAttribute("dy",n*(k-1)+"em")}else m.setAttribute("dy","1em");m.textContent=""===h[l]?" ":h[l];m.parentNode||f.appendChild(m)}f.parentNode||this.textRoot.appendChild(f)},getComponentsString:function(a,b){for(var c=[],d=!0,e=a.length,f=[],g,h=0;h<e;h++)g=a[h],c.push(g),(g=this.getShortString(g))?f.push(g):(0<h&&this.getShortString(a[h-1])&&f.push(this.clipLine(a[h],a[h-1])),h<e-1&&this.getShortString(a[h+1])&&f.push(this.clipLine(a[h],a[h+1])),d=!1);return{path:f.join(b||","),complete:d}}, +clipLine:function(a,b){if(b.equals(a))return"";var c=this.getResolution(),d=this.MAX_PIXEL-this.translationParameters.x,e=this.MAX_PIXEL-this.translationParameters.y,f=(b.x-this.featureDx)/c+this.left,g=this.top-b.y/c,h=(a.x-this.featureDx)/c+this.left,c=this.top-a.y/c,k;if(h<-d||h>d)k=(c-g)/(h-f),h=0>h?-d:d,c=g+(h-f)*k;if(c<-e||c>e)k=(h-f)/(c-g),c=0>c?-e:e,h=f+(c-g)*k;return h+","+c},getShortString:function(a){var b=this.getResolution(),c=(a.x-this.featureDx)/b+this.left;a=this.top-a.y/b;return this.inValidRange(c, +a)?c+","+a:!1},getPosition:function(a){return{x:parseFloat(a.getAttributeNS(null,"cx")),y:parseFloat(a.getAttributeNS(null,"cy"))}},importSymbol:function(a){this.defs||(this.defs=this.createDefs());var b=this.container.id+"-"+a,c=document.getElementById(b);if(null!=c)return c;var d=OpenLayers.Renderer.symbol[a];if(!d)throw Error(a+" is not a valid symbol name");a=this.nodeFactory(b,"symbol");var e=this.nodeFactory(null,"polygon");a.appendChild(e);for(var c=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE, +0,0),f=[],g,h,k=0;k<d.length;k+=2)g=d[k],h=d[k+1],c.left=Math.min(c.left,g),c.bottom=Math.min(c.bottom,h),c.right=Math.max(c.right,g),c.top=Math.max(c.top,h),f.push(g,",",h);e.setAttributeNS(null,"points",f.join(" "));d=c.getWidth();e=c.getHeight();a.setAttributeNS(null,"viewBox",[c.left-d,c.bottom-e,3*d,3*e].join(" "));this.symbolMetrics[b]=[Math.max(d,e),c.getCenterLonLat().lon,c.getCenterLonLat().lat];this.defs.appendChild(a);return a},getFeatureIdFromEvent:function(a){var b=OpenLayers.Renderer.Elements.prototype.getFeatureIdFromEvent.apply(this, +arguments);b||(b=a.target,b=b.parentNode&&b!=this.rendererRoot?b.parentNode._featureId:void 0);return b},CLASS_NAME:"OpenLayers.Renderer.SVG"});OpenLayers.Renderer.SVG.LABEL_ALIGN={l:"start",r:"end",b:"bottom",t:"hanging"};OpenLayers.Renderer.SVG.LABEL_VSHIFT={t:"-70%",b:"0"};OpenLayers.Renderer.SVG.LABEL_VFACTOR={t:0,b:-1};OpenLayers.Renderer.SVG.preventDefault=function(a){OpenLayers.Event.preventDefault(a)};OpenLayers.Format.SLD.v1_0_0=OpenLayers.Class(OpenLayers.Format.SLD.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sld http://schemas.opengis.net/sld/1.0.0/StyledLayerDescriptor.xsd",CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0"});OpenLayers.Format.OWSContext=OpenLayers.Class(OpenLayers.Format.Context,{defaultVersion:"0.3.1",getVersion:function(a,b){var c=OpenLayers.Format.XML.VersionedOGC.prototype.getVersion.apply(this,arguments);"0.3.0"===c&&(c=this.defaultVersion);return c},toContext:function(a){var b={};"OpenLayers.Map"==a.CLASS_NAME&&(b.bounds=a.getExtent(),b.maxExtent=a.maxExtent,b.projection=a.projection,b.size=a.getSize(),b.layers=a.layers);return b},CLASS_NAME:"OpenLayers.Format.OWSContext"});OpenLayers.Format.OWSContext.v0_3_1=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{owc:"http://www.opengis.net/ows-context",gml:"http://www.opengis.net/gml",kml:"http://www.opengis.net/kml/2.2",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows",sld:"http://www.opengis.net/sld",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},VERSION:"0.3.1",schemaLocation:"http://www.opengis.net/ows-context http://www.ogcnetwork.net/schemas/owc/0.3.1/owsContext.xsd", +defaultPrefix:"owc",extractAttributes:!0,xy:!0,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},featureNS:"http://mapserver.gis.umn.edu/mapserver",featureType:"vector",geometryName:"geometry",nestingLayerLookup:null,initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);OpenLayers.Format.GML.v2.prototype.setGeometryTypes.call(this)},setNestingPath:function(a){if(a.layersContext)for(var b=0,c=a.layersContext.length;b<c;b++){var d= +a.layersContext[b],e=[],f=a.title||"";a.metadata&&a.metadata.nestingPath&&(e=a.metadata.nestingPath.slice());""!=f&&e.push(f);d.metadata.nestingPath=e;d.layersContext&&this.setNestingPath(d)}},decomposeNestingPath:function(a){var b=[];if(OpenLayers.Util.isArray(a)){for(a=a.slice();0<a.length;)b.push(a.slice()),a.pop();b.reverse()}return b},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a, +b);this.setNestingPath({layersContext:b.layersContext});a=[];this.processLayer(a,b);delete b.layersContext;b.layersContext=a;return b},processLayer:function(a,b){if(b.layersContext)for(var c=0,d=b.layersContext.length;c<d;c++){var e=b.layersContext[c];a.push(e);e.layersContext&&this.processLayer(a,e)}},write:function(a,b){this.nestingLayerLookup={};b=b||{};OpenLayers.Util.applyDefaults(b,a);var c=this.writeNode("OWSContext",b);this.nestingLayerLookup=null;this.setAttributeNS(c,this.namespaces.xsi, +"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this,[c])},readers:{kml:{Document:function(a,b){b.features=(new OpenLayers.Format.KML({kmlns:this.namespaces.kml,extractStyles:!0})).read(a)}},owc:{OWSContext:function(a,b){this.readChildNodes(a,b)},General:function(a,b){this.readChildNodes(a,b)},ResourceList:function(a,b){this.readChildNodes(a,b)},Layer:function(a,b){var c={metadata:{},visibility:"1"!=a.getAttribute("hidden"),queryable:"1"==a.getAttribute("queryable"), +opacity:null!=a.getAttribute("opacity")?parseFloat(a.getAttribute("opacity")):null,name:a.getAttribute("name"),categoryLayer:null==a.getAttribute("name"),formats:[],styles:[]};b.layersContext||(b.layersContext=[]);b.layersContext.push(c);this.readChildNodes(a,c)},InlineGeometry:function(a,b){b.features=[];var c=this.getElementsByTagNameNS(a,this.namespaces.gml,"featureMember"),d;1<=c.length&&(d=c[0]);d&&d.firstChild&&(c=d.firstChild.nextSibling?d.firstChild.nextSibling:d.firstChild,this.setNamespace("feature", +c.namespaceURI),this.featureType=c.localName||c.nodeName.split(":").pop(),this.readChildNodes(a,b))},Server:function(a,b){if(!b.service&&!b.version||b.service!=OpenLayers.Format.Context.serviceTypes.WMS)b.service=a.getAttribute("service"),b.version=a.getAttribute("version"),this.readChildNodes(a,b)},Name:function(a,b){b.name=this.getChildValue(a);this.readChildNodes(a,b)},Title:function(a,b){b.title=this.getChildValue(a);this.readChildNodes(a,b)},StyleList:function(a,b){this.readChildNodes(a,b.styles)}, +Style:function(a,b){var c={};b.push(c);this.readChildNodes(a,c)},LegendURL:function(a,b){var c={};b.legend=c;this.readChildNodes(a,c)},OnlineResource:function(a,b){b.url=this.getAttributeNS(a,this.namespaces.xlink,"href");this.readChildNodes(a,b)}},ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows,gml:OpenLayers.Format.GML.v2.prototype.readers.gml,sld:OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld,feature:OpenLayers.Format.GML.v2.prototype.readers.feature},writers:{owc:{OWSContext:function(a){var b= +this.createElementNSPlus("OWSContext",{attributes:{version:this.VERSION,id:a.id||OpenLayers.Util.createUniqueID("OpenLayers_OWSContext_")}});this.writeNode("General",a,b);this.writeNode("ResourceList",a,b);return b},General:function(a){var b=this.createElementNSPlus("General");this.writeNode("ows:BoundingBox",a,b);this.writeNode("ows:Title",a.title||"OpenLayers OWSContext",b);return b},ResourceList:function(a){for(var b=this.createElementNSPlus("ResourceList"),c=0,d=a.layers.length;c<d;c++){var e= +a.layers[c],f=this.decomposeNestingPath(e.metadata.nestingPath);this.writeNode("_Layer",{layer:e,subPaths:f},b)}return b},Server:function(a){var b=this.createElementNSPlus("Server",{attributes:{version:a.version,service:a.service}});this.writeNode("OnlineResource",a,b);return b},OnlineResource:function(a){return this.createElementNSPlus("OnlineResource",{attributes:{"xlink:href":a.url}})},InlineGeometry:function(a){var b=this.createElementNSPlus("InlineGeometry"),c=a.getDataExtent();null!==c&&this.writeNode("gml:boundedBy", +c,b);for(var c=0,d=a.features.length;c<d;c++)this.writeNode("gml:featureMember",a.features[c],b);return b},StyleList:function(a){for(var b=this.createElementNSPlus("StyleList"),c=0,d=a.length;c<d;c++)this.writeNode("Style",a[c],b);return b},Style:function(a){var b=this.createElementNSPlus("Style");this.writeNode("Name",a,b);this.writeNode("Title",a,b);a.legend&&this.writeNode("LegendURL",a,b);return b},Name:function(a){return this.createElementNSPlus("Name",{value:a.name})},Title:function(a){return this.createElementNSPlus("Title", +{value:a.title})},LegendURL:function(a){var b=this.createElementNSPlus("LegendURL");this.writeNode("OnlineResource",a.legend,b);return b},_WMS:function(a){var b=this.createElementNSPlus("Layer",{attributes:{name:a.params.LAYERS,queryable:a.queryable?"1":"0",hidden:a.visibility?"0":"1",opacity:a.hasOwnProperty("opacity")?a.opacity:null}});this.writeNode("ows:Title",a.name,b);this.writeNode("ows:OutputFormat",a.params.FORMAT,b);this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WMS, +version:a.params.VERSION,url:a.url},b);a.metadata.styles&&0<a.metadata.styles.length&&this.writeNode("StyleList",a.metadata.styles,b);return b},_Layer:function(a){var b,c,d;b=a.layer;c=a.subPaths;d=null;0<c.length?(b=c[0].join("/"),c=b.lastIndexOf("/"),d=this.nestingLayerLookup[b],c=0<c?b.substring(c+1,b.length):b,d||(d=this.createElementNSPlus("Layer"),this.writeNode("ows:Title",c,d),this.nestingLayerLookup[b]=d),a.subPaths.shift(),this.writeNode("_Layer",a,d)):(b instanceof OpenLayers.Layer.WMS? +d=this.writeNode("_WMS",b):b instanceof OpenLayers.Layer.Vector&&(b.protocol instanceof OpenLayers.Protocol.WFS.v1?d=this.writeNode("_WFS",b):b.protocol instanceof OpenLayers.Protocol.HTTP?b.protocol.format instanceof OpenLayers.Format.GML?(b.protocol.format.version="2.1.2",d=this.writeNode("_GML",b)):b.protocol.format instanceof OpenLayers.Format.KML&&(b.protocol.format.version="2.2",d=this.writeNode("_KML",b)):(this.setNamespace("feature",this.featureNS),d=this.writeNode("_InlineGeometry",b))), +b.options.maxScale&&this.writeNode("sld:MinScaleDenominator",b.options.maxScale,d),b.options.minScale&&this.writeNode("sld:MaxScaleDenominator",b.options.minScale,d),this.nestingLayerLookup[b.name]=d);return d},_WFS:function(a){var b=this.createElementNSPlus("Layer",{attributes:{name:a.protocol.featurePrefix+":"+a.protocol.featureType,hidden:a.visibility?"0":"1"}});this.writeNode("ows:Title",a.name,b);this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.WFS,version:a.protocol.version, +url:a.protocol.url},b);return b},_InlineGeometry:function(a){var b=this.createElementNSPlus("Layer",{attributes:{name:this.featureType,hidden:a.visibility?"0":"1"}});this.writeNode("ows:Title",a.name,b);this.writeNode("InlineGeometry",a,b);return b},_GML:function(a){var b=this.createElementNSPlus("Layer");this.writeNode("ows:Title",a.name,b);this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.GML,url:a.protocol.url,version:a.protocol.format.version},b);return b},_KML:function(a){var b= +this.createElementNSPlus("Layer");this.writeNode("ows:Title",a.name,b);this.writeNode("Server",{service:OpenLayers.Format.Context.serviceTypes.KML,version:a.protocol.format.version,url:a.protocol.url},b);return b}},gml:OpenLayers.Util.applyDefaults({boundedBy:function(a){var b=this.createElementNSPlus("gml:boundedBy");this.writeNode("gml:Box",a,b);return b}},OpenLayers.Format.GML.v2.prototype.writers.gml),ows:OpenLayers.Format.OWSCommon.v1_0_0.prototype.writers.ows,sld:OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld, +feature:OpenLayers.Format.GML.v2.prototype.writers.feature},CLASS_NAME:"OpenLayers.Format.OWSContext.v0_3_1"});OpenLayers.Popup=OpenLayers.Class({events:null,id:"",lonlat:null,div:null,contentSize:null,size:null,contentHTML:null,backgroundColor:"",opacity:"",border:"",contentDiv:null,groupDiv:null,closeDiv:null,autoSize:!1,minSize:null,maxSize:null,displayClass:"olPopup",contentDisplayClass:"olPopupContent",padding:0,disableFirefoxOverflowHack:!1,fixPadding:function(){"number"==typeof this.padding&&(this.padding=new OpenLayers.Bounds(this.padding,this.padding,this.padding,this.padding))},panMapIfOutOfView:!1, +keepInMap:!1,closeOnMove:!1,map:null,initialize:function(a,b,c,d,e,f){null==a&&(a=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_"));this.id=a;this.lonlat=b;this.contentSize=null!=c?c:new OpenLayers.Size(OpenLayers.Popup.WIDTH,OpenLayers.Popup.HEIGHT);null!=d&&(this.contentHTML=d);this.backgroundColor=OpenLayers.Popup.COLOR;this.opacity=OpenLayers.Popup.OPACITY;this.border=OpenLayers.Popup.BORDER;this.div=OpenLayers.Util.createDiv(this.id,null,null,null,null,null,"hidden");this.div.className=this.displayClass; +this.groupDiv=OpenLayers.Util.createDiv(this.id+"_GroupDiv",null,null,null,"relative",null,"hidden");a=this.div.id+"_contentDiv";this.contentDiv=OpenLayers.Util.createDiv(a,null,this.contentSize.clone(),null,"relative");this.contentDiv.className=this.contentDisplayClass;this.groupDiv.appendChild(this.contentDiv);this.div.appendChild(this.groupDiv);e&&this.addCloseBox(f);this.registerEvents()},destroy:function(){this.border=this.opacity=this.backgroundColor=this.contentHTML=this.size=this.lonlat=this.id= +null;this.closeOnMove&&this.map&&this.map.events.unregister("movestart",this,this.hide);this.events.destroy();this.events=null;this.closeDiv&&(OpenLayers.Event.stopObservingElement(this.closeDiv),this.groupDiv.removeChild(this.closeDiv));this.closeDiv=null;this.div.removeChild(this.groupDiv);this.groupDiv=null;null!=this.map&&this.map.removePopup(this);this.panMapIfOutOfView=this.padding=this.maxSize=this.minSize=this.autoSize=this.div=this.map=null},draw:function(a){null==a&&null!=this.lonlat&&null!= +this.map&&(a=this.map.getLayerPxFromLonLat(this.lonlat));this.closeOnMove&&this.map.events.register("movestart",this,this.hide);this.disableFirefoxOverflowHack||"firefox"!=OpenLayers.BROWSER_NAME||(this.map.events.register("movestart",this,function(){var a=document.defaultView.getComputedStyle(this.contentDiv,null).getPropertyValue("overflow");"hidden"!=a&&(this.contentDiv._oldOverflow=a,this.contentDiv.style.overflow="hidden")}),this.map.events.register("moveend",this,function(){var a=this.contentDiv._oldOverflow; +a&&(this.contentDiv.style.overflow=a,this.contentDiv._oldOverflow=null)}));this.moveTo(a);this.autoSize||this.size||this.setSize(this.contentSize);this.setBackgroundColor();this.setOpacity();this.setBorder();this.setContentHTML();this.panMapIfOutOfView&&this.panIntoView();return this.div},updatePosition:function(){if(this.lonlat&&this.map){var a=this.map.getLayerPxFromLonLat(this.lonlat);a&&this.moveTo(a)}},moveTo:function(a){null!=a&&null!=this.div&&(this.div.style.left=a.x+"px",this.div.style.top= +a.y+"px")},visible:function(){return OpenLayers.Element.visible(this.div)},toggle:function(){this.visible()?this.hide():this.show()},show:function(){this.div.style.display="";this.panMapIfOutOfView&&this.panIntoView()},hide:function(){this.div.style.display="none"},setSize:function(a){this.size=a.clone();var b=this.getContentDivPadding(),c=b.left+b.right,d=b.top+b.bottom;this.fixPadding();c+=this.padding.left+this.padding.right;d+=this.padding.top+this.padding.bottom;if(this.closeDiv)var e=parseInt(this.closeDiv.style.width), +c=c+(e+b.right);this.size.w+=c;this.size.h+=d;"msie"==OpenLayers.BROWSER_NAME&&(this.contentSize.w+=b.left+b.right,this.contentSize.h+=b.bottom+b.top);null!=this.div&&(this.div.style.width=this.size.w+"px",this.div.style.height=this.size.h+"px");null!=this.contentDiv&&(this.contentDiv.style.width=a.w+"px",this.contentDiv.style.height=a.h+"px")},updateSize:function(){var a="<div class='"+this.contentDisplayClass+"'>"+this.contentDiv.innerHTML+"</div>",b=this.map?this.map.div:document.body,c=OpenLayers.Util.getRenderedDimensions(a, +null,{displayClass:this.displayClass,containerElement:b}),d=this.getSafeContentSize(c),e=null;d.equals(c)?e=c:(c={w:d.w<c.w?d.w:null,h:d.h<c.h?d.h:null},c.w&&c.h?e=d:(a=OpenLayers.Util.getRenderedDimensions(a,c,{displayClass:this.contentDisplayClass,containerElement:b}),"hidden"!=OpenLayers.Element.getStyle(this.contentDiv,"overflow")&&a.equals(d)&&(d=OpenLayers.Util.getScrollbarWidth(),c.w?a.h+=d:a.w+=d),e=this.getSafeContentSize(a)));this.setSize(e)},setBackgroundColor:function(a){void 0!=a&&(this.backgroundColor= +a);null!=this.div&&(this.div.style.backgroundColor=this.backgroundColor)},setOpacity:function(a){void 0!=a&&(this.opacity=a);null!=this.div&&(this.div.style.opacity=this.opacity,this.div.style.filter="alpha(opacity="+100*this.opacity+")")},setBorder:function(a){void 0!=a&&(this.border=a);null!=this.div&&(this.div.style.border=this.border)},setContentHTML:function(a){null!=a&&(this.contentHTML=a);null!=this.contentDiv&&(null!=this.contentHTML&&this.contentHTML!=this.contentDiv.innerHTML)&&(this.contentDiv.innerHTML= +this.contentHTML,this.autoSize&&(this.registerImageListeners(),this.updateSize()))},registerImageListeners:function(){for(var a=function(){null!==this.popup.id&&(this.popup.updateSize(),this.popup.visible()&&this.popup.panMapIfOutOfView&&this.popup.panIntoView(),OpenLayers.Event.stopObserving(this.img,"load",this.img._onImgLoad))},b=this.contentDiv.getElementsByTagName("img"),c=0,d=b.length;c<d;c++){var e=b[c];if(0==e.width||0==e.height)e._onImgLoad=OpenLayers.Function.bind(a,{popup:this,img:e}), +OpenLayers.Event.observe(e,"load",e._onImgLoad)}},getSafeContentSize:function(a){a=a.clone();var b=this.getContentDivPadding(),c=b.left+b.right,d=b.top+b.bottom;this.fixPadding();c+=this.padding.left+this.padding.right;d+=this.padding.top+this.padding.bottom;if(this.closeDiv)var e=parseInt(this.closeDiv.style.width),c=c+(e+b.right);this.minSize&&(a.w=Math.max(a.w,this.minSize.w-c),a.h=Math.max(a.h,this.minSize.h-d));this.maxSize&&(a.w=Math.min(a.w,this.maxSize.w-c),a.h=Math.min(a.h,this.maxSize.h- +d));if(this.map&&this.map.size){e=b=0;if(this.keepInMap&&!this.panMapIfOutOfView)switch(e=this.map.getPixelFromLonLat(this.lonlat),this.relativePosition){case "tr":b=e.x;e=this.map.size.h-e.y;break;case "tl":b=this.map.size.w-e.x;e=this.map.size.h-e.y;break;case "bl":b=this.map.size.w-e.x;e=e.y;break;case "br":b=e.x;e=e.y;break;default:b=e.x,e=this.map.size.h-e.y}d=this.map.size.h-this.map.paddingForPopups.top-this.map.paddingForPopups.bottom-d-e;a.w=Math.min(a.w,this.map.size.w-this.map.paddingForPopups.left- +this.map.paddingForPopups.right-c-b);a.h=Math.min(a.h,d)}return a},getContentDivPadding:function(){var a=this._contentDivPadding;a||(null==this.div.parentNode&&(this.div.style.display="none",document.body.appendChild(this.div)),this._contentDivPadding=a=new OpenLayers.Bounds(OpenLayers.Element.getStyle(this.contentDiv,"padding-left"),OpenLayers.Element.getStyle(this.contentDiv,"padding-bottom"),OpenLayers.Element.getStyle(this.contentDiv,"padding-right"),OpenLayers.Element.getStyle(this.contentDiv, +"padding-top")),this.div.parentNode==document.body&&(document.body.removeChild(this.div),this.div.style.display=""));return a},addCloseBox:function(a){this.closeDiv=OpenLayers.Util.createDiv(this.id+"_close",null,{w:17,h:17});this.closeDiv.className="olPopupCloseBox";var b=this.getContentDivPadding();this.closeDiv.style.right=b.right+"px";this.closeDiv.style.top=b.top+"px";this.groupDiv.appendChild(this.closeDiv);a=a||function(a){this.hide();OpenLayers.Event.stop(a)};OpenLayers.Event.observe(this.closeDiv, +"touchend",OpenLayers.Function.bindAsEventListener(a,this));OpenLayers.Event.observe(this.closeDiv,"click",OpenLayers.Function.bindAsEventListener(a,this))},panIntoView:function(){var a=this.map.getSize(),b=this.map.getViewPortPxFromLayerPx(new OpenLayers.Pixel(parseInt(this.div.style.left),parseInt(this.div.style.top))),c=b.clone();b.x<this.map.paddingForPopups.left?c.x=this.map.paddingForPopups.left:b.x+this.size.w>a.w-this.map.paddingForPopups.right&&(c.x=a.w-this.map.paddingForPopups.right-this.size.w); +b.y<this.map.paddingForPopups.top?c.y=this.map.paddingForPopups.top:b.y+this.size.h>a.h-this.map.paddingForPopups.bottom&&(c.y=a.h-this.map.paddingForPopups.bottom-this.size.h);this.map.pan(b.x-c.x,b.y-c.y)},registerEvents:function(){this.events=new OpenLayers.Events(this,this.div,null,!0);this.events.on({mousedown:this.onmousedown,mousemove:this.onmousemove,mouseup:this.onmouseup,click:this.onclick,mouseout:this.onmouseout,dblclick:this.ondblclick,touchstart:function(a){OpenLayers.Event.stop(a,!0)}, +scope:this})},onmousedown:function(a){this.mousedown=!0;OpenLayers.Event.stop(a,!0)},onmousemove:function(a){this.mousedown&&OpenLayers.Event.stop(a,!0)},onmouseup:function(a){this.mousedown&&(this.mousedown=!1,OpenLayers.Event.stop(a,!0))},onclick:function(a){OpenLayers.Event.stop(a,!0)},onmouseout:function(a){this.mousedown=!1},ondblclick:function(a){OpenLayers.Event.stop(a,!0)},CLASS_NAME:"OpenLayers.Popup"});OpenLayers.Popup.WIDTH=200;OpenLayers.Popup.HEIGHT=200;OpenLayers.Popup.COLOR="white"; +OpenLayers.Popup.OPACITY=1;OpenLayers.Popup.BORDER="0px";OpenLayers.Control.ScaleLine=OpenLayers.Class(OpenLayers.Control,{maxWidth:100,topOutUnits:"km",topInUnits:"m",bottomOutUnits:"mi",bottomInUnits:"ft",eTop:null,eBottom:null,geodesic:!1,draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.eTop||(this.eTop=document.createElement("div"),this.eTop.className=this.displayClass+"Top",this.div.appendChild(this.eTop),this.eTop.style.visibility=""==this.topOutUnits||""==this.topInUnits?"hidden":"visible",this.eBottom=document.createElement("div"), +this.eBottom.className=this.displayClass+"Bottom",this.div.appendChild(this.eBottom),this.eBottom.style.visibility=""==this.bottomOutUnits||""==this.bottomInUnits?"hidden":"visible");this.map.events.register("moveend",this,this.update);this.update();return this.div},getBarLen:function(a){var b=parseInt(Math.log(a)/Math.log(10)),b=Math.pow(10,b);a=parseInt(a/b);return(5<a?5:2<a?2:1)*b},update:function(){var a=this.map.getResolution();if(a){var b=this.map.getUnits(),c=OpenLayers.INCHES_PER_UNIT,d=this.maxWidth* +a*c[b],e=1;!0===this.geodesic&&(e=(this.map.getGeodesicPixelSize().w||1E-6)*this.maxWidth/(d/c.km),d*=e);var f,g;1E5<d?(f=this.topOutUnits,g=this.bottomOutUnits):(f=this.topInUnits,g=this.bottomInUnits);var h=d/c[f],k=d/c[g],d=this.getBarLen(h),l=this.getBarLen(k),h=d/c[b]*c[f],k=l/c[b]*c[g],b=h/a/e,a=k/a/e;"visible"==this.eBottom.style.visibility&&(this.eBottom.style.width=Math.round(a)+"px",this.eBottom.innerHTML=l+" "+g);"visible"==this.eTop.style.visibility&&(this.eTop.style.width=Math.round(b)+ +"px",this.eTop.innerHTML=d+" "+f)}},CLASS_NAME:"OpenLayers.Control.ScaleLine"});OpenLayers.Icon=OpenLayers.Class({url:null,size:null,offset:null,calculateOffset:null,imageDiv:null,px:null,initialize:function(a,b,c,d){this.url=a;this.size=b||{w:20,h:20};this.offset=c||{x:-(this.size.w/2),y:-(this.size.h/2)};this.calculateOffset=d;a=OpenLayers.Util.createUniqueID("OL_Icon_");this.imageDiv=OpenLayers.Util.createAlphaImageDiv(a)},destroy:function(){this.erase();OpenLayers.Event.stopObservingElement(this.imageDiv.firstChild);this.imageDiv.innerHTML="";this.imageDiv=null},clone:function(){return new OpenLayers.Icon(this.url, +this.size,this.offset,this.calculateOffset)},setSize:function(a){null!=a&&(this.size=a);this.draw()},setUrl:function(a){null!=a&&(this.url=a);this.draw()},draw:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,this.size,this.url,"absolute");this.moveTo(a);return this.imageDiv},erase:function(){null!=this.imageDiv&&null!=this.imageDiv.parentNode&&OpenLayers.Element.remove(this.imageDiv)},setOpacity:function(a){OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,null,null,null, +null,null,null,a)},moveTo:function(a){null!=a&&(this.px=a);null!=this.imageDiv&&(null==this.px?this.display(!1):(this.calculateOffset&&(this.offset=this.calculateOffset(this.size)),OpenLayers.Util.modifyAlphaImageDiv(this.imageDiv,null,{x:this.px.x+this.offset.x,y:this.px.y+this.offset.y})))},display:function(a){this.imageDiv.style.display=a?"":"none"},isDrawn:function(){return this.imageDiv&&this.imageDiv.parentNode&&11!=this.imageDiv.parentNode.nodeType},CLASS_NAME:"OpenLayers.Icon"});OpenLayers.Marker=OpenLayers.Class({icon:null,lonlat:null,events:null,map:null,initialize:function(a,b){this.lonlat=a;var c=b?b:OpenLayers.Marker.defaultIcon();null==this.icon?this.icon=c:(this.icon.url=c.url,this.icon.size=c.size,this.icon.offset=c.offset,this.icon.calculateOffset=c.calculateOffset);this.events=new OpenLayers.Events(this,this.icon.imageDiv)},destroy:function(){this.erase();this.map=null;this.events.destroy();this.events=null;null!=this.icon&&(this.icon.destroy(),this.icon=null)}, +draw:function(a){return this.icon.draw(a)},erase:function(){null!=this.icon&&this.icon.erase()},moveTo:function(a){null!=a&&null!=this.icon&&this.icon.moveTo(a);this.lonlat=this.map.getLonLatFromLayerPx(a)},isDrawn:function(){return this.icon&&this.icon.isDrawn()},onScreen:function(){var a=!1;this.map&&(a=this.map.getExtent().containsLonLat(this.lonlat));return a},inflate:function(a){this.icon&&this.icon.setSize({w:this.icon.size.w*a,h:this.icon.size.h*a})},setOpacity:function(a){this.icon.setOpacity(a)}, +setUrl:function(a){this.icon.setUrl(a)},display:function(a){this.icon.display(a)},CLASS_NAME:"OpenLayers.Marker"});OpenLayers.Marker.defaultIcon=function(){return new OpenLayers.Icon(OpenLayers.Util.getImageLocation("marker.png"),{w:21,h:25},{x:-10.5,y:-25})};OpenLayers.Layer.TileCache=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,format:"image/png",serverResolutions:null,initialize:function(a,b,c,d){this.layername=c;OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a,b,{},d]);this.extension=this.format.split("/")[1].toLowerCase();this.extension="jpg"==this.extension?"jpeg":this.extension},clone:function(a){null==a&&(a=new OpenLayers.Layer.TileCache(this.name,this.url,this.layername,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this, +[a])},getURL:function(a){var b=this.getServerResolution(),c=this.maxExtent,d=this.tileSize,e=Math.round((a.left-c.left)/(b*d.w));a=Math.round((a.bottom-c.bottom)/(b*d.h));b=null!=this.serverResolutions?OpenLayers.Util.indexOf(this.serverResolutions,b):this.map.getZoom();e=[this.layername,OpenLayers.Number.zeroPad(b,2),OpenLayers.Number.zeroPad(parseInt(e/1E6),3),OpenLayers.Number.zeroPad(parseInt(e/1E3)%1E3,3),OpenLayers.Number.zeroPad(parseInt(e)%1E3,3),OpenLayers.Number.zeroPad(parseInt(a/1E6), +3),OpenLayers.Number.zeroPad(parseInt(a/1E3)%1E3,3),OpenLayers.Number.zeroPad(parseInt(a)%1E3,3)+"."+this.extension].join("/");b=this.url;OpenLayers.Util.isArray(b)&&(b=this.selectUrl(e,b));b="/"==b.charAt(b.length-1)?b:b+"/";return b+e},CLASS_NAME:"OpenLayers.Layer.TileCache"});OpenLayers.Strategy.Paging=OpenLayers.Class(OpenLayers.Strategy,{features:null,length:10,num:null,paging:!1,activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a)this.layer.events.on({beforefeaturesadded:this.cacheFeatures,scope:this});return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);a&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures,scope:this}));return a},cacheFeatures:function(a){this.paging||(this.clearCache(), +this.features=a.features,this.pageNext(a))},clearCache:function(){if(this.features)for(var a=0;a<this.features.length;++a)this.features[a].destroy();this.num=this.features=null},pageCount:function(){return Math.ceil((this.features?this.features.length:0)/this.length)},pageNum:function(){return this.num},pageLength:function(a){a&&0<a&&(this.length=a);return this.length},pageNext:function(a){var b=!1;this.features&&(null===this.num&&(this.num=-1),b=this.page((this.num+1)*this.length,a));return b},pagePrevious:function(){var a= +!1;this.features&&(null===this.num&&(this.num=this.pageCount()),a=this.page((this.num-1)*this.length));return a},page:function(a,b){var c=!1;if(this.features&&0<=a&&a<this.features.length){var d=Math.floor(a/this.length);d!=this.num&&(this.paging=!0,c=this.features.slice(a,a+this.length),this.layer.removeFeatures(this.layer.features),this.num=d,b&&b.features?b.features=c:this.layer.addFeatures(c),this.paging=!1,c=!0)}return c},CLASS_NAME:"OpenLayers.Strategy.Paging"});OpenLayers.Control.DragFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,onStart:function(a,b){},onDrag:function(a,b){},onComplete:function(a,b){},onEnter:function(a){},onLeave:function(a){},documentDrag:!1,layer:null,feature:null,dragCallbacks:{},featureCallbacks:{},lastPixel:null,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);this.layer=a;this.handlers={drag:new OpenLayers.Handler.Drag(this,OpenLayers.Util.extend({down:this.downFeature,move:this.moveFeature, +up:this.upFeature,out:this.cancel,done:this.doneDragging},this.dragCallbacks),{documentDrag:this.documentDrag}),feature:new OpenLayers.Handler.Feature(this,this.layer,OpenLayers.Util.extend({click:this.clickFeature,clickout:this.clickoutFeature,over:this.overFeature,out:this.outFeature},this.featureCallbacks),{geometryTypes:this.geometryTypes})}},clickFeature:function(a){this.handlers.feature.touch&&(!this.over&&this.overFeature(a))&&(this.handlers.drag.dragstart(this.handlers.feature.evt),this.handlers.drag.stopDown= +!1)},clickoutFeature:function(a){this.handlers.feature.touch&&this.over&&(this.outFeature(a),this.handlers.drag.stopDown=!0)},destroy:function(){this.layer=null;OpenLayers.Control.prototype.destroy.apply(this,[])},activate:function(){return this.handlers.feature.activate()&&OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.handlers.drag.deactivate();this.handlers.feature.deactivate();this.feature=null;this.dragging=!1;this.lastPixel=null;OpenLayers.Element.removeClass(this.map.viewPortDiv, +this.displayClass+"Over");return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},overFeature:function(a){var b=!1;this.handlers.drag.dragging?this.over=this.feature.id==a.id?!0:!1:(this.feature=a,this.handlers.drag.activate(),this.over=b=!0,OpenLayers.Element.addClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onEnter(a));return b},downFeature:function(a){this.lastPixel=a;this.onStart(this.feature,a)},moveFeature:function(a){var b=this.map.getResolution();this.feature.geometry.move(b* +(a.x-this.lastPixel.x),b*(this.lastPixel.y-a.y));this.layer.drawFeature(this.feature);this.lastPixel=a;this.onDrag(this.feature,a)},upFeature:function(a){this.over||this.handlers.drag.deactivate()},doneDragging:function(a){this.onComplete(this.feature,a)},outFeature:function(a){this.handlers.drag.dragging?this.feature.id==a.id&&(this.over=!1):(this.over=!1,this.handlers.drag.deactivate(),OpenLayers.Element.removeClass(this.map.viewPortDiv,this.displayClass+"Over"),this.onLeave(a),this.feature=null)}, +cancel:function(){this.handlers.drag.deactivate();this.over=!1},setMap:function(a){this.handlers.drag.setMap(a);this.handlers.feature.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.DragFeature"});OpenLayers.Control.TransformFeature=OpenLayers.Class(OpenLayers.Control,{geometryTypes:null,layer:null,preserveAspectRatio:!1,rotate:!0,feature:null,renderIntent:"temporary",rotationHandleSymbolizer:null,box:null,center:null,scale:1,ratio:1,rotation:0,handles:null,rotationHandles:null,dragControl:null,irregular:!1,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);this.layer=a;this.rotationHandleSymbolizer||(this.rotationHandleSymbolizer={stroke:!1,pointRadius:10,fillOpacity:0, +cursor:"pointer"});this.createBox();this.createControl()},activate:function(){var a=!1;OpenLayers.Control.prototype.activate.apply(this,arguments)&&(this.dragControl.activate(),this.layer.addFeatures([this.box]),this.rotate&&this.layer.addFeatures(this.rotationHandles),this.layer.addFeatures(this.handles),a=!0);return a},deactivate:function(){var a=!1;OpenLayers.Control.prototype.deactivate.apply(this,arguments)&&(this.layer.removeFeatures(this.handles),this.rotate&&this.layer.removeFeatures(this.rotationHandles), +this.layer.removeFeatures([this.box]),this.dragControl.deactivate(),a=!0);return a},setMap:function(a){this.dragControl.setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},setFeature:function(a,b){b=OpenLayers.Util.applyDefaults(b,{rotation:0,scale:1,ratio:1});var c=this.rotation,d=this.center;OpenLayers.Util.extend(this,b);if(!1!==this.events.triggerEvent("beforesetfeature",{feature:a})){this.feature=a;this.activate();this._setfeature=!0;var e=this.feature.geometry.getBounds();this.box.move(e.getCenterLonLat()); +this.box.geometry.rotate(-c,d);this._angle=0;this.rotation?(c=a.geometry.clone(),c.rotate(-this.rotation,this.center),c=new OpenLayers.Feature.Vector(c.getBounds().toGeometry()),c.geometry.rotate(this.rotation,this.center),this.box.geometry.rotate(this.rotation,this.center),this.box.move(c.geometry.getBounds().getCenterLonLat()),c=c.geometry.components[0].components[0].getBounds().getCenterLonLat()):c=new OpenLayers.LonLat(e.left,e.bottom);this.handles[0].move(c);delete this._setfeature;this.events.triggerEvent("setfeature", +{feature:a})}},unsetFeature:function(){this.active?this.deactivate():(this.feature=null,this.rotation=0,this.ratio=this.scale=1)},createBox:function(){var a=this;this.center=new OpenLayers.Geometry.Point(0,0);this.box=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString([new OpenLayers.Geometry.Point(-1,-1),new OpenLayers.Geometry.Point(0,-1),new OpenLayers.Geometry.Point(1,-1),new OpenLayers.Geometry.Point(1,0),new OpenLayers.Geometry.Point(1,1),new OpenLayers.Geometry.Point(0,1),new OpenLayers.Geometry.Point(-1, +1),new OpenLayers.Geometry.Point(-1,0),new OpenLayers.Geometry.Point(-1,-1)]),null,"string"==typeof this.renderIntent?null:this.renderIntent);this.box.geometry.move=function(b,c){a._moving=!0;OpenLayers.Geometry.LineString.prototype.move.apply(this,arguments);a.center.move(b,c);delete a._moving};for(var b=function(a,b){OpenLayers.Geometry.Point.prototype.move.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.move(a,b);this._handle.geometry.move(a,b)},c=function(a,b,c){OpenLayers.Geometry.Point.prototype.resize.apply(this, +arguments);this._rotationHandle&&this._rotationHandle.geometry.resize(a,b,c);this._handle.geometry.resize(a,b,c)},d=function(a,b){OpenLayers.Geometry.Point.prototype.rotate.apply(this,arguments);this._rotationHandle&&this._rotationHandle.geometry.rotate(a,b);this._handle.geometry.rotate(a,b)},e=function(b,c){var d=this.x,e=this.y;OpenLayers.Geometry.Point.prototype.move.call(this,b,c);if(!a._moving){var f=a.dragControl.handlers.drag.evt,g=!(!a._setfeature&&a.preserveAspectRatio)&&!(f&&f.shiftKey), +h=new OpenLayers.Geometry.Point(d,e),f=a.center;this.rotate(-a.rotation,f);h.rotate(-a.rotation,f);var k=this.x-f.x,l=this.y-f.y,m=k-(this.x-h.x),n=l-(this.y-h.y);a.irregular&&!a._setfeature&&(k-=(this.x-h.x)/2,l-=(this.y-h.y)/2);this.x=d;this.y=e;h=1;g?(l=1E-5>Math.abs(n)?1:l/n,h=(1E-5>Math.abs(m)?1:k/m)/l):(m=Math.sqrt(m*m+n*n),l=Math.sqrt(k*k+l*l)/m);a._moving=!0;a.box.geometry.rotate(-a.rotation,f);delete a._moving;a.box.geometry.resize(l,f,h);a.box.geometry.rotate(a.rotation,f);a.transformFeature({scale:l, +ratio:h});a.irregular&&!a._setfeature&&(k=f.clone(),k.x+=1E-5>Math.abs(d-f.x)?0:this.x-d,k.y+=1E-5>Math.abs(e-f.y)?0:this.y-e,a.box.geometry.move(this.x-d,this.y-e),a.transformFeature({center:k}))}},f=function(b,c){var d=this.x,e=this.y;OpenLayers.Geometry.Point.prototype.move.call(this,b,c);if(!a._moving){var f=a.dragControl.handlers.drag.evt,f=f&&f.shiftKey?45:1,g=a.center,h=this.x-g.x,k=this.y-g.y;this.x=d;this.y=e;d=Math.atan2(k-c,h-b);d=Math.atan2(k,h)-d;d*=180/Math.PI;a._angle=(a._angle+d)% +360;d=a.rotation%f;if(Math.abs(a._angle)>=f||0!==d)d=Math.round(a._angle/f)*f-d,a._angle=0,a.box.geometry.rotate(d,g),a.transformFeature({rotation:d})}},g=Array(8),h=Array(4),k,l,m,n="sw s se e ne n nw w".split(" "),p=0;8>p;++p)k=this.box.geometry.components[p],l=new OpenLayers.Feature.Vector(k.clone(),{role:n[p]+"-resize"},"string"==typeof this.renderIntent?null:this.renderIntent),0==p%2&&(m=new OpenLayers.Feature.Vector(k.clone(),{role:n[p]+"-rotate"},"string"==typeof this.rotationHandleSymbolizer? +null:this.rotationHandleSymbolizer),m.geometry.move=f,k._rotationHandle=m,h[p/2]=m),k.move=b,k.resize=c,k.rotate=d,l.geometry.move=e,k._handle=l,g[p]=l;this.rotationHandles=h;this.handles=g},createControl:function(){var a=this;this.dragControl=new OpenLayers.Control.DragFeature(this.layer,{documentDrag:!0,moveFeature:function(b){this.feature===a.feature&&(this.feature=a.box);OpenLayers.Control.DragFeature.prototype.moveFeature.apply(this,arguments)},onDrag:function(b,c){b===a.box&&a.transformFeature({center:a.center})}, +onStart:function(b,c){var d=!a.geometryTypes||-1!==OpenLayers.Util.indexOf(a.geometryTypes,b.geometry.CLASS_NAME),e=OpenLayers.Util.indexOf(a.handles,b),e=e+OpenLayers.Util.indexOf(a.rotationHandles,b);b!==a.feature&&(b!==a.box&&-2==e&&d)&&a.setFeature(b)},onComplete:function(b,c){a.events.triggerEvent("transformcomplete",{feature:a.feature})}})},drawHandles:function(){for(var a=this.layer,b=0;8>b;++b)this.rotate&&0===b%2&&a.drawFeature(this.rotationHandles[b/2],this.rotationHandleSymbolizer),a.drawFeature(this.handles[b], +this.renderIntent)},transformFeature:function(a){if(!this._setfeature){this.scale*=a.scale||1;this.ratio*=a.ratio||1;var b=this.rotation;this.rotation=(this.rotation+(a.rotation||0))%360;if(!1!==this.events.triggerEvent("beforetransform",a)){var c=this.feature,d=c.geometry,e=this.center;d.rotate(-b,e);a.scale||a.ratio?d.resize(a.scale,e,a.ratio):a.center&&c.move(a.center.getBounds().getCenterLonLat());d.rotate(this.rotation,e);this.layer.drawFeature(c);c.toState(OpenLayers.State.UPDATE);this.events.triggerEvent("transform", +a)}}this.layer.drawFeature(this.box,this.renderIntent);this.drawHandles()},destroy:function(){for(var a,b=0;8>b;++b)a=this.box.geometry.components[b],a._handle.destroy(),a._handle=null,a._rotationHandle&&a._rotationHandle.destroy(),a._rotationHandle=null;this.rotationHandles=this.rotationHandleSymbolizer=this.handles=this.feature=this.center=null;this.box.destroy();this.layer=this.box=null;this.dragControl.destroy();this.dragControl=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)}, +CLASS_NAME:"OpenLayers.Control.TransformFeature"});OpenLayers.Handler.Box=OpenLayers.Class(OpenLayers.Handler,{dragHandler:null,boxDivClassName:"olHandlerBoxZoomBox",boxOffsets:null,initialize:function(a,b,c){OpenLayers.Handler.prototype.initialize.apply(this,arguments);this.dragHandler=new OpenLayers.Handler.Drag(this,{down:this.startBox,move:this.moveBox,out:this.removeBox,up:this.endBox},{keyMask:this.keyMask})},destroy:function(){OpenLayers.Handler.prototype.destroy.apply(this,arguments);this.dragHandler&&(this.dragHandler.destroy(),this.dragHandler= +null)},setMap:function(a){OpenLayers.Handler.prototype.setMap.apply(this,arguments);this.dragHandler&&this.dragHandler.setMap(a)},startBox:function(a){this.callback("start",[]);this.zoomBox=OpenLayers.Util.createDiv("zoomBox",{x:-9999,y:-9999});this.zoomBox.className=this.boxDivClassName;this.zoomBox.style.zIndex=this.map.Z_INDEX_BASE.Popup-1;this.map.viewPortDiv.appendChild(this.zoomBox);OpenLayers.Element.addClass(this.map.viewPortDiv,"olDrawBox")},moveBox:function(a){var b=this.dragHandler.start.x, +c=this.dragHandler.start.y,d=Math.abs(b-a.x),e=Math.abs(c-a.y),f=this.getBoxOffsets();this.zoomBox.style.width=d+f.width+1+"px";this.zoomBox.style.height=e+f.height+1+"px";this.zoomBox.style.left=(a.x<b?b-d-f.left:b-f.left)+"px";this.zoomBox.style.top=(a.y<c?c-e-f.top:c-f.top)+"px"},endBox:function(a){var b;if(5<Math.abs(this.dragHandler.start.x-a.x)||5<Math.abs(this.dragHandler.start.y-a.y)){var c=this.dragHandler.start;b=Math.min(c.y,a.y);var d=Math.max(c.y,a.y),e=Math.min(c.x,a.x);a=Math.max(c.x, +a.x);b=new OpenLayers.Bounds(e,d,a,b)}else b=this.dragHandler.start.clone();this.removeBox();this.callback("done",[b])},removeBox:function(){this.map.viewPortDiv.removeChild(this.zoomBox);this.boxOffsets=this.zoomBox=null;OpenLayers.Element.removeClass(this.map.viewPortDiv,"olDrawBox")},activate:function(){return OpenLayers.Handler.prototype.activate.apply(this,arguments)?(this.dragHandler.activate(),!0):!1},deactivate:function(){return OpenLayers.Handler.prototype.deactivate.apply(this,arguments)? +(this.dragHandler.deactivate()&&this.zoomBox&&this.removeBox(),!0):!1},getBoxOffsets:function(){if(!this.boxOffsets){var a=document.createElement("div");a.style.position="absolute";a.style.border="1px solid black";a.style.width="3px";document.body.appendChild(a);var b=3==a.clientWidth;document.body.removeChild(a);var a=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-left-width")),c=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-right-width")),d=parseInt(OpenLayers.Element.getStyle(this.zoomBox, +"border-top-width")),e=parseInt(OpenLayers.Element.getStyle(this.zoomBox,"border-bottom-width"));this.boxOffsets={left:a,right:c,top:d,bottom:e,width:!1===b?a+c:0,height:!1===b?d+e:0}}return this.boxOffsets},CLASS_NAME:"OpenLayers.Handler.Box"});OpenLayers.Control.ZoomBox=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,out:!1,keyMask:null,alwaysZoom:!1,zoomOnClick:!0,draw:function(){this.handler=new OpenLayers.Handler.Box(this,{done:this.zoomBox},{keyMask:this.keyMask})},zoomBox:function(a){if(a instanceof OpenLayers.Bounds){var b,c=a.getCenterPixel();if(this.out){b=Math.min(this.map.size.h/(a.bottom-a.top),this.map.size.w/(a.right-a.left));var d=this.map.getExtent(),e=this.map.getLonLatFromPixel(c),f=e.lon-d.getWidth()/ +2*b;a=e.lon+d.getWidth()/2*b;var g=e.lat-d.getHeight()/2*b;b=e.lat+d.getHeight()/2*b;b=new OpenLayers.Bounds(f,g,a,b)}else f=this.map.getLonLatFromPixel({x:a.left,y:a.bottom}),a=this.map.getLonLatFromPixel({x:a.right,y:a.top}),b=new OpenLayers.Bounds(f.lon,f.lat,a.lon,a.lat);f=this.map.getZoom();g=this.map.getSize();a=g.w/2;g=g.h/2;b=this.map.getZoomForExtent(b);d=this.map.getResolution();e=this.map.getResolutionForZoom(b);d==e?this.map.setCenter(this.map.getLonLatFromPixel(c)):this.map.zoomTo(b, +{x:(d*c.x-e*a)/(d-e),y:(d*c.y-e*g)/(d-e)});f==this.map.getZoom()&&!0==this.alwaysZoom&&this.map.zoomTo(f+(this.out?-1:1))}else this.zoomOnClick&&(this.out?this.map.zoomTo(this.map.getZoom()-1,a):this.map.zoomTo(this.map.getZoom()+1,a))},CLASS_NAME:"OpenLayers.Control.ZoomBox"});OpenLayers.Control.DragPan=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,panned:!1,interval:0,documentDrag:!1,kinetic:null,enableKinetic:!0,kineticInterval:10,draw:function(){if(this.enableKinetic&&OpenLayers.Kinetic){var a={interval:this.kineticInterval};"object"===typeof this.enableKinetic&&(a=OpenLayers.Util.extend(a,this.enableKinetic));this.kinetic=new OpenLayers.Kinetic(a)}this.handler=new OpenLayers.Handler.Drag(this,{move:this.panMap,done:this.panMapDone,down:this.panMapStart}, +{interval:this.interval,documentDrag:this.documentDrag})},panMapStart:function(){this.kinetic&&this.kinetic.begin()},panMap:function(a){this.kinetic&&this.kinetic.update(a);this.panned=!0;this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:!0,animate:!1})},panMapDone:function(a){if(this.panned){var b=null;this.kinetic&&(b=this.kinetic.end(a));this.map.pan(this.handler.last.x-a.x,this.handler.last.y-a.y,{dragging:!!b,animate:!1});if(b){var c=this;this.kinetic.move(b,function(a,b, +f){c.map.pan(a,b,{dragging:!f,animate:!1})})}this.panned=!1}},CLASS_NAME:"OpenLayers.Control.DragPan"});OpenLayers.Control.Navigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,documentDrag:!1,zoomBox:null,zoomBoxEnabled:!0,zoomWheelEnabled:!0,mouseWheelOptions:null,handleRightClicks:!1,zoomBoxKeyMask:OpenLayers.Handler.MOD_SHIFT,autoActivate:!0,initialize:function(a){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();this.dragPan&&this.dragPan.destroy();this.dragPan=null; +this.zoomBox&&this.zoomBox.destroy();this.zoomBox=null;this.pinchZoom&&this.pinchZoom.destroy();this.pinchZoom=null;OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.dragPan.activate();this.zoomWheelEnabled&&this.handlers.wheel.activate();this.handlers.click.activate();this.zoomBoxEnabled&&this.zoomBox.activate();this.pinchZoom&&this.pinchZoom.activate();return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){this.pinchZoom&&this.pinchZoom.deactivate(); +this.zoomBox.deactivate();this.dragPan.deactivate();this.handlers.click.deactivate();this.handlers.wheel.deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},draw:function(){this.handleRightClicks&&(this.map.viewPortDiv.oncontextmenu=OpenLayers.Function.False);this.handlers.click=new OpenLayers.Handler.Click(this,{click:this.defaultClick,dblclick:this.defaultDblClick,dblrightclick:this.defaultDblRightClick},{"double":!0,stopDouble:!0});this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map, +documentDrag:this.documentDrag},this.dragPanOptions));this.zoomBox=new OpenLayers.Control.ZoomBox({map:this.map,keyMask:this.zoomBoxKeyMask});this.dragPan.draw();this.zoomBox.draw();this.handlers.wheel=new OpenLayers.Handler.MouseWheel(this,{up:this.wheelUp,down:this.wheelDown},OpenLayers.Util.extend(this.map.fractionalZoom?{}:{cumulative:!1,interval:50,maxDelta:6},this.mouseWheelOptions));OpenLayers.Control.PinchZoom&&(this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map}, +this.pinchZoomOptions)))},defaultClick:function(a){a.lastTouches&&2==a.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(a){this.map.zoomTo(this.map.zoom+1,a.xy)},defaultDblRightClick:function(a){this.map.zoomTo(this.map.zoom-1,a.xy)},wheelChange:function(a,b){this.map.fractionalZoom||(b=Math.round(b));var c=this.map.getZoom(),d;d=Math.max(c+b,0);d=Math.min(d,this.map.getNumZoomLevels());d!==c&&this.map.zoomTo(d,a.xy)},wheelUp:function(a,b){this.wheelChange(a,b||1)},wheelDown:function(a, +b){this.wheelChange(a,b||-1)},disableZoomBox:function(){this.zoomBoxEnabled=!1;this.zoomBox.deactivate()},enableZoomBox:function(){this.zoomBoxEnabled=!0;this.active&&this.zoomBox.activate()},disableZoomWheel:function(){this.zoomWheelEnabled=!1;this.handlers.wheel.deactivate()},enableZoomWheel:function(){this.zoomWheelEnabled=!0;this.active&&this.handlers.wheel.activate()},CLASS_NAME:"OpenLayers.Control.Navigation"});OpenLayers.Control.DrawFeature=OpenLayers.Class(OpenLayers.Control,{layer:null,callbacks:null,multi:!1,featureAdded:function(){},initialize:function(a,b,c){OpenLayers.Control.prototype.initialize.apply(this,[c]);this.callbacks=OpenLayers.Util.extend({done:this.drawFeature,modify:function(a,b){this.layer.events.triggerEvent("sketchmodified",{vertex:a,feature:b})},create:function(a,b){this.layer.events.triggerEvent("sketchstarted",{vertex:a,feature:b})}},this.callbacks);this.layer=a;this.handlerOptions= +this.handlerOptions||{};this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{renderers:a.renderers,rendererOptions:a.rendererOptions});"multi"in this.handlerOptions||(this.handlerOptions.multi=this.multi);if(a=this.layer.styleMap&&this.layer.styleMap.styles.temporary)this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":a})});this.handler=new b(this,this.callbacks,this.handlerOptions)}, +drawFeature:function(a){a=new OpenLayers.Feature.Vector(a);!1!==this.layer.events.triggerEvent("sketchcomplete",{feature:a})&&(a.state=OpenLayers.State.INSERT,this.layer.addFeatures([a]),this.featureAdded(a),this.events.triggerEvent("featureadded",{feature:a}))},insertXY:function(a,b){this.handler&&this.handler.line&&this.handler.insertXY(a,b)},insertDeltaXY:function(a,b){this.handler&&this.handler.line&&this.handler.insertDeltaXY(a,b)},insertDirectionLength:function(a,b){this.handler&&this.handler.line&& +this.handler.insertDirectionLength(a,b)},insertDeflectionLength:function(a,b){this.handler&&this.handler.line&&this.handler.insertDeflectionLength(a,b)},undo:function(){return this.handler.undo&&this.handler.undo()},redo:function(){return this.handler.redo&&this.handler.redo()},finishSketch:function(){this.handler.finishGeometry()},cancel:function(){this.handler.cancel()},CLASS_NAME:"OpenLayers.Control.DrawFeature"});OpenLayers.Handler.Polygon=OpenLayers.Class(OpenLayers.Handler.Path,{holeModifier:null,drawingHole:!1,polygon:null,createFeature:function(a){a=this.layer.getLonLatFromViewPortPx(a);a=new OpenLayers.Geometry.Point(a.lon,a.lat);this.point=new OpenLayers.Feature.Vector(a);this.line=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LinearRing([this.point.geometry]));this.polygon=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon([this.line.geometry]));this.callback("create",[this.point.geometry, +this.getSketch()]);this.point.geometry.clearBounds();this.layer.addFeatures([this.polygon,this.point],{silent:!0})},addPoint:function(a){if(!this.drawingHole&&this.holeModifier&&this.evt&&this.evt[this.holeModifier])for(var b=this.point.geometry,c=this.control.layer.features,d,e=c.length-1;0<=e;--e)if(d=c[e].geometry,(d instanceof OpenLayers.Geometry.Polygon||d instanceof OpenLayers.Geometry.MultiPolygon)&&d.intersects(b)){b=c[e];this.control.layer.removeFeatures([b],{silent:!0});this.control.layer.events.registerPriority("sketchcomplete", +this,this.finalizeInteriorRing);this.control.layer.events.registerPriority("sketchmodified",this,this.enforceTopology);b.geometry.addComponent(this.line.geometry);this.polygon=b;this.drawingHole=!0;break}OpenLayers.Handler.Path.prototype.addPoint.apply(this,arguments)},getCurrentPointIndex:function(){return this.line.geometry.components.length-2},enforceTopology:function(a){a=a.vertex;var b=this.line.geometry.components;this.polygon.geometry.intersects(a)||(b=b[b.length-3],a.x=b.x,a.y=b.y)},finishGeometry:function(){this.line.geometry.removeComponent(this.line.geometry.components[this.line.geometry.components.length- +2]);this.removePoint();this.finalize()},finalizeInteriorRing:function(){var a=this.line.geometry,b=0!==a.getArea();if(b){for(var c=this.polygon.geometry.components,d=c.length-2;0<=d;--d)if(a.intersects(c[d])){b=!1;break}if(b)a:for(d=c.length-2;0<d;--d)for(var e=c[d].components,f=0,g=e.length;f<g;++f)if(a.containsPoint(e[f])){b=!1;break a}}b?this.polygon.state!==OpenLayers.State.INSERT&&(this.polygon.state=OpenLayers.State.UPDATE):this.polygon.geometry.removeComponent(a);this.restoreFeature();return!1}, +cancel:function(){this.drawingHole&&(this.polygon.geometry.removeComponent(this.line.geometry),this.restoreFeature(!0));return OpenLayers.Handler.Path.prototype.cancel.apply(this,arguments)},restoreFeature:function(a){this.control.layer.events.unregister("sketchcomplete",this,this.finalizeInteriorRing);this.control.layer.events.unregister("sketchmodified",this,this.enforceTopology);this.layer.removeFeatures([this.polygon],{silent:!0});this.control.layer.addFeatures([this.polygon],{silent:!0});this.drawingHole= +!1;a||this.control.layer.events.triggerEvent("sketchcomplete",{feature:this.polygon})},destroyFeature:function(a){OpenLayers.Handler.Path.prototype.destroyFeature.call(this,a);this.polygon=null},drawFeature:function(){this.layer.drawFeature(this.polygon,this.style);this.layer.drawFeature(this.point,this.style)},getSketch:function(){return this.polygon},getGeometry:function(){var a=this.polygon&&this.polygon.geometry;a&&this.multi&&(a=new OpenLayers.Geometry.MultiPolygon([a]));return a},CLASS_NAME:"OpenLayers.Handler.Polygon"});OpenLayers.Control.EditingToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{citeCompliant:!1,initialize:function(a,b){OpenLayers.Control.Panel.prototype.initialize.apply(this,[b]);this.addControls([new OpenLayers.Control.Navigation]);var c=[new OpenLayers.Control.DrawFeature(a,OpenLayers.Handler.Point,{displayClass:"olControlDrawFeaturePoint",handlerOptions:{citeCompliant:this.citeCompliant}}),new OpenLayers.Control.DrawFeature(a,OpenLayers.Handler.Path,{displayClass:"olControlDrawFeaturePath",handlerOptions:{citeCompliant:this.citeCompliant}}), +new OpenLayers.Control.DrawFeature(a,OpenLayers.Handler.Polygon,{displayClass:"olControlDrawFeaturePolygon",handlerOptions:{citeCompliant:this.citeCompliant}})];this.addControls(c)},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);null===this.defaultControl&&(this.defaultControl=this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.EditingToolbar"});OpenLayers.Strategy.BBOX=OpenLayers.Class(OpenLayers.Strategy,{bounds:null,resolution:null,ratio:2,resFactor:null,response:null,activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);a&&(this.layer.events.on({moveend:this.update,refresh:this.update,visibilitychanged:this.update,scope:this}),this.update());return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);a&&this.layer.events.un({moveend:this.update,refresh:this.update,visibilitychanged:this.update, +scope:this});return a},update:function(a){var b=this.getMapBounds();null!==b&&(a&&a.force||this.layer.visibility&&this.layer.calculateInRange()&&this.invalidBounds(b))&&(this.calculateBounds(b),this.resolution=this.layer.map.getResolution(),this.triggerRead(a))},getMapBounds:function(){if(null===this.layer.map)return null;var a=this.layer.map.getExtent();a&&!this.layer.projection.equals(this.layer.map.getProjectionObject())&&(a=a.clone().transform(this.layer.map.getProjectionObject(),this.layer.projection)); +return a},invalidBounds:function(a){a||(a=this.getMapBounds());a=!this.bounds||!this.bounds.containsBounds(a);!a&&this.resFactor&&(a=this.resolution/this.layer.map.getResolution(),a=a>=this.resFactor||a<=1/this.resFactor);return a},calculateBounds:function(a){a||(a=this.getMapBounds());var b=a.getCenterLonLat(),c=a.getWidth()*this.ratio;a=a.getHeight()*this.ratio;this.bounds=new OpenLayers.Bounds(b.lon-c/2,b.lat-a/2,b.lon+c/2,b.lat+a/2)},triggerRead:function(a){!this.response||a&&!0===a.noAbort|| +(this.layer.protocol.abort(this.response),this.layer.events.triggerEvent("loadend"));var b={filter:this.createFilter()};this.layer.events.triggerEvent("loadstart",b);this.response=this.layer.protocol.read(OpenLayers.Util.applyDefaults({filter:b.filter,callback:this.merge,scope:this},a))},createFilter:function(){var a=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,value:this.bounds,projection:this.layer.projection});this.layer.filter&&(a=new OpenLayers.Filter.Logical({type:OpenLayers.Filter.Logical.AND, +filters:[this.layer.filter,a]}));return a},merge:function(a){this.layer.destroyFeatures();if(a.success()){var b=a.features;if(b&&0<b.length){var c=this.layer.projection,d=this.layer.map.getProjectionObject();if(!d.equals(c))for(var e,f=0,g=b.length;f<g;++f)(e=b[f].geometry)&&e.transform(c,d);this.layer.addFeatures(b)}}else this.bounds=null;this.response=null;this.layer.events.triggerEvent("loadend",{response:a})},CLASS_NAME:"OpenLayers.Strategy.BBOX"});OpenLayers.Layer.WorldWind=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{},isBaseLayer:!0,lzd:null,zoomLevels:null,initialize:function(a,b,c,d,e,f){this.lzd=c;this.zoomLevels=d;c=[];c.push(a,b,e,f);OpenLayers.Layer.Grid.prototype.initialize.apply(this,c);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS)},getZoom:function(){var a=this.map.getZoom();this.map.getMaxExtent();return a-=Math.log(this.maxResolution/(this.lzd/512))/Math.log(2)},getURL:function(a){a=this.adjustBounds(a); +var b=this.getZoom(),c=this.map.getMaxExtent(),d=this.lzd/Math.pow(2,this.getZoom()),e=Math.floor((a.left-c.left)/d);a=Math.floor((a.bottom-c.bottom)/d);return this.map.getResolution()<=this.lzd/512&&this.getZoom()<=this.zoomLevels?this.getFullRequestString({L:b,X:e,Y:a}):OpenLayers.Util.getImageLocation("blank.gif")},CLASS_NAME:"OpenLayers.Layer.WorldWind"});OpenLayers.Protocol.CSW=function(a){a=OpenLayers.Util.applyDefaults(a,OpenLayers.Protocol.CSW.DEFAULTS);var b=OpenLayers.Protocol.CSW["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported CSW version: "+a.version;return new b(a)};OpenLayers.Protocol.CSW.DEFAULTS={version:"2.0.2"};OpenLayers.Format.WMTSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",yx:{"urn:ogc:def:crs:EPSG::4326":!0},createLayer:function(a,b){if(!("layer"in b))throw Error("Missing property 'layer' in configuration.");for(var c=a.contents,d,e=0,f=c.layers.length;e<f;++e)if(c.layers[e].identifier===b.layer){d=c.layers[e];break}if(!d)throw Error("Layer not found");var g=b.format;!g&&(d.formats&&d.formats.length)&&(g=d.formats[0]);var h;b.matrixSet?h=c.tileMatrixSets[b.matrixSet]: +1<=d.tileMatrixSetLinks.length&&(h=c.tileMatrixSets[d.tileMatrixSetLinks[0].tileMatrixSet]);if(!h)throw Error("matrixSet not found");for(var k,e=0,f=d.styles.length;e<f&&(k=d.styles[e],!k.isDefault);++e);c=b.requestEncoding;if(!c&&(c="KVP",a.operationsMetadata.GetTile.dcp.http)){var l=a.operationsMetadata.GetTile.dcp.http;l.get[0].constraints&&(l=l.get[0].constraints.GetEncoding.allowedValues,l.KVP||!l.REST&&!l.RESTful||(c="REST"))}var l=[],m=b.params||{};delete b.params;for(var n=0,p=d.dimensions.length;n< +p;n++){var q=d.dimensions[n];l.push(q.identifier);m.hasOwnProperty(q.identifier)||(m[q.identifier]=q["default"])}var n=b.projection||h.supportedCRS.replace(/urn:ogc:def:crs:(\w+):(.*:)?(\w+)$/,"$1:$3"),p=b.units||("EPSG:4326"===n?"degrees":"m"),q=[],r;for(r in h.matrixIds)h.matrixIds.hasOwnProperty(r)&&q.push(2.8E-4*h.matrixIds[r].scaleDenominator/OpenLayers.METERS_PER_INCH/OpenLayers.INCHES_PER_UNIT[p]);if("REST"===c&&d.resourceUrls){r=[];for(var f=0,s=d.resourceUrls.length;f<s;++f)e=d.resourceUrls[f], +e.format===g&&"tile"===e.resourceType&&r.push(e.template)}else{s=a.operationsMetadata.GetTile.dcp.http.get;r=[];for(var t,e=0,f=s.length;e<f;e++)t=s[e].constraints,(!t||t&&t.GetEncoding.allowedValues[c])&&r.push(s[e].url)}return new OpenLayers.Layer.WMTS(OpenLayers.Util.applyDefaults(b,{url:r,requestEncoding:c,name:d.title,style:k.identifier,format:g,matrixIds:h.matrixIds,matrixSet:h.identifier,projection:n,units:p,resolutions:!1===b.isBaseLayer?void 0:q,serverResolutions:q,tileFullExtent:h.bounds, +dimensions:l,params:m}))},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities"});OpenLayers.Layer.Google.v3={DEFAULTS:{sphericalMercator:!0,projection:"EPSG:900913"},animationEnabled:!0,loadMapObject:function(){this.type||(this.type=google.maps.MapTypeId.ROADMAP);var a,b=OpenLayers.Layer.Google.cache[this.map.id];b?(a=b.mapObject,++b.count):(a=this.map.getCenter(),b=document.createElement("div"),b.className="olForeignContainer",b.style.width="100%",b.style.height="100%",a=new google.maps.Map(b,{center:a?new google.maps.LatLng(a.lat,a.lon):new google.maps.LatLng(0,0),zoom:this.map.getZoom()|| +0,mapTypeId:this.type,disableDefaultUI:!0,keyboardShortcuts:!1,draggable:!1,disableDoubleClickZoom:!0,scrollwheel:!1,streetViewControl:!1}),b=document.createElement("div"),b.style.width="100%",b.style.height="100%",a.controls[google.maps.ControlPosition.TOP_LEFT].push(b),b={googleControl:b,mapObject:a,count:1},OpenLayers.Layer.Google.cache[this.map.id]=b);this.mapObject=a;this.setGMapVisibility(this.visibility)},onMapResize:function(){this.visibility&&google.maps.event.trigger(this.mapObject,"resize")}, +setGMapVisibility:function(a){var b=OpenLayers.Layer.Google.cache[this.map.id],c=this.map;if(b){for(var d=this.type,e=c.layers,f,g=e.length-1;0<=g;--g)if(f=e[g],f instanceof OpenLayers.Layer.Google&&!0===f.visibility&&!0===f.inRange){d=f.type;a=!0;break}e=this.mapObject.getDiv();if(!0===a){if(e.parentNode!==c.div)if(b.rendered)c.div.appendChild(e),b.googleControl.appendChild(c.viewPortDiv),google.maps.event.trigger(this.mapObject,"resize");else{var h=this;google.maps.event.addListenerOnce(this.mapObject, +"tilesloaded",function(){b.rendered=!0;h.setGMapVisibility(h.getVisibility());h.moveTo(h.map.getCenter())})}this.mapObject.setMapTypeId(d)}else b.googleControl.hasChildNodes()&&(c.div.appendChild(c.viewPortDiv),c.div.removeChild(e))}},getMapContainer:function(){return this.mapObject.getDiv()},getMapObjectBoundsFromOLBounds:function(a){var b=null;null!=a&&(b=this.sphericalMercator?this.inverseMercator(a.bottom,a.left):new OpenLayers.LonLat(a.bottom,a.left),a=this.sphericalMercator?this.inverseMercator(a.top, +a.right):new OpenLayers.LonLat(a.top,a.right),b=new google.maps.LatLngBounds(new google.maps.LatLng(b.lat,b.lon),new google.maps.LatLng(a.lat,a.lon)));return b},getMapObjectLonLatFromMapObjectPixel:function(a){var b=this.map.getSize(),c=this.getLongitudeFromMapObjectLonLat(this.mapObject.center),d=this.getLatitudeFromMapObjectLonLat(this.mapObject.center),e=this.map.getResolution();a=new OpenLayers.LonLat(c+(a.x-b.w/2)*e,d-(a.y-b.h/2)*e);this.wrapDateLine&&(a=a.wrapDateLine(this.maxExtent));return this.getMapObjectLonLatFromLonLat(a.lon, +a.lat)},getMapObjectPixelFromMapObjectLonLat:function(a){var b=this.getLongitudeFromMapObjectLonLat(a);a=this.getLatitudeFromMapObjectLonLat(a);var c=this.map.getResolution(),d=this.map.getExtent();return this.getMapObjectPixelFromXY(1/c*(b-d.left),1/c*(d.top-a))},setMapObjectCenter:function(a,b){if(!1===this.animationEnabled&&b!=this.mapObject.zoom){var c=this.getMapContainer();google.maps.event.addListenerOnce(this.mapObject,"idle",function(){c.style.visibility=""});c.style.visibility="hidden"}this.mapObject.setOptions({center:a, +zoom:b})},getMapObjectZoomFromMapObjectBounds:function(a){return this.mapObject.getBoundsZoomLevel(a)},getMapObjectLonLatFromLonLat:function(a,b){var c;this.sphericalMercator?(c=this.inverseMercator(a,b),c=new google.maps.LatLng(c.lat,c.lon)):c=new google.maps.LatLng(b,a);return c},getMapObjectPixelFromXY:function(a,b){return new google.maps.Point(a,b)}};OpenLayers.Format.WPSDescribeProcess=OpenLayers.Class(OpenLayers.Format.XML,{VERSION:"1.0.0",namespaces:{wps:"http://www.opengis.net/wps/1.0.0",ows:"http://www.opengis.net/ows/1.1",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd",defaultPrefix:"wps",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this, +[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b},readers:{wps:{ProcessDescriptions:function(a,b){b.processDescriptions={};this.readChildNodes(a,b.processDescriptions)},ProcessDescription:function(a,b){var c={processVersion:this.getAttributeNS(a,this.namespaces.wps,"processVersion"),statusSupported:"true"===a.getAttribute("statusSupported"),storeSupported:"true"===a.getAttribute("storeSupported")};this.readChildNodes(a,c);b[c.identifier]=c},DataInputs:function(a, +b){b.dataInputs=[];this.readChildNodes(a,b.dataInputs)},ProcessOutputs:function(a,b){b.processOutputs=[];this.readChildNodes(a,b.processOutputs)},Output:function(a,b){var c={};this.readChildNodes(a,c);b.push(c)},ComplexOutput:function(a,b){b.complexOutput={};this.readChildNodes(a,b.complexOutput)},LiteralOutput:function(a,b){b.literalOutput={};this.readChildNodes(a,b.literalOutput)},Input:function(a,b){var c={maxOccurs:parseInt(a.getAttribute("maxOccurs")),minOccurs:parseInt(a.getAttribute("minOccurs"))}; +this.readChildNodes(a,c);b.push(c)},BoundingBoxData:function(a,b){b.boundingBoxData={};this.readChildNodes(a,b.boundingBoxData)},CRS:function(a,b){b.CRSs||(b.CRSs={});b.CRSs[this.getChildValue(a)]=!0},LiteralData:function(a,b){b.literalData={};this.readChildNodes(a,b.literalData)},ComplexData:function(a,b){b.complexData={};this.readChildNodes(a,b.complexData)},Default:function(a,b){b["default"]={};this.readChildNodes(a,b["default"])},Supported:function(a,b){b.supported={};this.readChildNodes(a,b.supported)}, +Format:function(a,b){var c={};this.readChildNodes(a,c);b.formats||(b.formats={});b.formats[c.mimeType]=!0},MimeType:function(a,b){b.mimeType=this.getChildValue(a)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSDescribeProcess"});OpenLayers.Format.WKT=OpenLayers.Class(OpenLayers.Format,{initialize:function(a){this.regExes={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(a){var b,c;a=a.replace(/[\n\r]/g," ");if(c=this.regExes.typeStr.exec(a))if(a=c[1].toLowerCase(),c=c[2],this.parse[a]&&(b=this.parse[a].apply(this,[c])),this.internalProjection&&this.externalProjection)if(b&& +"OpenLayers.Feature.Vector"==b.CLASS_NAME)b.geometry.transform(this.externalProjection,this.internalProjection);else if(b&&"geometrycollection"!=a&&"object"==typeof b)for(a=0,c=b.length;a<c;a++)b[a].geometry.transform(this.externalProjection,this.internalProjection);return b},write:function(a){var b,c;a.constructor==Array?c=!0:(a=[a],c=!1);var d=[];c&&d.push("GEOMETRYCOLLECTION(");for(var e=0,f=a.length;e<f;++e)c&&0<e&&d.push(","),b=a[e].geometry,d.push(this.extractGeometry(b));c&&d.push(")");return d.join("")}, +extractGeometry:function(a){var b=a.CLASS_NAME.split(".")[2].toLowerCase();if(!this.extract[b])return null;this.internalProjection&&this.externalProjection&&(a=a.clone(),a.transform(this.internalProjection,this.externalProjection));return("collection"==b?"GEOMETRYCOLLECTION":b.toUpperCase())+"("+this.extract[b].apply(this,[a])+")"},extract:{point:function(a){return a.x+" "+a.y},multipoint:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push("("+this.extract.point.apply(this,[a.components[c]])+ +")");return b.join(",")},linestring:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extract.point.apply(this,[a.components[c]]));return b.join(",")},multilinestring:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push("("+this.extract.linestring.apply(this,[a.components[c]])+")");return b.join(",")},polygon:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push("("+this.extract.linestring.apply(this,[a.components[c]])+")");return b.join(",")},multipolygon:function(a){for(var b= +[],c=0,d=a.components.length;c<d;++c)b.push("("+this.extract.polygon.apply(this,[a.components[c]])+")");return b.join(",")},collection:function(a){for(var b=[],c=0,d=a.components.length;c<d;++c)b.push(this.extractGeometry.apply(this,[a.components[c]]));return b.join(",")}},parse:{point:function(a){a=OpenLayers.String.trim(a).split(this.regExes.spaces);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(a[0],a[1]))},multipoint:function(a){for(var b=OpenLayers.String.trim(a).split(","), +c=[],d=0,e=b.length;d<e;++d)a=b[d].replace(this.regExes.trimParens,"$1"),c.push(this.parse.point.apply(this,[a]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPoint(c))},linestring:function(a){a=OpenLayers.String.trim(a).split(",");for(var b=[],c=0,d=a.length;c<d;++c)b.push(this.parse.point.apply(this,[a[c]]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(b))},multilinestring:function(a){for(var b=OpenLayers.String.trim(a).split(this.regExes.parenComma), +c=[],d=0,e=b.length;d<e;++d)a=b[d].replace(this.regExes.trimParens,"$1"),c.push(this.parse.linestring.apply(this,[a]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiLineString(c))},polygon:function(a){var b;a=OpenLayers.String.trim(a).split(this.regExes.parenComma);for(var c=[],d=0,e=a.length;d<e;++d)b=a[d].replace(this.regExes.trimParens,"$1"),b=this.parse.linestring.apply(this,[b]).geometry,b=new OpenLayers.Geometry.LinearRing(b.components),c.push(b);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Polygon(c))}, +multipolygon:function(a){for(var b=OpenLayers.String.trim(a).split(this.regExes.doubleParenComma),c=[],d=0,e=b.length;d<e;++d)a=b[d].replace(this.regExes.trimParens,"$1"),c.push(this.parse.polygon.apply(this,[a]).geometry);return new OpenLayers.Feature.Vector(new OpenLayers.Geometry.MultiPolygon(c))},geometrycollection:function(a){a=a.replace(/,\s*([A-Za-z])/g,"|$1");a=OpenLayers.String.trim(a).split("|");for(var b=[],c=0,d=a.length;c<d;++c)b.push(OpenLayers.Format.WKT.prototype.read.apply(this,[a[c]])); +return b}},CLASS_NAME:"OpenLayers.Format.WKT"});OpenLayers.WPSProcess=OpenLayers.Class({client:null,server:null,identifier:null,description:null,localWPS:"http://geoserver/wps",formats:null,chained:0,executeCallbacks:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.executeCallbacks=[];this.formats={"application/wkt":new OpenLayers.Format.WKT,"application/json":new OpenLayers.Format.GeoJSON}},describe:function(a){a=a||{};if(!this.description)this.client.describeProcess(this.server,this.identifier,function(b){this.description||this.parseDescription(b); +a.callback&&a.callback.call(a.scope,this.description)},this);else if(a.callback){var b=this.description;window.setTimeout(function(){a.callback.call(a.scope,b)},0)}},configure:function(a){this.describe({callback:function(){var b=this.description,c=a.inputs,d,e,f;e=0;for(f=b.dataInputs.length;e<f;++e)d=b.dataInputs[e],this.setInputData(d,c[d.identifier]);a.callback&&a.callback.call(a.scope)},scope:this});return this},execute:function(a){this.configure({inputs:a.inputs,callback:function(){var b=this, +c=this.getOutputIndex(b.description.processOutputs,a.output);b.setResponseForm({outputIndex:c});(function e(){OpenLayers.Util.removeItem(b.executeCallbacks,e);0!==b.chained?b.executeCallbacks.push(e):OpenLayers.Request.POST({url:b.client.servers[b.server].url,data:(new OpenLayers.Format.WPSExecute).write(b.description),success:function(e){var g=b.findMimeType(b.description.processOutputs[c].complexOutput.supported.formats);e=b.formats[g].read(e.responseText);e instanceof OpenLayers.Feature.Vector&& +(e=[e]);a.success&&(g={},g[a.output||"result"]=e,a.success.call(a.scope,g))},scope:b})})()},scope:this})},output:function(a){return new OpenLayers.WPSProcess.ChainLink({process:this,output:a})},parseDescription:function(a){a=this.client.servers[this.server];this.description=(new OpenLayers.Format.WPSDescribeProcess).read(a.processDescription[this.identifier]).processDescriptions[this.identifier]},setInputData:function(a,b){delete a.data;delete a.reference;if(b instanceof OpenLayers.WPSProcess.ChainLink)++this.chained, +a.reference={method:"POST",href:b.process.server===this.server?this.localWPS:this.client.servers[b.process.server].url},b.process.describe({callback:function(){--this.chained;this.chainProcess(a,b)},scope:this});else{a.data={};var c=a.complexData;c?(c=this.findMimeType(c.supported.formats),a.data.complexData={mimeType:c,value:this.formats[c].write(this.toFeatures(b))}):a.data.literalData={value:b}}},setResponseForm:function(a){a=a||{};var b=this.description.processOutputs[a.outputIndex||0];this.description.responseForm= +{rawDataOutput:{identifier:b.identifier,mimeType:this.findMimeType(b.complexOutput.supported.formats,a.supportedFormats)}}},getOutputIndex:function(a,b){var c;if(b)for(var d=a.length-1;0<=d;--d){if(a[d].identifier===b){c=d;break}}else c=0;return c},chainProcess:function(a,b){var c=this.getOutputIndex(b.process.description.processOutputs,b.output);a.reference.mimeType=this.findMimeType(a.complexData.supported.formats,b.process.description.processOutputs[c].complexOutput.supported.formats);var d={}; +d[a.reference.mimeType]=!0;b.process.setResponseForm({outputIndex:c,supportedFormats:d});for(a.reference.body=b.process.description;0<this.executeCallbacks.length;)this.executeCallbacks[0]()},toFeatures:function(a){var b=OpenLayers.Util.isArray(a);b||(a=[a]);for(var c=Array(a.length),d,e=0,f=a.length;e<f;++e)d=a[e],c[e]=d instanceof OpenLayers.Feature.Vector?d:new OpenLayers.Feature.Vector(d);return b?c:c[0]},findMimeType:function(a,b){b=b||this.formats;for(var c in a)if(c in b)return c},CLASS_NAME:"OpenLayers.WPSProcess"}); +OpenLayers.WPSProcess.ChainLink=OpenLayers.Class({process:null,output:null,initialize:function(a){OpenLayers.Util.extend(this,a)},CLASS_NAME:"OpenLayers.WPSProcess.ChainLink"});OpenLayers.WPSClient=OpenLayers.Class({servers:null,version:"1.0.0",lazy:!1,events:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.events=new OpenLayers.Events(this);this.servers={};for(var b in a.servers)this.servers[b]="string"==typeof a.servers[b]?{url:a.servers[b],version:this.version,processDescription:{}}:a.servers[b]},execute:function(a){this.getProcess(a.server,a.process).execute({inputs:a.inputs,success:a.success,scope:a.scope})},getProcess:function(a,b){var c=new OpenLayers.WPSProcess({client:this, +server:a,identifier:b});this.lazy||c.describe();return c},describeProcess:function(a,b,c,d){var e=this.servers[a];e.processDescription[b]?window.setTimeout(function(){c.call(d,e.processDescription[b])},0):b in e.processDescription?this.events.register("describeprocess",this,function g(a){a.identifier===b&&(this.events.unregister("describeprocess",this,g),c.call(d,a.raw))}):(e.processDescription[b]=null,OpenLayers.Request.GET({url:e.url,params:{SERVICE:"WPS",VERSION:e.version,REQUEST:"DescribeProcess", +IDENTIFIER:b},success:function(a){e.processDescription[b]=a.responseText;this.events.triggerEvent("describeprocess",{identifier:b,raw:a.responseText})},scope:this}))},destroy:function(){this.events.destroy();this.servers=this.events=null},CLASS_NAME:"OpenLayers.WPSClient"});OpenLayers.Format.CSWGetRecords.v2_0_2=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{csw:"http://www.opengis.net/cat/csw/2.0.2",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",gmd:"http://www.isotc211.org/2005/gmd",geonet:"http://www.fao.org/geonetwork",ogc:"http://www.opengis.net/ogc",ows:"http://www.opengis.net/ows",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},defaultPrefix:"csw",version:"2.0.2",schemaLocation:"http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd", +requestId:null,resultType:null,outputFormat:null,outputSchema:null,startPosition:null,maxRecords:null,DistributedSearch:null,ResponseHandler:null,Query:null,regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b}, +readers:{csw:{GetRecordsResponse:function(a,b){b.records=[];this.readChildNodes(a,b);var c=this.getAttributeNS(a,"","version");""!=c&&(b.version=c)},RequestId:function(a,b){b.RequestId=this.getChildValue(a)},SearchStatus:function(a,b){b.SearchStatus={};var c=this.getAttributeNS(a,"","timestamp");""!=c&&(b.SearchStatus.timestamp=c)},SearchResults:function(a,b){this.readChildNodes(a,b);for(var c=a.attributes,d={},e=0,f=c.length;e<f;++e)d[c[e].name]="numberOfRecordsMatched"==c[e].name||"numberOfRecordsReturned"== +c[e].name||"nextRecord"==c[e].name?parseInt(c[e].nodeValue):c[e].nodeValue;b.SearchResults=d},SummaryRecord:function(a,b){var c={type:"SummaryRecord"};this.readChildNodes(a,c);b.records.push(c)},BriefRecord:function(a,b){var c={type:"BriefRecord"};this.readChildNodes(a,c);b.records.push(c)},DCMIRecord:function(a,b){var c={type:"DCMIRecord"};this.readChildNodes(a,c);b.records.push(c)},Record:function(a,b){var c={type:"Record"};this.readChildNodes(a,c);b.records.push(c)},"*":function(a,b){var c=a.localName|| +a.nodeName.split(":").pop();b[c]=this.getChildValue(a)}},geonet:{info:function(a,b){var c={};this.readChildNodes(a,c);b.gninfo=c}},dc:{"*":function(a,b){var c=a.localName||a.nodeName.split(":").pop();OpenLayers.Util.isArray(b[c])||(b[c]=[]);for(var d={},e=a.attributes,f=0,g=e.length;f<g;++f)d[e[f].name]=e[f].nodeValue;d.value=this.getChildValue(a);""!=d.value&&b[c].push(d)}},dct:{"*":function(a,b){var c=a.localName||a.nodeName.split(":").pop();OpenLayers.Util.isArray(b[c])||(b[c]=[]);b[c].push(this.getChildValue(a))}}, +ows:OpenLayers.Util.applyDefaults({BoundingBox:function(a,b){b.bounds&&(b.BoundingBox=[{crs:b.projection,value:[b.bounds.left,b.bounds.bottom,b.bounds.right,b.bounds.top]}],delete b.projection,delete b.bounds);OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows.BoundingBox.apply(this,arguments)}},OpenLayers.Format.OWSCommon.v1_0_0.prototype.readers.ows)},write:function(a){a=this.writeNode("csw:GetRecords",a);a.setAttribute("xmlns:gmd",this.namespaces.gmd);return OpenLayers.Format.XML.prototype.write.apply(this, +[a])},writers:{csw:{GetRecords:function(a){a||(a={});var b=this.createElementNSPlus("csw:GetRecords",{attributes:{service:"CSW",version:this.version,requestId:a.requestId||this.requestId,resultType:a.resultType||this.resultType,outputFormat:a.outputFormat||this.outputFormat,outputSchema:a.outputSchema||this.outputSchema,startPosition:a.startPosition||this.startPosition,maxRecords:a.maxRecords||this.maxRecords}});(a.DistributedSearch||this.DistributedSearch)&&this.writeNode("csw:DistributedSearch", +a.DistributedSearch||this.DistributedSearch,b);var c=a.ResponseHandler||this.ResponseHandler;if(OpenLayers.Util.isArray(c)&&0<c.length)for(var d=0,e=c.length;d<e;d++)this.writeNode("csw:ResponseHandler",c[d],b);this.writeNode("Query",a.Query||this.Query,b);return b},DistributedSearch:function(a){return this.createElementNSPlus("csw:DistributedSearch",{attributes:{hopCount:a.hopCount}})},ResponseHandler:function(a){return this.createElementNSPlus("csw:ResponseHandler",{value:a.value})},Query:function(a){a|| +(a={});var b=this.createElementNSPlus("csw:Query",{attributes:{typeNames:a.typeNames||"csw:Record"}}),c=a.ElementName;if(OpenLayers.Util.isArray(c)&&0<c.length)for(var d=0,e=c.length;d<e;d++)this.writeNode("csw:ElementName",c[d],b);else this.writeNode("csw:ElementSetName",a.ElementSetName||{value:"summary"},b);a.Constraint&&this.writeNode("csw:Constraint",a.Constraint,b);a.SortBy&&this.writeNode("ogc:SortBy",a.SortBy,b);return b},ElementName:function(a){return this.createElementNSPlus("csw:ElementName", +{value:a.value})},ElementSetName:function(a){return this.createElementNSPlus("csw:ElementSetName",{attributes:{typeNames:a.typeNames},value:a.value})},Constraint:function(a){var b=this.createElementNSPlus("csw:Constraint",{attributes:{version:a.version}});if(a.Filter){var c=new OpenLayers.Format.Filter({version:a.version});b.appendChild(c.write(a.Filter))}else a.CqlText&&(a=this.createElementNSPlus("CqlText",{value:a.CqlText.value}),b.appendChild(a));return b}},ogc:OpenLayers.Format.Filter.v1_1_0.prototype.writers.ogc}, +CLASS_NAME:"OpenLayers.Format.CSWGetRecords.v2_0_2"});/* + Apache 2 + + Contains portions of Rico <http://openrico.org/> + + Copyright 2005 Sabre Airline Solutions + + Licensed under the Apache License, Version 2.0 (the "License"); you + may not use this file except in compliance with the License. You + may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied. See the License for the specific language governing + permissions and limitations under the License. +*/ +OpenLayers.Marker.Box=OpenLayers.Class(OpenLayers.Marker,{bounds:null,div:null,initialize:function(a,b,c){this.bounds=a;this.div=OpenLayers.Util.createDiv();this.div.style.overflow="hidden";this.events=new OpenLayers.Events(this,this.div);this.setBorder(b,c)},destroy:function(){this.div=this.bounds=null;OpenLayers.Marker.prototype.destroy.apply(this,arguments)},setBorder:function(a,b){a||(a="red");b||(b=2);this.div.style.border=b+"px solid "+a},draw:function(a,b){OpenLayers.Util.modifyDOMElement(this.div, +null,a,b);return this.div},onScreen:function(){var a=!1;this.map&&(a=this.map.getExtent().containsBounds(this.bounds,!0,!0));return a},display:function(a){this.div.style.display=a?"":"none"},CLASS_NAME:"OpenLayers.Marker.Box"});OpenLayers.Format.Text=OpenLayers.Class(OpenLayers.Format,{defaultStyle:null,extractStyles:!0,initialize:function(a){a=a||{};!1!==a.extractStyles&&(a.defaultStyle={externalGraphic:OpenLayers.Util.getImageLocation("marker.png"),graphicWidth:21,graphicHeight:25,graphicXOffset:-10.5,graphicYOffset:-12.5});OpenLayers.Format.prototype.initialize.apply(this,[a])},read:function(a){a=a.split("\n");for(var b,c=[],d=0;d<a.length-1;d++){var e=a[d].replace(/^\s*/,"").replace(/\s*$/,"");if("#"!=e.charAt(0))if(b){for(var e= +e.split("\t"),f=new OpenLayers.Geometry.Point(0,0),g={},h=this.defaultStyle?OpenLayers.Util.applyDefaults({},this.defaultStyle):null,k=!1,l=0;l<e.length;l++)if(e[l])if("point"==b[l])k=e[l].split(","),f.y=parseFloat(k[0]),f.x=parseFloat(k[1]),k=!0;else if("lat"==b[l])f.y=parseFloat(e[l]),k=!0;else if("lon"==b[l])f.x=parseFloat(e[l]),k=!0;else if("title"==b[l])g.title=e[l];else if("image"==b[l]||"icon"==b[l]&&h)h.externalGraphic=e[l];else if("iconSize"==b[l]&&h){var m=e[l].split(",");h.graphicWidth= +parseFloat(m[0]);h.graphicHeight=parseFloat(m[1])}else"iconOffset"==b[l]&&h?(m=e[l].split(","),h.graphicXOffset=parseFloat(m[0]),h.graphicYOffset=parseFloat(m[1])):"description"==b[l]?g.description=e[l]:"overflow"==b[l]?g.overflow=e[l]:g[b[l]]=e[l];k&&(this.internalProjection&&this.externalProjection&&f.transform(this.externalProjection,this.internalProjection),e=new OpenLayers.Feature.Vector(f,g,h),c.push(e))}else b=e.split("\t")}return c},CLASS_NAME:"OpenLayers.Format.Text"});OpenLayers.Layer.Text=OpenLayers.Class(OpenLayers.Layer.Markers,{location:null,features:null,formatOptions:null,selectedFeature:null,initialize:function(a,b){OpenLayers.Layer.Markers.prototype.initialize.apply(this,arguments);this.features=[]},destroy:function(){OpenLayers.Layer.Markers.prototype.destroy.apply(this,arguments);this.clearFeatures();this.features=null},loadText:function(){this.loaded||null==this.location||(this.events.triggerEvent("loadstart"),OpenLayers.Request.GET({url:this.location, +success:this.parseData,failure:function(a){this.events.triggerEvent("loadend")},scope:this}),this.loaded=!0)},moveTo:function(a,b,c){OpenLayers.Layer.Markers.prototype.moveTo.apply(this,arguments);this.visibility&&!this.loaded&&this.loadText()},parseData:function(a){a=a.responseText;var b={};OpenLayers.Util.extend(b,this.formatOptions);this.map&&!this.projection.equals(this.map.getProjectionObject())&&(b.externalProjection=this.projection,b.internalProjection=this.map.getProjectionObject());a=(new OpenLayers.Format.Text(b)).read(a); +for(var b=0,c=a.length;b<c;b++){var d={},e=a[b],f,g,h;f=new OpenLayers.LonLat(e.geometry.x,e.geometry.y);e.style.graphicWidth&&e.style.graphicHeight&&(g=new OpenLayers.Size(e.style.graphicWidth,e.style.graphicHeight));void 0!==e.style.graphicXOffset&&void 0!==e.style.graphicYOffset&&(h=new OpenLayers.Pixel(e.style.graphicXOffset,e.style.graphicYOffset));null!=e.style.externalGraphic?d.icon=new OpenLayers.Icon(e.style.externalGraphic,g,h):(d.icon=OpenLayers.Marker.defaultIcon(),null!=g&&d.icon.setSize(g)); +null!=e.attributes.title&&null!=e.attributes.description&&(d.popupContentHTML="<h2>"+e.attributes.title+"</h2><p>"+e.attributes.description+"</p>");d.overflow=e.attributes.overflow||"auto";d=new OpenLayers.Feature(this,f,d);this.features.push(d);f=d.createMarker();null!=e.attributes.title&&null!=e.attributes.description&&f.events.register("click",d,this.markerClick);this.addMarker(f)}this.events.triggerEvent("loadend")},markerClick:function(a){var b=this==this.layer.selectedFeature;this.layer.selectedFeature= +b?null:this;for(var c=0,d=this.layer.map.popups.length;c<d;c++)this.layer.map.removePopup(this.layer.map.popups[c]);b||this.layer.map.addPopup(this.createPopup());OpenLayers.Event.stop(a)},clearFeatures:function(){if(null!=this.features)for(;0<this.features.length;){var a=this.features[0];OpenLayers.Util.removeItem(this.features,a);a.destroy()}},CLASS_NAME:"OpenLayers.Layer.Text"});OpenLayers.Handler.RegularPolygon=OpenLayers.Class(OpenLayers.Handler.Drag,{sides:4,radius:null,snapAngle:null,snapToggle:"shiftKey",layerOptions:null,persist:!1,irregular:!1,citeCompliant:!1,angle:null,fixedRadius:!1,feature:null,layer:null,origin:null,initialize:function(a,b,c){c&&c.layerOptions&&c.layerOptions.styleMap||(this.style=OpenLayers.Util.extend(OpenLayers.Feature.Vector.style["default"],{}));OpenLayers.Handler.Drag.prototype.initialize.apply(this,[a,b,c]);this.options=c?c:{}},setOptions:function(a){OpenLayers.Util.extend(this.options, +a);OpenLayers.Util.extend(this,a)},activate:function(){var a=!1;OpenLayers.Handler.Drag.prototype.activate.apply(this,arguments)&&(a=OpenLayers.Util.extend({displayInLayerSwitcher:!1,calculateInRange:OpenLayers.Function.True,wrapDateLine:this.citeCompliant},this.layerOptions),this.layer=new OpenLayers.Layer.Vector(this.CLASS_NAME,a),this.map.addLayer(this.layer),a=!0);return a},deactivate:function(){var a=!1;OpenLayers.Handler.Drag.prototype.deactivate.apply(this,arguments)&&(this.dragging&&this.cancel(), +null!=this.layer.map&&(this.layer.destroy(!1),this.feature&&this.feature.destroy()),this.feature=this.layer=null,a=!0);return a},down:function(a){this.fixedRadius=!!this.radius;a=this.layer.getLonLatFromViewPortPx(a.xy);this.origin=new OpenLayers.Geometry.Point(a.lon,a.lat);if(!this.fixedRadius||this.irregular)this.radius=this.map.getResolution();this.persist&&this.clear();this.feature=new OpenLayers.Feature.Vector;this.createGeometry();this.callback("create",[this.origin,this.feature]);this.layer.addFeatures([this.feature], +{silent:!0});this.layer.drawFeature(this.feature,this.style)},move:function(a){var b=this.layer.getLonLatFromViewPortPx(a.xy),b=new OpenLayers.Geometry.Point(b.lon,b.lat);this.irregular?(a=Math.sqrt(2)*Math.abs(b.y-this.origin.y)/2,this.radius=Math.max(this.map.getResolution()/2,a)):this.fixedRadius?this.origin=b:(this.calculateAngle(b,a),this.radius=Math.max(this.map.getResolution()/2,b.distanceTo(this.origin)));this.modifyGeometry();if(this.irregular){a=b.x-this.origin.x;var b=b.y-this.origin.y, +c;c=0==b?a/(this.radius*Math.sqrt(2)):a/b;this.feature.geometry.resize(1,this.origin,c);this.feature.geometry.move(a/2,b/2)}this.layer.drawFeature(this.feature,this.style)},up:function(a){this.finalize();this.start==this.last&&this.callback("done",[a.xy])},out:function(a){this.finalize()},createGeometry:function(){this.angle=Math.PI*(1/this.sides-0.5);this.snapAngle&&(this.angle+=this.snapAngle*(Math.PI/180));this.feature.geometry=OpenLayers.Geometry.Polygon.createRegularPolygon(this.origin,this.radius, +this.sides,this.snapAngle)},modifyGeometry:function(){var a,b,c=this.feature.geometry.components[0];c.components.length!=this.sides+1&&(this.createGeometry(),c=this.feature.geometry.components[0]);for(var d=0;d<this.sides;++d)b=c.components[d],a=this.angle+2*d*Math.PI/this.sides,b.x=this.origin.x+this.radius*Math.cos(a),b.y=this.origin.y+this.radius*Math.sin(a),b.clearBounds()},calculateAngle:function(a,b){var c=Math.atan2(a.y-this.origin.y,a.x-this.origin.x);if(this.snapAngle&&this.snapToggle&&!b[this.snapToggle]){var d= +Math.PI/180*this.snapAngle;this.angle=Math.round(c/d)*d}else this.angle=c},cancel:function(){this.callback("cancel",null);this.finalize()},finalize:function(){this.origin=null;this.radius=this.options.radius},clear:function(){this.layer&&(this.layer.renderer.clear(),this.layer.destroyFeatures())},callback:function(a,b){this.callbacks[a]&&this.callbacks[a].apply(this.control,[this.feature.geometry.clone()]);this.persist||"done"!=a&&"cancel"!=a||this.clear()},CLASS_NAME:"OpenLayers.Handler.RegularPolygon"});OpenLayers.Control.SLDSelect=OpenLayers.Class(OpenLayers.Control,{clearOnDeactivate:!1,layers:null,callbacks:null,selectionSymbolizer:{Polygon:{fillColor:"#FF0000",stroke:!1},Line:{strokeColor:"#FF0000",strokeWidth:2},Point:{graphicName:"square",fillColor:"#FF0000",pointRadius:5}},layerOptions:null,sketchStyle:null,wfsCache:{},layerCache:{},initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);this.callbacks=OpenLayers.Util.extend({done:this.select,click:this.select},this.callbacks); +this.handlerOptions=this.handlerOptions||{};this.layerOptions=OpenLayers.Util.applyDefaults(this.layerOptions,{displayInLayerSwitcher:!1,tileOptions:{maxGetUrlLength:2048}});this.sketchStyle&&(this.handlerOptions.layerOptions=OpenLayers.Util.applyDefaults(this.handlerOptions.layerOptions,{styleMap:new OpenLayers.StyleMap({"default":this.sketchStyle})}));this.handler=new a(this,this.callbacks,this.handlerOptions)},destroy:function(){for(var a in this.layerCache)delete this.layerCache[a];for(a in this.wfsCache)delete this.wfsCache[a]; +OpenLayers.Control.prototype.destroy.apply(this,arguments)},coupleLayerVisiblity:function(a){this.setVisibility(a.object.getVisibility())},createSelectionLayer:function(a){var b;if(this.layerCache[a.id])b=this.layerCache[a.id];else{b=new OpenLayers.Layer.WMS(a.name,a.url,a.params,OpenLayers.Util.applyDefaults(this.layerOptions,a.getOptions()));this.layerCache[a.id]=b;if(!1===this.layerOptions.displayInLayerSwitcher)a.events.on({visibilitychanged:this.coupleLayerVisiblity,scope:b});this.map.addLayer(b)}return b}, +createSLD:function(a,b,c){for(var d={version:"1.0.0",namedLayers:{}},e=(""+a.params.LAYERS).split(","),f=0,g=e.length;f<g;f++){var h=e[f];d.namedLayers[h]={name:h,userStyles:[]};var k=this.selectionSymbolizer,l=c[f];0<=l.type.indexOf("Polygon")?k={Polygon:this.selectionSymbolizer.Polygon}:0<=l.type.indexOf("LineString")?k={Line:this.selectionSymbolizer.Line}:0<=l.type.indexOf("Point")&&(k={Point:this.selectionSymbolizer.Point});d.namedLayers[h].userStyles.push({name:"default",rules:[new OpenLayers.Rule({symbolizer:k, +filter:b[f],maxScaleDenominator:a.options.minScale})]})}return(new OpenLayers.Format.SLD({srsName:this.map.getProjection()})).write(d)},parseDescribeLayer:function(a){var b=new OpenLayers.Format.WMSDescribeLayer,c=a.responseXML;c&&c.documentElement||(c=a.responseText);a=b.read(c);for(var b=[],c=null,d=0,e=a.length;d<e;d++)"WFS"==a[d].owsType&&(b.push(a[d].typeName),c=a[d].owsURL);OpenLayers.Request.GET({url:c,params:{SERVICE:"WFS",TYPENAME:b.toString(),REQUEST:"DescribeFeatureType",VERSION:"1.0.0"}, +callback:function(a){var b=new OpenLayers.Format.WFSDescribeFeatureType,c=a.responseXML;c&&c.documentElement||(c=a.responseText);a=b.read(c);this.control.wfsCache[this.layer.id]=a;this.control._queue&&this.control.applySelection()},scope:this})},getGeometryAttributes:function(a){var b=[];a=this.wfsCache[a.id];for(var c=0,d=a.featureTypes.length;c<d;c++)for(var e=a.featureTypes[c].properties,f=0,g=e.length;f<g;f++){var h=e[f],k=h.type;(0<=k.indexOf("LineString")||0<=k.indexOf("GeometryAssociationType")|| +0<=k.indexOf("GeometryPropertyType")||0<=k.indexOf("Point")||0<=k.indexOf("Polygon"))&&b.push(h)}return b},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a)for(var b=0,c=this.layers.length;b<c;b++){var d=this.layers[b];d&&!this.wfsCache[d.id]&&OpenLayers.Request.GET({url:d.url,params:{SERVICE:"WMS",VERSION:d.params.VERSION,LAYERS:d.params.LAYERS,REQUEST:"DescribeLayer"},callback:this.parseDescribeLayer,scope:{layer:d,control:this}})}return a},deactivate:function(){var a= +OpenLayers.Control.prototype.deactivate.call(this);if(a)for(var b=0,c=this.layers.length;b<c;b++){var d=this.layers[b];if(d&&!0===this.clearOnDeactivate){var e=this.layerCache,f=e[d.id];f&&(d.events.un({visibilitychanged:this.coupleLayerVisiblity,scope:f}),f.destroy(),delete e[d.id])}}return a},setLayers:function(a){this.active?(this.deactivate(),this.layers=a,this.activate()):this.layers=a},createFilter:function(a,b){var c=null;this.handler instanceof OpenLayers.Handler.RegularPolygon?c=!0===this.handler.irregular? +new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:a.name,value:b.getBounds()}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:a.name,value:b}):this.handler instanceof OpenLayers.Handler.Polygon?c=new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:a.name,value:b}):this.handler instanceof OpenLayers.Handler.Path?c=0<=a.type.indexOf("Point")?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN, +property:a.name,distance:0.01*this.map.getExtent().getWidth(),distanceUnits:this.map.getUnits(),value:b}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:a.name,value:b}):this.handler instanceof OpenLayers.Handler.Click&&(c=0<=a.type.indexOf("Polygon")?new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:a.name,value:b}):new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,property:a.name,distance:0.01*this.map.getExtent().getWidth(), +distanceUnits:this.map.getUnits(),value:b}));return c},select:function(a){this._queue=function(){for(var b=0,c=this.layers.length;b<c;b++){for(var d=this.layers[b],e=this.getGeometryAttributes(d),f=[],g=0,h=e.length;g<h;g++){var k=e[g];if(null!==k){if(!(a instanceof OpenLayers.Geometry)){var l=this.map.getLonLatFromPixel(a.xy);a=new OpenLayers.Geometry.Point(l.lon,l.lat)}k=this.createFilter(k,a);null!==k&&f.push(k)}}g=this.createSelectionLayer(d);this.events.triggerEvent("selected",{layer:d,filters:f}); +d=this.createSLD(d,f,e);g.mergeNewParams({SLD_BODY:d});delete this._queue}};this.applySelection()},applySelection:function(){for(var a=!0,b=0,c=this.layers.length;b<c;b++)if(!this.wfsCache[this.layers[b].id]){a=!1;break}a&&this._queue.call(this)},CLASS_NAME:"OpenLayers.Control.SLDSelect"});OpenLayers.Control.Scale=OpenLayers.Class(OpenLayers.Control,{element:null,geodesic:!1,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);this.element=OpenLayers.Util.getElement(a)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.element||(this.element=document.createElement("div"),this.div.appendChild(this.element));this.map.events.register("moveend",this,this.updateScale);this.updateScale();return this.div},updateScale:function(){var a; +if(!0===this.geodesic){if(!this.map.getUnits())return;a=OpenLayers.INCHES_PER_UNIT;a=(this.map.getGeodesicPixelSize().w||1E-6)*a.km*OpenLayers.DOTS_PER_INCH}else a=this.map.getScale();a&&(a=9500<=a&&95E4>=a?Math.round(a/1E3)+"K":95E4<=a?Math.round(a/1E6)+"M":Math.round(a),this.element.innerHTML=OpenLayers.i18n("Scale = 1 : ${scaleDenom}",{scaleDenom:a}))},CLASS_NAME:"OpenLayers.Control.Scale"});OpenLayers.Layer.MapGuide=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,useHttpTile:!1,singleTile:!1,useOverlay:!1,useAsyncOverlay:!0,TILE_PARAMS:{operation:"GETTILEIMAGE",version:"1.2.0"},SINGLE_TILE_PARAMS:{operation:"GETMAPIMAGE",format:"PNG",locale:"en",clip:"1",version:"1.0.0"},OVERLAY_PARAMS:{operation:"GETDYNAMICMAPOVERLAYIMAGE",format:"PNG",locale:"en",clip:"1",version:"2.0.0"},FOLDER_PARAMS:{tileColumnsPerFolder:30,tileRowsPerFolder:30,format:"png",querystring:null},defaultSize:new OpenLayers.Size(300, +300),tileOriginCorner:"tl",initialize:function(a,b,c,d){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);if(null==d||null==d.isBaseLayer)this.isBaseLayer="true"!=this.transparent&&!0!=this.transparent;d&&null!=d.useOverlay&&(this.useOverlay=d.useOverlay);this.singleTile?this.useOverlay?(OpenLayers.Util.applyDefaults(this.params,this.OVERLAY_PARAMS),this.useAsyncOverlay||(this.params.version="1.0.0")):OpenLayers.Util.applyDefaults(this.params,this.SINGLE_TILE_PARAMS):(this.useHttpTile? +OpenLayers.Util.applyDefaults(this.params,this.FOLDER_PARAMS):OpenLayers.Util.applyDefaults(this.params,this.TILE_PARAMS),this.setTileSize(this.defaultSize))},clone:function(a){null==a&&(a=new OpenLayers.Layer.MapGuide(this.name,this.url,this.params,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getURL:function(a){var b;b=a.getCenterLonLat();var c=this.map.getSize();this.singleTile?(a={setdisplaydpi:OpenLayers.DOTS_PER_INCH,setdisplayheight:c.h*this.ratio,setdisplaywidth:c.w* +this.ratio,setviewcenterx:b.lon,setviewcentery:b.lat,setviewscale:this.map.getScale()},this.useOverlay&&!this.useAsyncOverlay&&(b={},b=OpenLayers.Util.extend(b,a),b.operation="GETVISIBLEMAPEXTENT",b.version="1.0.0",b.session=this.params.session,b.mapName=this.params.mapName,b.format="text/xml",b=this.getFullRequestString(b),OpenLayers.Request.GET({url:b,async:!1})),b=this.getFullRequestString(a)):(c=this.map.getResolution(),b=Math.floor((a.left-this.maxExtent.left)/c),b=Math.round(b/this.tileSize.w), +a=Math.floor((this.maxExtent.top-a.top)/c),a=Math.round(a/this.tileSize.h),b=this.useHttpTile?this.getImageFilePath({tilecol:b,tilerow:a,scaleindex:this.resolutions.length-this.map.zoom-1}):this.getFullRequestString({tilecol:b,tilerow:a,scaleindex:this.resolutions.length-this.map.zoom-1}));return b},getFullRequestString:function(a,b){var c=null==b?this.url:b;"object"==typeof c&&(c=c[Math.floor(Math.random()*c.length)]);var d=c,e=OpenLayers.Util.extend({},this.params),e=OpenLayers.Util.extend(e,a), +f=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c)),g;for(g in e)g.toUpperCase()in f&&delete e[g];e=OpenLayers.Util.getParameterString(e);e=e.replace(/,/g,"+");""!=e&&(f=c.charAt(c.length-1),d="&"==f||"?"==f?d+e:-1==c.indexOf("?")?d+("?"+e):d+("&"+e));return d},getImageFilePath:function(a,b){var c=null==b?this.url:b;"object"==typeof c&&(c=c[Math.floor(Math.random()*c.length)]);var d="",e="";0>a.tilerow&&(d="-");d=0==a.tilerow?d+"0":d+Math.floor(Math.abs(a.tilerow/this.params.tileRowsPerFolder))* +this.params.tileRowsPerFolder;0>a.tilecol&&(e="-");e=0==a.tilecol?e+"0":e+Math.floor(Math.abs(a.tilecol/this.params.tileColumnsPerFolder))*this.params.tileColumnsPerFolder;d="/S"+Math.floor(a.scaleindex)+"/"+this.params.basemaplayergroupname+"/R"+d+"/C"+e+"/"+a.tilerow%this.params.tileRowsPerFolder+"_"+a.tilecol%this.params.tileColumnsPerFolder+"."+this.params.format;this.params.querystring&&(d+="?"+this.params.querystring);return c+d},CLASS_NAME:"OpenLayers.Layer.MapGuide"});OpenLayers.Control.Measure=OpenLayers.Class(OpenLayers.Control,{callbacks:null,displaySystem:"metric",geodesic:!1,displaySystemUnits:{geographic:["dd"],english:["mi","ft","in"],metric:["km","m"]},partialDelay:300,delayedTrigger:null,persist:!1,immediate:!1,initialize:function(a,b){OpenLayers.Control.prototype.initialize.apply(this,[b]);var c={done:this.measureComplete,point:this.measurePartial};this.immediate&&(c.modify=this.measureImmediate);this.callbacks=OpenLayers.Util.extend(c,this.callbacks); +this.handlerOptions=OpenLayers.Util.extend({persist:this.persist},this.handlerOptions);this.handler=new a(this,this.callbacks,this.handlerOptions)},deactivate:function(){this.cancelDelay();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},cancel:function(){this.cancelDelay();this.handler.cancel()},setImmediate:function(a){(this.immediate=a)?this.callbacks.modify=this.measureImmediate:delete this.callbacks.modify},updateHandler:function(a,b){var c=this.active;c&&this.deactivate(); +this.handler=new a(this,this.callbacks,b);c&&this.activate()},measureComplete:function(a){this.cancelDelay();this.measure(a,"measure")},measurePartial:function(a,b){this.cancelDelay();b=b.clone();this.handler.freehandMode(this.handler.evt)?this.measure(b,"measurepartial"):this.delayedTrigger=window.setTimeout(OpenLayers.Function.bind(function(){this.delayedTrigger=null;this.measure(b,"measurepartial")},this),this.partialDelay)},measureImmediate:function(a,b,c){c&&!this.handler.freehandMode(this.handler.evt)&& +(this.cancelDelay(),this.measure(b.geometry,"measurepartial"))},cancelDelay:function(){null!==this.delayedTrigger&&(window.clearTimeout(this.delayedTrigger),this.delayedTrigger=null)},measure:function(a,b){var c,d;-1<a.CLASS_NAME.indexOf("LineString")?(c=this.getBestLength(a),d=1):(c=this.getBestArea(a),d=2);this.events.triggerEvent(b,{measure:c[0],units:c[1],order:d,geometry:a})},getBestArea:function(a){for(var b=this.displaySystemUnits[this.displaySystem],c,d,e=0,f=b.length;e<f&&!(c=b[e],d=this.getArea(a, +c),1<d);++e);return[d,c]},getArea:function(a,b){var c,d;this.geodesic?(c=a.getGeodesicArea(this.map.getProjectionObject()),d="m"):(c=a.getArea(),d=this.map.getUnits());var e=OpenLayers.INCHES_PER_UNIT[b];e&&(c*=Math.pow(OpenLayers.INCHES_PER_UNIT[d]/e,2));return c},getBestLength:function(a){for(var b=this.displaySystemUnits[this.displaySystem],c,d,e=0,f=b.length;e<f&&!(c=b[e],d=this.getLength(a,c),1<d);++e);return[d,c]},getLength:function(a,b){var c,d;this.geodesic?(c=a.getGeodesicLength(this.map.getProjectionObject()), +d="m"):(c=a.getLength(),d=this.map.getUnits());var e=OpenLayers.INCHES_PER_UNIT[b];e&&(c*=OpenLayers.INCHES_PER_UNIT[d]/e);return c},CLASS_NAME:"OpenLayers.Control.Measure"});OpenLayers.Format.WMC.v1_0_0=OpenLayers.Class(OpenLayers.Format.WMC.v1,{VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/context http://schemas.opengis.net/context/1.0.0/context.xsd",initialize:function(a){OpenLayers.Format.WMC.v1.prototype.initialize.apply(this,[a])},read_wmc_SRS:function(a,b){var c=this.getChildValue(b);"object"!=typeof a.projections&&(a.projections={});for(var c=c.split(/ +/),d=0,e=c.length;d<e;d++)a.projections[c[d]]=!0},write_wmc_Layer:function(a){var b=OpenLayers.Format.WMC.v1.prototype.write_wmc_Layer.apply(this, +[a]);if(a.srs){var c=[],d;for(d in a.srs)c.push(d);b.appendChild(this.createElementDefaultNS("SRS",c.join(" ")))}b.appendChild(this.write_wmc_FormatList(a));b.appendChild(this.write_wmc_StyleList(a));a.dimensions&&b.appendChild(this.write_wmc_DimensionList(a));b.appendChild(this.write_wmc_LayerExtension(a))},CLASS_NAME:"OpenLayers.Format.WMC.v1_0_0"});OpenLayers.Popup.Anchored=OpenLayers.Class(OpenLayers.Popup,{relativePosition:null,keepInMap:!0,anchor:null,initialize:function(a,b,c,d,e,f,g){OpenLayers.Popup.prototype.initialize.apply(this,[a,b,c,d,f,g]);this.anchor=null!=e?e:{size:new OpenLayers.Size(0,0),offset:new OpenLayers.Pixel(0,0)}},destroy:function(){this.relativePosition=this.anchor=null;OpenLayers.Popup.prototype.destroy.apply(this,arguments)},show:function(){this.updatePosition();OpenLayers.Popup.prototype.show.apply(this,arguments)}, +moveTo:function(a){var b=this.relativePosition;this.relativePosition=this.calculateRelativePosition(a);OpenLayers.Popup.prototype.moveTo.call(this,this.calculateNewPx(a));this.relativePosition!=b&&this.updateRelativePosition()},setSize:function(a){OpenLayers.Popup.prototype.setSize.apply(this,arguments);if(this.lonlat&&this.map){var b=this.map.getLayerPxFromLonLat(this.lonlat);this.moveTo(b)}},calculateRelativePosition:function(a){a=this.map.getLonLatFromLayerPx(a);a=this.map.getExtent().determineQuadrant(a); +return OpenLayers.Bounds.oppositeQuadrant(a)},updateRelativePosition:function(){},calculateNewPx:function(a){a=a.offset(this.anchor.offset);var b=this.size||this.contentSize,c="t"==this.relativePosition.charAt(0);a.y+=c?-b.h:this.anchor.size.h;c="l"==this.relativePosition.charAt(1);a.x+=c?-b.w:this.anchor.size.w;return a},CLASS_NAME:"OpenLayers.Popup.Anchored"});OpenLayers.Popup.Framed=OpenLayers.Class(OpenLayers.Popup.Anchored,{imageSrc:null,imageSize:null,isAlphaImage:!1,positionBlocks:null,blocks:null,fixedRelativePosition:!1,initialize:function(a,b,c,d,e,f,g){OpenLayers.Popup.Anchored.prototype.initialize.apply(this,arguments);this.fixedRelativePosition&&(this.updateRelativePosition(),this.calculateRelativePosition=function(a){return this.relativePosition});this.contentDiv.style.position="absolute";this.contentDiv.style.zIndex=1;f&&(this.closeDiv.style.zIndex= +1);this.groupDiv.style.position="absolute";this.groupDiv.style.top="0px";this.groupDiv.style.left="0px";this.groupDiv.style.height="100%";this.groupDiv.style.width="100%"},destroy:function(){this.isAlphaImage=this.imageSize=this.imageSrc=null;this.fixedRelativePosition=!1;this.positionBlocks=null;for(var a=0;a<this.blocks.length;a++){var b=this.blocks[a];b.image&&b.div.removeChild(b.image);b.image=null;b.div&&this.groupDiv.removeChild(b.div);b.div=null}this.blocks=null;OpenLayers.Popup.Anchored.prototype.destroy.apply(this, +arguments)},setBackgroundColor:function(a){},setBorder:function(){},setOpacity:function(a){},setSize:function(a){OpenLayers.Popup.Anchored.prototype.setSize.apply(this,arguments);this.updateBlocks()},updateRelativePosition:function(){this.padding=this.positionBlocks[this.relativePosition].padding;if(this.closeDiv){var a=this.getContentDivPadding();this.closeDiv.style.right=a.right+this.padding.right+"px";this.closeDiv.style.top=a.top+this.padding.top+"px"}this.updateBlocks()},calculateNewPx:function(a){var b= +OpenLayers.Popup.Anchored.prototype.calculateNewPx.apply(this,arguments);return b=b.offset(this.positionBlocks[this.relativePosition].offset)},createBlocks:function(){this.blocks=[];var a=null,b;for(b in this.positionBlocks){a=b;break}a=this.positionBlocks[a];for(b=0;b<a.blocks.length;b++){var c={};this.blocks.push(c);c.div=OpenLayers.Util.createDiv(this.id+"_FrameDecorationDiv_"+b,null,null,null,"absolute",null,"hidden",null);c.image=(this.isAlphaImage?OpenLayers.Util.createAlphaImageDiv:OpenLayers.Util.createImage)(this.id+ +"_FrameDecorationImg_"+b,null,this.imageSize,this.imageSrc,"absolute",null,null,null);c.div.appendChild(c.image);this.groupDiv.appendChild(c.div)}},updateBlocks:function(){this.blocks||this.createBlocks();if(this.size&&this.relativePosition){for(var a=this.positionBlocks[this.relativePosition],b=0;b<a.blocks.length;b++){var c=a.blocks[b],d=this.blocks[b],e=c.anchor.left,f=c.anchor.bottom,g=c.anchor.right,h=c.anchor.top,k=isNaN(c.size.w)?this.size.w-(g+e):c.size.w,l=isNaN(c.size.h)?this.size.h-(f+ +h):c.size.h;d.div.style.width=(0>k?0:k)+"px";d.div.style.height=(0>l?0:l)+"px";d.div.style.left=null!=e?e+"px":"";d.div.style.bottom=null!=f?f+"px":"";d.div.style.right=null!=g?g+"px":"";d.div.style.top=null!=h?h+"px":"";d.image.style.left=c.position.x+"px";d.image.style.top=c.position.y+"px"}this.contentDiv.style.left=this.padding.left+"px";this.contentDiv.style.top=this.padding.top+"px"}},CLASS_NAME:"OpenLayers.Popup.Framed"});OpenLayers.Popup.FramedCloud=OpenLayers.Class(OpenLayers.Popup.Framed,{contentDisplayClass:"olFramedCloudPopupContent",autoSize:!0,panMapIfOutOfView:!0,imageSize:new OpenLayers.Size(1276,736),isAlphaImage:!1,fixedRelativePosition:!1,positionBlocks:{tl:{offset:new OpenLayers.Pixel(44,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null, +50,0,0),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,18),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-1238,-632)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(0,-688)}]},tr:{offset:new OpenLayers.Pixel(-45,0),padding:new OpenLayers.Bounds(8,40,8,9),blocks:[{size:new OpenLayers.Size("auto", +"auto"),anchor:new OpenLayers.Bounds(0,51,22,0),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,50,0,0),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",19),anchor:new OpenLayers.Bounds(0,32,22,null),position:new OpenLayers.Pixel(0,-631)},{size:new OpenLayers.Size(22,19),anchor:new OpenLayers.Bounds(null,32,0,null),position:new OpenLayers.Pixel(-1238,-631)},{size:new OpenLayers.Size(81,35),anchor:new OpenLayers.Bounds(0, +0,null,null),position:new OpenLayers.Pixel(-215,-687)}]},bl:{offset:new OpenLayers.Pixel(45,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-1238,0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22, +21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-1238,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(null,null,0,0),position:new OpenLayers.Pixel(-101,-674)}]},br:{offset:new OpenLayers.Pixel(-44,0),padding:new OpenLayers.Bounds(8,9,8,40),blocks:[{size:new OpenLayers.Size("auto","auto"),anchor:new OpenLayers.Bounds(0,21,22,32),position:new OpenLayers.Pixel(0,0)},{size:new OpenLayers.Size(22,"auto"),anchor:new OpenLayers.Bounds(null,21,0,32),position:new OpenLayers.Pixel(-1238, +0)},{size:new OpenLayers.Size("auto",21),anchor:new OpenLayers.Bounds(0,0,22,null),position:new OpenLayers.Pixel(0,-629)},{size:new OpenLayers.Size(22,21),anchor:new OpenLayers.Bounds(null,0,0,null),position:new OpenLayers.Pixel(-1238,-629)},{size:new OpenLayers.Size(81,33),anchor:new OpenLayers.Bounds(0,null,null,0),position:new OpenLayers.Pixel(-311,-674)}]}},minSize:new OpenLayers.Size(105,10),maxSize:new OpenLayers.Size(1200,660),initialize:function(a,b,c,d,e,f,g){this.imageSrc=OpenLayers.Util.getImageLocation("cloud-popup-relative.png"); +OpenLayers.Popup.Framed.prototype.initialize.apply(this,arguments);this.contentDiv.className=this.contentDisplayClass},CLASS_NAME:"OpenLayers.Popup.FramedCloud"});OpenLayers.Tile.Image.IFrame={useIFrame:null,blankImageUrl:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAQAIBRAA7",draw:function(){if(OpenLayers.Tile.Image.prototype.shouldDraw.call(this)){var a=this.layer.getURL(this.bounds),b=this.useIFrame;this.useIFrame=null!==this.maxGetUrlLength&&!this.layer.async&&a.length>this.maxGetUrlLength;a=b&&!this.useIFrame;b=!b&&this.useIFrame;if(a||b)this.imgDiv&&this.imgDiv.parentNode===this.frame&&this.frame.removeChild(this.imgDiv),this.imgDiv= +null,a&&this.frame.removeChild(this.frame.firstChild)}return OpenLayers.Tile.Image.prototype.draw.apply(this,arguments)},getImage:function(){if(!0===this.useIFrame){if(!this.frame.childNodes.length){var a=document.createElement("div"),b=a.style;b.position="absolute";b.width="100%";b.height="100%";b.zIndex=1;b.backgroundImage="url("+this.blankImageUrl+")";this.frame.appendChild(a)}a=this.id+"_iFrame";9>parseFloat(navigator.appVersion.split("MSIE")[1])?(b=document.createElement('<iframe name="'+a+'">'), +b.style.backgroundColor="#FFFFFF",b.style.filter="chroma(color=#FFFFFF)"):(b=document.createElement("iframe"),b.style.backgroundColor="transparent",b.name=a);b.scrolling="no";b.marginWidth="0px";b.marginHeight="0px";b.frameBorder="0";b.style.position="absolute";b.style.width="100%";b.style.height="100%";1>this.layer.opacity&&OpenLayers.Util.modifyDOMElement(b,null,null,null,null,null,null,this.layer.opacity);this.frame.appendChild(b);return this.imgDiv=b}return OpenLayers.Tile.Image.prototype.getImage.apply(this, +arguments)},createRequestForm:function(){var a=document.createElement("form");a.method="POST";var b=this.layer.params._OLSALT,b=(b?b+"_":"")+this.bounds.toBBOX();a.action=OpenLayers.Util.urlAppend(this.layer.url,b);a.target=this.id+"_iFrame";this.layer.getImageSize();var b=OpenLayers.Util.getParameters(this.url),c,d;for(d in b)c=document.createElement("input"),c.type="hidden",c.name=d,c.value=b[d],a.appendChild(c);return a},setImgSrc:function(a){if(!0===this.useIFrame)if(a){var b=this.createRequestForm(); +this.frame.appendChild(b);b.submit();this.frame.removeChild(b)}else this.imgDiv.parentNode===this.frame&&(this.frame.removeChild(this.imgDiv),this.imgDiv=null);else OpenLayers.Tile.Image.prototype.setImgSrc.apply(this,arguments)},onImageLoad:function(){OpenLayers.Tile.Image.prototype.onImageLoad.apply(this,arguments);!0===this.useIFrame&&(this.imgDiv.style.opacity=1,this.frame.style.opacity=this.layer.opacity)},createBackBuffer:function(){var a;!1===this.useIFrame&&(a=OpenLayers.Tile.Image.prototype.createBackBuffer.call(this)); +return a}};OpenLayers.Format.SOSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.SOSCapabilities"});OpenLayers.Format.SOSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.SOSCapabilities,{namespaces:{ows:"http://www.opengis.net/ows/1.1",sos:"http://www.opengis.net/sos/1.0",gml:"http://www.opengis.net/gml",xlink:"http://www.w3.org/1999/xlink"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this, +[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);return b},readers:{gml:OpenLayers.Util.applyDefaults({name:function(a,b){b.name=this.getChildValue(a)},TimePeriod:function(a,b){b.timePeriod={};this.readChildNodes(a,b.timePeriod)},beginPosition:function(a,b){b.beginPosition=this.getChildValue(a)},endPosition:function(a,b){b.endPosition=this.getChildValue(a)}},OpenLayers.Format.GML.v3.prototype.readers.gml),sos:{Capabilities:function(a,b){this.readChildNodes(a,b)},Contents:function(a, +b){b.contents={};this.readChildNodes(a,b.contents)},ObservationOfferingList:function(a,b){b.offeringList={};this.readChildNodes(a,b.offeringList)},ObservationOffering:function(a,b){var c=this.getAttributeNS(a,this.namespaces.gml,"id");b[c]={procedures:[],observedProperties:[],featureOfInterestIds:[],responseFormats:[],resultModels:[],responseModes:[]};this.readChildNodes(a,b[c])},time:function(a,b){b.time={};this.readChildNodes(a,b.time)},procedure:function(a,b){b.procedures.push(this.getAttributeNS(a, +this.namespaces.xlink,"href"))},observedProperty:function(a,b){b.observedProperties.push(this.getAttributeNS(a,this.namespaces.xlink,"href"))},featureOfInterest:function(a,b){b.featureOfInterestIds.push(this.getAttributeNS(a,this.namespaces.xlink,"href"))},responseFormat:function(a,b){b.responseFormats.push(this.getChildValue(a))},resultModel:function(a,b){b.resultModels.push(this.getChildValue(a))},responseMode:function(a,b){b.responseModes.push(this.getChildValue(a))}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows}, +CLASS_NAME:"OpenLayers.Format.SOSCapabilities.v1_0_0"});OpenLayers.Handler.Pinch=OpenLayers.Class(OpenLayers.Handler,{started:!1,stopDown:!1,pinching:!1,last:null,start:null,touchstart:function(a){var b=!0;this.pinching=!1;if(OpenLayers.Event.isMultiTouch(a))this.started=!0,this.last=this.start={distance:this.getDistance(a.touches),delta:0,scale:1},this.callback("start",[a,this.start]),b=!this.stopDown;else{if(this.started)return!1;this.started=!1;this.last=this.start=null}OpenLayers.Event.preventDefault(a);return b},touchmove:function(a){if(this.started&& +OpenLayers.Event.isMultiTouch(a)){this.pinching=!0;var b=this.getPinchData(a);this.callback("move",[a,b]);this.last=b;OpenLayers.Event.stop(a)}else if(this.started)return!1;return!0},touchend:function(a){return this.started&&!OpenLayers.Event.isMultiTouch(a)?(this.pinching=this.started=!1,this.callback("done",[a,this.start,this.last]),this.last=this.start=null,!1):!0},activate:function(){var a=!1;OpenLayers.Handler.prototype.activate.apply(this,arguments)&&(this.pinching=!1,a=!0);return a},deactivate:function(){var a= +!1;OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.pinching=this.started=!1,this.last=this.start=null,a=!0);return a},getDistance:function(a){var b=a[0];a=a[1];return Math.sqrt(Math.pow(b.olClientX-a.olClientX,2)+Math.pow(b.olClientY-a.olClientY,2))},getPinchData:function(a){a=this.getDistance(a.touches);return{distance:a,delta:this.last.distance-a,scale:a/this.start.distance}},CLASS_NAME:"OpenLayers.Handler.Pinch"});OpenLayers.Control.NavToolbar=OpenLayers.Class(OpenLayers.Control.Panel,{initialize:function(a){OpenLayers.Control.Panel.prototype.initialize.apply(this,[a]);this.addControls([new OpenLayers.Control.Navigation,new OpenLayers.Control.ZoomBox])},draw:function(){var a=OpenLayers.Control.Panel.prototype.draw.apply(this,arguments);null===this.defaultControl&&(this.defaultControl=this.controls[0]);return a},CLASS_NAME:"OpenLayers.Control.NavToolbar"});OpenLayers.Strategy.Refresh=OpenLayers.Class(OpenLayers.Strategy,{force:!1,interval:0,timer:null,activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);a&&(!0===this.layer.visibility&&this.start(),this.layer.events.on({visibilitychanged:this.reset,scope:this}));return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);a&&(this.stop(),this.layer.events.un({visibilitychanged:this.reset,scope:this}));return a},reset:function(){!0===this.layer.visibility? +this.start():this.stop()},start:function(){this.interval&&("number"===typeof this.interval&&0<this.interval)&&(this.timer=window.setInterval(OpenLayers.Function.bind(this.refresh,this),this.interval))},refresh:function(){this.layer&&(this.layer.refresh&&"function"==typeof this.layer.refresh)&&this.layer.refresh({force:this.force})},stop:function(){null!==this.timer&&(window.clearInterval(this.timer),this.timer=null)},CLASS_NAME:"OpenLayers.Strategy.Refresh"});OpenLayers.Layer.ArcGIS93Rest=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{format:"png"},isBaseLayer:!0,initialize:function(a,b,c,d){var e=[];c=OpenLayers.Util.upperCaseObject(c);e.push(a,b,c,d);OpenLayers.Layer.Grid.prototype.initialize.apply(this,e);OpenLayers.Util.applyDefaults(this.params,OpenLayers.Util.upperCaseObject(this.DEFAULT_PARAMS));this.params.TRANSPARENT&&"true"==this.params.TRANSPARENT.toString().toLowerCase()&&(null!=d&&d.isBaseLayer||(this.isBaseLayer=!1),"jpg"==this.params.FORMAT&& +(this.params.FORMAT=OpenLayers.Util.alphaHack()?"gif":"png"))},clone:function(a){null==a&&(a=new OpenLayers.Layer.ArcGIS93Rest(this.name,this.url,this.params,this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getURL:function(a){a=this.adjustBounds(a);var b=this.projection.getCode().split(":"),b=b[b.length-1],c=this.getImageSize();a={BBOX:a.toBBOX(),SIZE:c.w+","+c.h,F:"image",BBOXSR:b,IMAGESR:b};if(this.layerDefs){var b=[],d;for(d in this.layerDefs)this.layerDefs.hasOwnProperty(d)&& +this.layerDefs[d]&&(b.push(d),b.push(":"),b.push(this.layerDefs[d]),b.push(";"));0<b.length&&(a.LAYERDEFS=b.join(""))}return this.getFullRequestString(a)},setLayerFilter:function(a,b){this.layerDefs||(this.layerDefs={});b?this.layerDefs[a]=b:delete this.layerDefs[a]},clearLayerFilter:function(a){a?delete this.layerDefs[a]:delete this.layerDefs},mergeNewParams:function(a){a=[OpenLayers.Util.upperCaseObject(a)];return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,a)},CLASS_NAME:"OpenLayers.Layer.ArcGIS93Rest"});OpenLayers.Handler.Hover=OpenLayers.Class(OpenLayers.Handler,{delay:500,pixelTolerance:null,stopMove:!1,px:null,timerId:null,mousemove:function(a){this.passesTolerance(a.xy)&&(this.clearTimer(),this.callback("move",[a]),this.px=a.xy,a=OpenLayers.Util.extend({},a),this.timerId=window.setTimeout(OpenLayers.Function.bind(this.delayedCall,this,a),this.delay));return!this.stopMove},mouseout:function(a){OpenLayers.Util.mouseLeft(a,this.map.viewPortDiv)&&(this.clearTimer(),this.callback("move",[a]));return!0}, +passesTolerance:function(a){var b=!0;this.pixelTolerance&&this.px&&Math.sqrt(Math.pow(this.px.x-a.x,2)+Math.pow(this.px.y-a.y,2))<this.pixelTolerance&&(b=!1);return b},clearTimer:function(){null!=this.timerId&&(window.clearTimeout(this.timerId),this.timerId=null)},delayedCall:function(a){this.callback("pause",[a])},deactivate:function(){var a=!1;OpenLayers.Handler.prototype.deactivate.apply(this,arguments)&&(this.clearTimer(),a=!0);return a},CLASS_NAME:"OpenLayers.Handler.Hover"});OpenLayers.Control.GetFeature=OpenLayers.Class(OpenLayers.Control,{protocol:null,multipleKey:null,toggleKey:null,modifiers:null,multiple:!1,click:!0,single:!0,clickout:!0,toggle:!1,clickTolerance:5,hover:!1,box:!1,maxFeatures:10,features:null,hoverFeature:null,handlers:null,hoverResponse:null,filterType:OpenLayers.Filter.Spatial.BBOX,initialize:function(a){a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);this.features={};this.handlers={};this.click&&(this.handlers.click= +new OpenLayers.Handler.Click(this,{click:this.selectClick},this.handlerOptions.click||{}));this.box&&(this.handlers.box=new OpenLayers.Handler.Box(this,{done:this.selectBox},OpenLayers.Util.extend(this.handlerOptions.box,{boxDivClassName:"olHandlerBoxSelectFeature"})));this.hover&&(this.handlers.hover=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.selectHover},OpenLayers.Util.extend(this.handlerOptions.hover,{delay:250,pixelTolerance:2})))},activate:function(){if(!this.active)for(var a in this.handlers)this.handlers[a].activate(); +return OpenLayers.Control.prototype.activate.apply(this,arguments)},deactivate:function(){if(this.active)for(var a in this.handlers)this.handlers[a].deactivate();return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},selectClick:function(a){var b=this.pixelToBounds(a.xy);this.setModifiers(a);this.request(b,{single:this.single})},selectBox:function(a){var b;if(a instanceof OpenLayers.Bounds)b=this.map.getLonLatFromPixel({x:a.left,y:a.bottom}),a=this.map.getLonLatFromPixel({x:a.right, +y:a.top}),b=new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat);else{if(this.click)return;b=this.pixelToBounds(a)}this.setModifiers(this.handlers.box.dragHandler.evt);this.request(b)},selectHover:function(a){a=this.pixelToBounds(a.xy);this.request(a,{single:!0,hover:!0})},cancelHover:function(){this.hoverResponse&&(this.protocol.abort(this.hoverResponse),this.hoverResponse=null,OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"))},request:function(a,b){b=b||{};var c=new OpenLayers.Filter.Spatial({type:this.filterType, +value:a});OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");c=this.protocol.read({maxFeatures:!0==b.single?this.maxFeatures:void 0,filter:c,callback:function(c){c.success()&&(c.features.length?!0==b.single?this.selectBestFeature(c.features,a.getCenterLonLat(),b):this.select(c.features):b.hover?this.hoverSelect():(this.events.triggerEvent("clickout"),this.clickout&&this.unselectAll()));OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},scope:this});!0==b.hover&&(this.hoverResponse= +c)},selectBestFeature:function(a,b,c){c=c||{};if(a.length){b=new OpenLayers.Geometry.Point(b.lon,b.lat);for(var d,e,f,g=Number.MAX_VALUE,h=0;h<a.length&&!(d=a[h],d.geometry&&(f=b.distanceTo(d.geometry,{edge:!1}),f<g&&(g=f,e=d,0==g)));++h);!0==c.hover?this.hoverSelect(e):this.select(e||a)}},setModifiers:function(a){this.modifiers={multiple:this.multiple||this.multipleKey&&a[this.multipleKey],toggle:this.toggle||this.toggleKey&&a[this.toggleKey]}},select:function(a){this.modifiers.multiple||this.modifiers.toggle|| +this.unselectAll();OpenLayers.Util.isArray(a)||(a=[a]);var b=this.events.triggerEvent("beforefeaturesselected",{features:a});if(!1!==b){for(var c=[],d,e=0,f=a.length;e<f;++e)d=a[e],this.features[d.fid||d.id]?this.modifiers.toggle&&this.unselect(this.features[d.fid||d.id]):(b=this.events.triggerEvent("beforefeatureselected",{feature:d}),!1!==b&&(this.features[d.fid||d.id]=d,c.push(d),this.events.triggerEvent("featureselected",{feature:d})));this.events.triggerEvent("featuresselected",{features:c})}}, +hoverSelect:function(a){var b=a?a.fid||a.id:null,c=this.hoverFeature?this.hoverFeature.fid||this.hoverFeature.id:null;c&&c!=b&&(this.events.triggerEvent("outfeature",{feature:this.hoverFeature}),this.hoverFeature=null);b&&b!=c&&(this.events.triggerEvent("hoverfeature",{feature:a}),this.hoverFeature=a)},unselect:function(a){delete this.features[a.fid||a.id];this.events.triggerEvent("featureunselected",{feature:a})},unselectAll:function(){for(var a in this.features)this.unselect(this.features[a])}, +setMap:function(a){for(var b in this.handlers)this.handlers[b].setMap(a);OpenLayers.Control.prototype.setMap.apply(this,arguments)},pixelToBounds:function(a){var b=a.add(-this.clickTolerance/2,this.clickTolerance/2);a=a.add(this.clickTolerance/2,-this.clickTolerance/2);b=this.map.getLonLatFromPixel(b);a=this.map.getLonLatFromPixel(a);return new OpenLayers.Bounds(b.lon,b.lat,a.lon,a.lat)},CLASS_NAME:"OpenLayers.Control.GetFeature"});OpenLayers.Format.QueryStringFilter=function(){function a(a){a=a.replace(/%/g,"\\%");a=a.replace(/\\\\\.(\*)?/g,function(a,b){return b?a:"\\\\_"});a=a.replace(/\\\\\.\*/g,"\\\\%");a=a.replace(/(\\)?\.(\*)?/g,function(a,b,c){return b||c?a:"_"});a=a.replace(/(\\)?\.\*/g,function(a,b){return b?a:"%"});a=a.replace(/\\\./g,".");return a=a.replace(/(\\)?\\\*/g,function(a,b){return b?a:"*"})}var b={};b[OpenLayers.Filter.Comparison.EQUAL_TO]="eq";b[OpenLayers.Filter.Comparison.NOT_EQUAL_TO]="ne";b[OpenLayers.Filter.Comparison.LESS_THAN]= +"lt";b[OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO]="lte";b[OpenLayers.Filter.Comparison.GREATER_THAN]="gt";b[OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO]="gte";b[OpenLayers.Filter.Comparison.LIKE]="ilike";return OpenLayers.Class(OpenLayers.Format,{wildcarded:!1,srsInBBOX:!1,write:function(c,d){d=d||{};var e=c.CLASS_NAME,e=e.substring(e.lastIndexOf(".")+1);switch(e){case "Spatial":switch(c.type){case OpenLayers.Filter.Spatial.BBOX:d.bbox=c.value.toArray();this.srsInBBOX&&c.projection&& +d.bbox.push(c.projection.getCode());break;case OpenLayers.Filter.Spatial.DWITHIN:d.tolerance=c.distance;case OpenLayers.Filter.Spatial.WITHIN:d.lon=c.value.x;d.lat=c.value.y;break;default:OpenLayers.Console.warn("Unknown spatial filter type "+c.type)}break;case "Comparison":e=b[c.type];if(void 0!==e){var f=c.value;c.type==OpenLayers.Filter.Comparison.LIKE&&(f=a(f),this.wildcarded&&(f="%"+f+"%"));d[c.property+"__"+e]=f;d.queryable=d.queryable||[];d.queryable.push(c.property)}else OpenLayers.Console.warn("Unknown comparison filter type "+ +c.type);break;case "Logical":if(c.type===OpenLayers.Filter.Logical.AND)for(e=0,f=c.filters.length;e<f;e++)d=this.write(c.filters[e],d);else OpenLayers.Console.warn("Unsupported logical filter type "+c.type);break;default:OpenLayers.Console.warn("Unknown filter type "+e)}return d},CLASS_NAME:"OpenLayers.Format.QueryStringFilter"})}();OpenLayers.Control.MousePosition=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,element:null,prefix:"",separator:", ",suffix:"",numDigits:5,granularity:10,emptyString:null,lastXy:null,displayProjection:null,destroy:function(){this.deactivate();OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.map.events.register("mousemove",this,this.redraw),this.map.events.register("mouseout",this,this.reset), +this.redraw(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)?(this.map.events.unregister("mousemove",this,this.redraw),this.map.events.unregister("mouseout",this,this.reset),this.element.innerHTML="",!0):!1},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.element||(this.div.left="",this.div.top="",this.element=this.div);return this.div},redraw:function(a){var b;if(null==a)this.reset();else if(null==this.lastXy||Math.abs(a.xy.x- +this.lastXy.x)>this.granularity||Math.abs(a.xy.y-this.lastXy.y)>this.granularity)this.lastXy=a.xy;else if(b=this.map.getLonLatFromPixel(a.xy))this.displayProjection&&b.transform(this.map.getProjectionObject(),this.displayProjection),this.lastXy=a.xy,a=this.formatOutput(b),a!=this.element.innerHTML&&(this.element.innerHTML=a)},reset:function(a){null!=this.emptyString&&(this.element.innerHTML=this.emptyString)},formatOutput:function(a){var b=parseInt(this.numDigits);return this.prefix+a.lon.toFixed(b)+ +this.separator+a.lat.toFixed(b)+this.suffix},CLASS_NAME:"OpenLayers.Control.MousePosition"});OpenLayers.Control.Geolocate=OpenLayers.Class(OpenLayers.Control,{geolocation:null,available:"geolocation"in navigator,bind:!0,watch:!1,geolocationOptions:null,destroy:function(){this.deactivate();OpenLayers.Control.prototype.destroy.apply(this,arguments)},activate:function(){this.available&&!this.geolocation&&(this.geolocation=navigator.geolocation);return this.geolocation?OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.watch?this.watchId=this.geolocation.watchPosition(OpenLayers.Function.bind(this.geolocate, +this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions):this.getCurrentLocation(),!0):!1:(this.events.triggerEvent("locationuncapable"),!1)},deactivate:function(){this.active&&null!==this.watchId&&this.geolocation.clearWatch(this.watchId);return OpenLayers.Control.prototype.deactivate.apply(this,arguments)},geolocate:function(a){var b=(new OpenLayers.LonLat(a.coords.longitude,a.coords.latitude)).transform(new OpenLayers.Projection("EPSG:4326"),this.map.getProjectionObject());this.bind&& +this.map.setCenter(b);this.events.triggerEvent("locationupdated",{position:a,point:new OpenLayers.Geometry.Point(b.lon,b.lat)})},getCurrentLocation:function(){if(!this.active||this.watch)return!1;this.geolocation.getCurrentPosition(OpenLayers.Function.bind(this.geolocate,this),OpenLayers.Function.bind(this.failure,this),this.geolocationOptions);return!0},failure:function(a){this.events.triggerEvent("locationfailed",{error:a})},CLASS_NAME:"OpenLayers.Control.Geolocate"});OpenLayers.Tile.UTFGrid=OpenLayers.Class(OpenLayers.Tile,{url:null,utfgridResolution:2,json:null,format:null,destroy:function(){this.clear();OpenLayers.Tile.prototype.destroy.apply(this,arguments)},draw:function(){var a=OpenLayers.Tile.prototype.draw.apply(this,arguments);if(a)if(this.isLoading?(this.abortLoading(),this.events.triggerEvent("reload")):(this.isLoading=!0,this.events.triggerEvent("loadstart")),this.url=this.layer.getURL(this.bounds),this.layer.useJSONP){var b=new OpenLayers.Protocol.Script({url:this.url, +callback:function(a){this.isLoading=!1;this.events.triggerEvent("loadend");this.json=a.data},scope:this});b.read();this.request=b}else this.request=OpenLayers.Request.GET({url:this.url,callback:function(a){this.isLoading=!1;this.events.triggerEvent("loadend");200===a.status&&this.parseData(a.responseText)},scope:this});else this.unload();return a},abortLoading:function(){this.request&&(this.request.abort(),delete this.request);this.isLoading=!1},getFeatureInfo:function(a,b){var c=null;if(this.json){var d= +this.getFeatureId(a,b);null!==d&&(c={id:d,data:this.json.data[d]})}return c},getFeatureId:function(a,b){var c=null;if(this.json){var d=this.utfgridResolution,d=this.json.grid[Math.floor(b/d)].charCodeAt(Math.floor(a/d)),d=this.indexFromCharCode(d),e=this.json.keys;!isNaN(d)&&d in e&&(c=e[d])}return c},indexFromCharCode:function(a){93<=a&&a--;35<=a&&a--;return a-32},parseData:function(a){this.format||(this.format=new OpenLayers.Format.JSON);this.json=this.format.read(a)},clear:function(){this.json= +null},CLASS_NAME:"OpenLayers.Tile.UTFGrid"});OpenLayers.Protocol.HTTP=OpenLayers.Class(OpenLayers.Protocol,{url:null,headers:null,params:null,callback:null,scope:null,readWithPOST:!1,updateWithPOST:!1,deleteWithPOST:!1,wildcarded:!1,srsInBBOX:!1,initialize:function(a){a=a||{};this.params={};this.headers={};OpenLayers.Protocol.prototype.initialize.apply(this,arguments);if(!this.filterToParams&&OpenLayers.Format.QueryStringFilter){var b=new OpenLayers.Format.QueryStringFilter({wildcarded:this.wildcarded,srsInBBOX:this.srsInBBOX});this.filterToParams= +function(a,d){return b.write(a,d)}}},destroy:function(){this.headers=this.params=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(a){OpenLayers.Protocol.prototype.read.apply(this,arguments);a=a||{};a.params=OpenLayers.Util.applyDefaults(a.params,this.options.params);a=OpenLayers.Util.applyDefaults(a,this.options);a.filter&&this.filterToParams&&(a.params=this.filterToParams(a.filter,a.params));var b=void 0!==a.readWithPOST?a.readWithPOST:this.readWithPOST,c=new OpenLayers.Protocol.Response({requestType:"read"}); +b?(b=a.headers||{},b["Content-Type"]="application/x-www-form-urlencoded",c.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,c,a),data:OpenLayers.Util.getParameterString(a.params),headers:b})):c.priv=OpenLayers.Request.GET({url:a.url,callback:this.createCallback(this.handleRead,c,a),params:a.params,headers:a.headers});return c},handleRead:function(a,b){this.handleResponse(a,b)},create:function(a,b){b=OpenLayers.Util.applyDefaults(b,this.options);var c=new OpenLayers.Protocol.Response({reqFeatures:a, +requestType:"create"});c.priv=OpenLayers.Request.POST({url:b.url,callback:this.createCallback(this.handleCreate,c,b),headers:b.headers,data:this.format.write(a)});return c},handleCreate:function(a,b){this.handleResponse(a,b)},update:function(a,b){b=b||{};var c=b.url||a.url||this.options.url+"/"+a.fid;b=OpenLayers.Util.applyDefaults(b,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:a,requestType:"update"});d.priv=OpenLayers.Request[this.updateWithPOST?"POST":"PUT"]({url:c,callback:this.createCallback(this.handleUpdate, +d,b),headers:b.headers,data:this.format.write(a)});return d},handleUpdate:function(a,b){this.handleResponse(a,b)},"delete":function(a,b){b=b||{};var c=b.url||a.url||this.options.url+"/"+a.fid;b=OpenLayers.Util.applyDefaults(b,this.options);var d=new OpenLayers.Protocol.Response({reqFeatures:a,requestType:"delete"}),e=this.deleteWithPOST?"POST":"DELETE",c={url:c,callback:this.createCallback(this.handleDelete,d,b),headers:b.headers};this.deleteWithPOST&&(c.data=this.format.write(a));d.priv=OpenLayers.Request[e](c); +return d},handleDelete:function(a,b){this.handleResponse(a,b)},handleResponse:function(a,b){var c=a.priv;b.callback&&(200<=c.status&&300>c.status?("delete"!=a.requestType&&(a.features=this.parseFeatures(c)),a.code=OpenLayers.Protocol.Response.SUCCESS):a.code=OpenLayers.Protocol.Response.FAILURE,b.callback.call(b.scope,a))},parseFeatures:function(a){var b=a.responseXML;b&&b.documentElement||(b=a.responseText);return!b||0>=b.length?null:this.format.read(b)},commit:function(a,b){function c(a){for(var b= +a.features?a.features.length:0,c=Array(b),e=0;e<b;++e)c[e]=a.features[e].fid;r.insertIds=c;d.apply(this,[a])}function d(a){this.callUserCallback(a,b);q=q&&a.success();f++;f>=p&&b.callback&&(r.code=q?OpenLayers.Protocol.Response.SUCCESS:OpenLayers.Protocol.Response.FAILURE,b.callback.apply(b.scope,[r]))}b=OpenLayers.Util.applyDefaults(b,this.options);var e=[],f=0,g={};g[OpenLayers.State.INSERT]=[];g[OpenLayers.State.UPDATE]=[];g[OpenLayers.State.DELETE]=[];for(var h,k,l=[],m=0,n=a.length;m<n;++m)if(h= +a[m],k=g[h.state])k.push(h),l.push(h);var p=(0<g[OpenLayers.State.INSERT].length?1:0)+g[OpenLayers.State.UPDATE].length+g[OpenLayers.State.DELETE].length,q=!0,r=new OpenLayers.Protocol.Response({reqFeatures:l});h=g[OpenLayers.State.INSERT];0<h.length&&e.push(this.create(h,OpenLayers.Util.applyDefaults({callback:c,scope:this},b.create)));h=g[OpenLayers.State.UPDATE];for(m=h.length-1;0<=m;--m)e.push(this.update(h[m],OpenLayers.Util.applyDefaults({callback:d,scope:this},b.update)));h=g[OpenLayers.State.DELETE]; +for(m=h.length-1;0<=m;--m)e.push(this["delete"](h[m],OpenLayers.Util.applyDefaults({callback:d,scope:this},b["delete"])));return e},abort:function(a){a&&a.priv.abort()},callUserCallback:function(a,b){var c=b[a.requestType];c&&c.callback&&c.callback.call(c.scope,a)},CLASS_NAME:"OpenLayers.Protocol.HTTP"});OpenLayers.Strategy.Cluster=OpenLayers.Class(OpenLayers.Strategy,{distance:20,threshold:null,features:null,clusters:null,clustering:!1,resolution:null,activate:function(){var a=OpenLayers.Strategy.prototype.activate.call(this);if(a)this.layer.events.on({beforefeaturesadded:this.cacheFeatures,featuresremoved:this.clearCache,moveend:this.cluster,scope:this});return a},deactivate:function(){var a=OpenLayers.Strategy.prototype.deactivate.call(this);a&&(this.clearCache(),this.layer.events.un({beforefeaturesadded:this.cacheFeatures, +featuresremoved:this.clearCache,moveend:this.cluster,scope:this}));return a},cacheFeatures:function(a){var b=!0;this.clustering||(this.clearCache(),this.features=a.features,this.cluster(),b=!1);return b},clearCache:function(){this.clustering||(this.features=null)},cluster:function(a){if((!a||a.zoomChanged)&&this.features&&(a=this.layer.map.getResolution(),a!=this.resolution||!this.clustersExist())){this.resolution=a;a=[];for(var b,c,d,e=0;e<this.features.length;++e)if(b=this.features[e],b.geometry){c= +!1;for(var f=a.length-1;0<=f;--f)if(d=a[f],this.shouldCluster(d,b)){this.addToCluster(d,b);c=!0;break}c||a.push(this.createCluster(this.features[e]))}this.clustering=!0;this.layer.removeAllFeatures();this.clustering=!1;if(0<a.length){if(1<this.threshold)for(b=a.slice(),a=[],e=0,d=b.length;e<d;++e)c=b[e],c.attributes.count<this.threshold?Array.prototype.push.apply(a,c.cluster):a.push(c);this.clustering=!0;this.layer.addFeatures(a);this.clustering=!1}this.clusters=a}},clustersExist:function(){var a= +!1;if(this.clusters&&0<this.clusters.length&&this.clusters.length==this.layer.features.length)for(var a=!0,b=0;b<this.clusters.length;++b)if(this.clusters[b]!=this.layer.features[b]){a=!1;break}return a},shouldCluster:function(a,b){var c=a.geometry.getBounds().getCenterLonLat(),d=b.geometry.getBounds().getCenterLonLat();return Math.sqrt(Math.pow(c.lon-d.lon,2)+Math.pow(c.lat-d.lat,2))/this.resolution<=this.distance},addToCluster:function(a,b){a.cluster.push(b);a.attributes.count+=1},createCluster:function(a){var b= +a.geometry.getBounds().getCenterLonLat(),b=new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(b.lon,b.lat),{count:1});b.cluster=[a];return b},CLASS_NAME:"OpenLayers.Strategy.Cluster"});OpenLayers.Strategy.Filter=OpenLayers.Class(OpenLayers.Strategy,{filter:null,cache:null,caching:!1,activate:function(){var a=OpenLayers.Strategy.prototype.activate.apply(this,arguments);a&&(this.cache=[],this.layer.events.on({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this}));return a},deactivate:function(){this.cache=null;this.layer&&this.layer.events&&this.layer.events.un({beforefeaturesadded:this.handleAdd,beforefeaturesremoved:this.handleRemove,scope:this}); +return OpenLayers.Strategy.prototype.deactivate.apply(this,arguments)},handleAdd:function(a){if(!this.caching&&this.filter){var b=a.features;a.features=[];for(var c,d=0,e=b.length;d<e;++d)c=b[d],this.filter.evaluate(c)?a.features.push(c):this.cache.push(c)}},handleRemove:function(a){this.caching||(this.cache=[])},setFilter:function(a){this.filter=a;a=this.cache;this.cache=[];this.handleAdd({features:this.layer.features});0<this.cache.length&&(this.caching=!0,this.layer.removeFeatures(this.cache.slice()), +this.caching=!1);0<a.length&&(a={features:a},this.handleAdd(a),0<a.features.length&&(this.caching=!0,this.layer.addFeatures(a.features),this.caching=!1))},CLASS_NAME:"OpenLayers.Strategy.Filter"});OpenLayers.Protocol.SOS=function(a){a=OpenLayers.Util.applyDefaults(a,OpenLayers.Protocol.SOS.DEFAULTS);var b=OpenLayers.Protocol.SOS["v"+a.version.replace(/\./g,"_")];if(!b)throw"Unsupported SOS version: "+a.version;return new b(a)};OpenLayers.Protocol.SOS.DEFAULTS={version:"1.0.0"};OpenLayers.Format.WFSDescribeFeatureType=OpenLayers.Class(OpenLayers.Format.XML,{regExes:{trimSpace:/^\s*|\s*$/g},namespaces:{xsd:"http://www.w3.org/2001/XMLSchema"},readers:{xsd:{schema:function(a,b){var c=[],d={},e,f;this.readChildNodes(a,{complexTypes:c,customTypes:d});var g=a.attributes,h,k;e=0;for(f=g.length;e<f;++e)h=g[e],k=h.name,0===k.indexOf("xmlns")?this.setNamespace(k.split(":")[1]||"",h.value):b[k]=h.value;b.featureTypes=c;b.targetPrefix=this.namespaceAlias[b.targetNamespace];e=0;for(f= +c.length;e<f;++e)g=c[e],h=d[g.typeName],d[g.typeName]&&(g.typeName=h.name)},complexType:function(a,b){var c={typeName:a.getAttribute("name")};this.readChildNodes(a,c);b.complexTypes.push(c)},complexContent:function(a,b){this.readChildNodes(a,b)},extension:function(a,b){this.readChildNodes(a,b)},sequence:function(a,b){var c={elements:[]};this.readChildNodes(a,c);b.properties=c.elements},element:function(a,b){var c;if(b.elements){var d={};c=a.attributes;for(var e,f=0,g=c.length;f<g;++f)e=c[f],d[e.name]= +e.value;c=d.type;c||(c={},this.readChildNodes(a,c),d.restriction=c,d.type=c.base);d.localType=(c.base||c).split(":").pop();b.elements.push(d);this.readChildNodes(a,d)}b.complexTypes&&(c=a.getAttribute("type"),d=c.split(":").pop(),b.customTypes[d]={name:a.getAttribute("name"),type:c})},annotation:function(a,b){b.annotation={};this.readChildNodes(a,b.annotation)},appinfo:function(a,b){b.appinfo||(b.appinfo=[]);b.appinfo.push(this.getChildValue(a))},documentation:function(a,b){b.documentation||(b.documentation= +[]);var c=this.getChildValue(a);b.documentation.push({lang:a.getAttribute("xml:lang"),textContent:c.replace(this.regExes.trimSpace,"")})},simpleType:function(a,b){this.readChildNodes(a,b)},restriction:function(a,b){b.base=a.getAttribute("base");this.readRestriction(a,b)}}},readRestriction:function(a,b){for(var c=a.childNodes,d,e,f=0,g=c.length;f<g;++f)d=c[f],1==d.nodeType&&(e=d.nodeName.split(":").pop(),d=d.getAttribute("value"),b[e]?("string"==typeof b[e]&&(b[e]=[b[e]]),b[e].push(d)):b[e]=d)},read:function(a){"string"== +typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};if("ExceptionReport"===a.nodeName.split(":").pop()){var c=new OpenLayers.Format.OGCExceptionReport;b.error=c.read(a)}else this.readNode(a,b);return b},CLASS_NAME:"OpenLayers.Format.WFSDescribeFeatureType"});OpenLayers.Format.GeoRSS=OpenLayers.Class(OpenLayers.Format.XML,{rssns:"http://backend.userland.com/rss2",featureNS:"http://mapserver.gis.umn.edu/mapserver",georssns:"http://www.georss.org/georss",geons:"http://www.w3.org/2003/01/geo/wgs84_pos#",featureTitle:"Untitled",featureDescription:"No Description",gmlParser:null,xy:!1,createGeometryFromItem:function(a){var b=this.getElementsByTagNameNS(a,this.georssns,"point"),c=this.getElementsByTagNameNS(a,this.geons,"lat"),d=this.getElementsByTagNameNS(a, +this.geons,"long"),e=this.getElementsByTagNameNS(a,this.georssns,"line"),f=this.getElementsByTagNameNS(a,this.georssns,"polygon"),g=this.getElementsByTagNameNS(a,this.georssns,"where");a=this.getElementsByTagNameNS(a,this.georssns,"box");if(0<b.length||0<c.length&&0<d.length){0<b.length?(c=OpenLayers.String.trim(b[0].firstChild.nodeValue).split(/\s+/),2!=c.length&&(c=OpenLayers.String.trim(b[0].firstChild.nodeValue).split(/\s*,\s*/))):c=[parseFloat(c[0].firstChild.nodeValue),parseFloat(d[0].firstChild.nodeValue)]; +var h=new OpenLayers.Geometry.Point(c[1],c[0])}else if(0<e.length){c=OpenLayers.String.trim(this.getChildValue(e[0])).split(/\s+/);d=[];e=0;for(f=c.length;e<f;e+=2)b=new OpenLayers.Geometry.Point(c[e+1],c[e]),d.push(b);h=new OpenLayers.Geometry.LineString(d)}else if(0<f.length){c=OpenLayers.String.trim(this.getChildValue(f[0])).split(/\s+/);d=[];e=0;for(f=c.length;e<f;e+=2)b=new OpenLayers.Geometry.Point(c[e+1],c[e]),d.push(b);h=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(d)])}else 0< +g.length?(this.gmlParser||(this.gmlParser=new OpenLayers.Format.GML({xy:this.xy})),h=this.gmlParser.parseFeature(g[0]).geometry):0<a.length&&(c=OpenLayers.String.trim(a[0].firstChild.nodeValue).split(/\s+/),d=[],3<c.length&&(b=new OpenLayers.Geometry.Point(c[1],c[0]),d.push(b),b=new OpenLayers.Geometry.Point(c[1],c[2]),d.push(b),b=new OpenLayers.Geometry.Point(c[3],c[2]),d.push(b),b=new OpenLayers.Geometry.Point(c[3],c[0]),d.push(b),b=new OpenLayers.Geometry.Point(c[1],c[0]),d.push(b)),h=new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(d)])); +h&&(this.internalProjection&&this.externalProjection)&&h.transform(this.externalProjection,this.internalProjection);return h},createFeatureFromItem:function(a){var b=this.createGeometryFromItem(a),c=this._getChildValue(a,"*","title",this.featureTitle),d=this._getChildValue(a,"*","description",this._getChildValue(a,"*","content",this._getChildValue(a,"*","summary",this.featureDescription))),e=this._getChildValue(a,"*","link");if(!e)try{e=this.getElementsByTagNameNS(a,"*","link")[0].getAttribute("href")}catch(f){e= +null}a=this._getChildValue(a,"*","id",null);b=new OpenLayers.Feature.Vector(b,{title:c,description:d,link:e});b.fid=a;return b},_getChildValue:function(a,b,c,d){return(a=this.getElementsByTagNameNS(a,b,c))&&a[0]&&a[0].firstChild&&a[0].firstChild.nodeValue?this.getChildValue(a[0]):void 0==d?"":d},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=null,b=this.getElementsByTagNameNS(a,"*","item");0==b.length&&(b=this.getElementsByTagNameNS(a,"*","entry")); +a=b.length;for(var c=Array(a),d=0;d<a;d++)c[d]=this.createFeatureFromItem(b[d]);return c},write:function(a){var b;if(OpenLayers.Util.isArray(a)){b=this.createElementNS(this.rssns,"rss");for(var c=0,d=a.length;c<d;c++)b.appendChild(this.createFeatureXML(a[c]))}else b=this.createFeatureXML(a);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFeatureXML:function(a){var b=this.buildGeometryNode(a.geometry),c=this.createElementNS(this.rssns,"item"),d=this.createElementNS(this.rssns,"title"); +d.appendChild(this.createTextNode(a.attributes.title?a.attributes.title:""));var e=this.createElementNS(this.rssns,"description");e.appendChild(this.createTextNode(a.attributes.description?a.attributes.description:""));c.appendChild(d);c.appendChild(e);a.attributes.link&&(d=this.createElementNS(this.rssns,"link"),d.appendChild(this.createTextNode(a.attributes.link)),c.appendChild(d));for(var f in a.attributes)"link"!=f&&("title"!=f&&"description"!=f)&&(d=this.createTextNode(a.attributes[f]),e=f,-1!= +f.search(":")&&(e=f.split(":")[1]),e=this.createElementNS(this.featureNS,"feature:"+e),e.appendChild(d),c.appendChild(e));c.appendChild(b);return c},buildGeometryNode:function(a){this.internalProjection&&this.externalProjection&&(a=a.clone(),a.transform(this.internalProjection,this.externalProjection));var b;if("OpenLayers.Geometry.Polygon"==a.CLASS_NAME)b=this.createElementNS(this.georssns,"georss:polygon"),b.appendChild(this.buildCoordinatesNode(a.components[0]));else if("OpenLayers.Geometry.LineString"== +a.CLASS_NAME)b=this.createElementNS(this.georssns,"georss:line"),b.appendChild(this.buildCoordinatesNode(a));else if("OpenLayers.Geometry.Point"==a.CLASS_NAME)b=this.createElementNS(this.georssns,"georss:point"),b.appendChild(this.buildCoordinatesNode(a));else throw"Couldn't parse "+a.CLASS_NAME;return b},buildCoordinatesNode:function(a){var b=null;a.components&&(b=a.components);if(b){a=b.length;for(var c=Array(a),d=0;d<a;d++)c[d]=b[d].y+" "+b[d].x;b=c.join(" ")}else b=a.y+" "+a.x;return this.createTextNode(b)}, +CLASS_NAME:"OpenLayers.Format.GeoRSS"});OpenLayers.Format.WPSCapabilities=OpenLayers.Class(OpenLayers.Format.XML.VersionedOGC,{defaultVersion:"1.0.0",CLASS_NAME:"OpenLayers.Format.WPSCapabilities"});OpenLayers.Format.WPSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows/1.1",wps:"http://www.opengis.net/wps/1.0.0",xlink:"http://www.w3.org/1999/xlink"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a])},read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement); +var b={};this.readNode(a,b);return b},readers:{wps:{Capabilities:function(a,b){this.readChildNodes(a,b)},ProcessOfferings:function(a,b){b.processOfferings={};this.readChildNodes(a,b.processOfferings)},Process:function(a,b){var c={processVersion:this.getAttributeNS(a,this.namespaces.wps,"processVersion")};this.readChildNodes(a,c);b[c.identifier]=c},Languages:function(a,b){b.languages=[];this.readChildNodes(a,b.languages)},Default:function(a,b){var c={isDefault:!0};this.readChildNodes(a,c);b.push(c)}, +Supported:function(a,b){var c={};this.readChildNodes(a,c);b.push(c)}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WPSCapabilities.v1_0_0"});OpenLayers.Control.PinchZoom=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOOL,pinchOrigin:null,currentCenter:null,autoActivate:!0,preserveCenter:!1,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.handler=new OpenLayers.Handler.Pinch(this,{start:this.pinchStart,move:this.pinchMove,done:this.pinchDone},this.handlerOptions)},pinchStart:function(a,b){var c=this.preserveCenter?this.map.getPixelFromLonLat(this.map.getCenter()):a.xy;this.currentCenter= +this.pinchOrigin=c},pinchMove:function(a,b){var c=b.scale,d=this.map.layerContainerOriginPx,e=this.pinchOrigin,f=this.preserveCenter?this.map.getPixelFromLonLat(this.map.getCenter()):a.xy,g=Math.round(d.x+f.x-e.x+(c-1)*(d.x-e.x)),d=Math.round(d.y+f.y-e.y+(c-1)*(d.y-e.y));this.map.applyTransform(g,d,c);this.currentCenter=f},pinchDone:function(a,b,c){this.map.applyTransform();a=this.map.getZoomForResolution(this.map.getResolution()/c.scale,!0);if(a!==this.map.getZoom()||!this.currentCenter.equals(this.pinchOrigin)){b= +this.map.getResolutionForZoom(a);c=this.map.getLonLatFromPixel(this.pinchOrigin);var d=this.currentCenter,e=this.map.getSize();c.lon+=b*(e.w/2-d.x);c.lat-=b*(e.h/2-d.y);this.map.div.clientWidth=this.map.div.clientWidth;this.map.setCenter(c,a)}},CLASS_NAME:"OpenLayers.Control.PinchZoom"});OpenLayers.Control.TouchNavigation=OpenLayers.Class(OpenLayers.Control,{dragPan:null,dragPanOptions:null,pinchZoom:null,pinchZoomOptions:null,clickHandlerOptions:null,documentDrag:!1,autoActivate:!0,initialize:function(a){this.handlers={};OpenLayers.Control.prototype.initialize.apply(this,arguments)},destroy:function(){this.deactivate();this.dragPan&&this.dragPan.destroy();this.dragPan=null;this.pinchZoom&&(this.pinchZoom.destroy(),delete this.pinchZoom);OpenLayers.Control.prototype.destroy.apply(this, +arguments)},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.dragPan.activate(),this.handlers.click.activate(),this.pinchZoom.activate(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this,arguments)?(this.dragPan.deactivate(),this.handlers.click.deactivate(),this.pinchZoom.deactivate(),!0):!1},draw:function(){var a={click:this.defaultClick,dblclick:this.defaultDblClick},b=OpenLayers.Util.extend({"double":!0,stopDouble:!0, +pixelTolerance:2},this.clickHandlerOptions);this.handlers.click=new OpenLayers.Handler.Click(this,a,b);this.dragPan=new OpenLayers.Control.DragPan(OpenLayers.Util.extend({map:this.map,documentDrag:this.documentDrag},this.dragPanOptions));this.dragPan.draw();this.pinchZoom=new OpenLayers.Control.PinchZoom(OpenLayers.Util.extend({map:this.map},this.pinchZoomOptions))},defaultClick:function(a){a.lastTouches&&2==a.lastTouches.length&&this.map.zoomOut()},defaultDblClick:function(a){this.map.zoomTo(this.map.zoom+ +1,a.xy)},CLASS_NAME:"OpenLayers.Control.TouchNavigation"});OpenLayers.Console.warn("OpenLayers.Rico is deprecated");OpenLayers.Rico=OpenLayers.Rico||{}; +OpenLayers.Rico.Color=OpenLayers.Class({initialize:function(a,b,c){this.rgb={r:a,g:b,b:c}},setRed:function(a){this.rgb.r=a},setGreen:function(a){this.rgb.g=a},setBlue:function(a){this.rgb.b=a},setHue:function(a){var b=this.asHSB();b.h=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,b.b)},setSaturation:function(a){var b=this.asHSB();b.s=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,b.b)},setBrightness:function(a){var b=this.asHSB();b.b=a;this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,b.b)}, +darken:function(a){var b=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,Math.max(b.b-a,0))},brighten:function(a){var b=this.asHSB();this.rgb=OpenLayers.Rico.Color.HSBtoRGB(b.h,b.s,Math.min(b.b+a,1))},blend:function(a){this.rgb.r=Math.floor((this.rgb.r+a.rgb.r)/2);this.rgb.g=Math.floor((this.rgb.g+a.rgb.g)/2);this.rgb.b=Math.floor((this.rgb.b+a.rgb.b)/2)},isBright:function(){this.asHSB();return 0.5<this.asHSB().b},isDark:function(){return!this.isBright()},asRGB:function(){return"rgb("+ +this.rgb.r+","+this.rgb.g+","+this.rgb.b+")"},asHex:function(){return"#"+this.rgb.r.toColorPart()+this.rgb.g.toColorPart()+this.rgb.b.toColorPart()},asHSB:function(){return OpenLayers.Rico.Color.RGBtoHSB(this.rgb.r,this.rgb.g,this.rgb.b)},toString:function(){return this.asHex()}}); +OpenLayers.Rico.Color.createFromHex=function(a){if(4==a.length){var b=a;a="#";for(var c=1;4>c;c++)a+=b.charAt(c)+b.charAt(c)}0==a.indexOf("#")&&(a=a.substring(1));b=a.substring(0,2);c=a.substring(2,4);a=a.substring(4,6);return new OpenLayers.Rico.Color(parseInt(b,16),parseInt(c,16),parseInt(a,16))}; +OpenLayers.Rico.Color.createColorFromBackground=function(a){var b=OpenLayers.Element.getStyle(OpenLayers.Util.getElement(a),"backgroundColor");return"transparent"==b&&a.parentNode?OpenLayers.Rico.Color.createColorFromBackground(a.parentNode):null==b?new OpenLayers.Rico.Color(255,255,255):0==b.indexOf("rgb(")?(a=b.substring(4,b.length-1).split(","),new OpenLayers.Rico.Color(parseInt(a[0]),parseInt(a[1]),parseInt(a[2]))):0==b.indexOf("#")?OpenLayers.Rico.Color.createFromHex(b):new OpenLayers.Rico.Color(255, +255,255)}; +OpenLayers.Rico.Color.HSBtoRGB=function(a,b,c){var d=0,e=0,f=0;if(0==b)f=e=d=parseInt(255*c+0.5);else{a=6*(a-Math.floor(a));var g=a-Math.floor(a),h=c*(1-b),k=c*(1-b*g);b=c*(1-b*(1-g));switch(parseInt(a)){case 0:d=255*c+0.5;e=255*b+0.5;f=255*h+0.5;break;case 1:d=255*k+0.5;e=255*c+0.5;f=255*h+0.5;break;case 2:d=255*h+0.5;e=255*c+0.5;f=255*b+0.5;break;case 3:d=255*h+0.5;e=255*k+0.5;f=255*c+0.5;break;case 4:d=255*b+0.5;e=255*h+0.5;f=255*c+0.5;break;case 5:d=255*c+0.5,e=255*h+0.5,f=255*k+0.5}}return{r:parseInt(d),g:parseInt(e), +b:parseInt(f)}};OpenLayers.Rico.Color.RGBtoHSB=function(a,b,c){var d,e=a>b?a:b;c>e&&(e=c);var f=a<b?a:b;c<f&&(f=c);d=0!=e?(e-f)/e:0;if(0==d)a=0;else{var g=(e-a)/(e-f),h=(e-b)/(e-f);c=(e-c)/(e-f);a=(a==e?c-h:b==e?2+g-c:4+h-g)/6;0>a&&(a+=1)}return{h:a,s:d,b:e/255}};OpenLayers.Style2=OpenLayers.Class({id:null,name:null,title:null,description:null,layerName:null,isDefault:!1,rules:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.id=OpenLayers.Util.createUniqueID(this.CLASS_NAME+"_")},destroy:function(){for(var a=0,b=this.rules.length;a<b;a++)this.rules[a].destroy();delete this.rules},clone:function(){var a=OpenLayers.Util.extend({},this);if(this.rules){a.rules=[];for(var b=0,c=this.rules.length;b<c;++b)a.rules.push(this.rules[b].clone())}return new OpenLayers.Style2(a)}, +CLASS_NAME:"OpenLayers.Style2"});OpenLayers.Format.WFS=OpenLayers.Class(OpenLayers.Format.GML,{layer:null,wfsns:"http://www.opengis.net/wfs",ogcns:"http://www.opengis.net/ogc",initialize:function(a,b){OpenLayers.Format.GML.prototype.initialize.apply(this,[a]);this.layer=b;this.layer.featureNS&&(this.featureNS=this.layer.featureNS);this.layer.options.geometry_column&&(this.geometryName=this.layer.options.geometry_column);this.layer.options.typename&&(this.featureName=this.layer.options.typename)},write:function(a){var b=this.createElementNS(this.wfsns, +"wfs:Transaction");b.setAttribute("version","1.0.0");b.setAttribute("service","WFS");for(var c=0;c<a.length;c++)switch(a[c].state){case OpenLayers.State.INSERT:b.appendChild(this.insert(a[c]));break;case OpenLayers.State.UPDATE:b.appendChild(this.update(a[c]));break;case OpenLayers.State.DELETE:b.appendChild(this.remove(a[c]))}return OpenLayers.Format.XML.prototype.write.apply(this,[b])},createFeatureXML:function(a){var b=this.buildGeometryNode(a.geometry),c=this.createElementNS(this.featureNS,"feature:"+ +this.geometryName);c.appendChild(b);b=this.createElementNS(this.featureNS,"feature:"+this.featureName);b.appendChild(c);for(var d in a.attributes){var c=this.createTextNode(a.attributes[d]),e=d;-1!=d.search(":")&&(e=d.split(":")[1]);e=this.createElementNS(this.featureNS,"feature:"+e);e.appendChild(c);b.appendChild(e)}return b},insert:function(a){var b=this.createElementNS(this.wfsns,"wfs:Insert");b.appendChild(this.createFeatureXML(a));return b},update:function(a){a.fid||OpenLayers.Console.userError(OpenLayers.i18n("noFID")); +var b=this.createElementNS(this.wfsns,"wfs:Update");b.setAttribute("typeName",this.featurePrefix+":"+this.featureName);b.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var c=this.createElementNS(this.wfsns,"wfs:Property"),d=this.createElementNS(this.wfsns,"wfs:Name"),e=this.createTextNode(this.geometryName);d.appendChild(e);c.appendChild(d);d=this.createElementNS(this.wfsns,"wfs:Value");e=this.buildGeometryNode(a.geometry);a.layer&&e.setAttribute("srsName",a.layer.projection.getCode()); +d.appendChild(e);c.appendChild(d);b.appendChild(c);for(var f in a.attributes)c=this.createElementNS(this.wfsns,"wfs:Property"),d=this.createElementNS(this.wfsns,"wfs:Name"),d.appendChild(this.createTextNode(f)),c.appendChild(d),d=this.createElementNS(this.wfsns,"wfs:Value"),d.appendChild(this.createTextNode(a.attributes[f])),c.appendChild(d),b.appendChild(c);c=this.createElementNS(this.ogcns,"ogc:Filter");f=this.createElementNS(this.ogcns,"ogc:FeatureId");f.setAttribute("fid",a.fid);c.appendChild(f); +b.appendChild(c);return b},remove:function(a){if(!a.fid)return OpenLayers.Console.userError(OpenLayers.i18n("noFID")),!1;var b=this.createElementNS(this.wfsns,"wfs:Delete");b.setAttribute("typeName",this.featurePrefix+":"+this.featureName);b.setAttribute("xmlns:"+this.featurePrefix,this.featureNS);var c=this.createElementNS(this.ogcns,"ogc:Filter"),d=this.createElementNS(this.ogcns,"ogc:FeatureId");d.setAttribute("fid",a.fid);c.appendChild(d);b.appendChild(c);return b},destroy:function(){this.layer= +null},CLASS_NAME:"OpenLayers.Format.WFS"});OpenLayers.Format.SLD.v1_0_0_GeoServer=OpenLayers.Class(OpenLayers.Format.SLD.v1_0_0,{version:"1.0.0",profile:"GeoServer",readers:OpenLayers.Util.applyDefaults({sld:OpenLayers.Util.applyDefaults({Priority:function(a,b){var c=this.readers.ogc._expression.call(this,a);c&&(b.priority=c)},VendorOption:function(a,b){b.vendorOptions||(b.vendorOptions={});b.vendorOptions[a.getAttribute("name")]=this.getChildValue(a)},TextSymbolizer:function(a,b){OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld.TextSymbolizer.apply(this, +arguments);var c=this.multipleSymbolizers?b.symbolizers[b.symbolizers.length-1]:b.symbolizer.Text;void 0===c.graphic&&(c.graphic=!1)}},OpenLayers.Format.SLD.v1_0_0.prototype.readers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.readers),writers:OpenLayers.Util.applyDefaults({sld:OpenLayers.Util.applyDefaults({Priority:function(a){return this.writers.sld._OGCExpression.call(this,"sld:Priority",a)},VendorOption:function(a){return this.createElementNSPlus("sld:VendorOption",{attributes:{name:a.name}, +value:a.value})},TextSymbolizer:function(a){var b=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.TextSymbolizer.apply(this,arguments);!1!==a.graphic&&(a.externalGraphic||a.graphicName)&&this.writeNode("Graphic",a,b);"priority"in a&&this.writeNode("Priority",a.priority,b);return this.addVendorOptions(b,a)},PointSymbolizer:function(a){var b=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PointSymbolizer.apply(this,arguments);return this.addVendorOptions(b,a)},LineSymbolizer:function(a){var b= +OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.LineSymbolizer.apply(this,arguments);return this.addVendorOptions(b,a)},PolygonSymbolizer:function(a){var b=OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld.PolygonSymbolizer.apply(this,arguments);return this.addVendorOptions(b,a)}},OpenLayers.Format.SLD.v1_0_0.prototype.writers.sld)},OpenLayers.Format.SLD.v1_0_0.prototype.writers),addVendorOptions:function(a,b){if(b.vendorOptions)for(var c in b.vendorOptions)this.writeNode("VendorOption",{name:c, +value:b.vendorOptions[c]},a);return a},CLASS_NAME:"OpenLayers.Format.SLD.v1_0_0_GeoServer"});OpenLayers.Layer.Boxes=OpenLayers.Class(OpenLayers.Layer.Markers,{drawMarker:function(a){var b=this.map.getLayerPxFromLonLat({lon:a.bounds.left,lat:a.bounds.top}),c=this.map.getLayerPxFromLonLat({lon:a.bounds.right,lat:a.bounds.bottom});null==c||null==b?a.display(!1):(b=a.draw(b,{w:Math.max(1,c.x-b.x),h:Math.max(1,c.y-b.y)}),a.drawn||(this.div.appendChild(b),a.drawn=!0))},removeMarker:function(a){OpenLayers.Util.removeItem(this.markers,a);null!=a.div&&a.div.parentNode==this.div&&this.div.removeChild(a.div)}, +CLASS_NAME:"OpenLayers.Layer.Boxes"});OpenLayers.Format.WFSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.WFSCapabilities.v1,{readers:{wfs:OpenLayers.Util.applyDefaults({Service:function(a,b){b.service={};this.readChildNodes(a,b.service)},Fees:function(a,b){var c=this.getChildValue(a);c&&"none"!=c.toLowerCase()&&(b.fees=c)},AccessConstraints:function(a,b){var c=this.getChildValue(a);c&&"none"!=c.toLowerCase()&&(b.accessConstraints=c)},OnlineResource:function(a,b){var c=this.getChildValue(a);c&&"none"!=c.toLowerCase()&&(b.onlineResource= +c)},Keywords:function(a,b){var c=this.getChildValue(a);c&&"none"!=c.toLowerCase()&&(b.keywords=c.split(", "))},Capability:function(a,b){b.capability={};this.readChildNodes(a,b.capability)},Request:function(a,b){b.request={};this.readChildNodes(a,b.request)},GetFeature:function(a,b){b.getfeature={href:{},formats:[]};this.readChildNodes(a,b.getfeature)},ResultFormat:function(a,b){for(var c=a.childNodes,d,e=0;e<c.length;e++)d=c[e],1==d.nodeType&&b.formats.push(d.nodeName)},DCPType:function(a,b){this.readChildNodes(a, +b)},HTTP:function(a,b){this.readChildNodes(a,b.href)},Get:function(a,b){b.get=a.getAttribute("onlineResource")},Post:function(a,b){b.post=a.getAttribute("onlineResource")},SRS:function(a,b){var c=this.getChildValue(a);c&&(b.srs=c)}},OpenLayers.Format.WFSCapabilities.v1.prototype.readers.wfs)},CLASS_NAME:"OpenLayers.Format.WFSCapabilities.v1_0_0"});OpenLayers.Format.WMSCapabilities.v1_3=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1,{readers:{wms:OpenLayers.Util.applyDefaults({WMS_Capabilities:function(a,b){this.readChildNodes(a,b)},LayerLimit:function(a,b){b.layerLimit=parseInt(this.getChildValue(a))},MaxWidth:function(a,b){b.maxWidth=parseInt(this.getChildValue(a))},MaxHeight:function(a,b){b.maxHeight=parseInt(this.getChildValue(a))},BoundingBox:function(a,b){var c=OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms.BoundingBox.apply(this, +[a,b]);c.srs=a.getAttribute("CRS");b.bbox[c.srs]=c},CRS:function(a,b){this.readers.wms.SRS.apply(this,[a,b])},EX_GeographicBoundingBox:function(a,b){b.llbbox=[];this.readChildNodes(a,b.llbbox)},westBoundLongitude:function(a,b){b[0]=this.getChildValue(a)},eastBoundLongitude:function(a,b){b[2]=this.getChildValue(a)},southBoundLatitude:function(a,b){b[1]=this.getChildValue(a)},northBoundLatitude:function(a,b){b[3]=this.getChildValue(a)},MinScaleDenominator:function(a,b){b.maxScale=parseFloat(this.getChildValue(a)).toPrecision(16)}, +MaxScaleDenominator:function(a,b){b.minScale=parseFloat(this.getChildValue(a)).toPrecision(16)},Dimension:function(a,b){var c={name:a.getAttribute("name").toLowerCase(),units:a.getAttribute("units"),unitsymbol:a.getAttribute("unitSymbol"),nearestVal:"1"===a.getAttribute("nearestValue"),multipleVal:"1"===a.getAttribute("multipleValues"),"default":a.getAttribute("default")||"",current:"1"===a.getAttribute("current"),values:this.getChildValue(a).split(",")};b.dimensions[c.name]=c},Keyword:function(a, +b){var c={value:this.getChildValue(a),vocabulary:a.getAttribute("vocabulary")};b.keywords&&b.keywords.push(c)}},OpenLayers.Format.WMSCapabilities.v1.prototype.readers.wms),sld:{UserDefinedSymbolization:function(a,b){this.readers.wms.UserDefinedSymbolization.apply(this,[a,b]);b.userSymbols.inlineFeature=1==parseInt(a.getAttribute("InlineFeature"));b.userSymbols.remoteWCS=1==parseInt(a.getAttribute("RemoteWCS"))},DescribeLayer:function(a,b){this.readers.wms.DescribeLayer.apply(this,[a,b])},GetLegendGraphic:function(a, +b){this.readers.wms.GetLegendGraphic.apply(this,[a,b])}}},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_3"});OpenLayers.Layer.Zoomify=OpenLayers.Class(OpenLayers.Layer.Grid,{size:null,isBaseLayer:!0,standardTileSize:256,tileOriginCorner:"tl",numberOfTiers:0,tileCountUpToTier:null,tierSizeInTiles:null,tierImageSize:null,initialize:function(a,b,c,d){this.initializeZoomify(c);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a,b,c,{},d])},initializeZoomify:function(a){var b=a.clone();this.size=a.clone();a=new OpenLayers.Size(Math.ceil(b.w/this.standardTileSize),Math.ceil(b.h/this.standardTileSize));this.tierSizeInTiles= +[a];for(this.tierImageSize=[b];b.w>this.standardTileSize||b.h>this.standardTileSize;)b=new OpenLayers.Size(Math.floor(b.w/2),Math.floor(b.h/2)),a=new OpenLayers.Size(Math.ceil(b.w/this.standardTileSize),Math.ceil(b.h/this.standardTileSize)),this.tierSizeInTiles.push(a),this.tierImageSize.push(b);this.tierSizeInTiles.reverse();this.tierImageSize.reverse();this.numberOfTiers=this.tierSizeInTiles.length;b=[1];this.tileCountUpToTier=[0];for(a=1;a<this.numberOfTiers;a++)b.unshift(Math.pow(2,a)),this.tileCountUpToTier.push(this.tierSizeInTiles[a- +1].w*this.tierSizeInTiles[a-1].h+this.tileCountUpToTier[a-1]);this.serverResolutions||(this.serverResolutions=b)},destroy:function(){OpenLayers.Layer.Grid.prototype.destroy.apply(this,arguments);this.tileCountUpToTier.length=0;this.tierSizeInTiles.length=0;this.tierImageSize.length=0},clone:function(a){null==a&&(a=new OpenLayers.Layer.Zoomify(this.name,this.url,this.size,this.options));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getURL:function(a){a=this.adjustBounds(a);var b= +this.getServerResolution(),c=Math.round((a.left-this.tileOrigin.lon)/(b*this.tileSize.w));a=Math.round((this.tileOrigin.lat-a.top)/(b*this.tileSize.h));b=this.getZoomForResolution(b);c="TileGroup"+Math.floor((c+a*this.tierSizeInTiles[b].w+this.tileCountUpToTier[b])/256)+"/"+b+"-"+c+"-"+a+".jpg";b=this.url;OpenLayers.Util.isArray(b)&&(b=this.selectUrl(c,b));return b+c},getImageSize:function(){if(0<arguments.length){var a=this.adjustBounds(arguments[0]),b=this.getServerResolution(),c=Math.round((a.left- +this.tileOrigin.lon)/(b*this.tileSize.w)),a=Math.round((this.tileOrigin.lat-a.top)/(b*this.tileSize.h)),b=this.getZoomForResolution(b),d=this.standardTileSize,e=this.standardTileSize;c==this.tierSizeInTiles[b].w-1&&(d=this.tierImageSize[b].w%this.standardTileSize);a==this.tierSizeInTiles[b].h-1&&(e=this.tierImageSize[b].h%this.standardTileSize);return new OpenLayers.Size(d,e)}return this.tileSize},setMap:function(a){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments);this.tileOrigin=new OpenLayers.LonLat(this.map.maxExtent.left, +this.map.maxExtent.top)},CLASS_NAME:"OpenLayers.Layer.Zoomify"});OpenLayers.Layer.MapServer=OpenLayers.Class(OpenLayers.Layer.Grid,{DEFAULT_PARAMS:{mode:"map",map_imagetype:"png"},initialize:function(a,b,c,d){OpenLayers.Layer.Grid.prototype.initialize.apply(this,arguments);this.params=OpenLayers.Util.applyDefaults(this.params,this.DEFAULT_PARAMS);if(null==d||null==d.isBaseLayer)this.isBaseLayer="true"!=this.params.transparent&&!0!=this.params.transparent},clone:function(a){null==a&&(a=new OpenLayers.Layer.MapServer(this.name,this.url,this.params,this.getOptions())); +return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getURL:function(a){a=this.adjustBounds(a);a=[a.left,a.bottom,a.right,a.top];var b=this.getImageSize();return this.getFullRequestString({mapext:a,imgext:a,map_size:[b.w,b.h],imgx:b.w/2,imgy:b.h/2,imgxy:[b.w,b.h]})},getFullRequestString:function(a,b){var c=null==b?this.url:b,d=OpenLayers.Util.extend({},this.params),d=OpenLayers.Util.extend(d,a),e=OpenLayers.Util.getParameterString(d);OpenLayers.Util.isArray(c)&&(c=this.selectUrl(e,c)); +var e=OpenLayers.Util.upperCaseObject(OpenLayers.Util.getParameters(c)),f;for(f in d)f.toUpperCase()in e&&delete d[f];e=OpenLayers.Util.getParameterString(d);d=c;e=e.replace(/,/g,"+");""!=e&&(f=c.charAt(c.length-1),d="&"==f||"?"==f?d+e:-1==c.indexOf("?")?d+("?"+e):d+("&"+e));return d},CLASS_NAME:"OpenLayers.Layer.MapServer"});OpenLayers.Renderer.VML=OpenLayers.Class(OpenLayers.Renderer.Elements,{xmlns:"urn:schemas-microsoft-com:vml",symbolCache:{},offset:null,initialize:function(a){if(this.supported()){if(!document.namespaces.olv){document.namespaces.add("olv",this.xmlns);for(var b=document.createStyleSheet(),c="shape rect oval fill stroke imagedata group textbox".split(" "),d=0,e=c.length;d<e;d++)b.addRule("olv\\:"+c[d],"behavior: url(#default#VML); position: absolute; display: inline-block;")}OpenLayers.Renderer.Elements.prototype.initialize.apply(this, +arguments)}},supported:function(){return!!document.namespaces},setExtent:function(a,b){var c=OpenLayers.Renderer.Elements.prototype.setExtent.apply(this,arguments),d=this.getResolution(),e=a.left/d|0,d=a.top/d-this.size.h|0;b||!this.offset?(this.offset={x:e,y:d},d=e=0):(e-=this.offset.x,d-=this.offset.y);this.root.coordorigin=e-this.xOffset+" "+d;for(var e=[this.root,this.vectorRoot,this.textRoot],f=0,g=e.length;f<g;++f)d=e[f],d.coordsize=this.size.w+" "+this.size.h;this.root.style.flip="y";return c}, +setSize:function(a){OpenLayers.Renderer.prototype.setSize.apply(this,arguments);for(var b=[this.rendererRoot,this.root,this.vectorRoot,this.textRoot],c=this.size.w+"px",d=this.size.h+"px",e,f=0,g=b.length;f<g;++f)e=b[f],e.style.width=c,e.style.height=d},getNodeType:function(a,b){var c=null;switch(a.CLASS_NAME){case "OpenLayers.Geometry.Point":c=b.externalGraphic?"olv:rect":this.isComplexSymbol(b.graphicName)?"olv:shape":"olv:oval";break;case "OpenLayers.Geometry.Rectangle":c="olv:rect";break;case "OpenLayers.Geometry.LineString":case "OpenLayers.Geometry.LinearRing":case "OpenLayers.Geometry.Polygon":case "OpenLayers.Geometry.Curve":c= +"olv:shape"}return c},setStyle:function(a,b,c,d){b=b||a._style;c=c||a._options;var e=b.fillColor,f=b.title||b.graphicTitle;f&&(a.title=f);if("OpenLayers.Geometry.Point"===a._geometryClass)if(b.externalGraphic){c.isFilled=!0;var e=b.graphicWidth||b.graphicHeight,f=b.graphicHeight||b.graphicWidth,e=e?e:2*b.pointRadius,f=f?f:2*b.pointRadius,g=this.getResolution(),h=void 0!=b.graphicXOffset?b.graphicXOffset:-(0.5*e),k=void 0!=b.graphicYOffset?b.graphicYOffset:-(0.5*f);a.style.left=((d.x-this.featureDx)/ +g-this.offset.x+h|0)+"px";a.style.top=(d.y/g-this.offset.y-(k+f)|0)+"px";a.style.width=e+"px";a.style.height=f+"px";a.style.flip="y";e="none";c.isStroked=!1}else this.isComplexSymbol(b.graphicName)?(f=this.importSymbol(b.graphicName),a.path=f.path,a.coordorigin=f.left+","+f.bottom,f=f.size,a.coordsize=f+","+f,this.drawCircle(a,d,b.pointRadius),a.style.flip="y"):this.drawCircle(a,d,b.pointRadius);c.isFilled?a.fillcolor=e:a.filled="false";d=a.getElementsByTagName("fill");d=0==d.length?null:d[0];c.isFilled? +(d||(d=this.createNode("olv:fill",a.id+"_fill")),d.opacity=b.fillOpacity,"OpenLayers.Geometry.Point"===a._geometryClass&&b.externalGraphic&&(b.graphicOpacity&&(d.opacity=b.graphicOpacity),d.src=b.externalGraphic,d.type="frame",b.graphicWidth&&b.graphicHeight||(d.aspect="atmost")),d.parentNode!=a&&a.appendChild(d)):d&&a.removeChild(d);e=b.rotation;if(void 0!==e||void 0!==a._rotation)a._rotation=e,b.externalGraphic?(this.graphicRotate(a,h,k,b),d.opacity=0):"OpenLayers.Geometry.Point"===a._geometryClass&& +(a.style.rotation=e||0);h=a.getElementsByTagName("stroke");h=0==h.length?null:h[0];c.isStroked?(h||(h=this.createNode("olv:stroke",a.id+"_stroke"),a.appendChild(h)),h.on=!0,h.color=b.strokeColor,h.weight=b.strokeWidth+"px",h.opacity=b.strokeOpacity,h.endcap="butt"==b.strokeLinecap?"flat":b.strokeLinecap||"round",b.strokeDashstyle&&(h.dashstyle=this.dashStyle(b))):(a.stroked=!1,h&&(h.on=!1));"inherit"!=b.cursor&&null!=b.cursor&&(a.style.cursor=b.cursor);return a},graphicRotate:function(a,b,c,d){d= +d||a._style;var e=d.rotation||0,f,g;if(d.graphicWidth&&d.graphicHeight){g=Math.max(d.graphicWidth,d.graphicHeight);f=d.graphicWidth/d.graphicHeight;var h=Math.round(d.graphicWidth||g*f),k=Math.round(d.graphicHeight||g);a.style.width=h+"px";a.style.height=k+"px";var l=document.getElementById(a.id+"_image");l||(l=this.createNode("olv:imagedata",a.id+"_image"),a.appendChild(l));l.style.width=h+"px";l.style.height=k+"px";l.src=d.externalGraphic;l.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='', sizingMethod='scale')"; +l=e*Math.PI/180;e=Math.sin(l);l=Math.cos(l);e="progid:DXImageTransform.Microsoft.Matrix(M11="+l+",M12="+-e+",M21="+e+",M22="+l+",SizingMethod='auto expand')\n";(l=d.graphicOpacity||d.fillOpacity)&&1!=l&&(e+="progid:DXImageTransform.Microsoft.BasicImage(opacity="+l+")\n");a.style.filter=e;e=new OpenLayers.Geometry.Point(-b,-c);h=(new OpenLayers.Bounds(0,0,h,k)).toGeometry();h.rotate(d.rotation,e);h=h.getBounds();a.style.left=Math.round(parseInt(a.style.left)+h.left)+"px";a.style.top=Math.round(parseInt(a.style.top)- +h.bottom)+"px"}else{var m=new Image;m.onreadystatechange=OpenLayers.Function.bind(function(){if("complete"==m.readyState||"interactive"==m.readyState)f=m.width/m.height,g=Math.max(2*d.pointRadius,d.graphicWidth||0,d.graphicHeight||0),b*=f,d.graphicWidth=g*f,d.graphicHeight=g,this.graphicRotate(a,b,c,d)},this);m.src=d.externalGraphic}},postDraw:function(a){a.style.visibility="visible";var b=a._style.fillColor,c=a._style.strokeColor;"none"==b&&a.fillcolor!=b&&(a.fillcolor=b);"none"==c&&a.strokecolor!= +c&&(a.strokecolor=c)},setNodeDimension:function(a,b){var c=b.getBounds();if(c){var d=this.getResolution(),c=new OpenLayers.Bounds((c.left-this.featureDx)/d-this.offset.x|0,c.bottom/d-this.offset.y|0,(c.right-this.featureDx)/d-this.offset.x|0,c.top/d-this.offset.y|0);a.style.left=c.left+"px";a.style.top=c.top+"px";a.style.width=c.getWidth()+"px";a.style.height=c.getHeight()+"px";a.coordorigin=c.left+" "+c.top;a.coordsize=c.getWidth()+" "+c.getHeight()}},dashStyle:function(a){a=a.strokeDashstyle;switch(a){case "solid":case "dot":case "dash":case "dashdot":case "longdash":case "longdashdot":return a; +default:return a=a.split(/[ ,]/),2==a.length?1*a[0]>=2*a[1]?"longdash":1==a[0]||1==a[1]?"dot":"dash":4==a.length?1*a[0]>=2*a[1]?"longdashdot":"dashdot":"solid"}},createNode:function(a,b){var c=document.createElement(a);b&&(c.id=b);c.unselectable="on";c.onselectstart=OpenLayers.Function.False;return c},nodeTypeCompare:function(a,b){var c=b,d=c.indexOf(":");-1!=d&&(c=c.substr(d+1));var e=a.nodeName,d=e.indexOf(":");-1!=d&&(e=e.substr(d+1));return c==e},createRenderRoot:function(){return this.nodeFactory(this.container.id+ +"_vmlRoot","div")},createRoot:function(a){return this.nodeFactory(this.container.id+a,"olv:group")},drawPoint:function(a,b){return this.drawCircle(a,b,1)},drawCircle:function(a,b,c){if(!isNaN(b.x)&&!isNaN(b.y)){var d=this.getResolution();a.style.left=((b.x-this.featureDx)/d-this.offset.x|0)-c+"px";a.style.top=(b.y/d-this.offset.y|0)-c+"px";b=2*c;a.style.width=b+"px";a.style.height=b+"px";return a}return!1},drawLineString:function(a,b){return this.drawLine(a,b,!1)},drawLinearRing:function(a,b){return this.drawLine(a, +b,!0)},drawLine:function(a,b,c){this.setNodeDimension(a,b);for(var d=this.getResolution(),e=b.components.length,f=Array(e),g,h,k=0;k<e;k++)g=b.components[k],h=(g.x-this.featureDx)/d-this.offset.x|0,g=g.y/d-this.offset.y|0,f[k]=" "+h+","+g+" l ";b=c?" x e":" e";a.path="m"+f.join("")+b;return a},drawPolygon:function(a,b){this.setNodeDimension(a,b);var c=this.getResolution(),d=[],e,f,g,h,k,l,m,n,p,q;e=0;for(f=b.components.length;e<f;e++){d.push("m");g=b.components[e].components;h=0===e;l=k=null;m=0; +for(n=g.length;m<n;m++)p=g[m],q=(p.x-this.featureDx)/c-this.offset.x|0,p=p.y/c-this.offset.y|0,q=" "+q+","+p,d.push(q),0==m&&d.push(" l"),h||(k?k!=q&&(l?l!=q&&(h=!0):l=q):k=q);d.push(h?" x ":" ")}d.push("e");a.path=d.join("");return a},drawRectangle:function(a,b){var c=this.getResolution();a.style.left=((b.x-this.featureDx)/c-this.offset.x|0)+"px";a.style.top=(b.y/c-this.offset.y|0)+"px";a.style.width=(b.width/c|0)+"px";a.style.height=(b.height/c|0)+"px";return a},drawText:function(a,b,c){var d=this.nodeFactory(a+ +this.LABEL_ID_SUFFIX,"olv:rect"),e=this.nodeFactory(a+this.LABEL_ID_SUFFIX+"_textbox","olv:textbox"),f=this.getResolution();d.style.left=((c.x-this.featureDx)/f-this.offset.x|0)+"px";d.style.top=(c.y/f-this.offset.y|0)+"px";d.style.flip="y";e.innerText=b.label;"inherit"!=b.cursor&&null!=b.cursor&&(e.style.cursor=b.cursor);b.fontColor&&(e.style.color=b.fontColor);b.fontOpacity&&(e.style.filter="alpha(opacity="+100*b.fontOpacity+")");b.fontFamily&&(e.style.fontFamily=b.fontFamily);b.fontSize&&(e.style.fontSize= +b.fontSize);b.fontWeight&&(e.style.fontWeight=b.fontWeight);b.fontStyle&&(e.style.fontStyle=b.fontStyle);!0===b.labelSelect&&(d._featureId=a,e._featureId=a,e._geometry=c,e._geometryClass=c.CLASS_NAME);e.style.whiteSpace="nowrap";e.inset="1px,0px,0px,0px";d.parentNode||(d.appendChild(e),this.textRoot.appendChild(d));b=b.labelAlign||"cm";1==b.length&&(b+="m");a=e.clientWidth*OpenLayers.Renderer.VML.LABEL_SHIFT[b.substr(0,1)];e=e.clientHeight*OpenLayers.Renderer.VML.LABEL_SHIFT[b.substr(1,1)];d.style.left= +parseInt(d.style.left)-a-1+"px";d.style.top=parseInt(d.style.top)+e+"px"},moveRoot:function(a){var b=this.map.getLayer(a.container.id);b instanceof OpenLayers.Layer.Vector.RootContainer&&(b=this.map.getLayer(this.container.id));b&&b.renderer.clear();OpenLayers.Renderer.Elements.prototype.moveRoot.apply(this,arguments);b&&b.redraw()},importSymbol:function(a){var b=this.container.id+"-"+a,c=this.symbolCache[b];if(c)return c;c=OpenLayers.Renderer.symbol[a];if(!c)throw Error(a+" is not a valid symbol name"); +a=new OpenLayers.Bounds(Number.MAX_VALUE,Number.MAX_VALUE,0,0);for(var d=["m"],e=0;e<c.length;e+=2){var f=c[e],g=c[e+1];a.left=Math.min(a.left,f);a.bottom=Math.min(a.bottom,g);a.right=Math.max(a.right,f);a.top=Math.max(a.top,g);d.push(f);d.push(g);0==e&&d.push("l")}d.push("x e");c=d.join(" ");d=(a.getWidth()-a.getHeight())/2;0<d?(a.bottom-=d,a.top+=d):(a.left+=d,a.right-=d);c={path:c,size:a.getWidth(),left:a.left,bottom:a.bottom};return this.symbolCache[b]=c},CLASS_NAME:"OpenLayers.Renderer.VML"}); +OpenLayers.Renderer.VML.LABEL_SHIFT={l:0,c:0.5,r:1,t:0,m:0.5,b:1};OpenLayers.Control.CacheRead=OpenLayers.Class(OpenLayers.Control,{fetchEvent:"tileloadstart",layers:null,autoActivate:!0,setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);var b,c=this.layers||a.layers;for(b=c.length-1;0<=b;--b)this.addLayer({layer:c[b]});if(!this.layers)a.events.on({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this})},addLayer:function(a){a.layer.events.register(this.fetchEvent,this,this.fetch)},removeLayer:function(a){a.layer.events.unregister(this.fetchEvent, +this,this.fetch)},fetch:function(a){if(this.active&&window.localStorage&&a.tile instanceof OpenLayers.Tile.Image){var b=a.tile,c=b.url;!b.layer.crossOriginKeyword&&(OpenLayers.ProxyHost&&0===c.indexOf(OpenLayers.ProxyHost))&&(c=OpenLayers.Control.CacheWrite.urlMap[c]);if(c=window.localStorage.getItem("olCache_"+c))b.url=c,"tileerror"===a.type&&b.setImgSrc(c)}},destroy:function(){if(this.layers||this.map){var a,b=this.layers||this.map.layers;for(a=b.length-1;0<=a;--a)this.removeLayer({layer:b[a]})}this.map&& +this.map.events.un({addlayer:this.addLayer,removeLayer:this.removeLayer,scope:this});OpenLayers.Control.prototype.destroy.apply(this,arguments)},CLASS_NAME:"OpenLayers.Control.CacheRead"});OpenLayers.Protocol.WFS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.0.0",CLASS_NAME:"OpenLayers.Protocol.WFS.v1_0_0"});OpenLayers.Format.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Format.XML,{layerIdentifier:"_layer",featureIdentifier:"_feature",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},gmlFormat:null,read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));var b=a.documentElement;if(b){var c=this["read_"+b.nodeName];a=c?c.call(this,b):(new OpenLayers.Format.GML(this.options?this.options:{})).read(a)}return a},read_msGMLOutput:function(a){var b= +[];if(a=this.getSiblingNodesByTagCriteria(a,this.layerIdentifier))for(var c=0,d=a.length;c<d;++c){var e=a[c],f=e.nodeName;e.prefix&&(f=f.split(":")[1]);f=f.replace(this.layerIdentifier,"");if(e=this.getSiblingNodesByTagCriteria(e,this.featureIdentifier))for(var g=0;g<e.length;g++){var h=e[g],k=this.parseGeometry(h),h=this.parseAttributes(h),h=new OpenLayers.Feature.Vector(k.geometry,h,null);h.bounds=k.bounds;h.type=f;b.push(h)}}return b},read_FeatureInfoResponse:function(a){var b=[];a=this.getElementsByTagNameNS(a, +"*","FIELDS");for(var c=0,d=a.length;c<d;c++){var e=a[c],f={},g,h=e.attributes.length;if(0<h)for(g=0;g<h;g++){var k=e.attributes[g];f[k.nodeName]=k.nodeValue}else for(e=e.childNodes,g=0,h=e.length;g<h;++g)k=e[g],3!=k.nodeType&&(f[k.getAttribute("name")]=k.getAttribute("value"));b.push(new OpenLayers.Feature.Vector(null,f,null))}return b},getSiblingNodesByTagCriteria:function(a,b){var c=[],d,e,f,g;if(a&&a.hasChildNodes()){d=a.childNodes;f=d.length;for(var h=0;h<f;h++){for(g=d[h];g&&1!=g.nodeType;)g= +g.nextSibling,h++;e=g?g.nodeName:"";0<e.length&&-1<e.indexOf(b)?c.push(g):(e=this.getSiblingNodesByTagCriteria(g,b),0<e.length&&(0==c.length?c=e:c.push(e)))}}return c},parseAttributes:function(a){var b={};if(1==a.nodeType){a=a.childNodes;for(var c=a.length,d=0;d<c;++d){var e=a[d];if(1==e.nodeType){var f=e.childNodes,e=e.prefix?e.nodeName.split(":")[1]:e.nodeName;0==f.length?b[e]=null:1==f.length&&(f=f[0],3==f.nodeType||4==f.nodeType)&&(f=f.nodeValue.replace(this.regExes.trimSpace,""),b[e]=f)}}}return b}, +parseGeometry:function(a){this.gmlFormat||(this.gmlFormat=new OpenLayers.Format.GML);a=this.gmlFormat.parseFeature(a);var b,c=null;a&&(b=a.geometry&&a.geometry.clone(),c=a.bounds&&a.bounds.clone(),a.destroy());return{geometry:b,bounds:c}},CLASS_NAME:"OpenLayers.Format.WMSGetFeatureInfo"});OpenLayers.Control.WMTSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:!1,requestEncoding:"KVP",drillDown:!1,maxFeatures:10,clickCallback:"click",layers:null,queryVisible:!0,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handler:null,hoverRequest:null,pending:0,initialize:function(a){a=a||{};a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(a.formatOptions)); +!0===this.drillDown&&(this.hover=!1);this.hover?this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250})):(a={},a[this.clickCallback]=this.getInfoForClick,this.handler=new OpenLayers.Handler.Click(this,a,this.handlerOptions.click||{}))},getInfoForClick:function(a){this.request(a.xy,{})},getInfoForHover:function(a){this.request(a.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(--this.pending, +0>=this.pending&&(OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),this.pending=0),this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var a=this.layers||this.map.layers,b=[],c,d=a.length-1;0<=d&&(c=a[d],!(c instanceof OpenLayers.Layer.WMTS)||(c.requestEncoding!==this.requestEncoding||this.queryVisible&&!c.getVisibility())||(b.push(c),this.drillDown&&!this.hover));--d);return b},buildRequestOptions:function(a,b){var c=this.map.getLonLatFromPixel(b),d=a.getURL(new OpenLayers.Bounds(c.lon, +c.lat,c.lon,c.lat)),d=OpenLayers.Util.getParameters(d),c=a.getTileInfo(c);OpenLayers.Util.extend(d,{service:"WMTS",version:a.version,request:"GetFeatureInfo",infoFormat:this.infoFormat,i:c.i,j:c.j});OpenLayers.Util.applyDefaults(d,this.vendorParams);return{url:OpenLayers.Util.isArray(a.url)?a.url[0]:a.url,params:OpenLayers.Util.upperCaseObject(d),callback:function(c){this.handleResponse(b,c,a)},scope:this}},request:function(a,b){b=b||{};var c=this.findLayers();if(0<c.length){for(var d,e,f=0,g=c.length;f< +g;f++)e=c[f],d=this.events.triggerEvent("beforegetfeatureinfo",{xy:a,layer:e}),!1!==d&&(++this.pending,d=this.buildRequestOptions(e,a),d=OpenLayers.Request.GET(d),!0===b.hover&&(this.hoverRequest=d));0<this.pending&&OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait")}},handleResponse:function(a,b,c){--this.pending;0>=this.pending&&(OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait"),this.pending=0);if(b.status&&(200>b.status||300<=b.status))this.events.triggerEvent("exception", +{xy:a,request:b,layer:c});else{var d=b.responseXML;d&&d.documentElement||(d=b.responseText);var e,f;try{e=this.format.read(d)}catch(g){f=!0,this.events.triggerEvent("exception",{xy:a,request:b,error:g,layer:c})}f||this.events.triggerEvent("getfeatureinfo",{text:b.responseText,features:e,request:b,xy:a,layer:c})}},CLASS_NAME:"OpenLayers.Control.WMTSGetFeatureInfo"});OpenLayers.Protocol.CSW.v2_0_2=OpenLayers.Class(OpenLayers.Protocol,{formatOptions:null,initialize:function(a){OpenLayers.Protocol.prototype.initialize.apply(this,[a]);a.format||(this.format=new OpenLayers.Format.CSWGetRecords.v2_0_2(OpenLayers.Util.extend({},this.formatOptions)))},destroy:function(){this.options&&!this.options.format&&this.format.destroy();this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(a){a=OpenLayers.Util.extend({},a);OpenLayers.Util.applyDefaults(a, +this.options||{});var b=new OpenLayers.Protocol.Response({requestType:"read"}),c=this.format.write(a.params||a);b.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,b,a),params:a.params,headers:a.headers,data:c});return b},handleRead:function(a,b){if(b.callback){var c=a.priv;200<=c.status&&300>c.status?(a.data=this.parseData(c),a.code=OpenLayers.Protocol.Response.SUCCESS):a.code=OpenLayers.Protocol.Response.FAILURE;b.callback.call(b.scope,a)}},parseData:function(a){var b= +a.responseXML;b&&b.documentElement||(b=a.responseText);return!b||0>=b.length?null:this.format.read(b)},CLASS_NAME:"OpenLayers.Protocol.CSW.v2_0_2"});OpenLayers.Format.WCSCapabilities.v1_1_0=OpenLayers.Class(OpenLayers.Format.WCSCapabilities.v1,{namespaces:{wcs:"http://www.opengis.net/wcs/1.1",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance",ows:"http://www.opengis.net/ows/1.1"},errorProperty:"operationsMetadata",readers:{wcs:OpenLayers.Util.applyDefaults({Capabilities:function(a,b){this.readChildNodes(a,b)},Contents:function(a,b){b.contentMetadata=[];this.readChildNodes(a,b.contentMetadata)},CoverageSummary:function(a, +b){var c={};this.readChildNodes(a,c);b.push(c)},Identifier:function(a,b){b.identifier=this.getChildValue(a)},Title:function(a,b){b.title=this.getChildValue(a)},Abstract:function(a,b){b["abstract"]=this.getChildValue(a)},SupportedCRS:function(a,b){var c=this.getChildValue(a);c&&(b.supportedCRS||(b.supportedCRS=[]),b.supportedCRS.push(c))},SupportedFormat:function(a,b){var c=this.getChildValue(a);c&&(b.supportedFormat||(b.supportedFormat=[]),b.supportedFormat.push(c))}},OpenLayers.Format.WCSCapabilities.v1.prototype.readers.wcs), +ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WCSCapabilities.v1_1_0"});OpenLayers.Control.Graticule=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,intervals:[45,30,20,10,5,2,1,0.5,0.2,0.1,0.05,0.01,0.005,0.002,0.001],displayInLayerSwitcher:!0,visible:!0,numPoints:50,targetSize:200,layerName:null,labelled:!0,labelFormat:"dm",lineSymbolizer:{strokeColor:"#333",strokeWidth:1,strokeOpacity:0.5},labelSymbolizer:{},gratLayer:null,initialize:function(a){a=a||{};a.layerName=a.layerName||OpenLayers.i18n("Graticule");OpenLayers.Control.prototype.initialize.apply(this,[a]); +this.labelSymbolizer.stroke=!1;this.labelSymbolizer.fill=!1;this.labelSymbolizer.label="${label}";this.labelSymbolizer.labelAlign="${labelAlign}";this.labelSymbolizer.labelXOffset="${xOffset}";this.labelSymbolizer.labelYOffset="${yOffset}"},destroy:function(){this.deactivate();OpenLayers.Control.prototype.destroy.apply(this,arguments);this.gratLayer&&(this.gratLayer.destroy(),this.gratLayer=null)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);if(!this.gratLayer){var a=new OpenLayers.Style({}, +{rules:[new OpenLayers.Rule({symbolizer:{Point:this.labelSymbolizer,Line:this.lineSymbolizer}})]});this.gratLayer=new OpenLayers.Layer.Vector(this.layerName,{styleMap:new OpenLayers.StyleMap({"default":a}),visibility:this.visible,displayInLayerSwitcher:this.displayInLayerSwitcher})}return this.div},activate:function(){return OpenLayers.Control.prototype.activate.apply(this,arguments)?(this.map.addLayer(this.gratLayer),this.map.events.register("moveend",this,this.update),this.update(),!0):!1},deactivate:function(){return OpenLayers.Control.prototype.deactivate.apply(this, +arguments)?(this.map.events.unregister("moveend",this,this.update),this.map.removeLayer(this.gratLayer),!0):!1},update:function(){var a=this.map.getExtent();if(a){this.gratLayer.destroyFeatures();var b=new OpenLayers.Projection("EPSG:4326"),c=this.map.getProjectionObject(),d=this.map.getResolution();c.proj&&"longlat"==c.proj.projName&&(this.numPoints=1);var e=this.map.getCenter(),f=new OpenLayers.Pixel(e.lon,e.lat);OpenLayers.Projection.transform(f,c,b);for(var e=this.targetSize*d,e=e*e,g,d=0;d<this.intervals.length;++d){g= +this.intervals[d];var h=g/2,k=f.offset({x:-h,y:-h}),h=f.offset({x:h,y:h});OpenLayers.Projection.transform(k,b,c);OpenLayers.Projection.transform(h,b,c);if((k.x-h.x)*(k.x-h.x)+(k.y-h.y)*(k.y-h.y)<=e)break}f.x=Math.floor(f.x/g)*g;f.y=Math.floor(f.y/g)*g;var d=0,e=[f.clone()],h=f.clone(),l;do h=h.offset({x:0,y:g}),l=OpenLayers.Projection.transform(h.clone(),b,c),e.unshift(h);while(a.containsPixel(l)&&1E3>++d);h=f.clone();do h=h.offset({x:0,y:-g}),l=OpenLayers.Projection.transform(h.clone(),b,c),e.push(h); +while(a.containsPixel(l)&&1E3>++d);d=0;k=[f.clone()];h=f.clone();do h=h.offset({x:-g,y:0}),l=OpenLayers.Projection.transform(h.clone(),b,c),k.unshift(h);while(a.containsPixel(l)&&1E3>++d);h=f.clone();do h=h.offset({x:g,y:0}),l=OpenLayers.Projection.transform(h.clone(),b,c),k.push(h);while(a.containsPixel(l)&&1E3>++d);g=[];for(d=0;d<k.length;++d){l=k[d].x;for(var f=[],m=null,n=Math.min(e[0].y,90),h=Math.max(e[e.length-1].y,-90),p=(n-h)/this.numPoints,n=h,h=0;h<=this.numPoints;++h){var q=new OpenLayers.Geometry.Point(l, +n);q.transform(b,c);f.push(q);n+=p;q.y>=a.bottom&&!m&&(m=q)}this.labelled&&(m=new OpenLayers.Geometry.Point(m.x,a.bottom),l={value:l,label:this.labelled?OpenLayers.Util.getFormattedLonLat(l,"lon",this.labelFormat):"",labelAlign:"cb",xOffset:0,yOffset:2},this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(m,l)));f=new OpenLayers.Geometry.LineString(f);g.push(new OpenLayers.Feature.Vector(f))}for(h=0;h<e.length;++h)if(n=e[h].y,!(-90>n||90<n)){f=[];d=k[0].x;p=(k[k.length-1].x-d)/this.numPoints; +l=d;m=null;for(d=0;d<=this.numPoints;++d)q=new OpenLayers.Geometry.Point(l,n),q.transform(b,c),f.push(q),l+=p,q.x<a.right&&(m=q);this.labelled&&(m=new OpenLayers.Geometry.Point(a.right,m.y),l={value:n,label:this.labelled?OpenLayers.Util.getFormattedLonLat(n,"lat",this.labelFormat):"",labelAlign:"rb",xOffset:-2,yOffset:2},this.gratLayer.addFeatures(new OpenLayers.Feature.Vector(m,l)));f=new OpenLayers.Geometry.LineString(f);g.push(new OpenLayers.Feature.Vector(f))}this.gratLayer.addFeatures(g)}},CLASS_NAME:"OpenLayers.Control.Graticule"});OpenLayers.Console.warn("OpenLayers.Rico is deprecated");OpenLayers.Rico=OpenLayers.Rico||{}; +OpenLayers.Rico.Corner={round:function(a,b){a=OpenLayers.Util.getElement(a);this._setOptions(b);var c=this.options.color;"fromElement"==this.options.color&&(c=this._background(a));var d=this.options.bgColor;"fromParent"==this.options.bgColor&&(d=this._background(a.offsetParent));this._roundCornersImpl(a,c,d)},changeColor:function(a,b){a.style.backgroundColor=b;for(var c=a.parentNode.getElementsByTagName("span"),d=0;d<c.length;d++)c[d].style.backgroundColor=b},changeOpacity:function(a,b){var c="alpha(opacity="+ +100*b+")";a.style.opacity=b;a.style.filter=c;for(var d=a.parentNode.getElementsByTagName("span"),e=0;e<d.length;e++)d[e].style.opacity=b,d[e].style.filter=c},reRound:function(a,b){var c=a.parentNode.childNodes[2];a.parentNode.removeChild(a.parentNode.childNodes[0]);a.parentNode.removeChild(c);this.round(a.parentNode,b)},_roundCornersImpl:function(a,b,c){this.options.border&&this._renderBorder(a,c);this._isTopRounded()&&this._roundTopCorners(a,b,c);this._isBottomRounded()&&this._roundBottomCorners(a, +b,c)},_renderBorder:function(a,b){var c="1px solid "+this._borderColor(b);a.innerHTML="<div "+("style='border-left: "+c+";"+("border-right: "+c)+"'")+">"+a.innerHTML+"</div>"},_roundTopCorners:function(a,b,c){for(var d=this._createCorner(c),e=0;e<this.options.numSlices;e++)d.appendChild(this._createCornerSlice(b,c,e,"top"));a.style.paddingTop=0;a.insertBefore(d,a.firstChild)},_roundBottomCorners:function(a,b,c){for(var d=this._createCorner(c),e=this.options.numSlices-1;0<=e;e--)d.appendChild(this._createCornerSlice(b, +c,e,"bottom"));a.style.paddingBottom=0;a.appendChild(d)},_createCorner:function(a){var b=document.createElement("div");b.style.backgroundColor=this._isTransparent()?"transparent":a;return b},_createCornerSlice:function(a,b,c,d){var e=document.createElement("span"),f=e.style;f.backgroundColor=a;f.display="block";f.height="1px";f.overflow="hidden";f.fontSize="1px";a=this._borderColor(a,b);this.options.border&&0==c?(f.borderTopStyle="solid",f.borderTopWidth="1px",f.borderLeftWidth="0px",f.borderRightWidth= +"0px",f.borderBottomWidth="0px",f.height="0px",f.borderColor=a):a&&(f.borderColor=a,f.borderStyle="solid",f.borderWidth="0px 1px");this.options.compact||c!=this.options.numSlices-1||(f.height="2px");this._setMargin(e,c,d);this._setBorder(e,c,d);return e},_setOptions:function(a){this.options={corners:"all",color:"fromElement",bgColor:"fromParent",blend:!0,border:!1,compact:!1};OpenLayers.Util.extend(this.options,a||{});this.options.numSlices=this.options.compact?2:4;this._isTransparent()&&(this.options.blend= +!1)},_whichSideTop:function(){return this._hasString(this.options.corners,"all","top")||0<=this.options.corners.indexOf("tl")&&0<=this.options.corners.indexOf("tr")?"":0<=this.options.corners.indexOf("tl")?"left":0<=this.options.corners.indexOf("tr")?"right":""},_whichSideBottom:function(){return this._hasString(this.options.corners,"all","bottom")||0<=this.options.corners.indexOf("bl")&&0<=this.options.corners.indexOf("br")?"":0<=this.options.corners.indexOf("bl")?"left":0<=this.options.corners.indexOf("br")? +"right":""},_borderColor:function(a,b){return"transparent"==a?b:this.options.border?this.options.border:this.options.blend?this._blend(b,a):""},_setMargin:function(a,b,c){b=this._marginSize(b);c="top"==c?this._whichSideTop():this._whichSideBottom();"left"==c?(a.style.marginLeft=b+"px",a.style.marginRight="0px"):"right"==c?(a.style.marginRight=b+"px",a.style.marginLeft="0px"):(a.style.marginLeft=b+"px",a.style.marginRight=b+"px")},_setBorder:function(a,b,c){b=this._borderSize(b);c="top"==c?this._whichSideTop(): +this._whichSideBottom();"left"==c?(a.style.borderLeftWidth=b+"px",a.style.borderRightWidth="0px"):"right"==c?(a.style.borderRightWidth=b+"px",a.style.borderLeftWidth="0px"):(a.style.borderLeftWidth=b+"px",a.style.borderRightWidth=b+"px");!1!=this.options.border&&(a.style.borderLeftWidth=b+"px",a.style.borderRightWidth=b+"px")},_marginSize:function(a){if(this._isTransparent())return 0;var b=[5,3,2,1],c=[3,2,1,0],d=[2,1],e=[1,0];return this.options.compact&&this.options.blend?e[a]:this.options.compact? +d[a]:this.options.blend?c[a]:b[a]},_borderSize:function(a){var b=[5,3,2,1],c=[2,1,1,1],d=[1,0],e=[0,2,0,0];return this.options.compact&&(this.options.blend||this._isTransparent())?1:this.options.compact?d[a]:this.options.blend?c[a]:this.options.border?e[a]:this._isTransparent()?b[a]:0},_hasString:function(a){for(var b=1;b<arguments.length;b++)if(0<=a.indexOf(arguments[b]))return!0;return!1},_blend:function(a,b){var c=OpenLayers.Rico.Color.createFromHex(a);c.blend(OpenLayers.Rico.Color.createFromHex(b)); +return c},_background:function(a){try{return OpenLayers.Rico.Color.createColorFromBackground(a).asHex()}catch(b){return"#ffffff"}},_isTransparent:function(){return"transparent"==this.options.color},_isTopRounded:function(){return this._hasString(this.options.corners,"all","top","tl","tr")},_isBottomRounded:function(){return this._hasString(this.options.corners,"all","bottom","bl","br")},_hasSingleTextChild:function(a){return 1==a.childNodes.length&&3==a.childNodes[0].nodeType}};OpenLayers.Control.NavigationHistory=OpenLayers.Class(OpenLayers.Control,{type:OpenLayers.Control.TYPE_TOGGLE,previous:null,previousOptions:null,next:null,nextOptions:null,limit:50,autoActivate:!0,clearOnDeactivate:!1,registry:null,nextStack:null,previousStack:null,listeners:null,restoring:!1,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.registry=OpenLayers.Util.extend({moveend:this.getState},this.registry);a={trigger:OpenLayers.Function.bind(this.previousTrigger, +this),displayClass:this.displayClass+" "+this.displayClass+"Previous"};OpenLayers.Util.extend(a,this.previousOptions);this.previous=new OpenLayers.Control.Button(a);a={trigger:OpenLayers.Function.bind(this.nextTrigger,this),displayClass:this.displayClass+" "+this.displayClass+"Next"};OpenLayers.Util.extend(a,this.nextOptions);this.next=new OpenLayers.Control.Button(a);this.clear()},onPreviousChange:function(a,b){a&&!this.previous.active?this.previous.activate():!a&&this.previous.active&&this.previous.deactivate()}, +onNextChange:function(a,b){a&&!this.next.active?this.next.activate():!a&&this.next.active&&this.next.deactivate()},destroy:function(){OpenLayers.Control.prototype.destroy.apply(this);this.previous.destroy();this.next.destroy();this.deactivate();for(var a in this)this[a]=null},setMap:function(a){this.map=a;this.next.setMap(a);this.previous.setMap(a)},draw:function(){OpenLayers.Control.prototype.draw.apply(this,arguments);this.next.draw();this.previous.draw()},previousTrigger:function(){var a=this.previousStack.shift(), +b=this.previousStack.shift();void 0!=b?(this.nextStack.unshift(a),this.previousStack.unshift(b),this.restoring=!0,this.restore(b),this.restoring=!1,this.onNextChange(this.nextStack[0],this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1)):this.previousStack.unshift(a);return b},nextTrigger:function(){var a=this.nextStack.shift();void 0!=a&&(this.previousStack.unshift(a),this.restoring=!0,this.restore(a),this.restoring=!1,this.onNextChange(this.nextStack[0], +this.nextStack.length),this.onPreviousChange(this.previousStack[1],this.previousStack.length-1));return a},clear:function(){this.previousStack=[];this.previous.deactivate();this.nextStack=[];this.next.deactivate()},getState:function(){return{center:this.map.getCenter(),resolution:this.map.getResolution(),projection:this.map.getProjectionObject(),units:this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units}},restore:function(a){var b,c;if(this.map.getProjectionObject()== +a.projection)c=this.map.getZoomForResolution(a.resolution),b=a.center;else{b=a.center.clone();b.transform(a.projection,this.map.getProjectionObject());c=a.units;var d=this.map.getProjectionObject().getUnits()||this.map.units||this.map.baseLayer.units;c=this.map.getZoomForResolution((c&&d?OpenLayers.INCHES_PER_UNIT[c]/OpenLayers.INCHES_PER_UNIT[d]:1)*a.resolution)}this.map.setCenter(b,c)},setListeners:function(){this.listeners={};for(var a in this.registry)this.listeners[a]=OpenLayers.Function.bind(function(){if(!this.restoring){var b= +this.registry[a].apply(this,arguments);this.previousStack.unshift(b);if(1<this.previousStack.length)this.onPreviousChange(this.previousStack[1],this.previousStack.length-1);this.previousStack.length>this.limit+1&&this.previousStack.pop();0<this.nextStack.length&&(this.nextStack=[],this.onNextChange(null,0))}return!0},this)},activate:function(){var a=!1;if(this.map&&OpenLayers.Control.prototype.activate.apply(this)){null==this.listeners&&this.setListeners();for(var b in this.listeners)this.map.events.register(b, +this,this.listeners[b]);a=!0;0==this.previousStack.length&&this.initStack()}return a},initStack:function(){this.map.getCenter()&&this.listeners.moveend()},deactivate:function(){var a=!1;if(this.map&&OpenLayers.Control.prototype.deactivate.apply(this)){for(var b in this.listeners)this.map.events.unregister(b,this,this.listeners[b]);this.clearOnDeactivate&&this.clear();a=!0}return a},CLASS_NAME:"OpenLayers.Control.NavigationHistory"});OpenLayers.Layer.UTFGrid=OpenLayers.Class(OpenLayers.Layer.XYZ,{isBaseLayer:!1,projection:new OpenLayers.Projection("EPSG:900913"),useJSONP:!1,tileClass:OpenLayers.Tile.UTFGrid,initialize:function(a){OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a.name,a.url,{},a]);this.tileOptions=OpenLayers.Util.extend({utfgridResolution:this.utfgridResolution},this.tileOptions)},createBackBuffer:function(){},clone:function(a){null==a&&(a=new OpenLayers.Layer.UTFGrid(this.getOptions()));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this, +[a])},getFeatureInfo:function(a){var b=null;(a=this.getTileData(a))&&a.tile&&(b=a.tile.getFeatureInfo(a.i,a.j));return b},getFeatureId:function(a){var b=null;a=this.getTileData(a);a.tile&&(b=a.tile.getFeatureId(a.i,a.j));return b},CLASS_NAME:"OpenLayers.Layer.UTFGrid"});OpenLayers.TileManager=OpenLayers.Class({cacheSize:256,tilesPerFrame:2,frameDelay:16,moveDelay:100,zoomDelay:200,maps:null,tileQueueId:null,tileQueue:null,tileCache:null,tileCacheIndex:null,initialize:function(a){OpenLayers.Util.extend(this,a);this.maps=[];this.tileQueueId={};this.tileQueue={};this.tileCache={};this.tileCacheIndex=[]},addMap:function(a){if(!this._destroyed&&OpenLayers.Layer.Grid){this.maps.push(a);this.tileQueue[a.id]=[];for(var b=0,c=a.layers.length;b<c;++b)this.addLayer({layer:a.layers[b]}); +a.events.on({move:this.move,zoomend:this.zoomEnd,changelayer:this.changeLayer,addlayer:this.addLayer,preremovelayer:this.removeLayer,scope:this})}},removeMap:function(a){if(!this._destroyed&&OpenLayers.Layer.Grid){window.clearTimeout(this.tileQueueId[a.id]);if(a.layers)for(var b=0,c=a.layers.length;b<c;++b)this.removeLayer({layer:a.layers[b]});a.events&&a.events.un({move:this.move,zoomend:this.zoomEnd,changelayer:this.changeLayer,addlayer:this.addLayer,preremovelayer:this.removeLayer,scope:this}); +delete this.tileQueue[a.id];delete this.tileQueueId[a.id];OpenLayers.Util.removeItem(this.maps,a)}},move:function(a){this.updateTimeout(a.object,this.moveDelay,!0)},zoomEnd:function(a){this.updateTimeout(a.object,this.zoomDelay)},changeLayer:function(a){"visibility"!==a.property&&"params"!==a.property||this.updateTimeout(a.object,0)},addLayer:function(a){a=a.layer;if(a instanceof OpenLayers.Layer.Grid){a.events.on({addtile:this.addTile,retile:this.clearTileQueue,scope:this});var b,c,d;for(b=a.grid.length- +1;0<=b;--b)for(c=a.grid[b].length-1;0<=c;--c)d=a.grid[b][c],this.addTile({tile:d}),d.url&&!d.imgDiv&&this.manageTileCache({object:d})}},removeLayer:function(a){a=a.layer;if(a instanceof OpenLayers.Layer.Grid&&(this.clearTileQueue({object:a}),a.events&&a.events.un({addtile:this.addTile,retile:this.clearTileQueue,scope:this}),a.grid)){var b,c,d;for(b=a.grid.length-1;0<=b;--b)for(c=a.grid[b].length-1;0<=c;--c)d=a.grid[b][c],this.unloadTile({object:d})}},updateTimeout:function(a,b,c){window.clearTimeout(this.tileQueueId[a.id]); +var d=this.tileQueue[a.id];if(!c||d.length)this.tileQueueId[a.id]=window.setTimeout(OpenLayers.Function.bind(function(){this.drawTilesFromQueue(a);d.length&&this.updateTimeout(a,this.frameDelay)},this),b)},addTile:function(a){if(a.tile instanceof OpenLayers.Tile.Image)a.tile.events.on({beforedraw:this.queueTileDraw,beforeload:this.manageTileCache,loadend:this.addToCache,unload:this.unloadTile,scope:this});else this.removeLayer({layer:a.tile.layer})},unloadTile:function(a){a=a.object;a.events.un({beforedraw:this.queueTileDraw, +beforeload:this.manageTileCache,loadend:this.addToCache,unload:this.unloadTile,scope:this});OpenLayers.Util.removeItem(this.tileQueue[a.layer.map.id],a)},queueTileDraw:function(a){a=a.object;var b=!1,c=a.layer,d=c.getURL(a.bounds),e=this.tileCache[d];e&&"olTileImage"!==e.className&&(delete this.tileCache[d],OpenLayers.Util.removeItem(this.tileCacheIndex,d),e=null);!c.url||!c.async&&e||(b=this.tileQueue[c.map.id],~OpenLayers.Util.indexOf(b,a)||b.push(a),b=!0);return!b},drawTilesFromQueue:function(a){var b= +this.tileQueue[a.id],c=this.tilesPerFrame;for(a=a.zoomTween&&a.zoomTween.playing;!a&&b.length&&c;)b.shift().draw(!0),--c},manageTileCache:function(a){a=a.object;var b=this.tileCache[a.url];b&&(b.parentNode&&OpenLayers.Element.hasClass(b.parentNode,"olBackBuffer")&&(b.parentNode.removeChild(b),b.id=null),b.parentNode||(b.style.visibility="hidden",b.style.opacity=0,a.setImage(b),OpenLayers.Util.removeItem(this.tileCacheIndex,a.url),this.tileCacheIndex.push(a.url)))},addToCache:function(a){a=a.object; +this.tileCache[a.url]||OpenLayers.Element.hasClass(a.imgDiv,"olImageLoadError")||(this.tileCacheIndex.length>=this.cacheSize&&(delete this.tileCache[this.tileCacheIndex[0]],this.tileCacheIndex.shift()),this.tileCache[a.url]=a.imgDiv,this.tileCacheIndex.push(a.url))},clearTileQueue:function(a){a=a.object;for(var b=this.tileQueue[a.map.id],c=b.length-1;0<=c;--c)b[c].layer===a&&b.splice(c,1)},destroy:function(){for(var a=this.maps.length-1;0<=a;--a)this.removeMap(this.maps[a]);this.tileCacheIndex=this.tileCache= +this.tileQueueId=this.tileQueue=this.maps=null;this._destroyed=!0}});OpenLayers.Layer.ArcGISCache=OpenLayers.Class(OpenLayers.Layer.XYZ,{url:null,tileOrigin:null,tileSize:new OpenLayers.Size(256,256),useArcGISServer:!0,type:"png",useScales:!1,overrideDPI:!1,initialize:function(a,b,c){OpenLayers.Layer.XYZ.prototype.initialize.apply(this,arguments);this.resolutions&&(this.serverResolutions=this.resolutions,this.maxExtent=this.getMaxExtentForResolution(this.resolutions[0]));if(this.layerInfo){var d=this.layerInfo,e=new OpenLayers.Bounds(d.fullExtent.xmin,d.fullExtent.ymin, +d.fullExtent.xmax,d.fullExtent.ymax);this.projection="EPSG:"+d.spatialReference.wkid;this.sphericalMercator=102100==d.spatialReference.wkid;this.units="esriFeet"==d.units?"ft":"m";if(d.tileInfo){this.tileSize=new OpenLayers.Size(d.tileInfo.width||d.tileInfo.cols,d.tileInfo.height||d.tileInfo.rows);this.tileOrigin=new OpenLayers.LonLat(d.tileInfo.origin.x,d.tileInfo.origin.y);var f=new OpenLayers.Geometry.Point(e.left,e.top),e=new OpenLayers.Geometry.Point(e.right,e.bottom);this.useScales?this.scales= +[]:this.resolutions=[];this.lods=[];for(var g in d.tileInfo.lods)if(d.tileInfo.lods.hasOwnProperty(g)){var h=d.tileInfo.lods[g];this.useScales?this.scales.push(h.scale):this.resolutions.push(h.resolution);var k=this.getContainingTileCoords(f,h.resolution);h.startTileCol=k.x;h.startTileRow=k.y;k=this.getContainingTileCoords(e,h.resolution);h.endTileCol=k.x;h.endTileRow=k.y;this.lods.push(h)}this.maxExtent=this.calculateMaxExtentWithLOD(this.lods[0]);this.serverResolutions=this.resolutions;this.overrideDPI&& +d.tileInfo.dpi&&(OpenLayers.DOTS_PER_INCH=d.tileInfo.dpi)}}},getContainingTileCoords:function(a,b){return new OpenLayers.Pixel(Math.max(Math.floor((a.x-this.tileOrigin.lon)/(this.tileSize.w*b)),0),Math.max(Math.floor((this.tileOrigin.lat-a.y)/(this.tileSize.h*b)),0))},calculateMaxExtentWithLOD:function(a){var b=this.tileOrigin.lon+a.startTileCol*this.tileSize.w*a.resolution,c=this.tileOrigin.lat-a.startTileRow*this.tileSize.h*a.resolution;return new OpenLayers.Bounds(b,c-(a.endTileRow-a.startTileRow+ +1)*this.tileSize.h*a.resolution,b+(a.endTileCol-a.startTileCol+1)*this.tileSize.w*a.resolution,c)},calculateMaxExtentWithExtent:function(a,b){var c=new OpenLayers.Geometry.Point(a.left,a.top),d=new OpenLayers.Geometry.Point(a.right,a.bottom),c=this.getContainingTileCoords(c,b),d=this.getContainingTileCoords(d,b);return this.calculateMaxExtentWithLOD({resolution:b,startTileCol:c.x,startTileRow:c.y,endTileCol:d.x,endTileRow:d.y})},getUpperLeftTileCoord:function(a){var b=new OpenLayers.Geometry.Point(this.maxExtent.left, +this.maxExtent.top);return this.getContainingTileCoords(b,a)},getLowerRightTileCoord:function(a){var b=new OpenLayers.Geometry.Point(this.maxExtent.right,this.maxExtent.bottom);return this.getContainingTileCoords(b,a)},getMaxExtentForResolution:function(a){var b=this.getUpperLeftTileCoord(a),c=this.getLowerRightTileCoord(a),d=this.tileOrigin.lon+b.x*this.tileSize.w*a,e=this.tileOrigin.lat-b.y*this.tileSize.h*a;return new OpenLayers.Bounds(d,e-(c.y-b.y+1)*this.tileSize.h*a,d+(c.x-b.x+1)*this.tileSize.w* +a,e)},clone:function(a){null==a&&(a=new OpenLayers.Layer.ArcGISCache(this.name,this.url,this.options));return OpenLayers.Layer.XYZ.prototype.clone.apply(this,[a])},initGriddedTiles:function(a){delete this._tileOrigin;OpenLayers.Layer.XYZ.prototype.initGriddedTiles.apply(this,arguments)},getMaxExtent:function(){var a=this.map.getResolution();return this.maxExtent=this.getMaxExtentForResolution(a)},getTileOrigin:function(){if(!this._tileOrigin){var a=this.getMaxExtent();this._tileOrigin=new OpenLayers.LonLat(a.left, +a.bottom)}return this._tileOrigin},getURL:function(a){var b=this.getResolution(),c=this.tileOrigin.lon+b*this.tileSize.w/2,d=this.tileOrigin.lat-b*this.tileSize.h/2;a=a.getCenterLonLat();c=Math.round(Math.abs((a.lon-c)/(b*this.tileSize.w)));d=Math.round(Math.abs((d-a.lat)/(b*this.tileSize.h)));a=this.map.getZoom();if(this.lods){if(b=this.lods[this.map.getZoom()],c<b.startTileCol||c>b.endTileCol||d<b.startTileRow||d>b.endTileRow)return null}else{var e=this.getUpperLeftTileCoord(b),b=this.getLowerRightTileCoord(b); +if(c<e.x||c>=b.x||d<e.y||d>=b.y)return null}b=this.url;e=""+c+d+a;OpenLayers.Util.isArray(b)&&(b=this.selectUrl(e,b));this.useArcGISServer?b+="/tile/${z}/${y}/${x}":(c="C"+OpenLayers.Number.zeroPad(c,8,16),d="R"+OpenLayers.Number.zeroPad(d,8,16),a="L"+OpenLayers.Number.zeroPad(a,2,10),b=b+"/${z}/${y}/${x}."+this.type);b=OpenLayers.String.format(b,{x:c,y:d,z:a});return OpenLayers.Util.urlAppend(b,OpenLayers.Util.getParameterString(this.params))},CLASS_NAME:"OpenLayers.Layer.ArcGISCache"});OpenLayers.Control.WMSGetFeatureInfo=OpenLayers.Class(OpenLayers.Control,{hover:!1,drillDown:!1,maxFeatures:10,clickCallback:"click",output:"features",layers:null,queryVisible:!1,url:null,layerUrls:null,infoFormat:"text/html",vendorParams:{},format:null,formatOptions:null,handler:null,hoverRequest:null,initialize:function(a){a=a||{};a.handlerOptions=a.handlerOptions||{};OpenLayers.Control.prototype.initialize.apply(this,[a]);this.format||(this.format=new OpenLayers.Format.WMSGetFeatureInfo(a.formatOptions)); +!0===this.drillDown&&(this.hover=!1);this.hover?this.handler=new OpenLayers.Handler.Hover(this,{move:this.cancelHover,pause:this.getInfoForHover},OpenLayers.Util.extend(this.handlerOptions.hover||{},{delay:250})):(a={},a[this.clickCallback]=this.getInfoForClick,this.handler=new OpenLayers.Handler.Click(this,a,this.handlerOptions.click||{}))},getInfoForClick:function(a){this.events.triggerEvent("beforegetfeatureinfo",{xy:a.xy});OpenLayers.Element.addClass(this.map.viewPortDiv,"olCursorWait");this.request(a.xy, +{})},getInfoForHover:function(a){this.events.triggerEvent("beforegetfeatureinfo",{xy:a.xy});this.request(a.xy,{hover:!0})},cancelHover:function(){this.hoverRequest&&(this.hoverRequest.abort(),this.hoverRequest=null)},findLayers:function(){for(var a=this.layers||this.map.layers,b=[],c,d,e=a.length-1;0<=e;--e)c=a[e],c instanceof OpenLayers.Layer.WMS&&(!this.queryVisible||c.getVisibility())&&(d=OpenLayers.Util.isArray(c.url)?c.url[0]:c.url,!1!==this.drillDown||this.url||(this.url=d),(!0===this.drillDown|| +this.urlMatches(d))&&b.push(c));return b},urlMatches:function(a){var b=OpenLayers.Util.isEquivalentUrl(this.url,a);if(!b&&this.layerUrls)for(var c=0,d=this.layerUrls.length;c<d;++c)if(OpenLayers.Util.isEquivalentUrl(this.layerUrls[c],a)){b=!0;break}return b},buildWMSOptions:function(a,b,c,d){for(var e=[],f=[],g=0,h=b.length;g<h;g++)null!=b[g].params.LAYERS&&(e=e.concat(b[g].params.LAYERS),f=f.concat(this.getStyleNames(b[g])));b=b[0];g=this.map.getProjection();(h=b.projection)&&h.equals(this.map.getProjectionObject())&& +(g=h.getCode());d=OpenLayers.Util.extend({service:"WMS",version:b.params.VERSION,request:"GetFeatureInfo",exceptions:b.params.EXCEPTIONS,bbox:this.map.getExtent().toBBOX(null,b.reverseAxisOrder()),feature_count:this.maxFeatures,height:this.map.getSize().h,width:this.map.getSize().w,format:d,info_format:b.params.INFO_FORMAT||this.infoFormat},1.3<=parseFloat(b.params.VERSION)?{crs:g,i:parseInt(c.x),j:parseInt(c.y)}:{srs:g,x:parseInt(c.x),y:parseInt(c.y)});0!=e.length&&(d=OpenLayers.Util.extend({layers:e, +query_layers:e,styles:f},d));OpenLayers.Util.applyDefaults(d,this.vendorParams);return{url:a,params:OpenLayers.Util.upperCaseObject(d),callback:function(b){this.handleResponse(c,b,a)},scope:this}},getStyleNames:function(a){return a.params.STYLES?a.params.STYLES:OpenLayers.Util.isArray(a.params.LAYERS)?Array(a.params.LAYERS.length):a.params.LAYERS.replace(/[^,]/g,"")},request:function(a,b){var c=this.findLayers();if(0==c.length)this.events.triggerEvent("nogetfeatureinfo"),OpenLayers.Element.removeClass(this.map.viewPortDiv, +"olCursorWait");else if(b=b||{},!1===this.drillDown){var c=this.buildWMSOptions(this.url,c,a,c[0].params.FORMAT),d=OpenLayers.Request.GET(c);!0===b.hover&&(this.hoverRequest=d)}else{this._numRequests=this._requestCount=0;this.features=[];for(var d={},e,f=0,g=c.length;f<g;f++){var h=c[f];e=OpenLayers.Util.isArray(h.url)?h.url[0]:h.url;e in d?d[e].push(h):(this._numRequests++,d[e]=[h])}for(e in d)c=d[e],c=this.buildWMSOptions(e,c,a,c[0].params.FORMAT),OpenLayers.Request.GET(c)}},triggerGetFeatureInfo:function(a, +b,c){this.events.triggerEvent("getfeatureinfo",{text:a.responseText,features:c,request:a,xy:b});OpenLayers.Element.removeClass(this.map.viewPortDiv,"olCursorWait")},handleResponse:function(a,b,c){var d=b.responseXML;d&&d.documentElement||(d=b.responseText);d=this.format.read(d);!1===this.drillDown?this.triggerGetFeatureInfo(b,a,d):(this._requestCount++,this._features="object"===this.output?(this._features||[]).concat({url:c,features:d}):(this._features||[]).concat(d),this._requestCount===this._numRequests&& +(this.triggerGetFeatureInfo(b,a,this._features.concat()),delete this._features,delete this._requestCount,delete this._numRequests))},CLASS_NAME:"OpenLayers.Control.WMSGetFeatureInfo"});OpenLayers.Format.WMSCapabilities.v1_3_0=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_3,{version:"1.3.0",CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_3_0"});OpenLayers.Format.SOSGetFeatureOfInterest=OpenLayers.Class(OpenLayers.Format.XML,{VERSION:"1.0.0",namespaces:{sos:"http://www.opengis.net/sos/1.0",gml:"http://www.opengis.net/gml",sa:"http://www.opengis.net/sampling/1.0",xsi:"http://www.w3.org/2001/XMLSchema-instance"},schemaLocation:"http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosAll.xsd",defaultPrefix:"sos",regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},read:function(a){"string"== +typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={features:[]};this.readNode(a,b);a=[];for(var c=0,d=b.features.length;c<d;c++){var e=b.features[c];this.internalProjection&&(this.externalProjection&&e.components[0])&&e.components[0].transform(this.externalProjection,this.internalProjection);e=new OpenLayers.Feature.Vector(e.components[0],e.attributes);a.push(e)}return a},readers:{sa:{SamplingPoint:function(a,b){if(!b.attributes){var c= +{attributes:{}};b.features.push(c);b=c}b.attributes.id=this.getAttributeNS(a,this.namespaces.gml,"id");this.readChildNodes(a,b)},position:function(a,b){this.readChildNodes(a,b)}},gml:OpenLayers.Util.applyDefaults({FeatureCollection:function(a,b){this.readChildNodes(a,b)},featureMember:function(a,b){var c={attributes:{}};b.features.push(c);this.readChildNodes(a,c)},name:function(a,b){b.attributes.name=this.getChildValue(a)},pos:function(a,b){this.externalProjection||(this.externalProjection=new OpenLayers.Projection(a.getAttribute("srsName"))); +OpenLayers.Format.GML.v3.prototype.readers.gml.pos.apply(this,[a,b])}},OpenLayers.Format.GML.v3.prototype.readers.gml)},writers:{sos:{GetFeatureOfInterest:function(a){for(var b=this.createElementNSPlus("GetFeatureOfInterest",{attributes:{version:this.VERSION,service:"SOS","xsi:schemaLocation":this.schemaLocation}}),c=0,d=a.fois.length;c<d;c++)this.writeNode("FeatureOfInterestId",{foi:a.fois[c]},b);return b},FeatureOfInterestId:function(a){return this.createElementNSPlus("FeatureOfInterestId",{value:a.foi})}}}, +CLASS_NAME:"OpenLayers.Format.SOSGetFeatureOfInterest"});OpenLayers.Format.SOSGetObservation=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{ows:"http://www.opengis.net/ows",gml:"http://www.opengis.net/gml",sos:"http://www.opengis.net/sos/1.0",ogc:"http://www.opengis.net/ogc",om:"http://www.opengis.net/om/1.0",sa:"http://www.opengis.net/sampling/1.0",xlink:"http://www.w3.org/1999/xlink",xsi:"http://www.w3.org/2001/XMLSchema-instance"},regExes:{trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g},VERSION:"1.0.0",schemaLocation:"http://www.opengis.net/sos/1.0 http://schemas.opengis.net/sos/1.0.0/sosGetObservation.xsd", +defaultPrefix:"sos",read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={measurements:[],observations:[]};this.readNode(a,b);return b},write:function(a){a=this.writeNode("sos:GetObservation",a);a.setAttribute("xmlns:om",this.namespaces.om);a.setAttribute("xmlns:ogc",this.namespaces.ogc);this.setAttributeNS(a,this.namespaces.xsi,"xsi:schemaLocation",this.schemaLocation);return OpenLayers.Format.XML.prototype.write.apply(this, +[a])},readers:{om:{ObservationCollection:function(a,b){b.id=this.getAttributeNS(a,this.namespaces.gml,"id");this.readChildNodes(a,b)},member:function(a,b){this.readChildNodes(a,b)},Measurement:function(a,b){var c={};b.measurements.push(c);this.readChildNodes(a,c)},Observation:function(a,b){var c={};b.observations.push(c);this.readChildNodes(a,c)},samplingTime:function(a,b){var c={};b.samplingTime=c;this.readChildNodes(a,c)},observedProperty:function(a,b){b.observedProperty=this.getAttributeNS(a,this.namespaces.xlink, +"href");this.readChildNodes(a,b)},procedure:function(a,b){b.procedure=this.getAttributeNS(a,this.namespaces.xlink,"href");this.readChildNodes(a,b)},featureOfInterest:function(a,b){var c={features:[]};b.fois=[];b.fois.push(c);this.readChildNodes(a,c);for(var d=[],e=0,f=c.features.length;e<f;e++){var g=c.features[e];d.push(new OpenLayers.Feature.Vector(g.components[0],g.attributes))}c.features=d},result:function(a,b){var c={};b.result=c;""!==this.getChildValue(a)?(c.value=this.getChildValue(a),c.uom= +a.getAttribute("uom")):this.readChildNodes(a,c)}},sa:OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.sa,gml:OpenLayers.Util.applyDefaults({TimeInstant:function(a,b){var c={};b.timeInstant=c;this.readChildNodes(a,c)},timePosition:function(a,b){b.timePosition=this.getChildValue(a)}},OpenLayers.Format.SOSGetFeatureOfInterest.prototype.readers.gml)},writers:{sos:{GetObservation:function(a){var b=this.createElementNSPlus("GetObservation",{attributes:{version:this.VERSION,service:"SOS"}});this.writeNode("offering", +a,b);a.eventTime&&this.writeNode("eventTime",a,b);for(var c in a.procedures)this.writeNode("procedure",a.procedures[c],b);for(var d in a.observedProperties)this.writeNode("observedProperty",a.observedProperties[d],b);a.foi&&this.writeNode("featureOfInterest",a.foi,b);this.writeNode("responseFormat",a,b);a.resultModel&&this.writeNode("resultModel",a,b);a.responseMode&&this.writeNode("responseMode",a,b);return b},featureOfInterest:function(a){var b=this.createElementNSPlus("featureOfInterest");this.writeNode("ObjectID", +a.objectId,b);return b},ObjectID:function(a){return this.createElementNSPlus("ObjectID",{value:a})},responseFormat:function(a){return this.createElementNSPlus("responseFormat",{value:a.responseFormat})},procedure:function(a){return this.createElementNSPlus("procedure",{value:a})},offering:function(a){return this.createElementNSPlus("offering",{value:a.offering})},observedProperty:function(a){return this.createElementNSPlus("observedProperty",{value:a})},eventTime:function(a){var b=this.createElementNSPlus("eventTime"); +"latest"===a.eventTime&&this.writeNode("ogc:TM_Equals",a,b);return b},resultModel:function(a){return this.createElementNSPlus("resultModel",{value:a.resultModel})},responseMode:function(a){return this.createElementNSPlus("responseMode",{value:a.responseMode})}},ogc:{TM_Equals:function(a){var b=this.createElementNSPlus("ogc:TM_Equals");this.writeNode("ogc:PropertyName",{property:"urn:ogc:data:time:iso8601"},b);"latest"===a.eventTime&&this.writeNode("gml:TimeInstant",{value:"latest"},b);return b},PropertyName:function(a){return this.createElementNSPlus("ogc:PropertyName", +{value:a.property})}},gml:{TimeInstant:function(a){var b=this.createElementNSPlus("gml:TimeInstant");this.writeNode("gml:timePosition",a,b);return b},timePosition:function(a){return this.createElementNSPlus("gml:timePosition",{value:a.value})}}},CLASS_NAME:"OpenLayers.Format.SOSGetObservation"});OpenLayers.Control.UTFGrid=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,layers:null,defaultHandlerOptions:{delay:300,pixelTolerance:4,stopMove:!1,single:!0,"double":!1,stopSingle:!1,stopDouble:!1},handlerMode:"click",setHandler:function(a){this.handlerMode=a;this.resetHandler()},resetHandler:function(){this.handler&&(this.handler.deactivate(),this.handler.destroy(),this.handler=null);"hover"==this.handlerMode?this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handleEvent,move:this.reset}, +this.handlerOptions):"click"==this.handlerMode?this.handler=new OpenLayers.Handler.Click(this,{click:this.handleEvent},this.handlerOptions):"move"==this.handlerMode&&(this.handler=new OpenLayers.Handler.Hover(this,{pause:this.handleEvent,move:this.handleEvent},this.handlerOptions));return this.handler?!0:!1},initialize:function(a){a=a||{};a.handlerOptions=a.handlerOptions||this.defaultHandlerOptions;OpenLayers.Control.prototype.initialize.apply(this,[a]);this.resetHandler()},handleEvent:function(a){if(null== +a)this.reset();else{var b=this.map.getLonLatFromPixel(a.xy);if(b){var c=this.findLayers();if(0<c.length){for(var d={},e,f,g=0,h=c.length;g<h;g++)e=c[g],f=OpenLayers.Util.indexOf(this.map.layers,e),d[f]=e.getFeatureInfo(b);this.callback(d,b,a.xy)}}}},callback:function(a){},reset:function(a){this.callback(null)},findLayers:function(){for(var a=this.layers||this.map.layers,b=[],c,d=a.length-1;0<=d;--d)c=a[d],c instanceof OpenLayers.Layer.UTFGrid&&b.push(c);return b},CLASS_NAME:"OpenLayers.Control.UTFGrid"});OpenLayers.Format.CQL=function(){function a(a){function b(){var a=e.pop();switch(a.type){case "LOGICAL":var c=b(),g=b();return new OpenLayers.Filter.Logical({filters:[g,c],type:f[a.text.toUpperCase()]});case "NOT":return a=b(),new OpenLayers.Filter.Logical({filters:[a],type:OpenLayers.Filter.Logical.NOT});case "BETWEEN":return e.pop(),g=b(),a=b(),c=b(),new OpenLayers.Filter.Comparison({property:c,lowerBoundary:a,upperBoundary:g,type:OpenLayers.Filter.Comparison.BETWEEN});case "COMPARISON":return g= +b(),c=b(),new OpenLayers.Filter.Comparison({property:c,value:g,type:d[a.text.toUpperCase()]});case "IS_NULL":return c=b(),new OpenLayers.Filter.Comparison({property:c,type:d[a.text.toUpperCase()]});case "VALUE":return(c=a.text.match(/^'(.*)'$/))?c[1].replace(/''/g,"'"):Number(a.text);case "SPATIAL":switch(a.text.toUpperCase()){case "BBOX":var a=b(),c=b(),g=b(),h=b(),k=b();return new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.BBOX,property:k,value:OpenLayers.Bounds.fromArray([h,g,c, +a])});case "INTERSECTS":return g=b(),c=b(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.INTERSECTS,property:c,value:g});case "WITHIN":return g=b(),c=b(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.WITHIN,property:c,value:g});case "CONTAINS":return g=b(),c=b(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.CONTAINS,property:c,value:g});case "DWITHIN":return a=b(),g=b(),c=b(),new OpenLayers.Filter.Spatial({type:OpenLayers.Filter.Spatial.DWITHIN,value:g, +property:c,distance:Number(a)})}case "GEOMETRY":return OpenLayers.Geometry.fromWKT(a.text);default:return a.text}}for(var c=[],e=[];a.length;){var g=a.shift();switch(g.type){case "PROPERTY":case "GEOMETRY":case "VALUE":e.push(g);break;case "COMPARISON":case "BETWEEN":case "IS_NULL":case "LOGICAL":for(var k=h[g.type];0<c.length&&h[c[c.length-1].type]<=k;)e.push(c.pop());c.push(g);break;case "SPATIAL":case "NOT":case "LPAREN":c.push(g);break;case "RPAREN":for(;0<c.length&&"LPAREN"!=c[c.length-1].type;)e.push(c.pop()); +c.pop();0<c.length&&"SPATIAL"==c[c.length-1].type&&e.push(c.pop());case "COMMA":case "END":break;default:throw Error("Unknown token type "+g.type);}}for(;0<c.length;)e.push(c.pop());a=b();if(0<e.length){a="Remaining tokens after building AST: \n";for(c=e.length-1;0<=c;c--)a+=e[c].type+": "+e[c].text+"\n";throw Error(a);}return a}var b={PROPERTY:/^[_a-zA-Z]\w*/,COMPARISON:/^(=|<>|<=|<|>=|>|LIKE)/i,IS_NULL:/^IS NULL/i,COMMA:/^,/,LOGICAL:/^(AND|OR)/i,VALUE:/^('([^']|'')*'|\d+(\.\d*)?|\.\d+)/,LPAREN:/^\(/, +RPAREN:/^\)/,SPATIAL:/^(BBOX|INTERSECTS|DWITHIN|WITHIN|CONTAINS)/i,NOT:/^NOT/i,BETWEEN:/^BETWEEN/i,GEOMETRY:function(a){var b=/^(POINT|LINESTRING|POLYGON|MULTIPOINT|MULTILINESTRING|MULTIPOLYGON|GEOMETRYCOLLECTION)/.exec(a);if(b){var c=a.length,b=a.indexOf("(",b[0].length);if(-1<b)for(var d=1;b<c&&0<d;)switch(b++,a.charAt(b)){case "(":d++;break;case ")":d--}return[a.substr(0,b+1)]}},END:/^$/},c={LPAREN:["GEOMETRY","SPATIAL","PROPERTY","VALUE","LPAREN"],RPAREN:["NOT","LOGICAL","END","RPAREN"],PROPERTY:["COMPARISON", +"BETWEEN","COMMA","IS_NULL"],BETWEEN:["VALUE"],IS_NULL:["END"],COMPARISON:["VALUE"],COMMA:["GEOMETRY","VALUE","PROPERTY"],VALUE:["LOGICAL","COMMA","RPAREN","END"],SPATIAL:["LPAREN"],LOGICAL:["NOT","VALUE","SPATIAL","PROPERTY","LPAREN"],NOT:["PROPERTY","LPAREN"],GEOMETRY:["COMMA","RPAREN"]},d={"=":OpenLayers.Filter.Comparison.EQUAL_TO,"<>":OpenLayers.Filter.Comparison.NOT_EQUAL_TO,"<":OpenLayers.Filter.Comparison.LESS_THAN,"<=":OpenLayers.Filter.Comparison.LESS_THAN_OR_EQUAL_TO,">":OpenLayers.Filter.Comparison.GREATER_THAN, +">=":OpenLayers.Filter.Comparison.GREATER_THAN_OR_EQUAL_TO,LIKE:OpenLayers.Filter.Comparison.LIKE,BETWEEN:OpenLayers.Filter.Comparison.BETWEEN,"IS NULL":OpenLayers.Filter.Comparison.IS_NULL},e={},f={AND:OpenLayers.Filter.Logical.AND,OR:OpenLayers.Filter.Logical.OR},g={},h={RPAREN:3,LOGICAL:2,COMPARISON:1},k;for(k in d)d.hasOwnProperty(k)&&(e[d[k]]=k);for(k in f)f.hasOwnProperty(k)&&(g[f[k]]=k);return OpenLayers.Class(OpenLayers.Format,{read:function(d){var e=d;d=[];var f,g=["NOT","GEOMETRY","SPATIAL", +"PROPERTY","LPAREN"];do{a:{f=g;for(var h=void 0,g=void 0,k=f.length,h=0;h<k;h++){var g=f[h],s=b[g]instanceof RegExp?b[g].exec(e):(0,b[g])(e);if(s){f=s[0];e=e.substr(f.length).replace(/^\s*/,"");f={type:g,text:f,remainder:e};break a}}d="ERROR: In parsing: ["+e+"], expected one of: ";for(h=0;h<k;h++)g=f[h],d+="\n "+g+": "+b[g];throw Error(d);}e=f.remainder;g=c[f.type];if("END"!=f.type&&!g)throw Error("No follows list for "+f.type);d.push(f)}while("END"!=f.type);d=a(d);this.keepData&&(this.data=d); +return d},write:function(a){if(a instanceof OpenLayers.Geometry)return a.toString();switch(a.CLASS_NAME){case "OpenLayers.Filter.Spatial":switch(a.type){case OpenLayers.Filter.Spatial.BBOX:return"BBOX("+a.property+","+a.value.toBBOX()+")";case OpenLayers.Filter.Spatial.DWITHIN:return"DWITHIN("+a.property+", "+this.write(a.value)+", "+a.distance+")";case OpenLayers.Filter.Spatial.WITHIN:return"WITHIN("+a.property+", "+this.write(a.value)+")";case OpenLayers.Filter.Spatial.INTERSECTS:return"INTERSECTS("+ +a.property+", "+this.write(a.value)+")";case OpenLayers.Filter.Spatial.CONTAINS:return"CONTAINS("+a.property+", "+this.write(a.value)+")";default:throw Error("Unknown spatial filter type: "+a.type);}case "OpenLayers.Filter.Logical":if(a.type==OpenLayers.Filter.Logical.NOT)return"NOT ("+this.write(a.filters[0])+")";for(var b="(",c=!0,d=0;d<a.filters.length;d++)c?c=!1:b+=") "+g[a.type]+" (",b+=this.write(a.filters[d]);return b+")";case "OpenLayers.Filter.Comparison":return a.type==OpenLayers.Filter.Comparison.BETWEEN? +a.property+" BETWEEN "+this.write(a.lowerBoundary)+" AND "+this.write(a.upperBoundary):null!==a.value?a.property+" "+e[a.type]+" "+this.write(a.value):a.property+" "+e[a.type];case void 0:if("string"===typeof a)return"'"+a.replace(/'/g,"''")+"'";if("number"===typeof a)return String(a);default:throw Error("Can't encode: "+a.CLASS_NAME+" "+a);}},CLASS_NAME:"OpenLayers.Format.CQL"})}();OpenLayers.Control.Split=OpenLayers.Class(OpenLayers.Control,{layer:null,source:null,sourceOptions:null,tolerance:null,edge:!0,deferDelete:!1,mutual:!0,targetFilter:null,sourceFilter:null,handler:null,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,[a]);this.options=a||{};this.options.source&&this.setSource(this.options.source)},setSource:function(a){this.active?(this.deactivate(),this.handler&&(this.handler.destroy(),delete this.handler),this.source=a,this.activate()):this.source= +a},activate:function(){var a=OpenLayers.Control.prototype.activate.call(this);if(a)if(!this.source)this.handler||(this.handler=new OpenLayers.Handler.Path(this,{done:function(a){this.onSketchComplete({feature:new OpenLayers.Feature.Vector(a)})}},{layerOptions:this.sourceOptions})),this.handler.activate();else if(this.source.events)this.source.events.on({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this});return a},deactivate:function(){var a=OpenLayers.Control.prototype.deactivate.call(this); +a&&this.source&&this.source.events&&this.source.events.un({sketchcomplete:this.onSketchComplete,afterfeaturemodified:this.afterFeatureModified,scope:this});return a},onSketchComplete:function(a){this.feature=null;return!this.considerSplit(a.feature)},afterFeatureModified:function(a){a.modified&&"function"===typeof a.feature.geometry.split&&(this.feature=a.feature,this.considerSplit(a.feature))},removeByGeometry:function(a,b){for(var c=0,d=a.length;c<d;++c)if(a[c].geometry===b){a.splice(c,1);break}}, +isEligible:function(a){return a.geometry?a.state!==OpenLayers.State.DELETE&&"function"===typeof a.geometry.split&&this.feature!==a&&(!this.targetFilter||this.targetFilter.evaluate(a.attributes)):!1},considerSplit:function(a){var b=!1,c=!1;if(!this.sourceFilter||this.sourceFilter.evaluate(a.attributes)){for(var d=this.layer&&this.layer.features||[],e,f,g=[],h=[],k=this.layer===this.source&&this.mutual,l={edge:this.edge,tolerance:this.tolerance,mutual:k},m=[a.geometry],n,p,q,r=0,s=d.length;r<s;++r)if(n= +d[r],this.isEligible(n)){p=[n.geometry];for(var t=0;t<m.length;++t){q=m[t];for(var u=0;u<p.length;++u)if(e=p[u],q.getBounds().intersectsBounds(e.getBounds())&&(e=q.split(e,l)))f=this.events.triggerEvent("beforesplit",{source:a,target:n}),!1!==f&&(k&&(f=e[0],1<f.length&&(f.unshift(t,1),Array.prototype.splice.apply(m,f),t+=f.length-3),e=e[1]),1<e.length&&(e.unshift(u,1),Array.prototype.splice.apply(p,e),u+=e.length-3))}p&&1<p.length&&(this.geomsToFeatures(n,p),this.events.triggerEvent("split",{original:n, +features:p}),Array.prototype.push.apply(g,p),h.push(n),c=!0)}m&&1<m.length&&(this.geomsToFeatures(a,m),this.events.triggerEvent("split",{original:a,features:m}),Array.prototype.push.apply(g,m),h.push(a),b=!0);if(b||c){if(this.deferDelete){d=[];r=0;for(s=h.length;r<s;++r)c=h[r],c.state===OpenLayers.State.INSERT?d.push(c):(c.state=OpenLayers.State.DELETE,this.layer.drawFeature(c));this.layer.destroyFeatures(d,{silent:!0});r=0;for(s=g.length;r<s;++r)g[r].state=OpenLayers.State.INSERT}else this.layer.destroyFeatures(h, +{silent:!0});this.layer.addFeatures(g,{silent:!0});this.events.triggerEvent("aftersplit",{source:a,features:g})}}return b},geomsToFeatures:function(a,b){var c=a.clone();delete c.geometry;for(var d,e=0,f=b.length;e<f;++e)d=c.clone(),d.geometry=b[e],d.state=OpenLayers.State.INSERT,b[e]=d},destroy:function(){this.active&&this.deactivate();OpenLayers.Control.prototype.destroy.call(this)},CLASS_NAME:"OpenLayers.Control.Split"});OpenLayers.Layer.WMTS=OpenLayers.Class(OpenLayers.Layer.Grid,{isBaseLayer:!0,version:"1.0.0",requestEncoding:"KVP",url:null,layer:null,matrixSet:null,style:null,format:"image/jpeg",tileOrigin:null,tileFullExtent:null,formatSuffix:null,matrixIds:null,dimensions:null,params:null,zoomOffset:0,serverResolutions:null,formatSuffixMap:{"image/png":"png","image/png8":"png","image/png24":"png","image/png32":"png",png:"png","image/jpeg":"jpg","image/jpg":"jpg",jpeg:"jpg",jpg:"jpg"},matrix:null,initialize:function(a){var b= +{url:!0,layer:!0,style:!0,matrixSet:!0},c;for(c in b)if(!(c in a))throw Error("Missing property '"+c+"' in layer configuration.");a.params=OpenLayers.Util.upperCaseObject(a.params);OpenLayers.Layer.Grid.prototype.initialize.apply(this,[a.name,a.url,a.params,a]);this.formatSuffix||(this.formatSuffix=this.formatSuffixMap[this.format]||this.format.split("/").pop());if(this.matrixIds&&(a=this.matrixIds.length)&&"string"===typeof this.matrixIds[0])for(b=this.matrixIds,this.matrixIds=Array(a),c=0;c<a;++c)this.matrixIds[c]= +{identifier:b[c]}},setMap:function(){OpenLayers.Layer.Grid.prototype.setMap.apply(this,arguments)},updateMatrixProperties:function(){if(this.matrix=this.getMatrix())this.matrix.topLeftCorner&&(this.tileOrigin=this.matrix.topLeftCorner),this.matrix.tileWidth&&this.matrix.tileHeight&&(this.tileSize=new OpenLayers.Size(this.matrix.tileWidth,this.matrix.tileHeight)),this.tileOrigin||(this.tileOrigin=new OpenLayers.LonLat(this.maxExtent.left,this.maxExtent.top)),this.tileFullExtent||(this.tileFullExtent= +this.maxExtent)},moveTo:function(a,b,c){!b&&this.matrix||this.updateMatrixProperties();return OpenLayers.Layer.Grid.prototype.moveTo.apply(this,arguments)},clone:function(a){null==a&&(a=new OpenLayers.Layer.WMTS(this.options));return a=OpenLayers.Layer.Grid.prototype.clone.apply(this,[a])},getIdentifier:function(){return this.getServerZoom()},getMatrix:function(){var a;if(this.matrixIds&&0!==this.matrixIds.length)if("scaleDenominator"in this.matrixIds[0])for(var b=OpenLayers.METERS_PER_INCH*OpenLayers.INCHES_PER_UNIT[this.units]* +this.getServerResolution()/2.8E-4,c=Number.POSITIVE_INFINITY,d,e=0,f=this.matrixIds.length;e<f;++e)d=Math.abs(1-this.matrixIds[e].scaleDenominator/b),d<c&&(c=d,a=this.matrixIds[e]);else a=this.matrixIds[this.getIdentifier()];else a={identifier:this.getIdentifier()};return a},getTileInfo:function(a){var b=this.getServerResolution(),c=(a.lon-this.tileOrigin.lon)/(b*this.tileSize.w);a=(this.tileOrigin.lat-a.lat)/(b*this.tileSize.h);var b=Math.floor(c),d=Math.floor(a);return{col:b,row:d,i:Math.floor((c- +b)*this.tileSize.w),j:Math.floor((a-d)*this.tileSize.h)}},getURL:function(a){a=this.adjustBounds(a);var b="";if(!this.tileFullExtent||this.tileFullExtent.intersectsBounds(a)){a=a.getCenterLonLat();var c=this.getTileInfo(a);a=this.dimensions;var d,b=OpenLayers.Util.isArray(this.url)?this.selectUrl([this.version,this.style,this.matrixSet,this.matrix.identifier,c.row,c.col].join(),this.url):this.url;if("REST"===this.requestEncoding.toUpperCase())if(d=this.params,-1!==b.indexOf("{")){b=b.replace(/\{/g, +"${");c={style:this.style,Style:this.style,TileMatrixSet:this.matrixSet,TileMatrix:this.matrix.identifier,TileRow:c.row,TileCol:c.col};if(a){var e,f;for(f=a.length-1;0<=f;--f)e=a[f],c[e]=d[e.toUpperCase()]}b=OpenLayers.String.format(b,c)}else{e=this.version+"/"+this.layer+"/"+this.style+"/";if(a)for(f=0;f<a.length;f++)d[a[f]]&&(e=e+d[a[f]]+"/");e=e+this.matrixSet+"/"+this.matrix.identifier+"/"+c.row+"/"+c.col+"."+this.formatSuffix;b.match(/\/$/)||(b+="/");b+=e}else"KVP"===this.requestEncoding.toUpperCase()&& +(d={SERVICE:"WMTS",REQUEST:"GetTile",VERSION:this.version,LAYER:this.layer,STYLE:this.style,TILEMATRIXSET:this.matrixSet,TILEMATRIX:this.matrix.identifier,TILEROW:c.row,TILECOL:c.col,FORMAT:this.format},b=OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(this,[d]))}return b},mergeNewParams:function(a){if("KVP"===this.requestEncoding.toUpperCase())return OpenLayers.Layer.Grid.prototype.mergeNewParams.apply(this,[OpenLayers.Util.upperCaseObject(a)])},CLASS_NAME:"OpenLayers.Layer.WMTS"});OpenLayers.Protocol.SOS.v1_0_0=OpenLayers.Class(OpenLayers.Protocol,{fois:null,formatOptions:null,initialize:function(a){OpenLayers.Protocol.prototype.initialize.apply(this,[a]);a.format||(this.format=new OpenLayers.Format.SOSGetFeatureOfInterest(this.formatOptions))},destroy:function(){this.options&&!this.options.format&&this.format.destroy();this.format=null;OpenLayers.Protocol.prototype.destroy.apply(this)},read:function(a){a=OpenLayers.Util.extend({},a);OpenLayers.Util.applyDefaults(a,this.options|| +{});var b=new OpenLayers.Protocol.Response({requestType:"read"}),c=this.format,c=OpenLayers.Format.XML.prototype.write.apply(c,[c.writeNode("sos:GetFeatureOfInterest",{fois:this.fois})]);b.priv=OpenLayers.Request.POST({url:a.url,callback:this.createCallback(this.handleRead,b,a),data:c});return b},handleRead:function(a,b){if(b.callback){var c=a.priv;200<=c.status&&300>c.status?(a.features=this.parseFeatures(c),a.code=OpenLayers.Protocol.Response.SUCCESS):a.code=OpenLayers.Protocol.Response.FAILURE; +b.callback.call(b.scope,a)}},parseFeatures:function(a){var b=a.responseXML;b&&b.documentElement||(b=a.responseText);return!b||0>=b.length?null:this.format.read(b)},CLASS_NAME:"OpenLayers.Protocol.SOS.v1_0_0"});OpenLayers.Layer.KaMapCache=OpenLayers.Class(OpenLayers.Layer.KaMap,{IMAGE_EXTENSIONS:{jpeg:"jpg",gif:"gif",png:"png",png8:"png",png24:"png",dithered:"png"},DEFAULT_FORMAT:"jpeg",initialize:function(a,b,c,d){OpenLayers.Layer.KaMap.prototype.initialize.apply(this,arguments);this.extension=this.IMAGE_EXTENSIONS[this.params.i.toLowerCase()||this.DEFAULT_FORMAT]},getURL:function(a){a=this.adjustBounds(a);var b=this.map.getResolution(),c=Math.round(1E4*this.map.getScale())/1E4,d=Math.round(a.left/b);a= +-Math.round(a.top/b);var b=Math.floor(d/this.tileSize.w/this.params.metaTileSize.w)*this.tileSize.w*this.params.metaTileSize.w,e=Math.floor(a/this.tileSize.h/this.params.metaTileSize.h)*this.tileSize.h*this.params.metaTileSize.h,c=["/",this.params.map,"/",c,"/",this.params.g.replace(/\s/g,"_"),"/def/t",e,"/l",b,"/t",a,"l",d,".",this.extension],d=this.url;OpenLayers.Util.isArray(d)&&(d=this.selectUrl(c.join(""),d));return d+c.join("")},CLASS_NAME:"OpenLayers.Layer.KaMapCache"});OpenLayers.Protocol.WFS.v1_1_0=OpenLayers.Class(OpenLayers.Protocol.WFS.v1,{version:"1.1.0",initialize:function(a){OpenLayers.Protocol.WFS.v1.prototype.initialize.apply(this,arguments);this.outputFormat&&!this.readFormat&&("gml2"==this.outputFormat.toLowerCase()?this.readFormat=new OpenLayers.Format.GML.v2({featureType:this.featureType,featureNS:this.featureNS,geometryName:this.geometryName}):"json"==this.outputFormat.toLowerCase()&&(this.readFormat=new OpenLayers.Format.GeoJSON))},CLASS_NAME:"OpenLayers.Protocol.WFS.v1_1_0"});OpenLayers.Format.WMSCapabilities.v1_1_1=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1,{version:"1.1.1",readers:{wms:OpenLayers.Util.applyDefaults({SRS:function(a,b){b.srs[this.getChildValue(a)]=!0}},OpenLayers.Format.WMSCapabilities.v1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1"});OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC=OpenLayers.Class(OpenLayers.Format.WMSCapabilities.v1_1_1,{version:"1.1.1",profile:"WMSC",readers:{wms:OpenLayers.Util.applyDefaults({VendorSpecificCapabilities:function(a,b){b.vendorSpecific={tileSets:[]};this.readChildNodes(a,b.vendorSpecific)},TileSet:function(a,b){var c={srs:{},bbox:{},resolutions:[]};this.readChildNodes(a,c);b.tileSets.push(c)},Resolutions:function(a,b){for(var c=this.getChildValue(a).split(" "),d=0,e=c.length;d<e;d++)""!=c[d]&&b.resolutions.push(parseFloat(c[d]))}, +Width:function(a,b){b.width=parseInt(this.getChildValue(a))},Height:function(a,b){b.height=parseInt(this.getChildValue(a))},Layers:function(a,b){b.layers=this.getChildValue(a)},Styles:function(a,b){b.styles=this.getChildValue(a)}},OpenLayers.Format.WMSCapabilities.v1_1_1.prototype.readers.wms)},CLASS_NAME:"OpenLayers.Format.WMSCapabilities.v1_1_1_WMSC"});OpenLayers.Control.LayerSwitcher=OpenLayers.Class(OpenLayers.Control,{layerStates:null,layersDiv:null,baseLayersDiv:null,baseLayers:null,dataLbl:null,dataLayersDiv:null,dataLayers:null,minimizeDiv:null,maximizeDiv:null,ascending:!0,initialize:function(a){OpenLayers.Control.prototype.initialize.apply(this,arguments);this.layerStates=[]},destroy:function(){this.clearLayersArray("base");this.clearLayersArray("data");this.map.events.un({buttonclick:this.onButtonClick,addlayer:this.redraw,changelayer:this.redraw, +removelayer:this.redraw,changebaselayer:this.redraw,scope:this});this.events.unregister("buttonclick",this,this.onButtonClick);OpenLayers.Control.prototype.destroy.apply(this,arguments)},setMap:function(a){OpenLayers.Control.prototype.setMap.apply(this,arguments);this.map.events.on({addlayer:this.redraw,changelayer:this.redraw,removelayer:this.redraw,changebaselayer:this.redraw,scope:this});this.outsideViewport?(this.events.attachToElement(this.div),this.events.register("buttonclick",this,this.onButtonClick)): +this.map.events.register("buttonclick",this,this.onButtonClick)},draw:function(){OpenLayers.Control.prototype.draw.apply(this);this.loadContents();this.outsideViewport||this.minimizeControl();this.redraw();return this.div},onButtonClick:function(a){a=a.buttonElement;a===this.minimizeDiv?this.minimizeControl():a===this.maximizeDiv?this.maximizeControl():a._layerSwitcher===this.id&&(a["for"]&&(a=document.getElementById(a["for"])),a.disabled||("radio"==a.type?(a.checked=!0,this.map.setBaseLayer(this.map.getLayer(a._layer))): +(a.checked=!a.checked,this.updateMap())))},clearLayersArray:function(a){this[a+"LayersDiv"].innerHTML="";this[a+"Layers"]=[]},checkRedraw:function(){if(!this.layerStates.length||this.map.layers.length!=this.layerStates.length)return!0;for(var a=0,b=this.layerStates.length;a<b;a++){var c=this.layerStates[a],d=this.map.layers[a];if(c.name!=d.name||c.inRange!=d.inRange||c.id!=d.id||c.visibility!=d.visibility)return!0}return!1},redraw:function(){if(!this.checkRedraw())return this.div;this.clearLayersArray("base"); +this.clearLayersArray("data");var a=!1,b=!1,c=this.map.layers.length;this.layerStates=Array(c);for(var d=0;d<c;d++){var e=this.map.layers[d];this.layerStates[d]={name:e.name,visibility:e.visibility,inRange:e.inRange,id:e.id}}var f=this.map.layers.slice();this.ascending||f.reverse();d=0;for(c=f.length;d<c;d++){var e=f[d],g=e.isBaseLayer;if(e.displayInLayerSwitcher){g?b=!0:a=!0;var h=g?e==this.map.baseLayer:e.getVisibility(),k=document.createElement("input"),l=OpenLayers.Util.createUniqueID(this.id+ +"_input_");k.id=l;k.name=g?this.id+"_baseLayers":e.name;k.type=g?"radio":"checkbox";k.value=e.name;k.checked=h;k.defaultChecked=h;k.className="olButton";k._layer=e.id;k._layerSwitcher=this.id;g||e.inRange||(k.disabled=!0);h=document.createElement("label");h["for"]=k.id;OpenLayers.Element.addClass(h,"labelSpan olButton");h._layer=e.id;h._layerSwitcher=this.id;g||e.inRange||(h.style.color="gray");h.innerHTML=e.name;h.style.verticalAlign=g?"bottom":"baseline";l=document.createElement("br");(g?this.baseLayers: +this.dataLayers).push({layer:e,inputElem:k,labelSpan:h});e=g?this.baseLayersDiv:this.dataLayersDiv;e.appendChild(k);e.appendChild(h);e.appendChild(l)}}this.dataLbl.style.display=a?"":"none";this.baseLbl.style.display=b?"":"none";return this.div},updateMap:function(){for(var a=0,b=this.baseLayers.length;a<b;a++){var c=this.baseLayers[a];c.inputElem.checked&&this.map.setBaseLayer(c.layer,!1)}a=0;for(b=this.dataLayers.length;a<b;a++)c=this.dataLayers[a],c.layer.setVisibility(c.inputElem.checked)},maximizeControl:function(a){this.div.style.width= +"";this.div.style.height="";this.showControls(!1);null!=a&&OpenLayers.Event.stop(a)},minimizeControl:function(a){this.div.style.width="0px";this.div.style.height="0px";this.showControls(!0);null!=a&&OpenLayers.Event.stop(a)},showControls:function(a){this.maximizeDiv.style.display=a?"":"none";this.minimizeDiv.style.display=a?"none":"";this.layersDiv.style.display=a?"none":""},loadContents:function(){this.layersDiv=document.createElement("div");this.layersDiv.id=this.id+"_layersDiv";OpenLayers.Element.addClass(this.layersDiv, +"layersDiv");this.baseLbl=document.createElement("div");this.baseLbl.innerHTML=OpenLayers.i18n("Base Layer");OpenLayers.Element.addClass(this.baseLbl,"baseLbl");this.baseLayersDiv=document.createElement("div");OpenLayers.Element.addClass(this.baseLayersDiv,"baseLayersDiv");this.dataLbl=document.createElement("div");this.dataLbl.innerHTML=OpenLayers.i18n("Overlays");OpenLayers.Element.addClass(this.dataLbl,"dataLbl");this.dataLayersDiv=document.createElement("div");OpenLayers.Element.addClass(this.dataLayersDiv, +"dataLayersDiv");this.ascending?(this.layersDiv.appendChild(this.baseLbl),this.layersDiv.appendChild(this.baseLayersDiv),this.layersDiv.appendChild(this.dataLbl),this.layersDiv.appendChild(this.dataLayersDiv)):(this.layersDiv.appendChild(this.dataLbl),this.layersDiv.appendChild(this.dataLayersDiv),this.layersDiv.appendChild(this.baseLbl),this.layersDiv.appendChild(this.baseLayersDiv));this.div.appendChild(this.layersDiv);var a=OpenLayers.Util.getImageLocation("layer-switcher-maximize.png");this.maximizeDiv= +OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MaximizeDiv",null,null,a,"absolute");OpenLayers.Element.addClass(this.maximizeDiv,"maximizeDiv olButton");this.maximizeDiv.style.display="none";this.div.appendChild(this.maximizeDiv);a=OpenLayers.Util.getImageLocation("layer-switcher-minimize.png");this.minimizeDiv=OpenLayers.Util.createAlphaImageDiv("OpenLayers_Control_MinimizeDiv",null,null,a,"absolute");OpenLayers.Element.addClass(this.minimizeDiv,"minimizeDiv olButton");this.minimizeDiv.style.display= +"none";this.div.appendChild(this.minimizeDiv)},CLASS_NAME:"OpenLayers.Control.LayerSwitcher"});OpenLayers.Format.Atom=OpenLayers.Class(OpenLayers.Format.XML,{namespaces:{atom:"http://www.w3.org/2005/Atom",georss:"http://www.georss.org/georss"},feedTitle:"untitled",defaultEntryTitle:"untitled",gmlParser:null,xy:!1,read:function(a){"string"==typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));return this.parseFeatures(a)},write:function(a){var b;if(OpenLayers.Util.isArray(a)){b=this.createElementNSPlus("atom:feed");b.appendChild(this.createElementNSPlus("atom:title",{value:this.feedTitle})); +for(var c=0,d=a.length;c<d;c++)b.appendChild(this.buildEntryNode(a[c]))}else b=this.buildEntryNode(a);return OpenLayers.Format.XML.prototype.write.apply(this,[b])},buildContentNode:function(a){var b=this.createElementNSPlus("atom:content",{attributes:{type:a.type||null}});if(a.src)b.setAttribute("src",a.src);else if("text"==a.type||null==a.type)b.appendChild(this.createTextNode(a.value));else if("html"==a.type){if("string"!=typeof a.value)throw"HTML content must be in form of an escaped string";b.appendChild(this.createTextNode(a.value))}else"xhtml"== +a.type?b.appendChild(a.value):"xhtml"==a.type||a.type.match(/(\+|\/)xml$/)?b.appendChild(a.value):b.appendChild(this.createTextNode(a.value));return b},buildEntryNode:function(a){var b=a.attributes,c=b.atom||{},d=this.createElementNSPlus("atom:entry");if(c.authors)for(var e=OpenLayers.Util.isArray(c.authors)?c.authors:[c.authors],f=0,g=e.length;f<g;f++)d.appendChild(this.buildPersonConstructNode("author",e[f]));if(c.categories)for(var e=OpenLayers.Util.isArray(c.categories)?c.categories:[c.categories], +h,f=0,g=e.length;f<g;f++)h=e[f],d.appendChild(this.createElementNSPlus("atom:category",{attributes:{term:h.term,scheme:h.scheme||null,label:h.label||null}}));c.content&&d.appendChild(this.buildContentNode(c.content));if(c.contributors)for(e=OpenLayers.Util.isArray(c.contributors)?c.contributors:[c.contributors],f=0,g=e.length;f<g;f++)d.appendChild(this.buildPersonConstructNode("contributor",e[f]));a.fid&&d.appendChild(this.createElementNSPlus("atom:id",{value:a.fid}));if(c.links)for(e=OpenLayers.Util.isArray(c.links)? +c.links:[c.links],f=0,g=e.length;f<g;f++)h=e[f],d.appendChild(this.createElementNSPlus("atom:link",{attributes:{href:h.href,rel:h.rel||null,type:h.type||null,hreflang:h.hreflang||null,title:h.title||null,length:h.length||null}}));c.published&&d.appendChild(this.createElementNSPlus("atom:published",{value:c.published}));c.rights&&d.appendChild(this.createElementNSPlus("atom:rights",{value:c.rights}));(c.summary||b.description)&&d.appendChild(this.createElementNSPlus("atom:summary",{value:c.summary|| +b.description}));d.appendChild(this.createElementNSPlus("atom:title",{value:c.title||b.title||this.defaultEntryTitle}));c.updated&&d.appendChild(this.createElementNSPlus("atom:updated",{value:c.updated}));a.geometry&&(b=this.createElementNSPlus("georss:where"),b.appendChild(this.buildGeometryNode(a.geometry)),d.appendChild(b));return d},initGmlParser:function(){this.gmlParser=new OpenLayers.Format.GML.v3({xy:this.xy,featureNS:"http://example.com#feature",internalProjection:this.internalProjection, +externalProjection:this.externalProjection})},buildGeometryNode:function(a){this.gmlParser||this.initGmlParser();return this.gmlParser.writeNode("feature:_geometry",a).firstChild},buildPersonConstructNode:function(a,b){var c=["uri","email"],d=this.createElementNSPlus("atom:"+a);d.appendChild(this.createElementNSPlus("atom:name",{value:b.name}));for(var e=0,f=c.length;e<f;e++)b[c[e]]&&d.appendChild(this.createElementNSPlus("atom:"+c[e],{value:b[c[e]]}));return d},getFirstChildValue:function(a,b,c, +d){return(a=this.getElementsByTagNameNS(a,b,c))&&0<a.length?this.getChildValue(a[0],d):d},parseFeature:function(a){var b={},c=null,d=null,e=null,f=this.namespaces.atom;this.parsePersonConstructs(a,"author",b);d=this.getElementsByTagNameNS(a,f,"category");0<d.length&&(b.categories=[]);for(var g=0,h=d.length;g<h;g++){c={};c.term=d[g].getAttribute("term");if(e=d[g].getAttribute("scheme"))c.scheme=e;if(e=d[g].getAttribute("label"))c.label=e;b.categories.push(c)}d=this.getElementsByTagNameNS(a,f,"content"); +if(0<d.length){c={};if(e=d[0].getAttribute("type"))c.type=e;(e=d[0].getAttribute("src"))?c.src=e:("text"==c.type||"html"==c.type||null==c.type?c.value=this.getFirstChildValue(a,f,"content",null):"xhtml"==c.type||c.type.match(/(\+|\/)xml$/)?c.value=this.getChildEl(d[0]):c.value=this.getFirstChildValue(a,f,"content",null),b.content=c)}this.parsePersonConstructs(a,"contributor",b);b.id=this.getFirstChildValue(a,f,"id",null);d=this.getElementsByTagNameNS(a,f,"link");0<d.length&&(b.links=Array(d.length)); +for(var k=["rel","type","hreflang","title","length"],g=0,h=d.length;g<h;g++){c={};c.href=d[g].getAttribute("href");for(var l=0,m=k.length;l<m;l++)(e=d[g].getAttribute(k[l]))&&(c[k[l]]=e);b.links[g]=c}if(c=this.getFirstChildValue(a,f,"published",null))b.published=c;if(c=this.getFirstChildValue(a,f,"rights",null))b.rights=c;if(c=this.getFirstChildValue(a,f,"summary",null))b.summary=c;b.title=this.getFirstChildValue(a,f,"title",null);b.updated=this.getFirstChildValue(a,f,"updated",null);c={title:b.title, +description:b.summary,atom:b};a=this.parseLocations(a)[0];a=new OpenLayers.Feature.Vector(a,c);a.fid=b.id;return a},parseFeatures:function(a){var b=[],c=this.getElementsByTagNameNS(a,this.namespaces.atom,"entry");0==c.length&&(c=[a]);a=0;for(var d=c.length;a<d;a++)b.push(this.parseFeature(c[a]));return b},parseLocations:function(a){var b=this.namespaces.georss,c={components:[]},d=this.getElementsByTagNameNS(a,b,"where");if(d&&0<d.length){this.gmlParser||this.initGmlParser();for(var e=0,f=d.length;e< +f;e++)this.gmlParser.readChildNodes(d[e],c)}c=c.components;if((d=this.getElementsByTagNameNS(a,b,"point"))&&0<d.length)for(e=0,f=d.length;e<f;e++){var g=OpenLayers.String.trim(d[e].firstChild.nodeValue).split(/\s+/);2!=g.length&&(g=OpenLayers.String.trim(d[e].firstChild.nodeValue).split(/\s*,\s*/));c.push(new OpenLayers.Geometry.Point(g[1],g[0]))}var h=this.getElementsByTagNameNS(a,b,"line");if(h&&0<h.length)for(var k,e=0,f=h.length;e<f;e++){d=OpenLayers.String.trim(h[e].firstChild.nodeValue).split(/\s+/); +k=[];for(var l=0,m=d.length;l<m;l+=2)g=new OpenLayers.Geometry.Point(d[l+1],d[l]),k.push(g);c.push(new OpenLayers.Geometry.LineString(k))}if((a=this.getElementsByTagNameNS(a,b,"polygon"))&&0<a.length)for(e=0,f=a.length;e<f;e++){d=OpenLayers.String.trim(a[e].firstChild.nodeValue).split(/\s+/);k=[];l=0;for(m=d.length;l<m;l+=2)g=new OpenLayers.Geometry.Point(d[l+1],d[l]),k.push(g);c.push(new OpenLayers.Geometry.Polygon([new OpenLayers.Geometry.LinearRing(k)]))}if(this.internalProjection&&this.externalProjection)for(e= +0,f=c.length;e<f;e++)c[e]&&c[e].transform(this.externalProjection,this.internalProjection);return c},parsePersonConstructs:function(a,b,c){var d=[],e=this.namespaces.atom;a=this.getElementsByTagNameNS(a,e,b);for(var f=["uri","email"],g=0,h=a.length;g<h;g++){var k={};k.name=this.getFirstChildValue(a[g],e,"name",null);for(var l=0,m=f.length;l<m;l++){var n=this.getFirstChildValue(a[g],e,f[l],null);n&&(k[f[l]]=n)}d.push(k)}0<d.length&&(c[b+"s"]=d)},CLASS_NAME:"OpenLayers.Format.Atom"});OpenLayers.Control.KeyboardDefaults=OpenLayers.Class(OpenLayers.Control,{autoActivate:!0,slideFactor:75,observeElement:null,draw:function(){this.handler=new OpenLayers.Handler.Keyboard(this,{keydown:this.defaultKeyPress},{observeElement:this.observeElement||document})},defaultKeyPress:function(a){var b,c=!0;b=OpenLayers.Event.element(a);if(!b||"INPUT"!=b.tagName&&"TEXTAREA"!=b.tagName&&"SELECT"!=b.tagName){switch(a.keyCode){case OpenLayers.Event.KEY_LEFT:this.map.pan(-this.slideFactor,0);break;case OpenLayers.Event.KEY_RIGHT:this.map.pan(this.slideFactor, +0);break;case OpenLayers.Event.KEY_UP:this.map.pan(0,-this.slideFactor);break;case OpenLayers.Event.KEY_DOWN:this.map.pan(0,this.slideFactor);break;case 33:b=this.map.getSize();this.map.pan(0,-0.75*b.h);break;case 34:b=this.map.getSize();this.map.pan(0,0.75*b.h);break;case 35:b=this.map.getSize();this.map.pan(0.75*b.w,0);break;case 36:b=this.map.getSize();this.map.pan(-0.75*b.w,0);break;case 43:case 61:case 187:case 107:this.map.zoomIn();break;case 45:case 109:case 189:case 95:this.map.zoomOut(); +break;default:c=!1}c&&OpenLayers.Event.stop(a)}},CLASS_NAME:"OpenLayers.Control.KeyboardDefaults"});OpenLayers.Format.WMTSCapabilities.v1_0_0=OpenLayers.Class(OpenLayers.Format.OWSCommon.v1_1_0,{version:"1.0.0",namespaces:{ows:"http://www.opengis.net/ows/1.1",wmts:"http://www.opengis.net/wmts/1.0",xlink:"http://www.w3.org/1999/xlink"},yx:null,defaultPrefix:"wmts",initialize:function(a){OpenLayers.Format.XML.prototype.initialize.apply(this,[a]);this.options=a;a=OpenLayers.Util.extend({},OpenLayers.Format.WMTSCapabilities.prototype.yx);this.yx=OpenLayers.Util.extend(a,this.yx)},read:function(a){"string"== +typeof a&&(a=OpenLayers.Format.XML.prototype.read.apply(this,[a]));a&&9==a.nodeType&&(a=a.documentElement);var b={};this.readNode(a,b);b.version=this.version;return b},readers:{wmts:{Capabilities:function(a,b){this.readChildNodes(a,b)},Contents:function(a,b){b.contents={};b.contents.layers=[];b.contents.tileMatrixSets={};this.readChildNodes(a,b.contents)},Layer:function(a,b){var c={styles:[],formats:[],dimensions:[],tileMatrixSetLinks:[],layers:[]};this.readChildNodes(a,c);b.layers.push(c)},Style:function(a, +b){var c={};c.isDefault="true"===a.getAttribute("isDefault");this.readChildNodes(a,c);b.styles.push(c)},Format:function(a,b){b.formats.push(this.getChildValue(a))},TileMatrixSetLink:function(a,b){var c={};this.readChildNodes(a,c);b.tileMatrixSetLinks.push(c)},TileMatrixSet:function(a,b){if(b.layers){var c={matrixIds:[]};this.readChildNodes(a,c);b.tileMatrixSets[c.identifier]=c}else b.tileMatrixSet=this.getChildValue(a)},TileMatrix:function(a,b){var c={supportedCRS:b.supportedCRS};this.readChildNodes(a, +c);b.matrixIds.push(c)},ScaleDenominator:function(a,b){b.scaleDenominator=parseFloat(this.getChildValue(a))},TopLeftCorner:function(a,b){var c=this.getChildValue(a).split(" "),d;b.supportedCRS&&(d=b.supportedCRS.replace(/urn:ogc:def:crs:(\w+):.+:(\w+)$/,"urn:ogc:def:crs:$1::$2"),d=!!this.yx[d]);b.topLeftCorner=d?new OpenLayers.LonLat(c[1],c[0]):new OpenLayers.LonLat(c[0],c[1])},TileWidth:function(a,b){b.tileWidth=parseInt(this.getChildValue(a))},TileHeight:function(a,b){b.tileHeight=parseInt(this.getChildValue(a))}, +MatrixWidth:function(a,b){b.matrixWidth=parseInt(this.getChildValue(a))},MatrixHeight:function(a,b){b.matrixHeight=parseInt(this.getChildValue(a))},ResourceURL:function(a,b){b.resourceUrl=b.resourceUrl||{};var c=a.getAttribute("resourceType");b.resourceUrls||(b.resourceUrls=[]);c=b.resourceUrl[c]={format:a.getAttribute("format"),template:a.getAttribute("template"),resourceType:c};b.resourceUrls.push(c)},WSDL:function(a,b){b.wsdl={};b.wsdl.href=a.getAttribute("xlink:href")},ServiceMetadataURL:function(a, +b){b.serviceMetadataUrl={};b.serviceMetadataUrl.href=a.getAttribute("xlink:href")},LegendURL:function(a,b){b.legend={};b.legend.href=a.getAttribute("xlink:href");b.legend.format=a.getAttribute("format")},Dimension:function(a,b){var c={values:[]};this.readChildNodes(a,c);b.dimensions.push(c)},Default:function(a,b){b["default"]=this.getChildValue(a)},Value:function(a,b){b.values.push(this.getChildValue(a))}},ows:OpenLayers.Format.OWSCommon.v1_1_0.prototype.readers.ows},CLASS_NAME:"OpenLayers.Format.WMTSCapabilities.v1_0_0"}); diff --git a/phpMyAdmin/js/vendor/openlayers/img/blank.gif b/phpMyAdmin/js/vendor/openlayers/img/blank.gif new file mode 100755 index 0000000..4bcc753 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/blank.gif differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/cloud-popup-relative.png b/phpMyAdmin/js/vendor/openlayers/img/cloud-popup-relative.png new file mode 100755 index 0000000..df95457 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/cloud-popup-relative.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/drag-rectangle-off.png b/phpMyAdmin/js/vendor/openlayers/img/drag-rectangle-off.png new file mode 100755 index 0000000..bb75b81 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/drag-rectangle-off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/drag-rectangle-on.png b/phpMyAdmin/js/vendor/openlayers/img/drag-rectangle-on.png new file mode 100755 index 0000000..bf5e46d Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/drag-rectangle-on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/east-mini.png b/phpMyAdmin/js/vendor/openlayers/img/east-mini.png new file mode 100755 index 0000000..6685939 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/east-mini.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/layer-switcher-maximize.png b/phpMyAdmin/js/vendor/openlayers/img/layer-switcher-maximize.png new file mode 100755 index 0000000..2a7f032 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/layer-switcher-maximize.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/layer-switcher-minimize.png b/phpMyAdmin/js/vendor/openlayers/img/layer-switcher-minimize.png new file mode 100755 index 0000000..df60923 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/layer-switcher-minimize.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/marker-blue.png b/phpMyAdmin/js/vendor/openlayers/img/marker-blue.png new file mode 100755 index 0000000..90d2485 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/marker-blue.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/marker-gold.png b/phpMyAdmin/js/vendor/openlayers/img/marker-gold.png new file mode 100755 index 0000000..1c55af1 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/marker-gold.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/marker-green.png b/phpMyAdmin/js/vendor/openlayers/img/marker-green.png new file mode 100755 index 0000000..18086d0 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/marker-green.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/marker.png b/phpMyAdmin/js/vendor/openlayers/img/marker.png new file mode 100755 index 0000000..990d61d Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/marker.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/measuring-stick-off.png b/phpMyAdmin/js/vendor/openlayers/img/measuring-stick-off.png new file mode 100755 index 0000000..73e3d55 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/measuring-stick-off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/measuring-stick-on.png b/phpMyAdmin/js/vendor/openlayers/img/measuring-stick-on.png new file mode 100755 index 0000000..fbc162d Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/measuring-stick-on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/north-mini.png b/phpMyAdmin/js/vendor/openlayers/img/north-mini.png new file mode 100755 index 0000000..c3b6062 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/north-mini.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/panning-hand-off.png b/phpMyAdmin/js/vendor/openlayers/img/panning-hand-off.png new file mode 100755 index 0000000..a5f0f82 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/panning-hand-off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/panning-hand-on.png b/phpMyAdmin/js/vendor/openlayers/img/panning-hand-on.png new file mode 100755 index 0000000..3454f12 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/panning-hand-on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/slider.png b/phpMyAdmin/js/vendor/openlayers/img/slider.png new file mode 100755 index 0000000..56d355e Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/slider.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/south-mini.png b/phpMyAdmin/js/vendor/openlayers/img/south-mini.png new file mode 100755 index 0000000..654673b Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/south-mini.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/west-mini.png b/phpMyAdmin/js/vendor/openlayers/img/west-mini.png new file mode 100755 index 0000000..61ad92e Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/west-mini.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/zoom-minus-mini.png b/phpMyAdmin/js/vendor/openlayers/img/zoom-minus-mini.png new file mode 100755 index 0000000..1b8d84d Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/zoom-minus-mini.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/zoom-plus-mini.png b/phpMyAdmin/js/vendor/openlayers/img/zoom-plus-mini.png new file mode 100755 index 0000000..466cc7b Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/zoom-plus-mini.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/zoom-world-mini.png b/phpMyAdmin/js/vendor/openlayers/img/zoom-world-mini.png new file mode 100755 index 0000000..dcc60f1 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/zoom-world-mini.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/img/zoombar.png b/phpMyAdmin/js/vendor/openlayers/img/zoombar.png new file mode 100755 index 0000000..b366acb Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/img/zoombar.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/google.css b/phpMyAdmin/js/vendor/openlayers/theme/default/google.css new file mode 100755 index 0000000..1b748ef --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/theme/default/google.css @@ -0,0 +1,9 @@ +.olLayerGoogleCopyright { + right: 3px; + bottom: 2px; + left: auto; +} +.olLayerGooglePoweredBy { + left: 2px; + bottom: 2px; +} diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/google.tidy.css b/phpMyAdmin/js/vendor/openlayers/theme/default/google.tidy.css new file mode 100755 index 0000000..c0e07ac --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/theme/default/google.tidy.css @@ -0,0 +1 @@ +.olLayerGoogleCopyright{right:3px;bottom:2px;left:auto;}.olLayerGooglePoweredBy{left:2px;bottom:2px;} \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/ie6-style.css b/phpMyAdmin/js/vendor/openlayers/theme/default/ie6-style.css new file mode 100755 index 0000000..a0fd7c6 --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/theme/default/ie6-style.css @@ -0,0 +1,10 @@ +.olControlZoomPanel div { + background-image: url(img/zoom-panel-NOALPHA.png); +} +.olControlPanPanel div { + background-image: url(img/pan-panel-NOALPHA.png); +} +.olControlEditingToolbar { + width: 200px; +} + diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/ie6-style.tidy.css b/phpMyAdmin/js/vendor/openlayers/theme/default/ie6-style.tidy.css new file mode 100755 index 0000000..7a23bbc --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/theme/default/ie6-style.tidy.css @@ -0,0 +1 @@ +.olControlZoomPanel div{background-image:url(img/zoom-panel-NOALPHA.png);}.olControlPanPanel div{background-image:url(img/pan-panel-NOALPHA.png);}.olControlEditingToolbar{width:200px;} \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/add_point_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/add_point_off.png new file mode 100755 index 0000000..c6d6b52 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/add_point_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/add_point_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/add_point_on.png new file mode 100755 index 0000000..7e86d5b Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/add_point_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/blank.gif b/phpMyAdmin/js/vendor/openlayers/theme/default/img/blank.gif new file mode 100755 index 0000000..4bcc753 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/blank.gif differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/close.gif b/phpMyAdmin/js/vendor/openlayers/theme/default/img/close.gif new file mode 100755 index 0000000..a8958de Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/close.gif differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/drag-rectangle-off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/drag-rectangle-off.png new file mode 100755 index 0000000..bb75b81 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/drag-rectangle-off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/drag-rectangle-on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/drag-rectangle-on.png new file mode 100755 index 0000000..bf5e46d Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/drag-rectangle-on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_line_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_line_off.png new file mode 100755 index 0000000..64165ca Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_line_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_line_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_line_on.png new file mode 100755 index 0000000..8378fec Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_line_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_point_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_point_off.png new file mode 100755 index 0000000..a7ee50e Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_point_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_point_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_point_on.png new file mode 100755 index 0000000..5143fe9 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_point_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_polygon_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_polygon_off.png new file mode 100755 index 0000000..73c823f Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_polygon_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_polygon_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_polygon_on.png new file mode 100755 index 0000000..56d8e21 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/draw_polygon_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/editing_tool_bar.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/editing_tool_bar.png new file mode 100755 index 0000000..bf6e060 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/editing_tool_bar.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/move_feature_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/move_feature_off.png new file mode 100755 index 0000000..440b6e1 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/move_feature_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/move_feature_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/move_feature_on.png new file mode 100755 index 0000000..759f972 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/move_feature_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/navigation_history.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/navigation_history.png new file mode 100755 index 0000000..a8ba8f1 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/navigation_history.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/overview_replacement.gif b/phpMyAdmin/js/vendor/openlayers/theme/default/img/overview_replacement.gif new file mode 100755 index 0000000..a82cf5f Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/overview_replacement.gif differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan-panel-NOALPHA.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan-panel-NOALPHA.png new file mode 100755 index 0000000..9088840 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan-panel-NOALPHA.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan-panel.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan-panel.png new file mode 100755 index 0000000..2e75080 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan-panel.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan_off.png new file mode 100755 index 0000000..7ea5080 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan_on.png new file mode 100755 index 0000000..248f27d Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/pan_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/panning-hand-off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/panning-hand-off.png new file mode 100755 index 0000000..a5f0f82 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/panning-hand-off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/panning-hand-on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/panning-hand-on.png new file mode 100755 index 0000000..3454f12 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/panning-hand-on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/remove_point_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/remove_point_off.png new file mode 100755 index 0000000..95c40c4 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/remove_point_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/remove_point_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/remove_point_on.png new file mode 100755 index 0000000..4ecd214 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/remove_point_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/ruler.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/ruler.png new file mode 100755 index 0000000..d459187 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/ruler.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/save_features_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/save_features_off.png new file mode 100755 index 0000000..22d07b0 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/save_features_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/save_features_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/save_features_on.png new file mode 100755 index 0000000..8fe36ef Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/save_features_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_next_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_next_off.png new file mode 100755 index 0000000..102f934 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_next_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_next_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_next_on.png new file mode 100755 index 0000000..a00c683 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_next_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_previous_off.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_previous_off.png new file mode 100755 index 0000000..d2efd14 Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_previous_off.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_previous_on.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_previous_on.png new file mode 100755 index 0000000..205154e Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/view_previous_on.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/zoom-panel-NOALPHA.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/zoom-panel-NOALPHA.png new file mode 100755 index 0000000..989973f Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/zoom-panel-NOALPHA.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/img/zoom-panel.png b/phpMyAdmin/js/vendor/openlayers/theme/default/img/zoom-panel.png new file mode 100755 index 0000000..7b5a43b Binary files /dev/null and b/phpMyAdmin/js/vendor/openlayers/theme/default/img/zoom-panel.png differ diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/style.css b/phpMyAdmin/js/vendor/openlayers/theme/default/style.css new file mode 100755 index 0000000..cbed84e --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/theme/default/style.css @@ -0,0 +1,516 @@ +div.olMap { + z-index: 0; + padding: 0 !important; + margin: 0 !important; + cursor: default; +} + +div.olMapViewport { + text-align: left; + -ms-touch-action: none; +} + +div.olLayerDiv { + -moz-user-select: none; + -khtml-user-select: none; +} + +.olLayerGoogleCopyright { + left: 2px; + bottom: 2px; +} +.olLayerGoogleV3.olLayerGoogleCopyright { + right: auto !important; +} +.olLayerGooglePoweredBy { + left: 2px; + bottom: 15px; +} +.olLayerGoogleV3.olLayerGooglePoweredBy { + bottom: 15px !important; +} +/* GMaps should not set styles on its container */ +.olForeignContainer { + opacity: 1 !important; +} +.olControlAttribution { + font-size: smaller; + right: 3px; + bottom: 4.5em; + position: absolute; + display: block; +} +.olControlScale { + right: 3px; + bottom: 3em; + display: block; + position: absolute; + font-size: smaller; +} +.olControlScaleLine { + display: block; + position: absolute; + left: 10px; + bottom: 15px; + font-size: xx-small; +} +.olControlScaleLineBottom { + border: solid 2px black; + border-bottom: none; + margin-top:-2px; + text-align: center; +} +.olControlScaleLineTop { + border: solid 2px black; + border-top: none; + text-align: center; +} + +.olControlPermalink { + right: 3px; + bottom: 1.5em; + display: block; + position: absolute; + font-size: smaller; +} + +div.olControlMousePosition { + bottom: 0; + right: 3px; + display: block; + position: absolute; + font-family: Arial; + font-size: smaller; +} + +.olControlOverviewMapContainer { + position: absolute; + bottom: 0; + right: 0; +} + +.olControlOverviewMapElement { + padding: 10px 18px 10px 10px; + background-color: #00008B; + -moz-border-radius: 1em 0 0 0; +} + +.olControlOverviewMapMinimizeButton, +.olControlOverviewMapMaximizeButton { + height: 18px; + width: 18px; + right: 0; + bottom: 80px; + cursor: pointer; +} + +.olControlOverviewMapExtentRectangle { + overflow: hidden; + background-image: url("img/blank.gif"); + cursor: move; + border: 2px dotted red; +} +.olControlOverviewMapRectReplacement { + overflow: hidden; + cursor: move; + background-image: url("img/overview_replacement.gif"); + background-repeat: no-repeat; + background-position: center; +} + +.olLayerGeoRSSDescription { + float:left; + width:100%; + overflow:auto; + font-size:1.0em; +} +.olLayerGeoRSSClose { + float:right; + color:gray; + font-size:1.2em; + margin-right:6px; + font-family:sans-serif; +} +.olLayerGeoRSSTitle { + float:left;font-size:1.2em; +} + +.olPopupContent { + padding:5px; + overflow: auto; +} + +.olControlNavigationHistory { + background-image: url("img/navigation_history.png"); + background-repeat: no-repeat; + width: 24px; + height: 24px; + +} +.olControlNavigationHistoryPreviousItemActive { + background-position: 0 0; +} +.olControlNavigationHistoryPreviousItemInactive { + background-position: 0 -24px; +} +.olControlNavigationHistoryNextItemActive { + background-position: -24px 0; +} +.olControlNavigationHistoryNextItemInactive { + background-position: -24px -24px; +} + +div.olControlSaveFeaturesItemActive { + background-image: url(img/save_features_on.png); + background-repeat: no-repeat; + background-position: 0 1px; +} +div.olControlSaveFeaturesItemInactive { + background-image: url(img/save_features_off.png); + background-repeat: no-repeat; + background-position: 0 1px; +} + +.olHandlerBoxZoomBox { + border: 2px solid red; + position: absolute; + background-color: white; + opacity: 0.50; + font-size: 1px; + filter: alpha(opacity=50); +} +.olHandlerBoxSelectFeature { + border: 2px solid blue; + position: absolute; + background-color: white; + opacity: 0.50; + font-size: 1px; + filter: alpha(opacity=50); +} + +.olControlPanPanel { + top: 10px; + left: 5px; +} + +.olControlPanPanel div { + background-image: url(img/pan-panel.png); + height: 18px; + width: 18px; + cursor: pointer; + position: absolute; +} + +.olControlPanPanel .olControlPanNorthItemInactive { + top: 0; + left: 9px; + background-position: 0 0; +} +.olControlPanPanel .olControlPanSouthItemInactive { + top: 36px; + left: 9px; + background-position: 18px 0; +} +.olControlPanPanel .olControlPanWestItemInactive { + position: absolute; + top: 18px; + left: 0; + background-position: 0 18px; +} +.olControlPanPanel .olControlPanEastItemInactive { + top: 18px; + left: 18px; + background-position: 18px 18px; +} + +.olControlZoomPanel { + top: 71px; + left: 14px; +} + +.olControlZoomPanel div { + background-image: url(img/zoom-panel.png); + position: absolute; + height: 18px; + width: 18px; + cursor: pointer; +} + +.olControlZoomPanel .olControlZoomInItemInactive { + top: 0; + left: 0; + background-position: 0 0; +} + +.olControlZoomPanel .olControlZoomToMaxExtentItemInactive { + top: 18px; + left: 0; + background-position: 0 -18px; +} + +.olControlZoomPanel .olControlZoomOutItemInactive { + top: 36px; + left: 0; + background-position: 0 18px; +} + +/* + * When a potential text is bigger than the image it move the image + * with some headers (closes #3154) + */ +.olControlPanZoomBar div { + font-size: 1px; +} + +.olPopupCloseBox { + background: url("img/close.gif") no-repeat; + cursor: pointer; +} + +.olFramedCloudPopupContent { + padding: 5px; + overflow: auto; +} + +.olControlNoSelect { + -moz-user-select: none; + -khtml-user-select: none; +} + +.olImageLoadError { + background-color: pink; + opacity: 0.5; + filter: alpha(opacity=50); /* IE */ +} + +/** + * Cursor styles + */ + +.olCursorWait { + cursor: wait; +} +.olDragDown { + cursor: move; +} +.olDrawBox { + cursor: crosshair; +} +.olControlDragFeatureOver { + cursor: move; +} +.olControlDragFeatureActive.olControlDragFeatureOver.olDragDown { + cursor: -moz-grabbing; +} + +/** + * Layer switcher + */ +.olControlLayerSwitcher { + position: absolute; + top: 25px; + right: 0; + width: 20em; + font-family: sans-serif; + font-weight: bold; + margin-top: 3px; + margin-left: 3px; + margin-bottom: 3px; + font-size: smaller; + color: white; + background-color: transparent; +} + +.olControlLayerSwitcher .layersDiv { + padding-top: 5px; + padding-left: 10px; + padding-bottom: 5px; + padding-right: 10px; + background-color: darkblue; +} + +.olControlLayerSwitcher .layersDiv .baseLbl, +.olControlLayerSwitcher .layersDiv .dataLbl { + margin-top: 3px; + margin-left: 3px; + margin-bottom: 3px; +} + +.olControlLayerSwitcher .layersDiv .baseLayersDiv, +.olControlLayerSwitcher .layersDiv .dataLayersDiv { + padding-left: 10px; +} + +.olControlLayerSwitcher .maximizeDiv, +.olControlLayerSwitcher .minimizeDiv { + width: 18px; + height: 18px; + top: 5px; + right: 0; + cursor: pointer; +} + +.olBingAttribution { + color: #DDD; +} +.olBingAttribution.road { + color: #333; +} + +.olGoogleAttribution.hybrid, .olGoogleAttribution.satellite { + color: #EEE; +} +.olGoogleAttribution { + color: #333; +} +span.olGoogleAttribution a { + color: #77C; +} +span.olGoogleAttribution.hybrid a, span.olGoogleAttribution.satellite a { + color: #EEE; +} + +/** + * Editing and navigation icons. + * (using the editing_tool_bar.png sprint image) + */ +.olControlNavToolbar , +.olControlEditingToolbar { + margin: 5px 5px 0 0; +} +.olControlNavToolbar div, +.olControlEditingToolbar div { + background-image: url("img/editing_tool_bar.png"); + background-repeat: no-repeat; + margin: 0 0 5px 5px; + width: 24px; + height: 22px; + cursor: pointer +} +/* positions */ +.olControlEditingToolbar { + right: 0; + top: 0; +} +.olControlNavToolbar { + top: 295px; + left: 9px; +} +/* layouts */ +.olControlEditingToolbar div { + float: right; +} +/* individual controls */ +.olControlNavToolbar .olControlNavigationItemInactive, +.olControlEditingToolbar .olControlNavigationItemInactive { + background-position: -103px -1px; +} +.olControlNavToolbar .olControlNavigationItemActive , +.olControlEditingToolbar .olControlNavigationItemActive { + background-position: -103px -24px; +} +.olControlNavToolbar .olControlZoomBoxItemInactive { + background-position: -128px -1px; +} +.olControlNavToolbar .olControlZoomBoxItemActive { + background-position: -128px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePointItemInactive { + background-position: -77px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePointItemActive { + background-position: -77px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePathItemInactive { + background-position: -51px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePathItemActive { + background-position: -51px -24px; +} +.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{ + background-position: -26px -1px; +} +.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive { + background-position: -26px -24px; +} + +div.olControlZoom { + position: absolute; + top: 8px; + left: 8px; + background: rgba(255,255,255,0.4); + border-radius: 4px; + padding: 2px; +} +div.olControlZoom a { + display: block; + margin: 1px; + padding: 0; + color: white; + font-size: 18px; + font-family: 'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif; + font-weight: bold; + text-decoration: none; + text-align: center; + height: 22px; + width:22px; + line-height: 19px; + background: #130085; /* fallback for IE - IE6 requires background shorthand*/ + background: rgba(0, 60, 136, 0.5); + filter: alpha(opacity=80); +} +div.olControlZoom a:hover { + background: #130085; /* fallback for IE */ + background: rgba(0, 60, 136, 0.7); + filter: alpha(opacity=100); +} +@media only screen and (max-width: 600px) { + div.olControlZoom a:hover { + background: rgba(0, 60, 136, 0.5); + } +} +a.olControlZoomIn { + border-radius: 4px 4px 0 0; +} +a.olControlZoomOut { + border-radius: 0 0 4px 4px; +} + + +/** + * Animations + */ + +.olLayerGrid .olTileImage { + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + -o-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; +} + +/* Turn on GPU support where available */ +.olTileImage { + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -o-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + -moz-perspective: 1000; + -ms-perspective: 1000; + perspective: 1000; +} + +/* when replacing tiles, do not show tile and backbuffer at the same time */ +.olTileReplacing { + display: none; +} + +/* override any max-width image settings (e.g. bootstrap.css) */ +img.olTileImage { + max-width: none; +} diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/style.mobile.css b/phpMyAdmin/js/vendor/openlayers/theme/default/style.mobile.css new file mode 100755 index 0000000..92e7d00 --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/theme/default/style.mobile.css @@ -0,0 +1,70 @@ +div.olControlZoom { + position: absolute; + top: 8px; + left: 8px; + background: rgba(255,255,255,0.4); + border-radius: 4px; + padding: 2px; +} +* { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +div.olControlZoom a { + display: block; + margin: 1px; + padding: 0; + color: white; + font-size: 28px; + font-family: sans-serif; + font-weight: bold; + text-decoration: none; + text-align: center; + height: 32px; + width: 32px; + line-height: 28px; + text-shadow: 0 0 3px rgba(0,0,0,0.8); + background: #130085; /* fallback for IE - IE6 requires background shorthand*/ + background: rgba(0, 60, 136, 0.5); + filter: alpha(opacity=80); +} +a.olControlZoomIn { + border-radius: 4px 4px 0 0; +} +a.olControlZoomOut { + border-radius: 0 0 4px 4px; +} +div.olControlZoom a:hover { + background: #130085; /* fallback for IE */ + background: rgba(0, 60, 136, 0.7); + filter: alpha(opacity=100); +} +@media only screen and (max-width: 600px) { + div.olControlZoom a:hover { + background: rgba(0, 60, 136, 0.5); + } +} +div.olMapViewport { + -ms-touch-action: none; +} +.olLayerGrid .olTileImage { + -webkit-transition: opacity 0.2s linear; + -moz-transition: opacity 0.2s linear; + -o-transition: opacity 0.2s linear; + transition: opacity 0.2s linear; +} +/* Turn on GPU support where available */ +.olTileImage { + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -o-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000; + -moz-perspective: 1000; + -ms-perspective: 1000; + perspective: 1000; +} diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/style.mobile.tidy.css b/phpMyAdmin/js/vendor/openlayers/theme/default/style.mobile.tidy.css new file mode 100755 index 0000000..bf7eeaf --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/theme/default/style.mobile.tidy.css @@ -0,0 +1 @@ +div.olControlZoom{position:absolute;top:8px;left:8px;background:rgba(255,255,255,0.4);border-radius:4px;padding:2px;}*{-webkit-tap-highlight-color:rgba(0,0,0,0);}div.olControlZoom a{display:block;color:#FFF;font-size:28px;font-family:sans-serif;font-weight:700;text-decoration:none;text-align:center;height:32px;width:32px;line-height:28px;text-shadow:0 0 3px rgba(0,0,0,0.8);background:rgba(0,60,136,0.5);filter:alpha(opacity=80);margin:1px;padding:0;}a.olControlZoomIn{border-radius:4px 4px 0 0;}a.olControlZoomOut{border-radius:0 0 4px 4px;}div.olControlZoom a:hover{background:rgba(0,60,136,0.7);filter:alpha(opacity=100);}div.olMapViewport{-ms-touch-action:none;}.olLayerGrid .olTileImage{-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear;}.olTileImage{-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-o-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;-moz-perspective:1000;-ms-perspective:1000;perspective:1000;}@media only screen and max-width 600px{div.olControlZoom a:hover{background:rgba(0,60,136,0.5);}} \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/openlayers/theme/default/style.tidy.css b/phpMyAdmin/js/vendor/openlayers/theme/default/style.tidy.css new file mode 100755 index 0000000..f973d45 --- /dev/null +++ b/phpMyAdmin/js/vendor/openlayers/theme/default/style.tidy.css @@ -0,0 +1 @@ +div.olMap{z-index:0;cursor:default;margin:0!important;padding:0!important;}div.olMapViewport{text-align:left;-ms-touch-action:none;}.olLayerGoogleCopyright{left:2px;bottom:2px;}.olLayerGoogleV3.olLayerGoogleCopyright{right:auto!important;}.olLayerGooglePoweredBy{left:2px;bottom:15px;}.olLayerGoogleV3.olLayerGooglePoweredBy{bottom:15px!important;}.olForeignContainer{opacity:1!important;}.olControlAttribution{font-size:smaller;right:3px;bottom:4.5em;position:absolute;display:block;}.olControlScale{right:3px;bottom:3em;display:block;position:absolute;font-size:smaller;}.olControlScaleLine{display:block;position:absolute;left:10px;bottom:15px;font-size:xx-small;}.olControlScaleLineBottom{border:solid 2px #000;border-bottom:none;margin-top:-2px;text-align:center;}.olControlScaleLineTop{border:solid 2px #000;border-top:none;text-align:center;}.olControlPermalink{right:3px;bottom:1.5em;display:block;position:absolute;font-size:smaller;}div.olControlMousePosition{bottom:0;right:3px;display:block;position:absolute;font-family:Arial;font-size:smaller;}.olControlOverviewMapContainer{position:absolute;bottom:0;right:0;}.olControlOverviewMapElement{background-color:#00008B;-moz-border-radius:1em 0 0;padding:10px 18px 10px 10px;}.olControlOverviewMapMinimizeButton,.olControlOverviewMapMaximizeButton{height:18px;width:18px;right:0;bottom:80px;cursor:pointer;}.olControlOverviewMapExtentRectangle{overflow:hidden;background-image:url(img/blank.gif);cursor:move;border:2px dotted red;}.olControlOverviewMapRectReplacement{overflow:hidden;cursor:move;background-image:url(img/overview_replacement.gif);background-repeat:no-repeat;background-position:center;}.olLayerGeoRSSDescription{float:left;width:100%;overflow:auto;font-size:1em;}.olLayerGeoRSSClose{float:right;color:gray;font-size:1.2em;margin-right:6px;font-family:sans-serif;}.olLayerGeoRSSTitle{float:left;font-size:1.2em;}.olControlNavigationHistory{background-image:url(img/navigation_history.png);background-repeat:no-repeat;width:24px;height:24px;}.olControlNavigationHistoryPreviousItemActive{background-position:0 0;}.olControlNavigationHistoryPreviousItemInactive{background-position:0 -24px;}.olControlNavigationHistoryNextItemActive{background-position:-24px 0;}.olControlNavigationHistoryNextItemInactive{background-position:-24px -24px;}div.olControlSaveFeaturesItemActive{background-image:url(img/save_features_on.png);background-repeat:no-repeat;background-position:0 1px;}div.olControlSaveFeaturesItemInactive{background-image:url(img/save_features_off.png);background-repeat:no-repeat;background-position:0 1px;}.olHandlerBoxZoomBox{border:2px solid red;position:absolute;background-color:#FFF;opacity:.5;font-size:1px;filter:alpha(opacity=50);}.olHandlerBoxSelectFeature{border:2px solid blue;position:absolute;background-color:#FFF;opacity:.5;font-size:1px;filter:alpha(opacity=50);}.olControlPanPanel{top:10px;left:5px;}.olControlPanPanel div{background-image:url(img/pan-panel.png);height:18px;width:18px;cursor:pointer;position:absolute;}.olControlPanPanel .olControlPanNorthItemInactive{top:0;left:9px;background-position:0 0;}.olControlPanPanel .olControlPanSouthItemInactive{top:36px;left:9px;background-position:18px 0;}.olControlPanPanel .olControlPanWestItemInactive{position:absolute;top:18px;left:0;background-position:0 18px;}.olControlPanPanel .olControlPanEastItemInactive{top:18px;left:18px;background-position:18px 18px;}.olControlZoomPanel{top:71px;left:14px;}.olControlZoomPanel div{background-image:url(img/zoom-panel.png);position:absolute;height:18px;width:18px;cursor:pointer;}.olControlZoomPanel .olControlZoomInItemInactive{top:0;left:0;background-position:0 0;}.olControlZoomPanel .olControlZoomToMaxExtentItemInactive{top:18px;left:0;background-position:0 -18px;}.olControlZoomPanel .olControlZoomOutItemInactive{top:36px;left:0;background-position:0 18px;}.olControlPanZoomBar div{font-size:1px;}.olPopupCloseBox{background:url(img/close.gif) no-repeat;cursor:pointer;}.olImageLoadError{background-color:#FFC0CB;opacity:.5;filter:alpha(opacity=50);}.olCursorWait{cursor:wait;}.olDrawBox{cursor:crosshair;}.olControlDragFeatureActive.olControlDragFeatureOver.olDragDown{cursor:0;}.olControlLayerSwitcher{position:absolute;top:25px;right:0;width:20em;font-family:sans-serif;font-weight:700;margin-top:3px;margin-left:3px;margin-bottom:3px;font-size:smaller;color:#FFF;background-color:transparent;}.olControlLayerSwitcher .layersDiv{background-color:#00008B;padding:5px 10px;}.olControlLayerSwitcher .layersDiv .baseLbl,.olControlLayerSwitcher .layersDiv .dataLbl{margin-top:3px;margin-left:3px;margin-bottom:3px;}.olControlLayerSwitcher .layersDiv .baseLayersDiv,.olControlLayerSwitcher .layersDiv .dataLayersDiv{padding-left:10px;}.olControlLayerSwitcher .maximizeDiv,.olControlLayerSwitcher .minimizeDiv{width:18px;height:18px;top:5px;right:0;cursor:pointer;}.olBingAttribution{color:#DDD;}span.olGoogleAttribution a{color:#77C;}.olControlNavToolbar,.olControlEditingToolbar{margin:5px 5px 0 0;}.olControlNavToolbar div,.olControlEditingToolbar div{background-image:url(img/editing_tool_bar.png);background-repeat:no-repeat;width:24px;height:22px;cursor:pointer;margin:0 0 5px 5px;}.olControlEditingToolbar{right:0;top:0;}.olControlNavToolbar{top:295px;left:9px;}.olControlEditingToolbar div{float:right;}.olControlNavToolbar .olControlNavigationItemInactive,.olControlEditingToolbar .olControlNavigationItemInactive{background-position:-103px -1px;}.olControlNavToolbar .olControlNavigationItemActive,.olControlEditingToolbar .olControlNavigationItemActive{background-position:-103px -24px;}.olControlNavToolbar .olControlZoomBoxItemInactive{background-position:-128px -1px;}.olControlNavToolbar .olControlZoomBoxItemActive{background-position:-128px -24px;}.olControlEditingToolbar .olControlDrawFeaturePointItemInactive{background-position:-77px -1px;}.olControlEditingToolbar .olControlDrawFeaturePointItemActive{background-position:-77px -24px;}.olControlEditingToolbar .olControlDrawFeaturePathItemInactive{background-position:-51px -1px;}.olControlEditingToolbar .olControlDrawFeaturePathItemActive{background-position:-51px -24px;}.olControlEditingToolbar .olControlDrawFeaturePolygonItemInactive{background-position:-26px -1px;}.olControlEditingToolbar .olControlDrawFeaturePolygonItemActive{background-position:-26px -24px;}div.olControlZoom{position:absolute;top:8px;left:8px;background:rgba(255,255,255,0.4);border-radius:4px;padding:2px;}div.olControlZoom a{display:block;color:#FFF;font-size:18px;font-family:'Lucida Grande', Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;font-weight:700;text-decoration:none;text-align:center;height:22px;width:22px;line-height:19px;background:rgba(0,60,136,0.5);filter:alpha(opacity=80);margin:1px;padding:0;}div.olControlZoom a:hover{background:rgba(0,60,136,0.7);filter:alpha(opacity=100);}a.olControlZoomIn{border-radius:4px 4px 0 0;}a.olControlZoomOut{border-radius:0 0 4px 4px;}.olLayerGrid .olTileImage{-webkit-transition:opacity .2s linear;-moz-transition:opacity .2s linear;-o-transition:opacity .2s linear;transition:opacity .2s linear;}.olTileImage{-webkit-transform:translateZ(0);-moz-transform:translateZ(0);-o-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000;-moz-perspective:1000;-ms-perspective:1000;perspective:1000;}.olTileReplacing{display:none;}img.olTileImage{max-width:none;}div.olLayerDiv,.olControlNoSelect{-khtml-user-select:none;-moz-user-select:none;}.olPopupContent,.olFramedCloudPopupContent{overflow:auto;padding:5px;}.olDragDown,.olControlDragFeatureOver{cursor:move;}.olBingAttribution.road,.olGoogleAttribution{color:#333;}.olGoogleAttribution.hybrid,.olGoogleAttribution.satellite,span.olGoogleAttribution.hybrid a,span.olGoogleAttribution.satellite a{color:#EEE;}@media only screen and max-width 600px{div.olControlZoom a:hover{background:rgba(0,60,136,0.5);}} \ No newline at end of file diff --git a/phpMyAdmin/js/vendor/sprintf.js b/phpMyAdmin/js/vendor/sprintf.js new file mode 100755 index 0000000..56291d5 --- /dev/null +++ b/phpMyAdmin/js/vendor/sprintf.js @@ -0,0 +1,211 @@ +function sprintf() { +/* + * Copyright (c) 2013 Kevin van Zonneveld (http://kvz.io) + * and Contributors (http://phpjs.org/authors) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. +*/ + // discuss at: http://phpjs.org/functions/sprintf/ + // original by: Ash Searle (http://hexmen.com/blog/) + // improved by: Michael White (http://getsprink.com) + // improved by: Jack + // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // improved by: Dj + // improved by: Allidylls + // input by: Paulo Freitas + // input by: Brett Zamir (http://brett-zamir.me) + // example 1: sprintf("%01.2f", 123.1); + // returns 1: 123.10 + // example 2: sprintf("[%10s]", 'monkey'); + // returns 2: '[ monkey]' + // example 3: sprintf("[%'#10s]", 'monkey'); + // returns 3: '[####monkey]' + // example 4: sprintf("%d", 123456789012345); + // returns 4: '123456789012345' + // example 5: sprintf('%-03s', 'E'); + // returns 5: 'E00' + + var regex = /%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g; + var a = arguments; + var i = 0; + var format = a[i++]; + + // pad() + var pad = function (str, len, chr, leftJustify) { + if (!chr) { + chr = ' '; + } + var padding = (str.length >= len) ? '' : new Array(1 + len - str.length >>> 0) + .join(chr); + return leftJustify ? str + padding : padding + str; + }; + + // justify() + var justify = function (value, prefix, leftJustify, minWidth, zeroPad, customPadChar) { + var diff = minWidth - value.length; + if (diff > 0) { + if (leftJustify || !zeroPad) { + value = pad(value, minWidth, customPadChar, leftJustify); + } else { + value = value.slice(0, prefix.length) + pad('', diff, '0', true) + value.slice(prefix.length); + } + } + return value; + }; + + // formatBaseX() + var formatBaseX = function (value, base, prefix, leftJustify, minWidth, precision, zeroPad) { + // Note: casts negative numbers to positive ones + var number = value >>> 0; + prefix = prefix && number && { + '2': '0b', + '8': '0', + '16': '0x' + }[base] || ''; + value = prefix + pad(number.toString(base), precision || 0, '0', false); + return justify(value, prefix, leftJustify, minWidth, zeroPad); + }; + + // formatString() + var formatString = function (value, leftJustify, minWidth, precision, zeroPad, customPadChar) { + if (precision != null) { + value = value.slice(0, precision); + } + return justify(value, '', leftJustify, minWidth, zeroPad, customPadChar); + }; + + // doFormat() + var doFormat = function (substring, valueIndex, flags, minWidth, _, precision, type) { + var number, prefix, method, textTransform, value; + + if (substring === '%%') { + return '%'; + } + + // parse flags + var leftJustify = false; + var positivePrefix = ''; + var zeroPad = false; + var prefixBaseX = false; + var customPadChar = ' '; + var flagsl = flags.length; + for (var j = 0; flags && j < flagsl; j++) { + switch (flags.charAt(j)) { + case ' ': + positivePrefix = ' '; + break; + case '+': + positivePrefix = '+'; + break; + case '-': + leftJustify = true; + break; + case "'": + customPadChar = flags.charAt(j + 1); + break; + case '0': + zeroPad = true; + customPadChar = '0'; + break; + case '#': + prefixBaseX = true; + break; + } + } + + // parameters may be null, undefined, empty-string or real valued + // we want to ignore null, undefined and empty-string values + if (!minWidth) { + minWidth = 0; + } else if (minWidth === '*') { + minWidth = +a[i++]; + } else if (minWidth.charAt(0) == '*') { + minWidth = +a[minWidth.slice(1, -1)]; + } else { + minWidth = +minWidth; + } + + // Note: undocumented perl feature: + if (minWidth < 0) { + minWidth = -minWidth; + leftJustify = true; + } + + if (!isFinite(minWidth)) { + throw new Error('sprintf: (minimum-)width must be finite'); + } + + if (!precision) { + precision = 'fFeE'.indexOf(type) > -1 ? 6 : (type === 'd') ? 0 : undefined; + } else if (precision === '*') { + precision = +a[i++]; + } else if (precision.charAt(0) == '*') { + precision = +a[precision.slice(1, -1)]; + } else { + precision = +precision; + } + + // grab value using valueIndex if required? + value = valueIndex ? a[valueIndex.slice(0, -1)] : a[i++]; + + switch (type) { + case 's': + return formatString(String(value), leftJustify, minWidth, precision, zeroPad, customPadChar); + case 'c': + return formatString(String.fromCharCode(+value), leftJustify, minWidth, precision, zeroPad); + case 'b': + return formatBaseX(value, 2, prefixBaseX, leftJustify, minWidth, precision, zeroPad); + case 'o': + return formatBaseX(value, 8, prefixBaseX, leftJustify, minWidth, precision, zeroPad); + case 'x': + return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad); + case 'X': + return formatBaseX(value, 16, prefixBaseX, leftJustify, minWidth, precision, zeroPad) + .toUpperCase(); + case 'u': + return formatBaseX(value, 10, prefixBaseX, leftJustify, minWidth, precision, zeroPad); + case 'i': + case 'd': + number = +value || 0; + // Plain Math.round doesn't just truncate + number = Math.round(number - number % 1); + prefix = number < 0 ? '-' : positivePrefix; + value = prefix + pad(String(Math.abs(number)), precision, '0', false); + return justify(value, prefix, leftJustify, minWidth, zeroPad); + case 'e': + case 'E': + case 'f': // Should handle locales (as per setlocale) + case 'F': + case 'g': + case 'G': + number = +value; + prefix = number < 0 ? '-' : positivePrefix; + method = ['toExponential', 'toFixed', 'toPrecision']['efg'.indexOf(type.toLowerCase())]; + textTransform = ['toString', 'toUpperCase']['eEfFgG'.indexOf(type) % 2]; + value = prefix + Math.abs(number)[method](precision); + return justify(value, prefix, leftJustify, minWidth, zeroPad)[textTransform](); + default: + return substring; + } + }; + + return format.replace(regex, doFormat); +} diff --git a/phpMyAdmin/js/vendor/tracekit.js b/phpMyAdmin/js/vendor/tracekit.js new file mode 100755 index 0000000..0b06b68 --- /dev/null +++ b/phpMyAdmin/js/vendor/tracekit.js @@ -0,0 +1,1277 @@ +/** + * https://github.com/csnover/TraceKit + * @license MIT + * @namespace TraceKit + */ +(function(window, undefined) { +if (!window) { + return; +} + +var TraceKit = {}; +var _oldTraceKit = window.TraceKit; + +// global reference to slice +var _slice = [].slice; +var UNKNOWN_FUNCTION = '?'; + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Error_types +var ERROR_TYPES_RE = /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/; + +/** + * A better form of hasOwnProperty<br/> + * Example: `_has(MainHostObject, property) === true/false` + * + * @param {Object} object to check property + * @param {string} key to check + * @return {Boolean} true if the object has the key and it is not inherited + */ +function _has(object, key) { + return Object.prototype.hasOwnProperty.call(object, key); +} + +/** + * Returns true if the parameter is undefined<br/> + * Example: `_isUndefined(val) === true/false` + * + * @param {*} what Value to check + * @return {Boolean} true if undefined and false otherwise + */ +function _isUndefined(what) { + return typeof what === 'undefined'; +} + +/** + * Export TraceKit out to another variable<br/> + * Example: `var TK = TraceKit.noConflict()` + * @return {Object} The TraceKit object + * @memberof TraceKit + */ +TraceKit.noConflict = function noConflict() { + window.TraceKit = _oldTraceKit; + return TraceKit; +}; + +/** + * Wrap any function in a TraceKit reporter<br/> + * Example: `func = TraceKit.wrap(func);` + * + * @param {Function} func Function to be wrapped + * @return {Function} The wrapped func + * @memberof TraceKit + */ +TraceKit.wrap = function traceKitWrapper(func) { + function wrapped() { + try { + return func.apply(this, arguments); + } catch (e) { + TraceKit.report(e); + throw e; + } + } + return wrapped; +}; + +/** + * Cross-browser processing of unhandled exceptions + * + * Syntax: + * ```js + * TraceKit.report.subscribe(function(stackInfo) { ... }) + * TraceKit.report.unsubscribe(function(stackInfo) { ... }) + * TraceKit.report(exception) + * try { ...code... } catch(ex) { TraceKit.report(ex); } + * ``` + * + * Supports: + * - Firefox: full stack trace with line numbers, plus column number + * on top frame; column number is not guaranteed + * - Opera: full stack trace with line and column numbers + * - Chrome: full stack trace with line and column numbers + * - Safari: line and column number for the top frame only; some frames + * may be missing, and column number is not guaranteed + * - IE: line and column number for the top frame only; some frames + * may be missing, and column number is not guaranteed + * + * In theory, TraceKit should work on all of the following versions: + * - IE5.5+ (only 8.0 tested) + * - Firefox 0.9+ (only 3.5+ tested) + * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require + * Exceptions Have Stacktrace to be enabled in opera:config) + * - Safari 3+ (only 4+ tested) + * - Chrome 1+ (only 5+ tested) + * - Konqueror 3.5+ (untested) + * + * Requires TraceKit.computeStackTrace. + * + * Tries to catch all unhandled exceptions and report them to the + * subscribed handlers. Please note that TraceKit.report will rethrow the + * exception. This is REQUIRED in order to get a useful stack trace in IE. + * If the exception does not reach the top of the browser, you will only + * get a stack trace from the point where TraceKit.report was called. + * + * Handlers receive a TraceKit.StackTrace object as described in the + * TraceKit.computeStackTrace docs. + * + * @memberof TraceKit + * @namespace + */ +TraceKit.report = (function reportModuleWrapper() { + var handlers = [], + lastException = null, + lastExceptionStack = null; + + /** + * Add a crash handler. + * @param {Function} handler + * @memberof TraceKit.report + */ + function subscribe(handler) { + installGlobalHandler(); + handlers.push(handler); + } + + /** + * Remove a crash handler. + * @param {Function} handler + * @memberof TraceKit.report + */ + function unsubscribe(handler) { + for (var i = handlers.length - 1; i >= 0; --i) { + if (handlers[i] === handler) { + handlers.splice(i, 1); + } + } + + if (handlers.length === 0) { + window.onerror = _oldOnerrorHandler; + _onErrorHandlerInstalled = false; + } + } + + /** + * Dispatch stack information to all handlers. + * @param {TraceKit.StackTrace} stack + * @param {boolean} isWindowError Is this a top-level window error? + * @param {Error=} error The error that's being handled (if available, null otherwise) + * @memberof TraceKit.report + * @throws An exception if an error occurs while calling an handler. + */ + function notifyHandlers(stack, isWindowError, error) { + var exception = null; + if (isWindowError && !TraceKit.collectWindowErrors) { + return; + } + for (var i in handlers) { + if (_has(handlers, i)) { + try { + handlers[i](stack, isWindowError, error); + } catch (inner) { + exception = inner; + } + } + } + + if (exception) { + throw exception; + } + } + + var _oldOnerrorHandler, _onErrorHandlerInstalled; + + /** + * Ensures all global unhandled exceptions are recorded. + * Supported by Gecko and IE. + * @param {string} message Error message. + * @param {string} url URL of script that generated the exception. + * @param {(number|string)} lineNo The line number at which the error occurred. + * @param {(number|string)=} columnNo The column number at which the error occurred. + * @param {Error=} errorObj The actual Error object. + * @memberof TraceKit.report + */ + function traceKitWindowOnError(message, url, lineNo, columnNo, errorObj) { + var stack = null; + + if (lastExceptionStack) { + TraceKit.computeStackTrace.augmentStackTraceWithInitialElement(lastExceptionStack, url, lineNo, message); + processLastException(); + } else if (errorObj) { + stack = TraceKit.computeStackTrace(errorObj); + notifyHandlers(stack, true, errorObj); + } else { + var location = { + 'url': url, + 'line': lineNo, + 'column': columnNo + }; + + var name; + var msg = message; // must be new var or will modify original `arguments` + if ({}.toString.call(message) === '[object String]') { + var groups = message.match(ERROR_TYPES_RE); + if (groups) { + name = groups[1]; + msg = groups[2]; + } + } + + location.func = TraceKit.computeStackTrace.guessFunctionName(location.url, location.line); + location.context = TraceKit.computeStackTrace.gatherContext(location.url, location.line); + stack = { + 'name': name, + 'message': msg, + 'mode': 'onerror', + 'stack': [location] + }; + + notifyHandlers(stack, true, null); + } + + if (_oldOnerrorHandler) { + return _oldOnerrorHandler.apply(this, arguments); + } + + return false; + } + + /** + * Install a global onerror handler + * @memberof TraceKit.report + */ + function installGlobalHandler() { + if (_onErrorHandlerInstalled === true) { + return; + } + + _oldOnerrorHandler = window.onerror; + window.onerror = traceKitWindowOnError; + _onErrorHandlerInstalled = true; + } + + /** + * Process the most recent exception + * @memberof TraceKit.report + */ + function processLastException() { + var _lastExceptionStack = lastExceptionStack, + _lastException = lastException; + lastExceptionStack = null; + lastException = null; + notifyHandlers(_lastExceptionStack, false, _lastException); + } + + /** + * Reports an unhandled Error to TraceKit. + * @param {Error} ex + * @memberof TraceKit.report + * @throws An exception if an incomplete stack trace is detected (old IE browsers). + */ + function report(ex) { + if (lastExceptionStack) { + if (lastException === ex) { + return; // already caught by an inner catch block, ignore + } else { + processLastException(); + } + } + + var stack = TraceKit.computeStackTrace(ex); + lastExceptionStack = stack; + lastException = ex; + + // If the stack trace is incomplete, wait for 2 seconds for + // slow slow IE to see if onerror occurs or not before reporting + // this exception; otherwise, we will end up with an incomplete + // stack trace + setTimeout(function () { + if (lastException === ex) { + processLastException(); + } + }, (stack.incomplete ? 2000 : 0)); + + throw ex; // re-throw to propagate to the top level (and cause window.onerror) + } + + report.subscribe = subscribe; + report.unsubscribe = unsubscribe; + return report; +}()); + +/** + * An object representing a single stack frame. + * @typedef {Object} StackFrame + * @property {string} url The JavaScript or HTML file URL. + * @property {string} func The function name, or empty for anonymous functions (if guessing did not work). + * @property {string[]?} args The arguments passed to the function, if known. + * @property {number=} line The line number, if known. + * @property {number=} column The column number, if known. + * @property {string[]} context An array of source code lines; the middle element corresponds to the correct line#. + * @memberof TraceKit + */ + +/** + * An object representing a JavaScript stack trace. + * @typedef {Object} StackTrace + * @property {string} name The name of the thrown exception. + * @property {string} message The exception error message. + * @property {TraceKit.StackFrame[]} stack An array of stack frames. + * @property {string} mode 'stack', 'stacktrace', 'multiline', 'callers', 'onerror', or 'failed' -- method used to collect the stack trace. + * @memberof TraceKit + */ + +/** + * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript + * + * Syntax: + * ```js + * s = TraceKit.computeStackTrace.ofCaller([depth]) + * s = TraceKit.computeStackTrace(exception) // consider using TraceKit.report instead (see below) + * ``` + * + * Supports: + * - Firefox: full stack trace with line numbers and unreliable column + * number on top frame + * - Opera 10: full stack trace with line and column numbers + * - Opera 9-: full stack trace with line numbers + * - Chrome: full stack trace with line and column numbers + * - Safari: line and column number for the topmost stacktrace element + * only + * - IE: no line numbers whatsoever + * + * Tries to guess names of anonymous functions by looking for assignments + * in the source code. In IE and Safari, we have to guess source file names + * by searching for function bodies inside all page scripts. This will not + * work for scripts that are loaded cross-domain. + * Here be dragons: some function names may be guessed incorrectly, and + * duplicate functions may be mismatched. + * + * TraceKit.computeStackTrace should only be used for tracing purposes. + * Logging of unhandled exceptions should be done with TraceKit.report, + * which builds on top of TraceKit.computeStackTrace and provides better + * IE support by utilizing the window.onerror event to retrieve information + * about the top of the stack. + * + * Note: In IE and Safari, no stack trace is recorded on the Error object, + * so computeStackTrace instead walks its *own* chain of callers. + * This means that: + * * in Safari, some methods may be missing from the stack trace; + * * in IE, the topmost function in the stack trace will always be the + * caller of computeStackTrace. + * + * This is okay for tracing (because you are likely to be calling + * computeStackTrace from the function you want to be the topmost element + * of the stack trace anyway), but not okay for logging unhandled + * exceptions (because your catch block will likely be far away from the + * inner function that actually caused the exception). + * + * Tracing example: + * ```js + * function trace(message) { + * var stackInfo = TraceKit.computeStackTrace.ofCaller(); + * var data = message + "\n"; + * for(var i in stackInfo.stack) { + * var item = stackInfo.stack[i]; + * data += (item.func || '[anonymous]') + "() in " + item.url + ":" + (item.line || '0') + "\n"; + * } + * if (window.console) + * console.info(data); + * else + * alert(data); + * } + * ``` + * @memberof TraceKit + * @namespace + */ +TraceKit.computeStackTrace = (function computeStackTraceWrapper() { + var debug = false, + sourceCache = {}; + + /** + * Attempts to retrieve source code via XMLHttpRequest, which is used + * to look up anonymous function names. + * @param {string} url URL of source code. + * @return {string} Source contents. + * @memberof TraceKit.computeStackTrace + */ + function loadSource(url) { + if (!TraceKit.remoteFetching) { //Only attempt request if remoteFetching is on. + return ''; + } + try { + var getXHR = function() { + try { + return new window.XMLHttpRequest(); + } catch (e) { + // explicitly bubble up the exception if not found + return new window.ActiveXObject('Microsoft.XMLHTTP'); + } + }; + + var request = getXHR(); + request.open('GET', url, false); + request.send(''); + return request.responseText; + } catch (e) { + return ''; + } + } + + /** + * Retrieves source code from the source code cache. + * @param {string} url URL of source code. + * @return {Array.<string>} Source contents. + * @memberof TraceKit.computeStackTrace + */ + function getSource(url) { + if (typeof url !== 'string') { + return []; + } + + if (!_has(sourceCache, url)) { + // URL needs to be able to fetched within the acceptable domain. Otherwise, + // cross-domain errors will be triggered. + /* + Regex matches: + 0 - Full Url + 1 - Protocol + 2 - Domain + 3 - Port (Useful for internal applications) + 4 - Path + */ + var source = ''; + var domain = ''; + try { domain = window.document.domain; } catch (e) { } + var match = /(.*)\:\/\/([^:\/]+)([:\d]*)\/{0,1}([\s\S]*)/.exec(url); + if (match && match[2] === domain) { + source = loadSource(url); + } + sourceCache[url] = source ? source.split('\n') : []; + } + + return sourceCache[url]; + } + + /** + * Tries to use an externally loaded copy of source code to determine + * the name of a function by looking at the name of the variable it was + * assigned to, if any. + * @param {string} url URL of source code. + * @param {(string|number)} lineNo Line number in source code. + * @return {string} The function name, if discoverable. + * @memberof TraceKit.computeStackTrace + */ + function guessFunctionName(url, lineNo) { + var reFunctionArgNames = /function ([^(]*)\(([^)]*)\)/, + reGuessFunction = /['"]?([0-9A-Za-z$_]+)['"]?\s*[:=]\s*(function|eval|new Function)/, + line = '', + maxLines = 10, + source = getSource(url), + m; + + if (!source.length) { + return UNKNOWN_FUNCTION; + } + + // Walk backwards from the first line in the function until we find the line which + // matches the pattern above, which is the function definition + for (var i = 0; i < maxLines; ++i) { + line = source[lineNo - i] + line; + + if (!_isUndefined(line)) { + if ((m = reGuessFunction.exec(line))) { + return m[1]; + } else if ((m = reFunctionArgNames.exec(line))) { + return m[1]; + } + } + } + + return UNKNOWN_FUNCTION; + } + + /** + * Retrieves the surrounding lines from where an exception occurred. + * @param {string} url URL of source code. + * @param {(string|number)} line Line number in source code to center around for context. + * @return {?Array.<string>} Lines of source code. + * @memberof TraceKit.computeStackTrace + */ + function gatherContext(url, line) { + var source = getSource(url); + + if (!source.length) { + return null; + } + + var context = [], + // linesBefore & linesAfter are inclusive with the offending line. + // if linesOfContext is even, there will be one extra line + // *before* the offending line. + linesBefore = Math.floor(TraceKit.linesOfContext / 2), + // Add one extra line if linesOfContext is odd + linesAfter = linesBefore + (TraceKit.linesOfContext % 2), + start = Math.max(0, line - linesBefore - 1), + end = Math.min(source.length, line + linesAfter - 1); + + line -= 1; // convert to 0-based index + + for (var i = start; i < end; ++i) { + if (!_isUndefined(source[i])) { + context.push(source[i]); + } + } + + return context.length > 0 ? context : null; + } + + /** + * Escapes special characters, except for whitespace, in a string to be + * used inside a regular expression as a string literal. + * @param {string} text The string. + * @return {string} The escaped string literal. + * @memberof TraceKit.computeStackTrace + */ + function escapeRegExp(text) { + return text.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g, '\\$&'); + } + + /** + * Escapes special characters in a string to be used inside a regular + * expression as a string literal. Also ensures that HTML entities will + * be matched the same as their literal friends. + * @param {string} body The string. + * @return {string} The escaped string. + * @memberof TraceKit.computeStackTrace + */ + function escapeCodeAsRegExpForMatchingInsideHTML(body) { + return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', '(?:>|>)').replace('&', '(?:&|&)').replace('"', '(?:"|")').replace(/\s+/g, '\\s+'); + } + + /** + * Determines where a code fragment occurs in the source code. + * @param {RegExp} re The function definition. + * @param {Array.<string>} urls A list of URLs to search. + * @return {?Object.<string, (string|number)>} An object containing + * the url, line, and column number of the defined function. + * @memberof TraceKit.computeStackTrace + */ + function findSourceInUrls(re, urls) { + var source, m; + for (var i = 0, j = urls.length; i < j; ++i) { + if ((source = getSource(urls[i])).length) { + source = source.join('\n'); + if ((m = re.exec(source))) { + + return { + 'url': urls[i], + 'line': source.substring(0, m.index).split('\n').length, + 'column': m.index - source.lastIndexOf('\n', m.index) - 1 + }; + } + } + } + + return null; + } + + /** + * Determines at which column a code fragment occurs on a line of the + * source code. + * @param {string} fragment The code fragment. + * @param {string} url The URL to search. + * @param {(string|number)} line The line number to examine. + * @return {?number} The column number. + * @memberof TraceKit.computeStackTrace + */ + function findSourceInLine(fragment, url, line) { + var source = getSource(url), + re = new RegExp('\\b' + escapeRegExp(fragment) + '\\b'), + m; + + line -= 1; + + if (source && source.length > line && (m = re.exec(source[line]))) { + return m.index; + } + + return null; + } + + /** + * Determines where a function was defined within the source code. + * @param {(Function|string)} func A function reference or serialized + * function definition. + * @return {?Object.<string, (string|number)>} An object containing + * the url, line, and column number of the defined function. + * @memberof TraceKit.computeStackTrace + */ + function findSourceByFunctionBody(func) { + if (_isUndefined(window && window.document)) { + return; + } + + var urls = [window.location.href], + scripts = window.document.getElementsByTagName('script'), + body, + code = '' + func, + codeRE = /^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/, + eventRE = /^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s*\}\s*$/, + re, + parts, + result; + + for (var i = 0; i < scripts.length; ++i) { + var script = scripts[i]; + if (script.src) { + urls.push(script.src); + } + } + + if (!(parts = codeRE.exec(code))) { + re = new RegExp(escapeRegExp(code).replace(/\s+/g, '\\s+')); + } + + // not sure if this is really necessary, but I don鈥檛 have a test + // corpus large enough to confirm that and it was in the original. + else { + var name = parts[1] ? '\\s+' + parts[1] : '', + args = parts[2].split(',').join('\\s*,\\s*'); + + body = escapeRegExp(parts[3]).replace(/;$/, ';?'); // semicolon is inserted if the function ends with a comment.replace(/\s+/g, '\\s+'); + re = new RegExp('function' + name + '\\s*\\(\\s*' + args + '\\s*\\)\\s*{\\s*' + body + '\\s*}'); + } + + // look for a normal function definition + if ((result = findSourceInUrls(re, urls))) { + return result; + } + + // look for an old-school event handler function + if ((parts = eventRE.exec(code))) { + var event = parts[1]; + body = escapeCodeAsRegExpForMatchingInsideHTML(parts[2]); + + // look for a function defined in HTML as an onXXX handler + re = new RegExp('on' + event + '=[\\\'"]\\s*' + body + '\\s*[\\\'"]', 'i'); + + if ((result = findSourceInUrls(re, urls[0]))) { + return result; + } + + // look for ??? + re = new RegExp(body); + + if ((result = findSourceInUrls(re, urls))) { + return result; + } + } + + return null; + } + + // Contents of Exception in various browsers. + // + // SAFARI: + // ex.message = Can't find variable: qq + // ex.line = 59 + // ex.sourceId = 580238192 + // ex.sourceURL = http://... + // ex.expressionBeginOffset = 96 + // ex.expressionCaretOffset = 98 + // ex.expressionEndOffset = 98 + // ex.name = ReferenceError + // + // FIREFOX: + // ex.message = qq is not defined + // ex.fileName = http://... + // ex.lineNumber = 59 + // ex.columnNumber = 69 + // ex.stack = ...stack trace... (see the example below) + // ex.name = ReferenceError + // + // CHROME: + // ex.message = qq is not defined + // ex.name = ReferenceError + // ex.type = not_defined + // ex.arguments = ['aa'] + // ex.stack = ...stack trace... + // + // INTERNET EXPLORER: + // ex.message = ... + // ex.name = ReferenceError + // + // OPERA: + // ex.message = ...message... (see the example below) + // ex.name = ReferenceError + // ex.opera#sourceloc = 11 (pretty much useless, duplicates the info in ex.message) + // ex.stacktrace = n/a; see 'opera:config#UserPrefs|Exceptions Have Stacktrace' + + /** + * Computes stack trace information from the stack property. + * Chrome and Gecko use this property. + * @param {Error} ex + * @return {?TraceKit.StackTrace} Stack trace information. + * @memberof TraceKit.computeStackTrace + */ + function computeStackTraceFromStackProp(ex) { + if (!ex.stack) { + return null; + } + + var chrome = /^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i, + gecko = /^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i, + winjs = /^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i, + + // Used to additionally parse URL/line/column from eval frames + isEval, + geckoEval = /(\S+) line (\d+)(?: > eval line \d+)* > eval/i, + chromeEval = /\((\S*)(?::(\d+))(?::(\d+))\)/, + + lines = ex.stack.split('\n'), + stack = [], + submatch, + parts, + element, + reference = /^(.*) is undefined$/.exec(ex.message); + + for (var i = 0, j = lines.length; i < j; ++i) { + if ((parts = chrome.exec(lines[i]))) { + var isNative = parts[2] && parts[2].indexOf('native') === 0; // start of line + isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line + if (isEval && (submatch = chromeEval.exec(parts[2]))) { + // throw out eval line/column and use top-most line/column number + parts[2] = submatch[1]; // url + parts[3] = submatch[2]; // line + parts[4] = submatch[3]; // column + } + element = { + 'url': !isNative ? parts[2] : null, + 'func': parts[1] || UNKNOWN_FUNCTION, + 'args': isNative ? [parts[2]] : [], + 'line': parts[3] ? +parts[3] : null, + 'column': parts[4] ? +parts[4] : null + }; + } else if ( parts = winjs.exec(lines[i]) ) { + element = { + 'url': parts[2], + 'func': parts[1] || UNKNOWN_FUNCTION, + 'args': [], + 'line': +parts[3], + 'column': parts[4] ? +parts[4] : null + }; + } else if ((parts = gecko.exec(lines[i]))) { + isEval = parts[3] && parts[3].indexOf(' > eval') > -1; + if (isEval && (submatch = geckoEval.exec(parts[3]))) { + // throw out eval line/column and use top-most line number + parts[3] = submatch[1]; + parts[4] = submatch[2]; + parts[5] = null; // no column when eval + } else if (i === 0 && !parts[5] && !_isUndefined(ex.columnNumber)) { + // FireFox uses this awesome columnNumber property for its top frame + // Also note, Firefox's column number is 0-based and everything else expects 1-based, + // so adding 1 + // NOTE: this hack doesn't work if top-most frame is eval + stack[0].column = ex.columnNumber + 1; + } + element = { + 'url': parts[3], + 'func': parts[1] || UNKNOWN_FUNCTION, + 'args': parts[2] ? parts[2].split(',') : [], + 'line': parts[4] ? +parts[4] : null, + 'column': parts[5] ? +parts[5] : null + }; + } else { + continue; + } + + if (!element.func && element.line) { + element.func = guessFunctionName(element.url, element.line); + } + + element.context = element.line ? gatherContext(element.url, element.line) : null; + stack.push(element); + } + + if (!stack.length) { + return null; + } + + if (stack[0] && stack[0].line && !stack[0].column && reference) { + stack[0].column = findSourceInLine(reference[1], stack[0].url, stack[0].line); + } + + return { + 'mode': 'stack', + 'name': ex.name, + 'message': ex.message, + 'stack': stack + }; + } + + /** + * Computes stack trace information from the stacktrace property. + * Opera 10+ uses this property. + * @param {Error} ex + * @return {?TraceKit.StackTrace} Stack trace information. + * @memberof TraceKit.computeStackTrace + */ + function computeStackTraceFromStacktraceProp(ex) { + // Access and store the stacktrace property before doing ANYTHING + // else to it because Opera is not very good at providing it + // reliably in other circumstances. + var stacktrace = ex.stacktrace; + if (!stacktrace) { + return; + } + + var opera10Regex = / line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i, + opera11Regex = / line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i, + lines = stacktrace.split('\n'), + stack = [], + parts; + + for (var line = 0; line < lines.length; line += 2) { + var element = null; + if ((parts = opera10Regex.exec(lines[line]))) { + element = { + 'url': parts[2], + 'line': +parts[1], + 'column': null, + 'func': parts[3], + 'args':[] + }; + } else if ((parts = opera11Regex.exec(lines[line]))) { + element = { + 'url': parts[6], + 'line': +parts[1], + 'column': +parts[2], + 'func': parts[3] || parts[4], + 'args': parts[5] ? parts[5].split(',') : [] + }; + } + + if (element) { + if (!element.func && element.line) { + element.func = guessFunctionName(element.url, element.line); + } + if (element.line) { + try { + element.context = gatherContext(element.url, element.line); + } catch (exc) {} + } + + if (!element.context) { + element.context = [lines[line + 1]]; + } + + stack.push(element); + } + } + + if (!stack.length) { + return null; + } + + return { + 'mode': 'stacktrace', + 'name': ex.name, + 'message': ex.message, + 'stack': stack + }; + } + + /** + * NOT TESTED. + * Computes stack trace information from an error message that includes + * the stack trace. + * Opera 9 and earlier use this method if the option to show stack + * traces is turned on in opera:config. + * @param {Error} ex + * @return {?TraceKit.StackTrace} Stack information. + * @memberof TraceKit.computeStackTrace + */ + function computeStackTraceFromOperaMultiLineMessage(ex) { + // TODO: Clean this function up + // Opera includes a stack trace into the exception message. An example is: + // + // Statement on line 3: Undefined variable: undefinedFunc + // Backtrace: + // Line 3 of linked script file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.js: In function zzz + // undefinedFunc(a); + // Line 7 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function yyy + // zzz(x, y, z); + // Line 3 of inline#1 script in file://localhost/Users/andreyvit/Projects/TraceKit/javascript-client/sample.html: In function xxx + // yyy(a, a, a); + // Line 1 of function script + // try { xxx('hi'); return false; } catch(ex) { TraceKit.report(ex); } + // ... + + var lines = ex.message.split('\n'); + if (lines.length < 4) { + return null; + } + + var lineRE1 = /^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i, + lineRE2 = /^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i, + lineRE3 = /^\s*Line (\d+) of function script\s*$/i, + stack = [], + scripts = (window && window.document && window.document.getElementsByTagName('script')), + inlineScriptBlocks = [], + parts; + + for (var s in scripts) { + if (_has(scripts, s) && !scripts[s].src) { + inlineScriptBlocks.push(scripts[s]); + } + } + + for (var line = 2; line < lines.length; line += 2) { + var item = null; + if ((parts = lineRE1.exec(lines[line]))) { + item = { + 'url': parts[2], + 'func': parts[3], + 'args': [], + 'line': +parts[1], + 'column': null + }; + } else if ((parts = lineRE2.exec(lines[line]))) { + item = { + 'url': parts[3], + 'func': parts[4], + 'args': [], + 'line': +parts[1], + 'column': null // TODO: Check to see if inline#1 (+parts[2]) points to the script number or column number. + }; + var relativeLine = (+parts[1]); // relative to the start of the <SCRIPT> block + var script = inlineScriptBlocks[parts[2] - 1]; + if (script) { + var source = getSource(item.url); + if (source) { + source = source.join('\n'); + var pos = source.indexOf(script.innerText); + if (pos >= 0) { + item.line = relativeLine + source.substring(0, pos).split('\n').length; + } + } + } + } else if ((parts = lineRE3.exec(lines[line]))) { + var url = window.location.href.replace(/#.*$/, ''); + var re = new RegExp(escapeCodeAsRegExpForMatchingInsideHTML(lines[line + 1])); + var src = findSourceInUrls(re, [url]); + item = { + 'url': url, + 'func': '', + 'args': [], + 'line': src ? src.line : parts[1], + 'column': null + }; + } + + if (item) { + if (!item.func) { + item.func = guessFunctionName(item.url, item.line); + } + var context = gatherContext(item.url, item.line); + var midline = (context ? context[Math.floor(context.length / 2)] : null); + if (context && midline.replace(/^\s*/, '') === lines[line + 1].replace(/^\s*/, '')) { + item.context = context; + } else { + // if (context) alert("Context mismatch. Correct midline:\n" + lines[i+1] + "\n\nMidline:\n" + midline + "\n\nContext:\n" + context.join("\n") + "\n\nURL:\n" + item.url); + item.context = [lines[line + 1]]; + } + stack.push(item); + } + } + if (!stack.length) { + return null; // could not parse multiline exception message as Opera stack trace + } + + return { + 'mode': 'multiline', + 'name': ex.name, + 'message': lines[0], + 'stack': stack + }; + } + + /** + * Adds information about the first frame to incomplete stack traces. + * Safari and IE require this to get complete data on the first frame. + * @param {TraceKit.StackTrace} stackInfo Stack trace information from + * one of the compute* methods. + * @param {string} url The URL of the script that caused an error. + * @param {(number|string)} lineNo The line number of the script that + * caused an error. + * @param {string=} message The error generated by the browser, which + * hopefully contains the name of the object that caused the error. + * @return {boolean} Whether or not the stack information was + * augmented. + * @memberof TraceKit.computeStackTrace + */ + function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, message) { + var initial = { + 'url': url, + 'line': lineNo + }; + + if (initial.url && initial.line) { + stackInfo.incomplete = false; + + if (!initial.func) { + initial.func = guessFunctionName(initial.url, initial.line); + } + + if (!initial.context) { + initial.context = gatherContext(initial.url, initial.line); + } + + var reference = / '([^']+)' /.exec(message); + if (reference) { + initial.column = findSourceInLine(reference[1], initial.url, initial.line); + } + + if (stackInfo.stack.length > 0) { + if (stackInfo.stack[0].url === initial.url) { + if (stackInfo.stack[0].line === initial.line) { + return false; // already in stack trace + } else if (!stackInfo.stack[0].line && stackInfo.stack[0].func === initial.func) { + stackInfo.stack[0].line = initial.line; + stackInfo.stack[0].context = initial.context; + return false; + } + } + } + + stackInfo.stack.unshift(initial); + stackInfo.partial = true; + return true; + } else { + stackInfo.incomplete = true; + } + + return false; + } + + /** + * Computes stack trace information by walking the arguments.caller + * chain at the time the exception occurred. This will cause earlier + * frames to be missed but is the only way to get any stack trace in + * Safari and IE. The top frame is restored by + * {@link augmentStackTraceWithInitialElement}. + * @param {Error} ex + * @return {TraceKit.StackTrace=} Stack trace information. + * @memberof TraceKit.computeStackTrace + */ + function computeStackTraceByWalkingCallerChain(ex, depth) { + var functionName = /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i, + stack = [], + funcs = {}, + recursion = false, + parts, + item, + source; + + for (var curr = computeStackTraceByWalkingCallerChain.caller; curr && !recursion; curr = curr.caller) { + if (curr === computeStackTrace || curr === TraceKit.report) { + continue; + } + + item = { + 'url': null, + 'func': UNKNOWN_FUNCTION, + 'args': [], + 'line': null, + 'column': null + }; + + if (curr.name) { + item.func = curr.name; + } else if ((parts = functionName.exec(curr.toString()))) { + item.func = parts[1]; + } + + if (typeof item.func === 'undefined') { + try { + item.func = parts.input.substring(0, parts.input.indexOf('{')); + } catch (e) { } + } + + if ((source = findSourceByFunctionBody(curr))) { + item.url = source.url; + item.line = source.line; + + if (item.func === UNKNOWN_FUNCTION) { + item.func = guessFunctionName(item.url, item.line); + } + + var reference = / '([^']+)' /.exec(ex.message || ex.description); + if (reference) { + item.column = findSourceInLine(reference[1], source.url, source.line); + } + } + + if (funcs['' + curr]) { + recursion = true; + }else{ + funcs['' + curr] = true; + } + + stack.push(item); + } + + if (depth) { + stack.splice(0, depth); + } + + var result = { + 'mode': 'callers', + 'name': ex.name, + 'message': ex.message, + 'stack': stack + }; + augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fileName, ex.line || ex.lineNumber, ex.message || ex.description); + return result; + } + + /** + * Computes a stack trace for an exception. + * @param {Error} ex + * @param {(string|number)=} depth + * @memberof TraceKit.computeStackTrace + */ + function computeStackTrace(ex, depth) { + var stack = null; + depth = (depth == null ? 0 : +depth); + + try { + // This must be tried first because Opera 10 *destroys* + // its stacktrace property if you try to access the stack + // property first!! + stack = computeStackTraceFromStacktraceProp(ex); + if (stack) { + return stack; + } + } catch (e) { + if (debug) { + throw e; + } + } + + try { + stack = computeStackTraceFromStackProp(ex); + if (stack) { + return stack; + } + } catch (e) { + if (debug) { + throw e; + } + } + + try { + stack = computeStackTraceFromOperaMultiLineMessage(ex); + if (stack) { + return stack; + } + } catch (e) { + if (debug) { + throw e; + } + } + + try { + stack = computeStackTraceByWalkingCallerChain(ex, depth + 1); + if (stack) { + return stack; + } + } catch (e) { + if (debug) { + throw e; + } + } + + return { + 'name': ex.name, + 'message': ex.message, + 'mode': 'failed' + }; + } + + /** + * Logs a stacktrace starting from the previous call and working down. + * @param {(number|string)=} depth How many frames deep to trace. + * @return {TraceKit.StackTrace} Stack trace information. + * @memberof TraceKit.computeStackTrace + */ + function computeStackTraceOfCaller(depth) { + depth = (depth == null ? 0 : +depth) + 1; // "+ 1" because "ofCaller" should drop one frame + try { + throw new Error(); + } catch (ex) { + return computeStackTrace(ex, depth + 1); + } + } + + computeStackTrace.augmentStackTraceWithInitialElement = augmentStackTraceWithInitialElement; + computeStackTrace.computeStackTraceFromStackProp = computeStackTraceFromStackProp; + computeStackTrace.guessFunctionName = guessFunctionName; + computeStackTrace.gatherContext = gatherContext; + computeStackTrace.ofCaller = computeStackTraceOfCaller; + computeStackTrace.getSource = getSource; + + return computeStackTrace; +}()); + +/** + * Extends support for global error handling for asynchronous browser + * functions. Adopted from Closure Library's errorhandler.js + * @memberof TraceKit + */ +TraceKit.extendToAsynchronousCallbacks = function () { + var _helper = function _helper(fnName) { + var originalFn = window[fnName]; + window[fnName] = function traceKitAsyncExtension() { + // Make a copy of the arguments + var args = _slice.call(arguments); + var originalCallback = args[0]; + if (typeof (originalCallback) === 'function') { + args[0] = TraceKit.wrap(originalCallback); + } + // IE < 9 doesn't support .call/.apply on setInterval/setTimeout, but it + // also only supports 2 argument and doesn't care what "this" is, so we + // can just call the original function directly. + if (originalFn.apply) { + return originalFn.apply(this, args); + } else { + return originalFn(args[0], args[1]); + } + }; + }; + + _helper('setTimeout'); + _helper('setInterval'); +}; + +//Default options: +if (!TraceKit.remoteFetching) { + TraceKit.remoteFetching = true; +} +if (!TraceKit.collectWindowErrors) { + TraceKit.collectWindowErrors = true; +} +if (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) { + // 5 lines before, the offending line, 5 lines after + TraceKit.linesOfContext = 11; +} + +// UMD export +if (typeof define === 'function' && define.amd) { + define('TraceKit', [], TraceKit); +} else if (typeof module !== 'undefined' && module.exports && window.module !== module) { + module.exports = TraceKit; +} else { + window.TraceKit = TraceKit; +} + +}(typeof window !== 'undefined' ? window : global)); diff --git a/phpMyAdmin/js/vendor/u2f-api-polyfill.js b/phpMyAdmin/js/vendor/u2f-api-polyfill.js new file mode 100755 index 0000000..8fbf271 --- /dev/null +++ b/phpMyAdmin/js/vendor/u2f-api-polyfill.js @@ -0,0 +1,754 @@ + +//Copyright 2014-2015 Google Inc. All rights reserved. + +//Use of this source code is governed by a BSD-style +//license that can be found in the LICENSE file or at +//https://developers.google.com/open-source/licenses/bsd + +/** + * @fileoverview The U2F api. + */ +'use strict'; + +(function (){ + var isChrome = 'chrome' in window && window.navigator.userAgent.indexOf('Edge') < 0; + if ('u2f' in window || !isChrome) { + return; + } + + /** Namespace for the U2F api. + * @type {Object} + */ + var u2f = window.u2f = {}; + + /** + * FIDO U2F Javascript API Version + * @number + */ + var js_api_version; + + /** + * The U2F extension id + * @const {string} + */ + // The Chrome packaged app extension ID. + // Uncomment this if you want to deploy a server instance that uses + // the package Chrome app and does not require installing the U2F Chrome extension. + u2f.EXTENSION_ID = 'kmendfapggjehodndflmmgagdbamhnfd'; + // The U2F Chrome extension ID. + // Uncomment this if you want to deploy a server instance that uses + // the U2F Chrome extension to authenticate. + // u2f.EXTENSION_ID = 'pfboblefjcgdjicmnffhdgionmgcdmne'; + + + /** + * Message types for messsages to/from the extension + * @const + * @enum {string} + */ + u2f.MessageTypes = { + 'U2F_REGISTER_REQUEST': 'u2f_register_request', + 'U2F_REGISTER_RESPONSE': 'u2f_register_response', + 'U2F_SIGN_REQUEST': 'u2f_sign_request', + 'U2F_SIGN_RESPONSE': 'u2f_sign_response', + 'U2F_GET_API_VERSION_REQUEST': 'u2f_get_api_version_request', + 'U2F_GET_API_VERSION_RESPONSE': 'u2f_get_api_version_response' + }; + + + /** + * Response status codes + * @const + * @enum {number} + */ + u2f.ErrorCodes = { + 'OK': 0, + 'OTHER_ERROR': 1, + 'BAD_REQUEST': 2, + 'CONFIGURATION_UNSUPPORTED': 3, + 'DEVICE_INELIGIBLE': 4, + 'TIMEOUT': 5 + }; + + + /** + * A message for registration requests + * @typedef {{ + * type: u2f.MessageTypes, + * appId: ?string, + * timeoutSeconds: ?number, + * requestId: ?number + * }} + */ + u2f.U2fRequest; + + + /** + * A message for registration responses + * @typedef {{ + * type: u2f.MessageTypes, + * responseData: (u2f.Error | u2f.RegisterResponse | u2f.SignResponse), + * requestId: ?number + * }} + */ + u2f.U2fResponse; + + + /** + * An error object for responses + * @typedef {{ + * errorCode: u2f.ErrorCodes, + * errorMessage: ?string + * }} + */ + u2f.Error; + + /** + * Data object for a single sign request. + * @typedef {enum {BLUETOOTH_RADIO, BLUETOOTH_LOW_ENERGY, USB, NFC}} + */ + u2f.Transport; + + + /** + * Data object for a single sign request. + * @typedef {Array<u2f.Transport>} + */ + u2f.Transports; + + /** + * Data object for a single sign request. + * @typedef {{ + * version: string, + * challenge: string, + * keyHandle: string, + * appId: string + * }} + */ + u2f.SignRequest; + + + /** + * Data object for a sign response. + * @typedef {{ + * keyHandle: string, + * signatureData: string, + * clientData: string + * }} + */ + u2f.SignResponse; + + + /** + * Data object for a registration request. + * @typedef {{ + * version: string, + * challenge: string + * }} + */ + u2f.RegisterRequest; + + + /** + * Data object for a registration response. + * @typedef {{ + * version: string, + * keyHandle: string, + * transports: Transports, + * appId: string + * }} + */ + u2f.RegisterResponse; + + + /** + * Data object for a registered key. + * @typedef {{ + * version: string, + * keyHandle: string, + * transports: ?Transports, + * appId: ?string + * }} + */ + u2f.RegisteredKey; + + + /** + * Data object for a get API register response. + * @typedef {{ + * js_api_version: number + * }} + */ + u2f.GetJsApiVersionResponse; + + + //Low level MessagePort API support + + /** + * Sets up a MessagePort to the U2F extension using the + * available mechanisms. + * @param {function((MessagePort|u2f.WrappedChromeRuntimePort_))} callback + */ + u2f.getMessagePort = function(callback) { + if (typeof chrome != 'undefined' && chrome.runtime) { + // The actual message here does not matter, but we need to get a reply + // for the callback to run. Thus, send an empty signature request + // in order to get a failure response. + var msg = { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + signRequests: [] + }; + chrome.runtime.sendMessage(u2f.EXTENSION_ID, msg, function() { + if (!chrome.runtime.lastError) { + // We are on a whitelisted origin and can talk directly + // with the extension. + u2f.getChromeRuntimePort_(callback); + } else { + // chrome.runtime was available, but we couldn't message + // the extension directly, use iframe + u2f.getIframePort_(callback); + } + }); + } else if (u2f.isAndroidChrome_()) { + u2f.getAuthenticatorPort_(callback); + } else if (u2f.isIosChrome_()) { + u2f.getIosPort_(callback); + } else { + // chrome.runtime was not available at all, which is normal + // when this origin doesn't have access to any extensions. + u2f.getIframePort_(callback); + } + }; + + /** + * Detect chrome running on android based on the browser's useragent. + * @private + */ + u2f.isAndroidChrome_ = function() { + var userAgent = navigator.userAgent; + return userAgent.indexOf('Chrome') != -1 && + userAgent.indexOf('Android') != -1; + }; + + /** + * Detect chrome running on iOS based on the browser's platform. + * @private + */ + u2f.isIosChrome_ = function() { + return ["iPhone", "iPad", "iPod"].indexOf(navigator.platform) > -1; + }; + + /** + * Connects directly to the extension via chrome.runtime.connect. + * @param {function(u2f.WrappedChromeRuntimePort_)} callback + * @private + */ + u2f.getChromeRuntimePort_ = function(callback) { + var port = chrome.runtime.connect(u2f.EXTENSION_ID, + {'includeTlsChannelId': true}); + setTimeout(function() { + callback(new u2f.WrappedChromeRuntimePort_(port)); + }, 0); + }; + + /** + * Return a 'port' abstraction to the Authenticator app. + * @param {function(u2f.WrappedAuthenticatorPort_)} callback + * @private + */ + u2f.getAuthenticatorPort_ = function(callback) { + setTimeout(function() { + callback(new u2f.WrappedAuthenticatorPort_()); + }, 0); + }; + + /** + * Return a 'port' abstraction to the iOS client app. + * @param {function(u2f.WrappedIosPort_)} callback + * @private + */ + u2f.getIosPort_ = function(callback) { + setTimeout(function() { + callback(new u2f.WrappedIosPort_()); + }, 0); + }; + + /** + * A wrapper for chrome.runtime.Port that is compatible with MessagePort. + * @param {Port} port + * @constructor + * @private + */ + u2f.WrappedChromeRuntimePort_ = function(port) { + this.port_ = port; + }; + + /** + * Format and return a sign request compliant with the JS API version supported by the extension. + * @param {Array<u2f.SignRequest>} signRequests + * @param {number} timeoutSeconds + * @param {number} reqId + * @return {Object} + */ + u2f.formatSignRequest_ = + function(appId, challenge, registeredKeys, timeoutSeconds, reqId) { + if (js_api_version === undefined || js_api_version < 1.1) { + // Adapt request to the 1.0 JS API + var signRequests = []; + for (var i = 0; i < registeredKeys.length; i++) { + signRequests[i] = { + version: registeredKeys[i].version, + challenge: challenge, + keyHandle: registeredKeys[i].keyHandle, + appId: appId + }; + } + return { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + signRequests: signRequests, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; + } + // JS 1.1 API + return { + type: u2f.MessageTypes.U2F_SIGN_REQUEST, + appId: appId, + challenge: challenge, + registeredKeys: registeredKeys, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; + }; + + /** + * Format and return a register request compliant with the JS API version supported by the extension.. + * @param {Array<u2f.SignRequest>} signRequests + * @param {Array<u2f.RegisterRequest>} signRequests + * @param {number} timeoutSeconds + * @param {number} reqId + * @return {Object} + */ + u2f.formatRegisterRequest_ = + function(appId, registeredKeys, registerRequests, timeoutSeconds, reqId) { + if (js_api_version === undefined || js_api_version < 1.1) { + // Adapt request to the 1.0 JS API + for (var i = 0; i < registerRequests.length; i++) { + registerRequests[i].appId = appId; + } + var signRequests = []; + for (var i = 0; i < registeredKeys.length; i++) { + signRequests[i] = { + version: registeredKeys[i].version, + challenge: registerRequests[0], + keyHandle: registeredKeys[i].keyHandle, + appId: appId + }; + } + return { + type: u2f.MessageTypes.U2F_REGISTER_REQUEST, + signRequests: signRequests, + registerRequests: registerRequests, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; + } + // JS 1.1 API + return { + type: u2f.MessageTypes.U2F_REGISTER_REQUEST, + appId: appId, + registerRequests: registerRequests, + registeredKeys: registeredKeys, + timeoutSeconds: timeoutSeconds, + requestId: reqId + }; + }; + + + /** + * Posts a message on the underlying channel. + * @param {Object} message + */ + u2f.WrappedChromeRuntimePort_.prototype.postMessage = function(message) { + this.port_.postMessage(message); + }; + + + /** + * Emulates the HTML 5 addEventListener interface. Works only for the + * onmessage event, which is hooked up to the chrome.runtime.Port.onMessage. + * @param {string} eventName + * @param {function({data: Object})} handler + */ + u2f.WrappedChromeRuntimePort_.prototype.addEventListener = + function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name == 'message' || name == 'onmessage') { + this.port_.onMessage.addListener(function(message) { + // Emulate a minimal MessageEvent object + handler({'data': message}); + }); + } else { + console.error('WrappedChromeRuntimePort only supports onMessage'); + } + }; + + /** + * Wrap the Authenticator app with a MessagePort interface. + * @constructor + * @private + */ + u2f.WrappedAuthenticatorPort_ = function() { + this.requestId_ = -1; + this.requestObject_ = null; + } + + /** + * Launch the Authenticator intent. + * @param {Object} message + */ + u2f.WrappedAuthenticatorPort_.prototype.postMessage = function(message) { + var intentUrl = + u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_ + + ';S.request=' + encodeURIComponent(JSON.stringify(message)) + + ';end'; + document.location = intentUrl; + }; + + /** + * Tells what type of port this is. + * @return {String} port type + */ + u2f.WrappedAuthenticatorPort_.prototype.getPortType = function() { + return "WrappedAuthenticatorPort_"; + }; + + + /** + * Emulates the HTML 5 addEventListener interface. + * @param {string} eventName + * @param {function({data: Object})} handler + */ + u2f.WrappedAuthenticatorPort_.prototype.addEventListener = function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name == 'message') { + var self = this; + /* Register a callback to that executes when + * chrome injects the response. */ + window.addEventListener( + 'message', self.onRequestUpdate_.bind(self, handler), false); + } else { + console.error('WrappedAuthenticatorPort only supports message'); + } + }; + + /** + * Callback invoked when a response is received from the Authenticator. + * @param function({data: Object}) callback + * @param {Object} message message Object + */ + u2f.WrappedAuthenticatorPort_.prototype.onRequestUpdate_ = + function(callback, message) { + var messageObject = JSON.parse(message.data); + var intentUrl = messageObject['intentURL']; + + var errorCode = messageObject['errorCode']; + var responseObject = null; + if (messageObject.hasOwnProperty('data')) { + responseObject = /** @type {Object} */ ( + JSON.parse(messageObject['data'])); + } + + callback({'data': responseObject}); + }; + + /** + * Base URL for intents to Authenticator. + * @const + * @private + */ + u2f.WrappedAuthenticatorPort_.INTENT_URL_BASE_ = + 'intent:#Intent;action=com.google.android.apps.authenticator.AUTHENTICATE'; + + /** + * Wrap the iOS client app with a MessagePort interface. + * @constructor + * @private + */ + u2f.WrappedIosPort_ = function() {}; + + /** + * Launch the iOS client app request + * @param {Object} message + */ + u2f.WrappedIosPort_.prototype.postMessage = function(message) { + var str = JSON.stringify(message); + var url = "u2f://auth?" + encodeURI(str); + location.replace(url); + }; + + /** + * Tells what type of port this is. + * @return {String} port type + */ + u2f.WrappedIosPort_.prototype.getPortType = function() { + return "WrappedIosPort_"; + }; + + /** + * Emulates the HTML 5 addEventListener interface. + * @param {string} eventName + * @param {function({data: Object})} handler + */ + u2f.WrappedIosPort_.prototype.addEventListener = function(eventName, handler) { + var name = eventName.toLowerCase(); + if (name !== 'message') { + console.error('WrappedIosPort only supports message'); + } + }; + + /** + * Sets up an embedded trampoline iframe, sourced from the extension. + * @param {function(MessagePort)} callback + * @private + */ + u2f.getIframePort_ = function(callback) { + // Create the iframe + var iframeOrigin = 'chrome-extension://' + u2f.EXTENSION_ID; + var iframe = document.createElement('iframe'); + iframe.src = iframeOrigin + '/u2f-comms.html'; + iframe.setAttribute('style', 'display:none'); + document.body.appendChild(iframe); + + var channel = new MessageChannel(); + var ready = function(message) { + if (message.data == 'ready') { + channel.port1.removeEventListener('message', ready); + callback(channel.port1); + } else { + console.error('First event on iframe port was not "ready"'); + } + }; + channel.port1.addEventListener('message', ready); + channel.port1.start(); + + iframe.addEventListener('load', function() { + // Deliver the port to the iframe and initialize + iframe.contentWindow.postMessage('init', iframeOrigin, [channel.port2]); + }); + }; + + + //High-level JS API + + /** + * Default extension response timeout in seconds. + * @const + */ + u2f.EXTENSION_TIMEOUT_SEC = 30; + + /** + * A singleton instance for a MessagePort to the extension. + * @type {MessagePort|u2f.WrappedChromeRuntimePort_} + * @private + */ + u2f.port_ = null; + + /** + * Callbacks waiting for a port + * @type {Array<function((MessagePort|u2f.WrappedChromeRuntimePort_))>} + * @private + */ + u2f.waitingForPort_ = []; + + /** + * A counter for requestIds. + * @type {number} + * @private + */ + u2f.reqCounter_ = 0; + + /** + * A map from requestIds to client callbacks + * @type {Object.<number,(function((u2f.Error|u2f.RegisterResponse)) + * |function((u2f.Error|u2f.SignResponse)))>} + * @private + */ + u2f.callbackMap_ = {}; + + /** + * Creates or retrieves the MessagePort singleton to use. + * @param {function((MessagePort|u2f.WrappedChromeRuntimePort_))} callback + * @private + */ + u2f.getPortSingleton_ = function(callback) { + if (u2f.port_) { + callback(u2f.port_); + } else { + if (u2f.waitingForPort_.length == 0) { + u2f.getMessagePort(function(port) { + u2f.port_ = port; + u2f.port_.addEventListener('message', + /** @type {function(Event)} */ (u2f.responseHandler_)); + + // Careful, here be async callbacks. Maybe. + while (u2f.waitingForPort_.length) + u2f.waitingForPort_.shift()(u2f.port_); + }); + } + u2f.waitingForPort_.push(callback); + } + }; + + /** + * Handles response messages from the extension. + * @param {MessageEvent.<u2f.Response>} message + * @private + */ + u2f.responseHandler_ = function(message) { + var response = message.data; + var reqId = response['requestId']; + if (!reqId || !u2f.callbackMap_[reqId]) { + console.error('Unknown or missing requestId in response.'); + return; + } + var cb = u2f.callbackMap_[reqId]; + delete u2f.callbackMap_[reqId]; + cb(response['responseData']); + }; + + /** + * Dispatches an array of sign requests to available U2F tokens. + * If the JS API version supported by the extension is unknown, it first sends a + * message to the extension to find out the supported API version and then it sends + * the sign request. + * @param {string=} appId + * @param {string=} challenge + * @param {Array<u2f.RegisteredKey>} registeredKeys + * @param {function((u2f.Error|u2f.SignResponse))} callback + * @param {number=} opt_timeoutSeconds + */ + u2f.sign = function(appId, challenge, registeredKeys, callback, opt_timeoutSeconds) { + if (js_api_version === undefined) { + // Send a message to get the extension to JS API version, then send the actual sign request. + u2f.getApiVersion( + function (response) { + js_api_version = response['js_api_version'] === undefined ? 0 : response['js_api_version']; + console.log("Extension JS API Version: ", js_api_version); + u2f.sendSignRequest(appId, challenge, registeredKeys, callback, opt_timeoutSeconds); + }); + } else { + // We know the JS API version. Send the actual sign request in the supported API version. + u2f.sendSignRequest(appId, challenge, registeredKeys, callback, opt_timeoutSeconds); + } + }; + + /** + * Dispatches an array of sign requests to available U2F tokens. + * @param {string=} appId + * @param {string=} challenge + * @param {Array<u2f.RegisteredKey>} registeredKeys + * @param {function((u2f.Error|u2f.SignResponse))} callback + * @param {number=} opt_timeoutSeconds + */ + u2f.sendSignRequest = function(appId, challenge, registeredKeys, callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var timeoutSeconds = (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC); + var req = u2f.formatSignRequest_(appId, challenge, registeredKeys, timeoutSeconds, reqId); + port.postMessage(req); + }); + }; + + /** + * Dispatches register requests to available U2F tokens. An array of sign + * requests identifies already registered tokens. + * If the JS API version supported by the extension is unknown, it first sends a + * message to the extension to find out the supported API version and then it sends + * the register request. + * @param {string=} appId + * @param {Array<u2f.RegisterRequest>} registerRequests + * @param {Array<u2f.RegisteredKey>} registeredKeys + * @param {function((u2f.Error|u2f.RegisterResponse))} callback + * @param {number=} opt_timeoutSeconds + */ + u2f.register = function(appId, registerRequests, registeredKeys, callback, opt_timeoutSeconds) { + if (js_api_version === undefined) { + // Send a message to get the extension to JS API version, then send the actual register request. + u2f.getApiVersion( + function (response) { + js_api_version = response['js_api_version'] === undefined ? 0: response['js_api_version']; + console.log("Extension JS API Version: ", js_api_version); + u2f.sendRegisterRequest(appId, registerRequests, registeredKeys, + callback, opt_timeoutSeconds); + }); + } else { + // We know the JS API version. Send the actual register request in the supported API version. + u2f.sendRegisterRequest(appId, registerRequests, registeredKeys, + callback, opt_timeoutSeconds); + } + }; + + /** + * Dispatches register requests to available U2F tokens. An array of sign + * requests identifies already registered tokens. + * @param {string=} appId + * @param {Array<u2f.RegisterRequest>} registerRequests + * @param {Array<u2f.RegisteredKey>} registeredKeys + * @param {function((u2f.Error|u2f.RegisterResponse))} callback + * @param {number=} opt_timeoutSeconds + */ + u2f.sendRegisterRequest = function(appId, registerRequests, registeredKeys, callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var timeoutSeconds = (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC); + var req = u2f.formatRegisterRequest_( + appId, registeredKeys, registerRequests, timeoutSeconds, reqId); + port.postMessage(req); + }); + }; + + + /** + * Dispatches a message to the extension to find out the supported + * JS API version. + * If the user is on a mobile phone and is thus using Google Authenticator instead + * of the Chrome extension, don't send the request and simply return 0. + * @param {function((u2f.Error|u2f.GetJsApiVersionResponse))} callback + * @param {number=} opt_timeoutSeconds + */ + u2f.getApiVersion = function(callback, opt_timeoutSeconds) { + u2f.getPortSingleton_(function(port) { + // If we are using Android Google Authenticator or iOS client app, + // do not fire an intent to ask which JS API version to use. + if (port.getPortType) { + var apiVersion; + switch (port.getPortType()) { + case 'WrappedIosPort_': + case 'WrappedAuthenticatorPort_': + apiVersion = 1.1; + break; + + default: + apiVersion = 0; + break; + } + callback({ 'js_api_version': apiVersion }); + return; + } + var reqId = ++u2f.reqCounter_; + u2f.callbackMap_[reqId] = callback; + var req = { + type: u2f.MessageTypes.U2F_GET_API_VERSION_REQUEST, + timeoutSeconds: (typeof opt_timeoutSeconds !== 'undefined' ? + opt_timeoutSeconds : u2f.EXTENSION_TIMEOUT_SEC), + requestId: reqId + }; + port.postMessage(req); + }); + }; +})(); diff --git a/phpMyAdmin/js/vendor/zxcvbn.js b/phpMyAdmin/js/vendor/zxcvbn.js new file mode 100755 index 0000000..19599d7 --- /dev/null +++ b/phpMyAdmin/js/vendor/zxcvbn.js @@ -0,0 +1,27 @@ +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.zxcvbn = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ +var adjacency_graphs;adjacency_graphs={qwerty:{"!":["`~",null,null,"2@","qQ",null],'"':[";:","[{","]}",null,null,"/?"],"#":["2@",null,null,"4$","eE","wW"],$:["3#",null,null,"5%","rR","eE"],"%":["4$",null,null,"6^","tT","rR"],"&":["6^",null,null,"8*","uU","yY"],"'":[";:","[{","]}",null,null,"/?"],"(":["8*",null,null,"0)","oO","iI"],")":["9(",null,null,"-_","pP","oO"],"*":["7&",null,null,"9(","iI","uU"],"+":["-_",null,null,null,"]}","[{"],",":["mM","kK","lL",".>",null,null],"-":["0)",null,null,"=+","[{","pP"],".":[",<","lL",";:","/?",null,null],"/":[".>",";:","'\"",null,null,null],0:["9(",null,null,"-_","pP","oO"],1:["`~",null,null,"2@","qQ",null],2:["1!",null,null,"3#","wW","qQ"],3:["2@",null,null,"4$","eE","wW"],4:["3#",null,null,"5%","rR","eE"],5:["4$",null,null,"6^","tT","rR"],6:["5%",null,null,"7&","yY","tT"],7:["6^",null,null,"8*","uU","yY"],8:["7&",null,null,"9(","iI","uU"],9:["8*",null,null,"0)","oO","iI"],":":["lL","pP","[{","'\"","/?",".>"],";":["lL","pP","[{","'\"","/?",".>"],"<":["mM","kK","lL",".>",null,null],"=":["-_",null,null,null,"]}","[{"],">":[",<","lL",";:","/?",null,null],"?":[".>",";:","'\"",null,null,null],"@":["1!",null,null,"3#","wW","qQ"],A:[null,"qQ","wW","sS","zZ",null],B:["vV","gG","hH","nN",null,null],C:["xX","dD","fF","vV",null,null],D:["sS","eE","rR","fF","cC","xX"],E:["wW","3#","4$","rR","dD","sS"],F:["dD","rR","tT","gG","vV","cC"],G:["fF","tT","yY","hH","bB","vV"],H:["gG","yY","uU","jJ","nN","bB"],I:["uU","8*","9(","oO","kK","jJ"],J:["hH","uU","iI","kK","mM","nN"],K:["jJ","iI","oO","lL",",<","mM"],L:["kK","oO","pP",";:",".>",",<"],M:["nN","jJ","kK",",<",null,null],N:["bB","hH","jJ","mM",null,null],O:["iI","9(","0)","pP","lL","kK"],P:["oO","0)","-_","[{",";:","lL"],Q:[null,"1!","2@","wW","aA",null],R:["eE","4$","5%","tT","fF","dD"],S:["aA","wW","eE","dD","xX","zZ"],T:["rR","5%","6^","yY","gG","fF"],U:["yY","7&","8*","iI","jJ","hH"],V:["cC","fF","gG","bB",null,null],W:["qQ","2@","3#","eE","sS","aA"],X:["zZ","sS","dD","cC",null,null],Y:["tT","6^","7&","uU","hH","gG"],Z:[null,"aA","sS","xX",null,null],"[":["pP","-_","=+","]}","'\"",";:"],"\\":["]}",null,null,null,null,null],"]":["[{","=+",null,"\\|",null,"'\""],"^":["5%",null,null,"7&","yY","tT"],_:["0)",null,null,"=+","[{","pP"],"`":[null,null,null,"1!",null,null],a:[null,"qQ","wW","sS","zZ",null],b:["vV","gG","hH","nN",null,null],c:["xX","dD","fF","vV",null,null],d:["sS","eE","rR","fF","cC","xX"],e:["wW","3#","4$","rR","dD","sS"],f:["dD","rR","tT","gG","vV","cC"],g:["fF","tT","yY","hH","bB","vV"],h:["gG","yY","uU","jJ","nN","bB"],i:["uU","8*","9(","oO","kK","jJ"],j:["hH","uU","iI","kK","mM","nN"],k:["jJ","iI","oO","lL",",<","mM"],l:["kK","oO","pP",";:",".>",",<"],m:["nN","jJ","kK",",<",null,null],n:["bB","hH","jJ","mM",null,null],o:["iI","9(","0)","pP","lL","kK"],p:["oO","0)","-_","[{",";:","lL"],q:[null,"1!","2@","wW","aA",null],r:["eE","4$","5%","tT","fF","dD"],s:["aA","wW","eE","dD","xX","zZ"],t:["rR","5%","6^","yY","gG","fF"],u:["yY","7&","8*","iI","jJ","hH"],v:["cC","fF","gG","bB",null,null],w:["qQ","2@","3#","eE","sS","aA"],x:["zZ","sS","dD","cC",null,null],y:["tT","6^","7&","uU","hH","gG"],z:[null,"aA","sS","xX",null,null],"{":["pP","-_","=+","]}","'\"",";:"],"|":["]}",null,null,null,null,null],"}":["[{","=+",null,"\\|",null,"'\""],"~":[null,null,null,"1!",null,null]},dvorak:{"!":["`~",null,null,"2@","'\"",null],'"':[null,"1!","2@",",<","aA",null],"#":["2@",null,null,"4$",".>",",<"],$:["3#",null,null,"5%","pP",".>"],"%":["4$",null,null,"6^","yY","pP"],"&":["6^",null,null,"8*","gG","fF"],"'":[null,"1!","2@",",<","aA",null],"(":["8*",null,null,"0)","rR","cC"],")":["9(",null,null,"[{","lL","rR"],"*":["7&",null,null,"9(","cC","gG"],"+":["/?","]}",null,"\\|",null,"-_"],",":["'\"","2@","3#",".>","oO","aA"],"-":["sS","/?","=+",null,null,"zZ"],".":[",<","3#","4$","pP","eE","oO"],"/":["lL","[{","]}","=+","-_","sS"],0:["9(",null,null,"[{","lL","rR"],1:["`~",null,null,"2@","'\"",null],2:["1!",null,null,"3#",",<","'\""],3:["2@",null,null,"4$",".>",",<"],4:["3#",null,null,"5%","pP",".>"],5:["4$",null,null,"6^","yY","pP"],6:["5%",null,null,"7&","fF","yY"],7:["6^",null,null,"8*","gG","fF"],8:["7&",null,null,"9(","cC","gG"],9:["8*",null,null,"0)","rR","cC"],":":[null,"aA","oO","qQ",null,null],";":[null,"aA","oO","qQ",null,null],"<":["'\"","2@","3#",".>","oO","aA"],"=":["/?","]}",null,"\\|",null,"-_"],">":[",<","3#","4$","pP","eE","oO"],"?":["lL","[{","]}","=+","-_","sS"],"@":["1!",null,null,"3#",",<","'\""],A:[null,"'\"",",<","oO",";:",null],B:["xX","dD","hH","mM",null,null],C:["gG","8*","9(","rR","tT","hH"],D:["iI","fF","gG","hH","bB","xX"],E:["oO",".>","pP","uU","jJ","qQ"],F:["yY","6^","7&","gG","dD","iI"],G:["fF","7&","8*","cC","hH","dD"],H:["dD","gG","cC","tT","mM","bB"],I:["uU","yY","fF","dD","xX","kK"],J:["qQ","eE","uU","kK",null,null],K:["jJ","uU","iI","xX",null,null],L:["rR","0)","[{","/?","sS","nN"],M:["bB","hH","tT","wW",null,null],N:["tT","rR","lL","sS","vV","wW"],O:["aA",",<",".>","eE","qQ",";:"],P:[".>","4$","5%","yY","uU","eE"],Q:[";:","oO","eE","jJ",null,null],R:["cC","9(","0)","lL","nN","tT"],S:["nN","lL","/?","-_","zZ","vV"],T:["hH","cC","rR","nN","wW","mM"],U:["eE","pP","yY","iI","kK","jJ"],V:["wW","nN","sS","zZ",null,null],W:["mM","tT","nN","vV",null,null],X:["kK","iI","dD","bB",null,null],Y:["pP","5%","6^","fF","iI","uU"],Z:["vV","sS","-_",null,null,null],"[":["0)",null,null,"]}","/?","lL"],"\\":["=+",null,null,null,null,null],"]":["[{",null,null,null,"=+","/?"],"^":["5%",null,null,"7&","fF","yY"],_:["sS","/?","=+",null,null,"zZ"],"`":[null,null,null,"1!",null,null],a:[null,"'\"",",<","oO",";:",null],b:["xX","dD","hH","mM",null,null],c:["gG","8*","9(","rR","tT","hH"],d:["iI","fF","gG","hH","bB","xX"],e:["oO",".>","pP","uU","jJ","qQ"],f:["yY","6^","7&","gG","dD","iI"],g:["fF","7&","8*","cC","hH","dD"],h:["dD","gG","cC","tT","mM","bB"],i:["uU","yY","fF","dD","xX","kK"],j:["qQ","eE","uU","kK",null,null],k:["jJ","uU","iI","xX",null,null],l:["rR","0)","[{","/?","sS","nN"],m:["bB","hH","tT","wW",null,null],n:["tT","rR","lL","sS","vV","wW"],o:["aA",",<",".>","eE","qQ",";:"],p:[".>","4$","5%","yY","uU","eE"],q:[";:","oO","eE","jJ",null,null],r:["cC","9(","0)","lL","nN","tT"],s:["nN","lL","/?","-_","zZ","vV"],t:["hH","cC","rR","nN","wW","mM"],u:["eE","pP","yY","iI","kK","jJ"],v:["wW","nN","sS","zZ",null,null],w:["mM","tT","nN","vV",null,null],x:["kK","iI","dD","bB",null,null],y:["pP","5%","6^","fF","iI","uU"],z:["vV","sS","-_",null,null,null],"{":["0)",null,null,"]}","/?","lL"],"|":["=+",null,null,null,null,null],"}":["[{",null,null,null,"=+","/?"],"~":[null,null,null,"1!",null,null]},keypad:{"*":["/",null,null,null,"-","+","9","8"],"+":["9","*","-",null,null,null,null,"6"],"-":["*",null,null,null,null,null,"+","9"],".":["0","2","3",null,null,null,null,null],"/":[null,null,null,null,"*","9","8","7"],0:[null,"1","2","3",".",null,null,null],1:[null,null,"4","5","2","0",null,null],2:["1","4","5","6","3",".","0",null],3:["2","5","6",null,null,null,".","0"],4:[null,null,"7","8","5","2","1",null],5:["4","7","8","9","6","3","2","1"],6:["5","8","9","+",null,null,"3","2"],7:[null,null,null,"/","8","5","4",null],8:["7",null,"/","*","9","6","5","4"],9:["8","/","*","-","+",null,"6","5"]},mac_keypad:{"*":["/",null,null,null,null,null,"-","9"],"+":["6","9","-",null,null,null,null,"3"],"-":["9","/","*",null,null,null,"+","6"],".":["0","2","3",null,null,null,null,null],"/":["=",null,null,null,"*","-","9","8"],0:[null,"1","2","3",".",null,null,null],1:[null,null,"4","5","2","0",null,null],2:["1","4","5","6","3",".","0",null],3:["2","5","6","+",null,null,".","0"],4:[null,null,"7","8","5","2","1",null],5:["4","7","8","9","6","3","2","1"],6:["5","8","9","-","+",null,"3","2"],7:[null,null,null,"=","8","5","4",null],8:["7",null,"=","/","9","6","5","4"],9:["8","=","/","*","-","+","6","5"],"=":[null,null,null,null,"/","9","8","7"]}},module.exports=adjacency_graphs; + +},{}],2:[function(require,module,exports){ +var feedback,scoring;scoring=require("./scoring"),feedback={default_feedback:{warning:"",suggestions:["Use a few words, avoid common phrases","No need for symbols, digits, or uppercase letters"]},get_feedback:function(e,s){var a,t,r,n,o,i;if(0===s.length)return this.default_feedback;if(e>2)return{warning:"",suggestions:[]};for(n=s[0],i=s.slice(1),t=0,r=i.length;t<r;t++)o=i[t],o.token.length>n.token.length&&(n=o);return feedback=this.get_match_feedback(n,1===s.length),a="Add another word or two. Uncommon words are better.",null!=feedback?(feedback.suggestions.unshift(a),null==feedback.warning&&(feedback.warning="")):feedback={warning:"",suggestions:[a]},feedback},get_match_feedback:function(e,s){var a,t;switch(e.pattern){case"dictionary":return this.get_dictionary_match_feedback(e,s);case"spatial":return a=e.graph.toUpperCase(),t=1===e.turns?"Straight rows of keys are easy to guess":"Short keyboard patterns are easy to guess",{warning:t,suggestions:["Use a longer keyboard pattern with more turns"]};case"repeat":return t=1===e.base_token.length?'Repeats like "aaa" are easy to guess':'Repeats like "abcabcabc" are only slightly harder to guess than "abc"',{warning:t,suggestions:["Avoid repeated words and characters"]};case"sequence":return{warning:"Sequences like abc or 6543 are easy to guess",suggestions:["Avoid sequences"]};case"regex":if("recent_year"===e.regex_name)return{warning:"Recent years are easy to guess",suggestions:["Avoid recent years","Avoid years that are associated with you"]};break;case"date":return{warning:"Dates are often easy to guess",suggestions:["Avoid dates and years that are associated with you"]}}},get_dictionary_match_feedback:function(e,s){var a,t,r,n,o;return n="passwords"===e.dictionary_name?!s||e.l33t||e.reversed?e.guesses_log10<=4?"This is similar to a commonly used password":void 0:e.rank<=10?"This is a top-10 common password":e.rank<=100?"This is a top-100 common password":"This is a very common password":"english"===e.dictionary_name?s?"A word by itself is easy to guess":void 0:"surnames"===(a=e.dictionary_name)||"male_names"===a||"female_names"===a?s?"Names and surnames by themselves are easy to guess":"Common names and surnames are easy to guess":"",r=[],o=e.token,o.match(scoring.START_UPPER)?r.push("Capitalization doesn't help very much"):o.match(scoring.ALL_UPPER)&&o.toLowerCase()!==o&&r.push("All-uppercase is almost as easy to guess as all-lowercase"),e.reversed&&e.token.length>=4&&r.push("Reversed words aren't much harder to guess"),e.l33t&&r.push("Predictable substitutions like '@' instead of 'a' don't help very much"),t={warning:n,suggestions:r}}},module.exports=feedback; + +},{"./scoring":6}],3:[function(require,module,exports){ +var frequency_lists;frequency_lists={passwords:"123456,password,12345678,qwerty,123456789,12345,1234,111111,1234567,dragon,123123,baseball,abc123,football,monkey,letmein,shadow,master,696969,mustang,666666,qwertyuiop,123321,1234567890,pussy,superman,654321,1qaz2wsx,7777777,fuckyou,qazwsx,jordan,123qwe,000000,killer,trustno1,hunter,harley,zxcvbnm,asdfgh,buster,batman,soccer,tigger,charlie,sunshine,iloveyou,fuckme,ranger,hockey,computer,starwars,asshole,pepper,klaster,112233,zxcvbn,freedom,princess,maggie,pass,ginger,11111111,131313,fuck,love,cheese,159753,summer,chelsea,dallas,biteme,matrix,yankees,6969,corvette,austin,access,thunder,merlin,secret,diamond,hello,hammer,fucker,1234qwer,silver,gfhjkm,internet,samantha,golfer,scooter,test,orange,cookie,q1w2e3r4t5,maverick,sparky,phoenix,mickey,bigdog,snoopy,guitar,whatever,chicken,camaro,mercedes,peanut,ferrari,falcon,cowboy,welcome,sexy,samsung,steelers,smokey,dakota,arsenal,boomer,eagles,tigers,marina,nascar,booboo,gateway,yellow,porsche,monster,spider,diablo,hannah,bulldog,junior,london,purple,compaq,lakers,iceman,qwer1234,hardcore,cowboys,money,banana,ncc1701,boston,tennis,q1w2e3r4,coffee,scooby,123654,nikita,yamaha,mother,barney,brandy,chester,fuckoff,oliver,player,forever,rangers,midnight,chicago,bigdaddy,redsox,angel,badboy,fender,jasper,slayer,rabbit,natasha,marine,bigdick,wizard,marlboro,raiders,prince,casper,fishing,flower,jasmine,iwantu,panties,adidas,winter,winner,gandalf,password1,enter,ghbdtn,1q2w3e4r,golden,cocacola,jordan23,winston,madison,angels,panther,blowme,sexsex,bigtits,spanky,bitch,sophie,asdfasdf,horny,thx1138,toyota,tiger,dick,canada,12344321,blowjob,8675309,muffin,liverpoo,apples,qwerty123,passw0rd,abcd1234,pokemon,123abc,slipknot,qazxsw,123456a,scorpion,qwaszx,butter,startrek,rainbow,asdfghjkl,razz,newyork,redskins,gemini,cameron,qazwsxedc,florida,liverpool,turtle,sierra,viking,booger,butthead,doctor,rocket,159357,dolphins,captain,bandit,jaguar,packers,pookie,peaches,789456,asdf,dolphin,helpme,blue,theman,maxwell,qwertyui,shithead,lovers,maddog,giants,nirvana,metallic,hotdog,rosebud,mountain,warrior,stupid,elephant,suckit,success,bond007,jackass,alexis,porn,lucky,scorpio,samson,q1w2e3,azerty,rush2112,driver,freddy,1q2w3e4r5t,sydney,gators,dexter,red123,123456q,12345a,bubba,creative,voodoo,golf,trouble,america,nissan,gunner,garfield,bullshit,asdfghjk,5150,fucking,apollo,1qazxsw2,2112,eminem,legend,airborne,bear,beavis,apple,brooklyn,godzilla,skippy,4815162342,buddy,qwert,kitten,magic,shelby,beaver,phantom,asdasd,xavier,braves,darkness,blink182,copper,platinum,qweqwe,tomcat,01012011,girls,bigboy,102030,animal,police,online,11223344,voyager,lifehack,12qwaszx,fish,sniper,315475,trinity,blazer,heaven,lover,snowball,playboy,loveme,bubbles,hooters,cricket,willow,donkey,topgun,nintendo,saturn,destiny,pakistan,pumpkin,digital,sergey,redwings,explorer,tits,private,runner,therock,guinness,lasvegas,beatles,789456123,fire,cassie,christin,qwerty1,celtic,asdf1234,andrey,broncos,007007,babygirl,eclipse,fluffy,cartman,michigan,carolina,testing,alexande,birdie,pantera,cherry,vampire,mexico,dickhead,buffalo,genius,montana,beer,minecraft,maximus,flyers,lovely,stalker,metallica,doggie,snickers,speedy,bronco,lol123,paradise,yankee,horses,magnum,dreams,147258369,lacrosse,ou812,goober,enigma,qwertyu,scotty,pimpin,bollocks,surfer,cock,poohbear,genesis,star,asd123,qweasdzxc,racing,hello1,hawaii,eagle1,viper,poopoo,einstein,boobies,12345q,bitches,drowssap,simple,badger,alaska,action,jester,drummer,111222,spitfire,forest,maryjane,champion,diesel,svetlana,friday,hotrod,147258,chevy,lucky1,westside,security,google,badass,tester,shorty,thumper,hitman,mozart,zaq12wsx,boobs,reddog,010203,lizard,a123456,123456789a,ruslan,eagle,1232323q,scarface,qwerty12,147852,a12345,buddha,porno,420420,spirit,money1,stargate,qwe123,naruto,mercury,liberty,12345qwert,semperfi,suzuki,popcorn,spooky,marley,scotland,kitty,cherokee,vikings,simpsons,rascal,qweasd,hummer,loveyou,michael1,patches,russia,jupiter,penguin,passion,cumshot,vfhbyf,honda,vladimir,sandman,passport,raider,bastard,123789,infinity,assman,bulldogs,fantasy,sucker,1234554321,horney,domino,budlight,disney,ironman,usuckballz1,softball,brutus,redrum,bigred,mnbvcxz,fktrcfylh,karina,marines,digger,kawasaki,cougar,fireman,oksana,monday,cunt,justice,nigger,super,wildcats,tinker,logitech,dancer,swordfis,avalon,everton,alexandr,motorola,patriots,hentai,madonna,pussy1,ducati,colorado,connor,juventus,galore,smooth,freeuser,warcraft,boogie,titanic,wolverin,elizabet,arizona,valentin,saints,asdfg,accord,test123,password123,christ,yfnfif,stinky,slut,spiderma,naughty,chopper,hello123,ncc1701d,extreme,skyline,poop,zombie,pearljam,123qweasd,froggy,awesome,vision,pirate,fylhtq,dreamer,bullet,predator,empire,123123a,kirill,charlie1,panthers,penis,skipper,nemesis,rasdzv3,peekaboo,rolltide,cardinal,psycho,danger,mookie,happy1,wanker,chevelle,manutd,goblue,9379992,hobbes,vegeta,fyfcnfcbz,852456,picard,159951,windows,loverboy,victory,vfrcbv,bambam,serega,123654789,turkey,tweety,galina,hiphop,rooster,changeme,berlin,taurus,suckme,polina,electric,avatar,134679,maksim,raptor,alpha1,hendrix,newport,bigcock,brazil,spring,a1b2c3,madmax,alpha,britney,sublime,darkside,bigman,wolfpack,classic,hercules,ronaldo,letmein1,1q2w3e,741852963,spiderman,blizzard,123456789q,cheyenne,cjkysirj,tiger1,wombat,bubba1,pandora,zxc123,holiday,wildcat,devils,horse,alabama,147852369,caesar,12312,buddy1,bondage,pussycat,pickle,shaggy,catch22,leather,chronic,a1b2c3d4,admin,qqq111,qaz123,airplane,kodiak,freepass,billybob,sunset,katana,phpbb,chocolat,snowman,angel1,stingray,firebird,wolves,zeppelin,detroit,pontiac,gundam,panzer,vagina,outlaw,redhead,tarheels,greenday,nastya,01011980,hardon,engineer,dragon1,hellfire,serenity,cobra,fireball,lickme,darkstar,1029384756,01011,mustang1,flash,124578,strike,beauty,pavilion,01012000,bobafett,dbrnjhbz,bigmac,bowling,chris1,ytrewq,natali,pyramid,rulez,welcome1,dodgers,apache,swimming,whynot,teens,trooper,fuckit,defender,precious,135790,packard,weasel,popeye,lucifer,cancer,icecream,142536,raven,swordfish,presario,viktor,rockstar,blonde,james1,wutang,spike,pimp,atlanta,airforce,thailand,casino,lennon,mouse,741852,hacker,bluebird,hawkeye,456123,theone,catfish,sailor,goldfish,nfnmzyf,tattoo,pervert,barbie,maxima,nipples,machine,trucks,wrangler,rocks,tornado,lights,cadillac,bubble,pegasus,madman,longhorn,browns,target,666999,eatme,qazwsx123,microsoft,dilbert,christia,baller,lesbian,shooter,xfiles,seattle,qazqaz,cthutq,amateur,prelude,corona,freaky,malibu,123qweasdzxc,assassin,246810,atlantis,integra,pussies,iloveu,lonewolf,dragons,monkey1,unicorn,software,bobcat,stealth,peewee,openup,753951,srinivas,zaqwsx,valentina,shotgun,trigger,veronika,bruins,coyote,babydoll,joker,dollar,lestat,rocky1,hottie,random,butterfly,wordpass,smiley,sweety,snake,chipper,woody,samurai,devildog,gizmo,maddie,soso123aljg,mistress,freedom1,flipper,express,hjvfirf,moose,cessna,piglet,polaris,teacher,montreal,cookies,wolfgang,scully,fatboy,wicked,balls,tickle,bunny,dfvgbh,foobar,transam,pepsi,fetish,oicu812,basketba,toshiba,hotstuff,sunday,booty,gambit,31415926,impala,stephani,jessica1,hooker,lancer,knicks,shamrock,fuckyou2,stinger,314159,redneck,deftones,squirt,siemens,blaster,trucker,subaru,renegade,ibanez,manson,swinger,reaper,blondie,mylove,galaxy,blahblah,enterpri,travel,1234abcd,babylon5,indiana,skeeter,master1,sugar,ficken,smoke,bigone,sweetpea,fucked,trfnthbyf,marino,escort,smitty,bigfoot,babes,larisa,trumpet,spartan,valera,babylon,asdfghj,yankees1,bigboobs,stormy,mister,hamlet,aardvark,butterfl,marathon,paladin,cavalier,manchester,skater,indigo,hornet,buckeyes,01011990,indians,karate,hesoyam,toronto,diamonds,chiefs,buckeye,1qaz2wsx3edc,highland,hotsex,charger,redman,passwor,maiden,drpepper,storm,pornstar,garden,12345678910,pencil,sherlock,timber,thuglife,insane,pizza,jungle,jesus1,aragorn,1a2b3c,hamster,david1,triumph,techno,lollol,pioneer,catdog,321654,fktrctq,morpheus,141627,pascal,shadow1,hobbit,wetpussy,erotic,consumer,blabla,justme,stones,chrissy,spartak,goforit,burger,pitbull,adgjmptw,italia,barcelona,hunting,colors,kissme,virgin,overlord,pebbles,sundance,emerald,doggy,racecar,irina,element,1478963,zipper,alpine,basket,goddess,poison,nipple,sakura,chichi,huskers,13579,pussys,q12345,ultimate,ncc1701e,blackie,nicola,rommel,matthew1,caserta,omega,geronimo,sammy1,trojan,123qwe123,philips,nugget,tarzan,chicks,aleksandr,bassman,trixie,portugal,anakin,dodger,bomber,superfly,madness,q1w2e3r4t5y6,loser,123asd,fatcat,ybrbnf,soldier,warlock,wrinkle1,desire,sexual,babe,seminole,alejandr,951753,11235813,westham,andrei,concrete,access14,weed,letmein2,ladybug,naked,christop,trombone,tintin,bluesky,rhbcnbyf,qazxswedc,onelove,cdtnkfyf,whore,vfvjxrf,titans,stallion,truck,hansolo,blue22,smiles,beagle,panama,kingkong,flatron,inferno,mongoose,connect,poiuyt,snatch,qawsed,juice,blessed,rocker,snakes,turbo,bluemoon,sex4me,finger,jamaica,a1234567,mulder,beetle,fuckyou1,passat,immortal,plastic,123454321,anthony1,whiskey,dietcoke,suck,spunky,magic1,monitor,cactus,exigen,planet,ripper,teen,spyder,apple1,nolimit,hollywoo,sluts,sticky,trunks,1234321,14789632,pickles,sailing,bonehead,ghbdtnbr,delta,charlott,rubber,911911,112358,molly1,yomama,hongkong,jumper,william1,ilovesex,faster,unreal,cumming,memphis,1123581321,nylons,legion,sebastia,shalom,pentium,geheim,werewolf,funtime,ferret,orion,curious,555666,niners,cantona,sprite,philly,pirates,abgrtyu,lollipop,eternity,boeing,super123,sweets,cooldude,tottenha,green1,jackoff,stocking,7895123,moomoo,martini,biscuit,drizzt,colt45,fossil,makaveli,snapper,satan666,maniac,salmon,patriot,verbatim,nasty,shasta,asdzxc,shaved,blackcat,raistlin,qwerty12345,punkrock,cjkywt,01012010,4128,waterloo,crimson,twister,oxford,musicman,seinfeld,biggie,condor,ravens,megadeth,wolfman,cosmos,sharks,banshee,keeper,foxtrot,gn56gn56,skywalke,velvet,black1,sesame,dogs,squirrel,privet,sunrise,wolverine,sucks,legolas,grendel,ghost,cats,carrot,frosty,lvbnhbq,blades,stardust,frog,qazwsxed,121314,coolio,brownie,groovy,twilight,daytona,vanhalen,pikachu,peanuts,licker,hershey,jericho,intrepid,ninja,1234567a,zaq123,lobster,goblin,punisher,strider,shogun,kansas,amadeus,seven7,jason1,neptune,showtime,muscle,oldman,ekaterina,rfrfirf,getsome,showme,111222333,obiwan,skittles,danni,tanker,maestro,tarheel,anubis,hannibal,anal,newlife,gothic,shark,fighter,blue123,blues,123456z,princes,slick,chaos,thunder1,sabine,1q2w3e4r5t6y,python,test1,mirage,devil,clover,tequila,chelsea1,surfing,delete,potato,chubby,panasonic,sandiego,portland,baggins,fusion,sooners,blackdog,buttons,californ,moscow,playtime,mature,1a2b3c4d,dagger,dima,stimpy,asdf123,gangster,warriors,iverson,chargers,byteme,swallow,liquid,lucky7,dingdong,nymets,cracker,mushroom,456852,crusader,bigguy,miami,dkflbvbh,bugger,nimrod,tazman,stranger,newpass,doodle,powder,gotcha,guardian,dublin,slapshot,septembe,147896325,pepsi1,milano,grizzly,woody1,knights,photos,2468,nookie,charly,rammstein,brasil,123321123,scruffy,munchkin,poopie,123098,kittycat,latino,walnut,1701,thegame,viper1,1passwor,kolobok,picasso,robert1,barcelon,bananas,trance,auburn,coltrane,eatshit,goodluck,starcraft,wheels,parrot,postal,blade,wisdom,pink,gorilla,katerina,pass123,andrew1,shaney14,dumbass,osiris,fuck_inside,oakland,discover,ranger1,spanking,lonestar,bingo,meridian,ping,heather1,dookie,stonecol,megaman,192837465,rjntyjr,ledzep,lowrider,25802580,richard1,firefly,griffey,racerx,paradox,ghjcnj,gangsta,zaq1xsw2,tacobell,weezer,sirius,halflife,buffett,shiloh,123698745,vertigo,sergei,aliens,sobaka,keyboard,kangaroo,sinner,soccer1,0.0.000,bonjour,socrates,chucky,hotboy,sprint,0007,sarah1,scarlet,celica,shazam,formula1,sommer,trebor,qwerasdf,jeep,mailcreated5240,bollox,asshole1,fuckface,honda1,rebels,vacation,lexmark,penguins,12369874,ragnarok,formula,258456,tempest,vfhecz,tacoma,qwertz,colombia,flames,rockon,duck,prodigy,wookie,dodgeram,mustangs,123qaz,sithlord,smoker,server,bang,incubus,scoobydo,oblivion,molson,kitkat,titleist,rescue,zxcv1234,carpet,1122,bigballs,tardis,jimbob,xanadu,blueeyes,shaman,mersedes,pooper,pussy69,golfing,hearts,mallard,12312312,kenwood,patrick1,dogg,cowboys1,oracle,123zxc,nuttertools,102938,topper,1122334455,shemale,sleepy,gremlin,yourmom,123987,gateway1,printer,monkeys,peterpan,mikey,kingston,cooler,analsex,jimbo,pa55word,asterix,freckles,birdman,frank1,defiant,aussie,stud,blondes,tatyana,445566,aspirine,mariners,jackal,deadhead,katrin,anime,rootbeer,frogger,polo,scooter1,hallo,noodles,thomas1,parola,shaolin,celine,11112222,plymouth,creampie,justdoit,ohyeah,fatass,assfuck,amazon,1234567q,kisses,magnus,camel,nopass,bosco,987456,6751520,harley1,putter,champs,massive,spidey,lightnin,camelot,letsgo,gizmodo,aezakmi,bones,caliente,12121,goodtime,thankyou,raiders1,brucelee,redalert,aquarius,456654,catherin,smokin,pooh,mypass,astros,roller,porkchop,sapphire,qwert123,kevin1,a1s2d3f4,beckham,atomic,rusty1,vanilla,qazwsxedcrfv,hunter1,kaktus,cxfcnmt,blacky,753159,elvis1,aggies,blackjac,bangkok,scream,123321q,iforgot,power1,kasper,abc12,buster1,slappy,shitty,veritas,chevrole,amber1,01012001,vader,amsterdam,jammer,primus,spectrum,eduard,granny,horny1,sasha1,clancy,usa123,satan,diamond1,hitler,avenger,1221,spankme,123456qwerty,simba,smudge,scrappy,labrador,john316,syracuse,front242,falcons,husker,candyman,commando,gator,pacman,delta1,pancho,krishna,fatman,clitoris,pineappl,lesbians,8j4ye3uz,barkley,vulcan,punkin,boner,celtics,monopoly,flyboy,romashka,hamburg,123456aa,lick,gangbang,223344,area51,spartans,aaa111,tricky,snuggles,drago,homerun,vectra,homer1,hermes,topcat,cuddles,infiniti,1234567890q,cosworth,goose,phoenix1,killer1,ivanov,bossman,qawsedrf,peugeot,exigent,doberman,durango,brandon1,plumber,telefon,horndog,laguna,rbhbkk,dawg,webmaster,breeze,beast,porsche9,beefcake,leopard,redbull,oscar1,topdog,godsmack,theking,pics,omega1,speaker,viktoria,fuckers,bowler,starbuck,gjkbyf,valhalla,anarchy,blacks,herbie,kingpin,starfish,nokia,loveit,achilles,906090,labtec,ncc1701a,fitness,jordan1,brando,arsenal1,bull,kicker,napass,desert,sailboat,bohica,tractor,hidden,muppet,jackson1,jimmy1,terminator,phillies,pa55w0rd,terror,farside,swingers,legacy,frontier,butthole,doughboy,jrcfyf,tuesday,sabbath,daniel1,nebraska,homers,qwertyuio,azamat,fallen,agent007,striker,camels,iguana,looker,pinkfloy,moloko,qwerty123456,dannyboy,luckydog,789654,pistol,whocares,charmed,skiing,select,franky,puppy,daniil,vladik,vette,vfrcbvrf,ihateyou,nevada,moneys,vkontakte,mandingo,puppies,666777,mystic,zidane,kotenok,dilligaf,budman,bunghole,zvezda,123457,triton,golfball,technics,trojans,panda,laptop,rookie,01011991,15426378,aberdeen,gustav,jethro,enterprise,igor,stripper,filter,hurrican,rfnthbyf,lespaul,gizmo1,butch,132435,dthjybrf,1366613,excalibu,963852,nofear,momoney,possum,cutter,oilers,moocow,cupcake,gbpltw,batman1,splash,svetik,super1,soleil,bogdan,melissa1,vipers,babyboy,tdutybq,lancelot,ccbill,keystone,passwort,flamingo,firefox,dogman,vortex,rebel,noodle,raven1,zaphod,killme,pokemon1,coolman,danila,designer,skinny,kamikaze,deadman,gopher,doobie,warhammer,deeznuts,freaks,engage,chevy1,steve1,apollo13,poncho,hammers,azsxdc,dracula,000007,sassy,bitch1,boots,deskjet,12332,macdaddy,mighty,rangers1,manchest,sterlin,casey1,meatball,mailman,sinatra,cthulhu,summer1,bubbas,cartoon,bicycle,eatpussy,truelove,sentinel,tolkien,breast,capone,lickit,summit,123456k,peter1,daisy1,kitty1,123456789z,crazy1,jamesbon,texas1,sexygirl,362436,sonic,billyboy,redhot,microsof,microlab,daddy1,rockets,iloveyo,fernand,gordon24,danie,cutlass,polska,star69,titties,pantyhos,01011985,thekid,aikido,gofish,mayday,1234qwe,coke,anfield,sony,lansing,smut,scotch,sexx,catman,73501505,hustler,saun,dfkthbz,passwor1,jenny1,azsxdcfv,cheers,irish1,gabrie,tinman,orioles,1225,charlton,fortuna,01011970,airbus,rustam,xtreme,bigmoney,zxcasd,retard,grumpy,huskies,boxing,4runner,kelly1,ultima,warlord,fordf150,oranges,rotten,asdfjkl,superstar,denali,sultan,bikini,saratoga,thor,figaro,sixers,wildfire,vladislav,128500,sparta,mayhem,greenbay,chewie,music1,number1,cancun,fabie,mellon,poiuytrewq,cloud9,crunch,bigtime,chicken1,piccolo,bigbird,321654987,billy1,mojo,01011981,maradona,sandro,chester1,bizkit,rjirfrgbde,789123,rightnow,jasmine1,hyperion,treasure,meatloaf,armani,rovers,jarhead,01011986,cruise,coconut,dragoon,utopia,davids,cosmo,rfhbyf,reebok,1066,charli,giorgi,sticks,sayang,pass1234,exodus,anaconda,zaqxsw,illini,woofwoof,emily1,sandy1,packer,poontang,govols,jedi,tomato,beaner,cooter,creamy,lionking,happy123,albatros,poodle,kenworth,dinosaur,greens,goku,happyday,eeyore,tsunami,cabbage,holyshit,turkey50,memorex,chaser,bogart,orgasm,tommy1,volley,whisper,knopka,ericsson,walleye,321123,pepper1,katie1,chickens,tyler1,corrado,twisted,100000,zorro,clemson,zxcasdqwe,tootsie,milana,zenith,fktrcfylhf,shania,frisco,polniypizdec0211,crazybab,junebug,fugazi,rereirf,vfvekz,1001,sausage,vfczyz,koshka,clapton,justin1,anhyeuem,condom,fubar,hardrock,skywalker,tundra,cocks,gringo,150781,canon,vitalik,aspire,stocks,samsung1,applepie,abc12345,arjay,gandalf1,boob,pillow,sparkle,gmoney,rockhard,lucky13,samiam,everest,hellyeah,bigsexy,skorpion,rfrnec,hedgehog,australi,candle,slacker,dicks,voyeur,jazzman,america1,bobby1,br0d3r,wolfie,vfksirf,1qa2ws3ed,13243546,fright,yosemite,temp,karolina,fart,barsik,surf,cheetah,baddog,deniska,starship,bootie,milena,hithere,kume,greatone,dildo,50cent,0.0.0.000,albion,amanda1,midget,lion,maxell,football1,cyclone,freeporn,nikola,bonsai,kenshin,slider,balloon,roadkill,killbill,222333,jerkoff,78945612,dinamo,tekken,rambler,goliath,cinnamon,malaka,backdoor,fiesta,packers1,rastaman,fletch,sojdlg123aljg,stefano,artemis,calico,nyjets,damnit,robotech,duchess,rctybz,hooter,keywest,18436572,hal9000,mechanic,pingpong,operator,presto,sword,rasputin,spank,bristol,faggot,shado,963852741,amsterda,321456,wibble,carrera,alibaba,majestic,ramses,duster,route66,trident,clipper,steeler,wrestlin,divine,kipper,gotohell,kingfish,snake1,passwords,buttman,pompey,viagra,zxcvbnm1,spurs,332211,slutty,lineage2,oleg,macross,pooter,brian1,qwert1,charles1,slave,jokers,yzerman,swimmer,ne1469,nwo4life,solnce,seamus,lolipop,pupsik,moose1,ivanova,secret1,matador,love69,420247,ktyjxrf,subway,cinder,vermont,pussie,chico,florian,magick,guiness,allsop,ghetto,flash1,a123456789,typhoon,dfkthf,depeche,skydive,dammit,seeker,fuckthis,crysis,kcj9wx5n,umbrella,r2d2c3po,123123q,snoopdog,critter,theboss,ding,162534,splinter,kinky,cyclops,jayhawk,456321,caramel,qwer123,underdog,caveman,onlyme,grapes,feather,hotshot,fuckher,renault,george1,sex123,pippen,000001,789987,floppy,cunts,megapass,1000,pornos,usmc,kickass,great1,quattro,135246,wassup,helloo,p0015123,nicole1,chivas,shannon1,bullseye,java,fishes,blackhaw,jamesbond,tunafish,juggalo,dkflbckfd,123789456,dallas1,translator,122333,beanie,alucard,gfhjkm123,supersta,magicman,ashley1,cohiba,xbox360,caligula,12131415,facial,7753191,dfktynbyf,cobra1,cigars,fang,klingon,bob123,safari,looser,10203,deepthroat,malina,200000,tazmania,gonzo,goalie,jacob1,monaco,cruiser,misfit,vh5150,tommyboy,marino13,yousuck,sharky,vfhufhbnf,horizon,absolut,brighton,123456r,death1,kungfu,maxx,forfun,mamapapa,enter1,budweise,banker,getmoney,kostya,qazwsx12,bigbear,vector,fallout,nudist,gunners,royals,chainsaw,scania,trader,blueboy,walrus,eastside,kahuna,qwerty1234,love123,steph,01011989,cypress,champ,undertaker,ybrjkfq,europa,snowboar,sabres,moneyman,chrisbln,minime,nipper,groucho,whitey,viewsonic,penthous,wolf359,fabric,flounder,coolguy,whitesox,passme,smegma,skidoo,thanatos,fucku2,snapple,dalejr,mondeo,thesims,mybaby,panasoni,sinbad,thecat,topher,frodo,sneakers,q123456,z1x2c3,alfa,chicago1,taylor1,ghjcnjnfr,cat123,olivier,cyber,titanium,0420,madison1,jabroni,dang,hambone,intruder,holly1,gargoyle,sadie1,static,poseidon,studly,newcastl,sexxxx,poppy,johannes,danzig,beastie,musica,buckshot,sunnyday,adonis,bluedog,bonkers,2128506,chrono,compute,spawn,01011988,turbo1,smelly,wapbbs,goldstar,ferrari1,778899,quantum,pisces,boomboom,gunnar,1024,test1234,florida1,nike,superman1,multiplelo,custom,motherlode,1qwerty,westwood,usnavy,apple123,daewoo,korn,stereo,sasuke,sunflowe,watcher,dharma,555777,mouse1,assholes,babyblue,123qwerty,marius,walmart,snoop,starfire,tigger1,paintbal,knickers,aaliyah,lokomotiv,theend,winston1,sapper,rover,erotica,scanner,racer,zeus,sexy69,doogie,bayern,joshua1,newbie,scott1,losers,droopy,outkast,martin1,dodge1,wasser,ufkbyf,rjycnfynby,thirteen,12345z,112211,hotred,deejay,hotpussy,192837,jessic,philippe,scout,panther1,cubbies,havefun,magpie,fghtkm,avalanch,newyork1,pudding,leonid,harry1,cbr600,audia4,bimmer,fucku,01011984,idontknow,vfvfgfgf,1357,aleksey,builder,01011987,zerocool,godfather,mylife,donuts,allmine,redfish,777888,sascha,nitram,bounce,333666,smokes,1x2zkg8w,rodman,stunner,zxasqw12,hoosier,hairy,beretta,insert,123456s,rtyuehe,francesc,tights,cheese1,micron,quartz,hockey1,gegcbr,searay,jewels,bogey,paintball,celeron,padres,bing,syncmaster,ziggy,simon1,beaches,prissy,diehard,orange1,mittens,aleksandra,queens,02071986,biggles,thongs,southpark,artur,twinkle,gretzky,rabota,cambiami,monalisa,gollum,chuckles,spike1,gladiator,whisky,spongebob,sexy1,03082006,mazafaka,meathead,4121,ou8122,barefoot,12345678q,cfitymrf,bigass,a1s2d3,kosmos,blessing,titty,clevelan,terrapin,ginger1,johnboy,maggot,clarinet,deeznutz,336699,stumpy,stoney,footbal,traveler,volvo,bucket,snapon,pianoman,hawkeyes,futbol,casanova,tango,goodboy,scuba,honey1,sexyman,warthog,mustard,abc1234,nickel,10203040,meowmeow,1012,boricua,prophet,sauron,12qwas,reefer,andromeda,crystal1,joker1,90210,goofy,loco,lovesex,triangle,whatsup,mellow,bengals,monster1,maste,01011910,lover1,love1,123aaa,sunshin,smeghead,hokies,sting,welder,rambo,cerberus,bunny1,rockford,monke,1q2w3e4r5,goldwing,gabriell,buzzard,crjhgbjy,james007,rainman,groove,tiberius,purdue,nokia6300,hayabusa,shou,jagger,diver,zigzag,poochie,usarmy,phish,redwood,redwing,12345679,salamander,silver1,abcd123,sputnik,boobie,ripple,eternal,12qw34er,thegreat,allstar,slinky,gesperrt,mishka,whiskers,pinhead,overkill,sweet1,rhfcjnrf,montgom240,sersolution,jamie1,starman,proxy,swords,nikolay,bacardi,rasta,badgirl,rebecca1,wildman,penny1,spaceman,1007,10101,logan1,hacked,bulldog1,helmet,windsor,buffy1,runescape,trapper,123451,banane,dbrnjh,ripken,12345qwe,frisky,shun,fester,oasis,lightning,ib6ub9,cicero,kool,pony,thedog,784512,01011992,megatron,illusion,edward1,napster,11223,squash,roadking,woohoo,19411945,hoosiers,01091989,tracker,bagira,midway,leavemealone,br549,14725836,235689,menace,rachel1,feng,laser,stoned,realmadrid,787898,balloons,tinkerbell,5551212,maria1,pobeda,heineken,sonics,moonlight,optimus,comet,orchid,02071982,jaybird,kashmir,12345678a,chuang,chunky,peach,mortgage,rulezzz,saleen,chuckie,zippy,fishing1,gsxr750,doghouse,maxim,reader,shai,buddah,benfica,chou,salomon,meister,eraser,blackbir,bigmike,starter,pissing,angus,deluxe,eagles1,hardcock,135792468,mian,seahawks,godfathe,bookworm,gregor,intel,talisman,blackjack,babyface,hawaiian,dogfood,zhong,01011975,sancho,ludmila,medusa,mortimer,123456654321,roadrunn,just4me,stalin,01011993,handyman,alphabet,pizzas,calgary,clouds,password2,cgfhnfr,f**k,cubswin,gong,lexus,max123,xxx123,digital1,gfhjkm1,7779311,missy1,michae,beautifu,gator1,1005,pacers,buddie,chinook,heckfy,dutchess,sally1,breasts,beowulf,darkman,jenn,tiffany1,zhei,quan,qazwsx1,satana,shang,idontkno,smiths,puddin,nasty1,teddybea,valkyrie,passwd,chao,boxster,killers,yoda,cheater,inuyasha,beast1,wareagle,foryou,dragonball,mermaid,bhbirf,teddy1,dolphin1,misty1,delphi,gromit,sponge,qazzaq,fytxrf,gameover,diao,sergi,beamer,beemer,kittykat,rancid,manowar,adam12,diggler,assword,austin1,wishbone,gonavy,sparky1,fisting,thedude,sinister,1213,venera,novell,salsero,jayden,fuckoff1,linda1,vedder,02021987,1pussy,redline,lust,jktymrf,02011985,dfcbkbq,dragon12,chrome,gamecube,titten,cong,bella1,leng,02081988,eureka,bitchass,147369,banner,lakota,123321a,mustafa,preacher,hotbox,02041986,z1x2c3v4,playstation,01011977,claymore,electra,checkers,zheng,qing,armagedon,02051986,wrestle,svoboda,bulls,nimbus,alenka,madina,newpass6,onetime,aa123456,bartman,02091987,silverad,electron,12345t,devil666,oliver1,skylar,rhtdtlrj,gobucks,johann,12011987,milkman,02101985,camper,thunderb,bigbutt,jammin,davide,cheeks,goaway,lighter,claudi,thumbs,pissoff,ghostrider,cocaine,teng,squall,lotus,hootie,blackout,doitnow,subzero,02031986,marine1,02021988,pothead,123456qw,skate,1369,peng,antoni,neng,miao,bcfields,1492,marika,794613,musashi,tulips,nong,piao,chai,ruan,southpar,02061985,nude,mandarin,654123,ninjas,cannabis,jetski,xerxes,zhuang,kleopatra,dickie,bilbo,pinky,morgan1,1020,1017,dieter,baseball1,tottenham,quest,yfnfkmz,dirtbike,1234567890a,mango,jackson5,ipswich,iamgod,02011987,tdutybz,modena,qiao,slippery,qweasd123,bluefish,samtron,toon,111333,iscool,02091986,petrov,fuzzy,zhou,1357924680,mollydog,deng,02021986,1236987,pheonix,zhun,ghblehjr,othello,starcraf,000111,sanfran,a11111,cameltoe,badman,vasilisa,jiang,1qaz2ws,luan,sveta,12qw12,akira,chuai,369963,cheech,beatle,pickup,paloma,01011983,caravan,elizaveta,gawker,banzai,pussey,mullet,seng,bingo1,bearcat,flexible,farscape,borussia,zhuai,templar,guitar1,toolman,yfcntymrf,chloe1,xiang,slave1,guai,nuggets,02081984,mantis,slim,scorpio1,fyutkbyf,thedoors,02081987,02061986,123qq123,zappa,fergie,7ugd5hip2j,huai,asdfzxcv,sunflower,pussyman,deadpool,bigtit,01011982,love12,lassie,skyler,gatorade,carpedie,jockey,mancity,spectre,02021984,cameron1,artemka,reng,02031984,iomega,jing,moritz,spice,rhino,spinner,heater,zhai,hover,talon,grease,qiong,corleone,ltybcrf,tian,cowboy1,hippie,chimera,ting,alex123,02021985,mickey1,corsair,sonoma,aaron1,xxxpass,bacchus,webmaste,chuo,xyz123,chrysler,spurs1,artem,shei,cosmic,01020304,deutsch,gabriel1,123455,oceans,987456321,binladen,latinas,a12345678,speedo,buttercu,02081989,21031988,merlot,millwall,ceng,kotaku,jiong,dragonba,2580,stonecold,snuffy,01011999,02011986,hellos,blaze,maggie1,slapper,istanbul,bonjovi,babylove,mazda,bullfrog,phoeni,meng,porsche1,nomore,02061989,bobdylan,capslock,orion1,zaraza,teddybear,ntktajy,myname,rong,wraith,mets,niao,02041984,smokie,chevrolet,dialog,gfhjkmgfhjkm,dotcom,vadim,monarch,athlon,mikey1,hamish,pian,liang,coolness,chui,thoma,ramones,ciccio,chippy,eddie1,house1,ning,marker,cougars,jackpot,barbados,reds,pdtplf,knockers,cobalt,amateurs,dipshit,napoli,kilroy,pulsar,jayhawks,daemon,alexey,weng,shuang,9293709b13,shiner,eldorado,soulmate,mclaren,golfer1,andromed,duan,50spanks,sexyboy,dogshit,02021983,shuo,kakashka,syzygy,111111a,yeahbaby,qiang,netscape,fulham,120676,gooner,zhui,rainbow6,laurent,dog123,halifax,freeway,carlitos,147963,eastwood,microphone,monkey12,1123,persik,coldbeer,geng,nuan,danny1,fgtkmcby,entropy,gadget,just4fun,sophi,baggio,carlito,1234567891,02021989,02041983,specialk,piramida,suan,bigblue,salasana,hopeful,mephisto,bailey1,hack,annie1,generic,violetta,spencer1,arcadia,02051983,hondas,9562876,trainer,jones1,smashing,liao,159632,iceberg,rebel1,snooker,temp123,zang,matteo,fastball,q2w3e4r5,bamboo,fuckyo,shutup,astro,buddyboy,nikitos,redbird,maxxxx,shitface,02031987,kuai,kissmyass,sahara,radiohea,1234asdf,wildcard,maxwell1,patric,plasma,heynow,bruno1,shao,bigfish,misfits,sassy1,sheng,02011988,02081986,testpass,nanook,cygnus,licking,slavik,pringles,xing,1022,ninja1,submit,dundee,tiburon,pinkfloyd,yummy,shuai,guang,chopin,obelix,insomnia,stroker,1a2s3d4f,1223,playboy1,lazarus,jorda,spider1,homerj,sleeper,02041982,darklord,cang,02041988,02041987,tripod,magician,jelly,telephon,15975,vsjasnel12,pasword,iverson3,pavlov,homeboy,gamecock,amigo,brodie,budapest,yjdsqgfhjkm,reckless,02011980,pang,tiger123,2469,mason1,orient,01011979,zong,cdtnbr,maksimka,1011,bushido,taxman,giorgio,sphinx,kazantip,02101984,concorde,verizon,lovebug,georg,sam123,seadoo,qazwsxedc123,jiao,jezebel,pharmacy,abnormal,jellybea,maxime,puffy,islander,bunnies,jiggaman,drakon,010180,pluto,zhjckfd,12365,classics,crusher,mordor,hooligan,strawberry,02081985,scrabble,hawaii50,1224,wg8e3wjf,cthtuf,premium,arrow,123456qwe,mazda626,ramrod,tootie,rhjrjlbk,ghost1,1211,bounty,niang,02071984,goat,killer12,sweetnes,porno1,masamune,426hemi,corolla,mariposa,hjccbz,doomsday,bummer,blue12,zhao,bird33,excalibur,samsun,kirsty,buttfuck,kfhbcf,zhuo,marcello,ozzy,02021982,dynamite,655321,master12,123465,lollypop,stepan,1qa2ws,spiker,goirish,callum,michael2,moonbeam,attila,henry1,lindros,andrea1,sporty,lantern,12365478,nextel,violin,volcom,998877,water1,imation,inspiron,dynamo,citadel,placebo,clowns,tiao,02061988,tripper,dabears,haggis,merlin1,02031985,anthrax,amerika,iloveme,vsegda,burrito,bombers,snowboard,forsaken,katarina,a1a2a3,woofer,tigger2,fullmoon,tiger2,spock,hannah1,snoopy1,sexxxy,sausages,stanislav,cobain,robotics,exotic,green123,mobydick,senators,pumpkins,fergus,asddsa,147741,258852,windsurf,reddevil,vfitymrf,nevermind,nang,woodland,4417,mick,shui,q1q2q3,wingman,69696,superb,zuan,ganesh,pecker,zephyr,anastasiya,icu812,larry1,02081982,broker,zalupa,mihail,vfibyf,dogger,7007,paddle,varvara,schalke,1z2x3c,presiden,yankees2,tuning,poopy,02051982,concord,vanguard,stiffy,rjhjktdf,felix1,wrench,firewall,boxer,bubba69,popper,02011984,temppass,gobears,cuan,tipper,fuckme1,kamila,thong,puss,bigcat,drummer1,02031982,sowhat,digimon,tigers1,rang,jingle,bian,uranus,soprano,mandy1,dusty1,fandango,aloha,pumpkin1,postman,02061980,dogcat,bombay,pussy123,onetwo,highheel,pippo,julie1,laura1,pepito,beng,smokey1,stylus,stratus,reload,duckie,karen1,jimbo1,225588,369258,krusty,snappy,asdf12,electro,111qqq,kuang,fishin,clit,abstr,christma,qqqqq1,1234560,carnage,guyver,boxers,kittens,zeng,1000000,qwerty11,toaster,cramps,yugioh,02061987,icehouse,zxcvbnm123,pineapple,namaste,harrypotter,mygirl,falcon1,earnhard,fender1,spikes,nutmeg,01081989,dogboy,02091983,369852,softail,mypassword,prowler,bigboss,1112,harvest,heng,jubilee,killjoy,basset,keng,zaqxswcde,redsox1,biao,titan,misfit99,robot,wifey,kidrock,02101987,gameboy,enrico,1z2x3c4v,broncos1,arrows,havana,banger,cookie1,chriss,123qw,platypus,cindy1,lumber,pinball,foxy,london1,1023,05051987,02041985,password12,superma,longbow,radiohead,nigga,12051988,spongebo,qwert12345,abrakadabra,dodgers1,02101989,chillin,niceguy,pistons,hookup,santafe,bigben,jets,1013,vikings1,mankind,viktoriya,beardog,hammer1,02071980,reddwarf,magelan,longjohn,jennife,gilles,carmex2,02071987,stasik,bumper,doofus,slamdunk,pixies,garion,steffi,alessandro,beerman,niceass,warrior1,honolulu,134679852,visa,johndeer,mother1,windmill,boozer,oatmeal,aptiva,busty,delight,tasty,slick1,bergkamp,badgers,guitars,puffin,02091981,nikki1,irishman,miller1,zildjian,123000,airwolf,magnet,anai,install,02041981,02061983,astra,romans,megan1,mudvayne,freebird,muscles,dogbert,02091980,02091984,snowflak,01011900,mang,joseph1,nygiants,playstat,junior1,vjcrdf,qwer12,webhompas,giraffe,pelican,jefferso,comanche,bruiser,monkeybo,kjkszpj,123456l,micro,albany,02051987,angel123,epsilon,aladin,death666,hounddog,josephin,altima,chilly,02071988,78945,ultra,02041979,gasman,thisisit,pavel,idunno,kimmie,05051985,paulie,ballin,medion,moondog,manolo,pallmall,climber,fishbone,genesis1,153624,toffee,tbone,clippers,krypton,jerry1,picturs,compass,111111q,02051988,1121,02081977,sairam,getout,333777,cobras,22041987,bigblock,severin,booster,norwich,whiteout,ctrhtn,123456m,02061984,hewlett,shocker,fuckinside,02031981,chase1,white1,versace,123456789s,basebal,iloveyou2,bluebell,08031986,anthon,stubby,foreve,undertak,werder,saiyan,mama123,medic,chipmunk,mike123,mazdarx7,qwe123qwe,bowwow,kjrjvjnbd,celeb,choochoo,demo,lovelife,02051984,colnago,lithium,02051989,15051981,zzzxxx,welcom,anastasi,fidelio,franc,26061987,roadster,stone55,drifter,hookem,hellboy,1234qw,cbr900rr,sinned,good123654,storm1,gypsy,zebra,zachary1,toejam,buceta,02021979,testing1,redfox,lineage,mike1,highbury,koroleva,nathan1,washingt,02061982,02091985,vintage,redbaron,dalshe,mykids,11051987,macbeth,julien,james123,krasotka,111000,10011986,987123,pipeline,tatarin,sensei,codered,komodo,frogman,7894561230,nascar24,juicy,01031988,redrose,mydick,pigeon,tkbpfdtnf,smirnoff,1215,spam,winner1,flyfish,moskva,81fukkc,21031987,olesya,starligh,summer99,13041988,fishhead,freesex,super12,06061986,azazel,scoobydoo,02021981,cabron,yogibear,sheba1,konstantin,tranny,chilli,terminat,ghbywtccf,slowhand,soccer12,cricket1,fuckhead,1002,seagull,achtung,blam,bigbob,bdsm,nostromo,survivor,cnfybckfd,lemonade,boomer1,rainbow1,rober,irinka,cocksuck,peaches1,itsme,sugar1,zodiac,upyours,dinara,135791,sunny1,chiara,johnson1,02041989,solitude,habibi,sushi,markiz,smoke1,rockies,catwoman,johnny1,qwerty7,bearcats,username,01011978,wanderer,ohshit,02101986,sigma,stephen1,paradigm,02011989,flanker,sanity,jsbach,spotty,bologna,fantasia,chevys,borabora,cocker,74108520,123ewq,12021988,01061990,gtnhjdbx,02071981,01011960,sundevil,3000gt,mustang6,gagging,maggi,armstron,yfnfkb,13041987,revolver,02021976,trouble1,madcat,jeremy1,jackass1,volkswag,30051985,corndog,pool6123,marines1,03041991,pizza1,piggy,sissy,02031979,sunfire,angelus,undead,24061986,14061991,wildbill,shinobi,45m2do5bs,123qwer,21011989,cleopatr,lasvega,hornets,amorcit,11081989,coventry,nirvana1,destin,sidekick,20061988,02081983,gbhfvblf,sneaky,bmw325,22021989,nfytxrf,sekret,kalina,zanzibar,hotone,qazws,wasabi,heidi1,highlander,blues1,hitachi,paolo,23041987,slayer1,simba1,02011981,tinkerbe,kieran,01121986,172839,boiler,1125,bluesman,waffle,asdfgh01,threesom,conan,1102,reflex,18011987,nautilus,everlast,fatty,vader1,01071986,cyborg,ghbdtn123,birddog,rubble,02071983,suckers,02021973,skyhawk,12qw12qw,dakota1,joebob,nokia6233,woodie,longdong,lamer,troll,ghjcnjgfhjkm,420000,boating,nitro,armada,messiah,1031,penguin1,02091989,americ,02071989,redeye,asdqwe123,07071987,monty1,goten,spikey,sonata,635241,tokiohotel,sonyericsson,citroen,compaq1,1812,umpire,belmont,jonny,pantera1,nudes,palmtree,14111986,fenway,bighead,razor,gryphon,andyod22,aaaaa1,taco,10031988,enterme,malachi,dogface,reptile,01041985,dindom,handball,marseille,candy1,19101987,torino,tigge,matthias,viewsoni,13031987,stinker,evangelion,24011985,123456123,rampage,sandrine,02081980,thecrow,astral,28041987,sprinter,private1,seabee,shibby,02101988,25081988,fearless,junkie,01091987,aramis,antelope,draven,fuck1,mazda6,eggman,02021990,barselona,buddy123,19061987,fyfnjkbq,nancy1,12121990,10071987,sluggo,kille,hotties,irishka,zxcasdqwe123,shamus,fairlane,honeybee,soccer10,13061986,fantomas,17051988,10051987,20111986,gladiato,karachi,gambler,gordo,01011995,biatch,matthe,25800852,papito,excite,buffalo1,bobdole,cheshire,player1,28021992,thewho,10101986,pinky1,mentor,tomahawk,brown1,03041986,bismillah,bigpoppa,ijrjkfl,01121988,runaway,08121986,skibum,studman,helper,squeak,holycow,manfred,harlem,glock,gideon,987321,14021985,yellow1,wizard1,margarit,success1,medved,sf49ers,lambda,pasadena,johngalt,quasar,1776,02031980,coldplay,amand,playa,bigpimp,04041991,capricorn,elefant,sweetness,bruce1,luca,dominik,10011990,biker,09051945,datsun,elcamino,trinitro,malice,audi,voyager1,02101983,joe123,carpente,spartan1,mario1,glamour,diaper,12121985,22011988,winter1,asimov,callisto,nikolai,pebble,02101981,vendetta,david123,boytoy,11061985,02031989,iloveyou1,stupid1,cayman,casper1,zippo,yamahar1,wildwood,foxylady,calibra,02041980,27061988,dungeon,leedsutd,30041986,11051990,bestbuy,antares,dominion,24680,01061986,skillet,enforcer,derparol,01041988,196969,29071983,f00tball,purple1,mingus,25031987,21031990,remingto,giggles,klaste,3x7pxr,01011994,coolcat,29051989,megane,20031987,02051980,04041988,synergy,0000007,macman,iforget,adgjmp,vjqgfhjkm,28011987,rfvfcenhf,16051989,25121987,16051987,rogue,mamamia,08051990,20091991,1210,carnival,bolitas,paris1,dmitriy,dimas,05051989,papillon,knuckles,29011985,hola,tophat,28021990,100500,cutiepie,devo,415263,ducks,ghjuhfvvf,asdqwe,22021986,freefall,parol,02011983,zarina,buste,vitamin,warez,bigones,17061988,baritone,jamess,twiggy,mischief,bitchy,hetfield,1003,dontknow,grinch,sasha_007,18061990,12031985,12031987,calimero,224466,letmei,15011987,acmilan,alexandre,02031977,08081988,whiteboy,21051991,barney1,02071978,money123,18091985,bigdawg,02031988,cygnusx1,zoloto,31011987,firefigh,blowfish,screamer,lfybbk,20051988,chelse,11121986,01031989,harddick,sexylady,30031988,02041974,auditt,pizdec,kojak,kfgjxrf,20091988,123456ru,wp2003wp,1204,15051990,slugger,kordell1,03031986,swinging,01011974,02071979,rockie,dimples,1234123,1dragon,trucking,rusty2,roger1,marijuana,kerouac,02051978,08031985,paco,thecure,keepout,kernel,noname123,13121985,francisc,bozo,02011982,22071986,02101979,obsidian,12345qw,spud,tabasco,02051985,jaguars,dfktynby,kokomo,popova,notused,sevens,4200,magneto,02051976,roswell,15101986,21101986,lakeside,bigbang,aspen,little1,14021986,loki,suckmydick,strawber,carlos1,nokian73,dirty1,joshu,25091987,16121987,02041975,advent,17011987,slimshady,whistler,10101990,stryker,22031984,15021985,01031985,blueball,26031988,ksusha,bahamut,robocop,w_pass,chris123,impreza,prozac,bookie,bricks,13021990,alice1,cassandr,11111q,john123,4ever,korova,02051973,142857,25041988,paramedi,eclipse1,salope,07091990,1124,darkangel,23021986,999666,nomad,02051981,smackdow,01021990,yoyoma,argentin,moonligh,57chevy,bootys,hardone,capricor,galant,spanker,dkflbr,24111989,magpies,krolik,21051988,cevthrb,cheddar,22041988,bigbooty,scuba1,qwedsa,duffman,bukkake,acura,johncena,sexxy,p@ssw0rd,258369,cherries,12345s,asgard,leopold,fuck123,mopar,lalakers,dogpound,matrix1,crusty,spanner,kestrel,fenris,universa,peachy,assasin,lemmein,eggplant,hejsan,canucks,wendy1,doggy1,aikman,tupac,turnip,godlike,fussball,golden1,19283746,april1,django,petrova,captain1,vincent1,ratman,taekwondo,chocha,serpent,perfect1,capetown,vampir,amore,gymnast,timeout,nbvjatq,blue32,ksenia,k.lvbkf,nazgul,budweiser,clutch,mariya,sylveste,02051972,beaker,cartman1,q11111,sexxx,forever1,loser1,marseill,magellan,vehpbr,sexgod,jktxrf,hallo123,132456,liverpool1,southpaw,seneca,camden,357159,camero,tenchi,johndoe,145236,roofer,741963,vlad,02041978,fktyrf,zxcv123,wingnut,wolfpac,notebook,pufunga7782,brandy1,biteme1,goodgirl,redhat,02031978,challeng,millenium,hoops,maveric,noname,angus1,gaell,onion,olympus,sabrina1,ricard,sixpack,gratis,gagged,camaross,hotgirls,flasher,02051977,bubba123,goldfing,moonshin,gerrard,volkov,sonyfuck,mandrake,258963,tracer,lakers1,asians,susan1,money12,helmut,boater,diablo2,1234zxcv,dogwood,bubbles1,happy2,randy1,aries,beach1,marcius2,navigator,goodie,hellokitty,fkbyjxrf,earthlink,lookout,jumbo,opendoor,stanley1,marie1,12345m,07071977,ashle,wormix,murzik,02081976,lakewood,bluejays,loveya,commande,gateway2,peppe,01011976,7896321,goth,oreo,slammer,rasmus,faith1,knight1,stone1,redskin,ironmaiden,gotmilk,destiny1,dejavu,1master,midnite,timosha,espresso,delfin,toriamos,oberon,ceasar,markie,1a2s3d,ghhh47hj7649,vjkjrj,daddyo,dougie,disco,auggie,lekker,therock1,ou8123,start1,noway,p4ssw0rd,shadow12,333444,saigon,2fast4u,capecod,23skidoo,qazxcv,beater,bremen,aaasss,roadrunner,peace1,12345qwer,02071975,platon,bordeaux,vbkfirf,135798642,test12,supernov,beatles1,qwert40,optimist,vanessa1,prince1,ilovegod,nightwish,natasha1,alchemy,bimbo,blue99,patches1,gsxr1000,richar,hattrick,hott,solaris,proton,nevets,enternow,beavis1,amigos,159357a,ambers,lenochka,147896,suckdick,shag,intercourse,blue1234,spiral,02061977,tosser,ilove,02031975,cowgirl,canuck,q2w3e4,munch,spoons,waterboy,123567,evgeniy,savior,zasada,redcar,mamacita,terefon,globus,doggies,htubcnhfwbz,1008,cuervo,suslik,azertyui,limewire,houston1,stratfor,steaua,coors,tennis1,12345qwerty,stigmata,derf,klondike,patrici,marijuan,hardball,odyssey,nineinch,boston1,pass1,beezer,sandr,charon,power123,a1234,vauxhall,875421,awesome1,reggae,boulder,funstuff,iriska,krokodil,rfntymrf,sterva,champ1,bball,peeper,m123456,toolbox,cabernet,sheepdog,magic32,pigpen,02041977,holein1,lhfrjy,banan,dabomb,natalie1,jennaj,montana1,joecool,funky,steven1,ringo,junio,sammy123,qqqwww,baltimor,footjob,geezer,357951,mash4077,cashmone,pancake,monic,grandam,bongo,yessir,gocubs,nastia,vancouve,barley,dragon69,watford,ilikepie,02071976,laddie,123456789m,hairball,toonarmy,pimpdadd,cvthnm,hunte,davinci,lback,sophie1,firenze,q1234567,admin1,bonanza,elway7,daman,strap,azert,wxcvbn,afrika,theforce,123456t,idefix,wolfen,houdini,scheisse,default,beech,maserati,02061976,sigmachi,dylan1,bigdicks,eskimo,mizzou,02101976,riccardo,egghead,111777,kronos,ghbrjk,chaos1,jomama,rfhnjirf,rodeo,dolemite,cafc91,nittany,pathfind,mikael,password9,vqsablpzla,purpl,gabber,modelsne,myxworld,hellsing,punker,rocknrol,fishon,fuck69,02041976,lolol,twinkie,tripleh,cirrus,redbone,killer123,biggun,allegro,gthcbr,smith1,wanking,bootsy,barry1,mohawk,koolaid,5329,futurama,samoht,klizma,996633,lobo,honeys,peanut1,556677,zxasqw,joemama,javelin,samm,223322,sandra1,flicks,montag,nataly,3006,tasha1,1235789,dogbone,poker1,p0o9i8u7,goodday,smoothie,toocool,max333,metroid,archange,vagabond,billabon,22061941,tyson1,02031973,darkange,skateboard,evolutio,morrowind,wizards,frodo1,rockin,cumslut,plastics,zaqwsxcde,5201314,doit,outback,bumble,dominiqu,persona,nevermore,alinka,02021971,forgetit,sexo,all4one,c2h5oh,petunia,sheeba,kenny1,elisabet,aolsucks,woodstoc,pumper,02011975,fabio,granada,scrapper,123459,minimoni,q123456789,breaker,1004,02091976,ncc74656,slimshad,friendster,austin31,wiseguy,donner,dilbert1,132465,blackbird,buffet,jellybean,barfly,behappy,01011971,carebear,fireblad,02051975,boxcar,cheeky,kiteboy,hello12,panda1,elvisp,opennow,doktor,alex12,02101977,pornking,flamengo,02091975,snowbird,lonesome,robin1,11111a,weed420,baracuda,bleach,12345abc,nokia1,metall,singapor,mariner,herewego,dingo,tycoon,cubs,blunts,proview,123456789d,kamasutra,lagnaf,vipergts,navyseal,starwar,masterbate,wildone,peterbil,cucumber,butkus,123qwert,climax,deniro,gotribe,cement,scooby1,summer69,harrier,shodan,newyear,02091977,starwars1,romeo1,sedona,harald,doubled,sasha123,bigguns,salami,awnyce,kiwi,homemade,pimping,azzer,bradley1,warhamme,linkin,dudeman,qwe321,pinnacle,maxdog,flipflop,lfitymrf,fucker1,acidburn,esquire,sperma,fellatio,jeepster,thedon,sexybitch,pookey,spliff,widget,vfntvfnbrf,trinity1,mutant,samuel1,meliss,gohome,1q2q3q,mercede,comein,grin,cartoons,paragon,henrik,rainyday,pacino,senna,bigdog1,alleycat,12345qaz,narnia,mustang2,tanya1,gianni,apollo11,wetter,clovis,escalade,rainbows,freddy1,smart1,daisydog,s123456,cocksucker,pushkin,lefty,sambo,fyutkjxtr,hiziad,boyz,whiplash,orchard,newark,adrenalin,1598753,bootsie,chelle,trustme,chewy,golfgti,tuscl,ambrosia,5wr2i7h8,penetration,shonuf,jughead,payday,stickman,gotham,kolokol,johnny5,kolbasa,stang,puppydog,charisma,gators1,mone,jakarta,draco,nightmar,01011973,inlove,laetitia,02091973,tarpon,nautica,meadow,0192837465,luckyone,14881488,chessie,goldeney,tarakan,69camaro,bungle,wordup,interne,fuckme2,515000,dragonfl,sprout,02081974,gerbil,bandit1,02071971,melanie1,phialpha,camber,kathy1,adriano,gonzo1,10293847,bigjohn,bismarck,7777777a,scamper,12348765,rabbits,222777,bynthytn,dima123,alexander1,mallorca,dragster,favorite6,beethove,burner,cooper1,fosters,hello2,normandy,777999,sebring,1michael,lauren1,blake1,killa,02091971,nounours,trumpet1,thumper1,playball,xantia,rugby1,rocknroll,guillaum,angela1,strelok,prosper,buttercup,masterp,dbnfkbr,cambridg,venom,treefrog,lumina,1234566,supra,sexybabe,freee,shen,frogs,driller,pavement,grace1,dicky,checker,smackdown,pandas,cannibal,asdffdsa,blue42,zyjxrf,nthvbyfnjh,melrose,neon,jabber,gamma,369258147,aprilia,atticus,benessere,catcher,skipper1,azertyuiop,sixty9,thierry,treetop,jello,melons,123456789qwe,tantra,buzzer,catnip,bouncer,computer1,sexyone,ananas,young1,olenka,sexman,mooses,kittys,sephiroth,contra,hallowee,skylark,sparkles,777333,1qazxsw23edc,lucas1,q1w2e3r,gofast,hannes,amethyst,ploppy,flower2,hotass,amatory,volleyba,dixie1,bettyboo,ticklish,02061974,frenchy,phish1,murphy1,trustno,02061972,leinad,mynameis,spooge,jupiter1,hyundai,frosch,junkmail,abacab,marbles,32167,casio,sunshine1,wayne1,longhair,caster,snicker,02101973,gannibal,skinhead,hansol,gatsby,segblue2,montecar,plato,gumby,kaboom,matty,bosco1,888999,jazzy,panter,jesus123,charlie2,giulia,candyass,sex69,travis1,farmboy,special1,02041973,letsdoit,password01,allison1,abcdefg1,notredam,ilikeit,789654123,liberty1,rugger,uptown,alcatraz,123456w,airman,007bond,navajo,kenobi,terrier,stayout,grisha,frankie1,fluff,1qazzaq1,1234561,virginie,1234568,tango1,werdna,octopus,fitter,dfcbkbcf,blacklab,115599,montrose,allen1,supernova,frederik,ilovepussy,justice1,radeon,playboy2,blubber,sliver,swoosh,motocros,lockdown,pearls,thebear,istheman,pinetree,biit,1234rewq,rustydog,tampabay,titts,babycake,jehovah,vampire1,streaming,collie,camil,fidelity,calvin1,stitch,gatit,restart,puppy1,budgie,grunt,capitals,hiking,dreamcas,zorro1,321678,riffraff,makaka,playmate,napalm,rollin,amstel,zxcvb123,samanth,rumble,fuckme69,jimmys,951357,pizzaman,1234567899,tralala,delpiero,alexi,yamato,itisme,1million,vfndtq,kahlua,londo,wonderboy,carrots,tazz,ratboy,rfgecnf,02081973,nico,fujitsu,tujhrf,sergbest,blobby,02051970,sonic1,1357911,smirnov,video1,panhead,bucky,02031974,44332211,duffer,cashmoney,left4dead,bagpuss,salman,01011972,titfuck,66613666,england1,malish,dresden,lemans,darina,zapper,123456as,123456qqq,met2002,02041972,redstar,blue23,1234509876,pajero,booyah,please1,tetsuo,semper,finder,hanuman,sunlight,123456n,02061971,treble,cupoi,password99,dimitri,3ip76k2,popcorn1,lol12345,stellar,nympho,shark1,keith1,saskia,bigtruck,revoluti,rambo1,asd222,feelgood,phat,gogators,bismark,cola,puck,furball,burnout,slonik,bowtie,mommy1,icecube,fabienn,mouser,papamama,rolex,giants1,blue11,trooper1,momdad,iklo,morten,rhubarb,gareth,123456d,blitz,canada1,r2d2,brest,tigercat,usmarine,lilbit,benny1,azrael,lebowski,12345r,madagaskar,begemot,loverman,dragonballz,italiano,mazda3,naughty1,onions,diver1,cyrano,capcom,asdfg123,forlife,fisherman,weare138,requiem,mufasa,alpha123,piercing,hellas,abracadabra,duckman,caracas,macintos,02011971,jordan2,crescent,fduecn,hogtied,eatmenow,ramjet,18121812,kicksass,whatthe,discus,rfhfvtkmrf,rufus1,sqdwfe,mantle,vegitto,trek,dan123,paladin1,rudeboy,liliya,lunchbox,riversid,acapulco,libero,dnsadm,maison,toomuch,boobear,hemlock,sextoy,pugsley,misiek,athome,migue,altoids,marcin,123450,rhfcfdbwf,jeter2,rhinos,rjhjkm,mercury1,ronaldinho,shampoo,makayla,kamilla,masterbating,tennesse,holger,john1,matchbox,hores,poptart,parlament,goodyear,asdfgh1,02081970,hardwood,alain,erection,hfytnrb,highlife,implants,benjami,dipper,jeeper,bendover,supersonic,babybear,laserjet,gotenks,bama,natedogg,aol123,pokemo,rabbit1,raduga,sopranos,cashflow,menthol,pharao,hacking,334455,ghjcnbnenrf,lizzy,muffin1,pooky,penis1,flyer,gramma,dipset,becca,ireland1,diana1,donjuan,pong,ziggy1,alterego,simple1,cbr900,logger,111555,claudia1,cantona7,matisse,ljxtymrf,victori,harle,mamas,encore,mangos,iceman1,diamon,alexxx,tiamat,5000,desktop,mafia,smurf,princesa,shojou,blueberr,welkom,maximka,123890,123q123,tammy1,bobmarley,clips,demon666,ismail,termite,laser1,missie,altair,donna1,bauhaus,trinitron,mogwai,flyers88,juniper,nokia5800,boroda,jingles,qwerasdfzxcv,shakur,777666,legos,mallrats,1qazxsw,goldeneye,tamerlan,julia1,backbone,spleen,49ers,shady,darkone,medic1,justi,giggle,cloudy,aisan,douche,parkour,bluejay,huskers1,redwine,1qw23er4,satchmo,1231234,nineball,stewart1,ballsack,probes,kappa,amiga,flipper1,dortmund,963258,trigun,1237895,homepage,blinky,screwy,gizzmo,belkin,chemist,coolhand,chachi,braves1,thebest,greedisgood,pro100,banana1,101091m,123456g,wonderfu,barefeet,8inches,1111qqqq,kcchiefs,qweasdzxc123,metal1,jennifer1,xian,asdasd123,pollux,cheerleaers,fruity,mustang5,turbos,shopper,photon,espana,hillbill,oyster,macaroni,gigabyte,jesper,motown,tuxedo,buster12,triplex,cyclones,estrell,mortis,holla,456987,fiddle,sapphic,jurassic,thebeast,ghjcnjq,baura,spock1,metallica1,karaoke,nemrac58,love1234,02031970,flvbybcnhfnjh,frisbee,diva,ajax,feathers,flower1,soccer11,allday,mierda,pearl1,amature,marauder,333555,redheads,womans,egorka,godbless,159263,nimitz,aaaa1111,sashka,madcow,socce,greywolf,baboon,pimpdaddy,123456789r,reloaded,lancia,rfhfylfi,dicker,placid,grimace,22446688,olemiss,whores,culinary,wannabe,maxi,1234567aa,amelie,riley1,trample,phantom1,baberuth,bramble,asdfqwer,vides,4you,abc123456,taichi,aztnm,smother,outsider,hakr,blackhawk,bigblack,girlie,spook,valeriya,gianluca,freedo,1q2q3q4q,handbag,lavalamp,cumm,pertinant,whatup,nokia123,redlight,patrik,111aaa,poppy1,dfytxrf,aviator,sweeps,kristin1,cypher,elway,yinyang,access1,poophead,tucson,noles1,monterey,waterfal,dank,dougal,918273,suede,minnesot,legman,bukowski,ganja,mammoth,riverrat,asswipe,daredevi,lian,arizona1,kamikadze,alex1234,smile1,angel2,55bgates,bellagio,0001,wanrltw,stiletto,lipton,arsena,biohazard,bbking,chappy,tetris,as123456,darthvad,lilwayne,nopassword,7412369,123456789987654321,natchez,glitter,14785236,mytime,rubicon,moto,pyon,wazzup,tbird,shane1,nightowl,getoff,beckham7,trueblue,hotgirl,nevermin,deathnote,13131,taffy,bigal,copenhag,apricot,gallaries,dtkjcbgtl,totoro,onlyone,civicsi,jesse1,baby123,sierra1,festus,abacus,sickboy,fishtank,fungus,charle,golfpro,teensex,mario66,seaside,aleksei,rosewood,blackberry,1020304050,bedlam,schumi,deerhunt,contour,darkelf,surveyor,deltas,pitchers,741258963,dipstick,funny1,lizzard,112233445566,jupiter2,softtail,titman,greenman,z1x2c3v4b5,smartass,12345677,notnow,myworld,nascar1,chewbacc,nosferatu,downhill,dallas22,kuan,blazers,whales,soldat,craving,powerman,yfcntyf,hotrats,cfvceyu,qweasdzx,princess1,feline,qqwwee,chitown,1234qaz,mastermind,114477,dingbat,care1839,standby,kismet,atreides,dogmeat,icarus,monkeyboy,alex1,mouses,nicetits,sealteam,chopper1,crispy,winter99,rrpass1,myporn,myspace1,corazo,topolino,ass123,lawman,muffy,orgy,1love,passord,hooyah,ekmzyf,pretzel,amonra,nestle,01011950,jimbeam,happyman,z12345,stonewal,helios,manunited,harcore,dick1,gaymen,2hot4u,light1,qwerty13,kakashi,pjkjnj,alcatel,taylo,allah,buddydog,ltkmaby,mongo,blonds,start123,audia6,123456v,civilwar,bellaco,turtles,mustan,deadspin,aaa123,fynjirf,lucky123,tortoise,amor,summe,waterski,zulu,drag0n,dtxyjcnm,gizmos,strife,interacial,pusyy,goose1,bear1,equinox,matri,jaguar1,tobydog,sammys,nachos,traktor,bryan1,morgoth,444555,dasani,miami1,mashka,xxxxxx1,ownage,nightwin,hotlips,passmast,cool123,skolko,eldiablo,manu,1357908642,screwyou,badabing,foreplay,hydro,kubrick,seductive,demon1,comeon,galileo,aladdin,metoo,happines,902100,mizuno,caddy,bizzare,girls1,redone,ohmygod,sable,bonovox,girlies,hamper,opus,gizmodo1,aaabbb,pizzahut,999888,rocky2,anton1,kikimora,peavey,ocelot,a1a2a3a4,2wsx3edc,jackie1,solace,sprocket,galary,chuck1,volvo1,shurik,poop123,locutus,virago,wdtnjxtr,tequier,bisexual,doodles,makeitso,fishy,789632145,nothing1,fishcake,sentry,libertad,oaktree,fivestar,adidas1,vegitta,mississi,spiffy,carme,neutron,vantage,agassi,boners,123456789v,hilltop,taipan,barrage,kenneth1,fister,martian,willem,lfybkf,bluestar,moonman,ntktdbpjh,paperino,bikers,daffy,benji,quake,dragonfly,suckcock,danilka,lapochka,belinea,calypso,asshol,camero1,abraxas,mike1234,womam,q1q2q3q4q5,youknow,maxpower,pic's,audi80,sonora,raymond1,tickler,tadpole,belair,crazyman,finalfantasy,999000,jonatha,paisley,kissmyas,morgana,monste,mantra,spunk,magic123,jonesy,mark1,alessand,741258,baddest,ghbdtnrfrltkf,zxccxz,tictac,augustin,racers,7grout,foxfire,99762000,openit,nathanie,1z2x3c4v5b,seadog,gangbanged,lovehate,hondacbr,harpoon,mamochka,fisherma,bismilla,locust,wally1,spiderman1,saffron,utjhubq,123456987,20spanks,safeway,pisser,bdfyjd,kristen1,bigdick1,magenta,vfhujif,anfisa,friday13,qaz123wsx,0987654321q,tyrant,guan,meggie,kontol,nurlan,ayanami,rocket1,yaroslav,websol76,mutley,hugoboss,websolutions,elpaso,gagarin,badboys,sephirot,918273645,newuser,qian,edcrfv,booger1,852258,lockout,timoxa94,mazda323,firedog,sokolova,skydiver,jesus777,1234567890z,soulfly,canary,malinka,guillerm,hookers,dogfart,surfer1,osprey,india123,rhjkbr,stoppedby,nokia5530,123456789o,blue1,werter,divers,3000,123456f,alpina,cali,whoknows,godspeed,986532,foreskin,fuzzy1,heyyou,didier,slapnuts,fresno,rosebud1,sandman1,bears1,blade1,honeybun,queen1,baronn,pakista,philipp,9111961,topsecret,sniper1,214365,slipper,letsfuck,pippen33,godawgs,mousey,qw123456,scrotum,loveis,lighthou,bp2002,nancy123,jeffrey1,susieq,buddy2,ralphie,trout1,willi,antonov,sluttey,rehbwf,marty1,darian,losangeles,letme1n,12345d,pusssy,godiva,ender,golfnut,leonidas,a1b2c3d4e5,puffer,general1,wizzard,lehjxrf,racer1,bigbucks,cool12,buddys,zinger,esprit,vbienrf,josep,tickling,froggie,987654321a,895623,daddys,crumbs,gucci,mikkel,opiate,tracy1,christophe,came11,777555,petrovich,humbug,dirtydog,allstate,horatio,wachtwoord,creepers,squirts,rotary,bigd,georgia1,fujifilm,2sweet,dasha,yorkie,slimjim,wiccan,kenzie,system1,skunk,b12345,getit,pommes,daredevil,sugars,bucker,piston,lionheart,1bitch,515051,catfight,recon,icecold,fantom,vodafone,kontakt,boris1,vfcnth,canine,01011961,valleywa,faraon,chickenwing101,qq123456,livewire,livelife,roosters,jeepers,ilya1234,coochie,pavlik,dewalt,dfhdfhf,architec,blackops,1qaz2wsx3edc4rfv,rhfcjnf,wsxedc,teaser,sebora,25252,rhino1,ankara,swifty,decimal,redleg,shanno,nermal,candies,smirnova,dragon01,photo1,ranetki,a1s2d3f4g5,axio,wertzu,maurizio,6uldv8,zxcvasdf,punkass,flowe,graywolf,peddler,3rjs1la7qe,mpegs,seawolf,ladyboy,pianos,piggies,vixen,alexus,orpheus,gdtrfb,z123456,macgyver,hugetits,ralph1,flathead,maurici,mailru,goofball,nissan1,nikon,stopit,odin,big1,smooch,reboot,famil,bullit,anthony7,gerhard,methos,124038,morena,eagle2,jessica2,zebras,getlost,gfynthf,123581321,sarajevo,indon,comets,tatjana,rfgbnjirf,joystick,batman12,123456c,sabre,beerme,victory1,kitties,1475369,badboy1,booboo1,comcast,slava,squid,saxophon,lionhear,qaywsx,bustle,nastena,roadway,loader,hillside,starlight,24681012,niggers,access99,bazooka,molly123,blackice,bandi,cocacol,nfhfrfy,timur,muschi,horse1,quant4307s,squerting,oscars,mygirls,flashman,tangerin,goofy1,p0o9i8,housewifes,newness,monkey69,escorpio,password11,hippo,warcraft3,qazxsw123,qpalzm,ribbit,ghbdtndctv,bogota,star123,258000,lincoln1,bigjim,lacoste,firestorm,legenda,indain,ludacris,milamber,1009,evangeli,letmesee,a111111,hooters1,bigred1,shaker,husky,a4tech,cnfkrth,argyle,rjhjdf,nataha,0o9i8u7y,gibson1,sooners1,glendale,archery,hoochie,stooge,aaaaaa1,scorpions,school1,vegas1,rapier,mike23,bassoon,groupd2013,macaco,baker1,labia,freewill,santiag,silverado,butch1,vflfufcrfh,monica1,rugrat,cornhole,aerosmit,bionicle,gfgfvfvf,daniel12,virgo,fmale,favorite2,detroit1,pokey,shredder,baggies,wednesda,cosmo1,mimosa,sparhawk,firehawk,romario,911turbo,funtimes,fhntvrf,nexus6,159753456,timothy1,bajingan,terry1,frenchie,raiden,1mustang,babemagnet,74123698,nadejda,truffles,rapture,douglas1,lamborghini,motocross,rjcvjc,748596,skeeter1,dante1,angel666,telecom,carsten,pietro,bmw318,astro1,carpediem,samir,orang,helium,scirocco,fuzzball,rushmore,rebelz,hotspur,lacrimosa,chevys10,madonna1,domenico,yfnfirf,jachin,shelby1,bloke,dawgs,dunhill,atlanta1,service1,mikado,devilman,angelit,reznor,euphoria,lesbain,checkmat,browndog,phreak,blaze1,crash1,farida,mutter,luckyme,horsemen,vgirl,jediknig,asdas,cesare,allnight,rockey,starlite,truck1,passfan,close-up,samue,cazzo,wrinkles,homely,eatme1,sexpot,snapshot,dima1995,asthma,thetruth,ducky,blender,priyanka,gaucho,dutchman,sizzle,kakarot,651550,passcode,justinbieber,666333,elodie,sanjay,110442,alex01,lotus1,2300mj,lakshmi,zoomer,quake3,12349876,teapot,12345687,ramada,pennywis,striper,pilot1,chingon,optima,nudity,ethan1,euclid,beeline,loyola,biguns,zaq12345,bravo1,disney1,buffa,assmunch,vivid,6661313,wellingt,aqwzsx,madala11,9874123,sigmar,pictere,tiptop,bettyboop,dinero,tahiti,gregory1,bionic,speed1,fubar1,lexus1,denis1,hawthorn,saxman,suntzu,bernhard,dominika,camaro1,hunter12,balboa,bmw2002,seville,diablo1,vfhbyjxrf,1234abc,carling,lockerroom,punani,darth,baron1,vaness,1password,libido,picher,232425,karamba,futyn007,daydream,11001001,dragon123,friends1,bopper,rocky123,chooch,asslover,shimmer,riddler,openme,tugboat,sexy123,midori,gulnara,christo,swatch,laker,offroad,puddles,hackers,mannheim,manager1,horseman,roman1,dancer1,komputer,pictuers,nokia5130,ejaculation,lioness,123456y,evilone,nastenka,pushok,javie,lilman,3141592,mjolnir,toulouse,pussy2,bigworm,smoke420,fullback,extensa,dreamcast,belize,delboy,willie1,casablanca,csyjxtr,ricky1,bonghit,salvator,basher,pussylover,rosie1,963258741,vivitron,cobra427,meonly,armageddon,myfriend,zardoz,qwedsazxc,kraken,fzappa,starfox,333999,illmatic,capoeira,weenie,ramzes,freedom2,toasty,pupkin,shinigami,fhvfutljy,nocturne,churchil,thumbnils,tailgate,neworder,sexymama,goarmy,cerebus,michelle1,vbifyz,surfsup,earthlin,dabulls,basketbal,aligator,mojojojo,saibaba,welcome2,wifes,wdtnjr,12345w,slasher,papabear,terran,footman,hocke,153759,texans,tom123,sfgiants,billabong,aassdd,monolith,xxx777,l3tm31n,ticktock,newone,hellno,japanees,contortionist,admin123,scout1,alabama1,divx1,rochard,privat,radar1,bigdad,fhctybq,tortuga,citrus,avanti,fantasy1,woodstock,s12345,fireman1,embalmer,woodwork,bonzai,konyor,newstart,jigga,panorama,goats,smithy,rugrats,hotmama,daedalus,nonstop,fruitbat,lisenok,quaker,violator,12345123,my3sons,cajun,fraggle,gayboy,oldfart,vulva,knickerless,orgasms,undertow,binky,litle,kfcnjxrf,masturbation,bunnie,alexis1,planner,transexual,sparty,leeloo,monies,fozzie,stinger1,landrove,anakonda,scoobie,yamaha1,henti,star12,rfhlbyfk,beyonce,catfood,cjytxrf,zealots,strat,fordtruc,archangel,silvi,sativa,boogers,miles1,bigjoe,tulip,petite,greentea,shitter,jonboy,voltron,morticia,evanescence,3edc4rfv,longshot,windows1,serge,aabbcc,starbucks,sinful,drywall,prelude1,www123,camel1,homebrew,marlins,123412,letmeinn,domini,swampy,plokij,fordf350,webcam,michele1,bolivi,27731828,wingzero,qawsedrftg,shinji,sverige,jasper1,piper1,cummer,iiyama,gocats,amour,alfarome,jumanji,mike69,fantasti,1monkey,w00t88,shawn1,lorien,1a2s3d4f5g,koleso,murph,natascha,sunkist,kennwort,emine,grinder,m12345,q1q2q3q4,cheeba,money2,qazwsxedc1,diamante,prosto,pdiddy,stinky1,gabby1,luckys,franci,pornographic,moochie,gfhjdjp,samdog,empire1,comicbookdb,emili,motdepasse,iphone,braveheart,reeses,nebula,sanjose,bubba2,kickflip,arcangel,superbow,porsche911,xyzzy,nigger1,dagobert,devil1,alatam,monkey2,barbara1,12345v,vfpfafrf,alessio,babemagn,aceman,arrakis,kavkaz,987789,jasons,berserk,sublime1,rogue1,myspace,buckwhea,csyekz,pussy4me,vette1,boots1,boingo,arnaud,budlite,redstorm,paramore,becky1,imtheman,chango,marley1,milkyway,666555,giveme,mahalo,lux2000,lucian,paddy,praxis,shimano,bigpenis,creeper,newproject2004,rammstei,j3qq4h7h2v,hfljcnm,lambchop,anthony2,bugman,gfhjkm12,dreamer1,stooges,cybersex,diamant,cowboyup,maximus1,sentra,615243,goethe,manhatta,fastcar,selmer,1213141516,yfnfitymrf,denni,chewey,yankee1,elektra,123456789p,trousers,fishface,topspin,orwell,vorona,sodapop,motherfu,ibilltes,forall,kookie,ronald1,balrog,maximilian,mypasswo,sonny1,zzxxcc,tkfkdg,magoo,mdogg,heeled,gitara,lesbos,marajade,tippy,morozova,enter123,lesbean,pounded,asd456,fialka,scarab,sharpie,spanky1,gstring,sachin,12345asd,princeto,hellohel,ursitesux,billows,1234kekc,kombat,cashew,duracell,kseniya,sevenof9,kostik,arthur1,corvet07,rdfhnbhf,songoku,tiberian,needforspeed,1qwert,dropkick,kevin123,panache,libra,a123456a,kjiflm,vfhnsirf,cntgfy,iamcool,narut,buffer,sk8ordie,urlaub,fireblade,blanked,marishka,gemini1,altec,gorillaz,chief1,revival47,ironman1,space1,ramstein,doorknob,devilmaycry,nemesis1,sosiska,pennstat,monday1,pioner,shevchenko,detectiv,evildead,blessed1,aggie,coffees,tical,scotts,bullwink,marsel,krypto,adrock,rjitxrf,asmodeus,rapunzel,theboys,hotdogs,deepthro,maxpayne,veronic,fyyeirf,otter,cheste,abbey1,thanos,bedrock,bartok,google1,xxxzzz,rodent,montecarlo,hernande,mikayla,123456789l,bravehea,12locked,ltymub,pegasus1,ameteur,saltydog,faisal,milfnew,momsuck,everques,ytngfhjkz,m0nkey,businessbabe,cooki,custard,123456ab,lbvjxrf,outlaws,753357,qwerty78,udacha,insider,chees,fuckmehard,shotokan,katya,seahorse,vtldtlm,turtle1,mike12,beebop,heathe,everton1,darknes,barnie,rbcekz,alisher,toohot,theduke,555222,reddog1,breezy,bulldawg,monkeyman,baylee,losangel,mastermi,apollo1,aurelie,zxcvb12345,cayenne,bastet,wsxzaq,geibcnbr,yello,fucmy69,redwall,ladybird,bitchs,cccccc1,rktjgfnhf,ghjdthrf,quest1,oedipus,linus,impalass,fartman,12345k,fokker,159753a,optiplex,bbbbbb1,realtor,slipkno,santacru,rowdy,jelena,smeller,3984240,ddddd1,sexyme,janet1,3698741,eatme69,cazzone,today1,poobear,ignatius,master123,newpass1,heather2,snoopdogg,blondinka,pass12,honeydew,fuckthat,890098890,lovem,goldrush,gecko,biker1,llama,pendejo,avalanche,fremont,snowman1,gandolf,chowder,1a2b3c4d5e,flyguy,magadan,1fuck,pingvin,nokia5230,ab1234,lothar,lasers,bignuts,renee1,royboy,skynet,12340987,1122334,dragrace,lovely1,22334455,booter,12345612,corvett,123456qq,capital1,videoes,funtik,wyvern,flange,sammydog,hulkster,13245768,not4you,vorlon,omegared,l58jkdjp!,filippo,123mudar,samadams,petrus,chris12,charlie123,123456789123,icetea,sunderla,adrian1,123qweas,kazanova,aslan,monkey123,fktyeirf,goodsex,123ab,lbtest,banaan,bluenose,837519,asd12345,waffenss,whateve,1a2a3a4a,trailers,vfhbirf,bhbcrf,klaatu,turk182,monsoon,beachbum,sunbeam,succes,clyde1,viking1,rawhide,bubblegum,princ,mackenzi,hershey1,222555,dima55,niggaz,manatee,aquila,anechka,pamel,bugsbunn,lovel,sestra,newport1,althor,hornyman,wakeup,zzz111,phishy,cerber,torrent,thething,solnishko,babel,buckeye1,peanu,ethernet,uncencored,baraka,665544,chris2,rb26dett,willy1,choppers,texaco,biggirl,123456b,anna2614,sukebe,caralho,callofduty,rt6ytere,jesus7,angel12,1money,timelord,allblack,pavlova,romanov,tequiero,yitbos,lookup,bulls23,snowflake,dickweed,barks,lever,irisha,firestar,fred1234,ghjnjnbg,danman,gatito,betty1,milhouse,kbctyjr,masterbaiting,delsol,papit,doggys,123698741,bdfyjdf,invictus,bloods,kayla1,yourmama,apple2,angelok,bigboy1,pontiac1,verygood,yeshua,twins2,porn4me,141516,rasta69,james2,bosshog,candys,adventur,stripe,djkjlz,dokken,austin316,skins,hogwarts,vbhevbh,navigato,desperado,xxx666,cneltyn,vasiliy,hazmat,daytek,eightbal,fred1,four20,74227422,fabia,aerosmith,manue,wingchun,boohoo,hombre,sanity72,goatboy,fuckm,partizan,avrora,utahjazz,submarin,pussyeat,heinlein,control1,costaric,smarty,chuan,triplets,snowy,snafu,teacher1,vangogh,vandal,evergree,cochise,qwerty99,pyramid1,saab900,sniffer,qaz741,lebron23,mark123,wolvie,blackbelt,yoshi,feeder,janeway,nutella,fuking,asscock,deepak,poppie,bigshow,housewife,grils,tonto,cynthia1,temptress,irakli,belle1,russell1,manders,frank123,seabass,gforce,songbird,zippy1,naught,brenda1,chewy1,hotshit,topaz,43046721,girfriend,marinka,jakester,thatsme,planeta,falstaff,patrizia,reborn,riptide,cherry1,shuan,nogard,chino,oasis1,qwaszx12,goodlife,davis1,1911a1,harrys,shitfuck,12345678900,russian7,007700,bulls1,porshe,danil,dolphi,river1,sabaka,gobigred,deborah1,volkswagen,miamo,alkaline,muffdive,1letmein,fkbyrf,goodguy,hallo1,nirvan,ozzie,cannonda,cvbhyjdf,marmite,germany1,joeblow,radio1,love11,raindrop,159852,jacko,newday,fathead,elvis123,caspe,citibank,sports1,deuce,boxter,fakepass,golfman,snowdog,birthday4,nonmembe,niklas,parsifal,krasota,theshit,1235813,maganda,nikita1,omicron,cassie1,columbo,buick,sigma1,thistle,bassin,rickster,apteka,sienna,skulls,miamor,coolgirl,gravis,1qazxc,virgini,hunter2,akasha,batma,motorcyc,bambino,tenerife,fordf250,zhuan,iloveporn,markiza,hotbabes,becool,fynjybyf,wapapapa,forme,mamont,pizda,dragonz,sharon1,scrooge,mrbill,pfloyd,leeroy,natedog,ishmael,777111,tecumseh,carajo,nfy.irf,0000000000o,blackcock,fedorov,antigone,feanor,novikova,bobert,peregrin,spartan117,pumkin,rayman,manuals,tooltime,555333,bonethug,marina1,bonnie1,tonyhawk,laracroft,mahalkita,18273645,terriers,gamer,hoser,littlema,molotok,glennwei,lemon1,caboose,tater,12345654321,brians,fritz1,mistral,jigsaw,fuckshit,hornyguy,southside,edthom,antonio1,bobmarle,pitures,ilikesex,crafty,nexus,boarder,fulcrum,astonvil,yanks1,yngwie,account1,zooropa,hotlegs,sammi,gumbo,rover1,perkele,maurolarastefy,lampard,357753,barracud,dmband,abcxyz,pathfinder,335577,yuliya,micky,jayman,asdfg12345,1596321,halcyon,rerfhtre,feniks,zaxscd,gotyoass,jaycee,samson1,jamesb,vibrate,grandpri,camino,colossus,davidb,mamo4ka,nicky1,homer123,pinguin,watermelon,shadow01,lasttime,glider,823762,helen1,pyramids,tulane,osama,rostov,john12,scoote,bhbyrf,gohan,galeries,joyful,bigpussy,tonka,mowgli,astalavista,zzz123,leafs,dalejr8,unicorn1,777000,primal,bigmama,okmijn,killzone,qaz12345,snookie,zxcvvcxz,davidc,epson,rockman,ceaser,beanbag,katten,3151020,duckhunt,segreto,matros,ragnar,699669,sexsexse,123123z,fuckyeah,bigbutts,gbcmrf,element1,marketin,saratov,elbereth,blaster1,yamahar6,grime,masha,juneau,1230123,pappy,lindsay1,mooner,seattle1,katzen,lucent,polly1,lagwagon,pixie,misiaczek,666666a,smokedog,lakers24,eyeball,ironhors,ametuer,volkodav,vepsrf,kimmy,gumby1,poi098,ovation,1q2w3,drinker,penetrating,summertime,1dallas,prima,modles,takamine,hardwork,macintosh,tahoe,passthie,chiks,sundown,flowers1,boromir,music123,phaedrus,albert1,joung,malakas,gulliver,parker1,balder,sonne,jessie1,domainlock2005,express1,vfkbyf,youandme,raketa,koala,dhjnvytyjub,nhfrnjh,testibil,ybrbnjc,987654321q,axeman,pintail,pokemon123,dogggg,shandy,thesaint,11122233,x72jhhu3z,theclash,raptors,zappa1,djdjxrf,hell666,friday1,vivaldi,pluto1,lance1,guesswho,jeadmi,corgan,skillz,skippy1,mango1,gymnastic,satori,362514,theedge,cxfcnkbdfz,sparkey,deicide,bagels,lololol,lemmings,r4e3w2q1,silve,staind,schnuffi,dazzle,basebal1,leroy1,bilbo1,luckie,qwerty2,goodfell,hermione,peaceout,davidoff,yesterda,killah,flippy,chrisb,zelda1,headless,muttley,fuckof,tittys,catdaddy,photog,beeker,reaver,ram1500,yorktown,bolero,tryagain,arman,chicco,learjet,alexei,jenna1,go2hell,12s3t4p55,momsanaladventure,mustang9,protoss,rooter,ginola,dingo1,mojave,erica1,1qazse4,marvin1,redwolf,sunbird,dangerou,maciek,girsl,hawks1,packard1,excellen,dashka,soleda,toonces,acetate,nacked,jbond007,alligator,debbie1,wellhung,monkeyma,supers,rigger,larsson,vaseline,rjnzhf,maripos,123456asd,cbr600rr,doggydog,cronic,jason123,trekker,flipmode,druid,sonyvaio,dodges,mayfair,mystuff,fun4me,samanta,sofiya,magics,1ranger,arcane,sixtynin,222444,omerta,luscious,gbyudby,bobcats,envision,chance1,seaweed,holdem,tomate,mensch,slicer,acura1,goochi,qweewq,punter,repoman,tomboy,never1,cortina,gomets,147896321,369852147,dogma,bhjxrf,loglatin,eragon,strato,gazelle,growler,885522,klaudia,payton34,fuckem,butchie,scorpi,lugano,123456789k,nichola,chipper1,spide,uhbujhbq,rsalinas,vfylfhby,longhorns,bugatti,everquest,!qaz2wsx,blackass,999111,snakeman,p455w0rd,fanatic,family1,pfqxbr,777vlad,mysecret,marat,phoenix2,october1,genghis,panties1,cooker,citron,ace123,1234569,gramps,blackcoc,kodiak1,hickory,ivanhoe,blackboy,escher,sincity,beaks,meandyou,spaniel,canon1,timmy1,lancaste,polaroid,edinburg,fuckedup,hotman,cueball,golfclub,gopack,bookcase,worldcup,dkflbvbhjdbx,twostep,17171717aa,letsplay,zolushka,stella1,pfkegf,kingtut,67camaro,barracuda,wiggles,gjhjkm,prancer,patata,kjifhf,theman1,romanova,sexyass,copper1,dobber,sokolov,pomidor,algernon,cadman,amoremio,william2,silly1,bobbys,hercule,hd764nw5d7e1vb1,defcon,deutschland,robinhood,alfalfa,machoman,lesbens,pandora1,easypay,tomservo,nadezhda,goonies,saab9000,jordyn,f15eagle,dbrecz,12qwerty,greatsex,thrawn,blunted,baywatch,doggystyle,loloxx,chevy2,january1,kodak,bushel,78963214,ub6ib9,zz8807zpl,briefs,hawker,224488,first1,bonzo,brent1,erasure,69213124,sidewind,soccer13,622521,mentos,kolibri,onepiece,united1,ponyboy,keksa12,wayer,mypussy,andrej,mischa,mille,bruno123,garter,bigpun,talgat,familia,jazzy1,mustang8,newjob,747400,bobber,blackbel,hatteras,ginge,asdfjkl;,camelot1,blue44,rebbyt34,ebony1,vegas123,myboys,aleksander,ijrjkflrf,lopata,pilsner,lotus123,m0nk3y,andreev,freiheit,balls1,drjynfrnt,mazda1,waterpolo,shibumi,852963,123bbb,cezer121,blondie1,volkova,rattler,kleenex,ben123,sanane,happydog,satellit,qazplm,qazwsxedcrfvtgb,meowmix,badguy,facefuck,spice1,blondy,major1,25000,anna123,654321a,sober1,deathrow,patterso,china1,naruto1,hawkeye1,waldo1,butchy,crayon,5tgb6yhn,klopik,crocodil,mothra,imhorny,pookie1,splatter,slippy,lizard1,router,buratino,yahweh,123698,dragon11,123qwe456,peepers,trucker1,ganjaman,1hxboqg2,cheyanne,storys,sebastie,zztop,maddison,4rfv3edc,darthvader,jeffro,iloveit,victor1,hotty,delphin,lifeisgood,gooseman,shifty,insertions,dude123,abrupt,123masha,boogaloo,chronos,stamford,pimpster,kthjxrf,getmein,amidala,flubber,fettish,grapeape,dantes,oralsex,jack1,foxcg33,winchest,francis1,getin,archon,cliffy,blueman,1basebal,sport1,emmitt22,porn123,bignasty,morga,123hfjdk147,ferrar,juanito,fabiol,caseydog,steveo,peternorth,paroll,kimchi,bootleg,gaijin,secre,acacia,eatme2,amarillo,monkey11,rfhfgep,tylers,a1a2a3a4a5,sweetass,blower,rodina,babushka,camilo,cimbom,tiffan,vfnbkmlf,ohbaby,gotigers,lindsey1,dragon13,romulus,qazxsw12,zxcvbn1,dropdead,hitman47,snuggle,eleven11,bloopers,357mag,avangard,bmw320,ginscoot,dshade,masterkey,voodoo1,rootedit,caramba,leahcim,hannover,8phrowz622,tim123,cassius,000000a,angelito,zzzzz1,badkarma,star1,malaga,glenwood,footlove,golf1,summer12,helpme1,fastcars,titan1,police1,polinka,k.jdm,marusya,augusto,shiraz,pantyhose,donald1,blaise,arabella,brigada,c3por2d2,peter01,marco1,hellow,dillweed,uzumymw,geraldin,loveyou2,toyota1,088011,gophers,indy500,slainte,5hsu75kpot,teejay,renat,racoon,sabrin,angie1,shiznit,harpua,sexyred,latex,tucker1,alexandru,wahoo,teamwork,deepblue,goodison,rundmc,r2d2c3p0,puppys,samba,ayrton,boobed,999777,topsecre,blowme1,123321z,loudog,random1,pantie,drevil,mandolin,121212q,hottub,brother1,failsafe,spade1,matvey,open1234,carmen1,priscill,schatzi,kajak,gooddog,trojans1,gordon1,kayak,calamity,argent,ufhvjybz,seviyi,penfold,assface,dildos,hawkwind,crowbar,yanks,ruffles,rastus,luv2epus,open123,aquafina,dawns,jared1,teufel,12345c,vwgolf,pepsi123,amores,passwerd,01478520,boliva,smutty,headshot,password3,davidd,zydfhm,gbgbcmrf,pornpass,insertion,ceckbr,test2,car123,checkit,dbnfkbq,niggas,nyyankee,muskrat,nbuhtyjr,gunner1,ocean1,fabienne,chrissy1,wendys,loveme89,batgirl,cerveza,igorek,steel1,ragman,boris123,novifarm,sexy12,qwerty777,mike01,giveitup,123456abc,fuckall,crevice,hackerz,gspot,eight8,assassins,texass,swallows,123458,baldur,moonshine,labatt,modem,sydney1,voland,dbnfkz,hotchick,jacker,princessa,dawgs1,holiday1,booper,reliant,miranda1,jamaica1,andre1,badnaamhere,barnaby,tiger7,david12,margaux,corsica,085tzzqi,universi,thewall,nevermor,martin6,qwerty77,cipher,apples1,0102030405,seraphim,black123,imzadi,gandon,ducati99,1shadow,dkflbvbhjdyf,44magnum,bigbad,feedme,samantha1,ultraman,redneck1,jackdog,usmc0311,fresh1,monique1,tigre,alphaman,cool1,greyhoun,indycar,crunchy,55chevy,carefree,willow1,063dyjuy,xrated,assclown,federica,hilfiger,trivia,bronco1,mamita,100200300,simcity,lexingky,akatsuki,retsam,johndeere,abudfv,raster,elgato,businka,satanas,mattingl,redwing1,shamil,patate,mannn,moonstar,evil666,b123456,bowl300,tanechka,34523452,carthage,babygir,santino,bondarenko,jesuss,chico1,numlock,shyguy,sound1,kirby1,needit,mostwanted,427900,funky1,steve123,passions,anduril,kermit1,prospero,lusty,barakuda,dream1,broodwar,porky,christy1,mahal,yyyyyy1,allan1,1sexy,flintsto,capri,cumeater,heretic,robert2,hippos,blindax,marykay,collecti,kasumi,1qaz!qaz,112233q,123258,chemistr,coolboy,0o9i8u,kabuki,righton,tigress,nessie,sergej,andrew12,yfafyz,ytrhjvfyn,angel7,victo,mobbdeep,lemming,transfor,1725782,myhouse,aeynbr,muskie,leno4ka,westham1,cvbhyjd,daffodil,pussylicker,pamela1,stuffer,warehous,tinker1,2w3e4r,pluton,louise1,polarbea,253634,prime1,anatoliy,januar,wysiwyg,cobraya,ralphy,whaler,xterra,cableguy,112233a,porn69,jamesd,aqualung,jimmy123,lumpy,luckyman,kingsize,golfing1,alpha7,leeds1,marigold,lol1234,teabag,alex11,10sne1,saopaulo,shanny,roland1,basser,3216732167,carol1,year2005,morozov,saturn1,joseluis,bushed,redrock,memnoch,lalaland,indiana1,lovegod,gulnaz,buffalos,loveyou1,anteater,pattaya,jaydee,redshift,bartek,summerti,coffee1,ricochet,incest,schastie,rakkaus,h2opolo,suikoden,perro,dance1,loveme1,whoopass,vladvlad,boober,flyers1,alessia,gfcgjhn,pipers,papaya,gunsling,coolone,blackie1,gonads,gfhjkzytn,foxhound,qwert12,gangrel,ghjvtntq,bluedevi,mywife,summer01,hangman,licorice,patter,vfr750,thorsten,515253,ninguna,dakine,strange1,mexic,vergeten,12345432,8phrowz624,stampede,floyd1,sailfish,raziel,ananda,giacomo,freeme,crfprf,74185296,allstars,master01,solrac,gfnhbjn,bayliner,bmw525,3465xxx,catter,single1,michael3,pentium4,nitrox,mapet123456,halibut,killroy,xxxxx1,phillip1,poopsie,arsenalfc,buffys,kosova,all4me,32165498,arslan,opensesame,brutis,charles2,pochta,nadegda,backspac,mustang0,invis,gogeta,654321q,adam25,niceday,truckin,gfdkbr,biceps,sceptre,bigdave,lauras,user345,sandys,shabba,ratdog,cristiano,natha,march13,gumball,getsdown,wasdwasd,redhead1,dddddd1,longlegs,13572468,starsky,ducksoup,bunnys,omsairam,whoami,fred123,danmark,flapper,swanky,lakings,yfhenj,asterios,rainier,searcher,dapper,ltdjxrf,horsey,seahawk,shroom,tkfkdgo,aquaman,tashkent,number9,messi10,1asshole,milenium,illumina,vegita,jodeci,buster01,bareback,goldfinger,fire1,33rjhjds,sabian,thinkpad,smooth1,sully,bonghits,sushi1,magnavox,colombi,voiture,limpone,oldone,aruba,rooster1,zhenya,nomar5,touchdow,limpbizkit,rhfcfdxbr,baphomet,afrodita,bball1,madiso,ladles,lovefeet,matthew2,theworld,thunderbird,dolly1,123rrr,forklift,alfons,berkut,speedy1,saphire,oilman,creatine,pussylov,bastard1,456258,wicked1,filimon,skyline1,fucing,yfnfkbz,hot123,abdulla,nippon,nolimits,billiard,booty1,buttplug,westlife,coolbean,aloha1,lopas,asasin,1212121,october2,whodat,good4u,d12345,kostas,ilya1992,regal,pioneer1,volodya,focus1,bastos,nbvjif,fenix,anita1,vadimka,nickle,jesusc,123321456,teste,christ1,essendon,evgenii,celticfc,adam1,forumwp,lovesme,26exkp,chillout,burly,thelast1,marcus1,metalgear,test11,ronaldo7,socrate,world1,franki,mommie,vicecity,postov1000,charlie3,oldschool,333221,legoland,antoshka,counterstrike,buggy,mustang3,123454,qwertzui,toons,chesty,bigtoe,tigger12,limpopo,rerehepf,diddle,nokia3250,solidsnake,conan1,rockroll,963369,titanic1,qwezxc,cloggy,prashant,katharin,maxfli,takashi,cumonme,michael9,mymother,pennstate,khalid,48151623,fightclub,showboat,mateusz,elrond,teenie,arrow1,mammamia,dustydog,dominator,erasmus,zxcvb1,1a2a3a,bones1,dennis1,galaxie,pleaseme,whatever1,junkyard,galadriel,charlies,2wsxzaq1,crimson1,behemoth,teres,master11,fairway,shady1,pass99,1batman,joshua12,baraban,apelsin,mousepad,melon,twodogs,123321qwe,metalica,ryjgrf,pipiska,rerfhfxf,lugnut,cretin,iloveu2,powerade,aaaaaaa1,omanko,kovalenko,isabe,chobits,151nxjmt,shadow11,zcxfcnkbdf,gy3yt2rgls,vfhbyrf,159753123,bladerunner,goodone,wonton,doodie,333666999,fuckyou123,kitty123,chisox,orlando1,skateboa,red12345,destroye,snoogans,satan1,juancarlo,goheels,jetson,scottt,fuckup,aleksa,gfhfljrc,passfind,oscar123,derrick1,hateme,viper123,pieman,audi100,tuffy,andover,shooter1,10000,makarov,grant1,nighthaw,13576479,browneye,batigol,nfvfhf,chocolate1,7hrdnw23,petter,bantam,morlii,jediknight,brenden,argonaut,goodstuf,wisconsi,315920,abigail1,dirtbag,splurge,k123456,lucky777,valdepen,gsxr600,322223,ghjnjrjk,zaq1xsw2cde3,schwanz,walter1,letmein22,nomads,124356,codeblue,nokian70,fucke,footbal1,agyvorc,aztecs,passw0r,smuggles,femmes,ballgag,krasnodar,tamuna,schule,sixtynine,empires,erfolg,dvader,ladygaga,elite1,venezuel,nitrous,kochamcie,olivia1,trustn01,arioch,sting1,131415,tristar,555000,maroon,135799,marsik,555556,fomoco,natalka,cwoui,tartan,davecole,nosferat,hotsauce,dmitry,horus,dimasik,skazka,boss302,bluebear,vesper,ultras,tarantul,asd123asd,azteca,theflash,8ball,1footbal,titlover,lucas123,number6,sampson1,789852,party1,dragon99,adonai,carwash,metropol,psychnau,vthctltc,hounds,firework,blink18,145632,wildcat1,satchel,rice80,ghtktcnm,sailor1,cubano,anderso,rocks1,mike11,famili,dfghjc,besiktas,roygbiv,nikko,bethan,minotaur,rakesh,orange12,hfleuf,jackel,myangel,favorite7,1478520,asssss,agnieszka,haley1,raisin,htubyf,1buster,cfiekz,derevo,1a2a3a4a5a,baltika,raffles,scruffy1,clitlick,louis1,buddha1,fy.nrf,walker1,makoto,shadow2,redbeard,vfvfvskfhfve,mycock,sandydog,lineman,network1,favorite8,longdick,mustangg,mavericks,indica,1killer,cisco1,angelofwar,blue69,brianna1,bubbaa,slayer666,level42,baldrick,brutus1,lowdown,haribo,lovesexy,500000,thissuck,picker,stephy,1fuckme,characte,telecast,1bigdog,repytwjdf,thematrix,hammerhe,chucha,ganesha,gunsmoke,georgi,sheltie,1harley,knulla,sallas,westie,dragon7,conker,crappie,margosha,lisboa,3e2w1q,shrike,grifter,ghjcnjghjcnj,asdfg1,mnbvcxz1,myszka,posture,boggie,rocketman,flhtyfkby,twiztid,vostok,pi314159,force1,televizor,gtkmvtym,samhain,imcool,jadzia,dreamers,strannik,k2trix,steelhea,nikitin,commodor,brian123,chocobo,whopper,ibilljpf,megafon,ararat,thomas12,ghbrjkbcn,q1234567890,hibernia,kings1,jim123,redfive,68camaro,iawgk2,xavier1,1234567u,d123456,ndirish,airborn,halfmoon,fluffy1,ranchero,sneaker,soccer2,passion1,cowman,birthday1,johnn,razzle,glock17,wsxqaz,nubian,lucky2,jelly1,henderso,eric1,123123e,boscoe01,fuck0ff,simpson1,sassie,rjyjgkz,nascar3,watashi,loredana,janus,wilso,conman,david2,mothe,iloveher,snikers,davidj,fkmnthyfnbdf,mettss,ratfink,123456h,lostsoul,sweet16,brabus,wobble,petra1,fuckfest,otters,sable1,svetka,spartacu,bigstick,milashka,1lover,pasport,champagn,papichul,hrvatska,hondacivic,kevins,tacit,moneybag,gohogs,rasta1,246813579,ytyfdbcnm,gubber,darkmoon,vitaliy,233223,playboys,tristan1,joyce1,oriflame,mugwump,access2,autocad,thematri,qweqwe123,lolwut,ibill01,multisyn,1233211,pelikan,rob123,chacal,1234432,griffon,pooch,dagestan,geisha,satriani,anjali,rocketma,gixxer,pendrago,vincen,hellokit,killyou,ruger,doodah,bumblebe,badlands,galactic,emachines,foghorn,jackso,jerem,avgust,frontera,123369,daisymae,hornyboy,welcome123,tigger01,diabl,angel13,interex,iwantsex,rockydog,kukolka,sawdust,online1,3234412,bigpapa,jewboy,3263827,dave123,riches,333222,tony1,toggle,farter,124816,tities,balle,brasilia,southsid,micke,ghbdtn12,patit,ctdfcnjgjkm,olds442,zzzzzz1,nelso,gremlins,gypsy1,carter1,slut69,farcry,7415963,michael8,birdie1,charl,123456789abc,100001,aztec,sinjin,bigpimpi,closeup,atlas1,nvidia,doggone,classic1,manana,malcolm1,rfkbyf,hotbabe,rajesh,dimebag,ganjubas,rodion,jagr68,seren,syrinx,funnyman,karapuz,123456789n,bloomin,admin18533362,biggdogg,ocarina,poopy1,hellome,internet1,booties,blowjobs,matt1,donkey1,swede,1jennife,evgeniya,lfhbyf,coach1,444777,green12,patryk,pinewood,justin12,271828,89600506779,notredame,tuborg,lemond,sk8ter,million1,wowser,pablo1,st0n3,jeeves,funhouse,hiroshi,gobucs,angeleye,bereza,winter12,catalin,qazedc,andros,ramazan,vampyre,sweethea,imperium,murat,jamest,flossy,sandeep,morgen,salamandra,bigdogg,stroller,njdevils,nutsack,vittorio,%%passwo,playful,rjyatnrf,tookie,ubnfhf,michi,777444,shadow13,devils1,radiance,toshiba1,beluga,amormi,dandfa,trust1,killemall,smallville,polgara,billyb,landscap,steves,exploite,zamboni,damage11,dzxtckfd,trader12,pokey1,kobe08,damager,egorov,dragon88,ckfdbr,lisa69,blade2,audis4,nelson1,nibbles,23176djivanfros,mutabor,artofwar,matvei,metal666,hrfzlz,schwinn,poohbea,seven77,thinker,123456789qwerty,sobriety,jakers,karamelka,vbkfyf,volodin,iddqd,dale03,roberto1,lizaveta,qqqqqq1,cathy1,08154711,davidm,quixote,bluenote,tazdevil,katrina1,bigfoot1,bublik,marma,olechka,fatpussy,marduk,arina,nonrev67,qqqq1111,camill,wtpfhm,truffle,fairview,mashina,voltaire,qazxswedcvfr,dickface,grassy,lapdance,bosstone,crazy8,yackwin,mobil,danielit,mounta1n,player69,bluegill,mewtwo,reverb,cnthdf,pablito,a123321,elena1,warcraft1,orland,ilovemyself,rfntyjr,joyride,schoo,dthjxrf,thetachi,goodtimes,blacksun,humpty,chewbacca,guyute,123xyz,lexicon,blue45,qwe789,galatasaray,centrino,hendrix1,deimos,saturn5,craig1,vlad1996,sarah123,tupelo,ljrnjh,hotwife,bingos,1231231,nicholas1,flamer,pusher,1233210,heart1,hun999,jiggy,giddyup,oktober,123456zxc,budda,galahad,glamur,samwise,oneton,bugsbunny,dominic1,scooby2,freetime,internat,159753852,sc00ter,wantit,mazinger,inflames,laracrof,greedo,014789,godofwar,repytwjd,water123,fishnet,venus1,wallace1,tenpin,paula1,1475963,mania,novikov,qwertyasdfgh,goldmine,homies,777888999,8balls,holeinon,paper1,samael,013579,mansur,nikit,ak1234,blueline,polska1,hotcock,laredo,windstar,vbkbwbz,raider1,newworld,lfybkrf,catfish1,shorty1,piranha,treacle,royale,2234562,smurfs,minion,cadence,flapjack,123456p,sydne,135531,robinhoo,nasdaq,decatur,cyberonline,newage,gemstone,jabba,touchme,hooch,pigdog,indahous,fonzie,zebra1,juggle,patrick2,nihongo,hitomi,oldnavy,qwerfdsa,ukraina,shakti,allure,kingrich,diane1,canad,piramide,hottie1,clarion,college1,5641110,connect1,therion,clubber,velcro,dave1,astra1,13579-,astroboy,skittle,isgreat,photoes,cvzefh1gkc,001100,2cool4u,7555545,ginger12,2wsxcde3,camaro69,invader,domenow,asd1234,colgate,qwertasdfg,jack123,pass01,maxman,bronte,whkzyc,peter123,bogie,yecgaa,abc321,1qay2wsx,enfield,camaroz2,trashman,bonefish,system32,azsxdcfvgb,peterose,iwantyou,dick69,temp1234,blastoff,capa200,connie1,blazin,12233445,sexybaby,123456j,brentfor,pheasant,hommer,jerryg,thunders,august1,lager,kapusta,boobs1,nokia5300,rocco1,xytfu7,stars1,tugger,123sas,blingbling,1bubba,0wnsyo0,1george,baile,richard2,habana,1diamond,sensatio,1golfer,maverick1,1chris,clinton1,michael7,dragons1,sunrise1,pissant,fatim,mopar1,levani,rostik,pizzapie,987412365,oceans11,748159263,cum4me,palmetto,4r3e2w1q,paige1,muncher,arsehole,kratos,gaffer,banderas,billys,prakash,crabby,bungie,silver12,caddis,spawn1,xboxlive,sylvania,littlebi,524645,futura,valdemar,isacs155,prettygirl,big123,555444,slimer,chicke,newstyle,skypilot,sailormoon,fatluvr69,jetaime,sitruc,jesuschrist,sameer,bear12,hellion,yendor,country1,etnies,conejo,jedimast,darkknight,toobad,yxcvbn,snooks,porn4life,calvary,alfaromeo,ghostman,yannick,fnkfynblf,vatoloco,homebase,5550666,barret,1111111111zz,odysseus,edwardss,favre4,jerrys,crybaby,xsw21qaz,firestor,spanks,indians1,squish,kingair,babycakes,haters,sarahs,212223,teddyb,xfactor,cumload,rhapsody,death123,three3,raccoon,thomas2,slayer66,1q2q3q4q5q,thebes,mysterio,thirdeye,orkiox.,nodoubt,bugsy,schweiz,dima1996,angels1,darkwing,jeronimo,moonpie,ronaldo9,peaches2,mack10,manish,denise1,fellowes,carioca,taylor12,epaulson,makemoney,oc247ngucz,kochanie,3edcvfr4,vulture,1qw23e,1234567z,munchie,picard1,xthtgfirf,sportste,psycho1,tahoe1,creativ,perils,slurred,hermit,scoob,diesel1,cards1,wipeout,weeble,integra1,out3xf,powerpc,chrism,kalle,ariadne,kailua,phatty,dexter1,fordman,bungalow,paul123,compa,train1,thejoker,jys6wz,pussyeater,eatmee,sludge,dominus,denisa,tagheuer,yxcvbnm,bill1,ghfdlf,300zx,nikita123,carcass,semaj,ramone,muenchen,animal1,greeny,annemari,dbrf134,jeepcj7,mollys,garten,sashok,ironmaid,coyotes,astoria,george12,westcoast,primetim,123456o,panchito,rafae,japan1,framer,auralo,tooshort,egorova,qwerty22,callme,medicina,warhawk,w1w2w3w4,cristia,merli,alex22,kawaii,chatte,wargames,utvols,muaddib,trinket,andreas1,jjjjj1,cleric,scooters,cuntlick,gggggg1,slipknot1,235711,handcuff,stussy,guess1,leiceste,ppppp1,passe,lovegun,chevyman,hugecock,driver1,buttsex,psychnaut1,cyber1,black2,alpha12,melbourn,man123,metalman,yjdsqujl,blondi,bungee,freak1,stomper,caitlin1,nikitina,flyaway,prikol,begood,desperad,aurelius,john1234,whosyourdaddy,slimed123,bretagne,den123,hotwheel,king123,roodypoo,izzicam,save13tx,warpten,nokia3310,samolet,ready1,coopers,scott123,bonito,1aaaaa,yomomma,dawg1,rache,itworks,asecret,fencer,451236,polka,olivetti,sysadmin,zepplin,sanjuan,479373,lickem,hondacrx,pulamea,future1,naked1,sexyguy,w4g8at,lollol1,declan,runner1,rumple,daddy123,4snz9g,grandprix,calcio,whatthefuck,nagrom,asslick,pennst,negrit,squiggy,1223334444,police22,giovann,toronto1,tweet,yardbird,seagate,truckers,554455,scimitar,pescator,slydog,gaysex,dogfish,fuck777,12332112,qazxswed,morkovka,daniela1,imback,horny69,789123456,123456789w,jimmy2,bagger,ilove69,nikolaus,atdhfkm,rebirth,1111aaaa,pervasive,gjgeufq,dte4uw,gfhnbpfy,skeletor,whitney1,walkman,delorean,disco1,555888,as1234,ishikawa,fuck12,reaper1,dmitrii,bigshot,morrisse,purgen,qwer4321,itachi,willys,123123qwe,kisska,roma123,trafford,sk84life,326159487,pedros,idiom,plover,bebop,159875321,jailbird,arrowhea,qwaszx123,zaxscdvf,catlover,bakers,13579246,bones69,vermont1,helloyou,simeon,chevyz71,funguy,stargaze,parolparol,steph1,bubby,apathy,poppet,laxman,kelly123,goodnews,741236,boner1,gaetano,astonvilla,virtua,luckyboy,rocheste,hello2u,elohim,trigger1,cstrike,pepsicola,miroslav,96385274,fistfuck,cheval,magyar,svetlanka,lbfyjxrf,mamedov,123123123q,ronaldo1,scotty1,1nicole,pittbull,fredd,bbbbb1,dagwood,gfhkfvtyn,ghblehrb,logan5,1jordan,sexbomb,omega2,montauk,258741,dtythf,gibbon,winamp,thebomb,millerli,852654,gemin,baldy,halflife2,dragon22,mulberry,morrigan,hotel6,zorglub,surfin,951159,excell,arhangel,emachine,moses1,968574,reklama,bulldog2,cuties,barca,twingo,saber,elite11,redtruck,casablan,ashish,moneyy,pepper12,cnhtktw,rjcnbr,arschloch,phenix,cachorro,sunita,madoka,joselui,adams1,mymoney,hemicuda,fyutkjr,jake12,chicas,eeeee1,sonnyboy,smarties,birdy,kitten1,cnfcbr,island1,kurosaki,taekwond,konfetka,bennett1,omega3,jackson2,fresca,minako,octavian,kban667,feyenoord,muaythai,jakedog,fktrcfylhjdyf,1357911q,phuket,sexslave,fktrcfylhjdbx,asdfjk,89015173454,qwerty00,kindbud,eltoro,sex6969,nyknicks,12344321q,caballo,evenflow,hoddle,love22,metro1,mahalko,lawdog,tightass,manitou,buckie,whiskey1,anton123,335533,password4,primo,ramair,timbo,brayden,stewie,pedro1,yorkshir,ganster,hellothe,tippy1,direwolf,genesi,rodrig,enkeli,vaz21099,sorcerer,winky,oneshot,boggle,serebro,badger1,japanes,comicbook,kamehame,alcat,denis123,echo45,sexboy,gr8ful,hondo,voetbal,blue33,2112rush,geneviev,danni1,moosey,polkmn,matthew7,ironhead,hot2trot,ashley12,sweeper,imogen,blue21,retep,stealth1,guitarra,bernard1,tatian,frankfur,vfnhbwf,slacking,haha123,963741,asdasdas,katenok,airforce1,123456789qaz,shotgun1,12qwasz,reggie1,sharo,976431,pacifica,dhip6a,neptun,kardon,spooky1,beaut,555555a,toosweet,tiedup,11121314,startac,lover69,rediska,pirata,vfhrbp,1234qwerty,energize,hansolo1,playbo,larry123,oemdlg,cnjvfnjkju,a123123,alexan,gohawks,antonius,fcbayern,mambo,yummy1,kremlin,ellen1,tremere,vfiekz,bellevue,charlie9,izabella,malishka,fermat,rotterda,dawggy,becket,chasey,kramer1,21125150,lolit,cabrio,schlong,arisha,verity,3some,favorit,maricon,travelle,hotpants,red1234,garrett1,home123,knarf,seven777,figment,asdewq,canseco,good2go,warhol,thomas01,pionee,al9agd,panacea,chevy454,brazzers,oriole,azerty123,finalfan,patricio,northsta,rebelde,bulldo,stallone,boogie1,7uftyx,cfhfnjd,compusa,cornholi,config,deere,hoopster,sepultura,grasshop,babygurl,lesbo,diceman,proverbs,reddragon,nurbek,tigerwoo,superdup,buzzsaw,kakaroto,golgo13,edwar,123qaz123,butter1,sssss1,texas2,respekt,ou812ic,123456qaz,55555a,doctor1,mcgwire,maria123,aol999,cinders,aa1234,joness,ghbrjkmyj,makemone,sammyboy,567765,380zliki,theraven,testme,mylene,elvira26,indiglo,tiramisu,shannara,baby1,123666,gfhreh,papercut,johnmish,orange8,bogey1,mustang7,bagpipes,dimarik,vsijyjr,4637324,ravage,cogito,seven11,natashka,warzone,hr3ytm,4free,bigdee,000006,243462536,bigboi,123333,trouts,sandy123,szevasz,monica2,guderian,newlife1,ratchet,r12345,razorbac,12345i,piazza31,oddjob,beauty1,fffff1,anklet,nodrog,pepit,olivi,puravida,robert12,transam1,portman,bubbadog,steelers1,wilson1,eightball,mexico1,superboy,4rfv5tgb,mzepab,samurai1,fuckslut,colleen1,girdle,vfrcbvec,q1w2e3r4t,soldier1,19844891,alyssa1,a12345a,fidelis,skelter,nolove,mickeymouse,frehley,password69,watermel,aliska,soccer15,12345e,ladybug1,abulafia,adagio,tigerlil,takehana,hecate,bootneck,junfan,arigato,wonkette,bobby123,trustnoone,phantasm,132465798,brianjo,w12345,t34vfrc1991,deadeye,1robert,1daddy,adida,check1,grimlock,muffi,airwalk,prizrak,onclick,longbeac,ernie1,eadgbe,moore1,geniu,shadow123,bugaga,jonathan1,cjrjkjdf,orlova,buldog,talon1,westport,aenima,541233432442,barsuk,chicago2,kellys,hellbent,toughguy,iskander,skoal,whatisit,jake123,scooter2,fgjrfkbgcbc,ghandi,love13,adelphia,vjhrjdrf,adrenali,niunia,jemoeder,rainbo,all4u8,anime1,freedom7,seraph,789321,tommys,antman,firetruc,neogeo,natas,bmwm3,froggy1,paul1,mamit,bayview,gateways,kusanagi,ihateu,frederi,rock1,centurion,grizli,biggin,fish1,stalker1,3girls,ilovepor,klootzak,lollo,redsox04,kirill123,jake1,pampers,vasya,hammers1,teacup,towing,celtic1,ishtar,yingyang,4904s677075,dahc1,patriot1,patrick9,redbirds,doremi,rebecc,yoohoo,makarova,epiphone,rfgbnfy,milesd,blister,chelseafc,katana1,blackrose,1james,primrose,shock5,hard1,scooby12,c6h12o6,dustoff,boing,chisel,kamil,1william,defiant1,tyvugq,mp8o6d,aaa340,nafets,sonnet,flyhigh,242526,crewcom,love23,strike1,stairway,katusha,salamand,cupcake1,password0,007james,sunnie,multisync,harley01,tequila1,fred12,driver8,q8zo8wzq,hunter01,mozzer,temporar,eatmeraw,mrbrownxx,kailey,sycamore,flogger,tincup,rahasia,ganymede,bandera,slinger,1111122222,vander,woodys,1cowboy,khaled,jamies,london12,babyboo,tzpvaw,diogenes,budice,mavrick,135797531,cheeta,macros,squonk,blackber,topfuel,apache1,falcon16,darkjedi,cheeze,vfhvtkfl,sparco,change1,gfhfif,freestyl,kukuruza,loveme2,12345f,kozlov,sherpa,marbella,44445555,bocephus,1winner,alvar,hollydog,gonefish,iwantin,barman,godislove,amanda18,rfpfynbg,eugen,abcdef1,redhawk,thelema,spoonman,baller1,harry123,475869,tigerman,cdtnjxrf,marillio,scribble,elnino,carguy,hardhead,l2g7k3,troopers,selen,dragon76,antigua,ewtosi,ulysse,astana,paroli,cristo,carmex,marjan,bassfish,letitbe,kasparov,jay123,19933991,blue13,eyecandy,scribe,mylord,ukflbjkec,ellie1,beaver1,destro,neuken,halfpint,ameli,lilly1,satanic,xngwoj,12345trewq,asdf1,bulldogg,asakura,jesucrist,flipside,packers4,biggy,kadett,biteme69,bobdog,silverfo,saint1,bobbo,packman,knowledg,foolio,fussbal,12345g,kozerog,westcoas,minidisc,nbvcxw,martini1,alastair,rasengan,superbee,memento,porker,lena123,florenc,kakadu,bmw123,getalife,bigsky,monkee,people1,schlampe,red321,memyself,0147896325,12345678900987654321,soccer14,realdeal,gfgjxrf,bella123,juggs,doritos,celtics1,peterbilt,ghbdtnbrb,gnusmas,xcountry,ghbdtn1,batman99,deusex,gtnhjdf,blablabl,juster,marimba,love2,rerjkrf,alhambra,micros,siemens1,assmaste,moonie,dashadasha,atybrc,eeeeee1,wildrose,blue55,davidl,xrp23q,skyblue,leo123,ggggg1,bestfriend,franny,1234rmvb,fun123,rules1,sebastien,chester2,hakeem,winston2,fartripper,atlant,07831505,iluvsex,q1a2z3,larrys,009900,ghjkju,capitan,rider1,qazxsw21,belochka,andy123,hellya,chicca,maximal,juergen,password1234,howard1,quetzal,daniel123,qpwoeiruty,123555,bharat,ferrari3,numbnuts,savant,ladydog,phipsi,lovepussy,etoile,power2,mitten,britneys,chilidog,08522580,2fchbg,kinky1,bluerose,loulo,ricardo1,doqvq3,kswbdu,013cpfza,timoha,ghbdtnghbdtn,3stooges,gearhead,browns1,g00ber,super7,greenbud,kitty2,pootie,toolshed,gamers,coffe,ibill123,freelove,anasazi,sister1,jigger,natash,stacy1,weronika,luzern,soccer7,hoopla,dmoney,valerie1,canes,razdvatri,washere,greenwoo,rfhjkbyf,anselm,pkxe62,maribe,daniel2,maxim1,faceoff,carbine,xtkjdtr,buddy12,stratos,jumpman,buttocks,aqswdefr,pepsis,sonechka,steeler1,lanman,nietzsch,ballz,biscuit1,wrxsti,goodfood,juventu,federic,mattman,vika123,strelec,jledfyxbr,sideshow,4life,fredderf,bigwilly,12347890,12345671,sharik,bmw325i,fylhtqrf,dannon4,marky,mrhappy,drdoom,maddog1,pompier,cerbera,goobers,howler,jenny69,evely,letitrid,cthuttdyf,felip,shizzle,golf12,t123456,yamah,bluearmy,squishy,roxan,10inches,dollface,babygirl1,blacksta,kaneda,lexingto,canadien,222888,kukushka,sistema,224422,shadow69,ppspankp,mellons,barbie1,free4all,alfa156,lostone,2w3e4r5t,painkiller,robbie1,binger,8dihc6,jaspe,rellik,quark,sogood,hoopstar,number2,snowy1,dad2ownu,cresta,qwe123asd,hjvfyjdf,gibsonsg,qbg26i,dockers,grunge,duckling,lfiekz,cuntsoup,kasia1,1tigger,woaini,reksio,tmoney,firefighter,neuron,audia3,woogie,powerboo,powermac,fatcock,12345666,upnfmc,lustful,porn1,gotlove,amylee,kbytqrf,11924704,25251325,sarasota,sexme,ozzie1,berliner,nigga1,guatemal,seagulls,iloveyou!,chicken2,qwerty21,010203040506,1pillow,libby1,vodoley,backlash,piglets,teiubesc,019283,vonnegut,perico,thunde,buckey,gtxtymrf,manunite,iiiii1,lost4815162342,madonn,270873_,britney1,kevlar,piano1,boondock,colt1911,salamat,doma77ns,anuradha,cnhjqrf,rottweil,newmoon,topgun1,mauser,fightclu,birthday21,reviewpa,herons,aassddff,lakers32,melissa2,vredina,jiujitsu,mgoblue,shakey,moss84,12345zxcvb,funsex,benji1,garci,113322,chipie,windex,nokia5310,pwxd5x,bluemax,cosita,chalupa,trotsky,new123,g3ujwg,newguy,canabis,gnaget,happydays,felixx,1patrick,cumface,sparkie,kozlova,123234,newports,broncos7,golf18,recycle,hahah,harrypot,cachondo,open4me,miria,guessit,pepsione,knocker,usmc1775,countach,playe,wiking,landrover,cracksevi,drumline,a7777777,smile123,manzana,panty,liberta,pimp69,dolfan,quality1,schnee,superson,elaine22,webhompass,mrbrownx,deepsea,4wheel,mamasita,rockport,rollie,myhome,jordan12,kfvgjxrf,hockey12,seagrave,ford1,chelsea2,samsara,marissa1,lamesa,mobil1,piotrek,tommygun,yyyyy1,wesley1,billy123,homersim,julies,amanda12,shaka,maldini,suzenet,springst,iiiiii1,yakuza,111111aa,westwind,helpdesk,annamari,bringit,hopefull,hhhhhhh1,saywhat,mazdarx8,bulova,jennife1,baikal,gfhjkmxbr,victoria1,gizmo123,alex99,defjam,2girls,sandrock,positivo,shingo,syncmast,opensesa,silicone,fuckina,senna1,karlos,duffbeer,montagne,gehrig,thetick,pepino,hamburge,paramedic,scamp,smokeweed,fabregas,phantoms,venom121293,2583458,badone,porno69,manwhore,vfvf123,notagain,vbktyf,rfnthbyrf,wildblue,kelly001,dragon66,camell,curtis1,frolova,1212123,dothedew,tyler123,reddrago,planetx,promethe,gigolo,1001001,thisone,eugeni,blackshe,cruzazul,incognito,puller,joonas,quick1,spirit1,gazza,zealot,gordito,hotrod1,mitch1,pollito,hellcat,mythos,duluth,383pdjvl,easy123,hermos,binkie,its420,lovecraf,darien,romina,doraemon,19877891,syclone,hadoken,transpor,ichiro,intell,gargamel,dragon2,wavpzt,557744,rjw7x4,jennys,kickit,rjynfrn,likeit,555111,corvus,nec3520,133113,mookie1,bochum,samsung2,locoman0,154ugeiu,vfvfbgfgf,135792,[start],tenni,20001,vestax,hufmqw,neveragain,wizkid,kjgfnf,nokia6303,tristen,saltanat,louie1,gandalf2,sinfonia,alpha3,tolstoy,ford150,f00bar,1hello,alici,lol12,riker1,hellou,333888,1hunter,qw1234,vibrator,mets86,43211234,gonzale,cookies1,sissy1,john11,bubber,blue01,cup2006,gtkmvtyb,nazareth,heybaby,suresh,teddie,mozilla,rodeo1,madhouse,gamera,123123321,naresh,dominos,foxtrot1,taras,powerup,kipling,jasonb,fidget,galena,meatman,alpacino,bookmark,farting,humper,titsnass,gorgon,castaway,dianka,anutka,gecko1,fucklove,connery,wings1,erika1,peoria,moneymaker,ichabod,heaven1,paperboy,phaser,breakers,nurse1,westbrom,alex13,brendan1,123asd123,almera,grubber,clarkie,thisisme,welkom01,51051051051,crypto,freenet,pflybwf,black12,testme2,changeit,autobahn,attica,chaoss,denver1,tercel,gnasher23,master2,vasilii,sherman1,gomer,bigbuck,derek1,qwerzxcv,jumble,dragon23,art131313,numark,beasty,cxfcnmttcnm,updown,starion,glist,sxhq65,ranger99,monkey7,shifter,wolves1,4r5t6y,phone1,favorite5,skytommy,abracada,1martin,102030405060,gatech,giulio,blacktop,cheer1,africa1,grizzly1,inkjet,shemales,durango1,booner,11223344q,supergirl,vanyarespekt,dickless,srilanka,weaponx,6string,nashvill,spicey,boxer1,fabien,2sexy2ho,bowhunt,jerrylee,acrobat,tawnee,ulisse,nolimit8,l8g3bkde,pershing,gordo1,allover,gobrowns,123432,123444,321456987,spoon1,hhhhh1,sailing1,gardenia,teache,sexmachine,tratata,pirate1,niceone,jimbos,314159265,qsdfgh,bobbyy,ccccc1,carla1,vjkjltw,savana,biotech,frigid,123456789g,dragon10,yesiam,alpha06,oakwood,tooter,winsto,radioman,vavilon,asnaeb,google123,nariman,kellyb,dthyjcnm,password6,parol1,golf72,skate1,lthtdj,1234567890s,kennet,rossia,lindas,nataliya,perfecto,eminem1,kitana,aragorn1,rexona,arsenalf,planot,coope,testing123,timex,blackbox,bullhead,barbarian,dreamon,polaris1,cfvjktn,frdfhbev,gametime,slipknot666,nomad1,hfgcjlbz,happy69,fiddler,brazil1,joeboy,indianali,113355,obelisk,telemark,ghostrid,preston1,anonim,wellcome,verizon1,sayangku,censor,timeport,dummies,adult1,nbnfybr,donger,thales,iamgay,sexy1234,deadlift,pidaras,doroga,123qwe321,portuga,asdfgh12,happys,cadr14nu,pi3141,maksik,dribble,cortland,darken,stepanova,bommel,tropic,sochi2014,bluegras,shahid,merhaba,nacho,2580456,orange44,kongen,3cudjz,78girl,my3kids,marcopol,deadmeat,gabbie,saruman,jeepman,freddie1,katie123,master99,ronal,ballbag,centauri,killer7,xqgann,pinecone,jdeere,geirby,aceshigh,55832811,pepsimax,rayden,razor1,tallyho,ewelina,coldfire,florid,glotest,999333,sevenup,bluefin,limaperu,apostol,bobbins,charmed1,michelin,sundin,centaur,alphaone,christof,trial1,lions1,45645,just4you,starflee,vicki1,cougar1,green2,jellyfis,batman69,games1,hihje863,crazyzil,w0rm1,oklick,dogbite,yssup,sunstar,paprika,postov10,124578963,x24ik3,kanada,buckster,iloveamy,bear123,smiler,nx74205,ohiostat,spacey,bigbill,doudo,nikolaeva,hcleeb,sex666,mindy1,buster11,deacons,boness,njkcnsq,candy2,cracker1,turkey1,qwertyu1,gogreen,tazzzz,edgewise,ranger01,qwerty6,blazer1,arian,letmeinnow,cigar1,jjjjjj1,grigio,frien,tenchu,f9lmwd,imissyou,filipp,heathers,coolie,salem1,woodduck,scubadiv,123kat,raffaele,nikolaev,dapzu455,skooter,9inches,lthgfhjkm,gr8one,ffffff1,zujlrf,amanda69,gldmeo,m5wkqf,rfrltkf,televisi,bonjou,paleale,stuff1,cumalot,fuckmenow,climb7,mark1234,t26gn4,oneeye,george2,utyyflbq,hunting1,tracy71,ready2go,hotguy,accessno,charger1,rudedog,kmfdm,goober1,sweetie1,wtpmjgda,dimensio,ollie1,pickles1,hellraiser,mustdie,123zzz,99887766,stepanov,verdun,tokenbad,anatol,bartende,cidkid86,onkelz,timmie,mooseman,patch1,12345678c,marta1,dummy1,bethany1,myfamily,history1,178500,lsutiger,phydeaux,moren,dbrnjhjdbx,gnbxrf,uniden,drummers,abpbrf,godboy,daisy123,hogan1,ratpack,irland,tangerine,greddy,flore,sqrunch,billyjoe,q55555,clemson1,98745632,marios,ishot,angelin,access12,naruto12,lolly,scxakv,austin12,sallad,cool99,rockit,mongo1,mark22,ghbynth,ariadna,senha,docto,tyler2,mobius,hammarby,192168,anna12,claire1,pxx3eftp,secreto,greeneye,stjabn,baguvix,satana666,rhbcnbyjxrf,dallastx,garfiel,michaelj,1summer,montan,1234ab,filbert,squids,fastback,lyudmila,chucho,eagleone,kimberle,ar3yuk3,jake01,nokids,soccer22,1066ad,ballon,cheeto,review69,madeira,taylor2,sunny123,chubbs,lakeland,striker1,porche,qwertyu8,digiview,go1234,ferari,lovetits,aditya,minnow,green3,matman,cellphon,fortytwo,minni,pucara,69a20a,roman123,fuente,12e3e456,paul12,jacky,demian,littleman,jadakiss,vlad1997,franca,282860,midian,nunzio,xaccess2,colibri,jessica0,revilo,654456,harvey1,wolf1,macarena,corey1,husky1,arsen,milleniu,852147,crowes,redcat,combat123654,hugger,psalms,quixtar,ilovemom,toyot,ballss,ilovekim,serdar,james23,avenger1,serendip,malamute,nalgas,teflon,shagger,letmein6,vyjujnjxbt,assa1234,student1,dixiedog,gznybwf13,fuckass,aq1sw2de3,robroy,hosehead,sosa21,123345,ias100,teddy123,poppin,dgl70460,zanoza,farhan,quicksilver,1701d,tajmahal,depechemode,paulchen,angler,tommy2,recoil,megamanx,scarecro,nicole2,152535,rfvtgb,skunky,fatty1,saturno,wormwood,milwauke,udbwsk,sexlover,stefa,7bgiqk,gfnhbr,omar10,bratan,lbyfvj,slyfox,forest1,jambo,william3,tempus,solitari,lucydog,murzilka,qweasdzxc1,vehpbkrf,12312345,fixit,woobie,andre123,123456789x,lifter,zinaida,soccer17,andone,foxbat,torsten,apple12,teleport,123456i,leglover,bigcocks,vologda,dodger1,martyn,d6o8pm,naciona,eagleeye,maria6,rimshot,bentley1,octagon,barbos,masaki,gremio,siemen,s1107d,mujeres,bigtits1,cherr,saints1,mrpink,simran,ghzybr,ferrari2,secret12,tornado1,kocham,picolo,deneme,onelove1,rolan,fenster,1fuckyou,cabbie,pegaso,nastyboy,password5,aidana,mine2306,mike13,wetone,tigger69,ytreza,bondage1,myass,golova,tolik,happyboy,poilkj,nimda2k,rammer,rubies,hardcore1,jetset,hoops1,jlaudio,misskitt,1charlie,google12,theone1,phred,porsch,aalborg,luft4,charlie5,password7,gnosis,djgabbab,1daniel,vinny,borris,cumulus,member1,trogdor,darthmau,andrew2,ktjybl,relisys,kriste,rasta220,chgobndg,weener,qwerty66,fritter,followme,freeman1,ballen,blood1,peache,mariso,trevor1,biotch,gtfullam,chamonix,friendste,alligato,misha1,1soccer,18821221,venkat,superd,molotov,bongos,mpower,acun3t1x,dfcmrf,h4x3d,rfhfufylf,tigran,booyaa,plastic1,monstr,rfnhby,lookatme,anabolic,tiesto,simon123,soulman,canes1,skyking,tomcat1,madona,bassline,dasha123,tarheel1,dutch1,xsw23edc,qwerty123456789,imperator,slaveboy,bateau,paypal,house123,pentax,wolf666,drgonzo,perros,digger1,juninho,hellomoto,bladerun,zzzzzzz1,keebler,take8422,fffffff1,ginuwine,israe,caesar1,crack1,precious1,garand,magda1,zigazaga,321ewq,johnpaul,mama1234,iceman69,sanjeev,treeman,elric,rebell,1thunder,cochon,deamon,zoltan,straycat,uhbyuj,luvfur,mugsy,primer,wonder1,teetime,candycan,pfchfytw,fromage,gitler,salvatio,piggy1,23049307,zafira,chicky,sergeev,katze,bangers,andriy,jailbait,vaz2107,ghbhjlf,dbjktnnf,aqswde,zaratustra,asroma,1pepper,alyss,kkkkk1,ryan1,radish,cozumel,waterpol,pentium1,rosebowl,farmall,steinway,dbrekz,baranov,jkmuf,another1,chinacat,qqqqqqq1,hadrian,devilmaycry4,ratbag,teddy2,love21,pullings,packrat,robyn1,boobo,qw12er34,tribe1,rosey,celestia,nikkie,fortune12,olga123,danthema,gameon,vfrfhjys,dilshod,henry14,jenova,redblue,chimaera,pennywise,sokrates,danimal,qqaazz,fuaqz4,killer2,198200,tbone1,kolyan,wabbit,lewis1,maxtor,egoist,asdfas,spyglass,omegas,jack12,nikitka,esperanz,doozer,matematika,wwwww1,ssssss1,poiu0987,suchka,courtney1,gungho,alpha2,fktyjxrf,summer06,bud420,devildriver,heavyd,saracen,foucault,choclate,rjdfktyrj,goblue1,monaro,jmoney,dcpugh,efbcapa201,qqh92r,pepsicol,bbb747,ch5nmk,honeyb,beszoptad,tweeter,intheass,iseedeadpeople,123dan,89231243658s,farside1,findme,smiley1,55556666,sartre,ytcnjh,kacper,costarica,134679258,mikeys,nolimit9,vova123,withyou,5rxypn,love143,freebie,rescue1,203040,michael6,12monkey,redgreen,steff,itstime,naveen,good12345,acidrain,1dawg,miramar,playas,daddio,orion2,852741,studmuff,kobe24,senha123,stephe,mehmet,allalone,scarface1,helloworld,smith123,blueyes,vitali,memphis1,mybitch,colin1,159874,1dick,podaria,d6wnro,brahms,f3gh65,dfcbkmtd,xxxman,corran,ugejvp,qcfmtz,marusia,totem,arachnid,matrix2,antonell,fgntrf,zemfira,christos,surfing1,naruto123,plato1,56qhxs,madzia,vanille,043aaa,asq321,mutton,ohiostate,golde,cdznjckfd,rhfcysq,green5,elephan,superdog,jacqueli,bollock,lolitas,nick12,1orange,maplelea,july23,argento,waldorf,wolfer,pokemon12,zxcvbnmm,flicka,drexel,outlawz,harrie,atrain,juice2,falcons1,charlie6,19391945,tower1,dragon21,hotdamn,dirtyboy,love4ever,1ginger,thunder2,virgo1,alien1,bubblegu,4wwvte,123456789qqq,realtime,studio54,passss,vasilek,awsome,giorgia,bigbass,2002tii,sunghile,mosdef,simbas,count0,uwrl7c,summer05,lhepmz,ranger21,sugarbea,principe,5550123,tatanka,9638v,cheerios,majere,nomercy,jamesbond007,bh90210,7550055,jobber,karaganda,pongo,trickle,defamer,6chid8,1q2a3z,tuscan,nick123,.adgjm,loveyo,hobbes1,note1234,shootme,171819,loveporn,9788960,monty123,fabrice,macduff,monkey13,shadowfa,tweeker,hanna1,madball,telnet,loveu2,qwedcxzas,thatsit,vfhcbr,ptfe3xxp,gblfhfcs,ddddddd1,hakkinen,liverune,deathsta,misty123,suka123,recon1,inferno1,232629,polecat,sanibel,grouch,hitech,hamradio,rkfdbfnehf,vandam,nadin,fastlane,shlong,iddqdidkfa,ledzeppelin,sexyfeet,098123,stacey1,negras,roofing,lucifer1,ikarus,tgbyhn,melnik,barbaria,montego,twisted1,bigal1,jiggle,darkwolf,acerview,silvio,treetops,bishop1,iwanna,pornsite,happyme,gfccdjhl,114411,veritech,batterse,casey123,yhntgb,mailto,milli,guster,q12345678,coronet,sleuth,fuckmeha,armadill,kroshka,geordie,lastochka,pynchon,killall,tommy123,sasha1996,godslove,hikaru,clticic,cornbrea,vfkmdbyf,passmaster,123123123a,souris,nailer,diabolo,skipjack,martin12,hinata,mof6681,brookie,dogfight,johnso,karpov,326598,rfvbrflpt,travesti,caballer,galaxy1,wotan,antoha,art123,xakep1234,ricflair,pervert1,p00kie,ambulanc,santosh,berserker,larry33,bitch123,a987654321,dogstar,angel22,cjcbcrf,redhouse,toodles,gold123,hotspot,kennedy1,glock21,chosen1,schneide,mainman,taffy1,3ki42x,4zqauf,ranger2,4meonly,year2000,121212a,kfylsi,netzwerk,diese,picasso1,rerecz,225522,dastan,swimmer1,brooke1,blackbea,oneway,ruslana,dont4get,phidelt,chrisp,gjyxbr,xwing,kickme,shimmy,kimmy1,4815162342lost,qwerty5,fcporto,jazzbo,mierd,252627,basses,sr20det,00133,florin,howdy1,kryten,goshen,koufax,cichlid,imhotep,andyman,wrest666,saveme,dutchy,anonymou,semprini,siempre,mocha1,forest11,wildroid,aspen1,sesam,kfgekz,cbhbec,a55555,sigmanu,slash1,giggs11,vatech,marias,candy123,jericho1,kingme,123a123,drakula,cdjkjxm,mercur,oneman,hoseman,plumper,ilovehim,lancers,sergey1,takeshi,goodtogo,cranberr,ghjcnj123,harvick,qazxs,1972chev,horsesho,freedom3,letmein7,saitek,anguss,vfvfgfgfz,300000,elektro,toonporn,999111999q,mamuka,q9umoz,edelweis,subwoofer,bayside,disturbe,volition,lucky3,12345678z,3mpz4r,march1,atlantida,strekoza,seagrams,090909t,yy5rbfsc,jack1234,sammy12,sampras,mark12,eintrach,chaucer,lllll1,nochance,whitepower,197000,lbvekz,passer,torana,12345as,pallas,koolio,12qw34,nokia8800,findout,1thomas,mmmmm1,654987,mihaela,chinaman,superduper,donnas,ringo1,jeroen,gfdkjdf,professo,cdtnrf,tranmere,tanstaaf,himera,ukflbfnjh,667788,alex32,joschi,w123456,okidoki,flatline,papercli,super8,doris1,2good4u,4z34l0ts,pedigree,freeride,gsxr1100,wulfgar,benjie,ferdinan,king1,charlie7,djdxbr,fhntvbq,ripcurl,2wsx1qaz,kingsx,desade,sn00py,loveboat,rottie,evgesha,4money,dolittle,adgjmpt,buzzers,brett1,makita,123123qweqwe,rusalka,sluts1,123456e,jameson1,bigbaby,1z2z3z,ckjybr,love4u,fucker69,erhfbyf,jeanluc,farhad,fishfood,merkin,giant1,golf69,rfnfcnhjaf,camera1,stromb,smoothy,774411,nylon,juice1,rfn.irf,newyor,123456789t,marmot,star11,jennyff,jester1,hisashi,kumquat,alex777,helicopt,merkur,dehpye,cummin,zsmj2v,kristjan,april12,englan,honeypot,badgirls,uzumaki,keines,p12345,guita,quake1,duncan1,juicer,milkbone,hurtme,123456789b,qq123456789,schwein,p3wqaw,54132442,qwertyytrewq,andreeva,ruffryde,punkie,abfkrf,kristinka,anna1987,ooooo1,335533aa,umberto,amber123,456123789,456789123,beelch,manta,peeker,1112131415,3141592654,gipper,wrinkle5,katies,asd123456,james11,78n3s5af,michael0,daboss,jimmyb,hotdog1,david69,852123,blazed,sickan,eljefe,2n6wvq,gobills,rfhfcm,squeaker,cabowabo,luebri,karups,test01,melkor,angel777,smallvil,modano,olorin,4rkpkt,leslie1,koffie,shadows1,littleon,amiga1,topeka,summer20,asterix1,pitstop,aloysius,k12345,magazin,joker69,panocha,pass1word,1233214,ironpony,368ejhih,88keys,pizza123,sonali,57np39,quake2,1234567890qw,1020304,sword1,fynjif,abcde123,dfktyjr,rockys,grendel1,harley12,kokakola,super2,azathoth,lisa123,shelley1,girlss,ibragim,seven1,jeff24,1bigdick,dragan,autobot,t4nvp7,omega123,900000,hecnfv,889988,nitro1,doggie1,fatjoe,811pahc,tommyt,savage1,pallino,smitty1,jg3h4hfn,jamielee,1qazwsx,zx123456,machine1,asdfgh123,guinnes,789520,sharkman,jochen,legend1,sonic2,extreme1,dima12,photoman,123459876,nokian95,775533,vaz2109,april10,becks,repmvf,pooker,qwer12345,themaster,nabeel,monkey10,gogetit,hockey99,bbbbbbb1,zinedine,dolphin2,anelka,1superma,winter01,muggsy,horny2,669966,kuleshov,jesusis,calavera,bullet1,87t5hdf,sleepers,winkie,vespa,lightsab,carine,magister,1spider,shitbird,salavat,becca1,wc18c2,shirak,galactus,zaskar,barkley1,reshma,dogbreat,fullsail,asasa,boeder,12345ta,zxcvbnm12,lepton,elfquest,tony123,vkaxcs,savatage,sevilia1,badkitty,munkey,pebbles1,diciembr,qapmoc,gabriel2,1qa2ws3e,cbcmrb,welldone,nfyufh,kaizen,jack11,manisha,grommit,g12345,maverik,chessman,heythere,mixail,jjjjjjj1,sylvia1,fairmont,harve,skully,global1,youwish,pikachu1,badcat,zombie1,49527843,ultra1,redrider,offsprin,lovebird,153426,stymie,aq1sw2,sorrento,0000001,r3ady41t,webster1,95175,adam123,coonass,159487,slut1,gerasim,monkey99,slutwife,159963,1pass1page,hobiecat,bigtymer,all4you,maggie2,olamide,comcast1,infinit,bailee,vasileva,.ktxrf,asdfghjkl1,12345678912,setter,fuckyou7,nnagqx,lifesuck,draken,austi,feb2000,cable1,1234qwerasdf,hax0red,zxcv12,vlad7788,nosaj,lenovo,underpar,huskies1,lovegirl,feynman,suerte,babaloo,alskdjfhg,oldsmobi,bomber1,redrover,pupuce,methodman,phenom,cutegirl,countyli,gretsch,godisgood,bysunsu,hardhat,mironova,123qwe456rty,rusty123,salut,187211,555666777,11111z,mahesh,rjntyjxtr,br00klyn,dunce1,timebomb,bovine,makelove,littlee,shaven,rizwan,patrick7,42042042,bobbijo,rustem,buttmunc,dongle,tiger69,bluecat,blackhol,shirin,peaces,cherub,cubase,longwood,lotus7,gwju3g,bruin,pzaiu8,green11,uyxnyd,seventee,dragon5,tinkerbel,bluess,bomba,fedorova,joshua2,bodyshop,peluche,gbpacker,shelly1,d1i2m3a4,ghtpbltyn,talons,sergeevna,misato,chrisc,sexmeup,brend,olddog,davros,hazelnut,bridget1,hzze929b,readme,brethart,wild1,ghbdtnbr1,nortel,kinger,royal1,bucky1,allah1,drakkar,emyeuanh,gallaghe,hardtime,jocker,tanman,flavio,abcdef123,leviatha,squid1,skeet,sexse,123456x,mom4u4mm,lilred,djljktq,ocean11,cadaver,baxter1,808state,fighton,primavera,1andrew,moogle,limabean,goddess1,vitalya,blue56,258025,bullride,cicci,1234567d,connor1,gsxr11,oliveoil,leonard1,legsex,gavrik,rjnjgtc,mexicano,2bad4u,goodfellas,ornw6d,mancheste,hawkmoon,zlzfrh,schorsch,g9zns4,bashful,rossi46,stephie,rfhfntkm,sellout,123fuck,stewar1,solnze,00007,thor5200,compaq12,didit,bigdeal,hjlbyf,zebulon,wpf8eu,kamran,emanuele,197500,carvin,ozlq6qwm,3syqo15hil,pennys,epvjb6,asdfghjkl123,198000,nfbcbz,jazzer,asfnhg66,zoloft,albundy,aeiou,getlaid,planet1,gjkbyjxrf,alex2000,brianb,moveon,maggie11,eieio,vcradq,shaggy1,novartis,cocoloco,dunamis,554uzpad,sundrop,1qwertyu,alfie,feliks,briand,123www,red456,addams,fhntv1998,goodhead,theway,javaman,angel01,stratoca,lonsdale,15987532,bigpimpin,skater1,issue43,muffie,yasmina,slowride,crm114,sanity729,himmel,carolcox,bustanut,parabola,masterlo,computador,crackhea,dynastar,rockbott,doggysty,wantsome,bigten,gaelle,juicy1,alaska1,etower,sixnine,suntan,froggies,nokia7610,hunter11,njnets,alicante,buttons1,diosesamo,elizabeth1,chiron,trustnoo,amatuers,tinytim,mechta,sammy2,cthulu,trs8f7,poonam,m6cjy69u35,cookie12,blue25,jordans,santa1,kalinka,mikey123,lebedeva,12345689,kissss,queenbee,vjybnjh,ghostdog,cuckold,bearshare,rjcntyrj,alinochka,ghjcnjrdfibyj,aggie1,teens1,3qvqod,dauren,tonino,hpk2qc,iqzzt580,bears85,nascar88,theboy,njqcw4,masyanya,pn5jvw,intranet,lollone,shadow99,00096462,techie,cvtifhbrb,redeemed,gocanes,62717315,topman,intj3a,cobrajet,antivirus,whyme,berserke,ikilz083,airedale,brandon2,hopkig,johanna1,danil8098,gojira,arthu,vision1,pendragon,milen,chrissie,vampiro,mudder,chris22,blowme69,omega7,surfers,goterps,italy1,baseba11,diego1,gnatsum,birdies,semenov,joker123,zenit2011,wojtek,cab4ma99,watchmen,damia,forgotte,fdm7ed,strummer,freelanc,cingular,orange77,mcdonalds,vjhjpjdf,kariya,tombston,starlet,hawaii1,dantheman,megabyte,nbvjirf,anjing,ybrjkftdbx,hotmom,kazbek,pacific1,sashimi,asd12,coorslig,yvtte545,kitte,elysium,klimenko,cobblers,kamehameha,only4me,redriver,triforce,sidorov,vittoria,fredi,dank420,m1234567,fallout2,989244342a,crazy123,crapola,servus,volvos,1scooter,griffin1,autopass,ownzyou,deviant,george01,2kgwai,boeing74,simhrq,hermosa,hardcor,griffy,rolex1,hackme,cuddles1,master3,bujhtr,aaron123,popolo,blader,1sexyred,gerry1,cronos,ffvdj474,yeehaw,bob1234,carlos2,mike77,buckwheat,ramesh,acls2h,monster2,montess,11qq22ww,lazer,zx123456789,chimpy,masterch,sargon,lochness,archana,1234qwert,hbxfhl,sarahb,altoid,zxcvbn12,dakot,caterham,dolomite,chazz,r29hqq,longone,pericles,grand1,sherbert,eagle3,pudge,irontree,synapse,boome,nogood,summer2,pooki,gangsta1,mahalkit,elenka,lbhtrnjh,dukedog,19922991,hopkins1,evgenia,domino1,x123456,manny1,tabbycat,drake1,jerico,drahcir,kelly2,708090a,facesit,11c645df,mac123,boodog,kalani,hiphop1,critters,hellothere,tbirds,valerka,551scasi,love777,paloalto,mrbrown,duke3d,killa1,arcturus,spider12,dizzy1,smudger,goddog,75395,spammy,1357997531,78678,datalife,zxcvbn123,1122112211,london22,23dp4x,rxmtkp,biggirls,ownsu,lzbs2twz,sharps,geryfe,237081a,golakers,nemesi,sasha1995,pretty1,mittens1,d1lakiss,speedrac,gfhjkmm,sabbat,hellrais,159753258,qwertyuiop123,playgirl,crippler,salma,strat1,celest,hello5,omega5,cheese12,ndeyl5,edward12,soccer3,cheerio,davido,vfrcbr,gjhjctyjr,boscoe,inessa,shithole,ibill,qwepoi,201jedlz,asdlkj,davidk,spawn2,ariel1,michael4,jamie123,romantik,micro1,pittsbur,canibus,katja,muhtar,thomas123,studboy,masahiro,rebrov,patrick8,hotboys,sarge1,1hammer,nnnnn1,eistee,datalore,jackdani,sasha2010,mwq6qlzo,cmfnpu,klausi,cnhjbntkm,andrzej,ilovejen,lindaa,hunter123,vvvvv1,novembe,hamster1,x35v8l,lacey1,1silver,iluvporn,valter,herson,alexsandr,cojones,backhoe,womens,777angel,beatit,klingon1,ta8g4w,luisito,benedikt,maxwel,inspecto,zaq12ws,wladimir,bobbyd,peterj,asdfg12,hellspawn,bitch69,nick1234,golfer23,sony123,jello1,killie,chubby1,kodaira52,yanochka,buckfast,morris1,roaddogg,snakeeye,sex1234,mike22,mmouse,fucker11,dantist,brittan,vfrfhjdf,doc123,plokijuh,emerald1,batman01,serafim,elementa,soccer9,footlong,cthuttdbx,hapkido,eagle123,getsmart,getiton,batman2,masons,mastiff,098890,cfvfhf,james7,azalea,sherif,saun24865709,123red,cnhtrjpf,martina1,pupper,michael5,alan12,shakir,devin1,ha8fyp,palom,mamulya,trippy,deerhunter,happyone,monkey77,3mta3,123456789f,crownvic,teodor,natusik,0137485,vovchik,strutter,triumph1,cvetok,moremone,sonnen,screwbal,akira1,sexnow,pernille,independ,poopies,samapi,kbcbxrf,master22,swetlana,urchin,viper2,magica,slurpee,postit,gilgames,kissarmy,clubpenguin,limpbizk,timber1,celin,lilkim,fuckhard,lonely1,mom123,goodwood,extasy,sdsadee23,foxglove,malibog,clark1,casey2,shell1,odense,balefire,dcunited,cubbie,pierr,solei,161718,bowling1,areyukesc,batboy,r123456,1pionee,marmelad,maynard1,cn42qj,cfvehfq,heathrow,qazxcvbn,connecti,secret123,newfie,xzsawq21,tubitzen,nikusha,enigma1,yfcnz123,1austin,michaelc,splunge,wanger,phantom2,jason2,pain4me,primetime21,babes1,liberte,sugarray,undergro,zonker,labatts,djhjyf,watch1,eagle5,madison2,cntgfirf,sasha2,masterca,fiction7,slick50,bruins1,sagitari,12481632,peniss,insuranc,2b8riedt,12346789,mrclean,ssptx452,tissot,q1w2e3r4t5y6u7,avatar1,comet1,spacer,vbrjkf,pass11,wanker1,14vbqk9p,noshit,money4me,sayana,fish1234,seaways,pipper,romeo123,karens,wardog,ab123456,gorilla1,andrey123,lifesucks,jamesr,4wcqjn,bearman,glock22,matt11,dflbvrf,barbi,maine1,dima1997,sunnyboy,6bjvpe,bangkok1,666666q,rafiki,letmein0,0raziel0,dalla,london99,wildthin,patrycja,skydog,qcactw,tmjxn151,yqlgr667,jimmyd,stripclub,deadwood,863abgsg,horses1,qn632o,scatman,sonia1,subrosa,woland,kolya,charlie4,moleman,j12345,summer11,angel11,blasen,sandal,mynewpas,retlaw,cambria,mustang4,nohack04,kimber45,fatdog,maiden1,bigload,necron,dupont24,ghost123,turbo2,.ktymrf,radagast,balzac,vsevolod,pankaj,argentum,2bigtits,mamabear,bumblebee,mercury7,maddie1,chomper,jq24nc,snooky,pussylic,1lovers,taltos,warchild,diablo66,jojo12,sumerki,aventura,gagger,annelies,drumset,cumshots,azimut,123580,clambake,bmw540,birthday54,psswrd,paganini,wildwest,filibert,teaseme,1test,scampi,thunder5,antosha,purple12,supersex,hhhhhh1,brujah,111222333a,13579a,bvgthfnjh,4506802a,killians,choco,qqqwwweee,raygun,1grand,koetsu13,sharp1,mimi92139,fastfood,idontcare,bluered,chochoz,4z3al0ts,target1,sheffiel,labrat,stalingrad,147123,cubfan,corvett1,holden1,snapper1,4071505,amadeo,pollo,desperados,lovestory,marcopolo,mumbles,familyguy,kimchee,marcio,support1,tekila,shygirl1,trekkie,submissi,ilaria,salam,loveu,wildstar,master69,sales1,netware,homer2,arseniy,gerrity1,raspberr,atreyu,stick1,aldric,tennis12,matahari,alohomora,dicanio,michae1,michaeld,666111,luvbug,boyscout,esmerald,mjordan,admiral1,steamboa,616913,ybhdfyf,557711,555999,sunray,apokalipsis,theroc,bmw330,buzzy,chicos,lenusik,shadowma,eagles05,444222,peartree,qqq123,sandmann,spring1,430799,phatass,andi03,binky1,arsch,bamba,kenny123,fabolous,loser123,poop12,maman,phobos,tecate,myxworld4,metros,cocorico,nokia6120,johnny69,hater,spanked,313233,markos,love2011,mozart1,viktoriy,reccos,331234,hornyone,vitesse,1um83z,55555q,proline,v12345,skaven,alizee,bimini,fenerbahce,543216,zaqqaz,poi123,stabilo,brownie1,1qwerty1,dinesh,baggins1,1234567t,davidkin,friend1,lietuva,octopuss,spooks,12345qq,myshit,buttface,paradoxx,pop123,golfin,sweet69,rfghbp,sambuca,kayak1,bogus1,girlz,dallas12,millers,123456zx,operatio,pravda,eternal1,chase123,moroni,proust,blueduck,harris1,redbarch,996699,1010101,mouche,millenni,1123456,score1,1234565,1234576,eae21157,dave12,pussyy,gfif1991,1598741,hoppy,darrian,snoogins,fartface,ichbins,vfkbyrf,rusrap,2741001,fyfrjylf,aprils,favre,thisis,bannana,serval,wiggum,satsuma,matt123,ivan123,gulmira,123zxc123,oscar2,acces,annie2,dragon0,emiliano,allthat,pajaro,amandine,rawiswar,sinead,tassie,karma1,piggys,nokias,orions,origami,type40,mondo,ferrets,monker,biteme2,gauntlet,arkham,ascona,ingram01,klem1,quicksil,bingo123,blue66,plazma,onfire,shortie,spjfet,123963,thered,fire777,lobito,vball,1chicken,moosehea,elefante,babe23,jesus12,parallax,elfstone,number5,shrooms,freya,hacker1,roxette,snoops,number7,fellini,dtlmvf,chigger,mission1,mitsubis,kannan,whitedog,james01,ghjgecr,rfnfgekmnf,everythi,getnaked,prettybo,sylvan,chiller,carrera4,cowbo,biochem,azbuka,qwertyuiop1,midnight1,informat,audio1,alfred1,0range,sucker1,scott2,russland,1eagle,torben,djkrjlfd,rocky6,maddy1,bonobo,portos,chrissi,xjznq5,dexte,vdlxuc,teardrop,pktmxr,iamtheone,danijela,eyphed,suzuki1,etvww4,redtail,ranger11,mowerman,asshole2,coolkid,adriana1,bootcamp,longcut,evets,npyxr5,bighurt,bassman1,stryder,giblet,nastja,blackadd,topflite,wizar,cumnow,technolo,bassboat,bullitt,kugm7b,maksimus,wankers,mine12,sunfish,pimpin1,shearer9,user1,vjzgjxnf,tycobb,80070633pc,stanly,vitaly,shirley1,cinzia,carolyn1,angeliqu,teamo,qdarcv,aa123321,ragdoll,bonit,ladyluck,wiggly,vitara,jetbalance,12345600,ozzman,dima12345,mybuddy,shilo,satan66,erebus,warrio,090808qwe,stupi,bigdan,paul1234,chiapet,brooks1,philly1,dually,gowest,farmer1,1qa2ws3ed4rf,alberto1,beachboy,barne,aa12345,aliyah,radman,benson1,dfkthbq,highball,bonou2,i81u812,workit,darter,redhook,csfbr5yy,buttlove,episode1,ewyuza,porthos,lalal,abcd12,papero,toosexy,keeper1,silver7,jujitsu,corset,pilot123,simonsay,pinggolf,katerinka,kender,drunk1,fylhjvtlf,rashmi,nighthawk,maggy,juggernaut,larryb,cabibble,fyabcf,247365,gangstar,jaybee,verycool,123456789qw,forbidde,prufrock,12345zxc,malaika,blackbur,docker,filipe,koshechka,gemma1,djamaal,dfcbkmtdf,gangst,9988aa,ducks1,pthrfkj,puertorico,muppets,griffins,whippet,sauber,timofey,larinso,123456789zxc,quicken,qsefth,liteon,headcase,bigdadd,zxc321,maniak,jamesc,bassmast,bigdogs,1girls,123xxx,trajan,lerochka,noggin,mtndew,04975756,domin,wer123,fumanchu,lambada,thankgod,june22,kayaking,patchy,summer10,timepass,poiu1234,kondor,kakka,lament,zidane10,686xqxfg,l8v53x,caveman1,nfvthkfy,holymoly,pepita,alex1996,mifune,fighter1,asslicker,jack22,abc123abc,zaxxon,midnigh,winni,psalm23,punky,monkey22,password13,mymusic,justyna,annushka,lucky5,briann,495rus19,withlove,almaz,supergir,miata,bingbong,bradpitt,kamasutr,yfgjktjy,vanman,pegleg,amsterdam1,123a321,letmein9,shivan,korona,bmw520,annette1,scotsman,gandal,welcome12,sc00by,qpwoei,fred69,m1sf1t,hamburg1,1access,dfkmrbhbz,excalibe,boobies1,fuckhole,karamel,starfuck,star99,breakfas,georgiy,ywvxpz,smasher,fatcat1,allanon,12345n,coondog,whacko,avalon1,scythe,saab93,timon,khorne,atlast,nemisis,brady12,blenheim,52678677,mick7278,9skw5g,fleetwoo,ruger1,kissass,pussy7,scruff,12345l,bigfun,vpmfsz,yxkck878,evgeny,55667788,lickher,foothill,alesis,poppies,77777778,californi,mannie,bartjek,qhxbij,thehulk,xirt2k,angelo4ek,rfkmrekznjh,tinhorse,1david,sparky12,night1,luojianhua,bobble,nederland,rosemari,travi,minou,ciscokid,beehive,565hlgqo,alpine1,samsung123,trainman,xpress,logistic,vw198m2n,hanter,zaqwsx123,qwasz,mariachi,paska,kmg365,kaulitz,sasha12,north1,polarbear,mighty1,makeksa11,123456781,one4all,gladston,notoriou,polniypizdec110211,gosia,grandad,xholes,timofei,invalidp,speaker1,zaharov,maggiema,loislane,gonoles,br5499,discgolf,kaskad,snooper,newman1,belial,demigod,vicky1,pridurok,alex1990,tardis1,cruzer,hornie,sacramen,babycat,burunduk,mark69,oakland1,me1234,gmctruck,extacy,sexdog,putang,poppen,billyd,1qaz2w,loveable,gimlet,azwebitalia,ragtop,198500,qweas,mirela,rock123,11bravo,sprewell,tigrenok,jaredleto,vfhbif,blue2,rimjob,catwalk,sigsauer,loqse,doromich,jack01,lasombra,jonny5,newpassword,profesor,garcia1,123as123,croucher,demeter,4_life,rfhfvtkm,superman2,rogues,assword1,russia1,jeff1,mydream,z123456789,rascal1,darre,kimberl,pickle1,ztmfcq,ponchik,lovesporn,hikari,gsgba368,pornoman,chbjun,choppy,diggity,nightwolf,viktori,camar,vfhecmrf,alisa1,minstrel,wishmaster,mulder1,aleks,gogirl,gracelan,8womys,highwind,solstice,dbrnjhjdyf,nightman,pimmel,beertje,ms6nud,wwfwcw,fx3tuo,poopface,asshat,dirtyd,jiminy,luv2fuck,ptybnxtvgbjy,dragnet,pornogra,10inch,scarlet1,guido1,raintree,v123456,1aaaaaaa,maxim1935,hotwater,gadzooks,playaz,harri,brando1,defcon1,ivanna,123654a,arsenal2,candela,nt5d27,jaime1,duke1,burton1,allstar1,dragos,newpoint,albacore,1236987z,verygoodbot,1wildcat,fishy1,ptktysq,chris11,puschel,itdxtyrj,7kbe9d,serpico,jazzie,1zzzzz,kindbuds,wenef45313,1compute,tatung,sardor,gfyfcjybr,test99,toucan,meteora,lysander,asscrack,jowgnx,hevnm4,suckthis,masha123,karinka,marit,oqglh565,dragon00,vvvbbb,cheburashka,vfrfrf,downlow,unforgiven,p3e85tr,kim123,sillyboy,gold1,golfvr6,quicksan,irochka,froglegs,shortsto,caleb1,tishka,bigtitts,smurfy,bosto,dropzone,nocode,jazzbass,digdug,green7,saltlake,therat,dmitriev,lunita,deaddog,summer0,1212qq,bobbyg,mty3rh,isaac1,gusher,helloman,sugarbear,corvair,extrem,teatime,tujazopi,titanik,efyreg,jo9k2jw2,counchac,tivoli,utjvtnhbz,bebit,jacob6,clayton1,incubus1,flash123,squirter,dima2010,cock1,rawks,komatsu,forty2,98741236,cajun1,madelein,mudhoney,magomed,q111111,qaswed,consense,12345b,bakayaro,silencer,zoinks,bigdic,werwolf,pinkpuss,96321478,alfie1,ali123,sarit,minette,musics,chato,iaapptfcor,cobaka,strumpf,datnigga,sonic123,yfnecbr,vjzctvmz,pasta1,tribbles,crasher,htlbcrf,1tiger,shock123,bearshar,syphon,a654321,cubbies1,jlhanes,eyespy,fucktheworld,carrie1,bmw325is,suzuk,mander,dorina,mithril,hondo1,vfhnbyb,sachem,newton1,12345x,7777755102q,230857z,xxxsex,scubapro,hayastan,spankit,delasoul,searock6,fallout3,nilrem,24681357,pashka,voluntee,pharoh,willo,india1,badboy69,roflmao,gunslinger,lovergir,mama12,melange,640xwfkv,chaton,darkknig,bigman1,aabbccdd,harleyd,birdhouse,giggsy,hiawatha,tiberium,joker7,hello1234,sloopy,tm371855,greendog,solar1,bignose,djohn11,espanol,oswego,iridium,kavitha,pavell,mirjam,cyjdsvujljv,alpha5,deluge,hamme,luntik,turismo,stasya,kjkbnf,caeser,schnecke,tweety1,tralfaz,lambrett,prodigy1,trstno1,pimpshit,werty1,karman,bigboob,pastel,blackmen,matthew8,moomin,q1w2e,gilly,primaver,jimmyg,house2,elviss,15975321,1jessica,monaliza,salt55,vfylfhbyrf,harley11,tickleme,murder1,nurgle,kickass1,theresa1,fordtruck,pargolf,managua,inkognito,sherry1,gotit,friedric,metro2033,slk230,freeport,cigarett,492529,vfhctkm,thebeach,twocats,bakugan,yzerman1,charlieb,motoko,skiman,1234567w,pussy3,love77,asenna,buffie,260zntpc,kinkos,access20,mallard1,fuckyou69,monami,rrrrr1,bigdog69,mikola,1boomer,godzila,ginger2,dima2000,skorpion39,dima1234,hawkdog79,warrior2,ltleirf,supra1,jerusale,monkey01,333z333,666888,kelsey1,w8gkz2x1,fdfnfh,msnxbi,qwe123rty,mach1,monkey3,123456789qq,c123456,nezabudka,barclays,nisse,dasha1,12345678987654321,dima1993,oldspice,frank2,rabbitt,prettyboy,ov3ajy,iamthema,kawasak,banjo1,gtivr6,collants,gondor,hibees,cowboys2,codfish,buster2,purzel,rubyred,kayaker,bikerboy,qguvyt,masher,sseexx,kenshiro,moonglow,semenova,rosari,eduard1,deltaforce,grouper,bongo1,tempgod,1taylor,goldsink,qazxsw1,1jesus,m69fg2w,maximili,marysia,husker1,kokanee,sideout,googl,south1,plumber1,trillian,00001,1357900,farkle,1xxxxx,pascha,emanuela,bagheera,hound1,mylov,newjersey,swampfox,sakic19,torey,geforce,wu4etd,conrail,pigman,martin2,ber02,nascar2,angel69,barty,kitsune,cornet,yes90125,goomba,daking,anthea,sivart,weather1,ndaswf,scoubidou,masterchief,rectum,3364068,oranges1,copter,1samanth,eddies,mimoza,ahfywbz,celtic88,86mets,applemac,amanda11,taliesin,1angel,imhere,london11,bandit12,killer666,beer1,06225930,psylocke,james69,schumach,24pnz6kc,endymion,wookie1,poiu123,birdland,smoochie,lastone,rclaki,olive1,pirat,thunder7,chris69,rocko,151617,djg4bb4b,lapper,ajcuivd289,colole57,shadow7,dallas21,ajtdmw,executiv,dickies,omegaman,jason12,newhaven,aaaaaas,pmdmscts,s456123789,beatri,applesauce,levelone,strapon,benladen,creaven,ttttt1,saab95,f123456,pitbul,54321a,sex12345,robert3,atilla,mevefalkcakk,1johnny,veedub,lilleke,nitsuj,5t6y7u8i,teddys,bluefox,nascar20,vwjetta,buffy123,playstation3,loverr,qweasd12,lover2,telekom,benjamin1,alemania,neutrino,rockz,valjean,testicle,trinity3,realty,firestarter,794613852,ardvark,guadalup,philmont,arnold1,holas,zw6syj,birthday299,dover1,sexxy1,gojets,741236985,cance,blue77,xzibit,qwerty88,komarova,qweszxc,footer,rainger,silverst,ghjcnb,catmando,tatooine,31217221027711,amalgam,69dude,qwerty321,roscoe1,74185,cubby,alfa147,perry1,darock,katmandu,darknight,knicks1,freestuff,45454,kidman,4tlved,axlrose,cutie1,quantum1,joseph10,ichigo,pentium3,rfhectkm,rowdy1,woodsink,justforfun,sveta123,pornografia,mrbean,bigpig,tujheirf,delta9,portsmou,hotbod,kartal,10111213,fkbyf001,pavel1,pistons1,necromancer,verga,c7lrwu,doober,thegame1,hatesyou,sexisfun,1melissa,tuczno18,bowhunte,gobama,scorch,campeon,bruce2,fudge1,herpderp,bacon1,redsky,blackeye,19966991,19992000,ripken8,masturba,34524815,primax,paulina1,vp6y38,427cobra,4dwvjj,dracon,fkg7h4f3v6,longview,arakis,panama1,honda2,lkjhgfdsaz,razors,steels,fqkw5m,dionysus,mariajos,soroka,enriqu,nissa,barolo,king1234,hshfd4n279,holland1,flyer1,tbones,343104ky,modems,tk421,ybrbnrf,pikapp,sureshot,wooddoor,florida2,mrbungle,vecmrf,catsdogs,axolotl,nowayout,francoi,chris21,toenail,hartland,asdjkl,nikkii,onlyyou,buckskin,fnord,flutie,holen1,rincewind,lefty1,ducky1,199000,fvthbrf,redskin1,ryno23,lostlove,19mtpgam19,abercrom,benhur,jordan11,roflcopter,ranma,phillesh,avondale,igromania,p4ssword,jenny123,tttttt1,spycams,cardigan,2112yyz,sleepy1,paris123,mopars,lakers34,hustler1,james99,matrix3,popimp,12pack,eggbert,medvedev,testit,performa,logitec,marija,sexybeast,supermanboy,iwantit,rjktcj,jeffer,svarog,halo123,whdbtp,nokia3230,heyjoe,marilyn1,speeder,ibxnsm,prostock,bennyboy,charmin,codydog,parol999,ford9402,jimmer,crayola,159357258,alex77,joey1,cayuga,phish420,poligon,specops,tarasova,caramelo,draconis,dimon,cyzkhw,june29,getbent,1guitar,jimjam,dictiona,shammy,flotsam,0okm9ijn,crapper,technic,fwsadn,rhfdxtyrj,zaq11qaz,anfield1,159753q,curious1,hip-hop,1iiiii,gfhjkm2,cocteau,liveevil,friskie,crackhead,b1afra,elektrik,lancer1,b0ll0cks,jasond,z1234567,tempest1,alakazam,asdfasd,duffy1,oneday,dinkle,qazedctgb,kasimir,happy7,salama,hondaciv,nadezda,andretti,cannondale,sparticu,znbvjd,blueice,money01,finster,eldar,moosie,pappa,delta123,neruda,bmw330ci,jeanpaul,malibu1,alevtina,sobeit,travolta,fullmetal,enamorad,mausi,boston12,greggy,smurf1,ratrace,ichiban,ilovepus,davidg,wolf69,villa1,cocopuff,football12,starfury,zxc12345,forfree,fairfiel,dreams1,tayson,mike2,dogday,hej123,oldtimer,sanpedro,clicker,mollycat,roadstar,golfe,lvbnhbq1,topdevice,a1b2c,sevastopol,calli,milosc,fire911,pink123,team3x,nolimit5,snickers1,annies,09877890,jewel1,steve69,justin11,autechre,killerbe,browncow,slava1,christer,fantomen,redcloud,elenberg,beautiful1,passw0rd1,nazira,advantag,cockring,chaka,rjpzdrf,99941,az123456,biohazar,energie,bubble1,bmw323,tellme,printer1,glavine,1starwar,coolbeans,april17,carly1,quagmire,admin2,djkujuhfl,pontoon,texmex,carlos12,thermo,vaz2106,nougat,bob666,1hockey,1john,cricke,qwerty10,twinz,totalwar,underwoo,tijger,lildevil,123q321,germania,freddd,1scott,beefy,5t4r3e2w1q,fishbait,nobby,hogger,dnstuff,jimmyc,redknapp,flame1,tinfloor,balla,nfnfhby,yukon1,vixens,batata,danny123,1zxcvbnm,gaetan,homewood,greats,tester1,green99,1fucker,sc0tland,starss,glori,arnhem,goatman,1234asd,supertra,bill123,elguapo,sexylegs,jackryan,usmc69,innow,roaddog,alukard,winter11,crawler,gogiants,rvd420,alessandr,homegrow,gobbler,esteba,valeriy,happy12,1joshua,hawking,sicnarf,waynes,iamhappy,bayadera,august2,sashas,gotti,dragonfire,pencil1,halogen,borisov,bassingw,15975346,zachar,sweetp,soccer99,sky123,flipyou,spots3,xakepy,cyclops1,dragon77,rattolo58,motorhea,piligrim,helloween,dmb2010,supermen,shad0w,eatcum,sandokan,pinga,ufkfrnbrf,roksana,amista,pusser,sony1234,azerty1,1qasw2,ghbdt,q1w2e3r4t5y6u7i8,ktutylf,brehznev,zaebali,shitass,creosote,gjrtvjy,14938685,naughtyboy,pedro123,21crack,maurice1,joesakic,nicolas1,matthew9,lbyfhf,elocin,hfcgbplzq,pepper123,tiktak,mycroft,ryan11,firefly1,arriva,cyecvevhbr,loreal,peedee,jessica8,lisa01,anamari,pionex,ipanema,airbag,frfltvbz,123456789aa,epwr49,casper12,sweethear,sanandreas,wuschel,cocodog,france1,119911,redroses,erevan,xtvgbjy,bigfella,geneve,volvo850,evermore,amy123,moxie,celebs,geeman,underwor,haslo1,joy123,hallow,chelsea0,12435687,abarth,12332145,tazman1,roshan,yummie,genius1,chrisd,ilovelife,seventy7,qaz1wsx2,rocket88,gaurav,bobbyboy,tauchen,roberts1,locksmit,masterof,www111,d9ungl,volvos40,asdasd1,golfers,jillian1,7xm5rq,arwpls4u,gbhcf2,elloco,football2,muerte,bob101,sabbath1,strider1,killer66,notyou,lawnboy,de7mdf,johnnyb,voodoo2,sashaa,homedepo,bravos,nihao123,braindea,weedhead,rajeev,artem1,camille1,rockss,bobbyb,aniston,frnhbcf,oakridge,biscayne,cxfcnm,dressage,jesus3,kellyann,king69,juillet,holliste,h00ters,ripoff,123645,1999ar,eric12,123777,tommi,dick12,bilder,chris99,rulezz,getpaid,chicubs,ender1,byajhvfnbrf,milkshak,sk8board,freakshow,antonella,monolit,shelb,hannah01,masters1,pitbull1,1matthew,luvpussy,agbdlcid,panther2,alphas,euskadi,8318131,ronnie1,7558795,sweetgirl,cookie59,sequoia,5552555,ktyxbr,4500455,money7,severus,shinobu,dbityrf,phisig,rogue2,fractal,redfred,sebastian1,nelli,b00mer,cyberman,zqjphsyf6ctifgu,oldsmobile,redeemer,pimpi,lovehurts,1slayer,black13,rtynfdh,airmax,g00gle,1panther,artemon,nopasswo,fuck1234,luke1,trinit,666000,ziadma,oscardog,davex,hazel1,isgood,demond,james5,construc,555551,january2,m1911a1,flameboy,merda,nathan12,nicklaus,dukester,hello99,scorpio7,leviathan,dfcbktr,pourquoi,vfrcbv123,shlomo,rfcgth,rocky3,ignatz,ajhneyf,roger123,squeek,4815162342a,biskit,mossimo,soccer21,gridlock,lunker,popstar,ghhh47hj764,chutney,nitehawk,vortec,gamma1,codeman,dragula,kappasig,rainbow2,milehigh,blueballs,ou8124me,rulesyou,collingw,mystere,aster,astrovan,firetruck,fische,crawfish,hornydog,morebeer,tigerpaw,radost,144000,1chance,1234567890qwe,gracie1,myopia,oxnard,seminoles,evgeni,edvard,partytim,domani,tuffy1,jaimatadi,blackmag,kzueirf,peternor,mathew1,maggie12,henrys,k1234567,fasted,pozitiv,cfdtkbq,jessica7,goleafs,bandito,girl78,sharingan,skyhigh,bigrob,zorros,poopers,oldschoo,pentium2,gripper,norcal,kimba,artiller,moneymak,00197400,272829,shadow1212,thebull,handbags,all4u2c,bigman2,civics,godisgoo,section8,bandaid,suzanne1,zorba,159123,racecars,i62gbq,rambo123,ironroad,johnson2,knobby,twinboys,sausage1,kelly69,enter2,rhjirf,yessss,james12,anguilla,boutit,iggypop,vovochka,06060,budwiser,romuald,meditate,good1,sandrin,herkules,lakers8,honeybea,11111111a,miche,rangers9,lobster1,seiko,belova,midcon,mackdadd,bigdaddy1,daddie,sepultur,freddy12,damon1,stormy1,hockey2,bailey12,hedimaptfcor,dcowboys,sadiedog,thuggin,horny123,josie1,nikki2,beaver69,peewee1,mateus,viktorija,barrys,cubswin1,matt1234,timoxa,rileydog,sicilia,luckycat,candybar,julian1,abc456,pussylip,phase1,acadia,catty,246800,evertonf,bojangle,qzwxec,nikolaj,fabrizi,kagome,noncapa0,marle,popol,hahaha1,cossie,carla10,diggers,spankey,sangeeta,cucciolo,breezer,starwar1,cornholio,rastafari,spring99,yyyyyyy1,webstar,72d5tn,sasha1234,inhouse,gobuffs,civic1,redstone,234523,minnie1,rivaldo,angel5,sti2000,xenocide,11qq11,1phoenix,herman1,holly123,tallguy,sharks1,madri,superbad,ronin,jalal123,hardbody,1234567r,assman1,vivahate,buddylee,38972091,bonds25,40028922,qrhmis,wp2005,ceejay,pepper01,51842543,redrum1,renton,varadero,tvxtjk7r,vetteman,djhvbrc,curly1,fruitcak,jessicas,maduro,popmart,acuari,dirkpitt,buick1,bergerac,golfcart,pdtpljxrf,hooch1,dudelove,d9ebk7,123452000,afdjhbn,greener,123455432,parachut,mookie12,123456780,jeepcj5,potatoe,sanya,qwerty2010,waqw3p,gotika,freaky1,chihuahu,buccanee,ecstacy,crazyboy,slickric,blue88,fktdnbyf,2004rj,delta4,333222111,calient,ptbdhw,1bailey,blitz1,sheila1,master23,hoagie,pyf8ah,orbita,daveyboy,prono1,delta2,heman,1horny,tyrik123,ostrov,md2020,herve,rockfish,el546218,rfhbyjxrf,chessmaster,redmoon,lenny1,215487,tomat,guppy,amekpass,amoeba,my3girls,nottingh,kavita,natalia1,puccini,fabiana,8letters,romeos,netgear,casper2,taters,gowings,iforgot1,pokesmot,pollit,lawrun,petey1,rosebuds,007jr,gthtcnhjqrf,k9dls02a,neener,azertyu,duke11,manyak,tiger01,petros,supermar,mangas,twisty,spotter,takagi,dlanod,qcmfd454,tusymo,zz123456,chach,navyblue,gilbert1,2kash6zq,avemaria,1hxboqg2s,viviane,lhbjkjubz2957704,nowwowtg,1a2b3c4,m0rn3,kqigb7,superpuper,juehtw,gethigh,theclown,makeme,pradeep,sergik,deion21,nurik,devo2706,nbvibt,roman222,kalima,nevaeh,martin7,anathema,florian1,tamwsn3sja,dinmamma,133159,123654q,slicks,pnp0c08,yojimbo,skipp,kiran,pussyfuck,teengirl,apples12,myballs,angeli,1234a,125678,opelastra,blind1,armagedd,fish123,pitufo,chelseaf,thedevil,nugget1,cunt69,beetle1,carter15,apolon,collant,password00,fishboy,djkrjdf,deftone,celti,three11,cyrus1,lefthand,skoal1,ferndale,aries1,fred01,roberta1,chucks,cornbread,lloyd1,icecrea,cisco123,newjerse,vfhrbpf,passio,volcom1,rikimaru,yeah11,djembe,facile,a1l2e3x4,batman7,nurbol,lorenzo1,monica69,blowjob1,998899,spank1,233391,n123456,1bear,bellsout,999998,celtic67,sabre1,putas,y9enkj,alfabeta,heatwave,honey123,hard4u,insane1,xthysq,magnum1,lightsaber,123qweqwe,fisher1,pixie1,precios,benfic,thegirls,bootsman,4321rewq,nabokov,hightime,djghjc,1chelsea,junglist,august16,t3fkvkmj,1232123,lsdlsd12,chuckie1,pescado,granit,toogood,cathouse,natedawg,bmw530,123kid,hajime,198400,engine1,wessonnn,kingdom1,novembre,1rocks,kingfisher,qwerty89,jordan22,zasranec,megat,sucess,installutil,fetish01,yanshi1982,1313666,1314520,clemence,wargod,time1,newzealand,snaker,13324124,cfrehf,hepcat,mazahaka,bigjay,denisov,eastwest,1yellow,mistydog,cheetos,1596357,ginger11,mavrik,bubby1,bhbyf,pyramide,giusepp,luthien,honda250,andrewjackie,kentavr,lampoon,zaq123wsx,sonicx,davidh,1ccccc,gorodok,windsong,programm,blunt420,vlad1995,zxcvfdsa,tarasov,mrskin,sachas,mercedes1,koteczek,rawdog,honeybear,stuart1,kaktys,richard7,55555n,azalia,hockey10,scouter,francy,1xxxxxx,julie456,tequilla,penis123,schmoe,tigerwoods,1ferrari,popov,snowdrop,matthieu,smolensk,cornflak,jordan01,love2000,23wesdxc,kswiss,anna2000,geniusnet,baby2000,33ds5x,waverly,onlyone4,networkingpe,raven123,blesse,gocards,wow123,pjflkork,juicey,poorboy,freeee,billybo,shaheen,zxcvbnm.,berlit,truth1,gepard,ludovic,gunther1,bobby2,bob12345,sunmoon,septembr,bigmac1,bcnjhbz,seaking,all4u,12qw34er56ty,bassie,nokia5228,7355608,sylwia,charvel,billgate,davion,chablis,catsmeow,kjiflrf,amylynn,rfvbkkf,mizredhe,handjob,jasper12,erbol,solara,bagpipe,biffer,notime,erlan,8543852,sugaree,oshkosh,fedora,bangbus,5lyedn,longball,teresa1,bootyman,aleksand,qazwsxedc12,nujbhc,tifosi,zpxvwy,lights1,slowpoke,tiger12,kstate,password10,alex69,collins1,9632147,doglover,baseball2,security1,grunts,orange2,godloves,213qwe879,julieb,1qazxsw23edcvfr4,noidea,8uiazp,betsy1,junior2,parol123,123456zz,piehonkii,kanker,bunky,hingis,reese1,qaz123456,sidewinder,tonedup,footsie,blackpoo,jalapeno,mummy1,always1,josh1,rockyboy,plucky,chicag,nadroj,blarney,blood123,wheaties,packer1,ravens1,mrjones,gfhjkm007,anna2010,awatar,guitar12,hashish,scale1,tomwaits,amrita,fantasma,rfpfym,pass2,tigris,bigair,slicker,sylvi,shilpa,cindylou,archie1,bitches1,poppys,ontime,horney1,camaroz28,alladin,bujhm,cq2kph,alina1,wvj5np,1211123a,tetons,scorelan,concordi,morgan2,awacs,shanty,tomcat14,andrew123,bear69,vitae,fred99,chingy,octane,belgario,fatdaddy,rhodan,password23,sexxes,boomtown,joshua01,war3demo,my2kids,buck1,hot4you,monamour,12345aa,yumiko,parool,carlton1,neverland,rose12,right1,sociald,grouse,brandon0,cat222,alex00,civicex,bintang,malkav,arschloc,dodgeviper,qwerty666,goduke,dante123,boss1,ontheroc,corpsman,love14,uiegu451,hardtail,irondoor,ghjrehfnehf,36460341,konijn,h2slca,kondom25,123456ss,cfytxrf,btnjey,nando,freemail,comander,natas666,siouxsie,hummer1,biomed,dimsum,yankees0,diablo666,lesbian1,pot420,jasonm,glock23,jennyb,itsmine,lena2010,whattheh,beandip,abaddon,kishore,signup,apogee,biteme12,suzieq,vgfun4,iseeyou,rifleman,qwerta,4pussy,hawkman,guest1,june17,dicksuck,bootay,cash12,bassale,ktybyuhfl,leetch,nescafe,7ovtgimc,clapton1,auror,boonie,tracker1,john69,bellas,cabinboy,yonkers,silky1,ladyffesta,drache,kamil1,davidp,bad123,snoopy12,sanche,werthvfy,achille,nefertiti,gerald1,slage33,warszawa,macsan26,mason123,kotopes,welcome8,nascar99,kiril,77778888,hairy1,monito,comicsans,81726354,killabee,arclight,yuo67,feelme,86753099,nnssnn,monday12,88351132,88889999,websters,subito,asdf12345,vaz2108,zvbxrpl,159753456852,rezeda,multimed,noaccess,henrique,tascam,captiva,zadrot,hateyou,sophie12,123123456,snoop1,charlie8,birmingh,hardline,libert,azsxdcf,89172735872,rjpthju,bondar,philips1,olegnaruto,myword,yakman,stardog,banana12,1234567890w,farout,annick,duke01,rfj422,billard,glock19,shaolin1,master10,cinderel,deltaone,manning1,biggreen,sidney1,patty1,goforit1,766rglqy,sevendus,aristotl,armagedo,blumen,gfhfyjz,kazakov,lekbyxxx,accord1,idiota,soccer16,texas123,victoire,ololo,chris01,bobbbb,299792458,eeeeeee1,confiden,07070,clarks,techno1,kayley,stang1,wwwwww1,uuuuu1,neverdie,jasonr,cavscout,481516234,mylove1,shaitan,1qazxcvb,barbaros,123456782000,123wer,thissucks,7seven,227722,faerie,hayduke,dbacks,snorkel,zmxncbv,tiger99,unknown1,melmac,polo1234,sssssss1,1fire,369147,bandung,bluejean,nivram,stanle,ctcnhf,soccer20,blingbli,dirtball,alex2112,183461,skylin,boobman,geronto,brittany1,yyz2112,gizmo69,ktrcec,dakota12,chiken,sexy11,vg08k714,bernadet,1bulldog,beachs,hollyb,maryjoy,margo1,danielle1,chakra,alexand,hullcity,matrix12,sarenna,pablos,antler,supercar,chomsky,german1,airjordan,545ettvy,camaron,flight1,netvideo,tootall,valheru,481516,1234as,skimmer,redcross,inuyash,uthvfy,1012nw,edoardo,bjhgfi,golf11,9379992a,lagarto,socball,boopie,krazy,.adgjmptw,gaydar,kovalev,geddylee,firstone,turbodog,loveee,135711,badbo,trapdoor,opopop11,danny2,max2000,526452,kerry1,leapfrog,daisy2,134kzbip,1andrea,playa1,peekab00,heskey,pirrello,gsewfmck,dimon4ik,puppie,chelios,554433,hypnodanny,fantik,yhwnqc,ghbdtngjrf,anchorag,buffett1,fanta,sappho,024680,vialli,chiva,lucylu,hashem,exbntkm,thema,23jordan,jake11,wildside,smartie,emerica,2wj2k9oj,ventrue,timoth,lamers,baerchen,suspende,boobis,denman85,1adam12,otello,king12,dzakuni,qsawbbs,isgay,porno123,jam123,daytona1,tazzie,bunny123,amaterasu,jeffre,crocus,mastercard,bitchedup,chicago7,aynrand,intel1,tamila,alianza,mulch,merlin12,rose123,alcapone,mircea,loveher,joseph12,chelsea6,dorothy1,wolfgar,unlimite,arturik,qwerty3,paddy1,piramid,linda123,cooool,millie1,warlock1,forgotit,tort02,ilikeyou,avensis,loveislife,dumbass1,clint1,2110se,drlove,olesia,kalinina,sergey123,123423,alicia1,markova,tri5a3,media1,willia1,xxxxxxx1,beercan,smk7366,jesusislord,motherfuck,smacker,birthday5,jbaby,harley2,hyper1,a9387670a,honey2,corvet,gjmptw,rjhjkmbien,apollon,madhuri,3a5irt,cessna17,saluki,digweed,tamia1,yja3vo,cfvlehfr,1111111q,martyna,stimpy1,anjana,yankeemp,jupiler,idkfa,1blue,fromv,afric,3xbobobo,liverp00l,nikon1,amadeus1,acer123,napoleo,david7,vbhjckfdf,mojo69,percy1,pirates1,grunt1,alenushka,finbar,zsxdcf,mandy123,1fred,timewarp,747bbb,druids,julia123,123321qq,spacebar,dreads,fcbarcelona,angela12,anima,christopher1,stargazer,123123s,hockey11,brewski,marlbor,blinker,motorhead,damngood,werthrf,letmein3,moremoney,killer99,anneke,eatit,pilatus,andrew01,fiona1,maitai,blucher,zxgdqn,e5pftu,nagual,panic1,andron,openwide,alphabeta,alison1,chelsea8,fende,mmm666,1shot2,a19l1980,123456@,1black,m1chael,vagner,realgood,maxxx,vekmnbr,stifler,2509mmh,tarkan,sherzod,1234567b,gunners1,artem2010,shooby,sammie1,p123456,piggie,abcde12345,nokia6230,moldir,piter,1qaz3edc,frequenc,acuransx,1star,nikeair,alex21,dapimp,ranjan,ilovegirls,anastasiy,berbatov,manso,21436587,leafs1,106666,angelochek,ingodwetrust,123456aaa,deano,korsar,pipetka,thunder9,minka,himura,installdevic,1qqqqq,digitalprodu,suckmeoff,plonker,headers,vlasov,ktr1996,windsor1,mishanya,garfield1,korvin,littlebit,azaz09,vandamme,scripto,s4114d,passward,britt1,r1chard,ferrari5,running1,7xswzaq,falcon2,pepper76,trademan,ea53g5,graham1,volvos80,reanimator,micasa,1234554321q,kairat,escorpion,sanek94,karolina1,kolovrat,karen2,1qaz@wsx,racing1,splooge,sarah2,deadman1,creed1,nooner,minicoop,oceane,room112,charme,12345ab,summer00,wetcunt,drewman,nastyman,redfire,appels,merlin69,dolfin,bornfree,diskette,ohwell,12345678qwe,jasont,madcap,cobra2,dolemit1,whatthehell,juanit,voldemar,rocke,bianc,elendil,vtufgjkbc,hotwheels,spanis,sukram,pokerface,k1ller,freakout,dontae,realmadri,drumss,gorams,258789,snakey,jasonn,whitewolf,befree,johnny99,pooka,theghost,kennys,vfvektxrf,toby1,jumpman23,deadlock,barbwire,stellina,alexa1,dalamar,mustanggt,northwes,tesoro,chameleo,sigtau,satoshi,george11,hotcum,cornell1,golfer12,geek01d,trololo,kellym,megapolis,pepsi2,hea666,monkfish,blue52,sarajane,bowler1,skeets,ddgirls,hfccbz,bailey01,isabella1,dreday,moose123,baobab,crushme,000009,veryhot,roadie,meanone,mike18,henriett,dohcvtec,moulin,gulnur,adastra,angel9,western1,natura,sweetpe,dtnfkm,marsbar,daisys,frogger1,virus1,redwood1,streetball,fridolin,d78unhxq,midas,michelob,cantik,sk2000,kikker,macanudo,rambone,fizzle,20000,peanuts1,cowpie,stone32,astaroth,dakota01,redso,mustard1,sexylove,giantess,teaparty,bobbin,beerbong,monet1,charles3,anniedog,anna1988,cameleon,longbeach,tamere,qpful542,mesquite,waldemar,12345zx,iamhere,lowboy,canard,granp,daisymay,love33,moosejaw,nivek,ninjaman,shrike01,aaa777,88002000600,vodolei,bambush,falcor,harley69,alphaomega,severine,grappler,bosox,twogirls,gatorman,vettes,buttmunch,chyna,excelsio,crayfish,birillo,megumi,lsia9dnb9y,littlebo,stevek,hiroyuki,firehous,master5,briley2,gangste,chrisk,camaleon,bulle,troyboy,froinlaven,mybutt,sandhya,rapala,jagged,crazycat,lucky12,jetman,wavmanuk,1heather,beegee,negril,mario123,funtime1,conehead,abigai,mhorgan,patagoni,travel1,backspace,frenchfr,mudcat,dashenka,baseball3,rustys,741852kk,dickme,baller23,griffey1,suckmycock,fuhrfzgc,jenny2,spuds,berlin1,justfun,icewind,bumerang,pavlusha,minecraft123,shasta1,ranger12,123400,twisters,buthead,miked,finance1,dignity7,hello9,lvjdp383,jgthfnjh,dalmatio,paparoach,miller31,2bornot2b,fathe,monterre,theblues,satans,schaap,jasmine2,sibelius,manon,heslo,jcnhjd,shane123,natasha2,pierrot,bluecar,iloveass,harriso,red12,london20,job314,beholder,reddawg,fuckyou!,pussylick,bologna1,austintx,ole4ka,blotto,onering,jearly,balbes,lightbul,bighorn,crossfir,lee123,prapor,1ashley,gfhjkm22,wwe123,09090,sexsite,marina123,jagua,witch1,schmoo,parkview,dragon3,chilango,ultimo,abramova,nautique,2bornot2,duende,1arthur,nightwing,surfboar,quant4307,15s9pu03,karina1,shitball,walleye1,wildman1,whytesha,1morgan,my2girls,polic,baranova,berezuckiy,kkkkkk1,forzima,fornow,qwerty02,gokart,suckit69,davidlee,whatnow,edgard,tits1,bayshore,36987412,ghbphfr,daddyy,explore1,zoidberg,5qnzjx,morgane,danilov,blacksex,mickey12,balsam,83y6pv,sarahc,slaye,all4u2,slayer69,nadia1,rlzwp503,4cranker,kaylie,numberon,teremok,wolf12,deeppurple,goodbeer,aaa555,66669999,whatif,harmony1,ue8fpw,3tmnej,254xtpss,dusty197,wcksdypk,zerkalo,dfnheirf,motorol,digita,whoareyou,darksoul,manics,rounders,killer11,d2000lb,cegthgfhjkm,catdog1,beograd,pepsico,julius1,123654987,softbal,killer23,weasel1,lifeson,q123456q,444555666,bunches,andy1,darby1,service01,bear11,jordan123,amega,duncan21,yensid,lerxst,rassvet,bronco2,fortis,pornlove,paiste,198900,asdflkjh,1236547890,futur,eugene1,winnipeg261,fk8bhydb,seanjohn,brimston,matthe1,bitchedu,crisco,302731,roxydog,woodlawn,volgograd,ace1210,boy4u2ownnyc,laura123,pronger,parker12,z123456z,andrew13,longlife,sarang,drogba,gobruins,soccer4,holida,espace,almira,murmansk,green22,safina,wm00022,1chevy,schlumpf,doroth,ulises,golf99,hellyes,detlef,mydog,erkina,bastardo,mashenka,sucram,wehttam,generic1,195000,spaceboy,lopas123,scammer,skynyrd,daddy2,titani,ficker,cr250r,kbnthfnehf,takedown,sticky1,davidruiz,desant,nremtp,painter1,bogies,agamemno,kansas1,smallfry,archi,2b4dnvsx,1player,saddie,peapod,6458zn7a,qvw6n2,gfxqx686,twice2,sh4d0w3d,mayfly,375125,phitau,yqmbevgk,89211375759,kumar1,pfhfpf,toyboy,way2go,7pvn4t,pass69,chipster,spoony,buddycat,diamond3,rincewin,hobie,david01,billbo,hxp4life,matild,pokemon2,dimochka,clown1,148888,jenmt3,cuxldv,cqnwhy,cde34rfv,simone1,verynice,toobig,pasha123,mike00,maria2,lolpop,firewire,dragon9,martesana,a1234567890,birthday3,providen,kiska,pitbulls,556655,misawa,damned69,martin11,goldorak,gunship,glory1,winxclub,sixgun,splodge,agent1,splitter,dome69,ifghjb,eliza1,snaiper,wutang36,phoenix7,666425,arshavin,paulaner,namron,m69fg1w,qwert1234,terrys,zesyrmvu,joeman,scoots,dwml9f,625vrobg,sally123,gostoso,symow8,pelota,c43qpul5rz,majinbuu,lithium1,bigstuff,horndog1,kipelov,kringle,1beavis,loshara,octobe,jmzacf,12342000,qw12qw,runescape1,chargers1,krokus,piknik,jessy,778811,gjvbljh,474jdvff,pleaser,misskitty,breaker1,7f4df451,dayan,twinky,yakumo,chippers,matia,tanith,len2ski1,manni,nichol1,f00b4r,nokia3110,standart,123456789i,shami,steffie,larrywn,chucker,john99,chamois,jjjkkk,penmouse,ktnj2010,gooners,hemmelig,rodney1,merlin01,bearcat1,1yyyyy,159753z,1fffff,1ddddd,thomas11,gjkbyrf,ivanka,f1f2f3,petrovna,phunky,conair,brian2,creative1,klipsch,vbitymrf,freek,breitlin,cecili,westwing,gohabsgo,tippmann,1steve,quattro6,fatbob,sp00ky,rastas,1123581,redsea,rfnmrf,jerky1,1aaaaaa,spk666,simba123,qwert54321,123abcd,beavis69,fyfyfc,starr1,1236547,peanutbutter,sintra,12345abcde,1357246,abcde1,climbon,755dfx,mermaids,monte1,serkan,geilesau,777win,jasonc,parkside,imagine1,rockhead,producti,playhard,principa,spammer,gagher,escada,tsv1860,dbyjuhfl,cruiser1,kennyg,montgome,2481632,pompano,cum123,angel6,sooty,bear01,april6,bodyhamm,pugsly,getrich,mikes,pelusa,fosgate,jasonp,rostislav,kimberly1,128mo,dallas11,gooner1,manuel1,cocacola1,imesh,5782790,password8,daboys,1jones,intheend,e3w2q1,whisper1,madone,pjcgujrat,1p2o3i,jamesp,felicida,nemrac,phikap,firecat,jrcfyjxrf,matt12,bigfan,doedel,005500,jasonx,1234567k,badfish,goosey,utjuhfabz,wilco,artem123,igor123,spike123,jor23dan,dga9la,v2jmsz,morgan12,avery1,dogstyle,natasa,221195ws,twopac,oktober7,karthik,poop1,mightymo,davidr,zermatt,jehova,aezakmi1,dimwit,monkey5,serega123,qwerty111,blabl,casey22,boy123,1clutch,asdfjkl1,hariom,bruce10,jeep95,1smith,sm9934,karishma,bazzzz,aristo,669e53e1,nesterov,kill666,fihdfv,1abc2,anna1,silver11,mojoman,telefono,goeagles,sd3lpgdr,rfhfynby,melinda1,llcoolj,idteul,bigchief,rocky13,timberwo,ballers,gatekeep,kashif,hardass,anastasija,max777,vfuyjkbz,riesling,agent99,kappas,dalglish,tincan,orange3,turtoise,abkbvjy,mike24,hugedick,alabala,geolog,aziza,devilboy,habanero,waheguru,funboy,freedom5,natwest,seashore,impaler,qwaszx1,pastas,bmw535,tecktonik,mika00,jobsearc,pinche,puntang,aw96b6,1corvett,skorpio,foundati,zzr1100,gembird,vfnhjcrby,soccer18,vaz2110,peterp,archer1,cross1,samedi,dima1992,hunter99,lipper,hotbody,zhjckfdf,ducati1,trailer1,04325956,cheryl1,benetton,kononenko,sloneczko,rfgtkmrf,nashua,balalaika,ampere,eliston,dorsai,digge,flyrod,oxymoron,minolta,ironmike,majortom,karimov,fortun,putaria,an83546921an13,blade123,franchis,mxaigtg5,dynxyu,devlt4,brasi,terces,wqmfuh,nqdgxz,dale88,minchia,seeyou,housepen,1apple,1buddy,mariusz,bighouse,tango2,flimflam,nicola1,qwertyasd,tomek1,shumaher,kartoshka,bassss,canaries,redman1,123456789as,preciosa,allblacks,navidad,tommaso,beaudog,forrest1,green23,ryjgjxrf,go4it,ironman2,badnews,butterba,1grizzly,isaeva,rembrand,toront,1richard,bigjon,yfltymrf,1kitty,4ng62t,littlejo,wolfdog,ctvtyjd,spain1,megryan,tatertot,raven69,4809594q,tapout,stuntman,a131313,lagers,hotstuf,lfdbl11,stanley2,advokat,boloto,7894561,dooker,adxel187,cleodog,4play,0p9o8i,masterb,bimota,charlee,toystory,6820055,6666667,crevette,6031769,corsa,bingoo,dima1990,tennis11,samuri,avocado,melissa6,unicor,habari,metart,needsex,cockman,hernan,3891576,3334444,amigo1,gobuffs2,mike21,allianz,2835493,179355,midgard,joey123,oneluv,ellis1,towncar,shonuff,scouse,tool69,thomas19,chorizo,jblaze,lisa1,dima1999,sophia1,anna1989,vfvekbxrf,krasavica,redlegs,jason25,tbontb,katrine,eumesmo,vfhufhbnrf,1654321,asdfghj1,motdepas,booga,doogle,1453145,byron1,158272,kardinal,tanne,fallen1,abcd12345,ufyljy,n12345,kucing,burberry,bodger,1234578,februar,1234512,nekkid,prober,harrison1,idlewild,rfnz90,foiegras,pussy21,bigstud,denzel,tiffany2,bigwill,1234567890zzz,hello69,compute1,viper9,hellspaw,trythis,gococks,dogballs,delfi,lupine,millenia,newdelhi,charlest,basspro,1mike,joeblack,975310,1rosebud,batman11,misterio,fucknut,charlie0,august11,juancho,ilonka,jigei743ks,adam1234,889900,goonie,alicat,ggggggg1,1zzzzzzz,sexywife,northstar,chris23,888111,containe,trojan1,jason5,graikos,1ggggg,1eeeee,tigers01,indigo1,hotmale,jacob123,mishima,richard3,cjxb2014,coco123,meagain,thaman,wallst,edgewood,bundas,1power,matilda1,maradon,hookedup,jemima,r3vi3wpass,2004-10-,mudman,taz123,xswzaq,emerson1,anna21,warlord1,toering,pelle,tgwdvu,masterb8,wallstre,moppel,priora,ghjcnjrdfif,yoland,12332100,1j9e7f6f,jazzzz,yesman,brianm,42qwerty42,12345698,darkmanx,nirmal,john31,bb123456,neuspeed,billgates,moguls,fj1200,hbhlair,shaun1,ghbdfn,305pwzlr,nbu3cd,susanb,pimpdad,mangust6403,joedog,dawidek,gigante,708090,703751,700007,ikalcr,tbivbn,697769,marvi,iyaayas,karen123,jimmyboy,dozer1,e6z8jh,bigtime1,getdown,kevin12,brookly,zjduc3,nolan1,cobber,yr8wdxcq,liebe,m1garand,blah123,616879,action1,600000,sumitomo,albcaz,asian1,557799,dave69,556699,sasa123,streaker,michel1,karate1,buddy7,daulet,koks888,roadtrip,wapiti,oldguy,illini1,1234qq,mrspock,kwiatek,buterfly,august31,jibxhq,jackin,taxicab,tristram,talisker,446655,444666,chrisa,freespace,vfhbfyyf,chevell,444333,notyours,442244,christian1,seemore,sniper12,marlin1,joker666,multik,devilish,crf450,cdfoli,eastern1,asshead,duhast,voyager2,cyberia,1wizard,cybernet,iloveme1,veterok,karandash,392781,looksee,diddy,diabolic,foofight,missey,herbert1,bmw318i,premier1,zsfmpv,eric1234,dun6sm,fuck11,345543,spudman,lurker,bitem,lizzy1,ironsink,minami,339311,s7fhs127,sterne,332233,plankton,galax,azuywe,changepa,august25,mouse123,sikici,killer69,xswqaz,quovadis,gnomik,033028pw,777777a,barrakuda,spawn666,goodgod,slurp,morbius,yelnats,cujo31,norman1,fastone,earwig,aureli,wordlife,bnfkbz,yasmi,austin123,timberla,missy2,legalize,netcom,liljon,takeit,georgin,987654321z,warbird,vitalina,all4u3,mmmmmm1,bichon,ellobo,wahoos,fcazmj,aksarben,lodoss,satnam,vasili,197800,maarten,sam138989,0u812,ankita,walte,prince12,anvils,bestia,hoschi,198300,univer,jack10,ktyecbr,gr00vy,hokie,wolfman1,fuckwit,geyser,emmanue,ybrjkftd,qwerty33,karat,dblock,avocat,bobbym,womersle,1please,nostra,dayana,billyray,alternat,iloveu1,qwerty69,rammstein1,mystikal,winne,drawde,executor,craxxxs,ghjcnjnf,999888777,welshman,access123,963214785,951753852,babe69,fvcnthlfv,****me,666999666,testing2,199200,nintendo64,oscarr,guido8,zhanna,gumshoe,jbird,159357456,pasca,123452345,satan6,mithrand,fhbirf,aa1111aa,viggen,ficktjuv,radial9,davids1,rainbow7,futuro,hipho,platin,poppy123,rhenjq,fulle,rosit,chicano,scrumpy,lumpy1,seifer,uvmrysez,autumn1,xenon,susie1,7u8i9o0p,gamer1,sirene,muffy1,monkeys1,kalinin,olcrackmaster,hotmove,uconn,gshock,merson,lthtdyz,pizzaboy,peggy1,pistache,pinto1,fishka,ladydi,pandor,baileys,hungwell,redboy,rookie1,amanda01,passwrd,clean1,matty1,tarkus,jabba1,bobster,beer30,solomon1,moneymon,sesamo,fred11,sunnysid,jasmine5,thebears,putamadre,workhard,flashbac,counter1,liefde,magnat,corky1,green6,abramov,lordik,univers,shortys,david3,vip123,gnarly,1234567s,billy2,honkey,deathstar,grimmy,govinda,direktor,12345678s,linus1,shoppin,rekbrjdf,santeria,prett,berty75,mohican,daftpunk,uekmyfhf,chupa,strats,ironbird,giants56,salisbur,koldun,summer04,pondscum,jimmyj,miata1,george3,redshoes,weezie,bartman1,0p9o8i7u,s1lver,dorkus,125478,omega9,sexisgood,mancow,patric1,jetta1,074401,ghjuhtcc,gfhjk,bibble,terry2,123213,medicin,rebel2,hen3ry,4freedom,aldrin,lovesyou,browny,renwod,winnie1,belladon,1house,tyghbn,blessme,rfhfrfnbwf,haylee,deepdive,booya,phantasy,gansta,cock69,4mnveh,gazza1,redapple,structur,anakin1,manolito,steve01,poolman,chloe123,vlad1998,qazwsxe,pushit,random123,ontherocks,o236nq,brain1,dimedrol,agape,rovnogod,1balls,knigh,alliso,love01,wolf01,flintstone,beernuts,tuffguy,isengard,highfive,alex23,casper99,rubina,getreal,chinita,italian1,airsoft,qwerty23,muffdiver,willi1,grace123,orioles1,redbull1,chino1,ziggy123,breadman,estefan,ljcneg,gotoit,logan123,wideglid,mancity1,treess,qwe123456,kazumi,qweasdqwe,oddworld,naveed,protos,towson,a801016,godislov,at_asp,bambam1,soccer5,dark123,67vette,carlos123,hoser1,scouser,wesdxc,pelus,dragon25,pflhjn,abdula,1freedom,policema,tarkin,eduardo1,mackdad,gfhjkm11,lfplhfgthvf,adilet,zzzzxxxx,childre,samarkand,cegthgegth,shama,fresher,silvestr,greaser,allout,plmokn,sexdrive,nintendo1,fantasy7,oleander,fe126fd,crumpet,pingzing,dionis,hipster,yfcnz,requin,calliope,jerome1,housecat,abc123456789,doghot,snake123,augus,brillig,chronic1,gfhjkbot,expediti,noisette,master7,caliban,whitetai,favorite3,lisamari,educatio,ghjhjr,saber1,zcegth,1958proman,vtkrbq,milkdud,imajica,thehip,bailey10,hockey19,dkflbdjcnjr,j123456,bernar,aeiouy,gamlet,deltachi,endzone,conni,bcgfybz,brandi1,auckland2010,7653ajl1,mardigra,testuser,bunko18,camaro67,36936,greenie,454dfmcq,6xe8j2z4,mrgreen,ranger5,headhunt,banshee1,moonunit,zyltrc,hello3,pussyboy,stoopid,tigger11,yellow12,drums1,blue02,kils123,junkman,banyan,jimmyjam,tbbucs,sportster,badass1,joshie,braves10,lajolla,1amanda,antani,78787,antero,19216801,chich,rhett32,sarahm,beloit,sucker69,corkey,nicosnn,rccola,caracol,daffyduc,bunny2,mantas,monkies,hedonist,cacapipi,ashton1,sid123,19899891,patche,greekgod,cbr1000,leader1,19977991,ettore,chongo,113311,picass,cfif123,rhtfnbd,frances1,andy12,minnette,bigboy12,green69,alices,babcia,partyboy,javabean,freehand,qawsed123,xxx111,harold1,passwo,jonny1,kappa1,w2dlww3v5p,1merlin,222999,tomjones,jakeman,franken,markhegarty,john01,carole1,daveman,caseys,apeman,mookey,moon123,claret,titans1,residentevil,campari,curitiba,dovetail,aerostar,jackdaniels,basenji,zaq12w,glencoe,biglove,goober12,ncc170,far7766,monkey21,eclipse9,1234567v,vanechka,aristote,grumble,belgorod,abhishek,neworleans,pazzword,dummie,sashadog,diablo11,mst3000,koala1,maureen1,jake99,isaiah1,funkster,gillian1,ekaterina20,chibears,astra123,4me2no,winte,skippe,necro,windows9,vinograd,demolay,vika2010,quiksilver,19371ayj,dollar1,shecky,qzwxecrv,butterfly1,merrill1,scoreland,1crazy,megastar,mandragora,track1,dedhed,jacob2,newhope,qawsedrftgyh,shack1,samvel,gatita,shyster,clara1,telstar,office1,crickett,truls,nirmala,joselito,chrisl,lesnik,aaaabbbb,austin01,leto2010,bubbie,aaa12345,widder,234432,salinger,mrsmith,qazsedcft,newshoes,skunks,yt1300,bmw316,arbeit,smoove,123321qweewq,123qazwsx,22221111,seesaw,0987654321a,peach1,1029384756q,sereda,gerrard8,shit123,batcave,energy1,peterb,mytruck,peter12,alesya,tomato1,spirou,laputaxx,magoo1,omgkremidia,knight12,norton1,vladislava,shaddy,austin11,jlbyjxrf,kbdthgekm,punheta,fetish69,exploiter,roger2,manstein,gtnhjd,32615948worms,dogbreath,ujkjdjkjvrf,vodka1,ripcord,fatrat,kotek1,tiziana,larrybir,thunder3,nbvfnb,9kyq6fge,remembe,likemike,gavin1,shinigam,yfcnfcmz,13245678,jabbar,vampyr,ane4ka,lollipo,ashwin,scuderia,limpdick,deagle,3247562,vishenka,fdhjhf,alex02,volvov70,mandys,bioshock,caraca,tombraider,matrix69,jeff123,13579135,parazit,black3,noway1,diablos,hitmen,garden1,aminor,decembe,august12,b00ger,006900,452073t,schach,hitman1,mariner1,vbnmrf,paint1,742617000027,bitchboy,pfqxjyjr,5681392,marryher,sinnet,malik1,muffin12,aninha,piolin,lady12,traffic1,cbvjyf,6345789,june21,ivan2010,ryan123,honda99,gunny,coorslight,asd321,hunter69,7224763,sonofgod,dolphins1,1dolphin,pavlenko,woodwind,lovelov,pinkpant,gblfhfcbyf,hotel1,justinbiebe,vinter,jeff1234,mydogs,1pizza,boats1,parrothe,shawshan,brooklyn1,cbrown,1rocky,hemi426,dragon64,redwings1,porsches,ghostly,hubbahub,buttnut,b929ezzh,sorokina,flashg,fritos,b7mguk,metatron,treehous,vorpal,8902792,marcu,free123,labamba,chiefs1,zxc123zxc,keli_14,hotti,1steeler,money4,rakker,foxwoods,free1,ahjkjd,sidorova,snowwhit,neptune1,mrlover,trader1,nudelamb,baloo,power7,deltasig,bills1,trevo,7gorwell,nokia6630,nokia5320,madhatte,1cowboys,manga1,namtab,sanjar,fanny1,birdman1,adv12775,carlo1,dude1998,babyhuey,nicole11,madmike,ubvyfpbz,qawsedr,lifetec,skyhook,stalker123,toolong,robertso,ripazha,zippy123,1111111a,manol,dirtyman,analslut,jason3,dutches,minhasenha,cerise,fenrir,jayjay1,flatbush,franka,bhbyjxrf,26429vadim,lawntrax,198700,fritzy,nikhil,ripper1,harami,truckman,nemvxyheqdd5oqxyxyzi,gkfytnf,bugaboo,cableman,hairpie,xplorer,movado,hotsex69,mordred,ohyeah1,patrick3,frolov,katieh,4311111q,mochaj,presari,bigdo,753951852,freedom4,kapitan,tomas1,135795,sweet123,pokers,shagme,tane4ka,sentinal,ufgyndmv,jonnyb,skate123,123456798,123456788,very1,gerrit,damocles,dollarbi,caroline1,lloyds,pizdets,flatland,92702689,dave13,meoff,ajnjuhfabz,achmed,madison9,744744z,amonte,avrillavigne,elaine1,norma1,asseater,everlong,buddy23,cmgang1,trash1,mitsu,flyman,ulugbek,june27,magistr,fittan,sebora64,dingos,sleipnir,caterpil,cindys,212121qaz,partys,dialer,gjytltkmybr,qweqaz,janvier,rocawear,lostboy,aileron,sweety1,everest1,pornman,boombox,potter1,blackdic,44448888,eric123,112233aa,2502557i,novass,nanotech,yourname,x12345,indian1,15975300,1234567l,carla51,chicago0,coleta,cxzdsaewq,qqwweerr,marwan,deltic,hollys,qwerasd,pon32029,rainmake,nathan0,matveeva,legioner,kevink,riven,tombraid,blitzen,a54321,jackyl,chinese1,shalimar,oleg1995,beaches1,tommylee,eknock,berli,monkey23,badbob,pugwash,likewhoa,jesus2,yujyd360,belmar,shadow22,utfp5e,angelo1,minimax,pooder,cocoa1,moresex,tortue,lesbia,panthe,snoopy2,drumnbass,alway,gmcz71,6jhwmqku,leppard,dinsdale,blair1,boriqua,money111,virtuagirl,267605,rattlesn,1sunshin,monica12,veritas1,newmexic,millertime,turandot,rfvxfnrf,jaydog,kakawka,bowhunter,booboo12,deerpark,erreway,taylorma,rfkbybyf,wooglin,weegee,rexdog,iamhorny,cazzo1,vhou812,bacardi1,dctktyyfz,godpasi,peanut12,bertha1,fuckyoubitch,ghosty,altavista,jertoot,smokeit,ghjcnbvtyz,fhnehxbr,rolsen,qazxcdews,maddmaxx,redrocke,qazokm,spencer2,thekiller,asdf11,123sex,tupac1,p1234567,dbrown,1biteme,tgo4466,316769,sunghi,shakespe,frosty1,gucci1,arcana,bandit01,lyubov,poochy,dartmout,magpies1,sunnyd,mouseman,summer07,chester7,shalini,danbury,pigboy,dave99,deniss,harryb,ashley11,pppppp1,01081988m,balloon1,tkachenko,bucks1,master77,pussyca,tricky1,zzxxccvv,zoulou,doomer,mukesh,iluv69,supermax,todays,thefox,don123,dontask,diplom,piglett,shiney,fahbrf,qaz12wsx,temitope,reggin,project1,buffy2,inside1,lbpfqyth,vanilla1,lovecock,u4slpwra,fylh.irf,123211,7ertu3ds,necroman,chalky,artist1,simpso,4x7wjr,chaos666,lazyacres,harley99,ch33s3,marusa,eagle7,dilligas,computadora,lucky69,denwer,nissan350z,unforgiv,oddball,schalke0,aztec1,borisova,branden1,parkave,marie123,germa,lafayett,878kckxy,405060,cheeseca,bigwave,fred22,andreea,poulet,mercutio,psycholo,andrew88,o4izdmxu,sanctuar,newhome,milion,suckmydi,rjvgm.nth,warior,goodgame,1qwertyuiop,6339cndh,scorpio2,macker,southbay,crabcake,toadie,paperclip,fatkid,maddo,cliff1,rastafar,maries,twins1,geujdrf,anjela,wc4fun,dolina,mpetroff,rollout,zydeco,shadow3,pumpki,steeda,volvo240,terras,blowjo,blue2000,incognit,badmojo,gambit1,zhukov,station1,aaronb,graci,duke123,clipper1,qazxsw2,ledzeppe,kukareku,sexkitte,cinco,007008,lakers12,a1234b,acmilan1,afhfjy,starrr,slutty3,phoneman,kostyan,bonzo1,sintesi07,ersatz,cloud1,nephilim,nascar03,rey619,kairos,123456789e,hardon1,boeing1,juliya,hfccdtn,vgfun8,polizei,456838,keithb,minouche,ariston,savag,213141,clarkken,microwav,london2,santacla,campeo,qr5mx7,464811,mynuts,bombo,1mickey,lucky8,danger1,ironside,carter12,wyatt1,borntorun,iloveyou123,jose1,pancake1,tadmichaels,monsta,jugger,hunnie,triste,heat7777,ilovejesus,queeny,luckycharm,lieben,gordolee85,jtkirk,forever21,jetlag,skylane,taucher,neworlea,holera,000005,anhnhoem,melissa7,mumdad,massimiliano,dima1994,nigel1,madison3,slicky,shokolad,serenit,jmh1978,soccer123,chris3,drwho,rfpzdrf,1qasw23ed,free4me,wonka,sasquatc,sanan,maytag,verochka,bankone,molly12,monopoli,xfqybr,lamborgini,gondolin,candycane,needsome,jb007,scottie1,brigit,0147258369,kalamazo,lololyo123,bill1234,ilovejes,lol123123,popkorn,april13,567rntvm,downunde,charle1,angelbab,guildwars,homeworld,qazxcvbnm,superma1,dupa123,kryptoni,happyy,artyom,stormie,cool11,calvin69,saphir,konovalov,jansport,october8,liebling,druuna,susans,megans,tujhjdf,wmegrfux,jumbo1,ljb4dt7n,012345678910,kolesnik,speculum,at4gftlw,kurgan,93pn75,cahek0980,dallas01,godswill,fhifdby,chelsea4,jump23,barsoom,catinhat,urlacher,angel99,vidadi1,678910,lickme69,topaz1,westend,loveone,c12345,gold12,alex1959,mamon,barney12,1maggie,alex12345,lp2568cskt,s1234567,gjikbdctyf,anthony0,browns99,chips1,sunking,widespre,lalala1,tdutif,fucklife,master00,alino4ka,stakan,blonde1,phoebus,tenore,bvgthbz,brunos,suzjv8,uvdwgt,revenant,1banana,veroniqu,sexfun,sp1der,4g3izhox,isakov,shiva1,scooba,bluefire,wizard12,dimitris,funbags,perseus,hoodoo,keving,malboro,157953,a32tv8ls,latics,animate,mossad,yejntb,karting,qmpq39zr,busdrive,jtuac3my,jkne9y,sr20dett,4gxrzemq,keylargo,741147,rfktylfhm,toast1,skins1,xcalibur,gattone,seether,kameron,glock9mm,julio1,delenn,gameday,tommyd,str8edge,bulls123,66699,carlsberg,woodbird,adnama,45auto,codyman,truck2,1w2w3w4w,pvjegu,method1,luetdi,41d8cd98f00b,bankai,5432112345,94rwpe,reneee,chrisx,melvins,775577,sam2000,scrappy1,rachid,grizzley,margare,morgan01,winstons,gevorg,gonzal,crawdad,gfhfdjp,babilon,noneya,pussy11,barbell,easyride,c00li0,777771,311music,karla1,golions,19866891,peejay,leadfoot,hfvbkm,kr9z40sy,cobra123,isotwe,grizz,sallys,****you,aaa123a,dembel,foxs14,hillcres,webman,mudshark,alfredo1,weeded,lester1,hovepark,ratface,000777fffa,huskie,wildthing,elbarto,waikiki,masami,call911,goose2,regin,dovajb,agricola,cjytxrj,andy11,penny123,family01,a121212,1braves,upupa68,happy100,824655,cjlove,firsttim,kalel,redhair,dfhtymt,sliders,bananna,loverbo,fifa2008,crouton,chevy350,panties2,kolya1,alyona,hagrid,spagetti,q2w3e4r,867530,narkoman,nhfdvfnjkju123,1ccccccc,napolean,0072563,allay,w8sted,wigwam,jamesk,state1,parovoz,beach69,kevinb,rossella,logitech1,celula,gnocca,canucks1,loginova,marlboro1,aaaa1,kalleanka,mester,mishutka,milenko,alibek,jersey1,peterc,1mouse,nedved,blackone,ghfplybr,682regkh,beejay,newburgh,ruffian,clarets,noreaga,xenophon,hummerh2,tenshi,smeagol,soloyo,vfhnby,ereiamjh,ewq321,goomie,sportin,cellphone,sonnie,jetblack,saudan,gblfhfc,matheus,uhfvjnf,alicja,jayman1,devon1,hexagon,bailey2,vtufajy,yankees7,salty1,908070,killemal,gammas,eurocard,sydney12,tuesday1,antietam,wayfarer,beast666,19952009sa,aq12ws,eveli,hockey21,haloreach,dontcare,xxxx1,andrea11,karlmarx,jelszo,tylerb,protools,timberwolf,ruffneck,pololo,1bbbbb,waleed,sasami,twinss,fairlady,illuminati,alex007,sucks1,homerjay,scooter7,tarbaby,barmaley,amistad,vanes,randers,tigers12,dreamer2,goleafsg,googie,bernie1,as12345,godeep,james3,phanto,gwbush,cumlover,2196dc,studioworks,995511,golf56,titova,kaleka,itali,socks1,kurwamac,daisuke,hevonen,woody123,daisie,wouter,henry123,gostosa,guppie,porpoise,iamsexy,276115,paula123,1020315,38gjgeuftd,rjrfrjkf,knotty,idiot1,sasha12345,matrix13,securit,radical1,ag764ks,jsmith,coolguy1,secretar,juanas,sasha1988,itout,00000001,tiger11,1butthea,putain,cavalo,basia1,kobebryant,1232323,12345asdfg,sunsh1ne,cyfqgth,tomkat,dorota,dashit,pelmen,5t6y7u,whipit,smokeone,helloall,bonjour1,snowshoe,nilknarf,x1x2x3,lammas,1234599,lol123456,atombomb,ironchef,noclue,alekseev,gwbush1,silver2,12345678m,yesican,fahjlbnf,chapstic,alex95,open1,tiger200,lisichka,pogiako,cbr929,searchin,tanya123,alex1973,phil413,alex1991,dominati,geckos,freddi,silenthill,egroeg,vorobey,antoxa,dark666,shkola,apple22,rebellio,shamanking,7f8srt,cumsucker,partagas,bill99,22223333,arnster55,fucknuts,proxima,silversi,goblues,parcells,vfrcbvjdf,piloto,avocet,emily2,1597530,miniskir,himitsu,pepper2,juiceman,venom1,bogdana,jujube,quatro,botafogo,mama2010,junior12,derrickh,asdfrewq,miller2,chitarra,silverfox,napol,prestigio,devil123,mm111qm,ara123,max33484,sex2000,primo1,sephan,anyuta,alena2010,viborg,verysexy,hibiscus,terps,josefin,oxcart,spooker,speciali,raffaello,partyon,vfhvtkflrf,strela,a123456z,worksuck,glasss,lomonosov,dusty123,dukeblue,1winter,sergeeva,lala123,john22,cmc09,sobolev,bettylou,dannyb,gjkrjdybr,hagakure,iecnhbr,awsedr,pmdmsctsk,costco,alekseeva,fktrcttd,bazuka,flyingv,garuda,buffy16,gutierre,beer12,stomatolog,ernies,palmeiras,golf123,love269,n.kmgfy,gjkysqgbpltw,youare,joeboo,baksik,lifeguar,111a111,nascar8,mindgame,dude1,neopets,frdfkfyu,june24,phoenix8,penelopa,merlin99,mercenar,badluck,mishel,bookert,deadsexy,power9,chinchil,1234567m,alex10,skunk1,rfhkcjy,sammycat,wright1,randy2,marakesh,temppassword,elmer251,mooki,patrick0,bonoedge,1tits,chiar,kylie1,graffix,milkman1,cornel,mrkitty,nicole12,ticketmaster,beatles4,number20,ffff1,terps1,superfre,yfdbufnjh,jake1234,flblfc,1111qq,zanuda,jmol01,wpoolejr,polopol,nicolett,omega13,cannonba,123456789.,sandy69,ribeye,bo243ns,marilena,bogdan123,milla,redskins1,19733791,alias1,movie1,ducat,marzena,shadowru,56565,coolman1,pornlover,teepee,spiff,nafanya,gateway3,fuckyou0,hasher,34778,booboo69,staticx,hang10,qq12345,garnier,bosco123,1234567qw,carson1,samso,1xrg4kcq,cbr929rr,allan123,motorbik,andrew22,pussy101,miroslava,cytujdbr,camp0017,cobweb,snusmumrik,salmon1,cindy2,aliya,serendipity,co437at,tincouch,timmy123,hunter22,st1100,vvvvvv1,blanka,krondor,sweeti,nenit,kuzmich,gustavo1,bmw320i,alex2010,trees1,kyliem,essayons,april26,kumari,sprin,fajita,appletre,fghbjhb,1green,katieb,steven2,corrado1,satelite,1michell,123456789c,cfkfvfylhf,acurarsx,slut543,inhere,bob2000,pouncer,k123456789,fishie,aliso,audia8,bluetick,soccer69,jordan99,fromhell,mammoth1,fighting54,mike25,pepper11,extra1,worldwid,chaise,vfr800,sordfish,almat,nofate,listopad,hellgate,dctvghbdf,jeremia,qantas,lokiju,honker,sprint1,maral,triniti,compaq3,sixsix6,married1,loveman,juggalo1,repvtyrj,zxcasdqw,123445,whore1,123678,monkey6,west123,warcraf,pwnage,mystery1,creamyou,ant123,rehjgfnrf,corona1,coleman1,steve121,alderaan,barnaul,celeste1,junebug1,bombshel,gretzky9,tankist,targa,cachou,vaz2101,playgolf,boneyard,strateg,romawka,iforgotit,pullup,garbage1,irock,archmage,shaft1,oceano,sadies,alvin1,135135ab,psalm69,lmfao,ranger02,zaharova,33334444,perkman,realman,salguod,cmoney,astonmartin,glock1,greyfox,viper99,helpm,blackdick,46775575,family5,shazbot,dewey1,qwertyas,shivani,black22,mailman1,greenday1,57392632,red007,stanky,sanchez1,tysons,daruma,altosax,krayzie,85852008,1forever,98798798,irock.,123456654,142536789,ford22,brick1,michela,preciou,crazy4u,01telemike01,nolife,concac,safety1,annie123,brunswic,destini,123456qwer,madison0,snowball1,137946,1133557799,jarule,scout2,songohan,thedead,00009999,murphy01,spycam,hirsute,aurinko,associat,1miller,baklan,hermes1,2183rm,martie,kangoo,shweta,yvonne1,westsid,jackpot1,rotciv,maratik,fabrika,claude1,nursultan,noentry,ytnhjufnm,electra1,ghjcnjnfr1,puneet,smokey01,integrit,bugeye,trouble2,14071789,paul01,omgwtf,dmh415,ekilpool,yourmom1,moimeme,sparky11,boludo,ruslan123,kissme1,demetrio,appelsin,asshole3,raiders2,bunns,fynjybj,billygoa,p030710p$e4o,macdonal,248ujnfk,acorns,schmidt1,sparrow1,vinbylrj,weasle,jerom,ycwvrxxh,skywalk,gerlinde,solidus,postal1,poochie1,1charles,rhianna,terorist,rehnrf,omgwtfbbq,assfucke,deadend,zidan,jimboy,vengence,maroon5,7452tr,dalejr88,sombra,anatole,elodi,amazonas,147789,q12345q,gawker1,juanma,kassidy,greek1,bruces,bilbob,mike44,0o9i8u7y6t,kaligula,agentx,familie,anders1,pimpjuice,0128um,birthday10,lawncare,hownow,grandorgue,juggerna,scarfac,kensai,swatteam,123four,motorbike,repytxbr,other1,celicagt,pleomax,gen0303,godisgreat,icepick,lucifer666,heavy1,tea4two,forsure,02020,shortdog,webhead,chris13,palenque,3techsrl,knights1,orenburg,prong,nomarg,wutang1,80637852730,laika,iamfree,12345670,pillow1,12343412,bigears,peterg,stunna,rocky5,12123434,damir,feuerwehr,7418529630,danone,yanina,valenci,andy69,111222q,silvia1,1jjjjj,loveforever,passwo1,stratocaster,8928190a,motorolla,lateralu,ujujkm,chubba,ujkjdf,signon,123456789zx,serdce,stevo,wifey200,ololo123,popeye1,1pass,central1,melena,luxor,nemezida,poker123,ilovemusic,qaz1234,noodles1,lakeshow,amarill,ginseng,billiam,trento,321cba,fatback,soccer33,master13,marie2,newcar,bigtop,dark1,camron,nosgoth,155555,biglou,redbud,jordan7,159789,diversio,actros,dazed,drizzit,hjcnjd,wiktoria,justic,gooses,luzifer,darren1,chynna,tanuki,11335577,icculus,boobss,biggi,firstson,ceisi123,gatewa,hrothgar,jarhead1,happyjoy,felipe1,bebop1,medman,athena1,boneman,keiths,djljgfl,dicklick,russ120,mylady,zxcdsa,rock12,bluesea,kayaks,provista,luckies,smile4me,bootycal,enduro,123123f,heartbre,ern3sto,apple13,bigpappa,fy.njxrf,bigtom,cool69,perrito,quiet1,puszek,cious,cruella,temp1,david26,alemap,aa123123,teddies,tricolor,smokey12,kikiriki,mickey01,robert01,super5,ranman,stevenso,deliciou,money777,degauss,mozar,susanne1,asdasd12,shitbag,mommy123,wrestle1,imfree,fuckyou12,barbaris,florent,ujhijr,f8yruxoj,tefjps,anemone,toltec,2gether,left4dead2,ximen,gfkmvf,dunca,emilys,diana123,16473a,mark01,bigbro,annarbor,nikita2000,11aa11,tigres,llllll1,loser2,fbi11213,jupite,qwaszxqw,macabre,123ert,rev2000,mooooo,klapaucius,bagel1,chiquit,iyaoyas,bear101,irocz28,vfktymrfz,smokey2,love99,rfhnbyf,dracul,keith123,slicko,peacock1,orgasmic,thesnake,solder,wetass,doofer,david5,rhfcyjlfh,swanny,tammys,turkiye,tubaman,estefani,firehose,funnyguy,servo,grace17,pippa1,arbiter,jimmy69,nfymrf,asdf67nm,rjcnzy,demon123,thicknes,sexysex,kristall,michail,encarta,banderos,minty,marchenko,de1987ma,mo5kva,aircav,naomi1,bonni,tatoo,cronaldo,49ers1,mama1963,1truck,telecaster,punksnotdead,erotik,1eagles,1fender,luv269,acdeehan,tanner1,freema,1q3e5t7u,linksys,tiger6,megaman1,neophyte,australia1,mydaddy,1jeffrey,fgdfgdfg,gfgekz,1986irachka,keyman,m0b1l3,dfcz123,mikeyg,playstation2,abc125,slacker1,110491g,lordsoth,bhavani,ssecca,dctvghbdtn,niblick,hondacar,baby01,worldcom,4034407,51094didi,3657549,3630000,3578951,sweetpussy,majick,supercoo,robert11,abacabb,panda123,gfhjkm13,ford4x4,zippo1,lapin,1726354,lovesong,dude11,moebius,paravoz,1357642,matkhau,solnyshko,daniel4,multiplelog,starik,martusia,iamtheman,greentre,jetblue,motorrad,vfrcbvev,redoak,dogma1,gnorman,komlos,tonka1,1010220,666satan,losenord,lateralus,absinthe,command1,jigga1,iiiiiii1,pants1,jungfrau,926337,ufhhbgjnnth,yamakasi,888555,sunny7,gemini69,alone1,zxcvbnmz,cabezon,skyblues,zxc1234,456123a,zero00,caseih,azzurra,legolas1,menudo,murcielago,785612,779977,benidorm,viperman,dima1985,piglet1,hemligt,hotfeet,7elephants,hardup,gamess,a000000,267ksyjf,kaitlynn,sharkie,sisyphus,yellow22,667766,redvette,666420,mets69,ac2zxdty,hxxrvwcy,cdavis,alan1,noddy,579300,druss,eatshit1,555123,appleseed,simpleplan,kazak,526282,fynfyfyfhbde,birthday6,dragon6,1pookie,bluedevils,omg123,hj8z6e,x5dxwp,455445,batman23,termin,chrisbrown,animals1,lucky9,443322,kzktxrf,takayuki,fermer,assembler,zomu9q,sissyboy,sergant,felina,nokia6230i,eminem12,croco,hunt4red,festina,darknigh,cptnz062,ndshnx4s,twizzler,wnmaz7sd,aamaax,gfhfcjkmrf,alabama123,barrynov,happy5,punt0it,durandal,8xuuobe4,cmu9ggzh,bruno12,316497,crazyfrog,vfvfktyf,apple3,kasey1,mackdaddy,anthon1,sunnys,angel3,cribbage,moon1,donal,bryce1,pandabear,mwss474,whitesta,freaker,197100,bitche,p2ssw0rd,turnb,tiktonik,moonlite,ferret1,jackas,ferrum,bearclaw,liberty2,1diablo,caribe,snakeeyes,janbam,azonic,rainmaker,vetalik,bigeasy,baby1234,sureno13,blink1,kluivert,calbears,lavanda,198600,dhtlbyf,medvedeva,fox123,whirling,bonscott,freedom9,october3,manoman,segredo,cerulean,robinso,bsmith,flatus,dannon,password21,rrrrrr1,callista,romai,rainman1,trantor,mickeymo,bulldog7,g123456,pavlin,pass22,snowie,hookah,7ofnine,bubba22,cabible,nicerack,moomoo1,summer98,yoyo123,milan1,lieve27,mustang69,jackster,exocet,nadege,qaz12,bahama,watson1,libras,eclipse2,bahram,bapezm,up9x8rww,ghjcnjz,themaste,deflep27,ghost16,gattaca,fotograf,junior123,gilber,gbjyth,8vjzus,rosco1,begonia,aldebara,flower12,novastar,buzzman,manchild,lopez1,mama11,william7,yfcnz1,blackstar,spurs123,moom4242,1amber,iownyou,tightend,07931505,paquito,1johnson,smokepot,pi31415,snowmass,ayacdc,jessicam,giuliana,5tgbnhy6,harlee,giuli,bigwig,tentacle,scoubidou2,benelli,vasilina,nimda,284655,jaihind,lero4ka,1tommy,reggi,ididit,jlbyjxtcndj,mike26,qbert,wweraw,lukasz,loosee123,palantir,flint1,mapper,baldie,saturne,virgin1,meeeee,elkcit,iloveme2,blue15,themoon,radmir,number3,shyanne,missle,hannelor,jasmina,karin1,lewie622,ghjcnjqgfhjkm,blasters,oiseau,sheela,grinders,panget,rapido,positiv,twink,fltkbyf,kzsfj874,daniel01,enjoyit,nofags,doodad,rustler,squealer,fortunat,peace123,khushi,devils2,7inches,candlebo,topdawg,armen,soundman,zxcqweasd,april7,gazeta,netman,hoppers,bear99,ghbjhbntn,mantle7,bigbo,harpo,jgordon,bullshi,vinny1,krishn,star22,thunderc,galinka,phish123,tintable,nightcrawler,tigerboy,rbhgbx,messi,basilisk,masha1998,nina123,yomamma,kayla123,geemoney,0000000000d,motoman,a3jtni,ser123,owen10,italien,vintelok,12345rewq,nightime,jeepin,ch1tt1ck,mxyzptlk,bandido,ohboy,doctorj,hussar,superted,parfilev,grundle,1jack,livestrong,chrisj,matthew3,access22,moikka,fatone,miguelit,trivium,glenn1,smooches,heiko,dezember,spaghett,stason,molokai,bossdog,guitarma,waderh,boriska,photosho,path13,hfrtnf,audre,junior24,monkey24,silke,vaz21093,bigblue1,trident1,candide,arcanum,klinker,orange99,bengals1,rosebu,mjujuj,nallepuh,mtwapa1a,ranger69,level1,bissjop,leica,1tiffany,rutabega,elvis77,kellie1,sameas,barada,karabas,frank12,queenb,toutoune,surfcity,samanth1,monitor1,littledo,kazakova,fodase,mistral1,april22,carlit,shakal,batman123,fuckoff2,alpha01,5544332211,buddy3,towtruck,kenwood1,vfiekmrf,jkl123,pypsik,ranger75,sitges,toyman,bartek1,ladygirl,booman,boeing77,installsqlst,222666,gosling,bigmack,223311,bogos,kevin2,gomez1,xohzi3g4,kfnju842,klubnika,cubalibr,123456789101,kenpo,0147852369,raptor1,tallulah,boobys,jjones,1q2s3c,moogie,vid2600,almas,wombat1,extra300,xfiles1,green77,sexsex1,heyjude,sammyy,missy123,maiyeuem,nccpl25282,thicluv,sissie,raven3,fldjrfn,buster22,broncos2,laurab,letmein4,harrydog,solovey,fishlips,asdf4321,ford123,superjet,norwegen,movieman,psw333333,intoit,postbank,deepwate,ola123,geolog323,murphys,eshort,a3eilm2s2y,kimota,belous,saurus,123321qaz,i81b4u,aaa12,monkey20,buckwild,byabybnb,mapleleafs,yfcnzyfcnz,baby69,summer03,twista,246890,246824,ltcnhjth,z1z2z3,monika1,sad123,uto29321,bathory,villan,funkey,poptarts,spam967888,705499fh,sebast,porn1234,earn381,1porsche,whatthef,123456789y,polo12,brillo,soreilly,waters1,eudora,allochka,is_a_bot,winter00,bassplay,531879fiz,onemore,bjarne,red911,kot123,artur1,qazxdr,c0rvette,diamond7,matematica,klesko,beaver12,2enter,seashell,panam,chaching,edward2,browni,xenogear,cornfed,aniram,chicco22,darwin1,ancella2,sophie2,vika1998,anneli,shawn41,babie,resolute,pandora2,william8,twoone,coors1,jesusis1,teh012,cheerlea,renfield,tessa1,anna1986,madness1,bkmlfh,19719870,liebherr,ck6znp42,gary123,123654z,alsscan,eyedoc,matrix7,metalgea,chinito,4iter,falcon11,7jokx7b9du,bigfeet,tassadar,retnuh,muscle1,klimova,darion,batistuta,bigsur,1herbier,noonie,ghjrehjh,karimova,faustus,snowwhite,1manager,dasboot,michael12,analfuck,inbed,dwdrums,jaysoncj,maranell,bsheep75,164379,rolodex,166666,rrrrrrr1,almaz666,167943,russel1,negrito,alianz,goodpussy,veronik,1w2q3r4e,efremov,emb377,sdpass,william6,alanfahy,nastya1995,panther5,automag,123qwe12,vfvf2011,fishe,1peanut,speedie,qazwsx1234,pass999,171204j,ketamine,sheena1,energizer,usethis1,123abc123,buster21,thechamp,flvbhfk,frank69,chane,hopeful1,claybird,pander,anusha,bigmaxxx,faktor,housebed,dimidrol,bigball,shashi,derby1,fredy,dervish,bootycall,80988218126,killerb,cheese2,pariss,mymail,dell123,catbert,christa1,chevytru,gjgjdf,00998877,overdriv,ratten,golf01,nyyanks,dinamite,bloembol,gismo,magnus1,march2,twinkles,ryan22,duckey,118a105b,kitcat,brielle,poussin,lanzarot,youngone,ssvegeta,hero63,battle1,kiler,fktrcfylh1,newera,vika1996,dynomite,oooppp,beer4me,foodie,ljhjuf,sonshine,godess,doug1,constanc,thinkbig,steve2,damnyou,autogod,www333,kyle1,ranger7,roller1,harry2,dustin1,hopalong,tkachuk,b00bies,bill2,deep111,stuffit,fire69,redfish1,andrei123,graphix,1fishing,kimbo1,mlesp31,ifufkbyf,gurkan,44556,emily123,busman,and123,8546404,paladine,1world,bulgakov,4294967296,bball23,1wwwww,mycats,elain,delta6,36363,emilyb,color1,6060842,cdtnkfyrf,hedonism,gfgfrfhkj,5551298,scubad,gostate,sillyme,hdbiker,beardown,fishers,sektor,00000007,newbaby,rapid1,braves95,gator2,nigge,anthony3,sammmy,oou812,heffer,phishin,roxanne1,yourass,hornet1,albator,2521659,underwat,tanusha,dianas,3f3fpht7op,dragon20,bilbobag,cheroke,radiatio,dwarf1,majik,33st33,dochka,garibald,robinh,sham69,temp01,wakeboar,violet1,1w2w3w,registr,tonite,maranello,1593570,parolamea,galatasara,loranthos,1472583,asmodean,1362840,scylla,doneit,jokerr,porkypig,kungen,mercator,koolhaas,come2me,debbie69,calbear,liverpoolfc,yankees4,12344321a,kennyb,madma,85200258,dustin23,thomas13,tooling,mikasa,mistic,crfnbyf,112233445,sofia1,heinz57,colts1,price1,snowey,joakim,mark11,963147,cnhfcnm,kzinti,1bbbbbbb,rubberdu,donthate,rupert1,sasha1992,regis1,nbuhbwf,fanboy,sundial,sooner1,wayout,vjnjhjkf,deskpro,arkangel,willie12,mikeyb,celtic1888,luis1,buddy01,duane1,grandma1,aolcom,weeman,172839456,basshead,hornball,magnu,pagedown,molly2,131517,rfvtgbyhn,astonmar,mistery,madalina,cash1,1happy,shenlong,matrix01,nazarova,369874125,800500,webguy,rse2540,ashley2,briank,789551,786110,chunli,j0nathan,greshnik,courtne,suckmyco,mjollnir,789632147,asdfg1234,754321,odelay,ranma12,zebedee,artem777,bmw318is,butt1,rambler1,yankees9,alabam,5w76rnqp,rosies,mafioso,studio1,babyruth,tranzit,magical123,gfhjkm135,12345$,soboleva,709394,ubique,drizzt1,elmers,teamster,pokemons,1472583690,1597532486,shockers,merckx,melanie2,ttocs,clarisse,earth1,dennys,slobber,flagman,farfalla,troika,4fa82hyx,hakan,x4ww5qdr,cumsuck,leather1,forum1,july20,barbel,zodiak,samuel12,ford01,rushfan,bugsy1,invest1,tumadre,screwme,a666666,money5,henry8,tiddles,sailaway,starburs,100years,killer01,comando,hiromi,ranetka,thordog,blackhole,palmeira,verboten,solidsna,q1w1e1,humme,kevinc,gbrfxe,gevaudan,hannah11,peter2,vangar,sharky7,talktome,jesse123,chuchi,pammy,!qazxsw2,siesta,twenty1,wetwilly,477041,natural1,sun123,daniel3,intersta,shithead1,hellyea,bonethugs,solitair,bubbles2,father1,nick01,444000,adidas12,dripik,cameron2,442200,a7nz8546,respublika,fkojn6gb,428054,snoppy,rulez1,haslo,rachael1,purple01,zldej102,ab12cd34,cytuehjxrf,madhu,astroman,preteen,handsoff,mrblonde,biggio,testin,vfdhif,twolves,unclesam,asmara,kpydskcw,lg2wmgvr,grolsch,biarritz,feather1,williamm,s62i93,bone1,penske,337733,336633,taurus1,334433,billet,diamondd,333000,nukem,fishhook,godogs,thehun,lena1982,blue00,smelly1,unb4g9ty,65pjv22,applegat,mikehunt,giancarlo,krillin,felix123,december1,soapy,46doris,nicole23,bigsexy1,justin10,pingu,bambou,falcon12,dgthtl,1surfer,qwerty01,estrellit,nfqcjy,easygo,konica,qazqwe,1234567890m,stingers,nonrev,3e4r5t,champio,bbbbbb99,196400,allen123,seppel,simba2,rockme,zebra3,tekken3,endgame,sandy2,197300,fitte,monkey00,eldritch,littleone,rfyfgkz,1member,66chevy,oohrah,cormac,hpmrbm41,197600,grayfox,elvis69,celebrit,maxwell7,rodders,krist,1camaro,broken1,kendall1,silkcut,katenka,angrick,maruni,17071994a,tktyf,kruemel,snuffles,iro4ka,baby12,alexis01,marryme,vlad1994,forward1,culero,badaboom,malvin,hardtoon,hatelove,molley,knopo4ka,duchess1,mensuck,cba321,kickbutt,zastava,wayner,fuckyou6,eddie123,cjkysir,john33,dragonfi,cody1,jabell,cjhjrf,badseed,sweden1,marihuana,brownlov,elland,nike1234,kwiettie,jonnyboy,togepi,billyk,robert123,bb334,florenci,ssgoku,198910,bristol1,bob007,allister,yjdujhjl,gauloise,198920,bellaboo,9lives,aguilas,wltfg4ta,foxyroxy,rocket69,fifty50,babalu,master21,malinois,kaluga,gogosox,obsessio,yeahrigh,panthers1,capstan,liza2000,leigh1,paintball1,blueskie,cbr600f3,bagdad,jose98,mandreki,shark01,wonderbo,muledeer,xsvnd4b2,hangten,200001,grenden,anaell,apa195,model1,245lufpq,zip100,ghjcgtrn,wert1234,misty2,charro,juanjose,fkbcrf,frostbit,badminto,buddyy,1doctor,vanya,archibal,parviz,spunky1,footboy,dm6tzsgp,legola,samadhi,poopee,ytdxz2ca,hallowboy,dposton,gautie,theworm,guilherme,dopehead,iluvtits,bobbob1,ranger6,worldwar,lowkey,chewbaca,oooooo99,ducttape,dedalus,celular,8i9o0p,borisenko,taylor01,111111z,arlingto,p3nnywiz,rdgpl3ds,boobless,kcmfwesg,blacksab,mother2,markus1,leachim,secret2,s123456789,1derful,espero,russell2,tazzer,marykate,freakme,mollyb,lindros8,james00,gofaster,stokrotka,kilbosik,aquamann,pawel1,shedevil,mousie,slot2009,october6,146969,mm259up,brewcrew,choucho,uliana,sexfiend,fktirf,pantss,vladimi,starz,sheeps,12341234q,bigun,tiggers,crjhjcnm,libtech,pudge1,home12,zircon,klaus1,jerry2,pink1,lingus,monkey66,dumass,polopolo09,feuerweh,rjyatnf,chessy,beefer,shamen,poohbear1,4jjcho,bennevis,fatgirls,ujnbrf,cdexswzaq,9noize9,rich123,nomoney,racecar1,hacke,clahay,acuario,getsum,hondacrv,william0,cheyenn,techdeck,atljhjdf,wtcacq,suger,fallenangel,bammer,tranquil,carla123,relayer,lespaul1,portvale,idontno,bycnbnen,trooper2,gennadiy,pompon,billbob,amazonka,akitas,chinatow,atkbrc,busters,fitness1,cateye,selfok2013,1murphy,fullhous,mucker,bajskorv,nectarin,littlebitch,love24,feyenoor,bigal37,lambo1,pussybitch,icecube1,biged,kyocera,ltybcjdf,boodle,theking1,gotrice,sunset1,abm1224,fromme,sexsells,inheat,kenya1,swinger1,aphrodit,kurtcobain,rhind101,poidog,poiulkjh,kuzmina,beantown,tony88,stuttgar,drumer,joaqui,messenge,motorman,amber2,nicegirl,rachel69,andreia,faith123,studmuffin,jaiden,red111,vtkmybr,gamecocks,gumper,bosshogg,4me2know,tokyo1,kleaner,roadhog,fuckmeno,phoenix3,seeme,buttnutt,boner69,andreyka,myheart,katerin,rugburn,jvtuepip,dc3ubn,chile1,ashley69,happy99,swissair,balls2,fylhttdf,jimboo,55555d,mickey11,voronin,m7hsqstm,stufff,merete,weihnachte,dowjones,baloo1,freeones,bears34,auburn1,beverl,timberland,1elvis,guinness1,bombadil,flatron1,logging7,telefoon,merl1n,masha1,andrei1,cowabung,yousuck1,1matrix,peopl,asd123qwe,sweett,mirror1,torrente,joker12,diamond6,jackaroo,00000a,millerlite,ironhorse,2twins,stryke,gggg1,zzzxxxccc,roosevel,8363eddy,angel21,depeche1,d0ct0r,blue14,areyou,veloce,grendal,frederiksberg,cbcntvf,cb207sl,sasha2000,was.here,fritzz,rosedale,spinoza,cokeisit,gandalf3,skidmark,ashley01,12345j,1234567890qaz,sexxxxxx,beagles,lennart,12345789,pass10,politic,max007,gcheckou,12345611,tiffy,lightman,mushin,velosiped,brucewayne,gauthie,elena123,greenegg,h2oski,clocker,nitemare,123321s,megiddo,cassidy1,david13,boywonde,flori,peggy12,pgszt6md,batterie,redlands,scooter6,bckhere,trueno,bailey11,maxwell2,bandana,timoth1,startnow,ducati74,tiern,maxine1,blackmetal,suzyq,balla007,phatfarm,kirsten1,titmouse,benhogan,culito,forbin,chess1,warren1,panman,mickey7,24lover,dascha,speed2,redlion,andrew10,johnwayn,nike23,chacha1,bendog,bullyboy,goldtree,spookie,tigger99,1cookie,poutine,cyclone1,woodpony,camaleun,bluesky1,dfadan,eagles20,lovergirl,peepshow,mine1,dima1989,rjdfkmxer,11111aaaaa,machina,august17,1hhhhh,0773417k,1monster,freaksho,jazzmin,davidw,kurupt,chumly,huggies,sashenka,ccccccc1,bridge1,giggalo,cincinna,pistol1,hello22,david77,lightfoo,lucky6,jimmy12,261397,lisa12,tabaluga,mysite,belo4ka,greenn,eagle99,punkrawk,salvado,slick123,wichsen,knight99,dummys,fefolico,contrera,kalle1,anna1984,delray,robert99,garena,pretende,racefan,alons,serenada,ludmilla,cnhtkjr,l0swf9gx,hankster,dfktynbyrf,sheep1,john23,cv141ab,kalyani,944turbo,crystal2,blackfly,zrjdktdf,eus1sue1,mario5,riverplate,harddriv,melissa3,elliott1,sexybitc,cnhfyybr,jimdavis,bollix,beta1,amberlee,skywalk1,natala,1blood,brattax,shitty1,gb15kv99,ronjon,rothmans,thedoc,joey21,hotboi,firedawg,bimbo38,jibber,aftermat,nomar,01478963,phishing,domodo,anna13,materia,martha1,budman1,gunblade,exclusiv,sasha1997,anastas,rebecca2,fackyou,kallisti,fuckmyass,norseman,ipswich1,151500,1edward,intelinside,darcy1,bcrich,yjdjcnbf,failte,buzzzz,cream1,tatiana1,7eleven,green8,153351,1a2s3d4f5g6h,154263,milano1,bambi1,bruins77,rugby2,jamal1,bolita,sundaypunch,bubba12,realmadr,vfyxtcnth,iwojima,notlob,black666,valkiria,nexus1,millerti,birthday100,swiss1,appollo,gefest,greeneyes,celebrat,tigerr,slava123,izumrud,bubbabub,legoman,joesmith,katya123,sweetdream,john44,wwwwwww1,oooooo1,socal,lovespor,s5r8ed67s,258147,heidis,cowboy22,wachovia,michaelb,qwe1234567,i12345,255225,goldie1,alfa155,45colt,safeu851,antonova,longtong,1sparky,gfvznm,busen,hjlbjy,whateva,rocky4,cokeman,joshua3,kekskek1,sirocco,jagman,123456qwert,phinupi,thomas10,loller,sakur,vika2011,fullred,mariska,azucar,ncstate,glenn74,halima,aleshka,ilovemylife,verlaat,baggie,scoubidou6,phatboy,jbruton,scoop1,barney11,blindman,def456,maximus2,master55,nestea,11223355,diego123,sexpistols,sniffy,philip1,f12345,prisonbreak,nokia2700,ajnjuhfa,yankees3,colfax,ak470000,mtnman,bdfyeirf,fotball,ichbin,trebla,ilusha,riobravo,beaner1,thoradin,polkaudi,kurosawa,honda123,ladybu,valerik,poltava,saviola,fuckyouguys,754740g0,anallove,microlab1,juris01,ncc1864,garfild,shania1,qagsud,makarenko,cindy69,lebedev,andrew11,johnnybo,groovy1,booster1,sanders1,tommyb,johnson4,kd189nlcih,hondaman,vlasova,chick1,sokada,sevisgur,bear2327,chacho,sexmania,roma1993,hjcnbckfd,valley1,howdie,tuppence,jimandanne,strike3,y4kuz4,nhfnfnf,tsubasa,19955991,scabby,quincunx,dima1998,uuuuuu1,logica,skinner1,pinguino,lisa1234,xpressmusic,getfucked,qqqq1,bbbb1,matulino,ulyana,upsman,johnsmith,123579,co2000,spanner1,todiefor,mangoes,isabel1,123852,negra,snowdon,nikki123,bronx1,booom,ram2500,chuck123,fireboy,creek1,batman13,princesse,az12345,maksat,1knight,28infern,241455,r7112s,muselman,mets1986,katydid,vlad777,playme,kmfdm1,asssex,1prince,iop890,bigbroth,mollymoo,waitron,lizottes,125412,juggler,quinta,0sister0,zanardi,nata123,heckfyxbr,22q04w90e,engine2,nikita95,zamira,hammer22,lutscher,carolina1,zz6319,sanman,vfuflfy,buster99,rossco,kourniko,aggarwal,tattoo1,janice1,finger1,125521,19911992,shdwlnds,rudenko,vfvfgfgf123,galatea,monkeybu,juhani,premiumcash,classact,devilmay,helpme2,knuddel,hardpack,ramil,perrit,basil1,zombie13,stockcar,tos8217,honeypie,nowayman,alphadog,melon1,talula,125689,tiribon12,tornike,haribol,telefone,tiger22,sucka,lfytxrf,chicken123,muggins,a23456,b1234567,lytdybr,otter1,pippa,vasilisk,cooking1,helter,78978,bestboy,viper7,ahmed1,whitewol,mommys,apple5,shazam1,chelsea7,kumiko,masterma,rallye,bushmast,jkz123,entrar,andrew6,nathan01,alaric,tavasz,heimdall,gravy1,jimmy99,cthlwt,powerr,gthtrhtcnjr,canesfan,sasha11,ybrbnf_25,august9,brucie,artichok,arnie1,superdude,tarelka,mickey22,dooper,luners,holeshot,good123,gettysbu,bicho,hammer99,divine5,1zxcvbn,stronzo,q22222,disne,bmw750il,godhead,hallodu,aerith,nastik,differen,cestmoi,amber69,5string,pornosta,dirtygirl,ginger123,formel1,scott12,honda200,hotspurs,johnatha,firstone123,lexmark1,msconfig,karlmasc,l123456,123qweasdzx,baldman,sungod,furka,retsub,9811020,ryder1,tcglyued,astron,lbvfcbr,minddoc,dirt49,baseball12,tbear,simpl,schuey,artimus,bikman,plat1num,quantex,gotyou,hailey1,justin01,ellada,8481068,000002,manimal,dthjybxrf,buck123,dick123,6969696,nospam,strong1,kodeord,bama12,123321w,superman123,gladiolus,nintend,5792076,dreamgirl,spankme1,gautam,arianna1,titti,tetas,cool1234,belladog,importan,4206969,87e5nclizry,teufelo7,doller,yfl.irf,quaresma,3440172,melis,bradle,nnmaster,fast1,iverso,blargh,lucas12,chrisg,iamsam,123321az,tomjerry,kawika,2597174,standrew,billyg,muskan,gizmodo2,rz93qpmq,870621345,sathya,qmezrxg4,januari,marthe,moom4261,cum2me,hkger286,lou1988,suckit1,croaker,klaudia1,753951456,aidan1,fsunoles,romanenko,abbydog,isthebes,akshay,corgi,fuck666,walkman555,ranger98,scorpian,hardwareid,bluedragon,fastman,2305822q,iddqdiddqd,1597532,gopokes,zvfrfcb,w1234567,sputnik1,tr1993,pa$$w0rd,2i5fdruv,havvoc,1357913,1313131,bnm123,cowd00d,flexscan,thesims2,boogiema,bigsexxy,powerstr,ngc4565,joshman,babyboy1,123jlb,funfunfu,qwe456,honor1,puttana,bobbyj,daniel21,pussy12,shmuck,1232580,123578951,maxthedo,hithere1,bond0007,gehenna,nomames,blueone,r1234567,bwana,gatinho,1011111,torrents,cinta,123451234,tiger25,money69,edibey,pointman,mmcm19,wales1,caffreys,phaedra,bloodlus,321ret32,rufuss,tarbit,joanna1,102030405,stickboy,lotrfotr34,jamshid,mclarenf1,ataman,99ford,yarrak,logan2,ironlung,pushistik,dragoon1,unclebob,tigereye,pinokio,tylerj,mermaid1,stevie1,jaylen,888777,ramana,roman777,brandon7,17711771s,thiago,luigi1,edgar1,brucey,videogam,classi,birder,faramir,twiddle,cubalibre,grizzy,fucky,jjvwd4,august15,idinahui,ranita,nikita1998,123342,w1w2w3,78621323,4cancel,789963,(null,vassago,jaydog472,123452,timt42,canada99,123589,rebenok,htyfnf,785001,osipov,maks123,neverwinter,love2010,777222,67390436,eleanor1,bykemo,aquemini,frogg,roboto,thorny,shipmate,logcabin,66005918,nokian,gonzos,louisian,1abcdefg,triathlo,ilovemar,couger,letmeino,supera,runvs,fibonacci,muttly,58565254,5thgbqi,vfnehsv,electr,jose12,artemis1,newlove,thd1shr,hawkey,grigoryan,saisha,tosca,redder,lifesux,temple1,bunnyman,thekids,sabbeth,tarzan1,182838,158uefas,dell50,1super,666222,47ds8x,jackhamm,mineonly,rfnfhbyf,048ro,665259,kristina1,bombero,52545856,secure1,bigloser,peterk,alex2,51525354,anarchy1,superx,teenslut,money23,sigmapi,sanfrancisco,acme34,private5,eclips,qwerttrewq,axelle,kokain,hardguy,peter69,jesuschr,dyanna,dude69,sarah69,toyota91,amberr,45645645,bugmenot,bigted,44556677,556644,wwr8x9pu,alphaome,harley13,kolia123,wejrpfpu,revelati,nairda,sodoff,cityboy,pinkpussy,dkalis,miami305,wow12345,triplet,tannenbau,asdfasdf1,darkhors,527952,retired1,soxfan,nfyz123,37583867,goddes,515069,gxlmxbewym,1warrior,36925814,dmb2011,topten,karpova,89876065093rax,naturals,gateway9,cepseoun,turbot,493949,cock22,italia1,sasafras,gopnik,stalke,1qazxdr5,wm2006,ace1062,alieva,blue28,aracel,sandia,motoguzz,terri1,emmajane,conej,recoba,alex1995,jerkyboy,cowboy12,arenrone,precisio,31415927,scsa316,panzer1,studly1,powerhou,bensam,mashoutq,billee,eeyore1,reape,thebeatl,rul3z,montesa,doodle1,cvzefh1gk,424365,a159753,zimmerma,gumdrop,ashaman,grimreap,icandoit,borodina,branca,dima2009,keywest1,vaders,bubluk,diavolo,assss,goleta,eatass,napster1,382436,369741,5411pimo,lenchik,pikach,gilgamesh,kalimera,singer1,gordon2,rjycnbnewbz,maulwurf,joker13,2much4u,bond00,alice123,robotec,fuckgirl,zgjybz,redhorse,margaret1,brady1,pumpkin2,chinky,fourplay,1booger,roisin,1brandon,sandan,blackheart,cheez,blackfin,cntgfyjdf,mymoney1,09080706,goodboss,sebring1,rose1,kensingt,bigboner,marcus12,ym3cautj,struppi,thestone,lovebugs,stater,silver99,forest99,qazwsx12345,vasile,longboar,mkonji,huligan,rhfcbdfz,airmail,porn11,1ooooo,sofun,snake2,msouthwa,dougla,1iceman,shahrukh,sharona,dragon666,france98,196800,196820,ps253535,zjses9evpa,sniper01,design1,konfeta,jack99,drum66,good4you,station2,brucew,regedit,school12,mvtnr765,pub113,fantas,tiburon1,king99,ghjcnjgbpltw,checkito,308win,1ladybug,corneliu,svetasveta,197430,icicle,imaccess,ou81269,jjjdsl,brandon6,bimbo1,smokee,piccolo1,3611jcmg,children2,cookie2,conor1,darth1,margera,aoi856,paully,ou812345,sklave,eklhigcz,30624700,amazing1,wahooo,seau55,1beer,apples2,chulo,dolphin9,heather6,198206,198207,hergood,miracle1,njhyflj,4real,milka,silverfi,fabfive,spring12,ermine,mammy,jumpjet,adilbek,toscana,caustic,hotlove,sammy69,lolita1,byoung,whipme,barney01,mistys,tree1,buster3,kaylin,gfccgjhn,132333,aishiteru,pangaea,fathead1,smurph,198701,ryslan,gasto,xexeylhf,anisimov,chevyss,saskatoo,brandy12,tweaker,irish123,music2,denny1,palpatin,outlaw1,lovesuck,woman1,mrpibb,diadora,hfnfneq,poulette,harlock,mclaren1,cooper12,newpass3,bobby12,rfgecnfcerf,alskdjfh,mini14,dukers,raffael,199103,cleo123,1234567qwertyu,mossberg,scoopy,dctulf,starline,hjvjxrf,misfits1,rangers2,bilbos,blackhea,pappnase,atwork,purple2,daywalker,summoner,1jjjjjjj,swansong,chris10,laluna,12345qqq,charly1,lionsden,money99,silver33,hoghead,bdaddy,199430,saisg002,nosaints,tirpitz,1gggggg,jason13,kingss,ernest1,0cdh0v99ue,pkunzip,arowana,spiri,deskjet1,armine,lances,magic2,thetaxi,14159265,cacique,14142135,orange10,richard0,backdraf,255ooo,humtum,kohsamui,c43dae874d,wrestling1,cbhtym,sorento,megha,pepsiman,qweqwe12,bliss7,mario64,korolev,balls123,schlange,gordit,optiquest,fatdick,fish99,richy,nottoday,dianne1,armyof1,1234qwerasdfzxcv,bbonds,aekara,lidiya,baddog1,yellow5,funkie,ryan01,greentree,gcheckout,marshal1,liliput,000000z,rfhbyrf,gtogto43,rumpole,tarado,marcelit,aqwzsxedc,kenshin1,sassydog,system12,belly1,zilla,kissfan,tools1,desember,donsdad,nick11,scorpio6,poopoo1,toto99,steph123,dogfuck,rocket21,thx113,dude12,sanek,sommar,smacky,pimpsta,letmego,k1200rs,lytghjgtnhjdcr,abigale,buddog,deles,baseball9,roofus,carlsbad,hamzah,hereiam,genial,schoolgirlie,yfz450,breads,piesek,washear,chimay,apocalyp,nicole18,gfgf1234,gobulls,dnevnik,wonderwall,beer1234,1moose,beer69,maryann1,adpass,mike34,birdcage,hottuna,gigant,penquin,praveen,donna123,123lol123,thesame,fregat,adidas11,selrahc,pandoras,test3,chasmo,111222333000,pecos,daniel11,ingersol,shana1,mama12345,cessna15,myhero,1simpson,nazarenko,cognit,seattle2,irina1,azfpc310,rfycthdf,hardy1,jazmyn,sl1200,hotlanta,jason22,kumar123,sujatha,fsd9shtyu,highjump,changer,entertai,kolding,mrbig,sayuri,eagle21,qwertzu,jorge1,0101dd,bigdong,ou812a,sinatra1,htcnjhfy,oleg123,videoman,pbyfblf,tv612se,bigbird1,kenaidog,gunite,silverma,ardmore,123123qq,hotbot,cascada,cbr600f4,harakiri,chico123,boscos,aaron12,glasgow1,kmn5hc,lanfear,1light,liveoak,fizika,ybrjkftdyf,surfside,intermilan,multipas,redcard,72chevy,balata,coolio1,schroede,kanat,testerer,camion,kierra,hejmeddig,antonio2,tornados,isidor,pinkey,n8skfswa,ginny1,houndog,1bill,chris25,hastur,1marine,greatdan,french1,hatman,123qqq,z1z2z3z4,kicker1,katiedog,usopen,smith22,mrmagoo,1234512i,assa123,7seven7,monster7,june12,bpvtyf,149521,guenter,alex1985,voronina,mbkugegs,zaqwsxcderfv,rusty5,mystic1,master0,abcdef12,jndfkb,r4zpm3,cheesey,skripka,blackwhite,sharon69,dro8smwq,lektor,techman,boognish,deidara,heckfyf,quietkey,authcode,monkey4,jayboy,pinkerto,merengue,chulita,bushwick,turambar,kittykit,joseph2,dad123,kristo,pepote,scheiss,hambone1,bigballa,restaura,tequil,111luzer,euro2000,motox,denhaag,chelsi,flaco1,preeti,lillo,1001sin,passw,august24,beatoff,555555d,willis1,kissthis,qwertyz,rvgmw2gl,iloveboobies,timati,kimbo,msinfo,dewdrop,sdbaker,fcc5nky2,messiah1,catboy,small1,chode,beastie1,star77,hvidovre,short1,xavie,dagobah,alex1987,papageno,dakota2,toonami,fuerte,jesus33,lawina,souppp,dirtybir,chrish,naturist,channel1,peyote,flibble,gutentag,lactate,killem,zucchero,robinho,ditka,grumpy1,avr7000,boxxer,topcop,berry1,mypass1,beverly1,deuce1,9638527410,cthuttdf,kzkmrf,lovethem,band1t,cantona1,purple11,apples123,wonderwo,123a456,fuzzie,lucky99,dancer2,hoddling,rockcity,winner12,spooty,mansfiel,aimee1,287hf71h,rudiger,culebra,god123,agent86,daniel0,bunky1,notmine,9ball,goofus,puffy1,xyh28af4,kulikov,bankshot,vurdf5i2,kevinm,ercole,sexygirls,razvan,october7,goater,lollie,raissa,thefrog,mdmaiwa3,mascha,jesussaves,union1,anthony9,crossroa,brother2,areyuke,rodman91,toonsex,dopeman,gericom,vaz2115,cockgobbler,12356789,12345699,signatur,alexandra1,coolwhip,erwin1,awdrgyjilp,pens66,ghjrjgtyrj,linkinpark,emergenc,psych0,blood666,bootmort,wetworks,piroca,johnd,iamthe1,supermario,homer69,flameon,image1,bebert,fylhtq1,annapoli,apple11,hockey22,10048,indahouse,mykiss,1penguin,markp,misha123,foghat,march11,hank1,santorin,defcon4,tampico,vbnhjafy,robert22,bunkie,athlon64,sex777,nextdoor,koskesh,lolnoob,seemnemaailm,black23,march15,yeehaa,chiqui,teagan,siegheil,monday2,cornhusk,mamusia,chilis,sthgrtst,feldspar,scottm,pugdog,rfghjy,micmac,gtnhjdyf,terminato,1jackson,kakosja,bogomol,123321aa,rkbvtyrj,tresor,tigertig,fuckitall,vbkkbjy,caramon,zxc12,balin,dildo1,soccer09,avata,abby123,cheetah1,marquise,jennyc,hondavfr,tinti,anna1985,dennis2,jorel,mayflowe,icema,hal2000,nikkis,bigmouth,greenery,nurjan,leonov,liberty7,fafnir,larionov,sat321321,byteme1,nausicaa,hjvfynbrf,everto,zebra123,sergio1,titone,wisdom1,kahala,104328q,marcin1,salima,pcitra,1nnnnn,nalini,galvesto,neeraj,rick1,squeeky,agnes1,jitterbu,agshar,maria12,0112358,traxxas,stivone,prophet1,bananza,sommer1,canoneos,hotfun,redsox11,1bigmac,dctdjkjl,legion1,everclea,valenok,black9,danny001,roxie1,1theman,mudslide,july16,lechef,chula,glamis,emilka,canbeef,ioanna,cactus1,rockshox,im2cool,ninja9,thvfrjdf,june28,milo17,missyou,micky1,nbibyf,nokiaa,goldi,mattias,fuckthem,asdzxc123,ironfist,junior01,nesta,crazzy,killswit,hygge,zantac,kazama,melvin1,allston,maandag,hiccup,prototyp,specboot,dwl610,hello6,159456,baldhead,redwhite,calpoly,whitetail,agile1,cousteau,matt01,aust1n,malcolmx,gjlfhjr,semperf1,ferarri,a1b2c3d,vangelis,mkvdari,bettis36,andzia,comand,tazzman,morgaine,pepluv,anna1990,inandout,anetka,anna1997,wallpape,moonrake,huntress,hogtie,cameron7,sammy7,singe11,clownboy,newzeala,wilmar,safrane,rebeld,poopi,granat,hammertime,nermin,11251422,xyzzy1,bogeys,jkmxbr,fktrcfyl,11223311,nfyrbcn,11223300,powerpla,zoedog,ybrbnbyf,zaphod42,tarawa,jxfhjdfirf,dude1234,g5wks9,goobe,czekolada,blackros,amaranth,medical1,thereds,julija,nhecsyfujkjdt,promopas,buddy4,marmalad,weihnachten,tronic,letici,passthief,67mustan,ds7zamnw,morri,w8woord,cheops,pinarell,sonofsam,av473dv,sf161pn,5c92v5h6,purple13,tango123,plant1,1baby,xufrgemw,fitta,1rangers,spawns,kenned,taratata,19944991,11111118,coronas,4ebouux8,roadrash,corvette1,dfyjdf846,marley12,qwaszxerdfcv,68stang,67stang,racin,ellehcim,sofiko,nicetry,seabass1,jazzman1,zaqwsx1,laz2937,uuuuuuu1,vlad123,rafale,j1234567,223366,nnnnnn1,226622,junkfood,asilas,cer980,daddymac,persepho,neelam,00700,shithappens,255555,qwertyy,xbox36,19755791,qweasd1,bearcub,jerryb,a1b1c1,polkaudio,basketball1,456rty,1loveyou,marcus2,mama1961,palace1,transcend,shuriken,sudhakar,teenlove,anabelle,matrix99,pogoda,notme,bartend,jordana,nihaoma,ataris,littlegi,ferraris,redarmy,giallo,fastdraw,accountbloc,peludo,pornostar,pinoyako,cindee,glassjaw,dameon,johnnyd,finnland,saudade,losbravo,slonko,toplay,smalltit,nicksfun,stockhol,penpal,caraj,divedeep,cannibus,poppydog,pass88,viktory,walhalla,arisia,lucozade,goldenbo,tigers11,caball,ownage123,tonna,handy1,johny,capital5,faith2,stillher,brandan,pooky1,antananarivu,hotdick,1justin,lacrimos,goathead,bobrik,cgtwbfkbcn,maywood,kamilek,gbplf123,gulnar,beanhead,vfvjyn,shash,viper69,ttttttt1,hondacr,kanako,muffer,dukies,justin123,agapov58,mushka,bad11bad,muleman,jojo123,andreika,makeit,vanill,boomers,bigals,merlin11,quacker,aurelien,spartak1922,ligeti,diana2,lawnmowe,fortune1,awesom,rockyy,anna1994,oinker,love88,eastbay,ab55484,poker0,ozzy666,papasmurf,antihero,photogra,ktm250,painkill,jegr2d2,p3orion,canman,dextur,qwest123,samboy,yomismo,sierra01,herber,vfrcbvvfrcbv,gloria1,llama1,pie123,bobbyjoe,buzzkill,skidrow,grabber,phili,javier1,9379992q,geroin,oleg1994,sovereig,rollover,zaq12qaz,battery1,killer13,alina123,groucho1,mario12,peter22,butterbean,elise1,lucycat,neo123,ferdi,golfer01,randie,gfhfyjbr,ventura1,chelsea3,pinoy,mtgox,yrrim7,shoeman,mirko,ffggyyo,65mustan,ufdibyjd,john55,suckfuck,greatgoo,fvfnjhb,mmmnnn,love20,1bullshi,sucesso,easy1234,robin123,rockets1,diamondb,wolfee,nothing0,joker777,glasnost,richar1,guille,sayan,koresh,goshawk,alexx,batman21,a123456b,hball,243122,rockandr,coolfool,isaia,mary1,yjdbrjdf,lolopc,cleocat,cimbo,lovehina,8vfhnf,passking,bonapart,diamond2,bigboys,kreator,ctvtyjdf,sassy123,shellac,table54781,nedkelly,philbert,sux2bu,nomis,sparky99,python1,littlebear,numpty,silmaril,sweeet,jamesw,cbufhtnf,peggysue,wodahs,luvsex,wizardry,venom123,love4you,bama1,samat,reviewpass,ned467,cjkjdtq,mamula,gijoe,amersham,devochka,redhill,gisel,preggo,polock,cando,rewster,greenlantern,panasonik,dave1234,mikeee,1carlos,miledi,darkness1,p0o9i8u7y6,kathryn1,happyguy,dcp500,assmaster,sambuka,sailormo,antonio3,logans,18254288,nokiax2,qwertzuiop,zavilov,totti,xenon1,edward11,targa1,something1,tony_t,q1w2e3r4t5y6u7i8o9p0,02551670,vladimir1,monkeybutt,greenda,neel21,craiger,saveliy,dei008,honda450,fylhtq95,spike2,fjnq8915,passwordstandard,vova12345,talonesi,richi,gigemags,pierre1,westin,trevoga,dorothee,bastogne,25563o,brandon3,truegrit,krimml,iamgreat,servis,a112233,paulinka,azimuth,corperfmonsy,358hkyp,homerun1,dogbert1,eatmyass,cottage1,savina,baseball7,bigtex,gimmesum,asdcxz,lennon1,a159357,1bastard,413276191q,pngfilt,pchealth,netsnip,bodiroga,1matt,webtvs,ravers,adapters,siddis,mashamasha,coffee2,myhoney,anna1982,marcia1,fairchil,maniek,iloveluc,batmonh,wildon,bowie1,netnwlnk,fancy1,tom204,olga1976,vfif123,queens1,ajax01,lovess,mockba,icam4usb,triada,odinthor,rstlne,exciter,sundog,anchorat,girls69,nfnmzyrf,soloma,gti16v,shadowman,ottom,rataros,tonchin,vishal,chicken0,pornlo,christiaan,volante,likesit,mariupol,runfast,gbpltw123,missys,villevalo,kbpjxrf,ghibli,calla,cessna172,kinglear,dell11,swift1,walera,1cricket,pussy5,turbo911,tucke,maprchem56458,rosehill,thekiwi1,ygfxbkgt,mandarinka,98xa29,magnit,cjfrf,paswoord,grandam1,shenmue,leedsuni,hatrick,zagadka,angeldog,michaell,dance123,koichi,bballs,29palms,xanth,228822,ppppppp1,1kkkkk,1lllll,mynewbots,spurss,madmax1,224455,city1,mmmmmmm1,nnnnnnn1,biedronka,thebeatles,elessar,f14tomcat,jordan18,bobo123,ayi000,tedbear,86chevyx,user123,bobolink,maktub,elmer1,flyfishi,franco1,gandalf0,traxdata,david21,enlighte,dmitrij,beckys,1giants,flippe,12345678w,jossie,rugbyman,snowcat,rapeme,peanut11,gemeni,udders,techn9ne,armani1,chappie,war123,vakantie,maddawg,sewanee,jake5253,tautt1,anthony5,letterma,jimbo2,kmdtyjr,hextall,jessica6,amiga500,hotcunt,phoenix9,veronda,saqartvelo,scubas,sixer3,williamj,nightfal,shihan,melnikova,kosssss,handily,killer77,jhrl0821,march17,rushman,6gcf636i,metoyou,irina123,mine11,primus1,formatters,matthew5,infotech,gangster1,jordan45,moose69,kompas,motoxxx,greatwhi,cobra12,kirpich,weezer1,hello23,montse,tracy123,connecte,cjymrf,hemingwa,azreal,gundam00,mobila,boxman,slayers1,ravshan,june26,fktrcfylhjd,bermuda1,tylerd,maersk,qazwsx11,eybdthcbntn,ash123,camelo,kat123,backd00r,cheyenne1,1king,jerkin,tnt123,trabant,warhammer40k,rambos,punto,home77,pedrito,1frank,brille,guitarman,george13,rakas,tgbxtcrbq,flute1,bananas1,lovezp1314,thespot,postie,buster69,sexytime,twistys,zacharia,sportage,toccata,denver7,terry123,bogdanova,devil69,higgins1,whatluck,pele10,kkk666,jeffery1,1qayxsw2,riptide1,chevy11,munchy,lazer1,hooker1,ghfgjh,vergesse,playgrou,4077mash,gusev,humpin,oneputt,hydepark,monster9,tiger8,tangsoo,guy123,hesoyam1,uhtqneyu,thanku,lomond,ortezza,kronik,geetha,rabbit66,killas,qazxswe,alabaste,1234567890qwerty,capone1,andrea12,geral,beatbox,slutfuck,booyaka,jasmine7,ostsee,maestro1,beatme,tracey1,buster123,donaldduck,ironfish,happy6,konnichi,gintonic,momoney1,dugan1,today2,enkidu,destiny2,trim7gun,katuha,fractals,morganstanley,polkadot,gotime,prince11,204060,fifa2010,bobbyt,seemee,amanda10,airbrush,bigtitty,heidie,layla1,cotton1,5speed,fyfnjkmtdyf,flynavy,joxury8f,meeko,akuma,dudley1,flyboy1,moondog1,trotters,mariami,signin,chinna,legs11,pussy4,1s1h1e1f1,felici,optimus1,iluvu,marlins1,gavaec,balance1,glock40,london01,kokot,southwes,comfort1,sammy11,rockbottom,brianc,litebeer,homero,chopsuey,greenlan,charit,freecell,hampster,smalldog,viper12,blofeld,1234567890987654321,realsex,romann,cartman2,cjdthitycndj,nelly1,bmw528,zwezda,masterba,jeep99,turtl,america2,sunburst,sanyco,auntjudy,125wm,blue10,qwsazx,cartma,toby12,robbob,red222,ilovecock,losfix16,1explore,helge,vaz2114,whynotme,baba123,mugen,1qazwsxedc,albertjr,0101198,sextime,supras,nicolas2,wantsex,pussy6,checkm8,winam,24gordon,misterme,curlew,gbljhfcs,medtech,franzi,butthea,voivod,blackhat,egoiste,pjkeirf,maddog69,pakalolo,hockey4,igor1234,rouges,snowhite,homefree,sexfreak,acer12,dsmith,blessyou,199410,vfrcbvjd,falco02,belinda1,yaglasph,april21,groundho,jasmin1,nevergiveup,elvir,gborv526,c00kie,emma01,awesome2,larina,mike12345,maximu,anupam,bltynbabrfwbz,tanushka,sukkel,raptor22,josh12,schalke04,cosmodog,fuckyou8,busybee,198800,bijoux,frame1,blackmor,giveit,issmall,bear13,123-123,bladez,littlegirl,ultra123,fletch1,flashnet,loploprock,rkelly,12step,lukas1,littlewhore,cuntfinger,stinkyfinger,laurenc,198020,n7td4bjl,jackie69,camel123,ben1234,1gateway,adelheid,fatmike,thuglove,zzaaqq,chivas1,4815162342q,mamadou,nadano,james22,benwin,andrea99,rjirf,michou,abkbgg,d50gnn,aaazzz,a123654,blankman,booboo11,medicus,bigbone,197200,justine1,bendix,morphius,njhvjp,44mag,zsecyus56,goodbye1,nokiadermo,a333444,waratsea,4rzp8ab7,fevral,brillian,kirbys,minim,erathia,grazia,zxcvb1234,dukey,snaggle,poppi,hymen,1video,dune2000,jpthjdf,cvbn123,zcxfcnkbdfz,astonv,ginnie,316271,engine3,pr1ncess,64chevy,glass1,laotzu,hollyy,comicbooks,assasins,nuaddn9561,scottsda,hfcnfvfy,accobra,7777777z,werty123,metalhead,romanson,redsand,365214,shalo,arsenii,1989cc,sissi,duramax,382563,petera,414243,mamapap,jollymon,field1,fatgirl,janets,trompete,matchbox20,rambo2,nepenthe,441232,qwertyuiop10,bozo123,phezc419hv,romantika,lifestyl,pengui,decembre,demon6,panther6,444888,scanman,ghjcnjabkz,pachanga,buzzword,indianer,spiderman3,tony12,startre,frog1,fyutk,483422,tupacshakur,albert12,1drummer,bmw328i,green17,aerdna,invisibl,summer13,calimer,mustaine,lgnu9d,morefun,hesoyam123,escort1,scrapland,stargat,barabbas,dead13,545645,mexicali,sierr,gfhfpbn,gonchar,moonstafa,searock,counte,foster1,jayhawk1,floren,maremma,nastya2010,softball1,adaptec,halloo,barrabas,zxcasd123,hunny,mariana1,kafedra,freedom0,green420,vlad1234,method7,665566,tooting,hallo12,davinchi,conducto,medias,666444,invernes,madhatter,456asd,12345678i,687887,le33px,spring00,help123,bellybut,billy5,vitalik1,river123,gorila,bendis,power666,747200,footslav,acehigh,qazxswedc123,q1a1z1,richard9,peterburg,tabletop,gavrilov,123qwe1,kolosov,fredrau,run4fun,789056,jkbvgbflf,chitra,87654321q,steve22,wideopen,access88,surfe,tdfyutkbjy,impossib,kevin69,880888,cantina,887766,wxcvb,dontforg,qwer1209,asslicke,mamma123,indig,arkasha,scrapp,morelia,vehxbr,jones2,scratch1,cody11,cassie12,gerbera,dontgotm,underhil,maks2010,hollywood1,hanibal,elena2010,jason11,1010321,stewar,elaman,fireplug,goodby,sacrific,babyphat,bobcat12,bruce123,1233215,tony45,tiburo,love15,bmw750,wallstreet,2h0t4me,1346795,lamerz,munkee,134679q,granvill,1512198,armastus,aiden1,pipeutvj,g1234567,angeleyes,usmc1,102030q,putangina,brandnew,shadowfax,eagles12,1falcon,brianw,lokomoti,2022958,scooper,pegas,jabroni1,2121212,buffal,siffredi,wewiz,twotone,rosebudd,nightwis,carpet1,mickey2,2525252,sleddog,red333,jamesm,2797349,jeff12,onizuka,felixxxx,rf6666,fine1,ohlala,forplay,chicago5,muncho,scooby11,ptichka,johnnn,19851985p,dogphil3650,totenkopf,monitor2,macross7,3816778,dudder,semaj1,bounder,racerx1,5556633,7085506,ofclr278,brody1,7506751,nantucke,hedj2n4q,drew1,aessedai,trekbike,pussykat,samatron,imani,9124852,wiley1,dukenukem,iampurehaha2,9556035,obvious1,mccool24,apache64,kravchenko,justforf,basura,jamese,s0ccer,safado,darksta,surfer69,damian1,gjpbnbd,gunny1,wolley,sananton,zxcvbn123456,odt4p6sv8,sergei1,modem1,mansikka,zzzz1,rifraf,dima777,mary69,looking4,donttell,red100,ninjutsu,uaeuaeman,bigbri,brasco,queenas8151,demetri,angel007,bubbl,kolort,conny,antonia1,avtoritet,kaka22,kailayu,sassy2,wrongway,chevy3,1nascar,patriots1,chrisrey,mike99,sexy22,chkdsk,sd3utre7,padawan,a6pihd,doming,mesohorny,tamada,donatello,emma22,eather,susan69,pinky123,stud69,fatbitch,pilsbury,thc420,lovepuss,1creativ,golf1234,hurryup,1honda,huskerdu,marino1,gowron,girl1,fucktoy,gtnhjpfdjlcr,dkjfghdk,pinkfl,loreli,7777777s,donkeykong,rockytop,staples1,sone4ka,xxxjay,flywheel,toppdogg,bigbubba,aaa123456,2letmein,shavkat,paule,dlanor,adamas,0147852,aassaa,dixon1,bmw328,mother12,ilikepussy,holly2,tsmith,excaliber,fhutynbyf,nicole3,tulipan,emanue,flyvholm,currahee,godsgift,antonioj,torito,dinky1,sanna,yfcnzvjz,june14,anime123,123321456654,hanswurst,bandman,hello101,xxxyyy,chevy69,technica,tagada,arnol,v00d00,lilone,filles,drumandbass,dinamit,a1234a,eatmeat,elway07,inout,james6,dawid1,thewolf,diapason,yodaddy,qscwdv,fuckit1,liljoe,sloeber,simbacat,sascha1,qwe1234,1badger,prisca,angel17,gravedig,jakeyboy,longboard,truskawka,golfer11,pyramid7,highspee,pistola,theriver,hammer69,1packers,dannyd,alfonse,qwertgfdsa,11119999,basket1,ghjtrn,saralee,12inches,paolo1,zse4xdr5,taproot,sophieh6,grizzlie,hockey69,danang,biggums,hotbitch,5alive,beloved1,bluewave,dimon95,koketka,multiscan,littleb,leghorn,poker2,delite,skyfir,bigjake,persona1,amberdog,hannah12,derren,ziffle,1sarah,1assword,sparky01,seymur,tomtom1,123321qw,goskins,soccer19,luvbekki,bumhole,2balls,1muffin,borodin,monkey9,yfeiybrb,1alex,betmen,freder,nigger123,azizbek,gjkzrjdf,lilmike,1bigdadd,1rock,taganrog,snappy1,andrey1,kolonka,bunyan,gomango,vivia,clarkkent,satur,gaudeamus,mantaray,1month,whitehea,fargus,andrew99,ray123,redhawks,liza2009,qw12345,den12345,vfhnsyjdf,147258369a,mazepa,newyorke,1arsenal,hondas2000,demona,fordgt,steve12,birthday2,12457896,dickster,edcwsxqaz,sahalin,pantyman,skinny1,hubertus,cumshot1,chiro,kappaman,mark3434,canada12,lichking,bonkers1,ivan1985,sybase,valmet,doors1,deedlit,kyjelly,bdfysx,ford11,throatfuck,backwood,fylhsq,lalit,boss429,kotova,bricky,steveh,joshua19,kissa,imladris,star1234,lubimka,partyman,crazyd,tobias1,ilike69,imhome,whome,fourstar,scanner1,ujhjl312,anatoli,85bears,jimbo69,5678ytr,potapova,nokia7070,sunday1,kalleank,1996gta,refinnej,july1,molodec,nothanks,enigm,12play,sugardog,nhfkbdfkb,larousse,cannon1,144444,qazxcdew,stimorol,jhereg,spawn7,143000,fearme,hambur,merlin21,dobie,is3yeusc,partner1,dekal,varsha,478jfszk,flavi,hippo1,9hmlpyjd,july21,7imjfstw,lexxus,truelov,nokia5200,carlos6,anais,mudbone,anahit,taylorc,tashas,larkspur,animal2000,nibiru,jan123,miyvarxar,deflep,dolore,communit,ifoptfcor,laura2,anadrol,mamaliga,mitzi1,blue92,april15,matveev,kajlas,wowlook1,1flowers,shadow14,alucard1,1golf,bantha,scotlan,singapur,mark13,manchester1,telus01,superdav,jackoff1,madnes,bullnuts,world123,clitty,palmer1,david10,spider10,sargsyan,rattlers,david4,windows2,sony12,visigoth,qqqaaa,penfloor,cabledog,camilla1,natasha123,eagleman,softcore,bobrov,dietmar,divad,sss123,d1234567,tlbyjhju,1q1q1q1,paraiso,dav123,lfiekmrf,drachen,lzhan16889,tplate,gfghbrf,casio1,123boots1,123test,sys64738,heavymetal,andiamo,meduza,soarer,coco12,negrita,amigas,heavymet,bespin,1asdfghj,wharfrat,wetsex,tight1,janus1,sword123,ladeda,dragon98,austin2,atep1,jungle1,12345abcd,lexus300,pheonix1,alex1974,123qw123,137955,bigtim,shadow88,igor1994,goodjob,arzen,champ123,121ebay,changeme1,brooksie,frogman1,buldozer,morrowin,achim,trish1,lasse,festiva,bubbaman,scottb,kramit,august22,tyson123,passsword,oompah,al123456,fucking1,green45,noodle1,looking1,ashlynn,al1716,stang50,coco11,greese,bob111,brennan1,jasonj,1cherry,1q2345,1xxxxxxx,fifa2011,brondby,zachar1,satyam,easy1,magic7,1rainbow,cheezit,1eeeeeee,ashley123,assass1,amanda123,jerbear,1bbbbbb,azerty12,15975391,654321z,twinturb,onlyone1,denis1988,6846kg3r,jumbos,pennydog,dandelion,haileris,epervier,snoopy69,afrodite,oldpussy,green55,poopypan,verymuch,katyusha,recon7,mine69,tangos,contro,blowme2,jade1,skydive1,fiveiron,dimo4ka,bokser,stargirl,fordfocus,tigers2,platina,baseball11,raque,pimper,jawbreak,buster88,walter34,chucko,penchair,horizon1,thecure1,scc1975,adrianna1,kareta,duke12,krille,dumbfuck,cunt1,aldebaran,laverda,harumi,knopfler,pongo1,pfhbyf,dogman1,rossigno,1hardon,scarlets,nuggets1,ibelieve,akinfeev,xfhkbr,athene,falcon69,happie,billly,nitsua,fiocco,qwerty09,gizmo2,slava2,125690,doggy123,craigs,vader123,silkeborg,124365,peterm,123978,krakatoa,123699,123592,kgvebmqy,pensacol,d1d2d3,snowstor,goldenboy,gfg65h7,ev700,church1,orange11,g0dz1ll4,chester3,acheron,cynthi,hotshot1,jesuschris,motdepass,zymurgy,one2one,fietsbel,harryp,wisper,pookster,nn527hp,dolla,milkmaid,rustyboy,terrell1,epsilon1,lillian1,dale3,crhbgrf,maxsim,selecta,mamada,fatman1,ufkjxrf,shinchan,fuckuall,women1,000008,bossss,greta1,rbhjxrf,mamasboy,purple69,felicidade,sexy21,cathay,hunglow,splatt,kahless,shopping1,1gandalf,themis,delta7,moon69,blue24,parliame,mamma1,miyuki,2500hd,jackmeof,razer,rocker1,juvis123,noremac,boing747,9z5ve9rrcz,icewater,titania,alley1,moparman,christo1,oliver2,vinicius,tigerfan,chevyy,joshua99,doda99,matrixx,ekbnrf,jackfrost,viper01,kasia,cnfhsq,triton1,ssbt8ae2,rugby8,ramman,1lucky,barabash,ghtlfntkm,junaid,apeshit,enfant,kenpo1,shit12,007000,marge1,shadow10,qwerty789,richard8,vbitkm,lostboys,jesus4me,richard4,hifive,kolawole,damilola,prisma,paranoya,prince2,lisaann,happyness,cardss,methodma,supercop,a8kd47v5,gamgee,polly123,irene1,number8,hoyasaxa,1digital,matthew0,dclxvi,lisica,roy123,2468013579,sparda,queball,vaffanculo,pass1wor,repmvbx,999666333,freedom8,botanik,777555333,marcos1,lubimaya,flash2,einstei,08080,123456789j,159951159,159357123,carrot1,alina1995,sanjos,dilara,mustang67,wisteria,jhnjgtl12,98766789,darksun,arxangel,87062134,creativ1,malyshka,fuckthemall,barsic,rocksta,2big4u,5nizza,genesis2,romance1,ofcourse,1horse,latenite,cubana,sactown,789456123a,milliona,61808861,57699434,imperia,bubba11,yellow3,change12,55495746,flappy,jimbo123,19372846,19380018,cutlass1,craig123,klepto,beagle1,solus,51502112,pasha1,19822891,46466452,19855891,petshop,nikolaevna,119966,nokia6131,evenpar,hoosier1,contrasena,jawa350,gonzo123,mouse2,115511,eetfuk,gfhfvgfvgfv,1crystal,sofaking,coyote1,kwiatuszek,fhrflbq,valeria1,anthro,0123654789,alltheway,zoltar,maasikas,wildchil,fredonia,earlgrey,gtnhjczy,matrix123,solid1,slavko,12monkeys,fjdksl,inter1,nokia6500,59382113kevinp,spuddy,cachero,coorslit,password!,kiba1z,karizma,vova1994,chicony,english1,bondra12,1rocket,hunden,jimbob1,zpflhjn1,th0mas,deuce22,meatwad,fatfree,congas,sambora,cooper2,janne,clancy1,stonie,busta,kamaz,speedy2,jasmine3,fahayek,arsenal0,beerss,trixie1,boobs69,luansantana,toadman,control2,ewing33,maxcat,mama1964,diamond4,tabaco,joshua0,piper2,music101,guybrush,reynald,pincher,katiebug,starrs,pimphard,frontosa,alex97,cootie,clockwor,belluno,skyeseth,booty69,chaparra,boochie,green4,bobcat1,havok,saraann,pipeman,aekdb,jumpshot,wintermu,chaika,1chester,rjnjatq,emokid,reset1,regal1,j0shua,134679a,asmodey,sarahh,zapidoo,ciccione,sosexy,beckham23,hornets1,alex1971,delerium,manageme,connor11,1rabbit,sane4ek,caseyboy,cbljhjdf,redsox20,tttttt99,haustool,ander,pantera6,passwd1,journey1,9988776655,blue135,writerspace,xiaoyua123,justice2,niagra,cassis,scorpius,bpgjldsgjldthnf,gamemaster,bloody1,retrac,stabbin,toybox,fight1,ytpyf.,glasha,va2001,taylor11,shameles,ladylove,10078,karmann,rodeos,eintritt,lanesra,tobasco,jnrhjqcz,navyman,pablit,leshka,jessica3,123vika,alena1,platinu,ilford,storm7,undernet,sasha777,1legend,anna2002,kanmax1994,porkpie,thunder0,gundog,pallina,easypass,duck1,supermom,roach1,twincam,14028,tiziano,qwerty32,123654789a,evropa,shampoo1,yfxfkmybr,cubby1,tsunami1,fktrcttdf,yasacrac,17098,happyhap,bullrun,rodder,oaktown,holde,isbest,taylor9,reeper,hammer11,julias,rolltide1,compaq123,fourx4,subzero1,hockey9,7mary3,busines,ybrbnjcbr,wagoneer,danniash,portishead,digitex,alex1981,david11,infidel,1snoopy,free30,jaden,tonto1,redcar27,footie,moskwa,thomas21,hammer12,burzum,cosmo123,50000,burltree,54343,54354,vwpassat,jack5225,cougars1,burlpony,blackhorse,alegna,petert,katemoss,ram123,nels0n,ferrina,angel77,cstock,1christi,dave55,abc123a,alex1975,av626ss,flipoff,folgore,max1998,science1,si711ne,yams7,wifey1,sveiks,cabin1,volodia,ox3ford,cartagen,platini,picture1,sparkle1,tiedomi,service321,wooody,christi1,gnasher,brunob,hammie,iraffert,bot2010,dtcyeirf,1234567890p,cooper11,alcoholi,savchenko,adam01,chelsea5,niewiem,icebear,lllooottt,ilovedick,sweetpus,money8,cookie13,rfnthbyf1988,booboo2,angus123,blockbus,david9,chica1,nazaret,samsung9,smile4u,daystar,skinnass,john10,thegirl,sexybeas,wasdwasd1,sigge1,1qa2ws3ed4rf5tg,czarny,ripley1,chris5,ashley19,anitha,pokerman,prevert,trfnthby,tony69,georgia2,stoppedb,qwertyuiop12345,miniclip,franky1,durdom,cabbages,1234567890o,delta5,liudmila,nhfycajhvths,court1,josiew,abcd1,doghead,diman,masiania,songline,boogle,triston,deepika,sexy4me,grapple,spacebal,ebonee,winter0,smokewee,nargiza,dragonla,sassys,andy2000,menards,yoshio,massive1,suckmy1k,passat99,sexybo,nastya1996,isdead,stratcat,hokuto,infix,pidoras,daffyduck,cumhard,baldeagl,kerberos,yardman,shibainu,guitare,cqub6553,tommyy,bk.irf,bigfoo,hecto,july27,james4,biggus,esbjerg,isgod,1irish,phenmarr,jamaic,roma1990,diamond0,yjdbrjd,girls4me,tampa1,kabuto,vaduz,hanse,spieng,dianochka,csm101,lorna1,ogoshi,plhy6hql,2wsx4rfv,cameron0,adebayo,oleg1996,sharipov,bouboule,hollister1,frogss,yeababy,kablam,adelante,memem,howies,thering,cecilia1,onetwo12,ojp123456,jordan9,msorcloledbr,neveraga,evh5150,redwin,1august,canno,1mercede,moody1,mudbug,chessmas,tiikeri,stickdaddy77,alex15,kvartira,7654321a,lollol123,qwaszxedc,algore,solana,vfhbyfvfhbyf,blue72,misha1111,smoke20,junior13,mogli,threee,shannon2,fuckmylife,kevinh,saransk,karenw,isolde,sekirarr,orion123,thomas0,debra1,laketaho,alondra,curiva,jazz1234,1tigers,jambos,lickme2,suomi,gandalf7,028526,zygote,brett123,br1ttany,supafly,159000,kingrat,luton1,cool-ca,bocman,thomasd,skiller,katter,mama777,chanc,tomass,1rachel,oldno7,rfpfyjdf,bigkev,yelrah,primas,osito,kipper1,msvcr71,bigboy11,thesun,noskcaj,chicc,sonja1,lozinka,mobile1,1vader,ummagumma,waves1,punter12,tubgtn,server1,irina1991,magic69,dak001,pandemonium,dead1,berlingo,cherrypi,1montana,lohotron,chicklet,asdfgh123456,stepside,ikmvw103,icebaby,trillium,1sucks,ukrnet,glock9,ab12345,thepower,robert8,thugstools,hockey13,buffon,livefree,sexpics,dessar,ja0000,rosenrot,james10,1fish,svoloch,mykitty,muffin11,evbukb,shwing,artem1992,andrey1992,sheldon1,passpage,nikita99,fubar123,vannasx,eight888,marial,max2010,express2,violentj,2ykn5ccf,spartan11,brenda69,jackiech,abagail,robin2,grass1,andy76,bell1,taison,superme,vika1995,xtr451,fred20,89032073168,denis1984,2000jeep,weetabix,199020,daxter,tevion,panther8,h9iymxmc,bigrig,kalambur,tsalagi,12213443,racecar02,jeffrey4,nataxa,bigsam,purgator,acuracl,troutbum,potsmoke,jimmyz,manutd1,nytimes,pureevil,bearss,cool22,dragonage,nodnarb,dbrbyu,4seasons,freude,elric1,werule,hockey14,12758698,corkie,yeahright,blademan,tafkap,clave,liziko,hofner,jeffhardy,nurich,runne,stanisla,lucy1,monk3y,forzaroma,eric99,bonaire,blackwoo,fengshui,1qaz0okm,newmoney,pimpin69,07078,anonymer,laptop1,cherry12,ace111,salsa1,wilbur1,doom12,diablo23,jgtxzbhr,under1,honda01,breadfan,megan2,juancarlos,stratus1,ackbar,love5683,happytim,lambert1,cbljhtyrj,komarov,spam69,nfhtkrf,brownn,sarmat,ifiksr,spike69,hoangen,angelz,economia,tanzen,avogadro,1vampire,spanners,mazdarx,queequeg,oriana,hershil,sulaco,joseph11,8seconds,aquariu,cumberla,heather9,anthony8,burton12,crystal0,maria3,qazwsxc,snow123,notgood,198520,raindog,heehaw,consulta,dasein,miller01,cthulhu1,dukenuke,iubire,baytown,hatebree,198505,sistem,lena12,welcome01,maraca,middleto,sindhu,mitsou,phoenix5,vovan,donaldo,dylandog,domovoy,lauren12,byrjuybnj,123llll,stillers,sanchin,tulpan,smallvill,1mmmmm,patti1,folgers,mike31,colts18,123456rrr,njkmrjz,phoenix0,biene,ironcity,kasperok,password22,fitnes,matthew6,spotligh,bujhm123,tommycat,hazel5,guitar11,145678,vfcmrf,compass1,willee,1barney,jack2000,littleminge,shemp,derrek,xxx12345,littlefuck,spuds1,karolinka,camneely,qwertyu123,142500,brandon00,munson15,falcon3,passssap,z3cn2erv,goahead,baggio10,141592,denali1,37kazoo,copernic,123456789asd,orange88,bravada,rush211,197700,pablo123,uptheass,samsam1,demoman,mattylad10,heydude,mister2,werken,13467985,marantz,a22222,f1f2f3f4,fm12mn12,gerasimova,burrito1,sony1,glenny,baldeagle,rmfidd,fenomen,verbati,forgetme,5element,wer138,chanel1,ooicu812,10293847qp,minicooper,chispa,myturn,deisel,vthrehbq,boredboi4u,filatova,anabe,poiuyt1,barmalei,yyyy1,fourkids,naumenko,bangbros,pornclub,okaykk,euclid90,warrior3,kornet,palevo,patatina,gocart,antanta,jed1054,clock1,111111w,dewars,mankind1,peugeot406,liten,tahira,howlin,naumov,rmracing,corone,cunthole,passit,rock69,jaguarxj,bumsen,197101,sweet2,197010,whitecat,sawadee,money100,yfhrjnbrb,andyboy,9085603566,trace1,fagget,robot1,angel20,6yhn7ujm,specialinsta,kareena,newblood,chingada,boobies2,bugger1,squad51,133andre,call06,ashes1,ilovelucy,success2,kotton,cavalla,philou,deebee,theband,nine09,artefact,196100,kkkkkkk1,nikolay9,onelov,basia,emilyann,sadman,fkrjujkbr,teamomuch,david777,padrino,money21,firdaus,orion3,chevy01,albatro,erdfcv,2legit,sarah7,torock,kevinn,holio,soloy,enron714,starfleet,qwer11,neverman,doctorwh,lucy11,dino12,trinity7,seatleon,o123456,pimpman,1asdfgh,snakebit,chancho,prorok,bleacher,ramire,darkseed,warhorse,michael123,1spanky,1hotdog,34erdfcv,n0th1ng,dimanche,repmvbyf,michaeljackson,login1,icequeen,toshiro,sperme,racer2,veget,birthday26,daniel9,lbvekmrf,charlus,bryan123,wspanic,schreibe,1andonly,dgoins,kewell,apollo12,egypt1,fernie,tiger21,aa123456789,blowj,spandau,bisquit,12345678d,deadmau5,fredie,311420,happyface,samant,gruppa,filmstar,andrew17,bakesale,sexy01,justlook,cbarkley,paul11,bloodred,rideme,birdbath,nfkbcvfy,jaxson,sirius1,kristof,virgos,nimrod1,hardc0re,killerbee,1abcdef,pitcher1,justonce,vlada,dakota99,vespucci,wpass,outside1,puertori,rfvbkf,teamlosi,vgfun2,porol777,empire11,20091989q,jasong,webuivalidat,escrima,lakers08,trigger2,addpass,342500,mongini,dfhtybr,horndogg,palermo1,136900,babyblu,alla98,dasha2010,jkelly,kernow,yfnecz,rockhopper,toeman,tlaloc,silver77,dave01,kevinr,1234567887654321,135642,me2you,8096468644q,remmus,spider7,jamesa,jilly,samba1,drongo,770129ji,supercat,juntas,tema1234,esthe,1234567892000,drew11,qazqaz123,beegees,blome,rattrace,howhigh,tallboy,rufus2,sunny2,sou812,miller12,indiana7,irnbru,patch123,letmeon,welcome5,nabisco,9hotpoin,hpvteb,lovinit,stormin,assmonke,trill,atlanti,money1234,cubsfan,mello1,stars2,ueptkm,agate,dannym88,lover123,wordz,worldnet,julemand,chaser1,s12345678,pissword,cinemax,woodchuc,point1,hotchkis,packers2,bananana,kalender,420666,penguin8,awo8rx3wa8t,hoppie,metlife,ilovemyfamily,weihnachtsbau,pudding1,luckystr,scully1,fatboy1,amizade,dedham,jahbless,blaat,surrende,****er,1panties,bigasses,ghjuhfvbcn,asshole123,dfktyrb,likeme,nickers,plastik,hektor,deeman,muchacha,cerebro,santana5,testdrive,dracula1,canalc,l1750sq,savannah1,murena,1inside,pokemon00,1iiiiiii,jordan20,sexual1,mailliw,calipso,014702580369,1zzzzzz,1jjjjjj,break1,15253545,yomama1,katinka,kevin11,1ffffff,martijn,sslazio,daniel5,porno2,nosmas,leolion,jscript,15975312,pundai,kelli1,kkkddd,obafgkm,marmaris,lilmama,london123,rfhfnt,elgordo,talk87,daniel7,thesims3,444111,bishkek,afrika2002,toby22,1speedy,daishi,2children,afroman,qqqqwwww,oldskool,hawai,v55555,syndicat,pukimak,fanatik,tiger5,parker01,bri5kev6,timexx,wartburg,love55,ecosse,yelena03,madinina,highway1,uhfdbwfgf,karuna,buhjvfybz,wallie,46and2,khalif,europ,qaz123wsx456,bobbybob,wolfone,falloutboy,manning18,scuba10,schnuff,ihateyou1,lindam,sara123,popcor,fallengun,divine1,montblanc,qwerty8,rooney10,roadrage,bertie1,latinus,lexusis,rhfvfnjhcr,opelgt,hitme,agatka,1yamaha,dmfxhkju,imaloser,michell1,sb211st,silver22,lockedup,andrew9,monica01,sassycat,dsobwick,tinroof,ctrhtnyj,bultaco,rhfcyjzhcr,aaaassss,14ss88,joanne1,momanddad,ahjkjdf,yelhsa,zipdrive,telescop,500600,1sexsex,facial1,motaro,511647,stoner1,temujin,elephant1,greatman,honey69,kociak,ukqmwhj6,altezza,cumquat,zippos,kontiki,123max,altec1,bibigon,tontos,qazsew,nopasaran,militar,supratt,oglala,kobayash,agathe,yawetag,dogs1,cfiekmrf,megan123,jamesdea,porosenok,tiger23,berger1,hello11,seemann,stunner1,walker2,imissu,jabari,minfd,lollol12,hjvfy,1-oct,stjohns,2278124q,123456789qwer,alex1983,glowworm,chicho,mallards,bluedevil,explorer1,543211,casita,1time,lachesis,alex1982,airborn1,dubesor,changa,lizzie1,captaink,socool,bidule,march23,1861brr,k.ljxrf,watchout,fotze,1brian,keksa2,aaaa1122,matrim,providian,privado,dreame,merry1,aregdone,davidt,nounour,twenty2,play2win,artcast2,zontik,552255,shit1,sluggy,552861,dr8350,brooze,alpha69,thunder6,kamelia2011,caleb123,mmxxmm,jamesh,lfybkjd,125267,125000,124536,bliss1,dddsss,indonesi,bob69,123888,tgkbxfgy,gerar,themack,hijodeputa,good4now,ddd123,clk430,kalash,tolkien1,132forever,blackb,whatis,s1s2s3s4,lolkin09,yamahar,48n25rcc,djtiesto,111222333444555,bigbull,blade55,coolbree,kelse,ichwill,yamaha12,sakic,bebeto,katoom,donke,sahar,wahine,645202,god666,berni,starwood,june15,sonoio,time123,llbean,deadsoul,lazarev,cdtnf,ksyusha,madarchod,technik,jamesy,4speed,tenorsax,legshow,yoshi1,chrisbl,44e3ebda,trafalga,heather7,serafima,favorite4,havefun1,wolve,55555r,james13,nosredna,bodean,jlettier,borracho,mickael,marinus,brutu,sweet666,kiborg,rollrock,jackson6,macross1,ousooner,9085084232,takeme,123qwaszx,firedept,vfrfhjd,jackfros,123456789000,briane,cookie11,baby22,bobby18,gromova,systemofadown,martin01,silver01,pimaou,darthmaul,hijinx,commo,chech,skyman,sunse,2vrd6,vladimirovna,uthvfybz,nicole01,kreker,bobo1,v123456789,erxtgb,meetoo,drakcap,vfvf12,misiek1,butane,network2,flyers99,riogrand,jennyk,e12345,spinne,avalon11,lovejone,studen,maint,porsche2,qwerty100,chamberl,bluedog1,sungam,just4u,andrew23,summer22,ludic,musiclover,aguil,beardog1,libertin,pippo1,joselit,patito,bigberth,digler,sydnee,jockstra,poopo,jas4an,nastya123,profil,fuesse,default1,titan2,mendoz,kpcofgs,anamika,brillo021,bomberman,guitar69,latching,69pussy,blues2,phelge,ninja123,m7n56xo,qwertasd,alex1976,cunningh,estrela,gladbach,marillion,mike2000,258046,bypop,muffinman,kd5396b,zeratul,djkxbwf,john77,sigma2,1linda,selur,reppep,quartz1,teen1,freeclus,spook1,kudos4ever,clitring,sexiness,blumpkin,macbook,tileman,centra,escaflowne,pentable,shant,grappa,zverev,1albert,lommerse,coffee11,777123,polkilo,muppet1,alex74,lkjhgfdsazx,olesica,april14,ba25547,souths,jasmi,arashi,smile2,2401pedro,mybabe,alex111,quintain,pimp1,tdeir8b2,makenna,122333444455555,%e2%82%ac,tootsie1,pass111,zaqxsw123,gkfdfybt,cnfnbcnbrf,usermane,iloveyou12,hard69,osasuna,firegod,arvind,babochka,kiss123,cookie123,julie123,kamakazi,dylan2,223355,tanguy,nbhtqa,tigger13,tubby1,makavel,asdflkj,sambo1,mononoke,mickeys,gayguy,win123,green33,wcrfxtvgbjy,bigsmall,1newlife,clove,babyfac,bigwaves,mama1970,shockwav,1friday,bassey,yarddog,codered1,victory7,bigrick,kracker,gulfstre,chris200,sunbanna,bertuzzi,begemotik,kuolema,pondus,destinee,123456789zz,abiodun,flopsy,amadeusptfcor,geronim,yggdrasi,contex,daniel6,suck1,adonis1,moorea,el345612,f22raptor,moviebuf,raunchy,6043dkf,zxcvbnm123456789,eric11,deadmoin,ratiug,nosliw,fannies,danno,888889,blank1,mikey2,gullit,thor99,mamiya,ollieb,thoth,dagger1,websolutionssu,bonker,prive,1346798520,03038,q1234q,mommy2,contax,zhipo,gwendoli,gothic1,1234562000,lovedick,gibso,digital2,space199,b26354,987654123,golive,serious1,pivkoo,better1,824358553,794613258,nata1980,logout,fishpond,buttss,squidly,good4me,redsox19,jhonny,zse45rdx,matrixxx,honey12,ramina,213546879,motzart,fall99,newspape,killit,gimpy,photowiz,olesja,thebus,marco123,147852963,bedbug,147369258,hellbound,gjgjxrf,123987456,lovehurt,five55,hammer01,1234554321a,alina2011,peppino,ang238,questor,112358132,alina1994,alina1998,money77,bobjones,aigerim,cressida,madalena,420smoke,tinchair,raven13,mooser,mauric,lovebu,adidas69,krypton1,1111112,loveline,divin,voshod,michaelm,cocotte,gbkbuhbv,76689295,kellyj,rhonda1,sweetu70,steamforums,geeque,nothere,124c41,quixotic,steam181,1169900,rfcgthcrbq,rfvbkm,sexstuff,1231230,djctvm,rockstar1,fulhamfc,bhecbr,rfntyf,quiksilv,56836803,jedimaster,pangit,gfhjkm777,tocool,1237654,stella12,55378008,19216811,potte,fender12,mortalkombat,ball1,nudegirl,palace22,rattrap,debeers,lickpussy,jimmy6,not4u2c,wert12,bigjuggs,sadomaso,1357924,312mas,laser123,arminia,branford,coastie,mrmojo,19801982,scott11,banaan123,ingres,300zxtt,hooters6,sweeties,19821983,19831985,19833891,sinnfein,welcome4,winner69,killerman,tachyon,tigre1,nymets1,kangol,martinet,sooty1,19921993,789qwe,harsingh,1597535,thecount,phantom3,36985214,lukas123,117711,pakistan1,madmax11,willow01,19932916,fucker12,flhrci,opelagila,theword,ashley24,tigger3,crazyj,rapide,deadfish,allana,31359092,sasha1993,sanders2,discman,zaq!2wsx,boilerma,mickey69,jamesg,babybo,jackson9,orion7,alina2010,indien,breeze1,atease,warspite,bazongaz,1celtic,asguard,mygal,fitzgera,1secret,duke33,cyklone,dipascuc,potapov,1escobar2,c0l0rad0,kki177hk,1little,macondo,victoriya,peter7,red666,winston6,kl?benhavn,muneca,jackme,jennan,happylife,am4h39d8nh,bodybuil,201980,dutchie,biggame,lapo4ka,rauchen,black10,flaquit,water12,31021364,command2,lainth88,mazdamx5,typhon,colin123,rcfhlfc,qwaszx11,g0away,ramir,diesirae,hacked1,cessna1,woodfish,enigma2,pqnr67w5,odgez8j3,grisou,hiheels,5gtgiaxm,2580258,ohotnik,transits,quackers,serjik,makenzie,mdmgatew,bryana,superman12,melly,lokit,thegod,slickone,fun4all,netpass,penhorse,1cooper,nsync,asdasd22,otherside,honeydog,herbie1,chiphi,proghouse,l0nd0n,shagg,select1,frost1996,casper123,countr,magichat,greatzyo,jyothi,3bears,thefly,nikkita,fgjcnjk,nitros,hornys,san123,lightspe,maslova,kimber1,newyork2,spammm,mikejone,pumpk1n,bruiser1,bacons,prelude9,boodie,dragon4,kenneth2,love98,power5,yodude,pumba,thinline,blue30,sexxybj,2dumb2live,matt21,forsale,1carolin,innova,ilikeporn,rbgtkjd,a1s2d3f,wu9942,ruffus,blackboo,qwerty999,draco1,marcelin,hideki,gendalf,trevon,saraha,cartmen,yjhbkmcr,time2go,fanclub,ladder1,chinni,6942987,united99,lindac,quadra,paolit,mainstre,beano002,lincoln7,bellend,anomie,8520456,bangalor,goodstuff,chernov,stepashka,gulla,mike007,frasse,harley03,omnislash,8538622,maryjan,sasha2011,gineok,8807031,hornier,gopinath,princesit,bdr529,godown,bosslady,hakaone,1qwe2,madman1,joshua11,lovegame,bayamon,jedi01,stupid12,sport123,aaa666,tony44,collect1,charliem,chimaira,cx18ka,trrim777,chuckd,thedream,redsox99,goodmorning,delta88,iloveyou11,newlife2,figvam,chicago3,jasonk,12qwer,9875321,lestat1,satcom,conditio,capri50,sayaka,9933162,trunks1,chinga,snooch,alexand1,findus,poekie,cfdbyf,kevind,mike1969,fire13,leftie,bigtuna,chinnu,silence1,celos1,blackdra,alex24,gfgfif,2boobs,happy8,enolagay,sataniv1993,turner1,dylans,peugeo,sasha1994,hoppel,conno,moonshot,santa234,meister1,008800,hanako,tree123,qweras,gfitymrf,reggie31,august29,supert,joshua10,akademia,gbljhfc,zorro123,nathalia,redsox12,hfpdjl,mishmash,nokiae51,nyyankees,tu190022,strongbo,none1,not4u2no,katie2,popart,harlequi,santan,michal1,1therock,screwu,csyekmrf,olemiss1,tyrese,hoople,sunshin1,cucina,starbase,topshelf,fostex,california1,castle1,symantec,pippolo,babare,turntabl,1angela,moo123,ipvteb,gogolf,alex88,cycle1,maxie1,phase2,selhurst,furnitur,samfox,fromvermine,shaq34,gators96,captain2,delonge,tomatoe,bisous,zxcvbnma,glacius,pineapple1,cannelle,ganibal,mko09ijn,paraklast1974,hobbes12,petty43,artema,junior8,mylover,1234567890d,fatal1ty,prostreet,peruan,10020,nadya,caution1,marocas,chanel5,summer08,metal123,111lox,scrapy,thatguy,eddie666,washingto,yannis,minnesota_hp,lucky4,playboy6,naumova,azzurro,patat,dale33,pa55wd,speedster,zemanova,saraht,newto,tony22,qscesz,arkady,1oliver,death6,vkfwx046,antiflag,stangs,jzf7qf2e,brianp,fozzy,cody123,startrek1,yoda123,murciela,trabajo,lvbnhbtdf,canario,fliper,adroit,henry5,goducks,papirus,alskdj,soccer6,88mike,gogetter,tanelorn,donking,marky1,leedsu,badmofo,al1916,wetdog,akmaral,pallet,april24,killer00,nesterova,rugby123,coffee12,browseui,ralliart,paigow,calgary1,armyman,vtldtltd,frodo2,frxtgb,iambigal,benno,jaytee,2hot4you,askar,bigtee,brentwoo,palladin,eddie2,al1916w,horosho,entrada,ilovetits,venture1,dragon19,jayde,chuvak,jamesl,fzr600,brandon8,vjqvbh,snowbal,snatch1,bg6njokf,pudder,karolin,candoo,pfuflrf,satchel1,manteca,khongbiet,critter1,partridg,skyclad,bigdon,ginger69,brave1,anthony4,spinnake,chinadol,passout,cochino,nipples1,15058,lopesk,sixflags,lloo999,parkhead,breakdance,cia123,fidodido,yuitre12,fooey,artem1995,gayathri,medin,nondriversig,l12345,bravo7,happy13,kazuya,camster,alex1998,luckyy,zipcode,dizzle,boating1,opusone,newpassw,movies23,kamikazi,zapato,bart316,cowboys0,corsair1,kingshit,hotdog12,rolyat,h200svrm,qwerty4,boofer,rhtyltkm,chris999,vaz21074,simferopol,pitboss,love3,britania,tanyshka,brause,123qwerty123,abeille,moscow1,ilkaev,manut,process1,inetcfg,dragon05,fortknox,castill,rynner,mrmike,koalas,jeebus,stockpor,longman,juanpabl,caiman,roleplay,jeremi,26058,prodojo,002200,magical1,black5,bvlgari,doogie1,cbhtqa,mahina,a1s2d3f4g5h6,jblpro,usmc01,bismilah,guitar01,april9,santana1,1234aa,monkey14,sorokin,evan1,doohan,animalsex,pfqxtyjr,dimitry,catchme,chello,silverch,glock45,dogleg,litespee,nirvana9,peyton18,alydar,warhamer,iluvme,sig229,minotavr,lobzik,jack23,bushwack,onlin,football123,joshua5,federov,winter2,bigmax,fufnfrhbcnb,hfpldfnhb,1dakota,f56307,chipmonk,4nick8,praline,vbhjh123,king11,22tango,gemini12,street1,77879,doodlebu,homyak,165432,chuluthu,trixi,karlito,salom,reisen,cdtnkzxjr,pookie11,tremendo,shazaam,welcome0,00000ty,peewee51,pizzle,gilead,bydand,sarvar,upskirt,legends1,freeway1,teenfuck,ranger9,darkfire,dfymrf,hunt0802,justme1,buffy1ma,1harry,671fsa75yt,burrfoot,budster,pa437tu,jimmyp,alina2006,malacon,charlize,elway1,free12,summer02,gadina,manara,gomer1,1cassie,sanja,kisulya,money3,pujols,ford50,midiland,turga,orange6,demetriu,freakboy,orosie1,radio123,open12,vfufpby,mustek,chris33,animes,meiling,nthtvjr,jasmine9,gfdkjd,oligarh,marimar,chicago9,.kzirf,bugssgub,samuraix,jackie01,pimpjuic,macdad,cagiva,vernost,willyboy,fynjyjdf,tabby1,privet123,torres9,retype,blueroom,raven11,q12we3,alex1989,bringiton,ridered,kareltje,ow8jtcs8t,ciccia,goniners,countryb,24688642,covingto,24861793,beyblade,vikin,badboyz,wlafiga,walstib,mirand,needajob,chloes,balaton,kbpfdtnf,freyja,bond9007,gabriel12,stormbri,hollage,love4eve,fenomeno,darknite,dragstar,kyle123,milfhunter,ma123123123,samia,ghislain,enrique1,ferien12,xjy6721,natalie2,reglisse,wilson2,wesker,rosebud7,amazon1,robertr,roykeane,xtcnth,mamatata,crazyc,mikie,savanah,blowjob69,jackie2,forty1,1coffee,fhbyjxrf,bubbah,goteam,hackedit,risky1,logoff,h397pnvr,buck13,robert23,bronc,st123st,godflesh,pornog,iamking,cisco69,septiembr,dale38,zhongguo,tibbar,panther9,buffa1,bigjohn1,mypuppy,vehvfycr,april16,shippo,fire1234,green15,q123123,gungadin,steveg,olivier1,chinaski,magnoli,faithy,storm12,toadfrog,paul99,78791,august20,automati,squirtle,cheezy,positano,burbon,nunya,llebpmac,kimmi,turtle2,alan123,prokuror,violin1,durex,pussygal,visionar,trick1,chicken6,29024,plowboy,rfybreks,imbue,sasha13,wagner1,vitalogy,cfymrf,thepro,26028,gorbunov,dvdcom,letmein5,duder,fastfun,pronin,libra1,conner1,harley20,stinker1,20068,20038,amitech,syoung,dugway,18068,welcome7,jimmypag,anastaci,kafka1,pfhfnecnhf,catsss,campus100,shamal,nacho1,fire12,vikings2,brasil1,rangerover,mohamma,peresvet,14058,cocomo,aliona,14038,qwaser,vikes,cbkmdf,skyblue1,ou81234,goodlove,dfkmltvfh,108888,roamer,pinky2,static1,zxcv4321,barmen,rock22,shelby2,morgans,1junior,pasword1,logjam,fifty5,nhfrnjhbcn,chaddy,philli,nemesis2,ingenier,djkrjd,ranger3,aikman8,knothead,daddy69,love007,vsythb,ford350,tiger00,renrut,owen11,energy12,march14,alena123,robert19,carisma,orange22,murphy11,podarok,prozak,kfgeirf,wolf13,lydia1,shazza,parasha,akimov,tobbie,pilote,heather4,baster,leones,gznfxjr,megama,987654321g,bullgod,boxster1,minkey,wombats,vergil,colegiata,lincol,smoothe,pride1,carwash1,latrell,bowling3,fylhtq123,pickwick,eider,bubblebox,bunnies1,loquit,slipper1,nutsac,purina,xtutdfhf,plokiju,1qazxs,uhjpysq,zxcvbasdfg,enjoy1,1pumpkin,phantom7,mama22,swordsma,wonderbr,dogdays,milker,u23456,silvan,dfkthbr,slagelse,yeahman,twothree,boston11,wolf100,dannyg,troll1,fynjy123,ghbcnfd,bftest,ballsdeep,bobbyorr,alphasig,cccdemo,fire123,norwest,claire2,august10,lth1108,problemas,sapito,alex06,1rusty,maccom,goirish1,ohyes,bxdumb,nabila,boobear1,rabbit69,princip,alexsander,travail,chantal1,dogggy,greenpea,diablo69,alex2009,bergen09,petticoa,classe,ceilidh,vlad2011,kamakiri,lucidity,qaz321,chileno,cexfhf,99ranger,mcitra,estoppel,volvos60,carter80,webpass,temp12,touareg,fcgbhby,bubba8,sunitha,200190ru,bitch2,shadow23,iluvit,nicole0,ruben1,nikki69,butttt,shocker1,souschef,lopotok01,kantot,corsano,cfnfyf,riverat,makalu,swapna,all4u9,cdtnkfy,ntktgepbr,ronaldo99,thomasj,bmw540i,chrisw,boomba,open321,z1x2c3v4b5n6m7,gaviota,iceman44,frosya,chris100,chris24,cosette,clearwat,micael,boogyman,pussy9,camus1,chumpy,heccrbq,konoplya,chester8,scooter5,ghjgfufylf,giotto,koolkat,zero000,bonita1,ckflrbq,j1964,mandog,18n28n24a,renob,head1,shergar,ringo123,tanita,sex4free,johnny12,halberd,reddevils,biolog,dillinge,fatb0y,c00per,hyperlit,wallace2,spears1,vitamine,buheirf,sloboda,alkash,mooman,marion1,arsenal7,sunder,nokia5610,edifier,pippone,fyfnjkmtdbx,fujimo,pepsi12,kulikova,bolat,duetto,daimon,maddog01,timoshka,ezmoney,desdemon,chesters,aiden,hugues,patrick5,aikman08,robert4,roenick,nyranger,writer1,36169544,foxmulder,118801,kutter,shashank,jamjar,118811,119955,aspirina,dinkus,1sailor,nalgene,19891959,snarf,allie1,cracky,resipsa,45678912,kemerovo,19841989,netware1,alhimik,19801984,nicole123,19761977,51501984,malaka1,montella,peachfuz,jethro1,cypress1,henkie,holdon,esmith,55443322,1friend,quique,bandicoot,statistika,great123,death13,ucht36,master4,67899876,bobsmith,nikko1,jr1234,hillary1,78978978,rsturbo,lzlzdfcz,bloodlust,shadow00,skagen,bambina,yummies,88887777,91328378,matthew4,itdoes,98256518,102938475,alina2002,123123789,fubared,dannys,123456321,nikifor,suck69,newmexico,scubaman,rhbcnb,fifnfy,puffdadd,159357852,dtheyxbr,theman22,212009164,prohor,shirle,nji90okm,newmedia,goose5,roma1995,letssee,iceman11,aksana,wirenut,pimpdady,1212312121,tamplier,pelican1,domodedovo,1928374655,fiction6,duckpond,ybrecz,thwack,onetwo34,gunsmith,murphydo,fallout1,spectre1,jabberwo,jgjesq,turbo6,bobo12,redryder,blackpus,elena1971,danilova,antoin,bobo1234,bobob,bobbobbo,dean1,222222a,jesusgod,matt23,musical1,darkmage,loppol,werrew,josepha,rebel12,toshka,gadfly,hawkwood,alina12,dnomyar,sexaddict,dangit,cool23,yocrack,archimed,farouk,nhfkzkz,lindalou,111zzzzz,ghjatccjh,wethepeople,m123456789,wowsers,kbkbxrf,bulldog5,m_roesel,sissinit,yamoon6,123ewqasd,dangel,miruvor79,kaytee,falcon7,bandit11,dotnet,dannii,arsenal9,miatamx5,1trouble,strip4me,dogpile,sexyred1,rjdfktdf,google10,shortman,crystal7,awesome123,cowdog,haruka,birthday28,jitter,diabolik,boomer12,dknight,bluewate,hockey123,crm0624,blueboys,willy123,jumpup,google2,cobra777,llabesab,vicelord,hopper1,gerryber,remmah,j10e5d4,qqqqqqw,agusti,fre_ak8yj,nahlik,redrobin,scott3,epson1,dumpy,bundao,aniolek,hola123,jergens,itsasecret,maxsam,bluelight,mountai1,bongwater,1london,pepper14,freeuse,dereks,qweqw,fordgt40,rfhfdfy,raider12,hunnybun,compac,splicer,megamon,tuffgong,gymnast1,butter11,modaddy,wapbbs_1,dandelio,soccer77,ghjnbdjcnjzybt,123xyi2,fishead,x002tp00,whodaman,555aaa,oussama,brunodog,technici,pmtgjnbl,qcxdw8ry,schweden,redsox3,throbber,collecto,japan10,dbm123dm,hellhoun,tech1,deadzone,kahlan,wolf123,dethklok,xzsawq,bigguy1,cybrthc,chandle,buck01,qq123123,secreta,williams1,c32649135,delta12,flash33,123joker,spacejam,polopo,holycrap,daman1,tummybed,financia,nusrat,euroline,magicone,jimkirk,ameritec,daniel26,sevenn,topazz,kingpins,dima1991,macdog,spencer5,oi812,geoffre,music11,baffle,123569,usagi,cassiope,polla,lilcrowe,thecakeisalie,vbhjndjhtw,vthokies,oldmans,sophie01,ghoster,penny2,129834,locutus1,meesha,magik,jerry69,daddysgirl,irondesk,andrey12,jasmine123,vepsrfyn,likesdick,1accord,jetboat,grafix,tomuch,showit,protozoa,mosias98,taburetka,blaze420,esenin,anal69,zhv84kv,puissant,charles0,aishwarya,babylon6,bitter1,lenina,raleigh1,lechat,access01,kamilka,fynjy,sparkplu,daisy3112,choppe,zootsuit,1234567j,rubyrose,gorilla9,nightshade,alternativa,cghfdjxybr,snuggles1,10121v,vova1992,leonardo1,dave2,matthewd,vfhfnbr,1986mets,nobull,bacall,mexican1,juanjo,mafia1,boomer22,soylent,edwards1,jordan10,blackwid,alex86,gemini13,lunar2,dctvcjcfnm,malaki,plugger,eagles11,snafu2,1shelly,cintaku,hannah22,tbird1,maks5843,irish88,homer22,amarok,fktrcfylhjdf,lincoln2,acess,gre69kik,need4speed,hightech,core2duo,blunt1,ublhjgjybrf,dragon33,1autopas,autopas1,wwww1,15935746,daniel20,2500aa,massim,1ggggggg,96ford,hardcor1,cobra5,blackdragon,vovan_lt,orochimaru,hjlbntkb,qwertyuiop12,tallen,paradoks,frozenfish,ghjuhfvvbcn,gerri1,nuggett,camilit,doright,trans1,serena1,catch2,bkmyeh,fireston,afhvfwtdn,purple3,figure8,fuckya,scamp1,laranja,ontheoutside,louis123,yellow7,moonwalk,mercury2,tolkein,raide,amenra,a13579,dranreb,5150vh,harish,tracksta,sexking,ozzmosis,katiee,alomar,matrix19,headroom,jahlove,ringding,apollo8,132546,132613,12345672000,saretta,135798,136666,thomas7,136913,onetwothree,hockey33,calida,nefertit,bitwise,tailhook,boop4,kfgecbr,bujhmbujhm,metal69,thedark,meteoro,felicia1,house12,tinuviel,istina,vaz2105,pimp13,toolfan,nina1,tuesday2,maxmotives,lgkp500,locksley,treech,darling1,kurama,aminka,ramin,redhed,dazzler,jager1,stpiliot,cardman,rfvtym,cheeser,14314314,paramoun,samcat,plumpy,stiffie,vsajyjr,panatha,qqq777,car12345,098poi,asdzx,keegan1,furelise,kalifornia,vbhjckfd,beast123,zcfvfzkexifz,harry5,1birdie,96328i,escola,extra330,henry12,gfhfyjqz,14u2nv,max1234,templar1,1dave,02588520,catrin,pangolin,marhaba,latin1,amorcito,dave22,escape1,advance1,yasuhiro,grepw,meetme,orange01,ernes,erdna,zsergn,nautica1,justinb,soundwav,miasma,greg78,nadine1,sexmad,lovebaby,promo1,excel1,babys,dragonma,camry1,sonnenschein,farooq,wazzkaprivet,magal,katinas,elvis99,redsox24,rooney1,chiefy,peggys,aliev,pilsung,mudhen,dontdoit,dennis12,supercal,energia,ballsout,funone,claudiu,brown2,amoco,dabl1125,philos,gjdtkbntkm,servette,13571113,whizzer,nollie,13467982,upiter,12string,bluejay1,silkie,william4,kosta1,143333,connor12,sustanon,06068,corporat,ssnake,laurita,king10,tahoes,arsenal123,sapato,charless,jeanmarc,levent,algerie,marine21,jettas,winsome,dctvgbplf,1701ab,xxxp455w0rd5,lllllll1,ooooooo1,monalis,koufax32,anastasya,debugger,sarita2,jason69,ufkxjyjr,gjlcnfdf,1jerry,daniel10,balinor,sexkitten,death2,qwertasdfgzxcvb,s9te949f,vegeta1,sysman,maxxam,dimabilan,mooose,ilovetit,june23,illest,doesit,mamou,abby12,longjump,transalp,moderato,littleguy,magritte,dilnoza,hawaiiguy,winbig,nemiroff,kokaine,admira,myemail,dream2,browneyes,destiny7,dragonss,suckme1,asa123,andranik,suckem,fleshbot,dandie,timmys,scitra,timdog,hasbeen,guesss,smellyfe,arachne,deutschl,harley88,birthday27,nobody1,papasmur,home1,jonass,bunia3,epatb1,embalm,vfvekmrf,apacer,12345656,estreet,weihnachtsbaum,mrwhite,admin12,kristie1,kelebek,yoda69,socken,tima123,bayern1,fktrcfylth,tamiya,99strenght,andy01,denis2011,19delta,stokecit,aotearoa,stalker2,nicnac,conrad1,popey,agusta,bowl36,1bigfish,mossyoak,1stunner,getinnow,jessejames,gkfnjy,drako,1nissan,egor123,hotness,1hawaii,zxc123456,cantstop,1peaches,madlen,west1234,jeter1,markis,judit,attack1,artemi,silver69,153246,crazy2,green9,yoshimi,1vette,chief123,jasper2,1sierra,twentyon,drstrang,aspirant,yannic,jenna123,bongtoke,slurpy,1sugar,civic97,rusty21,shineon,james19,anna12345,wonderwoman,1kevin,karol1,kanabis,wert21,fktif6115,evil1,kakaha,54gv768,826248s,tyrone1,1winston,sugar2,falcon01,adelya,mopar440,zasxcd,leecher,kinkysex,mercede1,travka,11234567,rebon,geekboy".split(","), +english_wikipedia:"the,of,and,in,was,is,for,as,on,with,by,he,at,from,his,an,were,are,which,doc,https,also,or,has,had,first,one,their,its,after,new,who,they,two,her,she,been,other,when,time,during,there,into,school,more,may,years,over,only,year,most,would,world,city,some,where,between,later,three,state,such,then,national,used,made,known,under,many,university,united,while,part,season,team,these,american,than,film,second,born,south,became,states,war,through,being,including,both,before,north,high,however,people,family,early,history,album,area,them,series,against,until,since,district,county,name,work,life,group,music,following,number,company,several,four,called,played,released,career,league,game,government,house,each,based,day,same,won,use,station,club,international,town,located,population,general,college,east,found,age,march,end,september,began,home,public,church,line,june,river,member,system,place,century,band,july,york,january,october,song,august,best,former,british,party,named,held,village,show,local,november,took,service,december,built,another,major,within,along,members,five,single,due,although,small,old,left,final,large,include,building,served,president,received,games,death,february,main,third,set,children,own,order,species,park,law,air,published,road,died,book,men,women,army,often,according,education,central,country,division,english,top,included,development,french,community,among,water,play,side,list,times,near,late,form,original,different,center,power,led,students,german,moved,court,six,land,council,island,u.s.,record,million,research,art,established,award,street,military,television,given,region,support,western,production,non,political,point,cup,period,business,title,started,various,election,using,england,role,produced,become,program,works,field,total,office,class,written,association,radio,union,level,championship,director,few,force,created,department,founded,services,married,though,per,n't,site,open,act,short,society,version,royal,present,northern,worked,professional,full,returned,joined,story,france,european,currently,language,social,california,india,days,design,st.,further,round,australia,wrote,san,project,control,southern,railway,board,popular,continued,free,battle,considered,video,common,position,living,half,playing,recorded,red,post,described,average,records,special,modern,appeared,announced,areas,rock,release,elected,others,example,term,opened,similar,formed,route,census,current,schools,originally,lake,developed,race,himself,forces,addition,information,upon,province,match,event,songs,result,events,win,eastern,track,lead,teams,science,human,construction,minister,germany,awards,available,throughout,training,style,body,museum,australian,health,seven,signed,chief,eventually,appointed,sea,centre,debut,tour,points,media,light,range,character,across,features,families,largest,indian,network,less,performance,players,refer,europe,sold,festival,usually,taken,despite,designed,committee,process,return,official,episode,institute,stage,followed,performed,japanese,personal,thus,arts,space,low,months,includes,china,study,middle,magazine,leading,japan,groups,aircraft,featured,federal,civil,rights,model,coach,canadian,books,remained,eight,type,independent,completed,capital,academy,instead,kingdom,organization,countries,studies,competition,sports,size,above,section,finished,gold,involved,reported,management,systems,industry,directed,market,fourth,movement,technology,bank,ground,campaign,base,lower,sent,rather,added,provided,coast,grand,historic,valley,conference,bridge,winning,approximately,films,chinese,awarded,degree,russian,shows,native,female,replaced,municipality,square,studio,medical,data,african,successful,mid,bay,attack,previous,operations,spanish,theatre,student,republic,beginning,provide,ship,primary,owned,writing,tournament,culture,introduced,texas,related,natural,parts,governor,reached,ireland,units,senior,decided,italian,whose,higher,africa,standard,income,professor,placed,regional,los,buildings,championships,active,novel,energy,generally,interest,via,economic,previously,stated,itself,channel,below,operation,leader,traditional,trade,structure,limited,runs,prior,regular,famous,saint,navy,foreign,listed,artist,catholic,airport,results,parliament,collection,unit,officer,goal,attended,command,staff,commission,lived,location,plays,commercial,places,foundation,significant,older,medal,self,scored,companies,highway,activities,programs,wide,musical,notable,library,numerous,paris,towards,individual,allowed,plant,property,annual,contract,whom,highest,initially,required,earlier,assembly,artists,rural,seat,practice,defeated,ended,soviet,length,spent,manager,press,associated,author,issues,additional,characters,lord,zealand,policy,engine,township,noted,historical,complete,financial,religious,mission,contains,nine,recent,represented,pennsylvania,administration,opening,secretary,lines,report,executive,youth,closed,theory,writer,italy,angeles,appearance,feature,queen,launched,legal,terms,entered,issue,edition,singer,greek,majority,background,source,anti,cultural,complex,changes,recording,stadium,islands,operated,particularly,basketball,month,uses,port,castle,mostly,names,fort,selected,increased,status,earth,subsequently,pacific,cover,variety,certain,goals,remains,upper,congress,becoming,studied,irish,nature,particular,loss,caused,chart,dr.,forced,create,era,retired,material,review,rate,singles,referred,larger,individuals,shown,provides,products,speed,democratic,poland,parish,olympics,cities,themselves,temple,wing,genus,households,serving,cost,wales,stations,passed,supported,view,cases,forms,actor,male,matches,males,stars,tracks,females,administrative,median,effect,biography,train,engineering,camp,offered,chairman,houses,mainly,19th,surface,therefore,nearly,score,ancient,subject,prime,seasons,claimed,experience,specific,jewish,failed,overall,believed,plot,troops,greater,spain,consists,broadcast,heavy,increase,raised,separate,campus,1980s,appears,presented,lies,composed,recently,influence,fifth,nations,creek,references,elections,britain,double,cast,meaning,earned,carried,producer,latter,housing,brothers,attempt,article,response,border,remaining,nearby,direct,ships,value,workers,politician,academic,label,1970s,commander,rule,fellow,residents,authority,editor,transport,dutch,projects,responsible,covered,territory,flight,races,defense,tower,emperor,albums,facilities,daily,stories,assistant,managed,primarily,quality,function,proposed,distribution,conditions,prize,journal,code,vice,newspaper,corps,highly,constructed,mayor,critical,secondary,corporation,rugby,regiment,ohio,appearances,serve,allow,nation,multiple,discovered,directly,scene,levels,growth,elements,acquired,1990s,officers,physical,20th,latin,host,jersey,graduated,arrived,issued,literature,metal,estate,vote,immediately,quickly,asian,competed,extended,produce,urban,1960s,promoted,contemporary,global,formerly,appear,industrial,types,opera,ministry,soldiers,commonly,mass,formation,smaller,typically,drama,shortly,density,senate,effects,iran,polish,prominent,naval,settlement,divided,basis,republican,languages,distance,treatment,continue,product,mile,sources,footballer,format,clubs,leadership,initial,offers,operating,avenue,officially,columbia,grade,squadron,fleet,percent,farm,leaders,agreement,likely,equipment,website,mount,grew,method,transferred,intended,renamed,iron,asia,reserve,capacity,politics,widely,activity,advanced,relations,scottish,dedicated,crew,founder,episodes,lack,amount,build,efforts,concept,follows,ordered,leaves,positive,economy,entertainment,affairs,memorial,ability,illinois,communities,color,text,railroad,scientific,focus,comedy,serves,exchange,environment,cars,direction,organized,firm,description,agency,analysis,purpose,destroyed,reception,planned,revealed,infantry,architecture,growing,featuring,household,candidate,removed,situated,models,knowledge,solo,technical,organizations,assigned,conducted,participated,largely,purchased,register,gained,combined,headquarters,adopted,potential,protection,scale,approach,spread,independence,mountains,titled,geography,applied,safety,mixed,accepted,continues,captured,rail,defeat,principal,recognized,lieutenant,mentioned,semi,owner,joint,liberal,actress,traffic,creation,basic,notes,unique,supreme,declared,simply,plants,sales,massachusetts,designated,parties,jazz,compared,becomes,resources,titles,concert,learning,remain,teaching,versions,content,alongside,revolution,sons,block,premier,impact,champions,districts,generation,estimated,volume,image,sites,account,roles,sport,quarter,providing,zone,yard,scoring,classes,presence,performances,representatives,hosted,split,taught,origin,olympic,claims,critics,facility,occurred,suffered,municipal,damage,defined,resulted,respectively,expanded,platform,draft,opposition,expected,educational,ontario,climate,reports,atlantic,surrounding,performing,reduced,ranked,allows,birth,nominated,younger,newly,kong,positions,theater,philadelphia,heritage,finals,disease,sixth,laws,reviews,constitution,tradition,swedish,theme,fiction,rome,medicine,trains,resulting,existing,deputy,environmental,labour,classical,develop,fans,granted,receive,alternative,begins,nuclear,fame,buried,connected,identified,palace,falls,letters,combat,sciences,effort,villages,inspired,regions,towns,conservative,chosen,animals,labor,attacks,materials,yards,steel,representative,orchestra,peak,entitled,officials,returning,reference,northwest,imperial,convention,examples,ocean,publication,painting,subsequent,frequently,religion,brigade,fully,sides,acts,cemetery,relatively,oldest,suggested,succeeded,achieved,application,programme,cells,votes,promotion,graduate,armed,supply,flying,communist,figures,literary,netherlands,korea,worldwide,citizens,1950s,faculty,draw,stock,seats,occupied,methods,unknown,articles,claim,holds,authorities,audience,sweden,interview,obtained,covers,settled,transfer,marked,allowing,funding,challenge,southeast,unlike,crown,rise,portion,transportation,sector,phase,properties,edge,tropical,standards,institutions,philosophy,legislative,hills,brand,fund,conflict,unable,founding,refused,attempts,metres,permanent,starring,applications,creating,effective,aired,extensive,employed,enemy,expansion,billboard,rank,battalion,multi,vehicle,fought,alliance,category,perform,federation,poetry,bronze,bands,entry,vehicles,bureau,maximum,billion,trees,intelligence,greatest,screen,refers,commissioned,gallery,injury,confirmed,setting,treaty,adult,americans,broadcasting,supporting,pilot,mobile,writers,programming,existence,squad,minnesota,copies,korean,provincial,sets,defence,offices,agricultural,internal,core,northeast,retirement,factory,actions,prevent,communications,ending,weekly,containing,functions,attempted,interior,weight,bowl,recognition,incorporated,increasing,ultimately,documentary,derived,attacked,lyrics,mexican,external,churches,centuries,metropolitan,selling,opposed,personnel,mill,visited,presidential,roads,pieces,norwegian,controlled,18th,rear,influenced,wrestling,weapons,launch,composer,locations,developing,circuit,specifically,studios,shared,canal,wisconsin,publishing,approved,domestic,consisted,determined,comic,establishment,exhibition,southwest,fuel,electronic,cape,converted,educated,melbourne,hits,wins,producing,norway,slightly,occur,surname,identity,represent,constituency,funds,proved,links,structures,athletic,birds,contest,users,poet,institution,display,receiving,rare,contained,guns,motion,piano,temperature,publications,passenger,contributed,toward,cathedral,inhabitants,architect,exist,athletics,muslim,courses,abandoned,signal,successfully,disambiguation,tennessee,dynasty,heavily,maryland,jews,representing,budget,weather,missouri,introduction,faced,pair,chapel,reform,height,vietnam,occurs,motor,cambridge,lands,focused,sought,patients,shape,invasion,chemical,importance,communication,selection,regarding,homes,voivodeship,maintained,borough,failure,aged,passing,agriculture,oregon,teachers,flow,philippines,trail,seventh,portuguese,resistance,reaching,negative,fashion,scheduled,downtown,universities,trained,skills,scenes,views,notably,typical,incident,candidates,engines,decades,composition,commune,chain,inc.,austria,sale,values,employees,chamber,regarded,winners,registered,task,investment,colonial,swiss,user,entirely,flag,stores,closely,entrance,laid,journalist,coal,equal,causes,turkish,quebec,techniques,promote,junction,easily,dates,kentucky,singapore,residence,violence,advance,survey,humans,expressed,passes,streets,distinguished,qualified,folk,establish,egypt,artillery,visual,improved,actual,finishing,medium,protein,switzerland,productions,operate,poverty,neighborhood,organisation,consisting,consecutive,sections,partnership,extension,reaction,factor,costs,bodies,device,ethnic,racial,flat,objects,chapter,improve,musicians,courts,controversy,membership,merged,wars,expedition,interests,arab,comics,gain,describes,mining,bachelor,crisis,joining,decade,1930s,distributed,habitat,routes,arena,cycle,divisions,briefly,vocals,directors,degrees,object,recordings,installed,adjacent,demand,voted,causing,businesses,ruled,grounds,starred,drawn,opposite,stands,formal,operates,persons,counties,compete,wave,israeli,ncaa,resigned,brief,greece,combination,demographics,historian,contain,commonwealth,musician,collected,argued,louisiana,session,cabinet,parliamentary,electoral,loan,profit,regularly,conservation,islamic,purchase,17th,charts,residential,earliest,designs,paintings,survived,moth,items,goods,grey,anniversary,criticism,images,discovery,observed,underground,progress,additionally,participate,thousands,reduce,elementary,owners,stating,iraq,resolution,capture,tank,rooms,hollywood,finance,queensland,reign,maintain,iowa,landing,broad,outstanding,circle,path,manufacturing,assistance,sequence,gmina,crossing,leads,universal,shaped,kings,attached,medieval,ages,metro,colony,affected,scholars,oklahoma,coastal,soundtrack,painted,attend,definition,meanwhile,purposes,trophy,require,marketing,popularity,cable,mathematics,mississippi,represents,scheme,appeal,distinct,factors,acid,subjects,roughly,terminal,economics,senator,diocese,prix,contrast,argentina,czech,wings,relief,stages,duties,16th,novels,accused,whilst,equivalent,charged,measure,documents,couples,request,danish,defensive,guide,devices,statistics,credited,tries,passengers,allied,frame,puerto,peninsula,concluded,instruments,wounded,differences,associate,forests,afterwards,replace,requirements,aviation,solution,offensive,ownership,inner,legislation,hungarian,contributions,actors,translated,denmark,steam,depending,aspects,assumed,injured,severe,admitted,determine,shore,technique,arrival,measures,translation,debuted,delivered,returns,rejected,separated,visitors,damaged,storage,accompanied,markets,industries,losses,gulf,charter,strategy,corporate,socialist,somewhat,significantly,physics,mounted,satellite,experienced,constant,relative,pattern,restored,belgium,connecticut,partners,harvard,retained,networks,protected,mode,artistic,parallel,collaboration,debate,involving,journey,linked,salt,authors,components,context,occupation,requires,occasionally,policies,tamil,ottoman,revolutionary,hungary,poem,versus,gardens,amongst,audio,makeup,frequency,meters,orthodox,continuing,suggests,legislature,coalition,guitarist,eighth,classification,practices,soil,tokyo,instance,limit,coverage,considerable,ranking,colleges,cavalry,centers,daughters,twin,equipped,broadway,narrow,hosts,rates,domain,boundary,arranged,12th,whereas,brazilian,forming,rating,strategic,competitions,trading,covering,baltimore,commissioner,infrastructure,origins,replacement,praised,disc,collections,expression,ukraine,driven,edited,austrian,solar,ensure,premiered,successor,wooden,operational,hispanic,concerns,rapid,prisoners,childhood,meets,influential,tunnel,employment,tribe,qualifying,adapted,temporary,celebrated,appearing,increasingly,depression,adults,cinema,entering,laboratory,script,flows,romania,accounts,fictional,pittsburgh,achieve,monastery,franchise,formally,tools,newspapers,revival,sponsored,processes,vienna,springs,missions,classified,13th,annually,branches,lakes,gender,manner,advertising,normally,maintenance,adding,characteristics,integrated,decline,modified,strongly,critic,victims,malaysia,arkansas,nazi,restoration,powered,monument,hundreds,depth,15th,controversial,admiral,criticized,brick,honorary,initiative,output,visiting,birmingham,progressive,existed,carbon,1920s,credits,colour,rising,hence,defeating,superior,filmed,listing,column,surrounded,orleans,principles,territories,struck,participation,indonesia,movements,index,commerce,conduct,constitutional,spiritual,ambassador,vocal,completion,edinburgh,residing,tourism,finland,bears,medals,resident,themes,visible,indigenous,involvement,basin,electrical,ukrainian,concerts,boats,styles,processing,rival,drawing,vessels,experimental,declined,touring,supporters,compilation,coaching,cited,dated,roots,string,explained,transit,traditionally,poems,minimum,representation,14th,releases,effectively,architectural,triple,indicated,greatly,elevation,clinical,printed,10th,proposal,peaked,producers,romanized,rapidly,stream,innings,meetings,counter,householder,honour,lasted,agencies,document,exists,surviving,experiences,honors,landscape,hurricane,harbor,panel,competing,profile,vessel,farmers,lists,revenue,exception,customers,11th,participants,wildlife,utah,bible,gradually,preserved,replacing,symphony,begun,longest,siege,provinces,mechanical,genre,transmission,agents,executed,videos,benefits,funded,rated,instrumental,ninth,similarly,dominated,destruction,passage,technologies,thereafter,outer,facing,affiliated,opportunities,instrument,governments,scholar,evolution,channels,shares,sessions,widespread,occasions,engineers,scientists,signing,battery,competitive,alleged,eliminated,supplies,judges,hampshire,regime,portrayed,penalty,taiwan,denied,submarine,scholarship,substantial,transition,victorian,http,nevertheless,filed,supports,continental,tribes,ratio,doubles,useful,honours,blocks,principle,retail,departure,ranks,patrol,yorkshire,vancouver,inter,extent,afghanistan,strip,railways,component,organ,symbol,categories,encouraged,abroad,civilian,periods,traveled,writes,struggle,immediate,recommended,adaptation,egyptian,graduating,assault,drums,nomination,historically,voting,allies,detailed,achievement,percentage,arabic,assist,frequent,toured,apply,and/or,intersection,maine,touchdown,throne,produces,contribution,emerged,obtain,archbishop,seek,researchers,remainder,populations,clan,finnish,overseas,fifa,licensed,chemistry,festivals,mediterranean,injuries,animated,seeking,publisher,volumes,limits,venue,jerusalem,generated,trials,islam,youngest,ruling,glasgow,germans,songwriter,persian,municipalities,donated,viewed,belgian,cooperation,posted,tech,dual,volunteer,settlers,commanded,claiming,approval,delhi,usage,terminus,partly,electricity,locally,editions,premiere,absence,belief,traditions,statue,indicate,manor,stable,attributed,possession,managing,viewers,chile,overview,seed,regulations,essential,minority,cargo,segment,endemic,forum,deaths,monthly,playoffs,erected,practical,machines,suburb,relation,mrs.,descent,indoor,continuous,characterized,solutions,caribbean,rebuilt,serbian,summary,contested,psychology,pitch,attending,muhammad,tenure,drivers,diameter,assets,venture,punk,airlines,concentration,athletes,volunteers,pages,mines,influences,sculpture,protest,ferry,behalf,drafted,apparent,furthermore,ranging,romanian,democracy,lanka,significance,linear,d.c.,certified,voters,recovered,tours,demolished,boundaries,assisted,identify,grades,elsewhere,mechanism,1940s,reportedly,aimed,conversion,suspended,photography,departments,beijing,locomotives,publicly,dispute,magazines,resort,conventional,platforms,internationally,capita,settlements,dramatic,derby,establishing,involves,statistical,implementation,immigrants,exposed,diverse,layer,vast,ceased,connections,belonged,interstate,uefa,organised,abuse,deployed,cattle,partially,filming,mainstream,reduction,automatic,rarely,subsidiary,decides,merger,comprehensive,displayed,amendment,guinea,exclusively,manhattan,concerning,commons,radical,serbia,baptist,buses,initiated,portrait,harbour,choir,citizen,sole,unsuccessful,manufactured,enforcement,connecting,increases,patterns,sacred,muslims,clothing,hindu,unincorporated,sentenced,advisory,tanks,campaigns,fled,repeated,remote,rebellion,implemented,texts,fitted,tribute,writings,sufficient,ministers,21st,devoted,jurisdiction,coaches,interpretation,pole,businessman,peru,sporting,prices,cuba,relocated,opponent,arrangement,elite,manufacturer,responded,suitable,distinction,calendar,dominant,tourist,earning,prefecture,ties,preparation,anglo,pursue,worship,archaeological,chancellor,bangladesh,scores,traded,lowest,horror,outdoor,biology,commented,specialized,loop,arriving,farming,housed,historians,'the,patent,pupils,christianity,opponents,athens,northwestern,maps,promoting,reveals,flights,exclusive,lions,norfolk,hebrew,extensively,eldest,shops,acquisition,virtual,renowned,margin,ongoing,essentially,iranian,alternate,sailed,reporting,conclusion,originated,temperatures,exposure,secured,landed,rifle,framework,identical,martial,focuses,topics,ballet,fighters,belonging,wealthy,negotiations,evolved,bases,oriented,acres,democrat,heights,restricted,vary,graduation,aftermath,chess,illness,participating,vertical,collective,immigration,demonstrated,leaf,completing,organic,missile,leeds,eligible,grammar,confederate,improvement,congressional,wealth,cincinnati,spaces,indicates,corresponding,reaches,repair,isolated,taxes,congregation,ratings,leagues,diplomatic,submitted,winds,awareness,photographs,maritime,nigeria,accessible,animation,restaurants,philippine,inaugural,dismissed,armenian,illustrated,reservoir,speakers,programmes,resource,genetic,interviews,camps,regulation,computers,preferred,travelled,comparison,distinctive,recreation,requested,southeastern,dependent,brisbane,breeding,playoff,expand,bonus,gauge,departed,qualification,inspiration,shipping,slaves,variations,shield,theories,munich,recognised,emphasis,favour,variable,seeds,undergraduate,territorial,intellectual,qualify,mini,banned,pointed,democrats,assessment,judicial,examination,attempting,objective,partial,characteristic,hardware,pradesh,execution,ottawa,metre,drum,exhibitions,withdrew,attendance,phrase,journalism,logo,measured,error,christians,trio,protestant,theology,respective,atmosphere,buddhist,substitute,curriculum,fundamental,outbreak,rabbi,intermediate,designation,globe,liberation,simultaneously,diseases,experiments,locomotive,difficulties,mainland,nepal,relegated,contributing,database,developments,veteran,carries,ranges,instruction,lodge,protests,obama,newcastle,experiment,physician,describing,challenges,corruption,delaware,adventures,ensemble,succession,renaissance,tenth,altitude,receives,approached,crosses,syria,croatia,warsaw,professionals,improvements,worn,airline,compound,permitted,preservation,reducing,printing,scientist,activist,comprises,sized,societies,enters,ruler,gospel,earthquake,extend,autonomous,croatian,serial,decorated,relevant,ideal,grows,grass,tier,towers,wider,welfare,columns,alumni,descendants,interface,reserves,banking,colonies,manufacturers,magnetic,closure,pitched,vocalist,preserve,enrolled,cancelled,equation,2000s,nickname,bulgaria,heroes,exile,mathematical,demands,input,structural,tube,stem,approaches,argentine,axis,manuscript,inherited,depicted,targets,visits,veterans,regard,removal,efficiency,organisations,concepts,lebanon,manga,petersburg,rally,supplied,amounts,yale,tournaments,broadcasts,signals,pilots,azerbaijan,architects,enzyme,literacy,declaration,placing,batting,incumbent,bulgarian,consistent,poll,defended,landmark,southwestern,raid,resignation,travels,casualties,prestigious,namely,aims,recipient,warfare,readers,collapse,coached,controls,volleyball,coup,lesser,verse,pairs,exhibited,proteins,molecular,abilities,integration,consist,aspect,advocate,administered,governing,hospitals,commenced,coins,lords,variation,resumed,canton,artificial,elevated,palm,difficulty,civic,efficient,northeastern,inducted,radiation,affiliate,boards,stakes,byzantine,consumption,freight,interaction,oblast,numbered,seminary,contracts,extinct,predecessor,bearing,cultures,functional,neighboring,revised,cylinder,grants,narrative,reforms,athlete,tales,reflect,presidency,compositions,specialist,cricketer,founders,sequel,widow,disbanded,associations,backed,thereby,pitcher,commanding,boulevard,singers,crops,militia,reviewed,centres,waves,consequently,fortress,tributary,portions,bombing,excellence,nest,payment,mars,plaza,unity,victories,scotia,farms,nominations,variant,attacking,suspension,installation,graphics,estates,comments,acoustic,destination,venues,surrender,retreat,libraries,quarterback,customs,berkeley,collaborated,gathered,syndrome,dialogue,recruited,shanghai,neighbouring,psychological,saudi,moderate,exhibit,innovation,depot,binding,brunswick,situations,certificate,actively,shakespeare,editorial,presentation,ports,relay,nationalist,methodist,archives,experts,maintains,collegiate,bishops,maintaining,temporarily,embassy,essex,wellington,connects,reformed,bengal,recalled,inches,doctrine,deemed,legendary,reconstruction,statements,palestinian,meter,achievements,riders,interchange,spots,auto,accurate,chorus,dissolved,missionary,thai,operators,e.g.,generations,failing,delayed,cork,nashville,perceived,venezuela,cult,emerging,tomb,abolished,documented,gaining,canyon,episcopal,stored,assists,compiled,kerala,kilometers,mosque,grammy,theorem,unions,segments,glacier,arrives,theatrical,circulation,conferences,chapters,displays,circular,authored,conductor,fewer,dimensional,nationwide,liga,yugoslavia,peer,vietnamese,fellowship,armies,regardless,relating,dynamic,politicians,mixture,serie,somerset,imprisoned,posts,beliefs,beta,layout,independently,electronics,provisions,fastest,logic,headquartered,creates,challenged,beaten,appeals,plains,protocol,graphic,accommodate,iraqi,midfielder,span,commentary,freestyle,reflected,palestine,lighting,burial,virtually,backing,prague,tribal,heir,identification,prototype,criteria,dame,arch,tissue,footage,extending,procedures,predominantly,updated,rhythm,preliminary,cafe,disorder,prevented,suburbs,discontinued,retiring,oral,followers,extends,massacre,journalists,conquest,larvae,pronounced,behaviour,diversity,sustained,addressed,geographic,restrictions,voiced,milwaukee,dialect,quoted,grid,nationally,nearest,roster,twentieth,separation,indies,manages,citing,intervention,guidance,severely,migration,artwork,focusing,rivals,trustees,varied,enabled,committees,centered,skating,slavery,cardinals,forcing,tasks,auckland,youtube,argues,colored,advisor,mumbai,requiring,theological,registration,refugees,nineteenth,survivors,runners,colleagues,priests,contribute,variants,workshop,concentrated,creator,lectures,temples,exploration,requirement,interactive,navigation,companion,perth,allegedly,releasing,citizenship,observation,stationed,ph.d.,sheep,breed,discovers,encourage,kilometres,journals,performers,isle,saskatchewan,hybrid,hotels,lancashire,dubbed,airfield,anchor,suburban,theoretical,sussex,anglican,stockholm,permanently,upcoming,privately,receiver,optical,highways,congo,colours,aggregate,authorized,repeatedly,varies,fluid,innovative,transformed,praise,convoy,demanded,discography,attraction,export,audiences,ordained,enlisted,occasional,westminster,syrian,heavyweight,bosnia,consultant,eventual,improving,aires,wickets,epic,reactions,scandal,i.e.,discrimination,buenos,patron,investors,conjunction,testament,construct,encountered,celebrity,expanding,georgian,brands,retain,underwent,algorithm,foods,provision,orbit,transformation,associates,tactical,compact,varieties,stability,refuge,gathering,moreover,manila,configuration,gameplay,discipline,entity,comprising,composers,skill,monitoring,ruins,museums,sustainable,aerial,altered,codes,voyage,friedrich,conflicts,storyline,travelling,conducting,merit,indicating,referendum,currency,encounter,particles,automobile,workshops,acclaimed,inhabited,doctorate,cuban,phenomenon,dome,enrollment,tobacco,governance,trend,equally,manufacture,hydrogen,grande,compensation,download,pianist,grain,shifted,neutral,evaluation,define,cycling,seized,array,relatives,motors,firms,varying,automatically,restore,nicknamed,findings,governed,investigate,manitoba,administrator,vital,integral,indonesian,confusion,publishers,enable,geographical,inland,naming,civilians,reconnaissance,indianapolis,lecturer,deer,tourists,exterior,rhode,bassist,symbols,scope,ammunition,yuan,poets,punjab,nursing,cent,developers,estimates,presbyterian,nasa,holdings,generate,renewed,computing,cyprus,arabia,duration,compounds,gastropod,permit,valid,touchdowns,facade,interactions,mineral,practiced,allegations,consequence,goalkeeper,baronet,copyright,uprising,carved,targeted,competitors,mentions,sanctuary,fees,pursued,tampa,chronicle,capabilities,specified,specimens,toll,accounting,limestone,staged,upgraded,philosophical,streams,guild,revolt,rainfall,supporter,princeton,terrain,hometown,probability,assembled,paulo,surrey,voltage,developer,destroyer,floors,lineup,curve,prevention,potentially,onwards,trips,imposed,hosting,striking,strict,admission,apartments,solely,utility,proceeded,observations,euro,incidents,vinyl,profession,haven,distant,expelled,rivalry,runway,torpedo,zones,shrine,dimensions,investigations,lithuania,idaho,pursuit,copenhagen,considerably,locality,wireless,decrease,genes,thermal,deposits,hindi,habitats,withdrawn,biblical,monuments,casting,plateau,thesis,managers,flooding,assassination,acknowledged,interim,inscription,guided,pastor,finale,insects,transported,activists,marshal,intensity,airing,cardiff,proposals,lifestyle,prey,herald,capitol,aboriginal,measuring,lasting,interpreted,occurring,desired,drawings,healthcare,panels,elimination,oslo,ghana,blog,sabha,intent,superintendent,governors,bankruptcy,p.m.,equity,disk,layers,slovenia,prussia,quartet,mechanics,graduates,politically,monks,screenplay,nato,absorbed,topped,petition,bold,morocco,exhibits,canterbury,publish,rankings,crater,dominican,enhanced,planes,lutheran,governmental,joins,collecting,brussels,unified,streak,strategies,flagship,surfaces,oval,archive,etymology,imprisonment,instructor,noting,remix,opposing,servant,rotation,width,trans,maker,synthesis,excess,tactics,snail,ltd.,lighthouse,sequences,cornwall,plantation,mythology,performs,foundations,populated,horizontal,speedway,activated,performer,diving,conceived,edmonton,subtropical,environments,prompted,semifinals,caps,bulk,treasury,recreational,telegraph,continent,portraits,relegation,catholics,graph,velocity,rulers,endangered,secular,observer,learns,inquiry,idol,dictionary,certification,estimate,cluster,armenia,observatory,revived,nadu,consumers,hypothesis,manuscripts,contents,arguments,editing,trails,arctic,essays,belfast,acquire,promotional,undertaken,corridor,proceedings,antarctic,millennium,labels,delegates,vegetation,acclaim,directing,substance,outcome,diploma,philosopher,malta,albanian,vicinity,degc,legends,regiments,consent,terrorist,scattered,presidents,gravity,orientation,deployment,duchy,refuses,estonia,crowned,separately,renovation,rises,wilderness,objectives,agreements,empress,slopes,inclusion,equality,decree,ballot,criticised,rochester,recurring,struggled,disabled,henri,poles,prussian,convert,bacteria,poorly,sudan,geological,wyoming,consistently,minimal,withdrawal,interviewed,proximity,repairs,initiatives,pakistani,republicans,propaganda,viii,abstract,commercially,availability,mechanisms,naples,discussions,underlying,lens,proclaimed,advised,spelling,auxiliary,attract,lithuanian,editors,o'brien,accordance,measurement,novelist,ussr,formats,councils,contestants,indie,facebook,parishes,barrier,battalions,sponsor,consulting,terrorism,implement,uganda,crucial,unclear,notion,distinguish,collector,attractions,filipino,ecology,investments,capability,renovated,iceland,albania,accredited,scouts,armor,sculptor,cognitive,errors,gaming,condemned,successive,consolidated,baroque,entries,regulatory,reserved,treasurer,variables,arose,technological,rounded,provider,rhine,agrees,accuracy,genera,decreased,frankfurt,ecuador,edges,particle,rendered,calculated,careers,faction,rifles,americas,gaelic,portsmouth,resides,merchants,fiscal,premises,coin,draws,presenter,acceptance,ceremonies,pollution,consensus,membrane,brigadier,nonetheless,genres,supervision,predicted,magnitude,finite,differ,ancestry,vale,delegation,removing,proceeds,placement,emigrated,siblings,molecules,payments,considers,demonstration,proportion,newer,valve,achieving,confederation,continuously,luxury,notre,introducing,coordinates,charitable,squadrons,disorders,geometry,winnipeg,ulster,loans,longtime,receptor,preceding,belgrade,mandate,wrestler,neighbourhood,factories,buddhism,imported,sectors,protagonist,steep,elaborate,prohibited,artifacts,prizes,pupil,cooperative,sovereign,subspecies,carriers,allmusic,nationals,settings,autobiography,neighborhoods,analog,facilitate,voluntary,jointly,newfoundland,organizing,raids,exercises,nobel,machinery,baltic,crop,granite,dense,websites,mandatory,seeks,surrendered,anthology,comedian,bombs,slot,synopsis,critically,arcade,marking,equations,halls,indo,inaugurated,embarked,speeds,clause,invention,premiership,likewise,presenting,demonstrate,designers,organize,examined,km/h,bavaria,troop,referee,detection,zurich,prairie,rapper,wingspan,eurovision,luxembourg,slovakia,inception,disputed,mammals,entrepreneur,makers,evangelical,yield,clergy,trademark,defunct,allocated,depicting,volcanic,batted,conquered,sculptures,providers,reflects,armoured,locals,walt,herzegovina,contracted,entities,sponsorship,prominence,flowing,ethiopia,marketed,corporations,withdraw,carnegie,induced,investigated,portfolio,flowering,opinions,viewing,classroom,donations,bounded,perception,leicester,fruits,charleston,academics,statute,complaints,smallest,deceased,petroleum,resolved,commanders,algebra,southampton,modes,cultivation,transmitter,spelled,obtaining,sizes,acre,pageant,bats,abbreviated,correspondence,barracks,feast,tackles,raja,derives,geology,disputes,translations,counted,constantinople,seating,macedonia,preventing,accommodation,homeland,explored,invaded,provisional,transform,sphere,unsuccessfully,missionaries,conservatives,highlights,traces,organisms,openly,dancers,fossils,absent,monarchy,combining,lanes,stint,dynamics,chains,missiles,screening,module,tribune,generating,miners,nottingham,seoul,unofficial,owing,linking,rehabilitation,citation,louisville,mollusk,depicts,differential,zimbabwe,kosovo,recommendations,responses,pottery,scorer,aided,exceptions,dialects,telecommunications,defines,elderly,lunar,coupled,flown,25th,espn,formula_1,bordered,fragments,guidelines,gymnasium,valued,complexity,papal,presumably,maternal,challenging,reunited,advancing,comprised,uncertain,favorable,twelfth,correspondent,nobility,livestock,expressway,chilean,tide,researcher,emissions,profits,lengths,accompanying,witnessed,itunes,drainage,slope,reinforced,feminist,sanskrit,develops,physicians,outlets,isbn,coordinator,averaged,termed,occupy,diagnosed,yearly,humanitarian,prospect,spacecraft,stems,enacted,linux,ancestors,karnataka,constitute,immigrant,thriller,ecclesiastical,generals,celebrations,enhance,heating,advocated,evident,advances,bombardment,watershed,shuttle,wicket,twitter,adds,branded,teaches,schemes,pension,advocacy,conservatory,cairo,varsity,freshwater,providence,seemingly,shells,cuisine,specially,peaks,intensive,publishes,trilogy,skilled,nacional,unemployment,destinations,parameters,verses,trafficking,determination,infinite,savings,alignment,linguistic,countryside,dissolution,measurements,advantages,licence,subfamily,highlands,modest,regent,algeria,crest,teachings,knockout,brewery,combine,conventions,descended,chassis,primitive,fiji,explicitly,cumberland,uruguay,laboratories,bypass,elect,informal,preceded,holocaust,tackle,minneapolis,quantity,securities,console,doctoral,religions,commissioners,expertise,unveiled,precise,diplomat,standings,infant,disciplines,sicily,endorsed,systematic,charted,armored,mild,lateral,townships,hurling,prolific,invested,wartime,compatible,galleries,moist,battlefield,decoration,convent,tubes,terrestrial,nominee,requests,delegate,leased,dubai,polar,applying,addresses,munster,sings,commercials,teamed,dances,eleventh,midland,cedar,flee,sandstone,snails,inspection,divide,asset,themed,comparable,paramount,dairy,archaeology,intact,institutes,rectangular,instances,phases,reflecting,substantially,applies,vacant,lacked,copa,coloured,encounters,sponsors,encoded,possess,revenues,ucla,chaired,a.m.,enabling,playwright,stoke,sociology,tibetan,frames,motto,financing,illustrations,gibraltar,chateau,bolivia,transmitted,enclosed,persuaded,urged,folded,suffolk,regulated,bros.,submarines,myth,oriental,malaysian,effectiveness,narrowly,acute,sunk,replied,utilized,tasmania,consortium,quantities,gains,parkway,enlarged,sided,employers,adequate,accordingly,assumption,ballad,mascot,distances,peaking,saxony,projected,affiliation,limitations,metals,guatemala,scots,theaters,kindergarten,verb,employer,differs,discharge,controller,seasonal,marching,guru,campuses,avoided,vatican,maori,excessive,chartered,modifications,caves,monetary,sacramento,mixing,institutional,celebrities,irrigation,shapes,broadcaster,anthem,attributes,demolition,offshore,specification,surveys,yugoslav,contributor,auditorium,lebanese,capturing,airports,classrooms,chennai,paths,tendency,determining,lacking,upgrade,sailors,detected,kingdoms,sovereignty,freely,decorative,momentum,scholarly,georges,gandhi,speculation,transactions,undertook,interact,similarities,cove,teammate,constituted,painters,tends,madagascar,partnerships,afghan,personalities,attained,rebounds,masses,synagogue,reopened,asylum,embedded,imaging,catalogue,defenders,taxonomy,fiber,afterward,appealed,communists,lisbon,rica,judaism,adviser,batsman,ecological,commands,lgbt,cooling,accessed,wards,shiva,employs,thirds,scenic,worcester,tallest,contestant,humanities,economist,textile,constituencies,motorway,tram,percussion,cloth,leisure,1880s,baden,flags,resemble,riots,coined,sitcom,composite,implies,daytime,tanzania,penalties,optional,competitor,excluded,steering,reversed,autonomy,reviewer,breakthrough,professionally,damages,pomeranian,deputies,valleys,ventures,highlighted,electorate,mapping,shortened,executives,tertiary,specimen,launching,bibliography,sank,pursuing,binary,descendant,marched,natives,ideology,turks,adolf,archdiocese,tribunal,exceptional,nigerian,preference,fails,loading,comeback,vacuum,favored,alter,remnants,consecrated,spectators,trends,patriarch,feedback,paved,sentences,councillor,astronomy,advocates,broader,commentator,commissions,identifying,revealing,theatres,incomplete,enables,constituent,reformation,tract,haiti,atmospheric,screened,explosive,czechoslovakia,acids,symbolic,subdivision,liberals,incorporate,challenger,erie,filmmaker,laps,kazakhstan,organizational,evolutionary,chemicals,dedication,riverside,fauna,moths,maharashtra,annexed,gen.,resembles,underwater,garnered,timeline,remake,suited,educator,hectares,automotive,feared,latvia,finalist,narrator,portable,airways,plaque,designing,villagers,licensing,flank,statues,struggles,deutsche,migrated,cellular,jacksonville,wimbledon,defining,highlight,preparatory,planets,cologne,employ,frequencies,detachment,readily,libya,resign,halt,helicopters,reef,landmarks,collaborative,irregular,retaining,helsinki,folklore,weakened,viscount,interred,professors,memorable,mega,repertoire,rowing,dorsal,albeit,progressed,operative,coronation,liner,telugu,domains,philharmonic,detect,bengali,synthetic,tensions,atlas,dramatically,paralympics,xbox,shire,kiev,lengthy,sued,notorious,seas,screenwriter,transfers,aquatic,pioneers,unesco,radius,abundant,tunnels,syndicated,inventor,accreditation,janeiro,exeter,ceremonial,omaha,cadet,predators,resided,prose,slavic,precision,abbot,deity,engaging,cambodia,estonian,compliance,demonstrations,protesters,reactor,commodore,successes,chronicles,mare,extant,listings,minerals,tonnes,parody,cultivated,traders,pioneering,supplement,slovak,preparations,collision,partnered,vocational,atoms,malayalam,welcomed,documentation,curved,functioning,presently,formations,incorporates,nazis,botanical,nucleus,ethical,greeks,metric,automated,whereby,stance,europeans,duet,disability,purchasing,email,telescope,displaced,sodium,comparative,processor,inning,precipitation,aesthetic,import,coordination,feud,alternatively,mobility,tibet,regained,succeeding,hierarchy,apostolic,catalog,reproduction,inscriptions,vicar,clusters,posthumously,rican,loosely,additions,photographic,nowadays,selective,derivative,keyboards,guides,collectively,affecting,combines,operas,networking,decisive,terminated,continuity,finishes,ancestor,consul,heated,simulation,leipzig,incorporating,georgetown,formula_2,circa,forestry,portrayal,councillors,advancement,complained,forewings,confined,transaction,definitions,reduces,televised,1890s,rapids,phenomena,belarus,alps,landscapes,quarterly,specifications,commemorate,continuation,isolation,antenna,downstream,patents,ensuing,tended,saga,lifelong,columnist,labeled,gymnastics,papua,anticipated,demise,encompasses,madras,antarctica,interval,icon,rams,midlands,ingredients,priory,strengthen,rouge,explicit,gaza,aging,securing,anthropology,listeners,adaptations,underway,vista,malay,fortified,lightweight,violations,concerto,financed,jesuit,observers,trustee,descriptions,nordic,resistant,opted,accepts,prohibition,andhra,inflation,negro,wholly,imagery,spur,instructed,gloucester,cycles,middlesex,destroyers,statewide,evacuated,hyderabad,peasants,mice,shipyard,coordinate,pitching,colombian,exploring,numbering,compression,countess,hiatus,exceed,raced,archipelago,traits,soils,o'connor,vowel,android,facto,angola,amino,holders,logistics,circuits,emergence,kuwait,partition,emeritus,outcomes,submission,promotes,barack,negotiated,loaned,stripped,50th,excavations,treatments,fierce,participant,exports,decommissioned,cameo,remarked,residences,fuselage,mound,undergo,quarry,node,midwest,specializing,occupies,etc.,showcase,molecule,offs,modules,salon,exposition,revision,peers,positioned,hunters,competes,algorithms,reside,zagreb,calcium,uranium,silicon,airs,counterpart,outlet,collectors,sufficiently,canberra,inmates,anatomy,ensuring,curves,aviv,firearms,basque,volcano,thrust,sheikh,extensions,installations,aluminum,darker,sacked,emphasized,aligned,asserted,pseudonym,spanning,decorations,eighteenth,orbital,spatial,subdivided,notation,decay,macedonian,amended,declining,cyclist,feat,unusually,commuter,birthplace,latitude,activation,overhead,30th,finalists,whites,encyclopedia,tenor,qatar,survives,complement,concentrations,uncommon,astronomical,bangalore,pius,genome,memoir,recruit,prosecutor,modification,paired,container,basilica,arlington,displacement,germanic,mongolia,proportional,debates,matched,calcutta,rows,tehran,aerospace,prevalent,arise,lowland,24th,spokesman,supervised,advertisements,clash,tunes,revelation,wanderers,quarterfinals,fisheries,steadily,memoirs,pastoral,renewable,confluence,acquiring,strips,slogan,upstream,scouting,analyst,practitioners,turbine,strengthened,heavier,prehistoric,plural,excluding,isles,persecution,turin,rotating,villain,hemisphere,unaware,arabs,corpus,relied,singular,unanimous,schooling,passive,angles,dominance,instituted,aria,outskirts,balanced,beginnings,financially,structured,parachute,viewer,attitudes,subjected,escapes,derbyshire,erosion,addressing,styled,declaring,originating,colts,adjusted,stained,occurrence,fortifications,baghdad,nitrogen,localities,yemen,galway,debris,lodz,victorious,pharmaceutical,substances,unnamed,dwelling,atop,developmental,activism,voter,refugee,forested,relates,overlooking,genocide,kannada,insufficient,oversaw,partisan,dioxide,recipients,factions,mortality,capped,expeditions,receptors,reorganized,prominently,atom,flooded,flute,orchestral,scripts,mathematician,airplay,detached,rebuilding,dwarf,brotherhood,salvation,expressions,arabian,cameroon,poetic,recruiting,bundesliga,inserted,scrapped,disabilities,evacuation,pasha,undefeated,crafts,rituals,aluminium,norm,pools,submerged,occupying,pathway,exams,prosperity,wrestlers,promotions,basal,permits,nationalism,trim,merge,gazette,tributaries,transcription,caste,porto,emerge,modeled,adjoining,counterparts,paraguay,redevelopment,renewal,unreleased,equilibrium,similarity,minorities,soviets,comprise,nodes,tasked,unrelated,expired,johan,precursor,examinations,electrons,socialism,exiled,admiralty,floods,wigan,nonprofit,lacks,brigades,screens,repaired,hanover,fascist,labs,osaka,delays,judged,statutory,colt,col.,offspring,solving,bred,assisting,retains,somalia,grouped,corresponds,tunisia,chaplain,eminent,chord,22nd,spans,viral,innovations,possessions,mikhail,kolkata,icelandic,implications,introduces,racism,workforce,alto,compulsory,admits,censorship,onset,reluctant,inferior,iconic,progression,liability,turnout,satellites,behavioral,coordinated,exploitation,posterior,averaging,fringe,krakow,mountainous,greenwich,para,plantations,reinforcements,offerings,famed,intervals,constraints,individually,nutrition,1870s,taxation,threshold,tomatoes,fungi,contractor,ethiopian,apprentice,diabetes,wool,gujarat,honduras,norse,bucharest,23rd,arguably,accompany,prone,teammates,perennial,vacancy,polytechnic,deficit,okinawa,functionality,reminiscent,tolerance,transferring,myanmar,concludes,neighbours,hydraulic,economically,slower,plots,charities,synod,investor,catholicism,identifies,bronx,interpretations,adverse,judiciary,hereditary,nominal,sensor,symmetry,cubic,triangular,tenants,divisional,outreach,representations,passages,undergoing,cartridge,testified,exceeded,impacts,limiting,railroads,defeats,regain,rendering,humid,retreated,reliability,governorate,antwerp,infamous,implied,packaging,lahore,trades,billed,extinction,ecole,rejoined,recognizes,projection,qualifications,stripes,forts,socially,lexington,accurately,sexuality,westward,wikipedia,pilgrimage,abolition,choral,stuttgart,nests,expressing,strikeouts,assessed,monasteries,reconstructed,humorous,marxist,fertile,consort,urdu,patronage,peruvian,devised,lyric,baba,nassau,communism,extraction,popularly,markings,inability,litigation,accounted,processed,emirates,tempo,cadets,eponymous,contests,broadly,oxide,courtyard,frigate,directory,apex,outline,regency,chiefly,patrols,secretariat,cliffs,residency,privy,armament,australians,dorset,geometric,genetics,scholarships,fundraising,flats,demographic,multimedia,captained,documentaries,updates,canvas,blockade,guerrilla,songwriting,administrators,intake,drought,implementing,fraction,cannes,refusal,inscribed,meditation,announcing,exported,ballots,formula_3,curator,basel,arches,flour,subordinate,confrontation,gravel,simplified,berkshire,patriotic,tuition,employing,servers,castile,posting,combinations,discharged,miniature,mutations,constellation,incarnation,ideals,necessity,granting,ancestral,crowds,pioneered,mormon,methodology,rama,indirect,complexes,bavarian,patrons,uttar,skeleton,bollywood,flemish,viable,bloc,breeds,triggered,sustainability,tailed,referenced,comply,takeover,latvian,homestead,platoon,communal,nationality,excavated,targeting,sundays,posed,physicist,turret,endowment,marginal,dispatched,commentators,renovations,attachment,collaborations,ridges,barriers,obligations,shareholders,prof.,defenses,presided,rite,backgrounds,arbitrary,affordable,gloucestershire,thirteenth,inlet,miniseries,possesses,detained,pressures,subscription,realism,solidarity,proto,postgraduate,noun,burmese,abundance,homage,reasoning,anterior,robust,fencing,shifting,vowels,garde,profitable,loch,anchored,coastline,samoa,terminology,prostitution,magistrate,venezuelan,speculated,regulate,fixture,colonists,digit,induction,manned,expeditionary,computational,centennial,principally,vein,preserving,engineered,numerical,cancellation,conferred,continually,borne,seeded,advertisement,unanimously,treaties,infections,ions,sensors,lowered,amphibious,lava,fourteenth,bahrain,niagara,nicaragua,squares,congregations,26th,periodic,proprietary,1860s,contributors,seller,overs,emission,procession,presumed,illustrator,zinc,gases,tens,applicable,stretches,reproductive,sixteenth,apparatus,accomplishments,canoe,guam,oppose,recruitment,accumulated,limerick,namibia,staging,remixes,ordnance,uncertainty,pedestrian,temperate,treason,deposited,registry,cerambycidae,attracting,lankan,reprinted,shipbuilding,homosexuality,neurons,eliminating,1900s,resume,ministries,beneficial,blackpool,surplus,northampton,licenses,constructing,announcer,standardized,alternatives,taipei,inadequate,failures,yields,medalist,titular,obsolete,torah,burlington,predecessors,lublin,retailers,castles,depiction,issuing,gubernatorial,propulsion,tiles,damascus,discs,alternating,pomerania,peasant,tavern,redesignated,27th,illustration,focal,mans,codex,specialists,productivity,antiquity,controversies,promoter,pits,companions,behaviors,lyrical,prestige,creativity,swansea,dramas,approximate,feudal,tissues,crude,campaigned,unprecedented,chancel,amendments,surroundings,allegiance,exchanges,align,firmly,optimal,commenting,reigning,landings,obscure,1850s,contemporaries,paternal,devi,endurance,communes,incorporation,denominations,exchanged,routing,resorts,amnesty,slender,explores,suppression,heats,pronunciation,centred,coupe,stirling,freelance,treatise,linguistics,laos,informs,discovering,pillars,encourages,halted,robots,definitive,maturity,tuberculosis,venetian,silesian,unchanged,originates,mali,lincolnshire,quotes,seniors,premise,contingent,distribute,danube,gorge,logging,dams,curling,seventeenth,specializes,wetlands,deities,assess,thickness,rigid,culminated,utilities,substrate,insignia,nile,assam,shri,currents,suffrage,canadians,mortar,asteroid,bosnian,discoveries,enzymes,sanctioned,replica,hymn,investigators,tidal,dominate,derivatives,converting,leinster,verbs,honoured,criticisms,dismissal,discrete,masculine,reorganization,unlimited,wurttemberg,sacks,allocation,bahn,jurisdictions,participates,lagoon,famine,communion,culminating,surveyed,shortage,cables,intersects,cassette,foremost,adopting,solicitor,outright,bihar,reissued,farmland,dissertation,turnpike,baton,photographed,christchurch,kyoto,finances,rails,histories,linebacker,kilkenny,accelerated,dispersed,handicap,absorption,rancho,ceramic,captivity,cites,font,weighed,mater,utilize,bravery,extract,validity,slovenian,seminars,discourse,ranged,duel,ironically,warships,sega,temporal,surpassed,prolonged,recruits,northumberland,greenland,contributes,patented,eligibility,unification,discusses,reply,translates,beirut,relies,torque,northward,reviewers,monastic,accession,neural,tramway,heirs,sikh,subscribers,amenities,taliban,audit,rotterdam,wagons,kurdish,favoured,combustion,meanings,persia,browser,diagnostic,niger,formula_4,denomination,dividing,parameter,branding,badminton,leningrad,sparked,hurricanes,beetles,propeller,mozambique,refined,diagram,exhaust,vacated,readings,markers,reconciliation,determines,concurrent,imprint,primera,organism,demonstrating,filmmakers,vanderbilt,affiliates,traction,evaluated,defendants,megachile,investigative,zambia,assassinated,rewarded,probable,staffordshire,foreigners,directorate,nominees,consolidation,commandant,reddish,differing,unrest,drilling,bohemia,resembling,instrumentation,considerations,haute,promptly,variously,dwellings,clans,tablet,enforced,cockpit,semifinal,hussein,prisons,ceylon,emblem,monumental,phrases,correspond,crossover,outlined,characterised,acceleration,caucus,crusade,protested,composing,rajasthan,habsburg,rhythmic,interception,inherent,cooled,ponds,spokesperson,gradual,consultation,kuala,globally,suppressed,builders,avengers,suffix,integer,enforce,fibers,unionist,proclamation,uncovered,infrared,adapt,eisenhower,utilizing,captains,stretched,observing,assumes,prevents,analyses,saxophone,caucasus,notices,villains,dartmouth,mongol,hostilities,stretching,veterinary,lenses,texture,prompting,overthrow,excavation,islanders,masovian,battleship,biographer,replay,degradation,departing,luftwaffe,fleeing,oversight,immigrated,serbs,fishermen,strengthening,respiratory,italians,denotes,radial,escorted,motif,wiltshire,expresses,accessories,reverted,establishments,inequality,protocols,charting,famously,satirical,entirety,trench,friction,atletico,sampling,subset,weekday,upheld,sharply,correlation,incorrect,mughal,travelers,hasan,earnings,offset,evaluate,specialised,recognizing,flexibility,nagar,postseason,algebraic,capitalism,crystals,melodies,polynomial,racecourse,defences,austro,wembley,attracts,anarchist,resurrection,reviewing,decreasing,prefix,ratified,mutation,displaying,separating,restoring,assemblies,ordinance,priesthood,cruisers,appoint,moldova,imports,directive,epidemic,militant,senegal,signaling,restriction,critique,retrospective,nationalists,undertake,sioux,canals,algerian,redesigned,philanthropist,depict,conceptual,turbines,intellectuals,eastward,applicants,contractors,vendors,undergone,namesake,ensured,tones,substituted,hindwings,arrests,tombs,transitional,principality,reelection,taiwanese,cavity,manifesto,broadcasters,spawned,thoroughbred,identities,generators,proposes,hydroelectric,johannesburg,cortex,scandinavian,killings,aggression,boycott,catalyst,physiology,fifteenth,waterfront,chromosome,organist,costly,calculation,cemeteries,flourished,recognise,juniors,merging,disciples,ashore,workplace,enlightenment,diminished,debated,hailed,podium,educate,mandated,distributor,litre,electromagnetic,flotilla,estuary,peterborough,staircase,selections,melodic,confronts,wholesale,integrate,intercepted,catalonia,unite,immense,palatinate,switches,earthquakes,occupational,successors,praising,concluding,faculties,firstly,overhaul,empirical,metacritic,inauguration,evergreen,laden,winged,philosophers,amalgamated,geoff,centimeters,napoleonic,upright,planting,brewing,fined,sensory,migrants,wherein,inactive,headmaster,warwickshire,siberia,terminals,denounced,academia,divinity,bilateral,clive,omitted,peerage,relics,apartheid,syndicate,fearing,fixtures,desirable,dismantled,ethnicity,valves,biodiversity,aquarium,ideological,visibility,creators,analyzed,tenant,balkan,postwar,supplier,smithsonian,risen,morphology,digits,bohemian,wilmington,vishnu,demonstrates,aforementioned,biographical,mapped,khorasan,phosphate,presentations,ecosystem,processors,calculations,mosaic,clashes,penned,recalls,coding,angular,lattice,macau,accountability,extracted,pollen,therapeutic,overlap,violinist,deposed,candidacy,infants,covenant,bacterial,restructuring,dungeons,ordination,conducts,builds,invasive,customary,concurrently,relocation,cello,statutes,borneo,entrepreneurs,sanctions,packet,rockefeller,piedmont,comparisons,waterfall,receptions,glacial,surge,signatures,alterations,advertised,enduring,somali,botanist,100th,canonical,motifs,longitude,circulated,alloy,indirectly,margins,preserves,internally,besieged,shale,peripheral,drained,baseman,reassigned,tobago,soloist,socio,grazing,contexts,roofs,portraying,ottomans,shrewsbury,noteworthy,lamps,supplying,beams,qualifier,portray,greenhouse,stronghold,hitter,rites,cretaceous,urging,derive,nautical,aiming,fortunes,verde,donors,reliance,exceeding,exclusion,exercised,simultaneous,continents,guiding,pillar,gradient,poznan,eruption,clinics,moroccan,indicator,trams,piers,parallels,fragment,teatro,potassium,satire,compressed,businessmen,influx,seine,perspectives,shelters,decreases,mounting,formula_5,confederacy,equestrian,expulsion,mayors,liberia,resisted,affinity,shrub,unexpectedly,stimulus,amtrak,deported,perpendicular,statesman,wharf,storylines,romanesque,weights,surfaced,interceptions,dhaka,crambidae,orchestras,rwanda,conclude,constitutes,subsidiaries,admissions,prospective,shear,bilingual,campaigning,presiding,domination,commemorative,trailing,confiscated,petrol,acquisitions,polymer,onlyinclude,chloride,elevations,resolutions,hurdles,pledged,likelihood,objected,erect,encoding,databases,aristotle,hindus,marshes,bowled,ministerial,grange,acronym,annexation,squads,ambient,pilgrims,botany,sofla,astronomer,planetary,descending,bestowed,ceramics,diplomacy,metabolism,colonization,potomac,africans,engraved,recycling,commitments,resonance,disciplinary,jamaican,narrated,spectral,tipperary,waterford,stationary,arbitration,transparency,threatens,crossroads,slalom,oversee,centenary,incidence,economies,livery,moisture,newsletter,autobiographical,bhutan,propelled,dependence,moderately,adobe,barrels,subdivisions,outlook,labelled,stratford,arising,diaspora,barony,automobiles,ornamental,slated,norms,primetime,generalized,analysts,vectors,libyan,yielded,certificates,rooted,vernacular,belarusian,marketplace,prediction,fairfax,malawi,viruses,wooded,demos,mauritius,prosperous,coincided,liberties,huddersfield,ascent,warnings,hinduism,glucose,pulitzer,unused,filters,illegitimate,acquitted,protestants,canopy,staple,psychedelic,winding,abbas,pathways,cheltenham,lagos,niche,invaders,proponents,barred,conversely,doncaster,recession,embraced,rematch,concession,emigration,upgrades,bowls,tablets,remixed,loops,kensington,shootout,monarchs,organizers,harmful,punjabi,broadband,exempt,neolithic,profiles,portrays,parma,cyrillic,quasi,attested,regimental,revive,torpedoes,heidelberg,rhythms,spherical,denote,hymns,icons,theologian,qaeda,exceptionally,reinstated,comune,playhouse,lobbying,grossing,viceroy,delivers,visually,armistice,utrecht,syllable,vertices,analogous,annex,refurbished,entrants,knighted,disciple,rhetoric,detailing,inactivated,ballads,algae,intensified,favourable,sanitation,receivers,pornography,commemorated,cannons,entrusted,manifold,photographers,pueblo,textiles,steamer,myths,marquess,onward,liturgical,romney,uzbekistan,consistency,denoted,hertfordshire,convex,hearings,sulfur,universidad,podcast,selecting,emperors,arises,justices,1840s,mongolian,exploited,termination,digitally,infectious,sedan,symmetric,penal,illustrate,formulation,attribute,problematic,modular,inverse,berth,searches,rutgers,leicestershire,enthusiasts,lockheed,upwards,transverse,accolades,backward,archaeologists,crusaders,nuremberg,defects,ferries,vogue,containers,openings,transporting,separates,lumpur,purchases,attain,wichita,topology,woodlands,deleted,periodically,syntax,overturned,musicals,corp.,strasbourg,instability,nationale,prevailing,cache,marathi,versailles,unmarried,grains,straits,antagonist,segregation,assistants,d'etat,contention,dictatorship,unpopular,motorcycles,criterion,analytical,salzburg,militants,hanged,worcestershire,emphasize,paralympic,erupted,convinces,offences,oxidation,nouns,populace,atari,spanned,hazardous,educators,playable,births,baha'i,preseason,generates,invites,meteorological,handbook,foothills,enclosure,diffusion,mirza,convergence,geelong,coefficient,connector,formula_6,cylindrical,disasters,pleaded,knoxville,contamination,compose,libertarian,arrondissement,franciscan,intercontinental,susceptible,initiation,malaria,unbeaten,consonants,waived,saloon,popularized,estadio,pseudo,interdisciplinary,transports,transformers,carriages,bombings,revolves,ceded,collaborator,celestial,exemption,colchester,maltese,oceanic,ligue,crete,shareholder,routed,depictions,ridden,advisors,calculate,lending,guangzhou,simplicity,newscast,scheduling,snout,eliot,undertaking,armenians,nottinghamshire,whitish,consulted,deficiency,salle,cinemas,superseded,rigorous,kerman,convened,landowners,modernization,evenings,pitches,conditional,scandinavia,differed,formulated,cyclists,swami,guyana,dunes,electrified,appalachian,abdomen,scenarios,prototypes,sindh,consonant,adaptive,boroughs,wolverhampton,modelling,cylinders,amounted,minimize,ambassadors,lenin,settler,coincide,approximation,grouping,murals,bullying,registers,rumours,engagements,energetic,vertex,annals,bordering,geologic,yellowish,runoff,converts,allegheny,facilitated,saturdays,colliery,monitored,rainforest,interfaces,geographically,impaired,prevalence,joachim,paperback,slowed,shankar,distinguishing,seminal,categorized,authorised,auspices,bandwidth,asserts,rebranded,balkans,supplemented,seldom,weaving,capsule,apostles,populous,monmouth,payload,symphonic,densely,shoreline,managerial,masonry,antioch,averages,textbooks,royalist,coliseum,tandem,brewers,diocesan,posthumous,walled,incorrectly,distributions,ensued,reasonably,graffiti,propagation,automation,harmonic,augmented,middleweight,limbs,elongated,landfall,comparatively,literal,grossed,koppen,wavelength,1830s,cerebral,boasts,congestion,physiological,practitioner,coasts,cartoonist,undisclosed,frontal,launches,burgundy,qualifiers,imposing,stade,flanked,assyrian,raided,multiplayer,montane,chesapeake,pathology,drains,vineyards,intercollegiate,semiconductor,grassland,convey,citations,predominant,rejects,benefited,yahoo,graphs,busiest,encompassing,hamlets,explorers,suppress,minors,graphical,calculus,sediment,intends,diverted,mainline,unopposed,cottages,initiate,alumnus,towed,autism,forums,darlington,modernist,oxfordshire,lectured,capitalist,suppliers,panchayat,actresses,foundry,southbound,commodity,wesleyan,divides,palestinians,luton,caretaker,nobleman,mutiny,organizer,preferences,nomenclature,splits,unwilling,offenders,timor,relying,halftime,semitic,arithmetic,milestone,jesuits,arctiidae,retrieved,consuming,contender,edged,plagued,inclusive,transforming,khmer,federally,insurgents,distributing,amherst,rendition,prosecutors,viaduct,disqualified,kabul,liturgy,prevailed,reelected,instructors,swimmers,aperture,churchyard,interventions,totals,darts,metropolis,fuels,fluent,northbound,correctional,inflicted,barrister,realms,culturally,aristocratic,collaborating,emphasizes,choreographer,inputs,ensembles,humboldt,practised,endowed,strains,infringement,archaeologist,congregational,magna,relativity,efficiently,proliferation,mixtape,abruptly,regeneration,commissioning,yukon,archaic,reluctantly,retailer,northamptonshire,universally,crossings,boilers,nickelodeon,revue,abbreviation,retaliation,scripture,routinely,medicinal,benedictine,kenyan,retention,deteriorated,glaciers,apprenticeship,coupling,researched,topography,entrances,anaheim,pivotal,compensate,arched,modify,reinforce,dusseldorf,journeys,motorsport,conceded,sumatra,spaniards,quantitative,loire,cinematography,discarded,botswana,morale,engined,zionist,philanthropy,sainte,fatalities,cypriot,motorsports,indicators,pricing,institut,bethlehem,implicated,gravitational,differentiation,rotor,thriving,precedent,ambiguous,concessions,forecast,conserved,fremantle,asphalt,landslide,middlesbrough,formula_7,humidity,overseeing,chronological,diaries,multinational,crimean,turnover,improvised,youths,declares,tasmanian,canadiens,fumble,refinery,weekdays,unconstitutional,upward,guardians,brownish,imminent,hamas,endorsement,naturalist,martyrs,caledonia,chords,yeshiva,reptiles,severity,mitsubishi,fairs,installment,substitution,repertory,keyboardist,interpreter,silesia,noticeable,rhineland,transmit,inconsistent,booklet,academies,epithet,pertaining,progressively,aquatics,scrutiny,prefect,toxicity,rugged,consume,o'donnell,evolve,uniquely,cabaret,mediated,landowner,transgender,palazzo,compilations,albuquerque,induce,sinai,remastered,efficacy,underside,analogue,specify,possessing,advocating,compatibility,liberated,greenville,mecklenburg,header,memorials,sewage,rhodesia,1800s,salaries,atoll,coordinating,partisans,repealed,amidst,subjective,optimization,nectar,evolving,exploits,madhya,styling,accumulation,raion,postage,responds,buccaneers,frontman,brunei,choreography,coated,kinetic,sampled,inflammatory,complementary,eclectic,norte,vijay,a.k.a,mainz,casualty,connectivity,laureate,franchises,yiddish,reputed,unpublished,economical,periodicals,vertically,bicycles,brethren,capacities,unitary,archeological,tehsil,domesday,wehrmacht,justification,angered,mysore,fielded,abuses,nutrients,ambitions,taluk,battleships,symbolism,superiority,neglect,attendees,commentaries,collaborators,predictions,yorker,breeders,investing,libretto,informally,coefficients,memorandum,pounder,collingwood,tightly,envisioned,arbor,mistakenly,captures,nesting,conflicting,enhancing,streetcar,manufactures,buckinghamshire,rewards,commemorating,stony,expenditure,tornadoes,semantic,relocate,weimar,iberian,sighted,intending,ensign,beverages,expectation,differentiate,centro,utilizes,saxophonist,catchment,transylvania,ecosystems,shortest,sediments,socialists,ineffective,kapoor,formidable,heroine,guantanamo,prepares,scattering,pamphlet,verified,elector,barons,totaling,shrubs,pyrenees,amalgamation,mutually,longitudinal,comte,negatively,masonic,envoy,sexes,akbar,mythical,tonga,bishopric,assessments,malaya,warns,interiors,reefs,reflections,neutrality,musically,nomadic,waterways,provence,collaborate,scaled,adulthood,emerges,euros,optics,incentives,overland,periodical,liege,awarding,realization,slang,affirmed,schooner,hokkaido,czechoslovak,protectorate,undrafted,disagreed,commencement,electors,spruce,swindon,fueled,equatorial,inventions,suites,slovene,backdrop,adjunct,energies,remnant,inhabit,alliances,simulcast,reactors,mosques,travellers,outfielder,plumage,migratory,benin,experimented,fibre,projecting,drafting,laude,evidenced,northernmost,indicted,directional,replication,croydon,comedies,jailed,organizes,devotees,reservoirs,turrets,originate,economists,songwriters,junta,trenches,mounds,proportions,comedic,apostle,azerbaijani,farmhouse,resembled,disrupted,playback,mixes,diagonal,relevance,govern,programmer,gdansk,maize,soundtracks,tendencies,mastered,impacted,believers,kilometre,intervene,chairperson,aerodrome,sails,subsidies,ensures,aesthetics,congresses,ratios,sardinia,southernmost,functioned,controllers,downward,randomly,distortion,regents,palatine,disruption,spirituality,vidhan,tracts,compiler,ventilation,anchorage,symposium,assert,pistols,excelled,avenues,convoys,moniker,constructions,proponent,phased,spines,organising,schleswig,policing,campeonato,mined,hourly,croix,lucrative,authenticity,haitian,stimulation,burkina,espionage,midfield,manually,staffed,awakening,metabolic,biographies,entrepreneurship,conspicuous,guangdong,preface,subgroup,mythological,adjutant,feminism,vilnius,oversees,honourable,tripoli,stylized,kinase,societe,notoriety,altitudes,configurations,outward,transmissions,announces,auditor,ethanol,clube,nanjing,mecca,haifa,blogs,postmaster,paramilitary,depart,positioning,potent,recognizable,spire,brackets,remembrance,overlapping,turkic,articulated,scientology,operatic,deploy,readiness,biotechnology,restrict,cinematographer,inverted,synonymous,administratively,westphalia,commodities,replaces,downloads,centralized,munitions,preached,sichuan,fashionable,implementations,matrices,hiv/aids,loyalist,luzon,celebrates,hazards,heiress,mercenaries,synonym,creole,ljubljana,technician,auditioned,technicians,viewpoint,wetland,mongols,princely,sharif,coating,dynasties,southward,doubling,formula_8,mayoral,harvesting,conjecture,goaltender,oceania,spokane,welterweight,bracket,gatherings,weighted,newscasts,mussolini,affiliations,disadvantage,vibrant,spheres,sultanate,distributors,disliked,establishes,marches,drastically,yielding,jewellery,yokohama,vascular,airlift,canons,subcommittee,repression,strengths,graded,outspoken,fused,pembroke,filmography,redundant,fatigue,repeal,threads,reissue,pennant,edible,vapor,corrections,stimuli,commemoration,dictator,anand,secession,amassed,orchards,pontifical,experimentation,greeted,bangor,forwards,decomposition,quran,trolley,chesterfield,traverse,sermons,burials,skier,climbs,consultants,petitioned,reproduce,parted,illuminated,kurdistan,reigned,occupants,packaged,geometridae,woven,regulating,protagonists,crafted,affluent,clergyman,consoles,migrant,supremacy,attackers,caliph,defect,convection,rallies,huron,resin,segunda,quota,warship,overseen,criticizing,shrines,glamorgan,lowering,beaux,hampered,invasions,conductors,collects,bluegrass,surrounds,substrates,perpetual,chronology,pulmonary,executions,crimea,compiling,noctuidae,battled,tumors,minsk,novgorod,serviced,yeast,computation,swamps,theodor,baronetcy,salford,uruguayan,shortages,odisha,siberian,novelty,cinematic,invitational,decks,dowager,oppression,bandits,appellate,state-of-the-art,clade,palaces,signalling,galaxies,industrialist,tensor,learnt,incurred,magistrates,binds,orbits,ciudad,willingness,peninsular,basins,biomedical,shafts,marlborough,bournemouth,withstand,fitzroy,dunedin,variance,steamship,integrating,muscular,fines,akron,bulbophyllum,malmo,disclosed,cornerstone,runways,medicines,twenty20,gettysburg,progresses,frigates,bodied,transformations,transforms,helens,modelled,versatile,regulator,pursuits,legitimacy,amplifier,scriptures,voyages,examines,presenters,octagonal,poultry,formula_9,anatolia,computed,migrate,directorial,hybrids,localized,preferring,guggenheim,persisted,grassroots,inflammation,fishery,otago,vigorous,professions,instructional,inexpensive,insurgency,legislators,sequels,surnames,agrarian,stainless,nairobi,minas,forerunner,aristocracy,transitions,sicilian,showcased,doses,hiroshima,summarized,gearbox,emancipation,limitation,nuclei,seismic,abandonment,dominating,appropriations,occupations,electrification,hilly,contracting,exaggerated,entertainer,kazan,oricon,cartridges,characterization,parcel,maharaja,exceeds,aspiring,obituary,flattened,contrasted,narration,replies,oblique,outpost,fronts,arranger,talmud,keynes,doctrines,endured,confesses,fortification,supervisors,kilometer,academie,jammu,bathurst,piracy,prostitutes,navarre,cumulative,cruises,lifeboat,twinned,radicals,interacting,expenditures,wexford,libre,futsal,curated,clockwise,colloquially,procurement,immaculate,lyricist,enhancement,porcelain,alzheimer,highlighting,judah,disagreements,storytelling,sheltered,wroclaw,vaudeville,contrasts,neoclassical,compares,contrasting,deciduous,francaise,descriptive,cyclic,reactive,antiquities,meiji,repeats,creditors,forcibly,newmarket,picturesque,impending,uneven,bison,raceway,solvent,ecumenical,optic,professorship,harvested,waterway,banjo,pharaoh,geologist,scanning,dissent,recycled,unmanned,retreating,gospels,aqueduct,branched,tallinn,groundbreaking,syllables,hangar,designations,procedural,craters,cabins,encryption,anthropologist,montevideo,outgoing,inverness,chattanooga,fascism,calais,chapels,groundwater,downfall,misleading,robotic,tortricidae,pixel,handel,prohibit,crewe,renaming,reprised,kickoff,leftist,spaced,integers,causeway,pines,authorship,organise,ptolemy,accessibility,virtues,lesions,iroquois,qur'an,atheist,synthesized,biennial,confederates,dietary,skaters,stresses,tariff,koreans,intercity,republics,quintet,baroness,naive,amplitude,insistence,tbilisi,residues,grammatical,diversified,egyptians,accompaniment,vibration,repository,mandal,topological,distinctions,coherent,invariant,batters,nuevo,internationals,implements,follower,bahia,widened,independents,cantonese,totaled,guadalajara,wolverines,befriended,muzzle,surveying,hungarians,medici,deportation,rayon,approx,recounts,attends,clerical,hellenic,furnished,alleging,soluble,systemic,gallantry,bolshevik,intervened,hostel,gunpowder,specialising,stimulate,leiden,removes,thematic,floral,bafta,printers,conglomerate,eroded,analytic,successively,lehigh,thessaloniki,kilda,clauses,ascended,nehru,scripted,tokugawa,competence,diplomats,exclude,consecration,freedoms,assaults,revisions,blacksmith,textual,sparse,concacaf,slain,uploaded,enraged,whaling,guise,stadiums,debuting,dormitory,cardiovascular,yunnan,dioceses,consultancy,notions,lordship,archdeacon,collided,medial,airfields,garment,wrestled,adriatic,reversal,refueling,verification,jakob,horseshoe,intricate,veracruz,sarawak,syndication,synthesizer,anthologies,stature,feasibility,guillaume,narratives,publicized,antrim,intermittent,constituents,grimsby,filmmaking,doping,unlawful,nominally,transmitting,documenting,seater,internationale,ejected,steamboat,alsace,boise,ineligible,geared,vassal,mustered,ville,inline,pairing,eurasian,kyrgyzstan,barnsley,reprise,stereotypes,rushes,conform,firefighters,deportivo,revolutionaries,rabbis,concurrency,charters,sustaining,aspirations,algiers,chichester,falkland,morphological,systematically,volcanoes,designate,artworks,reclaimed,jurist,anglia,resurrected,chaotic,feasible,circulating,simulated,environmentally,confinement,adventist,harrisburg,laborers,ostensibly,universiade,pensions,influenza,bratislava,octave,refurbishment,gothenburg,putin,barangay,annapolis,breaststroke,illustrates,distorted,choreographed,promo,emphasizing,stakeholders,descends,exhibiting,intrinsic,invertebrates,evenly,roundabout,salts,formula_10,strata,inhibition,branching,stylistic,rumored,realises,mitochondrial,commuted,adherents,logos,bloomberg,telenovela,guineas,charcoal,engages,winery,reflective,siena,cambridgeshire,ventral,flashback,installing,engraving,grasses,traveller,rotated,proprietor,nationalities,precedence,sourced,trainers,cambodian,reductions,depleted,saharan,classifications,biochemistry,plaintiffs,arboretum,humanist,fictitious,aleppo,climates,bazaar,his/her,homogeneous,multiplication,moines,indexed,linguist,skeletal,foliage,societal,differentiated,informing,mammal,infancy,archival,cafes,malls,graeme,musee,schizophrenia,fargo,pronouns,derivation,descend,ascending,terminating,deviation,recaptured,confessions,weakening,tajikistan,bahadur,pasture,b/hip,donegal,supervising,sikhs,thinkers,euclidean,reinforcement,friars,portage,fuscous,lucknow,synchronized,assertion,choirs,privatization,corrosion,multitude,skyscraper,royalties,ligament,usable,spores,directs,clashed,stockport,fronted,dependency,contiguous,biologist,backstroke,powerhouse,frescoes,phylogenetic,welding,kildare,gabon,conveyed,augsburg,severn,continuum,sahib,lille,injuring,passeriformesfamily,succeeds,translating,unitarian,startup,turbulent,outlying,philanthropic,stanislaw,idols,claremont,conical,haryana,armagh,blended,implicit,conditioned,modulation,rochdale,labourers,coinage,shortstop,potsdam,gears,obesity,bestseller,advisers,bouts,comedians,jozef,lausanne,taxonomic,correlated,columbian,marne,indications,psychologists,libel,edict,beaufort,disadvantages,renal,finalized,racehorse,unconventional,disturbances,falsely,zoology,adorned,redesign,executing,narrower,commended,appliances,stalls,resurgence,saskatoon,miscellaneous,permitting,epoch,formula_11,cumbria,forefront,vedic,eastenders,disposed,supermarkets,rower,inhibitor,magnesium,colourful,yusuf,harrow,formulas,centrally,balancing,ionic,nocturnal,consolidate,ornate,raiding,charismatic,accelerate,nominate,residual,dhabi,commemorates,attribution,uninhabited,mindanao,atrocities,genealogical,romani,applicant,enactment,abstraction,trough,pulpit,minuscule,misconduct,grenades,timely,supplements,messaging,curvature,ceasefire,telangana,susquehanna,braking,redistribution,shreveport,neighbourhoods,gregorian,widowed,khuzestan,empowerment,scholastic,evangelist,peptide,topical,theorist,historia,thence,sudanese,museo,jurisprudence,masurian,frankish,headlined,recounted,netball,petitions,tolerant,hectare,truncated,southend,methane,captives,reigns,massif,subunit,acidic,weightlifting,footballers,sabah,britannia,tunisian,segregated,sawmill,withdrawing,unpaid,weaponry,somme,perceptions,unicode,alcoholism,durban,wrought,waterfalls,jihad,auschwitz,upland,eastbound,adjective,anhalt,evaluating,regimes,guildford,reproduced,pamphlets,hierarchical,maneuvers,hanoi,fabricated,repetition,enriched,arterial,replacements,tides,globalization,adequately,westbound,satisfactory,fleets,phosphorus,lastly,neuroscience,anchors,xinjiang,membranes,improvisation,shipments,orthodoxy,submissions,bolivian,mahmud,ramps,leyte,pastures,outlines,flees,transmitters,fares,sequential,stimulated,novice,alternately,symmetrical,breakaway,layered,baronets,lizards,blackish,edouard,horsepower,penang,principals,mercantile,maldives,overwhelmingly,hawke,rallied,prostate,conscription,juveniles,maccabi,carvings,strikers,sudbury,spurred,improves,lombardy,macquarie,parisian,elastic,distillery,shetland,humane,brentford,wrexham,warehouses,routines,encompassed,introductory,isfahan,instituto,palais,revolutions,sporadic,impoverished,portico,fellowships,speculative,enroll,dormant,adhere,fundamentally,sculpted,meritorious,template,upgrading,reformer,rectory,uncredited,indicative,creeks,galveston,radically,hezbollah,firearm,educating,prohibits,trondheim,locus,refit,headwaters,screenings,lowlands,wasps,coarse,attaining,sedimentary,perished,pitchfork,interned,cerro,stagecoach,aeronautical,liter,transitioned,haydn,inaccurate,legislatures,bromwich,knesset,spectroscopy,butte,asiatic,degraded,concordia,catastrophic,lobes,wellness,pensacola,periphery,hapoel,theta,horizontally,freiburg,liberalism,pleas,durable,warmian,offenses,mesopotamia,shandong,unsuitable,hospitalized,appropriately,phonetic,encompass,conversions,observes,illnesses,breakout,assigns,crowns,inhibitors,nightly,manifestation,fountains,maximize,alphabetical,sloop,expands,newtown,widening,gaddafi,commencing,camouflage,footprint,tyrol,barangays,universite,highlanders,budgets,query,lobbied,westchester,equator,stipulated,pointe,distinguishes,allotted,embankment,advises,storing,loyalists,fourier,rehearsals,starvation,gland,rihanna,tubular,expressive,baccalaureate,intersections,revered,carbonate,eritrea,craftsmen,cosmopolitan,sequencing,corridors,shortlisted,bangladeshi,persians,mimic,parades,repetitive,recommends,flanks,promoters,incompatible,teaming,ammonia,greyhound,solos,improper,legislator,newsweek,recurrent,vitro,cavendish,eireann,crises,prophets,mandir,strategically,guerrillas,formula_12,ghent,contenders,equivalence,drone,sociological,hamid,castes,statehood,aland,clinched,relaunched,tariffs,simulations,williamsburg,rotate,mediation,smallpox,harmonica,lodges,lavish,restrictive,o'sullivan,detainees,polynomials,echoes,intersecting,learners,elects,charlemagne,defiance,epsom,liszt,facilitating,absorbing,revelations,padua,pieter,pious,penultimate,mammalian,montenegrin,supplementary,widows,aromatic,croats,roanoke,trieste,legions,subdistrict,babylonian,grasslands,volga,violently,sparsely,oldies,telecommunication,respondents,quarries,downloadable,commandos,taxpayer,catalytic,malabar,afforded,copying,declines,nawab,junctions,assessing,filtering,classed,disused,compliant,christoph,gottingen,civilizations,hermitage,caledonian,whereupon,ethnically,springsteen,mobilization,terraces,indus,excel,zoological,enrichment,simulate,guitarists,registrar,cappella,invoked,reused,manchu,configured,uppsala,genealogy,mergers,casts,curricular,rebelled,subcontinent,horticultural,parramatta,orchestrated,dockyard,claudius,decca,prohibiting,turkmenistan,brahmin,clandestine,obligatory,elaborated,parasitic,helix,constraint,spearheaded,rotherham,eviction,adapting,albans,rescues,sociologist,guiana,convicts,occurrences,kamen,antennas,asturias,wheeled,sanitary,deterioration,trier,theorists,baseline,announcements,valea,planners,factual,serialized,serials,bilbao,demoted,fission,jamestown,cholera,alleviate,alteration,indefinite,sulfate,paced,climatic,valuation,artisans,proficiency,aegean,regulators,fledgling,sealing,influencing,servicemen,frequented,cancers,tambon,narayan,bankers,clarified,embodied,engraver,reorganisation,dissatisfied,dictated,supplemental,temperance,ratification,puget,nutrient,pretoria,papyrus,uniting,ascribed,cores,coptic,schoolhouse,barrio,1910s,armory,defected,transatlantic,regulates,ported,artefacts,specifies,boasted,scorers,mollusks,emitted,navigable,quakers,projective,dialogues,reunification,exponential,vastly,banners,unsigned,dissipated,halves,coincidentally,leasing,purported,escorting,estimation,foxes,lifespan,inflorescence,assimilation,showdown,staunch,prologue,ligand,superliga,telescopes,northwards,keynote,heaviest,taunton,redeveloped,vocalists,podlaskie,soyuz,rodents,azores,moravian,outset,parentheses,apparel,domestically,authoritative,polymers,monterrey,inhibit,launcher,jordanian,folds,taxis,mandates,singled,liechtenstein,subsistence,marxism,ousted,governorship,servicing,offseason,modernism,prism,devout,translators,islamist,chromosomes,pitted,bedfordshire,fabrication,authoritarian,javanese,leaflets,transient,substantive,predatory,sigismund,assassinate,diagrams,arrays,rediscovered,reclamation,spawning,fjord,peacekeeping,strands,fabrics,highs,regulars,tirana,ultraviolet,athenian,filly,barnet,naacp,nueva,favourites,terminates,showcases,clones,inherently,interpreting,bjorn,finely,lauded,unspecified,chola,pleistocene,insulation,antilles,donetsk,funnel,nutritional,biennale,reactivated,southport,primate,cavaliers,austrians,interspersed,restarted,suriname,amplifiers,wladyslaw,blockbuster,sportsman,minogue,brightness,benches,bridgeport,initiating,israelis,orbiting,newcomers,externally,scaling,transcribed,impairment,luxurious,longevity,impetus,temperament,ceilings,tchaikovsky,spreads,pantheon,bureaucracy,1820s,heraldic,villas,formula_13,galician,meath,avoidance,corresponded,headlining,connacht,seekers,rappers,solids,monograph,scoreless,opole,isotopes,himalayas,parodies,garments,microscopic,republished,havilland,orkney,demonstrators,pathogen,saturated,hellenistic,facilitates,aerodynamic,relocating,indochina,laval,astronomers,bequeathed,administrations,extracts,nagoya,torquay,demography,medicare,ambiguity,renumbered,pursuant,concave,syriac,electrode,dispersal,henan,bialystok,walsall,crystalline,puebla,janata,illumination,tianjin,enslaved,coloration,championed,defamation,grille,johor,rejoin,caspian,fatally,planck,workings,appointing,institutionalized,wessex,modernized,exemplified,regatta,jacobite,parochial,programmers,blending,eruptions,insurrection,regression,indices,sited,dentistry,mobilized,furnishings,levant,primaries,ardent,nagasaki,conqueror,dorchester,opined,heartland,amman,mortally,wellesley,bowlers,outputs,coveted,orthography,immersion,disrepair,disadvantaged,curate,childless,condensed,codice_1,remodeled,resultant,bolsheviks,superfamily,saxons,2010s,contractual,rivalries,malacca,oaxaca,magnate,vertebrae,quezon,olympiad,yucatan,tyres,macro,specialization,commendation,caliphate,gunnery,exiles,excerpts,fraudulent,adjustable,aramaic,interceptor,drumming,standardization,reciprocal,adolescents,federalist,aeronautics,favorably,enforcing,reintroduced,zhejiang,refining,biplane,banknotes,accordion,intersect,illustrating,summits,classmate,militias,biomass,massacres,epidemiology,reworked,wrestlemania,nantes,auditory,taxon,elliptical,chemotherapy,asserting,avoids,proficient,airmen,yellowstone,multicultural,alloys,utilization,seniority,kuyavian,huntsville,orthogonal,bloomington,cultivars,casimir,internment,repulsed,impedance,revolving,fermentation,parana,shutout,partnering,empowered,islamabad,polled,classify,amphibians,greyish,obedience,4x100,projectile,khyber,halfback,relational,d'ivoire,synonyms,endeavour,padma,customized,mastery,defenceman,berber,purge,interestingly,covent,promulgated,restricting,condemnation,hillsborough,walkers,privateer,intra,captaincy,naturalized,huffington,detecting,hinted,migrating,bayou,counterattack,anatomical,foraging,unsafe,swiftly,outdated,paraguayan,attire,masjid,endeavors,jerseys,triassic,quechua,growers,axial,accumulate,wastewater,cognition,fungal,animator,pagoda,kochi,uniformly,antibody,yerevan,hypotheses,combatants,italianate,draining,fragmentation,snowfall,formative,inversion,kitchener,identifier,additive,lucha,selects,ashland,cambrian,racetrack,trapping,congenital,primates,wavelengths,expansions,yeomanry,harcourt,wealthiest,awaited,punta,intervening,aggressively,vichy,piloted,midtown,tailored,heyday,metadata,guadalcanal,inorganic,hadith,pulses,francais,tangent,scandals,erroneously,tractors,pigment,constabulary,jiangsu,landfill,merton,basalt,astor,forbade,debuts,collisions,exchequer,stadion,roofed,flavour,sculptors,conservancy,dissemination,electrically,undeveloped,existent,surpassing,pentecostal,manifested,amend,formula_14,superhuman,barges,tunis,analytics,argyll,liquids,mechanized,domes,mansions,himalayan,indexing,reuters,nonlinear,purification,exiting,timbers,triangles,decommissioning,departmental,causal,fonts,americana,sept.,seasonally,incomes,razavi,sheds,memorabilia,rotational,terre,sutra,protege,yarmouth,grandmaster,annum,looted,imperialism,variability,liquidation,baptised,isotope,showcasing,milling,rationale,hammersmith,austen,streamlined,acknowledging,contentious,qaleh,breadth,turing,referees,feral,toulon,unofficially,identifiable,standout,labeling,dissatisfaction,jurgen,angrily,featherweight,cantons,constrained,dominates,standalone,relinquished,theologians,markedly,italics,downed,nitrate,likened,gules,craftsman,singaporean,pixels,mandela,moray,parity,departement,antigen,academically,burgh,brahma,arranges,wounding,triathlon,nouveau,vanuatu,banded,acknowledges,unearthed,stemming,authentication,byzantines,converge,nepali,commonplace,deteriorating,recalling,palette,mathematicians,greenish,pictorial,ahmedabad,rouen,validation,u.s.a.,'best,malvern,archers,converter,undergoes,fluorescent,logistical,notification,transvaal,illicit,symphonies,stabilization,worsened,fukuoka,decrees,enthusiast,seychelles,blogger,louvre,dignitaries,burundi,wreckage,signage,pinyin,bursts,federer,polarization,urbana,lazio,schism,nietzsche,venerable,administers,seton,kilograms,invariably,kathmandu,farmed,disqualification,earldom,appropriated,fluctuations,kermanshah,deployments,deformation,wheelbase,maratha,psalm,bytes,methyl,engravings,skirmish,fayette,vaccines,ideally,astrology,breweries,botanic,opposes,harmonies,irregularities,contended,gaulle,prowess,constants,aground,filipinos,fresco,ochreous,jaipur,willamette,quercus,eastwards,mortars,champaign,braille,reforming,horned,hunan,spacious,agitation,draught,specialties,flourishing,greensboro,necessitated,swedes,elemental,whorls,hugely,structurally,plurality,synthesizers,embassies,assad,contradictory,inference,discontent,recreated,inspectors,unicef,commuters,embryo,modifying,stints,numerals,communicated,boosted,trumpeter,brightly,adherence,remade,leases,restrained,eucalyptus,dwellers,planar,grooves,gainesville,daimler,anzac,szczecin,cornerback,prized,peking,mauritania,khalifa,motorized,lodging,instrumentalist,fortresses,cervical,formula_15,passerine,sectarian,researches,apprenticed,reliefs,disclose,gliding,repairing,queue,kyushu,literate,canoeing,sacrament,separatist,calabria,parkland,flowed,investigates,statistically,visionary,commits,dragoons,scrolls,premieres,revisited,subdued,censored,patterned,elective,outlawed,orphaned,leyland,richly,fujian,miniatures,heresy,plaques,countered,nonfiction,exponent,moravia,dispersion,marylebone,midwestern,enclave,ithaca,federated,electronically,handheld,microscopy,tolls,arrivals,climbers,continual,cossacks,moselle,deserts,ubiquitous,gables,forecasts,deforestation,vertebrates,flanking,drilled,superstructure,inspected,consultative,bypassed,ballast,subsidy,socioeconomic,relic,grenada,journalistic,administering,accommodated,collapses,appropriation,reclassified,foreword,porte,assimilated,observance,fragmented,arundel,thuringia,gonzaga,shenzhen,shipyards,sectional,ayrshire,sloping,dependencies,promenade,ecuadorian,mangrove,constructs,goalscorer,heroism,iteration,transistor,omnibus,hampstead,cochin,overshadowed,chieftain,scalar,finishers,ghanaian,abnormalities,monoplane,encyclopaedia,characterize,travancore,baronetage,bearers,biking,distributes,paving,christened,inspections,banco,humber,corinth,quadratic,albanians,lineages,majored,roadside,inaccessible,inclination,darmstadt,fianna,epilepsy,propellers,papacy,montagu,bhutto,sugarcane,optimized,pilasters,contend,batsmen,brabant,housemates,sligo,ascot,aquinas,supervisory,accorded,gerais,echoed,nunavut,conservatoire,carniola,quartermaster,gminas,impeachment,aquitaine,reformers,quarterfinal,karlsruhe,accelerator,coeducational,archduke,gelechiidae,seaplane,dissident,frenchman,palau,depots,hardcover,aachen,darreh,denominational,groningen,parcels,reluctance,drafts,elliptic,counters,decreed,airship,devotional,contradiction,formula_16,undergraduates,qualitative,guatemalan,slavs,southland,blackhawks,detrimental,abolish,chechen,manifestations,arthritis,perch,fated,hebei,peshawar,palin,immensely,havre,totalling,rampant,ferns,concourse,triples,elites,olympian,larva,herds,lipid,karabakh,distal,monotypic,vojvodina,batavia,multiplied,spacing,spellings,pedestrians,parchment,glossy,industrialization,dehydrogenase,patriotism,abolitionist,mentoring,elizabethan,figurative,dysfunction,abyss,constantin,middletown,stigma,mondays,gambia,gaius,israelites,renounced,nepalese,overcoming,buren,sulphur,divergence,predation,looting,iberia,futuristic,shelved,anthropological,innsbruck,escalated,clermont,entrepreneurial,benchmark,mechanically,detachments,populist,apocalyptic,exited,embryonic,stanza,readership,chiba,landlords,expansive,boniface,therapies,perpetrators,whitehall,kassel,masts,carriageway,clinch,pathogens,mazandaran,undesirable,teutonic,miocene,nagpur,juris,cantata,compile,diffuse,dynastic,reopening,comptroller,o'neal,flourish,electing,scientifically,departs,welded,modal,cosmology,fukushima,libertadores,chang'an,asean,generalization,localization,afrikaans,cricketers,accompanies,emigrants,esoteric,southwards,shutdown,prequel,fittings,innate,wrongly,equitable,dictionaries,senatorial,bipolar,flashbacks,semitism,walkway,lyrically,legality,sorbonne,vigorously,durga,samoan,karel,interchanges,patna,decider,registering,electrodes,anarchists,excursion,overthrown,gilan,recited,michelangelo,advertiser,kinship,taboo,cessation,formula_17,premiers,traversed,madurai,poorest,torneo,exerted,replicate,spelt,sporadically,horde,landscaping,razed,hindered,esperanto,manchuria,propellant,jalan,baha'is,sikkim,linguists,pandit,racially,ligands,dowry,francophone,escarpment,behest,magdeburg,mainstay,villiers,yangtze,grupo,conspirators,martyrdom,noticeably,lexical,kazakh,unrestricted,utilised,sired,inhabits,proofs,joseon,pliny,minted,buddhists,cultivate,interconnected,reuse,viability,australasian,derelict,resolving,overlooks,menon,stewardship,playwrights,thwarted,filmfare,disarmament,protections,bundles,sidelined,hypothesized,singer/songwriter,forage,netted,chancery,townshend,restructured,quotation,hyperbolic,succumbed,parliaments,shenandoah,apical,kibbutz,storeys,pastors,lettering,ukrainians,hardships,chihuahua,avail,aisles,taluka,antisemitism,assent,ventured,banksia,seamen,hospice,faroe,fearful,woreda,outfield,chlorine,transformer,tatar,panoramic,pendulum,haarlem,styria,cornice,importing,catalyzes,subunits,enamel,bakersfield,realignment,sorties,subordinates,deanery,townland,gunmen,tutelage,evaluations,allahabad,thrace,veneto,mennonite,sharia,subgenus,satisfies,puritan,unequal,gastrointestinal,ordinances,bacterium,horticulture,argonauts,adjectives,arable,duets,visualization,woolwich,revamped,euroleague,thorax,completes,originality,vasco,freighter,sardar,oratory,sects,extremes,signatories,exporting,arisen,exacerbated,departures,saipan,furlongs,d'italia,goring,dakar,conquests,docked,offshoot,okrug,referencing,disperse,netting,summed,rewritten,articulation,humanoid,spindle,competitiveness,preventive,facades,westinghouse,wycombe,synthase,emulate,fostering,abdel,hexagonal,myriad,caters,arjun,dismay,axiom,psychotherapy,colloquial,complemented,martinique,fractures,culmination,erstwhile,atrium,electronica,anarchism,nadal,montpellier,algebras,submitting,adopts,stemmed,overcame,internacional,asymmetric,gallipoli,gliders,flushing,extermination,hartlepool,tesla,interwar,patriarchal,hitherto,ganges,combatant,marred,philology,glastonbury,reversible,isthmus,undermined,southwark,gateshead,andalusia,remedies,hastily,optimum,smartphone,evade,patrolled,beheaded,dopamine,waivers,ugandan,gujarati,densities,predicting,intestinal,tentative,interstellar,kolonia,soloists,penetrated,rebellions,qeshlaq,prospered,colegio,deficits,konigsberg,deficient,accessing,relays,kurds,politburo,codified,incarnations,occupancy,cossack,metaphysical,deprivation,chopra,piccadilly,formula_18,makeshift,protestantism,alaskan,frontiers,faiths,tendon,dunkirk,durability,autobots,bonuses,coinciding,emails,gunboat,stucco,magma,neutrons,vizier,subscriptions,visuals,envisaged,carpets,smoky,schema,parliamentarian,immersed,domesticated,parishioners,flinders,diminutive,mahabharata,ballarat,falmouth,vacancies,gilded,twigs,mastering,clerics,dalmatia,islington,slogans,compressor,iconography,congolese,sanction,blends,bulgarians,moderator,outflow,textures,safeguard,trafalgar,tramways,skopje,colonialism,chimneys,jazeera,organisers,denoting,motivations,ganga,longstanding,deficiencies,gwynedd,palladium,holistic,fascia,preachers,embargo,sidings,busan,ignited,artificially,clearwater,cemented,northerly,salim,equivalents,crustaceans,oberliga,quadrangle,historiography,romanians,vaults,fiercely,incidental,peacetime,tonal,bhopal,oskar,radha,pesticides,timeslot,westerly,cathedrals,roadways,aldershot,connectors,brahmins,paler,aqueous,gustave,chromatic,linkage,lothian,specialises,aggregation,tributes,insurgent,enact,hampden,ghulam,federations,instigated,lyceum,fredrik,chairmanship,floated,consequent,antagonists,intimidation,patriarchate,warbler,heraldry,entrenched,expectancy,habitation,partitions,widest,launchers,nascent,ethos,wurzburg,lycee,chittagong,mahatma,merseyside,asteroids,yokosuka,cooperatives,quorum,redistricting,bureaucratic,yachts,deploying,rustic,phonology,chorale,cellist,stochastic,crucifixion,surmounted,confucian,portfolios,geothermal,crested,calibre,tropics,deferred,nasir,iqbal,persistence,essayist,chengdu,aborigines,fayetteville,bastion,interchangeable,burlesque,kilmarnock,specificity,tankers,colonels,fijian,quotations,enquiry,quito,palmerston,delle,multidisciplinary,polynesian,iodine,antennae,emphasised,manganese,baptists,galilee,jutland,latent,excursions,skepticism,tectonic,precursors,negligible,musique,misuse,vitoria,expressly,veneration,sulawesi,footed,mubarak,chongqing,chemically,midday,ravaged,facets,varma,yeovil,ethnographic,discounted,physicists,attache,disbanding,essen,shogunate,cooperated,waikato,realising,motherwell,pharmacology,sulfide,inward,expatriate,devoid,cultivar,monde,andean,groupings,goran,unaffected,moldovan,postdoctoral,coleophora,delegated,pronoun,conductivity,coleridge,disapproval,reappeared,microbial,campground,olsztyn,fostered,vaccination,rabbinical,champlain,milestones,viewership,caterpillar,effected,eupithecia,financier,inferred,uzbek,bundled,bandar,balochistan,mysticism,biosphere,holotype,symbolizes,lovecraft,photons,abkhazia,swaziland,subgroups,measurable,falkirk,valparaiso,ashok,discriminatory,rarity,tabernacle,flyweight,jalisco,westernmost,antiquarian,extracellular,margrave,colspan=9,midsummer,digestive,reversing,burgeoning,substitutes,medallist,khrushchev,guerre,folio,detonated,partido,plentiful,aggregator,medallion,infiltration,shaded,santander,fared,auctioned,permian,ramakrishna,andorra,mentors,diffraction,bukit,potentials,translucent,feminists,tiers,protracted,coburg,wreath,guelph,adventurer,he/she,vertebrate,pipelines,celsius,outbreaks,australasia,deccan,garibaldi,unionists,buildup,biochemical,reconstruct,boulders,stringent,barbed,wording,furnaces,pests,befriends,organises,popes,rizal,tentacles,cadre,tallahassee,punishments,occidental,formatted,mitigation,rulings,rubens,cascades,inducing,choctaw,volta,synagogues,movable,altarpiece,mitigate,practise,intermittently,encountering,memberships,earns,signify,retractable,amounting,pragmatic,wilfrid,dissenting,divergent,kanji,reconstituted,devonian,constitutions,levied,hendrik,starch,costal,honduran,ditches,polygon,eindhoven,superstars,salient,argus,punitive,purana,alluvial,flaps,inefficient,retracted,advantageous,quang,andersson,danville,binghamton,symbolize,conclave,shaanxi,silica,interpersonal,adept,frans,pavilions,lubbock,equip,sunken,limburg,activates,prosecutions,corinthian,venerated,shootings,retreats,parapet,orissa,riviere,animations,parodied,offline,metaphysics,bluffs,plume,piety,fruition,subsidized,steeplechase,shanxi,eurasia,angled,forecasting,suffragan,ashram,larval,labyrinth,chronicler,summaries,trailed,merges,thunderstorms,filtered,formula_19,advertisers,alpes,informatics,parti,constituting,undisputed,certifications,javascript,molten,sclerosis,rumoured,boulogne,hmong,lewes,breslau,notts,bantu,ducal,messengers,radars,nightclubs,bantamweight,carnatic,kaunas,fraternal,triggering,controversially,londonderry,visas,scarcity,offaly,uprisings,repelled,corinthians,pretext,kuomintang,kielce,empties,matriculated,pneumatic,expos,agile,treatises,midpoint,prehistory,oncology,subsets,hydra,hypertension,axioms,wabash,reiterated,swapped,achieves,premio,ageing,overture,curricula,challengers,subic,selangor,liners,frontline,shutter,validated,normalized,entertainers,molluscs,maharaj,allegation,youngstown,synth,thoroughfare,regionally,pillai,transcontinental,pedagogical,riemann,colonia,easternmost,tentatively,profiled,herefordshire,nativity,meuse,nucleotide,inhibits,huntingdon,throughput,recorders,conceding,domed,homeowners,centric,gabled,canoes,fringes,breeder,subtitled,fluoride,haplogroup,zionism,izmir,phylogeny,kharkiv,romanticism,adhesion,usaaf,delegations,lorestan,whalers,biathlon,vaulted,mathematically,pesos,skirmishes,heisman,kalamazoo,gesellschaft,launceston,interacts,quadruple,kowloon,psychoanalysis,toothed,ideologies,navigational,valence,induces,lesotho,frieze,rigging,undercarriage,explorations,spoof,eucharist,profitability,virtuoso,recitals,subterranean,sizeable,herodotus,subscriber,huxley,pivot,forewing,warring,boleslaw,bharatiya,suffixes,trois,percussionist,downturn,garrisons,philosophies,chants,mersin,mentored,dramatist,guilds,frameworks,thermodynamic,venomous,mehmed,assembling,rabbinic,hegemony,replicas,enlargement,claimant,retitled,utica,dumfries,metis,deter,assortment,tubing,afflicted,weavers,rupture,ornamentation,transept,salvaged,upkeep,callsign,rajput,stevenage,trimmed,intracellular,synchronization,consular,unfavorable,royalists,goldwyn,fasting,hussars,doppler,obscurity,currencies,amiens,acorn,tagore,townsville,gaussian,migrations,porta,anjou,graphite,seaport,monographs,gladiators,metrics,calligraphy,sculptural,swietokrzyskie,tolombeh,eredivisie,shoals,queries,carts,exempted,fiberglass,mirrored,bazar,progeny,formalized,mukherjee,professed,amazon.com,cathode,moreton,removable,mountaineers,nagano,transplantation,augustinian,steeply,epilogue,adapter,decisively,accelerating,mediaeval,substituting,tasman,devonshire,litres,enhancements,himmler,nephews,bypassing,imperfect,argentinian,reims,integrates,sochi,ascii,licences,niches,surgeries,fables,versatility,indra,footpath,afonso,crore,evaporation,encodes,shelling,conformity,simplify,updating,quotient,overt,firmware,umpires,architectures,eocene,conservatism,secretion,embroidery,f.c..,tuvalu,mosaics,shipwreck,prefectural,cohort,grievances,garnering,centerpiece,apoptosis,djibouti,bethesda,formula_20,shonen,richland,justinian,dormitories,meteorite,reliably,obtains,pedagogy,hardness,cupola,manifolds,amplification,steamers,familial,dumbarton,jerzy,genital,maidstone,salinity,grumman,signifies,presbytery,meteorology,procured,aegis,streamed,deletion,nuestra,mountaineering,accords,neuronal,khanate,grenoble,axles,dispatches,tokens,turku,auctions,propositions,planters,proclaiming,recommissioned,stravinsky,obverse,bombarded,waged,saviour,massacred,reformist,purportedly,resettlement,ravenna,embroiled,minden,revitalization,hikers,bridging,torpedoed,depletion,nizam,affectionately,latitudes,lubeck,spore,polymerase,aarhus,nazism,101st,buyout,galerie,diets,overflow,motivational,renown,brevet,deriving,melee,goddesses,demolish,amplified,tamworth,retake,brokerage,beneficiaries,henceforth,reorganised,silhouette,browsers,pollutants,peron,lichfield,encircled,defends,bulge,dubbing,flamenco,coimbatore,refinement,enshrined,grizzlies,capacitor,usefulness,evansville,interscholastic,rhodesian,bulletins,diamondbacks,rockers,platted,medalists,formosa,transporter,slabs,guadeloupe,disparate,concertos,violins,regaining,mandible,untitled,agnostic,issuance,hamiltonian,brampton,srpska,homology,downgraded,florentine,epitaph,kanye,rallying,analysed,grandstand,infinitely,antitrust,plundered,modernity,colspan=3|total,amphitheatre,doric,motorists,yemeni,carnivorous,probabilities,prelate,struts,scrapping,bydgoszcz,pancreatic,signings,predicts,compendium,ombudsman,apertura,appoints,rebbe,stereotypical,valladolid,clustered,touted,plywood,inertial,kettering,curving,d'honneur,housewives,grenadier,vandals,barbarossa,necked,waltham,reputedly,jharkhand,cistercian,pursues,viscosity,organiser,cloister,islet,stardom,moorish,himachal,strives,scripps,staggered,blasts,westwards,millimeters,angolan,hubei,agility,admirals,mordellistena,coincides,platte,vehicular,cordillera,riffs,schoolteacher,canaan,acoustics,tinged,reinforcing,concentrates,daleks,monza,selectively,musik,polynesia,exporter,reviving,macclesfield,bunkers,ballets,manors,caudal,microbiology,primes,unbroken,outcry,flocks,pakhtunkhwa,abelian,toowoomba,luminous,mould,appraisal,leuven,experimentally,interoperability,hideout,perak,specifying,knighthood,vasily,excerpt,computerized,niels,networked,byzantium,reaffirmed,geographer,obscured,fraternities,mixtures,allusion,accra,lengthened,inquest,panhandle,pigments,revolts,bluetooth,conjugate,overtaken,foray,coils,breech,streaks,impressionist,mendelssohn,intermediary,panned,suggestive,nevis,upazila,rotunda,mersey,linnaeus,anecdotes,gorbachev,viennese,exhaustive,moldavia,arcades,irrespective,orator,diminishing,predictive,cohesion,polarized,montage,avian,alienation,conus,jaffna,urbanization,seawater,extremity,editorials,scrolling,dreyfus,traverses,topographic,gunboats,extratropical,normans,correspondents,recognises,millennia,filtration,ammonium,voicing,complied,prefixes,diplomas,figurines,weakly,gated,oscillator,lucerne,embroidered,outpatient,airframe,fractional,disobedience,quarterbacks,formula_21,shinto,chiapas,epistle,leakage,pacifist,avignon,penrith,renders,mantua,screenplays,gustaf,tesco,alphabetically,rations,discharges,headland,tapestry,manipur,boolean,mediator,ebenezer,subchannel,fable,bestselling,ateneo,trademarks,recurrence,dwarfs,britannica,signifying,vikram,mediate,condensation,censuses,verbandsgemeinde,cartesian,sprang,surat,britons,chelmsford,courtenay,statistic,retina,abortions,liabilities,closures,mississauga,skyscrapers,saginaw,compounded,aristocrat,msnbc,stavanger,septa,interpretive,hinder,visibly,seeding,shutouts,irregularly,quebecois,footbridge,hydroxide,implicitly,lieutenants,simplex,persuades,midshipman,heterogeneous,officiated,crackdown,lends,tartu,altars,fractions,dissidents,tapered,modernisation,scripting,blazon,aquaculture,thermodynamics,sistan,hasidic,bellator,pavia,propagated,theorized,bedouin,transnational,mekong,chronicled,declarations,kickstarter,quotas,runtime,duquesne,broadened,clarendon,brownsville,saturation,tatars,electorates,malayan,replicated,observable,amphitheater,endorsements,referral,allentown,mormons,pantomime,eliminates,typeface,allegorical,varna,conduction,evoke,interviewer,subordinated,uyghur,landscaped,conventionally,ascend,edifice,postulated,hanja,whitewater,embarking,musicologist,tagalog,frontage,paratroopers,hydrocarbons,transliterated,nicolae,viewpoints,surrealist,asheville,falklands,hacienda,glide,opting,zimbabwean,discal,mortgages,nicaraguan,yadav,ghosh,abstracted,castilian,compositional,cartilage,intergovernmental,forfeited,importation,rapping,artes,republika,narayana,condominium,frisian,bradman,duality,marche,extremist,phosphorylation,genomes,allusions,valencian,habeas,ironworks,multiplex,harpsichord,emigrate,alternated,breda,waffen,smartphones,familiarity,regionalliga,herbaceous,piping,dilapidated,carboniferous,xviii,critiques,carcinoma,sagar,chippewa,postmodern,neapolitan,excludes,notoriously,distillation,tungsten,richness,installments,monoxide,chand,privatisation,molded,maths,projectiles,luoyang,epirus,lemma,concentric,incline,erroneous,sideline,gazetted,leopards,fibres,renovate,corrugated,unilateral,repatriation,orchestration,saeed,rockingham,loughborough,formula_22,bandleader,appellation,openness,nanotechnology,massively,tonnage,dunfermline,exposes,moored,ridership,motte,eurobasket,majoring,feats,silla,laterally,playlist,downwards,methodologies,eastbourne,daimyo,cellulose,leyton,norwalk,oblong,hibernian,opaque,insular,allegory,camogie,inactivation,favoring,masterpieces,rinpoche,serotonin,portrayals,waverley,airliner,longford,minimalist,outsourcing,excise,meyrick,qasim,organisational,synaptic,farmington,gorges,scunthorpe,zoned,tohoku,librarians,davao,decor,theatrically,brentwood,pomona,acquires,planter,capacitors,synchronous,skateboarding,coatings,turbocharged,ephraim,capitulation,scoreboard,hebrides,ensues,cereals,ailing,counterpoint,duplication,antisemitic,clique,aichi,oppressive,transcendental,incursions,rename,renumbering,powys,vestry,bitterly,neurology,supplanted,affine,susceptibility,orbiter,activating,overlaps,ecoregion,raman,canoer,darfur,microorganisms,precipitated,protruding,torun,anthropologists,rennes,kangaroos,parliamentarians,edits,littoral,archived,begum,rensselaer,microphones,ypres,empower,etruscan,wisden,montfort,calibration,isomorphic,rioting,kingship,verbally,smyrna,cohesive,canyons,fredericksburg,rahul,relativistic,micropolitan,maroons,industrialized,henchmen,uplift,earthworks,mahdi,disparity,cultured,transliteration,spiny,fragmentary,extinguished,atypical,inventors,biosynthesis,heralded,curacao,anomalies,aeroplane,surya,mangalore,maastricht,ashkenazi,fusiliers,hangzhou,emitting,monmouthshire,schwarzenegger,ramayana,peptides,thiruvananthapuram,alkali,coimbra,budding,reasoned,epithelial,harbors,rudimentary,classically,parque,ealing,crusades,rotations,riparian,pygmy,inertia,revolted,microprocessor,calendars,solvents,kriegsmarine,accademia,cheshmeh,yoruba,ardabil,mitra,genomic,notables,propagate,narrates,univision,outposts,polio,birkenhead,urinary,crocodiles,pectoral,barrymore,deadliest,rupees,chaim,protons,comical,astrophysics,unifying,formula_23,vassals,cortical,audubon,pedals,tenders,resorted,geophysical,lenders,recognising,tackling,lanarkshire,doctrinal,annan,combating,guangxi,estimating,selectors,tribunals,chambered,inhabiting,exemptions,curtailed,abbasid,kandahar,boron,bissau,150th,codenamed,wearer,whorl,adhered,subversive,famer,smelting,inserting,mogadishu,zoologist,mosul,stumps,almanac,olympiacos,stamens,participatory,cults,honeycomb,geologists,dividend,recursive,skiers,reprint,pandemic,liber,percentages,adversely,stoppage,chieftains,tubingen,southerly,overcrowding,unorganized,hangars,fulfil,hails,cantilever,woodbridge,pinus,wiesbaden,fertilization,fluorescence,enhances,plenary,troublesome,episodic,thrissur,kickboxing,allele,staffing,garda,televisions,philatelic,spacetime,bullpen,oxides,leninist,enrolling,inventive,truro,compatriot,ruskin,normative,assay,gotha,murad,illawarra,gendarmerie,strasse,mazraeh,rebounded,fanfare,liaoning,rembrandt,iranians,emirate,governs,latency,waterfowl,chairmen,katowice,aristocrats,eclipsed,sentient,sonatas,interplay,sacking,decepticons,dynamical,arbitrarily,resonant,petar,velocities,alludes,wastes,prefectures,belleville,sensibility,salvadoran,consolidating,medicaid,trainees,vivekananda,molar,porous,upload,youngster,infused,doctorates,wuhan,annihilation,enthusiastically,gamespot,kanpur,accumulating,monorail,operetta,tiling,sapporo,finns,calvinist,hydrocarbon,sparrows,orienteering,cornelis,minster,vuelta,plebiscite,embraces,panchayats,focussed,remediation,brahman,olfactory,reestablished,uniqueness,northumbria,rwandan,predominately,abode,ghats,balances,californian,uptake,bruges,inert,westerns,reprints,cairn,yarra,resurfaced,audible,rossini,regensburg,italiana,fleshy,irrigated,alerts,yahya,varanasi,marginalized,expatriates,cantonment,normandie,sahitya,directives,rounder,hulls,fictionalized,constables,inserts,hipped,potosi,navies,biologists,canteen,husbandry,augment,fortnight,assamese,kampala,o'keefe,paleolithic,bluish,promontory,consecutively,striving,niall,reuniting,dipole,friendlies,disapproved,thrived,netflix,liberian,dielectric,medway,strategist,sankt,pickups,hitters,encode,rerouted,claimants,anglesey,partitioned,cavan,flutes,reared,repainted,armaments,bowed,thoracic,balliol,piero,chaplains,dehestan,sender,junkers,sindhi,sickle,dividends,metallurgy,honorific,berths,namco,springboard,resettled,gansu,copyrighted,criticizes,utopian,bendigo,ovarian,binomial,spaceflight,oratorio,proprietors,supergroup,duplicated,foreground,strongholds,revolved,optimize,layouts,westland,hurler,anthropomorphic,excelsior,merchandising,reeds,vetoed,cryptography,hollyoaks,monash,flooring,ionian,resilience,johnstown,resolves,lawmakers,alegre,wildcards,intolerance,subculture,selector,slums,formulate,bayonet,istvan,restitution,interchangeably,awakens,rostock,serpentine,oscillation,reichstag,phenotype,recessed,piotr,annotated,preparedness,consultations,clausura,preferential,euthanasia,genoese,outcrops,freemasonry,geometrical,genesee,islets,prometheus,panamanian,thunderbolt,terraced,stara,shipwrecks,futebol,faroese,sharqi,aldermen,zeitung,unify,formula_24,humanism,syntactic,earthen,blyth,taxed,rescinded,suleiman,cymru,dwindled,vitality,superieure,resupply,adolphe,ardennes,rajiv,profiling,olympique,gestation,interfaith,milosevic,tagline,funerary,druze,silvery,plough,shrubland,relaunch,disband,nunatak,minimizing,excessively,waned,attaching,luminosity,bugle,encampment,electrostatic,minesweeper,dubrovnik,rufous,greenock,hochschule,assyrians,extracting,malnutrition,priya,attainment,anhui,connotations,predicate,seabirds,deduced,pseudonyms,gopal,plovdiv,refineries,imitated,kwazulu,terracotta,tenets,discourses,brandeis,whigs,dominions,pulmonate,landslides,tutors,determinant,richelieu,farmstead,tubercles,technicolor,hegel,redundancy,greenpeace,shortening,mules,distilled,xxiii,fundamentalist,acrylic,outbuildings,lighted,corals,signaled,transistors,cavite,austerity,76ers,exposures,dionysius,outlining,commutative,permissible,knowledgeable,howrah,assemblage,inhibited,crewmen,mbit/s,pyramidal,aberdeenshire,bering,rotates,atheism,howitzer,saone,lancet,fermented,contradicted,materiel,ofsted,numeric,uniformity,josephus,nazarene,kuwaiti,noblemen,pediment,emergent,campaigner,akademi,murcia,perugia,gallen,allsvenskan,finned,cavities,matriculation,rosters,twickenham,signatory,propel,readable,contends,artisan,flamboyant,reggio,italo,fumbles,widescreen,rectangle,centimetres,collaborates,envoys,rijeka,phonological,thinly,refractive,civilisation,reductase,cognate,dalhousie,monticello,lighthouses,jitsu,luneburg,socialite,fermi,collectible,optioned,marquee,jokingly,architecturally,kabir,concubine,nationalisation,watercolor,wicklow,acharya,pooja,leibniz,rajendra,nationalized,stalemate,bloggers,glutamate,uplands,shivaji,carolingian,bucuresti,dasht,reappears,muscat,functionally,formulations,hinged,hainan,catechism,autosomal,incremental,asahi,coeur,diversification,multilateral,fewest,recombination,finisher,harrogate,hangul,feasts,photovoltaic,paget,liquidity,alluded,incubation,applauded,choruses,malagasy,hispanics,bequest,underparts,cassava,kazimierz,gastric,eradication,mowtowr,tyrosine,archbishopric,e9e9e9,unproductive,uxbridge,hydrolysis,harbours,officio,deterministic,devonport,kanagawa,breaches,freetown,rhinoceros,chandigarh,janos,sanatorium,liberator,inequalities,agonist,hydrophobic,constructors,nagorno,snowboarding,welcomes,subscribed,iloilo,resuming,catalysts,stallions,jawaharlal,harriers,definitively,roughriders,hertford,inhibiting,elgar,randomized,incumbents,episcopate,rainforests,yangon,improperly,kemal,interpreters,diverged,uttarakhand,umayyad,phnom,panathinaikos,shabbat,diode,jiangxi,forbidding,nozzle,artistry,licensee,processions,staffs,decimated,expressionism,shingle,palsy,ontology,mahayana,maribor,sunil,hostels,edwardian,jetty,freehold,overthrew,eukaryotic,schuylkill,rawalpindi,sheath,recessive,ferenc,mandibles,berlusconi,confessor,convergent,ababa,slugging,rentals,sephardic,equivalently,collagen,markov,dynamically,hailing,depressions,sprawling,fairgrounds,indistinguishable,plutarch,pressurized,banff,coldest,braunschweig,mackintosh,sociedad,wittgenstein,tromso,airbase,lecturers,subtitle,attaches,purified,contemplated,dreamworks,telephony,prophetic,rockland,aylesbury,biscay,coherence,aleksandar,judoka,pageants,theses,homelessness,luthor,sitcoms,hinterland,fifths,derwent,privateers,enigmatic,nationalistic,instructs,superimposed,conformation,tricycle,dusan,attributable,unbeknownst,laptops,etching,archbishops,ayatollah,cranial,gharbi,interprets,lackawanna,abingdon,saltwater,tories,lender,minaj,ancillary,ranching,pembrokeshire,topographical,plagiarism,murong,marque,chameleon,assertions,infiltrated,guildhall,reverence,schenectady,formula_25,kollam,notary,mexicana,initiates,abdication,basra,theorems,ionization,dismantling,eared,censors,budgetary,numeral,verlag,excommunicated,distinguishable,quarried,cagliari,hindustan,symbolizing,watertown,descartes,relayed,enclosures,militarily,sault,devolved,dalian,djokovic,filaments,staunton,tumour,curia,villainous,decentralized,galapagos,moncton,quartets,onscreen,necropolis,brasileiro,multipurpose,alamos,comarca,jorgen,concise,mercia,saitama,billiards,entomologist,montserrat,lindbergh,commuting,lethbridge,phoenician,deviations,anaerobic,denouncing,redoubt,fachhochschule,principalities,negros,announcers,seconded,parrots,konami,revivals,approving,devotee,riyadh,overtook,morecambe,lichen,expressionist,waterline,silverstone,geffen,sternites,aspiration,behavioural,grenville,tripura,mediums,genders,pyotr,charlottesville,sacraments,programmable,ps100,shackleton,garonne,sumerian,surpass,authorizing,interlocking,lagoons,voiceless,advert,steeple,boycotted,alouettes,yosef,oxidative,sassanid,benefiting,sayyid,nauru,predetermined,idealism,maxillary,polymerization,semesters,munchen,conor,outfitted,clapham,progenitor,gheorghe,observational,recognitions,numerically,colonized,hazrat,indore,contaminants,fatality,eradicate,assyria,convocation,cameos,skillful,skoda,corfu,confucius,overtly,ramadan,wollongong,placements,d.c..,permutation,contemporaneous,voltages,elegans,universitat,samar,plunder,dwindling,neuter,antonin,sinhala,campania,solidified,stanzas,fibrous,marburg,modernize,sorcery,deutscher,florets,thakur,disruptive,infielder,disintegration,internazionale,vicariate,effigy,tripartite,corrective,klamath,environs,leavenworth,sandhurst,workmen,compagnie,hoseynabad,strabo,palisades,ordovician,sigurd,grandsons,defection,viacom,sinhalese,innovator,uncontrolled,slavonic,indexes,refrigeration,aircrew,superbike,resumption,neustadt,confrontations,arras,hindenburg,ripon,embedding,isomorphism,dwarves,matchup,unison,lofty,argos,louth,constitutionally,transitive,newington,facelift,degeneration,perceptual,aviators,enclosing,igneous,symbolically,academician,constitutionality,iso/iec,sacrificial,maturation,apprentices,enzymology,naturalistic,hajji,arthropods,abbess,vistula,scuttled,gradients,pentathlon,etudes,freedmen,melaleuca,thrice,conductive,sackville,franciscans,stricter,golds,kites,worshiped,monsignor,trios,orally,tiered,primacy,bodywork,castleford,epidemics,alveolar,chapelle,chemists,hillsboro,soulful,warlords,ngati,huguenot,diurnal,remarking,luger,motorways,gauss,jahan,cutoff,proximal,bandai,catchphrase,jonubi,ossetia,codename,codice_2,throated,itinerant,chechnya,riverfront,leela,evoked,entailed,zamboanga,rejoining,circuitry,haymarket,khartoum,feuds,braced,miyazaki,mirren,lubusz,caricature,buttresses,attrition,characterizes,widnes,evanston,materialism,contradictions,marist,midrash,gainsborough,ulithi,turkmen,vidya,escuela,patrician,inspirations,reagent,premierships,humanistic,euphrates,transitioning,belfry,zedong,adaption,kaliningrad,lobos,epics,waiver,coniferous,polydor,inductee,refitted,moraine,unsatisfactory,worsening,polygamy,rajya,nested,subgenre,broadside,stampeders,lingua,incheon,pretender,peloton,persuading,excitation,multan,predates,tonne,brackish,autoimmune,insulated,podcasts,iraqis,bodybuilding,condominiums,midlothian,delft,debtor,asymmetrical,lycaenidae,forcefully,pathogenic,tamaulipas,andaman,intravenous,advancements,senegalese,chronologically,realigned,inquirer,eusebius,dekalb,additives,shortlist,goldwater,hindustani,auditing,caterpillars,pesticide,nakhon,ingestion,lansdowne,traditionalist,northland,thunderbirds,josip,nominating,locale,ventricular,animators,verandah,epistles,surveyors,anthems,dredd,upheaval,passaic,anatolian,svalbard,associative,floodplain,taranaki,estuaries,irreducible,beginners,hammerstein,allocate,coursework,secreted,counteract,handwritten,foundational,passover,discoverer,decoding,wares,bourgeoisie,playgrounds,nazionale,abbreviations,seanad,golan,mishra,godavari,rebranding,attendances,backstory,interrupts,lettered,hasbro,ultralight,hormozgan,armee,moderne,subdue,disuse,improvisational,enrolment,persists,moderated,carinthia,hatchback,inhibitory,capitalized,anatoly,abstracts,albemarle,bergamo,insolvency,sentai,cellars,walloon,joked,kashmiri,dirac,materialized,renomination,homologous,gusts,eighteens,centrifugal,storied,baluchestan,formula_26,poincare,vettel,infuriated,gauges,streetcars,vedanta,stately,liquidated,goguryeo,swifts,accountancy,levee,acadian,hydropower,eustace,comintern,allotment,designating,torsion,molding,irritation,aerobic,halen,concerted,plantings,garrisoned,gramophone,cytoplasm,onslaught,requisitioned,relieving,genitive,centrist,jeong,espanola,dissolving,chatterjee,sparking,connaught,varese,arjuna,carpathian,empowering,meteorologist,decathlon,opioid,hohenzollern,fenced,ibiza,avionics,footscray,scrum,discounts,filament,directories,a.f.c,stiffness,quaternary,adventurers,transmits,harmonious,taizong,radiating,germantown,ejection,projectors,gaseous,nahuatl,vidyalaya,nightlife,redefined,refuted,destitute,arista,potters,disseminated,distanced,jamboree,kaohsiung,tilted,lakeshore,grained,inflicting,kreis,novelists,descendents,mezzanine,recast,fatah,deregulation,ac/dc,australis,kohgiluyeh,boreal,goths,authoring,intoxicated,nonpartisan,theodosius,pyongyang,shree,boyhood,sanfl,plenipotentiary,photosynthesis,presidium,sinaloa,honshu,texan,avenida,transmembrane,malays,acropolis,catalunya,vases,inconsistencies,methodists,quell,suisse,banat,simcoe,cercle,zealanders,discredited,equine,sages,parthian,fascists,interpolation,classifying,spinoff,yehuda,cruised,gypsum,foaled,wallachia,saraswati,imperialist,seabed,footnotes,nakajima,locales,schoolmaster,drosophila,bridgehead,immanuel,courtier,bookseller,niccolo,stylistically,portmanteau,superleague,konkani,millimetres,arboreal,thanjavur,emulation,sounders,decompression,commoners,infusion,methodological,osage,rococo,anchoring,bayreuth,formula_27,abstracting,symbolized,bayonne,electrolyte,rowed,corvettes,traversing,editorship,sampler,presidio,curzon,adirondack,swahili,rearing,bladed,lemur,pashtun,behaviours,bottling,zaire,recognisable,systematics,leeward,formulae,subdistricts,smithfield,vijaya,buoyancy,boosting,cantonal,rishi,airflow,kamakura,adana,emblems,aquifer,clustering,husayn,woolly,wineries,montessori,turntable,exponentially,caverns,espoused,pianists,vorpommern,vicenza,latterly,o'rourke,williamstown,generale,kosice,duisburg,poirot,marshy,mismanagement,mandalay,dagenham,universes,chiral,radiated,stewards,vegan,crankshaft,kyrgyz,amphibian,cymbals,infrequently,offenbach,environmentalist,repatriated,permutations,midshipmen,loudoun,refereed,bamberg,ornamented,nitric,selim,translational,dorsum,annunciation,gippsland,reflector,informational,regia,reactionary,ahmet,weathering,erlewine,legalized,berne,occupant,divas,manifests,analyzes,disproportionate,mitochondria,totalitarian,paulista,interscope,anarcho,correlate,brookfield,elongate,brunel,ordinal,precincts,volatility,equaliser,hittite,somaliland,ticketing,monochrome,ubuntu,chhattisgarh,titleholder,ranches,referendums,blooms,accommodates,merthyr,religiously,ryukyu,tumultuous,checkpoints,anode,mi'kmaq,cannonball,punctuation,remodelled,assassinations,criminology,alternates,yonge,pixar,namibian,piraeus,trondelag,hautes,lifeboats,shoal,atelier,vehemently,sadat,postcode,jainism,lycoming,undisturbed,lutherans,genomics,popmatters,tabriz,isthmian,notched,autistic,horsham,mites,conseil,bloomsbury,seung,cybertron,idris,overhauled,disbandment,idealized,goldfields,worshippers,lobbyist,ailments,paganism,herbarium,athenians,messerschmitt,faraday,entangled,'olya,untreated,criticising,howitzers,parvati,lobed,debussy,atonement,tadeusz,permeability,mueang,sepals,degli,optionally,fuelled,follies,asterisk,pristina,lewiston,congested,overpass,affixed,pleads,telecasts,stanislaus,cryptographic,friesland,hamstring,selkirk,antisubmarine,inundated,overlay,aggregates,fleur,trolleybus,sagan,ibsen,inductees,beltway,tiled,ladders,cadbury,laplace,ascetic,micronesia,conveying,bellingham,cleft,batches,usaid,conjugation,macedon,assisi,reappointed,brine,jinnah,prairies,screenwriting,oxidized,despatches,linearly,fertilizers,brazilians,absorbs,wagga,modernised,scorsese,ashraf,charlestown,esque,habitable,nizhny,lettres,tuscaloosa,esplanade,coalitions,carbohydrates,legate,vermilion,standardised,galleria,psychoanalytic,rearrangement,substation,competency,nationalised,reshuffle,reconstructions,mehdi,bougainville,receivership,contraception,enlistment,conducive,aberystwyth,solicitors,dismisses,fibrosis,montclair,homeowner,surrealism,s.h.i.e.l.d,peregrine,compilers,1790s,parentage,palmas,rzeszow,worldview,eased,svenska,housemate,bundestag,originator,enlisting,outwards,reciprocity,formula_28,carbohydrate,democratically,firefighting,romagna,acknowledgement,khomeini,carbide,quests,vedas,characteristically,guwahati,brixton,unintended,brothels,parietal,namur,sherbrooke,moldavian,baruch,milieu,undulating,laurier,entre,dijon,ethylene,abilene,heracles,paralleling,ceres,dundalk,falun,auspicious,chisinau,polarity,foreclosure,templates,ojibwe,punic,eriksson,biden,bachchan,glaciation,spitfires,norsk,nonviolent,heidegger,algonquin,capacitance,cassettes,balconies,alleles,airdate,conveys,replays,classifies,infrequent,amine,cuttings,rarer,woking,olomouc,amritsar,rockabilly,illyrian,maoist,poignant,tempore,stalinist,segmented,bandmate,mollusc,muhammed,totalled,byrds,tendered,endogenous,kottayam,aisne,oxidase,overhears,illustrators,verve,commercialization,purplish,directv,moulded,lyttelton,baptismal,captors,saracens,georgios,shorten,polity,grids,fitzwilliam,sculls,impurities,confederations,akhtar,intangible,oscillations,parabolic,harlequin,maulana,ovate,tanzanian,singularity,confiscation,qazvin,speyer,phonemes,overgrown,vicarage,gurion,undocumented,niigata,thrones,preamble,stave,interment,liiga,ataturk,aphrodite,groupe,indentured,habsburgs,caption,utilitarian,ozark,slovenes,reproductions,plasticity,serbo,dulwich,castel,barbuda,salons,feuding,lenape,wikileaks,swamy,breuning,shedding,afield,superficially,operationally,lamented,okanagan,hamadan,accolade,furthering,adolphus,fyodor,abridged,cartoonists,pinkish,suharto,cytochrome,methylation,debit,colspan=9|,refine,taoist,signalled,herding,leaved,bayan,fatherland,rampart,sequenced,negation,storyteller,occupiers,barnabas,pelicans,nadir,conscripted,railcars,prerequisite,furthered,columba,carolinas,markup,gwalior,franche,chaco,eglinton,ramparts,rangoon,metabolites,pollination,croat,televisa,holyoke,testimonial,setlist,safavid,sendai,georgians,shakespearean,galleys,regenerative,krzysztof,overtones,estado,barbary,cherbourg,obispo,sayings,composites,sainsbury,deliberation,cosmological,mahalleh,embellished,ascap,biala,pancras,calumet,grands,canvases,antigens,marianas,defenseman,approximated,seedlings,soren,stele,nuncio,immunology,testimonies,glossary,recollections,suitability,tampere,venous,cohomology,methanol,echoing,ivanovich,warmly,sterilization,imran,multiplying,whitechapel,undersea,xuanzong,tacitus,bayesian,roundhouse,correlations,rioters,molds,fiorentina,bandmates,mezzo,thani,guerilla,200th,premiums,tamils,deepwater,chimpanzees,tribesmen,selwyn,globo,turnovers,punctuated,erode,nouvelle,banbury,exponents,abolishing,helical,maimonides,endothelial,goteborg,infield,encroachment,cottonwood,mazowiecki,parable,saarbrucken,reliever,epistemology,artistes,enrich,rationing,formula_29,palmyra,subfamilies,kauai,zoran,fieldwork,arousal,creditor,friuli,celts,comoros,equated,escalation,negev,tallied,inductive,anion,netanyahu,mesoamerican,lepidoptera,aspirated,remit,westmorland,italic,crosse,vaclav,fuego,owain,balmain,venetians,ethnicities,deflected,ticino,apulia,austere,flycatcher,reprising,repressive,hauptbahnhof,subtype,ophthalmology,summarizes,eniwetok,colonisation,subspace,nymphalidae,earmarked,tempe,burnet,crests,abbots,norwegians,enlarge,ashoka,frankfort,livorno,malware,renters,singly,iliad,moresby,rookies,gustavus,affirming,alleges,legume,chekhov,studded,abdicated,suzhou,isidore,townsite,repayment,quintus,yankovic,amorphous,constructor,narrowing,industrialists,tanganyika,capitalization,connective,mughals,rarities,aerodynamics,worthing,antalya,diagnostics,shaftesbury,thracian,obstetrics,benghazi,multiplier,orbitals,livonia,roscommon,intensify,ravel,oaths,overseer,locomotion,necessities,chickasaw,strathclyde,treviso,erfurt,aortic,contemplation,accrington,markazi,predeceased,hippocampus,whitecaps,assemblyman,incursion,ethnography,extraliga,reproducing,directorship,benzene,byway,stupa,taxable,scottsdale,onondaga,favourably,countermeasures,lithuanians,thatched,deflection,tarsus,consuls,annuity,paralleled,contextual,anglian,klang,hoisted,multilingual,enacting,samaj,taoiseach,carthaginian,apologised,hydrology,entrant,seamless,inflorescences,mugabe,westerners,seminaries,wintering,penzance,mitre,sergeants,unoccupied,delimitation,discriminate,upriver,abortive,nihon,bessarabia,calcareous,buffaloes,patil,daegu,streamline,berks,chaparral,laity,conceptions,typified,kiribati,threaded,mattel,eccentricity,signified,patagonia,slavonia,certifying,adnan,astley,sedition,minimally,enumerated,nikos,goalless,walid,narendra,causa,missoula,coolant,dalek,outcrop,hybridization,schoolchildren,peasantry,afghans,confucianism,shahr,gallic,tajik,kierkegaard,sauvignon,commissar,patriarchs,tuskegee,prussians,laois,ricans,talmudic,officiating,aesthetically,baloch,antiochus,separatists,suzerainty,arafat,shading,u.s.c,chancellors,inc..,toolkit,nepenthes,erebidae,solicited,pratap,kabbalah,alchemist,caltech,darjeeling,biopic,spillway,kaiserslautern,nijmegen,bolstered,neath,pahlavi,eugenics,bureaus,retook,northfield,instantaneous,deerfield,humankind,selectivity,putative,boarders,cornhuskers,marathas,raikkonen,aliabad,mangroves,garages,gulch,karzai,poitiers,chernobyl,thane,alexios,belgrano,scion,solubility,urbanized,executable,guizhou,nucleic,tripled,equalled,harare,houseguests,potency,ghazi,repeater,overarching,regrouped,broward,ragtime,d'art,nandi,regalia,campsites,mamluk,plating,wirral,presumption,zenit,archivist,emmerdale,decepticon,carabidae,kagoshima,franconia,guarani,formalism,diagonally,submarginal,denys,walkways,punts,metrolink,hydrographic,droplets,upperside,martyred,hummingbird,antebellum,curiously,mufti,friary,chabad,czechs,shaykh,reactivity,berklee,turbonilla,tongan,sultans,woodville,unlicensed,enmity,dominicans,operculum,quarrying,watercolour,catalyzed,gatwick,'what,mesozoic,auditors,shizuoka,footballing,haldane,telemundo,appended,deducted,disseminate,o'shea,pskov,abrasive,entente,gauteng,calicut,lemurs,elasticity,suffused,scopula,staining,upholding,excesses,shostakovich,loanwords,naidu,championnat,chromatography,boasting,goaltenders,engulfed,salah,kilogram,morristown,shingles,shi'a,labourer,renditions,frantisek,jekyll,zonal,nanda,sheriffs,eigenvalues,divisione,endorsing,ushered,auvergne,cadres,repentance,freemasons,utilising,laureates,diocletian,semiconductors,o'grady,vladivostok,sarkozy,trackage,masculinity,hydroxyl,mervyn,muskets,speculations,gridiron,opportunistic,mascots,aleutian,fillies,sewerage,excommunication,borrowers,capillary,trending,sydenham,synthpop,rajah,cagayan,deportes,kedah,faure,extremism,michoacan,levski,culminates,occitan,bioinformatics,unknowingly,inciting,emulated,footpaths,piacenza,dreadnought,viceroyalty,oceanographic,scouted,combinatorial,ornithologist,cannibalism,mujahideen,independiente,cilicia,hindwing,minimized,odeon,gyorgy,rubles,purchaser,collieries,kickers,interurban,coiled,lynchburg,respondent,plzen,detractors,etchings,centering,intensification,tomography,ranjit,warblers,retelling,reinstatement,cauchy,modulus,redirected,evaluates,beginner,kalateh,perforated,manoeuvre,scrimmage,internships,megawatts,mottled,haakon,tunbridge,kalyan,summarised,sukarno,quetta,canonized,henryk,agglomeration,coahuila,diluted,chiropractic,yogyakarta,talladega,sheik,cation,halting,reprisals,sulfuric,musharraf,sympathizers,publicised,arles,lectionary,fracturing,startups,sangha,latrobe,rideau,ligaments,blockading,cremona,lichens,fabaceae,modulated,evocative,embodies,battersea,indistinct,altai,subsystem,acidity,somatic,formula_30,tariq,rationality,sortie,ashlar,pokal,cytoplasmic,valour,bangla,displacing,hijacking,spectrometry,westmeath,weill,charing,goias,revolvers,individualized,tenured,nawaz,piquet,chanted,discard,bernd,phalanx,reworking,unilaterally,subclass,yitzhak,piloting,circumvent,disregarded,semicircular,viscous,tibetans,endeavours,retaliated,cretan,vienne,workhouse,sufficiency,aurangzeb,legalization,lipids,expanse,eintracht,sanjak,megas,125th,bahraini,yakima,eukaryotes,thwart,affirmation,peloponnese,retailing,carbonyl,chairwoman,macedonians,dentate,rockaway,correctness,wealthier,metamorphic,aragonese,fermanagh,pituitary,schrodinger,evokes,spoiler,chariots,akita,genitalia,combe,confectionery,desegregation,experiential,commodores,persepolis,viejo,restorations,virtualization,hispania,printmaking,stipend,yisrael,theravada,expended,radium,tweeted,polygonal,lippe,charente,leveraged,cutaneous,fallacy,fragrant,bypasses,elaborately,rigidity,majid,majorca,kongo,plasmodium,skits,audiovisual,eerste,staircases,prompts,coulthard,northwestward,riverdale,beatrix,copyrights,prudential,communicates,mated,obscenity,asynchronous,analyse,hansa,searchlight,farnborough,patras,asquith,qarah,contours,fumbled,pasteur,redistributed,almeria,sanctuaries,jewry,israelite,clinicians,koblenz,bookshop,affective,goulburn,panelist,sikorsky,cobham,mimics,ringed,portraiture,probabilistic,girolamo,intelligible,andalusian,jalal,athenaeum,eritrean,auxiliaries,pittsburg,devolution,sangam,isolating,anglers,cronulla,annihilated,kidderminster,synthesize,popularised,theophilus,bandstand,innumerable,chagrin,retroactively,weser,multiples,birdlife,goryeo,pawnee,grosser,grappling,tactile,ahmadinejad,turboprop,erdogan,matchday,proletarian,adhering,complements,austronesian,adverts,luminaries,archeology,impressionism,conifer,sodomy,interracial,platoons,lessen,postings,pejorative,registrations,cookery,persecutions,microbes,audits,idiosyncratic,subsp,suspensions,restricts,colouring,ratify,instrumentals,nucleotides,sulla,posits,bibliotheque,diameters,oceanography,instigation,subsumed,submachine,acceptor,legation,borrows,sedge,discriminated,loaves,insurers,highgate,detectable,abandons,kilns,sportscaster,harwich,iterations,preakness,arduous,tensile,prabhu,shortwave,philologist,shareholding,vegetative,complexities,councilors,distinctively,revitalize,automaton,amassing,montreux,khanh,surabaya,nurnberg,pernambuco,cuisines,charterhouse,firsts,tercera,inhabitant,homophobia,naturalism,einar,powerplant,coruna,entertainments,whedon,rajputs,raton,democracies,arunachal,oeuvre,wallonia,jeddah,trolleybuses,evangelism,vosges,kiowa,minimise,encirclement,undertakes,emigrant,beacons,deepened,grammars,publius,preeminent,seyyed,repechage,crafting,headingley,osteopathic,lithography,hotly,bligh,inshore,betrothed,olympians,formula_31,dissociation,trivandrum,arran,petrovic,stettin,disembarked,simplification,bronzes,philo,acrobatic,jonsson,conjectured,supercharged,kanto,detects,cheeses,correlates,harmonics,lifecycle,sudamericana,reservists,decayed,elitserien,parametric,113th,dusky,hogarth,modulo,symbiotic,monopolies,discontinuation,converges,southerners,tucuman,eclipses,enclaves,emits,famicom,caricatures,artistically,levelled,mussels,erecting,mouthparts,cunard,octaves,crucible,guardia,unusable,lagrangian,droughts,ephemeral,pashto,canis,tapering,sasebo,silurian,metallurgical,outscored,evolves,reissues,sedentary,homotopy,greyhawk,reagents,inheriting,onshore,tilting,rebuffed,reusable,naturalists,basingstoke,insofar,offensives,dravidian,curators,planks,rajan,isoforms,flagstaff,preside,globular,egalitarian,linkages,biographers,goalscorers,molybdenum,centralised,nordland,jurists,ellesmere,rosberg,hideyoshi,restructure,biases,borrower,scathing,redress,tunnelling,workflow,magnates,mahendra,dissenters,plethora,transcriptions,handicrafts,keyword,xi'an,petrograd,unser,prokofiev,90deg,madan,bataan,maronite,kearny,carmarthen,termini,consulates,disallowed,rockville,bowery,fanzine,docklands,bests,prohibitions,yeltsin,selassie,naturalization,realisation,dispensary,tribeca,abdulaziz,pocahontas,stagnation,pamplona,cuneiform,propagating,subsurface,christgau,epithelium,schwerin,lynching,routledge,hanseatic,upanishad,glebe,yugoslavian,complicity,endowments,girona,mynetworktv,entomology,plinth,ba'ath,supercup,torus,akkadian,salted,englewood,commandery,belgaum,prefixed,colorless,dartford,enthroned,caesarea,nominative,sandown,safeguards,hulled,formula_32,leamington,dieppe,spearhead,generalizations,demarcation,llanelli,masque,brickwork,recounting,sufism,strikingly,petrochemical,onslow,monologues,emigrating,anderlecht,sturt,hossein,sakhalin,subduction,novices,deptford,zanjan,airstrikes,coalfield,reintroduction,timbaland,hornby,messianic,stinging,universalist,situational,radiocarbon,strongman,rowling,saloons,traffickers,overran,fribourg,cambrai,gravesend,discretionary,finitely,archetype,assessor,pilipinas,exhumed,invocation,interacted,digitized,timisoara,smelter,teton,sexism,precepts,srinagar,pilsudski,carmelite,hanau,scoreline,hernando,trekking,blogging,fanbase,wielded,vesicles,nationalization,banja,rafts,motoring,luang,takeda,girder,stimulates,histone,sunda,nanoparticles,attains,jumpers,catalogued,alluding,pontus,ancients,examiners,shinkansen,ribbentrop,reimbursement,pharmacological,ramat,stringed,imposes,cheaply,transplanted,taiping,mizoram,looms,wallabies,sideman,kootenay,encased,sportsnet,revolutionized,tangier,benthic,runic,pakistanis,heatseekers,shyam,mishnah,presbyterians,stadt,sutras,straddles,zoroastrian,infer,fueling,gymnasts,ofcom,gunfight,journeyman,tracklist,oshawa,ps500,pa'in,mackinac,xiongnu,mississippian,breckinridge,freemason,bight,autoroute,liberalization,distantly,thrillers,solomons,presumptive,romanization,anecdotal,bohemians,unpaved,milder,concurred,spinners,alphabets,strenuous,rivieres,kerrang,mistreatment,dismounted,intensively,carlist,dancehall,shunting,pluralism,trafficked,brokered,bonaventure,bromide,neckar,designates,malian,reverses,sotheby,sorghum,serine,environmentalists,languedoc,consulship,metering,bankstown,handlers,militiamen,conforming,regularity,pondicherry,armin,capsized,consejo,capitalists,drogheda,granular,purged,acadians,endocrine,intramural,elicit,terns,orientations,miklos,omitting,apocryphal,slapstick,brecon,pliocene,affords,typography,emigre,tsarist,tomasz,beset,nishi,necessitating,encyclical,roleplaying,journeyed,inflow,sprints,progressives,novosibirsk,cameroonian,ephesus,speckled,kinshasa,freiherr,burnaby,dalmatian,torrential,rigor,renegades,bhakti,nurburgring,cosimo,convincingly,reverting,visayas,lewisham,charlottetown,charadriiformesfamily,transferable,jodhpur,converters,deepening,camshaft,underdeveloped,protease,polonia,uterine,quantify,tobruk,dealerships,narasimha,fortran,inactivity,1780s,victors,categorised,naxos,workstation,skink,sardinian,chalice,precede,dammed,sondheim,phineas,tutored,sourcing,uncompromising,placer,tyneside,courtiers,proclaims,pharmacies,hyogo,booksellers,sengoku,kursk,spectrometer,countywide,wielkopolski,bobsleigh,shetty,llywelyn,consistory,heretics,guinean,cliches,individualism,monolithic,imams,usability,bursa,deliberations,railings,torchwood,inconsistency,balearic,stabilizer,demonstrator,facet,radioactivity,outboard,educates,d'oyly,heretical,handover,jurisdictional,shockwave,hispaniola,conceptually,routers,unaffiliated,trentino,formula_33,cypriots,intervenes,neuchatel,formulating,maggiore,delisted,alcohols,thessaly,potable,estimator,suborder,fluency,mimicry,clergymen,infrastructures,rivals.com,baroda,subplot,majlis,plano,clinching,connotation,carinae,savile,intercultural,transcriptional,sandstones,ailerons,annotations,impresario,heinkel,scriptural,intermodal,astrological,ribbed,northeastward,posited,boers,utilise,kalmar,phylum,breakwater,skype,textured,guideline,azeri,rimini,massed,subsidence,anomalous,wolfsburg,polyphonic,accrediting,vodacom,kirov,captaining,kelantan,logie,fervent,eamon,taper,bundeswehr,disproportionately,divination,slobodan,pundits,hispano,kinetics,reunites,makati,ceasing,statistician,amending,chiltern,eparchy,riverine,melanoma,narragansett,pagans,raged,toppled,breaching,zadar,holby,dacian,ochre,velodrome,disparities,amphoe,sedans,webpage,williamsport,lachlan,groton,baring,swastika,heliport,unwillingness,razorbacks,exhibitors,foodstuffs,impacting,tithe,appendages,dermot,subtypes,nurseries,balinese,simulating,stary,remakes,mundi,chautauqua,geologically,stockade,hakka,dilute,kalimantan,pahang,overlapped,fredericton,baha'u'llah,jahangir,damping,benefactors,shomali,triumphal,cieszyn,paradigms,shielded,reggaeton,maharishi,zambian,shearing,golestan,mirroring,partitioning,flyover,songbook,incandescent,merrimack,huguenots,sangeet,vulnerabilities,trademarked,drydock,tantric,honoris,queenstown,labelling,iterative,enlists,statesmen,anglicans,herge,qinghai,burgundian,islami,delineated,zhuge,aggregated,banknote,qatari,suitably,tapestries,asymptotic,charleroi,majorities,pyramidellidae,leanings,climactic,tahir,ramsar,suppressor,revisionist,trawler,ernakulam,penicillium,categorization,slits,entitlement,collegium,earths,benefice,pinochet,puritans,loudspeaker,stockhausen,eurocup,roskilde,alois,jaroslav,rhondda,boutiques,vigor,neurotransmitter,ansar,malden,ferdinando,sported,relented,intercession,camberwell,wettest,thunderbolts,positional,oriel,cloverleaf,penalized,shoshone,rajkumar,completeness,sharjah,chromosomal,belgians,woolen,ultrasonic,sequentially,boleyn,mordella,microsystems,initiator,elachista,mineralogy,rhododendron,integrals,compostela,hamza,sawmills,stadio,berlioz,maidens,stonework,yachting,tappeh,myocardial,laborer,workstations,costumed,nicaea,lanark,roundtable,mashhad,nablus,algonquian,stuyvesant,sarkar,heroines,diwan,laments,intonation,intrigues,almaty,feuded,grandes,algarve,rehabilitate,macrophages,cruciate,dismayed,heuristic,eliezer,kozhikode,covalent,finalised,dimorphism,yaroslavl,overtaking,leverkusen,middlebury,feeders,brookings,speculates,insoluble,lodgings,jozsef,cysteine,shenyang,habilitation,spurious,brainchild,mtdna,comique,albedo,recife,partick,broadening,shahi,orientated,himalaya,swabia,palme,mennonites,spokeswoman,conscripts,sepulchre,chartres,eurozone,scaffold,invertebrate,parishad,bagan,heian,watercolors,basse,supercomputer,commences,tarragona,plainfield,arthurian,functor,identically,murex,chronicling,pressings,burrowing,histoire,guayaquil,goalkeeping,differentiable,warburg,machining,aeneas,kanawha,holocene,ramesses,reprisal,qingdao,avatars,turkestan,cantatas,besieging,repudiated,teamsters,equipping,hydride,ahmadiyya,euston,bottleneck,computations,terengganu,kalinga,stela,rediscovery,'this,azhar,stylised,karelia,polyethylene,kansai,motorised,lounges,normalization,calculators,1700s,goalkeepers,unfolded,commissary,cubism,vignettes,multiverse,heaters,briton,sparingly,childcare,thorium,plock,riksdag,eunuchs,catalysis,limassol,perce,uncensored,whitlam,ulmus,unites,mesopotamian,refraction,biodiesel,forza,fulda,unseated,mountbatten,shahrak,selenium,osijek,mimicking,antimicrobial,axons,simulcasting,donizetti,swabian,sportsmen,hafiz,neared,heraclius,locates,evaded,subcarpathian,bhubaneswar,negeri,jagannath,thaksin,aydin,oromo,lateran,goldsmiths,multiculturalism,cilia,mihai,evangelists,lorient,qajar,polygons,vinod,mechanised,anglophone,prefabricated,mosses,supervillain,airliners,biofuels,iodide,innovators,valais,wilberforce,logarithm,intelligentsia,dissipation,sanctioning,duchies,aymara,porches,simulators,mostar,telepathic,coaxial,caithness,burghs,fourths,stratification,joaquim,scribes,meteorites,monarchist,germination,vries,desiring,replenishment,istria,winemaking,tammany,troupes,hetman,lanceolate,pelagic,triptych,primeira,scant,outbound,hyphae,denser,bentham,basie,normale,executes,ladislaus,kontinental,herat,cruiserweight,activision,customization,manoeuvres,inglewood,northwood,waveform,investiture,inpatient,alignments,kiryat,rabat,archimedes,ustad,monsanto,archetypal,kirkby,sikhism,correspondingly,catskill,overlaid,petrels,widowers,unicameral,federalists,metalcore,gamerankings,mussel,formula_34,lymphocytes,cystic,southgate,vestiges,immortals,kalam,strove,amazons,pocono,sociologists,sopwith,adheres,laurens,caregivers,inspecting,transylvanian,rebroadcast,rhenish,miserables,pyrams,blois,newtonian,carapace,redshirt,gotland,nazir,unilever,distortions,linebackers,federalism,mombasa,lumen,bernoulli,favouring,aligarh,denounce,steamboats,dnieper,stratigraphic,synths,bernese,umass,icebreaker,guanajuato,heisenberg,boldly,diodes,ladakh,dogmatic,scriptwriter,maritimes,battlestar,symposia,adaptable,toluca,bhavan,nanking,ieyasu,picardy,soybean,adalbert,brompton,deutsches,brezhnev,glandular,laotian,hispanicized,ibadan,personification,dalit,yamuna,regio,dispensed,yamagata,zweibrucken,revising,fandom,stances,participle,flavours,khitan,vertebral,crores,mayaguez,dispensation,guntur,undefined,harpercollins,unionism,meena,leveling,philippa,refractory,telstra,judea,attenuation,pylons,elaboration,elegy,edging,gracillariidae,residencies,absentia,reflexive,deportations,dichotomy,stoves,sanremo,shimon,menachem,corneal,conifers,mordellidae,facsimile,diagnoses,cowper,citta,viticulture,divisive,riverview,foals,mystics,polyhedron,plazas,airspeed,redgrave,motherland,impede,multiplicity,barrichello,airships,pharmacists,harvester,clays,payloads,differentiating,popularize,caesars,tunneling,stagnant,circadian,indemnity,sensibilities,musicology,prefects,serfs,metra,lillehammer,carmarthenshire,kiosks,welland,barbican,alkyl,tillandsia,gatherers,asociacion,showings,bharati,brandywine,subversion,scalable,pfizer,dawla,barium,dardanelles,nsdap,konig,ayutthaya,hodgkin,sedimentation,completions,purchasers,sponsorships,maximizing,banked,taoism,minot,enrolls,fructose,aspired,capuchin,outages,artois,carrollton,totality,osceola,pawtucket,fontainebleau,converged,queretaro,competencies,botha,allotments,sheaf,shastri,obliquely,banding,catharines,outwardly,monchengladbach,driest,contemplative,cassini,ranga,pundit,kenilworth,tiananmen,disulfide,formula_35,townlands,codice_3,looping,caravans,rachmaninoff,segmentation,fluorine,anglicised,gnostic,dessau,discern,reconfigured,altrincham,rebounding,battlecruiser,ramblers,1770s,convective,triomphe,miyagi,mourners,instagram,aloft,breastfeeding,courtyards,folkestone,changsha,kumamoto,saarland,grayish,provisionally,appomattox,uncial,classicism,mahindra,elapsed,supremes,monophyletic,cautioned,formula_36,noblewoman,kernels,sucre,swaps,bengaluru,grenfell,epicenter,rockhampton,worshipful,licentiate,metaphorical,malankara,amputated,wattle,palawan,tankobon,nobunaga,polyhedra,transduction,jilin,syrians,affinities,fluently,emanating,anglicized,sportscar,botanists,altona,dravida,chorley,allocations,kunming,luanda,premiering,outlived,mesoamerica,lingual,dissipating,impairments,attenborough,balustrade,emulator,bakhsh,cladding,increments,ascents,workington,qal'eh,winless,categorical,petrel,emphasise,dormer,toros,hijackers,telescopic,solidly,jankovic,cession,gurus,madoff,newry,subsystems,northside,talib,englishmen,farnese,holographic,electives,argonne,scrivener,predated,brugge,nauvoo,catalyses,soared,siddeley,graphically,powerlifting,funicular,sungai,coercive,fusing,uncertainties,locos,acetic,diverge,wedgwood,dressings,tiebreaker,didactic,vyacheslav,acreage,interplanetary,battlecruisers,sunbury,alkaloids,hairpin,automata,wielkie,interdiction,plugins,monkees,nudibranch,esporte,approximations,disabling,powering,characterisation,ecologically,martinsville,termen,perpetuated,lufthansa,ascendancy,motherboard,bolshoi,athanasius,prunus,dilution,invests,nonzero,mendocino,charan,banque,shaheed,counterculture,unita,voivode,hospitalization,vapour,supermarine,resistor,steppes,osnabruck,intermediates,benzodiazepines,sunnyside,privatized,geopolitical,ponta,beersheba,kievan,embody,theoretic,sangh,cartographer,blige,rotors,thruway,battlefields,discernible,demobilized,broodmare,colouration,sagas,policymakers,serialization,augmentation,hoare,frankfurter,transnistria,kinases,detachable,generational,converging,antiaircraft,khaki,bimonthly,coadjutor,arkhangelsk,kannur,buffers,livonian,northwich,enveloped,cysts,yokozuna,herne,beeching,enron,virginian,woollen,excepting,competitively,outtakes,recombinant,hillcrest,clearances,pathe,cumbersome,brasov,u.s.a,likud,christiania,cruciform,hierarchies,wandsworth,lupin,resins,voiceover,sitar,electrochemical,mediacorp,typhus,grenadiers,hepatic,pompeii,weightlifter,bosniak,oxidoreductase,undersecretary,rescuers,ranji,seleucid,analysing,exegesis,tenancy,toure,kristiansand,110th,carillon,minesweepers,poitou,acceded,palladian,redevelop,naismith,rifled,proletariat,shojo,hackensack,harvests,endpoint,kuban,rosenborg,stonehenge,authorisation,jacobean,revocation,compatriots,colliding,undetermined,okayama,acknowledgment,angelou,fresnel,chahar,ethereal,mg/kg,emmet,mobilised,unfavourable,cultura,characterizing,parsonage,skeptics,expressways,rabaul,medea,guardsmen,visakhapatnam,caddo,homophobic,elmwood,encircling,coexistence,contending,seljuk,mycologist,infertility,moliere,insolvent,covenants,underpass,holme,landesliga,workplaces,delinquency,methamphetamine,contrived,tableau,tithes,overlying,usurped,contingents,spares,oligocene,molde,beatification,mordechai,balloting,pampanga,navigators,flowered,debutant,codec,orogeny,newsletters,solon,ambivalent,ubisoft,archdeaconry,harpers,kirkus,jabal,castings,kazhagam,sylhet,yuwen,barnstaple,amidships,causative,isuzu,watchtower,granules,canaveral,remuneration,insurer,payout,horizonte,integrative,attributing,kiwis,skanderbeg,asymmetry,gannett,urbanism,disassembled,unaltered,precluded,melodifestivalen,ascends,plugin,gurkha,bisons,stakeholder,industrialisation,abbotsford,sextet,bustling,uptempo,slavia,choreographers,midwives,haram,javed,gazetteer,subsection,natively,weighting,lysine,meera,redbridge,muchmusic,abruzzo,adjoins,unsustainable,foresters,kbit/s,cosmopterigidae,secularism,poetics,causality,phonograph,estudiantes,ceausescu,universitario,adjoint,applicability,gastropods,nagaland,kentish,mechelen,atalanta,woodpeckers,lombards,gatineau,romansh,avraham,acetylcholine,perturbation,galois,wenceslaus,fuzhou,meandering,dendritic,sacristy,accented,katha,therapeutics,perceives,unskilled,greenhouses,analogues,chaldean,timbre,sloped,volodymyr,sadiq,maghreb,monogram,rearguard,caucuses,mures,metabolite,uyezd,determinism,theosophical,corbet,gaels,disruptions,bicameral,ribosomal,wolseley,clarksville,watersheds,tarsi,radon,milanese,discontinuous,aristotelian,whistleblower,representational,hashim,modestly,localised,atrial,hazara,ravana,troyes,appointees,rubus,morningside,amity,aberdare,ganglia,wests,zbigniew,aerobatic,depopulated,corsican,introspective,twinning,hardtop,shallower,cataract,mesolithic,emblematic,graced,lubrication,republicanism,voronezh,bastions,meissen,irkutsk,oboes,hokkien,sprites,tenet,individualist,capitulated,oakville,dysentery,orientalist,hillsides,keywords,elicited,incised,lagging,apoel,lengthening,attractiveness,marauders,sportswriter,decentralization,boltzmann,contradicts,draftsman,precipitate,solihull,norske,consorts,hauptmann,riflemen,adventists,syndromes,demolishing,customize,continuo,peripherals,seamlessly,linguistically,bhushan,orphanages,paraul,lessened,devanagari,quarto,responders,patronymic,riemannian,altoona,canonization,honouring,geodetic,exemplifies,republica,enzymatic,porters,fairmount,pampa,sufferers,kamchatka,conjugated,coachella,uthman,repositories,copious,headteacher,awami,phoneme,homomorphism,franconian,moorland,davos,quantified,kamloops,quarks,mayoralty,weald,peacekeepers,valerian,particulate,insiders,perthshire,caches,guimaraes,piped,grenadines,kosciuszko,trombonist,artemisia,covariance,intertidal,soybeans,beatified,ellipse,fruiting,deafness,dnipropetrovsk,accrued,zealous,mandala,causation,junius,kilowatt,bakeries,montpelier,airdrie,rectified,bungalows,toleration,debian,pylon,trotskyist,posteriorly,two-and-a-half,herbivorous,islamists,poetical,donne,wodehouse,frome,allium,assimilate,phonemic,minaret,unprofitable,darpa,untenable,leaflet,bitcoin,zahir,thresholds,argentino,jacopo,bespoke,stratified,wellbeing,shiite,basaltic,timberwolves,secrete,taunts,marathons,isomers,carre,consecrators,penobscot,pitcairn,sakha,crosstown,inclusions,impassable,fenders,indre,uscgc,jordi,retinue,logarithmic,pilgrimages,railcar,cashel,blackrock,macroscopic,aligning,tabla,trestle,certify,ronson,palps,dissolves,thickened,silicate,taman,walsingham,hausa,lowestoft,rondo,oleksandr,cuyahoga,retardation,countering,cricketing,holborn,identifiers,hells,geophysics,infighting,sculpting,balaji,webbed,irradiation,runestone,trusses,oriya,sojourn,forfeiture,colonize,exclaimed,eucharistic,lackluster,glazing,northridge,gutenberg,stipulates,macroeconomic,priori,outermost,annular,udinese,insulating,headliner,godel,polytope,megalithic,salix,sharapova,derided,muskegon,braintree,plateaus,confers,autocratic,isomer,interstitial,stamping,omits,kirtland,hatchery,evidences,intifada,111th,podgorica,capua,motivating,nuneaton,jakub,korsakov,amitabh,mundial,monrovia,gluten,predictor,marshalling,d'orleans,levers,touchscreen,brantford,fricative,banishment,descendent,antagonism,ludovico,loudspeakers,formula_37,livelihoods,manassas,steamships,dewsbury,uppermost,humayun,lures,pinnacles,dependents,lecce,clumps,observatories,paleozoic,dedicating,samiti,draughtsman,gauls,incite,infringing,nepean,pythagorean,convents,triumvirate,seigneur,gaiman,vagrant,fossa,byproduct,serrated,renfrewshire,sheltering,achaemenid,dukedom,catchers,sampdoria,platelet,bielefeld,fluctuating,phenomenology,strikeout,ethnology,prospectors,woodworking,tatra,wildfires,meditations,agrippa,fortescue,qureshi,wojciech,methyltransferase,accusative,saatchi,amerindian,volcanism,zeeland,toyama,vladimirovich,allege,polygram,redox,budgeted,advisories,nematode,chipset,starscream,tonbridge,hardening,shales,accompanist,paraded,phonographic,whitefish,sportive,audiobook,kalisz,hibernation,latif,duels,ps200,coxeter,nayak,safeguarding,cantabria,minesweeping,zeiss,dunams,catholicos,sawtooth,ontological,nicobar,bridgend,unclassified,intrinsically,hanoverian,rabbitohs,kenseth,alcalde,northumbrian,raritan,septuagint,presse,sevres,origen,dandenong,peachtree,intersected,impeded,usages,hippodrome,novara,trajectories,customarily,yardage,inflected,yanow,kalan,taverns,liguria,librettist,intermarriage,1760s,courant,gambier,infanta,ptolemaic,ukulele,haganah,sceptical,manchukuo,plexus,implantation,hilal,intersex,efficiencies,arbroath,hagerstown,adelphi,diario,marais,matti,lifes,coining,modalities,divya,bletchley,conserving,ivorian,mithridates,generative,strikeforce,laymen,toponymy,pogrom,satya,meticulously,agios,dufferin,yaakov,fortnightly,cargoes,deterrence,prefrontal,przemysl,mitterrand,commemorations,chatsworth,gurdwara,abuja,chakraborty,badajoz,geometries,artiste,diatonic,ganglion,presides,marymount,nanak,cytokines,feudalism,storks,rowers,widens,politico,evangelicals,assailants,pittsfield,allowable,bijapur,telenovelas,dichomeris,glenelg,herbivores,keita,inked,radom,fundraisers,constantius,boheme,portability,komnenos,crystallography,derrida,moderates,tavistock,fateh,spacex,disjoint,bristles,commercialized,interwoven,empirically,regius,bulacan,newsday,showa,radicalism,yarrow,pleura,sayed,structuring,cotes,reminiscences,acetyl,edicts,escalators,aomori,encapsulated,legacies,bunbury,placings,fearsome,postscript,powerfully,keighley,hildesheim,amicus,crevices,deserters,benelux,aurangabad,freeware,ioannis,carpathians,chirac,seceded,prepaid,landlocked,naturalised,yanukovych,soundscan,blotch,phenotypic,determinants,twente,dictatorial,giessen,composes,recherche,pathophysiology,inventories,ayurveda,elevating,gravestone,degeneres,vilayet,popularizing,spartanburg,bloemfontein,previewed,renunciation,genotype,ogilvy,tracery,blacklisted,emissaries,diploid,disclosures,tupolev,shinjuku,antecedents,pennine,braganza,bhattacharya,countable,spectroscopic,ingolstadt,theseus,corroborated,compounding,thrombosis,extremadura,medallions,hasanabad,lambton,perpetuity,glycol,besancon,palaiologos,pandey,caicos,antecedent,stratum,laserdisc,novitiate,crowdfunding,palatal,sorceress,dassault,toughness,celle,cezanne,vientiane,tioga,hander,crossbar,gisborne,cursor,inspectorate,serif,praia,sphingidae,nameplate,psalter,ivanovic,sitka,equalised,mutineers,sergius,outgrowth,creationism,haredi,rhizomes,predominate,undertakings,vulgate,hydrothermal,abbeville,geodesic,kampung,physiotherapy,unauthorised,asteraceae,conservationist,minoan,supersport,mohammadabad,cranbrook,mentorship,legitimately,marshland,datuk,louvain,potawatomi,carnivores,levies,lyell,hymnal,regionals,tinto,shikoku,conformal,wanganui,beira,lleida,standstill,deloitte,formula_40,corbusier,chancellery,mixtapes,airtime,muhlenberg,formula_39,bracts,thrashers,prodigious,gironde,chickamauga,uyghurs,substitutions,pescara,batangas,gregarious,gijon,paleo,mathura,pumas,proportionally,hawkesbury,yucca,kristiania,funimation,fluted,eloquence,mohun,aftermarket,chroniclers,futurist,nonconformist,branko,mannerisms,lesnar,opengl,altos,retainers,ashfield,shelbourne,sulaiman,divisie,gwent,locarno,lieder,minkowski,bivalve,redeployed,cartography,seaway,bookings,decays,ostend,antiquaries,pathogenesis,formula_38,chrysalis,esperance,valli,motogp,homelands,bridged,bloor,ghazal,vulgaris,baekje,prospector,calculates,debtors,hesperiidae,titian,returner,landgrave,frontenac,kelowna,pregame,castelo,caius,canoeist,watercolours,winterthur,superintendents,dissonance,dubstep,adorn,matic,salih,hillel,swordsman,flavoured,emitter,assays,monongahela,deeded,brazzaville,sufferings,babylonia,fecal,umbria,astrologer,gentrification,frescos,phasing,zielona,ecozone,candido,manoj,quadrilateral,gyula,falsetto,prewar,puntland,infinitive,contraceptive,bakhtiari,ohrid,socialization,tailplane,evoking,havelock,macapagal,plundering,104th,keynesian,templars,phrasing,morphologically,czestochowa,humorously,catawba,burgas,chiswick,ellipsoid,kodansha,inwards,gautama,katanga,orthopaedic,heilongjiang,sieges,outsourced,subterminal,vijayawada,hares,oration,leitrim,ravines,manawatu,cryogenic,tracklisting,about.com,ambedkar,degenerated,hastened,venturing,lobbyists,shekhar,typefaces,northcote,rugen,'good,ornithology,asexual,hemispheres,unsupported,glyphs,spoleto,epigenetic,musicianship,donington,diogo,kangxi,bisected,polymorphism,megawatt,salta,embossed,cheetahs,cruzeiro,unhcr,aristide,rayleigh,maturing,indonesians,noire,llano,ffffff,camus,purges,annales,convair,apostasy,algol,phage,apaches,marketers,aldehyde,pompidou,kharkov,forgeries,praetorian,divested,retrospectively,gornji,scutellum,bitumen,pausanias,magnification,imitations,nyasaland,geographers,floodlights,athlone,hippolyte,expositions,clarinetist,razak,neutrinos,rotax,sheykh,plush,interconnect,andalus,cladogram,rudyard,resonator,granby,blackfriars,placido,windscreen,sahel,minamoto,haida,cations,emden,blackheath,thematically,blacklist,pawel,disseminating,academical,undamaged,raytheon,harsher,powhatan,ramachandran,saddles,paderborn,capping,zahra,prospecting,glycine,chromatin,profane,banska,helmand,okinawan,dislocation,oscillators,insectivorous,foyle,gilgit,autonomic,tuareg,sluice,pollinated,multiplexed,granary,narcissus,ranchi,staines,nitra,goalscoring,midwifery,pensioners,algorithmic,meetinghouse,biblioteca,besar,narva,angkor,predate,lohan,cyclical,detainee,occipital,eventing,faisalabad,dartmoor,kublai,courtly,resigns,radii,megachilidae,cartels,shortfall,xhosa,unregistered,benchmarks,dystopian,bulkhead,ponsonby,jovanovic,accumulates,papuan,bhutanese,intuitively,gotaland,headliners,recursion,dejan,novellas,diphthongs,imbued,withstood,analgesic,amplify,powertrain,programing,maidan,alstom,affirms,eradicated,summerslam,videogame,molla,severing,foundered,gallium,atmospheres,desalination,shmuel,howmeh,catolica,bossier,reconstructing,isolates,lyase,tweets,unconnected,tidewater,divisible,cohorts,orebro,presov,furnishing,folklorist,simplifying,centrale,notations,factorization,monarchies,deepen,macomb,facilitation,hennepin,declassified,redrawn,microprocessors,preliminaries,enlarging,timeframe,deutschen,shipbuilders,patiala,ferrous,aquariums,genealogies,vieux,unrecognized,bridgwater,tetrahedral,thule,resignations,gondwana,registries,agder,dataset,felled,parva,analyzer,worsen,coleraine,columella,blockaded,polytechnique,reassembled,reentry,narvik,greys,nigra,knockouts,bofors,gniezno,slotted,hamasaki,ferrers,conferring,thirdly,domestication,photojournalist,universality,preclude,ponting,halved,thereupon,photosynthetic,ostrava,mismatch,pangasinan,intermediaries,abolitionists,transited,headings,ustase,radiological,interconnection,dabrowa,invariants,honorius,preferentially,chantilly,marysville,dialectical,antioquia,abstained,gogol,dirichlet,muricidae,symmetries,reproduces,brazos,fatwa,bacillus,ketone,paribas,chowk,multiplicative,dermatitis,mamluks,devotes,adenosine,newbery,meditative,minefields,inflection,oxfam,conwy,bystrica,imprints,pandavas,infinitesimal,conurbation,amphetamine,reestablish,furth,edessa,injustices,frankston,serjeant,4x200,khazar,sihanouk,longchamp,stags,pogroms,coups,upperparts,endpoints,infringed,nuanced,summing,humorist,pacification,ciaran,jamaat,anteriorly,roddick,springboks,faceted,hypoxia,rigorously,cleves,fatimid,ayurvedic,tabled,ratna,senhora,maricopa,seibu,gauguin,holomorphic,campgrounds,amboy,coordinators,ponderosa,casemates,ouachita,nanaimo,mindoro,zealander,rimsky,cluny,tomaszow,meghalaya,caetano,tilak,roussillon,landtag,gravitation,dystrophy,cephalopods,trombones,glens,killarney,denominated,anthropogenic,pssas,roubaix,carcasses,montmorency,neotropical,communicative,rabindranath,ordinated,separable,overriding,surged,sagebrush,conciliation,codice_4,durrani,phosphatase,qadir,votive,revitalized,taiyuan,tyrannosaurus,graze,slovaks,nematodes,environmentalism,blockhouse,illiteracy,schengen,ecotourism,alternation,conic,wields,hounslow,blackfoot,kwame,ambulatory,volhynia,hordaland,croton,piedras,rohit,drava,conceptualized,birla,illustrative,gurgaon,barisal,tutsi,dezong,nasional,polje,chanson,clarinets,krasnoyarsk,aleksandrovich,cosmonaut,d'este,palliative,midseason,silencing,wardens,durer,girders,salamanders,torrington,supersonics,lauda,farid,circumnavigation,embankments,funnels,bajnoksag,lorries,cappadocia,jains,warringah,retirees,burgesses,equalization,cusco,ganesan,algal,amazonian,lineups,allocating,conquerors,usurper,mnemonic,predating,brahmaputra,ahmadabad,maidenhead,numismatic,subregion,encamped,reciprocating,freebsd,irgun,tortoises,governorates,zionists,airfoil,collated,ajmer,fiennes,etymological,polemic,chadian,clerestory,nordiques,fluctuated,calvados,oxidizing,trailhead,massena,quarrels,dordogne,tirunelveli,pyruvate,pulsed,athabasca,sylar,appointee,serer,japonica,andronikos,conferencing,nicolaus,chemin,ascertained,incited,woodbine,helices,hospitalised,emplacements,to/from,orchestre,tyrannical,pannonia,methodism,pop/rock,shibuya,berbers,despot,seaward,westpac,separator,perpignan,alamein,judeo,publicize,quantization,ethniki,gracilis,menlo,offside,oscillating,unregulated,succumbing,finnmark,metrical,suleyman,raith,sovereigns,bundesstrasse,kartli,fiduciary,darshan,foramen,curler,concubines,calvinism,larouche,bukhara,sophomores,mohanlal,lutheranism,monomer,eamonn,'black,uncontested,immersive,tutorials,beachhead,bindings,permeable,postulates,comite,transformative,indiscriminate,hofstra,associacao,amarna,dermatology,lapland,aosta,babur,unambiguous,formatting,schoolboys,gwangju,superconducting,replayed,adherent,aureus,compressors,forcible,spitsbergen,boulevards,budgeting,nossa,annandale,perumal,interregnum,sassoon,kwajalein,greenbrier,caldas,triangulation,flavius,increment,shakhtar,nullified,pinfall,nomen,microfinance,depreciation,cubist,steeper,splendour,gruppe,everyman,chasers,campaigners,bridle,modality,percussive,darkly,capes,velar,picton,triennial,factional,padang,toponym,betterment,norepinephrine,112th,estuarine,diemen,warehousing,morphism,ideologically,pairings,immunization,crassus,exporters,sefer,flocked,bulbous,deseret,booms,calcite,bohol,elven,groot,pulau,citigroup,wyeth,modernizing,layering,pastiche,complies,printmaker,condenser,theropod,cassino,oxyrhynchus,akademie,trainings,lowercase,coxae,parte,chetniks,pentagonal,keselowski,monocoque,morsi,reticulum,meiosis,clapboard,recoveries,tinge,an/fps,revista,sidon,livre,epidermis,conglomerates,kampong,congruent,harlequins,tergum,simplifies,epidemiological,underwriting,tcp/ip,exclusivity,multidimensional,mysql,columbine,ecologist,hayat,sicilies,levees,handset,aesop,usenet,pacquiao,archiving,alexandrian,compensatory,broadsheet,annotation,bahamian,d'affaires,interludes,phraya,shamans,marmara,customizable,immortalized,ambushes,chlorophyll,diesels,emulsion,rheumatoid,voluminous,screenwriters,tailoring,sedis,runcorn,democratization,bushehr,anacostia,constanta,antiquary,sixtus,radiate,advaita,antimony,acumen,barristers,reichsbahn,ronstadt,symbolist,pasig,cursive,secessionist,afrikaner,munnetra,inversely,adsorption,syllabic,moltke,idioms,midline,olimpico,diphosphate,cautions,radziwill,mobilisation,copelatus,trawlers,unicron,bhaskar,financiers,minimalism,derailment,marxists,oireachtas,abdicate,eigenvalue,zafar,vytautas,ganguly,chelyabinsk,telluride,subordination,ferried,dived,vendee,pictish,dimitrov,expiry,carnation,cayley,magnitudes,lismore,gretna,sandwiched,unmasked,sandomierz,swarthmore,tetra,nanyang,pevsner,dehradun,mormonism,rashi,complying,seaplanes,ningbo,cooperates,strathcona,mornington,mestizo,yulia,edgbaston,palisade,ethno,polytopes,espirito,tymoshenko,pronunciations,paradoxical,taichung,chipmunks,erhard,maximise,accretion,kanda,`abdu'l,narrowest,umpiring,mycenaean,divisor,geneticist,ceredigion,barque,hobbyists,equates,auxerre,spinose,cheil,sweetwater,guano,carboxylic,archiv,tannery,cormorant,agonists,fundacion,anbar,tunku,hindrance,meerut,concordat,secunderabad,kachin,achievable,murfreesboro,comprehensively,forges,broadest,synchronised,speciation,scapa,aliyev,conmebol,tirelessly,subjugated,pillaged,udaipur,defensively,lakhs,stateless,haasan,headlamps,patterning,podiums,polyphony,mcmurdo,mujer,vocally,storeyed,mucosa,multivariate,scopus,minimizes,formalised,certiorari,bourges,populate,overhanging,gaiety,unreserved,borromeo,woolworths,isotopic,bashar,purify,vertebra,medan,juxtaposition,earthwork,elongation,chaudhary,schematic,piast,steeped,nanotubes,fouls,achaea,legionnaires,abdur,qmjhl,embraer,hardback,centerville,ilocos,slovan,whitehorse,mauritian,moulding,mapuche,donned,provisioning,gazprom,jonesboro,audley,lightest,calyx,coldwater,trigonometric,petroglyphs,psychoanalyst,congregate,zambezi,fissure,supervises,bexley,etobicoke,wairarapa,tectonics,emphasises,formula_41,debugging,linfield,spatially,ionizing,ungulates,orinoco,clades,erlangen,news/talk,vols.,ceara,yakovlev,finsbury,entanglement,fieldhouse,graphene,intensifying,grigory,keyong,zacatecas,ninian,allgemeine,keswick,societa,snorri,femininity,najib,monoclonal,guyanese,postulate,huntly,abbeys,machinist,yunus,emphasising,ishaq,urmia,bremerton,pretenders,lumiere,thoroughfares,chikara,dramatized,metathorax,taiko,transcendence,wycliffe,retrieves,umpired,steuben,racehorses,taylors,kuznetsov,montezuma,precambrian,canopies,gaozong,propodeum,disestablished,retroactive,shoreham,rhizome,doubleheader,clinician,diwali,quartzite,shabaab,agassiz,despatched,stormwater,luxemburg,callao,universidade,courland,skane,glyph,dormers,witwatersrand,curacy,qualcomm,nansen,entablature,lauper,hausdorff,lusaka,ruthenian,360deg,cityscape,douai,vaishnava,spars,vaulting,rationalist,gygax,sequestration,typology,pollinates,accelerators,leben,colonials,cenotaph,imparted,carthaginians,equaled,rostrum,gobind,bodhisattva,oberst,bicycling,arabi,sangre,biophysics,hainaut,vernal,lunenburg,apportioned,finches,lajos,nenad,repackaged,zayed,nikephoros,r.e.m,swaminarayan,gestalt,unplaced,crags,grohl,sialkot,unsaturated,gwinnett,linemen,forays,palakkad,writs,instrumentalists,aircrews,badged,terrapins,180deg,oneness,commissariat,changi,pupation,circumscribed,contador,isotropic,administrated,fiefs,nimes,intrusions,minoru,geschichte,nadph,tainan,changchun,carbondale,frisia,swapo,evesham,hawai'i,encyclopedic,transporters,dysplasia,formula_42,onsite,jindal,guetta,judgements,narbonne,permissions,paleogene,rationalism,vilna,isometric,subtracted,chattahoochee,lamina,missa,greville,pervez,lattices,persistently,crystallization,timbered,hawaiians,fouling,interrelated,masood,ripening,stasi,gamal,visigothic,warlike,cybernetics,tanjung,forfar,cybernetic,karelian,brooklands,belfort,greifswald,campeche,inexplicably,refereeing,understory,uninterested,prius,collegiately,sefid,sarsfield,categorize,biannual,elsevier,eisteddfod,declension,autonoma,procuring,misrepresentation,novelization,bibliographic,shamanism,vestments,potash,eastleigh,ionized,turan,lavishly,scilly,balanchine,importers,parlance,'that,kanyakumari,synods,mieszko,crossovers,serfdom,conformational,legislated,exclave,heathland,sadar,differentiates,propositional,konstantinos,photoshop,manche,vellore,appalachia,orestes,taiga,exchanger,grozny,invalidated,baffin,spezia,staunchly,eisenach,robustness,virtuosity,ciphers,inlets,bolagh,understandings,bosniaks,parser,typhoons,sinan,luzerne,webcomic,subtraction,jhelum,businessweek,ceske,refrained,firebox,mitigated,helmholtz,dilip,eslamabad,metalwork,lucan,apportionment,provident,gdynia,schooners,casement,danse,hajjiabad,benazir,buttress,anthracite,newsreel,wollaston,dispatching,cadastral,riverboat,provincetown,nantwich,missal,irreverent,juxtaposed,darya,ennobled,electropop,stereoscopic,maneuverability,laban,luhansk,udine,collectibles,haulage,holyrood,materially,supercharger,gorizia,shkoder,townhouses,pilate,layoffs,folkloric,dialectic,exuberant,matures,malla,ceuta,citizenry,crewed,couplet,stopover,transposition,tradesmen,antioxidant,amines,utterance,grahame,landless,isere,diction,appellant,satirist,urbino,intertoto,subiaco,antonescu,nehemiah,ubiquitin,emcee,stourbridge,fencers,103rd,wranglers,monteverdi,watertight,expounded,xiamen,manmohan,pirie,threefold,antidepressant,sheboygan,grieg,cancerous,diverging,bernini,polychrome,fundamentalism,bihari,critiqued,cholas,villers,tendulkar,dafydd,vastra,fringed,evangelization,episcopalian,maliki,sana'a,ashburton,trianon,allegany,heptathlon,insufficiently,panelists,pharrell,hexham,amharic,fertilized,plumes,cistern,stratigraphy,akershus,catalans,karoo,rupee,minuteman,quantification,wigmore,leutnant,metanotum,weeknights,iridescent,extrasolar,brechin,deuterium,kuching,lyricism,astrakhan,brookhaven,euphorbia,hradec,bhagat,vardar,aylmer,positron,amygdala,speculators,unaccompanied,debrecen,slurry,windhoek,disaffected,rapporteur,mellitus,blockers,fronds,yatra,sportsperson,precession,physiologist,weeknight,pidgin,pharma,condemns,standardize,zetian,tibor,glycoprotein,emporia,cormorants,amalie,accesses,leonhard,denbighshire,roald,116th,will.i.am,symbiosis,privatised,meanders,chemnitz,jabalpur,shing,secede,ludvig,krajina,homegrown,snippets,sasanian,euripides,peder,cimarron,streaked,graubunden,kilimanjaro,mbeki,middleware,flensburg,bukovina,lindwall,marsalis,profited,abkhaz,polis,camouflaged,amyloid,morgantown,ovoid,bodleian,morte,quashed,gamelan,juventud,natchitoches,storyboard,freeview,enumeration,cielo,preludes,bulawayo,1600s,olympiads,multicast,faunal,asura,reinforces,puranas,ziegfeld,handicraft,seamount,kheil,noche,hallmarks,dermal,colorectal,encircle,hessen,umbilicus,sunnis,leste,unwin,disclosing,superfund,montmartre,refuelling,subprime,kolhapur,etiology,bismuth,laissez,vibrational,mazar,alcoa,rumsfeld,recurve,ticonderoga,lionsgate,onlookers,homesteads,filesystem,barometric,kingswood,biofuel,belleza,moshav,occidentalis,asymptomatic,northeasterly,leveson,huygens,numan,kingsway,primogeniture,toyotomi,yazoo,limpets,greenbelt,booed,concurrence,dihedral,ventrites,raipur,sibiu,plotters,kitab,109th,trackbed,skilful,berthed,effendi,fairing,sephardi,mikhailovich,lockyer,wadham,invertible,paperbacks,alphabetic,deuteronomy,constitutive,leathery,greyhounds,estoril,beechcraft,poblacion,cossidae,excreted,flamingos,singha,olmec,neurotransmitters,ascoli,nkrumah,forerunners,dualism,disenchanted,benefitted,centrum,undesignated,noida,o'donoghue,collages,egrets,egmont,wuppertal,cleave,montgomerie,pseudomonas,srinivasa,lymphatic,stadia,resold,minima,evacuees,consumerism,ronde,biochemist,automorphism,hollows,smuts,improvisations,vespasian,bream,pimlico,eglin,colne,melancholic,berhad,ousting,saale,notaulices,ouest,hunslet,tiberias,abdomina,ramsgate,stanislas,donbass,pontefract,sucrose,halts,drammen,chelm,l'arc,taming,trolleys,konin,incertae,licensees,scythian,giorgos,dative,tanglewood,farmlands,o'keeffe,caesium,romsdal,amstrad,corte,oglethorpe,huntingdonshire,magnetization,adapts,zamosc,shooto,cuttack,centrepiece,storehouse,winehouse,morbidity,woodcuts,ryazan,buddleja,buoyant,bodmin,estero,austral,verifiable,periyar,christendom,curtail,shura,kaifeng,cotswold,invariance,seafaring,gorica,androgen,usman,seabird,forecourt,pekka,juridical,audacious,yasser,cacti,qianlong,polemical,d'amore,espanyol,distrito,cartographers,pacifism,serpents,backa,nucleophilic,overturning,duplicates,marksman,oriente,vuitton,oberleutnant,gielgud,gesta,swinburne,transfiguration,1750s,retaken,celje,fredrikstad,asuka,cropping,mansard,donates,blacksmiths,vijayanagara,anuradhapura,germinate,betis,foreshore,jalandhar,bayonets,devaluation,frazione,ablaze,abidjan,approvals,homeostasis,corollary,auden,superfast,redcliffe,luxembourgish,datum,geraldton,printings,ludhiana,honoree,synchrotron,invercargill,hurriedly,108th,three-and-a-half,colonist,bexar,limousin,bessemer,ossetian,nunataks,buddhas,rebuked,thais,tilburg,verdicts,interleukin,unproven,dordrecht,solent,acclamation,muammar,dahomey,operettas,4x400,arrears,negotiators,whitehaven,apparitions,armoury,psychoactive,worshipers,sculptured,elphinstone,airshow,kjell,o'callaghan,shrank,professorships,predominance,subhash,coulomb,sekolah,retrofitted,samos,overthrowing,vibrato,resistors,palearctic,datasets,doordarshan,subcutaneous,compiles,immorality,patchwork,trinidadian,glycogen,pronged,zohar,visigoths,freres,akram,justo,agora,intakes,craiova,playwriting,bukhari,militarism,iwate,petitioners,harun,wisla,inefficiency,vendome,ledges,schopenhauer,kashi,entombed,assesses,tenn.,noumea,baguio,carex,o'donovan,filings,hillsdale,conjectures,blotches,annuals,lindisfarne,negated,vivek,angouleme,trincomalee,cofactor,verkhovna,backfield,twofold,automaker,rudra,freighters,darul,gharana,busway,formula_43,plattsburgh,portuguesa,showrunner,roadmap,valenciennes,erdos,biafra,spiritualism,transactional,modifies,carne,107th,cocos,gcses,tiverton,radiotherapy,meadowlands,gunma,srebrenica,foxtel,authenticated,enslavement,classicist,klaipeda,minstrels,searchable,infantrymen,incitement,shiga,nadp+,urals,guilders,banquets,exteriors,counterattacks,visualized,diacritics,patrimony,svensson,transepts,prizren,telegraphy,najaf,emblazoned,coupes,effluent,ragam,omani,greensburg,taino,flintshire,cd/dvd,lobbies,narrating,cacao,seafarers,bicolor,collaboratively,suraj,floodlit,sacral,puppetry,tlingit,malwa,login,motionless,thien,overseers,vihar,golem,specializations,bathhouse,priming,overdubs,winningest,archetypes,uniao,acland,creamery,slovakian,lithographs,maryborough,confidently,excavating,stillborn,ramallah,audiencia,alava,ternary,hermits,rostam,bauxite,gawain,lothair,captions,gulfstream,timelines,receded,mediating,petain,bastia,rudbar,bidders,disclaimer,shrews,tailings,trilobites,yuriy,jamil,demotion,gynecology,rajinikanth,madrigals,ghazni,flycatchers,vitebsk,bizet,computationally,kashgar,refinements,frankford,heralds,europe/africa,levante,disordered,sandringham,queues,ransacked,trebizond,verdes,comedie,primitives,figurine,organists,culminate,gosport,coagulation,ferrying,hoyas,polyurethane,prohibitive,midfielders,ligase,progesterone,defectors,sweetened,backcountry,diodorus,waterside,nieuport,khwaja,jurong,decried,gorkha,ismaili,300th,octahedral,kindergartens,paseo,codification,notifications,disregarding,risque,reconquista,shortland,atolls,texarkana,perceval,d'etudes,kanal,herbicides,tikva,nuova,gatherer,dissented,soweto,dexterity,enver,bacharach,placekicker,carnivals,automate,maynooth,symplectic,chetnik,militaire,upanishads,distributive,strafing,championing,moiety,miliband,blackadder,enforceable,maung,dimer,stadtbahn,diverges,obstructions,coleophoridae,disposals,shamrocks,aural,banca,bahru,coxed,grierson,vanadium,watermill,radiative,ecoregions,berets,hariri,bicarbonate,evacuations,mallee,nairn,rushden,loggia,slupsk,satisfactorily,milliseconds,cariboo,reine,cyclo,pigmentation,postmodernism,aqueducts,vasari,bourgogne,dilemmas,liquefied,fluminense,alloa,ibaraki,tenements,kumasi,humerus,raghu,labours,putsch,soundcloud,bodybuilder,rakyat,domitian,pesaro,translocation,sembilan,homeric,enforcers,tombstones,lectureship,rotorua,salamis,nikolaos,inferences,superfortress,lithgow,surmised,undercard,tarnow,barisan,stingrays,federacion,coldstream,haverford,ornithological,heerenveen,eleazar,jyoti,murali,bamako,riverbed,subsidised,theban,conspicuously,vistas,conservatorium,madrasa,kingfishers,arnulf,credential,syndicalist,sheathed,discontinuity,prisms,tsushima,coastlines,escapees,vitis,optimizing,megapixel,overground,embattled,halide,sprinters,buoys,mpumalanga,peculiarities,106th,roamed,menezes,macao,prelates,papyri,freemen,dissertations,irishmen,pooled,sverre,reconquest,conveyance,subjectivity,asturian,circassian,formula_45,comdr,thickets,unstressed,monro,passively,harmonium,moveable,dinar,carlsson,elysees,chairing,b'nai,confusingly,kaoru,convolution,godolphin,facilitator,saxophones,eelam,jebel,copulation,anions,livres,licensure,pontypridd,arakan,controllable,alessandria,propelling,stellenbosch,tiber,wolka,liberators,yarns,d'azur,tsinghua,semnan,amhara,ablation,melies,tonality,historique,beeston,kahne,intricately,sonoran,robespierre,gyrus,boycotts,defaulted,infill,maranhao,emigres,framingham,paraiba,wilhelmshaven,tritium,skyway,labial,supplementation,possessor,underserved,motets,maldivian,marrakech,quays,wikimedia,turbojet,demobilization,petrarch,encroaching,sloops,masted,karbala,corvallis,agribusiness,seaford,stenosis,hieronymus,irani,superdraft,baronies,cortisol,notability,veena,pontic,cyclin,archeologists,newham,culled,concurring,aeolian,manorial,shouldered,fords,philanthropists,105th,siddharth,gotthard,halim,rajshahi,jurchen,detritus,practicable,earthenware,discarding,travelogue,neuromuscular,elkhart,raeder,zygmunt,metastasis,internees,102nd,vigour,upmarket,summarizing,subjunctive,offsets,elizabethtown,udupi,pardubice,repeaters,instituting,archaea,substandard,technische,linga,anatomist,flourishes,velika,tenochtitlan,evangelistic,fitchburg,springbok,cascading,hydrostatic,avars,occasioned,filipina,perceiving,shimbun,africanus,consternation,tsing,optically,beitar,45deg,abutments,roseville,monomers,huelva,lotteries,hypothalamus,internationalist,electromechanical,hummingbirds,fibreglass,salaried,dramatists,uncovers,invokes,earners,excretion,gelding,ancien,aeronautica,haverhill,stour,ittihad,abramoff,yakov,ayodhya,accelerates,industrially,aeroplanes,deleterious,dwelt,belvoir,harpalus,atpase,maluku,alasdair,proportionality,taran,epistemological,interferometer,polypeptide,adjudged,villager,metastatic,marshalls,madhavan,archduchess,weizmann,kalgoorlie,balan,predefined,sessile,sagaing,brevity,insecticide,psychosocial,africana,steelworks,aether,aquifers,belem,mineiro,almagro,radiators,cenozoic,solute,turbocharger,invicta,guested,buccaneer,idolatry,unmatched,paducah,sinestro,dispossessed,conforms,responsiveness,cyanobacteria,flautist,procurator,complementing,semifinalist,rechargeable,permafrost,cytokine,refuges,boomed,gelderland,franchised,jinan,burnie,doubtless,randomness,colspan=12,angra,ginebra,famers,nuestro,declarative,roughness,lauenburg,motile,rekha,issuer,piney,interceptors,napoca,gipsy,formulaic,formula_44,viswanathan,ebrahim,thessalonica,galeria,muskogee,unsold,html5,taito,mobutu,icann,carnarvon,fairtrade,morphisms,upsilon,nozzles,fabius,meander,murugan,strontium,episcopacy,sandinista,parasol,attenuated,bhima,primeval,panay,ordinator,negara,osteoporosis,glossop,ebook,paradoxically,grevillea,modoc,equating,phonetically,legumes,covariant,dorje,quatre,bruxelles,pyroclastic,shipbuilder,zhaozong,obscuring,sveriges,tremolo,extensible,barrack,multnomah,hakon,chaharmahal,parsing,volumetric,astrophysical,glottal,combinatorics,freestanding,encoder,paralysed,cavalrymen,taboos,heilbronn,orientalis,lockport,marvels,ozawa,dispositions,waders,incurring,saltire,modulate,papilio,phenol,intermedia,rappahannock,plasmid,fortify,phenotypes,transiting,correspondences,leaguer,larnaca,incompatibility,mcenroe,deeming,endeavoured,aboriginals,helmed,salar,arginine,werke,ferrand,expropriated,delimited,couplets,phoenicians,petioles,ouster,anschluss,protectionist,plessis,urchins,orquesta,castleton,juniata,bittorrent,fulani,donji,mykola,rosemont,chandos,scepticism,signer,chalukya,wicketkeeper,coquitlam,programmatic,o'brian,carteret,urology,steelhead,paleocene,konkan,bettered,venkatesh,surfacing,longitudinally,centurions,popularization,yazid,douro,widths,premios,leonards,gristmill,fallujah,arezzo,leftists,ecliptic,glycerol,inaction,disenfranchised,acrimonious,depositing,parashah,cockatoo,marechal,bolzano,chios,cablevision,impartiality,pouches,thickly,equities,bentinck,emotive,boson,ashdown,conquistadors,parsi,conservationists,reductive,newlands,centerline,ornithologists,waveguide,nicene,philological,hemel,setanta,masala,aphids,convening,casco,matrilineal,chalcedon,orthographic,hythe,replete,damming,bolivarian,admixture,embarks,borderlands,conformed,nagarjuna,blenny,chaitanya,suwon,shigeru,tatarstan,lingayen,rejoins,grodno,merovingian,hardwicke,puducherry,prototyping,laxmi,upheavals,headquarter,pollinators,bromine,transom,plantagenet,arbuthnot,chidambaram,woburn,osamu,panelling,coauthored,zhongshu,hyaline,omissions,aspergillus,offensively,electrolytic,woodcut,sodom,intensities,clydebank,piotrkow,supplementing,quipped,focke,harbinger,positivism,parklands,wolfenbuttel,cauca,tryptophan,taunus,curragh,tsonga,remand,obscura,ashikaga,eltham,forelimbs,analogs,trnava,observances,kailash,antithesis,ayumi,abyssinia,dorsally,tralee,pursuers,misadventures,padova,perot,mahadev,tarim,granth,licenced,compania,patuxent,baronial,korda,cochabamba,codices,karna,memorialized,semaphore,playlists,mandibular,halal,sivaji,scherzinger,stralsund,foundries,ribosome,mindfulness,nikolayevich,paraphyletic,newsreader,catalyze,ioannina,thalamus,gbit/s,paymaster,sarab,500th,replenished,gamepro,cracow,formula_46,gascony,reburied,lessing,easement,transposed,meurthe,satires,proviso,balthasar,unbound,cuckoos,durbar,louisbourg,cowes,wholesalers,manet,narita,xiaoping,mohamad,illusory,cathal,reuptake,alkaloid,tahrir,mmorpg,underlies,anglicanism,repton,aharon,exogenous,buchenwald,indigent,odostomia,milled,santorum,toungoo,nevsky,steyr,urbanisation,darkseid,subsonic,canaanite,akiva,eglise,dentition,mediators,cirencester,peloponnesian,malmesbury,durres,oerlikon,tabulated,saens,canaria,ischemic,esterhazy,ringling,centralization,walthamstow,nalanda,lignite,takht,leninism,expiring,circe,phytoplankton,promulgation,integrable,breeches,aalto,menominee,borgo,scythians,skrull,galleon,reinvestment,raglan,reachable,liberec,airframes,electrolysis,geospatial,rubiaceae,interdependence,symmetrically,simulcasts,keenly,mauna,adipose,zaidi,fairport,vestibular,actuators,monochromatic,literatures,congestive,sacramental,atholl,skytrain,tycho,tunings,jamia,catharina,modifier,methuen,tapings,infiltrating,colima,grafting,tauranga,halides,pontificate,phonetics,koper,hafez,grooved,kintetsu,extrajudicial,linkoping,cyberpunk,repetitions,laurentian,parnu,bretton,darko,sverdlovsk,foreshadowed,akhenaten,rehnquist,gosford,coverts,pragmatism,broadleaf,ethiopians,instated,mediates,sodra,opulent,descriptor,enugu,shimla,leesburg,officership,giffard,refectory,lusitania,cybermen,fiume,corus,tydfil,lawrenceville,ocala,leviticus,burghers,ataxia,richthofen,amicably,acoustical,watling,inquired,tiempo,multiracial,parallelism,trenchard,tokyopop,germanium,usisl,philharmonia,shapur,jacobites,latinized,sophocles,remittances,o'farrell,adder,dimitrios,peshwa,dimitar,orlov,outstretched,musume,satish,dimensionless,serialised,baptisms,pagasa,antiviral,1740s,quine,arapaho,bombardments,stratosphere,ophthalmic,injunctions,carbonated,nonviolence,asante,creoles,sybra,boilermakers,abington,bipartite,permissive,cardinality,anheuser,carcinogenic,hohenlohe,surinam,szeged,infanticide,generically,floorball,'white,automakers,cerebellar,homozygous,remoteness,effortlessly,allude,'great,headmasters,minting,manchurian,kinabalu,wemyss,seditious,widgets,marbled,almshouses,bards,subgenres,tetsuya,faulting,kickboxer,gaulish,hoseyn,malton,fluvial,questionnaires,mondale,downplayed,traditionalists,vercelli,sumatran,landfills,gamesradar,exerts,franciszek,unlawfully,huesca,diderot,libertarians,professorial,laane,piecemeal,conidae,taiji,curatorial,perturbations,abstractions,szlachta,watercraft,mullah,zoroastrianism,segmental,khabarovsk,rectors,affordability,scuola,diffused,stena,cyclonic,workpiece,romford,'little,jhansi,stalag,zhongshan,skipton,maracaibo,bernadotte,thanet,groening,waterville,encloses,sahrawi,nuffield,moorings,chantry,annenberg,islay,marchers,tenses,wahid,siegen,furstenberg,basques,resuscitation,seminarians,tympanum,gentiles,vegetarianism,tufted,venkata,fantastical,pterophoridae,machined,superposition,glabrous,kaveri,chicane,executors,phyllonorycter,bidirectional,jasta,undertones,touristic,majapahit,navratilova,unpopularity,barbadian,tinian,webcast,hurdler,rigidly,jarrah,staphylococcus,igniting,irrawaddy,stabilised,airstrike,ragas,wakayama,energetically,ekstraklasa,minibus,largemouth,cultivators,leveraging,waitangi,carnaval,weaves,turntables,heydrich,sextus,excavate,govind,ignaz,pedagogue,uriah,borrowings,gemstones,infractions,mycobacterium,batavian,massing,praetor,subalpine,massoud,passers,geostationary,jalil,trainsets,barbus,impair,budejovice,denbigh,pertain,historicity,fortaleza,nederlandse,lamenting,masterchef,doubs,gemara,conductance,ploiesti,cetaceans,courthouses,bhagavad,mihailovic,occlusion,bremerhaven,bulwark,morava,kaine,drapery,maputo,conquistador,kaduna,famagusta,first-past-the-post,erudite,galton,undated,tangential,filho,dismembered,dashes,criterium,darwen,metabolized,blurring,everard,randwick,mohave,impurity,acuity,ansbach,chievo,surcharge,plantain,algoma,porosity,zirconium,selva,sevenoaks,venizelos,gwynne,golgi,imparting,separatism,courtesan,idiopathic,gravestones,hydroelectricity,babar,orford,purposeful,acutely,shard,ridgewood,viterbo,manohar,expropriation,placenames,brevis,cosine,unranked,richfield,newnham,recoverable,flightless,dispersing,clearfield,abu'l,stranraer,kempe,streamlining,goswami,epidermal,pieta,conciliatory,distilleries,electrophoresis,bonne,tiago,curiosities,candidature,picnicking,perihelion,lintel,povoa,gullies,configure,excision,facies,signers,1730s,insufficiency,semiotics,streatham,deactivation,entomological,skippers,albacete,parodying,escherichia,honorees,singaporeans,counterterrorism,tiruchirappalli,omnivorous,metropole,globalisation,athol,unbounded,codice_5,landforms,classifier,farmhouses,reaffirming,reparation,yomiuri,technologists,mitte,medica,viewable,steampunk,konya,kshatriya,repelling,edgewater,lamiinae,devas,potteries,llandaff,engendered,submits,virulence,uplifted,educationist,metropolitans,frontrunner,dunstable,forecastle,frets,methodius,exmouth,linnean,bouchet,repulsion,computable,equalling,liceo,tephritidae,agave,hydrological,azarenka,fairground,l'homme,enforces,xinhua,cinematographers,cooperstown,sa'id,paiute,christianization,tempos,chippenham,insulator,kotor,stereotyped,dello,cours,hisham,d'souza,eliminations,supercars,passau,rebrand,natures,coote,persephone,rededicated,cleaved,plenum,blistering,indiscriminately,cleese,safed,recursively,compacted,revues,hydration,shillong,echelons,garhwal,pedimented,grower,zwolle,wildflower,annexing,methionine,petah,valens,famitsu,petiole,specialities,nestorian,shahin,tokaido,shearwater,barberini,kinsmen,experimenter,alumnae,cloisters,alumina,pritzker,hardiness,soundgarden,julich,ps300,watercourse,cementing,wordplay,olivet,demesne,chasseurs,amide,zapotec,gaozu,porphyry,absorbers,indium,analogies,devotions,engravers,limestones,catapulted,surry,brickworks,gotra,rodham,landline,paleontologists,shankara,islip,raucous,trollope,arpad,embarkation,morphemes,recites,picardie,nakhchivan,tolerances,formula_47,khorramabad,nichiren,adrianople,kirkuk,assemblages,collider,bikaner,bushfires,roofline,coverings,reredos,bibliotheca,mantras,accentuated,commedia,rashtriya,fluctuation,serhiy,referential,fittipaldi,vesicle,geeta,iraklis,immediacy,chulalongkorn,hunsruck,bingen,dreadnoughts,stonemason,meenakshi,lebesgue,undergrowth,baltistan,paradoxes,parlement,articled,tiflis,dixieland,meriden,tejano,underdogs,barnstable,exemplify,venter,tropes,wielka,kankakee,iskandar,zilina,pharyngeal,spotify,materialised,picts,atlantique,theodoric,prepositions,paramilitaries,pinellas,attlee,actuated,piedmontese,grayling,thucydides,multifaceted,unedited,autonomously,universelle,utricularia,mooted,preto,incubated,underlie,brasenose,nootka,bushland,sensu,benzodiazepine,esteghlal,seagoing,amenhotep,azusa,sappers,culpeper,smokeless,thoroughbreds,dargah,gorda,alumna,mankato,zdroj,deleting,culvert,formula_49,punting,wushu,hindering,immunoglobulin,standardisation,birger,oilfield,quadrangular,ulama,recruiters,netanya,1630s,communaute,istituto,maciej,pathan,meher,vikas,characterizations,playmaker,interagency,intercepts,assembles,horthy,introspection,narada,matra,testes,radnicki,estonians,csiro,instar,mitford,adrenergic,crewmembers,haaretz,wasatch,lisburn,rangefinder,ordre,condensate,reforestation,corregidor,spvgg,modulator,mannerist,faulted,aspires,maktoum,squarepants,aethelred,piezoelectric,mulatto,dacre,progressions,jagiellonian,norge,samaria,sukhoi,effingham,coxless,hermetic,humanists,centrality,litters,stirlingshire,beaconsfield,sundanese,geometrically,caretakers,habitually,bandra,pashtuns,bradenton,arequipa,laminar,brickyard,hitchin,sustains,shipboard,ploughing,trechus,wheelers,bracketed,ilyushin,subotica,d'hondt,reappearance,bridgestone,intermarried,fulfilment,aphasia,birkbeck,transformational,strathmore,hornbill,millstone,lacan,voids,solothurn,gymnasiums,laconia,viaducts,peduncle,teachta,edgware,shinty,supernovae,wilfried,exclaim,parthia,mithun,flashpoint,moksha,cumbia,metternich,avalanches,militancy,motorist,rivadavia,chancellorsville,federals,gendered,bounding,footy,gauri,caliphs,lingam,watchmaker,unrecorded,riverina,unmodified,seafloor,droit,pfalz,chrysostom,gigabit,overlordship,besiege,espn2,oswestry,anachronistic,ballymena,reactivation,duchovny,ghani,abacetus,duller,legio,watercourses,nord-pas-de-calais,leiber,optometry,swarms,installer,sancti,adverbs,iheartmedia,meiningen,zeljko,kakheti,notional,circuses,patrilineal,acrobatics,infrastructural,sheva,oregonian,adjudication,aamir,wloclawek,overfishing,obstructive,subtracting,aurobindo,archeologist,newgate,'cause,secularization,tehsils,abscess,fingal,janacek,elkhorn,trims,kraftwerk,mandating,irregulars,faintly,congregationalist,sveti,kasai,mishaps,kennebec,provincially,durkheim,scotties,aicte,rapperswil,imphal,surrenders,morphs,nineveh,hoxha,cotabato,thuringian,metalworking,retold,shogakukan,anthers,proteasome,tippeligaen,disengagement,mockumentary,palatial,erupts,flume,corrientes,masthead,jaroslaw,rereleased,bharti,labors,distilling,tusks,varzim,refounded,enniskillen,melkite,semifinalists,vadodara,bermudian,capstone,grasse,origination,populus,alesi,arrondissements,semigroup,verein,opossum,messrs.,portadown,bulbul,tirupati,mulhouse,tetrahedron,roethlisberger,nonverbal,connexion,warangal,deprecated,gneiss,octet,vukovar,hesketh,chambre,despatch,claes,kargil,hideo,gravelly,tyndale,aquileia,tuners,defensible,tutte,theotokos,constructivist,ouvrage,dukla,polisario,monasticism,proscribed,commutation,testers,nipissing,codon,mesto,olivine,concomitant,exoskeleton,purports,coromandel,eyalet,dissension,hippocrates,purebred,yaounde,composting,oecophoridae,procopius,o'day,angiogenesis,sheerness,intelligencer,articular,felixstowe,aegon,endocrinology,trabzon,licinius,pagodas,zooplankton,hooghly,satie,drifters,sarthe,mercian,neuilly,tumours,canal+,scheldt,inclinations,counteroffensive,roadrunners,tuzla,shoreditch,surigao,predicates,carnot,algeciras,militaries,generalize,bulkheads,gawler,pollutant,celta,rundgren,microrna,gewog,olimpija,placental,lubelski,roxburgh,discerned,verano,kikuchi,musicale,l'enfant,ferocity,dimorphic,antigonus,erzurum,prebendary,recitative,discworld,cyrenaica,stigmella,totnes,sutta,pachuca,ulsan,downton,landshut,castellan,pleural,siedlce,siecle,catamaran,cottbus,utilises,trophic,freeholders,holyhead,u.s.s,chansons,responder,waziristan,suzuka,birding,shogi,asker,acetone,beautification,cytotoxic,dixit,hunterdon,cobblestone,formula_48,kossuth,devizes,sokoto,interlaced,shuttered,kilowatts,assiniboine,isaak,salto,alderney,sugarloaf,franchising,aggressiveness,toponyms,plaintext,antimatter,henin,equidistant,salivary,bilingualism,mountings,obligate,extirpated,irenaeus,misused,pastoralists,aftab,immigrating,warping,tyrolean,seaforth,teesside,soundwave,oligarchy,stelae,pairwise,iupac,tezuka,posht,orchestrations,landmass,ironstone,gallia,hjalmar,carmelites,strafford,elmhurst,palladio,fragility,teleplay,gruffudd,karoly,yerba,potok,espoo,inductance,macaque,nonprofits,pareto,rock'n'roll,spiritualist,shadowed,skateboarder,utterances,generality,congruence,prostrate,deterred,yellowknife,albarn,maldon,battlements,mohsen,insecticides,khulna,avellino,menstruation,glutathione,springdale,parlophone,confraternity,korps,countrywide,bosphorus,preexisting,damodar,astride,alexandrovich,sprinting,crystallized,botev,leaching,interstates,veers,angevin,undaunted,yevgeni,nishapur,northerners,alkmaar,bethnal,grocers,sepia,tornus,exemplar,trobe,charcot,gyeonggi,larne,tournai,lorain,voided,genji,enactments,maxilla,adiabatic,eifel,nazim,transducer,thelonious,pyrite,deportiva,dialectal,bengt,rosettes,labem,sergeyevich,synoptic,conservator,statuette,biweekly,adhesives,bifurcation,rajapaksa,mammootty,republique,yusef,waseda,marshfield,yekaterinburg,minnelli,fundy,fenian,matchups,dungannon,supremacist,panelled,drenthe,iyengar,fibula,narmada,homeport,oceanside,precept,antibacterial,altarpieces,swath,ospreys,lillooet,legnica,lossless,formula_50,galvatron,iorga,stormont,rsfsr,loggers,kutno,phenomenological,medallists,cuatro,soissons,homeopathy,bituminous,injures,syndicates,typesetting,displacements,dethroned,makassar,lucchese,abergavenny,targu,alborz,akb48,boldface,gastronomy,sacra,amenity,accumulator,myrtaceae,cornices,mourinho,denunciation,oxbow,diddley,aargau,arbitrage,bedchamber,gruffydd,zamindar,klagenfurt,caernarfon,slowdown,stansted,abrasion,tamaki,suetonius,dukakis,individualistic,ventrally,hotham,perestroika,ketones,fertilisation,sobriquet,couplings,renderings,misidentified,rundfunk,sarcastically,braniff,concours,dismissals,elegantly,modifiers,crediting,combos,crucially,seafront,lieut,ischemia,manchus,derivations,proteases,aristophanes,adenauer,porting,hezekiah,sante,trulli,hornblower,foreshadowing,ypsilanti,dharwad,khani,hohenstaufen,distillers,cosmodrome,intracranial,turki,salesian,gorzow,jihlava,yushchenko,leichhardt,venables,cassia,eurogamer,airtel,curative,bestsellers,timeform,sortied,grandview,massillon,ceding,pilbara,chillicothe,heredity,elblag,rogaland,ronne,millennial,batley,overuse,bharata,fille,campbelltown,abeyance,counterclockwise,250cc,neurodegenerative,consigned,electromagnetism,sunnah,saheb,exons,coxswain,gleaned,bassoons,worksop,prismatic,immigrate,pickets,takeo,bobsledder,stosur,fujimori,merchantmen,stiftung,forli,endorses,taskforce,thermally,atman,gurps,floodplains,enthalpy,extrinsic,setubal,kennesaw,grandis,scalability,durations,showrooms,prithvi,outro,overruns,andalucia,amanita,abitur,hipper,mozambican,sustainment,arsene,chesham,palaeolithic,reportage,criminality,knowsley,haploid,atacama,shueisha,ridgefield,astern,getafe,lineal,timorese,restyled,hollies,agincourt,unter,justly,tannins,mataram,industrialised,tarnovo,mumtaz,mustapha,stretton,synthetase,condita,allround,putra,stjepan,troughs,aechmea,specialisation,wearable,kadokawa,uralic,aeros,messiaen,existentialism,jeweller,effigies,gametes,fjordane,cochlear,interdependent,demonstrative,unstructured,emplacement,famines,spindles,amplitudes,actuator,tantalum,psilocybe,apnea,monogatari,expulsions,seleucus,tsuen,hospitaller,kronstadt,eclipsing,olympiakos,clann,canadensis,inverter,helio,egyptologist,squamous,resonate,munir,histology,torbay,khans,jcpenney,veterinarians,aintree,microscopes,colonised,reflectors,phosphorylated,pristimantis,tulare,corvinus,multiplexing,midweek,demosthenes,transjordan,ecija,tengku,vlachs,anamorphic,counterweight,radnor,trinitarian,armidale,maugham,njsiaa,futurism,stairways,avicenna,montebello,bridgetown,wenatchee,lyonnais,amass,surinamese,streptococcus,m*a*s*h,hydrogenation,frazioni,proscenium,kalat,pennsylvanian,huracan,tallying,kralove,nucleolar,phrygian,seaports,hyacinthe,ignace,donning,instalment,regnal,fonds,prawn,carell,folktales,goaltending,bracknell,vmware,patriarchy,mitsui,kragujevac,pythagoras,soult,thapa,disproved,suwalki,secures,somoza,l'ecole,divizia,chroma,herders,technologist,deduces,maasai,rampur,paraphrase,raimi,imaged,magsaysay,ivano,turmeric,formula_51,subcommittees,axillary,ionosphere,organically,indented,refurbishing,pequot,violinists,bearn,colle,contralto,silverton,mechanization,etruscans,wittelsbach,pasir,redshirted,marrakesh,scarp,plein,wafers,qareh,teotihuacan,frobenius,sinensis,rehoboth,bundaberg,newbridge,hydrodynamic,traore,abubakar,adjusts,storytellers,dynamos,verbandsliga,concertmaster,exxonmobil,appreciable,sieradz,marchioness,chaplaincy,rechristened,cunxu,overpopulation,apolitical,sequencer,beaked,nemanja,binaries,intendant,absorber,filamentous,indebtedness,nusra,nashik,reprises,psychedelia,abwehr,ligurian,isoform,resistive,pillaging,mahathir,reformatory,lusatia,allerton,ajaccio,tepals,maturin,njcaa,abyssinian,objector,fissures,sinuous,ecclesiastic,dalits,caching,deckers,phosphates,wurlitzer,navigated,trofeo,berea,purefoods,solway,unlockable,grammys,kostroma,vocalizations,basilan,rebuke,abbasi,douala,helsingborg,ambon,bakar,runestones,cenel,tomislav,pigmented,northgate,excised,seconda,kirke,determinations,dedicates,vilas,pueblos,reversion,unexploded,overprinted,ekiti,deauville,masato,anaesthesia,endoplasmic,transponders,aguascalientes,hindley,celluloid,affording,bayeux,piaget,rickshaws,eishockey,camarines,zamalek,undersides,hardwoods,hermitian,mutinied,monotone,blackmails,affixes,jpmorgan,habermas,mitrovica,paleontological,polystyrene,thana,manas,conformist,turbofan,decomposes,logano,castration,metamorphoses,patroness,herbicide,mikolaj,rapprochement,macroeconomics,barranquilla,matsudaira,lintels,femina,hijab,spotsylvania,morpheme,bitola,baluchistan,kurukshetra,otway,extrusion,waukesha,menswear,helder,trung,bingley,protester,boars,overhang,differentials,exarchate,hejaz,kumara,unjustified,timings,sharpness,nuovo,taisho,sundar,etc..,jehan,unquestionably,muscovy,daltrey,canute,paneled,amedeo,metroplex,elaborates,telus,tetrapods,dragonflies,epithets,saffir,parthenon,lucrezia,refitting,pentateuch,hanshin,montparnasse,lumberjacks,sanhedrin,erectile,odors,greenstone,resurgent,leszek,amory,substituents,prototypical,viewfinder,monck,universiteit,joffre,revives,chatillon,seedling,scherzo,manukau,ashdod,gympie,homolog,stalwarts,ruinous,weibo,tochigi,wallenberg,gayatri,munda,satyagraha,storefronts,heterogeneity,tollway,sportswriters,binocular,gendarmes,ladysmith,tikal,ortsgemeinde,ja'far,osmotic,linlithgow,bramley,telecoms,pugin,repose,rupaul,sieur,meniscus,garmisch,reintroduce,400th,shoten,poniatowski,drome,kazakhstani,changeover,astronautics,husserl,herzl,hypertext,katakana,polybius,antananarivo,seong,breguet,reliquary,utada,aggregating,liangshan,sivan,tonawanda,audiobooks,shankill,coulee,phenolic,brockton,bookmakers,handsets,boaters,wylde,commonality,mappings,silhouettes,pennines,maurya,pratchett,singularities,eschewed,pretensions,vitreous,ibero,totalitarianism,poulenc,lingered,directx,seasoning,deputation,interdict,illyria,feedstock,counterbalance,muzik,buganda,parachuted,violist,homogeneity,comix,fjords,corsairs,punted,verandahs,equilateral,laoghaire,magyars,117th,alesund,televoting,mayotte,eateries,refurbish,nswrl,yukio,caragiale,zetas,dispel,codecs,inoperable,outperformed,rejuvenation,elstree,modernise,contributory,pictou,tewkesbury,chechens,ashina,psionic,refutation,medico,overdubbed,nebulae,sandefjord,personages,eccellenza,businessperson,placename,abenaki,perryville,threshing,reshaped,arecibo,burslem,colspan=3|turnout,rebadged,lumia,erinsborough,interactivity,bitmap,indefatigable,theosophy,excitatory,gleizes,edsel,bermondsey,korce,saarinen,wazir,diyarbakir,cofounder,liberalisation,onsen,nighthawks,siting,retirements,semyon,d'histoire,114th,redditch,venetia,praha,'round,valdosta,hieroglyphic,postmedial,edirne,miscellany,savona,cockpits,minimization,coupler,jacksonian,appeasement,argentines,saurashtra,arkwright,hesiod,folios,fitzalan,publica,rivaled,civitas,beermen,constructivism,ribeira,zeitschrift,solanum,todos,deformities,chilliwack,verdean,meagre,bishoprics,gujrat,yangzhou,reentered,inboard,mythologies,virtus,unsurprisingly,rusticated,museu,symbolise,proportionate,thesaban,symbian,aeneid,mitotic,veliki,compressive,cisterns,abies,winemaker,massenet,bertolt,ahmednagar,triplemania,armorial,administracion,tenures,smokehouse,hashtag,fuerza,regattas,gennady,kanazawa,mahmudabad,crustal,asaph,valentinian,ilaiyaraaja,honeyeater,trapezoidal,cooperatively,unambiguously,mastodon,inhospitable,harnesses,riverton,renewables,djurgardens,haitians,airings,humanoids,boatswain,shijiazhuang,faints,veera,punjabis,steepest,narain,karlovy,serre,sulcus,collectives,1500m,arion,subarctic,liberally,apollonius,ostia,droplet,headstones,norra,robusta,maquis,veronese,imola,primers,luminance,escadrille,mizuki,irreconcilable,stalybridge,temur,paraffin,stuccoed,parthians,counsels,fundamentalists,vivendi,polymath,sugababes,mikko,yonne,fermions,vestfold,pastoralist,kigali,unseeded,glarus,cusps,amasya,northwesterly,minorca,astragalus,verney,trevelyan,antipathy,wollstonecraft,bivalves,boulez,royle,divisao,quranic,bareilly,coronal,deviates,lulea,erectus,petronas,chandan,proxies,aeroflot,postsynaptic,memoriam,moyne,gounod,kuznetsova,pallava,ordinating,reigate,'first,lewisburg,exploitative,danby,academica,bailiwick,brahe,injective,stipulations,aeschylus,computes,gulden,hydroxylase,liveries,somalis,underpinnings,muscovite,kongsberg,domus,overlain,shareware,variegated,jalalabad,agence,ciphertext,insectivores,dengeki,menuhin,cladistic,baerum,betrothal,tokushima,wavelet,expansionist,pottsville,siyuan,prerequisites,carpi,nemzeti,nazar,trialled,eliminator,irrorated,homeward,redwoods,undeterred,strayed,lutyens,multicellular,aurelian,notated,lordships,alsatian,idents,foggia,garros,chalukyas,lillestrom,podlaski,pessimism,hsien,demilitarized,whitewashed,willesden,kirkcaldy,sanctorum,lamia,relaying,escondido,paediatric,contemplates,demarcated,bluestone,betula,penarol,capitalise,kreuznach,kenora,115th,hold'em,reichswehr,vaucluse,m.i.a,windings,boys/girls,cajon,hisar,predictably,flemington,ysgol,mimicked,clivina,grahamstown,ionia,glyndebourne,patrese,aquaria,sleaford,dayal,sportscenter,malappuram,m.b.a.,manoa,carbines,solvable,designator,ramanujan,linearity,academicians,sayid,lancastrian,factorial,strindberg,vashem,delos,comyn,condensing,superdome,merited,kabaddi,intransitive,bideford,neuroimaging,duopoly,scorecards,ziggler,heriot,boyars,virology,marblehead,microtubules,westphalian,anticipates,hingham,searchers,harpist,rapides,morricone,convalescent,mises,nitride,metrorail,matterhorn,bicol,drivetrain,marketer,snippet,winemakers,muban,scavengers,halberstadt,herkimer,peten,laborious,stora,montgomeryshire,booklist,shamir,herault,eurostar,anhydrous,spacewalk,ecclesia,calliostoma,highschool,d'oro,suffusion,imparts,overlords,tagus,rectifier,counterinsurgency,ministered,eilean,milecastle,contre,micromollusk,okhotsk,bartoli,matroid,hasidim,thirunal,terme,tarlac,lashkar,presque,thameslink,flyby,troopship,renouncing,fatih,messrs,vexillum,bagration,magnetite,bornholm,androgynous,vehement,tourette,philosophic,gianfranco,tuileries,codice_6,radially,flexion,hants,reprocessing,setae,burne,palaeographically,infantryman,shorebirds,tamarind,moderna,threading,militaristic,crohn,norrkoping,125cc,stadtholder,troms,klezmer,alphanumeric,brome,emmanuelle,tiwari,alchemical,formula_52,onassis,bleriot,bipedal,colourless,hermeneutics,hosni,precipitating,turnstiles,hallucinogenic,panhellenic,wyandotte,elucidated,chita,ehime,generalised,hydrophilic,biota,niobium,rnzaf,gandhara,longueuil,logics,sheeting,bielsko,cuvier,kagyu,trefoil,docent,pancrase,stalinism,postures,encephalopathy,monckton,imbalances,epochs,leaguers,anzio,diminishes,pataki,nitrite,amuro,nabil,maybach,l'aquila,babbler,bacolod,thutmose,evora,gaudi,breakage,recur,preservative,60deg,mendip,functionaries,columnar,maccabiah,chert,verden,bromsgrove,clijsters,dengue,pastorate,phuoc,principia,viareggio,kharagpur,scharnhorst,anyang,bosons,l'art,criticises,ennio,semarang,brownian,mirabilis,asperger,calibers,typographical,cartooning,minos,disembark,supranational,undescribed,etymologically,alappuzha,vilhelm,lanao,pakenham,bhagavata,rakoczi,clearings,astrologers,manitowoc,bunuel,acetylene,scheduler,defamatory,trabzonspor,leaded,scioto,pentathlete,abrahamic,minigames,aldehydes,peerages,legionary,1640s,masterworks,loudness,bryansk,likeable,genocidal,vegetated,towpath,declination,pyrrhus,divinely,vocations,rosebery,associazione,loaders,biswas,oeste,tilings,xianzong,bhojpuri,annuities,relatedness,idolator,psers,constriction,chuvash,choristers,hanafi,fielders,grammarian,orpheum,asylums,millbrook,gyatso,geldof,stabilise,tableaux,diarist,kalahari,panini,cowdenbeath,melanin,4x100m,resonances,pinar,atherosclerosis,sheringham,castlereagh,aoyama,larks,pantograph,protrude,natak,gustafsson,moribund,cerevisiae,cleanly,polymeric,holkar,cosmonauts,underpinning,lithosphere,firuzabad,languished,mingled,citrate,spadina,lavas,daejeon,fibrillation,porgy,pineville,ps1000,cobbled,emamzadeh,mukhtar,dampers,indelible,salonika,nanoscale,treblinka,eilat,purporting,fluctuate,mesic,hagiography,cutscenes,fondation,barrens,comically,accrue,ibrox,makerere,defections,'there,hollandia,skene,grosseto,reddit,objectors,inoculation,rowdies,playfair,calligrapher,namor,sibenik,abbottabad,propellants,hydraulically,chloroplasts,tablelands,tecnico,schist,klasse,shirvan,bashkortostan,bullfighting,north/south,polski,hanns,woodblock,kilmore,ejecta,ignacy,nanchang,danubian,commendations,snohomish,samaritans,argumentation,vasconcelos,hedgehogs,vajrayana,barents,kulkarni,kumbakonam,identifications,hillingdon,weirs,nayanar,beauvoir,messe,divisors,atlantiques,broods,affluence,tegucigalpa,unsuited,autodesk,akash,princeps,culprits,kingstown,unassuming,goole,visayan,asceticism,blagojevich,irises,paphos,unsound,maurier,pontchartrain,desertification,sinfonietta,latins,especial,limpet,valerenga,glial,brainstem,mitral,parables,sauropod,judean,iskcon,sarcoma,venlo,justifications,zhuhai,blavatsky,alleviated,usafe,steppenwolf,inversions,janko,chagall,secretory,basildon,saguenay,pergamon,hemispherical,harmonized,reloading,franjo,domaine,extravagance,relativism,metamorphosed,labuan,baloncesto,gmail,byproducts,calvinists,counterattacked,vitus,bubonic,120th,strachey,ritually,brookwood,selectable,savinja,incontinence,meltwater,jinja,1720s,brahmi,morgenthau,sheaves,sleeved,stratovolcano,wielki,utilisation,avoca,fluxus,panzergrenadier,philately,deflation,podlaska,prerogatives,kuroda,theophile,zhongzong,gascoyne,magus,takao,arundell,fylde,merdeka,prithviraj,venkateswara,liepaja,daigo,dreamland,reflux,sunnyvale,coalfields,seacrest,soldering,flexor,structuralism,alnwick,outweighed,unaired,mangeshkar,batons,glaad,banshees,irradiated,organelles,biathlete,cabling,chairlift,lollapalooza,newsnight,capacitive,succumbs,flatly,miramichi,burwood,comedienne,charteris,biotic,workspace,aficionados,sokolka,chatelet,o'shaughnessy,prosthesis,neoliberal,refloated,oppland,hatchlings,econometrics,loess,thieu,androids,appalachians,jenin,pterostichinae,downsized,foils,chipsets,stencil,danza,narrate,maginot,yemenite,bisects,crustacean,prescriptive,melodious,alleviation,empowers,hansson,autodromo,obasanjo,osmosis,daugava,rheumatism,moraes,leucine,etymologies,chepstow,delaunay,bramall,bajaj,flavoring,approximates,marsupials,incisive,microcomputer,tactically,waals,wilno,fisichella,ursus,hindmarsh,mazarin,lomza,xenophobia,lawlessness,annecy,wingers,gornja,gnaeus,superieur,tlaxcala,clasps,symbolises,slats,rightist,effector,blighted,permanence,divan,progenitors,kunsthalle,anointing,excelling,coenzyme,indoctrination,dnipro,landholdings,adriaan,liturgies,cartan,ethmia,attributions,sanctus,trichy,chronicon,tancred,affinis,kampuchea,gantry,pontypool,membered,distrusted,fissile,dairies,hyposmocoma,craigie,adarsh,martinsburg,taxiway,30deg,geraint,vellum,bencher,khatami,formula_53,zemun,teruel,endeavored,palmares,pavements,u.s..,internationalization,satirized,carers,attainable,wraparound,muang,parkersburg,extinctions,birkenfeld,wildstorm,payers,cohabitation,unitas,culloden,capitalizing,clwyd,daoist,campinas,emmylou,orchidaceae,halakha,orientales,fealty,domnall,chiefdom,nigerians,ladislav,dniester,avowed,ergonomics,newsmagazine,kitsch,cantilevered,benchmarking,remarriage,alekhine,coldfield,taupo,almirante,substations,apprenticeships,seljuq,levelling,eponym,symbolising,salyut,opioids,underscore,ethnologue,mohegan,marikina,libro,bassano,parse,semantically,disjointed,dugdale,padraig,tulsi,modulating,xfinity,headlands,mstislav,earthworms,bourchier,lgbtq,embellishments,pennants,rowntree,betel,motet,mulla,catenary,washoe,mordaunt,dorking,colmar,girardeau,glentoran,grammatically,samad,recreations,technion,staccato,mikoyan,spoilers,lyndhurst,victimization,chertsey,belafonte,tondo,tonsberg,narrators,subcultures,malformations,edina,augmenting,attests,euphemia,cabriolet,disguising,1650s,navarrese,demoralized,cardiomyopathy,welwyn,wallachian,smoothness,planktonic,voles,issuers,sardasht,survivability,cuauhtemoc,thetis,extruded,signet,raghavan,lombok,eliyahu,crankcase,dissonant,stolberg,trencin,desktops,bursary,collectivization,charlottenburg,triathlete,curvilinear,involuntarily,mired,wausau,invades,sundaram,deletions,bootstrap,abellio,axiomatic,noguchi,setups,malawian,visalia,materialist,kartuzy,wenzong,plotline,yeshivas,parganas,tunica,citric,conspecific,idlib,superlative,reoccupied,blagoevgrad,masterton,immunological,hatta,courbet,vortices,swallowtail,delves,haridwar,diptera,boneh,bahawalpur,angering,mardin,equipments,deployable,guanine,normality,rimmed,artisanal,boxset,chandrasekhar,jools,chenar,tanakh,carcassonne,belatedly,millville,anorthosis,reintegration,velde,surfactant,kanaan,busoni,glyphipterix,personas,fullness,rheims,tisza,stabilizers,bharathi,joost,spinola,mouldings,perching,esztergom,afzal,apostate,lustre,s.league,motorboat,monotheistic,armature,barat,asistencia,bloomsburg,hippocampal,fictionalised,defaults,broch,hexadecimal,lusignan,ryanair,boccaccio,breisgau,southbank,bskyb,adjoined,neurobiology,aforesaid,sadhu,langue,headship,wozniacki,hangings,regulus,prioritized,dynamism,allier,hannity,shimin,antoninus,gymnopilus,caledon,preponderance,melayu,electrodynamics,syncopated,ibises,krosno,mechanistic,morpeth,harbored,albini,monotheism,'real,hyperactivity,haveli,writer/director,minato,nimoy,caerphilly,chitral,amirabad,fanshawe,l'oreal,lorde,mukti,authoritarianism,valuing,spyware,hanbury,restarting,stato,embed,suiza,empiricism,stabilisation,stari,castlemaine,orbis,manufactory,mauritanian,shoji,taoyuan,prokaryotes,oromia,ambiguities,embodying,slims,frente,innovate,ojibwa,powdery,gaeltacht,argentinos,quatermass,detergents,fijians,adaptor,tokai,chileans,bulgars,oxidoreductases,bezirksliga,conceicao,myosin,nellore,500cc,supercomputers,approximating,glyndwr,polypropylene,haugesund,cockerell,tudman,ashbourne,hindemith,bloodlines,rigveda,etruria,romanos,steyn,oradea,deceleration,manhunter,laryngeal,fraudulently,janez,wendover,haplotype,janaki,naoki,belizean,mellencamp,cartographic,sadhana,tricolour,pseudoscience,satara,bytow,s.p.a.,jagdgeschwader,arcot,omagh,sverdrup,masterplan,surtees,apocrypha,ahvaz,d'amato,socratic,leumit,unnumbered,nandini,witold,marsupial,coalesced,interpolated,gimnasia,karadzic,keratin,mamoru,aldeburgh,speculator,escapement,irfan,kashyap,satyajit,haddington,solver,rothko,ashkelon,kickapoo,yeomen,superbly,bloodiest,greenlandic,lithic,autofocus,yardbirds,poona,keble,javan,sufis,expandable,tumblr,ursuline,swimwear,winwood,counsellors,aberrations,marginalised,befriending,workouts,predestination,varietal,siddhartha,dunkeld,judaic,esquimalt,shabab,ajith,telefonica,stargard,hoysala,radhakrishnan,sinusoidal,strada,hiragana,cebuano,monoid,independencia,floodwaters,mildura,mudflats,ottokar,translit,radix,wigner,philosophically,tephritid,synthesizing,castletown,installs,stirner,resettle,bushfire,choirmaster,kabbalistic,shirazi,lightship,rebus,colonizers,centrifuge,leonean,kristofferson,thymus,clackamas,ratnam,rothesay,municipally,centralia,thurrock,gulfport,bilinear,desirability,merite,psoriasis,macaw,erigeron,consignment,mudstone,distorting,karlheinz,ramen,tailwheel,vitor,reinsurance,edifices,superannuation,dormancy,contagion,cobden,rendezvoused,prokaryotic,deliberative,patricians,feigned,degrades,starlings,sopot,viticultural,beaverton,overflowed,convener,garlands,michiel,ternopil,naturelle,biplanes,bagot,gamespy,ventspils,disembodied,flattening,profesional,londoners,arusha,scapular,forestall,pyridine,ulema,eurodance,aruna,callus,periodontal,coetzee,immobilized,o'meara,maharani,katipunan,reactants,zainab,microgravity,saintes,britpop,carrefour,constrain,adversarial,firebirds,brahmo,kashima,simca,surety,surpluses,superconductivity,gipuzkoa,cumans,tocantins,obtainable,humberside,roosting,'king,formula_54,minelayer,bessel,sulayman,cycled,biomarkers,annealing,shusha,barda,cassation,djing,polemics,tuple,directorates,indomitable,obsolescence,wilhelmine,pembina,bojan,tambo,dioecious,pensioner,magnificat,1660s,estrellas,southeasterly,immunodeficiency,railhead,surreptitiously,codeine,encores,religiosity,tempera,camberley,efendi,boardings,malleable,hagia,input/output,lucasfilm,ujjain,polymorphisms,creationist,berners,mickiewicz,irvington,linkedin,endures,kinect,munition,apologetics,fairlie,predicated,reprinting,ethnographer,variances,levantine,mariinsky,jadid,jarrow,asia/oceania,trinamool,waveforms,bisexuality,preselection,pupae,buckethead,hieroglyph,lyricists,marionette,dunbartonshire,restorer,monarchical,pazar,kickoffs,cabildo,savannas,gliese,dench,spoonbills,novelette,diliman,hypersensitivity,authorising,montefiore,mladen,qu'appelle,theistic,maruti,laterite,conestoga,saare,californica,proboscis,carrickfergus,imprecise,hadassah,baghdadi,jolgeh,deshmukh,amusements,heliopolis,berle,adaptability,partenkirchen,separations,baikonur,cardamom,southeastward,southfield,muzaffar,adequacy,metropolitana,rajkot,kiyoshi,metrobus,evictions,reconciles,librarianship,upsurge,knightley,badakhshan,proliferated,spirituals,burghley,electroacoustic,professing,featurette,reformists,skylab,descriptors,oddity,greyfriars,injects,salmond,lanzhou,dauntless,subgenera,underpowered,transpose,mahinda,gatos,aerobatics,seaworld,blocs,waratahs,joris,giggs,perfusion,koszalin,mieczyslaw,ayyubid,ecologists,modernists,sant'angelo,quicktime,him/her,staves,sanyo,melaka,acrocercops,qigong,iterated,generalizes,recuperation,vihara,circassians,psychical,chavo,memoires,infiltrates,notaries,pelecaniformesfamily,strident,chivalric,pierrepont,alleviating,broadsides,centipede,b.tech,reinterpreted,sudetenland,hussite,covenanters,radhika,ironclads,gainsbourg,testis,penarth,plantar,azadegan,beano,espn.com,leominster,autobiographies,nbcuniversal,eliade,khamenei,montferrat,undistinguished,ethnological,wenlock,fricatives,polymorphic,biome,joule,sheaths,astrophysicist,salve,neoclassicism,lovat,downwind,belisarius,forma,usurpation,freie,depopulation,backbench,ascenso,'high,aagpbl,gdanski,zalman,mouvement,encapsulation,bolshevism,statny,voyageurs,hywel,vizcaya,mazra'eh,narthex,azerbaijanis,cerebrospinal,mauretania,fantail,clearinghouse,bolingbroke,pequeno,ansett,remixing,microtubule,wrens,jawahar,palembang,gambian,hillsong,fingerboard,repurposed,sundry,incipient,veolia,theologically,ulaanbaatar,atsushi,foundling,resistivity,myeloma,factbook,mazowiecka,diacritic,urumqi,clontarf,provokes,intelsat,professes,materialise,portobello,benedictines,panionios,introverted,reacquired,bridport,mammary,kripke,oratorios,vlore,stoning,woredas,unreported,antti,togolese,fanzines,heuristics,conservatories,carburetors,clitheroe,cofounded,formula_57,erupting,quinnipiac,bootle,ghostface,sittings,aspinall,sealift,transferase,boldklub,siskiyou,predominated,francophonie,ferruginous,castrum,neogene,sakya,madama,precipitous,'love,posix,bithynia,uttara,avestan,thrushes,seiji,memorably,septimius,libri,cibernetico,hyperinflation,dissuaded,cuddalore,peculiarity,vaslui,grojec,albumin,thurles,casks,fasteners,fluidity,buble,casals,terek,gnosticism,cognates,ulnar,radwanska,babylonians,majuro,oxidizer,excavators,rhythmically,liffey,gorakhpur,eurydice,underscored,arborea,lumumba,tuber,catholique,grama,galilei,scrope,centreville,jacobin,bequests,ardeche,polygamous,montauban,terai,weatherboard,readability,attainder,acraea,transversely,rivets,winterbottom,reassures,bacteriology,vriesea,chera,andesite,dedications,homogenous,reconquered,bandon,forrestal,ukiyo,gurdjieff,tethys,sparc,muscogee,grebes,belchatow,mansa,blantyre,palliser,sokolow,fibroblasts,exmoor,misaki,soundscapes,housatonic,middelburg,convenor,leyla,antipope,histidine,okeechobee,alkenes,sombre,alkene,rubik,macaques,calabar,trophee,pinchot,'free,frusciante,chemins,falaise,vasteras,gripped,schwarzenberg,cumann,kanchipuram,acoustically,silverbacks,fangio,inset,plympton,kuril,vaccinations,recep,theropods,axils,stavropol,encroached,apoptotic,papandreou,wailers,moonstone,assizes,micrometers,hornchurch,truncation,annapurna,egyptologists,rheumatic,promiscuity,satiric,fleche,caloptilia,anisotropy,quaternions,gruppo,viscounts,awardees,aftershocks,sigint,concordance,oblasts,gaumont,stent,commissars,kesteven,hydroxy,vijayanagar,belorussian,fabricius,watermark,tearfully,mamet,leukaemia,sorkh,milepost,tattooing,vosta,abbasids,uncompleted,hedong,woodwinds,extinguishing,malus,multiplexes,francoist,pathet,responsa,bassists,'most,postsecondary,ossory,grampian,saakashvili,alito,strasberg,impressionistic,volador,gelatinous,vignette,underwing,campanian,abbasabad,albertville,hopefuls,nieuwe,taxiways,reconvened,recumbent,pathologists,unionized,faversham,asymptotically,romulo,culling,donja,constricted,annesley,duomo,enschede,lovech,sharpshooter,lansky,dhamma,papillae,alanine,mowat,delius,wrest,mcluhan,podkarpackie,imitators,bilaspur,stunting,pommel,casemate,handicaps,nagas,testaments,hemings,necessitate,rearward,locative,cilla,klitschko,lindau,merion,consequential,antic,soong,copula,berthing,chevrons,rostral,sympathizer,budokan,ranulf,beria,stilt,replying,conflated,alcibiades,painstaking,yamanashi,calif.,arvid,ctesiphon,xizong,rajas,caxton,downbeat,resurfacing,rudders,miscegenation,deathmatch,foregoing,arthropod,attestation,karts,reapportionment,harnessing,eastlake,schola,dosing,postcolonial,imtiaz,formula_55,insulators,gunung,accumulations,pampas,llewelyn,bahnhof,cytosol,grosjean,teaneck,briarcliff,arsenio,canara,elaborating,passchendaele,searchlights,holywell,mohandas,preventable,gehry,mestizos,ustinov,cliched,'national,heidfeld,tertullian,jihadist,tourer,miletus,semicircle,outclassed,bouillon,cardinalate,clarifies,dakshina,bilayer,pandyan,unrwa,chandragupta,formula_56,portola,sukumaran,lactation,islamia,heikki,couplers,misappropriation,catshark,montt,ploughs,carib,stator,leaderboard,kenrick,dendrites,scape,tillamook,molesworth,mussorgsky,melanesia,restated,troon,glycoside,truckee,headwater,mashup,sectoral,gangwon,docudrama,skirting,psychopathology,dramatised,ostroleka,infestations,thabo,depolarization,wideroe,eisenbahn,thomond,kumaon,upendra,foreland,acronyms,yaqui,retaking,raphaelite,specie,dupage,villars,lucasarts,chloroplast,werribee,balsa,ascribe,havant,flava,khawaja,tyumen,subtract,interrogators,reshaping,buzzcocks,eesti,campanile,potemkin,apertures,snowboarder,registrars,handbooks,boyar,contaminant,depositors,proximate,jeunesse,zagora,pronouncements,mists,nihilism,deified,margraviate,pietersen,moderators,amalfi,adjectival,copepods,magnetosphere,pallets,clemenceau,castra,perforation,granitic,troilus,grzegorz,luthier,dockyards,antofagasta,ffestiniog,subroutine,afterword,waterwheel,druce,nitin,undifferentiated,emacs,readmitted,barneveld,tapers,hittites,infomercials,infirm,braathens,heligoland,carpark,geomagnetic,musculoskeletal,nigerien,machinima,harmonize,repealing,indecency,muskoka,verite,steubenville,suffixed,cytoskeleton,surpasses,harmonia,imereti,ventricles,heterozygous,envisions,otsego,ecoles,warrnambool,burgenland,seria,rawat,capistrano,welby,kirin,enrollments,caricom,dragonlance,schaffhausen,expanses,photojournalism,brienne,etude,referent,jamtland,schemas,xianbei,cleburne,bicester,maritima,shorelines,diagonals,bjelke,nonpublic,aliasing,m.f.a,ovals,maitreya,skirmishing,grothendieck,sukhothai,angiotensin,bridlington,durgapur,contras,gakuen,skagit,rabbinate,tsunamis,haphazard,tyldesley,microcontroller,discourages,hialeah,compressing,septimus,larvik,condoleezza,psilocybin,protectionism,songbirds,clandestinely,selectmen,wargame,cinemascope,khazars,agronomy,melzer,latifah,cherokees,recesses,assemblymen,basescu,banaras,bioavailability,subchannels,adenine,o'kelly,prabhakar,leonese,dimethyl,testimonials,geoffroy,oxidant,universiti,gheorghiu,bohdan,reversals,zamorin,herbivore,jarre,sebastiao,infanterie,dolmen,teddington,radomsko,spaceships,cuzco,recapitulation,mahoning,bainimarama,myelin,aykroyd,decals,tokelau,nalgonda,rajasthani,121st,quelled,tambov,illyrians,homilies,illuminations,hypertrophy,grodzisk,inundation,incapacity,equilibria,combats,elihu,steinitz,berengar,gowda,canwest,khosrau,maculata,houten,kandinsky,onside,leatherhead,heritable,belvidere,federative,chukchi,serling,eruptive,patan,entitlements,suffragette,evolutions,migrates,demobilisation,athleticism,trope,sarpsborg,kensal,translink,squamish,concertgebouw,energon,timestamp,competences,zalgiris,serviceman,codice_7,spoofing,assange,mahadevan,skien,suceava,augustan,revisionism,unconvincing,hollande,drina,gottlob,lippi,broglie,darkening,tilapia,eagerness,nacht,kolmogorov,photometric,leeuwarden,jrotc,haemorrhage,almanack,cavalli,repudiation,galactose,zwickau,cetinje,houbraken,heavyweights,gabonese,ordinals,noticias,museveni,steric,charaxes,amjad,resection,joinville,leczyca,anastasius,purbeck,subtribe,dalles,leadoff,monoamine,jettisoned,kaori,anthologized,alfreton,indic,bayezid,tottori,colonizing,assassinating,unchanging,eusebian,d'estaing,tsingtao,toshio,transferases,peronist,metrology,equus,mirpur,libertarianism,kovil,indole,'green,abstention,quantitatively,icebreakers,tribals,mainstays,dryandra,eyewear,nilgiri,chrysanthemum,inositol,frenetic,merchantman,hesar,physiotherapist,transceiver,dancefloor,rankine,neisse,marginalization,lengthen,unaided,rework,pageantry,savio,striated,funen,witton,illuminates,frass,hydrolases,akali,bistrita,copywriter,firings,handballer,tachinidae,dmytro,coalesce,neretva,menem,moraines,coatbridge,crossrail,spoofed,drosera,ripen,protour,kikuyu,boleslav,edwardes,troubadours,haplogroups,wrasse,educationalist,sroda,khaneh,dagbladet,apennines,neuroscientist,deplored,terje,maccabees,daventry,spaceport,lessening,ducats,singer/guitarist,chambersburg,yeong,configurable,ceremonially,unrelenting,caffe,graaf,denizens,kingsport,ingush,panhard,synthesised,tumulus,homeschooled,bozorg,idiomatic,thanhouser,queensway,radek,hippolytus,inking,banovina,peacocks,piaui,handsworth,pantomimes,abalone,thera,kurzweil,bandura,augustinians,bocelli,ferrol,jiroft,quadrature,contravention,saussure,rectification,agrippina,angelis,matanzas,nidaros,palestrina,latium,coriolis,clostridium,ordain,uttering,lanchester,proteolytic,ayacucho,merseburg,holbein,sambalpur,algebraically,inchon,ostfold,savoia,calatrava,lahiri,judgeship,ammonite,masaryk,meyerbeer,hemorrhagic,superspeedway,ningxia,panicles,encircles,khmelnytsky,profusion,esher,babol,inflationary,anhydride,gaspe,mossy,periodicity,nacion,meteorologists,mahjong,interventional,sarin,moult,enderby,modell,palgrave,warners,montcalm,siddha,functionalism,rilke,politicized,broadmoor,kunste,orden,brasileira,araneta,eroticism,colquhoun,mamba,blacktown,tubercle,seagrass,manoel,camphor,neoregelia,llandudno,annexe,enplanements,kamien,plovers,statisticians,iturbide,madrasah,nontrivial,publican,landholders,manama,uninhabitable,revivalist,trunkline,friendliness,gurudwara,rocketry,unido,tripos,besant,braque,evolutionarily,abkhazian,staffel,ratzinger,brockville,bohemond,intercut,djurgarden,utilitarianism,deploys,sastri,absolutism,subhas,asghar,fictions,sepinwall,proportionately,titleholders,thereon,foursquare,machinegun,knightsbridge,siauliai,aqaba,gearboxes,castaways,weakens,phallic,strzelce,buoyed,ruthenia,pharynx,intractable,neptunes,koine,leakey,netherlandish,preempted,vinay,terracing,instigating,alluvium,prosthetics,vorarlberg,politiques,joinery,reduplication,nebuchadnezzar,lenticular,banka,seaborne,pattinson,helpline,aleph,beckenham,californians,namgyal,franziska,aphid,branagh,transcribe,appropriateness,surakarta,takings,propagates,juraj,b0d3fb,brera,arrayed,tailback,falsehood,hazleton,prosody,egyptology,pinnate,tableware,ratan,camperdown,ethnologist,tabari,classifiers,biogas,126th,kabila,arbitron,apuestas,membranous,kincardine,oceana,glories,natick,populism,synonymy,ghalib,mobiles,motherboards,stationers,germinal,patronised,formula_58,gaborone,torts,jeezy,interleague,novaya,batticaloa,offshoots,wilbraham,filename,nswrfl,'well,trilobite,pythons,optimally,scientologists,rhesus,pilsen,backdrops,batang,unionville,hermanos,shrikes,fareham,outlawing,discontinuing,boisterous,shamokin,scanty,southwestward,exchangers,unexpired,mewar,h.m.s,saldanha,pawan,condorcet,turbidity,donau,indulgences,coincident,cliques,weeklies,bardhaman,violators,kenai,caspase,xperia,kunal,fistula,epistemic,cammell,nephi,disestablishment,rotator,germaniawerft,pyaar,chequered,jigme,perlis,anisotropic,popstars,kapil,appendices,berat,defecting,shacks,wrangel,panchayath,gorna,suckling,aerosols,sponheim,talal,borehole,encodings,enlai,subduing,agong,nadar,kitsap,syrmia,majumdar,pichilemu,charleville,embryology,booting,literati,abutting,basalts,jussi,repubblica,hertogenbosch,digitization,relents,hillfort,wiesenthal,kirche,bhagwan,bactrian,oases,phyla,neutralizing,helsing,ebooks,spearheading,margarine,'golden,phosphor,picea,stimulants,outliers,timescale,gynaecology,integrator,skyrocketed,bridgnorth,senecio,ramachandra,suffragist,arrowheads,aswan,inadvertent,microelectronics,118th,sofer,kubica,melanesian,tuanku,balkh,vyborg,crystallographic,initiators,metamorphism,ginzburg,looters,unimproved,finistere,newburyport,norges,immunities,franchisees,asterism,kortrijk,camorra,komsomol,fleurs,draughts,patagonian,voracious,artin,collaborationist,revolucion,revitalizing,xaver,purifying,antipsychotic,disjunct,pompeius,dreamwave,juvenal,beinn,adiyaman,antitank,allama,boletus,melanogaster,dumitru,caproni,aligns,athabaskan,stobart,phallus,veikkausliiga,hornsey,buffering,bourbons,dobruja,marga,borax,electrics,gangnam,motorcyclist,whidbey,draconian,lodger,galilean,sanctification,imitates,boldness,underboss,wheatland,cantabrian,terceira,maumee,redefining,uppercase,ostroda,characterise,universalism,equalized,syndicalism,haringey,masovia,deleuze,funkadelic,conceals,thuan,minsky,pluralistic,ludendorff,beekeeping,bonfires,endoscopic,abuts,prebend,jonkoping,amami,tribunes,yup'ik,awadh,gasification,pforzheim,reforma,antiwar,vaishnavism,maryville,inextricably,margrethe,empresa,neutrophils,sanctified,ponca,elachistidae,curiae,quartier,mannar,hyperplasia,wimax,busing,neologism,florins,underrepresented,digitised,nieuw,cooch,howards,frege,hughie,plied,swale,kapellmeister,vajpayee,quadrupled,aeronautique,dushanbe,custos,saltillo,kisan,tigray,manaus,epigrams,shamanic,peppered,frosts,promotion/relegation,concedes,zwingli,charentes,whangarei,hyung,spring/summer,sobre,eretz,initialization,sawai,ephemera,grandfathered,arnaldo,customised,permeated,parapets,growths,visegrad,estudios,altamont,provincia,apologises,stoppard,carburettor,rifts,kinematic,zhengzhou,eschatology,prakrit,folate,yvelines,scapula,stupas,rishon,reconfiguration,flutist,1680s,apostolate,proudhon,lakshman,articulating,stortford,faithfull,bitterns,upwelling,qur'anic,lidar,interferometry,waterlogged,koirala,ditton,wavefunction,fazal,babbage,antioxidants,lemberg,deadlocked,tolled,ramapo,mathematica,leiria,topologies,khali,photonic,balti,1080p,corrects,recommenced,polyglot,friezes,tiebreak,copacabana,cholmondeley,armband,abolishment,sheamus,buttes,glycolysis,cataloged,warrenton,sassari,kishan,foodservice,cryptanalysis,holmenkollen,cosplay,machi,yousuf,mangal,allying,fertiliser,otomi,charlevoix,metallurg,parisians,bottlenose,oakleigh,debug,cidade,accede,ligation,madhava,pillboxes,gatefold,aveyron,sorin,thirsk,immemorial,menelik,mehra,domingos,underpinned,fleshed,harshness,diphthong,crestwood,miskolc,dupri,pyrausta,muskingum,tuoba,prodi,incidences,waynesboro,marquesas,heydar,artesian,calinescu,nucleation,funders,covalently,compaction,derbies,seaters,sodor,tabular,amadou,peckinpah,o'halloran,zechariah,libyans,kartik,daihatsu,chandran,erzhu,heresies,superheated,yarder,dorde,tanjore,abusers,xuanwu,juniperus,moesia,trusteeship,birdwatching,beatz,moorcock,harbhajan,sanga,choreographic,photonics,boylston,amalgamate,prawns,electrifying,sarath,inaccurately,exclaims,powerpoint,chaining,cpusa,adulterous,saccharomyces,glogow,vfl/afl,syncretic,simla,persisting,functors,allosteric,euphorbiaceae,juryo,mlada,moana,gabala,thornycroft,kumanovo,ostrovsky,sitio,tutankhamun,sauropods,kardzhali,reinterpretation,sulpice,rosyth,originators,halesowen,delineation,asesoria,abatement,gardai,elytra,taillights,overlays,monsoons,sandpipers,ingmar,henrico,inaccuracy,irwell,arenabowl,elche,pressburg,signalman,interviewees,sinkhole,pendle,ecommerce,cellos,nebria,organometallic,surrealistic,propagandist,interlaken,canandaigua,aerials,coutinho,pascagoula,tonopah,letterkenny,gropius,carbons,hammocks,childe,polities,hosiery,donitz,suppresses,diaghilev,stroudsburg,bagram,pistoia,regenerating,unitarians,takeaway,offstage,vidin,glorification,bakunin,yavapai,lutzow,sabercats,witney,abrogated,gorlitz,validating,dodecahedron,stubbornly,telenor,glaxosmithkline,solapur,undesired,jellicoe,dramatization,four-and-a-half,seawall,waterpark,artaxerxes,vocalization,typographic,byung,sachsenhausen,shepparton,kissimmee,konnan,belsen,dhawan,khurd,mutagenesis,vejle,perrot,estradiol,formula_60,saros,chiloe,misiones,lamprey,terrains,speke,miasto,eigenvectors,haydock,reservist,corticosteroids,savitri,shinawatra,developmentally,yehudi,berates,janissaries,recapturing,rancheria,subplots,gresley,nikkatsu,oryol,cosmas,boavista,formula_59,playfully,subsections,commentated,kathakali,dorid,vilaine,seepage,hylidae,keiji,kazakhs,triphosphate,1620s,supersede,monarchists,falla,miyako,notching,bhumibol,polarizing,secularized,shingled,bronislaw,lockerbie,soleyman,bundesbahn,latakia,redoubts,boult,inwardly,invents,ondrej,minangkabau,newquay,permanente,alhaji,madhav,malini,ellice,bookmaker,mankiewicz,etihad,o'dea,interrogative,mikawa,wallsend,canisius,bluesy,vitruvius,noord,ratifying,mixtec,gujranwala,subprefecture,keelung,goiania,nyssa,shi'ite,semitone,ch'uan,computerised,pertuan,catapults,nepomuk,shruti,millstones,buskerud,acolytes,tredegar,sarum,armia,dell'arte,devises,custodians,upturned,gallaudet,disembarking,thrashed,sagrada,myeon,undeclared,qumran,gaiden,tepco,janesville,showground,condense,chalon,unstaffed,pasay,undemocratic,hauts,viridis,uninjured,escutcheon,gymkhana,petaling,hammam,dislocations,tallaght,rerum,shias,indios,guaranty,simplicial,benares,benediction,tajiri,prolifically,huawei,onerous,grantee,ferencvaros,otranto,carbonates,conceit,digipak,qadri,masterclasses,swamiji,cradock,plunket,helmsman,119th,salutes,tippecanoe,murshidabad,intelligibility,mittal,diversifying,bidar,asansol,crowdsourcing,rovere,karakoram,grindcore,skylights,tulagi,furrows,ligne,stuka,sumer,subgraph,amata,regionalist,bulkeley,teletext,glorify,readied,lexicographer,sabadell,predictability,quilmes,phenylalanine,bandaranaike,pyrmont,marksmen,quisling,viscountess,sociopolitical,afoul,pediments,swazi,martyrology,nullify,panagiotis,superconductors,veldenz,jujuy,l'isle,hematopoietic,shafi,subsea,hattiesburg,jyvaskyla,kebir,myeloid,landmine,derecho,amerindians,birkenau,scriabin,milhaud,mucosal,nikaya,freikorps,theoretician,proconsul,o'hanlon,clerked,bactria,houma,macular,topologically,shrubby,aryeh,ghazali,afferent,magalhaes,moduli,ashtabula,vidarbha,securitate,ludwigsburg,adoor,varun,shuja,khatun,chengde,bushels,lascelles,professionnelle,elfman,rangpur,unpowered,citytv,chojnice,quaternion,stokowski,aschaffenburg,commutes,subramaniam,methylene,satrap,gharb,namesakes,rathore,helier,gestational,heraklion,colliers,giannis,pastureland,evocation,krefeld,mahadeva,churchmen,egret,yilmaz,galeazzo,pudukkottai,artigas,generalitat,mudslides,frescoed,enfeoffed,aphorisms,melilla,montaigne,gauliga,parkdale,mauboy,linings,prema,sapir,xylophone,kushan,rockne,sequoyah,vasyl,rectilinear,vidyasagar,microcosm,san'a,carcinogen,thicknesses,aleut,farcical,moderating,detested,hegemonic,instalments,vauban,verwaltungsgemeinschaft,picayune,razorback,magellanic,moluccas,pankhurst,exportation,waldegrave,sufferer,bayswater,1up.com,rearmament,orangutans,varazdin,b.o.b,elucidate,harlingen,erudition,brankovic,lapis,slipway,urraca,shinde,unwell,elwes,euboea,colwyn,srivijaya,grandstands,hortons,generalleutnant,fluxes,peterhead,gandhian,reals,alauddin,maximized,fairhaven,endow,ciechanow,perforations,darters,panellist,manmade,litigants,exhibitor,tirol,caracalla,conformance,hotelier,stabaek,hearths,borac,frisians,ident,veliko,emulators,schoharie,uzbeks,samarra,prestwick,wadia,universita,tanah,bucculatrix,predominates,genotypes,denounces,roadsides,ganassi,keokuk,philatelist,tomic,ingots,conduits,samplers,abdus,johar,allegories,timaru,wolfpacks,secunda,smeaton,sportivo,inverting,contraindications,whisperer,moradabad,calamities,bakufu,soundscape,smallholders,nadeem,crossroad,xenophobic,zakir,nationalliga,glazes,retroflex,schwyz,moroder,rubra,quraysh,theodoros,endemol,infidels,km/hr,repositioned,portraitist,lluis,answerable,arges,mindedness,coarser,eyewall,teleported,scolds,uppland,vibraphone,ricoh,isenburg,bricklayer,cuttlefish,abstentions,communicable,cephalopod,stockyards,balto,kinston,armbar,bandini,elphaba,maxims,bedouins,sachsen,friedkin,tractate,pamir,ivanovo,mohini,kovalainen,nambiar,melvyn,orthonormal,matsuyama,cuernavaca,veloso,overstated,streamer,dravid,informers,analyte,sympathized,streetscape,gosta,thomasville,grigore,futuna,depleting,whelks,kiedis,armadale,earner,wynyard,dothan,animating,tridentine,sabri,immovable,rivoli,ariege,parley,clinker,circulates,junagadh,fraunhofer,congregants,180th,buducnost,formula_62,olmert,dedekind,karnak,bayernliga,mazes,sandpiper,ecclestone,yuvan,smallmouth,decolonization,lemmy,adjudicated,retiro,legia,benue,posit,acidification,wahab,taconic,floatplane,perchlorate,atria,wisbech,divestment,dallara,phrygia,palustris,cybersecurity,rebates,facie,mineralogical,substituent,proteges,fowey,mayenne,smoothbore,cherwell,schwarzschild,junin,murrumbidgee,smalltalk,d'orsay,emirati,calaveras,titusville,theremin,vikramaditya,wampanoag,burra,plaines,onegin,emboldened,whampoa,langa,soderbergh,arnaz,sowerby,arendal,godunov,pathanamthitta,damselfly,bestowing,eurosport,iconoclasm,outfitters,acquiesced,badawi,hypotension,ebbsfleet,annulus,sohrab,thenceforth,chagatai,necessitates,aulus,oddities,toynbee,uniontown,innervation,populaire,indivisible,rossellini,minuet,cyrene,gyeongju,chania,cichlids,harrods,1690s,plunges,abdullahi,gurkhas,homebuilt,sortable,bangui,rediff,incrementally,demetrios,medaille,sportif,svend,guttenberg,tubules,carthusian,pleiades,torii,hoppus,phenyl,hanno,conyngham,teschen,cronenberg,wordless,melatonin,distinctiveness,autos,freising,xuanzang,dunwich,satanism,sweyn,predrag,contractually,pavlovic,malaysians,micrometres,expertly,pannonian,abstaining,capensis,southwesterly,catchphrases,commercialize,frankivsk,normanton,hibernate,verso,deportees,dubliners,codice_8,condors,zagros,glosses,leadville,conscript,morrisons,usury,ossian,oulton,vaccinium,civet,ayman,codrington,hadron,nanometers,geochemistry,extractor,grigori,tyrrhenian,neocollyris,drooping,falsification,werft,courtauld,brigantine,orhan,chapultepec,supercopa,federalized,praga,havering,encampments,infallibility,sardis,pawar,undirected,reconstructionist,ardrossan,varuna,pastimes,archdiocesan,fledging,shenhua,molise,secondarily,stagnated,replicates,ciencias,duryodhana,marauding,ruislip,ilyich,intermixed,ravenswood,shimazu,mycorrhizal,icosahedral,consents,dunblane,follicular,pekin,suffield,muromachi,kinsale,gauche,businesspeople,thereto,watauga,exaltation,chelmno,gorse,proliferate,drainages,burdwan,kangra,transducers,inductor,duvalier,maguindanao,moslem,uncaf,givenchy,plantarum,liturgics,telegraphs,lukashenko,chenango,andante,novae,ironwood,faubourg,torme,chinensis,ambala,pietermaritzburg,virginians,landform,bottlenecks,o'driscoll,darbhanga,baptistery,ameer,needlework,naperville,auditoriums,mullingar,starrer,animatronic,topsoil,madura,cannock,vernet,santurce,catocala,ozeki,pontevedra,multichannel,sundsvall,strategists,medio,135th,halil,afridi,trelawny,caloric,ghraib,allendale,hameed,ludwigshafen,spurned,pavlo,palmar,strafed,catamarca,aveiro,harmonization,surah,predictors,solvay,mande,omnipresent,parenthesis,echolocation,equaling,experimenters,acyclic,lithographic,sepoys,katarzyna,sridevi,impoundment,khosrow,caesarean,nacogdoches,rockdale,lawmaker,caucasians,bahman,miyan,rubric,exuberance,bombastic,ductile,snowdonia,inlays,pinyon,anemones,hurries,hospitallers,tayyip,pulleys,treme,photovoltaics,testbed,polonium,ryszard,osgoode,profiting,ironwork,unsurpassed,nepticulidae,makai,lumbini,preclassic,clarksburg,egremont,videography,rehabilitating,ponty,sardonic,geotechnical,khurasan,solzhenitsyn,henna,phoenicia,rhyolite,chateaux,retorted,tomar,deflections,repressions,harborough,renan,brumbies,vandross,storia,vodou,clerkenwell,decking,universo,salon.com,imprisoning,sudwest,ghaziabad,subscribing,pisgah,sukhumi,econometric,clearest,pindar,yildirim,iulia,atlases,cements,remaster,dugouts,collapsible,resurrecting,batik,unreliability,thiers,conjunctions,colophon,marcher,placeholder,flagella,wolds,kibaki,viviparous,twelver,screenshots,aroostook,khadr,iconographic,itasca,jaume,basti,propounded,varro,be'er,jeevan,exacted,shrublands,creditable,brocade,boras,bittern,oneonta,attentional,herzliya,comprehensible,lakeville,discards,caxias,frankland,camerata,satoru,matlab,commutator,interprovincial,yorkville,benefices,nizami,edwardsville,amigaos,cannabinoid,indianola,amateurliga,pernicious,ubiquity,anarchic,novelties,precondition,zardari,symington,sargodha,headphone,thermopylae,mashonaland,zindagi,thalberg,loewe,surfactants,dobro,crocodilians,samhita,diatoms,haileybury,berwickshire,supercritical,sofie,snorna,slatina,intramolecular,agung,osteoarthritis,obstetric,teochew,vakhtang,connemara,deformations,diadem,ferruccio,mainichi,qualitatively,refrigerant,rerecorded,methylated,karmapa,krasinski,restatement,rouvas,cubitt,seacoast,schwarzkopf,homonymous,shipowner,thiamine,approachable,xiahou,160th,ecumenism,polistes,internazionali,fouad,berar,biogeography,texting,inadequately,'when,4kids,hymenoptera,emplaced,cognomen,bellefonte,supplant,michaelmas,uriel,tafsir,morazan,schweinfurt,chorister,ps400,nscaa,petipa,resolutely,ouagadougou,mascarene,supercell,konstanz,bagrat,harmonix,bergson,shrimps,resonators,veneta,camas,mynydd,rumford,generalmajor,khayyam,web.com,pappus,halfdan,tanana,suomen,yutaka,bibliographical,traian,silat,noailles,contrapuntal,agaricus,'special,minibuses,1670s,obadiah,deepa,rorschach,malolos,lymington,valuations,imperials,caballeros,ambroise,judicature,elegiac,sedaka,shewa,checksum,gosforth,legionaries,corneille,microregion,friedrichshafen,antonis,surnamed,mycelium,cantus,educations,topmost,outfitting,ivica,nankai,gouda,anthemic,iosif,supercontinent,antifungal,belarusians,mudaliar,mohawks,caversham,glaciated,basemen,stevan,clonmel,loughton,deventer,positivist,manipuri,tensors,panipat,changeup,impermeable,dubbo,elfsborg,maritimo,regimens,bikram,bromeliad,substratum,norodom,gaultier,queanbeyan,pompeo,redacted,eurocopter,mothballed,centaurs,borno,copra,bemidji,'home,sopron,neuquen,passo,cineplex,alexandrov,wysokie,mammoths,yossi,sarcophagi,congreve,petkovic,extraneous,waterbirds,slurs,indias,phaeton,discontented,prefaced,abhay,prescot,interoperable,nordisk,bicyclists,validly,sejong,litovsk,zanesville,kapitanleutnant,kerch,changeable,mcclatchy,celebi,attesting,maccoll,sepahan,wayans,veined,gaudens,markt,dansk,soane,quantized,petersham,forebears,nayarit,frenzied,queuing,bygone,viggo,ludwik,tanka,hanssen,brythonic,cornhill,primorsky,stockpiles,conceptualization,lampeter,hinsdale,mesoderm,bielsk,rosenheim,ultron,joffrey,stanwyck,khagan,tiraspol,pavelic,ascendant,empoli,metatarsal,descentralizado,masada,ligier,huseyin,ramadi,waratah,tampines,ruthenium,statoil,mladost,liger,grecian,multiparty,digraph,maglev,reconsideration,radiography,cartilaginous,taizu,wintered,anabaptist,peterhouse,shoghi,assessors,numerator,paulet,painstakingly,halakhic,rocroi,motorcycling,gimel,kryptonian,emmeline,cheeked,drawdown,lelouch,dacians,brahmana,reminiscence,disinfection,optimizations,golders,extensor,tsugaru,tolling,liman,gulzar,unconvinced,crataegus,oppositional,dvina,pyrolysis,mandan,alexius,prion,stressors,loomed,moated,dhivehi,recyclable,relict,nestlings,sarandon,kosovar,solvers,czeslaw,kenta,maneuverable,middens,berkhamsted,comilla,folkways,loxton,beziers,batumi,petrochemicals,optimised,sirjan,rabindra,musicality,rationalisation,drillers,subspaces,'live,bbwaa,outfielders,tsung,danske,vandalised,norristown,striae,kanata,gastroenterology,steadfastly,equalising,bootlegging,mannerheim,notodontidae,lagoa,commentating,peninsulas,chishti,seismology,modigliani,preceptor,canonically,awardee,boyaca,hsinchu,stiffened,nacelle,bogor,dryness,unobstructed,yaqub,scindia,peeters,irritant,ammonites,ferromagnetic,speechwriter,oxygenated,walesa,millais,canarian,faience,calvinistic,discriminant,rasht,inker,annexes,howth,allocates,conditionally,roused,regionalism,regionalbahn,functionary,nitrates,bicentenary,recreates,saboteurs,koshi,plasmids,thinned,124th,plainview,kardashian,neuville,victorians,radiates,127th,vieques,schoolmates,petru,tokusatsu,keying,sunaina,flamethrower,'bout,demersal,hosokawa,corelli,omniscient,o'doherty,niksic,reflectivity,transdev,cavour,metronome,temporally,gabba,nsaids,geert,mayport,hematite,boeotia,vaudreuil,torshavn,sailplane,mineralogist,eskisehir,practises,gallifrey,takumi,unease,slipstream,hedmark,paulinus,ailsa,wielkopolska,filmworks,adamantly,vinaya,facelifted,franchisee,augustana,toppling,velvety,crispa,stonington,histological,genealogist,tactician,tebow,betjeman,nyingma,overwinter,oberoi,rampal,overwinters,petaluma,lactarius,stanmore,balikpapan,vasant,inclines,laminate,munshi,sociedade,rabbah,septal,boyband,ingrained,faltering,inhumans,nhtsa,affix,l'ordre,kazuki,rossendale,mysims,latvians,slaveholders,basilicata,neuburg,assize,manzanillo,scrobipalpa,formula_61,belgique,pterosaurs,privateering,vaasa,veria,northport,pressurised,hobbyist,austerlitz,sahih,bhadra,siliguri,bistrica,bursaries,wynton,corot,lepidus,lully,libor,libera,olusegun,choline,mannerism,lymphocyte,chagos,duxbury,parasitism,ecowas,morotai,cancion,coniston,aggrieved,sputnikmusic,parle,ammonian,civilisations,malformation,cattaraugus,skyhawks,d'arc,demerara,bronfman,midwinter,piscataway,jogaila,threonine,matins,kohlberg,hubli,pentatonic,camillus,nigam,potro,unchained,chauvel,orangeville,cistercians,redeployment,xanthi,manju,carabinieri,pakeha,nikolaevich,kantakouzenos,sesquicentennial,gunships,symbolised,teramo,ballo,crusading,l'oeil,bharatpur,lazier,gabrovo,hysteresis,rothbard,chaumont,roundel,ma'mun,sudhir,queried,newts,shimane,presynaptic,playfield,taxonomists,sensitivities,freleng,burkinabe,orfeo,autovia,proselytizing,bhangra,pasok,jujutsu,heung,pivoting,hominid,commending,formula_64,epworth,christianized,oresund,hantuchova,rajputana,hilversum,masoretic,dayak,bakri,assen,magog,macromolecules,waheed,qaida,spassky,rumped,protrudes,preminger,misogyny,glencairn,salafi,lacunae,grilles,racemes,areva,alighieri,inari,epitomized,photoshoot,one-of-a-kind,tring,muralist,tincture,backwaters,weaned,yeasts,analytically,smaland,caltrans,vysocina,jamuna,mauthausen,175th,nouvelles,censoring,reggina,christology,gilad,amplifying,mehmood,johnsons,redirects,eastgate,sacrum,meteoric,riverbanks,guidebooks,ascribes,scoparia,iconoclastic,telegraphic,chine,merah,mistico,lectern,sheung,aethelstan,capablanca,anant,uspto,albatrosses,mymensingh,antiretroviral,clonal,coorg,vaillant,liquidator,gigas,yokai,eradicating,motorcyclists,waitakere,tandon,nears,montenegrins,250th,tatsuya,yassin,atheistic,syncretism,nahum,berisha,transcended,owensboro,lakshmana,abteilung,unadorned,nyack,overflows,harrisonburg,complainant,uematsu,frictional,worsens,sangguniang,abutment,bulwer,sarma,apollinaire,shippers,lycia,alentejo,porpoises,optus,trawling,augustow,blackwall,workbench,westmount,leaped,sikandar,conveniences,stornoway,culverts,zoroastrians,hristo,ansgar,assistive,reassert,fanned,compasses,delgada,maisons,arima,plonsk,verlaine,starstruck,rakhine,befell,spirally,wyclef,expend,colloquium,formula_63,albertus,bellarmine,handedness,holon,introns,movimiento,profitably,lohengrin,discoverers,awash,erste,pharisees,dwarka,oghuz,hashing,heterodox,uloom,vladikavkaz,linesman,rehired,nucleophile,germanicus,gulshan,songz,bayerische,paralympian,crumlin,enjoined,khanum,prahran,penitent,amersfoort,saranac,semisimple,vagrants,compositing,tualatin,oxalate,lavra,ironi,ilkeston,umpqua,calum,stretford,zakat,guelders,hydrazine,birkin,spurring,modularity,aspartate,sodermanland,hopital,bellary,legazpi,clasico,cadfael,hypersonic,volleys,pharmacokinetics,carotene,orientale,pausini,bataille,lunga,retailed,m.phil,mazowieckie,vijayan,rawal,sublimation,promissory,estimators,ploughed,conflagration,penda,segregationist,otley,amputee,coauthor,sopra,pellew,wreckers,tollywood,circumscription,permittivity,strabane,landward,articulates,beaverbrook,rutherglen,coterminous,whistleblowers,colloidal,surbiton,atlante,oswiecim,bhasa,lampooned,chanter,saarc,landkreis,tribulation,tolerates,daiichi,hatun,cowries,dyschirius,abercromby,attock,aldwych,inflows,absolutist,l'histoire,committeeman,vanbrugh,headstock,westbourne,appenzell,hoxton,oculus,westfalen,roundabouts,nickelback,trovatore,quenching,summarises,conservators,transmutation,talleyrand,barzani,unwillingly,axonal,'blue,opining,enveloping,fidesz,rafah,colborne,flickr,lozenge,dulcimer,ndebele,swaraj,oxidize,gonville,resonated,gilani,superiore,endeared,janakpur,shepperton,solidifying,memoranda,sochaux,kurnool,rewari,emirs,kooning,bruford,unavailability,kayseri,judicious,negating,pterosaur,cytosolic,chernihiv,variational,sabretooth,seawolves,devalued,nanded,adverb,volunteerism,sealers,nemours,smederevo,kashubian,bartin,animax,vicomte,polotsk,polder,archiepiscopal,acceptability,quidditch,tussock,seminaire,immolation,belge,coves,wellingborough,khaganate,mckellen,nayaka,brega,kabhi,pontoons,bascule,newsreels,injectors,cobol,weblog,diplo,biggar,wheatbelt,erythrocytes,pedra,showgrounds,bogdanovich,eclecticism,toluene,elegies,formalize,andromedae,airworthiness,springville,mainframes,overexpression,magadha,bijelo,emlyn,glutamine,accenture,uhuru,metairie,arabidopsis,patanjali,peruvians,berezovsky,accion,astrolabe,jayanti,earnestly,sausalito,recurved,1500s,ramla,incineration,galleons,laplacian,shiki,smethwick,isomerase,dordevic,janow,jeffersonville,internationalism,penciled,styrene,ashur,nucleoside,peristome,horsemanship,sedges,bachata,medes,kristallnacht,schneerson,reflectance,invalided,strutt,draupadi,destino,partridges,tejas,quadrennial,aurel,halych,ethnomusicology,autonomist,radyo,rifting,shi'ar,crvena,telefilm,zawahiri,plana,sultanates,theodorus,subcontractors,pavle,seneschal,teleports,chernivtsi,buccal,brattleboro,stankovic,safar,dunhuang,electrocution,chastised,ergonomic,midsomer,130th,zomba,nongovernmental,escapist,localize,xuzhou,kyrie,carinthian,karlovac,nisan,kramnik,pilipino,digitisation,khasi,andronicus,highwayman,maior,misspelling,sebastopol,socon,rhaetian,archimandrite,partway,positivity,otaku,dingoes,tarski,geopolitics,disciplinarian,zulfikar,kenzo,globose,electrophilic,modele,storekeeper,pohang,wheldon,washers,interconnecting,digraphs,intrastate,campy,helvetic,frontispiece,ferrocarril,anambra,petraeus,midrib,endometrial,dwarfism,mauryan,endocytosis,brigs,percussionists,furtherance,synergistic,apocynaceae,krona,berthier,circumvented,casal,siltstone,precast,ethnikos,realists,geodesy,zarzuela,greenback,tripathi,persevered,interments,neutralization,olbermann,departements,supercomputing,demobilised,cassavetes,dunder,ministering,veszprem,barbarism,'world,pieve,apologist,frentzen,sulfides,firewalls,pronotum,staatsoper,hachette,makhachkala,oberland,phonon,yoshihiro,instars,purnima,winslet,mutsu,ergative,sajid,nizamuddin,paraphrased,ardeidae,kodagu,monooxygenase,skirmishers,sportiva,o'byrne,mykolaiv,ophir,prieta,gyllenhaal,kantian,leche,copan,herero,ps250,gelsenkirchen,shalit,sammarinese,chetwynd,wftda,travertine,warta,sigmaringen,concerti,namespace,ostergotland,biomarker,universals,collegio,embarcadero,wimborne,fiddlers,likening,ransomed,stifled,unabated,kalakaua,khanty,gongs,goodrem,countermeasure,publicizing,geomorphology,swedenborg,undefended,catastrophes,diverts,storyboards,amesbury,contactless,placentia,festivity,authorise,terrane,thallium,stradivarius,antonine,consortia,estimations,consecrate,supergiant,belichick,pendants,butyl,groza,univac,afire,kavala,studi,teletoon,paucity,gonbad,koninklijke,128th,stoichiometric,multimodal,facundo,anatomic,melamine,creuse,altan,brigands,mcguinty,blomfield,tsvangirai,protrusion,lurgan,warminster,tenzin,russellville,discursive,definable,scotrail,lignin,reincorporated,o'dell,outperform,redland,multicolored,evaporates,dimitrie,limbic,patapsco,interlingua,surrogacy,cutty,potrero,masud,cahiers,jintao,ardashir,centaurus,plagiarized,minehead,musings,statuettes,logarithms,seaview,prohibitively,downforce,rivington,tomorrowland,microbiologist,ferric,morag,capsid,kucinich,clairvaux,demotic,seamanship,cicada,painterly,cromarty,carbonic,tupou,oconee,tehuantepec,typecast,anstruther,internalized,underwriters,tetrahedra,flagrant,quakes,pathologies,ulrik,nahal,tarquini,dongguan,parnassus,ryoko,senussi,seleucia,airasia,einer,sashes,d'amico,matriculating,arabesque,honved,biophysical,hardinge,kherson,mommsen,diels,icbms,reshape,brasiliensis,palmach,netaji,oblate,functionalities,grigor,blacksburg,recoilless,melanchthon,reales,astrodome,handcrafted,memes,theorizes,isma'il,aarti,pirin,maatschappij,stabilizes,honiara,ashbury,copts,rootes,defensed,queiroz,mantegna,galesburg,coraciiformesfamily,cabrillo,tokio,antipsychotics,kanon,173rd,apollonia,finial,lydian,hadamard,rangi,dowlatabad,monolingual,platformer,subclasses,chiranjeevi,mirabeau,newsgroup,idmanyurdu,kambojas,walkover,zamoyski,generalist,khedive,flanges,knowle,bande,157th,alleyn,reaffirm,pininfarina,zuckerberg,hakodate,131st,aditi,bellinzona,vaulter,planking,boscombe,colombians,lysis,toppers,metered,nahyan,queensryche,minho,nagercoil,firebrand,foundress,bycatch,mendota,freeform,antena,capitalisation,martinus,overijssel,purists,interventionist,zgierz,burgundians,hippolyta,trompe,umatilla,moroccans,dictionnaire,hydrography,changers,chota,rimouski,aniline,bylaw,grandnephew,neamt,lemnos,connoisseurs,tractive,rearrangements,fetishism,finnic,apalachicola,landowning,calligraphic,circumpolar,mansfeld,legible,orientalism,tannhauser,blamey,maximization,noinclude,blackbirds,angara,ostersund,pancreatitis,glabra,acleris,juried,jungian,triumphantly,singlet,plasmas,synesthesia,yellowhead,unleashes,choiseul,quanzhong,brookville,kaskaskia,igcse,skatepark,jatin,jewellers,scaritinae,techcrunch,tellurium,lachaise,azuma,codeshare,dimensionality,unidirectional,scolaire,macdill,camshafts,unassisted,verband,kahlo,eliya,prelature,chiefdoms,saddleback,sockers,iommi,coloratura,llangollen,biosciences,harshest,maithili,k'iche,plical,multifunctional,andreu,tuskers,confounding,sambre,quarterdeck,ascetics,berdych,transversal,tuolumne,sagami,petrobras,brecker,menxia,instilling,stipulating,korra,oscillate,deadpan,v/line,pyrotechnic,stoneware,prelims,intracoastal,retraining,ilija,berwyn,encrypt,achievers,zulfiqar,glycoproteins,khatib,farmsteads,occultist,saman,fionn,derulo,khilji,obrenovic,argosy,toowong,dementieva,sociocultural,iconostasis,craigslist,festschrift,taifa,intercalated,tanjong,penticton,sharad,marxian,extrapolation,guises,wettin,prabang,exclaiming,kosta,famas,conakry,wanderings,'aliabad,macleay,exoplanet,bancorp,besiegers,surmounting,checkerboard,rajab,vliet,tarek,operable,wargaming,haldimand,fukuyama,uesugi,aggregations,erbil,brachiopods,tokyu,anglais,unfavorably,ujpest,escorial,armagnac,nagara,funafuti,ridgeline,cocking,o'gorman,compactness,retardant,krajowa,barua,coking,bestows,thampi,chicagoland,variably,o'loughlin,minnows,schwa,shaukat,polycarbonate,chlorinated,godalming,gramercy,delved,banqueting,enlil,sarada,prasanna,domhnall,decadal,regressive,lipoprotein,collectable,surendra,zaporizhia,cycliste,suchet,offsetting,formula_65,pudong,d'arte,blyton,quonset,osmania,tientsin,manorama,proteomics,bille,jalpaiguri,pertwee,barnegat,inventiveness,gollancz,euthanized,henricus,shortfalls,wuxia,chlorides,cerrado,polyvinyl,folktale,straddled,bioengineering,eschewing,greendale,recharged,olave,ceylonese,autocephalous,peacebuilding,wrights,guyed,rosamund,abitibi,bannockburn,gerontology,scutari,souness,seagram,codice_9,'open,xhtml,taguig,purposed,darbar,orthopedics,unpopulated,kisumu,tarrytown,feodor,polyhedral,monadnock,gottorp,priam,redesigning,gasworks,elfin,urquiza,homologation,filipovic,bohun,manningham,gornik,soundness,shorea,lanus,gelder,darke,sandgate,criticality,paranaense,153rd,vieja,lithograph,trapezoid,tiebreakers,convalescence,yan'an,actuaries,balad,altimeter,thermoelectric,trailblazer,previn,tenryu,ancaster,endoscopy,nicolet,discloses,fracking,plaine,salado,americanism,placards,absurdist,propylene,breccia,jirga,documenta,ismailis,161st,brentano,dallas/fort,embellishment,calipers,subscribes,mahavidyalaya,wednesbury,barnstormers,miwok,schembechler,minigame,unterberger,dopaminergic,inacio,nizamabad,overridden,monotype,cavernous,stichting,sassafras,sotho,argentinean,myrrh,rapidity,flatts,gowrie,dejected,kasaragod,cyprinidae,interlinked,arcseconds,degeneracy,infamously,incubate,substructure,trigeminal,sectarianism,marshlands,hooliganism,hurlers,isolationist,urania,burrard,switchover,lecco,wilts,interrogator,strived,ballooning,volterra,raciborz,relegating,gilding,cybele,dolomites,parachutist,lochaber,orators,raeburn,backend,benaud,rallycross,facings,banga,nuclides,defencemen,futurity,emitters,yadkin,eudonia,zambales,manasseh,sirte,meshes,peculiarly,mcminnville,roundly,boban,decrypt,icelanders,sanam,chelan,jovian,grudgingly,penalised,subscript,gambrinus,poaceae,infringements,maleficent,runciman,148th,supersymmetry,granites,liskeard,eliciting,involution,hallstatt,kitzbuhel,shankly,sandhills,inefficiencies,yishuv,psychotropic,nightjars,wavell,sangamon,vaikundar,choshu,retrospectives,pitesti,gigantea,hashemi,bosna,gakuin,siochana,arrangers,baronetcies,narayani,temecula,creston,koscierzyna,autochthonous,wyandot,anniston,igreja,mobilise,buzau,dunster,musselburgh,wenzhou,khattak,detoxification,decarboxylase,manlius,campbells,coleoptera,copyist,sympathisers,suisun,eminescu,defensor,transshipment,thurgau,somerton,fluctuates,ambika,weierstrass,lukow,giambattista,volcanics,romanticized,innovated,matabeleland,scotiabank,garwolin,purine,d'auvergne,borderland,maozhen,pricewaterhousecoopers,testator,pallium,scout.com,mv/pi,nazca,curacies,upjohn,sarasvati,monegasque,ketrzyn,malory,spikelets,biomechanics,haciendas,rapped,dwarfed,stews,nijinsky,subjection,matsu,perceptible,schwarzburg,midsection,entertains,circuitous,epiphytic,wonsan,alpini,bluefield,sloths,transportable,braunfels,dictum,szczecinek,jukka,wielun,wejherowo,hucknall,grameen,duodenum,ribose,deshpande,shahar,nexstar,injurious,dereham,lithographer,dhoni,structuralist,progreso,deschutes,christus,pulteney,quoins,yitzchak,gyeongsang,breviary,makkah,chiyoda,jutting,vineland,angiosperms,necrotic,novelisation,redistribute,tirumala,140th,featureless,mafic,rivaling,toyline,2/1st,martius,saalfeld,monthan,texian,kathak,melodramas,mithila,regierungsbezirk,509th,fermenting,schoolmate,virtuosic,briain,kokoda,heliocentric,handpicked,kilwinning,sonically,dinars,kasim,parkways,bogdanov,luxembourgian,halland,avesta,bardic,daugavpils,excavator,qwest,frustrate,physiographic,majoris,'ndrangheta,unrestrained,firmness,montalban,abundances,preservationists,adare,executioners,guardsman,bonnaroo,neglects,nazrul,pro12,hoorn,abercorn,refuting,kabud,cationic,parapsychology,troposphere,venezuelans,malignancy,khoja,unhindered,accordionist,medak,visby,ejercito,laparoscopic,dinas,umayyads,valmiki,o'dowd,saplings,stranding,incisions,illusionist,avocets,buccleuch,amazonia,fourfold,turboprops,roosts,priscus,turnstile,areal,certifies,pocklington,spoofs,viseu,commonalities,dabrowka,annam,homesteaders,daredevils,mondrian,negotiates,fiestas,perennials,maximizes,lubavitch,ravindra,scrapers,finials,kintyre,violas,snoqualmie,wilders,openbsd,mlawa,peritoneal,devarajan,congke,leszno,mercurial,fakir,joannes,bognor,overloading,unbuilt,gurung,scuttle,temperaments,bautzen,jardim,tradesman,visitations,barbet,sagamore,graaff,forecasters,wilsons,assis,l'air,shariah,sochaczew,russa,dirge,biliary,neuve,heartbreakers,strathearn,jacobian,overgrazing,edrich,anticline,parathyroid,petula,lepanto,decius,channelled,parvathi,puppeteers,communicators,francorchamps,kahane,longus,panjang,intron,traite,xxvii,matsuri,amrit,katyn,disheartened,cacak,omonia,alexandrine,partaking,wrangling,adjuvant,haskovo,tendrils,greensand,lammermoor,otherworld,volusia,stabling,one-and-a-half,bresson,zapatista,eotvos,ps150,webisodes,stepchildren,microarray,braganca,quanta,dolne,superoxide,bellona,delineate,ratha,lindenwood,bruhl,cingulate,tallies,bickerton,helgi,bevin,takoma,tsukuba,statuses,changeling,alister,bytom,dibrugarh,magnesia,duplicating,outlier,abated,goncalo,strelitz,shikai,mardan,musculature,ascomycota,springhill,tumuli,gabaa,odenwald,reformatted,autocracy,theresienstadt,suplex,chattopadhyay,mencken,congratulatory,weatherfield,systema,solemnity,projekt,quanzhou,kreuzberg,postbellum,nobuo,mediaworks,finisterre,matchplay,bangladeshis,kothen,oocyte,hovered,aromas,afshar,browed,teases,chorlton,arshad,cesaro,backbencher,iquique,vulcans,padmini,unabridged,cyclase,despotic,kirilenko,achaean,queensberry,debre,octahedron,iphigenia,curbing,karimnagar,sagarmatha,smelters,surrealists,sanada,shrestha,turridae,leasehold,jiedushi,eurythmics,appropriating,correze,thimphu,amery,musicomh,cyborgs,sandwell,pushcart,retorts,ameliorate,deteriorates,stojanovic,spline,entrenchments,bourse,chancellorship,pasolini,lendl,personage,reformulated,pubescens,loiret,metalurh,reinvention,nonhuman,eilema,tarsal,complutense,magne,broadview,metrodome,outtake,stouffville,seinen,bataillon,phosphoric,ostensible,opatow,aristides,beefheart,glorifying,banten,romsey,seamounts,fushimi,prophylaxis,sibylla,ranjith,goslar,balustrades,georgiev,caird,lafitte,peano,canso,bankura,halfpenny,segregate,caisson,bizerte,jamshedpur,euromaidan,philosophie,ridged,cheerfully,reclassification,aemilius,visionaries,samoans,wokingham,chemung,wolof,unbranched,cinerea,bhosle,ourense,immortalised,cornerstones,sourcebook,khufu,archimedean,universitatea,intermolecular,fiscally,suffices,metacomet,adjudicator,stablemate,specks,glace,inowroclaw,patristic,muharram,agitating,ashot,neurologic,didcot,gamla,ilves,putouts,siraj,laski,coaling,diarmuid,ratnagiri,rotulorum,liquefaction,morbihan,harel,aftershock,gruiformesfamily,bonnier,falconiformesfamily,adorns,wikis,maastrichtian,stauffenberg,bishopsgate,fakhr,sevenfold,ponders,quantifying,castiel,opacity,depredations,lenten,gravitated,o'mahony,modulates,inuktitut,paston,kayfabe,vagus,legalised,balked,arianism,tendering,sivas,birthdate,awlaki,khvajeh,shahab,samtgemeinde,bridgeton,amalgamations,biogenesis,recharging,tsukasa,mythbusters,chamfered,enthronement,freelancers,maharana,constantia,sutil,messines,monkton,okanogan,reinvigorated,apoplexy,tanahashi,neues,valiants,harappan,russes,carding,volkoff,funchal,statehouse,imitative,intrepidity,mellotron,samaras,turkana,besting,longitudes,exarch,diarrhoea,transcending,zvonareva,darna,ramblin,disconnection,137th,refocused,diarmait,agricole,ba'athist,turenne,contrabass,communis,daviess,fatimids,frosinone,fittingly,polyphyletic,qanat,theocratic,preclinical,abacha,toorak,marketplaces,conidia,seiya,contraindicated,retford,bundesautobahn,rebuilds,climatology,seaworthy,starfighter,qamar,categoria,malai,hellinsia,newstead,airworthy,catenin,avonmouth,arrhythmias,ayyavazhi,downgrade,ashburnham,ejector,kinematics,petworth,rspca,filmation,accipitridae,chhatrapati,g/mol,bacau,agama,ringtone,yudhoyono,orchestrator,arbitrators,138th,powerplants,cumbernauld,alderley,misamis,hawai`i,cuando,meistriliiga,jermyn,alans,pedigrees,ottavio,approbation,omnium,purulia,prioress,rheinland,lymphoid,lutsk,oscilloscope,ballina,iliac,motorbikes,modernising,uffizi,phylloxera,kalevala,bengalis,amravati,syntheses,interviewers,inflectional,outflank,maryhill,unhurt,profiler,nacelles,heseltine,personalised,guarda,herpetologist,airpark,pigot,margaretha,dinos,peleliu,breakbeat,kastamonu,shaivism,delamere,kingsville,epigram,khlong,phospholipids,journeying,lietuvos,congregated,deviance,celebes,subsoil,stroma,kvitova,lubricating,layoff,alagoas,olafur,doron,interuniversity,raycom,agonopterix,uzice,nanna,springvale,raimundo,wrested,pupal,talat,skinheads,vestige,unpainted,handan,odawara,ammar,attendee,lapped,myotis,gusty,ciconiiformesfamily,traversal,subfield,vitaphone,prensa,hasidism,inwood,carstairs,kropotkin,turgenev,dobra,remittance,purim,tannin,adige,tabulation,lethality,pacha,micronesian,dhruva,defensemen,tibeto,siculus,radioisotope,sodertalje,phitsanulok,euphonium,oxytocin,overhangs,skinks,fabrica,reinterred,emulates,bioscience,paragliding,raekwon,perigee,plausibility,frolunda,erroll,aznar,vyasa,albinus,trevally,confederacion,terse,sixtieth,1530s,kendriya,skateboarders,frontieres,muawiyah,easements,shehu,conservatively,keystones,kasem,brutalist,peekskill,cowry,orcas,syllabary,paltz,elisabetta,denticles,hampering,dolni,eidos,aarau,lermontov,yankton,shahbaz,barrages,kongsvinger,reestablishment,acetyltransferase,zulia,mrnas,slingsby,eucalypt,efficacious,weybridge,gradation,cinematheque,malthus,bampton,coexisted,cisse,hamdi,cupertino,saumarez,chionodes,libertine,formers,sakharov,pseudonymous,vol.1,mcduck,gopalakrishnan,amberley,jorhat,grandmasters,rudiments,dwindle,param,bukidnon,menander,americanus,multipliers,pulawy,homoerotic,pillbox,cd+dvd,epigraph,aleksandrow,extrapolated,horseshoes,contemporain,angiography,hasselt,shawinigan,memorization,legitimized,cyclades,outsold,rodolphe,kelis,powerball,dijkstra,analyzers,incompressible,sambar,orangeburg,osten,reauthorization,adamawa,sphagnum,hypermarket,millipedes,zoroaster,madea,ossuary,murrayfield,pronominal,gautham,resellers,ethers,quarrelled,dolna,stragglers,asami,tangut,passos,educacion,sharaf,texel,berio,bethpage,bezalel,marfa,noronha,36ers,genteel,avram,shilton,compensates,sweetener,reinstalled,disables,noether,1590s,balakrishnan,kotaro,northallerton,cataclysm,gholam,cancellara,schiphol,commends,longinus,albinism,gemayel,hamamatsu,volos,islamism,sidereal,pecuniary,diggings,townsquare,neosho,lushan,chittoor,akhil,disputation,desiccation,cambodians,thwarting,deliberated,ellipsis,bahini,susumu,separators,kohneh,plebeians,kultur,ogaden,pissarro,trypeta,latur,liaodong,vetting,datong,sohail,alchemists,lengthwise,unevenly,masterly,microcontrollers,occupier,deviating,farringdon,baccalaureat,theocracy,chebyshev,archivists,jayaram,ineffectiveness,scandinavians,jacobins,encomienda,nambu,g/cm3,catesby,paavo,heeded,rhodium,idealised,10deg,infective,mecyclothorax,halevy,sheared,minbari,audax,lusatian,rebuffs,hitfix,fastener,subjugate,tarun,binet,compuserve,synthesiser,keisuke,amalric,ligatures,tadashi,ignazio,abramovich,groundnut,otomo,maeve,mortlake,ostrogoths,antillean,todor,recto,millimetre,espousing,inaugurate,paracetamol,galvanic,harpalinae,jedrzejow,reassessment,langlands,civita,mikan,stikine,bijar,imamate,istana,kaiserliche,erastus,federale,cytosine,expansionism,hommes,norrland,smriti,snapdragon,gulab,taleb,lossy,khattab,urbanised,sesto,rekord,diffuser,desam,morganatic,silting,pacts,extender,beauharnais,purley,bouches,halfpipe,discontinuities,houthi,farmville,animism,horni,saadi,interpretative,blockades,symeon,biogeographic,transcaucasian,jetties,landrieu,astrocytes,conjunto,stumpings,weevils,geysers,redux,arching,romanus,tazeh,marcellinus,casein,opava,misrata,anare,sattar,declarer,dreux,oporto,venta,vallis,icosahedron,cortona,lachine,mohammedan,sandnes,zynga,clarin,diomedes,tsuyoshi,pribram,gulbarga,chartist,superettan,boscawen,altus,subang,gating,epistolary,vizianagaram,ogdensburg,panna,thyssen,tarkovsky,dzogchen,biograph,seremban,unscientific,nightjar,legco,deism,n.w.a,sudha,siskel,sassou,flintlock,jovial,montbeliard,pallida,formula_66,tranquillity,nisei,adornment,'people,yamhill,hockeyallsvenskan,adopters,appian,lowicz,haplotypes,succinctly,starogard,presidencies,kheyrabad,sobibor,kinesiology,cowichan,militum,cromwellian,leiningen,ps1.5,concourses,dalarna,goldfield,brzeg,faeces,aquarii,matchless,harvesters,181st,numismatics,korfball,sectioned,transpires,facultative,brandishing,kieron,forages,menai,glutinous,debarge,heathfield,1580s,malang,photoelectric,froome,semiotic,alwar,grammophon,chiaroscuro,mentalist,maramures,flacco,liquors,aleutians,marvell,sutlej,patnaik,qassam,flintoff,bayfield,haeckel,sueno,avicii,exoplanets,hoshi,annibale,vojislav,honeycombs,celebrant,rendsburg,veblen,quails,141st,carronades,savar,narrations,jeeva,ontologies,hedonistic,marinette,godot,munna,bessarabian,outrigger,thame,gravels,hoshino,falsifying,stereochemistry,nacionalista,medially,radula,ejecting,conservatorio,odile,ceiba,jaina,essonne,isometry,allophones,recidivism,iveco,ganda,grammarians,jagan,signposted,uncompressed,facilitators,constancy,ditko,propulsive,impaling,interbank,botolph,amlaib,intergroup,sorbus,cheka,debye,praca,adorning,presbyteries,dormition,strategos,qarase,pentecostals,beehives,hashemite,goldust,euronext,egress,arpanet,soames,jurchens,slovenska,copse,kazim,appraisals,marischal,mineola,sharada,caricaturist,sturluson,galba,faizabad,overwintering,grete,uyezds,didsbury,libreville,ablett,microstructure,anadolu,belenenses,elocution,cloaks,timeslots,halden,rashidun,displaces,sympatric,germanus,tuples,ceska,equalize,disassembly,krautrock,babangida,memel,deild,gopala,hematology,underclass,sangli,wawrinka,assur,toshack,refrains,nicotinic,bhagalpur,badami,racetracks,pocatello,walgreens,nazarbayev,occultation,spinnaker,geneon,josias,hydrolyzed,dzong,corregimiento,waistcoat,thermoplastic,soldered,anticancer,lactobacillus,shafi'i,carabus,adjournment,schlumberger,triceratops,despotate,mendicant,krishnamurti,bahasa,earthworm,lavoisier,noetherian,kalki,fervently,bhawan,saanich,coquille,gannet,motagua,kennels,mineralization,fitzherbert,svein,bifurcated,hairdressing,felis,abounded,dimers,fervour,hebdo,bluffton,aetna,corydon,clevedon,carneiro,subjectively,deutz,gastropoda,overshot,concatenation,varman,carolla,maharshi,mujib,inelastic,riverhead,initialized,safavids,rohini,caguas,bulges,fotbollforbund,hefei,spithead,westville,maronites,lytham,americo,gediminas,stephanus,chalcolithic,hijra,gnu/linux,predilection,rulership,sterility,haidar,scarlatti,saprissa,sviatoslav,pointedly,sunroof,guarantor,thevar,airstrips,pultusk,sture,129th,divinities,daizong,dolichoderus,cobourg,maoists,swordsmanship,uprated,bohme,tashi,largs,chandi,bluebeard,householders,richardsonian,drepanidae,antigonish,elbasan,occultism,marca,hypergeometric,oirat,stiglitz,ignites,dzungar,miquelon,pritam,d'automne,ulidiid,niamey,vallecano,fondo,billiton,incumbencies,raceme,chambery,cadell,barenaked,kagame,summerside,haussmann,hatshepsut,apothecaries,criollo,feint,nasals,timurid,feltham,plotinus,oxygenation,marginata,officinalis,salat,participations,ising,downe,izumo,unguided,pretence,coursed,haruna,viscountcy,mainstage,justicia,powiat,takara,capitoline,implacable,farben,stopford,cosmopterix,tuberous,kronecker,galatians,kweli,dogmas,exhorted,trebinje,skanda,newlyn,ablative,basidia,bhiwani,encroachments,stranglers,regrouping,tubal,shoestring,wawel,anionic,mesenchymal,creationists,pyrophosphate,moshi,despotism,powerbook,fatehpur,rupiah,segre,ternate,jessore,b.i.g,shevardnadze,abounds,gliwice,densest,memoria,suborbital,vietcong,ratepayers,karunanidhi,toolbar,descents,rhymney,exhortation,zahedan,carcinomas,hyperbaric,botvinnik,billets,neuropsychological,tigranes,hoards,chater,biennially,thistles,scotus,wataru,flotillas,hungama,monopolistic,payouts,vetch,generalissimo,caries,naumburg,piran,blizzards,escalates,reactant,shinya,theorize,rizzoli,transitway,ecclesiae,streptomyces,cantal,nisibis,superconductor,unworkable,thallus,roehampton,scheckter,viceroys,makuuchi,ilkley,superseding,takuya,klodzko,borbon,raspberries,operand,w.a.k.o,sarabande,factionalism,egalitarianism,temasek,torbat,unscripted,jorma,westerner,perfective,vrije,underlain,goldfrapp,blaenau,jomon,barthes,drivetime,bassa,bannock,umaga,fengxiang,zulus,sreenivasan,farces,codice_10,freeholder,poddebice,imperialists,deregulated,wingtip,o'hagan,pillared,overtone,hofstadter,149th,kitano,saybrook,standardizing,aldgate,staveley,o'flaherty,hundredths,steerable,soltan,empted,cruyff,intramuros,taluks,cotonou,marae,karur,figueres,barwon,lucullus,niobe,zemlya,lathes,homeported,chaux,amyotrophic,opines,exemplars,bhamo,homomorphisms,gauleiter,ladin,mafiosi,airdrieonians,b/soul,decal,transcaucasia,solti,defecation,deaconess,numidia,sampradaya,normalised,wingless,schwaben,alnus,cinerama,yakutsk,ketchikan,orvieto,unearned,monferrato,rotem,aacsb,loong,decoders,skerries,cardiothoracic,repositioning,pimpernel,yohannan,tenebrionoidea,nargis,nouvel,costliest,interdenominational,noize,redirecting,zither,morcha,radiometric,frequenting,irtysh,gbagbo,chakri,litvinenko,infotainment,ravensbruck,harith,corbels,maegashira,jousting,natan,novus,falcao,minis,railed,decile,rauma,ramaswamy,cavitation,paranaque,berchtesgaden,reanimated,schomberg,polysaccharides,exclusionary,cleon,anurag,ravaging,dhanush,mitchells,granule,contemptuous,keisei,rolleston,atlantean,yorkist,daraa,wapping,micrometer,keeneland,comparably,baranja,oranje,schlafli,yogic,dinajpur,unimpressive,masashi,recreativo,alemannic,petersfield,naoko,vasudeva,autosport,rajat,marella,busko,wethersfield,ssris,soulcalibur,kobani,wildland,rookery,hoffenheim,kauri,aliphatic,balaclava,ferrite,publicise,victorias,theism,quimper,chapbook,functionalist,roadbed,ulyanovsk,cupen,purpurea,calthorpe,teofilo,mousavi,cochlea,linotype,detmold,ellerslie,gakkai,telkom,southsea,subcontractor,inguinal,philatelists,zeebrugge,piave,trochidae,dempo,spoilt,saharanpur,mihrab,parasympathetic,barbarous,chartering,antiqua,katsina,bugis,categorizes,altstadt,kandyan,pambansa,overpasses,miters,assimilating,finlandia,uneconomic,am/fm,harpsichordist,dresdner,luminescence,authentically,overpowers,magmatic,cliftonville,oilfields,skirted,berthe,cuman,oakham,frelimo,glockenspiel,confection,saxophonists,piaseczno,multilevel,antipater,levying,maltreatment,velho,opoczno,harburg,pedophilia,unfunded,palettes,plasterwork,breve,dharmendra,auchinleck,nonesuch,blackmun,libretti,rabbani,145th,hasselbeck,kinnock,malate,vanden,cloverdale,ashgabat,nares,radians,steelworkers,sabor,possums,catterick,hemispheric,ostra,outpaced,dungeness,almshouse,penryn,texians,1000m,franchitti,incumbency,texcoco,newar,tramcars,toroidal,meitetsu,spellbound,agronomist,vinifera,riata,bunko,pinas,ba'al,github,vasilyevich,obsolescent,geodesics,ancestries,tujue,capitalised,unassigned,throng,unpaired,psychometric,skegness,exothermic,buffered,kristiansund,tongued,berenger,basho,alitalia,prolongation,archaeologically,fractionation,cyprinid,echinoderms,agriculturally,justiciar,sonam,ilium,baits,danceable,grazer,ardahan,grassed,preemption,glassworks,hasina,ugric,umbra,wahhabi,vannes,tinnitus,capitaine,tikrit,lisieux,scree,hormuz,despenser,jagiellon,maisonneuve,gandaki,santarem,basilicas,lancing,landskrona,weilburg,fireside,elysian,isleworth,krishnamurthy,filton,cynon,tecmo,subcostal,scalars,triglycerides,hyperplane,farmingdale,unione,meydan,pilings,mercosur,reactivate,akiba,fecundity,jatra,natsume,zarqawi,preta,masao,presbyter,oakenfold,rhodri,ferran,ruizong,cloyne,nelvana,epiphanius,borde,scutes,strictures,troughton,whitestone,sholom,toyah,shingon,kutuzov,abelard,passant,lipno,cafeterias,residuals,anabaptists,paratransit,criollos,pleven,radiata,destabilizing,hadiths,bazaars,mannose,taiyo,crookes,welbeck,baoding,archelaus,nguesso,alberni,wingtips,herts,viasat,lankans,evreux,wigram,fassbinder,ryuichi,storting,reducible,olesnica,znojmo,hyannis,theophanes,flatiron,mustering,rajahmundry,kadir,wayang,prome,lethargy,zubin,illegality,conall,dramedy,beerbohm,hipparchus,ziarat,ryuji,shugo,glenorchy,microarchitecture,morne,lewinsky,cauvery,battenberg,hyksos,wayanad,hamilcar,buhari,brazo,bratianu,solms,aksaray,elamite,chilcotin,bloodstock,sagara,dolny,reunified,umlaut,proteaceae,camborne,calabrian,dhanbad,vaxjo,cookware,potez,rediffusion,semitones,lamentations,allgau,guernica,suntory,pleated,stationing,urgell,gannets,bertelsmann,entryway,raphitomidae,acetaldehyde,nephrology,categorizing,beiyang,permeate,tourney,geosciences,khana,masayuki,crucis,universitaria,slaskie,khaimah,finno,advani,astonishingly,tubulin,vampiric,jeolla,sociale,cleethorpes,badri,muridae,suzong,debater,decimation,kenyans,mutualism,pontifex,middlemen,insee,halevi,lamentation,psychopathy,brassey,wenders,kavya,parabellum,prolactin,inescapable,apses,malignancies,rinzai,stigmatized,menahem,comox,ateliers,welshpool,setif,centimetre,truthfulness,downfield,drusus,woden,glycosylation,emanated,agulhas,dalkeith,jazira,nucky,unifil,jobim,operon,oryzomys,heroically,seances,supernumerary,backhouse,hashanah,tatler,imago,invert,hayato,clockmaker,kingsmill,swiecie,analogously,golconda,poste,tacitly,decentralised,ge'ez,diplomatically,fossiliferous,linseed,mahavira,pedestals,archpriest,byelection,domiciled,jeffersonian,bombus,winegrowing,waukegan,uncultivated,haverfordwest,saumur,communally,disbursed,cleeve,zeljeznicar,speciosa,vacationers,sigur,vaishali,zlatko,iftikhar,cropland,transkei,incompleteness,bohra,subantarctic,slieve,physiologic,similis,klerk,replanted,'right,chafee,reproducible,bayburt,regicide,muzaffarpur,plurals,hanyu,orthologs,diouf,assailed,kamui,tarik,dodecanese,gorne,on/off,179th,shimoga,granaries,carlists,valar,tripolitania,sherds,simmern,dissociated,isambard,polytechnical,yuvraj,brabazon,antisense,pubmed,glans,minutely,masaaki,raghavendra,savoury,podcasting,tachi,bienville,gongsun,ridgely,deform,yuichi,binders,canna,carcetti,llobregat,implored,berri,njegos,intermingled,offload,athenry,motherhouse,corpora,kakinada,dannebrog,imperio,prefaces,musicologists,aerospatiale,shirai,nagapattinam,servius,cristoforo,pomfret,reviled,entebbe,stane,east/west,thermometers,matriarchal,siglo,bodil,legionnaire,ze'ev,theorizing,sangeetha,horticulturist,uncountable,lookalike,anoxic,ionospheric,genealogists,chicopee,imprinting,popish,crematoria,diamondback,cyathea,hanzhong,cameramen,halogaland,naklo,waclaw,storehouses,flexed,comuni,frits,glauca,nilgiris,compresses,nainital,continuations,albay,hypoxic,samajwadi,dunkerque,nanticoke,sarwar,interchanged,jubal,corba,jalgaon,derleth,deathstroke,magny,vinnytsia,hyphenated,rimfire,sawan,boehner,disrepute,normalize,aromanian,dualistic,approximant,chama,karimabad,barnacles,sanok,stipends,dyfed,rijksmuseum,reverberation,suncorp,fungicides,reverie,spectrograph,stereophonic,niazi,ordos,alcan,karaite,lautrec,tableland,lamellar,rieti,langmuir,russula,webern,tweaks,hawick,southerner,morphy,naturalisation,enantiomer,michinoku,barbettes,relieves,carburettors,redruth,oblates,vocabularies,mogilev,bagmati,galium,reasserted,extolled,symon,eurosceptic,inflections,tirtha,recompense,oruro,roping,gouverneur,pared,yayoi,watermills,retooled,leukocytes,jubilant,mazhar,nicolau,manheim,touraine,bedser,hambledon,kohat,powerhouses,tlemcen,reuven,sympathetically,afrikaners,interes,handcrafts,etcher,baddeley,wodonga,amaury,155th,vulgarity,pompadour,automorphisms,1540s,oppositions,prekmurje,deryni,fortifying,arcuate,mahila,bocage,uther,nozze,slashes,atlantica,hadid,rhizomatous,azeris,'with,osmena,lewisville,innervated,bandmaster,outcropping,parallelogram,dominicana,twang,ingushetia,extensional,ladino,sastry,zinoviev,relatable,nobilis,cbeebies,hitless,eulima,sporangia,synge,longlisted,criminalized,penitential,weyden,tubule,volyn,priestesses,glenbrook,kibbutzim,windshaft,canadair,falange,zsolt,bonheur,meine,archangels,safeguarded,jamaicans,malarial,teasers,badging,merseyrail,operands,pulsars,gauchos,biotin,bambara,necaxa,egmond,tillage,coppi,anxiolytic,preah,mausoleums,plautus,feroz,debunked,187th,belediyespor,mujibur,wantage,carboxyl,chettiar,murnau,vagueness,racemic,backstretch,courtland,municipio,palpatine,dezful,hyperbola,sreekumar,chalons,altay,arapahoe,tudors,sapieha,quilon,burdensome,kanya,xxviii,recension,generis,siphuncle,repressor,bitrate,mandals,midhurst,dioxin,democratique,upholds,rodez,cinematographic,epoque,jinping,rabelais,zhytomyr,glenview,rebooted,khalidi,reticulata,122nd,monnaie,passersby,ghazals,europaea,lippmann,earthbound,tadic,andorran,artvin,angelicum,banksy,epicentre,resemblances,shuttled,rathaus,bernt,stonemasons,balochi,siang,tynemouth,cygni,biosynthetic,precipitates,sharecroppers,d'annunzio,softbank,shiji,apeldoorn,polycyclic,wenceslas,wuchang,samnites,tamarack,silmarillion,madinah,palaeontology,kirchberg,sculpin,rohtak,aquabats,oviparous,thynne,caney,blimps,minimalistic,whatcom,palatalization,bardstown,direct3d,paramagnetic,kamboja,khash,globemaster,lengua,matej,chernigov,swanage,arsenals,cascadia,cundinamarca,tusculum,leavers,organics,warplanes,'three,exertions,arminius,gandharva,inquires,comercio,kuopio,chabahar,plotlines,mersenne,anquetil,paralytic,buckminster,ambit,acrolophus,quantifiers,clacton,ciliary,ansaldo,fergana,egoism,thracians,chicoutimi,northbrook,analgesia,brotherhoods,hunza,adriaen,fluoridation,snowfalls,soundboard,fangoria,cannibalistic,orthogonius,chukotka,dindigul,manzoni,chainz,macromedia,beltline,muruga,schistura,provable,litex,initio,pneumoniae,infosys,cerium,boonton,cannonballs,d'une,solvency,mandurah,houthis,dolmens,apologists,radioisotopes,blaxploitation,poroshenko,stawell,coosa,maximilien,tempelhof,espouse,declaratory,hambro,xalapa,outmoded,mihiel,benefitting,desirous,archeparchy,repopulated,telescoping,captor,mackaye,disparaged,ramanathan,crowne,tumbled,technetium,silted,chedi,nievre,hyeon,cartoonish,interlock,infocom,rediff.com,dioramas,timekeeping,concertina,kutaisi,cesky,lubomirski,unapologetic,epigraphic,stalactites,sneha,biofilm,falconry,miraflores,catena,'outstanding,prospekt,apotheosis,o'odham,pacemakers,arabica,gandhinagar,reminisces,iroquoian,ornette,tilling,neoliberalism,chameleons,pandava,prefontaine,haiyan,gneisenau,utama,bando,reconstitution,azaria,canola,paratroops,ayckbourn,manistee,stourton,manifestos,lympne,denouement,tractatus,rakim,bellflower,nanometer,sassanids,turlough,presbyterianism,varmland,20deg,phool,nyerere,almohad,manipal,vlaanderen,quickness,removals,makow,circumflex,eatery,morane,fondazione,alkylation,unenforceable,galliano,silkworm,junior/senior,abducts,phlox,konskie,lofoten,buuren,glyphosate,faired,naturae,cobbles,taher,skrulls,dostoevsky,walkout,wagnerian,orbited,methodically,denzil,sarat,extraterritorial,kohima,d'armor,brinsley,rostropovich,fengtian,comitatus,aravind,moche,wrangell,giscard,vantaa,viljandi,hakoah,seabees,muscatine,ballade,camanachd,sothern,mullioned,durad,margraves,maven,arete,chandni,garifuna,142nd,reading/literature,thickest,intensifies,trygve,khaldun,perinatal,asana,powerline,acetylation,nureyev,omiya,montesquieu,riverwalk,marly,correlating,intermountain,bulgar,hammerheads,underscores,wiretapping,quatrain,ruisseau,newsagent,tuticorin,polygyny,hemsworth,partisanship,banna,istrian,evaporator".split(","), +female_names:"mary,patricia,linda,barbara,elizabeth,jennifer,maria,susan,margaret,dorothy,lisa,nancy,karen,betty,helen,sandra,donna,carol,ruth,sharon,michelle,laura,sarah,kimberly,deborah,jessica,shirley,cynthia,angela,melissa,brenda,amy,anna,rebecca,virginia,kathleen,pamela,martha,debra,amanda,stephanie,carolyn,christine,marie,janet,catherine,frances,ann,joyce,diane,alice,julie,heather,teresa,doris,gloria,evelyn,jean,cheryl,mildred,katherine,joan,ashley,judith,rose,janice,kelly,nicole,judy,christina,kathy,theresa,beverly,denise,tammy,irene,jane,lori,rachel,marilyn,andrea,kathryn,louise,sara,anne,jacqueline,wanda,bonnie,julia,ruby,lois,tina,phyllis,norma,paula,diana,annie,lillian,emily,robin,peggy,crystal,gladys,rita,dawn,connie,florence,tracy,edna,tiffany,carmen,rosa,cindy,grace,wendy,victoria,edith,kim,sherry,sylvia,josephine,thelma,shannon,sheila,ethel,ellen,elaine,marjorie,carrie,charlotte,monica,esther,pauline,emma,juanita,anita,rhonda,hazel,amber,eva,debbie,april,leslie,clara,lucille,jamie,joanne,eleanor,valerie,danielle,megan,alicia,suzanne,michele,gail,bertha,darlene,veronica,jill,erin,geraldine,lauren,cathy,joann,lorraine,lynn,sally,regina,erica,beatrice,dolores,bernice,audrey,yvonne,annette,marion,dana,stacy,ana,renee,ida,vivian,roberta,holly,brittany,melanie,loretta,yolanda,jeanette,laurie,katie,kristen,vanessa,alma,sue,elsie,beth,jeanne,vicki,carla,tara,rosemary,eileen,terri,gertrude,lucy,tonya,ella,stacey,wilma,gina,kristin,jessie,natalie,agnes,vera,charlene,bessie,delores,melinda,pearl,arlene,maureen,colleen,allison,tamara,joy,georgia,constance,lillie,claudia,jackie,marcia,tanya,nellie,minnie,marlene,heidi,glenda,lydia,viola,courtney,marian,stella,caroline,dora,vickie,mattie,maxine,irma,mabel,marsha,myrtle,lena,christy,deanna,patsy,hilda,gwendolyn,jennie,nora,margie,nina,cassandra,leah,penny,kay,priscilla,naomi,carole,olga,billie,dianne,tracey,leona,jenny,felicia,sonia,miriam,velma,becky,bobbie,violet,kristina,toni,misty,mae,shelly,daisy,ramona,sherri,erika,katrina,claire,lindsey,lindsay,geneva,guadalupe,belinda,margarita,sheryl,cora,faye,ada,sabrina,isabel,marguerite,hattie,harriet,molly,cecilia,kristi,brandi,blanche,sandy,rosie,joanna,iris,eunice,angie,inez,lynda,madeline,amelia,alberta,genevieve,monique,jodi,janie,kayla,sonya,jan,kristine,candace,fannie,maryann,opal,alison,yvette,melody,luz,susie,olivia,flora,shelley,kristy,mamie,lula,lola,verna,beulah,antoinette,candice,juana,jeannette,pam,kelli,whitney,bridget,karla,celia,latoya,patty,shelia,gayle,della,vicky,lynne,sheri,marianne,kara,jacquelyn,erma,blanca,myra,leticia,pat,krista,roxanne,angelica,robyn,adrienne,rosalie,alexandra,brooke,bethany,sadie,bernadette,traci,jody,kendra,nichole,rachael,mable,ernestine,muriel,marcella,elena,krystal,angelina,nadine,kari,estelle,dianna,paulette,lora,mona,doreen,rosemarie,desiree,antonia,janis,betsy,christie,freda,meredith,lynette,teri,cristina,eula,leigh,meghan,sophia,eloise,rochelle,gretchen,cecelia,raquel,henrietta,alyssa,jana,gwen,jenna,tricia,laverne,olive,tasha,silvia,elvira,delia,kate,patti,lorena,kellie,sonja,lila,lana,darla,mindy,essie,mandy,lorene,elsa,josefina,jeannie,miranda,dixie,lucia,marta,faith,lela,johanna,shari,camille,tami,shawna,elisa,ebony,melba,ora,nettie,tabitha,ollie,winifred,kristie,alisha,aimee,rena,myrna,marla,tammie,latasha,bonita,patrice,ronda,sherrie,addie,francine,deloris,stacie,adriana,cheri,abigail,celeste,jewel,cara,adele,rebekah,lucinda,dorthy,effie,trina,reba,sallie,aurora,lenora,etta,lottie,kerri,trisha,nikki,estella,francisca,josie,tracie,marissa,karin,brittney,janelle,lourdes,laurel,helene,fern,elva,corinne,kelsey,ina,bettie,elisabeth,aida,caitlin,ingrid,iva,eugenia,christa,goldie,maude,jenifer,therese,dena,lorna,janette,latonya,candy,consuelo,tamika,rosetta,debora,cherie,polly,dina,jewell,fay,jillian,dorothea,nell,trudy,esperanza,patrica,kimberley,shanna,helena,cleo,stefanie,rosario,ola,janine,mollie,lupe,alisa,lou,maribel,susanne,bette,susana,elise,cecile,isabelle,lesley,jocelyn,paige,joni,rachelle,leola,daphne,alta,ester,petra,graciela,imogene,jolene,keisha,lacey,glenna,gabriela,keri,ursula,lizzie,kirsten,shana,adeline,mayra,jayne,jaclyn,gracie,sondra,carmela,marisa,rosalind,charity,tonia,beatriz,marisol,clarice,jeanine,sheena,angeline,frieda,lily,shauna,millie,claudette,cathleen,angelia,gabrielle,autumn,katharine,jodie,staci,lea,christi,justine,elma,luella,margret,dominique,socorro,martina,margo,mavis,callie,bobbi,maritza,lucile,leanne,jeannine,deana,aileen,lorie,ladonna,willa,manuela,gale,selma,dolly,sybil,abby,ivy,dee,winnie,marcy,luisa,jeri,magdalena,ofelia,meagan,audra,matilda,leila,cornelia,bianca,simone,bettye,randi,virgie,latisha,barbra,georgina,eliza,leann,bridgette,rhoda,haley,adela,nola,bernadine,flossie,ila,greta,ruthie,nelda,minerva,lilly,terrie,letha,hilary,estela,valarie,brianna,rosalyn,earline,catalina,ava,mia,clarissa,lidia,corrine,alexandria,concepcion,tia,sharron,rae,dona,ericka,jami,elnora,chandra,lenore,neva,marylou,melisa,tabatha,serena,avis,allie,sofia,jeanie,odessa,nannie,harriett,loraine,penelope,milagros,emilia,benita,allyson,ashlee,tania,esmeralda,eve,pearlie,zelma,malinda,noreen,tameka,saundra,hillary,amie,althea,rosalinda,lilia,alana,clare,alejandra,elinor,lorrie,jerri,darcy,earnestine,carmella,noemi,marcie,liza,annabelle,louisa,earlene,mallory,carlene,nita,selena,tanisha,katy,julianne,lakisha,edwina,maricela,margery,kenya,dollie,roxie,roslyn,kathrine,nanette,charmaine,lavonne,ilene,tammi,suzette,corine,kaye,chrystal,lina,deanne,lilian,juliana,aline,luann,kasey,maryanne,evangeline,colette,melva,lawanda,yesenia,nadia,madge,kathie,ophelia,valeria,nona,mitzi,mari,georgette,claudine,fran,alissa,roseann,lakeisha,susanna,reva,deidre,chasity,sheree,elvia,alyce,deirdre,gena,briana,araceli,katelyn,rosanne,wendi,tessa,berta,marva,imelda,marietta,marci,leonor,arline,sasha,madelyn,janna,juliette,deena,aurelia,josefa,augusta,liliana,lessie,amalia,savannah,anastasia,vilma,natalia,rosella,lynnette,corina,alfreda,leanna,amparo,coleen,tamra,aisha,wilda,karyn,maura,mai,evangelina,rosanna,hallie,erna,enid,mariana,lacy,juliet,jacklyn,freida,madeleine,mara,cathryn,lelia,casandra,bridgett,angelita,jannie,dionne,annmarie,katina,beryl,millicent,katheryn,diann,carissa,maryellen,liz,lauri,helga,gilda,rhea,marquita,hollie,tisha,tamera,angelique,francesca,kaitlin,lolita,florine,rowena,reyna,twila,fanny,janell,ines,concetta,bertie,alba,brigitte,alyson,vonda,pansy,elba,noelle,letitia,deann,brandie,louella,leta,felecia,sharlene,lesa,beverley,isabella,herminia,terra,celina,tori,octavia,jade,denice,germaine,michell,cortney,nelly,doretha,deidra,monika,lashonda,judi,chelsey,antionette,margot,adelaide,leeann,elisha,dessie,libby,kathi,gayla,latanya,mina,mellisa,kimberlee,jasmin,renae,zelda,elda,justina,gussie,emilie,camilla,abbie,rocio,kaitlyn,edythe,ashleigh,selina,lakesha,geri,allene,pamala,michaela,dayna,caryn,rosalia,jacquline,rebeca,marybeth,krystle,iola,dottie,belle,griselda,ernestina,elida,adrianne,demetria,delma,jaqueline,arleen,virgina,retha,fatima,tillie,eleanore,cari,treva,wilhelmina,rosalee,maurine,latrice,jena,taryn,elia,debby,maudie,jeanna,delilah,catrina,shonda,hortencia,theodora,teresita,robbin,danette,delphine,brianne,nilda,danna,cindi,bess,iona,winona,vida,rosita,marianna,racheal,guillermina,eloisa,celestine,caren,malissa,lona,chantel,shellie,marisela,leora,agatha,soledad,migdalia,ivette,christen,athena,janel,veda,pattie,tessie,tera,marilynn,lucretia,karrie,dinah,daniela,alecia,adelina,vernice,shiela,portia,merry,lashawn,dara,tawana,verda,alene,zella,sandi,rafaela,maya,kira,candida,alvina,suzan,shayla,lettie,samatha,oralia,matilde,larissa,vesta,renita,delois,shanda,phillis,lorri,erlinda,cathrine,barb,isabell,ione,gisela,roxanna,mayme,kisha,ellie,mellissa,dorris,dalia,bella,annetta,zoila,reta,reina,lauretta,kylie,christal,pilar,charla,elissa,tiffani,tana,paulina,leota,breanna,jayme,carmel,vernell,tomasa,mandi,dominga,santa,melodie,lura,alexa,tamela,mirna,kerrie,venus,felicita,cristy,carmelita,berniece,annemarie,tiara,roseanne,missy,cori,roxana,pricilla,kristal,jung,elyse,haydee,aletha,bettina,marge,gillian,filomena,zenaida,harriette,caridad,vada,aretha,pearline,marjory,marcela,flor,evette,elouise,alina,damaris,catharine,belva,nakia,marlena,luanne,lorine,karon,dorene,danita,brenna,tatiana,louann,julianna,andria,philomena,lucila,leonora,dovie,romona,mimi,jacquelin,gaye,tonja,misti,chastity,stacia,roxann,micaela,velda,marlys,johnna,aura,ivonne,hayley,nicki,majorie,herlinda,yadira,perla,gregoria,antonette,shelli,mozelle,mariah,joelle,cordelia,josette,chiquita,trista,laquita,georgiana,candi,shanon,hildegard,stephany,magda,karol,gabriella,tiana,roma,richelle,oleta,jacque,idella,alaina,suzanna,jovita,tosha,nereida,marlyn,kyla,delfina,tena,stephenie,sabina,nathalie,marcelle,gertie,darleen,thea,sharonda,shantel,belen,venessa,rosalina,genoveva,clementine,rosalba,renate,renata,georgianna,floy,dorcas,ariana,tyra,theda,mariam,juli,jesica,vikki,verla,roselyn,melvina,jannette,ginny,debrah,corrie,violeta,myrtis,latricia,collette,charleen,anissa,viviana,twyla,nedra,latonia,hellen,fabiola,annamarie,adell,sharyn,chantal,niki,maud,lizette,lindy,kesha,jeana,danelle,charline,chanel,valorie,dortha,cristal,sunny,leone,leilani,gerri,debi,andra,keshia,eulalia,easter,dulce,natividad,linnie,kami,georgie,catina,brook,alda,winnifred,sharla,ruthann,meaghan,magdalene,lissette,adelaida,venita,trena,shirlene,shameka,elizebeth,dian,shanta,latosha,carlotta,windy,rosina,mariann,leisa,jonnie,dawna,cathie,astrid,laureen,janeen,holli,fawn,vickey,teressa,shante,rubye,marcelina,chanda,terese,scarlett,marnie,lulu,lisette,jeniffer,elenor,dorinda,donita,carman,bernita,altagracia,aleta,adrianna,zoraida,lyndsey,janina,starla,phylis,phuong,kyra,charisse,blanch,sanjuanita,rona,nanci,marilee,maranda,brigette,sanjuana,marita,kassandra,joycelyn,felipa,chelsie,bonny,mireya,lorenza,kyong,ileana,candelaria,sherie,lucie,leatrice,lakeshia,gerda,edie,bambi,marylin,lavon,hortense,garnet,evie,tressa,shayna,lavina,kyung,jeanetta,sherrill,shara,phyliss,mittie,anabel,alesia,thuy,tawanda,joanie,tiffanie,lashanda,karissa,enriqueta,daria,daniella,corinna,alanna,abbey,roxane,roseanna,magnolia,lida,joellen,coral,carleen,tresa,peggie,novella,nila,maybelle,jenelle,carina,nova,melina,marquerite,margarette,josephina,evonne,cinthia,albina,toya,tawnya,sherita,myriam,lizabeth,lise,keely,jenni,giselle,cheryle,ardith,ardis,alesha,adriane,shaina,linnea,karolyn,felisha,dori,darci,artie,armida,zola,xiomara,vergie,shamika,nena,nannette,maxie,lovie,jeane,jaimie,inge,farrah,elaina,caitlyn,felicitas,cherly,caryl,yolonda,yasmin,teena,prudence,pennie,nydia,mackenzie,orpha,marvel,lizbeth,laurette,jerrie,hermelinda,carolee,tierra,mirian,meta,melony,kori,jennette,jamila,yoshiko,susannah,salina,rhiannon,joleen,cristine,ashton,aracely,tomeka,shalonda,marti,lacie,kala,jada,ilse,hailey,brittani,zona,syble,sherryl,nidia,marlo,kandice,kandi,alycia,ronna,norene,mercy,ingeborg,giovanna,gemma,christel,audry,zora,vita,trish,stephaine,shirlee,shanika,melonie,mazie,jazmin,inga,hettie,geralyn,fonda,estrella,adella,sarita,rina,milissa,maribeth,golda,evon,ethelyn,enedina,cherise,chana,velva,tawanna,sade,mirta,karie,jacinta,elna,davina,cierra,ashlie,albertha,tanesha,nelle,mindi,lorinda,larue,florene,demetra,dedra,ciara,chantelle,ashly,suzy,rosalva,noelia,lyda,leatha,krystyna,kristan,karri,darline,darcie,cinda,cherrie,awilda,almeda,rolanda,lanette,jerilyn,gisele,evalyn,cyndi,cleta,carin,zina,zena,velia,tanika,charissa,talia,margarete,lavonda,kaylee,kathlene,jonna,irena,ilona,idalia,candis,candance,brandee,anitra,alida,sigrid,nicolette,maryjo,linette,hedwig,christiana,alexia,tressie,modesta,lupita,lita,gladis,evelia,davida,cherri,cecily,ashely,annabel,agustina,wanita,shirly,rosaura,hulda,yetta,verona,thomasina,sibyl,shannan,mechelle,leandra,lani,kylee,kandy,jolynn,ferne,eboni,corene,alysia,zula,nada,moira,lyndsay,lorretta,jammie,hortensia,gaynell,adria,vina,vicenta,tangela,stephine,norine,nella,liana,leslee,kimberely,iliana,glory,felica,emogene,elfriede,eden,eartha,carma,ocie,lennie,kiara,jacalyn,carlota,arielle,otilia,kirstin,kacey,johnetta,joetta,jeraldine,jaunita,elana,dorthea,cami,amada,adelia,vernita,tamar,siobhan,renea,rashida,ouida,nilsa,meryl,kristyn,julieta,danica,breanne,aurea,anglea,sherron,odette,malia,lorelei,leesa,kenna,kathlyn,fiona,charlette,suzie,shantell,sabra,racquel,myong,mira,martine,lucienne,lavada,juliann,elvera,delphia,christiane,charolette,carri,asha,angella,paola,ninfa,leda,stefani,shanell,palma,machelle,lissa,kecia,kathryne,karlene,julissa,jettie,jenniffer,corrina,carolann,alena,rosaria,myrtice,marylee,liane,kenyatta,judie,janey,elmira,eldora,denna,cristi,cathi,zaida,vonnie,viva,vernie,rosaline,mariela,luciana,lesli,karan,felice,deneen,adina,wynona,tarsha,sheron,shanita,shani,shandra,randa,pinkie,nelida,marilou,lyla,laurene,laci,janene,dorotha,daniele,dani,carolynn,carlyn,berenice,ayesha,anneliese,alethea,thersa,tamiko,rufina,oliva,mozell,marylyn,kristian,kathyrn,kasandra,kandace,janae,domenica,debbra,dannielle,chun,arcelia,zenobia,sharen,sharee,lavinia,kacie,jackeline,huong,felisa,emelia,eleanora,cythia,cristin,claribel,anastacia,zulma,zandra,yoko,tenisha,susann,sherilyn,shay,shawanda,romana,mathilda,linsey,keiko,joana,isela,gretta,georgetta,eugenie,desirae,delora,corazon,antonina,anika,willene,tracee,tamatha,nichelle,mickie,maegan,luana,lanita,kelsie,edelmira,bree,afton,teodora,tamie,shena,linh,keli,kaci,danyelle,arlette,albertine,adelle,tiffiny,simona,nicolasa,nichol,nakisha,maira,loreen,kizzy,fallon,christene,bobbye,ying,vincenza,tanja,rubie,roni,queenie,margarett,kimberli,irmgard,idell,hilma,evelina,esta,emilee,dennise,dania,carie,risa,rikki,particia,masako,luvenia,loree,loni,lien,gigi,florencia,denita,billye,tomika,sharita,rana,nikole,neoma,margarite,madalyn,lucina,laila,kali,jenette,gabriele,evelyne,elenora,clementina,alejandrina,zulema,violette,vannessa,thresa,retta,patience,noella,nickie,jonell,chaya,camelia,bethel,anya,suzann,mila,lilla,laverna,keesha,kattie,georgene,eveline,estell,elizbeth,vivienne,vallie,trudie,stephane,magaly,madie,kenyetta,karren,janetta,hermine,drucilla,debbi,celestina,candie,britni,beckie,amina,zita,yolande,vivien,vernetta,trudi,pearle,patrina,ossie,nicolle,loyce,letty,katharina,joselyn,jonelle,jenell,iesha,heide,florinda,florentina,elodia,dorine,brunilda,brigid,ashli,ardella,twana,tarah,shavon,serina,rayna,ramonita,margurite,lucrecia,kourtney,kati,jesenia,crista,ayana,alica,alia,vinnie,suellen,romelia,rachell,olympia,michiko,kathaleen,jolie,jessi,janessa,hana,elease,carletta,britany,shona,salome,rosamond,regena,raina,ngoc,nelia,louvenia,lesia,latrina,laticia,larhonda,jina,jacki,emmy,deeann,coretta,arnetta,thalia,shanice,neta,mikki,micki,lonna,leana,lashunda,kiley,joye,jacqulyn,ignacia,hyun,hiroko,henriette,elayne,delinda,dahlia,coreen,consuela,conchita,babette,ayanna,anette,albertina,shawnee,shaneka,quiana,pamelia,merri,merlene,margit,kiesha,kiera,kaylene,jodee,jenise,erlene,emmie,dalila,daisey,casie,belia,babara,versie,vanesa,shelba,shawnda,nikia,naoma,marna,margeret,madaline,lawana,kindra,jutta,jazmine,janett,hannelore,glendora,gertrud,garnett,freeda,frederica,florance,flavia,carline,beverlee,anjanette,valda,tamala,shonna,sarina,oneida,merilyn,marleen,lurline,lenna,katherin,jeni,gracia,glady,farah,enola,dominque,devona,delana,cecila,caprice,alysha,alethia,vena,theresia,tawny,shakira,samara,sachiko,rachele,pamella,marni,mariel,maren,malisa,ligia,lera,latoria,larae,kimber,kathern,karey,jennefer,janeth,halina,fredia,delisa,debroah,ciera,angelika,andree,altha,vivan,terresa,tanna,sudie,signe,salena,ronni,rebbecca,myrtie,malika,maida,leonarda,kayleigh,ethyl,ellyn,dayle,cammie,brittni,birgit,avelina,asuncion,arianna,akiko,venice,tyesha,tonie,tiesha,takisha,steffanie,sindy,meghann,manda,macie,kellye,kellee,joslyn,inger,indira,glinda,glennis,fernanda,faustina,eneida,elicia,digna,dell,arletta,willia,tammara,tabetha,sherrell,sari,rebbeca,pauletta,natosha,nakita,mammie,kenisha,kazuko,kassie,earlean,daphine,corliss,clotilde,carolyne,bernetta,augustina,audrea,annis,annabell,tennille,tamica,selene,rosana,regenia,qiana,markita,macy,leeanne,laurine,jessenia,janita,georgine,genie,emiko,elvie,deandra,dagmar,corie,collen,cherish,romaine,porsha,pearlene,micheline,merna,margorie,margaretta,lore,jenine,hermina,fredericka,elke,drusilla,dorathy,dione,celena,brigida,allegra,tamekia,synthia,sook,slyvia,rosann,reatha,raye,marquetta,margart,ling,layla,kymberly,kiana,kayleen,katlyn,karmen,joella,emelda,eleni,detra,clemmie,cheryll,chantell,cathey,arnita,arla,angle,angelic,alyse,zofia,thomasine,tennie,sherly,sherley,sharyl,remedios,petrina,nickole,myung,myrle,mozella,louanne,lisha,latia,krysta,julienne,jeanene,jacqualine,isaura,gwenda,earleen,cleopatra,carlie,audie,antonietta,alise,verdell,tomoko,thao,talisha,shemika,savanna,santina,rosia,raeann,odilia,nana,minna,magan,lynelle,karma,joeann,ivana,inell,ilana,gudrun,dreama,crissy,chante,carmelina,arvilla,annamae,alvera,aleida,yanira,vanda,tianna,stefania,shira,nicol,nancie,monserrate,melynda,melany,lovella,laure,kacy,jacquelynn,hyon,gertha,eliana,christena,christeen,charise,caterina,carley,candyce,arlena,ammie,willette,vanita,tuyet,syreeta,penney,nyla,maryam,marya,magen,ludie,loma,livia,lanell,kimberlie,julee,donetta,diedra,denisha,deane,dawne,clarine,cherryl,bronwyn,alla,valery,tonda,sueann,soraya,shoshana,shela,sharleen,shanelle,nerissa,meridith,mellie,maye,maple,magaret,lili,leonila,leonie,leeanna,lavonia,lavera,kristel,kathey,kathe,jann,ilda,hildred,hildegarde,genia,fumiko,evelin,ermelinda,elly,dung,doloris,dionna,danae,berneice,annice,alix,verena,verdie,shawnna,shawana,shaunna,rozella,randee,ranae,milagro,lynell,luise,loida,lisbeth,karleen,junita,jona,isis,hyacinth,hedy,gwenn,ethelene,erline,donya,domonique,delicia,dannette,cicely,branda,blythe,bethann,ashlyn,annalee,alline,yuko,vella,trang,towanda,tesha,sherlyn,narcisa,miguelina,meri,maybell,marlana,marguerita,madlyn,lory,loriann,leonore,leighann,laurice,latesha,laronda,katrice,kasie,kaley,jadwiga,glennie,gearldine,francina,epifania,dyan,dorie,diedre,denese,demetrice,delena,cristie,cleora,catarina,carisa,barbera,almeta,trula,tereasa,solange,sheilah,shavonne,sanora,rochell,mathilde,margareta,maia,lynsey,lawanna,launa,kena,keena,katia,glynda,gaylene,elvina,elanor,danuta,danika,cristen,cordie,coletta,clarita,carmon,brynn,azucena,aundrea,angele,verlie,verlene,tamesha,silvana,sebrina,samira,reda,raylene,penni,norah,noma,mireille,melissia,maryalice,laraine,kimbery,karyl,karine,jolanda,johana,jesusa,jaleesa,jacquelyne,iluminada,hilaria,hanh,gennie,francie,floretta,exie,edda,drema,delpha,barbar,assunta,ardell,annalisa,alisia,yukiko,yolando,wonda,waltraud,veta,temeka,tameika,shirleen,shenita,piedad,ozella,mirtha,marilu,kimiko,juliane,jenice,janay,jacquiline,hilde,elois,echo,devorah,chau,brinda,betsey,arminda,aracelis,apryl,annett,alishia,veola,usha,toshiko,theola,tashia,talitha,shery,renetta,reiko,rasheeda,obdulia,mika,melaine,meggan,marlen,marget,marceline,mana,magdalen,librada,lezlie,latashia,lasandra,kelle,isidra,inocencia,gwyn,francoise,erminia,erinn,dimple,devora,criselda,armanda,arie,ariane,angelena,aliza,adriene,adaline,xochitl,twanna,tomiko,tamisha,taisha,susy,rutha,rhona,noriko,natashia,merrie,marinda,mariko,margert,loris,lizzette,leisha,kaila,joannie,jerrica,jene,jannet,janee,jacinda,herta,elenore,doretta,delaine,daniell,claudie,britta,apolonia,amberly,alease,yuri,waneta,tomi,sharri,sandie,roselle,reynalda,raguel,phylicia,patria,olimpia,odelia,mitzie,minda,mignon,mica,mendy,marivel,maile,lynetta,lavette,lauryn,latrisha,lakiesha,kiersten,kary,josphine,jolyn,jetta,janise,jacquie,ivelisse,glynis,gianna,gaynelle,danyell,danille,dacia,coralee,cher,ceola,arianne,aleshia,yung,williemae,trinh,thora,sherika,shemeka,shaunda,roseline,ricki,melda,mallie,lavonna,latina,laquanda,lala,lachelle,klara,kandis,johna,jeanmarie,jaye,grayce,gertude,emerita,ebonie,clorinda,ching,chery,carola,breann,blossom,bernardine,becki,arletha,argelia,alita,yulanda,yessenia,tobi,tasia,sylvie,shirl,shirely,shella,shantelle,sacha,rebecka,providencia,paulene,misha,miki,marline,marica,lorita,latoyia,lasonya,kerstin,kenda,keitha,kathrin,jaymie,gricelda,ginette,eryn,elina,elfrieda,danyel,cheree,chanelle,barrie,aurore,annamaria,alleen,ailene,aide,yasmine,vashti,treasa,tiffaney,sheryll,sharie,shanae,raisa,neda,mitsuko,mirella,milda,maryanna,maragret,mabelle,luetta,lorina,letisha,latarsha,lanelle,lajuana,krissy,karly,karena,jessika,jerica,jeanelle,jalisa,jacelyn,izola,euna,etha,domitila,dominica,daina,creola,carli,camie,brittny,ashanti,anisha,aleen,adah,yasuko,valrie,tona,tinisha,terisa,taneka,simonne,shalanda,serita,ressie,refugia,olene,margherita,mandie,maire,lyndia,luci,lorriane,loreta,leonia,lavona,lashawnda,lakia,kyoko,krystina,krysten,kenia,kelsi,jeanice,isobel,georgiann,genny,felicidad,eilene,deloise,deedee,conception,clora,cherilyn,calandra,armandina,anisa,tiera,theressa,stephania,sima,shyla,shonta,shera,shaquita,shala,rossana,nohemi,nery,moriah,melita,melida,melani,marylynn,marisha,mariette,malorie,madelene,ludivina,loria,lorette,loralee,lianne,lavenia,laurinda,lashon,kimi,keila,katelynn,jone,joane,jayna,janella,hertha,francene,elinore,despina,delsie,deedra,clemencia,carolin,bulah,brittanie,blondell,bibi,beaulah,beata,annita,agripina,virgen,valene,twanda,tommye,tarra,tari,tammera,shakia,sadye,ruthanne,rochel,rivka,pura,nenita,natisha,ming,merrilee,melodee,marvis,lucilla,leena,laveta,larita,lanie,keren,ileen,georgeann,genna,frida,eufemia,emely,edyth,deonna,deadra,darlena,chanell,cathern,cassondra,cassaundra,bernarda,berna,arlinda,anamaria,vertie,valeri,torri,stasia,sherise,sherill,sanda,ruthe,rosy,robbi,ranee,quyen,pearly,palmira,onita,nisha,niesha,nida,merlyn,mayola,marylouise,marth,margene,madelaine,londa,leontine,leoma,leia,lauralee,lanora,lakita,kiyoko,keturah,katelin,kareen,jonie,johnette,jenee,jeanett,izetta,hiedi,heike,hassie,giuseppina,georgann,fidela,fernande,elwanda,ellamae,eliz,dusti,dotty,cyndy,coralie,celesta,alverta,xenia,wava,vanetta,torrie,tashina,tandy,tambra,tama,stepanie,shila,shaunta,sharan,shaniqua,shae,setsuko,serafina,sandee,rosamaria,priscila,olinda,nadene,muoi,michelina,mercedez,maryrose,marcene,magali,mafalda,lannie,kayce,karoline,kamilah,kamala,justa,joline,jennine,jacquetta,iraida,georgeanna,franchesca,emeline,elane,ehtel,earlie,dulcie,dalene,classie,chere,charis,caroyln,carmina,carita,bethanie,ayako,arica,alysa,alessandra,akilah,adrien,zetta,youlanda,yelena,yahaira,xuan,wendolyn,tijuana,terina,teresia,suzi,sherell,shavonda,shaunte,sharda,shakita,sena,ryann,rubi,riva,reginia,rachal,parthenia,pamula,monnie,monet,michaele,melia,malka,maisha,lisandra,lekisha,lean,lakendra,krystin,kortney,kizzie,kittie,kera,kendal,kemberly,kanisha,julene,jule,johanne,jamee,halley,gidget,fredricka,fleta,fatimah,eusebia,elza,eleonore,dorthey,doria,donella,dinorah,delorse,claretha,christinia,charlyn,bong,belkis,azzie,andera,aiko,adena,yajaira,vania,ulrike,toshia,tifany,stefany,shizue,shenika,shawanna,sharolyn,sharilyn,shaquana,shantay,rozanne,roselee,remona,reanna,raelene,phung,petronila,natacha,nancey,myrl,miyoko,miesha,merideth,marvella,marquitta,marhta,marchelle,lizeth,libbie,lahoma,ladawn,kina,katheleen,katharyn,karisa,kaleigh,junie,julieann,johnsie,janean,jaimee,jackqueline,hisako,herma,helaine,gwyneth,gita,eustolia,emelina,elin,edris,donnette,donnetta,dierdre,denae,darcel,clarisa,cinderella,chia,charlesetta,charita,celsa,cassy,cassi,carlee,bruna,brittaney,brande,billi,antonetta,angla,angelyn,analisa,alane,wenona,wendie,veronique,vannesa,tobie,tempie,sumiko,sulema,somer,sheba,sharice,shanel,shalon,rosio,roselia,renay,rema,reena,ozie,oretha,oralee,ngan,nakesha,milly,marybelle,margrett,maragaret,manie,lurlene,lillia,lieselotte,lavelle,lashaunda,lakeesha,kaycee,kalyn,joya,joette,jenae,janiece,illa,grisel,glayds,genevie,gala,fredda,eleonor,debera,deandrea,corrinne,cordia,contessa,colene,cleotilde,chantay,cecille,beatris,azalee,arlean,ardath,anjelica,anja,alfredia,aleisha,zada,yuonne,xiao,willodean,vennie,vanna,tyisha,tova,torie,tonisha,tilda,tien,sirena,sherril,shanti,shan,senaida,samella,robbyn,renda,reita,phebe,paulita,nobuko,nguyet,neomi,mikaela,melania,maximina,marg,maisie,lynna,lilli,lashaun,lakenya,lael,kirstie,kathline,kasha,karlyn,karima,jovan,josefine,jennell,jacqui,jackelyn,hien,grazyna,florrie,floria,eleonora,dwana,dorla,delmy,deja,dede,dann,crysta,clelia,claris,chieko,cherlyn,cherelle,charmain,chara,cammy,arnette,ardelle,annika,amiee,amee,allena,yvone,yuki,yoshie,yevette,yael,willetta,voncile,venetta,tula,tonette,timika,temika,telma,teisha,taren,stacee,shawnta,saturnina,ricarda,pasty,onie,nubia,marielle,mariella,marianela,mardell,luanna,loise,lisabeth,lindsy,lilliana,lilliam,lelah,leigha,leanora,kristeen,khalilah,keeley,kandra,junko,joaquina,jerlene,jani,jamika,hsiu,hermila,genevive,evia,eugena,emmaline,elfreda,elene,donette,delcie,deeanna,darcey,clarinda,cira,chae,celinda,catheryn,casimira,carmelia,camellia,breana,bobette,bernardina,bebe,basilia,arlyne,amal,alayna,zonia,zenia,yuriko,yaeko,wynell,willena,vernia,tora,terrilyn,terica,tenesha,tawna,tajuana,taina,stephnie,sona,sina,shondra,shizuko,sherlene,sherice,sharika,rossie,rosena,rima,rheba,renna,natalya,nancee,melodi,meda,matha,marketta,maricruz,marcelene,malvina,luba,louetta,leida,lecia,lauran,lashawna,laine,khadijah,katerine,kasi,kallie,julietta,jesusita,jestine,jessia,jeffie,janyce,isadora,georgianne,fidelia,evita,eura,eulah,estefana,elsy,eladia,dodie,denisse,deloras,delila,daysi,crystle,concha,claretta,charlsie,charlena,carylon,bettyann,asley,ashlea,amira,agueda,agnus,yuette,vinita,victorina,tynisha,treena,toccara,tish,thomasena,tegan,soila,shenna,sharmaine,shantae,shandi,saran,sarai,sana,rosette,rolande,regine,otelia,olevia,nicholle,necole,naida,myrta,myesha,mitsue,minta,mertie,margy,mahalia,madalene,loura,lorean,lesha,leonida,lenita,lavone,lashell,lashandra,lamonica,kimbra,katherina,karry,kanesha,jong,jeneva,jaquelyn,gilma,ghislaine,gertrudis,fransisca,fermina,ettie,etsuko,ellan,elidia,edra,dorethea,doreatha,denyse,deetta,daine,cyrstal,corrin,cayla,carlita,camila,burma,bula,buena,barabara,avril,alaine,zana,wilhemina,wanetta,verline,vasiliki,tonita,tisa,teofila,tayna,taunya,tandra,takako,sunni,suanne,sixta,sharell,seema,rosenda,robena,raymonde,pamila,ozell,neida,mistie,micha,merissa,maurita,maryln,maryetta,marcell,malena,makeda,lovetta,lourie,lorrine,lorilee,laurena,lashay,larraine,laree,lacresha,kristle,keva,keira,karole,joie,jinny,jeannetta,jama,heidy,gilberte,gema,faviola,evelynn,enda,elli,ellena,divina,dagny,collene,codi,cindie,chassidy,chasidy,catrice,catherina,cassey,caroll,carlena,candra,calista,bryanna,britteny,beula,bari,audrie,audria,ardelia,annelle,angila,alona,allyn".split(","),surnames:"smith,johnson,williams,jones,brown,davis,miller,wilson,moore,taylor,anderson,jackson,white,harris,martin,thompson,garcia,martinez,robinson,clark,rodriguez,lewis,lee,walker,hall,allen,young,hernandez,king,wright,lopez,hill,green,adams,baker,gonzalez,nelson,carter,mitchell,perez,roberts,turner,phillips,campbell,parker,evans,edwards,collins,stewart,sanchez,morris,rogers,reed,cook,morgan,bell,murphy,bailey,rivera,cooper,richardson,cox,howard,ward,torres,peterson,gray,ramirez,watson,brooks,sanders,price,bennett,wood,barnes,ross,henderson,coleman,jenkins,perry,powell,long,patterson,hughes,flores,washington,butler,simmons,foster,gonzales,bryant,alexander,griffin,diaz,hayes,myers,ford,hamilton,graham,sullivan,wallace,woods,cole,west,owens,reynolds,fisher,ellis,harrison,gibson,mcdonald,cruz,marshall,ortiz,gomez,murray,freeman,wells,webb,simpson,stevens,tucker,porter,hicks,crawford,boyd,mason,morales,kennedy,warren,dixon,ramos,reyes,burns,gordon,shaw,holmes,rice,robertson,hunt,black,daniels,palmer,mills,nichols,grant,knight,ferguson,stone,hawkins,dunn,perkins,hudson,spencer,gardner,stephens,payne,pierce,berry,matthews,arnold,wagner,willis,watkins,olson,carroll,duncan,snyder,hart,cunningham,lane,andrews,ruiz,harper,fox,riley,armstrong,carpenter,weaver,greene,elliott,chavez,sims,peters,kelley,franklin,lawson,fields,gutierrez,schmidt,carr,vasquez,castillo,wheeler,chapman,montgomery,richards,williamson,johnston,banks,meyer,bishop,mccoy,howell,alvarez,morrison,hansen,fernandez,garza,harvey,burton,nguyen,jacobs,reid,fuller,lynch,garrett,romero,welch,larson,frazier,burke,hanson,mendoza,moreno,bowman,medina,fowler,brewer,hoffman,carlson,silva,pearson,holland,fleming,jensen,vargas,byrd,davidson,hopkins,herrera,wade,soto,walters,neal,caldwell,lowe,jennings,barnett,graves,jimenez,horton,shelton,barrett,obrien,castro,sutton,mckinney,lucas,miles,rodriquez,chambers,holt,lambert,fletcher,watts,bates,hale,rhodes,pena,beck,newman,haynes,mcdaniel,mendez,bush,vaughn,parks,dawson,santiago,norris,hardy,steele,curry,powers,schultz,barker,guzman,page,munoz,ball,keller,chandler,weber,walsh,lyons,ramsey,wolfe,schneider,mullins,benson,sharp,bowen,barber,cummings,hines,baldwin,griffith,valdez,hubbard,salazar,reeves,warner,stevenson,burgess,santos,tate,cross,garner,mann,mack,moss,thornton,mcgee,farmer,delgado,aguilar,vega,glover,manning,cohen,harmon,rodgers,robbins,newton,blair,higgins,ingram,reese,cannon,strickland,townsend,potter,goodwin,walton,rowe,hampton,ortega,patton,swanson,goodman,maldonado,yates,becker,erickson,hodges,rios,conner,adkins,webster,malone,hammond,flowers,cobb,moody,quinn,pope,osborne,mccarthy,guerrero,estrada,sandoval,gibbs,gross,fitzgerald,stokes,doyle,saunders,wise,colon,gill,alvarado,greer,padilla,waters,nunez,ballard,schwartz,mcbride,houston,christensen,klein,pratt,briggs,parsons,mclaughlin,zimmerman,buchanan,moran,copeland,pittman,brady,mccormick,holloway,brock,poole,logan,bass,marsh,drake,wong,jefferson,morton,abbott,sparks,norton,huff,massey,figueroa,carson,bowers,roberson,barton,tran,lamb,harrington,boone,cortez,clarke,mathis,singleton,wilkins,cain,underwood,hogan,mckenzie,collier,luna,phelps,mcguire,bridges,wilkerson,nash,summers,atkins,wilcox,pitts,conley,marquez,burnett,cochran,chase,davenport,hood,gates,ayala,sawyer,vazquez,dickerson,hodge,acosta,flynn,espinoza,nicholson,monroe,wolf,morrow,whitaker,oconnor,skinner,ware,molina,kirby,huffman,gilmore,dominguez,oneal,lang,combs,kramer,hancock,gallagher,gaines,shaffer,wiggins,mathews,mcclain,fischer,wall,melton,hensley,bond,dyer,grimes,contreras,wyatt,baxter,snow,mosley,shepherd,larsen,hoover,beasley,petersen,whitehead,meyers,garrison,shields,horn,savage,olsen,schroeder,hartman,woodard,mueller,kemp,deleon,booth,patel,calhoun,wiley,eaton,cline,navarro,harrell,humphrey,parrish,duran,hutchinson,hess,dorsey,bullock,robles,beard,dalton,avila,rich,blackwell,johns,blankenship,trevino,salinas,campos,pruitt,callahan,montoya,hardin,guerra,mcdowell,stafford,gallegos,henson,wilkinson,booker,merritt,atkinson,orr,decker,hobbs,tanner,knox,pacheco,stephenson,glass,rojas,serrano,marks,hickman,sweeney,strong,mcclure,conway,roth,maynard,farrell,lowery,hurst,nixon,weiss,trujillo,ellison,sloan,juarez,winters,mclean,boyer,villarreal,mccall,gentry,carrillo,ayers,lara,sexton,pace,hull,leblanc,browning,velasquez,leach,chang,sellers,herring,noble,foley,bartlett,mercado,landry,durham,walls,barr,mckee,bauer,rivers,bradshaw,pugh,velez,rush,estes,dodson,morse,sheppard,weeks,camacho,bean,barron,livingston,middleton,spears,branch,blevins,chen,kerr,mcconnell,hatfield,harding,solis,frost,giles,blackburn,pennington,woodward,finley,mcintosh,koch,mccullough,blanchard,rivas,brennan,mejia,kane,benton,buckley,valentine,maddox,russo,mcknight,buck,moon,mcmillan,crosby,berg,dotson,mays,roach,chan,richmond,meadows,faulkner,oneill,knapp,kline,ochoa,jacobson,gay,hendricks,horne,shepard,hebert,cardenas,mcintyre,waller,holman,donaldson,cantu,morin,gillespie,fuentes,tillman,bentley,peck,key,salas,rollins,gamble,dickson,santana,cabrera,cervantes,howe,hinton,hurley,spence,zamora,yang,mcneil,suarez,petty,gould,mcfarland,sampson,carver,bray,macdonald,stout,hester,melendez,dillon,farley,hopper,galloway,potts,joyner,stein,aguirre,osborn,mercer,bender,franco,rowland,sykes,pickett,sears,mayo,dunlap,hayden,wilder,mckay,coffey,mccarty,ewing,cooley,vaughan,bonner,cotton,holder,stark,ferrell,cantrell,fulton,lott,calderon,pollard,hooper,burch,mullen,fry,riddle,levy,duke,odonnell,britt,daugherty,berger,dillard,alston,frye,riggs,chaney,odom,duffy,fitzpatrick,valenzuela,mayer,alford,mcpherson,acevedo,barrera,cote,reilly,compton,mooney,mcgowan,craft,clemons,wynn,nielsen,baird,stanton,snider,rosales,bright,witt,hays,holden,rutledge,kinney,clements,castaneda,slater,hahn,burks,delaney,pate,lancaster,sharpe,whitfield,talley,macias,burris,ratliff,mccray,madden,kaufman,beach,goff,cash,bolton,mcfadden,levine,byers,kirkland,kidd,workman,carney,mcleod,holcomb,finch,sosa,haney,franks,sargent,nieves,downs,rasmussen,bird,hewitt,foreman,valencia,oneil,delacruz,vinson,dejesus,hyde,forbes,gilliam,guthrie,wooten,huber,barlow,boyle,mcmahon,buckner,rocha,puckett,langley,knowles,cooke,velazquez,whitley,vang,shea,rouse,hartley,mayfield,elder,rankin,hanna,cowan,lucero,arroyo,slaughter,haas,oconnell,minor,boucher,archer,boggs,dougherty,andersen,newell,crowe,wang,friedman,bland,swain,holley,pearce,childs,yarbrough,galvan,proctor,meeks,lozano,mora,rangel,bacon,villanueva,schaefer,rosado,helms,boyce,goss,stinson,ibarra,hutchins,covington,crowley,hatcher,mackey,bunch,womack,polk,dodd,childress,childers,villa,springer,mahoney,dailey,belcher,lockhart,griggs,costa,brandt,walden,moser,tatum,mccann,akers,lutz,pryor,orozco,mcallister,lugo,davies,shoemaker,rutherford,newsome,magee,chamberlain,blanton,simms,godfrey,flanagan,crum,cordova,escobar,downing,sinclair,donahue,krueger,mcginnis,gore,farris,webber,corbett,andrade,starr,lyon,yoder,hastings,mcgrath,spivey,krause,harden,crabtree,kirkpatrick,arrington,ritter,mcghee,bolden,maloney,gagnon,dunbar,ponce,pike,mayes,beatty,mobley,kimball,butts,montes,eldridge,braun,hamm,gibbons,moyer,manley,herron,plummer,elmore,cramer,rucker,pierson,fontenot,rubio,goldstein,elkins,wills,novak,hickey,worley,gorman,katz,dickinson,broussard,woodruff,crow,britton,nance,lehman,bingham,zuniga,whaley,shafer,coffman,steward,delarosa,neely,mata,davila,mccabe,kessler,hinkle,welsh,pagan,goldberg,goins,crouch,cuevas,quinones,mcdermott,hendrickson,samuels,denton,bergeron,ivey,locke,haines,snell,hoskins,byrne,arias,corbin,beltran,chappell,downey,dooley,tuttle,couch,payton,mcelroy,crockett,groves,cartwright,dickey,mcgill,dubois,muniz,tolbert,dempsey,cisneros,sewell,latham,vigil,tapia,rainey,norwood,stroud,meade,tipton,kuhn,hilliard,bonilla,teague,gunn,greenwood,correa,reece,pineda,phipps,frey,kaiser,ames,gunter,schmitt,milligan,espinosa,bowden,vickers,lowry,pritchard,costello,piper,mcclellan,lovell,sheehan,hatch,dobson,singh,jeffries,hollingsworth,sorensen,meza,fink,donnelly,burrell,tomlinson,colbert,billings,ritchie,helton,sutherland,peoples,mcqueen,thomason,givens,crocker,vogel,robison,dunham,coker,swartz,keys,ladner,richter,hargrove,edmonds,brantley,albright,murdock,boswell,muller,quintero,padgett,kenney,daly,connolly,inman,quintana,lund,barnard,villegas,simons,huggins,tidwell,sanderson,bullard,mcclendon,duarte,draper,marrero,dwyer,abrams,stover,goode,fraser,crews,bernal,godwin,conklin,mcneal,baca,esparza,crowder,bower,brewster,mcneill,rodrigues,leal,coates,raines,mccain,mccord,miner,holbrook,swift,dukes,carlisle,aldridge,ackerman,starks,ricks,holliday,ferris,hairston,sheffield,lange,fountain,doss,betts,kaplan,carmichael,bloom,ruffin,penn,kern,bowles,sizemore,larkin,dupree,seals,metcalf,hutchison,henley,farr,mccauley,hankins,gustafson,curran,waddell,ramey,cates,pollock,cummins,messer,heller,funk,cornett,palacios,galindo,cano,hathaway,pham,enriquez,salgado,pelletier,painter,wiseman,blount,feliciano,houser,doherty,mead,mcgraw,swan,capps,blanco,blackmon,thomson,mcmanus,burkett,gleason,dickens,cormier,voss,rushing,rosenberg,hurd,dumas,benitez,arellano,marin,caudill,bragg,jaramillo,huerta,gipson,colvin,biggs,vela,platt,cassidy,tompkins,mccollum,dolan,daley,crump,sneed,kilgore,grove,grimm,davison,brunson,prater,marcum,devine,dodge,stratton,rosas,choi,tripp,ledbetter,hightower,feldman,epps,yeager,posey,scruggs,cope,stubbs,richey,overton,trotter,sprague,cordero,butcher,stiles,burgos,woodson,horner,bassett,purcell,haskins,akins,ziegler,spaulding,hadley,grubbs,sumner,murillo,zavala,shook,lockwood,driscoll,dahl,thorpe,redmond,putnam,mcwilliams,mcrae,romano,joiner,sadler,hedrick,hager,hagen,fitch,coulter,thacker,mansfield,langston,guidry,ferreira,corley,conn,rossi,lackey,baez,saenz,mcnamara,mcmullen,mckenna,mcdonough,link,engel,browne,roper,peacock,eubanks,drummond,stringer,pritchett,parham,mims,landers,grayson,schafer,egan,timmons,ohara,keen,hamlin,finn,cortes,mcnair,nadeau,moseley,michaud,rosen,oakes,kurtz,jeffers,calloway,beal,bautista,winn,suggs,stern,stapleton,lyles,laird,montano,dawkins,hagan,goldman,bryson,barajas,lovett,segura,metz,lockett,langford,hinson,eastman,hooks,smallwood,shapiro,crowell,whalen,triplett,chatman,aldrich,cahill,youngblood,ybarra,stallings,sheets,reeder,connelly,bateman,abernathy,winkler,wilkes,masters,hackett,granger,gillis,schmitz,sapp,napier,souza,lanier,gomes,weir,otero,ledford,burroughs,babcock,ventura,siegel,dugan,bledsoe,atwood,wray,varner,spangler,anaya,staley,kraft,fournier,belanger,wolff,thorne,bynum,burnette,boykin,swenson,purvis,pina,khan,duvall,darby,xiong,kauffman,healy,engle,benoit,valle,steiner,spicer,shaver,randle,lundy,chin,calvert,staton,neff,kearney,darden,oakley,medeiros,mccracken,crenshaw,perdue,dill,whittaker,tobin,washburn,hogue,goodrich,easley,bravo,dennison,shipley,kerns,jorgensen,crain,villalobos,maurer,longoria,keene,coon,witherspoon,staples,pettit,kincaid,eason,madrid,echols,lusk,stahl,currie,thayer,shultz,mcnally,seay,maher,gagne,barrow,nava,moreland,honeycutt,hearn,diggs,caron,whitten,westbrook,stovall,ragland,munson,meier,looney,kimble,jolly,hobson,goddard,culver,burr,presley,negron,connell,tovar,huddleston,ashby,salter,root,pendleton,oleary,nickerson,myrick,judd,jacobsen,bain,adair,starnes,matos,busby,herndon,hanley,bellamy,doty,bartley,yazzie,rowell,parson,gifford,cullen,christiansen,benavides,barnhart,talbot,mock,crandall,connors,bonds,whitt,gage,bergman,arredondo,addison,lujan,dowdy,jernigan,huynh,bouchard,dutton,rhoades,ouellette,kiser,herrington,hare,blackman,babb,allred,rudd,paulson,ogden,koenig,geiger,begay,parra,lassiter,hawk,esposito,waldron,ransom,prather,chacon,vick,sands,roark,parr,mayberry,greenberg,coley,bruner,whitman,skaggs,shipman,leary,hutton,romo,medrano,ladd,kruse,askew,schulz,alfaro,tabor,mohr,gallo,bermudez,pereira,bliss,reaves,flint,comer,woodall,naquin,guevara,delong,carrier,pickens,tilley,schaffer,knutson,fenton,doran,vogt,vann,prescott,mclain,landis,corcoran,zapata,hyatt,hemphill,faulk,dove,boudreaux,aragon,whitlock,trejo,tackett,shearer,saldana,hanks,mckinnon,koehler,bourgeois,keyes,goodson,foote,lunsford,goldsmith,flood,winslow,sams,reagan,mccloud,hough,esquivel,naylor,loomis,coronado,ludwig,braswell,bearden,huang,fagan,ezell,edmondson,cronin,nunn,lemon,guillory,grier,dubose,traylor,ryder,dobbins,coyle,aponte,whitmore,smalls,rowan,malloy,cardona,braxton,borden,humphries,carrasco,ruff,metzger,huntley,hinojosa,finney,madsen,ernst,dozier,burkhart,bowser,peralta,daigle,whittington,sorenson,saucedo,roche,redding,fugate,avalos,waite,lind,huston,hawthorne,hamby,boyles,boles,regan,faust,crook,beam,barger,hinds,gallardo,willoughby,willingham,eckert,busch,zepeda,worthington,tinsley,hoff,hawley,carmona,varela,rector,newcomb,kinsey,dube,whatley,ragsdale,bernstein,becerra,yost,mattson,felder,cheek,handy,grossman,gauthier,escobedo,braden,beckman,mott,hillman,flaherty,dykes,stockton,stearns,lofton,coats,cavazos,beavers,barrios,tang,mosher,cardwell,coles,burnham,weller,lemons,beebe,aguilera,parnell,harman,couture,alley,schumacher,redd,dobbs,blum,blalock,merchant,ennis,denson,cottrell,brannon,bagley,aviles,watt,sousa,rosenthal,rooney,dietz,blank,paquette,mcclelland,duff,velasco,lentz,grubb,burrows,barbour,ulrich,shockley,rader,beyer,mixon,layton,altman,weathers,stoner,squires,shipp,priest,lipscomb,cutler,caballero,zimmer,willett,thurston,storey,medley,epperson,shah,mcmillian,baggett,torrez,hirsch,dent,poirier,peachey,farrar,creech,barth,trimble,dupre,albrecht,sample,lawler,crisp,conroy,wetzel,nesbitt,murry,jameson,wilhelm,patten,minton,matson,kimbrough,guinn,croft,toth,pulliam,nugent,newby,littlejohn,dias,canales,bernier,baron,singletary,renteria,pruett,mchugh,mabry,landrum,brower,stoddard,cagle,stjohn,scales,kohler,kellogg,hopson,gant,tharp,gann,zeigler,pringle,hammons,fairchild,deaton,chavis,carnes,rowley,matlock,kearns,irizarry,carrington,starkey,lopes,jarrell,craven,baum,littlefield,linn,humphreys,etheridge,cuellar,chastain,bundy,speer,skelton,quiroz,pyle,portillo,ponder,moulton,machado,killian,hutson,hitchcock,dowling,cloud,burdick,spann,pedersen,levin,leggett,hayward,dietrich,beaulieu,barksdale,wakefield,snowden,briscoe,bowie,berman,ogle,mcgregor,laughlin,helm,burden,wheatley,schreiber,pressley,parris,alaniz,agee,swann,snodgrass,schuster,radford,monk,mattingly,harp,girard,cheney,yancey,wagoner,ridley,lombardo,hudgins,gaskins,duckworth,coburn,willey,prado,newberry,magana,hammonds,elam,whipple,slade,serna,ojeda,liles,dorman,diehl,upton,reardon,michaels,goetz,eller,bauman,baer,layne,hummel,brenner,amaya,adamson,ornelas,dowell,cloutier,castellanos,wellman,saylor,orourke,moya,montalvo,kilpatrick,durbin,shell,oldham,kang,garvin,foss,branham,bartholomew,templeton,maguire,holton,rider,monahan,mccormack,beaty,anders,streeter,nieto,nielson,moffett,lankford,keating,heck,gatlin,delatorre,callaway,adcock,worrell,unger,robinette,nowak,jeter,brunner,steen,parrott,overstreet,nobles,montanez,clevenger,brinkley,trahan,quarles,pickering,pederson,jansen,grantham,gilchrist,crespo,aiken,schell,schaeffer,lorenz,leyva,harms,dyson,wallis,pease,leavitt,cheng,cavanaugh,batts,warden,seaman,rockwell,quezada,paxton,linder,houck,fontaine,durant,caruso,adler,pimentel,mize,lytle,cleary,cason,acker,switzer,isaacs,higginbotham,waterman,vandyke,stamper,sisk,shuler,riddick,mcmahan,levesque,hatton,bronson,bollinger,arnett,okeefe,gerber,gannon,farnsworth,baughman,silverman,satterfield,mccrary,kowalski,grigsby,greco,cabral,trout,rinehart,mahon,linton,gooden,curley,baugh,wyman,weiner,schwab,schuler,morrissey,mahan,bunn,thrasher,spear,waggoner,qualls,purdy,mcwhorter,mauldin,gilman,perryman,newsom,menard,martino,graf,billingsley,artis,simpkins,salisbury,quintanilla,gilliland,fraley,foust,crouse,scarborough,grissom,fultz,marlow,markham,madrigal,lawton,barfield,whiting,varney,schwarz,gooch,arce,wheat,truong,poulin,hurtado,selby,gaither,fortner,culpepper,coughlin,brinson,boudreau,bales,stepp,holm,schilling,morrell,kahn,heaton,gamez,causey,turpin,shanks,schrader,meek,isom,hardison,carranza,yanez,scroggins,schofield,runyon,ratcliff,murrell,moeller,irby,currier,butterfield,ralston,pullen,pinson,estep,carbone,hawks,ellington,casillas,spurlock,sikes,motley,mccartney,kruger,isbell,houle,burk,tomlin,quigley,neumann,lovelace,fennell,cheatham,bustamante,skidmore,hidalgo,forman,culp,bowens,betancourt,aquino,robb,milner,martel,gresham,wiles,ricketts,dowd,collazo,bostic,blakely,sherrod,kenyon,gandy,ebert,deloach,allard,sauer,robins,olivares,gillette,chestnut,bourque,paine,hite,hauser,devore,crawley,chapa,talbert,poindexter,meador,mcduffie,mattox,kraus,harkins,choate,wren,sledge,sanborn,kinder,geary,cornwell,barclay,abney,seward,rhoads,howland,fortier,benner,vines,tubbs,troutman,rapp,mccurdy,deluca,westmoreland,havens,guajardo,clary,seal,meehan,herzog,guillen,ashcraft,waugh,renner,milam,elrod,churchill,breaux,bolin,asher,windham,tirado,pemberton,nolen,noland,knott,emmons,cornish,christenson,brownlee,barbee,waldrop,pitt,olvera,lombardi,gruber,gaffney,eggleston,banda,archuleta,slone,prewitt,pfeiffer,nettles,mena,mcadams,henning,gardiner,cromwell,chisholm,burleson,vest,oglesby,mccarter,lumpkin,wofford,vanhorn,thorn,teel,swafford,stclair,stanfield,ocampo,herrmann,hannon,arsenault,roush,mcalister,hiatt,gunderson,forsythe,duggan,delvalle,cintron,wilks,weinstein,uribe,rizzo,noyes,mclendon,gurley,bethea,winstead,maples,guyton,giordano,alderman,valdes,polanco,pappas,lively,grogan,griffiths,bobo,arevalo,whitson,sowell,rendon,fernandes,farrow,benavidez,ayres,alicea,stump,smalley,seitz,schulte,gilley,gallant,canfield,wolford,omalley,mcnutt,mcnulty,mcgovern,hardman,harbin,cowart,chavarria,brink,beckett,bagwell,armstead,anglin,abreu,reynoso,krebs,jett,hoffmann,greenfield,forte,burney,broome,sisson,trammell,partridge,mace,lomax,lemieux,gossett,frantz,fogle,cooney,broughton,pence,paulsen,muncy,mcarthur,hollins,beauchamp,withers,osorio,mulligan,hoyle,dockery,cockrell,begley,amador,roby,rains,lindquist,gentile,everhart,bohannon,wylie,sommers,purnell,fortin,dunning,breeden,vail,phelan,phan,marx,cosby,colburn,boling,biddle,ledesma,gaddis,denney,chow,bueno,berrios,wicker,tolliver,thibodeaux,nagle,lavoie,fisk,crist,barbosa,reedy,locklear,kolb,himes,behrens,beckwith,weems,wahl,shorter,shackelford,rees,muse,cerda,valadez,thibodeau,saavedra,ridgeway,reiter,mchenry,majors,lachance,keaton,ferrara,clemens,blocker,applegate,needham,mojica,kuykendall,hamel,escamilla,doughty,burchett,ainsworth,vidal,upchurch,thigpen,strauss,spruill,sowers,riggins,ricker,mccombs,harlow,buffington,sotelo,olivas,negrete,morey,macon,logsdon,lapointe,bigelow,bello,westfall,stubblefield,lindley,hein,hawes,farrington,breen,birch,wilde,steed,sepulveda,reinhardt,proffitt,minter,messina,mcnabb,maier,keeler,gamboa,donohue,basham,shinn,crooks,cota,borders,bills,bachman,tisdale,tavares,schmid,pickard,gulley,fonseca,delossantos,condon,batista,wicks,wadsworth,martell,littleton,ison,haag,folsom,brumfield,broyles,brito,mireles,mcdonnell,leclair,hamblin,gough,fanning,binder,winfield,whitworth,soriano,palumbo,newkirk,mangum,hutcherson,comstock,carlin,beall,bair,wendt,watters,walling,putman,otoole,morley,mares,lemus,keener,hundley,dial,damico,billups,strother,mcfarlane,lamm,eaves,crutcher,caraballo,canty,atwell,taft,siler,rust,rawls,rawlings,prieto,mcneely,mcafee,hulsey,hackney,galvez,escalante,delagarza,crider,bandy,wilbanks,stowe,steinberg,renfro,masterson,massie,lanham,haskell,hamrick,dehart,burdette,branson,bourne,babin,aleman,worthy,tibbs,smoot,slack,paradis,mull,luce,houghton,gantt,furman,danner,christianson,burge,ashford,arndt,almeida,stallworth,shade,searcy,sager,noonan,mclemore,mcintire,maxey,lavigne,jobe,ferrer,falk,coffin,byrnes,aranda,apodaca,stamps,rounds,peek,olmstead,lewandowski,kaminski,dunaway,bruns,brackett,amato,reich,mcclung,lacroix,koontz,herrick,hardesty,flanders,cousins,cato,cade,vickery,shank,nagel,dupuis,croteau,cotter,stuckey,stine,porterfield,pauley,moffitt,knudsen,hardwick,goforth,dupont,blunt,barrows,barnhill,shull,rash,loftis,lemay,kitchens,horvath,grenier,fuchs,fairbanks,culbertson,calkins,burnside,beattie,ashworth,albertson,wertz,vaught,vallejo,turk,tuck,tijerina,sage,peterman,marroquin,marr,lantz,hoang,demarco,cone,berube,barnette,wharton,stinnett,slocum,scanlon,sander,pinto,mancuso,lima,headley,epstein,counts,clarkson,carnahan,boren,arteaga,adame,zook,whittle,whitehurst,wenzel,saxton,reddick,puente,handley,haggerty,earley,devlin,chaffin,cady,acuna,solano,sigler,pollack,pendergrass,ostrander,janes,francois,crutchfield,chamberlin,brubaker,baptiste,willson,reis,neeley,mullin,mercier,lira,layman,keeling,higdon,espinal,chapin,warfield,toledo,pulido,peebles,nagy,montague,mello,lear,jaeger,hogg,graff,furr,soliz,poore,mendenhall,mclaurin,maestas,gable,barraza,tillery,snead,pond,neill,mcculloch,mccorkle,lightfoot,hutchings,holloman,harness,dorn,bock,zielinski,turley,treadwell,stpierre,starling,somers,oswald,merrick,easterling,bivens,truitt,poston,parry,ontiveros,olivarez,moreau,medlin,lenz,knowlton,fairley,cobbs,chisolm,bannister,woodworth,toler,ocasio,noriega,neuman,moye,milburn,mcclanahan,lilley,hanes,flannery,dellinger,danielson,conti,blodgett,beers,weatherford,strain,karr,hitt,denham,custer,coble,clough,casteel,bolduc,batchelor,ammons,whitlow,tierney,staten,sibley,seifert,schubert,salcedo,mattison,laney,haggard,grooms,dees,cromer,cooks,colson,caswell,zarate,swisher,shin,ragan,pridgen,mcvey,matheny,lafleur,franz,ferraro,dugger,whiteside,rigsby,mcmurray,lehmann,jacoby,hildebrand,hendrick,headrick,goad,fincher,drury,borges,archibald,albers,woodcock,trapp,soares,seaton,monson,luckett,lindberg,kopp,keeton,healey,garvey,gaddy,fain,burchfield,wentworth,strand,stack,spooner,saucier,ricci,plunkett,pannell,ness,leger,freitas,fong,elizondo,duval,beaudoin,urbina,rickard,partin,mcgrew,mcclintock,ledoux,forsyth,faison,devries,bertrand,wasson,tilton,scarbrough,leung,irvine,garber,denning,corral,colley,castleberry,bowlin,bogan,beale,baines,trice,rayburn,parkinson,nunes,mcmillen,leahy,kimmel,higgs,fulmer,carden,bedford,taggart,spearman,prichard,morrill,koonce,heinz,hedges,guenther,grice,findley,dover,creighton,boothe,bayer,arreola,vitale,valles,raney,osgood,hanlon,burley,bounds,worden,weatherly,vetter,tanaka,stiltner,nevarez,mosby,montero,melancon,harter,hamer,goble,gladden,gist,ginn,akin,zaragoza,tarver,sammons,royster,oreilly,muir,morehead,luster,kingsley,kelso,grisham,glynn,baumann,alves,yount,tamayo,paterson,oates,menendez,longo,hargis,gillen,desantis,conover,breedlove,sumpter,scherer,rupp,reichert,heredia,creel,cohn,clemmons,casas,bickford,belton,bach,williford,whitcomb,tennant,sutter,stull,mccallum,langlois,keel,keegan,dangelo,dancy,damron,clapp,clanton,bankston,oliveira,mintz,mcinnis,martens,mabe,laster,jolley,hildreth,hefner,glaser,duckett,demers,brockman,blais,alcorn,agnew,toliver,tice,seeley,najera,musser,mcfall,laplante,galvin,fajardo,doan,coyne,copley,clawson,cheung,barone,wynne,woodley,tremblay,stoll,sparrow,sparkman,schweitzer,sasser,samples,roney,legg,heim,farias,colwell,christman,bratcher,winchester,upshaw,southerland,sorrell,sells,mccloskey,martindale,luttrell,loveless,lovejoy,linares,latimer,embry,coombs,bratton,bostick,venable,tuggle,toro,staggs,sandlin,jefferies,heckman,griffis,crayton,clem,browder,thorton,sturgill,sprouse,royer,rousseau,ridenour,pogue,perales,peeples,metzler,mesa,mccutcheon,mcbee,hornsby,heffner,corrigan,armijo,plante,peyton,paredes,macklin,hussey,hodgson,granados,frias,becnel,batten,almanza,turney,teal,sturgeon,meeker,mcdaniels,limon,keeney,hutto,holguin,gorham,fishman,fierro,blanchette,rodrigue,reddy,osburn,oden,lerma,kirkwood,keefer,haugen,hammett,chalmers,brinkman,baumgartner,zhang,valerio,tellez,steffen,shumate,sauls,ripley,kemper,guffey,evers,craddock,carvalho,blaylock,banuelos,balderas,wheaton,turnbull,shuman,pointer,mosier,mccue,ligon,kozlowski,johansen,ingle,herr,briones,snipes,rickman,pipkin,pantoja,orosco,moniz,lawless,kunkel,hibbard,galarza,enos,bussey,schott,salcido,perreault,mcdougal,mccool,haight,garris,easton,conyers,atherton,wimberly,utley,spellman,smithson,slagle,ritchey,rand,petit,osullivan,oaks,nutt,mcvay,mccreary,mayhew,knoll,jewett,harwood,cardoza,ashe,arriaga,zeller,wirth,whitmire,stauffer,rountree,redden,mccaffrey,martz,larose,langdon,humes,gaskin,faber,devito,cass,almond,wingfield,wingate,villareal,tyner,smothers,severson,reno,pennell,maupin,leighton,janssen,hassell,hallman,halcomb,folse,fitzsimmons,fahey,cranford,bolen,battles,battaglia,wooldridge,trask,rosser,regalado,mcewen,keefe,fuqua,echevarria,caro,boynton,andrus,viera,vanmeter,taber,spradlin,seibert,provost,prentice,oliphant,laporte,hwang,hatchett,hass,greiner,freedman,covert,chilton,byars,wiese,venegas,swank,shrader,roberge,mullis,mortensen,mccune,marlowe,kirchner,keck,isaacson,hostetler,halverson,gunther,griswold,fenner,durden,blackwood,ahrens,sawyers,savoy,nabors,mcswain,mackay,lavender,lash,labbe,jessup,fullerton,cruse,crittenden,correia,centeno,caudle,canady,callender,alarcon,ahern,winfrey,tribble,salley,roden,musgrove,minnick,fortenberry,carrion,bunting,batiste,whited,underhill,stillwell,rauch,pippin,perrin,messenger,mancini,lister,kinard,hartmann,fleck,wilt,treadway,thornhill,spalding,rafferty,pitre,patino,ordonez,linkous,kelleher,homan,galbraith,feeney,curtin,coward,camarillo,buss,bunnell,bolt,beeler,autry,alcala,witte,wentz,stidham,shively,nunley,meacham,martins,lemke,lefebvre,hynes,horowitz,hoppe,holcombe,dunne,derr,cochrane,brittain,bedard,beauregard,torrence,strunk,soria,simonson,shumaker,scoggins,oconner,moriarty,kuntz,ives,hutcheson,horan,hales,garmon,fitts,bohn,atchison,wisniewski,vanwinkle,sturm,sallee,prosser,moen,lundberg,kunz,kohl,keane,jorgenson,jaynes,funderburk,freed,durr,creamer,cosgrove,batson,vanhoose,thomsen,teeter,smyth,redmon,orellana,maness,heflin,goulet,frick,forney,bunker,asbury,aguiar,talbott,southard,mowery,mears,lemmon,krieger,hickson,elston,duong,delgadillo,dayton,dasilva,conaway,catron,bruton,bradbury,bordelon,bivins,bittner,bergstrom,beals,abell,whelan,tejada,pulley,pino,norfleet,nealy,maes,loper,gatewood,frierson,freund,finnegan,cupp,covey,catalano,boehm,bader,yoon,walston,tenney,sipes,rawlins,medlock,mccaskill,mccallister,marcotte,maclean,hughey,henke,harwell,gladney,gilson,chism,caskey,brandenburg,baylor,villasenor,veal,thatcher,stegall,petrie,nowlin,navarrete,lombard,loftin,lemaster,kroll,kovach,kimbrell,kidwell,hershberger,fulcher,cantwell,bustos,boland,bobbitt,binkley,wester,weis,verdin,tong,tiller,sisco,sharkey,seymore,rosenbaum,rohr,quinonez,pinkston,malley,logue,lessard,lerner,lebron,krauss,klinger,halstead,haller,getz,burrow,alger,shores,pfeifer,perron,nelms,munn,mcmaster,mckenney,manns,knudson,hutchens,huskey,goebel,flagg,cushman,click,castellano,carder,bumgarner,wampler,spinks,robson,neel,mcreynolds,mathias,maas,loera,jenson,florez,coons,buckingham,brogan,berryman,wilmoth,wilhite,thrash,shephard,seidel,schulze,roldan,pettis,obryan,maki,mackie,hatley,frazer,fiore,chesser,bottoms,bisson,benefield,allman,wilke,trudeau,timm,shifflett,mundy,milliken,mayers,leake,kohn,huntington,horsley,hermann,guerin,fryer,frizzell,foret,flemming,fife,criswell,carbajal,bozeman,boisvert,angulo,wallen,tapp,silvers,ramsay,oshea,orta,moll,mckeever,mcgehee,linville,kiefer,ketchum,howerton,groce,gass,fusco,corbitt,betz,bartels,amaral,aiello,weddle,sperry,seiler,runyan,raley,overby,osteen,olds,mckeown,matney,lauer,lattimore,hindman,hartwell,fredrickson,fredericks,espino,clegg,carswell,cambell,burkholder,woodbury,welker,totten,thornburg,theriault,stitt,stamm,stackhouse,scholl,saxon,rife,razo,quinlan,pinkerton,olivo,nesmith,nall,mattos,lafferty,justus,giron,geer,fielder,drayton,dortch,conners,conger,boatwright,billiot,barden,armenta,tibbetts,steadman,slattery,rinaldi,raynor,pinckney,pettigrew,milne,matteson,halsey,gonsalves,fellows,durand,desimone,cowley,cowles,brill,barham,barela,barba,ashmore,withrow,valenti,tejeda,spriggs,sayre,salerno,peltier,peel,merriman,matheson,lowman,lindstrom,hyland,giroux,earls,dugas,dabney,collado,briseno,baxley,whyte,wenger,vanover,vanburen,thiel,schindler,schiller,rigby,pomeroy,passmore,marble,manzo,mahaffey,lindgren,laflamme,greathouse,fite,calabrese,bayne,yamamoto,wick,townes,thames,reinhart,peeler,naranjo,montez,mcdade,mast,markley,marchand,leeper,kellum,hudgens,hennessey,hadden,gainey,coppola,borrego,bolling,beane,ault,slaton,pape,null,mulkey,lightner,langer,hillard,ethridge,enright,derosa,baskin,weinberg,turman,somerville,pardo,noll,lashley,ingraham,hiller,hendon,glaze,cothran,cooksey,conte,carrico,abner,wooley,swope,summerlin,sturgis,sturdivant,stott,spurgeon,spillman,speight,roussel,popp,nutter,mckeon,mazza,magnuson,lanning,kozak,jankowski,heyward,forster,corwin,callaghan,bays,wortham,usher,theriot,sayers,sabo,poling,loya,lieberman,laroche,labelle,howes,harr,garay,fogarty,everson,durkin,dominquez,chaves,chambliss,witcher,vieira,vandiver,terrill,stoker,schreiner,moorman,liddell,lawhorn,krug,irons,hylton,hollenbeck,herrin,hembree,goolsby,goodin,gilmer,foltz,dinkins,daughtry,caban,brim,briley,bilodeau,wyant,vergara,tallent,swearingen,stroup,scribner,quillen,pitman,mccants,maxfield,martinson,holtz,flournoy,brookins,brody,baumgardner,straub,sills,roybal,roundtree,oswalt,mcgriff,mcdougall,mccleary,maggard,gragg,gooding,godinez,doolittle,donato,cowell,cassell,bracken,appel,zambrano,reuter,perea,nakamura,monaghan,mickens,mcclinton,mcclary,marler,kish,judkins,gilbreath,freese,flanigan,felts,erdmann,dodds,chew,brownell,boatright,barreto,slayton,sandberg,saldivar,pettway,odum,narvaez,moultrie,montemayor,merrell,lees,keyser,hoke,hardaway,hannan,gilbertson,fogg,dumont,deberry,coggins,buxton,bucher,broadnax,beeson,araujo,appleton,amundson,aguayo,ackley,yocum,worsham,shivers,sanches,sacco,robey,rhoden,pender,ochs,mccurry,madera,luong,knotts,jackman,heinrich,hargrave,gault,comeaux,chitwood,caraway,boettcher,bernhardt,barrientos,zink,wickham,whiteman,thorp,stillman,settles,schoonover,roque,riddell,pilcher,phifer,novotny,macleod,hardee,haase,grider,doucette,clausen,bevins,beamon,badillo,tolley,tindall,soule,snook,seale,pinkney,pellegrino,nowell,nemeth,mondragon,mclane,lundgren,ingalls,hudspeth,hixson,gearhart,furlong,downes,dibble,deyoung,cornejo,camara,brookshire,boyette,wolcott,surratt,sellars,segal,salyer,reeve,rausch,labonte,haro,gower,freeland,fawcett,eads,driggers,donley,collett,bromley,boatman,ballinger,baldridge,volz,trombley,stonge,shanahan,rivard,rhyne,pedroza,matias,jamieson,hedgepeth,hartnett,estevez,eskridge,denman,chiu,chinn,catlett,carmack,buie,bechtel,beardsley,bard,ballou,ulmer,skeen,robledo,rincon,reitz,piazza,munger,moten,mcmichael,loftus,ledet,kersey,groff,fowlkes,crumpton,clouse,bettis,villagomez,timmerman,strom,santoro,roddy,penrod,musselman,macpherson,leboeuf,harless,haddad,guido,golding,fulkerson,fannin,dulaney,dowdell,cottle,ceja,cate,bosley,benge,albritton,voigt,trowbridge,soileau,seely,rohde,pearsall,paulk,orth,nason,mota,mcmullin,marquardt,madigan,hoag,gillum,gabbard,fenwick,danforth,cushing,cress,creed,cazares,bettencourt,barringer,baber,stansberry,schramm,rutter,rivero,oquendo,necaise,mouton,montenegro,miley,mcgough,marra,macmillan,lamontagne,jasso,horst,hetrick,heilman,gaytan,gall,fortney,dingle,desjardins,dabbs,burbank,brigham,breland,beaman,arriola,yarborough,wallin,toscano,stowers,reiss,pichardo,orton,michels,mcnamee,mccrory,leatherman,kell,keister,horning,hargett,guay,ferro,deboer,dagostino,carper,blanks,beaudry,towle,tafoya,stricklin,strader,soper,sonnier,sigmon,schenk,saddler,pedigo,mendes,lunn,lohr,lahr,kingsbury,jarman,hume,holliman,hofmann,haworth,harrelson,hambrick,flick,edmunds,dacosta,crossman,colston,chaplin,carrell,budd,weiler,waits,valentino,trantham,tarr,solorio,roebuck,powe,plank,pettus,pagano,mink,luker,leathers,joslin,hartzell,gambrell,cepeda,carty,caputo,brewington,bedell,ballew,applewhite,warnock,walz,urena,tudor,reel,pigg,parton,mickelson,meagher,mclellan,mcculley,mandel,leech,lavallee,kraemer,kling,kipp,kehoe,hochstetler,harriman,gregoire,grabowski,gosselin,gammon,fancher,edens,desai,brannan,armendariz,woolsey,whitehouse,whetstone,ussery,towne,testa,tallman,studer,strait,steinmetz,sorrells,sauceda,rolfe,paddock,mitchem,mcginn,mccrea,lovato,hazen,gilpin,gaynor,fike,devoe,delrio,curiel,burkhardt,bode,backus,zinn,watanabe,wachter,vanpelt,turnage,shaner,schroder,sato,riordan,quimby,portis,natale,mckoy,mccown,kilmer,hotchkiss,hesse,halbert,gwinn,godsey,delisle,chrisman,canter,arbogast,angell,acree,yancy,woolley,wesson,weatherspoon,trainor,stockman,spiller,sipe,rooks,reavis,propst,porras,neilson,mullens,loucks,llewellyn,kumar,koester,klingensmith,kirsch,kester,honaker,hodson,hennessy,helmick,garrity,garibay,drain,casarez,callis,botello,aycock,avant,wingard,wayman,tully,theisen,szymanski,stansbury,segovia,rainwater,preece,pirtle,padron,mincey,mckelvey,mathes,larrabee,kornegay,klug,ingersoll,hecht,germain,eggers,dykstra,deering,decoteau,deason,dearing,cofield,carrigan,bonham,bahr,aucoin,appleby,almonte,yager,womble,wimmer,weimer,vanderpool,stancil,sprinkle,romine,remington,pfaff,peckham,olivera,meraz,maze,lathrop,koehn,hazelton,halvorson,hallock,haddock,ducharme,dehaven,caruthers,brehm,bosworth,bost,bias,beeman,basile,bane,aikens,wold,walther,tabb,suber,strawn,stocker,shirey,schlosser,riedel,rembert,reimer,pyles,peele,merriweather,letourneau,latta,kidder,hixon,hillis,hight,herbst,henriquez,haygood,hamill,gabel,fritts,eubank,dawes,correll,bushey,buchholz,brotherton,botts,barnwell,auger,atchley,westphal,veilleux,ulloa,stutzman,shriver,ryals,pilkington,moyers,marrs,mangrum,maddux,lockard,laing,kuhl,harney,hammock,hamlett,felker,doerr,depriest,carrasquillo,carothers,bogle,bischoff,bergen,albanese,wyckoff,vermillion,vansickle,thibault,tetreault,stickney,shoemake,ruggiero,rawson,racine,philpot,paschal,mcelhaney,mathison,legrand,lapierre,kwan,kremer,jiles,hilbert,geyer,faircloth,ehlers,egbert,desrosiers,dalrymple,cotten,cashman,cadena,boardman,alcaraz,wyrick,therrien,tankersley,strickler,puryear,plourde,pattison,pardue,mcginty,mcevoy,landreth,kuhns,koon,hewett,giddens,emerick,eades,deangelis,cosme,ceballos,birdsong,benham,bemis,armour,anguiano,welborn,tsosie,storms,shoup,sessoms,samaniego,rood,rojo,rhinehart,raby,northcutt,myer,munguia,morehouse,mcdevitt,mallett,lozada,lemoine,kuehn,hallett,grim,gillard,gaylor,garman,gallaher,feaster,faris,darrow,dardar,coney,carreon,braithwaite,boylan,boyett,bixler,bigham,benford,barragan,barnum,zuber,wyche,westcott,vining,stoltzfus,simonds,shupe,sabin,ruble,rittenhouse,richman,perrone,mulholland,millan,lomeli,kite,jemison,hulett,holler,hickerson,herold,hazelwood,griffen,gause,forde,eisenberg,dilworth,charron,chaisson,bristow,breunig,brace,boutwell,bentz,belk,bayless,batchelder,baran,baeza,zimmermann,weathersby,volk,toole,theis,tedesco,searle,schenck,satterwhite,ruelas,rankins,partida,nesbit,morel,menchaca,levasseur,kaylor,johnstone,hulse,hollar,hersey,harrigan,harbison,guyer,gish,giese,gerlach,geller,geisler,falcone,elwell,doucet,deese,darr,corder,chafin,byler,bussell,burdett,brasher,bowe,bellinger,bastian,barner,alleyne,wilborn,weil,wegner,tatro,spitzer,smithers,schoen,resendez,parisi,overman,obrian,mudd,mahler,maggio,lindner,lalonde,lacasse,laboy,killion,kahl,jessen,jamerson,houk,henshaw,gustin,graber,durst,duenas,davey,cundiff,conlon,colunga,coakley,chiles,capers,buell,bricker,bissonnette,bartz,bagby,zayas,volpe,treece,toombs,thom,terrazas,swinney,skiles,silveira,shouse,senn,ramage,moua,langham,kyles,holston,hoagland,herd,feller,denison,carraway,burford,bickel,ambriz,abercrombie,yamada,weidner,waddle,verduzco,thurmond,swindle,schrock,sanabria,rosenberger,probst,peabody,olinger,nazario,mccafferty,mcbroom,mcabee,mazur,matherne,mapes,leverett,killingsworth,heisler,griego,gosnell,frankel,franke,ferrante,fenn,ehrlich,christopherso,chasse,caton,brunelle,bloomfield,babbitt,azevedo,abramson,ables,abeyta,youmans,wozniak,wainwright,stowell,smitherman,samuelson,runge,rothman,rosenfeld,peake,owings,olmos,munro,moreira,leatherwood,larkins,krantz,kovacs,kizer,kindred,karnes,jaffe,hubbell,hosey,hauck,goodell,erdman,dvorak,doane,cureton,cofer,buehler,bierman,berndt,banta,abdullah,warwick,waltz,turcotte,torrey,stith,seger,sachs,quesada,pinder,peppers,pascual,paschall,parkhurst,ozuna,oster,nicholls,lheureux,lavalley,kimura,jablonski,haun,gourley,gilligan,croy,cotto,cargill,burwell,burgett,buckman,booher,adorno,wrenn,whittemore,urias,szabo,sayles,saiz,rutland,rael,pharr,pelkey,ogrady,nickell,musick,moats,mather,massa,kirschner,kieffer,kellar,hendershot,gott,godoy,gadson,furtado,fiedler,erskine,dutcher,dever,daggett,chevalier,brake,ballesteros,amerson,wingo,waldon,trott,silvey,showers,schlegel,ritz,pepin,pelayo,parsley,palermo,moorehead,mchale,lett,kocher,kilburn,iglesias,humble,hulbert,huckaby,hartford,hardiman,gurney,grigg,grasso,goings,fillmore,farber,depew,dandrea,cowen,covarrubias,burrus,bracy,ardoin,thompkins,standley,radcliffe,pohl,persaud,parenteau,pabon,newson,newhouse,napolitano,mulcahy,malave,keim,hooten,hernandes,heffernan,hearne,greenleaf,glick,fuhrman,fetter,faria,dishman,dickenson,crites,criss,clapper,chenault,castor,casto,bugg,bove,bonney,anderton,allgood,alderson,woodman,warrick,toomey,tooley,tarrant,summerville,stebbins,sokol,searles,schutz,schumann,scheer,remillard,raper,proulx,palmore,monroy,messier,melo,melanson,mashburn,manzano,lussier,jenks,huneycutt,hartwig,grimsley,fulk,fielding,fidler,engstrom,eldred,dantzler,crandell,calder,brumley,breton,brann,bramlett,boykins,bianco,bancroft,almaraz,alcantar,whitmer,whitener,welton,vineyard,rahn,paquin,mizell,mcmillin,mckean,marston,maciel,lundquist,liggins,lampkin,kranz,koski,kirkham,jiminez,hazzard,harrod,graziano,grammer,gendron,garrido,fordham,englert,dryden,demoss,deluna,crabb,comeau,brummett,blume,benally,wessel,vanbuskirk,thorson,stumpf,stockwell,reams,radtke,rackley,pelton,niemi,newland,nelsen,morrissette,miramontes,mcginley,mccluskey,marchant,luevano,lampe,lail,jeffcoat,infante,hinman,gaona,eady,desmarais,decosta,dansby,cisco,choe,breckenridge,bostwick,borg,bianchi,alberts,wilkie,whorton,vargo,tait,soucy,schuman,ousley,mumford,lippert,leath,lavergne,laliberte,kirksey,kenner,johnsen,izzo,hiles,gullett,greenwell,gaspar,galbreath,gaitan,ericson,delapaz,croom,cottingham,clift,bushnell,bice,beason,arrowood,waring,voorhees,truax,shreve,shockey,schatz,sandifer,rubino,rozier,roseberry,pieper,peden,nester,nave,murphey,malinowski,macgregor,lafrance,kunkle,kirkman,hipp,hasty,haddix,gervais,gerdes,gamache,fouts,fitzwater,dillingham,deming,deanda,cedeno,cannady,burson,bouldin,arceneaux,woodhouse,whitford,wescott,welty,weigel,torgerson,toms,surber,sunderland,sterner,setzer,riojas,pumphrey,puga,metts,mcgarry,mccandless,magill,lupo,loveland,llamas,leclerc,koons,kahler,huss,holbert,heintz,haupt,grimmett,gaskill,ellingson,dorr,dingess,deweese,desilva,crossley,cordeiro,converse,conde,caldera,cairns,burmeister,burkhalter,brawner,bott,youngs,vierra,valladares,shrum,shropshire,sevilla,rusk,rodarte,pedraza,nino,merino,mcminn,markle,mapp,lajoie,koerner,kittrell,kato,hyder,hollifield,heiser,hazlett,greenwald,fant,eldredge,dreher,delafuente,cravens,claypool,beecher,aronson,alanis,worthen,wojcik,winger,whitacre,valverde,valdivia,troupe,thrower,swindell,suttles,stroman,spires,slate,shealy,sarver,sartin,sadowski,rondeau,rolon,rascon,priddy,paulino,nolte,munroe,molloy,mciver,lykins,loggins,lenoir,klotz,kempf,hupp,hollowell,hollander,haynie,harkness,harker,gottlieb,frith,eddins,driskell,doggett,densmore,charette,cassady,byrum,burcham,buggs,benn,whitted,warrington,vandusen,vaillancourt,steger,siebert,scofield,quirk,purser,plumb,orcutt,nordstrom,mosely,michalski,mcphail,mcdavid,mccraw,marchese,mannino,lefevre,largent,lanza,kress,isham,hunsaker,hoch,hildebrandt,guarino,grijalva,graybill,fick,ewell,ewald,cusick,crumley,coston,cathcart,carruthers,bullington,bowes,blain,blackford,barboza,yingling,wert,weiland,varga,silverstein,sievers,shuster,shumway,runnels,rumsey,renfroe,provencher,polley,mohler,middlebrooks,kutz,koster,groth,glidden,fazio,deen,chipman,chenoweth,champlin,cedillo,carrero,carmody,buckles,brien,boutin,bosch,berkowitz,altamirano,wilfong,wiegand,waites,truesdale,toussaint,tobey,tedder,steelman,sirois,schnell,robichaud,richburg,plumley,pizarro,piercy,ortego,oberg,neace,mertz,mcnew,matta,lapp,lair,kibler,howlett,hollister,hofer,hatten,hagler,falgoust,engelhardt,eberle,dombrowski,dinsmore,daye,casares,braud,balch,autrey,wendel,tyndall,strobel,stoltz,spinelli,serrato,reber,rathbone,palomino,nickels,mayle,mathers,mach,loeffler,littrell,levinson,leong,lemire,lejeune,lazo,lasley,koller,kennard,hoelscher,hintz,hagerman,greaves,fore,eudy,engler,corrales,cordes,brunet,bidwell,bennet,tyrrell,tharpe,swinton,stribling,southworth,sisneros,savoie,samons,ruvalcaba,ries,ramer,omara,mosqueda,millar,mcpeak,macomber,luckey,litton,lehr,lavin,hubbs,hoard,hibbs,hagans,futrell,exum,evenson,culler,carbaugh,callen,brashear,bloomer,blakeney,bigler,addington,woodford,unruh,tolentino,sumrall,stgermain,smock,sherer,rayner,pooler,oquinn,nero,mcglothlin,linden,kowal,kerrigan,ibrahim,harvell,hanrahan,goodall,geist,fussell,fung,ferebee,eley,eggert,dorsett,dingman,destefano,colucci,clemmer,burnell,brumbaugh,boddie,berryhill,avelar,alcantara,winder,winchell,vandenberg,trotman,thurber,thibeault,stlouis,stilwell,sperling,shattuck,sarmiento,ruppert,rumph,renaud,randazzo,rademacher,quiles,pearman,palomo,mercurio,lowrey,lindeman,lawlor,larosa,lander,labrecque,hovis,holifield,henninger,hawkes,hartfield,hann,hague,genovese,garrick,fudge,frink,eddings,dinh,cribbs,calvillo,bunton,brodeur,bolding,blanding,agosto,zahn,wiener,trussell,tello,teixeira,speck,sharma,shanklin,sealy,scanlan,santamaria,roundy,robichaux,ringer,rigney,prevost,polson,nord,moxley,medford,mccaslin,mcardle,macarthur,lewin,lasher,ketcham,keiser,heine,hackworth,grose,grizzle,gillman,gartner,frazee,fleury,edson,edmonson,derry,cronk,conant,burress,burgin,broom,brockington,bolick,boger,birchfield,billington,baily,bahena,armbruster,anson,yoho,wilcher,tinney,timberlake,thielen,sutphin,stultz,sikora,serra,schulman,scheffler,santillan,rego,preciado,pinkham,mickle,lomas,lizotte,lent,kellerman,keil,johanson,hernadez,hartsfield,haber,gorski,farkas,eberhardt,duquette,delano,cropper,cozart,cockerham,chamblee,cartagena,cahoon,buzzell,brister,brewton,blackshear,benfield,aston,ashburn,arruda,wetmore,weise,vaccaro,tucci,sudduth,stromberg,stoops,showalter,shears,runion,rowden,rosenblum,riffle,renfrow,peres,obryant,leftwich,lark,landeros,kistler,killough,kerley,kastner,hoggard,hartung,guertin,govan,gatling,gailey,fullmer,fulford,flatt,esquibel,endicott,edmiston,edelstein,dufresne,dressler,dickman,chee,busse,bonnett,berard,yoshida,velarde,veach,vanhouten,vachon,tolson,tolman,tennyson,stites,soler,shutt,ruggles,rhone,pegues,neese,muro,moncrief,mefford,mcphee,mcmorris,mceachern,mcclurg,mansour,mader,leija,lecompte,lafountain,labrie,jaquez,heald,hash,hartle,gainer,frisby,farina,eidson,edgerton,dyke,durrett,duhon,cuomo,cobos,cervantez,bybee,brockway,borowski,binion,beery,arguello,amaro,acton,yuen,winton,wigfall,weekley,vidrine,vannoy,tardiff,shoop,shilling,schick,safford,prendergast,pilgrim,pellerin,osuna,nissen,nalley,moller,messner,messick,merrifield,mcguinness,matherly,marcano,mahone,lemos,lebrun,jara,hoffer,herren,hecker,haws,haug,gwin,gober,gilliard,fredette,favela,echeverria,downer,donofrio,desrochers,crozier,corson,bechtold,argueta,aparicio,zamudio,westover,westerman,utter,troyer,thies,tapley,slavin,shirk,sandler,roop,rimmer,raymer,radcliff,otten,moorer,millet,mckibben,mccutchen,mcavoy,mcadoo,mayorga,mastin,martineau,marek,madore,leflore,kroeger,kennon,jimerson,hostetter,hornback,hendley,hance,guardado,granado,gowen,goodale,flinn,fleetwood,fitz,durkee,duprey,dipietro,dilley,clyburn,brawley,beckley,arana,weatherby,vollmer,vestal,tunnell,trigg,tingle,takahashi,sweatt,storer,snapp,shiver,rooker,rathbun,poisson,perrine,perri,parmer,parke,pare,papa,palmieri,midkiff,mecham,mccomas,mcalpine,lovelady,lillard,lally,knopp,kile,kiger,haile,gupta,goldsberry,gilreath,fulks,friesen,franzen,flack,findlay,ferland,dreyer,dore,dennard,deckard,debose,crim,coulombe,chancey,cantor,branton,bissell,barns,woolard,witham,wasserman,spiegel,shoffner,scholz,ruch,rossman,petry,palacio,paez,neary,mortenson,millsap,miele,menke,mckim,mcanally,martines,lemley,larochelle,klaus,klatt,kaufmann,kapp,helmer,hedge,halloran,glisson,frechette,fontana,eagan,distefano,danley,creekmore,chartier,chaffee,carillo,burg,bolinger,berkley,benz,basso,bash,zelaya,woodring,witkowski,wilmot,wilkens,wieland,verdugo,urquhart,tsai,timms,swiger,swaim,sussman,pires,molnar,mcatee,lowder,loos,linker,landes,kingery,hufford,higa,hendren,hammack,hamann,gillam,gerhardt,edelman,delk,deans,curl,constantine,cleaver,claar,casiano,carruth,carlyle,brophy,bolanos,bibbs,bessette,beggs,baugher,bartel,averill,andresen,amin,adames,valente,turnbow,swink,sublett,stroh,stringfellow,ridgway,pugliese,poteat,ohare,neubauer,murchison,mingo,lemmons,kwon,kellam,kean,jarmon,hyden,hudak,hollinger,henkel,hemingway,hasson,hansel,halter,haire,ginsberg,gillispie,fogel,flory,etter,elledge,eckman,deas,currin,crafton,coomer,colter,claxton,bulter,braddock,bowyer,binns,bellows,baskerville,barros,ansley,woolf,wight,waldman,wadley,tull,trull,tesch,stouffer,stadler,slay,shubert,sedillo,santacruz,reinke,poynter,neri,neale,mowry,moralez,monger,mitchum,merryman,manion,macdougall,litchfield,levitt,lepage,lasalle,khoury,kavanagh,karns,ivie,huebner,hodgkins,halpin,garica,eversole,dutra,dunagan,duffey,dillman,dillion,deville,dearborn,damato,courson,coulson,burdine,bousquet,bonin,bish,atencio,westbrooks,wages,vaca,toner,tillis,swett,struble,stanfill,solorzano,slusher,sipple,silvas,shults,schexnayder,saez,rodas,rager,pulver,penton,paniagua,meneses,mcfarlin,mcauley,matz,maloy,magruder,lohman,landa,lacombe,jaimes,holzer,holst,heil,hackler,grundy,gilkey,farnham,durfee,dunton,dunston,duda,dews,craver,corriveau,conwell,colella,chambless,bremer,boutte,bourassa,blaisdell,backman,babineaux,audette,alleman,towner,taveras,tarango,sullins,suiter,stallard,solberg,schlueter,poulos,pimental,owsley,okelley,moffatt,metcalfe,meekins,medellin,mcglynn,mccowan,marriott,marable,lennox,lamoureux,koss,kerby,karp,isenberg,howze,hockenberry,highsmith,hallmark,gusman,greeley,giddings,gaudet,gallup,fleenor,eicher,edington,dimaggio,dement,demello,decastro,bushman,brundage,brooker,bourg,blackstock,bergmann,beaton,banister,argo,appling,wortman,watterson,villalpando,tillotson,tighe,sundberg,sternberg,stamey,shipe,seeger,scarberry,sattler,sain,rothstein,poteet,plowman,pettiford,penland,partain,pankey,oyler,ogletree,ogburn,moton,merkel,lucier,lakey,kratz,kinser,kershaw,josephson,imhoff,hendry,hammon,frisbie,frawley,fraga,forester,eskew,emmert,drennan,doyon,dandridge,cawley,carvajal,bracey,belisle,batey,ahner,wysocki,weiser,veliz,tincher,sansone,sankey,sandstrom,rohrer,risner,pridemore,pfeffer,persinger,peery,oubre,nowicki,musgrave,murdoch,mullinax,mccary,mathieu,livengood,kyser,klink,kimes,kellner,kavanaugh,kasten,imes,hoey,hinshaw,hake,gurule,grube,grillo,geter,gatto,garver,garretson,farwell,eiland,dunford,decarlo,corso,colman,collard,cleghorn,chasteen,cavender,carlile,calvo,byerly,brogdon,broadwater,breault,bono,bergin,behr,ballenger,amick,tamez,stiffler,steinke,simmon,shankle,schaller,salmons,sackett,saad,rideout,ratcliffe,ranson,plascencia,petterson,olszewski,olney,olguin,nilsson,nevels,morelli,montiel,monge,michaelson,mertens,mcchesney,mcalpin,mathewson,loudermilk,lineberry,liggett,kinlaw,kight,jost,hereford,hardeman,halpern,halliday,hafer,gaul,friel,freitag,forsberg,evangelista,doering,dicarlo,dendy,delp,deguzman,dameron,curtiss,cosper,cauthen,bradberry,bouton,bonnell,bixby,bieber,beveridge,bedwell,barhorst,bannon,baltazar,baier,ayotte,attaway,arenas,abrego,turgeon,tunstall,thaxton,tenorio,stotts,sthilaire,shedd,seabolt,scalf,salyers,ruhl,rowlett,robinett,pfister,perlman,pepe,parkman,nunnally,norvell,napper,modlin,mckellar,mcclean,mascarenas,leibowitz,ledezma,kuhlman,kobayashi,hunley,holmquist,hinkley,hazard,hartsell,gribble,gravely,fifield,eliason,doak,crossland,carleton,bridgeman,bojorquez,boggess,auten,woosley,whiteley,wexler,twomey,tullis,townley,standridge,santoyo,rueda,riendeau,revell,pless,ottinger,nigro,nickles,mulvey,menefee,mcshane,mcloughlin,mckinzie,markey,lockridge,lipsey,knisley,knepper,kitts,kiel,jinks,hathcock,godin,gallego,fikes,fecteau,estabrook,ellinger,dunlop,dudek,countryman,chauvin,chatham,bullins,brownfield,boughton,bloodworth,bibb,baucom,barbieri,aubin,armitage,alessi,absher,abbate,zito,woolery,wiggs,wacker,tynes,tolle,telles,tarter,swarey,strode,stockdale,stalnaker,spina,schiff,saari,risley,rameriz,rakes,pettaway,penner,paulus,palladino,omeara,montelongo,melnick,mehta,mcgary,mccourt,mccollough,marchetti,manzanares,lowther,leiva,lauderdale,lafontaine,kowalczyk,knighton,joubert,jaworski,huth,hurdle,housley,hackman,gulick,gordy,gilstrap,gehrke,gebhart,gaudette,foxworth,endres,dunkle,cimino,caddell,brauer,braley,bodine,blackmore,belden,backer,ayer,andress,wisner,vuong,valliere,twigg,tavarez,strahan,steib,staub,sowder,seiber,schutt,scharf,schade,rodriques,risinger,renshaw,rahman,presnell,piatt,nieman,nevins,mcilwain,mcgaha,mccully,mccomb,massengale,macedo,lesher,kearse,jauregui,husted,hudnall,holmberg,hertel,hardie,glidewell,frausto,fassett,dalessandro,dahlgren,corum,constantino,conlin,colquitt,colombo,claycomb,cardin,buller,boney,bocanegra,biggers,benedetto,araiza,andino,albin,zorn,werth,weisman,walley,vanegas,ulibarri,towe,tedford,teasley,suttle,steffens,stcyr,squire,singley,sifuentes,shuck,schram,sass,rieger,ridenhour,rickert,richerson,rayborn,rabe,raab,pendley,pastore,ordway,moynihan,mellott,mckissick,mcgann,mccready,mauney,marrufo,lenhart,lazar,lafave,keele,kautz,jardine,jahnke,jacobo,hord,hardcastle,hageman,giglio,gehring,fortson,duque,duplessis,dicken,derosier,deitz,dalessio,cram,castleman,candelario,callison,caceres,bozarth,biles,bejarano,bashaw,avina,armentrout,alverez,acord,waterhouse,vereen,vanlandingham,strawser,shotwell,severance,seltzer,schoonmaker,schock,schaub,schaffner,roeder,rodrigez,riffe,rasberry,rancourt,railey,quade,pursley,prouty,perdomo,oxley,osterman,nickens,murphree,mounts,merida,maus,mattern,masse,martinelli,mangan,lutes,ludwick,loney,laureano,lasater,knighten,kissinger,kimsey,kessinger,honea,hollingshead,hockett,heyer,heron,gurrola,gove,glasscock,gillett,galan,featherstone,eckhardt,duron,dunson,dasher,culbreth,cowden,cowans,claypoole,churchwell,chabot,caviness,cater,caston,callan,byington,burkey,boden,beckford,atwater,archambault,alvey,alsup,whisenant,weese,voyles,verret,tsang,tessier,sweitzer,sherwin,shaughnessy,revis,remy,prine,philpott,peavy,paynter,parmenter,ovalle,offutt,nightingale,newlin,nakano,myatt,muth,mohan,mcmillon,mccarley,mccaleb,maxson,marinelli,maley,liston,letendre,kain,huntsman,hirst,hagerty,gulledge,greenway,grajeda,gorton,goines,gittens,frederickson,fanelli,embree,eichelberger,dunkin,dixson,dillow,defelice,chumley,burleigh,borkowski,binette,biggerstaff,berglund,beller,audet,arbuckle,allain,alfano,youngman,wittman,weintraub,vanzant,vaden,twitty,stollings,standifer,sines,shope,scalise,saville,posada,pisano,otte,nolasco,mier,merkle,mendiola,melcher,mejias,mcmurry,mccalla,markowitz,manis,mallette,macfarlane,lough,looper,landin,kittle,kinsella,kinnard,hobart,helman,hellman,hartsock,halford,hage,gordan,glasser,gayton,gattis,gastelum,gaspard,frisch,fitzhugh,eckstein,eberly,dowden,despain,crumpler,crotty,cornelison,chouinard,chamness,catlin,cann,bumgardner,budde,branum,bradfield,braddy,borst,birdwell,bazan,banas,bade,arango,ahearn,addis,zumwalt,wurth,wilk,widener,wagstaff,urrutia,terwilliger,tart,steinman,staats,sloat,rives,riggle,revels,reichard,prickett,poff,pitzer,petro,pell,northrup,nicks,moline,mielke,maynor,mallon,magness,lingle,lindell,lieb,lesko,lebeau,lammers,lafond,kiernan,ketron,jurado,holmgren,hilburn,hayashi,hashimoto,harbaugh,guillot,gard,froehlich,feinberg,falco,dufour,drees,doney,diep,delao,daves,dail,crowson,coss,congdon,carner,camarena,butterworth,burlingame,bouffard,bloch,bilyeu,barta,bakke,baillargeon,avent,aquilar,zeringue,yarber,wolfson,vogler,voelker,truss,troxell,thrift,strouse,spielman,sistrunk,sevigny,schuller,schaaf,ruffner,routh,roseman,ricciardi,peraza,pegram,overturf,olander,odaniel,millner,melchor,maroney,machuca,macaluso,livesay,layfield,laskowski,kwiatkowski,kilby,hovey,heywood,hayman,havard,harville,haigh,hagood,grieco,glassman,gebhardt,fleischer,fann,elson,eccles,cunha,crumb,blakley,bardwell,abshire,woodham,wines,welter,wargo,varnado,tutt,traynor,swaney,stricker,stoffel,stambaugh,sickler,shackleford,selman,seaver,sansom,sanmiguel,royston,rourke,rockett,rioux,puleo,pitchford,nardi,mulvaney,middaugh,malek,leos,lathan,kujawa,kimbro,killebrew,houlihan,hinckley,herod,hepler,hamner,hammel,hallowell,gonsalez,gingerich,gambill,funkhouser,fricke,fewell,falkner,endsley,dulin,drennen,deaver,dambrosio,chadwell,castanon,burkes,brune,brisco,brinker,bowker,boldt,berner,beaumont,beaird,bazemore,barrick,albano,younts,wunderlich,weidman,vanness,toland,theobald,stickler,steiger,stanger,spies,spector,sollars,smedley,seibel,scoville,saito,rummel,rowles,rouleau,roos,rogan,roemer,ream,raya,purkey,priester,perreira,penick,paulin,parkins,overcash,oleson,neves,muldrow,minard,midgett,michalak,melgar,mcentire,mcauliffe,marte,lydon,lindholm,leyba,langevin,lagasse,lafayette,kesler,kelton,kaminsky,jaggers,humbert,huck,howarth,hinrichs,higley,gupton,guimond,gravois,giguere,fretwell,fontes,feeley,faucher,eichhorn,ecker,earp,dole,dinger,derryberry,demars,deel,copenhaver,collinsworth,colangelo,cloyd,claiborne,caulfield,carlsen,calzada,caffey,broadus,brenneman,bouie,bodnar,blaney,blanc,beltz,behling,barahona,yockey,winkle,windom,wimer,villatoro,trexler,teran,taliaferro,sydnor,swinson,snelling,smtih,simonton,simoneaux,simoneau,sherrer,seavey,scheel,rushton,rupe,ruano,rippy,reiner,reiff,rabinowitz,quach,penley,odle,nock,minnich,mckown,mccarver,mcandrew,longley,laux,lamothe,lafreniere,kropp,krick,kates,jepson,huie,howse,howie,henriques,haydon,haught,hatter,hartzog,harkey,grimaldo,goshorn,gormley,gluck,gilroy,gillenwater,giffin,fluker,feder,eyre,eshelman,eakins,detwiler,delrosario,davisson,catalan,canning,calton,brammer,botelho,blakney,bartell,averett,askins,aker,witmer,winkelman,widmer,whittier,weitzel,wardell,wagers,ullman,tupper,tingley,tilghman,talton,simard,seda,scheller,sala,rundell,rost,ribeiro,rabideau,primm,pinon,peart,ostrom,ober,nystrom,nussbaum,naughton,murr,moorhead,monti,monteiro,melson,meissner,mclin,mcgruder,marotta,makowski,majewski,madewell,lunt,lukens,leininger,lebel,lakin,kepler,jaques,hunnicutt,hungerford,hoopes,hertz,heins,halliburton,grosso,gravitt,glasper,gallman,gallaway,funke,fulbright,falgout,eakin,dostie,dorado,dewberry,derose,cutshall,crampton,costanzo,colletti,cloninger,claytor,chiang,campagna,burd,brokaw,broaddus,bretz,brainard,binford,bilbrey,alpert,aitken,ahlers,zajac,woolfolk,witten,windle,wayland,tramel,tittle,talavera,suter,straley,specht,sommerville,soloman,skeens,sigman,sibert,shavers,schuck,schmit,sartain,sabol,rosenblatt,rollo,rashid,rabb,polston,nyberg,northrop,navarra,muldoon,mikesell,mcdougald,mcburney,mariscal,lozier,lingerfelt,legere,latour,lagunas,lacour,kurth,killen,kiely,kayser,kahle,isley,huertas,hower,hinz,haugh,gumm,galicia,fortunato,flake,dunleavy,duggins,doby,digiovanni,devaney,deltoro,cribb,corpuz,coronel,coen,charbonneau,caine,burchette,blakey,blakemore,bergquist,beene,beaudette,bayles,ballance,bakker,bailes,asberry,arwood,zucker,willman,whitesell,wald,walcott,vancleave,trump,strasser,simas,shick,schleicher,schaal,saleh,rotz,resnick,rainer,partee,ollis,oller,oday,noles,munday,mong,millican,merwin,mazzola,mansell,magallanes,llanes,lewellen,lepore,kisner,keesee,jeanlouis,ingham,hornbeck,hawn,hartz,harber,haffner,gutshall,guth,grays,gowan,finlay,finkelstein,eyler,enloe,dungan,diez,dearman,cull,crosson,chronister,cassity,campion,callihan,butz,breazeale,blumenthal,berkey,batty,batton,arvizu,alderete,aldana,albaugh,abernethy,wolter,wille,tweed,tollefson,thomasson,teter,testerman,sproul,spates,southwick,soukup,skelly,senter,sealey,sawicki,sargeant,rossiter,rosemond,repp,pifer,ormsby,nickelson,naumann,morabito,monzon,millsaps,millen,mcelrath,marcoux,mantooth,madson,macneil,mackinnon,louque,leister,lampley,kushner,krouse,kirwan,jessee,janson,jahn,jacquez,islas,hutt,holladay,hillyer,hepburn,hensel,harrold,gingrich,geis,gales,fults,finnell,ferri,featherston,epley,ebersole,eames,dunigan,drye,dismuke,devaughn,delorenzo,damiano,confer,collum,clower,clow,claussen,clack,caylor,cawthon,casias,carreno,bluhm,bingaman,bewley,belew,beckner,auld,amey,wolfenbarger,wilkey,wicklund,waltman,villalba,valero,valdovinos,ullrich,tyus,twyman,trost,tardif,tanguay,stripling,steinbach,shumpert,sasaki,sappington,sandusky,reinhold,reinert,quijano,placencia,pinkard,phinney,perrotta,pernell,parrett,oxendine,owensby,orman,nuno,mori,mcroberts,mcneese,mckamey,mccullum,markel,mardis,maines,lueck,lubin,lefler,leffler,larios,labarbera,kershner,josey,jeanbaptiste,izaguirre,hermosillo,haviland,hartshorn,hafner,ginter,getty,franck,fiske,dufrene,doody,davie,dangerfield,dahlberg,cuthbertson,crone,coffelt,chidester,chesson,cauley,caudell,cantara,campo,caines,bullis,bucci,brochu,bogard,bickerstaff,benning,arzola,antonelli,adkinson,zellers,wulf,worsley,woolridge,whitton,westerfield,walczak,vassar,truett,trueblood,trawick,townsley,topping,tobar,telford,steverson,stagg,sitton,sill,sergent,schoenfeld,sarabia,rutkowski,rubenstein,rigdon,prentiss,pomerleau,plumlee,philbrick,patnode,oloughlin,obregon,nuss,morell,mikell,mele,mcinerney,mcguigan,mcbrayer,lollar,kuehl,kinzer,kamp,joplin,jacobi,howells,holstein,hedden,hassler,harty,halle,greig,gouge,goodrum,gerhart,geier,geddes,gast,forehand,ferree,fendley,feltner,esqueda,encarnacion,eichler,egger,edmundson,eatmon,doud,donohoe,donelson,dilorenzo,digiacomo,diggins,delozier,dejong,danford,crippen,coppage,cogswell,clardy,cioffi,cabe,brunette,bresnahan,blomquist,blackstone,biller,bevis,bevan,bethune,benbow,baty,basinger,balcom,andes,aman,aguero,adkisson,yandell,wilds,whisenhunt,weigand,weeden,voight,villar,trottier,tillett,suazo,setser,scurry,schuh,schreck,schauer,samora,roane,rinker,reimers,ratchford,popovich,parkin,natal,melville,mcbryde,magdaleno,loehr,lockman,lingo,leduc,larocca,lamere,laclair,krall,korte,koger,jalbert,hughs,higbee,henton,heaney,haith,gump,greeson,goodloe,gholston,gasper,gagliardi,fregoso,farthing,fabrizio,ensor,elswick,elgin,eklund,eaddy,drouin,dorton,dizon,derouen,deherrera,davy,dampier,cullum,culley,cowgill,cardoso,cardinale,brodsky,broadbent,brimmer,briceno,branscum,bolyard,boley,bennington,beadle,baur,ballentine,azure,aultman,arciniega,aguila,aceves,yepez,woodrum,wethington,weissman,veloz,trusty,troup,trammel,tarpley,stivers,steck,sprayberry,spraggins,spitler,spiers,sohn,seagraves,schiffman,rudnick,rizo,riccio,rennie,quackenbush,puma,plott,pearcy,parada,paiz,munford,moskowitz,mease,mcnary,mccusker,lozoya,longmire,loesch,lasky,kuhlmann,krieg,koziol,kowalewski,konrad,kindle,jowers,jolin,jaco,horgan,hine,hileman,hepner,heise,heady,hawkinson,hannigan,haberman,guilford,grimaldi,garton,gagliano,fruge,follett,fiscus,ferretti,ebner,easterday,eanes,dirks,dimarco,depalma,deforest,cruce,craighead,christner,candler,cadwell,burchell,buettner,brinton,brazier,brannen,brame,bova,bomar,blakeslee,belknap,bangs,balzer,athey,armes,alvis,alverson,alvardo,yeung,wheelock,westlund,wessels,volkman,threadgill,thelen,tague,symons,swinford,sturtevant,straka,stier,stagner,segarra,seawright,rutan,roux,ringler,riker,ramsdell,quattlebaum,purifoy,poulson,permenter,peloquin,pasley,pagel,osman,obannon,nygaard,newcomer,munos,motta,meadors,mcquiston,mcniel,mcmann,mccrae,mayne,matte,legault,lechner,kucera,krohn,kratzer,koopman,jeske,horrocks,hock,hibbler,hesson,hersh,harvin,halvorsen,griner,grindle,gladstone,garofalo,frampton,forbis,eddington,diorio,dingus,dewar,desalvo,curcio,creasy,cortese,cordoba,connally,cluff,cascio,capuano,canaday,calabro,bussard,brayton,borja,bigley,arnone,arguelles,acuff,zamarripa,wooton,widner,wideman,threatt,thiele,templin,teeters,synder,swint,swick,sturges,stogner,stedman,spratt,siegfried,shetler,scull,savino,sather,rothwell,rook,rone,rhee,quevedo,privett,pouliot,poche,pickel,petrillo,pellegrini,peaslee,partlow,otey,nunnery,morelock,morello,meunier,messinger,mckie,mccubbin,mccarron,lerch,lavine,laverty,lariviere,lamkin,kugler,krol,kissel,keeter,hubble,hickox,hetzel,hayner,hagy,hadlock,groh,gottschalk,goodsell,gassaway,garrard,galligan,firth,fenderson,feinstein,etienne,engleman,emrick,ellender,drews,doiron,degraw,deegan,dart,crissman,corr,cookson,coil,cleaves,charest,chapple,chaparro,castano,carpio,byer,bufford,bridgewater,bridgers,brandes,borrero,bonanno,aube,ancheta,abarca,abad,wooster,wimbush,willhite,willams,wigley,weisberg,wardlaw,vigue,vanhook,unknow,torre,tasker,tarbox,strachan,slover,shamblin,semple,schuyler,schrimsher,sayer,salzman,rubalcava,riles,reneau,reichel,rayfield,rabon,pyatt,prindle,poss,polito,plemmons,pesce,perrault,pereyra,ostrowski,nilsen,niemeyer,munsey,mundell,moncada,miceli,meader,mcmasters,mckeehan,matsumoto,marron,marden,lizarraga,lingenfelter,lewallen,langan,lamanna,kovac,kinsler,kephart,keown,kass,kammerer,jeffreys,hysell,hosmer,hardnett,hanner,guyette,greening,glazer,ginder,fromm,fluellen,finkle,fessler,essary,eisele,duren,dittmer,crochet,cosentino,cogan,coelho,cavin,carrizales,campuzano,brough,bopp,bookman,bobb,blouin,beesley,battista,bascom,bakken,badgett,arneson,anselmo,albino,ahumada,woodyard,wolters,wireman,willison,warman,waldrup,vowell,vantassel,twombly,toomer,tennison,teets,tedeschi,swanner,stutz,stelly,sheehy,schermerhorn,scala,sandidge,salters,salo,saechao,roseboro,rolle,ressler,renz,renn,redford,raposa,rainbolt,pelfrey,orndorff,oney,nolin,nimmons,nardone,myhre,morman,menjivar,mcglone,mccammon,maxon,marciano,manus,lowrance,lorenzen,lonergan,lollis,littles,lindahl,lamas,lach,kuster,krawczyk,knuth,knecht,kirkendall,keitt,keever,kantor,jarboe,hoye,houchens,holter,holsinger,hickok,helwig,helgeson,hassett,harner,hamman,hames,hadfield,goree,goldfarb,gaughan,gaudreau,gantz,gallion,frady,foti,flesher,ferrin,faught,engram,donegan,desouza,degroot,cutright,crowl,criner,coan,clinkscales,chewning,chavira,catchings,carlock,bulger,buenrostro,bramblett,brack,boulware,bookout,bitner,birt,baranowski,baisden,allmon,acklin,yoakum,wilbourn,whisler,weinberger,washer,vasques,vanzandt,vanatta,troxler,tomes,tindle,tims,throckmorton,thach,stpeter,stlaurent,stenson,spry,spitz,songer,snavely,shroyer,shortridge,shenk,sevier,seabrook,scrivner,saltzman,rosenberry,rockwood,robeson,roan,reiser,ramires,raber,posner,popham,piotrowski,pinard,peterkin,pelham,peiffer,peay,nadler,musso,millett,mestas,mcgowen,marques,marasco,manriquez,manos,mair,lipps,leiker,krumm,knorr,kinslow,kessel,kendricks,kelm,irick,ickes,hurlburt,horta,hoekstra,heuer,helmuth,heatherly,hampson,hagar,haga,greenlaw,grau,godbey,gingras,gillies,gibb,gayden,gauvin,garrow,fontanez,florio,finke,fasano,ezzell,ewers,eveland,eckenrode,duclos,drumm,dimmick,delancey,defazio,dashiell,cusack,crowther,crigger,cray,coolidge,coldiron,cleland,chalfant,cassel,camire,cabrales,broomfield,brittingham,brisson,brickey,braziel,brazell,bragdon,boulanger,boman,bohannan,beem,barre,azar,ashbaugh,armistead,almazan,adamski,zendejas,winburn,willaims,wilhoit,westberry,wentzel,wendling,visser,vanscoy,vankirk,vallee,tweedy,thornberry,sweeny,spradling,spano,smelser,shim,sechrist,schall,scaife,rugg,rothrock,roesler,riehl,ridings,render,ransdell,radke,pinero,petree,pendergast,peluso,pecoraro,pascoe,panek,oshiro,navarrette,murguia,moores,moberg,michaelis,mcwhirter,mcsweeney,mcquade,mccay,mauk,mariani,marceau,mandeville,maeda,lunde,ludlow,loeb,lindo,linderman,leveille,leith,larock,lambrecht,kulp,kinsley,kimberlin,kesterson,hoyos,helfrich,hanke,grisby,goyette,gouveia,glazier,gile,gerena,gelinas,gasaway,funches,fujimoto,flynt,fenske,fellers,fehr,eslinger,escalera,enciso,duley,dittman,dineen,diller,devault,collings,clymer,clowers,chavers,charland,castorena,castello,camargo,bunce,bullen,boyes,borchers,borchardt,birnbaum,birdsall,billman,benites,bankhead,ange,ammerman,adkison,winegar,wickman,warr,warnke,villeneuve,veasey,vassallo,vannatta,vadnais,twilley,towery,tomblin,tippett,theiss,talkington,talamantes,swart,swanger,streit,stines,stabler,spurling,sobel,sine,simmers,shippy,shiflett,shearin,sauter,sanderlin,rusch,runkle,ruckman,rorie,roesch,richert,rehm,randel,ragin,quesenberry,puentes,plyler,plotkin,paugh,oshaughnessy,ohalloran,norsworthy,niemann,nader,moorefield,mooneyham,modica,miyamoto,mickel,mebane,mckinnie,mazurek,mancilla,lukas,lovins,loughlin,lotz,lindsley,liddle,levan,lederman,leclaire,lasseter,lapoint,lamoreaux,lafollette,kubiak,kirtley,keffer,kaczmarek,housman,hiers,hibbert,herrod,hegarty,hathorn,greenhaw,grafton,govea,futch,furst,franko,forcier,foran,flickinger,fairfield,eure,emrich,embrey,edgington,ecklund,eckard,durante,deyo,delvecchio,dade,currey,creswell,cottrill,casavant,cartier,cargile,capel,cammack,calfee,burse,burruss,brust,brousseau,bridwell,braaten,borkholder,bloomquist,bjork,bartelt,amburgey,yeary,whitefield,vinyard,vanvalkenburg,twitchell,timmins,tapper,stringham,starcher,spotts,slaugh,simonsen,sheffer,sequeira,rosati,rhymes,quint,pollak,peirce,patillo,parkerson,paiva,nilson,nevin,narcisse,mitton,merriam,merced,meiners,mckain,mcelveen,mcbeth,marsden,marez,manke,mahurin,mabrey,luper,krull,hunsicker,hornbuckle,holtzclaw,hinnant,heston,hering,hemenway,hegwood,hearns,halterman,guiterrez,grote,granillo,grainger,glasco,gilder,garren,garlock,garey,fryar,fredricks,fraizer,foshee,ferrel,felty,everitt,evens,esser,elkin,eberhart,durso,duguay,driskill,doster,dewall,deveau,demps,demaio,delreal,deleo,darrah,cumberbatch,culberson,cranmer,cordle,colgan,chesley,cavallo,castellon,castelli,carreras,carnell,carlucci,bontrager,blumberg,blasingame,becton,artrip,andujar,alkire,alder,zukowski,zuckerman,wroblewski,wrigley,woodside,wigginton,westman,westgate,werts,washam,wardlow,walser,waiters,tadlock,stringfield,stimpson,stickley,standish,spurlin,spindler,speller,spaeth,sotomayor,sluder,shryock,shepardson,shatley,scannell,santistevan,rosner,resto,reinhard,rathburn,prisco,poulsen,pinney,phares,pennock,pastrana,oviedo,ostler,nauman,mulford,moise,moberly,mirabal,metoyer,metheny,mentzer,meldrum,mcinturff,mcelyea,mcdougle,massaro,lumpkins,loveday,lofgren,lirette,lesperance,lefkowitz,ledger,lauzon,lachapelle,klassen,keough,kempton,kaelin,jeffords,hsieh,hoyer,horwitz,hoeft,hennig,haskin,gourdine,golightly,girouard,fulgham,fritsch,freer,frasher,foulk,firestone,fiorentino,fedor,ensley,englehart,eells,dunphy,donahoe,dileo,dibenedetto,dabrowski,crick,coonrod,conder,coddington,chunn,chaput,cerna,carreiro,calahan,braggs,bourdon,bollman,bittle,bauder,barreras,aubuchon,anzalone,adamo,zerbe,willcox,westberg,weikel,waymire,vroman,vinci,vallejos,truesdell,troutt,trotta,tollison,toles,tichenor,symonds,surles,strayer,stgeorge,sroka,sorrentino,solares,snelson,silvestri,sikorski,shawver,schumaker,schorr,schooley,scates,satterlee,satchell,rymer,roselli,robitaille,riegel,regis,reames,provenzano,priestley,plaisance,pettey,palomares,nowakowski,monette,minyard,mclamb,mchone,mccarroll,masson,magoon,maddy,lundin,licata,leonhardt,landwehr,kircher,kinch,karpinski,johannsen,hussain,houghtaling,hoskinson,hollaway,holeman,hobgood,hiebert,goggin,geissler,gadbois,gabaldon,fleshman,flannigan,fairman,eilers,dycus,dunmire,duffield,dowler,deloatch,dehaan,deemer,clayborn,christofferso,chilson,chesney,chatfield,carron,canale,brigman,branstetter,bosse,borton,bonar,biron,barroso,arispe,zacharias,zabel,yaeger,woolford,whetzel,weakley,veatch,vandeusen,tufts,troxel,troche,traver,townsel,talarico,swilley,sterrett,stenger,speakman,sowards,sours,souders,souder,soles,sobers,snoddy,smither,shute,shoaf,shahan,schuetz,scaggs,santini,rosson,rolen,robidoux,rentas,recio,pixley,pawlowski,pawlak,paull,overbey,orear,oliveri,oldenburg,nutting,naugle,mossman,misner,milazzo,michelson,mcentee,mccullar,mccree,mcaleer,mazzone,mandell,manahan,malott,maisonet,mailloux,lumley,lowrie,louviere,lipinski,lindemann,leppert,leasure,labarge,kubik,knisely,knepp,kenworthy,kennelly,kelch,kanter,houchin,hosley,hosler,hollon,holleman,heitman,haggins,gwaltney,goulding,gorden,geraci,gathers,frison,feagin,falconer,espada,erving,erikson,eisenhauer,ebeling,durgin,dowdle,dinwiddie,delcastillo,dedrick,crimmins,covell,cournoyer,coria,cohan,cataldo,carpentier,canas,campa,brode,brashears,blaser,bicknell,bednar,barwick,ascencio,althoff,almodovar,alamo,zirkle,zabala,wolverton,winebrenner,wetherell,westlake,wegener,weddington,tuten,trosclair,tressler,theroux,teske,swinehart,swensen,sundquist,southall,socha,sizer,silverberg,shortt,shimizu,sherrard,shaeffer,scheid,scheetz,saravia,sanner,rubinstein,rozell,romer,rheaume,reisinger,randles,pullum,petrella,payan,nordin,norcross,nicoletti,nicholes,newbold,nakagawa,monteith,milstead,milliner,mellen,mccardle,liptak,leitch,latimore,larrison,landau,laborde,koval,izquierdo,hymel,hoskin,holte,hoefer,hayworth,hausman,harrill,harrel,hardt,gully,groover,grinnell,greenspan,graver,grandberry,gorrell,goldenberg,goguen,gilleland,fuson,feldmann,everly,dyess,dunnigan,downie,dolby,deatherage,cosey,cheever,celaya,caver,cashion,caplinger,cansler,byrge,bruder,breuer,breslin,brazelton,botkin,bonneau,bondurant,bohanan,bogue,bodner,boatner,blatt,bickley,belliveau,beiler,beier,beckstead,bachmann,atkin,altizer,alloway,allaire,albro,abron,zellmer,yetter,yelverton,wiens,whidden,viramontes,vanwormer,tarantino,tanksley,sumlin,strauch,strang,stice,spahn,sosebee,sigala,shrout,seamon,schrum,schneck,schantz,ruddy,romig,roehl,renninger,reding,polak,pohlman,pasillas,oldfield,oldaker,ohanlon,ogilvie,norberg,nolette,neufeld,nellis,mummert,mulvihill,mullaney,monteleone,mendonca,meisner,mcmullan,mccluney,mattis,massengill,manfredi,luedtke,lounsbury,liberatore,lamphere,laforge,jourdan,iorio,iniguez,ikeda,hubler,hodgdon,hocking,heacock,haslam,haralson,hanshaw,hannum,hallam,haden,garnes,garces,gammage,gambino,finkel,faucett,ehrhardt,eggen,dusek,durrant,dubay,dones,depasquale,delucia,degraff,decamp,davalos,cullins,conard,clouser,clontz,cifuentes,chappel,chaffins,celis,carwile,byram,bruggeman,bressler,brathwaite,brasfield,bradburn,boose,bodie,blosser,bertsch,bernardi,bernabe,bengtson,barrette,astorga,alday,albee,abrahamson,yarnell,wiltse,wiebe,waguespack,vasser,upham,turek,traxler,torain,tomaszewski,tinnin,tiner,tindell,styron,stahlman,staab,skiba,sheperd,seidl,secor,schutte,sanfilippo,ruder,rondon,rearick,procter,prochaska,pettengill,pauly,neilsen,nally,mullenax,morano,meads,mcnaughton,mcmurtry,mcmath,mckinsey,matthes,massenburg,marlar,margolis,malin,magallon,mackin,lovette,loughran,loring,longstreet,loiselle,lenihan,kunze,koepke,kerwin,kalinowski,kagan,innis,innes,holtzman,heinemann,harshman,haider,haack,grondin,grissett,greenawalt,goudy,goodlett,goldston,gokey,gardea,galaviz,gafford,gabrielson,furlow,fritch,fordyce,folger,elizalde,ehlert,eckhoff,eccleston,ealey,dubin,diemer,deschamps,delapena,decicco,debolt,cullinan,crittendon,crase,cossey,coppock,coots,colyer,cluck,chamberland,burkhead,bumpus,buchan,borman,birkholz,berardi,benda,behnke,barter,amezquita,wotring,wirtz,wingert,wiesner,whitesides,weyant,wainscott,venezia,varnell,tussey,thurlow,tabares,stiver,stell,starke,stanhope,stanek,sisler,sinnott,siciliano,shehan,selph,seager,scurlock,scranton,santucci,santangelo,saltsman,rogge,rettig,renwick,reidy,reider,redfield,premo,parente,paolucci,palmquist,ohler,netherton,mutchler,morita,mistretta,minnis,middendorf,menzel,mendosa,mendelson,meaux,mcspadden,mcquaid,mcnatt,manigault,maney,mager,lukes,lopresti,liriano,letson,lechuga,lazenby,lauria,larimore,krupp,krupa,kopec,kinchen,kifer,kerney,kerner,kennison,kegley,karcher,justis,johson,jellison,janke,huskins,holzman,hinojos,hefley,hatmaker,harte,halloway,hallenbeck,goodwyn,glaspie,geise,fullwood,fryman,frakes,fraire,farrer,enlow,engen,ellzey,eckles,earles,dunkley,drinkard,dreiling,draeger,dinardo,dills,desroches,desantiago,curlee,crumbley,critchlow,coury,courtright,coffield,cleek,charpentier,cardone,caples,cantin,buntin,bugbee,brinkerhoff,brackin,bourland,blassingame,beacham,banning,auguste,andreasen,amann,almon,alejo,adelman,abston,yerger,wymer,woodberry,windley,whiteaker,westfield,weibel,wanner,waldrep,villani,vanarsdale,utterback,updike,triggs,topete,tolar,tigner,thoms,tauber,tarvin,tally,swiney,sweatman,studebaker,stennett,starrett,stannard,stalvey,sonnenberg,smithey,sieber,sickles,shinault,segars,sanger,salmeron,rothe,rizzi,restrepo,ralls,ragusa,quiroga,papenfuss,oropeza,okane,mudge,mozingo,molinaro,mcvicker,mcgarvey,mcfalls,mccraney,matus,magers,llanos,livermore,linehan,leitner,laymon,lawing,lacourse,kwong,kollar,kneeland,kennett,kellett,kangas,janzen,hutter,huling,hofmeister,hewes,harjo,habib,guice,grullon,greggs,grayer,granier,grable,gowdy,giannini,getchell,gartman,garnica,ganey,gallimore,fetters,fergerson,farlow,fagundes,exley,esteves,enders,edenfield,easterwood,drakeford,dipasquale,desousa,deshields,deeter,dedmon,debord,daughtery,cutts,courtemanche,coursey,copple,coomes,collis,cogburn,clopton,choquette,chaidez,castrejon,calhoon,burbach,bulloch,buchman,bruhn,bohon,blough,baynes,barstow,zeman,zackery,yardley,yamashita,wulff,wilken,wiliams,wickersham,wible,whipkey,wedgeworth,walmsley,walkup,vreeland,verrill,umana,traub,swingle,summey,stroupe,stockstill,steffey,stefanski,statler,stapp,speights,solari,soderberg,shunk,shorey,shewmaker,sheilds,schiffer,schank,schaff,sagers,rochon,riser,rickett,reale,raglin,polen,plata,pitcock,percival,palen,orona,oberle,nocera,navas,nault,mullings,montejano,monreal,minick,middlebrook,meece,mcmillion,mccullen,mauck,marshburn,maillet,mahaney,magner,maclin,lucey,litteral,lippincott,leite,leaks,lamarre,jurgens,jerkins,jager,hurwitz,hughley,hotaling,horstman,hohman,hocker,hively,hipps,hessler,hermanson,hepworth,helland,hedlund,harkless,haigler,gutierez,grindstaff,glantz,giardina,gerken,gadsden,finnerty,farnum,encinas,drakes,dennie,cutlip,curtsinger,couto,cortinas,corby,chiasson,carle,carballo,brindle,borum,bober,blagg,berthiaume,beahm,batres,basnight,backes,axtell,atterberry,alvares,alegria,woodell,wojciechowski,winfree,winbush,wiest,wesner,wamsley,wakeman,verner,truex,trafton,toman,thorsen,theus,tellier,tallant,szeto,strope,stills,simkins,shuey,shaul,servin,serio,serafin,salguero,ryerson,rudder,ruark,rother,rohrbaugh,rohrbach,rohan,rogerson,risher,reeser,pryce,prokop,prins,priebe,prejean,pinheiro,petrone,petri,penson,pearlman,parikh,natoli,murakami,mullikin,mullane,motes,morningstar,mcveigh,mcgrady,mcgaughey,mccurley,marchan,manske,lusby,linde,likens,licon,leroux,lemaire,legette,laskey,laprade,laplant,kolar,kittredge,kinley,kerber,kanagy,jetton,janik,ippolito,inouye,hunsinger,howley,howery,horrell,holthaus,hiner,hilson,hilderbrand,hartzler,harnish,harada,hansford,halligan,hagedorn,gwynn,gudino,greenstein,greear,gracey,goudeau,goodner,ginsburg,gerth,gerner,fujii,frier,frenette,folmar,fleisher,fleischmann,fetzer,eisenman,earhart,dupuy,dunkelberger,drexler,dillinger,dilbeck,dewald,demby,deford,craine,chesnut,casady,carstens,carrick,carino,carignan,canchola,bushong,burman,buono,brownlow,broach,britten,brickhouse,boyden,boulton,borland,bohrer,blubaugh,bever,berggren,benevides,arocho,arends,amezcua,almendarez,zalewski,witzel,winkfield,wilhoite,vangundy,vanfleet,vanetten,vandergriff,urbanski,troiano,thibodaux,straus,stoneking,stjean,stillings,stange,speicher,speegle,smeltzer,slawson,simmonds,shuttleworth,serpa,senger,seidman,schweiger,schloss,schimmel,schechter,sayler,sabatini,ronan,rodiguez,riggleman,richins,reamer,prunty,porath,plunk,piland,philbrook,pettitt,perna,peralez,pascale,padula,oboyle,nivens,nickols,mundt,munden,montijo,mcmanis,mcgrane,mccrimmon,manzi,mangold,malick,mahar,maddock,losey,litten,leedy,leavell,ladue,krahn,kluge,junker,iversen,imler,hurtt,huizar,hubbert,howington,hollomon,holdren,hoisington,heiden,hauge,hartigan,gutirrez,griffie,greenhill,gratton,granata,gottfried,gertz,gautreaux,furry,furey,funderburg,flippen,fitzgibbon,drucker,donoghue,dildy,devers,detweiler,despres,denby,degeorge,cueto,cranston,courville,clukey,cirillo,chivers,caudillo,butera,bulluck,buckmaster,braunstein,bracamonte,bourdeau,bonnette".split(","), +us_tv_and_film:"you,i,to,that,it,me,what,this,know,i'm,no,have,my,don't,just,not,do,be,your,we,it's,so,but,all,well,oh,about,right,you're,get,here,out,going,like,yeah,if,can,up,want,think,that's,now,go,him,how,got,did,why,see,come,good,really,look,will,okay,back,can't,mean,tell,i'll,hey,he's,could,didn't,yes,something,because,say,take,way,little,make,need,gonna,never,we're,too,she's,i've,sure,our,sorry,what's,let,thing,maybe,down,man,very,there's,should,anything,said,much,any,even,off,please,doing,thank,give,thought,help,talk,god,still,wait,find,nothing,again,things,let's,doesn't,call,told,great,better,ever,night,away,believe,feel,everything,you've,fine,last,keep,does,put,around,stop,they're,i'd,guy,isn't,always,listen,wanted,guys,huh,those,big,lot,happened,thanks,won't,trying,kind,wrong,talking,guess,care,bad,mom,remember,getting,we'll,together,dad,leave,understand,wouldn't,actually,hear,baby,nice,father,else,stay,done,wasn't,course,might,mind,every,enough,try,hell,came,someone,you'll,whole,yourself,idea,ask,must,coming,looking,woman,room,knew,tonight,real,son,hope,went,hmm,happy,pretty,saw,girl,sir,friend,already,saying,next,job,problem,minute,thinking,haven't,heard,honey,matter,myself,couldn't,exactly,having,probably,happen,we've,hurt,boy,dead,gotta,alone,excuse,start,kill,hard,you'd,today,car,ready,without,wants,hold,wanna,yet,seen,deal,once,gone,morning,supposed,friends,head,stuff,worry,live,truth,face,forget,true,cause,soon,knows,telling,wife,who's,chance,run,move,anyone,person,bye,somebody,heart,miss,making,meet,anyway,phone,reason,damn,lost,looks,bring,case,turn,wish,tomorrow,kids,trust,check,change,anymore,least,aren't,working,makes,taking,means,brother,hate,ago,says,beautiful,gave,fact,crazy,sit,afraid,important,rest,fun,kid,word,watch,glad,everyone,sister,minutes,everybody,bit,couple,whoa,either,mrs,feeling,daughter,wow,gets,asked,break,promise,door,close,hand,easy,question,tried,far,walk,needs,mine,killed,hospital,anybody,alright,wedding,shut,able,die,perfect,stand,comes,hit,waiting,dinner,funny,husband,almost,pay,answer,cool,eyes,news,child,shouldn't,yours,moment,sleep,read,where's,sounds,sonny,pick,sometimes,bed,date,plan,hours,lose,hands,serious,shit,behind,inside,ahead,week,wonderful,fight,past,cut,quite,he'll,sick,it'll,eat,nobody,goes,save,seems,finally,lives,worried,upset,carly,met,brought,seem,sort,safe,weren't,leaving,front,shot,loved,asking,running,clear,figure,hot,felt,parents,drink,absolutely,how's,daddy,sweet,alive,sense,meant,happens,bet,blood,ain't,kidding,lie,meeting,dear,seeing,sound,fault,ten,buy,hour,speak,lady,jen,thinks,christmas,outside,hang,possible,worse,mistake,ooh,handle,spend,totally,giving,here's,marriage,realize,unless,sex,send,needed,scared,picture,talked,ass,hundred,changed,completely,explain,certainly,sign,boys,relationship,loves,hair,lying,choice,anywhere,future,weird,luck,she'll,turned,touch,kiss,crane,questions,obviously,wonder,pain,calling,somewhere,throw,straight,cold,fast,words,food,none,drive,feelings,they'll,marry,drop,cannot,dream,protect,twenty,surprise,sweetheart,poor,looked,mad,except,gun,y'know,dance,takes,appreciate,especially,situation,besides,pull,hasn't,worth,sheridan,amazing,expect,swear,piece,busy,happening,movie,we'd,catch,perhaps,step,fall,watching,kept,darling,dog,honor,moving,till,admit,problems,murder,he'd,evil,definitely,feels,honest,eye,broke,missed,longer,dollars,tired,evening,starting,entire,trip,niles,suppose,calm,imagine,fair,caught,blame,sitting,favor,apartment,terrible,clean,learn,frasier,relax,accident,wake,prove,smart,message,missing,forgot,interested,table,nbsp,mouth,pregnant,ring,careful,shall,dude,ride,figured,wear,shoot,stick,follow,angry,write,stopped,ran,standing,forgive,jail,wearing,ladies,kinda,lunch,cristian,greenlee,gotten,hoping,phoebe,thousand,ridge,paper,tough,tape,count,boyfriend,proud,agree,birthday,they've,share,offer,hurry,feet,wondering,decision,ones,finish,voice,herself,would've,mess,deserve,evidence,cute,dress,interesting,hotel,enjoy,quiet,concerned,staying,beat,sweetie,mention,clothes,fell,neither,mmm,fix,respect,prison,attention,holding,calls,surprised,bar,keeping,gift,hadn't,putting,dark,owe,ice,helping,normal,aunt,lawyer,apart,plans,jax,girlfriend,floor,whether,everything's,box,judge,upstairs,sake,mommy,possibly,worst,acting,accept,blow,strange,saved,conversation,plane,mama,yesterday,lied,quick,lately,stuck,difference,store,she'd,bought,doubt,listening,walking,cops,deep,dangerous,buffy,sleeping,chloe,rafe,join,card,crime,gentlemen,willing,window,walked,guilty,likes,fighting,difficult,soul,joke,favorite,uncle,promised,bother,seriously,cell,knowing,broken,advice,somehow,paid,losing,push,helped,killing,boss,liked,innocent,rules,learned,thirty,risk,letting,speaking,ridiculous,afternoon,apologize,nervous,charge,patient,boat,how'd,hide,detective,planning,huge,breakfast,horrible,awful,pleasure,driving,hanging,picked,sell,quit,apparently,dying,notice,congratulations,visit,could've,c'mon,letter,decide,forward,fool,showed,smell,seemed,spell,memory,pictures,slow,seconds,hungry,hearing,kitchen,ma'am,should've,realized,kick,grab,discuss,fifty,reading,idiot,suddenly,agent,destroy,bucks,shoes,peace,arms,demon,livvie,consider,papers,incredible,witch,drunk,attorney,tells,knock,ways,gives,nose,skye,turns,keeps,jealous,drug,sooner,cares,plenty,extra,outta,weekend,matters,gosh,opportunity,impossible,waste,pretend,jump,eating,proof,slept,arrest,breathe,perfectly,warm,pulled,twice,easier,goin,dating,suit,romantic,drugs,comfortable,finds,checked,divorce,begin,ourselves,closer,ruin,smile,laugh,treat,fear,what'd,otherwise,excited,mail,hiding,stole,pacey,noticed,fired,excellent,bringing,bottom,note,sudden,bathroom,honestly,sing,foot,remind,charges,witness,finding,tree,dare,hardly,that'll,steal,silly,contact,teach,shop,plus,colonel,fresh,trial,invited,roll,reach,dirty,choose,emergency,dropped,butt,credit,obvious,locked,loving,nuts,agreed,prue,goodbye,condition,guard,fuckin,grow,cake,mood,crap,crying,belong,partner,trick,pressure,dressed,taste,neck,nurse,raise,lots,carry,whoever,drinking,they'd,breaking,file,lock,wine,spot,paying,assume,asleep,turning,viki,bedroom,shower,nikolas,camera,fill,reasons,forty,bigger,nope,breath,doctors,pants,freak,movies,folks,cream,wild,truly,desk,convince,client,threw,hurts,spending,answers,shirt,chair,rough,doin,sees,ought,empty,wind,aware,dealing,pack,tight,hurting,guest,arrested,salem,confused,surgery,expecting,deacon,unfortunately,goddamn,bottle,beyond,whenever,pool,opinion,starts,jerk,secrets,falling,necessary,barely,dancing,tests,copy,cousin,ahem,twelve,tess,skin,fifteen,speech,orders,complicated,nowhere,escape,biggest,restaurant,grateful,usual,burn,address,someplace,screw,everywhere,regret,goodness,mistakes,details,responsibility,suspect,corner,hero,dumb,terrific,whoo,hole,memories,o'clock,teeth,ruined,bite,stenbeck,liar,showing,cards,desperate,search,pathetic,spoke,scare,marah,afford,settle,stayed,checking,hired,heads,concern,blew,alcazar,champagne,connection,tickets,happiness,saving,kissing,hated,personally,suggest,prepared,onto,downstairs,ticket,it'd,loose,holy,duty,convinced,throwing,kissed,legs,loud,saturday,babies,where'd,warning,miracle,carrying,blind,ugly,shopping,hates,sight,bride,coat,clearly,celebrate,brilliant,wanting,forrester,lips,custody,screwed,buying,toast,thoughts,reality,lexie,attitude,advantage,grandfather,sami,grandma,someday,roof,marrying,powerful,grown,grandmother,fake,must've,ideas,exciting,familiar,bomb,bout,harmony,schedule,capable,practically,correct,clue,forgotten,appointment,deserves,threat,bloody,lonely,shame,jacket,hook,scary,investigation,invite,shooting,lesson,criminal,victim,funeral,considering,burning,strength,harder,sisters,pushed,shock,pushing,heat,chocolate,miserable,corinthos,nightmare,brings,zander,crash,chances,sending,recognize,healthy,boring,feed,engaged,headed,treated,knife,drag,badly,hire,paint,pardon,behavior,closet,warn,gorgeous,milk,survive,ends,dump,rent,remembered,thanksgiving,rain,revenge,prefer,spare,pray,disappeared,aside,statement,sometime,meat,fantastic,breathing,laughing,stood,affair,ours,depends,protecting,jury,brave,fingers,murdered,explanation,picking,blah,stronger,handsome,unbelievable,anytime,shake,oakdale,wherever,pulling,facts,waited,lousy,circumstances,disappointed,weak,trusted,license,nothin,trash,understanding,slip,sounded,awake,friendship,stomach,weapon,threatened,mystery,vegas,understood,basically,switch,frankly,cheap,lifetime,deny,clock,garbage,why'd,tear,ears,indeed,changing,singing,tiny,decent,avoid,messed,filled,touched,disappear,exact,pills,kicked,harm,fortune,pretending,insurance,fancy,drove,cared,belongs,nights,lorelai,lift,timing,guarantee,chest,woke,burned,watched,heading,selfish,drinks,doll,committed,elevator,freeze,noise,wasting,ceremony,uncomfortable,staring,files,bike,stress,permission,thrown,possibility,borrow,fabulous,doors,screaming,bone,xander,what're,meal,apology,anger,honeymoon,bail,parking,fixed,wash,stolen,sensitive,stealing,photo,chose,lets,comfort,worrying,pocket,mateo,bleeding,shoulder,ignore,talent,tied,garage,dies,demons,dumped,witches,rude,crack,bothering,radar,soft,meantime,gimme,kinds,fate,concentrate,throat,prom,messages,intend,ashamed,somethin,manage,guilt,interrupt,guts,tongue,shoe,basement,sentence,purse,glasses,cabin,universe,repeat,mirror,wound,travers,tall,engagement,therapy,emotional,jeez,decisions,soup,thrilled,stake,chef,moves,extremely,moments,expensive,counting,shots,kidnapped,cleaning,shift,plate,impressed,smells,trapped,aidan,knocked,charming,attractive,argue,puts,whip,embarrassed,package,hitting,bust,stairs,alarm,pure,nail,nerve,incredibly,walks,dirt,stamp,terribly,friendly,damned,jobs,suffering,disgusting,stopping,deliver,riding,helps,disaster,bars,crossed,trap,talks,eggs,chick,threatening,spoken,introduce,confession,embarrassing,bags,impression,gate,reputation,presents,chat,suffer,argument,talkin,crowd,homework,coincidence,cancel,pride,solve,hopefully,pounds,pine,mate,illegal,generous,outfit,maid,bath,punch,freaked,begging,recall,enjoying,prepare,wheel,defend,signs,painful,yourselves,maris,that'd,suspicious,cooking,button,warned,sixty,pity,yelling,awhile,confidence,offering,pleased,panic,hers,gettin,refuse,grandpa,testify,choices,cruel,mental,gentleman,coma,cutting,proteus,guests,expert,benefit,faces,jumped,toilet,sneak,halloween,privacy,smoking,reminds,twins,swing,solid,options,commitment,crush,ambulance,wallet,gang,eleven,option,laundry,assure,stays,skip,fail,discussion,clinic,betrayed,sticking,bored,mansion,soda,sheriff,suite,handled,busted,load,happier,studying,romance,procedure,commit,assignment,suicide,minds,swim,yell,llanview,chasing,proper,believes,humor,hopes,lawyers,giant,latest,escaped,parent,tricks,insist,dropping,cheer,medication,flesh,routine,sandwich,handed,false,beating,warrant,awfully,odds,treating,thin,suggesting,fever,sweat,silent,clever,sweater,mall,sharing,assuming,judgment,goodnight,divorced,surely,steps,confess,math,listened,comin,answered,vulnerable,bless,dreaming,chip,zero,pissed,nate,kills,tears,knees,chill,brains,unusual,packed,dreamed,cure,lookin,grave,cheating,breaks,locker,gifts,awkward,thursday,joking,reasonable,dozen,curse,quartermaine,millions,dessert,rolling,detail,alien,delicious,closing,vampires,wore,tail,secure,salad,murderer,spit,offense,dust,conscience,bread,answering,lame,invitation,grief,smiling,pregnancy,prisoner,delivery,guards,virus,shrink,freezing,wreck,massimo,wire,technically,blown,anxious,cave,holidays,cleared,wishes,caring,candles,bound,charm,pulse,jumping,jokes,boom,occasion,silence,nonsense,frightened,slipped,dimera,blowing,relationships,kidnapping,spin,tool,roxy,packing,blaming,wrap,obsessed,fruit,torture,personality,there'll,fairy,necessarily,seventy,print,motel,underwear,grams,exhausted,believing,freaking,carefully,trace,touching,messing,recovery,intention,consequences,belt,sacrifice,courage,enjoyed,attracted,remove,testimony,intense,heal,defending,unfair,relieved,loyal,slowly,buzz,alcohol,surprises,psychiatrist,plain,attic,who'd,uniform,terrified,cleaned,zach,threaten,fella,enemies,satisfied,imagination,hooked,headache,forgetting,counselor,andie,acted,badge,naturally,frozen,sakes,appropriate,trunk,dunno,costume,sixteen,impressive,kicking,junk,grabbed,understands,describe,clients,owns,affect,witnesses,starving,instincts,happily,discussing,deserved,strangers,surveillance,admire,questioning,dragged,barn,deeply,wrapped,wasted,tense,hoped,fellas,roommate,mortal,fascinating,stops,arrangements,agenda,literally,propose,honesty,underneath,sauce,promises,lecture,eighty,torn,shocked,backup,differently,ninety,deck,biological,pheebs,ease,creep,waitress,telephone,ripped,raising,scratch,rings,prints,thee,arguing,ephram,asks,oops,diner,annoying,taggert,sergeant,blast,towel,clown,habit,creature,bermuda,snap,react,paranoid,handling,eaten,therapist,comment,sink,reporter,nurses,beats,priority,interrupting,warehouse,loyalty,inspector,pleasant,excuses,threats,guessing,tend,praying,motive,unconscious,mysterious,unhappy,tone,switched,rappaport,sookie,neighbor,loaded,swore,piss,balance,toss,misery,thief,squeeze,lobby,goa'uld,geez,exercise,forth,booked,sandburg,poker,eighteen,d'you,bury,everyday,digging,creepy,wondered,liver,hmmm,magical,fits,discussed,moral,helpful,searching,flew,depressed,aisle,cris,amen,vows,neighbors,darn,cents,arrange,annulment,useless,adventure,resist,fourteen,celebrating,inch,debt,violent,sand,teal'c,celebration,reminded,phones,paperwork,emotions,stubborn,pound,tension,stroke,steady,overnight,chips,beef,suits,boxes,cassadine,collect,tragedy,spoil,realm,wipe,surgeon,stretch,stepped,nephew,neat,limo,confident,perspective,climb,punishment,finest,springfield,hint,furniture,blanket,twist,proceed,fries,worries,niece,gloves,soap,signature,disappoint,crawl,convicted,flip,counsel,doubts,crimes,accusing,shaking,remembering,hallway,halfway,bothered,madam,gather,cameras,blackmail,symptoms,rope,ordinary,imagined,cigarette,supportive,explosion,trauma,ouch,furious,cheat,avoiding,whew,thick,oooh,boarding,approve,urgent,shhh,misunderstanding,drawer,phony,interfere,catching,bargain,tragic,respond,punish,penthouse,thou,rach,ohhh,insult,bugs,beside,begged,absolute,strictly,socks,senses,sneaking,reward,polite,checks,tale,physically,instructions,fooled,blows,tabby,bitter,adorable,y'all,tested,suggestion,jewelry,alike,jacks,distracted,shelter,lessons,constable,circus,audition,tune,shoulders,mask,helpless,feeding,explains,sucked,robbery,objection,behave,valuable,shadows,courtroom,confusing,talented,smarter,mistaken,customer,bizarre,scaring,motherfucker,alert,vecchio,reverend,foolish,compliment,bastards,worker,wheelchair,protective,gentle,reverse,picnic,knee,cage,wives,wednesday,voices,toes,stink,scares,pour,cheated,slide,ruining,filling,exit,cottage,upside,proves,parked,diary,complaining,confessed,pipe,merely,massage,chop,spill,prayer,betray,waiter,scam,rats,fraud,brush,tables,sympathy,pill,filthy,seventeen,employee,bracelet,pays,fairly,deeper,arrive,tracking,spite,shed,recommend,oughta,nanny,menu,diet,corn,roses,patch,dime,devastated,subtle,bullets,beans,pile,confirm,strings,parade,borrowed,toys,straighten,steak,premonition,planted,honored,exam,convenient,traveling,laying,insisted,dish,aitoro,kindly,grandson,donor,temper,teenager,proven,mothers,denial,backwards,tent,swell,noon,happiest,drives,thinkin,spirits,potion,holes,fence,whatsoever,rehearsal,overheard,lemme,hostage,bench,tryin,taxi,shove,moron,impress,needle,intelligent,instant,disagree,stinks,rianna,recover,groom,gesture,constantly,bartender,suspects,sealed,legally,hears,dresses,sheet,psychic,teenage,knocking,judging,accidentally,waking,rumor,manners,homeless,hollow,desperately,tapes,referring,item,genoa,gear,majesty,cried,tons,spells,instinct,quote,motorcycle,convincing,fashioned,aids,accomplished,grip,bump,upsetting,needing,invisible,forgiveness,feds,compare,bothers,tooth,inviting,earn,compromise,cocktail,tramp,jabot,intimate,dignity,dealt,souls,informed,gods,dressing,cigarettes,alistair,leak,fond,corky,seduce,liquor,fingerprints,enchantment,butters,stuffed,stavros,emotionally,transplant,tips,oxygen,nicely,lunatic,drill,complain,announcement,unfortunate,slap,prayers,plug,opens,oath,o'neill,mutual,yacht,remembers,fried,extraordinary,bait,warton,sworn,stare,safely,reunion,burst,might've,dive,aboard,expose,buddies,trusting,booze,sweep,sore,scudder,properly,parole,ditch,canceled,speaks,glow,wears,thirsty,skull,ringing,dorm,dining,bend,unexpected,pancakes,harsh,flattered,ahhh,troubles,fights,favourite,eats,rage,undercover,spoiled,sloane,shine,destroying,deliberately,conspiracy,thoughtful,sandwiches,plates,nails,miracles,fridge,drank,contrary,beloved,allergic,washed,stalking,solved,sack,misses,forgiven,bent,maciver,involve,dragging,cooked,pointing,foul,dull,beneath,heels,faking,deaf,stunt,jealousy,hopeless,fears,cuts,scenario,necklace,crashed,accuse,restraining,homicide,helicopter,firing,safer,auction,videotape,tore,reservations,pops,appetite,wounds,vanquish,ironic,fathers,excitement,anyhow,tearing,sends,rape,laughed,belly,dealer,cooperate,accomplish,wakes,spotted,sorts,reservation,ashes,tastes,supposedly,loft,intentions,integrity,wished,towels,suspected,investigating,inappropriate,lipstick,lawn,compassion,cafeteria,scarf,precisely,obsession,loses,lighten,infection,granddaughter,explode,balcony,this'll,spying,publicity,depend,cracked,conscious,ally,absurd,vicious,invented,forbid,directions,defendant,bare,announce,screwing,salesman,robbed,leap,lakeview,insanity,reveal,possibilities,kidnap,gown,chairs,wishing,setup,punished,criminals,regrets,raped,quarters,lamp,dentist,anyways,anonymous,semester,risks,owes,lungs,explaining,delicate,tricked,eager,doomed,adoption,stab,sickness,scum,floating,envelope,vault,sorel,pretended,potatoes,plea,photograph,payback,misunderstood,kiddo,healing,cascade,capeside,stabbed,remarkable,brat,privilege,passionate,nerves,lawsuit,kidney,disturbed,cozy,tire,shirts,oven,ordering,delay,risky,monsters,honorable,grounded,closest,breakdown,bald,abandon,scar,collar,worthless,sucking,enormous,disturbing,disturb,distract,deals,conclusions,vodka,dishes,crawling,briefcase,wiped,whistle,sits,roast,rented,pigs,flirting,deposit,bottles,topic,riot,overreacting,logical,hostile,embarrass,casual,beacon,amusing,altar,claus,survival,skirt,shave,porch,ghosts,favors,drops,dizzy,chili,advise,strikes,rehab,photographer,peaceful,leery,heavens,fortunately,fooling,expectations,cigar,weakness,ranch,practicing,examine,cranes,bribe,sail,prescription,hush,fragile,forensics,expense,drugged,cows,bells,visitor,suitcase,sorta,scan,manticore,insecure,imagining,hardest,clerk,wrist,what'll,starters,silk,pump,pale,nicer,haul,flies,boot,thumb,there'd,how're,elders,quietly,pulls,idiots,erase,denying,ankle,amnesia,accepting,heartbeat,devane,confront,minus,legitimate,fixing,arrogant,tuna,supper,slightest,sins,sayin,recipe,pier,paternity,humiliating,genuine,snack,rational,minded,guessed,weddings,tumor,humiliated,aspirin,spray,picks,eyed,drowning,contacts,ritual,perfume,hiring,hating,docks,creatures,visions,thanking,thankful,sock,nineteen,fork,throws,teenagers,stressed,slice,rolls,plead,ladder,kicks,detectives,assured,tellin,shallow,responsibilities,repay,howdy,girlfriends,deadly,comforting,ceiling,verdict,insensitive,spilled,respected,messy,interrupted,halliwell,blond,bleed,wardrobe,takin,murders,backs,underestimate,justify,harmless,frustrated,fold,enzo,communicate,bugging,arson,whack,salary,rumors,obligation,liking,dearest,congratulate,vengeance,rack,puzzle,fires,courtesy,caller,blamed,tops,quiz,prep,curiosity,circles,barbecue,sunnydale,spinning,psychotic,cough,accusations,resent,laughs,freshman,envy,drown,bartlet,asses,sofa,poster,highness,dock,apologies,theirs,stat,stall,realizes,psych,mmmm,fools,understandable,treats,succeed,stir,relaxed,makin,gratitude,faithful,accent,witter,wandering,locate,inevitable,gretel,deed,crushed,controlling,smelled,robe,gossip,gambling,cosmetics,accidents,surprising,stiff,sincere,rushed,refrigerator,preparing,nightmares,mijo,ignoring,hunch,fireworks,drowned,brass,whispering,sophisticated,luggage,hike,explore,emotion,crashing,contacted,complications,shining,rolled,righteous,reconsider,goody,geek,frightening,ethics,creeps,courthouse,camping,affection,smythe,haircut,essay,baked,apologized,vibe,respects,receipt,mami,hats,destructive,adore,adopt,tracked,shorts,reminding,dough,creations,cabot,barrel,snuck,slight,reporters,pressing,magnificent,madame,lazy,glorious,fiancee,bits,visitation,sane,kindness,shoulda,rescued,mattress,lounge,lifted,importantly,glove,enterprises,disappointment,condo,beings,admitting,yelled,waving,spoon,screech,satisfaction,reads,nailed,worm,tick,resting,marvelous,fuss,cortlandt,chased,pockets,luckily,lilith,filing,conversations,consideration,consciousness,worlds,innocence,forehead,aggressive,trailer,slam,quitting,inform,delighted,daylight,danced,confidential,aunts,washing,tossed,spectra,marrow,lined,implying,hatred,grill,corpse,clues,sober,offended,morgue,infected,humanity,distraction,cart,wired,violation,promising,harassment,glue,d'angelo,cursed,brutal,warlocks,wagon,unpleasant,proving,priorities,mustn't,lease,flame,disappearance,depressing,thrill,sitter,ribs,flush,earrings,deadline,corporal,collapsed,update,snapped,smack,melt,figuring,delusional,coulda,burnt,tender,sperm,realise,pork,popped,interrogation,esteem,choosing,undo,pres,prayed,plague,manipulate,insulting,detention,delightful,coffeehouse,betrayal,apologizing,adjust,wrecked,wont,whipped,rides,reminder,monsieur,faint,bake,distress,correctly,complaint,blocked,tortured,risking,pointless,handing,dumping,cups,alibi,struggling,shiny,risked,mummy,mint,hose,hobby,fortunate,fleischman,fitting,curtain,counseling,rode,puppet,modeling,memo,irresponsible,humiliation,hiya,freakin,felony,choke,blackmailing,appreciated,tabloid,suspicion,recovering,pledge,panicked,nursery,louder,jeans,investigator,homecoming,frustrating,buys,busting,buff,sleeve,irony,dope,declare,autopsy,workin,torch,prick,limb,hysterical,goddamnit,fetch,dimension,crowded,clip,climbing,bonding,woah,trusts,negotiate,lethal,iced,fantasies,deeds,bore,babysitter,questioned,outrageous,kiriakis,insulted,grudge,driveway,deserted,definite,beep,wires,suggestions,searched,owed,lend,drunken,demanding,costanza,conviction,bumped,weigh,touches,tempted,shout,resolve,relate,poisoned,meals,invitations,haunted,bogus,autograph,affects,tolerate,stepping,spontaneous,sleeps,probation,manny,fist,spectacular,hostages,heroin,havin,habits,encouraging,consult,burgers,boyfriends,bailed,baggage,watches,troubled,torturing,teasing,sweetest,qualities,postpone,overwhelmed,malkovich,impulse,classy,charging,amazed,policeman,hypocrite,humiliate,hideous,d'ya,costumes,bluffing,betting,bein,bedtime,alcoholic,vegetable,tray,suspicions,spreading,splendid,shrimp,shouting,pressed,nooo,grieving,gladly,fling,eliminate,cereal,aaah,sonofabitch,paralyzed,lotta,locks,guaranteed,dummy,despise,dental,briefing,bluff,batteries,whatta,sounding,servants,presume,handwriting,fainted,dried,allright,acknowledge,whacked,toxic,reliable,quicker,overwhelming,lining,harassing,fatal,endless,dolls,convict,whatcha,unlikely,shutting,positively,overcome,goddam,essence,dose,diagnosis,cured,bully,ahold,yearbook,tempting,shelf,prosecution,pouring,possessed,greedy,wonders,thorough,spine,rath,psychiatric,meaningless,latte,jammed,ignored,fiance,evidently,contempt,compromised,cans,weekends,urge,theft,suing,shipment,scissors,responding,proposition,noises,matching,hormones,hail,grandchildren,gently,smashed,sexually,sentimental,nicest,manipulated,intern,handcuffs,framed,errands,entertaining,crib,carriage,barge,spends,slipping,seated,rubbing,rely,reject,recommendation,reckon,headaches,float,embrace,corners,whining,sweating,skipped,mountie,motives,listens,cristobel,cleaner,cheerleader,balsom,unnecessary,stunning,scent,quartermaines,pose,montega,loosen,info,hottest,haunt,gracious,forgiving,errand,cakes,blames,abortion,sketch,shifts,plotting,perimeter,pals,mere,mattered,lonigan,interference,eyewitness,enthusiasm,diapers,strongest,shaken,punched,portal,catches,backyard,terrorists,sabotage,organs,needy,cuff,civilization,woof,who'll,prank,obnoxious,mates,hereby,gabby,faked,cellar,whitelighter,void,strangle,sour,muffins,interfering,demonic,clearing,boutique,barrington,terrace,smoked,righty,quack,petey,pact,knot,ketchup,disappearing,cordy,uptight,ticking,terrifying,tease,swamp,secretly,rejection,reflection,realizing,rays,mentally,marone,doubted,deception,congressman,cheesy,toto,stalling,scoop,ribbon,immune,expects,destined,bets,bathing,appreciation,accomplice,wander,shoved,sewer,scroll,retire,lasts,fugitive,freezer,discount,cranky,crank,clearance,bodyguard,anxiety,accountant,whoops,volunteered,talents,stinking,remotely,garlic,decency,cord,beds,altogether,uniforms,tremendous,popping,outa,observe,lung,hangs,feelin,dudes,donation,disguise,curb,bites,antique,toothbrush,realistic,predict,landlord,hourglass,hesitate,consolation,babbling,tipped,stranded,smartest,repeating,puke,psst,paycheck,overreacted,macho,juvenile,grocery,freshen,disposal,cuffs,caffeine,vanished,unfinished,ripping,pinch,flattering,expenses,dinners,colleague,ciao,belthazor,attorneys,woulda,whereabouts,waitin,truce,tripped,tasted,steer,poisoning,manipulative,immature,husbands,heel,granddad,delivering,condoms,addict,trashed,raining,pasta,needles,leaning,detector,coolest,batch,appointments,almighty,vegetables,spark,perfection,pains,momma,mole,meow,hairs,getaway,cracking,compliments,behold,verge,tougher,timer,tapped,taped,specialty,snooping,shoots,rendezvous,pentagon,leverage,jeopardize,janitor,grandparents,forbidden,clueless,bidding,ungrateful,unacceptable,tutor,serum,scuse,pajamas,mouths,lure,irrational,doom,cries,beautifully,arresting,approaching,traitor,sympathetic,smug,smash,rental,prostitute,premonitions,jumps,inventory,darlin,committing,banging,asap,worms,violated,vent,traumatic,traced,sweaty,shaft,overboard,insight,healed,grasp,experiencing,crappy,crab,chunk,awww,stain,shack,reacted,pronounce,poured,moms,marriages,jabez,handful,flipped,fireplace,embarrassment,disappears,concussion,bruises,brakes,twisting,swept,summon,splitting,sloppy,settling,reschedule,notch,hooray,grabbing,exquisite,disrespect,thornhart,straw,slapped,shipped,shattered,ruthless,refill,payroll,numb,mourning,manly,hunk,entertain,drift,dreadful,doorstep,confirmation,chops,appreciates,vague,tires,stressful,stashed,stash,sensed,preoccupied,predictable,noticing,madly,gunshot,dozens,dork,confuse,cleaners,charade,chalk,cappuccino,bouquet,amulet,addiction,who've,warming,unlock,satisfy,sacrificed,relaxing,lone,blocking,blend,blankets,addicted,yuck,hunger,hamburger,greeting,greet,gravy,gram,dreamt,dice,caution,backpack,agreeing,whale,taller,supervisor,sacrifices,phew,ounce,irrelevant,gran,felon,favorites,farther,fade,erased,easiest,convenience,compassionate,cane,backstage,agony,adores,veins,tweek,thieves,surgical,strangely,stetson,recital,proposing,productive,meaningful,immunity,hassle,goddamned,frighten,dearly,cease,ambition,wage,unstable,salvage,richer,refusing,raging,pumping,pressuring,mortals,lowlife,intimidated,intentionally,inspire,forgave,devotion,despicable,deciding,dash,comfy,breach,bark,aaaah,switching,swallowed,stove,screamed,scars,russians,pounding,poof,pipes,pawn,legit,invest,farewell,curtains,civilized,caviar,boost,token,superstition,supernatural,sadness,recorder,psyched,motivated,microwave,hallelujah,fraternity,dryer,cocoa,chewing,acceptable,unbelievably,smiled,smelling,simpler,respectable,remarks,khasinau,indication,gutter,grabs,fulfill,flashlight,ellenor,blooded,blink,blessings,beware,uhhh,turf,swings,slips,shovel,shocking,puff,mirrors,locking,heartless,fras,childish,cardiac,utterly,tuscany,ticked,stunned,statesville,sadly,purely,kiddin,jerks,hitch,flirt,fare,equals,dismiss,christening,casket,c'mere,breakup,biting,antibiotics,accusation,abducted,witchcraft,thread,runnin,punching,paramedics,newest,murdering,masks,lawndale,initials,grampa,choking,charms,careless,bushes,buns,bummed,shred,saves,saddle,rethink,regards,precinct,persuade,meds,manipulating,llanfair,leash,hearted,guarantees,fucks,disgrace,deposition,bookstore,boil,vitals,veil,trespassing,sidewalk,sensible,punishing,overtime,optimistic,obsessing,notify,mornin,jeopardy,jaffa,injection,hilarious,desires,confide,cautious,yada,where're,vindictive,vial,teeny,stroll,sittin,scrub,rebuild,posters,ordeal,nuns,intimacy,inheritance,exploded,donate,distracting,despair,crackers,wildwind,virtue,thoroughly,tails,spicy,sketches,sights,sheer,shaving,seize,scarecrow,refreshing,prosecute,platter,napkin,misplaced,merchandise,loony,jinx,heroic,frankenstein,ambitious,syrup,solitary,resemblance,reacting,premature,lavery,flashes,cheque,awright,acquainted,wrapping,untie,salute,realised,priceless,partying,lightly,lifting,kasnoff,insisting,glowing,generator,explosives,cutie,confronted,buts,blouse,ballistic,antidote,analyze,allowance,adjourned,unto,understatement,tucked,touchy,subconscious,screws,sarge,roommates,rambaldi,offend,nerd,knives,irresistible,incapable,hostility,goddammit,fuse,frat,curfew,blackmailed,walkin,starve,sleigh,sarcastic,recess,rebound,pinned,parlor,outfits,livin,heartache,haired,fundraiser,doorman,discreet,dilucca,cracks,considerate,climbed,catering,apophis,zoey,urine,strung,stitches,sordid,sark,protector,phoned,pets,hostess,flaw,flavor,deveraux,consumed,confidentiality,bourbon,straightened,specials,spaghetti,prettier,powerless,playin,playground,paranoia,instantly,havoc,exaggerating,eavesdropping,doughnuts,diversion,deepest,cutest,comb,bela,behaving,anyplace,accessory,workout,translate,stuffing,speeding,slime,royalty,polls,marital,lurking,lottery,imaginary,greetings,fairwinds,elegant,elbow,credibility,credentials,claws,chopped,bridal,bedside,babysitting,witty,unforgivable,underworld,tempt,tabs,sophomore,selfless,secrecy,restless,okey,movin,metaphor,messes,meltdown,lecter,incoming,gasoline,diefenbaker,buckle,admired,adjustment,warmth,throats,seduced,queer,parenting,noses,luckiest,graveyard,gifted,footsteps,dimeras,cynical,wedded,verbal,unpredictable,tuned,stoop,slides,sinking,rigged,plumbing,lingerie,hankey,greed,everwood,elope,dresser,chauffeur,bulletin,bugged,bouncing,temptation,strangest,slammed,sarcasm,pending,packages,orderly,obsessive,murderers,meteor,inconvenience,glimpse,froze,execute,courageous,consulate,closes,bosses,bees,amends,wuss,wolfram,wacky,unemployed,testifying,syringe,stew,startled,sorrow,sleazy,shaky,screams,rsquo,remark,poke,nutty,mentioning,mend,inspiring,impulsive,housekeeper,foam,fingernails,conditioning,baking,whine,thug,starved,sniffing,sedative,programmed,picket,paged,hound,homosexual,homo,hips,forgets,flipping,flea,flatter,dwell,dumpster,choo,assignments,ants,vile,unreasonable,tossing,thanked,steals,souvenir,scratched,psychopath,outs,obstruction,obey,lump,insists,harass,gloat,filth,edgy,didn,coroner,confessing,bruise,betraying,bailing,appealing,adebisi,wrath,wandered,waist,vain,traps,stepfather,poking,obligated,heavenly,dilemma,crazed,contagious,coaster,cheering,bundle,vomit,thingy,speeches,robbing,raft,pumped,pillows,peep,packs,neglected,m'kay,loneliness,intrude,helluva,gardener,forresters,drooling,betcha,vase,supermarket,squat,spitting,rhyme,relieve,receipts,racket,pictured,pause,overdue,motivation,morgendorffer,kidnapper,insect,horns,feminine,eyeballs,dumps,disappointing,crock,convertible,claw,clamp,canned,cambias,bathtub,avanya,artery,weep,warmer,suspense,summoned,spiders,reiber,raving,pushy,postponed,ohhhh,noooo,mold,laughter,incompetent,hugging,groceries,drip,communicating,auntie,adios,wraps,wiser,willingly,weirdest,timmih,thinner,swelling,swat,steroids,sensitivity,scrape,rehearse,prophecy,ledge,justified,insults,hateful,handles,doorway,chatting,buyer,buckaroo,bedrooms,askin,ammo,tutoring,subpoena,scratching,privileges,pager,mart,intriguing,idiotic,grape,enlighten,corrupt,brunch,bridesmaid,barking,applause,acquaintance,wretched,superficial,soak,smoothly,sensing,restraint,posing,pleading,payoff,oprah,nemo,morals,loaf,jumpy,ignorant,herbal,hangin,germs,generosity,flashing,doughnut,clumsy,chocolates,captive,behaved,apologise,vanity,stumbled,preview,poisonous,perjury,parental,onboard,mugged,minding,linen,knots,interviewing,humour,grind,greasy,goons,drastic,coop,comparing,cocky,clearer,bruised,brag,bind,worthwhile,whoop,vanquishing,tabloids,sprung,spotlight,sentencing,racist,provoke,pining,overly,locket,imply,impatient,hovering,hotter,fest,endure,dots,doren,debts,crawled,chained,brit,breaths,weirdo,warmed,wand,troubling,tok'ra,strapped,soaked,skipping,scrambled,rattle,profound,musta,mocking,misunderstand,limousine,kacl,hustle,forensic,enthusiastic,duct,drawers,devastating,conquer,clarify,chores,cheerleaders,cheaper,callin,blushing,barging,abused,yoga,wrecking,wits,waffles,virginity,vibes,uninvited,unfaithful,teller,strangled,scheming,ropes,rescuing,rave,postcard,o'reily,morphine,lotion,lads,kidneys,judgement,itch,indefinitely,grenade,glamorous,genetically,freud,discretion,delusions,crate,competent,bakery,argh,ahhhh,wedge,wager,unfit,tripping,torment,superhero,stirring,spinal,sorority,seminar,scenery,rabble,pneumonia,perks,override,ooooh,mija,manslaughter,mailed,lime,lettuce,intimidate,guarded,grieve,grad,frustration,doorbell,chinatown,authentic,arraignment,annulled,allergies,wanta,verify,vegetarian,tighter,telegram,stalk,spared,shoo,satisfying,saddam,requesting,pens,overprotective,obstacles,notified,nasedo,grandchild,genuinely,flushed,fluids,floss,escaping,ditched,cramp,corny,bunk,bitten,billions,bankrupt,yikes,wrists,ultrasound,ultimatum,thirst,sniff,shakes,salsa,retrieve,reassuring,pumps,neurotic,negotiating,needn't,monitors,millionaire,lydecker,limp,incriminating,hatchet,gracias,gordie,fills,feeds,doubting,decaf,biopsy,whiz,voluntarily,ventilator,unpack,unload,toad,spooked,snitch,schillinger,reassure,persuasive,mystical,mysteries,matrimony,mails,jock,headline,explanations,dispatch,curly,cupid,condolences,comrade,cassadines,bulb,bragging,awaits,assaulted,ambush,adolescent,abort,yank,whit,vaguely,undermine,tying,swamped,stabbing,slippers,slash,sincerely,sigh,setback,secondly,rotting,precaution,pcpd,melting,liaison,hots,hooking,headlines,haha,ganz,fury,felicity,fangs,encouragement,earring,dreidel,dory,donut,dictate,decorating,cocktails,bumps,blueberry,believable,backfired,backfire,apron,adjusting,vous,vouch,vitamins,ummm,tattoos,slimy,sibling,shhhh,renting,peculiar,parasite,paddington,marries,mailbox,magically,lovebirds,knocks,informant,exits,drazen,distractions,disconnected,dinosaurs,dashwood,crooked,conveniently,wink,warped,underestimated,tacky,shoving,seizure,reset,pushes,opener,mornings,mash,invent,indulge,horribly,hallucinating,festive,eyebrows,enjoys,desperation,dealers,darkest,daph,boragora,belts,bagel,authorization,auditions,agitated,wishful,wimp,vanish,unbearable,tonic,suffice,suction,slaying,safest,rocking,relive,puttin,prettiest,noisy,newlyweds,nauseous,misguided,mildly,midst,liable,judgmental,indy,hunted,givin,fascinated,elephants,dislike,deluded,decorate,crummy,contractions,carve,bottled,bonded,bahamas,unavailable,twenties,trustworthy,surgeons,stupidity,skies,remorse,preferably,pies,nausea,napkins,mule,mourn,melted,mashed,inherit,greatness,golly,excused,dumbo,drifting,delirious,damaging,cubicle,compelled,comm,chooses,checkup,boredom,bandages,alarms,windshield,who're,whaddya,transparent,surprisingly,sunglasses,slit,roar,reade,prognosis,probe,pitiful,persistent,peas,nosy,nagging,morons,masterpiece,martinis,limbo,liars,irritating,inclined,hump,hoynes,fiasco,eatin,cubans,concentrating,colorful,clam,cider,brochure,barto,bargaining,wiggle,welcoming,weighing,vanquished,stains,sooo,snacks,smear,sire,resentment,psychologist,pint,overhear,morality,landingham,kisser,hoot,holling,handshake,grilled,formality,elevators,depths,confirms,boathouse,accidental,westbridge,wacko,ulterior,thugs,thighs,tangled,stirred,snag,sling,sleaze,rumour,ripe,remarried,puddle,pins,perceptive,miraculous,longing,lockup,librarian,impressions,immoral,hypothetically,guarding,gourmet,gabe,faxed,extortion,downright,digest,cranberry,bygones,buzzing,burying,bikes,weary,taping,takeout,sweeping,stepmother,stale,senor,seaborn,pros,pepperoni,newborn,ludicrous,injected,geeks,forged,faults,drue,dire,dief,desi,deceiving,caterer,calmed,budge,ankles,vending,typing,tribbiani,there're,squared,snowing,shades,sexist,rewrite,regretted,raises,picky,orphan,mural,misjudged,miscarriage,memorize,leaking,jitters,invade,interruption,illegally,handicapped,glitch,gittes,finer,distraught,dispose,dishonest,digs,dads,cruelty,circling,canceling,butterflies,belongings,barbrady,amusement,alias,zombies,where've,unborn,swearing,stables,squeezed,sensational,resisting,radioactive,questionable,privileged,portofino,owning,overlook,orson,oddly,interrogate,imperative,impeccable,hurtful,hors,heap,graders,glance,disgust,devious,destruct,crazier,countdown,chump,cheeseburger,burglar,berries,ballroom,assumptions,annoyed,allergy,admirer,admirable,activate,underpants,twit,tack,strokes,stool,sham,scrap,retarded,resourceful,remarkably,refresh,pressured,precautions,pointy,nightclub,mustache,maui,lace,hunh,hubby,flare,dont,dokey,dangerously,crushing,clinging,choked,chem,cheerleading,checkbook,cashmere,calmly,blush,believer,amazingly,alas,what've,toilets,tacos,stairwell,spirited,sewing,rubbed,punches,protects,nuisance,motherfuckers,mingle,kynaston,knack,kinkle,impose,gullible,godmother,funniest,friggin,folding,fashions,eater,dysfunctional,drool,dripping,ditto,cruising,criticize,conceive,clone,cedars,caliber,brighter,blinded,birthdays,banquet,anticipate,annoy,whim,whichever,volatile,veto,vested,shroud,rests,reindeer,quarantine,pleases,painless,orphans,orphanage,offence,obliged,negotiation,narcotics,mistletoe,meddling,manifest,lookit,lilah,intrigued,injustice,homicidal,gigantic,exposing,elves,disturbance,disastrous,depended,demented,correction,cooped,cheerful,buyers,brownies,beverage,basics,arvin,weighs,upsets,unethical,swollen,sweaters,stupidest,sensation,scalpel,props,prescribed,pompous,objections,mushrooms,mulwray,manipulation,lured,internship,insignificant,inmate,incentive,fulfilled,disagreement,crypt,cornered,copied,brightest,beethoven,attendant,amaze,yogurt,wyndemere,vocabulary,tulsa,tactic,stuffy,respirator,pretends,polygraph,pennies,ordinarily,olives,necks,morally,martyr,leftovers,joints,hopping,homey,hints,heartbroken,forge,florist,firsthand,fiend,dandy,crippled,corrected,conniving,conditioner,clears,chemo,bubbly,bladder,beeper,baptism,wiring,wench,weaknesses,volunteering,violating,unlocked,tummy,surrogate,subid,stray,startle,specifics,slowing,scoot,robbers,rightful,richest,qfxmjrie,puffs,pierced,pencils,paralysis,makeover,luncheon,linksynergy,jerky,jacuzzi,hitched,hangover,fracture,flock,firemen,disgusted,darned,clams,borrowing,banged,wildest,weirder,unauthorized,stunts,sleeves,sixties,shush,shalt,retro,quits,pegged,painfully,paging,omelet,memorized,lawfully,jackets,intercept,ingredient,grownup,glued,fulfilling,enchanted,delusion,daring,compelling,carton,bridesmaids,bribed,boiling,bathrooms,bandage,awaiting,assign,arrogance,antiques,ainsley,turkeys,trashing,stockings,stalked,stabilized,skates,sedated,robes,respecting,psyche,presumptuous,prejudice,paragraph,mocha,mints,mating,mantan,lorne,loads,listener,itinerary,hepatitis,heave,guesses,fading,examining,dumbest,dishwasher,deceive,cunning,cripple,convictions,confided,compulsive,compromising,burglary,bumpy,brainwashed,benes,arnie,affirmative,adrenaline,adamant,watchin,waitresses,transgenic,toughest,tainted,surround,stormed,spree,spilling,spectacle,soaking,shreds,sewers,severed,scarce,scamming,scalp,rewind,rehearsing,pretentious,potions,overrated,obstacle,nerds,meems,mcmurphy,maternity,maneuver,loathe,fertility,eloping,ecstatic,ecstasy,divorcing,dignan,costing,clubhouse,clocks,candid,bursting,breather,braces,bending,arsonist,adored,absorb,valiant,uphold,unarmed,topolsky,thrilling,thigh,terminate,sustain,spaceship,snore,sneeze,smuggling,salty,quaint,patronize,patio,morbid,mamma,kettle,joyous,invincible,interpret,insecurities,impulses,illusions,holed,exploit,drivin,defenseless,dedicate,cradle,coupon,countless,conjure,cardboard,booking,backseat,accomplishment,wordsworth,wisely,valet,vaccine,urges,unnatural,unlucky,truths,traumatized,tasting,swears,strawberries,steaks,stats,skank,seducing,secretive,scumbag,screwdriver,schedules,rooting,rightfully,rattled,qualifies,puppets,prospects,pronto,posse,polling,pedestal,palms,muddy,morty,microscope,merci,lecturing,inject,incriminate,hygiene,grapefruit,gazebo,funnier,cuter,bossy,booby,aides,zende,winthrop,warrants,valentines,undressed,underage,truthfully,tampered,suffers,speechless,sparkling,sidelines,shrek,railing,puberty,pesky,outrage,outdoors,motions,moods,lunches,litter,kidnappers,itching,intuition,imitation,humility,hassling,gallons,drugstore,dosage,disrupt,dipping,deranged,debating,cuckoo,cremated,craziness,cooperating,circumstantial,chimney,blinking,biscuits,admiring,weeping,triad,trashy,soothing,slumber,slayers,skirts,siren,shindig,sentiment,rosco,riddance,quaid,purity,proceeding,pretzels,panicking,mckechnie,lovin,leaked,intruding,impersonating,ignorance,hamburgers,footprints,fluke,fleas,festivities,fences,feisty,evacuate,emergencies,deceived,creeping,craziest,corpses,conned,coincidences,bounced,bodyguards,blasted,bitterness,baloney,ashtray,apocalypse,zillion,watergate,wallpaper,telesave,sympathize,sweeter,startin,spades,sodas,snowed,sleepover,signor,seein,retainer,restroom,rested,repercussions,reliving,reconcile,prevail,preaching,overreact,o'neil,noose,moustache,manicure,maids,landlady,hypothetical,hopped,homesick,hives,hesitation,herbs,hectic,heartbreak,haunting,gangs,frown,fingerprint,exhausting,everytime,disregard,cling,chevron,chaperone,blinding,bitty,beads,battling,badgering,anticipation,upstanding,unprofessional,unhealthy,turmoil,truthful,toothpaste,tippin,thoughtless,tagataya,shooters,senseless,rewarding,propane,preposterous,pigeons,pastry,overhearing,obscene,negotiable,loner,jogging,itchy,insinuating,insides,hospitality,hormone,hearst,forthcoming,fists,fifties,etiquette,endings,destroys,despises,deprived,cuddy,crust,cloak,circumstance,chewed,casserole,bidder,bearer,artoo,applaud,appalling,vowed,virgins,vigilante,undone,throttle,testosterone,tailor,symptom,swoop,suitcases,stomp,sticker,stakeout,spoiling,snatched,smoochy,smitten,shameless,restraints,researching,renew,refund,reclaim,raoul,puzzles,purposely,punks,prosecuted,plaid,picturing,pickin,parasites,mysteriously,multiply,mascara,jukebox,interruptions,gunfire,furnace,elbows,duplicate,drapes,deliberate,decoy,cryptic,coupla,condemn,complicate,colossal,clerks,clarity,brushed,banished,argon,alarmed,worships,versa,uncanny,technicality,sundae,stumble,stripping,shuts,schmuck,satin,saliva,robber,relentless,reconnect,recipes,rearrange,rainy,psychiatrists,policemen,plunge,plugged,patched,overload,o'malley,mindless,menus,lullaby,lotte,leavin,killin,karinsky,invalid,hides,grownups,griff,flaws,flashy,flaming,fettes,evicted,dread,degrassi,dealings,dangers,cushion,bowel,barged,abide,abandoning,wonderfully,wait'll,violate,suicidal,stayin,sorted,slamming,sketchy,shoplifting,raiser,quizmaster,prefers,needless,motherhood,momentarily,migraine,lifts,leukemia,leftover,keepin,hinks,hellhole,gowns,goodies,gallon,futures,entertained,eighties,conspiring,cheery,benign,apiece,adjustments,abusive,abduction,wiping,whipping,welles,unspeakable,unidentified,trivial,transcripts,textbook,supervise,superstitious,stricken,stimulating,spielberg,slices,shelves,scratches,sabotaged,retrieval,repressed,rejecting,quickie,ponies,peeking,outraged,o'connell,moping,moaning,mausoleum,licked,kovich,klutz,interrogating,interfered,insulin,infested,incompetence,hyper,horrified,handedly,gekko,fraid,fractured,examiner,eloped,disoriented,dashing,crashdown,courier,cockroach,chipped,brushing,bombed,bolts,baths,baptized,astronaut,assurance,anemia,abuela,abiding,withholding,weave,wearin,weaker,suffocating,straws,straightforward,stench,steamed,starboard,sideways,shrinks,shortcut,scram,roasted,roaming,riviera,respectfully,repulsive,psychiatry,provoked,penitentiary,painkillers,ninotchka,mitzvah,milligrams,midge,marshmallows,looky,lapse,kubelik,intellect,improvise,implant,goa'ulds,giddy,geniuses,fruitcake,footing,fightin,drinkin,doork,detour,cuddle,crashes,combo,colonnade,cheats,cetera,bailiff,auditioning,assed,amused,alienate,aiding,aching,unwanted,topless,tongues,tiniest,superiors,soften,sheldrake,rawley,raisins,presses,plaster,nessa,narrowed,minions,merciful,lawsuits,intimidating,infirmary,inconvenient,imposter,hugged,honoring,holdin,hades,godforsaken,fumes,forgery,foolproof,folder,flattery,fingertips,exterminator,explodes,eccentric,dodging,disguised,crave,constructive,concealed,compartment,chute,chinpokomon,bodily,astronauts,alimony,accustomed,abdominal,wrinkle,wallow,valium,untrue,uncover,trembling,treasures,torched,toenails,timed,termites,telly,taunting,taransky,talker,succubus,smarts,sliding,sighting,semen,seizures,scarred,savvy,sauna,saddest,sacrificing,rubbish,riled,ratted,rationally,provenance,phonse,perky,pedal,overdose,nasal,nanites,mushy,movers,missus,midterm,merits,melodramatic,manure,knitting,invading,interpol,incapacitated,hotline,hauling,gunpoint,grail,ganza,framing,flannel,faded,eavesdrop,desserts,calories,breathtaking,bleak,blacked,batter,aggravated,yanked,wigand,whoah,unwind,undoubtedly,unattractive,twitch,trimester,torrance,timetable,taxpayers,strained,stared,slapping,sincerity,siding,shenanigans,shacking,sappy,samaritan,poorer,politely,paste,oysters,overruled,nightcap,mosquito,millimeter,merrier,manhood,lucked,kilos,ignition,hauled,harmed,goodwill,freshmen,fenmore,fasten,farce,exploding,erratic,drunks,ditching,d'artagnan,cramped,contacting,closets,clientele,chimp,bargained,arranging,anesthesia,amuse,altering,afternoons,accountable,abetting,wolek,waved,uneasy,toddy,tattooed,spauldings,sliced,sirens,schibetta,scatter,rinse,remedy,redemption,pleasures,optimism,oblige,mmmmm,masked,malicious,mailing,kosher,kiddies,judas,isolate,insecurity,incidentally,heals,headlights,growl,grilling,glazed,flunk,floats,fiery,fairness,exercising,excellency,disclosure,cupboard,counterfeit,condescending,conclusive,clicked,cleans,cholesterol,cashed,broccoli,brats,blueprints,blindfold,billing,attach,appalled,alrighty,wynant,unsolved,unreliable,toots,tighten,sweatshirt,steinbrenner,steamy,spouse,sonogram,slots,sleepless,shines,retaliate,rephrase,redeem,rambling,quilt,quarrel,prying,proverbial,priced,prescribe,prepped,pranks,possessive,plaintiff,pediatrics,overlooked,outcast,nightgown,mumbo,mediocre,mademoiselle,lunchtime,lifesaver,leaned,lambs,interns,hounding,hellmouth,hahaha,goner,ghoul,gardening,frenzy,foyer,extras,exaggerate,everlasting,enlightened,dialed,devote,deceitful,d'oeuvres,cosmetic,contaminated,conspired,conning,cavern,carving,butting,boiled,blurry,babysit,ascension,aaaaah,wildly,whoopee,whiny,weiskopf,walkie,vultures,vacations,upfront,unresolved,tampering,stockholders,snaps,sleepwalking,shrunk,sermon,seduction,scams,revolve,phenomenal,patrolling,paranormal,ounces,omigod,nightfall,lashing,innocents,infierno,incision,humming,haunts,gloss,gloating,frannie,fetal,feeny,entrapment,discomfort,detonator,dependable,concede,complication,commotion,commence,chulak,caucasian,casually,brainer,bolie,ballpark,anwar,analyzing,accommodations,youse,wring,wallowing,transgenics,thrive,tedious,stylish,strippers,sterile,squeezing,squeaky,sprained,solemn,snoring,shattering,shabby,seams,scrawny,revoked,residue,reeks,recite,ranting,quoting,predicament,plugs,pinpoint,petrified,pathological,passports,oughtta,nighter,navigate,kippie,intrigue,intentional,insufferable,hunky,how've,horrifying,hearty,hamptons,grazie,funerals,forks,fetched,excruciating,enjoyable,endanger,dumber,drying,diabolical,crossword,corry,comprehend,clipped,classmates,candlelight,brutally,brutality,boarded,bathrobe,authorize,assemble,aerobics,wholesome,whiff,vermin,trophies,trait,tragically,toying,testy,tasteful,stocked,spinach,sipping,sidetracked,scrubbing,scraping,sanctity,robberies,ridin,retribution,refrain,realities,radiant,protesting,projector,plutonium,payin,parting,o'reilly,nooooo,motherfucking,measly,manic,lalita,juggling,jerking,intro,inevitably,hypnosis,huddle,horrendous,hobbies,heartfelt,harlin,hairdresser,gonorrhea,fussing,furtwangler,fleeting,flawless,flashed,fetus,eulogy,distinctly,disrespectful,denies,crossbow,cregg,crabs,cowardly,contraction,contingency,confirming,condone,coffins,cleansing,cheesecake,certainty,cages,c'est,briefed,bravest,bosom,boils,binoculars,bachelorette,appetizer,ambushed,alerted,woozy,withhold,vulgar,utmost,unleashed,unholy,unhappiness,unconditional,typewriter,typed,twists,supermodel,subpoenaed,stringing,skeptical,schoolgirl,romantically,rocked,revoir,reopen,puncture,preach,polished,planetarium,penicillin,peacefully,nurturing,more'n,mmhmm,midgets,marklar,lodged,lifeline,jellyfish,infiltrate,hutch,horseback,heist,gents,frickin,freezes,forfeit,flakes,flair,fathered,eternally,epiphany,disgruntled,discouraged,delinquent,decipher,danvers,cubes,credible,coping,chills,cherished,catastrophe,bombshell,birthright,billionaire,ample,affections,admiration,abbotts,whatnot,watering,vinegar,unthinkable,unseen,unprepared,unorthodox,underhanded,uncool,timeless,thump,thermometer,theoretically,tapping,tagged,swung,stares,spiked,solves,smuggle,scarier,saucer,quitter,prudent,powdered,poked,pointers,peril,penetrate,penance,opium,nudge,nostrils,neurological,mockery,mobster,medically,loudly,insights,implicate,hypocritical,humanly,holiness,healthier,hammered,haldeman,gunman,gloom,freshly,francs,flunked,flawed,emptiness,drugging,dozer,derevko,deprive,deodorant,cryin,crocodile,coloring,colder,cognac,clocked,clippings,charades,chanting,certifiable,caterers,brute,brochures,botched,blinders,bitchin,banter,woken,ulcer,tread,thankfully,swine,swimsuit,swans,stressing,steaming,stamped,stabilize,squirm,snooze,shuffle,shredded,seafood,scratchy,savor,sadistic,rhetorical,revlon,realist,prosecuting,prophecies,polyester,petals,persuasion,paddles,o'leary,nuthin,neighbour,negroes,muster,meningitis,matron,lockers,letterman,legged,indictment,hypnotized,housekeeping,hopelessly,hallucinations,grader,goldilocks,girly,flask,envelopes,downside,doves,dissolve,discourage,disapprove,diabetic,deliveries,decorator,crossfire,criminally,containment,comrades,complimentary,chatter,catchy,cashier,cartel,caribou,cardiologist,brawl,booted,barbershop,aryan,angst,administer,zellie,wreak,whistles,vandalism,vamps,uterus,upstate,unstoppable,understudy,tristin,transcript,tranquilizer,toxins,tonsils,stempel,spotting,spectator,spatula,softer,snotty,slinging,showered,sexiest,sensual,sadder,rimbaud,restrain,resilient,remission,reinstate,rehash,recollection,rabies,popsicle,plausible,pediatric,patronizing,ostrich,ortolani,oooooh,omelette,mistrial,marseilles,loophole,laughin,kevvy,irritated,infidelity,hypothermia,horrific,groupie,grinding,graceful,goodspeed,gestures,frantic,extradition,echelon,disks,dawnie,dared,damsel,curled,collateral,collage,chant,calculating,bumping,bribes,boardwalk,blinds,blindly,bleeds,bickering,beasts,backside,avenge,apprehended,anguish,abusing,youthful,yells,yanking,whomever,when'd,vomiting,vengeful,unpacking,unfamiliar,undying,tumble,trolls,treacherous,tipping,tantrum,tanked,summons,straps,stomped,stinkin,stings,staked,squirrels,sprinkles,speculate,sorting,skinned,sicko,sicker,shootin,shatter,seeya,schnapps,s'posed,ronee,respectful,regroup,regretting,reeling,reckoned,ramifications,puddy,projections,preschool,plissken,platonic,permalash,outdone,outburst,mutants,mugging,misfortune,miserably,miraculously,medications,margaritas,manpower,lovemaking,logically,leeches,latrine,kneel,inflict,impostor,hypocrisy,hippies,heterosexual,heightened,hecuba,healer,gunned,grooming,groin,gooey,gloomy,frying,friendships,fredo,firepower,fathom,exhaustion,evils,endeavor,eggnog,dreaded,d'arcy,crotch,coughing,coronary,cookin,consummate,congrats,companionship,caved,caspar,bulletproof,brilliance,breakin,brash,blasting,aloud,airtight,advising,advertise,adultery,aches,wronged,upbeat,trillion,thingies,tending,tarts,surreal,specs,specialize,spade,shrew,shaping,selves,schoolwork,roomie,recuperating,rabid,quart,provocative,proudly,pretenses,prenatal,pharmaceuticals,pacing,overworked,originals,nicotine,murderous,mileage,mayonnaise,massages,losin,interrogated,injunction,impartial,homing,heartbreaker,hacks,glands,giver,fraizh,flips,flaunt,englishman,electrocuted,dusting,ducking,drifted,donating,cylon,crutches,crates,cowards,comfortably,chummy,chitchat,childbirth,businesswoman,brood,blatant,bethy,barring,bagged,awakened,asbestos,airplanes,worshipped,winnings,why're,visualize,unprotected,unleash,trays,thicker,therapists,takeoff,streisand,storeroom,stethoscope,stacked,spiteful,sneaks,snapping,slaughtered,slashed,simplest,silverware,shits,secluded,scruples,scrubs,scraps,ruptured,roaring,receptionist,recap,raditch,radiator,pushover,plastered,pharmacist,perverse,perpetrator,ornament,ointment,nineties,napping,nannies,mousse,moors,momentary,misunderstandings,manipulator,malfunction,laced,kivar,kickin,infuriating,impressionable,holdup,hires,hesitated,headphones,hammering,groundwork,grotesque,graces,gauze,gangsters,frivolous,freeing,fours,forwarding,ferrars,faulty,fantasizing,extracurricular,empathy,divorces,detonate,depraved,demeaning,deadlines,dalai,cursing,cufflink,crows,coupons,comforted,claustrophobic,casinos,camped,busboy,bluth,bennetts,baskets,attacker,aplastic,angrier,affectionate,zapped,wormhole,weaken,unrealistic,unravel,unimportant,unforgettable,twain,suspend,superbowl,stutter,stewardess,stepson,standin,spandex,souvenirs,sociopath,skeletons,shivering,sexier,selfishness,scrapbook,ritalin,ribbons,reunite,remarry,relaxation,rattling,rapist,psychosis,prepping,poses,pleasing,pisses,piling,persecuted,padded,operatives,negotiator,natty,menopause,mennihan,martimmys,loyalties,laynie,lando,justifies,intimately,inexperienced,impotent,immortality,horrors,hooky,hinges,heartbreaking,handcuffed,gypsies,guacamole,grovel,graziella,goggles,gestapo,fussy,ferragamo,feeble,eyesight,explosions,experimenting,enchanting,doubtful,dizziness,dismantle,detectors,deserving,defective,dangling,dancin,crumble,creamed,cramping,conceal,clockwork,chrissakes,chrissake,chopping,cabinets,brooding,bonfire,blurt,bloated,blackmailer,beforehand,bathed,bathe,barcode,banish,badges,babble,await,attentive,aroused,antibodies,animosity,ya'll,wrinkled,wonderland,willed,whisk,waltzing,waitressing,vigilant,upbringing,unselfish,uncles,trendy,trajectory,striped,stamina,stalled,staking,stacks,spoils,snuff,snooty,snide,shrinking,senora,secretaries,scoundrel,saline,salads,rundown,riddles,relapse,recommending,raspberry,plight,pecan,pantry,overslept,ornaments,niner,negligent,negligence,nailing,mucho,mouthed,monstrous,malpractice,lowly,loitering,logged,lingering,lettin,lattes,kamal,juror,jillefsky,jacked,irritate,intrusion,insatiable,infect,impromptu,icing,hmmmm,hefty,gasket,frightens,flapping,firstborn,faucet,estranged,envious,dopey,doesn,disposition,disposable,disappointments,dipped,dignified,deceit,dealership,deadbeat,curses,coven,counselors,concierge,clutches,casbah,callous,cahoots,brotherly,britches,brides,bethie,beige,autographed,attendants,attaboy,astonishing,appreciative,antibiotic,aneurysm,afterlife,affidavit,zoning,whats,whaddaya,vasectomy,unsuspecting,toula,topanga,tonio,toasted,tiring,terrorized,tenderness,tailing,sweats,suffocated,sucky,subconsciously,starvin,sprouts,spineless,sorrows,snowstorm,smirk,slicery,sledding,slander,simmer,signora,sigmund,seventies,sedate,scented,sandals,rollers,retraction,resigning,recuperate,receptive,racketeering,queasy,provoking,priors,prerogative,premed,pinched,pendant,outsiders,orbing,opportunist,olanov,neurologist,nanobot,mommies,molested,misread,mannered,laundromat,intercom,inspect,insanely,infatuation,indulgent,indiscretion,inconsiderate,hurrah,howling,herpes,hasta,harassed,hanukkah,groveling,groosalug,gander,galactica,futile,fridays,flier,fixes,exploiting,exorcism,evasive,endorse,emptied,dreary,dreamy,downloaded,dodged,doctored,disobeyed,disneyland,disable,dehydrated,contemplating,coconuts,cockroaches,clogged,chilling,chaperon,cameraman,bulbs,bucklands,bribing,brava,bracelets,bowels,bluepoint,appetizers,appendix,antics,anointed,analogy,almonds,yammering,winch,weirdness,wangler,vibrations,vendor,unmarked,unannounced,twerp,trespass,travesty,transfusion,trainee,towelie,tiresome,straightening,staggering,sonar,socializing,sinus,sinners,shambles,serene,scraped,scones,scepter,sarris,saberhagen,ridiculously,ridicule,rents,reconciled,radios,publicist,pubes,prune,prude,precrime,postponing,pluck,perish,peppermint,peeled,overdo,nutshell,nostalgic,mulan,mouthing,mistook,meddle,maybourne,martimmy,lobotomy,livelihood,lippman,likeness,kindest,kaffee,jocks,jerked,jeopardizing,jazzed,insured,inquisition,inhale,ingenious,holier,helmets,heirloom,heinous,haste,harmsway,hardship,hanky,gutters,gruesome,groping,goofing,godson,glare,finesse,figuratively,ferrie,endangerment,dreading,dozed,dorky,dmitri,divert,discredit,dialing,cufflinks,crutch,craps,corrupted,cocoon,cleavage,cannery,bystander,brushes,bruising,bribery,brainstorm,bolted,binge,ballistics,astute,arroway,adventurous,adoptive,addicts,addictive,yadda,whitelighters,wematanye,weeds,wedlock,wallets,vulnerability,vroom,vents,upped,unsettling,unharmed,trippin,trifle,tracing,tormenting,thats,syphilis,subtext,stickin,spices,sores,smacked,slumming,sinks,signore,shitting,shameful,shacked,septic,seedy,righteousness,relish,rectify,ravishing,quickest,phoebs,perverted,peeing,pedicure,pastrami,passionately,ozone,outnumbered,oregano,offender,nukes,nosed,nighty,nifty,mounties,motivate,moons,misinterpreted,mercenary,mentality,marsellus,lupus,lumbar,lovesick,lobsters,leaky,laundering,latch,jafar,instinctively,inspires,indoors,incarcerated,hundredth,handkerchief,gynecologist,guittierez,groundhog,grinning,goodbyes,geese,fullest,eyelashes,eyelash,enquirer,endlessly,elusive,disarm,detest,deluding,dangle,cotillion,corsage,conjugal,confessional,cones,commandment,coded,coals,chuckle,christmastime,cheeseburgers,chardonnay,celery,campfire,calming,burritos,brundle,broflovski,brighten,borderline,blinked,bling,beauties,bauers,battered,articulate,alienated,ahhhhh,agamemnon,accountants,y'see,wrongful,wrapper,workaholic,winnebago,whispered,warts,vacate,unworthy,unanswered,tonane,tolerated,throwin,throbbing,thrills,thorns,thereof,there've,tarot,sunscreen,stretcher,stereotype,soggy,sobbing,sizable,sightings,shucks,shrapnel,sever,senile,seaboard,scorned,saver,rebellious,rained,putty,prenup,pores,pinching,pertinent,peeping,paints,ovulating,opposites,occult,nutcracker,nutcase,newsstand,newfound,mocked,midterms,marshmallow,marbury,maclaren,leans,krudski,knowingly,keycard,junkies,juilliard,jolinar,irritable,invaluable,inuit,intoxicating,instruct,insolent,inexcusable,incubator,illustrious,hunsecker,houseguest,homosexuals,homeroom,hernia,harming,handgun,hallways,hallucination,gunshots,groupies,groggy,goiter,gingerbread,giggling,frigging,fledged,fedex,fairies,exchanging,exaggeration,esteemed,enlist,drags,dispense,disloyal,disconnect,desks,dentists,delacroix,degenerate,daydreaming,cushions,cuddly,corroborate,complexion,compensated,cobbler,closeness,chilled,checkmate,channing,carousel,calms,bylaws,benefactor,ballgame,baiting,backstabbing,artifact,airspace,adversary,actin,accuses,accelerant,abundantly,abstinence,zissou,zandt,yapping,witchy,willows,whadaya,vilandra,veiled,undress,undivided,underestimating,ultimatums,twirl,truckload,tremble,toasting,tingling,tents,tempered,sulking,stunk,sponges,spills,softly,snipers,scourge,rooftop,riana,revolting,revisit,refreshments,redecorating,recapture,raysy,pretense,prejudiced,precogs,pouting,poofs,pimple,piles,pediatrician,padre,packets,paces,orvelle,oblivious,objectivity,nighttime,nervosa,mexicans,meurice,melts,matchmaker,maeby,lugosi,lipnik,leprechaun,kissy,kafka,introductions,intestines,inspirational,insightful,inseparable,injections,inadvertently,hussy,huckabees,hittin,hemorrhaging,headin,haystack,hallowed,grudges,granilith,grandkids,grading,gracefully,godsend,gobbles,fragrance,fliers,finchley,farts,eyewitnesses,expendable,existential,dorms,delaying,degrading,deduction,darlings,danes,cylons,counsellor,contraire,consciously,conjuring,congratulating,cokes,buffay,brooch,bitching,bistro,bijou,bewitched,benevolent,bends,bearings,barren,aptitude,amish,amazes,abomination,worldly,whispers,whadda,wayward,wailing,vanishing,upscale,untouchable,unspoken,uncontrollable,unavoidable,unattended,trite,transvestite,toupee,timid,timers,terrorizing,swana,stumped,strolling,storybook,storming,stomachs,stoked,stationery,springtime,spontaneity,spits,spins,soaps,sentiments,scramble,scone,rooftops,retract,reflexes,rawdon,ragged,quirky,quantico,psychologically,prodigal,pounce,potty,pleasantries,pints,petting,perceive,onstage,notwithstanding,nibble,newmans,neutralize,mutilated,millionaires,mayflower,masquerade,mangy,macreedy,lunatics,lovable,locating,limping,lasagna,kwang,keepers,juvie,jaded,ironing,intuitive,intensely,insure,incantation,hysteria,hypnotize,humping,happenin,griet,grasping,glorified,ganging,g'night,focker,flunking,flimsy,flaunting,fixated,fitzwallace,fainting,eyebrow,exonerated,ether,electrician,egotistical,earthly,dusted,dignify,detonation,debrief,dazzling,dan'l,damnedest,daisies,crushes,crucify,contraband,confronting,collapsing,cocked,clicks,cliche,circled,chandelier,carburetor,callers,broads,breathes,bloodshed,blindsided,blabbing,bialystock,bashing,ballerina,aviva,arteries,anomaly,airstrip,agonizing,adjourn,aaaaa,yearning,wrecker,witnessing,whence,warhead,unsure,unheard,unfreeze,unfold,unbalanced,ugliest,troublemaker,toddler,tiptoe,threesome,thirties,thermostat,swipe,surgically,subtlety,stung,stumbling,stubs,stride,strangling,sprayed,socket,smuggled,showering,shhhhh,sabotaging,rumson,rounding,risotto,repairman,rehearsed,ratty,ragging,radiology,racquetball,racking,quieter,quicksand,prowl,prompt,premeditated,prematurely,prancing,porcupine,plated,pinocchio,peeked,peddle,panting,overweight,overrun,outing,outgrown,obsess,nursed,nodding,negativity,negatives,musketeers,mugger,motorcade,merrily,matured,masquerading,marvellous,maniacs,lovey,louse,linger,lilies,lawful,kudos,knuckle,juices,judgments,itches,intolerable,intermission,inept,incarceration,implication,imaginative,huckleberry,holster,heartburn,gunna,groomed,graciously,fulfillment,fugitives,forsaking,forgives,foreseeable,flavors,flares,fixation,fickle,fantasize,famished,fades,expiration,exclamation,erasing,eiffel,eerie,earful,duped,dulles,dissing,dissect,dispenser,dilated,detergent,desdemona,debriefing,damper,curing,crispina,crackpot,courting,cordial,conflicted,comprehension,commie,cleanup,chiropractor,charmer,chariot,cauldron,catatonic,bullied,buckets,brilliantly,breathed,booths,boardroom,blowout,blindness,blazing,biologically,bibles,biased,beseech,barbaric,balraj,audacity,anticipating,alcoholics,airhead,agendas,admittedly,absolution,youre,yippee,wittlesey,withheld,willful,whammy,weakest,washes,virtuous,videotapes,vials,unplugged,unpacked,unfairly,turbulence,tumbling,tricking,tremendously,traitors,torches,tinga,thyroid,teased,tawdry,taker,sympathies,swiped,sundaes,suave,strut,stepdad,spewing,spasm,socialize,slither,simulator,shutters,shrewd,shocks,semantics,schizophrenic,scans,savages,rya'c,runny,ruckus,royally,roadblocks,rewriting,revoke,repent,redecorate,recovers,recourse,ratched,ramali,racquet,quince,quiche,puppeteer,puking,puffed,problemo,praises,pouch,postcards,pooped,poised,piled,phoney,phobia,patching,parenthood,pardner,oozing,ohhhhh,numbing,nostril,nosey,neatly,nappa,nameless,mortuary,moronic,modesty,midwife,mcclane,matuka,maitre,lumps,lucid,loosened,loins,lawnmower,lamotta,kroehner,jinxy,jessep,jamming,jailhouse,jacking,intruders,inhuman,infatuated,indigestion,implore,implanted,hormonal,hoboken,hillbilly,heartwarming,headway,hatched,hartmans,harping,grapevine,gnome,forties,flyin,flirted,fingernail,exhilarating,enjoyment,embark,dumper,dubious,drell,docking,disillusioned,dishonor,disbarred,dicey,custodial,counterproductive,corned,cords,contemplate,concur,conceivable,cobblepot,chickened,checkout,carpe,cap'n,campers,buyin,bullies,braid,boxed,bouncy,blueberries,blubbering,bloodstream,bigamy,beeped,bearable,autographs,alarming,wretch,wimps,widower,whirlwind,whirl,warms,vandelay,unveiling,undoing,unbecoming,turnaround,touche,togetherness,tickles,ticker,teensy,taunt,sweethearts,stitched,standpoint,staffers,spotless,soothe,smothered,sickening,shouted,shepherds,shawl,seriousness,schooled,schoolboy,s'mores,roped,reminders,raggedy,preemptive,plucked,pheromones,particulars,pardoned,overpriced,overbearing,outrun,ohmigod,nosing,nicked,neanderthal,mosquitoes,mortified,milky,messin,mecha,markinson,marivellas,mannequin,manderley,madder,macready,lookie,locusts,lifetimes,lanna,lakhi,kholi,impersonate,hyperdrive,horrid,hopin,hogging,hearsay,harpy,harboring,hairdo,hafta,grasshopper,gobble,gatehouse,foosball,floozy,fished,firewood,finalize,felons,euphemism,entourage,elitist,elegance,drokken,drier,dredge,dossier,diseased,diarrhea,diagnose,despised,defuse,d'amour,contesting,conserve,conscientious,conjured,collars,clogs,chenille,chatty,chamomile,casing,calculator,brittle,breached,blurted,birthing,bikinis,astounding,assaulting,aroma,appliance,antsy,amnio,alienating,aliases,adolescence,xerox,wrongs,workload,willona,whistling,werewolves,wallaby,unwelcome,unseemly,unplug,undermining,ugliness,tyranny,tuesdays,trumpets,transference,ticks,tangible,tagging,swallowing,superheroes,studs,strep,stowed,stomping,steffy,sprain,spouting,sponsoring,sneezing,smeared,slink,shakin,sewed,seatbelt,scariest,scammed,sanctimonious,roasting,rightly,retinal,rethinking,resented,reruns,remover,racks,purest,progressing,presidente,preeclampsia,postponement,portals,poppa,pliers,pinning,pelvic,pampered,padding,overjoyed,ooooo,one'll,octavius,nonono,nicknames,neurosurgeon,narrows,misled,mislead,mishap,milltown,milking,meticulous,mediocrity,meatballs,machete,lurch,layin,knockin,khruschev,jurors,jumpin,jugular,jeweler,intellectually,inquiries,indulging,indestructible,indebted,imitate,ignores,hyperventilating,hyenas,hurrying,hermano,hellish,heheh,harshly,handout,grunemann,glances,giveaway,getup,gerome,furthest,frosting,frail,forwarded,forceful,flavored,flammable,flaky,fingered,fatherly,ethic,embezzlement,duffel,dotted,distressed,disobey,disappearances,dinky,diminish,diaphragm,deuces,creme,courteous,comforts,coerced,clots,clarification,chunks,chickie,chases,chaperoning,cartons,caper,calves,caged,bustin,bulging,bringin,boomhauer,blowin,blindfolded,biscotti,ballplayer,bagging,auster,assurances,aschen,arraigned,anonymity,alters,albatross,agreeable,adoring,abduct,wolfi,weirded,watchers,washroom,warheads,vincennes,urgency,understandably,uncomplicated,uhhhh,twitching,treadmill,thermos,tenorman,tangle,talkative,swarm,surrendering,summoning,strive,stilts,stickers,squashed,spraying,sparring,soaring,snort,sneezed,slaps,skanky,singin,sidle,shreck,shortness,shorthand,sharper,shamed,sadist,rydell,rusik,roulette,resumes,respiration,recount,reacts,purgatory,princesses,presentable,ponytail,plotted,pinot,pigtails,phillippe,peddling,paroled,orbed,offends,o'hara,moonlit,minefield,metaphors,malignant,mainframe,magicks,maggots,maclaine,loathing,leper,leaps,leaping,lashed,larch,larceny,lapses,ladyship,juncture,jiffy,jakov,invoke,infantile,inadmissible,horoscope,hinting,hideaway,hesitating,heddy,heckles,hairline,gripe,gratifying,governess,goebbels,freddo,foresee,fascination,exemplary,executioner,etcetera,escorts,endearing,eaters,earplugs,draped,disrupting,disagrees,dimes,devastate,detain,depositions,delicacy,darklighter,cynicism,cyanide,cutters,cronus,continuance,conquering,confiding,compartments,combing,cofell,clingy,cleanse,christmases,cheered,cheekbones,buttle,burdened,bruenell,broomstick,brained,bozos,bontecou,bluntman,blazes,blameless,bizarro,bellboy,beaucoup,barkeep,awaken,astray,assailant,appease,aphrodisiac,alleys,yesss,wrecks,woodpecker,wondrous,wimpy,willpower,wheeling,weepy,waxing,waive,videotaped,veritable,untouched,unlisted,unfounded,unforeseen,twinge,triggers,traipsing,toxin,tombstone,thumping,therein,testicles,telephones,tarmac,talby,tackled,swirling,suicides,suckered,subtitles,sturdy,strangler,stockbroker,stitching,steered,standup,squeal,sprinkler,spontaneously,splendor,spiking,spender,snipe,snagged,skimming,siddown,showroom,shovels,shotguns,shoelaces,shitload,shellfish,sharpest,shadowy,seizing,scrounge,scapegoat,sayonara,saddled,rummaging,roomful,renounce,reconsidered,recharge,realistically,radioed,quirks,quadrant,punctual,practising,pours,poolhouse,poltergeist,pocketbook,plainly,picnics,pesto,pawing,passageway,partied,oneself,numero,nostalgia,nitwit,neuro,mixer,meanest,mcbeal,matinee,margate,marce,manipulations,manhunt,manger,magicians,loafers,litvack,lightheaded,lifeguard,lawns,laughingstock,ingested,indignation,inconceivable,imposition,impersonal,imbecile,huddled,housewarming,horizons,homicides,hiccups,hearse,hardened,gushing,gushie,greased,goddamit,freelancer,forging,fondue,flustered,flung,flinch,flicker,fixin,festivus,fertilizer,farted,faggots,exonerate,evict,enormously,encrypted,emdash,embracing,duress,dupres,dowser,doormat,disfigured,disciplined,dibbs,depository,deathbed,dazzled,cuttin,cures,crowding,crepe,crammed,copycat,contradict,confidant,condemning,conceited,commute,comatose,clapping,circumference,chuppah,chore,choksondik,chestnuts,briault,bottomless,bonnet,blokes,berluti,beret,beggars,bankroll,bania,athos,arsenic,apperantly,ahhhhhh,afloat,accents,zipped,zeros,zeroes,zamir,yuppie,youngsters,yorkers,wisest,wipes,wield,whyn't,weirdos,wednesdays,vicksburg,upchuck,untraceable,unsupervised,unpleasantness,unhook,unconscionable,uncalled,trappings,tragedies,townie,thurgood,things'll,thine,tetanus,terrorize,temptations,tanning,tampons,swarming,straitjacket,steroid,startling,starry,squander,speculating,sollozzo,sneaked,slugs,skedaddle,sinker,silky,shortcomings,sellin,seasoned,scrubbed,screwup,scrapes,scarves,sandbox,salesmen,rooming,romances,revere,reproach,reprieve,rearranging,ravine,rationalize,raffle,punchy,psychobabble,provocation,profoundly,prescriptions,preferable,polishing,poached,pledges,pirelli,perverts,oversized,overdressed,outdid,nuptials,nefarious,mouthpiece,motels,mopping,mongrel,missin,metaphorically,mertin,memos,melodrama,melancholy,measles,meaner,mantel,maneuvering,mailroom,luring,listenin,lifeless,licks,levon,legwork,kneecaps,kippur,kiddie,kaput,justifiable,insistent,insidious,innuendo,innit,indecent,imaginable,horseshit,hemorrhoid,hella,healthiest,haywire,hamsters,hairbrush,grouchy,grisly,gratuitous,glutton,glimmer,gibberish,ghastly,gentler,generously,geeky,fuhrer,fronting,foolin,faxes,faceless,extinguisher,expel,etched,endangering,ducked,dodgeball,dives,dislocated,discrepancy,devour,derail,dementia,daycare,cynic,crumbling,cowardice,covet,cornwallis,corkscrew,cookbook,commandments,coincidental,cobwebs,clouded,clogging,clicking,clasp,chopsticks,chefs,chaps,cashing,carat,calmer,brazen,brainwashing,bradys,bowing,boned,bloodsucking,bleachers,bleached,bedpan,bearded,barrenger,bachelors,awwww,assures,assigning,asparagus,apprehend,anecdote,amoral,aggravation,afoot,acquaintances,accommodating,yakking,worshipping,wladek,willya,willies,wigged,whoosh,whisked,watered,warpath,volts,violates,valuables,uphill,unwise,untimely,unsavory,unresponsive,unpunished,unexplained,tubby,trolling,toxicology,tormented,toothache,tingly,timmiihh,thursdays,thoreau,terrifies,temperamental,telegrams,talkie,takers,symbiote,swirl,suffocate,stupider,strapping,steckler,springing,someway,sleepyhead,sledgehammer,slant,slams,showgirl,shoveling,shmoopy,sharkbait,shan't,scrambling,schematics,sandeman,sabbatical,rummy,reykjavik,revert,responsive,rescheduled,requisition,relinquish,rejoice,reckoning,recant,rebadow,reassurance,rattlesnake,ramble,primed,pricey,prance,pothole,pocus,persist,perpetrated,pekar,peeling,pastime,parmesan,pacemaker,overdrive,ominous,observant,nothings,noooooo,nonexistent,nodded,nieces,neglecting,nauseating,mutated,musket,mumbling,mowing,mouthful,mooseport,monologue,mistrust,meetin,masseuse,mantini,mailer,madre,lowlifes,locksmith,livid,liven,limos,liberating,lhasa,leniency,leering,laughable,lashes,lasagne,laceration,korben,katan,kalen,jittery,jammies,irreplaceable,intubate,intolerant,inhaler,inhaled,indifferent,indifference,impound,impolite,humbly,heroics,heigh,guillotine,guesthouse,grounding,grips,gossiping,goatee,gnomes,gellar,frutt,frobisher,freudian,foolishness,flagged,femme,fatso,fatherhood,fantasized,fairest,faintest,eyelids,extravagant,extraterrestrial,extraordinarily,escalator,elevate,drivel,dissed,dismal,disarray,dinnertime,devastation,dermatologist,delicately,defrost,debutante,debacle,damone,dainty,cuvee,culpa,crucified,creeped,crayons,courtship,convene,congresswoman,concocted,compromises,comprende,comma,coleslaw,clothed,clinically,chickenshit,checkin,cesspool,caskets,calzone,brothel,boomerang,bodega,blasphemy,bitsy,bicentennial,berlini,beatin,beards,barbas,barbarians,backpacking,arrhythmia,arousing,arbitrator,antagonize,angling,anesthetic,altercation,aggressor,adversity,acathla,aaahhh,wreaking,workup,wonderin,wither,wielding,what'm,what'cha,waxed,vibrating,veterinarian,venting,vasey,valor,validate,upholstery,untied,unscathed,uninterrupted,unforgiving,undies,uncut,twinkies,tucking,treatable,treasured,tranquility,townspeople,torso,tomei,tipsy,tinsel,tidings,thirtieth,tantrums,tamper,talky,swayed,swapping,suitor,stylist,stirs,standoff,sprinklers,sparkly,snobby,snatcher,smoother,sleepin,shrug,shoebox,sheesh,shackles,setbacks,sedatives,screeching,scorched,scanned,satyr,roadblock,riverbank,ridiculed,resentful,repellent,recreate,reconvene,rebuttal,realmedia,quizzes,questionnaire,punctured,pucker,prolong,professionalism,pleasantly,pigsty,penniless,paychecks,patiently,parading,overactive,ovaries,orderlies,oracles,oiled,offending,nudie,neonatal,neighborly,moops,moonlighting,mobilize,mmmmmm,milkshake,menial,meats,mayan,maxed,mangled,magua,lunacy,luckier,liters,lansbury,kooky,knowin,jeopardized,inkling,inhalation,inflated,infecting,incense,inbound,impractical,impenetrable,idealistic,i'mma,hypocrites,hurtin,humbled,hologram,hokey,hocus,hitchhiking,hemorrhoids,headhunter,hassled,harts,hardworking,haircuts,hacksaw,genitals,gazillion,gammy,gamesphere,fugue,footwear,folly,flashlights,fives,filet,extenuating,estrogen,entails,embezzled,eloquent,egomaniac,ducts,drowsy,drones,doree,donovon,disguises,diggin,deserting,depriving,defying,deductible,decorum,decked,daylights,daybreak,dashboard,damnation,cuddling,crunching,crickets,crazies,councilman,coughed,conundrum,complimented,cohaagen,clutching,clued,clader,cheques,checkpoint,chats,channeling,ceases,carasco,capisce,cantaloupe,cancelling,campsite,burglars,breakfasts,bra'tac,blueprint,bleedin,blabbed,beneficiary,basing,avert,atone,arlyn,approves,apothecary,antiseptic,aleikuum,advisement,zadir,wobbly,withnail,whattaya,whacking,wedged,wanders,vaginal,unimaginable,undeniable,unconditionally,uncharted,unbridled,tweezers,tvmegasite,trumped,triumphant,trimming,treading,tranquilizers,toontown,thunk,suture,suppressing,strays,stonewall,stogie,stepdaughter,stace,squint,spouses,splashed,speakin,sounder,sorrier,sorrel,sombrero,solemnly,softened,snobs,snippy,snare,smoothing,slump,slimeball,slaving,silently,shiller,shakedown,sensations,scrying,scrumptious,screamin,saucy,santoses,roundup,roughed,rosary,robechaux,retrospect,rescind,reprehensible,repel,remodeling,reconsidering,reciprocate,railroaded,psychics,promos,prob'ly,pristine,printout,priestess,prenuptial,precedes,pouty,phoning,peppy,pariah,parched,panes,overloaded,overdoing,nymphs,nother,notebooks,nearing,nearer,monstrosity,milady,mieke,mephesto,medicated,marshals,manilow,mammogram,m'lady,lotsa,loopy,lesion,lenient,learner,laszlo,kross,kinks,jinxed,involuntary,insubordination,ingrate,inflatable,incarnate,inane,hypoglycemia,huntin,humongous,hoodlum,honking,hemorrhage,helpin,hathor,hatching,grotto,grandmama,gorillas,godless,girlish,ghouls,gershwin,frosted,flutter,flagpole,fetching,fatter,faithfully,exert,evasion,escalate,enticing,enchantress,elopement,drills,downtime,downloading,dorks,doorways,divulge,dissociative,disgraceful,disconcerting,deteriorate,destinies,depressive,dented,denim,decruz,decidedly,deactivate,daydreams,curls,culprit,cruelest,crippling,cranberries,corvis,copped,commend,coastguard,cloning,cirque,churning,chock,chivalry,catalogues,cartwheels,carols,canister,buttered,bundt,buljanoff,bubbling,brokers,broaden,brimstone,brainless,bores,badmouthing,autopilot,ascertain,aorta,ampata,allenby,accosted,absolve,aborted,aaagh,aaaaaah,yonder,yellin,wyndham,wrongdoing,woodsboro,wigging,wasteland,warranty,waltzed,walnuts,vividly,veggie,unnecessarily,unloaded,unicorns,understated,unclean,umbrellas,twirling,turpentine,tupperware,triage,treehouse,tidbit,tickled,threes,thousandth,thingie,terminally,teething,tassel,talkies,swoon,switchboard,swerved,suspiciously,subsequentlyne,subscribe,strudel,stroking,strictest,stensland,starin,stannart,squirming,squealing,sorely,softie,snookums,sniveling,smidge,sloth,skulking,simian,sightseeing,siamese,shudder,shoppers,sharpen,shannen,semtex,secondhand,seance,scowl,scorn,safekeeping,russe,rummage,roshman,roomies,roaches,rinds,retrace,retires,resuscitate,rerun,reputations,rekall,refreshment,reenactment,recluse,ravioli,raves,raking,purses,punishable,punchline,puked,prosky,previews,poughkeepsie,poppins,polluted,placenta,pissy,petulant,perseverance,pears,pawns,pastries,partake,panky,palate,overzealous,orchids,obstructing,objectively,obituaries,obedient,nothingness,musty,motherly,mooning,momentous,mistaking,minutemen,milos,microchip,meself,merciless,menelaus,mazel,masturbate,mahogany,lysistrata,lillienfield,likable,liberate,leveled,letdown,larynx,lardass,lainey,lagged,klorel,kidnappings,keyed,karmic,jeebies,irate,invulnerable,intrusive,insemination,inquire,injecting,informative,informants,impure,impasse,imbalance,illiterate,hurled,hunts,hematoma,headstrong,handmade,handiwork,growling,gorky,getcha,gesundheit,gazing,galley,foolishly,fondness,floris,ferocious,feathered,fateful,fancies,fakes,faker,expire,ever'body,essentials,eskimos,enlightening,enchilada,emissary,embolism,elsinore,ecklie,drenched,drazi,doped,dogging,doable,dislikes,dishonesty,disengage,discouraging,derailed,deformed,deflect,defer,deactivated,crips,constellations,congressmen,complimenting,clubbing,clawing,chromium,chimes,chews,cheatin,chaste,cellblock,caving,catered,catacombs,calamari,bucking,brulee,brits,brisk,breezes,bounces,boudoir,binks,better'n,bellied,behrani,behaves,bedding,balmy,badmouth,backers,avenging,aromatherapy,armpit,armoire,anythin,anonymously,anniversaries,aftershave,affliction,adrift,admissible,adieu,acquittal,yucky,yearn,whitter,whirlpool,wendigo,watchdog,wannabes,wakey,vomited,voicemail,valedictorian,uttered,unwed,unrequited,unnoticed,unnerving,unkind,unjust,uniformed,unconfirmed,unadulterated,unaccounted,uglier,turnoff,trampled,tramell,toads,timbuktu,throwback,thimble,tasteless,tarantula,tamale,takeovers,swish,supposing,streaking,stargher,stanzi,stabs,squeamish,splattered,spiritually,spilt,speciality,smacking,skywire,skips,skaara,simpatico,shredding,showin,shortcuts,shite,shielding,shamelessly,serafine,sentimentality,seasick,schemer,scandalous,sainted,riedenschneider,rhyming,revel,retractor,retards,resurrect,remiss,reminiscing,remanded,reiben,regains,refuel,refresher,redoing,redheaded,reassured,rearranged,rapport,qumar,prowling,prejudices,precarious,powwow,pondering,plunger,plunged,pleasantville,playpen,phlegm,perfected,pancreas,paley,ovary,outbursts,oppressed,ooohhh,omoroca,offed,o'toole,nurture,nursemaid,nosebleed,necktie,muttering,munchies,mucking,mogul,mitosis,misdemeanor,miscarried,millionth,migraines,midler,manicurist,mandelbaum,manageable,malfunctioned,magnanimous,loudmouth,longed,lifestyles,liddy,lickety,leprechauns,komako,klute,kennel,justifying,irreversible,inventing,intergalactic,insinuate,inquiring,ingenuity,inconclusive,incessant,improv,impersonation,hyena,humperdinck,hubba,housework,hoffa,hither,hissy,hippy,hijacked,heparin,hellooo,hearth,hassles,hairstyle,hahahaha,hadda,guys'll,gutted,gulls,gritty,grievous,graft,gossamer,gooder,gambled,gadgets,fundamentals,frustrations,frolicking,frock,frilly,foreseen,footloose,fondly,flirtation,flinched,flatten,farthest,exposer,evading,escrow,empathize,embryos,embodiment,ellsberg,ebola,dulcinea,dreamin,drawbacks,doting,doose,doofy,disturbs,disorderly,disgusts,detox,denominator,demeanor,deliriously,decode,debauchery,croissant,cravings,cranked,coworkers,councilor,confuses,confiscate,confines,conduit,compress,combed,clouding,clamps,cinch,chinnery,celebratory,catalogs,carpenters,carnal,canin,bundys,bulldozer,buggers,bueller,brainy,booming,bookstores,bloodbath,bittersweet,bellhop,beeping,beanstalk,beady,baudelaire,bartenders,bargains,averted,armadillo,appreciating,appraised,antlers,aloof,allowances,alleyway,affleck,abject,zilch,youore,xanax,wrenching,wouldn,witted,wicca,whorehouse,whooo,whips,vouchers,victimized,vicodin,untested,unsolicited,unfocused,unfettered,unfeeling,unexplainable,understaffed,underbelly,tutorial,tryst,trampoline,towering,tirade,thieving,thang,swimmin,swayzak,suspecting,superstitions,stubbornness,streamers,strattman,stonewalling,stiffs,stacking,spout,splice,sonrisa,smarmy,slows,slicing,sisterly,shrill,shined,seeming,sedley,seatbelts,scour,scold,schoolyard,scarring,salieri,rustling,roxbury,rewire,revved,retriever,reputable,remodel,reins,reincarnation,rance,rafters,rackets,quail,pumbaa,proclaim,probing,privates,pried,prewedding,premeditation,posturing,posterity,pleasurable,pizzeria,pimps,penmanship,penchant,pelvis,overturn,overstepped,overcoat,ovens,outsmart,outed,ooohh,oncologist,omission,offhand,odour,nyazian,notarized,nobody'll,nightie,navel,nabbed,mystique,mover,mortician,morose,moratorium,mockingbird,mobsters,mingling,methinks,messengered,merde,masochist,martouf,martians,marinara,manray,majorly,magnifying,mackerel,lurid,lugging,lonnegan,loathsome,llantano,liberace,leprosy,latinos,lanterns,lamest,laferette,kraut,intestine,innocencia,inhibitions,ineffectual,indisposed,incurable,inconvenienced,inanimate,improbable,implode,hydrant,hustling,hustled,huevos,how'm,hooey,hoods,honcho,hinge,hijack,heimlich,hamunaptra,haladki,haiku,haggle,gutsy,grunting,grueling,gribbs,greevy,grandstanding,godparents,glows,glistening,gimmick,gaping,fraiser,formalities,foreigner,folders,foggy,fitty,fiends,fe'nos,favours,eyeing,extort,expedite,escalating,epinephrine,entitles,entice,eminence,eights,earthlings,eagerly,dunville,dugout,doublemeat,doling,dispensing,dispatcher,discoloration,diners,diddly,dictates,diazepam,derogatory,delights,defies,decoder,dealio,danson,cutthroat,crumbles,croissants,crematorium,craftsmanship,could'a,cordless,cools,conked,confine,concealing,complicates,communique,cockamamie,coasters,clobbered,clipping,clipboard,clemenza,cleanser,circumcision,chanukah,certainaly,cellmate,cancels,cadmium,buzzed,bumstead,bucko,browsing,broth,braver,boggling,bobbing,blurred,birkhead,benet,belvedere,bellies,begrudge,beckworth,banky,baldness,baggy,babysitters,aversion,astonished,assorted,appetites,angina,amiss,ambulances,alibis,airway,admires,adhesive,yoyou,xxxxxx,wreaked,wracking,woooo,wooing,wised,wilshire,wedgie,waging,violets,vincey,uplifting,untrustworthy,unmitigated,uneventful,undressing,underprivileged,unburden,umbilical,tweaking,turquoise,treachery,tosses,torching,toothpick,toasts,thickens,tereza,tenacious,teldar,taint,swill,sweatin,subtly,subdural,streep,stopwatch,stockholder,stillwater,stalkers,squished,squeegee,splinters,spliced,splat,spied,spackle,sophistication,snapshots,smite,sluggish,slithered,skeeters,sidewalks,sickly,shrugs,shrubbery,shrieking,shitless,settin,sentinels,selfishly,scarcely,sangria,sanctum,sahjhan,rustle,roving,rousing,rosomorf,riddled,responsibly,renoir,remoray,remedial,refundable,redirect,recheck,ravenwood,rationalizing,ramus,ramelle,quivering,pyjamas,psychos,provocations,prouder,protestors,prodded,proctologist,primordial,pricks,prickly,precedents,pentangeli,pathetically,parka,parakeet,panicky,overthruster,outsmarted,orthopedic,oncoming,offing,nutritious,nuthouse,nourishment,nibbling,newlywed,narcissist,mutilation,mundane,mummies,mumble,mowed,morvern,mortem,mopes,molasses,misplace,miscommunication,miney,midlife,menacing,memorizing,massaging,masking,magnets,luxuries,lounging,lothario,liposuction,lidocaine,libbets,levitate,leeway,launcelot,larek,lackeys,kumbaya,kryptonite,knapsack,keyhole,katarangura,juiced,jakey,ironclad,invoice,intertwined,interlude,interferes,injure,infernal,indeedy,incur,incorrigible,incantations,impediment,igloo,hysterectomy,hounded,hollering,hindsight,heebie,havesham,hasenfuss,hankering,hangers,hakuna,gutless,gusto,grubbing,grrrr,grazed,gratification,grandeur,gorak,godammit,gnawing,glanced,frostbite,frees,frazzled,fraulein,fraternizing,fortuneteller,formaldehyde,followup,foggiest,flunky,flickering,firecrackers,figger,fetuses,fates,eyeliner,extremities,extradited,expires,exceedingly,evaporate,erupt,epileptic,entrails,emporium,egregious,eggshells,easing,duwayne,droll,dreyfuss,dovey,doubly,doozy,donkeys,donde,distrust,distressing,disintegrate,discreetly,decapitated,dealin,deader,dashed,darkroom,dares,daddies,dabble,cushy,cupcakes,cuffed,croupier,croak,crapped,coursing,coolers,contaminate,consummated,construed,condos,concoction,compulsion,commish,coercion,clemency,clairvoyant,circulate,chesterton,checkered,charlatan,chaperones,categorically,cataracts,carano,capsules,capitalize,burdon,bullshitting,brewed,breathless,breasted,brainstorming,bossing,borealis,bonsoir,bobka,boast,blimp,bleep,bleeder,blackouts,bisque,billboards,beatings,bayberry,bashed,bamboozled,balding,baklava,baffled,backfires,babak,awkwardness,attest,attachments,apologizes,anyhoo,antiquated,alcante,advisable,aahhh,aaahh,zatarc,yearbooks,wuddya,wringing,womanhood,witless,winging,whatsa,wetting,waterproof,wastin,vogelman,vocation,vindicated,vigilance,vicariously,venza,vacuuming,utensils,uplink,unveil,unloved,unloading,uninhibited,unattached,tweaked,turnips,trinkets,toughen,toting,topside,terrors,terrify,technologically,tarnish,tagliati,szpilman,surly,supple,summation,suckin,stepmom,squeaking,splashmore,souffle,solitaire,solicitation,solarium,smokers,slugged,slobbering,skylight,skimpy,sinuses,silenced,sideburns,shrinkage,shoddy,shhhhhh,shelled,shareef,shangri,seuss,serenade,scuffle,scoff,scanners,sauerkraut,sardines,sarcophagus,salvy,rusted,russells,rowboat,rolfsky,ringside,respectability,reparations,renegotiate,reminisce,reimburse,regimen,raincoat,quibble,puzzled,purposefully,pubic,proofing,prescribing,prelim,poisons,poaching,personalized,personable,peroxide,pentonville,payphone,payoffs,paleontology,overflowing,oompa,oddest,objecting,o'hare,o'daniel,notches,nobody'd,nightstand,neutralized,nervousness,nerdy,needlessly,naquadah,nappy,nantucket,nambla,mountaineer,motherfuckin,morrie,monopolizing,mohel,mistreated,misreading,misbehave,miramax,minivan,milligram,milkshakes,metamorphosis,medics,mattresses,mathesar,matchbook,matata,marys,malucci,magilla,lymphoma,lowers,lordy,linens,lindenmeyer,limelight,leapt,laxative,lather,lapel,lamppost,laguardia,kindling,kegger,kawalsky,juries,jokin,jesminder,interning,innermost,injun,infallible,industrious,indulgence,incinerator,impossibility,impart,illuminate,iguanas,hypnotic,hyped,hospitable,hoses,homemaker,hirschmuller,helpers,headset,guardianship,guapo,grubby,granola,granddaddy,goren,goblet,gluttony,globes,giorno,getter,geritol,gassed,gaggle,foxhole,fouled,foretold,floorboards,flippers,flaked,fireflies,feedings,fashionably,farragut,fallback,facials,exterminate,excites,everything'll,evenin,ethically,ensue,enema,empath,eluded,eloquently,eject,edema,dumpling,droppings,dolled,distasteful,disputing,displeasure,disdain,deterrent,dehydration,defied,decomposing,dawned,dailies,custodian,crusts,crucifix,crowning,crier,crept,craze,crawls,couldn,correcting,corkmaster,copperfield,cooties,contraption,consumes,conspire,consenting,consented,conquers,congeniality,complains,communicator,commendable,collide,coladas,colada,clout,clooney,classifieds,clammy,civility,cirrhosis,chink,catskills,carvers,carpool,carelessness,cardio,carbs,capades,butabi,busmalis,burping,burdens,bunks,buncha,bulldozers,browse,brockovich,breakthroughs,bravado,boogety,blossoms,blooming,bloodsucker,blight,betterton,betrayer,belittle,beeps,bawling,barts,bartending,bankbooks,babish,atropine,assertive,armbrust,anyanka,annoyance,anemic,anago,airwaves,aimlessly,aaargh,aaand,yoghurt,writhing,workable,winking,winded,widen,whooping,whiter,whatya,wazoo,voila,virile,vests,vestibule,versed,vanishes,urkel,uproot,unwarranted,unscheduled,unparalleled,undergrad,tweedle,turtleneck,turban,trickery,transponder,toyed,townhouse,thyself,thunderstorm,thinning,thawed,tether,technicalities,tau'ri,tarnished,taffeta,tacked,systolic,swerve,sweepstakes,swabs,suspenders,superwoman,sunsets,succulent,subpoenas,stumper,stosh,stomachache,stewed,steppin,stepatech,stateside,spicoli,sparing,soulless,sonnets,sockets,snatching,smothering,slush,sloman,slashing,sitters,simpleton,sighs,sidra,sickens,shunned,shrunken,showbiz,shopped,shimmering,shagging,semblance,segue,sedation,scuzzlebutt,scumbags,screwin,scoundrels,scarsdale,scabs,saucers,saintly,saddened,runaways,runaround,rheya,resenting,rehashing,rehabilitated,regrettable,refreshed,redial,reconnecting,ravenous,raping,rafting,quandary,pylea,putrid,puffing,psychopathic,prunes,probate,prayin,pomegranate,plummeting,planing,plagues,pinata,pithy,perversion,personals,perched,peeps,peckish,pavarotti,pajama,packin,pacifier,overstepping,okama,obstetrician,nutso,nuance,normalcy,nonnegotiable,nomak,ninny,nines,nicey,newsflash,neutered,nether,negligee,necrosis,navigating,narcissistic,mylie,muses,momento,moisturizer,moderation,misinformed,misconception,minnifield,mikkos,methodical,mebbe,meager,maybes,matchmaking,masry,markovic,malakai,luzhin,lusting,lumberjack,loopholes,loaning,lightening,leotard,launder,lamaze,kubla,kneeling,kibosh,jumpsuit,joliet,jogger,janover,jakovasaurs,irreparable,innocently,inigo,infomercial,inexplicable,indispensable,impregnated,impossibly,imitating,hunches,hummus,houmfort,hothead,hostiles,hooves,hooligans,homos,homie,hisself,heyyy,hesitant,hangout,handsomest,handouts,hairless,gwennie,guzzling,guinevere,grungy,goading,glaring,gavel,gardino,gangrene,fruitful,friendlier,freckle,freakish,forthright,forearm,footnote,flops,fixer,firecracker,finito,figgered,fezzik,fastened,farfetched,fanciful,familiarize,faire,fahrenheit,extravaganza,exploratory,explanatory,everglades,eunuch,estas,escapade,erasers,emptying,embarassing,dweeb,dutiful,dumplings,dries,drafty,dollhouse,dismissing,disgraced,discrepancies,disbelief,disagreeing,digestion,didnt,deviled,deviated,demerol,delectable,decaying,decadent,dears,dateless,d'algout,cultivating,cryto,crumpled,crumbled,cronies,crease,craves,cozying,corduroy,congratulated,confidante,compressions,complicating,compadre,coerce,classier,chums,chumash,chivalrous,chinpoko,charred,chafing,celibacy,carted,carryin,carpeting,carotid,cannibals,candor,butterscotch,busts,busier,bullcrap,buggin,brookside,brodski,brassiere,brainwash,brainiac,botrelle,bonbon,boatload,blimey,blaring,blackness,bipartisan,bimbos,bigamist,biebe,biding,betrayals,bestow,bellerophon,bedpans,bassinet,basking,barzini,barnyard,barfed,backups,audited,asinine,asalaam,arouse,applejack,annoys,anchovies,ampule,alameida,aggravate,adage,accomplices,yokel,y'ever,wringer,witwer,withdrawals,windward,willfully,whorfin,whimsical,whimpering,weddin,weathered,warmest,wanton,volant,visceral,vindication,veggies,urinate,uproar,unwritten,unwrap,unsung,unsubstantiated,unspeakably,unscrupulous,unraveling,unquote,unqualified,unfulfilled,undetectable,underlined,unattainable,unappreciated,ummmm,ulcers,tylenol,tweak,turnin,tuatha,tropez,trellis,toppings,tootin,toodle,tinkering,thrives,thespis,theatrics,thatherton,tempers,tavington,tartar,tampon,swelled,sutures,sustenance,sunflowers,sublet,stubbins,strutting,strewn,stowaway,stoic,sternin,stabilizing,spiraling,spinster,speedometer,speakeasy,soooo,soiled,sneakin,smithereens,smelt,smacks,slaughterhouse,slacks,skids,sketching,skateboards,sizzling,sixes,sirree,simplistic,shouts,shorted,shoelace,sheeit,shards,shackled,sequestered,selmak,seduces,seclusion,seamstress,seabeas,scoops,scooped,scavenger,satch,s'more,rudeness,romancing,rioja,rifkin,rieper,revise,reunions,repugnant,replicating,repaid,renewing,relaxes,rekindle,regrettably,regenerate,reels,reciting,reappear,readin,ratting,rapes,rancher,rammed,rainstorm,railroading,queers,punxsutawney,punishes,pssst,prudy,proudest,protectors,procrastinating,proactive,priss,postmortem,pompoms,poise,pickings,perfectionist,peretti,people'll,pecking,patrolman,paralegal,paragraphs,paparazzi,pankot,pampering,overstep,overpower,outweigh,omnipotent,odious,nuwanda,nurtured,newsroom,neeson,needlepoint,necklaces,neato,muggers,muffler,mousy,mourned,mosey,mopey,mongolians,moldy,misinterpret,minibar,microfilm,mendola,mended,melissande,masturbating,masbath,manipulates,maimed,mailboxes,magnetism,m'lord,m'honey,lymph,lunge,lovelier,lefferts,leezak,ledgers,larraby,laloosh,kundun,kozinski,knockoff,kissin,kiosk,kennedys,kellman,karlo,kaleidoscope,jeffy,jaywalking,instructing,infraction,informer,infarction,impulsively,impressing,impersonated,impeach,idiocy,hyperbole,hurray,humped,huhuh,hsing,hordes,hoodlums,honky,hitchhiker,hideously,heaving,heathcliff,headgear,headboard,hazing,harem,handprint,hairspray,gutiurrez,goosebumps,gondola,glitches,gasping,frolic,freeways,frayed,fortitude,forgetful,forefathers,fonder,foiled,foaming,flossing,flailing,fitzgeralds,firehouse,finders,fiftieth,fellah,fawning,farquaad,faraway,fancied,extremists,exorcist,exhale,ethros,entrust,ennui,energized,encephalitis,embezzling,elster,elixir,electrolytes,duplex,dryers,drexl,dredging,drawback,don'ts,dobisch,divorcee,disrespected,disprove,disobeying,disinfectant,dingy,digress,dieting,dictating,devoured,devise,detonators,desist,deserter,derriere,deron,deceptive,debilitating,deathwok,daffodils,curtsy,cursory,cuppa,cumin,cronkite,cremation,credence,cranking,coverup,courted,countin,counselling,cornball,contentment,consensual,compost,cluett,cleverly,cleansed,cleanliness,chopec,chomp,chins,chime,cheswick,chessler,cheapest,chatted,cauliflower,catharsis,catchin,caress,camcorder,calorie,cackling,bystanders,buttoned,buttering,butted,buries,burgel,buffoon,brogna,bragged,boutros,bogeyman,blurting,blurb,blowup,bloodhound,blissful,birthmark,bigot,bestest,belted,belligerent,beggin,befall,beeswax,beatnik,beaming,barricade,baggoli,badness,awoke,artsy,artful,aroun,armpits,arming,annihilate,anise,angiogram,anaesthetic,amorous,ambiance,alligators,adoration,admittance,adama,abydos,zonked,zhivago,yorkin,wrongfully,writin,wrappers,worrywart,woops,wonderfalls,womanly,wickedness,whoopie,wholeheartedly,whimper,which'll,wheelchairs,what'ya,warranted,wallop,wading,wacked,virginal,vermouth,vermeil,verger,ventriss,veneer,vampira,utero,ushers,urgently,untoward,unshakable,unsettled,unruly,unlocks,ungodly,undue,uncooperative,uncontrollably,unbeatable,twitchy,tumbler,truest,triumphs,triplicate,tribbey,tortures,tongaree,tightening,thorazine,theres,testifies,teenaged,tearful,taxing,taldor,syllabus,swoops,swingin,suspending,sunburn,stuttering,stupor,strides,strategize,strangulation,stooped,stipulation,stingy,stapled,squeaks,squawking,spoilsport,splicing,spiel,spencers,spasms,spaniard,softener,sodding,soapbox,smoldering,smithbauer,skittish,sifting,sickest,sicilians,shuffling,shrivel,segretti,seeping,securely,scurrying,scrunch,scrote,screwups,schenkman,sawing,savin,satine,sapiens,salvaging,salmonella,sacrilege,rumpus,ruffle,roughing,rotted,rondall,ridding,rickshaw,rialto,rhinestone,restrooms,reroute,requisite,repress,rednecks,redeeming,rayed,ravell,raked,raincheck,raffi,racked,pushin,profess,prodding,procure,presuming,preppy,prednisone,potted,posttraumatic,poorhouse,podiatrist,plowed,pledging,playroom,plait,placate,pinback,picketing,photographing,pharoah,petrak,petal,persecuting,perchance,pellets,peeved,peerless,payable,pauses,pathologist,pagliacci,overwrought,overreaction,overqualified,overheated,outcasts,otherworldly,opinionated,oodles,oftentimes,occured,obstinate,nutritionist,numbness,nubile,nooooooo,nobodies,nepotism,neanderthals,mushu,mucus,mothering,mothballs,monogrammed,molesting,misspoke,misspelled,misconstrued,miscalculated,minimums,mince,mildew,mighta,middleman,mementos,mellowed,mayol,mauled,massaged,marmalade,mardi,makings,lundegaard,lovingly,loudest,lotto,loosing,loompa,looming,longs,loathes,littlest,littering,lifelike,legalities,laundered,lapdog,lacerations,kopalski,knobs,knitted,kittridge,kidnaps,kerosene,karras,jungles,jockeys,iranoff,invoices,invigorating,insolence,insincere,insectopia,inhumane,inhaling,ingrates,infestation,individuality,indeterminate,incomprehensible,inadequacy,impropriety,importer,imaginations,illuminating,ignite,hysterics,hypodermic,hyperventilate,hyperactive,humoring,honeymooning,honed,hoist,hoarding,hitching,hiker,hightail,hemoglobin,hell'd,heinie,growin,grasped,grandparent,granddaughters,gouged,goblins,gleam,glades,gigantor,get'em,geriatric,gatekeeper,gargoyles,gardenias,garcon,garbo,gallows,gabbing,futon,fulla,frightful,freshener,fortuitous,forceps,fogged,fodder,foamy,flogging,flaun,flared,fireplaces,feverish,favell,fattest,fattening,fallow,extraordinaire,evacuating,errant,envied,enchant,enamored,egocentric,dussander,dunwitty,dullest,dropout,dredged,dorsia,doornail,donot,dongs,dogged,dodgy,ditty,dishonorable,discriminating,discontinue,dings,dilly,dictation,dialysis,delly,delightfully,daryll,dandruff,cruddy,croquet,cringe,crimp,credo,crackling,courtside,counteroffer,counterfeiting,corrupting,copping,conveyor,contusions,contusion,conspirator,consoling,connoisseur,confetti,composure,compel,colic,coddle,cocksuckers,coattails,cloned,claustrophobia,clamoring,churn,chugga,chirping,chasin,chapped,chalkboard,centimeter,caymans,catheter,casings,caprica,capelli,cannolis,cannoli,camogli,camembert,butchers,butchered,busboys,bureaucrats,buckled,bubbe,brownstone,bravely,brackley,bouquets,botox,boozing,boosters,bodhi,blunders,blunder,blockage,biocyte,betrays,bested,beryllium,beheading,beggar,begbie,beamed,bastille,barstool,barricades,barbecues,barbecued,bandwagon,backfiring,bacarra,avenged,autopsies,aunties,associating,artichoke,arrowhead,appendage,apostrophe,antacid,ansel,annul,amuses,amped,amicable,amberg,alluring,adversaries,admirers,adlai,acupuncture,abnormality,aaaahhhh,zooming,zippity,zipping,zeroed,yuletide,yoyodyne,yengeese,yeahhh,wrinkly,wracked,withered,winks,windmills,whopping,wendle,weigart,waterworks,waterbed,watchful,wantin,wagging,waaah,vying,ventricle,varnish,vacuumed,unreachable,unprovoked,unmistakable,unfriendly,unfolding,underpaid,uncuff,unappealing,unabomber,typhoid,tuxedos,tushie,turds,tumnus,troubadour,trinium,treaters,treads,transpired,transgression,tought,thready,thins,thinners,techs,teary,tattaglia,tassels,tarzana,tanking,tablecloths,synchronize,symptomatic,sycophant,swimmingly,sweatshop,surfboard,superpowers,sunroom,sunblock,sugarplum,stupidly,strumpet,strapless,stooping,stools,stealthy,stalks,stairmaster,staffer,sshhh,squatting,squatters,spectacularly,sorbet,socked,sociable,snubbed,snorting,sniffles,snazzy,snakebite,smuggler,smorgasbord,smooching,slurping,slouch,slingshot,slaved,skimmed,sisterhood,silliest,sidarthur,sheraton,shebang,sharpening,shanghaied,shakers,sendoff,scurvy,scoliosis,scaredy,scagnetti,sawchuk,saugus,sasquatch,sandbag,saltines,s'pose,roston,rostle,riveting,ristle,rifling,revulsion,reverently,retrograde,restful,resents,reptilian,reorganize,renovating,reiterate,reinvent,reinmar,reibers,reechard,recuse,reconciling,recognizance,reclaiming,recitation,recieved,rebate,reacquainted,rascals,railly,quintuplets,quahog,pygmies,puzzling,punctuality,prosthetic,proms,probie,preys,preserver,preppie,poachers,plummet,plumbers,plannin,pitying,pitfalls,piqued,pinecrest,pinches,pillage,pigheaded,physique,pessimistic,persecute,perjure,percentile,pentothal,pensky,penises,peini,pazzi,pastels,parlour,paperweight,pamper,pained,overwhelm,overalls,outrank,outpouring,outhouse,outage,ouija,obstructed,obsessions,obeying,obese,o'riley,o'higgins,nosebleeds,norad,noooooooo,nononono,nonchalant,nippy,neurosis,nekhorvich,necronomicon,naquada,n'est,mystik,mystified,mumps,muddle,mothership,moped,monumentally,monogamous,mondesi,misogynistic,misinterpreting,mindlock,mending,megaphone,meeny,medicating,meanie,masseur,markstrom,marklars,margueritas,manifesting,maharajah,lukewarm,loveliest,loran,lizardo,liquored,lipped,lingers,limey,lemkin,leisurely,lathe,latched,lapping,ladle,krevlorneswath,kosygin,khakis,kenaru,keats,kaitlan,julliard,jollies,jaundice,jargon,jackals,invisibility,insipid,inflamed,inferiority,inexperience,incinerated,incinerate,incendiary,incan,inbred,implicating,impersonator,hunks,horsing,hooded,hippopotamus,hiked,hetson,hetero,hessian,henslowe,hendler,hellstrom,headstone,hayloft,harbucks,handguns,hallucinate,haldol,haggling,gynaecologist,gulag,guilder,guaranteeing,groundskeeper,grindstone,grimoir,grievance,griddle,gribbit,greystone,graceland,gooders,goeth,gentlemanly,gelatin,gawking,ganged,fukes,fromby,frenchmen,foursome,forsley,forbids,footwork,foothold,floater,flinging,flicking,fittest,fistfight,fireballs,fillings,fiddling,fennyman,felonious,felonies,feces,favoritism,fatten,fanatics,faceman,excusing,excepted,entwined,entree,ensconced,eladio,ehrlichman,easterland,dueling,dribbling,drape,downtrodden,doused,dosed,dorleen,dokie,distort,displeased,disown,dismount,disinherited,disarmed,disapproves,diperna,dined,diligent,dicaprio,depress,decoded,debatable,dealey,darsh,damsels,damning,dad'll,d'oeuvre,curlers,curie,cubed,crikey,crepes,countrymen,cornfield,coppers,copilot,copier,cooing,conspiracies,consigliere,condoning,commoner,commies,combust,comas,colds,clawed,clamped,choosy,chomping,chimps,chigorin,chianti,cheep,checkups,cheaters,celibate,cautiously,cautionary,castell,carpentry,caroling,carjacking,caritas,caregiver,cardiology,candlesticks,canasta,cain't,burro,burnin,bunking,bumming,bullwinkle,brummel,brooms,brews,breathin,braslow,bracing,botulism,boorish,bloodless,blayne,blatantly,blankie,bedbugs,becuase,barmaid,bared,baracus,banal,bakes,backpacks,attentions,atrocious,ativan,athame,asunder,astound,assuring,aspirins,asphyxiation,ashtrays,aryans,arnon,apprehension,applauding,anvil,antiquing,antidepressants,annoyingly,amputate,altruistic,alotta,alerting,afterthought,affront,affirm,actuality,abysmal,absentee,yeller,yakushova,wuzzy,wriggle,worrier,woogyman,womanizer,windpipe,windbag,willin,whisking,whimsy,wendall,weeny,weensy,weasels,watery,watcha,wasteful,waski,washcloth,waaay,vouched,viznick,ventriloquist,vendettas,veils,vayhue,vamanos,vadimus,upstage,uppity,unsaid,unlocking,unintentionally,undetected,undecided,uncaring,unbearably,tween,tryout,trotting,trini,trimmings,trickier,treatin,treadstone,trashcan,transcendent,tramps,townsfolk,torturous,torrid,toothpicks,tolerable,tireless,tiptoeing,timmay,tillinghouse,tidying,tibia,thumbing,thrusters,thrashing,these'll,thatos,testicular,teriyaki,tenors,tenacity,tellers,telemetry,tarragon,switchblade,swicker,swells,sweatshirts,swatches,surging,supremely,sump'n,succumb,subsidize,stumbles,stuffs,stoppin,stipulate,stenographer,steamroll,stasis,stagger,squandered,splint,splendidly,splashy,splashing,specter,sorcerers,somewheres,somber,snuggled,snowmobile,sniffed,snags,smugglers,smudged,smirking,smearing,slings,sleet,sleepovers,sleek,slackers,siree,siphoning,singed,sincerest,sickened,shuffled,shriveled,shorthanded,shittin,shish,shipwrecked,shins,sheetrock,shawshank,shamu,sha're,servitude,sequins,seascape,scrapings,scoured,scorching,sandpaper,saluting,salud,ruffled,roughnecks,rougher,rosslyn,rosses,roost,roomy,romping,revolutionize,reprimanded,refute,refrigerated,reeled,redundancies,rectal,recklessly,receding,reassignment,reapers,readout,ration,raring,ramblings,raccoons,quarantined,purging,punters,psychically,premarital,pregnancies,predisposed,precautionary,pollute,podunk,plums,plaything,pixilated,pitting,piranhas,pieced,piddles,pickled,photogenic,phosphorous,pffft,pestilence,pessimist,perspiration,perps,penticoff,passageways,pardons,panics,pancamo,paleontologist,overwhelms,overstating,overpaid,overdid,outlive,orthodontist,orgies,oreos,ordover,ordinates,ooooooh,oooohhh,omelettes,officiate,obtuse,obits,nymph,novocaine,noooooooooo,nipping,nilly,nightstick,negate,neatness,natured,narcotic,narcissism,namun,nakatomi,murky,muchacho,mouthwash,motzah,morsel,morph,morlocks,mooch,moloch,molest,mohra,modus,modicum,mockolate,misdemeanors,miscalculation,middies,meringue,mercilessly,meditating,mayakovsky,maximillian,marlee,markovski,maniacal,maneuvered,magnificence,maddening,lutze,lunged,lovelies,lorry,loosening,lookee,littered,lilac,lightened,laces,kurzon,kurtzweil,kind've,kimono,kenji,kembu,keanu,kazuo,jonesing,jilted,jiggling,jewelers,jewbilee,jacqnoud,jacksons,ivories,insurmountable,innocuous,innkeeper,infantery,indulged,indescribable,incoherent,impervious,impertinent,imperfections,hunnert,huffy,horsies,horseradish,hollowed,hogwash,hockley,hissing,hiromitsu,hidin,hereafter,helpmann,hehehe,haughty,happenings,hankie,handsomely,halliwells,haklar,haise,gunsights,grossly,grope,grocer,grits,gripping,grabby,glorificus,gizzard,gilardi,gibarian,geminon,gasses,garnish,galloping,gairwyn,futterman,futility,fumigated,fruitless,friendless,freon,foregone,forego,floored,flighty,flapjacks,fizzled,ficus,festering,farbman,fabricate,eyghon,extricate,exalted,eventful,esophagus,enterprising,entail,endor,emphatically,embarrasses,electroshock,easel,duffle,drumsticks,dissection,dissected,disposing,disparaging,disorientation,disintegrated,disarming,devoting,dessaline,deprecating,deplorable,delve,degenerative,deduct,decomposed,deathly,dearie,daunting,dankova,cyclotron,cyberspace,cutbacks,culpable,cuddled,crumpets,cruelly,crouching,cranium,cramming,cowering,couric,cordesh,conversational,conclusively,clung,clotting,cleanest,chipping,chimpanzee,chests,cheapen,chainsaws,censure,catapult,caravaggio,carats,captivating,calrissian,butlers,busybody,bussing,bunion,bulimic,budging,brung,browbeat,brokenhearted,brecher,breakdowns,bracebridge,boning,blowhard,blisters,blackboard,bigotry,bialy,bhamra,bended,begat,battering,baste,basquiat,barricaded,barometer,balled,baited,badenweiler,backhand,ascenscion,argumentative,appendicitis,apparition,anxiously,antagonistic,angora,anacott,amniotic,ambience,alonna,aleck,akashic,ageless,abouts,aawwww,aaaaarrrrrrggghhh,aaaaaa,zendi,yuppies,yodel,y'hear,wrangle,wombosi,wittle,withstanding,wisecracks,wiggling,wierd,whittlesley,whipper,whattya,whatsamatter,whatchamacallit,whassup,whad'ya,weakling,warfarin,waponis,wampum,wadn't,vorash,vizzini,virtucon,viridiana,veracity,ventilated,varicose,varcon,vandalized,vamos,vamoose,vaccinated,vacationing,usted,urinal,uppers,unwittingly,unsealed,unplanned,unhinged,unhand,unfathomable,unequivocally,unbreakable,unadvisedly,udall,tynacorp,tuxes,tussle,turati,tunic,tsavo,trussed,troublemakers,trollop,tremors,transsexual,transfusions,toothbrushes,toned,toddlers,tinted,tightened,thundering,thorpey,this'd,thespian,thaddius,tenuous,tenths,tenement,telethon,teleprompter,teaspoon,taunted,tattle,tardiness,taraka,tappy,tapioca,tapeworm,talcum,tacks,swivel,swaying,superpower,summarize,sumbitch,sultry,suburbia,styrofoam,stylings,strolls,strobe,stockpile,stewardesses,sterilized,sterilize,stealin,stakeouts,squawk,squalor,squabble,sprinkled,sportsmanship,spokes,spiritus,sparklers,spareribs,sowing,sororities,sonovabitch,solicit,softy,softness,softening,snuggling,snatchers,snarling,snarky,snacking,smears,slumped,slowest,slithering,sleazebag,slayed,slaughtering,skidded,skated,sivapathasundaram,sissies,silliness,silences,sidecar,sicced,shylock,shtick,shrugged,shriek,shoves,should'a,shortcake,shockingly,shirking,shaves,shatner,sharpener,shapely,shafted,sexless,septum,selflessness,seabea,scuff,screwball,scoping,scooch,scolding,schnitzel,schemed,scalper,santy,sankara,sanest,salesperson,sakulos,safehouse,sabers,runes,rumblings,rumbling,ruijven,ringers,righto,rhinestones,retrieving,reneging,remodelling,relentlessly,regurgitate,refills,reeking,reclusive,recklessness,recanted,ranchers,rafer,quaking,quacks,prophesied,propensity,profusely,problema,prided,prays,postmark,popsicles,poodles,pollyanna,polaroids,pokes,poconos,pocketful,plunging,plugging,pleeease,platters,pitied,pinetti,piercings,phooey,phonies,pestering,periscope,pentagram,pelts,patronized,paramour,paralyze,parachutes,pales,paella,paducci,owatta,overdone,overcrowded,overcompensating,ostracized,ordinate,optometrist,operandi,omens,okayed,oedipal,nuttier,nuptial,nunheim,noxious,nourish,notepad,nitroglycerin,nibblet,neuroses,nanosecond,nabbit,mythic,munchkins,multimillion,mulroney,mucous,muchas,mountaintop,morlin,mongorians,moneybags,mom'll,molto,mixup,misgivings,mindset,michalchuk,mesmerized,merman,mensa,meaty,mbwun,materialize,materialistic,masterminded,marginally,mapuhe,malfunctioning,magnify,macnamara,macinerney,machinations,macadamia,lysol,lurks,lovelorn,lopsided,locator,litback,litany,linea,limousines,limes,lighters,liebkind,levity,levelheaded,letterhead,lesabre,leron,lepers,lefts,leftenant,laziness,layaway,laughlan,lascivious,laryngitis,lapsed,landok,laminated,kurten,kobol,knucklehead,knowed,knotted,kirkeby,kinsa,karnovsky,jolla,jimson,jettison,jeric,jawed,jankis,janitors,jango,jalopy,jailbreak,jackers,jackasses,invalidate,intercepting,intercede,insinuations,infertile,impetuous,impaled,immerse,immaterial,imbeciles,imagines,idyllic,idolized,icebox,i'd've,hypochondriac,hyphen,hurtling,hurried,hunchback,hullo,horsting,hoooo,homeboys,hollandaise,hoity,hijinks,hesitates,herrero,herndorff,helplessly,heeyy,heathen,hearin,headband,harrassment,harpies,halstrom,hahahahaha,hacer,grumbling,grimlocks,grift,greets,grandmothers,grander,grafts,gordievsky,gondorff,godorsky,glscripts,gaudy,gardeners,gainful,fuses,fukienese,frizzy,freshness,freshening,fraught,frantically,foxbooks,fortieth,forked,foibles,flunkies,fleece,flatbed,fisted,firefight,fingerpaint,filibuster,fhloston,fenceline,femur,fatigues,fanucci,fantastically,familiars,falafel,fabulously,eyesore,expedient,ewwww,eviscerated,erogenous,epidural,enchante,embarassed,embarass,embalming,elude,elspeth,electrocute,eigth,eggshell,echinacea,eases,earpiece,earlobe,dumpsters,dumbshit,dumbasses,duloc,duisberg,drummed,drinkers,dressy,dorma,doily,divvy,diverting,dissuade,disrespecting,displace,disorganized,disgustingly,discord,disapproving,diligence,didja,diced,devouring,detach,destructing,desolate,demerits,delude,delirium,degrade,deevak,deemesa,deductions,deduce,debriefed,deadbeats,dateline,darndest,damnable,dalliance,daiquiri,d'agosta,cussing,cryss,cripes,cretins,crackerjack,cower,coveting,couriers,countermission,cotswolds,convertibles,conversationalist,consorting,consoled,consarn,confides,confidentially,commited,commiserate,comme,comforter,comeuppance,combative,comanches,colosseum,colling,coexist,coaxing,cliffside,chutes,chucked,chokes,childlike,childhoods,chickening,chenowith,charmingly,changin,catsup,captioning,capsize,cappucino,capiche,candlewell,cakewalk,cagey,caddie,buxley,bumbling,bulky,buggered,brussel,brunettes,brumby,brotha,bronck,brisket,bridegroom,braided,bovary,bookkeeper,bluster,bloodline,blissfully,blase,billionaires,bicker,berrisford,bereft,berating,berate,bendy,belive,belated,beikoku,beens,bedspread,bawdy,barreling,baptize,banya,balthazar,balmoral,bakshi,bails,badgered,backstreet,awkwardly,auras,attuned,atheists,astaire,assuredly,arrivederci,appetit,appendectomy,apologetic,antihistamine,anesthesiologist,amulets,albie,alarmist,aiight,adstream,admirably,acquaint,abound,abominable,aaaaaaah,zekes,zatunica,wussy,worded,wooed,woodrell,wiretap,windowsill,windjammer,windfall,whisker,whims,whatiya,whadya,weirdly,weenies,waunt,washout,wanto,waning,victimless,verdad,veranda,vandaley,vancomycin,valise,vaguest,upshot,unzip,unwashed,untrained,unstuck,unprincipled,unmentionables,unjustly,unfolds,unemployable,uneducated,unduly,undercut,uncovering,unconsciousness,unconsciously,tyndareus,turncoat,turlock,tulle,tryouts,trouper,triplette,trepkos,tremor,treeger,trapeze,traipse,tradeoff,trach,torin,tommorow,tollan,toity,timpani,thumbprint,thankless,tell'em,telepathy,telemarketing,telekinesis,teevee,teeming,tarred,tambourine,talentless,swooped,switcheroo,swirly,sweatpants,sunstroke,suitors,sugarcoat,subways,subterfuge,subservient,subletting,stunningly,strongbox,striptease,stravanavitch,stradling,stoolie,stodgy,stocky,stifle,stealer,squeezes,squatter,squarely,sprouted,spool,spindly,speedos,soups,soundly,soulmates,somebody'll,soliciting,solenoid,sobering,snowflakes,snowballs,snores,slung,slimming,skulk,skivvies,skewered,skewer,sizing,sistine,sidebar,sickos,shushing,shunt,shugga,shone,shol'va,sharpened,shapeshifter,shadowing,shadoe,selectman,sefelt,seared,scrounging,scribbling,scooping,scintillating,schmoozing,scallops,sapphires,sanitarium,sanded,safes,rudely,roust,rosebush,rosasharn,rondell,roadhouse,riveted,rewrote,revamp,retaliatory,reprimand,replicators,replaceable,remedied,relinquishing,rejoicing,reincarnated,reimbursed,reevaluate,redid,redefine,recreating,reconnected,rebelling,reassign,rearview,rayne,ravings,ratso,rambunctious,radiologist,quiver,quiero,queef,qualms,pyrotechnics,pulsating,psychosomatic,proverb,promiscuous,profanity,prioritize,preying,predisposition,precocious,precludes,prattling,prankster,povich,potting,postpartum,porridge,polluting,plowing,pistachio,pissin,pickpocket,physicals,peruse,pertains,personified,personalize,perjured,perfecting,pepys,pepperdine,pembry,peering,peels,pedophile,patties,passkey,paratrooper,paraphernalia,paralyzing,pandering,paltry,palpable,pagers,pachyderm,overstay,overestimated,overbite,outwit,outgrow,outbid,ooops,oomph,oohhh,oldie,obliterate,objectionable,nygma,notting,noches,nitty,nighters,newsstands,newborns,neurosurgery,nauseated,nastiest,narcolepsy,mutilate,muscled,murmur,mulva,mulling,mukada,muffled,morgues,moonbeams,monogamy,molester,molestation,molars,moans,misprint,mismatched,mirth,mindful,mimosas,millander,mescaline,menstrual,menage,mellowing,medevac,meddlesome,matey,manicures,malevolent,madmen,macaroons,lydell,lycra,lunchroom,lunching,lozenges,looped,litigious,liquidate,linoleum,lingk,limitless,limber,lilacs,ligature,liftoff,lemmiwinks,leggo,learnin,lazarre,lawyered,lactose,knelt,kenosha,kemosabe,jussy,junky,jordy,jimmies,jeriko,jakovasaur,issacs,isabela,irresponsibility,ironed,intoxication,insinuated,inherits,ingest,ingenue,inflexible,inflame,inevitability,inedible,inducement,indignant,indictments,indefensible,incomparable,incommunicado,improvising,impounded,illogical,ignoramus,hydrochloric,hydrate,hungover,humorless,humiliations,hugest,hoverdrone,hovel,hmmph,hitchhike,hibernating,henchman,helloooo,heirlooms,heartsick,headdress,hatches,harebrained,hapless,hanen,handsomer,hallows,habitual,guten,gummy,guiltier,guidebook,gstaad,gruff,griss,grieved,grata,gorignak,goosed,goofed,glowed,glitz,glimpses,glancing,gilmores,gianelli,geraniums,garroway,gangbusters,gamblers,galls,fuddy,frumpy,frowning,frothy,fro'tak,frere,fragrances,forgettin,follicles,flowery,flophouse,floatin,flirts,flings,flatfoot,fingerprinting,fingerprinted,fingering,finald,fillet,fianc,femoral,federales,fawkes,fascinates,farfel,fambly,falsified,fabricating,exterminators,expectant,excusez,excrement,excercises,evian,etins,esophageal,equivalency,equate,equalizer,entrees,enquire,endearment,empathetic,emailed,eggroll,earmuffs,dyslexic,duper,duesouth,drunker,druggie,dreadfully,dramatics,dragline,downplay,downers,dominatrix,doers,docket,docile,diversify,distracts,disloyalty,disinterested,discharging,disagreeable,dirtier,dinghy,dimwitted,dimoxinil,dimmy,diatribe,devising,deviate,detriment,desertion,depressants,depravity,deniability,delinquents,defiled,deepcore,deductive,decimate,deadbolt,dauthuille,dastardly,daiquiris,daggers,dachau,curiouser,curdled,cucamonga,cruller,cruces,crosswalk,crinkle,crescendo,cremate,counseled,couches,cornea,corday,copernicus,contrition,contemptible,constipated,conjoined,confounded,condescend,concoct,conch,compensating,committment,commandeered,comely,coddled,cockfight,cluttered,clunky,clownfish,cloaked,clenched,cleanin,civilised,circumcised,cimmeria,cilantro,chutzpah,chucking,chiseled,chicka,chattering,cervix,carrey,carpal,carnations,cappuccinos,candied,calluses,calisthenics,bushy,burners,budington,buchanans,brimming,braids,boycotting,bouncers,botticelli,botherin,bookkeeping,bogyman,bogged,bloodthirsty,blintzes,blanky,binturong,billable,bigboote,bewildered,betas,bequeath,behoove,befriend,bedpost,bedded,baudelaires,barreled,barboni,barbeque,bangin,baltus,bailout,backstabber,baccarat,awning,augie,arguillo,archway,apricots,apologising,annyong,anchorman,amenable,amazement,allspice,alannis,airfare,airbags,ahhhhhhhhh,ahhhhhhhh,ahhhhhhh,agitator,adrenal,acidosis,achoo,accessorizing,accentuate,abrasions,abductor,aaaahhh,aaaaaaaa,aaaaaaa,zeroing,zelner,zeldy,yevgeny,yeska,yellows,yeesh,yeahh,yamuri,wouldn't've,workmanship,woodsman,winnin,winked,wildness,whoring,whitewash,whiney,when're,wheezer,wheelman,wheelbarrow,westerburg,weeding,watermelons,washboard,waltzes,wafting,voulez,voluptuous,vitone,vigilantes,videotaping,viciously,vices,veruca,vermeer,verifying,vasculitis,valets,upholstered,unwavering,untold,unsympathetic,unromantic,unrecognizable,unpredictability,unmask,unleashing,unintentional,unglued,unequivocal,underrated,underfoot,unchecked,unbutton,unbind,unbiased,unagi,uhhhhh,tugging,triads,trespasses,treehorn,traviata,trappers,transplants,trannie,tramping,tracheotomy,tourniquet,tooty,toothless,tomarrow,toasters,thruster,thoughtfulness,thornwood,tengo,tenfold,telltale,telephoto,telephoned,telemarketer,tearin,tastic,tastefully,tasking,taser,tamed,tallow,taketh,taillight,tadpoles,tachibana,syringes,sweated,swarthy,swagger,surges,supermodels,superhighway,sunup,sun'll,sulfa,sugarless,sufficed,subside,strolled,stringy,strengthens,straightest,straightens,storefront,stopper,stockpiling,stimulant,stiffed,steyne,sternum,stepladder,stepbrother,steers,steelheads,steakhouse,stathis,stankylecartmankennymr,standoffish,stalwart,squirted,spritz,sprig,sprawl,spousal,sphincter,spenders,spearmint,spatter,spangled,southey,soured,sonuvabitch,somethng,snuffed,sniffs,smokescreen,smilin,slobs,sleepwalker,sleds,slays,slayage,skydiving,sketched,skanks,sixed,siphoned,siphon,simpering,sigfried,sidearm,siddons,sickie,shuteye,shuffleboard,shrubberies,shrouded,showmanship,shouldn't've,shoplift,shiatsu,sentries,sentance,sensuality,seething,secretions,searing,scuttlebutt,sculpt,scowling,scouring,scorecard,schoolers,schmucks,scepters,scaly,scalps,scaffolding,sauces,sartorius,santen,salivating,sainthood,saget,saddens,rygalski,rusting,ruination,rueland,rudabaga,rottweiler,roofies,romantics,rollerblading,roldy,roadshow,rickets,rible,rheza,revisiting,retentive,resurface,restores,respite,resounding,resorting,resists,repulse,repressing,repaying,reneged,refunds,rediscover,redecorated,reconstructive,recommitted,recollect,receptacle,reassess,reanimation,realtors,razinin,rationalization,ratatouille,rashum,rasczak,rancheros,rampler,quizzing,quips,quartered,purring,pummeling,puede,proximo,prospectus,pronouncing,prolonging,procreation,proclamations,principled,prides,preoccupation,prego,precog,prattle,pounced,potshots,potpourri,porque,pomegranates,polenta,plying,pluie,plesac,playmates,plantains,pillowcase,piddle,pickers,photocopied,philistine,perpetuate,perpetually,perilous,pawned,pausing,pauper,parter,parlez,parlay,pally,ovulation,overtake,overstate,overpowering,overpowered,overconfident,overbooked,ovaltine,outweighs,outings,ottos,orrin,orifice,orangutan,oopsy,ooooooooh,oooooo,ooohhhh,ocular,obstruct,obscenely,o'dwyer,nutjob,nunur,notifying,nostrand,nonny,nonfat,noblest,nimble,nikes,nicht,newsworthy,nestled,nearsighted,ne'er,nastier,narco,nakedness,muted,mummified,mudda,mozzarella,moxica,motivator,motility,mothafucka,mortmain,mortgaged,mores,mongers,mobbed,mitigating,mistah,misrepresented,mishke,misfortunes,misdirection,mischievous,mineshaft,millaney,microwaves,metzenbaum,mccovey,masterful,masochistic,marliston,marijawana,manya,mantumbi,malarkey,magnifique,madrona,madox,machida,m'hidi,lullabies,loveliness,lotions,looka,lompoc,litterbug,litigator,lithe,liquorice,linds,limericks,lightbulb,lewises,letch,lemec,layover,lavatory,laurels,lateness,laparotomy,laboring,kuato,kroff,krispy,krauts,knuckleheads,kitschy,kippers,kimbrow,keypad,keepsake,kebab,karloff,junket,judgemental,jointed,jezzie,jetting,jeeze,jeeter,jeesus,jeebs,janeane,jails,jackhammer,ixnay,irritates,irritability,irrevocable,irrefutable,irked,invoking,intricacies,interferon,intents,insubordinate,instructive,instinctive,inquisitive,inlay,injuns,inebriated,indignity,indecisive,incisors,incacha,inalienable,impresses,impregnate,impregnable,implosion,idolizes,hypothyroidism,hypoglycemic,huseni,humvee,huddling,honing,hobnobbing,hobnob,histrionics,histamine,hirohito,hippocratic,hindquarters,hikita,hikes,hightailed,hieroglyphics,heretofore,herbalist,hehey,hedriks,heartstrings,headmistress,headlight,hardheaded,happend,handlebars,hagitha,habla,gyroscope,guys'd,guy'd,guttersnipe,grump,growed,grovelling,groan,greenbacks,gravedigger,grating,grasshoppers,grandiose,grandest,grafted,gooood,goood,gooks,godsakes,goaded,glamorama,giveth,gingham,ghostbusters,germane,georgy,gazzo,gazelles,gargle,garbled,galgenstein,gaffe,g'day,fyarl,furnish,furies,fulfills,frowns,frowned,frighteningly,freebies,freakishly,forewarned,foreclose,forearms,fordson,fonics,flushes,flitting,flemmer,flabby,fishbowl,fidgeting,fevers,feigning,faxing,fatigued,fathoms,fatherless,fancier,fanatical,factored,eyelid,eyeglasses,expresso,expletive,expectin,excruciatingly,evidentiary,ever'thing,eurotrash,eubie,estrangement,erlich,epitome,entrap,enclose,emphysema,embers,emasculating,eighths,eardrum,dyslexia,duplicitous,dumpty,dumbledore,dufus,duddy,duchamp,drunkenness,drumlin,drowns,droid,drinky,drifts,drawbridge,dramamine,douggie,douchebag,dostoyevsky,doodling,don'tcha,domineering,doings,dogcatcher,doctoring,ditzy,dissimilar,dissecting,disparage,disliking,disintegrating,dishwalla,dishonored,dishing,disengaged,disavowed,dippy,diorama,dimmed,dilate,digitalis,diggory,dicing,diagnosing,devola,desolation,dennings,denials,deliverance,deliciously,delicacies,degenerates,degas,deflector,defile,deference,decrepit,deciphered,dawdle,dauphine,daresay,dangles,dampen,damndest,cucumbers,cucaracha,cryogenically,croaks,croaked,criticise,crisper,creepiest,creams,crackle,crackin,covertly,counterintelligence,corrosive,cordially,cops'll,convulsions,convoluted,conversing,conga,confrontational,confab,condolence,condiments,complicit,compiegne,commodus,comings,cometh,collusion,collared,cockeyed,clobber,clemonds,clarithromycin,cienega,christmasy,christmassy,chloroform,chippie,chested,cheeco,checklist,chauvinist,chandlers,chambermaid,chakras,cellophane,caveat,cataloguing,cartmanland,carples,carny,carded,caramels,cappy,caped,canvassing,callback,calibrated,calamine,buttermilk,butterfingers,bunsen,bulimia,bukatari,buildin,budged,brobich,bringer,brendell,brawling,bratty,braised,boyish,boundless,botch,boosh,bookies,bonbons,bodes,bobunk,bluntly,blossoming,bloomers,bloodstains,bloodhounds,blech,biter,biometric,bioethics,bijan,bigoted,bicep,bereaved,bellowing,belching,beholden,beached,batmobile,barcodes,barch,barbecuing,bandanna,backwater,backtrack,backdraft,augustino,atrophy,atrocity,atley,atchoo,asthmatic,assoc,armchair,arachnids,aptly,appetizing,antisocial,antagonizing,anorexia,anini,andersons,anagram,amputation,alleluia,airlock,aimless,agonized,agitate,aggravating,aerosol,acing,accomplishing,accidently,abuser,abstain,abnormally,aberration,aaaaahh,zlotys,zesty,zerzura,zapruder,zantopia,yelburton,yeess,y'knowwhati'msayin,wwhat,wussies,wrenched,would'a,worryin,wormser,wooooo,wookiee,wolchek,wishin,wiseguys,windbreaker,wiggy,wieners,wiedersehen,whoopin,whittled,wherefore,wharvey,welts,wellstone,wedges,wavered,watchit,wastebasket,wango,waken,waitressed,wacquiem,vrykolaka,voula,vitally,visualizing,viciousness,vespers,vertes,verily,vegetarians,vater,vaporize,vannacutt,vallens,ussher,urinating,upping,unwitting,untangle,untamed,unsanitary,unraveled,unopened,unisex,uninvolved,uninteresting,unintelligible,unimaginative,undeserving,undermines,undergarments,unconcerned,tyrants,typist,tykes,tybalt,twosome,twits,tutti,turndown,tularemia,tuberculoma,tsimshian,truffaut,truer,truant,trove,triumphed,tripe,trigonometry,trifled,trifecta,tribulations,tremont,tremoille,transcends,trafficker,touchin,tomfoolery,tinkered,tinfoil,tightrope,thousan,thoracotomy,thesaurus,thawing,thatta,tessio,temps,taxidermist,tator,tachycardia,t'akaya,swelco,sweetbreads,swatting,supercollider,sunbathing,summarily,suffocation,sueleen,succinct,subsided,submissive,subjecting,subbing,subatomic,stupendous,stunted,stubble,stubbed,streetwalker,strategizing,straining,straightaway,stoli,stiffer,stickup,stens,steamroller,steadwell,steadfast,stateroom,stans,sshhhh,squishing,squinting,squealed,sprouting,sprimp,spreadsheets,sprawled,spotlights,spooning,spirals,speedboat,spectacles,speakerphone,southglen,souse,soundproof,soothsayer,sommes,somethings,solidify,soars,snorted,snorkeling,snitches,sniping,snifter,sniffin,snickering,sneer,snarl,smila,slinking,slanted,slanderous,slammin,skimp,skilosh,siteid,sirloin,singe,sighing,sidekicks,sicken,showstopper,shoplifter,shimokawa,sherborne,shavadai,sharpshooters,sharking,shagged,shaddup,senorita,sesterces,sensuous,seahaven,scullery,scorcher,schotzie,schnoz,schmooze,schlep,schizo,scents,scalping,scalped,scallop,scalding,sayeth,saybrooke,sawed,savoring,sardine,sandstorm,sandalwood,salutations,sagman,s'okay,rsvp'd,rousted,rootin,romper,romanovs,rollercoaster,rolfie,robinsons,ritzy,ritualistic,ringwald,rhymed,rheingold,rewrites,revoking,reverts,retrofit,retort,retinas,respirations,reprobate,replaying,repaint,renquist,renege,relapsing,rekindled,rejuvenating,rejuvenated,reinstating,recriminations,rechecked,reassemble,rears,reamed,reacquaint,rayanne,ravish,rathole,raspail,rarest,rapists,rants,racketeer,quittin,quitters,quintessential,queremos,quellek,quelle,quasimodo,pyromaniac,puttanesca,puritanical,purer,puree,pungent,pummel,puedo,psychotherapist,prosecutorial,prosciutto,propositioning,procrastination,probationary,primping,preventative,prevails,preservatives,preachy,praetorians,practicality,powders,potus,postop,positives,poser,portolano,portokalos,poolside,poltergeists,pocketed,poach,plummeted,plucking,plimpton,playthings,plastique,plainclothes,pinpointed,pinkus,pinks,pigskin,piffle,pictionary,piccata,photocopy,phobias,perignon,perfumes,pecks,pecked,patently,passable,parasailing,paramus,papier,paintbrush,pacer,paaiint,overtures,overthink,overstayed,overrule,overestimate,overcooked,outlandish,outgrew,outdoorsy,outdo,orchestrate,oppress,opposable,oooohh,oomupwah,okeydokey,okaaay,ohashi,of'em,obscenities,oakie,o'gar,nurection,nostradamus,norther,norcom,nooch,nonsensical,nipped,nimbala,nervously,neckline,nebbleman,narwhal,nametag,n'n't,mycenae,muzak,muumuu,mumbled,mulvehill,muggings,muffet,mouthy,motivates,motaba,moocher,mongi,moley,moisturize,mohair,mocky,mmkay,mistuh,missis,misdeeds,mincemeat,miggs,miffed,methadone,messieur,menopausal,menagerie,mcgillicuddy,mayflowers,matrimonial,matick,masai,marzipan,maplewood,manzelle,mannequins,manhole,manhandle,malfunctions,madwoman,machiavelli,lynley,lynched,lurconis,lujack,lubricant,looove,loons,loofah,lonelyhearts,lollipops,lineswoman,lifers,lexter,lepner,lemony,leggy,leafy,leadeth,lazerus,lazare,lawford,languishing,lagoda,ladman,kundera,krinkle,krendler,kreigel,kowolski,knockdown,knifed,kneed,kneecap,kids'll,kennie,kenmore,keeled,kazootie,katzenmoyer,kasdan,karak,kapowski,kakistos,julyan,jockstrap,jobless,jiggly,jaunt,jarring,jabbering,irrigate,irrevocably,irrationally,ironies,invitro,intimated,intently,intentioned,intelligently,instill,instigator,instep,inopportune,innuendoes,inflate,infects,infamy,indiscretions,indiscreet,indio,indignities,indict,indecision,inconspicuous,inappropriately,impunity,impudent,impotence,implicates,implausible,imperfection,impatience,immutable,immobilize,idealist,iambic,hysterically,hyperspace,hygienist,hydraulics,hydrated,huzzah,husks,hunched,huffed,hubris,hubbub,hovercraft,houngan,hosed,horoscopes,hopelessness,hoodwinked,honorably,honeysuckle,homegirl,holiest,hippity,hildie,hieroglyphs,hexton,herein,heckle,heaping,healthilizer,headfirst,hatsue,harlot,hardwired,halothane,hairstyles,haagen,haaaaa,gutting,gummi,groundless,groaning,gristle,grills,graynamore,grabbin,goodes,goggle,glittering,glint,gleaming,glassy,girth,gimbal,giblets,gellers,geezers,geeze,garshaw,gargantuan,garfunkel,gangway,gandarium,gamut,galoshes,gallivanting,gainfully,gachnar,fusionlips,fusilli,furiously,frugal,fricking,frederika,freckling,frauds,fountainhead,forthwith,forgo,forgettable,foresight,foresaw,fondling,fondled,fondle,folksy,fluttering,fluffing,floundering,flirtatious,flexing,flatterer,flaring,fixating,finchy,figurehead,fiendish,fertilize,ferment,fending,fellahs,feelers,fascinate,fantabulous,falsify,fallopian,faithless,fairer,fainter,failings,facetious,eyepatch,exxon,extraterrestrials,extradite,extracurriculars,extinguish,expunged,expelling,exorbitant,exhilarated,exertion,exerting,excercise,everbody,evaporated,escargot,escapee,erases,epizootics,epithelials,ephrum,entanglements,enslave,engrossed,emphatic,emeralds,ember,emancipated,elevates,ejaculate,effeminate,eccentricities,easygoing,earshot,dunks,dullness,dulli,dulled,drumstick,dropper,driftwood,dregs,dreck,dreamboat,draggin,downsizing,donowitz,dominoes,diversions,distended,dissipate,disraeli,disqualify,disowned,dishwashing,disciplining,discerning,disappoints,dinged,digested,dicking,detonating,despising,depressor,depose,deport,dents,defused,deflecting,decryption,decoys,decoupage,decompress,decibel,decadence,deafening,dawning,dater,darkened,dappy,dallying,dagon,czechoslovakians,cuticles,cuteness,cupboards,culottes,cruisin,crosshairs,cronyn,criminalistics,creatively,creaming,crapping,cranny,cowed,contradicting,constipation,confining,confidences,conceiving,conceivably,concealment,compulsively,complainin,complacent,compels,communing,commode,comming,commensurate,columnists,colonoscopy,colchicine,coddling,clump,clubbed,clowning,cliffhanger,clang,cissy,choosers,choker,chiffon,channeled,chalet,cellmates,cathartic,caseload,carjack,canvass,canisters,candlestick,candlelit,camry,calzones,calitri,caldy,byline,butterball,bustier,burlap,bureaucrat,buffoons,buenas,brookline,bronzed,broiled,broda,briss,brioche,briar,breathable,brays,brassieres,boysenberry,bowline,boooo,boonies,booklets,bookish,boogeyman,boogey,bogas,boardinghouse,bluuch,blundering,bluer,blowed,blotchy,blossomed,bloodwork,bloodied,blithering,blinks,blathering,blasphemous,blacking,birdson,bings,bfmid,bfast,bettin,berkshires,benjamins,benevolence,benched,benatar,bellybutton,belabor,behooves,beddy,beaujolais,beattle,baxworth,baseless,barfing,bannish,bankrolled,banek,ballsy,ballpoint,baffling,badder,badda,bactine,backgammon,baako,aztreonam,authoritah,auctioning,arachtoids,apropos,aprons,apprised,apprehensive,anythng,antivenin,antichrist,anorexic,anoint,anguished,angioplasty,angio,amply,ampicillin,amphetamines,alternator,alcove,alabaster,airlifted,agrabah,affidavits,admonished,admonish,addled,addendum,accuser,accompli,absurdity,absolved,abrusso,abreast,aboot,abductions,abducting,aback,ababwa,aaahhhh,zorin,zinthar,zinfandel,zillions,zephyrs,zatarcs,zacks,youuu,yokels,yardstick,yammer,y'understand,wynette,wrung,wreaths,wowed,wouldn'ta,worming,wormed,workday,woodsy,woodshed,woodchuck,wojadubakowski,withering,witching,wiseass,wiretaps,wining,willoby,wiccaning,whupped,whoopi,whoomp,wholesaler,whiteness,whiner,whatchya,wharves,wenus,weirdoes,weaning,watusi,waponi,waistband,wackos,vouching,votre,vivica,viveca,vivant,vivacious,visor,visitin,visage,vicrum,vetted,ventriloquism,venison,varnsen,vaporized,vapid,vanstock,uuuuh,ushering,urologist,urination,upstart,uprooted,unsubtitled,unspoiled,unseat,unseasonably,unseal,unsatisfying,unnerve,unlikable,unleaded,uninsured,uninspired,unicycle,unhooked,unfunny,unfreezing,unflattering,unfairness,unexpressed,unending,unencumbered,unearth,undiscovered,undisciplined,understan,undershirt,underlings,underline,undercurrent,uncivilized,uncharacteristic,umpteenth,uglies,tuney,trumps,truckasaurus,trubshaw,trouser,tringle,trifling,trickster,trespassers,trespasser,traumas,trattoria,trashes,transgressions,trampling,tp'ed,toxoplasmosis,tounge,tortillas,topsy,topple,topnotch,tonsil,tions,timmuh,timithious,tilney,tighty,tightness,tightens,tidbits,ticketed,thyme,threepio,thoughtfully,thorkel,thommo,thing'll,thefts,that've,thanksgivings,tetherball,testikov,terraforming,tepid,tendonitis,tenboom,telex,teenybopper,tattered,tattaglias,tanneke,tailspin,tablecloth,swooping,swizzle,swiping,swindled,swilling,swerving,sweatshops,swaddling,swackhammer,svetkoff,supossed,superdad,sumptuous,sugary,sugai,subvert,substantiate,submersible,sublimating,subjugation,stymied,strychnine,streetlights,strassmans,stranglehold,strangeness,straddling,straddle,stowaways,stotch,stockbrokers,stifling,stepford,steerage,steena,statuary,starlets,staggeringly,ssshhh,squaw,spurt,spungeon,spritzer,sprightly,sprays,sportswear,spoonful,splittin,splitsville,speedily,specialise,spastic,sparrin,souvlaki,southie,sourpuss,soupy,soundstage,soothes,somebody'd,softest,sociopathic,socialized,snyders,snowmobiles,snowballed,snatches,smugness,smoothest,smashes,sloshed,sleight,skyrocket,skied,skewed,sixpence,sipowicz,singling,simulates,shyness,shuvanis,showoff,shortsighted,shopkeeper,shoehorn,shithouse,shirtless,shipshape,shifu,shelve,shelbyville,sheepskin,sharpens,shaquille,shanshu,servings,sequined,seizes,seashells,scrambler,scopes,schnauzer,schmo,schizoid,scampered,savagely,saudis,santas,sandovals,sanding,saleswoman,sagging,s'cuse,rutting,ruthlessly,runneth,ruffians,rubes,rosalita,rollerblades,rohypnol,roasts,roadies,ritten,rippling,ripples,rigoletto,richardo,rethought,reshoot,reserving,reseda,rescuer,reread,requisitions,repute,reprogram,replenish,repetitious,reorganizing,reinventing,reinvented,reheat,refrigerators,reenter,recruiter,recliner,rawdy,rashes,rajeski,raison,raisers,rages,quinine,questscape,queller,pygmalion,pushers,pusan,purview,pumpin,pubescent,prudes,provolone,propriety,propped,procrastinate,processional,preyed,pretrial,portent,pooling,poofy,polloi,policia,poacher,pluses,pleasuring,platitudes,plateaued,plaguing,pittance,pinheads,pincushion,pimply,pimped,piggyback,piecing,phillipe,philipse,philby,pharaohs,petyr,petitioner,peshtigo,pesaram,persnickety,perpetrate,percolating,pepto,penne,penell,pemmican,peeks,pedaling,peacemaker,pawnshop,patting,pathologically,patchouli,pasts,pasties,passin,parlors,paltrow,palamon,padlock,paddling,oversleep,overheating,overdosed,overcharge,overblown,outrageously,ornery,opportune,oooooooooh,oohhhh,ohhhhhh,ogres,odorless,obliterated,nyong,nymphomaniac,ntozake,novocain,nough,nonnie,nonissue,nodules,nightmarish,nightline,niceties,newsman,needra,nedry,necking,navour,nauseam,nauls,narim,namath,nagged,naboo,n'sync,myslexia,mutator,mustafi,musketeer,murtaugh,murderess,munching,mumsy,muley,mouseville,mortifying,morgendorffers,moola,montel,mongoloid,molestered,moldings,mocarbies,mo'ss,mixers,misrell,misnomer,misheard,mishandled,miscreant,misconceptions,miniscule,millgate,mettle,metricconverter,meteors,menorah,mengele,melding,meanness,mcgruff,mcarnold,matzoh,matted,mastectomy,massager,marveling,marooned,marmaduke,marick,manhandled,manatees,man'll,maltin,maliciously,malfeasance,malahide,maketh,makeovers,maiming,machismo,lumpectomy,lumbering,lucci,lording,lorca,lookouts,loogie,loners,loathed,lissen,lighthearted,lifer,lickin,lewen,levitation,lestercorp,lessee,lentils,legislate,legalizing,lederhosen,lawmen,lasskopf,lardner,lambeau,lamagra,ladonn,lactic,lacquer,labatier,krabappel,kooks,knickknacks,klutzy,kleynach,klendathu,kinross,kinkaid,kind'a,ketch,kesher,karikos,karenina,kanamits,junshi,jumbled,joust,jotted,jobson,jingling,jigalong,jerries,jellies,jeeps,javna,irresistable,internist,intercranial,inseminated,inquisitor,infuriate,inflating,infidelities,incessantly,incensed,incase,incapacitate,inasmuch,inaccuracies,imploding,impeding,impediments,immaturity,illegible,iditarod,icicles,ibuprofen,i'i'm,hymie,hydrolase,hunker,humps,humons,humidor,humdinger,humbling,huggin,huffing,housecleaning,hothouse,hotcakes,hosty,hootenanny,hootchie,hoosegow,honks,honeymooners,homily,homeopathic,hitchhikers,hissed,hillnigger,hexavalent,hewwo,hershe,hermey,hergott,henny,hennigans,henhouse,hemolytic,helipad,heifer,hebrews,hebbing,heaved,headlock,harrowing,harnessed,hangovers,handi,handbasket,halfrek,hacene,gyges,guys're,gundersons,gumption,gruntmaster,grubs,grossie,groped,grins,greaseball,gravesite,gratuity,granma,grandfathers,grandbaby,gradski,gracing,gossips,gooble,goners,golitsyn,gofer,godsake,goddaughter,gnats,gluing,glares,givers,ginza,gimmie,gimmee,gennero,gemme,gazpacho,gazed,gassy,gargling,gandhiji,galvanized,gallbladder,gaaah,furtive,fumigation,fucka,fronkonsteen,frills,freezin,freewald,freeloader,frailty,forger,foolhardy,fondest,fomin,followin,follicle,flotation,flopping,floodgates,flogged,flicked,flenders,fleabag,fixings,fixable,fistful,firewater,firelight,fingerbang,finalizing,fillin,filipov,fiderer,felling,feldberg,feign,faunia,fatale,farkus,fallible,faithfulness,factoring,eyeful,extramarital,exterminated,exhume,exasperated,eviscerate,estoy,esmerelda,escapades,epoxy,enticed,enthused,entendre,engrossing,endorphins,emptive,emmys,eminently,embezzler,embarressed,embarrassingly,embalmed,eludes,eling,elated,eirie,egotitis,effecting,eerily,eecom,eczema,earthy,earlobes,eally,dyeing,dwells,duvet,duncans,dulcet,droves,droppin,drools,drey'auc,downriver,domesticity,dollop,doesnt,dobler,divulged,diversionary,distancing,dispensers,disorienting,disneyworld,dismissive,disingenuous,disheveled,disfiguring,dinning,dimming,diligently,dilettante,dilation,dickensian,diaphragms,devastatingly,destabilize,desecrate,deposing,deniece,demony,delving,delicates,deigned,defraud,deflower,defibrillator,defiantly,defenceless,defacing,deconstruction,decompose,deciphering,decibels,deceptively,deceptions,decapitation,debutantes,debonair,deadlier,dawdling,davic,darwinism,darnit,darks,danke,danieljackson,dangled,cytoxan,cutout,cutlery,curveball,curfews,cummerbund,crunches,crouched,crisps,cripples,crilly,cribs,crewman,creepin,creeds,credenza,creak,crawly,crawlin,crawlers,crated,crackheads,coworker,couldn't've,corwins,coriander,copiously,convenes,contraceptives,contingencies,contaminating,conniption,condiment,concocting,comprehending,complacency,commendatore,comebacks,com'on,collarbone,colitis,coldly,coiffure,coffers,coeds,codependent,cocksucking,cockney,cockles,clutched,closeted,cloistered,cleve,cleats,clarifying,clapped,cinnabar,chunnel,chumps,cholinesterase,choirboy,chocolatey,chlamydia,chigliak,cheesie,chauvinistic,chasm,chartreuse,charo,charnier,chapil,chalked,chadway,certifiably,cellulite,celled,cavalcade,cataloging,castrated,cassio,cashews,cartouche,carnivore,carcinogens,capulet,captivated,capt'n,cancellations,campin,callate,callar,caffeinated,cadavers,cacophony,cackle,buzzes,buttoning,busload,burglaries,burbs,buona,bunions,bullheaded,buffs,bucyk,buckling,bruschetta,browbeating,broomsticks,broody,bromly,brolin,briefings,brewskies,breathalyzer,breakups,bratwurst,brania,braiding,brags,braggin,bradywood,bottomed,bossa,bordello,bookshelf,boogida,bondsman,bolder,boggles,bludgeoned,blowtorch,blotter,blips,blemish,bleaching,blainetologists,blading,blabbermouth,birdseed,bimmel,biloxi,biggly,bianchinni,betadine,berenson,belus,belloq,begets,befitting,beepers,beelzebub,beefed,bedridden,bedevere,beckons,beaded,baubles,bauble,battleground,bathrobes,basketballs,basements,barroom,barnacle,barkin,barked,baretta,bangles,bangler,banality,bambang,baltar,ballplayers,bagman,baffles,backroom,babysat,baboons,averse,audiotape,auctioneer,atten,atcha,astonishment,arugula,arroz,antihistamines,annoyances,anesthesiology,anatomically,anachronism,amiable,amaretto,allahu,alight,aimin,ailment,afterglow,affronte,advil,adrenals,actualization,acrost,ached,accursed,accoutrements,absconded,aboveboard,abetted,aargh,aaaahh,zuwicky,zolda,ziploc,zakamatak,youve,yippie,yesterdays,yella,yearns,yearnings,yearned,yawning,yalta,yahtzee,y'mean,y'are,wuthering,wreaks,worrisome,workiiing,wooooooo,wonky,womanizing,wolodarsky,wiwith,withdraws,wishy,wisht,wipers,wiper,winos,windthorne,windsurfing,windermere,wiggled,wiggen,whwhat,whodunit,whoaaa,whittling,whitesnake,whereof,wheezing,wheeze,whatd'ya,whataya,whammo,whackin,wellll,weightless,weevil,wedgies,webbing,weasly,wayside,waxes,waturi,washy,washrooms,wandell,waitaminute,waddya,waaaah,vornac,vishnoor,virulent,vindictiveness,vinceres,villier,vigeous,vestigial,ventilate,vented,venereal,veering,veered,veddy,vaslova,valosky,vailsburg,vaginas,vagas,urethra,upstaged,uploading,unwrapping,unwieldy,untapped,unsatisfied,unquenchable,unnerved,unmentionable,unlovable,unknowns,uninformed,unimpressed,unhappily,unguarded,unexplored,undergarment,undeniably,unclench,unclaimed,uncharacteristically,unbuttoned,unblemished,ululd,uhhhm,tweeze,tutsami,tushy,tuscarora,turkle,turghan,turbinium,tubers,trucoat,troxa,tropicana,triquetra,trimmers,triceps,trespassed,traya,traumatizing,transvestites,trainors,tradin,trackers,townies,tourelles,toucha,tossin,tortious,topshop,topes,tonics,tongs,tomsk,tomorrows,toiling,toddle,tizzy,tippers,timmi,thwap,thusly,ththe,thrusts,throwers,throwed,throughway,thickening,thermonuclear,thelwall,thataway,terrifically,tendons,teleportation,telepathically,telekinetic,teetering,teaspoons,tarantulas,tapas,tanned,tangling,tamales,tailors,tahitian,tactful,tachy,tablespoon,syrah,synchronicity,synch,synapses,swooning,switchman,swimsuits,sweltering,sweetly,suvolte,suslov,surfed,supposition,suppertime,supervillains,superfluous,superego,sunspots,sunning,sunless,sundress,suckah,succotash,sublevel,subbasement,studious,striping,strenuously,straights,stonewalled,stillness,stilettos,stevesy,steno,steenwyck,stargates,stammering,staedert,squiggly,squiggle,squashing,squaring,spreadsheet,spramp,spotters,sporto,spooking,splendido,spittin,spirulina,spiky,spate,spartacus,spacerun,soonest,something'll,someth,somepin,someone'll,sofas,soberly,sobered,snowmen,snowbank,snowballing,snivelling,sniffling,snakeskin,snagging,smush,smooter,smidgen,smackers,slumlord,slossum,slimmer,slighted,sleepwalk,sleazeball,skokie,skeptic,sitarides,sistah,sipped,sindell,simpletons,simony,silkwood,silks,silken,sightless,sideboard,shuttles,shrugging,shrouds,showy,shoveled,shouldn'ta,shoplifters,shitstorm,sheeny,shapetype,shaming,shallows,shackle,shabbily,shabbas,seppuku,senility,semite,semiautomatic,selznick,secretarial,sebacio,scuzzy,scummy,scrutinized,scrunchie,scribbled,scotches,scolded,scissor,schlub,scavenging,scarin,scarfing,scallions,scald,savour,savored,saute,sarcoidosis,sandbar,saluted,salish,saith,sailboats,sagittarius,sacre,saccharine,sacamano,rushdie,rumpled,rumba,rulebook,rubbers,roughage,rotisserie,rootie,roofy,roofie,romanticize,rittle,ristorante,rippin,rinsing,ringin,rincess,rickety,reveling,retest,retaliating,restorative,reston,restaurateur,reshoots,resetting,resentments,reprogramming,repossess,repartee,renzo,remore,remitting,remeber,relaxants,rejuvenate,rejections,regenerated,refocus,referrals,reeno,recycles,recrimination,reclining,recanting,reattach,reassigning,razgul,raved,rattlesnakes,rattles,rashly,raquetball,ransack,raisinettes,raheem,radisson,radishes,raban,quoth,qumari,quints,quilts,quilting,quien,quarreled,purty,purblind,punchbowl,publically,psychotics,psychopaths,psychoanalyze,pruning,provasik,protectin,propping,proportioned,prophylactic,proofed,prompter,procreate,proclivities,prioritizing,prinze,pricked,press'll,presets,prescribes,preocupe,prejudicial,prefex,preconceived,precipice,pralines,pragmatist,powerbar,pottie,pottersville,potsie,potholes,posses,posies,portkey,porterhouse,pornographers,poring,poppycock,poppers,pomponi,pokin,poitier,podiatry,pleeze,pleadings,playbook,platelets,plane'arium,placebos,place'll,pistachios,pirated,pinochle,pineapples,pinafore,pimples,piggly,piddling,picon,pickpockets,picchu,physiologically,physic,phobic,philandering,phenomenally,pheasants,pewter,petticoat,petronis,petitioning,perturbed,perpetuating,permutat,perishable,perimeters,perfumed,percocet,per'sus,pepperjack,penalize,pelting,pellet,peignoir,pedicures,peckers,pecans,pawning,paulsson,pattycake,patrolmen,patois,pathos,pasted,parishioner,parcheesi,parachuting,papayas,pantaloons,palpitations,palantine,paintballing,overtired,overstress,oversensitive,overnights,overexcited,overanxious,overachiever,outwitted,outvoted,outnumber,outlast,outlander,out've,orphey,orchestrating,openers,ooooooo,okies,ohhhhhhhhh,ohhhhhhhh,ogling,offbeat,obsessively,obeyed,o'hana,o'bannon,o'bannion,numpce,nummy,nuked,nuances,nourishing,nosedive,norbu,nomlies,nomine,nixed,nihilist,nightshift,newmeat,neglectful,neediness,needin,naphthalene,nanocytes,nanite,naivete,n'yeah,mystifying,myhnegon,mutating,musing,mulled,muggy,muerto,muckraker,muchachos,mountainside,motherless,mosquitos,morphed,mopped,moodoo,moncho,mollem,moisturiser,mohicans,mocks,mistresses,misspent,misinterpretation,miscarry,minuses,mindee,mimes,millisecond,milked,mightn't,mightier,mierzwiak,microchips,meyerling,mesmerizing,mershaw,meecrob,medicate,meddled,mckinnons,mcgewan,mcdunnough,mcats,mbien,matzah,matriarch,masturbated,masselin,martialed,marlboros,marksmanship,marinate,marchin,manicured,malnourished,malign,majorek,magnon,magnificently,macking,machiavellian,macdougal,macchiato,macaws,macanaw,m'self,lydells,lusts,lucite,lubricants,lopper,lopped,loneliest,lonelier,lomez,lojack,loath,liquefy,lippy,limps,likin,lightness,liesl,liebchen,licious,libris,libation,lhamo,leotards,leanin,laxatives,lavished,latka,lanyard,lanky,landmines,lameness,laddies,lacerated,labored,l'amour,kreskin,kovitch,kournikova,kootchy,konoss,knknow,knickety,knackety,kmart,klicks,kiwanis,kissable,kindergartners,kilter,kidnet,kid'll,kicky,kickbacks,kickback,kholokov,kewpie,kendo,katra,kareoke,kafelnikov,kabob,junjun,jumba,julep,jordie,jondy,jolson,jenoff,jawbone,janitorial,janiro,ipecac,invigorated,intruded,intros,intravenously,interruptus,interrogations,interject,interfacing,interestin,insuring,instilled,insensitivity,inscrutable,inroads,innards,inlaid,injector,ingratitude,infuriates,infra,infliction,indelicate,incubators,incrimination,inconveniencing,inconsolable,incestuous,incas,incarcerate,inbreeding,impudence,impressionists,impeached,impassioned,imipenem,idling,idiosyncrasies,icebergs,hypotensive,hydrochloride,hushed,humus,humph,hummm,hulking,hubcaps,hubald,howya,howbout,how'll,housebroken,hotwire,hotspots,hotheaded,horrace,hopsfield,honto,honkin,honeymoons,homewrecker,hombres,hollers,hollerin,hoedown,hoboes,hobbling,hobble,hoarse,hinky,highlighters,hexes,heru'ur,hernias,heppleman,hell're,heighten,heheheheheh,heheheh,hedging,heckling,heckled,heavyset,heatshield,heathens,heartthrob,headpiece,hayseed,haveo,hauls,hasten,harridan,harpoons,hardens,harcesis,harbouring,hangouts,halkein,haleh,halberstam,hairnet,hairdressers,hacky,haaaa,h'yah,gusta,gushy,gurgling,guilted,gruel,grudging,grrrrrr,grosses,groomsmen,griping,gravest,gratified,grated,goulash,goopy,goona,goodly,godliness,godawful,godamn,glycerin,glutes,glowy,globetrotters,glimpsed,glenville,glaucoma,girlscout,giraffes,gilbey,gigglepuss,ghora,gestating,gelato,geishas,gearshift,gayness,gasped,gaslighting,garretts,garba,gablyczyck,g'head,fumigating,fumbling,fudged,fuckwad,fuck're,fuchsia,fretting,freshest,frenchies,freezers,fredrica,fraziers,fraidy,foxholes,fourty,fossilized,forsake,forfeits,foreclosed,foreal,footsies,florists,flopped,floorshow,floorboard,flinching,flecks,flaubert,flatware,flatulence,flatlined,flashdance,flail,flagging,fiver,fitzy,fishsticks,finetti,finelli,finagle,filko,fieldstone,fibber,ferrini,feedin,feasting,favore,fathering,farrouhk,farmin,fairytale,fairservice,factoid,facedown,fabled,eyeballin,extortionist,exquisitely,expedited,exorcise,existentialist,execs,exculpatory,exacerbate,everthing,eventuality,evander,euphoric,euphemisms,estamos,erred,entitle,enquiries,enormity,enfants,endive,encyclopedias,emulating,embittered,effortless,ectopic,ecirc,easely,earphones,earmarks,dweller,durslar,durned,dunois,dunking,dunked,dumdum,dullard,dudleys,druthers,druggist,drossos,drooled,driveways,drippy,dreamless,drawstring,drang,drainpipe,dozing,dotes,dorkface,doorknobs,doohickey,donnatella,doncha,domicile,dokos,dobermans,dizzying,divola,ditsy,distaste,disservice,dislodged,dislodge,disinherit,disinformation,discounting,dinka,dimly,digesting,diello,diddling,dictatorships,dictators,diagnostician,devours,devilishly,detract,detoxing,detours,detente,destructs,desecrated,derris,deplore,deplete,demure,demolitions,demean,delish,delbruck,delaford,degaulle,deftly,deformity,deflate,definatly,defector,decrypted,decontamination,decapitate,decanter,dardis,dampener,damme,daddy'll,dabbling,dabbled,d'etre,d'argent,d'alene,d'agnasti,czechoslovakian,cymbal,cyberdyne,cutoffs,cuticle,curvaceous,curiousity,crowing,crowed,croutons,cropped,criminy,crescentis,crashers,cranwell,coverin,courtrooms,countenance,cosmically,cosign,corroboration,coroners,cornflakes,copperpot,copperhead,copacetic,coordsize,convulsing,consults,conjures,congenial,concealer,compactor,commercialism,cokey,cognizant,clunkers,clumsily,clucking,cloves,cloven,cloths,clothe,clods,clocking,clings,clavicle,classless,clashing,clanking,clanging,clamping,civvies,citywide,circulatory,circuited,chronisters,chromic,choos,chloroformed,chillun,cheesed,chatterbox,chaperoned,channukah,cerebellum,centerpieces,centerfold,ceecee,ccedil,cavorting,cavemen,cauterized,cauldwell,catting,caterine,cassiopeia,carves,cartwheel,carpeted,carob,caressing,carelessly,careening,capricious,capitalistic,capillaries,candidly,camaraderie,callously,calfskin,caddies,buttholes,busywork,busses,burps,burgomeister,bunkhouse,bungchow,bugler,buffets,buffed,brutish,brusque,bronchitis,bromden,brolly,broached,brewskis,brewin,brean,breadwinner,brana,bountiful,bouncin,bosoms,borgnine,bopping,bootlegs,booing,bombosity,bolting,boilerplate,bluey,blowback,blouses,bloodsuckers,bloodstained,bloat,bleeth,blackface,blackest,blackened,blacken,blackballed,blabs,blabbering,birdbrain,bipartisanship,biodegradable,biltmore,bilked,big'uns,bidet,besotted,bernheim,benegas,bendiga,belushi,bellboys,belittling,behinds,begone,bedsheets,beckoning,beaute,beaudine,beastly,beachfront,bathes,batak,baser,baseballs,barbella,bankrolling,bandaged,baerly,backlog,backin,babying,azkaban,awwwww,aviary,authorizes,austero,aunty,attics,atreus,astounded,astonish,artemus,arses,arintero,appraiser,apathetic,anybody'd,anxieties,anticlimactic,antar,anglos,angleman,anesthetist,androscoggin,andolini,andale,amway,amuck,amniocentesis,amnesiac,americano,amara,alvah,altruism,alternapalooza,alphabetize,alpaca,allus,allergist,alexandros,alaikum,akimbo,agoraphobia,agides,aggrhh,aftertaste,adoptions,adjuster,addictions,adamantium,activator,accomplishes,aberrant,aaaaargh,aaaaaaaaaaaaa,a'ight,zzzzzzz,zucchini,zookeeper,zirconia,zippers,zequiel,zellary,zeitgeist,zanuck,zagat,you'n,ylang,yes'm,yenta,yecchh,yecch,yawns,yankin,yahdah,yaaah,y'got,xeroxed,wwooww,wristwatch,wrangled,wouldst,worthiness,worshiping,wormy,wormtail,wormholes,woosh,wollsten,wolfing,woefully,wobbling,wintry,wingding,windstorm,windowtext,wiluna,wilting,wilted,willick,willenholly,wildflowers,wildebeest,whyyy,whoppers,whoaa,whizzing,whizz,whitest,whistled,whist,whinny,wheelies,whazzup,whatwhatwhaaat,whato,whatdya,what'dya,whacks,wewell,wetsuit,welluh,weeps,waylander,wavin,wassail,wasnt,warneford,warbucks,waltons,wallbanger,waiving,waitwait,vowing,voucher,vornoff,vorhees,voldemort,vivre,vittles,vindaloo,videogames,vichyssoise,vicarious,vesuvius,verguenza,ven't,velveteen,velour,velociraptor,vastness,vasectomies,vapors,vanderhof,valmont,validates,valiantly,vacuums,usurp,usernum,us'll,urinals,unyielding,unvarnished,unturned,untouchables,untangled,unsecured,unscramble,unreturned,unremarkable,unpretentious,unnerstand,unmade,unimpeachable,unfashionable,underwrite,underlining,underling,underestimates,underappreciated,uncouth,uncork,uncommonly,unclog,uncircumcised,unchallenged,uncas,unbuttoning,unapproved,unamerican,unafraid,umpteen,umhmm,uhwhy,ughuh,typewriters,twitches,twitched,twirly,twinkling,twinges,twiddling,turners,turnabout,tumblin,tryed,trowel,trousseau,trivialize,trifles,tribianni,trenchcoat,trembled,traumatize,transitory,transients,transfuse,transcribing,tranq,trampy,traipsed,trainin,trachea,traceable,touristy,toughie,toscanini,tortola,tortilla,torreon,toreador,tommorrow,tollbooth,tollans,toidy,togas,tofurkey,toddling,toddies,toasties,toadstool,to've,tingles,timin,timey,timetables,tightest,thuggee,thrusting,thrombus,throes,thrifty,thornharts,thinnest,thicket,thetas,thesulac,tethered,testaburger,tersenadine,terrif,terdlington,tepui,temping,tector,taxidermy,tastebuds,tartlets,tartabull,tar'd,tantamount,tangy,tangles,tamer,tabula,tabletops,tabithia,szechwan,synthedyne,svenjolly,svengali,survivalists,surmise,surfboards,surefire,suprise,supremacists,suppositories,superstore,supercilious,suntac,sunburned,summercliff,sullied,sugared,suckle,subtleties,substantiated,subsides,subliminal,subhuman,strowman,stroked,stroganoff,streetlight,straying,strainer,straighter,straightener,stoplight,stirrups,stewing,stereotyping,stepmommy,stephano,stashing,starshine,stairwells,squatsie,squandering,squalid,squabbling,squab,sprinkling,spreader,spongy,spokesmen,splintered,spittle,spitter,spiced,spews,spendin,spect,spearchucker,spatulas,southtown,soused,soshi,sorter,sorrowful,sooth,some'in,soliloquy,soiree,sodomized,sobriki,soaping,snows,snowcone,snitching,snitched,sneering,snausages,snaking,smoothed,smoochies,smarten,smallish,slushy,slurring,sluman,slithers,slippin,sleuthing,sleeveless,skinless,skillfully,sketchbook,skagnetti,sista,sinning,singularly,sinewy,silverlake,siguto,signorina,sieve,sidearms,shying,shunning,shtud,shrieks,shorting,shortbread,shopkeepers,shmancy,shizzit,shitheads,shitfaced,shipmates,shiftless,shelving,shedlow,shavings,shatters,sharifa,shampoos,shallots,shafter,sha'nauc,sextant,serviceable,sepsis,senores,sendin,semis,semanski,selflessly,seinfelds,seers,seeps,seductress,secaucus,sealant,scuttling,scusa,scrunched,scissorhands,schreber,schmancy,scamps,scalloped,savoir,savagery,sarong,sarnia,santangel,samool,sallow,salino,safecracker,sadism,sacrilegious,sabrini,sabath,s'aright,ruttheimer,rudest,rubbery,rousting,rotarian,roslin,roomed,romari,romanica,rolltop,rolfski,rockettes,roared,ringleader,riffing,ribcage,rewired,retrial,reting,resuscitated,restock,resale,reprogrammed,replicant,repentant,repellant,repays,repainting,renegotiating,rendez,remem,relived,relinquishes,relearn,relaxant,rekindling,rehydrate,refueled,refreshingly,refilling,reexamine,reeseman,redness,redeemable,redcoats,rectangles,recoup,reciprocated,reassessing,realy,realer,reachin,re'kali,rawlston,ravages,rappaports,ramoray,ramming,raindrops,rahesh,radials,racists,rabartu,quiches,quench,quarreling,quaintly,quadrants,putumayo,put'em,purifier,pureed,punitis,pullout,pukin,pudgy,puddings,puckering,pterodactyl,psychodrama,psats,protestations,protectee,prosaic,propositioned,proclivity,probed,printouts,prevision,pressers,preset,preposition,preempt,preemie,preconceptions,prancan,powerpuff,potties,potpie,poseur,porthole,poops,pooping,pomade,polyps,polymerized,politeness,polisher,polack,pocketknife,poatia,plebeian,playgroup,platonically,platitude,plastering,plasmapheresis,plaids,placemats,pizzazz,pintauro,pinstripes,pinpoints,pinkner,pincer,pimento,pileup,pilates,pigmen,pieeee,phrased,photocopies,phoebes,philistines,philanderer,pheromone,phasers,pfeffernuesse,pervs,perspire,personify,perservere,perplexed,perpetrating,perkiness,perjurer,periodontist,perfunctory,perdido,percodan,pentameter,pentacle,pensive,pensione,pennybaker,pennbrooke,penhall,pengin,penetti,penetrates,pegnoir,peeve,peephole,pectorals,peckin,peaky,peaksville,paxcow,paused,patted,parkishoff,parkers,pardoning,paraplegic,paraphrasing,paperers,papered,pangs,paneling,palooza,palmed,palmdale,palatable,pacify,pacified,owwwww,oversexed,overrides,overpaying,overdrawn,overcompensate,overcomes,overcharged,outmaneuver,outfoxed,oughtn't,ostentatious,oshun,orthopedist,or'derves,ophthalmologist,operagirl,oozes,oooooooh,onesie,omnis,omelets,oktoberfest,okeydoke,ofthe,ofher,obstetrical,obeys,obeah,o'henry,nyquil,nyanyanyanyah,nuttin,nutsy,nutball,nurhachi,numbskull,nullifies,nullification,nucking,nubbin,nourished,nonspecific,noing,noinch,nohoho,nobler,nitwits,newsprint,newspaperman,newscaster,neuropathy,netherworld,neediest,navasky,narcissists,napped,nafta,mache,mykonos,mutilating,mutherfucker,mutha,mutates,mutate,musn't,murchy,multitasking,mujeeb,mudslinging,muckraking,mousetrap,mourns,mournful,motherf,mostro,morphing,morphate,moralistic,moochy,mooching,monotonous,monopolize,monocle,molehill,moland,mofet,mockup,mobilizing,mmmmmmm,mitzvahs,mistreating,misstep,misjudge,misinformation,misdirected,miscarriages,miniskirt,mindwarped,minced,milquetoast,miguelito,mightily,midstream,midriff,mideast,microbe,methuselah,mesdames,mescal,men'll,memma,megaton,megara,megalomaniac,meeee,medulla,medivac,meaninglessness,mcnuggets,mccarthyism,maypole,may've,mauve,mateys,marshack,markles,marketable,mansiere,manservant,manse,manhandling,mallomars,malcontent,malaise,majesties,mainsail,mailmen,mahandra,magnolias,magnified,magev,maelstrom,machu,macado,m'boy,m'appelle,lustrous,lureen,lunges,lumped,lumberyard,lulled,luego,lucks,lubricated,loveseat,loused,lounger,loski,lorre,loora,looong,loonies,loincloth,lofts,lodgers,lobbing,loaner,livered,liqueur,ligourin,lifesaving,lifeguards,lifeblood,liaisons,let'em,lesbianism,lence,lemonlyman,legitimize,leadin,lazars,lazarro,lawyering,laugher,laudanum,latrines,lations,laters,lapels,lakefront,lahit,lafortunata,lachrymose,l'italien,kwaini,kruczynski,kramerica,kowtow,kovinsky,korsekov,kopek,knowakowski,knievel,knacks,kiowas,killington,kickball,keyworth,keymaster,kevie,keveral,kenyons,keggers,keepsakes,kechner,keaty,kavorka,karajan,kamerev,kaggs,jujyfruit,jostled,jonestown,jokey,joists,jocko,jimmied,jiggled,jests,jenzen,jenko,jellyman,jedediah,jealitosis,jaunty,jarmel,jankle,jagoff,jagielski,jackrabbits,jabbing,jabberjaw,izzat,irresponsibly,irrepressible,irregularity,irredeemable,inuvik,intuitions,intubated,intimates,interminable,interloper,intercostal,instyle,instigate,instantaneously,ining,ingrown,ingesting,infusing,infringe,infinitum,infact,inequities,indubitably,indisputable,indescribably,indentation,indefinable,incontrovertible,inconsequential,incompletes,incoherently,inclement,incidentals,inarticulate,inadequacies,imprudent,improprieties,imprison,imprinted,impressively,impostors,importante,imperious,impale,immodest,immobile,imbedded,imbecilic,illegals,idn't,hysteric,hypotenuse,hygienic,hyeah,hushpuppies,hunhh,humpback,humored,hummed,humiliates,humidifier,huggy,huggers,huckster,hotbed,hosing,hosers,horsehair,homebody,homebake,holing,holies,hoisting,hogwallop,hocks,hobbits,hoaxes,hmmmmm,hisses,hippest,hillbillies,hilarity,heurh,herniated,hermaphrodite,hennifer,hemlines,hemline,hemery,helplessness,helmsley,hellhound,heheheheh,heeey,hedda,heartbeats,heaped,healers,headstart,headsets,headlong,hawkland,havta,haulin,harvey'll,hanta,hansom,hangnail,handstand,handrail,handoff,hallucinogen,hallor,halitosis,haberdashery,gypped,guy'll,gumbel,guerillas,guava,guardrail,grunther,grunick,groppi,groomer,grodin,gripes,grinds,grifters,gretch,greevey,greasing,graveyards,grandkid,grainy,gouging,gooney,googly,goldmuff,goldenrod,goingo,godly,gobbledygook,gobbledegook,glues,gloriously,glengarry,glassware,glamor,gimmicks,giggly,giambetti,ghoulish,ghettos,ghali,gether,geriatrics,gerbils,geosynchronous,georgio,gente,gendarme,gelbman,gazillionth,gayest,gauging,gastro,gaslight,gasbag,garters,garish,garas,gantu,gangy,gangly,gangland,galling,gadda,furrowed,funnies,funkytown,fugimotto,fudging,fuckeen,frustrates,froufrou,froot,fromberge,frizzies,fritters,frightfully,friendliest,freeloading,freelancing,freakazoid,fraternization,framers,fornication,fornicating,forethought,footstool,foisting,focussing,focking,flurries,fluffed,flintstones,fledermaus,flayed,flawlessly,flatters,flashbang,flapped,fishies,firmer,fireproof,firebug,fingerpainting,finessed,findin,financials,finality,fillets,fiercest,fiefdom,fibbing,fervor,fentanyl,fenelon,fedorchuk,feckless,feathering,faucets,farewells,fantasyland,fanaticism,faltered,faggy,faberge,extorting,extorted,exterminating,exhumation,exhilaration,exhausts,exfoliate,excels,exasperating,exacting,everybody'd,evasions,espressos,esmail,errrr,erratically,eroding,ernswiler,epcot,enthralled,ensenada,enriching,enrage,enhancer,endear,encrusted,encino,empathic,embezzle,emanates,electricians,eking,egomaniacal,egging,effacing,ectoplasm,eavesdropped,dummkopf,dugray,duchaisne,drunkard,drudge,droop,droids,drips,dripped,dribbles,drazens,downy,downsize,downpour,dosages,doppelganger,dopes,doohicky,dontcha,doneghy,divining,divest,diuretics,diuretic,distrustful,disrupts,dismemberment,dismember,disinfect,disillusionment,disheartening,discourteous,discotheque,discolored,dirtiest,diphtheria,dinks,dimpled,didya,dickwad,diatribes,diathesis,diabetics,deviants,detonates,detests,detestable,detaining,despondent,desecration,derision,derailing,deputized,depressors,dependant,dentures,denominators,demur,demonology,delts,dellarte,delacour,deflated,defib,defaced,decorators,deaqon,davola,datin,darwinian,darklighters,dandelions,dampened,damaskinos,dalrimple,d'peshu,d'hoffryn,d'astier,cynics,cutesy,cutaway,curmudgeon,curdle,culpability,cuisinart,cuffing,crypts,cryptid,crunched,crumblers,crudely,crosscheck,croon,crissake,crevasse,creswood,creepo,creases,creased,creaky,cranks,crabgrass,coveralls,couple'a,coughs,coslaw,corporeal,cornucopia,cornering,corks,cordoned,coolly,coolin,cookbooks,contrite,contented,constrictor,confound,confit,confiscating,condoned,conditioners,concussions,comprendo,comers,combustible,combusted,collingswood,coldness,coitus,codicil,coasting,clydesdale,cluttering,clunker,clunk,clumsiness,clotted,clothesline,clinches,clincher,cleverness,clench,clein,cleanses,claymores,clammed,chugging,chronically,christsakes,choque,chompers,chiseling,chirpy,chirp,chinks,chingachgook,chickenpox,chickadee,chewin,chessboard,chargin,chanteuse,chandeliers,chamdo,chagrined,chaff,certs,certainties,cerreno,cerebrum,censured,cemetary,caterwauling,cataclysmic,casitas,cased,carvel,carting,carrear,carolling,carolers,carnie,cardiogram,carbuncle,capulets,canines,candaules,canape,caldecott,calamitous,cadillacs,cachet,cabeza,cabdriver,buzzards,butai,businesswomen,bungled,bumpkins,bummers,bulldoze,buffybot,bubut,bubbies,brrrrr,brownout,brouhaha,bronzing,bronchial,broiler,briskly,briefcases,bricked,breezing,breeher,breakable,breadstick,bravenet,braved,brandies,brainwaves,brainiest,braggart,bradlee,boys're,boys'll,boys'd,boutonniere,bossed,bosomy,borans,boosts,bookshelves,bookends,boneless,bombarding,bollo,boinked,boink,bluest,bluebells,bloodshot,blockhead,blockbusters,blithely,blather,blankly,bladders,blackbeard,bitte,bippy,biogenetics,bilge,bigglesworth,bicuspids,beususe,betaseron,besmirch,bernece,bereavement,bentonville,benchley,benching,bembe,bellyaching,bellhops,belie,beleaguered,behrle,beginnin,begining,beenie,beefs,beechwood,becau,beaverhausen,beakers,bazillion,baudouin,barrytown,barringtons,barneys,barbs,barbers,barbatus,bankrupted,bailiffs,backslide,baby'd,baaad,b'fore,awwwk,aways,awakes,automatics,authenticate,aught,aubyn,attired,attagirl,atrophied,asystole,astroturf,assertiveness,artichokes,arquillians,aright,archenemy,appraise,appeased,antin,anspaugh,anesthetics,anaphylactic,amscray,ambivalence,amalio,alriiight,alphabetized,alpena,alouette,allora,alliteration,allenwood,allegiances,algerians,alcerro,alastor,ahaha,agitators,aforethought,advertises,admonition,adirondacks,adenoids,acupuncturist,acula,actuarial,activators,actionable,achingly,accusers,acclimated,acclimate,absurdly,absorbent,absolvo,absolutes,absences,abdomenizer,aaaaaaaaah,aaaaaaaaaa,a'right".split(","), +male_names:"james,john,robert,michael,william,david,richard,charles,joseph,thomas,christopher,daniel,paul,mark,donald,george,kenneth,steven,edward,brian,ronald,anthony,kevin,jason,matthew,gary,timothy,jose,larry,jeffrey,frank,scott,eric,stephen,andrew,raymond,gregory,joshua,jerry,dennis,walter,patrick,peter,harold,douglas,henry,carl,arthur,ryan,roger,joe,juan,jack,albert,jonathan,justin,terry,gerald,keith,samuel,willie,ralph,lawrence,nicholas,roy,benjamin,bruce,brandon,adam,harry,fred,wayne,billy,steve,louis,jeremy,aaron,randy,eugene,carlos,russell,bobby,victor,ernest,phillip,todd,jesse,craig,alan,shawn,clarence,sean,philip,chris,johnny,earl,jimmy,antonio,danny,bryan,tony,luis,mike,stanley,leonard,nathan,dale,manuel,rodney,curtis,norman,marvin,vincent,glenn,jeffery,travis,jeff,chad,jacob,melvin,alfred,kyle,francis,bradley,jesus,herbert,frederick,ray,joel,edwin,don,eddie,ricky,troy,randall,barry,bernard,mario,leroy,francisco,marcus,micheal,theodore,clifford,miguel,oscar,jay,jim,tom,calvin,alex,jon,ronnie,bill,lloyd,tommy,leon,derek,darrell,jerome,floyd,leo,alvin,tim,wesley,dean,greg,jorge,dustin,pedro,derrick,dan,zachary,corey,herman,maurice,vernon,roberto,clyde,glen,hector,shane,ricardo,sam,rick,lester,brent,ramon,tyler,gilbert,gene,marc,reginald,ruben,brett,nathaniel,rafael,edgar,milton,raul,ben,cecil,duane,andre,elmer,brad,gabriel,ron,roland,jared,adrian,karl,cory,claude,erik,darryl,neil,christian,javier,fernando,clinton,ted,mathew,tyrone,darren,lonnie,lance,cody,julio,kurt,allan,clayton,hugh,max,dwayne,dwight,armando,felix,jimmie,everett,ian,ken,bob,jaime,casey,alfredo,alberto,dave,ivan,johnnie,sidney,byron,julian,isaac,clifton,willard,daryl,virgil,andy,salvador,kirk,sergio,seth,kent,terrance,rene,eduardo,terrence,enrique,freddie,stuart,fredrick,arturo,alejandro,joey,nick,luther,wendell,jeremiah,evan,julius,donnie,otis,trevor,luke,homer,gerard,doug,kenny,hubert,angelo,shaun,lyle,matt,alfonso,orlando,rex,carlton,ernesto,pablo,lorenzo,omar,wilbur,blake,horace,roderick,kerry,abraham,rickey,ira,andres,cesar,johnathan,malcolm,rudolph,damon,kelvin,rudy,preston,alton,archie,marco,pete,randolph,garry,geoffrey,jonathon,felipe,bennie,gerardo,dominic,loren,delbert,colin,guillermo,earnest,benny,noel,rodolfo,myron,edmund,salvatore,cedric,lowell,gregg,sherman,devin,sylvester,roosevelt,israel,jermaine,forrest,wilbert,leland,simon,irving,owen,rufus,woodrow,sammy,kristopher,levi,marcos,gustavo,jake,lionel,marty,gilberto,clint,nicolas,laurence,ismael,orville,drew,ervin,dewey,wilfred,josh,hugo,ignacio,caleb,tomas,sheldon,erick,frankie,darrel,rogelio,terence,alonzo,elias,bert,elbert,ramiro,conrad,noah,grady,phil,cornelius,lamar,rolando,clay,percy,bradford,merle,darin,amos,terrell,moses,irvin,saul,roman,darnell,randal,tommie,timmy,darrin,brendan,toby,van,abel,dominick,emilio,elijah,cary,domingo,aubrey,emmett,marlon,emanuel,jerald,edmond,emil,dewayne,otto,teddy,reynaldo,bret,jess,trent,humberto,emmanuel,stephan,louie,vicente,lamont,garland,micah,efrain,heath,rodger,demetrius,ethan,eldon,rocky,pierre,eli,bryce,antoine,robbie,kendall,royce,sterling,grover,elton,cleveland,dylan,chuck,damian,reuben,stan,leonardo,russel,erwin,benito,hans,monte,blaine,ernie,curt,quentin,agustin,jamal,devon,adolfo,tyson,wilfredo,bart,jarrod,vance,denis,damien,joaquin,harlan,desmond,elliot,darwin,gregorio,kermit,roscoe,esteban,anton,solomon,norbert,elvin,nolan,carey,rod,quinton,hal,brain,rob,elwood,kendrick,darius,moises,marlin,fidel,thaddeus,cliff,marcel,ali,raphael,bryon,armand,alvaro,jeffry,dane,joesph,thurman,ned,sammie,rusty,michel,monty,rory,fabian,reggie,kris,isaiah,gus,avery,loyd,diego,adolph,millard,rocco,gonzalo,derick,rodrigo,gerry,rigoberto,alphonso,rickie,noe,vern,elvis,bernardo,mauricio,hiram,donovan,basil,nickolas,scot,vince,quincy,eddy,sebastian,federico,ulysses,heriberto,donnell,denny,gavin,emery,romeo,jayson,dion,dante,clement,coy,odell,jarvis,bruno,issac,dudley,sanford,colby,carmelo,nestor,hollis,stefan,donny,linwood,beau,weldon,galen,isidro,truman,delmar,johnathon,silas,frederic,irwin,merrill,charley,marcelino,carlo,trenton,kurtis,aurelio,winfred,vito,collin,denver,leonel,emory,pasquale,mohammad,mariano,danial,landon,dirk,branden,adan,numbers,clair,buford,bernie,wilmer,emerson,zachery,jacques,errol,josue,edwardo,wilford,theron,raymundo,daren,tristan,robby,lincoln,jame,genaro,octavio,cornell,hung,arron,antony,herschel,alva,giovanni,garth,cyrus,cyril,ronny,stevie,lon,kennith,carmine,augustine,erich,chadwick,wilburn,russ,myles,jonas,mitchel,mervin,zane,jamel,lazaro,alphonse,randell,johnie,jarrett,ariel,abdul,dusty,luciano,seymour,scottie,eugenio,mohammed,arnulfo,lucien,ferdinand,thad,ezra,aldo,rubin,mitch,earle,abe,marquis,lanny,kareem,jamar,boris,isiah,emile,elmo,aron,leopoldo,everette,josef,eloy,dorian,rodrick,reinaldo,lucio,jerrod,weston,hershel,lemuel,lavern,burt,jules,gil,eliseo,ahmad,nigel,efren,antwan,alden,margarito,refugio,dino,osvaldo,les,deandre,normand,kieth,ivory,trey,norberto,napoleon,jerold,fritz,rosendo,milford,sang,deon,christoper,alfonzo,lyman,josiah,brant,wilton,rico,jamaal,dewitt,brenton,yong,olin,faustino,claudio,judson,gino,edgardo,alec,jarred,donn,trinidad,tad,porfirio,odis,lenard,chauncey,tod,mel,marcelo,kory,augustus,keven,hilario,bud,sal,orval,mauro,dannie,zachariah,olen,anibal,milo,jed,thanh,amado,lenny,tory,richie,horacio,brice,mohamed,delmer,dario,mac,jonah,jerrold,robt,hank,sung,rupert,rolland,kenton,damion,chi,antone,waldo,fredric,bradly,kip,burl,tyree,jefferey,ahmed,willy,stanford,oren,moshe,mikel,enoch,brendon,quintin,jamison,florencio,darrick,tobias,minh,hassan,giuseppe,demarcus,cletus,tyrell,lyndon,keenan,werner,theo,geraldo,columbus,chet,bertram,markus,huey,hilton,dwain,donte,tyron,omer,isaias,hipolito,fermin,chung,adalberto,jamey,teodoro,mckinley,maximo,raleigh,lawerence,abram,rashad,emmitt,daron,chong,samual,otha,miquel,eusebio,dong,domenic,darron,wilber,renato,hoyt,haywood,ezekiel,chas,florentino,elroy,clemente,arden,neville,edison,deshawn,carrol,shayne,nathanial,jordon,danilo,claud,sherwood,raymon,rayford,cristobal,ambrose,titus,hyman,felton,ezequiel,erasmo,lonny,milan,lino,jarod,herb,andreas,rhett,jude,douglass,cordell,oswaldo,ellsworth,virgilio,toney,nathanael,benedict,mose,hong,isreal,garret,fausto,arlen,zack,modesto,francesco,manual,gaylord,gaston,filiberto,deangelo,michale,granville,malik,zackary,tuan,nicky,cristopher,antione,malcom,korey,jospeh,colton,waylon,hosea,shad,santo,rudolf,rolf,renaldo,marcellus,lucius,kristofer,harland,arnoldo,rueben,leandro,kraig,jerrell,jeromy,hobert,cedrick,arlie,winford,wally,luigi,keneth,jacinto,graig,franklyn,edmundo,leif,jeramy,willian,vincenzo,shon,michal,lynwood,jere,elden,darell,broderick,alonso".split(",")},module.exports=frequency_lists; + +},{}],4:[function(require,module,exports){ +var feedback,matching,scoring,time,time_estimates,zxcvbn;matching=require("./matching"),scoring=require("./scoring"),time_estimates=require("./time_estimates"),feedback=require("./feedback"),time=function(){return(new Date).getTime()},zxcvbn=function(e,t){var i,n,c,s,a,r,m,o,u,g,_;for(null==t&&(t=[]),g=time(),u=[],c=0,s=t.length;c<s;c++)i=t[c],"string"!=(m=typeof i)&&"number"!==m&&"boolean"!==m||u.push(i.toString().toLowerCase());matching.set_user_input_dictionary(u),a=matching.omnimatch(e),o=scoring.most_guessable_match_sequence(e,a),o.calc_time=time()-g,n=time_estimates.estimate_attack_times(o.guesses);for(r in n)_=n[r],o[r]=_;return o.feedback=feedback.get_feedback(o.score,o.sequence),o},module.exports=zxcvbn; + +},{"./feedback":2,"./matching":5,"./scoring":6,"./time_estimates":7}],5:[function(require,module,exports){ +var DATE_MAX_YEAR,DATE_MIN_YEAR,DATE_SPLITS,GRAPHS,L33T_TABLE,RANKED_DICTIONARIES,REGEXEN,adjacency_graphs,build_ranked_dict,frequency_lists,lst,matching,name,scoring;frequency_lists=require("./frequency_lists"),adjacency_graphs=require("./adjacency_graphs"),scoring=require("./scoring"),build_ranked_dict=function(e){var t,n,r,i,a;for(i={},t=1,r=0,n=e.length;r<n;r++)a=e[r],i[a]=t,t+=1;return i},RANKED_DICTIONARIES={};for(name in frequency_lists)lst=frequency_lists[name],RANKED_DICTIONARIES[name]=build_ranked_dict(lst);GRAPHS={qwerty:adjacency_graphs.qwerty,dvorak:adjacency_graphs.dvorak,keypad:adjacency_graphs.keypad,mac_keypad:adjacency_graphs.mac_keypad},L33T_TABLE={a:["4","@"],b:["8"],c:["(","{","[","<"],e:["3"],g:["6","9"],i:["1","!","|"],l:["1","|","7"],o:["0"],s:["$","5"],t:["+","7"],x:["%"],z:["2"]},REGEXEN={recent_year:/19\d\d|200\d|201\d/g},DATE_MAX_YEAR=2050,DATE_MIN_YEAR=1e3,DATE_SPLITS={4:[[1,2],[2,3]],5:[[1,3],[2,3]],6:[[1,2],[2,4],[4,5]],7:[[1,3],[2,3],[4,5],[4,6]],8:[[2,4],[4,6]]},matching={empty:function(e){var t;return 0===function(){var n;n=[];for(t in e)n.push(t);return n}().length},extend:function(e,t){return e.push.apply(e,t)},translate:function(e,t){var n;return function(){var r,i,a,s;for(a=e.split(""),s=[],i=0,r=a.length;i<r;i++)n=a[i],s.push(t[n]||n);return s}().join("")},mod:function(e,t){return(e%t+t)%t},sorted:function(e){return e.sort(function(e,t){return e.i-t.i||e.j-t.j})},omnimatch:function(e){var t,n,r,i,a;for(i=[],r=[this.dictionary_match,this.reverse_dictionary_match,this.l33t_match,this.spatial_match,this.repeat_match,this.sequence_match,this.regex_match,this.date_match],a=0,t=r.length;a<t;a++)n=r[a],this.extend(i,n.call(this,e));return this.sorted(i)},dictionary_match:function(e,t){var n,r,i,a,s,o,h,u,c,l,_,f,d,p;null==t&&(t=RANKED_DICTIONARIES),s=[],a=e.length,u=e.toLowerCase();for(n in t)for(l=t[n],r=o=0,_=a;0<=_?o<_:o>_;r=0<=_?++o:--o)for(i=h=f=r,d=a;f<=d?h<d:h>d;i=f<=d?++h:--h)u.slice(r,+i+1||9e9)in l&&(p=u.slice(r,+i+1||9e9),c=l[p],s.push({pattern:"dictionary",i:r,j:i,token:e.slice(r,+i+1||9e9),matched_word:p,rank:c,dictionary_name:n,reversed:!1,l33t:!1}));return this.sorted(s)},reverse_dictionary_match:function(e,t){var n,r,i,a,s,o;for(null==t&&(t=RANKED_DICTIONARIES),o=e.split("").reverse().join(""),i=this.dictionary_match(o,t),a=0,n=i.length;a<n;a++)r=i[a],r.token=r.token.split("").reverse().join(""),r.reversed=!0,s=[e.length-1-r.j,e.length-1-r.i],r.i=s[0],r.j=s[1];return this.sorted(i)},set_user_input_dictionary:function(e){return RANKED_DICTIONARIES.user_inputs=build_ranked_dict(e.slice())},relevant_l33t_subtable:function(e,t){var n,r,i,a,s,o,h,u,c,l;for(s={},o=e.split(""),a=0,r=o.length;a<r;a++)n=o[a],s[n]=!0;l={};for(i in t)c=t[i],h=function(){var e,t,n;for(n=[],t=0,e=c.length;t<e;t++)u=c[t],u in s&&n.push(u);return n}(),h.length>0&&(l[i]=h);return l},enumerate_l33t_subs:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p;a=function(){var t;t=[];for(i in e)t.push(i);return t}(),p=[[]],n=function(e){var t,n,r,a,s,o,h,u;for(n=[],s={},o=0,a=e.length;o<a;o++)h=e[o],t=function(){var e,t,n;for(n=[],u=t=0,e=h.length;t<e;u=++t)i=h[u],n.push([i,u]);return n}(),t.sort(),r=function(){var e,n,r;for(r=[],u=n=0,e=t.length;n<e;u=++n)i=t[u],r.push(i+","+u);return r}().join("-"),r in s||(s[r]=!0,n.push(h));return n},r=function(t){var i,a,s,o,h,u,c,l,_,f,d,g,m,A,E,y;if(t.length){for(a=t[0],m=t.slice(1),c=[],d=e[a],l=0,h=d.length;l<h;l++)for(o=d[l],_=0,u=p.length;_<u;_++){for(A=p[_],i=-1,s=f=0,g=A.length;0<=g?f<g:f>g;s=0<=g?++f:--f)if(A[s][0]===o){i=s;break}i===-1?(y=A.concat([[o,a]]),c.push(y)):(E=A.slice(0),E.splice(i,1),E.push([o,a]),c.push(A),c.push(E))}return p=n(c),r(m)}},r(a),d=[];for(u=0,o=p.length;u<o;u++){for(_=p[u],f={},c=0,h=_.length;c<h;c++)l=_[c],s=l[0],t=l[1],f[s]=t;d.push(f)}return d},l33t_match:function(e,t,n){var r,i,a,s,o,h,u,c,l,_,f,d,p,g,m,A;for(null==t&&(t=RANKED_DICTIONARIES),null==n&&(n=L33T_TABLE),u=[],_=this.enumerate_l33t_subs(this.relevant_l33t_subtable(e,n)),c=0,a=_.length;c<a&&(d=_[c],!this.empty(d));c++)for(g=this.translate(e,d),f=this.dictionary_match(g,t),l=0,s=f.length;l<s;l++)if(o=f[l],m=e.slice(o.i,+o.j+1||9e9),m.toLowerCase()!==o.matched_word){h={};for(p in d)r=d[p],m.indexOf(p)!==-1&&(h[p]=r);o.l33t=!0,o.token=m,o.sub=h,o.sub_display=function(){var e;e=[];for(i in h)A=h[i],e.push(i+" -> "+A);return e}().join(", "),u.push(o)}return this.sorted(u.filter(function(e){return e.token.length>1}))},spatial_match:function(e,t){var n,r,i;null==t&&(t=GRAPHS),i=[];for(r in t)n=t[r],this.extend(i,this.spatial_match_helper(e,n,r));return this.sorted(i)},SHIFTED_RX:/[~!@#$%^&*()_+QWERTYUIOP{}|ASDFGHJKL:"ZXCVBNM<>?]/,spatial_match_helper:function(e,t,n){var r,i,a,s,o,h,u,c,l,_,f,d,p,g,m;for(f=[],u=0;u<e.length-1;)for(c=u+1,l=null,m=0,g="qwerty"!==n&&"dvorak"!==n||!this.SHIFTED_RX.exec(e.charAt(u))?0:1;;){if(p=e.charAt(c-1),o=!1,h=-1,s=-1,i=t[p]||[],c<e.length)for(a=e.charAt(c),d=0,_=i.length;d<_;d++)if(r=i[d],s+=1,r&&r.indexOf(a)!==-1){o=!0,h=s,1===r.indexOf(a)&&(g+=1),l!==h&&(m+=1,l=h);break}if(!o){c-u>2&&f.push({pattern:"spatial",i:u,j:c-1,token:e.slice(u,c),graph:n,turns:m,shifted_count:g}),u=c;break}c+=1}return f},repeat_match:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p;for(d=[],a=/(.+)\1+/g,c=/(.+?)\1+/g,l=/^(.+?)\1+$/,u=0;u<e.length&&(a.lastIndex=c.lastIndex=u,s=a.exec(e),_=c.exec(e),null!=s);)s[0].length>_[0].length?(f=s,i=l.exec(f[0])[1]):(f=_,i=f[1]),p=[f.index,f.index+f[0].length-1],o=p[0],h=p[1],t=scoring.most_guessable_match_sequence(i,this.omnimatch(i)),r=t.sequence,n=t.guesses,d.push({pattern:"repeat",i:o,j:h,token:f[0],base_token:i,base_guesses:n,base_matches:r,repeat_count:f[0].length/i.length}),u=h+1;return d},MAX_DELTA:5,sequence_match:function(e){var t,n,r,i,a,s,o,h,u;if(1===e.length)return[];for(u=function(t){return function(n,r,i){var a,s,o,u;if((r-n>1||1===Math.abs(i))&&0<(a=Math.abs(i))&&a<=t.MAX_DELTA)return u=e.slice(n,+r+1||9e9),/^[a-z]+$/.test(u)?(s="lower",o=26):/^[A-Z]+$/.test(u)?(s="upper",o=26):/^\d+$/.test(u)?(s="digits",o=10):(s="unicode",o=26),h.push({pattern:"sequence",i:n,j:r,token:e.slice(n,+r+1||9e9),sequence_name:s,sequence_space:o,ascending:i>0})}}(this),h=[],n=0,a=null,i=s=1,o=e.length;1<=o?s<o:s>o;i=1<=o?++s:--s)t=e.charCodeAt(i)-e.charCodeAt(i-1),null==a&&(a=t),t!==a&&(r=i-1,u(n,r,a),n=r,a=t);return u(n,e.length-1,a),h},regex_match:function(e,t){var n,r,i,a;null==t&&(t=REGEXEN),n=[];for(name in t)for(r=t[name],r.lastIndex=0;i=r.exec(e);)a=i[0],n.push({pattern:"regex",token:a,i:i.index,j:i.index+i[0].length-1,regex_name:name,regex_match:i});return this.sorted(n)},date_match:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p,g,m,A,E,y,v,I,R,T,D,k,x,j,b,N,S,q,L,M;for(_=[],f=/^\d{4,8}$/,d=/^(\d{1,4})([\s\/\\_.-])(\d{1,2})\2(\d{1,4})$/,s=m=0,v=e.length-4;0<=v?m<=v:m>=v;s=0<=v?++m:--m)for(o=A=I=s+3,R=s+7;(I<=R?A<=R:A>=R)&&!(o>=e.length);o=I<=R?++A:--A)if(M=e.slice(s,+o+1||9e9),f.exec(M)){for(r=[],T=DATE_SPLITS[M.length],E=0,c=T.length;E<c;E++)D=T[E],h=D[0],u=D[1],a=this.map_ints_to_dmy([parseInt(M.slice(0,h)),parseInt(M.slice(h,u)),parseInt(M.slice(u))]),null!=a&&r.push(a);if(r.length>0){for(t=r[0],p=function(e){return Math.abs(e.year-scoring.REFERENCE_YEAR)},g=p(r[0]),k=r.slice(1),y=0,l=k.length;y<l;y++)n=k[y],i=p(n),i<g&&(x=[n,i],t=x[0],g=x[1]);_.push({pattern:"date",token:M,i:s,j:o,separator:"",year:t.year,month:t.month,day:t.day})}}for(s=q=0,j=e.length-6;0<=j?q<=j:q>=j;s=0<=j?++q:--q)for(o=L=b=s+5,N=s+9;(b<=N?L<=N:L>=N)&&!(o>=e.length);o=b<=N?++L:--L)M=e.slice(s,+o+1||9e9),S=d.exec(M),null!=S&&(a=this.map_ints_to_dmy([parseInt(S[1]),parseInt(S[3]),parseInt(S[4])]),null!=a&&_.push({pattern:"date",token:M,i:s,j:o,separator:S[2],year:a.year,month:a.month,day:a.day}));return this.sorted(_.filter(function(e){var t,n,r,i;for(t=!1,i=0,n=_.length;i<n;i++)if(r=_[i],e!==r&&r.i<=e.i&&r.j>=e.j){t=!0;break}return!t}))},map_ints_to_dmy:function(e){var t,n,r,i,a,s,o,h,u,c,l,_,f,d,p,g;if(!(e[1]>31||e[1]<=0)){for(o=0,h=0,p=0,s=0,r=e.length;s<r;s++){if(n=e[s],99<n&&n<DATE_MIN_YEAR||n>DATE_MAX_YEAR)return;n>31&&(h+=1),n>12&&(o+=1),n<=0&&(p+=1)}if(!(h>=2||3===o||p>=2)){for(c=[[e[2],e.slice(0,2)],[e[0],e.slice(1,3)]],u=0,i=c.length;u<i;u++)if(_=c[u],g=_[0],d=_[1],DATE_MIN_YEAR<=g&&g<=DATE_MAX_YEAR)return t=this.map_ints_to_dm(d),null!=t?{year:g,month:t.month,day:t.day}:void 0;for(l=0,a=c.length;l<a;l++)if(f=c[l],g=f[0],d=f[1],t=this.map_ints_to_dm(d),null!=t)return g=this.two_to_four_digit_year(g),{year:g,month:t.month,day:t.day}}}},map_ints_to_dm:function(e){var t,n,r,i,a,s;for(a=[e,e.slice().reverse()],i=0,n=a.length;i<n;i++)if(s=a[i],t=s[0],r=s[1],1<=t&&t<=31&&1<=r&&r<=12)return{day:t,month:r}},two_to_four_digit_year:function(e){return e>99?e:e>50?e+1900:e+2e3}},module.exports=matching; + +},{"./adjacency_graphs":1,"./frequency_lists":3,"./scoring":6}],6:[function(require,module,exports){ +var BRUTEFORCE_CARDINALITY,MIN_GUESSES_BEFORE_GROWING_SEQUENCE,MIN_SUBMATCH_GUESSES_MULTI_CHAR,MIN_SUBMATCH_GUESSES_SINGLE_CHAR,adjacency_graphs,calc_average_degree,k,scoring,v;adjacency_graphs=require("./adjacency_graphs"),calc_average_degree=function(e){var t,r,n,s,a,u;t=0;for(n in e)a=e[n],t+=function(){var e,t,r;for(r=[],t=0,e=a.length;t<e;t++)s=a[t],s&&r.push(s);return r}().length;return t/=function(){var t;t=[];for(r in e)u=e[r],t.push(r);return t}().length},BRUTEFORCE_CARDINALITY=10,MIN_GUESSES_BEFORE_GROWING_SEQUENCE=1e4,MIN_SUBMATCH_GUESSES_SINGLE_CHAR=10,MIN_SUBMATCH_GUESSES_MULTI_CHAR=50,scoring={nCk:function(e,t){var r,n,s,a;if(t>e)return 0;if(0===t)return 1;for(s=1,r=n=1,a=t;1<=a?n<=a:n>=a;r=1<=a?++n:--n)s*=e,s/=r,e-=1;return s},log10:function(e){return Math.log(e)/Math.log(10)},log2:function(e){return Math.log(e)/Math.log(2)},factorial:function(e){var t,r,n,s;if(e<2)return 1;for(t=1,r=n=2,s=e;2<=s?n<=s:n>=s;r=2<=s?++n:--n)t*=r;return t},most_guessable_match_sequence:function(e,t,r){var n,s,a,u,i,_,o,h,E,c,g,f,l,p,A,S,R,v,I,M,N,C,U,T;for(null==r&&(r=!1),l=e.length,f=function(){var e,t,r;for(r=[],n=e=0,t=l;0<=t?e<t:e>t;n=0<=t?++e:--e)r.push([]);return r}(),p=0,_=t.length;p<_;p++)c=t[p],f[c.j].push(c);for(v=0,o=f.length;v<o;v++)E=f[v],E.sort(function(e,t){return e.i-t.i});for(A={m:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}(),pi:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}(),g:function(){var e,t,r;for(t=[],n=r=0,e=l;0<=e?r<e:r>e;n=0<=e?++r:--r)t.push({});return t}()},U=function(t){return function(n,s){var a,u,i,_,o,h;_=n.j,o=t.estimate_guesses(n,e),s>1&&(o*=A.pi[n.i-1][s-1]),i=t.factorial(s)*o,r||(i+=Math.pow(MIN_GUESSES_BEFORE_GROWING_SEQUENCE,s-1)),h=A.g[_];for(u in h)if(a=h[u],!(u>s)&&a<=i)return;return A.g[_][s]=i,A.m[_][s]=n,A.pi[_][s]=o}}(this),s=function(e){return function(e){var t,r,n,s,a,u;for(c=g(0,e),U(c,1),a=[],t=u=1,s=e;1<=s?u<=s:u>=s;t=1<=s?++u:--u)c=g(t,e),a.push(function(){var e,s;e=A.m[t-1],s=[];for(r in e)n=e[r],r=parseInt(r),"bruteforce"!==n.pattern&&s.push(U(c,r+1));return s}());return a}}(this),g=function(t){return function(t,r){return{pattern:"bruteforce",token:e.slice(t,+r+1||9e9),i:t,j:r}}}(this),C=function(e){return function(e){var t,r,n,s,a,u,i;u=[],s=e-1,a=void 0,n=1/0,i=A.g[s];for(r in i)t=i[r],t<n&&(a=r,n=t);for(;s>=0;)c=A.m[s][a],u.unshift(c),s=c.i-1,a--;return u}}(this),u=N=0,I=l;0<=I?N<I:N>I;u=0<=I?++N:--N){for(M=f[u],T=0,h=M.length;T<h;T++)if(c=M[T],c.i>0)for(i in A.m[c.i-1])i=parseInt(i),U(c,i+1);else U(c,1);s(u)}return R=C(l),S=R.length,a=0===e.length?1:A.g[l-1][S],{password:e,guesses:a,guesses_log10:this.log10(a),sequence:R}},estimate_guesses:function(e,t){var r,n,s;return null!=e.guesses?e.guesses:(s=1,e.token.length<t.length&&(s=1===e.token.length?MIN_SUBMATCH_GUESSES_SINGLE_CHAR:MIN_SUBMATCH_GUESSES_MULTI_CHAR),r={bruteforce:this.bruteforce_guesses,dictionary:this.dictionary_guesses,spatial:this.spatial_guesses,repeat:this.repeat_guesses,sequence:this.sequence_guesses,regex:this.regex_guesses,date:this.date_guesses},n=r[e.pattern].call(this,e),e.guesses=Math.max(n,s),e.guesses_log10=this.log10(e.guesses),e.guesses)},bruteforce_guesses:function(e){var t,r;return t=Math.pow(BRUTEFORCE_CARDINALITY,e.token.length),r=1===e.token.length?MIN_SUBMATCH_GUESSES_SINGLE_CHAR+1:MIN_SUBMATCH_GUESSES_MULTI_CHAR+1,Math.max(t,r)},repeat_guesses:function(e){return e.base_guesses*e.repeat_count},sequence_guesses:function(e){var t,r;return r=e.token.charAt(0),t="a"===r||"A"===r||"z"===r||"Z"===r||"0"===r||"1"===r||"9"===r?4:r.match(/\d/)?10:26,e.ascending||(t*=2),t*e.token.length},MIN_YEAR_SPACE:20,REFERENCE_YEAR:2016,regex_guesses:function(e){var t,r;if(t={alpha_lower:26,alpha_upper:26,alpha:52,alphanumeric:62,digits:10,symbols:33},e.regex_name in t)return Math.pow(t[e.regex_name],e.token.length);switch(e.regex_name){case"recent_year":return r=Math.abs(parseInt(e.regex_match[0])-this.REFERENCE_YEAR),r=Math.max(r,this.MIN_YEAR_SPACE)}},date_guesses:function(e){var t,r;return r=Math.max(Math.abs(e.year-this.REFERENCE_YEAR),this.MIN_YEAR_SPACE),t=365*r,e.separator&&(t*=4),t},KEYBOARD_AVERAGE_DEGREE:calc_average_degree(adjacency_graphs.qwerty),KEYPAD_AVERAGE_DEGREE:calc_average_degree(adjacency_graphs.keypad),KEYBOARD_STARTING_POSITIONS:function(){var e,t;e=adjacency_graphs.qwerty,t=[];for(k in e)v=e[k],t.push(k);return t}().length,KEYPAD_STARTING_POSITIONS:function(){var e,t;e=adjacency_graphs.keypad,t=[];for(k in e)v=e[k],t.push(k);return t}().length,spatial_guesses:function(e){var t,r,n,s,a,u,i,_,o,h,E,c,g,f,l,p,A,S;for("qwerty"===(E=e.graph)||"dvorak"===E?(l=this.KEYBOARD_STARTING_POSITIONS,s=this.KEYBOARD_AVERAGE_DEGREE):(l=this.KEYPAD_STARTING_POSITIONS,s=this.KEYPAD_AVERAGE_DEGREE),a=0,t=e.token.length,A=e.turns,u=_=2,c=t;2<=c?_<=c:_>=c;u=2<=c?++_:--_)for(o=Math.min(A,u-1),i=h=1,g=o;1<=g?h<=g:h>=g;i=1<=g?++h:--h)a+=this.nCk(u-1,i-1)*l*Math.pow(s,i);if(e.shifted_count)if(r=e.shifted_count,n=e.token.length-e.shifted_count,0===r||0===n)a*=2;else{for(p=0,u=S=1,f=Math.min(r,n);1<=f?S<=f:S>=f;u=1<=f?++S:--S)p+=this.nCk(r+n,u);a*=p}return a},dictionary_guesses:function(e){var t;return e.base_guesses=e.rank,e.uppercase_variations=this.uppercase_variations(e),e.l33t_variations=this.l33t_variations(e),t=e.reversed&&2||1,e.base_guesses*e.uppercase_variations*e.l33t_variations*t},START_UPPER:/^[A-Z][^A-Z]+$/,END_UPPER:/^[^A-Z]+[A-Z]$/,ALL_UPPER:/^[^a-z]+$/,ALL_LOWER:/^[^A-Z]+$/,uppercase_variations:function(e){var t,r,n,s,a,u,i,_,o,h,E,c;if(c=e.token,c.match(this.ALL_LOWER)||c.toLowerCase()===c)return 1;for(_=[this.START_UPPER,this.END_UPPER,this.ALL_UPPER],u=0,a=_.length;u<a;u++)if(h=_[u],c.match(h))return 2;for(r=function(){var e,t,r,s;for(r=c.split(""),s=[],t=0,e=r.length;t<e;t++)n=r[t],n.match(/[A-Z]/)&&s.push(n);return s}().length,t=function(){var e,t,r,s;for(r=c.split(""),s=[],t=0,e=r.length;t<e;t++)n=r[t],n.match(/[a-z]/)&&s.push(n);return s}().length,E=0,s=i=1,o=Math.min(r,t);1<=o?i<=o:i>=o;s=1<=o?++i:--i)E+=this.nCk(r+t,s);return E},l33t_variations:function(e){var t,r,n,s,a,u,i,_,o,h,E,c,g;if(!e.l33t)return 1;g=1,o=e.sub;for(E in o)if(c=o[E],s=e.token.toLowerCase().split(""),t=function(){var e,t,r;for(r=[],t=0,e=s.length;t<e;t++)n=s[t],n===E&&r.push(n);return r}().length,r=function(){var e,t,r;for(r=[],t=0,e=s.length;t<e;t++)n=s[t],n===c&&r.push(n);return r}().length,0===t||0===r)g*=2;else{for(i=Math.min(r,t),_=0,a=u=1,h=i;1<=h?u<=h:u>=h;a=1<=h?++u:--u)_+=this.nCk(r+t,a);g*=_}return g}},module.exports=scoring; + +},{"./adjacency_graphs":1}],7:[function(require,module,exports){ +var time_estimates;time_estimates={estimate_attack_times:function(e){var t,n,s,o;n={online_throttling_100_per_hour:e/(100/3600),online_no_throttling_10_per_second:e/10,offline_slow_hashing_1e4_per_second:e/1e4,offline_fast_hashing_1e10_per_second:e/1e10},t={};for(s in n)o=n[s],t[s]=this.display_time(o);return{crack_times_seconds:n,crack_times_display:t,score:this.guesses_to_score(e)}},guesses_to_score:function(e){var t;return t=5,e<1e3+t?0:e<1e6+t?1:e<1e8+t?2:e<1e10+t?3:4},display_time:function(e){var t,n,s,o,_,r,i,a,u,c;return i=60,r=60*i,s=24*r,a=31*s,c=12*a,n=100*c,u=e<1?[null,"less than a second"]:e<i?(t=Math.round(e),[t,t+" second"]):e<r?(t=Math.round(e/i),[t,t+" minute"]):e<s?(t=Math.round(e/r),[t,t+" hour"]):e<a?(t=Math.round(e/s),[t,t+" day"]):e<c?(t=Math.round(e/a),[t,t+" month"]):e<n?(t=Math.round(e/c),[t,t+" year"]):[null,"centuries"],o=u[0],_=u[1],null!=o&&1!==o&&(_+="s"),_}},module.exports=time_estimates; + +},{}]},{},[4])(4) +}); diff --git a/phpMyAdmin/js/whitelist.php b/phpMyAdmin/js/whitelist.php new file mode 100755 index 0000000..10ba267 --- /dev/null +++ b/phpMyAdmin/js/whitelist.php @@ -0,0 +1,46 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Exporting of Core::$goto_whitelist from PHP to Javascript + * + * @package PhpMyAdmin + */ + +use PhpMyAdmin\Core; +use PhpMyAdmin\OutputBuffering; + +if (!defined('TESTSUITE')) { + chdir('..'); + + // Send correct type: + header('Content-Type: text/javascript; charset=UTF-8'); + + // Cache output in client - the nocache query parameter makes sure that this + // file is reloaded when config changes + header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT'); + + // Avoid loading the full common.inc.php because this would add many + // non-js-compatible stuff like DOCTYPE + define('PMA_MINIMUM_COMMON', true); + define('PMA_PATH_TO_BASEDIR', '../'); + require_once './libraries/common.inc.php'; + // Close session early as we won't write anything there + session_write_close(); +} + +$buffer = OutputBuffering::getInstance(); +$buffer->start(); +if (!defined('TESTSUITE')) { + register_shutdown_function( + function () { + echo OutputBuffering::getInstance()->getContents(); + } + ); +} + +echo "var PMA_gotoWhitelist = new Array();\n"; +$i = 0; +foreach (Core::$goto_whitelist as $one_whitelist) { + echo 'PMA_gotoWhitelist[' , $i , ']="' , $one_whitelist , '";' , "\n"; + $i++; +} diff --git a/phpMyAdmin/libraries/advisory_rules_generic.txt b/phpMyAdmin/libraries/advisory_rules_generic.txt new file mode 100755 index 0000000..2a103ec --- /dev/null +++ b/phpMyAdmin/libraries/advisory_rules_generic.txt @@ -0,0 +1,402 @@ +# phpMyAdmin Advisory rules file +# +# Use only UNIX style newlines +# +# This file is being parsed by Advisor.php, which should handle syntax +# errors correctly. However, PHP Warnings and the like are being consumed by +# the phpMyAdmin error handler, so those won't show up E.g.: Justification line +# is empty because you used an unescape percent sign, sprintf() returns an +# empty string and no warning/error is shown +# +# Rule Syntax: +# 'rule' identifier[the name of the rule] eexpr [an optional precondition] +# expr [variable or value calculation used for the test] +# expr [test, if evaluted to 'true' it fires the rule. Use 'value' to insert the calculated value (without quotes)] +# string [the issue (what is the problem?)] +# string [the recommendation (how do i fix it?)] +# formatted-string '|' comma-seperated-expr [the justification (result of the calculated value / why did this rule fire?)] + +# comma-seperated-expr: expr(,expr)* +# eexpr: [expr] - expr enclosed in [] +# expr: a php code literal with extras: +# - variable names are replaced with their respective values +# - fired('name of rule') is replaced with true/false when given rule has +# been fired. Note however that this is a very simple rules engine. +# Rules are only checked in sequential order as they are written down +# here. If given rule has not been checked yet, fired() will always +# evaluate to false +# - 'value' is replaced with the calculated value. If it is a string, it +# will be put within single quotes +# - other than that you may use any php function, initialized variable or +# constant +# +# identifier: A string enclosed in single quotes +# string: A quoteless string, may contain HTML. Variable names enclosed in +# curly braces are replaced with links to directly edit this variable. +# e.g. {tmp_table_size} +# formatted-string: You may use classic php sprintf() string formatting here, +# the arguments must be appended after a trailing pipe (|) as +# mentioned in above syntax percent signs (%) are +# automatically escaped (%%) in the following cases: When +# followed by a space, dot or comma and at the end of the +# line) +# +# Comments start with # +# + +# Queries + +rule 'Uptime below one day' + Uptime + value < 86400 + Uptime is less than 1 day, performance tuning may not be accurate. + To have more accurate averages it is recommended to let the server run for longer than a day before running this analyzer + The uptime is only %s | ADVISOR_timespanFormat(Uptime) + +rule 'Questions below 1,000' + Questions + value < 1000 + Fewer than 1,000 questions have been run against this server. The recommendations may not be accurate. + Let the server run for a longer time until it has executed a greater amount of queries. + Current amount of Questions: %s | Questions + +rule 'Percentage of slow queries' [Questions > 0] + Slow_queries / Questions * 100 + value >= 5 + There is a lot of slow queries compared to the overall amount of Queries. + You might want to increase {long_query_time} or optimize the queries listed in the slow query log + The slow query rate should be below 5%, your value is %s%. | round(value,2) + +rule 'Slow query rate' [Questions > 0] + (Slow_queries / Questions * 100) / Uptime + value * 60 * 60 > 1 + There is a high percentage of slow queries compared to the server uptime. + You might want to increase {long_query_time} or optimize the queries listed in the slow query log + You have a slow query rate of %s per hour, you should have less than 1% per hour. | ADVISOR_bytime(value,2) + +rule 'Long query time' + long_query_time + value >= 10 + {long_query_time} is set to 10 seconds or more, thus only slow queries that take above 10 seconds are logged. + It is suggested to set {long_query_time} to a lower value, depending on your environment. Usually a value of 1-5 seconds is suggested. + long_query_time is currently set to %ds. | value + +rule 'Slow query logging' [PMA_MYSQL_INT_VERSION < 50600] + log_slow_queries + value == 'OFF' + The slow query log is disabled. + Enable slow query logging by setting {log_slow_queries} to 'ON'. This will help troubleshooting badly performing queries. + log_slow_queries is set to 'OFF' + +rule 'Slow query logging' [PMA_MYSQL_INT_VERSION >= 50600] + slow_query_log + value == 'OFF' + The slow query log is disabled. + Enable slow query logging by setting {slow_query_log} to 'ON'. This will help troubleshooting badly performing queries. + slow_query_log is set to 'OFF' + +# +# versions +rule 'Release Series' + version + substr(value,0,2) <= '5.' && substr(value,2,1) < 1 + The MySQL server version less than 5.1. + You should upgrade, as MySQL 5.1 has improved performance, and MySQL 5.5 even more so. + Current version: %s | value + +rule 'Minor Version' [! fired('Release Series')] + version + substr(value,0,2) <= '5.' && substr(value,2,1) <= 1 && substr(value,4,2) < 30 + Version less than 5.1.30 (the first GA release of 5.1). + You should upgrade, as recent versions of MySQL 5.1 have improved performance and MySQL 5.5 even more so. + Current version: %s | value + +rule 'Minor Version' [! fired('Release Series')] + version + substr(value,0,1) == 5 && substr(value,2,1) == 5 && substr(value,4,2) < 8 + Version less than 5.5.8 (the first GA release of 5.5). + You should upgrade, to a stable version of MySQL 5.5. + Current version: %s | value + +rule 'Distribution' + version_comment + preg_match('/source/i',value) + Version is compiled from source, not a MySQL official binary. + If you did not compile from source, you may be using a package modified by a distribution. The MySQL manual only is accurate for official MySQL binaries, not any package distributions (such as RedHat, Debian/Ubuntu etc). + 'source' found in version_comment + +rule 'Distribution' + version_comment + preg_match('/percona/i',value) + The MySQL manual only is accurate for official MySQL binaries. + Percona documentation is at <a href="https://www.percona.com/software/documentation/">https://www.percona.com/software/documentation/</a> + 'percona' found in version_comment + +rule 'MySQL Architecture' + system_memory + value > 3072*1024 && !preg_match('/64/',version_compile_machine) && !preg_match('/64/',version_compile_os) + MySQL is not compiled as a 64-bit package. + Your memory capacity is above 3 GiB (assuming the Server is on localhost), so MySQL might not be able to access all of your memory. You might want to consider installing the 64-bit version of MySQL. + Available memory on this host: %s | ADVISOR_formatByteDown(value*1024, 2, 2) + +# +# Query cache + +rule 'Query caching method' [!fired('Query cache disabled')] + Questions / Uptime + value > 100 + Suboptimal caching method. + You are using the MySQL Query cache with a fairly high traffic database. It might be worth considering to use <a href="https://dev.mysql.com/doc/refman/5.5/en/ha-memcached.html">memcached</a> instead of the MySQL Query cache, especially if you have multiple slaves. + The query cache is enabled and the server receives %d queries per second. This rule fires if there is more than 100 queries per second. | round(value,1) + +# +# Sorts +rule 'Percentage of sorts that cause temporary tables' [Sort_scan + Sort_range > 0] + Sort_merge_passes / (Sort_scan + Sort_range) * 100 + value > 10 + Too many sorts are causing temporary tables. + Consider increasing {sort_buffer_size} and/or {read_rnd_buffer_size}, depending on your system memory limits. + %s% of all sorts cause temporary tables, this value should be lower than 10%. | round(value,1) + +rule 'Rate of sorts that cause temporary tables' + Sort_merge_passes / Uptime + value * 60 * 60 > 1 + Too many sorts are causing temporary tables. + Consider increasing {sort_buffer_size} and/or {read_rnd_buffer_size}, depending on your system memory limits. + Temporary tables average: %s, this value should be less than 1 per hour. | ADVISOR_bytime(value,2) + +rule 'Sort rows' + Sort_rows / Uptime + value * 60 >= 1 + There are lots of rows being sorted. + While there is nothing wrong with a high amount of row sorting, you might want to make sure that the queries which require a lot of sorting use indexed columns in the ORDER BY clause, as this will result in much faster sorting. + Sorted rows average: %s | ADVISOR_bytime(value,2) + +# Joins, scans +rule 'Rate of joins without indexes' + (Select_range_check + Select_scan + Select_full_join) / Uptime + value * 60 * 60 > 1 + There are too many joins without indexes. + This means that joins are doing full table scans. Adding indexes for the columns being used in the join conditions will greatly speed up table joins. + Table joins average: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2) + +rule 'Rate of reading first index entry' + Handler_read_first / Uptime + value * 60 * 60 > 1 + The rate of reading the first index entry is high. + This usually indicates frequent full index scans. Full index scans are faster than table scans but require lots of CPU cycles in big tables, if those tables that have or had high volumes of UPDATEs and DELETEs, running 'OPTIMIZE TABLE' might reduce the amount of and/or speed up full index scans. Other than that full index scans can only be reduced by rewriting queries. + Index scans average: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2) + +rule 'Rate of reading fixed position' + Handler_read_rnd / Uptime + value * 60 * 60 > 1 + The rate of reading data from a fixed position is high. + This indicates that many queries need to sort results and/or do a full table scan, including join queries that do not use indexes. Add indexes where applicable. + Rate of reading fixed position average: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2) + +rule 'Rate of reading next table row' + Handler_read_rnd_next / Uptime + value * 60 * 60 > 1 + The rate of reading the next table row is high. + This indicates that many queries are doing full table scans. Add indexes where applicable. + Rate of reading next table row: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2) + +# temp tables +rule 'Different tmp_table_size and max_heap_table_size' + tmp_table_size - max_heap_table_size + value !=0 + {tmp_table_size} and {max_heap_table_size} are not the same. + If you have deliberately changed one of either: The server uses the lower value of either to determine the maximum size of in-memory tables. So if you wish to increase the in-memory table limit you will have to increase the other value as well. + Current values are tmp_table_size: %s, max_heap_table_size: %s | ADVISOR_formatByteDown(tmp_table_size, 2, 2), ADVISOR_formatByteDown(max_heap_table_size, 2, 2) + +rule 'Percentage of temp tables on disk' [Created_tmp_tables + Created_tmp_disk_tables > 0] + Created_tmp_disk_tables / (Created_tmp_tables + Created_tmp_disk_tables) * 100 + value > 25 + Many temporary tables are being written to disk instead of being kept in memory. + Increasing {max_heap_table_size} and {tmp_table_size} might help. However some temporary tables are always being written to disk, independent of the value of these variables. To eliminate these you will have to rewrite your queries to avoid those conditions (Within a temporary table: Presence of a BLOB or TEXT column or presence of a column bigger than 512 bytes) as mentioned in the beginning of an <a href="https://www.facebook.com/note.php?note_id=10150111255065841&comments">Article by the Pythian Group</a> + %s% of all temporary tables are being written to disk, this value should be below 25% | round(value,1) + +rule 'Temp disk rate' [!fired('Percentage of temp tables on disk')] + Created_tmp_disk_tables / Uptime + value * 60 * 60 > 1 + Many temporary tables are being written to disk instead of being kept in memory. + Increasing {max_heap_table_size} and {tmp_table_size} might help. However some temporary tables are always being written to disk, independent of the value of these variables. To eliminate these you will have to rewrite your queries to avoid those conditions (Within a temporary table: Presence of a BLOB or TEXT column or presence of a column bigger than 512 bytes) as mentioned in the <a href="https://dev.mysql.com/doc/refman/5.5/en/internal-temporary-tables.html">MySQL Documentation</a> + Rate of temporary tables being written to disk: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2) + +# +# MyISAM index cache +rule 'MyISAM key buffer size' + key_buffer_size + value == 0 + Key buffer is not initialized. No MyISAM indexes will be cached. + Set {key_buffer_size} depending on the size of your MyISAM indexes. 64M is a good start. + key_buffer_size is 0 + +rule 'Max % MyISAM key buffer ever used' [key_buffer_size > 0] + Key_blocks_used * key_cache_block_size / key_buffer_size * 100 + value < 95 + MyISAM key buffer (index cache) % used is low. + You may need to decrease the size of {key_buffer_size}, re-examine your tables to see if indexes have been removed, or examine queries and expectations about what indexes are being used. + max % MyISAM key buffer ever used: %s%, this value should be above 95% | round(value,1) + +# Don't fire if above rule fired - we don't need the same advice twice +rule 'Percentage of MyISAM key buffer used' [key_buffer_size > 0 && !fired('Max % MyISAM key buffer ever used')] + ( 1 - Key_blocks_unused * key_cache_block_size / key_buffer_size) * 100 + value < 95 + MyISAM key buffer (index cache) % used is low. + You may need to decrease the size of {key_buffer_size}, re-examine your tables to see if indexes have been removed, or examine queries and expectations about what indexes are being used. + % MyISAM key buffer used: %s%, this value should be above 95% | round(value,1) + +rule 'Percentage of index reads from memory' [Key_read_requests > 0] + 100 - (Key_reads / Key_read_requests * 100) + value < 95 + The % of indexes that use the MyISAM key buffer is low. + You may need to increase {key_buffer_size}. + Index reads from memory: %s%, this value should be above 95% | round(value,1) + +# +# other caches +rule 'Rate of table open' + Opened_tables / Uptime + value*60*60 > 10 + The rate of opening tables is high. + Opening tables requires disk I/O which is costly. Increasing {table_open_cache} might avoid this. + Opened table rate: %s, this value should be less than 10 per hour | ADVISOR_bytime(value,2) + +rule 'Percentage of used open files limit' + Open_files / open_files_limit * 100 + value > 85 + The number of open files is approaching the max number of open files. You may get a "Too many open files" error. + Consider increasing {open_files_limit}, and check the error log when restarting after changing {open_files_limit}. + The number of opened files is at %s% of the limit. It should be below 85% | round(value,1) + +rule 'Rate of open files' + Open_files / Uptime + value * 60 * 60 > 5 + The rate of opening files is high. + Consider increasing {open_files_limit}, and check the error log when restarting after changing {open_files_limit}. + Opened files rate: %s, this value should be less than 5 per hour | ADVISOR_bytime(value,2) + +rule 'Immediate table locks %' [Table_locks_waited + Table_locks_immediate > 0] + Table_locks_immediate / (Table_locks_waited + Table_locks_immediate) * 100 + value < 95 + Too many table locks were not granted immediately. + Optimize queries and/or use InnoDB to reduce lock wait. + Immediate table locks: %s%, this value should be above 95% | round(value,1) + +rule 'Table lock wait rate' + Table_locks_waited / Uptime + value * 60 * 60 > 1 + Too many table locks were not granted immediately. + Optimize queries and/or use InnoDB to reduce lock wait. + Table lock wait rate: %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2) + +rule 'Thread cache' + thread_cache_size + value < 1 + Thread cache is disabled, resulting in more overhead from new connections to MySQL. + Enable the thread cache by setting {thread_cache_size} > 0. + The thread cache is set to 0 + +rule 'Thread cache hit rate %' [thread_cache_size > 0] + 100 - Threads_created / Connections + value < 80 + Thread cache is not efficient. + Increase {thread_cache_size}. + Thread cache hitrate: %s%, this value should be above 80% | round(value,1) + +rule 'Threads that are slow to launch' [slow_launch_time > 0] + Slow_launch_threads + value > 0 + There are too many threads that are slow to launch. + This generally happens in case of general system overload as it is pretty simple operations. You might want to monitor your system load carefully. + %s thread(s) took longer than %s seconds to start, it should be 0 | value, slow_launch_time + +rule 'Slow launch time' + slow_launch_time + value > 2 + Slow_launch_time is above 2s. + Set {slow_launch_time} to 1s or 2s to correctly count threads that are slow to launch. + slow_launch_time is set to %s | value + +# +#Connections +rule 'Percentage of used connections' + Max_used_connections / max_connections * 100 + value > 80 + The maximum amount of used connections is getting close to the value of {max_connections}. + Increase {max_connections}, or decrease {wait_timeout} so that connections that do not close database handlers properly get killed sooner. Make sure the code closes database handlers properly. + Max_used_connections is at %s% of max_connections, it should be below 80% | round(value,1) + +rule 'Percentage of aborted connections' + Aborted_connects / Connections * 100 + value > 1 + Too many connections are aborted. + Connections are usually aborted when they cannot be authorized. <a href="https://www.percona.com/blog/2008/08/23/how-to-track-down-the-source-of-aborted_connects/">This article</a> might help you track down the source. + %s% of all connections are aborted. This value should be below 1% | round(value,1) + +rule 'Rate of aborted connections' + Aborted_connects / Uptime + value * 60 * 60 > 1 + Too many connections are aborted. + Connections are usually aborted when they cannot be authorized. <a href="https://www.percona.com/blog/2008/08/23/how-to-track-down-the-source-of-aborted_connects/">This article</a> might help you track down the source. + Aborted connections rate is at %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2) + +rule 'Percentage of aborted clients' + Aborted_clients / Connections * 100 + value > 2 + Too many clients are aborted. + Clients are usually aborted when they did not close their connection to MySQL properly. This can be due to network issues or code not closing a database handler properly. Check your network and code. + %s% of all clients are aborted. This value should be below 2% | round(value,1) + +rule 'Rate of aborted clients' + Aborted_clients / Uptime + value * 60 * 60 > 1 + Too many clients are aborted. + Clients are usually aborted when they did not close their connection to MySQL properly. This can be due to network issues or code not closing a database handler properly. Check your network and code. + Aborted client rate is at %s, this value should be less than 1 per hour | ADVISOR_bytime(value,2) + +# +# InnoDB +rule 'Is InnoDB disabled?' [PMA_MYSQL_INT_VERSION < 50600] + have_innodb + value != "YES" + You do not have InnoDB enabled. + InnoDB is usually the better choice for table engines. + have_innodb is set to 'value' + +rule 'InnoDB log size' [innodb_buffer_pool_size > 0] + innodb_log_file_size / innodb_buffer_pool_size * 100 + value < 20 && innodb_log_file_size / (1024 * 1024) < 256 + The InnoDB log file size is not an appropriate size, in relation to the InnoDB buffer pool. + Especially on a system with a lot of writes to InnoDB tables you should set {innodb_log_file_size} to 25% of {innodb_buffer_pool_size}. However the bigger this value, the longer the recovery time will be when database crashes, so this value should not be set much higher than 256 MiB. Please note however that you cannot simply change the value of this variable. You need to shutdown the server, remove the InnoDB log files, set the new value in my.cnf, start the server, then check the error logs if everything went fine. See also <a href="https://mysqldatabaseadministration.blogspot.com/2007/01/increase-innodblogfilesize-proper-way.html">this blog entry</a> + Your InnoDB log size is at %s% in relation to the InnoDB buffer pool size, it should not be below 20% | round(value,1) + +rule 'Max InnoDB log size' [innodb_buffer_pool_size > 0 && innodb_log_file_size / innodb_buffer_pool_size * 100 < 30] + innodb_log_file_size / (1024 * 1024) + value > 256 + The InnoDB log file size is inadequately large. + It is usually sufficient to set {innodb_log_file_size} to 25% of the size of {innodb_buffer_pool_size}. A very big {innodb_log_file_size} slows down the recovery time after a database crash considerably. See also <a href="https://www.percona.com/blog/2006/07/03/choosing-proper-innodb_log_file_size/">this Article</a>. You need to shutdown the server, remove the InnoDB log files, set the new value in my.cnf, start the server, then check the error logs if everything went fine. See also <a href="https://mysqldatabaseadministration.blogspot.com/2007/01/increase-innodblogfilesize-proper-way.html">this blog entry</a> + Your absolute InnoDB log size is %s MiB | round(value,1) + +rule 'InnoDB buffer pool size' [system_memory > 0] + innodb_buffer_pool_size / system_memory * 100 + value < 60 + Your InnoDB buffer pool is fairly small. + The InnoDB buffer pool has a profound impact on performance for InnoDB tables. Assign all your remaining memory to this buffer. For database servers that use solely InnoDB as storage engine and have no other services (e.g. a web server) running, you may set this as high as 80% of your available memory. If that is not the case, you need to carefully assess the memory consumption of your other services and non-InnoDB-Tables and set this variable accordingly. If it is set too high, your system will start swapping, which decreases performance significantly. See also <a href="https://www.percona.com/blog/2007/11/03/choosing-innodb_buffer_pool_size/">this article</a> + You are currently using %s% of your memory for the InnoDB buffer pool. This rule fires if you are assigning less than 60%, however this might be perfectly adequate for your system if you don't have much InnoDB tables or other services running on the same machine. | value + +# +# other +rule 'MyISAM concurrent inserts' + concurrent_insert + value === 0 || value === 'NEVER' + Enable {concurrent_insert} by setting it to 1 + Setting {concurrent_insert} to 1 reduces contention between readers and writers for a given table. See also <a href="https://dev.mysql.com/doc/refman/5.5/en/concurrent-inserts.html">MySQL Documentation</a> + concurrent_insert is set to 0 + +# INSERT DELAYED USAGE +#Delayed_errors 0 +#Delayed_insert_threads 0 +#Delayed_writes 0 +#Not_flushed_delayed_rows diff --git a/phpMyAdmin/libraries/advisory_rules_mysql_before80003.txt b/phpMyAdmin/libraries/advisory_rules_mysql_before80003.txt new file mode 100755 index 0000000..e28b7f4 --- /dev/null +++ b/phpMyAdmin/libraries/advisory_rules_mysql_before80003.txt @@ -0,0 +1,57 @@ +# phpMyAdmin Advisory rules file +# +# See doc in advisory_rules_generic.txt +# + +# +# Query cache + +# Lame: 'ON' == 0 is true, so you need to compare 'ON' == '0' +rule 'Query cache disabled' + query_cache_size + value == 0 || query_cache_type == 'OFF' || query_cache_type == '0' + The query cache is not enabled. + The query cache is known to greatly improve performance if configured correctly. Enable it by setting {query_cache_size} to a 2 digit MiB value and setting {query_cache_type} to 'ON'. <b>Note:</b> If you are using memcached, ignore this recommendation. + query_cache_size is set to 0 or query_cache_type is set to 'OFF' + +rule 'Query cache efficiency (%)' [Com_select + Qcache_hits > 0 && !fired('Query cache disabled')] + Qcache_hits / (Com_select + Qcache_hits) * 100 + value < 20 + Query cache not running efficiently, it has a low hit rate. + Consider increasing {query_cache_limit}. + The current query cache hit rate of %s% is below 20% | round(value,1) + +rule 'Query Cache usage' [!fired('Query cache disabled')] + 100 - Qcache_free_memory / query_cache_size * 100 + value < 80 + Less than 80% of the query cache is being utilized. + This might be caused by {query_cache_limit} being too low. Flushing the query cache might help as well. + The current ratio of free query cache memory to total query cache size is %s%. It should be above 80% | round(value,1) + +rule 'Query cache fragmentation' [!fired('Query cache disabled')] + Qcache_free_blocks / (Qcache_total_blocks / 2) * 100 + value > 20 + The query cache is considerably fragmented. + Severe fragmentation is likely to (further) increase Qcache_lowmem_prunes. This might be caused by many Query cache low memory prunes due to {query_cache_size} being too small. For a immediate but short lived fix you can flush the query cache (might lock the query cache for a long time). Carefully adjusting {query_cache_min_res_unit} to a lower value might help too, e.g. you can set it to the average size of your queries in the cache using this formula: (query_cache_size - qcache_free_memory) / qcache_queries_in_cache + The cache is currently fragmented by %s% , with 100% fragmentation meaning that the query cache is an alternating pattern of free and used blocks. This value should be below 20%. | round(value,1) + +rule 'Query cache low memory prunes' [Qcache_inserts > 0 && !fired('Query cache disabled')] + Qcache_lowmem_prunes / Qcache_inserts * 100 + value > 0.1 + Cached queries are removed due to low query cache memory from the query cache. + You might want to increase {query_cache_size}, however keep in mind that the overhead of maintaining the cache is likely to increase with its size, so do this in small increments and monitor the results. + The ratio of removed queries to inserted queries is %s%. The lower this value is, the better (This rules firing limit: 0.1%) | round(value,1) + +rule 'Query cache max size' [!fired('Query cache disabled')] + query_cache_size + value > 1024 * 1024 * 128 + The query cache size is above 128 MiB. Big query caches may cause significant overhead that is required to maintain the cache. + Depending on your environment, it might be performance increasing to reduce this value. + Current query cache size: %s | ADVISOR_formatByteDown(value, 2, 2) + +rule 'Query cache min result size' [!fired('Query cache disabled')] + query_cache_limit + value == 1024*1024 + The max size of the result set in the query cache is the default of 1 MiB. + Changing {query_cache_limit} (usually by increasing) may increase efficiency. This variable determines the maximum size a query result may have to be inserted into the query cache. If there are many query results above 1 MiB that are well cacheable (many reads, little writes) then increasing {query_cache_limit} will increase efficiency. Whereas in the case of many query results being above 1 MiB that are not very well cacheable (often invalidated due to table updates) increasing {query_cache_limit} might reduce efficiency. + query_cache_limit is set to 1 MiB diff --git a/phpMyAdmin/libraries/certs/12d55845.0 b/phpMyAdmin/libraries/certs/12d55845.0 new file mode 100755 index 0000000..b2e43c9 --- /dev/null +++ b/phpMyAdmin/libraries/certs/12d55845.0 @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ +MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT +DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow +PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD +Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O +rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq +OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b +xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw +7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD +aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG +SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 +ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr +AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz +R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 +JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo +Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- diff --git a/phpMyAdmin/libraries/certs/2e5ac55d.0 b/phpMyAdmin/libraries/certs/2e5ac55d.0 new file mode 100755 index 0000000..b2e43c9 --- /dev/null +++ b/phpMyAdmin/libraries/certs/2e5ac55d.0 @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ +MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT +DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow +PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD +Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O +rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq +OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b +xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw +7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD +aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG +SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 +ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr +AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz +R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 +JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo +Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- diff --git a/phpMyAdmin/libraries/certs/4042bcee.0 b/phpMyAdmin/libraries/certs/4042bcee.0 new file mode 100755 index 0000000..9548dc1 --- /dev/null +++ b/phpMyAdmin/libraries/certs/4042bcee.0 @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw +TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh +cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 +WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu +ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc +h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ +0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U +A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW +T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH +B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC +B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv +KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn +OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn +jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw +qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI +rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq +hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ +3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK +NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 +ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur +TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC +jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc +oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq +4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA +mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d +emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE----- diff --git a/phpMyAdmin/libraries/certs/6187b673.0 b/phpMyAdmin/libraries/certs/6187b673.0 new file mode 100755 index 0000000..9548dc1 --- /dev/null +++ b/phpMyAdmin/libraries/certs/6187b673.0 @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw +TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh +cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 +WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu +ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc +h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ +0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U +A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW +T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH +B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC +B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv +KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn +OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn +jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw +qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI +rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq +hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ +3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK +NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 +ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur +TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC +jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc +oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq +4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA +mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d +emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE----- diff --git a/phpMyAdmin/libraries/certs/README.rst b/phpMyAdmin/libraries/certs/README.rst new file mode 100755 index 0000000..bc48f6c --- /dev/null +++ b/phpMyAdmin/libraries/certs/README.rst @@ -0,0 +1,16 @@ +phpMyAdmin SSL certificates +=========================== + +This directory contains copy of root certificates used to sign phpmyadmin.net +and reports.phpmyadmin.net websites. It is used to allow operation on systems +where the certificates are missing or wrongly configured (happens on Windows +with wrongly compiled CURL). + +Currently included SSL certificates: + +* ISRG Root X1 +* DST Root CA X3 + +See https://letsencrypt.org/certificates/ for more info on them. + +In case of update, the filenames can be generated using c_rehash tool. diff --git a/phpMyAdmin/libraries/certs/cacert.pem b/phpMyAdmin/libraries/certs/cacert.pem new file mode 100755 index 0000000..5f2265f --- /dev/null +++ b/phpMyAdmin/libraries/certs/cacert.pem @@ -0,0 +1,51 @@ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw +TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh +cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 +WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu +ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY +MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc +h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ +0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U +A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW +T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH +B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC +B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv +KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn +OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn +jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw +qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI +rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq +hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ +3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK +NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 +ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur +TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC +jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc +oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq +4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA +mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d +emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/ +MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT +DkRTVCBSb290IENBIFgzMB4XDTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVow +PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD +Ew5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmTrE4O +rz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEq +OLl5CjH9UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9b +xiqKqy69cK3FCxolkHRyxXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw +7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40dutolucbY38EVAjqr2m7xPi71XAicPNaD +aeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQMA0GCSqG +SIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69 +ikugdB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXr +AvHRAosZy5Q6XkjEGB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZz +R8srzJmwN0jP41ZL9c8PDHIyh8bwRLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5 +JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubSfZGL+T0yjWW06XyxV3bqxbYo +Ob8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- diff --git a/phpMyAdmin/libraries/check_user_privileges.inc.php b/phpMyAdmin/libraries/check_user_privileges.inc.php new file mode 100755 index 0000000..168a992 --- /dev/null +++ b/phpMyAdmin/libraries/check_user_privileges.inc.php @@ -0,0 +1,29 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Get user's global privileges and some db-specific privileges + * + * @package PhpMyAdmin + */ +if (! defined('PHPMYADMIN')) { + exit; +} + +use PhpMyAdmin\CheckUserPrivileges; + +$checkUserPrivileges = new CheckUserPrivileges($GLOBALS['dbi']); + +list($username, $hostname) = $GLOBALS['dbi']->getCurrentUserAndHost(); +if ($username === '') { // MySQL is started with --skip-grant-tables + $GLOBALS['is_create_db_priv'] = true; + $GLOBALS['is_reload_priv'] = true; + $GLOBALS['db_to_create'] = ''; + $GLOBALS['dbs_where_create_table_allowed'] = array('*'); + $GLOBALS['dbs_to_test'] = false; + $GLOBALS['db_priv'] = true; + $GLOBALS['col_priv'] = true; + $GLOBALS['table_priv'] = true; + $GLOBALS['proc_priv'] = true; +} else { + $checkUserPrivileges->analyseShowGrant(); +} diff --git a/phpMyAdmin/libraries/classes/Advisor.php b/phpMyAdmin/libraries/classes/Advisor.php new file mode 100755 index 0000000..a60b777 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Advisor.php @@ -0,0 +1,675 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * A simple rules engine, that parses and executes the rules in advisory_rules.txt. + * Adjusted to phpMyAdmin. + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use Exception; +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\SysInfo; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; + +/** + * Advisor class + * + * @package PhpMyAdmin + */ +class Advisor +{ + const GENERIC_RULES_FILE = 'libraries/advisory_rules_generic.txt'; + const BEFORE_MYSQL80003_RULES_FILE = 'libraries/advisory_rules_mysql_before80003.txt'; + + protected $dbi; + protected $variables; + protected $globals; + protected $parseResult; + protected $runResult; + protected $expression; + + /** + * Constructor + * + * @param DatabaseInterface $dbi DatabaseInterface object + * @param ExpressionLanguage $expression ExpressionLanguage object + */ + public function __construct(DatabaseInterface $dbi, ExpressionLanguage $expression) + { + $this->dbi = $dbi; + $this->expression = $expression; + /* + * Register functions for ExpressionLanguage, we intentionally + * do not implement support for compile as we do not use it. + */ + $this->expression->register( + 'round', + function (){}, + function ($arguments, $num) { + return round($num); + } + ); + $this->expression->register( + 'substr', + function (){}, + function ($arguments, $string, $start, $length) { + return substr($string, $start, $length); + } + ); + $this->expression->register( + 'preg_match', + function (){}, + function ($arguments, $pattern , $subject) { + return preg_match($pattern, $subject); + } + ); + $this->expression->register( + 'ADVISOR_bytime', + function (){}, + function ($arguments, $num, $precision) { + return self::byTime($num, $precision); + } + ); + $this->expression->register( + 'ADVISOR_timespanFormat', + function (){}, + function ($arguments, $seconds) { + return self::timespanFormat($seconds); + } + ); + $this->expression->register( + 'ADVISOR_formatByteDown', + function (){}, + function ($arguments, $value, $limes = 6, $comma = 0) { + return self::formatByteDown($value, $limes, $comma); + } + ); + $this->expression->register( + 'fired', + function (){}, + function ($arguments, $value) { + if (!isset($this->runResult['fired'])) { + return 0; + } + + // Did matching rule fire? + foreach ($this->runResult['fired'] as $rule) { + if ($rule['id'] == $value) { + return '1'; + } + } + + return '0'; + } + ); + /* Some global variables for advisor */ + $this->globals = array( + 'PMA_MYSQL_INT_VERSION' => $this->dbi->getVersion(), + ); + + } + + /** + * Get variables + * + * @return mixed + */ + public function getVariables() + { + return $this->variables; + } + + /** + * Set variables + * + * @param array $variables Variables + * + * @return Advisor + */ + public function setVariables(array $variables) + { + $this->variables = $variables; + + return $this; + } + + /** + * Set a variable and its value + * + * @param string|int $variable Variable to set + * @param mixed $value Value to set + * + * @return $this + */ + public function setVariable($variable, $value) + { + $this->variables[$variable] = $value; + + return $this; + } + + /** + * Get parseResult + * + * @return mixed + */ + public function getParseResult() + { + return $this->parseResult; + } + + /** + * Set parseResult + * + * @param array $parseResult Parse result + * + * @return Advisor + */ + public function setParseResult(array $parseResult) + { + $this->parseResult = $parseResult; + + return $this; + } + + /** + * Get runResult + * + * @return mixed + */ + public function getRunResult() + { + return $this->runResult; + } + + /** + * Set runResult + * + * @param array $runResult Run result + * + * @return Advisor + */ + public function setRunResult(array $runResult) + { + $this->runResult = $runResult; + + return $this; + } + + /** + * Parses and executes advisor rules + * + * @return array with run and parse results + */ + public function run() + { + // HowTo: A simple Advisory system in 3 easy steps. + + // Step 1: Get some variables to evaluate on + $this->setVariables( + array_merge( + $this->dbi->fetchResult('SHOW GLOBAL STATUS', 0, 1), + $this->dbi->fetchResult('SHOW GLOBAL VARIABLES', 0, 1) + ) + ); + + // Add total memory to variables as well + $sysinfo = SysInfo::get(); + $memory = $sysinfo->memory(); + $this->variables['system_memory'] + = isset($memory['MemTotal']) ? $memory['MemTotal'] : 0; + + $ruleFiles = $this->defineRulesFiles(); + + // Step 2: Read and parse the list of rules + $parsedResults = []; + foreach ($ruleFiles as $ruleFile) { + $parsedResults[] = $this->parseRulesFile($ruleFile); + } + $this->setParseResult(call_user_func_array('array_merge_recursive', $parsedResults)); + + // Step 3: Feed the variables to the rules and let them fire. Sets + // $runResult + $this->runRules(); + + return array( + 'parse' => array('errors' => $this->parseResult['errors']), + 'run' => $this->runResult + ); + } + + /** + * Stores current error in run results. + * + * @param string $description description of an error. + * @param Exception $exception exception raised + * + * @return void + */ + public function storeError($description, $exception) + { + $this->runResult['errors'][] = $description + . ' ' + . sprintf( + __('Error when evaluating: %s'), + $exception->getMessage() + ); + } + + /** + * Executes advisor rules + * + * @return boolean + */ + public function runRules() + { + $this->setRunResult( + array( + 'fired' => array(), + 'notfired' => array(), + 'unchecked' => array(), + 'errors' => array(), + ) + ); + + foreach ($this->parseResult['rules'] as $rule) { + $this->variables['value'] = 0; + $precond = true; + + if (isset($rule['precondition'])) { + try { + $precond = $this->ruleExprEvaluate($rule['precondition']); + } catch (Exception $e) { + $this->storeError( + sprintf( + __('Failed evaluating precondition for rule \'%s\'.'), + $rule['name'] + ), + $e + ); + continue; + } + } + + if (! $precond) { + $this->addRule('unchecked', $rule); + } else { + try { + $value = $this->ruleExprEvaluate($rule['formula']); + } catch (Exception $e) { + $this->storeError( + sprintf( + __('Failed calculating value for rule \'%s\'.'), + $rule['name'] + ), + $e + ); + continue; + } + + $this->variables['value'] = $value; + + try { + if ($this->ruleExprEvaluate($rule['test'])) { + $this->addRule('fired', $rule); + } else { + $this->addRule('notfired', $rule); + } + } catch (Exception $e) { + $this->storeError( + sprintf( + __('Failed running test for rule \'%s\'.'), + $rule['name'] + ), + $e + ); + } + } + } + + return true; + } + + /** + * Escapes percent string to be used in format string. + * + * @param string $str string to escape + * + * @return string + */ + public static function escapePercent($str) + { + return preg_replace('/%( |,|\.|$|\(|\)|<|>)/', '%%\1', $str); + } + + /** + * Wrapper function for translating. + * + * @param string $str the string + * @param string $param the parameters + * + * @return string + */ + public function translate($str, $param = null) + { + $string = _gettext(self::escapePercent($str)); + if (! is_null($param)) { + $params = $this->ruleExprEvaluate('[' . $param . ']'); + } else { + $params = array(); + } + return vsprintf($string, $params); + } + + /** + * Splits justification to text and formula. + * + * @param array $rule the rule + * + * @return string[] + */ + public static function splitJustification(array $rule) + { + $jst = preg_split('/\s*\|\s*/', $rule['justification'], 2); + if (count($jst) > 1) { + return array($jst[0], $jst[1]); + } + return array($rule['justification']); + } + + /** + * Adds a rule to the result list + * + * @param string $type type of rule + * @param array $rule rule itself + * + * @return void + */ + public function addRule($type, array $rule) + { + switch ($type) { + case 'notfired': + case 'fired': + $jst = self::splitJustification($rule); + if (count($jst) > 1) { + try { + /* Translate */ + $str = $this->translate($jst[0], $jst[1]); + } catch (Exception $e) { + $this->storeError( + sprintf( + __('Failed formatting string for rule \'%s\'.'), + $rule['name'] + ), + $e + ); + return; + } + + $rule['justification'] = $str; + } else { + $rule['justification'] = $this->translate($rule['justification']); + } + $rule['id'] = $rule['name']; + $rule['name'] = $this->translate($rule['name']); + $rule['issue'] = $this->translate($rule['issue']); + + // Replaces {server_variable} with 'server_variable' + // linking to server_variables.php + $rule['recommendation'] = preg_replace_callback( + '/\{([a-z_0-9]+)\}/Ui', + array($this, 'replaceVariable'), + $this->translate($rule['recommendation']) + ); + + // Replaces external Links with Core::linkURL() generated links + $rule['recommendation'] = preg_replace_callback( + '#href=("|\')(https?://[^\1]+)\1#i', + array($this, 'replaceLinkURL'), + $rule['recommendation'] + ); + break; + } + + $this->runResult[$type][] = $rule; + } + + /** + * Defines the rules files to use + * + * @return array + */ + protected function defineRulesFiles() + { + $isMariaDB = false !== strpos($this->getVariables()['version'], 'MariaDB'); + $ruleFiles = [self::GENERIC_RULES_FILE]; + // If MariaDB (= not MySQL) OR MYSQL < 8.0.3, add another rules file. + if ($isMariaDB || $this->globals['PMA_MYSQL_INT_VERSION'] < 80003) { + $ruleFiles[] = self::BEFORE_MYSQL80003_RULES_FILE; + } + return $ruleFiles; + } + + /** + * Callback for wrapping links with Core::linkURL + * + * @param array $matches List of matched elements form preg_replace_callback + * + * @return string Replacement value + */ + private function replaceLinkURL(array $matches) + { + return 'href="' . Core::linkURL($matches[2]) . '" target="_blank" rel="noopener noreferrer"'; + } + + /** + * Callback for wrapping variable edit links + * + * @param array $matches List of matched elements form preg_replace_callback + * + * @return string Replacement value + */ + private function replaceVariable(array $matches) + { + return '<a href="server_variables.php' . Url::getCommon(array('filter' => $matches[1])) + . '">' . htmlspecialchars($matches[1]) . '</a>'; + } + + /** + * Runs a code expression, replacing variable names with their respective + * values + * + * @param string $expr expression to evaluate + * + * @return integer result of evaluated expression + * + * @throws Exception + */ + public function ruleExprEvaluate($expr) + { + // Actually evaluate the code + // This can throw exception + $value = $this->expression->evaluate( + $expr, + array_merge($this->variables, $this->globals) + ); + + return $value; + } + + /** + * Reads the rule file into an array, throwing errors messages on syntax + * errors. + * + * @param string $filename Name of file to parse + * + * @return array with parsed data + */ + public static function parseRulesFile($filename) + { + $file = file($filename, FILE_IGNORE_NEW_LINES); + + $errors = array(); + $rules = array(); + $lines = array(); + + if ($file === false) { + $errors[] = sprintf( + __('Error in reading file: The file \'%s\' does not exist or is not readable!'), + $filename + ); + return array('rules' => $rules, 'lines' => $lines, 'errors' => $errors); + } + + $ruleSyntax = array( + 'name', 'formula', 'test', 'issue', 'recommendation', 'justification' + ); + $numRules = count($ruleSyntax); + $numLines = count($file); + $ruleNo = -1; + $ruleLine = -1; + + for ($i = 0; $i < $numLines; $i++) { + $line = $file[$i]; + if ($line == "" || $line[0] == '#') { + continue; + } + + // Reading new rule + if (substr($line, 0, 4) == 'rule') { + if ($ruleLine > 0) { + $errors[] = sprintf( + __( + 'Invalid rule declaration on line %1$s, expected line ' + . '%2$s of previous rule.' + ), + $i + 1, + $ruleSyntax[$ruleLine++] + ); + continue; + } + if (preg_match("/rule\s'(.*)'( \[(.*)\])?$/", $line, $match)) { + $ruleLine = 1; + $ruleNo++; + $rules[$ruleNo] = array('name' => $match[1]); + $lines[$ruleNo] = array('name' => $i + 1); + if (isset($match[3])) { + $rules[$ruleNo]['precondition'] = $match[3]; + $lines[$ruleNo]['precondition'] = $i + 1; + } + } else { + $errors[] = sprintf( + __('Invalid rule declaration on line %s.'), + $i + 1 + ); + } + continue; + } else { + if ($ruleLine == -1) { + $errors[] = sprintf( + __('Unexpected characters on line %s.'), + $i + 1 + ); + } + } + + // Reading rule lines + if ($ruleLine > 0) { + if (!isset($line[0])) { + continue; // Empty lines are ok + } + // Non tabbed lines are not + if ($line[0] != "\t") { + $errors[] = sprintf( + __( + 'Unexpected character on line %1$s. Expected tab, but ' + . 'found "%2$s".' + ), + $i + 1, + $line[0] + ); + continue; + } + $rules[$ruleNo][$ruleSyntax[$ruleLine]] = chop( + mb_substr($line, 1) + ); + $lines[$ruleNo][$ruleSyntax[$ruleLine]] = $i + 1; + ++$ruleLine; + } + + // Rule complete + if ($ruleLine == $numRules) { + $ruleLine = -1; + } + } + + return array('rules' => $rules, 'lines' => $lines, 'errors' => $errors); + } + + /** + * Formats interval like 10 per hour + * + * @param integer $num number to format + * @param integer $precision required precision + * + * @return string formatted string + */ + public static function byTime($num, $precision) + { + if ($num >= 1) { // per second + $per = __('per second'); + } elseif ($num * 60 >= 1) { // per minute + $num = $num * 60; + $per = __('per minute'); + } elseif ($num * 60 * 60 >= 1 ) { // per hour + $num = $num * 60 * 60; + $per = __('per hour'); + } else { + $num = $num * 60 * 60 * 24; + $per = __('per day'); + } + + $num = round($num, $precision); + + if ($num == 0) { + $num = '<' . pow(10, -$precision); + } + + return "$num $per"; + } + + /** + * Wrapper for PhpMyAdmin\Util::timespanFormat + * + * This function is used when evaluating advisory_rules.txt + * + * @param int $seconds the timespan + * + * @return string the formatted value + */ + public static function timespanFormat($seconds) + { + return Util::timespanFormat($seconds); + } + + /** + * Wrapper around PhpMyAdmin\Util::formatByteDown + * + * This function is used when evaluating advisory_rules.txt + * + * @param double $value the value to format + * @param int $limes the sensitiveness + * @param int $comma the number of decimals to retain + * + * @return string the formatted value with unit + */ + public static function formatByteDown($value, $limes = 6, $comma = 0) + { + return implode(' ', Util::formatByteDown($value, $limes, $comma)); + } +} diff --git a/phpMyAdmin/libraries/classes/Bookmark.php b/phpMyAdmin/libraries/classes/Bookmark.php new file mode 100755 index 0000000..d3f14c5 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Bookmark.php @@ -0,0 +1,383 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Handles bookmarking SQL queries + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Util; + +/** + * Handles bookmarking SQL queries + * + * @package PhpMyAdmin + */ +class Bookmark +{ + /** + * ID of the bookmark + * + * @var int + */ + private $_id; + /** + * Database the bookmark belongs to + * + * @var string + */ + private $_database; + /** + * The user to whom the bookmark belongs, empty for public bookmarks + * + * @var string + */ + private $_user; + /** + * Label of the bookmark + * + * @var string + */ + private $_label; + /** + * SQL query that is bookmarked + * + * @var string + */ + private $_query; + + /** + * @var DatabaseInterface + */ + private $dbi; + + /** + * Current user + * + * @var string + */ + private $user; + + public function __construct(DatabaseInterface $dbi, $user) + { + $this->dbi = $dbi; + $this->user = $user; + } + + /** + * Returns the ID of the bookmark + * + * @return int + */ + public function getId() + { + return $this->_id; + } + + /** + * Returns the database of the bookmark + * + * @return string + */ + public function getDatabase() + { + return $this->_database; + } + + /** + * Returns the user whom the bookmark belongs to + * + * @return string + */ + public function getUser() + { + return $this->_user; + } + + /** + * Returns the label of the bookmark + * + * @return string + */ + public function getLabel() + { + return $this->_label; + } + + /** + * Returns the query + * + * @return string + */ + public function getQuery() + { + return $this->_query; + } + + /** + * Adds a bookmark + * + * @return boolean whether the INSERT succeeds or not + * + * @access public + */ + public function save() + { + $cfgBookmark = self::getParams($this->user); + if (empty($cfgBookmark)) { + return false; + } + + $query = "INSERT INTO " . Util::backquote($cfgBookmark['db']) + . "." . Util::backquote($cfgBookmark['table']) + . " (id, dbase, user, query, label) VALUES (NULL, " + . "'" . $this->dbi->escapeString($this->_database) . "', " + . "'" . $this->dbi->escapeString($this->_user) . "', " + . "'" . $this->dbi->escapeString($this->_query) . "', " + . "'" . $this->dbi->escapeString($this->_label) . "')"; + return $this->dbi->query($query, DatabaseInterface::CONNECT_CONTROL); + } + + /** + * Deletes a bookmark + * + * @return bool true if successful + * + * @access public + */ + public function delete() + { + $cfgBookmark = self::getParams($this->user); + if (empty($cfgBookmark)) { + return false; + } + + $query = "DELETE FROM " . Util::backquote($cfgBookmark['db']) + . "." . Util::backquote($cfgBookmark['table']) + . " WHERE id = " . $this->_id; + return $this->dbi->tryQuery($query, DatabaseInterface::CONNECT_CONTROL); + } + + /** + * Returns the number of variables in a bookmark + * + * @return number number of variables + */ + public function getVariableCount() + { + $matches = array(); + preg_match_all("/\[VARIABLE[0-9]*\]/", $this->_query, $matches, PREG_SET_ORDER); + return count($matches); + } + + /** + * Replace the placeholders in the bookmark query with variables + * + * @param array $variables array of variables + * + * @return string query with variables applied + */ + public function applyVariables(array $variables) + { + // remove comments that encloses a variable placeholder + $query = preg_replace( + '|/\*(.*\[VARIABLE[0-9]*\].*)\*/|imsU', + '${1}', + $this->_query + ); + // replace variable placeholders with values + $number_of_variables = $this->getVariableCount(); + for ($i = 1; $i <= $number_of_variables; $i++) { + $var = ''; + if (! empty($variables[$i])) { + $var = $this->dbi->escapeString($variables[$i]); + } + $query = str_replace('[VARIABLE' . $i . ']', $var, $query); + // backward compatibility + if ($i == 1) { + $query = str_replace('[VARIABLE]', $var, $query); + } + } + return $query; + } + + /** + * Defines the bookmark parameters for the current user + * + * @param string $user Current user + * @return array the bookmark parameters for the current user + * @access public + */ + public static function getParams($user) + { + static $cfgBookmark = null; + + if (null !== $cfgBookmark) { + return $cfgBookmark; + } + + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + if ($cfgRelation['bookmarkwork']) { + $cfgBookmark = array( + 'user' => $user, + 'db' => $cfgRelation['db'], + 'table' => $cfgRelation['bookmark'], + ); + } else { + $cfgBookmark = false; + } + + return $cfgBookmark; + } + + /** + * Creates a Bookmark object from the parameters + * + * @param DatabaseInterface $dbi DatabaseInterface object + * @param string $user Current user + * @param array $bkm_fields the properties of the bookmark to add; here, + * $bkm_fields['bkm_sql_query'] is urlencoded + * @param boolean $all_users whether to make the bookmark + * available for all users + * + * @return Bookmark|false + */ + public static function createBookmark( + DatabaseInterface $dbi, + $user, + array $bkm_fields, + $all_users = false + ) { + if (!(isset($bkm_fields['bkm_sql_query']) + && strlen($bkm_fields['bkm_sql_query']) > 0 + && isset($bkm_fields['bkm_label']) + && strlen($bkm_fields['bkm_label']) > 0) + ) { + return false; + } + + $bookmark = new Bookmark($dbi, $user); + $bookmark->_database = $bkm_fields['bkm_database']; + $bookmark->_label = $bkm_fields['bkm_label']; + $bookmark->_query = $bkm_fields['bkm_sql_query']; + $bookmark->_user = $all_users ? '' : $bkm_fields['bkm_user']; + + return $bookmark; + } + + /** + * Gets the list of bookmarks defined for the current database + * + * @param DatabaseInterface $dbi DatabaseInterface object + * @param string $user Current user + * @param string|bool $db the current database name or false + * + * @return Bookmark[] the bookmarks list + * + * @access public + */ + public static function getList(DatabaseInterface $dbi, $user, $db = false) + { + $cfgBookmark = self::getParams($user); + if (empty($cfgBookmark)) { + return array(); + } + + $query = "SELECT * FROM " . Util::backquote($cfgBookmark['db']) + . "." . Util::backquote($cfgBookmark['table']) + . " WHERE ( `user` = ''" + . " OR `user` = '" . $dbi->escapeString($cfgBookmark['user']) . "' )"; + if ($db !== false) { + $query .= " AND dbase = '" . $dbi->escapeString($db) . "'"; + } + $query .= " ORDER BY label ASC"; + + $result = $dbi->fetchResult( + $query, + null, + null, + DatabaseInterface::CONNECT_CONTROL, + DatabaseInterface::QUERY_STORE + ); + + if (! empty($result)) { + $bookmarks = array(); + foreach ($result as $row) { + $bookmark = new Bookmark($dbi, $user); + $bookmark->_id = $row['id']; + $bookmark->_database = $row['dbase']; + $bookmark->_user = $row['user']; + $bookmark->_label = $row['label']; + $bookmark->_query = $row['query']; + $bookmarks[] = $bookmark; + } + + return $bookmarks; + } + + return array(); + } + + /** + * Retrieve a specific bookmark + * + * @param DatabaseInterface $dbi DatabaseInterface object + * @param string $user Current user + * @param string $db the current database name + * @param mixed $id an identifier of the bookmark to get + * @param string $id_field which field to look up the identifier + * @param boolean $action_bookmark_all true: get all bookmarks regardless + * of the owning user + * @param boolean $exact_user_match whether to ignore bookmarks with no user + * + * @return Bookmark the bookmark + * + * @access public + * + */ + public static function get( + DatabaseInterface $dbi, + $user, + $db, + $id, + $id_field = 'id', + $action_bookmark_all = false, + $exact_user_match = false + ) { + $cfgBookmark = self::getParams($user); + if (empty($cfgBookmark)) { + return null; + } + + $query = "SELECT * FROM " . Util::backquote($cfgBookmark['db']) + . "." . Util::backquote($cfgBookmark['table']) + . " WHERE dbase = '" . $dbi->escapeString($db) . "'"; + if (! $action_bookmark_all) { + $query .= " AND (user = '" + . $dbi->escapeString($cfgBookmark['user']) . "'"; + if (! $exact_user_match) { + $query .= " OR user = ''"; + } + $query .= ")"; + } + $query .= " AND " . Util::backquote($id_field) + . " = '" . $dbi->escapeString($id) . "' LIMIT 1"; + + $result = $dbi->fetchSingleRow($query, 'ASSOC', DatabaseInterface::CONNECT_CONTROL); + if (! empty($result)) { + $bookmark = new Bookmark($dbi, $user); + $bookmark->_id = $result['id']; + $bookmark->_database = $result['dbase']; + $bookmark->_user = $result['user']; + $bookmark->_label = $result['label']; + $bookmark->_query = $result['query']; + return $bookmark; + } + + return null; + } +} diff --git a/phpMyAdmin/libraries/classes/BrowseForeigners.php b/phpMyAdmin/libraries/classes/BrowseForeigners.php new file mode 100755 index 0000000..97a9e18 --- /dev/null +++ b/phpMyAdmin/libraries/classes/BrowseForeigners.php @@ -0,0 +1,346 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Contains functions used by browse_foreigners.php + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * PhpMyAdmin\BrowseForeigners class + * + * @package PhpMyAdmin + */ +class BrowseForeigners +{ + private $limitChars; + private $maxRows; + private $repeatCells; + private $showAll; + private $themeImage; + + /** + * Constructor + * + * @param int $limitChars Maximum number of characters to show + * @param int $maxRows Number of rows to display + * @param int $repeatCells Repeat the headers every X cells, or 0 to deactivate + * @param boolean $showAll Shows the 'Show all' button or not + * @param string $themeImage Theme image path + */ + public function __construct( + $limitChars, + $maxRows, + $repeatCells, + $showAll, + $themeImage + ) { + $this->limitChars = (int) $limitChars; + $this->maxRows = (int) $maxRows; + $this->repeatCells = (int) $repeatCells; + $this->showAll = (bool) $showAll; + $this->themeImage = $themeImage; + } + + /** + * Function to get html for one relational key + * + * @param integer $horizontal_count the current horizontal count + * @param string $header table header + * @param array $keys all the keys + * @param integer $indexByKeyname index by keyname + * @param array $descriptions descriptions + * @param integer $indexByDescription index by description + * @param string $current_value current value on the edit form + * + * @return string $html the generated html + */ + private function getHtmlForOneKey( + $horizontal_count, + $header, + array $keys, + $indexByKeyname, + array $descriptions, + $indexByDescription, + $current_value + ) { + $horizontal_count++; + $output = ''; + + // whether the key name corresponds to the selected value in the form + $rightKeynameIsSelected = false; + $leftKeynameIsSelected = false; + + if ($this->repeatCells > 0 && $horizontal_count > $this->repeatCells) { + $output .= $header; + $horizontal_count = 0; + } + + // key names and descriptions for the left section, + // sorted by key names + $leftKeyname = $keys[$indexByKeyname]; + list( + $leftDescription, + $leftDescriptionTitle + ) = $this->getDescriptionAndTitle($descriptions[$indexByKeyname]); + + // key names and descriptions for the right section, + // sorted by descriptions + $rightKeyname = $keys[$indexByDescription]; + list( + $rightDescription, + $rightDescriptionTitle + ) = $this->getDescriptionAndTitle($descriptions[$indexByDescription]); + + $indexByDescription++; + + if (! empty($current_value)) { + $rightKeynameIsSelected = $rightKeyname == $current_value; + $leftKeynameIsSelected = $leftKeyname == $current_value; + } + + $output .= '<tr class="noclick">'; + + $output .= Template::get('table/browse_foreigners/column_element')->render([ + 'keyname' => $leftKeyname, + 'description' => $leftDescription, + 'title' => $leftDescriptionTitle, + 'is_selected' => $leftKeynameIsSelected, + 'nowrap' => true, + ]); + $output .= Template::get('table/browse_foreigners/column_element')->render([ + 'keyname' => $leftKeyname, + 'description' => $leftDescription, + 'title' => $leftDescriptionTitle, + 'is_selected' => $leftKeynameIsSelected, + 'nowrap' => false, + ]); + + $output .= '<td width="20%">' + . '<img src="' . $this->themeImage . 'spacer.png" alt=""' + . ' width="1" height="1" /></td>'; + + $output .= Template::get('table/browse_foreigners/column_element')->render([ + 'keyname' => $rightKeyname, + 'description' => $rightDescription, + 'title' => $rightDescriptionTitle, + 'is_selected' => $rightKeynameIsSelected, + 'nowrap' => false, + ]); + $output .= Template::get('table/browse_foreigners/column_element')->render([ + 'keyname' => $rightKeyname, + 'description' => $rightDescription, + 'title' => $rightDescriptionTitle, + 'is_selected' => $rightKeynameIsSelected, + 'nowrap' => true, + ]); + + $output .= '</tr>'; + + return array($output, $horizontal_count, $indexByDescription); + } + + /** + * Function to get html for relational field selection + * + * @param string $db current database + * @param string $table current table + * @param string $field field + * @param array $foreignData foreign column data + * @param string $fieldkey field key + * @param string $current_value current columns's value + * + * @return string + */ + public function getHtmlForRelationalFieldSelection( + $db, + $table, + $field, + array $foreignData, + $fieldkey, + $current_value + ) { + $gotopage = $this->getHtmlForGotoPage($foreignData); + $foreignShowAll = Template::get('table/browse_foreigners/show_all')->render([ + 'foreign_data' => $foreignData, + 'show_all' => $this->showAll, + 'max_rows' => $this->maxRows, + ]); + + $output = '<form class="ajax" ' + . 'id="browse_foreign_form" name="browse_foreign_from" ' + . 'action="browse_foreigners.php" method="post">' + . '<fieldset>' + . Url::getHiddenInputs($db, $table) + . '<input type="hidden" name="field" value="' . htmlspecialchars($field) + . '" />' + . '<input type="hidden" name="fieldkey" value="' + . (isset($fieldkey) ? htmlspecialchars($fieldkey) : '') . '" />'; + + if (isset($_POST['rownumber'])) { + $output .= '<input type="hidden" name="rownumber" value="' + . htmlspecialchars($_POST['rownumber']) . '" />'; + } + $filter_value = (isset($_POST['foreign_filter']) + ? htmlspecialchars($_POST['foreign_filter']) + : ''); + $output .= '<span class="formelement">' + . '<label for="input_foreign_filter">' . __('Search:') . '</label>' + . '<input type="text" name="foreign_filter" ' + . 'id="input_foreign_filter" ' + . 'value="' . $filter_value . '" data-old="' . $filter_value . '" ' + . '/>' + . '<input type="submit" name="submit_foreign_filter" value="' + . __('Go') . '" />' + . '</span>' + . '<span class="formelement">' . $gotopage . '</span>' + . '<span class="formelement">' . $foreignShowAll . '</span>' + . '</fieldset>' + . '</form>'; + + $output .= '<table width="100%" id="browse_foreign_table">'; + + if (!is_array($foreignData['disp_row'])) { + $output .= '</tbody>' + . '</table>'; + + return $output; + } + + $header = '<tr> + <th>' . __('Keyname') . '</th> + <th>' . __('Description') . '</th> + <td width="20%"></td> + <th>' . __('Description') . '</th> + <th>' . __('Keyname') . '</th> + </tr>'; + + $output .= '<thead>' . $header . '</thead>' . "\n" + . '<tfoot>' . $header . '</tfoot>' . "\n" + . '<tbody>' . "\n"; + + $descriptions = array(); + $keys = array(); + foreach ($foreignData['disp_row'] as $relrow) { + if ($foreignData['foreign_display'] != false) { + $descriptions[] = $relrow[$foreignData['foreign_display']]; + } else { + $descriptions[] = ''; + } + + $keys[] = $relrow[$foreignData['foreign_field']]; + } + + asort($keys); + + $horizontal_count = 0; + $indexByDescription = 0; + + foreach ($keys as $indexByKeyname => $value) { + list( + $html, + $horizontal_count, + $indexByDescription + ) = $this->getHtmlForOneKey( + $horizontal_count, + $header, + $keys, + $indexByKeyname, + $descriptions, + $indexByDescription, + $current_value + ); + $output .= $html; + } + + $output .= '</tbody>' + . '</table>'; + + return $output; + } + + /** + * Get the description (possibly truncated) and the title + * + * @param string $description the key name's description + * + * @return array the new description and title + */ + private function getDescriptionAndTitle($description) + { + if (mb_strlen($description) <= $this->limitChars) { + $description = htmlspecialchars( + $description + ); + $descriptionTitle = ''; + } else { + $descriptionTitle = htmlspecialchars( + $description + ); + $description = htmlspecialchars( + mb_substr( + $description, 0, $this->limitChars + ) + . '...' + ); + } + return array($description, $descriptionTitle); + } + + /** + * Function to get html for the goto page option + * + * @param array|null $foreignData foreign data + * + * @return string + */ + private function getHtmlForGotoPage($foreignData) + { + $gotopage = ''; + isset($_POST['pos']) ? $pos = $_POST['pos'] : $pos = 0; + if ($foreignData === null || ! is_array($foreignData['disp_row'])) { + return $gotopage; + } + + $pageNow = @floor($pos / $this->maxRows) + 1; + $nbTotalPage = @ceil($foreignData['the_total'] / $this->maxRows); + + if ($foreignData['the_total'] > $this->maxRows) { + $gotopage = Util::pageselector( + 'pos', + $this->maxRows, + $pageNow, + $nbTotalPage, + 200, + 5, + 5, + 20, + 10, + __('Page number:') + ); + } + + return $gotopage; + } + + /** + * Function to get foreign limit + * + * @param string $foreignShowAll foreign navigation + * + * @return string + */ + public function getForeignLimit($foreignShowAll) + { + if (isset($foreignShowAll) && $foreignShowAll == __('Show all')) { + return null; + } + isset($_POST['pos']) ? $pos = $_POST['pos'] : $pos = 0; + return 'LIMIT ' . $pos . ', ' . $this->maxRows . ' '; + } +} diff --git a/phpMyAdmin/libraries/classes/CentralColumns.php b/phpMyAdmin/libraries/classes/CentralColumns.php new file mode 100755 index 0000000..7379cee --- /dev/null +++ b/phpMyAdmin/libraries/classes/CentralColumns.php @@ -0,0 +1,1453 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Functions for displaying user preferences pages + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\Charsets; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Message; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * PhpMyAdmin\CentralColumns class + * + * @package PhpMyAdmin + */ +class CentralColumns +{ + /** + * DatabaseInterface instance + * + * @var DatabaseInterface + */ + private $dbi; + + /** + * Current user + * + * @var string + */ + private $user; + + /** + * Number of rows displayed when browsing a result set + * + * @var int + */ + private $maxRows; + + /** + * Which editor should be used for CHAR/VARCHAR fields + * + * @var string + */ + private $charEditing; + + /** + * Disable use of INFORMATION_SCHEMA + * + * @var boolean + */ + private $disableIs; + + /** + * @var Relation + */ + private $relation; + + /** + * Constructor + * + * @param DatabaseInterface $dbi DatabaseInterface instance + */ + public function __construct(DatabaseInterface $dbi) + { + $this->dbi = $dbi; + + $this->user = $GLOBALS['cfg']['Server']['user']; + $this->maxRows = (int) $GLOBALS['cfg']['MaxRows']; + $this->charEditing = $GLOBALS['cfg']['CharEditing']; + $this->disableIs = (bool) $GLOBALS['cfg']['Server']['DisableIS']; + + $this->relation = new Relation(); + } + + /** + * Defines the central_columns parameters for the current user + * + * @return array the central_columns parameters for the current user + * @access public + */ + public function getParams() + { + static $cfgCentralColumns = null; + + if (null !== $cfgCentralColumns) { + return $cfgCentralColumns; + } + + $cfgRelation = $this->relation->getRelationsParam(); + + if ($cfgRelation['centralcolumnswork']) { + $cfgCentralColumns = array( + 'user' => $this->user, + 'db' => $cfgRelation['db'], + 'table' => $cfgRelation['central_columns'], + ); + } else { + $cfgCentralColumns = false; + } + + return $cfgCentralColumns; + } + + /** + * get $num columns of given database from central columns list + * starting at offset $from + * + * @param string $db selected database + * @param int $from starting offset of first result + * @param int $num maximum number of results to return + * + * @return array list of $num columns present in central columns list + * starting at offset $from for the given database + */ + public function getColumnsList($db, $from = 0, $num = 25) + { + $cfgCentralColumns = $this->getParams(); + if (empty($cfgCentralColumns)) { + return array(); + } + $pmadb = $cfgCentralColumns['db']; + $this->dbi->selectDb($pmadb, DatabaseInterface::CONNECT_CONTROL); + $central_list_table = $cfgCentralColumns['table']; + //get current values of $db from central column list + if ($num == 0) { + $query = 'SELECT * FROM ' . Util::backquote($central_list_table) . ' ' + . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\';'; + } else { + $query = 'SELECT * FROM ' . Util::backquote($central_list_table) . ' ' + . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\' ' + . 'LIMIT ' . $from . ', ' . $num . ';'; + } + $has_list = (array) $this->dbi->fetchResult( + $query, null, null, DatabaseInterface::CONNECT_CONTROL + ); + $this->handleColumnExtra($has_list); + return $has_list; + } + + /** + * Get the number of columns present in central list for given db + * + * @param string $db current database + * + * @return int number of columns in central list of columns for $db + */ + public function getCount($db) + { + $cfgCentralColumns = $this->getParams(); + if (empty($cfgCentralColumns)) { + return 0; + } + $pmadb = $cfgCentralColumns['db']; + $this->dbi->selectDb($pmadb, DatabaseInterface::CONNECT_CONTROL); + $central_list_table = $cfgCentralColumns['table']; + $query = 'SELECT count(db_name) FROM ' . + Util::backquote($central_list_table) . ' ' + . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\';'; + $res = $this->dbi->fetchResult( + $query, null, null, DatabaseInterface::CONNECT_CONTROL + ); + if (isset($res[0])) { + return $res[0]; + } + + return 0; + } + + /** + * return the existing columns in central list among the given list of columns + * + * @param string $db the selected database + * @param string $cols comma separated list of given columns + * @param boolean $allFields set if need all the fields of existing columns, + * otherwise only column_name is returned + * + * @return array list of columns in central columns among given set of columns + */ + private function findExistingColNames( + $db, + $cols, + $allFields = false + ) { + $cfgCentralColumns = $this->getParams(); + if (empty($cfgCentralColumns)) { + return array(); + } + $pmadb = $cfgCentralColumns['db']; + $this->dbi->selectDb($pmadb, DatabaseInterface::CONNECT_CONTROL); + $central_list_table = $cfgCentralColumns['table']; + if ($allFields) { + $query = 'SELECT * FROM ' . Util::backquote($central_list_table) . ' ' + . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\' AND col_name IN (' . $cols . ');'; + $has_list = (array) $this->dbi->fetchResult( + $query, null, null, DatabaseInterface::CONNECT_CONTROL + ); + $this->handleColumnExtra($has_list); + } else { + $query = 'SELECT col_name FROM ' + . Util::backquote($central_list_table) . ' ' + . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\' AND col_name IN (' . $cols . ');'; + $has_list = (array) $this->dbi->fetchResult( + $query, null, null, DatabaseInterface::CONNECT_CONTROL + ); + } + + return $has_list; + } + + /** + * return error message to be displayed if central columns + * configuration storage is not completely configured + * + * @return Message + */ + private function configErrorMessage() + { + return Message::error( + __( + 'The configuration storage is not ready for the central list' + . ' of columns feature.' + ) + ); + } + + /** + * build the insert query for central columns list given PMA storage + * db, central_columns table, column name and corresponding definition to be added + * + * @param string $column column to add into central list + * @param array $def list of attributes of the column being added + * @param string $db PMA configuration storage database name + * @param string $central_list_table central columns configuration storage table name + * + * @return string query string to insert the given column + * with definition into central list + */ + private function getInsertQuery( + $column, + array $def, + $db, + $central_list_table + ) { + $type = ""; + $length = 0; + $attribute = ""; + if (isset($def['Type'])) { + $extracted_columnspec = Util::extractColumnSpec($def['Type']); + $attribute = trim($extracted_columnspec[ 'attribute']); + $type = $extracted_columnspec['type']; + $length = $extracted_columnspec['spec_in_brackets']; + } + if (isset($def['Attribute'])) { + $attribute = $def['Attribute']; + }; + $collation = isset($def['Collation'])?$def['Collation']:""; + $isNull = ($def['Null'] == "NO")?0:1; + $extra = isset($def['Extra'])?$def['Extra']:""; + $default = isset($def['Default'])?$def['Default']:""; + $insQuery = 'INSERT INTO ' + . Util::backquote($central_list_table) . ' ' + . 'VALUES ( \'' . $this->dbi->escapeString($db) . '\' ,' + . '\'' . $this->dbi->escapeString($column) . '\',\'' + . $this->dbi->escapeString($type) . '\',' + . '\'' . $this->dbi->escapeString($length) . '\',\'' + . $this->dbi->escapeString($collation) . '\',' + . '\'' . $this->dbi->escapeString($isNull) . '\',' + . '\'' . implode(',', array($extra, $attribute)) + . '\',\'' . $this->dbi->escapeString($default) . '\');'; + return $insQuery; + } + + /** + * If $isTable is true then unique columns from given tables as $field_select + * are added to central list otherwise the $field_select is considered as + * list of columns and these columns are added to central list if not already added + * + * @param array $field_select if $isTable is true selected tables list + * otherwise selected columns list + * @param bool $isTable if passed array is of tables or columns + * @param string $table if $isTable is false, then table name to + * which columns belong + * + * @return true|PhpMyAdmin\Message + */ + public function syncUniqueColumns( + array $field_select, + $isTable = true, + $table = null + ) { + $cfgCentralColumns = $this->getParams(); + if (empty($cfgCentralColumns)) { + return $this->configErrorMessage(); + } + $db = $_POST['db']; + $pmadb = $cfgCentralColumns['db']; + $central_list_table = $cfgCentralColumns['table']; + $this->dbi->selectDb($db); + $existingCols = array(); + $cols = ""; + $insQuery = array(); + $fields = array(); + $message = true; + if ($isTable) { + foreach ($field_select as $table) { + $fields[$table] = (array) $this->dbi->getColumns( + $db, $table, null, true + ); + foreach ($fields[$table] as $field => $def) { + $cols .= "'" . $this->dbi->escapeString($field) . "',"; + } + } + + $has_list = $this->findExistingColNames($db, trim($cols, ',')); + foreach ($field_select as $table) { + foreach ($fields[$table] as $field => $def) { + if (!in_array($field, $has_list)) { + $has_list[] = $field; + $insQuery[] = $this->getInsertQuery( + $field, $def, $db, $central_list_table + ); + } else { + $existingCols[] = "'" . $field . "'"; + } + } + } + } else { + if ($table === null) { + $table = $_POST['table']; + } + foreach ($field_select as $column) { + $cols .= "'" . $this->dbi->escapeString($column) . "',"; + } + $has_list = $this->findExistingColNames($db, trim($cols, ',')); + foreach ($field_select as $column) { + if (!in_array($column, $has_list)) { + $has_list[] = $column; + $field = (array) $this->dbi->getColumns( + $db, $table, $column, + true + ); + $insQuery[] = $this->getInsertQuery( + $column, $field, $db, $central_list_table + ); + } else { + $existingCols[] = "'" . $column . "'"; + } + } + } + if (! empty($existingCols)) { + $existingCols = implode(",", array_unique($existingCols)); + $message = Message::notice( + sprintf( + __( + 'Could not add %1$s as they already exist in central list!' + ), htmlspecialchars($existingCols) + ) + ); + $message->addMessage( + Message::notice( + "Please remove them first " + . "from central list if you want to update above columns" + ) + ); + } + $this->dbi->selectDb($pmadb, DatabaseInterface::CONNECT_CONTROL); + if (! empty($insQuery)) { + foreach ($insQuery as $query) { + if (!$this->dbi->tryQuery($query, DatabaseInterface::CONNECT_CONTROL)) { + $message = Message::error(__('Could not add columns!')); + $message->addMessage( + Message::rawError( + $this->dbi->getError(DatabaseInterface::CONNECT_CONTROL) + ) + ); + break; + } + } + } + return $message; + } + + /** + * if $isTable is true it removes all columns of given tables as $field_select from + * central columns list otherwise $field_select is columns list and it removes + * given columns if present in central list + * + * @param array $field_select if $isTable selected list of tables otherwise + * selected list of columns to remove from central list + * @param bool $isTable if passed array is of tables or columns + * + * @return true|PhpMyAdmin\Message + */ + public function deleteColumnsFromList( + array $field_select, + $isTable = true + ) { + $cfgCentralColumns = $this->getParams(); + if (empty($cfgCentralColumns)) { + return $this->configErrorMessage(); + } + $db = $_POST['db']; + $pmadb = $cfgCentralColumns['db']; + $central_list_table = $cfgCentralColumns['table']; + $this->dbi->selectDb($db); + $message = true; + $colNotExist = array(); + $fields = array(); + if ($isTable) { + $cols = ''; + foreach ($field_select as $table) { + $fields[$table] = (array) $this->dbi->getColumnNames( + $db, $table + ); + foreach ($fields[$table] as $col_select) { + $cols .= '\'' . $this->dbi->escapeString($col_select) . '\','; + } + } + $cols = trim($cols, ','); + $has_list = $this->findExistingColNames($db, $cols); + foreach ($field_select as $table) { + foreach ($fields[$table] as $column) { + if (!in_array($column, $has_list)) { + $colNotExist[] = "'" . $column . "'"; + } + } + } + + } else { + $cols = ''; + foreach ($field_select as $col_select) { + $cols .= '\'' . $this->dbi->escapeString($col_select) . '\','; + } + $cols = trim($cols, ','); + $has_list = $this->findExistingColNames($db, $cols); + foreach ($field_select as $column) { + if (!in_array($column, $has_list)) { + $colNotExist[] = "'" . $column . "'"; + } + } + } + if (!empty($colNotExist)) { + $colNotExist = implode(",", array_unique($colNotExist)); + $message = Message::notice( + sprintf( + __( + 'Couldn\'t remove Column(s) %1$s ' + . 'as they don\'t exist in central columns list!' + ), htmlspecialchars($colNotExist) + ) + ); + } + $this->dbi->selectDb($pmadb, DatabaseInterface::CONNECT_CONTROL); + + $query = 'DELETE FROM ' . Util::backquote($central_list_table) . ' ' + . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\' AND col_name IN (' . $cols . ');'; + + if (!$this->dbi->tryQuery($query, DatabaseInterface::CONNECT_CONTROL)) { + $message = Message::error(__('Could not remove columns!')); + $message->addHtml('<br />' . htmlspecialchars($cols) . '<br />'); + $message->addMessage( + Message::rawError( + $this->dbi->getError(DatabaseInterface::CONNECT_CONTROL) + ) + ); + } + return $message; + } + + /** + * Make the columns of given tables consistent with central list of columns. + * Updates only those columns which are not being referenced. + * + * @param string $db current database + * @param array $selected_tables list of selected tables. + * + * @return true|PhpMyAdmin\Message + */ + public function makeConsistentWithList( + $db, + array $selected_tables + ) { + $message = true; + foreach ($selected_tables as $table) { + $query = 'ALTER TABLE ' . Util::backquote($table); + $has_list = $this->getFromTable($db, $table, true); + $this->dbi->selectDb($db); + foreach ($has_list as $column) { + $column_status = $this->relation->checkChildForeignReferences( + $db, $table, $column['col_name'] + ); + //column definition can only be changed if + //it is not referenced by another column + if ($column_status['isEditable']) { + $query .= ' MODIFY ' . Util::backquote($column['col_name']) . ' ' + . $this->dbi->escapeString($column['col_type']); + if ($column['col_length']) { + $query .= '(' . $column['col_length'] . ')'; + } + + $query .= ' ' . $column['col_attribute']; + if ($column['col_isNull']) { + $query .= ' NULL'; + } else { + $query .= ' NOT NULL'; + } + + $query .= ' ' . $column['col_extra']; + if ($column['col_default']) { + if ($column['col_default'] != 'CURRENT_TIMESTAMP' + || $column['col_default'] != 'current_timestamp()') { + $query .= ' DEFAULT \'' . $this->dbi->escapeString( + $column['col_default'] + ) . '\''; + } else { + $query .= ' DEFAULT ' . $this->dbi->escapeString( + $column['col_default'] + ); + } + } + $query .= ','; + } + } + $query = trim($query, " ,") . ";"; + if (!$this->dbi->tryQuery($query)) { + if ($message === true) { + $message = Message::error( + $this->dbi->getError() + ); + } else { + $message->addText( + $this->dbi->getError(), + '<br />' + ); + } + } + } + return $message; + } + + /** + * return the columns present in central list of columns for a given + * table of a given database + * + * @param string $db given database + * @param string $table given table + * @param boolean $allFields set if need all the fields of existing columns, + * otherwise only column_name is returned + * + * @return array columns present in central list from given table of given db. + */ + public function getFromTable( + $db, + $table, + $allFields = false + ) { + $cfgCentralColumns = $this->getParams(); + if (empty($cfgCentralColumns)) { + return array(); + } + $this->dbi->selectDb($db); + $fields = (array) $this->dbi->getColumnNames( + $db, $table + ); + $cols = ''; + foreach ($fields as $col_select) { + $cols .= '\'' . $this->dbi->escapeString($col_select) . '\','; + } + $cols = trim($cols, ','); + $has_list = $this->findExistingColNames($db, $cols, $allFields); + if (! empty($has_list)) { + return (array)$has_list; + } + + return array(); + } + + /** + * update a column in central columns list if a edit is requested + * + * @param string $db current database + * @param string $orig_col_name original column name before edit + * @param string $col_name new column name + * @param string $col_type new column type + * @param string $col_attribute new column attribute + * @param string $col_length new column length + * @param int $col_isNull value 1 if new column isNull is true, 0 otherwise + * @param string $collation new column collation + * @param string $col_extra new column extra property + * @param string $col_default new column default value + * + * @return true|PhpMyAdmin\Message + */ + public function updateOneColumn( + $db, + $orig_col_name, + $col_name, + $col_type, + $col_attribute, + $col_length, + $col_isNull, + $collation, + $col_extra, + $col_default + ) { + $cfgCentralColumns = $this->getParams(); + if (empty($cfgCentralColumns)) { + return $this->configErrorMessage(); + } + $centralTable = $cfgCentralColumns['table']; + $this->dbi->selectDb($cfgCentralColumns['db'], DatabaseInterface::CONNECT_CONTROL); + if ($orig_col_name == "") { + $def = array(); + $def['Type'] = $col_type; + if ($col_length) { + $def['Type'] .= '(' . $col_length . ')'; + } + $def['Collation'] = $collation; + $def['Null'] = $col_isNull?__('YES'):__('NO'); + $def['Extra'] = $col_extra; + $def['Attribute'] = $col_attribute; + $def['Default'] = $col_default; + $query = $this->getInsertQuery($col_name, $def, $db, $centralTable); + } else { + $query = 'UPDATE ' . Util::backquote($centralTable) + . ' SET col_type = \'' . $this->dbi->escapeString($col_type) . '\'' + . ', col_name = \'' . $this->dbi->escapeString($col_name) . '\'' + . ', col_length = \'' . $this->dbi->escapeString($col_length) . '\'' + . ', col_isNull = ' . $col_isNull + . ', col_collation = \'' . $this->dbi->escapeString($collation) . '\'' + . ', col_extra = \'' + . implode(',', array($col_extra, $col_attribute)) . '\'' + . ', col_default = \'' . $this->dbi->escapeString($col_default) . '\'' + . ' WHERE db_name = \'' . $this->dbi->escapeString($db) . '\' ' + . 'AND col_name = \'' . $this->dbi->escapeString($orig_col_name) + . '\''; + } + if (!$this->dbi->tryQuery($query, DatabaseInterface::CONNECT_CONTROL)) { + return Message::error( + $this->dbi->getError(DatabaseInterface::CONNECT_CONTROL) + ); + } + return true; + } + + /** + * Update Multiple column in central columns list if a chnage is requested + * + * @return true|PhpMyAdmin\Message + */ + public function updateMultipleColumn() + { + $db = $_POST['db']; + $col_name = $_POST['field_name']; + $orig_col_name = $_POST['orig_col_name']; + $col_default = $_POST['field_default_type']; + $col_length = $_POST['field_length']; + $col_attribute = $_POST['field_attribute']; + $col_type = $_POST['field_type']; + $collation = $_POST['field_collation']; + $col_isNull = array(); + $col_extra = array(); + $num_central_fields = count($orig_col_name); + for ($i = 0; $i < $num_central_fields ; $i++) { + $col_isNull[$i] = isset($_POST['field_null'][$i]) ? 1 : 0; + $col_extra[$i] = isset($_POST['col_extra'][$i]) + ? $_POST['col_extra'][$i] : ''; + + if ($col_default[$i] == 'NONE') { + $col_default[$i] = ""; + } elseif ($col_default[$i] == 'USER_DEFINED') { + $col_default[$i] = $_POST['field_default_value'][$i]; + } + + $message = $this->updateOneColumn( + $db, $orig_col_name[$i], $col_name[$i], $col_type[$i], + $col_attribute[$i], $col_length[$i], $col_isNull[$i], $collation[$i], + $col_extra[$i], $col_default[$i] + ); + if (!is_bool($message)) { + return $message; + } + } + return true; + } + + /** + * get the html for table navigation in Central columns page + * + * @param int $total_rows total number of rows in complete result set + * @param int $pos offset of first result with complete result set + * @param string $db current database + * + * @return string html for table navigation in Central columns page + */ + public function getHtmlForTableNavigation($total_rows, $pos, $db) + { + $pageNow = ($pos / $this->maxRows) + 1; + $nbTotalPage = ceil($total_rows / $this->maxRows); + $page_selector = ($nbTotalPage > 1)?(Util::pageselector( + 'pos', $this->maxRows, $pageNow, $nbTotalPage + )):''; + return Template::get('database/central_columns/table_navigation')->render(array( + "pos" => $pos, + "max_rows" => $this->maxRows, + "db" => $db, + "total_rows" => $total_rows, + "nb_total_page" => $nbTotalPage, + "page_selector" => $page_selector, + )); + } + + /** + * function generate and return the table header for central columns page + * + * @param string $class styling class of 'th' elements + * @param string $title title of the 'th' elements + * @param integer $actionCount number of actions + * + * @return string html for table header in central columns view/edit page + */ + public function getTableHeader($class = '', $title = '', $actionCount = 0) + { + $action = ''; + if ($actionCount > 0) { + $action .= '<th class="column_action" colspan="' . $actionCount . '">' + . __('Action') . '</th>'; + } + $tableheader = '<thead>'; + $tableheader .= '<tr>' + . '<th class="' . $class . '"></th>' + . '<th class="hide"></th>' + . $action + . '<th class="' . $class . '" title="' . $title . '" data-column="name">' + . __('Name') . '<div class="sorticon"></div></th>' + . '<th class="' . $class . '" title="' . $title . '" data-column="type">' + . __('Type') . '<div class="sorticon"></div></th>' + . '<th class="' . $class . '" title="' . $title . '" data-column="length">' + . __('Length/Values') . '<div class="sorticon"></div></th>' + . '<th class="' . $class . '" title="' . $title . '" data-column="default">' + . __('Default') . '<div class="sorticon"></div></th>' + . '<th class="' . $class . '" title="' . $title . '" data-column="collation"' + . '>' . __('Collation') . '<div class="sorticon"></div></th>' + . '<th class="' . $class . '" title="' . $title + . '" data-column="attribute">' + . __('Attribute') . '<div class="sorticon"></div></th>' + . '<th class="' . $class . '" title="' . $title . '" data-column="isnull">' + . __('Null') . '<div class="sorticon"></div></th>' + . '<th class="' . $class . '" title="' . $title . '" data-column="extra">' + . __('A_I') . '<div class="sorticon"></div></th>' + . '</tr>'; + $tableheader .= '</thead>'; + return $tableheader; + } + + /** + * Function generate and return the table header for + * multiple edit central columns page + * + * @param array $headers headers list + * + * @return string html for table header in central columns multi edit page + */ + private function getEditTableHeader(array $headers) + { + return Template::get( + 'database/central_columns/edit_table_header' + )->render([ + 'headers' => $headers, + ]); + } + + /** + * build the dropdown select html for tables of given database + * + * @param string $db current database + * + * @return string html dropdown for selecting table + */ + private function getHtmlForTableDropdown($db) + { + $this->dbi->selectDb($db); + $tables = $this->dbi->getTables($db); + $selectHtml = '<select name="table-select" id="table-select">' + . '<option value="" disabled="disabled" selected="selected">' + . __('Select a table') . '</option>'; + foreach ($tables as $table) { + $selectHtml .= '<option value="' . htmlspecialchars($table) . '">' + . htmlspecialchars($table) . '</option>'; + } + $selectHtml .= '</select>'; + return $selectHtml; + } + + /** + * build dropdown select html to select column in selected table, + * include only columns which are not already in central list + * + * @param string $db current database to which selected table belongs + * @param string $selected_tbl selected table + * + * @return string html to select column + */ + public function getHtmlForColumnDropdown($db, $selected_tbl) + { + $existing_cols = $this->getFromTable($db, $selected_tbl); + $this->dbi->selectDb($db); + $columns = (array) $this->dbi->getColumnNames( + $db, $selected_tbl + ); + $selectColHtml = ""; + foreach ($columns as $column) { + if (!in_array($column, $existing_cols)) { + $selectColHtml .= '<option value="' . htmlspecialchars($column) . '">' + . htmlspecialchars($column) + . '</option>'; + } + } + return $selectColHtml; + } + + /** + * HTML to display the form that let user to add a column on Central columns page + * + * @param int $total_rows total number of rows in complete result set + * @param int $pos offset of first result with complete result set + * @param string $db current database + * + * @return string html to add a column in the central list + */ + public function getHtmlForAddColumn( + $total_rows, + $pos, + $db + ) { + $icon = Util::getIcon( + 'centralColumns_add', + __('Add column') + ); + $table_drop_down = $this->getHtmlForTableDropdown($db); + return Template::get('database/central_columns/add_column')->render(array( + 'icon' => $icon, + 'pos' => $pos, + 'db' => $db, + 'total_rows' => $total_rows, + 'table_drop_down' => $table_drop_down, + )); + } + + /** + * build html for a row in central columns table + * + * @param array $row array contains complete information of a particular row of central list table + * @param int $row_num position the row in the table + * @param string $db current database + * + * @return string html of a particular row in the central columns table. + */ + public function getHtmlForTableRow(array $row, $row_num, $db) + { + $tableHtml = '<tr data-rownum="' . $row_num . '" id="f_' . $row_num . '">' + . Url::getHiddenInputs( + $db + ) + . '<input type="hidden" name="edit_save" value="save">' + . '<td class="nowrap">' + . '<input type="checkbox" class="checkall" name="selected_fld[]" ' + . 'value="' . htmlspecialchars($row['col_name']) . '" ' + . 'id="checkbox_row_' . $row_num . '"/>' + . '</td>' + . '<td id="edit_' . $row_num . '" class="edit center">' + . '<a href="#">' . Util::getIcon('b_edit', __('Edit')) . '</a></td>' + . '<td class="del_row" data-rownum = "' . $row_num . '">' + . '<a hrf="#">' . Util::getIcon('b_drop', __('Delete')) . '</a>' + . '<input type="submit" data-rownum = "' . $row_num . '"' + . ' class="edit_cancel_form" value="Cancel"></td>' + . '<td id="save_' . $row_num . '" class="hide">' + . '<input type="submit" data-rownum = "' . $row_num . '"' + . ' class="edit_save_form" value="Save"></td>'; + + $tableHtml .= + '<td name="col_name" class="nowrap">' + . '<span>' . htmlspecialchars($row['col_name']) . '</span>' + . '<input name="orig_col_name" type="hidden" ' + . 'value="' . htmlspecialchars($row['col_name']) . '">' + . Template::get('columns_definitions/column_name')->render(array( + 'column_number' => $row_num, + 'ci' => 0, + 'ci_offset' => 0, + 'column_meta' => array( + 'Field'=>$row['col_name'] + ), + 'cfg_relation' => array( + 'centralcolumnswork' => false + ), + 'max_rows' => $this->maxRows, + )) + . '</td>'; + $tableHtml .= + '<td name = "col_type" class="nowrap"><span>' + . htmlspecialchars($row['col_type']) . '</span>' + . Template::get('columns_definitions/column_type') + ->render( + array( + 'column_number' => $row_num, + 'ci' => 1, + 'ci_offset' => 0, + 'type_upper' => mb_strtoupper($row['col_type']), + 'column_meta' => array() + ) + ) + . '</td>'; + $tableHtml .= + '<td class="nowrap" name="col_length">' + . '<span>' . ($row['col_length']?htmlspecialchars($row['col_length']):"") + . '</span>' + . Template::get('columns_definitions/column_length')->render( + array( + 'column_number' => $row_num, + 'ci' => 2, + 'ci_offset' => 0, + 'length_values_input_size' => 8, + 'length_to_display' => $row['col_length'] + ) + ) + . '</td>'; + + $meta = array(); + if (!isset($row['col_default']) || $row['col_default'] == '') { + $meta['DefaultType'] = 'NONE'; + } else { + if ($row['col_default'] == 'CURRENT_TIMESTAMP' + || $row['col_default'] == 'current_timestamp()' + ) { + $meta['DefaultType'] = 'CURRENT_TIMESTAMP'; + } elseif ($row['col_default'] == 'NULL') { + $meta['DefaultType'] = $row['col_default']; + } else { + $meta['DefaultType'] = 'USER_DEFINED'; + $meta['DefaultValue'] = $row['col_default']; + } + } + $tableHtml .= + '<td class="nowrap" name="col_default"><span>' . (isset($row['col_default']) + ? htmlspecialchars($row['col_default']) : 'None') + . '</span>' + . Template::get('columns_definitions/column_default') + ->render( + array( + 'column_number' => $row_num, + 'ci' => 3, + 'ci_offset' => 0, + 'type_upper' => mb_strtoupper($row['col_type']), + 'column_meta' => $meta, + 'char_editing' => $this->charEditing, + ) + ) + . '</td>'; + + $tableHtml .= + '<td name="collation" class="nowrap">' + . '<span>' . htmlspecialchars($row['col_collation']) . '</span>' + . Charsets::getCollationDropdownBox( + $this->dbi, + $this->disableIs, + 'field_collation[' . $row_num . ']', + 'field_' . $row_num . '_4', $row['col_collation'], false + ) + . '</td>'; + $tableHtml .= + '<td class="nowrap" name="col_attribute">' + . '<span>' . + ($row['col_attribute'] + ? htmlspecialchars($row['col_attribute']) : "" ) + . '</span>' + . Template::get('columns_definitions/column_attribute') + ->render( + array( + 'column_number' => $row_num, + 'ci' => 5, + 'ci_offset' => 0, + 'extracted_columnspec' => array(), + 'column_meta' => $row['col_attribute'], + 'submit_attribute' => false, + 'attribute_types' => $this->dbi->types->getAttributes(), + ) + ) + . '</td>'; + $tableHtml .= + '<td class="nowrap" name="col_isNull">' + . '<span>' . ($row['col_isNull'] ? __('Yes') : __('No')) + . '</span>' + . Template::get('columns_definitions/column_null') + ->render( + array( + 'column_number' => $row_num, + 'ci' => 6, + 'ci_offset' => 0, + 'column_meta' => array( + 'Null' => $row['col_isNull'] + ) + ) + ) + . '</td>'; + + $tableHtml .= + '<td class="nowrap" name="col_extra"><span>' + . htmlspecialchars($row['col_extra']) . '</span>' + . Template::get('columns_definitions/column_extra')->render( + array( + 'column_number' => $row_num, + 'ci' => 7, + 'ci_offset' => 0, + 'column_meta' => array('Extra'=>$row['col_extra']) + ) + ) + . '</td>'; + + $tableHtml .= '</tr>'; + + return $tableHtml; + } + + /** + * build html for editing a row in central columns table + * + * @param array $row array contains complete information of a + * particular row of central list table + * @param int $row_num position the row in the table + * + * @return string html of a particular row in the central columns table. + */ + private function getHtmlForEditTableRow(array $row, $row_num) + { + $tableHtml = '<tr>' + . '<input name="orig_col_name[' . $row_num . ']" type="hidden" ' + . 'value="' . htmlspecialchars($row['col_name']) . '">' + . '<td name="col_name" class="nowrap">' + . Template::get('columns_definitions/column_name')->render(array( + 'column_number' => $row_num, + 'ci' => 0, + 'ci_offset' => 0, + 'column_meta' => array( + 'Field' => $row['col_name'] + ), + 'cfg_relation' => array( + 'centralcolumnswork' => false + ), + 'max_rows' => $this->maxRows, + )) + . '</td>'; + $tableHtml .= + '<td name = "col_type" class="nowrap">' + . Template::get('columns_definitions/column_type') + ->render( + array( + 'column_number' => $row_num, + 'ci' => 1, + 'ci_offset' => 0, + 'type_upper' => mb_strtoupper($row['col_type']), + 'column_meta' => array() + ) + ) + . '</td>'; + $tableHtml .= + '<td class="nowrap" name="col_length">' + . Template::get('columns_definitions/column_length')->render( + array( + 'column_number' => $row_num, + 'ci' => 2, + 'ci_offset' => 0, + 'length_values_input_size' => 8, + 'length_to_display' => $row['col_length'] + ) + ) + . '</td>'; + $meta = array(); + if (!isset($row['col_default']) || $row['col_default'] == '') { + $meta['DefaultType'] = 'NONE'; + } else { + if ($row['col_default'] == 'CURRENT_TIMESTAMP' + || $row['col_default'] == 'current_timestamp()' + ) { + $meta['DefaultType'] = 'CURRENT_TIMESTAMP'; + } elseif ($row['col_default'] == 'NULL') { + $meta['DefaultType'] = $row['col_default']; + } else { + $meta['DefaultType'] = 'USER_DEFINED'; + $meta['DefaultValue'] = $row['col_default']; + } + } + $tableHtml .= + '<td class="nowrap" name="col_default">' + . Template::get('columns_definitions/column_default') + ->render( + array( + 'column_number' => $row_num, + 'ci' => 3, + 'ci_offset' => 0, + 'type_upper' => mb_strtoupper($row['col_default']), + 'column_meta' => $meta, + 'char_editing' => $this->charEditing, + ) + ) + . '</td>'; + $tableHtml .= + '<td name="collation" class="nowrap">' + . Charsets::getCollationDropdownBox( + $this->dbi, + $this->disableIs, + 'field_collation[' . $row_num . ']', + 'field_' . $row_num . '_4', $row['col_collation'], false + ) + . '</td>'; + $tableHtml .= + '<td class="nowrap" name="col_attribute">' + . Template::get('columns_definitions/column_attribute') + ->render( + array( + 'column_number' => $row_num, + 'ci' => 5, + 'ci_offset' => 0, + 'extracted_columnspec' => array( + 'attribute' => $row['col_attribute'] + ), + 'column_meta' => array(), + 'submit_attribute' => false, + 'attribute_types' => $this->dbi->types->getAttributes(), + ) + ) + . '</td>'; + $tableHtml .= + '<td class="nowrap" name="col_isNull">' + . Template::get('columns_definitions/column_null') + ->render( + array( + 'column_number' => $row_num, + 'ci' => 6, + 'ci_offset' => 0, + 'column_meta' => array( + 'Null' => $row['col_isNull'] + ) + ) + ) + . '</td>'; + + $tableHtml .= + '<td class="nowrap" name="col_extra">' + . Template::get('columns_definitions/column_extra')->render( + array( + 'column_number' => $row_num, + 'ci' => 7, + 'ci_offset' => 0, + 'column_meta' => array('Extra' => $row['col_extra']) + ) + ) + . '</td>'; + $tableHtml .= '</tr>'; + return $tableHtml; + } + + /** + * get the list of columns in given database excluding + * the columns present in current table + * + * @param string $db selected database + * @param string $table current table name + * + * @return string encoded list of columns present in central list for the given + * database + */ + public function getListRaw($db, $table) + { + $cfgCentralColumns = $this->getParams(); + if (empty($cfgCentralColumns)) { + return json_encode(array()); + } + $centralTable = $cfgCentralColumns['table']; + if (empty($table) || $table == '') { + $query = 'SELECT * FROM ' . Util::backquote($centralTable) . ' ' + . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\';'; + } else { + $this->dbi->selectDb($db); + $columns = (array) $this->dbi->getColumnNames( + $db, $table + ); + $cols = ''; + foreach ($columns as $col_select) { + $cols .= '\'' . $this->dbi->escapeString($col_select) . '\','; + } + $cols = trim($cols, ','); + $query = 'SELECT * FROM ' . Util::backquote($centralTable) . ' ' + . 'WHERE db_name = \'' . $this->dbi->escapeString($db) . '\''; + if ($cols) { + $query .= ' AND col_name NOT IN (' . $cols . ')'; + } + $query .= ';'; + } + $this->dbi->selectDb($cfgCentralColumns['db'], DatabaseInterface::CONNECT_CONTROL); + $columns_list = (array)$this->dbi->fetchResult( + $query, null, null, DatabaseInterface::CONNECT_CONTROL + ); + $this->handleColumnExtra($columns_list); + return json_encode($columns_list); + } + + /** + * Get HTML for "check all" check box with "with selected" dropdown + * + * @param string $pmaThemeImage pma theme image url + * @param string $text_dir url for text directory + * + * @return string $html_output + */ + public function getTableFooter($pmaThemeImage, $text_dir) + { + $html_output = Template::get('select_all') + ->render( + array( + 'pma_theme_image' => $pmaThemeImage, + 'text_dir' => $text_dir, + 'form_name' => 'tableslistcontainer', + ) + ); + $html_output .= Util::getButtonOrImage( + 'edit_central_columns', 'mult_submit change_central_columns', + __('Edit'), 'b_edit', 'edit central columns' + ); + $html_output .= Util::getButtonOrImage( + 'delete_central_columns', 'mult_submit', + __('Delete'), 'b_drop', + 'remove_from_central_columns' + ); + return $html_output; + } + + /** + * function generate and return the table footer for + * multiple edit central columns page + * + * @return string html for table footer in central columns multi edit page + */ + private function getEditTableFooter() + { + $html_output = '<fieldset class="tblFooters">' + . '<input type="submit" ' + . 'name="save_multi_central_column_edit" value="' . __('Save') . '" />' + . '</fieldset>'; + return $html_output; + } + + /** + * Column `col_extra` is used to store both extra and attributes for a column. + * This method separates them. + * + * @param array &$columns_list columns list + * + * @return void + */ + private function handleColumnExtra(array &$columns_list) + { + foreach ($columns_list as &$row) { + $vals = explode(',', $row['col_extra']); + + if (in_array('BINARY', $vals)) { + $row['col_attribute'] = 'BINARY'; + } elseif (in_array('UNSIGNED', $vals)) { + $row['col_attribute'] = 'UNSIGNED'; + } elseif (in_array('UNSIGNED ZEROFILL', $vals)) { + $row['col_attribute'] = 'UNSIGNED ZEROFILL'; + } elseif (in_array('on update CURRENT_TIMESTAMP', $vals)) { + $row['col_attribute'] = 'on update CURRENT_TIMESTAMP'; + } else { + $row['col_attribute'] = ''; + } + + if (in_array('auto_increment', $vals)) { + $row['col_extra'] = 'auto_increment'; + } else { + $row['col_extra'] = ''; + } + } + } + + /** + * build html for adding a new user defined column to central list + * + * @param string $db current database + * @param integer $total_rows number of rows in central columns + * + * @return string html of the form to let user add a new user defined column to the + * list + */ + public function getHtmlForAddNewColumn($db, $total_rows) + { + $addNewColumn = '<div id="add_col_div" class="topmargin"><a href="#">' + . '<span>+</span> ' . __('Add new column') . '</a>' + . '<form id="add_new" class="new_central_col ' + . ($total_rows != 0 ? 'hide"' : '"') + . 'method="post" action="db_central_columns.php">' + . Url::getHiddenInputs( + $db + ) + . '<input type="hidden" name="add_new_column" value="add_new_column">' + . '<div class="responsivetable">' + . '<table>'; + $addNewColumn .= $this->getTableHeader(); + $addNewColumn .= '<tr>' + . '<td></td>' + . '<td name="col_name" class="nowrap">' + . Template::get('columns_definitions/column_name')->render(array( + 'column_number' => 0, + 'ci' => 0, + 'ci_offset' => 0, + 'column_meta' => array(), + 'cfg_relation' => array( + 'centralcolumnswork' => false + ), + 'max_rows' => $this->maxRows, + )) + . '</td>' + . '<td name = "col_type" class="nowrap">' + . Template::get('columns_definitions/column_type') + ->render( + array( + 'column_number' => 0, + 'ci' => 1, + 'ci_offset' => 0, + 'type_upper' => '', + 'column_meta' => array() + ) + ) + . '</td>' + . '<td class="nowrap" name="col_length">' + . Template::get('columns_definitions/column_length')->render( + array( + 'column_number' => 0, + 'ci' => 2, + 'ci_offset' => 0, + 'length_values_input_size' => 8, + 'length_to_display' => '' + ) + ) + . '</td>' + . '<td class="nowrap" name="col_default">' + . Template::get('columns_definitions/column_default') + ->render( + array( + 'column_number' => 0, + 'ci' => 3, + 'ci_offset' => 0, + 'type_upper' => '', + 'column_meta' => array(), + 'char_editing' => $this->charEditing, + ) + ) + . '</td>' + . '<td name="collation" class="nowrap">' + . Charsets::getCollationDropdownBox( + $this->dbi, + $this->disableIs, + 'field_collation[0]', + 'field_0_4', null, false + ) + . '</td>' + . '<td class="nowrap" name="col_attribute">' + . Template::get('columns_definitions/column_attribute') + ->render( + array( + 'column_number' => 0, + 'ci' => 5, + 'ci_offset' => 0, + 'extracted_columnspec' => array(), + 'column_meta' => array(), + 'submit_attribute' => false, + 'attribute_types' => $this->dbi->types->getAttributes(), + ) + ) + . '</td>' + . '<td class="nowrap" name="col_isNull">' + . Template::get('columns_definitions/column_null') + ->render( + array( + 'column_number' => 0, + 'ci' => 6, + 'ci_offset' => 0, + 'column_meta' => array() + ) + ) + . '</td>' + . '<td class="nowrap" name="col_extra">' + . Template::get('columns_definitions/column_extra')->render( + array( + 'column_number' => 0, + 'ci' => 7, + 'ci_offset' => 0, + 'column_meta' => array() + ) + ) + . '</td>' + . ' <td>' + . '<input id="add_column_save" type="submit" ' + . ' value="Save"/></td>' + . '</tr>'; + $addNewColumn .= '</table></div></form></div>'; + return $addNewColumn; + } + + /** + * Get HTML for editing page central columns + * + * @param array $selected_fld Array containing the selected fields + * @param string $selected_db String containing the name of database + * + * @return string HTML for complete editing page for central columns + */ + public function getHtmlForEditingPage(array $selected_fld, $selected_db) + { + $html = '<form id="multi_edit_central_columns">'; + $header_cells = array( + __('Name'), __('Type'), __('Length/Values'), __('Default'), + __('Collation'), __('Attributes'), __('Null'), __('A_I') + ); + $html .= $this->getEditTableHeader($header_cells); + $selected_fld_safe = array(); + foreach ($selected_fld as $key) { + $selected_fld_safe[] = $this->dbi->escapeString($key); + } + $columns_list = implode("','", $selected_fld_safe); + $columns_list = "'" . $columns_list . "'"; + $list_detail_cols = $this->findExistingColNames($selected_db, $columns_list, true); + $row_num = 0; + foreach ($list_detail_cols as $row) { + $tableHtmlRow = $this->getHtmlForEditTableRow( + $row, + $row_num + ); + $html .= $tableHtmlRow; + $row_num++; + } + $html .= '</table>'; + $html .= $this->getEditTableFooter(); + $html .= '</form>'; + return $html; + } +} diff --git a/phpMyAdmin/libraries/classes/Charsets.php b/phpMyAdmin/libraries/classes/Charsets.php new file mode 100755 index 0000000..38c90f1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Charsets.php @@ -0,0 +1,704 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * MySQL charset metadata and manipulations + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Util; + +/** + * Class used to manage MySQL charsets + * + * @package PhpMyAdmin + */ +class Charsets +{ + /** + * MySQL charsets map + * + * @var array + */ + public static $mysql_charset_map = array( + 'big5' => 'big5', + 'cp-866' => 'cp866', + 'euc-jp' => 'ujis', + 'euc-kr' => 'euckr', + 'gb2312' => 'gb2312', + 'gbk' => 'gbk', + 'iso-8859-1' => 'latin1', + 'iso-8859-2' => 'latin2', + 'iso-8859-7' => 'greek', + 'iso-8859-8' => 'hebrew', + 'iso-8859-8-i' => 'hebrew', + 'iso-8859-9' => 'latin5', + 'iso-8859-13' => 'latin7', + 'iso-8859-15' => 'latin1', + 'koi8-r' => 'koi8r', + 'shift_jis' => 'sjis', + 'tis-620' => 'tis620', + 'utf-8' => 'utf8', + 'windows-1250' => 'cp1250', + 'windows-1251' => 'cp1251', + 'windows-1252' => 'latin1', + 'windows-1256' => 'cp1256', + 'windows-1257' => 'cp1257', + ); + + private static $_charsets = array(); + + /** + * The charset for the server + * + * @var string + */ + private static $_charset_server; + + private static $_charsets_descriptions = array(); + private static $_collations = array(); + private static $_default_collations = array(); + + /** + * Loads charset data from the MySQL server. + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param boolean $disableIs Disable use of INFORMATION_SCHEMA + * + * @return void + */ + private static function loadCharsets(DatabaseInterface $dbi, $disableIs) + { + /* Data already loaded */ + if (count(self::$_charsets) > 0) { + return; + } + + if ($disableIs) { + $sql = 'SHOW CHARACTER SET'; + } else { + $sql = 'SELECT `CHARACTER_SET_NAME` AS `Charset`,' + . ' `DESCRIPTION` AS `Description`' + . ' FROM `information_schema`.`CHARACTER_SETS`'; + } + $res = $dbi->query($sql); + + self::$_charsets = array(); + while ($row = $dbi->fetchAssoc($res)) { + $name = $row['Charset']; + self::$_charsets[] = $name; + self::$_charsets_descriptions[$name] = $row['Description']; + } + $dbi->freeResult($res); + + sort(self::$_charsets, SORT_STRING); + } + + /** + * Loads collation data from the MySQL server. + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param boolean $disableIs Disable use of INFORMATION_SCHEMA + * + * @return void + */ + private static function loadCollations(DatabaseInterface $dbi, $disableIs) + { + /* Data already loaded */ + if (count(self::$_collations) > 0) { + return; + } + + if ($disableIs) { + $sql = 'SHOW COLLATION'; + } else { + $sql = 'SELECT `CHARACTER_SET_NAME` AS `Charset`,' + . ' `COLLATION_NAME` AS `Collation`, `IS_DEFAULT` AS `Default`' + . ' FROM `information_schema`.`COLLATIONS`'; + } + + $res = $dbi->query($sql); + while ($row = $dbi->fetchAssoc($res)) { + $char_set_name = $row['Charset']; + $name = $row['Collation']; + self::$_collations[$char_set_name][] = $name; + if ($row['Default'] == 'Yes' || $row['Default'] == '1') { + self::$_default_collations[$char_set_name] = $name; + } + } + $dbi->freeResult($res); + + foreach (self::$_collations as $key => $value) { + sort(self::$_collations[$key], SORT_STRING); + } + } + + /** + * Get current MySQL server charset. + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * + * @return string + */ + public static function getServerCharset(DatabaseInterface $dbi) + { + if (self::$_charset_server) { + return self::$_charset_server; + } else { + $charsetServer = $dbi->getVariable('character_set_server'); + if (! is_string($charsetServer)) {// MySQL 5.7.8 fallback, issue #15614 + $charsetServer = $dbi->fetchValue("SELECT @@character_set_server;"); + } + self::$_charset_server = $charsetServer; + return self::$_charset_server; + } + } + + /** + * Get MySQL charsets + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param boolean $disableIs Disable use of INFORMATION_SCHEMA + * + * @return array + */ + public static function getMySQLCharsets(DatabaseInterface $dbi, $disableIs) + { + self::loadCharsets($dbi, $disableIs); + return self::$_charsets; + } + + /** + * Get MySQL charsets descriptions + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param boolean $disableIs Disable use of INFORMATION_SCHEMA + * + * @return array + */ + public static function getMySQLCharsetsDescriptions(DatabaseInterface $dbi, $disableIs) + { + self::loadCharsets($dbi, $disableIs); + return self::$_charsets_descriptions; + } + + /** + * Get MySQL collations + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param boolean $disableIs Disable use of INFORMATION_SCHEMA + * + * @return array + */ + public static function getMySQLCollations(DatabaseInterface $dbi, $disableIs) + { + self::loadCollations($dbi, $disableIs); + return self::$_collations; + } + + /** + * Get MySQL default collations + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param boolean $disableIs Disable use of INFORMATION_SCHEMA + * + * @return array + */ + public static function getMySQLCollationsDefault(DatabaseInterface $dbi, $disableIs) + { + self::loadCollations($dbi, $disableIs); + return self::$_default_collations; + } + + /** + * Generate charset dropdown box + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param boolean $disableIs Disable use of INFORMATION_SCHEMA + * @param string $name Element name + * @param string $id Element id + * @param null|string $default Default value + * @param bool $label Label + * @param bool $submitOnChange Submit on change + * + * @return string + */ + public static function getCharsetDropdownBox( + DatabaseInterface $dbi, + $disableIs, + $name = null, + $id = null, + $default = null, + $label = true, + $submitOnChange = false + ) { + self::loadCharsets($dbi, $disableIs); + if (empty($name)) { + $name = 'character_set'; + } + + $return_str = '<select lang="en" dir="ltr" name="' + . htmlspecialchars($name) . '"' + . (empty($id) ? '' : ' id="' . htmlspecialchars($id) . '"') + . ($submitOnChange ? ' class="autosubmit"' : '') . '>' . "\n"; + if ($label) { + $return_str .= '<option value="">' + . __('Charset') + . '</option>' . "\n"; + } + $return_str .= '<option value=""></option>' . "\n"; + foreach (self::$_charsets as $current_charset) { + $current_cs_descr + = empty(self::$_charsets_descriptions[$current_charset]) + ? $current_charset + : self::$_charsets_descriptions[$current_charset]; + + $return_str .= '<option value="' . $current_charset + . '" title="' . $current_cs_descr . '"' + . ($default == $current_charset ? ' selected="selected"' : '') . '>' + . $current_charset . '</option>' . "\n"; + } + $return_str .= '</select>' . "\n"; + + return $return_str; + } + + /** + * Generate collation dropdown box + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param boolean $disableIs Disable use of INFORMATION_SCHEMA + * @param string $name Element name + * @param string $id Element id + * @param null|string $default Default value + * @param bool $label Label + * @param bool $submitOnChange Submit on change + * + * @return string + */ + public static function getCollationDropdownBox( + DatabaseInterface $dbi, + $disableIs, + $name = null, + $id = null, + $default = null, + $label = true, + $submitOnChange = false + ) { + self::loadCharsets($dbi, $disableIs); + self::loadCollations($dbi, $disableIs); + if (empty($name)) { + $name = 'collation'; + } + + $return_str = '<select lang="en" dir="ltr" name="' + . htmlspecialchars($name) . '"' + . (empty($id) ? '' : ' id="' . htmlspecialchars($id) . '"') + . ($submitOnChange ? ' class="autosubmit"' : '') . '>' . "\n"; + if ($label) { + $return_str .= '<option value="">' + . __('Collation') + . '</option>' . "\n"; + } + $return_str .= '<option value=""></option>' . "\n"; + foreach (self::$_charsets as $current_charset) { + $current_cs_descr + = empty(self::$_charsets_descriptions[$current_charset]) + ? $current_charset + : self::$_charsets_descriptions[$current_charset]; + + $return_str .= '<optgroup label="' . $current_charset + . '" title="' . $current_cs_descr . '">' . "\n"; + foreach (self::$_collations[$current_charset] as $current_collation) { + $return_str .= '<option value="' . $current_collation + . '" title="' . self::getCollationDescr($current_collation) . '"' + . ($default == $current_collation ? ' selected="selected"' : '') + . '>' + . $current_collation . '</option>' . "\n"; + } + $return_str .= '</optgroup>' . "\n"; + } + $return_str .= '</select>' . "\n"; + + return $return_str; + } + + /** + * Returns description for given collation + * + * @param string $collation MySQL collation string + * + * @return string collation description + */ + public static function getCollationDescr($collation) + { + $parts = explode('_', $collation); + + $name = __('Unknown'); + $variant = null; + $suffixes = array(); + $unicode = false; + $unknown = false; + + $level = 0; + foreach ($parts as $part) { + if ($level == 0) { + /* Next will be language */ + $level = 1; + /* First should be charset */ + switch ($part) { + case 'binary': + $name = _pgettext('Collation', 'Binary'); + break; + // Unicode charsets + case 'utf8mb4': + $variant = 'UCA 4.0.0'; + // Fall through to other unicode + case 'ucs2': + case 'utf8': + case 'utf16': + case 'utf16le': + case 'utf16be': + case 'utf32': + $name = _pgettext('Collation', 'Unicode'); + $unicode = true; + break; + // West European charsets + case 'ascii': + case 'cp850': + case 'dec8': + case 'hp8': + case 'latin1': + case 'macroman': + $name = _pgettext('Collation', 'West European'); + break; + // Central European charsets + case 'cp1250': + case 'cp852': + case 'latin2': + case 'macce': + $name = _pgettext('Collation', 'Central European'); + break; + // Russian charsets + case 'cp866': + case 'koi8r': + $name = _pgettext('Collation', 'Russian'); + break; + // Chinese charsets + case 'gb2312': + case 'gbk': + $name = _pgettext('Collation', 'Simplified Chinese'); + break; + case 'big5': + $name = _pgettext('Collation', 'Traditional Chinese'); + break; + case 'gb18030': + $name = _pgettext('Collation', 'Chinese'); + $unicode = true; + break; + // Japanese charsets + case 'sjis': + case 'ujis': + case 'cp932': + case 'eucjpms': + $name = _pgettext('Collation', 'Japanese'); + break; + // Baltic charsets + case 'cp1257': + case 'latin7': + $name = _pgettext('Collation', 'Baltic'); + break; + // Other + case 'armscii8': + case 'armscii': + $name = _pgettext('Collation', 'Armenian'); + break; + case 'cp1251': + $name = _pgettext('Collation', 'Cyrillic'); + break; + case 'cp1256': + $name = _pgettext('Collation', 'Arabic'); + break; + case 'euckr': + $name = _pgettext('Collation', 'Korean'); + break; + case 'hebrew': + $name = _pgettext('Collation', 'Hebrew'); + break; + case 'geostd8': + $name = _pgettext('Collation', 'Georgian'); + break; + case 'greek': + $name = _pgettext('Collation', 'Greek'); + break; + case 'keybcs2': + $name = _pgettext('Collation', 'Czech-Slovak'); + break; + case 'koi8u': + $name = _pgettext('Collation', 'Ukrainian'); + break; + case 'latin5': + $name = _pgettext('Collation', 'Turkish'); + break; + case 'swe7': + $name = _pgettext('Collation', 'Swedish'); + break; + case 'tis620': + $name = _pgettext('Collation', 'Thai'); + break; + default: + $name = _pgettext('Collation', 'Unknown'); + $unknown = true; + break; + } + continue; + } + if ($level == 1) { + /* Next will be variant unless changed later */ + $level = 4; + /* Locale name or code */ + $found = true; + switch ($part) { + case 'general': + break; + case 'bulgarian': + case 'bg': + $name = _pgettext('Collation', 'Bulgarian'); + break; + case 'chinese': + case 'cn': + case 'zh': + if ($unicode) { + $name = _pgettext('Collation', 'Chinese'); + } + break; + case 'croatian': + case 'hr': + $name = _pgettext('Collation', 'Croatian'); + break; + case 'czech': + case 'cs': + $name = _pgettext('Collation', 'Czech'); + break; + case 'danish': + case 'da': + $name = _pgettext('Collation', 'Danish'); + break; + case 'english': + case 'en': + $name = _pgettext('Collation', 'English'); + break; + case 'esperanto': + case 'eo': + $name = _pgettext('Collation', 'Esperanto'); + break; + case 'estonian': + case 'et': + $name = _pgettext('Collation', 'Estonian'); + break; + case 'german1': + $name = _pgettext('Collation', 'German (dictionary order)'); + break; + case 'german2': + $name = _pgettext('Collation', 'German (phone book order)'); + break; + case 'german': + case 'de': + /* Name is set later */ + $level = 2; + break; + case 'hungarian': + case 'hu': + $name = _pgettext('Collation', 'Hungarian'); + break; + case 'icelandic': + case 'is': + $name = _pgettext('Collation', 'Icelandic'); + break; + case 'japanese': + case 'ja': + $name = _pgettext('Collation', 'Japanese'); + break; + case 'la': + $name = _pgettext('Collation', 'Classical Latin'); + break; + case 'latvian': + case 'lv': + $name = _pgettext('Collation', 'Latvian'); + break; + case 'lithuanian': + case 'lt': + $name = _pgettext('Collation', 'Lithuanian'); + break; + case 'korean': + case 'ko': + $name = _pgettext('Collation', 'Korean'); + break; + case 'myanmar': + case 'my': + $name = _pgettext('Collation', 'Burmese'); + break; + case 'persian': + $name = _pgettext('Collation', 'Persian'); + break; + case 'polish': + case 'pl': + $name = _pgettext('Collation', 'Polish'); + break; + case 'roman': + $name = _pgettext('Collation', 'West European'); + break; + case 'romanian': + case 'ro': + $name = _pgettext('Collation', 'Romanian'); + break; + case 'ru': + $name = _pgettext('Collation', 'Russian'); + break; + case 'si': + case 'sinhala': + $name = _pgettext('Collation', 'Sinhalese'); + break; + case 'slovak': + case 'sk': + $name = _pgettext('Collation', 'Slovak'); + break; + case 'slovenian': + case 'sl': + $name = _pgettext('Collation', 'Slovenian'); + break; + case 'spanish': + $name = _pgettext('Collation', 'Spanish (modern)'); + break; + case 'es': + /* Name is set later */ + $level = 3; + break; + case 'spanish2': + $name = _pgettext('Collation', 'Spanish (traditional)'); + break; + case 'swedish': + case 'sv': + $name = _pgettext('Collation', 'Swedish'); + break; + case 'thai': + case 'th': + $name = _pgettext('Collation', 'Thai'); + break; + case 'turkish': + case 'tr': + $name = _pgettext('Collation', 'Turkish'); + break; + case 'ukrainian': + case 'uk': + $name = _pgettext('Collation', 'Ukrainian'); + break; + case 'vietnamese': + case 'vi': + $name = _pgettext('Collation', 'Vietnamese'); + break; + case 'unicode': + if ($unknown) { + $name = _pgettext('Collation', 'Unicode'); + } + break; + default: + $found = false; + } + if ($found) { + continue; + } + // Not parsed token, fall to next level + } + if ($level == 2) { + /* Next will be variant */ + $level = 4; + /* Germal variant */ + if ($part == 'pb') { + $name = _pgettext('Collation', 'German (phone book order)'); + continue; + } + $name = _pgettext('Collation', 'German (dictionary order)'); + // Not parsed token, fall to next level + } + if ($level == 3) { + /* Next will be variant */ + $level = 4; + /* Spanish variant */ + if ($part == 'trad') { + $name = _pgettext('Collation', 'Spanish (traditional)'); + continue; + } + $name = _pgettext('Collation', 'Spanish (modern)'); + // Not parsed token, fall to next level + } + if ($level == 4) { + /* Next will be suffix */ + $level = 5; + /* Variant */ + $found = true; + switch ($part) { + case '0900': + $variant = 'UCA 9.0.0'; + break; + case '520': + $variant = 'UCA 5.2.0'; + break; + case 'mysql561': + $variant = 'MySQL 5.6.1'; + break; + case 'mysql500': + $variant = 'MySQL 5.0.0'; + break; + default: + $found = false; + } + if ($found) { + continue; + } + // Not parsed token, fall to next level + } + if ($level == 5) { + /* Suffixes */ + switch ($part) { + case 'ci': + $suffixes[] = _pgettext('Collation variant', 'case-insensitive'); + break; + case 'cs': + $suffixes[] = _pgettext('Collation variant', 'case-sensitive'); + break; + case 'ai': + $suffixes[] = _pgettext('Collation variant', 'accent-insensitive'); + break; + case 'as': + $suffixes[] = _pgettext('Collation variant', 'accent-sensitive'); + break; + case 'ks': + $suffixes[] = _pgettext('Collation variant', 'kana-sensitive'); + break; + case 'w2': + case 'l2': + $suffixes[] = _pgettext('Collation variant', 'multi-level'); + break; + case 'bin': + $suffixes[] = _pgettext('Collation variant', 'binary'); + break; + case 'nopad': + $suffixes[] = _pgettext('Collation variant', 'no-pad'); + break; + } + } + } + + $result = $name; + if (! is_null($variant)) { + $result .= ' (' . $variant . ')'; + } + if (count($suffixes) > 0) { + $result .= ', ' . implode(', ', $suffixes); + } + return $result; + } +} diff --git a/phpMyAdmin/libraries/classes/CheckUserPrivileges.php b/phpMyAdmin/libraries/classes/CheckUserPrivileges.php new file mode 100755 index 0000000..7b3770d --- /dev/null +++ b/phpMyAdmin/libraries/classes/CheckUserPrivileges.php @@ -0,0 +1,338 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Get user's global privileges and some db-specific privileges + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Util; + +/** + * PhpMyAdmin\CheckUserPrivileges class + * + * @package PhpMyAdmin + */ +class CheckUserPrivileges +{ + /** + * @var DatabaseInterface + */ + private $dbi; + + /** + * Constructor + * + * @param DatabaseInterface $dbi DatabaseInterface object + */ + public function __construct(DatabaseInterface $dbi) + { + $this->dbi = $dbi; + } + + /** + * Extracts details from a result row of a SHOW GRANT query + * + * @param string $row grant row + * + * @return array + */ + public function getItemsFromShowGrantsRow($row) + { + $db_name_offset = mb_strpos($row, ' ON ') + 4; + + $tblname_end_offset = mb_strpos($row, ' TO '); + $tblname_start_offset = false; + + if ($__tblname_start_offset = mb_strpos($row, '`.', $db_name_offset)) { + if ($__tblname_start_offset < $tblname_end_offset) { + $tblname_start_offset = $__tblname_start_offset + 1; + } + } + + if (!$tblname_start_offset) { + $tblname_start_offset = mb_strpos($row, '.', $db_name_offset); + } + + $show_grants_dbname = mb_substr( + $row, + $db_name_offset, + $tblname_start_offset - $db_name_offset + ); + + $show_grants_dbname = Util::unQuote($show_grants_dbname, '`'); + + $show_grants_str = mb_substr( + $row, + 6, + (mb_strpos($row, ' ON ') - 6) + ); + + $show_grants_tblname = mb_substr( + $row, + $tblname_start_offset + 1, + $tblname_end_offset - $tblname_start_offset - 1 + ); + $show_grants_tblname = Util::unQuote($show_grants_tblname, '`'); + + return array( + $show_grants_str, + $show_grants_dbname, + $show_grants_tblname + ); + } + + /** + * Check if user has required privileges for + * performing 'Adjust privileges' operations + * + * @param string $show_grants_str string containing grants for user + * @param string $show_grants_dbname name of db extracted from grant string + * @param string $show_grants_tblname name of table extracted from grant string + * + * @return void + */ + public function checkRequiredPrivilegesForAdjust( + $show_grants_str, + $show_grants_dbname, + $show_grants_tblname + ) { + // '... ALL PRIVILEGES ON *.* ...' OR '... ALL PRIVILEGES ON `mysql`.* ..' + // OR + // SELECT, INSERT, UPDATE, DELETE .... ON *.* OR `mysql`.* + if ($show_grants_str == 'ALL' + || $show_grants_str == 'ALL PRIVILEGES' + || (mb_strpos( + $show_grants_str, 'SELECT, INSERT, UPDATE, DELETE' + ) !== false) + ) { + if ($show_grants_dbname == '*' + && $show_grants_tblname == '*' + ) { + $GLOBALS['col_priv'] = true; + $GLOBALS['db_priv'] = true; + $GLOBALS['proc_priv'] = true; + $GLOBALS['table_priv'] = true; + + if ($show_grants_str == 'ALL PRIVILEGES' + || $show_grants_str == 'ALL' + ) { + $GLOBALS['is_reload_priv'] = true; + } + } + + // check for specific tables in `mysql` db + // Ex. '... ALL PRIVILEGES on `mysql`.`columns_priv` .. ' + if ($show_grants_dbname == 'mysql') { + switch ($show_grants_tblname) { + case "columns_priv": + $GLOBALS['col_priv'] = true; + break; + case "db": + $GLOBALS['db_priv'] = true; + break; + case "procs_priv": + $GLOBALS['proc_priv'] = true; + break; + case "tables_priv": + $GLOBALS['table_priv'] = true; + break; + case "*": + $GLOBALS['col_priv'] = true; + $GLOBALS['db_priv'] = true; + $GLOBALS['proc_priv'] = true; + $GLOBALS['table_priv'] = true; + break; + default: + } + } + } + } + + /** + * sets privilege information extracted from SHOW GRANTS result + * + * Detection for some CREATE privilege. + * + * Since MySQL 4.1.2, we can easily detect current user's grants using $userlink + * (no control user needed) and we don't have to try any other method for + * detection + * + * @todo fix to get really all privileges, not only explicitly defined for this user + * from MySQL manual: (https://dev.mysql.com/doc/refman/5.0/en/show-grants.html) + * SHOW GRANTS displays only the privileges granted explicitly to the named + * account. Other privileges might be available to the account, but they are not + * displayed. For example, if an anonymous account exists, the named account + * might be able to use its privileges, but SHOW GRANTS will not display them. + * + * @return void + */ + public function analyseShowGrant() + { + if (Util::cacheExists('is_create_db_priv')) { + $GLOBALS['is_create_db_priv'] = Util::cacheGet( + 'is_create_db_priv' + ); + $GLOBALS['is_reload_priv'] = Util::cacheGet( + 'is_reload_priv' + ); + $GLOBALS['db_to_create'] = Util::cacheGet( + 'db_to_create' + ); + $GLOBALS['dbs_where_create_table_allowed'] = Util::cacheGet( + 'dbs_where_create_table_allowed' + ); + $GLOBALS['dbs_to_test'] = Util::cacheGet( + 'dbs_to_test' + ); + + $GLOBALS['db_priv'] = Util::cacheGet( + 'db_priv' + ); + $GLOBALS['col_priv'] = Util::cacheGet( + 'col_priv' + ); + $GLOBALS['table_priv'] = Util::cacheGet( + 'table_priv' + ); + $GLOBALS['proc_priv'] = Util::cacheGet( + 'proc_priv' + ); + + return; + } + + // defaults + $GLOBALS['is_create_db_priv'] = false; + $GLOBALS['is_reload_priv'] = false; + $GLOBALS['db_to_create'] = ''; + $GLOBALS['dbs_where_create_table_allowed'] = array(); + $GLOBALS['dbs_to_test'] = $this->dbi->getSystemSchemas(); + $GLOBALS['proc_priv'] = false; + $GLOBALS['db_priv'] = false; + $GLOBALS['col_priv'] = false; + $GLOBALS['table_priv'] = false; + + $rs_usr = $this->dbi->tryQuery('SHOW GRANTS'); + + if (! $rs_usr) { + return; + } + + $re0 = '(^|(\\\\\\\\)+|[^\\\\])'; // non-escaped wildcards + $re1 = '(^|[^\\\\])(\\\)+'; // escaped wildcards + + while ($row = $this->dbi->fetchRow($rs_usr)) { + list( + $show_grants_str, + $show_grants_dbname, + $show_grants_tblname + ) = $this->getItemsFromShowGrantsRow($row[0]); + + if ($show_grants_dbname == '*') { + if ($show_grants_str != 'USAGE') { + $GLOBALS['dbs_to_test'] = false; + } + } elseif ($GLOBALS['dbs_to_test'] !== false) { + $GLOBALS['dbs_to_test'][] = $show_grants_dbname; + } + + if ( + mb_strpos($show_grants_str,'RELOAD') !== false + ) { + $GLOBALS['is_reload_priv'] = true; + } + + // check for the required privileges for adjust + $this->checkRequiredPrivilegesForAdjust( + $show_grants_str, + $show_grants_dbname, + $show_grants_tblname + ); + + /** + * @todo if we find CREATE VIEW but not CREATE, do not offer + * the create database dialog box + */ + if ($show_grants_str == 'ALL' + || $show_grants_str == 'ALL PRIVILEGES' + || $show_grants_str == 'CREATE' + || strpos($show_grants_str, 'CREATE,') !== false + ) { + if ($show_grants_dbname == '*') { + // a global CREATE privilege + $GLOBALS['is_create_db_priv'] = true; + $GLOBALS['is_reload_priv'] = true; + $GLOBALS['db_to_create'] = ''; + $GLOBALS['dbs_where_create_table_allowed'][] = '*'; + // @todo we should not break here, cause GRANT ALL *.* + // could be revoked by a later rule like GRANT SELECT ON db.* + break; + } else { + // this array may contain wildcards + $GLOBALS['dbs_where_create_table_allowed'][] = $show_grants_dbname; + + $dbname_to_test = Util::backquote($show_grants_dbname); + + if ($GLOBALS['is_create_db_priv']) { + // no need for any more tests if we already know this + continue; + } + + // does this db exist? + if ((preg_match('/' . $re0 . '%|_/', $show_grants_dbname) + && ! preg_match('/\\\\%|\\\\_/', $show_grants_dbname)) + || (! $this->dbi->tryQuery( + 'USE ' . preg_replace( + '/' . $re1 . '(%|_)/', '\\1\\3', $dbname_to_test + ) + ) + && mb_substr($this->dbi->getError(), 1, 4) != 1044) + ) { + /** + * Do not handle the underscore wildcard + * (this case must be rare anyway) + */ + $GLOBALS['db_to_create'] = preg_replace( + '/' . $re0 . '%/', '\\1', + $show_grants_dbname + ); + $GLOBALS['db_to_create'] = preg_replace( + '/' . $re1 . '(%|_)/', '\\1\\3', + $GLOBALS['db_to_create'] + ); + $GLOBALS['is_create_db_priv'] = true; + + /** + * @todo collect $GLOBALS['db_to_create'] into an array, + * to display a drop-down in the "Create database" dialog + */ + // we don't break, we want all possible databases + //break; + } // end if + } // end elseif + } // end if + + } // end while + + $this->dbi->freeResult($rs_usr); + + // must also cacheUnset() them in + // PhpMyAdmin\Plugins\Auth\AuthenticationCookie + Util::cacheSet('is_create_db_priv', $GLOBALS['is_create_db_priv']); + Util::cacheSet('is_reload_priv', $GLOBALS['is_reload_priv']); + Util::cacheSet('db_to_create', $GLOBALS['db_to_create']); + Util::cacheSet( + 'dbs_where_create_table_allowed', + $GLOBALS['dbs_where_create_table_allowed'] + ); + Util::cacheSet('dbs_to_test', $GLOBALS['dbs_to_test']); + + Util::cacheSet('proc_priv', $GLOBALS['proc_priv']); + Util::cacheSet('table_priv', $GLOBALS['table_priv']); + Util::cacheSet('col_priv', $GLOBALS['col_priv']); + Util::cacheSet('db_priv', $GLOBALS['db_priv']); + } // end function +} diff --git a/phpMyAdmin/libraries/classes/Config.php b/phpMyAdmin/libraries/classes/Config.php new file mode 100755 index 0000000..bd2c5ef --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config.php @@ -0,0 +1,1896 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Configuration handling. + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use DirectoryIterator; +use PhpMyAdmin\Core; +use PhpMyAdmin\Error; +use PhpMyAdmin\LanguageManager; +use PhpMyAdmin\ThemeManager; +use PhpMyAdmin\Url; +use PhpMyAdmin\UserPreferences; +use PhpMyAdmin\Util; +use PhpMyAdmin\Utils\HttpRequest; + +/** + * Indication for error handler (see end of this file). + */ +$GLOBALS['pma_config_loading'] = false; + +/** + * Configuration class + * + * @package PhpMyAdmin + */ +class Config +{ + /** + * @var string default config source + */ + var $default_source = './libraries/config.default.php'; + + /** + * @var array default configuration settings + */ + var $default = array(); + + /** + * @var array configuration settings, without user preferences applied + */ + var $base_settings = array(); + + /** + * @var array configuration settings + */ + var $settings = array(); + + /** + * @var string config source + */ + var $source = ''; + + /** + * @var int source modification time + */ + var $source_mtime = 0; + var $default_source_mtime = 0; + var $set_mtime = 0; + + /** + * @var boolean + */ + var $error_config_file = false; + + /** + * @var boolean + */ + var $error_config_default_file = false; + + /** + * @var array + */ + var $default_server = array(); + + /** + * @var boolean whether init is done or not + * set this to false to force some initial checks + * like checking for required functions + */ + var $done = false; + + /** + * @var UserPreferences + */ + private $userPreferences; + + /** + * constructor + * + * @param string $source source to read config from + */ + public function __construct($source = null) + { + $this->settings = array('is_setup' => false); + + // functions need to refresh in case of config file changed goes in + // PhpMyAdmin\Config::load() + $this->load($source); + + // other settings, independent from config file, comes in + $this->checkSystem(); + + $this->base_settings = $this->settings; + + $this->userPreferences = new UserPreferences(); + } + + /** + * sets system and application settings + * + * @return void + */ + public function checkSystem() + { + $this->set('PMA_VERSION', '4.9.11'); + /* Major version */ + $this->set( + 'PMA_MAJOR_VERSION', + implode('.', array_slice(explode('.', $this->get('PMA_VERSION'), 3), 0, 2)) + ); + + $this->checkWebServerOs(); + $this->checkWebServer(); + $this->checkGd2(); + $this->checkClient(); + $this->checkUpload(); + $this->checkUploadSize(); + $this->checkOutputCompression(); + } + + /** + * whether to use gzip output compression or not + * + * @return void + */ + public function checkOutputCompression() + { + // If zlib output compression is set in the php configuration file, no + // output buffering should be run + if (ini_get('zlib.output_compression')) { + $this->set('OBGzip', false); + } + + // enable output-buffering (if set to 'auto') + if (strtolower($this->get('OBGzip')) == 'auto') { + $this->set('OBGzip', true); + } + } + + /** + * Sets the client platform based on user agent + * + * @param string $user_agent the user agent + * + * @return void + */ + private function _setClientPlatform($user_agent) + { + if (mb_strstr($user_agent, 'Win')) { + $this->set('PMA_USR_OS', 'Win'); + } elseif (mb_strstr($user_agent, 'Mac')) { + $this->set('PMA_USR_OS', 'Mac'); + } elseif (mb_strstr($user_agent, 'Linux')) { + $this->set('PMA_USR_OS', 'Linux'); + } elseif (mb_strstr($user_agent, 'Unix')) { + $this->set('PMA_USR_OS', 'Unix'); + } elseif (mb_strstr($user_agent, 'OS/2')) { + $this->set('PMA_USR_OS', 'OS/2'); + } else { + $this->set('PMA_USR_OS', 'Other'); + } + } + + /** + * Determines platform (OS), browser and version of the user + * Based on a phpBuilder article: + * + * @see http://www.phpbuilder.net/columns/tim20000821.php + * + * @return void + */ + public function checkClient() + { + if (Core::getenv('HTTP_USER_AGENT')) { + $HTTP_USER_AGENT = Core::getenv('HTTP_USER_AGENT'); + } else { + $HTTP_USER_AGENT = ''; + } + + // 1. Platform + $this->_setClientPlatform($HTTP_USER_AGENT); + + // 2. browser and version + // (must check everything else before Mozilla) + + $is_mozilla = preg_match( + '@Mozilla/([0-9]\.[0-9]{1,2})@', + $HTTP_USER_AGENT, + $mozilla_version + ); + + if (preg_match( + '@Opera(/| )([0-9]\.[0-9]{1,2})@', + $HTTP_USER_AGENT, + $log_version + )) { + $this->set('PMA_USR_BROWSER_VER', $log_version[2]); + $this->set('PMA_USR_BROWSER_AGENT', 'OPERA'); + } elseif (preg_match( + '@(MS)?IE ([0-9]{1,2}\.[0-9]{1,2})@', + $HTTP_USER_AGENT, + $log_version + )) { + $this->set('PMA_USR_BROWSER_VER', $log_version[2]); + $this->set('PMA_USR_BROWSER_AGENT', 'IE'); + } elseif (preg_match( + '@Trident/(7)\.0@', + $HTTP_USER_AGENT, + $log_version + )) { + $this->set('PMA_USR_BROWSER_VER', intval($log_version[1]) + 4); + $this->set('PMA_USR_BROWSER_AGENT', 'IE'); + } elseif (preg_match( + '@OmniWeb/([0-9]{1,3})@', + $HTTP_USER_AGENT, + $log_version + )) { + $this->set('PMA_USR_BROWSER_VER', $log_version[1]); + $this->set('PMA_USR_BROWSER_AGENT', 'OMNIWEB'); + // Konqueror 2.2.2 says Konqueror/2.2.2 + // Konqueror 3.0.3 says Konqueror/3 + } elseif (preg_match( + '@(Konqueror/)(.*)(;)@', + $HTTP_USER_AGENT, + $log_version + )) { + $this->set('PMA_USR_BROWSER_VER', $log_version[2]); + $this->set('PMA_USR_BROWSER_AGENT', 'KONQUEROR'); + // must check Chrome before Safari + } elseif ($is_mozilla + && preg_match('@Chrome/([0-9.]*)@', $HTTP_USER_AGENT, $log_version) + ) { + $this->set('PMA_USR_BROWSER_VER', $log_version[1]); + $this->set('PMA_USR_BROWSER_AGENT', 'CHROME'); + // newer Safari + } elseif ($is_mozilla + && preg_match('@Version/(.*) Safari@', $HTTP_USER_AGENT, $log_version) + ) { + $this->set( + 'PMA_USR_BROWSER_VER', $log_version[1] + ); + $this->set('PMA_USR_BROWSER_AGENT', 'SAFARI'); + // older Safari + } elseif ($is_mozilla + && preg_match('@Safari/([0-9]*)@', $HTTP_USER_AGENT, $log_version) + ) { + $this->set( + 'PMA_USR_BROWSER_VER', $mozilla_version[1] . '.' . $log_version[1] + ); + $this->set('PMA_USR_BROWSER_AGENT', 'SAFARI'); + // Firefox + } elseif (! mb_strstr($HTTP_USER_AGENT, 'compatible') + && preg_match('@Firefox/([\w.]+)@', $HTTP_USER_AGENT, $log_version) + ) { + $this->set( + 'PMA_USR_BROWSER_VER', $log_version[1] + ); + $this->set('PMA_USR_BROWSER_AGENT', 'FIREFOX'); + } elseif (preg_match('@rv:1\.9(.*)Gecko@', $HTTP_USER_AGENT)) { + $this->set('PMA_USR_BROWSER_VER', '1.9'); + $this->set('PMA_USR_BROWSER_AGENT', 'GECKO'); + } elseif ($is_mozilla) { + $this->set('PMA_USR_BROWSER_VER', $mozilla_version[1]); + $this->set('PMA_USR_BROWSER_AGENT', 'MOZILLA'); + } else { + $this->set('PMA_USR_BROWSER_VER', 0); + $this->set('PMA_USR_BROWSER_AGENT', 'OTHER'); + } + } + + /** + * Whether GD2 is present + * + * @return void + */ + public function checkGd2() + { + if ($this->get('GD2Available') == 'yes') { + $this->set('PMA_IS_GD2', 1); + return; + } + + if ($this->get('GD2Available') == 'no') { + $this->set('PMA_IS_GD2', 0); + return; + } + + if (!function_exists('imagecreatetruecolor')) { + $this->set('PMA_IS_GD2', 0); + return; + } + + if (function_exists('gd_info')) { + $gd_nfo = gd_info(); + if (mb_strstr($gd_nfo["GD Version"], '2.')) { + $this->set('PMA_IS_GD2', 1); + } else { + $this->set('PMA_IS_GD2', 0); + } + } else { + $this->set('PMA_IS_GD2', 0); + } + } + + /** + * Whether the Web server php is running on is IIS + * + * @return void + */ + public function checkWebServer() + { + // some versions return Microsoft-IIS, some Microsoft/IIS + // we could use a preg_match() but it's slower + if (Core::getenv('SERVER_SOFTWARE') + && stristr(Core::getenv('SERVER_SOFTWARE'), 'Microsoft') + && stristr(Core::getenv('SERVER_SOFTWARE'), 'IIS') + ) { + $this->set('PMA_IS_IIS', 1); + } else { + $this->set('PMA_IS_IIS', 0); + } + } + + /** + * Whether the os php is running on is windows or not + * + * @return void + */ + public function checkWebServerOs() + { + // Default to Unix or Equiv + $this->set('PMA_IS_WINDOWS', 0); + // If PHP_OS is defined then continue + if (defined('PHP_OS')) { + if (stristr(PHP_OS, 'win') && !stristr(PHP_OS, 'darwin')) { + // Is it some version of Windows + $this->set('PMA_IS_WINDOWS', 1); + } elseif (stristr(PHP_OS, 'OS/2')) { + // Is it OS/2 (No file permissions like Windows) + $this->set('PMA_IS_WINDOWS', 1); + } + } + } + + /** + * detects if Git revision + * @param string &$git_location (optional) verified git directory + * @return boolean + */ + public function isGitRevision(&$git_location = NULL) + { + // PMA config check + if (! $this->get('ShowGitRevision')) { + return false; + } + + // caching + if ( + isset($_SESSION['is_git_revision']) + && array_key_exists('git_location', $_SESSION) + ) { + // Define location using cached value + $git_location = $_SESSION['git_location']; + return $_SESSION['is_git_revision']; + } + + // find out if there is a .git folder + // or a .git file (--separate-git-dir) + $git = '.git'; + if (is_dir($git)) { + if (@is_file($git . '/config')) { + $git_location = $git; + } else { + $_SESSION['git_location'] = null; + $_SESSION['is_git_revision'] = false; + return false; + } + } elseif (is_file($git)) { + $contents = file_get_contents($git); + $gitmatch = array(); + // Matches expected format + if (! preg_match('/^gitdir: (.*)$/', + $contents, $gitmatch)) { + $_SESSION['git_location'] = null; + $_SESSION['is_git_revision'] = false; + return false; + } else { + if (@is_dir($gitmatch[1])) { + //Detected git external folder location + $git_location = $gitmatch[1]; + } else { + $_SESSION['git_location'] = null; + $_SESSION['is_git_revision'] = false; + return false; + } + } + } else { + $_SESSION['git_location'] = null; + $_SESSION['is_git_revision'] = false; + return false; + } + // Define session for caching + $_SESSION['git_location'] = $git_location; + $_SESSION['is_git_revision'] = true; + return true; + } + + /** + * detects Git revision, if running inside repo + * + * @return void + */ + public function checkGitRevision() + { + // find out if there is a .git folder + $git_folder = ''; + if (! $this->isGitRevision($git_folder)) { + $this->set('PMA_VERSION_GIT', 0); + return; + } + + if (! $ref_head = @file_get_contents($git_folder . '/HEAD')) { + $this->set('PMA_VERSION_GIT', 0); + return; + } + + if ($common_dir_contents = @file_get_contents($git_folder . '/commondir')) { + $git_folder = $git_folder . DIRECTORY_SEPARATOR . trim($common_dir_contents); + } + + $branch = false; + // are we on any branch? + if (strstr($ref_head, '/')) { + // remove ref: prefix + $ref_head = substr(trim($ref_head), 5); + if (substr($ref_head, 0, 11) === 'refs/heads/') { + $branch = substr($ref_head, 11); + } else { + $branch = basename($ref_head); + } + + $ref_file = $git_folder . '/' . $ref_head; + if (@file_exists($ref_file)) { + $hash = @file_get_contents($ref_file); + if (! $hash) { + $this->set('PMA_VERSION_GIT', 0); + return; + } + $hash = trim($hash); + } else { + // deal with packed refs + $packed_refs = @file_get_contents($git_folder . '/packed-refs'); + if (! $packed_refs) { + $this->set('PMA_VERSION_GIT', 0); + return; + } + // split file to lines + $ref_lines = explode("\n", $packed_refs); + foreach ($ref_lines as $line) { + // skip comments + if ($line[0] == '#') { + continue; + } + // parse line + $parts = explode(' ', $line); + // care only about named refs + if (count($parts) != 2) { + continue; + } + // have found our ref? + if ($parts[1] == $ref_head) { + $hash = $parts[0]; + break; + } + } + if (! isset($hash)) { + $this->set('PMA_VERSION_GIT', 0); + // Could not find ref + return; + } + } + } else { + $hash = trim($ref_head); + } + + $commit = false; + if (! preg_match('/^[0-9a-f]{40}$/i', $hash)) { + $commit = false; + } elseif (isset($_SESSION['PMA_VERSION_COMMITDATA_' . $hash])) { + $commit = $_SESSION['PMA_VERSION_COMMITDATA_' . $hash]; + } elseif (function_exists('gzuncompress')) { + $git_file_name = $git_folder . '/objects/' + . substr($hash, 0, 2) . '/' . substr($hash, 2); + if (@file_exists($git_file_name) ) { + if (! $commit = @file_get_contents($git_file_name)) { + $this->set('PMA_VERSION_GIT', 0); + return; + } + $commit = explode("\0", gzuncompress($commit), 2); + $commit = explode("\n", $commit[1]); + $_SESSION['PMA_VERSION_COMMITDATA_' . $hash] = $commit; + } else { + $pack_names = array(); + // work with packed data + $packs_file = $git_folder . '/objects/info/packs'; + if (@file_exists($packs_file) + && $packs = @file_get_contents($packs_file) + ) { + // File exists. Read it, parse the file to get the names of the + // packs. (to look for them in .git/object/pack directory later) + foreach (explode("\n", $packs) as $line) { + // skip blank lines + if (strlen(trim($line)) == 0) { + continue; + } + // skip non pack lines + if ($line[0] != 'P') { + continue; + } + // parse names + $pack_names[] = substr($line, 2); + } + } else { + // '.git/objects/info/packs' file can be missing + // (atlease in mysGit) + // File missing. May be we can look in the .git/object/pack + // directory for all the .pack files and use that list of + // files instead + $dirIterator = new DirectoryIterator( + $git_folder . '/objects/pack' + ); + foreach ($dirIterator as $file_info) { + $file_name = $file_info->getFilename(); + // if this is a .pack file + if ($file_info->isFile() && substr($file_name, -5) == '.pack' + ) { + $pack_names[] = $file_name; + } + } + } + $hash = strtolower($hash); + foreach ($pack_names as $pack_name) { + $index_name = str_replace('.pack', '.idx', $pack_name); + + // load index + $index_data = @file_get_contents( + $git_folder . '/objects/pack/' . $index_name + ); + if (! $index_data) { + continue; + } + // check format + if (substr($index_data, 0, 4) != "\377tOc") { + continue; + } + // check version + $version = unpack('N', substr($index_data, 4, 4)); + if ($version[1] != 2) { + continue; + } + // parse fanout table + $fanout = unpack( + "N*", + substr($index_data, 8, 256 * 4) + ); + + // find where we should search + $firstbyte = intval(substr($hash, 0, 2), 16); + // array is indexed from 1 and we need to get + // previous entry for start + if ($firstbyte == 0) { + $start = 0; + } else { + $start = $fanout[$firstbyte]; + } + $end = $fanout[$firstbyte + 1]; + + // stupid linear search for our sha + $found = false; + $offset = 8 + (256 * 4); + for ($position = $start; $position < $end; $position++) { + $sha = strtolower( + bin2hex( + substr($index_data, $offset + ($position * 20), 20) + ) + ); + if ($sha == $hash) { + $found = true; + break; + } + } + if (! $found) { + continue; + } + // read pack offset + $offset = 8 + (256 * 4) + (24 * $fanout[256]); + $pack_offset = unpack( + 'N', + substr($index_data, $offset + ($position * 4), 4) + ); + $pack_offset = $pack_offset[1]; + + // open pack file + $pack_file = fopen( + $git_folder . '/objects/pack/' . $pack_name, 'rb' + ); + if ($pack_file === false) { + continue; + } + // seek to start + fseek($pack_file, $pack_offset); + + // parse header + $header = ord(fread($pack_file, 1)); + $type = ($header >> 4) & 7; + $hasnext = ($header & 128) >> 7; + $size = $header & 0xf; + $offset = 4; + + while ($hasnext) { + $byte = ord(fread($pack_file, 1)); + $size |= ($byte & 0x7f) << $offset; + $hasnext = ($byte & 128) >> 7; + $offset += 7; + } + + // we care only about commit objects + if ($type != 1) { + continue; + } + + // read data + $commit = fread($pack_file, $size); + $commit = gzuncompress($commit); + $commit = explode("\n", $commit); + $_SESSION['PMA_VERSION_COMMITDATA_' . $hash] = $commit; + fclose($pack_file); + } + } + } + + $httpRequest = new HttpRequest(); + + // check if commit exists in Github + if ($commit !== false + && isset($_SESSION['PMA_VERSION_REMOTECOMMIT_' . $hash]) + ) { + $is_remote_commit = $_SESSION['PMA_VERSION_REMOTECOMMIT_' . $hash]; + } else { + $link = 'https://www.phpmyadmin.net/api/commit/' . $hash . '/'; + $is_found = $httpRequest->create($link, 'GET'); + switch($is_found) { + case false: + $is_remote_commit = false; + $_SESSION['PMA_VERSION_REMOTECOMMIT_' . $hash] = false; + break; + case null: + // no remote link for now, but don't cache this as Github is down + $is_remote_commit = false; + break; + default: + $is_remote_commit = true; + $_SESSION['PMA_VERSION_REMOTECOMMIT_' . $hash] = true; + if ($commit === false) { + // if no local commit data, try loading from Github + $commit_json = json_decode($is_found); + } + break; + } + } + + $is_remote_branch = false; + if ($is_remote_commit && $branch !== false) { + // check if branch exists in Github + if (isset($_SESSION['PMA_VERSION_REMOTEBRANCH_' . $hash])) { + $is_remote_branch = $_SESSION['PMA_VERSION_REMOTEBRANCH_' . $hash]; + } else { + $link = 'https://www.phpmyadmin.net/api/tree/' . $branch . '/'; + $is_found = $httpRequest->create($link, 'GET', true); + switch($is_found) { + case true: + $is_remote_branch = true; + $_SESSION['PMA_VERSION_REMOTEBRANCH_' . $hash] = true; + break; + case false: + $is_remote_branch = false; + $_SESSION['PMA_VERSION_REMOTEBRANCH_' . $hash] = false; + break; + case null: + // no remote link for now, but don't cache this as Github is down + $is_remote_branch = false; + break; + } + } + } + + if ($commit !== false) { + $author = array('name' => '', 'email' => '', 'date' => ''); + $committer = array('name' => '', 'email' => '', 'date' => ''); + + do { + $dataline = array_shift($commit); + $datalinearr = explode(' ', $dataline, 2); + $linetype = $datalinearr[0]; + if (in_array($linetype, array('author', 'committer'))) { + $user = $datalinearr[1]; + preg_match('/([^<]+)<([^>]+)> ([0-9]+)( [^ ]+)?/', $user, $user); + $user2 = array( + 'name' => trim($user[1]), + 'email' => trim($user[2]), + 'date' => date('Y-m-d H:i:s', $user[3])); + if (isset($user[4])) { + $user2['date'] .= $user[4]; + } + $$linetype = $user2; + } + } while ($dataline != ''); + $message = trim(implode(' ', $commit)); + + } elseif (isset($commit_json) && isset($commit_json->author) && isset($commit_json->committer) && isset($commit_json->message)) { + $author = array( + 'name' => $commit_json->author->name, + 'email' => $commit_json->author->email, + 'date' => $commit_json->author->date); + $committer = array( + 'name' => $commit_json->committer->name, + 'email' => $commit_json->committer->email, + 'date' => $commit_json->committer->date); + $message = trim($commit_json->message); + } else { + $this->set('PMA_VERSION_GIT', 0); + return; + } + + $this->set('PMA_VERSION_GIT', 1); + $this->set('PMA_VERSION_GIT_COMMITHASH', $hash); + $this->set('PMA_VERSION_GIT_BRANCH', $branch); + $this->set('PMA_VERSION_GIT_MESSAGE', $message); + $this->set('PMA_VERSION_GIT_AUTHOR', $author); + $this->set('PMA_VERSION_GIT_COMMITTER', $committer); + $this->set('PMA_VERSION_GIT_ISREMOTECOMMIT', $is_remote_commit); + $this->set('PMA_VERSION_GIT_ISREMOTEBRANCH', $is_remote_branch); + } + + /** + * loads default values from default source + * + * @return boolean success + */ + public function loadDefaults() + { + $cfg = array(); + if (! @file_exists($this->default_source)) { + $this->error_config_default_file = true; + return false; + } + $canUseErrorReporting = function_exists('error_reporting'); + if ($canUseErrorReporting) { + $old_error_reporting = error_reporting(0); + } + ob_start(); + $GLOBALS['pma_config_loading'] = true; + $eval_result = include $this->default_source; + $GLOBALS['pma_config_loading'] = false; + ob_end_clean(); + if ($canUseErrorReporting) { + error_reporting($old_error_reporting); + } + + if ($eval_result === false) { + $this->error_config_default_file = true; + return false; + } + + $this->default_source_mtime = filemtime($this->default_source); + + $this->default_server = $cfg['Servers'][1]; + unset($cfg['Servers']); + + $this->default = $cfg; + $this->settings = array_replace_recursive($this->settings, $cfg); + + $this->error_config_default_file = false; + + return true; + } + + /** + * loads configuration from $source, usually the config file + * should be called on object creation + * + * @param string $source config file + * + * @return bool + */ + public function load($source = null) + { + $this->loadDefaults(); + + if (null !== $source) { + $this->setSource($source); + } + + if (! $this->checkConfigSource()) { + return false; + } + + $cfg = array(); + + /** + * Parses the configuration file, we throw away any errors or + * output. + */ + $canUseErrorReporting = function_exists('error_reporting'); + if ($canUseErrorReporting) { + $old_error_reporting = error_reporting(0); + } + ob_start(); + $GLOBALS['pma_config_loading'] = true; + $eval_result = include $this->getSource(); + $GLOBALS['pma_config_loading'] = false; + ob_end_clean(); + if ($canUseErrorReporting) { + error_reporting($old_error_reporting); + } + + if ($eval_result === false) { + $this->error_config_file = true; + } else { + $this->error_config_file = false; + $this->source_mtime = filemtime($this->getSource()); + } + + /** + * Ignore keys with / as we do not use these + * + * These can be confusing for user configuration layer as it + * flatten array using / and thus don't see difference between + * $cfg['Export/method'] and $cfg['Export']['method'], while rest + * of thre code uses the setting only in latter form. + * + * This could be removed once we consistently handle both values + * in the functional code as well. + * + * It could use array_filter(...ARRAY_FILTER_USE_KEY), but it's not + * supported on PHP 5.5 and HHVM. + */ + $matched_keys = array_filter( + array_keys($cfg), + function ($key) {return strpos($key, '/') === false;} + ); + + $cfg = array_intersect_key($cfg, array_flip($matched_keys)); + + /** + * Backward compatibility code + */ + if (!empty($cfg['DefaultTabTable'])) { + $cfg['DefaultTabTable'] = str_replace( + '_properties', + '', + str_replace( + 'tbl_properties.php', + 'tbl_sql.php', + $cfg['DefaultTabTable'] + ) + ); + } + if (!empty($cfg['DefaultTabDatabase'])) { + $cfg['DefaultTabDatabase'] = str_replace( + '_details', + '', + str_replace( + 'db_details.php', + 'db_sql.php', + $cfg['DefaultTabDatabase'] + ) + ); + } + + $this->settings = array_replace_recursive($this->settings, $cfg); + + return true; + } + + /** + * Sets the connection collation + * + * @return void + */ + private function _setConnectionCollation() + { + $collation_connection = $this->get('DefaultConnectionCollation'); + if (! empty($collation_connection) + && $collation_connection != $GLOBALS['collation_connection'] + ) { + $GLOBALS['dbi']->setCollation($collation_connection); + } + } + + /** + * Loads user preferences and merges them with current config + * must be called after control connection has been established + * + * @return void + */ + public function loadUserPreferences() + { + // index.php should load these settings, so that phpmyadmin.css.php + // will have everything available in session cache + $server = isset($GLOBALS['server']) + ? $GLOBALS['server'] + : (!empty($GLOBALS['cfg']['ServerDefault']) + ? $GLOBALS['cfg']['ServerDefault'] + : 0); + $cache_key = 'server_' . $server; + if ($server > 0 && !defined('PMA_MINIMUM_COMMON')) { + $config_mtime = max($this->default_source_mtime, $this->source_mtime); + // cache user preferences, use database only when needed + if (! isset($_SESSION['cache'][$cache_key]['userprefs']) + || $_SESSION['cache'][$cache_key]['config_mtime'] < $config_mtime + ) { + $prefs = $this->userPreferences->load(); + $_SESSION['cache'][$cache_key]['userprefs'] + = $this->userPreferences->apply($prefs['config_data']); + $_SESSION['cache'][$cache_key]['userprefs_mtime'] = $prefs['mtime']; + $_SESSION['cache'][$cache_key]['userprefs_type'] = $prefs['type']; + $_SESSION['cache'][$cache_key]['config_mtime'] = $config_mtime; + } + } elseif ($server == 0 + || ! isset($_SESSION['cache'][$cache_key]['userprefs']) + ) { + $this->set('user_preferences', false); + return; + } + $config_data = $_SESSION['cache'][$cache_key]['userprefs']; + // type is 'db' or 'session' + $this->set( + 'user_preferences', + $_SESSION['cache'][$cache_key]['userprefs_type'] + ); + $this->set( + 'user_preferences_mtime', + $_SESSION['cache'][$cache_key]['userprefs_mtime'] + ); + + // load config array + $this->settings = array_replace_recursive($this->settings, $config_data); + $GLOBALS['cfg'] = array_replace_recursive($GLOBALS['cfg'], $config_data); + if (defined('PMA_MINIMUM_COMMON')) { + return; + } + + // settings below start really working on next page load, but + // changes are made only in index.php so everything is set when + // in frames + + // save theme + /** @var ThemeManager $tmanager */ + $tmanager = ThemeManager::getInstance(); + if ($tmanager->getThemeCookie() || isset($_REQUEST['set_theme'])) { + if ((! isset($config_data['ThemeDefault']) + && $tmanager->theme->getId() != 'original') + || isset($config_data['ThemeDefault']) + && $config_data['ThemeDefault'] != $tmanager->theme->getId() + ) { + // new theme was set in common.inc.php + $this->setUserValue( + null, + 'ThemeDefault', + $tmanager->theme->getId(), + 'original' + ); + } + } else { + // no cookie - read default from settings + if ($this->settings['ThemeDefault'] != $tmanager->theme->getId() + && $tmanager->checkTheme($this->settings['ThemeDefault']) + ) { + $tmanager->setActiveTheme($this->settings['ThemeDefault']); + $tmanager->setThemeCookie(); + } + } + + // save language + if ($this->issetCookie('pma_lang') || isset($_POST['lang'])) { + if ((! isset($config_data['lang']) + && $GLOBALS['lang'] != 'en') + || isset($config_data['lang']) + && $GLOBALS['lang'] != $config_data['lang'] + ) { + $this->setUserValue(null, 'lang', $GLOBALS['lang'], 'en'); + } + } else { + // read language from settings + if (isset($config_data['lang'])) { + $language = LanguageManager::getInstance()->getLanguage( + $config_data['lang'] + ); + if ($language !== false) { + $language->activate(); + $this->setCookie('pma_lang', $language->getCode()); + } + } + } + + // set connection collation + $this->_setConnectionCollation(); + } + + /** + * Sets config value which is stored in user preferences (if available) + * or in a cookie. + * + * If user preferences are not yet initialized, option is applied to + * global config and added to a update queue, which is processed + * by {@link loadUserPreferences()} + * + * @param string $cookie_name can be null + * @param string $cfg_path configuration path + * @param mixed $new_cfg_value new value + * @param mixed $default_value default value + * + * @return true|PhpMyAdmin\Message + */ + public function setUserValue($cookie_name, $cfg_path, $new_cfg_value, + $default_value = null + ) { + $result = true; + // use permanent user preferences if possible + $prefs_type = $this->get('user_preferences'); + if ($prefs_type) { + if ($default_value === null) { + $default_value = Core::arrayRead($cfg_path, $this->default); + } + $result = $this->userPreferences->persistOption($cfg_path, $new_cfg_value, $default_value); + } + if ($prefs_type != 'db' && $cookie_name) { + // fall back to cookies + if ($default_value === null) { + $default_value = Core::arrayRead($cfg_path, $this->settings); + } + $this->setCookie($cookie_name, $new_cfg_value, $default_value); + } + Core::arrayWrite($cfg_path, $GLOBALS['cfg'], $new_cfg_value); + Core::arrayWrite($cfg_path, $this->settings, $new_cfg_value); + return $result; + } + + /** + * Reads value stored by {@link setUserValue()} + * + * @param string $cookie_name cookie name + * @param mixed $cfg_value config value + * + * @return mixed + */ + public function getUserValue($cookie_name, $cfg_value) + { + $cookie_exists = isset($_COOKIE) && !empty($this->getCookie($cookie_name)); + $prefs_type = $this->get('user_preferences'); + if ($prefs_type == 'db') { + // permanent user preferences value exists, remove cookie + if ($cookie_exists) { + $this->removeCookie($cookie_name); + } + } elseif ($cookie_exists) { + return $this->getCookie($cookie_name); + } + // return value from $cfg array + return $cfg_value; + } + + /** + * set source + * + * @param string $source source + * + * @return void + */ + public function setSource($source) + { + $this->source = trim($source); + } + + /** + * check config source + * + * @return boolean whether source is valid or not + */ + public function checkConfigSource() + { + if (! $this->getSource()) { + // no configuration file set at all + return false; + } + + if (! @file_exists($this->getSource())) { + $this->source_mtime = 0; + return false; + } + + if (! @is_readable($this->getSource())) { + // manually check if file is readable + // might be bug #3059806 Supporting running from CIFS/Samba shares + + $contents = false; + $handle = @fopen($this->getSource(), 'r'); + if ($handle !== false) { + $contents = @fread($handle, 1); // reading 1 byte is enough to test + fclose($handle); + } + if ($contents === false) { + $this->source_mtime = 0; + Core::fatalError( + sprintf( + function_exists('__') + ? __('Existing configuration file (%s) is not readable.') + : 'Existing configuration file (%s) is not readable.', + $this->getSource() + ) + ); + return false; + } + } + + return true; + } + + /** + * verifies the permissions on config file (if asked by configuration) + * (must be called after config.inc.php has been merged) + * + * @return void + */ + public function checkPermissions() + { + // Check for permissions (on platforms that support it): + if ($this->get('CheckConfigurationPermissions') && @file_exists($this->getSource())) { + $perms = @fileperms($this->getSource()); + if (!($perms === false) && ($perms & 2)) { + // This check is normally done after loading configuration + $this->checkWebServerOs(); + if ($this->get('PMA_IS_WINDOWS') == 0) { + $this->source_mtime = 0; + Core::fatalError( + __( + 'Wrong permissions on configuration file, ' + . 'should not be world writable!' + ) + ); + } + } + } + } + + /** + * Checks for errors + * (must be called after config.inc.php has been merged) + * + * @return void + */ + public function checkErrors() + { + if ($this->error_config_default_file) { + Core::fatalError( + sprintf( + __('Could not load default configuration from: %1$s'), + $this->default_source + ) + ); + } + + if ($this->error_config_file) { + $error = '[strong]' . __('Failed to read configuration file!') . '[/strong]' + . '[br][br]' + . __( + 'This usually means there is a syntax error in it, ' + . 'please check any errors shown below.' + ) + . '[br][br]' + . '[conferr]'; + trigger_error($error, E_USER_ERROR); + } + } + + /** + * returns specific config setting + * + * @param string $setting config setting + * + * @return mixed value + */ + public function get($setting) + { + if (isset($this->settings[$setting])) { + return $this->settings[$setting]; + } + return null; + } + + /** + * sets configuration variable + * + * @param string $setting configuration option + * @param mixed $value new value for configuration option + * + * @return void + */ + public function set($setting, $value) + { + if (! isset($this->settings[$setting]) + || $this->settings[$setting] !== $value + ) { + $this->settings[$setting] = $value; + $this->set_mtime = time(); + } + } + + /** + * returns source for current config + * + * @return string config source + */ + public function getSource() + { + return $this->source; + } + + /** + * returns a unique value to force a CSS reload if either the config + * or the theme changes + * + * @return int Summary of unix timestamps and fontsize, + * to be unique on theme parameters change + */ + public function getThemeUniqueValue() + { + if (null !== $this->get('FontSize')) { + $fontsize = intval($this->get('FontSize')); + } else { + $fontsize = 0; + } + return ( + $fontsize + + $this->source_mtime + + $this->default_source_mtime + + $this->get('user_preferences_mtime') + + $GLOBALS['PMA_Theme']->mtime_info + + $GLOBALS['PMA_Theme']->filesize_info); + } + + /** + * checks if upload is enabled + * + * @return void + */ + public function checkUpload() + { + if (!ini_get('file_uploads')) { + $this->set('enable_upload', false); + return; + } + + $this->set('enable_upload', true); + // if set "php_admin_value file_uploads Off" in httpd.conf + // ini_get() also returns the string "Off" in this case: + if ('off' == strtolower(ini_get('file_uploads'))) { + $this->set('enable_upload', false); + } + } + + /** + * Maximum upload size as limited by PHP + * Used with permission from Moodle (https://moodle.org/) by Martin Dougiamas + * + * this section generates $max_upload_size in bytes + * + * @return void + */ + public function checkUploadSize() + { + if (! $filesize = ini_get('upload_max_filesize')) { + $filesize = "5M"; + } + + if ($postsize = ini_get('post_max_size')) { + $this->set( + 'max_upload_size', + min(Core::getRealSize($filesize), Core::getRealSize($postsize)) + ); + } else { + $this->set('max_upload_size', Core::getRealSize($filesize)); + } + } + + /** + * Checks if protocol is https + * + * This function checks if the https protocol on the active connection. + * + * @return bool + */ + public function isHttps() + { + + if (null !== $this->get('is_https')) { + return $this->get('is_https'); + } + + $url = $this->get('PmaAbsoluteUri'); + + $is_https = false; + if (! empty($url) && parse_url($url, PHP_URL_SCHEME) === 'https') { + $is_https = true; + } elseif (strtolower(Core::getenv('HTTP_SCHEME')) == 'https') { + $is_https = true; + } elseif (strtolower(Core::getenv('HTTPS')) == 'on') { + $is_https = true; + } elseif (substr(strtolower(Core::getenv('REQUEST_URI')), 0, 6) == 'https:') { + $is_https = true; + } elseif (strtolower(Core::getenv('HTTP_HTTPS_FROM_LB')) == 'on') { + // A10 Networks load balancer + $is_https = true; + } elseif (strtolower(Core::getenv('HTTP_FRONT_END_HTTPS')) == 'on') { + $is_https = true; + } elseif (strtolower(Core::getenv('HTTP_X_FORWARDED_PROTO')) == 'https') { + $is_https = true; + } elseif (strtolower(Core::getenv('HTTP_CLOUDFRONT_FORWARDED_PROTO')) === 'https') { + // Amazon CloudFront, issue #15621 + $is_https = true; + } elseif (Core::getenv('SERVER_PORT') == 443) { + $is_https = true; + } + + $this->set('is_https', $is_https); + + return $is_https; + } + + /** + * Get phpMyAdmin root path + * + * @return string + */ + public function getRootPath() + { + static $cookie_path = null; + + if (null !== $cookie_path && !defined('TESTSUITE')) { + return $cookie_path; + } + + $url = $this->get('PmaAbsoluteUri'); + + if (! empty($url)) { + $path = parse_url($url, PHP_URL_PATH); + if (! empty($path)) { + if (substr($path, -1) != '/') { + return $path . '/'; + } + return $path; + } + } + + $parsed_url = parse_url($GLOBALS['PMA_PHP_SELF']); + + $parts = explode( + '/', + rtrim(str_replace('\\', '/', $parsed_url['path']), '/') + ); + + /* Remove filename */ + if (substr($parts[count($parts) - 1], -4) == '.php') { + $parts = array_slice($parts, 0, count($parts) - 1); + } + + /* Remove extra path from javascript calls */ + if (defined('PMA_PATH_TO_BASEDIR')) { + $parts = array_slice($parts, 0, count($parts) - 1); + } + + $parts[] = ''; + + return implode('/', $parts); + } + + /** + * enables backward compatibility + * + * @return void + */ + public function enableBc() + { + $GLOBALS['cfg'] = $this->settings; + $GLOBALS['default_server'] = $this->default_server; + unset($this->default_server); + $GLOBALS['is_upload'] = $this->get('enable_upload'); + $GLOBALS['max_upload_size'] = $this->get('max_upload_size'); + $GLOBALS['is_https'] = $this->get('is_https'); + + $defines = array( + 'PMA_VERSION', + 'PMA_MAJOR_VERSION', + 'PMA_THEME_VERSION', + 'PMA_THEME_GENERATION', + 'PMA_IS_WINDOWS', + 'PMA_IS_GD2', + 'PMA_USR_OS', + 'PMA_USR_BROWSER_VER', + 'PMA_USR_BROWSER_AGENT' + ); + + foreach ($defines as $define) { + if (! defined($define)) { + define($define, $this->get($define)); + } + } + } + + /** + * returns options for font size selection + * + * @param string $current_size current selected font size with unit + * + * @return array selectable font sizes + */ + protected static function getFontsizeOptions($current_size = '82%') + { + $unit = preg_replace('/[0-9.]*/', '', $current_size); + $value = preg_replace('/[^0-9.]*/', '', $current_size); + + $factors = array(); + $options = array(); + $options["$value"] = $value . $unit; + + if ($unit === '%') { + $factors[] = 1; + $factors[] = 5; + $factors[] = 10; + $options['100'] = '100%'; + } elseif ($unit === 'em') { + $factors[] = 0.05; + $factors[] = 0.2; + $factors[] = 1; + } elseif ($unit === 'pt') { + $factors[] = 0.5; + $factors[] = 2; + } elseif ($unit === 'px') { + $factors[] = 1; + $factors[] = 5; + $factors[] = 10; + } else { + //unknown font size unit + $factors[] = 0.05; + $factors[] = 0.2; + $factors[] = 1; + $factors[] = 5; + $factors[] = 10; + } + + foreach ($factors as $key => $factor) { + $option_inc = $value + $factor; + $option_dec = $value - $factor; + while (count($options) < 21) { + $options["$option_inc"] = $option_inc . $unit; + if ($option_dec > $factors[0]) { + $options["$option_dec"] = $option_dec . $unit; + } + $option_inc += $factor; + $option_dec -= $factor; + if (isset($factors[$key + 1]) + && $option_inc >= $value + $factors[$key + 1] + ) { + break; + } + } + } + ksort($options); + return $options; + } + + /** + * returns html selectbox for font sizes + * + * @return string html selectbox + */ + protected static function getFontsizeSelection() + { + $current_size = $GLOBALS['PMA_Config']->get('FontSize'); + // for the case when there is no config file (this is supported) + if (empty($current_size)) { + $current_size = '82%'; + } + $options = Config::getFontsizeOptions($current_size); + + $return = '<label for="select_fontsize">' . __('Font size') + . ':</label>' . "\n" + . '<select name="set_fontsize" id="select_fontsize"' + . ' class="autosubmit">' . "\n"; + foreach ($options as $option) { + $return .= '<option value="' . $option . '"'; + if ($option == $current_size) { + $return .= ' selected="selected"'; + } + $return .= '>' . $option . '</option>' . "\n"; + } + $return .= '</select>'; + + return $return; + } + + /** + * return complete font size selection form + * + * @return string html selectbox + */ + public static function getFontsizeForm() + { + return '<form name="form_fontsize_selection" id="form_fontsize_selection"' + . ' method="post" action="index.php" class="disableAjax">' . "\n" + . Url::getHiddenInputs() . "\n" + . Config::getFontsizeSelection() . "\n" + . '</form>'; + } + + /** + * removes cookie + * + * @param string $cookieName name of cookie to remove + * + * @return boolean result of setcookie() + */ + public function removeCookie($cookieName) + { + $httpCookieName = $this->getCookieName($cookieName); + + if ($this->issetCookie($cookieName)) { + unset($_COOKIE[$httpCookieName]); + } + if (defined('TESTSUITE')) { + return true; + } + return setcookie( + $httpCookieName, + '', + time() - 3600, + $this->getRootPath(), + '', + $this->isHttps() + ); + } + + /** + * sets cookie if value is different from current cookie value, + * or removes if value is equal to default + * + * @param string $cookie name of cookie to remove + * @param mixed $value new cookie value + * @param string $default default value + * @param int $validity validity of cookie in seconds (default is one month) + * @param bool $httponly whether cookie is only for HTTP (and not for scripts) + * + * @return boolean result of setcookie() + */ + public function setCookie($cookie, $value, $default = null, + $validity = null, $httponly = true + ) { + if (strlen($value) > 0 && null !== $default && $value === $default + ) { + // default value is used + if ($this->issetCookie($cookie)) { + // remove cookie + return $this->removeCookie($cookie); + } + return false; + } + + if (strlen($value) === 0 && $this->issetCookie($cookie)) { + // remove cookie, value is empty + return $this->removeCookie($cookie); + } + + $httpCookieName = $this->getCookieName($cookie); + + if (! $this->issetCookie($cookie) || $this->getCookie($cookie) !== $value) { + // set cookie with new value + /* Calculate cookie validity */ + if ($validity === null) { + /* Valid for one month */ + $validity = time() + 2592000; + } elseif ($validity == 0) { + /* Valid for session */ + $validity = 0; + } else { + $validity = time() + $validity; + } + if (defined('TESTSUITE')) { + $_COOKIE[$httpCookieName] = $value; + return true; + } + return setcookie( + $httpCookieName, + $value, + $validity, + $this->getRootPath(), + '', + $this->isHttps(), + $httponly + ); + } + + // cookie has already $value as value + return true; + } + + /** + * get cookie + * + * @param string $cookieName The name of the cookie to get + * + * @return mixed result of getCookie() + */ + public function getCookie($cookieName) { + if (isset($_COOKIE[$this->getCookieName($cookieName)])) { + return $_COOKIE[$this->getCookieName($cookieName)]; + } else { + return null; + } + } + + /** + * Get the real cookie name + * + * @param string $cookieName The name of the cookie + * @return string + */ + public function getCookieName($cookieName) { + return $cookieName. ( ($this->isHttps()) ? '_https' : '' ); + } + + /** + * isset cookie + * + * @param string $cookieName The name of the cookie to check + * + * @return bool result of issetCookie() + */ + public function issetCookie($cookieName) { + return isset($_COOKIE[$this->getCookieName($cookieName)]); + } + + /** + * Error handler to catch fatal errors when loading configuration + * file + * + * + * PMA_Config_fatalErrorHandler + * @return void + */ + public static function fatalErrorHandler() + { + if (!isset($GLOBALS['pma_config_loading']) + || !$GLOBALS['pma_config_loading'] + ) { + return; + } + + $error = error_get_last(); + if ($error === null) { + return; + } + + Core::fatalError( + sprintf( + 'Failed to load phpMyAdmin configuration (%s:%s): %s', + Error::relPath($error['file']), + $error['line'], + $error['message'] + ) + ); + } + + /** + * Wrapper for footer/header rendering + * + * @param string $filename File to check and render + * @param string $id Div ID + * + * @return string + */ + private static function _renderCustom($filename, $id) + { + $retval = ''; + if (@file_exists($filename)) { + $retval .= '<div id="' . $id . '">'; + ob_start(); + include $filename; + $retval .= ob_get_contents(); + ob_end_clean(); + $retval .= '</div>'; + } + return $retval; + } + + /** + * Renders user configured footer + * + * @return string + */ + public static function renderFooter() + { + return self::_renderCustom(CUSTOM_FOOTER_FILE, 'pma_footer'); + } + + /** + * Renders user configured footer + * + * @return string + */ + public static function renderHeader() + { + return self::_renderCustom(CUSTOM_HEADER_FILE, 'pma_header'); + } + + /** + * Returns temporary dir path + * + * @param string $name Directory name + * + * @return string|null + */ + public function getTempDir($name) + { + static $temp_dir = array(); + + if (isset($temp_dir[$name]) && !defined('TESTSUITE')) { + return $temp_dir[$name]; + } + + $path = $this->get('TempDir'); + if (empty($path)) { + $path = null; + } else { + $path .= '/' . $name; + if (! @is_dir($path)) { + @mkdir($path, 0770, true); + } + if (! @is_dir($path) || ! @is_writable($path)) { + $path = null; + } + } + + $temp_dir[$name] = $path; + return $path; + } + + /** + * Returns temporary directory + * + * @return string + */ + public function getUploadTempDir() + { + // First try configured temp dir + // Fallback to PHP upload_tmp_dir + $dirs = array( + $this->getTempDir('upload'), + ini_get('upload_tmp_dir'), + sys_get_temp_dir(), + ); + + foreach ($dirs as $dir) { + if (! empty($dir) && @is_writable($dir)) { + return realpath($dir); + } + } + + return null; + } + + /** + * Selects server based on request parameters. + * + * @return integer + */ + public function selectServer() { + $server = 0; + $request = empty($_REQUEST['server']) ? 0 : $_REQUEST['server']; + + /** + * Lookup server by name + * (see FAQ 4.8) + */ + if (! is_numeric($request)) { + foreach ($this->settings['Servers'] as $i => $server) { + $verboseToLower = mb_strtolower($server['verbose']); + $serverToLower = mb_strtolower($request); + if ($server['host'] == $request + || $server['verbose'] == $request + || $verboseToLower == $serverToLower + || md5($verboseToLower) === $serverToLower + ) { + $request = $i; + break; + } + } + if (is_string($request)) { + $request = 0; + } + } + + /** + * If no server is selected, make sure that $this->settings['Server'] is empty (so + * that nothing will work), and skip server authentication. + * We do NOT exit here, but continue on without logging into any server. + * This way, the welcome page will still come up (with no server info) and + * present a choice of servers in the case that there are multiple servers + * and '$this->settings['ServerDefault'] = 0' is set. + */ + + if (is_numeric($request) && ! empty($request) && ! empty($this->settings['Servers'][$request])) { + $server = $request; + $this->settings['Server'] = $this->settings['Servers'][$server]; + } else { + if (!empty($this->settings['Servers'][$this->settings['ServerDefault']])) { + $server = $this->settings['ServerDefault']; + $this->settings['Server'] = $this->settings['Servers'][$server]; + } else { + $server = 0; + $this->settings['Server'] = array(); + } + } + + return $server; + } + + /** + * Checks whether Servers configuration is valid and possibly apply fixups. + * + * @return void + */ + public function checkServers() { + // Do we have some server? + if (! isset($this->settings['Servers']) || count($this->settings['Servers']) == 0) { + // No server => create one with defaults + $this->settings['Servers'] = array(1 => $this->default_server); + } else { + // We have server(s) => apply default configuration + $new_servers = array(); + + foreach ($this->settings['Servers'] as $server_index => $each_server) { + + // Detect wrong configuration + if (!is_int($server_index) || $server_index < 1) { + trigger_error( + sprintf(__('Invalid server index: %s'), $server_index), + E_USER_ERROR + ); + } + + $each_server = array_merge($this->default_server, $each_server); + + // Final solution to bug #582890 + // If we are using a socket connection + // and there is nothing in the verbose server name + // or the host field, then generate a name for the server + // in the form of "Server 2", localized of course! + if (empty($each_server['host']) && empty($each_server['verbose'])) { + $each_server['verbose'] = sprintf(__('Server %d'), $server_index); + } + + $new_servers[$server_index] = $each_server; + } + $this->settings['Servers'] = $new_servers; + } + } +} + +if (!defined('TESTSUITE')) { + register_shutdown_function(array('PhpMyAdmin\Config', 'fatalErrorHandler')); +} diff --git a/phpMyAdmin/libraries/classes/Config/ConfigFile.php b/phpMyAdmin/libraries/classes/Config/ConfigFile.php new file mode 100755 index 0000000..5e4e712 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/ConfigFile.php @@ -0,0 +1,531 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Config file management + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config; + +use PhpMyAdmin\Config; +use PhpMyAdmin\Core; + +/** + * Config file management class. + * Stores its data in $_SESSION + * + * @package PhpMyAdmin + */ +class ConfigFile +{ + /** + * Stores default PMA config from config.default.php + * @var array + */ + private $_defaultCfg; + + /** + * Stores allowed values for non-standard fields + * @var array + */ + private $_cfgDb; + + /** + * Stores original PMA config, not modified by user preferences + * @var Config + */ + private $_baseCfg; + + /** + * Whether we are currently working in PMA Setup context + * @var bool + */ + private $_isInSetup; + + /** + * Keys which will be always written to config file + * @var array + */ + private $_persistKeys = array(); + + /** + * Changes keys while updating config in {@link updateWithGlobalConfig()} + * or reading by {@link getConfig()} or {@link getConfigArray()} + * @var array + */ + private $_cfgUpdateReadMapping = array(); + + /** + * Key filter for {@link set()} + * @var array|null + */ + private $_setFilter; + + /** + * Instance id (key in $_SESSION array, separate for each server - + * ConfigFile{server id}) + * @var string + */ + private $_id; + + /** + * Result for {@link _flattenArray()} + * @var array|null + */ + private $_flattenArrayResult; + + /** + * Constructor + * + * @param array|null $base_config base configuration read from + * {@link PhpMyAdmin\Config::$base_config}, + * use only when not in PMA Setup + */ + public function __construct($base_config = null) + { + // load default config values + $cfg = &$this->_defaultCfg; + include './libraries/config.default.php'; + $cfg['fontsize'] = '82%'; + + // load additional config information + $cfg_db = &$this->_cfgDb; + include './libraries/config.values.php'; + + // apply default values overrides + if (count($cfg_db['_overrides'])) { + foreach ($cfg_db['_overrides'] as $path => $value) { + Core::arrayWrite($path, $cfg, $value); + } + } + + $this->_baseCfg = $base_config; + $this->_isInSetup = is_null($base_config); + $this->_id = 'ConfigFile' . $GLOBALS['server']; + if (!isset($_SESSION[$this->_id])) { + $_SESSION[$this->_id] = array(); + } + } + + /** + * Sets names of config options which will be placed in config file even if + * they are set to their default values (use only full paths) + * + * @param array $keys the names of the config options + * + * @return void + */ + public function setPersistKeys(array $keys) + { + // checking key presence is much faster than searching so move values + // to keys + $this->_persistKeys = array_flip($keys); + } + + /** + * Returns flipped array set by {@link setPersistKeys()} + * + * @return array + */ + public function getPersistKeysMap() + { + return $this->_persistKeys; + } + + /** + * By default ConfigFile allows setting of all configuration keys, use + * this method to set up a filter on {@link set()} method + * + * @param array|null $keys array of allowed keys or null to remove filter + * + * @return void + */ + public function setAllowedKeys($keys) + { + if ($keys === null) { + $this->_setFilter = null; + return; + } + // checking key presence is much faster than searching so move values + // to keys + $this->_setFilter = array_flip($keys); + } + + /** + * Sets path mapping for updating config in + * {@link updateWithGlobalConfig()} or reading + * by {@link getConfig()} or {@link getConfigArray()} + * + * @param array $mapping Contains the mapping of "Server/config options" + * to "Server/1/config options" + * + * @return void + */ + public function setCfgUpdateReadMapping(array $mapping) + { + $this->_cfgUpdateReadMapping = $mapping; + } + + /** + * Resets configuration data + * + * @return void + */ + public function resetConfigData() + { + $_SESSION[$this->_id] = array(); + } + + /** + * Sets configuration data (overrides old data) + * + * @param array $cfg Configuration options + * + * @return void + */ + public function setConfigData(array $cfg) + { + $_SESSION[$this->_id] = $cfg; + } + + /** + * Sets config value + * + * @param string $path Path + * @param mixed $value Value + * @param string $canonical_path Canonical path + * + * @return void + */ + public function set($path, $value, $canonical_path = null) + { + if ($canonical_path === null) { + $canonical_path = $this->getCanonicalPath($path); + } + // apply key whitelist + if ($this->_setFilter !== null + && ! isset($this->_setFilter[$canonical_path]) + ) { + return; + } + // if the path isn't protected it may be removed + if (isset($this->_persistKeys[$canonical_path])) { + Core::arrayWrite($path, $_SESSION[$this->_id], $value); + return; + } + + $default_value = $this->getDefault($canonical_path); + $remove_path = $value === $default_value; + if ($this->_isInSetup) { + // remove if it has a default value or is empty + $remove_path = $remove_path + || (empty($value) && empty($default_value)); + } else { + // get original config values not overwritten by user + // preferences to allow for overwriting options set in + // config.inc.php with default values + $instance_default_value = Core::arrayRead( + $canonical_path, + $this->_baseCfg + ); + // remove if it has a default value and base config (config.inc.php) + // uses default value + $remove_path = $remove_path + && ($instance_default_value === $default_value); + } + if ($remove_path) { + Core::arrayRemove($path, $_SESSION[$this->_id]); + return; + } + + Core::arrayWrite($path, $_SESSION[$this->_id], $value); + } + + /** + * Flattens multidimensional array, changes indices to paths + * (eg. 'key/subkey'). + * Used as array_walk() callback. + * + * @param mixed $value Value + * @param mixed $key Key + * @param mixed $prefix Prefix + * + * @return void + */ + private function _flattenArray($value, $key, $prefix) + { + // no recursion for numeric arrays + if (is_array($value) && !isset($value[0])) { + $prefix .= $key . '/'; + array_walk($value, array($this, '_flattenArray'), $prefix); + } else { + $this->_flattenArrayResult[$prefix . $key] = $value; + } + } + + /** + * Returns default config in a flattened array + * + * @return array + */ + public function getFlatDefaultConfig() + { + $this->_flattenArrayResult = array(); + array_walk($this->_defaultCfg, array($this, '_flattenArray'), ''); + $flat_cfg = $this->_flattenArrayResult; + $this->_flattenArrayResult = null; + return $flat_cfg; + } + + /** + * Updates config with values read from given array + * (config will contain differences to defaults from config.defaults.php). + * + * @param array $cfg Configuration + * + * @return void + */ + public function updateWithGlobalConfig(array $cfg) + { + // load config array and flatten it + $this->_flattenArrayResult = array(); + array_walk($cfg, array($this, '_flattenArray'), ''); + $flat_cfg = $this->_flattenArrayResult; + $this->_flattenArrayResult = null; + + // save values map for translating a few user preferences paths, + // should be complemented by code reading from generated config + // to perform inverse mapping + foreach ($flat_cfg as $path => $value) { + if (isset($this->_cfgUpdateReadMapping[$path])) { + $path = $this->_cfgUpdateReadMapping[$path]; + } + $this->set($path, $value, $path); + } + } + + /** + * Returns config value or $default if it's not set + * + * @param string $path Path of config file + * @param mixed $default Default values + * + * @return mixed + */ + public function get($path, $default = null) + { + return Core::arrayRead($path, $_SESSION[$this->_id], $default); + } + + /** + * Returns default config value or $default it it's not set ie. it doesn't + * exist in config.default.php ($cfg) and config.values.php + * ($_cfg_db['_overrides']) + * + * @param string $canonical_path Canonical path + * @param mixed $default Default value + * + * @return mixed + */ + public function getDefault($canonical_path, $default = null) + { + return Core::arrayRead($canonical_path, $this->_defaultCfg, $default); + } + + /** + * Returns config value, if it's not set uses the default one; returns + * $default if the path isn't set and doesn't contain a default value + * + * @param string $path Path + * @param mixed $default Default value + * + * @return mixed + */ + public function getValue($path, $default = null) + { + $v = Core::arrayRead($path, $_SESSION[$this->_id], null); + if ($v !== null) { + return $v; + } + $path = $this->getCanonicalPath($path); + return $this->getDefault($path, $default); + } + + /** + * Returns canonical path + * + * @param string $path Path + * + * @return string + */ + public function getCanonicalPath($path) + { + return preg_replace('#^Servers/([\d]+)/#', 'Servers/1/', $path); + } + + /** + * Returns config database entry for $path ($cfg_db in config_info.php) + * + * @param string $path path of the variable in config db + * @param mixed $default default value + * + * @return mixed + */ + public function getDbEntry($path, $default = null) + { + return Core::arrayRead($path, $this->_cfgDb, $default); + } + + /** + * Returns server count + * + * @return int + */ + public function getServerCount() + { + return isset($_SESSION[$this->_id]['Servers']) + ? count($_SESSION[$this->_id]['Servers']) + : 0; + } + + /** + * Returns server list + * + * @return array|null + */ + public function getServers() + { + return isset($_SESSION[$this->_id]['Servers']) + ? $_SESSION[$this->_id]['Servers'] + : null; + } + + /** + * Returns DSN of given server + * + * @param integer $server server index + * + * @return string + */ + public function getServerDSN($server) + { + if (!isset($_SESSION[$this->_id]['Servers'][$server])) { + return ''; + } + + $path = 'Servers/' . $server; + $dsn = 'mysqli://'; + if ($this->getValue("$path/auth_type") == 'config') { + $dsn .= $this->getValue("$path/user"); + if (! empty($this->getValue("$path/password"))) { + $dsn .= ':***'; + } + $dsn .= '@'; + } + if ($this->getValue("$path/host") != 'localhost') { + $dsn .= $this->getValue("$path/host"); + $port = $this->getValue("$path/port"); + if ($port) { + $dsn .= ':' . $port; + } + } else { + $dsn .= $this->getValue("$path/socket"); + } + return $dsn; + } + + /** + * Returns server name + * + * @param int $id server index + * + * @return string + */ + public function getServerName($id) + { + if (!isset($_SESSION[$this->_id]['Servers'][$id])) { + return ''; + } + $verbose = $this->get("Servers/$id/verbose"); + if (!empty($verbose)) { + return $verbose; + } + $host = $this->get("Servers/$id/host"); + return empty($host) ? 'localhost' : $host; + } + + /** + * Removes server + * + * @param int $server server index + * + * @return void + */ + public function removeServer($server) + { + if (!isset($_SESSION[$this->_id]['Servers'][$server])) { + return; + } + $last_server = $this->getServerCount(); + + for ($i = $server; $i < $last_server; $i++) { + $_SESSION[$this->_id]['Servers'][$i] + = $_SESSION[$this->_id]['Servers'][$i + 1]; + } + unset($_SESSION[$this->_id]['Servers'][$last_server]); + + if (isset($_SESSION[$this->_id]['ServerDefault']) + && $_SESSION[$this->_id]['ServerDefault'] == $last_server + ) { + unset($_SESSION[$this->_id]['ServerDefault']); + } + } + + /** + * Returns configuration array (full, multidimensional format) + * + * @return array + */ + public function getConfig() + { + $c = $_SESSION[$this->_id]; + foreach ($this->_cfgUpdateReadMapping as $map_to => $map_from) { + // if the key $c exists in $map_to + if (Core::arrayRead($map_to, $c) !== null) { + Core::arrayWrite($map_to, $c, Core::arrayRead($map_from, $c)); + Core::arrayRemove($map_from, $c); + } + } + return $c; + } + + /** + * Returns configuration array (flat format) + * + * @return array + */ + public function getConfigArray() + { + $this->_flattenArrayResult = array(); + array_walk($_SESSION[$this->_id], array($this, '_flattenArray'), ''); + $c = $this->_flattenArrayResult; + $this->_flattenArrayResult = null; + + $persistKeys = array_diff( + array_keys($this->_persistKeys), + array_keys($c) + ); + foreach ($persistKeys as $k) { + $c[$k] = $this->getDefault($this->getCanonicalPath($k)); + } + + foreach ($this->_cfgUpdateReadMapping as $map_to => $map_from) { + if (!isset($c[$map_from])) { + continue; + } + $c[$map_to] = $c[$map_from]; + unset($c[$map_from]); + } + return $c; + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Descriptions.php b/phpMyAdmin/libraries/classes/Config/Descriptions.php new file mode 100755 index 0000000..37fc5c2 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Descriptions.php @@ -0,0 +1,1493 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Verbose descriptions for settings. + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config; + +use PhpMyAdmin\Sanitize; + +/** + * Base class for forms, loads default configuration options, checks allowed + * values etc. + * + * @package PhpMyAdmin + */ +class Descriptions +{ + /** + * Return + * Return name or description for a configuration path. + * + * @param string $path Path of configuration + * @param string $type Type of message, either 'name', 'cmt' or 'desc' + * + * @return string + */ + public static function get($path, $type = 'name') + { + $key = str_replace( + array('Servers/1/', '/'), + array('Servers/', '_'), + $path + ); + $value = self::getString($key, $type); + + /* Fallback to path for name and empty string for description and comment */ + if (is_null($value)) { + if ($type == 'name') { + $value = $path; + } else { + $value = ''; + } + } + + return Sanitize::sanitize($value); + } + + /** + * Return name or description for a cleaned up configuration path. + * + * @param string $path Path of configuration + * @param string $type Type of message, either 'name', 'cmt' or 'desc' + * + * @return string|null Null if not found + */ + public static function getString($path, $type = 'name') + { + switch ($path . '_' . $type) { + case 'AllowArbitraryServer_desc': + return __('If enabled, user can enter any MySQL server in login form for cookie auth.'); + case 'AllowArbitraryServer_name': + return __('Allow login to any MySQL server'); + case 'ArbitraryServerRegexp_desc': + return __( + 'Restricts the MySQL servers the user can enter when a login to an arbitrary ' + . 'MySQL server is enabled by matching the IP or hostname of the MySQL server ' . + 'to the given regular expression.' + ); + case 'ArbitraryServerRegexp_name': + return __('Restrict login to MySQL server'); + case 'AllowThirdPartyFraming_desc': + return __( + 'Enabling this allows a page located on a different domain to call phpMyAdmin ' + . 'inside a frame, and is a potential [strong]security hole[/strong] allowing ' + . 'cross-frame scripting (XSS) attacks.' + ); + case 'AllowThirdPartyFraming_name': + return __('Allow third party framing'); + case 'AllowUserDropDatabase_name': + return __('Show "Drop database" link to normal users'); + case 'blowfish_secret_desc': + return __( + 'Secret passphrase used for encrypting cookies in [kbd]cookie[/kbd] ' + . 'authentication.' + ); + case 'blowfish_secret_name': + return __('Blowfish secret'); + case 'BrowseMarkerEnable_desc': + return __('Highlight selected rows.'); + case 'BrowseMarkerEnable_name': + return __('Row marker'); + case 'BrowsePointerEnable_desc': + return __('Highlight row pointed by the mouse cursor.'); + case 'BrowsePointerEnable_name': + return __('Highlight pointer'); + case 'BZipDump_desc': + return __( + 'Enable bzip2 compression for' + . ' import operations.' + ); + case 'BZipDump_name': + return __('Bzip2'); + case 'CharEditing_desc': + return __( + 'Defines which type of editing controls should be used for CHAR and VARCHAR ' + . 'columns; [kbd]input[/kbd] - allows limiting of input length, ' + . '[kbd]textarea[/kbd] - allows newlines in columns.' + ); + case 'CharEditing_name': + return __('CHAR columns editing'); + case 'CodemirrorEnable_desc': + return __( + 'Use user-friendly editor for editing SQL queries ' + . '(CodeMirror) with syntax highlighting and ' + . 'line numbers.' + ); + case 'CodemirrorEnable_name': + return __('Enable CodeMirror'); + case 'LintEnable_desc': + return __( + 'Find any errors in the query before executing it.' + . ' Requires CodeMirror to be enabled.' + ); + case 'LintEnable_name': + return __('Enable linter'); + case 'MinSizeForInputField_desc': + return __( + 'Defines the minimum size for input fields generated for CHAR and VARCHAR ' + . 'columns.' + ); + case 'MinSizeForInputField_name': + return __('Minimum size for input field'); + case 'MaxSizeForInputField_desc': + return __( + 'Defines the maximum size for input fields generated for CHAR and VARCHAR ' + . 'columns.' + ); + case 'MaxSizeForInputField_name': + return __('Maximum size for input field'); + case 'CharTextareaCols_desc': + return __('Number of columns for CHAR/VARCHAR textareas.'); + case 'CharTextareaCols_name': + return __('CHAR textarea columns'); + case 'CharTextareaRows_desc': + return __('Number of rows for CHAR/VARCHAR textareas.'); + case 'CharTextareaRows_name': + return __('CHAR textarea rows'); + case 'CheckConfigurationPermissions_name': + return __('Check config file permissions'); + case 'CompressOnFly_desc': + return __( + 'Compress gzip exports on the fly without the need for much memory; if ' + . 'you encounter problems with created gzip files disable this feature.' + ); + case 'CompressOnFly_name': + return __('Compress on the fly'); + case 'Confirm_desc': + return __( + 'Whether a warning ("Are your really sure鈥�") should be displayed ' + . 'when you\'re about to lose data.' + ); + case 'Confirm_name': + return __('Confirm DROP queries'); + case 'DBG_sql_desc': + return __('Log SQL queries and their execution time, to be displayed in the console'); + case 'DBG_sql_name': + return __('Debug SQL'); + case 'DefaultTabDatabase_desc': + return __('Tab that is displayed when entering a database.'); + case 'DefaultTabDatabase_name': + return __('Default database tab'); + case 'DefaultTabServer_desc': + return __('Tab that is displayed when entering a server.'); + case 'DefaultTabServer_name': + return __('Default server tab'); + case 'DefaultTabTable_desc': + return __('Tab that is displayed when entering a table.'); + case 'DefaultTabTable_name': + return __('Default table tab'); + case 'EnableAutocompleteForTablesAndColumns_desc': + return __('Autocomplete of the table and column names in the SQL queries.'); + case 'EnableAutocompleteForTablesAndColumns_name': + return __('Enable autocomplete for table and column names'); + case 'HideStructureActions_desc': + return __('Whether the table structure actions should be hidden.'); + case 'ShowColumnComments_name': + return __('Show column comments'); + case 'ShowColumnComments_desc': + return __('Whether column comments should be shown in table structure view'); + case 'HideStructureActions_name': + return __('Hide table structure actions'); + case 'DefaultTransformations_Hex_name': + return __('Default transformations for Hex'); + case 'DefaultTransformations_Hex_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + case 'DefaultTransformations_Substring_name': + return __('Default transformations for Substring'); + case 'DefaultTransformations_Substring_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + case 'DefaultTransformations_Bool2Text_name': + return __('Default transformations for Bool2Text'); + case 'DefaultTransformations_Bool2Text_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + case 'DefaultTransformations_External_name': + return __('Default transformations for External'); + case 'DefaultTransformations_External_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + case 'DefaultTransformations_PreApPend_name': + return __('Default transformations for PreApPend'); + case 'DefaultTransformations_PreApPend_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + case 'DefaultTransformations_DateFormat_name': + return __('Default transformations for DateFormat'); + case 'DefaultTransformations_DateFormat_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + case 'DefaultTransformations_Inline_name': + return __('Default transformations for Inline'); + case 'DefaultTransformations_Inline_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + case 'DefaultTransformations_TextImageLink_name': + return __('Default transformations for TextImageLink'); + case 'DefaultTransformations_TextImageLink_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + case 'DefaultTransformations_TextLink_name': + return __('Default transformations for TextLink'); + case 'DefaultTransformations_TextLink_desc': + return __('Values for options list for default transformations. These will be overwritten if transformation is filled in at table structure page.'); + + case 'DisplayServersList_desc': + return __('Show server listing as a list instead of a drop down.'); + case 'DisplayServersList_name': + return __('Display servers as a list'); + case 'DisableMultiTableMaintenance_desc': + return __( + 'Disable the table maintenance mass operations, like optimizing or repairing ' + . 'the selected tables of a database.' + ); + case 'DisableMultiTableMaintenance_name': + return __('Disable multi table maintenance'); + case 'ExecTimeLimit_desc': + return __( + 'Set the number of seconds a script is allowed to run ([kbd]0[/kbd] for no ' + . 'limit).' + ); + case 'ExecTimeLimit_name': + return __('Maximum execution time'); + case 'Export_lock_tables_name': + return sprintf( + __('Use %s statement'), htmlspecialchars('<code>LOCK TABLES</code>') + ); + case 'Export_asfile_name': + return __('Save as file'); + case 'Export_charset_name': + return __('Character set of the file'); + case 'Export_codegen_format_name': + return __('Format'); + case 'Export_compression_name': + return __('Compression'); + case 'Export_csv_columns_name': + return __('Put columns names in the first row'); + case 'Export_csv_enclosed_name': + return __('Columns enclosed with'); + case 'Export_csv_escaped_name': + return __('Columns escaped with'); + case 'Export_csv_null_name': + return __('Replace NULL with'); + case 'Export_csv_removeCRLF_name': + return __('Remove CRLF characters within columns'); + case 'Export_csv_separator_name': + return __('Columns terminated with'); + case 'Export_csv_terminated_name': + return __('Lines terminated with'); + case 'Export_excel_columns_name': + return __('Put columns names in the first row'); + case 'Export_excel_edition_name': + return __('Excel edition'); + case 'Export_excel_null_name': + return __('Replace NULL with'); + case 'Export_excel_removeCRLF_name': + return __('Remove CRLF characters within columns'); + case 'Export_file_template_database_name': + return __('Database name template'); + case 'Export_file_template_server_name': + return __('Server name template'); + case 'Export_file_template_table_name': + return __('Table name template'); + case 'Export_format_name': + return __('Format'); + case 'Export_htmlword_columns_name': + return __('Put columns names in the first row'); + case 'Export_htmlword_null_name': + return __('Replace NULL with'); + case 'Export_htmlword_structure_or_data_name': + return __('Dump table'); + case 'Export_latex_caption_name': + return __('Include table caption'); + case 'Export_latex_columns_name': + return __('Put columns names in the first row'); + case 'Export_latex_comments_name': + return __('Comments'); + case 'Export_latex_data_caption_name': + return __('Table caption'); + case 'Export_latex_data_continued_caption_name': + return __('Continued table caption'); + case 'Export_latex_data_label_name': + return __('Label key'); + case 'Export_latex_mime_name': + return __('MIME type'); + case 'Export_latex_null_name': + return __('Replace NULL with'); + case 'Export_latex_relation_name': + return __('Relationships'); + case 'Export_latex_structure_caption_name': + return __('Table caption'); + case 'Export_latex_structure_continued_caption_name': + return __('Continued table caption'); + case 'Export_latex_structure_label_name': + return __('Label key'); + case 'Export_latex_structure_or_data_name': + return __('Dump table'); + case 'Export_method_name': + return __('Export method'); + case 'Export_ods_columns_name': + return __('Put columns names in the first row'); + case 'Export_ods_null_name': + return __('Replace NULL with'); + case 'Export_odt_columns_name': + return __('Put columns names in the first row'); + case 'Export_odt_comments_name': + return __('Comments'); + case 'Export_odt_mime_name': + return __('MIME type'); + case 'Export_odt_null_name': + return __('Replace NULL with'); + case 'Export_odt_relation_name': + return __('Relationships'); + case 'Export_odt_structure_or_data_name': + return __('Dump table'); + case 'Export_onserver_name': + return __('Save on server'); + case 'Export_onserver_overwrite_name': + return __('Overwrite existing file(s)'); + case 'Export_as_separate_files_name': + return __('Export as separate files'); + case 'Export_quick_export_onserver_name': + return __('Save on server'); + case 'Export_quick_export_onserver_overwrite_name': + return __('Overwrite existing file(s)'); + case 'Export_remember_file_template_name': + return __('Remember file name template'); + case 'Export_sql_auto_increment_name': + return __('Add AUTO_INCREMENT value'); + case 'Export_sql_backquotes_name': + return __('Enclose table and column names with backquotes'); + case 'Export_sql_compatibility_name': + return __('SQL compatibility mode'); + case 'Export_sql_dates_name': + return __('Creation/Update/Check dates'); + case 'Export_sql_delayed_name': + return __('Use delayed inserts'); + case 'Export_sql_disable_fk_name': + return __('Disable foreign key checks'); + case 'Export_sql_views_as_tables_name': + return __('Export views as tables'); + case 'Export_sql_metadata_name': + return __('Export related metadata from phpMyAdmin configuration storage'); + case 'Export_sql_create_database_name': + return sprintf(__('Add %s'), 'CREATE DATABASE / USE'); + case 'Export_sql_drop_database_name': + return sprintf(__('Add %s'), 'DROP DATABASE'); + case 'Export_sql_drop_table_name': + return sprintf( + __('Add %s'), 'DROP TABLE / VIEW / PROCEDURE / FUNCTION / EVENT / TRIGGER' + ); + case 'Export_sql_create_table_name': + return sprintf(__('Add %s'), 'CREATE TABLE'); + case 'Export_sql_create_view_name': + return sprintf(__('Add %s'), 'CREATE VIEW'); + case 'Export_sql_create_trigger_name': + return sprintf(__('Add %s'), 'CREATE TRIGGER'); + case 'Export_sql_hex_for_binary_name': + return __('Use hexadecimal for BINARY & BLOB'); + case 'Export_sql_if_not_exists_name': + return __( + 'Add IF NOT EXISTS (less efficient as indexes will be generated during' + . ' table creation)' + ); + case 'Export_sql_ignore_name': + return __('Use ignore inserts'); + case 'Export_sql_include_comments_name': + return __('Comments'); + case 'Export_sql_insert_syntax_name': + return __('Syntax to use when inserting data'); + case 'Export_sql_max_query_size_name': + return __('Maximal length of created query'); + case 'Export_sql_mime_name': + return __('MIME type'); + case 'Export_sql_procedure_function_name': + return sprintf(__('Add %s'), 'CREATE PROCEDURE / FUNCTION / EVENT'); + case 'Export_sql_relation_name': + return __('Relationships'); + case 'Export_sql_structure_or_data_name': + return __('Dump table'); + case 'Export_sql_type_name': + return __('Export type'); + case 'Export_sql_use_transaction_name': + return __('Enclose export in a transaction'); + case 'Export_sql_utc_time_name': + return __('Export time in UTC'); + case 'Export_texytext_columns_name': + return __('Put columns names in the first row'); + case 'Export_texytext_null_name': + return __('Replace NULL with'); + case 'Export_texytext_structure_or_data_name': + return __('Dump table'); + case 'ForeignKeyDropdownOrder_desc': + return __( + 'Sort order for items in a foreign-key dropdown box; [kbd]content[/kbd] is ' + . 'the referenced data, [kbd]id[/kbd] is the key value.' + ); + case 'ForeignKeyDropdownOrder_name': + return __('Foreign key dropdown order'); + case 'ForeignKeyMaxLimit_desc': + return __('A dropdown will be used if fewer items are present.'); + case 'ForeignKeyMaxLimit_name': + return __('Foreign key limit'); + case 'DefaultForeignKeyChecks_desc': + return __('Default value for foreign key checks checkbox for some queries.'); + case 'DefaultForeignKeyChecks_name': + return __('Foreign key checks'); + case 'Form_Browse_name': + return __('Browse mode'); + case 'Form_Browse_desc': + return __('Customize browse mode.'); + case 'Form_CodeGen_name': + return 'CodeGen'; + case 'Form_CodeGen_desc': + return __('Customize default options.'); + case 'Form_Csv_name': + return __('CSV'); + case 'Form_Csv_desc': + return __('Customize default options.'); + case 'Form_Developer_name': + return __('Developer'); + case 'Form_Developer_desc': + return __('Settings for phpMyAdmin developers.'); + case 'Form_Edit_name': + return __('Edit mode'); + case 'Form_Edit_desc': + return __('Customize edit mode.'); + case 'Form_Export_defaults_name': + return __('Export defaults'); + case 'Form_Export_defaults_desc': + return __('Customize default export options.'); + case 'Form_General_name': + return __('General'); + case 'Form_General_desc': + return __('Set some commonly used options.'); + case 'Form_Import_defaults_name': + return __('Import defaults'); + case 'Form_Import_defaults_desc': + return __('Customize default common import options.'); + case 'Form_Import_export_name': + return __('Import / export'); + case 'Form_Import_export_desc': + return __('Set import and export directories and compression options.'); + case 'Form_Latex_name': + return __('LaTeX'); + case 'Form_Latex_desc': + return __('Customize default options.'); + case 'Form_Navi_databases_name': + return __('Databases'); + case 'Form_Navi_databases_desc': + return __('Databases display options.'); + case 'Form_Navi_panel_name': + return __('Navigation panel'); + case 'Form_Navi_panel_desc': + return __('Customize appearance of the navigation panel.'); + case 'Form_Navi_tree_name': + return __('Navigation tree'); + case 'Form_Navi_tree_desc': + return __('Customize the navigation tree.'); + case 'Form_Navi_servers_name': + return __('Servers'); + case 'Form_Navi_servers_desc': + return __('Servers display options.'); + case 'Form_Navi_tables_name': + return __('Tables'); + case 'Form_Navi_tables_desc': + return __('Tables display options.'); + case 'Form_Main_panel_name': + return __('Main panel'); + case 'Form_Microsoft_Office_name': + return __('Microsoft Office'); + case 'Form_Microsoft_Office_desc': + return __('Customize default options.'); + case 'Form_Open_Document_name': + return 'OpenDocument'; + case 'Form_Open_Document_desc': + return __('Customize default options.'); + case 'Form_Other_core_settings_name': + return __('Other core settings'); + case 'Form_Other_core_settings_desc': + return __('Settings that didn\'t fit anywhere else.'); + case 'Form_Page_titles_name': + return __('Page titles'); + case 'Form_Page_titles_desc': + return __( + 'Specify browser\'s title bar text. Refer to ' + . '[doc@faq6-27]documentation[/doc] for magic strings that can be used ' + . 'to get special values.' + ); + case 'Form_Security_name': + return __('Security'); + case 'Form_Security_desc': + return __( + 'Please note that phpMyAdmin is just a user interface and its features do not ' + . 'limit MySQL.' + ); + case 'Form_Server_name': + return __('Basic settings'); + case 'Form_Server_auth_name': + return __('Authentication'); + case 'Form_Server_auth_desc': + return __('Authentication settings.'); + case 'Form_Server_config_name': + return __('Server configuration'); + case 'Form_Server_config_desc': + return __( + 'Advanced server configuration, do not change these options unless you know ' + . 'what they are for.' + ); + case 'Form_Server_desc': + return __('Enter server connection parameters.'); + case 'Form_Server_pmadb_name': + return __('Configuration storage'); + case 'Form_Server_pmadb_desc': + return __( + 'Configure phpMyAdmin configuration storage to gain access to additional ' + . 'features, see [doc@linked-tables]phpMyAdmin configuration storage[/doc] in ' + . 'documentation.' + ); + case 'Form_Server_tracking_name': + return __('Changes tracking'); + case 'Form_Server_tracking_desc': + return __( + 'Tracking of changes made in database. Requires the phpMyAdmin configuration ' + . 'storage.' + ); + case 'Form_Sql_name': + return __('SQL'); + case 'Form_Sql_box_name': + return __('SQL Query box'); + case 'Form_Sql_box_desc': + return __('Customize links shown in SQL Query boxes.'); + case 'Form_Sql_desc': + return __('Customize default options.'); + case 'Form_Sql_queries_name': + return __('SQL queries'); + case 'Form_Sql_queries_desc': + return __('SQL queries settings.'); + case 'Form_Startup_name': + return __('Startup'); + case 'Form_Startup_desc': + return __('Customize startup page.'); + case 'Form_DbStructure_name': + return __('Database structure'); + case 'Form_DbStructure_desc': + return __('Choose which details to show in the database structure (list of tables).'); + case 'Form_TableStructure_name': + return __('Table structure'); + case 'Form_TableStructure_desc': + return __('Settings for the table structure (list of columns).'); + case 'Form_Tabs_name': + return __('Tabs'); + case 'Form_Tabs_desc': + return __('Choose how you want tabs to work.'); + case 'Form_DisplayRelationalSchema_name': + return __('Display relational schema'); + case 'Form_DisplayRelationalSchema_desc': + return ''; + case 'PDFDefaultPageSize_name': + return __('Paper size'); + case 'PDFDefaultPageSize_desc': + return ''; + case 'Form_Databases_name': + return __('Databases'); + case 'Form_Text_fields_name': + return __('Text fields'); + case 'Form_Text_fields_desc': + return __('Customize text input fields.'); + case 'Form_Texy_name': + return __('Texy! text'); + case 'Form_Texy_desc': + return __('Customize default options'); + case 'Form_Warnings_name': + return __('Warnings'); + case 'Form_Warnings_desc': + return __('Disable some of the warnings shown by phpMyAdmin.'); + case 'Form_Console_name': + return __('Console'); + case 'GZipDump_desc': + return __( + 'Enable gzip compression for import ' + . 'and export operations.' + ); + case 'GZipDump_name': + return __('GZip'); + case 'IconvExtraParams_name': + return __('Extra parameters for iconv'); + case 'IgnoreMultiSubmitErrors_desc': + return __( + 'If enabled, phpMyAdmin continues computing multiple-statement queries even if ' + . 'one of the queries failed.' + ); + case 'IgnoreMultiSubmitErrors_name': + return __('Ignore multiple statement errors'); + case 'Import_allow_interrupt_desc': + return __( + 'Allow interrupt of import in case script detects it is close to time limit. ' + . 'This might be a good way to import large files, however it can break ' + . 'transactions.' + ); + case 'Import_allow_interrupt_name': + return __('Partial import: allow interrupt'); + case 'Import_charset_name': + return __('Character set of the file'); + case 'Import_csv_col_names_name': + return __('Lines terminated with'); + case 'Import_csv_enclosed_name': + return __('Columns enclosed with'); + case 'Import_csv_escaped_name': + return __('Columns escaped with'); + case 'Import_csv_ignore_name': + return __('Do not abort on INSERT error'); + case 'Import_csv_replace_name': + return __('Add ON DUPLICATE KEY UPDATE'); + case 'Import_csv_replace_desc': + return __('Update data when duplicate keys found on import'); + case 'Import_csv_terminated_name': + return __('Columns terminated with'); + case 'Import_format_desc': + return __( + 'Default format; be aware that this list depends on location (database, table) ' + . 'and only SQL is always available.' + ); + case 'Import_format_name': + return __('Format of imported file'); + case 'Import_ldi_enclosed_name': + return __('Columns enclosed with'); + case 'Import_ldi_escaped_name': + return __('Columns escaped with'); + case 'Import_ldi_ignore_name': + return __('Do not abort on INSERT error'); + case 'Import_ldi_local_option_name': + return __('Use LOCAL keyword'); + case 'Import_ldi_replace_name': + return __('Add ON DUPLICATE KEY UPDATE'); + case 'Import_ldi_replace_desc': + return __('Update data when duplicate keys found on import'); + case 'Import_ldi_terminated_name': + return __('Columns terminated with'); + case 'Import_ods_col_names_name': + return __('Column names in first row'); + case 'Import_ods_empty_rows_name': + return __('Do not import empty rows'); + case 'Import_ods_recognize_currency_name': + return __('Import currencies ($5.00 to 5.00)'); + case 'Import_ods_recognize_percentages_name': + return __('Import percentages as proper decimals (12.00% to .12)'); + case 'Import_skip_queries_desc': + return __('Number of queries to skip from start.'); + case 'Import_skip_queries_name': + return __('Partial import: skip queries'); + case 'Import_sql_compatibility_name': + return __('SQL compatibility mode'); + case 'Import_sql_no_auto_value_on_zero_name': + return __('Do not use AUTO_INCREMENT for zero values'); + case 'Import_sql_read_as_multibytes_name': + return __('Read as multibytes'); + case 'InitialSlidersState_name': + return __('Initial state for sliders'); + case 'InsertRows_desc': + return __('How many rows can be inserted at one time.'); + case 'InsertRows_name': + return __('Number of inserted rows'); + case 'LimitChars_desc': + return __('Maximum number of characters shown in any non-numeric column on browse view.'); + case 'LimitChars_name': + return __('Limit column characters'); + case 'LoginCookieDeleteAll_desc': + return __( + 'If TRUE, logout deletes cookies for all servers; when set to FALSE, logout ' + . 'only occurs for the current server. Setting this to FALSE makes it easy to ' + . 'forget to log out from other servers when connected to multiple servers.' + ); + case 'LoginCookieDeleteAll_name': + return __('Delete all cookies on logout'); + case 'LoginCookieRecall_desc': + return __( + 'Define whether the previous login should be recalled or not in ' + . '[kbd]cookie[/kbd] authentication mode.' + ); + case 'LoginCookieRecall_name': + return __('Recall user name'); + case 'LoginCookieStore_desc': + return __( + 'Defines how long (in seconds) a login cookie should be stored in browser. ' + . 'The default of 0 means that it will be kept for the existing session only, ' + . 'and will be deleted as soon as you close the browser window. This is ' + . 'recommended for non-trusted environments.' + ); + case 'LoginCookieStore_name': + return __('Login cookie store'); + case 'LoginCookieValidity_desc': + return __('Define how long (in seconds) a login cookie is valid.'); + case 'LoginCookieValidity_name': + return __('Login cookie validity'); + case 'LongtextDoubleTextarea_desc': + return __('Double size of textarea for LONGTEXT columns.'); + case 'LongtextDoubleTextarea_name': + return __('Bigger textarea for LONGTEXT'); + case 'MaxCharactersInDisplayedSQL_desc': + return __('Maximum number of characters used when a SQL query is displayed.'); + case 'MaxCharactersInDisplayedSQL_name': + return __('Maximum displayed SQL length'); + case 'MaxDbList_cmt': + return __('Users cannot set a higher value'); + case 'MaxDbList_desc': + return __('Maximum number of databases displayed in database list.'); + case 'MaxDbList_name': + return __('Maximum databases'); + case 'FirstLevelNavigationItems_desc': + return __( + 'The number of items that can be displayed on each page on the first level' + . ' of the navigation tree.' + ); + case 'FirstLevelNavigationItems_name': + return __('Maximum items on first level'); + case 'MaxNavigationItems_desc': + return __('The number of items that can be displayed on each page of the navigation tree.'); + case 'MaxNavigationItems_name': + return __('Maximum items in branch'); + case 'MaxRows_desc': + return __( + 'Number of rows displayed when browsing a result set. If the result set ' + . 'contains more rows, "Previous" and "Next" links will be ' + . 'shown.' + ); + case 'MaxRows_name': + return __('Maximum number of rows to display'); + case 'MaxTableList_cmt': + return __('Users cannot set a higher value'); + case 'MaxTableList_desc': + return __('Maximum number of tables displayed in table list.'); + case 'MaxTableList_name': + return __('Maximum tables'); + case 'MemoryLimit_desc': + return __( + 'The number of bytes a script is allowed to allocate, eg. [kbd]32M[/kbd] ' + . '([kbd]-1[/kbd] for no limit and [kbd]0[/kbd] for no change).' + ); + case 'MemoryLimit_name': + return __('Memory limit'); + case 'ShowDatabasesNavigationAsTree_desc': + return __('In the navigation panel, replaces the database tree with a selector'); + case 'ShowDatabasesNavigationAsTree_name': + return __('Show databases navigation as tree'); + case 'NavigationWidth_name': + return __('Navigation panel width'); + case 'NavigationWidth_desc': + return __('Set to 0 to collapse navigation panel.'); + case 'NavigationLinkWithMainPanel_desc': + return __('Link with main panel by highlighting the current database or table.'); + case 'NavigationLinkWithMainPanel_name': + return __('Link with main panel'); + case 'NavigationDisplayLogo_desc': + return __('Show logo in navigation panel.'); + case 'NavigationDisplayLogo_name': + return __('Display logo'); + case 'NavigationLogoLink_desc': + return __('URL where logo in the navigation panel will point to.'); + case 'NavigationLogoLink_name': + return __('Logo link URL'); + case 'NavigationLogoLinkWindow_desc': + return __( + 'Open the linked page in the main window ([kbd]main[/kbd]) or in a new one ' + . '([kbd]new[/kbd]).' + ); + case 'NavigationLogoLinkWindow_name': + return __('Logo link target'); + case 'NavigationDisplayServers_desc': + return __('Display server choice at the top of the navigation panel.'); + case 'NavigationDisplayServers_name': + return __('Display servers selection'); + case 'NavigationTreeDefaultTabTable_name': + return __('Target for quick access icon'); + case 'NavigationTreeDefaultTabTable2_name': + return __('Target for second quick access icon'); + case 'NavigationTreeDisplayItemFilterMinimum_desc': + return __( + 'Defines the minimum number of items (tables, views, routines and events) to ' + . 'display a filter box.' + ); + case 'NavigationTreeDisplayItemFilterMinimum_name': + return __('Minimum number of items to display the filter box'); + case 'NavigationTreeDisplayDbFilterMinimum_name': + return __('Minimum number of databases to display the database filter box'); + case 'NavigationTreeEnableGrouping_desc': + return __( + 'Group items in the navigation tree (determined by the separator defined in ' . + 'the Databases and Tables tabs above).' + ); + case 'NavigationTreeEnableGrouping_name': + return __('Group items in the tree'); + case 'NavigationTreeDbSeparator_desc': + return __('String that separates databases into different tree levels.'); + case 'NavigationTreeDbSeparator_name': + return __('Database tree separator'); + case 'NavigationTreeTableSeparator_desc': + return __('String that separates tables into different tree levels.'); + case 'NavigationTreeTableSeparator_name': + return __('Table tree separator'); + case 'NavigationTreeTableLevel_name': + return __('Maximum table tree depth'); + case 'NavigationTreePointerEnable_desc': + return __('Highlight server under the mouse cursor.'); + case 'NavigationTreePointerEnable_name': + return __('Enable highlighting'); + case 'NavigationTreeEnableExpansion_desc': + return __('Whether to offer the possibility of tree expansion in the navigation panel.'); + case 'NavigationTreeEnableExpansion_name': + return __('Enable navigation tree expansion'); + case 'NavigationTreeShowTables_name': + return __('Show tables in tree'); + case 'NavigationTreeShowTables_desc': + return __('Whether to show tables under database in the navigation tree'); + case 'NavigationTreeShowViews_name': + return __('Show views in tree'); + case 'NavigationTreeShowViews_desc': + return __('Whether to show views under database in the navigation tree'); + case 'NavigationTreeShowFunctions_name': + return __('Show functions in tree'); + case 'NavigationTreeShowFunctions_desc': + return __('Whether to show functions under database in the navigation tree'); + case 'NavigationTreeShowProcedures_name': + return __('Show procedures in tree'); + case 'NavigationTreeShowProcedures_desc': + return __('Whether to show procedures under database in the navigation tree'); + case 'NavigationTreeShowEvents_name': + return __('Show events in tree'); + case 'NavigationTreeShowEvents_desc': + return __('Whether to show events under database in the navigation tree'); + case 'NumRecentTables_desc': + return __('Maximum number of recently used tables; set 0 to disable.'); + case 'NumFavoriteTables_desc': + return __('Maximum number of favorite tables; set 0 to disable.'); + case 'NumRecentTables_name': + return __('Recently used tables'); + case 'NumFavoriteTables_name': + return __('Favorite tables'); + case 'RowActionLinks_desc': + return __('These are Edit, Copy and Delete links.'); + case 'RowActionLinks_name': + return __('Where to show the table row links'); + case 'RowActionLinksWithoutUnique_desc': + return __('Whether to show row links even in the absence of a unique key.'); + case 'RowActionLinksWithoutUnique_name': + return __('Show row links anyway'); + case 'DisableShortcutKeys_name': + return __('Disable shortcut keys'); + case 'DisableShortcutKeys_desc': + return __('Disable shortcut keys'); + case 'NaturalOrder_desc': + return __('Use natural order for sorting table and database names.'); + case 'NaturalOrder_name': + return __('Natural order'); + case 'TableNavigationLinksMode_desc': + return __('Use only icons, only text or both.'); + case 'TableNavigationLinksMode_name': + return __('Table navigation bar'); + case 'OBGzip_desc': + return __('Use GZip output buffering for increased speed in HTTP transfers.'); + case 'OBGzip_name': + return __('GZip output buffering'); + case 'Order_desc': + return __( + '[kbd]SMART[/kbd] - i.e. descending order for columns of type TIME, DATE, ' + . 'DATETIME and TIMESTAMP, ascending order otherwise.' + ); + case 'Order_name': + return __('Default sorting order'); + case 'PersistentConnections_desc': + return __('Use persistent connections to MySQL databases.'); + case 'PersistentConnections_name': + return __('Persistent connections'); + case 'PmaNoRelation_DisableWarning_desc': + return __( + 'Disable the default warning that is displayed on the database details ' + . 'Structure page if any of the required tables for the phpMyAdmin ' + . 'configuration storage could not be found.' + ); + case 'PmaNoRelation_DisableWarning_name': + return __('Missing phpMyAdmin configuration storage tables'); + case 'ReservedWordDisableWarning_desc': + return __( + 'Disable the default warning that is displayed on the Structure page if column ' + . 'names in a table are reserved MySQL words.' + ); + case 'ReservedWordDisableWarning_name': + return __('MySQL reserved word warning'); + case 'TabsMode_desc': + return __('Use only icons, only text or both.'); + case 'TabsMode_name': + return __('How to display the menu tabs'); + case 'ActionLinksMode_desc': + return __('Use only icons, only text or both.'); + case 'ActionLinksMode_name': + return __('How to display various action links'); + case 'ProtectBinary_desc': + return __('Disallow BLOB and BINARY columns from editing.'); + case 'ProtectBinary_name': + return __('Protect binary columns'); + case 'QueryHistoryDB_desc': + return __( + 'Enable if you want DB-based query history (requires phpMyAdmin configuration ' + . 'storage). If disabled, this utilizes JS-routines to display query history ' + . '(lost by window close).' + ); + case 'QueryHistoryDB_name': + return __('Permanent query history'); + case 'QueryHistoryMax_cmt': + return __('Users cannot set a higher value'); + case 'QueryHistoryMax_desc': + return __('How many queries are kept in history.'); + case 'QueryHistoryMax_name': + return __('Query history length'); + case 'RecodingEngine_desc': + return __('Select which functions will be used for character set conversion.'); + case 'RecodingEngine_name': + return __('Recoding engine'); + case 'RememberSorting_desc': + return __('When browsing tables, the sorting of each table is remembered.'); + case 'RememberSorting_name': + return __('Remember table\'s sorting'); + case 'TablePrimaryKeyOrder_desc': + return __('Default sort order for tables with a primary key.'); + case 'TablePrimaryKeyOrder_name': + return __('Primary key default sort order'); + case 'RepeatCells_desc': + return __('Repeat the headers every X cells, [kbd]0[/kbd] deactivates this feature.'); + case 'RepeatCells_name': + return __('Repeat headers'); + case 'GridEditing_name': + return __('Grid editing: trigger action'); + case 'RelationalDisplay_name': + return __('Relational display'); + case 'RelationalDisplay_desc': + return __('For display Options'); + case 'SaveCellsAtOnce_name': + return __('Grid editing: save all edited cells at once'); + case 'SaveDir_desc': + return __('Directory where exports can be saved on server.'); + case 'SaveDir_name': + return __('Save directory'); + case 'Servers_AllowDeny_order_desc': + return __('Leave blank if not used.'); + case 'Servers_AllowDeny_order_name': + return __('Host authorization order'); + case 'Servers_AllowDeny_rules_desc': + return __('Leave blank for defaults.'); + case 'Servers_AllowDeny_rules_name': + return __('Host authorization rules'); + case 'Servers_AllowNoPassword_name': + return __('Allow logins without a password'); + case 'Servers_AllowRoot_name': + return __('Allow root login'); + case 'Servers_SessionTimeZone_name': + return __('Session timezone'); + case 'Servers_SessionTimeZone_desc': + return __( + 'Sets the effective timezone; possibly different than the one from your ' + . 'database server' + ); + case 'Servers_auth_http_realm_desc': + return __('HTTP Basic Auth Realm name to display when doing HTTP Auth.'); + case 'Servers_auth_http_realm_name': + return __('HTTP Realm'); + case 'Servers_auth_type_desc': + return __('Authentication method to use.'); + case 'Servers_auth_type_name': + return __('Authentication type'); + case 'Servers_bookmarktable_desc': + return __( + 'Leave blank for no [doc@bookmarks@]bookmark[/doc] ' + . 'support, suggested: [kbd]pma__bookmark[/kbd]' + ); + case 'Servers_bookmarktable_name': + return __('Bookmark table'); + case 'Servers_column_info_desc': + return __( + 'Leave blank for no column comments/mime types, suggested: ' + . '[kbd]pma__column_info[/kbd].' + ); + case 'Servers_column_info_name': + return __('Column information table'); + case 'Servers_compress_desc': + return __('Compress connection to MySQL server.'); + case 'Servers_compress_name': + return __('Compress connection'); + case 'Servers_controlpass_name': + return __('Control user password'); + case 'Servers_controluser_desc': + return __( + 'A special MySQL user configured with limited permissions, more information ' + . 'available on [doc@linked-tables]documentation[/doc].' + ); + case 'Servers_controluser_name': + return __('Control user'); + case 'Servers_controlhost_desc': + return __( + 'An alternate host to hold the configuration storage; leave blank to use the ' + . 'already defined host.' + ); + case 'Servers_controlhost_name': + return __('Control host'); + case 'Servers_controlport_desc': + return __( + 'An alternate port to connect to the host that holds the configuration storage; ' + . 'leave blank to use the default port, or the already defined port, if the ' + . 'controlhost equals host.' + ); + case 'Servers_controlport_name': + return __('Control port'); + case 'Servers_hide_db_desc': + return __('Hide databases matching regular expression (PCRE).'); + case 'Servers_DisableIS_desc': + return __( + 'More information on [a@https://github.com/phpmyadmin/phpmyadmin/issues/8970]phpMyAdmin ' + . 'issue tracker[/a] and [a@https://bugs.mysql.com/19588]MySQL Bugs[/a]' + ); + case 'Servers_DisableIS_name': + return __('Disable use of INFORMATION_SCHEMA'); + case 'Servers_hide_db_name': + return __('Hide databases'); + case 'Servers_history_desc': + return __( + 'Leave blank for no SQL query history support, suggested: ' + . '[kbd]pma__history[/kbd].' + ); + case 'Servers_history_name': + return __('SQL query history table'); + case 'Servers_host_desc': + return __('Hostname where MySQL server is running.'); + case 'Servers_host_name': + return __('Server hostname'); + case 'Servers_LogoutURL_name': + return __('Logout URL'); + case 'Servers_MaxTableUiprefs_desc': + return __( + 'Limits number of table preferences which are stored in database, the oldest ' + . 'records are automatically removed.' + ); + case 'Servers_MaxTableUiprefs_name': + return __('Maximal number of table preferences to store'); + case 'Servers_savedsearches_name': + return __('QBE saved searches table'); + case 'Servers_savedsearches_desc': + return __( + 'Leave blank for no QBE saved searches support, suggested: ' + . '[kbd]pma__savedsearches[/kbd].' + ); + case 'Servers_export_templates_name': + return __('Export templates table'); + case 'Servers_export_templates_desc': + return __( + 'Leave blank for no export template support, suggested: ' + . '[kbd]pma__export_templates[/kbd].' + ); + case 'Servers_central_columns_name': + return __('Central columns table'); + case 'Servers_central_columns_desc': + return __( + 'Leave blank for no central columns support, suggested: ' + . '[kbd]pma__central_columns[/kbd].' + ); + case 'Servers_only_db_desc': + return __( + 'You can use MySQL wildcard characters (% and _), escape them if you want to ' + . 'use their literal instances, i.e. use [kbd]\'my\_db\'[/kbd] and not ' + . '[kbd]\'my_db\'[/kbd].' + ); + case 'Servers_only_db_name': + return __('Show only listed databases'); + case 'Servers_password_desc': + return __('Leave empty if not using config auth.'); + case 'Servers_password_name': + return __('Password for config auth'); + case 'Servers_pdf_pages_desc': + return __('Leave blank for no PDF schema support, suggested: [kbd]pma__pdf_pages[/kbd].'); + case 'Servers_pdf_pages_name': + return __('PDF schema: pages table'); + case 'Servers_pmadb_desc': + return __( + 'Database used for relations, bookmarks, and PDF features. See ' + . '[doc@linked-tables]pmadb[/doc] for complete information. ' + . 'Leave blank for no support. Suggested: [kbd]phpmyadmin[/kbd].' + ); + case 'Servers_pmadb_name': + return __('Database name'); + case 'Servers_port_desc': + return __('Port on which MySQL server is listening, leave empty for default.'); + case 'Servers_port_name': + return __('Server port'); + case 'Servers_recent_desc': + return __( + 'Leave blank for no "persistent" recently used tables across sessions, ' + . 'suggested: [kbd]pma__recent[/kbd].' + ); + case 'Servers_recent_name': + return __('Recently used table'); + case 'Servers_favorite_desc': + return __( + 'Leave blank for no "persistent" favorite tables across sessions, ' + . 'suggested: [kbd]pma__favorite[/kbd].' + ); + case 'Servers_favorite_name': + return __('Favorites table'); + case 'Servers_relation_desc': + return __( + 'Leave blank for no ' + . '[doc@relations@]relation-links[/doc] support, ' + . 'suggested: [kbd]pma__relation[/kbd].' + ); + case 'Servers_relation_name': + return __('Relation table'); + case 'Servers_SignonSession_desc': + return __( + 'See [doc@authentication-modes]authentication ' + . 'types[/doc] for an example.' + ); + case 'Servers_SignonSession_name': + return __('Signon session name'); + case 'Servers_SignonURL_name': + return __('Signon URL'); + case 'Servers_socket_desc': + return __('Socket on which MySQL server is listening, leave empty for default.'); + case 'Servers_socket_name': + return __('Server socket'); + case 'Servers_ssl_desc': + return __('Enable SSL for connection to MySQL server.'); + case 'Servers_ssl_name': + return __('Use SSL'); + case 'Servers_table_coords_desc': + return __('Leave blank for no PDF schema support, suggested: [kbd]pma__table_coords[/kbd].'); + case 'Servers_table_coords_name': + return __('Designer and PDF schema: table coordinates'); + case 'Servers_table_info_desc': + return __( + 'Table to describe the display columns, leave blank for no support; ' + . 'suggested: [kbd]pma__table_info[/kbd].' + ); + case 'Servers_table_info_name': + return __('Display columns table'); + case 'Servers_table_uiprefs_desc': + return __( + 'Leave blank for no "persistent" tables\' UI preferences across sessions, ' + . 'suggested: [kbd]pma__table_uiprefs[/kbd].' + ); + case 'Servers_table_uiprefs_name': + return __('UI preferences table'); + case 'Servers_tracking_add_drop_database_desc': + return __( + 'Whether a DROP DATABASE IF EXISTS statement will be added as first line to ' + . 'the log when creating a database.' + ); + case 'Servers_tracking_add_drop_database_name': + return __('Add DROP DATABASE'); + case 'Servers_tracking_add_drop_table_desc': + return __( + 'Whether a DROP TABLE IF EXISTS statement will be added as first line to the ' + . 'log when creating a table.' + ); + case 'Servers_tracking_add_drop_table_name': + return __('Add DROP TABLE'); + case 'Servers_tracking_add_drop_view_desc': + return __( + 'Whether a DROP VIEW IF EXISTS statement will be added as first line to the ' + . 'log when creating a view.' + ); + case 'Servers_tracking_add_drop_view_name': + return __('Add DROP VIEW'); + case 'Servers_tracking_default_statements_desc': + return __('Defines the list of statements the auto-creation uses for new versions.'); + case 'Servers_tracking_default_statements_name': + return __('Statements to track'); + case 'Servers_tracking_desc': + return __( + 'Leave blank for no SQL query tracking support, suggested: ' + . '[kbd]pma__tracking[/kbd].' + ); + case 'Servers_tracking_name': + return __('SQL query tracking table'); + case 'Servers_tracking_version_auto_create_desc': + return __( + 'Whether the tracking mechanism creates versions for tables and views ' + . 'automatically.' + ); + case 'Servers_tracking_version_auto_create_name': + return __('Automatically create versions'); + case 'Servers_userconfig_desc': + return __( + 'Leave blank for no user preferences storage in database, suggested: ' + . '[kbd]pma__userconfig[/kbd].' + ); + case 'Servers_userconfig_name': + return __('User preferences storage table'); + case 'Servers_users_desc': + return __( + 'Both this table and the user groups table are required to enable the ' . + 'configurable menus feature; leaving either one of them blank will disable ' . + 'this feature, suggested: [kbd]pma__users[/kbd].' + ); + case 'Servers_users_name': + return __('Users table'); + case 'Servers_usergroups_desc': + return __( + 'Both this table and the users table are required to enable the configurable ' . + 'menus feature; leaving either one of them blank will disable this feature, ' . + 'suggested: [kbd]pma__usergroups[/kbd].' + ); + case 'Servers_usergroups_name': + return __('User groups table'); + case 'Servers_navigationhiding_desc': + return __( + 'Leave blank to disable the feature to hide and show navigation items, ' . + 'suggested: [kbd]pma__navigationhiding[/kbd].' + ); + case 'Servers_navigationhiding_name': + return __('Hidden navigation items table'); + case 'Servers_user_desc': + return __('Leave empty if not using config auth.'); + case 'Servers_user_name': + return __('User for config auth'); + case 'Servers_verbose_desc': + return __( + 'A user-friendly description of this server. Leave blank to display the ' . + 'hostname instead.' + ); + case 'Servers_verbose_name': + return __('Verbose name of this server'); + case 'ShowAll_desc': + return __('Whether a user should be displayed a "show all (rows)" button.'); + case 'ShowAll_name': + return __('Allow to display all the rows'); + case 'ShowChgPassword_desc': + return __( + 'Please note that enabling this has no effect with [kbd]config[/kbd] ' . + 'authentication mode because the password is hard coded in the configuration ' . + 'file; this does not limit the ability to execute the same command directly.' + ); + case 'ShowChgPassword_name': + return __('Show password change form'); + case 'ShowCreateDb_name': + return __('Show create database form'); + case 'ShowDbStructureComment_desc': + return __('Show or hide a column displaying the comments for all tables.'); + case 'ShowDbStructureComment_name': + return __('Show table comments'); + case 'ShowDbStructureCreation_desc': + return __('Show or hide a column displaying the Creation timestamp for all tables.'); + case 'ShowDbStructureCreation_name': + return __('Show creation timestamp'); + case 'ShowDbStructureLastUpdate_desc': + return __('Show or hide a column displaying the Last update timestamp for all tables.'); + case 'ShowDbStructureLastUpdate_name': + return __('Show last update timestamp'); + case 'ShowDbStructureLastCheck_desc': + return __('Show or hide a column displaying the Last check timestamp for all tables.'); + case 'ShowDbStructureLastCheck_name': + return __('Show last check timestamp'); + case 'ShowDbStructureCharset_desc': + return __('Show or hide a column displaying the charset for all tables.'); + case 'ShowDbStructureCharset_name': + return __('Show table charset'); + case 'ShowFieldTypesInDataEditView_desc': + return __( + 'Defines whether or not type fields should be initially displayed in ' . + 'edit/insert mode.' + ); + case 'ShowFieldTypesInDataEditView_name': + return __('Show field types'); + case 'ShowFunctionFields_desc': + return __('Display the function fields in edit/insert mode.'); + case 'ShowFunctionFields_name': + return __('Show function fields'); + case 'ShowHint_desc': + return __('Whether to show hint or not.'); + case 'ShowHint_name': + return __('Show hint'); + case 'ShowPhpInfo_desc': + return __( + 'Shows link to [a@https://php.net/manual/function.phpinfo.php]phpinfo()[/a] ' . + 'output.' + ); + case 'ShowPhpInfo_name': + return __('Show phpinfo() link'); + case 'ShowServerInfo_name': + return __('Show detailed MySQL server information'); + case 'ShowSQL_desc': + return __('Defines whether SQL queries generated by phpMyAdmin should be displayed.'); + case 'ShowSQL_name': + return __('Show SQL queries'); + case 'RetainQueryBox_desc': + return __('Defines whether the query box should stay on-screen after its submission.'); + case 'RetainQueryBox_name': + return __('Retain query box'); + case 'ShowStats_desc': + return __('Allow to display database and table statistics (eg. space usage).'); + case 'ShowStats_name': + return __('Show statistics'); + case 'SkipLockedTables_desc': + return __('Mark used tables and make it possible to show databases with locked tables.'); + case 'SkipLockedTables_name': + return __('Skip locked tables'); + case 'SQLQuery_Edit_name': + return __('Edit'); + case 'SQLQuery_Explain_name': + return __('Explain SQL'); + case 'SQLQuery_Refresh_name': + return __('Refresh'); + case 'SQLQuery_ShowAsPHP_name': + return __('Create PHP code'); + case 'SuhosinDisableWarning_desc': + return __( + 'Disable the default warning that is displayed on the main page if Suhosin is ' . + 'detected.' + ); + case 'SuhosinDisableWarning_name': + return __('Suhosin warning'); + case 'LoginCookieValidityDisableWarning_desc': + return __( + 'Disable the default warning that is displayed on the main page if the value ' . + 'of the PHP setting session.gc_maxlifetime is less than the value of ' . + '`LoginCookieValidity`.' + ); + case 'LoginCookieValidityDisableWarning_name': + return __('Login cookie validity warning'); + case 'TextareaCols_desc': + return __( + 'Textarea size (columns) in edit mode, this value will be emphasized for SQL ' . + 'query textareas (*2).' + ); + case 'TextareaCols_name': + return __('Textarea columns'); + case 'TextareaRows_desc': + return __( + 'Textarea size (rows) in edit mode, this value will be emphasized for SQL ' . + 'query textareas (*2).' + ); + case 'TextareaRows_name': + return __('Textarea rows'); + case 'TitleDatabase_desc': + return __('Title of browser window when a database is selected.'); + case 'TitleDatabase_name': + return __('Database'); + case 'TitleDefault_desc': + return __('Title of browser window when nothing is selected.'); + case 'TitleDefault_name': + return __('Default title'); + case 'TitleServer_desc': + return __('Title of browser window when a server is selected.'); + case 'TitleServer_name': + return __('Server'); + case 'TitleTable_desc': + return __('Title of browser window when a table is selected.'); + case 'TitleTable_name': + return __('Table'); + case 'TrustedProxies_desc': + return __( + 'Input proxies as [kbd]IP: trusted HTTP header[/kbd]. The following example ' . + 'specifies that phpMyAdmin should trust a HTTP_X_FORWARDED_FOR ' . + '(X-Forwarded-For) header coming from the proxy 1.2.3.4:[br][kbd]1.2.3.4: ' . + 'HTTP_X_FORWARDED_FOR[/kbd].' + ); + case 'TrustedProxies_name': + return __('List of trusted proxies for IP allow/deny'); + case 'UploadDir_desc': + return __('Directory on server where you can upload files for import.'); + case 'UploadDir_name': + return __('Upload directory'); + case 'UseDbSearch_desc': + return __('Allow for searching inside the entire database.'); + case 'UseDbSearch_name': + return __('Use database search'); + case 'UserprefsDeveloperTab_desc': + return __( + 'When disabled, users cannot set any of the options below, regardless of the ' . + 'checkbox on the right.' + ); + case 'UserprefsDeveloperTab_name': + return __('Enable the Developer tab in settings'); + case 'VersionCheck_desc': + return __('Enables check for latest version on main phpMyAdmin page.'); + case 'VersionCheck_name': + return __('Version check'); + case 'ProxyUrl_desc': + return __( + 'The url of the proxy to be used when retrieving the information about the ' . + 'latest version of phpMyAdmin or when submitting error reports. You need this ' . + 'if the server where phpMyAdmin is installed does not have direct access to ' . + 'the internet. The format is: "hostname:portnumber".' + ); + case 'ProxyUrl_name': + return __('Proxy url'); + case 'ProxyUser_desc': + return __( + 'The username for authenticating with the proxy. By default, no ' . + 'authentication is performed. If a username is supplied, Basic ' . + 'Authentication will be performed. No other types of authentication are ' . + 'currently supported.' + ); + case 'ProxyUser_name': + return __('Proxy username'); + case 'ProxyPass_desc': + return __('The password for authenticating with the proxy.'); + case 'ProxyPass_name': + return __('Proxy password'); + + case 'ZipDump_desc': + return __('Enable ZIP compression for import and export operations.'); + case 'ZipDump_name': + return __('ZIP'); + case 'CaptchaLoginPublicKey_desc': + return __('Enter your public key for your domain reCaptcha service.'); + case 'CaptchaLoginPublicKey_name': + return __('Public key for reCaptcha'); + case 'CaptchaLoginPrivateKey_desc': + return __('Enter your private key for your domain reCaptcha service.'); + case 'CaptchaLoginPrivateKey_name': + return __('Private key for reCaptcha'); + + case 'SendErrorReports_desc': + return __('Choose the default action when sending error reports.'); + case 'SendErrorReports_name': + return __('Send error reports'); + + case 'ConsoleEnterExecutes_desc': + return __( + 'Queries are executed by pressing Enter (instead of Ctrl+Enter). New lines ' . + 'will be inserted with Shift+Enter.' + ); + case 'ConsoleEnterExecutes_name': + return __('Enter executes queries in console'); + + case 'ZeroConf_desc': + return __( + 'Enable Zero Configuration mode which lets you setup phpMyAdmin ' + . 'configuration storage tables automatically.' + ); + case 'ZeroConf_name': + return __('Enable Zero Configuration mode'); + case 'Console_StartHistory_name': + return __('Show query history at start'); + case 'Console_AlwaysExpand_name': + return __('Always expand query messages'); + case 'Console_CurrentQuery_name': + return __('Show current browsing query'); + case 'Console_EnterExecutes_name': + return __('Execute queries on Enter and insert new line with Shift + Enter'); + case 'Console_DarkTheme_name': + return __('Switch to dark theme'); + case 'Console_Height_name': + return __('Console height'); + case 'Console_Mode_name': + return __('Console mode'); + case 'Console_GroupQueries_name': + return __('Group queries'); + case 'Console_Order_name': + return __('Order'); + case 'Console_OrderBy_name': + return __('Order by'); + case 'FontSize_name': + return __('Font size'); + case 'DefaultConnectionCollation_name': + return __('Server connection collation'); + } + return null; + } +} + diff --git a/phpMyAdmin/libraries/classes/Config/Form.php b/phpMyAdmin/libraries/classes/Config/Form.php new file mode 100755 index 0000000..f7c670f --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Form.php @@ -0,0 +1,233 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Form handling code. + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config; + +use PhpMyAdmin\Config\ConfigFile; + +/** + * Base class for forms, loads default configuration options, checks allowed + * values etc. + * + * @package PhpMyAdmin + */ +class Form +{ + /** + * Form name + * @var string + */ + public $name; + + /** + * Arbitrary index, doesn't affect class' behavior + * @var int + */ + public $index; + + /** + * Form fields (paths), filled by {@link readFormPaths()}, indexed by field name + * @var array + */ + public $fields; + + /** + * Stores default values for some fields (eg. pmadb tables) + * @var array + */ + public $default; + + /** + * Caches field types, indexed by field names + * @var array + */ + private $_fieldsTypes; + + /** + * ConfigFile instance + * @var ConfigFile + */ + private $_configFile; + + /** + * Constructor, reads default config values + * + * @param string $form_name Form name + * @param array $form Form data + * @param ConfigFile $cf Config file instance + * @param int $index arbitrary index, stored in Form::$index + */ + public function __construct( + $form_name, array $form, ConfigFile $cf, $index = null + ) { + $this->index = $index; + $this->_configFile = $cf; + $this->loadForm($form_name, $form); + } + + /** + * Returns type of given option + * + * @param string $option_name path or field name + * + * @return string|null one of: boolean, integer, double, string, select, array + */ + public function getOptionType($option_name) + { + $key = ltrim( + mb_substr( + $option_name, + mb_strrpos($option_name, '/') + ), + '/' + ); + return isset($this->_fieldsTypes[$key]) + ? $this->_fieldsTypes[$key] + : null; + } + + /** + * Returns allowed values for select fields + * + * @param string $option_path Option path + * + * @return array + */ + public function getOptionValueList($option_path) + { + $value = $this->_configFile->getDbEntry($option_path); + if ($value === null) { + trigger_error("$option_path - select options not defined", E_USER_ERROR); + return array(); + } + if (!is_array($value)) { + trigger_error("$option_path - not a static value list", E_USER_ERROR); + return array(); + } + // convert array('#', 'a', 'b') to array('a', 'b') + if (isset($value[0]) && $value[0] === '#') { + // remove first element ('#') + array_shift($value); + // $value has keys and value names, return it + return $value; + } + + // convert value list array('a', 'b') to array('a' => 'a', 'b' => 'b') + $has_string_keys = false; + $keys = array(); + for ($i = 0, $nb = count($value); $i < $nb; $i++) { + if (!isset($value[$i])) { + $has_string_keys = true; + break; + } + $keys[] = is_bool($value[$i]) ? (int)$value[$i] : $value[$i]; + } + if (! $has_string_keys) { + $value = array_combine($keys, $value); + } + + // $value has keys and value names, return it + return $value; + } + + /** + * array_walk callback function, reads path of form fields from + * array (see docs for \PhpMyAdmin\Config\Forms\BaseForm::getForms) + * + * @param mixed $value Value + * @param mixed $key Key + * @param mixed $prefix Prefix + * + * @return void + */ + private function _readFormPathsCallback($value, $key, $prefix) + { + static $group_counter = 0; + + if (is_array($value)) { + $prefix .= $key . '/'; + array_walk($value, array($this, '_readFormPathsCallback'), $prefix); + return; + } + + if (!is_int($key)) { + $this->default[$prefix . $key] = $value; + $value = $key; + } + // add unique id to group ends + if ($value == ':group:end') { + $value .= ':' . $group_counter++; + } + $this->fields[] = $prefix . $value; + } + + /** + * Reads form paths to {@link $fields} + * + * @param array $form Form + * + * @return void + */ + protected function readFormPaths(array $form) + { + // flatten form fields' paths and save them to $fields + $this->fields = array(); + array_walk($form, array($this, '_readFormPathsCallback'), ''); + + // $this->fields is an array of the form: [0..n] => 'field path' + // change numeric indexes to contain field names (last part of the path) + $paths = $this->fields; + $this->fields = array(); + foreach ($paths as $path) { + $key = ltrim( + mb_substr($path, mb_strrpos($path, '/')), + '/' + ); + $this->fields[$key] = $path; + } + // now $this->fields is an array of the form: 'field name' => 'field path' + } + + /** + * Reads fields' types to $this->_fieldsTypes + * + * @return void + */ + protected function readTypes() + { + $cf = $this->_configFile; + foreach ($this->fields as $name => $path) { + if (mb_strpos($name, ':group:') === 0) { + $this->_fieldsTypes[$name] = 'group'; + continue; + } + $v = $cf->getDbEntry($path); + if ($v !== null) { + $type = is_array($v) ? 'select' : $v; + } else { + $type = gettype($cf->getDefault($path)); + } + $this->_fieldsTypes[$name] = $type; + } + } + + /** + * Reads form settings and prepares class to work with given subset of + * config file + * + * @param string $form_name Form name + * @param array $form Form + * + * @return void + */ + public function loadForm($form_name, array $form) + { + $this->name = $form_name; + $this->readFormPaths($form); + $this->readTypes(); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/FormDisplay.php b/phpMyAdmin/libraries/classes/Config/FormDisplay.php new file mode 100755 index 0000000..5d9eedb --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/FormDisplay.php @@ -0,0 +1,880 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Form management class, displays and processes forms + * + * Explanation of used terms: + * o work_path - original field path, eg. Servers/4/verbose + * o system_path - work_path modified so that it points to the first server, + * eg. Servers/1/verbose + * o translated_path - work_path modified for HTML field name, a path with + * slashes changed to hyphens, eg. Servers-4-verbose + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config; + +use PhpMyAdmin\Config\ConfigFile; +use PhpMyAdmin\Config\Descriptions; +use PhpMyAdmin\Config\Form; +use PhpMyAdmin\Config\FormDisplayTemplate; +use PhpMyAdmin\Config\Forms\User\UserFormList; +use PhpMyAdmin\Config\Validator; +use PhpMyAdmin\Sanitize; +use PhpMyAdmin\Util; + +/** + * Form management class, displays and processes forms + * + * @package PhpMyAdmin + */ +class FormDisplay +{ + /** + * ConfigFile instance + * @var ConfigFile + */ + private $_configFile; + + /** + * Form list + * @var Form[] + */ + private $_forms = array(); + + /** + * Stores validation errors, indexed by paths + * [ Form_name ] is an array of form errors + * [path] is a string storing error associated with single field + * @var array + */ + private $_errors = array(); + + /** + * Paths changed so that they can be used as HTML ids, indexed by paths + * @var array + */ + private $_translatedPaths = array(); + + /** + * Server paths change indexes so we define maps from current server + * path to the first one, indexed by work path + * @var array + */ + private $_systemPaths = array(); + + /** + * Language strings which will be sent to PMA_messages JS variable + * Will be looked up in $GLOBALS: str{value} or strSetup{value} + * @var array + */ + private $_jsLangStrings = array(); + + /** + * Tells whether forms have been validated + * @var bool + */ + private $_isValidated = true; + + /** + * Dictionary with user preferences keys + * @var array|null + */ + private $_userprefsKeys; + + /** + * Dictionary with disallowed user preferences keys + * @var array + */ + private $_userprefsDisallow; + + /** + * Constructor + * + * @param ConfigFile $cf Config file instance + */ + public function __construct(ConfigFile $cf) + { + $this->_jsLangStrings = array( + 'error_nan_p' => __('Not a positive number!'), + 'error_nan_nneg' => __('Not a non-negative number!'), + 'error_incorrect_port' => __('Not a valid port number!'), + 'error_invalid_value' => __('Incorrect value!'), + 'error_value_lte' => __('Value must be less than or equal to %s!')); + $this->_configFile = $cf; + // initialize validators + Validator::getValidators($this->_configFile); + } + + /** + * Returns {@link ConfigFile} associated with this instance + * + * @return ConfigFile + */ + public function getConfigFile() + { + return $this->_configFile; + } + + /** + * Registers form in form manager + * + * @param string $form_name Form name + * @param array $form Form data + * @param int $server_id 0 if new server, validation; >= 1 if editing a server + * + * @return void + */ + public function registerForm($form_name, array $form, $server_id = null) + { + $this->_forms[$form_name] = new Form( + $form_name, $form, $this->_configFile, $server_id + ); + $this->_isValidated = false; + foreach ($this->_forms[$form_name]->fields as $path) { + $work_path = $server_id === null + ? $path + : str_replace('Servers/1/', "Servers/$server_id/", $path); + $this->_systemPaths[$work_path] = $path; + $this->_translatedPaths[$work_path] = str_replace('/', '-', $work_path); + } + } + + /** + * Processes forms, returns true on successful save + * + * @param bool $allow_partial_save allows for partial form saving + * on failed validation + * @param bool $check_form_submit whether check for $_POST['submit_save'] + * + * @return boolean whether processing was successful + */ + public function process($allow_partial_save = true, $check_form_submit = true) + { + if ($check_form_submit && !isset($_POST['submit_save'])) { + return false; + } + + // save forms + if (count($this->_forms) > 0) { + return $this->save(array_keys($this->_forms), $allow_partial_save); + } + return false; + } + + /** + * Runs validation for all registered forms + * + * @return void + */ + private function _validate() + { + if ($this->_isValidated) { + return; + } + + $paths = array(); + $values = array(); + foreach ($this->_forms as $form) { + /* @var $form Form */ + $paths[] = $form->name; + // collect values and paths + foreach ($form->fields as $path) { + $work_path = array_search($path, $this->_systemPaths); + $values[$path] = $this->_configFile->getValue($work_path); + $paths[] = $path; + } + } + + // run validation + $errors = Validator::validate( + $this->_configFile, $paths, $values, false + ); + + // change error keys from canonical paths to work paths + if (is_array($errors) && count($errors) > 0) { + $this->_errors = array(); + foreach ($errors as $path => $error_list) { + $work_path = array_search($path, $this->_systemPaths); + // field error + if (! $work_path) { + // form error, fix path + $work_path = $path; + } + $this->_errors[$work_path] = $error_list; + } + } + $this->_isValidated = true; + } + + /** + * Outputs HTML for the forms under the menu tab + * + * @param bool $show_restore_default whether to show "restore default" + * button besides the input field + * @param array &$js_default stores JavaScript code + * to be displayed + * @param array &$js will be updated with javascript code + * @param bool $show_buttons whether show submit and reset button + * + * @return string $htmlOutput + */ + private function _displayForms( + $show_restore_default, array &$js_default, array &$js, $show_buttons + ) { + $htmlOutput = ''; + $validators = Validator::getValidators($this->_configFile); + + foreach ($this->_forms as $form) { + /* @var $form Form */ + $form_errors = isset($this->_errors[$form->name]) + ? $this->_errors[$form->name] : null; + $htmlOutput .= FormDisplayTemplate::displayFieldsetTop( + Descriptions::get("Form_{$form->name}"), + Descriptions::get("Form_{$form->name}", 'desc'), + $form_errors, + array('id' => $form->name) + ); + + foreach ($form->fields as $field => $path) { + $work_path = array_search($path, $this->_systemPaths); + $translated_path = $this->_translatedPaths[$work_path]; + // always true/false for user preferences display + // otherwise null + $userprefs_allow = isset($this->_userprefsKeys[$path]) + ? !isset($this->_userprefsDisallow[$path]) + : null; + // display input + $htmlOutput .= $this->_displayFieldInput( + $form, + $field, + $path, + $work_path, + $translated_path, + $show_restore_default, + $userprefs_allow, + $js_default + ); + // register JS validators for this field + if (isset($validators[$path])) { + FormDisplayTemplate::addJsValidate($translated_path, $validators[$path], $js); + } + } + $htmlOutput .= FormDisplayTemplate::displayFieldsetBottom($show_buttons); + } + return $htmlOutput; + } + + /** + * Outputs HTML for forms + * + * @param bool $tabbed_form if true, use a form with tabs + * @param bool $show_restore_default whether show "restore default" button + * besides the input field + * @param bool $show_buttons whether show submit and reset button + * @param string $form_action action attribute for the form + * @param array|null $hidden_fields array of form hidden fields (key: field + * name) + * + * @return string HTML for forms + */ + public function getDisplay( + $tabbed_form = false, + $show_restore_default = false, + $show_buttons = true, + $form_action = null, + $hidden_fields = null + ) { + static $js_lang_sent = false; + + $htmlOutput = ''; + + $js = array(); + $js_default = array(); + + $htmlOutput .= FormDisplayTemplate::displayFormTop($form_action, 'post', $hidden_fields); + + if ($tabbed_form) { + $tabs = array(); + foreach ($this->_forms as $form) { + $tabs[$form->name] = Descriptions::get("Form_$form->name"); + } + $htmlOutput .= FormDisplayTemplate::displayTabsTop($tabs); + } + + // validate only when we aren't displaying a "new server" form + $is_new_server = false; + foreach ($this->_forms as $form) { + /* @var $form Form */ + if ($form->index === 0) { + $is_new_server = true; + break; + } + } + if (! $is_new_server) { + $this->_validate(); + } + + // user preferences + $this->_loadUserprefsInfo(); + + // display forms + $htmlOutput .= $this->_displayForms( + $show_restore_default, $js_default, $js, $show_buttons + ); + + if ($tabbed_form) { + $htmlOutput .= FormDisplayTemplate::displayTabsBottom(); + } + $htmlOutput .= FormDisplayTemplate::displayFormBottom(); + + // if not already done, send strings used for validation to JavaScript + if (! $js_lang_sent) { + $js_lang_sent = true; + $js_lang = array(); + foreach ($this->_jsLangStrings as $strName => $strValue) { + $js_lang[] = "'$strName': '" . Sanitize::jsFormat($strValue, false) . '\''; + } + $js[] = "$.extend(PMA_messages, {\n\t" + . implode(",\n\t", $js_lang) . '})'; + } + + $js[] = "$.extend(defaultValues, {\n\t" + . implode(",\n\t", $js_default) . '})'; + $htmlOutput .= FormDisplayTemplate::displayJavascript($js); + + return $htmlOutput; + } + + /** + * Prepares data for input field display and outputs HTML code + * + * @param Form $form Form object + * @param string $field field name as it appears in $form + * @param string $system_path field path, eg. Servers/1/verbose + * @param string $work_path work path, eg. Servers/4/verbose + * @param string $translated_path work path changed so that it can be + * used as XHTML id + * @param bool $show_restore_default whether show "restore default" button + * besides the input field + * @param bool|null $userprefs_allow whether user preferences are enabled + * for this field (null - no support, + * true/false - enabled/disabled) + * @param array &$js_default array which stores JavaScript code + * to be displayed + * + * @return string HTML for input field + */ + private function _displayFieldInput( + Form $form, $field, $system_path, $work_path, + $translated_path, $show_restore_default, $userprefs_allow, array &$js_default + ) { + $name = Descriptions::get($system_path); + $description = Descriptions::get($system_path, 'desc'); + + $value = $this->_configFile->get($work_path); + $value_default = $this->_configFile->getDefault($system_path); + $value_is_default = false; + if ($value === null || $value === $value_default) { + $value = $value_default; + $value_is_default = true; + } + + $opts = array( + 'doc' => $this->getDocLink($system_path), + 'show_restore_default' => $show_restore_default, + 'userprefs_allow' => $userprefs_allow, + 'userprefs_comment' => Descriptions::get($system_path, 'cmt') + ); + if (isset($form->default[$system_path])) { + $opts['setvalue'] = $form->default[$system_path]; + } + + if (isset($this->_errors[$work_path])) { + $opts['errors'] = $this->_errors[$work_path]; + } + + $type = ''; + switch ($form->getOptionType($field)) { + case 'string': + $type = 'text'; + break; + case 'short_string': + $type = 'short_text'; + break; + case 'double': + case 'integer': + $type = 'number_text'; + break; + case 'boolean': + $type = 'checkbox'; + break; + case 'select': + $type = 'select'; + $opts['values'] = $form->getOptionValueList($form->fields[$field]); + break; + case 'array': + $type = 'list'; + $value = (array) $value; + $value_default = (array) $value_default; + break; + case 'group': + // :group:end is changed to :group:end:{unique id} in Form class + $htmlOutput = ''; + if (mb_substr($field, 7, 4) != 'end:') { + $htmlOutput .= FormDisplayTemplate::displayGroupHeader( + mb_substr($field, 7) + ); + } else { + FormDisplayTemplate::displayGroupFooter(); + } + return $htmlOutput; + case 'NULL': + trigger_error("Field $system_path has no type", E_USER_WARNING); + return null; + } + + // detect password fields + if ($type === 'text' + && (mb_substr($translated_path, -9) === '-password' + || mb_substr($translated_path, -4) === 'pass' + || mb_substr($translated_path, -4) === 'Pass') + ) { + $type = 'password'; + } + + // TrustedProxies requires changes before displaying + if ($system_path == 'TrustedProxies') { + foreach ($value as $ip => &$v) { + if (!preg_match('/^-\d+$/', $ip)) { + $v = $ip . ': ' . $v; + } + } + } + $this->_setComments($system_path, $opts); + + // send default value to form's JS + $js_line = '\'' . $translated_path . '\': '; + switch ($type) { + case 'text': + case 'short_text': + case 'number_text': + case 'password': + $js_line .= '\'' . Sanitize::escapeJsString($value_default) . '\''; + break; + case 'checkbox': + $js_line .= $value_default ? 'true' : 'false'; + break; + case 'select': + $value_default_js = is_bool($value_default) + ? (int) $value_default + : $value_default; + $js_line .= '[\'' . Sanitize::escapeJsString($value_default_js) . '\']'; + break; + case 'list': + $js_line .= '\'' . Sanitize::escapeJsString(implode("\n", $value_default)) + . '\''; + break; + } + $js_default[] = $js_line; + + return FormDisplayTemplate::displayInput( + $translated_path, $name, $type, $value, + $description, $value_is_default, $opts + ); + } + + /** + * Displays errors + * + * @return string HTML for errors + */ + public function displayErrors() + { + $this->_validate(); + if (count($this->_errors) == 0) { + return null; + } + + $htmlOutput = ''; + + foreach ($this->_errors as $system_path => $error_list) { + if (isset($this->_systemPaths[$system_path])) { + $name = Descriptions::get($this->_systemPaths[$system_path]); + } else { + $name = Descriptions::get('Form_' . $system_path); + } + $htmlOutput .= FormDisplayTemplate::displayErrors($name, $error_list); + } + + return $htmlOutput; + } + + /** + * Reverts erroneous fields to their default values + * + * @return void + */ + public function fixErrors() + { + $this->_validate(); + if (count($this->_errors) == 0) { + return; + } + + $cf = $this->_configFile; + foreach (array_keys($this->_errors) as $work_path) { + if (!isset($this->_systemPaths[$work_path])) { + continue; + } + $canonical_path = $this->_systemPaths[$work_path]; + $cf->set($work_path, $cf->getDefault($canonical_path)); + } + } + + /** + * Validates select field and casts $value to correct type + * + * @param string &$value Current value + * @param array $allowed List of allowed values + * + * @return bool + */ + private function _validateSelect(&$value, array $allowed) + { + $value_cmp = is_bool($value) + ? (int) $value + : $value; + foreach ($allowed as $vk => $v) { + // equality comparison only if both values are numeric or not numeric + // (allows to skip 0 == 'string' equalling to true) + // or identity (for string-string) + if (($vk == $value && !(is_numeric($value_cmp) xor is_numeric($vk))) + || $vk === $value + ) { + // keep boolean value as boolean + if (!is_bool($value)) { + settype($value, gettype($vk)); + } + return true; + } + } + return false; + } + + /** + * Validates and saves form data to session + * + * @param array|string $forms array of form names + * @param bool $allow_partial_save allows for partial form saving on + * failed validation + * + * @return boolean true on success (no errors and all saved) + */ + public function save($forms, $allow_partial_save = true) + { + $result = true; + $forms = (array) $forms; + + $values = array(); + $to_save = array(); + $is_setup_script = $GLOBALS['PMA_Config']->get('is_setup'); + if ($is_setup_script) { + $this->_loadUserprefsInfo(); + } + + $this->_errors = array(); + foreach ($forms as $form_name) { + /* @var $form Form */ + if (isset($this->_forms[$form_name])) { + $form = $this->_forms[$form_name]; + } else { + continue; + } + // get current server id + $change_index = $form->index === 0 + ? $this->_configFile->getServerCount() + 1 + : false; + // grab POST values + foreach ($form->fields as $field => $system_path) { + $work_path = array_search($system_path, $this->_systemPaths); + $key = $this->_translatedPaths[$work_path]; + $type = $form->getOptionType($field); + + // skip groups + if ($type == 'group') { + continue; + } + + // ensure the value is set + if (!isset($_POST[$key])) { + // checkboxes aren't set by browsers if they're off + if ($type == 'boolean') { + $_POST[$key] = false; + } else { + $this->_errors[$form->name][] = sprintf( + __('Missing data for %s'), + '<i>' . Descriptions::get($system_path) . '</i>' + ); + $result = false; + continue; + } + } + + // user preferences allow/disallow + if ($is_setup_script + && isset($this->_userprefsKeys[$system_path]) + ) { + if (isset($this->_userprefsDisallow[$system_path]) + && isset($_POST[$key . '-userprefs-allow']) + ) { + unset($this->_userprefsDisallow[$system_path]); + } elseif (!isset($_POST[$key . '-userprefs-allow'])) { + $this->_userprefsDisallow[$system_path] = true; + } + } + + // cast variables to correct type + switch ($type) { + case 'double': + $_POST[$key] = Util::requestString($_POST[$key]); + settype($_POST[$key], 'float'); + break; + case 'boolean': + case 'integer': + if ($_POST[$key] !== '') { + $_POST[$key] = Util::requestString($_POST[$key]); + settype($_POST[$key], $type); + } + break; + case 'select': + $successfully_validated = $this->_validateSelect( + $_POST[$key], + $form->getOptionValueList($system_path) + ); + if (! $successfully_validated) { + $this->_errors[$work_path][] = __('Incorrect value!'); + $result = false; + // "continue" for the $form->fields foreach-loop + continue 2; + } + break; + case 'string': + case 'short_string': + $_POST[$key] = Util::requestString($_POST[$key]); + break; + case 'array': + // eliminate empty values and ensure we have an array + $post_values = is_array($_POST[$key]) + ? $_POST[$key] + : explode("\n", $_POST[$key]); + $_POST[$key] = array(); + $this->_fillPostArrayParameters($post_values, $key); + break; + } + + // now we have value with proper type + $values[$system_path] = $_POST[$key]; + if ($change_index !== false) { + $work_path = str_replace( + "Servers/$form->index/", + "Servers/$change_index/", $work_path + ); + } + $to_save[$work_path] = $system_path; + } + } + + // save forms + if (!$allow_partial_save && !empty($this->_errors)) { + // don't look for non-critical errors + $this->_validate(); + return $result; + } + + foreach ($to_save as $work_path => $path) { + // TrustedProxies requires changes before saving + if ($path == 'TrustedProxies') { + $proxies = array(); + $i = 0; + foreach ($values[$path] as $value) { + $matches = array(); + $match = preg_match( + "/^(.+):(?:[ ]?)(\\w+)$/", $value, $matches + ); + if ($match) { + // correct 'IP: HTTP header' pair + $ip = trim($matches[1]); + $proxies[$ip] = trim($matches[2]); + } else { + // save also incorrect values + $proxies["-$i"] = $value; + $i++; + } + } + $values[$path] = $proxies; + } + $this->_configFile->set($work_path, $values[$path], $path); + } + if ($is_setup_script) { + $this->_configFile->set( + 'UserprefsDisallow', + array_keys($this->_userprefsDisallow) + ); + } + + // don't look for non-critical errors + $this->_validate(); + + return $result; + } + + /** + * Tells whether form validation failed + * + * @return boolean + */ + public function hasErrors() + { + return count($this->_errors) > 0; + } + + + /** + * Returns link to documentation + * + * @param string $path Path to documentation + * + * @return string + */ + public function getDocLink($path) + { + $test = mb_substr($path, 0, 6); + if ($test == 'Import' || $test == 'Export') { + return ''; + } + return Util::getDocuLink( + 'config', + 'cfg_' . $this->_getOptName($path) + ); + } + + /** + * Changes path so it can be used in URLs + * + * @param string $path Path + * + * @return string + */ + private function _getOptName($path) + { + return str_replace(array('Servers/1/', '/'), array('Servers/', '_'), $path); + } + + /** + * Fills out {@link userprefs_keys} and {@link userprefs_disallow} + * + * @return void + */ + private function _loadUserprefsInfo() + { + if ($this->_userprefsKeys !== null) { + return; + } + + $this->_userprefsKeys = array_flip(UserFormList::getFields()); + // read real config for user preferences display + $userprefs_disallow = $GLOBALS['PMA_Config']->get('is_setup') + ? $this->_configFile->get('UserprefsDisallow', array()) + : $GLOBALS['cfg']['UserprefsDisallow']; + $this->_userprefsDisallow = array_flip($userprefs_disallow); + } + + /** + * Sets field comments and warnings based on current environment + * + * @param string $system_path Path to settings + * @param array &$opts Chosen options + * + * @return void + */ + private function _setComments($system_path, array &$opts) + { + // RecodingEngine - mark unavailable types + if ($system_path == 'RecodingEngine') { + $comment = ''; + if (!function_exists('iconv')) { + $opts['values']['iconv'] .= ' (' . __('unavailable') . ')'; + $comment = sprintf( + __('"%s" requires %s extension'), 'iconv', 'iconv' + ); + } + if (!function_exists('recode_string')) { + $opts['values']['recode'] .= ' (' . __('unavailable') . ')'; + $comment .= ($comment ? ", " : '') . sprintf( + __('"%s" requires %s extension'), + 'recode', 'recode' + ); + } + /* mbstring is always there thanks to polyfill */ + $opts['comment'] = $comment; + $opts['comment_warning'] = true; + } + // ZipDump, GZipDump, BZipDump - check function availability + if ($system_path == 'ZipDump' + || $system_path == 'GZipDump' + || $system_path == 'BZipDump' + ) { + $comment = ''; + $funcs = array( + 'ZipDump' => array('zip_open', 'gzcompress'), + 'GZipDump' => array('gzopen', 'gzencode'), + 'BZipDump' => array('bzopen', 'bzcompress')); + if (!function_exists($funcs[$system_path][0])) { + $comment = sprintf( + __( + 'Compressed import will not work due to missing function %s.' + ), + $funcs[$system_path][0] + ); + } + if (!function_exists($funcs[$system_path][1])) { + $comment .= ($comment ? '; ' : '') . sprintf( + __( + 'Compressed export will not work due to missing function %s.' + ), + $funcs[$system_path][1] + ); + } + $opts['comment'] = $comment; + $opts['comment_warning'] = true; + } + if (! $GLOBALS['PMA_Config']->get('is_setup')) { + if (($system_path == 'MaxDbList' || $system_path == 'MaxTableList' + || $system_path == 'QueryHistoryMax') + ) { + $opts['comment'] = sprintf( + __('maximum %s'), $GLOBALS['cfg'][$system_path] + ); + } + } + } + + /** + * Copy items of an array to $_POST variable + * + * @param array $post_values List of parameters + * @param string $key Array key + * + * @return void + */ + private function _fillPostArrayParameters(array $post_values, $key) + { + foreach ($post_values as $v) { + $v = Util::requestString($v); + if ($v !== '') { + $_POST[$key][] = $v; + } + } + } +} diff --git a/phpMyAdmin/libraries/classes/Config/FormDisplayTemplate.php b/phpMyAdmin/libraries/classes/Config/FormDisplayTemplate.php new file mode 100755 index 0000000..88dee0c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/FormDisplayTemplate.php @@ -0,0 +1,493 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Form templates + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config; + +use PhpMyAdmin\Sanitize; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * PhpMyAdmin\Config\FormDisplayTemplate class + * + * @package PhpMyAdmin + */ +class FormDisplayTemplate +{ + /** + * Displays top part of the form + * + * @param string $action default: $_SERVER['REQUEST_URI'] + * @param string $method 'post' or 'get' + * @param array|null $hidden_fields array of form hidden fields (key: field name) + * + * @return string + */ + public static function displayFormTop($action = null, $method = 'post', $hidden_fields = null) + { + static $has_check_page_refresh = false; + + if ($action === null) { + $action = $_SERVER['REQUEST_URI']; + } + if ($method != 'post') { + $method = 'get'; + } + $htmlOutput = '<form method="' . $method . '" action="' + . htmlspecialchars($action) . '" class="config-form disableAjax">'; + $htmlOutput .= '<input type="hidden" name="tab_hash" value="" />'; + // we do validation on page refresh when browser remembers field values, + // add a field with known value which will be used for checks + if (! $has_check_page_refresh) { + $has_check_page_refresh = true; + $htmlOutput .= '<input type="hidden" name="check_page_refresh" ' + . ' id="check_page_refresh" value="" />' . "\n"; + } + $htmlOutput .= Url::getHiddenInputs('', '', 0, 'server') . "\n"; + $htmlOutput .= Url::getHiddenFields((array)$hidden_fields); + return $htmlOutput; + } + + /** + * Displays form tabs which are given by an array indexed by fieldset id + * ({@link self::displayFieldsetTop}), with values being tab titles. + * + * @param array $tabs tab names + * + * @return string + */ + public static function displayTabsTop(array $tabs) + { + $items = array(); + foreach ($tabs as $tab_id => $tab_name) { + $items[] = array( + 'content' => htmlspecialchars($tab_name), + 'url' => array( + 'href' => '#' . $tab_id, + ), + ); + } + + $htmlOutput = Template::get('list/unordered')->render( + array( + 'class' => 'tabs responsivetable', + 'items' => $items, + ) + ); + $htmlOutput .= '<br />'; + $htmlOutput .= '<div class="tabs_contents">'; + return $htmlOutput; + } + + /** + * Displays top part of a fieldset + * + * @param string $title title of fieldset + * @param string $description description shown on top of fieldset + * @param array|null $errors error messages to display + * @param array $attributes optional extra attributes of fieldset + * + * @return string + */ + public static function displayFieldsetTop( + $title = '', + $description = '', + $errors = null, + array $attributes = array() + ) { + global $_FormDisplayGroup; + + $_FormDisplayGroup = 0; + + $attributes = array_merge(array('class' => 'optbox'), $attributes); + + return Template::get('config/form_display/fieldset_top')->render([ + 'attributes' => $attributes, + 'title' => $title, + 'description' => $description, + 'errors' => $errors, + ]); + } + + /** + * Displays input field + * + * $opts keys: + * o doc - (string) documentation link + * o errors - error array + * o setvalue - (string) shows button allowing to set predefined value + * o show_restore_default - (boolean) whether show "restore default" button + * o userprefs_allow - whether user preferences are enabled for this field + * (null - no support, true/false - enabled/disabled) + * o userprefs_comment - (string) field comment + * o values - key - value pairs for <select> fields + * o values_escaped - (boolean) tells whether values array is already escaped + * (defaults to false) + * o values_disabled - (array)list of disabled values (keys from values) + * o comment - (string) tooltip comment + * o comment_warning - (bool) whether this comments warns about something + * + * @param string $path config option path + * @param string $name config option name + * @param string $type type of config option + * @param mixed $value current value + * @param string $description verbose description + * @param bool $value_is_default whether value is default + * @param array|null $opts see above description + * + * @return string + */ + public static function displayInput($path, $name, $type, $value, $description = '', + $value_is_default = true, $opts = null + ) { + global $_FormDisplayGroup; + static $icons; // An array of IMG tags used further below in the function + + if (defined('TESTSUITE')) { + $icons = null; + } + + $is_setup_script = $GLOBALS['PMA_Config']->get('is_setup'); + if ($icons === null) { // if the static variables have not been initialised + $icons = array(); + // Icon definitions: + // The same indexes will be used in the $icons array. + // The first element contains the filename and the second + // element is used for the "alt" and "title" attributes. + $icon_init = array( + 'edit' => array('b_edit', ''), + 'help' => array('b_help', __('Documentation')), + 'reload' => array('s_reload', ''), + 'tblops' => array('b_tblops', '') + ); + if ($is_setup_script) { + // When called from the setup script, we don't have access to the + // sprite-aware getImage() function because the PMA_theme class + // has not been loaded, so we generate the img tags manually. + foreach ($icon_init as $k => $v) { + $title = ''; + if (! empty($v[1])) { + $title = ' title="' . $v[1] . '"'; + } + $icons[$k] = sprintf( + '<img alt="%s" src="%s"%s />', + $v[1], + "../themes/pmahomme/img/{$v[0]}.png", + $title + ); + } + } else { + // In this case we just use getImage() because it's available + foreach ($icon_init as $k => $v) { + $icons[$k] = Util::getImage( + $v[0], $v[1] + ); + } + } + } + $has_errors = isset($opts['errors']) && !empty($opts['errors']); + $option_is_disabled = ! $is_setup_script && isset($opts['userprefs_allow']) + && ! $opts['userprefs_allow']; + $name_id = 'name="' . htmlspecialchars($path) . '" id="' + . htmlspecialchars($path) . '"'; + $field_class = $type == 'checkbox' ? 'checkbox' : ''; + if (! $value_is_default) { + $field_class .= ($field_class == '' ? '' : ' ') + . ($has_errors ? 'custom field-error' : 'custom'); + } + $field_class = $field_class ? ' class="' . $field_class . '"' : ''; + $tr_class = $_FormDisplayGroup > 0 + ? 'group-field group-field-' . $_FormDisplayGroup + : ''; + if (isset($opts['setvalue']) && $opts['setvalue'] == ':group') { + unset($opts['setvalue']); + $_FormDisplayGroup++; + $tr_class = 'group-header-field group-header-' . $_FormDisplayGroup; + } + if ($option_is_disabled) { + $tr_class .= ($tr_class ? ' ' : '') . 'disabled-field'; + } + $tr_class = $tr_class ? ' class="' . $tr_class . '"' : ''; + + $htmlOutput = '<tr' . $tr_class . '>'; + $htmlOutput .= '<th>'; + $htmlOutput .= '<label for="' . htmlspecialchars($path) . '">' . htmlspecialchars_decode($name) + . '</label>'; + + if (! empty($opts['doc'])) { + $htmlOutput .= '<span class="doc">'; + $htmlOutput .= '<a href="' . $opts['doc'] + . '" target="documentation">' . $icons['help'] . '</a>'; + $htmlOutput .= "\n"; + $htmlOutput .= '</span>'; + } + + if ($option_is_disabled) { + $htmlOutput .= '<span class="disabled-notice" title="'; + $htmlOutput .= __( + 'This setting is disabled, it will not be applied to your configuration.' + ); + $htmlOutput .= '">' . __('Disabled') . "</span>"; + } + + if (!empty($description)) { + $htmlOutput .= '<small>' . $description . '</small>'; + } + + $htmlOutput .= '</th>'; + $htmlOutput .= '<td>'; + + switch ($type) { + case 'text': + $htmlOutput .= '<input type="text" class="all85" ' . $name_id . $field_class + . ' value="' . htmlspecialchars($value) . '" />'; + break; + case 'password': + $htmlOutput .= '<input type="password" class="all85" ' . $name_id . $field_class + . ' value="' . htmlspecialchars($value) . '" />'; + break; + case 'short_text': + // As seen in the reporting server (#15042) we sometimes receive + // an array here. No clue about its origin nor content, so let's avoid + // a notice on htmlspecialchars(). + if (! is_array($value)) { + $htmlOutput .= '<input type="text" size="25" ' . $name_id + . $field_class . ' value="' . htmlspecialchars($value) + . '" />'; + } + break; + case 'number_text': + $htmlOutput .= '<input type="number" ' . $name_id . $field_class + . ' value="' . htmlspecialchars($value) . '" />'; + break; + case 'checkbox': + $htmlOutput .= '<span' . $field_class . '><input type="checkbox" ' . $name_id + . ($value ? ' checked="checked"' : '') . ' /></span>'; + break; + case 'select': + $htmlOutput .= '<select class="all85" ' . $name_id . $field_class . '>'; + $escape = !(isset($opts['values_escaped']) && $opts['values_escaped']); + $values_disabled = isset($opts['values_disabled']) + ? array_flip($opts['values_disabled']) : array(); + foreach ($opts['values'] as $opt_value_key => $opt_value) { + // set names for boolean values + if (is_bool($opt_value)) { + $opt_value = mb_strtolower( + $opt_value ? __('Yes') : __('No') + ); + } + // escape if necessary + if ($escape) { + $display = htmlspecialchars($opt_value); + $display_value = htmlspecialchars($opt_value_key); + } else { + $display = $opt_value; + $display_value = $opt_value_key; + } + // compare with selected value + // boolean values are cast to integers when used as array keys + $selected = is_bool($value) + ? (int) $value === $opt_value_key + : $opt_value_key === $value; + $htmlOutput .= '<option value="' . $display_value . '"'; + if ($selected) { + $htmlOutput .= ' selected="selected"'; + } + if (isset($values_disabled[$opt_value_key])) { + $htmlOutput .= ' disabled="disabled"'; + } + $htmlOutput .= '>' . $display . '</option>'; + } + $htmlOutput .= '</select>'; + break; + case 'list': + $htmlOutput .= '<textarea cols="35" rows="5" ' . $name_id . $field_class + . '>' . htmlspecialchars(implode("\n", $value)) . '</textarea>'; + break; + } + if (isset($opts['comment']) && $opts['comment']) { + $class = 'field-comment-mark'; + if (isset($opts['comment_warning']) && $opts['comment_warning']) { + $class .= ' field-comment-warning'; + } + $htmlOutput .= '<span class="' . $class . '" title="' + . htmlspecialchars($opts['comment']) . '">i</span>'; + } + if ($is_setup_script + && isset($opts['userprefs_comment']) + && $opts['userprefs_comment'] + ) { + $htmlOutput .= '<a class="userprefs-comment" title="' + . htmlspecialchars($opts['userprefs_comment']) . '">' + . $icons['tblops'] . '</a>'; + } + if (isset($opts['setvalue']) && $opts['setvalue']) { + $htmlOutput .= '<a class="set-value hide" href="#' + . htmlspecialchars("$path={$opts['setvalue']}") . '" title="' + . sprintf(__('Set value: %s'), htmlspecialchars($opts['setvalue'])) + . '">' . $icons['edit'] . '</a>'; + } + if (isset($opts['show_restore_default']) && $opts['show_restore_default']) { + $htmlOutput .= '<a class="restore-default hide" href="#' . $path . '" title="' + . __('Restore default value') . '">' . $icons['reload'] . '</a>'; + } + // this must match with displayErrors() in scripts/config.js + if ($has_errors) { + $htmlOutput .= "\n <dl class=\"inline_errors\">"; + foreach ($opts['errors'] as $error) { + $htmlOutput .= '<dd>' . htmlspecialchars($error) . '</dd>'; + } + $htmlOutput .= '</dl>'; + } + $htmlOutput .= '</td>'; + if ($is_setup_script && isset($opts['userprefs_allow'])) { + $htmlOutput .= '<td class="userprefs-allow" title="' . + __('Allow users to customize this value') . '">'; + $htmlOutput .= '<input type="checkbox" name="' . $path + . '-userprefs-allow" '; + if ($opts['userprefs_allow']) { + $htmlOutput .= 'checked="checked"'; + }; + $htmlOutput .= '/>'; + $htmlOutput .= '</td>'; + } elseif ($is_setup_script) { + $htmlOutput .= '<td> </td>'; + } + $htmlOutput .= '</tr>'; + return $htmlOutput; + } + + /** + * Display group header + * + * @param string $headerText Text of header + * + * @return string|void + */ + public static function displayGroupHeader($headerText) + { + global $_FormDisplayGroup; + + $_FormDisplayGroup++; + if (! $headerText) { + return null; + } + $colspan = $GLOBALS['PMA_Config']->get('is_setup') ? 3 : 2; + + return Template::get('config/form_display/group_header')->render([ + 'group' => $_FormDisplayGroup, + 'colspan' => $colspan, + 'header_text' => $headerText, + ]); + } + + /** + * Display group footer + * + * @return void + */ + public static function displayGroupFooter() + { + global $_FormDisplayGroup; + + $_FormDisplayGroup--; + } + + /** + * Displays bottom part of a fieldset + * + * @param bool $showButtons Whether show submit and reset button + * + * @return string + */ + public static function displayFieldsetBottom($showButtons = true) + { + return Template::get('config/form_display/fieldset_bottom')->render([ + 'show_buttons' => $showButtons, + 'is_setup' => $GLOBALS['PMA_Config']->get('is_setup'), + ]); + } + + /** + * Closes form tabs + * + * @return string + */ + public static function displayTabsBottom() + { + return Template::get('config/form_display/tabs_bottom')->render(); + } + + /** + * Displays bottom part of the form + * + * @return string + */ + public static function displayFormBottom() + { + return Template::get('config/form_display/form_bottom')->render(); + } + + /** + * Appends JS validation code to $js_array + * + * @param string $field_id ID of field to validate + * @param string|array $validators validators callback + * @param array &$js_array will be updated with javascript code + * + * @return void + */ + public static function addJsValidate($field_id, $validators, array &$js_array) + { + foreach ((array)$validators as $validator) { + $validator = (array)$validator; + $v_name = array_shift($validator); + $v_name = "PMA_" . $v_name; + $v_args = array(); + foreach ($validator as $arg) { + $v_args[] = Sanitize::escapeJsString($arg); + } + $v_args = $v_args ? ", ['" . implode("', '", $v_args) . "']" : ''; + $js_array[] = "validateField('$field_id', '$v_name', true$v_args)"; + } + } + + /** + * Displays JavaScript code + * + * @param array $js_array lines of javascript code + * + * @return string + */ + public static function displayJavascript(array $js_array) + { + if (empty($js_array)) { + return null; + } + + return Template::get('javascript/display')->render( + array('js_array' => $js_array,) + ); + } + + /** + * Displays error list + * + * @param string $name Name of item with errors + * @param array $errorList List of errors to show + * + * @return string HTML for errors + */ + public static function displayErrors($name, array $errorList) + { + return Template::get('config/form_display/errors')->render([ + 'name' => $name, + 'error_list' => $errorList, + ]); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/BaseForm.php b/phpMyAdmin/libraries/classes/Config/Forms/BaseForm.php new file mode 100755 index 0000000..c16fb8b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/BaseForm.php @@ -0,0 +1,85 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Base class for preferences. + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms; + +use PhpMyAdmin\Config\ConfigFile; +use PhpMyAdmin\Config\FormDisplay; + +/** + * Base form for user preferences + */ +abstract class BaseForm extends FormDisplay +{ + /** + * Constructor + * + * @param ConfigFile $cf Config file instance + * @param int|null $server_id 0 if new server, validation; >= 1 if editing a server + */ + public function __construct(ConfigFile $cf, $server_id = null) + { + parent::__construct($cf); + foreach (static::getForms() as $form_name => $form) { + $this->registerForm($form_name, $form, $server_id); + } + } + + /** + * List of available forms, each form is described as an array of fields to display. + * Fields MUST have their counterparts in the $cfg array. + * + * To define form field, use the notation below: + * $forms['Form group']['Form name'] = array('Option/path'); + * + * You can assign default values set by special button ("set value: ..."), eg.: + * 'Servers/1/pmadb' => 'phpmyadmin' + * + * To group options, use: + * ':group:' . __('group name') // just define a group + * or + * 'option' => ':group' // group starting from this option + * End group blocks with: + * ':group:end' + * + * @todo This should be abstract, but that does not work in PHP 5 + * + * @return array + */ + public static function getForms() + { + return array(); + } + + /** + * Returns list of fields used in the form. + * + * @return string[] + */ + public static function getFields() + { + $names = []; + foreach (static::getForms() as $form) { + foreach ($form as $k => $v) { + $names[] = is_int($k) ? $v : $k; + } + } + return $names; + } + + /** + * Returns name of the form + * + * @todo This should be abstract, but that does not work in PHP 5 + * + * @return string + */ + public static function getName() + { + return ''; + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/BaseFormList.php b/phpMyAdmin/libraries/classes/Config/Forms/BaseFormList.php new file mode 100755 index 0000000..1065c3b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/BaseFormList.php @@ -0,0 +1,127 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms; + +use PhpMyAdmin\Config\ConfigFile; + +class BaseFormList +{ + /** + * List of all forms + */ + protected static $all = array(); + + protected static $ns = 'PhpMyAdmin\\Config\\Forms\\'; + + private $_forms; + + public static function getAll() + { + return static::$all; + } + + public static function isValid($name) + { + return in_array($name, static::$all); + } + + public static function get($name) + { + if (static::isValid($name)) { + return static::$ns . $name . 'Form'; + } + return null; + } + + /** + * Constructor + * + * @param ConfigFile $cf Config file instance + */ + public function __construct(ConfigFile $cf) + { + $this->_forms = array(); + foreach (static::$all as $form) { + $class = static::get($form); + $this->_forms[] = new $class($cf); + } + } + + /** + * Processes forms, returns true on successful save + * + * @param bool $allow_partial_save allows for partial form saving + * on failed validation + * @param bool $check_form_submit whether check for $_POST['submit_save'] + * + * @return boolean whether processing was successful + */ + public function process($allow_partial_save = true, $check_form_submit = true) + { + $ret = true; + foreach ($this->_forms as $form) { + $ret = $ret && $form->process($allow_partial_save, $check_form_submit); + } + return $ret; + } + + /** + * Displays errors + * + * @return string HTML for errors + */ + public function displayErrors() + { + $ret = ''; + foreach ($this->_forms as $form) { + $ret .= $form->displayErrors(); + } + return $ret; + } + + /** + * Reverts erroneous fields to their default values + * + * @return void + */ + public function fixErrors() + { + foreach ($this->_forms as $form) { + $form->fixErrors(); + } + } + + /** + * Tells whether form validation failed + * + * @return boolean + */ + public function hasErrors() + { + $ret = false; + foreach ($this->_forms as $form) { + $ret = $ret || $form->hasErrors(); + } + return $ret; + } + + /** + * Returns list of fields used in the form. + * + * @return string[] + */ + public static function getFields() + { + $names = []; + foreach (static::$all as $form) { + $class = static::get($form); + $names = array_merge($names, $class::getFields()); + } + return $names; + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/BrowseForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/BrowseForm.php new file mode 100755 index 0000000..e39a7fd --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/BrowseForm.php @@ -0,0 +1,21 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +use PhpMyAdmin\Config\Forms\BaseForm; +use PhpMyAdmin\Config\Forms\User\MainForm; + +class BrowseForm extends BaseForm +{ + public static function getForms() + { + return [ + 'Browse' => MainForm::getForms()['Browse'] + ]; + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/DbStructureForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/DbStructureForm.php new file mode 100755 index 0000000..03c9172 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/DbStructureForm.php @@ -0,0 +1,22 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +use PhpMyAdmin\Config\Forms\BaseForm; +use PhpMyAdmin\Config\Forms\User\MainForm; + +class DbStructureForm extends BaseForm +{ + public static function getForms() + { + return [ + 'DbStructure' => MainForm::getForms()['DbStructure'] + ]; + } +} + diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/EditForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/EditForm.php new file mode 100755 index 0000000..b7b83b0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/EditForm.php @@ -0,0 +1,23 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +use PhpMyAdmin\Config\Forms\BaseForm; +use PhpMyAdmin\Config\Forms\User\MainForm; +use PhpMyAdmin\Config\Forms\User\FeaturesForm; + +class EditForm extends BaseForm +{ + public static function getForms() + { + return [ + 'Edit' => MainForm::getForms()['Edit'], + 'Text_fields' => FeaturesForm::getForms()['Text_fields'], + ]; + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/ExportForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/ExportForm.php new file mode 100755 index 0000000..824be9c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/ExportForm.php @@ -0,0 +1,12 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +class ExportForm extends \PhpMyAdmin\Config\Forms\User\ExportForm +{ +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/ImportForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/ImportForm.php new file mode 100755 index 0000000..991fe62 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/ImportForm.php @@ -0,0 +1,12 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +class ImportForm extends \PhpMyAdmin\Config\Forms\User\ImportForm +{ +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/NaviForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/NaviForm.php new file mode 100755 index 0000000..33fbf33 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/NaviForm.php @@ -0,0 +1,12 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +class NaviForm extends \PhpMyAdmin\Config\Forms\User\NaviForm +{ +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/PageFormList.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/PageFormList.php new file mode 100755 index 0000000..3216842 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/PageFormList.php @@ -0,0 +1,25 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Page preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +use PhpMyAdmin\Config\Forms\BaseFormList; + +class PageFormList extends BaseFormList +{ + protected static $all = array( + 'Browse', + 'DbStructure', + 'Edit', + 'Export', + 'Import', + 'Navi', + 'Sql', + 'TableStructure', + ); + protected static $ns = '\\PhpMyAdmin\\Config\\Forms\\Page\\'; +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/SqlForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/SqlForm.php new file mode 100755 index 0000000..5a276f6 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/SqlForm.php @@ -0,0 +1,12 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +class SqlForm extends \PhpMyAdmin\Config\Forms\User\SqlForm +{ +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Page/TableStructureForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Page/TableStructureForm.php new file mode 100755 index 0000000..bf24540 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Page/TableStructureForm.php @@ -0,0 +1,22 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Page; + +use PhpMyAdmin\Config\Forms\BaseForm; +use PhpMyAdmin\Config\Forms\User\MainForm; + +class TableStructureForm extends BaseForm +{ + public static function getForms() + { + return [ + 'TableStructure' => MainForm::getForms()['TableStructure'] + ]; + } +} + diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/ConfigForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/ConfigForm.php new file mode 100755 index 0000000..35dfd85 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/ConfigForm.php @@ -0,0 +1,23 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +use PhpMyAdmin\Config\Forms\BaseForm; + +class ConfigForm extends BaseForm +{ + public static function getForms() + { + return array( + 'Config' => array( + 'DefaultLang', + 'ServerDefault' + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/ExportForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/ExportForm.php new file mode 100755 index 0000000..09e59a1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/ExportForm.php @@ -0,0 +1,12 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +class ExportForm extends \PhpMyAdmin\Config\Forms\User\ExportForm +{ +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/FeaturesForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/FeaturesForm.php new file mode 100755 index 0000000..58b40f9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/FeaturesForm.php @@ -0,0 +1,63 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +class FeaturesForm extends \PhpMyAdmin\Config\Forms\User\FeaturesForm +{ + public static function getForms() + { + $result = parent::getForms(); + /* Remove only_db/hide_db, we have proper Server form in setup */ + $result['Databases'] = array_diff( + $result['Databases'], + ['Servers/1/only_db', 'Servers/1/hide_db'] + ); + /* Following are not available to user */ + $result['Import_export'] = array( + 'UploadDir', + 'SaveDir', + 'RecodingEngine' => ':group', + 'IconvExtraParams', + ':group:end', + 'ZipDump', + 'GZipDump', + 'BZipDump', + 'CompressOnFly' + ); + $result['Security'] = array( + 'blowfish_secret', + 'CheckConfigurationPermissions', + 'TrustedProxies', + 'AllowUserDropDatabase', + 'AllowArbitraryServer', + 'ArbitraryServerRegexp', + 'LoginCookieRecall', + 'LoginCookieStore', + 'LoginCookieDeleteAll', + 'CaptchaLoginPublicKey', + 'CaptchaLoginPrivateKey' + ); + $result['Developer'] = array( + 'UserprefsDeveloperTab', + 'DBG/sql', + ); + $result['Other_core_settings'] = array( + 'OBGzip', + 'PersistentConnections', + 'ExecTimeLimit', + 'MemoryLimit', + 'UseDbSearch', + 'ProxyUrl', + 'ProxyUser', + 'ProxyPass', + 'AllowThirdPartyFraming', + 'ZeroConf', + ); + return $result; + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/ImportForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/ImportForm.php new file mode 100755 index 0000000..cc36b1b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/ImportForm.php @@ -0,0 +1,12 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +class ImportForm extends \PhpMyAdmin\Config\Forms\User\ImportForm +{ +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/MainForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/MainForm.php new file mode 100755 index 0000000..3359ab8 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/MainForm.php @@ -0,0 +1,20 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +class MainForm extends \PhpMyAdmin\Config\Forms\User\MainForm +{ + public static function getForms() + { + $result = parent::getForms(); + /* Following are not available to user */ + $result['Startup'][] = 'ShowPhpInfo'; + $result['Startup'][] = 'ShowChgPassword'; + return $result; + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/NaviForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/NaviForm.php new file mode 100755 index 0000000..b44d2b0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/NaviForm.php @@ -0,0 +1,12 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +class NaviForm extends \PhpMyAdmin\Config\Forms\User\NaviForm +{ +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/ServersForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/ServersForm.php new file mode 100755 index 0000000..7cd452b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/ServersForm.php @@ -0,0 +1,81 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +use PhpMyAdmin\Config\Forms\BaseForm; + +class ServersForm extends BaseForm +{ + public static function getForms() + { + return array( + 'Server' => array('Servers' => array(1 => array( + 'verbose', + 'host', + 'port', + 'socket', + 'ssl', + 'compress'))), + 'Server_auth' => array('Servers' => array(1 => array( + 'auth_type', + ':group:' . __('Config authentication'), + 'user', + 'password', + ':group:end', + ':group:' . __('HTTP authentication'), + 'auth_http_realm', + ':group:end', + ':group:' . __('Signon authentication'), + 'SignonSession', + 'SignonURL', + 'LogoutURL'))), + 'Server_config' => array('Servers' => array(1 => array( + 'only_db', + 'hide_db', + 'AllowRoot', + 'AllowNoPassword', + 'DisableIS', + 'AllowDeny/order', + 'AllowDeny/rules', + 'SessionTimeZone'))), + 'Server_pmadb' => array('Servers' => array(1 => array( + 'pmadb' => 'phpmyadmin', + 'controlhost', + 'controlport', + 'controluser', + 'controlpass', + 'bookmarktable' => 'pma__bookmark', + 'relation' => 'pma__relation', + 'userconfig' => 'pma__userconfig', + 'users' => 'pma__users', + 'usergroups' => 'pma__usergroups', + 'navigationhiding' => 'pma__navigationhiding', + 'table_info' => 'pma__table_info', + 'column_info' => 'pma__column_info', + 'history' => 'pma__history', + 'recent' => 'pma__recent', + 'favorite' => 'pma__favorite', + 'table_uiprefs' => 'pma__table_uiprefs', + 'tracking' => 'pma__tracking', + 'table_coords' => 'pma__table_coords', + 'pdf_pages' => 'pma__pdf_pages', + 'savedsearches' => 'pma__savedsearches', + 'central_columns' => 'pma__central_columns', + 'designer_settings' => 'pma__designer_settings', + 'export_templates' => 'pma__export_templates', + 'MaxTableUiprefs' => 100))), + 'Server_tracking' => array('Servers' => array(1 => array( + 'tracking_version_auto_create', + 'tracking_default_statements', + 'tracking_add_drop_view', + 'tracking_add_drop_table', + 'tracking_add_drop_database', + ))), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/SetupFormList.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/SetupFormList.php new file mode 100755 index 0000000..900bf05 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/SetupFormList.php @@ -0,0 +1,25 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Setup preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +use PhpMyAdmin\Config\Forms\BaseFormList; + +class SetupFormList extends BaseFormList +{ + protected static $all = array( + 'Config', + 'Export', + 'Features', + 'Import', + 'Main', + 'Navi', + 'Servers', + 'Sql', + ); + protected static $ns = '\\PhpMyAdmin\\Config\\Forms\\Setup\\'; +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/Setup/SqlForm.php b/phpMyAdmin/libraries/classes/Config/Forms/Setup/SqlForm.php new file mode 100755 index 0000000..5d1af45 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/Setup/SqlForm.php @@ -0,0 +1,19 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\Setup; + +class SqlForm extends \PhpMyAdmin\Config\Forms\User\SqlForm +{ + public static function getForms() + { + $result = parent::getForms(); + /* Following are not available to user */ + $result['Sql_queries'][] = 'QueryHistoryDB'; + return $result; + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/User/ExportForm.php b/phpMyAdmin/libraries/classes/Config/Forms/User/ExportForm.php new file mode 100755 index 0000000..8a74c3d --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/User/ExportForm.php @@ -0,0 +1,142 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\User; + +use PhpMyAdmin\Config\Forms\BaseForm; + +class ExportForm extends BaseForm +{ + public static function getForms() + { + return array( + 'Export_defaults' => array( + 'Export/method', + ':group:' . __('Quick'), + 'Export/quick_export_onserver', + 'Export/quick_export_onserver_overwrite', + ':group:end', + ':group:' . __('Custom'), + 'Export/format', + 'Export/compression', + 'Export/charset', + 'Export/lock_tables', + 'Export/as_separate_files', + 'Export/asfile' => ':group', + 'Export/onserver', + 'Export/onserver_overwrite', + ':group:end', + 'Export/file_template_table', + 'Export/file_template_database', + 'Export/file_template_server' + ), + 'Sql' => array( + 'Export/sql_include_comments' => ':group', + 'Export/sql_dates', + 'Export/sql_relation', + 'Export/sql_mime', + ':group:end', + 'Export/sql_use_transaction', + 'Export/sql_disable_fk', + 'Export/sql_views_as_tables', + 'Export/sql_metadata', + 'Export/sql_compatibility', + 'Export/sql_structure_or_data', + ':group:' . __('Structure'), + 'Export/sql_drop_database', + 'Export/sql_create_database', + 'Export/sql_drop_table', + 'Export/sql_create_table' => ':group', + 'Export/sql_if_not_exists', + 'Export/sql_auto_increment', + ':group:end', + 'Export/sql_create_view', + 'Export/sql_procedure_function', + 'Export/sql_create_trigger', + 'Export/sql_backquotes', + ':group:end', + ':group:' . __('Data'), + 'Export/sql_delayed', + 'Export/sql_ignore', + 'Export/sql_type', + 'Export/sql_insert_syntax', + 'Export/sql_max_query_size', + 'Export/sql_hex_for_binary', + 'Export/sql_utc_time' + ), + 'CodeGen' => array( + 'Export/codegen_format' + ), + 'Csv' => array( + ':group:' . __('CSV'), + 'Export/csv_separator', + 'Export/csv_enclosed', + 'Export/csv_escaped', + 'Export/csv_terminated', + 'Export/csv_null', + 'Export/csv_removeCRLF', + 'Export/csv_columns', + ':group:end', + ':group:' . __('CSV for MS Excel'), + 'Export/excel_null', + 'Export/excel_removeCRLF', + 'Export/excel_columns', + 'Export/excel_edition' + ), + 'Latex' => array( + 'Export/latex_caption', + 'Export/latex_structure_or_data', + ':group:' . __('Structure'), + 'Export/latex_structure_caption', + 'Export/latex_structure_continued_caption', + 'Export/latex_structure_label', + 'Export/latex_relation', + 'Export/latex_comments', + 'Export/latex_mime', + ':group:end', + ':group:' . __('Data'), + 'Export/latex_columns', + 'Export/latex_data_caption', + 'Export/latex_data_continued_caption', + 'Export/latex_data_label', + 'Export/latex_null' + ), + 'Microsoft_Office' => array( + ':group:' . __('Microsoft Word 2000'), + 'Export/htmlword_structure_or_data', + 'Export/htmlword_null', + 'Export/htmlword_columns'), + 'Open_Document' => array( + ':group:' . __('OpenDocument Spreadsheet'), + 'Export/ods_columns', + 'Export/ods_null', + ':group:end', + ':group:' . __('OpenDocument Text'), + 'Export/odt_structure_or_data', + ':group:' . __('Structure'), + 'Export/odt_relation', + 'Export/odt_comments', + 'Export/odt_mime', + ':group:end', + ':group:' . __('Data'), + 'Export/odt_columns', + 'Export/odt_null' + ), + 'Texy' => array( + 'Export/texytext_structure_or_data', + ':group:' . __('Data'), + 'Export/texytext_null', + 'Export/texytext_columns' + ), + ); + } + + public static function getName() + { + return __('Export'); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/User/FeaturesForm.php b/phpMyAdmin/libraries/classes/Config/Forms/User/FeaturesForm.php new file mode 100755 index 0000000..9a121e9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/User/FeaturesForm.php @@ -0,0 +1,84 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\User; + +use PhpMyAdmin\Config\Forms\BaseForm; + +class FeaturesForm extends BaseForm +{ + public static function getForms() + { + $result = array( + 'General' => array( + 'VersionCheck', + 'NaturalOrder', + 'InitialSlidersState', + 'SkipLockedTables', + 'DisableMultiTableMaintenance', + 'ShowHint', + 'SendErrorReports', + 'ConsoleEnterExecutes', + 'DisableShortcutKeys', + 'FontSize', + ), + 'Databases' => array( + 'Servers/1/only_db', // saves to Server/only_db + 'Servers/1/hide_db', // saves to Server/hide_db + 'MaxDbList', + 'MaxTableList', + 'DefaultConnectionCollation', + ), + 'Text_fields' => array( + 'CharEditing', + 'MinSizeForInputField', + 'MaxSizeForInputField', + 'CharTextareaCols', + 'CharTextareaRows', + 'TextareaCols', + 'TextareaRows', + 'LongtextDoubleTextarea' + ), + 'Page_titles' => array( + 'TitleDefault', + 'TitleTable', + 'TitleDatabase', + 'TitleServer' + ), + 'Warnings' => array( + 'PmaNoRelation_DisableWarning', + 'SuhosinDisableWarning', + 'LoginCookieValidityDisableWarning', + 'ReservedWordDisableWarning' + ), + 'Console' => array( + 'Console/Mode', + 'Console/StartHistory', + 'Console/AlwaysExpand', + 'Console/CurrentQuery', + 'Console/EnterExecutes', + 'Console/DarkTheme', + 'Console/Height', + 'Console/GroupQueries', + 'Console/OrderBy', + 'Console/Order', + ), + ); + // skip Developer form if no setting is available + if ($GLOBALS['cfg']['UserprefsDeveloperTab']) { + $result['Developer'] = array( + 'DBG/sql' + ); + } + return $result; + } + + public static function getName() + { + return __('Features'); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/User/ImportForm.php b/phpMyAdmin/libraries/classes/Config/Forms/User/ImportForm.php new file mode 100755 index 0000000..daf5c43 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/User/ImportForm.php @@ -0,0 +1,60 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\User; + +use PhpMyAdmin\Config\Forms\BaseForm; + +class ImportForm extends BaseForm +{ + public static function getForms() + { + return array( + 'Import_defaults' => array( + 'Import/format', + 'Import/charset', + 'Import/allow_interrupt', + 'Import/skip_queries' + ), + 'Sql' => array( + 'Import/sql_compatibility', + 'Import/sql_no_auto_value_on_zero', + 'Import/sql_read_as_multibytes' + ), + 'Csv' => array( + ':group:' . __('CSV'), + 'Import/csv_replace', + 'Import/csv_ignore', + 'Import/csv_terminated', + 'Import/csv_enclosed', + 'Import/csv_escaped', + 'Import/csv_col_names', + ':group:end', + ':group:' . __('CSV using LOAD DATA'), + 'Import/ldi_replace', + 'Import/ldi_ignore', + 'Import/ldi_terminated', + 'Import/ldi_enclosed', + 'Import/ldi_escaped', + 'Import/ldi_local_option' + ), + 'Open_Document' => array( + ':group:' . __('OpenDocument Spreadsheet'), + 'Import/ods_col_names', + 'Import/ods_empty_rows', + 'Import/ods_recognize_percentages', + 'Import/ods_recognize_currency' + ), + + ); + } + + public static function getName() + { + return __('Import'); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/User/MainForm.php b/phpMyAdmin/libraries/classes/Config/Forms/User/MainForm.php new file mode 100755 index 0000000..e3c54ed --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/User/MainForm.php @@ -0,0 +1,86 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\User; + +use PhpMyAdmin\Config\Forms\BaseForm; + +class MainForm extends BaseForm +{ + public static function getForms() + { + return array( + 'Startup' => array( + 'ShowCreateDb', + 'ShowStats', + 'ShowServerInfo' + ), + 'DbStructure' => array( + 'ShowDbStructureCharset', + 'ShowDbStructureComment', + 'ShowDbStructureCreation', + 'ShowDbStructureLastUpdate', + 'ShowDbStructureLastCheck' + ), + 'TableStructure' => array( + 'HideStructureActions', + 'ShowColumnComments', + ':group:' . __('Default transformations'), + 'DefaultTransformations/Hex', + 'DefaultTransformations/Substring', + 'DefaultTransformations/Bool2Text', + 'DefaultTransformations/External', + 'DefaultTransformations/PreApPend', + 'DefaultTransformations/DateFormat', + 'DefaultTransformations/Inline', + 'DefaultTransformations/TextImageLink', + 'DefaultTransformations/TextLink', + ':group:end' + ), + 'Browse' => array( + 'TableNavigationLinksMode', + 'ActionLinksMode', + 'ShowAll', + 'MaxRows', + 'Order', + 'BrowsePointerEnable', + 'BrowseMarkerEnable', + 'GridEditing', + 'SaveCellsAtOnce', + 'RepeatCells', + 'LimitChars', + 'RowActionLinks', + 'RowActionLinksWithoutUnique', + 'TablePrimaryKeyOrder', + 'RememberSorting', + 'RelationalDisplay' + ), + 'Edit' => array( + 'ProtectBinary', + 'ShowFunctionFields', + 'ShowFieldTypesInDataEditView', + 'InsertRows', + 'ForeignKeyDropdownOrder', + 'ForeignKeyMaxLimit' + ), + 'Tabs' => array( + 'TabsMode', + 'DefaultTabServer', + 'DefaultTabDatabase', + 'DefaultTabTable' + ), + 'DisplayRelationalSchema' => array( + 'PDFDefaultPageSize' + ), + ); + } + + public static function getName() + { + return __('Main panel'); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/User/NaviForm.php b/phpMyAdmin/libraries/classes/Config/Forms/User/NaviForm.php new file mode 100755 index 0000000..1d9ff1f --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/User/NaviForm.php @@ -0,0 +1,61 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\User; + +use PhpMyAdmin\Config\Forms\BaseForm; + +class NaviForm extends BaseForm +{ + public static function getForms() + { + return array( + 'Navi_panel' => array( + 'ShowDatabasesNavigationAsTree', + 'NavigationLinkWithMainPanel', + 'NavigationDisplayLogo', + 'NavigationLogoLink', + 'NavigationLogoLinkWindow', + 'NavigationTreePointerEnable', + 'FirstLevelNavigationItems', + 'NavigationTreeDisplayItemFilterMinimum', + 'NumRecentTables', + 'NumFavoriteTables', + 'NavigationWidth', + ), + 'Navi_tree' => array( + 'MaxNavigationItems', + 'NavigationTreeEnableGrouping', + 'NavigationTreeEnableExpansion', + 'NavigationTreeShowTables', + 'NavigationTreeShowViews', + 'NavigationTreeShowFunctions', + 'NavigationTreeShowProcedures', + 'NavigationTreeShowEvents' + ), + 'Navi_servers' => array( + 'NavigationDisplayServers', + 'DisplayServersList', + ), + 'Navi_databases' => array( + 'NavigationTreeDisplayDbFilterMinimum', + 'NavigationTreeDbSeparator' + ), + 'Navi_tables' => array( + 'NavigationTreeDefaultTabTable', + 'NavigationTreeDefaultTabTable2', + 'NavigationTreeTableSeparator', + 'NavigationTreeTableLevel', + ), + ); + } + + public static function getName() + { + return __('Navigation panel'); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/User/SqlForm.php b/phpMyAdmin/libraries/classes/Config/Forms/User/SqlForm.php new file mode 100755 index 0000000..2058076 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/User/SqlForm.php @@ -0,0 +1,42 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\User; + +use PhpMyAdmin\Config\Forms\BaseForm; + +class SqlForm extends BaseForm +{ + public static function getForms() + { + return array( + 'Sql_queries' => array( + 'ShowSQL', + 'Confirm', + 'QueryHistoryMax', + 'IgnoreMultiSubmitErrors', + 'MaxCharactersInDisplayedSQL', + 'RetainQueryBox', + 'CodemirrorEnable', + 'LintEnable', + 'EnableAutocompleteForTablesAndColumns', + 'DefaultForeignKeyChecks', + ), + 'Sql_box' => array( + 'SQLQuery/Edit', + 'SQLQuery/Explain', + 'SQLQuery/ShowAsPHP', + 'SQLQuery/Refresh', + ), + ); + } + + public static function getName() + { + return __('SQL queries'); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Forms/User/UserFormList.php b/phpMyAdmin/libraries/classes/Config/Forms/User/UserFormList.php new file mode 100755 index 0000000..f32cae3 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Forms/User/UserFormList.php @@ -0,0 +1,23 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * User preferences form + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config\Forms\User; + +use PhpMyAdmin\Config\Forms\BaseFormList; + +class UserFormList extends BaseFormList +{ + protected static $all = array( + 'Features', + 'Sql', + 'Navi', + 'Main', + 'Import', + 'Export', + ); + protected static $ns = '\\PhpMyAdmin\\Config\\Forms\\User\\'; +} diff --git a/phpMyAdmin/libraries/classes/Config/PageSettings.php b/phpMyAdmin/libraries/classes/Config/PageSettings.php new file mode 100755 index 0000000..dee1eea --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/PageSettings.php @@ -0,0 +1,231 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Page-related settings + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config; + +use PhpMyAdmin\Config\ConfigFile; +use PhpMyAdmin\Config\FormDisplay; +use PhpMyAdmin\Config\Forms\Page\PageFormList; +use PhpMyAdmin\Core; +use PhpMyAdmin\Message; +use PhpMyAdmin\Response; +use PhpMyAdmin\UserPreferences; + +/** + * Page-related settings + * + * @package PhpMyAdmin + */ +class PageSettings +{ + + /** + * Contains id of the form element + * @var string + */ + private $_elemId = 'page_settings_modal'; + + /** + * Name of the group to show + * @var string + */ + private $_groupName = ''; + + /** + * Contains HTML of errors + * @var string + */ + private $_errorHTML = ''; + + /** + * Contains HTML of settings + * @var string + */ + private $_HTML = ''; + + /** + * @var UserPreferences + */ + private $userPreferences; + + /** + * Constructor + * + * @param string $formGroupName The name of config form group to display + * @param string $elemId Id of the div containing settings + */ + public function __construct($formGroupName, $elemId = null) + { + $this->userPreferences = new UserPreferences(); + + $form_class = PageFormList::get($formGroupName); + if (is_null($form_class)) { + return; + } + + if (isset($_REQUEST['printview']) && $_REQUEST['printview'] == '1') { + return; + } + + if (!empty($elemId)) { + $this->_elemId = $elemId; + } + $this->_groupName = $formGroupName; + + $cf = new ConfigFile($GLOBALS['PMA_Config']->base_settings); + $this->userPreferences->pageInit($cf); + + $form_display = new $form_class($cf); + + // Process form + $error = null; + if (isset($_POST['submit_save']) + && $_POST['submit_save'] == $formGroupName + ) { + $this->_processPageSettings($form_display, $cf, $error); + } + + // Display forms + $this->_HTML = $this->_getPageSettingsDisplay($form_display, $error); + } + + /** + * Process response to form + * + * @param FormDisplay &$form_display Form + * @param ConfigFile &$cf Configuration file + * @param Message|null &$error Error message + * + * @return void + */ + private function _processPageSettings(&$form_display, &$cf, &$error) + { + if ($form_display->process(false) && !$form_display->hasErrors()) { + // save settings + $result = $this->userPreferences->save($cf->getConfigArray()); + if ($result === true) { + // reload page + $response = Response::getInstance(); + Core::sendHeaderLocation( + $response->getFooter()->getSelfUrl('unencoded') + ); + exit(); + } else { + $error = $result; + } + } + } + + /** + * Store errors in _errorHTML + * + * @param FormDisplay &$form_display Form + * @param Message|null &$error Error message + * + * @return void + */ + private function _storeError(&$form_display, &$error) + { + $retval = ''; + if ($error) { + $retval .= $error->getDisplay(); + } + if ($form_display->hasErrors()) { + // form has errors + $retval .= '<div class="error config-form">' + . '<b>' . __( + 'Cannot save settings, submitted configuration form contains ' + . 'errors!' + ) . '</b>' + . $form_display->displayErrors() + . '</div>'; + } + $this->_errorHTML = $retval; + } + + /** + * Display page-related settings + * + * @param FormDisplay &$form_display Form + * @param Message &$error Error message + * + * @return string + */ + private function _getPageSettingsDisplay(&$form_display, &$error) + { + $response = Response::getInstance(); + + $retval = ''; + + $this->_storeError($form_display, $error); + + $retval .= '<div id="' . $this->_elemId . '">'; + $retval .= '<div class="page_settings">'; + $retval .= $form_display->getDisplay( + true, + true, + false, + $response->getFooter()->getSelfUrl(), + array( + 'submit_save' => $this->_groupName + ) + ); + $retval .= '</div>'; + $retval .= '</div>'; + + return $retval; + } + + /** + * Get HTML output + * + * @return string + */ + public function getHTML() + { + return $this->_HTML; + } + + /** + * Get error HTML output + * + * @return string + */ + public function getErrorHTML() + { + return $this->_errorHTML; + } + + /** + * Group to show for Page-related settings + * @param string $formGroupName The name of config form group to display + * @return PageSettings + */ + public static function showGroup($formGroupName) + { + $object = new PageSettings($formGroupName); + + $response = Response::getInstance(); + $response->addHTML($object->getErrorHTML()); + $response->addHTML($object->getHTML()); + + return $object; + } + + /** + * Get HTML for navigation settings + * @return string + */ + public static function getNaviSettings() + { + $object = new PageSettings('Navi', 'pma_navigation_settings'); + + $response = Response::getInstance(); + $response->addHTML($object->getErrorHTML()); + return $object->getHTML(); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/ServerConfigChecks.php b/phpMyAdmin/libraries/classes/Config/ServerConfigChecks.php new file mode 100755 index 0000000..485c3b4 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/ServerConfigChecks.php @@ -0,0 +1,560 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Server config checks management + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config; + +use PhpMyAdmin\Config\ConfigFile; +use PhpMyAdmin\Config\Descriptions; +use PhpMyAdmin\Core; +use PhpMyAdmin\Sanitize; +use PhpMyAdmin\Setup\Index as SetupIndex; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Performs various compatibility, security and consistency checks on current config + * + * Outputs results to message list, must be called between SetupIndex::messagesBegin() + * and SetupIndex::messagesEnd() + * + * @package PhpMyAdmin + */ +class ServerConfigChecks +{ + /** + * @var ConfigFile configurations being checked + */ + protected $cfg; + + /** + * Constructor. + * + * @param ConfigFile $cfg Configuration + */ + public function __construct(ConfigFile $cfg) + { + $this->cfg = $cfg; + } + + /** + * Perform config checks + * + * @return void + */ + public function performConfigChecks() + { + $blowfishSecret = $this->cfg->get('blowfish_secret'); + $blowfishSecretSet = false; + $cookieAuthUsed = false; + + list($cookieAuthUsed, $blowfishSecret, $blowfishSecretSet) + = $this->performConfigChecksServers( + $cookieAuthUsed, $blowfishSecret, $blowfishSecretSet + ); + + $this->performConfigChecksCookieAuthUsed( + $cookieAuthUsed, $blowfishSecretSet, + $blowfishSecret + ); + + // + // $cfg['AllowArbitraryServer'] + // should be disabled + // + if ($this->cfg->getValue('AllowArbitraryServer')) { + $sAllowArbitraryServerWarn = sprintf( + __( + 'This %soption%s should be disabled as it allows attackers to ' + . 'bruteforce login to any MySQL server. If you feel this is necessary, ' + . 'use %srestrict login to MySQL server%s or %strusted proxies list%s. ' + . 'However, IP-based protection with trusted proxies list may not be ' + . 'reliable if your IP belongs to an ISP where thousands of users, ' + . 'including you, are connected to.' + ), + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Security]', + '[/a]', + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Security]', + '[/a]', + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Security]', + '[/a]' + ); + SetupIndex::messagesSet( + 'notice', + 'AllowArbitraryServer', + Descriptions::get('AllowArbitraryServer'), + Sanitize::sanitize($sAllowArbitraryServerWarn) + ); + } + + $this->performConfigChecksLoginCookie(); + + $sDirectoryNotice = __( + 'This value should be double checked to ensure that this directory is ' + . 'neither world accessible nor readable or writable by other users on ' + . 'your server.' + ); + + // + // $cfg['SaveDir'] + // should not be world-accessible + // + if ($this->cfg->getValue('SaveDir') != '') { + SetupIndex::messagesSet( + 'notice', + 'SaveDir', + Descriptions::get('SaveDir'), + Sanitize::sanitize($sDirectoryNotice) + ); + } + + // + // $cfg['TempDir'] + // should not be world-accessible + // + if ($this->cfg->getValue('TempDir') != '') { + SetupIndex::messagesSet( + 'notice', + 'TempDir', + Descriptions::get('TempDir'), + Sanitize::sanitize($sDirectoryNotice) + ); + } + + $this->performConfigChecksZips(); + } + + /** + * Check config of servers + * + * @param boolean $cookieAuthUsed Cookie auth is used + * @param string $blowfishSecret Blowfish secret + * @param boolean $blowfishSecretSet Blowfish secret set + * + * @return array + */ + protected function performConfigChecksServers( + $cookieAuthUsed, $blowfishSecret, + $blowfishSecretSet + ) { + $serverCnt = $this->cfg->getServerCount(); + for ($i = 1; $i <= $serverCnt; $i++) { + $cookieAuthServer + = ($this->cfg->getValue("Servers/$i/auth_type") == 'cookie'); + $cookieAuthUsed |= $cookieAuthServer; + $serverName = $this->performConfigChecksServersGetServerName( + $this->cfg->getServerName($i), $i + ); + $serverName = htmlspecialchars($serverName); + + list($blowfishSecret, $blowfishSecretSet) + = $this->performConfigChecksServersSetBlowfishSecret( + $blowfishSecret, $cookieAuthServer, $blowfishSecretSet + ); + + // + // $cfg['Servers'][$i]['ssl'] + // should be enabled if possible + // + if (!$this->cfg->getValue("Servers/$i/ssl")) { + $title = Descriptions::get('Servers/1/ssl') . " ($serverName)"; + SetupIndex::messagesSet( + 'notice', + "Servers/$i/ssl", + $title, + __( + 'You should use SSL connections if your database server ' + . 'supports it.' + ) + ); + } + $sSecurityInfoMsg = Sanitize::sanitize(sprintf( + __( + 'If you feel this is necessary, use additional protection settings - ' + . '%1$shost authentication%2$s settings and %3$strusted proxies list%4%s. ' + . 'However, IP-based protection may not be reliable if your IP belongs ' + . 'to an ISP where thousands of users, including you, are connected to.' + ), + '[a@' . Url::getCommon(array('page' => 'servers', 'mode' => 'edit', 'id' => $i)) . '#tab_Server_config]', + '[/a]', + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Security]', + '[/a]' + )); + + // + // $cfg['Servers'][$i]['auth_type'] + // warn about full user credentials if 'auth_type' is 'config' + // + if ($this->cfg->getValue("Servers/$i/auth_type") == 'config' + && $this->cfg->getValue("Servers/$i/user") != '' + && $this->cfg->getValue("Servers/$i/password") != '' + ) { + $title = Descriptions::get('Servers/1/auth_type') + . " ($serverName)"; + SetupIndex::messagesSet( + 'notice', + "Servers/$i/auth_type", + $title, + Sanitize::sanitize(sprintf( + __( + 'You set the [kbd]config[/kbd] authentication type and included ' + . 'username and password for auto-login, which is not a desirable ' + . 'option for live hosts. Anyone who knows or guesses your phpMyAdmin ' + . 'URL can directly access your phpMyAdmin panel. Set %1$sauthentication ' + . 'type%2$s to [kbd]cookie[/kbd] or [kbd]http[/kbd].' + ), + '[a@' . Url::getCommon(array('page' => 'servers', 'mode' => 'edit', 'id' => $i)) . '#tab_Server]', + '[/a]' + )) + . ' ' . $sSecurityInfoMsg + ); + } + + // + // $cfg['Servers'][$i]['AllowRoot'] + // $cfg['Servers'][$i]['AllowNoPassword'] + // serious security flaw + // + if ($this->cfg->getValue("Servers/$i/AllowRoot") + && $this->cfg->getValue("Servers/$i/AllowNoPassword") + ) { + $title = Descriptions::get('Servers/1/AllowNoPassword') + . " ($serverName)"; + SetupIndex::messagesSet( + 'notice', + "Servers/$i/AllowNoPassword", + $title, + __('You allow for connecting to the server without a password.') + . ' ' . $sSecurityInfoMsg + ); + } + } + return array($cookieAuthUsed, $blowfishSecret, $blowfishSecretSet); + } + + /** + * Set blowfish secret + * + * @param string $blowfishSecret Blowfish secret + * @param boolean $cookieAuthServer Cookie auth is used + * @param boolean $blowfishSecretSet Blowfish secret set + * + * @return array + */ + protected function performConfigChecksServersSetBlowfishSecret( + $blowfishSecret, $cookieAuthServer, $blowfishSecretSet + ) { + if ($cookieAuthServer && $blowfishSecret === null) { + $blowfishSecretSet = true; + $this->cfg->set('blowfish_secret', Util::generateRandom(32)); + } + return array($blowfishSecret, $blowfishSecretSet); + } + + /** + * Define server name + * + * @param string $serverName Server name + * @param int $serverId Server id + * + * @return string Server name + */ + protected function performConfigChecksServersGetServerName( + $serverName, $serverId + ) { + if ($serverName == 'localhost') { + $serverName .= " [$serverId]"; + return $serverName; + } + return $serverName; + } + + /** + * Perform config checks for zip part. + * + * @return void + */ + protected function performConfigChecksZips() { + $this->performConfigChecksServerGZipdump(); + $this->performConfigChecksServerBZipdump(); + $this->performConfigChecksServersZipdump(); + } + + /** + * Perform config checks for zip part. + * + * @return void + */ + protected function performConfigChecksServersZipdump() { + // + // $cfg['ZipDump'] + // requires zip_open in import + // + if ($this->cfg->getValue('ZipDump') && !$this->functionExists('zip_open')) { + SetupIndex::messagesSet( + 'error', + 'ZipDump_import', + Descriptions::get('ZipDump'), + Sanitize::sanitize(sprintf( + __( + '%sZip decompression%s requires functions (%s) which are unavailable ' + . 'on this system.' + ), + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Import_export]', + '[/a]', + 'zip_open' + )) + ); + } + + // + // $cfg['ZipDump'] + // requires gzcompress in export + // + if ($this->cfg->getValue('ZipDump') && !$this->functionExists('gzcompress')) { + SetupIndex::messagesSet( + 'error', + 'ZipDump_export', + Descriptions::get('ZipDump'), + Sanitize::sanitize(sprintf( + __( + '%sZip compression%s requires functions (%s) which are unavailable on ' + . 'this system.' + ), + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Import_export]', + '[/a]', + 'gzcompress' + )) + ); + } + } + + /** + * Check config of servers + * + * @param boolean $cookieAuthUsed Cookie auth is used + * @param boolean $blowfishSecretSet Blowfish secret set + * @param string $blowfishSecret Blowfish secret + * + * @return array + */ + protected function performConfigChecksCookieAuthUsed( + $cookieAuthUsed, $blowfishSecretSet, + $blowfishSecret + ) { + // + // $cfg['blowfish_secret'] + // it's required for 'cookie' authentication + // + if ($cookieAuthUsed) { + if ($blowfishSecretSet) { + // 'cookie' auth used, blowfish_secret was generated + SetupIndex::messagesSet( + 'notice', + 'blowfish_secret_created', + Descriptions::get('blowfish_secret'), + Sanitize::sanitize(__( + 'You didn\'t have blowfish secret set and have enabled ' + . '[kbd]cookie[/kbd] authentication, so a key was automatically ' + . 'generated for you. It is used to encrypt cookies; you don\'t need to ' + . 'remember it.' + )) + ); + } else { + $blowfishWarnings = array(); + // check length + if (strlen($blowfishSecret) < 32) { + // too short key + $blowfishWarnings[] = __( + 'Key is too short, it should have at least 32 characters.' + ); + } + // check used characters + $hasDigits = (bool)preg_match('/\d/', $blowfishSecret); + $hasChars = (bool)preg_match('/\S/', $blowfishSecret); + $hasNonword = (bool)preg_match('/\W/', $blowfishSecret); + if (!$hasDigits || !$hasChars || !$hasNonword) { + $blowfishWarnings[] = Sanitize::sanitize( + __( + 'Key should contain letters, numbers [em]and[/em] ' + . 'special characters.' + ) + ); + } + if (!empty($blowfishWarnings)) { + SetupIndex::messagesSet( + 'error', + 'blowfish_warnings' . count($blowfishWarnings), + Descriptions::get('blowfish_secret'), + implode('<br />', $blowfishWarnings) + ); + } + } + } + } + + /** + * Check configuration for login cookie + * + * @return void + */ + protected function performConfigChecksLoginCookie() { + // + // $cfg['LoginCookieValidity'] + // value greater than session.gc_maxlifetime will cause + // random session invalidation after that time + $loginCookieValidity = $this->cfg->getValue('LoginCookieValidity'); + if ($loginCookieValidity > ini_get('session.gc_maxlifetime') + ) { + SetupIndex::messagesSet( + 'error', + 'LoginCookieValidity', + Descriptions::get('LoginCookieValidity'), + Sanitize::sanitize(sprintf( + __( + '%1$sLogin cookie validity%2$s greater than %3$ssession.gc_maxlifetime%4$s may ' + . 'cause random session invalidation (currently session.gc_maxlifetime ' + . 'is %5$d).' + ), + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Security]', + '[/a]', + '[a@' . Core::getPHPDocLink('session.configuration.php#ini.session.gc-maxlifetime') . ']', + '[/a]', + ini_get('session.gc_maxlifetime') + )) + ); + } + + // + // $cfg['LoginCookieValidity'] + // should be at most 1800 (30 min) + // + if ($loginCookieValidity > 1800) { + SetupIndex::messagesSet( + 'notice', + 'LoginCookieValidity', + Descriptions::get('LoginCookieValidity'), + Sanitize::sanitize(sprintf( + __( + '%sLogin cookie validity%s should be set to 1800 seconds (30 minutes) ' + . 'at most. Values larger than 1800 may pose a security risk such as ' + . 'impersonation.' + ), + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Security]', + '[/a]' + )) + ); + } + + // + // $cfg['LoginCookieValidity'] + // $cfg['LoginCookieStore'] + // LoginCookieValidity must be less or equal to LoginCookieStore + // + if (($this->cfg->getValue('LoginCookieStore') != 0) + && ($loginCookieValidity > $this->cfg->getValue('LoginCookieStore')) + ) { + SetupIndex::messagesSet( + 'error', + 'LoginCookieValidity', + Descriptions::get('LoginCookieValidity'), + Sanitize::sanitize(sprintf( + __( + 'If using [kbd]cookie[/kbd] authentication and %sLogin cookie store%s ' + . 'is not 0, %sLogin cookie validity%s must be set to a value less or ' + . 'equal to it.' + ), + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Security]', + '[/a]', + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Security]', + '[/a]' + )) + ); + } + } + + /** + * Check GZipDump configuration + * + * @return void + */ + protected function performConfigChecksServerBZipdump() + { + // + // $cfg['BZipDump'] + // requires bzip2 functions + // + if ($this->cfg->getValue('BZipDump') + && (!$this->functionExists('bzopen') || !$this->functionExists('bzcompress')) + ) { + $functions = $this->functionExists('bzopen') + ? '' : + 'bzopen'; + $functions .= $this->functionExists('bzcompress') + ? '' + : ($functions ? ', ' : '') . 'bzcompress'; + SetupIndex::messagesSet( + 'error', + 'BZipDump', + Descriptions::get('BZipDump'), + Sanitize::sanitize( + sprintf( + __( + '%1$sBzip2 compression and decompression%2$s requires functions (%3$s) which ' + . 'are unavailable on this system.' + ), + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Import_export]', + '[/a]', + $functions + ) + ) + ); + } + } + + /** + * Check GZipDump configuration + * + * @return void + */ + protected function performConfigChecksServerGZipdump() + { + // + // $cfg['GZipDump'] + // requires zlib functions + // + if ($this->cfg->getValue('GZipDump') + && (!$this->functionExists('gzopen') || !$this->functionExists('gzencode')) + ) { + SetupIndex::messagesSet( + 'error', + 'GZipDump', + Descriptions::get('GZipDump'), + Sanitize::sanitize(sprintf( + __( + '%1$sGZip compression and decompression%2$s requires functions (%3$s) which ' + . 'are unavailable on this system.' + ), + '[a@' . Url::getCommon(array('page' => 'form', 'formset' => 'Features')) . '#tab_Import_export]', + '[/a]', + 'gzencode' + )) + ); + } + } + + /** + * Wrapper around function_exists to allow mock in test + * + * @param string $name Function name + * + * @return boolean + */ + protected function functionExists($name) + { + return function_exists($name); + } +} diff --git a/phpMyAdmin/libraries/classes/Config/Validator.php b/phpMyAdmin/libraries/classes/Config/Validator.php new file mode 100755 index 0000000..2d0bcf3 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Config/Validator.php @@ -0,0 +1,589 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Form validation for configuration editor + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Config; + +use PhpMyAdmin\Config\ConfigFile; +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Util; + +/** + * Validation class for various validation functions + * + * Validation function takes two argument: id for which it is called + * and array of fields' values (usually values for entire formset, as defined + * in forms.inc.php). + * The function must always return an array with an error (or error array) + * assigned to a form element (formset name or field path). Even if there are + * no errors, key must be set with an empty value. + * + * Validation functions are assigned in $cfg_db['_validators'] (config.values.php). + * + * @package PhpMyAdmin + */ +class Validator +{ + /** + * Returns validator list + * + * @param ConfigFile $cf Config file instance + * + * @return array + */ + public static function getValidators(ConfigFile $cf) + { + static $validators = null; + + if ($validators !== null) { + return $validators; + } + + $validators = $cf->getDbEntry('_validators', array()); + if ($GLOBALS['PMA_Config']->get('is_setup')) { + return $validators; + } + + // not in setup script: load additional validators for user + // preferences we need original config values not overwritten + // by user preferences, creating a new PhpMyAdmin\Config instance is a + // better idea than hacking into its code + $uvs = $cf->getDbEntry('_userValidators', array()); + foreach ($uvs as $field => $uv_list) { + $uv_list = (array)$uv_list; + foreach ($uv_list as &$uv) { + if (!is_array($uv)) { + continue; + } + for ($i = 1, $nb = count($uv); $i < $nb; $i++) { + if (mb_substr($uv[$i], 0, 6) == 'value:') { + $uv[$i] = Core::arrayRead( + mb_substr($uv[$i], 6), + $GLOBALS['PMA_Config']->base_settings + ); + } + } + } + $validators[$field] = isset($validators[$field]) + ? array_merge((array)$validators[$field], $uv_list) + : $uv_list; + } + return $validators; + } + + /** + * Runs validation $validator_id on values $values and returns error list. + * + * Return values: + * o array, keys - field path or formset id, values - array of errors + * when $isPostSource is true values is an empty array to allow for error list + * cleanup in HTML document + * o false - when no validators match name(s) given by $validator_id + * + * @param ConfigFile $cf Config file instance + * @param string|array $validator_id ID of validator(s) to run + * @param array &$values Values to validate + * @param bool $isPostSource tells whether $values are directly from + * POST request + * + * @return bool|array + */ + public static function validate( + ConfigFile $cf, $validator_id, array &$values, $isPostSource + ) { + // find validators + $validator_id = (array) $validator_id; + $validators = static::getValidators($cf); + $vids = array(); + foreach ($validator_id as &$vid) { + $vid = $cf->getCanonicalPath($vid); + if (isset($validators[$vid])) { + $vids[] = $vid; + } + } + if (empty($vids)) { + return false; + } + + // create argument list with canonical paths and remember path mapping + $arguments = array(); + $key_map = array(); + foreach ($values as $k => $v) { + $k2 = $isPostSource ? str_replace('-', '/', $k) : $k; + $k2 = mb_strpos($k2, '/') + ? $cf->getCanonicalPath($k2) + : $k2; + $key_map[$k2] = $k; + $arguments[$k2] = $v; + } + + // validate + $result = array(); + foreach ($vids as $vid) { + // call appropriate validation functions + foreach ((array)$validators[$vid] as $validator) { + $vdef = (array) $validator; + $vname = array_shift($vdef); + $vname = 'PhpMyAdmin\Config\Validator::' . $vname; + $args = array_merge(array($vid, &$arguments), $vdef); + $r = call_user_func_array($vname, $args); + + // merge results + if (!is_array($r)) { + continue; + } + + foreach ($r as $key => $error_list) { + // skip empty values if $isPostSource is false + if (! $isPostSource && empty($error_list)) { + continue; + } + if (! isset($result[$key])) { + $result[$key] = array(); + } + $result[$key] = array_merge( + $result[$key], (array)$error_list + ); + } + } + } + + // restore original paths + $new_result = array(); + foreach ($result as $k => $v) { + $k2 = isset($key_map[$k]) ? $key_map[$k] : $k; + if (is_array($v)) { + $new_result[$k2] = array_map('htmlspecialchars', $v); + } else { + $new_result[$k2] = htmlspecialchars($v); + } + } + return empty($new_result) ? true : $new_result; + } + + /** + * Test database connection + * + * @param string $host host name + * @param string $port tcp port to use + * @param string $socket socket to use + * @param string $user username to use + * @param string $pass password to use + * @param string $error_key key to use in return array + * + * @return bool|array + */ + public static function testDBConnection( + $host, + $port, + $socket, + $user, + $pass = null, + $error_key = 'Server' + ) { + if ($GLOBALS['cfg']['DBG']['demo']) { + // Connection test disabled on the demo server! + return true; + } + + $error = null; + $host = Core::sanitizeMySQLHost($host); + + if (function_exists('error_clear_last')) { + /* PHP 7 only code */ + error_clear_last(); + } + + if (DatabaseInterface::checkDbExtension('mysqli')) { + $socket = empty($socket) ? null : $socket; + $port = empty($port) ? null : $port; + $extension = 'mysqli'; + } else { + $socket = empty($socket) ? null : ':' . ($socket[0] == '/' ? '' : '/') . $socket; + $port = empty($port) ? null : ':' . $port; + $extension = 'mysql'; + } + + if ($extension == 'mysql') { + $conn = @mysql_connect($host . $port . $socket, $user, $pass); + if (! $conn) { + $error = __('Could not connect to the database server!'); + } else { + mysql_close($conn); + } + } else { + $conn = @mysqli_connect($host, $user, $pass, null, $port, $socket); + if (! $conn) { + $error = __('Could not connect to the database server!'); + } else { + mysqli_close($conn); + } + } + if (! is_null($error)) { + $error .= ' - ' . error_get_last(); + } + return is_null($error) ? true : array($error_key => $error); + } + + /** + * Validate server config + * + * @param string $path path to config, not used + * keep this parameter since the method is invoked using + * reflection along with other similar methods + * @param array $values config values + * + * @return array + */ + public static function validateServer($path, array $values) + { + $result = array( + 'Server' => '', + 'Servers/1/user' => '', + 'Servers/1/SignonSession' => '', + 'Servers/1/SignonURL' => '' + ); + $error = false; + if (empty($values['Servers/1/auth_type'])) { + $values['Servers/1/auth_type'] = ''; + $result['Servers/1/auth_type'] = __('Invalid authentication type!'); + $error = true; + } + if ($values['Servers/1/auth_type'] == 'config' + && empty($values['Servers/1/user']) + ) { + $result['Servers/1/user'] = __( + 'Empty username while using [kbd]config[/kbd] authentication method!' + ); + $error = true; + } + if ($values['Servers/1/auth_type'] == 'signon' + && empty($values['Servers/1/SignonSession']) + ) { + $result['Servers/1/SignonSession'] = __( + 'Empty signon session name ' + . 'while using [kbd]signon[/kbd] authentication method!' + ); + $error = true; + } + if ($values['Servers/1/auth_type'] == 'signon' + && empty($values['Servers/1/SignonURL']) + ) { + $result['Servers/1/SignonURL'] = __( + 'Empty signon URL while using [kbd]signon[/kbd] authentication ' + . 'method!' + ); + $error = true; + } + + if (! $error && $values['Servers/1/auth_type'] == 'config') { + $password = ''; + if (! empty($values['Servers/1/password'])) { + $password = $values['Servers/1/password']; + } + $test = static::testDBConnection( + empty($values['Servers/1/host']) ? '' : $values['Servers/1/host'], + empty($values['Servers/1/port']) ? '' : $values['Servers/1/port'], + empty($values['Servers/1/socket']) ? '' : $values['Servers/1/socket'], + empty($values['Servers/1/user']) ? '' : $values['Servers/1/user'], + $password, + 'Server' + ); + + if ($test !== true) { + $result = array_merge($result, $test); + } + } + return $result; + } + + /** + * Validate pmadb config + * + * @param string $path path to config, not used + * keep this parameter since the method is invoked using + * reflection along with other similar methods + * @param array $values config values + * + * @return array + */ + public static function validatePMAStorage($path, array $values) + { + $result = array( + 'Server_pmadb' => '', + 'Servers/1/controluser' => '', + 'Servers/1/controlpass' => '' + ); + $error = false; + + if (empty($values['Servers/1/pmadb'])) { + return $result; + } + + $result = array(); + if (empty($values['Servers/1/controluser'])) { + $result['Servers/1/controluser'] = __( + 'Empty phpMyAdmin control user while using phpMyAdmin configuration ' + . 'storage!' + ); + $error = true; + } + if (empty($values['Servers/1/controlpass'])) { + $result['Servers/1/controlpass'] = __( + 'Empty phpMyAdmin control user password while using phpMyAdmin ' + . 'configuration storage!' + ); + $error = true; + } + if (! $error) { + $test = static::testDBConnection( + empty($values['Servers/1/host']) ? '' : $values['Servers/1/host'], + empty($values['Servers/1/port']) ? '' : $values['Servers/1/port'], + empty($values['Servers/1/socket']) ? '' : $values['Servers/1/socket'], + empty($values['Servers/1/controluser']) ? '' : $values['Servers/1/controluser'], + empty($values['Servers/1/controlpass']) ? '' : $values['Servers/1/controlpass'], + 'Server_pmadb' + ); + if ($test !== true) { + $result = array_merge($result, $test); + } + } + return $result; + } + + + /** + * Validates regular expression + * + * @param string $path path to config + * @param array $values config values + * + * @return array + */ + public static function validateRegex($path, array $values) + { + $result = array($path => ''); + + if (empty($values[$path])) { + return $result; + } + + if (function_exists('error_clear_last')) { + /* PHP 7 only code */ + error_clear_last(); + $last_error = null; + } else { + // As fallback we trigger another error to ensure + // that preg error will be different + @strpos(); + $last_error = error_get_last(); + } + + $matches = array(); + // in libraries/ListDatabase.php _checkHideDatabase(), + // a '/' is used as the delimiter for hide_db + @preg_match('/' . Util::requestString($values[$path]) . '/', '', $matches); + + $current_error = error_get_last(); + + if ($current_error !== $last_error) { + $error = preg_replace('/^preg_match\(\): /', '', $current_error['message']); + return array($path => $error); + } + + return $result; + } + + /** + * Validates TrustedProxies field + * + * @param string $path path to config + * @param array $values config values + * + * @return array + */ + public static function validateTrustedProxies($path, array $values) + { + $result = array($path => array()); + + if (empty($values[$path])) { + return $result; + } + + if (is_array($values[$path]) || is_object($values[$path])) { + // value already processed by FormDisplay::save + $lines = array(); + foreach ($values[$path] as $ip => $v) { + $v = Util::requestString($v); + $lines[] = preg_match('/^-\d+$/', $ip) + ? $v + : $ip . ': ' . $v; + } + } else { + // AJAX validation + $lines = explode("\n", $values[$path]); + } + foreach ($lines as $line) { + $line = trim($line); + $matches = array(); + // we catch anything that may (or may not) be an IP + if (!preg_match("/^(.+):(?:[ ]?)\\w+$/", $line, $matches)) { + $result[$path][] = __('Incorrect value:') . ' ' + . htmlspecialchars($line); + continue; + } + // now let's check whether we really have an IP address + if (filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) === false + && filter_var($matches[1], FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) === false + ) { + $ip = htmlspecialchars(trim($matches[1])); + $result[$path][] = sprintf(__('Incorrect IP address: %s'), $ip); + continue; + } + } + + return $result; + } + + /** + * Tests integer value + * + * @param string $path path to config + * @param array $values config values + * @param bool $allow_neg allow negative values + * @param bool $allow_zero allow zero + * @param int $max_value max allowed value + * @param string $error_string error message string + * + * @return string empty string if test is successful + */ + public static function validateNumber( + $path, + array $values, + $allow_neg, + $allow_zero, + $max_value, + $error_string + ) { + if (empty($values[$path])) { + return ''; + } + + $value = Util::requestString($values[$path]); + + if (intval($value) != $value + || (! $allow_neg && $value < 0) + || (! $allow_zero && $value == 0) + || $value > $max_value + ) { + return $error_string; + } + + return ''; + } + + /** + * Validates port number + * + * @param string $path path to config + * @param array $values config values + * + * @return array + */ + public static function validatePortNumber($path, array $values) + { + return array( + $path => static::validateNumber( + $path, + $values, + false, + false, + 65535, + __('Not a valid port number!') + ) + ); + } + + /** + * Validates positive number + * + * @param string $path path to config + * @param array $values config values + * + * @return array + */ + public static function validatePositiveNumber($path, array $values) + { + return array( + $path => static::validateNumber( + $path, + $values, + false, + false, + PHP_INT_MAX, + __('Not a positive number!') + ) + ); + } + + /** + * Validates non-negative number + * + * @param string $path path to config + * @param array $values config values + * + * @return array + */ + public static function validateNonNegativeNumber($path, array $values) + { + return array( + $path => static::validateNumber( + $path, + $values, + false, + true, + PHP_INT_MAX, + __('Not a non-negative number!') + ) + ); + } + + /** + * Validates value according to given regular expression + * Pattern and modifiers must be a valid for PCRE <b>and</b> JavaScript RegExp + * + * @param string $path path to config + * @param array $values config values + * @param string $regex regular expression to match + * + * @return array + */ + public static function validateByRegex($path, array $values, $regex) + { + if (!isset($values[$path])) { + return ''; + } + $result = preg_match($regex, Util::requestString($values[$path])); + return array($path => ($result ? '' : __('Incorrect value!'))); + } + + /** + * Validates upper bound for numeric inputs + * + * @param string $path path to config + * @param array $values config values + * @param int $max_value maximal allowed value + * + * @return array + */ + public static function validateUpperBound($path, array $values, $max_value) + { + $result = $values[$path] <= $max_value; + return array($path => ($result ? '' + : sprintf(__('Value must be less than or equal to %s!'), $max_value))); + } +} diff --git a/phpMyAdmin/libraries/classes/Console.php b/phpMyAdmin/libraries/classes/Console.php new file mode 100755 index 0000000..565635b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Console.php @@ -0,0 +1,152 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Used to render the console of PMA's pages + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\Bookmark; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Template; +use PhpMyAdmin\Util; + +/** + * Class used to output the console + * + * @package PhpMyAdmin + */ +class Console +{ + /** + * Whether to display anything + * + * @access private + * @var bool + */ + private $_isEnabled; + + /** + * Whether we are servicing an ajax request. + * + * @access private + * @var bool + */ + private $_isAjax; + + /** + * @var Relation + */ + private $relation; + + /** + * Creates a new class instance + */ + public function __construct() + { + $this->_isEnabled = true; + $this->relation = new Relation(); + } + + /** + * Set the ajax flag to indicate whether + * we are servicing an ajax request + * + * @param bool $isAjax Whether we are servicing an ajax request + * + * @return void + */ + public function setAjax($isAjax) + { + $this->_isAjax = (boolean) $isAjax; + } + + /** + * Disables the rendering of the footer + * + * @return void + */ + public function disable() + { + $this->_isEnabled = false; + } + + /** + * Renders the bookmark content + * + * @access public + * @return string + */ + public static function getBookmarkContent() + { + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + if ($cfgBookmark) { + $bookmarks = Bookmark::getList( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'] + ); + $count_bookmarks = count($bookmarks); + if ($count_bookmarks > 0) { + $welcomeMessage = sprintf( + _ngettext( + 'Showing %1$d bookmark (both private and shared)', + 'Showing %1$d bookmarks (both private and shared)', + $count_bookmarks + ), + $count_bookmarks + ); + } else { + $welcomeMessage = __('No bookmarks'); + } + unset($count_bookmarks, $private_message, $shared_message); + return Template::get('console/bookmark_content') + ->render( + array( + 'welcome_message' => $welcomeMessage, + 'bookmarks' => $bookmarks, + ) + ); + } + return ''; + } + + /** + * Returns the list of JS scripts required by console + * + * @return array list of scripts + */ + public function getScripts() + { + return array('console.js'); + } + + /** + * Renders the console + * + * @access public + * @return string + */ + public function getDisplay() + { + if ((! $this->_isAjax) && $this->_isEnabled) { + $cfgBookmark = Bookmark::getParams( + $GLOBALS['cfg']['Server']['user'] + ); + + $image = Util::getImage('console', __('SQL Query Console')); + $_sql_history = $this->relation->getHistory( + $GLOBALS['cfg']['Server']['user'] + ); + $bookmarkContent = static::getBookmarkContent(); + + return Template::get('console/display')->render([ + 'cfg_bookmark' => $cfgBookmark, + 'image' => $image, + 'sql_history' => $_sql_history, + 'bookmark_content' => $bookmarkContent, + ]); + } + return ''; + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Controller.php b/phpMyAdmin/libraries/classes/Controllers/Controller.php new file mode 100755 index 0000000..24df284 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Controller.php @@ -0,0 +1,39 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Controller + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers; + +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Response; + +/** + * Base class for all of controller + * + * @package PhpMyAdmin\Controllers + */ +abstract class Controller +{ + + /** + * @var Response + */ + protected $response; + + /** + * @var DatabaseInterface + */ + protected $dbi; + + /** + * Constructor + */ + public function __construct($response, $dbi) + { + $this->response = $response; + $this->dbi = $dbi; + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Database/DatabaseStructureController.php b/phpMyAdmin/libraries/classes/Controllers/Database/DatabaseStructureController.php new file mode 100755 index 0000000..8145375 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Database/DatabaseStructureController.php @@ -0,0 +1,1115 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Database\DatabaseStructureController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers\Database; + +use PhpMyAdmin\Charsets; +use PhpMyAdmin\Config\PageSettings; +use PhpMyAdmin\Controllers\DatabaseController; +use PhpMyAdmin\Core; +use PhpMyAdmin\Display\CreateTable; +use PhpMyAdmin\Message; +use PhpMyAdmin\RecentFavoriteTable; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Replication; +use PhpMyAdmin\Response; +use PhpMyAdmin\Sanitize; +use PhpMyAdmin\Template; +use PhpMyAdmin\Tracker; +use PhpMyAdmin\Util; +use PhpMyAdmin\Url; + +/** + * Handles database structure logic + * + * @package PhpMyAdmin\Controllers + */ +class DatabaseStructureController extends DatabaseController +{ + /** + * @var int Number of tables + */ + protected $_num_tables; + /** + * @var int Current position in the list + */ + protected $_pos; + /** + * @var bool DB is information_schema + */ + protected $_db_is_system_schema; + /** + * @var int Number of tables + */ + protected $_total_num_tables; + /** + * @var array Tables in the database + */ + protected $_tables; + /** + * @var bool whether stats show or not + */ + protected $_is_show_stats; + + /** + * @var Relation $relation + */ + private $relation; + + /** + * Constructor + */ + public function __construct($response, $dbi, $db) + { + parent::__construct($response, $dbi, $db); + $this->relation = new Relation(); + } + + /** + * Retrieves databse information for further use + * + * @param string $sub_part Page part name + * + * @return void + */ + private function _getDbInfo($sub_part) + { + list( + $tables, + $num_tables, + $total_num_tables, + , + $is_show_stats, + $db_is_system_schema, + , + , + $pos + ) = Util::getDbInfo($this->db, $sub_part); + + $this->_tables = $tables; + $this->_num_tables = $num_tables; + $this->_pos = $pos; + $this->_db_is_system_schema = $db_is_system_schema; + $this->_total_num_tables = $total_num_tables; + $this->_is_show_stats = $is_show_stats; + } + + /** + * Index action + * + * @return void + */ + public function indexAction() + { + $response = Response::getInstance(); + + // Add/Remove favorite tables using Ajax request. + if ($response->isAjax() && !empty($_REQUEST['favorite_table'])) { + $this->addRemoveFavoriteTablesAction(); + return; + } + + // If there is an Ajax request for real row count of a table. + if ($response->isAjax() + && isset($_REQUEST['real_row_count']) + && $_REQUEST['real_row_count'] == true + ) { + $this->handleRealRowCountRequestAction(); + return; + } + + // Drops/deletes/etc. multiple tables if required + if ((! empty($_POST['submit_mult']) && isset($_POST['selected_tbl'])) + || isset($_POST['mult_btn']) + ) { + $this->multiSubmitAction(); + } + + $this->response->getHeader()->getScripts()->addFiles( + array( + 'db_structure.js', + 'tbl_change.js', + ) + ); + + // Gets the database structure + $this->_getDbInfo('_structure'); + + // Checks if there are any tables to be shown on current page. + // If there are no tables, the user is redirected to the last page + // having any. + if ($this->_total_num_tables > 0 && $this->_pos > $this->_total_num_tables) { + $uri = './db_structure.php' . Url::getCommonRaw(array( + 'db' => $this->db, + 'pos' => max(0, $this->_total_num_tables - $GLOBALS['cfg']['MaxTableList']), + 'reload' => 1 + )); + Core::sendHeaderLocation($uri); + } + + include_once 'libraries/replication.inc.php'; + + PageSettings::showGroup('DbStructure'); + + // 1. No tables + if ($this->_num_tables == 0) { + $this->response->addHTML( + Message::notice(__('No tables found in database.')) + ); + if (empty($this->_db_is_system_schema)) { + $this->response->addHTML(CreateTable::getHtml($this->db)); + } + return; + } + + // else + // 2. Shows table information + /** + * Displays the tables list + */ + $this->response->addHTML('<div id="tableslistcontainer">'); + $_url_params = array( + 'pos' => $this->_pos, + 'db' => $this->db); + + // Add the sort options if they exists + if (isset($_REQUEST['sort'])) { + $_url_params['sort'] = $_REQUEST['sort']; + } + + if (isset($_REQUEST['sort_order'])) { + $_url_params['sort_order'] = $_REQUEST['sort_order']; + } + + $this->response->addHTML( + Util::getListNavigator( + $this->_total_num_tables, $this->_pos, $_url_params, + 'db_structure.php', 'frame_content', $GLOBALS['cfg']['MaxTableList'] + ) + ); + + $this->displayTableList(); + + // display again the table list navigator + $this->response->addHTML( + Util::getListNavigator( + $this->_total_num_tables, $this->_pos, $_url_params, + 'db_structure.php', 'frame_content', + $GLOBALS['cfg']['MaxTableList'] + ) + ); + + $this->response->addHTML('</div><hr />'); + + /** + * Work on the database + */ + /* DATABASE WORK */ + /* Printable view of a table */ + $this->response->addHTML( + Template::get('database/structure/print_view_data_dictionary_link') + ->render(array('url_query' => Url::getCommon( + array( + 'db' => $this->db, + 'goto' => 'db_structure.php', + ) + ))) + ); + + if (empty($this->_db_is_system_schema)) { + $this->response->addHTML(CreateTable::getHtml($this->db)); + } + } + + /** + * Add or remove favorite tables + * + * @return void + */ + public function addRemoveFavoriteTablesAction() + { + $fav_instance = RecentFavoriteTable::getInstance('favorite'); + if (isset($_REQUEST['favorite_tables'])) { + $favorite_tables = json_decode($_REQUEST['favorite_tables'], true); + } else { + $favorite_tables = array(); + } + // Required to keep each user's preferences separate. + $user = sha1($GLOBALS['cfg']['Server']['user']); + + // Request for Synchronization of favorite tables. + if (isset($_REQUEST['sync_favorite_tables'])) { + $cfgRelation = $this->relation->getRelationsParam(); + if ($cfgRelation['favoritework']) { + $this->synchronizeFavoriteTables($fav_instance, $user, $favorite_tables); + } + return; + } + $changes = true; + $titles = Util::buildActionTitles(); + $favorite_table = $_REQUEST['favorite_table']; + $already_favorite = $this->checkFavoriteTable($favorite_table); + + if (isset($_REQUEST['remove_favorite'])) { + if ($already_favorite) { + // If already in favorite list, remove it. + $fav_instance->remove($this->db, $favorite_table); + $already_favorite = false; // for favorite_anchor template + } + } elseif (isset($_REQUEST['add_favorite'])) { + if (!$already_favorite) { + $nbTables = count($fav_instance->getTables()); + if ($nbTables == $GLOBALS['cfg']['NumFavoriteTables']) { + $changes = false; + } else { + // Otherwise add to favorite list. + $fav_instance->add($this->db, $favorite_table); + $already_favorite = true; // for favorite_anchor template + } + } + } + + $favorite_tables[$user] = $fav_instance->getTables(); + $this->response->addJSON('changes', $changes); + if (!$changes) { + $this->response->addJSON( + 'message', + Template::get('components/error_message') + ->render( + array( + 'msg' => __("Favorite List is full!") + ) + ) + ); + return; + } + // Check if current table is already in favorite list. + $favParams = array('db' => $this->db, + 'ajax_request' => true, + 'favorite_table' => $favorite_table, + (($already_favorite ? 'remove' : 'add') . '_favorite') => true + ); + $this->response->addJSON( + array( + 'user' => $user, + 'favorite_tables' => json_encode($favorite_tables), + 'list' => $fav_instance->getHtmlList(), + 'anchor' => Template::get('database/structure/favorite_anchor') + ->render( + array( + 'table_name_hash' => md5($favorite_table), + 'db_table_name_hash' => md5($this->db . "." . $favorite_table), + 'fav_params' => $favParams, + 'already_favorite' => $already_favorite, + 'titles' => $titles, + ) + ) + ) + ); + } + + /** + * Handles request for real row count on database level view page. + * + * @return boolean true + */ + public function handleRealRowCountRequestAction() + { + $ajax_response = $this->response; + // If there is a request to update all table's row count. + if (!isset($_REQUEST['real_row_count_all'])) { + // Get the real row count for the table. + $real_row_count = $this->dbi + ->getTable($this->db, $_REQUEST['table']) + ->getRealRowCountTable(); + // Format the number. + $real_row_count = Util::formatNumber($real_row_count, 0); + $ajax_response->addJSON('real_row_count', $real_row_count); + return; + } + + // Array to store the results. + $real_row_count_all = array(); + // Iterate over each table and fetch real row count. + foreach ($this->_tables as $table) { + $row_count = $this->dbi + ->getTable($this->db, $table['TABLE_NAME']) + ->getRealRowCountTable(); + $real_row_count_all[] = array( + 'table' => $table['TABLE_NAME'], + 'row_count' => $row_count + ); + } + + $ajax_response->addJSON( + 'real_row_count_all', + json_encode($real_row_count_all) + ); + } + + /** + * Handles actions related to multiple tables + * + * @return void + */ + public function multiSubmitAction() + { + $action = 'db_structure.php'; + $err_url = 'db_structure.php' . Url::getCommon( + array('db' => $this->db) + ); + + // see bug #2794840; in this case, code path is: + // db_structure.php -> libraries/mult_submits.inc.php -> sql.php + // -> db_structure.php and if we got an error on the multi submit, + // we must display it here and not call again mult_submits.inc.php + if (! isset($_POST['error']) || false === $_POST['error']) { + include 'libraries/mult_submits.inc.php'; + } + if (empty($_POST['message'])) { + $_POST['message'] = Message::success(); + } + } + + /** + * Displays the list of tables + * + * @return void + */ + protected function displayTableList() + { + // filtering + $this->response->addHTML( + Template::get('filter')->render(['filter_value' => '']) + ); + + $i = $sum_entries = 0; + $overhead_check = false; + $create_time_all = ''; + $update_time_all = ''; + $check_time_all = ''; + $num_columns = $GLOBALS['cfg']['PropertiesNumColumns'] > 1 + ? ceil($this->_num_tables / $GLOBALS['cfg']['PropertiesNumColumns']) + 1 + : 0; + $row_count = 0; + $sum_size = 0; + $overhead_size = 0; + + $hidden_fields = array(); + $overall_approx_rows = false; + $structure_table_rows = []; + foreach ($this->_tables as $keyname => $current_table) { + // Get valid statistics whatever is the table type + + $drop_query = ''; + $drop_message = ''; + $overhead = ''; + $input_class = ['checkall']; + + $table_is_view = false; + // Sets parameters for links + $tbl_url_query = Url::getCommon( + array('db' => $this->db, 'table' => $current_table['TABLE_NAME']) + ); + // do not list the previous table's size info for a view + + list($current_table, $formatted_size, $unit, $formatted_overhead, + $overhead_unit, $overhead_size, $table_is_view, $sum_size) + = $this->getStuffForEngineTypeTable( + $current_table, $sum_size, $overhead_size + ); + + $curTable = $this->dbi + ->getTable($this->db, $current_table['TABLE_NAME']); + if (!$curTable->isMerge()) { + $sum_entries += $current_table['TABLE_ROWS']; + } + + if (isset($current_table['Collation'])) { + $collation = '<dfn title="' + . Charsets::getCollationDescr($current_table['Collation']) . '">' + . $current_table['Collation'] . '</dfn>'; + } else { + $collation = '---'; + } + + if ($this->_is_show_stats) { + if ($formatted_overhead != '') { + $overhead = '<a href="tbl_structure.php' + . $tbl_url_query . '#showusage">' + . '<span>' . $formatted_overhead . '</span> ' + . '<span class="unit">' . $overhead_unit . '</span>' + . '</a>' . "\n"; + $overhead_check = true; + $input_class[] = 'tbl-overhead'; + } else { + $overhead = '-'; + } + } // end if + + if ($GLOBALS['cfg']['ShowDbStructureCharset']) { + if (isset($current_table['Collation'])) { + $charset = mb_substr($collation, 0, mb_strpos($collation, "_")); + } else { + $charset = ''; + } + } + + if ($GLOBALS['cfg']['ShowDbStructureCreation']) { + $create_time = isset($current_table['Create_time']) + ? $current_table['Create_time'] : ''; + if ($create_time + && (!$create_time_all + || $create_time < $create_time_all) + ) { + $create_time_all = $create_time; + } + } + + if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']) { + $update_time = isset($current_table['Update_time']) + ? $current_table['Update_time'] : ''; + if ($update_time + && (!$update_time_all + || $update_time < $update_time_all) + ) { + $update_time_all = $update_time; + } + } + + if ($GLOBALS['cfg']['ShowDbStructureLastCheck']) { + $check_time = isset($current_table['Check_time']) + ? $current_table['Check_time'] : ''; + if ($check_time + && (!$check_time_all + || $check_time < $check_time_all) + ) { + $check_time_all = $check_time; + } + } + + $truename = (!empty($tooltip_truename) + && isset($tooltip_truename[$current_table['TABLE_NAME']])) + ? $tooltip_truename[$current_table['TABLE_NAME']] + : $current_table['TABLE_NAME']; + + $i++; + + $row_count++; + if ($table_is_view) { + $hidden_fields[] = '<input type="hidden" name="views[]" value="' + . htmlspecialchars($current_table['TABLE_NAME']) . '" />'; + } + + /* + * Always activate links for Browse, Search and Empty, even if + * the icons are greyed, because + * 1. for views, we don't know the number of rows at this point + * 2. for tables, another source could have populated them since the + * page was generated + * + * I could have used the PHP ternary conditional operator but I find + * the code easier to read without this operator. + */ + $may_have_rows = $current_table['TABLE_ROWS'] > 0 || $table_is_view; + $titles = Util::buildActionTitles(); + + $browse_table = Template::get('database/structure/browse_table') + ->render( + array( + 'tbl_url_query' => $tbl_url_query, + 'title' => $may_have_rows ? $titles['Browse'] + : $titles['NoBrowse'], + ) + ); + + $search_table = Template::get('database/structure/search_table') + ->render( + array( + 'tbl_url_query' => $tbl_url_query, + 'title' => $may_have_rows ? $titles['Search'] + : $titles['NoSearch'], + ) + ); + + $browse_table_label = Template::get( + 'database/structure/browse_table_label' + ) + ->render( + array( + 'tbl_url_query' => $tbl_url_query, + 'title' => htmlspecialchars( + $current_table['TABLE_COMMENT'] + ), + 'truename' => $truename, + ) + ); + + $empty_table = ''; + if (!$this->_db_is_system_schema) { + $empty_table = ''; + if (!$table_is_view) { + $empty_table = Template::get('database/structure/empty_table') + ->render( + array( + 'tbl_url_query' => $tbl_url_query, + 'sql_query' => urlencode( + 'TRUNCATE ' . Util::backquote( + $current_table['TABLE_NAME'] + ) + ), + 'message_to_show' => urlencode( + sprintf( + __('Table %s has been emptied.'), + htmlspecialchars( + $current_table['TABLE_NAME'] + ) + ) + ), + 'title' => $may_have_rows ? $titles['Empty'] + : $titles['NoEmpty'], + ) + ); + } + $drop_query = sprintf( + 'DROP %s %s', + ($table_is_view || $current_table['ENGINE'] == null) ? 'VIEW' + : 'TABLE', + Util::backquote( + $current_table['TABLE_NAME'] + ) + ); + $drop_message = sprintf( + (($table_is_view || $current_table['ENGINE'] == null) + ? __('View %s has been dropped.') + : __('Table %s has been dropped.')), + str_replace( + ' ', ' ', + htmlspecialchars($current_table['TABLE_NAME']) + ) + ); + } + + if ($num_columns > 0 + && $this->_num_tables > $num_columns + && ($row_count % $num_columns) == 0 + ) { + $row_count = 1; + + $this->response->addHTML( + Template::get('database/structure/table_header')->render([ + 'db' => $this->db, + 'db_is_system_schema' => $this->_db_is_system_schema, + 'replication' => $GLOBALS['replication_info']['slave']['status'], + 'properties_num_columns' => $GLOBALS['cfg']['PropertiesNumColumns'], + 'is_show_stats' => $GLOBALS['is_show_stats'], + 'show_charset' => $GLOBALS['cfg']['ShowDbStructureCharset'], + 'show_comment' => $GLOBALS['cfg']['ShowDbStructureComment'], + 'show_creation' => $GLOBALS['cfg']['ShowDbStructureCreation'], + 'show_last_update' => $GLOBALS['cfg']['ShowDbStructureLastUpdate'], + 'show_last_check' => $GLOBALS['cfg']['ShowDbStructureLastCheck'], + 'num_favorite_tables' => $GLOBALS['cfg']['NumFavoriteTables'], + 'structure_table_rows' => $structure_table_rows, + ]) + ); + $structure_table_rows = []; + } + + list($approx_rows, $show_superscript) = $this->isRowCountApproximated( + $current_table, $table_is_view + ); + + list($do, $ignored) = $this->getReplicationStatus($truename); + + $structure_table_rows[] = [ + 'db' => $this->db, + 'curr' => $i, + 'input_class' => implode(' ', $input_class), + 'table_is_view' => $table_is_view, + 'current_table' => $current_table, + 'browse_table_label' => $browse_table_label, + 'tracking_icon' => $this->getTrackingIcon($truename), + 'server_slave_status' => $GLOBALS['replication_info']['slave']['status'], + 'browse_table' => $browse_table, + 'tbl_url_query' => $tbl_url_query, + 'search_table' => $search_table, + 'db_is_system_schema' => $this->_db_is_system_schema, + 'titles' => $titles, + 'empty_table' => $empty_table, + 'drop_query' => $drop_query, + 'drop_message' => $drop_message, + 'collation' => $collation, + 'formatted_size' => $formatted_size, + 'unit' => $unit, + 'overhead' => $overhead, + 'create_time' => isset($create_time) + ? $create_time : '', + 'update_time' => isset($update_time) + ? $update_time : '', + 'check_time' => isset($check_time) + ? $check_time : '', + 'charset' => isset($charset) + ? $charset : '', + 'is_show_stats' => $this->_is_show_stats, + 'ignored' => $ignored, + 'do' => $do, + 'approx_rows' => $approx_rows, + 'show_superscript' => $show_superscript, + 'already_favorite' => $this->checkFavoriteTable( + $current_table['TABLE_NAME'] + ), + 'num_favorite_tables' => $GLOBALS['cfg']['NumFavoriteTables'], + 'properties_num_columns' => $GLOBALS['cfg']['PropertiesNumColumns'], + 'limit_chars' => $GLOBALS['cfg']['LimitChars'], + 'show_charset' => $GLOBALS['cfg']['ShowDbStructureCharset'], + 'show_comment' => $GLOBALS['cfg']['ShowDbStructureComment'], + 'show_creation' => $GLOBALS['cfg']['ShowDbStructureCreation'], + 'show_last_update' => $GLOBALS['cfg']['ShowDbStructureLastUpdate'], + 'show_last_check' => $GLOBALS['cfg']['ShowDbStructureLastCheck'], + ]; + + $overall_approx_rows = $overall_approx_rows || $approx_rows; + } // end foreach + + $db_collation = $this->dbi->getDbCollation($this->db); + $db_charset = mb_substr($db_collation, 0, mb_strpos($db_collation, "_")); + + // table form + $this->response->addHTML( + Template::get('database/structure/table_header')->render([ + 'db' => $this->db, + 'db_is_system_schema' => $this->_db_is_system_schema, + 'replication' => $GLOBALS['replication_info']['slave']['status'], + 'properties_num_columns' => $GLOBALS['cfg']['PropertiesNumColumns'], + 'is_show_stats' => $GLOBALS['is_show_stats'], + 'show_charset' => $GLOBALS['cfg']['ShowDbStructureCharset'], + 'show_comment' => $GLOBALS['cfg']['ShowDbStructureComment'], + 'show_creation' => $GLOBALS['cfg']['ShowDbStructureCreation'], + 'show_last_update' => $GLOBALS['cfg']['ShowDbStructureLastUpdate'], + 'show_last_check' => $GLOBALS['cfg']['ShowDbStructureLastCheck'], + 'num_favorite_tables' => $GLOBALS['cfg']['NumFavoriteTables'], + 'structure_table_rows' => $structure_table_rows, + 'body_for_table_summary' => [ + 'num_tables' => $this->_num_tables, + 'server_slave_status' => $GLOBALS['replication_info']['slave']['status'], + 'db_is_system_schema' => $this->_db_is_system_schema, + 'sum_entries' => $sum_entries, + 'db_collation' => $db_collation, + 'is_show_stats' => $this->_is_show_stats, + 'db_charset' => $db_charset, + 'sum_size' => $sum_size, + 'overhead_size' => $overhead_size, + 'create_time_all' => $create_time_all, + 'update_time_all' => $update_time_all, + 'check_time_all' => $check_time_all, + 'approx_rows' => $overall_approx_rows, + 'num_favorite_tables' => $GLOBALS['cfg']['NumFavoriteTables'], + 'db' => $GLOBALS['db'], + 'properties_num_columns' => $GLOBALS['cfg']['PropertiesNumColumns'], + 'dbi' => $GLOBALS['dbi'], + 'show_charset' => $GLOBALS['cfg']['ShowDbStructureCharset'], + 'show_comment' => $GLOBALS['cfg']['ShowDbStructureComment'], + 'show_creation' => $GLOBALS['cfg']['ShowDbStructureCreation'], + 'show_last_update' => $GLOBALS['cfg']['ShowDbStructureLastUpdate'], + 'show_last_check' => $GLOBALS['cfg']['ShowDbStructureLastCheck'], + ], + 'check_all_tables' => [ + 'pma_theme_image' => $GLOBALS['pmaThemeImage'], + 'text_dir' => $GLOBALS['text_dir'], + 'overhead_check' => $overhead_check, + 'db_is_system_schema' => $this->_db_is_system_schema, + 'hidden_fields' => $hidden_fields, + 'disable_multi_table' => $GLOBALS['cfg']['DisableMultiTableMaintenance'], + 'central_columns_work' => $GLOBALS['cfgRelation']['centralcolumnswork'], + ], + ]) + ); + } + + /** + * Returns the tracking icon if the table is tracked + * + * @param string $table table name + * + * @return string HTML for tracking icon + */ + protected function getTrackingIcon($table) + { + $tracking_icon = ''; + if (Tracker::isActive()) { + $is_tracked = Tracker::isTracked($this->db, $table); + if ($is_tracked + || Tracker::getVersion($this->db, $table) > 0 + ) { + $tracking_icon = Template::get( + 'database/structure/tracking_icon' + ) + ->render( + array( + 'db' => $this->db, + 'table' => $table, + 'is_tracked' => $is_tracked, + ) + ); + } + } + return $tracking_icon; + } + + /** + * Returns whether the row count is approximated + * + * @param array $current_table array containing details about the table + * @param boolean $table_is_view whether the table is a view + * + * @return array + */ + protected function isRowCountApproximated(array $current_table, $table_is_view) + { + $approx_rows = false; + $show_superscript = ''; + + // there is a null value in the ENGINE + // - when the table needs to be repaired, or + // - when it's a view + // so ensure that we'll display "in use" below for a table + // that needs to be repaired + if (isset($current_table['TABLE_ROWS']) + && ($current_table['ENGINE'] != null || $table_is_view) + ) { + // InnoDB/TokuDB table: we did not get an accurate row count + $approx_rows = !$table_is_view + && in_array($current_table['ENGINE'], array('InnoDB', 'TokuDB')) + && !$current_table['COUNTED']; + + if ($table_is_view + && $current_table['TABLE_ROWS'] >= $GLOBALS['cfg']['MaxExactCountViews'] + ) { + $approx_rows = true; + $show_superscript = Util::showHint( + Sanitize::sanitize( + sprintf( + __( + 'This view has at least this number of ' + . 'rows. Please refer to %sdocumentation%s.' + ), + '[doc@cfg_MaxExactCountViews]', '[/doc]' + ) + ) + ); + } + } + + return array($approx_rows, $show_superscript); + } + + /** + * Returns the replication status of the table. + * + * @param string $table table name + * + * @return array + */ + protected function getReplicationStatus($table) + { + $do = $ignored = false; + if ($GLOBALS['replication_info']['slave']['status']) { + + $nbServSlaveDoDb = count( + $GLOBALS['replication_info']['slave']['Do_DB'] + ); + $nbServSlaveIgnoreDb = count( + $GLOBALS['replication_info']['slave']['Ignore_DB'] + ); + $searchDoDBInTruename = array_search( + $table, $GLOBALS['replication_info']['slave']['Do_DB'] + ); + $searchDoDBInDB = array_search( + $this->db, $GLOBALS['replication_info']['slave']['Do_DB'] + ); + + $do = strlen($searchDoDBInTruename) > 0 + || strlen($searchDoDBInDB) > 0 + || ($nbServSlaveDoDb == 0 && $nbServSlaveIgnoreDb == 0) + || $this->hasTable( + $GLOBALS['replication_info']['slave']['Wild_Do_Table'], + $table + ); + + $searchDb = array_search( + $this->db, + $GLOBALS['replication_info']['slave']['Ignore_DB'] + ); + $searchTable = array_search( + $table, + $GLOBALS['replication_info']['slave']['Ignore_Table'] + ); + $ignored = strlen($searchTable) > 0 + || strlen($searchDb) > 0 + || $this->hasTable( + $GLOBALS['replication_info']['slave']['Wild_Ignore_Table'], + $table + ); + } + + return array($do, $ignored); + } + + /** + * Synchronize favorite tables + * + * + * @param RecentFavoriteTable $fav_instance Instance of this class + * @param string $user The user hash + * @param array $favorite_tables Existing favorites + * + * @return void + */ + protected function synchronizeFavoriteTables( + $fav_instance, + $user, + array $favorite_tables + ) { + $fav_instance_tables = $fav_instance->getTables(); + + if (empty($fav_instance_tables) + && isset($favorite_tables[$user]) + ) { + foreach ($favorite_tables[$user] as $key => $value) { + $fav_instance->add($value['db'], $value['table']); + } + } + $favorite_tables[$user] = $fav_instance->getTables(); + + $this->response->addJSON( + array( + 'favorite_tables' => json_encode($favorite_tables), + 'list' => $fav_instance->getHtmlList() + ) + ); + $server_id = $GLOBALS['server']; + // Set flag when localStorage and pmadb(if present) are in sync. + $_SESSION['tmpval']['favorites_synced'][$server_id] = true; + } + + /** + * Function to check if a table is already in favorite list. + * + * @param string $current_table current table + * + * @return true|false + */ + protected function checkFavoriteTable($current_table) + { + // ensure $_SESSION['tmpval']['favorite_tables'] is initialized + RecentFavoriteTable::getInstance('favorite'); + foreach ( + $_SESSION['tmpval']['favorite_tables'][$GLOBALS['server']] as $value + ) { + if ($value['db'] == $this->db && $value['table'] == $current_table) { + return true; + } + } + return false; + } + + /** + * Find table with truename + * + * @param array $db DB to look into + * @param string $truename Table name + * + * @return bool + */ + protected function hasTable(array $db, $truename) + { + foreach ($db as $db_table) { + if ($this->db == Replication::extractDbOrTable($db_table) + && preg_match( + "@^" . + preg_quote(mb_substr(Replication::extractDbOrTable($db_table, 'table'), 0, -1)) . "@", + $truename + ) + ) { + return true; + } + } + return false; + } + + /** + * Get the value set for ENGINE table, + * + * @param array $current_table current table + * @param integer $sum_size total table size + * @param integer $overhead_size overhead size + * + * @return array + * @internal param bool $table_is_view whether table is view or not + */ + protected function getStuffForEngineTypeTable( + array $current_table, $sum_size, $overhead_size + ) { + $formatted_size = '-'; + $unit = ''; + $formatted_overhead = ''; + $overhead_unit = ''; + $table_is_view = false; + + switch ( $current_table['ENGINE']) { + // MyISAM, ISAM or Heap table: Row count, data size and index size + // are accurate; data size is accurate for ARCHIVE + case 'MyISAM' : + case 'ISAM' : + case 'HEAP' : + case 'MEMORY' : + case 'ARCHIVE' : + case 'Aria' : + case 'Maria' : + list($current_table, $formatted_size, $unit, $formatted_overhead, + $overhead_unit, $overhead_size, $sum_size) + = $this->getValuesForAriaTable( + $current_table, $sum_size, $overhead_size, + $formatted_size, $unit, $formatted_overhead, $overhead_unit + ); + break; + case 'InnoDB' : + case 'PBMS' : + case 'TokuDB' : + // InnoDB table: Row count is not accurate but data and index sizes are. + // PBMS table in Drizzle: TABLE_ROWS is taken from table cache, + // so it may be unavailable + list($current_table, $formatted_size, $unit, $sum_size) + = $this->getValuesForInnodbTable( + $current_table, $sum_size + ); + break; + // Mysql 5.0.x (and lower) uses MRG_MyISAM + // and MySQL 5.1.x (and higher) uses MRG_MYISAM + // Both are aliases for MERGE + case 'MRG_MyISAM' : + case 'MRG_MYISAM' : + case 'MERGE' : + case 'BerkeleyDB' : + // Merge or BerkleyDB table: Only row count is accurate. + if ($this->_is_show_stats) { + $formatted_size = ' - '; + $unit = ''; + } + break; + // for a view, the ENGINE is sometimes reported as null, + // or on some servers it's reported as "SYSTEM VIEW" + case null : + case 'SYSTEM VIEW' : + // possibly a view, do nothing + break; + default : + // Unknown table type. + if ($this->_is_show_stats) { + $formatted_size = __('unknown'); + $unit = ''; + } + } // end switch + + if ($current_table['TABLE_TYPE'] == 'VIEW' + || $current_table['TABLE_TYPE'] == 'SYSTEM VIEW' + ) { + // countRecords() takes care of $cfg['MaxExactCountViews'] + $current_table['TABLE_ROWS'] = $this->dbi + ->getTable($this->db, $current_table['TABLE_NAME']) + ->countRecords(true); + $table_is_view = true; + } + + return array($current_table, $formatted_size, $unit, $formatted_overhead, + $overhead_unit, $overhead_size, $table_is_view, $sum_size + ); + } + + /** + * Get values for ARIA/MARIA tables + * + * @param array $current_table current table + * @param integer $sum_size sum size + * @param integer $overhead_size overhead size + * @param integer $formatted_size formatted size + * @param string $unit unit + * @param integer $formatted_overhead overhead formatted + * @param string $overhead_unit overhead unit + * + * @return array + */ + protected function getValuesForAriaTable( + array $current_table, $sum_size, $overhead_size, $formatted_size, $unit, + $formatted_overhead, $overhead_unit + ) { + if ($this->_db_is_system_schema) { + $current_table['Rows'] = $this->dbi + ->getTable($this->db, $current_table['Name']) + ->countRecords(); + } + + if ($this->_is_show_stats) { + $tblsize = $current_table['Data_length'] + + $current_table['Index_length']; + $sum_size += $tblsize; + list($formatted_size, $unit) = Util::formatByteDown( + $tblsize, 3, ($tblsize > 0) ? 1 : 0 + ); + if (isset($current_table['Data_free']) + && $current_table['Data_free'] > 0 + ) { + list($formatted_overhead, $overhead_unit) + = Util::formatByteDown( + $current_table['Data_free'], 3, + (($current_table['Data_free'] > 0) ? 1 : 0) + ); + $overhead_size += $current_table['Data_free']; + } + } + return array($current_table, $formatted_size, $unit, $formatted_overhead, + $overhead_unit, $overhead_size, $sum_size + ); + } + + /** + * Get values for InnoDB table + * + * @param array $current_table current table + * @param integer $sum_size sum size + * + * @return array + */ + protected function getValuesForInnodbTable( + array $current_table, $sum_size + ) { + $formatted_size = $unit = ''; + + if ((in_array($current_table['ENGINE'], array('InnoDB', 'TokuDB')) + && $current_table['TABLE_ROWS'] < $GLOBALS['cfg']['MaxExactCount']) + || !isset($current_table['TABLE_ROWS']) + ) { + $current_table['COUNTED'] = true; + $current_table['TABLE_ROWS'] = $this->dbi + ->getTable($this->db, $current_table['TABLE_NAME']) + ->countRecords(true); + } else { + $current_table['COUNTED'] = false; + } + + if ($this->_is_show_stats) { + $tblsize = $current_table['Data_length'] + + $current_table['Index_length']; + $sum_size += $tblsize; + list($formatted_size, $unit) = Util::formatByteDown( + $tblsize, 3, (($tblsize > 0) ? 1 : 0) + ); + } + + return array($current_table, $formatted_size, $unit, $sum_size); + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/DatabaseController.php b/phpMyAdmin/libraries/classes/Controllers/DatabaseController.php new file mode 100755 index 0000000..af0ffc1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/DatabaseController.php @@ -0,0 +1,30 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\DatabaseController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers; + +/** + * Handles database related logic + * + * @package PhpMyAdmin\Controllers + */ +abstract class DatabaseController extends Controller +{ + /** + * @var string $db + */ + protected $db; + + /** + * Constructor + */ + public function __construct($response, $dbi, $db) + { + parent::__construct($response, $dbi); + $this->db = $db; + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Server/ServerBinlogController.php b/phpMyAdmin/libraries/classes/Controllers/Server/ServerBinlogController.php new file mode 100755 index 0000000..807b722 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Server/ServerBinlogController.php @@ -0,0 +1,263 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Server\ServerBinlogController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers\Server; + +use PhpMyAdmin\Controllers\Controller; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Message; +use PhpMyAdmin\Server\Common; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Handles viewing binary logs + * + * @package PhpMyAdmin\Controllers + */ +class ServerBinlogController extends Controller +{ + /** + * array binary log files + */ + protected $binary_logs; + + /** + * Constructs ServerBinlogController + */ + public function __construct($response, $dbi) + { + parent::__construct($response, $dbi); + $this->binary_logs = $this->dbi->fetchResult( + 'SHOW MASTER LOGS', + 'Log_name', + null, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + } + + /** + * Index action + * + * @return void + */ + public function indexAction() + { + /** + * Does the common work + */ + include_once 'libraries/server_common.inc.php'; + + $url_params = array(); + if (! isset($_POST['log']) + || ! array_key_exists($_POST['log'], $this->binary_logs) + ) { + $_POST['log'] = ''; + } else { + $url_params['log'] = $_POST['log']; + } + + if (!empty($_POST['dontlimitchars'])) { + $url_params['dontlimitchars'] = 1; + } + + $this->response->addHTML( + Template::get('server/sub_page_header')->render([ + 'type' => 'binlog', + ]) + ); + $this->response->addHTML($this->_getLogSelector($url_params)); + $this->response->addHTML($this->_getLogInfo($url_params)); + } + + /** + * Returns the html for log selector. + * + * @param array $url_params links parameters + * + * @return string + */ + private function _getLogSelector(array $url_params) + { + return Template::get('server/binlog/log_selector')->render( + array( + 'url_params' => $url_params, + 'binary_logs' => $this->binary_logs, + 'log' => $_POST['log'], + ) + ); + } + + /** + * Returns the html for binary log information. + * + * @param array $url_params links parameters + * + * @return string + */ + private function _getLogInfo(array $url_params) + { + /** + * Need to find the real end of rows? + */ + if (! isset($_POST['pos'])) { + $pos = 0; + } else { + /* We need this to be a integer */ + $pos = (int) $_POST['pos']; + } + + $sql_query = 'SHOW BINLOG EVENTS'; + if (! empty($_POST['log'])) { + $sql_query .= ' IN \'' . $_POST['log'] . '\''; + } + $sql_query .= ' LIMIT ' . $pos . ', ' . intval($GLOBALS['cfg']['MaxRows']); + + /** + * Sends the query + */ + $result = $this->dbi->query($sql_query); + + /** + * prepare some vars for displaying the result table + */ + // Gets the list of fields properties + if (isset($result) && $result) { + $num_rows = $this->dbi->numRows($result); + } else { + $num_rows = 0; + } + + if (empty($_POST['dontlimitchars'])) { + $dontlimitchars = false; + } else { + $dontlimitchars = true; + $url_params['dontlimitchars'] = 1; + } + + //html output + $html = Util::getMessage(Message::success(), $sql_query); + $html .= '<table id="binlogTable">' + . '<thead>' + . '<tr>' + . '<td colspan="6" class="center">'; + + $html .= $this->_getNavigationRow($url_params, $pos, $num_rows, $dontlimitchars); + + $html .= '</td>' + . '</tr>' + . '<tr>' + . '<th>' . __('Log name') . '</th>' + . '<th>' . __('Position') . '</th>' + . '<th>' . __('Event type') . '</th>' + . '<th>' . __('Server ID') . '</th>' + . '<th>' . __('Original position') . '</th>' + . '<th>' . __('Information') . '</th>' + . '</tr>' + . '</thead>' + . '<tbody>'; + + $html .= $this->_getAllLogItemInfo($result, $dontlimitchars); + + $html .= '</tbody>' + . '</table>'; + + return $html; + } + + /** + * Returns the html for Navigation Row. + * + * @param array $url_params Links parameters + * @param int $pos Position to display + * @param int $num_rows Number of results row + * @param bool $dontlimitchars Whether limit chars + * + * @return string + */ + private function _getNavigationRow(array $url_params, $pos, $num_rows, $dontlimitchars) + { + $html = ""; + // we do not know how much rows are in the binlog + // so we can just force 'NEXT' button + if ($pos > 0) { + $this_url_params = $url_params; + if ($pos > $GLOBALS['cfg']['MaxRows']) { + $this_url_params['pos'] = $pos - $GLOBALS['cfg']['MaxRows']; + } + + $html .= '<a href="server_binlog.php" data-post="' + . Url::getCommon($this_url_params, '', false) . '"'; + if (Util::showIcons('TableNavigationLinksMode')) { + $html .= ' title="' . _pgettext('Previous page', 'Previous') . '">'; + } else { + $html .= '>' . _pgettext('Previous page', 'Previous'); + } // end if... else... + $html .= ' < </a> - '; + } + + $this_url_params = $url_params; + if ($pos > 0) { + $this_url_params['pos'] = $pos; + } + if ($dontlimitchars) { + unset($this_url_params['dontlimitchars']); + $tempTitle = __('Truncate Shown Queries'); + $tempImgMode = 'partial'; + } else { + $this_url_params['dontlimitchars'] = 1; + $tempTitle = __('Show Full Queries'); + $tempImgMode = 'full'; + } + $html .= '<a href="server_binlog.php" data-post="' . Url::getCommon($this_url_params, '', false) + . '" title="' . $tempTitle . '">' + . '<img src="' . $GLOBALS['pmaThemeImage'] . 's_' . $tempImgMode + . 'text.png" alt="' . $tempTitle . '" /></a>'; + + // we do not now how much rows are in the binlog + // so we can just force 'NEXT' button + if ($num_rows >= $GLOBALS['cfg']['MaxRows']) { + $this_url_params = $url_params; + $this_url_params['pos'] = $pos + $GLOBALS['cfg']['MaxRows']; + $html .= ' - <a href="server_binlog.php" data-post="' + . Url::getCommon($this_url_params, '', false) + . '"'; + if (Util::showIcons('TableNavigationLinksMode')) { + $html .= ' title="' . _pgettext('Next page', 'Next') . '">'; + } else { + $html .= '>' . _pgettext('Next page', 'Next'); + } // end if... else... + $html .= ' > </a>'; + } + + return $html; + } + + /** + * Returns the html for all binary log items. + * + * @param resource $result MySQL Query result + * @param bool $dontlimitchars Whether limit chars + * + * @return string + */ + private function _getAllLogItemInfo($result, $dontlimitchars) + { + $html = ""; + while ($value = $this->dbi->fetchAssoc($result)) { + $html .= Template::get('server/binlog/log_row')->render( + array( + 'value' => $value, + 'dontlimitchars' => $dontlimitchars, + ) + ); + } + return $html; + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Server/ServerCollationsController.php b/phpMyAdmin/libraries/classes/Controllers/Server/ServerCollationsController.php new file mode 100755 index 0000000..cead8ab --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Server/ServerCollationsController.php @@ -0,0 +1,76 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +/** + * Holds the PhpMyAdmin\Controllers\Server\ServerCollationsController + * + * @package PhpMyAdmin\Controllers + */ + +namespace PhpMyAdmin\Controllers\Server; + +use PhpMyAdmin\Controllers\Controller; +use PhpMyAdmin\Charsets; +use PhpMyAdmin\Server\Common; +use PhpMyAdmin\Template; + +/** + * Handles viewing character sets and collations + * + * @package PhpMyAdmin\Controllers + */ +class ServerCollationsController extends Controller +{ + /** + * Index action + * + * @return void + */ + public function indexAction() + { + $dbi = $GLOBALS['dbi']; + $disableIs = $GLOBALS['cfg']['Server']['DisableIS']; + + /** + * Does the common work + */ + include_once 'libraries/server_common.inc.php'; + + $this->response->addHTML( + Template::get('server/sub_page_header')->render([ + 'type' => 'collations', + ]) + ); + $this->response->addHTML( + $this->_getHtmlForCharsets( + Charsets::getMySQLCharsets($dbi, $disableIs), + Charsets::getMySQLCollations($dbi, $disableIs), + Charsets::getMySQLCharsetsDescriptions($dbi, $disableIs), + Charsets::getMySQLCollationsDefault($dbi, $disableIs) + ) + ); + } + + /** + * Returns the html for server Character Sets and Collations. + * + * @param array $mysqlCharsets Mysql Charsets list + * @param array $mysqlCollations Mysql Collations list + * @param array $mysqlCharsetsDesc Charsets descriptions + * @param array $mysqlDftCollations Default Collations list + * + * @return string + */ + function _getHtmlForCharsets(array $mysqlCharsets, array $mysqlCollations, + array $mysqlCharsetsDesc, array $mysqlDftCollations + ) { + return Template::get('server/collations/charsets')->render( + array( + 'mysql_charsets' => $mysqlCharsets, + 'mysql_collations' => $mysqlCollations, + 'mysql_charsets_desc' => $mysqlCharsetsDesc, + 'mysql_dft_collations' => $mysqlDftCollations, + ) + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Server/ServerDatabasesController.php b/phpMyAdmin/libraries/classes/Controllers/Server/ServerDatabasesController.php new file mode 100755 index 0000000..d802d40 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Server/ServerDatabasesController.php @@ -0,0 +1,470 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +/** + * Holds the PhpMyAdmin\Controllers\Server\ServerDatabasesController + * + * @package PhpMyAdmin\Controllers + */ + +namespace PhpMyAdmin\Controllers\Server; + +use PhpMyAdmin\Controllers\Controller; +use PhpMyAdmin\Charsets; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Message; +use PhpMyAdmin\Response; +use PhpMyAdmin\Server\Common; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Handles viewing and creating and deleting databases + * + * @package PhpMyAdmin\Controllers + */ +class ServerDatabasesController extends Controller +{ + /** + * @var array array of database details + */ + private $_databases; + /** + * @var int number of databases + */ + private $_database_count; + /** + * @var string sort by column + */ + private $_sort_by; + /** + * @var string sort order of databases + */ + private $_sort_order; + /** + * @var boolean whether to show database statistics + */ + private $_dbstats; + /** + * @var int position in list navigation + */ + private $_pos; + + /** + * Index action + * + * @return void + */ + public function indexAction() + { + include_once 'libraries/check_user_privileges.inc.php'; + + $response = Response::getInstance(); + + if (isset($_POST['drop_selected_dbs']) + && $response->isAjax() + && ($GLOBALS['dbi']->isSuperuser() || $GLOBALS['cfg']['AllowUserDropDatabase']) + ) { + $this->dropDatabasesAction(); + return; + } + + include_once 'libraries/replication.inc.php'; + + if (isset($_POST['new_db']) + && $response->isAjax() + ) { + $this->createDatabaseAction(); + return; + } + + include_once 'libraries/server_common.inc.php'; + + $header = $this->response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('server_databases.js'); + + $this->_setSortDetails(); + $this->_dbstats = ! empty($_POST['dbstats']); + $this->_pos = empty($_REQUEST['pos']) ? 0 : (int) $_REQUEST['pos']; + + /** + * Gets the databases list + */ + if ($GLOBALS['server'] > 0) { + $this->_databases = $this->dbi->getDatabasesFull( + null, $this->_dbstats, DatabaseInterface::CONNECT_USER, $this->_sort_by, + $this->_sort_order, $this->_pos, true + ); + $this->_database_count = count($GLOBALS['dblist']->databases); + } else { + $this->_database_count = 0; + } + + if ($this->_database_count > 0 && ! empty($this->_databases)) { + $databases = $this->_getHtmlForDatabases($replication_types); + } + + $this->response->addHTML(Template::get('server/databases/index')->render([ + 'show_create_db' => $GLOBALS['cfg']['ShowCreateDb'], + 'is_create_db_priv' => $GLOBALS['is_create_db_priv'], + 'dbstats' => $this->_dbstats, + 'db_to_create' => $GLOBALS['db_to_create'], + 'server_collation' => $GLOBALS['dbi']->getServerCollation(), + 'databases' => isset($databases) ? $databases : null, + 'dbi' => $GLOBALS['dbi'], + 'disable_is' => $GLOBALS['cfg']['Server']['DisableIS'], + ])); + } + + /** + * Handles creating a new database + * + * @return void + */ + public function createDatabaseAction() + { + // lower_case_table_names=1 `DB` becomes `db` + if ($GLOBALS['dbi']->getLowerCaseNames() === '1') { + $_POST['new_db'] = mb_strtolower( + $_POST['new_db'] + ); + } + /** + * Builds and executes the db creation sql query + */ + $sql_query = 'CREATE DATABASE ' . Util::backquote($_POST['new_db']); + if (! empty($_POST['db_collation'])) { + list($db_charset) = explode('_', $_POST['db_collation']); + $charsets = Charsets::getMySQLCharsets( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['DisableIS'] + ); + $collations = Charsets::getMySQLCollations( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['DisableIS'] + ); + if (in_array($db_charset, $charsets) + && in_array($_POST['db_collation'], $collations[$db_charset]) + ) { + $sql_query .= ' DEFAULT' + . Util::getCharsetQueryPart($_POST['db_collation']); + } + } + $sql_query .= ';'; + + $result = $GLOBALS['dbi']->tryQuery($sql_query); + + if (! $result) { + // avoid displaying the not-created db name in header or navi panel + $GLOBALS['db'] = ''; + + $message = Message::rawError($GLOBALS['dbi']->getError()); + $this->response->setRequestStatus(false); + $this->response->addJSON('message', $message); + } else { + $GLOBALS['db'] = $_POST['new_db']; + + $message = Message::success(__('Database %1$s has been created.')); + $message->addParam($_POST['new_db']); + $this->response->addJSON('message', $message); + $this->response->addJSON( + 'sql_query', Util::getMessage(null, $sql_query, 'success') + ); + + $this->response->addJSON( + 'url_query', + Util::getScriptNameForOption( + $GLOBALS['cfg']['DefaultTabDatabase'], 'database' + ) + . Url::getCommon(array('db' => $_POST['new_db'])) + ); + } + } + + /** + * Handles dropping multiple databases + * + * @return void + */ + public function dropDatabasesAction() + { + if (! isset($_POST['selected_dbs'])) { + $message = Message::error(__('No databases selected.')); + } else { + $action = 'server_databases.php'; + $err_url = $action . Url::getCommon(); + + $GLOBALS['submit_mult'] = 'drop_db'; + $GLOBALS['mult_btn'] = __('Yes'); + + include 'libraries/mult_submits.inc.php'; + + if (empty($message)) { // no error message + $number_of_databases = count($selected); + $message = Message::success( + _ngettext( + '%1$d database has been dropped successfully.', + '%1$d databases have been dropped successfully.', + $number_of_databases + ) + ); + $message->addParam($number_of_databases); + } + } + + if ($message instanceof Message) { + $this->response->setRequestStatus($message->isSuccess()); + $this->response->addJSON('message', $message); + } + } + + /** + * Extracts parameters $sort_order and $sort_by + * + * @return void + */ + private function _setSortDetails() + { + if (empty($_REQUEST['sort_by'])) { + $this->_sort_by = 'SCHEMA_NAME'; + } else { + $sort_by_whitelist = array( + 'SCHEMA_NAME', + 'DEFAULT_COLLATION_NAME', + 'SCHEMA_TABLES', + 'SCHEMA_TABLE_ROWS', + 'SCHEMA_DATA_LENGTH', + 'SCHEMA_INDEX_LENGTH', + 'SCHEMA_LENGTH', + 'SCHEMA_DATA_FREE' + ); + if (in_array($_REQUEST['sort_by'], $sort_by_whitelist)) { + $this->_sort_by = $_REQUEST['sort_by']; + } else { + $this->_sort_by = 'SCHEMA_NAME'; + } + } + + if (isset($_REQUEST['sort_order']) + && mb_strtolower($_REQUEST['sort_order']) == 'desc' + ) { + $this->_sort_order = 'desc'; + } else { + $this->_sort_order = 'asc'; + } + } + + /** + * Returns the html for Database List + * + * @param array $replication_types replication types + * + * @return string + */ + private function _getHtmlForDatabases(array $replication_types) + { + $first_database = reset($this->_databases); + // table col order + $column_order = $this->_getColumnOrder(); + + // calculate aggregate stats to display in footer + foreach ($this->_databases as $current) { + foreach ($column_order as $stat_name => $stat) { + if (array_key_exists($stat_name, $current) + && is_numeric($stat['footer']) + ) { + $column_order[$stat_name]['footer'] += $current[$stat_name]; + } + } + } + + $_url_params = array( + 'pos' => $this->_pos, + 'dbstats' => $this->_dbstats, + 'sort_by' => $this->_sort_by, + 'sort_order' => $this->_sort_order, + ); + + $html = Template::get('server/databases/databases_header')->render([ + 'database_count' => $this->_database_count, + 'pos' => $this->_pos, + 'url_params' => $_url_params, + 'max_db_list' => $GLOBALS['cfg']['MaxDbList'], + 'sort_by' => $this->_sort_by, + 'sort_order' => $this->_sort_order, + 'column_order' => $column_order, + 'first_database' => $first_database, + 'master_replication' => $GLOBALS['replication_info']['master']['status'], + 'slave_replication' => $GLOBALS['replication_info']['slave']['status'], + 'is_superuser' => $GLOBALS['dbi']->isSuperuser(), + 'allow_user_drop_database' => $GLOBALS['cfg']['AllowUserDropDatabase'], + ]); + + $html .= $this->_getHtmlForTableBody($column_order, $replication_types); + + $html .= Template::get('server/databases/databases_footer')->render([ + 'column_order' => $column_order, + 'first_database' => $first_database, + 'master_replication' => $GLOBALS['replication_info']['master']['status'], + 'slave_replication' => $GLOBALS['replication_info']['slave']['status'], + 'database_count' => $this->_database_count, + 'is_superuser' => $GLOBALS['dbi']->isSuperuser(), + 'allow_user_drop_database' => $GLOBALS['cfg']['AllowUserDropDatabase'], + 'pma_theme_image' => $GLOBALS['pmaThemeImage'], + 'text_dir' => $GLOBALS['text_dir'], + 'dbstats' => $this->_dbstats, + ]); + + return $html; + } + + /** + * Prepares the $column_order array + * + * @return array + */ + private function _getColumnOrder() + { + $column_order = array(); + $column_order['DEFAULT_COLLATION_NAME'] = array( + 'disp_name' => __('Collation'), + 'description_function' => array(Charsets::class, 'getCollationDescr'), + 'format' => 'string', + 'footer' => $this->dbi->getServerCollation(), + ); + $column_order['SCHEMA_TABLES'] = array( + 'disp_name' => __('Tables'), + 'format' => 'number', + 'footer' => 0, + ); + $column_order['SCHEMA_TABLE_ROWS'] = array( + 'disp_name' => __('Rows'), + 'format' => 'number', + 'footer' => 0, + ); + $column_order['SCHEMA_DATA_LENGTH'] = array( + 'disp_name' => __('Data'), + 'format' => 'byte', + 'footer' => 0, + ); + $column_order['SCHEMA_INDEX_LENGTH'] = array( + 'disp_name' => __('Indexes'), + 'format' => 'byte', + 'footer' => 0, + ); + $column_order['SCHEMA_LENGTH'] = array( + 'disp_name' => __('Total'), + 'format' => 'byte', + 'footer' => 0, + ); + $column_order['SCHEMA_DATA_FREE'] = array( + 'disp_name' => __('Overhead'), + 'format' => 'byte', + 'footer' => 0, + ); + + return $column_order; + } + + /** + * Returns the html for Database List + * + * @param array $column_order column order + * @param array $replication_types replication types + * + * @return string + */ + private function _getHtmlForTableBody(array $column_order, array $replication_types) + { + $html = '<tbody>' . "\n"; + + foreach ($this->_databases as $current) { + $tr_class = ' db-row'; + if ($this->dbi->isSystemSchema($current['SCHEMA_NAME'], true)) { + $tr_class .= ' noclick'; + } + + $generated_html = $this->_buildHtmlForDb( + $current, + $column_order, + $replication_types, + $GLOBALS['replication_info'], + $tr_class + ); + $html .= $generated_html; + } // end foreach ($this->_databases as $key => $current) + $html .= '</tbody>'; + + return $html; + } + + /** + * Builds the HTML for one database to display in the list + * of databases from server_databases.php + * + * @param array $current current database + * @param array $column_order column order + * @param array $replication_types replication types + * @param array $replication_info replication info + * @param string $tr_class HTMl class for the row + * + * @return array $column_order, $out + */ + function _buildHtmlForDb( + array $current, array $column_order, + array $replication_types, array $replication_info, $tr_class = '' + ) { + $master_replication = $slave_replication = ''; + foreach ($replication_types as $type) { + if ($replication_info[$type]['status']) { + $out = ''; + $key = array_search( + $current["SCHEMA_NAME"], + $replication_info[$type]['Ignore_DB'] + ); + if (strlen($key) > 0) { + $out = Util::getIcon( + 's_cancel', + __('Not replicated') + ); + } else { + $key = array_search( + $current["SCHEMA_NAME"], $replication_info[$type]['Do_DB'] + ); + + if (strlen($key) > 0 + || count($replication_info[$type]['Do_DB']) == 0 + ) { + // if ($key != null) did not work for index "0" + $out = Util::getIcon( + 's_success', + __('Replicated') + ); + } + } + + if ($type == 'master') { + $master_replication = $out; + } elseif ($type == 'slave') { + $slave_replication = $out; + } + } + } + + return Template::get('server/databases/table_row')->render([ + 'current' => $current, + 'tr_class' => $tr_class, + 'column_order' => $column_order, + 'master_replication_status' => $GLOBALS['replication_info']['master']['status'], + 'master_replication' => $master_replication, + 'slave_replication_status' => $GLOBALS['replication_info']['slave']['status'], + 'slave_replication' => $slave_replication, + 'is_superuser' => $GLOBALS['dbi']->isSuperuser(), + 'allow_user_drop_database' => $GLOBALS['cfg']['AllowUserDropDatabase'], + 'is_system_schema' => $GLOBALS['dbi']->isSystemSchema($current['SCHEMA_NAME'], true), + 'default_tab_database' => $GLOBALS['cfg']['DefaultTabDatabase'], + ]); + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Server/ServerEnginesController.php b/phpMyAdmin/libraries/classes/Controllers/Server/ServerEnginesController.php new file mode 100755 index 0000000..794060d --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Server/ServerEnginesController.php @@ -0,0 +1,100 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +/** + * Holds the PhpMyAdmin\Controllers\Server\ServerEnginesController + * + * @package PhpMyAdmin\Controllers + */ + +namespace PhpMyAdmin\Controllers\Server; + +use PhpMyAdmin\Controllers\Controller; +use PhpMyAdmin\Server\Common; +use PhpMyAdmin\StorageEngine; +use PhpMyAdmin\Template; +use PhpMyAdmin\Util; + +/** + * Handles viewing storage engine details + * + * @package PhpMyAdmin\Controllers + */ +class ServerEnginesController extends Controller +{ + /** + * Index action + * + * @return void + */ + public function indexAction() + { + /** + * Does the common work + */ + require 'libraries/server_common.inc.php'; + + /** + * Displays the sub-page heading + */ + $this->response->addHTML( + Template::get('server/sub_page_header')->render([ + 'type' => 'engines', + ]) + ); + + /** + * Did the user request information about a certain storage engine? + */ + if (empty($_REQUEST['engine']) + || ! StorageEngine::isValid($_REQUEST['engine']) + ) { + $this->response->addHTML($this->_getHtmlForAllServerEngines()); + } else { + $engine = StorageEngine::getEngine($_REQUEST['engine']); + $this->response->addHTML($this->_getHtmlForServerEngine($engine)); + } + } + + /** + * Return HTML with all Storage Engine information + * + * @return string + */ + private function _getHtmlForAllServerEngines() + { + return Template::get('server/engines/engines')->render( + array('engines' => StorageEngine::getStorageEngines()) + ); + } + + /** + * Return HTML for a given Storage Engine + * + * @param StorageEngine $engine storage engine + * + * @return string + */ + private function _getHtmlForServerEngine(StorageEngine $engine) + { + $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : ''; + $pageOutput = ! empty($page) ? $engine->getPage($page) : ''; + + /** + * Displays details about a given Storage Engine + */ + return Template::get('server/engines/engine')->render( + array( + 'title' => $engine->getTitle(), + 'help_page' => $engine->getMysqlHelpPage(), + 'comment' => $engine->getComment(), + 'info_pages' => $engine->getInfoPages(), + 'support' => $engine->getSupportInformationMessage(), + 'variables' => $engine->getHtmlVariables(), + 'page_output' => $pageOutput, + 'page' => $page, + 'engine' => $_REQUEST['engine'], + ) + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Server/ServerPluginsController.php b/phpMyAdmin/libraries/classes/Controllers/Server/ServerPluginsController.php new file mode 100755 index 0000000..0094178 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Server/ServerPluginsController.php @@ -0,0 +1,111 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +/** + * Holds the PhpMyAdmin\Controllers\Server\ServerPluginsController +* +* @package PhpMyAdmin\Controllers +*/ + +namespace PhpMyAdmin\Controllers\Server; + +use PhpMyAdmin\Controllers\Controller; +use PhpMyAdmin\Server\Common; +use PhpMyAdmin\Template; + +/** + * Handles viewing server plugin details + * + * @package PhpMyAdmin\Controllers + */ +class ServerPluginsController extends Controller +{ + /** + * @var array plugin details + */ + protected $plugins; + + /** + * Constructs ServerPluginsController + */ + public function __construct($response, $dbi) + { + parent::__construct($response, $dbi); + $this->_setServerPlugins(); + } + + /** + * Index action + * + * @return void + */ + public function indexAction() + { + include 'libraries/server_common.inc.php'; + + $header = $this->response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('vendor/jquery/jquery.tablesorter.js'); + $scripts->addFile('server_plugins.js'); + + /** + * Displays the page + */ + $this->response->addHTML( + Template::get('server/sub_page_header')->render([ + 'type' => 'plugins', + ]) + ); + $this->response->addHTML($this->_getPluginsHtml()); + } + + /** + * Sets details about server plugins + * + * @return void + */ + private function _setServerPlugins() + { + $sql = "SELECT plugin_name, + plugin_type, + (plugin_status = 'ACTIVE') AS is_active, + plugin_type_version, + plugin_author, + plugin_description, + plugin_license + FROM information_schema.plugins + ORDER BY plugin_type, plugin_name"; + + $res = $this->dbi->query($sql); + $this->plugins = array(); + while ($row = $this->dbi->fetchAssoc($res)) { + $this->plugins[$row['plugin_type']][] = $row; + } + $this->dbi->freeResult($res); + ksort($this->plugins); + } + + /** + * Returns the html for plugin Tab. + * + * @return string + */ + private function _getPluginsHtml() + { + $html = '<div id="plugins_plugins">'; + $html .= Template::get('server/plugins/section_links') + ->render(array('plugins' => $this->plugins)); + + foreach ($this->plugins as $plugin_type => $plugin_list) { + $html .= Template::get('server/plugins/section') + ->render( + array( + 'plugin_type' => $plugin_type, + 'plugin_list' => $plugin_list, + ) + ); + } + $html .= '</div>'; + return $html; + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Server/ServerVariablesController.php b/phpMyAdmin/libraries/classes/Controllers/Server/ServerVariablesController.php new file mode 100755 index 0000000..dca5e32 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Server/ServerVariablesController.php @@ -0,0 +1,2837 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ + +/** + * Holds the PhpMyAdmin\Controllers\Server\ServerVariablesController + * + * @package PhpMyAdmin\Controllers + */ + +namespace PhpMyAdmin\Controllers\Server; + +use PhpMyAdmin\Controllers\Controller; +use PhpMyAdmin\Message; +use PhpMyAdmin\Response; +use PhpMyAdmin\Server\Common; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Handles viewing and editing server variables + * + * @package PhpMyAdmin\Controllers + */ +class ServerVariablesController extends Controller +{ + /** + * @var array Documentation links for variables + */ + protected $variable_doc_links; + + /** + * Constructs ServerVariablesController + */ + public function __construct($response, $dbi) + { + parent::__construct($response, $dbi); + + $this->variable_doc_links = $this->_getDocumentLinks(); + } + + /** + * Index action + * + * @return void + */ + public function indexAction() + { + $response = Response::getInstance(); + if ($response->isAjax() + && isset($_GET['type']) + && $_GET['type'] === 'getval' + ) { + $this->getValueAction(); + return; + } + + if ($response->isAjax() + && isset($_POST['type']) + && $_POST['type'] === 'setval' + ) { + $this->setValueAction(); + return; + } + + include 'libraries/server_common.inc.php'; + + $header = $this->response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('server_variables.js'); + + /** + * Displays the sub-page heading + */ + $this->response->addHTML( + Template::get('server/sub_page_header')->render([ + 'type' => 'variables', + 'link' => 'server_system_variables', + ]) + ); + + /** + * Sends the queries and buffers the results + */ + $serverVarsResult = $this->dbi->tryQuery('SHOW SESSION VARIABLES;'); + + if ($serverVarsResult !== false) { + + $serverVarsSession = array(); + while ($arr = $this->dbi->fetchRow($serverVarsResult)) { + $serverVarsSession[$arr[0]] = $arr[1]; + } + $this->dbi->freeResult($serverVarsResult); + + $serverVars = $this->dbi->fetchResult('SHOW GLOBAL VARIABLES;', 0, 1); + + /** + * Link templates + */ + $this->response->addHtml($this->_getHtmlForLinkTemplates()); + + /** + * Displays the page + */ + $this->response->addHtml( + $this->_getHtmlForServerVariables($serverVars, $serverVarsSession) + ); + } else { + /** + * Display the error message + */ + $this->response->addHTML( + Message::error( + sprintf( + __( + 'Not enough privilege to view server variables and ' + . 'settings. %s' + ), + Util::showMySQLDocu( + 'server-system-variables', + false, + 'sysvar_show_compatibility_56' + ) + ) + )->getDisplay() + ); + } + } + + /** + * Handle the AJAX request for a single variable value + * + * @return void + */ + public function getValueAction() + { + // Send with correct charset + header('Content-Type: text/html; charset=UTF-8'); + // Do not use double quotes inside the query to avoid a problem + // when server is running in ANSI_QUOTES sql_mode + $varValue = $this->dbi->fetchSingleRow( + 'SHOW GLOBAL VARIABLES WHERE Variable_name=\'' + . $GLOBALS['dbi']->escapeString($_GET['varName']) . '\';', + 'NUM' + ); + + if (isset($this->variable_doc_links[$_GET['varName']][3]) + && $this->variable_doc_links[$_GET['varName']][3] == 'byte' + ) { + $this->response->addJSON( + 'message', + implode( + ' ', Util::formatByteDown($varValue[1], 3, 3) + ) + ); + } else { + $this->response->addJSON( + 'message', + $varValue[1] + ); + } + } + + /** + * Handle the AJAX request for setting value for a single variable + * + * @return void + */ + public function setValueAction() + { + $value = $_POST['varValue']; + $matches = array(); + + if (isset($this->variable_doc_links[$_POST['varName']][3]) + && $this->variable_doc_links[$_POST['varName']][3] == 'byte' + && preg_match( + '/^\s*(\d+(\.\d+)?)\s*(mb|kb|mib|kib|gb|gib)\s*$/i', + $value, + $matches + ) + ) { + $exp = array( + 'kb' => 1, + 'kib' => 1, + 'mb' => 2, + 'mib' => 2, + 'gb' => 3, + 'gib' => 3 + ); + $value = floatval($matches[1]) * pow( + 1024, + $exp[mb_strtolower($matches[3])] + ); + } else { + $value = $GLOBALS['dbi']->escapeString($value); + } + + if (! is_numeric($value)) { + $value="'" . $value . "'"; + } + + if (! preg_match("/[^a-zA-Z0-9_]+/", $_POST['varName']) + && $this->dbi->query( + 'SET GLOBAL ' . $_POST['varName'] . ' = ' . $value + ) + ) { + // Some values are rounded down etc. + $varValue = $this->dbi->fetchSingleRow( + 'SHOW GLOBAL VARIABLES WHERE Variable_name="' + . $GLOBALS['dbi']->escapeString($_POST['varName']) + . '";', 'NUM' + ); + list($formattedValue, $isHtmlFormatted) = $this->_formatVariable( + $_POST['varName'], $varValue[1] + ); + + if ($isHtmlFormatted == false) { + $this->response->addJSON( + 'variable', + htmlspecialchars( + $formattedValue + ) + ); + } else { + $this->response->addJSON( + 'variable', + $formattedValue + ); + } + } else { + $this->response->setRequestStatus(false); + $this->response->addJSON( + 'error', + __('Setting variable failed') + ); + } + } + + /** + * Format Variable + * + * @param string $name variable name + * @param integer $value variable value + * + * @return array formatted string and bool if string is HTML formatted + */ + private function _formatVariable($name, $value) + { + $isHtmlFormatted = false; + $formattedValue = $value; + + if (is_numeric($value)) { + if (isset($this->variable_doc_links[$name][3]) + && $this->variable_doc_links[$name][3] == 'byte' + ) { + $isHtmlFormatted = true; + $formattedValue = '<abbr title="' + . htmlspecialchars(Util::formatNumber($value, 0)) . '">' + . htmlspecialchars( + implode(' ', Util::formatByteDown($value, 3, 3)) + ) + . '</abbr>'; + } else { + $formattedValue = Util::formatNumber($value, 0); + } + } + + return array( + $formattedValue, + $isHtmlFormatted + ); + } + + /** + * Prints link templates + * + * @return string + */ + private function _getHtmlForLinkTemplates() + { + $url = 'server_variables.php' . Url::getCommon(); + return Template::get('server/variables/link_template') + ->render(array('url' => $url)); + } + + /** + * Prints Html for Server Variables + * + * @param array $serverVars global variables + * @param array $serverVarsSession session variables + * + * @return string + */ + private function _getHtmlForServerVariables(array $serverVars, array $serverVarsSession) + { + // filter + $filterValue = ! empty($_REQUEST['filter']) ? $_REQUEST['filter'] : ''; + $output = Template::get('filter') + ->render(array('filter_value' => $filterValue)); + + $output .= '<div class="responsivetable">'; + $output .= '<table id="serverVariables" class="width100 data filteredData noclick">'; + $output .= Template::get('server/variables/variable_table_head')->render(); + $output .= '<tbody>'; + + $output .= $this->_getHtmlForServerVariablesItems( + $serverVars, $serverVarsSession + ); + + $output .= '</tbody>'; + $output .= '</table>'; + $output .= '</div>'; + + return $output; + } + + + /** + * Prints Html for Server Variables Items + * + * @param array $serverVars global variables + * @param array $serverVarsSession session variables + * + * @return string + */ + private function _getHtmlForServerVariablesItems( + array $serverVars, array $serverVarsSession + ) { + // list of static (i.e. non-editable) system variables + $static_variables = $this->_getStaticSystemVariables(); + + $output = ''; + foreach ($serverVars as $name => $value) { + $has_session_value = isset($serverVarsSession[$name]) + && $serverVarsSession[$name] != $value; + $row_class = ($has_session_value ? ' diffSession' : ''); + $docLink = isset($this->variable_doc_links[$name]) + ? $this->variable_doc_links[$name] : null; + + list($formattedValue, $isHtmlFormatted) = $this->_formatVariable($name, $value); + + $output .= Template::get('server/variables/variable_row')->render(array( + 'row_class' => $row_class, + 'editable' => ! in_array( + strtolower($name), + $static_variables + ), + 'doc_link' => $docLink, + 'name' => $name, + 'value' => $formattedValue, + 'is_superuser' => $this->dbi->isSuperuser(), + 'is_html_formatted' => $isHtmlFormatted, + )); + + if ($has_session_value) { + list($formattedValue, $isHtmlFormatted)= $this->_formatVariable( + $name, $serverVarsSession[$name] + ); + $output .= Template::get('server/variables/session_variable_row') + ->render( + array( + 'row_class' => $row_class, + 'value' => $formattedValue, + 'is_html_formatted' => $isHtmlFormatted, + ) + ); + } + + } + + return $output; + } + + /** + * Returns Array of documentation links + * + * $variable_doc_links[string $name] = array( + * string $name, + * string $anchor, + * string $chapter, + * string $type, + * string $format); + * string $name: name of the system variable + * string $anchor: anchor to the documentation page + * string $chapter: chapter of "HTML, one page per chapter" documentation + * string $type: type of system variable + * string $format: if set to 'byte' it will format the variable + * with Util::formatByteDown() + * + * @return array + */ + private function _getDocumentLinks() + { + $variable_doc_links = array(); + $variable_doc_links['auto_increment_increment'] = array( + 'auto_increment_increment', + 'replication-options-master', + 'sysvar'); + $variable_doc_links['auto_increment_offset'] = array( + 'auto_increment_offset', + 'replication-options-master', + 'sysvar'); + $variable_doc_links['autocommit'] = array( + 'autocommit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['automatic_sp_privileges'] = array( + 'automatic_sp_privileges', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['avoid_temporal_upgrade'] = array( + 'avoid_temporal_upgrade', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['back_log'] = array( + 'back_log', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['basedir'] = array( + 'basedir', + 'server-options', + 'option_mysqld'); + $variable_doc_links['big_tables'] = array( + 'big-tables', + 'server-options', + 'option_mysqld'); + $variable_doc_links['bind_address'] = array( + 'bind-address', + 'server-options', + 'option_mysqld'); + $variable_doc_links['binlog_cache_size'] = array( + 'binlog_cache_size', + 'replication-options-binary-log', + 'sysvar', + 'byte'); + $variable_doc_links['binlog_checksum'] = array( + 'binlog_checksum', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_direct_non_transactional_updates'] = array( + 'binlog_direct_non_transactional_updates', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_error_action'] = array( + 'binlog_error_action', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_format'] = array( + 'binlog-format', + 'server-options', + 'option_mysqld'); + $variable_doc_links['binlog_group_commit_sync_delay'] = array( + 'binlog_group_commit_sync_delay', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_group_commit_sync_no_delay_count'] = array( + 'binlog_group_commit_sync_no_delay_count', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_gtid_simple_recovery'] = array( + 'binlog_gtid_simple_recovery', + 'replication-options-gtids', + 'sysvar'); + $variable_doc_links['binlog_max_flush_queue_time'] = array( + 'binlog_max_flush_queue_time', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_order_commits'] = array( + 'binlog_order_commits', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_row_image'] = array( + 'binlog_row_image', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_rows_query_log_events'] = array( + 'binlog_rows_query_log_events', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['binlog_stmt_cache_size'] = array( + 'binlog_stmt_cache_size', + 'replication-options-binary-log', + 'sysvar', + 'byte'); + $variable_doc_links['block_encryption_mode'] = array( + 'block_encryption_mode', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['bulk_insert_buffer_size'] = array( + 'bulk_insert_buffer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['character_set_client'] = array( + 'character_set_client', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['character_set_connection'] = array( + 'character_set_connection', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['character_set_database'] = array( + 'character_set_database', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['character_set_filesystem'] = array( + 'character-set-filesystem', + 'server-options', + 'option_mysqld'); + $variable_doc_links['character_set_results'] = array( + 'character_set_results', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['character_set_server'] = array( + 'character-set-server', + 'server-options', + 'option_mysqld'); + $variable_doc_links['character_set_system'] = array( + 'character_set_system', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['character_sets_dir'] = array( + 'character-sets-dir', + 'server-options', + 'option_mysqld'); + $variable_doc_links['check_proxy_users'] = array( + 'check_proxy_users', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['collation_connection'] = array( + 'collation_connection', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['collation_database'] = array( + 'collation_database', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['collation_server'] = array( + 'collation-server', + 'server-options', + 'option_mysqld'); + $variable_doc_links['completion_type'] = array( + 'completion_type', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['concurrent_insert'] = array( + 'concurrent_insert', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['connect_timeout'] = array( + 'connect_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['core_file'] = array( + 'core_file', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['datadir'] = array( + 'datadir', + 'server-options', + 'option_mysqld'); + $variable_doc_links['date_format'] = array( + 'date_format', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['datetime_format'] = array( + 'datetime_format', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['debug'] = array( + 'debug', + 'server-options', + 'option_mysqld'); + $variable_doc_links['debug_sync'] = array( + 'debug_sync', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['default_authentication_plugin'] = array( + 'default_authentication_plugin', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['default_password_lifetime'] = array( + 'default_password_lifetime', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['default_storage_engine'] = array( + 'default-storage-engine', + 'server-options', + 'option_mysqld'); + $variable_doc_links['default_tmp_storage_engine'] = array( + 'default_tmp_storage_engine', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['default_week_format'] = array( + 'default_week_format', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['delay_key_write'] = array( + 'delay-key-write', + 'server-options', + 'option_mysqld'); + $variable_doc_links['delayed_insert_limit'] = array( + 'delayed_insert_limit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['delayed_insert_timeout'] = array( + 'delayed_insert_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['delayed_queue_size'] = array( + 'delayed_queue_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['disabled_storage_engines'] = array( + 'disabled_storage_engines', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['disconnect_on_expired_password'] = array( + 'disconnect_on_expired_password', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['div_precision_increment'] = array( + 'div_precision_increment', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['end_markers_in_json'] = array( + 'end_markers_in_json', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['enforce_gtid_consistency'] = array( + 'enforce_gtid_consistency', + 'replication-options-gtids', + 'sysvar'); + $variable_doc_links['eq_range_index_dive_limit'] = array( + 'eq_range_index_dive_limit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['engine_condition_pushdown'] = array( + 'engine-condition-pushdown', + 'server-options', + 'option_mysqld'); + $variable_doc_links['error_count'] = array( + 'error_count', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['event_scheduler'] = array( + 'event-scheduler', + 'server-options', + 'option_mysqld'); + $variable_doc_links['expire_logs_days'] = array( + 'expire_logs_days', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['explicit_defaults_for_timestamp'] = array( + 'explicit_defaults_for_timestamp', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['external_user'] = array( + 'external_user', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['flush'] = array( + 'flush', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['flush_time'] = array( + 'flush_time', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['foreign_key_checks'] = array( + 'foreign_key_checks', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ft_boolean_syntax'] = array( + 'ft_boolean_syntax', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ft_max_word_len'] = array( + 'ft_max_word_len', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ft_min_word_len'] = array( + 'ft_min_word_len', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ft_query_expansion_limit'] = array( + 'ft_query_expansion_limit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ft_stopword_file'] = array( + 'ft_stopword_file', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['general_log'] = array( + 'general-log', + 'server-options', + 'option_mysqld'); + $variable_doc_links['general_log_file'] = array( + 'general_log_file', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['group_concat_max_len'] = array( + 'group_concat_max_len', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['gtid_executed'] = array( + 'gtid_executed', + 'replication-options-gtids', + 'sysvar'); + $variable_doc_links['gtid_executed_compression_period'] = array( + 'gtid_executed_compression_period', + 'replication-options-gtids', + 'sysvar'); + $variable_doc_links['gtid_mode'] = array( + 'gtid_mode', + 'replication-options-gtids', + 'sysvar'); + $variable_doc_links['gtid_owned'] = array( + 'gtid_owned', + 'replication-options-gtids', + 'sysvar'); + $variable_doc_links['gtid_purged'] = array( + 'gtid_purged', + 'replication-options-gtids', + 'sysvar'); + $variable_doc_links['have_compress'] = array( + 'have_compress', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_crypt'] = array( + 'have_crypt', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_csv'] = array( + 'have_csv', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_dynamic_loading'] = array( + 'have_dynamic_loading', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_geometry'] = array( + 'have_geometry', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_innodb'] = array( + 'have_innodb', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_ndbcluster'] = array( + 'have_ndbcluster', + 'mysql-cluster-system-variables', + 'sysvar'); + $variable_doc_links['have_openssl'] = array( + 'have_openssl', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_partitioning'] = array( + 'have_partitioning', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_profiling'] = array( + 'have_profiling', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_query_cache'] = array( + 'have_query_cache', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_rtree_keys'] = array( + 'have_rtree_keys', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_ssl'] = array( + 'have_ssl', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_statement_timeout'] = array( + 'have_statement_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['have_symlink'] = array( + 'have_symlink', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['host_cache_size'] = array( + 'host_cache_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['hostname'] = array( + 'hostname', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['identity'] = array( + 'identity', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ignore_builtin_innodb'] = array( + 'ignore-builtin-innodb', + 'innodb-parameters', + 'option_mysqld'); + $variable_doc_links['ignore_db_dirs'] = array( + 'ignore_db_dirs', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['init_connect'] = array( + 'init_connect', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['init_file'] = array( + 'init-file', + 'server-options', + 'option_mysqld'); + $variable_doc_links['init_slave'] = array( + 'init_slave', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['innodb_adaptive_flushing'] = array( + 'innodb_adaptive_flushing', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_adaptive_flushing_lwm'] = array( + 'innodb_adaptive_flushing_lwm', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_adaptive_hash_index'] = array( + 'innodb_adaptive_hash_index', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_adaptive_hash_index_parts'] = array( + 'innodb_adaptive_hash_index_parts', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_adaptive_max_sleep_delay'] = array( + 'innodb_adaptive_max_sleep_delay', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_additional_mem_pool_size'] = array( + 'innodb_additional_mem_pool_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_api_bk_commit_interval'] = array( + 'innodb_api_bk_commit_interval', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_api_disable_rowlock'] = array( + 'innodb_api_disable_rowlock', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_api_enable_binlog'] = array( + 'innodb_api_enable_binlog', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_api_enable_mdl'] = array( + 'innodb_api_enable_mdl', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_api_trx_level'] = array( + 'innodb_api_trx_level', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_autoextend_increment'] = array( + 'innodb_autoextend_increment', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_autoinc_lock_mode'] = array( + 'innodb_autoinc_lock_mode', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_chunk_size'] = array( + 'innodb_buffer_pool_chunk_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_buffer_pool_dump_at_shutdown'] = array( + 'innodb_buffer_pool_dump_at_shutdown', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_dump_now'] = array( + 'innodb_buffer_pool_dump_now', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_dump_pct'] = array( + 'innodb_buffer_pool_dump_pct', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_filename'] = array( + 'innodb_buffer_pool_filename', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_instances'] = array( + 'innodb_buffer_pool_instances', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_load_abort'] = array( + 'innodb_buffer_pool_load_abort', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_load_at_startup'] = array( + 'innodb_buffer_pool_load_at_startup', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_load_now'] = array( + 'innodb_buffer_pool_load_now', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_buffer_pool_size'] = array( + 'innodb_buffer_pool_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_change_buffer_max_size'] = array( + 'innodb_change_buffer_max_size', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_change_buffering'] = array( + 'innodb_change_buffering', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_checksum_algorithm'] = array( + 'innodb_checksum_algorithm', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_checksums'] = array( + 'innodb_checksums', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_cmp_per_index_enabled'] = array( + 'innodb_cmp_per_index_enabled', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_commit_concurrency'] = array( + 'innodb_commit_concurrency', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_compression_failure_threshold_pct'] = array( + 'innodb_compression_failure_threshold_pct', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_compression_level'] = array( + 'innodb_compression_level', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_compression_pad_pct_max'] = array( + 'innodb_compression_pad_pct_max', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_concurrency_tickets'] = array( + 'innodb_concurrency_tickets', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_data_file_path'] = array( + 'innodb_data_file_path', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_data_home_dir'] = array( + 'innodb_data_home_dir', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_disable_sort_file_cache'] = array( + 'innodb_disable_sort_file_cache', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_doublewrite'] = array( + 'innodb_doublewrite', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_fast_shutdown'] = array( + 'innodb_fast_shutdown', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_file_format'] = array( + 'innodb_file_format', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_file_format_check'] = array( + 'innodb_file_format_check', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_file_format_max'] = array( + 'innodb_file_format_max', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_file_per_table'] = array( + 'innodb_file_per_table', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_fill_factor'] = array( + 'innodb_fill_factor', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_flush_log_at_timeout'] = array( + 'innodb_flush_log_at_timeout', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_flush_log_at_trx_commit'] = array( + 'innodb_flush_log_at_trx_commit', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_flush_method'] = array( + 'innodb_flush_method', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_flush_neighbors'] = array( + 'innodb_flush_neighbors', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_flush_sync'] = array( + 'innodb_flush_sync', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_flushing_avg_loops'] = array( + 'innodb_flushing_avg_loops', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_force_load_corrupted'] = array( + 'innodb_force_load_corrupted', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_force_recovery'] = array( + 'innodb_force_recovery', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_aux_table'] = array( + 'innodb_ft_aux_table', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_cache_size'] = array( + 'innodb_ft_cache_size', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_enable_diag_print'] = array( + 'innodb_ft_enable_diag_print', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_enable_stopword'] = array( + 'innodb_ft_enable_stopword', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_max_token_size'] = array( + 'innodb_ft_max_token_size', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_min_token_size'] = array( + 'innodb_ft_min_token_size', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_num_word_optimize'] = array( + 'innodb_ft_num_word_optimize', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_result_cache_limit'] = array( + 'innodb_ft_result_cache_limit', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_server_stopword_table'] = array( + 'innodb_ft_server_stopword_table', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_sort_pll_degree'] = array( + 'innodb_ft_sort_pll_degree', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_total_cache_size'] = array( + 'innodb_ft_total_cache_size', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_ft_user_stopword_table'] = array( + 'innodb_ft_user_stopword_table', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_io_capacity'] = array( + 'innodb_io_capacity', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_io_capacity_max'] = array( + 'innodb_io_capacity_max', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_large_prefix'] = array( + 'innodb_large_prefix', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_lock_wait_timeout'] = array( + 'innodb_lock_wait_timeout', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_locks_unsafe_for_binlog'] = array( + 'innodb_locks_unsafe_for_binlog', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_log_buffer_size'] = array( + 'innodb_log_buffer_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_log_checksum_algorithm'] = array( + 'innodb_log_checksum_algorithm', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_log_compressed_pages'] = array( + 'innodb_log_compressed_pages', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_log_file_size'] = array( + 'innodb_log_file_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_log_files_in_group'] = array( + 'innodb_log_files_in_group', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_log_group_home_dir'] = array( + 'innodb_log_group_home_dir', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_log_write_ahead_size'] = array( + 'innodb_log_write_ahead_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_lru_scan_depth'] = array( + 'innodb_lru_scan_depth', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_max_dirty_pages_pct'] = array( + 'innodb_max_dirty_pages_pct', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_max_dirty_pages_pct_lwm'] = array( + 'innodb_max_dirty_pages_pct_lwm', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_max_purge_lag'] = array( + 'innodb_max_purge_lag', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_max_purge_lag_delay'] = array( + 'innodb_max_purge_lag_delay', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_max_undo_log_size'] = array( + 'innodb_max_undo_log_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_mirrored_log_groups'] = array( + 'innodb_mirrored_log_groups', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_monitor_disable'] = array( + 'innodb_monitor_disable', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_monitor_enable'] = array( + 'innodb_monitor_enable', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_monitor_reset'] = array( + 'innodb_monitor_reset', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_monitor_reset_all'] = array( + 'innodb_monitor_reset_all', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_old_blocks_pct'] = array( + 'innodb_old_blocks_pct', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_old_blocks_time'] = array( + 'innodb_old_blocks_time', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_online_alter_log_max_size'] = array( + 'innodb_online_alter_log_max_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_open_files'] = array( + 'innodb_open_files', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_optimize_fulltext_only'] = array( + 'innodb_optimize_fulltext_only', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_page_cleaners'] = array( + 'innodb_page_cleaners', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_page_size'] = array( + 'innodb_page_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_print_all_deadlocks'] = array( + 'innodb_print_all_deadlocks', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_purge_batch_size'] = array( + 'innodb_purge_batch_size', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_purge_rseg_truncate_frequency'] = array( + 'innodb_purge_rseg_truncate_frequency', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_purge_threads'] = array( + 'innodb_purge_threads', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_random_read_ahead'] = array( + 'innodb_random_read_ahead', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_read_ahead_threshold'] = array( + 'innodb_read_ahead_threshold', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_read_io_threads'] = array( + 'innodb_read_io_threads', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_read_only'] = array( + 'innodb_read_only', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_replication_delay'] = array( + 'innodb_replication_delay', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_rollback_on_timeout'] = array( + 'innodb_rollback_on_timeout', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_rollback_segments'] = array( + 'innodb_rollback_segments', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_sort_buffer_size'] = array( + 'innodb_sort_buffer_size', + 'innodb-parameters', + 'sysvar', + 'byte'); + $variable_doc_links['innodb_spin_wait_delay'] = array( + 'innodb_spin_wait_delay', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_stats_auto_recalc'] = array( + 'innodb_stats_auto_recalc', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_stats_method'] = array( + 'innodb_stats_method', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_stats_on_metadata'] = array( + 'innodb_stats_on_metadata', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_stats_persistent'] = array( + 'innodb_stats_persistent', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_stats_persistent_sample_pages'] = array( + 'innodb_stats_persistent_sample_pages', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_stats_sample_pages'] = array( + 'innodb_stats_sample_pages', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_stats_transient_sample_pages'] = array( + 'innodb_stats_transient_sample_pages', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_status_output'] = array( + 'innodb_status_output', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_status_output_locks'] = array( + 'innodb_status_output_locks', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_strict_mode'] = array( + 'innodb_strict_mode', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_support_xa'] = array( + 'innodb_support_xa', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_sync_array_size'] = array( + 'innodb_sync_array_size', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_sync_spin_loops'] = array( + 'innodb_sync_spin_loops', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_table_locks'] = array( + 'innodb_table_locks', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_temp_data_file_path'] = array( + 'innodb_temp_data_file_path', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_thread_concurrency'] = array( + 'innodb_thread_concurrency', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_thread_sleep_delay'] = array( + 'innodb_thread_sleep_delay', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_undo_directory'] = array( + 'innodb_undo_directory', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_undo_log_truncate'] = array( + 'innodb_undo_log_truncate', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_undo_logs'] = array( + 'innodb_undo_logs', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_undo_tablespaces'] = array( + 'innodb_undo_tablespaces', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_use_native_aio'] = array( + 'innodb_use_native_aio', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_use_sys_malloc'] = array( + 'innodb_use_sys_malloc', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_version'] = array( + 'innodb_version', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['innodb_write_io_threads'] = array( + 'innodb_write_io_threads', + 'innodb-parameters', + 'sysvar'); + $variable_doc_links['insert_id'] = array( + 'insert_id', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['interactive_timeout'] = array( + 'interactive_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['internal_tmp_disk_storage_engine'] = array( + 'internal_tmp_disk_storage_engine', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['join_buffer_size'] = array( + 'join_buffer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['keep_files_on_create'] = array( + 'keep_files_on_create', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['key_buffer_size'] = array( + 'key_buffer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['key_cache_age_threshold'] = array( + 'key_cache_age_threshold', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['key_cache_block_size'] = array( + 'key_cache_block_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['key_cache_division_limit'] = array( + 'key_cache_division_limit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['language'] = array( + 'language', + 'server-options', + 'option_mysqld'); + $variable_doc_links['large_files_support'] = array( + 'large_files_support', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['large_page_size'] = array( + 'large_page_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['large_pages'] = array( + 'large-pages', + 'server-options', + 'option_mysqld'); + $variable_doc_links['last_insert_id'] = array( + 'last_insert_id', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['lc_messages'] = array( + 'lc-messages', + 'server-options', + 'option_mysqld'); + $variable_doc_links['lc_messages_dir'] = array( + 'lc-messages-dir', + 'server-options', + 'option_mysqld'); + $variable_doc_links['lc_time_names'] = array( + 'lc_time_names', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['license'] = array( + 'license', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['local_infile'] = array( + 'local_infile', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['lock_wait_timeout'] = array( + 'lock_wait_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['locked_in_memory'] = array( + 'locked_in_memory', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_backward_compatible_user_definitions'] = array( + 'log_backward_compatible_user_definitions', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log'] = array( + 'log', + 'server-options', + 'option_mysqld'); + $variable_doc_links['log_bin'] = array( + 'log_bin', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['log-bin'] = array( + 'log-bin', + 'replication-options-binary-log', + 'option_mysqld'); + $variable_doc_links['log_bin_basename'] = array( + 'log_bin_basename', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['log_bin_index'] = array( + 'log_bin_index', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['log_bin_trust_function_creators'] = array( + 'log-bin-trust-function-creators', + 'replication-options-binary-log', + 'option_mysqld'); + $variable_doc_links['log_bin_use_v1_row_events'] = array( + 'log_bin_use_v1_row_events', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['log_error'] = array( + 'log-error', + 'server-options', + 'option_mysqld'); + $variable_doc_links['log_error_verbosity'] = array( + 'log_error_verbosity', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_output'] = array( + 'log-output', + 'server-options', + 'option_mysqld'); + $variable_doc_links['log_queries_not_using_indexes'] = array( + 'log-queries-not-using-indexes', + 'server-options', + 'option_mysqld'); + $variable_doc_links['log_slave_updates'] = array( + 'log-slave-updates', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['log_slow_admin_statements'] = array( + 'log_slow_admin_statements', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_slow_slave_statements'] = array( + 'log_slow_slave_statements', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['log_syslog'] = array( + 'log_syslog', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_syslog_facility'] = array( + 'log_syslog_facility', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_syslog_include_pid'] = array( + 'log_syslog_include_pid', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_syslog_tag'] = array( + 'log_syslog_tag', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_throttle_queries_not_using_indexes'] = array( + 'log_throttle_queries_not_using_indexes', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_timestamps'] = array( + 'log_timestamps', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['log_slow_queries'] = array( + 'log-slow-queries', + 'server-options', + 'option_mysqld'); + $variable_doc_links['log_warnings'] = array( + 'log-warnings', + 'server-options', + 'option_mysqld'); + $variable_doc_links['long_query_time'] = array( + 'long_query_time', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['low_priority_updates'] = array( + 'low-priority-updates', + 'server-options', + 'option_mysqld'); + $variable_doc_links['lower_case_file_system'] = array( + 'lower_case_file_system', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['lower_case_table_names'] = array( + 'lower_case_table_names', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['master_info_repository'] = array( + 'master_info_repository', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['master_verify_checksum'] = array( + 'master_verify_checksum', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['master-bind'] = array( + '', + 'replication-options', + 0); + $variable_doc_links['max_allowed_packet'] = array( + 'max_allowed_packet', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_binlog_cache_size'] = array( + 'max_binlog_cache_size', + 'replication-options-binary-log', + 'sysvar', + 'byte'); + $variable_doc_links['max_binlog_size'] = array( + 'max_binlog_size', + 'replication-options-binary-log', + 'sysvar', + 'byte'); + $variable_doc_links['max_binlog_stmt_cache_size'] = array( + 'max_binlog_stmt_cache_size', + 'replication-options-binary-log', + 'sysvar', + 'byte'); + $variable_doc_links['max_connect_errors'] = array( + 'max_connect_errors', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_connections'] = array( + 'max_connections', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_delayed_threads'] = array( + 'max_delayed_threads', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_digest_length'] = array( + 'max_digest_length', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_error_count'] = array( + 'max_error_count', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_execution_time'] = array( + 'max_execution_time', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_heap_table_size'] = array( + 'max_heap_table_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['max_insert_delayed_threads'] = array( + 'max_insert_delayed_threads', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_join_size'] = array( + 'max_join_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_length_for_sort_data'] = array( + 'max_length_for_sort_data', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_points_in_geometry'] = array( + 'max_points_in_geometry', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_long_data_size'] = array( + 'max_long_data_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_prepared_stmt_count'] = array( + 'max_prepared_stmt_count', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_relay_log_size'] = array( + 'max_relay_log_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['max_seeks_for_key'] = array( + 'max_seeks_for_key', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_sort_length'] = array( + 'max_sort_length', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_sp_recursion_depth'] = array( + 'max_sp_recursion_depth', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_tmp_tables'] = array( + 'max_tmp_tables', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_user_connections'] = array( + 'max_user_connections', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['max_write_lock_count'] = array( + 'max_write_lock_count', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['metadata_locks_cache_size'] = array( + 'metadata_locks_cache_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['metadata_locks_hash_instances'] = array( + 'metadata_locks_hash_instances', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['memlock'] = array( + 'memlock', + 'server-options', + 'option_mysqld'); + $variable_doc_links['min_examined_row_limit'] = array( + 'min-examined-row-limit', + 'server-options', + 'option_mysqld'); + $variable_doc_links['multi_range_count'] = array( + 'multi_range_count', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['myisam_data_pointer_size'] = array( + 'myisam_data_pointer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['myisam_max_sort_file_size'] = array( + 'myisam_max_sort_file_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['myisam_mmap_size'] = array( + 'myisam_mmap_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['myisam_recover_options'] = array( + 'myisam_recover_options', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['myisam_repair_threads'] = array( + 'myisam_repair_threads', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['myisam_sort_buffer_size'] = array( + 'myisam_sort_buffer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['myisam_stats_method'] = array( + 'myisam_stats_method', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['myisam_use_mmap'] = array( + 'myisam_use_mmap', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['mysql_native_password_proxy_users'] = array( + 'mysql_native_password_proxy_users', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['named_pipe'] = array( + 'named_pipe', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['net_buffer_length'] = array( + 'net_buffer_length', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['net_read_timeout'] = array( + 'net_read_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['net_retry_count'] = array( + 'net_retry_count', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['net_write_timeout'] = array( + 'net_write_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['new'] = array( + 'new', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ngram_token_size'] = array( + 'ngram_token_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['offline_mode'] = array( + 'offline_mode', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['old'] = array( + 'old', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['old_alter_table'] = array( + 'old-alter-table', + 'server-options', + 'option_mysqld'); + $variable_doc_links['old_passwords'] = array( + 'old-passwords', + 'server-options', + 'option_mysqld'); + $variable_doc_links['open_files_limit'] = array( + 'open-files-limit', + 'server-options', + 'option_mysqld'); + $variable_doc_links['optimizer_prune_level'] = array( + 'optimizer_prune_level', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['optimizer_search_depth'] = array( + 'optimizer_search_depth', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['optimizer_switch'] = array( + 'optimizer_switch', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['optimizer_trace'] = array( + 'optimizer_trace', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['optimizer_trace_features'] = array( + 'optimizer_trace_features', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['optimizer_trace_limit'] = array( + 'optimizer_trace_limit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['optimizer_trace_max_mem_size'] = array( + 'optimizer_trace_max_mem_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['optimizer_trace_offset'] = array( + 'optimizer_trace_offset', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['partition'] = array( + 'partition', + 'server-options', + 'option_mysqld'); + $variable_doc_links['performance_schema'] = array( + 'performance_schema', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_accounts_size'] = array( + 'performance_schema_accounts_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_digests_size'] = array( + 'performance_schema_digests_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_events_stages_history_long_size'] + = array( + 'performance_schema_events_stages_history_long_size', + 'performance-schema-system-variables', + 'sysvar', + ); + $variable_doc_links['performance_schema_events_stages_history_size'] = array( + 'performance_schema_events_stages_history_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_events_statements_history_long_size'] + = array( + 'performance_schema_events_statements_history_long_size', + 'performance-schema-system-variables', + 'sysvar', + ); + $variable_doc_links['performance_schema_events_statements_history_size'] + = array( + 'performance_schema_events_statements_history_size', + 'performance-schema-system-variables', + 'sysvar', + ); + $variable_doc_links['performance_schema_events_transactions_history_long_size'] + = array( + 'performance_schema_events_transactions_history_long_size', + 'performance-schema-system-variables', + 'sysvar', + ); + $variable_doc_links['performance_schema_events_transactions_history_size'] + = array( + 'performance_schema_events_transactions_history_size', + 'performance-schema-system-variables', + 'sysvar', + ); + $variable_doc_links['performance_schema_events_waits_history_long_size'] + = array( + 'performance_schema_events_waits_history_long_size', + 'performance-schema-system-variables', + 'sysvar', + ); + $variable_doc_links['performance_schema_events_waits_history_size'] = array( + 'performance_schema_events_waits_history_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_hosts_size'] = array( + 'performance_schema_hosts_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_cond_classes'] = array( + 'performance_schema_max_cond_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_cond_instances'] = array( + 'performance_schema_max_cond_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_digest_length'] = array( + 'performance_schema_max_digest_length', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_file_classes'] = array( + 'performance_schema_max_file_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_file_handles'] = array( + 'performance_schema_max_file_handles', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_file_instances'] = array( + 'performance_schema_max_file_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_index_stat'] = array( + 'performance_schema_max_index_stat', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_memory_classes'] = array( + 'performance_schema_max_memory_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_metadata_locks'] = array( + 'performance_schema_max_metadata_locks', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_mutex_classes'] = array( + 'performance_schema_max_mutex_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_mutex_instances'] = array( + 'performance_schema_max_mutex_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_prepared_statements_instances'] = array( + 'performance_schema_max_prepared_statements_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_program_instances'] = array( + 'performance_schema_max_program_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_rwlock_classes'] = array( + 'performance_schema_max_rwlock_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_rwlock_instances'] = array( + 'performance_schema_max_rwlock_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_socket_classes'] = array( + 'performance_schema_max_socket_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_socket_instances'] = array( + 'performance_schema_max_socket_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_sql_text_length'] = array( + 'performance_schema_max_sql_text_length', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_stage_classes'] = array( + 'performance_schema_max_stage_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_statement_classes'] = array( + 'performance_schema_max_statement_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_statement_stack'] = array( + 'performance_schema_max_statement_stack', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_table_handles'] = array( + 'performance_schema_max_table_handles', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_table_instances'] = array( + 'performance_schema_max_table_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_table_lock_stat'] = array( + 'performance_schema_max_table_lock_stat', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_thread_classes'] = array( + 'performance_schema_max_thread_classes', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_max_thread_instances'] = array( + 'performance_schema_max_thread_instances', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_session_connect_attrs_size'] = array( + 'performance_schema_session_connect_attrs_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_setup_actors_size'] = array( + 'performance_schema_setup_actors_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_setup_objects_size'] = array( + 'performance_schema_setup_objects_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['performance_schema_users_size'] = array( + 'performance_schema_users_size', + 'performance-schema-system-variables', + 'sysvar'); + $variable_doc_links['pid_file'] = array( + 'pid-file', + 'server-options', + 'option_mysqld'); + $variable_doc_links['plugin_dir'] = array( + 'plugin_dir', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['port'] = array( + 'port', + 'server-options', + 'option_mysqld'); + $variable_doc_links['preload_buffer_size'] = array( + 'preload_buffer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['profiling'] = array( + 'profiling', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['profiling_history_size'] = array( + 'profiling_history_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['protocol_version'] = array( + 'protocol_version', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['proxy_user'] = array( + 'proxy_user', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['pseudo_thread_id'] = array( + 'pseudo_thread_id', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['query_alloc_block_size'] = array( + 'query_alloc_block_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['query_cache_limit'] = array( + 'query_cache_limit', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['query_cache_min_res_unit'] = array( + 'query_cache_min_res_unit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['query_cache_size'] = array( + 'query_cache_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['query_cache_type'] = array( + 'query_cache_type', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['query_cache_wlock_invalidate'] = array( + 'query_cache_wlock_invalidate', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['query_prealloc_size'] = array( + 'query_prealloc_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['rand_seed1'] = array( + 'rand_seed1', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['rand_seed2'] = array( + 'rand_seed2', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['range_alloc_block_size'] = array( + 'range_alloc_block_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['rbr_exec_mode'] = array( + 'rbr_exec_mode', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['read_buffer_size'] = array( + 'read_buffer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['read_only'] = array( + 'read_only', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['read_rnd_buffer_size'] = array( + 'read_rnd_buffer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['relay_log'] = array( + 'relay_log', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['relay_log_basename'] = array( + 'relay_log_basename', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['relay-log-index'] = array( + 'relay-log-index', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['relay_log_index'] = array( + 'relay_log_index', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['relay_log_info_file'] = array( + 'relay_log_info_file', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['relay_log_info_repository'] = array( + 'relay_log_info_repository', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['relay_log_purge'] = array( + 'relay_log_purge', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['relay_log_recovery'] = array( + 'relay_log_recovery', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['relay_log_space_limit'] = array( + 'relay_log_space_limit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['report_host'] = array( + 'report-host', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['report_password'] = array( + 'report-password', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['report_port'] = array( + 'report-port', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['report_user'] = array( + 'report-user', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['require_secure_transport'] = array( + 'require_secure_transport', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['rpl_stop_slave_timeout'] = array( + 'rpl_stop_slave_timeout', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['rpl_recovery_rank'] = array( + 'rpl_recovery_rank', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['rpl_semi_sync_master_enabled'] = array( + 'rpl_semi_sync_master_enabled', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['rpl_semi_sync_master_timeout'] = array( + 'rpl_semi_sync_master_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['rpl_semi_sync_master_trace_level'] = array( + 'rpl_semi_sync_master_trace_level', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['rpl_semi_sync_master_wait_no_slave'] = array( + 'rpl_semi_sync_master_wait_no_slave', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['rpl_semi_sync_slave_enabled'] = array( + 'rpl_semi_sync_slave_enabled', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['rpl_semi_sync_slave_trace_level'] = array( + 'rpl_semi_sync_slave_trace_level', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['safe_show_database'] = array( + 'safe-show-database', + 'server-options', + 'option_mysqld'); + $variable_doc_links['secure_auth'] = array( + 'secure-auth', + 'server-options', + 'option_mysqld'); + $variable_doc_links['secure_file_priv'] = array( + 'secure-file-priv', + 'server-options', + 'option_mysqld'); + $variable_doc_links['server_id'] = array( + 'server-id', + 'replication-options', + 'option_mysqld'); + $variable_doc_links['server_id_bits'] = array( + 'server_id_bits', + 'mysql-cluster-system-variables', + 'sysvar'); + $variable_doc_links['server_uuid'] = array( + 'server_uuid', + 'replication-options', + 'sysvar'); + $variable_doc_links['session_track_gtids'] = array( + 'session_track_gtids', + 'server_system_variables', + 'sysvar'); + $variable_doc_links['session_track_schema'] = array( + 'session_track_schema', + 'server_system_variables', + 'sysvar'); + $variable_doc_links['session_track_state_change'] = array( + 'session_track_state_change', + 'server_system_variables', + 'sysvar'); + $variable_doc_links['session_track_system_variables'] = array( + 'session_track_system_variables', + 'session_system_variables', + 'sysvar'); + $variable_doc_links['session_track_transaction_info'] = array( + 'session_track_transaction_info', + 'session_system_variables', + 'sysvar'); + $variable_doc_links['sha256_password_proxy_users'] = array( + 'sha256_password_proxy_users', + 'session_system_variables', + 'sysvar'); + $variable_doc_links['show_compatibility_56'] = array( + 'show_compatibility_56', + 'session_system_variables', + 'sysvar'); + $variable_doc_links['show_old_temporals'] = array( + 'show_old_temporals', + 'session_system_variables', + 'sysvar'); + $variable_doc_links['shared_memory'] = array( + 'shared_memory', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['shared_memory_base_name'] = array( + 'shared_memory_base_name', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['skip_external_locking'] = array( + 'skip-external-locking', + 'server-options', + 'option_mysqld'); + $variable_doc_links['skip_name_resolve'] = array( + 'skip-name-resolve', + 'server-options', + 'option_mysqld'); + $variable_doc_links['skip_networking'] = array( + 'skip-networking', + 'server-options', + 'option_mysqld'); + $variable_doc_links['skip_show_database'] = array( + 'skip-show-database', + 'server-options', + 'option_mysqld'); + $variable_doc_links['slave_allow_batching'] = array( + 'slave_allow_batching', + 'mysql-cluster-system-variables', + 'sysvar'); + $variable_doc_links['slave_checkpoint_group'] = array( + 'slave_checkpoint_group', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_checkpoint_period'] = array( + 'slave_checkpoint_period', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_compressed_protocol'] = array( + 'slave_compressed_protocol', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_exec_mode'] = array( + 'slave_exec_mode', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_load_tmpdir'] = array( + 'slave-load-tmpdir', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['slave_max_allowed_packet'] = array( + 'slave_max_allowed_packet', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_net_timeout'] = array( + 'slave-net-timeout', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['slave_parallel_type'] = array( + 'slave_parallel_type', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_parallel_workers'] = array( + 'slave_parallel_workers', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_pending_jobs_size_max'] = array( + 'slave_pending_jobs_size_max', + 'replication-options-slave', + 'sysvar', + 'byte'); + $variable_doc_links['slave_preserve_commit_order'] = array( + 'slave_preserve_commit_order', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_rows_search_algorithms'] = array( + 'slave_rows_search_algorithms', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_skip_errors'] = array( + 'slave-skip-errors', + 'replication-options-slave', + 'option_mysqld'); + $variable_doc_links['slave_sql_verify_checksum'] = array( + 'slave_sql_verify_checksum', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_transaction_retries'] = array( + 'slave_transaction_retries', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slave_type_conversions'] = array( + 'slave_type_conversions', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['slow_launch_time'] = array( + 'slow_launch_time', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['slow_query_log'] = array( + 'slow-query-log', + 'server-options', + 'server-system-variables'); + $variable_doc_links['slow_query_log_file'] = array( + 'slow_query_log_file', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['socket'] = array( + 'socket', + 'server-options', + 'option_mysqld'); + $variable_doc_links['sort_buffer_size'] = array( + 'sort_buffer_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['sql_auto_is_null'] = array( + 'sql_auto_is_null', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_big_selects'] = array( + 'sql_big_selects', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_big_tables'] = array( + 'big-tables', + 'server-options', + 'server-system-variables'); + $variable_doc_links['sql_buffer_result'] = array( + 'sql_buffer_result', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_log_bin'] = array( + 'sql_log_bin', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_log_off'] = array( + 'sql_log_off', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_log_update'] = array( + 'sql_log_update', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_low_priority_updates'] = array( + 'sql_low_priority_updates', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_max_join_size'] = array( + 'sql_max_join_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_mode'] = array( + 'sql-mode', + 'server-options', + 'option_mysqld'); + $variable_doc_links['sql_notes'] = array( + 'sql_notes', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_quote_show_create'] = array( + 'sql_quote_show_create', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_safe_updates'] = array( + 'sql_safe_updates', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_select_limit'] = array( + 'sql_select_limit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sql_slave_skip_counter'] = array( + 'sql_slave_skip_counter', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['sql_warnings'] = array( + 'sql_warnings', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ssl_ca'] = array( + 'ssl-ca', + 'ssl-options', + 'option_general'); + $variable_doc_links['ssl_capath'] = array( + 'ssl-capath', + 'ssl-options', + 'option_general'); + $variable_doc_links['ssl_cert'] = array( + 'ssl-cert', + 'ssl-options', + 'option_general'); + $variable_doc_links['ssl_cipher'] = array( + 'ssl-cipher', + 'ssl-options', + 'option_general'); + $variable_doc_links['ssl_crl'] = array( + 'ssl_crl', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ssl_crlpath'] = array( + 'ssl_crlpath', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['ssl_key'] = array( + 'ssl-key', + 'ssl-options', + 'option_general'); + $variable_doc_links['storage_engine'] = array( + 'storage_engine', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['stored_program_cache'] = array( + 'stored_program_cache', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['super_read_only'] = array( + 'super_read_only', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sync_binlog'] = array( + 'sync_binlog', + 'replication-options-binary-log', + 'sysvar'); + $variable_doc_links['sync_frm'] = array( + 'sync_frm', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['sync_master_info'] = array( + 'sync_master_info', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['sync_relay_log'] = array( + 'sync_relay_log', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['sync_relay_log_info'] = array( + 'sync_relay_log_info', + 'replication-options-slave', + 'sysvar'); + $variable_doc_links['system_time_zone'] = array( + 'system_time_zone', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['table_definition_cache'] = array( + 'table_definition_cache', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['table_lock_wait_timeout'] = array( + 'table_lock_wait_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['table_open_cache'] = array( + 'table_open_cache', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['table_open_cache_instances'] = array( + 'table_open_cache_instances', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['table_type'] = array( + 'table_type', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['thread_cache_size'] = array( + 'thread_cache_size', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['thread_concurrency'] = array( + 'thread_concurrency', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['thread_handling'] = array( + 'thread_handling', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['thread_stack'] = array( + 'thread_stack', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['time_format'] = array( + 'time_format', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['time_zone'] = array( + 'time_zone', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['timed_mutexes'] = array( + 'timed_mutexes', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['timestamp'] = array( + 'timestamp', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['tmp_table_size'] = array( + 'tmp_table_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['tmpdir'] = array( + 'tmpdir', + 'server-options', + 'option_mysqld'); + $variable_doc_links['transaction_alloc_block_size'] = array( + 'transaction_alloc_block_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['transaction_prealloc_size'] = array( + 'transaction_prealloc_size', + 'server-system-variables', + 'sysvar', + 'byte'); + $variable_doc_links['transaction_write_set_extraction'] = array( + 'transaction_write_set_extraction', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['tx_isolation'] = array( + 'tx_isolation', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['tx_read_only'] = array( + 'tx_read_only', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['unique_checks'] = array( + 'unique_checks', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['updatable_views_with_limit'] = array( + 'updatable_views_with_limit', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['version'] = array( + 'version', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['version_comment'] = array( + 'version_comment', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['version_compile_machine'] = array( + 'version_compile_machine', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['version_compile_os'] = array( + 'version_compile_os', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['wait_timeout'] = array( + 'wait_timeout', + 'server-system-variables', + 'sysvar'); + $variable_doc_links['warning_count'] = array( + 'warning_count', + 'server-system-variables', + 'sysvar'); + return $variable_doc_links; + } + + /** + * Returns array of static(i.e. non-editable/ read-only) global system variables + * + * See https://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html + * + * @return array + */ + private function _getStaticSystemVariables() + { + $static_variables = array( + 'audit_log_buffer_size', + 'audit_log_current_session', + 'audit_log_file', + 'audit_log_format', + 'audit_log_policy', + 'audit_log_strategy', + 'auto_generate_certs', + 'back_log', + 'basedir', + 'bind_address', + 'binlog_gtid_simple_recovery', + 'character_set_system', + 'character_sets_dir', + 'core_file', + 'daemon_memcached_enable_binlog', + 'daemon_memcached_engine_lib_name', + 'daemon_memcached_engine_lib_path', + 'daemon_memcached_option', + 'daemon_memcached_r_batch_size', + 'daemon_memcached_w_batch_size', + 'datadir', + 'date_format', + 'datetime_format', + 'default_authentication_plugin', + 'disabled_storage_engines', + 'explicit_defaults_for_timestamp', + 'ft_max_word_len', + 'ft_min_word_len', + 'ft_query_expansion_limit', + 'ft_stopword_file', + 'gtid_owned', + 'have_compress', + 'have_crypt', + 'have_dynamic_loading', + 'have_geometry', + 'have_openssl', + 'have_profiling', + 'have_query_cache', + 'have_rtree_keys', + 'have_ssl', + 'have_statement_timeout', + 'have_symlink', + 'hostname', + 'ignore_builtin_innodb', + 'ignore_db_dirs', + 'init_file', + 'innodb_adaptive_hash_index_parts', + 'innodb_additional_mem_pool_size', + 'innodb_api_disable_rowlock', + 'innodb_api_enable_binlog', + 'innodb_api_enable_mdl', + 'innodb_autoinc_lock_mode', + 'innodb_buffer_pool_chunk_size', + 'innodb_buffer_pool_instances', + 'innodb_buffer_pool_load_at_startup', + 'innodb_checksums', + 'innodb_data_file_path', + 'innodb_data_home_dir', + 'innodb_doublewrite', + 'innodb_file_format_check', + 'innodb_flush_method', + 'innodb_force_load_corrupted', + 'innodb_force_recovery', + 'innodb_ft_cache_size', + 'innodb_ft_max_token_size', + 'innodb_ft_min_token_size', + 'innodb_ft_sort_pll_degree', + 'innodb_ft_total_cache_size', + 'innodb_locks_unsafe_for_binlog', + 'innodb_log_buffer_size', + 'innodb_log_file_size', + 'innodb_log_files_in_group', + 'innodb_log_group_home_dir', + 'innodb_numa_interleave', + 'innodb_open_files', + 'innodb_page_cleaners', + 'innodb_page_size', + 'innodb_purge_threads', + 'innodb_read_io_threads', + 'innodb_read_only', + 'innodb_rollback_on_timeout', + 'innodb_sort_buffer_size', + 'innodb_sync_array_size', + 'innodb_sync_debug', + 'innodb_temp_data_file_path', + 'innodb_undo_directory', + 'innodb_undo_tablespaces', + 'innodb_use_native_aio', + 'innodb_use_sys_malloc', + 'innodb_version', + 'innodb_write_io_threads', + 'language', + 'large_files_support', + 'large_page_size', + 'large_pages', + 'lc_messages_dir', + 'license', + 'locked_in_memory', + 'log-bin', + 'log_bin', + 'log_bin_basename', + 'log_bin_index', + 'log_bin_use_v1_row_events', + 'log_bin_use_v1_row_events', + 'log_error', + 'log_slave_updates', + 'log_slave_updates', + 'lower_case_file_system', + 'lower_case_table_names', + 'max_digest_length', + 'mecab_rc_file', + 'metadata_locks_cache_size', + 'metadata_locks_hash_instances', + 'myisam_mmap_size', + 'myisam_recover_options', + 'named_pipe', + 'ndb-batch-size', + 'ndb-cluster-connection-pool', + 'ndb-cluster-connection-pool-nodeids', + 'ndb_log_apply_status', + 'ndb_log_apply_status', + 'ndb_log_orig', + 'ndb_log_orig', + 'ndb_log_transaction_id', + 'ndb_log_transaction_id', + 'ndb_optimized_node_selection', + 'Ndb_slave_max_replicated_epoch', + 'ndb_use_copying_alter_table', + 'ndb_version', + 'ndb_version_string', + 'ndb-wait-connected', + 'ndb-wait-setup', + 'ndbinfo_database', + 'ndbinfo_version', + 'ngram_token_size', + 'old', + 'open_files_limit', + 'performance_schema', + 'performance_schema_accounts_size', + 'performance_schema_digests_size', + 'performance_schema_events_stages_history_long_size', + 'performance_schema_events_stages_history_size', + 'performance_schema_events_statements_history_long_size', + 'performance_schema_events_statements_history_size', + 'performance_schema_events_transactions_history_long_size', + 'performance_schema_events_transactions_history_size', + 'performance_schema_events_waits_history_long_size', + 'performance_schema_events_waits_history_size', + 'performance_schema_hosts_size', + 'performance_schema_max_cond_classes', + 'performance_schema_max_cond_instances', + 'performance_schema_max_digest_length', + 'performance_schema_max_file_classes', + 'performance_schema_max_file_handles', + 'performance_schema_max_file_instances', + 'performance_schema_max_index_stat', + 'performance_schema_max_memory_classes', + 'performance_schema_max_metadata_locks', + 'performance_schema_max_mutex_classes', + 'performance_schema_max_mutex_instances', + 'performance_schema_max_prepared_statements_instances', + 'performance_schema_max_program_instances', + 'performance_schema_max_rwlock_classes', + 'performance_schema_max_rwlock_instances', + 'performance_schema_max_socket_classes', + 'performance_schema_max_socket_instances', + 'performance_schema_max_sql_text_length', + 'performance_schema_max_stage_classes', + 'performance_schema_max_statement_classes', + 'performance_schema_max_statement_stack', + 'performance_schema_max_table_handles', + 'performance_schema_max_table_instances', + 'performance_schema_max_table_lock_stat', + 'performance_schema_max_thread_classes', + 'performance_schema_max_thread_instances', + 'performance_schema_session_connect_attrs_size', + 'performance_schema_setup_actors_size', + 'performance_schema_setup_objects_size', + 'performance_schema_users_size', + 'pid_file', + 'plugin_dir', + 'port', + 'protocol_version', + 'relay_log', + 'relay_log_basename', + 'relay_log_index', + 'relay_log_index', + 'relay_log_info_file', + 'relay_log_recovery', + 'relay_log_space_limit', + 'report_host', + 'eport_password', + 'report_port', + 'report_user', + 'secure_file_priv', + 'server_id_bits', + 'server_id_bits', + 'server_uuid', + 'sha256_password_auto_generate_rsa_keys', + 'sha256_password_private_key_path', + 'sha256_password_public_key_path', + 'shared_memory', + 'shared_memory_base_name', + 'simplified_binlog_gtid_recovery', + 'skip_external_locking', + 'skip_name_resolve', + 'skip_networking', + 'skip_show_database', + 'slave_load_tmpdir', + 'slave_skip_errors', + 'slave_type_conversions', + 'socket', + 'ssl_ca', + 'ssl_capath', + 'ssl_cert', + 'ssl_cipher', + 'ssl_crl', + 'ssl_crlpath', + 'ssl_key', + 'system_time_zone', + 'table_open_cache_instances', + 'thread_concurrency', + 'thread_handling', + 'thread_stack', + 'time_format', + 'tls_version', + 'tmpdir', + 'validate_user_plugins', + 'version', + 'version_comment', + 'version_compile_machine', + 'version_compile_os', + 'version_tokens_session_number' + ); + + return $static_variables; + } + +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Table/TableChartController.php b/phpMyAdmin/libraries/classes/Controllers/Table/TableChartController.php new file mode 100755 index 0000000..82bb1c1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Table/TableChartController.php @@ -0,0 +1,246 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Table\TableChartController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers\Table; + +use PhpMyAdmin\Controllers\TableController; +use PhpMyAdmin\Message; +use PhpMyAdmin\Response; +use PhpMyAdmin\SqlParser\Components\Limit; +use PhpMyAdmin\SqlParser\Parser; +use PhpMyAdmin\Table; +use PhpMyAdmin\Template; +use PhpMyAdmin\Util; + +/** + * Handles table related logic + * + * @package PhpMyAdmin\Controllers + */ +class TableChartController extends TableController +{ + /** + * @var string $sql_query + */ + protected $sql_query; + + /** + * @var string $url_query + */ + protected $url_query; + + /** + * @var array $cfg + */ + protected $cfg; + + /** + * Constructor + * + * @param string $sql_query Query + * @param string $url_query Query URL + * @param array $cfg Configuration + */ + public function __construct( + $response, + $dbi, + $db, + $table, + $sql_query, + $url_query, + array $cfg + ) { + parent::__construct($response, $dbi, $db, $table); + + $this->sql_query = $sql_query; + $this->url_query = $url_query; + $this->cfg = $cfg; + } + + /** + * Execute the query and return the result + * + * @return void + */ + public function indexAction() + { + $response = Response::getInstance(); + if ($response->isAjax() + && isset($_REQUEST['pos']) + && isset($_REQUEST['session_max_rows']) + ) { + $this->ajaxAction(); + return; + } + + // Throw error if no sql query is set + if (!isset($this->sql_query) || $this->sql_query == '') { + $this->response->setRequestStatus(false); + $this->response->addHTML( + Message::error(__('No SQL query was set to fetch data.')) + ); + return; + } + + $this->response->getHeader()->getScripts()->addFiles( + array( + 'chart.js', + 'tbl_chart.js', + 'vendor/jqplot/jquery.jqplot.js', + 'vendor/jqplot/plugins/jqplot.barRenderer.js', + 'vendor/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js', + 'vendor/jqplot/plugins/jqplot.canvasTextRenderer.js', + 'vendor/jqplot/plugins/jqplot.categoryAxisRenderer.js', + 'vendor/jqplot/plugins/jqplot.dateAxisRenderer.js', + 'vendor/jqplot/plugins/jqplot.pointLabels.js', + 'vendor/jqplot/plugins/jqplot.pieRenderer.js', + 'vendor/jqplot/plugins/jqplot.enhancedPieLegendRenderer.js', + 'vendor/jqplot/plugins/jqplot.highlighter.js' + ) + ); + + /** + * Extract values for common work + * @todo Extract common files + */ + $db = &$this->db; + $table = &$this->table; + $url_params = array(); + + /** + * Runs common work + */ + if (strlen($this->table) > 0) { + $url_params['goto'] = Util::getScriptNameForOption( + $this->cfg['DefaultTabTable'], 'table' + ); + $url_params['back'] = 'tbl_sql.php'; + include 'libraries/tbl_common.inc.php'; + $GLOBALS['dbi']->selectDb($GLOBALS['db']); + } elseif (strlen($this->db) > 0) { + $url_params['goto'] = Util::getScriptNameForOption( + $this->cfg['DefaultTabDatabase'], 'database' + ); + $url_params['back'] = 'sql.php'; + include 'libraries/db_common.inc.php'; + } else { + $url_params['goto'] = Util::getScriptNameForOption( + $this->cfg['DefaultTabServer'], 'server' + ); + $url_params['back'] = 'sql.php'; + include 'libraries/server_common.inc.php'; + } + + $data = array(); + + $result = $this->dbi->tryQuery($this->sql_query); + $fields_meta = $this->dbi->getFieldsMeta($result); + while ($row = $this->dbi->fetchAssoc($result)) { + $data[] = $row; + } + + $keys = array_keys($data[0]); + + $numeric_types = array('int', 'real'); + $numeric_column_count = 0; + foreach ($keys as $idx => $key) { + if (in_array($fields_meta[$idx]->type, $numeric_types)) { + $numeric_column_count++; + } + } + + if ($numeric_column_count == 0) { + $this->response->setRequestStatus(false); + $this->response->addJSON( + 'message', + __('No numeric columns present in the table to plot.') + ); + return; + } + + $url_params['db'] = $this->db; + $url_params['reload'] = 1; + + /** + * Displays the page + */ + $this->response->addHTML( + Template::get('table/chart/tbl_chart')->render( + array( + 'url_query' => $this->url_query, + 'url_params' => $url_params, + 'keys' => $keys, + 'fields_meta' => $fields_meta, + 'numeric_types' => $numeric_types, + 'numeric_column_count' => $numeric_column_count, + 'sql_query' => $this->sql_query + ) + ) + ); + } + + /** + * Handle ajax request + * + * @return void + */ + public function ajaxAction() + { + /** + * Extract values for common work + * @todo Extract common files + */ + $db = &$this->db; + $table = &$this->table; + + if (strlen($this->table) > 0 && strlen($this->db) > 0) { + include './libraries/tbl_common.inc.php'; + } + + $parser = new Parser($this->sql_query); + $statement = $parser->statements[0]; + if (empty($statement->limit)) { + $statement->limit = new Limit( + $_REQUEST['session_max_rows'], $_REQUEST['pos'] + ); + } else { + $start = $statement->limit->offset + $_REQUEST['pos']; + $rows = min( + $_REQUEST['session_max_rows'], + $statement->limit->rowCount - $_REQUEST['pos'] + ); + $statement->limit = new Limit($rows, $start); + } + $sql_with_limit = $statement->build(); + + $data = array(); + $result = $this->dbi->tryQuery($sql_with_limit); + while ($row = $this->dbi->fetchAssoc($result)) { + $data[] = $row; + } + + if (empty($data)) { + $this->response->setRequestStatus(false); + $this->response->addJSON('message', __('No data to display')); + return; + } + $sanitized_data = array(); + + foreach ($data as $data_row_number => $data_row) { + $tmp_row = array(); + foreach ($data_row as $data_column => $data_value) { + $tmp_row[htmlspecialchars($data_column)] = htmlspecialchars( + $data_value + ); + } + $sanitized_data[] = $tmp_row; + } + $this->response->setRequestStatus(true); + $this->response->addJSON('message', null); + $this->response->addJSON('chartData', json_encode($sanitized_data)); + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Table/TableGisVisualizationController.php b/phpMyAdmin/libraries/classes/Controllers/Table/TableGisVisualizationController.php new file mode 100755 index 0000000..b0d6d9b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Table/TableGisVisualizationController.php @@ -0,0 +1,222 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Table\TableIndexesController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers\Table; + +use PhpMyAdmin\Controllers\TableController; +use PhpMyAdmin\Core; +use PhpMyAdmin\Gis\GisVisualization; +use PhpMyAdmin\Message; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; + +require_once 'libraries/common.inc.php'; +require_once 'libraries/db_common.inc.php'; + +/** + * Class TableGisVisualizationController + * + * @package PhpMyAdmin\Controllers + */ +class TableGisVisualizationController extends TableController +{ + + /** + * @var array $url_params + */ + protected $url_params; + + /** + * @var string $sql_query + */ + protected $sql_query; + + /** + * @var array $visualizationSettings + */ + protected $visualizationSettings; + + /** + * @var \PhpMyAdmin\Gis\GisVisualization $visualization + */ + protected $visualization; + + /** + * Constructor + * + * @param string $sql_query SQL query for retrieving GIS data + * @param array $url_params array of URL parameters + * @param string $goto goto script + * @param string $back back script + * @param array $visualizationSettings visualization settings + */ + public function __construct( + $response, + $dbi, + $db, + $table, + $sql_query, + array $url_params, + $goto, + $back, + array $visualizationSettings + ) { + parent::__construct($response, $dbi, $db, $table); + + $this->sql_query = $sql_query; + $this->url_params = $url_params; + $this->url_params['goto'] = $goto; + $this->url_params['back'] = $back; + $this->visualizationSettings = $visualizationSettings; + } + + /** + * Save to file + * + * @return void + */ + public function saveToFileAction() + { + $this->response->disable(); + $file_name = $this->visualizationSettings['spatialColumn']; + $save_format = $_GET['fileFormat']; + $this->visualization->toFile($file_name, $save_format); + } + + /** + * Index + * + * @return void + */ + public function indexAction() + { + // Throw error if no sql query is set + if (! isset($this->sql_query) || $this->sql_query == '') { + $this->response->setRequestStatus(false); + $this->response->addHTML( + Message::error(__('No SQL query was set to fetch data.')) + ); + return; + } + + // Execute the query and return the result + $result = $this->dbi->tryQuery($this->sql_query); + // Get the meta data of results + $meta = $this->dbi->getFieldsMeta($result); + + // Find the candidate fields for label column and spatial column + $labelCandidates = array(); + $spatialCandidates = array(); + foreach ($meta as $column_meta) { + if ($column_meta->type == 'geometry') { + $spatialCandidates[] = $column_meta->name; + } else { + $labelCandidates[] = $column_meta->name; + } + } + + // Get settings if any posted + if (Core::isValid($_POST['visualizationSettings'], 'array')) { + $this->visualizationSettings = $_POST['visualizationSettings']; + } + + // Check mysql version + $this->visualizationSettings['mysqlVersion'] = $this->dbi->getVersion(); + + if (!isset($this->visualizationSettings['labelColumn']) + && isset($labelCandidates[0]) + ) { + $this->visualizationSettings['labelColumn'] = ''; + } + + // If spatial column is not set, use first geometric column as spatial column + if (! isset($this->visualizationSettings['spatialColumn'])) { + $this->visualizationSettings['spatialColumn'] = $spatialCandidates[0]; + } + + // Convert geometric columns from bytes to text. + $pos = isset($_GET['pos']) ? $_GET['pos'] + : $_SESSION['tmpval']['pos']; + if (isset($_GET['session_max_rows'])) { + $rows = $_GET['session_max_rows']; + } else { + if ($_SESSION['tmpval']['max_rows'] != 'all') { + $rows = $_SESSION['tmpval']['max_rows']; + } else { + $rows = $GLOBALS['cfg']['MaxRows']; + } + } + $this->visualization = GisVisualization::get( + $this->sql_query, + $this->visualizationSettings, + $rows, + $pos + ); + + if (isset($_GET['saveToFile'])) { + $this->saveToFileAction(); + return; + } + + $this->response->getHeader()->getScripts()->addFiles( + array( + 'vendor/openlayers/OpenLayers.js', + 'vendor/jquery/jquery.svg.js', + 'tbl_gis_visualization.js', + ) + ); + + // If all the rows contain SRID, use OpenStreetMaps on the initial loading. + if (! isset($_POST['displayVisualization'])) { + if ($this->visualization->hasSrid()) { + $this->visualizationSettings['choice'] = 'useBaseLayer'; + } else { + unset($this->visualizationSettings['choice']); + } + } + + $this->visualization->setUserSpecifiedSettings($this->visualizationSettings); + if ($this->visualizationSettings != null) { + foreach ($this->visualization->getSettings() as $setting => $val) { + if (! isset($this->visualizationSettings[$setting])) { + $this->visualizationSettings[$setting] = $val; + } + } + } + + /** + * Displays the page + */ + $this->url_params['sql_query'] = $this->sql_query; + $downloadUrl = 'tbl_gis_visualization.php' . Url::getCommon( + array_merge( + $this->url_params, + array( + 'sql_signature' => Core::signSqlQuery($this->sql_query), + 'saveToFile' => true, + 'session_max_rows' => $rows, + 'pos' => $pos + ) + ) + ); + $html = Template::get('table/gis_visualization/gis_visualization')->render( + array( + 'url_params' => $this->url_params, + 'download_url' => $downloadUrl, + 'label_candidates' => $labelCandidates, + 'spatial_candidates' => $spatialCandidates, + 'visualization_settings' => $this->visualizationSettings, + 'sql_query' => $this->sql_query, + 'visualization' => $this->visualization->toImage('svg'), + 'draw_ol' => $this->visualization->asOl(), + 'pma_theme_image' => $GLOBALS['pmaThemeImage'] + ) + ); + + $this->response->addHTML($html); + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Table/TableIndexesController.php b/phpMyAdmin/libraries/classes/Controllers/Table/TableIndexesController.php new file mode 100755 index 0000000..080d292 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Table/TableIndexesController.php @@ -0,0 +1,177 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Table\TableIndexesController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers\Table; + +use PhpMyAdmin\Controllers\TableController; +use PhpMyAdmin\Index; +use PhpMyAdmin\Message; +use PhpMyAdmin\Response; +use PhpMyAdmin\Template; +use PhpMyAdmin\Util; + +/** + * Class TableIndexesController + * + * @package PhpMyAdmin\Controllers + */ +class TableIndexesController extends TableController +{ + /** + * @var Index $index + */ + protected $index; + + /** + * Constructor + * + * @param Index $index Index + */ + public function __construct( + $response, + $dbi, + $db, + $table, + $index + ) { + parent::__construct($response, $dbi, $db, $table); + + $this->index = $index; + } + + /** + * Index + * + * @return void + */ + public function indexAction() + { + if (isset($_POST['do_save_data'])) { + $this->doSaveDataAction(); + return; + } // end builds the new index + + $this->displayFormAction(); + } + + /** + * Display the form to edit/create an index + * + * @return void + */ + public function displayFormAction() + { + $GLOBALS['dbi']->selectDb($GLOBALS['db']); + $add_fields = 0; + if (isset($_POST['index']) && is_array($_POST['index'])) { + // coming already from form + if (isset($_POST['index']['columns']['names'])) { + $add_fields = count($_POST['index']['columns']['names']) + - $this->index->getColumnCount(); + } + if (isset($_POST['add_fields'])) { + $add_fields += $_POST['added_fields']; + } + } elseif (isset($_POST['create_index'])) { + $add_fields = $_POST['added_fields']; + } // end preparing form values + + // Get fields and stores their name/type + if (isset($_POST['create_edit_table'])) { + $fields = json_decode($_POST['columns'], true); + $index_params = array( + 'Non_unique' => ($_POST['index']['Index_choice'] == 'UNIQUE') + ? '0' : '1', + ); + $this->index->set($index_params); + $add_fields = count($fields); + } else { + $fields = $this->dbi->getTable($this->db, $this->table) + ->getNameAndTypeOfTheColumns(); + } + + $form_params = array( + 'db' => $this->db, + 'table' => $this->table, + ); + + if (isset($_POST['create_index'])) { + $form_params['create_index'] = 1; + } elseif (isset($_POST['old_index'])) { + $form_params['old_index'] = $_POST['old_index']; + } elseif (isset($_POST['index'])) { + $form_params['old_index'] = $_POST['index']; + } + + $this->response->getHeader()->getScripts()->addFile('indexes.js'); + + $this->response->addHTML( + Template::get('table/index_form')->render( + array( + 'fields' => $fields, + 'index' => $this->index, + 'form_params' => $form_params, + 'add_fields' => $add_fields, + 'create_edit_table' => isset($_POST['create_edit_table']) + ) + ) + ); + } + + /** + * Process the data from the edit/create index form, + * run the query to build the new index + * and moves back to "tbl_sql.php" + * + * @return void + */ + public function doSaveDataAction() + { + $error = false; + + $sql_query = $this->dbi->getTable($this->db, $this->table) + ->getSqlQueryForIndexCreateOrEdit($this->index, $error); + + // If there is a request for SQL previewing. + if (isset($_POST['preview_sql'])) { + + $this->response->addJSON( + 'sql_data', + Template::get('preview_sql') + ->render( + array( + 'query_data' => $sql_query + ) + ) + ); + } elseif (!$error) { + + $this->dbi->query($sql_query); + $response = Response::getInstance(); + if ($response->isAjax()) { + $message = Message::success( + __('Table %1$s has been altered successfully.') + ); + $message->addParam($this->table); + $this->response->addJSON( + 'message', Util::getMessage($message, $sql_query, 'success') + ); + $this->response->addJSON( + 'index_table', + Index::getHtmlForIndexes( + $this->table, $this->db + ) + ); + } else { + include 'tbl_structure.php'; + } + } else { + $this->response->setRequestStatus(false); + $this->response->addJSON('message', $error); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Table/TableRelationController.php b/phpMyAdmin/libraries/classes/Controllers/Table/TableRelationController.php new file mode 100755 index 0000000..de7ff78 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Table/TableRelationController.php @@ -0,0 +1,390 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Table\TableRelationController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers\Table; + +use PhpMyAdmin\Controllers\TableController; +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Index; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Table; +use PhpMyAdmin\Template; +use PhpMyAdmin\Util; + +/** + * Handles table relation logic + * + * @package PhpMyAdmin\Controllers + */ +class TableRelationController extends TableController +{ + /** + * @var array $options_array + */ + protected $options_array; + + /** + * @var array $cfgRelation + */ + protected $cfgRelation; + + /** + * @var array $existrel + */ + protected $existrel; + + /** + * @var string $tbl_storage_engine + */ + protected $tbl_storage_engine; + + /** + * @var array $existrel_foreign + */ + protected $existrel_foreign; + + /** + * @var Table $udp_query + */ + protected $upd_query; + + /** + * @var Relation $relation + */ + private $relation; + + /** + * Constructor + * + * @param array|null $options_array Options + * @param array|null $cfgRelation Config relation + * @param string $tbl_storage_engine Table storage engine + * @param array|null $existrel Relations + * @param array|null $existrel_foreign External relations + * @param string $upd_query Update query + */ + public function __construct( + $response, + $dbi, + $db, + $table, + $options_array, + $cfgRelation, + $tbl_storage_engine, + $existrel, + $existrel_foreign, + $upd_query + ) { + parent::__construct($response, $dbi, $db, $table); + + $this->options_array = $options_array; + $this->cfgRelation = $cfgRelation; + $this->tbl_storage_engine = $tbl_storage_engine; + $this->existrel = $existrel; + $this->existrel_foreign = $existrel_foreign; + $this->upd_query = $upd_query; + $this->relation = new Relation(); + } + + /** + * Index + * + * @return void + */ + public function indexAction() + { + // Send table of column names to populate corresponding dropdowns depending + // on the current selection + if (isset($_POST['getDropdownValues']) + && $_POST['getDropdownValues'] === 'true' + ) { + // if both db and table are selected + if (isset($_POST['foreignTable'])) { + $this->getDropdownValueForTableAction(); + } else { // if only the db is selected + $this->getDropdownValueForDbAction(); + } + return; + } + + $this->response->getHeader()->getScripts()->addFiles( + array( + 'tbl_relation.js', + 'indexes.js' + ) + ); + + // Set the database + $this->dbi->selectDb($this->db); + + // updates for Internal relations + if (isset($_POST['destination_db']) && $this->cfgRelation['relwork']) { + $this->updateForInternalRelationAction(); + } + + // updates for foreign keys + $this->updateForForeignKeysAction(); + + // Updates for display field + if ($this->cfgRelation['displaywork'] && isset($_POST['display_field'])) { + $this->updateForDisplayField(); + } + + // If we did an update, refresh our data + if (isset($_POST['destination_db']) && $this->cfgRelation['relwork']) { + $this->existrel = $this->relation->getForeigners( + $this->db, $this->table, '', 'internal' + ); + } + if (isset($_POST['destination_foreign_db']) + && Util::isForeignKeySupported($this->tbl_storage_engine) + ) { + $this->existrel_foreign = $this->relation->getForeigners( + $this->db, $this->table, '', 'foreign' + ); + } + + // display secondary level tabs if necessary + $engine = $this->dbi->getTable($this->db, $this->table)->getStorageEngine(); + + $this->response->addHTML( + Template::get('table/secondary_tabs')->render( + array( + 'url_params' => array( + 'db' => $GLOBALS['db'], + 'table' => $GLOBALS['table'] + ), + 'is_foreign_key_supported' => Util::isForeignKeySupported($engine), + 'cfg_relation' => $this->relation->getRelationsParam(), + ) + ) + ); + $this->response->addHTML('<div id="structure_content">'); + + /** + * Dialog + */ + // Now find out the columns of our $table + // need to use DatabaseInterface::QUERY_STORE with $this->dbi->numRows() + // in mysqli + $columns = $this->dbi->getColumns($this->db, $this->table); + + $column_array = array(); + $column_array[''] = ''; + foreach ($columns as $column) { + if (strtoupper($this->tbl_storage_engine) == 'INNODB' + || ! empty($column['Key']) + ) { + $column_array[$column['Field']] = $column['Field']; + } + } + if ($GLOBALS['cfg']['NaturalOrder']) { + uksort($column_array, 'strnatcasecmp'); + } + + // common form + $this->response->addHTML( + Template::get('table/relation/common_form')->render([ + 'db' => $this->db, + 'table' => $this->table, + 'cfg_relation' => $this->cfgRelation, + 'tbl_storage_engine' => $this->tbl_storage_engine, + 'existrel' => isset($this->existrel) ? $this->existrel : array(), + 'existrel_foreign' => is_array($this->existrel_foreign) && array_key_exists('foreign_keys_data', $this->existrel_foreign) + ? $this->existrel_foreign['foreign_keys_data'] : array(), + 'options_array' => $this->options_array, + 'column_array' => $column_array, + 'save_row' => array_values($columns), + 'url_params' => $GLOBALS['url_params'], + 'databases' => $GLOBALS['dblist']->databases, + 'dbi' => $GLOBALS['dbi'], + ]) + ); + + if (Util::isForeignKeySupported($this->tbl_storage_engine)) { + $this->response->addHTML(Index::getHtmlForDisplayIndexes()); + } + $this->response->addHTML('</div>'); + } + + /** + * Update for display field + * + * @return void + */ + public function updateForDisplayField() + { + if ($this->upd_query->updateDisplayField( + $_POST['display_field'], $this->cfgRelation + ) + ) { + $this->response->addHTML( + Util::getMessage( + __('Display column was successfully updated.'), + '', 'success' + ) + ); + } + } + + /** + * Update for FK + * + * @return void + */ + public function updateForForeignKeysAction() + { + $multi_edit_columns_name = isset($_POST['foreign_key_fields_name']) + ? $_POST['foreign_key_fields_name'] + : null; + $preview_sql_data = ''; + $seen_error = false; + + // (for now, one index name only; we keep the definitions if the + // foreign db is not the same) + if (isset($_POST['destination_foreign_db']) + && isset($_POST['destination_foreign_table']) + && isset($_POST['destination_foreign_column'])) { + list($html, $preview_sql_data, $display_query, $seen_error) + = $this->upd_query->updateForeignKeys( + $_POST['destination_foreign_db'], + $multi_edit_columns_name, $_POST['destination_foreign_table'], + $_POST['destination_foreign_column'], $this->options_array, + $this->table, + is_array($this->existrel_foreign) && array_key_exists('foreign_keys_data', $this->existrel_foreign) + ? $this->existrel_foreign['foreign_keys_data'] + : [] + ); + $this->response->addHTML($html); + } + + // If there is a request for SQL previewing. + if (isset($_POST['preview_sql'])) { + Core::previewSQL($preview_sql_data); + } + + if (!empty($display_query) && !$seen_error) { + $GLOBALS['display_query'] = $display_query; + $this->response->addHTML( + Util::getMessage( + __('Your SQL query has been executed successfully.'), + null, 'success' + ) + ); + } + } + + /** + * Update for internal relation + * + * @return void + */ + public function updateForInternalRelationAction() + { + $multi_edit_columns_name = isset($_POST['fields_name']) + ? $_POST['fields_name'] + : null; + + if ($this->upd_query->updateInternalRelations( + $multi_edit_columns_name, + $_POST['destination_db'], + $_POST['destination_table'], + $_POST['destination_column'], + $this->cfgRelation, + isset($this->existrel) ? $this->existrel : null + ) + ) { + $this->response->addHTML( + Util::getMessage( + __('Internal relationships were successfully updated.'), + '', 'success' + ) + ); + } + } + + /** + * Send table columns for foreign table dropdown + * + * @return void + * + */ + public function getDropdownValueForTableAction() + { + $foreignTable = $_POST['foreignTable']; + $table_obj = $this->dbi->getTable($_POST['foreignDb'], $foreignTable); + // Since views do not have keys defined on them provide the full list of + // columns + if ($table_obj->isView()) { + $columnList = $table_obj->getColumns(false, false); + } else { + $columnList = $table_obj->getIndexedColumns(false, false); + } + $columns = array(); + foreach ($columnList as $column) { + $columns[] = htmlspecialchars($column); + } + if ($GLOBALS['cfg']['NaturalOrder']) { + usort($columns, 'strnatcasecmp'); + } + $this->response->addJSON('columns', $columns); + + // @todo should be: $server->db($db)->table($table)->primary() + $primary = Index::getPrimary($foreignTable, $_POST['foreignDb']); + if (false === $primary) { + return; + } + + $this->response->addJSON('primary', array_keys($primary->getColumns())); + } + + /** + * Send database selection values for dropdown + * + * @return void + * + */ + public function getDropdownValueForDbAction() + { + $tables = array(); + $foreign = isset($_POST['foreign']) && $_POST['foreign'] === 'true'; + + if ($foreign) { + $query = 'SHOW TABLE STATUS FROM ' + . Util::backquote($_POST['foreignDb']); + $tables_rs = $this->dbi->query( + $query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + + while ($row = $this->dbi->fetchArray($tables_rs)) { + if (isset($row['Engine']) + && mb_strtoupper($row['Engine']) == $this->tbl_storage_engine + ) { + $tables[] = htmlspecialchars($row['Name']); + } + } + } else { + $query = 'SHOW TABLES FROM ' + . Util::backquote($_POST['foreignDb']); + $tables_rs = $this->dbi->query( + $query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + while ($row = $this->dbi->fetchArray($tables_rs)) { + $tables[] = htmlspecialchars($row[0]); + } + } + if ($GLOBALS['cfg']['NaturalOrder']) { + usort($tables, 'strnatcasecmp'); + } + $this->response->addJSON('tables', $tables); + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Table/TableSearchController.php b/phpMyAdmin/libraries/classes/Controllers/Table/TableSearchController.php new file mode 100755 index 0000000..e9f1e48 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Table/TableSearchController.php @@ -0,0 +1,1173 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Table\TableSearchController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers\Table; + +use PhpMyAdmin\Controllers\TableController; +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Sql; +use PhpMyAdmin\Template; +use PhpMyAdmin\Util; + +/** + * Class TableSearchController + * + * @package PhpMyAdmin\Controllers + */ +class TableSearchController extends TableController +{ + /** + * Normal search or Zoom search + * + * @access private + * @var string + */ + private $_searchType; + /** + * Names of columns + * + * @access private + * @var array + */ + private $_columnNames; + /** + * Types of columns + * + * @access private + * @var array + */ + private $_columnTypes; + /** + * Collations of columns + * + * @access private + * @var array + */ + private $_columnCollations; + /** + * Null Flags of columns + * + * @access private + * @var array + */ + private $_columnNullFlags; + /** + * Whether a geometry column is present + * + * @access private + * @var boolean + */ + private $_geomColumnFlag; + /** + * Foreign Keys + * + * @access private + * @var array + */ + private $_foreigners; + /** + * Connection charset + * + * @access private + * @var string + */ + private $_connectionCharSet; + + protected $url_query; + + /** + * @var Relation $relation + */ + private $relation; + + /** + * Constructor + * + * @param string $searchType Search type + * @param string $url_query URL query + */ + public function __construct( + $response, + $dbi, + $db, + $table, + $searchType, + $url_query + ) { + parent::__construct($response, $dbi, $db, $table); + + $this->url_query = $url_query; + $this->_searchType = $searchType; + $this->_columnNames = array(); + $this->_columnNullFlags = array(); + $this->_columnTypes = array(); + $this->_columnCollations = array(); + $this->_geomColumnFlag = false; + $this->_foreigners = array(); + $this->relation = new Relation(); + // Loads table's information + $this->_loadTableInfo(); + $this->_connectionCharSet = $this->dbi->fetchValue( + "SELECT @@character_set_connection" + ); + } + + /** + * Gets all the columns of a table along with their types, collations + * and whether null or not. + * + * @return void + */ + private function _loadTableInfo() + { + // Gets the list and number of columns + $columns = $this->dbi->getColumns( + $this->db, $this->table, null, true + ); + // Get details about the geometry functions + $geom_types = Util::getGISDatatypes(); + + foreach ($columns as $row) { + // set column name + $this->_columnNames[] = $row['Field']; + + $type = $row['Type']; + // check whether table contains geometric columns + if (in_array($type, $geom_types)) { + $this->_geomColumnFlag = true; + } + // reformat mysql query output + if (strncasecmp($type, 'set', 3) == 0 + || strncasecmp($type, 'enum', 4) == 0 + ) { + $type = str_replace(',', ', ', $type); + } else { + // strip the "BINARY" attribute, except if we find "BINARY(" because + // this would be a BINARY or VARBINARY column type + if (! preg_match('@BINARY[\(]@i', $type)) { + $type = preg_replace('@BINARY@i', '', $type); + } + $type = preg_replace('@ZEROFILL@i', '', $type); + $type = preg_replace('@UNSIGNED@i', '', $type); + $type = mb_strtolower($type); + } + if (empty($type)) { + $type = ' '; + } + $this->_columnTypes[] = $type; + $this->_columnNullFlags[] = $row['Null']; + $this->_columnCollations[] + = ! empty($row['Collation']) && $row['Collation'] != 'NULL' + ? $row['Collation'] + : ''; + } // end for + + // Retrieve foreign keys + $this->_foreigners = $this->relation->getForeigners($this->db, $this->table); + } + + /** + * Index action + * + * @return void + */ + public function indexAction() + { + switch ($this->_searchType) { + case 'replace': + if (isset($_POST['find'])) { + $this->findAction(); + + return; + } + $this->response + ->getHeader() + ->getScripts() + ->addFile('tbl_find_replace.js'); + + if (isset($_POST['replace'])) { + $this->replaceAction(); + } + + // Displays the find and replace form + $this->displaySelectionFormAction(); + break; + + case 'normal': + $this->response->getHeader() + ->getScripts() + ->addFiles( + array( + 'makegrid.js', + 'sql.js', + 'tbl_select.js', + 'tbl_change.js', + 'vendor/jquery/jquery.uitablefilter.js', + 'gis_data_editor.js', + ) + ); + + if (isset($_POST['range_search'])) { + $this->rangeSearchAction(); + + return; + } + + /** + * No selection criteria received -> display the selection form + */ + if (!isset($_POST['columnsToDisplay']) + && !isset($_POST['displayAllColumns']) + ) { + $this->displaySelectionFormAction(); + } else { + $this->doSelectionAction(); + } + break; + + case 'zoom': + $this->response->getHeader() + ->getScripts() + ->addFiles( + array( + 'makegrid.js', + 'sql.js', + 'vendor/jqplot/jquery.jqplot.js', + 'vendor/jqplot/plugins/jqplot.canvasTextRenderer.js', + 'vendor/jqplot/plugins/jqplot.canvasAxisLabelRenderer.js', + 'vendor/jqplot/plugins/jqplot.dateAxisRenderer.js', + 'vendor/jqplot/plugins/jqplot.highlighter.js', + 'vendor/jqplot/plugins/jqplot.cursor.js', + 'tbl_zoom_plot_jqplot.js', + 'tbl_change.js', + ) + ); + + /** + * Handle AJAX request for data row on point select + * + * @var boolean Object containing parameters for the POST request + */ + if (isset($_POST['get_data_row']) + && $_POST['get_data_row'] == true + ) { + $this->getDataRowAction(); + + return; + } + /** + * Handle AJAX request for changing field information + * (value,collation,operators,field values) in input form + * + * @var boolean Object containing parameters for the POST request + */ + if (isset($_POST['change_tbl_info']) + && $_POST['change_tbl_info'] == true + ) { + $this->changeTableInfoAction(); + + return; + } + + //Set default datalabel if not selected + if (!isset($_POST['zoom_submit']) || $_POST['dataLabel'] == '') { + $dataLabel = $this->relation->getDisplayField($this->db, $this->table); + } else { + $dataLabel = $_POST['dataLabel']; + } + + // Displays the zoom search form + $this->displaySelectionFormAction($dataLabel); + + /* + * Handle the input criteria and generate the query result + * Form for displaying query results + */ + if (isset($_POST['zoom_submit']) + && $_POST['criteriaColumnNames'][0] != 'pma_null' + && $_POST['criteriaColumnNames'][1] != 'pma_null' + && $_POST['criteriaColumnNames'][0] != $_POST['criteriaColumnNames'][1] + ) { + if (! isset($goto)) { + $goto = Util::getScriptNameForOption( + $GLOBALS['cfg']['DefaultTabTable'], 'table' + ); + } + $this->zoomSubmitAction($dataLabel, $goto); + } + break; + } + } + + /** + * Zoom submit action + * + * @param string $dataLabel Data label + * @param string $goto Goto + * + * @return void + */ + public function zoomSubmitAction($dataLabel, $goto) + { + //Query generation part + $sql_query = $this->_buildSqlQuery(); + $sql_query .= ' LIMIT ' . $_POST['maxPlotLimit']; + + //Query execution part + $result = $this->dbi->query( + $sql_query . ";", + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + $fields_meta = $this->dbi->getFieldsMeta($result); + $data = array(); + while ($row = $this->dbi->fetchAssoc($result)) { + //Need a row with indexes as 0,1,2 for the getUniqueCondition + // hence using a temporary array + $tmpRow = array(); + foreach ($row as $val) { + $tmpRow[] = $val; + } + //Get unique condition on each row (will be needed for row update) + $uniqueCondition = Util::getUniqueCondition( + $result, // handle + count($this->_columnNames), // fields_cnt + $fields_meta, // fields_meta + $tmpRow, // row + true, // force_unique + false, // restrict_to_table + null // analyzed_sql_results + ); + //Append it to row array as where_clause + $row['where_clause'] = $uniqueCondition[0]; + $row['where_clause_sign'] = Core::signSqlQuery($uniqueCondition[0]); + + $tmpData = array( + $_POST['criteriaColumnNames'][0] => + $row[$_POST['criteriaColumnNames'][0]], + $_POST['criteriaColumnNames'][1] => + $row[$_POST['criteriaColumnNames'][1]], + 'where_clause' => $uniqueCondition[0], + 'where_clause_sign' => Core::signSqlQuery($uniqueCondition[0]) + ); + $tmpData[$dataLabel] = ($dataLabel) ? $row[$dataLabel] : ''; + $data[] = $tmpData; + } + unset($tmpData); + + //Displays form for point data and scatter plot + $titles = array( + 'Browse' => Util::getIcon( + 'b_browse', + __('Browse foreign values') + ) + ); + $this->response->addHTML( + Template::get('table/search/zoom_result_form')->render([ + 'db' => $this->db, + 'table' => $this->table, + 'column_names' => $this->_columnNames, + 'foreigners' => $this->_foreigners, + 'column_null_flags' => $this->_columnNullFlags, + 'column_types' => $this->_columnTypes, + 'titles' => $titles, + 'goto' => $goto, + 'data' => $data, + 'data_json' => json_encode($data), + 'zoom_submit' => isset($_POST['zoom_submit']), + 'foreign_max_limit' => $GLOBALS['cfg']['ForeignKeyMaxLimit'], + ]) + ); + } + + /** + * Change table info action + * + * @return void + */ + public function changeTableInfoAction() + { + $field = $_POST['field']; + if ($field == 'pma_null') { + $this->response->addJSON('field_type', ''); + $this->response->addJSON('field_collation', ''); + $this->response->addJSON('field_operators', ''); + $this->response->addJSON('field_value', ''); + return; + } + $key = array_search($field, $this->_columnNames); + $search_index + = ((isset($_POST['it']) && is_numeric($_POST['it'])) + ? intval($_POST['it']) : 0); + + $properties = $this->getColumnProperties($search_index, $key); + $this->response->addJSON( + 'field_type', htmlspecialchars($properties['type']) + ); + $this->response->addJSON('field_collation', $properties['collation']); + $this->response->addJSON('field_operators', $properties['func']); + $this->response->addJSON('field_value', $properties['value']); + } + + /** + * Get data row action + * + * @return void + */ + public function getDataRowAction() + { + if (! Core::checkSqlQuerySignature($_POST['where_clause'], $_POST['where_clause_sign'])) { + return; + } + + $extra_data = array(); + $row_info_query = 'SELECT * FROM ' . Util::backquote($_POST['db']) . '.' + . Util::backquote($_POST['table']) . ' WHERE ' . $_POST['where_clause']; + $result = $this->dbi->query( + $row_info_query . ";", + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + $fields_meta = $this->dbi->getFieldsMeta($result); + while ($row = $this->dbi->fetchAssoc($result)) { + // for bit fields we need to convert them to printable form + $i = 0; + foreach ($row as $col => $val) { + if ($fields_meta[$i]->type == 'bit') { + $row[$col] = Util::printableBitValue( + $val, $fields_meta[$i]->length + ); + } + $i++; + } + $extra_data['row_info'] = $row; + } + $this->response->addJSON($extra_data); + } + + /** + * Do selection action + * + * @return void + */ + public function doSelectionAction() + { + /** + * Selection criteria have been submitted -> do the work + */ + $sql_query = $this->_buildSqlQuery(); + + /** + * Add this to ensure following procedures included running correctly. + */ + $db = $this->db; + + $sql = new Sql(); + $sql->executeQueryAndSendQueryResponse( + null, // analyzed_sql_results + false, // is_gotofile + $this->db, // db + $this->table, // table + null, // find_real_end + null, // sql_query_for_bookmark + null, // extra_data + null, // message_to_show + null, // message + null, // sql_data + $GLOBALS['goto'], // goto + $GLOBALS['pmaThemeImage'], // pmaThemeImage + null, // disp_query + null, // disp_message + null, // query_type + $sql_query, // sql_query + null, // selectedTables + null // complete_query + ); + } + + /** + * Display selection form action + * + * @param string $dataLabel Data label + * + * @return void + */ + public function displaySelectionFormAction($dataLabel = null) + { + $this->url_query .= '&goto=tbl_select.php&back=tbl_select.php'; + if (! isset($goto)) { + $goto = Util::getScriptNameForOption( + $GLOBALS['cfg']['DefaultTabTable'], 'table' + ); + } + // Displays the table search form + $this->response->addHTML( + Template::get('secondary_tabs') + ->render( + array( + 'url_params' => array( + 'db' => $this->db, + 'table' => $this->table, + ), + 'sub_tabs' => $this->_getSubTabs(), + ) + ) + ); + $this->response->addHTML( + Template::get('table/search/selection_form')->render(array( + 'search_type' => $this->_searchType, + 'db' => $this->db, + 'table' => $this->table, + 'goto' => $goto, + 'self' => $this, + 'geom_column_flag' => $this->_geomColumnFlag, + 'column_names' => $this->_columnNames, + 'column_types' => $this->_columnTypes, + 'column_collations' => $this->_columnCollations, + 'data_label' => $dataLabel, + 'criteria_column_names' => isset($_POST['criteriaColumnNames']) ? $_POST['criteriaColumnNames'] : null, + 'criteria_column_types' => isset($_POST['criteriaColumnTypes']) ? $_POST['criteriaColumnTypes'] : null, + 'sql_types' => $GLOBALS['dbi']->types, + 'max_rows' => intval($GLOBALS['cfg']['MaxRows']), + 'max_plot_limit' => ((! empty($_POST['maxPlotLimit'])) + ? intval($_POST['maxPlotLimit']) + : intval($GLOBALS['cfg']['maxRowPlotLimit'])), + )) + ); + } + + /** + * Range search action + * + * @return void + */ + public function rangeSearchAction() + { + $min_max = $this->getColumnMinMax($_POST['column']); + $this->response->addJSON('column_data', $min_max); + } + + /** + * Find action + * + * @return void + */ + public function findAction() + { + $useRegex = array_key_exists('useRegex', $_POST) + && $_POST['useRegex'] == 'on'; + + $preview = $this->getReplacePreview( + $_POST['columnIndex'], + $_POST['find'], + $_POST['replaceWith'], + $useRegex, + $this->_connectionCharSet + ); + $this->response->addJSON('preview', $preview); + } + + /** + * Replace action + * + * @return void + */ + public function replaceAction() + { + $this->replace( + $_POST['columnIndex'], + $_POST['findString'], + $_POST['replaceWith'], + $_POST['useRegex'], + $this->_connectionCharSet + ); + $this->response->addHTML( + Util::getMessage( + __('Your SQL query has been executed successfully.'), + null, 'success' + ) + ); + } + + /** + * Returns HTML for previewing strings found and their replacements + * + * @param int $columnIndex index of the column + * @param string $find string to find in the column + * @param string $replaceWith string to replace with + * @param boolean $useRegex to use Regex replace or not + * @param string $charSet character set of the connection + * + * @return string HTML for previewing strings found and their replacements + */ + function getReplacePreview( + $columnIndex, $find, $replaceWith, $useRegex, $charSet + ) { + $column = $this->_columnNames[$columnIndex]; + if ($useRegex) { + $result = $this->_getRegexReplaceRows( + $columnIndex, $find, $replaceWith, $charSet + ); + } else { + $sql_query = "SELECT " + . Util::backquote($column) . "," + . " REPLACE(" + . Util::backquote($column) . ", '" . $find . "', '" + . $replaceWith + . "')," + . " COUNT(*)" + . " FROM " . Util::backquote($this->db) + . "." . Util::backquote($this->table) + . " WHERE " . Util::backquote($column) + . " LIKE '%" . $find . "%' COLLATE " . $charSet . "_bin"; // here we + // change the collation of the 2nd operand to a case sensitive + // binary collation to make sure that the comparison + // is case sensitive + $sql_query .= " GROUP BY " . Util::backquote($column) + . " ORDER BY " . Util::backquote($column) . " ASC"; + + $result = $this->dbi->fetchResult($sql_query, 0); + } + + return Template::get('table/search/replace_preview')->render( + array( + 'db' => $this->db, + 'table' => $this->table, + 'column_index' => $columnIndex, + 'find' => $find, + 'replace_with' => $replaceWith, + 'use_regex' => $useRegex, + 'result' => $result + ) + ); + } + + /** + * Finds and returns Regex pattern and their replacements + * + * @param int $columnIndex index of the column + * @param string $find string to find in the column + * @param string $replaceWith string to replace with + * @param string $charSet character set of the connection + * + * @return array Array containing original values, replaced values and count + */ + private function _getRegexReplaceRows( + $columnIndex, $find, $replaceWith, $charSet + ) { + $column = $this->_columnNames[$columnIndex]; + $sql_query = "SELECT " + . Util::backquote($column) . "," + . " 1," // to add an extra column that will have replaced value + . " COUNT(*)" + . " FROM " . Util::backquote($this->db) + . "." . Util::backquote($this->table) + . " WHERE " . Util::backquote($column) + . " RLIKE '" . $GLOBALS['dbi']->escapeString($find) . "' COLLATE " + . $charSet . "_bin"; // here we + // change the collation of the 2nd operand to a case sensitive + // binary collation to make sure that the comparison is case sensitive + $sql_query .= " GROUP BY " . Util::backquote($column) + . " ORDER BY " . Util::backquote($column) . " ASC"; + + $result = $this->dbi->fetchResult($sql_query, 0); + + if (is_array($result)) { + /* Iterate over possible delimiters to get one */ + $delimiters = array('/', '@', '#', '~', '!', '$', '%', '^', '&', '_'); + $found = false; + for ($i = 0, $l = count($delimiters); $i < $l; $i++) { + if (strpos($find, $delimiters[$i]) === false) { + $found = true; + break; + } + } + if (! $found) { + return false; + } + $find = $delimiters[$i] . $find . $delimiters[$i]; + foreach ($result as $index=>$row) { + $result[$index][1] = preg_replace( + $find, + $replaceWith, + $row[0] + ); + } + } + return $result; + } + + /** + * Replaces a given string in a column with a give replacement + * + * @param int $columnIndex index of the column + * @param string $find string to find in the column + * @param string $replaceWith string to replace with + * @param boolean $useRegex to use Regex replace or not + * @param string $charSet character set of the connection + * + * @return void + */ + public function replace($columnIndex, $find, $replaceWith, $useRegex, + $charSet + ) { + $column = $this->_columnNames[$columnIndex]; + if ($useRegex) { + $toReplace = $this->_getRegexReplaceRows( + $columnIndex, $find, $replaceWith, $charSet + ); + $sql_query = "UPDATE " . Util::backquote($this->table) + . " SET " . Util::backquote($column) . " = CASE"; + if (is_array($toReplace)) { + foreach ($toReplace as $row) { + $sql_query .= "\n WHEN " . Util::backquote($column) + . " = '" . $GLOBALS['dbi']->escapeString($row[0]) + . "' THEN '" . $GLOBALS['dbi']->escapeString($row[1]) . "'"; + } + } + $sql_query .= " END" + . " WHERE " . Util::backquote($column) + . " RLIKE '" . $GLOBALS['dbi']->escapeString($find) . "' COLLATE " + . $charSet . "_bin"; // here we + // change the collation of the 2nd operand to a case sensitive + // binary collation to make sure that the comparison + // is case sensitive + } else { + $sql_query = "UPDATE " . Util::backquote($this->table) + . " SET " . Util::backquote($column) . " =" + . " REPLACE(" + . Util::backquote($column) . ", '" . $find . "', '" + . $replaceWith + . "')" + . " WHERE " . Util::backquote($column) + . " LIKE '%" . $find . "%' COLLATE " . $charSet . "_bin"; // here we + // change the collation of the 2nd operand to a case sensitive + // binary collation to make sure that the comparison + // is case sensitive + } + $this->dbi->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + $GLOBALS['sql_query'] = $sql_query; + } + + /** + * Finds minimum and maximum value of a given column. + * + * @param string $column Column name + * + * @return array + */ + public function getColumnMinMax($column) + { + $sql_query = 'SELECT MIN(' . Util::backquote($column) . ') AS `min`, ' + . 'MAX(' . Util::backquote($column) . ') AS `max` ' + . 'FROM ' . Util::backquote($this->db) . '.' + . Util::backquote($this->table); + + $result = $this->dbi->fetchSingleRow($sql_query); + + return $result; + } + + /** + * Returns an array with necessary configurations to create + * sub-tabs in the table_select page. + * + * @return array Array containing configuration (icon, text, link, id, args) + * of sub-tabs + */ + private function _getSubTabs() + { + $subtabs = array(); + $subtabs['search']['icon'] = 'b_search'; + $subtabs['search']['text'] = __('Table search'); + $subtabs['search']['link'] = 'tbl_select.php'; + $subtabs['search']['id'] = 'tbl_search_id'; + $subtabs['search']['args']['pos'] = 0; + + $subtabs['zoom']['icon'] = 'b_select'; + $subtabs['zoom']['link'] = 'tbl_zoom_select.php'; + $subtabs['zoom']['text'] = __('Zoom search'); + $subtabs['zoom']['id'] = 'zoom_search_id'; + + $subtabs['replace']['icon'] = 'b_find_replace'; + $subtabs['replace']['link'] = 'tbl_find_replace.php'; + $subtabs['replace']['text'] = __('Find and replace'); + $subtabs['replace']['id'] = 'find_replace_id'; + + return $subtabs; + } + + /** + * Builds the sql search query from the post parameters + * + * @return string the generated SQL query + */ + private function _buildSqlQuery() + { + $sql_query = 'SELECT '; + + // If only distinct values are needed + $is_distinct = (isset($_POST['distinct'])) ? 'true' : 'false'; + if ($is_distinct == 'true') { + $sql_query .= 'DISTINCT '; + } + + // if all column names were selected to display, we do a 'SELECT *' + // (more efficient and this helps prevent a problem in IE + // if one of the rows is edited and we come back to the Select results) + if (isset($_POST['zoom_submit']) || ! empty($_POST['displayAllColumns'])) { + $sql_query .= '* '; + } else { + $sql_query .= implode( + ', ', + Util::backquote($_POST['columnsToDisplay']) + ); + } // end if + + $sql_query .= ' FROM ' + . Util::backquote($_POST['table']); + $whereClause = $this->_generateWhereClause(); + $sql_query .= $whereClause; + + // if the search results are to be ordered + if (isset($_POST['orderByColumn']) && $_POST['orderByColumn'] != '--nil--') { + $sql_query .= ' ORDER BY ' + . Util::backquote($_POST['orderByColumn']) + . ' ' . $_POST['order']; + } // end if + return $sql_query; + } + + /** + * Provides a column's type, collation, operators list, and criteria value + * to display in table search form + * + * @param integer $search_index Row number in table search form + * @param integer $column_index Column index in ColumnNames array + * + * @return array Array containing column's properties + */ + public function getColumnProperties($search_index, $column_index) + { + $selected_operator = (isset($_POST['criteriaColumnOperators'][$search_index]) + ? $_POST['criteriaColumnOperators'][$search_index] : ''); + $entered_value = (isset($_POST['criteriaValues']) + ? $_POST['criteriaValues'] : ''); + $titles = array( + 'Browse' => Util::getIcon( + 'b_browse', __('Browse foreign values') + ) + ); + //Gets column's type and collation + $type = $this->_columnTypes[$column_index]; + $collation = $this->_columnCollations[$column_index]; + //Gets column's comparison operators depending on column type + $typeOperators = $GLOBALS['dbi']->types->getTypeOperatorsHtml( + preg_replace('@\(.*@s', '', $this->_columnTypes[$column_index]), + $this->_columnNullFlags[$column_index], $selected_operator + ); + $func = Template::get('table/search/column_comparison_operators')->render( + array( + 'search_index' => $search_index, + 'type_operators' => $typeOperators + ) + ); + //Gets link to browse foreign data(if any) and criteria inputbox + $foreignData = $this->relation->getForeignData( + $this->_foreigners, $this->_columnNames[$column_index], false, '', '' + ); + $value = Template::get('table/search/input_box')->render( + array( + 'str' => '', + 'column_type' => (string) $type, + 'column_id' => 'fieldID_', + 'in_zoom_search_edit' => false, + 'foreigners' => $this->_foreigners, + 'column_name' => $this->_columnNames[$column_index], + 'column_name_hash' => md5($this->_columnNames[$column_index]), + 'foreign_data' => $foreignData, + 'table' => $this->table, + 'column_index' => $search_index, + 'foreign_max_limit' => $GLOBALS['cfg']['ForeignKeyMaxLimit'], + 'criteria_values' => $entered_value, + 'db' => $this->db, + 'titles' => $titles, + 'in_fbs' => true + ) + ); + return array( + 'type' => $type, + 'collation' => $collation, + 'func' => $func, + 'value' => $value + ); + } + + /** + * Generates the where clause for the SQL search query to be executed + * + * @return string the generated where clause + */ + private function _generateWhereClause() + { + if (isset($_POST['customWhereClause']) + && trim($_POST['customWhereClause']) != '' + ) { + return ' WHERE ' . $_POST['customWhereClause']; + } + + // If there are no search criteria set or no unary criteria operators, + // return + if (! isset($_POST['criteriaValues']) + && ! isset($_POST['criteriaColumnOperators']) + && ! isset($_POST['geom_func']) + ) { + return ''; + } + + // else continue to form the where clause from column criteria values + $fullWhereClause = array(); + foreach ($_POST['criteriaColumnOperators'] as $column_index => $operator) { + $unaryFlag = $GLOBALS['dbi']->types->isUnaryOperator($operator); + $tmp_geom_func = isset($_POST['geom_func'][$column_index]) + ? $_POST['geom_func'][$column_index] : null; + + $whereClause = $this->_getWhereClause( + $_POST['criteriaValues'][$column_index], + $_POST['criteriaColumnNames'][$column_index], + $_POST['criteriaColumnTypes'][$column_index], + $operator, + $unaryFlag, + $tmp_geom_func + ); + + if ($whereClause) { + $fullWhereClause[] = $whereClause; + } + } // end foreach + + if (!empty($fullWhereClause)) { + return ' WHERE ' . implode(' AND ', $fullWhereClause); + } + return ''; + } + + /** + * Return the where clause in case column's type is ENUM. + * + * @param mixed $criteriaValues Search criteria input + * @param string $func_type Search function/operator + * + * @return string part of where clause. + */ + private function _getEnumWhereClause($criteriaValues, $func_type) + { + if (! is_array($criteriaValues)) { + $criteriaValues = explode(',', $criteriaValues); + } + $enum_selected_count = count($criteriaValues); + if ($func_type == '=' && $enum_selected_count > 1) { + $func_type = 'IN'; + $parens_open = '('; + $parens_close = ')'; + + } elseif ($func_type == '!=' && $enum_selected_count > 1) { + $func_type = 'NOT IN'; + $parens_open = '('; + $parens_close = ')'; + + } else { + $parens_open = ''; + $parens_close = ''; + } + $enum_where = '\'' + . $GLOBALS['dbi']->escapeString($criteriaValues[0]) . '\''; + for ($e = 1; $e < $enum_selected_count; $e++) { + $enum_where .= ', \'' + . $GLOBALS['dbi']->escapeString($criteriaValues[$e]) . '\''; + } + + return ' ' . $func_type . ' ' . $parens_open + . $enum_where . $parens_close; + } + + /** + * Return the where clause for a geometrical column. + * + * @param mixed $criteriaValues Search criteria input + * @param string $names Name of the column on which search is submitted + * @param string $func_type Search function/operator + * @param string $types Type of the field + * @param bool $geom_func Whether geometry functions should be applied + * + * @return string part of where clause. + */ + private function _getGeomWhereClause($criteriaValues, $names, + $func_type, $types, $geom_func = null + ) { + $geom_unary_functions = array( + 'IsEmpty' => 1, + 'IsSimple' => 1, + 'IsRing' => 1, + 'IsClosed' => 1, + ); + $where = ''; + + // Get details about the geometry functions + $geom_funcs = Util::getGISFunctions($types, true, false); + + // If the function takes multiple parameters + if(strpos($func_type, "IS NULL") !== false || strpos($func_type, "IS NOT NULL") !== false) { + $where = Util::backquote($names) . " " . $func_type; + return $where; + } elseif ($geom_funcs[$geom_func]['params'] > 1) { + // create gis data from the criteria input + $gis_data = Util::createGISData($criteriaValues, $this->dbi->getVersion()); + $where = $geom_func . '(' . Util::backquote($names) + . ', ' . $gis_data . ')'; + return $where; + } + + // New output type is the output type of the function being applied + $type = $geom_funcs[$geom_func]['type']; + $geom_function_applied = $geom_func + . '(' . Util::backquote($names) . ')'; + + // If the where clause is something like 'IsEmpty(`spatial_col_name`)' + if (isset($geom_unary_functions[$geom_func]) + && trim($criteriaValues) == '' + ) { + $where = $geom_function_applied; + + } elseif (in_array($type, Util::getGISDatatypes()) + && ! empty($criteriaValues) + ) { + // create gis data from the criteria input + $gis_data = Util::createGISData($criteriaValues, $this->dbi->getVersion()); + $where = $geom_function_applied . " " . $func_type . " " . $gis_data; + + } elseif (strlen($criteriaValues) > 0) { + $where = $geom_function_applied . " " + . $func_type . " '" . $criteriaValues . "'"; + } + return $where; + } + + /** + * Return the where clause for query generation based on the inputs provided. + * + * @param mixed $criteriaValues Search criteria input + * @param string $names Name of the column on which search is submitted + * @param string $types Type of the field + * @param string $func_type Search function/operator + * @param bool $unaryFlag Whether operator unary or not + * @param bool $geom_func Whether geometry functions should be applied + * + * @return string generated where clause. + */ + private function _getWhereClause($criteriaValues, $names, $types, + $func_type, $unaryFlag, $geom_func = null + ) { + // If geometry function is set + if (! empty($geom_func)) { + return $this->_getGeomWhereClause( + $criteriaValues, $names, $func_type, $types, $geom_func + ); + } + + $backquoted_name = Util::backquote($names); + $where = ''; + if ($unaryFlag) { + $where = $backquoted_name . ' ' . $func_type; + } elseif (strncasecmp($types, 'enum', 4) == 0 && (! empty($criteriaValues) || $criteriaValues[0] === '0')) { + $where = $backquoted_name; + $where .= $this->_getEnumWhereClause($criteriaValues, $func_type); + + } elseif ($criteriaValues != '') { + // For these types we quote the value. Even if it's another type + // (like INT), for a LIKE we always quote the value. MySQL converts + // strings to numbers and numbers to strings as necessary + // during the comparison + if (preg_match('@char|binary|blob|text|set|date|time|year@i', $types) + || mb_strpos(' ' . $func_type, 'LIKE') + ) { + $quot = '\''; + } else { + $quot = ''; + } + + // LIKE %...% + if ($func_type == 'LIKE %...%') { + $func_type = 'LIKE'; + $criteriaValues = '%' . $criteriaValues . '%'; + } + if ($func_type == 'REGEXP ^...$') { + $func_type = 'REGEXP'; + $criteriaValues = '^' . $criteriaValues . '$'; + } + + if ('IN (...)' != $func_type + && 'NOT IN (...)' != $func_type + && 'BETWEEN' != $func_type + && 'NOT BETWEEN' != $func_type + ) { + return $backquoted_name . ' ' . $func_type . ' ' . $quot + . $GLOBALS['dbi']->escapeString($criteriaValues) . $quot; + } + $func_type = str_replace(' (...)', '', $func_type); + + //Don't explode if this is already an array + //(Case for (NOT) IN/BETWEEN.) + if (is_array($criteriaValues)) { + $values = $criteriaValues; + } else { + $values = explode(',', $criteriaValues); + } + // quote values one by one + $emptyKey = false; + foreach ($values as $key => &$value) { + if ('' === $value) { + $emptyKey = $key; + $value = 'NULL'; + continue; + } + $value = $quot . $GLOBALS['dbi']->escapeString(trim($value)) + . $quot; + } + + if ('BETWEEN' == $func_type || 'NOT BETWEEN' == $func_type) { + $where = $backquoted_name . ' ' . $func_type . ' ' + . (isset($values[0]) ? $values[0] : '') + . ' AND ' . (isset($values[1]) ? $values[1] : ''); + } else { //[NOT] IN + if (false !== $emptyKey) { + unset($values[$emptyKey]); + } + $wheres = array(); + if (!empty($values)) { + $wheres[] = $backquoted_name . ' ' . $func_type + . ' (' . implode(',', $values) . ')'; + } + if (false !== $emptyKey) { + $wheres[] = $backquoted_name . ' IS NULL'; + } + $where = implode(' OR ', $wheres); + if (1 < count($wheres)) { + $where = '(' . $where . ')'; + } + } + } // end if + + return $where; + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/Table/TableStructureController.php b/phpMyAdmin/libraries/classes/Controllers/Table/TableStructureController.php new file mode 100755 index 0000000..80dccdb --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/Table/TableStructureController.php @@ -0,0 +1,1502 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\Table\TableStructureController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers\Table; + +use PhpMyAdmin\CentralColumns; +use PhpMyAdmin\Config\PageSettings; +use PhpMyAdmin\Controllers\TableController; +use PhpMyAdmin\Core; +use PhpMyAdmin\CreateAddField; +use PhpMyAdmin\Index; +use PhpMyAdmin\Message; +use PhpMyAdmin\ParseAnalyze; +use PhpMyAdmin\Partition; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Sql; +use PhpMyAdmin\SqlParser\Context; +use PhpMyAdmin\SqlParser\Parser; +use PhpMyAdmin\SqlParser\Statements\CreateStatement; +use PhpMyAdmin\Table; +use PhpMyAdmin\Template; +use PhpMyAdmin\Tracker; +use PhpMyAdmin\Transformations; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Handles table structure logic + * + * @package PhpMyAdmin\Controllers + */ +class TableStructureController extends TableController +{ + /** + * @var Table The table object + */ + protected $table_obj; + /** + * @var string The URL query string + */ + protected $_url_query; + /** + * @var bool DB is information_schema + */ + protected $_db_is_system_schema; + /** + * @var bool Table is a view + */ + protected $_tbl_is_view; + /** + * @var string Table storage engine + */ + protected $_tbl_storage_engine; + /** + * @var int Number of rows + */ + protected $_table_info_num_rows; + /** + * @var string Table collation + */ + protected $_tbl_collation; + /** + * @var array Show table info + */ + protected $_showtable; + + /** + * @var CreateAddField + */ + private $createAddField; + + /** + * @var Relation $relation + */ + private $relation; + + /** + * TableStructureController constructor + * + * @param string $db DB name + * @param string $table Table name + * @param string $type Indicate the db_structure or tbl_structure + * @param int $num_tables Number of tables + * @param int $pos Current position in the list + * @param bool $db_is_system_schema DB is information_schema + * @param int $total_num_tables Number of tables + * @param array $tables Tables in the DB + * @param bool $is_show_stats Whether stats show or not + * @param bool $tbl_is_view Table is a view + * @param string $tbl_storage_engine Table storage engine + * @param int $table_info_num_rows Number of rows + * @param string $tbl_collation Table collation + * @param array $showtable Show table info + */ + public function __construct( + $response, + $dbi, + $db, + $table, + $type, + $num_tables, + $pos, + $db_is_system_schema, + $total_num_tables, + $tables, + $is_show_stats, + $tbl_is_view, + $tbl_storage_engine, + $table_info_num_rows, + $tbl_collation, + $showtable + ) { + parent::__construct($response, $dbi, $db, $table); + + $this->_db_is_system_schema = $db_is_system_schema; + $this->_url_query = Url::getCommonRaw(array('db' => $db, 'table' => $table)); + $this->_tbl_is_view = $tbl_is_view; + $this->_tbl_storage_engine = $tbl_storage_engine; + $this->_table_info_num_rows = $table_info_num_rows; + $this->_tbl_collation = $tbl_collation; + $this->_showtable = $showtable; + $this->table_obj = $this->dbi->getTable($this->db, $this->table); + + $this->createAddField = new CreateAddField($dbi); + $this->relation = new Relation(); + } + + /** + * Index action + * + * @return void + */ + public function indexAction() + { + PageSettings::showGroup('TableStructure'); + + /** + * Function implementations for this script + */ + include_once 'libraries/check_user_privileges.inc.php'; + + $this->response->getHeader()->getScripts()->addFiles( + array( + 'tbl_structure.js', + 'indexes.js' + ) + ); + + /** + * Handle column moving + */ + if (isset($_POST['move_columns']) + && is_array($_POST['move_columns']) + && $this->response->isAjax() + ) { + $this->moveColumns(); + return; + } + + /** + * handle MySQL reserved words columns check + */ + if (isset($_POST['reserved_word_check'])) { + if ($GLOBALS['cfg']['ReservedWordDisableWarning'] === false) { + $columns_names = $_POST['field_name']; + $reserved_keywords_names = array(); + foreach ($columns_names as $column) { + if (Context::isKeyword(trim($column), true)) { + $reserved_keywords_names[] = trim($column); + } + } + if (Context::isKeyword(trim($this->table), true)) { + $reserved_keywords_names[] = trim($this->table); + } + if (count($reserved_keywords_names) == 0) { + $this->response->setRequestStatus(false); + } + $this->response->addJSON( + 'message', sprintf( + _ngettext( + 'The name \'%s\' is a MySQL reserved keyword.', + 'The names \'%s\' are MySQL reserved keywords.', + count($reserved_keywords_names) + ), + implode(',', $reserved_keywords_names) + ) + ); + } else { + $this->response->setRequestStatus(false); + } + return; + } + /** + * A click on Change has been made for one column + */ + if (isset($_GET['change_column'])) { + $this->displayHtmlForColumnChange(null, 'tbl_structure.php'); + return; + } + + /** + * Adding or editing partitioning of the table + */ + if (isset($_POST['edit_partitioning']) + && ! isset($_POST['save_partitioning']) + ) { + $this->displayHtmlForPartitionChange(); + return; + } + + /** + * handle multiple field commands if required + * + * submit_mult_*_x comes from IE if <input type="img" ...> is used + */ + $submit_mult = $this->getMultipleFieldCommandType(); + + if (! empty($submit_mult)) { + if (isset($_POST['selected_fld'])) { + if ($submit_mult == 'browse') { + // browsing the table displaying only selected columns + $this->displayTableBrowseForSelectedColumns( + $GLOBALS['goto'], $GLOBALS['pmaThemeImage'] + ); + } else { + // handle multiple field commands + // handle confirmation of deleting multiple columns + $action = 'tbl_structure.php'; + $GLOBALS['selected'] = $_POST['selected_fld']; + list( + $what_ret, $query_type_ret, $is_unset_submit_mult, + $mult_btn_ret, $centralColsError + ) + = $this->getDataForSubmitMult( + $submit_mult, $_POST['selected_fld'], $action + ); + //update the existing variables + // todo: refactor mult_submits.inc.php such as + // below globals are not needed anymore + if (isset($what_ret)) { + $GLOBALS['what'] = $what_ret; + global $what; + } + if (isset($query_type_ret)) { + $GLOBALS['query_type'] = $query_type_ret; + global $query_type; + } + if ($is_unset_submit_mult) { + unset($submit_mult); + } + if (isset($mult_btn_ret)) { + $GLOBALS['mult_btn'] = $mult_btn_ret; + global $mult_btn; + } + include 'libraries/mult_submits.inc.php'; + /** + * if $submit_mult == 'change', execution will have stopped + * at this point + */ + if (empty($message)) { + $message = Message::success(); + } + $this->response->addHTML( + Util::getMessage($message, $sql_query) + ); + } + } else { + $this->response->setRequestStatus(false); + $this->response->addJSON('message', __('No column selected.')); + } + } + + // display secondary level tabs if necessary + $engine = $this->table_obj->getStorageEngine(); + $this->response->addHTML( + Template::get('table/secondary_tabs')->render( + array( + 'url_params' => array( + 'db' => $this->db, + 'table' => $this->table + ), + 'is_foreign_key_supported' => Util::isForeignKeySupported($engine), + 'cfg_relation' => $this->relation->getRelationsParam(), + ) + ) + ); + $this->response->addHTML('<div id="structure_content">'); + + /** + * Modifications have been submitted -> updates the table + */ + if (isset($_POST['do_save_data'])) { + $regenerate = $this->updateColumns(); + if ($regenerate) { + // This happens when updating failed + // @todo: do something appropriate + } else { + // continue to show the table's structure + unset($_POST['selected']); + } + } + + /** + * Modifications to the partitioning have been submitted -> updates the table + */ + if (isset($_POST['save_partitioning'])) { + $this->updatePartitioning(); + } + + /** + * Adding indexes + */ + if (isset($_POST['add_key']) + || isset($_POST['partition_maintenance']) + ) { + //todo: set some variables for sql.php include, to be eliminated + //after refactoring sql.php + $db = $this->db; + $table = $this->table; + $sql_query = $GLOBALS['sql_query']; + $cfg = $GLOBALS['cfg']; + $pmaThemeImage = $GLOBALS['pmaThemeImage']; + include 'sql.php'; + $GLOBALS['reload'] = true; + } + + /** + * Gets the relation settings + */ + $cfgRelation = $this->relation->getRelationsParam(); + + /** + * Runs common work + */ + // set db, table references, for require_once that follows + // got to be eliminated in long run + $db = &$this->db; + $table = &$this->table; + $url_params = array(); + include_once 'libraries/tbl_common.inc.php'; + $this->_db_is_system_schema = $db_is_system_schema; + $this->_url_query = Url::getCommonRaw(array( + 'db' => $db, + 'table' => $table, + 'goto' => 'tbl_structure.php', + 'back' => 'tbl_structure.php', + )); + /* The url_params array is initialized in above include */ + $url_params['goto'] = 'tbl_structure.php'; + $url_params['back'] = 'tbl_structure.php'; + + // 2. Gets table keys and retains them + // @todo should be: $server->db($db)->table($table)->primary() + $primary = Index::getPrimary($this->table, $this->db); + $columns_with_index = $this->dbi + ->getTable($this->db, $this->table) + ->getColumnsWithIndex( + Index::UNIQUE | Index::INDEX | Index::SPATIAL + | Index::FULLTEXT + ); + $columns_with_unique_index = $this->dbi + ->getTable($this->db, $this->table) + ->getColumnsWithIndex(Index::UNIQUE); + + // 3. Get fields + $fields = (array)$this->dbi->getColumns( + $this->db, $this->table, null, true + ); + + foreach ($fields as $key => $row) { + if ('text' === substr($row['Type'], -4)) { + $fields[$key]['Default'] = stripcslashes(substr($row['Default'], 1, -1)); + } + } + + //display table structure + $this->response->addHTML( + $this->displayStructure( + $cfgRelation, $columns_with_unique_index, $url_params, + $primary, $fields, $columns_with_index + ) + ); + + $this->response->addHTML('</div>'); + } + + /** + * Moves columns in the table's structure based on $_REQUEST + * + * @return void + */ + protected function moveColumns() + { + $this->dbi->selectDb($this->db); + + /* + * load the definitions for all columns + */ + $columns = $this->dbi->getColumnsFull($this->db, $this->table); + $column_names = array_keys($columns); + $changes = array(); + + // @see https://mariadb.com/kb/en/library/changes-improvements-in-mariadb-102/#information-schema + $usesLiteralNull = $this->dbi->isMariaDB() && $this->dbi->getVersion() >= 100200; + $defaultNullValue = $usesLiteralNull ? 'NULL' : null; + // move columns from first to last + for ($i = 0, $l = count($_POST['move_columns']); $i < $l; $i++) { + $column = $_POST['move_columns'][$i]; + // is this column already correctly placed? + if ($column_names[$i] == $column) { + continue; + } + + // it is not, let's move it to index $i + $data = $columns[$column]; + $extracted_columnspec = Util::extractColumnSpec($data['Type']); + if (isset($data['Extra']) + && $data['Extra'] == 'on update CURRENT_TIMESTAMP' + ) { + $extracted_columnspec['attribute'] = $data['Extra']; + unset($data['Extra']); + } + $current_timestamp = ($data['Type'] == 'timestamp' + || $data['Type'] == 'datetime' || $data['DATA_TYPE'] == 'int') + && ($data['Default'] == 'CURRENT_TIMESTAMP' + || $data['Default'] == 'current_timestamp()'); + + // @see https://mariadb.com/kb/en/library/information-schema-columns-table/#examples + if ($data['Null'] === 'YES' && in_array($data['Default'], [$defaultNullValue, null])) { + $default_type = 'NULL'; + } elseif ($current_timestamp) { + $default_type = 'CURRENT_TIMESTAMP'; + } elseif ($data['Default'] === null) { + $default_type = 'NONE'; + } else { + $default_type = 'USER_DEFINED'; + } + + $virtual = array( + 'VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED' + ); + $data['Virtuality'] = ''; + $data['Expression'] = ''; + if (isset($data['Extra']) && in_array($data['Extra'], $virtual)) { + $data['Virtuality'] = str_replace(' GENERATED', '', $data['Extra']); + $expressions = $this->table_obj->getColumnGenerationExpression($column); + $data['Expression'] = $expressions[$column]; + } + + $changes[] = 'CHANGE ' . Table::generateAlter( + $column, + $column, + mb_strtoupper($extracted_columnspec['type']), + $extracted_columnspec['spec_in_brackets'], + $extracted_columnspec['attribute'], + isset($data['Collation']) ? $data['Collation'] : '', + $data['Null'] === 'YES' ? 'YES' : 'NO', + $default_type, + $current_timestamp ? '' : $data['Default'], + isset($data['Extra']) && $data['Extra'] !== '' ? $data['Extra'] + : false, + isset($data['COLUMN_COMMENT']) && $data['COLUMN_COMMENT'] !== '' + ? $data['COLUMN_COMMENT'] : false, + $data['Virtuality'], + $data['Expression'], + $i === 0 ? '-first' : $column_names[$i - 1] + ); + // update current column_names array, first delete old position + for ($j = 0, $ll = count($column_names); $j < $ll; $j++) { + if ($column_names[$j] == $column) { + unset($column_names[$j]); + } + } + // insert moved column + array_splice($column_names, $i, 0, $column); + } + if (empty($changes)) { // should never happen + $this->response->setRequestStatus(false); + return; + } + // move columns + $this->dbi->tryQuery( + sprintf( + 'ALTER TABLE %s %s', + Util::backquote($this->table), + implode(', ', $changes) + ) + ); + $tmp_error = $this->dbi->getError(); + if ($tmp_error) { + $this->response->setRequestStatus(false); + $this->response->addJSON('message', Message::error($tmp_error)); + } else { + $message = Message::success( + __('The columns have been moved successfully.') + ); + $this->response->addJSON('message', $message); + $this->response->addJSON('columns', $column_names); + } + } + + /** + * Displays HTML for changing one or more columns + * + * @param array $selected the selected columns + * @param string $action target script to call + * + * @return boolean $regenerate true if error occurred + * + */ + protected function displayHtmlForColumnChange($selected, $action) + { + // $selected comes from mult_submits.inc.php + if (empty($selected)) { + $selected[] = $_REQUEST['field']; + $selected_cnt = 1; + } else { // from a multiple submit + $selected_cnt = count($selected); + } + + /** + * @todo optimize in case of multiple fields to modify + */ + $fields_meta = array(); + for ($i = 0; $i < $selected_cnt; $i++) { + $value = $this->dbi->getColumns( + $this->db, $this->table, $this->dbi->escapeString($selected[$i]), true + ); + if (count($value) == 0) { + $message = Message::error( + __('Failed to get description of column %s!') + ); + $message->addParam($selected[$i]); + $this->response->addHTML($message); + + } else { + $fields_meta[] = $value; + } + } + $num_fields = count($fields_meta); + // set these globals because tbl_columns_definition_form.inc.php + // verifies them + // @todo: refactor tbl_columns_definition_form.inc.php so that it uses + // protected function params + $GLOBALS['action'] = $action; + $GLOBALS['num_fields'] = $num_fields; + + /** + * Form for changing properties. + */ + include_once 'libraries/check_user_privileges.inc.php'; + include 'libraries/tbl_columns_definition_form.inc.php'; + } + + /** + * Displays HTML for partition change + * + * @return string HTML for partition change + */ + protected function displayHtmlForPartitionChange() + { + $partitionDetails = null; + if (! isset($_POST['partition_by'])) { + $partitionDetails = $this->_extractPartitionDetails(); + } + + include 'libraries/tbl_partition_definition.inc.php'; + $this->response->addHTML( + Template::get('table/structure/partition_definition_form') + ->render( + array( + 'db' => $this->db, + 'table' => $this->table, + 'partition_details' => $partitionDetails, + ) + ) + ); + } + + /** + * Extracts partition details from CREATE TABLE statement + * + * @return array[] array of partition details + */ + private function _extractPartitionDetails() + { + $createTable = (new Table($this->table, $this->db))->showCreate(); + if (! $createTable) { + return null; + } + + $parser = new Parser($createTable); + /** + * @var $stmt PhpMyAdmin\SqlParser\Statements\CreateStatement + */ + $stmt = $parser->statements[0]; + + $partitionDetails = array(); + + $partitionDetails['partition_by'] = ''; + $partitionDetails['partition_expr'] = ''; + $partitionDetails['partition_count'] = ''; + + if (! empty($stmt->partitionBy)) { + $openPos = strpos($stmt->partitionBy, "("); + $closePos = strrpos($stmt->partitionBy, ")"); + + $partitionDetails['partition_by'] + = trim(substr($stmt->partitionBy, 0, $openPos)); + $partitionDetails['partition_expr'] + = trim(substr($stmt->partitionBy, $openPos + 1, $closePos - ($openPos + 1))); + if (isset($stmt->partitionsNum)) { + $count = $stmt->partitionsNum; + } else { + $count = count($stmt->partitions); + } + $partitionDetails['partition_count'] = $count; + } + + $partitionDetails['subpartition_by'] = ''; + $partitionDetails['subpartition_expr'] = ''; + $partitionDetails['subpartition_count'] = ''; + + if (! empty($stmt->subpartitionBy)) { + $openPos = strpos($stmt->subpartitionBy, "("); + $closePos = strrpos($stmt->subpartitionBy, ")"); + + $partitionDetails['subpartition_by'] + = trim(substr($stmt->subpartitionBy, 0, $openPos)); + $partitionDetails['subpartition_expr'] + = trim(substr($stmt->subpartitionBy, $openPos + 1, $closePos - ($openPos + 1))); + if (isset($stmt->subpartitionsNum)) { + $count = $stmt->subpartitionsNum; + } else { + $count = count($stmt->partitions[0]->subpartitions); + } + $partitionDetails['subpartition_count'] = $count; + } + + // Only LIST and RANGE type parameters allow subpartitioning + $partitionDetails['can_have_subpartitions'] + = $partitionDetails['partition_count'] > 1 + && ($partitionDetails['partition_by'] == 'RANGE' + || $partitionDetails['partition_by'] == 'RANGE COLUMNS' + || $partitionDetails['partition_by'] == 'LIST' + || $partitionDetails['partition_by'] == 'LIST COLUMNS'); + + // Values are specified only for LIST and RANGE type partitions + $partitionDetails['value_enabled'] = isset($partitionDetails['partition_by']) + && ($partitionDetails['partition_by'] == 'RANGE' + || $partitionDetails['partition_by'] == 'RANGE COLUMNS' + || $partitionDetails['partition_by'] == 'LIST' + || $partitionDetails['partition_by'] == 'LIST COLUMNS'); + + $partitionDetails['partitions'] = array(); + + for ($i = 0; $i < intval($partitionDetails['partition_count']); $i++) { + + if (! isset($stmt->partitions[$i])) { + $partitionDetails['partitions'][$i] = array( + 'name' => 'p' . $i, + 'value_type' => '', + 'value' => '', + 'engine' => '', + 'comment' => '', + 'data_directory' => '', + 'index_directory' => '', + 'max_rows' => '', + 'min_rows' => '', + 'tablespace' => '', + 'node_group' => '', + ); + } else { + $p = $stmt->partitions[$i]; + $type = $p->type; + $expr = trim($p->expr, '()'); + if ($expr == 'MAXVALUE') { + $type .= ' MAXVALUE'; + $expr = ''; + } + $partitionDetails['partitions'][$i] = array( + 'name' => $p->name, + 'value_type' => $type, + 'value' => $expr, + 'engine' => $p->options->has('ENGINE', true), + 'comment' => trim($p->options->has('COMMENT', true), "'"), + 'data_directory' => trim($p->options->has('DATA DIRECTORY', true), "'"), + 'index_directory' => trim($p->options->has('INDEX_DIRECTORY', true), "'"), + 'max_rows' => $p->options->has('MAX_ROWS', true), + 'min_rows' => $p->options->has('MIN_ROWS', true), + 'tablespace' => $p->options->has('TABLESPACE', true), + 'node_group' => $p->options->has('NODEGROUP', true), + ); + } + + $partition =& $partitionDetails['partitions'][$i]; + $partition['prefix'] = 'partitions[' . $i . ']'; + + if ($partitionDetails['subpartition_count'] > 1) { + $partition['subpartition_count'] = $partitionDetails['subpartition_count']; + $partition['subpartitions'] = array(); + + for ($j = 0; $j < intval($partitionDetails['subpartition_count']); $j++) { + if (! isset($stmt->partitions[$i]->subpartitions[$j])) { + $partition['subpartitions'][$j] = array( + 'name' => $partition['name'] . '_s' . $j, + 'engine' => '', + 'comment' => '', + 'data_directory' => '', + 'index_directory' => '', + 'max_rows' => '', + 'min_rows' => '', + 'tablespace' => '', + 'node_group' => '', + ); + } else { + $sp = $stmt->partitions[$i]->subpartitions[$j]; + $partition['subpartitions'][$j] = array( + 'name' => $sp->name, + 'engine' => $sp->options->has('ENGINE', true), + 'comment' => trim($sp->options->has('COMMENT', true), "'"), + 'data_directory' => trim($sp->options->has('DATA DIRECTORY', true), "'"), + 'index_directory' => trim($sp->options->has('INDEX_DIRECTORY', true), "'"), + 'max_rows' => $sp->options->has('MAX_ROWS', true), + 'min_rows' => $sp->options->has('MIN_ROWS', true), + 'tablespace' => $sp->options->has('TABLESPACE', true), + 'node_group' => $sp->options->has('NODEGROUP', true), + ); + } + + $subpartition =& $partition['subpartitions'][$j]; + $subpartition['prefix'] = 'partitions[' . $i . ']' + . '[subpartitions][' . $j . ']'; + } + } + } + + return $partitionDetails; + } + + /** + * Update the table's partitioning based on $_REQUEST + * + * @return void + */ + protected function updatePartitioning() + { + $sql_query = "ALTER TABLE " . Util::backquote($this->table) . " " + . $this->createAddField->getPartitionsDefinition(); + + // Execute alter query + $result = $this->dbi->tryQuery($sql_query); + + if ($result !== false) { + $message = Message::success( + __('Table %1$s has been altered successfully.') + ); + $message->addParam($this->table); + $this->response->addHTML( + Util::getMessage($message, $sql_query, 'success') + ); + } else { + $this->response->setRequestStatus(false); + $this->response->addJSON( + 'message', + Message::rawError( + __('Query error') . ':<br />' . $this->dbi->getError() + ) + ); + } + } + + /** + * Function to get the type of command for multiple field handling + * + * @return string + */ + protected function getMultipleFieldCommandType() + { + $types = array( + 'change', 'drop', 'primary', + 'index', 'unique', 'spatial', + 'fulltext', 'browse' + ); + + foreach ($types as $type) { + if (isset($_POST['submit_mult_' . $type . '_x'])) { + return $type; + } + } + + if (isset($_POST['submit_mult'])) { + return $_POST['submit_mult']; + } elseif (isset($_POST['mult_btn']) + && $_POST['mult_btn'] == __('Yes') + ) { + if (isset($_POST['selected'])) { + $_POST['selected_fld'] = $_POST['selected']; + } + return 'row_delete'; + } + + return null; + } + + /** + * Function to display table browse for selected columns + * + * @param string $goto goto page url + * @param string $pmaThemeImage URI of the pma theme image + * + * @return void + */ + protected function displayTableBrowseForSelectedColumns($goto, $pmaThemeImage) + { + $GLOBALS['active_page'] = 'sql.php'; + $fields = array(); + foreach ($_POST['selected_fld'] as $sval) { + $fields[] = Util::backquote($sval); + } + $sql_query = sprintf( + 'SELECT %s FROM %s.%s', + implode(', ', $fields), + Util::backquote($this->db), + Util::backquote($this->table) + ); + + // Parse and analyze the query + $db = &$this->db; + list( + $analyzed_sql_results, + $db, + ) = ParseAnalyze::sqlQuery($sql_query, $db); + // @todo: possibly refactor + extract($analyzed_sql_results); + + $sql = new Sql(); + $this->response->addHTML( + $sql->executeQueryAndGetQueryResponse( + isset($analyzed_sql_results) ? $analyzed_sql_results : '', + false, // is_gotofile + $this->db, // db + $this->table, // table + null, // find_real_end + null, // sql_query_for_bookmark + null, // extra_data + null, // message_to_show + null, // message + null, // sql_data + $goto, // goto + $pmaThemeImage, // pmaThemeImage + null, // disp_query + null, // disp_message + null, // query_type + $sql_query, // sql_query + null, // selectedTables + null // complete_query + ) + ); + } + + /** + * Update the table's structure based on $_REQUEST + * + * @return boolean $regenerate true if error occurred + * + */ + protected function updateColumns() + { + $err_url = 'tbl_structure.php' . Url::getCommon( + array( + 'db' => $this->db, 'table' => $this->table + ) + ); + $regenerate = false; + $field_cnt = count($_POST['field_name']); + $changes = array(); + $adjust_privileges = array(); + + for ($i = 0; $i < $field_cnt; $i++) { + if (!$this->columnNeedsAlterTable($i)) { + continue; + } + + $changes[] = 'CHANGE ' . Table::generateAlter( + Util::getValueByKey($_POST, "field_orig.${i}", ''), + $_POST['field_name'][$i], + $_POST['field_type'][$i], + $_POST['field_length'][$i], + $_POST['field_attribute'][$i], + Util::getValueByKey($_POST, "field_collation.${i}", ''), + Util::getValueByKey($_POST, "field_null.${i}", 'NO'), + $_POST['field_default_type'][$i], + $_POST['field_default_value'][$i], + Util::getValueByKey($_POST, "field_extra.${i}", false), + Util::getValueByKey($_POST, "field_comments.${i}", ''), + Util::getValueByKey($_POST, "field_virtuality.${i}", ''), + Util::getValueByKey($_POST, "field_expression.${i}", ''), + Util::getValueByKey($_POST, "field_move_to.${i}", '') + ); + + // find the remembered sort expression + $sorted_col = $this->table_obj->getUiProp( + Table::PROP_SORTED_COLUMN + ); + // if the old column name is part of the remembered sort expression + if (mb_strpos( + $sorted_col, + Util::backquote($_POST['field_orig'][$i]) + ) !== false) { + // delete the whole remembered sort expression + $this->table_obj->removeUiProp(Table::PROP_SORTED_COLUMN); + } + + if (isset($_POST['field_adjust_privileges'][$i]) + && ! empty($_POST['field_adjust_privileges'][$i]) + && $_POST['field_orig'][$i] != $_POST['field_name'][$i] + ) { + $adjust_privileges[$_POST['field_orig'][$i]] + = $_POST['field_name'][$i]; + } + } // end for + + if (count($changes) > 0 || isset($_POST['preview_sql'])) { + // Builds the primary keys statements and updates the table + $key_query = ''; + /** + * this is a little bit more complex + * + * @todo if someone selects A_I when altering a column we need to check: + * - no other column with A_I + * - the column has an index, if not create one + * + */ + + // To allow replication, we first select the db to use + // and then run queries on this db. + if (!$this->dbi->selectDb($this->db)) { + Util::mysqlDie( + $this->dbi->getError(), + 'USE ' . Util::backquote($this->db) . ';', + false, + $err_url + ); + } + $sql_query = 'ALTER TABLE ' . Util::backquote($this->table) . ' '; + $sql_query .= implode(', ', $changes) . $key_query; + $sql_query .= ';'; + + // If there is a request for SQL previewing. + if (isset($_POST['preview_sql'])) { + Core::previewSQL(count($changes) > 0 ? $sql_query : ''); + } + + $columns_with_index = $this->dbi + ->getTable($this->db, $this->table) + ->getColumnsWithIndex( + Index::PRIMARY | Index::UNIQUE | Index::INDEX + | Index::SPATIAL | Index::FULLTEXT + ); + + $changedToBlob = array(); + // While changing the Column Collation + // First change to BLOB + for ($i = 0; $i < $field_cnt; $i++ ) { + if (isset($_POST['field_collation'][$i]) + && isset($_POST['field_collation_orig'][$i]) + && $_POST['field_collation'][$i] !== $_POST['field_collation_orig'][$i] + && ! in_array($_POST['field_orig'][$i], $columns_with_index) + ) { + $secondary_query = 'ALTER TABLE ' . Util::backquote( + $this->table + ) + . ' CHANGE ' . Util::backquote( + $_POST['field_orig'][$i] + ) + . ' ' . Util::backquote($_POST['field_orig'][$i]) + . ' BLOB'; + + if (isset($_POST['field_virtuality'][$i]) + && isset($_POST['field_expression'][$i])) { + if ($_POST['field_virtuality'][$i]) { + $secondary_query .= ' AS (' . $_POST['field_expression'][$i] . ') ' + . $_POST['field_virtuality'][$i]; + } + } + + $secondary_query .= ';'; + + $this->dbi->query($secondary_query); + $changedToBlob[$i] = true; + } else { + $changedToBlob[$i] = false; + } + } + + // Then make the requested changes + $result = $this->dbi->tryQuery($sql_query); + + if ($result !== false) { + $changed_privileges = $this->adjustColumnPrivileges( + $adjust_privileges + ); + + if ($changed_privileges) { + $message = Message::success( + __( + 'Table %1$s has been altered successfully. Privileges ' . + 'have been adjusted.' + ) + ); + } else { + $message = Message::success( + __('Table %1$s has been altered successfully.') + ); + } + $message->addParam($this->table); + + $this->response->addHTML( + Util::getMessage($message, $sql_query, 'success') + ); + } else { + // An error happened while inserting/updating a table definition + + // Save the Original Error + $orig_error = $this->dbi->getError(); + $changes_revert = array(); + + // Change back to Original Collation and data type + for ($i = 0; $i < $field_cnt; $i++) { + if ($changedToBlob[$i]) { + $changes_revert[] = 'CHANGE ' . Table::generateAlter( + Util::getValueByKey($_POST, "field_orig.${i}", ''), + $_POST['field_name'][$i], + $_POST['field_type_orig'][$i], + $_POST['field_length_orig'][$i], + $_POST['field_attribute_orig'][$i], + Util::getValueByKey($_POST, "field_collation_orig.${i}", ''), + Util::getValueByKey($_POST, "field_null_orig.${i}", 'NO'), + $_POST['field_default_type_orig'][$i], + $_POST['field_default_value_orig'][$i], + Util::getValueByKey($_POST, "field_extra_orig.${i}", false), + Util::getValueByKey($_POST, "field_comments_orig.${i}", ''), + Util::getValueByKey($_POST, "field_virtuality_orig.${i}", ''), + Util::getValueByKey($_POST, "field_expression_orig.${i}", ''), + Util::getValueByKey($_POST, "field_move_to_orig.${i}", '') + ); + } + } + + $revert_query = 'ALTER TABLE ' . Util::backquote($this->table) + . ' '; + $revert_query .= implode(', ', $changes_revert) . ''; + $revert_query .= ';'; + + // Column reverted back to original + $this->dbi->query($revert_query); + + $this->response->setRequestStatus(false); + $this->response->addJSON( + 'message', + Message::rawError( + __('Query error') . ':<br />' . $orig_error + ) + ); + $regenerate = true; + } + } + + // update field names in relation + if (isset($_POST['field_orig']) && is_array($_POST['field_orig'])) { + foreach ($_POST['field_orig'] as $fieldindex => $fieldcontent) { + if ($_POST['field_name'][$fieldindex] != $fieldcontent) { + $this->relation->renameField( + $this->db, $this->table, $fieldcontent, + $_POST['field_name'][$fieldindex] + ); + } + } + } + + // update mime types + if (isset($_POST['field_mimetype']) + && is_array($_POST['field_mimetype']) + && $GLOBALS['cfg']['BrowseMIME'] + ) { + foreach ($_POST['field_mimetype'] as $fieldindex => $mimetype) { + if (isset($_POST['field_name'][$fieldindex]) + && strlen($_POST['field_name'][$fieldindex]) > 0 + ) { + Transformations::setMIME( + $this->db, $this->table, + $_POST['field_name'][$fieldindex], + $mimetype, + $_POST['field_transformation'][$fieldindex], + $_POST['field_transformation_options'][$fieldindex], + $_POST['field_input_transformation'][$fieldindex], + $_POST['field_input_transformation_options'][$fieldindex] + ); + } + } + } + return $regenerate; + } + + /** + * Adjusts the Privileges for all the columns whose names have changed + * + * @param array $adjust_privileges assoc array of old col names mapped to new + * cols + * + * @return boolean $changed boolean whether at least one column privileges + * adjusted + */ + protected function adjustColumnPrivileges(array $adjust_privileges) + { + $changed = false; + + if (Util::getValueByKey($GLOBALS, 'col_priv', false) + && Util::getValueByKey($GLOBALS, 'is_reload_priv', false) + ) { + $this->dbi->selectDb('mysql'); + + // For Column specific privileges + foreach ($adjust_privileges as $oldCol => $newCol) { + + $this->dbi->query( + sprintf( + 'UPDATE %s SET Column_name = "%s" + WHERE Db = "%s" + AND Table_name = "%s" + AND Column_name = "%s";', + Util::backquote('columns_priv'), + $newCol, $this->db, $this->table, $oldCol + ) + ); + + // i.e. if atleast one column privileges adjusted + $changed = true; + } + + if ($changed) { + // Finally FLUSH the new privileges + $this->dbi->query("FLUSH PRIVILEGES;"); + } + } + + return $changed; + } + + /** + * Verifies if some elements of a column have changed + * + * @param integer $i column index in the request + * + * @return boolean $alterTableNeeded true if we need to generate ALTER TABLE + * + */ + protected function columnNeedsAlterTable($i) + { + // these two fields are checkboxes so might not be part of the + // request; therefore we define them to avoid notices below + if (! isset($_POST['field_null'][$i])) { + $_POST['field_null'][$i] = 'NO'; + } + if (! isset($_POST['field_extra'][$i])) { + $_POST['field_extra'][$i] = ''; + } + + // field_name does not follow the convention (corresponds to field_orig) + if ($_POST['field_name'][$i] != $_POST['field_orig'][$i]) { + return true; + } + + $fields = array( + 'field_attribute', 'field_collation', 'field_comments', + 'field_default_value', 'field_default_type', 'field_extra', + 'field_length', 'field_null', 'field_type' + ); + foreach ($fields as $field) { + if ($_POST[$field][$i] != $_POST[$field . '_orig'][$i]) { + return true; + } + } + return !empty($_POST['field_move_to'][$i]); + } + + /** + * Displays the table structure ('show table' works correct since 3.23.03) + * + * @param array $cfgRelation current relation parameters + * @param array $columns_with_unique_index Columns with unique index + * @param mixed $url_params Contains an associative + * array with url params + * @param Index|false $primary_index primary index or false if + * no one exists + * @param array $fields Fields + * @param array $columns_with_index Columns with index + * + * @return string + */ + protected function displayStructure( + array $cfgRelation, array $columns_with_unique_index, $url_params, + $primary_index, array $fields, array $columns_with_index + ) { + // prepare comments + $comments_map = array(); + $mime_map = array(); + + if ($GLOBALS['cfg']['ShowPropertyComments']) { + $comments_map = $this->relation->getComments($this->db, $this->table); + if ($cfgRelation['mimework'] && $GLOBALS['cfg']['BrowseMIME']) { + $mime_map = Transformations::getMIME($this->db, $this->table, true); + } + } + $centralColumns = new CentralColumns($GLOBALS['dbi']); + $central_list = $centralColumns->getFromTable( + $this->db, + $this->table + ); + $columns_list = array(); + + $titles = array( + 'Change' => Util::getIcon('b_edit', __('Change')), + 'Drop' => Util::getIcon('b_drop', __('Drop')), + 'NoDrop' => Util::getIcon('b_drop', __('Drop')), + 'Primary' => Util::getIcon('b_primary', __('Primary')), + 'Index' => Util::getIcon('b_index', __('Index')), + 'Unique' => Util::getIcon('b_unique', __('Unique')), + 'Spatial' => Util::getIcon('b_spatial', __('Spatial')), + 'IdxFulltext' => Util::getIcon('b_ftext', __('Fulltext')), + 'NoPrimary' => Util::getIcon('bd_primary', __('Primary')), + 'NoIndex' => Util::getIcon('bd_index', __('Index')), + 'NoUnique' => Util::getIcon('bd_unique', __('Unique')), + 'NoSpatial' => Util::getIcon('bd_spatial', __('Spatial')), + 'NoIdxFulltext' => Util::getIcon('bd_ftext', __('Fulltext')), + 'DistinctValues' => Util::getIcon('b_browse', __('Distinct values')), + ); + + /** + * Displays Space usage and row statistics + */ + // BEGIN - Calc Table Space + // Get valid statistics whatever is the table type + if ($GLOBALS['cfg']['ShowStats']) { + //get table stats in HTML format + $tablestats = $this->getTableStats(); + //returning the response in JSON format to be used by Ajax + $this->response->addJSON('tableStat', $tablestats); + } + // END - Calc Table Space + + $hideStructureActions = false; + if ($GLOBALS['cfg']['HideStructureActions'] === true) { + $hideStructureActions = true; + } + + return Template::get('table/structure/display_structure')->render( + array( + 'hide_structure_actions' => $hideStructureActions, + 'db' => $this->db, + 'table' => $this->table, + 'db_is_system_schema' => $this->_db_is_system_schema, + 'tbl_is_view' => $this->_tbl_is_view, + 'mime_map' => $mime_map, + 'url_query' => $this->_url_query, + 'url_params' => $url_params, + 'titles' => $titles, + 'tbl_storage_engine' => $this->_tbl_storage_engine, + 'primary' => $primary_index, + 'columns_with_unique_index' => $columns_with_unique_index, + 'columns_list' => $columns_list, + 'table_stats' => isset($tablestats) ? $tablestats : null, + 'fields' => $fields, + 'columns_with_index' => $columns_with_index, + 'central_list' => $central_list, + 'comments_map' => $comments_map, + 'browse_mime' => $GLOBALS['cfg']['BrowseMIME'], + 'show_column_comments' => $GLOBALS['cfg']['ShowColumnComments'], + 'show_stats' => $GLOBALS['cfg']['ShowStats'], + 'relation_commwork' => $GLOBALS['cfgRelation']['commwork'], + 'relation_mimework' => $GLOBALS['cfgRelation']['mimework'], + 'central_columns_work' => $GLOBALS['cfgRelation']['centralcolumnswork'], + 'mysql_int_version' => $GLOBALS['dbi']->getVersion(), + 'is_mariadb' => $GLOBALS['dbi']->isMariaDB(), + 'pma_theme_image' => $GLOBALS['pmaThemeImage'], + 'text_dir' => $GLOBALS['text_dir'], + 'is_active' => Tracker::isActive(), + 'have_partitioning' => Partition::havePartitioning(), + 'partition_names' => Partition::getPartitionNames($this->db, $this->table), + ) + ); + } + + /** + * Get HTML snippet for display table statistics + * + * @return string $html_output + */ + protected function getTableStats() + { + if (empty($this->_showtable)) { + $this->_showtable = $this->dbi->getTable( + $this->db, $this->table + )->getStatusInfo(null, true); + } + + if (empty($this->_showtable['Data_length'])) { + $this->_showtable['Data_length'] = 0; + } + if (empty($this->_showtable['Index_length'])) { + $this->_showtable['Index_length'] = 0; + } + + $is_innodb = (isset($this->_showtable['Type']) + && $this->_showtable['Type'] == 'InnoDB'); + + $mergetable = $this->table_obj->isMerge(); + + // this is to display for example 261.2 MiB instead of 268k KiB + $max_digits = 3; + $decimals = 1; + list($data_size, $data_unit) = Util::formatByteDown( + $this->_showtable['Data_length'], $max_digits, $decimals + ); + if ($mergetable == false) { + list($index_size, $index_unit) = Util::formatByteDown( + $this->_showtable['Index_length'], $max_digits, $decimals + ); + } + // InnoDB returns a huge value in Data_free, do not use it + if (! $is_innodb && isset($this->_showtable['Data_free']) + && $this->_showtable['Data_free'] > 0 + ) { + list($free_size, $free_unit) = Util::formatByteDown( + $this->_showtable['Data_free'], $max_digits, $decimals + ); + list($effect_size, $effect_unit) = Util::formatByteDown( + $this->_showtable['Data_length'] + + $this->_showtable['Index_length'] + - $this->_showtable['Data_free'], + $max_digits, $decimals + ); + } else { + list($effect_size, $effect_unit) = Util::formatByteDown( + $this->_showtable['Data_length'] + + $this->_showtable['Index_length'], + $max_digits, $decimals + ); + } + list($tot_size, $tot_unit) = Util::formatByteDown( + $this->_showtable['Data_length'] + $this->_showtable['Index_length'], + $max_digits, $decimals + ); + if ($this->_table_info_num_rows > 0) { + list($avg_size, $avg_unit) = Util::formatByteDown( + ($this->_showtable['Data_length'] + + $this->_showtable['Index_length']) + / $this->_showtable['Rows'], + 6, + 1 + ); + } else { + $avg_size = $avg_unit = ''; + } + + return Template::get('table/structure/display_table_stats')->render( + array( + 'showtable' => $this->_showtable, + 'table_info_num_rows' => $this->_table_info_num_rows, + 'tbl_is_view' => $this->_tbl_is_view, + 'db_is_system_schema' => $this->_db_is_system_schema, + 'tbl_storage_engine' => $this->_tbl_storage_engine, + 'url_query' => $this->_url_query, + 'tbl_collation' => $this->_tbl_collation, + 'is_innodb' => $is_innodb, + 'mergetable' => $mergetable, + 'avg_size' => isset($avg_size) ? $avg_size : null, + 'avg_unit' => isset($avg_unit) ? $avg_unit : null, + 'data_size' => $data_size, + 'data_unit' => $data_unit, + 'index_size' => isset($index_size) ? $index_size : null, + 'index_unit' => isset($index_unit) ? $index_unit : null, + 'free_size' => isset($free_size) ? $free_size : null, + 'free_unit' => isset($free_unit) ? $free_unit : null, + 'effect_size' => $effect_size, + 'effect_unit' => $effect_unit, + 'tot_size' => $tot_size, + 'tot_unit' => $tot_unit, + 'table' => $GLOBALS['table'] + ) + ); + } + + /** + * Gets table primary key + * + * @return string + */ + protected function getKeyForTablePrimary() + { + $this->dbi->selectDb($this->db); + $result = $this->dbi->query( + 'SHOW KEYS FROM ' . Util::backquote($this->table) . ';' + ); + $primary = ''; + while ($row = $this->dbi->fetchAssoc($result)) { + // Backups the list of primary keys + if ($row['Key_name'] == 'PRIMARY') { + $primary .= $row['Column_name'] . ', '; + } + } // end while + $this->dbi->freeResult($result); + + return $primary; + } + + /** + * Get List of information for Submit Mult + * + * @param string $submit_mult mult_submit type + * @param array $selected the selected columns + * @param string $action action type + * + * @return array + */ + protected function getDataForSubmitMult($submit_mult, $selected, $action) + { + $centralColumns = new CentralColumns($GLOBALS['dbi']); + $what = null; + $query_type = null; + $is_unset_submit_mult = false; + $mult_btn = null; + $centralColsError = null; + switch ($submit_mult) { + case 'drop': + $what = 'drop_fld'; + break; + case 'primary': + // Gets table primary key + $primary = $this->getKeyForTablePrimary(); + if (empty($primary)) { + // no primary key, so we can safely create new + $is_unset_submit_mult = true; + $query_type = 'primary_fld'; + $mult_btn = __('Yes'); + } else { + // primary key exists, so lets as user + $what = 'primary_fld'; + } + break; + case 'index': + $is_unset_submit_mult = true; + $query_type = 'index_fld'; + $mult_btn = __('Yes'); + break; + case 'unique': + $is_unset_submit_mult = true; + $query_type = 'unique_fld'; + $mult_btn = __('Yes'); + break; + case 'spatial': + $is_unset_submit_mult = true; + $query_type = 'spatial_fld'; + $mult_btn = __('Yes'); + break; + case 'ftext': + $is_unset_submit_mult = true; + $query_type = 'fulltext_fld'; + $mult_btn = __('Yes'); + break; + case 'add_to_central_columns': + $centralColsError = $centralColumns->syncUniqueColumns( + $selected, + false + ); + break; + case 'remove_from_central_columns': + $centralColsError = $centralColumns->deleteColumnsFromList( + $selected, + false + ); + break; + case 'change': + $this->displayHtmlForColumnChange($selected, $action); + // execution stops here but PhpMyAdmin\Response correctly finishes + // the rendering + exit; + case 'browse': + // this should already be handled by tbl_structure.php + } + + return array( + $what, $query_type, $is_unset_submit_mult, $mult_btn, + $centralColsError + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Controllers/TableController.php b/phpMyAdmin/libraries/classes/Controllers/TableController.php new file mode 100755 index 0000000..60651ab --- /dev/null +++ b/phpMyAdmin/libraries/classes/Controllers/TableController.php @@ -0,0 +1,40 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Controllers\TableController + * + * @package PhpMyAdmin\Controllers + */ +namespace PhpMyAdmin\Controllers; + +/** + * Handles table related logic + * + * @package PhpMyAdmin\Controllers + */ +abstract class TableController extends Controller +{ + /** + * @var string $db + */ + protected $db; + + /** + * @var string $table + */ + protected $table; + + /** + * Constructor + */ + public function __construct( + $response, + $dbi, + $db, + $table + ) { + parent::__construct($response, $dbi); + $this->db = $db; + $this->table = $table; + } +} diff --git a/phpMyAdmin/libraries/classes/Core.php b/phpMyAdmin/libraries/classes/Core.php new file mode 100755 index 0000000..621544e --- /dev/null +++ b/phpMyAdmin/libraries/classes/Core.php @@ -0,0 +1,1352 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Core functions used all over the scripts. + * This script is distinct from libraries/common.inc.php because this + * script is called from /test. + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Message; +use PhpMyAdmin\Response; +use PhpMyAdmin\Sanitize; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Core class + * + * @package PhpMyAdmin + */ +class Core +{ + /** + * the whitelist for goto parameter + * @static array $goto_whitelist + */ + public static $goto_whitelist = array( + 'db_datadict.php', + 'db_sql.php', + 'db_events.php', + 'db_export.php', + 'db_importdocsql.php', + 'db_multi_table_query.php', + 'db_qbe.php', + 'db_structure.php', + 'db_import.php', + 'db_operations.php', + 'db_search.php', + 'db_routines.php', + 'export.php', + 'import.php', + 'index.php', + 'pdf_pages.php', + 'pdf_schema.php', + 'server_binlog.php', + 'server_collations.php', + 'server_databases.php', + 'server_engines.php', + 'server_export.php', + 'server_import.php', + 'server_privileges.php', + 'server_sql.php', + 'server_status.php', + 'server_status_advisor.php', + 'server_status_monitor.php', + 'server_status_queries.php', + 'server_status_variables.php', + 'server_variables.php', + 'sql.php', + 'tbl_addfield.php', + 'tbl_change.php', + 'tbl_create.php', + 'tbl_import.php', + 'tbl_indexes.php', + 'tbl_sql.php', + 'tbl_export.php', + 'tbl_operations.php', + 'tbl_structure.php', + 'tbl_relation.php', + 'tbl_replace.php', + 'tbl_row_action.php', + 'tbl_select.php', + 'tbl_zoom_select.php', + 'transformation_overview.php', + 'transformation_wrapper.php', + 'user_password.php', + ); + + /** + * checks given $var and returns it if valid, or $default of not valid + * given $var is also checked for type being 'similar' as $default + * or against any other type if $type is provided + * + * <code> + * // $_REQUEST['db'] not set + * echo Core::ifSetOr($_REQUEST['db'], ''); // '' + * // $_POST['sql_query'] not set + * echo Core::ifSetOr($_POST['sql_query']); // null + * // $cfg['EnableFoo'] not set + * echo Core::ifSetOr($cfg['EnableFoo'], false, 'boolean'); // false + * echo Core::ifSetOr($cfg['EnableFoo']); // null + * // $cfg['EnableFoo'] set to 1 + * echo Core::ifSetOr($cfg['EnableFoo'], false, 'boolean'); // false + * echo Core::ifSetOr($cfg['EnableFoo'], false, 'similar'); // 1 + * echo Core::ifSetOr($cfg['EnableFoo'], false); // 1 + * // $cfg['EnableFoo'] set to true + * echo Core::ifSetOr($cfg['EnableFoo'], false, 'boolean'); // true + * </code> + * + * @param mixed &$var param to check + * @param mixed $default default value + * @param mixed $type var type or array of values to check against $var + * + * @return mixed $var or $default + * + * @see self::isValid() + */ + public static function ifSetOr(&$var, $default = null, $type = 'similar') + { + if (! self::isValid($var, $type, $default)) { + return $default; + } + + return $var; + } + + /** + * checks given $var against $type or $compare + * + * $type can be: + * - false : no type checking + * - 'scalar' : whether type of $var is integer, float, string or boolean + * - 'numeric' : whether type of $var is any number representation + * - 'length' : whether type of $var is scalar with a string length > 0 + * - 'similar' : whether type of $var is similar to type of $compare + * - 'equal' : whether type of $var is identical to type of $compare + * - 'identical' : whether $var is identical to $compare, not only the type! + * - or any other valid PHP variable type + * + * <code> + * // $_REQUEST['doit'] = true; + * Core::isValid($_REQUEST['doit'], 'identical', 'true'); // false + * // $_REQUEST['doit'] = 'true'; + * Core::isValid($_REQUEST['doit'], 'identical', 'true'); // true + * </code> + * + * NOTE: call-by-reference is used to not get NOTICE on undefined vars, + * but the var is not altered inside this function, also after checking a var + * this var exists nut is not set, example: + * <code> + * // $var is not set + * isset($var); // false + * functionCallByReference($var); // false + * isset($var); // true + * functionCallByReference($var); // true + * </code> + * + * to avoid this we set this var to null if not isset + * + * @param mixed &$var variable to check + * @param mixed $type var type or array of valid values to check against $var + * @param mixed $compare var to compare with $var + * + * @return boolean whether valid or not + * + * @todo add some more var types like hex, bin, ...? + * @see https://secure.php.net/gettype + */ + public static function isValid(&$var, $type = 'length', $compare = null) + { + if (! isset($var)) { + // var is not even set + return false; + } + + if ($type === false) { + // no vartype requested + return true; + } + + if (is_array($type)) { + return in_array($var, $type); + } + + // allow some aliases of var types + $type = strtolower($type); + switch ($type) { + case 'identic' : + $type = 'identical'; + break; + case 'len' : + $type = 'length'; + break; + case 'bool' : + $type = 'boolean'; + break; + case 'float' : + $type = 'double'; + break; + case 'int' : + $type = 'integer'; + break; + case 'null' : + $type = 'NULL'; + break; + } + + if ($type === 'identical') { + return $var === $compare; + } + + // whether we should check against given $compare + if ($type === 'similar') { + switch (gettype($compare)) { + case 'string': + case 'boolean': + $type = 'scalar'; + break; + case 'integer': + case 'double': + $type = 'numeric'; + break; + default: + $type = gettype($compare); + } + } elseif ($type === 'equal') { + $type = gettype($compare); + } + + // do the check + if ($type === 'length' || $type === 'scalar') { + $is_scalar = is_scalar($var); + if ($is_scalar && $type === 'length') { + return strlen($var) > 0; + } + return $is_scalar; + } + + if ($type === 'numeric') { + return is_numeric($var); + } + + return gettype($var) === $type; + } + + /** + * Removes insecure parts in a path; used before include() or + * require() when a part of the path comes from an insecure source + * like a cookie or form. + * + * @param string $path The path to check + * + * @return string The secured path + * + * @access public + */ + public static function securePath($path) + { + // change .. to . + $path = preg_replace('@\.\.*@', '.', $path); + + return $path; + } // end function + + /** + * displays the given error message on phpMyAdmin error page in foreign language, + * ends script execution and closes session + * + * loads language file if not loaded already + * + * @param string $error_message the error message or named error message + * @param string|array $message_args arguments applied to $error_message + * + * @return void + */ + public static function fatalError($error_message, $message_args = null) { + /* Use format string if applicable */ + if (is_string($message_args)) { + $error_message = sprintf($error_message, $message_args); + } elseif (is_array($message_args)) { + $error_message = vsprintf($error_message, $message_args); + } + + /* + * Avoid using Response class as config does not have to be loaded yet + * (this can happen on early fatal error) + */ + if (isset($GLOBALS['dbi']) && !is_null($GLOBALS['dbi']) && isset($GLOBALS['PMA_Config']) && $GLOBALS['PMA_Config']->get('is_setup') === false && Response::getInstance()->isAjax()) { + $response = Response::getInstance(); + $response->setRequestStatus(false); + $response->addJSON('message', Message::error($error_message)); + } elseif (! empty($_REQUEST['ajax_request'])) { + // Generate JSON manually + self::headerJSON(); + echo json_encode( + array( + 'success' => false, + 'message' => Message::error($error_message)->getDisplay(), + ) + ); + } else { + $error_message = strtr($error_message, array('<br />' => '[br]')); + $error_header = __('Error'); + $lang = isset($GLOBALS['lang']) ? $GLOBALS['lang'] : 'en'; + $dir = isset($GLOBALS['text_dir']) ? $GLOBALS['text_dir'] : 'ltr'; + + // Displays the error message + include './libraries/error.inc.php'; + } + if (! defined('TESTSUITE')) { + exit; + } + } + + /** + * Returns a link to the PHP documentation + * + * @param string $target anchor in documentation + * + * @return string the URL + * + * @access public + */ + public static function getPHPDocLink($target) + { + /* List of PHP documentation translations */ + $php_doc_languages = array( + 'pt_BR', 'zh', 'fr', 'de', 'it', 'ja', 'pl', 'ro', 'ru', 'fa', 'es', 'tr' + ); + + $lang = 'en'; + if (in_array($GLOBALS['lang'], $php_doc_languages)) { + $lang = $GLOBALS['lang']; + } + + return self::linkURL('https://secure.php.net/manual/' . $lang . '/' . $target); + } + + /** + * Warn or fail on missing extension. + * + * @param string $extension Extension name + * @param bool $fatal Whether the error is fatal. + * @param string $extra Extra string to append to message. + * + * @return void + */ + public static function warnMissingExtension($extension, $fatal = false, $extra = '') + { + /* Gettext does not have to be loaded yet here */ + if (function_exists('__')) { + $message = __( + 'The %s extension is missing. Please check your PHP configuration.' + ); + } else { + $message + = 'The %s extension is missing. Please check your PHP configuration.'; + } + $doclink = self::getPHPDocLink('book.' . $extension . '.php'); + $message = sprintf( + $message, + '[a@' . $doclink . '@Documentation][em]' . $extension . '[/em][/a]' + ); + if ($extra != '') { + $message .= ' ' . $extra; + } + if ($fatal) { + self::fatalError($message); + return; + } + + $GLOBALS['error_handler']->addError( + $message, + E_USER_WARNING, + '', + '', + false + ); + } + + /** + * returns count of tables in given db + * + * @param string $db database to count tables for + * + * @return integer count of tables in $db + */ + public static function getTableCount($db) + { + $tables = $GLOBALS['dbi']->tryQuery( + 'SHOW TABLES FROM ' . Util::backquote($db) . ';', + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + if ($tables) { + $num_tables = $GLOBALS['dbi']->numRows($tables); + $GLOBALS['dbi']->freeResult($tables); + } else { + $num_tables = 0; + } + + return $num_tables; + } + + /** + * Converts numbers like 10M into bytes + * Used with permission from Moodle (https://moodle.org) by Martin Dougiamas + * (renamed with PMA prefix to avoid double definition when embedded + * in Moodle) + * + * @param string|int $size size (Default = 0) + * + * @return integer $size + */ + public static function getRealSize($size = 0) + { + if (! $size) { + return 0; + } + + $binaryprefixes = array( + 'T' => 1099511627776, + 't' => 1099511627776, + 'G' => 1073741824, + 'g' => 1073741824, + 'M' => 1048576, + 'm' => 1048576, + 'K' => 1024, + 'k' => 1024, + ); + + if (preg_match('/^([0-9]+)([KMGT])/i', $size, $matches)) { + return $matches[1] * $binaryprefixes[$matches[2]]; + } + + return (int) $size; + } // end getRealSize() + + /** + * boolean phpMyAdmin.Core::checkPageValidity(string &$page, array $whitelist) + * + * checks given $page against given $whitelist and returns true if valid + * it optionally ignores query parameters in $page (script.php?ignored) + * + * @param string &$page page to check + * @param array $whitelist whitelist to check page against + * @param boolean $include whether the page is going to be included + * + * @return boolean whether $page is valid or not (in $whitelist or not) + */ + public static function checkPageValidity(&$page, array $whitelist = [], $include = false) + { + if (empty($whitelist)) { + $whitelist = self::$goto_whitelist; + } + if (! isset($page) || !is_string($page)) { + return false; + } + + if (in_array($page, $whitelist)) { + return true; + } + if ($include) { + return false; + } + + $_page = mb_substr( + $page, + 0, + mb_strpos($page . '?', '?') + ); + if (in_array($_page, $whitelist)) { + return true; + } + + $_page = urldecode($page); + $_page = mb_substr( + $_page, + 0, + mb_strpos($_page . '?', '?') + ); + if (in_array($_page, $whitelist)) { + return true; + } + + return false; + } + + /** + * tries to find the value for the given environment variable name + * + * searches in $_SERVER, $_ENV then tries getenv() and apache_getenv() + * in this order + * + * @param string $var_name variable name + * + * @return string value of $var or empty string + */ + public static function getenv($var_name) + { + if (isset($_SERVER[$var_name])) { + return $_SERVER[$var_name]; + } + + if (isset($_ENV[$var_name])) { + return $_ENV[$var_name]; + } + + if (getenv($var_name)) { + return getenv($var_name); + } + + if (function_exists('apache_getenv') + && apache_getenv($var_name, true) + ) { + return apache_getenv($var_name, true); + } + + return ''; + } + + /** + * Send HTTP header, taking IIS limits into account (600 seems ok) + * + * @param string $uri the header to send + * @param bool $use_refresh whether to use Refresh: header when running on IIS + * + * @return void + */ + public static function sendHeaderLocation($uri, $use_refresh = false) + { + if ($GLOBALS['PMA_Config']->get('PMA_IS_IIS') && mb_strlen($uri) > 600) { + Response::getInstance()->disable(); + + echo Template::get('header_location') + ->render(array('uri' => $uri)); + + return; + } + + /* + * Avoid relative path redirect problems in case user entered URL + * like /phpmyadmin/index.php/ which some web servers happily accept. + */ + if ($uri[0] == '.') { + $uri = $GLOBALS['PMA_Config']->getRootPath() . substr($uri, 2); + } + + $response = Response::getInstance(); + + session_write_close(); + if ($response->headersSent()) { + trigger_error( + 'Core::sendHeaderLocation called when headers are already sent!', + E_USER_ERROR + ); + } + // bug #1523784: IE6 does not like 'Refresh: 0', it + // results in a blank page + // but we need it when coming from the cookie login panel) + if ($GLOBALS['PMA_Config']->get('PMA_IS_IIS') && $use_refresh) { + $response->header('Refresh: 0; ' . $uri); + } else { + $response->header('Location: ' . $uri); + } + } + + /** + * Outputs application/json headers. This includes no caching. + * + * @return void + */ + public static function headerJSON() + { + if (defined('TESTSUITE')) { + return; + } + // No caching + self::noCacheHeader(); + // MIME type + header('Content-Type: application/json; charset=UTF-8'); + // Disable content sniffing in browser + // This is needed in case we include HTML in JSON, browser might assume it's + // html to display + header('X-Content-Type-Options: nosniff'); + } + + /** + * Outputs headers to prevent caching in browser (and on the way). + * + * @return void + */ + public static function noCacheHeader() + { + if (defined('TESTSUITE')) { + return; + } + // rfc2616 - Section 14.21 + header('Expires: ' . gmdate(DATE_RFC1123)); + // HTTP/1.1 + header( + 'Cache-Control: no-store, no-cache, must-revalidate,' + . ' pre-check=0, post-check=0, max-age=0' + ); + + header('Pragma: no-cache'); // HTTP/1.0 + // test case: exporting a database into a .gz file with Safari + // would produce files not having the current time + // (added this header for Safari but should not harm other browsers) + header('Last-Modified: ' . gmdate(DATE_RFC1123)); + } + + + /** + * Sends header indicating file download. + * + * @param string $filename Filename to include in headers if empty, + * none Content-Disposition header will be sent. + * @param string $mimetype MIME type to include in headers. + * @param int $length Length of content (optional) + * @param bool $no_cache Whether to include no-caching headers. + * + * @return void + */ + public static function downloadHeader($filename, $mimetype, $length = 0, $no_cache = true) + { + if ($no_cache) { + self::noCacheHeader(); + } + /* Replace all possibly dangerous chars in filename */ + $filename = Sanitize::sanitizeFilename($filename); + if (!empty($filename)) { + header('Content-Description: File Transfer'); + header('Content-Disposition: attachment; filename="' . $filename . '"'); + } + header('Content-Type: ' . $mimetype); + // inform the server that compression has been done, + // to avoid a double compression (for example with Apache + mod_deflate) + $notChromeOrLessThan43 = PMA_USR_BROWSER_AGENT != 'CHROME' // see bug #4942 + || (PMA_USR_BROWSER_AGENT == 'CHROME' && PMA_USR_BROWSER_VER < 43); + if (strpos($mimetype, 'gzip') !== false && $notChromeOrLessThan43) { + header('Content-Encoding: gzip'); + } + header('Content-Transfer-Encoding: binary'); + if ($length > 0) { + header('Content-Length: ' . $length); + } + } + + /** + * Returns value of an element in $array given by $path. + * $path is a string describing position of an element in an associative array, + * eg. Servers/1/host refers to $array[Servers][1][host] + * + * @param string $path path in the array + * @param array $array the array + * @param mixed $default default value + * + * @return mixed array element or $default + */ + public static function arrayRead($path, array $array, $default = null) + { + $keys = explode('/', $path); + $value =& $array; + foreach ($keys as $key) { + if (! isset($value[$key])) { + return $default; + } + $value =& $value[$key]; + } + return $value; + } + + /** + * Stores value in an array + * + * @param string $path path in the array + * @param array &$array the array + * @param mixed $value value to store + * + * @return void + */ + public static function arrayWrite($path, array &$array, $value) + { + $keys = explode('/', $path); + $last_key = array_pop($keys); + $a =& $array; + foreach ($keys as $key) { + if (! isset($a[$key])) { + $a[$key] = array(); + } + $a =& $a[$key]; + } + $a[$last_key] = $value; + } + + /** + * Removes value from an array + * + * @param string $path path in the array + * @param array &$array the array + * + * @return void + */ + public static function arrayRemove($path, array &$array) + { + $keys = explode('/', $path); + $keys_last = array_pop($keys); + $path = array(); + $depth = 0; + + $path[0] =& $array; + $found = true; + // go as deep as required or possible + foreach ($keys as $key) { + if (! isset($path[$depth][$key])) { + $found = false; + break; + } + $depth++; + $path[$depth] =& $path[$depth - 1][$key]; + } + // if element found, remove it + if ($found) { + unset($path[$depth][$keys_last]); + $depth--; + } + + // remove empty nested arrays + for (; $depth >= 0; $depth--) { + if (! isset($path[$depth+1]) || count($path[$depth+1]) == 0) { + unset($path[$depth][$keys[$depth]]); + } else { + break; + } + } + } + + /** + * Returns link to (possibly) external site using defined redirector. + * + * @param string $url URL where to go. + * + * @return string URL for a link. + */ + public static function linkURL($url) + { + if (!preg_match('#^https?://#', $url)) { + return $url; + } + + $params = array(); + $params['url'] = $url; + + $url = Url::getCommon($params); + //strip off token and such sensitive information. Just keep url. + $arr = parse_url($url); + parse_str($arr["query"], $vars); + $query = http_build_query(array("url" => $vars["url"])); + + if (!is_null($GLOBALS['PMA_Config']) && $GLOBALS['PMA_Config']->get('is_setup')) { + $url = '../url.php?' . $query; + } else { + $url = './url.php?' . $query; + } + + return $url; + } + + /** + * Checks whether domain of URL is whitelisted domain or not. + * Use only for URLs of external sites. + * + * @param string $url URL of external site. + * + * @return boolean True: if domain of $url is allowed domain, + * False: otherwise. + */ + public static function isAllowedDomain($url) + { + $arr = parse_url($url); + // We need host to be set + if (! isset($arr['host']) || strlen($arr['host']) == 0) { + return false; + } + // We do not want these to be present + $blocked = array('user', 'pass', 'port'); + foreach ($blocked as $part) { + if (isset($arr[$part]) && strlen($arr[$part]) != 0) { + return false; + } + } + $domain = $arr["host"]; + $domainWhiteList = array( + /* Include current domain */ + $_SERVER['SERVER_NAME'], + /* phpMyAdmin domains */ + 'wiki.phpmyadmin.net', + 'www.phpmyadmin.net', + 'phpmyadmin.net', + 'demo.phpmyadmin.net', + 'docs.phpmyadmin.net', + /* mysql.com domains */ + 'dev.mysql.com','bugs.mysql.com', + /* mariadb domains */ + 'mariadb.org', 'mariadb.com', + /* php.net domains */ + 'php.net', + 'secure.php.net', + /* Github domains*/ + 'github.com','www.github.com', + /* Percona domains */ + 'www.percona.com', + /* Following are doubtful ones. */ + 'mysqldatabaseadministration.blogspot.com', + ); + + return in_array($domain, $domainWhiteList); + } + + /** + * Replace some html-unfriendly stuff + * + * @param string $buffer String to process + * + * @return string Escaped and cleaned up text suitable for html + */ + public static function mimeDefaultFunction($buffer) + { + $buffer = htmlspecialchars($buffer); + $buffer = str_replace(' ', '  ', $buffer); + $buffer = preg_replace("@((\015\012)|(\015)|(\012))@", '<br />' . "\n", $buffer); + + return $buffer; + } + + /** + * Displays SQL query before executing. + * + * @param array|string $query_data Array containing queries or query itself + * + * @return void + */ + public static function previewSQL($query_data) + { + $retval = '<div class="preview_sql">'; + if (empty($query_data)) { + $retval .= __('No change'); + } elseif (is_array($query_data)) { + foreach ($query_data as $query) { + $retval .= Util::formatSql($query); + } + } else { + $retval .= Util::formatSql($query_data); + } + $retval .= '</div>'; + $response = Response::getInstance(); + $response->addJSON('sql_data', $retval); + exit; + } + + /** + * recursively check if variable is empty + * + * @param mixed $value the variable + * + * @return bool true if empty + */ + public static function emptyRecursive($value) + { + $empty = true; + if (is_array($value)) { + array_walk_recursive( + $value, + function ($item) use (&$empty) { + $empty = $empty && empty($item); + } + ); + } else { + $empty = empty($value); + } + return $empty; + } + + /** + * Creates some globals from $_POST variables matching a pattern + * + * @param array $post_patterns The patterns to search for + * + * @return void + */ + public static function setPostAsGlobal(array $post_patterns) + { + foreach (array_keys($_POST) as $post_key) { + foreach ($post_patterns as $one_post_pattern) { + if (preg_match($one_post_pattern, $post_key)) { + $GLOBALS[$post_key] = $_POST[$post_key]; + } + } + } + } + + /** + * Creates some globals from $_REQUEST + * + * @param string $param db|table + * + * @return void + */ + public static function setGlobalDbOrTable($param) + { + $GLOBALS[$param] = ''; + if (self::isValid($_REQUEST[$param])) { + // can we strip tags from this? + // only \ and / is not allowed in db names for MySQL + $GLOBALS[$param] = $_REQUEST[$param]; + $GLOBALS['url_params'][$param] = $GLOBALS[$param]; + } + } + + /** + * PATH_INFO could be compromised if set, so remove it from PHP_SELF + * and provide a clean PHP_SELF here + * + * @return void + */ + public static function cleanupPathInfo() + { + global $PMA_PHP_SELF; + + $PMA_PHP_SELF = self::getenv('PHP_SELF'); + if (empty($PMA_PHP_SELF)) { + $PMA_PHP_SELF = urldecode(self::getenv('REQUEST_URI')); + } + $_PATH_INFO = self::getenv('PATH_INFO'); + if (! empty($_PATH_INFO) && ! empty($PMA_PHP_SELF)) { + $question_pos = mb_strpos($PMA_PHP_SELF, '?'); + if ($question_pos != false) { + $PMA_PHP_SELF = mb_substr($PMA_PHP_SELF, 0, $question_pos); + } + $path_info_pos = mb_strrpos($PMA_PHP_SELF, $_PATH_INFO); + if ($path_info_pos !== false) { + $path_info_part = mb_substr($PMA_PHP_SELF, $path_info_pos, mb_strlen($_PATH_INFO)); + if ($path_info_part == $_PATH_INFO) { + $PMA_PHP_SELF = mb_substr($PMA_PHP_SELF, 0, $path_info_pos); + } + } + } + + $path = []; + foreach(explode('/', $PMA_PHP_SELF) as $part) { + // ignore parts that have no value + if (empty($part) || $part === '.') continue; + + if ($part !== '..') { + // cool, we found a new part + array_push($path, $part); + } elseif (count($path) > 0) { + // going back up? sure + array_pop($path); + } + // Here we intentionall ignore case where we go too up + // as there is nothing sane to do + } + + $PMA_PHP_SELF = htmlspecialchars('/' . join('/', $path)); + } + + /** + * Checks that required PHP extensions are there. + * @return void + */ + public static function checkExtensions() + { + /** + * Warning about mbstring. + */ + if (! function_exists('mb_detect_encoding')) { + self::warnMissingExtension('mbstring'); + } + + /** + * We really need this one! + */ + if (! function_exists('preg_replace')) { + self::warnMissingExtension('pcre', true); + } + + /** + * JSON is required in several places. + */ + if (! function_exists('json_encode')) { + self::warnMissingExtension('json', true); + } + + /** + * ctype is required for Twig. + */ + if (! function_exists('ctype_alpha')) { + self::warnMissingExtension('ctype', true); + } + + /** + * hash is required for cookie authentication. + */ + if (! function_exists('hash_hmac')) { + self::warnMissingExtension('hash', true); + } + } + + /** + * Gets the "true" IP address of the current user + * + * @return string the ip of the user + * + * @access private + */ + public static function getIp() + { + /* Get the address of user */ + if (empty($_SERVER['REMOTE_ADDR'])) { + /* We do not know remote IP */ + return false; + } + + $direct_ip = $_SERVER['REMOTE_ADDR']; + + /* Do we trust this IP as a proxy? If yes we will use it's header. */ + if (!isset($GLOBALS['cfg']['TrustedProxies'][$direct_ip])) { + /* Return true IP */ + return $direct_ip; + } + + /** + * Parse header in form: + * X-Forwarded-For: client, proxy1, proxy2 + */ + // Get header content + $value = self::getenv($GLOBALS['cfg']['TrustedProxies'][$direct_ip]); + // Grab first element what is client adddress + $value = explode(',', $value)[0]; + // checks that the header contains only one IP address, + $is_ip = filter_var($value, FILTER_VALIDATE_IP); + + if ($is_ip !== false) { + // True IP behind a proxy + return $value; + } + + // We could not parse header + return false; + } // end of the 'getIp()' function + + /** + * Sanitizes MySQL hostname + * + * * strips p: prefix(es) + * + * @param string $name User given hostname + * + * @return string + */ + public static function sanitizeMySQLHost($name) + { + while (strtolower(substr($name, 0, 2)) == 'p:') { + $name = substr($name, 2); + } + + return $name; + } + + /** + * Sanitizes MySQL username + * + * * strips part behind null byte + * + * @param string $name User given username + * + * @return string + */ + public static function sanitizeMySQLUser($name) + { + $position = strpos($name, chr(0)); + if ($position !== false) { + return substr($name, 0, $position); + } + return $name; + } + + /** + * Safe unserializer wrapper + * + * It does not unserialize data containing objects + * + * @param string $data Data to unserialize + * + * @return mixed + */ + public static function safeUnserialize($data) + { + if (! is_string($data)) { + return null; + } + + /* validate serialized data */ + $length = strlen($data); + $depth = 0; + for ($i = 0; $i < $length; $i++) { + $value = $data[$i]; + + switch ($value) + { + case '}': + /* end of array */ + if ($depth <= 0) { + return null; + } + $depth--; + break; + case 's': + /* string */ + // parse sting length + $strlen = intval(substr($data, $i + 2)); + // string start + $i = strpos($data, ':', $i + 2); + if ($i === false) { + return null; + } + // skip string, quotes and ; + $i += 2 + $strlen + 1; + if ($data[$i] != ';') { + return null; + } + break; + + case 'b': + case 'i': + case 'd': + /* bool, integer or double */ + // skip value to sepearator + $i = strpos($data, ';', $i); + if ($i === false) { + return null; + } + break; + case 'a': + /* array */ + // find array start + $i = strpos($data, '{', $i); + if ($i === false) { + return null; + } + // remember nesting + $depth++; + break; + case 'N': + /* null */ + // skip to end + $i = strpos($data, ';', $i); + if ($i === false) { + return null; + } + break; + default: + /* any other elements are not wanted */ + return null; + } + } + + // check unterminated arrays + if ($depth > 0) { + return null; + } + + return unserialize($data); + } + + /** + * Applies changes to PHP configuration. + * + * @return void + */ + public static function configure() + { + /** + * Set utf-8 encoding for PHP + */ + ini_set('default_charset', 'utf-8'); + mb_internal_encoding('utf-8'); + + /** + * Set precision to sane value, with higher values + * things behave slightly unexpectedly, for example + * round(1.2, 2) returns 1.199999999999999956. + */ + ini_set('precision', 14); + + /** + * check timezone setting + * this could produce an E_WARNING - but only once, + * if not done here it will produce E_WARNING on every date/time function + */ + date_default_timezone_set(@date_default_timezone_get()); + } + + /** + * Check whether PHP configuration matches our needs. + * + * @return void + */ + public static function checkConfiguration() + { + /** + * As we try to handle charsets by ourself, mbstring overloads just + * break it, see bug 1063821. + * + * We specifically use empty here as we are looking for anything else than + * empty value or 0. + */ + if (extension_loaded('mbstring') && !empty(ini_get('mbstring.func_overload'))) { + self::fatalError( + __( + 'You have enabled mbstring.func_overload in your PHP ' + . 'configuration. This option is incompatible with phpMyAdmin ' + . 'and might cause some data to be corrupted!' + ) + ); + } + + /** + * The ini_set and ini_get functions can be disabled using + * disable_functions but we're relying quite a lot of them. + */ + if (! function_exists('ini_get') || ! function_exists('ini_set')) { + self::fatalError( + __( + 'You have disabled ini_get and/or ini_set in php.ini. ' + . 'This option is incompatible with phpMyAdmin!' + ) + ); + } + } + + /** + * prints list item for main page + * + * @param string $name displayed text + * @param string $listId id, used for css styles + * @param string $url make item as link with $url as target + * @param string $mysql_help_page display a link to MySQL's manual + * @param string $target special target for $url + * @param string $a_id id for the anchor, + * used for jQuery to hook in functions + * @param string $class class for the li element + * @param string $a_class class for the anchor element + * + * @return void + */ + public static function printListItem($name, $listId = null, $url = null, + $mysql_help_page = null, $target = null, $a_id = null, $class = null, + $a_class = null + ) { + echo Template::get('list/item') + ->render( + array( + 'content' => $name, + 'id' => $listId, + 'class' => $class, + 'url' => array( + 'href' => $url, + 'target' => $target, + 'id' => $a_id, + 'class' => $a_class, + ), + 'mysql_help_page' => $mysql_help_page, + ) + ); + } + + /** + * Checks request and fails with fatal error if something problematic is found + * + * @return void + */ + public static function checkRequest() + { + if (isset($_REQUEST['GLOBALS']) || isset($_FILES['GLOBALS'])) { + self::fatalError(__("GLOBALS overwrite attempt")); + } + + /** + * protect against possible exploits - there is no need to have so much variables + */ + if (count($_REQUEST) > 1000) { + self::fatalError(__('possible exploit')); + } + } + + /** + * Sign the sql query using hmac using the session token + * + * @param string $sqlQuery The sql query + * @return string + */ + public static function signSqlQuery($sqlQuery) + { + /** @var array $cfg */ + global $cfg; + return hash_hmac('sha256', $sqlQuery, $_SESSION[' HMAC_secret '] . $cfg['blowfish_secret']); + } + + /** + * Check that the sql query has a valid hmac signature + * + * @param string $sqlQuery The sql query + * @param string $signature The Signature to check + * @return bool + */ + public static function checkSqlQuerySignature($sqlQuery, $signature) + { + /** @var array $cfg */ + global $cfg; + $hmac = hash_hmac('sha256', $sqlQuery, $_SESSION[' HMAC_secret '] . $cfg['blowfish_secret']); + return hash_equals($hmac, $signature); + } + + /** + * @return void + */ + public static function populateRequestWithEncryptedQueryParams() + { + if ( + (! isset($_GET['eq']) || ! is_string($_GET['eq'])) + && (! isset($_POST['eq']) || ! is_string($_POST['eq'])) + ) { + unset($_GET['eq'], $_POST['eq'], $_REQUEST['eq']); + return; + } + + $isFromPost = isset($_POST['eq']); + $decryptedQuery = Url::decryptQuery($isFromPost ? $_POST['eq'] : $_GET['eq']); + unset($_GET['eq'], $_POST['eq'], $_REQUEST['eq']); + if ($decryptedQuery === null) { + return; + } + + $urlQueryParams = (array) json_decode($decryptedQuery); + foreach ($urlQueryParams as $urlQueryParamKey => $urlQueryParamValue) { + if ($isFromPost) { + $_POST[$urlQueryParamKey] = $urlQueryParamValue; + } else { + $_GET[$urlQueryParamKey] = $urlQueryParamValue; + } + + $_REQUEST[$urlQueryParamKey] = $urlQueryParamValue; + } + } +} diff --git a/phpMyAdmin/libraries/classes/CreateAddField.php b/phpMyAdmin/libraries/classes/CreateAddField.php new file mode 100755 index 0000000..d80e4e2 --- /dev/null +++ b/phpMyAdmin/libraries/classes/CreateAddField.php @@ -0,0 +1,556 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\CreateAddField class + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Index; +use PhpMyAdmin\Table; +use PhpMyAdmin\Util; + +/** + * Set of functions for tbl_create.php and tbl_addfield.php + * + * @package PhpMyAdmin + */ +class CreateAddField +{ + /** + * @var DatabaseInterface + */ + private $dbi; + + /** + * Constructor + * + * @param DatabaseInterface $dbi DatabaseInterface interface + */ + public function __construct(DatabaseInterface $dbi) + { + $this->dbi = $dbi; + } + + /** + * Transforms the radio button field_key into 4 arrays + * + * @return array An array of arrays which represents column keys for each index type + */ + private function getIndexedColumns() + { + $fieldCount = count($_POST['field_name']); + $fieldPrimary = json_decode($_POST['primary_indexes'], true); + $fieldIndex = json_decode($_POST['indexes'], true); + $fieldUnique = json_decode($_POST['unique_indexes'], true); + $fieldFullText = json_decode($_POST['fulltext_indexes'], true); + $fieldSpatial = json_decode($_POST['spatial_indexes'], true); + + return [ + $fieldCount, + $fieldPrimary, + $fieldIndex, + $fieldUnique, + $fieldFullText, + $fieldSpatial, + ]; + } + + /** + * Initiate the column creation statement according to the table creation or + * add columns to a existing table + * + * @param int $fieldCount number of columns + * @param boolean $isCreateTable true if requirement is to get the statement + * for table creation + * + * @return array $definitions An array of initial sql statements + * according to the request + */ + private function buildColumnCreationStatement( + $fieldCount, + $isCreateTable = true + ) { + $definitions = []; + $previousField = -1; + for ($i = 0; $i < $fieldCount; ++$i) { + // '0' is also empty for php :-( + if (strlen($_POST['field_name'][$i]) === 0) { + continue; + } + + $definition = $this->getStatementPrefix($isCreateTable) . + Table::generateFieldSpec( + trim($_POST['field_name'][$i]), + $_POST['field_type'][$i], + $_POST['field_length'][$i], + $_POST['field_attribute'][$i], + isset($_POST['field_collation'][$i]) + ? $_POST['field_collation'][$i] + : '', + isset($_POST['field_null'][$i]) + ? $_POST['field_null'][$i] + : 'NO', + $_POST['field_default_type'][$i], + $_POST['field_default_value'][$i], + isset($_POST['field_extra'][$i]) + ? $_POST['field_extra'][$i] + : false, + isset($_POST['field_comments'][$i]) + ? $_POST['field_comments'][$i] + : '', + isset($_POST['field_virtuality'][$i]) + ? $_POST['field_virtuality'][$i] + : '', + isset($_POST['field_expression'][$i]) + ? $_POST['field_expression'][$i] + : '' + ); + + $definition .= $this->setColumnCreationStatementSuffix($i, $previousField, $isCreateTable); + $previousField = $i; + $definitions[] = $definition; + } // end for + + return $definitions; + } + + /** + * Set column creation suffix according to requested position of the new column + * + * @param int $currentFieldNumber current column number + * @param int $previousField previous field for ALTER statement + * @param boolean $isCreateTable true if requirement is to get the statement + * for table creation + * + * @return string $sqlSuffix suffix + */ + private function setColumnCreationStatementSuffix( + $currentFieldNumber, + $previousField, + $isCreateTable = true + ) { + // no suffix is needed if request is a table creation + $sqlSuffix = ' '; + if ($isCreateTable) { + return $sqlSuffix; + } + + if ((string) $_POST['field_where'] === 'last') { + return $sqlSuffix; + } + + // Only the first field can be added somewhere other than at the end + if ($previousField == -1) { + if ((string) $_POST['field_where'] === 'first') { + $sqlSuffix .= ' FIRST'; + } else if (! empty($_POST['after_field'])) { + $sqlSuffix .= ' AFTER ' + . Util::backquote($_POST['after_field']); + } + } else { + $sqlSuffix .= ' AFTER ' + . Util::backquote( + $_POST['field_name'][$previousField] + ); + } + + return $sqlSuffix; + } + + /** + * Create relevant index statements + * + * @param array $index an array of index columns + * @param string $indexChoice index choice that which represents + * the index type of $indexed_fields + * @param boolean $isCreateTable true if requirement is to get the statement + * for table creation + * + * @return array an array of sql statements for indexes + */ + private function buildIndexStatements( + array $index, + $indexChoice, + $isCreateTable = true + ) { + $statement = []; + if (!count($index)) { + return $statement; + } + + $sqlQuery = $this->getStatementPrefix($isCreateTable) + . ' ' . $indexChoice; + + if (! empty($index['Key_name']) && $index['Key_name'] != 'PRIMARY') { + $sqlQuery .= ' ' . Util::backquote($index['Key_name']); + } + + $indexFields = []; + foreach ($index['columns'] as $key => $column) { + $indexFields[$key] = Util::backquote( + $_POST['field_name'][$column['col_index']] + ); + if ($column['size']) { + $indexFields[$key] .= '(' . $column['size'] . ')'; + } + } + + $sqlQuery .= ' (' . implode(', ', $indexFields) . ')'; + + $keyBlockSizes = $index['Key_block_size']; + if (! empty($keyBlockSizes)) { + $sqlQuery .= " KEY_BLOCK_SIZE = " + . $this->dbi->escapeString($keyBlockSizes); + } + + // specifying index type is allowed only for primary, unique and index only + $type = $index['Index_type']; + if ($index['Index_choice'] != 'SPATIAL' + && $index['Index_choice'] != 'FULLTEXT' + && in_array($type, Index::getIndexTypes()) + ) { + $sqlQuery .= ' USING ' . $type; + } + + $parser = $index['Parser']; + if ($index['Index_choice'] == 'FULLTEXT' && ! empty($parser)) { + $sqlQuery .= " WITH PARSER " . $this->dbi->escapeString($parser); + } + + $comment = $index['Index_comment']; + if (! empty($comment)) { + $sqlQuery .= " COMMENT '" . $this->dbi->escapeString($comment) + . "'"; + } + + $statement[] = $sqlQuery; + + return $statement; + } + + /** + * Statement prefix for the buildColumnCreationStatement() + * + * @param boolean $isCreateTable true if requirement is to get the statement + * for table creation + * + * @return string $sqlPrefix prefix + */ + private function getStatementPrefix($isCreateTable = true) + { + $sqlPrefix = " "; + if (! $isCreateTable) { + $sqlPrefix = ' ADD '; + } + return $sqlPrefix; + } + + /** + * Merge index definitions for one type of index + * + * @param array $definitions the index definitions to merge to + * @param boolean $isCreateTable true if requirement is to get the statement + * for table creation + * @param array $indexedColumns the columns for one type of index + * @param string $indexKeyword the index keyword to use in the definition + * + * @return array $index_definitions + */ + private function mergeIndexStatements( + array $definitions, + $isCreateTable, + array $indexedColumns, + $indexKeyword + ) { + foreach ($indexedColumns as $index) { + $statements = $this->buildIndexStatements( + $index, + " " . $indexKeyword . " ", + $isCreateTable + ); + $definitions = array_merge($definitions, $statements); + } + return $definitions; + } + + /** + * Returns sql statement according to the column and index specifications as + * requested + * + * @param boolean $isCreateTable true if requirement is to get the statement + * for table creation + * + * @return string sql statement + */ + private function getColumnCreationStatements($isCreateTable = true) + { + $sqlStatement = ""; + list( + $fieldCount, + $fieldPrimary, + $fieldIndex, + $fieldUnique, + $fieldFullText, + $fieldSpatial + ) = $this->getIndexedColumns(); + $definitions = $this->buildColumnCreationStatement( + $fieldCount, + $isCreateTable + ); + + // Builds the PRIMARY KEY statements + $primaryKeyStatements = $this->buildIndexStatements( + isset($fieldPrimary[0]) ? $fieldPrimary[0] : [], + " PRIMARY KEY ", + $isCreateTable + ); + $definitions = array_merge($definitions, $primaryKeyStatements); + + // Builds the INDEX statements + $definitions = $this->mergeIndexStatements( + $definitions, + $isCreateTable, + $fieldIndex, + "INDEX" + ); + + // Builds the UNIQUE statements + $definitions = $this->mergeIndexStatements( + $definitions, + $isCreateTable, + $fieldUnique, + "UNIQUE" + ); + + // Builds the FULLTEXT statements + $definitions = $this->mergeIndexStatements( + $definitions, + $isCreateTable, + $fieldFullText, + "FULLTEXT" + ); + + // Builds the SPATIAL statements + $definitions = $this->mergeIndexStatements( + $definitions, + $isCreateTable, + $fieldSpatial, + "SPATIAL" + ); + + if (count($definitions)) { + $sqlStatement = implode(', ', $definitions); + } + $sqlStatement = preg_replace('@, $@', '', $sqlStatement); + + return $sqlStatement; + } + + /** + * Returns the partitioning clause + * + * @return string partitioning clause + */ + public function getPartitionsDefinition() + { + $sqlQuery = ""; + if (! empty($_POST['partition_by']) + && ! empty($_POST['partition_expr']) + && ! empty($_POST['partition_count']) + && $_POST['partition_count'] > 1 + ) { + $sqlQuery .= " PARTITION BY " . $_POST['partition_by'] + . " (" . $_POST['partition_expr'] . ")" + . " PARTITIONS " . $_POST['partition_count']; + } + + if (! empty($_POST['subpartition_by']) + && ! empty($_POST['subpartition_expr']) + && ! empty($_POST['subpartition_count']) + && $_POST['subpartition_count'] > 1 + ) { + $sqlQuery .= " SUBPARTITION BY " . $_POST['subpartition_by'] + . " (" . $_POST['subpartition_expr'] . ")" + . " SUBPARTITIONS " . $_POST['subpartition_count']; + } + + if (! empty($_POST['partitions'])) { + $i = 0; + $partitions = []; + foreach ($_POST['partitions'] as $partition) { + $partitions[] = $this->getPartitionDefinition($partition); + $i++; + } + $sqlQuery .= " (" . implode(", ", $partitions) . ")"; + } + + return $sqlQuery; + } + + /** + * Returns the definition of a partition/subpartition + * + * @param array $partition array of partition/subpartition detiails + * @param boolean $isSubPartition whether a subpartition + * + * @return string partition/subpartition definition + */ + private function getPartitionDefinition(array $partition, $isSubPartition = false) + { + $sqlQuery = " " . ($isSubPartition ? "SUB" : "") . "PARTITION "; + $sqlQuery .= $partition['name']; + + if (! empty($partition['value_type'])) { + $sqlQuery .= " VALUES " . $partition['value_type']; + + if ($partition['value_type'] != 'LESS THAN MAXVALUE') { + $sqlQuery .= " (" . $partition['value'] . ")"; + } + } + + if (! empty($partition['engine'])) { + $sqlQuery .= " ENGINE = " . $partition['engine']; + } + if (! empty($partition['comment'])) { + $sqlQuery .= " COMMENT = '" . $partition['comment'] . "'"; + } + if (! empty($partition['data_directory'])) { + $sqlQuery .= " DATA DIRECTORY = '" . $partition['data_directory'] . "'"; + } + if (! empty($partition['index_directory'])) { + $sqlQuery .= " INDEX_DIRECTORY = '" . $partition['index_directory'] . "'"; + } + if (! empty($partition['max_rows'])) { + $sqlQuery .= " MAX_ROWS = " . $partition['max_rows']; + } + if (! empty($partition['min_rows'])) { + $sqlQuery .= " MIN_ROWS = " . $partition['min_rows']; + } + if (! empty($partition['tablespace'])) { + $sqlQuery .= " TABLESPACE = " . $partition['tablespace']; + } + if (! empty($partition['node_group'])) { + $sqlQuery .= " NODEGROUP = " . $partition['node_group']; + } + + if (! empty($partition['subpartitions'])) { + $j = 0; + $subpartitions = []; + foreach ($partition['subpartitions'] as $subpartition) { + $subpartitions[] = $this->getPartitionDefinition( + $subpartition, + true + ); + $j++; + } + $sqlQuery .= " (" . implode(", ", $subpartitions) . ")"; + } + + return $sqlQuery; + } + + /** + * Function to get table creation sql query + * + * @param string $db database name + * @param string $table table name + * + * @return string + */ + public function getTableCreationQuery($db, $table) + { + // get column addition statements + $sqlStatement = $this->getColumnCreationStatements(true); + + // Builds the 'create table' statement + $sqlQuery = 'CREATE TABLE ' . Util::backquote($db) . '.' + . Util::backquote(trim($table)) . ' (' . $sqlStatement . ')'; + + // Adds table type, character set, comments and partition definition + if (!empty($_POST['tbl_storage_engine']) + && ($_POST['tbl_storage_engine'] != 'Default') + ) { + $sqlQuery .= ' ENGINE = ' . $_POST['tbl_storage_engine']; + } + if (!empty($_POST['tbl_collation'])) { + $sqlQuery .= Util::getCharsetQueryPart($_POST['tbl_collation']); + } + if (! empty($_POST['connection']) + && ! empty($_POST['tbl_storage_engine']) + && $_POST['tbl_storage_engine'] == 'FEDERATED' + ) { + $sqlQuery .= " CONNECTION = '" + . $this->dbi->escapeString($_POST['connection']) . "'"; + } + if (!empty($_POST['comment'])) { + $sqlQuery .= ' COMMENT = \'' + . $this->dbi->escapeString($_POST['comment']) . '\''; + } + $sqlQuery .= $this->getPartitionsDefinition(); + $sqlQuery .= ';'; + + return $sqlQuery; + } + + /** + * Function to get the number of fields for the table creation form + * + * @return int + */ + public function getNumberOfFieldsFromRequest() + { + // Limit to 4096 fields (MySQL maximal value) + $mysqlLimit = 4096; + + if (isset($_POST['submit_num_fields'])) { // adding new fields + $numberOfFields = intval($_POST['orig_num_fields']) + intval($_POST['added_fields']); + } elseif (isset($_POST['orig_num_fields'])) { // retaining existing fields + $numberOfFields = intval($_POST['orig_num_fields']); + } elseif (isset($_POST['num_fields']) + && intval($_POST['num_fields']) > 0 + ) { // new table with specified number of fields + $numberOfFields = intval($_POST['num_fields']); + } else { // new table with unspecified number of fields + $numberOfFields = 4; + } + + return min($numberOfFields, $mysqlLimit); + } + + /** + * Function to execute the column creation statement + * + * @param string $db current database + * @param string $table current table + * @param string $errorUrl error page url + * + * @return array + */ + public function tryColumnCreationQuery($db, $table, $errorUrl) + { + // get column addition statements + $sqlStatement = $this->getColumnCreationStatements(false); + + // To allow replication, we first select the db to use and then run queries + // on this db. + if (!($this->dbi->selectDb($db))) { + Util::mysqlDie( + $this->dbi->getError(), + 'USE ' . Util::backquote($db), + false, + $errorUrl + ); + } + $sqlQuery = 'ALTER TABLE ' . + Util::backquote($table) . ' ' . $sqlStatement . ';'; + // If there is a request for SQL previewing. + if (isset($_POST['preview_sql'])) { + Core::previewSQL($sqlQuery); + } + return [$this->dbi->tryQuery($sqlQuery), $sqlQuery]; + } +} diff --git a/phpMyAdmin/libraries/classes/Crypto/Crypto.php b/phpMyAdmin/libraries/classes/Crypto/Crypto.php new file mode 100755 index 0000000..f0ef18e --- /dev/null +++ b/phpMyAdmin/libraries/classes/Crypto/Crypto.php @@ -0,0 +1,161 @@ +<?php + +namespace PhpMyAdmin\Crypto; + +use Exception; +use phpseclib\Crypt\AES; +use phpseclib\Crypt\Random; + +final class Crypto +{ + /** @var bool */ + private $hasRandomBytesSupport; + + /** @var bool */ + private $hasSodiumSupport; + + /** + * @param bool $forceFallback Force the usage of the fallback functions. + */ + public function __construct($forceFallback = false) + { + $this->hasRandomBytesSupport = ! $forceFallback && is_callable('random_bytes'); + $this->hasSodiumSupport = ! $forceFallback + && $this->hasRandomBytesSupport + && is_callable('sodium_crypto_secretbox') + && is_callable('sodium_crypto_secretbox_open') + && defined('SODIUM_CRYPTO_SECRETBOX_NONCEBYTES') + && defined('SODIUM_CRYPTO_SECRETBOX_KEYBYTES'); + } + + /** + * @param string $plaintext + * + * @return string + */ + public function encrypt($plaintext) + { + if ($this->hasSodiumSupport) { + return $this->encryptWithSodium($plaintext); + } + + return $this->encryptWithPhpseclib($plaintext); + } + + /** + * @param string $ciphertext + * + * @return string + */ + public function decrypt($ciphertext) + { + if ($this->hasSodiumSupport) { + return $this->decryptWithSodium($ciphertext); + } + + return $this->decryptWithPhpseclib($ciphertext); + } + + /** + * @return string + */ + private function getEncryptionKey() + { + global $PMA_Config; + + $keyLength = $this->hasSodiumSupport ? SODIUM_CRYPTO_SECRETBOX_KEYBYTES : 32; + + $key = $PMA_Config->get('URLQueryEncryptionSecretKey'); + if (is_string($key) && mb_strlen($key, '8bit') === $keyLength) { + return $key; + } + + $key = isset($_SESSION['URLQueryEncryptionSecretKey']) ? $_SESSION['URLQueryEncryptionSecretKey'] : null; + if (is_string($key) && mb_strlen($key, '8bit') === $keyLength) { + return $key; + } + + $key = $this->hasRandomBytesSupport ? random_bytes($keyLength) : Random::string($keyLength); + $_SESSION['URLQueryEncryptionSecretKey'] = $key; + + return $key; + } + + /** + * @param string $plaintext + * + * @return string + */ + private function encryptWithPhpseclib($plaintext) + { + $key = $this->getEncryptionKey(); + $cipher = new AES(AES::MODE_CBC); + $iv = $this->hasRandomBytesSupport ? random_bytes(16) : Random::string(16); + $cipher->setIV($iv); + $cipher->setKey($key); + $ciphertext = $cipher->encrypt($plaintext); + $hmac = hash_hmac('sha256', $iv . $ciphertext, $key, true); + + return $hmac . $iv . $ciphertext; + } + + /** + * @param string $encrypted + * + * @return string|null + */ + private function decryptWithPhpseclib($encrypted) + { + $key = $this->getEncryptionKey(); + $hmac = mb_substr($encrypted, 0, 32, '8bit'); + $iv = mb_substr($encrypted, 32, 16, '8bit'); + $ciphertext = mb_substr($encrypted, 48, null, '8bit'); + $calculatedHmac = hash_hmac('sha256', $iv . $ciphertext, $key, true); + if (! hash_equals($hmac, $calculatedHmac)) { + return null; + } + + $cipher = new AES(AES::MODE_CBC); + $cipher->setIV($iv); + $cipher->setKey($key); + + return $cipher->decrypt($ciphertext); + } + + /** + * @param string $plaintext + * + * @return string + */ + private function encryptWithSodium($plaintext) + { + $key = $this->getEncryptionKey(); + $nonce = random_bytes(SODIUM_CRYPTO_SECRETBOX_NONCEBYTES); + $ciphertext = sodium_crypto_secretbox($plaintext, $nonce, $key); + + return $nonce . $ciphertext; + } + + /** + * @param string $encrypted + * + * @return string|null + */ + private function decryptWithSodium($encrypted) + { + $key = $this->getEncryptionKey(); + $nonce = mb_substr($encrypted, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, '8bit'); + $ciphertext = mb_substr($encrypted, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit'); + try { + $decrypted = sodium_crypto_secretbox_open($ciphertext, $nonce, $key); + } catch (Exception $e) { + return null; + } + + if ($decrypted === false) { + return null; + } + + return $decrypted; + } +} diff --git a/phpMyAdmin/libraries/classes/Database/DatabaseList.php b/phpMyAdmin/libraries/classes/Database/DatabaseList.php new file mode 100755 index 0000000..ab4c659 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Database/DatabaseList.php @@ -0,0 +1,58 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * holds the PhpMyAdmin\Database\DatabaseList class + * + * @package PhpMyAdmin + * + */ +namespace PhpMyAdmin\Database; + +use PhpMyAdmin\ListDatabase; + +/** + * holds the DatabaseList class + * + * @package PhpMyAdmin + */ +class DatabaseList +{ + /** + * Holds database list + * + * @var ListDatabase + */ + protected $databases = null; + + /** + * magic access to protected/inaccessible members/properties + * + * @param string $param parameter name + * + * @return mixed + * @see https://www.php.net/language.oop5.overloading + */ + public function __get($param) + { + switch ($param) { + case 'databases' : + return $this->getDatabaseList(); + } + + return null; + } + + /** + * Accessor to PMA::$databases + * + * @return ListDatabase + */ + public function getDatabaseList() + { + if (null === $this->databases) { + $this->databases = new ListDatabase(); + } + + return $this->databases; + } +} diff --git a/phpMyAdmin/libraries/classes/Database/Designer.php b/phpMyAdmin/libraries/classes/Database/Designer.php new file mode 100755 index 0000000..75da91e --- /dev/null +++ b/phpMyAdmin/libraries/classes/Database/Designer.php @@ -0,0 +1,432 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Database\Designer class + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Database; + +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Message; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\SchemaPlugin; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Template; +use PhpMyAdmin\Util; + +/** + * Set of functions related to database designer + * + * @package PhpMyAdmin + */ +class Designer +{ + /** + * @var Relation $relation + */ + private $relation; + + /** + * Constructor + */ + public function __construct() + { + $this->relation = new Relation(); + } + + /** + * Function to get html for displaying the page edit/delete form + * + * @param string $db database name + * @param string $operation 'edit' or 'delete' depending on the operation + * + * @return string html content + */ + public function getHtmlForEditOrDeletePages($db, $operation) + { + $cfgRelation = $this->relation->getRelationsParam(); + return Template::get('database/designer/edit_delete_pages')->render([ + 'db' => $db, + 'operation' => $operation, + 'pdfwork' => $cfgRelation['pdfwork'], + 'pages' => $this->getPageIdsAndNames($db), + ]); + } + + /** + * Function to get html for displaying the page save as form + * + * @param string $db database name + * + * @return string html content + */ + public function getHtmlForPageSaveAs($db) + { + $cfgRelation = $this->relation->getRelationsParam(); + return Template::get('database/designer/page_save_as')->render([ + 'db' => $db, + 'pdfwork' => $cfgRelation['pdfwork'], + 'pages' => $this->getPageIdsAndNames($db), + ]); + } + + /** + * Retrieve IDs and names of schema pages + * + * @param string $db database name + * + * @return array array of schema page id and names + */ + private function getPageIdsAndNames($db) + { + $result = []; + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['pdfwork']) { + return $result; + } + + $page_query = "SELECT `page_nr`, `page_descr` FROM " + . Util::backquote($cfgRelation['db']) . "." + . Util::backquote($cfgRelation['pdf_pages']) + . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($db) . "'" + . " ORDER BY `page_descr`"; + $page_rs = $this->relation->queryAsControlUser( + $page_query, + false, + DatabaseInterface::QUERY_STORE + ); + + while ($curr_page = $GLOBALS['dbi']->fetchAssoc($page_rs)) { + $result[intval($curr_page['page_nr'])] = $curr_page['page_descr']; + } + return $result; + } + + /** + * Function to get html for displaying the schema export + * + * @param string $db database name + * @param int $page the page to be exported + * + * @return string + */ + public function getHtmlForSchemaExport($db, $page) + { + /* Scan for schema plugins */ + /* @var $export_list SchemaPlugin[] */ + $export_list = Plugins::getPlugins( + "schema", + 'libraries/classes/Plugins/Schema/', + null + ); + + /* Fail if we didn't find any schema plugin */ + if (empty($export_list)) { + return Message::error( + __('Could not load schema plugins, please check your installation!') + )->getDisplay(); + } + + return Template::get('database/designer/schema_export') + ->render( + [ + 'db' => $db, + 'page' => $page, + 'export_list' => $export_list + ] + ); + } + + /** + * Returns HTML for including some variable to be accessed by JavaScript + * + * @param array $script_tables array on foreign key support for each table + * @param array $script_contr initialization data array + * @param Designer\DesignerTable[] $script_display_field displayed tables in designer with their display fields + * @param int $display_page page number of the selected page + * + * @return string html + */ + public function getHtmlForJsFields( + array $script_tables, + array $script_contr, + array $script_display_field, + $display_page + ) { + $displayedFields = []; + foreach ($script_display_field as $designerTable) { + if ($designerTable->getDisplayField() !== null) { + $displayedFields[$designerTable->getTableName()] = $designerTable->getDisplayField(); + } + } + $cfgRelation = $this->relation->getRelationsParam(); + $designerConfig = new \stdClass(); + $designerConfig->db = $_GET['db']; + $designerConfig->scriptTables = $script_tables; + $designerConfig->scriptContr = $script_contr; + $designerConfig->server = $GLOBALS['server']; + $designerConfig->scriptDisplayField = $displayedFields; + $designerConfig->displayPage = (int) $display_page; + $designerConfig->tablesEnabled = $cfgRelation['pdfwork']; + return Template::get('database/designer/js_fields')->render([ + 'designer_config' => json_encode($designerConfig) + ]); + } + + /** + * Returns HTML for the menu bar of the designer page + * + * @param boolean $visualBuilder whether this is visual query builder + * @param string $selectedPage name of the selected page + * @param array $paramsArray array with class name for various buttons + * on side menu + * + * @return string html + */ + public function getPageMenu($visualBuilder, $selectedPage, array $paramsArray) + { + return Template::get('database/designer/side_menu')->render([ + 'visual_builder' => $visualBuilder, + 'selected_page' => $selectedPage, + 'params_array' => $paramsArray, + 'theme' => $GLOBALS['PMA_Theme'], + ]); + } + + /** + * Returns array of stored values of Designer Settings + * + * @return array stored values + */ + private function getSideMenuParamsArray() + { + $params = []; + + $cfgRelation = $this->relation->getRelationsParam(); + + if ($cfgRelation['designersettingswork']) { + $query = 'SELECT `settings_data` FROM ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['designer_settings']) + . ' WHERE ' . Util::backquote('username') . ' = "' + . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) + . '";'; + + $result = $GLOBALS['dbi']->fetchSingleRow($query); + + $params = json_decode($result['settings_data'], true); + } + + return $params; + } + + /** + * Returns class names for various buttons on Designer Side Menu + * + * @return array class names of various buttons + */ + public function returnClassNamesFromMenuButtons() + { + $classes_array = []; + $params_array = $this->getSideMenuParamsArray(); + + if (isset($params_array['angular_direct']) + && $params_array['angular_direct'] == 'angular' + ) { + $classes_array['angular_direct'] = 'M_butt_Selected_down'; + } else { + $classes_array['angular_direct'] = 'M_butt'; + } + + if (isset($params_array['snap_to_grid']) + && $params_array['snap_to_grid'] == 'on' + ) { + $classes_array['snap_to_grid'] = 'M_butt_Selected_down'; + } else { + $classes_array['snap_to_grid'] = 'M_butt'; + } + + if (isset($params_array['pin_text']) + && $params_array['pin_text'] == 'true' + ) { + $classes_array['pin_text'] = 'M_butt_Selected_down'; + } else { + $classes_array['pin_text'] = 'M_butt'; + } + + if (isset($params_array['relation_lines']) + && $params_array['relation_lines'] == 'false' + ) { + $classes_array['relation_lines'] = 'M_butt_Selected_down'; + } else { + $classes_array['relation_lines'] = 'M_butt'; + } + + if (isset($params_array['small_big_all']) + && $params_array['small_big_all'] == 'v' + ) { + $classes_array['small_big_all'] = 'M_butt_Selected_down'; + } else { + $classes_array['small_big_all'] = 'M_butt'; + } + + if (isset($params_array['side_menu']) + && $params_array['side_menu'] == 'true' + ) { + $classes_array['side_menu'] = 'M_butt_Selected_down'; + } else { + $classes_array['side_menu'] = 'M_butt'; + } + + return $classes_array; + } + + /** + * Returns HTML for the canvas element + * + * @return string html + */ + public function getHtmlCanvas() + { + return Template::get('database/designer/canvas')->render(); + } + + /** + * Return HTML for the table list + * + * @return string html + */ + public function getHtmlTableList() + { + return Template::get('database/designer/table_list')->render([ + 'theme' => $GLOBALS['PMA_Theme'], + ]); + } + + /** + * Get HTML to display tables on designer page + * + * @param string $db The database name from the request + * @param array $designerTables The designer tables + * @param array $tab_pos tables positions + * @param int $display_page page number of the selected page + * @param array $tab_column table column info + * @param array $tables_all_keys all indices + * @param array $tables_pk_or_unique_keys unique or primary indices + * + * @return string html + */ + public function getDatabaseTables( + $db, + array $designerTables, + array $tab_pos, + $display_page, + array $tab_column, + array $tables_all_keys, + array $tables_pk_or_unique_keys + ) { + return Template::get('database/designer/database_tables')->render([ + 'db' => $GLOBALS['db'], + 'get_db' => $db, + 'has_query' => isset($_REQUEST['query']), + 'tab_pos' => $tab_pos, + 'display_page' => $display_page, + 'tab_column' => $tab_column, + 'tables_all_keys' => $tables_all_keys, + 'tables_pk_or_unique_keys' => $tables_pk_or_unique_keys, + 'tables' => $designerTables, + 'theme' => $GLOBALS['PMA_Theme'], + ]); + } + + /** + * Returns HTML for the new relations panel. + * + * @return string html + */ + public function getNewRelationPanel() + { + return Template::get('database/designer/new_relation_panel') + ->render(); + } + + /** + * Returns HTML for the relations delete panel + * + * @return string html + */ + public function getDeleteRelationPanel() + { + return Template::get('database/designer/delete_relation_panel') + ->render(); + } + + /** + * Returns HTML for the options panel + * + * @return string html + */ + public function getOptionsPanel() + { + return Template::get('database/designer/options_panel')->render(); + } + + /** + * Get HTML for the 'rename to' panel + * + * @return string html + */ + public function getRenameToPanel() + { + return Template::get('database/designer/rename_to_panel') + ->render(); + } + + /** + * Returns HTML for the 'having' panel + * + * @return string html + */ + public function getHavingQueryPanel() + { + return Template::get('database/designer/having_query_panel') + ->render(); + } + + /** + * Returns HTML for the 'aggregate' panel + * + * @return string html + */ + public function getAggregateQueryPanel() + { + return Template::get('database/designer/aggregate_query_panel') + ->render(); + } + + /** + * Returns HTML for the 'where' panel + * + * @return string html + */ + public function getWhereQueryPanel() + { + return Template::get('database/designer/where_query_panel') + ->render(); + } + + /** + * Returns HTML for the query details panel + * + * @param string $db Database name + * + * @return string html + */ + public function getQueryDetails($db) + { + return Template::get('database/designer/query_details')->render([ + 'db' => $db, + ]); + } +} diff --git a/phpMyAdmin/libraries/classes/Database/Designer/Common.php b/phpMyAdmin/libraries/classes/Database/Designer/Common.php new file mode 100755 index 0000000..6a395e8 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Database/Designer/Common.php @@ -0,0 +1,792 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Database\Designer\Common class + * + * @package PhpMyAdmin-Designer + */ +namespace PhpMyAdmin\Database\Designer; + +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Index; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Table; +use PhpMyAdmin\Util; +use PhpMyAdmin\Database\Designer\DesignerTable; + +/** + * Common functions for Designer + * + * @package PhpMyAdmin-Designer + */ +class Common +{ + /** + * @var Relation $relation + */ + private $relation; + + /** + * Constructor + */ + public function __construct() + { + $this->relation = new Relation(); + } + + /** + * Retrieves table info and returns it + * + * @param string $db (optional) Filter only a DB ($table is required if you use $db) + * @param string $table (optional) Filter only a table ($db is now required) + * @return DesignerTable[] with table info + */ + public function getTablesInfo($db = null, $table = null) + { + $designerTables = array(); + $db = ($db === null) ? $GLOBALS['db'] : $db; + // seems to be needed later + $GLOBALS['dbi']->selectDb($db); + if ($db === null && $table === null) { + $tables = $GLOBALS['dbi']->getTablesFull($db); + } else { + $tables = $GLOBALS['dbi']->getTablesFull($db, $table); + } + + foreach ($tables as $one_table) { + $DF = $this->relation->getDisplayField($db, $one_table['TABLE_NAME']); + $DF = is_string($DF) ? $DF : ''; + $DF = ($DF !== '') ? $DF : null; + $designerTables[] = new DesignerTable( + $db, + $one_table['TABLE_NAME'], + is_string($one_table['ENGINE']) ? $one_table['ENGINE'] : '', + $DF + ); + } + + return $designerTables; + } + + /** + * Retrieves table column info + * + * @param DesignerTable[] $designerTables The designer tables + * @return array table column nfo + */ + public function getColumnsInfo($designerTables) + { + //$GLOBALS['dbi']->selectDb($GLOBALS['db']); + $tabColumn = array(); + + foreach($designerTables as $designerTable) { + $fieldsRs = $GLOBALS['dbi']->query( + $GLOBALS['dbi']->getColumnsSql( + $designerTable->getDatabaseName(), + $designerTable->getTableName(), + null, + true + ), + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + $j = 0; + while ($row = $GLOBALS['dbi']->fetchAssoc($fieldsRs)) { + if (! isset($tabColumn[$designerTable->getDbTableString()])) { + $tabColumn[$designerTable->getDbTableString()] = []; + } + $tabColumn[$designerTable->getDbTableString()]['COLUMN_ID'][$j] = $j; + $tabColumn[$designerTable->getDbTableString()]['COLUMN_NAME'][$j] = $row['Field']; + $tabColumn[$designerTable->getDbTableString()]['TYPE'][$j] = $row['Type']; + $tabColumn[$designerTable->getDbTableString()]['NULLABLE'][$j] = $row['Null']; + $j++; + } + } + + return $tabColumn; + } + + /** + * Returns JavaScript code for initializing vars + * + * @param DesignerTable[] $designerTables The designer tables + * @return string JavaScript code + */ + public function getScriptContr($designerTables) + { + $GLOBALS['dbi']->selectDb($GLOBALS['db']); + $con = array(); + $con["C_NAME"] = array(); + $i = 0; + $alltab_rs = $GLOBALS['dbi']->query( + 'SHOW TABLES FROM ' . Util::backquote($GLOBALS['db']), + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + while ($val = @$GLOBALS['dbi']->fetchRow($alltab_rs)) { + $row = $this->relation->getForeigners($GLOBALS['db'], $val[0], '', 'internal'); + + if ($row !== false) { + foreach ($row as $field => $value) { + $con['C_NAME'][$i] = ''; + $con['DTN'][$i] = rawurlencode($GLOBALS['db'] . "." . $val[0]); + $con['DCN'][$i] = rawurlencode($field); + $con['STN'][$i] = rawurlencode( + $value['foreign_db'] . "." . $value['foreign_table'] + ); + $con['SCN'][$i] = rawurlencode($value['foreign_field']); + $i++; + } + } + $row = $this->relation->getForeigners($GLOBALS['db'], $val[0], '', 'foreign'); + + // We do not have access to the foreign keys if he user has partial access to the columns + if ($row !== false && isset($row['foreign_keys_data'])) { + foreach ($row['foreign_keys_data'] as $one_key) { + foreach ($one_key['index_list'] as $index => $one_field) { + $con['C_NAME'][$i] = rawurlencode($one_key['constraint']); + $con['DTN'][$i] = rawurlencode($GLOBALS['db'] . "." . $val[0]); + $con['DCN'][$i] = rawurlencode($one_field); + $con['STN'][$i] = rawurlencode( + (isset($one_key['ref_db_name']) ? + $one_key['ref_db_name'] : $GLOBALS['db']) + . "." . $one_key['ref_table_name'] + ); + $con['SCN'][$i] = rawurlencode($one_key['ref_index_list'][$index]); + $i++; + } + } + } + } + + $tableDbNames = []; + foreach($designerTables as $designerTable) { + $tableDbNames[] = $designerTable->getDbTableString(); + } + + $ti = 0; + $retval = array(); + for ($i = 0, $cnt = count($con["C_NAME"]); $i < $cnt; $i++) { + $c_name_i = $con['C_NAME'][$i]; + $dtn_i = $con['DTN'][$i]; + $retval[$ti] = array(); + $retval[$ti][$c_name_i] = array(); + if (in_array($dtn_i, $tableDbNames) && in_array($con['STN'][$i], $tableDbNames)) { + $retval[$ti][$c_name_i][$dtn_i] = array(); + $retval[$ti][$c_name_i][$dtn_i][$con['DCN'][$i]] = array( + 0 => $con['STN'][$i], + 1 => $con['SCN'][$i] + ); + } + $ti++; + } + return $retval; + } + + /** + * Returns UNIQUE and PRIMARY indices + * + * @param DesignerTable[] $designerTables The designer tables + * @return array unique or primary indices + */ + public function getPkOrUniqueKeys($designerTables) + { + return $this->getAllKeys($designerTables, true); + } + + /** + * Returns all indices + * + * @param DesignerTable[] $designerTables The designer tables + * @param bool $unique_only whether to include only unique ones + * + * @return array indices + */ + public function getAllKeys($designerTables, $unique_only = false) + { + $keys = array(); + + foreach ($designerTables as $designerTable) { + $schema = $designerTable->getDatabaseName(); + // for now, take into account only the first index segment + foreach (Index::getFromTable($designerTable->getTableName(), $schema) as $index) { + if ($unique_only && ! $index->isUnique()) { + continue; + } + $columns = $index->getColumns(); + foreach ($columns as $column_name => $dummy) { + $keys[$schema . '.' . $designerTable->getTableName() . '.' . $column_name] = 1; + } + } + } + return $keys; + } + + /** + * Return j_tab and h_tab arrays + * + * @param DesignerTable[] $designerTables The designer tables + * @return array + */ + public function getScriptTabs($designerTables) + { + $retval = array( + 'j_tabs' => array(), + 'h_tabs' => array() + ); + + foreach($designerTables as $designerTable) { + $key = rawurlencode($designerTable->getDbTableString()); + $retval['j_tabs'][$key] = $designerTable->supportsForeignkeys() ? 1 : 0; + $retval['h_tabs'][$key] = 1; + } + + return $retval; + } + + /** + * Returns table positions of a given pdf page + * + * @param int $pg pdf page id + * + * @return array of table positions + */ + public function getTablePositions($pg) + { + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['pdfwork']) { + return array(); + } + + $query = " + SELECT CONCAT_WS('.', `db_name`, `table_name`) AS `name`, + `db_name` as `dbName`, `table_name` as `tableName`, + `x` AS `X`, + `y` AS `Y`, + 1 AS `V`, + 1 AS `H` + FROM " . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['table_coords']) . " + WHERE pdf_page_number = " . intval($pg); + + $tab_pos = $GLOBALS['dbi']->fetchResult( + $query, + 'name', + null, + DatabaseInterface::CONNECT_CONTROL, + DatabaseInterface::QUERY_STORE + ); + return $tab_pos; + } + + /** + * Returns page name of a given pdf page + * + * @param int $pg pdf page id + * + * @return string|null table name + */ + public function getPageName($pg) + { + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['pdfwork']) { + return null; + } + + $query = "SELECT `page_descr`" + . " FROM " . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['pdf_pages']) + . " WHERE " . Util::backquote('page_nr') . " = " . intval($pg); + $page_name = $GLOBALS['dbi']->fetchResult( + $query, + null, + null, + DatabaseInterface::CONNECT_CONTROL, + DatabaseInterface::QUERY_STORE + ); + return ( is_array($page_name) && isset($page_name[0]) ) ? $page_name[0] : null; + } + + /** + * Deletes a given pdf page and its corresponding coordinates + * + * @param int $pg page id + * + * @return boolean success/failure + */ + public function deletePage($pg) + { + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['pdfwork']) { + return false; + } + + $query = "DELETE FROM " . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['table_coords']) + . " WHERE " . Util::backquote('pdf_page_number') . " = " . intval($pg); + $success = $this->relation->queryAsControlUser( + $query, true, DatabaseInterface::QUERY_STORE + ); + + if ($success) { + $query = "DELETE FROM " . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['pdf_pages']) + . " WHERE " . Util::backquote('page_nr') . " = " . intval($pg); + $success = $this->relation->queryAsControlUser( + $query, true, DatabaseInterface::QUERY_STORE + ); + } + + return (boolean) $success; + } + + /** + * Returns the id of the default pdf page of the database. + * Default page is the one which has the same name as the database. + * + * @param string $db database + * + * @return int id of the default pdf page for the database + */ + public function getDefaultPage($db) + { + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['pdfwork']) { + return -1; + } + + $query = "SELECT `page_nr`" + . " FROM " . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['pdf_pages']) + . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($db) . "'" + . " AND `page_descr` = '" . $GLOBALS['dbi']->escapeString($db) . "'"; + + $default_page_no = $GLOBALS['dbi']->fetchResult( + $query, + null, + null, + DatabaseInterface::CONNECT_CONTROL, + DatabaseInterface::QUERY_STORE + ); + + if (is_array($default_page_no) && isset($default_page_no[0])) { + return intval($default_page_no[0]); + } + return -1; + } + + /** + * Get the id of the page to load. If a default page exists it will be returned. + * If no such exists, returns the id of the first page of the database. + * + * @param string $db database + * + * @return int id of the page to load + */ + public function getLoadingPage($db) + { + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['pdfwork']) { + return -1; + } + + $page_no = -1; + + $default_page_no = $this->getDefaultPage($db); + if ($default_page_no != -1) { + $page_no = $default_page_no; + } else { + $query = "SELECT MIN(`page_nr`)" + . " FROM " . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['pdf_pages']) + . " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($db) . "'"; + + $min_page_no = $GLOBALS['dbi']->fetchResult( + $query, + null, + null, + DatabaseInterface::CONNECT_CONTROL, + DatabaseInterface::QUERY_STORE + ); + if (is_array($min_page_no) && isset($min_page_no[0])) { + $page_no = $min_page_no[0]; + } + } + return intval($page_no); + } + + /** + * Creates a new page and returns its auto-incrementing id + * + * @param string $pageName name of the page + * @param string $db name of the database + * + * @return int|null + */ + public function createNewPage($pageName, $db) + { + $cfgRelation = $this->relation->getRelationsParam(); + if ($cfgRelation['pdfwork']) { + $pageNumber = $this->relation->createPage( + $pageName, + $cfgRelation, + $db + ); + return $pageNumber; + } + return null; + } + + /** + * Saves positions of table(s) of a given pdf page + * + * @param int $pg pdf page id + * + * @return boolean success/failure + */ + public function saveTablePositions($pg) + { + $pageId = $GLOBALS['dbi']->escapeString($pg); + + $db = $GLOBALS['dbi']->escapeString($_POST['db']); + + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['pdfwork']) { + return false; + } + + $query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote( + $cfgRelation['table_coords'] + ) + . " WHERE `pdf_page_number` = '" . $pageId . "'"; + + $res = $this->relation->queryAsControlUser( + $query, + true, + DatabaseInterface::QUERY_STORE + ); + + if (!$res) { + return (boolean)$res; + } + + foreach ($_POST['t_h'] as $key => $value) { + $DB = $_POST['t_db'][$key]; + $TAB = $_POST['t_tbl'][$key]; + if (!$value) { + continue; + } + + $query = "INSERT INTO " + . Util::backquote($cfgRelation['db']) . "." + . Util::backquote($cfgRelation['table_coords']) + . " (`db_name`, `table_name`, `pdf_page_number`, `x`, `y`)" + . " VALUES (" + . "'" . $GLOBALS['dbi']->escapeString($DB) . "', " + . "'" . $GLOBALS['dbi']->escapeString($TAB) . "', " + . "'" . $pageId . "', " + . "'" . $GLOBALS['dbi']->escapeString($_POST['t_x'][$key]) . "', " + . "'" . $GLOBALS['dbi']->escapeString($_POST['t_y'][$key]) . "')"; + + $res = $this->relation->queryAsControlUser( + $query, true, DatabaseInterface::QUERY_STORE + ); + } + + return (boolean) $res; + } + + /** + * Saves the display field for a table. + * + * @param string $db database name + * @param string $table table name + * @param string $field display field name + * + * @return array<bool,string> + */ + public function saveDisplayField($db, $table, $field) + { + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['displaywork']) { + return [ + false, + _pgettext( + 'phpMyAdmin configuration storage is not configured for "Display Features" on designer when user tries to set a display field.', + 'phpMyAdmin configuration storage is not configured for "Display Features".' + ), + ]; + } + + $upd_query = new Table($table, $db, $GLOBALS['dbi']); + $upd_query->updateDisplayField($field, $cfgRelation); + + return [ + true, + null, + ]; + } + + /** + * Adds a new foreign relation + * + * @param string $db database name + * @param string $T1 foreign table + * @param string $F1 foreign field + * @param string $T2 master table + * @param string $F2 master field + * @param string $on_delete on delete action + * @param string $on_update on update action + * @param string $DB1 database + * @param string $DB2 database + * + * @return array array of success/failure and message + */ + public function addNewRelation($db, $T1, $F1, $T2, $F2, $on_delete, $on_update, $DB1, $DB2) + { + $tables = $GLOBALS['dbi']->getTablesFull($DB1, $T1); + $type_T1 = mb_strtoupper($tables[$T1]['ENGINE']); + $tables = $GLOBALS['dbi']->getTablesFull($DB2, $T2); + $type_T2 = mb_strtoupper($tables[$T2]['ENGINE']); + + // native foreign key + if (Util::isForeignKeySupported($type_T1) + && Util::isForeignKeySupported($type_T2) + && $type_T1 == $type_T2 + ) { + // relation exists? + $existrel_foreign = $this->relation->getForeigners($DB2, $T2, '', 'foreign'); + $foreigner = $this->relation->searchColumnInForeigners($existrel_foreign, $F2); + if ($foreigner + && isset($foreigner['constraint']) + ) { + return array(false, __('Error: relationship already exists.')); + } + // note: in InnoDB, the index does not requires to be on a PRIMARY + // or UNIQUE key + // improve: check all other requirements for InnoDB relations + $result = $GLOBALS['dbi']->query( + 'SHOW INDEX FROM ' . Util::backquote($DB1) + . '.' . Util::backquote($T1) . ';' + ); + + // will be use to emphasis prim. keys in the table view + $index_array1 = array(); + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $index_array1[$row['Column_name']] = 1; + } + $GLOBALS['dbi']->freeResult($result); + + $result = $GLOBALS['dbi']->query( + 'SHOW INDEX FROM ' . Util::backquote($DB2) + . '.' . Util::backquote($T2) . ';' + ); + // will be used to emphasis prim. keys in the table view + $index_array2 = array(); + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $index_array2[$row['Column_name']] = 1; + } + $GLOBALS['dbi']->freeResult($result); + + if (! empty($index_array1[$F1]) && ! empty($index_array2[$F2])) { + $upd_query = 'ALTER TABLE ' . Util::backquote($DB2) + . '.' . Util::backquote($T2) + . ' ADD FOREIGN KEY (' + . Util::backquote($F2) . ')' + . ' REFERENCES ' + . Util::backquote($DB1) . '.' + . Util::backquote($T1) . '(' + . Util::backquote($F1) . ')'; + + if ($on_delete != 'nix') { + $upd_query .= ' ON DELETE ' . $on_delete; + } + if ($on_update != 'nix') { + $upd_query .= ' ON UPDATE ' . $on_update; + } + $upd_query .= ';'; + if ($GLOBALS['dbi']->tryQuery($upd_query)) { + return array(true, __('FOREIGN KEY relationship has been added.')); + } + + $error = $GLOBALS['dbi']->getError(); + return array( + false, + __('Error: FOREIGN KEY relationship could not be added!') + . "<br/>" . $error + ); + } + + return array(false, __('Error: Missing index on column(s).')); + } + + // internal (pmadb) relation + if ($GLOBALS['cfgRelation']['relwork'] == false) { + return array(false, __('Error: Relational features are disabled!')); + } + + // no need to recheck if the keys are primary or unique at this point, + // this was checked on the interface part + + $q = "INSERT INTO " + . Util::backquote($GLOBALS['cfgRelation']['db']) + . "." + . Util::backquote($GLOBALS['cfgRelation']['relation']) + . "(master_db, master_table, master_field, " + . "foreign_db, foreign_table, foreign_field)" + . " values(" + . "'" . $GLOBALS['dbi']->escapeString($DB2) . "', " + . "'" . $GLOBALS['dbi']->escapeString($T2) . "', " + . "'" . $GLOBALS['dbi']->escapeString($F2) . "', " + . "'" . $GLOBALS['dbi']->escapeString($DB1) . "', " + . "'" . $GLOBALS['dbi']->escapeString($T1) . "', " + . "'" . $GLOBALS['dbi']->escapeString($F1) . "')"; + + if ($this->relation->queryAsControlUser($q, false, DatabaseInterface::QUERY_STORE) + ) { + return array(true, __('Internal relationship has been added.')); + } + + $error = $GLOBALS['dbi']->getError(DatabaseInterface::CONNECT_CONTROL); + return array( + false, + __('Error: Internal relationship could not be added!') + . "<br/>" . $error + ); + } + + /** + * Removes a foreign relation + * + * @param string $T1 foreign db.table + * @param string $F1 foreign field + * @param string $T2 master db.table + * @param string $F2 master field + * + * @return array array of success/failure and message + */ + public function removeRelation($T1, $F1, $T2, $F2) + { + list($DB1, $T1) = explode(".", $T1); + list($DB2, $T2) = explode(".", $T2); + + $tables = $GLOBALS['dbi']->getTablesFull($DB1, $T1); + $type_T1 = mb_strtoupper($tables[$T1]['ENGINE']); + $tables = $GLOBALS['dbi']->getTablesFull($DB2, $T2); + $type_T2 = mb_strtoupper($tables[$T2]['ENGINE']); + + if (Util::isForeignKeySupported($type_T1) + && Util::isForeignKeySupported($type_T2) + && $type_T1 == $type_T2 + ) { + // InnoDB + $existrel_foreign = $this->relation->getForeigners($DB2, $T2, '', 'foreign'); + $foreigner = $this->relation->searchColumnInForeigners($existrel_foreign, $F2); + + if (isset($foreigner['constraint'])) { + $upd_query = 'ALTER TABLE ' . Util::backquote($DB2) + . '.' . Util::backquote($T2) . ' DROP FOREIGN KEY ' + . Util::backquote($foreigner['constraint']) . ';'; + if ($GLOBALS['dbi']->query($upd_query)) { + return array(true, __('FOREIGN KEY relationship has been removed.')); + } + + $error = $GLOBALS['dbi']->getError(); + return array( + false, + __('Error: FOREIGN KEY relationship could not be removed!') + . "<br/>" . $error + ); + } + } + + // internal relations + $delete_query = "DELETE FROM " + . Util::backquote($GLOBALS['cfgRelation']['db']) . "." + . $GLOBALS['cfgRelation']['relation'] . " WHERE " + . "master_db = '" . $GLOBALS['dbi']->escapeString($DB2) . "'" + . " AND master_table = '" . $GLOBALS['dbi']->escapeString($T2) . "'" + . " AND master_field = '" . $GLOBALS['dbi']->escapeString($F2) . "'" + . " AND foreign_db = '" . $GLOBALS['dbi']->escapeString($DB1) . "'" + . " AND foreign_table = '" . $GLOBALS['dbi']->escapeString($T1) . "'" + . " AND foreign_field = '" . $GLOBALS['dbi']->escapeString($F1) . "'"; + + $result = $this->relation->queryAsControlUser( + $delete_query, + false, + DatabaseInterface::QUERY_STORE + ); + + if (!$result) { + $error = $GLOBALS['dbi']->getError(DatabaseInterface::CONNECT_CONTROL); + return array( + false, + __('Error: Internal relationship could not be removed!') . "<br/>" . $error + ); + } + + return array(true, __('Internal relationship has been removed.')); + } + + /** + * Save value for a designer setting + * + * @param string $index setting + * @param string $value value + * + * @return bool whether the operation succeeded + */ + public function saveSetting($index, $value) + { + $cfgRelation = $this->relation->getRelationsParam(); + $success = true; + if ($cfgRelation['designersettingswork']) { + + $cfgDesigner = array( + 'user' => $GLOBALS['cfg']['Server']['user'], + 'db' => $cfgRelation['db'], + 'table' => $cfgRelation['designer_settings'] + ); + + $orig_data_query = "SELECT settings_data" + . " FROM " . Util::backquote($cfgDesigner['db']) + . "." . Util::backquote($cfgDesigner['table']) + . " WHERE username = '" + . $GLOBALS['dbi']->escapeString($cfgDesigner['user']) . "';"; + + $orig_data = $GLOBALS['dbi']->fetchSingleRow( + $orig_data_query, 'ASSOC', DatabaseInterface::CONNECT_CONTROL + ); + + if (! empty($orig_data)) { + $orig_data = json_decode($orig_data['settings_data'], true); + $orig_data[$index] = $value; + $orig_data = json_encode($orig_data); + + $save_query = "UPDATE " + . Util::backquote($cfgDesigner['db']) + . "." . Util::backquote($cfgDesigner['table']) + . " SET settings_data = '" . $orig_data . "'" + . " WHERE username = '" + . $GLOBALS['dbi']->escapeString($cfgDesigner['user']) . "';"; + + $success = $this->relation->queryAsControlUser($save_query); + } else { + $save_data = array($index => $value); + + $query = "INSERT INTO " + . Util::backquote($cfgDesigner['db']) + . "." . Util::backquote($cfgDesigner['table']) + . " (username, settings_data)" + . " VALUES('" . $GLOBALS['dbi']->escapeString($cfgDesigner['user']) + . "', '" . json_encode($save_data) . "');"; + + $success = $this->relation->queryAsControlUser($query); + } + } + + return (bool) $success; + } +} diff --git a/phpMyAdmin/libraries/classes/Database/Designer/DesignerTable.php b/phpMyAdmin/libraries/classes/Database/Designer/DesignerTable.php new file mode 100755 index 0000000..548dab6 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Database/Designer/DesignerTable.php @@ -0,0 +1,98 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Database\Designer\DesignerTable class + * + * @package PhpMyAdmin-Designer + */ +namespace PhpMyAdmin\Database\Designer; + +use PhpMyAdmin\Util; + +/** + * Common functions for Designer + * + * @package PhpMyAdmin-Designer + */ +class DesignerTable +{ + private $tableName; + private $databaseName; + private $tableEngine; + private $displayField; + + /** + * Create a new DesignerTable + * + * @param string $databaseName The database name + * @param string $tableName The table name + * @param string $tableEngine The table engine + * @param string|null $displayField The display field if available + */ + public function __construct( + $databaseName, + $tableName, + $tableEngine, + $displayField + ) { + $this->databaseName = $databaseName; + $this->tableName = $tableName; + $this->tableEngine = $tableEngine; + $this->displayField = $displayField; + } + + /** + * The table engine supports or not foreign keys + * + * @return bool + */ + public function supportsForeignkeys() { + return Util::isForeignKeySupported($this->tableEngine); + } + + /** + * Get the database name + * + * @return string + */ + public function getDatabaseName() { + return $this->databaseName; + } + + /** + * Get the table name + * + * @return string + */ + public function getTableName() { + return $this->tableName; + } + + /** + * Get the table engine + * + * @return string + */ + public function getTableEngine() { + return $this->tableEngine; + } + + /** + * Get the displayed field + * + * @return string + */ + public function getDisplayField() + { + return $this->displayField; + } + + /** + * Get the db and table separated with a dot + * + * @return string + */ + public function getDbTableString() { + return $this->databaseName . '.' . $this->tableName; + } +} diff --git a/phpMyAdmin/libraries/classes/Database/MultiTableQuery.php b/phpMyAdmin/libraries/classes/Database/MultiTableQuery.php new file mode 100755 index 0000000..a1b1f74 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Database/MultiTableQuery.php @@ -0,0 +1,135 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Handles DB Multi-table query + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Database; + +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\ParseAnalyze; +use PhpMyAdmin\Sql; +use PhpMyAdmin\Template; + +/** + * Class to handle database Multi-table querying + * + * @package PhpMyAdmin + */ +class MultiTableQuery +{ + /** + * DatabaseInterface instance + * + * @access private + * @var DatabaseInterface + */ + private $dbi; + + /** + * Database name + * + * @access private + * @var string + */ + private $db; + + /** + * Default number of columns + * + * @access private + * @var integer + */ + private $defaultNoOfColumns; + + /** + * Table names + * + * @access private + * @var array + */ + private $tables; + + /** + * Constructor + * + * @param DatabaseInterface $dbi DatabaseInterface instance + * @param string $dbName Database name + * @param integer $defaultNoOfColumns Default number of columns + */ + public function __construct( + DatabaseInterface $dbi, + $dbName, + $defaultNoOfColumns = 3 + ) { + $this->dbi = $dbi; + $this->db = $dbName; + $this->defaultNoOfColumns = $defaultNoOfColumns; + + $this->tables = $this->dbi->getTables($this->db); + } + + /** + * Get Multi-Table query page HTML + * + * @return string Multi-Table query page HTML + */ + public function getFormHtml() + { + $tables = []; + foreach($this->tables as $table) { + $tables[$table]['hash'] = md5($table); + $tables[$table]['columns'] = array_keys( + $this->dbi->getColumns($this->db, $table) + ); + } + return Template::get('database/multi_table_query/form')->render([ + 'db' => $this->db, + 'tables' => $tables, + 'default_no_of_columns' => $this->defaultNoOfColumns, + ]); + } + + /** + * Displays multi-table query results + * + * @param string $sqlQuery The query to parse + * @param string $db The current database + * @param string $pmaThemeImage Uri of the PMA theme image + * + * @return void + */ + public static function displayResults($sqlQuery, $db, $pmaThemeImage) + { + list( + $analyzedSqlResults, + $db, + $tableFromSql + ) = ParseAnalyze::sqlQuery($sqlQuery, $db); + + extract($analyzedSqlResults); + $goto = 'db_multi_table_query.php'; + $sql = new Sql(); + $sql->executeQueryAndSendQueryResponse( + null, // analyzed_sql_results + false, // is_gotofile + $db, // db + null, // table + null, // find_real_end + null, // sql_query_for_bookmark - see below + null, // extra_data + null, // message_to_show + null, // message + null, // sql_data + $goto, // goto + $pmaThemeImage, // pmaThemeImage + null, // disp_query + null, // disp_message + null, // query_type + $sqlQuery, // sql_query + null, // selectedTables + null // complete_query + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Database/Qbe.php b/phpMyAdmin/libraries/classes/Database/Qbe.php new file mode 100755 index 0000000..fac18fe --- /dev/null +++ b/phpMyAdmin/libraries/classes/Database/Qbe.php @@ -0,0 +1,1961 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Handles DB QBE search + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Database; + +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Message; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Table; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Class to handle database QBE search + * + * @package PhpMyAdmin + */ +class Qbe +{ + /** + * Database name + * + * @access private + * @var string + */ + private $_db; + /** + * Table Names (selected/non-selected) + * + * @access private + * @var array + */ + private $_criteriaTables; + /** + * Column Names + * + * @access private + * @var array + */ + private $_columnNames; + /** + * Number of columns + * + * @access private + * @var integer + */ + private $_criteria_column_count; + /** + * Number of Rows + * + * @access private + * @var integer + */ + private $_criteria_row_count; + /** + * Whether to insert a new column + * + * @access private + * @var array + */ + private $_criteriaColumnInsert; + /** + * Whether to delete a column + * + * @access private + * @var array + */ + private $_criteriaColumnDelete; + /** + * Whether to insert a new row + * + * @access private + * @var array + */ + private $_criteriaRowInsert; + /** + * Whether to delete a row + * + * @access private + * @var array + */ + private $_criteriaRowDelete; + /** + * Already set criteria values + * + * @access private + * @var array + */ + private $_criteria; + /** + * Previously set criteria values + * + * @access private + * @var array + */ + private $_prev_criteria; + /** + * AND/OR relation b/w criteria columns + * + * @access private + * @var array + */ + private $_criteriaAndOrColumn; + /** + * AND/OR relation b/w criteria rows + * + * @access private + * @var array + */ + private $_criteriaAndOrRow; + /** + * Large width of a column + * + * @access private + * @var string + */ + private $_realwidth; + /** + * Minimum width of a column + * + * @access private + * @var int + */ + private $_form_column_width; + /** + * Selected columns in the form + * + * @access private + * @var array + */ + private $_formColumns; + /** + * Entered aliases in the form + * + * @access private + * @var array + */ + private $_formAliases; + /** + * Chosen sort options in the form + * + * @access private + * @var array + */ + private $_formSorts; + /** + * Chosen sort orders in the form + * + * @access private + * @var array + */ + private $_formSortOrders; + /** + * Show checkboxes in the form + * + * @access private + * @var array + */ + private $_formShows; + /** + * Entered criteria values in the form + * + * @access private + * @var array + */ + private $_formCriterions; + /** + * AND/OR column radio buttons in the form + * + * @access private + * @var array + */ + private $_formAndOrCols; + /** + * AND/OR row radio buttons in the form + * + * @access private + * @var array + */ + private $_formAndOrRows; + /** + * New column count in case of add/delete + * + * @access private + * @var integer + */ + private $_new_column_count; + /** + * New row count in case of add/delete + * + * @access private + * @var integer + */ + private $_new_row_count; + /** + * List of saved searches + * + * @access private + * @var array + */ + private $_savedSearchList = null; + /** + * Current search + * + * @access private + * @var SavedSearches + */ + private $_currentSearch = null; + + /** + * @var Relation $relation + */ + private $relation; + + /** + * Public Constructor + * + * @param string $dbname Database name + * @param array $savedSearchList List of saved searches + * @param SavedSearches $currentSearch Current search id + */ + public function __construct( + $dbname, + array $savedSearchList = array(), + $currentSearch = null + ) { + $this->_db = $dbname; + $this->_savedSearchList = $savedSearchList; + $this->_currentSearch = $currentSearch; + $this->_loadCriterias(); + // Sets criteria parameters + $this->_setSearchParams(); + $this->_setCriteriaTablesAndColumns(); + $this->relation = new Relation(); + } + + /** + * Initialize criterias + * + * @return static + */ + private function _loadCriterias() + { + if (null === $this->_currentSearch + || null === $this->_currentSearch->getCriterias() + ) { + return $this; + } + + $criterias = $this->_currentSearch->getCriterias(); + $_POST = $criterias + $_POST; + + return $this; + } + + /** + * Getter for current search + * + * @return SavedSearches + */ + private function _getCurrentSearch() + { + return $this->_currentSearch; + } + + /** + * Sets search parameters + * + * @return void + */ + private function _setSearchParams() + { + $criteriaColumnCount = $this->_initializeCriteriasCount(); + + $this->_criteriaColumnInsert = Core::ifSetOr( + $_POST['criteriaColumnInsert'], + null, + 'array' + ); + $this->_criteriaColumnDelete = Core::ifSetOr( + $_POST['criteriaColumnDelete'], + null, + 'array' + ); + + $this->_prev_criteria = isset($_POST['prev_criteria']) + ? $_POST['prev_criteria'] + : array(); + $this->_criteria = isset($_POST['criteria']) + ? $_POST['criteria'] + : array_fill(0, $criteriaColumnCount, ''); + + $this->_criteriaRowInsert = isset($_POST['criteriaRowInsert']) + ? $_POST['criteriaRowInsert'] + : array_fill(0, $criteriaColumnCount, ''); + $this->_criteriaRowDelete = isset($_POST['criteriaRowDelete']) + ? $_POST['criteriaRowDelete'] + : array_fill(0, $criteriaColumnCount, ''); + $this->_criteriaAndOrRow = isset($_POST['criteriaAndOrRow']) + ? $_POST['criteriaAndOrRow'] + : array_fill(0, $criteriaColumnCount, ''); + $this->_criteriaAndOrColumn = isset($_POST['criteriaAndOrColumn']) + ? $_POST['criteriaAndOrColumn'] + : array_fill(0, $criteriaColumnCount, ''); + // sets minimum width + $this->_form_column_width = 12; + $this->_formColumns = array(); + $this->_formSorts = array(); + $this->_formShows = array(); + $this->_formCriterions = array(); + $this->_formAndOrRows = array(); + $this->_formAndOrCols = array(); + } + + /** + * Sets criteria tables and columns + * + * @return void + */ + private function _setCriteriaTablesAndColumns() + { + // The tables list sent by a previously submitted form + if (Core::isValid($_POST['TableList'], 'array')) { + foreach ($_POST['TableList'] as $each_table) { + $this->_criteriaTables[$each_table] = ' selected="selected"'; + } + } // end if + $all_tables = $GLOBALS['dbi']->query( + 'SHOW TABLES FROM ' . Util::backquote($this->_db) . ';', + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + $all_tables_count = $GLOBALS['dbi']->numRows($all_tables); + if (0 == $all_tables_count) { + Message::error(__('No tables found in database.'))->display(); + exit; + } + // The tables list gets from MySQL + while (list($table) = $GLOBALS['dbi']->fetchRow($all_tables)) { + $columns = $GLOBALS['dbi']->getColumns($this->_db, $table); + + if (empty($this->_criteriaTables[$table]) + && ! empty($_POST['TableList']) + ) { + $this->_criteriaTables[$table] = ''; + } else { + $this->_criteriaTables[$table] = ' selected="selected"'; + } // end if + + // The fields list per selected tables + if ($this->_criteriaTables[$table] == ' selected="selected"') { + $each_table = Util::backquote($table); + $this->_columnNames[] = $each_table . '.*'; + foreach ($columns as $each_column) { + $each_column = $each_table . '.' + . Util::backquote($each_column['Field']); + $this->_columnNames[] = $each_column; + // increase the width if necessary + $this->_form_column_width = max( + mb_strlen($each_column), + $this->_form_column_width + ); + } // end foreach + } // end if + } // end while + $GLOBALS['dbi']->freeResult($all_tables); + + // sets the largest width found + $this->_realwidth = $this->_form_column_width . 'ex'; + } + /** + * Provides select options list containing column names + * + * @param integer $column_number Column Number (0,1,2) or more + * @param string $selected Selected criteria column name + * + * @return string HTML for select options + */ + private function _showColumnSelectCell($column_number, $selected = '') + { + return Template::get('database/qbe/column_select_cell')->render([ + 'column_number' => $column_number, + 'column_names' => $this->_columnNames, + 'selected' => $selected, + ]); + } + + /** + * Provides select options list containing sort options (ASC/DESC) + * + * @param integer $columnNumber Column Number (0,1,2) or more + * @param string $selected Selected criteria 'ASC' or 'DESC' + * + * @return string HTML for select options + */ + private function _getSortSelectCell( + $columnNumber, + $selected = '' + ) { + return Template::get('database/qbe/sort_select_cell')->render([ + 'real_width' => $this->_realwidth, + 'column_number' => $columnNumber, + 'selected' => $selected, + ]); + } + + /** + * Provides select options list containing sort order + * + * @param integer $columnNumber Column Number (0,1,2) or more + * @param integer $sortOrder Sort order + * + * @return string HTML for select options + */ + private function _getSortOrderSelectCell($columnNumber, $sortOrder) + { + $totalColumnCount = $this->_getNewColumnCount(); + return Template::get('database/qbe/sort_order_select_cell')->render([ + 'total_column_count' => $totalColumnCount, + 'column_number' => $columnNumber, + 'sort_order' => $sortOrder, + ]); + } + + /** + * Returns the new column count after adding and removing columns as instructed + * + * @return int new column count + */ + private function _getNewColumnCount() + { + $totalColumnCount = $this->_criteria_column_count; + if (! empty($this->_criteriaColumnInsert)) { + $totalColumnCount += count($this->_criteriaColumnInsert); + } + if (! empty($this->_criteriaColumnDelete)) { + $totalColumnCount -= count($this->_criteriaColumnDelete); + } + return $totalColumnCount; + } + + /** + * Provides search form's row containing column select options + * + * @return string HTML for search table's row + */ + private function _getColumnNamesRow() + { + $html_output = '<tr class="noclick">'; + $html_output .= '<th>' . __('Column:') . '</th>'; + $new_column_count = 0; + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + if (isset($this->_criteriaColumnInsert[$column_index]) + && $this->_criteriaColumnInsert[$column_index] == 'on' + ) { + $html_output .= $this->_showColumnSelectCell( + $new_column_count + ); + $new_column_count++; + } + if (! empty($this->_criteriaColumnDelete) + && isset($this->_criteriaColumnDelete[$column_index]) + && $this->_criteriaColumnDelete[$column_index] == 'on' + ) { + continue; + } + $selected = ''; + if (isset($_POST['criteriaColumn'][$column_index])) { + $selected = $_POST['criteriaColumn'][$column_index]; + $this->_formColumns[$new_column_count] + = $_POST['criteriaColumn'][$column_index]; + } + $html_output .= $this->_showColumnSelectCell( + $new_column_count, + $selected + ); + $new_column_count++; + } // end for + $this->_new_column_count = $new_column_count; + $html_output .= '</tr>'; + return $html_output; + } + + /** + * Provides search form's row containing column aliases + * + * @return string HTML for search table's row + */ + private function _getColumnAliasRow() + { + $html_output = '<tr class="noclick">'; + $html_output .= '<th>' . __('Alias:') . '</th>'; + $new_column_count = 0; + + for ( + $colInd = 0; + $colInd < $this->_criteria_column_count; + $colInd++ + ) { + if (! empty($this->_criteriaColumnInsert) + && isset($this->_criteriaColumnInsert[$colInd]) + && $this->_criteriaColumnInsert[$colInd] == 'on' + ) { + $html_output .= '<td class="center">'; + $html_output .= '<input type="text"' + . ' name="criteriaAlias[' . $new_column_count . ']" />'; + $html_output .= '</td>'; + $new_column_count++; + } // end if + + if (! empty($this->_criteriaColumnDelete) + && isset($this->_criteriaColumnDelete[$colInd]) + && $this->_criteriaColumnDelete[$colInd] == 'on' + ) { + continue; + } + + $tmp_alias = ''; + if (! empty($_POST['criteriaAlias'][$colInd])) { + $tmp_alias + = $this->_formAliases[$new_column_count] + = $_POST['criteriaAlias'][$colInd]; + }// end if + + $html_output .= '<td class="center">'; + $html_output .= '<input type="text"' + . ' name="criteriaAlias[' . $new_column_count . ']"' + . ' value="' . htmlspecialchars($tmp_alias) . '" />'; + $html_output .= '</td>'; + $new_column_count++; + } // end for + $html_output .= '</tr>'; + return $html_output; + } + + /** + * Provides search form's row containing sort(ASC/DESC) select options + * + * @return string HTML for search table's row + */ + private function _getSortRow() + { + $html_output = '<tr class="noclick">'; + $html_output .= '<th>' . __('Sort:') . '</th>'; + $new_column_count = 0; + + for ( + $colInd = 0; + $colInd < $this->_criteria_column_count; + $colInd++ + ) { + if (! empty($this->_criteriaColumnInsert) + && isset($this->_criteriaColumnInsert[$colInd]) + && $this->_criteriaColumnInsert[$colInd] == 'on' + ) { + $html_output .= $this->_getSortSelectCell($new_column_count); + $new_column_count++; + } // end if + + if (! empty($this->_criteriaColumnDelete) + && isset($this->_criteriaColumnDelete[$colInd]) + && $this->_criteriaColumnDelete[$colInd] == 'on' + ) { + continue; + } + // If they have chosen all fields using the * selector, + // then sorting is not available, Fix for Bug #570698 + if (isset($_POST['criteriaSort'][$colInd]) + && isset($_POST['criteriaColumn'][$colInd]) + && mb_substr($_POST['criteriaColumn'][$colInd], -2) == '.*' + ) { + $_POST['criteriaSort'][$colInd] = ''; + } //end if + + $selected = ''; + if (isset($_POST['criteriaSort'][$colInd])) { + $this->_formSorts[$new_column_count] + = $_POST['criteriaSort'][$colInd]; + + if ($_POST['criteriaSort'][$colInd] == 'ASC') { + $selected = 'ASC'; + } elseif ($_POST['criteriaSort'][$colInd] == 'DESC') { + $selected = 'DESC'; + } + } else { + $this->_formSorts[$new_column_count] = ''; + } + + $html_output .= $this->_getSortSelectCell( + $new_column_count, $selected + ); + $new_column_count++; + } // end for + $html_output .= '</tr>'; + return $html_output; + } + + /** + * Provides search form's row containing sort order + * + * @return string HTML for search table's row + */ + private function _getSortOrder() + { + $html_output = '<tr class="noclick">'; + $html_output .= '<th>' . __('Sort order:') . '</th>'; + $new_column_count = 0; + + for ( + $colInd = 0; + $colInd < $this->_criteria_column_count; + $colInd++ + ) { + if (! empty($this->_criteriaColumnInsert) + && isset($this->_criteriaColumnInsert[$colInd]) + && $this->_criteriaColumnInsert[$colInd] == 'on' + ) { + $html_output .= $this->_getSortOrderSelectCell( + $new_column_count, null + ); + $new_column_count++; + } // end if + + if (! empty($this->_criteriaColumnDelete) + && isset($this->_criteriaColumnDelete[$colInd]) + && $this->_criteriaColumnDelete[$colInd] == 'on' + ) { + continue; + } + + $sortOrder = null; + if (! empty($_POST['criteriaSortOrder'][$colInd])) { + $sortOrder + = $this->_formSortOrders[$new_column_count] + = $_POST['criteriaSortOrder'][$colInd]; + } + + $html_output .= $this->_getSortOrderSelectCell( + $new_column_count, $sortOrder + ); + $new_column_count++; + } // end for + $html_output .= '</tr>'; + return $html_output; + } + + /** + * Provides search form's row containing SHOW checkboxes + * + * @return string HTML for search table's row + */ + private function _getShowRow() + { + $html_output = '<tr class="noclick">'; + $html_output .= '<th>' . __('Show:') . '</th>'; + $new_column_count = 0; + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + if (! empty($this->_criteriaColumnInsert) + && isset($this->_criteriaColumnInsert[$column_index]) + && $this->_criteriaColumnInsert[$column_index] == 'on' + ) { + $html_output .= '<td class="center">'; + $html_output .= '<input type="checkbox"' + . ' name="criteriaShow[' . $new_column_count . ']" />'; + $html_output .= '</td>'; + $new_column_count++; + } // end if + if (! empty($this->_criteriaColumnDelete) + && isset($this->_criteriaColumnDelete[$column_index]) + && $this->_criteriaColumnDelete[$column_index] == 'on' + ) { + continue; + } + if (isset($_POST['criteriaShow'][$column_index])) { + $checked_options = ' checked="checked"'; + $this->_formShows[$new_column_count] + = $_POST['criteriaShow'][$column_index]; + } else { + $checked_options = ''; + } + $html_output .= '<td class="center">'; + $html_output .= '<input type="checkbox"' + . ' name="criteriaShow[' . $new_column_count . ']"' + . $checked_options . ' />'; + $html_output .= '</td>'; + $new_column_count++; + } // end for + $html_output .= '</tr>'; + return $html_output; + } + + /** + * Provides search form's row containing criteria Inputboxes + * + * @return string HTML for search table's row + */ + private function _getCriteriaInputboxRow() + { + $html_output = '<tr class="noclick">'; + $html_output .= '<th>' . __('Criteria:') . '</th>'; + $new_column_count = 0; + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + if (! empty($this->_criteriaColumnInsert) + && isset($this->_criteriaColumnInsert[$column_index]) + && $this->_criteriaColumnInsert[$column_index] == 'on' + ) { + $html_output .= '<td class="center">'; + $html_output .= '<input type="text"' + . ' name="criteria[' . $new_column_count . ']"' + . ' class="textfield"' + . ' style="width: ' . $this->_realwidth . '"' + . ' size="20" />'; + $html_output .= '</td>'; + $new_column_count++; + } // end if + if (! empty($this->_criteriaColumnDelete) + && isset($this->_criteriaColumnDelete[$column_index]) + && $this->_criteriaColumnDelete[$column_index] == 'on' + ) { + continue; + } + if (isset($this->_criteria[$column_index])) { + $tmp_criteria = $this->_criteria[$column_index]; + } + if ((empty($this->_prev_criteria) + || ! isset($this->_prev_criteria[$column_index])) + || $this->_prev_criteria[$column_index] != htmlspecialchars($tmp_criteria) + ) { + $this->_formCriterions[$new_column_count] = $tmp_criteria; + } else { + $this->_formCriterions[$new_column_count] + = $this->_prev_criteria[$column_index]; + } + $html_output .= '<td class="center">'; + $html_output .= '<input type="hidden"' + . ' name="prev_criteria[' . $new_column_count . ']"' + . ' value="' + . htmlspecialchars($this->_formCriterions[$new_column_count]) + . '" />'; + $html_output .= '<input type="text"' + . ' name="criteria[' . $new_column_count . ']"' + . ' value="' . htmlspecialchars($tmp_criteria) . '"' + . ' class="textfield"' + . ' style="width: ' . $this->_realwidth . '"' + . ' size="20" />'; + $html_output .= '</td>'; + $new_column_count++; + } // end for + $html_output .= '</tr>'; + return $html_output; + } + + /** + * Provides footer options for adding/deleting row/columns + * + * @param string $type Whether row or column + * + * @return string HTML for footer options + */ + private function _getFootersOptions($type) + { + return Template::get('database/qbe/footer_options')->render([ + 'type' => $type, + ]); + } + + /** + * Provides search form table's footer options + * + * @return string HTML for table footer + */ + private function _getTableFooters() + { + $html_output = '<fieldset class="tblFooters">'; + $html_output .= $this->_getFootersOptions("row"); + $html_output .= $this->_getFootersOptions("column"); + $html_output .= '<div class="floatleft">'; + $html_output .= '<input type="submit" name="modify"' + . ' value="' . __('Update Query') . '" />'; + $html_output .= '</div>'; + $html_output .= '</fieldset>'; + return $html_output; + } + + /** + * Provides a select list of database tables + * + * @return string HTML for table select list + */ + private function _getTablesList() + { + $html_output = '<div class="floatleft width100">'; + $html_output .= '<fieldset>'; + $html_output .= '<legend>' . __('Use Tables') . '</legend>'; + // Build the options list for each table name + $options = ''; + $numTableListOptions = 0; + foreach ($this->_criteriaTables as $key => $val) { + $options .= '<option value="' . htmlspecialchars($key) . '"' . $val . '>' + . (str_replace(' ', ' ', htmlspecialchars($key))) . '</option>'; + $numTableListOptions++; + } + $html_output .= '<select name="TableList[]"' + . ' multiple="multiple" id="listTable"' + . ' size="' . (($numTableListOptions > 30) ? '15' : '7') . '">'; + $html_output .= $options; + $html_output .= '</select>'; + $html_output .= '</fieldset>'; + $html_output .= '<fieldset class="tblFooters">'; + $html_output .= '<input type="submit" name="modify" value="' + . __('Update Query') . '" />'; + $html_output .= '</fieldset>'; + $html_output .= '</div>'; + return $html_output; + } + + /** + * Provides And/Or modification cell along with Insert/Delete options + * (For modifying search form's table columns) + * + * @param integer $column_number Column Number (0,1,2) or more + * @param array|null $selected Selected criteria column name + * @param bool $last_column Whether this is the last column + * + * @return string HTML for modification cell + */ + private function _getAndOrColCell( + $column_number, $selected = null, $last_column = false + ) { + $html_output = '<td class="center">'; + if (! $last_column) { + $html_output .= '<strong>' . __('Or:') . '</strong>'; + $html_output .= '<input type="radio"' + . ' name="criteriaAndOrColumn[' . $column_number . ']"' + . ' value="or"' . (isset($selected['or']) ? $selected['or'] : '') . ' />'; + $html_output .= '  <strong>' . __('And:') . '</strong>'; + $html_output .= '<input type="radio"' + . ' name="criteriaAndOrColumn[' . $column_number . ']"' + . ' value="and"' . (isset($selected['and']) ? $selected['and'] : '') . ' />'; + } + $html_output .= '<br />' . __('Ins'); + $html_output .= '<input type="checkbox"' + . ' name="criteriaColumnInsert[' . $column_number . ']" />'; + $html_output .= '  ' . __('Del'); + $html_output .= '<input type="checkbox"' + . ' name="criteriaColumnDelete[' . $column_number . ']" />'; + $html_output .= '</td>'; + return $html_output; + } + + /** + * Provides search form's row containing column modifications options + * (For modifying search form's table columns) + * + * @return string HTML for search table's row + */ + private function _getModifyColumnsRow() + { + $html_output = '<tr class="noclick">'; + $html_output .= '<th>' . __('Modify:') . '</th>'; + $new_column_count = 0; + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + if (! empty($this->_criteriaColumnInsert) + && isset($this->_criteriaColumnInsert[$column_index]) + && $this->_criteriaColumnInsert[$column_index] == 'on' + ) { + $html_output .= $this->_getAndOrColCell($new_column_count); + $new_column_count++; + } // end if + + if (! empty($this->_criteriaColumnDelete) + && isset($this->_criteriaColumnDelete[$column_index]) + && $this->_criteriaColumnDelete[$column_index] == 'on' + ) { + continue; + } + + if (isset($this->_criteriaAndOrColumn[$column_index])) { + $this->_formAndOrCols[$new_column_count] + = $this->_criteriaAndOrColumn[$column_index]; + } + $checked_options = array(); + if (isset($this->_criteriaAndOrColumn[$column_index]) + && $this->_criteriaAndOrColumn[$column_index] == 'or' + ) { + $checked_options['or'] = ' checked="checked"'; + $checked_options['and'] = ''; + } else { + $checked_options['and'] = ' checked="checked"'; + $checked_options['or'] = ''; + } + $html_output .= $this->_getAndOrColCell( + $new_column_count, + $checked_options, + ($column_index + 1 == $this->_criteria_column_count) + ); + $new_column_count++; + } // end for + $html_output .= '</tr>'; + return $html_output; + } + + /** + * Provides Insert/Delete options for criteria inputbox + * with AND/OR relationship modification options + * + * @param integer $row_index Number of criteria row + * @param array $checked_options If checked + * + * @return string HTML + */ + private function _getInsDelAndOrCell($row_index, array $checked_options) + { + $html_output = '<td class="value nowrap">'; + $html_output .= '<!-- Row controls -->'; + $html_output .= '<table class="nospacing nopadding">'; + $html_output .= '<tr>'; + $html_output .= '<td class="value nowrap">'; + $html_output .= '<small>' . __('Ins:') . '</small>'; + $html_output .= '<input type="checkbox"' + . ' name="criteriaRowInsert[' . $row_index . ']" />'; + $html_output .= '</td>'; + $html_output .= '<td class="value">'; + $html_output .= '<strong>' . __('And:') . '</strong>'; + $html_output .= '</td>'; + $html_output .= '<td>'; + $html_output .= '<input type="radio"' + . ' name="criteriaAndOrRow[' . $row_index . ']" value="and"' + . $checked_options['and'] . ' />'; + $html_output .= '</td>'; + $html_output .= '</tr>'; + $html_output .= '<tr>'; + $html_output .= '<td class="value nowrap">'; + $html_output .= '<small>' . __('Del:') . '</small>'; + $html_output .= '<input type="checkbox"' + . ' name="criteriaRowDelete[' . $row_index . ']" />'; + $html_output .= '</td>'; + $html_output .= '<td class="value">'; + $html_output .= '<strong>' . __('Or:') . '</strong>'; + $html_output .= '</td>'; + $html_output .= '<td>'; + $html_output .= '<input type="radio"' + . ' name="criteriaAndOrRow[' . $row_index . ']"' + . ' value="or"' . $checked_options['or'] . ' />'; + $html_output .= '</td>'; + $html_output .= '</tr>'; + $html_output .= '</table>'; + $html_output .= '</td>'; + return $html_output; + } + + /** + * Provides rows for criteria inputbox Insert/Delete options + * with AND/OR relationship modification options + * + * @param integer $new_row_index New row index if rows are added/deleted + * + * @return string HTML table rows + */ + private function _getInputboxRow($new_row_index) + { + $html_output = ''; + $new_column_count = 0; + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + if (!empty($this->_criteriaColumnInsert) + && isset($this->_criteriaColumnInsert[$column_index]) + && $this->_criteriaColumnInsert[$column_index] == 'on' + ) { + $orFieldName = 'Or' . $new_row_index . '[' . $new_column_count . ']'; + $html_output .= '<td class="center">'; + $html_output .= '<input type="text"' + . ' name="Or' . $orFieldName . '" class="textfield"' + . ' style="width: ' . $this->_realwidth . '" size="20" />'; + $html_output .= '</td>'; + $new_column_count++; + } // end if + if (!empty($this->_criteriaColumnDelete) + && isset($this->_criteriaColumnDelete[$column_index]) + && $this->_criteriaColumnDelete[$column_index] == 'on' + ) { + continue; + } + $or = 'Or' . $new_row_index; + if (! empty($_POST[$or]) && isset($_POST[$or][$column_index])) { + $tmp_or = $_POST[$or][$column_index]; + } else { + $tmp_or = ''; + } + $html_output .= '<td class="center">'; + $html_output .= '<input type="text"' + . ' name="Or' . $new_row_index . '[' . $new_column_count . ']' . '"' + . ' value="' . htmlspecialchars($tmp_or) . '" class="textfield"' + . ' style="width: ' . $this->_realwidth . '" size="20" />'; + $html_output .= '</td>'; + if (!empty(${$or}) && isset(${$or}[$column_index])) { + $GLOBALS[${'cur' . $or}][$new_column_count] + = ${$or}[$column_index]; + } + $new_column_count++; + } // end for + return $html_output; + } + + /** + * Provides rows for criteria inputbox Insert/Delete options + * with AND/OR relationship modification options + * + * @return string HTML table rows + */ + private function _getInsDelAndOrCriteriaRows() + { + $html_output = ''; + $new_row_count = 0; + $checked_options = array(); + for ( + $row_index = 0; + $row_index <= $this->_criteria_row_count; + $row_index++ + ) { + if (isset($this->_criteriaRowInsert[$row_index]) + && $this->_criteriaRowInsert[$row_index] == 'on' + ) { + $checked_options['or'] = ' checked="checked"'; + $checked_options['and'] = ''; + $html_output .= '<tr class="noclick">'; + $html_output .= $this->_getInsDelAndOrCell( + $new_row_count, $checked_options + ); + $html_output .= $this->_getInputboxRow( + $new_row_count + ); + $new_row_count++; + $html_output .= '</tr>'; + } // end if + if (isset($this->_criteriaRowDelete[$row_index]) + && $this->_criteriaRowDelete[$row_index] == 'on' + ) { + continue; + } + if (isset($this->_criteriaAndOrRow[$row_index])) { + $this->_formAndOrRows[$new_row_count] + = $this->_criteriaAndOrRow[$row_index]; + } + if (isset($this->_criteriaAndOrRow[$row_index]) + && $this->_criteriaAndOrRow[$row_index] == 'and' + ) { + $checked_options['and'] = ' checked="checked"'; + $checked_options['or'] = ''; + } else { + $checked_options['or'] = ' checked="checked"'; + $checked_options['and'] = ''; + } + $html_output .= '<tr class="noclick">'; + $html_output .= $this->_getInsDelAndOrCell( + $new_row_count, $checked_options + ); + $html_output .= $this->_getInputboxRow( + $new_row_count + ); + $new_row_count++; + $html_output .= '</tr>'; + } // end for + $this->_new_row_count = $new_row_count; + return $html_output; + } + + /** + * Provides SELECT clause for building SQL query + * + * @return string Select clause + */ + private function _getSelectClause() + { + $select_clause = ''; + $select_clauses = array(); + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + if (! empty($this->_formColumns[$column_index]) + && isset($this->_formShows[$column_index]) + && $this->_formShows[$column_index] == 'on' + ) { + $select = $this->_formColumns[$column_index]; + if (! empty($this->_formAliases[$column_index])) { + $select .= " AS " + . Util::backquote($this->_formAliases[$column_index]); + } + $select_clauses[] = $select; + } + } // end for + if (!empty($select_clauses)) { + $select_clause = 'SELECT ' + . htmlspecialchars(implode(", ", $select_clauses)) . "\n"; + } + return $select_clause; + } + + /** + * Provides WHERE clause for building SQL query + * + * @return string Where clause + */ + private function _getWhereClause() + { + $where_clause = ''; + $criteria_cnt = 0; + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + if (! empty($this->_formColumns[$column_index]) + && ! empty($this->_formCriterions[$column_index]) + && $column_index + && isset($last_where) + && isset($this->_formAndOrCols) + ) { + $where_clause .= ' ' + . mb_strtoupper($this->_formAndOrCols[$last_where]) + . ' '; + } + if (! empty($this->_formColumns[$column_index]) + && ! empty($this->_formCriterions[$column_index]) + ) { + $where_clause .= '(' . $this->_formColumns[$column_index] . ' ' + . $this->_formCriterions[$column_index] . ')'; + $last_where = $column_index; + $criteria_cnt++; + } + } // end for + if ($criteria_cnt > 1) { + $where_clause = '(' . $where_clause . ')'; + } + // OR rows ${'cur' . $or}[$column_index] + if (! isset($this->_formAndOrRows)) { + $this->_formAndOrRows = array(); + } + for ( + $row_index = 0; + $row_index <= $this->_criteria_row_count; + $row_index++ + ) { + $criteria_cnt = 0; + $qry_orwhere = ''; + $last_orwhere = ''; + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + if (! empty($this->_formColumns[$column_index]) + && ! empty($_POST['Or' . $row_index][$column_index]) + && $column_index + ) { + $qry_orwhere .= ' ' + . mb_strtoupper( + $this->_formAndOrCols[$last_orwhere] + ) + . ' '; + } + if (! empty($this->_formColumns[$column_index]) + && ! empty($_POST['Or' . $row_index][$column_index]) + ) { + $qry_orwhere .= '(' . $this->_formColumns[$column_index] + . ' ' + . $_POST['Or' . $row_index][$column_index] + . ')'; + $last_orwhere = $column_index; + $criteria_cnt++; + } + } // end for + if ($criteria_cnt > 1) { + $qry_orwhere = '(' . $qry_orwhere . ')'; + } + if (! empty($qry_orwhere)) { + $where_clause .= "\n" + . mb_strtoupper( + isset($this->_formAndOrRows[$row_index]) + ? $this->_formAndOrRows[$row_index] . ' ' + : '' + ) + . $qry_orwhere; + } // end if + } // end for + + if (! empty($where_clause) && $where_clause != '()') { + $where_clause = 'WHERE ' . htmlspecialchars($where_clause) . "\n"; + } // end if + return $where_clause; + } + + /** + * Provides ORDER BY clause for building SQL query + * + * @return string Order By clause + */ + private function _getOrderByClause() + { + $orderby_clause = ''; + $orderby_clauses = array(); + + // Create copy of instance variables + $columns = $this->_formColumns; + $sort = $this->_formSorts; + $sortOrder = $this->_formSortOrders; + if (!empty($sortOrder) + && count($sortOrder) == count($sort) + && count($sortOrder) == count($columns) + ) { + // Sort all three arrays based on sort order + array_multisort($sortOrder, $sort, $columns); + } + + for ( + $column_index = 0; + $column_index < $this->_criteria_column_count; + $column_index++ + ) { + // if all columns are chosen with * selector, + // then sorting isn't available + // Fix for Bug #570698 + if (empty($columns[$column_index]) + && empty($sort[$column_index]) + ) { + continue; + } + + if (mb_substr($columns[$column_index], -2) == '.*') { + continue; + } + + if (! empty($sort[$column_index])) { + $orderby_clauses[] = $columns[$column_index] . ' ' + . $sort[$column_index]; + } + } // end for + if (!empty($orderby_clauses)) { + $orderby_clause = 'ORDER BY ' + . htmlspecialchars(implode(", ", $orderby_clauses)) . "\n"; + } + return $orderby_clause; + } + + /** + * Provides UNIQUE columns and INDEX columns present in criteria tables + * + * @param array $search_tables Tables involved in the search + * @param array $search_columns Columns involved in the search + * @param array $where_clause_columns Columns having criteria where clause + * + * @return array having UNIQUE and INDEX columns + */ + private function _getIndexes(array $search_tables, array $search_columns, + array $where_clause_columns + ) { + $unique_columns = array(); + $index_columns = array(); + + foreach ($search_tables as $table) { + $indexes = $GLOBALS['dbi']->getTableIndexes($this->_db, $table); + foreach ($indexes as $index) { + $column = $table . '.' . $index['Column_name']; + if (isset($search_columns[$column])) { + if ($index['Non_unique'] == 0) { + if (isset($where_clause_columns[$column])) { + $unique_columns[$column] = 'Y'; + } else { + $unique_columns[$column] = 'N'; + } + } else { + if (isset($where_clause_columns[$column])) { + $index_columns[$column] = 'Y'; + } else { + $index_columns[$column] = 'N'; + } + } + } + } // end while (each index of a table) + } // end while (each table) + + return array( + 'unique' => $unique_columns, + 'index' => $index_columns + ); + } + + /** + * Provides UNIQUE columns and INDEX columns present in criteria tables + * + * @param array $search_tables Tables involved in the search + * @param array $search_columns Columns involved in the search + * @param array $where_clause_columns Columns having criteria where clause + * + * @return array having UNIQUE and INDEX columns + */ + private function _getLeftJoinColumnCandidates(array $search_tables, array $search_columns, + array $where_clause_columns + ) { + $GLOBALS['dbi']->selectDb($this->_db); + + // Get unique columns and index columns + $indexes = $this->_getIndexes( + $search_tables, $search_columns, $where_clause_columns + ); + $unique_columns = $indexes['unique']; + $index_columns = $indexes['index']; + + list($candidate_columns, $needsort) + = $this->_getLeftJoinColumnCandidatesBest( + $search_tables, + $where_clause_columns, + $unique_columns, + $index_columns + ); + + // If we came up with $unique_columns (very good) or $index_columns (still + // good) as $candidate_columns we want to check if we have any 'Y' there + // (that would mean that they were also found in the whereclauses + // which would be great). if yes, we take only those + if ($needsort != 1) { + return $candidate_columns; + } + + $very_good = array(); + $still_good = array(); + foreach ($candidate_columns as $column => $is_where) { + $table = explode('.', $column); + $table = $table[0]; + if ($is_where == 'Y') { + $very_good[$column] = $table; + } else { + $still_good[$column] = $table; + } + } + if (count($very_good) > 0) { + $candidate_columns = $very_good; + // Candidates restricted in index+where + } else { + $candidate_columns = $still_good; + // None of the candidates where in a where-clause + } + + return $candidate_columns; + } + + /** + * Provides the main table to form the LEFT JOIN clause + * + * @param array $search_tables Tables involved in the search + * @param array $search_columns Columns involved in the search + * @param array $where_clause_columns Columns having criteria where clause + * @param array $where_clause_tables Tables having criteria where clause + * + * @return string table name + */ + private function _getMasterTable(array $search_tables, array $search_columns, + array $where_clause_columns, array $where_clause_tables + ) { + if (count($where_clause_tables) == 1) { + // If there is exactly one column that has a decent where-clause + // we will just use this + $master = key($where_clause_tables); + return $master; + } + + // Now let's find out which of the tables has an index + // (When the control user is the same as the normal user + // because he is using one of his databases as pmadb, + // the last db selected is not always the one where we need to work) + $candidate_columns = $this->_getLeftJoinColumnCandidates( + $search_tables, $search_columns, $where_clause_columns + ); + + // Generally, we need to display all the rows of foreign (referenced) + // table, whether they have any matching row in child table or not. + // So we select candidate tables which are foreign tables. + $foreign_tables = array(); + foreach ($candidate_columns as $one_table) { + $foreigners = $this->relation->getForeigners($this->_db, $one_table); + foreach ($foreigners as $key => $foreigner) { + if ($key != 'foreign_keys_data') { + if (in_array($foreigner['foreign_table'], $candidate_columns)) { + $foreign_tables[$foreigner['foreign_table']] + = $foreigner['foreign_table']; + } + continue; + } + foreach ($foreigner as $one_key) { + if (in_array($one_key['ref_table_name'], $candidate_columns)) { + $foreign_tables[$one_key['ref_table_name']] + = $one_key['ref_table_name']; + } + } + } + } + if (count($foreign_tables)) { + $candidate_columns = $foreign_tables; + } + + // If our array of candidates has more than one member we'll just + // find the smallest table. + // Of course the actual query would be faster if we check for + // the Criteria which gives the smallest result set in its table, + // but it would take too much time to check this + if (!(count($candidate_columns) > 1)) { + // Only one single candidate + return reset($candidate_columns); + } + + // Of course we only want to check each table once + $checked_tables = $candidate_columns; + $tsize = array(); + $maxsize = -1; + $result = ''; + foreach ($candidate_columns as $table) { + if ($checked_tables[$table] != 1) { + $_table = new Table($table, $this->_db); + $tsize[$table] = $_table->countRecords(); + $checked_tables[$table] = 1; + } + if ($tsize[$table] > $maxsize) { + $maxsize = $tsize[$table]; + $result = $table; + } + } + // Return largest table + return $result; + } + + /** + * Provides columns and tables that have valid where clause criteria + * + * @return array + */ + private function _getWhereClauseTablesAndColumns() + { + $where_clause_columns = array(); + $where_clause_tables = array(); + + // Now we need all tables that we have in the where clause + for ( + $column_index = 0, $nb = count($this->_criteria); + $column_index < $nb; + $column_index++ + ) { + $current_table = explode('.', $_POST['criteriaColumn'][$column_index]); + if (empty($current_table[0]) || empty($current_table[1])) { + continue; + } // end if + $table = str_replace('`', '', $current_table[0]); + $column = str_replace('`', '', $current_table[1]); + $column = $table . '.' . $column; + // Now we know that our array has the same numbers as $criteria + // we can check which of our columns has a where clause + if (! empty($this->_criteria[$column_index])) { + if (mb_substr($this->_criteria[$column_index], 0, 1) == '=' + || stristr($this->_criteria[$column_index], 'is') + ) { + $where_clause_columns[$column] = $column; + $where_clause_tables[$table] = $table; + } + } // end if + } // end for + return array( + 'where_clause_tables' => $where_clause_tables, + 'where_clause_columns' => $where_clause_columns + ); + } + + /** + * Provides FROM clause for building SQL query + * + * @param array $formColumns List of selected columns in the form + * + * @return string FROM clause + */ + private function _getFromClause(array $formColumns) + { + $from_clause = ''; + if (empty($formColumns)) { + return $from_clause; + } + + // Initialize some variables + $search_tables = $search_columns = array(); + + // We only start this if we have fields, otherwise it would be dumb + foreach ($formColumns as $value) { + $parts = explode('.', $value); + if (! empty($parts[0]) && ! empty($parts[1])) { + $table = str_replace('`', '', $parts[0]); + $search_tables[$table] = $table; + $search_columns[] = $table . '.' . str_replace( + '`', '', $parts[1] + ); + } + } // end while + + // Create LEFT JOINS out of Relations + $from_clause = $this->_getJoinForFromClause( + $search_tables, $search_columns + ); + + // In case relations are not defined, just generate the FROM clause + // from the list of tables, however we don't generate any JOIN + if (empty($from_clause)) { + // Create cartesian product + $from_clause = implode( + ", ", array_map(array('PhpMyAdmin\Util', 'backquote'), $search_tables) + ); + } + + return $from_clause; + } + + /** + * Formulates the WHERE clause by JOINing tables + * + * @param array $searchTables Tables involved in the search + * @param array $searchColumns Columns involved in the search + * + * @return string table name + */ + private function _getJoinForFromClause(array $searchTables, array $searchColumns) + { + // $relations[master_table][foreign_table] => clause + $relations = array(); + + // Fill $relations with inter table relationship data + foreach ($searchTables as $oneTable) { + $this->_loadRelationsForTable($relations, $oneTable); + } + + // Get tables and columns with valid where clauses + $validWhereClauses = $this->_getWhereClauseTablesAndColumns(); + $whereClauseTables = $validWhereClauses['where_clause_tables']; + $whereClauseColumns = $validWhereClauses['where_clause_columns']; + + // Get master table + $master = $this->_getMasterTable( + $searchTables, $searchColumns, + $whereClauseColumns, $whereClauseTables + ); + + // Will include master tables and all tables that can be combined into + // a cluster by their relation + $finalized = array(); + if (strlen($master) > 0) { + // Add master tables + $finalized[$master] = ''; + } + // Fill the $finalized array with JOIN clauses for each table + $this->_fillJoinClauses($finalized, $relations, $searchTables); + + // JOIN clause + $join = ''; + + // Tables that can not be combined with the table cluster + // which includes master table + $unfinalized = array_diff($searchTables, array_keys($finalized)); + if (count($unfinalized) > 0) { + + // We need to look for intermediary tables to JOIN unfinalized tables + // Heuristic to chose intermediary tables is to look for tables + // having relationships with unfinalized tables + foreach ($unfinalized as $oneTable) { + + $references = $this->relation->getChildReferences($this->_db, $oneTable); + foreach ($references as $column => $columnReferences) { + foreach ($columnReferences as $reference) { + + // Only from this schema + if ($reference['table_schema'] != $this->_db) { + continue; + } + + $table = $reference['table_name']; + + $this->_loadRelationsForTable($relations, $table); + + // Make copies + $tempFinalized = $finalized; + $tempSearchTables = $searchTables; + $tempSearchTables[] = $table; + + // Try joining with the added table + $this->_fillJoinClauses( + $tempFinalized, $relations, $tempSearchTables + ); + + $tempUnfinalized = array_diff( + $tempSearchTables, array_keys($tempFinalized) + ); + // Take greedy approach. + // If the unfinalized count drops we keep the new table + // and switch temporary varibles with the original ones + if (count($tempUnfinalized) < count($unfinalized)) { + $finalized = $tempFinalized; + $searchTables = $tempSearchTables; + } + + // We are done if no unfinalized tables anymore + if (count($tempUnfinalized) == 0) { + break 3; + } + } + } + } + + $unfinalized = array_diff($searchTables, array_keys($finalized)); + // If there are still unfinalized tables + if (count($unfinalized) > 0) { + // Add these tables as cartesian product before joined tables + $join .= implode( + ', ', array_map(array('PhpMyAdmin\Util', 'backquote'), $unfinalized) + ); + } + } + + $first = true; + // Add joined tables + foreach ($finalized as $table => $clause) { + if ($first) { + if (! empty($join)) { + $join .= ", "; + } + $join .= Util::backquote($table); + $first = false; + } else { + $join .= "\n LEFT JOIN " . Util::backquote( + $table + ) . " ON " . $clause; + } + } + + return $join; + } + + /** + * Loads relations for a given table into the $relations array + * + * @param array &$relations array of relations + * @param string $oneTable the table + * + * @return void + */ + private function _loadRelationsForTable(array &$relations, $oneTable) + { + $relations[$oneTable] = array(); + + $foreigners = $this->relation->getForeigners($GLOBALS['db'], $oneTable); + foreach ($foreigners as $field => $foreigner) { + // Foreign keys data + if ($field == 'foreign_keys_data') { + foreach ($foreigner as $oneKey) { + $clauses = array(); + // There may be multiple column relations + foreach ($oneKey['index_list'] as $index => $oneField) { + $clauses[] + = Util::backquote($oneTable) . "." + . Util::backquote($oneField) . " = " + . Util::backquote($oneKey['ref_table_name']) . "." + . Util::backquote($oneKey['ref_index_list'][$index]); + } + // Combine multiple column relations with AND + $relations[$oneTable][$oneKey['ref_table_name']] + = implode(" AND ", $clauses); + } + } else { // Internal relations + $relations[$oneTable][$foreigner['foreign_table']] + = Util::backquote($oneTable) . "." + . Util::backquote($field) . " = " + . Util::backquote($foreigner['foreign_table']) . "." + . Util::backquote($foreigner['foreign_field']); + } + } + } + + /** + * Fills the $finalized arrays with JOIN clauses for each of the tables + * + * @param array &$finalized JOIN clauses for each table + * @param array $relations Relations among tables + * @param array $searchTables Tables involved in the search + * + * @return void + */ + private function _fillJoinClauses(array &$finalized, array $relations, array $searchTables) + { + while (true) { + $added = false; + foreach ($searchTables as $masterTable) { + $foreignData = $relations[$masterTable]; + foreach ($foreignData as $foreignTable => $clause) { + if (! isset($finalized[$masterTable]) + && isset($finalized[$foreignTable]) + ) { + $finalized[$masterTable] = $clause; + $added = true; + } elseif (! isset($finalized[$foreignTable]) + && isset($finalized[$masterTable]) + && in_array($foreignTable, $searchTables) + ) { + $finalized[$foreignTable] = $clause; + $added = true; + } + if ($added) { + // We are done if all tables are in $finalized + if (count($finalized) == count($searchTables)) { + return; + } + } + } + } + // If no new tables were added during this iteration, break; + if (! $added) { + return; + } + } + } + + /** + * Provides the generated SQL query + * + * @param array $formColumns List of selected columns in the form + * + * @return string SQL query + */ + private function _getSQLQuery(array $formColumns) + { + $sql_query = ''; + // get SELECT clause + $sql_query .= $this->_getSelectClause(); + // get FROM clause + $from_clause = $this->_getFromClause($formColumns); + if (! empty($from_clause)) { + $sql_query .= 'FROM ' . htmlspecialchars($from_clause) . "\n"; + } + // get WHERE clause + $sql_query .= $this->_getWhereClause(); + // get ORDER BY clause + $sql_query .= $this->_getOrderByClause(); + return $sql_query; + } + + /** + * Provides the generated QBE form + * + * @return string QBE form + */ + public function getSelectionForm() + { + $html_output = '<form action="db_qbe.php" method="post" id="formQBE" ' + . 'class="lock-page">'; + $html_output .= '<div class="width100">'; + $html_output .= '<fieldset>'; + + if ($GLOBALS['cfgRelation']['savedsearcheswork']) { + $html_output .= $this->_getSavedSearchesField(); + } + + $html_output .= '<div class="responsivetable jsresponsive">'; + $html_output .= '<table class="data" style="width: 100%;">'; + // Get table's <tr> elements + $html_output .= $this->_getColumnNamesRow(); + $html_output .= $this->_getColumnAliasRow(); + $html_output .= $this->_getShowRow(); + $html_output .= $this->_getSortRow(); + $html_output .= $this->_getSortOrder(); + $html_output .= $this->_getCriteriaInputboxRow(); + $html_output .= $this->_getInsDelAndOrCriteriaRows(); + $html_output .= $this->_getModifyColumnsRow(); + $html_output .= '</table>'; + $this->_new_row_count--; + $url_params = array(); + $url_params['db'] = $this->_db; + $url_params['criteriaColumnCount'] = $this->_new_column_count; + $url_params['rows'] = $this->_new_row_count; + $html_output .= Url::getHiddenInputs($url_params); + $html_output .= '</div>'; + $html_output .= '</fieldset>'; + $html_output .= '</div>'; + // get footers + $html_output .= $this->_getTableFooters(); + // get tables select list + $html_output .= $this->_getTablesList(); + $html_output .= '</form>'; + $html_output .= '<form action="db_qbe.php" method="post" class="lock-page">'; + $html_output .= Url::getHiddenInputs(array('db' => $this->_db)); + // get SQL query + $html_output .= '<div class="floatleft desktop50">'; + $html_output .= '<fieldset id="tblQbe">'; + $html_output .= '<legend>' + . sprintf( + __('SQL query on database <b>%s</b>:'), + Util::getDbLink($this->_db) + ); + $html_output .= '</legend>'; + $text_dir = 'ltr'; + $html_output .= '<textarea cols="80" name="sql_query" id="textSqlquery"' + . ' rows="' . ((count($this->_criteriaTables) > 30) ? '15' : '7') . '"' + . ' dir="' . $text_dir . '">'; + + if (empty($this->_formColumns)) { + $this->_formColumns = array(); + } + $html_output .= $this->_getSQLQuery($this->_formColumns); + + $html_output .= '</textarea>'; + $html_output .= '</fieldset>'; + // displays form's footers + $html_output .= '<fieldset class="tblFooters" id="tblQbeFooters">'; + $html_output .= '<input type="hidden" name="submit_sql" value="1" />'; + $html_output .= '<input type="submit" value="' . __('Submit Query') . '" />'; + $html_output .= '</fieldset>'; + $html_output .= '</div>'; + $html_output .= '</form>'; + return $html_output; + } + + /** + * Get fields to display + * + * @return string + */ + private function _getSavedSearchesField() + { + $html_output = __('Saved bookmarked search:'); + $html_output .= ' <select name="searchId" id="searchId">'; + $html_output .= '<option value="">' . __('New bookmark') . '</option>'; + + $currentSearch = $this->_getCurrentSearch(); + $currentSearchId = null; + $currentSearchName = null; + if (null != $currentSearch) { + $currentSearchId = $currentSearch->getId(); + $currentSearchName = $currentSearch->getSearchName(); + } + + foreach ($this->_savedSearchList as $id => $name) { + $html_output .= '<option value="' . htmlspecialchars($id) + . '" ' . ( + $id == $currentSearchId + ? 'selected="selected" ' + : '' + ) + . '>' + . htmlspecialchars($name) + . '</option>'; + } + $html_output .= '</select>'; + $html_output .= '<input type="text" name="searchName" id="searchName" ' + . 'value="' . htmlspecialchars($currentSearchName) . '" />'; + $html_output .= '<input type="hidden" name="action" id="action" value="" />'; + $html_output .= '<input type="submit" name="saveSearch" id="saveSearch" ' + . 'value="' . __('Create bookmark') . '" />'; + if (null !== $currentSearchId) { + $html_output .= '<input type="submit" name="updateSearch" ' + . 'id="updateSearch" value="' . __('Update bookmark') . '" />'; + $html_output .= '<input type="submit" name="deleteSearch" ' + . 'id="deleteSearch" value="' . __('Delete bookmark') . '" />'; + } + + return $html_output; + } + + /** + * Initialize _criteria_column_count + * + * @return int Previous number of columns + */ + private function _initializeCriteriasCount() + { + // sets column count + $criteriaColumnCount = Core::ifSetOr( + $_POST['criteriaColumnCount'], + 3, + 'numeric' + ); + $criteriaColumnAdd = Core::ifSetOr( + $_POST['criteriaColumnAdd'], + 0, + 'numeric' + ); + $this->_criteria_column_count = max( + $criteriaColumnCount + $criteriaColumnAdd, + 0 + ); + + // sets row count + $rows = Core::ifSetOr($_POST['rows'], 0, 'numeric'); + $criteriaRowAdd = Core::ifSetOr($_POST['criteriaRowAdd'], 0, 'numeric'); + $this->_criteria_row_count = min( + 100, + max($rows + $criteriaRowAdd, 0) + ); + + return $criteriaColumnCount; + } + + /** + * Get best + * + * @param array $search_tables Tables involved in the search + * @param array $where_clause_columns Columns with where clause + * @param array $unique_columns Unique columns + * @param array $index_columns Indexed columns + * + * @return array + */ + private function _getLeftJoinColumnCandidatesBest( + array $search_tables, array $where_clause_columns, array $unique_columns, array $index_columns + ) { + // now we want to find the best. + if (isset($unique_columns) && count($unique_columns) > 0) { + $candidate_columns = $unique_columns; + $needsort = 1; + return array($candidate_columns, $needsort); + } elseif (isset($index_columns) && count($index_columns) > 0) { + $candidate_columns = $index_columns; + $needsort = 1; + return array($candidate_columns, $needsort); + } elseif (isset($where_clause_columns) && count($where_clause_columns) > 0) { + $candidate_columns = $where_clause_columns; + $needsort = 0; + return array($candidate_columns, $needsort); + } + + $candidate_columns = $search_tables; + $needsort = 0; + return array($candidate_columns, $needsort); + } +} diff --git a/phpMyAdmin/libraries/classes/Database/Search.php b/phpMyAdmin/libraries/classes/Database/Search.php new file mode 100755 index 0000000..f5923f9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Database/Search.php @@ -0,0 +1,339 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Handles Database Search + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Database; + +use PhpMyAdmin\Template; +use PhpMyAdmin\Util; + +/** + * Class to handle database search + * + * @package PhpMyAdmin + */ +class Search +{ + /** + * Database name + * + * @access private + * @var string + */ + private $db; + + /** + * Table Names + * + * @access private + * @var array + */ + private $tablesNamesOnly; + + /** + * Type of search + * + * @access private + * @var array + */ + private $searchTypes; + + /** + * Already set search type + * + * @access private + * @var integer + */ + private $criteriaSearchType; + + /** + * Already set search type's description + * + * @access private + * @var string + */ + private $searchTypeDescription; + + /** + * Search string/regexp + * + * @access private + * @var string + */ + private $criteriaSearchString; + + /** + * Criteria Tables to search in + * + * @access private + * @var array + */ + private $criteriaTables; + + /** + * Restrict the search to this column + * + * @access private + * @var string + */ + private $criteriaColumnName; + + /** + * Public Constructor + * + * @param string $db Database name + */ + public function __construct($db) + { + $this->db = $db; + $this->searchTypes = array( + '1' => __('at least one of the words'), + '2' => __('all of the words'), + '3' => __('the exact phrase as substring'), + '4' => __('the exact phrase as whole field'), + '5' => __('as regular expression'), + ); + // Sets criteria parameters + $this->setSearchParams(); + } + + /** + * Sets search parameters + * + * @return void + */ + private function setSearchParams() + { + $this->tablesNamesOnly = $GLOBALS['dbi']->getTables($this->db); + + if (empty($_POST['criteriaSearchType']) + || ! is_string($_POST['criteriaSearchType']) + || ! array_key_exists( + $_POST['criteriaSearchType'], + $this->searchTypes + ) + ) { + $this->criteriaSearchType = 1; + unset($_POST['submit_search']); + } else { + $this->criteriaSearchType = (int) $_POST['criteriaSearchType']; + $this->searchTypeDescription + = $this->searchTypes[$_POST['criteriaSearchType']]; + } + + if (empty($_POST['criteriaSearchString']) + || ! is_string($_POST['criteriaSearchString']) + ) { + $this->criteriaSearchString = ''; + unset($_POST['submit_search']); + } else { + $this->criteriaSearchString = $_POST['criteriaSearchString']; + } + + $this->criteriaTables = array(); + if (empty($_POST['criteriaTables']) + || ! is_array($_POST['criteriaTables']) + ) { + unset($_POST['submit_search']); + } else { + $this->criteriaTables = array_intersect( + $_POST['criteriaTables'], $this->tablesNamesOnly + ); + } + + if (empty($_POST['criteriaColumnName']) + || ! is_string($_POST['criteriaColumnName']) + ) { + unset($this->criteriaColumnName); + } else { + $this->criteriaColumnName = $GLOBALS['dbi']->escapeString( + $_POST['criteriaColumnName'] + ); + } + } + + /** + * Builds the SQL search query + * + * @param string $table The table name + * + * @return array 3 SQL queries (for count, display and delete results) + * + * @todo can we make use of fulltextsearch IN BOOLEAN MODE for this? + * PMA_backquote + * DatabaseInterface::freeResult + * DatabaseInterface::fetchAssoc + * $GLOBALS['db'] + * explode + * count + * strlen + */ + private function getSearchSqls($table) + { + // Statement types + $sqlstr_select = 'SELECT'; + $sqlstr_delete = 'DELETE'; + // Table to use + $sqlstr_from = ' FROM ' + . Util::backquote($GLOBALS['db']) . '.' + . Util::backquote($table); + // Gets where clause for the query + $where_clause = $this->getWhereClause($table); + // Builds complete queries + $sql = array(); + $sql['select_columns'] = $sqlstr_select . ' * ' . $sqlstr_from + . $where_clause; + // here, I think we need to still use the COUNT clause, even for + // VIEWs, anyway we have a WHERE clause that should limit results + $sql['select_count'] = $sqlstr_select . ' COUNT(*) AS `count`' + . $sqlstr_from . $where_clause; + $sql['delete'] = $sqlstr_delete . $sqlstr_from . $where_clause; + + return $sql; + } + + /** + * Provides where clause for building SQL query + * + * @param string $table The table name + * + * @return string The generated where clause + */ + private function getWhereClause($table) + { + // Columns to select + $allColumns = $GLOBALS['dbi']->getColumns($GLOBALS['db'], $table); + $likeClauses = array(); + // Based on search type, decide like/regex & '%'/'' + $like_or_regex = (($this->criteriaSearchType == 5) ? 'REGEXP' : 'LIKE'); + $automatic_wildcard = (($this->criteriaSearchType < 4) ? '%' : ''); + // For "as regular expression" (search option 5), LIKE won't be used + // Usage example: If user is searching for a literal $ in a regexp search, + // he should enter \$ as the value. + $criteriaSearchStringEscaped = $GLOBALS['dbi']->escapeString( + $this->criteriaSearchString + ); + // Extract search words or pattern + $search_words = (($this->criteriaSearchType > 2) + ? array($criteriaSearchStringEscaped) + : explode(' ', $criteriaSearchStringEscaped)); + + foreach ($search_words as $search_word) { + // Eliminates empty values + if (strlen($search_word) === 0) { + continue; + } + $likeClausesPerColumn = array(); + // for each column in the table + foreach ($allColumns as $column) { + if (! isset($this->criteriaColumnName) + || strlen($this->criteriaColumnName) === 0 + || $column['Field'] == $this->criteriaColumnName + ) { + $column = 'CONVERT(' . Util::backquote($column['Field']) + . ' USING utf8)'; + $likeClausesPerColumn[] = $column . ' ' . $like_or_regex . ' ' + . "'" + . $automatic_wildcard . $search_word . $automatic_wildcard + . "'"; + } + } // end for + if (count($likeClausesPerColumn) > 0) { + $likeClauses[] = implode(' OR ', $likeClausesPerColumn); + } + } // end for + // Use 'OR' if 'at least one word' is to be searched, else use 'AND' + $implode_str = ($this->criteriaSearchType == 1 ? ' OR ' : ' AND '); + if (empty($likeClauses)) { + // this could happen when the "inside column" does not exist + // in any selected tables + $where_clause = ' WHERE FALSE'; + } else { + $where_clause = ' WHERE (' + . implode(') ' . $implode_str . ' (', $likeClauses) + . ')'; + } + return $where_clause; + } + + /** + * Displays database search results + * + * @return string HTML for search results + */ + public function getSearchResults() + { + $resultTotal = 0; + $rows = []; + // For each table selected as search criteria + foreach ($this->criteriaTables as $eachTable) { + // Gets the SQL statements + $newSearchSqls = $this->getSearchSqls($eachTable); + // Executes the "COUNT" statement + $resultCount = intval($GLOBALS['dbi']->fetchValue( + $newSearchSqls['select_count'] + )); + $resultTotal += $resultCount; + // Gets the result row's HTML for a table + $rows[] = [ + 'table' => htmlspecialchars($eachTable), + 'new_search_sqls' => $newSearchSqls, + 'result_count' => $resultCount, + ]; + } + + return Template::get('database/search/results')->render([ + 'db' => $this->db, + 'rows' => $rows, + 'result_total' => $resultTotal, + 'criteria_tables' => $this->criteriaTables, + 'criteria_search_string' => htmlspecialchars($this->criteriaSearchString), + 'search_type_description' => $this->searchTypeDescription, + ]); + } + + /** + * Provides the main search form's html + * + * @return string HTML for selection form + */ + public function getSelectionForm() + { + $choices = array( + '1' => $this->searchTypes[1] . ' ' + . Util::showHint( + __('Words are separated by a space character (" ").') + ), + '2' => $this->searchTypes[2] . ' ' + . Util::showHint( + __('Words are separated by a space character (" ").') + ), + '3' => $this->searchTypes[3], + '4' => $this->searchTypes[4], + '5' => $this->searchTypes[5] . ' ' . Util::showMySQLDocu('Regexp') + ); + return Template::get('database/search/selection_form')->render([ + 'db' => $this->db, + 'choices' => $choices, + 'criteria_search_string' => $this->criteriaSearchString, + 'criteria_search_type' => $this->criteriaSearchType, + 'criteria_tables' => $this->criteriaTables, + 'tables_names_only' => $this->tablesNamesOnly, + 'criteria_column_name' => isset($this->criteriaColumnName) + ? $this->criteriaColumnName : null, + ]); + } + + /** + * Provides div tags for browsing search results and sql query form. + * + * @return string div tags + */ + public function getResultDivs() + { + return Template::get('database/search/result_divs')->render(); + } +} diff --git a/phpMyAdmin/libraries/classes/DatabaseInterface.php b/phpMyAdmin/libraries/classes/DatabaseInterface.php new file mode 100755 index 0000000..020ef41 --- /dev/null +++ b/phpMyAdmin/libraries/classes/DatabaseInterface.php @@ -0,0 +1,3113 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Main interface for database interactions + * + * @package PhpMyAdmin-DBI + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\Core; +use PhpMyAdmin\Database\DatabaseList; +use PhpMyAdmin\Dbi\DbiExtension; +use PhpMyAdmin\Dbi\DbiDummy; +use PhpMyAdmin\Dbi\DbiMysql; +use PhpMyAdmin\Dbi\DbiMysqli; +use PhpMyAdmin\Di\Container; +use PhpMyAdmin\Error; +use PhpMyAdmin\Index; +use PhpMyAdmin\LanguageManager; +use PhpMyAdmin\Relation; +use PhpMyAdmin\SystemDatabase; +use PhpMyAdmin\Table; +use PhpMyAdmin\Types; +use PhpMyAdmin\Tracker; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Main interface for database interactions + * + * @package PhpMyAdmin-DBI + */ +class DatabaseInterface +{ + /** + * Force STORE_RESULT method, ignored by classic MySQL. + */ + const QUERY_STORE = 1; + /** + * Do not read whole query. + */ + const QUERY_UNBUFFERED = 2; + /** + * Get session variable. + */ + const GETVAR_SESSION = 1; + /** + * Get global variable. + */ + const GETVAR_GLOBAL = 2; + + /** + * User connection. + */ + const CONNECT_USER = 0x100; + /** + * Control user connection. + */ + const CONNECT_CONTROL = 0x101; + /** + * Auxiliary connection. + * + * Used for example for replication setup. + */ + const CONNECT_AUXILIARY = 0x102; + + /** + * @var DbiExtension + */ + private $_extension; + + /** + * Opened database links + * + * @var array + */ + private $_links; + + /** + * @var array Table data cache + */ + private $_table_cache; + + /** + * @var array Current user and host cache + */ + private $_current_user; + + /** + * @var null|string lower_case_table_names value cache + */ + private $_lower_case_table_names = null; + + /** + * @var boolean Whether connection is MariaDB + */ + private $_is_mariadb = false; + /** + * @var boolean Whether connection is Percona + */ + private $_is_percona = false; + /** + * @var integer Server version as number + */ + private $_version_int = 55000; + /** + * @var string Server version + */ + private $_version_str = '5.50.0'; + /** + * @var string Server version comment + */ + private $_version_comment = ''; + + /** + * @var Types MySQL types data + */ + public $types; + + /** + * @var Relation $relation + */ + private $relation; + + /** + * Constructor + * + * @param DbiExtension $ext Object to be used for database queries + */ + public function __construct($ext) + { + $this->_extension = $ext; + $this->_links = array(); + if (defined('TESTSUITE')) { + $this->_links[DatabaseInterface::CONNECT_USER] = 1; + $this->_links[DatabaseInterface::CONNECT_CONTROL] = 2; + } + $this->_table_cache = array(); + $this->_current_user = array(); + $this->types = new Types($this); + $this->relation = new Relation(); + } + + /** + * Checks whether database extension is loaded + * + * @param string $extension mysql extension to check + * + * @return bool + */ + public static function checkDbExtension($extension = 'mysql') + { + return function_exists($extension . '_connect'); + } + + /** + * runs a query + * + * @param string $query SQL query to execute + * @param mixed $link optional database link to use + * @param int $options optional query options + * @param bool $cache_affected_rows whether to cache affected rows + * + * @return mixed + */ + public function query($query, $link = DatabaseInterface::CONNECT_USER, $options = 0, + $cache_affected_rows = true + ) { + $res = $this->tryQuery($query, $link, $options, $cache_affected_rows) + or Util::mysqlDie($this->getError($link), $query); + return $res; + } + + /** + * Get a cached value from table cache. + * + * @param array $contentPath Array of the name of the target value + * @param mixed $default Return value on cache miss + * + * @return mixed cached value or default + */ + public function getCachedTableContent(array $contentPath, $default = null) + { + return Util::getValueByKey($this->_table_cache, $contentPath, $default); + } + + /** + * Set an item in table cache using dot notation. + * + * @param array $contentPath Array with the target path + * @param mixed $value Target value + * + * @return void + */ + public function cacheTableContent(array $contentPath, $value) + { + $loc = &$this->_table_cache; + + if (!isset($contentPath)) { + $loc = $value; + return; + } + + while (count($contentPath) > 1) { + $key = array_shift($contentPath); + + // If the key doesn't exist at this depth, we will just create an empty + // array to hold the next value, allowing us to create the arrays to hold + // final values at the correct depth. Then we'll keep digging into the + // array. + if (!isset($loc[$key]) || !is_array($loc[$key])) { + $loc[$key] = array(); + } + $loc = &$loc[$key]; + } + + $loc[array_shift($contentPath)] = $value; + } + + /** + * Clear the table cache. + * + * @return void + */ + public function clearTableCache() + { + $this->_table_cache = array(); + } + + /** + * Caches table data so Table does not require to issue + * SHOW TABLE STATUS again + * + * @param array $tables information for tables of some databases + * @param string $table table name + * + * @return void + */ + private function _cacheTableData(array $tables, $table) + { + // Note: I don't see why we would need array_merge_recursive() here, + // as it creates double entries for the same table (for example a double + // entry for Comment when changing the storage engine in Operations) + // Note 2: Instead of array_merge(), simply use the + operator because + // array_merge() renumbers numeric keys starting with 0, therefore + // we would lose a db name that consists only of numbers + + foreach ($tables as $one_database => $its_tables) { + if (isset($this->_table_cache[$one_database])) { + // the + operator does not do the intended effect + // when the cache for one table already exists + if ($table + && isset($this->_table_cache[$one_database][$table]) + ) { + unset($this->_table_cache[$one_database][$table]); + } + $this->_table_cache[$one_database] + = $this->_table_cache[$one_database] + $tables[$one_database]; + } else { + $this->_table_cache[$one_database] = $tables[$one_database]; + } + } + } + + /** + * Stores query data into session data for debugging purposes + * + * @param string $query Query text + * @param integer $link link type + * @param object|boolean $result Query result + * @param integer $time Time to execute query + * + * @return void + */ + private function _dbgQuery($query, $link, $result, $time) + { + $dbgInfo = array(); + $error_message = $this->getError($link); + if ($result == false && is_string($error_message)) { + $dbgInfo['error'] + = '<span style="color:red">' + . htmlspecialchars($error_message) . '</span>'; + } + $dbgInfo['query'] = htmlspecialchars($query); + $dbgInfo['time'] = $time; + // Get and slightly format backtrace, this is used + // in the javascript console. + // Strip call to _dbgQuery + $dbgInfo['trace'] = Error::processBacktrace( + array_slice(debug_backtrace(), 1) + ); + $dbgInfo['hash'] = md5($query); + + $_SESSION['debug']['queries'][] = $dbgInfo; + } + + /** + * runs a query and returns the result + * + * @param string $query query to run + * @param integer $link link type + * @param integer $options query options + * @param bool $cache_affected_rows whether to cache affected row + * + * @return mixed + */ + public function tryQuery($query, $link = DatabaseInterface::CONNECT_USER, $options = 0, + $cache_affected_rows = true + ) { + $debug = isset($GLOBALS['cfg']['DBG']) ? $GLOBALS['cfg']['DBG']['sql'] : false; + if (! isset($this->_links[$link])) { + return false; + } + + if ($debug) { + $time = microtime(true); + } + + $result = $this->_extension->realQuery($query, $this->_links[$link], $options); + + if ($cache_affected_rows) { + $GLOBALS['cached_affected_rows'] = $this->affectedRows($link, false); + } + + if ($debug) { + $time = microtime(true) - $time; + $this->_dbgQuery($query, $link, $result, $time); + if ($GLOBALS['cfg']['DBG']['sqllog']) { + $warningsCount = ''; + if (($options & DatabaseInterface::QUERY_STORE) == DatabaseInterface::QUERY_STORE) { + if (isset($this->_links[$link]->warning_count)) { + $warningsCount = $this->_links[$link]->warning_count; + } + } + + openlog('phpMyAdmin', LOG_NDELAY | LOG_PID, LOG_USER); + + syslog( + LOG_INFO, + 'SQL[' . basename($_SERVER['SCRIPT_NAME']) . ']: ' + . sprintf('%0.3f', $time) . '(W:' . $warningsCount . ') > ' . $query + ); + closelog(); + } + } + + if ($result !== false && Tracker::isActive()) { + Tracker::handleQuery($query); + } + + return $result; + } + + /** + * Run multi query statement and return results + * + * @param string $multi_query multi query statement to execute + * @param mysqli $link mysqli object + * + * @return mysqli_result collection | boolean(false) + */ + public function tryMultiQuery($multi_query = '', $link = DatabaseInterface::CONNECT_USER) + { + if (! isset($this->_links[$link])) { + return false; + } + return $this->_extension->realMultiQuery($this->_links[$link], $multi_query); + } + + /** + * returns array with table names for given db + * + * @param string $database name of database + * @param mixed $link mysql link resource|object + * + * @return array tables names + */ + public function getTables($database, $link = DatabaseInterface::CONNECT_USER) + { + $tables = $this->fetchResult( + 'SHOW TABLES FROM ' . Util::backquote($database) . ';', + null, + 0, + $link, + self::QUERY_STORE + ); + if ($GLOBALS['cfg']['NaturalOrder']) { + usort($tables, 'strnatcasecmp'); + } + return $tables; + } + + + /** + * returns + * + * @param string $database name of database + * @param array $tables list of tables to search for for relations + * @param int $link mysql link resource|object + * + * @return array array of found foreign keys + */ + public function getForeignKeyConstrains($database, array $tables, $link = DatabaseInterface::CONNECT_USER) + { + $tablesListForQuery = ''; + foreach($tables as $table){ + $tablesListForQuery .= "'" . $this->escapeString($table) . "',"; + } + $tablesListForQuery = rtrim($tablesListForQuery, ','); + + $foreignKeyConstrains = $this->fetchResult( + "SELECT" + . " TABLE_NAME," + . " COLUMN_NAME," + . " REFERENCED_TABLE_NAME," + . " REFERENCED_COLUMN_NAME" + . " FROM information_schema.key_column_usage" + . " WHERE referenced_table_name IS NOT NULL" + . " AND TABLE_SCHEMA = '" . $this->escapeString($database) . "'" + . " AND TABLE_NAME IN (" . $tablesListForQuery . ")" + . " AND REFERENCED_TABLE_NAME IN (" . $tablesListForQuery . ");", + null, + null, + $link, + self::QUERY_STORE + ); + return $foreignKeyConstrains; + } + + /** + * returns a segment of the SQL WHERE clause regarding table name and type + * + * @param array|string $table table(s) + * @param boolean $tbl_is_group $table is a table group + * @param string $table_type whether table or view + * + * @return string a segment of the WHERE clause + */ + private function _getTableCondition($table, $tbl_is_group, $table_type) + { + // get table information from information_schema + if ($table) { + if (is_array($table)) { + $sql_where_table = 'AND t.`TABLE_NAME` ' + . Util::getCollateForIS() . ' IN (\'' + . implode( + '\', \'', + array_map( + array($this, 'escapeString'), + $table + ) + ) + . '\')'; + } elseif (true === $tbl_is_group) { + $sql_where_table = 'AND t.`TABLE_NAME` LIKE \'' + . Util::escapeMysqlWildcards( + $GLOBALS['dbi']->escapeString($table) + ) + . '%\''; + } else { + $sql_where_table = 'AND t.`TABLE_NAME` ' + . Util::getCollateForIS() . ' = \'' + . $GLOBALS['dbi']->escapeString($table) . '\''; + } + } else { + $sql_where_table = ''; + } + + if ($table_type) { + if ($table_type == 'view') { + $sql_where_table .= " AND t.`TABLE_TYPE` NOT IN ('BASE TABLE', 'SYSTEM VERSIONED')"; + } elseif ($table_type == 'table') { + $sql_where_table .= " AND t.`TABLE_TYPE` IN ('BASE TABLE', 'SYSTEM VERSIONED')"; + } + } + return $sql_where_table; + } + + /** + * returns the beginning of the SQL statement to fetch the list of tables + * + * @param string[] $this_databases databases to list + * @param string $sql_where_table additional condition + * + * @return string the SQL statement + */ + private function _getSqlForTablesFull($this_databases, $sql_where_table) + { + $sql = ' + SELECT *, + `TABLE_SCHEMA` AS `Db`, + `TABLE_NAME` AS `Name`, + `TABLE_TYPE` AS `TABLE_TYPE`, + `ENGINE` AS `Engine`, + `ENGINE` AS `Type`, + `VERSION` AS `Version`, + `ROW_FORMAT` AS `Row_format`, + `TABLE_ROWS` AS `Rows`, + `AVG_ROW_LENGTH` AS `Avg_row_length`, + `DATA_LENGTH` AS `Data_length`, + `MAX_DATA_LENGTH` AS `Max_data_length`, + `INDEX_LENGTH` AS `Index_length`, + `DATA_FREE` AS `Data_free`, + `AUTO_INCREMENT` AS `Auto_increment`, + `CREATE_TIME` AS `Create_time`, + `UPDATE_TIME` AS `Update_time`, + `CHECK_TIME` AS `Check_time`, + `TABLE_COLLATION` AS `Collation`, + `CHECKSUM` AS `Checksum`, + `CREATE_OPTIONS` AS `Create_options`, + `TABLE_COMMENT` AS `Comment` + FROM `information_schema`.`TABLES` t + WHERE `TABLE_SCHEMA` ' . Util::getCollateForIS() . ' + IN (\'' . implode("', '", $this_databases) . '\') + ' . $sql_where_table; + + return $sql; + } + + /** + * returns array of all tables in given db or dbs + * this function expects unquoted names: + * RIGHT: my_database + * WRONG: `my_database` + * WRONG: my\_database + * if $tbl_is_group is true, $table is used as filter for table names + * + * <code> + * $GLOBALS['dbi']->getTablesFull('my_database'); + * $GLOBALS['dbi']->getTablesFull('my_database', 'my_table')); + * $GLOBALS['dbi']->getTablesFull('my_database', 'my_tables_', true)); + * </code> + * + * @param string $database database + * @param string|array $table table name(s) + * @param boolean $tbl_is_group $table is a table group + * @param integer $limit_offset zero-based offset for the count + * @param boolean|integer $limit_count number of tables to return + * @param string $sort_by table attribute to sort by + * @param string $sort_order direction to sort (ASC or DESC) + * @param string $table_type whether table or view + * @param integer $link link type + * + * @todo move into Table + * + * @return array list of tables in given db(s) + */ + public function getTablesFull($database, $table = '', + $tbl_is_group = false, $limit_offset = 0, + $limit_count = false, $sort_by = 'Name', $sort_order = 'ASC', + $table_type = null, $link = DatabaseInterface::CONNECT_USER + ) { + if (true === $limit_count) { + $limit_count = $GLOBALS['cfg']['MaxTableList']; + } + // prepare and check parameters + if (! is_array($database)) { + $databases = array($database); + } else { + $databases = $database; + } + + $tables = array(); + + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + $sql_where_table = $this->_getTableCondition( + $table, $tbl_is_group, $table_type + ); + + // for PMA bc: + // `SCHEMA_FIELD_NAME` AS `SHOW_TABLE_STATUS_FIELD_NAME` + // + // on non-Windows servers, + // added BINARY in the WHERE clause to force a case sensitive + // comparison (if we are looking for the db Aa we don't want + // to find the db aa) + $this_databases = array_map( + array($this, 'escapeString'), + $databases + ); + + $sql = $this->_getSqlForTablesFull($this_databases, $sql_where_table); + + // Sort the tables + $sql .= " ORDER BY $sort_by $sort_order"; + + if ($limit_count) { + $sql .= ' LIMIT ' . $limit_count . ' OFFSET ' . $limit_offset; + } + + $tables = $this->fetchResult( + $sql, array('TABLE_SCHEMA', 'TABLE_NAME'), null, $link + ); + + if ($sort_by == 'Name' && $GLOBALS['cfg']['NaturalOrder']) { + // here, the array's first key is by schema name + foreach ($tables as $one_database_name => $one_database_tables) { + uksort($one_database_tables, 'strnatcasecmp'); + + if ($sort_order == 'DESC') { + $one_database_tables = array_reverse($one_database_tables); + } + $tables[$one_database_name] = $one_database_tables; + } + } elseif ($sort_by == 'Data_length') { + // Size = Data_length + Index_length + foreach ($tables as $one_database_name => $one_database_tables) { + uasort( + $one_database_tables, + function ($a, $b) { + $aLength = $a['Data_length'] + $a['Index_length']; + $bLength = $b['Data_length'] + $b['Index_length']; + return $aLength == $bLength + ? 0 + : ($aLength < $bLength ? -1 : 1); + } + ); + + if ($sort_order == 'DESC') { + $one_database_tables = array_reverse($one_database_tables); + } + $tables[$one_database_name] = $one_database_tables; + } + } + } // end (get information from table schema) + + // If permissions are wrong on even one database directory, + // information_schema does not return any table info for any database + // this is why we fall back to SHOW TABLE STATUS even for MySQL >= 50002 + if (empty($tables)) { + foreach ($databases as $each_database) { + if ($table || (true === $tbl_is_group) || ! empty($table_type)) { + $sql = 'SHOW TABLE STATUS FROM ' + . Util::backquote($each_database) + . ' WHERE'; + $needAnd = false; + if ($table || (true === $tbl_is_group)) { + if (is_array($table)) { + $sql .= ' `Name` IN (\'' + . implode( + '\', \'', + array_map( + array($this, 'escapeString'), + $table, + $link + ) + ) . '\')'; + } else { + $sql .= " `Name` LIKE '" + . Util::escapeMysqlWildcards( + $this->escapeString($table, $link) + ) + . "%'"; + } + $needAnd = true; + } + if (! empty($table_type)) { + if ($needAnd) { + $sql .= " AND"; + } + if ($table_type == 'view') { + $sql .= " `Comment` = 'VIEW'"; + } elseif ($table_type == 'table') { + $sql .= " `Comment` != 'VIEW'"; + } + } + } else { + $sql = 'SHOW TABLE STATUS FROM ' + . Util::backquote($each_database); + } + + $each_tables = $this->fetchResult($sql, 'Name', null, $link); + + // Sort naturally if the config allows it and we're sorting + // the Name column. + if ($sort_by == 'Name' && $GLOBALS['cfg']['NaturalOrder']) { + uksort($each_tables, 'strnatcasecmp'); + + if ($sort_order == 'DESC') { + $each_tables = array_reverse($each_tables); + } + } else { + // Prepare to sort by creating array of the selected sort + // value to pass to array_multisort + + // Size = Data_length + Index_length + if ($sort_by == 'Data_length') { + foreach ($each_tables as $table_name => $table_data) { + ${$sort_by}[$table_name] = strtolower( + $table_data['Data_length'] + + $table_data['Index_length'] + ); + } + } else { + foreach ($each_tables as $table_name => $table_data) { + ${$sort_by}[$table_name] + = strtolower($table_data[$sort_by]); + } + } + + if (! empty($$sort_by)) { + if ($sort_order == 'DESC') { + array_multisort($$sort_by, SORT_DESC, $each_tables); + } else { + array_multisort($$sort_by, SORT_ASC, $each_tables); + } + } + + // cleanup the temporary sort array + unset($$sort_by); + } + + if ($limit_count) { + $each_tables = array_slice( + $each_tables, $limit_offset, $limit_count + ); + } + + foreach ($each_tables as $table_name => $each_table) { + if (! isset($each_tables[$table_name]['Type']) + && isset($each_tables[$table_name]['Engine']) + ) { + // pma BC, same parts of PMA still uses 'Type' + $each_tables[$table_name]['Type'] + =& $each_tables[$table_name]['Engine']; + } elseif (! isset($each_tables[$table_name]['Engine']) + && isset($each_tables[$table_name]['Type']) + ) { + // old MySQL reports Type, newer MySQL reports Engine + $each_tables[$table_name]['Engine'] + =& $each_tables[$table_name]['Type']; + } + + // Compatibility with INFORMATION_SCHEMA output + $each_tables[$table_name]['TABLE_SCHEMA'] + = $each_database; + $each_tables[$table_name]['TABLE_NAME'] + =& $each_tables[$table_name]['Name']; + $each_tables[$table_name]['ENGINE'] + =& $each_tables[$table_name]['Engine']; + $each_tables[$table_name]['VERSION'] + =& $each_tables[$table_name]['Version']; + $each_tables[$table_name]['ROW_FORMAT'] + =& $each_tables[$table_name]['Row_format']; + $each_tables[$table_name]['TABLE_ROWS'] + =& $each_tables[$table_name]['Rows']; + $each_tables[$table_name]['AVG_ROW_LENGTH'] + =& $each_tables[$table_name]['Avg_row_length']; + $each_tables[$table_name]['DATA_LENGTH'] + =& $each_tables[$table_name]['Data_length']; + $each_tables[$table_name]['MAX_DATA_LENGTH'] + =& $each_tables[$table_name]['Max_data_length']; + $each_tables[$table_name]['INDEX_LENGTH'] + =& $each_tables[$table_name]['Index_length']; + $each_tables[$table_name]['DATA_FREE'] + =& $each_tables[$table_name]['Data_free']; + $each_tables[$table_name]['AUTO_INCREMENT'] + =& $each_tables[$table_name]['Auto_increment']; + $each_tables[$table_name]['CREATE_TIME'] + =& $each_tables[$table_name]['Create_time']; + $each_tables[$table_name]['UPDATE_TIME'] + =& $each_tables[$table_name]['Update_time']; + $each_tables[$table_name]['CHECK_TIME'] + =& $each_tables[$table_name]['Check_time']; + $each_tables[$table_name]['TABLE_COLLATION'] + =& $each_tables[$table_name]['Collation']; + $each_tables[$table_name]['CHECKSUM'] + =& $each_tables[$table_name]['Checksum']; + $each_tables[$table_name]['CREATE_OPTIONS'] + =& $each_tables[$table_name]['Create_options']; + $each_tables[$table_name]['TABLE_COMMENT'] + =& $each_tables[$table_name]['Comment']; + + if (strtoupper($each_tables[$table_name]['Comment']) === 'VIEW' + && $each_tables[$table_name]['Engine'] == null + ) { + $each_tables[$table_name]['TABLE_TYPE'] = 'VIEW'; + } elseif ($each_database == 'information_schema') { + $each_tables[$table_name]['TABLE_TYPE'] = 'SYSTEM VIEW'; + } else { + /** + * @todo difference between 'TEMPORARY' and 'BASE TABLE' + * but how to detect? + */ + $each_tables[$table_name]['TABLE_TYPE'] = 'BASE TABLE'; + } + } + + $tables[$each_database] = $each_tables; + } + } + + // cache table data + // so Table does not require to issue SHOW TABLE STATUS again + $this->_cacheTableData($tables, $table); + + if (is_array($database)) { + return $tables; + } + + if (isset($tables[$database])) { + return $tables[$database]; + } + + if (isset($tables[mb_strtolower($database)])) { + // on windows with lower_case_table_names = 1 + // MySQL returns + // with SHOW DATABASES or information_schema.SCHEMATA: `Test` + // but information_schema.TABLES gives `test` + // see https://github.com/phpmyadmin/phpmyadmin/issues/8402 + return $tables[mb_strtolower($database)]; + } + + return $tables; + } + + /** + * Get VIEWs in a particular database + * + * @param string $db Database name to look in + * + * @return array $views Set of VIEWs inside the database + */ + public function getVirtualTables($db) + { + + $tables_full = $this->getTablesFull($db); + $views = array(); + + foreach ($tables_full as $table=>$tmp) { + + $_table = $this->getTable($db, $table); + if ($_table->isView()) { + $views[] = $table; + } + + } + + return $views; + + } + + + /** + * returns array with databases containing extended infos about them + * + * @param string $database database + * @param boolean $force_stats retrieve stats also for MySQL < 5 + * @param integer $link link type + * @param string $sort_by column to order by + * @param string $sort_order ASC or DESC + * @param integer $limit_offset starting offset for LIMIT + * @param bool|int $limit_count row count for LIMIT or true + * for $GLOBALS['cfg']['MaxDbList'] + * + * @todo move into ListDatabase? + * + * @return array $databases + */ + public function getDatabasesFull($database = null, $force_stats = false, + $link = DatabaseInterface::CONNECT_USER, $sort_by = 'SCHEMA_NAME', $sort_order = 'ASC', + $limit_offset = 0, $limit_count = false + ) { + $sort_order = strtoupper($sort_order); + + if (true === $limit_count) { + $limit_count = $GLOBALS['cfg']['MaxDbList']; + } + + $apply_limit_and_order_manual = true; + + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + /** + * if $GLOBALS['cfg']['NaturalOrder'] is enabled, we cannot use LIMIT + * cause MySQL does not support natural ordering, + * we have to do it afterward + */ + $limit = ''; + if (! $GLOBALS['cfg']['NaturalOrder']) { + if ($limit_count) { + $limit = ' LIMIT ' . $limit_count . ' OFFSET ' . $limit_offset; + } + + $apply_limit_and_order_manual = false; + } + + // get table information from information_schema + if (! empty($database)) { + $sql_where_schema = 'WHERE `SCHEMA_NAME` LIKE \'' + . $this->escapeString($database, $link) . '\''; + } else { + $sql_where_schema = ''; + } + + $sql = 'SELECT *, + CAST(BIN_NAME AS CHAR CHARACTER SET utf8) AS SCHEMA_NAME + FROM ('; + $sql .= 'SELECT + BINARY s.SCHEMA_NAME AS BIN_NAME, + s.DEFAULT_COLLATION_NAME'; + if ($force_stats) { + $sql .= ', + COUNT(t.TABLE_SCHEMA) AS SCHEMA_TABLES, + SUM(t.TABLE_ROWS) AS SCHEMA_TABLE_ROWS, + SUM(t.DATA_LENGTH) AS SCHEMA_DATA_LENGTH, + SUM(t.MAX_DATA_LENGTH) AS SCHEMA_MAX_DATA_LENGTH, + SUM(t.INDEX_LENGTH) AS SCHEMA_INDEX_LENGTH, + SUM(t.DATA_LENGTH + t.INDEX_LENGTH) + AS SCHEMA_LENGTH, + SUM(IF(t.ENGINE <> \'InnoDB\', t.DATA_FREE, 0)) + AS SCHEMA_DATA_FREE'; + } + $sql .= ' + FROM `information_schema`.SCHEMATA s '; + if ($force_stats) { + $sql .= ' + LEFT JOIN `information_schema`.TABLES t + ON BINARY t.TABLE_SCHEMA = BINARY s.SCHEMA_NAME'; + } + $sql .= $sql_where_schema . ' + GROUP BY BINARY s.SCHEMA_NAME, s.DEFAULT_COLLATION_NAME + ORDER BY '; + if ($sort_by == 'SCHEMA_NAME' + || $sort_by == 'DEFAULT_COLLATION_NAME' + ) { + $sql .= 'BINARY '; + } + $sql .= Util::backquote($sort_by) + . ' ' . $sort_order + . $limit; + $sql .= ') a'; + + $databases = $this->fetchResult($sql, 'SCHEMA_NAME', null, $link); + + $mysql_error = $this->getError($link); + if (! count($databases) && $GLOBALS['errno']) { + Util::mysqlDie($mysql_error, $sql); + } + + // display only databases also in official database list + // f.e. to apply hide_db and only_db + $drops = array_diff( + array_keys($databases), (array) $GLOBALS['dblist']->databases + ); + foreach ($drops as $drop) { + unset($databases[$drop]); + } + } else { + $databases = array(); + foreach ($GLOBALS['dblist']->databases as $database_name) { + // Compatibility with INFORMATION_SCHEMA output + $databases[$database_name]['SCHEMA_NAME'] = $database_name; + + $databases[$database_name]['DEFAULT_COLLATION_NAME'] + = $this->getDbCollation($database_name); + + if (!$force_stats) { + continue; + } + + // get additional info about tables + $databases[$database_name]['SCHEMA_TABLES'] = 0; + $databases[$database_name]['SCHEMA_TABLE_ROWS'] = 0; + $databases[$database_name]['SCHEMA_DATA_LENGTH'] = 0; + $databases[$database_name]['SCHEMA_MAX_DATA_LENGTH'] = 0; + $databases[$database_name]['SCHEMA_INDEX_LENGTH'] = 0; + $databases[$database_name]['SCHEMA_LENGTH'] = 0; + $databases[$database_name]['SCHEMA_DATA_FREE'] = 0; + + $res = $this->query( + 'SHOW TABLE STATUS FROM ' + . Util::backquote($database_name) . ';' + ); + + if ($res === false) { + unset($res); + continue; + } + + while ($row = $this->fetchAssoc($res)) { + $databases[$database_name]['SCHEMA_TABLES']++; + $databases[$database_name]['SCHEMA_TABLE_ROWS'] + += $row['Rows']; + $databases[$database_name]['SCHEMA_DATA_LENGTH'] + += $row['Data_length']; + $databases[$database_name]['SCHEMA_MAX_DATA_LENGTH'] + += $row['Max_data_length']; + $databases[$database_name]['SCHEMA_INDEX_LENGTH'] + += $row['Index_length']; + + // for InnoDB, this does not contain the number of + // overhead bytes but the total free space + if ('InnoDB' != $row['Engine']) { + $databases[$database_name]['SCHEMA_DATA_FREE'] + += $row['Data_free']; + } + $databases[$database_name]['SCHEMA_LENGTH'] + += $row['Data_length'] + $row['Index_length']; + } + $this->freeResult($res); + unset($res); + } + } + + /** + * apply limit and order manually now + * (caused by older MySQL < 5 or $GLOBALS['cfg']['NaturalOrder']) + */ + if ($apply_limit_and_order_manual) { + $GLOBALS['callback_sort_order'] = $sort_order; + $GLOBALS['callback_sort_by'] = $sort_by; + usort( + $databases, + array(self::class, '_usortComparisonCallback') + ); + unset($GLOBALS['callback_sort_order'], $GLOBALS['callback_sort_by']); + + /** + * now apply limit + */ + if ($limit_count) { + $databases = array_slice($databases, $limit_offset, $limit_count); + } + } + + return $databases; + } + + /** + * usort comparison callback + * + * @param string $a first argument to sort + * @param string $b second argument to sort + * + * @return integer a value representing whether $a should be before $b in the + * sorted array or not + * + * @access private + */ + private static function _usortComparisonCallback($a, $b) + { + if ($GLOBALS['cfg']['NaturalOrder']) { + $sorter = 'strnatcasecmp'; + } else { + $sorter = 'strcasecmp'; + } + /* No sorting when key is not present */ + if (! isset($a[$GLOBALS['callback_sort_by']]) + || ! isset($b[$GLOBALS['callback_sort_by']]) + ) { + return 0; + } + // produces f.e.: + // return -1 * strnatcasecmp($a["SCHEMA_TABLES"], $b["SCHEMA_TABLES"]) + return ($GLOBALS['callback_sort_order'] == 'ASC' ? 1 : -1) * $sorter( + $a[$GLOBALS['callback_sort_by']], $b[$GLOBALS['callback_sort_by']] + ); + } // end of the '_usortComparisonCallback()' method + + /** + * returns detailed array with all columns for sql + * + * @param string $sql_query target SQL query to get columns + * @param array $view_columns alias for columns + * + * @return array + */ + public function getColumnMapFromSql($sql_query, array $view_columns = array()) + { + $result = $this->tryQuery($sql_query); + + if ($result === false) { + return array(); + } + + $meta = $this->getFieldsMeta( + $result + ); + + $nbFields = count($meta); + if ($nbFields <= 0) { + return array(); + } + + $column_map = array(); + $nbColumns = count($view_columns); + + for ($i=0; $i < $nbFields; $i++) { + + $map = array(); + $map['table_name'] = $meta[$i]->table; + $map['refering_column'] = $meta[$i]->name; + + if ($nbColumns > 1) { + $map['real_column'] = $view_columns[$i]; + } + + $column_map[] = $map; + } + + return $column_map; + } + + /** + * returns detailed array with all columns for given table in database, + * or all tables/databases + * + * @param string $database name of database + * @param string $table name of table to retrieve columns from + * @param string $column name of specific column + * @param mixed $link mysql link resource + * + * @return array + */ + public function getColumnsFull($database = null, $table = null, + $column = null, $link = DatabaseInterface::CONNECT_USER + ) { + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + $sql_wheres = array(); + $array_keys = array(); + + // get columns information from information_schema + if (null !== $database) { + $sql_wheres[] = '`TABLE_SCHEMA` = \'' + . $this->escapeString($database, $link) . '\' '; + } else { + $array_keys[] = 'TABLE_SCHEMA'; + } + if (null !== $table) { + $sql_wheres[] = '`TABLE_NAME` = \'' + . $this->escapeString($table, $link) . '\' '; + } else { + $array_keys[] = 'TABLE_NAME'; + } + if (null !== $column) { + $sql_wheres[] = '`COLUMN_NAME` = \'' + . $this->escapeString($column, $link) . '\' '; + } else { + $array_keys[] = 'COLUMN_NAME'; + } + + // for PMA bc: + // `[SCHEMA_FIELD_NAME]` AS `[SHOW_FULL_COLUMNS_FIELD_NAME]` + $sql = ' + SELECT *, + `COLUMN_NAME` AS `Field`, + `COLUMN_TYPE` AS `Type`, + `COLLATION_NAME` AS `Collation`, + `IS_NULLABLE` AS `Null`, + `COLUMN_KEY` AS `Key`, + `COLUMN_DEFAULT` AS `Default`, + `EXTRA` AS `Extra`, + `PRIVILEGES` AS `Privileges`, + `COLUMN_COMMENT` AS `Comment` + FROM `information_schema`.`COLUMNS`'; + + if (count($sql_wheres)) { + $sql .= "\n" . ' WHERE ' . implode(' AND ', $sql_wheres); + } + return $this->fetchResult($sql, $array_keys, null, $link); + } + + $columns = array(); + if (null === $database) { + foreach ($GLOBALS['dblist']->databases as $database) { + $columns[$database] = $this->getColumnsFull( + $database, null, null, $link + ); + } + return $columns; + } elseif (null === $table) { + $tables = $this->getTables($database); + foreach ($tables as $table) { + $columns[$table] = $this->getColumnsFull( + $database, $table, null, $link + ); + } + return $columns; + } + $sql = 'SHOW FULL COLUMNS FROM ' + . Util::backquote($database) . '.' . Util::backquote($table); + if (null !== $column) { + $sql .= " LIKE '" . $this->escapeString($column, $link) . "'"; + } + + $columns = $this->fetchResult($sql, 'Field', null, $link); + $ordinal_position = 1; + foreach ($columns as $column_name => $each_column) { + + // Compatibility with INFORMATION_SCHEMA output + $columns[$column_name]['COLUMN_NAME'] + =& $columns[$column_name]['Field']; + $columns[$column_name]['COLUMN_TYPE'] + =& $columns[$column_name]['Type']; + $columns[$column_name]['COLLATION_NAME'] + =& $columns[$column_name]['Collation']; + $columns[$column_name]['IS_NULLABLE'] + =& $columns[$column_name]['Null']; + $columns[$column_name]['COLUMN_KEY'] + =& $columns[$column_name]['Key']; + $columns[$column_name]['COLUMN_DEFAULT'] + =& $columns[$column_name]['Default']; + $columns[$column_name]['EXTRA'] + =& $columns[$column_name]['Extra']; + $columns[$column_name]['PRIVILEGES'] + =& $columns[$column_name]['Privileges']; + $columns[$column_name]['COLUMN_COMMENT'] + =& $columns[$column_name]['Comment']; + + $columns[$column_name]['TABLE_CATALOG'] = null; + $columns[$column_name]['TABLE_SCHEMA'] = $database; + $columns[$column_name]['TABLE_NAME'] = $table; + $columns[$column_name]['ORDINAL_POSITION'] = $ordinal_position; + $columns[$column_name]['DATA_TYPE'] + = substr( + $columns[$column_name]['COLUMN_TYPE'], + 0, + strpos($columns[$column_name]['COLUMN_TYPE'], '(') + ); + /** + * @todo guess CHARACTER_MAXIMUM_LENGTH from COLUMN_TYPE + */ + $columns[$column_name]['CHARACTER_MAXIMUM_LENGTH'] = null; + /** + * @todo guess CHARACTER_OCTET_LENGTH from CHARACTER_MAXIMUM_LENGTH + */ + $columns[$column_name]['CHARACTER_OCTET_LENGTH'] = null; + $columns[$column_name]['NUMERIC_PRECISION'] = null; + $columns[$column_name]['NUMERIC_SCALE'] = null; + $columns[$column_name]['CHARACTER_SET_NAME'] + = substr( + $columns[$column_name]['COLLATION_NAME'], + 0, + strpos($columns[$column_name]['COLLATION_NAME'], '_') + ); + + $ordinal_position++; + } + + if (null !== $column) { + return reset($columns); + } + + return $columns; + } + + /** + * Returns SQL query for fetching columns for a table + * + * The 'Key' column is not calculated properly, use $GLOBALS['dbi']->getColumns() + * to get correct values. + * + * @param string $database name of database + * @param string $table name of table to retrieve columns from + * @param string $column name of column, null to show all columns + * @param boolean $full whether to return full info or only column names + * + * @see getColumns() + * + * @return string + */ + public function getColumnsSql($database, $table, $column = null, $full = false) + { + $sql = 'SHOW ' . ($full ? 'FULL' : '') . ' COLUMNS FROM ' + . Util::backquote($database) . '.' . Util::backquote($table) + . (($column !== null) ? "LIKE '" + . $GLOBALS['dbi']->escapeString($column) . "'" : ''); + + return $sql; + } + + /** + * Returns descriptions of columns in given table (all or given by $column) + * + * @param string $database name of database + * @param string $table name of table to retrieve columns from + * @param string $column name of column, null to show all columns + * @param boolean $full whether to return full info or only column names + * @param integer $link link type + * + * @return array array indexed by column names or, + * if $column is given, flat array description + */ + public function getColumns($database, $table, $column = null, $full = false, + $link = DatabaseInterface::CONNECT_USER + ) { + $sql = $this->getColumnsSql($database, $table, $column, $full); + $fields = $this->fetchResult($sql, 'Field', null, $link); + if (! is_array($fields) || count($fields) == 0) { + return array(); + } + // Check if column is a part of multiple-column index and set its 'Key'. + $indexes = Index::getFromTable($table, $database); + foreach ($fields as $field => $field_data) { + if (!empty($field_data['Key'])) { + continue; + } + + foreach ($indexes as $index) { + /** @var Index $index */ + if (!$index->hasColumn($field)) { + continue; + } + + $index_columns = $index->getColumns(); + if ($index_columns[$field]->getSeqInIndex() > 1) { + if ($index->isUnique()) { + $fields[$field]['Key'] = 'UNI'; + } else { + $fields[$field]['Key'] = 'MUL'; + } + } + } + } + + return ($column != null) ? array_shift($fields) : $fields; + } + + /** + * Returns all column names in given table + * + * @param string $database name of database + * @param string $table name of table to retrieve columns from + * @param mixed $link mysql link resource + * + * @return null|array + */ + public function getColumnNames($database, $table, $link = DatabaseInterface::CONNECT_USER) + { + $sql = $this->getColumnsSql($database, $table); + // We only need the 'Field' column which contains the table's column names + $fields = array_keys($this->fetchResult($sql, 'Field', null, $link)); + + if (! is_array($fields) || count($fields) == 0) { + return null; + } + return $fields; + } + + /** + * Returns SQL for fetching information on table indexes (SHOW INDEXES) + * + * @param string $database name of database + * @param string $table name of the table whose indexes are to be retrieved + * @param string $where additional conditions for WHERE + * + * @return string SQL for getting indexes + */ + public function getTableIndexesSql($database, $table, $where = null) + { + $sql = 'SHOW INDEXES FROM ' . Util::backquote($database) . '.' + . Util::backquote($table); + if ($where) { + $sql .= ' WHERE (' . $where . ')'; + } + return $sql; + } + + /** + * Returns indexes of a table + * + * @param string $database name of database + * @param string $table name of the table whose indexes are to be retrieved + * @param mixed $link mysql link resource + * + * @return array $indexes + */ + public function getTableIndexes($database, $table, $link = DatabaseInterface::CONNECT_USER) + { + $sql = $this->getTableIndexesSql($database, $table); + $indexes = $this->fetchResult($sql, null, null, $link); + + if (! is_array($indexes) || count($indexes) < 1) { + return array(); + } + return $indexes; + } + + /** + * returns value of given mysql server variable + * + * @param string $var mysql server variable name + * @param int $type DatabaseInterface::GETVAR_SESSION | + * DatabaseInterface::GETVAR_GLOBAL + * @param mixed $link mysql link resource|object + * + * @return mixed value for mysql server variable + */ + public function getVariable( + $var, $type = self::GETVAR_SESSION, $link = DatabaseInterface::CONNECT_USER + ) { + switch ($type) { + case self::GETVAR_SESSION: + $modifier = ' SESSION'; + break; + case self::GETVAR_GLOBAL: + $modifier = ' GLOBAL'; + break; + default: + $modifier = ''; + } + return $this->fetchValue( + 'SHOW' . $modifier . ' VARIABLES LIKE \'' . $var . '\';', 0, 1, $link + ); + } + + /** + * Sets new value for a variable if it is different from the current value + * + * @param string $var variable name + * @param string $value value to set + * @param mixed $link mysql link resource|object + * + * @return bool whether query was a successful + */ + public function setVariable($var, $value, $link = DatabaseInterface::CONNECT_USER) + { + $current_value = $this->getVariable( + $var, self::GETVAR_SESSION, $link + ); + if ($current_value == $value) { + return true; + } + + return $this->query("SET " . $var . " = " . $value . ';', $link); + } + + /** + * Convert version string to integer. + * + * @param string $version MySQL server version + * + * @return int + */ + public static function versionToInt($version) + { + $match = explode('.', $version); + return (int) sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])); + } + + /** + * Function called just after a connection to the MySQL database server has + * been established. It sets the connection collation, and determines the + * version of MySQL which is running. + * + * @return void + */ + public function postConnect() + { + $version = $this->fetchSingleRow( + 'SELECT @@version, @@version_comment', + 'ASSOC', + DatabaseInterface::CONNECT_USER + ); + + if ($version) { + $this->_version_str = isset($version['@@version']) ? $version['@@version'] : ''; + $this->_version_int = self::versionToInt($this->_version_str); + $this->_version_comment = isset($version['@@version_comment']) ? $version['@@version_comment'] : ''; + if (stripos($this->_version_str, 'mariadb') !== false) { + $this->_is_mariadb = true; + } + if (stripos($this->_version_comment, 'percona') !== false) { + $this->_is_percona = true; + } + } + + if ($this->_version_int > 50503) { + $default_charset = 'utf8mb4'; + $default_collation = 'utf8mb4_general_ci'; + } else { + $default_charset = 'utf8'; + $default_collation = 'utf8_general_ci'; + } + $GLOBALS['collation_connection'] = $default_collation; + $GLOBALS['charset_connection'] = $default_charset; + $this->query( + "SET NAMES '$default_charset' COLLATE '$default_collation';", + DatabaseInterface::CONNECT_USER, + self::QUERY_STORE + ); + + /* Locale for messages */ + $locale = LanguageManager::getInstance()->getCurrentLanguage()->getMySQLLocale(); + if (! empty($locale)) { + $this->query( + "SET lc_messages = '" . $locale . "';", + DatabaseInterface::CONNECT_USER, + self::QUERY_STORE + ); + } + + // Set timezone for the session, if required. + if ($GLOBALS['cfg']['Server']['SessionTimeZone'] != '') { + $sql_query_tz = 'SET ' . Util::backquote('time_zone') . ' = ' + . '\'' + . $this->escapeString($GLOBALS['cfg']['Server']['SessionTimeZone']) + . '\''; + + if (! $this->tryQuery($sql_query_tz)) { + $error_message_tz = sprintf( + __( + 'Unable to use timezone "%1$s" for server %2$d. ' + . 'Please check your configuration setting for ' + . '[em]$cfg[\'Servers\'][%3$d][\'SessionTimeZone\'][/em]. ' + . 'phpMyAdmin is currently using the default time zone ' + . 'of the database server.' + ), + $GLOBALS['cfg']['Server']['SessionTimeZone'], + $GLOBALS['server'], + $GLOBALS['server'] + ); + + trigger_error($error_message_tz, E_USER_WARNING); + } + } + + /* Loads closest context to this version. */ + \PhpMyAdmin\SqlParser\Context::loadClosest( + ($this->_is_mariadb ? 'MariaDb' : 'MySql') . $this->_version_int + ); + + /** + * the DatabaseList class as a stub for the ListDatabase class + */ + $GLOBALS['dblist'] = new DatabaseList(); + } + + /** + * Sets collation connection for user link + * + * @param string $collation collation to set + */ + public function setCollation($collation) + { + $charset = $GLOBALS['charset_connection']; + /* Automatically adjust collation if not supported by server */ + if ($charset == 'utf8' && strncmp('utf8mb4_', $collation, 8) == 0) { + $collation = 'utf8_' . substr($collation, 8); + } + $result = $this->tryQuery( + "SET collation_connection = '" + . $this->escapeString($collation, DatabaseInterface::CONNECT_USER) + . "';", + DatabaseInterface::CONNECT_USER, + self::QUERY_STORE + ); + if ($result === false) { + trigger_error( + __('Failed to set configured collation connection!'), + E_USER_WARNING + ); + } else { + $GLOBALS['collation_connection'] = $collation; + } + } + + /** + * This function checks and initialises the phpMyAdmin configuration + * storage state before it is used into session cache. + * + * @return void + */ + public function initRelationParamsCache() + { + $storageDbName = isset($GLOBALS['cfg']['Server']['pmadb']) ? $GLOBALS['cfg']['Server']['pmadb'] : ''; + // Use "phpmyadmin" as a default database name to check to keep the behavior consistent + $storageDbName = $storageDbName !== null + && is_string($storageDbName) + && $storageDbName !== '' ? $storageDbName : 'phpmyadmin'; + + // This will make users not having explicitly listed databases + // have config values filled by the default phpMyAdmin storage table name values + $this->relation->fixPmaTables($storageDbName, false); + + // This global will be changed if fixPmaTables did find one valid table + $storageDbName = isset($GLOBALS['cfg']['Server']['pmadb']) ? $GLOBALS['cfg']['Server']['pmadb'] : ''; + + // Empty means that until now no pmadb was found eligible + if (empty($storageDbName)) { + $this->relation->fixPmaTables($GLOBALS['db'], false); + } + } + + /** + * Function called just after a connection to the MySQL database server has + * been established. It sets the connection collation, and determines the + * version of MySQL which is running. + * + * @return void + */ + public function postConnectControl() + { + // If Zero configuration mode enabled, check PMA tables in current db. + if ($GLOBALS['cfg']['ZeroConf'] == true) { + /** + * the DatabaseList class as a stub for the ListDatabase class + */ + $GLOBALS['dblist'] = new DatabaseList(); + + $this->initRelationParamsCache(); + } + } + + /** + * returns a single value from the given result or query, + * if the query or the result has more than one row or field + * the first field of the first row is returned + * + * <code> + * $sql = 'SELECT `name` FROM `user` WHERE `id` = 123'; + * $user_name = $GLOBALS['dbi']->fetchValue($sql); + * // produces + * // $user_name = 'John Doe' + * </code> + * + * @param string $query The query to execute + * @param integer $row_number row to fetch the value from, + * starting at 0, with 0 being default + * @param integer|string $field field to fetch the value from, + * starting at 0, with 0 being default + * @param integer $link link type + * + * @return mixed value of first field in first row from result + * or false if not found + */ + public function fetchValue($query, $row_number = 0, $field = 0, $link = DatabaseInterface::CONNECT_USER) + { + $value = false; + + $result = $this->tryQuery( + $query, + $link, + self::QUERY_STORE, + false + ); + if ($result === false) { + return false; + } + + // return false if result is empty or false + // or requested row is larger than rows in result + if ($this->numRows($result) < ($row_number + 1)) { + return $value; + } + + // if $field is an integer use non associative mysql fetch function + if (is_int($field)) { + $fetch_function = 'fetchRow'; + } else { + $fetch_function = 'fetchAssoc'; + } + + // get requested row + for ($i = 0; $i <= $row_number; $i++) { + $row = $this->$fetch_function($result); + } + $this->freeResult($result); + + // return requested field + if (isset($row[$field])) { + $value = $row[$field]; + } + + return $value; + } + + /** + * returns only the first row from the result + * + * <code> + * $sql = 'SELECT * FROM `user` WHERE `id` = 123'; + * $user = $GLOBALS['dbi']->fetchSingleRow($sql); + * // produces + * // $user = array('id' => 123, 'name' => 'John Doe') + * </code> + * + * @param string $query The query to execute + * @param string $type NUM|ASSOC|BOTH returned array should either numeric + * associative or both + * @param integer $link link type + * + * @return array|boolean first row from result + * or false if result is empty + */ + public function fetchSingleRow($query, $type = 'ASSOC', $link = DatabaseInterface::CONNECT_USER) + { + $result = $this->tryQuery( + $query, + $link, + self::QUERY_STORE, + false + ); + if ($result === false) { + return false; + } + + // return false if result is empty or false + if (! $this->numRows($result)) { + return false; + } + + switch ($type) { + case 'NUM' : + $fetch_function = 'fetchRow'; + break; + case 'ASSOC' : + $fetch_function = 'fetchAssoc'; + break; + case 'BOTH' : + default : + $fetch_function = 'fetchArray'; + break; + } + + $row = $this->$fetch_function($result); + $this->freeResult($result); + return $row; + } + + /** + * Returns row or element of a row + * + * @param array $row Row to process + * @param string|null $value Which column to return + * + * @return mixed + */ + private function _fetchValue(array $row, $value) + { + if (is_null($value)) { + return $row; + } + + return $row[$value]; + } + + /** + * returns all rows in the resultset in one array + * + * <code> + * $sql = 'SELECT * FROM `user`'; + * $users = $GLOBALS['dbi']->fetchResult($sql); + * // produces + * // $users[] = array('id' => 123, 'name' => 'John Doe') + * + * $sql = 'SELECT `id`, `name` FROM `user`'; + * $users = $GLOBALS['dbi']->fetchResult($sql, 'id'); + * // produces + * // $users['123'] = array('id' => 123, 'name' => 'John Doe') + * + * $sql = 'SELECT `id`, `name` FROM `user`'; + * $users = $GLOBALS['dbi']->fetchResult($sql, 0); + * // produces + * // $users['123'] = array(0 => 123, 1 => 'John Doe') + * + * $sql = 'SELECT `id`, `name` FROM `user`'; + * $users = $GLOBALS['dbi']->fetchResult($sql, 'id', 'name'); + * // or + * $users = $GLOBALS['dbi']->fetchResult($sql, 0, 1); + * // produces + * // $users['123'] = 'John Doe' + * + * $sql = 'SELECT `name` FROM `user`'; + * $users = $GLOBALS['dbi']->fetchResult($sql); + * // produces + * // $users[] = 'John Doe' + * + * $sql = 'SELECT `group`, `name` FROM `user`' + * $users = $GLOBALS['dbi']->fetchResult($sql, array('group', null), 'name'); + * // produces + * // $users['admin'][] = 'John Doe' + * + * $sql = 'SELECT `group`, `name` FROM `user`' + * $users = $GLOBALS['dbi']->fetchResult($sql, array('group', 'name'), 'id'); + * // produces + * // $users['admin']['John Doe'] = '123' + * </code> + * + * @param string $query query to execute + * @param string|integer|array $key field-name or offset + * used as key for array + * or array of those + * @param string|integer $value value-name or offset + * used as value for array + * @param integer $link link type + * @param integer $options query options + * + * @return array resultrows or values indexed by $key + */ + public function fetchResult($query, $key = null, $value = null, + $link = DatabaseInterface::CONNECT_USER, $options = 0 + ) { + $resultrows = array(); + + $result = $this->tryQuery($query, $link, $options, false); + + // return empty array if result is empty or false + if ($result === false) { + return $resultrows; + } + + $fetch_function = 'fetchAssoc'; + + // no nested array if only one field is in result + if (null === $key && 1 === $this->numFields($result)) { + $value = 0; + $fetch_function = 'fetchRow'; + } + + // if $key is an integer use non associative mysql fetch function + if (is_int($key)) { + $fetch_function = 'fetchRow'; + } + + if (null === $key) { + while ($row = $this->$fetch_function($result)) { + $resultrows[] = $this->_fetchValue($row, $value); + } + } else { + if (is_array($key)) { + while ($row = $this->$fetch_function($result)) { + $result_target =& $resultrows; + foreach ($key as $key_index) { + if (null === $key_index) { + $result_target =& $result_target[]; + continue; + } + + if (! isset($result_target[$row[$key_index]])) { + $result_target[$row[$key_index]] = array(); + } + $result_target =& $result_target[$row[$key_index]]; + } + $result_target = $this->_fetchValue($row, $value); + } + } else { + while ($row = $this->$fetch_function($result)) { + $resultrows[$row[$key]] = $this->_fetchValue($row, $value); + } + } + } + + $this->freeResult($result); + return $resultrows; + } + + /** + * Get supported SQL compatibility modes + * + * @return array supported SQL compatibility modes + */ + public function getCompatibilities() + { + $compats = array('NONE'); + $compats[] = 'ANSI'; + $compats[] = 'DB2'; + $compats[] = 'MAXDB'; + $compats[] = 'MYSQL323'; + $compats[] = 'MYSQL40'; + $compats[] = 'MSSQL'; + $compats[] = 'ORACLE'; + // removed; in MySQL 5.0.33, this produces exports that + // can't be read by POSTGRESQL (see our bug #1596328) + //$compats[] = 'POSTGRESQL'; + $compats[] = 'TRADITIONAL'; + + return $compats; + } + + /** + * returns warnings for last query + * + * @param integer $link link type + * + * @return array warnings + */ + public function getWarnings($link = DatabaseInterface::CONNECT_USER) + { + return $this->fetchResult('SHOW WARNINGS', null, null, $link); + } + + /** + * returns an array of PROCEDURE or FUNCTION names for a db + * + * @param string $db db name + * @param string $which PROCEDURE | FUNCTION + * @param integer $link link type + * + * @return array the procedure names or function names + */ + public function getProceduresOrFunctions($db, $which, $link = DatabaseInterface::CONNECT_USER) + { + $shows = $this->fetchResult( + 'SHOW ' . $which . ' STATUS;', null, null, $link + ); + $result = array(); + foreach ($shows as $one_show) { + if ($one_show['Db'] == $db && $one_show['Type'] == $which) { + $result[] = $one_show['Name']; + } + } + return($result); + } + + /** + * returns the definition of a specific PROCEDURE, FUNCTION, EVENT or VIEW + * + * @param string $db db name + * @param string $which PROCEDURE | FUNCTION | EVENT | VIEW + * @param string $name the procedure|function|event|view name + * @param integer $link link type + * + * @return string the definition + */ + public function getDefinition($db, $which, $name, $link = DatabaseInterface::CONNECT_USER) + { + $returned_field = array( + 'PROCEDURE' => 'Create Procedure', + 'FUNCTION' => 'Create Function', + 'EVENT' => 'Create Event', + 'VIEW' => 'Create View' + ); + $query = 'SHOW CREATE ' . $which . ' ' + . Util::backquote($db) . '.' + . Util::backquote($name); + return($this->fetchValue($query, 0, $returned_field[$which], $link)); + } + + /** + * returns details about the PROCEDUREs or FUNCTIONs for a specific database + * or details about a specific routine + * + * @param string $db db name + * @param string $which PROCEDURE | FUNCTION or null for both + * @param string $name name of the routine (to fetch a specific routine) + * + * @return array information about ROCEDUREs or FUNCTIONs + */ + public function getRoutines($db, $which = null, $name = '') + { + $routines = array(); + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + $query = "SELECT" + . " `ROUTINE_SCHEMA` AS `Db`," + . " `SPECIFIC_NAME` AS `Name`," + . " `ROUTINE_TYPE` AS `Type`," + . " `DEFINER` AS `Definer`," + . " `LAST_ALTERED` AS `Modified`," + . " `CREATED` AS `Created`," + . " `SECURITY_TYPE` AS `Security_type`," + . " `ROUTINE_COMMENT` AS `Comment`," + . " `CHARACTER_SET_CLIENT` AS `character_set_client`," + . " `COLLATION_CONNECTION` AS `collation_connection`," + . " `DATABASE_COLLATION` AS `Database Collation`," + . " `DTD_IDENTIFIER`" + . " FROM `information_schema`.`ROUTINES`" + . " WHERE `ROUTINE_SCHEMA` " . Util::getCollateForIS() + . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; + if (Core::isValid($which, array('FUNCTION','PROCEDURE'))) { + $query .= " AND `ROUTINE_TYPE` = '" . $which . "'"; + } + if (! empty($name)) { + $query .= " AND `SPECIFIC_NAME`" + . " = '" . $GLOBALS['dbi']->escapeString($name) . "'"; + } + $result = $this->fetchResult($query); + if (!empty($result)) { + $routines = $result; + } + } else { + if ($which == 'FUNCTION' || $which == null) { + $query = "SHOW FUNCTION STATUS" + . " WHERE `Db` = '" . $GLOBALS['dbi']->escapeString($db) . "'"; + if (! empty($name)) { + $query .= " AND `Name` = '" + . $GLOBALS['dbi']->escapeString($name) . "'"; + } + $result = $this->fetchResult($query); + if (!empty($result)) { + $routines = array_merge($routines, $result); + } + } + if ($which == 'PROCEDURE' || $which == null) { + $query = "SHOW PROCEDURE STATUS" + . " WHERE `Db` = '" . $GLOBALS['dbi']->escapeString($db) . "'"; + if (! empty($name)) { + $query .= " AND `Name` = '" + . $GLOBALS['dbi']->escapeString($name) . "'"; + } + $result = $this->fetchResult($query); + if (!empty($result)) { + $routines = array_merge($routines, $result); + } + } + } + + $ret = array(); + foreach ($routines as $routine) { + $one_result = array(); + $one_result['db'] = $routine['Db']; + $one_result['name'] = $routine['Name']; + $one_result['type'] = $routine['Type']; + $one_result['definer'] = $routine['Definer']; + $one_result['returns'] = isset($routine['DTD_IDENTIFIER']) + ? $routine['DTD_IDENTIFIER'] : ""; + $ret[] = $one_result; + } + + // Sort results by name + $name = array(); + foreach ($ret as $value) { + $name[] = $value['name']; + } + array_multisort($name, SORT_ASC, $ret); + + return($ret); + } + + /** + * returns details about the EVENTs for a specific database + * + * @param string $db db name + * @param string $name event name + * + * @return array information about EVENTs + */ + public function getEvents($db, $name = '') + { + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + $query = "SELECT" + . " `EVENT_SCHEMA` AS `Db`," + . " `EVENT_NAME` AS `Name`," + . " `DEFINER` AS `Definer`," + . " `TIME_ZONE` AS `Time zone`," + . " `EVENT_TYPE` AS `Type`," + . " `EXECUTE_AT` AS `Execute at`," + . " `INTERVAL_VALUE` AS `Interval value`," + . " `INTERVAL_FIELD` AS `Interval field`," + . " `STARTS` AS `Starts`," + . " `ENDS` AS `Ends`," + . " `STATUS` AS `Status`," + . " `ORIGINATOR` AS `Originator`," + . " `CHARACTER_SET_CLIENT` AS `character_set_client`," + . " `COLLATION_CONNECTION` AS `collation_connection`, " + . "`DATABASE_COLLATION` AS `Database Collation`" + . " FROM `information_schema`.`EVENTS`" + . " WHERE `EVENT_SCHEMA` " . Util::getCollateForIS() + . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; + if (! empty($name)) { + $query .= " AND `EVENT_NAME`" + . " = '" . $GLOBALS['dbi']->escapeString($name) . "'"; + } + } else { + $query = "SHOW EVENTS FROM " . Util::backquote($db); + if (! empty($name)) { + $query .= " AND `Name` = '" + . $GLOBALS['dbi']->escapeString($name) . "'"; + } + } + + $result = array(); + if ($events = $this->fetchResult($query)) { + foreach ($events as $event) { + $one_result = array(); + $one_result['name'] = $event['Name']; + $one_result['type'] = $event['Type']; + $one_result['status'] = $event['Status']; + $result[] = $one_result; + } + } + + // Sort results by name + $name = array(); + foreach ($result as $value) { + $name[] = $value['name']; + } + array_multisort($name, SORT_ASC, $result); + + return $result; + } + + /** + * returns details about the TRIGGERs for a specific table or database + * + * @param string $db db name + * @param string $table table name + * @param string $delimiter the delimiter to use (may be empty) + * + * @return array information about triggers (may be empty) + */ + public function getTriggers($db, $table = '', $delimiter = '//') + { + $result = array(); + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + $query = 'SELECT TRIGGER_SCHEMA, TRIGGER_NAME, EVENT_MANIPULATION' + . ', EVENT_OBJECT_TABLE, ACTION_TIMING, ACTION_STATEMENT' + . ', EVENT_OBJECT_SCHEMA, EVENT_OBJECT_TABLE, DEFINER' + . ' FROM information_schema.TRIGGERS' + . ' WHERE EVENT_OBJECT_SCHEMA ' . Util::getCollateForIS() . '=' + . ' \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + + if (! empty($table)) { + $query .= " AND EVENT_OBJECT_TABLE " . Util::getCollateForIS() + . " = '" . $GLOBALS['dbi']->escapeString($table) . "';"; + } + } else { + $query = "SHOW TRIGGERS FROM " . Util::backquote($db); + if (! empty($table)) { + $query .= " LIKE '" . $GLOBALS['dbi']->escapeString($table) . "';"; + } + } + + if ($triggers = $this->fetchResult($query)) { + foreach ($triggers as $trigger) { + if ($GLOBALS['cfg']['Server']['DisableIS']) { + $trigger['TRIGGER_NAME'] = $trigger['Trigger']; + $trigger['ACTION_TIMING'] = $trigger['Timing']; + $trigger['EVENT_MANIPULATION'] = $trigger['Event']; + $trigger['EVENT_OBJECT_TABLE'] = $trigger['Table']; + $trigger['ACTION_STATEMENT'] = $trigger['Statement']; + $trigger['DEFINER'] = $trigger['Definer']; + } + $one_result = array(); + $one_result['name'] = $trigger['TRIGGER_NAME']; + $one_result['table'] = $trigger['EVENT_OBJECT_TABLE']; + $one_result['action_timing'] = $trigger['ACTION_TIMING']; + $one_result['event_manipulation'] = $trigger['EVENT_MANIPULATION']; + $one_result['definition'] = $trigger['ACTION_STATEMENT']; + $one_result['definer'] = $trigger['DEFINER']; + + // do not prepend the schema name; this way, importing the + // definition into another schema will work + $one_result['full_trigger_name'] = Util::backquote( + $trigger['TRIGGER_NAME'] + ); + $one_result['drop'] = 'DROP TRIGGER IF EXISTS ' + . $one_result['full_trigger_name']; + $one_result['create'] = 'CREATE TRIGGER ' + . $one_result['full_trigger_name'] . ' ' + . $trigger['ACTION_TIMING'] . ' ' + . $trigger['EVENT_MANIPULATION'] + . ' ON ' . Util::backquote($trigger['EVENT_OBJECT_TABLE']) + . "\n" . ' FOR EACH ROW ' + . $trigger['ACTION_STATEMENT'] . "\n" . $delimiter . "\n"; + + $result[] = $one_result; + } + } + + // Sort results by name + $name = array(); + foreach ($result as $value) { + $name[] = $value['name']; + } + array_multisort($name, SORT_ASC, $result); + + return($result); + } + + /** + * Formats database error message in a friendly way. + * This is needed because some errors messages cannot + * be obtained by mysql_error(). + * + * @param int $error_number Error code + * @param string $error_message Error message as returned by server + * + * @return string HML text with error details + */ + public static function formatError($error_number, $error_message) + { + $error_message = htmlspecialchars($error_message); + + $error = '#' . ((string) $error_number); + $separator = ' — '; + + if ($error_number == 2002) { + $error .= ' - ' . $error_message; + $error .= $separator; + $error .= __( + 'The server is not responding (or the local server\'s socket' + . ' is not correctly configured).' + ); + } elseif ($error_number == 2003) { + $error .= ' - ' . $error_message; + $error .= $separator . __('The server is not responding.'); + } elseif ($error_number == 1698 ) { + $error .= ' - ' . $error_message; + $error .= $separator . '<a href="logout.php' . Url::getCommon() . '" class="disableAjax">'; + $error .= __('Logout and try as another user.') . '</a>'; + } elseif ($error_number == 1005) { + if (strpos($error_message, 'errno: 13') !== false) { + $error .= ' - ' . $error_message; + $error .= $separator + . __( + 'Please check privileges of directory containing database.' + ); + } else { + /* InnoDB constraints, see + * https://dev.mysql.com/doc/refman/5.0/en/ + * innodb-foreign-key-constraints.html + */ + $error .= ' - ' . $error_message . + ' (<a href="server_engines.php' . + Url::getCommon( + array('engine' => 'InnoDB', 'page' => 'Status') + ) . '">' . __('Details鈥�') . '</a>)'; + } + } else { + $error .= ' - ' . $error_message; + } + + return $error; + } + + /** + * gets the current user with host + * + * @return string the current user i.e. user@host + */ + public function getCurrentUser() + { + if (Util::cacheExists('mysql_cur_user')) { + return Util::cacheGet('mysql_cur_user'); + } + $user = $this->fetchValue('SELECT CURRENT_USER();'); + if ($user !== false) { + Util::cacheSet('mysql_cur_user', $user); + return $user; + } + return '@'; + } + + /** + * Checks if current user is superuser + * + * @return bool Whether user is a superuser + */ + public function isSuperuser() + { + return self::isUserType('super'); + } + + /** + * Checks if current user has global create user/grant privilege + * or is a superuser (i.e. SELECT on mysql.users) + * while caching the result in session. + * + * @param string $type type of user to check for + * i.e. 'create', 'grant', 'super' + * + * @return bool Whether user is a given type of user + */ + public function isUserType($type) + { + if (Util::cacheExists('is_' . $type . 'user')) { + return Util::cacheGet('is_' . $type . 'user'); + } + + // when connection failed we don't have a $userlink + if (! isset($this->_links[DatabaseInterface::CONNECT_USER])) { + return false; + } + + // checking if user is logged in + if ($type === 'logged') { + return true; + } + + if (! $GLOBALS['cfg']['Server']['DisableIS'] || $type === 'super') { + // Prepare query for each user type check + $query = ''; + if ($type === 'super') { + $query = 'SELECT 1 FROM mysql.user LIMIT 1'; + } elseif ($type === 'create') { + list($user, $host) = $this->getCurrentUserAndHost(); + $query = "SELECT 1 FROM `INFORMATION_SCHEMA`.`USER_PRIVILEGES` " + . "WHERE `PRIVILEGE_TYPE` = 'CREATE USER' AND " + . "'''" . $user . "''@''" . $host . "''' LIKE `GRANTEE` LIMIT 1"; + } elseif ($type === 'grant') { + list($user, $host) = $this->getCurrentUserAndHost(); + $query = "SELECT 1 FROM (" + . "SELECT `GRANTEE`, `IS_GRANTABLE` FROM " + . "`INFORMATION_SCHEMA`.`COLUMN_PRIVILEGES` UNION " + . "SELECT `GRANTEE`, `IS_GRANTABLE` FROM " + . "`INFORMATION_SCHEMA`.`TABLE_PRIVILEGES` UNION " + . "SELECT `GRANTEE`, `IS_GRANTABLE` FROM " + . "`INFORMATION_SCHEMA`.`SCHEMA_PRIVILEGES` UNION " + . "SELECT `GRANTEE`, `IS_GRANTABLE` FROM " + . "`INFORMATION_SCHEMA`.`USER_PRIVILEGES`) t " + . "WHERE `IS_GRANTABLE` = 'YES' AND " + . "'''" . $user . "''@''" . $host . "''' LIKE `GRANTEE` LIMIT 1"; + } + + $is = false; + $result = $this->tryQuery( + $query, + self::CONNECT_USER, + self::QUERY_STORE + ); + if ($result) { + $is = (bool) $this->numRows($result); + } + $this->freeResult($result); + } else { + $is = false; + $grants = $this->fetchResult( + "SHOW GRANTS FOR CURRENT_USER();", + null, + null, + self::CONNECT_USER, + self::QUERY_STORE + ); + if ($grants) { + foreach ($grants as $grant) { + if ($type === 'create') { + if (strpos($grant, "ALL PRIVILEGES ON *.*") !== false + || strpos($grant, "CREATE USER") !== false + ) { + $is = true; + break; + } + } elseif ($type === 'grant') { + if (strpos($grant, "WITH GRANT OPTION") !== false) { + $is = true; + break; + } + } + } + } + } + + Util::cacheSet('is_' . $type . 'user', $is); + return $is; + } + + /** + * Get the current user and host + * + * @return array array of username and hostname + */ + public function getCurrentUserAndHost() + { + if (count($this->_current_user) == 0) { + $user = $this->getCurrentUser(); + $this->_current_user = explode("@", $user); + } + return $this->_current_user; + } + + /** + * Returns value for lower_case_table_names variable + * + * @return string + */ + public function getLowerCaseNames() + { + if (is_null($this->_lower_case_table_names)) { + $this->_lower_case_table_names = $this->fetchValue( + "SELECT @@lower_case_table_names" + ); + } + return $this->_lower_case_table_names; + } + + /** + * Get the list of system schemas + * + * @return array list of system schemas + */ + public function getSystemSchemas() + { + $schemas = array( + 'information_schema', 'performance_schema', 'mysql', 'sys' + ); + $systemSchemas = array(); + foreach ($schemas as $schema) { + if ($this->isSystemSchema($schema, true)) { + $systemSchemas[] = $schema; + } + } + return $systemSchemas; + } + + /** + * Checks whether given schema is a system schema + * + * @param string $schema_name Name of schema (database) to test + * @param bool $testForMysqlSchema Whether 'mysql' schema should + * be treated the same as IS and DD + * + * @return bool + */ + public function isSystemSchema($schema_name, $testForMysqlSchema = false) + { + $schema_name = strtolower($schema_name); + return $schema_name == 'information_schema' + || $schema_name == 'performance_schema' + || ($schema_name == 'mysql' && $testForMysqlSchema) + || $schema_name == 'sys'; + } + + /** + * Return connection parameters for the database server + * + * @param integer $mode Connection mode on of CONNECT_USER, CONNECT_CONTROL + * or CONNECT_AUXILIARY. + * @param array|null $server Server information like host/port/socket/persistent + * + * @return array user, host and server settings array + */ + public function getConnectionParams($mode, $server = null) + { + global $cfg; + + $user = null; + $password = null; + + if ($mode == DatabaseInterface::CONNECT_USER) { + $user = $cfg['Server']['user']; + $password = $cfg['Server']['password']; + $server = $cfg['Server']; + } elseif ($mode == DatabaseInterface::CONNECT_CONTROL) { + $user = $cfg['Server']['controluser']; + $password = $cfg['Server']['controlpass']; + + $server = array(); + + $server['hide_connection_errors'] = $cfg['Server']['hide_connection_errors']; + + if (! empty($cfg['Server']['controlhost'])) { + $server['host'] = $cfg['Server']['controlhost']; + } else { + $server['host'] = $cfg['Server']['host']; + } + // Share the settings if the host is same + if ($server['host'] == $cfg['Server']['host']) { + $shared = array( + 'port', 'socket', 'compress', + 'ssl', 'ssl_key', 'ssl_cert', 'ssl_ca', + 'ssl_ca_path', 'ssl_ciphers', 'ssl_verify', + ); + foreach ($shared as $item) { + if (isset($cfg['Server'][$item])) { + $server[$item] = $cfg['Server'][$item]; + } + } + } + // Set configured port + if (! empty($cfg['Server']['controlport'])) { + $server['port'] = $cfg['Server']['controlport']; + } + // Set any configuration with control_ prefix + foreach ($cfg['Server'] as $key => $val) { + if (substr($key, 0, 8) === 'control_') { + $server[substr($key, 8)] = $val; + } + } + } else { + if (is_null($server)) { + return array(null, null, null); + } + if (isset($server['user'])) { + $user = $server['user']; + } + if (isset($server['password'])) { + $password = $server['password']; + } + } + + // Perform sanity checks on some variables + if (empty($server['port'])) { + $server['port'] = 0; + } else { + $server['port'] = intval($server['port']); + } + if (empty($server['socket'])) { + $server['socket'] = null; + } + if (empty($server['host'])) { + $server['host'] = 'localhost'; + } + if (!isset($server['ssl'])) { + $server['ssl'] = false; + } + if (!isset($server['compress'])) { + $server['compress'] = false; + } + + if (! isset($server['hide_connection_errors'])) { + $server['hide_connection_errors'] = false; + } + + return array($user, $password, $server); + } + + /** + * connects to the database server + * + * @param integer $mode Connection mode on of CONNECT_USER, CONNECT_CONTROL + * or CONNECT_AUXILIARY. + * @param array|null $server Server information like host/port/socket/persistent + * @param integer $target How to store connection link, defaults to $mode + * + * @return mixed false on error or a connection object on success + */ + public function connect($mode, $server = null, $target = null) + { + list($user, $password, $server) = $this->getConnectionParams($mode, $server); + + if (is_null($target)) { + $target = $mode; + } + + if (is_null($user) || is_null($password)) { + trigger_error( + __('Missing connection parameters!'), + E_USER_WARNING + ); + return false; + } + + // Do not show location and backtrace for connection errors + $GLOBALS['error_handler']->setHideLocation(true); + $result = $this->_extension->connect( + $user, $password, $server + ); + $GLOBALS['error_handler']->setHideLocation(false); + + if ($result) { + $this->_links[$target] = $result; + /* Run post connect for user connections */ + if ($target == DatabaseInterface::CONNECT_USER) { + $this->postConnect(); + } + return $result; + } + + if ($mode == DatabaseInterface::CONNECT_CONTROL) { + trigger_error( + __( + 'Connection for controluser as defined in your ' + . 'configuration failed.' + ), + E_USER_WARNING + ); + return false; + } elseif ($mode == DatabaseInterface::CONNECT_AUXILIARY) { + // Do not go back to main login if connection failed + // (currently used only in unit testing) + return false; + } + + return $result; + } + + /** + * selects given database + * + * @param string $dbname database name to select + * @param integer $link link type + * + * @return boolean + */ + public function selectDb($dbname, $link = DatabaseInterface::CONNECT_USER) + { + if (! isset($this->_links[$link])) { + return false; + } + return $this->_extension->selectDb($dbname, $this->_links[$link]); + } + + /** + * returns array of rows with associative and numeric keys from $result + * + * @param object $result result set identifier + * + * @return array + */ + public function fetchArray($result) + { + return $this->_extension->fetchArray($result); + } + + /** + * returns array of rows with associative keys from $result + * + * @param object $result result set identifier + * + * @return array + */ + public function fetchAssoc($result) + { + return $this->_extension->fetchAssoc($result); + } + + /** + * returns array of rows with numeric keys from $result + * + * @param object $result result set identifier + * + * @return array + */ + public function fetchRow($result) + { + return $this->_extension->fetchRow($result); + } + + /** + * Adjusts the result pointer to an arbitrary row in the result + * + * @param object $result database result + * @param integer $offset offset to seek + * + * @return bool true on success, false on failure + */ + public function dataSeek($result, $offset) + { + return $this->_extension->dataSeek($result, $offset); + } + + /** + * Frees memory associated with the result + * + * @param object $result database result + * + * @return void + */ + public function freeResult($result) + { + $this->_extension->freeResult($result); + } + + /** + * Check if there are any more query results from a multi query + * + * @param integer $link link type + * + * @return bool true or false + */ + public function moreResults($link = DatabaseInterface::CONNECT_USER) + { + if (! isset($this->_links[$link])) { + return false; + } + return $this->_extension->moreResults($this->_links[$link]); + } + + /** + * Prepare next result from multi_query + * + * @param integer $link link type + * + * @return bool true or false + */ + public function nextResult($link = DatabaseInterface::CONNECT_USER) + { + if (! isset($this->_links[$link])) { + return false; + } + return $this->_extension->nextResult($this->_links[$link]); + } + + /** + * Store the result returned from multi query + * + * @param integer $link link type + * + * @return mixed false when empty results / result set when not empty + */ + public function storeResult($link = DatabaseInterface::CONNECT_USER) + { + if (! isset($this->_links[$link])) { + return false; + } + return $this->_extension->storeResult($this->_links[$link]); + } + + /** + * Returns a string representing the type of connection used + * + * @param integer $link link type + * + * @return string type of connection used + */ + public function getHostInfo($link = DatabaseInterface::CONNECT_USER) + { + if (! isset($this->_links[$link])) { + return false; + } + return $this->_extension->getHostInfo($this->_links[$link]); + } + + /** + * Returns the version of the MySQL protocol used + * + * @param integer $link link type + * + * @return integer version of the MySQL protocol used + */ + public function getProtoInfo($link = DatabaseInterface::CONNECT_USER) + { + if (! isset($this->_links[$link])) { + return false; + } + return $this->_extension->getProtoInfo($this->_links[$link]); + } + + /** + * returns a string that represents the client library version + * + * @return string MySQL client library version + */ + public function getClientInfo() + { + return $this->_extension->getClientInfo(); + } + + /** + * returns last error message or false if no errors occurred + * + * @param integer $link link type + * + * @return string|bool $error or false + */ + public function getError($link = DatabaseInterface::CONNECT_USER) + { + if (! isset($this->_links[$link])) { + return false; + } + return $this->_extension->getError($this->_links[$link]); + } + + /** + * returns the number of rows returned by last query + * + * @param object $result result set identifier + * + * @return string|int + */ + public function numRows($result) + { + return $this->_extension->numRows($result); + } + + /** + * returns last inserted auto_increment id for given $link + * or $GLOBALS['userlink'] + * + * @param integer $link link type + * + * @return int|boolean + */ + public function insertId($link = DatabaseInterface::CONNECT_USER) + { + // If the primary key is BIGINT we get an incorrect result + // (sometimes negative, sometimes positive) + // and in the present function we don't know if the PK is BIGINT + // so better play safe and use LAST_INSERT_ID() + // + // When no controluser is defined, using mysqli_insert_id($link) + // does not always return the last insert id due to a mixup with + // the tracking mechanism, but this works: + return $this->fetchValue('SELECT LAST_INSERT_ID();', 0, 0, $link); + } + + /** + * returns the number of rows affected by last query + * + * @param integer $link link type + * @param bool $get_from_cache whether to retrieve from cache + * + * @return int|boolean + */ + public function affectedRows($link = DatabaseInterface::CONNECT_USER, $get_from_cache = true) + { + if (! isset($this->_links[$link])) { + return false; + } + + if ($get_from_cache) { + return $GLOBALS['cached_affected_rows']; + } + + return $this->_extension->affectedRows($this->_links[$link]); + } + + /** + * returns metainfo for fields in $result + * + * @param object $result result set identifier + * + * @return array meta info for fields in $result + */ + public function getFieldsMeta($result) + { + $result = $this->_extension->getFieldsMeta($result); + + if ($this->getLowerCaseNames() === '2') { + /** + * Fixup orgtable for lower_case_table_names = 2 + * + * In this setup MySQL server reports table name lower case + * but we still need to operate on original case to properly + * match existing strings + */ + foreach ($result as $value) { + if (strlen($value->orgtable) !== 0 && + mb_strtolower($value->orgtable) === mb_strtolower($value->table)) { + $value->orgtable = $value->table; + } + } + } + + return $result; + } + + /** + * return number of fields in given $result + * + * @param object $result result set identifier + * + * @return int field count + */ + public function numFields($result) + { + return $this->_extension->numFields($result); + } + + /** + * returns the length of the given field $i in $result + * + * @param object $result result set identifier + * @param int $i field + * + * @return int length of field + */ + public function fieldLen($result, $i) + { + return $this->_extension->fieldLen($result, $i); + } + + /** + * returns name of $i. field in $result + * + * @param object $result result set identifier + * @param int $i field + * + * @return string name of $i. field in $result + */ + public function fieldName($result, $i) + { + return $this->_extension->fieldName($result, $i); + } + + /** + * returns concatenated string of human readable field flags + * + * @param object $result result set identifier + * @param int $i field + * + * @return string field flags + */ + public function fieldFlags($result, $i) + { + return $this->_extension->fieldFlags($result, $i); + } + + /** + * returns properly escaped string for use in MySQL queries + * + * @param string $str string to be escaped + * @param mixed $link optional database link to use + * + * @return string a MySQL escaped string + */ + public function escapeString($str, $link = DatabaseInterface::CONNECT_USER) + { + if ($this->_extension === null || !isset($this->_links[$link])) { + return $str; + } + + return $this->_extension->escapeString($this->_links[$link], $str); + } + + /** + * Checks if this database server is running on Amazon RDS. + * + * @return boolean + */ + public function isAmazonRds() + { + if (Util::cacheExists('is_amazon_rds')) { + return Util::cacheGet('is_amazon_rds'); + } + $sql = 'SELECT @@basedir'; + $result = $this->fetchValue($sql); + $rds = (substr($result, 0, 10) == '/rdsdbbin/'); + Util::cacheSet('is_amazon_rds', $rds); + + return $rds; + } + + /** + * Gets SQL for killing a process. + * + * @param int $process Process ID + * + * @return string + */ + public function getKillQuery($process) + { + if ($this->isAmazonRds()) { + return 'CALL mysql.rds_kill(' . $process . ');'; + } + + return 'KILL ' . $process . ';'; + } + + /** + * Get the phpmyadmin database manager + * + * @return SystemDatabase + */ + public function getSystemDatabase() + { + return new SystemDatabase($this); + } + + /** + * Get a table with database name and table name + * + * @param string $db_name DB name + * @param string $table_name Table name + * + * @return Table + */ + public function getTable($db_name, $table_name) + { + return new Table($table_name, $db_name, $this); + } + + /** + * returns collation of given db + * + * @param string $db name of db + * + * @return string collation of $db + */ + public function getDbCollation($db) + { + if ($this->isSystemSchema($db)) { + // We don't have to check the collation of the virtual + // information_schema database: We know it! + return 'utf8_general_ci'; + } + + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + // this is slow with thousands of databases + $sql = 'SELECT DEFAULT_COLLATION_NAME FROM information_schema.SCHEMATA' + . ' WHERE SCHEMA_NAME = \'' . $this->escapeString($db) + . '\' LIMIT 1'; + return $this->fetchValue($sql); + } + + $this->selectDb($db); + $return = $this->fetchValue('SELECT @@collation_database'); + if ($db !== $GLOBALS['db']) { + $this->selectDb($GLOBALS['db']); + } + return $return; + } + + /** + * returns default server collation from show variables + * + * @return string $server_collation + */ + function getServerCollation() + { + return $this->fetchValue('SELECT @@collation_server'); + } + + /** + * Server version as number + * + * @return integer + */ + public function getVersion() + { + return $this->_version_int; + } + + /** + * Server version + * + * @return string + */ + public function getVersionString() + { + return $this->_version_str; + } + + /** + * Server version comment + * + * @return string + */ + public function getVersionComment() + { + return $this->_version_comment; + } + + /** + * Whether connection is MariaDB + * + * @return boolean + */ + public function isMariaDB() + { + return $this->_is_mariadb; + } + + /** + * Whether connection is Percona + * + * @return boolean + */ + public function isPercona() + { + return $this->_is_percona; + } + + /** + * Load correct database driver + * + * @return void + */ + public static function load() + { + if (defined('TESTSUITE')) { + /** + * For testsuite we use dummy driver which can fake some queries. + */ + $extension = new DbiDummy(); + } else { + + /** + * First check for the mysqli extension, as it's the one recommended + * for the MySQL server's version that we support + * (if PHP 7+, it's the only one supported) + */ + $extension = 'mysqli'; + if (! self::checkDbExtension($extension)) { + + $docurl = Util::getDocuLink('faq', 'faqmysql'); + $doclink = sprintf( + __('See %sour documentation%s for more information.'), + '[a@' . $docurl . '@documentation]', + '[/a]' + ); + + if (PHP_VERSION_ID < 70000) { + $extension = 'mysql'; + if (! self::checkDbExtension($extension)) { + // warn about both extensions missing and exit + Core::warnMissingExtension( + 'mysqli', + true, + $doclink + ); + } elseif (empty($_SESSION['mysqlwarning'])) { + trigger_error( + __( + 'You are using the mysql extension which is deprecated in ' + . 'phpMyAdmin. Please consider installing the mysqli ' + . 'extension.' + ) . ' ' . $doclink, + E_USER_WARNING + ); + // tell the user just once per session + $_SESSION['mysqlwarning'] = true; + } + } else { + // mysql extension is not part of PHP 7+, so warn and exit + Core::warnMissingExtension( + 'mysqli', + true, + $doclink + ); + } + } + + /** + * Including The DBI Plugin + */ + switch($extension) { + case 'mysql' : + $extension = new DbiMysql(); + break; + case 'mysqli' : + $extension = new DbiMysqli(); + break; + } + } + $GLOBALS['dbi'] = new DatabaseInterface($extension); + + $container = Container::getDefaultContainer(); + $container->set('PMA_DatabaseInterface', $GLOBALS['dbi']); + $container->alias('dbi', 'PMA_DatabaseInterface'); + } +} diff --git a/phpMyAdmin/libraries/classes/Dbi/DbiDummy.php b/phpMyAdmin/libraries/classes/Dbi/DbiDummy.php new file mode 100755 index 0000000..35cd9a0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Dbi/DbiDummy.php @@ -0,0 +1,454 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Fake database driver for testing purposes + * + * It has hardcoded results for given queries what makes easy to use it + * in testsuite. Feel free to include other queries which your test will + * need. + * + * @package PhpMyAdmin-DBI + * @subpackage Dummy + */ +namespace PhpMyAdmin\Dbi; + +require_once 'libraries/dbi/dbi_dummy.inc.php'; + +/** + * Fake database driver for testing purposes + * + * It has hardcoded results for given queries what makes easy to use it + * in testsuite. Feel free to include other queries which your test will + * need. + * + * @package PhpMyAdmin-DBI + * @subpackage Dummy + */ +class DbiDummy implements DbiExtension +{ + private $_queries = array(); + const OFFSET_GLOBAL = 1000; + + /** + * connects to the database server + * + * @param string $user mysql user name + * @param string $password mysql user password + * @param array $server host/port/socket/persistent + * + * @return mixed false on error or a mysqli object on success + */ + public function connect( + $user, + $password, + array $server = [] + ) { + return true; + } + + /** + * selects given database + * + * @param string $dbname name of db to select + * @param resource $link mysql link resource + * + * @return bool + */ + public function selectDb($dbname, $link) + { + $GLOBALS['dummy_db'] = $dbname; + + return true; + } + + /** + * runs a query and returns the result + * + * @param string $query query to run + * @param resource $link mysql link resource + * @param int $options query options + * + * @return mixed + */ + public function realQuery($query, $link = null, $options = 0) + { + $query = trim(preg_replace('/ */', ' ', str_replace("\n", ' ', $query))); + for ($i = 0, $nb = count($this->_queries); $i < $nb; $i++) { + if ($this->_queries[$i]['query'] != $query) { + continue; + } + + $this->_queries[$i]['pos'] = 0; + if (!is_array($this->_queries[$i]['result'])) { + return false; + } + + return $i; + } + for ($i = 0, $nb = count($GLOBALS['dummy_queries']); $i < $nb; $i++) { + if ($GLOBALS['dummy_queries'][$i]['query'] != $query) { + continue; + } + + $GLOBALS['dummy_queries'][$i]['pos'] = 0; + if (!is_array($GLOBALS['dummy_queries'][$i]['result'])) { + return false; + } + + return $i + self::OFFSET_GLOBAL; + } + echo "Not supported query: $query\n"; + + return false; + } + + /** + * Run the multi query and output the results + * + * @param resource $link connection object + * @param string $query multi query statement to execute + * + * @return array|bool + */ + public function realMultiQuery($link, $query) + { + return false; + } + + /** + * returns result data from $result + * + * @param object $result MySQL result + * + * @return array + */ + public function fetchAny($result) + { + $query_data = &$this->getQueryData($result); + if ($query_data['pos'] >= count($query_data['result'])) { + return false; + } + $ret = $query_data['result'][$query_data['pos']]; + $query_data['pos'] += 1; + + return $ret; + } + + /** + * returns array of rows with associative and numeric keys from $result + * + * @param object $result result MySQL result + * + * @return array + */ + public function fetchArray($result) + { + $query_data = &$this->getQueryData($result); + $data = $this->fetchAny($result); + if (!is_array($data) + || !isset($query_data['columns']) + ) { + return $data; + } + + foreach ($data as $key => $val) { + $data[$query_data['columns'][$key]] = $val; + } + + return $data; + } + + /** + * returns array of rows with associative keys from $result + * + * @param object $result MySQL result + * + * @return array + */ + public function fetchAssoc($result) + { + $data = $this->fetchAny($result); + $query_data = &$this->getQueryData($result); + if (!is_array($data) || !isset($query_data['columns'])) { + return $data; + } + + $ret = array(); + foreach ($data as $key => $val) { + $ret[$query_data['columns'][$key]] = $val; + } + + return $ret; + } + + /** + * returns array of rows with numeric keys from $result + * + * @param object $result MySQL result + * + * @return array + */ + public function fetchRow($result) + { + $data = $this->fetchAny($result); + + return $data; + } + + /** + * Adjusts the result pointer to an arbitrary row in the result + * + * @param object $result database result + * @param integer $offset offset to seek + * + * @return bool true on success, false on failure + */ + public function dataSeek($result, $offset) + { + $query_data = &$this->getQueryData($result); + if ($offset > count($query_data['result'])) { + return false; + } + $query_data['pos'] = $offset; + + return true; + } + + /** + * Frees memory associated with the result + * + * @param object $result database result + * + * @return void + */ + public function freeResult($result) + { + return; + } + + /** + * Check if there are any more query results from a multi query + * + * @param resource $link the connection object + * + * @return bool false + */ + public function moreResults($link) + { + return false; + } + + /** + * Prepare next result from multi_query + * + * @param resource $link the connection object + * + * @return boolean false + */ + public function nextResult($link) + { + return false; + } + + /** + * Store the result returned from multi query + * + * @param resource $link the connection object + * + * @return mixed false when empty results / result set when not empty + */ + public function storeResult($link) + { + return false; + } + + /** + * Returns a string representing the type of connection used + * + * @param resource $link mysql link + * + * @return string type of connection used + */ + public function getHostInfo($link) + { + return ''; + } + + /** + * Returns the version of the MySQL protocol used + * + * @param resource $link mysql link + * + * @return integer version of the MySQL protocol used + */ + public function getProtoInfo($link) + { + return -1; + } + + /** + * returns a string that represents the client library version + * + * @return string MySQL client library version + */ + public function getClientInfo() + { + return ''; + } + + /** + * returns last error message or false if no errors occurred + * + * @param resource $link connection link + * + * @return string|bool $error or false + */ + public function getError($link) + { + return false; + } + + /** + * returns the number of rows returned by last query + * + * @param object $result MySQL result + * + * @return string|int + */ + public function numRows($result) + { + if (is_bool($result)) { + return 0; + } + + $query_data = &$this->getQueryData($result); + + return count($query_data['result']); + } + + /** + * returns the number of rows affected by last query + * + * @param resource $link the mysql object + * @param bool $get_from_cache whether to retrieve from cache + * + * @return string|int + */ + public function affectedRows($link = null, $get_from_cache = true) + { + return 0; + } + + /** + * returns metainfo for fields in $result + * + * @param object $result result set identifier + * + * @return array meta info for fields in $result + */ + public function getFieldsMeta($result) + { + return array(); + } + + /** + * return number of fields in given $result + * + * @param object $result MySQL result + * + * @return int field count + */ + public function numFields($result) + { + $query_data = &$this->getQueryData($result); + if (!isset($query_data['columns'])) { + return 0; + } + + return count($query_data['columns']); + } + + /** + * returns the length of the given field $i in $result + * + * @param object $result result set identifier + * @param int $i field + * + * @return int length of field + */ + public function fieldLen($result, $i) + { + return -1; + } + + /** + * returns name of $i. field in $result + * + * @param object $result result set identifier + * @param int $i field + * + * @return string name of $i. field in $result + */ + public function fieldName($result, $i) + { + return ''; + } + + /** + * returns concatenated string of human readable field flags + * + * @param object $result result set identifier + * @param int $i field + * + * @return string field flags + */ + public function fieldFlags($result, $i) + { + return ''; + } + + /** + * returns properly escaped string for use in MySQL queries + * + * @param mixed $link database link + * @param string $str string to be escaped + * + * @return string a MySQL escaped string + */ + public function escapeString($link, $str) + { + return $str; + } + + /** + * Adds query result for testing + * + * @param string $query SQL + * @param array $result Expected result + * + * @return void + */ + public function setResult($query, $result) + { + $this->_queries[] = array( + 'query' => $query, + 'result' => $result, + ); + } + + /** + * Return query data for ID + * + * @param object $result result set identifier + * + * @return array + */ + private function &getQueryData($result) + { + if ($result >= self::OFFSET_GLOBAL) { + return $GLOBALS['dummy_queries'][$result - self::OFFSET_GLOBAL]; + } else { + return $this->_queries[$result]; + } + } +} diff --git a/phpMyAdmin/libraries/classes/Dbi/DbiExtension.php b/phpMyAdmin/libraries/classes/Dbi/DbiExtension.php new file mode 100755 index 0000000..b1b9ffa --- /dev/null +++ b/phpMyAdmin/libraries/classes/Dbi/DbiExtension.php @@ -0,0 +1,242 @@ +<?php +/** + * Contract for every database extension supported by phpMyAdmin + * + * @package PhpMyAdmin-DBI + */ +namespace PhpMyAdmin\Dbi; + +/** + * Contract for every database extension supported by phpMyAdmin + * + * @package PhpMyAdmin-DBI + */ +interface DbiExtension +{ + /** + * connects to the database server + * + * @param string $user user name + * @param string $password user password + * @param array $server host/port/socket/persistent + * + * @return mixed false on error or a connection object on success + */ + public function connect( + $user, $password, array $server + ); + + /** + * selects given database + * + * @param string $dbname database name to select + * @param resource $link connection object + * + * @return boolean + */ + public function selectDb($dbname, $link); + + /** + * runs a query and returns the result + * + * @param string $query query to execute + * @param resource $link connection object + * @param int $options query options + * + * @return mixed result + */ + public function realQuery($query, $link, $options); + + /** + * Run the multi query and output the results + * + * @param resource $link connection object + * @param string $query multi query statement to execute + * + * @return array|bool + */ + public function realMultiQuery($link, $query); + + /** + * returns array of rows with associative and numeric keys from $result + * + * @param object $result result set identifier + * + * @return array + */ + public function fetchArray($result); + + /** + * returns array of rows with associative keys from $result + * + * @param object $result result set identifier + * + * @return array + */ + public function fetchAssoc($result); + + /** + * returns array of rows with numeric keys from $result + * + * @param object $result result set identifier + * + * @return array + */ + public function fetchRow($result); + + /** + * Adjusts the result pointer to an arbitrary row in the result + * + * @param object $result database result + * @param integer $offset offset to seek + * + * @return bool true on success, false on failure + */ + public function dataSeek($result, $offset); + + /** + * Frees memory associated with the result + * + * @param object $result database result + * + * @return void + */ + public function freeResult($result); + + /** + * Check if there are any more query results from a multi query + * + * @param resource $link the connection object + * + * @return bool true or false + */ + public function moreResults($link); + + /** + * Prepare next result from multi_query + * + * @param resource $link the connection object + * + * @return bool true or false + */ + public function nextResult($link); + + /** + * Store the result returned from multi query + * + * @param resource $link mysql link + * + * @return mixed false when empty results / result set when not empty + */ + public function storeResult($link); + + /** + * Returns a string representing the type of connection used + * + * @param resource $link mysql link + * + * @return string type of connection used + */ + public function getHostInfo($link); + + /** + * Returns the version of the MySQL protocol used + * + * @param resource $link mysql link + * + * @return integer version of the MySQL protocol used + */ + public function getProtoInfo($link); + + /** + * returns a string that represents the client library version + * + * @return string MySQL client library version + */ + public function getClientInfo(); + + /** + * returns last error message or false if no errors occurred + * + * @param resource $link connection link + * + * @return string|bool $error or false + */ + public function getError($link); + + /** + * returns the number of rows returned by last query + * + * @param object $result result set identifier + * + * @return string|int + */ + public function numRows($result); + + /** + * returns the number of rows affected by last query + * + * @param resource $link the connection object + * + * @return int + */ + public function affectedRows($link); + + /** + * returns metainfo for fields in $result + * + * @param object $result result set identifier + * + * @return array meta info for fields in $result + */ + public function getFieldsMeta($result); + + /** + * return number of fields in given $result + * + * @param object $result result set identifier + * + * @return int field count + */ + public function numFields($result); + + /** + * returns the length of the given field $i in $result + * + * @param object $result result set identifier + * @param int $i field + * + * @return int length of field + */ + public function fieldLen($result, $i); + + /** + * returns name of $i. field in $result + * + * @param object $result result set identifier + * @param int $i field + * + * @return string name of $i. field in $result + */ + public function fieldName($result, $i); + + /** + * returns concatenated string of human readable field flags + * + * @param object $result result set identifier + * @param int $i field + * + * @return string field flags + */ + public function fieldFlags($result, $i); + + /** + * returns properly escaped string for use in MySQL queries + * + * @param mixed $link database link + * @param string $str string to be escaped + * + * @return string a MySQL escaped string + */ + public function escapeString($link, $str); +} diff --git a/phpMyAdmin/libraries/classes/Dbi/DbiMysql.php b/phpMyAdmin/libraries/classes/Dbi/DbiMysql.php new file mode 100755 index 0000000..9585ac2 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Dbi/DbiMysql.php @@ -0,0 +1,461 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Interface to the classic MySQL extension + * + * @package PhpMyAdmin-DBI + * @subpackage MySQL + */ +namespace PhpMyAdmin\Dbi; + +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; + +if (! defined('PHPMYADMIN')) { + exit; +} + +if (! extension_loaded('mysql')) { + // The old MySQL extension is deprecated as of PHP 5.5.0, and will be + // removed in the future. Instead, the `MySQLi` or `PDO_MySQL` extension + // should be used. + return; +} + +/** + * Interface to the classic MySQL extension + * + * @package PhpMyAdmin-DBI + * @subpackage MySQL + */ +class DbiMysql implements DbiExtension +{ + /** + * Helper function for connecting to the database server + * + * @param string $server host/port/socket + * @param string $user mysql user name + * @param string $password mysql user password + * @param int $client_flags client flags of connection + * @param bool $persistent whether to use persistent connection + * + * @return mixed false on error or a mysql connection resource on success + */ + private function _realConnect($server, $user, $password, $client_flags, + $persistent = false + ) { + global $cfg; + + if (ini_get('mysql.allow_local_infile')) { + Core::fatalError(__('Please disable mysql.allow_local_infile in your PHP configuration or install the mysqli extension.')); + } + + if (empty($client_flags)) { + if ($cfg['PersistentConnections'] || $persistent) { + $link = @mysql_pconnect($server, $user, $password); + } else { + $link = @mysql_connect($server, $user, $password); + } + } else { + if ($cfg['PersistentConnections'] || $persistent) { + $link = @mysql_pconnect($server, $user, $password, $client_flags); + } else { + $link = @mysql_connect( + $server, $user, $password, false, $client_flags + ); + } + } + + return $link; + } + + /** + * Run the multi query and output the results + * + * @param mysqli $link mysqli object + * @param string $query multi query statement to execute + * + * @return boolean false always false since mysql extension not support + * for multi query executions + */ + public function realMultiQuery($link, $query) + { + // N.B.: PHP's 'mysql' extension does not support + // multi_queries so this function will always + // return false. Use the 'mysqli' extension, if + // you need support for multi_queries. + return false; + } + + /** + * connects to the database server + * + * @param string $user mysql user name + * @param string $password mysql user password + * @param array $server host/port/socket/persistent + * + * @return mixed false on error or a mysqli object on success + */ + public function connect( + $user, $password, array $server + ) { + if ($server['port'] === 0) { + $server_port = ''; + } else { + $server_port = ':' . $server['port']; + } + + if (is_null($server['socket'])) { + $server_socket = ''; + } else { + $server_socket = ':' . $server['socket']; + } + + $client_flags = 0; + + if (defined('PMA_ENABLE_LDI')) { + // use CLIENT_LOCAL_FILES as defined in mysql_com.h + // for the case where the client library was not compiled + // with --enable-local-infile + $client_flags |= 128; + } + + /* Optionally compress connection */ + if (defined('MYSQL_CLIENT_COMPRESS') && $server['compress']) { + $client_flags |= MYSQL_CLIENT_COMPRESS; + } + + /* Optionally enable SSL */ + if (defined('MYSQL_CLIENT_SSL') && $server['ssl']) { + $client_flags |= MYSQL_CLIENT_SSL; + } + + if (!isset($server['host'])) { + $link = $this->_realConnect($server_socket, $user, $password, null); + } else { + $link = $this->_realConnect( + $server['host'] . $server_port . $server_socket, + $user, $password, null + ); + } + return $link; + } + + /** + * selects given database + * + * @param string $dbname name of db to select + * @param resource|null $link mysql link resource + * + * @return bool + */ + public function selectDb($dbname, $link) + { + return mysql_select_db($dbname, $link); + } + + /** + * runs a query and returns the result + * + * @param string $query query to run + * @param resource|null $link mysql link resource + * @param int $options query options + * + * @return mixed + */ + public function realQuery($query, $link, $options) + { + if ($options == ($options | DatabaseInterface::QUERY_STORE)) { + return mysql_query($query, $link); + } elseif ($options == ($options | DatabaseInterface::QUERY_UNBUFFERED)) { + return mysql_unbuffered_query($query, $link); + } + + return mysql_query($query, $link); + } + + /** + * returns array of rows with associative and numeric keys from $result + * + * @param resource $result result MySQL result + * + * @return array + */ + public function fetchArray($result) + { + return mysql_fetch_array($result, MYSQL_BOTH); + } + + /** + * returns array of rows with associative keys from $result + * + * @param resource $result MySQL result + * + * @return array + */ + public function fetchAssoc($result) + { + return mysql_fetch_array($result, MYSQL_ASSOC); + } + + /** + * returns array of rows with numeric keys from $result + * + * @param resource $result MySQL result + * + * @return array + */ + public function fetchRow($result) + { + return mysql_fetch_array($result, MYSQL_NUM); + } + + /** + * Adjusts the result pointer to an arbitrary row in the result + * + * @param resource $result database result + * @param integer $offset offset to seek + * + * @return bool true on success, false on failure + */ + public function dataSeek($result, $offset) + { + return mysql_data_seek($result, $offset); + } + + /** + * Frees memory associated with the result + * + * @param resource $result database result + * + * @return void + */ + public function freeResult($result) + { + if (is_resource($result) && get_resource_type($result) === 'mysql result') { + mysql_free_result($result); + } + } + + /** + * Check if there are any more query results from a multi query + * + * @param resource $link the connection object + * + * @return bool false + */ + public function moreResults($link) + { + // N.B.: PHP's 'mysql' extension does not support + // multi_queries so this function will always + // return false. Use the 'mysqli' extension, if + // you need support for multi_queries. + return false; + } + + /** + * Prepare next result from multi_query + * + * @param resource $link the connection object + * + * @return boolean false + */ + public function nextResult($link) + { + // N.B.: PHP's 'mysql' extension does not support + // multi_queries so this function will always + // return false. Use the 'mysqli' extension, if + // you need support for multi_queries. + return false; + } + + /** + * Returns a string representing the type of connection used + * + * @param resource|null $link mysql link + * + * @return string type of connection used + */ + public function getHostInfo($link) + { + return mysql_get_host_info($link); + } + + /** + * Returns the version of the MySQL protocol used + * + * @param resource|null $link mysql link + * + * @return int version of the MySQL protocol used + */ + public function getProtoInfo($link) + { + return mysql_get_proto_info($link); + } + + /** + * returns a string that represents the client library version + * + * @return string MySQL client library version + */ + public function getClientInfo() + { + return mysql_get_client_info(); + } + + /** + * returns last error message or false if no errors occurred + * + * @param resource|null $link mysql link + * + * @return string|bool $error or false + */ + public function getError($link) + { + $GLOBALS['errno'] = 0; + + if (null !== $link && false !== $link) { + $error_number = mysql_errno($link); + $error_message = mysql_error($link); + } else { + $error_number = mysql_errno(); + $error_message = mysql_error(); + } + if (0 == $error_number) { + return false; + } + + // keep the error number for further check after + // the call to getError() + $GLOBALS['errno'] = $error_number; + + return $GLOBALS['dbi']->formatError($error_number, $error_message); + } + + /** + * returns the number of rows returned by last query + * + * @param resource $result MySQL result + * + * @return string|int + */ + public function numRows($result) + { + if (is_bool($result)) { + return 0; + } + + return mysql_num_rows($result); + } + + /** + * returns the number of rows affected by last query + * + * @param resource|null $link the mysql object + * + * @return int + */ + public function affectedRows($link) + { + return mysql_affected_rows($link); + } + + /** + * returns metainfo for fields in $result + * + * @param resource $result MySQL result + * + * @return array meta info for fields in $result + * + * @todo add missing keys like in mysqli_query (decimals) + */ + public function getFieldsMeta($result) + { + $fields = array(); + $num_fields = mysql_num_fields($result); + for ($i = 0; $i < $num_fields; $i++) { + $field = mysql_fetch_field($result, $i); + $field->flags = mysql_field_flags($result, $i); + $field->orgtable = mysql_field_table($result, $i); + $field->orgname = mysql_field_name($result, $i); + $fields[] = $field; + } + return $fields; + } + + /** + * return number of fields in given $result + * + * @param resource $result MySQL result + * + * @return int field count + */ + public function numFields($result) + { + return mysql_num_fields($result); + } + + /** + * returns the length of the given field $i in $result + * + * @param resource $result MySQL result + * @param int $i field + * + * @return int length of field + */ + public function fieldLen($result, $i) + { + return mysql_field_len($result, $i); + } + + /** + * returns name of $i. field in $result + * + * @param resource $result MySQL result + * @param int $i field + * + * @return string name of $i. field in $result + */ + public function fieldName($result, $i) + { + return mysql_field_name($result, $i); + } + + /** + * returns concatenated string of human readable field flags + * + * @param resource $result MySQL result + * @param int $i field + * + * @return string field flags + */ + public function fieldFlags($result, $i) + { + return mysql_field_flags($result, $i); + } + + /** + * Store the result returned from multi query + * + * @param resource $result MySQL result + * + * @return false + */ + public function storeResult($result) + { + return false; + } + + /** + * returns properly escaped string for use in MySQL queries + * + * @param mixed $link database link + * @param string $str string to be escaped + * + * @return string a MySQL escaped string + */ + public function escapeString($link, $str) + { + return mysql_real_escape_string($str, $link); + } +} diff --git a/phpMyAdmin/libraries/classes/Dbi/DbiMysqli.php b/phpMyAdmin/libraries/classes/Dbi/DbiMysqli.php new file mode 100755 index 0000000..d0905eb --- /dev/null +++ b/phpMyAdmin/libraries/classes/Dbi/DbiMysqli.php @@ -0,0 +1,637 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Interface to the improved MySQL extension (MySQLi) + * + * @package PhpMyAdmin-DBI + * @subpackage MySQLi + */ +namespace PhpMyAdmin\Dbi; + +use PhpMyAdmin\DatabaseInterface; + +if (! defined('PHPMYADMIN')) { + exit; +} + +/** + * some PHP versions are reporting extra messages like "No index used in query" + */ + +mysqli_report(MYSQLI_REPORT_OFF); + +/** + * some older mysql client libs are missing these constants ... + */ +if (! defined('MYSQLI_BINARY_FLAG')) { + define('MYSQLI_BINARY_FLAG', 128); +} + +/** + * @see https://bugs.php.net/36007 + */ +if (! defined('MYSQLI_TYPE_NEWDECIMAL')) { + define('MYSQLI_TYPE_NEWDECIMAL', 246); +} +if (! defined('MYSQLI_TYPE_BIT')) { + define('MYSQLI_TYPE_BIT', 16); +} +if (! defined('MYSQLI_TYPE_JSON')) { + define('MYSQLI_TYPE_JSON', 245); +} + + +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Interface to the improved MySQL extension (MySQLi) + * + * @package PhpMyAdmin-DBI + * @subpackage MySQLi + */ +class DbiMysqli implements DbiExtension +{ + static private $pma_mysqli_flag_names = array( + MYSQLI_NUM_FLAG => 'num', + MYSQLI_PART_KEY_FLAG => 'part_key', + MYSQLI_SET_FLAG => 'set', + MYSQLI_TIMESTAMP_FLAG => 'timestamp', + MYSQLI_AUTO_INCREMENT_FLAG => 'auto_increment', + MYSQLI_ENUM_FLAG => 'enum', + MYSQLI_ZEROFILL_FLAG => 'zerofill', + MYSQLI_UNSIGNED_FLAG => 'unsigned', + MYSQLI_BLOB_FLAG => 'blob', + MYSQLI_MULTIPLE_KEY_FLAG => 'multiple_key', + MYSQLI_UNIQUE_KEY_FLAG => 'unique_key', + MYSQLI_PRI_KEY_FLAG => 'primary_key', + MYSQLI_NOT_NULL_FLAG => 'not_null', + ); + + /** + * connects to the database server + * + * @param string $user mysql user name + * @param string $password mysql user password + * @param array $server host/port/socket/persistent + * + * @return mixed false on error or a mysqli object on success + */ + public function connect( + $user, $password, array $server + ) { + if ($server) { + $server['host'] = (empty($server['host'])) + ? 'localhost' + : $server['host']; + } + + // NULL enables connection to the default socket + + $link = mysqli_init(); + + $client_flags = 0; + + /* Optionally compress connection */ + if ($server['compress'] && defined('MYSQLI_CLIENT_COMPRESS')) { + $client_flags |= MYSQLI_CLIENT_COMPRESS; + } + + /* Optionally enable SSL */ + if ($server['ssl']) { + $client_flags |= MYSQLI_CLIENT_SSL; + if (! empty($server['ssl_key']) || + ! empty($server['ssl_cert']) || + ! empty($server['ssl_ca']) || + ! empty($server['ssl_ca_path']) || + ! empty($server['ssl_ciphers']) + ) { + if (! isset($server['ssl_key']) || is_null($server['ssl_key'])) { + $server['ssl_key'] = ''; + } + if (! isset($server['ssl_cert']) || is_null($server['ssl_cert'])) { + $server['ssl_cert'] = ''; + } + if (! isset($server['ssl_ca']) || is_null($server['ssl_ca'])) { + $server['ssl_ca'] = ''; + } + if (! isset($server['ssl_ca_path']) || is_null($server['ssl_ca_path'])) { + $server['ssl_ca_path'] = ''; + } + if (! isset($server['ssl_ciphers']) || is_null($server['ssl_ciphers'])) { + $server['ssl_ciphers'] = ''; + } + mysqli_ssl_set( + $link, + $server['ssl_key'], + $server['ssl_cert'], + $server['ssl_ca'], + $server['ssl_ca_path'], + $server['ssl_ciphers'] + ); + } + /* + * disables SSL certificate validation on mysqlnd for MySQL 5.6 or later + * @link https://bugs.php.net/bug.php?id=68344 + * @link https://github.com/phpmyadmin/phpmyadmin/pull/11838 + */ + if (! $server['ssl_verify']) { + mysqli_options( + $link, + MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, + $server['ssl_verify'] + ); + $client_flags |= MYSQLI_CLIENT_SSL_DONT_VERIFY_SERVER_CERT; + } + } + + if ($GLOBALS['cfg']['PersistentConnections']) { + $host = 'p:' . $server['host']; + } else { + $host = $server['host']; + } + + if ($server['hide_connection_errors']) { + $return_value = @mysqli_real_connect( + $link, + $host, + $user, + $password, + '', + $server['port'], + $server['socket'], + $client_flags + ); + } else { + $return_value = mysqli_real_connect( + $link, + $host, + $user, + $password, + '', + $server['port'], + $server['socket'], + $client_flags + ); + } + + if ($return_value === false || is_null($return_value)) { + /* + * Switch to SSL if server asked us to do so, unfortunately + * there are more ways MySQL server can tell this: + * + * - MySQL 8.0 and newer should return error 3159 + * - #2001 - SSL Connection is required. Please specify SSL options and retry. + * - #9002 - SSL connection is required. Please specify SSL options and retry. + */ + $error_number = mysqli_connect_errno(); + $error_message = mysqli_connect_error(); + if (! $server['ssl'] && ($error_number == 3159 || + (($error_number == 2001 || $error_number == 9002) && stripos($error_message, 'SSL Connection is required') !== false)) + ) { + trigger_error( + __('SSL connection enforced by server, automatically enabling it.'), + E_USER_WARNING + ); + $server['ssl'] = true; + return self::connect($user, $password, $server); + } elseif ($error_number === 1045 && $server['hide_connection_errors']) { + trigger_error( + sprintf( + __( + 'Error 1045: Access denied for user. Additional error information' + . ' may be available, but is being hidden by the %s configuration directive.' + ), + '[code][doc@cfg_Servers_hide_connection_errors]' + . '$cfg[\'Servers\'][$i][\'hide_connection_errors\'][/doc][/code]' + ), + E_USER_ERROR + ); + } + + return false; + } + + if (defined('PMA_ENABLE_LDI')) { + mysqli_options($link, MYSQLI_OPT_LOCAL_INFILE, true); + } else { + mysqli_options($link, MYSQLI_OPT_LOCAL_INFILE, false); + } + + return $link; + } + + /** + * selects given database + * + * @param string $dbname database name to select + * @param mysqli $link the mysqli object + * + * @return boolean + */ + public function selectDb($dbname, $link) + { + return mysqli_select_db($link, $dbname); + } + + /** + * runs a query and returns the result + * + * @param string $query query to execute + * @param mysqli $link mysqli object + * @param int $options query options + * + * @return mysqli_result|bool + */ + public function realQuery($query, $link, $options) + { + if ($options == ($options | DatabaseInterface::QUERY_STORE)) { + $method = MYSQLI_STORE_RESULT; + } elseif ($options == ($options | DatabaseInterface::QUERY_UNBUFFERED)) { + $method = MYSQLI_USE_RESULT; + } else { + $method = 0; + } + + return mysqli_query($link, $query, $method); + } + + /** + * Run the multi query and output the results + * + * @param mysqli $link mysqli object + * @param string $query multi query statement to execute + * + * @return mysqli_result collection | boolean(false) + */ + public function realMultiQuery($link, $query) + { + return mysqli_multi_query($link, $query); + } + + /** + * returns array of rows with associative and numeric keys from $result + * + * @param mysqli_result $result result set identifier + * + * @return array + */ + public function fetchArray($result) + { + return mysqli_fetch_array($result, MYSQLI_BOTH); + } + + /** + * returns array of rows with associative keys from $result + * + * @param mysqli_result $result result set identifier + * + * @return array + */ + public function fetchAssoc($result) + { + return mysqli_fetch_array($result, MYSQLI_ASSOC); + } + + /** + * returns array of rows with numeric keys from $result + * + * @param mysqli_result $result result set identifier + * + * @return array + */ + public function fetchRow($result) + { + return mysqli_fetch_array($result, MYSQLI_NUM); + } + + /** + * Adjusts the result pointer to an arbitrary row in the result + * + * @param mysqli_result $result database result + * @param integer $offset offset to seek + * + * @return bool true on success, false on failure + */ + public function dataSeek($result, $offset) + { + return mysqli_data_seek($result, $offset); + } + + /** + * Frees memory associated with the result + * + * @param mysqli_result $result database result + * + * @return void + */ + public function freeResult($result) + { + if ($result instanceof mysqli_result) { + mysqli_free_result($result); + } + } + + /** + * Check if there are any more query results from a multi query + * + * @param mysqli $link the mysqli object + * + * @return bool true or false + */ + public function moreResults($link) + { + return mysqli_more_results($link); + } + + /** + * Prepare next result from multi_query + * + * @param mysqli $link the mysqli object + * + * @return bool true or false + */ + public function nextResult($link) + { + return mysqli_next_result($link); + } + + /** + * Store the result returned from multi query + * + * @param mysqli $link the mysqli object + * + * @return mixed false when empty results / result set when not empty + */ + public function storeResult($link) + { + return mysqli_store_result($link); + } + + /** + * Returns a string representing the type of connection used + * + * @param resource $link mysql link + * + * @return string type of connection used + */ + public function getHostInfo($link) + { + return mysqli_get_host_info($link); + } + + /** + * Returns the version of the MySQL protocol used + * + * @param resource $link mysql link + * + * @return integer version of the MySQL protocol used + */ + public function getProtoInfo($link) + { + return mysqli_get_proto_info($link); + } + + /** + * returns a string that represents the client library version + * + * @return string MySQL client library version + */ + public function getClientInfo() + { + return mysqli_get_client_info(); + } + + /** + * returns last error message or false if no errors occurred + * + * @param resource $link mysql link + * + * @return string|bool $error or false + */ + public function getError($link) + { + $GLOBALS['errno'] = 0; + + if (null !== $link && false !== $link) { + $error_number = mysqli_errno($link); + $error_message = mysqli_error($link); + } else { + $error_number = mysqli_connect_errno(); + $error_message = mysqli_connect_error(); + } + if (0 == $error_number) { + return false; + } + + // keep the error number for further check after + // the call to getError() + $GLOBALS['errno'] = $error_number; + + return $GLOBALS['dbi']->formatError($error_number, $error_message); + } + + /** + * returns the number of rows returned by last query + * + * @param mysqli_result $result result set identifier + * + * @return string|int + */ + public function numRows($result) + { + // see the note for tryQuery(); + if (is_bool($result)) { + return 0; + } + + return @mysqli_num_rows($result); + } + + /** + * returns the number of rows affected by last query + * + * @param mysqli $link the mysqli object + * + * @return int + */ + public function affectedRows($link) + { + return mysqli_affected_rows($link); + } + + /** + * returns metainfo for fields in $result + * + * @param mysqli_result $result result set identifier + * + * @return array meta info for fields in $result + */ + public function getFieldsMeta($result) + { + // Build an associative array for a type look up + $typeAr = array(); + $typeAr[MYSQLI_TYPE_DECIMAL] = 'real'; + $typeAr[MYSQLI_TYPE_NEWDECIMAL] = 'real'; + $typeAr[MYSQLI_TYPE_BIT] = 'int'; + $typeAr[MYSQLI_TYPE_TINY] = 'int'; + $typeAr[MYSQLI_TYPE_SHORT] = 'int'; + $typeAr[MYSQLI_TYPE_LONG] = 'int'; + $typeAr[MYSQLI_TYPE_FLOAT] = 'real'; + $typeAr[MYSQLI_TYPE_DOUBLE] = 'real'; + $typeAr[MYSQLI_TYPE_NULL] = 'null'; + $typeAr[MYSQLI_TYPE_TIMESTAMP] = 'timestamp'; + $typeAr[MYSQLI_TYPE_LONGLONG] = 'int'; + $typeAr[MYSQLI_TYPE_INT24] = 'int'; + $typeAr[MYSQLI_TYPE_DATE] = 'date'; + $typeAr[MYSQLI_TYPE_TIME] = 'time'; + $typeAr[MYSQLI_TYPE_DATETIME] = 'datetime'; + $typeAr[MYSQLI_TYPE_YEAR] = 'year'; + $typeAr[MYSQLI_TYPE_NEWDATE] = 'date'; + $typeAr[MYSQLI_TYPE_ENUM] = 'unknown'; + $typeAr[MYSQLI_TYPE_SET] = 'unknown'; + $typeAr[MYSQLI_TYPE_TINY_BLOB] = 'blob'; + $typeAr[MYSQLI_TYPE_MEDIUM_BLOB] = 'blob'; + $typeAr[MYSQLI_TYPE_LONG_BLOB] = 'blob'; + $typeAr[MYSQLI_TYPE_BLOB] = 'blob'; + $typeAr[MYSQLI_TYPE_VAR_STRING] = 'string'; + $typeAr[MYSQLI_TYPE_STRING] = 'string'; + // MySQL returns MYSQLI_TYPE_STRING for CHAR + // and MYSQLI_TYPE_CHAR === MYSQLI_TYPE_TINY + // so this would override TINYINT and mark all TINYINT as string + // see https://github.com/phpmyadmin/phpmyadmin/issues/8569 + //$typeAr[MYSQLI_TYPE_CHAR] = 'string'; + $typeAr[MYSQLI_TYPE_GEOMETRY] = 'geometry'; + $typeAr[MYSQLI_TYPE_BIT] = 'bit'; + $typeAr[MYSQLI_TYPE_JSON] = 'json'; + + $fields = mysqli_fetch_fields($result); + + // this happens sometimes (seen under MySQL 4.0.25) + if (!is_array($fields)) { + return false; + } + + foreach ($fields as $k => $field) { + $fields[$k]->_type = $field->type; + $fields[$k]->type = $typeAr[$field->type]; + $fields[$k]->_flags = $field->flags; + $fields[$k]->flags = $this->fieldFlags($result, $k); + + // Enhance the field objects for mysql-extension compatibility + //$flags = explode(' ', $fields[$k]->flags); + //array_unshift($flags, 'dummy'); + $fields[$k]->multiple_key + = (int) (bool) ($fields[$k]->_flags & MYSQLI_MULTIPLE_KEY_FLAG); + $fields[$k]->primary_key + = (int) (bool) ($fields[$k]->_flags & MYSQLI_PRI_KEY_FLAG); + $fields[$k]->unique_key + = (int) (bool) ($fields[$k]->_flags & MYSQLI_UNIQUE_KEY_FLAG); + $fields[$k]->not_null + = (int) (bool) ($fields[$k]->_flags & MYSQLI_NOT_NULL_FLAG); + $fields[$k]->unsigned + = (int) (bool) ($fields[$k]->_flags & MYSQLI_UNSIGNED_FLAG); + $fields[$k]->zerofill + = (int) (bool) ($fields[$k]->_flags & MYSQLI_ZEROFILL_FLAG); + $fields[$k]->numeric + = (int) (bool) ($fields[$k]->_flags & MYSQLI_NUM_FLAG); + $fields[$k]->blob + = (int) (bool) ($fields[$k]->_flags & MYSQLI_BLOB_FLAG); + } + return $fields; + } + + /** + * return number of fields in given $result + * + * @param mysqli_result $result result set identifier + * + * @return int field count + */ + public function numFields($result) + { + return mysqli_num_fields($result); + } + + /** + * returns the length of the given field $i in $result + * + * @param mysqli_result $result result set identifier + * @param int $i field + * + * @return int length of field + */ + public function fieldLen($result, $i) + { + if ($i >= $this->numFields($result)) { + return false; + } + return mysqli_fetch_field_direct($result, $i)->length; + } + + /** + * returns name of $i. field in $result + * + * @param mysqli_result $result result set identifier + * @param int $i field + * + * @return string name of $i. field in $result + */ + public function fieldName($result, $i) + { + if ($i >= $this->numFields($result)) { + return false; + } + return mysqli_fetch_field_direct($result, $i)->name; + } + + /** + * returns concatenated string of human readable field flags + * + * @param mysqli_result $result result set identifier + * @param int $i field + * + * @return string field flags + */ + public function fieldFlags($result, $i) + { + if ($i >= $this->numFields($result)) { + return false; + } + $f = mysqli_fetch_field_direct($result, $i); + $type = $f->type; + $charsetnr = $f->charsetnr; + $f = $f->flags; + $flags = array(); + foreach (self::$pma_mysqli_flag_names as $flag => $name) { + if ($f & $flag) { + $flags[] = $name; + } + } + // See https://dev.mysql.com/doc/refman/6.0/en/c-api-datatypes.html: + // to determine if a string is binary, we should not use MYSQLI_BINARY_FLAG + // but instead the charsetnr member of the MYSQL_FIELD + // structure. Watch out: some types like DATE returns 63 in charsetnr + // so we have to check also the type. + // Unfortunately there is no equivalent in the mysql extension. + if (($type == MYSQLI_TYPE_TINY_BLOB || $type == MYSQLI_TYPE_BLOB + || $type == MYSQLI_TYPE_MEDIUM_BLOB || $type == MYSQLI_TYPE_LONG_BLOB + || $type == MYSQLI_TYPE_VAR_STRING || $type == MYSQLI_TYPE_STRING) + && 63 == $charsetnr + ) { + $flags[] = 'binary'; + } + return implode(' ', $flags); + } + + /** + * returns properly escaped string for use in MySQL queries + * + * @param mixed $link database link + * @param string $str string to be escaped + * + * @return string a MySQL escaped string + */ + public function escapeString($link, $str) + { + return mysqli_real_escape_string($link, $str); + } +} diff --git a/phpMyAdmin/libraries/classes/Di/AliasItem.php b/phpMyAdmin/libraries/classes/Di/AliasItem.php new file mode 100755 index 0000000..3f461dd --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/AliasItem.php @@ -0,0 +1,46 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\AliasItem class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +/** + * Class AliasItem + * + * @package PhpMyAdmin\Di + */ +class AliasItem implements Item +{ + + /** @var Container */ + protected $container; + + /** @var string */ + protected $target; + + /** + * Constructor + * + * @param Container $container Container + * @param string $target Target + */ + public function __construct(Container $container, $target) + { + $this->container = $container; + $this->target = $target; + } + + /** + * Get the target item + * + * @param array $params Parameters + * @return mixed + */ + public function get(array $params = array()) + { + return $this->container->get($this->target, $params); + } +} diff --git a/phpMyAdmin/libraries/classes/Di/Container.php b/phpMyAdmin/libraries/classes/Di/Container.php new file mode 100755 index 0000000..06fab99 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/Container.php @@ -0,0 +1,189 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\Container class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +use Psr\Container\ContainerInterface; + +/** + * Class Container + * + * @package PhpMyAdmin\Di + */ +class Container implements ContainerInterface +{ + /** + * @var Item[] $content + */ + protected $content = array(); + + /** + * @var Container + */ + protected static $defaultContainer; + + /** + * Create a dependency injection container + * + * @param Container $base Container + */ + public function __construct(Container $base = null) + { + if (isset($base)) { + $this->content = $base->content; + } else { + $this->alias('container', 'Container'); + } + $this->set('Container', $this); + } + + /** + * Get an object with given name and parameters + * + * @param string $name Name + * @param array $params Parameters + * + * @throws NotFoundException No entry was found for **this** identifier. + * @throws ContainerException Error while retrieving the entry. + * + * @return mixed + */ + public function get($name, array $params = array()) + { + if (!$this->has($name)) { + throw new NotFoundException("No entry was found for $name identifier."); + } + + if (isset($this->content[$name])) { + return $this->content[$name]->get($params); + } elseif (isset($GLOBALS[$name])) { + return $GLOBALS[$name]; + } else { + throw new ContainerException("Error while retrieving the entry."); + } + } + + /** + * Returns true if the container can return an entry for the given identifier. + * Returns false otherwise. + * + * `has($name)` returning true does not mean that `get($name)` will not throw an exception. + * It does however mean that `get($name)` will not throw a `NotFoundException`. + * + * @param string $name Identifier of the entry to look for. + * + * @return bool + */ + public function has($name) + { + return isset($this->content[$name]) || isset($GLOBALS[$name]); + } + + /** + * Remove an object from container + * + * @param string $name Name + * + * @return void + */ + public function remove($name) + { + unset($this->content[$name]); + } + + /** + * Rename an object in container + * + * @param string $name Name + * @param string $newName New name + * + * @return void + */ + public function rename($name, $newName) + { + $this->content[$newName] = $this->content[$name]; + $this->remove($name); + } + + /** + * Set values in the container + * + * @param string|array $name Name + * @param mixed $value Value + * + * @return void + */ + public function set($name, $value = null) + { + if (is_array($name)) { + foreach ($name as $key => $val) { + $this->set($key, $val); + } + return; + } + $this->content[$name] = new ValueItem($value); + } + + /** + * Register a service in the container + * + * @param string $name Name + * @param mixed $service Service + * + * @return void + */ + public function service($name, $service = null) + { + if (!isset($service)) { + $service = $name; + } + $this->content[$name] = new ServiceItem($this, $service); + } + + /** + * Register a factory in the container + * + * @param string $name Name + * @param mixed $factory Factory + * + * @return void + */ + public function factory($name, $factory = null) + { + if (!isset($factory)) { + $factory = $name; + } + $this->content[$name] = new FactoryItem($this, $factory); + } + + /** + * Register an alias in the container + * + * @param string $name Name + * @param string $target Target + * + * @return void + */ + public function alias($name, $target) + { + // The target may be not defined yet + $this->content[$name] = new AliasItem($this, $target); + } + + /** + * Get the global default container + * + * @return Container + */ + public static function getDefaultContainer() + { + if (!isset(static::$defaultContainer)) { + static::$defaultContainer = new Container(); + } + return static::$defaultContainer; + } +} diff --git a/phpMyAdmin/libraries/classes/Di/ContainerException.php b/phpMyAdmin/libraries/classes/Di/ContainerException.php new file mode 100755 index 0000000..a5a2da0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/ContainerException.php @@ -0,0 +1,21 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\ContainerException class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +use Exception; +use Psr\Container\ContainerExceptionInterface; + +/** + * Class ContainerException + * + * @package PhpMyAdmin\Di + */ +class ContainerException extends Exception implements ContainerExceptionInterface +{ + +} diff --git a/phpMyAdmin/libraries/classes/Di/FactoryItem.php b/phpMyAdmin/libraries/classes/Di/FactoryItem.php new file mode 100755 index 0000000..16a096c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/FactoryItem.php @@ -0,0 +1,29 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\FactoryItem class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +/** + * Factory manager + * + * @package PhpMyAdmin\Di + */ +class FactoryItem extends ReflectorItem +{ + + /** + * Construct an instance + * + * @param array $params Parameters + * + * @return mixed + */ + public function get(array $params = array()) + { + return $this->invoke($params); + } +} diff --git a/phpMyAdmin/libraries/classes/Di/Item.php b/phpMyAdmin/libraries/classes/Di/Item.php new file mode 100755 index 0000000..9ddd6a8 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/Item.php @@ -0,0 +1,25 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\Item class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +/** + * Interface Item + * + * @package PhpMyAdmin\Di + */ +interface Item +{ + + /** + * Get a value from the item + * + * @param array $params Parameters + * @return mixed + */ + public function get(array $params = array()); +} diff --git a/phpMyAdmin/libraries/classes/Di/NotFoundException.php b/phpMyAdmin/libraries/classes/Di/NotFoundException.php new file mode 100755 index 0000000..f861ff8 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/NotFoundException.php @@ -0,0 +1,20 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\NotFoundException class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +use Psr\Container\NotFoundExceptionInterface; + +/** + * Class NotFoundException + * + * @package PhpMyAdmin\Di + */ +class NotFoundException extends ContainerException implements NotFoundExceptionInterface +{ + +} diff --git a/phpMyAdmin/libraries/classes/Di/ReflectorItem.php b/phpMyAdmin/libraries/classes/Di/ReflectorItem.php new file mode 100755 index 0000000..228a1f7 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/ReflectorItem.php @@ -0,0 +1,128 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\ReflectorItem class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +/** + * Reflector manager + * + * @package PhpMyAdmin\Di + */ +abstract class ReflectorItem implements Item +{ + + /** @var Container */ + private $_container; + + /** @var \Reflector */ + private $_reflector; + + /** + * Constructor + * + * @param Container $container Container + * @param mixed $definition Definition + */ + public function __construct(Container $container, $definition) + { + $this->_container = $container; + $this->_reflector = self::_resolveReflector($definition); + } + + /** + * Invoke the reflector with given parameters + * + * @param array $params Parameters + * @return mixed + */ + protected function invoke(array $params = array()) + { + $args = array(); + $reflector = $this->_reflector; + if ($reflector instanceof \ReflectionClass) { + $constructor = $reflector->getConstructor(); + if (isset($constructor)) { + $args = $this->_resolveArgs( + $constructor->getParameters(), + $params + ); + } + return $reflector->newInstanceArgs($args); + } + /** @var \ReflectionFunctionAbstract $reflector */ + $args = $this->_resolveArgs( + $reflector->getParameters(), + $params + ); + if ($reflector instanceof \ReflectionMethod) { + /** @var \ReflectionMethod $reflector */ + return $reflector->invokeArgs(null, $args); + } + /** @var \ReflectionFunction $reflector */ + return $reflector->invokeArgs($args); + } + + /** + * Getting required arguments with given parameters + * + * @param \ReflectionParameter[] $required Arguments + * @param array $params Parameters + * +*@return array + */ + private function _resolveArgs($required, array $params = array()) + { + $args = array(); + foreach ($required as $param) { + $name = $param->getName(); + $type = $param->getClass(); + if (isset($type)) { + $type = $type->getName(); + } + if (isset($params[$name])) { + $args[] = $params[$name]; + } elseif (is_string($type) && isset($params[$type])) { + $args[] = $params[$type]; + } else { + try { + $content = $this->_container->get($name); + if (isset($content)) { + $args[] = $content; + } elseif (is_string($type)) { + $args[] = $this->_container->get($type); + } else { + $args[] = null; + } + } catch (NotFoundException $e) { + $args[] = null; + } + } + } + return $args; + } + + /** + * Resolve the reflection + * + * @param mixed $definition Definition + * + * @return \Reflector + */ + private static function _resolveReflector($definition) + { + if (function_exists($definition)) { + return new \ReflectionFunction($definition); + } + if (is_string($definition)) { + $definition = explode('::', $definition); + } + if (!isset($definition[1])) { + return new \ReflectionClass($definition[0]); + } + return new \ReflectionMethod($definition[0], $definition[1]); + } +} diff --git a/phpMyAdmin/libraries/classes/Di/ServiceItem.php b/phpMyAdmin/libraries/classes/Di/ServiceItem.php new file mode 100755 index 0000000..25a4576 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/ServiceItem.php @@ -0,0 +1,34 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\ServiceItem class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +/** + * Service manager + * + * @package PhpMyAdmin\Di + */ +class ServiceItem extends ReflectorItem +{ + + /** @var mixed */ + protected $instance; + + /** + * Get the instance of the service + * + * @param array $params Parameters + * @return mixed + */ + public function get(array $params = array()) + { + if (!isset($this->instance)) { + $this->instance = $this->invoke(); + } + return $this->instance; + } +} diff --git a/phpMyAdmin/libraries/classes/Di/ValueItem.php b/phpMyAdmin/libraries/classes/Di/ValueItem.php new file mode 100755 index 0000000..2997a37 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Di/ValueItem.php @@ -0,0 +1,41 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds the PhpMyAdmin\Di\ValueItem class + * + * @package PhpMyAdmin\Di + */ +namespace PhpMyAdmin\Di; + +/** + * Value manager + * + * @package PhpMyAdmin\Di + */ +class ValueItem implements Item +{ + + /** @var mixed */ + protected $value; + + /** + * Constructor + * + * @param mixed $value Value + */ + public function __construct($value) + { + $this->value = $value; + } + + /** + * Get the value + * + * @param array $params Parameters + * @return mixed + */ + public function get(array $params = array()) + { + return $this->value; + } +} diff --git a/phpMyAdmin/libraries/classes/Display/ChangePassword.php b/phpMyAdmin/libraries/classes/Display/ChangePassword.php new file mode 100755 index 0000000..dec2523 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Display/ChangePassword.php @@ -0,0 +1,165 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Displays form for password change + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Display; + +use PhpMyAdmin\Message; +use PhpMyAdmin\Server\Privileges; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Displays form for password change + * + * @package PhpMyAdmin + */ +class ChangePassword +{ + /** + * Get HTML for the Change password dialog + * + * @param string $mode where is the function being called? + * values : 'change_pw' or 'edit_other' + * @param string $username username + * @param string $hostname hostname + * + * @return string html snippet + */ + public static function getHtml($mode, $username, $hostname) + { + /** + * autocomplete feature of IE kills the "onchange" event handler and it + * must be replaced by the "onpropertychange" one in this case + */ + $chg_evt_handler = 'onchange'; + + $is_privileges = basename($_SERVER['SCRIPT_NAME']) === 'server_privileges.php'; + + $html = '<form method="post" id="change_password_form" ' + . 'action="' . basename($GLOBALS['PMA_PHP_SELF']) . '" ' + . 'name="chgPassword" ' + . 'class="' . ($is_privileges ? 'submenu-item' : '') . '">'; + + $html .= Url::getHiddenInputs(); + + if (strpos($GLOBALS['PMA_PHP_SELF'], 'server_privileges') !== false) { + $html .= '<input type="hidden" name="username" ' + . 'value="' . htmlspecialchars($username) . '" />' + . '<input type="hidden" name="hostname" ' + . 'value="' . htmlspecialchars($hostname) . '" />'; + } + $html .= '<fieldset id="fieldset_change_password">' + . '<legend' + . ($is_privileges + ? ' data-submenu-label="' . __('Change password') . '"' + : '' + ) + . '>' . __('Change password') . '</legend>' + . '<table class="data noclick">' + . '<tr>' + . '<td colspan="2">' + . '<input type="radio" name="nopass" value="1" id="nopass_1" ' + . 'onclick="pma_pw.value = \'\'; pma_pw2.value = \'\'; ' + . 'this.checked = true" />' + . '<label for="nopass_1">' . __('No Password') . '</label>' + . '</td>' + . '</tr>' + . '<tr class="vmiddle">' + . '<td>' + . '<input type="radio" name="nopass" value="0" id="nopass_0" ' + . 'onclick="document.getElementById(\'text_pma_change_pw\').focus();" ' + . 'checked="checked" />' + . '<label for="nopass_0">' . __('Password:') . ' </label>' + . '</td>' + . '<td>' + . __('Enter:') . '     ' + . '<input type="password" name="pma_pw" id="text_pma_change_pw" size="10" ' + . 'class="textfield"' + . 'onkeyup="checkPasswordStrength($(this).val(), $(\'#change_password_strength_meter\'), meter_obj_label = $(\'#change_password_strength\'), PMA_commonParams.get(\'user\'));" ' + . $chg_evt_handler . '="nopass[1].checked = true" />' + . '<span>Strength:</span> ' + . '<meter max="4" id="change_password_strength_meter" name="pw_meter"></meter> ' + . '<span id="change_password_strength" name="pw_strength">Good</span>' + . '<br>' . __('Re-type:') . ' ' + . '<input type="password" name="pma_pw2" id="text_pma_change_pw2" size="10" ' + . 'class="textfield"' + . $chg_evt_handler . '="nopass[1].checked = true" />' + . '</td>' + . '</tr>'; + + $serverType = Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); + $orig_auth_plugin = Privileges::getCurrentAuthenticationPlugin( + 'change', + $username, + $hostname + ); + + if (($serverType == 'MySQL' + && $serverVersion >= 50507) + || ($serverType == 'MariaDB' + && $serverVersion >= 50200) + ) { + // Provide this option only for 5.7.6+ + // OR for privileged users in 5.5.7+ + if (($serverType == 'MySQL' + && $serverVersion >= 50706) + || ($GLOBALS['dbi']->isSuperuser() && $mode == 'edit_other') + ) { + $auth_plugin_dropdown = Privileges::getHtmlForAuthPluginsDropdown( + $orig_auth_plugin, 'change_pw', 'new' + ); + + $html .= '<tr class="vmiddle">' + . '<td>' . __('Password Hashing:') . '</td><td>'; + $html .= $auth_plugin_dropdown; + $html .= '</td></tr>' + . '<tr id="tr_element_before_generate_password"></tr>' + . '</table>'; + + $html .= '<div' + . ($orig_auth_plugin != 'sha256_password' + ? ' class="hide"' + : '') + . ' id="ssl_reqd_warning_cp">' + . Message::notice( + __( + 'This method requires using an \'<i>SSL connection</i>\' ' + . 'or an \'<i>unencrypted connection that encrypts the ' + . 'password using RSA</i>\'; while connecting to the server.' + ) + . Util::showMySQLDocu( + 'sha256-authentication-plugin' + ) + ) + ->getDisplay() + . '</div>'; + } else { + $html .= '<tr id="tr_element_before_generate_password"></tr>' + . '</table>'; + } + } else { + $auth_plugin_dropdown = Privileges::getHtmlForAuthPluginsDropdown( + $orig_auth_plugin, 'change_pw', 'old' + ); + + $html .= '<tr class="vmiddle">' + . '<td>' . __('Password Hashing:') . '</td><td>'; + $html .= $auth_plugin_dropdown . '</td></tr>' + . '<tr id="tr_element_before_generate_password"></tr>' + . '</table>'; + } + + $html .= '</fieldset>' + . '<fieldset id="fieldset_change_password_footer" class="tblFooters">' + . '<input type="hidden" name="change_pw" value="1" />' + . '<input type="submit" value="' . __('Go') . '" />' + . '</fieldset>' + . '</form>'; + return $html; + } +} diff --git a/phpMyAdmin/libraries/classes/Display/CreateTable.php b/phpMyAdmin/libraries/classes/Display/CreateTable.php new file mode 100755 index 0000000..5114d62 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Display/CreateTable.php @@ -0,0 +1,53 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Displays form for creating a table (if user has privileges for that) + * + * for MySQL >= 4.1.0, we should be able to detect if user has a CREATE + * privilege by looking at SHOW GRANTS output; + * for < 4.1.0, it could be more difficult because the logic tries to + * detect the current host and it might be expressed in many ways; also + * on a shared server, the user might be unable to define a controluser + * that has the proper rights to the "mysql" db; + * so we give up and assume that user has the right to create a table + * + * Note: in this case we could even skip the following "foreach" logic + * + * Addendum, 2006-01-19: ok, I give up. We got some reports about servers + * where the hostname field in mysql.user is not the same as the one + * in mysql.db for a user. In this case, SHOW GRANTS does not return + * the db-specific privileges. And probably, those users are on a shared + * server, so can't set up a control user with rights to the "mysql" db. + * We cannot reliably detect the db-specific privileges, so no more + * warnings about the lack of privileges for CREATE TABLE. Tested + * on MySQL 5.0.18. + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Display; + +use PhpMyAdmin\Template; + +require_once './libraries/check_user_privileges.inc.php'; + +/** + * PhpMyAdmin\Display\CreateTable class + * + * @package PhpMyAdmin + */ +class CreateTable +{ + /** + * Returns the html for create table. + * + * @param string $db database name + * + * @return string + */ + public static function getHtml($db) + { + return Template::get('database/create_table')->render( + array('db' => $db) + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Display/Export.php b/phpMyAdmin/libraries/classes/Display/Export.php new file mode 100755 index 0000000..53b6109 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Display/Export.php @@ -0,0 +1,806 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * functions for displaying server, database and table export + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Display; + +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Encoding; +use PhpMyAdmin\Message; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Plugins\ExportPlugin; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Response; +use PhpMyAdmin\Table; +use PhpMyAdmin\Template; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * PhpMyAdmin\Display\Export class + * + * @package PhpMyAdmin + */ +class Export +{ + /** + * @var Relation $relation + */ + private $relation; + + /** + * Constructor + */ + public function __construct() + { + $this->relation = new Relation(); + } + + /** + * Outputs appropriate checked statement for checkbox. + * + * @param string $str option name + * + * @return boolean + */ + private function checkboxCheck($str) + { + return isset($GLOBALS['cfg']['Export'][$str]) + && $GLOBALS['cfg']['Export'][$str]; + } + + /** + * Prints Html For Export Selection Options + * + * @param string $tmpSelect Tmp selected method of export + * + * @return string + */ + public function getHtmlForSelectOptions($tmpSelect = '') + { + // Check if the selected databases are defined in $_POST + // (from clicking Back button on export.php) + if (isset($_POST['db_select'])) { + $_POST['db_select'] = urldecode($_POST['db_select']); + $_POST['db_select'] = explode(",", $_POST['db_select']); + } + + $databases = []; + foreach ($GLOBALS['dblist']->databases as $currentDb) { + if ($GLOBALS['dbi']->isSystemSchema($currentDb, true)) { + continue; + } + $isSelected = false; + if (isset($_POST['db_select'])) { + if (in_array($currentDb, $_POST['db_select'])) { + $isSelected = true; + } + } elseif (!empty($tmpSelect)) { + if (mb_strpos( + ' ' . $tmpSelect, + '|' . $currentDb . '|' + )) { + $isSelected = true; + } + } else { + $isSelected = true; + } + $databases[] = [ + 'name' => $currentDb, + 'is_selected' => $isSelected, + ]; + } + + return Template::get('display/export/select_options')->render([ + 'databases' => $databases, + ]); + } + + /** + * Prints Html For Export Hidden Input + * + * @param string $exportType Selected Export Type + * @param string $db Selected DB + * @param string $table Selected Table + * @param string $singleTable Single Table + * @param string $sqlQuery SQL Query + * + * @return string + */ + public function getHtmlForHiddenInputs( + $exportType, + $db, + $table, + $singleTable, + $sqlQuery + ) { + global $cfg; + + // If the export method was not set, the default is quick + if (isset($_POST['export_method'])) { + $cfg['Export']['method'] = $_POST['export_method']; + } elseif (! isset($cfg['Export']['method'])) { + $cfg['Export']['method'] = 'quick'; + } + + if (empty($sqlQuery) && isset($_POST['sql_query'])) { + $sqlQuery = $_POST['sql_query']; + } + + return Template::get('display/export/hidden_inputs')->render([ + 'db' => $db, + 'table' => $table, + 'export_type' => $exportType, + 'export_method' => $cfg['Export']['method'], + 'single_table' => $singleTable, + 'sql_query' => $sqlQuery, + 'template_id' => isset($_POST['template_id']) ? $_POST['template_id'] : '', + ]); + } + + /** + * Returns HTML for the options in template dropdown + * + * @param string $exportType export type - server, database, or table + * + * @return string HTML for the options in teplate dropdown + */ + private function getOptionsForTemplates($exportType) + { + // Get the relation settings + $cfgRelation = $this->relation->getRelationsParam(); + + $query = "SELECT `id`, `template_name` FROM " + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['export_templates']) + . " WHERE `username` = " + . "'" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) + . "' AND `export_type` = '" . $GLOBALS['dbi']->escapeString($exportType) . "'" + . " ORDER BY `template_name`;"; + + $result = $this->relation->queryAsControlUser($query); + + $templates = []; + if ($result !== false) { + while ($row = $GLOBALS['dbi']->fetchAssoc($result, DatabaseInterface::CONNECT_CONTROL)) { + $templates[] = [ + 'name' => $row['template_name'], + 'id' => $row['id'], + ]; + } + } + + return Template::get('display/export/template_options')->render([ + 'templates' => $templates, + 'selected_template' => !empty($_POST['template_id']) ? $_POST['template_id'] : null, + ]); + } + + /** + * Prints Html For Export Options Method + * + * @return string + */ + private function getHtmlForOptionsMethod() + { + global $cfg; + if (isset($_POST['quick_or_custom'])) { + $exportMethod = $_POST['quick_or_custom']; + } else { + $exportMethod = $cfg['Export']['method']; + } + + return Template::get('display/export/method')->render([ + 'export_method' => $exportMethod, + ]); + } + + /** + * Prints Html For Export Options Selection + * + * @param string $exportType Selected Export Type + * @param string $multiValues Export Options + * + * @return string + */ + private function getHtmlForOptionsSelection($exportType, $multiValues) + { + return Template::get('display/export/selection')->render([ + 'export_type' => $exportType, + 'multi_values' => $multiValues, + ]); + } + + /** + * Prints Html For Export Options Format dropdown + * + * @param ExportPlugin[] $exportList Export List + * + * @return string + */ + private function getHtmlForOptionsFormatDropdown($exportList) + { + $dropdown = Plugins::getChoice('Export', 'what', $exportList, 'format'); + return Template::get('display/export/format_dropdown')->render([ + 'dropdown' => $dropdown, + ]); + } + + /** + * Prints Html For Export Options Format-specific options + * + * @param ExportPlugin[] $exportList Export List + * + * @return string + */ + private function getHtmlForOptionsFormat($exportList) + { + global $cfg; + $options = Plugins::getOptions('Export', $exportList); + + return Template::get('display/export/options_format')->render([ + 'options' => $options, + 'can_convert_kanji' => Encoding::canConvertKanji(), + 'exec_time_limit' => $cfg['ExecTimeLimit'], + ]); + } + + /** + * Prints Html For Export Options Rows + * + * @param string $db Selected DB + * @param string $table Selected Table + * @param string $unlimNumRows Num of Rows + * + * @return string + */ + private function getHtmlForOptionsRows($db, $table, $unlimNumRows) + { + $tableObject = new Table($table, $db); + $numberOfRows = $tableObject->countRecords(); + + return Template::get('display/export/options_rows')->render([ + 'allrows' => isset($_POST['allrows']) ? $_POST['allrows'] : null, + 'limit_to' => isset($_POST['limit_to']) ? $_POST['limit_to'] : null, + 'limit_from' => isset($_POST['limit_from']) ? $_POST['limit_from'] : null, + 'unlim_num_rows' => $unlimNumRows, + 'number_of_rows' => $numberOfRows, + ]); + } + + /** + * Prints Html For Export Options Quick Export + * + * @return string + */ + private function getHtmlForOptionsQuickExport() + { + global $cfg; + $saveDir = Util::userDir($cfg['SaveDir']); + $exportIsChecked = $this->checkboxCheck( + 'quick_export_onserver' + ); + $exportOverwriteIsChecked = $this->checkboxCheck( + 'quick_export_onserver_overwrite' + ); + + return Template::get('display/export/options_quick_export')->render([ + 'save_dir' => $saveDir, + 'export_is_checked' => $exportIsChecked, + 'export_overwrite_is_checked' => $exportOverwriteIsChecked, + ]); + } + + /** + * Prints Html For Export Options Save Dir + * + * @return string + */ + private function getHtmlForOptionsOutputSaveDir() + { + global $cfg; + $saveDir = Util::userDir($cfg['SaveDir']); + $exportIsChecked = $this->checkboxCheck( + 'onserver' + ); + $exportOverwriteIsChecked = $this->checkboxCheck( + 'onserver_overwrite' + ); + + return Template::get('display/export/options_output_save_dir')->render([ + 'save_dir' => $saveDir, + 'export_is_checked' => $exportIsChecked, + 'export_overwrite_is_checked' => $exportOverwriteIsChecked, + ]); + } + + + /** + * Prints Html For Export Options + * + * @param string $exportType Selected Export Type + * + * @return string + */ + private function getHtmlForOptionsOutputFormat($exportType) + { + $trans = new Message; + $trans->addText(__('@SERVER@ will become the server name')); + if ($exportType == 'database' || $exportType == 'table') { + $trans->addText(__(', @DATABASE@ will become the database name')); + if ($exportType == 'table') { + $trans->addText(__(', @TABLE@ will become the table name')); + } + } + + $msg = new Message( + __( + 'This value is interpreted using %1$sstrftime%2$s, ' + . 'so you can use time formatting strings. ' + . 'Additionally the following transformations will happen: %3$s. ' + . 'Other text will be kept as is. See the %4$sFAQ%5$s for details.' + ) + ); + $msg->addParamHtml( + '<a href="' . Core::linkURL(Core::getPHPDocLink('function.strftime.php')) + . '" target="documentation" title="' . __('Documentation') . '">' + ); + $msg->addParamHtml('</a>'); + $msg->addParam($trans); + $docUrl = Util::getDocuLink('faq', 'faq6-27'); + $msg->addParamHtml( + '<a href="' . $docUrl . '" target="documentation">' + ); + $msg->addParamHtml('</a>'); + + if (isset($_POST['filename_template'])) { + $filenameTemplate = $_POST['filename_template']; + } else { + if ($exportType == 'database') { + $filenameTemplate = $GLOBALS['PMA_Config']->getUserValue( + 'pma_db_filename_template', + $GLOBALS['cfg']['Export']['file_template_database'] + ); + } elseif ($exportType == 'table') { + $filenameTemplate = $GLOBALS['PMA_Config']->getUserValue( + 'pma_table_filename_template', + $GLOBALS['cfg']['Export']['file_template_table'] + ); + } else { + $filenameTemplate = $GLOBALS['PMA_Config']->getUserValue( + 'pma_server_filename_template', + $GLOBALS['cfg']['Export']['file_template_server'] + ); + } + } + + return Template::get('display/export/options_output_format')->render([ + 'message' => $msg->getMessage(), + 'filename_template' => $filenameTemplate, + 'is_checked' => $this->checkboxCheck('remember_file_template'), + ]); + } + + /** + * Prints Html For Export Options Charset + * + * @return string + */ + private function getHtmlForOptionsOutputCharset() + { + global $cfg; + + return Template::get('display/export/options_output_charset')->render([ + 'encodings' => Encoding::listEncodings(), + 'export_charset' => $cfg['Export']['charset'], + ]); + } + + /** + * Prints Html For Export Options Compression + * + * @return string + */ + private function getHtmlForOptionsOutputCompression() + { + global $cfg; + if (isset($_POST['compression'])) { + $selectedCompression = $_POST['compression']; + } elseif (isset($cfg['Export']['compression'])) { + $selectedCompression = $cfg['Export']['compression']; + } else { + $selectedCompression = 'none'; + } + + // Since separate files export works with ZIP only + if (isset($cfg['Export']['as_separate_files']) + && $cfg['Export']['as_separate_files'] + ) { + $selectedCompression = 'zip'; + } + + // zip and gzip encode features + $isZip = ($cfg['ZipDump'] && function_exists('gzcompress')); + $isGzip = ($cfg['GZipDump'] && function_exists('gzencode')); + + return Template::get('display/export/options_output_compression')->render([ + 'is_zip' => $isZip, + 'is_gzip' => $isGzip, + 'selected_compression' => $selectedCompression, + ]); + } + + /** + * Prints Html For Export Options Radio + * + * @return string + */ + private function getHtmlForOptionsOutputRadio() + { + return Template::get('display/export/options_output_radio')->render([ + 'has_repopulate' => isset($_POST['repopulate']), + 'export_asfile' => $GLOBALS['cfg']['Export']['asfile'], + ]); + } + + /** + * Prints Html For Export Options Checkbox - Separate files + * + * @param string $exportType Selected Export Type + * + * @return string + */ + private function getHtmlForOptionsOutputSeparateFiles($exportType) + { + $isChecked = $this->checkboxCheck('as_separate_files'); + + return Template::get('display/export/options_output_separate_files')->render([ + 'is_checked' => $isChecked, + 'export_type' => $exportType, + ]); + } + + /** + * Prints Html For Export Options + * + * @param string $exportType Selected Export Type + * + * @return string + */ + private function getHtmlForOptionsOutput($exportType) + { + global $cfg; + + $hasAliases = isset($_SESSION['tmpval']['aliases']) + && !Core::emptyRecursive($_SESSION['tmpval']['aliases']); + unset($_SESSION['tmpval']['aliases']); + + $isCheckedLockTables = $this->checkboxCheck('lock_tables'); + $isCheckedAsfile = $this->checkboxCheck('asfile'); + + $optionsOutputSaveDir = ''; + if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { + $optionsOutputSaveDir = $this->getHtmlForOptionsOutputSaveDir(); + } + $optionsOutputFormat = $this->getHtmlForOptionsOutputFormat($exportType); + $optionsOutputCharset = ''; + if (Encoding::isSupported()) { + $optionsOutputCharset = $this->getHtmlForOptionsOutputCharset(); + } + $optionsOutputCompression = $this->getHtmlForOptionsOutputCompression(); + $optionsOutputSeparateFiles = ''; + if ($exportType == 'server' || $exportType == 'database') { + $optionsOutputSeparateFiles = $this->getHtmlForOptionsOutputSeparateFiles( + $exportType + ); + } + $optionsOutputRadio = $this->getHtmlForOptionsOutputRadio(); + + return Template::get('display/export/options_output')->render([ + 'has_aliases' => $hasAliases, + 'export_type' => $exportType, + 'is_checked_lock_tables' => $isCheckedLockTables, + 'is_checked_asfile' => $isCheckedAsfile, + 'repopulate' => isset($_POST['repopulate']), + 'lock_tables' => isset($_POST['lock_tables']), + 'save_dir' => isset($cfg['SaveDir']) ? $cfg['SaveDir'] : null, + 'is_encoding_supported' => Encoding::isSupported(), + 'options_output_save_dir' => $optionsOutputSaveDir, + 'options_output_format' => $optionsOutputFormat, + 'options_output_charset' => $optionsOutputCharset, + 'options_output_compression' => $optionsOutputCompression, + 'options_output_separate_files' => $optionsOutputSeparateFiles, + 'options_output_radio' => $optionsOutputRadio, + ]); + } + + /** + * Prints Html For Export Options + * + * @param string $exportType Selected Export Type + * @param string $db Selected DB + * @param string $table Selected Table + * @param string $multiValues Export selection + * @param string $numTables number of tables + * @param ExportPlugin[] $exportList Export List + * @param string $unlimNumRows Number of Rows + * + * @return string + */ + public function getHtmlForOptions( + $exportType, + $db, + $table, + $multiValues, + $numTables, + $exportList, + $unlimNumRows + ) { + global $cfg; + $html = $this->getHtmlForOptionsMethod(); + $html .= $this->getHtmlForOptionsFormatDropdown($exportList); + $html .= $this->getHtmlForOptionsSelection($exportType, $multiValues); + + $tableObject = new Table($table, $db); + if (strlen($table) > 0 && empty($numTables) && ! $tableObject->isMerge()) { + $html .= $this->getHtmlForOptionsRows($db, $table, $unlimNumRows); + } + + if (isset($cfg['SaveDir']) && !empty($cfg['SaveDir'])) { + $html .= $this->getHtmlForOptionsQuickExport(); + } + + $html .= $this->getHtmlForAliasModalDialog(); + $html .= $this->getHtmlForOptionsOutput($exportType); + $html .= $this->getHtmlForOptionsFormat($exportList); + return $html; + } + + /** + * Generate Html For currently defined aliases + * + * @return string + */ + private function getHtmlForCurrentAlias() + { + $result = '<table id="alias_data"><thead><tr><th colspan="4">' + . __('Defined aliases') + . '</th></tr></thead><tbody>'; + + $template = Template::get('export/alias_item'); + if (isset($_SESSION['tmpval']['aliases'])) { + foreach ($_SESSION['tmpval']['aliases'] as $db => $dbData) { + if (isset($dbData['alias'])) { + $result .= $template->render(array( + 'type' => _pgettext('Alias', 'Database'), + 'name' => $db, + 'field' => 'aliases[' . $db . '][alias]', + 'value' => $dbData['alias'], + )); + } + if (! isset($dbData['tables'])) { + continue; + } + foreach ($dbData['tables'] as $table => $tableData) { + if (isset($tableData['alias'])) { + $result .= $template->render(array( + 'type' => _pgettext('Alias', 'Table'), + 'name' => $db . '.' . $table, + 'field' => 'aliases[' . $db . '][tables][' . $table . '][alias]', + 'value' => $tableData['alias'], + )); + } + if (! isset($tableData['columns'])) { + continue; + } + foreach ($tableData['columns'] as $column => $columnName) { + $result .= $template->render(array( + 'type' => _pgettext('Alias', 'Column'), + 'name' => $db . '.' . $table . '.'. $column, + 'field' => 'aliases[' . $db . '][tables][' . $table . '][colums][' . $column . ']', + 'value' => $columnName, + )); + } + } + } + } + + // Empty row for javascript manipulations + $result .= '</tbody><tfoot class="hide">' . $template->render(array( + 'type' => '', 'name' => '', 'field' => 'aliases_new', 'value' => '' + )) . '</tfoot>'; + + return $result . '</table>'; + } + + /** + * Generate Html For Alias Modal Dialog + * + * @return string + */ + public function getHtmlForAliasModalDialog() + { + $title = __('Rename exported databases/tables/columns'); + + $html = '<div id="alias_modal" class="hide" title="' . $title . '">'; + $html .= $this->getHtmlForCurrentAlias(); + $html .= Template::get('export/alias_add')->render(); + + $html .= '</div>'; + return $html; + } + + /** + * Gets HTML to display export dialogs + * + * @param string $exportType export type: server|database|table + * @param string $db selected DB + * @param string $table selected table + * @param string $sqlQuery SQL query + * @param int $numTables number of tables + * @param int $unlimNumRows unlimited number of rows + * @param string $multiValues selector options + * + * @return string $html + */ + public function getDisplay( + $exportType, + $db, + $table, + $sqlQuery, + $numTables, + $unlimNumRows, + $multiValues + ) { + $cfgRelation = $this->relation->getRelationsParam(); + + if (isset($_POST['single_table'])) { + $GLOBALS['single_table'] = $_POST['single_table']; + } + + // Export a single table + if (isset($_GET['single_table'])) { + $GLOBALS['single_table'] = $_GET['single_table']; + } + + /* Scan for plugins */ + /* @var $exportList ExportPlugin[] */ + $exportList = Plugins::getPlugins( + "export", + 'libraries/classes/Plugins/Export/', + array( + 'export_type' => $exportType, + 'single_table' => isset($GLOBALS['single_table']) + ) + ); + + /* Fail if we didn't find any plugin */ + if (empty($exportList)) { + Message::error( + __('Could not load export plugins, please check your installation!') + )->display(); + exit; + } + + $html = Template::get('display/export/option_header')->render([ + 'export_type' => $exportType, + 'db' => $db, + 'table' => $table, + ]); + + if ($cfgRelation['exporttemplateswork']) { + $html .= Template::get('display/export/template_loading')->render([ + 'options' => $this->getOptionsForTemplates($exportType), + ]); + } + + $html .= '<form method="post" action="export.php" ' + . ' name="dump" class="disableAjax">'; + + //output Hidden Inputs + $singleTableStr = isset($GLOBALS['single_table']) ? $GLOBALS['single_table'] + : ''; + $html .= $this->getHtmlForHiddenInputs( + $exportType, + $db, + $table, + $singleTableStr, + $sqlQuery + ); + + //output Export Options + $html .= $this->getHtmlForOptions( + $exportType, + $db, + $table, + $multiValues, + $numTables, + $exportList, + $unlimNumRows + ); + + $html .= '</form>'; + return $html; + } + + /** + * Handles export template actions + * + * @param array $cfgRelation Relation configuration + * + * @return void + */ + public function handleTemplateActions(array $cfgRelation) + { + if (isset($_POST['templateId'])) { + $id = $GLOBALS['dbi']->escapeString($_POST['templateId']); + } else { + $id = ''; + } + + $templateTable = Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['export_templates']); + $user = $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']); + + switch ($_POST['templateAction']) { + case 'create': + $query = "INSERT INTO " . $templateTable . "(" + . " `username`, `export_type`," + . " `template_name`, `template_data`" + . ") VALUES (" + . "'" . $user . "', " + . "'" . $GLOBALS['dbi']->escapeString($_POST['exportType']) + . "', '" . $GLOBALS['dbi']->escapeString($_POST['templateName']) + . "', '" . $GLOBALS['dbi']->escapeString($_POST['templateData']) + . "');"; + break; + case 'load': + $query = "SELECT `template_data` FROM " . $templateTable + . " WHERE `id` = " . $id . " AND `username` = '" . $user . "'"; + break; + case 'update': + $query = "UPDATE " . $templateTable . " SET `template_data` = " + . "'" . $GLOBALS['dbi']->escapeString($_POST['templateData']) . "'" + . " WHERE `id` = " . $id . " AND `username` = '" . $user . "'"; + break; + case 'delete': + $query = "DELETE FROM " . $templateTable + . " WHERE `id` = " . $id . " AND `username` = '" . $user . "'"; + break; + default: + $query = ''; + break; + } + + $result = $this->relation->queryAsControlUser($query, false); + + $response = Response::getInstance(); + if (! $result) { + $error = $GLOBALS['dbi']->getError(DatabaseInterface::CONNECT_CONTROL); + $response->setRequestStatus(false); + $response->addJSON('message', $error); + exit; + } + + $response->setRequestStatus(true); + if ('create' == $_POST['templateAction']) { + $response->addJSON( + 'data', + $this->getOptionsForTemplates($_POST['exportType']) + ); + } elseif ('load' == $_POST['templateAction']) { + $data = null; + while ($row = $GLOBALS['dbi']->fetchAssoc( + $result, DatabaseInterface::CONNECT_CONTROL + )) { + $data = $row['template_data']; + } + $response->addJSON('data', $data); + } + $GLOBALS['dbi']->freeResult($result); + } +} diff --git a/phpMyAdmin/libraries/classes/Display/GitRevision.php b/phpMyAdmin/libraries/classes/Display/GitRevision.php new file mode 100755 index 0000000..4cbd0cf --- /dev/null +++ b/phpMyAdmin/libraries/classes/Display/GitRevision.php @@ -0,0 +1,103 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Displays git revision + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Display; + +use PhpMyAdmin\Core; +use PhpMyAdmin\Response; +use PhpMyAdmin\Util; + +/** + * PhpMyAdmin\Display\GitRevision class + * + * @package PhpMyAdmin + */ +class GitRevision +{ + /** + * Prints details about the current Git commit revision + * + * @return void + */ + public static function display() + { + + // load revision data from repo + $GLOBALS['PMA_Config']->checkGitRevision(); + + if (! $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT')) { + $response = Response::getInstance(); + $response->setRequestStatus(false); + return; + } + + // if using a remote commit fast-forwarded, link to GitHub + $commit_hash = substr( + $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH'), + 0, + 7 + ); + $commit_hash = '<strong title="' + . htmlspecialchars($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_MESSAGE')) + . '">' . htmlspecialchars($commit_hash) . '</strong>'; + if ($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTECOMMIT')) { + $commit_hash = '<a href="' + . Core::linkURL( + 'https://github.com/phpmyadmin/phpmyadmin/commit/' + . htmlspecialchars($GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITHASH')) + ) + . '" rel="noopener noreferrer" target="_blank">' . $commit_hash . '</a>'; + } + + $branch = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH'); + $isRemoteBranch = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_ISREMOTEBRANCH'); + if ($isRemoteBranch) { + $branch = '<a href="' + . Core::linkURL( + 'https://github.com/phpmyadmin/phpmyadmin/tree/' + . $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_BRANCH') + ) + . '" rel="noopener noreferrer" target="_blank">' . htmlspecialchars($branch) . '</a>'; + } + if ($branch !== false) { + $branch = sprintf( + __('%1$s from %2$s branch'), + $commit_hash, + $isRemoteBranch ? $branch : htmlspecialchars($branch) + ); + } else { + $branch = $commit_hash . ' (' . __('no branch') . ')'; + } + + $committer = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_COMMITTER'); + $author = $GLOBALS['PMA_Config']->get('PMA_VERSION_GIT_AUTHOR'); + Core::printListItem( + __('Git revision:') . ' ' + . $branch . ',<br /> ' + . sprintf( + __('committed on %1$s by %2$s'), + Util::localisedDate(strtotime($committer['date'])), + '<a href="' . Core::linkURL( + 'mailto:' . htmlspecialchars($committer['email']) + ) . '">' + . htmlspecialchars($committer['name']) . '</a>' + ) + . ($author != $committer + ? ', <br />' + . sprintf( + __('authored on %1$s by %2$s'), + Util::localisedDate(strtotime($author['date'])), + '<a href="' . Core::linkURL( + 'mailto:' . htmlspecialchars($author['email']) + ) . '">' + . htmlspecialchars($author['name']) . '</a>' + ) + : ''), + 'li_pma_version_git', null, null, null + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Display/Import.php b/phpMyAdmin/libraries/classes/Display/Import.php new file mode 100755 index 0000000..f3cbb6b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Display/Import.php @@ -0,0 +1,111 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * functions for displaying import for: server, database and table + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Display; + +use PhpMyAdmin\Core; +use PhpMyAdmin\Display\ImportAjax; +use PhpMyAdmin\Encoding; +use PhpMyAdmin\Message; +use PhpMyAdmin\Plugins; +use PhpMyAdmin\Template; + +/** + * PhpMyAdmin\Display\Import class + * + * @package PhpMyAdmin + */ +class Import +{ + /** + * Gets HTML to display import dialogs + * + * @param string $importType Import type: server|database|table + * @param string $db Selected DB + * @param string $table Selected Table + * @param int $maxUploadSize Max upload size + * + * @return string HTML + */ + public static function get($importType, $db, $table, $maxUploadSize) + { + global $cfg; + global $SESSION_KEY; + + list( + $SESSION_KEY, + $uploadId, + ) = ImportAjax::uploadProgressSetup(); + + /* Scan for plugins */ + /* @var $importList \PhpMyAdmin\Plugins\ImportPlugin[] */ + $importList = Plugins::getPlugins( + "import", + 'libraries/classes/Plugins/Import/', + $importType + ); + + /* Fail if we didn't find any plugin */ + if (empty($importList)) { + Message::error( + __( + 'Could not load import plugins, please check your installation!' + ) + )->display(); + exit; + } + + if (Core::isValid($_REQUEST['offset'], 'numeric')) { + $offset = intval($_REQUEST['offset']); + } + if (isset($_REQUEST['timeout_passed'])) { + $timeoutPassed = $_REQUEST['timeout_passed']; + } + + $localImportFile = ''; + if (isset($_REQUEST['local_import_file'])) { + $localImportFile = $_REQUEST['local_import_file']; + } + + // zip, gzip and bzip2 encode features + $compressions = array(); + if ($cfg['GZipDump'] && function_exists('gzopen')) { + $compressions[] = 'gzip'; + } + if ($cfg['BZipDump'] && function_exists('bzopen')) { + $compressions[] = 'bzip2'; + } + if ($cfg['ZipDump'] && function_exists('zip_open')) { + $compressions[] = 'zip'; + } + + return Template::get('display/import/import')->render([ + 'upload_id' => $uploadId, + 'handler' => $_SESSION[$SESSION_KEY]["handler"], + 'id_key' => $_SESSION[$SESSION_KEY]['handler']::getIdKey(), + 'pma_theme_image' => $GLOBALS['pmaThemeImage'], + 'import_type' => $importType, + 'db' => $db, + 'table' => $table, + 'max_upload_size' => $maxUploadSize, + 'import_list' => $importList, + 'local_import_file' => $localImportFile, + 'is_upload' => $GLOBALS['is_upload'], + 'upload_dir' => isset($cfg['UploadDir']) ? $cfg['UploadDir'] : null, + 'timeout_passed_global' => isset($GLOBALS['timeout_passed']) ? $GLOBALS['timeout_passed'] : null, + 'compressions' => $compressions, + 'is_encoding_supported' => Encoding::isSupported(), + 'encodings' => Encoding::listEncodings(), + 'import_charset' => isset($cfg['Import']['charset']) ? $cfg['Import']['charset'] : null, + 'dbi' => $GLOBALS['dbi'], + 'disable_is' => $cfg['Server']['DisableIS'], + 'timeout_passed' => isset($timeoutPassed) ? $timeoutPassed : null, + 'offset' => isset($offset) ? $offset : null, + 'can_convert_kanji' => Encoding::canConvertKanji(), + ]); + } +} diff --git a/phpMyAdmin/libraries/classes/Display/ImportAjax.php b/phpMyAdmin/libraries/classes/Display/ImportAjax.php new file mode 100755 index 0000000..abb5e71 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Display/ImportAjax.php @@ -0,0 +1,134 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** +* Handles plugins that show the upload progress +* +* @package PhpMyAdmin +*/ +namespace PhpMyAdmin\Display; + +use PhpMyAdmin\Core; + +/** +* PhpMyAdmin\Display\ImportAjax class +* +* @package PhpMyAdmin +*/ +class ImportAjax +{ + /** + * Sets up some variables for upload progress + * + * @return array + */ + public static function uploadProgressSetup() + { + /** + * constant for differentiating array in $_SESSION variable + */ + $SESSION_KEY = '__upload_status'; + + /** + * sets default plugin for handling the import process + */ + $_SESSION[$SESSION_KEY]["handler"] = ""; + + /** + * unique ID for each upload + */ + $upload_id = uniqid(""); + + /** + * list of available plugins + */ + $plugins = array( + // PHP 5.4 session-based upload progress is problematic, see bug 3964 + //"session", + "progress", + "apc", + "noplugin" + ); + + // select available plugin + foreach ($plugins as $plugin) { + $check = $plugin . "Check"; + + if (self::$check()) { + $upload_class = 'PhpMyAdmin\Plugins\Import\Upload\Upload' . ucwords( + $plugin + ); + $_SESSION[$SESSION_KEY]["handler"] = $upload_class; + break; + } + } + return array($SESSION_KEY, $upload_id, $plugins); + } + + /** + * Checks if APC bar extension is available and configured correctly. + * + * @return boolean true if APC extension is available and if rfc1867 is enabled, + * false if it is not + */ + public static function apcCheck() + { + if (! extension_loaded('apc') + || ! function_exists('apc_fetch') + || ! function_exists('getallheaders') + ) { + return false; + } + return (ini_get('apc.enabled') && ini_get('apc.rfc1867')); + } + + /** + * Checks if PhpMyAdmin\Plugins\Import\Upload\UploadProgress bar extension is + * available. + * + * @return boolean true if PhpMyAdmin\Plugins\Import\Upload\UploadProgress + * extension is available, false if it is not + */ + public static function progressCheck() + { + return function_exists("uploadprogress_get_info") + && function_exists('getallheaders'); + } + + /** + * Checks if PHP 5.4 session upload-progress feature is available. + * + * @return boolean true if PHP 5.4 session upload-progress is available, + * false if it is not + */ + public static function sessionCheck() + { + return ini_get('session.upload_progress.enabled'); + } + + /** + * Default plugin for handling import. + * If no other plugin is available, noplugin is used. + * + * @return boolean true + */ + public static function nopluginCheck() + { + return true; + } + + /** + * The function outputs json encoded status of uploaded. + * It uses PMA_getUploadStatus, which is defined in plugin's file. + * + * @param string $id ID of transfer, usually $upload_id + * + * @return void + */ + public static function status($id) + { + Core::headerJSON(); + echo json_encode( + $_SESSION[$GLOBALS['SESSION_KEY']]['handler']::getUploadStatus($id) + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Display/Results.php b/phpMyAdmin/libraries/classes/Display/Results.php new file mode 100755 index 0000000..e371df9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Display/Results.php @@ -0,0 +1,5687 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Hold the PhpMyAdmin\Display\Results class + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Display; + +use PhpMyAdmin\Core; +use PhpMyAdmin\DatabaseInterface; +use PhpMyAdmin\Index; +use PhpMyAdmin\Message; +use PhpMyAdmin\Plugins\Transformations\Text_Plain_Link; +use PhpMyAdmin\Relation; +use PhpMyAdmin\Response; +use PhpMyAdmin\Sanitize; +use PhpMyAdmin\Sql; +use PhpMyAdmin\SqlParser\Utils\Query; +use PhpMyAdmin\Table; +use PhpMyAdmin\Template; +use PhpMyAdmin\Transformations; +use PhpMyAdmin\Url; +use PhpMyAdmin\Util; + +/** + * Handle all the functionalities related to displaying results + * of sql queries, stored procedure, browsing sql processes or + * displaying binary log. + * + * @package PhpMyAdmin + */ +class Results +{ + // Define constants + const NO_EDIT_OR_DELETE = 'nn'; + const UPDATE_ROW = 'ur'; + const DELETE_ROW = 'dr'; + const KILL_PROCESS = 'kp'; + + const POSITION_LEFT = 'left'; + const POSITION_RIGHT = 'right'; + const POSITION_BOTH = 'both'; + const POSITION_NONE = 'none'; + + const PLACE_TOP_DIRECTION_DROPDOWN = 'top_direction_dropdown'; + const PLACE_BOTTOM_DIRECTION_DROPDOWN = 'bottom_direction_dropdown'; + + const DISPLAY_FULL_TEXT = 'F'; + const DISPLAY_PARTIAL_TEXT = 'P'; + + const HEADER_FLIP_TYPE_AUTO = 'auto'; + const HEADER_FLIP_TYPE_CSS = 'css'; + const HEADER_FLIP_TYPE_FAKE = 'fake'; + + const DATE_FIELD = 'date'; + const DATETIME_FIELD = 'datetime'; + const TIMESTAMP_FIELD = 'timestamp'; + const TIME_FIELD = 'time'; + const STRING_FIELD = 'string'; + const GEOMETRY_FIELD = 'geometry'; + const BLOB_FIELD = 'BLOB'; + const BINARY_FIELD = 'BINARY'; + + const RELATIONAL_KEY = 'K'; + const RELATIONAL_DISPLAY_COLUMN = 'D'; + + const GEOMETRY_DISP_GEOM = 'GEOM'; + const GEOMETRY_DISP_WKT = 'WKT'; + const GEOMETRY_DISP_WKB = 'WKB'; + + const SMART_SORT_ORDER = 'SMART'; + const ASCENDING_SORT_DIR = 'ASC'; + const DESCENDING_SORT_DIR = 'DESC'; + + const TABLE_TYPE_INNO_DB = 'InnoDB'; + const ALL_ROWS = 'all'; + const QUERY_TYPE_SELECT = 'SELECT'; + + const ROUTINE_PROCEDURE = 'procedure'; + const ROUTINE_FUNCTION = 'function'; + + const ACTION_LINK_CONTENT_ICONS = 'icons'; + const ACTION_LINK_CONTENT_TEXT = 'text'; + + + // Declare global fields + + /** array with properties of the class */ + private $_property_array = array( + + /** string Database name */ + 'db' => null, + + /** string Table name */ + 'table' => null, + + /** string the URL to go back in case of errors */ + 'goto' => null, + + /** string the SQL query */ + 'sql_query' => null, + + /** + * integer the total number of rows returned by the SQL query without any + * appended "LIMIT" clause programmatically + */ + 'unlim_num_rows' => null, + + /** array meta information about fields */ + 'fields_meta' => null, + + /** boolean */ + 'is_count' => null, + + /** integer */ + 'is_export' => null, + + /** boolean */ + 'is_func' => null, + + /** integer */ + 'is_analyse' => null, + + /** integer the total number of rows returned by the SQL query */ + 'num_rows' => null, + + /** integer the total number of fields returned by the SQL query */ + 'fields_cnt' => null, + + /** double time taken for execute the SQL query */ + 'querytime' => null, + + /** string path for theme images directory */ + 'pma_theme_image' => null, + + /** string */ + 'text_dir' => null, + + /** boolean */ + 'is_maint' => null, + + /** boolean */ + 'is_explain' => null, + + /** boolean */ + 'is_show' => null, + + /** boolean */ + 'is_browse_distinct' => null, + + /** array table definitions */ + 'showtable' => null, + + /** string */ + 'printview' => null, + + /** string URL query */ + 'url_query' => null, + + /** array column names to highlight */ + 'highlight_columns' => null, + + /** array holding various display information */ + 'display_params' => null, + + /** array mime types information of fields */ + 'mime_map' => null, + + /** boolean */ + 'editable' => null, + + /** random unique ID to distinguish result set */ + 'unique_id' => null, + + /** where clauses for each row, each table in the row */ + 'whereClauseMap' => array(), + ); + + /** + * This variable contains the column transformation information + * for some of the system databases. + * One element of this array represent all relevant columns in all tables in + * one specific database + */ + public $transformation_info; + + /** + * @var Relation $relation + */ + private $relation; + + /** + * Get any property of this class + * + * @param string $property name of the property + * + * @return mixed|void if property exist, value of the relevant property + */ + public function __get($property) + { + if (array_key_exists($property, $this->_property_array)) { + return $this->_property_array[$property]; + } + } + + /** + * Set values for any property of this class + * + * @param string $property name of the property + * @param mixed $value value to set + * + * @return void + */ + public function __set($property, $value) + { + if (array_key_exists($property, $this->_property_array)) { + $this->_property_array[$property] = $value; + } + } + + /** + * Constructor for PhpMyAdmin\Display\Results class + * + * @param string $db the database name + * @param string $table the table name + * @param string $goto the URL to go back in case of errors + * @param string $sql_query the SQL query + * + * @access public + */ + public function __construct($db, $table, $goto, $sql_query) + { + $this->relation = new Relation(); + + $this->_setDefaultTransformations(); + + $this->__set('db', $db); + $this->__set('table', $table); + $this->__set('goto', $goto); + $this->__set('sql_query', $sql_query); + $this->__set('unique_id', rand()); + } + + /** + * Sets default transformations for some columns + * + * @return void + */ + private function _setDefaultTransformations() + { + $json_highlighting_data = array( + 'libraries/classes/Plugins/Transformations/Output/Text_Plain_Json.php', + 'PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Json', + 'Text_Plain' + ); + $sql_highlighting_data = array( + 'libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php', + 'PhpMyAdmin\Plugins\Transformations\Output\Text_Plain_Sql', + 'Text_Plain' + ); + $blob_sql_highlighting_data = array( + 'libraries/classes/Plugins/Transformations/Output/Text_Octetstream_Sql.php', + 'PhpMyAdmin\Plugins\Transformations\Output\Text_Octetstream_Sql', + 'Text_Octetstream' + ); + $link_data = array( + 'libraries/classes/Plugins/Transformations/Text_Plain_Link.php', + 'PhpMyAdmin\Plugins\Transformations\Text_Plain_Link', + 'Text_Plain' + ); + $this->transformation_info = array( + 'information_schema' => array( + 'events' => array( + 'event_definition' => $sql_highlighting_data + ), + 'processlist' => array( + 'info' => $sql_highlighting_data + ), + 'routines' => array( + 'routine_definition' => $sql_highlighting_data + ), + 'triggers' => array( + 'action_statement' => $sql_highlighting_data + ), + 'views' => array( + 'view_definition' => $sql_highlighting_data + ) + ), + 'mysql' => array( + 'event' => array( + 'body' => $blob_sql_highlighting_data, + 'body_utf8' => $blob_sql_highlighting_data + ), + 'general_log' => array( + 'argument' => $sql_highlighting_data + ), + 'help_category' => array( + 'url' => $link_data + ), + 'help_topic' => array( + 'example' => $sql_highlighting_data, + 'url' => $link_data + ), + 'proc' => array( + 'param_list' => $blob_sql_highlighting_data, + 'returns' => $blob_sql_highlighting_data, + 'body' => $blob_sql_highlighting_data, + 'body_utf8' => $blob_sql_highlighting_data + ), + 'slow_log' => array( + 'sql_text' => $sql_highlighting_data + ) + ) + ); + + $cfgRelation = $this->relation->getRelationsParam(); + if ($cfgRelation['db']) { + $this->transformation_info[$cfgRelation['db']] = array(); + $relDb = &$this->transformation_info[$cfgRelation['db']]; + if (! empty($cfgRelation['history'])) { + $relDb[$cfgRelation['history']] = array( + 'sqlquery' => $sql_highlighting_data + ); + } + if (! empty($cfgRelation['bookmark'])) { + $relDb[$cfgRelation['bookmark']] = array( + 'query' => $sql_highlighting_data + ); + } + if (! empty($cfgRelation['tracking'])) { + $relDb[$cfgRelation['tracking']] = array( + 'schema_sql' => $sql_highlighting_data, + 'data_sql' => $sql_highlighting_data + ); + } + if (! empty($cfgRelation['favorite'])) { + $relDb[$cfgRelation['favorite']] = array( + 'tables' => $json_highlighting_data + ); + } + if (! empty($cfgRelation['recent'])) { + $relDb[$cfgRelation['recent']] = array( + 'tables' => $json_highlighting_data + ); + } + if (! empty($cfgRelation['savedsearches'])) { + $relDb[$cfgRelation['savedsearches']] = array( + 'search_data' => $json_highlighting_data + ); + } + if (! empty($cfgRelation['designer_settings'])) { + $relDb[$cfgRelation['designer_settings']] = array( + 'settings_data' => $json_highlighting_data + ); + } + if (! empty($cfgRelation['table_uiprefs'])) { + $relDb[$cfgRelation['table_uiprefs']] = array( + 'prefs' => $json_highlighting_data + ); + } + if (! empty($cfgRelation['userconfig'])) { + $relDb[$cfgRelation['userconfig']] = array( + 'config_data' => $json_highlighting_data + ); + } + if (! empty($cfgRelation['export_templates'])) { + $relDb[$cfgRelation['export_templates']] = array( + 'template_data' => $json_highlighting_data + ); + } + } + } + + /** + * Set properties which were not initialized at the constructor + * + * @param integer $unlim_num_rows the total number of rows returned by + * the SQL query without any appended + * "LIMIT" clause programmatically + * @param array $fields_meta meta information about fields + * @param boolean $is_count statement is SELECT COUNT + * @param integer $is_export statement contains INTO OUTFILE + * @param boolean $is_func statement contains a function like SUM() + * @param integer $is_analyse statement contains PROCEDURE ANALYSE + * @param integer $num_rows total no. of rows returned by SQL query + * @param integer $fields_cnt total no.of fields returned by SQL query + * @param double $querytime time taken for execute the SQL query + * @param string $pmaThemeImage path for theme images directory + * @param string $text_dir text direction + * @param boolean $is_maint statement contains a maintenance command + * @param boolean $is_explain statement contains EXPLAIN + * @param boolean $is_show statement contains SHOW + * @param array $showtable table definitions + * @param string $printview print view was requested + * @param string $url_query URL query + * @param boolean $editable whether the results set is editable + * @param boolean $is_browse_dist whether browsing distinct values + * + * @return void + * + * @see sql.php + */ + public function setProperties( + $unlim_num_rows, $fields_meta, $is_count, $is_export, $is_func, + $is_analyse, $num_rows, $fields_cnt, $querytime, $pmaThemeImage, $text_dir, + $is_maint, $is_explain, $is_show, $showtable, $printview, $url_query, + $editable, $is_browse_dist + ) { + + $this->__set('unlim_num_rows', $unlim_num_rows); + $this->__set('fields_meta', $fields_meta); + $this->__set('is_count', $is_count); + $this->__set('is_export', $is_export); + $this->__set('is_func', $is_func); + $this->__set('is_analyse', $is_analyse); + $this->__set('num_rows', $num_rows); + $this->__set('fields_cnt', $fields_cnt); + $this->__set('querytime', $querytime); + $this->__set('pma_theme_image', $pmaThemeImage); + $this->__set('text_dir', $text_dir); + $this->__set('is_maint', $is_maint); + $this->__set('is_explain', $is_explain); + $this->__set('is_show', $is_show); + $this->__set('showtable', $showtable); + $this->__set('printview', $printview); + $this->__set('url_query', $url_query); + $this->__set('editable', $editable); + $this->__set('is_browse_distinct', $is_browse_dist); + + } // end of the 'setProperties()' function + + + /** + * Defines the parts to display for a print view + * + * @param array $displayParts the parts to display + * + * @return array $displayParts the modified display parts + * + * @access private + * + */ + private function _setDisplayPartsForPrintView(array $displayParts) + { + // set all elements to false! + $displayParts['edit_lnk'] = self::NO_EDIT_OR_DELETE; // no edit link + $displayParts['del_lnk'] = self::NO_EDIT_OR_DELETE; // no delete link + $displayParts['sort_lnk'] = (string) '0'; + $displayParts['nav_bar'] = (string) '0'; + $displayParts['bkm_form'] = (string) '0'; + $displayParts['text_btn'] = (string) '0'; + $displayParts['pview_lnk'] = (string) '0'; + + return $displayParts; + } + + /** + * Defines the parts to display for a SHOW statement + * + * @param array $displayParts the parts to display + * + * @return array $displayParts the modified display parts + * + * @access private + * + */ + private function _setDisplayPartsForShow(array $displayParts) + { + preg_match( + '@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?' + . 'PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS' + . ')@i', + $this->__get('sql_query'), $which + ); + + $bIsProcessList = isset($which[1]); + if ($bIsProcessList) { + $str = ' ' . strtoupper($which[1]); + $bIsProcessList = $bIsProcessList + && strpos($str, 'PROCESSLIST') > 0; + } + + if ($bIsProcessList) { + // no edit link + $displayParts['edit_lnk'] = self::NO_EDIT_OR_DELETE; + // "kill process" type edit link + $displayParts['del_lnk'] = self::KILL_PROCESS; + } else { + // Default case -> no links + // no edit link + $displayParts['edit_lnk'] = self::NO_EDIT_OR_DELETE; + // no delete link + $displayParts['del_lnk'] = self::NO_EDIT_OR_DELETE; + } + // Other settings + $displayParts['sort_lnk'] = (string) '0'; + $displayParts['nav_bar'] = (string) '0'; + $displayParts['bkm_form'] = (string) '1'; + $displayParts['text_btn'] = (string) '1'; + $displayParts['pview_lnk'] = (string) '1'; + + return $displayParts; + } + + /** + * Defines the parts to display for statements not related to data + * + * @param array $displayParts the parts to display + * + * @return array $displayParts the modified display parts + * + * @access private + * + */ + private function _setDisplayPartsForNonData(array $displayParts) + { + // Statement is a "SELECT COUNT", a + // "CHECK/ANALYZE/REPAIR/OPTIMIZE/CHECKSUM", an "EXPLAIN" one or + // contains a "PROC ANALYSE" part + $displayParts['edit_lnk'] = self::NO_EDIT_OR_DELETE; // no edit link + $displayParts['del_lnk'] = self::NO_EDIT_OR_DELETE; // no delete link + $displayParts['sort_lnk'] = (string) '0'; + $displayParts['nav_bar'] = (string) '0'; + $displayParts['bkm_form'] = (string) '1'; + + if ($this->__get('is_maint')) { + $displayParts['text_btn'] = (string) '1'; + } else { + $displayParts['text_btn'] = (string) '0'; + } + $displayParts['pview_lnk'] = (string) '1'; + + return $displayParts; + } + + /** + * Defines the parts to display for other statements (probably SELECT) + * + * @param array $displayParts the parts to display + * + * @return array $displayParts the modified display parts + * + * @access private + * + */ + private function _setDisplayPartsForSelect(array $displayParts) + { + // Other statements (ie "SELECT" ones) -> updates + // $displayParts['edit_lnk'], $displayParts['del_lnk'] and + // $displayParts['text_btn'] (keeps other default values) + + $fields_meta = $this->__get('fields_meta'); + $prev_table = ''; + $displayParts['text_btn'] = (string) '1'; + $number_of_columns = $this->__get('fields_cnt'); + + for ($i = 0; $i < $number_of_columns; $i++) { + + $is_link = ($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + || ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE) + || ($displayParts['sort_lnk'] != '0'); + + // Displays edit/delete/sort/insert links? + if ($is_link + && $prev_table != '' + && $fields_meta[$i]->table != '' + && $fields_meta[$i]->table != $prev_table + ) { + // don't display links + $displayParts['edit_lnk'] = self::NO_EDIT_OR_DELETE; + $displayParts['del_lnk'] = self::NO_EDIT_OR_DELETE; + /** + * @todo May be problematic with same field names + * in two joined table. + */ + // $displayParts['sort_lnk'] = (string) '0'; + if ($displayParts['text_btn'] == '1') { + break; + } + } // end if + + // Always display print view link + $displayParts['pview_lnk'] = (string) '1'; + if ($fields_meta[$i]->table != '') { + $prev_table = $fields_meta[$i]->table; + } + } // end for + + if ($prev_table == '') { // no table for any of the columns + // don't display links + $displayParts['edit_lnk'] = self::NO_EDIT_OR_DELETE; + $displayParts['del_lnk'] = self::NO_EDIT_OR_DELETE; + } + + return $displayParts; + } + + /** + * Defines the parts to display for the results of a SQL query + * and the total number of rows + * + * @param array $displayParts the parts to display (see a few + * lines above for explanations) + * + * @return array the first element is an array with explicit indexes + * for all the display elements + * the second element is the total number of rows returned + * by the SQL query without any programmatically appended + * LIMIT clause (just a copy of $unlim_num_rows if it exists, + * else computed inside this function) + * + * + * @access private + * + * @see getTable() + */ + private function _setDisplayPartsAndTotal(array $displayParts) + { + $the_total = 0; + + // 1. Following variables are needed for use in isset/empty or + // use with array indexes or safe use in foreach + $db = $this->__get('db'); + $table = $this->__get('table'); + $unlim_num_rows = $this->__get('unlim_num_rows'); + $num_rows = $this->__get('num_rows'); + $printview = $this->__get('printview'); + + // 2. Updates the display parts + if ($printview == '1') { + $displayParts = $this->_setDisplayPartsForPrintView($displayParts); + + } elseif ($this->__get('is_count') || $this->__get('is_analyse') + || $this->__get('is_maint') || $this->__get('is_explain') + ) { + $displayParts = $this->_setDisplayPartsForNonData($displayParts); + + } elseif ($this->__get('is_show')) { + $displayParts = $this->_setDisplayPartsForShow($displayParts); + + } else { + $displayParts = $this->_setDisplayPartsForSelect($displayParts); + } // end if..elseif...else + + // 3. Gets the total number of rows if it is unknown + if (isset($unlim_num_rows) && $unlim_num_rows != '') { + $the_total = $unlim_num_rows; + } elseif ((($displayParts['nav_bar'] == '1') + || ($displayParts['sort_lnk'] == '1')) + && (strlen($db) > 0 && strlen($table) > 0) + ) { + $the_total = $GLOBALS['dbi']->getTable($db, $table)->countRecords(); + } + + // if for COUNT query, number of rows returned more than 1 + // (may be being used GROUP BY) + if ($this->__get('is_count') && isset($num_rows) && $num_rows > 1) { + $displayParts['nav_bar'] = (string) '1'; + $displayParts['sort_lnk'] = (string) '1'; + } + // 4. If navigation bar or sorting fields names URLs should be + // displayed but there is only one row, change these settings to + // false + if ($displayParts['nav_bar'] == '1' || $displayParts['sort_lnk'] == '1') { + + // - Do not display sort links if less than 2 rows. + // - For a VIEW we (probably) did not count the number of rows + // so don't test this number here, it would remove the possibility + // of sorting VIEW results. + $_table = new Table($table, $db); + if (isset($unlim_num_rows) + && ($unlim_num_rows < 2) + && ! $_table->isView() + ) { + $displayParts['sort_lnk'] = (string) '0'; + } + } // end if (3) + + return array($displayParts, $the_total); + + } // end of the 'setDisplayPartsAndTotal()' function + + + /** + * Return true if we are executing a query in the form of + * "SELECT * FROM <a table> ..." + * + * @param array $analyzed_sql_results analyzed sql results + * + * @return boolean + * + * @access private + * + * @see _getTableHeaders(), _getColumnParams() + */ + private function _isSelect(array $analyzed_sql_results) + { + return ! ($this->__get('is_count') + || $this->__get('is_export') + || $this->__get('is_func') + || $this->__get('is_analyse')) + && !empty($analyzed_sql_results['select_from']) + && !empty($analyzed_sql_results['statement']->from) + && (count($analyzed_sql_results['statement']->from) == 1) + && !empty($analyzed_sql_results['statement']->from[0]->table); + } + + + /** + * Get a navigation button + * + * @param string $caption iconic caption for button + * @param string $title text for button + * @param integer $pos position for next query + * @param string $html_sql_query query ready for display + * @param boolean $back whether 'begin' or 'previous' + * @param string $onsubmit optional onsubmit clause + * @param string $input_for_real_end optional hidden field for special treatment + * @param string $onclick optional onclick clause + * + * @return string html content + * + * @access private + * + * @see _getMoveBackwardButtonsForTableNavigation(), + * _getMoveForwardButtonsForTableNavigation() + */ + private function _getTableNavigationButton( + $caption, + $title, + $pos, + $html_sql_query, + $back, + $onsubmit = '', + $input_for_real_end = '', + $onclick = '' + ) { + $caption_output = ''; + if ($back) { + if (Util::showIcons('TableNavigationLinksMode')) { + $caption_output .= $caption; + } + if (Util::showText('TableNavigationLinksMode')) { + $caption_output .= ' ' . $title; + } + } else { + if (Util::showText('TableNavigationLinksMode')) { + $caption_output .= $title; + } + if (Util::showIcons('TableNavigationLinksMode')) { + $caption_output .= ' ' . $caption; + } + } + + return Template::get('display/results/table_navigation_button')->render([ + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $html_sql_query, + 'pos' => $pos, + 'is_browse_distinct' => $this->__get('is_browse_distinct'), + 'goto' => $this->__get('goto'), + 'input_for_real_end' => $input_for_real_end, + 'caption_output' => $caption_output, + 'title' => $title, + 'onsubmit' => $onsubmit, + 'onclick' => $onclick, + ]); + } + + /** + * Possibly return a page selector for table navigation + * + * @param string $table_navigation_html the current navigation HTML + * + * @return array ($table_navigation_html, $nbTotalPage) + * + * @access private + * + */ + private function _getHtmlPageSelector($table_navigation_html) + { + $pageNow = @floor( + $_SESSION['tmpval']['pos'] + / $_SESSION['tmpval']['max_rows'] + ) + 1; + + $nbTotalPage = @ceil( + $this->__get('unlim_num_rows') + / $_SESSION['tmpval']['max_rows'] + ); + + if ($nbTotalPage > 1) { + $table_navigation_html .= '<td>'; + $_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $this->__get('sql_query'), + 'goto' => $this->__get('goto'), + 'is_browse_distinct' => $this->__get('is_browse_distinct'), + ); + + //<form> to keep the form alignment of button < and << + // and also to know what to execute when the selector changes + $table_navigation_html .= '<form action="sql.php" method="post">'; + $table_navigation_html .= Url::getHiddenInputs($_url_params); + + $table_navigation_html .= Util::pageselector( + 'pos', + $_SESSION['tmpval']['max_rows'], + $pageNow, $nbTotalPage, 200, 5, 5, 20, 10 + ); + + $table_navigation_html .= '</form>' + . '</td>'; + } + return array($table_navigation_html, $nbTotalPage); + } + + /** + * Get a navigation bar to browse among the results of a SQL query + * + * @param integer $pos_next the offset for the "next" page + * @param integer $pos_prev the offset for the "previous" page + * @param boolean $is_innodb whether its InnoDB or not + * @param string $sort_by_key_html the sort by key dialog + * + * @return string html content + * + * @access private + * + * @see _getTable() + */ + private function _getTableNavigation( + $pos_next, $pos_prev, $is_innodb, $sort_by_key_html + ) { + + $table_navigation_html = ''; + + // here, using htmlentities() would cause problems if the query + // contains accented characters + $html_sql_query = htmlspecialchars($this->__get('sql_query')); + + // Navigation bar + $table_navigation_html + .= '<table class="navigation nospacing nopadding print_ignore">' + . '<tr>' + . '<td class="navigation_separator"></td>'; + + // Move to the beginning or to the previous page + if ($_SESSION['tmpval']['pos'] + && ($_SESSION['tmpval']['max_rows'] != self::ALL_ROWS) + ) { + + $table_navigation_html + .= $this->_getMoveBackwardButtonsForTableNavigation( + $html_sql_query, $pos_prev + ); + + } // end move back + + $nbTotalPage = 1; + //page redirection + // (unless we are showing all records) + if ($_SESSION['tmpval']['max_rows'] != self::ALL_ROWS) { + list( + $table_navigation_html, + $nbTotalPage + ) = $this->_getHtmlPageSelector($table_navigation_html); + } + + $showing_all = false; + if ($_SESSION['tmpval']['max_rows'] == self::ALL_ROWS) { + $showing_all = true; + } + + // Move to the next page or to the last one + if ($this->__get('unlim_num_rows') === false // view with unknown number of rows + || ($_SESSION['tmpval']['max_rows'] != self::ALL_ROWS + && $_SESSION['tmpval']['pos'] + $_SESSION['tmpval']['max_rows'] < $this->__get('unlim_num_rows') + && $this->__get('num_rows') >= $_SESSION['tmpval']['max_rows']) + ) { + + $table_navigation_html + .= $this->_getMoveForwardButtonsForTableNavigation( + $html_sql_query, $pos_next, $is_innodb + ); + + } // end move toward + + // show separator if pagination happen + if ($nbTotalPage > 1) { + $table_navigation_html + .= '<td><div class="navigation_separator">|</div></td>'; + } + + // Display the "Show all" button if allowed + if ($GLOBALS['cfg']['ShowAll'] || ($this->__get('unlim_num_rows') <= 500) ) { + + $table_navigation_html .= $this->_getShowAllCheckboxForTableNavigation( + $showing_all, $html_sql_query + ); + + $table_navigation_html + .= '<td><div class="navigation_separator">|</div></td>'; + + } // end show all + + $table_navigation_html .= '<td>' + . '<div class="save_edited hide">' + . '<input type="submit" value="' . __('Save edited data') . '" />' + . '<div class="navigation_separator">|</div>' + . '</div>' + . '</td>' + . '<td>' + . '<div class="restore_column hide">' + . '<input type="submit" value="' . __('Restore column order') . '" />' + . '<div class="navigation_separator">|</div>' + . '</div>' + . '</td>'; + + // if displaying a VIEW, $unlim_num_rows could be zero because + // of $cfg['MaxExactCountViews']; in this case, avoid passing + // the 5th parameter to checkFormElementInRange() + // (this means we can't validate the upper limit + $table_navigation_html .= '<td class="navigation_goto">'; + + $table_navigation_html .= '<form action="sql.php" method="post" ' + . 'onsubmit="return ' + . '(checkFormElementInRange(' + . 'this, ' + . '\'session_max_rows\', ' + . '\'' + . str_replace('\'', '\\\'', __('%d is not valid row number.')) + . '\', ' + . '1)' + . ' && ' + . 'checkFormElementInRange(' + . 'this, ' + . '\'pos\', ' + . '\'' + . str_replace('\'', '\\\'', __('%d is not valid row number.')) + . '\', ' + . '0' + . (($this->__get('unlim_num_rows') > 0) + ? ', ' . ($this->__get('unlim_num_rows') - 1) + : '' + ) + . ')' + . ')' + . '">'; + + $table_navigation_html .= Url::getHiddenInputs( + $this->__get('db'), $this->__get('table') + ); + + $table_navigation_html .= $this->_getAdditionalFieldsForTableNavigation( + $html_sql_query + ); + + $table_navigation_html .= '</form>' + . '</td>' + . '<td class="navigation_separator"></td>' + . '<td class="largescreenonly">' + . '<span>' . __('Filter rows') . ':</span>' + . '<input type="text" class="filter_rows"' + . ' placeholder="' . __('Search this table') . '"' + . ' data-for="' . $this->__get('unique_id') . '" />' + . '</td>'; + + $table_navigation_html .= '<td class="largescreenonly">' . $sort_by_key_html . '</td>'; + + $table_navigation_html .= '<td class="navigation_separator"></td>' + . '</tr>' + . '</table>'; + + return $table_navigation_html; + + } // end of the '_getTableNavigation()' function + + + /** + * Prepare move backward buttons - previous and first + * + * @param string $html_sql_query the sql encoded by html special characters + * @param integer $pos_prev the offset for the "previous" page + * + * @return string html content + * + * @access private + * + * @see _getTableNavigation() + */ + private function _getMoveBackwardButtonsForTableNavigation( + $html_sql_query, $pos_prev + ) { + return $this->_getTableNavigationButton( + '<<', _pgettext('First page', 'Begin'), 0, $html_sql_query, true + ) + . $this->_getTableNavigationButton( + '<', _pgettext('Previous page', 'Previous'), $pos_prev, + $html_sql_query, true + ); + } // end of the '_getMoveBackwardButtonsForTableNavigation()' function + + + /** + * Prepare Show All checkbox for table navigation + * + * @param bool $showing_all whether all rows are shown currently + * @param string $html_sql_query the sql encoded by html special characters + * + * @return string html content + * + * @access private + * + * @see _getTableNavigation() + */ + private function _getShowAllCheckboxForTableNavigation( + $showing_all, $html_sql_query + ) { + return Template::get('display/results/show_all_checkbox')->render([ + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'is_browse_distinct' => $this->__get('is_browse_distinct'), + 'goto' => $this->__get('goto'), + 'unique_id' => $this->__get('unique_id'), + 'html_sql_query' => $html_sql_query, + 'showing_all' => $showing_all, + 'max_rows' => intval($GLOBALS['cfg']['MaxRows']), + ]); + } // end of the '_getShowAllButtonForTableNavigation()' function + + + /** + * Prepare move forward buttons - next and last + * + * @param string $html_sql_query the sql encoded by htmlspecialchars() + * @param integer $pos_next the offset for the "next" page + * @param boolean $is_innodb whether it's InnoDB or not + * + * @return string $buttons_html html content + * + * @access private + * + * @see _getTableNavigation() + */ + private function _getMoveForwardButtonsForTableNavigation( + $html_sql_query, $pos_next, $is_innodb + ) { + + // display the Next button + $buttons_html = $this->_getTableNavigationButton( + '>', + _pgettext('Next page', 'Next'), + $pos_next, + $html_sql_query, + false + ); + + // prepare some options for the End button + if ($is_innodb + && $this->__get('unlim_num_rows') > $GLOBALS['cfg']['MaxExactCount'] + ) { + $input_for_real_end = '<input id="real_end_input" type="hidden" ' + . 'name="find_real_end" value="1" />'; + // no backquote around this message + $onclick = ''; + } else { + $input_for_real_end = $onclick = ''; + } + + $maxRows = $_SESSION['tmpval']['max_rows']; + $onsubmit = 'onsubmit="return ' + . (($_SESSION['tmpval']['pos'] + + $maxRows + < $this->__get('unlim_num_rows') + && $this->__get('num_rows') >= $maxRows) + ? 'true' + : 'false') . '"'; + + // display the End button + $buttons_html .= $this->_getTableNavigationButton( + '>>', + _pgettext('Last page', 'End'), + @((ceil( + $this->__get('unlim_num_rows') + / $_SESSION['tmpval']['max_rows'] + )- 1) * $maxRows), + $html_sql_query, false, $onsubmit, $input_for_real_end, $onclick + ); + + return $buttons_html; + + } // end of the '_getMoveForwardButtonsForTableNavigation()' function + + + /** + * Prepare fields for table navigation + * Number of rows + * + * @param string $sqlQuery the sql encoded by htmlspecialchars() + * + * @return string html content + * + * @access private + * + * @see _getTableNavigation() + */ + private function _getAdditionalFieldsForTableNavigation($sqlQuery) + { + $numberOfRowsPlaceholder = null; + if ($_SESSION['tmpval']['max_rows'] == self::ALL_ROWS) { + $numberOfRowsPlaceholder = __('All'); + } + + $numberOfRowsChoices = array( + '25' => 25, + '50' => 50, + '100' => 100, + '250' => 250, + '500' => 500 + ); + + return Template::get('display/results/additional_fields')->render([ + 'goto' => $this->__get('goto'), + 'is_browse_distinct' => $this->__get('is_browse_distinct'), + 'sql_query' => $sqlQuery, + 'number_of_rows_choices' => $numberOfRowsChoices, + 'number_of_rows_placeholder' => $numberOfRowsPlaceholder, + 'pos' => $_SESSION['tmpval']['pos'], + 'max_rows' => $_SESSION['tmpval']['max_rows'], + ]); + } + + /** + * Get the headers of the results table, for all of the columns + * + * @param array $displayParts which elements to display + * @param array $analyzed_sql_results analyzed sql results + * @param array $sort_expression sort expression + * @param array $sort_expression_nodirection sort expression + * without direction + * @param array $sort_direction sort direction + * @param boolean $is_limited_display with limited operations + * or not + * @param string $unsorted_sql_query query without the sort part + * + * @return string html content + * + * @access private + * + * @see getTableHeaders() + */ + private function _getTableHeadersForColumns( + array $displayParts, array $analyzed_sql_results, array $sort_expression, + array $sort_expression_nodirection, array $sort_direction, $is_limited_display, + $unsorted_sql_query + ) { + $html = ''; + + // required to generate sort links that will remember whether the + // "Show all" button has been clicked + $sql_md5 = md5($this->__get('sql_query')); + $session_max_rows = $is_limited_display + ? 0 + : $_SESSION['tmpval']['query'][$sql_md5]['max_rows']; + + // Following variable are needed for use in isset/empty or + // use with array indexes/safe use in the for loop + $highlight_columns = $this->__get('highlight_columns'); + $fields_meta = $this->__get('fields_meta'); + + // Prepare Display column comments if enabled + // ($GLOBALS['cfg']['ShowBrowseComments']). + $comments_map = $this->_getTableCommentsArray($analyzed_sql_results); + + list($col_order, $col_visib) = $this->_getColumnParams( + $analyzed_sql_results + ); + + // optimize: avoid calling a method on each iteration + $number_of_columns = $this->__get('fields_cnt'); + + for ($j = 0; $j < $number_of_columns; $j++) { + // PHP 7.4 fix for accessing array offset on bool + $col_visib_current = is_array($col_visib) && isset($col_visib[$j]) ? $col_visib[$j] : null; + + // assign $i with the appropriate column order + $i = $col_order ? $col_order[$j] : $j; + + // See if this column should get highlight because it's used in the + // where-query. + $name = $fields_meta[$i]->name; + $condition_field = (isset($highlight_columns[$name]) + || isset($highlight_columns[Util::backquote($name)])) + ? true + : false; + + // Prepare comment-HTML-wrappers for each row, if defined/enabled. + $comments = $this->_getCommentForRow($comments_map, $fields_meta[$i]); + $display_params = $this->__get('display_params'); + + if (($displayParts['sort_lnk'] == '1') && ! $is_limited_display) { + + list($order_link, $sorted_header_html) + = $this->_getOrderLinkAndSortedHeaderHtml( + $fields_meta[$i], $sort_expression, + $sort_expression_nodirection, $i, $unsorted_sql_query, + $session_max_rows, $comments, + $sort_direction, $col_visib, + $col_visib_current + ); + + $html .= $sorted_header_html; + + $display_params['desc'][] = ' <th ' + . 'class="draggable' + . ($condition_field ? ' condition' : '') + . '" data-column="' . htmlspecialchars($fields_meta[$i]->name) + . '">' . "\n" . $order_link . $comments . ' </th>' . "\n"; + } else { + // Results can't be sorted + $html + .= $this->_getDraggableClassForNonSortableColumns( + $col_visib, $col_visib_current, $condition_field, + $fields_meta[$i], $comments + ); + + $display_params['desc'][] = ' <th ' + . 'class="draggable' + . ($condition_field ? ' condition"' : '') + . '" data-column="' . htmlspecialchars($fields_meta[$i]->name) + . '">' . ' ' + . htmlspecialchars($fields_meta[$i]->name) + . $comments . ' </th>'; + } // end else + + $this->__set('display_params', $display_params); + + } // end for + return $html; + } + + /** + * Get the headers of the results table + * + * @param array &$displayParts which elements to display + * @param array $analyzed_sql_results analyzed sql results + * @param string $unsorted_sql_query the unsorted sql query + * @param array $sort_expression sort expression + * @param array|string $sort_expression_nodirection sort expression + * without direction + * @param array $sort_direction sort direction + * @param boolean $is_limited_display with limited operations + * or not + * + * @return string html content + * + * @access private + * + * @see getTable() + */ + private function _getTableHeaders( + array &$displayParts, array $analyzed_sql_results, $unsorted_sql_query, + array $sort_expression = array(), $sort_expression_nodirection = '', + array $sort_direction = array(), $is_limited_display = false + ) { + + $table_headers_html = ''; + // Needed for use in isset/empty or + // use with array indexes/safe use in foreach + $printview = $this->__get('printview'); + $display_params = $this->__get('display_params'); + + // Output data needed for grid editing + $table_headers_html .= '<input class="save_cells_at_once" type="hidden"' + . ' value="' . $GLOBALS['cfg']['SaveCellsAtOnce'] . '" />' + . '<div class="common_hidden_inputs">' + . Url::getHiddenInputs( + $this->__get('db'), $this->__get('table') + ) + . '</div>'; + + // Output data needed for column reordering and show/hide column + $table_headers_html .= $this->_getDataForResettingColumnOrder($analyzed_sql_results); + + $display_params['emptypre'] = 0; + $display_params['emptyafter'] = 0; + $display_params['textbtn'] = ''; + $full_or_partial_text_link = null; + + $this->__set('display_params', $display_params); + + // Display options (if we are not in print view) + if (! (isset($printview) && ($printview == '1')) && ! $is_limited_display) { + + $table_headers_html .= $this->_getOptionsBlock(); + + // prepare full/partial text button or link + $full_or_partial_text_link = $this->_getFullOrPartialTextButtonOrLink(); + } + + // Start of form for multi-rows edit/delete/export + $table_headers_html .= $this->_getFormForMultiRowOperations( + $displayParts['del_lnk'] + ); + + // 1. Set $colspan and generate html with full/partial + // text button or link + list($colspan, $button_html) + = $this->_getFieldVisibilityParams( + $displayParts, $full_or_partial_text_link + ); + + $table_headers_html .= $button_html; + + // 2. Displays the fields' name + // 2.0 If sorting links should be used, checks if the query is a "JOIN" + // statement (see 2.1.3) + + // See if we have to highlight any header fields of a WHERE query. + // Uses SQL-Parser results. + $this->_setHighlightedColumnGlobalField($analyzed_sql_results); + + // Get the headers for all of the columns + $table_headers_html .= $this->_getTableHeadersForColumns( + $displayParts, $analyzed_sql_results, $sort_expression, + $sort_expression_nodirection, $sort_direction, + $is_limited_display, $unsorted_sql_query + ); + + // Display column at rightside - checkboxes or empty column + if (! $printview) { + $table_headers_html .= $this->_getColumnAtRightSide( + $displayParts, $full_or_partial_text_link, $colspan + ); + } + $table_headers_html .= '</tr>' . '</thead>'; + + return $table_headers_html; + + } // end of the '_getTableHeaders()' function + + + /** + * Prepare unsorted sql query and sort by key drop down + * + * @param array $analyzed_sql_results analyzed sql results + * @param array|null $sort_expression sort expression + * + * @return array two element array - $unsorted_sql_query, $drop_down_html + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getUnsortedSqlAndSortByKeyDropDown( + array $analyzed_sql_results, array $sort_expression + ) { + $drop_down_html = ''; + + $unsorted_sql_query = Query::replaceClause( + $analyzed_sql_results['statement'], + $analyzed_sql_results['parser']->list, + 'ORDER BY', + '' + ); + + // Data is sorted by indexes only if it there is only one table. + if ($this->_isSelect($analyzed_sql_results)) { + // grab indexes data: + $indexes = Index::getFromTable( + $this->__get('table'), + $this->__get('db') + ); + + // do we have any index? + if (! empty($indexes)) { + $drop_down_html = $this->_getSortByKeyDropDown( + $indexes, $sort_expression, + $unsorted_sql_query + ); + } + } + + return array($unsorted_sql_query, $drop_down_html); + + } // end of the '_getUnsortedSqlAndSortByKeyDropDown()' function + + /** + * Prepare sort by key dropdown - html code segment + * + * @param Index[] $indexes the indexes of the table for sort criteria + * @param array|null $sort_expression the sort expression + * @param string $unsorted_sql_query the unsorted sql query + * + * @return string $drop_down_html html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getSortByKeyDropDown( + $indexes, array $sort_expression, $unsorted_sql_query + ) { + + $drop_down_html = ''; + + $drop_down_html .= '<form action="sql.php" method="post" ' . + 'class="print_ignore">' . "\n" + . Url::getHiddenInputs( + $this->__get('db'), $this->__get('table') + ) + . Url::getHiddenFields(array('sort_by_key' => '1')) + . __('Sort by key') + . ': <select name="sql_query" class="autosubmit">' . "\n"; + + $used_index = false; + $local_order = (is_array($sort_expression) ? implode(', ',$sort_expression) : ''); + + foreach ($indexes as $index) { + + $asc_sort = '`' + . implode('` ASC, `', array_keys($index->getColumns())) + . '` ASC'; + + $desc_sort = '`' + . implode('` DESC, `', array_keys($index->getColumns())) + . '` DESC'; + + $used_index = $used_index + || ($local_order == $asc_sort) + || ($local_order == $desc_sort); + + if (preg_match( + '@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|' + . 'FOR UPDATE|LOCK IN SHARE MODE))@is', + $unsorted_sql_query, $my_reg + )) { + $unsorted_sql_query_first_part = $my_reg[1]; + $unsorted_sql_query_second_part = $my_reg[2]; + } else { + $unsorted_sql_query_first_part = $unsorted_sql_query; + $unsorted_sql_query_second_part = ''; + } + + $drop_down_html .= '<option value="' + . htmlspecialchars( + $unsorted_sql_query_first_part . "\n" + . ' ORDER BY ' . $asc_sort + . $unsorted_sql_query_second_part + ) + . '"' . ($local_order == $asc_sort + ? ' selected="selected"' + : '') + . '>' . htmlspecialchars($index->getName()) . ' (ASC)</option>'; + + $drop_down_html .= '<option value="' + . htmlspecialchars( + $unsorted_sql_query_first_part . "\n" + . ' ORDER BY ' . $desc_sort + . $unsorted_sql_query_second_part + ) + . '"' . ($local_order == $desc_sort + ? ' selected="selected"' + : '') + . '>' . htmlspecialchars($index->getName()) . ' (DESC)</option>'; + } + + $drop_down_html .= '<option value="' . htmlspecialchars($unsorted_sql_query) + . '"' . ($used_index ? '' : ' selected="selected"') . '>' . __('None') + . '</option>' + . '</select>' . "\n" + . '</form>' . "\n"; + + return $drop_down_html; + + } // end of the '_getSortByKeyDropDown()' function + + + /** + * Set column span, row span and prepare html with full/partial + * text button or link + * + * @param array &$displayParts which elements to display + * @param string $full_or_partial_text_link full/partial link or text button + * + * @return array 2 element array - $colspan, $button_html + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getFieldVisibilityParams( + array &$displayParts, $full_or_partial_text_link + ) { + + $button_html = ''; + $display_params = $this->__get('display_params'); + + // 1. Displays the full/partial text button (part 1)... + $button_html .= '<thead><tr>' . "\n"; + + $colspan = (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)) + ? ' colspan="4"' + : ''; + + // ... before the result table + if ((($displayParts['edit_lnk'] == self::NO_EDIT_OR_DELETE) + && ($displayParts['del_lnk'] == self::NO_EDIT_OR_DELETE)) + && ($displayParts['text_btn'] == '1') + ) { + + $display_params['emptypre'] + = (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; + + } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) + && ($displayParts['text_btn'] == '1') + ) { + // ... at the left column of the result table header if possible + // and required + + $display_params['emptypre'] + = (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; + + $button_html .= '<th class="column_action print_ignore" ' . $colspan + . '>' . $full_or_partial_text_link . '</th>'; + + } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) + && (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + || ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)) + ) { + // ... elseif no button, displays empty(ies) col(s) if required + + $display_params['emptypre'] + = (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 0; + + $button_html .= '<td ' . $colspan . '></td>'; + + } elseif (($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE)) { + // ... elseif display an empty column if the actions links are + // disabled to match the rest of the table + $button_html .= '<th class="column_action"></th>'; + } + + $this->__set('display_params', $display_params); + + return array($colspan, $button_html); + + } // end of the '_getFieldVisibilityParams()' function + + + /** + * Get table comments as array + * + * @param array $analyzed_sql_results analyzed sql results + * + * @return array $comments_map table comments + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getTableCommentsArray(array $analyzed_sql_results) + { + if ((!$GLOBALS['cfg']['ShowBrowseComments']) + || (empty($analyzed_sql_results['statement']->from)) + ) { + return array(); + } + + $ret = array(); + foreach ($analyzed_sql_results['statement']->from as $field) { + if (empty($field->table)) { + continue; + } + $ret[$field->table] = $this->relation->getComments( + empty($field->database) ? $this->__get('db') : $field->database, + $field->table + ); + } + + return $ret; + + } // end of the '_getTableCommentsArray()' function + + + /** + * Set global array for store highlighted header fields + * + * @param array $analyzed_sql_results analyzed sql results + * + * @return void + * + * @access private + * + * @see _getTableHeaders() + */ + private function _setHighlightedColumnGlobalField(array $analyzed_sql_results) + { + $highlight_columns = array(); + + if (!empty($analyzed_sql_results['statement']->where)) { + foreach ($analyzed_sql_results['statement']->where as $expr) { + foreach ($expr->identifiers as $identifier) { + $highlight_columns[$identifier] = 'true'; + } + } + } + + $this->__set('highlight_columns', $highlight_columns); + + } // end of the '_setHighlightedColumnGlobalField()' function + + + /** + * Prepare data for column restoring and show/hide + * + * @param array $analyzed_sql_results analyzed sql results + * + * @return string $data_html html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getDataForResettingColumnOrder(array $analyzed_sql_results) + { + if (! $this->_isSelect($analyzed_sql_results)) { + return ''; + } + + // generate the column order, if it is set + list($col_order, $col_visib) = $this->_getColumnParams( + $analyzed_sql_results + ); + + $data_html = ''; + + if ($col_order) { + $data_html .= '<input class="col_order" type="hidden" value="' + . implode(',', $col_order) . '" />'; + } + + if ($col_visib) { + $data_html .= '<input class="col_visib" type="hidden" value="' + . implode(',', $col_visib) . '" />'; + } + + // generate table create time + $table = new Table($this->__get('table'), $this->__get('db')); + if (! $table->isView()) { + $data_html .= '<input class="table_create_time" type="hidden" value="' + . $GLOBALS['dbi']->getTable( + $this->__get('db'), $this->__get('table') + )->getStatusInfo('Create_time') + . '" />'; + } + + return $data_html; + + } // end of the '_getDataForResettingColumnOrder()' function + + + /** + * Prepare option fields block + * + * @return string html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getOptionsBlock() + { + if(isset($_SESSION['tmpval']['possible_as_geometry']) && $_SESSION['tmpval']['possible_as_geometry'] == false) { + if($_SESSION['tmpval']['geoOption'] == self::GEOMETRY_DISP_GEOM) { + $_SESSION['tmpval']['geoOption'] = self::GEOMETRY_DISP_WKT; + } + } + return Template::get('display/results/options_block')->render([ + 'unique_id' => $this->__get('unique_id'), + 'geo_option' => $_SESSION['tmpval']['geoOption'], + 'hide_transformation' => $_SESSION['tmpval']['hide_transformation'], + 'display_blob' => $_SESSION['tmpval']['display_blob'], + 'display_binary' => $_SESSION['tmpval']['display_binary'], + 'relational_display' => $_SESSION['tmpval']['relational_display'], + 'displaywork' => $GLOBALS['cfgRelation']['displaywork'], + 'relwork' => $GLOBALS['cfgRelation']['relwork'], + 'possible_as_geometry' => $_SESSION['tmpval']['possible_as_geometry'], + 'pftext' => $_SESSION['tmpval']['pftext'], + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $this->__get('sql_query'), + 'goto' => $this->__get('goto'), + ]); + } + + /** + * Get full/partial text button or link + * + * @return string html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getFullOrPartialTextButtonOrLink() + { + + $url_params_full_text = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $this->__get('sql_query'), + 'goto' => $this->__get('goto'), + 'full_text_button' => 1 + ); + + if ($_SESSION['tmpval']['pftext'] == self::DISPLAY_FULL_TEXT) { + // currently in fulltext mode so show the opposite link + $tmp_image_file = $this->__get('pma_theme_image') . 's_partialtext.png'; + $tmp_txt = __('Partial texts'); + $url_params_full_text['pftext'] = self::DISPLAY_PARTIAL_TEXT; + } else { + $tmp_image_file = $this->__get('pma_theme_image') . 's_fulltext.png'; + $tmp_txt = __('Full texts'); + $url_params_full_text['pftext'] = self::DISPLAY_FULL_TEXT; + } + + $tmp_image = '<img class="fulltext" src="' . $tmp_image_file . '" alt="' + . $tmp_txt . '" title="' . $tmp_txt . '" />'; + + return Util::linkOrButton('sql.php', $url_params_full_text, $tmp_image); + + } // end of the '_getFullOrPartialTextButtonOrLink()' function + + + /** + * Prepare html form for multi row operations + * + * @param string $deleteLink the delete link of current row + * + * @return string $form_html html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getFormForMultiRowOperations($deleteLink) + { + return Template::get('display/results/multi_row_operations_form')->render([ + 'delete_link' => $deleteLink, + 'delete_row' => self::DELETE_ROW, + 'kill_process' => self::KILL_PROCESS, + 'unique_id' => $this->__get('unique_id'), + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + ]); + } + + /** + * Get comment for row + * + * @param array $commentsMap comments array + * @param array $fieldsMeta set of field properties + * + * @return string html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getCommentForRow(array $commentsMap, $fieldsMeta) + { + return Template::get('display/results/comment_for_row')->render([ + 'comments_map' => $commentsMap, + 'fields_meta' => $fieldsMeta, + 'limit_chars' => $GLOBALS['cfg']['LimitChars'], + ]); + } + + /** + * Prepare parameters and html for sorted table header fields + * + * @param array $fields_meta set of field properties + * @param array $sort_expression sort expression + * @param array $sort_expression_nodirection sort expression without direction + * @param integer $column_index the index of the column + * @param string $unsorted_sql_query the unsorted sql query + * @param integer $session_max_rows maximum rows resulted by sql + * @param string $comments comment for row + * @param array $sort_direction sort direction + * @param boolean $col_visib column is visible(false) + * array column isn't visible(string array) + * @param string $col_visib_j element of $col_visib array + * + * @return array 2 element array - $order_link, $sorted_header_html + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getOrderLinkAndSortedHeaderHtml( + $fields_meta, array $sort_expression, array $sort_expression_nodirection, + $column_index, $unsorted_sql_query, $session_max_rows, + $comments, array $sort_direction, $col_visib, $col_visib_j + ) { + + $sorted_header_html = ''; + + // Checks if the table name is required; it's the case + // for a query with a "JOIN" statement and if the column + // isn't aliased, or in queries like + // SELECT `1`.`master_field` , `2`.`master_field` + // FROM `PMA_relation` AS `1` , `PMA_relation` AS `2` + + $sort_tbl = (isset($fields_meta->table) + && strlen($fields_meta->table) > 0 + && $fields_meta->orgname == $fields_meta->name) + ? Util::backquote( + $fields_meta->table + ) . '.' + : ''; + + $name_to_use_in_sort = $fields_meta->name; + + // Generates the orderby clause part of the query which is part + // of URL + list($single_sort_order, $multi_sort_order, $order_img) + = $this->_getSingleAndMultiSortUrls( + $sort_expression, $sort_expression_nodirection, $sort_tbl, + $name_to_use_in_sort, $sort_direction, $fields_meta, $column_index + ); + + if (preg_match( + '@(.*)([[:space:]](LIMIT (.*)|PROCEDURE (.*)|FOR UPDATE|' + . 'LOCK IN SHARE MODE))@is', + $unsorted_sql_query, $regs3 + )) { + $single_sorted_sql_query = $regs3[1] . $single_sort_order . $regs3[2]; + $multi_sorted_sql_query = $regs3[1] . $multi_sort_order . $regs3[2]; + } else { + $single_sorted_sql_query = $unsorted_sql_query . $single_sort_order; + $multi_sorted_sql_query = $unsorted_sql_query . $multi_sort_order; + } + + $_single_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $single_sorted_sql_query, + 'sql_signature' => Core::signSqlQuery($single_sorted_sql_query), + 'session_max_rows' => $session_max_rows, + 'is_browse_distinct' => $this->__get('is_browse_distinct'), + ); + + $_multi_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $multi_sorted_sql_query, + 'sql_signature' => Core::signSqlQuery($multi_sorted_sql_query), + 'session_max_rows' => $session_max_rows, + 'is_browse_distinct' => $this->__get('is_browse_distinct'), + ); + + // Displays the sorting URL + // enable sort order swapping for image + $order_link = $this->_getSortOrderLink( + $order_img, $fields_meta, $_single_url_params, $_multi_url_params + ); + + $sorted_header_html .= $this->_getDraggableClassForSortableColumns( + $col_visib, $col_visib_j, + $fields_meta, $order_link, $comments + ); + + return array($order_link, $sorted_header_html); + + } // end of the '_getOrderLinkAndSortedHeaderHtml()' function + + /** + * Prepare parameters and html for sorted table header fields + * + * @param array $sort_expression sort expression + * @param array $sort_expression_nodirection sort expression without direction + * @param string $sort_tbl The name of the table to which + * the current column belongs to + * @param string $name_to_use_in_sort The current column under + * consideration + * @param array $sort_direction sort direction + * @param array $fields_meta set of field properties + * @param integer $column_index The index number to current column + * + * @return array 3 element array - $single_sort_order, $sort_order, $order_img + * + * @access private + * + * @see _getOrderLinkAndSortedHeaderHtml() + */ + private function _getSingleAndMultiSortUrls( + array $sort_expression, array $sort_expression_nodirection, $sort_tbl, + $name_to_use_in_sort, array $sort_direction, $fields_meta, $column_index + ) { + $sort_order = ""; + // Check if the current column is in the order by clause + $is_in_sort = $this->_isInSorted( + $sort_expression, $sort_expression_nodirection, + $sort_tbl, $name_to_use_in_sort + ); + $current_name = $name_to_use_in_sort; + if ($sort_expression_nodirection[0] == '' || !$is_in_sort) { + $special_index = $sort_expression_nodirection[0] == '' + ? 0 + : count($sort_expression_nodirection); + $sort_expression_nodirection[$special_index] + = Util::backquote( + $current_name + ); + $sort_direction[$special_index] = (preg_match( + '@time|date@i', + $fields_meta->type + )) ? self::DESCENDING_SORT_DIR : self::ASCENDING_SORT_DIR; + + } + + $sort_expression_nodirection = array_filter($sort_expression_nodirection); + $single_sort_order = null; + foreach ($sort_expression_nodirection as $index=>$expression) { + // check if this is the first clause, + // if it is then we have to add "order by" + $is_first_clause = ($index == 0); + $name_to_use_in_sort = $expression; + $sort_tbl_new = $sort_tbl; + // Test to detect if the column name is a standard name + // Standard name has the table name prefixed to the column name + if (mb_strpos($name_to_use_in_sort, '.') !== false) { + $matches = explode('.', $name_to_use_in_sort); + // Matches[0] has the table name + // Matches[1] has the column name + $name_to_use_in_sort = $matches[1]; + $sort_tbl_new = $matches[0]; + } + + // $name_to_use_in_sort might contain a space due to + // formatting of function expressions like "COUNT(name )" + // so we remove the space in this situation + $name_to_use_in_sort = str_replace(' )', ')', $name_to_use_in_sort); + $name_to_use_in_sort = str_replace('``', '`', $name_to_use_in_sort); + $name_to_use_in_sort = trim($name_to_use_in_sort, '`'); + + // If this the first column name in the order by clause add + // order by clause to the column name + $query_head = $is_first_clause ? "\nORDER BY " : ""; + // Again a check to see if the given column is a aggregate column + if (mb_strpos($name_to_use_in_sort, '(') !== false) { + $sort_order .= $query_head . $name_to_use_in_sort . ' ' ; + } else { + if (strlen($sort_tbl_new) > 0) { + $sort_tbl_new .= "."; + } + $sort_order .= $query_head . $sort_tbl_new + . Util::backquote( + $name_to_use_in_sort + ) . ' ' ; + } + + // For a special case where the code generates two dots between + // column name and table name. + $sort_order = preg_replace("/\.\./", ".", $sort_order); + // Incase this is the current column save $single_sort_order + if ($current_name == $name_to_use_in_sort) { + if (mb_strpos($current_name, '(') !== false) { + $single_sort_order = "\n" . 'ORDER BY ' . Util::backquote($current_name) . ' '; + } else { + $single_sort_order = "\n" . 'ORDER BY ' . $sort_tbl + . Util::backquote( + $current_name + ) . ' '; + } + if ($is_in_sort) { + list($single_sort_order, $order_img) + = $this->_getSortingUrlParams( + $sort_direction, $single_sort_order, $index + ); + } else { + $single_sort_order .= strtoupper($sort_direction[$index]); + } + } + if ($current_name == $name_to_use_in_sort && $is_in_sort) { + // We need to generate the arrow button and related html + list($sort_order, $order_img) = $this->_getSortingUrlParams( + $sort_direction, $sort_order, $index + ); + $order_img .= " <small>" . ($index + 1) . "</small>"; + } else { + $sort_order .= strtoupper($sort_direction[$index]); + } + // Separate columns by a comma + $sort_order .= ", "; + + unset($name_to_use_in_sort); + } + // remove the comma from the last column name in the newly + // constructed clause + $sort_order = mb_substr( + $sort_order, + 0, + mb_strlen($sort_order) - 2 + ); + if (empty($order_img)) { + $order_img = ''; + } + return array($single_sort_order, $sort_order, $order_img); + } + + /** + * Check whether the column is sorted + * + * @param array $sort_expression sort expression + * @param array $sort_expression_nodirection sort expression without direction + * @param string $sort_tbl the table name + * @param string $name_to_use_in_sort the sorting column name + * + * @return boolean $is_in_sort the column sorted or not + * + * @access private + * + * @see _getTableHeaders() + */ + private function _isInSorted( + array $sort_expression, array $sort_expression_nodirection, $sort_tbl, + $name_to_use_in_sort + ) { + + $index_in_expression = 0; + + foreach ($sort_expression_nodirection as $index => $clause) { + if (mb_strpos($clause, '.') !== false) { + $fragments = explode('.', $clause); + $clause2 = $fragments[0] . "." . str_replace('`', '', $fragments[1]); + } else { + $clause2 = $sort_tbl . str_replace('`', '', $clause); + } + if ($clause2 === $sort_tbl . $name_to_use_in_sort) { + $index_in_expression = $index; + break; + } + } + if (empty($sort_expression[$index_in_expression])) { + $is_in_sort = false; + } else { + // Field name may be preceded by a space, or any number + // of characters followed by a dot (tablename.fieldname) + // so do a direct comparison for the sort expression; + // this avoids problems with queries like + // "SELECT id, count(id)..." and clicking to sort + // on id or on count(id). + // Another query to test this: + // SELECT p.*, FROM_UNIXTIME(p.temps) FROM mytable AS p + // (and try clicking on each column's header twice) + $noSortTable = empty($sort_tbl) || mb_strpos( + $sort_expression_nodirection[$index_in_expression], $sort_tbl + ) === false; + $noOpenParenthesis = mb_strpos( + $sort_expression_nodirection[$index_in_expression], '(' + ) === false; + if (! empty($sort_tbl) && $noSortTable && $noOpenParenthesis) { + $new_sort_expression_nodirection = $sort_tbl + . $sort_expression_nodirection[$index_in_expression]; + } else { + $new_sort_expression_nodirection + = $sort_expression_nodirection[$index_in_expression]; + } + + //Back quotes are removed in next comparison, so remove them from value + //to compare. + $name_to_use_in_sort = str_replace('`', '', $name_to_use_in_sort); + + $is_in_sort = false; + $sort_name = str_replace('`', '', $sort_tbl) . $name_to_use_in_sort; + + if ($sort_name == str_replace('`', '', $new_sort_expression_nodirection) + || $sort_name == str_replace('`', '', $sort_expression_nodirection[$index_in_expression]) + ) { + $is_in_sort = true; + } + } + + return $is_in_sort; + + } // end of the '_isInSorted()' function + + + /** + * Get sort url parameters - sort order and order image + * + * @param array $sort_direction the sort direction + * @param string $sort_order the sorting order + * @param integer $index the index of sort direction array. + * + * @return array 2 element array - $sort_order, $order_img + * + * @access private + * + * @see _getSingleAndMultiSortUrls() + */ + private function _getSortingUrlParams(array $sort_direction, $sort_order, $index) + { + if (strtoupper(trim($sort_direction[$index])) == self::DESCENDING_SORT_DIR) { + $sort_order .= ' ASC'; + $order_img = ' ' . Util::getImage( + 's_desc', __('Descending'), + array('class' => "soimg", 'title' => '') + ); + $order_img .= ' ' . Util::getImage( + 's_asc', __('Ascending'), + array('class' => "soimg hide", 'title' => '') + ); + } else { + $sort_order .= ' DESC'; + $order_img = ' ' . Util::getImage( + 's_asc', __('Ascending'), + array('class' => "soimg", 'title' => '') + ); + $order_img .= ' ' . Util::getImage( + 's_desc', __('Descending'), + array('class' => "soimg hide", 'title' => '') + ); + } + return array($sort_order, $order_img); + } // end of the '_getSortingUrlParams()' function + + + /** + * Get sort order link + * + * @param string $order_img the sort order image + * @param array $fields_meta set of field properties + * @param array $order_url_params the url params for sort + * @param array $multi_order_url_params the url params for sort + * + * @return string the sort order link + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getSortOrderLink( + $order_img, $fields_meta, $order_url_params, $multi_order_url_params + ) { + $order_link_params = array( + 'class' => 'sortlink' + ); + + $order_link_content = htmlspecialchars($fields_meta->name); + $inner_link_content = $order_link_content . $order_img + . '<input type="hidden" value="sql.php' + . Url::getCommon($multi_order_url_params, '?', false) + . '" />'; + + return Util::linkOrButton( + 'sql.php', $order_url_params, $inner_link_content, $order_link_params + ); + + } // end of the '_getSortOrderLink()' function + + /** + * Check if the column contains numeric data. If yes, then set the + * column header's alignment right + * + * @param array $fields_meta set of field properties + * @param array &$th_class array containing classes + * + * @return void + * + * @see _getDraggableClassForSortableColumns() + */ + private function _getClassForNumericColumnType($fields_meta, array &$th_class) + { + if (preg_match( + '@int|decimal|float|double|real|bit|boolean|serial@i', + $fields_meta->type + )) { + $th_class[] = 'right'; + } + } + + /** + * Prepare columns to draggable effect for sortable columns + * + * @param boolean $col_visib the column is visible (false) + * array the column is not visible (string array) + * @param string $col_visib_j element of $col_visib array + * @param array $fields_meta set of field properties + * @param string $order_link the order link + * @param string $comments the comment for the column + * + * @return string $draggable_html html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getDraggableClassForSortableColumns( + $col_visib, $col_visib_j, $fields_meta, + $order_link, $comments + ) { + + $draggable_html = '<th'; + $th_class = array(); + $th_class[] = 'draggable'; + $this->_getClassForNumericColumnType($fields_meta, $th_class); + if ($col_visib && !$col_visib_j) { + $th_class[] = 'hide'; + } + + $th_class[] = 'column_heading'; + if ($GLOBALS['cfg']['BrowsePointerEnable'] == true) { + $th_class[] = 'pointer'; + } + + if ($GLOBALS['cfg']['BrowseMarkerEnable'] == true) { + $th_class[] = 'marker'; + } + + $draggable_html .= ' class="' . implode(' ', $th_class) . '"'; + + $draggable_html .= ' data-column="' . htmlspecialchars($fields_meta->name) + . '">' . $order_link . $comments . '</th>'; + + return $draggable_html; + + } // end of the '_getDraggableClassForSortableColumns()' function + + + /** + * Prepare columns to draggable effect for non sortable columns + * + * @param boolean $col_visib the column is visible (false) + * array the column is not visible (string array) + * @param string $col_visib_j element of $col_visib array + * @param boolean $condition_field whether to add CSS class condition + * @param array $fields_meta set of field properties + * @param string $comments the comment for the column + * + * @return string $draggable_html html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getDraggableClassForNonSortableColumns( + $col_visib, $col_visib_j, $condition_field, + $fields_meta, $comments + ) { + + $draggable_html = '<th'; + $th_class = array(); + $th_class[] = 'draggable'; + $this->_getClassForNumericColumnType($fields_meta, $th_class); + if ($col_visib && !$col_visib_j) { + $th_class[] = 'hide'; + } + + if ($condition_field) { + $th_class[] = 'condition'; + } + + $draggable_html .= ' class="' . implode(' ', $th_class) . '"'; + + $draggable_html .= ' data-column="' + . htmlspecialchars($fields_meta->name) . '">'; + + $draggable_html .= htmlspecialchars($fields_meta->name); + + $draggable_html .= "\n" . $comments . '</th>'; + + return $draggable_html; + + } // end of the '_getDraggableClassForNonSortableColumns()' function + + + /** + * Prepare column to show at right side - check boxes or empty column + * + * @param array &$displayParts which elements to display + * @param string $full_or_partial_text_link full/partial link or text button + * @param string $colspan column span of table header + * + * @return string html content + * + * @access private + * + * @see _getTableHeaders() + */ + private function _getColumnAtRightSide( + array &$displayParts, $full_or_partial_text_link, $colspan + ) { + + $right_column_html = ''; + $display_params = $this->__get('display_params'); + + // Displays the needed checkboxes at the right + // column of the result table header if possible and required... + if ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) + && (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + || ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)) + && ($displayParts['text_btn'] == '1') + ) { + + $display_params['emptyafter'] + = (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; + + $right_column_html .= "\n" + . '<th class="column_action print_ignore" ' . $colspan . '>' + . $full_or_partial_text_link + . '</th>'; + + } elseif ((($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH)) + && (($displayParts['edit_lnk'] == self::NO_EDIT_OR_DELETE) + && ($displayParts['del_lnk'] == self::NO_EDIT_OR_DELETE)) + && (! isset($GLOBALS['is_header_sent']) || ! $GLOBALS['is_header_sent']) + ) { + // ... elseif no button, displays empty columns if required + // (unless coming from Browse mode print view) + + $display_params['emptyafter'] + = (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + && ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE)) ? 4 : 1; + + $right_column_html .= "\n" . '<td class="print_ignore" ' . $colspan + . '></td>'; + } + + $this->__set('display_params', $display_params); + + return $right_column_html; + + } // end of the '_getColumnAtRightSide()' function + + + /** + * Prepares the display for a value + * + * @param string $class class of table cell + * @param bool $conditionField whether to add CSS class condition + * @param string $value value to display + * + * @return string the td + * + * @access private + * + * @see _getDataCellForGeometryColumns(), + * _getDataCellForNonNumericColumns() + */ + private function _buildValueDisplay($class, $conditionField, $value) + { + return Template::get('display/results/value_display')->render([ + 'class' => $class, + 'condition_field' => $conditionField, + 'value' => $value, + ]); + } + + /** + * Prepares the display for a null value + * + * @param string $class class of table cell + * @param bool $conditionField whether to add CSS class condition + * @param object $meta the meta-information about this field + * @param string $align cell alignment + * + * @return string the td + * + * @access private + * + * @see _getDataCellForNumericColumns(), + * _getDataCellForGeometryColumns(), + * _getDataCellForNonNumericColumns() + */ + private function _buildNullDisplay($class, $conditionField, $meta, $align = '') + { + $classes = $this->_addClass($class, $conditionField, $meta, ''); + + return Template::get('display/results/null_display')->render([ + 'align' => $align, + 'meta' => $meta, + 'classes' => $classes, + ]); + } + + /** + * Prepares the display for an empty value + * + * @param string $class class of table cell + * @param bool $conditionField whether to add CSS class condition + * @param object $meta the meta-information about this field + * @param string $align cell alignment + * + * @return string the td + * + * @access private + * + * @see _getDataCellForNumericColumns(), + * _getDataCellForGeometryColumns(), + * _getDataCellForNonNumericColumns() + */ + private function _buildEmptyDisplay($class, $conditionField, $meta, $align = '') + { + $classes = $this->_addClass($class, $conditionField, $meta, 'nowrap'); + + return Template::get('display/results/empty_display')->render([ + 'align' => $align, + 'classes' => $classes, + ]); + } + + /** + * Adds the relevant classes. + * + * @param string $class class of table cell + * @param bool $condition_field whether to add CSS class + * condition + * @param object $meta the meta-information about the + * field + * @param string $nowrap avoid wrapping + * @param bool $is_field_truncated is field truncated (display ...) + * @param object|string $transformation_plugin transformation plugin. + * Can also be the default function: + * Core::mimeDefaultFunction + * @param string $default_function default transformation function + * + * @return string the list of classes + * + * @access private + * + * @see _buildNullDisplay(), _getRowData() + */ + private function _addClass( + $class, $condition_field, $meta, $nowrap, $is_field_truncated = false, + $transformation_plugin = '', $default_function = '' + ) { + $classes = array( + $class, + $nowrap, + ); + + if (isset($meta->mimetype)) { + $classes[] = preg_replace('/\//', '_', $meta->mimetype); + } + + if ($condition_field) { + $classes[] = 'condition'; + } + + if ($is_field_truncated) { + $classes[] = 'truncated'; + } + + $mime_map = $this->__get('mime_map'); + $orgFullColName = $this->__get('db') . '.' . $meta->orgtable + . '.' . $meta->orgname; + if ($transformation_plugin != $default_function + || !empty($mime_map[$orgFullColName]['input_transformation']) + ) { + $classes[] = 'transformed'; + } + + // Define classes to be added to this data field based on the type of data + $matches = array( + 'enum' => 'enum', + 'set' => 'set', + 'binary' => 'hex', + ); + + foreach ($matches as $key => $value) { + if (mb_strpos($meta->flags, $key) !== false) { + $classes[] = $value; + } + } + + if (mb_strpos($meta->type, 'bit') !== false) { + $classes[] = 'bit'; + } + + return implode(' ', $classes); + } // end of the '_addClass()' function + + /** + * Prepare the body of the results table + * + * @param integer &$dt_result the link id associated to the query + * which results have to be displayed which + * results have to be displayed + * @param array &$displayParts which elements to display + * @param array $map the list of relations + * @param array $analyzed_sql_results analyzed sql results + * @param boolean $is_limited_display with limited operations or not + * + * @return string $table_body_html html content + * + * @global array $row current row data + * + * @access private + * + * @see getTable() + */ + private function _getTableBody( + &$dt_result, array &$displayParts, array $map, array $analyzed_sql_results, + $is_limited_display = false + ) { + + global $row; // mostly because of browser transformations, + // to make the row-data accessible in a plugin + + $table_body_html = ''; + + // query without conditions to shorten URLs when needed, 200 is just + // guess, it should depend on remaining URL length + $url_sql_query = $this->_getUrlSqlQuery($analyzed_sql_results); + + $display_params = $this->__get('display_params'); + + if (! is_array($map)) { + $map = array(); + } + + $row_no = 0; + $display_params['edit'] = array(); + $display_params['copy'] = array(); + $display_params['delete'] = array(); + $display_params['data'] = array(); + $display_params['row_delete'] = array(); + $this->__set('display_params', $display_params); + + // name of the class added to all grid editable elements; + // if we don't have all the columns of a unique key in the result set, + // do not permit grid editing + if ($is_limited_display || ! $this->__get('editable')) { + $grid_edit_class = ''; + } else { + switch ($GLOBALS['cfg']['GridEditing']) { + case 'double-click': + // trying to reduce generated HTML by using shorter + // classes like click1 and click2 + $grid_edit_class = 'grid_edit click2'; + break; + case 'click': + $grid_edit_class = 'grid_edit click1'; + break; + default: // 'disabled' + $grid_edit_class = ''; + break; + } + } + + // prepare to get the column order, if available + list($col_order, $col_visib) = $this->_getColumnParams( + $analyzed_sql_results + ); + + // Correction University of Virginia 19991216 in the while below + // Previous code assumed that all tables have keys, specifically that + // the phpMyAdmin GUI should support row delete/edit only for such + // tables. + // Although always using keys is arguably the prescribed way of + // defining a relational table, it is not required. This will in + // particular be violated by the novice. + // We want to encourage phpMyAdmin usage by such novices. So the code + // below has been changed to conditionally work as before when the + // table being displayed has one or more keys; but to display + // delete/edit options correctly for tables without keys. + + $whereClauseMap = $this->__get('whereClauseMap'); + while ($row = $GLOBALS['dbi']->fetchRow($dt_result)) { + + // add repeating headers + if ((($row_no != 0) && ($_SESSION['tmpval']['repeat_cells'] != 0)) + && !($row_no % $_SESSION['tmpval']['repeat_cells']) + ) { + $table_body_html .= $this->_getRepeatingHeaders( + $display_params + ); + } + + $tr_class = array(); + if ($GLOBALS['cfg']['BrowsePointerEnable'] != true) { + $tr_class[] = 'nopointer'; + } + if ($GLOBALS['cfg']['BrowseMarkerEnable'] != true) { + $tr_class[] = 'nomarker'; + } + + // pointer code part + $classes = (empty($tr_class) ? ' ' : 'class="' . implode(' ', $tr_class) . '"'); + $table_body_html .= '<tr ' . $classes . ' >'; + + // 1. Prepares the row + + // In print view these variable needs to be initialized + $del_url = $del_str = $edit_anchor_class = $editCopyUrlParams = $delUrlParams + = $edit_str = $js_conf = $copy_url = $copy_str = $edit_url = null; + + // 1.2 Defines the URLs for the modify/delete link(s) + + if (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + || ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE) + ) { + + // Results from a "SELECT" statement -> builds the + // WHERE clause to use in links (a unique key if possible) + /** + * @todo $where_clause could be empty, for example a table + * with only one field and it's a BLOB; in this case, + * avoid to display the delete and edit links + */ + list($where_clause, $clause_is_unique, $condition_array) + = Util::getUniqueCondition( + $dt_result, // handle + $this->__get('fields_cnt'), // fields_cnt + $this->__get('fields_meta'), // fields_meta + $row, // row + false, // force_unique + $this->__get('table'), // restrict_to_table + $analyzed_sql_results // analyzed_sql_results + ); + $whereClauseMap[$row_no][$this->__get('table')] = $where_clause; + $this->__set('whereClauseMap', $whereClauseMap); + + $where_clause_html = htmlspecialchars($where_clause); + + // 1.2.1 Modify link(s) - update row case + if ($displayParts['edit_lnk'] == self::UPDATE_ROW) { + + list($edit_url, $copy_url, $edit_str, $copy_str, + $edit_anchor_class, $editCopyUrlParams) + = $this->_getModifiedLinks( + $where_clause, + $clause_is_unique, $url_sql_query + ); + + } // end if (1.2.1) + + // 1.2.2 Delete/Kill link(s) + list($del_url, $del_str, $js_conf, $delUrlParams) + = $this->_getDeleteAndKillLinks( + $where_clause, $clause_is_unique, + $url_sql_query, $displayParts['del_lnk'], + $row + ); + + // 1.3 Displays the links at left if required + if (($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_LEFT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH) + ) { + + $table_body_html .= $this->_getPlacedLinks( + self::POSITION_LEFT, $del_url, $displayParts, $row_no, + $where_clause, $where_clause_html, $condition_array, + $edit_url, $copy_url, $edit_anchor_class, + $edit_str, $copy_str, $del_str, $js_conf, $editCopyUrlParams, $delUrlParams + ); + + } elseif ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE) { + + $table_body_html .= $this->_getPlacedLinks( + self::POSITION_NONE, $del_url, $displayParts, $row_no, + $where_clause, $where_clause_html, $condition_array, + $edit_url, $copy_url, $edit_anchor_class, + $edit_str, $copy_str, $del_str, $js_conf, $editCopyUrlParams, $delUrlParams + ); + + } // end if (1.3) + } // end if (1) + + // 2. Displays the rows' values + if (is_null($this->__get('mime_map'))) { + $this->_setMimeMap(); + } + $table_body_html .= $this->_getRowValues( + $dt_result, + $row, + $row_no, + $col_order, + $map, + $grid_edit_class, + $col_visib, + $url_sql_query, + $analyzed_sql_results + ); + + // 3. Displays the modify/delete links on the right if required + if (($displayParts['edit_lnk'] != self::NO_EDIT_OR_DELETE) + || ($displayParts['del_lnk'] != self::NO_EDIT_OR_DELETE) + ) { + if (($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_RIGHT) + || ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_BOTH) + ) { + + $table_body_html .= $this->_getPlacedLinks( + self::POSITION_RIGHT, $del_url, $displayParts, $row_no, + $where_clause, $where_clause_html, $condition_array, + $edit_url, $copy_url, $edit_anchor_class, + $edit_str, $copy_str, $del_str, $js_conf, $editCopyUrlParams, $delUrlParams + ); + + } + } // end if (3) + + $table_body_html .= '</tr>'; + $table_body_html .= "\n"; + $row_no++; + + } // end while + + return $table_body_html; + + } // end of the '_getTableBody()' function + + /** + * Sets the MIME details of the columns in the results set + * + * @return void + */ + private function _setMimeMap() + { + $fields_meta = $this->__get('fields_meta'); + $mimeMap = array(); + $added = array(); + + for ($currentColumn = 0; + $currentColumn < $this->__get('fields_cnt'); + ++$currentColumn) { + + $meta = $fields_meta[$currentColumn]; + $orgFullTableName = $this->__get('db') . '.' . $meta->orgtable; + + if ($GLOBALS['cfgRelation']['commwork'] + && $GLOBALS['cfgRelation']['mimework'] + && $GLOBALS['cfg']['BrowseMIME'] + && ! $_SESSION['tmpval']['hide_transformation'] + && empty($added[$orgFullTableName]) + ) { + $mimeMap = array_merge( + $mimeMap, + Transformations::getMIME($this->__get('db'), $meta->orgtable, false, true) + ); + $added[$orgFullTableName] = true; + } + } + + // special browser transformation for some SHOW statements + if ($this->__get('is_show') + && ! $_SESSION['tmpval']['hide_transformation'] + ) { + preg_match( + '@^SHOW[[:space:]]+(VARIABLES|(FULL[[:space:]]+)?' + . 'PROCESSLIST|STATUS|TABLE|GRANTS|CREATE|LOGS|DATABASES|FIELDS' + . ')@i', + $this->__get('sql_query'), $which + ); + + if (isset($which[1])) { + $str = ' ' . strtoupper($which[1]); + $isShowProcessList = strpos($str, 'PROCESSLIST') > 0; + if ($isShowProcessList) { + $mimeMap['..Info'] = array( + 'mimetype' => 'Text_Plain', + 'transformation' => 'output/Text_Plain_Sql.php', + ); + } + + $isShowCreateTable = preg_match( + '@CREATE[[:space:]]+TABLE@i', $this->__get('sql_query') + ); + if ($isShowCreateTable) { + $mimeMap['..Create Table'] = array( + 'mimetype' => 'Text_Plain', + 'transformation' => 'output/Text_Plain_Sql.php', + ); + } + } + } + + $this->__set('mime_map', $mimeMap); + } + + /** + * Get the values for one data row + * + * @param integer &$dt_result the link id associated to + * the query which results + * have to be displayed which + * results have to be + * displayed + * @param array $row current row data + * @param integer $row_no the index of current row + * @param array|boolean $col_order the column order false when + * a property not found false + * when a property not found + * @param array $map the list of relations + * @param string $grid_edit_class the class for all editable + * columns + * @param boolean|array|string $col_visib column is visible(false); + * column isn't visible(string + * array) + * @param string $url_sql_query the analyzed sql query + * @param array $analyzed_sql_results analyzed sql results + * + * @return string $row_values_html html content + * + * @access private + * + * @see _getTableBody() + */ + private function _getRowValues( + &$dt_result, array $row, $row_no, $col_order, array $map, + $grid_edit_class, $col_visib, + $url_sql_query, array $analyzed_sql_results + ) { + $row_values_html = ''; + + // Following variable are needed for use in isset/empty or + // use with array indexes/safe use in foreach + $sql_query = $this->__get('sql_query'); + $fields_meta = $this->__get('fields_meta'); + $highlight_columns = $this->__get('highlight_columns'); + $mime_map = $this->__get('mime_map'); + + $row_info = $this->_getRowInfoForSpecialLinks($row, $col_order); + + $whereClauseMap = $this->__get('whereClauseMap'); + + $columnCount = $this->__get('fields_cnt'); + for ($currentColumn = 0; + $currentColumn < $columnCount; + ++$currentColumn) { + + // assign $i with appropriate column order + $i = $col_order ? $col_order[$currentColumn] : $currentColumn; + + $meta = $fields_meta[$i]; + $orgFullColName + = $this->__get('db') . '.' . $meta->orgtable . '.' . $meta->orgname; + + $not_null_class = $meta->not_null ? 'not_null' : ''; + $relation_class = isset($map[$meta->name]) ? 'relation' : ''; + $hide_class = ($col_visib && ! $col_visib[$currentColumn]) + ? 'hide' + : ''; + $grid_edit = $meta->orgtable != '' ? $grid_edit_class : ''; + + // handle datetime-related class, for grid editing + $field_type_class + = $this->_getClassForDateTimeRelatedFields($meta->type); + + $is_field_truncated = false; + // combine all the classes applicable to this column's value + $class = $this->_getClassesForColumn( + $grid_edit, $not_null_class, $relation_class, + $hide_class, $field_type_class + ); + + // See if this column should get highlight because it's used in the + // where-query. + $condition_field = (isset($highlight_columns) + && (isset($highlight_columns[$meta->name]) + || isset($highlight_columns[Util::backquote($meta->name)]))) + ? true + : false; + + // Wrap MIME-transformations. [MIME] + $default_function = [Core::class, 'mimeDefaultFunction']; // default_function + $transformation_plugin = $default_function; + $transform_options = array(); + + if ($GLOBALS['cfgRelation']['mimework'] + && $GLOBALS['cfg']['BrowseMIME'] + ) { + + if (isset($mime_map[$orgFullColName]['mimetype']) + && !empty($mime_map[$orgFullColName]['transformation']) + ) { + + $file = $mime_map[$orgFullColName]['transformation']; + $include_file = 'libraries/classes/Plugins/Transformations/' . $file; + + if (@file_exists($include_file)) { + + $class_name = Transformations::getClassName($include_file); + if (class_exists($class_name)) { + // todo add $plugin_manager + $plugin_manager = null; + $transformation_plugin = new $class_name( + $plugin_manager + ); + + $transform_options = Transformations::getOptions( + isset( + $mime_map[$orgFullColName] + ['transformation_options'] + ) + ? $mime_map[$orgFullColName] + ['transformation_options'] + : '' + ); + + $meta->mimetype = str_replace( + '_', '/', + $mime_map[$orgFullColName]['mimetype'] + ); + } + + } // end if file_exists + } // end if transformation is set + } // end if mime/transformation works. + + // Check whether the field needs to display with syntax highlighting + + $dbLower = mb_strtolower($this->__get('db')); + $tblLower = mb_strtolower($meta->orgtable); + $nameLower = mb_strtolower($meta->orgname); + if (! empty($this->transformation_info[$dbLower][$tblLower][$nameLower]) + && (trim($row[$i]) != '') + && ! $_SESSION['tmpval']['hide_transformation'] + ) { + include_once $this->transformation_info + [$dbLower][$tblLower][$nameLower][0]; + $transformation_plugin = new $this->transformation_info + [$dbLower][$tblLower][$nameLower][1](null); + + $transform_options = Transformations::getOptions( + isset($mime_map[$orgFullColName]['transformation_options']) + ? $mime_map[$orgFullColName]['transformation_options'] + : '' + ); + + $meta->mimetype = str_replace( + '_', '/', + $this->transformation_info[$dbLower] + [mb_strtolower($meta->orgtable)] + [mb_strtolower($meta->orgname)][2] + ); + + } + + // Check for the predefined fields need to show as link in schemas + include_once 'libraries/special_schema_links.inc.php'; + + if (isset($GLOBALS['special_schema_links']) + && (! empty($GLOBALS['special_schema_links'][$dbLower][$tblLower][$nameLower])) + ) { + + $linking_url = $this->_getSpecialLinkUrl( + $row[$i], $row_info, mb_strtolower($meta->orgname) + ); + $transformation_plugin = new Text_Plain_Link(); + + $transform_options = array( + 0 => $linking_url, + 2 => true + ); + + $meta->mimetype = str_replace( + '_', '/', + 'Text/Plain' + ); + + } + + /* + * The result set can have columns from more than one table, + * this is why we have to check for the unique conditions + * related to this table; however getUniqueCondition() is + * costly and does not need to be called if we already know + * the conditions for the current table. + */ + if (! isset($whereClauseMap[$row_no][$meta->orgtable])) { + $unique_conditions = Util::getUniqueCondition( + $dt_result, // handle + $this->__get('fields_cnt'), // fields_cnt + $this->__get('fields_meta'), // fields_meta + $row, // row + false, // force_unique + $meta->orgtable, // restrict_to_table + $analyzed_sql_results // analyzed_sql_results + ); + $whereClauseMap[$row_no][$meta->orgtable] = $unique_conditions[0]; + } + + $_url_params = array( + 'db' => $this->__get('db'), + 'table' => $meta->orgtable, + 'where_clause_sign' => Core::signSqlQuery($whereClauseMap[$row_no][$meta->orgtable]), + 'where_clause' => $whereClauseMap[$row_no][$meta->orgtable], + 'transform_key' => $meta->orgname + ); + + if (! empty($sql_query)) { + $_url_params['sql_query'] = $url_sql_query; + } + + $transform_options['wrapper_link'] = Url::getCommon($_url_params); + + $display_params = $this->__get('display_params'); + + // in some situations (issue 11406), numeric returns 1 + // even for a string type + // for decimal numeric is returning 1 + // have to improve logic + if (($meta->numeric == 1 && $meta->type != 'string') || $meta->type == 'real') { + // n u m e r i c + + $display_params['data'][$row_no][$i] + = $this->_getDataCellForNumericColumns( + $row[$i], + $class, + $condition_field, + $meta, + $map, + $is_field_truncated, + $analyzed_sql_results, + $transformation_plugin, + $default_function, + $transform_options + ); + + } elseif ($meta->type == self::GEOMETRY_FIELD) { + // g e o m e t r y + + // Remove 'grid_edit' from $class as we do not allow to + // inline-edit geometry data. + $class = str_replace('grid_edit', '', $class); + + $display_params['data'][$row_no][$i] + = $this->_getDataCellForGeometryColumns( + $row[$i], + $class, + $meta, + $map, + $_url_params, + $condition_field, + $transformation_plugin, + $default_function, + $transform_options, + $analyzed_sql_results + ); + + } else { + // n o t n u m e r i c + + $display_params['data'][$row_no][$i] + = $this->_getDataCellForNonNumericColumns( + $row[$i], + $class, + $meta, + $map, + $_url_params, + $condition_field, + $transformation_plugin, + $default_function, + $transform_options, + $is_field_truncated, + $analyzed_sql_results, + $dt_result, + $i + ); + + } + + // output stored cell + $row_values_html .= $display_params['data'][$row_no][$i]; + + if (isset($display_params['rowdata'][$i][$row_no])) { + $display_params['rowdata'][$i][$row_no] + .= $display_params['data'][$row_no][$i]; + } else { + $display_params['rowdata'][$i][$row_no] + = $display_params['data'][$row_no][$i]; + } + + $this->__set('display_params', $display_params); + + } // end for + + return $row_values_html; + + } // end of the '_getRowValues()' function + + /** + * Get link for display special schema links + * + * @param string $column_value column value + * @param array $row_info information about row + * @param string $field_name column name + * + * @return string generated link + */ + private function _getSpecialLinkUrl($column_value, array $row_info, $field_name) + { + + $linking_url_params = array(); + $link_relations = $GLOBALS['special_schema_links'] + [mb_strtolower($this->__get('db'))] + [mb_strtolower($this->__get('table'))] + [$field_name]; + + if (! is_array($link_relations['link_param'])) { + $linking_url_params[$link_relations['link_param']] = $column_value; + } else { + // Consider only the case of creating link for column field + // sql query that needs to be passed as url param + $sql = 'SELECT `' . $column_value . '` FROM `' + . $row_info[$link_relations['link_param'][1]] . '`.`' + . $row_info[$link_relations['link_param'][2]] . '`'; + $linking_url_params[$link_relations['link_param'][0]] = $sql; + } + + $divider = strpos($link_relations['default_page'], '?') ? '&' : '?'; + if (empty($link_relations['link_dependancy_params'])) { + return $link_relations['default_page'] + . Url::getCommonRaw($linking_url_params, $divider); + } + + foreach ($link_relations['link_dependancy_params'] as $new_param) { + + // If param_info is an array, set the key and value + // from that array + if (is_array($new_param['param_info'])) { + $linking_url_params[$new_param['param_info'][0]] + = $new_param['param_info'][1]; + continue; + } + + $linking_url_params[$new_param['param_info']] + = $row_info[mb_strtolower($new_param['column_name'])]; + + // Special case 1 - when executing routines, according + // to the type of the routine, url param changes + if (empty($row_info['routine_type'])) { + continue; + } + } + + return $link_relations['default_page'] + . Url::getCommonRaw($linking_url_params, $divider); + } + + + /** + * Prepare row information for display special links + * + * @param array $row current row data + * @param array|boolean $col_order the column order + * + * @return array $row_info associative array with column nama -> value + */ + private function _getRowInfoForSpecialLinks(array $row, $col_order) + { + + $row_info = array(); + $fields_meta = $this->__get('fields_meta'); + + for ($n = 0; $n < $this->__get('fields_cnt'); ++$n) { + $m = $col_order ? $col_order[$n] : $n; + $row_info[mb_strtolower($fields_meta[$m]->orgname)] + = $row[$m]; + } + + return $row_info; + + } + + /** + * Get url sql query without conditions to shorten URLs + * + * @param array $analyzed_sql_results analyzed sql results + * + * @return string $url_sql analyzed sql query + * + * @access private + * + * @see _getTableBody() + */ + private function _getUrlSqlQuery(array $analyzed_sql_results) + { + if (($analyzed_sql_results['querytype'] != 'SELECT') + || (mb_strlen($this->__get('sql_query')) < 200) + ) { + return $this->__get('sql_query'); + } + + $query = 'SELECT ' . Query::getClause( + $analyzed_sql_results['statement'], + $analyzed_sql_results['parser']->list, + 'SELECT' + ); + + $from_clause = Query::getClause( + $analyzed_sql_results['statement'], + $analyzed_sql_results['parser']->list, + 'FROM' + ); + + if (!empty($from_clause)) { + $query .= ' FROM ' . $from_clause; + } + + return $query; + + } // end of the '_getUrlSqlQuery()' function + + + /** + * Get column order and column visibility + * + * @param array $analyzed_sql_results analyzed sql results + * + * @return array 2 element array - $col_order, $col_visib + * + * @access private + * + * @see _getTableBody() + */ + private function _getColumnParams(array $analyzed_sql_results) + { + if ($this->_isSelect($analyzed_sql_results)) { + $pmatable = new Table($this->__get('table'), $this->__get('db')); + $col_order = $pmatable->getUiProp(Table::PROP_COLUMN_ORDER); + /* Validate the value */ + if ($col_order !== false) { + $fields_cnt = $this->__get('fields_cnt'); + foreach ($col_order as $value) { + if ($value >= $fields_cnt) { + $pmatable->removeUiProp(Table::PROP_COLUMN_ORDER); + $fields_cnt = false; + } + } + } + $col_visib = $pmatable->getUiProp(Table::PROP_COLUMN_VISIB); + } else { + $col_order = false; + $col_visib = false; + } + + return array($col_order, $col_visib); + } // end of the '_getColumnParams()' function + + + /** + * Get HTML for repeating headers + * + * @param array $display_params holds various display info + * + * @return string $header_html html content + * + * @access private + * + * @see _getTableBody() + */ + private function _getRepeatingHeaders( + array $display_params + ) { + $header_html = '<tr>' . "\n"; + + if ($display_params['emptypre'] > 0) { + + $header_html .= ' <th colspan="' + . $display_params['emptypre'] . '">' + . "\n" . '  </th>' . "\n"; + + } elseif ($GLOBALS['cfg']['RowActionLinks'] == self::POSITION_NONE) { + $header_html .= ' <th></th>' . "\n"; + } + + foreach ($display_params['desc'] as $val) { + $header_html .= $val; + } + + if ($display_params['emptyafter'] > 0) { + $header_html + .= ' <th colspan="' . $display_params['emptyafter'] + . '">' + . "\n" . '  </th>' . "\n"; + } + $header_html .= '</tr>' . "\n"; + + return $header_html; + + } // end of the '_getRepeatingHeaders()' function + + + /** + * Get modified links + * + * @param string $where_clause the where clause of the sql + * @param boolean $clause_is_unique the unique condition of clause + * @param string $url_sql_query the analyzed sql query + * + * @return array 5 element array - $edit_url, $copy_url, + * $edit_str, $copy_str, $edit_anchor_class + * + * @access private + * + * @see _getTableBody() + */ + private function _getModifiedLinks( + $where_clause, $clause_is_unique, $url_sql_query + ) { + + $_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'where_clause' => $where_clause, + 'clause_is_unique' => $clause_is_unique, + 'sql_query' => $url_sql_query, + 'goto' => 'sql.php', + ); + + $edit_url = 'tbl_change.php'; + + $copy_url = 'tbl_change.php'; + + $edit_str = $this->_getActionLinkContent( + 'b_edit', __('Edit') + ); + $copy_str = $this->_getActionLinkContent( + 'b_insrow', __('Copy') + ); + + // Class definitions required for grid editing jQuery scripts + $edit_anchor_class = "edit_row_anchor"; + if ($clause_is_unique == 0) { + $edit_anchor_class .= ' nonunique'; + } + + return array($edit_url, $copy_url, $edit_str, $copy_str, $edit_anchor_class, $_url_params); + + } // end of the '_getModifiedLinks()' function + + + /** + * Get delete and kill links + * + * @param string $where_clause the where clause of the sql + * @param boolean $clause_is_unique the unique condition of clause + * @param string $url_sql_query the analyzed sql query + * @param string $del_lnk the delete link of current row + * @param array $row the current row + * + * @return array 3 element array + * $del_url, $del_str, $js_conf + * + * @access private + * + * @see _getTableBody() + */ + private function _getDeleteAndKillLinks( + $where_clause, $clause_is_unique, $url_sql_query, $del_lnk, array $row + ) { + + $goto = $this->__get('goto'); + + if ($del_lnk == self::DELETE_ROW) { // delete row case + + $_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $url_sql_query, + 'message_to_show' => __('The row has been deleted.'), + 'goto' => (empty($goto) ? 'tbl_sql.php' : $goto), + ); + + $lnk_goto = 'sql.php' . Url::getCommonRaw($_url_params); + + $del_query = 'DELETE FROM ' + . Util::backquote($this->__get('table')) + . ' WHERE ' . $where_clause . + ($clause_is_unique ? '' : ' LIMIT 1'); + + $_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $del_query, + 'message_to_show' => __('The row has been deleted.'), + 'goto' => $lnk_goto, + ); + $del_url = 'sql.php'; + + $js_conf = 'DELETE FROM ' . Sanitize::jsFormat($this->__get('table')) + . ' WHERE ' . Sanitize::jsFormat($where_clause, false) + . ($clause_is_unique ? '' : ' LIMIT 1'); + + $del_str = $this->_getActionLinkContent('b_drop', __('Delete')); + + } elseif ($del_lnk == self::KILL_PROCESS) { // kill process case + + $_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'sql_query' => $url_sql_query, + 'goto' => 'index.php', + ); + + $lnk_goto = 'sql.php' . Url::getCommonRaw($_url_params); + + $kill = $GLOBALS['dbi']->getKillQuery($row[0]); + + $_url_params = array( + 'db' => 'mysql', + 'sql_query' => $kill, + 'goto' => $lnk_goto, + ); + + $del_url = 'sql.php'; + $js_conf = $kill; + $del_str = Util::getIcon( + 'b_drop', __('Kill') + ); + } else { + $del_url = $del_str = $js_conf = $_url_params = null; + } + + return array($del_url, $del_str, $js_conf, $_url_params); + + } // end of the '_getDeleteAndKillLinks()' function + + + /** + * Get content inside the table row action links (Edit/Copy/Delete) + * + * @param string $icon The name of the file to get + * @param string $display_text The text displaying after the image icon + * + * @return string + * + * @access private + * + * @see _getModifiedLinks(), _getDeleteAndKillLinks() + */ + private function _getActionLinkContent($icon, $display_text) + { + + $linkContent = ''; + + if (isset($GLOBALS['cfg']['RowActionType']) + && $GLOBALS['cfg']['RowActionType'] == self::ACTION_LINK_CONTENT_ICONS + ) { + + $linkContent .= '<span class="nowrap">' + . Util::getImage( + $icon, $display_text + ) + . '</span>'; + + } elseif (isset($GLOBALS['cfg']['RowActionType']) + && $GLOBALS['cfg']['RowActionType'] == self::ACTION_LINK_CONTENT_TEXT + ) { + + $linkContent .= '<span class="nowrap">' . $display_text . '</span>'; + + } else { + + $linkContent .= Util::getIcon( + $icon, $display_text + ); + + } + + return $linkContent; + + } + + + /** + * Prepare placed links + * + * @param string $dir the direction of links should place + * @param string $del_url the url for delete row + * @param array $displayParts which elements to display + * @param integer $row_no the index of current row + * @param string $where_clause the where clause of the sql + * @param string $where_clause_html the html encoded where clause + * @param array $condition_array array of keys (primary, unique, condition) + * @param string $edit_url the url for edit row + * @param string $copy_url the url for copy row + * @param string $edit_anchor_class the class for html element for edit + * @param string $edit_str the label for edit row + * @param string $copy_str the label for copy row + * @param string $del_str the label for delete row + * @param string $js_conf text for the JS confirmation + * @param array $editCopyUrlParams URL parameters + * @param array $delUrlParams URL parameters + * + * @return string html content + * + * @access private + * + * @see _getTableBody() + */ + private function _getPlacedLinks( + $dir, $del_url, array $displayParts, $row_no, $where_clause, $where_clause_html, + array $condition_array, $edit_url, $copy_url, + $edit_anchor_class, $edit_str, $copy_str, $del_str, $js_conf, $editCopyUrlParams, $delUrlParams + ) { + + if (! isset($js_conf)) { + $js_conf = ''; + } + + return $this->_getCheckboxAndLinks( + $dir, $del_url, $displayParts, + $row_no, $where_clause, $where_clause_html, $condition_array, + $edit_url, $copy_url, $edit_anchor_class, + $edit_str, $copy_str, $del_str, $js_conf, $editCopyUrlParams, $delUrlParams + ); + + } // end of the '_getPlacedLinks()' function + + + /** + * Get the combined classes for a column + * + * @param string $grid_edit_class the class for all editable columns + * @param string $not_null_class the class for not null columns + * @param string $relation_class the class for relations in a column + * @param string $hide_class the class for visibility of a column + * @param string $field_type_class the class related to type of the field + * + * @return string $class the combined classes + * + * @access private + * + * @see _getTableBody() + */ + private function _getClassesForColumn( + $grid_edit_class, $not_null_class, $relation_class, + $hide_class, $field_type_class + ) { + $class = 'data ' . $grid_edit_class . ' ' . $not_null_class . ' ' + . $relation_class . ' ' . $hide_class . ' ' . $field_type_class; + + return $class; + + } // end of the '_getClassesForColumn()' function + + + /** + * Get class for datetime related fields + * + * @param string $type the type of the column field + * + * @return string $field_type_class the class for the column + * + * @access private + * + * @see _getTableBody() + */ + private function _getClassForDateTimeRelatedFields($type) + { + if ((substr($type, 0, 9) == self::TIMESTAMP_FIELD) + || ($type == self::DATETIME_FIELD) + ) { + $field_type_class = 'datetimefield'; + } elseif ($type == self::DATE_FIELD) { + $field_type_class = 'datefield'; + } elseif ($type == self::TIME_FIELD) { + $field_type_class = 'timefield'; + } elseif ($type == self::STRING_FIELD) { + $field_type_class = 'text'; + } else { + $field_type_class = ''; + } + return $field_type_class; + } // end of the '_getClassForDateTimeRelatedFields()' function + + + /** + * Prepare data cell for numeric type fields + * + * @param string $column the column's value + * @param string $class the html class for column + * @param boolean $condition_field the column should highlighted + * or not + * @param object $meta the meta-information about this + * field + * @param array $map the list of relations + * @param boolean $is_field_truncated the condition for blob data + * replacements + * @param array $analyzed_sql_results the analyzed query + * @param object|string $transformation_plugin the name of transformation plugin + * @param string $default_function the default transformation + * function + * @param array $transform_options the transformation parameters + * + * @return string $cell the prepared cell, html content + * + * @access private + * + * @see _getTableBody() + */ + private function _getDataCellForNumericColumns( + $column, $class, $condition_field, $meta, array $map, $is_field_truncated, + array $analyzed_sql_results, $transformation_plugin, $default_function, + array $transform_options + ) { + + if (! isset($column) || is_null($column)) { + + $cell = $this->_buildNullDisplay( + 'right ' . $class, $condition_field, $meta, '' + ); + + } elseif ($column != '') { + + $nowrap = ' nowrap'; + $where_comparison = ' = ' . $column; + + $cell = $this->_getRowData( + 'right ' . $class, $condition_field, + $analyzed_sql_results, $meta, $map, $column, $column, + $transformation_plugin, $default_function, $nowrap, + $where_comparison, $transform_options, + $is_field_truncated, '' + ); + } else { + + $cell = $this->_buildEmptyDisplay( + 'right ' . $class, $condition_field, $meta, '' + ); + } + + return $cell; + + } // end of the '_getDataCellForNumericColumns()' function + + + /** + * Get data cell for geometry type fields + * + * @param string $column the relevant column in data row + * @param string $class the html class for column + * @param object $meta the meta-information about + * this field + * @param array $map the list of relations + * @param array $_url_params the parameters for generate url + * @param boolean $condition_field the column should highlighted + * or not + * @param object|string $transformation_plugin the name of transformation + * function + * @param string $default_function the default transformation + * function + * @param string $transform_options the transformation parameters + * @param array $analyzed_sql_results the analyzed query + * + * @return string $cell the prepared data cell, html content + * + * @access private + * + * @see _getTableBody() + */ + private function _getDataCellForGeometryColumns( + $column, $class, $meta, array $map, array $_url_params, $condition_field, + $transformation_plugin, $default_function, $transform_options, + array $analyzed_sql_results + ) { + if (! isset($column) || is_null($column)) { + $cell = $this->_buildNullDisplay($class, $condition_field, $meta); + return $cell; + } + + if ($column == '') { + $cell = $this->_buildEmptyDisplay($class, $condition_field, $meta); + return $cell; + } + + // Display as [GEOMETRY - (size)] + if ($_SESSION['tmpval']['geoOption'] == self::GEOMETRY_DISP_GEOM) { + $geometry_text = $this->_handleNonPrintableContents( + strtoupper(self::GEOMETRY_FIELD), $column, $transformation_plugin, + $transform_options, $default_function, $meta, $_url_params + ); + + $cell = $this->_buildValueDisplay( + $class, $condition_field, $geometry_text + ); + return $cell; + } + + if ($_SESSION['tmpval']['geoOption'] == self::GEOMETRY_DISP_WKT) { + // Prepare in Well Known Text(WKT) format. + $where_comparison = ' = ' . $column; + + // Convert to WKT format + $wktval = Util::asWKT($column); + list( + $is_field_truncated, + $displayedColumn, + // skip 3rd param + ) = $this->_getPartialText($wktval); + + $cell = $this->_getRowData( + $class, $condition_field, $analyzed_sql_results, $meta, $map, + $wktval, $displayedColumn, $transformation_plugin, + $default_function, '', + $where_comparison, $transform_options, + $is_field_truncated, '' + ); + return $cell; + } + + // Prepare in Well Known Binary (WKB) format. + + if ($_SESSION['tmpval']['display_binary']) { + $where_comparison = ' = ' . $column; + + $wkbval = substr(bin2hex($column), 8); + list( + $is_field_truncated, + $displayedColumn, + // skip 3rd param + ) = $this->_getPartialText($wkbval); + + $cell = $this->_getRowData( + $class, $condition_field, + $analyzed_sql_results, $meta, $map, $wkbval, $displayedColumn, + $transformation_plugin, $default_function, '', + $where_comparison, $transform_options, + $is_field_truncated, '' + ); + return $cell; + } + + $wkbval = $this->_handleNonPrintableContents( + self::BINARY_FIELD, $column, $transformation_plugin, + $transform_options, $default_function, $meta, + $_url_params + ); + + $cell = $this->_buildValueDisplay( + $class, $condition_field, $wkbval + ); + + return $cell; + + } // end of the '_getDataCellForGeometryColumns()' function + + + /** + * Get data cell for non numeric type fields + * + * @param string $column the relevant column in data row + * @param string $class the html class for column + * @param object $meta the meta-information about + * the field + * @param array $map the list of relations + * @param array $_url_params the parameters for generate + * url + * @param boolean $condition_field the column should highlighted + * or not + * @param object|string $transformation_plugin the name of transformation + * function + * @param string $default_function the default transformation + * function + * @param string $transform_options the transformation parameters + * @param boolean $is_field_truncated is data truncated due to + * LimitChars + * @param array $analyzed_sql_results the analyzed query + * @param integer &$dt_result the link id associated to + * the query which results + * have to be displayed + * @param integer $col_index the column index + * + * @return string $cell the prepared data cell, html content + * + * @access private + * + * @see _getTableBody() + */ + private function _getDataCellForNonNumericColumns( + $column, $class, $meta, array $map, array $_url_params, $condition_field, + $transformation_plugin, $default_function, $transform_options, + $is_field_truncated, array $analyzed_sql_results, &$dt_result, $col_index + ) { + $original_length = 0; + + $is_analyse = $this->__get('is_analyse'); + $field_flags = $GLOBALS['dbi']->fieldFlags($dt_result, $col_index); + + $bIsText = gettype($transformation_plugin) === 'object' + && strpos($transformation_plugin->getMIMEtype(), 'Text') + === false; + + // disable inline grid editing + // if binary fields are protected + // or transformation plugin is of non text type + // such as image + if ((stristr($field_flags, self::BINARY_FIELD) + && ($GLOBALS['cfg']['ProtectBinary'] === 'all' + || ($GLOBALS['cfg']['ProtectBinary'] === 'noblob' + && !stristr($meta->type, self::BLOB_FIELD)) + || ($GLOBALS['cfg']['ProtectBinary'] === 'blob' + && stristr($meta->type, self::BLOB_FIELD)))) + || $bIsText + ) { + $class = str_replace('grid_edit', '', $class); + } + + if (! isset($column) || is_null($column)) { + $cell = $this->_buildNullDisplay($class, $condition_field, $meta); + return $cell; + } + + if ($column == '') { + $cell = $this->_buildEmptyDisplay($class, $condition_field, $meta); + return $cell; + } + + // Cut all fields to $GLOBALS['cfg']['LimitChars'] + // (unless it's a link-type transformation or binary) + $displayedColumn = $column; + if (!(gettype($transformation_plugin) === "object" + && strpos($transformation_plugin->getName(), 'Link') !== false) + && !stristr($field_flags, self::BINARY_FIELD) + ) { + list( + $is_field_truncated, + $column, + $original_length + ) = $this->_getPartialText($column); + } + + $formatted = false; + if (isset($meta->_type) && $meta->_type === MYSQLI_TYPE_BIT) { + + $displayedColumn = Util::printableBitValue( + $displayedColumn, $meta->length + ); + + // some results of PROCEDURE ANALYSE() are reported as + // being BINARY but they are quite readable, + // so don't treat them as BINARY + } elseif (stristr($field_flags, self::BINARY_FIELD) + && !(isset($is_analyse) && $is_analyse) + ) { + // we show the BINARY or BLOB message and field's size + // (or maybe use a transformation) + $binary_or_blob = self::BLOB_FIELD; + if ($meta->type === self::STRING_FIELD) { + $binary_or_blob = self::BINARY_FIELD; + } + $displayedColumn = $this->_handleNonPrintableContents( + $binary_or_blob, $displayedColumn, $transformation_plugin, + $transform_options, $default_function, + $meta, $_url_params, $is_field_truncated + ); + $class = $this->_addClass( + $class, $condition_field, $meta, '', + $is_field_truncated, $transformation_plugin, $default_function + ); + $result = strip_tags($column); + // disable inline grid editing + // if binary or blob data is not shown + if (stristr($result, $binary_or_blob)) { + $class = str_replace('grid_edit', '', $class); + } + $formatted = true; + } + + if ($formatted) { + $cell = $this->_buildValueDisplay( + $class, $condition_field, $displayedColumn + ); + return $cell; + } + + // transform functions may enable no-wrapping: + $function_nowrap = 'applyTransformationNoWrap'; + + $bool_nowrap = (($default_function != $transformation_plugin) + && function_exists($transformation_plugin->$function_nowrap())) + ? $transformation_plugin->$function_nowrap($transform_options) + : false; + + // do not wrap if date field type + $nowrap = (preg_match('@DATE|TIME@i', $meta->type) + || $bool_nowrap) ? ' nowrap' : ''; + + $where_comparison = ' = \'' + . $GLOBALS['dbi']->escapeString($column) + . '\''; + + $cell = $this->_getRowData( + $class, $condition_field, + $analyzed_sql_results, $meta, $map, $column, $displayedColumn, + $transformation_plugin, $default_function, $nowrap, + $where_comparison, $transform_options, + $is_field_truncated, $original_length + ); + + return $cell; + + } // end of the '_getDataCellForNonNumericColumns()' function + + /** + * Checks the posted options for viewing query results + * and sets appropriate values in the session. + * + * @todo make maximum remembered queries configurable + * @todo move/split into SQL class!? + * @todo currently this is called twice unnecessary + * @todo ignore LIMIT and ORDER in query!? + * + * @return void + * + * @access public + * + * @see sql.php file + */ + public function setConfigParamsForDisplayTable() + { + + $sql_md5 = md5($this->__get('sql_query')); + $query = array(); + if (isset($_SESSION['tmpval']['query'][$sql_md5])) { + $query = $_SESSION['tmpval']['query'][$sql_md5]; + } + + $query['sql'] = $this->__get('sql_query'); + + if (empty($query['repeat_cells'])) { + $query['repeat_cells'] = $GLOBALS['cfg']['RepeatCells']; + } + + // as this is a form value, the type is always string so we cannot + // use Core::isValid($_POST['session_max_rows'], 'integer') + if (Core::isValid($_POST['session_max_rows'], 'numeric')) { + $query['max_rows'] = (int)$_POST['session_max_rows']; + unset($_POST['session_max_rows']); + } elseif ($_POST['session_max_rows'] == self::ALL_ROWS) { + $query['max_rows'] = self::ALL_ROWS; + unset($_POST['session_max_rows']); + } elseif (empty($query['max_rows'])) { + $query['max_rows'] = intval($GLOBALS['cfg']['MaxRows']); + } + + if (Core::isValid($_REQUEST['pos'], 'numeric')) { + $query['pos'] = $_REQUEST['pos']; + unset($_REQUEST['pos']); + } elseif (empty($query['pos'])) { + $query['pos'] = 0; + } + + if (Core::isValid( + $_REQUEST['pftext'], + array( + self::DISPLAY_PARTIAL_TEXT, self::DISPLAY_FULL_TEXT + ) + ) + ) { + $query['pftext'] = $_REQUEST['pftext']; + unset($_REQUEST['pftext']); + } elseif (empty($query['pftext'])) { + $query['pftext'] = self::DISPLAY_PARTIAL_TEXT; + } + + if (Core::isValid( + $_REQUEST['relational_display'], + array( + self::RELATIONAL_KEY, self::RELATIONAL_DISPLAY_COLUMN + ) + ) + ) { + $query['relational_display'] = $_REQUEST['relational_display']; + unset($_REQUEST['relational_display']); + } elseif (empty($query['relational_display'])) { + // The current session value has priority over a + // change via Settings; this change will be apparent + // starting from the next session + $query['relational_display'] = $GLOBALS['cfg']['RelationalDisplay']; + } + + if (Core::isValid( + $_REQUEST['geoOption'], + array( + self::GEOMETRY_DISP_WKT, self::GEOMETRY_DISP_WKB, + self::GEOMETRY_DISP_GEOM + ) + ) + ) { + $query['geoOption'] = $_REQUEST['geoOption']; + unset($_REQUEST['geoOption']); + } elseif (empty($query['geoOption'])) { + $query['geoOption'] = self::GEOMETRY_DISP_GEOM; + } + + if (isset($_REQUEST['display_binary'])) { + $query['display_binary'] = true; + unset($_REQUEST['display_binary']); + } elseif (isset($_REQUEST['display_options_form'])) { + // we know that the checkbox was unchecked + unset($query['display_binary']); + } elseif (isset($_REQUEST['full_text_button'])) { + // do nothing to keep the value that is there in the session + } else { + // selected by default because some operations like OPTIMIZE TABLE + // and all queries involving functions return "binary" contents, + // according to low-level field flags + $query['display_binary'] = true; + } + + if (isset($_REQUEST['display_blob'])) { + $query['display_blob'] = true; + unset($_REQUEST['display_blob']); + } elseif (isset($_REQUEST['display_options_form'])) { + // we know that the checkbox was unchecked + unset($query['display_blob']); + } + + if (isset($_REQUEST['hide_transformation'])) { + $query['hide_transformation'] = true; + unset($_REQUEST['hide_transformation']); + } elseif (isset($_REQUEST['display_options_form'])) { + // we know that the checkbox was unchecked + unset($query['hide_transformation']); + } + + // move current query to the last position, to be removed last + // so only least executed query will be removed if maximum remembered + // queries limit is reached + unset($_SESSION['tmpval']['query'][$sql_md5]); + $_SESSION['tmpval']['query'][$sql_md5] = $query; + + // do not exceed a maximum number of queries to remember + if (count($_SESSION['tmpval']['query']) > 10) { + array_shift($_SESSION['tmpval']['query']); + //echo 'deleting one element ...'; + } + + // populate query configuration + $_SESSION['tmpval']['pftext'] + = $query['pftext']; + $_SESSION['tmpval']['relational_display'] + = $query['relational_display']; + $_SESSION['tmpval']['geoOption'] + = $query['geoOption']; + $_SESSION['tmpval']['display_binary'] = isset( + $query['display_binary'] + ); + $_SESSION['tmpval']['display_blob'] = isset( + $query['display_blob'] + ); + $_SESSION['tmpval']['hide_transformation'] = isset( + $query['hide_transformation'] + ); + $_SESSION['tmpval']['pos'] + = $query['pos']; + $_SESSION['tmpval']['max_rows'] + = $query['max_rows']; + $_SESSION['tmpval']['repeat_cells'] + = $query['repeat_cells']; + } + + /** + * Prepare a table of results returned by a SQL query. + * + * @param integer &$dt_result the link id associated to the query + * which results have to be displayed + * @param array &$displayParts the parts to display + * @param array $analyzed_sql_results analyzed sql results + * @param boolean $is_limited_display With limited operations or not + * + * @return string $table_html Generated HTML content for resulted table + * + * @access public + * + * @see sql.php file + */ + public function getTable( + &$dt_result, array &$displayParts, array $analyzed_sql_results, + $is_limited_display = false + ) { + + /** + * The statement this table is built for. + * @var \PhpMyAdmin\SqlParser\Statements\SelectStatement + */ + if (isset($analyzed_sql_results['statement'])) { + $statement = $analyzed_sql_results['statement']; + } else { + $statement = null; + } + + $table_html = ''; + // Following variable are needed for use in isset/empty or + // use with array indexes/safe use in foreach + $fields_meta = $this->__get('fields_meta'); + $showtable = $this->__get('showtable'); + $printview = $this->__get('printview'); + + /** + * @todo move this to a central place + * @todo for other future table types + */ + $is_innodb = (isset($showtable['Type']) + && $showtable['Type'] == self::TABLE_TYPE_INNO_DB); + + $sql = new Sql(); + if ($is_innodb && $sql->isJustBrowsing($analyzed_sql_results, true)) { + // "j u s t b r o w s i n g" + $pre_count = '~'; + $after_count = Util::showHint( + Sanitize::sanitize( + __('May be approximate. See [doc@faq3-11]FAQ 3.11[/doc].') + ) + ); + } else { + $pre_count = ''; + $after_count = ''; + } + + // 1. ----- Prepares the work ----- + + // 1.1 Gets the information about which functionalities should be + // displayed + + list( + $displayParts, + $total + ) = $this->_setDisplayPartsAndTotal($displayParts); + + // 1.2 Defines offsets for the next and previous pages + if ($displayParts['nav_bar'] == '1') { + list($pos_next, $pos_prev) = $this->_getOffsets(); + } // end if + + // 1.3 Extract sorting expressions. + // we need $sort_expression and $sort_expression_nodirection + // even if there are many table references + $sort_expression = array(); + $sort_expression_nodirection = array(); + $sort_direction = array(); + + if (!is_null($statement) && !empty($statement->order)) { + foreach ($statement->order as $o) { + $sort_expression[] = $o->expr->expr . ' ' . $o->type; + $sort_expression_nodirection[] = $o->expr->expr; + $sort_direction[] = $o->type; + } + } else { + $sort_expression[] = ''; + $sort_expression_nodirection[] = ''; + $sort_direction[] = ''; + } + + $number_of_columns = count($sort_expression_nodirection); + + // 1.4 Prepares display of first and last value of the sorted column + $sorted_column_message = ''; + for ( $i = 0; $i < $number_of_columns; $i++ ) { + $sorted_column_message .= $this->_getSortedColumnMessage( + $dt_result, $sort_expression_nodirection[$i] + ); + } + + // 2. ----- Prepare to display the top of the page ----- + + // 2.1 Prepares a messages with position information + if (($displayParts['nav_bar'] == '1') && isset($pos_next)) { + + $message = $this->_setMessageInformation( + $sorted_column_message, + $analyzed_sql_results, + $total, + $pos_next, + $pre_count, + $after_count + ); + + $table_html .= Util::getMessage( + $message, $this->__get('sql_query'), 'success' + ); + + } elseif ((!isset($printview) || ($printview != '1')) && !$is_limited_display) { + + $table_html .= Util::getMessage( + __('Your SQL query has been executed successfully.'), + $this->__get('sql_query'), 'success' + ); + } + + // 2.3 Prepare the navigation bars + if (strlen($this->__get('table')) === 0) { + + if ($analyzed_sql_results['querytype'] == 'SELECT') { + // table does not always contain a real table name, + // for example in MySQL 5.0.x, the query SHOW STATUS + // returns STATUS as a table name + $this->__set('table', $fields_meta[0]->table); + } else { + $this->__set('table', ''); + } + + } + + // can the result be sorted? + if ($displayParts['sort_lnk'] == '1' && ! is_null($analyzed_sql_results['statement'])) { + + // At this point, $sort_expression is an array + list($unsorted_sql_query, $sort_by_key_html) + = $this->_getUnsortedSqlAndSortByKeyDropDown( + $analyzed_sql_results, $sort_expression + ); + + } else { + $sort_by_key_html = $unsorted_sql_query = ''; + } + + if (($displayParts['nav_bar'] == '1') && !is_null($statement) && (empty($statement->limit))) { + $table_html .= $this->_getPlacedTableNavigations( + $pos_next, $pos_prev, self::PLACE_TOP_DIRECTION_DROPDOWN, + $is_innodb, $sort_by_key_html + ); + } + + // 2b ----- Get field references from Database ----- + // (see the 'relation' configuration variable) + + // initialize map + $map = array(); + + $target = array(); + if (!is_null($statement) && !empty($statement->from)) { + foreach ($statement->from as $field) { + if (!empty($field->table)) { + $target[] = $field->table; + } + } + } + + if (strlen($this->__get('table')) > 0) { + // This method set the values for $map array + $this->_setParamForLinkForeignKeyRelatedTables($map); + + // Coming from 'Distinct values' action of structure page + // We manipulate relations mechanism to show a link to related rows. + if ($this->__get('is_browse_distinct')) { + $map[$fields_meta[1]->name] = array( + $this->__get('table'), + $fields_meta[1]->name, + '', + $this->__get('db') + ); + } + } // end if + // end 2b + + // 3. ----- Prepare the results table ----- + if ($is_limited_display) { + $table_html .= "<br>"; + } + + $table_html .= $this->_getTableHeaders( + $displayParts, + $analyzed_sql_results, + $unsorted_sql_query, + $sort_expression, + $sort_expression_nodirection, + $sort_direction, + $is_limited_display + ); + + $table_html .= '<tbody>' . "\n"; + + $table_html .= $this->_getTableBody( + $dt_result, + $displayParts, + $map, + $analyzed_sql_results, + $is_limited_display + ); + + $this->__set('display_params', null); + + $table_html .= '</tbody>' . "\n" . '</table></div>'; + + // 4. ----- Prepares the link for multi-fields edit and delete + + if ($displayParts['del_lnk'] == self::DELETE_ROW + && $displayParts['del_lnk'] != self::KILL_PROCESS + ) { + + $table_html .= $this->_getMultiRowOperationLinks( + $dt_result, + $analyzed_sql_results, + $displayParts['del_lnk'] + ); + + } + + // 5. ----- Get the navigation bar at the bottom if required ----- + if (($displayParts['nav_bar'] == '1') && !is_null($statement) && empty($statement->limit)) { + $table_html .= $this->_getPlacedTableNavigations( + $pos_next, $pos_prev, self::PLACE_BOTTOM_DIRECTION_DROPDOWN, + $is_innodb, $sort_by_key_html + ); + } elseif (! isset($printview) || ($printview != '1')) { + $table_html .= "\n" . '<br /><br />' . "\n"; + } + + // 6. ----- Prepare "Query results operations" + if ((! isset($printview) || ($printview != '1')) && ! $is_limited_display) { + $table_html .= $this->_getResultsOperations( + $displayParts, $analyzed_sql_results + ); + } + + return $table_html; + + } // end of the 'getTable()' function + + + /** + * Get offsets for next page and previous page + * + * @return array array with two elements - $pos_next, $pos_prev + * + * @access private + * + * @see getTable() + */ + private function _getOffsets() + { + + if ($_SESSION['tmpval']['max_rows'] == self::ALL_ROWS) { + $pos_next = 0; + $pos_prev = 0; + } else { + + $pos_next = $_SESSION['tmpval']['pos'] + + $_SESSION['tmpval']['max_rows']; + + $pos_prev = $_SESSION['tmpval']['pos'] + - $_SESSION['tmpval']['max_rows']; + + if ($pos_prev < 0) { + $pos_prev = 0; + } + } + + return array($pos_next, $pos_prev); + + } // end of the '_getOffsets()' function + + + /** + * Prepare sorted column message + * + * @param integer &$dt_result the link id associated to the + * query which results have to + * be displayed + * @param string $sort_expression_nodirection sort expression without direction + * + * @return string html content + * null if not found sorted column + * + * @access private + * + * @see getTable() + */ + private function _getSortedColumnMessage( + &$dt_result, $sort_expression_nodirection + ) { + + $fields_meta = $this->__get('fields_meta'); // To use array indexes + + if (empty($sort_expression_nodirection)) { + return null; + } + + if (mb_strpos($sort_expression_nodirection, '.') === false) { + $sort_table = $this->__get('table'); + $sort_column = $sort_expression_nodirection; + } else { + list($sort_table, $sort_column) + = explode('.', $sort_expression_nodirection); + } + + $sort_table = Util::unQuote($sort_table); + $sort_column = Util::unQuote($sort_column); + + // find the sorted column index in row result + // (this might be a multi-table query) + $sorted_column_index = false; + + foreach ($fields_meta as $key => $meta) { + if (($meta->table == $sort_table) && ($meta->name == $sort_column)) { + $sorted_column_index = $key; + break; + } + } + + if ($sorted_column_index === false) { + return null; + } + + // fetch first row of the result set + $row = $GLOBALS['dbi']->fetchRow($dt_result); + + // initializing default arguments + $default_function = [Core::class, 'mimeDefaultFunction']; + $transformation_plugin = $default_function; + $transform_options = array(); + + // check for non printable sorted row data + $meta = $fields_meta[$sorted_column_index]; + + if (stristr($meta->type, self::BLOB_FIELD) + || ($meta->type == self::GEOMETRY_FIELD) + ) { + + $column_for_first_row = $this->_handleNonPrintableContents( + $meta->type, $row[$sorted_column_index], + $transformation_plugin, $transform_options, + $default_function, $meta + ); + + } else { + $column_for_first_row = $row[$sorted_column_index]; + } + + $column_for_first_row = mb_strtoupper( + mb_substr( + $column_for_first_row, 0, $GLOBALS['cfg']['LimitChars'] + ) . '...' + ); + + // fetch last row of the result set + $GLOBALS['dbi']->dataSeek($dt_result, $this->__get('num_rows') - 1); + $row = $GLOBALS['dbi']->fetchRow($dt_result); + + // check for non printable sorted row data + $meta = $fields_meta[$sorted_column_index]; + if (stristr($meta->type, self::BLOB_FIELD) + || ($meta->type == self::GEOMETRY_FIELD) + ) { + + $column_for_last_row = $this->_handleNonPrintableContents( + $meta->type, $row[$sorted_column_index], + $transformation_plugin, $transform_options, + $default_function, $meta + ); + + } else { + $column_for_last_row = $row[$sorted_column_index]; + } + + $column_for_last_row = mb_strtoupper( + mb_substr( + $column_for_last_row, 0, $GLOBALS['cfg']['LimitChars'] + ) . '...' + ); + + // reset to first row for the loop in _getTableBody() + $GLOBALS['dbi']->dataSeek($dt_result, 0); + + // we could also use here $sort_expression_nodirection + return ' [' . htmlspecialchars($sort_column) + . ': <strong>' . htmlspecialchars($column_for_first_row) . ' - ' + . htmlspecialchars($column_for_last_row) . '</strong>]'; + } // end of the '_getSortedColumnMessage()' function + + + /** + * Set the content that needs to be shown in message + * + * @param string $sorted_column_message the message for sorted column + * @param array $analyzed_sql_results the analyzed query + * @param integer $total the total number of rows returned by + * the SQL query without any + * programmatically appended LIMIT clause + * @param integer $pos_next the offset for next page + * @param string $pre_count the string renders before row count + * @param string $after_count the string renders after row count + * + * @return Message $message an object of Message + * + * @access private + * + * @see getTable() + */ + private function _setMessageInformation( + $sorted_column_message, array $analyzed_sql_results, $total, + $pos_next, $pre_count, $after_count + ) { + + $unlim_num_rows = $this->__get('unlim_num_rows'); // To use in isset() + + if (!empty($analyzed_sql_results['statement']->limit)) { + + $first_shown_rec = $analyzed_sql_results['statement']->limit->offset; + $row_count = $analyzed_sql_results['statement']->limit->rowCount; + + if ($row_count < $total) { + $last_shown_rec = $first_shown_rec + $row_count - 1; + } else { + $last_shown_rec = $first_shown_rec + $total - 1; + } + + } elseif (($_SESSION['tmpval']['max_rows'] == self::ALL_ROWS) + || ($pos_next > $total) + ) { + + $first_shown_rec = $_SESSION['tmpval']['pos']; + $last_shown_rec = $total - 1; + + } else { + + $first_shown_rec = $_SESSION['tmpval']['pos']; + $last_shown_rec = $pos_next - 1; + + } + + $table = new Table($this->__get('table'), $this->__get('db')); + if ($table->isView() + && ($total == $GLOBALS['cfg']['MaxExactCountViews']) + ) { + + $message = Message::notice( + __( + 'This view has at least this number of rows. ' + . 'Please refer to %sdocumentation%s.' + ) + ); + + $message->addParam('[doc@cfg_MaxExactCount]'); + $message->addParam('[/doc]'); + $message_view_warning = Util::showHint($message); + + } else { + $message_view_warning = false; + } + + $message = Message::success(__('Showing rows %1s - %2s')); + $message->addParam($first_shown_rec); + + if ($message_view_warning !== false) { + $message->addParamHtml('... ' . $message_view_warning); + } else { + $message->addParam($last_shown_rec); + } + + $message->addText('('); + + if ($message_view_warning === false) { + + if (isset($unlim_num_rows) && ($unlim_num_rows != $total)) { + $message_total = Message::notice( + $pre_count . __('%1$d total, %2$d in query') + ); + $message_total->addParam($total); + $message_total->addParam($unlim_num_rows); + } else { + $message_total = Message::notice($pre_count . __('%d total')); + $message_total->addParam($total); + } + + if (!empty($after_count)) { + $message_total->addHtml($after_count); + } + $message->addMessage($message_total, ''); + + $message->addText(', ', ''); + } + + $message_qt = Message::notice(__('Query took %01.4f seconds.') . ')'); + $message_qt->addParam($this->__get('querytime')); + + $message->addMessage($message_qt, ''); + if (! is_null($sorted_column_message)) { + $message->addHtml($sorted_column_message, ''); + } + + return $message; + } // end of the '_setMessageInformation()' function + + /** + * Set the value of $map array for linking foreign key related tables + * + * @param array &$map the list of relations + * + * @return void + * + * @access private + * + * @see getTable() + */ + private function _setParamForLinkForeignKeyRelatedTables(array &$map) + { + // To be able to later display a link to the related table, + // we verify both types of relations: either those that are + // native foreign keys or those defined in the phpMyAdmin + // configuration storage. If no PMA storage, we won't be able + // to use the "column to display" notion (for example show + // the name related to a numeric id). + $exist_rel = $this->relation->getForeigners( + $this->__get('db'), $this->__get('table'), '', self::POSITION_BOTH + ); + + if (! empty($exist_rel)) { + + foreach ($exist_rel as $master_field => $rel) { + if ($master_field != 'foreign_keys_data') { + $display_field = $this->relation->getDisplayField( + $rel['foreign_db'], $rel['foreign_table'] + ); + $map[$master_field] = array( + $rel['foreign_table'], + $rel['foreign_field'], + $display_field, + $rel['foreign_db'] + ); + } else { + foreach ($rel as $key => $one_key) { + foreach ($one_key['index_list'] as $index => $one_field) { + $display_field = $this->relation->getDisplayField( + isset($one_key['ref_db_name']) + ? $one_key['ref_db_name'] + : $GLOBALS['db'], + $one_key['ref_table_name'] + ); + + $map[$one_field] = array( + $one_key['ref_table_name'], + $one_key['ref_index_list'][$index], + $display_field, + isset($one_key['ref_db_name']) + ? $one_key['ref_db_name'] + : $GLOBALS['db'] + ); + } + } + } + } // end while + } // end if + + } // end of the '_setParamForLinkForeignKeyRelatedTables()' function + + + /** + * Prepare multi field edit/delete links + * + * @param integer &$dt_result the link id associated to the query which + * results have to be displayed + * @param array $analyzed_sql_results analyzed sql results + * @param string $del_link the display element - 'del_link' + * + * @return string $links_html html content + * + * @access private + * + * @see getTable() + */ + private function _getMultiRowOperationLinks( + &$dt_result, array $analyzed_sql_results, $del_link + ) { + + $links_html = '<div class="print_ignore" >'; + $url_query = $this->__get('url_query'); + $delete_text = ($del_link == self::DELETE_ROW) ? __('Delete') : __('Kill'); + + $links_html .= '<img class="selectallarrow" width="38" height="22"' + . ' src="' . $this->__get('pma_theme_image') . 'arrow_' + . $this->__get('text_dir') . '.png' . '"' + . ' alt="' . __('With selected:') . '" />'; + + $links_html .= '<input type="checkbox" ' + . 'id="resultsForm_' . $this->__get('unique_id') . '_checkall" ' + . 'class="checkall_box" title="' . __('Check all') . '" /> ' + . '<label for="resultsForm_' . $this->__get('unique_id') . '_checkall">' + . __('Check all') . '</label> ' + . '<i style="margin-left: 2em">' . __('With selected:') . '</i>' . "\n"; + + $links_html .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Edit'), 'b_edit', 'edit' + ); + + $links_html .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Copy'), 'b_insrow', 'copy' + ); + + $links_html .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + $delete_text, 'b_drop', 'delete' + ); + + if ($analyzed_sql_results['querytype'] == 'SELECT') { + $links_html .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Export'), 'b_tblexport', 'export' + ); + } + + $links_html .= "</div>\n"; + + $links_html .= '<input type="hidden" name="sql_query"' + . ' value="' . htmlspecialchars($this->__get('sql_query')) . '" />' + . "\n"; + + if (! empty($url_query)) { + $links_html .= '<input type="hidden" name="url_query"' + . ' value="' . $url_query . '" />' . "\n"; + } + + // fetch last row of the result set + $GLOBALS['dbi']->dataSeek($dt_result, $this->__get('num_rows') - 1); + $row = $GLOBALS['dbi']->fetchRow($dt_result); + + // @see DbiMysqi::fetchRow & DatabaseInterface::fetchRow + if (! is_array($row)) { + $row = array(); + } + + // $clause_is_unique is needed by getTable() to generate the proper param + // in the multi-edit and multi-delete form + list($where_clause, $clause_is_unique, $condition_array) + = Util::getUniqueCondition( + $dt_result, // handle + $this->__get('fields_cnt'), // fields_cnt + $this->__get('fields_meta'), // fields_meta + $row, // row + false, // force_unique + false, // restrict_to_table + $analyzed_sql_results // analyzed_sql_results + ); + unset($where_clause, $condition_array); + + // reset to first row for the loop in _getTableBody() + $GLOBALS['dbi']->dataSeek($dt_result, 0); + + $links_html .= '<input type="hidden" name="clause_is_unique"' + . ' value="' . $clause_is_unique . '" />' . "\n"; + + $links_html .= '</form>' . "\n"; + + return $links_html; + + } // end of the '_getMultiRowOperationLinks()' function + + + /** + * Prepare table navigation bar at the top or bottom + * + * @param integer $pos_next the offset for the "next" page + * @param integer $pos_prev the offset for the "previous" page + * @param string $place the place to show navigation + * @param boolean $is_innodb whether its InnoDB or not + * @param string $sort_by_key_html the sort by key dialog + * + * @return string html content of navigation bar + * + * @access private + * + * @see _getTable() + */ + private function _getPlacedTableNavigations( + $pos_next, $pos_prev, $place, $is_innodb, $sort_by_key_html + ) { + + $navigation_html = ''; + + if ($place == self::PLACE_BOTTOM_DIRECTION_DROPDOWN) { + $navigation_html .= '<br />' . "\n"; + } + + $navigation_html .= $this->_getTableNavigation( + $pos_next, $pos_prev, $is_innodb, $sort_by_key_html + ); + + if ($place == self::PLACE_TOP_DIRECTION_DROPDOWN) { + $navigation_html .= "\n"; + } + + return $navigation_html; + + } // end of the '_getPlacedTableNavigations()' function + + /** + * Generates HTML to display the Create view in span tag + * + * @param array $analyzed_sql_results analyzed sql results + * @param array $url_query URL Parameters + * + * @return string + * + * @access private + * + * @see _getResultsOperations() + */ + private function _getLinkForCreateView(array $analyzed_sql_results, $urlParams) + { + $results_operations_html = ''; + if (empty($analyzed_sql_results['procedure'])) { + + $results_operations_html .= '<span>' + . Util::linkOrButton( + 'view_create.php', + $urlParams, + Util::getIcon( + 'b_view_add', __('Create view'), true + ), + array('class' => 'create_view ajax') + ) + . '</span>' . "\n"; + } + return $results_operations_html; + + } + + /** + * Calls the _getResultsOperations with $only_view as true + * + * @param array $analyzed_sql_results analyzed sql results + * + * @return string + * + * @access public + * + */ + public function getCreateViewQueryResultOp(array $analyzed_sql_results) + { + + $results_operations_html = ''; + //calling to _getResultOperations with a fake $displayParts + //and setting only_view parameter to be true to generate just view + $results_operations_html .= $this->_getResultsOperations( + array(), + $analyzed_sql_results, + true + ); + return $results_operations_html; + } + + /** + * Get copy to clipboard links for results operations + * + * @return string $html + * + * @access private + */ + private function _getCopytoclipboardLinks() + { + $html = Util::linkOrButton( + '#', + null, + Util::getIcon( + 'b_insrow', __('Copy to clipboard'), true + ), + array('id' => 'copyToClipBoard') + ); + + return $html; + } + + /** + * Get printview links for results operations + * + * @return string $html + * + * @access private + */ + private function _getPrintviewLinks() + { + $html = Util::linkOrButton( + '#', + null, + Util::getIcon( + 'b_print', __('Print'), true + ), + array('id' => 'printView'), + 'print_view' + ); + + return $html; + } + + /** + * Get operations that are available on results. + * + * @param array $displayParts the parts to display + * @param array $analyzed_sql_results analyzed sql results + * @param boolean $only_view Whether to show only view + * + * @return string $results_operations_html html content + * + * @access private + * + * @see getTable() + */ + private function _getResultsOperations( + array $displayParts, array $analyzed_sql_results, $only_view = false + ) { + global $printview; + + $results_operations_html = ''; + $fields_meta = $this->__get('fields_meta'); // To safe use in foreach + $header_shown = false; + $header = '<fieldset class="print_ignore" ><legend>' + . __('Query results operations') . '</legend>'; + + $_url_params = array( + 'db' => $this->__get('db'), + 'table' => $this->__get('table'), + 'printview' => '1', + 'sql_query' => $this->__get('sql_query'), + ); + + if (!$header_shown) { + $results_operations_html .= $header; + $header_shown = true; + } + // if empty result set was produced we need to + // show only view and not other options + if ($only_view) { + $results_operations_html .= $this->_getLinkForCreateView( + $analyzed_sql_results, $_url_params + ); + + if ($header_shown) { + $results_operations_html .= '</fieldset><br />'; + } + return $results_operations_html; + } + + // Displays "printable view" link if required + if ($displayParts['pview_lnk'] == '1') { + $results_operations_html .= $this->_getPrintviewLinks(); + $results_operations_html .= $this->_getCopytoclipboardLinks(); + } // end displays "printable view" + + // Export link + // (the url_query has extra parameters that won't be used to export) + // (the single_table parameter is used in Export::getDisplay() + // to hide the SQL and the structure export dialogs) + // If the parser found a PROCEDURE clause + // (most probably PROCEDURE ANALYSE()) it makes no sense to + // display the Export link). + if (($analyzed_sql_results['querytype'] == self::QUERY_TYPE_SELECT) + && ! isset($printview) + && empty($analyzed_sql_results['procedure']) + ) { + + if (count($analyzed_sql_results['select_tables']) == 1) { + $_url_params['single_table'] = 'true'; + } + + if (! $header_shown) { + $results_operations_html .= $header; + $header_shown = true; + } + + $_url_params['unlim_num_rows'] = $this->__get('unlim_num_rows'); + + /** + * At this point we don't know the table name; this can happen + * for example with a query like + * SELECT bike_code FROM (SELECT bike_code FROM bikes) tmp + * As a workaround we set in the table parameter the name of the + * first table of this database, so that tbl_export.php and + * the script it calls do not fail + */ + if (empty($_url_params['table']) && ! empty($_url_params['db'])) { + $_url_params['table'] = $GLOBALS['dbi']->fetchValue("SHOW TABLES"); + /* No result (probably no database selected) */ + if ($_url_params['table'] === false) { + unset($_url_params['table']); + } + } + + $results_operations_html .= Util::linkOrButton( + 'tbl_export.php', + $_url_params, + Util::getIcon( + 'b_tblexport', __('Export'), true + ) + ) + . "\n"; + + // prepare chart + $results_operations_html .= Util::linkOrButton( + 'tbl_chart.php', + $_url_params, + Util::getIcon( + 'b_chart', __('Display chart'), true + ) + ) + . "\n"; + + // prepare GIS chart + $geometry_found = false; + // If at least one geometry field is found + foreach ($fields_meta as $meta) { + if ($meta->type == self::GEOMETRY_FIELD) { + $geometry_found = true; + break; + } + } + + if ($geometry_found) { + $results_operations_html + .= Util::linkOrButton( + 'tbl_gis_visualization.php', + $_url_params, + Util::getIcon( + 'b_globe', + __('Visualize GIS data'), + true + ) + ) + . "\n"; + } + } + + // CREATE VIEW + /** + * + * @todo detect privileges to create a view + * (but see 2006-01-19 note in PhpMyAdmin\Display\CreateTable, + * I think we cannot detect db-specific privileges reliably) + * Note: we don't display a Create view link if we found a PROCEDURE clause + */ + if (!$header_shown) { + $results_operations_html .= $header; + $header_shown = true; + } + + $results_operations_html .= $this->_getLinkForCreateView( + $analyzed_sql_results, $_url_params + ); + + if ($header_shown) { + $results_operations_html .= '</fieldset><br />'; + } + + return $results_operations_html; + + } // end of the '_getResultsOperations()' function + + + /** + * Verifies what to do with non-printable contents (binary or BLOB) + * in Browse mode. + * + * @param string $category BLOB|BINARY|GEOMETRY + * @param string $content the binary content + * @param mixed $transformation_plugin transformation plugin. + * Can also be the default function: + * Core::mimeDefaultFunction + * @param string $transform_options transformation parameters + * @param string $default_function default transformation function + * @param object $meta the meta-information about the field + * @param array $url_params parameters that should go to the + * download link + * @param boolean &$is_truncated the result is truncated or not + * + * @return mixed string or float + * + * @access private + * + * @see _getDataCellForGeometryColumns(), + * _getDataCellForNonNumericColumns(), + * _getSortedColumnMessage() + */ + private function _handleNonPrintableContents( + $category, $content, $transformation_plugin, $transform_options, + $default_function, $meta, array $url_params = array(), &$is_truncated = null + ) { + + $is_truncated = false; + $result = '[' . $category; + + if (isset($content)) { + + $size = strlen($content); + $display_size = Util::formatByteDown($size, 3, 1); + $result .= ' - ' . $display_size[0] . ' ' . $display_size[1]; + + } else { + + $result .= ' - NULL'; + $size = 0; + + } + + $result .= ']'; + + // if we want to use a text transformation on a BLOB column + if (gettype($transformation_plugin) === "object") { + $posMimeOctetstream = strpos( + $transformation_plugin->getMIMESubtype(), + 'Octetstream' + ); + $posMimeText = strpos($transformation_plugin->getMIMEtype(), 'Text'); + if ($posMimeOctetstream + || $posMimeText !== false + ) { + // Applying Transformations on hex string of binary data + // seems more appropriate + $result = pack("H*", bin2hex($content)); + } + } + + if ($size <= 0) { + return($result); + } + + if ($default_function != $transformation_plugin) { + $result = $transformation_plugin->applyTransformation( + $result, + $transform_options, + $meta + ); + return($result); + } + + $result = $default_function($result, array(), $meta); + if (($_SESSION['tmpval']['display_binary'] + && $meta->type === self::STRING_FIELD) + || ($_SESSION['tmpval']['display_blob'] + && stristr($meta->type, self::BLOB_FIELD)) + ) { + // in this case, restart from the original $content + if (mb_check_encoding($content, 'utf-8') + && !preg_match('/[\x00-\x08\x0B\x0C\x0E-\x1F\x80-\x9F]/u', $content) + ) { + // show as text if it's valid utf-8 + $result = htmlspecialchars($content); + } else { + $result = '0x' . bin2hex($content); + } + list( + $is_truncated, + $result, + // skip 3rd param + ) = $this->_getPartialText($result); + } + + /* Create link to download */ + + // in PHP < 5.5, empty() only checks variables + $tmpdb = $this->__get('db'); + if (count($url_params) > 0 + && (!empty($tmpdb) && !empty($meta->orgtable)) + ) { + $url_params['where_clause_sign'] = Core::signSqlQuery($url_params['where_clause']); + + $result = '<a href="tbl_get_field.php' + . Url::getCommon($url_params) + . '" class="disableAjax">' + . $result . '</a>'; + } + + return($result); + + } // end of the '_handleNonPrintableContents()' function + + + /** + * Retrieves the associated foreign key info for a data cell + * + * @param array $map the list of relations + * @param object $meta the meta-information about the field + * @param string $where_comparison data for the where clause + * + * @return string formatted data + * + * @access private + * + */ + private function _getFromForeign(array $map, $meta, $where_comparison) + { + $dispsql = 'SELECT ' + . Util::backquote($map[$meta->name][2]) + . ' FROM ' + . Util::backquote($map[$meta->name][3]) + . '.' + . Util::backquote($map[$meta->name][0]) + . ' WHERE ' + . Util::backquote($map[$meta->name][1]) + . $where_comparison; + + $dispresult = $GLOBALS['dbi']->tryQuery( + $dispsql, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + + if ($dispresult && $GLOBALS['dbi']->numRows($dispresult) > 0) { + list($dispval) = $GLOBALS['dbi']->fetchRow($dispresult, 0); + } else { + $dispval = __('Link not found!'); + } + + $GLOBALS['dbi']->freeResult($dispresult); + + return $dispval; + } + + /** + * Prepares the displayable content of a data cell in Browse mode, + * taking into account foreign key description field and transformations + * + * @param string $class css classes for the td element + * @param bool $condition_field whether the column is a part of + * the where clause + * @param array $analyzed_sql_results the analyzed query + * @param object $meta the meta-information about the + * field + * @param array $map the list of relations + * @param string $data data + * @param string $displayedData data that will be displayed (maybe be chunked) + * @param object|string $transformation_plugin transformation plugin. + * Can also be the default function: + * Core::mimeDefaultFunction + * @param string $default_function default function + * @param string $nowrap 'nowrap' if the content should + * not be wrapped + * @param string $where_comparison data for the where clause + * @param array $transform_options options for transformation + * @param bool $is_field_truncated whether the field is truncated + * @param string $original_length of a truncated column, or '' + * + * @return string formatted data + * + * @access private + * + * @see _getDataCellForNumericColumns(), _getDataCellForGeometryColumns(), + * _getDataCellForNonNumericColumns(), + * + */ + private function _getRowData( + $class, $condition_field, array $analyzed_sql_results, $meta, + array $map, $data, $displayedData, + $transformation_plugin, $default_function, $nowrap, $where_comparison, + array $transform_options, $is_field_truncated, $original_length='' + ) { + $relational_display = $_SESSION['tmpval']['relational_display']; + $printview = $this->__get('printview'); + $decimals = isset($meta->decimals) ? $meta->decimals : '-1'; + $result = '<td data-decimals="' . $decimals . '"' + . ' data-type="' . $meta->type . '"'; + + if (! empty($original_length)) { + // cannot use data-original-length + $result .= ' data-originallength="' . $original_length . '"'; + } + + $result .= ' class="' + . $this->_addClass( + $class, $condition_field, $meta, $nowrap, + $is_field_truncated, $transformation_plugin, $default_function + ) + . '">'; + + if (!empty($analyzed_sql_results['statement']->expr)) { + foreach ($analyzed_sql_results['statement']->expr as $expr) { + if ((empty($expr->alias)) || (empty($expr->column))) { + continue; + } + if (strcasecmp($meta->name, $expr->alias) == 0) { + $meta->name = $expr->column; + } + } + } + + if (isset($map[$meta->name])) { + + // Field to display from the foreign table? + if (isset($map[$meta->name][2]) + && strlen($map[$meta->name][2]) > 0 + ) { + $dispval = $this->_getFromForeign( + $map, $meta, $where_comparison + ); + } else { + $dispval = ''; + } // end if... else... + + if (isset($printview) && ($printview == '1')) { + + $result .= ($transformation_plugin != $default_function + ? $transformation_plugin->applyTransformation( + $data, + $transform_options, + $meta + ) + : $default_function($data) + ) + . ' <code>[->' . $dispval . ']</code>'; + + } else { + + if ($relational_display == self::RELATIONAL_KEY) { + + // user chose "relational key" in the display options, so + // the title contains the display field + $title = (! empty($dispval)) + ? htmlspecialchars($dispval) + : ''; + + } else { + $title = htmlspecialchars($data); + } + + $sqlQuery = 'SELECT * FROM ' + . Util::backquote($map[$meta->name][3]) . '.' + . Util::backquote($map[$meta->name][0]) + . ' WHERE ' + . Util::backquote($map[$meta->name][1]) + . $where_comparison; + + $_url_params = array( + 'db' => $map[$meta->name][3], + 'table' => $map[$meta->name][0], + 'pos' => '0', + 'sql_signature' => Core::signSqlQuery($sqlQuery), + 'sql_query' => $sqlQuery, + ); + + if ($transformation_plugin != $default_function) { + // always apply a transformation on the real data, + // not on the display field + $displayedData = $transformation_plugin->applyTransformation( + $data, + $transform_options, + $meta + ); + } else { + + if ($relational_display == self::RELATIONAL_DISPLAY_COLUMN + && ! empty($map[$meta->name][2]) + ) { + // user chose "relational display field" in the + // display options, so show display field in the cell + $displayedData = $default_function($dispval); + } else { + // otherwise display data in the cell + $displayedData = $default_function($displayedData); + } + + } + + $tag_params = array('title' => $title); + if (strpos($class, 'grid_edit') !== false) { + $tag_params['class'] = 'ajax'; + } + $result .= Util::linkOrButton( + 'sql.php', $_url_params, + $displayedData, $tag_params + ); + } + + } else { + $result .= ($transformation_plugin != $default_function + ? $transformation_plugin->applyTransformation( + $data, + $transform_options, + $meta + ) + : $default_function($data) + ); + } + + $result .= '</td>' . "\n"; + + return $result; + + } // end of the '_getRowData()' function + + + /** + * Prepares a checkbox for multi-row submits + * + * @param string $del_url delete url + * @param array $displayParts array with explicit indexes for all + * the display elements + * @param string $row_no the row number + * @param string $where_clause_html url encoded where clause + * @param array $condition_array array of conditions in the where clause + * @param string $id_suffix suffix for the id + * @param string $class css classes for the td element + * + * @return string the generated HTML + * + * @access private + * + * @see _getTableBody(), _getCheckboxAndLinks() + */ + private function _getCheckboxForMultiRowSubmissions( + $del_url, array $displayParts, $row_no, $where_clause_html, array $condition_array, + $id_suffix, $class + ) { + + $ret = ''; + + if (! empty($del_url) && $displayParts['del_lnk'] != self::KILL_PROCESS) { + + $ret .= '<td '; + if (! empty($class)) { + $ret .= 'class="' . $class . '"'; + } + + $ret .= ' class="center print_ignore">' + . '<input type="checkbox" id="id_rows_to_delete' + . $row_no . $id_suffix + . '" name="rows_to_delete[' . $row_no . ']"' + . ' class="multi_checkbox checkall"' + . ' value="' . $where_clause_html . '" ' + . ' />' + . '<input type="hidden" class="condition_array" value="' + . htmlspecialchars(json_encode($condition_array)) . '" />' + . ' </td>'; + } + + return $ret; + + } // end of the '_getCheckboxForMultiRowSubmissions()' function + + + /** + * Prepares an Edit link + * + * @param string $edit_url edit url + * @param array $urlParams URL parameters + * @param string $class css classes for td element + * @param string $edit_str text for the edit link + * @param string $where_clause where clause + * @param string $where_clause_html url encoded where clause + * + * @return string the generated HTML + * + * @access private + * + * @see _getTableBody(), _getCheckboxAndLinks() + */ + private function _getEditLink( + $edit_url, $urlParams, $class, $edit_str, $where_clause, $where_clause_html + ) { + + $ret = ''; + if (! empty($edit_url)) { + + $ret .= '<td class="' . $class . ' center print_ignore" ' + . ' ><span class="nowrap">' + . Util::linkOrButton($edit_url, $urlParams, $edit_str); + /* + * Where clause for selecting this row uniquely is provided as + * a hidden input. Used by jQuery scripts for handling grid editing + */ + if (! empty($where_clause)) { + $ret .= '<input type="hidden" class="where_clause" value ="' + . $where_clause_html . '" />'; + } + $ret .= '</span></td>'; + } + + return $ret; + + } // end of the '_getEditLink()' function + + + /** + * Prepares an Copy link + * + * @param string $copy_url copy url + * @param array $urlParams URL parameters + * @param string $copy_str text for the copy link + * @param string $where_clause where clause + * @param string $where_clause_html url encoded where clause + * @param string $class css classes for the td element + * + * @return string the generated HTML + * + * @access private + * + * @see _getTableBody(), _getCheckboxAndLinks() + */ + private function _getCopyLink( + $copy_url, $urlParams, $copy_str, $where_clause, $where_clause_html, $class + ) { + + $ret = ''; + if (! empty($copy_url)) { + + $ret .= '<td class="'; + if (! empty($class)) { + $ret .= $class . ' '; + } + + $ret .= 'center print_ignore" ' . ' ><span class="nowrap">' + . Util::linkOrButton($copy_url, $urlParams, $copy_str); + + /* + * Where clause for selecting this row uniquely is provided as + * a hidden input. Used by jQuery scripts for handling grid editing + */ + if (! empty($where_clause)) { + $ret .= '<input type="hidden" class="where_clause" value="' + . $where_clause_html . '" />'; + } + $ret .= '</span></td>'; + } + + return $ret; + + } // end of the '_getCopyLink()' function + + + /** + * Prepares a Delete link + * + * @param string $del_url delete url + * @param array $delUrlParams URL parameters + * @param string $del_str text for the delete link + * @param string $js_conf text for the JS confirmation + * @param string $class css classes for the td element + * + * @return string the generated HTML + * + * @access private + * + * @see _getTableBody(), _getCheckboxAndLinks() + */ + private function _getDeleteLink($del_url, $delUrlParams, $del_str, $js_conf, $class) + { + + $ret = ''; + if (empty($del_url)) { + return $ret; + } + + $ret .= '<td class="'; + if (! empty($class)) { + $ret .= $class . ' '; + } + $ajax = Response::getInstance()->isAjax() ? ' ajax' : ''; + $ret .= 'center print_ignore" ' . ' >' + . Util::linkOrButton( + $del_url, + $delUrlParams, + $del_str, + array('class' => 'delete_row requireConfirm' . $ajax) + ) + . '<div class="hide">' . $js_conf . '</div>' + . '</td>'; + + return $ret; + + } // end of the '_getDeleteLink()' function + + + /** + * Prepare checkbox and links at some position (left or right) + * (only called for horizontal mode) + * + * @param string $position the position of the checkbox and links + * @param string $del_url delete url + * @param array $displayParts array with explicit indexes for all the + * display elements + * @param string $row_no row number + * @param string $where_clause where clause + * @param string $where_clause_html url encoded where clause + * @param array $condition_array array of conditions in the where clause + * @param string $edit_url edit url + * @param string $copy_url copy url + * @param string $class css classes for the td elements + * @param string $edit_str text for the edit link + * @param string $copy_str text for the copy link + * @param string $del_str text for the delete link + * @param string $js_conf text for the JS confirmation + * @param array $editCopyUrlParams URL parameters + * @param array $delUrlParams URL parameters + * + * @return string the generated HTML + * + * @access private + * + * @see _getPlacedLinks() + */ + private function _getCheckboxAndLinks( + $position, $del_url, array $displayParts, $row_no, $where_clause, + $where_clause_html, array $condition_array, + $edit_url, $copy_url, $class, $edit_str, $copy_str, $del_str, $js_conf, $editCopyUrlParams, $delUrlParams + ) { + + $ret = ''; + $editUrlParams = $editCopyUrlParams + array('default_action' => 'update'); + $copyUrlParams = $editCopyUrlParams + array('default_action' => 'insert'); + + if ($position == self::POSITION_LEFT) { + + $ret .= $this->_getCheckboxForMultiRowSubmissions( + $del_url . Url::getCommon($delUrlParams), $displayParts, $row_no, $where_clause_html, + $condition_array, '_left', '' + ); + + $ret .= $this->_getEditLink( + $edit_url, $editUrlParams, $class, $edit_str, $where_clause, $where_clause_html + ); + + $ret .= $this->_getCopyLink( + $copy_url, $copyUrlParams, $copy_str, $where_clause, $where_clause_html, '' + ); + + $ret .= $this->_getDeleteLink($del_url, $delUrlParams, $del_str, $js_conf, ''); + + } elseif ($position == self::POSITION_RIGHT) { + + $ret .= $this->_getDeleteLink($del_url, $delUrlParams, $del_str, $js_conf, ''); + + $ret .= $this->_getCopyLink( + $copy_url, $copyUrlParams, $copy_str, $where_clause, $where_clause_html, '' + ); + + $ret .= $this->_getEditLink( + $edit_url, $editUrlParams, $class, $edit_str, $where_clause, $where_clause_html + ); + + $ret .= $this->_getCheckboxForMultiRowSubmissions( + $del_url . Url::getCommon($delUrlParams), $displayParts, $row_no, $where_clause_html, + $condition_array, '_right', '' + ); + + } else { // $position == self::POSITION_NONE + + $ret .= $this->_getCheckboxForMultiRowSubmissions( + $del_url . Url::getCommon($delUrlParams), $displayParts, $row_no, $where_clause_html, + $condition_array, '_left', '' + ); + } + + return $ret; + + } // end of the '_getCheckboxAndLinks()' function + + /** + * Truncates given string based on LimitChars configuration + * and Session pftext variable + * (string is truncated only if necessary) + * + * @param string $str string to be truncated + * + * @return mixed + * + * @access private + * + * @see _handleNonPrintableContents(), _getDataCellForGeometryColumns(), + * _getDataCellForNonNumericColumns + */ + private function _getPartialText($str) + { + $original_length = mb_strlen($str); + if ($original_length > $GLOBALS['cfg']['LimitChars'] + && $_SESSION['tmpval']['pftext'] === self::DISPLAY_PARTIAL_TEXT + ) { + $str = mb_substr( + $str, 0, $GLOBALS['cfg']['LimitChars'] + ) . '...'; + $truncated = true; + } else { + $truncated = false; + } + + return array($truncated, $str, $original_length); + } +} diff --git a/phpMyAdmin/libraries/classes/Encoding.php b/phpMyAdmin/libraries/classes/Encoding.php new file mode 100755 index 0000000..f17e311 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Encoding.php @@ -0,0 +1,334 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Hold the PhpMyAdmin\Encoding class + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\Config\ConfigFile; +use PhpMyAdmin\Core; +use PhpMyAdmin\Template; + +/** + * Encoding conversion helper class + * + * @package PhpMyAdmin + */ +class Encoding +{ + /** + * None encoding conversion engine + * + * @var int + */ + + const ENGINE_NONE = 0; + /** + * iconv encoding conversion engine + * + * @var int + */ + const ENGINE_ICONV = 1; + + /** + * recode encoding conversion engine + * + * @var int + */ + const ENGINE_RECODE = 2; + + /** + * mbstring encoding conversion engine + * + * @var int + */ + const ENGINE_MB = 3; + + /** + * Chosen encoding engine + * + * @var int + */ + private static $_engine = null; + + /** + * Map of conversion engine configurations + * + * Each entry contains: + * + * - function to detect + * - engine contant + * - extension name to warn when missing + * + * @var array + */ + private static $_enginemap = array( + 'iconv' => array('iconv', self::ENGINE_ICONV, 'iconv'), + 'recode' => array('recode_string', self::ENGINE_RECODE, 'recode'), + 'mb' => array('mb_convert_encoding', self::ENGINE_MB, 'mbstring'), + 'none' => array('isset', self::ENGINE_NONE, ''), + ); + + /** + * Order of automatic detection of engines + * + * @var array + */ + private static $_engineorder = array( + 'iconv', 'mb', 'recode', + ); + + /** + * Kanji encodings list + * + * @var string + */ + private static $_kanji_encodings = 'ASCII,SJIS,EUC-JP,JIS'; + + /** + * Initializes encoding engine detecting available backends. + * + * @return void + */ + public static function initEngine() + { + $engine = 'auto'; + if (isset($GLOBALS['cfg']['RecodingEngine'])) { + $engine = $GLOBALS['cfg']['RecodingEngine']; + } + + /* Use user configuration */ + if (isset(self::$_enginemap[$engine])) { + if (function_exists(self::$_enginemap[$engine][0])) { + self::$_engine = self::$_enginemap[$engine][1]; + return; + } else { + Core::warnMissingExtension(self::$_enginemap[$engine][2]); + } + } + + /* Autodetection */ + foreach (self::$_engineorder as $engine) { + if (function_exists(self::$_enginemap[$engine][0])) { + self::$_engine = self::$_enginemap[$engine][1]; + return; + } + } + + /* Fallback to none conversion */ + self::$_engine = self::ENGINE_NONE; + } + + /** + * Setter for engine. Use with caution, mostly useful for testing. + * + * @param int $engine Engine enconding + * + * @return void + */ + public static function setEngine($engine) + { + self::$_engine = $engine; + } + + /** + * Checks whether there is any charset conversion supported + * + * @return bool + */ + public static function isSupported() + { + if (is_null(self::$_engine)) { + self::initEngine(); + } + return self::$_engine != self::ENGINE_NONE; + } + + /** + * Converts encoding of text according to parameters with detected + * conversion function. + * + * @param string $src_charset source charset + * @param string $dest_charset target charset + * @param string $what what to convert + * + * @return string converted text + * + * @access public + */ + public static function convertString($src_charset, $dest_charset, $what) + { + if ($src_charset == $dest_charset) { + return $what; + } + if (is_null(self::$_engine)) { + self::initEngine(); + } + switch (self::$_engine) { + case self::ENGINE_RECODE: + return recode_string( + $src_charset . '..' . $dest_charset, + $what + ); + case self::ENGINE_ICONV: + return iconv( + $src_charset, + $dest_charset . + (isset($GLOBALS['cfg']['IconvExtraParams']) ? $GLOBALS['cfg']['IconvExtraParams'] : ''), + $what + ); + case self::ENGINE_MB: + return mb_convert_encoding( + $what, + $dest_charset, + $src_charset + ); + default: + return $what; + } + } + + /** + * Detects whether Kanji encoding is available + * + * @return bool + */ + public static function canConvertKanji() + { + return $GLOBALS['lang'] == 'ja'; + } + + /** + * Setter for Kanji encodings. Use with caution, mostly useful for testing. + * + * @return string + */ + public static function getKanjiEncodings() + { + return self::$_kanji_encodings; + } + + /** + * Setter for Kanji encodings. Use with caution, mostly useful for testing. + * + * @param string $value Kanji encodings list + * + * @return void + */ + public static function setKanjiEncodings($value) + { + self::$_kanji_encodings = $value; + } + + /** + * Reverses SJIS & EUC-JP position in the encoding codes list + * + * @return void + */ + public static function kanjiChangeOrder() + { + $parts = explode(',', self::$_kanji_encodings); + if ($parts[1] == 'EUC-JP') { + self::$_kanji_encodings = 'ASCII,SJIS,EUC-JP,JIS'; + } else { + self::$_kanji_encodings = 'ASCII,EUC-JP,SJIS,JIS'; + } + } + + /** + * Kanji string encoding convert + * + * @param string $str the string to convert + * @param string $enc the destination encoding code + * @param string $kana set 'kana' convert to JIS-X208-kana + * + * @return string the converted string + */ + public static function kanjiStrConv($str, $enc, $kana) + { + if ($enc == '' && $kana == '') { + return $str; + } + + $string_encoding = mb_detect_encoding($str, self::$_kanji_encodings); + if ($string_encoding === false) { + $string_encoding = 'utf-8'; + } + + if ($kana == 'kana') { + $dist = mb_convert_kana($str, 'KV', $string_encoding); + $str = $dist; + } + if ($string_encoding != $enc && $enc != '') { + $dist = mb_convert_encoding($str, $enc, $string_encoding); + } else { + $dist = $str; + } + return $dist; + } + + + /** + * Kanji file encoding convert + * + * @param string $file the name of the file to convert + * @param string $enc the destination encoding code + * @param string $kana set 'kana' convert to JIS-X208-kana + * + * @return string the name of the converted file + */ + public static function kanjiFileConv($file, $enc, $kana) + { + if ($enc == '' && $kana == '') { + return $file; + } + $tmpfname = tempnam($GLOBALS['PMA_Config']->getUploadTempDir(), $enc); + $fpd = fopen($tmpfname, 'wb'); + $fps = fopen($file, 'r'); + self::kanjiChangeOrder(); + while (!feof($fps)) { + $line = fgets($fps, 4096); + $dist = self::kanjiStrConv($line, $enc, $kana); + fputs($fpd, $dist); + } // end while + self::kanjiChangeOrder(); + fclose($fps); + fclose($fpd); + unlink($file); + + return $tmpfname; + } + + /** + * Defines radio form fields to switch between encoding modes + * + * @return string xhtml code for the radio controls + */ + public static function kanjiEncodingForm() + { + return Template::get('encoding/kanji_encoding_form')->render(); + } + + /** + * Lists available encodings. + * + * @return array + */ + public static function listEncodings() + { + if (is_null(self::$_engine)) { + self::initEngine(); + } + /* Most engines do not support listing */ + if (self::$_engine != self::ENGINE_MB) { + return $GLOBALS['cfg']['AvailableCharsets']; + } + + return array_intersect( + array_map('strtolower', mb_list_encodings()), + $GLOBALS['cfg']['AvailableCharsets'] + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Engines/Bdb.php b/phpMyAdmin/libraries/classes/Engines/Bdb.php new file mode 100755 index 0000000..cde9480 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Bdb.php @@ -0,0 +1,75 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The BDB storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\StorageEngine; + +/** + * The BDB storage engine + * + * @package PhpMyAdmin-Engines + */ +class Bdb extends StorageEngine +{ + /** + * Returns array with variable names related to this storage engine + * + * @return array variable names + */ + public function getVariables() + { + return array( + 'version_bdb' => array( + 'title' => __('Version information'), + ), + 'bdb_cache_size' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'bdb_home' => array(), + 'bdb_log_buffer_size' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'bdb_logdir' => array(), + 'bdb_max_lock' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'bdb_shared_data' => array(), + 'bdb_tmpdir' => array(), + 'bdb_data_direct' => array(), + 'bdb_lock_detect' => array(), + 'bdb_log_direct' => array(), + 'bdb_no_recover' => array(), + 'bdb_no_sync' => array(), + 'skip_sync_bdb_logs' => array(), + 'sync_bdb_logs' => array(), + ); + } + + /** + * Returns the pattern to be used in the query for SQL variables + * related to this storage engine + * + * @return string LIKE pattern + */ + public function getVariablesLikePattern() + { + return '%bdb%'; + } + + /** + * returns string with filename for the MySQL helppage + * about this storage engine + * + * @return string mysql helppage filename + */ + public function getMysqlHelpPage() + { + return 'bdb'; + } +} + diff --git a/phpMyAdmin/libraries/classes/Engines/Berkeleydb.php b/phpMyAdmin/libraries/classes/Engines/Berkeleydb.php new file mode 100755 index 0000000..ad4f460 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Berkeleydb.php @@ -0,0 +1,18 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The BerkeleyDB storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +/** + * This is same as BDB + * + * @package PhpMyAdmin-Engines + */ +class Berkeleydb extends Bdb +{ +} + diff --git a/phpMyAdmin/libraries/classes/Engines/Binlog.php b/phpMyAdmin/libraries/classes/Engines/Binlog.php new file mode 100755 index 0000000..4c4211f --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Binlog.php @@ -0,0 +1,30 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The binary log storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\StorageEngine; + +/** + * The binary log storage engine + * + * @package PhpMyAdmin-Engines + */ +class Binlog extends StorageEngine +{ + /** + * Returns string with filename for the MySQL helppage + * about this storage engine + * + * @return string mysql helppage filename + */ + public function getMysqlHelpPage() + { + return 'binary-log'; + } +} + diff --git a/phpMyAdmin/libraries/classes/Engines/Innobase.php b/phpMyAdmin/libraries/classes/Engines/Innobase.php new file mode 100755 index 0000000..9aeb8b3 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Innobase.php @@ -0,0 +1,17 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The Innobase storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +/** + * The Innobase storage engine + * + * @package PhpMyAdmin-Engines + */ +class Innobase extends Innodb +{ +} diff --git a/phpMyAdmin/libraries/classes/Engines/Innodb.php b/phpMyAdmin/libraries/classes/Engines/Innodb.php new file mode 100755 index 0000000..72cc8f4 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Innodb.php @@ -0,0 +1,395 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The InnoDB storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\StorageEngine; +use PhpMyAdmin\Util; + +/** + * The InnoDB storage engine + * + * @package PhpMyAdmin-Engines + */ +class Innodb extends StorageEngine +{ + /** + * Returns array with variable names related to InnoDB storage engine + * + * @return array variable names + */ + public function getVariables() + { + return array( + 'innodb_data_home_dir' => array( + 'title' => __('Data home directory'), + 'desc' => __( + 'The common part of the directory path for all InnoDB data ' + . 'files.' + ), + ), + 'innodb_data_file_path' => array( + 'title' => __('Data files'), + ), + 'innodb_autoextend_increment' => array( + 'title' => __('Autoextend increment'), + 'desc' => __( + 'The increment size for extending the size of an autoextending ' + . 'tablespace when it becomes full.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_buffer_pool_size' => array( + 'title' => __('Buffer pool size'), + 'desc' => __( + 'The size of the memory buffer InnoDB uses to cache data and ' + . 'indexes of its tables.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'innodb_additional_mem_pool_size' => array( + 'title' => 'innodb_additional_mem_pool_size', + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'innodb_buffer_pool_awe_mem_mb' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'innodb_checksums' => array(), + 'innodb_commit_concurrency' => array(), + 'innodb_concurrency_tickets' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_doublewrite' => array(), + 'innodb_fast_shutdown' => array(), + 'innodb_file_io_threads' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_file_per_table' => array(), + 'innodb_flush_log_at_trx_commit' => array(), + 'innodb_flush_method' => array(), + 'innodb_force_recovery' => array(), + 'innodb_lock_wait_timeout' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_locks_unsafe_for_binlog' => array(), + 'innodb_log_arch_dir' => array(), + 'innodb_log_archive' => array(), + 'innodb_log_buffer_size' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'innodb_log_file_size' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'innodb_log_files_in_group' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_log_group_home_dir' => array(), + 'innodb_max_dirty_pages_pct' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_max_purge_lag' => array(), + 'innodb_mirrored_log_groups' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_open_files' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_support_xa' => array(), + 'innodb_sync_spin_loops' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_table_locks' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_BOOLEAN, + ), + 'innodb_thread_concurrency' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'innodb_thread_sleep_delay' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + ); + } + + /** + * Returns the pattern to be used in the query for SQL variables + * related to InnoDb storage engine + * + * @return string SQL query LIKE pattern + */ + public function getVariablesLikePattern() + { + return 'innodb\\_%'; + } + + /** + * Get information pages + * + * @return array detail pages + */ + public function getInfoPages() + { + if ($this->support < PMA_ENGINE_SUPPORT_YES) { + return array(); + } + $pages = array(); + $pages['Bufferpool'] = __('Buffer Pool'); + $pages['Status'] = __('InnoDB Status'); + + return $pages; + } + + /** + * returns html tables with stats over inno db buffer pool + * + * @return string html table with stats + */ + public function getPageBufferpool() + { + // The following query is only possible because we know + // that we are on MySQL 5 here (checked above)! + // side note: I love MySQL 5 for this. :-) + $sql + = ' + SHOW STATUS + WHERE Variable_name LIKE \'Innodb\\_buffer\\_pool\\_%\' + OR Variable_name = \'Innodb_page_size\';'; + $status = $GLOBALS['dbi']->fetchResult($sql, 0, 1); + + $output = '<table class="data" id="table_innodb_bufferpool_usage">' . "\n" + . ' <caption class="tblHeaders">' . "\n" + . ' ' . __('Buffer Pool Usage') . "\n" + . ' </caption>' . "\n" + . ' <tfoot>' . "\n" + . ' <tr>' . "\n" + . ' <th colspan="2">' . "\n" + . ' ' . __('Total') . "\n" + . ' : ' + . Util::formatNumber( + $status['Innodb_buffer_pool_pages_total'], + 0 + ) + . ' ' . __('pages') + . ' / ' + . join( + ' ', + Util::formatByteDown( + $status['Innodb_buffer_pool_pages_total'] + * $status['Innodb_page_size'] + ) + ) . "\n" + . ' </th>' . "\n" + . ' </tr>' . "\n" + . ' </tfoot>' . "\n" + . ' <tbody>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Free pages') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_pages_free'], + 0 + ) + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Dirty pages') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_pages_dirty'], + 0 + ) + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Pages containing data') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_pages_data'], + 0 + ) . "\n" + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Pages to be flushed') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_pages_flushed'], + 0 + ) . "\n" + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Busy pages') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_pages_misc'], + 0 + ) . "\n" + . '</td>' . "\n" + . ' </tr>'; + + // not present at least since MySQL 5.1.40 + if (isset($status['Innodb_buffer_pool_pages_latched'])) { + $output .= ' <tr>' + . ' <th>' . __('Latched pages') . '</th>' + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_pages_latched'], + 0 + ) + . '</td>' + . ' </tr>'; + } + + $output .= ' </tbody>' . "\n" + . '</table>' . "\n\n" + . '<table class="data" id="table_innodb_bufferpool_activity">' . "\n" + . ' <caption class="tblHeaders">' . "\n" + . ' ' . __('Buffer Pool Activity') . "\n" + . ' </caption>' . "\n" + . ' <tbody>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Read requests') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_read_requests'], + 0 + ) . "\n" + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Write requests') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_write_requests'], + 0 + ) . "\n" + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Read misses') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_reads'], + 0 + ) . "\n" + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Write waits') . '</th>' . "\n" + . ' <td class="value">' + . Util::formatNumber( + $status['Innodb_buffer_pool_wait_free'], + 0 + ) . "\n" + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Read misses in %') . '</th>' . "\n" + . ' <td class="value">' + . ($status['Innodb_buffer_pool_read_requests'] == 0 + ? '---' + : htmlspecialchars( + Util::formatNumber( + $status['Innodb_buffer_pool_reads'] * 100 + / $status['Innodb_buffer_pool_read_requests'], + 3, + 2 + ) + ) . ' %') . "\n" + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' <tr>' . "\n" + . ' <th>' . __('Write waits in %') . '</th>' . "\n" + . ' <td class="value">' + . ($status['Innodb_buffer_pool_write_requests'] == 0 + ? '---' + : htmlspecialchars( + Util::formatNumber( + $status['Innodb_buffer_pool_wait_free'] * 100 + / $status['Innodb_buffer_pool_write_requests'], + 3, + 2 + ) + ) . ' %') . "\n" + . '</td>' . "\n" + . ' </tr>' . "\n" + . ' </tbody>' . "\n" + . '</table>' . "\n"; + + return $output; + } + + /** + * returns InnoDB status + * + * @return string result of SHOW ENGINE INNODB STATUS inside pre tags + */ + public function getPageStatus() + { + return '<pre id="pre_innodb_status">' . "\n" + . htmlspecialchars( + $GLOBALS['dbi']->fetchValue('SHOW ENGINE INNODB STATUS;', 0, 'Status') + ) . "\n" + . '</pre>' . "\n"; + } + + /** + * returns string with filename for the MySQL helppage + * about this storage engine + * + * @return string mysql helppage filename + */ + public function getMysqlHelpPage() + { + return 'innodb-storage-engine'; + } + + /** + * Gets the InnoDB plugin version number + * + * @return string the version number, or empty if not running as a plugin + */ + public function getInnodbPluginVersion() + { + return $GLOBALS['dbi']->fetchValue('SELECT @@innodb_version;'); + } + + /** + * Gets the InnoDB file format + * + * (do not confuse this with phpMyAdmin's storage engine plugins!) + * + * @return string the InnoDB file format + */ + public function getInnodbFileFormat() + { + return $GLOBALS['dbi']->fetchValue( + "SHOW GLOBAL VARIABLES LIKE 'innodb_file_format';", + 0, + 1 + ); + } + + /** + * Verifies if this server supports the innodb_file_per_table feature + * + * (do not confuse this with phpMyAdmin's storage engine plugins!) + * + * @return boolean whether this feature is supported or not + */ + public function supportsFilePerTable() + { + return ( + $GLOBALS['dbi']->fetchValue( + "SHOW GLOBAL VARIABLES LIKE 'innodb_file_per_table';", + 0, + 1 + ) == 'ON' + ); + } +} + diff --git a/phpMyAdmin/libraries/classes/Engines/Memory.php b/phpMyAdmin/libraries/classes/Engines/Memory.php new file mode 100755 index 0000000..b2a8b9f --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Memory.php @@ -0,0 +1,33 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The MEMORY (HEAP) storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\StorageEngine; + +/** + * The MEMORY (HEAP) storage engine + * + * @package PhpMyAdmin-Engines + */ +class Memory extends StorageEngine +{ + /** + * Returns array with variable names dedicated to MEMORY storage engine + * + * @return array variable names + */ + public function getVariables() + { + return array( + 'max_heap_table_size' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + ); + } +} + diff --git a/phpMyAdmin/libraries/classes/Engines/Merge.php b/phpMyAdmin/libraries/classes/Engines/Merge.php new file mode 100755 index 0000000..e610c8b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Merge.php @@ -0,0 +1,20 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The MERGE storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\StorageEngine; + +/** + * The MERGE storage engine + * + * @package PhpMyAdmin-Engines + */ +class Merge extends StorageEngine +{ +} + diff --git a/phpMyAdmin/libraries/classes/Engines/MrgMyisam.php b/phpMyAdmin/libraries/classes/Engines/MrgMyisam.php new file mode 100755 index 0000000..24465b8 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/MrgMyisam.php @@ -0,0 +1,27 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The MERGE storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +/** + * The MERGE storage engine + * + * @package PhpMyAdmin-Engines + */ +class MrgMyisam extends Merge +{ + /** + * returns string with filename for the MySQL helppage + * about this storage engine + * + * @return string mysql helppage filename + */ + public function getMysqlHelpPage() + { + return 'merge-storage-engine'; + } +} diff --git a/phpMyAdmin/libraries/classes/Engines/Myisam.php b/phpMyAdmin/libraries/classes/Engines/Myisam.php new file mode 100755 index 0000000..b0341fd --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Myisam.php @@ -0,0 +1,87 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The MyISAM storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\StorageEngine; + +/** + * The MyISAM storage engine + * + * @package PhpMyAdmin-Engines + */ +class Myisam extends StorageEngine +{ + /** + * Returns array with variable names dedicated to MyISAM storage engine + * + * @return array variable names + */ + public function getVariables() + { + return array( + 'myisam_data_pointer_size' => array( + 'title' => __('Data pointer size'), + 'desc' => __( + 'The default pointer size in bytes, to be used by CREATE TABLE ' + . 'for MyISAM tables when no MAX_ROWS option is specified.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'myisam_recover_options' => array( + 'title' => __('Automatic recovery mode'), + 'desc' => __( + 'The mode for automatic recovery of crashed MyISAM tables, as ' + . 'set via the --myisam-recover server startup option.' + ), + ), + 'myisam_max_sort_file_size' => array( + 'title' => __('Maximum size for temporary sort files'), + 'desc' => __( + 'The maximum size of the temporary file MySQL is allowed to use ' + . 'while re-creating a MyISAM index (during REPAIR TABLE, ALTER ' + . 'TABLE, or LOAD DATA INFILE).' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'myisam_max_extra_sort_file_size' => array( + 'title' => __('Maximum size for temporary files on index creation'), + 'desc' => __( + 'If the temporary file used for fast MyISAM index creation ' + . 'would be larger than using the key cache by the amount ' + . 'specified here, prefer the key cache method.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'myisam_repair_threads' => array( + 'title' => __('Repair threads'), + 'desc' => __( + 'If this value is greater than 1, MyISAM table indexes are ' + . 'created in parallel (each index in its own thread) during ' + . 'the repair by sorting process.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'myisam_sort_buffer_size' => array( + 'title' => __('Sort buffer size'), + 'desc' => __( + 'The buffer that is allocated when sorting MyISAM indexes ' + . 'during a REPAIR TABLE or when creating indexes with CREATE ' + . 'INDEX or ALTER TABLE.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'myisam_stats_method' => array(), + 'delay_key_write' => array(), + 'bulk_insert_buffer_size' => array( + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'skip_external_locking' => array(), + ); + } +} + diff --git a/phpMyAdmin/libraries/classes/Engines/Ndbcluster.php b/phpMyAdmin/libraries/classes/Engines/Ndbcluster.php new file mode 100755 index 0000000..49e87ae --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Ndbcluster.php @@ -0,0 +1,53 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The NDBCLUSTER storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\StorageEngine; + +/** + * The NDBCLUSTER storage engine + * + * @package PhpMyAdmin-Engines + */ +class Ndbcluster extends StorageEngine +{ + /** + * Returns array with variable names related to NDBCLUSTER storage engine + * + * @return array variable names + */ + public function getVariables() + { + return array( + 'ndb_connectstring' => array(), + ); + } + + /** + * Returns the pattern to be used in the query for SQL variables + * related to NDBCLUSTER storage engine + * + * @return string SQL query LIKE pattern + */ + public function getVariablesLikePattern() + { + return 'ndb\\_%'; + } + + /** + * Returns string with filename for the MySQL help page + * about this storage engine + * + * @return string mysql helppage filename + */ + public function getMysqlHelpPage() + { + return 'ndbcluster'; + } +} + diff --git a/phpMyAdmin/libraries/classes/Engines/Pbxt.php b/phpMyAdmin/libraries/classes/Engines/Pbxt.php new file mode 100755 index 0000000..9be40e7 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/Pbxt.php @@ -0,0 +1,193 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The PBXT storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\Core; +use PhpMyAdmin\StorageEngine; +use PhpMyAdmin\Util; + +/** + * The PBXT storage engine + * + * @package PhpMyAdmin-Engines + */ +class Pbxt extends StorageEngine +{ + /** + * Returns array with variable names dedicated to PBXT storage engine + * + * @return array variable names + */ + public function getVariables() + { + return array( + 'pbxt_index_cache_size' => array( + 'title' => __('Index cache size'), + 'desc' => __( + 'This is the amount of memory allocated to the' + . ' index cache. Default value is 32MB. The memory' + . ' allocated here is used only for caching index pages.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_record_cache_size' => array( + 'title' => __('Record cache size'), + 'desc' => __( + 'This is the amount of memory allocated to the' + . ' record cache used to cache table data. The default' + . ' value is 32MB. This memory is used to cache changes to' + . ' the handle data (.xtd) and row pointer (.xtr) files.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_log_cache_size' => array( + 'title' => __('Log cache size'), + 'desc' => __( + 'The amount of memory allocated to the' + . ' transaction log cache used to cache on transaction log' + . ' data. The default is 16MB.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_log_file_threshold' => array( + 'title' => __('Log file threshold'), + 'desc' => __( + 'The size of a transaction log before rollover,' + . ' and a new log is created. The default value is 16MB.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_transaction_buffer_size' => array( + 'title' => __('Transaction buffer size'), + 'desc' => __( + 'The size of the global transaction log buffer' + . ' (the engine allocates 2 buffers of this size).' + . ' The default is 1MB.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_checkpoint_frequency' => array( + 'title' => __('Checkpoint frequency'), + 'desc' => __( + 'The amount of data written to the transaction' + . ' log before a checkpoint is performed.' + . ' The default value is 24MB.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_data_log_threshold' => array( + 'title' => __('Data log threshold'), + 'desc' => __( + 'The maximum size of a data log file. The default' + . ' value is 64MB. PBXT can create a maximum of 32000 data' + . ' logs, which are used by all tables. So the value of' + . ' this variable can be increased to increase the total' + . ' amount of data that can be stored in the database.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_garbage_threshold' => array( + 'title' => __('Garbage threshold'), + 'desc' => __( + 'The percentage of garbage in a data log file' + . ' before it is compacted. This is a value between 1 and' + . ' 99. The default is 50.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + 'pbxt_log_buffer_size' => array( + 'title' => __('Log buffer size'), + 'desc' => __( + 'The size of the buffer used when writing a data' + . ' log. The default is 256MB. The engine allocates one' + . ' buffer per thread, but only if the thread is required' + . ' to write a data log.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_data_file_grow_size' => array( + 'title' => __('Data file grow size'), + 'desc' => __('The grow size of the handle data (.xtd) files.'), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_row_file_grow_size' => array( + 'title' => __('Row file grow size'), + 'desc' => __('The grow size of the row pointer (.xtr) files.'), + 'type' => PMA_ENGINE_DETAILS_TYPE_SIZE, + ), + 'pbxt_log_file_count' => array( + 'title' => __('Log file count'), + 'desc' => __( + 'This is the number of transaction log files' + . ' (pbxt/system/xlog*.xt) the system will maintain. If the' + . ' number of logs exceeds this value then old logs will be' + . ' deleted, otherwise they are renamed and given the next' + . ' highest number.' + ), + 'type' => PMA_ENGINE_DETAILS_TYPE_NUMERIC, + ), + ); + } + + /** + * returns the pbxt engine specific handling for + * PMA_ENGINE_DETAILS_TYPE_SIZE variables. + * + * @param string $formatted_size the size expression (for example 8MB) + * + * @return string the formatted value and its unit + */ + public function resolveTypeSize($formatted_size) + { + if (preg_match('/^[0-9]+[a-zA-Z]+$/', $formatted_size)) { + $value = Util::extractValueFromFormattedSize( + $formatted_size + ); + } else { + $value = $formatted_size; + } + + return Util::formatByteDown($value); + } + + //-------------------- + /** + * Get information about pages + * + * @return array Information about pages + */ + public function getInfoPages() + { + $pages = array(); + $pages['Documentation'] = __('Documentation'); + + return $pages; + } + + //-------------------- + /** + * Get content of documentation page + * + * @return string + */ + public function getPageDocumentation() + { + $output = '<p>' . sprintf( + __( + 'Documentation and further information about PBXT' + . ' can be found on the %sPrimeBase XT Home Page%s.' + ), + '<a href="' . Core::linkURL('https://mariadb.com/kb/en/mariadb/about-pbxt/') + . '" rel="noopener noreferrer" target="_blank">', + '</a>' + ) + . '</p>' . "\n"; + + return $output; + } +} diff --git a/phpMyAdmin/libraries/classes/Engines/PerformanceSchema.php b/phpMyAdmin/libraries/classes/Engines/PerformanceSchema.php new file mode 100755 index 0000000..9c62704 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Engines/PerformanceSchema.php @@ -0,0 +1,29 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * The performance schema storage engine + * + * @package PhpMyAdmin-Engines + */ +namespace PhpMyAdmin\Engines; + +use PhpMyAdmin\StorageEngine; + +/** + * The performance schema storage engine + * + * @package PhpMyAdmin-Engines + */ +class PerformanceSchema extends StorageEngine +{ + /** + * Returns string with filename for the MySQL helppage + * about this storage engine + * + * @return string mysql helppage filename + */ + public function getMysqlHelpPage() + { + return 'performance-schema'; + } +} diff --git a/phpMyAdmin/libraries/classes/Error.php b/phpMyAdmin/libraries/classes/Error.php new file mode 100755 index 0000000..d156f19 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Error.php @@ -0,0 +1,515 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds class PhpMyAdmin\Error + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use Exception; +use PhpMyAdmin\Message; + +/** + * a single error + * + * @package PhpMyAdmin + */ +class Error extends Message +{ + /** + * Error types + * + * @var array + */ + static public $errortype = array ( + 0 => 'Internal error', + E_ERROR => 'Error', + E_WARNING => 'Warning', + E_PARSE => 'Parsing Error', + E_NOTICE => 'Notice', + E_CORE_ERROR => 'Core Error', + E_CORE_WARNING => 'Core Warning', + E_COMPILE_ERROR => 'Compile Error', + E_COMPILE_WARNING => 'Compile Warning', + E_USER_ERROR => 'User Error', + E_USER_WARNING => 'User Warning', + E_USER_NOTICE => 'User Notice', + E_STRICT => 'Runtime Notice', + E_DEPRECATED => 'Deprecation Notice', + E_USER_DEPRECATED => 'Deprecation Notice', + E_RECOVERABLE_ERROR => 'Catchable Fatal Error', + ); + + /** + * Error levels + * + * @var array + */ + static public $errorlevel = array ( + 0 => 'error', + E_ERROR => 'error', + E_WARNING => 'error', + E_PARSE => 'error', + E_NOTICE => 'notice', + E_CORE_ERROR => 'error', + E_CORE_WARNING => 'error', + E_COMPILE_ERROR => 'error', + E_COMPILE_WARNING => 'error', + E_USER_ERROR => 'error', + E_USER_WARNING => 'error', + E_USER_NOTICE => 'notice', + E_STRICT => 'notice', + E_DEPRECATED => 'notice', + E_USER_DEPRECATED => 'notice', + E_RECOVERABLE_ERROR => 'error', + ); + + /** + * The file in which the error occurred + * + * @var string + */ + protected $file = ''; + + /** + * The line in which the error occurred + * + * @var integer + */ + protected $line = 0; + + /** + * Holds the backtrace for this error + * + * @var array + */ + protected $backtrace = array(); + + /** + * Hide location of errors + */ + protected $hide_location = false; + + /** + * Constructor + * + * @param integer $errno error number + * @param string $errstr error message + * @param string $errfile file + * @param integer $errline line + */ + public function __construct($errno, $errstr, $errfile, $errline) + { + $this->setNumber($errno); + $this->setMessage($errstr, false); + $this->setFile($errfile); + $this->setLine($errline); + + // This function can be disabled in php.ini + if (function_exists('debug_backtrace')) { + $backtrace = @debug_backtrace(); + // remove last three calls: + // debug_backtrace(), handleError() and addError() + $backtrace = array_slice($backtrace, 3); + } else { + $backtrace = array(); + } + + $this->setBacktrace($backtrace); + } + + /** + * Process backtrace to avoid path disclossures, objects and so on + * + * @param array $backtrace backtrace + * + * @return array + */ + public static function processBacktrace(array $backtrace) + { + $result = array(); + + $members = array('line', 'function', 'class', 'type'); + + foreach ($backtrace as $idx => $step) { + /* Create new backtrace entry */ + $result[$idx] = array(); + + /* Make path relative */ + if (isset($step['file'])) { + $result[$idx]['file'] = self::relPath($step['file']); + } + + /* Store members we want */ + foreach ($members as $name) { + if (isset($step[$name])) { + $result[$idx][$name] = $step[$name]; + } + } + + /* Store simplified args */ + if (isset($step['args'])) { + foreach ($step['args'] as $key => $arg) { + $result[$idx]['args'][$key] = self::getArg($arg, $step['function']); + } + } + } + + return $result; + } + + /** + * Toggles location hiding + * + * @param boolean $hide Whether to hide + * + * @return void + */ + public function setHideLocation($hide) + { + $this->hide_location = $hide; + } + + /** + * sets PhpMyAdmin\Error::$_backtrace + * + * We don't store full arguments to avoid wakeup or memory problems. + * + * @param array $backtrace backtrace + * + * @return void + */ + public function setBacktrace(array $backtrace) + { + $this->backtrace = self::processBacktrace($backtrace); + } + + /** + * sets PhpMyAdmin\Error::$_line + * + * @param integer $line the line + * + * @return void + */ + public function setLine($line) + { + $this->line = $line; + } + + /** + * sets PhpMyAdmin\Error::$_file + * + * @param string $file the file + * + * @return void + */ + public function setFile($file) + { + $this->file = self::relPath($file); + } + + + /** + * returns unique PhpMyAdmin\Error::$hash, if not exists it will be created + * + * @return string PhpMyAdmin\Error::$hash + */ + public function getHash() + { + try { + $backtrace = serialize($this->getBacktrace()); + } catch(Exception $e) { + $backtrace = ''; + } + if ($this->hash === null) { + $this->hash = md5( + $this->getNumber() . + $this->getMessage() . + $this->getFile() . + $this->getLine() . + $backtrace + ); + } + + return $this->hash; + } + + /** + * returns PhpMyAdmin\Error::$_backtrace for first $count frames + * pass $count = -1 to get full backtrace. + * The same can be done by not passing $count at all. + * + * @param integer $count Number of stack frames. + * + * @return array PhpMyAdmin\Error::$_backtrace + */ + public function getBacktrace($count = -1) + { + if ($count != -1) { + return array_slice($this->backtrace, 0, $count); + } + return $this->backtrace; + } + + /** + * returns PhpMyAdmin\Error::$file + * + * @return string PhpMyAdmin\Error::$file + */ + public function getFile() + { + return $this->file; + } + + /** + * returns PhpMyAdmin\Error::$line + * + * @return integer PhpMyAdmin\Error::$line + */ + public function getLine() + { + return $this->line; + } + + /** + * returns type of error + * + * @return string type of error + */ + public function getType() + { + return self::$errortype[$this->getNumber()]; + } + + /** + * returns level of error + * + * @return string level of error + */ + public function getLevel() + { + return self::$errorlevel[$this->getNumber()]; + } + + /** + * returns title prepared for HTML Title-Tag + * + * @return string HTML escaped and truncated title + */ + public function getHtmlTitle() + { + return htmlspecialchars( + mb_substr($this->getTitle(), 0, 100) + ); + } + + /** + * returns title for error + * + * @return string + */ + public function getTitle() + { + return $this->getType() . ': ' . $this->getMessage(); + } + + /** + * Get HTML backtrace + * + * @return string + */ + public function getBacktraceDisplay() + { + return self::formatBacktrace( + $this->getBacktrace(), + "<br />\n", + "<br />\n" + ); + } + + /** + * return formatted backtrace field + * + * @param array $backtrace Backtrace data + * @param string $separator Arguments separator to use + * @param string $lines Lines separator to use + * + * @return string formatted backtrace + */ + public static function formatBacktrace(array $backtrace, $separator, $lines) + { + $retval = ''; + + foreach ($backtrace as $step) { + if (isset($step['file']) && isset($step['line'])) { + $retval .= self::relPath($step['file']) + . '#' . $step['line'] . ': '; + } + if (isset($step['class'])) { + $retval .= $step['class'] . $step['type']; + } + $retval .= self::getFunctionCall($step, $separator); + $retval .= $lines; + } + + return $retval; + } + + /** + * Formats function call in a backtrace + * + * @param array $step backtrace step + * @param string $separator Arguments separator to use + * + * @return string + */ + public static function getFunctionCall(array $step, $separator) + { + $retval = $step['function'] . '('; + if (isset($step['args'])) { + if (count($step['args']) > 1) { + $retval .= $separator; + foreach ($step['args'] as $arg) { + $retval .= "\t"; + $retval .= $arg; + $retval .= ',' . $separator; + } + } elseif (count($step['args']) > 0) { + foreach ($step['args'] as $arg) { + $retval .= $arg; + } + } + } + $retval .= ')'; + return $retval; + } + + /** + * Get a single function argument + * + * if $function is one of include/require + * the $arg is converted to a relative path + * + * @param string $arg argument to process + * @param string $function function name + * + * @return string + */ + public static function getArg($arg, $function) + { + $retval = ''; + $include_functions = array( + 'include', + 'include_once', + 'require', + 'require_once', + ); + $connect_functions = array( + 'mysql_connect', + 'mysql_pconnect', + 'mysqli_connect', + 'mysqli_real_connect', + 'connect', + '_realConnect' + ); + + if (in_array($function, $include_functions)) { + $retval .= self::relPath($arg); + } elseif (in_array($function, $connect_functions) + && getType($arg) === 'string' + ) { + $retval .= getType($arg) . ' ********'; + } elseif (is_scalar($arg)) { + $retval .= getType($arg) . ' ' + . htmlspecialchars(var_export($arg, true)); + } elseif (is_object($arg)) { + $retval .= '<Class:' . get_class($arg) . '>'; + } else { + $retval .= getType($arg); + } + + return $retval; + } + + /** + * Gets the error as string of HTML + * + * @return string + */ + public function getDisplay() + { + $this->isDisplayed(true); + $retval = '<div class="' . $this->getLevel() . '">'; + if (! $this->isUserError()) { + $retval .= '<strong>' . $this->getType() . '</strong>'; + $retval .= ' in ' . $this->getFile() . '#' . $this->getLine(); + $retval .= "<br />\n"; + } + $retval .= $this->getMessage(); + if (! $this->isUserError()) { + $retval .= "<br />\n"; + $retval .= "<br />\n"; + $retval .= "<strong>Backtrace</strong><br />\n"; + $retval .= "<br />\n"; + $retval .= $this->getBacktraceDisplay(); + } + $retval .= '</div>'; + + return $retval; + } + + /** + * whether this error is a user error + * + * @return boolean + */ + public function isUserError() + { + return $this->hide_location || + ($this->getNumber() & (E_USER_WARNING | E_USER_ERROR | E_USER_NOTICE | E_USER_DEPRECATED)); + } + + /** + * return short relative path to phpMyAdmin basedir + * + * prevent path disclosure in error message, + * and make users feel safe to submit error reports + * + * @param string $path path to be shorten + * + * @return string shortened path + */ + public static function relPath($path) + { + $dest = @realpath($path); + + /* Probably affected by open_basedir */ + if ($dest === false) { + return basename($path); + } + + $Ahere = explode( + DIRECTORY_SEPARATOR, + realpath(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..') + ); + $Adest = explode(DIRECTORY_SEPARATOR, $dest); + + $result = '.'; + // && count ($Adest)>0 && count($Ahere)>0 ) + while (implode(DIRECTORY_SEPARATOR, $Adest) != implode(DIRECTORY_SEPARATOR, $Ahere)) { + if (count($Ahere) > count($Adest)) { + array_pop($Ahere); + $result .= DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..'; + } else { + array_pop($Adest); + } + } + $path = $result . str_replace(implode(DIRECTORY_SEPARATOR, $Adest), '', $dest); + return str_replace( + DIRECTORY_SEPARATOR . PATH_SEPARATOR, + DIRECTORY_SEPARATOR, + $path + ); + } +} diff --git a/phpMyAdmin/libraries/classes/ErrorHandler.php b/phpMyAdmin/libraries/classes/ErrorHandler.php new file mode 100755 index 0000000..26b51b6 --- /dev/null +++ b/phpMyAdmin/libraries/classes/ErrorHandler.php @@ -0,0 +1,595 @@ +<?php +/* vim: set expandtab sw=4 ts=4 sts=4: */ +/** + * Holds class PhpMyAdmin\ErrorHandler + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin; + +use PhpMyAdmin\Error; +use PhpMyAdmin\Response; +use PhpMyAdmin\Url; + +/** + * handling errors + * + * @package PhpMyAdmin + */ +class ErrorHandler +{ + /** + * holds errors to be displayed or reported later ... + * + * @var Error[] + */ + protected $errors = array(); + + /** + * Hide location of errors + */ + protected $hide_location = false; + + /** + * Initial error reporting state + */ + protected $error_reporting = 0; + + /** + * Constructor - set PHP error handler + * + */ + public function __construct() + { + /** + * Do not set ourselves as error handler in case of testsuite. + * + * This behavior is not tested there and breaks other tests as they + * rely on PHPUnit doing it's own error handling which we break here. + */ + if (!defined('TESTSUITE')) { + set_error_handler(array($this, 'handleError')); + } + if (function_exists('error_reporting')) { + $this->error_reporting = error_reporting(); + } + } + + /** + * Destructor + * + * stores errors in session + * + */ + public function __destruct() + { + if (isset($_SESSION)) { + if (! isset($_SESSION['errors'])) { + $_SESSION['errors'] = array(); + } + + // remember only not displayed errors + foreach ($this->errors as $key => $error) { + /** + * We don't want to store all errors here as it would + * explode user session. + */ + if (count($_SESSION['errors']) >= 10) { + $error = new Error( + 0, + __('Too many error messages, some are not displayed.'), + __FILE__, + __LINE__ + ); + $_SESSION['errors'][$error->getHash()] = $error; + break; + } elseif (($error instanceof Error) + && ! $error->isDisplayed() + ) { + $_SESSION['errors'][$key] = $error; + } + } + } + } + + /** + * Toggles location hiding + * + * @param boolean $hide Whether to hide + * + * @return void + */ + public function setHideLocation($hide) + { + $this->hide_location = $hide; + } + + /** + * returns array with all errors + * + * @param bool $check Whether to check for session errors + * + * @return Error[] + */ + public function getErrors($check=true) + { + if ($check) { + $this->checkSavedErrors(); + } + return $this->errors; + } + + /** + * returns the errors occurred in the current run only. + * Does not include the errors saved in the SESSION + * + * @return Error[] + */ + public function getCurrentErrors() + { + return $this->errors; + } + + /** + * Pops recent errors from the storage + * + * @param int $count Old error count + * + * @return Error[] + */ + public function sliceErrors($count) + { + $errors = $this->getErrors(false); + $this->errors = array_splice($errors, 0, $count); + return array_splice($errors, $count); + } + + /** + * Error handler - called when errors are triggered/occurred + * + * This calls the addError() function, escaping the error string + * Ignores the errors wherever Error Control Operator (@) is used. + * + * @param integer $errno error number + * @param string $errstr error string + * @param string $errfile error file + * @param integer $errline error line + * + * @return void + */ + public function handleError($errno, $errstr, $errfile, $errline) + { + if (function_exists('error_reporting')) { + /** + * Check if Error Control Operator (@) was used, but still show + * user errors even in this case. + */ + if (error_reporting() == 0 && + $this->error_reporting != 0 && + ($errno & (E_USER_WARNING | E_USER_ERROR | E_USER_NOTICE | E_USER_DEPRECATED)) == 0 + ) { + return; + } + } else { + if (($errno & (E_USER_WARNING | E_USER_ERROR | E_USER_NOTICE | E_USER_DEPRECATED)) == 0) { + return; + } + } + + $this->addError($errstr, $errno, $errfile, $errline, true); + } + + /** + * Add an error; can also be called directly (with or without escaping) + * + * The following error types cannot be handled with a user defined function: + * E_ERROR, E_PARSE, E_CORE_ERROR, E_CORE_WARNING, E_COMPILE_ERROR, + * E_COMPILE_WARNING, + * and most of E_STRICT raised in the file where set_error_handler() is called. + * + * Do not use the context parameter as we want to avoid storing the + * complete $GLOBALS inside $_SESSION['errors'] + * + * @param string $errstr error string + * @param integer $errno error number + * @param string $errfile error file + * @param integer $errline error line + * @param boolean $escape whether to escape the error string + * + * @return void + */ + public function addError($errstr, $errno, $errfile, $errline, $escape = true) + { + if ($escape) { + $errstr = htmlspecialchars($errstr); + } + // create error object + $error = new Error( + $errno, + $errstr, + $errfile, + $errline + ); + $error->setHideLocation($this->hide_location); + + // do not repeat errors + $this->errors[$error->getHash()] = $error; + + switch ($error->getNumber()) { + case E_STRICT: + case E_DEPRECATED: + case E_NOTICE: + case E_WARNING: + case E_CORE_WARNING: + case E_COMPILE_WARNING: + case E_RECOVERABLE_ERROR: + /* Avoid rendering BB code in PHP errors */ + $error->setBBCode(false); + break; + case E_USER_NOTICE: + case E_USER_WARNING: + case E_USER_ERROR: + case E_USER_DEPRECATED: + // just collect the error + // display is called from outside + break; + case E_ERROR: + case E_PARSE: + case E_CORE_ERROR: + case E_COMPILE_ERROR: + default: + // FATAL error, display it and exit + $this->dispFatalError($error); + exit; + } + } + + /** + * trigger a custom error + * + * @param string $errorInfo error message + * @param integer $errorNumber error number + * + * @return void + */ + public function triggerError($errorInfo, $errorNumber = null) + { + // we could also extract file and line from backtrace + // and call handleError() directly + trigger_error($errorInfo, $errorNumber); + } + + /** + * display fatal error and exit + * + * @param Error $error the error + * + * @return void + */ + protected function dispFatalError($error) + { + if (! headers_sent()) { + $this->dispPageStart($error); + } + $error->display(); + $this->dispPageEnd(); + exit; + } + + /** + * Displays user errors not displayed + * + * @return void + */ + public function dispUserErrors() + { + echo $this->getDispUserErrors(); + } + + /** + * Renders user errors not displayed + * + * @return string + */ + public function getDispUserErrors() + { + $retval = ''; + foreach ($this->getErrors() as $error) { + if ($error->isUserError() && ! $error->isDisplayed()) { + $retval .= $error->getDisplay(); + } + } + return $retval; + } + + /** + * display HTML header + * + * @param Error $error the error + * + * @return void + */ + protected function dispPageStart($error = null) + { + Response::getInstance()->disable(); + echo '<html><head><title>'; + if ($error) { + echo $error->getTitle(); + } else { + echo 'phpMyAdmin error reporting page'; + } + echo ''; + } + + /** + * display HTML footer + * + * @return void + */ + protected function dispPageEnd() + { + echo ''; + } + + /** + * renders errors not displayed + * + * @return string + */ + public function getDispErrors() + { + $retval = ''; + // display errors if SendErrorReports is set to 'ask'. + if ($GLOBALS['cfg']['SendErrorReports'] != 'never') { + foreach ($this->getErrors() as $error) { + if (! $error->isDisplayed()) { + $retval .= $error->getDisplay(); + } + } + } else { + $retval .= $this->getDispUserErrors(); + } + // if preference is not 'never' and + // there are 'actual' errors to be reported + if ($GLOBALS['cfg']['SendErrorReports'] != 'never' + && $this->countErrors() != $this->countUserErrors() + ) { + // add report button. + $retval .= '
      'php', + 'send_error_report' => '1', + 'server' => $GLOBALS['server'], + )); + $retval .= '' + . '' + . ''; + + if ($GLOBALS['cfg']['SendErrorReports'] == 'ask') { + // add ignore buttons + $retval .= ''; + } + $retval .= ''; + $retval .= '
      '; + } + return $retval; + } + + /** + * displays errors not displayed + * + * @return void + */ + public function dispErrors() + { + echo $this->getDispErrors(); + } + + /** + * look in session for saved errors + * + * @return void + */ + protected function checkSavedErrors() + { + if (isset($_SESSION['errors'])) { + + // restore saved errors + foreach ($_SESSION['errors'] as $hash => $error) { + if ($error instanceof Error && ! isset($this->errors[$hash])) { + $this->errors[$hash] = $error; + } + } + + // delete stored errors + $_SESSION['errors'] = array(); + unset($_SESSION['errors']); + } + } + + /** + * return count of errors + * + * @param bool $check Whether to check for session errors + * + * @return integer number of errors occurred + */ + public function countErrors($check=true) + { + return count($this->getErrors($check)); + } + + /** + * return count of user errors + * + * @return integer number of user errors occurred + */ + public function countUserErrors() + { + $count = 0; + if ($this->countErrors()) { + foreach ($this->getErrors() as $error) { + if ($error->isUserError()) { + $count++; + } + } + } + + return $count; + } + + /** + * whether use errors occurred or not + * + * @return boolean + */ + public function hasUserErrors() + { + return (bool) $this->countUserErrors(); + } + + /** + * whether errors occurred or not + * + * @return boolean + */ + public function hasErrors() + { + return (bool) $this->countErrors(); + } + + /** + * number of errors to be displayed + * + * @return integer number of errors to be displayed + */ + public function countDisplayErrors() + { + if ($GLOBALS['cfg']['SendErrorReports'] != 'never') { + return $this->countErrors(); + } + + return $this->countUserErrors(); + } + + /** + * whether there are errors to display or not + * + * @return boolean + */ + public function hasDisplayErrors() + { + return (bool) $this->countDisplayErrors(); + } + + /** + * Deletes previously stored errors in SESSION. + * Saves current errors in session as previous errors. + * Required to save current errors in case 'ask' + * + * @return void + */ + public function savePreviousErrors() + { + unset($_SESSION['prev_errors']); + $_SESSION['prev_errors'] = $GLOBALS['error_handler']->getCurrentErrors(); + } + + /** + * Function to check if there are any errors to be prompted. + * Needed because user warnings raised are + * also collected by global error handler. + * This distinguishes between the actual errors + * and user errors raised to warn user. + * + *@return boolean true if there are errors to be "prompted", false otherwise + */ + public function hasErrorsForPrompt() + { + return ( + $GLOBALS['cfg']['SendErrorReports'] != 'never' + && $this->countErrors() != $this->countUserErrors() + ); + } + + /** + * Function to report all the collected php errors. + * Must be called at the end of each script + * by the $GLOBALS['error_handler'] only. + * + * @return void + */ + public function reportErrors() + { + // if there're no actual errors, + if (!$this->hasErrors() + || $this->countErrors() == $this->countUserErrors() + ) { + // then simply return. + return; + } + // Delete all the prev_errors in session & store new prev_errors in session + $this->savePreviousErrors(); + $response = Response::getInstance(); + $jsCode = ''; + if ($GLOBALS['cfg']['SendErrorReports'] == 'always') { + if ($response->isAjax()) { + // set flag for automatic report submission. + $response->addJSON('_sendErrorAlways', '1'); + } else { + // send the error reports asynchronously & without asking user + $jsCode .= '$("#pma_report_errors_form").submit();' + . 'PMA_ajaxShowMessage( + PMA_messages["phpErrorsBeingSubmitted"], false + );'; + // js code to appropriate focusing, + $jsCode .= '$("html, body").animate({ + scrollTop:$(document).height() + }, "slow");'; + } + } elseif ($GLOBALS['cfg']['SendErrorReports'] == 'ask') { + //ask user whether to submit errors or not. + if (!$response->isAjax()) { + // js code to show appropriate msgs, event binding & focusing. + $jsCode = 'PMA_ajaxShowMessage(PMA_messages["phpErrorsFound"]);' + . '$("#pma_ignore_errors_popup").bind("click", function() { + PMA_ignorePhpErrors() + });' + . '$("#pma_ignore_all_errors_popup").bind("click", + function() { + PMA_ignorePhpErrors(false) + });' + . '$("#pma_ignore_errors_bottom").bind("click", function(e) { + e.preventDefault(); + PMA_ignorePhpErrors() + });' + . '$("#pma_ignore_all_errors_bottom").bind("click", + function(e) { + e.preventDefault(); + PMA_ignorePhpErrors(false) + });' + . '$("html, body").animate({ + scrollTop:$(document).height() + }, "slow");'; + } + } + // The errors are already sent from the response. + // Just focus on errors division upon load event. + $response->getFooter()->getScripts()->addCode($jsCode); + } +} diff --git a/phpMyAdmin/libraries/classes/ErrorReport.php b/phpMyAdmin/libraries/classes/ErrorReport.php new file mode 100755 index 0000000..3abef48 --- /dev/null +++ b/phpMyAdmin/libraries/classes/ErrorReport.php @@ -0,0 +1,275 @@ +httpRequest = $httpRequest; + $this->submissionUrl = 'https://reports.phpmyadmin.net/incidents/create'; + $this->relation = new Relation(); + } + + /** + * Returns the pretty printed error report data collected from the + * current configuration or from the request parameters sent by the + * error reporting js code. + * + * @return string the report + */ + private function getPrettyData() + { + $report = $this->getData(); + + return json_encode($report, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES); + } + + /** + * Returns the error report data collected from the current configuration or + * from the request parameters sent by the error reporting js code. + * + * @param string $exceptionType whether exception is 'js' or 'php' + * + * @return array error report if success, Empty Array otherwise + */ + public function getData($exceptionType = 'js') + { + /** @var Config $PMA_Config */ + global $PMA_Config; + + $relParams = $this->relation->getRelationsParam(); + // common params for both, php & js exceptions + $report = [ + "pma_version" => PMA_VERSION, + "browser_name" => PMA_USR_BROWSER_AGENT, + "browser_version" => PMA_USR_BROWSER_VER, + "user_os" => PMA_USR_OS, + "server_software" => $_SERVER['SERVER_SOFTWARE'], + "user_agent_string" => $_SERVER['HTTP_USER_AGENT'], + "locale" => $PMA_Config->getCookie('pma_lang'), + "configuration_storage" => + is_null($relParams['db']) ? "disabled" : "enabled", + "php_version" => phpversion() + ]; + + if ($exceptionType == 'js') { + if (empty($_POST['exception'])) { + return []; + } + $exception = $_POST['exception']; + $exception["stack"] = $this->translateStacktrace($exception["stack"]); + + if (isset($exception["url"])) { + list($uri, $scriptName) = $this->sanitizeUrl($exception["url"]); + $exception["uri"] = $uri; + $report["script_name"] = $scriptName; + unset($exception["url"]); + } else if (isset($_POST["url"])) { + list($uri, $scriptName) = $this->sanitizeUrl($_POST["url"]); + $exception["uri"] = $uri; + $report["script_name"] = $scriptName; + unset($_POST["url"]); + } else { + $report["script_name"] = null; + } + + $report["exception_type"] = 'js'; + $report["exception"] = $exception; + if (isset($_POST['microhistory'])) { + $report["microhistory"] = $_POST['microhistory']; + } + + if (! empty($_POST['description'])) { + $report['steps'] = $_POST['description']; + } + } elseif ($exceptionType == 'php') { + $errors = []; + // create php error report + $i = 0; + if (!isset($_SESSION['prev_errors']) + || $_SESSION['prev_errors'] == '' + ) { + return []; + } + foreach ($_SESSION['prev_errors'] as $errorObj) { + /* @var $errorObj PhpMyAdmin\Error */ + if ($errorObj->getLine() + && $errorObj->getType() + && $errorObj->getNumber() != E_USER_WARNING + ) { + $errors[$i++] = [ + "lineNum" => $errorObj->getLine(), + "file" => $errorObj->getFile(), + "type" => $errorObj->getType(), + "msg" => $errorObj->getOnlyMessage(), + "stackTrace" => $errorObj->getBacktrace(5), + "stackhash" => $errorObj->getHash() + ]; + } + } + + // if there were no 'actual' errors to be submitted. + if ($i==0) { + return []; // then return empty array + } + $report["exception_type"] = 'php'; + $report["errors"] = $errors; + } else { + return []; + } + + return $report; + } + + /** + * Sanitize a url to remove the identifiable host name and extract the + * current script name from the url fragment + * + * It returns two things in an array. The first is the uri without the + * hostname and identifying query params. The second is the name of the + * php script in the url + * + * @param string $url the url to sanitize + * + * @return array the uri and script name + */ + private function sanitizeUrl($url) + { + $components = parse_url($url); + if (isset($components["fragment"]) + && preg_match("", $components["fragment"], $matches) + ) { + $uri = str_replace($matches[0], "", $components["fragment"]); + $url = "https://example.com/" . $uri; + $components = parse_url($url); + } + + // get script name + preg_match("<([a-zA-Z\-_\d\.]*\.php|js\/[a-zA-Z\-_\d\/\.]*\.js)$>", $components["path"], $matches); + if (count($matches) < 2) { + $scriptName = 'index.php'; + } else { + $scriptName = $matches[1]; + } + + // remove deployment specific details to make uri more generic + if (isset($components["query"])) { + parse_str($components["query"], $queryArray); + unset($queryArray["db"]); + unset($queryArray["table"]); + unset($queryArray["token"]); + unset($queryArray["server"]); + unset($queryArray["eq"]); + $query = http_build_query($queryArray); + } else { + $query = ''; + } + + $uri = $scriptName . "?" . $query; + return [$uri, $scriptName]; + } + + /** + * Sends report data to the error reporting server + * + * @param array $report the report info to be sent + * + * @return string|null|bool the reply of the server + */ + public function send(array $report) + { + $response = $this->httpRequest->create( + $this->submissionUrl, + "POST", + false, + json_encode($report), + "Content-Type: application/json" + ); + return $response; + } + + /** + * Translates the cumulative line numbers in the stack trace as well as sanitize + * urls and trim long lines in the context + * + * @param array $stack the stack trace + * + * @return array $stack the modified stack trace + */ + private function translateStacktrace(array $stack) + { + foreach ($stack as &$level) { + foreach ($level["context"] as &$line) { + if (mb_strlen($line) > 80) { + $line = mb_substr($line, 0, 75) . "//..."; + } + } + list($uri, $scriptName) = $this->sanitizeUrl($level["url"]); + $level["uri"] = $uri; + $level["scriptname"] = $scriptName; + unset($level["url"]); + } + unset($level); + return $stack; + } + + /** + * Generates the error report form to collect user description and preview the + * report before being sent + * + * @return string the form + */ + public function getForm() + { + $datas = [ + 'report_data' => $this->getPrettyData(), + 'hidden_inputs' => Url::getHiddenInputs(), + 'hidden_fields' => null, + ]; + + $reportData = $this->getData(); + if (!empty($reportData)) { + $datas['hidden_fields'] = Url::getHiddenFields($reportData); + } + + return Template::get('error/report_form')->render($datas); + } +} diff --git a/phpMyAdmin/libraries/classes/Export.php b/phpMyAdmin/libraries/classes/Export.php new file mode 100755 index 0000000..affcc00 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Export.php @@ -0,0 +1,1101 @@ += 43; // see bug #4942 + + if (function_exists('gzencode') + && ((! ini_get('zlib.output_compression') + && ! self::isGzHandlerEnabled()) + || $GLOBALS['save_on_server'] + || $chromeAndGreaterThan43) + ) { + return true; + } + + return false; + } + + /** + * Output handler for all exports, if needed buffering, it stores data into + * $dump_buffer, otherwise it prints them out. + * + * @param string $line the insert statement + * + * @return bool Whether output succeeded + */ + public static function outputHandler($line) + { + global $time_start, $dump_buffer, $dump_buffer_len, $save_filename; + + // Kanji encoding convert feature + if ($GLOBALS['output_kanji_conversion']) { + $line = Encoding::kanjiStrConv( + $line, + $GLOBALS['knjenc'], + isset($GLOBALS['xkana']) ? $GLOBALS['xkana'] : '' + ); + } + + // If we have to buffer data, we will perform everything at once at the end + if ($GLOBALS['buffer_needed']) { + + $dump_buffer .= $line; + if ($GLOBALS['onfly_compression']) { + + $dump_buffer_len += strlen($line); + + if ($dump_buffer_len > $GLOBALS['memory_limit']) { + if ($GLOBALS['output_charset_conversion']) { + $dump_buffer = Encoding::convertString( + 'utf-8', + $GLOBALS['charset'], + $dump_buffer + ); + } + if ($GLOBALS['compression'] == 'gzip' + && self::gzencodeNeeded() + ) { + // as a gzipped file + // without the optional parameter level because it bugs + $dump_buffer = gzencode($dump_buffer); + } + if ($GLOBALS['save_on_server']) { + $write_result = @fwrite($GLOBALS['file_handle'], $dump_buffer); + // Here, use strlen rather than mb_strlen to get the length + // in bytes to compare against the number of bytes written. + if ($write_result != strlen($dump_buffer)) { + $GLOBALS['message'] = Message::error( + __('Insufficient space to save the file %s.') + ); + $GLOBALS['message']->addParam($save_filename); + return false; + } + } else { + echo $dump_buffer; + } + $dump_buffer = ''; + $dump_buffer_len = 0; + } + } else { + $time_now = time(); + if ($time_start >= $time_now + 30) { + $time_start = $time_now; + header('X-pmaPing: Pong'); + } // end if + } + } else { + if ($GLOBALS['asfile']) { + if ($GLOBALS['output_charset_conversion']) { + $line = Encoding::convertString( + 'utf-8', + $GLOBALS['charset'], + $line + ); + } + if ($GLOBALS['save_on_server'] && mb_strlen($line) > 0) { + $write_result = @fwrite($GLOBALS['file_handle'], $line); + // Here, use strlen rather than mb_strlen to get the length + // in bytes to compare against the number of bytes written. + if (! $write_result + || $write_result != strlen($line) + ) { + $GLOBALS['message'] = Message::error( + __('Insufficient space to save the file %s.') + ); + $GLOBALS['message']->addParam($save_filename); + return false; + } + $time_now = time(); + if ($time_start >= $time_now + 30) { + $time_start = $time_now; + header('X-pmaPing: Pong'); + } // end if + } else { + // We export as file - output normally + echo $line; + } + } else { + // We export as html - replace special chars + echo htmlspecialchars($line); + } + } + return true; + } // end of the 'self::outputHandler()' function + + /** + * Returns HTML containing the footer for a displayed export + * + * @param string $back_button the link for going Back + * @param string $refreshButton the link for refreshing page + * + * @return string $html the HTML output + */ + public static function getHtmlForDisplayedExportFooter($back_button, $refreshButton) + { + /** + * Close the html tags and add the footers for on-screen export + */ + $html = '' + . ' ' + . '
      ' + // bottom back button + . $back_button + . $refreshButton + . '
    • ' + . '' . "\n"; + return $html; + } + + /** + * Computes the memory limit for export + * + * @return int $memory_limit the memory limit + */ + public static function getMemoryLimit() + { + $memory_limit = trim(ini_get('memory_limit')); + $memory_limit_num = (int)substr($memory_limit, 0, -1); + $lowerLastChar = strtolower(substr($memory_limit, -1)); + // 2 MB as default + if (empty($memory_limit) || '-1' == $memory_limit) { + $memory_limit = 2 * 1024 * 1024; + } elseif ($lowerLastChar == 'm') { + $memory_limit = $memory_limit_num * 1024 * 1024; + } elseif ($lowerLastChar == 'k') { + $memory_limit = $memory_limit_num * 1024; + } elseif ($lowerLastChar == 'g') { + $memory_limit = $memory_limit_num * 1024 * 1024 * 1024; + } else { + $memory_limit = (int)$memory_limit; + } + + // Some of memory is needed for other things and as threshold. + // During export I had allocated (see memory_get_usage function) + // approx 1.2MB so this comes from that. + if ($memory_limit > 1500000) { + $memory_limit -= 1500000; + } + + // Some memory is needed for compression, assume 1/3 + $memory_limit /= 8; + return $memory_limit; + } + + /** + * Return the filename and MIME type for export file + * + * @param string $export_type type of export + * @param string $remember_template whether to remember template + * @param ExportPlugin $export_plugin the export plugin + * @param string $compression compression asked + * @param string $filename_template the filename template + * + * @return string[] the filename template and mime type + */ + public static function getFilenameAndMimetype( + $export_type, $remember_template, $export_plugin, $compression, + $filename_template + ) { + if ($export_type == 'server') { + if (! empty($remember_template)) { + $GLOBALS['PMA_Config']->setUserValue( + 'pma_server_filename_template', + 'Export/file_template_server', + $filename_template + ); + } + } elseif ($export_type == 'database') { + if (! empty($remember_template)) { + $GLOBALS['PMA_Config']->setUserValue( + 'pma_db_filename_template', + 'Export/file_template_database', + $filename_template + ); + } + } else { + if (! empty($remember_template)) { + $GLOBALS['PMA_Config']->setUserValue( + 'pma_table_filename_template', + 'Export/file_template_table', + $filename_template + ); + } + } + $filename = Util::expandUserString($filename_template); + // remove dots in filename (coming from either the template or already + // part of the filename) to avoid a remote code execution vulnerability + $filename = Sanitize::sanitizeFilename($filename, $replaceDots = true); + + // Grab basic dump extension and mime type + // Check if the user already added extension; + // get the substring where the extension would be if it was included + $extension_start_pos = mb_strlen($filename) - mb_strlen( + $export_plugin->getProperties()->getExtension() + ) - 1; + $user_extension = mb_substr( + $filename, $extension_start_pos, mb_strlen($filename) + ); + $required_extension = "." . $export_plugin->getProperties()->getExtension(); + if (mb_strtolower($user_extension) != $required_extension) { + $filename .= $required_extension; + } + $mime_type = $export_plugin->getProperties()->getMimeType(); + + // If dump is going to be compressed, set correct mime_type and add + // compression to extension + if ($compression == 'gzip') { + $filename .= '.gz'; + $mime_type = 'application/x-gzip'; + } elseif ($compression == 'zip') { + $filename .= '.zip'; + $mime_type = 'application/zip'; + } + return array($filename, $mime_type); + } + + /** + * Open the export file + * + * @param string $filename the export filename + * @param boolean $quick_export whether it's a quick export or not + * + * @return array the full save filename, possible message and the file handle + */ + public static function openFile($filename, $quick_export) + { + $file_handle = null; + $message = ''; + $doNotSaveItOver = true; + + if(isset($_POST['quick_export_onserver_overwrite'])) { + $doNotSaveItOver = $_POST['quick_export_onserver_overwrite'] != 'saveitover'; + } + + $save_filename = Util::userDir($GLOBALS['cfg']['SaveDir']) + . preg_replace('@[/\\\\]@', '_', $filename); + + if (@file_exists($save_filename) + && ((! $quick_export && empty($_POST['onserver_overwrite'])) + || ($quick_export + && $doNotSaveItOver)) + ) { + $message = Message::error( + __( + 'File %s already exists on server, ' + . 'change filename or check overwrite option.' + ) + ); + $message->addParam($save_filename); + } elseif (@is_file($save_filename) && ! @is_writable($save_filename)) { + $message = Message::error( + __( + 'The web server does not have permission ' + . 'to save the file %s.' + ) + ); + $message->addParam($save_filename); + } elseif (! $file_handle = @fopen($save_filename, 'w')) { + $message = Message::error( + __( + 'The web server does not have permission ' + . 'to save the file %s.' + ) + ); + $message->addParam($save_filename); + } + return array($save_filename, $message, $file_handle); + } + + /** + * Close the export file + * + * @param resource $file_handle the export file handle + * @param string $dump_buffer the current dump buffer + * @param string $save_filename the export filename + * + * @return Message $message a message object (or empty string) + */ + public static function closeFile($file_handle, $dump_buffer, $save_filename) + { + $write_result = @fwrite($file_handle, $dump_buffer); + fclose($file_handle); + // Here, use strlen rather than mb_strlen to get the length + // in bytes to compare against the number of bytes written. + if (strlen($dump_buffer) > 0 + && (! $write_result || $write_result != strlen($dump_buffer)) + ) { + $message = new Message( + __('Insufficient space to save the file %s.'), + Message::ERROR, + array($save_filename) + ); + } else { + $message = new Message( + __('Dump has been saved to file %s.'), + Message::SUCCESS, + array($save_filename) + ); + } + return $message; + } + + /** + * Compress the export buffer + * + * @param array|string $dump_buffer the current dump buffer + * @param string $compression the compression mode + * @param string $filename the filename + * + * @return object $message a message object (or empty string) + */ + public static function compress($dump_buffer, $compression, $filename) + { + if ($compression == 'zip' && function_exists('gzcompress')) { + $zipExtension = new ZipExtension(); + $filename = substr($filename, 0, -4); // remove extension (.zip) + $dump_buffer = $zipExtension->createFile($dump_buffer, $filename); + } elseif ($compression == 'gzip' && self::gzencodeNeeded()) { + // without the optional parameter level because it bugs + $dump_buffer = gzencode($dump_buffer); + } + return $dump_buffer; + } + + /** + * Saves the dump_buffer for a particular table in an array + * Used in separate files export + * + * @param string $object_name the name of current object to be stored + * @param boolean $append optional boolean to append to an existing index or not + * + * @return void + */ + public static function saveObjectInBuffer($object_name, $append = false) + { + + global $dump_buffer_objects, $dump_buffer, $dump_buffer_len; + + if (! empty($dump_buffer)) { + if ($append && isset($dump_buffer_objects[$object_name])) { + $dump_buffer_objects[$object_name] .= $dump_buffer; + } else { + $dump_buffer_objects[$object_name] = $dump_buffer; + } + } + + // Re - initialize + $dump_buffer = ''; + $dump_buffer_len = 0; + + } + + /** + * Returns HTML containing the header for a displayed export + * + * @param string $export_type the export type + * @param string $db the database name + * @param string $table the table name + * + * @return string[] the generated HTML and back button + */ + public static function getHtmlForDisplayedExportHeader($export_type, $db, $table) + { + $html = '
      '; + + /** + * Displays a back button with all the $_POST data in the URL + * (store in a variable to also display after the textarea) + */ + $back_button = '

      [ ' . __('Back') . ' ]

      '; + $html .= '
      '; + $html .= $back_button; + $refreshButton = '
      '; + $refreshButton .= '[ '. __('Refresh') .' ]'; + foreach($_POST as $name => $value) { + if (is_array($value)) { + foreach($value as $val) { + $refreshButton .= ''; + } + } + else { + $refreshButton .= ''; + } + } + $refreshButton .= '
      '; + $html .= $refreshButton + . '
      ' + . '
      ' + . ''; + + return $html_output; + } + + /** + * Get HTML for enum type + * + * @param array $column description of column in given table + * @param string $backup_field hidden input field + * @param string $column_name_appendix the name attribute + * @param array $extracted_columnspec associative array containing type, + * spec_in_brackets and possibly + * enum_set_values (another array) + * @param string $onChangeClause onchange clause for fields + * @param integer $tabindex tab index + * @param integer $tabindex_for_value offset for the values tabindex + * @param integer $idindex id index + * @param mixed $data data to edit + * @param boolean $readOnly is column read only or not + * + * @return string an html snippet + */ + private function getPmaTypeEnum( + array $column, + $backup_field, + $column_name_appendix, + array $extracted_columnspec, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $data, + $readOnly + ) { + $html_output = ''; + if (! isset($column['values'])) { + $column['values'] = $this->getColumnEnumValues( + $column, + $extracted_columnspec + ); + } + $column_enum_values = $column['values']; + $html_output .= ''; + $html_output .= "\n" . ' ' . $backup_field . "\n"; + if (mb_strlen($column['Type']) > 20) { + $html_output .= $this->getDropDownDependingOnLength( + $column, + $column_name_appendix, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $data, + $column_enum_values, + $readOnly + ); + } else { + $html_output .= $this->getRadioButtonDependingOnLength( + $column_name_appendix, + $onChangeClause, + $tabindex, + $column, + $tabindex_for_value, + $idindex, + $data, + $column_enum_values, + $readOnly + ); + } + return $html_output; + } + + /** + * Get column values + * + * @param array $column description of column in given table + * @param array $extracted_columnspec associative array containing type, + * spec_in_brackets and possibly enum_set_values + * (another array) + * + * @return array column values as an associative array + */ + private function getColumnEnumValues(array $column, array $extracted_columnspec) + { + $column['values'] = array(); + foreach ($extracted_columnspec['enum_set_values'] as $val) { + $column['values'][] = array( + 'plain' => $val, + 'html' => htmlspecialchars($val), + ); + } + return $column['values']; + } + + /** + * Get HTML drop down for more than 20 string length + * + * @param array $column description of column in given table + * @param string $column_name_appendix the name attribute + * @param string $onChangeClause onchange clause for fields + * @param integer $tabindex tab index + * @param integer $tabindex_for_value offset for the values tabindex + * @param integer $idindex id index + * @param string $data data to edit + * @param array $column_enum_values $column['values'] + * @param boolean $readOnly is column read only or not + * + * @return string an html snippet + */ + private function getDropDownDependingOnLength( + array $column, + $column_name_appendix, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $data, + array $column_enum_values, + $readOnly + ) { + $html_output = ''; + + //Add hidden input, as disabled '; + } + return $html_output; + } + + /** + * Get HTML radio button for less than 20 string length + * + * @param string $column_name_appendix the name attribute + * @param string $onChangeClause onchange clause for fields + * @param integer $tabindex tab index + * @param array $column description of column in given table + * @param integer $tabindex_for_value offset for the values tabindex + * @param integer $idindex id index + * @param string $data data to edit + * @param array $column_enum_values $column['values'] + * @param boolean $readOnly is column read only or not + * + * @return string an html snippet + */ + private function getRadioButtonDependingOnLength( + $column_name_appendix, + $onChangeClause, + $tabindex, + array $column, + $tabindex_for_value, + $idindex, + $data, + array $column_enum_values, + $readOnly + ) { + $j = 0; + $html_output = ''; + foreach ($column_enum_values as $enum_value) { + $html_output .= ' ' + . ''; + $html_output .= '' . "\n"; + $j++; + } + return $html_output; + } + + /** + * Get the HTML for 'set' pma type + * + * @param array $column description of column in given table + * @param array $extracted_columnspec associative array containing type, + * spec_in_brackets and possibly + * enum_set_values (another array) + * @param string $backup_field hidden input field + * @param string $column_name_appendix the name attribute + * @param string $onChangeClause onchange clause for fields + * @param integer $tabindex tab index + * @param integer $tabindex_for_value offset for the values tabindex + * @param integer $idindex id index + * @param string $data description of the column field + * @param boolean $readOnly is column read only or not + * + * @return string an html snippet + */ + private function getPmaTypeSet( + array $column, + array $extracted_columnspec, + $backup_field, + $column_name_appendix, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $data, + $readOnly + ) { + list($column_set_values, $select_size) = $this->getColumnSetValueAndSelectSize( + $column, + $extracted_columnspec + ); + $vset = array_flip(explode(',', $data)); + $html_output = $backup_field . "\n"; + $html_output .= ''; + $html_output .= ''; + + //Add hidden input, as disabled '; + } + return $html_output; + } + + /** + * Retrieve column 'set' value and select size + * + * @param array $column description of column in given table + * @param array $extracted_columnspec associative array containing type, + * spec_in_brackets and possibly enum_set_values + * (another array) + * + * @return array $column['values'], $column['select_size'] + */ + private function getColumnSetValueAndSelectSize( + array $column, + array $extracted_columnspec + ) { + if (! isset($column['values'])) { + $column['values'] = array(); + foreach ($extracted_columnspec['enum_set_values'] as $val) { + $column['values'][] = array( + 'plain' => $val, + 'html' => htmlspecialchars($val), + ); + } + $column['select_size'] = min(4, count($column['values'])); + } + return array($column['values'], $column['select_size']); + } + + /** + * Get HTML for binary and blob column + * + * @param array $column description of column in given table + * @param string $data data to edit + * @param string $special_chars special characters + * @param integer $biggest_max_file_size biggest max file size for uploading + * @param string $backup_field hidden input field + * @param string $column_name_appendix the name attribute + * @param string $onChangeClause onchange clause for fields + * @param integer $tabindex tab index + * @param integer $tabindex_for_value offset for the values tabindex + * @param integer $idindex id index + * @param string $text_dir text direction + * @param string $special_chars_encoded replaced char if the string starts + * with a \r\n pair (0x0d0a) add an extra \n + * @param string $vkey [multi_edit]['row_id'] + * @param boolean $is_upload is upload or not + * @param boolean $readOnly is column read only or not + * + * @return string an html snippet + */ + private function getBinaryAndBlobColumn( + array $column, + $data, + $special_chars, + $biggest_max_file_size, + $backup_field, + $column_name_appendix, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $text_dir, + $special_chars_encoded, + $vkey, + $is_upload, + $readOnly + ) { + $html_output = ''; + // Add field type : Protected or Hexadecimal + $fields_type_html = ''; + // Default value : hex + $fields_type_val = 'hex'; + if (($GLOBALS['cfg']['ProtectBinary'] === 'blob' && $column['is_blob']) + || ($GLOBALS['cfg']['ProtectBinary'] === 'all') + || ($GLOBALS['cfg']['ProtectBinary'] === 'noblob' && !$column['is_blob']) + ) { + $html_output .= __('Binary - do not edit'); + if (isset($data)) { + $data_size = Util::formatByteDown( + mb_strlen(stripslashes($data)), + 3, + 1 + ); + $html_output .= ' (' . $data_size[0] . ' ' . $data_size[1] . ')'; + unset($data_size); + } + $fields_type_val = 'protected'; + $html_output .= ''; + } elseif ($column['is_blob'] + || ($column['len'] > $GLOBALS['cfg']['LimitChars']) + ) { + $html_output .= "\n" . $this->getTextarea( + $column, + $backup_field, + $column_name_appendix, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $text_dir, + $special_chars_encoded, + 'HEX', + $readOnly + ); + } else { + // field size should be at least 4 and max $GLOBALS['cfg']['LimitChars'] + $fieldsize = min(max($column['len'], 4), $GLOBALS['cfg']['LimitChars']); + $html_output .= "\n" . $backup_field . "\n" . $this->getHtmlInput( + $column, + $column_name_appendix, + $special_chars, + $fieldsize, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + 'HEX', + $readOnly + ); + } + $html_output .= sprintf($fields_type_html, $fields_type_val); + + if ($is_upload && $column['is_blob'] && !$readOnly) { + // We don't want to prevent users from using + // browser's default drag-drop feature on some page(s), + // so we add noDragDrop class to the input + $html_output .= '
      ' + . ' '; + list($html_out,) = $this->getMaxUploadSize( + $column, + $biggest_max_file_size + ); + $html_output .= $html_out; + } + + if (!empty($GLOBALS['cfg']['UploadDir']) && !$readOnly) { + $html_output .= $this->getSelectOptionForUpload($vkey, $column); + } + + return $html_output; + } + + /** + * Get HTML input type + * + * @param array $column description of column in given table + * @param string $column_name_appendix the name attribute + * @param string $special_chars special characters + * @param integer $fieldsize html field size + * @param string $onChangeClause onchange clause for fields + * @param integer $tabindex tab index + * @param integer $tabindex_for_value offset for the values tabindex + * @param integer $idindex id index + * @param string $data_type the html5 data-* attribute type + * @param boolean $readOnly is column read only or not + * + * @return string an html snippet + */ + private function getHtmlInput( + array $column, + $column_name_appendix, + $special_chars, + $fieldsize, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $data_type, + $readOnly + ) { + $input_type = 'text'; + // do not use the 'date' or 'time' types here; they have no effect on some + // browsers and create side effects (see bug #4218) + + $the_class = 'textfield'; + // verify True_Type which does not contain the parentheses and length + if ($readOnly) { + //NOOP. Disable date/timepicker + } elseif ($column['True_Type'] === 'date') { + $the_class .= ' datefield'; + } elseif ($column['True_Type'] === 'time') { + $the_class .= ' timefield'; + } elseif ($column['True_Type'] === 'datetime' + || $column['True_Type'] === 'timestamp' + ) { + $the_class .= ' datetimefield'; + } + $input_min_max = false; + if (in_array($column['True_Type'], $this->dbi->types->getIntegerTypes())) { + $extracted_columnspec = Util::extractColumnSpec( + $column['Type'] + ); + $is_unsigned = $extracted_columnspec['unsigned']; + $min_max_values = $this->dbi->types->getIntegerRange( + $column['True_Type'], + ! $is_unsigned + ); + $input_min_max = 'min="' . $min_max_values[0] . '" ' + . 'max="' . $min_max_values[1] . '"'; + $data_type = 'INT'; + } + return ''; + } + + /** + * Get HTML select option for upload + * + * @param string $vkey [multi_edit]['row_id'] + * @param array $column description of column in given table + * + * @return string|void an html snippet + */ + private function getSelectOptionForUpload($vkey, array $column) + { + $files = FileListing::getFileSelectOptions( + Util::userDir($GLOBALS['cfg']['UploadDir']) + ); + + if ($files === false) { + return '' . __('Error') . '
      ' . "\n" + . __('The directory you set for upload work cannot be reached.') . "\n"; + } elseif (!empty($files)) { + return "
      \n" + . '' . __('Or') . '' . ' ' + . __('web server upload directory:') . '
      ' . "\n" + . '' . "\n"; + } + + return null; + } + + /** + * Retrieve the maximum upload file size + * + * @param array $column description of column in given table + * @param integer $biggest_max_file_size biggest max file size for uploading + * + * @return array an html snippet and $biggest_max_file_size + */ + private function getMaxUploadSize(array $column, $biggest_max_file_size) + { + // find maximum upload size, based on field type + /** + * @todo with functions this is not so easy, as you can basically + * process any data with function like MD5 + */ + global $max_upload_size; + $max_field_sizes = array( + 'tinyblob' => '256', + 'blob' => '65536', + 'mediumblob' => '16777216', + 'longblob' => '4294967296' // yeah, really + ); + + $this_field_max_size = $max_upload_size; // from PHP max + if ($this_field_max_size > $max_field_sizes[$column['pma_type']]) { + $this_field_max_size = $max_field_sizes[$column['pma_type']]; + } + $html_output + = Util::getFormattedMaximumUploadSize( + $this_field_max_size + ) . "\n"; + // do not generate here the MAX_FILE_SIZE, because we should + // put only one in the form to accommodate the biggest field + if ($this_field_max_size > $biggest_max_file_size) { + $biggest_max_file_size = $this_field_max_size; + } + return array($html_output, $biggest_max_file_size); + } + + /** + * Get HTML for the Value column of other datatypes + * (here, "column" is used in the sense of HTML column in HTML table) + * + * @param array $column description of column in given table + * @param string $default_char_editing default char editing mode which is stored + * in the config.inc.php script + * @param string $backup_field hidden input field + * @param string $column_name_appendix the name attribute + * @param string $onChangeClause onchange clause for fields + * @param integer $tabindex tab index + * @param string $special_chars special characters + * @param integer $tabindex_for_value offset for the values tabindex + * @param integer $idindex id index + * @param string $text_dir text direction + * @param string $special_chars_encoded replaced char if the string starts + * with a \r\n pair (0x0d0a) add an extra \n + * @param string $data data to edit + * @param array $extracted_columnspec associative array containing type, + * spec_in_brackets and possibly + * enum_set_values (another array) + * @param boolean $readOnly is column read only or not + * + * @return string an html snippet + */ + private function getValueColumnForOtherDatatypes( + array $column, + $default_char_editing, + $backup_field, + $column_name_appendix, + $onChangeClause, + $tabindex, + $special_chars, + $tabindex_for_value, + $idindex, + $text_dir, + $special_chars_encoded, + $data, + array $extracted_columnspec, + $readOnly + ) { + // HTML5 data-* attribute data-type + $data_type = $this->dbi->types->getTypeClass($column['True_Type']); + $fieldsize = $this->getColumnSize($column, $extracted_columnspec); + $html_output = $backup_field . "\n"; + if ($column['is_char'] + && ($GLOBALS['cfg']['CharEditing'] == 'textarea' + || mb_strpos($data, "\n") !== false) + ) { + $html_output .= "\n"; + $GLOBALS['cfg']['CharEditing'] = $default_char_editing; + $html_output .= $this->getTextarea( + $column, + $backup_field, + $column_name_appendix, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $text_dir, + $special_chars_encoded, + $data_type, + $readOnly + ); + } else { + $html_output .= $this->getHtmlInput( + $column, + $column_name_appendix, + $special_chars, + $fieldsize, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $data_type, + $readOnly + ); + + if (preg_match('/(VIRTUAL|PERSISTENT|GENERATED)/', $column['Extra']) && $column['Extra'] !== 'DEFAULT_GENERATED') { + $html_output .= ''; + } + if ($column['Extra'] == 'auto_increment') { + $html_output .= ''; + } + if (substr($column['pma_type'], 0, 9) == 'timestamp') { + $html_output .= ''; + } + if (substr($column['pma_type'], 0, 8) == 'datetime') { + $html_output .= ''; + } + if ($column['True_Type'] == 'bit') { + $html_output .= ''; + } + if ($column['pma_type'] == 'date' + || $column['pma_type'] == 'datetime' + || substr($column['pma_type'], 0, 9) == 'timestamp' + ) { + // the _3 suffix points to the date field + // the _2 suffix points to the corresponding NULL checkbox + // in dateFormat, 'yy' means the year with 4 digits + } + } + return $html_output; + } + + /** + * Get the field size + * + * @param array $column description of column in given table + * @param array $extracted_columnspec associative array containing type, + * spec_in_brackets and possibly enum_set_values + * (another array) + * + * @return integer field size + */ + private function getColumnSize(array $column, array $extracted_columnspec) + { + if ($column['is_char']) { + $fieldsize = $extracted_columnspec['spec_in_brackets']; + if ($fieldsize > $GLOBALS['cfg']['MaxSizeForInputField']) { + /** + * This case happens for CHAR or VARCHAR columns which have + * a size larger than the maximum size for input field. + */ + $GLOBALS['cfg']['CharEditing'] = 'textarea'; + } + } else { + /** + * This case happens for example for INT or DATE columns; + * in these situations, the value returned in $column['len'] + * seems appropriate. + */ + $fieldsize = $column['len']; + } + return min( + max($fieldsize, $GLOBALS['cfg']['MinSizeForInputField']), + $GLOBALS['cfg']['MaxSizeForInputField'] + ); + } + + /** + * Get HTML for gis data types + * + * @return string an html snippet + */ + private function getHtmlForGisDataTypes() + { + $edit_str = Util::getIcon('b_edit', __('Edit/Insert')); + return '' + . Util::linkOrButton( + '#', + null, + $edit_str, + array(), + '_blank' + ) + . ''; + } + + /** + * get html for continue insertion form + * + * @param string $table name of the table + * @param string $db name of the database + * @param array $where_clause_array array of where clauses + * @param string $err_url error url + * + * @return string an html snippet + */ + public function getContinueInsertionForm( + $table, + $db, + array $where_clause_array, + $err_url + ) { + return Template::get('table/insert/continue_insertion_form')->render([ + 'db' => $db, + 'table' => $table, + 'where_clause_array' => $where_clause_array, + 'err_url' => $err_url, + 'goto' => $GLOBALS['goto'], + 'sql_query' => isset($_POST['sql_query']) ? $_POST['sql_query'] : null, + 'has_where_clause' => isset($_POST['where_clause']), + 'insert_rows_default' => $GLOBALS['cfg']['InsertRows'], + ]); + } + + /** + * Get action panel + * + * @param array|null $where_clause where clause + * @param string $after_insert insert mode, e.g. new_insert, same_insert + * @param integer $tabindex tab index + * @param integer $tabindex_for_value offset for the values tabindex + * @param boolean $found_unique_key boolean variable for unique key + * + * @return string an html snippet + */ + public function getActionsPanel( + $where_clause, + $after_insert, + $tabindex, + $tabindex_for_value, + $found_unique_key + ) { + $html_output = '
      ' + . '' + . '' + . '' + . '' + . '' + . ''; + $html_output .='' + . $this->getSubmitAndResetButtonForActionsPanel($tabindex, $tabindex_for_value) + . '' + . '
      ' + . $this->getSubmitTypeDropDown($where_clause, $tabindex, $tabindex_for_value) + . "\n"; + + $html_output .= '' + . '   ' + . __('and then') . '   ' + . '' + . $this->getAfterInsertDropDown( + $where_clause, + $after_insert, + $found_unique_key + ) + . '
      ' + . '
      '; + return $html_output; + } + + /** + * Get a HTML drop down for submit types + * + * @param array|null $where_clause where clause + * @param integer $tabindex tab index + * @param integer $tabindex_for_value offset for the values tabindex + * + * @return string an html snippet + */ + private function getSubmitTypeDropDown( + $where_clause, + $tabindex, + $tabindex_for_value + ) { + $html_output = ''; + return $html_output; + } + + /** + * Get HTML drop down for after insert + * + * @param array|null $where_clause where clause + * @param string $after_insert insert mode, e.g. new_insert, same_insert + * @param boolean $found_unique_key boolean variable for unique key + * + * @return string an html snippet + */ + private function getAfterInsertDropDown($where_clause, $after_insert, $found_unique_key) + { + $html_output = ''; + return $html_output; + } + + /** + * get Submit button and Reset button for action panel + * + * @param integer $tabindex tab index + * @param integer $tabindex_for_value offset for the values tabindex + * + * @return string an html snippet + */ + private function getSubmitAndResetButtonForActionsPanel($tabindex, $tabindex_for_value) + { + return '' + . Util::showHint( + __( + 'Use TAB key to move from value to value,' + . ' or CTRL+arrows to move anywhere.' + ) + ) + . '' + . '' + . '' + . '' + . '' + . ''; + } + + /** + * Get table head and table foot for insert row table + * + * @param array $url_params url parameters + * + * @return string an html snippet + */ + private function getHeadAndFootOfInsertRowTable(array $url_params) + { + $html_output = '
      ' + . '' + . '' + . '' + . ''; + + if ($GLOBALS['cfg']['ShowFieldTypesInDataEditView']) { + $html_output .= $this->showTypeOrFunction('type', $url_params, true); + } + if ($GLOBALS['cfg']['ShowFunctionFields']) { + $html_output .= $this->showTypeOrFunction('function', $url_params, true); + } + + $html_output .= '' + . '' + . '' + . '' + . ' ' + . '' + . '' + . '' + . ''; + return $html_output; + } + + /** + * Prepares the field value and retrieve special chars, backup field and data array + * + * @param array $current_row a row of the table + * @param array $column description of column in given table + * @param array $extracted_columnspec associative array containing type, + * spec_in_brackets and possibly + * enum_set_values (another array) + * @param boolean $real_null_value whether column value null or not null + * @param array $gis_data_types list of GIS data types + * @param string $column_name_appendix string to append to column name in input + * @param bool $as_is use the data as is, used in repopulating + * + * @return array $real_null_value, $data, $special_chars, $backup_field, + * $special_chars_encoded + */ + private function getSpecialCharsAndBackupFieldForExistingRow( + array $current_row, + array $column, + array $extracted_columnspec, + $real_null_value, + array $gis_data_types, + $column_name_appendix, + $as_is + ) { + $special_chars_encoded = ''; + $data = null; + // (we are editing) + if (!isset($current_row[$column['Field']])) { + $real_null_value = true; + $current_row[$column['Field']] = ''; + $special_chars = ''; + $data = $current_row[$column['Field']]; + } elseif ($column['True_Type'] == 'bit') { + $special_chars = $as_is + ? $current_row[$column['Field']] + : Util::printableBitValue( + $current_row[$column['Field']], + $extracted_columnspec['spec_in_brackets'] + ); + } elseif ((substr($column['True_Type'], 0, 9) == 'timestamp' + || $column['True_Type'] == 'datetime' + || $column['True_Type'] == 'time') + && (mb_strpos($current_row[$column['Field']], ".") !== false) + ) { + $current_row[$column['Field']] = $as_is + ? $current_row[$column['Field']] + : Util::addMicroseconds( + $current_row[$column['Field']] + ); + $special_chars = htmlspecialchars($current_row[$column['Field']]); + } elseif (in_array($column['True_Type'], $gis_data_types)) { + // Convert gis data to Well Know Text format + $current_row[$column['Field']] = $as_is + ? $current_row[$column['Field']] + : Util::asWKT( + $current_row[$column['Field']], + true + ); + $special_chars = htmlspecialchars($current_row[$column['Field']]); + } else { + // special binary "characters" + if ($column['is_binary'] + || ($column['is_blob'] && $GLOBALS['cfg']['ProtectBinary'] !== 'all') + ) { + $current_row[$column['Field']] = $as_is + ? $current_row[$column['Field']] + : bin2hex( + $current_row[$column['Field']] + ); + } // end if + $special_chars = htmlspecialchars($current_row[$column['Field']]); + + //We need to duplicate the first \n or otherwise we will lose + //the first newline entered in a VARCHAR or TEXT column + $special_chars_encoded + = Util::duplicateFirstNewline($special_chars); + + $data = $current_row[$column['Field']]; + } // end if... else... + + //when copying row, it is useful to empty auto-increment column + // to prevent duplicate key error + if (isset($_POST['default_action']) + && $_POST['default_action'] === 'insert' + ) { + if ($column['Key'] === 'PRI' + && mb_strpos($column['Extra'], 'auto_increment') !== false + ) { + $data = $special_chars_encoded = $special_chars = null; + } + } + // If a timestamp field value is not included in an update + // statement MySQL auto-update it to the current timestamp; + // however, things have changed since MySQL 4.1, so + // it's better to set a fields_prev in this situation + $backup_field = ''; + + return array( + $real_null_value, + $special_chars_encoded, + $special_chars, + $data, + $backup_field + ); + } + + /** + * display default values + * + * @param array $column description of column in given table + * @param boolean $real_null_value whether column value null or not null + * + * @return array $real_null_value, $data, $special_chars, + * $backup_field, $special_chars_encoded + */ + private function getSpecialCharsAndBackupFieldForInsertingMode( + array $column, + $real_null_value + ) { + if (! isset($column['Default'])) { + $column['Default'] = ''; + $real_null_value = true; + $data = ''; + } else { + $data = $column['Default']; + } + + $trueType = $column['True_Type']; + + if ($trueType == 'bit') { + $special_chars = Util::convertBitDefaultValue( + $column['Default'] + ); + } elseif (substr($trueType, 0, 9) == 'timestamp' + || $trueType == 'datetime' + || $trueType == 'time' + ) { + $special_chars = Util::addMicroseconds($column['Default']); + } elseif ($trueType == 'binary' || $trueType == 'varbinary') { + $special_chars = bin2hex($column['Default']); + } elseif ('text' === substr($trueType, -4)) { + $textDefault = substr($column['Default'], 1, -1); + $special_chars = stripcslashes($textDefault !== false ? $textDefault : $column['Default']); + } else { + $special_chars = htmlspecialchars($column['Default']); + } + $backup_field = ''; + $special_chars_encoded = Util::duplicateFirstNewline( + $special_chars + ); + return array( + $real_null_value, $data, $special_chars, + $backup_field, $special_chars_encoded + ); + } + + /** + * Prepares the update/insert of a row + * + * @return array $loop_array, $using_key, $is_insert, $is_insertignore + */ + public function getParamsForUpdateOrInsert() + { + if (isset($_POST['where_clause'])) { + // we were editing something => use the WHERE clause + $loop_array = is_array($_POST['where_clause']) + ? $_POST['where_clause'] + : array($_POST['where_clause']); + $using_key = true; + $is_insert = isset($_POST['submit_type']) + && ($_POST['submit_type'] == 'insert' + || $_POST['submit_type'] == 'showinsert' + || $_POST['submit_type'] == 'insertignore'); + } else { + // new row => use indexes + $loop_array = array(); + if (! empty($_POST['fields'])) { + foreach ($_POST['fields']['multi_edit'] as $key => $dummy) { + $loop_array[] = $key; + } + } + $using_key = false; + $is_insert = true; + } + $is_insertignore = isset($_POST['submit_type']) + && $_POST['submit_type'] == 'insertignore'; + return array($loop_array, $using_key, $is_insert, $is_insertignore); + } + + /** + * Check wether insert row mode and if so include tbl_changen script and set + * global variables. + * + * @return void + */ + public function isInsertRow() + { + if (isset($_POST['insert_rows']) + && is_numeric($_POST['insert_rows']) + && $_POST['insert_rows'] != $GLOBALS['cfg']['InsertRows'] + ) { + $GLOBALS['cfg']['InsertRows'] = $_POST['insert_rows']; + $response = Response::getInstance(); + $header = $response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('vendor/jquery/additional-methods.js'); + $scripts->addFile('tbl_change.js'); + if (!defined('TESTSUITE')) { + include 'tbl_change.php'; + exit; + } + } + } + + /** + * set $_SESSION for edit_next + * + * @param string $one_where_clause one where clause from where clauses array + * + * @return void + */ + public function setSessionForEditNext($one_where_clause) + { + $local_query = 'SELECT * FROM ' . Util::backquote($GLOBALS['db']) + . '.' . Util::backquote($GLOBALS['table']) . ' WHERE ' + . str_replace('` =', '` >', $one_where_clause) . ' LIMIT 1;'; + + $res = $this->dbi->query($local_query); + $row = $this->dbi->fetchRow($res); + $meta = $this->dbi->getFieldsMeta($res); + // must find a unique condition based on unique key, + // not a combination of all fields + list($unique_condition, $clause_is_unique) + = Util::getUniqueCondition( + $res, // handle + count($meta), // fields_cnt + $meta, // fields_meta + $row, // row + true, // force_unique + false, // restrict_to_table + null // analyzed_sql_results + ); + if (! empty($unique_condition)) { + $_SESSION['edit_next'] = $unique_condition; + } + unset($unique_condition, $clause_is_unique); + } + + /** + * set $goto_include variable for different cases and retrieve like, + * if $GLOBALS['goto'] empty, if $goto_include previously not defined + * and new_insert, same_insert, edit_next + * + * @param string $goto_include store some script for include, otherwise it is + * boolean false + * + * @return string $goto_include + */ + public function getGotoInclude($goto_include) + { + $valid_options = array('new_insert', 'same_insert', 'edit_next'); + if (isset($_POST['after_insert']) + && in_array($_POST['after_insert'], $valid_options) + ) { + $goto_include = 'tbl_change.php'; + } elseif (! empty($GLOBALS['goto'])) { + if (! preg_match('@^[a-z_]+\.php$@', $GLOBALS['goto'])) { + // this should NOT happen + //$GLOBALS['goto'] = false; + $goto_include = false; + } else { + $goto_include = $GLOBALS['goto']; + } + if ($GLOBALS['goto'] == 'db_sql.php' && strlen($GLOBALS['table']) > 0) { + $GLOBALS['table'] = ''; + } + } + if (! $goto_include) { + if (strlen($GLOBALS['table']) === 0) { + $goto_include = 'db_sql.php'; + } else { + $goto_include = 'tbl_sql.php'; + } + } + return $goto_include; + } + + /** + * Defines the url to return in case of failure of the query + * + * @param array $url_params url parameters + * + * @return string error url for query failure + */ + public function getErrorUrl(array $url_params) + { + if (isset($_POST['err_url'])) { + return $_POST['err_url']; + } + + return 'tbl_change.php' . Url::getCommon($url_params); + } + + /** + * Builds the sql query + * + * @param boolean $is_insertignore $_POST['submit_type'] == 'insertignore' + * @param array $query_fields column names array + * @param array $value_sets array of query values + * + * @return array of query + */ + public function buildSqlQuery($is_insertignore, array $query_fields, array $value_sets) + { + if ($is_insertignore) { + $insert_command = 'INSERT IGNORE '; + } else { + $insert_command = 'INSERT '; + } + $query = array( + $insert_command . 'INTO ' + . Util::backquote($GLOBALS['table']) + . ' (' . implode(', ', $query_fields) . ') VALUES (' + . implode('), (', $value_sets) . ')' + ); + unset($insert_command, $query_fields); + return $query; + } + + /** + * Executes the sql query and get the result, then move back to the calling page + * + * @param array $url_params url parameters array + * @param array $query built query from buildSqlQuery() + * + * @return array $url_params, $total_affected_rows, $last_messages + * $warning_messages, $error_messages, $return_to_sql_query + */ + public function executeSqlQuery(array $url_params, array $query) + { + $return_to_sql_query = ''; + if (! empty($GLOBALS['sql_query'])) { + $url_params['sql_query'] = $GLOBALS['sql_query']; + $return_to_sql_query = $GLOBALS['sql_query']; + } + $GLOBALS['sql_query'] = implode('; ', $query) . ';'; + // to ensure that the query is displayed in case of + // "insert as new row" and then "insert another new row" + $GLOBALS['display_query'] = $GLOBALS['sql_query']; + + $total_affected_rows = 0; + $last_messages = array(); + $warning_messages = array(); + $error_messages = array(); + + foreach ($query as $single_query) { + if ($_POST['submit_type'] == 'showinsert') { + $last_messages[] = Message::notice(__('Showing SQL query')); + continue; + } + if ($GLOBALS['cfg']['IgnoreMultiSubmitErrors']) { + $result = $this->dbi->tryQuery($single_query); + } else { + $result = $this->dbi->query($single_query); + } + if (! $result) { + $error_messages[] = $this->dbi->getError(); + } else { + // The next line contains a real assignment, it's not a typo + if ($tmp = @$this->dbi->affectedRows()) { + $total_affected_rows += $tmp; + } + unset($tmp); + + $insert_id = $this->dbi->insertId(); + if ($insert_id != 0) { + // insert_id is id of FIRST record inserted in one insert, so if we + // inserted multiple rows, we had to increment this + + if ($total_affected_rows > 0) { + $insert_id = $insert_id + $total_affected_rows - 1; + } + $last_message = Message::notice(__('Inserted row id: %1$d')); + $last_message->addParam($insert_id); + $last_messages[] = $last_message; + } + $this->dbi->freeResult($result); + } + $warning_messages = $this->getWarningMessages(); + } + return array( + $url_params, + $total_affected_rows, + $last_messages, + $warning_messages, + $error_messages, + $return_to_sql_query + ); + } + + /** + * get the warning messages array + * + * @return array $warning_essages + */ + private function getWarningMessages() + { + $warning_essages = array(); + foreach ($this->dbi->getWarnings() as $warning) { + $warning_essages[] = Message::sanitize( + $warning['Level'] . ': #' . $warning['Code'] . ' ' . $warning['Message'] + ); + } + return $warning_essages; + } + + /** + * Column to display from the foreign table? + * + * @param string $where_comparison string that contain relation field value + * @param array $map all Relations to foreign tables for a given + * table or optionally a given column in a table + * @param string $relation_field relation field + * + * @return string $dispval display value from the foreign table + */ + public function getDisplayValueForForeignTableColumn( + $where_comparison, + array $map, + $relation_field + ) { + $foreigner = $this->relation->searchColumnInForeigners($map, $relation_field); + $display_field = $this->relation->getDisplayField( + $foreigner['foreign_db'], + $foreigner['foreign_table'] + ); + // Field to display from the foreign table? + if (isset($display_field) && strlen($display_field) > 0) { + $dispsql = 'SELECT ' . Util::backquote($display_field) + . ' FROM ' . Util::backquote($foreigner['foreign_db']) + . '.' . Util::backquote($foreigner['foreign_table']) + . ' WHERE ' . Util::backquote($foreigner['foreign_field']) + . $where_comparison; + $dispresult = $this->dbi->tryQuery( + $dispsql, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + if ($dispresult && $this->dbi->numRows($dispresult) > 0) { + list($dispval) = $this->dbi->fetchRow($dispresult, 0); + } else { + $dispval = ''; + } + if ($dispresult) { + $this->dbi->freeResult($dispresult); + } + return $dispval; + } + return ''; + } + + /** + * Display option in the cell according to user choices + * + * @param array $map all Relations to foreign tables for a given + * table or optionally a given column in a table + * @param string $relation_field relation field + * @param string $where_comparison string that contain relation field value + * @param string $dispval display value from the foreign table + * @param string $relation_field_value relation field value + * + * @return string $output HTML tag + */ + public function getLinkForRelationalDisplayField( + array $map, + $relation_field, + $where_comparison, + $dispval, + $relation_field_value + ) { + $foreigner = $this->relation->searchColumnInForeigners($map, $relation_field); + if ('K' == $_SESSION['tmpval']['relational_display']) { + // user chose "relational key" in the display options, so + // the title contains the display field + $title = (! empty($dispval)) + ? ' title="' . htmlspecialchars($dispval) . '"' + : ''; + } else { + $title = ' title="' . htmlspecialchars($relation_field_value) . '"'; + } + $_url_params = array( + 'db' => $foreigner['foreign_db'], + 'table' => $foreigner['foreign_table'], + 'pos' => '0', + 'sql_query' => 'SELECT * FROM ' + . Util::backquote($foreigner['foreign_db']) + . '.' . Util::backquote($foreigner['foreign_table']) + . ' WHERE ' . Util::backquote($foreigner['foreign_field']) + . $where_comparison + ); + $output = ''; + + if ('D' == $_SESSION['tmpval']['relational_display']) { + // user chose "relational display field" in the + // display options, so show display field in the cell + $output .= (!empty($dispval)) ? htmlspecialchars($dispval) : ''; + } else { + // otherwise display data in the cell + $output .= htmlspecialchars($relation_field_value); + } + $output .= ''; + return $output; + } + + /** + * Transform edited values + * + * @param string $db db name + * @param string $table table name + * @param array $transformation mimetypes for all columns of a table + * [field_name][field_key] + * @param array &$edited_values transform columns list and new values + * @param string $file file containing the transformation plugin + * @param string $column_name column name + * @param array $extra_data extra data array + * @param string $type the type of transformation + * + * @return array $extra_data + */ + public function transformEditedValues( + $db, + $table, + array $transformation, + array &$edited_values, + $file, + $column_name, + array $extra_data, + $type + ) { + $include_file = 'libraries/classes/Plugins/Transformations/' . $file; + if (is_file($include_file)) { + $_url_params = array( + 'db' => $db, + 'table' => $table, + 'where_clause_sign' => Core::signSqlQuery($_POST['where_clause']), + 'where_clause' => $_POST['where_clause'], + 'transform_key' => $column_name + ); + $transform_options = Transformations::getOptions( + isset($transformation[$type . '_options']) + ? $transformation[$type . '_options'] + : '' + ); + $transform_options['wrapper_link'] = Url::getCommon($_url_params); + $class_name = Transformations::getClassName($include_file); + if (class_exists($class_name)) { + /** @var TransformationsPlugin $transformation_plugin */ + $transformation_plugin = new $class_name(); + + foreach ($edited_values as $cell_index => $curr_cell_edited_values) { + if (isset($curr_cell_edited_values[$column_name])) { + $edited_values[$cell_index][$column_name] + = $extra_data['transformations'][$cell_index] + = $transformation_plugin->applyTransformation( + $curr_cell_edited_values[$column_name], + $transform_options, + '' + ); + } + } // end of loop for each transformation cell + } + } + return $extra_data; + } + + /** + * Get current value in multi edit mode + * + * @param array $multi_edit_funcs multiple edit functions array + * @param array $multi_edit_salt multiple edit array with encryption salt + * @param array $gis_from_text_functions array that contains gis from text functions + * @param string $current_value current value in the column + * @param array $gis_from_wkb_functions initially $val is $multi_edit_columns[$key] + * @param array $func_optional_param array('RAND','UNIX_TIMESTAMP') + * @param array $func_no_param array of set of string + * @param string $key an md5 of the column name + * + * @return array $cur_value + */ + public function getCurrentValueAsAnArrayForMultipleEdit( + $multi_edit_funcs, + $multi_edit_salt, + $gis_from_text_functions, + $current_value, + $gis_from_wkb_functions, + $func_optional_param, + $func_no_param, + $key + ) { + if (empty($multi_edit_funcs[$key])) { + return $current_value; + } elseif ('UUID' === $multi_edit_funcs[$key]) { + /* This way user will know what UUID new row has */ + $uuid = $this->dbi->fetchValue('SELECT UUID()'); + return "'" . $uuid . "'"; + } elseif ((in_array($multi_edit_funcs[$key], $gis_from_text_functions) + && substr($current_value, 0, 3) == "'''") + || in_array($multi_edit_funcs[$key], $gis_from_wkb_functions) + ) { + // Remove enclosing apostrophes + $current_value = mb_substr($current_value, 1, -1); + // Remove escaping apostrophes + $current_value = str_replace("''", "'", $current_value); + return $multi_edit_funcs[$key] . '(' . $current_value . ')'; + } elseif (! in_array($multi_edit_funcs[$key], $func_no_param) + || ($current_value != "''" + && in_array($multi_edit_funcs[$key], $func_optional_param)) + ) { + if ((isset($multi_edit_salt[$key]) + && ($multi_edit_funcs[$key] == "AES_ENCRYPT" + || $multi_edit_funcs[$key] == "AES_DECRYPT")) + || (! empty($multi_edit_salt[$key]) + && ($multi_edit_funcs[$key] == "DES_ENCRYPT" + || $multi_edit_funcs[$key] == "DES_DECRYPT" + || $multi_edit_funcs[$key] == "ENCRYPT")) + ) { + return $multi_edit_funcs[$key] . '(' . $current_value . ",'" + . $this->dbi->escapeString($multi_edit_salt[$key]) . "')"; + } + + return $multi_edit_funcs[$key] . '(' . $current_value . ')'; + } + + return $multi_edit_funcs[$key] . '()'; + } + + /** + * Get query values array and query fields array for insert and update in multi edit + * + * @param array $multi_edit_columns_name multiple edit columns name array + * @param array $multi_edit_columns_null multiple edit columns null array + * @param string $current_value current value in the column in loop + * @param array $multi_edit_columns_prev multiple edit previous columns array + * @param array $multi_edit_funcs multiple edit functions array + * @param boolean $is_insert boolean value whether insert or not + * @param array $query_values SET part of the sql query + * @param array $query_fields array of query fields + * @param string $current_value_as_an_array current value in the column + * as an array + * @param array $value_sets array of valu sets + * @param string $key an md5 of the column name + * @param array $multi_edit_columns_null_prev array of multiple edit columns + * null previous + * + * @return array ($query_values, $query_fields) + */ + public function getQueryValuesForInsertAndUpdateInMultipleEdit( + $multi_edit_columns_name, + $multi_edit_columns_null, + $current_value, + $multi_edit_columns_prev, + $multi_edit_funcs, + $is_insert, + $query_values, + $query_fields, + $current_value_as_an_array, + $value_sets, + $key, + $multi_edit_columns_null_prev + ) { + // i n s e r t + if ($is_insert) { + // no need to add column into the valuelist + if (strlen($current_value_as_an_array) > 0) { + $query_values[] = $current_value_as_an_array; + // first inserted row so prepare the list of fields + if (empty($value_sets)) { + $query_fields[] = Util::backquote( + $multi_edit_columns_name[$key] + ); + } + } + } elseif (! empty($multi_edit_columns_null_prev[$key]) + && ! isset($multi_edit_columns_null[$key]) + ) { + // u p d a t e + + // field had the null checkbox before the update + // field no longer has the null checkbox + $query_values[] + = Util::backquote($multi_edit_columns_name[$key]) + . ' = ' . $current_value_as_an_array; + } elseif (empty($multi_edit_funcs[$key]) + && isset($multi_edit_columns_prev[$key]) + && (("'" . $this->dbi->escapeString($multi_edit_columns_prev[$key]) . "'" === $current_value) + || ('0x' . $multi_edit_columns_prev[$key] === $current_value)) + ) { + // No change for this column and no MySQL function is used -> next column + } elseif (! empty($current_value)) { + // avoid setting a field to NULL when it's already NULL + // (field had the null checkbox before the update + // field still has the null checkbox) + if (empty($multi_edit_columns_null_prev[$key]) + || empty($multi_edit_columns_null[$key]) + ) { + $query_values[] + = Util::backquote($multi_edit_columns_name[$key]) + . ' = ' . $current_value_as_an_array; + } + } + return array($query_values, $query_fields); + } + + /** + * Get the current column value in the form for different data types + * + * @param string|false $possibly_uploaded_val uploaded file content + * @param string $key an md5 of the column name + * @param array $multi_edit_columns_type array of multi edit column types + * @param string $current_value current column value in the form + * @param array $multi_edit_auto_increment multi edit auto increment + * @param integer $rownumber index of where clause array + * @param array $multi_edit_columns_name multi edit column names array + * @param array $multi_edit_columns_null multi edit columns null array + * @param array $multi_edit_columns_null_prev multi edit columns previous null + * @param boolean $is_insert whether insert or not + * @param boolean $using_key whether editing or new row + * @param string $where_clause where clause + * @param string $table table name + * @param array $multi_edit_funcs multiple edit functions array + * + * @return string $current_value current column value in the form + */ + public function getCurrentValueForDifferentTypes( + $possibly_uploaded_val, + $key, + $multi_edit_columns_type, + $current_value, + $multi_edit_auto_increment, + $rownumber, + $multi_edit_columns_name, + $multi_edit_columns_null, + $multi_edit_columns_null_prev, + $is_insert, + $using_key, + $where_clause, + $table, + $multi_edit_funcs + ) { + // Fetch the current values of a row to use in case we have a protected field + if ($is_insert + && $using_key && isset($multi_edit_columns_type) + && is_array($multi_edit_columns_type) && !empty($where_clause) + ) { + $protected_row = $this->dbi->fetchSingleRow( + 'SELECT * FROM ' . Util::backquote($table) + . ' WHERE ' . $where_clause . ';' + ); + } + + if (false !== $possibly_uploaded_val) { + $current_value = $possibly_uploaded_val; + } elseif (! empty($multi_edit_funcs[$key])) { + $current_value = "'" . $this->dbi->escapeString($current_value) + . "'"; + } else { + // c o l u m n v a l u e i n t h e f o r m + if (isset($multi_edit_columns_type[$key])) { + $type = $multi_edit_columns_type[$key]; + } else { + $type = ''; + } + + if ($type != 'protected' && $type != 'set' && strlen($current_value) === 0) { + // best way to avoid problems in strict mode + // (works also in non-strict mode) + if (isset($multi_edit_auto_increment) + && isset($multi_edit_auto_increment[$key]) + ) { + $current_value = 'NULL'; + } else { + $current_value = "''"; + } + } elseif ($type == 'set') { + if (! empty($_POST['fields']['multi_edit'][$rownumber][$key])) { + $current_value = implode( + ',', + $_POST['fields']['multi_edit'][$rownumber][$key] + ); + $current_value = "'" + . $this->dbi->escapeString($current_value) . "'"; + } else { + $current_value = "''"; + } + } elseif ($type == 'protected') { + // here we are in protected mode (asked in the config) + // so tbl_change has put this special value in the + // columns array, so we do not change the column value + // but we can still handle column upload + + // when in UPDATE mode, do not alter field's contents. When in INSERT + // mode, insert empty field because no values were submitted. + // If protected blobs where set, insert original fields content. + if (! empty($protected_row[$multi_edit_columns_name[$key]])) { + $current_value = '0x' + . bin2hex($protected_row[$multi_edit_columns_name[$key]]); + } else { + $current_value = ''; + } + } elseif ($type === 'hex') { + if (substr($current_value, 0, 2) != '0x') { + $current_value = '0x' . $current_value; + } + } elseif ($type == 'bit') { + $current_value = preg_replace('/[^01]/', '0', $current_value); + $current_value = "b'" . $this->dbi->escapeString($current_value) + . "'"; + } elseif (! ($type == 'datetime' || $type == 'timestamp') + || ($current_value != 'CURRENT_TIMESTAMP' + && $current_value != 'current_timestamp()') + ) { + $current_value = "'" . $this->dbi->escapeString($current_value) + . "'"; + } + + // Was the Null checkbox checked for this field? + // (if there is a value, we ignore the Null checkbox: this could + // be possible if Javascript is disabled in the browser) + if (! empty($multi_edit_columns_null[$key]) + && ($current_value == "''" || $current_value == '') + ) { + $current_value = 'NULL'; + } + + // The Null checkbox was unchecked for this field + if (empty($current_value) + && ! empty($multi_edit_columns_null_prev[$key]) + && ! isset($multi_edit_columns_null[$key]) + ) { + $current_value = "''"; + } + } // end else (column value in the form) + return $current_value; + } + + /** + * Check whether inline edited value can be truncated or not, + * and add additional parameters for extra_data array if needed + * + * @param string $db Database name + * @param string $table Table name + * @param string $column_name Column name + * @param array &$extra_data Extra data for ajax response + * + * @return void + */ + public function verifyWhetherValueCanBeTruncatedAndAppendExtraData( + $db, + $table, + $column_name, + array &$extra_data + ) { + $extra_data['isNeedToRecheck'] = false; + + $sql_for_real_value = 'SELECT ' . Util::backquote($table) . '.' + . Util::backquote($column_name) + . ' FROM ' . Util::backquote($db) . '.' + . Util::backquote($table) + . ' WHERE ' . $_POST['where_clause'][0]; + + $result = $this->dbi->tryQuery($sql_for_real_value); + $fields_meta = $this->dbi->getFieldsMeta($result); + $meta = $fields_meta[0]; + if ($row = $this->dbi->fetchRow($result)) { + $new_value = $row[0]; + if ((substr($meta->type, 0, 9) == 'timestamp') + || ($meta->type == 'datetime') + || ($meta->type == 'time') + ) { + $new_value = Util::addMicroseconds($new_value); + } elseif (mb_strpos($meta->flags, 'binary') !== false) { + $new_value = '0x' . bin2hex($new_value); + } + $extra_data['isNeedToRecheck'] = true; + $extra_data['truncatableFieldValue'] = $new_value; + } + $this->dbi->freeResult($result); + } + + /** + * Function to get the columns of a table + * + * @param string $db current db + * @param string $table current table + * + * @return array + */ + public function getTableColumns($db, $table) + { + $this->dbi->selectDb($db); + return array_values($this->dbi->getColumns($db, $table, null, true)); + } + + /** + * Function to determine Insert/Edit rows + * + * @param string $where_clause where clause + * @param string $db current database + * @param string $table current table + * + * @return mixed + */ + public function determineInsertOrEdit($where_clause, $db, $table) + { + if (isset($_POST['where_clause'])) { + $where_clause = $_POST['where_clause']; + } + if (isset($_SESSION['edit_next'])) { + $where_clause = $_SESSION['edit_next']; + unset($_SESSION['edit_next']); + $after_insert = 'edit_next'; + } + if (isset($_POST['ShowFunctionFields'])) { + $GLOBALS['cfg']['ShowFunctionFields'] = $_POST['ShowFunctionFields']; + } + if (isset($_POST['ShowFieldTypesInDataEditView'])) { + $GLOBALS['cfg']['ShowFieldTypesInDataEditView'] + = $_POST['ShowFieldTypesInDataEditView']; + } + if (isset($_POST['after_insert'])) { + $after_insert = $_POST['after_insert']; + } + + if (isset($where_clause)) { + // we are editing + $insert_mode = false; + $where_clause_array = $this->getWhereClauseArray($where_clause); + list($where_clauses, $result, $rows, $found_unique_key) + = $this->analyzeWhereClauses( + $where_clause_array, + $table, + $db + ); + } else { + // we are inserting + $insert_mode = true; + $where_clause = null; + list($result, $rows) = $this->loadFirstRow($table, $db); + $where_clauses = null; + $where_clause_array = array(); + $found_unique_key = false; + } + + // Copying a row - fetched data will be inserted as a new row, + // therefore the where clause is needless. + if (isset($_POST['default_action']) + && $_POST['default_action'] === 'insert' + ) { + $where_clause = $where_clauses = null; + } + + return array( + $insert_mode, $where_clause, $where_clause_array, $where_clauses, + $result, $rows, $found_unique_key, + isset($after_insert) ? $after_insert : null + ); + } + + /** + * Function to get comments for the table columns + * + * @param string $db current database + * @param string $table current table + * + * @return array $comments_map comments for columns + */ + public function getCommentsMap($db, $table) + { + $comments_map = array(); + + if ($GLOBALS['cfg']['ShowPropertyComments']) { + $comments_map = $this->relation->getComments($db, $table); + } + + return $comments_map; + } + + /** + * Function to get URL parameters + * + * @param string $db current database + * @param string $table current table + * + * @return array $url_params url parameters + */ + public function getUrlParameters($db, $table) + { + /** + * @todo check if we could replace by "db_|tbl_" - please clarify!? + */ + $url_params = array( + 'db' => $db, + 'sql_query' => $_POST['sql_query'] + ); + + if (preg_match('@^tbl_@', $GLOBALS['goto'])) { + $url_params['table'] = $table; + } + + return $url_params; + } + + /** + * Function to get html for the gis editor div + * + * @return string + */ + public function getHtmlForGisEditor() + { + return '
      ' + . '' + . '
      '; + } + + /** + * Function to get html for the ignore option in insert mode + * + * @param int $row_id row id + * @param bool $checked ignore option is checked or not + * + * @return string + */ + public function getHtmlForIgnoreOption($row_id, $checked = true) + { + return '' + . '
      ' . "\n"; + } + + /** + * Function to get html for the function option + * + * @param array $column column + * @param string $column_name_appendix column name appendix + * + * @return String + */ + private function getHtmlForFunctionOption(array $column, $column_name_appendix) + { + return '' + . ''; + } + + /** + * Function to get html for the column type + * + * @param array $column column + * + * @return string + */ + private function getHtmlForInsertEditColumnType(array $column) + { + return ''; + } + + /** + * Function to get html for the insert edit form header + * + * @param bool $has_blob_field whether has blob field + * @param bool $is_upload whether is upload + * + * @return string + */ + public function getHtmlForInsertEditFormHeader($has_blob_field, $is_upload) + { + $html_output ='analyzeTableColumnsArray( + $column, + $comments_map, + $timestamp_seen + ); + } + $as_is = false; + if (!empty($repopulate) && !empty($current_row)) { + $current_row[$column['Field']] = $repopulate[$column['Field_md5']]; + $as_is = true; + } + + $extracted_columnspec + = Util::extractColumnSpec($column['Type']); + + if (-1 === $column['len']) { + $column['len'] = $this->dbi->fieldLen( + $current_result, + $column_number + ); + // length is unknown for geometry fields, + // make enough space to edit very simple WKTs + if (-1 === $column['len']) { + $column['len'] = 30; + } + } + //Call validation when the form submitted... + $onChangeClause = $chg_evt_handler + . "=\"return verificationsAfterFieldChange('" + . Sanitize::escapeJsString($column['Field_md5']) . "', '" + . Sanitize::escapeJsString($jsvkey) . "','" . $column['pma_type'] . "')\""; + + // Use an MD5 as an array index to avoid having special characters + // in the name attribute (see bug #1746964 ) + $column_name_appendix = $vkey . '[' . $column['Field_md5'] . ']'; + + if ($column['Type'] === 'datetime' + && ! isset($column['Default']) + && ! is_null($column['Default']) + && $insert_mode + ) { + $column['Default'] = date('Y-m-d H:i:s', time()); + } + + $html_output = $this->getHtmlForFunctionOption( + $column, + $column_name_appendix + ); + + if ($GLOBALS['cfg']['ShowFieldTypesInDataEditView']) { + $html_output .= $this->getHtmlForInsertEditColumnType($column); + } //End if + + // Get a list of GIS data types. + $gis_data_types = Util::getGISDatatypes(); + + // Prepares the field value + $real_null_value = false; + $special_chars_encoded = ''; + if (!empty($current_row)) { + // (we are editing) + list( + $real_null_value, $special_chars_encoded, $special_chars, + $data, $backup_field + ) + = $this->getSpecialCharsAndBackupFieldForExistingRow( + $current_row, + $column, + $extracted_columnspec, + $real_null_value, + $gis_data_types, + $column_name_appendix, + $as_is + ); + } else { + // (we are inserting) + // display default values + $tmp = $column; + if (isset($repopulate[$column['Field_md5']])) { + $tmp['Default'] = $repopulate[$column['Field_md5']]; + } + list($real_null_value, $data, $special_chars, $backup_field, + $special_chars_encoded + ) + = $this->getSpecialCharsAndBackupFieldForInsertingMode( + $tmp, + $real_null_value + ); + unset($tmp); + } + + $idindex = ($o_rows * $columns_cnt) + $column_number + 1; + $tabindex = $idindex; + + // Get a list of data types that are not yet supported. + $no_support_types = Util::unsupportedDatatypes(); + + // The function column + // ------------------- + $foreignData = $this->relation->getForeignData( + $foreigners, + $column['Field'], + false, + '', + '' + ); + if ($GLOBALS['cfg']['ShowFunctionFields']) { + $html_output .= $this->getFunctionColumn( + $column, + $is_upload, + $column_name_appendix, + $onChangeClause, + $no_support_types, + $tabindex_for_function, + $tabindex, + $idindex, + $insert_mode, + $readOnly, + $foreignData + ); + } + + // The null column + // --------------- + $html_output .= $this->getNullColumn( + $column, + $column_name_appendix, + $real_null_value, + $tabindex, + $tabindex_for_null, + $idindex, + $vkey, + $foreigners, + $foreignData, + $readOnly + ); + + // The value column (depends on type) + // ---------------- + // See bug #1667887 for the reason why we don't use the maxlength + // HTML attribute + + //add data attributes "no of decimals" and "data type" + $no_decimals = 0; + $type = current(explode("(", $column['pma_type'])); + if (preg_match('/\(([^()]+)\)/', $column['pma_type'], $match)) { + $match[0] = trim($match[0], '()'); + $no_decimals = $match[0]; + } + $html_output .= '' . "\n"; + // Will be used by js/tbl_change.js to set the default value + // for the "Continue insertion" feature + $html_output .= '' + . $special_chars . ''; + + // Check input transformation of column + $transformed_html = ''; + if (!empty($column_mime['input_transformation'])) { + $file = $column_mime['input_transformation']; + $include_file = 'libraries/classes/Plugins/Transformations/' . $file; + if (is_file($include_file)) { + $class_name = Transformations::getClassName($include_file); + if (class_exists($class_name)) { + $transformation_plugin = new $class_name(); + $transformation_options = Transformations::getOptions( + $column_mime['input_transformation_options'] + ); + $_url_params = array( + 'db' => $db, + 'table' => $table, + 'transform_key' => $column['Field'], + 'where_clause_sign' => Core::signSqlQuery($where_clause), + 'where_clause' => $where_clause + ); + $transformation_options['wrapper_link'] + = Url::getCommon($_url_params); + $current_value = ''; + if (isset($current_row[$column['Field']])) { + $current_value = $current_row[$column['Field']]; + } + if (method_exists($transformation_plugin, 'getInputHtml')) { + $transformed_html = $transformation_plugin->getInputHtml( + $column, + $row_id, + $column_name_appendix, + $transformation_options, + $current_value, + $text_dir, + $tabindex, + $tabindex_for_value, + $idindex + ); + } + if (method_exists($transformation_plugin, 'getScripts')) { + $GLOBALS['plugin_scripts'] = array_merge( + $GLOBALS['plugin_scripts'], + $transformation_plugin->getScripts() + ); + } + } + } + } + if (!empty($transformed_html)) { + $html_output .= $transformed_html; + } else { + $html_output .= $this->getValueColumn( + $column, + $backup_field, + $column_name_appendix, + $onChangeClause, + $tabindex, + $tabindex_for_value, + $idindex, + $data, + $special_chars, + $foreignData, + array($table, $db), + $row_id, + $titles, + $text_dir, + $special_chars_encoded, + $vkey, + $is_upload, + $biggest_max_file_size, + $default_char_editing, + $no_support_types, + $gis_data_types, + $extracted_columnspec, + $readOnly + ); + } + return $html_output; + } + + /** + * Function to get html for each insert/edit row + * + * @param array $url_params url parameters + * @param array $table_columns table columns + * @param array $comments_map comments map + * @param bool $timestamp_seen whether timestamp seen + * @param array $current_result current result + * @param string $chg_evt_handler javascript change event handler + * @param string $jsvkey javascript validation key + * @param string $vkey validation key + * @param bool $insert_mode whether insert mode + * @param array $current_row current row + * @param int &$o_rows row offset + * @param int &$tabindex tab index + * @param int $columns_cnt columns count + * @param bool $is_upload whether upload + * @param int $tabindex_for_function tab index offset for function + * @param array $foreigners foreigners + * @param int $tabindex_for_null tab index offset for null + * @param int $tabindex_for_value tab index offset for value + * @param string $table table + * @param string $db database + * @param int $row_id row id + * @param array $titles titles + * @param int $biggest_max_file_size biggest max file size + * @param string $text_dir text direction + * @param array $repopulate the data to be repopulated + * @param array $where_clause_array the array of where clauses + * + * @return string + */ + public function getHtmlForInsertEditRow( + array $url_params, + array $table_columns, + array $comments_map, + $timestamp_seen, + $current_result, + $chg_evt_handler, + $jsvkey, + $vkey, + $insert_mode, + array $current_row, + &$o_rows, + &$tabindex, + $columns_cnt, + $is_upload, + $tabindex_for_function, + array $foreigners, + $tabindex_for_null, + $tabindex_for_value, + $table, + $db, + $row_id, + array $titles, + $biggest_max_file_size, + $text_dir, + array $repopulate, + array $where_clause_array + ) { + $html_output = $this->getHeadAndFootOfInsertRowTable($url_params) + . ''; + + //store the default value for CharEditing + $default_char_editing = $GLOBALS['cfg']['CharEditing']; + $mime_map = Transformations::getMIME($db, $table); + $where_clause = ''; + if (isset($where_clause_array[$row_id])) { + $where_clause = $where_clause_array[$row_id]; + } + for ($column_number = 0; $column_number < $columns_cnt; $column_number++) { + $table_column = $table_columns[$column_number]; + $column_mime = array(); + if (isset($mime_map[$table_column['Field']])) { + $column_mime = $mime_map[$table_column['Field']]; + } + + $virtual = [ + 'VIRTUAL', + 'PERSISTENT', + 'VIRTUAL GENERATED', + 'STORED GENERATED', + ]; + if (! in_array($table_column['Extra'], $virtual)) { + $html_output .= $this->getHtmlForInsertEditFormColumn( + $table_columns, + $column_number, + $comments_map, + $timestamp_seen, + $current_result, + $chg_evt_handler, + $jsvkey, + $vkey, + $insert_mode, + $current_row, + $o_rows, + $tabindex, + $columns_cnt, + $is_upload, + $tabindex_for_function, + $foreigners, + $tabindex_for_null, + $tabindex_for_value, + $table, + $db, + $row_id, + $titles, + $biggest_max_file_size, + $default_char_editing, + $text_dir, + $repopulate, + $column_mime, + $where_clause + ); + } + } // end for + $o_rows++; + $html_output .= ' ' + . '
      ' . __('Column') . '' . __('Null') . '' . __('Value') . '
      ' + . '' + . '
      ' + . $column['Field_title'] + . '' + . '' + . '' . $column['pma_type'] . '' + . '

      ' + . '
      '; + + return $html_output; + } + + /** + * Returns whether the user has necessary insert/update privileges for the column + * + * @param array $table_column array of column details + * @param bool $insert_mode whether on insert mode + * + * @return boolean whether user has necessary privileges + */ + private function userHasColumnPrivileges(array $table_column, $insert_mode) + { + $privileges = $table_column['Privileges']; + return ($insert_mode && strstr($privileges, 'insert') !== false) + || (! $insert_mode && strstr($privileges, 'update') !== false); + } +} diff --git a/phpMyAdmin/libraries/classes/IpAllowDeny.php b/phpMyAdmin/libraries/classes/IpAllowDeny.php new file mode 100755 index 0000000..efc37b6 --- /dev/null +++ b/phpMyAdmin/libraries/classes/IpAllowDeny.php @@ -0,0 +1,306 @@ + -1 + || mb_strpos($ipToTest, ':') > -1 + ) { + // assume IPv6 + $result = self::ipv6MaskTest($testRange, $ipToTest); + } else { + $result = self::ipv4MaskTest($testRange, $ipToTest); + } + + return $result; + } // end of the "self::ipMaskTest()" function + + /** + * Based on IP Pattern Matcher + * Originally by J.Adams + * Found on + * Modified for phpMyAdmin + * + * Matches: + * xxx.xxx.xxx.xxx (exact) + * xxx.xxx.xxx.[yyy-zzz] (range) + * xxx.xxx.xxx.xxx/nn (CIDR) + * + * Does not match: + * xxx.xxx.xxx.xx[yyy-zzz] (range, partial octets not supported) + * + * @param string $testRange string of IP range to match + * @param string $ipToTest string of IP to test against range + * + * @return boolean whether the IP mask matches + * + * @access public + */ + public static function ipv4MaskTest($testRange, $ipToTest) + { + $result = true; + $match = preg_match( + '|([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/([0-9]+)|', + $testRange, + $regs + ); + if ($match) { + // performs a mask match + $ipl = ip2long($ipToTest); + $rangel = ip2long( + $regs[1] . '.' . $regs[2] . '.' . $regs[3] . '.' . $regs[4] + ); + + $maskl = 0; + + for ($i = 0; $i < 31; $i++) { + if ($i < $regs[5] - 1) { + $maskl = $maskl + pow(2, (30 - $i)); + } // end if + } // end for + + return ($maskl & $rangel) == ($maskl & $ipl); + } + + // range based + $maskocts = explode('.', $testRange); + $ipocts = explode('.', $ipToTest); + + // perform a range match + for ($i = 0; $i < 4; $i++) { + if (preg_match('|\[([0-9]+)\-([0-9]+)\]|', $maskocts[$i], $regs)) { + if (($ipocts[$i] > $regs[2]) || ($ipocts[$i] < $regs[1])) { + $result = false; + } // end if + } else { + if ($maskocts[$i] <> $ipocts[$i]) { + $result = false; + } // end if + } // end if/else + } //end for + + return $result; + } // end of the "self::ipv4MaskTest()" function + + /** + * IPv6 matcher + * CIDR section taken from https://stackoverflow.com/a/10086404 + * Modified for phpMyAdmin + * + * Matches: + * xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx + * (exact) + * xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:[yyyy-zzzz] + * (range, only at end of IP - no subnets) + * xxxx:xxxx:xxxx:xxxx/nn + * (CIDR) + * + * Does not match: + * xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xx[yyy-zzz] + * (range, partial octets not supported) + * + * @param string $test_range string of IP range to match + * @param string $ip_to_test string of IP to test against range + * + * @return boolean whether the IP mask matches + * + * @access public + */ + public static function ipv6MaskTest($test_range, $ip_to_test) + { + $result = true; + + // convert to lowercase for easier comparison + $test_range = mb_strtolower($test_range); + $ip_to_test = mb_strtolower($ip_to_test); + + $is_cidr = mb_strpos($test_range, '/') > -1; + $is_range = mb_strpos($test_range, '[') > -1; + $is_single = ! $is_cidr && ! $is_range; + + $ip_hex = bin2hex(inet_pton($ip_to_test)); + + if ($is_single) { + $range_hex = bin2hex(inet_pton($test_range)); + $result = hash_equals($ip_hex, $range_hex); + return $result; + } + + if ($is_range) { + // what range do we operate on? + $range_match = array(); + $match = preg_match( + '/\[([0-9a-f]+)\-([0-9a-f]+)\]/', $test_range, $range_match + ); + if ($match) { + $range_start = $range_match[1]; + $range_end = $range_match[2]; + + // get the first and last allowed IPs + $first_ip = str_replace($range_match[0], $range_start, $test_range); + $first_hex = bin2hex(inet_pton($first_ip)); + $last_ip = str_replace($range_match[0], $range_end, $test_range); + $last_hex = bin2hex(inet_pton($last_ip)); + + // check if the IP to test is within the range + $result = ($ip_hex >= $first_hex && $ip_hex <= $last_hex); + } + return $result; + } + + if ($is_cidr) { + // Split in address and prefix length + list($first_ip, $subnet) = explode('/', $test_range); + + // Parse the address into a binary string + $first_bin = inet_pton($first_ip); + $first_hex = bin2hex($first_bin); + + $flexbits = 128 - $subnet; + + // Build the hexadecimal string of the last address + $last_hex = $first_hex; + + $pos = 31; + while ($flexbits > 0) { + // Get the character at this position + $orig = mb_substr($last_hex, $pos, 1); + + // Convert it to an integer + $origval = hexdec($orig); + + // OR it with (2^flexbits)-1, with flexbits limited to 4 at a time + $newval = $origval | (pow(2, min(4, $flexbits)) - 1); + + // Convert it back to a hexadecimal character + $new = dechex($newval); + + // And put that character back in the string + $last_hex = substr_replace($last_hex, $new, $pos, 1); + + // We processed one nibble, move to previous position + $flexbits -= 4; + --$pos; + } + + // check if the IP to test is within the range + $result = ($ip_hex >= $first_hex && $ip_hex <= $last_hex); + } + + return $result; + } // end of the "self::ipv6MaskTest()" function + + /** + * Runs through IP Allow/Deny rules the use of it below for more information + * + * @param string $type 'allow' | 'deny' type of rule to match + * + * @return bool Whether rule has matched + * + * @access public + * + * @see Core::getIp() + */ + public static function allowDeny($type) + { + global $cfg; + + // Grabs true IP of the user and returns if it can't be found + $remote_ip = Core::getIp(); + if (empty($remote_ip)) { + return false; + } + + // copy username + $username = $cfg['Server']['user']; + + // copy rule database + if (isset($cfg['Server']['AllowDeny']['rules'])) { + $rules = $cfg['Server']['AllowDeny']['rules']; + if (! is_array($rules)) { + $rules = array(); + } + } else { + $rules = array(); + } + + // lookup table for some name shortcuts + $shortcuts = array( + 'all' => '0.0.0.0/0', + 'localhost' => '127.0.0.1/8' + ); + + // Provide some useful shortcuts if server gives us address: + if (Core::getenv('SERVER_ADDR')) { + $shortcuts['localnetA'] = Core::getenv('SERVER_ADDR') . '/8'; + $shortcuts['localnetB'] = Core::getenv('SERVER_ADDR') . '/16'; + $shortcuts['localnetC'] = Core::getenv('SERVER_ADDR') . '/24'; + } + + foreach ($rules as $rule) { + // extract rule data + $rule_data = explode(' ', $rule); + + // check for rule type + if ($rule_data[0] != $type) { + continue; + } + + // check for username + if (($rule_data[1] != '%') //wildcarded first + && (! hash_equals($rule_data[1], $username)) + ) { + continue; + } + + // check if the config file has the full string with an extra + // 'from' in it and if it does, just discard it + if ($rule_data[2] == 'from') { + $rule_data[2] = $rule_data[3]; + } + + // Handle shortcuts with above array + if (isset($shortcuts[$rule_data[2]])) { + $rule_data[2] = $shortcuts[$rule_data[2]]; + } + + // Add code for host lookups here + // Excluded for the moment + + // Do the actual matching now + if (self::ipMaskTest($rule_data[2], $remote_ip)) { + return true; + } + } // end while + + return false; + } // end of the "self::allowDeny()" function +} diff --git a/phpMyAdmin/libraries/classes/Language.php b/phpMyAdmin/libraries/classes/Language.php new file mode 100755 index 0000000..36e65f7 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Language.php @@ -0,0 +1,202 @@ +code = $code; + $this->name = $name; + $this->native = $native; + if (strpos($regex, '[-_]') === false) { + $regex = str_replace('|', '([-_][[:alpha:]]{2,3})?|', $regex); + } + $this->regex = $regex; + $this->mysql = $mysql; + } + + /** + * Returns native name for language + * + * @return string + */ + public function getNativeName() + { + return $this->native; + } + + /** + * Returns English name for language + * + * @return string + */ + public function getEnglishName() + { + return $this->name; + } + + /** + * Returns verbose name for language + * + * @return string + */ + public function getName() + { + if (! empty($this->native)) { + return $this->native . ' - ' . $this->name; + } + + return $this->name; + } + + /** + * Returns language code + * + * @return string + */ + public function getCode() + { + return $this->code; + } + + /** + * Returns MySQL locale code, can be empty + * + * @return string + */ + public function getMySQLLocale() + { + return $this->mysql; + } + + /** + * Compare function used for sorting + * + * @param Language $other Other object to compare + * + * @return int same as strcmp + */ + public function cmp($other) + { + return strcmp($this->name, $other->name); + } + + /** + * Checks whether language is currently active. + * + * @return bool + */ + public function isActive() + { + return $GLOBALS['lang'] == $this->code; + } + + /** + * Checks whether language matches HTTP header Accept-Language. + * + * @param string $header Header content + * + * @return bool + */ + public function matchesAcceptLanguage($header) + { + $pattern = '/^(' + . addcslashes($this->regex, '/') + . ')(;q=[0-9]\\.[0-9])?$/i'; + return preg_match($pattern, $header); + } + + /** + * Checks whether language matches HTTP header User-Agent + * + * @param string $header Header content + * + * @return bool + */ + public function matchesUserAgent($header) + { + $pattern = '/(\(|\[|;[[:space:]])(' + . addcslashes($this->regex, '/') + . ')(;|\]|\))/i'; + return preg_match($pattern, $header); + } + + /** + * Checks whether language is RTL + * + * @return bool + */ + public function isRTL() + { + return in_array($this->code, array('ar', 'fa', 'he', 'ur')); + } + + /** + * Activates given translation + * + * @return bool + */ + public function activate() + { + $GLOBALS['lang'] = $this->code; + + // Set locale + _setlocale(0, $this->code); + _bindtextdomain('phpmyadmin', LOCALE_PATH); + _textdomain('phpmyadmin'); + // Set PHP locale as well + if (function_exists('setlocale')) { + setlocale(0, $this->code); + } + + /* Text direction for language */ + if ($this->isRTL()) { + $GLOBALS['text_dir'] = 'rtl'; + } else { + $GLOBALS['text_dir'] = 'ltr'; + } + + /* TCPDF */ + $GLOBALS['l'] = array(); + + /* TCPDF settings */ + $GLOBALS['l']['a_meta_charset'] = 'UTF-8'; + $GLOBALS['l']['a_meta_dir'] = $GLOBALS['text_dir']; + $GLOBALS['l']['a_meta_language'] = $this->code; + + /* TCPDF translations */ + $GLOBALS['l']['w_page'] = __('Page number:'); + + /* Show possible warnings from langauge selection */ + LanguageManager::getInstance()->showWarnings(); + } +} diff --git a/phpMyAdmin/libraries/classes/LanguageManager.php b/phpMyAdmin/libraries/classes/LanguageManager.php new file mode 100755 index 0000000..6fd5596 --- /dev/null +++ b/phpMyAdmin/libraries/classes/LanguageManager.php @@ -0,0 +1,1001 @@ + array( + 'af', + 'Afrikaans', + '', + 'af|afrikaans', + '', + ), + 'am' => array( + 'am', + 'Amharic', + '釆犪垱釄姏', + 'am|amharic', + '', + ), + 'ar' => array( + 'ar', + 'Arabic', + 'العربية', + 'ar|arabic', + 'ar_AE', + ), + 'ar_ly' => array( + 'ar_LY', + 'Arabic (Libya)', + '賱賷亘賷', + 'ar[_-]ly|arabic (libya)|libian arabic', + 'ar_LY', + ), + 'az' => array( + 'az', + 'Azerbaijani', + 'Azərbaycanca', + 'az|azerbaijani', + '', + ), + 'bn' => array( + 'bn', + 'Bangla', + '唳唳傕Σ唳�', + 'bn|bangla', + '', + ), + 'be' => array( + 'be', + 'Belarusian', + 'Беларуская', + 'be|belarusian', + 'be_BY', + ), + 'be@latin' => array( + 'be@latin', + 'Belarusian (latin)', + 'Biełaruskaja', + 'be[-_]lat|be@latin|belarusian latin', + '', + ), + 'ber' => array( + 'ber', + 'Berber', + 'Tamazi桑t', + 'ber|berber', + '', + ), + 'bg' => array( + 'bg', + 'Bulgarian', + 'Български', + 'bg|bulgarian', + 'bg_BG', + ), + 'bs' => array( + 'bs', + 'Bosnian', + 'Bosanski', + 'bs|bosnian', + '', + ), + 'br' => array( + 'br', + 'Breton', + 'Brezhoneg', + 'br|breton', + '', + ), + 'brx' => array( + 'brx', + 'Bodo', + '啶ぁ啶监', + 'brx|bodo', + '', + ), + 'ca' => array( + 'ca', + 'Catalan', + 'Català', + 'ca|catalan', + 'ca_ES', + ), + 'ckb' => array( + 'ckb', + 'Sorani', + '爻蹎乇丕賳蹖', + 'ckb|sorani', + '', + ), + 'cs' => array( + 'cs', + 'Czech', + '膶e拧tina', + 'cs|czech', + 'cs_CZ', + ), + 'cy' => array( + 'cy', + 'Welsh', + 'Cymraeg', + 'cy|welsh', + '', + ), + 'da' => array( + 'da', + 'Danish', + 'Dansk', + 'da|danish', + 'da_DK', + ), + 'de' => array( + 'de', + 'German', + 'Deutsch', + 'de|german', + 'de_DE', + ), + 'el' => array( + 'el', + 'Greek', + 'Ελληνικά', + 'el|greek', + '', + ), + 'en' => array( + 'en', + 'English', + '', + 'en|english', + 'en_US', + ), + 'en_gb' => array( + 'en_GB', + 'English (United Kingdom)', + '', + 'en[_-]gb|english (United Kingdom)', + 'en_GB', + ), + 'eo' => array( + 'eo', + 'Esperanto', + 'Esperanto', + 'eo|esperanto', + '', + ), + 'es' => array( + 'es', + 'Spanish', + 'Español', + 'es|spanish', + 'es_ES', + ), + 'et' => array( + 'et', + 'Estonian', + 'Eesti', + 'et|estonian', + 'et_EE', + ), + 'eu' => array( + 'eu', + 'Basque', + 'Euskara', + 'eu|basque', + 'eu_ES', + ), + 'fa' => array( + 'fa', + 'Persian', + 'فارسی', + 'fa|persian', + '', + ), + 'fi' => array( + 'fi', + 'Finnish', + 'Suomi', + 'fi|finnish', + 'fi_FI', + ), + 'fil' => array( + 'fil', + 'Filipino', + 'Pilipino', + 'fil|filipino', + '', + ), + 'fr' => array( + 'fr', + 'French', + 'Français', + 'fr|french', + 'fr_FR', + ), + 'fy' => array( + 'fy', + 'Frisian', + 'Frysk', + 'fy|frisian', + '', + ), + 'gl' => array( + 'gl', + 'Galician', + 'Galego', + 'gl|galician', + 'gl_ES', + ), + 'gu' => array( + 'gu', + 'Gujarati', + '嗒椸珌嗒溹嗒距喃�', + 'gu|gujarati', + 'gu_IN', + ), + 'he' => array( + 'he', + 'Hebrew', + 'עברית', + 'he|hebrew', + 'he_IL', + ), + 'hi' => array( + 'hi', + 'Hindi', + 'हिन्दी', + 'hi|hindi', + 'hi_IN', + ), + 'hr' => array( + 'hr', + 'Croatian', + 'Hrvatski', + 'hr|croatian', + 'hr_HR', + ), + 'hu' => array( + 'hu', + 'Hungarian', + 'Magyar', + 'hu|hungarian', + 'hu_HU', + ), + 'hy' => array( + 'hy', + 'Armenian', + '諃铡盏榨謤乍斩', + 'hy|armenian', + '', + ), + 'ia' => array( + 'ia', + 'Interlingua', + '', + 'ia|interlingua', + '', + ), + 'id' => array( + 'id', + 'Indonesian', + 'Bahasa Indonesia', + 'id|indonesian', + 'id_ID', + ), + 'ig' => array( + 'ig', + 'Igbo', + 'As峄峄� Igbo', + 'ig|igbo', + '', + ), + 'it' => array( + 'it', + 'Italian', + 'Italiano', + 'it|italian', + 'it_IT', + ), + 'ja' => array( + 'ja', + 'Japanese', + '日本語', + 'ja|japanese', + 'ja_JP', + ), + 'ko' => array( + 'ko', + 'Korean', + '한국어', + 'ko|korean', + 'ko_KR', + ), + 'ka' => array( + 'ka', + 'Georgian', + 'ქართული', + 'ka|georgian', + '', + ), + 'kab' => array( + 'kab', + 'Kabylian', + 'Taqbaylit', + 'kab|kabylian', + '', + ), + 'kk' => array( + 'kk', + 'Kazakh', + '覛邪蟹邪覜', + 'kk|kazakh', + '', + ), + 'km' => array( + 'km', + 'Khmer', + '釣佱煉釣樶焸釣�', + 'km|khmer', + '', + ), + 'kn' => array( + 'kn', + 'Kannada', + '嗖曕波喑嵿波嗖�', + 'kn|kannada', + '', + ), + 'ksh' => array( + 'ksh', + 'Colognian', + 'K枚lsch', + 'ksh|colognian', + '', + ), + 'ku' => array( + 'ku', + 'Kurdish', + '讴賵乇丿蹖', + 'ku|kurdish', + '', + ), + 'ky' => array( + 'ky', + 'Kyrgyz', + '袣褘褉谐褘蟹褔邪', + 'ky|kyrgyz', + '', + ), + 'li' => array( + 'li', + 'Limburgish', + 'L猫mb枚rgs', + 'li|limburgish', + '', + ), + 'lt' => array( + 'lt', + 'Lithuanian', + 'Lietuvių', + 'lt|lithuanian', + 'lt_LT', + ), + 'lv' => array( + 'lv', + 'Latvian', + 'Latviešu', + 'lv|latvian', + 'lv_LV', + ), + 'mk' => array( + 'mk', + 'Macedonian', + 'Macedonian', + 'mk|macedonian', + 'mk_MK', + ), + 'ml' => array( + 'ml', + 'Malayalam', + 'Malayalam', + 'ml|malayalam', + '', + ), + 'mn' => array( + 'mn', + 'Mongolian', + 'Монгол', + 'mn|mongolian', + 'mn_MN', + ), + 'ms' => array( + 'ms', + 'Malay', + 'Bahasa Melayu', + 'ms|malay', + 'ms_MY', + ), + 'my' => array( + 'my', + 'Burmese', + '醼欋�坚�斸�横�欋��', + 'my|burmese', + '', + ), + 'ne' => array( + 'ne', + 'Nepali', + '啶ㄠ啶ぞ啶侧', + 'ne|nepali', + '', + ), + 'nb' => array( + 'nb', + 'Norwegian', + 'Norsk', + 'nb|norwegian', + 'nb_NO', + ), + 'nn' => array( + 'nn', + 'Norwegian Nynorsk', + 'Nynorsk', + 'nn|nynorsk', + 'nn_NO', + ), + 'nl' => array( + 'nl', + 'Dutch', + 'Nederlands', + 'nl|dutch', + 'nl_NL', + ), + 'pa' => array( + 'pa', + 'Punjabi', + '啜┌啜溹ň啜﹢', + 'pa|punjabi', + '', + ), + 'pl' => array( + 'pl', + 'Polish', + 'Polski', + 'pl|polish', + 'pl_PL', + ), + 'pt_br' => array( + 'pt_BR', + 'Brazilian Portuguese', + 'Português', + 'pt[-_]br|brazilian portuguese', + 'pt_BR', + ), + 'pt' => array( + 'pt', + 'Portuguese', + 'Português', + 'pt|portuguese', + 'pt_PT', + ), + 'rcf' => array( + 'rcf', + 'Réunion Creole', + 'Kréol', + 'rcf|creole (reunion)', + '', + ), + 'ro' => array( + 'ro', + 'Romanian', + 'Română', + 'ro|romanian', + 'ro_RO', + ), + 'ru' => array( + 'ru', + 'Russian', + 'Русский', + 'ru|russian', + 'ru_RU', + ), + 'si' => array( + 'si', + 'Sinhala', + 'සිංහල', + 'si|sinhala', + '', + ), + 'sk' => array( + 'sk', + 'Slovak', + 'Slovenčina', + 'sk|slovak', + 'sk_SK', + ), + 'sl' => array( + 'sl', + 'Slovenian', + 'Slovenščina', + 'sl|slovenian', + 'sl_SI', + ), + 'sq' => array( + 'sq', + 'Albanian', + 'Shqip', + 'sq|albanian', + 'sq_AL', + ), + 'sr@latin' => array( + 'sr@latin', + 'Serbian (latin)', + 'Srpski', + 'sr[-_]lat|sr@latin|serbian latin', + 'sr_YU', + ), + 'sr' => array( + 'sr', + 'Serbian', + 'Српски', + 'sr|serbian', + 'sr_YU', + ), + 'sv' => array( + 'sv', + 'Swedish', + 'Svenska', + 'sv|swedish', + 'sv_SE', + ), + 'ta' => array( + 'ta', + 'Tamil', + '喈む喈苦喁�', + 'ta|tamil', + 'ta_IN', + ), + 'te' => array( + 'te', + 'Telugu', + '喟む眴喟侧眮喟椸眮', + 'te|telugu', + 'te_IN', + ), + 'th' => array( + 'th', + 'Thai', + 'ภาษาไทย', + 'th|thai', + 'th_TH', + ), + 'tk' => array( + 'tk', + 'Turkmen', + 'T眉rkmen莽e', + 'tk|turkmen', + '', + ), + 'tr' => array( + 'tr', + 'Turkish', + 'Türkçe', + 'tr|turkish', + 'tr_TR', + ), + 'tt' => array( + 'tt', + 'Tatarish', + 'Tatarça', + 'tt|tatarish', + '', + ), + 'tzm' => array( + 'tzm', + 'Central Atlas Tamazight', + 'Tamazi桑t', + 'tzm|central atlas tamazight', + '', + ), + 'ug' => array( + 'ug', + 'Uyghur', + '卅蹏賷睾蹏乇趩蹠', + 'ug|uyghur', + '', + ), + 'uk' => array( + 'uk', + 'Ukrainian', + 'Українська', + 'uk|ukrainian', + 'uk_UA', + ), + 'ur' => array( + 'ur', + 'Urdu', + '丕購乇丿賵購', + 'ur|urdu', + 'ur_PK', + ), + 'uz@latin' => array( + 'uz@latin', + 'Uzbek (latin)', + 'O‘zbekcha', + 'uz[-_]lat|uz@latin|uzbek-latin', + '', + ), + 'uz' => array( + 'uz', + 'Uzbek (cyrillic)', + 'Ўзбекча', + 'uz[-_]cyr|uz@cyrillic|uzbek-cyrillic', + '', + ), + 'vi' => array( + 'vi', + 'Vietnamese', + 'Ti岷縩g Vi峄噒', + 'vi|vietnamese', + 'vi_VN', + ), + 'vls' => array( + 'vls', + 'Flemish', + 'West-Vlams', + 'vls|flemish', + '', + ), + 'zh_tw' => array( + 'zh_TW', + 'Chinese traditional', + '中文', + 'zh[-_](tw|hk)|chinese traditional', + 'zh_TW', + ), + // only TW and HK use traditional Chinese while others (CN, SG, MY) + // use simplified Chinese + 'zh_cn' => array( + 'zh_CN', + 'Chinese simplified', + '中文', + 'zh(?![-_](tw|hk))([-_][[:alpha:]]{2,3})?|chinese simplified', + 'zh_CN', + ), + ); + + private $_available_locales; + private $_available_languages; + private $_lang_failed_cfg; + private $_lang_failed_cookie; + private $_lang_failed_request; + private static $instance; + + /** + * Returns LanguageManager singleton + * + * @return LanguageManager + */ + public static function getInstance() + { + if (self::$instance === null) { + self::$instance = new LanguageManager; + } + return self::$instance; + } + + /** + * Returns list of available locales + * + * @return array + */ + public function listLocaleDir() + { + $result = array('en'); + + /* Check for existing directory */ + if (!is_dir(LOCALE_PATH)) { + return $result; + } + + /* Open the directory */ + $handle = @opendir(LOCALE_PATH); + /* This can happen if the kit is English-only */ + if ($handle === false) { + return $result; + } + + /* Process all files */ + while (false !== ($file = readdir($handle))) { + $path = LOCALE_PATH + . '/' . $file + . '/LC_MESSAGES/phpmyadmin.mo'; + if ($file != "." + && $file != ".." + && @file_exists($path) + ) { + $result[] = $file; + } + } + /* Close the handle */ + closedir($handle); + + return $result; + } + + /** + * Returns (cached) list of all available locales + * + * @return array of strings + */ + public function availableLocales() + { + if (! $this->_available_locales) { + + if (! isset($GLOBALS['PMA_Config']) || empty($GLOBALS['PMA_Config']->get('FilterLanguages'))) { + $this->_available_locales = $this->listLocaleDir(); + } else { + $this->_available_locales = preg_grep( + '@' . $GLOBALS['PMA_Config']->get('FilterLanguages') . '@', + $this->listLocaleDir() + ); + } + } + return $this->_available_locales; + } + + /** + * Checks whether there are some languages available + * + * @return boolean + */ + public function hasChoice() + { + return count($this->availableLanguages()) > 1; + } + + /** + * Returns (cached) list of all available languages + * + * @return array of Language objects + */ + public function availableLanguages() + { + if (! $this->_available_languages) { + $this->_available_languages = array(); + + foreach($this->availableLocales() as $lang) { + $lang = strtolower($lang); + if (isset($this::$_language_data[$lang])) { + $data = $this::$_language_data[$lang]; + $this->_available_languages[$lang] = new Language( + $data[0], + $data[1], + $data[2], + $data[3], + $data[4] + ); + } else { + $this->_available_languages[$lang] = new Language( + $lang, + ucfirst($lang), + ucfirst($lang), + $lang, + '' + ); + } + } + } + return $this->_available_languages; + } + + /** + * Returns (cached) list of all available languages sorted + * by name + * + * @return array of Language objects + */ + public function sortedLanguages() + { + $this->availableLanguages(); + uasort($this->_available_languages, function($a, $b) + { + return $a->cmp($b); + } + ); + return $this->_available_languages; + } + + /** + * Return Language object for given code + * + * @param string $code Language code + * + * @return object|false Language object or false on failure + */ + public function getLanguage($code) + { + $code = strtolower($code); + $langs = $this->availableLanguages(); + if (isset($langs[$code])) { + return $langs[$code]; + } + return false; + } + + /** + * Return currently active Language object + * + * @return object Language object + */ + public function getCurrentLanguage() + { + return $this->_available_languages[strtolower($GLOBALS['lang'])]; + } + + /** + * Activates language based on configuration, user preferences or + * browser + * + * @return Language + */ + public function selectLanguage() + { + // check forced language + if (! empty($GLOBALS['PMA_Config']->get('Lang'))) { + $lang = $this->getLanguage($GLOBALS['PMA_Config']->get('Lang')); + if ($lang !== false) { + return $lang; + } + $this->_lang_failed_cfg = true; + } + + // Don't use REQUEST in following code as it might be confused by cookies + // with same name. Check user requested language (POST) + if (! empty($_POST['lang'])) { + $lang = $this->getLanguage($_POST['lang']); + if ($lang !== false) { + return $lang; + } + $this->_lang_failed_request = true; + } + + // check user requested language (GET) + if (! empty($_GET['lang'])) { + $lang = $this->getLanguage($_GET['lang']); + if ($lang !== false) { + return $lang; + } + $this->_lang_failed_request = true; + } + + // check previous set language + if (! empty($GLOBALS['PMA_Config']->getCookie('pma_lang'))) { + $lang = $this->getLanguage($GLOBALS['PMA_Config']->getCookie('pma_lang')); + if ($lang !== false) { + return $lang; + } + $this->_lang_failed_cookie = true; + } + + $langs = $this->availableLanguages(); + + // try to find out user's language by checking its HTTP_ACCEPT_LANGUAGE variable; + $accepted_languages = Core::getenv('HTTP_ACCEPT_LANGUAGE'); + if ($accepted_languages) { + foreach (explode(',', $accepted_languages) as $header) { + foreach ($langs as $language) { + if ($language->matchesAcceptLanguage($header)) { + return $language; + } + } + } + } + + // try to find out user's language by checking its HTTP_USER_AGENT variable + $user_agent = Core::getenv('HTTP_USER_AGENT'); + if (! empty($user_agent)) { + foreach ($langs as $language) { + if ($language->matchesUserAgent($user_agent)) { + return $language; + } + } + } + + // Didn't catch any valid lang : we use the default settings + if (isset($langs[$GLOBALS['PMA_Config']->get('DefaultLang')])) { + return $langs[$GLOBALS['PMA_Config']->get('DefaultLang')]; + } + + // Fallback to English + return $langs['en']; + } + + /** + * Displays warnings about invalid languages. This needs to be postponed + * to show messages at time when language is initialized. + * + * @return void + */ + public function showWarnings() + { + // now, that we have loaded the language strings we can send the errors + if ($this->_lang_failed_cfg + || $this->_lang_failed_cookie + || $this->_lang_failed_request + ) { + trigger_error( + __('Ignoring unsupported language code.'), + E_USER_ERROR + ); + } + } + + + /** + * Returns HTML code for the language selector + * + * @param boolean $use_fieldset whether to use fieldset for selection + * @param boolean $show_doc whether to show documentation links + * + * @return string + * + * @access public + */ + public function getSelectorDisplay($use_fieldset = false, $show_doc = true) + { + $_form_params = array( + 'db' => $GLOBALS['db'], + 'table' => $GLOBALS['table'], + ); + + // For non-English, display "Language" with emphasis because it's + // not a proper word in the current language; we show it to help + // people recognize the dialog + $language_title = __('Language') + . (__('Language') != 'Language' ? ' - Language' : ''); + if ($show_doc) { + $language_title .= Util::showDocu('faq', 'faq7-2'); + } + + $available_languages = $this->sortedLanguages(); + + return Template::get('select_lang')->render( + array( + 'language_title' => $language_title, + 'use_fieldset' => $use_fieldset, + 'available_languages' => $available_languages, + '_form_params' => $_form_params, + ) + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Linter.php b/phpMyAdmin/libraries/classes/Linter.php new file mode 100755 index 0000000..53dd207 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Linter.php @@ -0,0 +1,179 @@ +length() : strlen($str); + + $lines = array(0); + for ($i = 0; $i < $len; ++$i) { + if ($str[$i] === "\n") { + $lines[] = $i + 1; + } + } + return $lines; + } + + /** + * Computes the number of the line and column given an absolute position. + * + * @param array $lines The starting position of each line. + * @param int $pos The absolute position + * + * @return array + */ + public static function findLineNumberAndColumn(array $lines, $pos) + { + $line = 0; + foreach ($lines as $lineNo => $lineStart) { + if ($lineStart > $pos) { + break; + } + $line = $lineNo; + } + return array($line, $pos - $lines[$line]); + } + + /** + * Runs the linting process. + * + * @param string $query The query to be checked. + * + * @return array + */ + public static function lint($query) + { + // Disabling lint for huge queries to save some resources. + if (mb_strlen($query) > 10000) { + return array( + array( + 'message' => __( + 'Linting is disabled for this query because it exceeds the ' + . 'maximum length.' + ), + 'fromLine' => 0, + 'fromColumn' => 0, + 'toLine' => 0, + 'toColumn' => 0, + 'severity' => 'warning', + ) + ); + } + + /** + * Lexer used for tokenizing the query. + * + * @var Lexer + */ + $lexer = new Lexer($query); + + /** + * Parsed used for analysing the query. + * + * @var Parser + */ + $parser = new Parser($lexer->list); + + /** + * Array containing all errors. + * + * @var array + */ + $errors = ParserError::get(array($lexer, $parser)); + + /** + * The response containing of all errors. + * + * @var array + */ + $response = array(); + + /** + * The starting position for each line. + * + * CodeMirror requires relative position to line, but the parser stores + * only the absolute position of the character in string. + * + * @var array + */ + $lines = static::getLines($query); + + // Building the response. + foreach ($errors as $idx => $error) { + + // Starting position of the string that caused the error. + list($fromLine, $fromColumn) = static::findLineNumberAndColumn( + $lines, $error[3] + ); + + // Ending position of the string that caused the error. + list($toLine, $toColumn) = static::findLineNumberAndColumn( + $lines, $error[3] + mb_strlen($error[2]) + ); + + // Building the response. + $response[] = array( + 'message' => sprintf( + __('%1$s (near %2$s)'), + htmlspecialchars($error[0]), htmlspecialchars($error[2]) + ), + 'fromLine' => $fromLine, + 'fromColumn' => $fromColumn, + 'toLine' => $toLine, + 'toColumn' => $toColumn, + 'severity' => 'error', + ); + } + + // Sending back the answer. + return $response; + } + +} diff --git a/phpMyAdmin/libraries/classes/ListAbstract.php b/phpMyAdmin/libraries/classes/ListAbstract.php new file mode 100755 index 0000000..9e28490 --- /dev/null +++ b/phpMyAdmin/libraries/classes/ListAbstract.php @@ -0,0 +1,121 @@ +item_empty; + } + + /** + * checks if the given db names exists in the current list, if there is + * missing at least one item it returns false otherwise true + * + * @return boolean true if all items exists, otherwise false + */ + public function exists() + { + $this_elements = $this->getArrayCopy(); + foreach (func_get_args() as $result) { + if (! in_array($result, $this_elements)) { + return false; + } + } + + return true; + } + + /** + * returns HTML '; + return $html; + } + + /** + * Gets HTML for replace_prefix_tbl or copy_tbl_change_prefix + * + * @param string $action action type + * @param array $urlParams URL params + * + * @return string + */ + public function getHtmlForReplacePrefixTable($action, array $urlParams) + { + $html = '
      '; + $html .= Url::getHiddenInputs($urlParams); + $html .= '
      '; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= '
      ' . __('From') . ''; + $html .= ''; + $html .= '
      ' . __('To') . ''; + $html .= ''; + $html .= '
      '; + $html .= '
      '; + $html .= ''; + $html .= '
      '; + + return $html; + } + + /** + * Gets HTML for add_prefix_tbl + * + * @param string $action action type + * @param array $urlParams URL params + * + * @return string + */ + public function getHtmlForAddPrefixTable($action, array $urlParams) + { + $html = '
      '; + $html .= Url::getHiddenInputs($urlParams); + $html .= '
      '; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= '
      ' . __('Add prefix') . ''; + $html .= ''; + $html .= '
      '; + $html .= '
      '; + $html .= ''; + $html .= '
      '; + + return $html; + } + + /** + * Gets HTML for other mult_submits actions + * + * @param string $what mult_submit type + * @param string $action action type + * @param array $urlParams URL params + * @param string $fullQuery full sql query string + * + * @return string + */ + public function getHtmlForOtherActions($what, $action, array $urlParams, $fullQuery) + { + $html = '
      '; + $html .= Url::getHiddenInputs($urlParams); + $html .= '
      '; + $html .= ''; + if ($what == 'drop_db') { + $html .= __('You are about to DESTROY a complete database!') . ' '; + } + $html .= __('Do you really want to execute the following query?'); + $html .= ''; + $html .= '' . $fullQuery . ''; + $html .= '
      '; + $html .= '
      '; + // Display option to disable foreign key checks while dropping tables + if ($what === 'drop_tbl' || $what === 'empty_tbl' || $what === 'row_delete') { + $html .= '
      '; + $html .= Util::getFKCheckbox(); + $html .= '
      '; + } + $html .= ''; + $html .= ''; + $html .= '
      '; + $html .= '
      '; + + return $html; + } + + /** + * Get query string from Selected + * + * @param string $what mult_submit type + * @param string $table table name + * @param array $selected the selected columns + * @param array $views table views + * + * @return array + */ + public function getQueryFromSelected($what, $table, array $selected, array $views) + { + $reload = false; + $fullQueryViews = null; + $fullQuery = ''; + + if ($what == 'drop_tbl') { + $fullQueryViews = ''; + } + + $selectedCount = count($selected); + $i = 0; + foreach ($selected as $selectedValue) { + switch ($what) { + case 'row_delete': + $fullQuery .= 'DELETE FROM ' + . Util::backquote(htmlspecialchars($table)) + // Do not append a "LIMIT 1" clause here + // (it's not binlog friendly). + // We don't need the clause because the calling panel permits + // this feature only when there is a unique index. + . ' WHERE ' . htmlspecialchars($selectedValue) + . ';
      '; + break; + case 'drop_db': + $fullQuery .= 'DROP DATABASE ' + . Util::backquote(htmlspecialchars($selectedValue)) + . ';
      '; + $reload = true; + break; + + case 'drop_tbl': + $current = $selectedValue; + if (!empty($views) && in_array($current, $views)) { + $fullQueryViews .= (empty($fullQueryViews) ? 'DROP VIEW ' : ', ') + . Util::backquote(htmlspecialchars($current)); + } else { + $fullQuery .= (empty($fullQuery) ? 'DROP TABLE ' : ', ') + . Util::backquote(htmlspecialchars($current)); + } + break; + + case 'empty_tbl': + $fullQuery .= 'TRUNCATE '; + $fullQuery .= Util::backquote(htmlspecialchars($selectedValue)) + . ';
      '; + break; + + case 'primary_fld': + if ($fullQuery == '') { + $fullQuery .= 'ALTER TABLE ' + . Util::backquote(htmlspecialchars($table)) + . '
        DROP PRIMARY KEY,' + . '
         ADD PRIMARY KEY(' + . '
           ' + . Util::backquote(htmlspecialchars($selectedValue)) + . ','; + } else { + $fullQuery .= '
           ' + . Util::backquote(htmlspecialchars($selectedValue)) + . ','; + } + if ($i == $selectedCount - 1) { + $fullQuery = preg_replace('@,$@', ');
      ', $fullQuery); + } + break; + + case 'drop_fld': + if ($fullQuery == '') { + $fullQuery .= 'ALTER TABLE ' + . Util::backquote(htmlspecialchars($table)); + } + $fullQuery .= '
        DROP ' + . Util::backquote(htmlspecialchars($selectedValue)) + . ','; + if ($i == $selectedCount - 1) { + $fullQuery = preg_replace('@,$@', ';
      ', $fullQuery); + } + break; + } // end switch + $i++; + } + + if ($what == 'drop_tbl') { + if (!empty($fullQuery)) { + $fullQuery .= ';
      ' . "\n"; + } + if (!empty($fullQueryViews)) { + $fullQuery .= $fullQueryViews . ';
      ' . "\n"; + } + unset($fullQueryViews); + } + + $fullQueryViews = isset($fullQueryViews) ? $fullQueryViews : null; + + return [$fullQuery, $reload, $fullQueryViews]; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Navigation.php b/phpMyAdmin/libraries/classes/Navigation/Navigation.php new file mode 100755 index 0000000..145167a --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Navigation.php @@ -0,0 +1,249 @@ +relation = new Relation(); + } + + /** + * Renders the navigation tree, or part of it + * + * @return string The navigation tree + */ + public function getDisplay() + { + /* Init */ + $retval = ''; + $response = Response::getInstance(); + if (! $response->isAjax()) { + $header = new NavigationHeader(); + $retval = $header->getDisplay(); + } + $tree = new NavigationTree(); + if (! $response->isAjax() + || ! empty($_POST['full']) + || ! empty($_POST['reload']) + ) { + if ($GLOBALS['cfg']['ShowDatabasesNavigationAsTree']) { + // provide database tree in navigation + $navRender = $tree->renderState(); + } else { + // provide legacy pre-4.0 navigation + $navRender = $tree->renderDbSelect(); + } + } else { + $navRender = $tree->renderPath(); + } + if (! $navRender) { + $retval .= Message::error( + __('An error has occurred while loading the navigation display') + )->getDisplay(); + } else { + $retval .= $navRender; + } + + if (! $response->isAjax()) { + // closes the tags that were opened by the navigation header + $retval .= '
      '; // pma_navigation_tree + $retval .= '
      '; + if (!defined('PMA_DISABLE_NAVI_SETTINGS')) { + $retval .= PageSettings::getNaviSettings(); + } + $retval .= '
      '; //pma_navi_settings_container + $retval .= '
      '; // pma_navigation_content + $retval .= $this->_getDropHandler(); + $retval .= '
      '; // pma_navigation + } + + return $retval; + } + + /** + * Add an item of navigation tree to the hidden items list in PMA database. + * + * @param string $itemName name of the navigation tree item + * @param string $itemType type of the navigation tree item + * @param string $dbName database name + * @param string $tableName table name if applicable + * + * @return void + */ + public function hideNavigationItem( + $itemName, $itemType, $dbName, $tableName = null + ) { + $navTable = Util::backquote($GLOBALS['cfgRelation']['db']) + . "." . Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); + $sqlQuery = "INSERT INTO " . $navTable + . "(`username`, `item_name`, `item_type`, `db_name`, `table_name`)" + . " VALUES (" + . "'" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'," + . "'" . $GLOBALS['dbi']->escapeString($itemName) . "'," + . "'" . $GLOBALS['dbi']->escapeString($itemType) . "'," + . "'" . $GLOBALS['dbi']->escapeString($dbName) . "'," + . "'" . (! empty($tableName)? $GLOBALS['dbi']->escapeString($tableName) : "" ) + . "')"; + $this->relation->queryAsControlUser($sqlQuery, false); + } + + /** + * Inserts Drag and Drop Import handler + * + * @return string html code for drop handler + */ + private function _getDropHandler() + { + $retval = ''; + $retval .= '
      ' + . __('Drop files here') + . '
      '; + $retval .= '
      '; + $retval .= '

      SQL upload ( '; + $retval .= '0 '; + $retval .= ') x'; + $retval .= '-

      '; + $retval .= '
      '; + $retval .= '
      '; + return $retval; + } + + /** + * Remove a hidden item of navigation tree from the + * list of hidden items in PMA database. + * + * @param string $itemName name of the navigation tree item + * @param string $itemType type of the navigation tree item + * @param string $dbName database name + * @param string $tableName table name if applicable + * + * @return void + */ + public function unhideNavigationItem( + $itemName, $itemType, $dbName, $tableName = null + ) { + $navTable = Util::backquote($GLOBALS['cfgRelation']['db']) + . "." . Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); + $sqlQuery = "DELETE FROM " . $navTable + . " WHERE" + . " `username`='" + . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'" + . " AND `item_name`='" . $GLOBALS['dbi']->escapeString($itemName) . "'" + . " AND `item_type`='" . $GLOBALS['dbi']->escapeString($itemType) . "'" + . " AND `db_name`='" . $GLOBALS['dbi']->escapeString($dbName) . "'" + . (! empty($tableName) + ? " AND `table_name`='" . $GLOBALS['dbi']->escapeString($tableName) . "'" + : "" + ); + $this->relation->queryAsControlUser($sqlQuery, false); + } + + /** + * Returns HTML for the dialog to show hidden navigation items. + * + * @param string $dbName database name + * @param string $itemType type of the items to include + * @param string $tableName table name + * + * @return string HTML for the dialog to show hidden navigation items + */ + public function getItemUnhideDialog($dbName, $itemType = null, $tableName = null) + { + $html = '
      '; + $html .= '
      '; + $html .= Url::getHiddenInputs($dbName, $tableName); + + $navTable = Util::backquote($GLOBALS['cfgRelation']['db']) + . "." . Util::backquote($GLOBALS['cfgRelation']['navigationhiding']); + $sqlQuery = "SELECT `item_name`, `item_type` FROM " . $navTable + . " WHERE `username`='" + . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'" + . " AND `db_name`='" . $GLOBALS['dbi']->escapeString($dbName) . "'" + . " AND `table_name`='" + . (! empty($tableName) ? $GLOBALS['dbi']->escapeString($tableName) : '') . "'"; + $result = $this->relation->queryAsControlUser($sqlQuery, false); + + $hidden = array(); + if ($result) { + while ($row = $GLOBALS['dbi']->fetchArray($result)) { + $type = $row['item_type']; + if (! isset($hidden[$type])) { + $hidden[$type] = array(); + } + $hidden[$type][] = $row['item_name']; + } + } + $GLOBALS['dbi']->freeResult($result); + + $typeMap = array( + 'group' => __('Groups:'), + 'event' => __('Events:'), + 'function' => __('Functions:'), + 'procedure' => __('Procedures:'), + 'table' => __('Tables:'), + 'view' => __('Views:'), + ); + if (empty($tableName)) { + $first = true; + foreach ($typeMap as $t => $lable) { + if ((empty($itemType) || $itemType == $t) + && isset($hidden[$t]) + ) { + $html .= (! $first ? '
      ' : '') + . '' . $lable . ''; + $html .= ''; + foreach ($hidden[$t] as $hiddenItem) { + $params = array( + 'unhideNavItem' => true, + 'itemType' => $t, + 'itemName' => $hiddenItem, + 'dbName' => $dbName + ); + + $html .= ''; + $html .= ''; + $html .= ''; + } + $html .= '
      ' . htmlspecialchars($hiddenItem) . '' + . Util::getIcon('show', __('Show')) + . '
      '; + $first = false; + } + } + } + + $html .= '
      '; + $html .= '
      '; + return $html; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/NavigationHeader.php b/phpMyAdmin/libraries/classes/Navigation/NavigationHeader.php new file mode 100755 index 0000000..b035525 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/NavigationHeader.php @@ -0,0 +1,259 @@ + true, + ) + ); + $class = ' class="list_container'; + if ($GLOBALS['cfg']['NavigationLinkWithMainPanel']) { + $class .= ' synced'; + } + if ($GLOBALS['cfg']['NavigationTreePointerEnable']) { + $class .= ' highlight'; + } + $class .= '"'; + $buffer = '
      '; + $buffer .= '
      '; + $buffer .= '
      '; + $buffer .= '
      '; + $buffer .= '
      '; + $buffer .= sprintf( + '', + $link_url + ); + $buffer .= $this->_logo(); + $buffer .= $this->_links(); + $buffer .= $this->_serverChoice(); + $buffer .= Util::getImage( + 'ajax_clock_small', + __('Loading鈥�'), + array( + 'style' => 'visibility: hidden; display:none', + 'class' => 'throbber', + ) + ); + $buffer .= '
      '; // pma_navigation_header + $buffer .= '
      '; + + return $buffer; + } + + /** + * Create the code for displaying the phpMyAdmin + * logo based on configuration settings + * + * @return string HTML code for the logo + */ + private function _logo() + { + $logo = 'phpMyAdmin'; + if (isset($GLOBALS['pmaThemeImage'])) { + $imgTag = ''; + if (@file_exists($GLOBALS['pmaThemeImage'] . 'logo_left.png')) { + $logo = sprintf($imgTag, $GLOBALS['pmaThemeImage'], 'logo_left.png'); + } elseif (@file_exists($GLOBALS['pmaThemeImage'] . 'pma_logo2.png')) { + $logo = sprintf($imgTag, $GLOBALS['pmaThemeImage'], 'pma_logo2.png'); + } + } + + // display Logo, depending on $GLOBALS['cfg']['NavigationDisplayLogo'] + if (!$GLOBALS['cfg']['NavigationDisplayLogo']) { + return Template::get('navigation/logo')->render([ + 'display_logo' => false, + 'use_logo_link' => false, + 'logo_link' => null, + 'link_attribs' => null, + 'logo' => $logo, + ]); + } + + if (!$GLOBALS['cfg']['NavigationLogoLink']) { + return Template::get('navigation/logo')->render([ + 'display_logo' => true, + 'use_logo_link' => false, + 'logo_link' => null, + 'link_attribs' => null, + 'logo' => $logo, + ]); + } + + $useLogoLink = true; + $linkAttriks = null; + $logoLink = trim( + htmlspecialchars($GLOBALS['cfg']['NavigationLogoLink']) + ); + // prevent XSS, see PMASA-2013-9 + // if link has protocol, allow only http and https + if (! Sanitize::checkLink($logoLink, true)) { + $logoLink = 'index.php'; + } + switch ($GLOBALS['cfg']['NavigationLogoLinkWindow']) { + case 'new': + $linkAttriks = 'target="_blank" rel="noopener noreferrer"'; + break; + case 'main': + // do not add our parameters for an external link + $host = parse_url( + $GLOBALS['cfg']['NavigationLogoLink'], + PHP_URL_HOST + ); + if (empty($host)) { + $hasStartChar = strpos($logoLink, '?'); + $logoLink .= Url::getCommon( + array(), + is_bool($hasStartChar) ? '?' : Url::getArgSeparator() + ); + } else { + $linkAttriks = 'target="_blank" rel="noopener noreferrer"'; + } + } + + return Template::get('navigation/logo')->render([ + 'display_logo' => true, + 'use_logo_link' => $useLogoLink, + 'logo_link' => $logoLink, + 'link_attribs' => $linkAttriks, + 'logo' => $logo, + ]); + } + + /** + * Creates the code for displaying the links + * at the top of the navigation panel + * + * @return string HTML code for the links + */ + private function _links() + { + // always iconic + $showIcon = true; + $showText = false; + + $retval = ''; + $retval .= ''; + $retval .= ''; + + return $retval; + } + + /** + * Displays the MySQL servers choice form + * + * @return string HTML code for the MySQL servers choice + */ + private function _serverChoice() + { + $retval = ''; + if ($GLOBALS['cfg']['NavigationDisplayServers'] + && count($GLOBALS['cfg']['Servers']) > 1 + ) { + $retval .= ''; + $retval .= '
      '; + $retval .= Select::render(true, true); + $retval .= '
      '; + $retval .= ''; + } + + return $retval; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/NavigationTree.php b/phpMyAdmin/libraries/classes/Navigation/NavigationTree.php new file mode 100755 index 0000000..1bc3594 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/NavigationTree.php @@ -0,0 +1,1579 @@ +_pos = (int) $_POST['pos']; + } elseif (isset($_GET['pos'])) { + $this->_pos = (int) $_GET['pos']; + } + if (!isset($this->_pos)) { + $this->_pos = $this->_getNavigationDbPos(); + } + // Get the active node + if (isset($_POST['aPath'])) { + $this->_aPath[0] = $this->_parsePath($_POST['aPath']); + $this->_pos2_name[0] = $_POST['pos2_name']; + $this->_pos2_value[0] = $_POST['pos2_value']; + if (isset($_POST['pos3_name'])) { + $this->_pos3_name[0] = $_POST['pos3_name']; + $this->_pos3_value[0] = $_POST['pos3_value']; + } + } else { + if (isset($_POST['n0_aPath'])) { + $count = 0; + while (isset($_POST['n' . $count . '_aPath'])) { + $this->_aPath[$count] = $this->_parsePath( + $_POST['n' . $count . '_aPath'] + ); + $index = 'n' . $count . '_pos2_'; + $this->_pos2_name[$count] = $_POST[$index . 'name']; + $this->_pos2_value[$count] = $_POST[$index . 'value']; + $index = 'n' . $count . '_pos3_'; + if (isset($_POST[$index])) { + $this->_pos3_name[$count] = $_POST[$index . 'name']; + $this->_pos3_value[$count] = $_POST[$index . 'value']; + } + $count++; + } + } + } + if (isset($_POST['vPath'])) { + $this->_vPath[0] = $this->_parsePath($_POST['vPath']); + } else { + if (isset($_POST['n0_vPath'])) { + $count = 0; + while (isset($_POST['n' . $count . '_vPath'])) { + $this->_vPath[$count] = $this->_parsePath( + $_POST['n' . $count . '_vPath'] + ); + $count++; + } + } + } + if (isset($_POST['searchClause'])) { + $this->_searchClause = $_POST['searchClause']; + } + if (isset($_POST['searchClause2'])) { + $this->_searchClause2 = $_POST['searchClause2']; + } + // Initialise the tree by creating a root node + $node = NodeFactory::getInstance('NodeDatabaseContainer', 'root'); + $this->_tree = $node; + if ($GLOBALS['cfg']['NavigationTreeEnableGrouping'] + && $GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] + ) { + $this->_tree->separator = $GLOBALS['cfg']['NavigationTreeDbSeparator']; + $this->_tree->separator_depth = 10000; + } + } + + /** + * Returns the database position for the page selector + * + * @return int + */ + private function _getNavigationDbPos() + { + $retval = 0; + + if (strlen($GLOBALS['db']) == 0) { + return $retval; + } + + /* + * @todo describe a scenario where this code is executed + */ + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $dbSeparator = $GLOBALS['dbi']->escapeString( + $GLOBALS['cfg']['NavigationTreeDbSeparator'] + ); + $query = "SELECT (COUNT(DB_first_level) DIV %d) * %d "; + $query .= "from ( "; + $query .= " SELECT distinct SUBSTRING_INDEX(SCHEMA_NAME, "; + $query .= " '%s', 1) "; + $query .= " DB_first_level "; + $query .= " FROM INFORMATION_SCHEMA.SCHEMATA "; + $query .= " WHERE `SCHEMA_NAME` < '%s' "; + $query .= ") t "; + + $retval = $GLOBALS['dbi']->fetchValue( + sprintf( + $query, + (int)$GLOBALS['cfg']['FirstLevelNavigationItems'], + (int)$GLOBALS['cfg']['FirstLevelNavigationItems'], + $dbSeparator, + $GLOBALS['dbi']->escapeString($GLOBALS['db']) + ) + ); + + return $retval; + } + + $prefixMap = array(); + if ($GLOBALS['dbs_to_test'] === false) { + $handle = $GLOBALS['dbi']->tryQuery("SHOW DATABASES"); + if ($handle !== false) { + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if (strcasecmp($arr[0], $GLOBALS['db']) >= 0) { + break; + } + + $prefix = strstr( + $arr[0], + $GLOBALS['cfg']['NavigationTreeDbSeparator'], + true + ); + if ($prefix === false) { + $prefix = $arr[0]; + } + $prefixMap[$prefix] = 1; + } + } + } else { + $databases = array(); + foreach ($GLOBALS['dbs_to_test'] as $db) { + $query = "SHOW DATABASES LIKE '" . $db . "'"; + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + continue; + } + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + $databases[] = $arr[0]; + } + } + sort($databases); + foreach ($databases as $database) { + if (strcasecmp($database, $GLOBALS['db']) >= 0) { + break; + } + + $prefix = strstr( + $database, + $GLOBALS['cfg']['NavigationTreeDbSeparator'], + true + ); + if ($prefix === false) { + $prefix = $database; + } + $prefixMap[$prefix] = 1; + } + } + + $navItems = (int)$GLOBALS['cfg']['FirstLevelNavigationItems']; + $retval = floor((count($prefixMap) / $navItems)) * $navItems; + + return $retval; + } + + /** + * Converts an encoded path to a node in string format to an array + * + * @param string $string The path to parse + * + * @return array + */ + private function _parsePath($string) + { + $path = explode('.', $string); + foreach ($path as $key => $value) { + $path[$key] = base64_decode($value); + } + + return $path; + } + + /** + * Generates the tree structure so that it can be rendered later + * + * @return Node|false The active node or false in case of failure + */ + private function _buildPath() + { + $retval = $this->_tree; + + // Add all databases unconditionally + $data = $this->_tree->getData( + 'databases', + $this->_pos, + $this->_searchClause + ); + $hiddenCounts = $this->_tree->getNavigationHidingData(); + foreach ($data as $db) { + $node = NodeFactory::getInstance('NodeDatabase', $db); + if (isset($hiddenCounts[$db])) { + $node->setHiddenCount($hiddenCounts[$db]); + } + $this->_tree->addChild($node); + } + + // Whether build other parts of the tree depends + // on whether we have any paths in $this->_aPath + foreach ($this->_aPath as $key => $path) { + $retval = $this->_buildPathPart( + $path, + $this->_pos2_name[$key], + $this->_pos2_value[$key], + isset($this->_pos3_name[$key]) ? $this->_pos3_name[$key] : '', + isset($this->_pos3_value[$key]) ? $this->_pos3_value[$key] : '' + ); + } + + return $retval; + } + + /** + * Builds a branch of the tree + * + * @param array $path A paths pointing to the branch + * of the tree that needs to be built + * @param string $type2 The type of item being paginated on + * the second level of the tree + * @param int $pos2 The position for the pagination of + * the branch at the second level of the tree + * @param string $type3 The type of item being paginated on + * the third level of the tree + * @param int $pos3 The position for the pagination of + * the branch at the third level of the tree + * + * @return Node|false The active node or false in case of failure + */ + private function _buildPathPart(array $path, $type2, $pos2, $type3, $pos3) + { + if (empty($pos2)) { + $pos2 = 0; + } + if (empty($pos3)) { + $pos3 = 0; + } + + $retval = true; + if (count($path) <= 1) { + return $retval; + } + + array_shift($path); // remove 'root' + /* @var $db NodeDatabase */ + $db = $this->_tree->getChild($path[0]); + $retval = $db; + + if ($db === false) { + return false; + } + + $containers = $this->_addDbContainers($db, $type2, $pos2); + + array_shift($path); // remove db + + if ((count($path) <= 0 || !array_key_exists($path[0], $containers)) + && count($containers) != 1 + ) { + return $retval; + } + + if (count($containers) == 1) { + $container = array_shift($containers); + } else { + $container = $db->getChild($path[0], true); + if ($container === false) { + return false; + } + } + $retval = $container; + + if (count($container->children) <= 1) { + $dbData = $db->getData( + $container->real_name, + $pos2, + $this->_searchClause2 + ); + foreach ($dbData as $item) { + switch ($container->real_name) { + case 'events': + $node = NodeFactory::getInstance( + 'NodeEvent', + $item + ); + break; + case 'functions': + $node = NodeFactory::getInstance( + 'NodeFunction', + $item + ); + break; + case 'procedures': + $node = NodeFactory::getInstance( + 'NodeProcedure', + $item + ); + break; + case 'tables': + $node = NodeFactory::getInstance( + 'NodeTable', + $item + ); + break; + case 'views': + $node = NodeFactory::getInstance( + 'NodeView', + $item + ); + break; + default: + break; + } + if (isset($node)) { + if ($type2 == $container->real_name) { + $node->pos2 = $pos2; + } + $container->addChild($node); + } + } + } + if (count($path) > 1 && $path[0] != 'tables') { + $retval = false; + + return $retval; + } + + array_shift($path); // remove container + if (count($path) <= 0) { + return $retval; + } + + /* @var $table NodeTable */ + $table = $container->getChild($path[0], true); + if ($table === false) { + if (!$db->getPresence('tables', $path[0])) { + return false; + } + + $node = NodeFactory::getInstance( + 'NodeTable', + $path[0] + ); + if ($type2 == $container->real_name) { + $node->pos2 = $pos2; + } + $container->addChild($node); + $table = $container->getChild($path[0], true); + } + $retval = $table; + $containers = $this->_addTableContainers( + $table, + $pos2, + $type3, + $pos3 + ); + array_shift($path); // remove table + if (count($path) <= 0 + || !array_key_exists($path[0], $containers) + ) { + return $retval; + } + + $container = $table->getChild($path[0], true); + $retval = $container; + $tableData = $table->getData( + $container->real_name, + $pos3 + ); + foreach ($tableData as $item) { + switch ($container->real_name) { + case 'indexes': + $node = NodeFactory::getInstance( + 'NodeIndex', + $item + ); + break; + case 'columns': + $node = NodeFactory::getInstance( + 'NodeColumn', + $item + ); + break; + case 'triggers': + $node = NodeFactory::getInstance( + 'NodeTrigger', + $item + ); + break; + default: + break; + } + if (isset($node)) { + $node->pos2 = $container->parent->pos2; + if ($type3 == $container->real_name) { + $node->pos3 = $pos3; + } + $container->addChild($node); + } + } + + return $retval; + } + + /** + * Adds containers to a node that is a table + * + * References to existing children are returned + * if this function is called twice on the same node + * + * @param NodeTable $table The table node, new containers will be + * attached to this node + * @param int $pos2 The position for the pagination of + * the branch at the second level of the tree + * @param string $type3 The type of item being paginated on + * the third level of the tree + * @param int $pos3 The position for the pagination of + * the branch at the third level of the tree + * + * @return array An array of new nodes + */ + private function _addTableContainers($table, $pos2, $type3, $pos3) + { + $retval = array(); + if ($table->hasChildren(true) == 0) { + if ($table->getPresence('columns')) { + $retval['columns'] = NodeFactory::getInstance( + 'NodeColumnContainer' + ); + } + if ($table->getPresence('indexes')) { + $retval['indexes'] = NodeFactory::getInstance( + 'NodeIndexContainer' + ); + } + if ($table->getPresence('triggers')) { + $retval['triggers'] = NodeFactory::getInstance( + 'NodeTriggerContainer' + ); + } + // Add all new Nodes to the tree + foreach ($retval as $node) { + $node->pos2 = $pos2; + if ($type3 == $node->real_name) { + $node->pos3 = $pos3; + } + $table->addChild($node); + } + } else { + foreach ($table->children as $node) { + if ($type3 == $node->real_name) { + $node->pos3 = $pos3; + } + $retval[$node->real_name] = $node; + } + } + + return $retval; + } + + /** + * Adds containers to a node that is a database + * + * References to existing children are returned + * if this function is called twice on the same node + * + * @param NodeDatabase $db The database node, new containers will be + * attached to this node + * @param string $type The type of item being paginated on + * the second level of the tree + * @param int $pos2 The position for the pagination of + * the branch at the second level of the tree + * + * @return array An array of new nodes + */ + private function _addDbContainers($db, $type, $pos2) + { + // Get items to hide + $hidden = $db->getHiddenItems('group'); + if (!$GLOBALS['cfg']['NavigationTreeShowTables'] + && !in_array('tables', $hidden) + ) { + $hidden[] = 'tables'; + } + if (!$GLOBALS['cfg']['NavigationTreeShowViews'] + && !in_array('views', $hidden) + ) { + $hidden[] = 'views'; + } + if (!$GLOBALS['cfg']['NavigationTreeShowFunctions'] + && !in_array('functions', $hidden) + ) { + $hidden[] = 'functions'; + } + if (!$GLOBALS['cfg']['NavigationTreeShowProcedures'] + && !in_array('procedures', $hidden) + ) { + $hidden[] = 'procedures'; + } + if (!$GLOBALS['cfg']['NavigationTreeShowEvents'] + && !in_array('events', $hidden) + ) { + $hidden[] = 'events'; + } + + $retval = array(); + if ($db->hasChildren(true) == 0) { + if (!in_array('tables', $hidden) && $db->getPresence('tables')) { + $retval['tables'] = NodeFactory::getInstance( + 'NodeTableContainer' + ); + } + if (!in_array('views', $hidden) && $db->getPresence('views')) { + $retval['views'] = NodeFactory::getInstance( + 'NodeViewContainer' + ); + } + if (!in_array('functions', $hidden) && $db->getPresence('functions')) { + $retval['functions'] = NodeFactory::getInstance( + 'NodeFunctionContainer' + ); + } + if (!in_array('procedures', $hidden) && $db->getPresence('procedures')) { + $retval['procedures'] = NodeFactory::getInstance( + 'NodeProcedureContainer' + ); + } + if (!in_array('events', $hidden) && $db->getPresence('events')) { + $retval['events'] = NodeFactory::getInstance( + 'NodeEventContainer' + ); + } + // Add all new Nodes to the tree + foreach ($retval as $node) { + if ($type == $node->real_name) { + $node->pos2 = $pos2; + } + $db->addChild($node); + } + } else { + foreach ($db->children as $node) { + if ($type == $node->real_name) { + $node->pos2 = $pos2; + } + $retval[$node->real_name] = $node; + } + } + + return $retval; + } + + /** + * Recursively groups tree nodes given a separator + * + * @param mixed $node The node to group or null + * to group the whole tree. If + * passed as an argument, $node + * must be of type CONTAINER + * + * @return void + */ + public function groupTree($node = null) + { + if (!isset($node)) { + $node = $this->_tree; + } + $this->groupNode($node); + foreach ($node->children as $child) { + $this->groupTree($child); + } + } + + /** + * Recursively groups tree nodes given a separator + * + * @param Node $node The node to group + * + * @return void + */ + public function groupNode($node) + { + if ($node->type != Node::CONTAINER + || !$GLOBALS['cfg']['NavigationTreeEnableExpansion'] + ) { + return; + } + + $separators = array(); + if (is_array($node->separator)) { + $separators = $node->separator; + } else { + if (strlen($node->separator)) { + $separators[] = $node->separator; + } + } + $prefixes = array(); + if ($node->separator_depth > 0) { + foreach ($node->children as $child) { + $prefix_pos = false; + foreach ($separators as $separator) { + $sep_pos = mb_strpos($child->name, $separator); + if ($sep_pos != false + && $sep_pos != mb_strlen($child->name) + && $sep_pos != 0 + && ($prefix_pos == false || $sep_pos < $prefix_pos) + ) { + $prefix_pos = $sep_pos; + } + } + if ($prefix_pos !== false) { + $prefix = mb_substr($child->name, 0, $prefix_pos); + if (!isset($prefixes[$prefix])) { + $prefixes[$prefix] = 1; + } else { + $prefixes[$prefix]++; + } + } + //Bug #4375: Check if prefix is the name of a DB, to create a group. + foreach ($node->children as $otherChild) { + if (array_key_exists($otherChild->name, $prefixes)) { + $prefixes[$otherChild->name]++; + } + } + } + //Check if prefix is the name of a DB, to create a group. + foreach ($node->children as $child) { + if (array_key_exists($child->name, $prefixes)) { + $prefixes[$child->name]++; + } + } + } + // It is not a group if it has only one item + foreach ($prefixes as $key => $value) { + if ($value == 1) { + unset($prefixes[$key]); + } + } + // rfe #1634 Don't group if there's only one group and no other items + if (count($prefixes) == 1) { + $keys = array_keys($prefixes); + $key = $keys[0]; + if ($prefixes[$key] == count($node->children) - 1) { + unset($prefixes[$key]); + } + } + if (count($prefixes)) { + /** @var Node[] $groups */ + $groups = array(); + foreach ($prefixes as $key => $value) { + + // warn about large groups + if ($value > 500 && !$this->_largeGroupWarning) { + trigger_error( + __( + 'There are large item groups in navigation panel which ' + . 'may affect the performance. Consider disabling item ' + . 'grouping in the navigation panel.' + ), + E_USER_WARNING + ); + $this->_largeGroupWarning = true; + } + + $groups[$key] = new Node( + htmlspecialchars((string) $key), + Node::CONTAINER, + true + ); + $groups[$key]->separator = $node->separator; + $groups[$key]->separator_depth = $node->separator_depth - 1; + $groups[$key]->icon = Util::getImage( + 'b_group' + ); + $groups[$key]->pos2 = $node->pos2; + $groups[$key]->pos3 = $node->pos3; + if ($node instanceof NodeTableContainer + || $node instanceof NodeViewContainer + ) { + $tblGroup = '&tbl_group=' . urlencode($key); + $groups[$key]->links = array( + 'text' => $node->links['text'] . $tblGroup, + 'icon' => $node->links['icon'] . $tblGroup, + ); + } + $node->addChild($groups[$key]); + foreach ($separators as $separator) { + $separatorLength = strlen($separator); + // FIXME: this could be more efficient + foreach ($node->children as $child) { + $keySeparatorLength = mb_strlen($key) + $separatorLength; + $name_substring = mb_substr( + $child->name, + 0, + $keySeparatorLength + ); + if (($name_substring != $key . $separator + && $child->name != $key) + || $child->type != Node::OBJECT + ) { + continue; + } + $class = get_class($child); + $className = substr($class, strrpos($class, '\\') + 1); + unset($class); + $new_child = NodeFactory::getInstance( + $className, + mb_substr( + $child->name, + $keySeparatorLength + ) + ); + + if ($new_child instanceof NodeDatabase + && $child->getHiddenCount() > 0 + ) { + $new_child->setHiddenCount($child->getHiddenCount()); + } + + $new_child->real_name = $child->real_name; + $new_child->icon = $child->icon; + $new_child->links = $child->links; + $new_child->pos2 = $child->pos2; + $new_child->pos3 = $child->pos3; + $groups[$key]->addChild($new_child); + foreach ($child->children as $elm) { + $new_child->addChild($elm); + } + $node->removeChild($child->name); + } + } + } + foreach ($prefixes as $key => $value) { + $this->groupNode($groups[$key]); + $groups[$key]->classes = "navGroup"; + } + } + } + + /** + * Renders a state of the tree, used in light mode when + * either JavaScript and/or Ajax are disabled + * + * @return string HTML code for the navigation tree + */ + public function renderState() + { + $this->_buildPath(); + $retval = $this->_quickWarp(); + $retval .= '
      '; + $retval .= '
        '; + $retval .= $this->_fastFilterHtml($this->_tree); + if ($GLOBALS['cfg']['NavigationTreeEnableExpansion'] + ) { + $retval .= $this->_controls(); + } + $retval .= '
      '; + $retval .= $this->_getPageSelector($this->_tree); + $this->groupTree(); + $retval .= "
        "; + $children = $this->_tree->children; + usort( + $children, + array('PhpMyAdmin\\Navigation\\NavigationTree', 'sortNode') + ); + $this->_setVisibility(); + for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { + if ($i == 0) { + $retval .= $this->_renderNode($children[0], true, 'first'); + } else { + if ($i + 1 != $nbChildren) { + $retval .= $this->_renderNode($children[$i], true); + } else { + $retval .= $this->_renderNode($children[$i], true, 'last'); + } + } + } + $retval .= "
      "; + + return $retval; + } + + /** + * Renders a part of the tree, used for Ajax + * requests in light mode + * + * @return string HTML code for the navigation tree + */ + public function renderPath() + { + $node = $this->_buildPath(); + if ($node === false) { + $retval = false; + } else { + $this->groupTree(); + $retval = "
      "; + if (!empty($this->_searchClause) || !empty($this->_searchClause2)) { + $retval .= "
        "; + } else { + $retval .= "
          "; + } + $listContent = $this->_fastFilterHtml($node); + $listContent .= $this->_getPageSelector($node); + $children = $node->children; + usort( + $children, + array('PhpMyAdmin\\Navigation\\NavigationTree', 'sortNode') + ); + for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { + if ($i + 1 != $nbChildren) { + $listContent .= $this->_renderNode($children[$i], true); + } else { + $listContent .= $this->_renderNode($children[$i], true, 'last'); + } + } + $retval .= $listContent; + $retval .= "
        "; + if (!$GLOBALS['cfg']['ShowDatabasesNavigationAsTree']) { + $retval .= ""; + $parents = $node->parents(true); + $retval .= urlencode($parents[0]->real_name); + $retval .= ""; + if (empty($listContent)) { + $retval .= "
        "; + $retval .= __('No tables found in database.'); + $retval .= "
        "; + } + } + $retval .= "
      "; + } + + if (!empty($this->_searchClause) || !empty($this->_searchClause2)) { + $results = 0; + if (!empty($this->_searchClause2)) { + if (is_object($node->realParent())) { + $results = $node->realParent() + ->getPresence( + $node->real_name, + $this->_searchClause2 + ); + } + } else { + $results = $this->_tree->getPresence( + 'databases', + $this->_searchClause + ); + } + $results = sprintf( + _ngettext( + '%s result found', + '%s results found', + $results + ), + $results + ); + Response::getInstance() + ->addJSON( + 'results', + $results + ); + } + + return $retval; + } + + /** + * Renders the parameters that are required on the client + * side to know which page(s) we will be requesting data from + * + * @param Node $node The node to create the pagination parameters for + * + * @return string + */ + private function _getPaginationParamsHtml($node) + { + $retval = ''; + $paths = $node->getPaths(); + if (isset($paths['aPath_clean'][2])) { + $retval .= ""; + $retval .= $paths['aPath_clean'][2]; + $retval .= ""; + $retval .= ""; + $retval .= htmlspecialchars($node->pos2); + $retval .= ""; + } + if (isset($paths['aPath_clean'][4])) { + $retval .= ""; + $retval .= $paths['aPath_clean'][4]; + $retval .= ""; + $retval .= ""; + $retval .= htmlspecialchars($node->pos3); + $retval .= ""; + } + + return $retval; + } + + /** + * Finds whether given tree matches this tree. + * + * @param array $tree Tree to check + * @param array $paths Paths to check + * + * @return boolean + */ + private function _findTreeMatch(array $tree, array $paths) + { + $match = false; + foreach ($tree as $path) { + $match = true; + foreach ($paths as $key => $part) { + if (!isset($path[$key]) || $part != $path[$key]) { + $match = false; + break; + } + } + if ($match) { + break; + } + } + + return $match; + } + + /** + * Renders a single node or a branch of the tree + * + * @param Node $node The node to render + * @param bool $recursive Bool: Whether to render a single node or a branch + * @param string $class An additional class for the list item + * + * @return string HTML code for the tree node or branch + */ + private function _renderNode($node, $recursive, $class = '') + { + $retval = ''; + $paths = $node->getPaths(); + if ($node->hasSiblings() + || $node->realParent() === false + ) { + $response = Response::getInstance(); + if ($node->type == Node::CONTAINER + && count($node->children) == 0 + && ! $response->isAjax() + ) { + return ''; + } + $retval .= '
    • '; + $sterile = array( + 'events', + 'triggers', + 'functions', + 'procedures', + 'views', + 'columns', + 'indexes', + ); + $parentName = ''; + $parents = $node->parents(false, true); + if (count($parents)) { + $parentName = $parents[0]->real_name; + } + // if node name itself is in sterile, then allow + if ($node->is_group + || (!in_array($parentName, $sterile) && !$node->isNew) + || (in_array($node->real_name, $sterile)) + ) { + $retval .= "
      "; + $iClass = ''; + if ($class == 'first') { + $iClass = " class='first'"; + } + $retval .= ""; + if (strpos($class, 'last') === false) { + $retval .= ""; + } + + $match = $this->_findTreeMatch( + $this->_vPath, + $paths['vPath_clean'] + ); + + $retval .= '_pos; + $retval .= ""; + $retval .= $this->_getPaginationParamsHtml($node); + if ($GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] + || $parentName != 'root' + ) { + $retval .= $node->getIcon($match); + } + + $retval .= ""; + $retval .= "
      "; + } else { + $retval .= "
      "; + $iClass = ''; + if ($class == 'first') { + $iClass = " class='first'"; + } + $retval .= ""; + $retval .= $this->_getPaginationParamsHtml($node); + $retval .= "
      "; + } + + $linkClass = ''; + $haveAjax = array( + 'functions', + 'procedures', + 'events', + 'triggers', + 'indexes', + ); + $parent = $node->parents(false, true); + $isNewView = $parent[0]->real_name == 'views' && $node->isNew === true; + if ($parent[0]->type == Node::CONTAINER + && (in_array($parent[0]->real_name, $haveAjax) || $isNewView) + ) { + $linkClass = ' ajax'; + } + + if ($node->type == Node::CONTAINER) { + $retval .= ""; + } + + $divClass = ''; + + if (isset($node->links['icon']) && !empty($node->links['icon'])) { + $iconLinks = $node->links['icon']; + $icons = $node->icon; + if (!is_array($iconLinks)) { + $iconLinks = array($iconLinks); + $icons = array($icons); + } + + if (count($icons) > 1) { + $divClass = 'double'; + } + } + + $retval .= "
      "; + + if (isset($node->links['icon']) && !empty($node->links['icon'])) { + $args = array(); + foreach ($node->parents(true) as $parent) { + $args[] = urlencode($parent->real_name); + } + + foreach ($icons as $key => $icon) { + $link = $this->encryptQueryParams(vsprintf($iconLinks[$key], $args)); + if ($linkClass != '') { + $retval .= ""; + $retval .= "{$icon}"; + } else { + $retval .= "{$icon}"; + } + } + } else { + $retval .= "{$node->icon}"; + } + $retval .= "
      "; + + if (isset($node->links['text'])) { + $args = array(); + foreach ($node->parents(true) as $parent) {; + $args[] = urlencode($parent->real_name); + } + $link = $this->encryptQueryParams(vsprintf($node->links['text'], $args)); + $title = isset($node->links['title']) ? $node->links['title'] : ''; + if ($node->type == Node::CONTAINER) { + $retval .= " "; + $retval .= htmlspecialchars($node->name); + $retval .= ""; + } else { + $retval .= "real_name); + $retval .= ""; + } + } else { + $retval .= " {$node->name}"; + } + $retval .= $node->getHtmlForControlButtons(); + if ($node->type == Node::CONTAINER) { + $retval .= "
      "; + } + $retval .= '
      '; + $wrap = true; + } else { + $node->visible = true; + $wrap = false; + $retval .= $this->_getPaginationParamsHtml($node); + } + + if ($recursive) { + $hide = ''; + if (!$node->visible) { + $hide = " style='display: none;'"; + } + $children = $node->children; + usort( + $children, + array('PhpMyAdmin\\Navigation\\NavigationTree', 'sortNode') + ); + $buffer = ''; + $extra_class = ''; + for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { + if ($i + 1 == $nbChildren) { + $extra_class = ' last'; + } + $buffer .= $this->_renderNode( + $children[$i], + true, + $children[$i]->classes . $extra_class + ); + } + if (!empty($buffer)) { + if ($wrap) { + $retval .= "
        "; + } + $retval .= $this->_fastFilterHtml($node); + $retval .= $this->_getPageSelector($node); + $retval .= $buffer; + if ($wrap) { + $retval .= "
    • "; + } + } + } + if ($node->hasSiblings()) { + $retval .= "
    • "; + } + + return $retval; + } + + /** + * Renders a database select box like the pre-4.0 navigation panel + * + * @return string HTML code + */ + public function renderDbSelect() + { + $this->_buildPath(); + $retval = $this->_quickWarp(); + $this->_tree->is_group = false; + $retval .= '
      '; + // Provide for pagination in database select + $retval .= Util::getListNavigator( + $this->_tree->getPresence('databases', ''), + $this->_pos, + array('server' => $GLOBALS['server']), + 'navigation.php', + 'frame_navigation', + $GLOBALS['cfg']['FirstLevelNavigationItems'], + 'pos', + array('dbselector') + ); + $children = $this->_tree->children; + $url_params = array( + 'server' => $GLOBALS['server'], + ); + $retval .= '
      '; + $retval .= '
      '; + $retval .= Url::getHiddenFields($url_params); + $retval .= '
      '; + $retval .= '
      '; + $retval .= '
        '; + $children = $this->_tree->children; + usort( + $children, + array('PhpMyAdmin\\Navigation\\NavigationTree', 'sortNode') + ); + $this->_setVisibility(); + for ($i = 0, $nbChildren = count($children); $i < $nbChildren; $i++) { + if ($i == 0) { + $retval .= $this->_renderNode($children[0], true, 'first'); + } else { + if ($i + 1 != $nbChildren) { + $retval .= $this->_renderNode($children[$i], true); + } else { + $retval .= $this->_renderNode($children[$i], true, 'last'); + } + } + } + $retval .= '
      '; + + return $retval; + } + + /** + * Makes some nodes visible based on the which node is active + * + * @return void + */ + private function _setVisibility() + { + foreach ($this->_vPath as $path) { + $node = $this->_tree; + foreach ($path as $value) { + $child = $node->getChild($value); + if ($child !== false) { + $child->visible = true; + $node = $child; + } + } + } + } + + /** + * Generates the HTML code for displaying the fast filter for tables + * + * @param Node $node The node for which to generate the fast filter html + * + * @return string LI element used for the fast filter + */ + private function _fastFilterHtml($node) + { + $retval = ''; + $filter_db_min + = (int)$GLOBALS['cfg']['NavigationTreeDisplayDbFilterMinimum']; + $filter_item_min + = (int)$GLOBALS['cfg']['NavigationTreeDisplayItemFilterMinimum']; + if ($node === $this->_tree + && $this->_tree->getPresence() >= $filter_db_min + ) { + $url_params = array( + 'pos' => 0, + ); + $retval .= '
    • '; + $retval .= '
      '; + $retval .= Url::getHiddenInputs($url_params); + $retval .= 'X'; + $retval .= "
      "; + $retval .= "
    • "; + + return $retval; + } + + if (($node->type == Node::CONTAINER + && ($node->real_name == 'tables' + || $node->real_name == 'views' + || $node->real_name == 'functions' + || $node->real_name == 'procedures' + || $node->real_name == 'events')) + && method_exists($node->realParent(), 'getPresence') + && $node->realParent()->getPresence($node->real_name) >= $filter_item_min + ) { + $paths = $node->getPaths(); + $url_params = array( + 'pos' => $this->_pos, + 'aPath' => $paths['aPath'], + 'vPath' => $paths['vPath'], + 'pos2_name' => $node->real_name, + 'pos2_value' => 0, + ); + $retval .= "
    • "; + $retval .= "
      "; + $retval .= Url::getHiddenFields($url_params); + $retval .= ""; + $retval .= "X"; + $retval .= "
      "; + $retval .= "
    • "; + } + + return $retval; + } + + /** + * Creates the code for displaying the controls + * at the top of the navigation tree + * + * @return string HTML code for the controls + */ + private function _controls() + { + // always iconic + $showIcon = true; + $showText = false; + + $retval = ''; + $retval .= ''; + $retval .= ''; + + return $retval; + } + + /** + * Generates the HTML code for displaying the list pagination + * + * @param Node $node The node for whose children the page + * selector will be created + * + * @return string + */ + private function _getPageSelector($node) + { + $retval = ''; + if ($node === $this->_tree) { + $retval .= Util::getListNavigator( + $this->_tree->getPresence('databases', $this->_searchClause), + $this->_pos, + array('server' => $GLOBALS['server']), + 'navigation.php', + 'frame_navigation', + $GLOBALS['cfg']['FirstLevelNavigationItems'], + 'pos', + array('dbselector') + ); + } else { + if ($node->type == Node::CONTAINER && !$node->is_group) { + $paths = $node->getPaths(); + + $level = isset($paths['aPath_clean'][4]) ? 3 : 2; + $_url_params = array( + 'aPath' => $paths['aPath'], + 'vPath' => $paths['vPath'], + 'pos' => $this->_pos, + 'server' => $GLOBALS['server'], + 'pos2_name' => $paths['aPath_clean'][2], + ); + if ($level == 3) { + $pos = $node->pos3; + $_url_params['pos2_value'] = $node->pos2; + $_url_params['pos3_name'] = $paths['aPath_clean'][4]; + } else { + $pos = $node->pos2; + } + $num = $node->realParent() + ->getPresence( + $node->real_name, + $this->_searchClause2 + ); + $retval .= Util::getListNavigator( + $num, + $pos, + $_url_params, + 'navigation.php', + 'frame_navigation', + $GLOBALS['cfg']['MaxNavigationItems'], + 'pos' . $level . '_value' + ); + } + } + + return $retval; + } + + /** + * Called by usort() for sorting the nodes in a container + * + * @param Node $a The first element used in the comparison + * @param Node $b The second element used in the comparison + * + * @return int See strnatcmp() and strcmp() + */ + static public function sortNode($a, $b) + { + if ($a->isNew) { + return -1; + } + + if ($b->isNew) { + return 1; + } + + if ($GLOBALS['cfg']['NaturalOrder']) { + return strnatcasecmp($a->name, $b->name); + } + + return strcasecmp($a->name, $b->name); + } + + /** + * Display quick warp links, contain Recents and Favorites + * + * @return string HTML code + */ + private function _quickWarp() + { + $retval = '
      '; + if ($GLOBALS['cfg']['NumRecentTables'] > 0) { + $retval .= RecentFavoriteTable::getInstance('recent') + ->getHtml(); + } + if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) { + $retval .= RecentFavoriteTable::getInstance('favorite') + ->getHtml(); + } + $retval .= '
      '; + $retval .= '
      '; + + return $retval; + } + + /** + * @param string $link + * + * @return string + */ + private function encryptQueryParams($link) + { + global $PMA_Config; + + if (! $PMA_Config->get('URLQueryEncryption')) { + return $link; + } + + $url = parse_url($link); + parse_str(htmlspecialchars_decode($url['query']), $query); + + return $url['path'] . '?' . htmlspecialchars(Url::buildHttpQuery($query)); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/NodeFactory.php b/phpMyAdmin/libraries/classes/Navigation/NodeFactory.php new file mode 100755 index 0000000..5c0f4dc --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/NodeFactory.php @@ -0,0 +1,91 @@ +name = $name; + $this->real_name = $name; + } + if ($type === Node::CONTAINER) { + $this->type = Node::CONTAINER; + } + $this->is_group = (bool)$is_group; + $this->relation = new Relation(); + } + + /** + * Adds a child node to this node + * + * @param Node $child A child node + * + * @return void + */ + public function addChild($child) + { + $this->children[] = $child; + $child->parent = $this; + } + + /** + * Returns a child node given it's name + * + * @param string $name The name of requested child + * @param bool $real_name Whether to use the "real_name" + * instead of "name" in comparisons + * + * @return false|Node The requested child node or false, + * if the requested node cannot be found + */ + public function getChild($name, $real_name = false) + { + if ($real_name) { + foreach ($this->children as $child) { + if ($child->real_name == $name) { + return $child; + } + } + } else { + foreach ($this->children as $child) { + if ($child->name == $name) { + return $child; + } + } + } + + return false; + } + + /** + * Removes a child node from this node + * + * @param string $name The name of child to be removed + * + * @return void + */ + public function removeChild($name) + { + foreach ($this->children as $key => $child) { + if ($child->name == $name) { + unset($this->children[$key]); + break; + } + } + } + + /** + * Retrieves the parents for a node + * + * @param bool $self Whether to include the Node itself in the results + * @param bool $containers Whether to include nodes of type CONTAINER + * @param bool $groups Whether to include nodes which have $group == true + * + * @return array An array of parent Nodes + */ + public function parents($self = false, $containers = false, $groups = false) + { + $parents = array(); + if ($self + && ($this->type != Node::CONTAINER || $containers) + && (!$this->is_group || $groups) + ) { + $parents[] = $this; + } + $parent = $this->parent; + while (isset($parent)) { + if (($parent->type != Node::CONTAINER || $containers) + && (!$parent->is_group || $groups) + ) { + $parents[] = $parent; + } + $parent = $parent->parent; + } + + return $parents; + } + + /** + * Returns the actual parent of a node. If used twice on an index or columns + * node, it will return the table and database nodes. The names of the returned + * nodes can be used in SQL queries, etc... + * + * @return Node|false + */ + public function realParent() + { + $retval = $this->parents(); + if (count($retval) <= 0) { + return false; + } + + return $retval[0]; + } + + /** + * This function checks if the node has children nodes associated with it + * + * @param bool $count_empty_containers Whether to count empty child + * containers as valid children + * + * @return bool Whether the node has child nodes + */ + public function hasChildren($count_empty_containers = true) + { + $retval = false; + if ($count_empty_containers) { + if (count($this->children)) { + $retval = true; + } + } else { + foreach ($this->children as $child) { + if ($child->type == Node::OBJECT || $child->hasChildren(false)) { + $retval = true; + break; + } + } + } + + return $retval; + } + + /** + * Returns true if the node has some siblings (other nodes on the same tree + * level, in the same branch), false otherwise. + * The only exception is for nodes on + * the third level of the tree (columns and indexes), for which the function + * always returns true. This is because we want to render the containers + * for these nodes + * + * @return bool + */ + public function hasSiblings() + { + $retval = false; + $paths = $this->getPaths(); + if (count($paths['aPath_clean']) > 3) { + $retval = true; + + return $retval; + } + + foreach ($this->parent->children as $child) { + if ($child !== $this + && ($child->type == Node::OBJECT || $child->hasChildren(false)) + ) { + $retval = true; + break; + } + } + + return $retval; + } + + /** + * Returns the number of child nodes that a node has associated with it + * + * @return int The number of children nodes + */ + public function numChildren() + { + $retval = 0; + foreach ($this->children as $child) { + if ($child->type == Node::OBJECT) { + $retval++; + } else { + $retval += $child->numChildren(); + } + } + + return $retval; + } + + /** + * Returns the actual path and the virtual paths for a node + * both as clean arrays and base64 encoded strings + * + * @return array + */ + public function getPaths() + { + $aPath = array(); + $aPath_clean = array(); + foreach ($this->parents(true, true, false) as $parent) { + $aPath[] = base64_encode($parent->real_name); + $aPath_clean[] = $parent->real_name; + } + $aPath = implode('.', array_reverse($aPath)); + $aPath_clean = array_reverse($aPath_clean); + + $vPath = array(); + $vPath_clean = array(); + foreach ($this->parents(true, true, true) as $parent) { + $vPath[] = base64_encode($parent->name); + $vPath_clean[] = $parent->name; + } + $vPath = implode('.', array_reverse($vPath)); + $vPath_clean = array_reverse($vPath_clean); + + return array( + 'aPath' => $aPath, + 'aPath_clean' => $aPath_clean, + 'vPath' => $vPath, + 'vPath_clean' => $vPath_clean, + ); + } + + /** + * Returns the names of children of type $type present inside this container + * This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase and PhpMyAdmin\Navigation\Nodes\NodeTable classes + * + * @param string $type The type of item we are looking for + * ('tables', 'views', etc) + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + public function getData($type, $pos, $searchClause = '') + { + $maxItems = $GLOBALS['cfg']['FirstLevelNavigationItems']; + if (!$GLOBALS['cfg']['NavigationTreeEnableGrouping'] + || !$GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] + ) { + if (isset($GLOBALS['cfg']['Server']['DisableIS']) + && !$GLOBALS['cfg']['Server']['DisableIS'] + ) { + $query = "SELECT `SCHEMA_NAME` "; + $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA` "; + $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); + $query .= "ORDER BY `SCHEMA_NAME` "; + $query .= "LIMIT $pos, $maxItems"; + $retval = $GLOBALS['dbi']->fetchResult($query); + + return $retval; + } + + if ($GLOBALS['dbs_to_test'] === false) { + $retval = array(); + $query = "SHOW DATABASES "; + $query .= $this->_getWhereClause('Database', $searchClause); + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + return $retval; + } + + $count = 0; + if (!$GLOBALS['dbi']->dataSeek($handle, $pos)) { + return $retval; + } + + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($count < $maxItems) { + $retval[] = $arr[0]; + $count++; + } else { + break; + } + } + + return $retval; + } + + $retval = array(); + $count = 0; + foreach ($this->_getDatabasesToSearch($searchClause) as $db) { + $query = "SHOW DATABASES LIKE '" . $db . "'"; + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + continue; + } + + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($this->_isHideDb($arr[0])) { + continue; + } + if (in_array($arr[0], $retval)) { + continue; + } + + if ($pos <= 0 && $count < $maxItems) { + $retval[] = $arr[0]; + $count++; + } + $pos--; + } + } + sort($retval); + + return $retval; + } + + $dbSeparator = $GLOBALS['cfg']['NavigationTreeDbSeparator']; + if (isset($GLOBALS['cfg']['Server']['DisableIS']) + && !$GLOBALS['cfg']['Server']['DisableIS'] + ) { + $query = "SELECT `SCHEMA_NAME` "; + $query .= "FROM `INFORMATION_SCHEMA`.`SCHEMATA`, "; + $query .= "("; + $query .= "SELECT DB_first_level "; + $query .= "FROM ( "; + $query .= "SELECT DISTINCT SUBSTRING_INDEX(SCHEMA_NAME, "; + $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "', 1) "; + $query .= "DB_first_level "; + $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; + $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); + $query .= ") t "; + $query .= "ORDER BY DB_first_level ASC "; + $query .= "LIMIT $pos, $maxItems"; + $query .= ") t2 "; + $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); + $query .= "AND 1 = LOCATE(CONCAT(DB_first_level, "; + $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "'), "; + $query .= "CONCAT(SCHEMA_NAME, "; + $query .= "'" . $GLOBALS['dbi']->escapeString($dbSeparator) . "')) "; + $query .= "ORDER BY SCHEMA_NAME ASC"; + $retval = $GLOBALS['dbi']->fetchResult($query); + + return $retval; + } + + if ($GLOBALS['dbs_to_test'] === false) { + $query = "SHOW DATABASES "; + $query .= $this->_getWhereClause('Database', $searchClause); + $handle = $GLOBALS['dbi']->tryQuery($query); + $prefixes = array(); + if ($handle !== false) { + $prefixMap = array(); + $total = $pos + $maxItems; + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + $prefix = strstr($arr[0], $dbSeparator, true); + if ($prefix === false) { + $prefix = $arr[0]; + } + $prefixMap[$prefix] = 1; + if (sizeof($prefixMap) == $total) { + break; + } + } + $prefixes = array_slice(array_keys($prefixMap), $pos); + } + + $query = "SHOW DATABASES "; + $query .= $this->_getWhereClause('Database', $searchClause); + $query .= "AND ("; + $subClauses = array(); + foreach ($prefixes as $prefix) { + $subClauses[] = " LOCATE('" + . $GLOBALS['dbi']->escapeString($prefix) . $dbSeparator + . "', " + . "CONCAT(`Database`, '" . $dbSeparator . "')) = 1 "; + } + $query .= implode("OR", $subClauses) . ")"; + $retval = $GLOBALS['dbi']->fetchResult($query); + + return $retval; + } + + $retval = array(); + $prefixMap = array(); + $total = $pos + $maxItems; + foreach ($this->_getDatabasesToSearch($searchClause) as $db) { + $query = "SHOW DATABASES LIKE '" . $db . "'"; + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + continue; + } + + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($this->_isHideDb($arr[0])) { + continue; + } + $prefix = strstr($arr[0], $dbSeparator, true); + if ($prefix === false) { + $prefix = $arr[0]; + } + $prefixMap[$prefix] = 1; + if (sizeof($prefixMap) == $total) { + break 2; + } + } + } + $prefixes = array_slice(array_keys($prefixMap), $pos); + + foreach ($this->_getDatabasesToSearch($searchClause) as $db) { + $query = "SHOW DATABASES LIKE '" . $db . "'"; + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + continue; + } + + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($this->_isHideDb($arr[0])) { + continue; + } + if (in_array($arr[0], $retval)) { + continue; + } + + foreach ($prefixes as $prefix) { + $starts_with = strpos( + $arr[0] . $dbSeparator, + $prefix . $dbSeparator + ) === 0; + if ($starts_with) { + $retval[] = $arr[0]; + break; + } + } + } + } + sort($retval); + + return $retval; + } + + /** + * Returns the number of children of type $type present inside this container + * This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase and PhpMyAdmin\Navigation\Nodes\NodeTable classes + * + * @param string $type The type of item we are looking for + * ('tables', 'views', etc) + * @param string $searchClause A string used to filter the results of the query + * + * @return int + */ + public function getPresence($type = '', $searchClause = '') + { + if (!$GLOBALS['cfg']['NavigationTreeEnableGrouping'] + || !$GLOBALS['cfg']['ShowDatabasesNavigationAsTree'] + ) { + if (isset($GLOBALS['cfg']['Server']['DisableIS']) + && !$GLOBALS['cfg']['Server']['DisableIS'] + ) { + $query = "SELECT COUNT(*) "; + $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; + $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); + $retval = (int)$GLOBALS['dbi']->fetchValue($query); + + return $retval; + } + + if ($GLOBALS['dbs_to_test'] === false) { + $query = "SHOW DATABASES "; + $query .= $this->_getWhereClause('Database', $searchClause); + $retval = $GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + + return $retval; + } + + $retval = 0; + foreach ($this->_getDatabasesToSearch($searchClause) as $db) { + $query = "SHOW DATABASES LIKE '" . $db . "'"; + $retval += $GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + } + + return $retval; + } + + $dbSeparator = $GLOBALS['cfg']['NavigationTreeDbSeparator']; + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $query = "SELECT COUNT(*) "; + $query .= "FROM ( "; + $query .= "SELECT DISTINCT SUBSTRING_INDEX(SCHEMA_NAME, "; + $query .= "'$dbSeparator', 1) "; + $query .= "DB_first_level "; + $query .= "FROM INFORMATION_SCHEMA.SCHEMATA "; + $query .= $this->_getWhereClause('SCHEMA_NAME', $searchClause); + $query .= ") t "; + $retval = (int)$GLOBALS['dbi']->fetchValue($query); + + return $retval; + } + + if ($GLOBALS['dbs_to_test'] !== false) { + $prefixMap = array(); + foreach ($this->_getDatabasesToSearch($searchClause) as $db) { + $query = "SHOW DATABASES LIKE '" . $db . "'"; + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + continue; + } + + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($this->_isHideDb($arr[0])) { + continue; + } + $prefix = strstr($arr[0], $dbSeparator, true); + if ($prefix === false) { + $prefix = $arr[0]; + } + $prefixMap[$prefix] = 1; + } + } + $retval = count($prefixMap); + + return $retval; + } + + $prefixMap = array(); + $query = "SHOW DATABASES "; + $query .= $this->_getWhereClause('Database', $searchClause); + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle !== false) { + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + $prefix = strstr($arr[0], $dbSeparator, true); + if ($prefix === false) { + $prefix = $arr[0]; + } + $prefixMap[$prefix] = 1; + } + } + $retval = count($prefixMap); + + return $retval; + } + + /** + * Detemines whether a given database should be hidden according to 'hide_db' + * + * @param string $db database name + * + * @return boolean whether to hide + */ + private function _isHideDb($db) + { + return !empty($GLOBALS['cfg']['Server']['hide_db']) + && preg_match('/' . $GLOBALS['cfg']['Server']['hide_db'] . '/', $db); + } + + /** + * Get the list of databases for 'SHOW DATABASES LIKE' queries. + * If a search clause is set it gets the highest priority while only_db gets + * the next priority. In case both are empty list of databases determined by + * GRANTs are used + * + * @param string $searchClause search clause + * + * @return array array of databases + */ + private function _getDatabasesToSearch($searchClause) + { + if (!empty($searchClause)) { + $databases = array( + "%" . $GLOBALS['dbi']->escapeString($searchClause) . "%", + ); + } elseif (!empty($GLOBALS['cfg']['Server']['only_db'])) { + $databases = $GLOBALS['cfg']['Server']['only_db']; + } elseif (!empty($GLOBALS['dbs_to_test'])) { + $databases = $GLOBALS['dbs_to_test']; + } + sort($databases); + + return $databases; + } + + /** + * Returns the WHERE clause depending on the $searchClause parameter + * and the hide_db directive + * + * @param string $columnName Column name of the column having database names + * @param string $searchClause A string used to filter the results of the query + * + * @return string + */ + private function _getWhereClause($columnName, $searchClause = '') + { + $whereClause = "WHERE TRUE "; + if (!empty($searchClause)) { + $whereClause .= "AND " . Util::backquote($columnName) + . " LIKE '%"; + $whereClause .= $GLOBALS['dbi']->escapeString($searchClause); + $whereClause .= "%' "; + } + + if (!empty($GLOBALS['cfg']['Server']['hide_db'])) { + $whereClause .= "AND " . Util::backquote($columnName) + . " NOT REGEXP '" + . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['hide_db']) + . "' "; + } + + if (!empty($GLOBALS['cfg']['Server']['only_db'])) { + if (is_string($GLOBALS['cfg']['Server']['only_db'])) { + $GLOBALS['cfg']['Server']['only_db'] = array( + $GLOBALS['cfg']['Server']['only_db'], + ); + } + $whereClause .= "AND ("; + $subClauses = array(); + foreach ($GLOBALS['cfg']['Server']['only_db'] as $each_only_db) { + $subClauses[] = " " . Util::backquote($columnName) + . " LIKE '" + . $GLOBALS['dbi']->escapeString($each_only_db) . "' "; + } + $whereClause .= implode("OR", $subClauses) . ") "; + } + + return $whereClause; + } + + /** + * Returns HTML for control buttons displayed infront of a node + * + * @return String HTML for control buttons + */ + public function getHtmlForControlButtons() + { + return ''; + } + + /** + * Returns CSS classes for a node + * + * @param boolean $match Whether the node matched loaded tree + * + * @return String with html classes. + */ + public function getCssClasses($match) + { + if (!$GLOBALS['cfg']['NavigationTreeEnableExpansion'] + ) { + return ''; + } + + $result = array('expander'); + + if ($this->is_group || $match) { + $result[] = 'loaded'; + } + if ($this->type == Node::CONTAINER) { + $result[] = 'container'; + } + + return implode(' ', $result); + } + + /** + * Returns icon for the node + * + * @param boolean $match Whether the node matched loaded tree + * + * @return String with image name + */ + public function getIcon($match) + { + if (!$GLOBALS['cfg']['NavigationTreeEnableExpansion'] + ) { + return ''; + } elseif ($match) { + $this->visible = true; + + return Util::getImage('b_minus'); + } + + return Util::getImage('b_plus', __('Expand/Collapse')); + } + + /** + * Gets the count of hidden elements for each database + * + * @return array array containing the count of hidden elements for each database + */ + public function getNavigationHidingData() + { + $cfgRelation = $this->relation->getRelationsParam(); + if ($cfgRelation['navwork']) { + $navTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote( + $cfgRelation['navigationhiding'] + ); + $sqlQuery = "SELECT `db_name`, COUNT(*) AS `count` FROM " . $navTable + . " WHERE `username`='" + . $GLOBALS['dbi']->escapeString( + $GLOBALS['cfg']['Server']['user'] + ) . "'" + . " GROUP BY `db_name`"; + $counts = $GLOBALS['dbi']->fetchResult( + $sqlQuery, + 'db_name', + 'count', + DatabaseInterface::CONNECT_CONTROL + ); + + return $counts; + } + + return null; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeColumn.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeColumn.php new file mode 100755 index 0000000..876cb22 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeColumn.php @@ -0,0 +1,41 @@ +icon = Util::getImage('pause', __('Column')); + $this->links = array( + 'text' => 'tbl_structure.php?server=' . $GLOBALS['server'] + . '&db=%3$s&table=%2$s&field=%1$s' + . '&change_column=1', + 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] + . '&db=%3$s&table=%2$s&field=%1$s' + . '&change_column=1', + 'title' => __('Structure'), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeColumnContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeColumnContainer.php new file mode 100755 index 0000000..eaa7c9c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeColumnContainer.php @@ -0,0 +1,53 @@ +icon = Util::getImage('pause', __('Columns')); + $this->links = array( + 'text' => 'tbl_structure.php?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + ); + $this->real_name = 'columns'; + + $new_label = _pgettext('Create new column', 'New'); + $new = NodeFactory::getInstance( + 'Node', + $new_label + ); + $new->isNew = true; + $new->icon = Util::getImage('b_column_add', $new_label); + $new->links = array( + 'text' => 'tbl_addfield.php?server=' . $GLOBALS['server'] + . '&db=%3$s&table=%2$s' + . '&field_where=last&after_field=', + 'icon' => 'tbl_addfield.php?server=' . $GLOBALS['server'] + . '&db=%3$s&table=%2$s' + . '&field_where=last&after_field=', + ); + $new->classes = 'new_column italics'; + $this->addChild($new); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabase.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabase.php new file mode 100755 index 0000000..0844f56 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabase.php @@ -0,0 +1,715 @@ +icon = Util::getImage( + 's_db', + __('Database operations') + ); + + $script_name = Util::getScriptNameForOption( + $GLOBALS['cfg']['DefaultTabDatabase'], + 'database' + ); + $this->links = array( + 'text' => $script_name + . '?server=' . $GLOBALS['server'] + . '&db=%1$s', + 'icon' => 'db_operations.php?server=' . $GLOBALS['server'] + . '&db=%1$s&', + 'title' => __('Structure'), + ); + $this->classes = 'database'; + } + + /** + * Returns the number of children of type $type present inside this container + * This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase + * and PhpMyAdmin\Navigation\Nodes\NodeTable classes + * + * @param string $type The type of item we are looking for + * ('tables', 'views', etc) + * @param string $searchClause A string used to filter the results of + * the query + * @param boolean $singleItem Whether to get presence of a single known + * item or false in none + * + * @return int + */ + public function getPresence($type = '', $searchClause = '', $singleItem = false) + { + $retval = 0; + switch ($type) { + case 'tables': + $retval = $this->_getTableCount($searchClause, $singleItem); + break; + case 'views': + $retval = $this->_getViewCount($searchClause, $singleItem); + break; + case 'procedures': + $retval = $this->_getProcedureCount($searchClause, $singleItem); + break; + case 'functions': + $retval = $this->_getFunctionCount($searchClause, $singleItem); + break; + case 'events': + $retval = $this->_getEventCount($searchClause, $singleItem); + break; + default: + break; + } + + return $retval; + } + + /** + * Returns the number of tables or views present inside this database + * + * @param string $which tables|views + * @param string $searchClause A string used to filter the results of + * the query + * @param boolean $singleItem Whether to get presence of a single known + * item or false in none + * + * @return int + */ + private function _getTableOrViewCount($which, $searchClause, $singleItem) + { + $db = $this->real_name; + if ($which == 'tables') { + $condition = 'IN'; + } else { + $condition = 'NOT IN'; + } + + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + $db = $GLOBALS['dbi']->escapeString($db); + $query = "SELECT COUNT(*) "; + $query .= "FROM `INFORMATION_SCHEMA`.`TABLES` "; + $query .= "WHERE `TABLE_SCHEMA`='$db' "; + $query .= "AND `TABLE_TYPE`" . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; + if (! empty($searchClause)) { + $query .= "AND " . $this->_getWhereClauseForSearch( + $searchClause, + $singleItem, + 'TABLE_NAME' + ); + } + $retval = (int)$GLOBALS['dbi']->fetchValue($query); + } else { + $query = "SHOW FULL TABLES FROM "; + $query .= Util::backquote($db); + $query .= " WHERE `Table_type`" . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; + if (!empty($searchClause)) { + $query .= "AND " . $this->_getWhereClauseForSearch( + $searchClause, + $singleItem, + 'Tables_in_' . $db + ); + } + $retval = $GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + } + + return $retval; + } + + /** + * Returns the number of tables present inside this database + * + * @param string $searchClause A string used to filter the results of + * the query + * @param boolean $singleItem Whether to get presence of a single known + * item or false in none + * + * @return int + */ + private function _getTableCount($searchClause, $singleItem) + { + return $this->_getTableOrViewCount( + 'tables', + $searchClause, + $singleItem + ); + } + + /** + * Returns the number of views present inside this database + * + * @param string $searchClause A string used to filter the results of + * the query + * @param boolean $singleItem Whether to get presence of a single known + * item or false in none + * + * @return int + */ + private function _getViewCount($searchClause, $singleItem) + { + return $this->_getTableOrViewCount( + 'views', + $searchClause, + $singleItem + ); + } + + /** + * Returns the number of procedures present inside this database + * + * @param string $searchClause A string used to filter the results of + * the query + * @param boolean $singleItem Whether to get presence of a single known + * item or false in none + * + * @return int + */ + private function _getProcedureCount($searchClause, $singleItem) + { + $db = $this->real_name; + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $db = $GLOBALS['dbi']->escapeString($db); + $query = "SELECT COUNT(*) "; + $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; + $query .= "WHERE `ROUTINE_SCHEMA` " + . Util::getCollateForIS() . "='$db'"; + $query .= "AND `ROUTINE_TYPE`='PROCEDURE' "; + if (!empty($searchClause)) { + $query .= "AND " . $this->_getWhereClauseForSearch( + $searchClause, + $singleItem, + 'ROUTINE_NAME' + ); + } + $retval = (int)$GLOBALS['dbi']->fetchValue($query); + } else { + $db = $GLOBALS['dbi']->escapeString($db); + $query = "SHOW PROCEDURE STATUS WHERE `Db`='$db' "; + if (!empty($searchClause)) { + $query .= "AND " . $this->_getWhereClauseForSearch( + $searchClause, + $singleItem, + 'Name' + ); + } + $retval = $GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + } + + return $retval; + } + + /** + * Returns the number of functions present inside this database + * + * @param string $searchClause A string used to filter the results of + * the query + * @param boolean $singleItem Whether to get presence of a single known + * item or false in none + * + * @return int + */ + private function _getFunctionCount($searchClause, $singleItem) + { + $db = $this->real_name; + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $db = $GLOBALS['dbi']->escapeString($db); + $query = "SELECT COUNT(*) "; + $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; + $query .= "WHERE `ROUTINE_SCHEMA` " + . Util::getCollateForIS() . "='$db' "; + $query .= "AND `ROUTINE_TYPE`='FUNCTION' "; + if (!empty($searchClause)) { + $query .= "AND " . $this->_getWhereClauseForSearch( + $searchClause, + $singleItem, + 'ROUTINE_NAME' + ); + } + $retval = (int)$GLOBALS['dbi']->fetchValue($query); + } else { + $db = $GLOBALS['dbi']->escapeString($db); + $query = "SHOW FUNCTION STATUS WHERE `Db`='$db' "; + if (!empty($searchClause)) { + $query .= "AND " . $this->_getWhereClauseForSearch( + $searchClause, + $singleItem, + 'Name' + ); + } + $retval = $GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + } + + return $retval; + } + + /** + * Returns the number of events present inside this database + * + * @param string $searchClause A string used to filter the results of + * the query + * @param boolean $singleItem Whether to get presence of a single known + * item or false in none + * + * @return int + */ + private function _getEventCount($searchClause, $singleItem) + { + $db = $this->real_name; + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $db = $GLOBALS['dbi']->escapeString($db); + $query = "SELECT COUNT(*) "; + $query .= "FROM `INFORMATION_SCHEMA`.`EVENTS` "; + $query .= "WHERE `EVENT_SCHEMA` " + . Util::getCollateForIS() . "='$db' "; + if (!empty($searchClause)) { + $query .= "AND " . $this->_getWhereClauseForSearch( + $searchClause, + $singleItem, + 'EVENT_NAME' + ); + } + $retval = (int)$GLOBALS['dbi']->fetchValue($query); + } else { + $db = Util::backquote($db); + $query = "SHOW EVENTS FROM $db "; + if (!empty($searchClause)) { + $query .= "WHERE " . $this->_getWhereClauseForSearch( + $searchClause, + $singleItem, + 'Name' + ); + } + $retval = $GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + } + + return $retval; + } + + /** + * Returns the WHERE clause for searching inside a database + * + * @param string $searchClause A string used to filter the results of the query + * @param boolean $singleItem Whether to get presence of a single known item + * @param string $columnName Name of the column in the result set to match + * + * @return string WHERE clause for searching + */ + private function _getWhereClauseForSearch( + $searchClause, + $singleItem, + $columnName + ) { + $query = ''; + if ($singleItem) { + $query .= Util::backquote($columnName) . " = "; + $query .= "'" . $GLOBALS['dbi']->escapeString($searchClause) . "'"; + } else { + $query .= Util::backquote($columnName) . " LIKE "; + $query .= "'%" . $GLOBALS['dbi']->escapeString($searchClause) + . "%'"; + } + + return $query; + } + + /** + * Returns the names of children of type $type present inside this container + * This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase + * and PhpMyAdmin\Navigation\Nodes\NodeTable classes + * + * @param string $type The type of item we are looking for + * ('tables', 'views', etc) + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + public function getData($type, $pos, $searchClause = '') + { + $retval = array(); + switch ($type) { + case 'tables': + $retval = $this->_getTables($pos, $searchClause); + break; + case 'views': + $retval = $this->_getViews($pos, $searchClause); + break; + case 'procedures': + $retval = $this->_getProcedures($pos, $searchClause); + break; + case 'functions': + $retval = $this->_getFunctions($pos, $searchClause); + break; + case 'events': + $retval = $this->_getEvents($pos, $searchClause); + break; + default: + break; + } + + // Remove hidden items so that they are not displayed in navigation tree + $cfgRelation = $this->relation->getRelationsParam(); + if ($cfgRelation['navwork']) { + $hiddenItems = $this->getHiddenItems(substr($type, 0, -1)); + foreach ($retval as $key => $item) { + if (in_array($item, $hiddenItems)) { + unset($retval[$key]); + } + } + } + + return $retval; + } + + /** + * Return list of hidden items of given type + * + * @param string $type The type of items we are looking for + * ('table', 'function', 'group', etc.) + * + * @return array Array containing hidden items of given type + */ + public function getHiddenItems($type) + { + $db = $this->real_name; + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['navwork']) { + return array(); + } + $navTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['navigationhiding']); + $sqlQuery = "SELECT `item_name` FROM " . $navTable + . " WHERE `username`='" . $cfgRelation['user'] . "'" + . " AND `item_type`='" . $type + . "'" . " AND `db_name`='" . $GLOBALS['dbi']->escapeString($db) + . "'"; + $result = $this->relation->queryAsControlUser($sqlQuery, false); + $hiddenItems = array(); + if ($result) { + while ($row = $GLOBALS['dbi']->fetchArray($result)) { + $hiddenItems[] = $row[0]; + } + } + $GLOBALS['dbi']->freeResult($result); + + return $hiddenItems; + } + + /** + * Returns the list of tables or views inside this database + * + * @param string $which tables|views + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + private function _getTablesOrViews($which, $pos, $searchClause) + { + if ($which == 'tables') { + $condition = 'IN'; + } else { + $condition = 'NOT IN'; + } + $maxItems = $GLOBALS['cfg']['MaxNavigationItems']; + $retval = array(); + $db = $this->real_name; + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + $escdDb = $GLOBALS['dbi']->escapeString($db); + $query = "SELECT `TABLE_NAME` AS `name` "; + $query .= "FROM `INFORMATION_SCHEMA`.`TABLES` "; + $query .= "WHERE `TABLE_SCHEMA`='$escdDb' "; + $query .= "AND `TABLE_TYPE`" . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; + if (! empty($searchClause)) { + $query .= "AND `TABLE_NAME` LIKE '%"; + $query .= $GLOBALS['dbi']->escapeString($searchClause); + $query .= "%'"; + } + $query .= "ORDER BY `TABLE_NAME` ASC "; + $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $retval = $GLOBALS['dbi']->fetchResult($query); + } else { + $query = " SHOW FULL TABLES FROM "; + $query .= Util::backquote($db); + $query .= " WHERE `Table_type`" . $condition . "('BASE TABLE', 'SYSTEM VERSIONED') "; + if (!empty($searchClause)) { + $query .= "AND " . Util::backquote( + "Tables_in_" . $db + ); + $query .= " LIKE '%" . $GLOBALS['dbi']->escapeString( + $searchClause + ); + $query .= "%'"; + } + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle !== false) { + $count = 0; + if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($count < $maxItems) { + $retval[] = $arr[0]; + $count++; + } else { + break; + } + } + } + } + } + + return $retval; + } + + /** + * Returns the list of tables inside this database + * + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + private function _getTables($pos, $searchClause) + { + return $this->_getTablesOrViews('tables', $pos, $searchClause); + } + + /** + * Returns the list of views inside this database + * + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + private function _getViews($pos, $searchClause) + { + return $this->_getTablesOrViews('views', $pos, $searchClause); + } + + /** + * Returns the list of procedures or functions inside this database + * + * @param string $routineType PROCEDURE|FUNCTION + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + private function _getRoutines($routineType, $pos, $searchClause) + { + $maxItems = $GLOBALS['cfg']['MaxNavigationItems']; + $retval = array(); + $db = $this->real_name; + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $escdDb = $GLOBALS['dbi']->escapeString($db); + $query = "SELECT `ROUTINE_NAME` AS `name` "; + $query .= "FROM `INFORMATION_SCHEMA`.`ROUTINES` "; + $query .= "WHERE `ROUTINE_SCHEMA` " + . Util::getCollateForIS() . "='$escdDb'"; + $query .= "AND `ROUTINE_TYPE`='" . $routineType . "' "; + if (!empty($searchClause)) { + $query .= "AND `ROUTINE_NAME` LIKE '%"; + $query .= $GLOBALS['dbi']->escapeString($searchClause); + $query .= "%'"; + } + $query .= "ORDER BY `ROUTINE_NAME` ASC "; + $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $retval = $GLOBALS['dbi']->fetchResult($query); + } else { + $escdDb = $GLOBALS['dbi']->escapeString($db); + $query = "SHOW " . $routineType . " STATUS WHERE `Db`='$escdDb' "; + if (!empty($searchClause)) { + $query .= "AND `Name` LIKE '%"; + $query .= $GLOBALS['dbi']->escapeString($searchClause); + $query .= "%'"; + } + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle !== false) { + $count = 0; + if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($count < $maxItems) { + $retval[] = $arr['Name']; + $count++; + } else { + break; + } + } + } + } + } + + return $retval; + } + + /** + * Returns the list of procedures inside this database + * + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + private function _getProcedures($pos, $searchClause) + { + return $this->_getRoutines('PROCEDURE', $pos, $searchClause); + } + + /** + * Returns the list of functions inside this database + * + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + private function _getFunctions($pos, $searchClause) + { + return $this->_getRoutines('FUNCTION', $pos, $searchClause); + } + + /** + * Returns the list of events inside this database + * + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + private function _getEvents($pos, $searchClause) + { + $maxItems = $GLOBALS['cfg']['MaxNavigationItems']; + $retval = array(); + $db = $this->real_name; + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $escdDb = $GLOBALS['dbi']->escapeString($db); + $query = "SELECT `EVENT_NAME` AS `name` "; + $query .= "FROM `INFORMATION_SCHEMA`.`EVENTS` "; + $query .= "WHERE `EVENT_SCHEMA` " + . Util::getCollateForIS() . "='$escdDb' "; + if (!empty($searchClause)) { + $query .= "AND `EVENT_NAME` LIKE '%"; + $query .= $GLOBALS['dbi']->escapeString($searchClause); + $query .= "%'"; + } + $query .= "ORDER BY `EVENT_NAME` ASC "; + $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $retval = $GLOBALS['dbi']->fetchResult($query); + } else { + $escdDb = Util::backquote($db); + $query = "SHOW EVENTS FROM $escdDb "; + if (!empty($searchClause)) { + $query .= "WHERE `Name` LIKE '%"; + $query .= $GLOBALS['dbi']->escapeString($searchClause); + $query .= "%'"; + } + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle !== false) { + $count = 0; + if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($count < $maxItems) { + $retval[] = $arr['Name']; + $count++; + } else { + break; + } + } + } + } + } + + return $retval; + } + + /** + * Returns HTML for control buttons displayed infront of a node + * + * @return String HTML for control buttons + */ + public function getHtmlForControlButtons() + { + $ret = ''; + $cfgRelation = $this->relation->getRelationsParam(); + if ($cfgRelation['navwork']) { + if ($this->hiddenCount > 0) { + $params = array( + 'showUnhideDialog' => true, + 'dbName' => $this->real_name, + ); + $ret = '' + . '' + . Util::getImage( + 'show', + __('Show hidden items') + ) + . ''; + } + } + + return $ret; + } + + /** + * Sets the number of hidden items in this database + * + * @param int $count hidden item count + * + * @return void + */ + public function setHiddenCount($count) + { + $this->hiddenCount = $count; + } + + /** + * Returns the number of hidden items in this database + * + * @return int hidden item count + */ + public function getHiddenCount() + { + return $this->hiddenCount; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseChild.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseChild.php new file mode 100755 index 0000000..e562af0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseChild.php @@ -0,0 +1,60 @@ +relation->getRelationsParam(); + if ($cfgRelation['navwork']) { + $db = $this->realParent()->real_name; + $item = $this->real_name; + + $params = array( + 'hideNavItem' => true, + 'itemType' => $this->getItemType(), + 'itemName' => $item, + 'dbName' => $db + ); + + $ret = '' + . '' + . Util::getImage('hide', __('Hide')) + . ''; + } + + return $ret; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseChildContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseChildContainer.php new file mode 100755 index 0000000..e11ff69 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseChildContainer.php @@ -0,0 +1,43 @@ +separator = $GLOBALS['cfg']['NavigationTreeTableSeparator']; + $this->separator_depth = (int)( + $GLOBALS['cfg']['NavigationTreeTableLevel'] + ); + } + } + + /** + * Returns the type of the item represented by the node. + * + * @return string type of the item + */ + protected function getItemType() + { + return 'group'; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseContainer.php new file mode 100755 index 0000000..33a9913 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeDatabaseContainer.php @@ -0,0 +1,48 @@ +isNew = true; + $new->icon = Util::getImage('b_newdb', ''); + $new->links = array( + 'text' => 'server_databases.php?server=' . $GLOBALS['server'], + 'icon' => 'server_databases.php?server=' . $GLOBALS['server'], + ); + $new->classes = 'new_database italics'; + $this->addChild($new); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeEvent.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeEvent.php new file mode 100755 index 0000000..0737fcc --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeEvent.php @@ -0,0 +1,49 @@ +icon = Util::getImage('b_events'); + $this->links = array( + 'text' => 'db_events.php?server=' . $GLOBALS['server'] + . '&db=%2$s&item_name=%1$s&edit_item=1', + 'icon' => 'db_events.php?server=' . $GLOBALS['server'] + . '&db=%2$s&item_name=%1$s&export_item=1', + ); + $this->classes = 'event'; + } + + /** + * Returns the type of the item represented by the node. + * + * @return string type of the item + */ + protected function getItemType() + { + return 'event'; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeEventContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeEventContainer.php new file mode 100755 index 0000000..0231c94 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeEventContainer.php @@ -0,0 +1,50 @@ +icon = Util::getImage('b_events', ''); + $this->links = array( + 'text' => 'db_events.php?server=' . $GLOBALS['server'] + . '&db=%1$s', + 'icon' => 'db_events.php?server=' . $GLOBALS['server'] + . '&db=%1$s', + ); + $this->real_name = 'events'; + + $new = NodeFactory::getInstance( + 'Node', + _pgettext('Create new event', 'New') + ); + $new->isNew = true; + $new->icon = Util::getImage('b_event_add', ''); + $new->links = array( + 'text' => 'db_events.php?server=' . $GLOBALS['server'] + . '&db=%2$s&add_item=1', + 'icon' => 'db_events.php?server=' . $GLOBALS['server'] + . '&db=%2$s&add_item=1', + ); + $new->classes = 'new_event italics'; + $this->addChild($new); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeFunction.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeFunction.php new file mode 100755 index 0000000..2f5cd38 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeFunction.php @@ -0,0 +1,51 @@ +icon = Util::getImage('b_routines', __('Function')); + $this->links = array( + 'text' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%2$s&item_name=%1$s&item_type=FUNCTION' + . '&edit_item=1', + 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%2$s&item_name=%1$s&item_type=FUNCTION' + . '&execute_dialog=1', + ); + $this->classes = 'function'; + } + + /** + * Returns the type of the item represented by the node. + * + * @return string type of the item + */ + protected function getItemType() + { + return 'function'; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeFunctionContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeFunctionContainer.php new file mode 100755 index 0000000..bf092ed --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeFunctionContainer.php @@ -0,0 +1,51 @@ +icon = Util::getImage('b_routines', __('Functions')); + $this->links = array( + 'text' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%1$s&type=FUNCTION', + 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%1$s&type=FUNCTION', + ); + $this->real_name = 'functions'; + + $new_label = _pgettext('Create new function', 'New'); + $new = NodeFactory::getInstance( + 'Node', + $new_label + ); + $new->isNew = true; + $new->icon = Util::getImage('b_routine_add', $new_label); + $new->links = array( + 'text' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%2$s&add_item=1&item_type=FUNCTION', + 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%2$s&add_item=1&item_type=FUNCTION', + ); + $new->classes = 'new_function italics'; + $this->addChild($new); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeIndex.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeIndex.php new file mode 100755 index 0000000..332cc2c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeIndex.php @@ -0,0 +1,39 @@ +icon = Util::getImage('b_index', __('Index')); + $this->links = array( + 'text' => 'tbl_indexes.php?server=' . $GLOBALS['server'] + . '&db=%3$s&table=%2$s&index=%1$s', + 'icon' => 'tbl_indexes.php?server=' . $GLOBALS['server'] + . '&db=%3$s&table=%2$s&index=%1$s', + ); + $this->classes = 'index'; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeIndexContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeIndexContainer.php new file mode 100755 index 0000000..39ba9ee --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeIndexContainer.php @@ -0,0 +1,53 @@ +icon = Util::getImage('b_index', __('Indexes')); + $this->links = array( + 'text' => 'tbl_structure.php?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + ); + $this->real_name = 'indexes'; + + $new_label = _pgettext('Create new index', 'New'); + $new = NodeFactory::getInstance( + 'Node', + $new_label + ); + $new->isNew = true; + $new->icon = Util::getImage('b_index_add', $new_label); + $new->links = array( + 'text' => 'tbl_indexes.php?server=' . $GLOBALS['server'] + . '&create_index=1&added_fields=2' + . '&db=%3$s&table=%2$s', + 'icon' => 'tbl_indexes.php?server=' . $GLOBALS['server'] + . '&create_index=1&added_fields=2' + . '&db=%3$s&table=%2$s', + ); + $new->classes = 'new_index italics'; + $this->addChild($new); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeProcedure.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeProcedure.php new file mode 100755 index 0000000..e9a74eb --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeProcedure.php @@ -0,0 +1,51 @@ +icon = Util::getImage('b_routines', __('Procedure')); + $this->links = array( + 'text' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%2$s&item_name=%1$s&item_type=PROCEDURE' + . '&edit_item=1', + 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%2$s&item_name=%1$s&item_type=PROCEDURE' + . '&execute_dialog=1', + ); + $this->classes = 'procedure'; + } + + /** + * Returns the type of the item represented by the node. + * + * @return string type of the item + */ + protected function getItemType() + { + return 'procedure'; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeProcedureContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeProcedureContainer.php new file mode 100755 index 0000000..e4eb0fa --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeProcedureContainer.php @@ -0,0 +1,51 @@ +icon = Util::getImage('b_routines', __('Procedures')); + $this->links = array( + 'text' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%1$s&type=PROCEDURE', + 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%1$s&type=PROCEDURE', + ); + $this->real_name = 'procedures'; + + $new_label = _pgettext('Create new procedure', 'New'); + $new = NodeFactory::getInstance( + 'Node', + $new_label + ); + $new->isNew = true; + $new->icon = Util::getImage('b_routine_add', $new_label); + $new->links = array( + 'text' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%2$s&add_item=1', + 'icon' => 'db_routines.php?server=' . $GLOBALS['server'] + . '&db=%2$s&add_item=1', + ); + $new->classes = 'new_procedure italics'; + $this->addChild($new); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTable.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTable.php new file mode 100755 index 0000000..cafe306 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTable.php @@ -0,0 +1,305 @@ +icon = array(); + $this->_addIcon( + Util::getScriptNameForOption( + $GLOBALS['cfg']['NavigationTreeDefaultTabTable'], + 'table' + ) + ); + $this->_addIcon( + Util::getScriptNameForOption( + $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], + 'table' + ) + ); + $title = Util::getTitleForTarget( + $GLOBALS['cfg']['DefaultTabTable'] + ); + $this->title = $title; + + $script_name = Util::getScriptNameForOption( + $GLOBALS['cfg']['DefaultTabTable'], + 'table' + ); + $this->links = array( + 'text' => $script_name + . '?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s' + . '&pos=0', + 'icon' => array( + Util::getScriptNameForOption( + $GLOBALS['cfg']['NavigationTreeDefaultTabTable'], + 'table' + ) + . '?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + Util::getScriptNameForOption( + $GLOBALS['cfg']['NavigationTreeDefaultTabTable2'], + 'table' + ) + . '?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + ), + 'title' => $this->title, + ); + $this->classes = 'table'; + } + + /** + * Returns the number of children of type $type present inside this container + * This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase + * and PhpMyAdmin\Navigation\Nodes\NodeTable classes + * + * @param string $type The type of item we are looking for + * ('columns' or 'indexes') + * @param string $searchClause A string used to filter the results of the query + * + * @return int + */ + public function getPresence($type = '', $searchClause = '') + { + $retval = 0; + $db = $this->realParent()->real_name; + $table = $this->real_name; + switch ($type) { + case 'columns': + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $db = $GLOBALS['dbi']->escapeString($db); + $table = $GLOBALS['dbi']->escapeString($table); + $query = "SELECT COUNT(*) "; + $query .= "FROM `INFORMATION_SCHEMA`.`COLUMNS` "; + $query .= "WHERE `TABLE_NAME`='$table' "; + $query .= "AND `TABLE_SCHEMA`='$db'"; + $retval = (int)$GLOBALS['dbi']->fetchValue($query); + } else { + $db = Util::backquote($db); + $table = Util::backquote($table); + $query = "SHOW COLUMNS FROM $table FROM $db"; + $retval = (int)$GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + } + break; + case 'indexes': + $db = Util::backquote($db); + $table = Util::backquote($table); + $query = "SHOW INDEXES FROM $table FROM $db"; + $retval = (int)$GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + break; + case 'triggers': + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $db = $GLOBALS['dbi']->escapeString($db); + $table = $GLOBALS['dbi']->escapeString($table); + $query = "SELECT COUNT(*) "; + $query .= "FROM `INFORMATION_SCHEMA`.`TRIGGERS` "; + $query .= "WHERE `EVENT_OBJECT_SCHEMA` " + . Util::getCollateForIS() . "='$db' "; + $query .= "AND `EVENT_OBJECT_TABLE` " + . Util::getCollateForIS() . "='$table'"; + $retval = (int)$GLOBALS['dbi']->fetchValue($query); + } else { + $db = Util::backquote($db); + $table = $GLOBALS['dbi']->escapeString($table); + $query = "SHOW TRIGGERS FROM $db WHERE `Table` = '$table'"; + $retval = (int)$GLOBALS['dbi']->numRows( + $GLOBALS['dbi']->tryQuery($query) + ); + } + break; + default: + break; + } + + return $retval; + } + + /** + * Returns the names of children of type $type present inside this container + * This method is overridden by the PhpMyAdmin\Navigation\Nodes\NodeDatabase + * and PhpMyAdmin\Navigation\Nodes\NodeTable classes + * + * @param string $type The type of item we are looking for + * ('tables', 'views', etc) + * @param int $pos The offset of the list within the results + * @param string $searchClause A string used to filter the results of the query + * + * @return array + */ + public function getData($type, $pos, $searchClause = '') + { + $maxItems = $GLOBALS['cfg']['MaxNavigationItems']; + $retval = array(); + $db = $this->realParent()->real_name; + $table = $this->real_name; + switch ($type) { + case 'columns': + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $db = $GLOBALS['dbi']->escapeString($db); + $table = $GLOBALS['dbi']->escapeString($table); + $query = "SELECT `COLUMN_NAME` AS `name` "; + $query .= "FROM `INFORMATION_SCHEMA`.`COLUMNS` "; + $query .= "WHERE `TABLE_NAME`='$table' "; + $query .= "AND `TABLE_SCHEMA`='$db' "; + $query .= "ORDER BY `COLUMN_NAME` ASC "; + $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $retval = $GLOBALS['dbi']->fetchResult($query); + break; + } + + $db = Util::backquote($db); + $table = Util::backquote($table); + $query = "SHOW COLUMNS FROM $table FROM $db"; + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + break; + } + + $count = 0; + if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($count < $maxItems) { + $retval[] = $arr['Field']; + $count++; + } else { + break; + } + } + } + break; + case 'indexes': + $db = Util::backquote($db); + $table = Util::backquote($table); + $query = "SHOW INDEXES FROM $table FROM $db"; + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + break; + } + + $count = 0; + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if (in_array($arr['Key_name'], $retval)) { + continue; + } + if ($pos <= 0 && $count < $maxItems) { + $retval[] = $arr['Key_name']; + $count++; + } + $pos--; + } + break; + case 'triggers': + if (!$GLOBALS['cfg']['Server']['DisableIS']) { + $db = $GLOBALS['dbi']->escapeString($db); + $table = $GLOBALS['dbi']->escapeString($table); + $query = "SELECT `TRIGGER_NAME` AS `name` "; + $query .= "FROM `INFORMATION_SCHEMA`.`TRIGGERS` "; + $query .= "WHERE `EVENT_OBJECT_SCHEMA` " + . Util::getCollateForIS() . "='$db' "; + $query .= "AND `EVENT_OBJECT_TABLE` " + . Util::getCollateForIS() . "='$table' "; + $query .= "ORDER BY `TRIGGER_NAME` ASC "; + $query .= "LIMIT " . intval($pos) . ", $maxItems"; + $retval = $GLOBALS['dbi']->fetchResult($query); + break; + } + + $db = Util::backquote($db); + $table = $GLOBALS['dbi']->escapeString($table); + $query = "SHOW TRIGGERS FROM $db WHERE `Table` = '$table'"; + $handle = $GLOBALS['dbi']->tryQuery($query); + if ($handle === false) { + break; + } + + $count = 0; + if ($GLOBALS['dbi']->dataSeek($handle, $pos)) { + while ($arr = $GLOBALS['dbi']->fetchArray($handle)) { + if ($count < $maxItems) { + $retval[] = $arr['Trigger']; + $count++; + } else { + break; + } + } + } + break; + default: + break; + } + + return $retval; + } + + /** + * Returns the type of the item represented by the node. + * + * @return string type of the item + */ + protected function getItemType() + { + return 'table'; + } + + /** + * Add an icon to navigation tree + * + * @param string $page Page name to redirect + * + * @return void + */ + private function _addIcon($page) + { + if (empty($page)) { + return; + } + + switch ($page) { + case 'tbl_structure.php': + $this->icon[] = Util::getImage('b_props', __('Structure')); + break; + case 'tbl_select.php': + $this->icon[] = Util::getImage('b_search', __('Search')); + break; + case 'tbl_change.php': + $this->icon[] = Util::getImage('b_insrow', __('Insert')); + break; + case 'tbl_sql.php': + $this->icon[] = Util::getImage('b_sql', __('SQL')); + break; + case 'sql.php': + $this->icon[] = Util::getImage('b_browse', __('Browse')); + break; + } + } +} + diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTableContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTableContainer.php new file mode 100755 index 0000000..e0a30cf --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTableContainer.php @@ -0,0 +1,52 @@ +icon = Util::getImage('b_browse', __('Tables')); + $this->links = array( + 'text' => 'db_structure.php?server=' . $GLOBALS['server'] + . '&db=%1$s&tbl_type=table', + 'icon' => 'db_structure.php?server=' . $GLOBALS['server'] + . '&db=%1$s&tbl_type=table', + ); + $this->real_name = 'tables'; + $this->classes = 'tableContainer subContainer'; + + $new_label = _pgettext('Create new table', 'New'); + $new = NodeFactory::getInstance( + 'Node', + $new_label + ); + $new->isNew = true; + $new->icon = Util::getImage('b_table_add', $new_label); + $new->links = array( + 'text' => 'tbl_create.php?server=' . $GLOBALS['server'] + . '&db=%2$s', + 'icon' => 'tbl_create.php?server=' . $GLOBALS['server'] + . '&db=%2$s', + ); + $new->classes = 'new_table italics'; + $this->addChild($new); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTrigger.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTrigger.php new file mode 100755 index 0000000..af88444 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTrigger.php @@ -0,0 +1,39 @@ +icon = Util::getImage('b_triggers'); + $this->links = array( + 'text' => 'db_triggers.php?server=' . $GLOBALS['server'] + . '&db=%3$s&item_name=%1$s&edit_item=1', + 'icon' => 'db_triggers.php?server=' . $GLOBALS['server'] + . '&db=%3$s&item_name=%1$s&export_item=1', + ); + $this->classes = 'trigger'; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTriggerContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTriggerContainer.php new file mode 100755 index 0000000..77cfc73 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeTriggerContainer.php @@ -0,0 +1,50 @@ +icon = Util::getImage('b_triggers'); + $this->links = array( + 'text' => 'db_triggers.php?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + 'icon' => 'db_triggers.php?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + ); + $this->real_name = 'triggers'; + + $new = NodeFactory::getInstance( + 'Node', + _pgettext('Create new trigger', 'New') + ); + $new->isNew = true; + $new->icon = Util::getImage('b_trigger_add', ''); + $new->links = array( + 'text' => 'db_triggers.php?server=' . $GLOBALS['server'] + . '&db=%3$s&add_item=1', + 'icon' => 'db_triggers.php?server=' . $GLOBALS['server'] + . '&db=%3$s&add_item=1', + ); + $new->classes = 'new_trigger italics'; + $this->addChild($new); + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeView.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeView.php new file mode 100755 index 0000000..e7dd518 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeView.php @@ -0,0 +1,49 @@ +icon = Util::getImage('b_props', __('View')); + $this->links = array( + 'text' => 'sql.php?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s&pos=0', + 'icon' => 'tbl_structure.php?server=' . $GLOBALS['server'] + . '&db=%2$s&table=%1$s', + ); + $this->classes = 'view'; + } + + /** + * Returns the type of the item represented by the node. + * + * @return string type of the item + */ + protected function getItemType() + { + return 'view'; + } +} diff --git a/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeViewContainer.php b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeViewContainer.php new file mode 100755 index 0000000..dfb97c4 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Navigation/Nodes/NodeViewContainer.php @@ -0,0 +1,52 @@ +icon = Util::getImage('b_views', __('Views')); + $this->links = array( + 'text' => 'db_structure.php?server=' . $GLOBALS['server'] + . '&db=%1$s&tbl_type=view', + 'icon' => 'db_structure.php?server=' . $GLOBALS['server'] + . '&db=%1$s&tbl_type=view', + ); + $this->classes = 'viewContainer subContainer'; + $this->real_name = 'views'; + + $new_label = _pgettext('Create new view', 'New'); + $new = NodeFactory::getInstance( + 'Node', + $new_label + ); + $new->isNew = true; + $new->icon = Util::getImage('b_view_add', $new_label); + $new->links = array( + 'text' => 'view_create.php?server=' . $GLOBALS['server'] + . '&db=%2$s', + 'icon' => 'view_create.php?server=' . $GLOBALS['server'] + . '&db=%2$s', + ); + $new->classes = 'new_view italics'; + $this->addChild($new); + } +} diff --git a/phpMyAdmin/libraries/classes/Normalization.php b/phpMyAdmin/libraries/classes/Normalization.php new file mode 100755 index 0000000..9acdb68 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Normalization.php @@ -0,0 +1,1071 @@ +dbi = $dbi; + $this->relation = new Relation(); + } + + /** + * build the html for columns of $colTypeCategory category + * in form of given $listType in a table + * + * @param string $db current database + * @param string $table current table + * @param string $colTypeCategory supported all|Numeric|String|Spatial + * |Date and time using the _pgettext() format + * @param string $listType type of list to build, supported dropdown|checkbox + * + * @return string HTML for list of columns in form of given list types + */ + public function getHtmlForColumnsList( + $db, + $table, + $colTypeCategory = 'all', + $listType = 'dropdown' + ) { + $columnTypeList = []; + if ($colTypeCategory != 'all') { + $types = $this->dbi->types->getColumns(); + $columnTypeList = $types[$colTypeCategory]; + } + $this->dbi->selectDb($db); + $columns = $this->dbi->getColumns( + $db, + $table, + null, + true + ); + $type = ""; + $selectColHtml = ""; + foreach ($columns as $column => $def) { + if (isset($def['Type'])) { + $extractedColumnSpec = Util::extractColumnSpec($def['Type']); + $type = $extractedColumnSpec['type']; + } + if (empty($columnTypeList) + || in_array(mb_strtoupper($type), $columnTypeList) + ) { + if ($listType == 'checkbox') { + $selectColHtml .= '' + . htmlspecialchars($column) . ' [ ' + . htmlspecialchars($def['Type']) . ' ]
      '; + } else { + $selectColHtml .= ''; + } + } + } + return $selectColHtml; + } + + /** + * get the html of the form to add the new column to given table + * + * @param integer $numFields number of columns to add + * @param string $db current database + * @param string $table current table + * @param array $columnMeta array containing default values for the fields + * + * @return string HTML + */ + public function getHtmlForCreateNewColumn( + $numFields, + $db, + $table, + array $columnMeta = [] + ) { + $cfgRelation = $this->relation->getRelationsParam(); + $contentCells = []; + $availableMime = []; + $mimeMap = []; + if ($cfgRelation['mimework'] && $GLOBALS['cfg']['BrowseMIME']) { + $mimeMap = Transformations::getMIME($db, $table); + $availableMime = Transformations::getAvailableMIMEtypes(); + } + $commentsMap = $this->relation->getComments($db, $table); + for ($columnNumber = 0; $columnNumber < $numFields; $columnNumber++) { + $contentCells[$columnNumber] = [ + 'column_number' => $columnNumber, + 'column_meta' => $columnMeta, + 'type_upper' => '', + 'length_values_input_size' => 8, + 'length' => '', + 'extracted_columnspec' => [], + 'submit_attribute' => null, + 'comments_map' => $commentsMap, + 'fields_meta' => null, + 'is_backup' => true, + 'move_columns' => [], + 'cfg_relation' => $cfgRelation, + 'available_mime' => isset($availableMime) ? $availableMime : [], + 'mime_map' => $mimeMap + ]; + } + + return Template::get( + 'columns_definitions/table_fields_definitions' + )->render([ + 'is_backup' => true, + 'fields_meta' => null, + 'mimework' => $cfgRelation['mimework'], + 'content_cells' => $contentCells, + 'change_column' => $_POST['change_column'], + 'is_virtual_columns_supported' => Util::isVirtualColumnsSupported(), + 'browse_mime' => $GLOBALS['cfg']['BrowseMIME'], + 'server_type' => Util::getServerType(), + 'max_rows' => intval($GLOBALS['cfg']['MaxRows']), + 'char_editing' => $GLOBALS['cfg']['CharEditing'], + 'attribute_types' => $this->dbi->types->getAttributes(), + 'privs_available' => $GLOBALS['col_priv'] && $GLOBALS['is_reload_priv'], + 'max_length' => $this->dbi->getVersion() >= 50503 ? 1024 : 255, + 'dbi' => $this->dbi, + 'disable_is' => $GLOBALS['cfg']['Server']['DisableIS'], + ]); + } + + /** + * build the html for step 1.1 of normalization + * + * @param string $db current database + * @param string $table current table + * @param string $normalizedTo up to which step normalization will go, + * possible values 1nf|2nf|3nf + * + * @return string HTML for step 1.1 + */ + public function getHtmlFor1NFStep1($db, $table, $normalizedTo) + { + $step = 1; + $stepTxt = __('Make all columns atomic'); + $html = "

      " + . __('First step of normalization (1NF)') . "

      "; + $html .= "
      " . + "
      " . + "" . __('Step 1.') . $step . " " . $stepTxt . "" . + "

      " . __( + 'Do you have any column which can be split into more than' + . ' one column? ' + . 'For example: address can be split into street, city, country and zip.' + ) + . "
      ( " + . __( + 'Show me the central list of columns that are not already in this table' + ) . " )

      " + . "

      " . __( + 'Select a column which can be split into more ' + . 'than one (on select of \'no such column\', it\'ll move to next step).' + ) + . "

      " + . "
      " + . "" + . "" . __('split into ') + . "" + . "
      " + . "
      " + . "
      " + . "
      " + . "
      "; + return $html; + } + + /** + * build the html contents of various html elements in step 1.2 + * + * @param string $db current database + * @param string $table current table + * + * @return string HTML contents for step 1.2 + */ + public function getHtmlContentsFor1NFStep2($db, $table) + { + $step = 2; + $stepTxt = __('Have a primary key'); + $primary = Index::getPrimary($table, $db); + $hasPrimaryKey = "0"; + $legendText = __('Step 1.') . $step . " " . $stepTxt; + $extra = ''; + if ($primary) { + $headText = __("Primary key already exists."); + $subText = __("Taking you to next step鈥�"); + $hasPrimaryKey = "1"; + } else { + $headText = __( + "There is no primary key; please add one.
      " + . "Hint: A primary key is a column " + . "(or combination of columns) that uniquely identify all rows." + ); + $subText = '' + . Util::getIcon( + 'b_index_add', + __( + 'Add a primary key on existing column(s)' + ) + ) + . ''; + $extra = __( + "If it's not possible to make existing " + . "column combinations as primary key" + ) . "
      " + . '' + . __('+ Add a new primary key column') . ''; + } + $res = [ + 'legendText' => $legendText, + 'headText' => $headText, + 'subText' => $subText, + 'hasPrimaryKey' => $hasPrimaryKey, + 'extra' => $extra + ]; + return $res; + } + + /** + * build the html contents of various html elements in step 1.4 + * + * @param string $db current database + * @param string $table current table + * + * @return string HTML contents for step 1.4 + */ + public function getHtmlContentsFor1NFStep4($db, $table) + { + $step = 4; + $stepTxt = __('Remove redundant columns'); + $legendText = __('Step 1.') . $step . " " . $stepTxt; + $headText = __( + "Do you have a group of columns which on combining gives an existing" + . " column? For example, if you have first_name, last_name and" + . " full_name then combining first_name and last_name gives full_name" + . " which is redundant." + ); + $subText = __( + "Check the columns which are redundant and click on remove. " + . "If no redundant column, click on 'No redundant column'" + ); + $extra = $this->getHtmlForColumnsList($db, $table, 'all', "checkbox") . "
      " + . '' + . ''; + $res = [ + 'legendText' => $legendText, + 'headText' => $headText, + 'subText' => $subText, + 'extra' => $extra + ]; + return $res; + } + + /** + * build the html contents of various html elements in step 1.3 + * + * @param string $db current database + * @param string $table current table + * + * @return string HTML contents for step 1.3 + */ + public function getHtmlContentsFor1NFStep3($db, $table) + { + $step = 3; + $stepTxt = __('Move repeating groups'); + $legendText = __('Step 1.') . $step . " " . $stepTxt; + $headText = __( + "Do you have a group of two or more columns that are closely " + . "related and are all repeating the same attribute? For example, " + . "a table that holds data on books might have columns such as book_id, " + . "author1, author2, author3 and so on which form a " + . "repeating group. In this case a new table (book_id, author) should " + . "be created." + ); + $subText = __( + "Check the columns which form a repeating group. " + . "If no such group, click on 'No repeating group'" + ); + $extra = $this->getHtmlForColumnsList($db, $table, 'all', "checkbox") . "
      " + . '' + . ''; + $primary = Index::getPrimary($table, $db); + $primarycols = $primary->getColumns(); + $pk = []; + foreach ($primarycols as $col) { + $pk[] = $col->getName(); + } + $res = [ + 'legendText' => $legendText, + 'headText' => $headText, + 'subText' => $subText, + 'extra' => $extra, + 'primary_key' => json_encode($pk) + ]; + return $res; + } + + /** + * build html contents for 2NF step 2.1 + * + * @param string $db current database + * @param string $table current table + * + * @return string HTML contents for 2NF step 2.1 + */ + public function getHtmlFor2NFstep1($db, $table) + { + $legendText = __('Step 2.') . "1 " . __('Find partial dependencies'); + $primary = Index::getPrimary($table, $db); + $primarycols = $primary->getColumns(); + $pk = []; + $subText = ''; + $selectPkForm = ""; + $extra = ""; + foreach ($primarycols as $col) { + $pk[] = $col->getName(); + $selectPkForm .= '' + . htmlspecialchars($col->getName()); + } + $key = implode(', ', $pk); + if (count($primarycols) > 1) { + $this->dbi->selectDb($db); + $columns = (array) $this->dbi->getColumnNames( + $db, + $table + ); + if (count($pk) == count($columns)) { + $headText = sprintf( + __( + 'No partial dependencies possible as ' + . 'no non-primary column exists since primary key ( %1$s ) ' + . 'is composed of all the columns in the table.' + ), + htmlspecialchars($key) + ) . '
      '; + $extra = '

      ' . __('Table is already in second normal form.') + . '

      '; + } else { + $headText = sprintf( + __( + 'The primary key ( %1$s ) consists of more than one column ' + . 'so we need to find the partial dependencies.' + ), + htmlspecialchars($key) + ) . '
      ' . __( + 'Please answer the following question(s) ' + . 'carefully to obtain a correct normalization.' + ) + . '
      ' . __( + '+ Show me the possible partial dependencies ' + . 'based on data in the table' + ) . ''; + $subText = __( + 'For each column below, ' + . 'please select the minimal set of columns among given set ' + . 'whose values combined together are sufficient' + . ' to determine the value of the column.' + ); + $cnt = 0; + foreach ($columns as $column) { + if (!in_array($column, $pk)) { + $cnt++; + $extra .= "" . sprintf( + __('\'%1$s\' depends on:'), + htmlspecialchars($column) + ) . "
      "; + $extra .= '
      ' + . $selectPkForm . '


      '; + } + } + } + } else { + $headText = sprintf( + __( + 'No partial dependencies possible as the primary key' + . ' ( %1$s ) has just one column.' + ), + htmlspecialchars($key) + ) . '
      '; + $extra = '

      ' . __('Table is already in second normal form.') . '

      '; + } + $res = [ + 'legendText' => $legendText, + 'headText' => $headText, + 'subText' => $subText, + 'extra' => $extra, + 'primary_key' => $key + ]; + return $res; + } + + /** + * build the html for showing the tables to have in order to put current table in 2NF + * + * @param array $partialDependencies array containing all the dependencies + * @param string $table current table + * + * @return string HTML + */ + public function getHtmlForNewTables2NF(array $partialDependencies, $table) + { + $html = '

      ' . sprintf( + __( + 'In order to put the ' + . 'original table \'%1$s\' into Second normal form we need ' + . 'to create the following tables:' + ), + htmlspecialchars($table) + ) . '

      '; + $tableName = $table; + $i = 1; + foreach ($partialDependencies as $key => $dependents) { + $html .= '

      ' + . '( ' . htmlspecialchars($key) . '' + . (count($dependents)>0?', ':'') + . htmlspecialchars(implode(', ', $dependents)) . ' )'; + $i++; + $tableName = 'table' . $i; + } + return $html; + } + + /** + * create/alter the tables needed for 2NF + * + * @param array $partialDependencies array containing all the partial dependencies + * @param object $tablesName name of new tables + * @param string $table current table + * @param string $db current database + * + * @return array + */ + public function createNewTablesFor2NF(array $partialDependencies, $tablesName, $table, $db) + { + $dropCols = false; + $nonPKCols = []; + $queries = []; + $error = false; + $headText = '

      ' . sprintf( + __('The second step of normalization is complete for table \'%1$s\'.'), + htmlspecialchars($table) + ) . '

      '; + if (count((array)$partialDependencies) == 1) { + return [ + 'legendText'=>__('End of step'), 'headText'=>$headText, + 'queryError'=>$error + ]; + } + $message = ''; + $this->dbi->selectDb($db); + foreach ($partialDependencies as $key => $dependents) { + if ($tablesName->$key != $table) { + $backquotedKey = implode(', ', Util::backquote(explode(', ', $key))); + $queries[] = 'CREATE TABLE ' . Util::backquote($tablesName->$key) + . ' SELECT DISTINCT ' . $backquotedKey + . (count($dependents)>0?', ':'') + . implode(',', Util::backquote($dependents)) + . ' FROM ' . Util::backquote($table) . ';'; + $queries[] = 'ALTER TABLE ' . Util::backquote($tablesName->$key) + . ' ADD PRIMARY KEY(' . $backquotedKey . ');'; + $nonPKCols = array_merge($nonPKCols, $dependents); + } else { + $dropCols = true; + } + } + + if ($dropCols) { + $query = 'ALTER TABLE ' . Util::backquote($table); + foreach ($nonPKCols as $col) { + $query .= ' DROP ' . Util::backquote($col) . ','; + } + $query = trim($query, ', '); + $query .= ';'; + $queries[] = $query; + } else { + $queries[] = 'DROP TABLE ' . Util::backquote($table); + } + foreach ($queries as $query) { + if (!$this->dbi->tryQuery($query)) { + $message = Message::error(__('Error in processing!')); + $message->addMessage( + Message::rawError( + $this->dbi->getError() + ), + '

      ' + ); + $error = true; + break; + } + } + return [ + 'legendText' => __('End of step'), + 'headText' => $headText, + 'queryError' => $error, + 'extra' => $message + ]; + } + + /** + * build the html for showing the new tables to have in order + * to put given tables in 3NF + * + * @param object $dependencies containing all the dependencies + * @param array $tables tables formed after 2NF and need to convert to 3NF + * @param string $db current database + * + * @return array containing html and the list of new tables + */ + public function getHtmlForNewTables3NF($dependencies, array $tables, $db) + { + $html = ""; + $i = 1; + $newTables = []; + foreach ($tables as $table => $arrDependson) { + if (count(array_unique($arrDependson)) == 1) { + continue; + } + $primary = Index::getPrimary($table, $db); + $primarycols = $primary->getColumns(); + $pk = []; + foreach ($primarycols as $col) { + $pk[] = $col->getName(); + } + $html .= '

      ' . sprintf( + __( + 'In order to put the ' + . 'original table \'%1$s\' into Third normal form we need ' + . 'to create the following tables:' + ), + htmlspecialchars($table) + ) . '

      '; + $tableName = $table; + $columnList = []; + foreach ($arrDependson as $key) { + $dependents = $dependencies->$key; + if ($key == $table) { + $key = implode(', ', $pk); + } + $tmpTableCols =array_merge(explode(', ', $key), $dependents); + sort($tmpTableCols); + if (!in_array($tmpTableCols, $columnList)) { + $columnList[] = $tmpTableCols; + $html .= '

      ' + . '( ' . htmlspecialchars($key) . '' + . (count($dependents)>0?', ':'') + . htmlspecialchars(implode(', ', $dependents)) . ' )'; + $newTables[$table][$tableName] = [ + "pk"=>$key, "nonpk"=>implode(', ', $dependents) + ]; + $i++; + $tableName = 'table' . $i; + } + } + } + return ['html' => $html, 'newTables' => $newTables, 'success' => true]; + } + + /** + * create new tables or alter existing to get 3NF + * + * @param array $newTables list of new tables to be created + * @param string $db current database + * + * @return array + */ + public function createNewTablesFor3NF(array $newTables, $db) + { + $queries = []; + $dropCols = false; + $error = false; + $headText = '

      ' . + __('The third step of normalization is complete.') + . '

      '; + if (count((array)$newTables) == 0) { + return [ + 'legendText'=>__('End of step'), 'headText'=>$headText, + 'queryError'=>$error + ]; + } + $message = ''; + $this->dbi->selectDb($db); + foreach ($newTables as $originalTable => $tablesList) { + foreach ($tablesList as $table => $cols) { + if ($table != $originalTable) { + $quotedPk = implode( + ', ', + Util::backquote(explode(', ', $cols->pk)) + ); + $quotedNonpk = implode( + ', ', + Util::backquote(explode(', ', $cols->nonpk)) + ); + $queries[] = 'CREATE TABLE ' . Util::backquote($table) + . ' SELECT DISTINCT ' . $quotedPk + . ', ' . $quotedNonpk + . ' FROM ' . Util::backquote($originalTable) . ';'; + $queries[] = 'ALTER TABLE ' . Util::backquote($table) + . ' ADD PRIMARY KEY(' . $quotedPk . ');'; + } else { + $dropCols = $cols; + } + } + if ($dropCols) { + $columns = (array) $this->dbi->getColumnNames( + $db, + $originalTable + ); + $colPresent = array_merge( + explode(', ', $dropCols->pk), + explode(', ', $dropCols->nonpk) + ); + $query = 'ALTER TABLE ' . Util::backquote($originalTable); + foreach ($columns as $col) { + if (!in_array($col, $colPresent)) { + $query .= ' DROP ' . Util::backquote($col) . ','; + } + } + $query = trim($query, ', '); + $query .= ';'; + $queries[] = $query; + } else { + $queries[] = 'DROP TABLE ' . Util::backquote($originalTable); + } + $dropCols = false; + } + foreach ($queries as $query) { + if (!$this->dbi->tryQuery($query)) { + $message = Message::error(__('Error in processing!')); + $message->addMessage( + Message::rawError( + $this->dbi->getError() + ), + '

      ' + ); + $error = true; + break; + } + } + return [ + 'legendText' => __('End of step'), + 'headText' => $headText, + 'queryError' => $error, + 'extra' => $message + ]; + } + + /** + * move the repeating group of columns to a new table + * + * @param string $repeatingColumns comma separated list of repeating group columns + * @param string $primaryColumns comma separated list of column in primary key + * of $table + * @param string $newTable name of the new table to be created + * @param string $newColumn name of the new column in the new table + * @param string $table current table + * @param string $db current database + * + * @return array + */ + public function moveRepeatingGroup( + $repeatingColumns, + $primaryColumns, + $newTable, + $newColumn, + $table, + $db + ) { + $repeatingColumnsArr = (array)Util::backquote( + explode(', ', $repeatingColumns) + ); + $primaryColumns = implode( + ',', + Util::backquote(explode(',', $primaryColumns)) + ); + $query1 = 'CREATE TABLE ' . Util::backquote($newTable); + $query2 = 'ALTER TABLE ' . Util::backquote($table); + $message = Message::success( + sprintf( + __('Selected repeating group has been moved to the table \'%s\''), + htmlspecialchars($table) + ) + ); + $first = true; + $error = false; + foreach ($repeatingColumnsArr as $repeatingColumn) { + if (!$first) { + $query1 .= ' UNION '; + } + $first = false; + $query1 .= ' SELECT ' . $primaryColumns . ',' . $repeatingColumn + . ' as ' . Util::backquote($newColumn) + . ' FROM ' . Util::backquote($table); + $query2 .= ' DROP ' . $repeatingColumn . ','; + } + $query2 = trim($query2, ','); + $queries = [$query1, $query2]; + $this->dbi->selectDb($db); + foreach ($queries as $query) { + if (!$this->dbi->tryQuery($query)) { + $message = Message::error(__('Error in processing!')); + $message->addMessage( + Message::rawError( + $this->dbi->getError() + ), + '

      ' + ); + $error = true; + break; + } + } + return [ + 'queryError' => $error, 'message' => $message + ]; + } + + /** + * build html for 3NF step 1 to find the transitive dependencies + * + * @param string $db current database + * @param array $tables tables formed after 2NF and need to process for 3NF + * + * @return string + */ + public function getHtmlFor3NFstep1($db, array $tables) + { + $legendText = __('Step 3.') . "1 " . __('Find transitive dependencies'); + $extra = ""; + $headText = __( + 'Please answer the following question(s) ' + . 'carefully to obtain a correct normalization.' + ); + $subText = __( + 'For each column below, ' + . 'please select the minimal set of columns among given set ' + . 'whose values combined together are sufficient' + . ' to determine the value of the column.
      ' + . 'Note: A column may have no transitive dependency, ' + . 'in that case you don\'t have to select any.' + ); + $cnt = 0; + foreach ($tables as $table) { + $primary = Index::getPrimary($table, $db); + $primarycols = $primary->getColumns(); + $selectTdForm = ""; + $pk = []; + foreach ($primarycols as $col) { + $pk[] = $col->getName(); + } + $this->dbi->selectDb($db); + $columns = (array) $this->dbi->getColumnNames( + $db, + $table + ); + if (count($columns) - count($pk) <= 1) { + continue; + } + foreach ($columns as $column) { + if (!in_array($column, $pk)) { + $selectTdForm .= '' + . '' . htmlspecialchars($column) . ''; + } + } + foreach ($columns as $column) { + if (!in_array($column, $pk)) { + $cnt++; + $extra .= "" . sprintf( + __('\'%1$s\' depends on:'), + htmlspecialchars($column) + ) + . "
      "; + $extra .= '
      ' + . $selectTdForm + . '


      '; + } + } + } + if ($extra == "") { + $headText = __( + "No Transitive dependencies possible as the table " + . "doesn't have any non primary key columns" + ); + $subText = ""; + $extra = "

      " . __("Table is already in Third normal form!") . "

      "; + } + $res = [ + 'legendText' => $legendText, + 'headText' => $headText, + 'subText' => $subText, + 'extra' => $extra + ]; + return $res; + } + + /** + * get html for options to normalize table + * + * @return string HTML + */ + public function getHtmlForNormalizeTable() + { + $htmlOutput = '
      ' + . Url::getHiddenInputs($GLOBALS['db'], $GLOBALS['table']) + . ''; + $htmlOutput .= '
      '; + $htmlOutput .= '' + . __('Improve table structure (Normalization):') . ''; + $htmlOutput .= '

      ' . __('Select up to what step you want to normalize') + . '

      '; + $choices = [ + '1nf' => __('First step of normalization (1NF)'), + '2nf' => __('Second step of normalization (1NF+2NF)'), + '3nf' => __('Third step of normalization (1NF+2NF+3NF)')]; + + $htmlOutput .= Util::getRadioFields( + 'normalizeTo', + $choices, + '1nf', + true + ); + $htmlOutput .= '
      ' + . "" . __( + 'Hint: Please follow the procedure carefully in order ' + . 'to obtain correct normalization' + ) . "" + . '' + . '
      ' + . '
      ' + . '
    '; + + return $htmlOutput; + } + + /** + * find all the possible partial dependencies based on data in the table. + * + * @param string $table current table + * @param string $db current database + * + * @return string HTML containing the list of all the possible partial dependencies + */ + public function findPartialDependencies($table, $db) + { + $dependencyList = []; + $this->dbi->selectDb($db); + $columns = (array) $this->dbi->getColumnNames( + $db, + $table + ); + $columns = (array)Util::backquote($columns); + $totalRowsRes = $this->dbi->fetchResult( + 'SELECT COUNT(*) FROM (SELECT * FROM ' + . Util::backquote($table) . ' LIMIT 500) as dt;' + ); + $totalRows = $totalRowsRes[0]; + $primary = Index::getPrimary($table, $db); + $primarycols = $primary->getColumns(); + $pk = []; + foreach ($primarycols as $col) { + $pk[] = Util::backquote($col->getName()); + } + $partialKeys = $this->getAllCombinationPartialKeys($pk); + $distinctValCount = $this->findDistinctValuesCount( + array_unique( + array_merge($columns, $partialKeys) + ), + $table + ); + foreach ($columns as $column) { + if (!in_array($column, $pk)) { + foreach ($partialKeys as $partialKey) { + if ($partialKey + && $this->checkPartialDependency( + $partialKey, + $column, + $table, + $distinctValCount[$partialKey], + $distinctValCount[$column], + $totalRows + ) + ) { + $dependencyList[$partialKey][] = $column; + } + } + } + } + + $html = __( + 'This list is based on a subset of the table\'s data ' + . 'and is not necessarily accurate. ' + ) + . '
    '; + foreach ($dependencyList as $dependon => $colList) { + $html .= '' + . '' + . '' + . htmlspecialchars(str_replace('`', '', $dependon)) . ' -> ' + . '' + . htmlspecialchars(str_replace('`', '', implode(', ', $colList))) + . '' + . ''; + } + if (empty($dependencyList)) { + $html .= '

    ' + . __('No partial dependencies found!') . '

    '; + } + $html .= '
    '; + return $html; + } + + /** + * check whether a particular column is dependent on given subset of primary key + * + * @param string $partialKey the partial key, subset of primary key, + * each column in key supposed to be backquoted + * @param string $column backquoted column on whose dependency being checked + * @param string $table current table + * @param integer $pkCnt distinct value count for given partial key + * @param integer $colCnt distinct value count for given column + * @param integer $totalRows total distinct rows count of the table + * + * @return boolean TRUE if $column is dependent on $partialKey, False otherwise + */ + private function checkPartialDependency( + $partialKey, + $column, + $table, + $pkCnt, + $colCnt, + $totalRows + ) { + $query = 'SELECT ' + . 'COUNT(DISTINCT ' . $partialKey . ',' . $column . ') as pkColCnt ' + . 'FROM (SELECT * FROM ' . Util::backquote($table) + . ' LIMIT 500) as dt' . ';'; + $res = $this->dbi->fetchResult($query, null, null); + $pkColCnt = $res[0]; + if ($pkCnt && $pkCnt == $colCnt && $colCnt == $pkColCnt) { + return true; + } + if ($totalRows && $totalRows == $pkCnt) { + return true; + } + return false; + } + + /** + * function to get distinct values count of all the column in the array $columns + * + * @param array $columns array of backquoted columns whose distinct values + * need to be counted. + * @param string $table table to which these columns belong + * + * @return array associative array containing the count + */ + private function findDistinctValuesCount(array $columns, $table) + { + $result = []; + $query = 'SELECT '; + foreach ($columns as $column) { + if ($column) { //each column is already backquoted + $query .= 'COUNT(DISTINCT ' . $column . ') as \'' + . $column . '_cnt\', '; + } + } + $query = trim($query, ', '); + $query .= ' FROM (SELECT * FROM ' . Util::backquote($table) + . ' LIMIT 500) as dt' . ';'; + $res = $this->dbi->fetchResult($query, null, null); + foreach ($columns as $column) { + if ($column) { + $result[$column] = isset($res[0][$column . '_cnt']) ? $res[0][$column . '_cnt'] : null; + } + } + return $result; + } + + /** + * find all the possible partial keys + * + * @param array $primaryKey array containing all the column present in primary key + * + * @return array containing all the possible partial keys(subset of primary key) + */ + private function getAllCombinationPartialKeys(array $primaryKey) + { + $results = ['']; + foreach ($primaryKey as $element) { + foreach ($results as $combination) { + array_push( + $results, + trim($element . ',' . $combination, ',') + ); + } + } + array_pop($results); //remove key which consist of all primary key columns + return $results; + } +} diff --git a/phpMyAdmin/libraries/classes/OpenDocument.php b/phpMyAdmin/libraries/classes/OpenDocument.php new file mode 100755 index 0000000..7710468 --- /dev/null +++ b/phpMyAdmin/libraries/classes/OpenDocument.php @@ -0,0 +1,177 @@ +' + . '' + . '' + . 'phpMyAdmin ' . PMA_VERSION . '' + . 'phpMyAdmin ' . PMA_VERSION + . '' + . '' . strftime('%Y-%m-%dT%H:%M:%S') + . '' + . '' + . '', + '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . '', + '' + . '' + . '' + . '' + . '' + . '' + . '' + ); + + $name = array( + 'mimetype', + 'content.xml', + 'meta.xml', + 'styles.xml', + 'META-INF/manifest.xml' + ); + + $zipExtension = new ZipExtension(); + return $zipExtension->createFile($data, $name); + } +} diff --git a/phpMyAdmin/libraries/classes/Operations.php b/phpMyAdmin/libraries/classes/Operations.php new file mode 100755 index 0000000..df94c04 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Operations.php @@ -0,0 +1,2159 @@ +relation = new Relation(); + } + + /** + * Get HTML output for database comment + * + * @param string $db database name + * + * @return string $html_output + */ + public function getHtmlForDatabaseComment($db) + { + $html_output = '
    ' + . '
    ' + . Url::getHiddenInputs($db) + . '
    ' + . ''; + if (Util::showIcons('ActionLinksMode')) { + $html_output .= Util::getImage('b_comment') . ' '; + } + $html_output .= __('Database comment'); + $html_output .= ''; + $html_output .= '' + . '
    '; + $html_output .= '
    ' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get HTML output for rename database + * + * @param string $db database name + * @param string $db_collation dataset collation + * + * @return string $html_output + */ + public function getHtmlForRenameDatabase($db, $db_collation) + { + $html_output = '
    ' + . '
    '; + if (isset($db_collation)) { + $html_output .= '' . "\n"; + } + $html_output .= '' + . '' + . Url::getHiddenInputs($db) + . '
    ' + . ''; + + if (Util::showIcons('ActionLinksMode')) { + $html_output .= Util::getImage('b_edit') . ' '; + } + $html_output .= __('Rename database to') + . ''; + + $html_output .= ''; + $html_output .= '
    '; + + if ($GLOBALS['db_priv'] && $GLOBALS['table_priv'] + && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $html_output .= ''; + } else { + $html_output .= ''; + } + + $html_output .= '
    '; + + $html_output .= '' + . '
    ' + . '
    ' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get HTML for database drop link + * + * @param string $db database name + * + * @return string $html_output + */ + public function getHtmlForDropDatabaseLink($db) + { + $this_sql_query = 'DROP DATABASE ' . Util::backquote($db); + $this_url_params = array( + 'sql_query' => $this_sql_query, + 'back' => 'db_operations.php', + 'goto' => 'index.php', + 'reload' => '1', + 'purge' => '1', + 'message_to_show' => sprintf( + __('Database %s has been dropped.'), + htmlspecialchars(Util::backquote($db)) + ), + 'db' => null, + ); + + $html_output = '
    ' + . '
    '; + $html_output .= ''; + if (Util::showIcons('ActionLinksMode')) { + $html_output .= Util::getImage('b_deltbl') . ' '; + } + $html_output .= __('Remove database') + . ''; + $html_output .= '
      '; + $html_output .= $this->getDeleteDataOrTablelink( + $this_url_params, + 'DROP_DATABASE', + __('Drop the database (DROP)'), + 'drop_db_anchor' + ); + $html_output .= '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get HTML snippet for copy database + * + * @param string $db database name + * @param string $db_collation dataset collation + * + * @return string $html_output + */ + public function getHtmlForCopyDatabase($db, $db_collation) + { + $drop_clause = 'DROP TABLE / DROP VIEW'; + $choices = array( + 'structure' => __('Structure only'), + 'data' => __('Structure and data'), + 'dataonly' => __('Data only') + ); + + $pma_switch_to_new = isset($_SESSION['pma_switch_to_new']) && $_SESSION['pma_switch_to_new']; + + $html_output = '
    '; + $html_output .= '
    '; + + if (isset($db_collation)) { + $html_output .= '' . "\n"; + } + $html_output .= '' . "\n" + . Url::getHiddenInputs($db); + $html_output .= '
    ' + . ''; + + if (Util::showIcons('ActionLinksMode')) { + $html_output .= Util::getImage('b_edit') . ' '; + } + $html_output .= __('Copy database to') + . '' + . '
    ' + . Util::getRadioFields( + 'what', $choices, 'data', true + ); + $html_output .= '
    '; + $html_output .= ''; + $html_output .= '
    '; + $html_output .= ''; + $html_output .= '
    '; + $html_output .= ''; + $html_output .= '
    '; + $html_output .= ''; + $html_output .= '
    '; + $html_output .= '
    '; + + if ($GLOBALS['db_priv'] && $GLOBALS['table_priv'] + && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $html_output .= ''; + } else { + $html_output .= ''; + } + $html_output .= '
    '; + + $html_output .= ''; + $html_output .= '' + . '
    '; + $html_output .= '
    ' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get HTML snippet for change database charset + * + * @param string $db database name + * @param string $db_collation dataset collation + * + * @return string $html_output + */ + public function getHtmlForChangeDatabaseCharset($db, $db_collation) + { + $html_output = '
    ' + . '
    '; + if (Util::showIcons('ActionLinksMode')) { + $html_output .= Util::getImage('s_asci') . ' '; + } + $html_output .= '' . "\n" + . '' . "\n" + . Charsets::getCollationDropdownBox( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['DisableIS'], + 'db_collation', + 'select_db_collation', + isset($db_collation) ? $db_collation : '', + false + ) + . '
    ' + . '' + . '' + . '
    ' + . '' + . '' + . '' + . '
    ' + . '' . "\n" + . '
    ' . "\n" + . '
    ' . "\n"; + + return $html_output; + } + + /** + * Run the Procedure definitions and function definitions + * + * to avoid selecting alternatively the current and new db + * we would need to modify the CREATE definitions to qualify + * the db name + * + * @param string $db database name + * + * @return void + */ + public function runProcedureAndFunctionDefinitions($db) + { + $procedure_names = $GLOBALS['dbi']->getProceduresOrFunctions($db, 'PROCEDURE'); + if ($procedure_names) { + foreach ($procedure_names as $procedure_name) { + $GLOBALS['dbi']->selectDb($db); + $tmp_query = $GLOBALS['dbi']->getDefinition( + $db, 'PROCEDURE', $procedure_name + ); + if ($tmp_query !== false) { + // collect for later display + $GLOBALS['sql_query'] .= "\n" . $tmp_query; + $GLOBALS['dbi']->selectDb($_POST['newname']); + $GLOBALS['dbi']->query($tmp_query); + } + } + } + + $function_names = $GLOBALS['dbi']->getProceduresOrFunctions($db, 'FUNCTION'); + if ($function_names) { + foreach ($function_names as $function_name) { + $GLOBALS['dbi']->selectDb($db); + $tmp_query = $GLOBALS['dbi']->getDefinition( + $db, 'FUNCTION', $function_name + ); + if ($tmp_query !== false) { + // collect for later display + $GLOBALS['sql_query'] .= "\n" . $tmp_query; + $GLOBALS['dbi']->selectDb($_POST['newname']); + $GLOBALS['dbi']->query($tmp_query); + } + } + } + } + + /** + * Create database before copy + * + * @return void + */ + public function createDbBeforeCopy() + { + $local_query = 'CREATE DATABASE IF NOT EXISTS ' + . Util::backquote($_POST['newname']); + if (isset($_POST['db_collation'])) { + $local_query .= ' DEFAULT' + . Util::getCharsetQueryPart($_POST['db_collation']); + } + $local_query .= ';'; + $GLOBALS['sql_query'] .= $local_query; + + // save the original db name because Tracker.php which + // may be called under $GLOBALS['dbi']->query() changes $GLOBALS['db'] + // for some statements, one of which being CREATE DATABASE + $original_db = $GLOBALS['db']; + $GLOBALS['dbi']->query($local_query); + $GLOBALS['db'] = $original_db; + + // Set the SQL mode to NO_AUTO_VALUE_ON_ZERO to prevent MySQL from creating + // export statements it cannot import + $sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'"; + $GLOBALS['dbi']->query($sql_set_mode); + + // rebuild the database list because Table::moveCopy + // checks in this list if the target db exists + $GLOBALS['dblist']->databases->build(); + } + + /** + * Get views as an array and create SQL view stand-in + * + * @param array $tables_full array of all tables in given db or dbs + * @param ExportSql $export_sql_plugin export plugin instance + * @param string $db database name + * + * @return array $views + */ + public function getViewsAndCreateSqlViewStandIn( + array $tables_full, $export_sql_plugin, $db + ) { + $views = array(); + foreach ($tables_full as $each_table => $tmp) { + // to be able to rename a db containing views, + // first all the views are collected and a stand-in is created + // the real views are created after the tables + if ($GLOBALS['dbi']->getTable($db, $each_table)->isView()) { + + // If view exists, and 'add drop view' is selected: Drop it! + if ($_POST['what'] != 'nocopy' + && isset($_POST['drop_if_exists']) + && $_POST['drop_if_exists'] == 'true' + ) { + $drop_query = 'DROP VIEW IF EXISTS ' + . Util::backquote($_POST['newname']) . '.' + . Util::backquote($each_table); + $GLOBALS['dbi']->query($drop_query); + + $GLOBALS['sql_query'] .= "\n" . $drop_query . ';'; + } + + $views[] = $each_table; + // Create stand-in definition to resolve view dependencies + $sql_view_standin = $export_sql_plugin->getTableDefStandIn( + $db, $each_table, "\n" + ); + $GLOBALS['dbi']->selectDb($_POST['newname']); + $GLOBALS['dbi']->query($sql_view_standin); + $GLOBALS['sql_query'] .= "\n" . $sql_view_standin; + } + } + return $views; + } + + /** + * Get sql query for copy/rename table and boolean for whether copy/rename or not + * + * @param array $tables_full array of all tables in given db or dbs + * @param boolean $move whether database name is empty or not + * @param string $db database name + * + * @return array SQL queries for the constraints + */ + public function copyTables(array $tables_full, $move, $db) + { + $sqlContraints = array(); + foreach ($tables_full as $each_table => $tmp) { + // skip the views; we have created stand-in definitions + if ($GLOBALS['dbi']->getTable($db, $each_table)->isView()) { + continue; + } + + // value of $what for this table only + $this_what = $_POST['what']; + + // do not copy the data from a Merge table + // note: on the calling FORM, 'data' means 'structure and data' + if ($GLOBALS['dbi']->getTable($db, $each_table)->isMerge()) { + if ($this_what == 'data') { + $this_what = 'structure'; + } + if ($this_what == 'dataonly') { + $this_what = 'nocopy'; + } + } + + if ($this_what != 'nocopy') { + // keep the triggers from the original db+table + // (third param is empty because delimiters are only intended + // for importing via the mysql client or our Import feature) + $triggers = $GLOBALS['dbi']->getTriggers($db, $each_table, ''); + + if (! Table::moveCopy( + $db, $each_table, $_POST['newname'], $each_table, + (isset($this_what) ? $this_what : 'data'), + $move, 'db_copy' + )) { + $GLOBALS['_error'] = true; + break; + } + // apply the triggers to the destination db+table + if ($triggers) { + $GLOBALS['dbi']->selectDb($_POST['newname']); + foreach ($triggers as $trigger) { + $GLOBALS['dbi']->query($trigger['create']); + $GLOBALS['sql_query'] .= "\n" . $trigger['create'] . ';'; + } + } + + // this does not apply to a rename operation + if (isset($_POST['add_constraints']) + && ! empty($GLOBALS['sql_constraints_query']) + ) { + $sqlContraints[] = $GLOBALS['sql_constraints_query']; + unset($GLOBALS['sql_constraints_query']); + } + } + } + return $sqlContraints; + } + + /** + * Run the EVENT definition for selected database + * + * to avoid selecting alternatively the current and new db + * we would need to modify the CREATE definitions to qualify + * the db name + * + * @param string $db database name + * + * @return void + */ + public function runEventDefinitionsForDb($db) + { + $event_names = $GLOBALS['dbi']->fetchResult( + 'SELECT EVENT_NAME FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' + . $GLOBALS['dbi']->escapeString($db) . '\';' + ); + if ($event_names) { + foreach ($event_names as $event_name) { + $GLOBALS['dbi']->selectDb($db); + $tmp_query = $GLOBALS['dbi']->getDefinition($db, 'EVENT', $event_name); + // collect for later display + $GLOBALS['sql_query'] .= "\n" . $tmp_query; + $GLOBALS['dbi']->selectDb($_POST['newname']); + $GLOBALS['dbi']->query($tmp_query); + } + } + } + + /** + * Handle the views, return the boolean value whether table rename/copy or not + * + * @param array $views views as an array + * @param boolean $move whether database name is empty or not + * @param string $db database name + * + * @return void + */ + public function handleTheViews(array $views, $move, $db) + { + // temporarily force to add DROP IF EXIST to CREATE VIEW query, + // to remove stand-in VIEW that was created earlier + // ( $_POST['drop_if_exists'] is used in moveCopy() ) + if (isset($_POST['drop_if_exists'])) { + $temp_drop_if_exists = $_POST['drop_if_exists']; + } + + $_POST['drop_if_exists'] = 'true'; + foreach ($views as $view) { + $copying_succeeded = Table::moveCopy( + $db, $view, $_POST['newname'], $view, 'structure', $move, 'db_copy' + ); + if (! $copying_succeeded) { + $GLOBALS['_error'] = true; + break; + } + } + unset($_POST['drop_if_exists']); + + if (isset($temp_drop_if_exists)) { + // restore previous value + $_POST['drop_if_exists'] = $temp_drop_if_exists; + } + } + + /** + * Adjust the privileges after Renaming the db + * + * @param string $oldDb Database name before renaming + * @param string $newname New Database name requested + * + * @return void + */ + public function adjustPrivilegesMoveDb($oldDb, $newname) + { + if ($GLOBALS['db_priv'] && $GLOBALS['table_priv'] + && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $GLOBALS['dbi']->selectDb('mysql'); + $newname = str_replace("_", "\_", $newname); + $oldDb = str_replace("_", "\_", $oldDb); + + // For Db specific privileges + $query_db_specific = 'UPDATE ' . Util::backquote('db') + . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newname) + . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\';'; + $GLOBALS['dbi']->query($query_db_specific); + + // For table specific privileges + $query_table_specific = 'UPDATE ' . Util::backquote('tables_priv') + . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newname) + . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\';'; + $GLOBALS['dbi']->query($query_table_specific); + + // For column specific privileges + $query_col_specific = 'UPDATE ' . Util::backquote('columns_priv') + . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newname) + . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\';'; + $GLOBALS['dbi']->query($query_col_specific); + + // For procedures specific privileges + $query_proc_specific = 'UPDATE ' . Util::backquote('procs_priv') + . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newname) + . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\';'; + $GLOBALS['dbi']->query($query_proc_specific); + + // Finally FLUSH the new privileges + $flush_query = "FLUSH PRIVILEGES;"; + $GLOBALS['dbi']->query($flush_query); + } + } + + /** + * Adjust the privileges after Copying the db + * + * @param string $oldDb Database name before copying + * @param string $newname New Database name requested + * + * @return void + */ + public function adjustPrivilegesCopyDb($oldDb, $newname) + { + if ($GLOBALS['db_priv'] && $GLOBALS['table_priv'] + && $GLOBALS['col_priv'] && $GLOBALS['proc_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $GLOBALS['dbi']->selectDb('mysql'); + $newname = str_replace("_", "\_", $newname); + $oldDb = str_replace("_", "\_", $oldDb); + + $query_db_specific_old = 'SELECT * FROM ' + . Util::backquote('db') . ' WHERE ' + . 'Db = "' . $oldDb . '";'; + + $old_privs_db = $GLOBALS['dbi']->fetchResult($query_db_specific_old, 0); + + foreach ($old_privs_db as $old_priv) { + $newDb_db_privs_query = 'INSERT INTO ' . Util::backquote('db') + . ' VALUES("' . $old_priv[0] . '", "' . $newname . '"'; + for ($i = 2; $i < count($old_priv); $i++) { + $newDb_db_privs_query .= ', "' . $old_priv[$i] . '"'; + } + $newDb_db_privs_query .= ')'; + + $GLOBALS['dbi']->query($newDb_db_privs_query); + } + + // For Table Specific privileges + $query_table_specific_old = 'SELECT * FROM ' + . Util::backquote('tables_priv') . ' WHERE ' + . 'Db = "' . $oldDb . '";'; + + $old_privs_table = $GLOBALS['dbi']->fetchResult( + $query_table_specific_old, + 0 + ); + + foreach ($old_privs_table as $old_priv) { + $newDb_table_privs_query = 'INSERT INTO ' . Util::backquote( + 'tables_priv' + ) . ' VALUES("' . $old_priv[0] . '", "' . $newname . '", "' + . $old_priv[2] . '", "' . $old_priv[3] . '", "' . $old_priv[4] + . '", "' . $old_priv[5] . '", "' . $old_priv[6] . '", "' + . $old_priv[7] . '");'; + + $GLOBALS['dbi']->query($newDb_table_privs_query); + } + + // For Column Specific privileges + $query_col_specific_old = 'SELECT * FROM ' + . Util::backquote('columns_priv') . ' WHERE ' + . 'Db = "' . $oldDb . '";'; + + $old_privs_col = $GLOBALS['dbi']->fetchResult( + $query_col_specific_old, + 0 + ); + + foreach ($old_privs_col as $old_priv) { + $newDb_col_privs_query = 'INSERT INTO ' . Util::backquote( + 'columns_priv' + ) . ' VALUES("' . $old_priv[0] . '", "' . $newname . '", "' + . $old_priv[2] . '", "' . $old_priv[3] . '", "' . $old_priv[4] + . '", "' . $old_priv[5] . '", "' . $old_priv[6] . '");'; + + $GLOBALS['dbi']->query($newDb_col_privs_query); + } + + // For Procedure Specific privileges + $query_proc_specific_old = 'SELECT * FROM ' + . Util::backquote('procs_priv') . ' WHERE ' + . 'Db = "' . $oldDb . '";'; + + $old_privs_proc = $GLOBALS['dbi']->fetchResult( + $query_proc_specific_old, + 0 + ); + + foreach ($old_privs_proc as $old_priv) { + $newDb_proc_privs_query = 'INSERT INTO ' . Util::backquote( + 'procs_priv' + ) . ' VALUES("' . $old_priv[0] . '", "' . $newname . '", "' + . $old_priv[2] . '", "' . $old_priv[3] . '", "' . $old_priv[4] + . '", "' . $old_priv[5] . '", "' . $old_priv[6] . '", "' + . $old_priv[7] . '");'; + + $GLOBALS['dbi']->query($newDb_proc_privs_query); + } + + // Finally FLUSH the new privileges + $flush_query = "FLUSH PRIVILEGES;"; + $GLOBALS['dbi']->query($flush_query); + } + } + + /** + * Create all accumulated constraints + * + * @param array $sqlConstratints array of sql constraints for the database + * + * @return void + */ + public function createAllAccumulatedConstraints(array $sqlConstratints) + { + $GLOBALS['dbi']->selectDb($_POST['newname']); + foreach ($sqlConstratints as $one_query) { + $GLOBALS['dbi']->query($one_query); + // and prepare to display them + $GLOBALS['sql_query'] .= "\n" . $one_query; + } + } + + /** + * Duplicate the bookmarks for the db (done once for each db) + * + * @param boolean $_error whether table rename/copy or not + * @param string $db database name + * + * @return void + */ + public function duplicateBookmarks($_error, $db) + { + if (! $_error && $db != $_POST['newname']) { + $get_fields = array('user', 'label', 'query'); + $where_fields = array('dbase' => $db); + $new_fields = array('dbase' => $_POST['newname']); + Table::duplicateInfo( + 'bookmarkwork', 'bookmark', $get_fields, + $where_fields, $new_fields + ); + } + } + + /** + * Get the HTML snippet for order the table + * + * @param array $columns columns array + * + * @return string $html_out + */ + public function getHtmlForOrderTheTable(array $columns) + { + $html_output = '
    '; + $html_output .= '
    '; + $html_output .= Url::getHiddenInputs( + $GLOBALS['db'], $GLOBALS['table'] + ); + $html_output .= '
    ' + . '' . __('Alter table order by') . '' + . ' ' . __('(singly)') . ' ' + . '
    ' + . '' + . '' + . '' + . '' + . '
    ' + . '
    ' + . '' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get the HTML snippet for move table + * + * @return string $html_output + */ + public function getHtmlForMoveTable() + { + $html_output = '
    '; + $html_output .= '
    ' + . Url::getHiddenInputs($GLOBALS['db'], $GLOBALS['table']); + + $html_output .= '' + . '' + . '
    '; + + $html_output .= '' . __('Move table to (database.table)') + . ''; + + if (count($GLOBALS['dblist']->databases) > $GLOBALS['cfg']['MaxDbList']) { + $html_output .= ''; + } else { + $html_output .= ''; + } + $html_output .= ' . '; + $html_output .= '
    '; + + // starting with MySQL 5.0.24, SHOW CREATE TABLE includes the AUTO_INCREMENT + // next value but users can decide if they want it or not for the operation + + $html_output .= '' + . '
    '; + + if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $html_output .= ''; + } else { + $html_output .= ''; + } + $html_output .= '
    '; + + $html_output .= '
    ' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get the HTML div for Table option + * + * @param Table $pma_table Table object + * @param string $comment Comment + * @param array $tbl_collation table collation + * @param string $tbl_storage_engine table storage engine + * @param string $pack_keys pack keys + * @param string $auto_increment value of auto increment + * @param string $delay_key_write delay key write + * @param string $transactional value of transactional + * @param string $page_checksum value of page checksum + * @param string $checksum the checksum + * + * @return string $html_output + */ + public function getTableOptionDiv($pma_table, $comment, $tbl_collation, $tbl_storage_engine, + $pack_keys, $auto_increment, $delay_key_write, + $transactional, $page_checksum, $checksum + ) { + $html_output = '
    '; + $html_output .= '
    getTableOptionFieldset( + $pma_table, $comment, $tbl_collation, + $tbl_storage_engine, $pack_keys, + $delay_key_write, $auto_increment, $transactional, $page_checksum, + $checksum + ); + + $html_output .= '
    ' + . '' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get HTML for the rename table part of table options + * + * @return string $html_output + */ + private function getHtmlForRenameTable() + { + $html_output = '' . __('Rename table to') . '' + . '' + . '' + . '' + . ''; + + if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $html_output .= ''; + } else { + $html_output .= ''; + } + $html_output .= ''; + + $html_output .= ''; + return $html_output; + } + + /** + * Get HTML for the table comments part of table options + * + * @param string $current_value of the table comments + * + * @return string $html_output + */ + private function getHtmlForTableComments($current_value) + { + $commentLength = $GLOBALS['dbi']->getVersion() >= 50503 ? 2048 : 60; + $html_output = '' . __('Table comments') . '' + . '' + . '' + . '' + . ''; + + return $html_output; + } + + /** + * Get HTML for the PACK KEYS part of table options + * + * @param string $current_value of the pack keys option + * + * @return string $html_output + */ + private function getHtmlForPackKeys($current_value) + { + $html_output = '' + . '' + . '' + . '' + . ''; + + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'ISAM'))) { + $html_output .= $this->getHtmlForPackKeys($pack_keys); + } // end if (MYISAM|ISAM) + + if ($pma_table->isEngine(array('MYISAM', 'ARIA'))) { + $html_output .= $this->getHtmlForTableRow( + 'new_checksum', + 'CHECKSUM', + $checksum + ); + + $html_output .= $this->getHtmlForTableRow( + 'new_delay_key_write', + 'DELAY_KEY_WRITE', + $delay_key_write + ); + } // end if (MYISAM) + + if ($pma_table->isEngine('ARIA')) { + $html_output .= $this->getHtmlForTableRow( + 'new_transactional', + 'TRANSACTIONAL', + $transactional + ); + + $html_output .= $this->getHtmlForTableRow( + 'new_page_checksum', + 'PAGE_CHECKSUM', + $page_checksum + ); + } // end if (ARIA) + + if (strlen($auto_increment) > 0 + && $pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'PBXT', 'ROCKSDB')) + ) { + $html_output .= '' + . '' + . '' + . ' '; + } // end if (MYISAM|INNODB) + + $possible_row_formats = $this->getPossibleRowFormat(); + + // for MYISAM there is also COMPRESSED but it can be set only by the + // myisampack utility, so don't offer here the choice because if we + // try it inside an ALTER TABLE, MySQL (at least in 5.1.23-maria) + // does not return a warning + // (if the table was compressed, it can be seen on the Structure page) + + if (isset($possible_row_formats[$tbl_storage_engine])) { + $current_row_format + = mb_strtoupper($GLOBALS['showtable']['Row_format']); + $html_output .= '' + . '' + . ''; + $html_output .= Util::getDropdown( + 'new_row_format', $possible_row_formats[$tbl_storage_engine], + $current_row_format, 'new_row_format' + ); + $html_output .= ''; + } + $html_output .= '' + . ''; + + return $html_output; + } + + /** + * Get the common HTML table row (tr) for new_checksum, new_delay_key_write, + * new_transactional and new_page_checksum + * + * @param string $attribute class, name and id attribute + * @param string $label label value + * @param string $val checksum, delay_key_write, transactional, page_checksum + * + * @return string $html_output + */ + private function getHtmlForTableRow($attribute, $label, $val) + { + return '' + . '' + . '' + . '' + . '' + . '' + . '' + . ''; + } + + /** + * Get array of possible row formats + * + * @return array $possible_row_formats + */ + private function getPossibleRowFormat() + { + // the outer array is for engines, the inner array contains the dropdown + // option values as keys then the dropdown option labels + + $possible_row_formats = array( + 'ARCHIVE' => array( + 'COMPRESSED' => 'COMPRESSED', + ), + 'ARIA' => array( + 'FIXED' => 'FIXED', + 'DYNAMIC' => 'DYNAMIC', + 'PAGE' => 'PAGE' + ), + 'MARIA' => array( + 'FIXED' => 'FIXED', + 'DYNAMIC' => 'DYNAMIC', + 'PAGE' => 'PAGE' + ), + 'MYISAM' => array( + 'FIXED' => 'FIXED', + 'DYNAMIC' => 'DYNAMIC' + ), + 'PBXT' => array( + 'FIXED' => 'FIXED', + 'DYNAMIC' => 'DYNAMIC' + ), + 'INNODB' => array( + 'COMPACT' => 'COMPACT', + 'REDUNDANT' => 'REDUNDANT' + ) + ); + + /** @var Innodb $innodbEnginePlugin */ + $innodbEnginePlugin = StorageEngine::getEngine('Innodb'); + $innodbPluginVersion = $innodbEnginePlugin->getInnodbPluginVersion(); + if (!empty($innodbPluginVersion)) { + $innodb_file_format = $innodbEnginePlugin->getInnodbFileFormat(); + } else { + $innodb_file_format = ''; + } + /** + * Newer MySQL/MariaDB always return empty a.k.a '' on $innodb_file_format otherwise + * old versions of MySQL/MariaDB must be returning something or not empty. + * This patch is to support newer MySQL/MariaDB while also for backward compatibilities. + */ + if (( ('Barracuda' == $innodb_file_format) || ($innodb_file_format == '') ) + && $innodbEnginePlugin->supportsFilePerTable() + ) { + $possible_row_formats['INNODB']['DYNAMIC'] = 'DYNAMIC'; + $possible_row_formats['INNODB']['COMPRESSED'] = 'COMPRESSED'; + } + + return $possible_row_formats; + } + + /** + * Get HTML div for copy table + * + * @return string $html_output + */ + public function getHtmlForCopytable() + { + $html_output = '
    '; + $html_output .= '
    ' + . Url::getHiddenInputs($GLOBALS['db'], $GLOBALS['table']) + . ''; + + $html_output .= '
    '; + $html_output .= '' + . __('Copy table to (database.table)') . ''; + + if (count($GLOBALS['dblist']->databases) > $GLOBALS['cfg']['MaxDbList']) { + $html_output .= ''; + } else { + $html_output .= ''; + } + $html_output .= ' . '; + $html_output .= '
    '; + + $choices = array( + 'structure' => __('Structure only'), + 'data' => __('Structure and data'), + 'dataonly' => __('Data only') + ); + + $html_output .= Util::getRadioFields( + 'what', $choices, 'data', true + ); + $html_output .= '
    '; + + $html_output .= '' + . '
    ' + . '' + . '
    '; + + // display "Add constraints" choice only if there are + // foreign keys + if ($this->relation->getForeigners($GLOBALS['db'], $GLOBALS['table'], '', 'foreign')) { + $html_output .= ''; + $html_output .= '
    '; + } // endif + + $html_output .= '
    '; + + if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $html_output .= ''; + } else { + $html_output .= ''; + } + $html_output .= '
    '; + + $pma_switch_to_new = isset($_SESSION['pma_switch_to_new']) && $_SESSION['pma_switch_to_new']; + + $html_output .= ''; + $html_output .= '' + . '
    '; + + $html_output .= '
    ' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get HTML snippet for table maintenance + * + * @param Table $pma_table Table object + * @param array $url_params array of URL parameters + * + * @return string $html_output + */ + public function getHtmlForTableMaintenance($pma_table, array $url_params) + { + $html_output = '
    '; + $html_output .= '
    ' + . '' . __('Table maintenance') . ''; + $html_output .= '
      '; + + // Note: BERKELEY (BDB) is no longer supported, starting with MySQL 5.1 + $html_output .= $this->getListofMaintainActionLink($pma_table, $url_params); + + $html_output .= '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get HTML 'li' having a link of maintain action + * + * @param Table $pma_table Table object + * @param array $url_params Array of URL parameters + * + * @return string $html_output + */ + private function getListofMaintainActionLink($pma_table, array $url_params) + { + $html_output = ''; + + // analyze table + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'BERKELEYDB', 'TOKUDB'))) { + $params = array( + 'sql_query' => 'ANALYZE TABLE ' + . Util::backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= $this->getMaintainActionlink( + __('Analyze table'), + $params, + $url_params, + 'ANALYZE_TABLE' + ); + } + + // check table + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'TOKUDB'))) { + $params = array( + 'sql_query' => 'CHECK TABLE ' + . Util::backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= $this->getMaintainActionlink( + __('Check table'), + $params, + $url_params, + 'CHECK_TABLE' + ); + } + + // checksum table + $params = array( + 'sql_query' => 'CHECKSUM TABLE ' + . Util::backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= $this->getMaintainActionlink( + __('Checksum table'), + $params, + $url_params, + 'CHECKSUM_TABLE' + ); + + // defragment table + if ($pma_table->isEngine(array('INNODB'))) { + $params = array( + 'sql_query' => 'ALTER TABLE ' + . Util::backquote($GLOBALS['table']) + . ' ENGINE = InnoDB;' + ); + $html_output .= $this->getMaintainActionlink( + __('Defragment table'), + $params, + $url_params, + 'InnoDB_File_Defragmenting' + ); + } + + // flush table + $params = array( + 'sql_query' => 'FLUSH TABLE ' + . Util::backquote($GLOBALS['table']), + 'message_to_show' => sprintf( + __('Table %s has been flushed.'), + htmlspecialchars($GLOBALS['table']) + ), + 'reload' => 1, + ); + $html_output .= $this->getMaintainActionlink( + __('Flush the table (FLUSH)'), + $params, + $url_params, + 'FLUSH' + ); + + // optimize table + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'BERKELEYDB', 'TOKUDB'))) { + $params = array( + 'sql_query' => 'OPTIMIZE TABLE ' + . Util::backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= $this->getMaintainActionlink( + __('Optimize table'), + $params, + $url_params, + 'OPTIMIZE_TABLE' + ); + } + + // repair table + if ($pma_table->isEngine(array('MYISAM', 'ARIA'))) { + $params = array( + 'sql_query' => 'REPAIR TABLE ' + . Util::backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + ); + $html_output .= $this->getMaintainActionlink( + __('Repair table'), + $params, + $url_params, + 'REPAIR_TABLE' + ); + } + + return $html_output; + } + + /** + * Get maintain action HTML link + * + * @param string $action_message action message + * @param array $params url parameters array + * @param array $url_params additional url parameters + * @param string $link contains name of page/anchor that is being linked + * + * @return string $html_output + */ + private function getMaintainActionlink($action_message, array $params, array $url_params, $link) + { + return '
  • ' + . Util::linkOrButton( + 'sql.php', + array_merge($url_params, $params), + $action_message, + ['class' => 'maintain_action ajax'] + ) + . Util::showMySQLDocu($link) + . '
  • '; + } + + /** + * Get HTML for Delete data or table (truncate table, drop table) + * + * @param array $truncate_table_url_params url parameter array for truncate table + * @param array $dropTableUrlParams url parameter array for drop table + * + * @return string $html_output + */ + public function getHtmlForDeleteDataOrTable( + array $truncate_table_url_params, + array $dropTableUrlParams + ) { + $html_output = '
    ' + . '
    ' + . '' . __('Delete data or table') . ''; + + $html_output .= '
      '; + + if (! empty($truncate_table_url_params)) { + $html_output .= $this->getDeleteDataOrTablelink( + $truncate_table_url_params, + 'TRUNCATE_TABLE', + __('Empty the table (TRUNCATE)'), + 'truncate_tbl_anchor' + ); + } + if (!empty($dropTableUrlParams)) { + $html_output .= $this->getDeleteDataOrTablelink( + $dropTableUrlParams, + 'DROP_TABLE', + __('Delete the table (DROP)'), + 'drop_tbl_anchor' + ); + } + $html_output .= '
    '; + + return $html_output; + } + + /** + * Get the HTML link for Truncate table, Drop table and Drop db + * + * @param array $url_params url parameter array for delete data or table + * @param string $syntax TRUNCATE_TABLE or DROP_TABLE or DROP_DATABASE + * @param string $link link to be shown + * @param string $htmlId id of the link + * + * @return string html output + */ + public function getDeleteDataOrTablelink(array $url_params, $syntax, $link, $htmlId) + { + return '
  • ' . Util::linkOrButton( + 'sql.php', + $url_params, + $link, + array('id' => $htmlId, 'class' => 'ajax') + ) + . Util::showMySQLDocu($syntax) + . '
  • '; + } + + /** + * Get HTML snippet for partition maintenance + * + * @param array $partition_names array of partition names for a specific db/table + * @param array $url_params url parameters + * + * @return string $html_output + */ + public function getHtmlForPartitionMaintenance(array $partition_names, array $url_params) + { + $choices = array( + 'ANALYZE' => __('Analyze'), + 'CHECK' => __('Check'), + 'OPTIMIZE' => __('Optimize'), + 'REBUILD' => __('Rebuild'), + 'REPAIR' => __('Repair'), + 'TRUNCATE' => __('Truncate') + ); + + $partition_method = Partition::getPartitionMethod( + $GLOBALS['db'], $GLOBALS['table'] + ); + // add COALESCE or DROP option to choices array depeding on Partition method + if ($partition_method == 'RANGE' + || $partition_method == 'RANGE COLUMNS' + || $partition_method == 'LIST' + || $partition_method == 'LIST COLUMNS' + ) { + $choices['DROP'] = __('Drop'); + } else { + $choices['COALESCE'] = __('Coalesce'); + } + + $html_output = '
    ' + . '
    ' + . Url::getHiddenInputs($GLOBALS['db'], $GLOBALS['table']) + . '
    ' + . '' + . __('Partition maintenance') + . Util::showMySQLDocu('partitioning_maintenance') + . ''; + + $html_select = '' . "\n"; + $html_output .= sprintf(__('Partition %s'), $html_select); + + $html_output .= '
    '; + $html_output .= Util::getRadioFields( + 'partition_operation', $choices, 'ANALYZE', false, true, 'floatleft' + ); + $this_url_params = array_merge( + $url_params, + array( + 'sql_query' => 'ALTER TABLE ' + . Util::backquote($GLOBALS['table']) + . ' REMOVE PARTITIONING;' + ) + ); + $html_output .= '

    '; + + $html_output .= '' + . __('Remove partitioning') . ''; + + $html_output .= '
    ' + . '
    ' + . '' + . '' + . '
    ' + . '
    ' + . '
    '; + + return $html_output; + } + + /** + * Get the HTML for Referential Integrity check + * + * @param array $foreign all Relations to foreign tables for a given table + * or optionally a given column in a table + * @param array $url_params array of url parameters + * + * @return string $html_output + */ + public function getHtmlForReferentialIntegrityCheck(array $foreign, array $url_params) + { + $html_output = '
    ' + . '
    ' + . '' . __('Check referential integrity:') . ''; + + $html_output .= '
      '; + + foreach ($foreign as $master => $arr) { + $join_query = 'SELECT ' + . Util::backquote($GLOBALS['table']) . '.*' + . ' FROM ' . Util::backquote($GLOBALS['table']) + . ' LEFT JOIN ' + . Util::backquote($arr['foreign_db']) + . '.' + . Util::backquote($arr['foreign_table']); + if ($arr['foreign_table'] == $GLOBALS['table']) { + $foreign_table = $GLOBALS['table'] . '1'; + $join_query .= ' AS ' . Util::backquote($foreign_table); + } else { + $foreign_table = $arr['foreign_table']; + } + $join_query .= ' ON ' + . Util::backquote($GLOBALS['table']) . '.' + . Util::backquote($master) + . ' = ' + . Util::backquote($arr['foreign_db']) + . '.' + . Util::backquote($foreign_table) . '.' + . Util::backquote($arr['foreign_field']) + . ' WHERE ' + . Util::backquote($arr['foreign_db']) + . '.' + . Util::backquote($foreign_table) . '.' + . Util::backquote($arr['foreign_field']) + . ' IS NULL AND ' + . Util::backquote($GLOBALS['table']) . '.' + . Util::backquote($master) + . ' IS NOT NULL'; + $this_url_params = array_merge( + $url_params, + [ + 'sql_query' => $join_query, + 'sql_signature' => Core::signSqlQuery($join_query), + ] + ); + + $html_output .= '
    • ' + . '' + . $master . ' -> ' . $arr['foreign_db'] . '.' + . $arr['foreign_table'] . '.' . $arr['foreign_field'] + . '
    • ' . "\n"; + } // foreach $foreign + $html_output .= '
    '; + + return $html_output; + } + + /** + * Reorder table based on request params + * + * @return array SQL query and result + */ + public function getQueryAndResultForReorderingTable() + { + $sql_query = 'ALTER TABLE ' + . Util::backquote($GLOBALS['table']) + . ' ORDER BY ' + . Util::backquote(urldecode($_POST['order_field'])); + if (isset($_POST['order_order']) + && $_POST['order_order'] === 'desc' + ) { + $sql_query .= ' DESC'; + } else { + $sql_query .= ' ASC'; + } + $sql_query .= ';'; + $result = $GLOBALS['dbi']->query($sql_query); + + return array($sql_query, $result); + } + + /** + * Get table alters array + * + * @param Table $pma_table The Table object + * @param string $pack_keys pack keys + * @param string $checksum value of checksum + * @param string $page_checksum value of page checksum + * @param string $delay_key_write delay key write + * @param string $row_format row format + * @param string $newTblStorageEngine table storage engine + * @param string $transactional value of transactional + * @param string $tbl_collation collation of the table + * + * @return array $table_alters + */ + public function getTableAltersArray($pma_table, $pack_keys, + $checksum, $page_checksum, $delay_key_write, + $row_format, $newTblStorageEngine, $transactional, $tbl_collation + ) { + global $auto_increment; + + $table_alters = array(); + + if (isset($_POST['comment']) + && urldecode($_POST['prev_comment']) !== $_POST['comment'] + ) { + $table_alters[] = 'COMMENT = \'' + . $GLOBALS['dbi']->escapeString($_POST['comment']) . '\''; + } + + if (! empty($newTblStorageEngine) + && mb_strtolower($newTblStorageEngine) !== mb_strtolower($GLOBALS['tbl_storage_engine']) + ) { + $table_alters[] = 'ENGINE = ' . $newTblStorageEngine; + } + if (! empty($_POST['tbl_collation']) + && $_POST['tbl_collation'] !== $tbl_collation + ) { + $table_alters[] = 'DEFAULT ' + . Util::getCharsetQueryPart($_POST['tbl_collation']); + } + + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'ISAM')) + && isset($_POST['new_pack_keys']) + && $_POST['new_pack_keys'] != (string)$pack_keys + ) { + $table_alters[] = 'pack_keys = ' . $_POST['new_pack_keys']; + } + + $_POST['new_checksum'] = empty($_POST['new_checksum']) ? '0' : '1'; + if ($pma_table->isEngine(array('MYISAM', 'ARIA')) + && $_POST['new_checksum'] !== $checksum + ) { + $table_alters[] = 'checksum = ' . $_POST['new_checksum']; + } + + $_POST['new_transactional'] + = empty($_POST['new_transactional']) ? '0' : '1'; + if ($pma_table->isEngine('ARIA') + && $_POST['new_transactional'] !== $transactional + ) { + $table_alters[] = 'TRANSACTIONAL = ' . $_POST['new_transactional']; + } + + $_POST['new_page_checksum'] + = empty($_POST['new_page_checksum']) ? '0' : '1'; + if ($pma_table->isEngine('ARIA') + && $_POST['new_page_checksum'] !== $page_checksum + ) { + $table_alters[] = 'PAGE_CHECKSUM = ' . $_POST['new_page_checksum']; + } + + $_POST['new_delay_key_write'] + = empty($_POST['new_delay_key_write']) ? '0' : '1'; + if ($pma_table->isEngine(array('MYISAM', 'ARIA')) + && $_POST['new_delay_key_write'] !== $delay_key_write + ) { + $table_alters[] = 'delay_key_write = ' . $_POST['new_delay_key_write']; + } + + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'PBXT', 'ROCKSDB')) + && ! empty($_POST['new_auto_increment']) + && (! isset($auto_increment) + || $_POST['new_auto_increment'] !== $auto_increment) + ) { + $table_alters[] = 'auto_increment = ' + . $GLOBALS['dbi']->escapeString($_POST['new_auto_increment']); + } + + if (! empty($_POST['new_row_format'])) { + $newRowFormat = $_POST['new_row_format']; + $newRowFormatLower = mb_strtolower($newRowFormat); + if ($pma_table->isEngine(array('MYISAM', 'ARIA', 'INNODB', 'PBXT')) + && (strlen($row_format) === 0 + || $newRowFormatLower !== mb_strtolower($row_format)) + ) { + $table_alters[] = 'ROW_FORMAT = ' + . $GLOBALS['dbi']->escapeString($newRowFormat); + } + } + + return $table_alters; + } + + /** + * Get warning messages array + * + * @return array $warning_messages + */ + public function getWarningMessagesArray() + { + $warning_messages = array(); + foreach ($GLOBALS['dbi']->getWarnings() as $warning) { + // In MariaDB 5.1.44, when altering a table from Maria to MyISAM + // and if TRANSACTIONAL was set, the system reports an error; + // I discussed with a Maria developer and he agrees that this + // should not be reported with a Level of Error, so here + // I just ignore it. But there are other 1478 messages + // that it's better to show. + if (! (isset($_POST['new_tbl_storage_engine']) + && $_POST['new_tbl_storage_engine'] == 'MyISAM' + && $warning['Code'] == '1478' + && $warning['Level'] == 'Error') + ) { + $warning_messages[] = $warning['Level'] . ': #' . $warning['Code'] + . ' ' . $warning['Message']; + } + } + return $warning_messages; + } + + /** + * Get SQL query and result after ran this SQL query for a partition operation + * has been requested by the user + * + * @return array $sql_query, $result + */ + public function getQueryAndResultForPartition() + { + $sql_query = 'ALTER TABLE ' + . Util::backquote($GLOBALS['table']) . ' ' + . $_POST['partition_operation'] + . ' PARTITION '; + + if ($_POST['partition_operation'] == 'COALESCE') { + $sql_query .= count($_POST['partition_name']); + } else { + $sql_query .= implode(', ', $_POST['partition_name']) . ';'; + } + + $result = $GLOBALS['dbi']->query($sql_query); + + return array($sql_query, $result); + } + + /** + * Adjust the privileges after renaming/moving a table + * + * @param string $oldDb Database name before table renaming/moving table + * @param string $oldTable Table name before table renaming/moving table + * @param string $newDb Database name after table renaming/ moving table + * @param string $newTable Table name after table renaming/moving table + * + * @return void + */ + public function adjustPrivilegesRenameOrMoveTable($oldDb, $oldTable, $newDb, $newTable) + { + if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $GLOBALS['dbi']->selectDb('mysql'); + + // For table specific privileges + $query_table_specific = 'UPDATE ' . Util::backquote('tables_priv') + . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newDb) . '\', Table_name = \'' . $GLOBALS['dbi']->escapeString($newTable) + . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\' AND Table_name = \'' . $GLOBALS['dbi']->escapeString($oldTable) + . '\';'; + $GLOBALS['dbi']->query($query_table_specific); + + // For column specific privileges + $query_col_specific = 'UPDATE ' . Util::backquote('columns_priv') + . 'SET Db = \'' . $GLOBALS['dbi']->escapeString($newDb) . '\', Table_name = \'' . $GLOBALS['dbi']->escapeString($newTable) + . '\' where Db = \'' . $GLOBALS['dbi']->escapeString($oldDb) . '\' AND Table_name = \'' . $GLOBALS['dbi']->escapeString($oldTable) + . '\';'; + $GLOBALS['dbi']->query($query_col_specific); + + // Finally FLUSH the new privileges + $flush_query = "FLUSH PRIVILEGES;"; + $GLOBALS['dbi']->query($flush_query); + } + } + + /** + * Adjust the privileges after copying a table + * + * @param string $oldDb Database name before table copying + * @param string $oldTable Table name before table copying + * @param string $newDb Database name after table copying + * @param string $newTable Table name after table copying + * + * @return void + */ + public function adjustPrivilegesCopyTable($oldDb, $oldTable, $newDb, $newTable) + { + if ($GLOBALS['table_priv'] && $GLOBALS['col_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $GLOBALS['dbi']->selectDb('mysql'); + + // For Table Specific privileges + $query_table_specific_old = 'SELECT * FROM ' + . Util::backquote('tables_priv') . ' where ' + . 'Db = "' . $oldDb . '" AND Table_name = "' . $oldTable . '";'; + + $old_privs_table = $GLOBALS['dbi']->fetchResult( + $query_table_specific_old, + 0 + ); + + foreach ($old_privs_table as $old_priv) { + $newDb_table_privs_query = 'INSERT INTO ' + . Util::backquote('tables_priv') . ' VALUES("' + . $old_priv[0] . '", "' . $newDb . '", "' . $old_priv[2] . '", "' + . $newTable . '", "' . $old_priv[4] . '", "' . $old_priv[5] + . '", "' . $old_priv[6] . '", "' . $old_priv[7] . '");'; + + $GLOBALS['dbi']->query($newDb_table_privs_query); + } + + // For Column Specific privileges + $query_col_specific_old = 'SELECT * FROM ' + . Util::backquote('columns_priv') . ' WHERE ' + . 'Db = "' . $oldDb . '" AND Table_name = "' . $oldTable . '";'; + + $old_privs_col = $GLOBALS['dbi']->fetchResult( + $query_col_specific_old, + 0 + ); + + foreach ($old_privs_col as $old_priv) { + $newDb_col_privs_query = 'INSERT INTO ' + . Util::backquote('columns_priv') . ' VALUES("' + . $old_priv[0] . '", "' . $newDb . '", "' . $old_priv[2] . '", "' + . $newTable . '", "' . $old_priv[4] . '", "' . $old_priv[5] + . '", "' . $old_priv[6] . '");'; + + $GLOBALS['dbi']->query($newDb_col_privs_query); + } + + // Finally FLUSH the new privileges + $flush_query = "FLUSH PRIVILEGES;"; + $GLOBALS['dbi']->query($flush_query); + } + } + + /** + * Change all collations and character sets of all columns in table + * + * @param string $db Database name + * @param string $table Table name + * @param string $tbl_collation Collation Name + * + * @return void + */ + public function changeAllColumnsCollation($db, $table, $tbl_collation) + { + $GLOBALS['dbi']->selectDb($db); + + $change_all_collations_query = 'ALTER TABLE ' + . Util::backquote($table) + . ' CONVERT TO'; + + list($charset) = explode('_', $tbl_collation); + + $change_all_collations_query .= ' CHARACTER SET ' . $charset + . ($charset == $tbl_collation ? '' : ' COLLATE ' . $tbl_collation); + + $GLOBALS['dbi']->query($change_all_collations_query); + } + + /** + * Move or copy a table + * + * @param string $db current database name + * @param string $table current table name + * + * @return void + */ + public function moveOrCopyTable($db, $table) + { + /** + * Selects the database to work with + */ + $GLOBALS['dbi']->selectDb($db); + + /** + * $_POST['target_db'] could be empty in case we came from an input field + * (when there are many databases, no drop-down) + */ + if (empty($_POST['target_db'])) { + $_POST['target_db'] = $db; + } + + /** + * A target table name has been sent to this script -> do the work + */ + if (Core::isValid($_POST['new_name'])) { + if ($db == $_POST['target_db'] && $table == $_POST['new_name']) { + if (isset($_POST['submit_move'])) { + $message = Message::error(__('Can\'t move table to same one!')); + } else { + $message = Message::error(__('Can\'t copy table to same one!')); + } + } else { + Table::moveCopy( + $db, $table, $_POST['target_db'], $_POST['new_name'], + $_POST['what'], isset($_POST['submit_move']), 'one_table' + ); + + if (isset($_POST['adjust_privileges']) + && ! empty($_POST['adjust_privileges']) + ) { + if (isset($_POST['submit_move'])) { + $this->adjustPrivilegesRenameOrMoveTable( + $db, $table, $_POST['target_db'], $_POST['new_name'] + ); + } else { + $this->adjustPrivilegesCopyTable( + $db, $table, $_POST['target_db'], $_POST['new_name'] + ); + } + + if (isset($_POST['submit_move'])) { + $message = Message::success( + __( + 'Table %s has been moved to %s. Privileges have been ' + . 'adjusted.' + ) + ); + } else { + $message = Message::success( + __( + 'Table %s has been copied to %s. Privileges have been ' + . 'adjusted.' + ) + ); + } + + } else { + if (isset($_POST['submit_move'])) { + $message = Message::success( + __('Table %s has been moved to %s.') + ); + } else { + $message = Message::success( + __('Table %s has been copied to %s.') + ); + } + } + + $old = Util::backquote($db) . '.' + . Util::backquote($table); + $message->addParam($old); + + $new_name = $_POST['new_name']; + if ($GLOBALS['dbi']->getLowerCaseNames() === '1') { + $new_name = strtolower($new_name); + } + + $GLOBALS['table'] = $new_name; + + $new = Util::backquote($_POST['target_db']) . '.' + . Util::backquote($new_name); + $message->addParam($new); + + /* Check: Work on new table or on old table? */ + if (isset($_POST['submit_move']) + || Core::isValid($_POST['switch_to_new']) + ) { + } + } + } else { + /** + * No new name for the table! + */ + $message = Message::error(__('The table name is empty!')); + } + + $response = Response::getInstance(); + if ($response->isAjax()) { + $response->addJSON('message', $message); + if ($message->isSuccess()) { + $response->addJSON('db', $GLOBALS['db']); + } else { + $response->setRequestStatus(false); + } + exit; + } + } +} diff --git a/phpMyAdmin/libraries/classes/OutputBuffering.php b/phpMyAdmin/libraries/classes/OutputBuffering.php new file mode 100755 index 0000000..a66b045 --- /dev/null +++ b/phpMyAdmin/libraries/classes/OutputBuffering.php @@ -0,0 +1,139 @@ +_mode = $this->_getMode(); + $this->_on = false; + } + + /** + * This function could be used eventually to support more modes. + * + * @return integer the output buffer mode + */ + private function _getMode() + { + $mode = 0; + if ($GLOBALS['cfg']['OBGzip'] && function_exists('ob_start')) { + if (ini_get('output_handler') == 'ob_gzhandler') { + // If a user sets the output_handler in php.ini to ob_gzhandler, then + // any right frame file in phpMyAdmin will not be handled properly by + // the browser. My fix was to check the ini file within the + // PMA_outBufferModeGet() function. + $mode = 0; + } elseif (function_exists('ob_get_level') && ob_get_level() > 0) { + // happens when php.ini's output_buffering is not Off + ob_end_clean(); + $mode = 1; + } else { + $mode = 1; + } + } + // Zero (0) is no mode or in other words output buffering is OFF. + // Follow 2^0, 2^1, 2^2, 2^3 type values for the modes. + // Useful if we ever decide to combine modes. Then a bitmask field of + // the sum of all modes will be the natural choice. + return $mode; + } + + /** + * Returns the singleton OutputBuffering object + * + * @return OutputBuffering object + */ + public static function getInstance() + { + if (empty(self::$_instance)) { + self::$_instance = new OutputBuffering(); + } + return self::$_instance; + } + + /** + * This function will need to run at the top of all pages if output + * output buffering is turned on. It also needs to be passed $mode from + * the PMA_outBufferModeGet() function or it will be useless. + * + * @return void + */ + public function start() + { + if (! $this->_on) { + if ($this->_mode && function_exists('ob_gzhandler')) { + ob_start('ob_gzhandler'); + } + ob_start(); + if (! defined('TESTSUITE')) { + header('X-ob_mode: ' . $this->_mode); + } + register_shutdown_function( + array(OutputBuffering::class, 'stop') + ); + $this->_on = true; + } + } + + /** + * This function will need to run at the bottom of all pages if output + * buffering is turned on. It also needs to be passed $mode from the + * PMA_outBufferModeGet() function or it will be useless. + * + * @return void + */ + public static function stop() + { + $buffer = OutputBuffering::getInstance(); + if ($buffer->_on) { + $buffer->_on = false; + $buffer->_content = ob_get_contents(); + if (ob_get_length() > 0) { + ob_end_clean(); + } + } + } + + /** + * Gets buffer content + * + * @return string buffer content + */ + public function getContents() + { + return $this->_content; + } + + /** + * Flushes output buffer + * + * @return void + */ + public function flush() + { + if (ob_get_status() && $this->_mode) { + ob_flush(); + } else { + flush(); + } + } +} diff --git a/phpMyAdmin/libraries/classes/ParseAnalyze.php b/phpMyAdmin/libraries/classes/ParseAnalyze.php new file mode 100755 index 0000000..c30af3e --- /dev/null +++ b/phpMyAdmin/libraries/classes/ParseAnalyze.php @@ -0,0 +1,78 @@ + 1) { + + /** + * @todo if there are more than one table name in the Select: + * - do not extract the first table name + * - do not show a table name in the page header + * - do not display the sub-pages links) + */ + $table = ''; + } else { + $table = $analyzed_sql_results['select_tables'][0][0]; + if (!empty($analyzed_sql_results['select_tables'][0][1])) { + $db = $analyzed_sql_results['select_tables'][0][1]; + } + } + // There is no point checking if a reload is required if we already decided + // to reload. Also, no reload is required for AJAX requests. + $response = Response::getInstance(); + if (empty($reload) && ! $response->isAjax()) { + // NOTE: Database names are case-insensitive. + $reload = strcasecmp($db, $prev_db) != 0; + } + + // Updating the array. + $analyzed_sql_results['reload'] = $reload; + } + + return array($analyzed_sql_results, $db, $table); + } +} diff --git a/phpMyAdmin/libraries/classes/Partition.php b/phpMyAdmin/libraries/classes/Partition.php new file mode 100755 index 0000000..3d1e1a6 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Partition.php @@ -0,0 +1,268 @@ +name = $row['PARTITION_NAME']; + $this->ordinal = $row['PARTITION_ORDINAL_POSITION']; + $this->method = $row['PARTITION_METHOD']; + $this->expression = $row['PARTITION_EXPRESSION']; + $this->description = $row['PARTITION_DESCRIPTION']; + // no sub partitions, load all data to this object + if (empty($row['SUBPARTITION_NAME'])) { + $this->loadCommonData($row); + } + } + + /** + * Returns the partiotion description + * + * @return string partition description + */ + public function getDescription() + { + return $this->description; + } + + /** + * Add a sub partition + * + * @param SubPartition $partition Sub partition + * + * @return void + */ + public function addSubPartition(SubPartition $partition) + { + $this->subPartitions[] = $partition; + } + + /** + * Whether there are sub partitions + * + * @return boolean + */ + public function hasSubPartitions() + { + return ! empty($this->subPartitions); + } + + /** + * Returns the number of data rows + * + * @return integer number of rows + */ + public function getRows() + { + if (empty($this->subPartitions)) { + return $this->rows; + } + + $rows = 0; + foreach ($this->subPartitions as $subPartition) { + $rows += $subPartition->rows; + } + return $rows; + } + + /** + * Returns the total data length + * + * @return integer data length + */ + public function getDataLength() + { + if (empty($this->subPartitions)) { + return $this->dataLength; + } + + $dataLength = 0; + foreach ($this->subPartitions as $subPartition) { + $dataLength += $subPartition->dataLength; + } + return $dataLength; + } + + /** + * Returns the tatal index length + * + * @return integer index length + */ + public function getIndexLength() + { + if (empty($this->subPartitions)) { + return $this->indexLength; + } + + $indexLength = 0; + foreach ($this->subPartitions as $subPartition) { + $indexLength += $subPartition->indexLength; + } + return $indexLength; + } + + /** + * Returns the list of sub partitions + * + * @return SubPartition[] + */ + public function getSubPartitions() + { + return $this->subPartitions; + } + + /** + * Returns array of partitions for a specific db/table + * + * @param string $db database name + * @param string $table table name + * + * @access public + * @return Partition[] + */ + static public function getPartitions($db, $table) + { + if (Partition::havePartitioning()) { + $result = $GLOBALS['dbi']->fetchResult( + "SELECT * FROM `information_schema`.`PARTITIONS`" + . " WHERE `TABLE_SCHEMA` = '" . $GLOBALS['dbi']->escapeString($db) + . "' AND `TABLE_NAME` = '" . $GLOBALS['dbi']->escapeString($table) . "'" + ); + if ($result) { + $partitionMap = array(); + foreach ($result as $row) { + if (isset($partitionMap[$row['PARTITION_NAME']])) { + $partition = $partitionMap[$row['PARTITION_NAME']]; + } else { + $partition = new Partition($row); + $partitionMap[$row['PARTITION_NAME']] = $partition; + } + + if (! empty($row['SUBPARTITION_NAME'])) { + $parentPartition = $partition; + $partition = new SubPartition($row); + $parentPartition->addSubPartition($partition); + } + } + return array_values($partitionMap); + } + return array(); + } + + return array(); + } + + /** + * returns array of partition names for a specific db/table + * + * @param string $db database name + * @param string $table table name + * + * @access public + * @return array of partition names + */ + static public function getPartitionNames($db, $table) + { + if (Partition::havePartitioning()) { + return $GLOBALS['dbi']->fetchResult( + "SELECT DISTINCT `PARTITION_NAME` FROM `information_schema`.`PARTITIONS`" + . " WHERE `TABLE_SCHEMA` = '" . $GLOBALS['dbi']->escapeString($db) + . "' AND `TABLE_NAME` = '" . $GLOBALS['dbi']->escapeString($table) . "'" + ); + } + + return array(); + } + + /** + * returns the partition method used by the table. + * + * @param string $db database name + * @param string $table table name + * + * @return string partition method + */ + static public function getPartitionMethod($db, $table) + { + if (Partition::havePartitioning()) { + $partition_method = $GLOBALS['dbi']->fetchResult( + "SELECT `PARTITION_METHOD` FROM `information_schema`.`PARTITIONS`" + . " WHERE `TABLE_SCHEMA` = '" . $GLOBALS['dbi']->escapeString($db) . "'" + . " AND `TABLE_NAME` = '" . $GLOBALS['dbi']->escapeString($table) . "'" + . " LIMIT 1" + ); + if (! empty($partition_method)) { + return $partition_method[0]; + } + } + return null; + } + + /** + * checks if MySQL server supports partitioning + * + * @static + * @staticvar boolean $have_partitioning + * @staticvar boolean $already_checked + * @access public + * @return boolean + */ + static public function havePartitioning() + { + static $have_partitioning = false; + static $already_checked = false; + + if (! $already_checked) { + if ($GLOBALS['dbi']->getVersion() < 50600) { + if ($GLOBALS['dbi']->fetchValue( + "SELECT @@have_partitioning;" + )) { + $have_partitioning = true; + } + } else if ($GLOBALS['dbi']->getVersion() >= 80000) { + $have_partitioning = true; + } else { + // see https://dev.mysql.com/doc/refman/5.6/en/partitioning.html + $plugins = $GLOBALS['dbi']->fetchResult("SHOW PLUGINS"); + foreach ($plugins as $value) { + if ($value['Name'] == 'partition') { + $have_partitioning = true; + break; + } + } + } + $already_checked = true; + } + return $have_partitioning; + } +} diff --git a/phpMyAdmin/libraries/classes/Pdf.php b/phpMyAdmin/libraries/classes/Pdf.php new file mode 100755 index 0000000..8ab3f1b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Pdf.php @@ -0,0 +1,154 @@ +SetAuthor('phpMyAdmin ' . PMA_VERSION); + $this->AddFont('DejaVuSans', '', 'dejavusans.php'); + $this->AddFont('DejaVuSans', 'B', 'dejavusansb.php'); + $this->SetFont(Pdf::PMA_PDF_FONT, '', 14); + $this->setFooterFont(array(Pdf::PMA_PDF_FONT, '', 14)); + } + + /** + * This function must be named "Footer" to work with the TCPDF library + * + * @return void + */ + // @codingStandardsIgnoreLine + public function Footer() + { + // Check if footer for this page already exists + if (!isset($this->footerset[$this->page])) { + $this->SetY(-15); + $this->SetFont(Pdf::PMA_PDF_FONT, '', 14); + $this->Cell( + 0, 6, + __('Page number:') . ' ' + . $this->getAliasNumPage() . '/' . $this->getAliasNbPages(), + 'T', 0, 'C' + ); + $this->Cell(0, 6, Util::localisedDate(), 0, 1, 'R'); + $this->SetY(20); + + // set footerset + $this->footerset[$this->page] = 1; + } + } + + /** + * Function to set alias which will be expanded on page rendering. + * + * @param string $name name of the alias + * @param string $value value of the alias + * + * @return void + */ + public function setAlias($name, $value) + { + $name = TCPDF_FONTS::UTF8ToUTF16BE( + $name, false, true, $this->CurrentFont + ); + $this->Alias[$name] = TCPDF_FONTS::UTF8ToUTF16BE( + $value, false, true, $this->CurrentFont + ); + } + + /** + * Improved with alias expanding. + * + * @return void + */ + public function _putpages() + { + if (count($this->Alias) > 0) { + $nbPages = count($this->pages); + for ($n = 1; $n <= $nbPages; $n++) { + $this->pages[$n] = strtr($this->pages[$n], $this->Alias); + } + } + parent::_putpages(); + } + + /** + * Displays an error message + * + * @param string $error_message the error message + * + * @return void + */ + // @codingStandardsIgnoreLine + public function Error($error_message = '') + { + Message::error( + __('Error while creating PDF:') . ' ' . $error_message + )->display(); + exit; + } + + /** + * Sends file as a download to user. + * + * @param string $filename file name + * + * @return void + */ + public function download($filename) + { + $pdfData = $this->getPDFData(); + Response::getInstance()->disable(); + Core::downloadHeader( + $filename, + 'application/pdf', + strlen($pdfData) + ); + echo $pdfData; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins.php b/phpMyAdmin/libraries/classes/Plugins.php new file mode 100755 index 0000000..b125bce --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins.php @@ -0,0 +1,584 @@ +getProperties()) { + $plugin_list[] = $plugin; + } + } + } + } + + usort($plugin_list, function($cmp_name_1, $cmp_name_2) { + return strcasecmp( + $cmp_name_1->getProperties()->getText(), + $cmp_name_2->getProperties()->getText() + ); + }); + return $plugin_list; + } + + /** + * Returns locale string for $name or $name if no locale is found + * + * @param string $name for local string + * + * @return string locale string for $name + */ + public static function getString($name) + { + return isset($GLOBALS[$name]) ? $GLOBALS[$name] : $name; + } + + /** + * Returns html input tag option 'checked' if plugin $opt + * should be set by config or request + * + * @param string $section name of config section in + * $GLOBALS['cfg'][$section] for plugin + * @param string $opt name of option + * + * @return string html input tag option 'checked' + */ + public static function checkboxCheck($section, $opt) + { + // If the form is being repopulated using $_GET data, that is priority + if (isset($_GET[$opt]) + || ! isset($_GET['repopulate']) + && ((! empty($GLOBALS['timeout_passed']) && isset($_REQUEST[$opt])) + || ! empty($GLOBALS['cfg'][$section][$opt])) + ) { + return ' checked="checked"'; + } + return ''; + } + + /** + * Returns default value for option $opt + * + * @param string $section name of config section in + * $GLOBALS['cfg'][$section] for plugin + * @param string $opt name of option + * + * @return string default value for option $opt + */ + public static function getDefault($section, $opt) + { + if (isset($_GET[$opt])) { + // If the form is being repopulated using $_GET data, that is priority + return htmlspecialchars($_GET[$opt]); + } + + if (isset($GLOBALS['timeout_passed']) + && $GLOBALS['timeout_passed'] + && isset($_REQUEST[$opt]) + ) { + return htmlspecialchars($_REQUEST[$opt]); + } + + if (!isset($GLOBALS['cfg'][$section][$opt])) { + return ''; + } + + $matches = array(); + /* Possibly replace localised texts */ + if (!preg_match_all( + '/(str[A-Z][A-Za-z0-9]*)/', + $GLOBALS['cfg'][$section][$opt], + $matches + )) { + return htmlspecialchars($GLOBALS['cfg'][$section][$opt]); + } + + $val = $GLOBALS['cfg'][$section][$opt]; + foreach ($matches[0] as $match) { + if (isset($GLOBALS[$match])) { + $val = str_replace($match, $GLOBALS[$match], $val); + } + } + return htmlspecialchars($val); + } + + /** + * Returns html select form element for plugin choice + * and hidden fields denoting whether each plugin must be exported as a file + * + * @param string $section name of config section in + * $GLOBALS['cfg'][$section] for plugin + * @param string $name name of select element + * @param array &$list array with plugin instances + * @param string $cfgname name of config value, if none same as $name + * + * @return string html select tag + */ + public static function getChoice($section, $name, array $list, $cfgname = null) + { + if (! isset($cfgname)) { + $cfgname = $name; + } + $ret = '' . "\n"; + } + $ret .= '' . "\n" . $hidden; + + return $ret; + } + + /** + * Returns single option in a list element + * + * @param string $section name of config section in $GLOBALS['cfg'][$section] for plugin + * @param string $plugin_name unique plugin name + * @param array|\PhpMyAdmin\Properties\PropertyItem &$propertyGroup options property main group instance + * @param boolean $is_subgroup if this group is a subgroup + * + * @return string table row with option + */ + public static function getOneOption( + $section, + $plugin_name, + &$propertyGroup, + $is_subgroup = false + ) { + $ret = "\n"; + + if (! $is_subgroup) { + // for subgroup headers + if (mb_strpos(get_class($propertyGroup), "PropertyItem")) { + $properties = array($propertyGroup); + } else { + // for main groups + $ret .= '
    '; + + if (method_exists($propertyGroup, 'getText')) { + $text = $propertyGroup->getText(); + } + + if ($text != null) { + $ret .= '

    ' . self::getString($text) . '

    '; + } + $ret .= '
      '; + } + } + + if (! isset($properties)) { + $not_subgroup_header = true; + if (method_exists($propertyGroup, 'getProperties')) { + $properties = $propertyGroup->getProperties(); + } + } + + if (isset($properties)) { + /** @var OptionsPropertySubgroup $propertyItem */ + foreach ($properties as $propertyItem) { + $property_class = get_class($propertyItem); + // if the property is a subgroup, we deal with it recursively + if (mb_strpos($property_class, "Subgroup")) { + // for subgroups + // each subgroup can have a header, which may also be a form element + /** @var OptionsPropertyItem $subgroup_header */ + $subgroup_header = $propertyItem->getSubgroupHeader(); + if (isset($subgroup_header)) { + $ret .= self::getOneOption( + $section, + $plugin_name, + $subgroup_header + ); + } + + $ret .= '
    • getName() . '">'; + } else { + $ret .= '>'; + } + + $ret .= self::getOneOption( + $section, + $plugin_name, + $propertyItem, + true + ); + continue; + } + + // single property item + $ret .= self::getHtmlForProperty( + $section, $plugin_name, $propertyItem + ); + } + } + + if ($is_subgroup) { + // end subgroup + $ret .= '
    '; + } else { + // end main group + if (! empty($not_subgroup_header)) { + $ret .= '
    '; + } + } + + if (method_exists($propertyGroup, "getDoc")) { + $doc = $propertyGroup->getDoc(); + if ($doc != null) { + if (count($doc) == 3) { + $ret .= PhpMyAdmin\Util::showMySQLDocu( + $doc[1], + false, + $doc[2] + ); + } elseif (count($doc) == 1) { + $ret .= PhpMyAdmin\Util::showDocu('faq', $doc[0]); + } else { + $ret .= PhpMyAdmin\Util::showMySQLDocu( + $doc[1] + ); + } + } + } + + // Close the list element after $doc link is displayed + if (isset($property_class)) { + if ($property_class == 'PhpMyAdmin\Properties\Options\Items\BoolPropertyItem' + || $property_class == 'PhpMyAdmin\Properties\Options\Items\MessageOnlyPropertyItem' + || $property_class == 'PhpMyAdmin\Properties\Options\Items\SelectPropertyItem' + || $property_class == 'PhpMyAdmin\Properties\Options\Items\TextPropertyItem' + ) { + $ret .= ''; + } + } + $ret .= "\n"; + return $ret; + } + + /** + * Get HTML for properties items + * + * @param string $section name of config section in + * $GLOBALS['cfg'][$section] for plugin + * @param string $plugin_name unique plugin name + * @param OptionsPropertyItem $propertyItem Property item + * + * @return string + */ + public static function getHtmlForProperty( + $section, $plugin_name, $propertyItem + ) { + $ret = null; + $property_class = get_class($propertyItem); + switch ($property_class) { + case 'PhpMyAdmin\Properties\Options\Items\BoolPropertyItem': + $ret .= '
  • ' . "\n"; + $ret .= 'getName() + ); + + if ($propertyItem->getForce() != null) { + // Same code is also few lines lower, update both if needed + $ret .= ' onclick="if (!this.checked && ' + . '(!document.getElementById(\'checkbox_' . $plugin_name + . '_' . $propertyItem->getForce() . '\') ' + . '|| !document.getElementById(\'checkbox_' + . $plugin_name . '_' . $propertyItem->getForce() + . '\').checked)) ' + . 'return false; else return true;"'; + } + $ret .= ' />'; + $ret .= ''; + break; + case 'PhpMyAdmin\Properties\Options\Items\DocPropertyItem': + echo 'PhpMyAdmin\Properties\Options\Items\DocPropertyItem'; + break; + case 'PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem': + $ret .= '
  • '; + break; + case 'PhpMyAdmin\Properties\Options\Items\MessageOnlyPropertyItem': + $ret .= '
  • ' . "\n"; + $ret .= '

    ' . self::getString($propertyItem->getText()) . '

    '; + break; + case 'PhpMyAdmin\Properties\Options\Items\RadioPropertyItem': + $default = self::getDefault( + $section, + $plugin_name . '_' . $propertyItem->getName() + ); + foreach ($propertyItem->getValues() as $key => $val) { + $ret .= '
  • ' + . self::getString($val) . '
  • '; + } + break; + case 'PhpMyAdmin\Properties\Options\Items\SelectPropertyItem': + $ret .= '
  • ' . "\n"; + $ret .= ''; + $ret .= ''; + break; + case 'PhpMyAdmin\Properties\Options\Items\TextPropertyItem': + case 'PhpMyAdmin\Properties\Options\Items\NumberPropertyItem': + $ret .= '
  • ' . "\n"; + $ret .= ''; + $ret .= 'getSize() != null + ? ' size="' . $propertyItem->getSize() . '"' + : '') + . ($propertyItem->getLen() != null + ? ' maxlength="' . $propertyItem->getLen() . '"' + : '') + . ' />'; + break; + default: + break; + } + return $ret; + } + + /** + * Returns html div with editable options for plugin + * + * @param string $section name of config section in $GLOBALS['cfg'][$section] + * @param array &$list array with plugin instances + * + * @return string html fieldset with plugin options + */ + public static function getOptions($section, array $list) + { + $ret = ''; + // Options for plugins that support them + foreach ($list as $plugin) { + $properties = $plugin->getProperties(); + if ($properties != null) { + $text = $properties->getText(); + $options = $properties->getOptions(); + } + + $elem = explode('\\', get_class($plugin)); + $plugin_name = array_pop($elem); + unset($elem); + $plugin_name = mb_strtolower( + mb_substr( + $plugin_name, + mb_strlen($section) + ) + ); + + $ret .= '
    '; + $ret .= '

    ' . self::getString($text) . '

    '; + + $no_options = true; + if (! is_null($options) && count($options) > 0) { + foreach ($options->getProperties() + as $propertyMainGroup + ) { + // check for hidden properties + $no_options = true; + foreach ($propertyMainGroup->getProperties() as $propertyItem) { + if (strcmp('PhpMyAdmin\Properties\Options\Items\HiddenPropertyItem', get_class($propertyItem))) { + $no_options = false; + break; + } + } + + $ret .= self::getOneOption( + $section, + $plugin_name, + $propertyMainGroup + ); + } + } + + if ($no_options) { + $ret .= '

    ' . __('This format has no options') . '

    '; + } + $ret .= '
    '; + } + return $ret; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationConfig.php b/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationConfig.php new file mode 100755 index 0000000..d9d7e07 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationConfig.php @@ -0,0 +1,170 @@ +isAjax()) { + $response->setRequestStatus(false); + // reload_flag removes the token parameter from the URL and reloads + $response->addJSON('reload_flag', '1'); + if (defined('TESTSUITE')) { + return true; + } else { + exit; + } + } + + return true; + } + + /** + * Gets authentication credentials + * + * @return boolean always true + */ + public function readCredentials() + { + if ($GLOBALS['token_provided'] && $GLOBALS['token_mismatch']) { + return false; + } + + $this->user = $GLOBALS['cfg']['Server']['user']; + $this->password = $GLOBALS['cfg']['Server']['password']; + + return true; + } + + /** + * User is not allowed to login to MySQL -> authentication failed + * + * @param string $failure String describing why authentication has failed + * + * @return void + */ + public function showFailure($failure) + { + parent::showFailure($failure); + $conn_error = $GLOBALS['dbi']->getError(); + if (!$conn_error) { + $conn_error = __('Cannot connect: invalid settings.'); + } + + /* HTML header */ + $response = Response::getInstance(); + $response->getFooter() + ->setMinimal(); + $header = $response->getHeader(); + $header->setBodyId('loginform'); + $header->setTitle(__('Access denied!')); + $header->disableMenuAndConsole(); + echo '

    +
    +

    '; + echo sprintf(__('Welcome to %s'), ' phpMyAdmin '); + echo '

    +
    +
    + + + + + + + ' , "\n"; + if (count($GLOBALS['cfg']['Servers']) > 1) { + // offer a chance to login to other servers if the current one failed + echo '' , "\n"; + echo ' ' , "\n"; + echo '' , "\n"; + } + echo '
    '; + if (isset($GLOBALS['allowDeny_forbidden']) + && $GLOBALS['allowDeny_forbidden'] + ) { + trigger_error(__('Access denied!'), E_USER_NOTICE); + } else { + // Check whether user has configured something + if ($GLOBALS['PMA_Config']->source_mtime == 0) { + echo '

    ' , sprintf( + __( + 'You probably did not create a configuration file.' + . ' You might want to use the %1$ssetup script%2$s to' + . ' create one.' + ), + '', + '' + ) , '

    ' , "\n"; + } elseif (!isset($GLOBALS['errno']) + || (isset($GLOBALS['errno']) && $GLOBALS['errno'] != 2002) + && $GLOBALS['errno'] != 2003 + ) { + // if we display the "Server not responding" error, do not confuse + // users by telling them they have a settings problem + // (note: it's true that they could have a badly typed host name, + // but anyway the current message tells that the server + // rejected the connection, which is not really what happened) + // 2002 is the error given by mysqli + // 2003 is the error given by mysql + trigger_error( + __( + 'phpMyAdmin tried to connect to the MySQL server, and the' + . ' server rejected the connection. You should check the' + . ' host, username and password in your configuration and' + . ' make sure that they correspond to the information given' + . ' by the administrator of the MySQL server.' + ), + E_USER_WARNING + ); + } + echo Util::mysqlDie( + $conn_error, + '', + true, + '', + false + ); + } + $GLOBALS['error_handler']->dispUserErrors(); + echo '
    ' , "\n"; + echo '' + , __('Retry to connect') + , '' , "\n"; + echo '
    ' , "\n"; + echo Select::render(true, true); + echo '
    ' , "\n"; + if (!defined('TESTSUITE')) { + exit; + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationCookie.php b/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationCookie.php new file mode 100755 index 0000000..997fe96 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationCookie.php @@ -0,0 +1,894 @@ +_use_openssl = ! class_exists('phpseclib\Crypt\Random'); + } + + /** + * Forces (not)using of openSSL + * + * @param boolean $use The flag + * + * @return void + */ + public function setUseOpenSSL($use) + { + $this->_use_openssl = $use; + } + + /** + * Displays authentication form + * + * this function MUST exit/quit the application + * + * @global string $conn_error the last connection error + * + * @return boolean|void + */ + public function showLoginForm() + { + global $conn_error; + + $response = Response::getInstance(); + if ($response->loginPage()) { + if (defined('TESTSUITE')) { + return true; + } else { + exit; + } + } + + // No recall if blowfish secret is not configured as it would produce + // garbage + if ($GLOBALS['cfg']['LoginCookieRecall'] + && ! empty($GLOBALS['cfg']['blowfish_secret']) + ) { + $default_user = $this->user; + $default_server = $GLOBALS['pma_auth_server']; + $autocomplete = ''; + } else { + $default_user = ''; + $default_server = ''; + // skip the IE autocomplete feature. + $autocomplete = ' autocomplete="off"'; + } + + echo Template::get('login/header')->render(['theme' => $GLOBALS['PMA_Theme']]); + + if ($GLOBALS['cfg']['DBG']['demo']) { + echo '
    '; + echo '' , __('phpMyAdmin Demo Server') , ''; + printf( + __( + 'You are using the demo server. You can do anything here, but ' + . 'please do not change root, debian-sys-maint and pma users. ' + . 'More information is available at %s.' + ), + 'demo.phpmyadmin.net' + ); + echo '
    '; + } + + // Show error message + if (! empty($conn_error)) { + Message::rawError($conn_error)->display(); + } elseif (isset($_GET['session_expired']) + && intval($_GET['session_expired']) == 1 + ) { + Message::rawError( + __('Your session has expired. Please log in again.') + )->display(); + } + + // Displays the languages form + $language_manager = LanguageManager::getInstance(); + if (empty($GLOBALS['cfg']['Lang']) && $language_manager->hasChoice()) { + echo "
    "; + // use fieldset, don't show doc link + echo $language_manager->getSelectorDisplay(true, false); + echo '
    '; + } + echo ' +
    + + '; + + if ($GLOBALS['error_handler']->hasDisplayErrors()) { + echo '
    '; + $GLOBALS['error_handler']->dispErrors(); + echo '
    '; + } + echo Template::get('login/footer')->render(); + echo Config::renderFooter(); + if (! defined('TESTSUITE')) { + exit; + } else { + return true; + } + } + + /** + * Gets authentication credentials + * + * this function DOES NOT check authentication - it just checks/provides + * authentication credentials required to connect to the MySQL server + * usually with $GLOBALS['dbi']->connect() + * + * it returns false if something is missing - which usually leads to + * showLoginForm() which displays login form + * + * it returns true if all seems ok which usually leads to auth_set_user() + * + * it directly switches to showFailure() if user inactivity timeout is reached + * + * @return boolean whether we get authentication settings or not + */ + public function readCredentials() + { + global $conn_error; + + // Initialization + /** + * @global $GLOBALS['pma_auth_server'] the user provided server to + * connect to + */ + $GLOBALS['pma_auth_server'] = ''; + + $this->user = $this->password = ''; + $GLOBALS['from_cookie'] = false; + + if (isset($_POST['pma_username']) && strlen($_POST['pma_username']) > 0) { + + // Verify Captcha if it is required. + if (! empty($GLOBALS['cfg']['CaptchaLoginPrivateKey']) + && ! empty($GLOBALS['cfg']['CaptchaLoginPublicKey']) + ) { + if (! empty($_POST["g-recaptcha-response"])) { + if (function_exists('curl_init')) { + $reCaptcha = new ReCaptcha\ReCaptcha( + $GLOBALS['cfg']['CaptchaLoginPrivateKey'], + new ReCaptcha\RequestMethod\CurlPost() + ); + } elseif (ini_get('allow_url_fopen')) { + $reCaptcha = new ReCaptcha\ReCaptcha( + $GLOBALS['cfg']['CaptchaLoginPrivateKey'], + new ReCaptcha\RequestMethod\Post() + ); + } else { + $reCaptcha = new ReCaptcha\ReCaptcha( + $GLOBALS['cfg']['CaptchaLoginPrivateKey'], + new ReCaptcha\RequestMethod\SocketPost() + ); + } + + // verify captcha status. + $resp = $reCaptcha->verify( + $_POST["g-recaptcha-response"], + Core::getIp() + ); + + // Check if the captcha entered is valid, if not stop the login. + if ($resp == null || ! $resp->isSuccess()) { + $codes = $resp->getErrorCodes(); + + if (in_array('invalid-json', $codes)) { + $conn_error = __('Failed to connect to the reCAPTCHA service!'); + } else { + $conn_error = __('Entered captcha is wrong, try again!'); + } + return false; + } + } else { + $conn_error = __('Missing reCAPTCHA verification, maybe it has been blocked by adblock?'); + return false; + } + } + + // The user just logged in + $this->user = Core::sanitizeMySQLUser($_POST['pma_username']); + $this->password = isset($_POST['pma_password']) ? $_POST['pma_password'] : ''; + if ($GLOBALS['cfg']['AllowArbitraryServer'] + && isset($_REQUEST['pma_servername']) + ) { + if ($GLOBALS['cfg']['ArbitraryServerRegexp']) { + $parts = explode(' ', $_REQUEST['pma_servername']); + if (count($parts) == 2) { + $tmp_host = $parts[0]; + } else { + $tmp_host = $_REQUEST['pma_servername']; + } + + $match = preg_match( + $GLOBALS['cfg']['ArbitraryServerRegexp'], $tmp_host + ); + if (! $match) { + $conn_error = __( + 'You are not allowed to log in to this MySQL server!' + ); + return false; + } + } + $GLOBALS['pma_auth_server'] = Core::sanitizeMySQLHost($_REQUEST['pma_servername']); + } + /* Secure current session on login to avoid session fixation */ + Session::secure(); + return true; + } + + // At the end, try to set the $this->user + // and $this->password variables from cookies + + // check cookies + $serverCookie = $GLOBALS['PMA_Config']->getCookie('pmaUser-' . $GLOBALS['server']); + if (empty($serverCookie)) { + return false; + } + + $value = $this->cookieDecrypt( + $serverCookie, + $this->_getEncryptionSecret() + ); + + if ($value === false) { + return false; + } + + $this->user = $value; + // user was never logged in since session start + if (empty($_SESSION['browser_access_time'])) { + return false; + } + + // User inactive too long + $last_access_time = time() - $GLOBALS['cfg']['LoginCookieValidity']; + foreach ($_SESSION['browser_access_time'] as $key => $value) { + if ($value < $last_access_time) { + unset($_SESSION['browser_access_time'][$key]); + } + } + // All sessions expired + if (empty($_SESSION['browser_access_time'])) { + Util::cacheUnset('is_create_db_priv'); + Util::cacheUnset('is_reload_priv'); + Util::cacheUnset('db_to_create'); + Util::cacheUnset('dbs_where_create_table_allowed'); + Util::cacheUnset('dbs_to_test'); + Util::cacheUnset('db_priv'); + Util::cacheUnset('col_priv'); + Util::cacheUnset('table_priv'); + Util::cacheUnset('proc_priv'); + + $this->showFailure('no-activity'); + if (! defined('TESTSUITE')) { + exit; + } else { + return false; + } + } + + // check password cookie + $serverCookie = $GLOBALS['PMA_Config']->getCookie('pmaAuth-' . $GLOBALS['server']); + + if (empty($serverCookie)) { + return false; + } + $value = $this->cookieDecrypt( + $serverCookie, + $this->_getSessionEncryptionSecret() + ); + if ($value === false) { + return false; + } + + $auth_data = json_decode($value, true); + + if (! is_array($auth_data) || ! isset($auth_data['password'])) { + return false; + } + $this->password = $auth_data['password']; + if ($GLOBALS['cfg']['AllowArbitraryServer'] && ! empty($auth_data['server'])) { + $GLOBALS['pma_auth_server'] = $auth_data['server']; + } + + $GLOBALS['from_cookie'] = true; + + return true; + } + + /** + * Set the user and password after last checkings if required + * + * @return boolean always true + */ + public function storeCredentials() + { + global $cfg; + + if ($GLOBALS['cfg']['AllowArbitraryServer'] + && ! empty($GLOBALS['pma_auth_server']) + ) { + /* Allow to specify 'host port' */ + $parts = explode(' ', $GLOBALS['pma_auth_server']); + if (count($parts) == 2) { + $tmp_host = $parts[0]; + $tmp_port = $parts[1]; + } else { + $tmp_host = $GLOBALS['pma_auth_server']; + $tmp_port = ''; + } + if ($cfg['Server']['host'] != $GLOBALS['pma_auth_server']) { + $cfg['Server']['host'] = $tmp_host; + if (! empty($tmp_port)) { + $cfg['Server']['port'] = $tmp_port; + } + } + unset($tmp_host, $tmp_port, $parts); + } + + return parent::storeCredentials(); + } + + /** + * Stores user credentials after successful login. + * + * @return void|bool + */ + public function rememberCredentials() + { + // Name and password cookies need to be refreshed each time + // Duration = one month for username + $this->storeUsernameCookie($this->user); + + // Duration = as configured + // Do not store password cookie on password change as we will + // set the cookie again after password has been changed + if (! isset($_POST['change_pw'])) { + $this->storePasswordCookie($this->password); + } + + // Set server cookies if required (once per session) and, in this case, + // force reload to ensure the client accepts cookies + if (! $GLOBALS['from_cookie']) { + // URL where to go: + $redirect_url = './index.php'; + + // any parameters to pass? + $url_params = array(); + if (strlen($GLOBALS['db']) > 0) { + $url_params['db'] = $GLOBALS['db']; + } + if (strlen($GLOBALS['table']) > 0) { + $url_params['table'] = $GLOBALS['table']; + } + // any target to pass? + if (! empty($GLOBALS['target']) + && $GLOBALS['target'] != 'index.php' + ) { + $url_params['target'] = $GLOBALS['target']; + } + + /** + * Clear user cache. + */ + Util::clearUserCache(); + + Response::getInstance() + ->disable(); + + Core::sendHeaderLocation( + $redirect_url . Url::getCommonRaw($url_params), + true + ); + if (! defined('TESTSUITE')) { + exit; + } else { + return false; + } + } // end if + + return true; + } + + /** + * Stores username in a cookie. + * + * @param string $username User name + * + * @return void + */ + public function storeUsernameCookie($username) + { + // Name and password cookies need to be refreshed each time + // Duration = one month for username + $GLOBALS['PMA_Config']->setCookie( + 'pmaUser-' . $GLOBALS['server'], + $this->cookieEncrypt( + $username, + $this->_getEncryptionSecret() + ) + ); + } + + /** + * Stores password in a cookie. + * + * @param string $password Password + * + * @return void + */ + public function storePasswordCookie($password) + { + $payload = array('password' => $password); + if ($GLOBALS['cfg']['AllowArbitraryServer'] && ! empty($GLOBALS['pma_auth_server'])) { + $payload['server'] = $GLOBALS['pma_auth_server']; + } + // Duration = as configured + $GLOBALS['PMA_Config']->setCookie( + 'pmaAuth-' . $GLOBALS['server'], + $this->cookieEncrypt( + json_encode($payload), + $this->_getSessionEncryptionSecret() + ), + null, + $GLOBALS['cfg']['LoginCookieStore'] + ); + } + + /** + * User is not allowed to login to MySQL -> authentication failed + * + * prepares error message and switches to showLoginForm() which display the error + * and the login form + * + * this function MUST exit/quit the application, + * currently done by call to showLoginForm() + * + * @param string $failure String describing why authentication has failed + * + * @return void + */ + public function showFailure($failure) + { + global $conn_error; + + parent::showFailure($failure); + + // Deletes password cookie and displays the login form + $GLOBALS['PMA_Config']->removeCookie('pmaAuth-' . $GLOBALS['server']); + + $conn_error = $this->getErrorMessage($failure); + + $response = Response::getInstance(); + + // needed for PHP-CGI (not need for FastCGI or mod-php) + $response->header('Cache-Control: no-store, no-cache, must-revalidate'); + $response->header('Pragma: no-cache'); + + $this->showLoginForm(); + } + + /** + * Returns blowfish secret or generates one if needed. + * + * @return string + */ + private function _getEncryptionSecret() + { + if (empty($GLOBALS['cfg']['blowfish_secret'])) { + return $this->_getSessionEncryptionSecret(); + } + + return $GLOBALS['cfg']['blowfish_secret']; + } + + /** + * Returns blowfish secret or generates one if needed. + * + * @return string + */ + private function _getSessionEncryptionSecret() + { + if (empty($_SESSION['encryption_key'])) { + if ($this->_use_openssl) { + $_SESSION['encryption_key'] = openssl_random_pseudo_bytes(32); + } else { + $_SESSION['encryption_key'] = Crypt\Random::string(32); + } + } + return $_SESSION['encryption_key']; + } + + /** + * Concatenates secret in order to make it 16 bytes log + * + * This doesn't add any security, just ensures the secret + * is long enough by copying it. + * + * @param string $secret Original secret + * + * @return string + */ + public function enlargeSecret($secret) + { + while (strlen($secret) < 16) { + $secret .= $secret; + } + return substr($secret, 0, 16); + } + + /** + * Derives MAC secret from encryption secret. + * + * @param string $secret the secret + * + * @return string the MAC secret + */ + public function getMACSecret($secret) + { + // Grab first part, up to 16 chars + // The MAC and AES secrets can overlap if original secret is short + $length = strlen($secret); + if ($length > 16) { + return substr($secret, 0, 16); + } + return $this->enlargeSecret( + $length == 1 ? $secret : substr($secret, 0, -1) + ); + } + + /** + * Derives AES secret from encryption secret. + * + * @param string $secret the secret + * + * @return string the AES secret + */ + public function getAESSecret($secret) + { + // Grab second part, up to 16 chars + // The MAC and AES secrets can overlap if original secret is short + $length = strlen($secret); + if ($length > 16) { + return substr($secret, -16); + } + return $this->enlargeSecret( + $length == 1 ? $secret : substr($secret, 1) + ); + } + + /** + * Cleans any SSL errors + * + * This can happen from corrupted cookies, by invalid encryption + * parameters used in older phpMyAdmin versions or by wrong openSSL + * configuration. + * + * In neither case the error is useful to user, but we need to clear + * the error buffer as otherwise the errors would pop up later, for + * example during MySQL SSL setup. + * + * @return void + */ + public function cleanSSLErrors() + { + if (function_exists('openssl_error_string')) { + while (($ssl_err = openssl_error_string()) !== false) { + } + } + } + + /** + * Encryption using openssl's AES or phpseclib's AES + * (phpseclib uses mcrypt when it is available) + * + * @param string $data original data + * @param string $secret the secret + * + * @return string the encrypted result + */ + public function cookieEncrypt($data, $secret) + { + $mac_secret = $this->getMACSecret($secret); + $aes_secret = $this->getAESSecret($secret); + $iv = $this->createIV(); + if ($this->_use_openssl) { + $result = openssl_encrypt( + $data, + 'AES-128-CBC', + $aes_secret, + 0, + $iv + ); + } else { + $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); + $cipher->setIV($iv); + $cipher->setKey($aes_secret); + $result = base64_encode($cipher->encrypt($data)); + } + $this->cleanSSLErrors(); + $iv = base64_encode($iv); + return json_encode( + array( + 'iv' => $iv, + 'mac' => hash_hmac('sha1', $iv . $result, $mac_secret), + 'payload' => $result, + ) + ); + } + + /** + * Decryption using openssl's AES or phpseclib's AES + * (phpseclib uses mcrypt when it is available) + * + * @param string $encdata encrypted data + * @param string $secret the secret + * + * @return string|false original data, false on error + */ + public function cookieDecrypt($encdata, $secret) + { + $data = json_decode($encdata, true); + + if (! is_array($data) || ! isset($data['mac']) || ! isset($data['iv']) || ! isset($data['payload']) + || ! is_string($data['mac']) || ! is_string($data['iv']) || ! is_string($data['payload']) + ) { + return false; + } + + $mac_secret = $this->getMACSecret($secret); + $aes_secret = $this->getAESSecret($secret); + $newmac = hash_hmac('sha1', $data['iv'] . $data['payload'], $mac_secret); + + if (! hash_equals($data['mac'], $newmac)) { + return false; + } + + if ($this->_use_openssl) { + $result = openssl_decrypt( + $data['payload'], + 'AES-128-CBC', + $aes_secret, + 0, + base64_decode($data['iv']) + ); + } else { + $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); + $cipher->setIV(base64_decode($data['iv'])); + $cipher->setKey($aes_secret); + $result = $cipher->decrypt(base64_decode($data['payload'])); + } + $this->cleanSSLErrors(); + return $result; + } + + /** + * Returns size of IV for encryption. + * + * @return int + */ + public function getIVSize() + { + if ($this->_use_openssl) { + return openssl_cipher_iv_length('AES-128-CBC'); + } + $cipher = new Crypt\AES(Crypt\Base::MODE_CBC); + return $cipher->block_size; + } + + /** + * Initialization + * Store the initialization vector because it will be needed for + * further decryption. I don't think necessary to have one iv + * per server so I don't put the server number in the cookie name. + * + * @return string + */ + public function createIV() + { + /* Testsuite shortcut only to allow predictable IV */ + if (! is_null($this->_cookie_iv)) { + return $this->_cookie_iv; + } + if ($this->_use_openssl) { + return openssl_random_pseudo_bytes( + $this->getIVSize() + ); + } + + return Crypt\Random::string( + $this->getIVSize() + ); + } + + /** + * Sets encryption IV to use + * + * This is for testing only! + * + * @param string $vector The IV + * + * @return void + */ + public function setIV($vector) + { + $this->_cookie_iv = $vector; + } + + /** + * Callback when user changes password. + * + * @param string $password New password to set + * + * @return void + */ + public function handlePasswordChange($password) + { + $this->storePasswordCookie($password); + } + + /** + * Perform logout + * + * @return void + */ + public function logOut() + { + /** @var Config $PMA_Config */ + global $PMA_Config; + + // -> delete password cookie(s) + if ($GLOBALS['cfg']['LoginCookieDeleteAll']) { + foreach ($GLOBALS['cfg']['Servers'] as $key => $val) { + $PMA_Config->removeCookie('pmaAuth-' . $key); + if ($PMA_Config->issetCookie('pmaAuth-' . $key)) { + $PMA_Config->removeCookie('pmaAuth-' . $key); + } + } + } else { + $cookieName = 'pmaAuth-' . $GLOBALS['server']; + $PMA_Config->removeCookie($cookieName); + if ($PMA_Config->issetCookie($cookieName)) { + $PMA_Config->removeCookie($cookieName); + } + } + parent::logOut(); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationHttp.php b/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationHttp.php new file mode 100755 index 0000000..3b8f0d8 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationHttp.php @@ -0,0 +1,214 @@ +isAjax()) { + $response->setRequestStatus(false); + // reload_flag removes the token parameter from the URL and reloads + $response->addJSON('reload_flag', '1'); + if (defined('TESTSUITE')) { + return true; + } else { + exit; + } + } + + return $this->authForm(); + } + + /** + * Displays authentication form + * + * @return boolean + */ + public function authForm() + { + if (empty($GLOBALS['cfg']['Server']['auth_http_realm'])) { + if (empty($GLOBALS['cfg']['Server']['verbose'])) { + $server_message = $GLOBALS['cfg']['Server']['host']; + } else { + $server_message = $GLOBALS['cfg']['Server']['verbose']; + } + $realm_message = 'phpMyAdmin ' . $server_message; + } else { + $realm_message = $GLOBALS['cfg']['Server']['auth_http_realm']; + } + + $response = Response::getInstance(); + + // remove non US-ASCII to respect RFC2616 + $realm_message = preg_replace('/[^\x20-\x7e]/i', '', $realm_message); + $response->header('WWW-Authenticate: Basic realm="' . $realm_message . '"'); + $response->setHttpResponseCode(401); + + /* HTML header */ + $footer = $response->getFooter(); + $footer->setMinimal(); + $header = $response->getHeader(); + $header->setTitle(__('Access denied!')); + $header->disableMenuAndConsole(); + $header->setBodyId('loginform'); + + $response->addHTML('

    '); + $response->addHTML(sprintf(__('Welcome to %s'), ' phpMyAdmin')); + $response->addHTML('

    '); + $response->addHTML('

    '); + $response->addHTML( + Message::error( + __('Wrong username/password. Access denied.') + ) + ); + $response->addHTML('

    '); + + $response->addHTML(Config::renderFooter()); + + if (!defined('TESTSUITE')) { + exit; + } else { + return false; + } + } + + /** + * Gets authentication credentials + * + * @return boolean whether we get authentication settings or not + */ + public function readCredentials() + { + // Grabs the $PHP_AUTH_USER variable + if (isset($GLOBALS['PHP_AUTH_USER'])) { + $this->user = $GLOBALS['PHP_AUTH_USER']; + } + if (empty($this->user)) { + if (Core::getenv('PHP_AUTH_USER')) { + $this->user = Core::getenv('PHP_AUTH_USER'); + } elseif (Core::getenv('REMOTE_USER')) { + // CGI, might be encoded, see below + $this->user = Core::getenv('REMOTE_USER'); + } elseif (Core::getenv('REDIRECT_REMOTE_USER')) { + // CGI, might be encoded, see below + $this->user = Core::getenv('REDIRECT_REMOTE_USER'); + } elseif (Core::getenv('AUTH_USER')) { + // WebSite Professional + $this->user = Core::getenv('AUTH_USER'); + } elseif (Core::getenv('HTTP_AUTHORIZATION')) { + // IIS, might be encoded, see below + $this->user = Core::getenv('HTTP_AUTHORIZATION'); + } elseif (Core::getenv('Authorization')) { + // FastCGI, might be encoded, see below + $this->user = Core::getenv('Authorization'); + } + } + // Grabs the $PHP_AUTH_PW variable + if (isset($GLOBALS['PHP_AUTH_PW'])) { + $this->password = $GLOBALS['PHP_AUTH_PW']; + } + if (empty($this->password)) { + if (Core::getenv('PHP_AUTH_PW')) { + $this->password = Core::getenv('PHP_AUTH_PW'); + } elseif (Core::getenv('REMOTE_PASSWORD')) { + // Apache/CGI + $this->password = Core::getenv('REMOTE_PASSWORD'); + } elseif (Core::getenv('AUTH_PASSWORD')) { + // WebSite Professional + $this->password = Core::getenv('AUTH_PASSWORD'); + } + } + // Sanitize empty password login + if (is_null($this->password)) { + $this->password = ''; + } + + // Avoid showing the password in phpinfo()'s output + unset($GLOBALS['PHP_AUTH_PW']); + unset($_SERVER['PHP_AUTH_PW']); + + // Decode possibly encoded information (used by IIS/CGI/FastCGI) + // (do not use explode() because a user might have a colon in his password + if (strcmp(substr($this->user, 0, 6), 'Basic ') == 0) { + $usr_pass = base64_decode(substr($this->user, 6)); + if (!empty($usr_pass)) { + $colon = strpos($usr_pass, ':'); + if ($colon) { + $this->user = substr($usr_pass, 0, $colon); + $this->password = substr($usr_pass, $colon + 1); + } + unset($colon); + } + unset($usr_pass); + } + + // sanitize username + $this->user = Core::sanitizeMySQLUser($this->user); + + // User logged out -> ensure the new username is not the same + $old_usr = isset($_REQUEST['old_usr']) ? $_REQUEST['old_usr'] : ''; + if (! empty($old_usr) + && (isset($this->user) && hash_equals($old_usr, $this->user)) + ) { + $this->user = ''; + } + + // Returns whether we get authentication settings or not + return !empty($this->user); + } + + /** + * User is not allowed to login to MySQL -> authentication failed + * + * @param string $failure String describing why authentication has failed + * + * @return void + */ + public function showFailure($failure) + { + parent::showFailure($failure); + $error = $GLOBALS['dbi']->getError(); + if ($error && $GLOBALS['errno'] != 1045) { + Core::fatalError($error); + } else { + $this->authForm(); + } + } + + /** + * Returns URL for login form. + * + * @return string + */ + public function getLoginFormURL() + { + return './index.php?old_usr=' . $this->user; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationSignon.php b/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationSignon.php new file mode 100755 index 0000000..e50c0ce --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Auth/AuthenticationSignon.php @@ -0,0 +1,282 @@ +disable(); + unset($_SESSION['LAST_SIGNON_URL']); + if (empty($GLOBALS['cfg']['Server']['SignonURL'])) { + Core::fatalError('You must set SignonURL!'); + } else { + Core::sendHeaderLocation($GLOBALS['cfg']['Server']['SignonURL']); + } + + if (!defined('TESTSUITE')) { + exit(); + } else { + return false; + } + } + + /** + * Set cookie params + * + * @param array $sessionCookieParams The cookie params + * @return void + */ + public function setCookieParams(array $sessionCookieParams = null) + { + /* Session cookie params from config */ + if ($sessionCookieParams === null) { + $sessionCookieParams = (array) $GLOBALS['cfg']['Server']['SignonCookieParams']; + } + + /* Sanitize cookie params */ + $defaultCookieParams = function ($key) { + switch ($key) { + case 'lifetime': + return 0; + case 'path': + return '/'; + case 'domain': + return ''; + case 'secure': + return false; + case 'httponly': + return false; + } + return null; + }; + + foreach (array('lifetime', 'path', 'domain', 'secure', 'httponly') as $key) { + if (! isset($sessionCookieParams[$key])) { + $sessionCookieParams[$key] = $defaultCookieParams($key); + } + } + + if (isset($sessionCookieParams['samesite']) + && ! in_array($sessionCookieParams['samesite'], array('Lax', 'Strict'))) { + // Not a valid value for samesite + unset($sessionCookieParams['samesite']); + } + + if (version_compare(phpversion(), '7.3.0', '>=')) { + session_set_cookie_params($sessionCookieParams); + } + + session_set_cookie_params( + $sessionCookieParams['lifetime'], + $sessionCookieParams['path'], + $sessionCookieParams['domain'], + $sessionCookieParams['secure'], + $sessionCookieParams['httponly'] + ); + } + + /** + * Gets authentication credentials + * + * @return boolean whether we get authentication settings or not + */ + public function readCredentials() + { + /* Check if we're using same signon server */ + $signon_url = $GLOBALS['cfg']['Server']['SignonURL']; + if (isset($_SESSION['LAST_SIGNON_URL']) + && $_SESSION['LAST_SIGNON_URL'] != $signon_url + ) { + return false; + } + + /* Script name */ + $script_name = $GLOBALS['cfg']['Server']['SignonScript']; + + /* Session name */ + $session_name = $GLOBALS['cfg']['Server']['SignonSession']; + + /* Login URL */ + $signon_url = $GLOBALS['cfg']['Server']['SignonURL']; + + /* Current host */ + $single_signon_host = $GLOBALS['cfg']['Server']['host']; + + /* Current port */ + $single_signon_port = $GLOBALS['cfg']['Server']['port']; + + /* No configuration updates */ + $single_signon_cfgupdate = array(); + + /* Handle script based auth */ + if (!empty($script_name)) { + if (!@file_exists($script_name)) { + Core::fatalError( + __('Can not find signon authentication script:') + . ' ' . $script_name + ); + } + include $script_name; + + list ($this->user, $this->password) + = get_login_credentials($GLOBALS['cfg']['Server']['user']); + } elseif (isset($_COOKIE[$session_name])) { /* Does session exist? */ + /* End current session */ + $old_session = session_name(); + $old_id = session_id(); + $oldCookieParams = session_get_cookie_params(); + if (!defined('TESTSUITE')) { + session_write_close(); + } + /* Load single signon session */ + if (!defined('TESTSUITE')) { + $this->setCookieParams(); + session_name($session_name); + session_id($_COOKIE[$session_name]); + session_start(); + } + + /* Clear error message */ + unset($_SESSION['PMA_single_signon_error_message']); + + /* Grab credentials if they exist */ + if (isset($_SESSION['PMA_single_signon_user'])) { + $this->user = $_SESSION['PMA_single_signon_user']; + } + if (isset($_SESSION['PMA_single_signon_password'])) { + $this->password = $_SESSION['PMA_single_signon_password']; + } + if (isset($_SESSION['PMA_single_signon_host'])) { + $single_signon_host = $_SESSION['PMA_single_signon_host']; + } + + if (isset($_SESSION['PMA_single_signon_port'])) { + $single_signon_port = $_SESSION['PMA_single_signon_port']; + } + + if (isset($_SESSION['PMA_single_signon_cfgupdate'])) { + $single_signon_cfgupdate = $_SESSION['PMA_single_signon_cfgupdate']; + } + + /* Also get token as it is needed to access subpages */ + if (isset($_SESSION['PMA_single_signon_token'])) { + /* No need to care about token on logout */ + $pma_token = $_SESSION['PMA_single_signon_token']; + } + + /* End single signon session */ + if (!defined('TESTSUITE')) { + session_write_close(); + } + + /* Restart phpMyAdmin session */ + if (!defined('TESTSUITE')) { + $this->setCookieParams($oldCookieParams); + session_name($old_session); + if (!empty($old_id)) { + session_id($old_id); + } + session_start(); + } + + /* Set the single signon host */ + $GLOBALS['cfg']['Server']['host'] = $single_signon_host; + + /* Set the single signon port */ + $GLOBALS['cfg']['Server']['port'] = $single_signon_port; + + /* Configuration update */ + $GLOBALS['cfg']['Server'] = array_merge( + $GLOBALS['cfg']['Server'], + $single_signon_cfgupdate + ); + + /* Restore our token */ + if (!empty($pma_token)) { + $_SESSION[' PMA_token '] = $pma_token; + $_SESSION[' HMAC_secret '] = Util::generateRandom(16); + } + + /** + * Clear user cache. + */ + Util::clearUserCache(); + } + + // Returns whether we get authentication settings or not + if (empty($this->user)) { + unset($_SESSION['LAST_SIGNON_URL']); + + return false; + } + + $_SESSION['LAST_SIGNON_URL'] = $GLOBALS['cfg']['Server']['SignonURL']; + + return true; + } + + /** + * User is not allowed to login to MySQL -> authentication failed + * + * @param string $failure String describing why authentication has failed + * + * @return void + */ + public function showFailure($failure) + { + parent::showFailure($failure); + + /* Session name */ + $session_name = $GLOBALS['cfg']['Server']['SignonSession']; + + /* Does session exist? */ + if (isset($_COOKIE[$session_name])) { + if (!defined('TESTSUITE')) { + /* End current session */ + session_write_close(); + + /* Load single signon session */ + $this->setCookieParams(); + session_name($session_name); + session_id($_COOKIE[$session_name]); + session_start(); + } + + /* Set error message */ + $_SESSION['PMA_single_signon_error_message'] = $this->getErrorMessage($failure); + } + $this->showLoginForm(); + } + + /** + * Returns URL for login form. + * + * @return string + */ + public function getLoginFormURL() + { + return $GLOBALS['cfg']['Server']['SignonURL']; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/AuthenticationPlugin.php b/phpMyAdmin/libraries/classes/Plugins/AuthenticationPlugin.php new file mode 100755 index 0000000..7e3edf6 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/AuthenticationPlugin.php @@ -0,0 +1,350 @@ +setSessionAccessTime(); + + $cfg['Server']['user'] = $this->user; + $cfg['Server']['password'] = $this->password; + + return true; + } + + /** + * Stores user credentials after successful login. + * + * @return void + */ + public function rememberCredentials() + { + } + + /** + * User is not allowed to login to MySQL -> authentication failed + * + * @param string $failure String describing why authentication has failed + * + * @return void + */ + public function showFailure($failure) + { + Logging::logUser($this->user, $failure); + } + + /** + * Perform logout + * + * @return void + */ + public function logOut() + { + /** @var Config $PMA_Config */ + global $PMA_Config; + + /* Obtain redirect URL (before doing logout) */ + if (! empty($GLOBALS['cfg']['Server']['LogoutURL'])) { + $redirect_url = $GLOBALS['cfg']['Server']['LogoutURL']; + } else { + $redirect_url = $this->getLoginFormURL(); + } + + /* Clear credentials */ + $this->user = ''; + $this->password = ''; + + /* + * Get a logged-in server count in case of LoginCookieDeleteAll is disabled. + */ + $server = 0; + if ($GLOBALS['cfg']['LoginCookieDeleteAll'] === false + && $GLOBALS['cfg']['Server']['auth_type'] == 'cookie' + ) { + foreach ($GLOBALS['cfg']['Servers'] as $key => $val) { + if ($PMA_Config->issetCookie('pmaAuth-' . $key)) { + $server = $key; + } + } + } + + if ($server === 0) { + /* delete user's choices that were stored in session */ + if (! defined('TESTSUITE')) { + session_unset(); + session_destroy(); + } + + /* Redirect to login form (or configured URL) */ + Core::sendHeaderLocation($redirect_url); + } else { + /* Redirect to other autenticated server */ + $_SESSION['partial_logout'] = true; + Core::sendHeaderLocation( + './index.php' . Url::getCommonRaw(array('server' => $server)) + ); + } + } + + /** + * Returns URL for login form. + * + * @return string + */ + public function getLoginFormURL() + { + return './index.php'; + } + + /** + * Returns error message for failed authentication. + * + * @param string $failure String describing why authentication has failed + * + * @return string + */ + public function getErrorMessage($failure) + { + if ($failure == 'empty-denied') { + return __( + 'Login without a password is forbidden by configuration' + . ' (see AllowNoPassword)' + ); + } elseif ($failure == 'root-denied' || $failure == 'allow-denied') { + return __('Access denied!'); + } elseif ($failure == 'no-activity') { + return sprintf( + __('No activity within %s seconds; please log in again.'), + intval($GLOBALS['cfg']['LoginCookieValidity']) + ); + } + + $dbi_error = $GLOBALS['dbi']->getError(); + if (!empty($dbi_error)) { + return htmlspecialchars($dbi_error); + } elseif (isset($GLOBALS['errno'])) { + return '#' . $GLOBALS['errno'] . ' ' + . __('Cannot log in to the MySQL server'); + } + + return __('Cannot log in to the MySQL server'); + } + + /** + * Callback when user changes password. + * + * @param string $password New password to set + * + * @return void + */ + public function handlePasswordChange($password) + { + } + + /** + * Store session access time in session. + * + * Tries to workaround PHP 5 session garbage collection which + * looks at the session file's last modified time + * + * @return void + */ + public function setSessionAccessTime() + { + if (isset($_REQUEST['guid'])) { + $guid = (string)$_REQUEST['guid']; + } else { + $guid = 'default'; + } + if (isset($_REQUEST['access_time'])) { + // Ensure access_time is in range <0, LoginCookieValidity + 1> + // to avoid excessive extension of validity. + // + // Negative values can cause session expiry extension + // Too big values can cause overflow and lead to same + $time = time() - min(max(0, intval($_REQUEST['access_time'])), $GLOBALS['cfg']['LoginCookieValidity'] + 1); + } else { + $time = time(); + } + $_SESSION['browser_access_time'][$guid] = $time; + } + + /** + * High level authentication interface + * + * Gets the credentials or shows login form if necessary + * + * @return void + */ + public function authenticate() + { + $success = $this->readCredentials(); + + /* Show login form (this exits) */ + if (! $success) { + /* Force generating of new session */ + Session::secure(); + $this->showLoginForm(); + } + + /* Store credentials (eg. in cookies) */ + $this->storeCredentials(); + /* Check allow/deny rules */ + $this->checkRules(); + } + + /** + * Check configuration defined restrictions for authentication + * + * @return void + */ + public function checkRules() + { + global $cfg; + + // Check IP-based Allow/Deny rules as soon as possible to reject the + // user based on mod_access in Apache + if (isset($cfg['Server']['AllowDeny']) + && isset($cfg['Server']['AllowDeny']['order']) + ) { + $allowDeny_forbidden = false; // default + if ($cfg['Server']['AllowDeny']['order'] == 'allow,deny') { + $allowDeny_forbidden = true; + if (IpAllowDeny::allowDeny('allow')) { + $allowDeny_forbidden = false; + } + if (IpAllowDeny::allowDeny('deny')) { + $allowDeny_forbidden = true; + } + } elseif ($cfg['Server']['AllowDeny']['order'] == 'deny,allow') { + if (IpAllowDeny::allowDeny('deny')) { + $allowDeny_forbidden = true; + } + if (IpAllowDeny::allowDeny('allow')) { + $allowDeny_forbidden = false; + } + } elseif ($cfg['Server']['AllowDeny']['order'] == 'explicit') { + if (IpAllowDeny::allowDeny('allow') && ! IpAllowDeny::allowDeny('deny')) { + $allowDeny_forbidden = false; + } else { + $allowDeny_forbidden = true; + } + } // end if ... elseif ... elseif + + // Ejects the user if banished + if ($allowDeny_forbidden) { + $this->showFailure('allow-denied'); + } + } // end if + + // is root allowed? + if (! $cfg['Server']['AllowRoot'] && $cfg['Server']['user'] == 'root') { + $this->showFailure('root-denied'); + } + + // is a login without password allowed? + if (! $cfg['Server']['AllowNoPassword'] + && $cfg['Server']['password'] === '' + ) { + $this->showFailure('empty-denied'); + } + } + + /** + * Checks whether two factor authentication is active + * for given user and performs it. + * + * @return void + */ + public function checkTwoFactor() + { + $twofactor = new TwoFactor($this->user); + + /* Do we need to show the form? */ + if ($twofactor->check()) { + return; + } + + $response = Response::getInstance(); + if ($response->loginPage()) { + if (defined('TESTSUITE')) { + return true; + } else { + exit; + } + } + echo Template::get('login/header')->render(['theme' => $GLOBALS['PMA_Theme']]); + Message::rawNotice( + __('You have enabled two factor authentication, please confirm your login.') + )->display(); + echo Template::get('login/twofactor')->render([ + 'form' => $twofactor->render(), + 'show_submit' => $twofactor->showSubmit, + ]); + echo Template::get('login/footer')->render(); + echo Config::renderFooter(); + if (! defined('TESTSUITE')) { + exit; + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportCodegen.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportCodegen.php new file mode 100755 index 0000000..b2a2763 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportCodegen.php @@ -0,0 +1,444 @@ +initSpecificVariables(); + $this->setProperties(); + } + + /** + * Initialize the local variables that are used for export CodeGen + * + * @return void + */ + protected function initSpecificVariables() + { + $this->_setCgFormats( + array( + "NHibernate C# DO", + "NHibernate XML", + ) + ); + + $this->_setCgHandlers( + array( + "_handleNHibernateCSBody", + "_handleNHibernateXMLBody", + ) + ); + } + + /** + * Sets the export CodeGen properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('CodeGen'); + $exportPluginProperties->setExtension('cs'); + $exportPluginProperties->setMimeType('text/cs'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new HiddenPropertyItem("structure_or_data"); + $generalOptions->addProperty($leaf); + $leaf = new SelectPropertyItem( + "format", + __('Format:') + ); + $leaf->setValues($this->_getCgFormats()); + $generalOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + return true; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in NHibernate format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + $CG_FORMATS = $this->_getCgFormats(); + $CG_HANDLERS = $this->_getCgHandlers(); + + $format = $GLOBALS['codegen_format']; + if (isset($CG_FORMATS[$format])) { + $method = $CG_HANDLERS[$format]; + + return Export::outputHandler( + $this->$method($db, $table, $crlf, $aliases) + ); + } + + return Export::outputHandler(sprintf("%s is not supported.", $format)); + } + + /** + * Used to make identifiers (from table or database names) + * + * @param string $str name to be converted + * @param bool $ucfirst whether to make the first character uppercase + * + * @return string identifier + */ + public static function cgMakeIdentifier($str, $ucfirst = true) + { + // remove unsafe characters + $str = preg_replace('/[^\p{L}\p{Nl}_]/u', '', $str); + // make sure first character is a letter or _ + if (!preg_match('/^\pL/u', $str)) { + $str = '_' . $str; + } + if ($ucfirst) { + $str = ucfirst($str); + } + + return $str; + } + + /** + * C# Handler + * + * @param string $db database name + * @param string $table table name + * @param string $crlf line separator + * @param array $aliases Aliases of db/table/columns + * + * @return string containing C# code lines, separated by "\n" + */ + private function _handleNHibernateCSBody($db, $table, $crlf, array $aliases = array()) + { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + $lines = array(); + + $result = $GLOBALS['dbi']->query( + sprintf( + 'DESC %s.%s', + Util::backquote($db), + Util::backquote($table) + ) + ); + if ($result) { + /** @var TableProperty[] $tableProperties */ + $tableProperties = array(); + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $col_as = $this->getAlias($aliases, $row[0], 'col', $db, $table); + if (!empty($col_as)) { + $row[0] = $col_as; + } + $tableProperties[] = new TableProperty($row); + } + $GLOBALS['dbi']->freeResult($result); + $lines[] = 'using System;'; + $lines[] = 'using System.Collections;'; + $lines[] = 'using System.Collections.Generic;'; + $lines[] = 'using System.Text;'; + $lines[] = 'namespace ' . ExportCodegen::cgMakeIdentifier($db_alias); + $lines[] = '{'; + $lines[] = ' #region ' + . ExportCodegen::cgMakeIdentifier($table_alias); + $lines[] = ' public class ' + . ExportCodegen::cgMakeIdentifier($table_alias); + $lines[] = ' {'; + $lines[] = ' #region Member Variables'; + foreach ($tableProperties as $tableProperty) { + $lines[] = $tableProperty->formatCs( + ' protected #dotNetPrimitiveType# _#name#;' + ); + } + $lines[] = ' #endregion'; + $lines[] = ' #region Constructors'; + $lines[] = ' public ' + . ExportCodegen::cgMakeIdentifier($table_alias) . '() { }'; + $temp = array(); + foreach ($tableProperties as $tableProperty) { + if (!$tableProperty->isPK()) { + $temp[] = $tableProperty->formatCs( + '#dotNetPrimitiveType# #name#' + ); + } + } + $lines[] = ' public ' + . ExportCodegen::cgMakeIdentifier($table_alias) + . '(' + . implode(', ', $temp) + . ')'; + $lines[] = ' {'; + foreach ($tableProperties as $tableProperty) { + if (!$tableProperty->isPK()) { + $lines[] = $tableProperty->formatCs( + ' this._#name#=#name#;' + ); + } + } + $lines[] = ' }'; + $lines[] = ' #endregion'; + $lines[] = ' #region Public Properties'; + foreach ($tableProperties as $tableProperty) { + $lines[] = $tableProperty->formatCs( + ' public virtual #dotNetPrimitiveType# #ucfirstName#' + . "\n" + . ' {' . "\n" + . ' get {return _#name#;}' . "\n" + . ' set {_#name#=value;}' . "\n" + . ' }' + ); + } + $lines[] = ' #endregion'; + $lines[] = ' }'; + $lines[] = ' #endregion'; + $lines[] = '}'; + } + + return implode($crlf, $lines); + } + + /** + * XML Handler + * + * @param string $db database name + * @param string $table table name + * @param string $crlf line separator + * @param array $aliases Aliases of db/table/columns + * + * @return string containing XML code lines, separated by "\n" + */ + private function _handleNHibernateXMLBody( + $db, + $table, + $crlf, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + $lines = array(); + $lines[] = ''; + $lines[] = ''; + $lines[] = ' '; + $result = $GLOBALS['dbi']->query( + sprintf( + "DESC %s.%s", + Util::backquote($db), + Util::backquote($table) + ) + ); + if ($result) { + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $col_as = $this->getAlias($aliases, $row[0], 'col', $db, $table); + if (!empty($col_as)) { + $row[0] = $col_as; + } + $tableProperty = new TableProperty($row); + if ($tableProperty->isPK()) { + $lines[] = $tableProperty->formatXml( + ' ' . "\n" + . ' ' . "\n" + . ' ' . "\n" + . ' ' + ); + } else { + $lines[] = $tableProperty->formatXml( + ' ' . "\n" + . ' ' . "\n" + . ' ' + ); + } + } + $GLOBALS['dbi']->freeResult($result); + } + $lines[] = ' '; + $lines[] = ''; + + return implode($crlf, $lines); + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Getter for CodeGen formats + * + * @return array + */ + private function _getCgFormats() + { + return $this->_cgFormats; + } + + /** + * Setter for CodeGen formats + * + * @param array $CG_FORMATS contains CodeGen Formats + * + * @return void + */ + private function _setCgFormats(array $CG_FORMATS) + { + $this->_cgFormats = $CG_FORMATS; + } + + /** + * Getter for CodeGen handlers + * + * @return array + */ + private function _getCgHandlers() + { + return $this->_cgHandlers; + } + + /** + * Setter for CodeGen handlers + * + * @param array $CG_HANDLERS contains CodeGen handler methods + * + * @return void + */ + private function _setCgHandlers(array $CG_HANDLERS) + { + $this->_cgHandlers = $CG_HANDLERS; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportCsv.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportCsv.php new file mode 100755 index 0000000..13f2c87 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportCsv.php @@ -0,0 +1,332 @@ +setProperties(); + } + + /** + * Sets the export CSV properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('CSV'); + $exportPluginProperties->setExtension('csv'); + $exportPluginProperties->setMimeType('text/comma-separated-values'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create leaf items and add them to the group + $leaf = new TextPropertyItem( + "separator", + __('Columns separated with:') + ); + $generalOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "enclosed", + __('Columns enclosed with:') + ); + $generalOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "escaped", + __('Columns escaped with:') + ); + $generalOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "terminated", + __('Lines terminated with:') + ); + $generalOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + 'null', + __('Replace NULL with:') + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + 'removeCRLF', + __('Remove carriage return/line feed characters within columns') + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + 'columns', + __('Put columns names in the first row') + ); + $generalOptions->addProperty($leaf); + $leaf = new HiddenPropertyItem( + 'structure_or_data' + ); + $generalOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + global $what, $csv_terminated, $csv_separator, $csv_enclosed, $csv_escaped; + + // Here we just prepare some values for export + if ($what == 'excel') { + $csv_terminated = "\015\012"; + switch ($GLOBALS['excel_edition']) { + case 'win': + // as tested on Windows with Excel 2002 and Excel 2007 + $csv_separator = ';'; + break; + case 'mac_excel2003': + $csv_separator = ';'; + break; + case 'mac_excel2008': + $csv_separator = ','; + break; + } + $csv_enclosed = '"'; + $csv_escaped = '"'; + if (isset($GLOBALS['excel_columns'])) { + $GLOBALS['csv_columns'] = 'yes'; + } + } else { + if (empty($csv_terminated) + || mb_strtolower($csv_terminated) == 'auto' + ) { + $csv_terminated = $GLOBALS['crlf']; + } else { + $csv_terminated = str_replace('\\r', "\015", $csv_terminated); + $csv_terminated = str_replace('\\n', "\012", $csv_terminated); + $csv_terminated = str_replace('\\t', "\011", $csv_terminated); + } // end if + $csv_separator = str_replace('\\t', "\011", $csv_separator); + } + + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + return true; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Alias of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in CSV format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + global $what, $csv_terminated, $csv_separator, $csv_enclosed, $csv_escaped; + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + // Gets the data from the database + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $fields_cnt = $GLOBALS['dbi']->numFields($result); + + // If required, get fields name at the first line + if (isset($GLOBALS['csv_columns'])) { + $schema_insert = ''; + for ($i = 0; $i < $fields_cnt; $i++) { + $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $col_as = stripslashes($col_as); + if ($csv_enclosed == '') { + $schema_insert .= $col_as; + } else { + $schema_insert .= $csv_enclosed + . str_replace( + $csv_enclosed, + $csv_escaped . $csv_enclosed, + $col_as + ) + . $csv_enclosed; + } + $schema_insert .= $csv_separator; + } // end for + $schema_insert = trim(mb_substr($schema_insert, 0, -1)); + if (!Export::outputHandler($schema_insert . $csv_terminated)) { + return false; + } + } // end if + + // Format the data + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $schema_insert = ''; + for ($j = 0; $j < $fields_cnt; $j++) { + if (!isset($row[$j]) || is_null($row[$j])) { + $schema_insert .= $GLOBALS[$what . '_null']; + } elseif ($row[$j] == '0' || $row[$j] != '') { + // always enclose fields + if ($what == 'excel') { + $row[$j] = preg_replace("/\015(\012)?/", "\012", $row[$j]); + } + // remove CRLF characters within field + if (isset($GLOBALS[$what . '_removeCRLF']) + && $GLOBALS[$what . '_removeCRLF'] + ) { + $row[$j] = str_replace( + "\n", + "", + str_replace( + "\r", + "", + $row[$j] + ) + ); + } + if ($csv_enclosed == '') { + $schema_insert .= $row[$j]; + } else { + // also double the escape string if found in the data + if ($csv_escaped != $csv_enclosed) { + $schema_insert .= $csv_enclosed + . str_replace( + $csv_enclosed, + $csv_escaped . $csv_enclosed, + str_replace( + $csv_escaped, + $csv_escaped . $csv_escaped, + $row[$j] + ) + ) + . $csv_enclosed; + } else { + // avoid a problem when escape string equals enclose + $schema_insert .= $csv_enclosed + . str_replace( + $csv_enclosed, + $csv_escaped . $csv_enclosed, + $row[$j] + ) + . $csv_enclosed; + } + } + } else { + $schema_insert .= ''; + } + if ($j < $fields_cnt - 1) { + $schema_insert .= $csv_separator; + } + } // end for + + if (!Export::outputHandler($schema_insert . $csv_terminated)) { + return false; + } + } // end while + $GLOBALS['dbi']->freeResult($result); + + return true; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportExcel.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportExcel.php new file mode 100755 index 0000000..fa4622a --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportExcel.php @@ -0,0 +1,88 @@ +setText('CSV for MS Excel'); + $exportPluginProperties->setExtension('csv'); + $exportPluginProperties->setMimeType('text/comma-separated-values'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new TextPropertyItem( + 'null', + __('Replace NULL with:') + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + 'removeCRLF', + __('Remove carriage return/line feed characters within columns') + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + 'columns', + __('Put columns names in the first row') + ); + $generalOptions->addProperty($leaf); + $leaf = new SelectPropertyItem( + 'edition', + __('Excel edition:') + ); + $leaf->setValues( + array( + 'win' => 'Windows', + 'mac_excel2003' => 'Excel 2003 / Macintosh', + 'mac_excel2008' => 'Excel 2008 / Macintosh', + ) + ); + $generalOptions->addProperty($leaf); + $leaf = new HiddenPropertyItem( + 'structure_or_data' + ); + $generalOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportHtmlword.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportHtmlword.php new file mode 100755 index 0000000..5aa7293 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportHtmlword.php @@ -0,0 +1,666 @@ +setProperties(); + } + + /** + * Sets the export HTML-Word properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('Microsoft Word 2000'); + $exportPluginProperties->setExtension('doc'); + $exportPluginProperties->setMimeType('application/vnd.ms-word'); + $exportPluginProperties->setForceFile(true); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // what to dump (structure/data/both) + $dumpWhat = new OptionsPropertyMainGroup( + "dump_what", __('Dump table') + ); + // create primary items and add them to the group + $leaf = new RadioPropertyItem("structure_or_data"); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data'), + ) + ); + $dumpWhat->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($dumpWhat); + + // data options main group + $dataOptions = new OptionsPropertyMainGroup( + "dump_what", __('Data dump options') + ); + $dataOptions->setForce('structure'); + // create primary items and add them to the group + $leaf = new TextPropertyItem( + "null", + __('Replace NULL with:') + ); + $dataOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + "columns", + __('Put columns names in the first row') + ); + $dataOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($dataOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + global $charset; + + return Export::outputHandler( + ' + + + + + + + ' + ); + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + return Export::outputHandler(''); + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + if (empty($db_alias)) { + $db_alias = $db; + } + + return Export::outputHandler( + '

    ' . __('Database') . ' ' . htmlspecialchars($db_alias) . '

    ' + ); + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in HTML-Word format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + global $what; + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + if (!Export::outputHandler( + '

    ' + . __('Dumping data for table') . ' ' . htmlspecialchars($table_alias) + . '

    ' + ) + ) { + return false; + } + if (!Export::outputHandler( + '' + ) + ) { + return false; + } + + // Gets the data from the database + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $fields_cnt = $GLOBALS['dbi']->numFields($result); + + // If required, get fields name at the first line + if (isset($GLOBALS['htmlword_columns'])) { + $schema_insert = ''; + for ($i = 0; $i < $fields_cnt; $i++) { + $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $col_as = stripslashes($col_as); + $schema_insert .= ''; + } // end for + $schema_insert .= ''; + if (!Export::outputHandler($schema_insert)) { + return false; + } + } // end if + + // Format the data + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $schema_insert = ''; + for ($j = 0; $j < $fields_cnt; $j++) { + if (!isset($row[$j]) || is_null($row[$j])) { + $value = $GLOBALS[$what . '_null']; + } elseif ($row[$j] == '0' || $row[$j] != '') { + $value = $row[$j]; + } else { + $value = ''; + } + $schema_insert .= ''; + } // end for + $schema_insert .= ''; + if (!Export::outputHandler($schema_insert)) { + return false; + } + } // end while + $GLOBALS['dbi']->freeResult($result); + + return Export::outputHandler('
    '); + } + + /** + * Returns a stand-in CREATE definition to resolve view dependencies + * + * @param string $db the database name + * @param string $view the view name + * @param string $crlf the end of line sequence + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting definition + */ + public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) + { + $schema_insert = '' + . '' + . '' + . '' + . '' + . '' + . ''; + + /** + * Get the unique keys in the view + */ + $unique_keys = array(); + $keys = $GLOBALS['dbi']->getTableIndexes($db, $view); + foreach ($keys as $key) { + if ($key['Non_unique'] == 0) { + $unique_keys[] = $key['Column_name']; + } + } + + $columns = $GLOBALS['dbi']->getColumns($db, $view); + foreach ($columns as $column) { + $col_as = $column['Field']; + if (!empty($aliases[$db]['tables'][$view]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$view]['columns'][$col_as]; + } + $schema_insert .= $this->formatOneColumnDefinition( + $column, + $unique_keys, + $col_as + ); + $schema_insert .= ''; + } + + $schema_insert .= '
    '; + + return $schema_insert; + } + + /** + * Returns $table's CREATE definition + * + * @param string $db the database name + * @param string $table the table name + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * PMA_exportStructure() also for other + * export types which use this parameter + * @param bool $do_mime whether to include mime comments + * at the end + * @param bool $view whether we're handling a view + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting schema + */ + public function getTableDef( + $db, + $table, + $do_relation, + $do_comments, + $do_mime, + $view = false, + array $aliases = array() + ) { + // set $cfgRelation here, because there is a chance that it's modified + // since the class initialization + global $cfgRelation; + + $schema_insert = ''; + + /** + * Gets fields properties + */ + $GLOBALS['dbi']->selectDb($db); + + // Check if we can use Relations + list($res_rel, $have_rel) = $this->relation->getRelationsAndStatus( + $do_relation && !empty($cfgRelation['relation']), + $db, + $table + ); + + /** + * Displays the table structure + */ + $schema_insert .= ''; + + $schema_insert .= ''; + $schema_insert .= ''; + $schema_insert .= ''; + $schema_insert .= ''; + $schema_insert .= ''; + if ($do_relation && $have_rel) { + $schema_insert .= ''; + } + if ($do_comments) { + $schema_insert .= ''; + $comments = $this->relation->getComments($db, $table); + } + if ($do_mime && $cfgRelation['mimework']) { + $schema_insert .= ''; + $mime_map = Transformations::getMIME($db, $table, true); + } + $schema_insert .= ''; + + $columns = $GLOBALS['dbi']->getColumns($db, $table); + /** + * Get the unique keys in the table + */ + $unique_keys = array(); + $keys = $GLOBALS['dbi']->getTableIndexes($db, $table); + foreach ($keys as $key) { + if ($key['Non_unique'] == 0) { + $unique_keys[] = $key['Column_name']; + } + } + foreach ($columns as $column) { + $col_as = $column['Field']; + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $schema_insert .= $this->formatOneColumnDefinition( + $column, + $unique_keys, + $col_as + ); + $field_name = $column['Field']; + if ($do_relation && $have_rel) { + $schema_insert .= ''; + } + if ($do_comments && $cfgRelation['commwork']) { + $schema_insert .= ''; + } + if ($do_mime && $cfgRelation['mimework']) { + $schema_insert .= ''; + } + + $schema_insert .= ''; + } // end foreach + + $schema_insert .= '
    ' + . htmlspecialchars( + $this->getRelationString( + $res_rel, + $field_name, + $db, + $aliases + ) + ) + . '' + . (isset($comments[$field_name]) + ? htmlspecialchars($comments[$field_name]) + : '') . '' + . (isset($mime_map[$field_name]) ? + htmlspecialchars( + str_replace('_', '/', $mime_map[$field_name]['mimetype']) + ) + : '') . '
    '; + + return $schema_insert; + } + + /** + * Outputs triggers + * + * @param string $db database name + * @param string $table table name + * + * @return string Formatted triggers list + */ + protected function getTriggers($db, $table) + { + $dump = ''; + $dump .= ''; + $dump .= ''; + $dump .= ''; + $dump .= ''; + $dump .= ''; + $dump .= ''; + + $triggers = $GLOBALS['dbi']->getTriggers($db, $table); + + foreach ($triggers as $trigger) { + $dump .= ''; + $dump .= '' + . '' + . '' + . '' + . ''; + } + + $dump .= '
    '; + + return $dump; + } + + /** + * Outputs table's structure + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $export_mode 'create_table', 'triggers', 'create_view', + * 'stand_in' + * @param string $export_type 'server', 'database', 'table' + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * PMA_exportStructure() also for other + * export types which use this parameter + * @param bool $do_mime whether to include mime comments + * @param bool $dates whether to include creation/update/check dates + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportStructure( + $db, + $table, + $crlf, + $error_url, + $export_mode, + $export_type, + $do_relation = false, + $do_comments = false, + $do_mime = false, + $dates = false, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + $dump = ''; + + switch ($export_mode) { + case 'create_table': + $dump .= '

    ' + . __('Table structure for table') . ' ' + . htmlspecialchars($table_alias) + . '

    '; + $dump .= $this->getTableDef( + $db, + $table, + $do_relation, + $do_comments, + $do_mime, + false, + $aliases + ); + break; + case 'triggers': + $dump = ''; + $triggers = $GLOBALS['dbi']->getTriggers($db, $table); + if ($triggers) { + $dump .= '

    ' + . __('Triggers') . ' ' . htmlspecialchars($table_alias) + . '

    '; + $dump .= $this->getTriggers($db, $table); + } + break; + case 'create_view': + $dump .= '

    ' + . __('Structure for view') . ' ' . htmlspecialchars($table_alias) + . '

    '; + $dump .= $this->getTableDef( + $db, + $table, + $do_relation, + $do_comments, + $do_mime, + true, + $aliases + ); + break; + case 'stand_in': + $dump .= '

    ' + . __('Stand-in structure for view') . ' ' + . htmlspecialchars($table_alias) + . '

    '; + // export a stand-in definition to resolve view dependencies + $dump .= $this->getTableDefStandIn($db, $table, $crlf, $aliases); + } // end switch + + return Export::outputHandler($dump); + } + + /** + * Formats the definition for one column + * + * @param array $column info about this column + * @param array $unique_keys unique keys of the table + * @param string $col_alias Column Alias + * + * @return string Formatted column definition + */ + protected function formatOneColumnDefinition( + array $column, + array $unique_keys, + $col_alias = '' + ) { + if (empty($col_alias)) { + $col_alias = $column['Field']; + } + $definition = ''; + + $extracted_columnspec = Util::extractColumnSpec($column['Type']); + + $type = htmlspecialchars($extracted_columnspec['print_type']); + if (empty($type)) { + $type = ' '; + } + + if (!isset($column['Default'])) { + if ($column['Null'] != 'NO') { + $column['Default'] = 'NULL'; + } + } + + $fmt_pre = ''; + $fmt_post = ''; + if (in_array($column['Field'], $unique_keys)) { + $fmt_pre = '' . $fmt_pre; + $fmt_post = $fmt_post . ''; + } + if ($column['Key'] == 'PRI') { + $fmt_pre = '' . $fmt_pre; + $fmt_post = $fmt_post . ''; + } + $definition .= '' . $fmt_pre + . htmlspecialchars($col_alias) . $fmt_post . ''; + $definition .= '' . htmlspecialchars($type) . ''; + $definition .= '' + . (($column['Null'] == '' || $column['Null'] == 'NO') + ? __('No') + : __('Yes')) + . ''; + $definition .= '' + . htmlspecialchars(isset($column['Default']) ? $column['Default'] : '') + . ''; + + return $definition; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportJson.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportJson.php new file mode 100755 index 0000000..27a2dc3 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportJson.php @@ -0,0 +1,293 @@ +setProperties(); + } + + /** + * Encodes the data into JSON + * + * @param mixed $data Data to encode + * + * @return string + */ + public function encode($data) + { + $options = 0; + if (isset($GLOBALS['json_pretty_print']) + && $GLOBALS['json_pretty_print'] + ) { + $options |= JSON_PRETTY_PRINT; + } + if (isset($GLOBALS['json_unicode']) + && $GLOBALS['json_unicode'] + ) { + $options |= JSON_UNESCAPED_UNICODE; + } + return json_encode($data, $options); + } + + /** + * Sets the export JSON properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('JSON'); + $exportPluginProperties->setExtension('json'); + $exportPluginProperties->setMimeType('text/plain'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new HiddenPropertyItem("structure_or_data"); + $generalOptions->addProperty($leaf); + + $leaf = new BoolPropertyItem( + 'pretty_print', + __('Output pretty-printed JSON (Use human-readable formatting)') + ); + $generalOptions->addProperty($leaf); + + $leaf = new BoolPropertyItem( + 'unicode', + __('Output unicode characters unescaped') + ); + $generalOptions->addProperty($leaf); + + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + global $crlf; + + $meta = array( + 'type' => 'header', + 'version' => PMA_VERSION, + 'comment' => 'Export to JSON plugin for PHPMyAdmin', + ); + + return Export::outputHandler( + '[' . $crlf . $this->encode($meta) . ',' . $crlf + ); + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + global $crlf; + + return Export::outputHandler(']' . $crlf); + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + global $crlf; + + if (empty($db_alias)) { + $db_alias = $db; + } + + $meta = array( + 'type' => 'database', + 'name' => $db_alias + ); + + return Export::outputHandler( + $this->encode($meta) . ',' . $crlf + ); + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in JSON format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + if (! $this->first) { + if (!Export::outputHandler(',')) { + return false; + } + } else { + $this->first = false; + } + + $buffer = $this->encode( + array( + 'type' => 'table', + 'name' => $table_alias, + 'database' => $db_alias, + 'data' => "@@DATA@@" + ) + ); + list($header, $footer) = explode('"@@DATA@@"', $buffer); + + if (!Export::outputHandler($header . $crlf . '[' . $crlf)) { + return false; + } + + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $columns_cnt = $GLOBALS['dbi']->numFields($result); + $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); + + $columns = array(); + for ($i = 0; $i < $columns_cnt; $i++) { + $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $columns[$i] = stripslashes($col_as); + } + + $record_cnt = 0; + while ($record = $GLOBALS['dbi']->fetchRow($result)) { + + $record_cnt++; + + // Output table name as comment if this is the first record of the table + if ($record_cnt > 1) { + if (!Export::outputHandler(',' . $crlf)) { + return false; + } + } + + $data = array(); + + for ($i = 0; $i < $columns_cnt; $i++) { + if ($fields_meta[$i]->type === 'geometry') { + // export GIS types as hex + $record[$i] = '0x' . bin2hex($record[$i]); + } + $data[$columns[$i]] = $record[$i]; + } + + $encodedData = $this->encode($data); + if (! $encodedData) { + return false; + } + if (! Export::outputHandler($encodedData)) { + return false; + } + } + + if (!Export::outputHandler($crlf . ']' . $crlf . $footer . $crlf)) { + return false; + } + + $GLOBALS['dbi']->freeResult($result); + + return true; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportLatex.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportLatex.php new file mode 100755 index 0000000..f9cebe1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportLatex.php @@ -0,0 +1,678 @@ +initSpecificVariables(); + $this->setProperties(); + } + + /** + * Initialize the local variables that are used for export Latex + * + * @return void + */ + protected function initSpecificVariables() + { + /* Messages used in default captions */ + $GLOBALS['strLatexContent'] = __('Content of table @TABLE@'); + $GLOBALS['strLatexContinued'] = __('(continued)'); + $GLOBALS['strLatexStructure'] = __('Structure of table @TABLE@'); + } + + /** + * Sets the export Latex properties + * + * @return void + */ + protected function setProperties() + { + global $plugin_param; + $hide_structure = false; + if ($plugin_param['export_type'] == 'table' + && !$plugin_param['single_table'] + ) { + $hide_structure = true; + } + + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('LaTeX'); + $exportPluginProperties->setExtension('tex'); + $exportPluginProperties->setMimeType('application/x-tex'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new BoolPropertyItem( + "caption", + __('Include table caption') + ); + $generalOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // what to dump (structure/data/both) main group + $dumpWhat = new OptionsPropertyMainGroup( + "dump_what", __('Dump table') + ); + // create primary items and add them to the group + $leaf = new RadioPropertyItem("structure_or_data"); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data'), + ) + ); + $dumpWhat->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($dumpWhat); + + // structure options main group + if (!$hide_structure) { + $structureOptions = new OptionsPropertyMainGroup( + "structure", __('Object creation options') + ); + $structureOptions->setForce('data'); + // create primary items and add them to the group + $leaf = new TextPropertyItem( + "structure_caption", + __('Table caption:') + ); + $leaf->setDoc('faq6-27'); + $structureOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "structure_continued_caption", + __('Table caption (continued):') + ); + $leaf->setDoc('faq6-27'); + $structureOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "structure_label", + __('Label key:') + ); + $leaf->setDoc('faq6-27'); + $structureOptions->addProperty($leaf); + if (!empty($GLOBALS['cfgRelation']['relation'])) { + $leaf = new BoolPropertyItem( + "relation", + __('Display foreign key relationships') + ); + $structureOptions->addProperty($leaf); + } + $leaf = new BoolPropertyItem( + "comments", + __('Display comments') + ); + $structureOptions->addProperty($leaf); + if (!empty($GLOBALS['cfgRelation']['mimework'])) { + $leaf = new BoolPropertyItem( + "mime", + __('Display MIME types') + ); + $structureOptions->addProperty($leaf); + } + // add the main group to the root group + $exportSpecificOptions->addProperty($structureOptions); + } + + // data options main group + $dataOptions = new OptionsPropertyMainGroup( + "data", __('Data dump options') + ); + $dataOptions->setForce('structure'); + // create primary items and add them to the group + $leaf = new BoolPropertyItem( + "columns", + __('Put columns names in the first row:') + ); + $dataOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "data_caption", + __('Table caption:') + ); + $leaf->setDoc('faq6-27'); + $dataOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "data_continued_caption", + __('Table caption (continued):') + ); + $leaf->setDoc('faq6-27'); + $dataOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "data_label", + __('Label key:') + ); + $leaf->setDoc('faq6-27'); + $dataOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + 'null', + __('Replace NULL with:') + ); + $dataOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($dataOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + global $crlf; + global $cfg; + + $head = '% phpMyAdmin LaTeX Dump' . $crlf + . '% version ' . PMA_VERSION . $crlf + . '% https://www.phpmyadmin.net/' . $crlf + . '%' . $crlf + . '% ' . __('Host:') . ' ' . $cfg['Server']['host']; + if (!empty($cfg['Server']['port'])) { + $head .= ':' . $cfg['Server']['port']; + } + $head .= $crlf + . '% ' . __('Generation Time:') . ' ' + . Util::localisedDate() . $crlf + . '% ' . __('Server version:') . ' ' . $GLOBALS['dbi']->getVersionString() . $crlf + . '% ' . __('PHP Version:') . ' ' . phpversion() . $crlf; + + return Export::outputHandler($head); + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + return true; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + if (empty($db_alias)) { + $db_alias = $db; + } + global $crlf; + $head = '% ' . $crlf + . '% ' . __('Database:') . ' ' . '\'' . $db_alias . '\'' . $crlf + . '% ' . $crlf; + + return Export::outputHandler($head); + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in JSON format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + $result = $GLOBALS['dbi']->tryQuery( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + + $columns_cnt = $GLOBALS['dbi']->numFields($result); + $columns = array(); + $columns_alias = array(); + for ($i = 0; $i < $columns_cnt; $i++) { + $columns[$i] = $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $columns_alias[$i] = $col_as; + } + + $buffer = $crlf . '%' . $crlf . '% ' . __('Data:') . ' ' . $table_alias + . $crlf . '%' . $crlf . ' \\begin{longtable}{|'; + + for ($index = 0; $index < $columns_cnt; $index++) { + $buffer .= 'l|'; + } + $buffer .= '} ' . $crlf; + + $buffer .= ' \\hline \\endhead \\hline \\endfoot \\hline ' . $crlf; + if (isset($GLOBALS['latex_caption'])) { + $buffer .= ' \\caption{' + . Util::expandUserString( + $GLOBALS['latex_data_caption'], + array( + 'texEscape', + get_class($this), + ), + array('table' => $table_alias, 'database' => $db_alias) + ) + . '} \\label{' + . Util::expandUserString( + $GLOBALS['latex_data_label'], + null, + array('table' => $table_alias, 'database' => $db_alias) + ) + . '} \\\\'; + } + if (!Export::outputHandler($buffer)) { + return false; + } + + // show column names + if (isset($GLOBALS['latex_columns'])) { + $buffer = '\\hline '; + for ($i = 0; $i < $columns_cnt; $i++) { + $buffer .= '\\multicolumn{1}{|c|}{\\textbf{' + . self::texEscape(stripslashes($columns_alias[$i])) . '}} & '; + } + + $buffer = mb_substr($buffer, 0, -2) . '\\\\ \\hline \hline '; + if (!Export::outputHandler($buffer . ' \\endfirsthead ' . $crlf)) { + return false; + } + if (isset($GLOBALS['latex_caption'])) { + if (!Export::outputHandler( + '\\caption{' + . Util::expandUserString( + $GLOBALS['latex_data_continued_caption'], + array( + 'texEscape', + get_class($this), + ), + array('table' => $table_alias, 'database' => $db_alias) + ) + . '} \\\\ ' + ) + ) { + return false; + } + } + if (!Export::outputHandler($buffer . '\\endhead \\endfoot' . $crlf)) { + return false; + } + } else { + if (!Export::outputHandler('\\\\ \hline')) { + return false; + } + } + + // print the whole table + while ($record = $GLOBALS['dbi']->fetchAssoc($result)) { + $buffer = ''; + // print each row + for ($i = 0; $i < $columns_cnt; $i++) { + if ((!function_exists('is_null') + || !is_null($record[$columns[$i]])) + && isset($record[$columns[$i]]) + ) { + $column_value = self::texEscape( + stripslashes($record[$columns[$i]]) + ); + } else { + $column_value = $GLOBALS['latex_null']; + } + + // last column ... no need for & character + if ($i == ($columns_cnt - 1)) { + $buffer .= $column_value; + } else { + $buffer .= $column_value . " & "; + } + } + $buffer .= ' \\\\ \\hline ' . $crlf; + if (!Export::outputHandler($buffer)) { + return false; + } + } + + $buffer = ' \\end{longtable}' . $crlf; + if (!Export::outputHandler($buffer)) { + return false; + } + + $GLOBALS['dbi']->freeResult($result); + + return true; + } // end getTableLaTeX + + /** + * Outputs table's structure + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $export_mode 'create_table', 'triggers', 'create_view', + * 'stand_in' + * @param string $export_type 'server', 'database', 'table' + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * exportStructure() also for other + * export types which use this parameter + * @param bool $do_mime whether to include mime comments + * @param bool $dates whether to include creation/update/check dates + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportStructure( + $db, + $table, + $crlf, + $error_url, + $export_mode, + $export_type, + $do_relation = false, + $do_comments = false, + $do_mime = false, + $dates = false, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + global $cfgRelation; + + /* We do not export triggers */ + if ($export_mode == 'triggers') { + return true; + } + + /** + * Get the unique keys in the table + */ + $unique_keys = array(); + $keys = $GLOBALS['dbi']->getTableIndexes($db, $table); + foreach ($keys as $key) { + if ($key['Non_unique'] == 0) { + $unique_keys[] = $key['Column_name']; + } + } + + /** + * Gets fields properties + */ + $GLOBALS['dbi']->selectDb($db); + + // Check if we can use Relations + list($res_rel, $have_rel) = $this->relation->getRelationsAndStatus( + $do_relation && !empty($cfgRelation['relation']), + $db, + $table + ); + /** + * Displays the table structure + */ + $buffer = $crlf . '%' . $crlf . '% ' . __('Structure:') . ' ' + . $table_alias . $crlf . '%' . $crlf . ' \\begin{longtable}{'; + if (!Export::outputHandler($buffer)) { + return false; + } + + $alignment = '|l|c|c|c|'; + if ($do_relation && $have_rel) { + $alignment .= 'l|'; + } + if ($do_comments) { + $alignment .= 'l|'; + } + if ($do_mime && $cfgRelation['mimework']) { + $alignment .= 'l|'; + } + $buffer = $alignment . '} ' . $crlf; + + $header = ' \\hline '; + $header .= '\\multicolumn{1}{|c|}{\\textbf{' . __('Column') + . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Type') + . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Null') + . '}} & \\multicolumn{1}{|c|}{\\textbf{' . __('Default') . '}}'; + if ($do_relation && $have_rel) { + $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . __('Links to') . '}}'; + } + if ($do_comments) { + $header .= ' & \\multicolumn{1}{|c|}{\\textbf{' . __('Comments') . '}}'; + $comments = $this->relation->getComments($db, $table); + } + if ($do_mime && $cfgRelation['mimework']) { + $header .= ' & \\multicolumn{1}{|c|}{\\textbf{MIME}}'; + $mime_map = Transformations::getMIME($db, $table, true); + } + + // Table caption for first page and label + if (isset($GLOBALS['latex_caption'])) { + $buffer .= ' \\caption{' + . Util::expandUserString( + $GLOBALS['latex_structure_caption'], + array( + 'texEscape', + get_class($this), + ), + array('table' => $table_alias, 'database' => $db_alias) + ) + . '} \\label{' + . Util::expandUserString( + $GLOBALS['latex_structure_label'], + null, + array('table' => $table_alias, 'database' => $db_alias) + ) + . '} \\\\' . $crlf; + } + $buffer .= $header . ' \\\\ \\hline \\hline' . $crlf + . '\\endfirsthead' . $crlf; + // Table caption on next pages + if (isset($GLOBALS['latex_caption'])) { + $buffer .= ' \\caption{' + . Util::expandUserString( + $GLOBALS['latex_structure_continued_caption'], + array( + 'texEscape', + get_class($this), + ), + array('table' => $table_alias, 'database' => $db_alias) + ) + . '} \\\\ ' . $crlf; + } + $buffer .= $header . ' \\\\ \\hline \\hline \\endhead \\endfoot ' . $crlf; + + if (!Export::outputHandler($buffer)) { + return false; + } + + $fields = $GLOBALS['dbi']->getColumns($db, $table); + foreach ($fields as $row) { + $extracted_columnspec = Util::extractColumnSpec($row['Type']); + $type = $extracted_columnspec['print_type']; + if (empty($type)) { + $type = ' '; + } + + if (!isset($row['Default'])) { + if ($row['Null'] != 'NO') { + $row['Default'] = 'NULL'; + } + } + + $field_name = $col_as = $row['Field']; + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + + $local_buffer = $col_as . "\000" . $type . "\000" + . (($row['Null'] == '' || $row['Null'] == 'NO') + ? __('No') : __('Yes')) + . "\000" . (isset($row['Default']) ? $row['Default'] : ''); + + if ($do_relation && $have_rel) { + $local_buffer .= "\000"; + $local_buffer .= $this->getRelationString( + $res_rel, + $field_name, + $db, + $aliases + ); + } + if ($do_comments && $cfgRelation['commwork']) { + $local_buffer .= "\000"; + if (isset($comments[$field_name])) { + $local_buffer .= $comments[$field_name]; + } + } + if ($do_mime && $cfgRelation['mimework']) { + $local_buffer .= "\000"; + if (isset($mime_map[$field_name])) { + $local_buffer .= str_replace( + '_', + '/', + $mime_map[$field_name]['mimetype'] + ); + } + } + $local_buffer = self::texEscape($local_buffer); + if ($row['Key'] == 'PRI') { + $pos = mb_strpos($local_buffer, "\000"); + $local_buffer = '\\textit{' + . + mb_substr($local_buffer, 0, $pos) + . '}' . + mb_substr($local_buffer, $pos); + } + if (in_array($field_name, $unique_keys)) { + $pos = mb_strpos($local_buffer, "\000"); + $local_buffer = '\\textbf{' + . + mb_substr($local_buffer, 0, $pos) + . '}' . + mb_substr($local_buffer, $pos); + } + $buffer = str_replace("\000", ' & ', $local_buffer); + $buffer .= ' \\\\ \\hline ' . $crlf; + + if (!Export::outputHandler($buffer)) { + return false; + } + } // end while + + $buffer = ' \\end{longtable}' . $crlf; + + return Export::outputHandler($buffer); + } // end of the 'exportStructure' method + + /** + * Escapes some special characters for use in TeX/LaTeX + * + * @param string $string the string to convert + * + * @return string the converted string with escape codes + */ + public static function texEscape($string) + { + $escape = array('$', '%', '{', '}', '&', '#', '_', '^'); + $cnt_escape = count($escape); + for ($k = 0; $k < $cnt_escape; $k++) { + $string = str_replace($escape[$k], '\\' . $escape[$k], $string); + } + + return $string; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportMediawiki.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportMediawiki.php new file mode 100755 index 0000000..93210d5 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportMediawiki.php @@ -0,0 +1,381 @@ +setProperties(); + } + + /** + * Sets the export MediaWiki properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('MediaWiki Table'); + $exportPluginProperties->setExtension('mediawiki'); + $exportPluginProperties->setMimeType('text/plain'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup( + "general_opts", __('Dump table') + ); + + // what to dump (structure/data/both) + $subgroup = new OptionsPropertySubgroup( + "dump_table", __("Dump table") + ); + $leaf = new RadioPropertyItem('structure_or_data'); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data'), + ) + ); + $subgroup->setSubgroupHeader($leaf); + $generalOptions->addProperty($subgroup); + + // export table name + $leaf = new BoolPropertyItem( + "caption", + __('Export table names') + ); + $generalOptions->addProperty($leaf); + + // export table headers + $leaf = new BoolPropertyItem( + "headers", + __('Export table headers') + ); + $generalOptions->addProperty($leaf); + //add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + return true; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Alias of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs table's structure + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $export_mode 'create_table','triggers','create_view', + * 'stand_in' + * @param string $export_type 'server', 'database', 'table' + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; this is + * deprecated but the parameter is left here + * because export.php calls exportStructure() + * also for other export types which use this + * parameter + * @param bool $do_mime whether to include mime comments + * @param bool $dates whether to include creation/update/check dates + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportStructure( + $db, + $table, + $crlf, + $error_url, + $export_mode, + $export_type, + $do_relation = false, + $do_comments = false, + $do_mime = false, + $dates = false, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + $output = ''; + switch ($export_mode) { + case 'create_table': + $columns = $GLOBALS['dbi']->getColumns($db, $table); + $columns = array_values($columns); + $row_cnt = count($columns); + + // Print structure comment + $output = $this->_exportComment( + "Table structure for " + . Util::backquote($table_alias) + ); + + // Begin the table construction + $output .= "{| class=\"wikitable\" style=\"text-align:center;\"" + . $this->_exportCRLF(); + + // Add the table name + if (isset($GLOBALS['mediawiki_caption'])) { + $output .= "|+'''" . $table_alias . "'''" . $this->_exportCRLF(); + } + + // Add the table headers + if (isset($GLOBALS['mediawiki_headers'])) { + $output .= "|- style=\"background:#ffdead;\"" . $this->_exportCRLF(); + $output .= "! style=\"background:#ffffff\" | " + . $this->_exportCRLF(); + for ($i = 0; $i < $row_cnt; ++$i) { + $col_as = $columns[$i]['Field']; + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as]) + ) { + $col_as + = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $output .= " | " . $col_as . $this->_exportCRLF(); + } + } + + // Add the table structure + $output .= "|-" . $this->_exportCRLF(); + $output .= "! Type" . $this->_exportCRLF(); + for ($i = 0; $i < $row_cnt; ++$i) { + $output .= " | " . $columns[$i]['Type'] . $this->_exportCRLF(); + } + + $output .= "|-" . $this->_exportCRLF(); + $output .= "! Null" . $this->_exportCRLF(); + for ($i = 0; $i < $row_cnt; ++$i) { + $output .= " | " . $columns[$i]['Null'] . $this->_exportCRLF(); + } + + $output .= "|-" . $this->_exportCRLF(); + $output .= "! Default" . $this->_exportCRLF(); + for ($i = 0; $i < $row_cnt; ++$i) { + $output .= " | " . $columns[$i]['Default'] . $this->_exportCRLF(); + } + + $output .= "|-" . $this->_exportCRLF(); + $output .= "! Extra" . $this->_exportCRLF(); + for ($i = 0; $i < $row_cnt; ++$i) { + $output .= " | " . $columns[$i]['Extra'] . $this->_exportCRLF(); + } + + $output .= "|}" . str_repeat($this->_exportCRLF(), 2); + break; + } // end switch + + return Export::outputHandler($output); + } + + /** + * Outputs the content of a table in MediaWiki format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + // Print data comment + $output = $this->_exportComment( + "Table data for " . Util::backquote($table_alias) + ); + + // Begin the table construction + // Use the "wikitable" class for style + // Use the "sortable" class for allowing tables to be sorted by column + $output .= "{| class=\"wikitable sortable\" style=\"text-align:center;\"" + . $this->_exportCRLF(); + + // Add the table name + if (isset($GLOBALS['mediawiki_caption'])) { + $output .= "|+'''" . $table_alias . "'''" . $this->_exportCRLF(); + } + + // Add the table headers + if (isset($GLOBALS['mediawiki_headers'])) { + // Get column names + $column_names = $GLOBALS['dbi']->getColumnNames($db, $table); + + // Add column names as table headers + if (!is_null($column_names)) { + // Use '|-' for separating rows + $output .= "|-" . $this->_exportCRLF(); + + // Use '!' for separating table headers + foreach ($column_names as $column) { + if (!empty($aliases[$db]['tables'][$table]['columns'][$column]) + ) { + $column + = $aliases[$db]['tables'][$table]['columns'][$column]; + } + $output .= " ! " . $column . "" . $this->_exportCRLF(); + } + } + } + + // Get the table data from the database + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $fields_cnt = $GLOBALS['dbi']->numFields($result); + + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $output .= "|-" . $this->_exportCRLF(); + + // Use '|' for separating table columns + for ($i = 0; $i < $fields_cnt; ++$i) { + $output .= " | " . $row[$i] . "" . $this->_exportCRLF(); + } + } + + // End table construction + $output .= "|}" . str_repeat($this->_exportCRLF(), 2); + + return Export::outputHandler($output); + } + + /** + * Outputs comments containing info about the exported tables + * + * @param string $text Text of comment + * + * @return string The formatted comment + */ + private function _exportComment($text = '') + { + // see https://www.mediawiki.org/wiki/Help:Formatting + $comment = $this->_exportCRLF(); + $comment .= '' . str_repeat($this->_exportCRLF(), 2); + + return $comment; + } + + /** + * Outputs CRLF + * + * @return string CRLF + */ + private function _exportCRLF() + { + // The CRLF expected by the mediawiki format is "\n" + return "\n"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportOds.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportOds.php new file mode 100755 index 0000000..aa6c164 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportOds.php @@ -0,0 +1,342 @@ +setProperties(); + } + + /** + * Sets the export ODS properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('OpenDocument Spreadsheet'); + $exportPluginProperties->setExtension('ods'); + $exportPluginProperties->setMimeType( + 'application/vnd.oasis.opendocument.spreadsheet' + ); + $exportPluginProperties->setForceFile(true); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new TextPropertyItem( + "null", + __('Replace NULL with:') + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + "columns", + __('Put columns names in the first row') + ); + $generalOptions->addProperty($leaf); + $leaf = new HiddenPropertyItem("structure_or_data"); + $generalOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + $GLOBALS['ods_buffer'] .= '' + . '' + . '' + . '' + . '' + . '/' + . '' + . '/' + . '' + . '' + . '' + . '' + . ':' + . '' + . ':' + . '' + . ' ' + . '' + . '' + . '' + . '' + . '/' + . '' + . '/' + . '' + . ' ' + . '' + . ':' + . '' + . ' ' + . '' + . '' + . '' + . '' + . '' + . '' + . '' + . ''; + + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + $GLOBALS['ods_buffer'] .= '' + . '' + . ''; + + return Export::outputHandler( + OpenDocument::create( + 'application/vnd.oasis.opendocument.spreadsheet', + $GLOBALS['ods_buffer'] + ) + ); + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in NHibernate format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + global $what; + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + // Gets the data from the database + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $fields_cnt = $GLOBALS['dbi']->numFields($result); + $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); + $field_flags = array(); + for ($j = 0; $j < $fields_cnt; $j++) { + $field_flags[$j] = $GLOBALS['dbi']->fieldFlags($result, $j); + } + + $GLOBALS['ods_buffer'] + .= ''; + + // If required, get fields name at the first line + if (isset($GLOBALS[$what . '_columns'])) { + $GLOBALS['ods_buffer'] .= ''; + for ($i = 0; $i < $fields_cnt; $i++) { + $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $GLOBALS['ods_buffer'] + .= '' + . '' + . htmlspecialchars( + stripslashes($col_as) + ) + . '' + . ''; + } // end for + $GLOBALS['ods_buffer'] .= ''; + } // end if + + // Format the data + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $GLOBALS['ods_buffer'] .= ''; + for ($j = 0; $j < $fields_cnt; $j++) { + if ($fields_meta[$j]->type === 'geometry') { + // export GIS types as hex + $row[$j] = '0x' . bin2hex($row[$j]); + } + if (!isset($row[$j]) || is_null($row[$j])) { + $GLOBALS['ods_buffer'] + .= '' + . '' + . htmlspecialchars($GLOBALS[$what . '_null']) + . '' + . ''; + } elseif (stristr($field_flags[$j], 'BINARY') + && $fields_meta[$j]->blob + ) { + // ignore BLOB + $GLOBALS['ods_buffer'] + .= '' + . '' + . ''; + } elseif ($fields_meta[$j]->type == "date") { + $GLOBALS['ods_buffer'] + .= '' + . '' + . htmlspecialchars($row[$j]) + . '' + . ''; + } elseif ($fields_meta[$j]->type == "time") { + $GLOBALS['ods_buffer'] + .= '' + . '' + . htmlspecialchars($row[$j]) + . '' + . ''; + } elseif ($fields_meta[$j]->type == "datetime") { + $GLOBALS['ods_buffer'] + .= '' + . '' + . htmlspecialchars($row[$j]) + . '' + . ''; + } elseif (($fields_meta[$j]->numeric + && $fields_meta[$j]->type != 'timestamp' + && !$fields_meta[$j]->blob) + || $fields_meta[$j]->type == 'real' + ) { + $GLOBALS['ods_buffer'] + .= '' + . '' + . htmlspecialchars($row[$j]) + . '' + . ''; + } else { + $GLOBALS['ods_buffer'] + .= '' + . '' + . htmlspecialchars($row[$j]) + . '' + . ''; + } + } // end for + $GLOBALS['ods_buffer'] .= ''; + } // end while + $GLOBALS['dbi']->freeResult($result); + + $GLOBALS['ods_buffer'] .= ''; + + return true; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportOdt.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportOdt.php new file mode 100755 index 0000000..f599aec --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportOdt.php @@ -0,0 +1,809 @@ +setProperties(); + } + + /** + * Sets the export ODT properties + * + * @return void + */ + protected function setProperties() + { + global $plugin_param; + $hide_structure = false; + if ($plugin_param['export_type'] == 'table' + && !$plugin_param['single_table'] + ) { + $hide_structure = true; + } + + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('OpenDocument Text'); + $exportPluginProperties->setExtension('odt'); + $exportPluginProperties->setMimeType( + 'application/vnd.oasis.opendocument.text' + ); + $exportPluginProperties->setForceFile(true); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // what to dump (structure/data/both) main group + $dumpWhat = new OptionsPropertyMainGroup( + "general_opts", __('Dump table') + ); + // create primary items and add them to the group + $leaf = new RadioPropertyItem("structure_or_data"); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data'), + ) + ); + $dumpWhat->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($dumpWhat); + + // structure options main group + if (!$hide_structure) { + $structureOptions = new OptionsPropertyMainGroup( + "structure", __('Object creation options') + ); + $structureOptions->setForce('data'); + // create primary items and add them to the group + if (!empty($GLOBALS['cfgRelation']['relation'])) { + $leaf = new BoolPropertyItem( + "relation", + __('Display foreign key relationships') + ); + $structureOptions->addProperty($leaf); + } + $leaf = new BoolPropertyItem( + "comments", + __('Display comments') + ); + $structureOptions->addProperty($leaf); + if (!empty($GLOBALS['cfgRelation']['mimework'])) { + $leaf = new BoolPropertyItem( + "mime", + __('Display MIME types') + ); + $structureOptions->addProperty($leaf); + } + // add the main group to the root group + $exportSpecificOptions->addProperty($structureOptions); + } + + // data options main group + $dataOptions = new OptionsPropertyMainGroup( + "data", __('Data dump options') + ); + $dataOptions->setForce('structure'); + // create primary items and add them to the group + $leaf = new BoolPropertyItem( + "columns", + __('Put columns names in the first row') + ); + $dataOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + 'null', + __('Replace NULL with:') + ); + $dataOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($dataOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + $GLOBALS['odt_buffer'] .= '' + . '' + . '' + . ''; + + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + $GLOBALS['odt_buffer'] .= '' + . '' + . ''; + if (!Export::outputHandler( + OpenDocument::create( + 'application/vnd.oasis.opendocument.text', + $GLOBALS['odt_buffer'] + ) + ) + ) { + return false; + } + + return true; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + if (empty($db_alias)) { + $db_alias = $db; + } + $GLOBALS['odt_buffer'] + .= '' + . __('Database') . ' ' . htmlspecialchars($db_alias) + . ''; + + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in NHibernate format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + global $what; + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + // Gets the data from the database + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $fields_cnt = $GLOBALS['dbi']->numFields($result); + $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); + $field_flags = array(); + for ($j = 0; $j < $fields_cnt; $j++) { + $field_flags[$j] = $GLOBALS['dbi']->fieldFlags($result, $j); + } + + $GLOBALS['odt_buffer'] + .= '' + . __('Dumping data for table') . ' ' . htmlspecialchars($table_alias) + . '' + . '' + . ''; + + // If required, get fields name at the first line + if (isset($GLOBALS[$what . '_columns'])) { + $GLOBALS['odt_buffer'] .= ''; + for ($i = 0; $i < $fields_cnt; $i++) { + $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $GLOBALS['odt_buffer'] + .= '' + . '' + . htmlspecialchars( + stripslashes($col_as) + ) + . '' + . ''; + } // end for + $GLOBALS['odt_buffer'] .= ''; + } // end if + + // Format the data + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $GLOBALS['odt_buffer'] .= ''; + for ($j = 0; $j < $fields_cnt; $j++) { + if ($fields_meta[$j]->type === 'geometry') { + // export GIS types as hex + $row[$j] = '0x' . bin2hex($row[$j]); + } + if (!isset($row[$j]) || is_null($row[$j])) { + $GLOBALS['odt_buffer'] + .= '' + . '' + . htmlspecialchars($GLOBALS[$what . '_null']) + . '' + . ''; + } elseif (stristr($field_flags[$j], 'BINARY') + && $fields_meta[$j]->blob + ) { + // ignore BLOB + $GLOBALS['odt_buffer'] + .= '' + . '' + . ''; + } elseif ($fields_meta[$j]->numeric + && $fields_meta[$j]->type != 'timestamp' + && !$fields_meta[$j]->blob + ) { + $GLOBALS['odt_buffer'] + .= '' + . '' + . htmlspecialchars($row[$j]) + . '' + . ''; + } else { + $GLOBALS['odt_buffer'] + .= '' + . '' + . htmlspecialchars($row[$j]) + . '' + . ''; + } + } // end for + $GLOBALS['odt_buffer'] .= ''; + } // end while + $GLOBALS['dbi']->freeResult($result); + + $GLOBALS['odt_buffer'] .= ''; + + return true; + } + + /** + * Returns a stand-in CREATE definition to resolve view dependencies + * + * @param string $db the database name + * @param string $view the view name + * @param string $crlf the end of line sequence + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting definition + */ + public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) + { + $db_alias = $db; + $view_alias = $view; + $this->initAlias($aliases, $db_alias, $view_alias); + /** + * Gets fields properties + */ + $GLOBALS['dbi']->selectDb($db); + + /** + * Displays the table structure + */ + $GLOBALS['odt_buffer'] + .= ''; + $columns_cnt = 4; + $GLOBALS['odt_buffer'] + .= ''; + /* Header */ + $GLOBALS['odt_buffer'] .= '' + . '' + . '' . __('Column') . '' + . '' + . '' + . '' . __('Type') . '' + . '' + . '' + . '' . __('Null') . '' + . '' + . '' + . '' . __('Default') . '' + . '' + . ''; + + $columns = $GLOBALS['dbi']->getColumns($db, $view); + foreach ($columns as $column) { + $col_as = isset($column['Field']) ? $column['Field'] : null; + if (!empty($aliases[$db]['tables'][$view]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$view]['columns'][$col_as]; + } + $GLOBALS['odt_buffer'] .= $this->formatOneColumnDefinition( + $column, + $col_as + ); + $GLOBALS['odt_buffer'] .= ''; + } // end foreach + + $GLOBALS['odt_buffer'] .= ''; + + return true; + } + + /** + * Returns $table's CREATE definition + * + * @param string $db the database name + * @param string $table the table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * PMA_exportStructure() also for other + * @param bool $do_mime whether to include mime comments + * @param bool $show_dates whether to include creation/update/check dates + * @param bool $add_semicolon whether to add semicolon and end-of-line at + * the end + * @param bool $view whether we're handling a view + * @param array $aliases Aliases of db/table/columns + * + * @return bool true + */ + public function getTableDef( + $db, + $table, + $crlf, + $error_url, + $do_relation, + $do_comments, + $do_mime, + $show_dates = false, + $add_semicolon = true, + $view = false, + array $aliases = array() + ) { + global $cfgRelation; + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + /** + * Gets fields properties + */ + $GLOBALS['dbi']->selectDb($db); + + // Check if we can use Relations + list($res_rel, $have_rel) = $this->relation->getRelationsAndStatus( + $do_relation && !empty($cfgRelation['relation']), + $db, + $table + ); + /** + * Displays the table structure + */ + $GLOBALS['odt_buffer'] .= ''; + $columns_cnt = 4; + if ($do_relation && $have_rel) { + $columns_cnt++; + } + if ($do_comments) { + $columns_cnt++; + } + if ($do_mime && $cfgRelation['mimework']) { + $columns_cnt++; + } + $GLOBALS['odt_buffer'] .= ''; + /* Header */ + $GLOBALS['odt_buffer'] .= '' + . '' + . '' . __('Column') . '' + . '' + . '' + . '' . __('Type') . '' + . '' + . '' + . '' . __('Null') . '' + . '' + . '' + . '' . __('Default') . '' + . ''; + if ($do_relation && $have_rel) { + $GLOBALS['odt_buffer'] .= '' + . '' . __('Links to') . '' + . ''; + } + if ($do_comments) { + $GLOBALS['odt_buffer'] .= '' + . '' . __('Comments') . '' + . ''; + $comments = $this->relation->getComments($db, $table); + } + if ($do_mime && $cfgRelation['mimework']) { + $GLOBALS['odt_buffer'] .= '' + . '' . __('MIME type') . '' + . ''; + $mime_map = Transformations::getMIME($db, $table, true); + } + $GLOBALS['odt_buffer'] .= ''; + + $columns = $GLOBALS['dbi']->getColumns($db, $table); + foreach ($columns as $column) { + $col_as = $field_name = $column['Field']; + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $GLOBALS['odt_buffer'] .= $this->formatOneColumnDefinition( + $column, + $col_as + ); + if ($do_relation && $have_rel) { + $foreigner = $this->relation->searchColumnInForeigners($res_rel, $field_name); + if ($foreigner) { + $rtable = $foreigner['foreign_table']; + $rfield = $foreigner['foreign_field']; + if (!empty($aliases[$db]['tables'][$rtable]['columns'][$rfield]) + ) { + $rfield + = $aliases[$db]['tables'][$rtable]['columns'][$rfield]; + } + if (!empty($aliases[$db]['tables'][$rtable]['alias'])) { + $rtable = $aliases[$db]['tables'][$rtable]['alias']; + } + $relation = htmlspecialchars($rtable . ' (' . $rfield . ')'); + $GLOBALS['odt_buffer'] + .= '' + . '' + . htmlspecialchars($relation) + . '' + . ''; + } + } + if ($do_comments) { + if (isset($comments[$field_name])) { + $GLOBALS['odt_buffer'] + .= '' + . '' + . htmlspecialchars($comments[$field_name]) + . '' + . ''; + } else { + $GLOBALS['odt_buffer'] + .= '' + . '' + . ''; + } + } + if ($do_mime && $cfgRelation['mimework']) { + if (isset($mime_map[$field_name])) { + $GLOBALS['odt_buffer'] + .= '' + . '' + . htmlspecialchars( + str_replace('_', '/', $mime_map[$field_name]['mimetype']) + ) + . '' + . ''; + } else { + $GLOBALS['odt_buffer'] + .= '' + . '' + . ''; + } + } + $GLOBALS['odt_buffer'] .= ''; + } // end foreach + + $GLOBALS['odt_buffer'] .= ''; + + return true; + } // end of the '$this->getTableDef()' function + + /** + * Outputs triggers + * + * @param string $db database name + * @param string $table table name + * @param array $aliases Aliases of db/table/columns + * + * @return bool true + */ + protected function getTriggers($db, $table, array $aliases = array()) + { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + $GLOBALS['odt_buffer'] .= '' + . '' + . '' + . '' + . '' . __('Name') . '' + . '' + . '' + . '' . __('Time') . '' + . '' + . '' + . '' . __('Event') . '' + . '' + . '' + . '' . __('Definition') . '' + . '' + . ''; + + $triggers = $GLOBALS['dbi']->getTriggers($db, $table); + + foreach ($triggers as $trigger) { + $GLOBALS['odt_buffer'] .= ''; + $GLOBALS['odt_buffer'] .= '' + . '' + . htmlspecialchars($trigger['name']) + . '' + . ''; + $GLOBALS['odt_buffer'] .= '' + . '' + . htmlspecialchars($trigger['action_timing']) + . '' + . ''; + $GLOBALS['odt_buffer'] .= '' + . '' + . htmlspecialchars($trigger['event_manipulation']) + . '' + . ''; + $GLOBALS['odt_buffer'] .= '' + . '' + . htmlspecialchars($trigger['definition']) + . '' + . ''; + $GLOBALS['odt_buffer'] .= ''; + } + + $GLOBALS['odt_buffer'] .= ''; + + return true; + } + + /** + * Outputs table's structure + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $export_mode 'create_table', 'triggers', 'create_view', + * 'stand_in' + * @param string $export_type 'server', 'database', 'table' + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * PMA_exportStructure() also for other + * @param bool $do_mime whether to include mime comments + * @param bool $dates whether to include creation/update/check dates + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportStructure( + $db, + $table, + $crlf, + $error_url, + $export_mode, + $export_type, + $do_relation = false, + $do_comments = false, + $do_mime = false, + $dates = false, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + switch ($export_mode) { + case 'create_table': + $GLOBALS['odt_buffer'] + .= '' + . __('Table structure for table') . ' ' . + htmlspecialchars($table_alias) + . ''; + $this->getTableDef( + $db, + $table, + $crlf, + $error_url, + $do_relation, + $do_comments, + $do_mime, + $dates, + true, + false, + $aliases + ); + break; + case 'triggers': + $triggers = $GLOBALS['dbi']->getTriggers($db, $table, $aliases); + if ($triggers) { + $GLOBALS['odt_buffer'] + .= '' + . __('Triggers') . ' ' + . htmlspecialchars($table_alias) + . ''; + $this->getTriggers($db, $table); + } + break; + case 'create_view': + $GLOBALS['odt_buffer'] + .= '' + . __('Structure for view') . ' ' + . htmlspecialchars($table_alias) + . ''; + $this->getTableDef( + $db, + $table, + $crlf, + $error_url, + $do_relation, + $do_comments, + $do_mime, + $dates, + true, + true, + $aliases + ); + break; + case 'stand_in': + $GLOBALS['odt_buffer'] + .= '' + . __('Stand-in structure for view') . ' ' + . htmlspecialchars($table_alias) + . ''; + // export a stand-in definition to resolve view dependencies + $this->getTableDefStandIn($db, $table, $crlf, $aliases); + } // end switch + + return true; + } // end of the '$this->exportStructure' function + + /** + * Formats the definition for one column + * + * @param array $column info about this column + * @param string $col_as column alias + * + * @return string Formatted column definition + */ + protected function formatOneColumnDefinition($column, $col_as = '') + { + if (empty($col_as)) { + $col_as = $column['Field']; + } + $definition = ''; + $definition .= '' + . '' . htmlspecialchars($col_as) . '' + . ''; + + $extracted_columnspec + = Util::extractColumnSpec($column['Type']); + $type = htmlspecialchars($extracted_columnspec['print_type']); + if (empty($type)) { + $type = ' '; + } + + $definition .= '' + . '' . htmlspecialchars($type) . '' + . ''; + if (!isset($column['Default'])) { + if ($column['Null'] != 'NO') { + $column['Default'] = 'NULL'; + } else { + $column['Default'] = ''; + } + } + $definition .= '' + . '' + . (($column['Null'] == '' || $column['Null'] == 'NO') + ? __('No') + : __('Yes')) + . '' + . ''; + $definition .= '' + . '' . htmlspecialchars($column['Default']) . '' + . ''; + + return $definition; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportPdf.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportPdf.php new file mode 100755 index 0000000..ff08fbc --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportPdf.php @@ -0,0 +1,385 @@ +initSpecificVariables(); + + $this->setProperties(); + } + + /** + * Initialize the local variables that are used for export PDF + * + * @return void + */ + protected function initSpecificVariables() + { + if (!empty($_POST['pdf_report_title'])) { + $this->_setPdfReportTitle($_POST['pdf_report_title']); + } + $this->_setPdf(new Pdf('L', 'pt', 'A3')); + } + + /** + * Sets the export PDF properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('PDF'); + $exportPluginProperties->setExtension('pdf'); + $exportPluginProperties->setMimeType('application/pdf'); + $exportPluginProperties->setForceFile(true); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new TextPropertyItem( + "report_title", + __('Report title:') + ); + $generalOptions->addProperty($leaf); + // add the group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // what to dump (structure/data/both) main group + $dumpWhat = new OptionsPropertyMainGroup( + "dump_what", __('Dump table') + ); + $leaf = new RadioPropertyItem("structure_or_data"); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data'), + ) + ); + $dumpWhat->addProperty($leaf); + // add the group to the root group + $exportSpecificOptions->addProperty($dumpWhat); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + $pdf_report_title = $this->_getPdfReportTitle(); + $pdf = $this->_getPdf(); + $pdf->Open(); + + $attr = array('titleFontSize' => 18, 'titleText' => $pdf_report_title); + $pdf->setAttributes($attr); + $pdf->setTopMargin(30); + + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + $pdf = $this->_getPdf(); + + // instead of $pdf->Output(): + return Export::outputHandler($pdf->getPDFData()); + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in NHibernate format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + $pdf = $this->_getPdf(); + $attr = array( + 'currentDb' => $db, + 'currentTable' => $table, + 'dbAlias' => $db_alias, + 'tableAlias' => $table_alias, + 'aliases' => $aliases, + ); + $pdf->setAttributes($attr); + $pdf->purpose = __('Dumping data'); + $pdf->mysqlReport($sql_query); + + return true; + } // end of the 'PMA_exportData()' function + + /** + * Outputs table structure + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $export_mode 'create_table', 'triggers', 'create_view', + * 'stand_in' + * @param string $export_type 'server', 'database', 'table' + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * PMA_exportStructure() also for other + * export types which use this parameter + * @param bool $do_mime whether to include mime comments + * @param bool $dates whether to include creation/update/check dates + * @param array $aliases aliases for db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportStructure( + $db, + $table, + $crlf, + $error_url, + $export_mode, + $export_type, + $do_relation = false, + $do_comments = false, + $do_mime = false, + $dates = false, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + $pdf = $this->_getPdf(); + // getting purpose to show at top + switch ($export_mode) { + case 'create_table': + $purpose = __('Table structure'); + break; + case 'triggers': + $purpose = __('Triggers'); + break; + case 'create_view': + $purpose = __('View structure'); + break; + case 'stand_in': + $purpose = __('Stand in'); + } // end switch + + $attr = array( + 'currentDb' => $db, + 'currentTable' => $table, + 'dbAlias' => $db_alias, + 'tableAlias' => $table_alias, + 'aliases' => $aliases, + 'purpose' => $purpose, + ); + $pdf->setAttributes($attr); + /** + * comment display set true as presently in pdf + * format, no option is present to take user input. + */ + $do_comments = true; + switch ($export_mode) { + case 'create_table': + $pdf->getTableDef( + $db, + $table, + $do_relation, + $do_comments, + $do_mime, + false, + $aliases + ); + break; + case 'triggers': + $pdf->getTriggers($db, $table); + break; + case 'create_view': + $pdf->getTableDef( + $db, + $table, + $do_relation, + $do_comments, + $do_mime, + false, + $aliases + ); + break; + case 'stand_in': + /* export a stand-in definition to resolve view dependencies + * Yet to develop this function + * $pdf->getTableDefStandIn($db, $table, $crlf); + */ + } // end switch + + return true; + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the PhpMyAdmin\Plugins\Export\Helpers\Pdf instance + * + * @return Pdf + */ + private function _getPdf() + { + return $this->_pdf; + } + + /** + * Instantiates the PhpMyAdmin\Plugins\Export\Helpers\Pdf class + * + * @param Pdf $pdf The instance + * + * @return void + */ + private function _setPdf($pdf) + { + $this->_pdf = $pdf; + } + + /** + * Gets the PDF report title + * + * @return string + */ + private function _getPdfReportTitle() + { + return $this->_pdfReportTitle; + } + + /** + * Sets the PDF report title + * + * @param string $pdfReportTitle PDF report title + * + * @return void + */ + private function _setPdfReportTitle($pdfReportTitle) + { + $this->_pdfReportTitle = $pdfReportTitle; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportPhparray.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportPhparray.php new file mode 100755 index 0000000..d5d157a --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportPhparray.php @@ -0,0 +1,257 @@ +setProperties(); + } + + /** + * Sets the export PHP Array properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('PHP array'); + $exportPluginProperties->setExtension('php'); + $exportPluginProperties->setMimeType('text/plain'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new HiddenPropertyItem("structure_or_data"); + $generalOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Removes end of comment from a string + * + * @param string $string String to replace + * + * @return string + */ + public function commentString($string) + { + return strtr($string, '*/', '-'); + } + + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + Export::outputHandler( + 'commentString(Util::backquote($db_alias)) + . $GLOBALS['crlf'] . ' */' . $GLOBALS['crlf'] + ); + + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in PHP array format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + + $columns_cnt = $GLOBALS['dbi']->numFields($result); + $columns = array(); + for ($i = 0; $i < $columns_cnt; $i++) { + $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $columns[$i] = stripslashes($col_as); + } + + // fix variable names (based on + // https://www.php.net/manual/en/language.variables.basics.php) + if (!preg_match( + '/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', + $table_alias + ) + ) { + // fix invalid characters in variable names by replacing them with + // underscores + $tablefixed = preg_replace( + '/[^a-zA-Z0-9_\x7f-\xff]/', + '_', + $table_alias + ); + + // variable name must not start with a number or dash... + if (preg_match('/^[a-zA-Z_\x7f-\xff]/', $tablefixed) === 0) { + $tablefixed = '_' . $tablefixed; + } + } else { + $tablefixed = $table; + } + + $buffer = ''; + $record_cnt = 0; + // Output table name as comment + $buffer .= $crlf . '/* ' + . $this->commentString(Util::backquote($db_alias)) . '.' + . $this->commentString(Util::backquote($table_alias)) . ' */' . $crlf; + $buffer .= '$' . $tablefixed . ' = array('; + + while ($record = $GLOBALS['dbi']->fetchRow($result)) { + $record_cnt++; + + if ($record_cnt == 1) { + $buffer .= $crlf . ' array('; + } else { + $buffer .= ',' . $crlf . ' array('; + } + + for ($i = 0; $i < $columns_cnt; $i++) { + $buffer .= var_export($columns[$i], true) + . " => " . var_export($record[$i], true) + . (($i + 1 >= $columns_cnt) ? '' : ','); + } + + $buffer .= ')'; + } + + $buffer .= $crlf . ');' . $crlf; + if (!Export::outputHandler($buffer)) { + return false; + } + + $GLOBALS['dbi']->freeResult($result); + + return true; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportSql.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportSql.php new file mode 100755 index 0000000..d1eac7b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportSql.php @@ -0,0 +1,2878 @@ +setProperties(); + + // Avoids undefined variables, use NULL so isset() returns false + if (!isset($GLOBALS['sql_backquotes'])) { + $GLOBALS['sql_backquotes'] = null; + } + } + + /** + * Sets the export SQL properties + * + * @return void + */ + protected function setProperties() + { + global $plugin_param; + + $hide_sql = false; + $hide_structure = false; + if ($plugin_param['export_type'] == 'table' + && !$plugin_param['single_table'] + ) { + $hide_structure = true; + $hide_sql = true; + } + + if (!$hide_sql) { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('SQL'); + $exportPluginProperties->setExtension('sql'); + $exportPluginProperties->setMimeType('text/x-sql'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + + // comments + $subgroup = new OptionsPropertySubgroup("include_comments"); + $leaf = new BoolPropertyItem( + 'include_comments', + __( + 'Display comments (includes info such as export' + . ' timestamp, PHP version, and server version)' + ) + ); + $subgroup->setSubgroupHeader($leaf); + + $leaf = new TextPropertyItem( + 'header_comment', + __('Additional custom header comment (\n splits lines):') + ); + $subgroup->addProperty($leaf); + $leaf = new BoolPropertyItem( + 'dates', + __( + 'Include a timestamp of when databases were created, last' + . ' updated, and last checked' + ) + ); + $subgroup->addProperty($leaf); + if (!empty($GLOBALS['cfgRelation']['relation'])) { + $leaf = new BoolPropertyItem( + 'relation', + __('Display foreign key relationships') + ); + $subgroup->addProperty($leaf); + } + if (!empty($GLOBALS['cfgRelation']['mimework'])) { + $leaf = new BoolPropertyItem( + 'mime', + __('Display MIME types') + ); + $subgroup->addProperty($leaf); + } + $generalOptions->addProperty($subgroup); + + // enclose in a transaction + $leaf = new BoolPropertyItem( + "use_transaction", + __('Enclose export in a transaction') + ); + $leaf->setDoc( + array( + 'programs', + 'mysqldump', + 'option_mysqldump_single-transaction', + ) + ); + $generalOptions->addProperty($leaf); + + // disable foreign key checks + $leaf = new BoolPropertyItem( + "disable_fk", + __('Disable foreign key checks') + ); + $leaf->setDoc( + array( + 'manual_MySQL_Database_Administration', + 'server-system-variables', + 'sysvar_foreign_key_checks', + ) + ); + $generalOptions->addProperty($leaf); + + // export views as tables + $leaf = new BoolPropertyItem( + "views_as_tables", + __('Export views as tables') + ); + $generalOptions->addProperty($leaf); + + // export metadata + $leaf = new BoolPropertyItem( + "metadata", + __('Export metadata') + ); + $generalOptions->addProperty($leaf); + + // compatibility maximization + $compats = $GLOBALS['dbi']->getCompatibilities(); + if (count($compats) > 0) { + $values = array(); + foreach ($compats as $val) { + $values[$val] = $val; + } + + $leaf = new SelectPropertyItem( + "compatibility", + __( + 'Database system or older MySQL server to maximize output' + . ' compatibility with:' + ) + ); + $leaf->setValues($values); + $leaf->setDoc( + array( + 'manual_MySQL_Database_Administration', + 'Server_SQL_mode', + ) + ); + $generalOptions->addProperty($leaf); + + unset($values); + } + + // what to dump (structure/data/both) + $subgroup = new OptionsPropertySubgroup( + "dump_table", __("Dump table") + ); + $leaf = new RadioPropertyItem('structure_or_data'); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data'), + ) + ); + $subgroup->setSubgroupHeader($leaf); + $generalOptions->addProperty($subgroup); + + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // structure options main group + if (!$hide_structure) { + $structureOptions = new OptionsPropertyMainGroup( + "structure", __('Object creation options') + ); + $structureOptions->setForce('data'); + + // begin SQL Statements + $subgroup = new OptionsPropertySubgroup(); + $leaf = new MessageOnlyPropertyItem( + 'add_statements', + __('Add statements:') + ); + $subgroup->setSubgroupHeader($leaf); + + // server export options + if ($plugin_param['export_type'] == 'server') { + $leaf = new BoolPropertyItem( + "drop_database", + sprintf(__('Add %s statement'), 'DROP DATABASE IF EXISTS') + ); + $subgroup->addProperty($leaf); + } + + if ($plugin_param['export_type'] == 'database') { + $create_clause = 'CREATE DATABASE / USE'; + $leaf = new BoolPropertyItem( + 'create_database', + sprintf(__('Add %s statement'), $create_clause) + ); + $subgroup->addProperty($leaf); + } + + if ($plugin_param['export_type'] == 'table') { + $drop_clause = $GLOBALS['dbi']->getTable( + $GLOBALS['db'], + $GLOBALS['table'] + )->isView() + ? 'DROP VIEW' + : 'DROP TABLE'; + } else { + $drop_clause = 'DROP TABLE / VIEW / PROCEDURE' + . ' / FUNCTION / EVENT'; + } + + $drop_clause .= ' / TRIGGER'; + + $leaf = new BoolPropertyItem( + 'drop_table', + sprintf(__('Add %s statement'), $drop_clause) + ); + $subgroup->addProperty($leaf); + + $subgroup_create_table = new OptionsPropertySubgroup(); + + // Add table structure option + $leaf = new BoolPropertyItem( + 'create_table', + sprintf(__('Add %s statement'), 'CREATE TABLE') + ); + $subgroup_create_table->setSubgroupHeader($leaf); + + $leaf = new BoolPropertyItem( + 'if_not_exists', + 'IF NOT EXISTS ' . __( + '(less efficient as indexes will be generated during table ' + . 'creation)' + ) + ); + $subgroup_create_table->addProperty($leaf); + + $leaf = new BoolPropertyItem( + 'auto_increment', + sprintf(__('%s value'), 'AUTO_INCREMENT') + ); + $subgroup_create_table->addProperty($leaf); + + $subgroup->addProperty($subgroup_create_table); + + // Add view option + $leaf = new BoolPropertyItem( + 'create_view', + sprintf(__('Add %s statement'), 'CREATE VIEW') + ); + $subgroup->addProperty($leaf); + + $leaf = new BoolPropertyItem( + 'procedure_function', + sprintf( + __('Add %s statement'), + 'CREATE PROCEDURE / FUNCTION / EVENT' + ) + ); + $subgroup->addProperty($leaf); + + // Add triggers option + $leaf = new BoolPropertyItem( + 'create_trigger', + sprintf(__('Add %s statement'), 'CREATE TRIGGER') + ); + $subgroup->addProperty($leaf); + + $structureOptions->addProperty($subgroup); + + $leaf = new BoolPropertyItem( + "backquotes", + __( + 'Enclose table and column names with backquotes ' + . '(Protects column and table names formed with' + . ' special characters or keywords)' + ) + ); + + $structureOptions->addProperty($leaf); + + // add the main group to the root group + $exportSpecificOptions->addProperty($structureOptions); + } + + // begin Data options + $dataOptions = new OptionsPropertyMainGroup( + "data", __('Data creation options') + ); + $dataOptions->setForce('structure'); + $leaf = new BoolPropertyItem( + "truncate", + __('Truncate table before insert') + ); + $dataOptions->addProperty($leaf); + + // begin SQL Statements + $subgroup = new OptionsPropertySubgroup(); + $leaf = new MessageOnlyPropertyItem( + __('Instead of INSERT statements, use:') + ); + $subgroup->setSubgroupHeader($leaf); + + $leaf = new BoolPropertyItem( + "delayed", + __('INSERT DELAYED statements') + ); + $leaf->setDoc( + array( + 'manual_MySQL_Database_Administration', + 'insert_delayed' + ) + ); + $subgroup->addProperty($leaf); + + $leaf = new BoolPropertyItem( + "ignore", + __('INSERT IGNORE statements') + ); + $leaf->setDoc( + array( + 'manual_MySQL_Database_Administration', + 'insert', + ) + ); + $subgroup->addProperty($leaf); + $dataOptions->addProperty($subgroup); + + // Function to use when dumping dat + $leaf = new SelectPropertyItem( + "type", + __('Function to use when dumping data:') + ); + $leaf->setValues( + array( + 'INSERT' => 'INSERT', + 'UPDATE' => 'UPDATE', + 'REPLACE' => 'REPLACE', + ) + ); + $dataOptions->addProperty($leaf); + + /* Syntax to use when inserting data */ + $subgroup = new OptionsPropertySubgroup(); + $leaf = new MessageOnlyPropertyItem( + null, + __('Syntax to use when inserting data:') + ); + $subgroup->setSubgroupHeader($leaf); + $leaf = new RadioPropertyItem( + "insert_syntax", + __('INSERT IGNORE statements') + ); + $leaf->setValues( + array( + 'complete' => __( + 'include column names in every INSERT statement' + . '
          Example: INSERT INTO' + . ' tbl_name (col_A,col_B,col_C) VALUES (1,2,3)' + ), + 'extended' => __( + 'insert multiple rows in every INSERT statement' + . '
          Example: INSERT INTO' + . ' tbl_name VALUES (1,2,3), (4,5,6), (7,8,9)' + ), + 'both' => __( + 'both of the above
          Example:' + . ' INSERT INTO tbl_name (col_A,col_B,col_C) VALUES' + . ' (1,2,3), (4,5,6), (7,8,9)' + ), + 'none' => __( + 'neither of the above
          Example:' + . ' INSERT INTO tbl_name VALUES (1,2,3)' + ), + ) + ); + $subgroup->addProperty($leaf); + $dataOptions->addProperty($subgroup); + + // Max length of query + $leaf = new NumberPropertyItem( + "max_query_size", + __('Maximal length of created query') + ); + $dataOptions->addProperty($leaf); + + // Dump binary columns in hexadecimal + $leaf = new BoolPropertyItem( + "hex_for_binary", + __( + 'Dump binary columns in hexadecimal notation' + . ' (for example, "abc" becomes 0x616263)' + ) + ); + $dataOptions->addProperty($leaf); + + // Dump time in UTC + $leaf = new BoolPropertyItem( + "utc_time", + __( + 'Dump TIMESTAMP columns in UTC (enables TIMESTAMP columns' + . ' to be dumped and reloaded between servers in different' + . ' time zones)' + ) + ); + $dataOptions->addProperty($leaf); + + // add the main group to the root group + $exportSpecificOptions->addProperty($dataOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + } + + /** + * Generates SQL for routines export + * + * @param string $db Database + * @param array $aliases Aliases of db/table/columns + * @param string $type Type of exported routine + * @param string $name Verbose name of exported routine + * @param array $routines List of routines to export + * @param string $delimiter Delimiter to use in SQL + * + * @return string SQL query + */ + protected function _exportRoutineSQL( + $db, array $aliases, $type, $name, array $routines, $delimiter + ) { + global $crlf; + + $text = $this->_exportComment() + . $this->_exportComment($name) + . $this->_exportComment(); + + $used_alias = false; + $proc_query = ''; + + foreach ($routines as $routine) { + if (!empty($GLOBALS['sql_drop_table'])) { + $proc_query .= 'DROP ' . $type . ' IF EXISTS ' + . Util::backquote($routine) + . $delimiter . $crlf; + } + $create_query = $this->replaceWithAliases( + $GLOBALS['dbi']->getDefinition($db, $type, $routine), + $aliases, + $db, + '', + $flag + ); + // One warning per database + if ($flag) { + $used_alias = true; + } + $proc_query .= $create_query . $delimiter . $crlf . $crlf; + } + if ($used_alias) { + $text .= $this->_exportComment( + __('It appears your database uses routines;') + ) + . $this->_exportComment( + __('alias export may not work reliably in all cases.') + ) + . $this->_exportComment(); + } + $text .= $proc_query; + + return $text; + } + + /** + * Exports routines (procedures and functions) + * + * @param string $db Database + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportRoutines($db, array $aliases = array()) + { + global $crlf; + + $db_alias = $db; + $this->initAlias($aliases, $db_alias); + + $text = ''; + $delimiter = '$$'; + + $procedure_names = $GLOBALS['dbi'] + ->getProceduresOrFunctions($db, 'PROCEDURE'); + $function_names = $GLOBALS['dbi']->getProceduresOrFunctions($db, 'FUNCTION'); + + if ($procedure_names || $function_names) { + $text .= $crlf + . 'DELIMITER ' . $delimiter . $crlf; + + if ($procedure_names) { + $text .= $this->_exportRoutineSQL( + $db, + $aliases, + 'PROCEDURE', + __('Procedures'), + $procedure_names, + $delimiter + ); + } + + if ($function_names) { + $text .= $this->_exportRoutineSQL( + $db, + $aliases, + 'FUNCTION', + __('Functions'), + $function_names, + $delimiter + ); + } + + $text .= 'DELIMITER ;' . $crlf; + } + + if (!empty($text)) { + return Export::outputHandler($text); + } + + return false; + } + + /** + * Possibly outputs comment + * + * @param string $text Text of comment + * + * @return string The formatted comment + */ + private function _exportComment($text = '') + { + if (isset($GLOBALS['sql_include_comments']) + && $GLOBALS['sql_include_comments'] + ) { + // see https://dev.mysql.com/doc/refman/5.0/en/ansi-diff-comments.html + if (empty($text)) { + return '--' . $GLOBALS['crlf']; + } + + $lines = preg_split("/\\r\\n|\\r|\\n/", $text); + $result = array(); + foreach ($lines as $line) { + $result[] = '-- ' . $line . $GLOBALS['crlf']; + } + return implode('', $result); + } + + return ''; + } + + /** + * Possibly outputs CRLF + * + * @return string $crlf or nothing + */ + private function _possibleCRLF() + { + if (isset($GLOBALS['sql_include_comments']) + && $GLOBALS['sql_include_comments'] + ) { + return $GLOBALS['crlf']; + } + + return ''; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + global $crlf; + + $foot = ''; + + if (isset($GLOBALS['sql_disable_fk'])) { + $foot .= 'SET FOREIGN_KEY_CHECKS=1;' . $crlf; + } + + if (isset($GLOBALS['sql_use_transaction'])) { + $foot .= 'COMMIT;' . $crlf; + } + + // restore connection settings + if ($this->_sent_charset) { + $foot .= $crlf + . '/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;' + . $crlf + . '/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;' + . $crlf + . '/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;' + . $crlf; + $this->_sent_charset = false; + } + + /* Restore timezone */ + if (isset($GLOBALS['sql_utc_time']) && $GLOBALS['sql_utc_time']) { + $GLOBALS['dbi']->query('SET time_zone = "' . $GLOBALS['old_tz'] . '"'); + } + + return Export::outputHandler($foot); + } + + /** + * Outputs export header. It is the first method to be called, so all + * the required variables are initialized here. + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + global $crlf, $cfg; + + if (isset($GLOBALS['sql_compatibility'])) { + $tmp_compat = $GLOBALS['sql_compatibility']; + if ($tmp_compat == 'NONE') { + $tmp_compat = ''; + } + $GLOBALS['dbi']->tryQuery('SET SQL_MODE="' . $tmp_compat . '"'); + unset($tmp_compat); + } + $head = $this->_exportComment('phpMyAdmin SQL Dump') + . $this->_exportComment('version ' . PMA_VERSION) + . $this->_exportComment('https://www.phpmyadmin.net/') + . $this->_exportComment(); + $host_string = __('Host:') . ' ' . $cfg['Server']['host']; + if (!empty($cfg['Server']['port'])) { + $host_string .= ':' . $cfg['Server']['port']; + } + $head .= $this->_exportComment($host_string); + $head .= $this->_exportComment( + __('Generation Time:') . ' ' + . Util::localisedDate() + ) + . $this->_exportComment( + __('Server version:') . ' ' . $GLOBALS['dbi']->getVersionString() + ) + . $this->_exportComment(__('PHP Version:') . ' ' . phpversion()) + . $this->_possibleCRLF(); + + if (isset($GLOBALS['sql_header_comment']) + && !empty($GLOBALS['sql_header_comment']) + ) { + // '\n' is not a newline (like "\n" would be), it's the characters + // backslash and n, as explained on the export interface + $lines = explode('\n', $GLOBALS['sql_header_comment']); + $head .= $this->_exportComment(); + foreach ($lines as $one_line) { + $head .= $this->_exportComment($one_line); + } + $head .= $this->_exportComment(); + } + + if (isset($GLOBALS['sql_disable_fk'])) { + $head .= 'SET FOREIGN_KEY_CHECKS=0;' . $crlf; + } + + // We want exported AUTO_INCREMENT columns to have still same value, + // do this only for recent MySQL exports + if ((! isset($GLOBALS['sql_compatibility']) + || $GLOBALS['sql_compatibility'] == 'NONE') + ) { + $head .= 'SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";' . $crlf; + } + + if (isset($GLOBALS['sql_use_transaction'])) { + $head .= 'SET AUTOCOMMIT = 0;' . $crlf + . 'START TRANSACTION;' . $crlf; + } + + /* Change timezone if we should export timestamps in UTC */ + if (isset($GLOBALS['sql_utc_time']) && $GLOBALS['sql_utc_time']) { + $head .= 'SET time_zone = "+00:00";' . $crlf; + $GLOBALS['old_tz'] = $GLOBALS['dbi'] + ->fetchValue('SELECT @@session.time_zone'); + $GLOBALS['dbi']->query('SET time_zone = "+00:00"'); + } + + $head .= $this->_possibleCRLF(); + + if (! empty($GLOBALS['asfile'])) { + // we are saving as file, therefore we provide charset information + // so that a utility like the mysql client can interpret + // the file correctly + if (isset($GLOBALS['charset']) + && isset(Charsets::$mysql_charset_map[$GLOBALS['charset']]) + ) { + // we got a charset from the export dialog + $set_names = Charsets::$mysql_charset_map[$GLOBALS['charset']]; + } else { + // by default we use the connection charset + $set_names = Charsets::$mysql_charset_map['utf-8']; + } + if ($set_names == 'utf8' && $GLOBALS['dbi']->getVersion() > 50503) { + $set_names = 'utf8mb4'; + } + $head .= $crlf + . '/*!40101 SET @OLD_CHARACTER_SET_CLIENT=' + . '@@CHARACTER_SET_CLIENT */;' . $crlf + . '/*!40101 SET @OLD_CHARACTER_SET_RESULTS=' + . '@@CHARACTER_SET_RESULTS */;' . $crlf + . '/*!40101 SET @OLD_COLLATION_CONNECTION=' + . '@@COLLATION_CONNECTION */;' . $crlf + . '/*!40101 SET NAMES ' . $set_names . ' */;' . $crlf . $crlf; + $this->_sent_charset = true; + } + + return Export::outputHandler($head); + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + global $crlf; + + if (empty($db_alias)) { + $db_alias = $db; + } + if (isset($GLOBALS['sql_compatibility'])) { + $compat = $GLOBALS['sql_compatibility']; + } else { + $compat = 'NONE'; + } + if (isset($GLOBALS['sql_drop_database'])) { + if (!Export::outputHandler( + 'DROP DATABASE IF EXISTS ' + . Util::backquoteCompat( + $db_alias, + $compat, + isset($GLOBALS['sql_backquotes']) + ) + . ';' . $crlf + ) + ) { + return false; + } + } + if ($export_type == 'database' && !isset($GLOBALS['sql_create_database'])) { + return true; + } + + $create_query = 'CREATE DATABASE IF NOT EXISTS ' + . Util::backquoteCompat( + $db_alias, + $compat, + isset($GLOBALS['sql_backquotes']) + ); + $collation = $GLOBALS['dbi']->getDbCollation($db); + if (mb_strpos($collation, '_')) { + $create_query .= ' DEFAULT CHARACTER SET ' + . mb_substr( + $collation, + 0, + mb_strpos($collation, '_') + ) + . ' COLLATE ' . $collation; + } else { + $create_query .= ' DEFAULT CHARACTER SET ' . $collation; + } + $create_query .= ';' . $crlf; + if (!Export::outputHandler($create_query)) { + return false; + } + + return $this->_exportUseStatement($db_alias, $compat); + } + + /** + * Outputs USE statement + * + * @param string $db db to use + * @param string $compat sql compatibility + * + * @return bool Whether it succeeded + */ + private function _exportUseStatement($db, $compat) + { + global $crlf; + + if (isset($GLOBALS['sql_compatibility']) + && $GLOBALS['sql_compatibility'] == 'NONE' + ) { + $result = Export::outputHandler( + 'USE ' + . Util::backquoteCompat( + $db, + $compat, + isset($GLOBALS['sql_backquotes']) + ) + . ';' . $crlf + ); + } else { + $result = Export::outputHandler('USE ' . $db . ';' . $crlf); + } + + return $result; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Alias of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + if (empty($db_alias)) { + $db_alias = $db; + } + if (isset($GLOBALS['sql_compatibility'])) { + $compat = $GLOBALS['sql_compatibility']; + } else { + $compat = 'NONE'; + } + $head = $this->_exportComment() + . $this->_exportComment( + __('Database:') . ' ' + . Util::backquoteCompat( + $db_alias, + $compat, + isset($GLOBALS['sql_backquotes']) + ) + ) + . $this->_exportComment(); + + return Export::outputHandler($head); + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + global $crlf; + + $result = true; + + //add indexes to the sql dump file + if (isset($GLOBALS['sql_indexes'])) { + $result = Export::outputHandler($GLOBALS['sql_indexes']); + unset($GLOBALS['sql_indexes']); + } + //add auto increments to the sql dump file + if (isset($GLOBALS['sql_auto_increments'])) { + $result = Export::outputHandler($GLOBALS['sql_auto_increments']); + unset($GLOBALS['sql_auto_increments']); + } + //add constraints to the sql dump file + if (isset($GLOBALS['sql_constraints'])) { + $result = Export::outputHandler($GLOBALS['sql_constraints']); + unset($GLOBALS['sql_constraints']); + } + + return $result; + } + + /** + * Exports events + * + * @param string $db Database + * + * @return bool Whether it succeeded + */ + public function exportEvents($db) + { + global $crlf; + + $text = ''; + $delimiter = '$$'; + + $event_names = $GLOBALS['dbi']->fetchResult( + "SELECT EVENT_NAME FROM information_schema.EVENTS WHERE" + . " EVENT_SCHEMA= '" . $GLOBALS['dbi']->escapeString($db) + . "';" + ); + + if ($event_names) { + $text .= $crlf + . "DELIMITER " . $delimiter . $crlf; + + $text .= $this->_exportComment() + . $this->_exportComment(__('Events')) + . $this->_exportComment(); + + foreach ($event_names as $event_name) { + if (!empty($GLOBALS['sql_drop_table'])) { + $text .= "DROP EVENT " + . Util::backquote($event_name) + . $delimiter . $crlf; + } + $text .= $GLOBALS['dbi']->getDefinition($db, 'EVENT', $event_name) + . $delimiter . $crlf . $crlf; + } + + $text .= "DELIMITER ;" . $crlf; + } + + if (!empty($text)) { + return Export::outputHandler($text); + } + + return false; + } + + /** + * Exports metadata from Configuration Storage + * + * @param string $db database being exported + * @param string|array $tables table(s) being exported + * @param array $metadataTypes types of metadata to export + * + * @return bool Whether it succeeded + */ + public function exportMetadata( + $db, + $tables, + array $metadataTypes + ) { + $cfgRelation = $this->relation->getRelationsParam(); + if (!isset($cfgRelation['db'])) { + return true; + } + + $comment = $this->_possibleCRLF() + . $this->_possibleCRLF() + . $this->_exportComment() + . $this->_exportComment(__('Metadata')) + . $this->_exportComment(); + if (!Export::outputHandler($comment)) { + return false; + } + + if (!$this->_exportUseStatement( + $cfgRelation['db'], + $GLOBALS['sql_compatibility'] + ) + ) { + return false; + } + + $r = true; + if (is_array($tables)) { + // export metadata for each table + foreach ($tables as $table) { + $r &= $this->_exportMetadata($db, $table, $metadataTypes); + } + // export metadata for the database + $r &= $this->_exportMetadata($db, null, $metadataTypes); + } else { + // export metadata for single table + $r &= $this->_exportMetadata($db, $tables, $metadataTypes); + } + + return $r; + } + + /** + * Exports metadata from Configuration Storage + * + * @param string $db database being exported + * @param string $table table being exported + * @param array $metadataTypes types of metadata to export + * + * @return bool Whether it succeeded + */ + private function _exportMetadata( + $db, + $table, + array $metadataTypes + ) { + $cfgRelation = $this->relation->getRelationsParam(); + + if (isset($table)) { + $types = array( + 'column_info' => 'db_name', + 'table_uiprefs' => 'db_name', + 'tracking' => 'db_name', + ); + } else { + $types = array( + 'bookmark' => 'dbase', + 'relation' => 'master_db', + 'pdf_pages' => 'db_name', + 'savedsearches' => 'db_name', + 'central_columns' => 'db_name', + ); + } + + $aliases = array(); + + $comment = $this->_possibleCRLF() + . $this->_exportComment(); + + if (isset($table)) { + $comment .= $this->_exportComment( + sprintf( + __('Metadata for table %s'), + $table + ) + ); + } else { + $comment .= $this->_exportComment( + sprintf( + __('Metadata for database %s'), + $db + ) + ); + } + + $comment .= $this->_exportComment(); + + if (!Export::outputHandler($comment)) { + return false; + } + + foreach ($types as $type => $dbNameColumn) { + if (in_array($type, $metadataTypes) && isset($cfgRelation[$type])) { + + // special case, designer pages and their coordinates + if ($type == 'pdf_pages') { + + $sql_query = "SELECT `page_nr`, `page_descr` FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation[$type]) + . " WHERE " . Util::backquote($dbNameColumn) + . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; + + $result = $GLOBALS['dbi']->fetchResult( + $sql_query, + 'page_nr', + 'page_descr' + ); + + foreach ($result as $page => $name) { + // insert row for pdf_page + $sql_query_row = "SELECT `db_name`, `page_descr` FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote( + $cfgRelation[$type] + ) + . " WHERE " . Util::backquote( + $dbNameColumn + ) + . " = '" . $GLOBALS['dbi']->escapeString($db) . "'" + . " AND `page_nr` = '" . intval($page) . "'"; + + if (!$this->exportData( + $cfgRelation['db'], + $cfgRelation[$type], + $GLOBALS['crlf'], + '', + $sql_query_row, + $aliases + ) + ) { + return false; + } + + $lastPage = $GLOBALS['crlf'] + . "SET @LAST_PAGE = LAST_INSERT_ID();" + . $GLOBALS['crlf']; + if (!Export::outputHandler($lastPage)) { + return false; + } + + $sql_query_coords = "SELECT `db_name`, `table_name`, " + . "'@LAST_PAGE' AS `pdf_page_number`, `x`, `y` FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote( + $cfgRelation['table_coords'] + ) + . " WHERE `pdf_page_number` = '" . $page . "'"; + + $GLOBALS['exporting_metadata'] = true; + if (!$this->exportData( + $cfgRelation['db'], + $cfgRelation['table_coords'], + $GLOBALS['crlf'], + '', + $sql_query_coords, + $aliases + ) + ) { + $GLOBALS['exporting_metadata'] = false; + + return false; + } + $GLOBALS['exporting_metadata'] = false; + } + continue; + } + + // remove auto_incrementing id field for some tables + if ($type == 'bookmark') { + $sql_query = "SELECT `dbase`, `user`, `label`, `query` FROM "; + } elseif ($type == 'column_info') { + $sql_query = "SELECT `db_name`, `table_name`, `column_name`," + . " `comment`, `mimetype`, `transformation`," + . " `transformation_options`, `input_transformation`," + . " `input_transformation_options` FROM"; + } elseif ($type == 'savedsearches') { + $sql_query = "SELECT `username`, `db_name`, `search_name`," + . " `search_data` FROM"; + } else { + $sql_query = "SELECT * FROM "; + } + $sql_query .= Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation[$type]) + . " WHERE " . Util::backquote($dbNameColumn) + . " = '" . $GLOBALS['dbi']->escapeString($db) . "'"; + if (isset($table)) { + $sql_query .= " AND `table_name` = '" + . $GLOBALS['dbi']->escapeString($table) . "'"; + } + + if (!$this->exportData( + $cfgRelation['db'], + $cfgRelation[$type], + $GLOBALS['crlf'], + '', + $sql_query, + $aliases + ) + ) { + return false; + } + } + } + + return true; + } + + /** + * Returns a stand-in CREATE definition to resolve view dependencies + * + * @param string $db the database name + * @param string $view the view name + * @param string $crlf the end of line sequence + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting definition + */ + public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) + { + $db_alias = $db; + $view_alias = $view; + $this->initAlias($aliases, $db_alias, $view_alias); + $create_query = ''; + if (!empty($GLOBALS['sql_drop_table'])) { + $create_query .= 'DROP VIEW IF EXISTS ' + . Util::backquote($view_alias) + . ';' . $crlf; + } + + $create_query .= 'CREATE TABLE '; + + if (isset($GLOBALS['sql_if_not_exists']) + && $GLOBALS['sql_if_not_exists'] + ) { + $create_query .= 'IF NOT EXISTS '; + } + $create_query .= Util::backquote($view_alias) . ' (' . $crlf; + $tmp = array(); + $columns = $GLOBALS['dbi']->getColumnsFull($db, $view); + foreach ($columns as $column_name => $definition) { + $col_alias = $column_name; + if (!empty($aliases[$db]['tables'][$view]['columns'][$col_alias])) { + $col_alias = $aliases[$db]['tables'][$view]['columns'][$col_alias]; + } + $tmp[] = Util::backquote($col_alias) . ' ' . + $definition['Type'] . $crlf; + } + $create_query .= implode(',', $tmp) . ');' . $crlf; + + return ($create_query); + } + + /** + * Returns CREATE definition that matches $view's structure + * + * @param string $db the database name + * @param string $view the view name + * @param string $crlf the end of line sequence + * @param bool $add_semicolon whether to add semicolon and end-of-line at + * the end + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting schema + */ + private function _getTableDefForView( + $db, + $view, + $crlf, + $add_semicolon = true, + array $aliases = array() + ) { + $db_alias = $db; + $view_alias = $view; + $this->initAlias($aliases, $db_alias, $view_alias); + $create_query = "CREATE TABLE"; + if (isset($GLOBALS['sql_if_not_exists'])) { + $create_query .= " IF NOT EXISTS "; + } + $create_query .= Util::backquote($view_alias) . "(" . $crlf; + + $columns = $GLOBALS['dbi']->getColumns($db, $view, null, true); + + $firstCol = true; + foreach ($columns as $column) { + $col_alias = $column['Field']; + if (!empty($aliases[$db]['tables'][$view]['columns'][$col_alias])) { + $col_alias = $aliases[$db]['tables'][$view]['columns'][$col_alias]; + } + $extracted_columnspec = Util::extractColumnSpec( + $column['Type'] + ); + + if (!$firstCol) { + $create_query .= "," . $crlf; + } + $create_query .= " " . Util::backquote($col_alias); + $create_query .= " " . $column['Type']; + if ($extracted_columnspec['can_contain_collation'] + && !empty($column['Collation']) + ) { + $create_query .= " COLLATE " . $column['Collation']; + } + if ($column['Null'] == 'NO') { + $create_query .= " NOT NULL"; + } + if (isset($column['Default'])) { + $create_query .= " DEFAULT '" + . $GLOBALS['dbi']->escapeString($column['Default']) . "'"; + } else { + if ($column['Null'] == 'YES') { + $create_query .= " DEFAULT NULL"; + } + } + if (!empty($column['Comment'])) { + $create_query .= " COMMENT '" + . $GLOBALS['dbi']->escapeString($column['Comment']) . "'"; + } + $firstCol = false; + } + $create_query .= $crlf . ")" . ($add_semicolon ? ';' : '') . $crlf; + + if (isset($GLOBALS['sql_compatibility'])) { + $compat = $GLOBALS['sql_compatibility']; + } else { + $compat = 'NONE'; + } + if ($compat == 'MSSQL') { + $create_query = $this->_makeCreateTableMSSQLCompatible( + $create_query + ); + } + + return $create_query; + } + + /** + * Returns $table's CREATE definition + * + * @param string $db the database name + * @param string $table the table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case + * of error + * @param bool $show_dates whether to include creation/ + * update/check dates + * @param bool $add_semicolon whether to add semicolon and + * end-of-line at the end + * @param bool $view whether we're handling a view + * @param bool $update_indexes_increments whether we need to update + * two global variables + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting schema + */ + public function getTableDef( + $db, + $table, + $crlf, + $error_url, + $show_dates = false, + $add_semicolon = true, + $view = false, + $update_indexes_increments = true, + array $aliases = array() + ) { + global $sql_drop_table, $sql_backquotes, $sql_constraints, + $sql_constraints_query, $sql_indexes, $sql_indexes_query, + $sql_auto_increments, $sql_drop_foreign_keys; + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + $schema_create = ''; + $auto_increment = ''; + $new_crlf = $crlf; + + if (isset($GLOBALS['sql_compatibility'])) { + $compat = $GLOBALS['sql_compatibility']; + } else { + $compat = 'NONE'; + } + + // need to use PhpMyAdmin\DatabaseInterface::QUERY_STORE + // with $GLOBALS['dbi']->numRows() in mysqli + $result = $GLOBALS['dbi']->tryQuery( + 'SHOW TABLE STATUS FROM ' . Util::backquote($db) + . ' WHERE Name = \'' . $GLOBALS['dbi']->escapeString($table) . '\'', + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + if ($result != false) { + if ($GLOBALS['dbi']->numRows($result) > 0) { + $tmpres = $GLOBALS['dbi']->fetchAssoc($result); + + // Here we optionally add the AUTO_INCREMENT next value, + // but starting with MySQL 5.0.24, the clause is already included + // in SHOW CREATE TABLE so we'll remove it below + if (isset($GLOBALS['sql_auto_increment']) + && !empty($tmpres['Auto_increment']) + ) { + $auto_increment .= ' AUTO_INCREMENT=' + . $tmpres['Auto_increment'] . ' '; + } + + if ($show_dates + && isset($tmpres['Create_time']) + && !empty($tmpres['Create_time']) + ) { + $schema_create .= $this->_exportComment( + __('Creation:') . ' ' + . Util::localisedDate( + strtotime($tmpres['Create_time']) + ) + ); + $new_crlf = $this->_exportComment() . $crlf; + } + + if ($show_dates + && isset($tmpres['Update_time']) + && !empty($tmpres['Update_time']) + ) { + $schema_create .= $this->_exportComment( + __('Last update:') . ' ' + . Util::localisedDate( + strtotime($tmpres['Update_time']) + ) + ); + $new_crlf = $this->_exportComment() . $crlf; + } + + if ($show_dates + && isset($tmpres['Check_time']) + && !empty($tmpres['Check_time']) + ) { + $schema_create .= $this->_exportComment( + __('Last check:') . ' ' + . Util::localisedDate( + strtotime($tmpres['Check_time']) + ) + ); + $new_crlf = $this->_exportComment() . $crlf; + } + } + $GLOBALS['dbi']->freeResult($result); + } + + $schema_create .= $new_crlf; + + // no need to generate a DROP VIEW here, it was done earlier + if (!empty($sql_drop_table) + && !$GLOBALS['dbi']->getTable($db, $table)->isView() + ) { + $schema_create .= 'DROP TABLE IF EXISTS ' + . Util::backquote($table_alias, $sql_backquotes) . ';' + . $crlf; + } + + // Complete table dump, + // Whether to quote table and column names or not + if ($sql_backquotes) { + $GLOBALS['dbi']->query('SET SQL_QUOTE_SHOW_CREATE = 1'); + } else { + $GLOBALS['dbi']->query('SET SQL_QUOTE_SHOW_CREATE = 0'); + } + + // I don't see the reason why this unbuffered query could cause problems, + // because SHOW CREATE TABLE returns only one row, and we free the + // results below. Nonetheless, we got 2 user reports about this + // (see bug 1562533) so I removed the unbuffered mode. + // $result = $GLOBALS['dbi']->query('SHOW CREATE TABLE ' . backquote($db) + // . '.' . backquote($table), null, DatabaseInterface::QUERY_UNBUFFERED); + // + // Note: SHOW CREATE TABLE, at least in MySQL 5.1.23, does not + // produce a displayable result for the default value of a BIT + // column, nor does the mysqldump command. See MySQL bug 35796 + $GLOBALS['dbi']->tryQuery('USE ' . Util::backquote($db)); + $result = $GLOBALS['dbi']->tryQuery( + 'SHOW CREATE TABLE ' . Util::backquote($db) . '.' + . Util::backquote($table) + ); + // an error can happen, for example the table is crashed + $tmp_error = $GLOBALS['dbi']->getError(); + if ($tmp_error) { + $message = sprintf(__('Error reading structure for table %s:'), "$db.$table"); + $message .= ' ' . $tmp_error; + if (! defined('TESTSUITE')) { + trigger_error($message, E_USER_ERROR); + } + return $this->_exportComment($message); + } + + // Old mode is stored so it can be restored once exporting is done. + $old_mode = Context::$MODE; + + $warning = ''; + if ($result != false && ($row = $GLOBALS['dbi']->fetchRow($result))) { + $create_query = $row[1]; + unset($row); + + // Convert end of line chars to one that we want (note that MySQL + // doesn't return query it will accept in all cases) + if (mb_strpos($create_query, "(\r\n ")) { + $create_query = str_replace("\r\n", $crlf, $create_query); + } elseif (mb_strpos($create_query, "(\n ")) { + $create_query = str_replace("\n", $crlf, $create_query); + } elseif (mb_strpos($create_query, "(\r ")) { + $create_query = str_replace("\r", $crlf, $create_query); + } + + /* + * Drop database name from VIEW creation. + * + * This is a bit tricky, but we need to issue SHOW CREATE TABLE with + * database name, but we don't want name to show up in CREATE VIEW + * statement. + */ + if ($view) { + $create_query = preg_replace( + '/' . preg_quote(Util::backquote($db), '/') . '\./', + '', + $create_query + ); + } + + // Substitute aliases in `CREATE` query. + $create_query = $this->replaceWithAliases( + $create_query, + $aliases, + $db, + $table, + $flag + ); + + // One warning per view. + if ($flag && $view) { + $warning = $this->_exportComment() + . $this->_exportComment( + __('It appears your database uses views;') + ) + . $this->_exportComment( + __('alias export may not work reliably in all cases.') + ) + . $this->_exportComment(); + } + + // Adding IF NOT EXISTS, if required. + if (isset($GLOBALS['sql_if_not_exists'])) { + $create_query = preg_replace( + '/^CREATE TABLE/', + 'CREATE TABLE IF NOT EXISTS', + $create_query + ); + } + + // Making the query MSSQL compatible. + if ($compat == 'MSSQL') { + $create_query = $this->_makeCreateTableMSSQLCompatible( + $create_query + ); + } + + // Views have no constraints, indexes, etc. They do not require any + // analysis. + if (!$view) { + + if (empty($sql_backquotes)) { + // Option "Enclose table and column names with backquotes" + // was checked. + Context::$MODE |= Context::SQL_MODE_NO_ENCLOSING_QUOTES; + } + + // Using appropriate quotes. + if (($compat === 'MSSQL') || ($sql_backquotes === '"')) { + Context::$MODE |= Context::SQL_MODE_ANSI_QUOTES; + } + } + + /** + * Parser used for analysis. + * + * @var Parser + */ + $parser = new Parser($create_query); + + /** + * `CREATE TABLE` statement. + * + * @var SelectStatement + */ + $statement = $parser->statements[0]; + + if (!empty($statement->entityOptions)) { + $engine = $statement->entityOptions->has('ENGINE'); + } else { + $engine = ''; + } + + /* Avoid operation on ARCHIVE tables as those can not be altered */ + if (!empty($statement->fields) && (empty($engine) || strtoupper($engine) != 'ARCHIVE')) { + + /** + * Fragments containining definition of each constraint. + * + * @var array + */ + $constraints = array(); + + /** + * Fragments containining definition of each index. + * + * @var array + */ + $indexes = array(); + + /** + * Fragments containining definition of each FULLTEXT index. + * + * @var array + */ + $indexes_fulltext = array(); + + /** + * Fragments containining definition of each foreign key that will + * be dropped. + * + * @var array + */ + $dropped = array(); + + /** + * Fragment containining definition of the `AUTO_INCREMENT`. + * + * @var array + */ + $auto_increment = array(); + + // Scanning each field of the `CREATE` statement to fill the arrays + // above. + // If the field is used in any of the arrays above, it is removed + // from the original definition. + // Also, AUTO_INCREMENT attribute is removed. + /** @var CreateDefinition $field */ + foreach ($statement->fields as $key => $field) { + + if ($field->isConstraint) { + // Creating the parts that add constraints. + $constraints[] = $field::build($field); + unset($statement->fields[$key]); + } elseif (!empty($field->key)) { + // Creating the parts that add indexes (must not be + // constraints). + if ($field->key->type === 'FULLTEXT KEY') { + $indexes_fulltext[] = $field->build($field); + unset($statement->fields[$key]); + } else { + if (empty($GLOBALS['sql_if_not_exists'])) { + $indexes[] = str_replace( + 'COMMENT=\'', 'COMMENT \'', $field::build($field) + ); + unset($statement->fields[$key]); + } + } + } + + // Creating the parts that drop foreign keys. + if (!empty($field->key)) { + if ($field->key->type === 'FOREIGN KEY') { + $dropped[] = 'FOREIGN KEY ' . Context::escape( + $field->name + ); + unset($statement->fields[$key]); + } + } + + // Dropping AUTO_INCREMENT. + if (!empty($field->options)) { + if ($field->options->has('AUTO_INCREMENT') + && empty($GLOBALS['sql_if_not_exists']) + ) { + + $auto_increment[] = $field::build($field); + $field->options->remove('AUTO_INCREMENT'); + } + } + } + + /** + * The header of the `ALTER` statement (`ALTER TABLE tbl`). + * + * @var string + */ + $alter_header = 'ALTER TABLE ' . + Util::backquoteCompat( + $table_alias, + $compat, + $sql_backquotes + ); + + /** + * The footer of the `ALTER` statement (usually ';') + * + * @var string + */ + $alter_footer = ';' . $crlf; + + // Generating constraints-related query. + if (!empty($constraints)) { + $sql_constraints_query = $alter_header . $crlf . ' ADD ' + . implode(',' . $crlf . ' ADD ', $constraints) + . $alter_footer; + + $sql_constraints = $this->generateComment( + $crlf, + $sql_constraints, + __('Constraints for dumped tables'), + __('Constraints for table'), + $table_alias, + $compat + ) . $sql_constraints_query; + } + + // Generating indexes-related query. + $sql_indexes_query = ''; + + if (!empty($indexes)) { + $sql_indexes_query .= $alter_header . $crlf . ' ADD ' + . implode(',' . $crlf . ' ADD ', $indexes) + . $alter_footer; + } + + if (!empty($indexes_fulltext)) { + // InnoDB supports one FULLTEXT index creation at a time. + // So FULLTEXT indexes are created one-by-one after other + // indexes where created. + $sql_indexes_query .= $alter_header . + ' ADD ' . implode( + $alter_footer . $alter_header . ' ADD ', + $indexes_fulltext + ) . $alter_footer; + } + + if ((!empty($indexes)) || (!empty($indexes_fulltext))) { + $sql_indexes = $this->generateComment( + $crlf, + $sql_indexes, + __('Indexes for dumped tables'), + __('Indexes for table'), + $table_alias, + $compat + ) . $sql_indexes_query; + } + + // Generating drop foreign keys-related query. + if (!empty($dropped)) { + $sql_drop_foreign_keys = $alter_header . $crlf . ' DROP ' + . implode(',' . $crlf . ' DROP ', $dropped) + . $alter_footer; + } + + // Generating auto-increment-related query. + if ((! empty($auto_increment)) && ($update_indexes_increments)) { + $sql_auto_increments_query = $alter_header . $crlf . ' MODIFY ' + . implode(',' . $crlf . ' MODIFY ', $auto_increment); + if (isset($GLOBALS['sql_auto_increment']) + && ($statement->entityOptions->has('AUTO_INCREMENT') !== false) + ) { + if (!isset($GLOBALS['table_data']) + || (isset($GLOBALS['table_data']) + && in_array($table, $GLOBALS['table_data'])) + ) { + $sql_auto_increments_query .= ', AUTO_INCREMENT=' + . $statement->entityOptions->has('AUTO_INCREMENT'); + } + } + $sql_auto_increments_query .= ';' . $crlf; + + $sql_auto_increments = $this->generateComment( + $crlf, + $sql_auto_increments, + __('AUTO_INCREMENT for dumped tables'), + __('AUTO_INCREMENT for table'), + $table_alias, + $compat + ) . $sql_auto_increments_query; + } + + // Removing the `AUTO_INCREMENT` attribute from the `CREATE TABLE` + // too. + if (!empty($statement->entityOptions) + && (empty($GLOBALS['sql_if_not_exists']) + || empty($GLOBALS['sql_auto_increment'])) + ) { + $statement->entityOptions->remove('AUTO_INCREMENT'); + } + + // Rebuilding the query. + $create_query = $statement->build(); + } + + $schema_create .= $create_query; + } + + $GLOBALS['dbi']->freeResult($result); + + // Restoring old mode. + Context::$MODE = $old_mode; + + return $warning . $schema_create . ($add_semicolon ? ';' . $crlf : ''); + } // end of the 'getTableDef()' function + + /** + * Returns $table's comments, relations etc. + * + * @param string $db database name + * @param string $table table name + * @param string $crlf end of line sequence + * @param bool $do_relation whether to include relation comments + * @param bool $do_mime whether to include mime comments + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting comments + */ + private function _getTableComments( + $db, + $table, + $crlf, + $do_relation = false, + $do_mime = false, + array $aliases = array() + ) { + global $cfgRelation, $sql_backquotes; + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + $schema_create = ''; + + // Check if we can use Relations + list($res_rel, $have_rel) = $this->relation->getRelationsAndStatus( + $do_relation && !empty($cfgRelation['relation']), + $db, + $table + ); + + if ($do_mime && $cfgRelation['mimework']) { + if (!($mime_map = Transformations::getMIME($db, $table, true))) { + unset($mime_map); + } + } + + if (isset($mime_map) && count($mime_map) > 0) { + $schema_create .= $this->_possibleCRLF() + . $this->_exportComment() + . $this->_exportComment( + __('MIME TYPES FOR TABLE') . ' ' + . Util::backquote($table, $sql_backquotes) . ':' + ); + foreach ($mime_map as $mime_field => $mime) { + $schema_create .= $this->_exportComment( + ' ' + . Util::backquote($mime_field, $sql_backquotes) + ) + . $this->_exportComment( + ' ' + . Util::backquote( + $mime['mimetype'], + $sql_backquotes + ) + ); + } + $schema_create .= $this->_exportComment(); + } + + if ($have_rel) { + $schema_create .= $this->_possibleCRLF() + . $this->_exportComment() + . $this->_exportComment( + __('RELATIONSHIPS FOR TABLE') . ' ' + . Util::backquote($table_alias, $sql_backquotes) + . ':' + ); + + foreach ($res_rel as $rel_field => $rel) { + if ($rel_field != 'foreign_keys_data') { + $rel_field_alias = !empty( + $aliases[$db]['tables'][$table]['columns'][$rel_field] + ) ? $aliases[$db]['tables'][$table]['columns'][$rel_field] + : $rel_field; + $schema_create .= $this->_exportComment( + ' ' + . Util::backquote( + $rel_field_alias, + $sql_backquotes + ) + ) + . $this->_exportComment( + ' ' + . Util::backquote( + $rel['foreign_table'], + $sql_backquotes + ) + . ' -> ' + . Util::backquote( + $rel['foreign_field'], + $sql_backquotes + ) + ); + } else { + foreach ($rel as $one_key) { + foreach ($one_key['index_list'] as $index => $field) { + $rel_field_alias = !empty( + $aliases[$db]['tables'][$table]['columns'][$field] + ) ? $aliases[$db]['tables'][$table]['columns'][$field] + : $field; + $schema_create .= $this->_exportComment( + ' ' + . Util::backquote( + $rel_field_alias, + $sql_backquotes + ) + ) + . $this->_exportComment( + ' ' + . Util::backquote( + $one_key['ref_table_name'], + $sql_backquotes + ) + . ' -> ' + . Util::backquote( + $one_key['ref_index_list'][$index], + $sql_backquotes + ) + ); + } + } + } + } + $schema_create .= $this->_exportComment(); + } + + return $schema_create; + } // end of the '_getTableComments()' function + + /** + * Outputs table's structure + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $export_mode 'create_table','triggers','create_view', + * 'stand_in' + * @param string $export_type 'server', 'database', 'table' + * @param bool $relation whether to include relation comments + * @param bool $comments whether to include the pmadb-style column + * comments as comments in the structure; this is + * deprecated but the parameter is left here + * because export.php calls exportStructure() + * also for other export types which use this + * parameter + * @param bool $mime whether to include mime comments + * @param bool $dates whether to include creation/update/check dates + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportStructure( + $db, + $table, + $crlf, + $error_url, + $export_mode, + $export_type, + $relation = false, + $comments = false, + $mime = false, + $dates = false, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + if (isset($GLOBALS['sql_compatibility'])) { + $compat = $GLOBALS['sql_compatibility']; + } else { + $compat = 'NONE'; + } + + $formatted_table_name = Util::backquoteCompat( + $table_alias, + $compat, + isset($GLOBALS['sql_backquotes']) + ); + $dump = $this->_possibleCRLF() + . $this->_exportComment(str_repeat('-', 56)) + . $this->_possibleCRLF() + . $this->_exportComment(); + + switch ($export_mode) { + case 'create_table': + $dump .= $this->_exportComment( + __('Table structure for table') . ' ' . $formatted_table_name + ); + $dump .= $this->_exportComment(); + $dump .= $this->getTableDef( + $db, + $table, + $crlf, + $error_url, + $dates, + true, + false, + true, + $aliases + ); + $dump .= $this->_getTableComments( + $db, + $table, + $crlf, + $relation, + $mime, + $aliases + ); + break; + case 'triggers': + $dump = ''; + $delimiter = '$$'; + $triggers = $GLOBALS['dbi']->getTriggers($db, $table, $delimiter); + if ($triggers) { + $dump .= $this->_possibleCRLF() + . $this->_exportComment() + . $this->_exportComment( + __('Triggers') . ' ' . $formatted_table_name + ) + . $this->_exportComment(); + $used_alias = false; + $trigger_query = ''; + foreach ($triggers as $trigger) { + if (!empty($GLOBALS['sql_drop_table'])) { + $trigger_query .= $trigger['drop'] . ';' . $crlf; + } + + $trigger_query .= 'DELIMITER ' . $delimiter . $crlf; + $trigger_query .= $this->replaceWithAliases( + $trigger['create'], + $aliases, + $db, + $table, + $flag + ); + if ($flag) { + $used_alias = true; + } + $trigger_query .= 'DELIMITER ;' . $crlf; + } + // One warning per table. + if ($used_alias) { + $dump .= $this->_exportComment( + __('It appears your table uses triggers;') + ) + . $this->_exportComment( + __('alias export may not work reliably in all cases.') + ) + . $this->_exportComment(); + } + $dump .= $trigger_query; + } + break; + case 'create_view': + if (empty($GLOBALS['sql_views_as_tables'])) { + $dump .= $this->_exportComment( + __('Structure for view') + . ' ' + . $formatted_table_name + ) + . $this->_exportComment(); + // delete the stand-in table previously created (if any) + if ($export_type != 'table') { + $dump .= 'DROP TABLE IF EXISTS ' + . Util::backquote($table_alias) . ';' . $crlf; + } + $dump .= $this->getTableDef( + $db, + $table, + $crlf, + $error_url, + $dates, + true, + true, + true, + $aliases + ); + } else { + $dump .= $this->_exportComment( + sprintf( + __('Structure for view %s exported as a table'), + $formatted_table_name + ) + ) + . $this->_exportComment(); + // delete the stand-in table previously created (if any) + if ($export_type != 'table') { + $dump .= 'DROP TABLE IF EXISTS ' + . Util::backquote($table_alias) . ';' . $crlf; + } + $dump .= $this->_getTableDefForView( + $db, + $table, + $crlf, + true, + $aliases + ); + } + break; + case 'stand_in': + $dump .= $this->_exportComment( + __('Stand-in structure for view') . ' ' . $formatted_table_name + ) + . $this->_exportComment( + __('(See below for the actual view)') + ) + . $this->_exportComment(); + // export a stand-in definition to resolve view dependencies + $dump .= $this->getTableDefStandIn($db, $table, $crlf, $aliases); + } // end switch + + // this one is built by getTableDef() to use in table copy/move + // but not in the case of export + unset($GLOBALS['sql_constraints_query']); + + return Export::outputHandler($dump); + } + + /** + * Outputs the content of a table in SQL format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + global $current_row, $sql_backquotes; + + // Do not export data for merge tables + if ($GLOBALS['dbi']->getTable($db, $table)->isMerge()) { + return true; + } + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + if (isset($GLOBALS['sql_compatibility'])) { + $compat = $GLOBALS['sql_compatibility']; + } else { + $compat = 'NONE'; + } + + $formatted_table_name = Util::backquoteCompat( + $table_alias, + $compat, + $sql_backquotes + ); + + // Do not export data for a VIEW, unless asked to export the view as a table + // (For a VIEW, this is called only when exporting a single VIEW) + if ($GLOBALS['dbi']->getTable($db, $table)->isView() + && empty($GLOBALS['sql_views_as_tables']) + ) { + $head = $this->_possibleCRLF() + . $this->_exportComment() + . $this->_exportComment('VIEW ' . ' ' . $formatted_table_name) + . $this->_exportComment(__('Data:') . ' ' . __('None')) + . $this->_exportComment() + . $this->_possibleCRLF(); + + return Export::outputHandler($head); + } + + $result = $GLOBALS['dbi']->tryQuery( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + // a possible error: the table has crashed + $tmp_error = $GLOBALS['dbi']->getError(); + if ($tmp_error) { + $message = sprintf(__('Error reading data for table %s:'), "$db.$table"); + $message .= ' ' . $tmp_error; + if (! defined('TESTSUITE')) { + trigger_error($message, E_USER_ERROR); + } + return Export::outputHandler( + $this->_exportComment($message) + ); + } + + if ($result == false) { + $GLOBALS['dbi']->freeResult($result); + + return true; + } + + $fields_cnt = $GLOBALS['dbi']->numFields($result); + + // Get field information + $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); + $field_flags = array(); + for ($j = 0; $j < $fields_cnt; $j++) { + $field_flags[$j] = $GLOBALS['dbi']->fieldFlags($result, $j); + } + + $field_set = array(); + for ($j = 0; $j < $fields_cnt; $j++) { + $col_as = $fields_meta[$j]->name; + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $field_set[$j] = Util::backquoteCompat( + $col_as, + $compat, + $sql_backquotes + ); + } + + if (isset($GLOBALS['sql_type']) + && $GLOBALS['sql_type'] == 'UPDATE' + ) { + // update + $schema_insert = 'UPDATE '; + if (isset($GLOBALS['sql_ignore'])) { + $schema_insert .= 'IGNORE '; + } + // avoid EOL blank + $schema_insert .= Util::backquoteCompat( + $table_alias, + $compat, + $sql_backquotes + ) . ' SET'; + } else { + // insert or replace + if (isset($GLOBALS['sql_type']) + && $GLOBALS['sql_type'] == 'REPLACE' + ) { + $sql_command = 'REPLACE'; + } else { + $sql_command = 'INSERT'; + } + + // delayed inserts? + if (isset($GLOBALS['sql_delayed'])) { + $insert_delayed = ' DELAYED'; + } else { + $insert_delayed = ''; + } + + // insert ignore? + if (isset($GLOBALS['sql_type']) + && $GLOBALS['sql_type'] == 'INSERT' + && isset($GLOBALS['sql_ignore']) + ) { + $insert_delayed .= ' IGNORE'; + } + //truncate table before insert + if (isset($GLOBALS['sql_truncate']) + && $GLOBALS['sql_truncate'] + && $sql_command == 'INSERT' + ) { + $truncate = 'TRUNCATE TABLE ' + . Util::backquoteCompat( + $table_alias, + $compat, + $sql_backquotes + ) . ";"; + $truncatehead = $this->_possibleCRLF() + . $this->_exportComment() + . $this->_exportComment( + __('Truncate table before insert') . ' ' + . $formatted_table_name + ) + . $this->_exportComment() + . $crlf; + Export::outputHandler($truncatehead); + Export::outputHandler($truncate); + } + + // scheme for inserting fields + if ($GLOBALS['sql_insert_syntax'] == 'complete' + || $GLOBALS['sql_insert_syntax'] == 'both' + ) { + $fields = implode(', ', $field_set); + $schema_insert = $sql_command . $insert_delayed . ' INTO ' + . Util::backquoteCompat( + $table_alias, + $compat, + $sql_backquotes + ) + // avoid EOL blank + . ' (' . $fields . ') VALUES'; + } else { + $schema_insert = $sql_command . $insert_delayed . ' INTO ' + . Util::backquoteCompat( + $table_alias, + $compat, + $sql_backquotes + ) + . ' VALUES'; + } + } + + //\x08\\x09, not required + $current_row = 0; + $query_size = 0; + if (($GLOBALS['sql_insert_syntax'] == 'extended' + || $GLOBALS['sql_insert_syntax'] == 'both') + && (!isset($GLOBALS['sql_type']) + || $GLOBALS['sql_type'] != 'UPDATE') + ) { + $separator = ','; + $schema_insert .= $crlf; + } else { + $separator = ';'; + } + + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + if ($current_row == 0) { + $head = $this->_possibleCRLF() + . $this->_exportComment() + . $this->_exportComment( + __('Dumping data for table') . ' ' + . $formatted_table_name + ) + . $this->_exportComment() + . $crlf; + if (!Export::outputHandler($head)) { + return false; + } + } + // We need to SET IDENTITY_INSERT ON for MSSQL + if (isset($GLOBALS['sql_compatibility']) + && $GLOBALS['sql_compatibility'] == 'MSSQL' + && $current_row == 0 + ) { + if (!Export::outputHandler( + 'SET IDENTITY_INSERT ' + . Util::backquoteCompat( + $table_alias, + $compat, + $sql_backquotes + ) + . ' ON ;' . $crlf + ) + ) { + return false; + } + } + $current_row++; + $values = array(); + for ($j = 0; $j < $fields_cnt; $j++) { + // NULL + if (!isset($row[$j]) || is_null($row[$j])) { + $values[] = 'NULL'; + } elseif ($fields_meta[$j]->numeric + && $fields_meta[$j]->type != 'timestamp' + && !$fields_meta[$j]->blob + ) { + // a number + // timestamp is numeric on some MySQL 4.1, BLOBs are + // sometimes numeric + $values[] = $row[$j]; + } elseif (stristr($field_flags[$j], 'BINARY') !== false + && isset($GLOBALS['sql_hex_for_binary']) + ) { + // a true BLOB + // - mysqldump only generates hex data when the --hex-blob + // option is used, for fields having the binary attribute + // no hex is generated + // - a TEXT field returns type blob but a real blob + // returns also the 'binary' flag + + // empty blobs need to be different, but '0' is also empty + // :-( + if (empty($row[$j]) && $row[$j] != '0') { + $values[] = '\'\''; + } else { + $values[] = '0x' . bin2hex($row[$j]); + } + } elseif ($fields_meta[$j]->type == 'bit') { + // detection of 'bit' works only on mysqli extension + $values[] = "b'" . $GLOBALS['dbi']->escapeString( + Util::printableBitValue( + $row[$j], + $fields_meta[$j]->length + ) + ) + . "'"; + } elseif ($fields_meta[$j]->type === 'geometry') { + // export GIS types as hex + $values[] = '0x' . bin2hex($row[$j]); + } elseif (!empty($GLOBALS['exporting_metadata']) + && $row[$j] == '@LAST_PAGE' + ) { + $values[] = '@LAST_PAGE'; + } else { + // something else -> treat as a string + $values[] = '\'' + . $GLOBALS['dbi']->escapeString($row[$j]) + . '\''; + } // end if + } // end for + + // should we make update? + if (isset($GLOBALS['sql_type']) + && $GLOBALS['sql_type'] == 'UPDATE' + ) { + + $insert_line = $schema_insert; + for ($i = 0; $i < $fields_cnt; $i++) { + if (0 == $i) { + $insert_line .= ' '; + } + if ($i > 0) { + // avoid EOL blank + $insert_line .= ','; + } + $insert_line .= $field_set[$i] . ' = ' . $values[$i]; + } + + list($tmp_unique_condition, $tmp_clause_is_unique) + = Util::getUniqueCondition( + $result, // handle + $fields_cnt, // fields_cnt + $fields_meta, // fields_meta + $row, // row + false, // force_unique + false, // restrict_to_table + null // analyzed_sql_results + ); + $insert_line .= ' WHERE ' . $tmp_unique_condition; + unset($tmp_unique_condition, $tmp_clause_is_unique); + } else { + + // Extended inserts case + if ($GLOBALS['sql_insert_syntax'] == 'extended' + || $GLOBALS['sql_insert_syntax'] == 'both' + ) { + if ($current_row == 1) { + $insert_line = $schema_insert . '(' + . implode(', ', $values) . ')'; + } else { + $insert_line = '(' . implode(', ', $values) . ')'; + $insertLineSize = mb_strlen($insert_line); + $sql_max_size = $GLOBALS['sql_max_query_size']; + if (isset($sql_max_size) + && $sql_max_size > 0 + && $query_size + $insertLineSize > $sql_max_size + ) { + if (!Export::outputHandler(';' . $crlf)) { + return false; + } + $query_size = 0; + $current_row = 1; + $insert_line = $schema_insert . $insert_line; + } + } + $query_size += mb_strlen($insert_line); + // Other inserts case + } else { + $insert_line = $schema_insert + . '(' . implode(', ', $values) . ')'; + } + } + unset($values); + + if (!Export::outputHandler( + ($current_row == 1 ? '' : $separator . $crlf) + . $insert_line + ) + ) { + return false; + } + } // end while + + if ($current_row > 0) { + if (!Export::outputHandler(';' . $crlf)) { + return false; + } + } + + // We need to SET IDENTITY_INSERT OFF for MSSQL + if (isset($GLOBALS['sql_compatibility']) + && $GLOBALS['sql_compatibility'] == 'MSSQL' + && $current_row > 0 + ) { + $outputSucceeded = Export::outputHandler( + $crlf . 'SET IDENTITY_INSERT ' + . Util::backquoteCompat( + $table_alias, + $compat, + $sql_backquotes + ) + . ' OFF;' . $crlf + ); + if (!$outputSucceeded) { + return false; + } + } + + $GLOBALS['dbi']->freeResult($result); + + return true; + } // end of the 'exportData()' function + + /** + * Make a create table statement compatible with MSSQL + * + * @param string $create_query MySQL create table statement + * + * @return string MSSQL compatible create table statement + */ + private function _makeCreateTableMSSQLCompatible($create_query) + { + // In MSSQL + // 1. No 'IF NOT EXISTS' in CREATE TABLE + // 2. DATE field doesn't exists, we will use DATETIME instead + // 3. UNSIGNED attribute doesn't exist + // 4. No length on INT, TINYINT, SMALLINT, BIGINT and no precision on + // FLOAT fields + // 5. No KEY and INDEX inside CREATE TABLE + // 6. DOUBLE field doesn't exists, we will use FLOAT instead + + $create_query = preg_replace( + "/^CREATE TABLE IF NOT EXISTS/", + 'CREATE TABLE', + $create_query + ); + // first we need to replace all lines ended with '" DATE ...,\n' + // last preg_replace preserve us from situation with date text + // inside DEFAULT field value + $create_query = preg_replace( + "/\" date DEFAULT NULL(,)?\n/", + '" datetime DEFAULT NULL$1' . "\n", + $create_query + ); + $create_query = preg_replace( + "/\" date NOT NULL(,)?\n/", + '" datetime NOT NULL$1' . "\n", + $create_query + ); + $create_query = preg_replace( + '/" date NOT NULL DEFAULT \'([^\'])/', + '" datetime NOT NULL DEFAULT \'$1', + $create_query + ); + + // next we need to replace all lines ended with ') UNSIGNED ...,' + // last preg_replace preserve us from situation with unsigned text + // inside DEFAULT field value + $create_query = preg_replace( + "/\) unsigned NOT NULL(,)?\n/", + ') NOT NULL$1' . "\n", + $create_query + ); + $create_query = preg_replace( + "/\) unsigned DEFAULT NULL(,)?\n/", + ') DEFAULT NULL$1' . "\n", + $create_query + ); + $create_query = preg_replace( + '/\) unsigned NOT NULL DEFAULT \'([^\'])/', + ') NOT NULL DEFAULT \'$1', + $create_query + ); + + // we need to replace all lines ended with + // '" INT|TINYINT([0-9]{1,}) ...,' last preg_replace preserve us + // from situation with int([0-9]{1,}) text inside DEFAULT field + // value + $create_query = preg_replace( + '/" (int|tinyint|smallint|bigint)\([0-9]+\) DEFAULT NULL(,)?\n/', + '" $1 DEFAULT NULL$2' . "\n", + $create_query + ); + $create_query = preg_replace( + '/" (int|tinyint|smallint|bigint)\([0-9]+\) NOT NULL(,)?\n/', + '" $1 NOT NULL$2' . "\n", + $create_query + ); + $create_query = preg_replace( + '/" (int|tinyint|smallint|bigint)\([0-9]+\) NOT NULL DEFAULT \'([^\'])/', + '" $1 NOT NULL DEFAULT \'$2', + $create_query + ); + + // we need to replace all lines ended with + // '" FLOAT|DOUBLE([0-9,]{1,}) ...,' + // last preg_replace preserve us from situation with + // float([0-9,]{1,}) text inside DEFAULT field value + $create_query = preg_replace( + '/" (float|double)(\([0-9]+,[0-9,]+\))? DEFAULT NULL(,)?\n/', + '" float DEFAULT NULL$3' . "\n", + $create_query + ); + $create_query = preg_replace( + '/" (float|double)(\([0-9,]+,[0-9,]+\))? NOT NULL(,)?\n/', + '" float NOT NULL$3' . "\n", + $create_query + ); + $create_query = preg_replace( + '/" (float|double)(\([0-9,]+,[0-9,]+\))? NOT NULL DEFAULT \'([^\'])/', + '" float NOT NULL DEFAULT \'$3', + $create_query + ); + + // @todo remove indexes from CREATE TABLE + + return $create_query; + } + + /** + * replaces db/table/column names with their aliases + * + * @param string $sql_query SQL query in which aliases are to be substituted + * @param array $aliases Alias information for db/table/column + * @param string $db the database name + * @param string $table the tablename + * @param string &$flag the flag denoting whether any replacement was done + * + * @return string query replaced with aliases + */ + public function replaceWithAliases( + $sql_query, + array $aliases, + $db, + $table = '', + &$flag = null + ) { + $flag = false; + + /** + * The parser of this query. + * + * @var Parser $parser + */ + $parser = new Parser($sql_query); + + if (empty($parser->statements[0])) { + return $sql_query; + } + + /** + * The statement that represents the query. + * + * @var \PhpMyAdmin\SqlParser\Statements\CreateStatement $statement + */ + $statement = $parser->statements[0]; + + /** + * Old database name. + * + * @var string $old_database + */ + $old_database = $db; + + // Replacing aliases in `CREATE TABLE` statement. + if ($statement->options->has('TABLE')) { + + // Extracting the name of the old database and table from the + // statement to make sure the parameters are corect. + if (!empty($statement->name->database)) { + $old_database = $statement->name->database; + } + + /** + * Old table name. + * + * @var string $old_table + */ + $old_table = $statement->name->table; + + // Finding the aliased database name. + // The database might be empty so we have to add a few checks. + $new_database = null; + if (!empty($statement->name->database)) { + $new_database = $statement->name->database; + if (!empty($aliases[$old_database]['alias'])) { + $new_database = $aliases[$old_database]['alias']; + } + } + + // Finding the aliases table name. + $new_table = $old_table; + if (!empty($aliases[$old_database]['tables'][$old_table]['alias'])) { + $new_table = $aliases[$old_database]['tables'][$old_table]['alias']; + } + + // Replacing new values. + if (($statement->name->database !== $new_database) + || ($statement->name->table !== $new_table) + ) { + $statement->name->database = $new_database; + $statement->name->table = $new_table; + $statement->name->expr = null; // Force rebuild. + $flag = true; + } + + foreach ($statement->fields as $field) { + + // Column name. + if (!empty($field->type)) { + if (!empty($aliases[$old_database]['tables'][$old_table]['columns'][$field->name])) { + $field->name = $aliases[$old_database]['tables'] + [$old_table]['columns'][$field->name]; + $flag = true; + } + } + + // Key's columns. + if (!empty($field->key)) { + foreach ($field->key->columns as $key => $column) { + if (!empty($aliases[$old_database]['tables'][$old_table]['columns'][$column['name']])) { + $field->key->columns[$key]['name'] = $aliases[$old_database] + ['tables'][$old_table]['columns'][$column['name']]; + $flag = true; + } + } + } + + // References. + if (!empty($field->references)) { + $ref_table = $field->references->table->table; + // Replacing table. + if (!empty($aliases[$old_database]['tables'][$ref_table]['alias'])) { + $field->references->table->table + = $aliases[$old_database]['tables'][$ref_table]['alias']; + $field->references->table->expr = null; + $flag = true; + } + // Replacing column names. + foreach ($field->references->columns as $key => $column) { + if (!empty($aliases[$old_database]['tables'][$ref_table]['columns'][$column])) { + $field->references->columns[$key] + = $aliases[$old_database]['tables'][$ref_table]['columns'][$column]; + $flag = true; + } + } + } + } + } elseif ($statement->options->has('TRIGGER')) { + + // Extracting the name of the old database and table from the + // statement to make sure the parameters are corect. + if (!empty($statement->table->database)) { + $old_database = $statement->table->database; + } + + /** + * Old table name. + * + * @var string $old_table + */ + $old_table = $statement->table->table; + + if (!empty($aliases[$old_database]['tables'][$old_table]['alias'])) { + $statement->table->table + = $aliases[$old_database]['tables'][$old_table]['alias']; + $statement->table->expr = null; // Force rebuild. + $flag = true; + } + } + + if (($statement->options->has('TRIGGER')) + || ($statement->options->has('PROCEDURE')) + || ($statement->options->has('FUNCTION')) + || ($statement->options->has('VIEW')) + ) { + + // Repalcing the body. + for ($i = 0, $count = count($statement->body); $i < $count; ++$i) { + + /** + * Token parsed at this moment. + * + * @var Token $token + */ + $token = $statement->body[$i]; + + // Replacing only symbols (that are not variables) and unknown + // identifiers. + if ((($token->type === Token::TYPE_SYMBOL) + && (!($token->flags & Token::FLAG_SYMBOL_VARIABLE))) + || ((($token->type === Token::TYPE_KEYWORD) + && (!($token->flags & Token::FLAG_KEYWORD_RESERVED))) + || ($token->type === Token::TYPE_NONE)) + ) { + $alias = $this->getAlias($aliases, $token->value); + if (!empty($alias)) { + // Replacing the token. + $token->token = Context::escape($alias); + $flag = true; + } + } + } + } + + return $statement->build(); + } + + /** + * Generate comment + * + * @param string $crlf Carriage return character + * @param string $sql_statement SQL statement + * @param string $comment1 Comment for dumped table + * @param string $comment2 Comment for current table + * @param string $table_alias Table alias + * @param string $compat Compatibility mode + * + * @return string + */ + protected function generateComment( + $crlf, + $sql_statement, + $comment1, + $comment2, + $table_alias, + $compat + ) { + if (!isset($sql_statement)) { + if (isset($GLOBALS['no_constraints_comments'])) { + $sql_statement = ''; + } else { + $sql_statement = $crlf + . $this->_exportComment() + . $this->_exportComment($comment1) + . $this->_exportComment(); + } + } + + // comments for current table + if (!isset($GLOBALS['no_constraints_comments'])) { + $sql_statement .= $crlf + . $this->_exportComment() + . $this->_exportComment( + $comment2 . ' ' . Util::backquoteCompat( + $table_alias, + $compat, + isset($GLOBALS['sql_backquotes']) + ) + ) + . $this->_exportComment(); + } + + return $sql_statement; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportTexytext.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportTexytext.php new file mode 100755 index 0000000..cef206f --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportTexytext.php @@ -0,0 +1,620 @@ +setProperties(); + } + + /** + * Sets the export Texy! text properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('Texy! text'); + $exportPluginProperties->setExtension('txt'); + $exportPluginProperties->setMimeType('text/plain'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // what to dump (structure/data/both) main group + $dumpWhat = new OptionsPropertyMainGroup( + "general_opts", __('Dump table') + ); + // create primary items and add them to the group + $leaf = new RadioPropertyItem("structure_or_data"); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data'), + ) + ); + $dumpWhat->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($dumpWhat); + + // data options main group + $dataOptions = new OptionsPropertyMainGroup( + "data", __('Data dump options') + ); + $dataOptions->setForce('structure'); + // create primary items and add them to the group + $leaf = new BoolPropertyItem( + "columns", + __('Put columns names in the first row') + ); + $dataOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + 'null', + __('Replace NULL with:') + ); + $dataOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($dataOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + return true; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Alias of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + if (empty($db_alias)) { + $db_alias = $db; + } + + return Export::outputHandler( + '===' . __('Database') . ' ' . $db_alias . "\n\n" + ); + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in NHibernate format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + global $what; + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + + if (!Export::outputHandler( + '== ' . __('Dumping data for table') . ' ' . $table_alias . "\n\n" + ) + ) { + return false; + } + + // Gets the data from the database + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $fields_cnt = $GLOBALS['dbi']->numFields($result); + + // If required, get fields name at the first line + if (isset($GLOBALS[$what . '_columns'])) { + $text_output = "|------\n"; + for ($i = 0; $i < $fields_cnt; $i++) { + $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $text_output .= '|' + . htmlspecialchars(stripslashes($col_as)); + } // end for + $text_output .= "\n|------\n"; + if (!Export::outputHandler($text_output)) { + return false; + } + } // end if + + // Format the data + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $text_output = ''; + for ($j = 0; $j < $fields_cnt; $j++) { + if (!isset($row[$j]) || is_null($row[$j])) { + $value = $GLOBALS[$what . '_null']; + } elseif ($row[$j] == '0' || $row[$j] != '') { + $value = $row[$j]; + } else { + $value = ' '; + } + $text_output .= '|' + . str_replace( + '|', + '|', + htmlspecialchars($value) + ); + } // end for + $text_output .= "\n"; + if (!Export::outputHandler($text_output)) { + return false; + } + } // end while + $GLOBALS['dbi']->freeResult($result); + + return true; + } + + /** + * Returns a stand-in CREATE definition to resolve view dependencies + * + * @param string $db the database name + * @param string $view the view name + * @param string $crlf the end of line sequence + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting definition + */ + public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) + { + $text_output = ''; + + /** + * Get the unique keys in the table + */ + $unique_keys = array(); + $keys = $GLOBALS['dbi']->getTableIndexes($db, $view); + foreach ($keys as $key) { + if ($key['Non_unique'] == 0) { + $unique_keys[] = $key['Column_name']; + } + } + + /** + * Gets fields properties + */ + $GLOBALS['dbi']->selectDb($db); + + /** + * Displays the table structure + */ + + $text_output .= "|------\n" + . '|' . __('Column') + . '|' . __('Type') + . '|' . __('Null') + . '|' . __('Default') + . "\n|------\n"; + + $columns = $GLOBALS['dbi']->getColumns($db, $view); + foreach ($columns as $column) { + $col_as = isset($column['Field']) ? $column['Field'] : null; + if (!empty($aliases[$db]['tables'][$view]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$view]['columns'][$col_as]; + } + $text_output .= $this->formatOneColumnDefinition( + $column, + $unique_keys, + $col_as + ); + $text_output .= "\n"; + } // end foreach + + return $text_output; + } + + /** + * Returns $table's CREATE definition + * + * @param string $db the database name + * @param string $table the table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * $this->exportStructure() also for other + * export types which use this parameter + * @param bool $do_mime whether to include mime comments + * @param bool $show_dates whether to include creation/update/check dates + * @param bool $add_semicolon whether to add semicolon and end-of-line + * at the end + * @param bool $view whether we're handling a view + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting schema + */ + public function getTableDef( + $db, + $table, + $crlf, + $error_url, + $do_relation, + $do_comments, + $do_mime, + $show_dates = false, + $add_semicolon = true, + $view = false, + array $aliases = array() + ) { + global $cfgRelation; + + $text_output = ''; + + /** + * Get the unique keys in the table + */ + $unique_keys = array(); + $keys = $GLOBALS['dbi']->getTableIndexes($db, $table); + foreach ($keys as $key) { + if ($key['Non_unique'] == 0) { + $unique_keys[] = $key['Column_name']; + } + } + + /** + * Gets fields properties + */ + $GLOBALS['dbi']->selectDb($db); + + // Check if we can use Relations + list($res_rel, $have_rel) = $this->relation->getRelationsAndStatus( + $do_relation && !empty($cfgRelation['relation']), + $db, + $table + ); + + /** + * Displays the table structure + */ + + $text_output .= "|------\n"; + $text_output .= '|' . __('Column'); + $text_output .= '|' . __('Type'); + $text_output .= '|' . __('Null'); + $text_output .= '|' . __('Default'); + if ($do_relation && $have_rel) { + $text_output .= '|' . __('Links to'); + } + if ($do_comments) { + $text_output .= '|' . __('Comments'); + $comments = $this->relation->getComments($db, $table); + } + if ($do_mime && $cfgRelation['mimework']) { + $text_output .= '|' . htmlspecialchars('MIME'); + $mime_map = Transformations::getMIME($db, $table, true); + } + $text_output .= "\n|------\n"; + + $columns = $GLOBALS['dbi']->getColumns($db, $table); + foreach ($columns as $column) { + $col_as = $column['Field']; + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $text_output .= $this->formatOneColumnDefinition( + $column, + $unique_keys, + $col_as + ); + $field_name = $column['Field']; + if ($do_relation && $have_rel) { + $text_output .= '|' . htmlspecialchars( + $this->getRelationString( + $res_rel, + $field_name, + $db, + $aliases + ) + ); + } + if ($do_comments && $cfgRelation['commwork']) { + $text_output .= '|' + . (isset($comments[$field_name]) + ? htmlspecialchars($comments[$field_name]) + : ''); + } + if ($do_mime && $cfgRelation['mimework']) { + $text_output .= '|' + . (isset($mime_map[$field_name]) + ? htmlspecialchars( + str_replace('_', '/', $mime_map[$field_name]['mimetype']) + ) + : ''); + } + + $text_output .= "\n"; + } // end foreach + + return $text_output; + } // end of the '$this->getTableDef()' function + + /** + * Outputs triggers + * + * @param string $db database name + * @param string $table table name + * + * @return string Formatted triggers list + */ + public function getTriggers($db, $table) + { + $dump = "|------\n"; + $dump .= '|' . __('Name'); + $dump .= '|' . __('Time'); + $dump .= '|' . __('Event'); + $dump .= '|' . __('Definition'); + $dump .= "\n|------\n"; + + $triggers = $GLOBALS['dbi']->getTriggers($db, $table); + + foreach ($triggers as $trigger) { + $dump .= '|' . $trigger['name']; + $dump .= '|' . $trigger['action_timing']; + $dump .= '|' . $trigger['event_manipulation']; + $dump .= '|' . + str_replace( + '|', + '|', + htmlspecialchars($trigger['definition']) + ); + $dump .= "\n"; + } + + return $dump; + } + + /** + * Outputs table's structure + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $export_mode 'create_table', 'triggers', 'create_view', + * 'stand_in' + * @param string $export_type 'server', 'database', 'table' + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * $this->exportStructure() also for other + * export types which use this parameter + * @param bool $do_mime whether to include mime comments + * @param bool $dates whether to include creation/update/check dates + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportStructure( + $db, + $table, + $crlf, + $error_url, + $export_mode, + $export_type, + $do_relation = false, + $do_comments = false, + $do_mime = false, + $dates = false, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + $dump = ''; + + switch ($export_mode) { + case 'create_table': + $dump .= '== ' . __('Table structure for table') . ' ' + . $table_alias . "\n\n"; + $dump .= $this->getTableDef( + $db, + $table, + $crlf, + $error_url, + $do_relation, + $do_comments, + $do_mime, + $dates, + true, + false, + $aliases + ); + break; + case 'triggers': + $dump = ''; + $triggers = $GLOBALS['dbi']->getTriggers($db, $table); + if ($triggers) { + $dump .= '== ' . __('Triggers') . ' ' . $table_alias . "\n\n"; + $dump .= $this->getTriggers($db, $table); + } + break; + case 'create_view': + $dump .= '== ' . __('Structure for view') . ' ' . $table_alias . "\n\n"; + $dump .= $this->getTableDef( + $db, + $table, + $crlf, + $error_url, + $do_relation, + $do_comments, + $do_mime, + $dates, + true, + true, + $aliases + ); + break; + case 'stand_in': + $dump .= '== ' . __('Stand-in structure for view') + . ' ' . $table . "\n\n"; + // export a stand-in definition to resolve view dependencies + $dump .= $this->getTableDefStandIn($db, $table, $crlf, $aliases); + } // end switch + + return Export::outputHandler($dump); + } + + /** + * Formats the definition for one column + * + * @param array $column info about this column + * @param array $unique_keys unique keys for this table + * @param string $col_alias Column Alias + * + * @return string Formatted column definition + */ + public function formatOneColumnDefinition( + $column, + $unique_keys, + $col_alias = '' + ) { + if (empty($col_alias)) { + $col_alias = $column['Field']; + } + $extracted_columnspec + = Util::extractColumnSpec($column['Type']); + $type = $extracted_columnspec['print_type']; + if (empty($type)) { + $type = ' '; + } + + if (!isset($column['Default'])) { + if ($column['Null'] != 'NO') { + $column['Default'] = 'NULL'; + } + } + + $fmt_pre = ''; + $fmt_post = ''; + if (in_array($column['Field'], $unique_keys)) { + $fmt_pre = '**' . $fmt_pre; + $fmt_post = $fmt_post . '**'; + } + if ($column['Key'] == 'PRI') { + $fmt_pre = '//' . $fmt_pre; + $fmt_post = $fmt_post . '//'; + } + $definition = '|' + . $fmt_pre . htmlspecialchars($col_alias) . $fmt_post; + $definition .= '|' . htmlspecialchars($type); + $definition .= '|' + . (($column['Null'] == '' || $column['Null'] == 'NO') + ? __('No') : __('Yes')); + $definition .= '|' + . htmlspecialchars( + isset($column['Default']) ? $column['Default'] : '' + ); + + return $definition; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportXml.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportXml.php new file mode 100755 index 0000000..b6ab2d9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportXml.php @@ -0,0 +1,584 @@ +setProperties(); + } + + /** + * Initialize the local variables that are used for export XML + * + * @return void + */ + protected function initSpecificVariables() + { + global $table, $tables; + $this->_setTable($table); + if (is_array($tables)) { + $this->_setTables($tables); + } + } + + /** + * Sets the export XML properties + * + * @return void + */ + protected function setProperties() + { + // create the export plugin property item + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('XML'); + $exportPluginProperties->setExtension('xml'); + $exportPluginProperties->setMimeType('text/xml'); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new HiddenPropertyItem("structure_or_data"); + $generalOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // export structure main group + $structure = new OptionsPropertyMainGroup( + "structure", __('Object creation options (all are recommended)') + ); + + // create primary items and add them to the group + $leaf = new BoolPropertyItem( + "export_events", + __('Events') + ); + $structure->addProperty($leaf); + $leaf = new BoolPropertyItem( + "export_functions", + __('Functions') + ); + $structure->addProperty($leaf); + $leaf = new BoolPropertyItem( + "export_procedures", + __('Procedures') + ); + $structure->addProperty($leaf); + $leaf = new BoolPropertyItem( + "export_tables", + __('Tables') + ); + $structure->addProperty($leaf); + $leaf = new BoolPropertyItem( + "export_triggers", + __('Triggers') + ); + $structure->addProperty($leaf); + $leaf = new BoolPropertyItem( + "export_views", + __('Views') + ); + $structure->addProperty($leaf); + $exportSpecificOptions->addProperty($structure); + + // data main group + $data = new OptionsPropertyMainGroup( + "data", __('Data dump options') + ); + // create primary items and add them to the group + $leaf = new BoolPropertyItem( + "export_contents", + __('Export contents') + ); + $data->addProperty($leaf); + $exportSpecificOptions->addProperty($data); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Generates output for SQL defintions of routines + * + * @param string $db Database name + * @param string $type Item type to be used in XML output + * @param string $dbitype Item type used in DBI qieries + * + * @return string XML with definitions + */ + private function _exportRoutines($db, $type, $dbitype) + { + // Export routines + $routines = $GLOBALS['dbi']->getProceduresOrFunctions( + $db, + $dbitype + ); + return $this->_exportDefinitions($db, $type, $dbitype, $routines); + } + + /** + * Generates output for SQL defintions + * + * @param string $db Database name + * @param string $type Item type to be used in XML output + * @param string $dbitype Item type used in DBI qieries + * @param array $names Names of items to export + * + * @return string XML with definitions + */ + private function _exportDefinitions($db, $type, $dbitype, array $names) + { + global $crlf; + + $head = ''; + + if ($names) { + foreach ($names as $name) { + $head .= ' ' . $crlf; + + // Do some formatting + $sql = $GLOBALS['dbi']->getDefinition($db, $dbitype, $name); + $sql = htmlspecialchars(rtrim($sql)); + $sql = str_replace("\n", "\n ", $sql); + + $head .= " " . $sql . $crlf; + $head .= ' ' . $crlf; + } + } + + return $head; + } + + /** + * Outputs export header. It is the first method to be called, so all + * the required variables are initialized here. + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + $this->initSpecificVariables(); + global $crlf, $cfg, $db; + $table = $this->_getTable(); + $tables = $this->_getTables(); + + $export_struct = isset($GLOBALS['xml_export_functions']) + || isset($GLOBALS['xml_export_procedures']) + || isset($GLOBALS['xml_export_tables']) + || isset($GLOBALS['xml_export_triggers']) + || isset($GLOBALS['xml_export_views']); + $export_data = isset($GLOBALS['xml_export_contents']) ? true : false; + + if ($GLOBALS['output_charset_conversion']) { + $charset = $GLOBALS['charset']; + } else { + $charset = 'utf-8'; + } + + $head = '' . $crlf + . '' . $crlf . $crlf; + + $head .= '' . $crlf; + + if ($export_struct) { + $result = $GLOBALS['dbi']->fetchResult( + 'SELECT `DEFAULT_CHARACTER_SET_NAME`, `DEFAULT_COLLATION_NAME`' + . ' FROM `information_schema`.`SCHEMATA` WHERE `SCHEMA_NAME`' + . ' = \'' . $GLOBALS['dbi']->escapeString($db) . '\' LIMIT 1' + ); + $db_collation = $result[0]['DEFAULT_COLLATION_NAME']; + $db_charset = $result[0]['DEFAULT_CHARACTER_SET_NAME']; + + $head .= ' ' . $crlf; + $head .= ' ' . $crlf; + $head .= ' ' . $crlf; + + if (is_null($tables)) { + $tables = array(); + } + + if (count($tables) === 0) { + $tables[] = $table; + } + + foreach ($tables as $table) { + // Export tables and views + $result = $GLOBALS['dbi']->fetchResult( + 'SHOW CREATE TABLE ' . Util::backquote($db) . '.' + . Util::backquote($table), + 0 + ); + $tbl = $result[$table][1]; + + $is_view = $GLOBALS['dbi']->getTable($db, $table) + ->isView(); + + if ($is_view) { + $type = 'view'; + } else { + $type = 'table'; + } + + if ($is_view && !isset($GLOBALS['xml_export_views'])) { + continue; + } + + if (!$is_view && !isset($GLOBALS['xml_export_tables'])) { + continue; + } + + $head .= ' ' + . $crlf; + + $tbl = " " . htmlspecialchars($tbl); + $tbl = str_replace("\n", "\n ", $tbl); + + $head .= $tbl . ';' . $crlf; + $head .= ' ' . $crlf; + + if (isset($GLOBALS['xml_export_triggers']) + && $GLOBALS['xml_export_triggers'] + ) { + // Export triggers + $triggers = $GLOBALS['dbi']->getTriggers($db, $table); + if ($triggers) { + foreach ($triggers as $trigger) { + $code = $trigger['create']; + $head .= ' ' . $crlf; + + // Do some formatting + $code = mb_substr(rtrim($code), 0, -3); + $code = " " . htmlspecialchars($code); + $code = str_replace("\n", "\n ", $code); + + $head .= $code . $crlf; + $head .= ' ' . $crlf; + } + + unset($trigger); + unset($triggers); + } + } + } + + if (isset($GLOBALS['xml_export_functions']) + && $GLOBALS['xml_export_functions'] + ) { + $head .= $this->_exportRoutines($db, 'function', 'FUNCTION'); + } + + if (isset($GLOBALS['xml_export_procedures']) + && $GLOBALS['xml_export_procedures'] + ) { + $head .= $this->_exportRoutines($db, 'procedure', 'PROCEDURE'); + } + + if (isset($GLOBALS['xml_export_events']) + && $GLOBALS['xml_export_events'] + ) { + // Export events + $events = $GLOBALS['dbi']->fetchResult( + "SELECT EVENT_NAME FROM information_schema.EVENTS " + . "WHERE EVENT_SCHEMA='" . $GLOBALS['dbi']->escapeString($db) + . "'" + ); + $head .= $this->_exportDefinitions( + $db, 'event', 'EVENT', $events + ); + } + + unset($result); + + $head .= ' ' . $crlf; + $head .= ' ' . $crlf; + + if ($export_data) { + $head .= $crlf; + } + } + + return Export::outputHandler($head); + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + $foot = ''; + + return Export::outputHandler($foot); + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + global $crlf; + + if (empty($db_alias)) { + $db_alias = $db; + } + if (isset($GLOBALS['xml_export_contents']) + && $GLOBALS['xml_export_contents'] + ) { + $head = ' ' . $crlf . ' ' . $crlf; + + return Export::outputHandler($head); + } + + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + global $crlf; + + if (isset($GLOBALS['xml_export_contents']) + && $GLOBALS['xml_export_contents'] + ) { + return Export::outputHandler(' ' . $crlf); + } + + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in XML format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + // Do not export data for merge tables + if ($GLOBALS['dbi']->getTable($db, $table)->isMerge()) { + return true; + } + + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + if (isset($GLOBALS['xml_export_contents']) + && $GLOBALS['xml_export_contents'] + ) { + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + + $columns_cnt = $GLOBALS['dbi']->numFields($result); + $columns = array(); + for ($i = 0; $i < $columns_cnt; $i++) { + $columns[$i] = stripslashes($GLOBALS['dbi']->fieldName($result, $i)); + } + unset($i); + + $buffer = ' ' . $crlf; + if (!Export::outputHandler($buffer)) { + return false; + } + + while ($record = $GLOBALS['dbi']->fetchRow($result)) { + $buffer = ' ' . $crlf; + for ($i = 0; $i < $columns_cnt; $i++) { + $col_as = $columns[$i]; + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as]) + ) { + $col_as + = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + // If a cell is NULL, still export it to preserve + // the XML structure + if (!isset($record[$i]) || is_null($record[$i])) { + $record[$i] = 'NULL'; + } + $buffer .= ' ' + . htmlspecialchars((string)$record[$i]) + . '' . $crlf; + } + $buffer .= '
    ' . $crlf; + + if (!Export::outputHandler($buffer)) { + return false; + } + } + $GLOBALS['dbi']->freeResult($result); + } + + return true; + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the table name + * + * @return string + */ + private function _getTable() + { + return $this->_table; + } + + /** + * Sets the table name + * + * @param string $table table name + * + * @return void + */ + private function _setTable($table) + { + $this->_table = $table; + } + + /** + * Gets the table names + * + * @return array + */ + private function _getTables() + { + return $this->_tables; + } + + /** + * Sets the table names + * + * @param array $tables table names + * + * @return void + */ + private function _setTables(array $tables) + { + $this->_tables = $tables; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/ExportYaml.php b/phpMyAdmin/libraries/classes/Plugins/Export/ExportYaml.php new file mode 100755 index 0000000..0e49fc6 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/ExportYaml.php @@ -0,0 +1,218 @@ +setProperties(); + } + + /** + * Sets the export YAML properties + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new ExportPluginProperties(); + $exportPluginProperties->setText('YAML'); + $exportPluginProperties->setExtension('yml'); + $exportPluginProperties->setMimeType('text/yaml'); + $exportPluginProperties->setForceFile(true); + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new HiddenPropertyItem("structure_or_data"); + $generalOptions->addProperty($leaf); + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader() + { + Export::outputHandler( + '%YAML 1.1' . $GLOBALS['crlf'] . '---' . $GLOBALS['crlf'] + ); + + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter() + { + Export::outputHandler('...' . $GLOBALS['crlf']); + + return true; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader($db, $db_alias = '') + { + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter($db) + { + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $export_type, $db_alias = '') + { + return true; + } + + /** + * Outputs the content of a table in JSON format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ) { + $db_alias = $db; + $table_alias = $table; + $this->initAlias($aliases, $db_alias, $table_alias); + $result = $GLOBALS['dbi']->query( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + + $columns_cnt = $GLOBALS['dbi']->numFields($result); + $columns = array(); + for ($i = 0; $i < $columns_cnt; $i++) { + $col_as = $GLOBALS['dbi']->fieldName($result, $i); + if (!empty($aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $columns[$i] = stripslashes($col_as); + } + + $buffer = ''; + $record_cnt = 0; + while ($record = $GLOBALS['dbi']->fetchRow($result)) { + $record_cnt++; + + // Output table name as comment if this is the first record of the table + if ($record_cnt == 1) { + $buffer = '# ' . $db_alias . '.' . $table_alias . $crlf; + $buffer .= '-' . $crlf; + } else { + $buffer = '-' . $crlf; + } + + for ($i = 0; $i < $columns_cnt; $i++) { + if (!isset($record[$i])) { + continue; + } + + if (is_null($record[$i])) { + $buffer .= ' ' . $columns[$i] . ': null' . $crlf; + continue; + } + + if (is_numeric($record[$i])) { + $buffer .= ' ' . $columns[$i] . ': ' . $record[$i] . $crlf; + continue; + } + + $record[$i] = str_replace( + array('\\', '"', "\n", "\r"), + array('\\\\', '\"', '\n', '\r'), + $record[$i] + ); + $buffer .= ' ' . $columns[$i] . ': "' . $record[$i] . '"' . $crlf; + } + + if (!Export::outputHandler($buffer)) { + return false; + } + } + $GLOBALS['dbi']->freeResult($result); + + return true; + } // end getTableYAML +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/Helpers/Pdf.php b/phpMyAdmin/libraries/classes/Plugins/Export/Helpers/Pdf.php new file mode 100755 index 0000000..4677327 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/Helpers/Pdf.php @@ -0,0 +1,851 @@ +relation = new Relation(); + } + + /** + * Add page if needed. + * + * @param float|int $h cell height. Default value: 0 + * @param mixed $y starting y position, leave empty for current + * position + * @param boolean $addpage if true add a page, otherwise only return + * the true/false state + * + * @return boolean true in case of page break, false otherwise. + */ + public function checkPageBreak($h = 0, $y = '', $addpage = true) + { + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + $current_page = $this->page; + if ((($y + $h) > $this->PageBreakTrigger) + && (!$this->InFooter) + && ($this->AcceptPageBreak()) + ) { + if ($addpage) { + //Automatic page break + $x = $this->x; + $this->AddPage($this->CurOrientation); + $this->y = $this->dataY; + $oldpage = $this->page - 1; + + $this_page_orm = $this->pagedim[$this->page]['orm']; + $old_page_orm = $this->pagedim[$oldpage]['orm']; + $this_page_olm = $this->pagedim[$this->page]['olm']; + $old_page_olm = $this->pagedim[$oldpage]['olm']; + if ($this->rtl) { + if ($this_page_orm != $old_page_orm) { + $this->x = $x - ($this_page_orm - $old_page_orm); + } else { + $this->x = $x; + } + } else { + if ($this_page_olm != $old_page_olm) { + $this->x = $x + ($this_page_olm - $old_page_olm); + } else { + $this->x = $x; + } + } + } + + return true; + } + + // account for columns mode + return $current_page != $this->page; + } + + /** + * This method is used to render the page header. + * + * @return void + */ + // @codingStandardsIgnoreLine + public function Header() + { + global $maxY; + // We don't want automatic page breaks while generating header + // as this can lead to infinite recursion as auto generated page + // will want header as well causing another page break + // FIXME: Better approach might be to try to compact the content + $this->SetAutoPageBreak(false); + // Check if header for this page already exists + if (!isset($this->headerset[$this->page])) { + $fullwidth = 0; + foreach ($this->tablewidths as $width) { + $fullwidth += $width; + } + $this->SetY(($this->tMargin) - ($this->FontSizePt / $this->k) * 5); + $this->cellFontSize = $this->FontSizePt; + $this->SetFont( + PdfLib::PMA_PDF_FONT, + '', + ($this->titleFontSize + ? $this->titleFontSize + : $this->FontSizePt) + ); + $this->Cell(0, $this->FontSizePt, $this->titleText, 0, 1, 'C'); + $this->SetFont(PdfLib::PMA_PDF_FONT, '', $this->cellFontSize); + $this->SetY(($this->tMargin) - ($this->FontSizePt / $this->k) * 2.5); + $this->Cell( + 0, + $this->FontSizePt, + __('Database:') . ' ' . $this->dbAlias . ', ' + . __('Table:') . ' ' . $this->tableAlias . ', ' + . __('Purpose:') . ' ' . $this->purpose, + 0, + 1, + 'L' + ); + $l = ($this->lMargin); + foreach ($this->colTitles as $col => $txt) { + $this->SetXY($l, ($this->tMargin)); + $this->MultiCell( + $this->tablewidths[$col], + $this->FontSizePt, + $txt + ); + $l += $this->tablewidths[$col]; + $maxY = ($maxY < $this->getY()) ? $this->getY() : $maxY; + } + $this->SetXY($this->lMargin, $this->tMargin); + $this->setFillColor(200, 200, 200); + $l = ($this->lMargin); + foreach ($this->colTitles as $col => $txt) { + $this->SetXY($l, $this->tMargin); + $this->cell( + $this->tablewidths[$col], + $maxY - ($this->tMargin), + '', + 1, + 0, + 'L', + 1 + ); + $this->SetXY($l, $this->tMargin); + $this->MultiCell( + $this->tablewidths[$col], + $this->FontSizePt, + $txt, + 0, + 'C' + ); + $l += $this->tablewidths[$col]; + } + $this->setFillColor(255, 255, 255); + // set headerset + $this->headerset[$this->page] = 1; + } + + $this->dataY = $maxY; + $this->SetAutoPageBreak(true); + } + + /** + * Generate table + * + * @param int $lineheight Height of line + * + * @return void + */ + public function morepagestable($lineheight = 8) + { + // some things to set and 'remember' + $l = $this->lMargin; + $startheight = $h = $this->dataY; + $startpage = $currpage = $this->page; + + // calculate the whole width + $fullwidth = 0; + foreach ($this->tablewidths as $width) { + $fullwidth += $width; + } + + // Now let's start to write the table + $row = 0; + $tmpheight = array(); + $maxpage = $this->page; + + while ($data = $GLOBALS['dbi']->fetchRow($this->results)) { + $this->page = $currpage; + // write the horizontal borders + $this->Line($l, $h, $fullwidth + $l, $h); + // write the content and remember the height of the highest col + foreach ($data as $col => $txt) { + $this->page = $currpage; + $this->SetXY($l, $h); + if ($this->tablewidths[$col] > 0) { + $this->MultiCell( + $this->tablewidths[$col], + $lineheight, + $txt, + 0, + $this->colAlign[$col] + ); + $l += $this->tablewidths[$col]; + } + + if (!isset($tmpheight[$row . '-' . $this->page])) { + $tmpheight[$row . '-' . $this->page] = 0; + } + if ($tmpheight[$row . '-' . $this->page] < $this->GetY()) { + $tmpheight[$row . '-' . $this->page] = $this->GetY(); + } + if ($this->page > $maxpage) { + $maxpage = $this->page; + } + unset($data[$col]); + } + + // get the height we were in the last used page + $h = $tmpheight[$row . '-' . $maxpage]; + // set the "pointer" to the left margin + $l = $this->lMargin; + // set the $currpage to the last page + $currpage = $maxpage; + unset($data[$row]); + $row++; + } + // draw the borders + // we start adding a horizontal line on the last page + $this->page = $maxpage; + $this->Line($l, $h, $fullwidth + $l, $h); + // now we start at the top of the document and walk down + for ($i = $startpage; $i <= $maxpage; $i++) { + $this->page = $i; + $l = $this->lMargin; + $t = ($i == $startpage) ? $startheight : $this->tMargin; + $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; + $this->Line($l, $t, $l, $lh); + foreach ($this->tablewidths as $width) { + $l += $width; + $this->Line($l, $t, $l, $lh); + } + } + // set it to the last page, if not it'll cause some problems + $this->page = $maxpage; + } + + /** + * Sets a set of attributes. + * + * @param array $attr array containing the attributes + * + * @return void + */ + public function setAttributes(array $attr = array()) + { + foreach ($attr as $key => $val) { + $this->$key = $val; + } + } + + /** + * Defines the top margin. + * The method can be called before creating the first page. + * + * @param float $topMargin the margin + * + * @return void + */ + public function setTopMargin($topMargin) + { + $this->tMargin = $topMargin; + } + + /** + * Prints triggers + * + * @param string $db database name + * @param string $table table name + * + * @return void + */ + public function getTriggers($db, $table) + { + $i = 0; + $triggers = $GLOBALS['dbi']->getTriggers($db, $table); + foreach ($triggers as $trigger) { + $i++; + break; + } + if ($i == 0) { + return; //prevents printing blank trigger list for any table + } + + unset($this->tablewidths); + unset($this->colTitles); + unset($this->titleWidth); + unset($this->colFits); + unset($this->display_column); + unset($this->colAlign); + + /** + * Making table heading + * Keeping column width constant + */ + $this->colTitles[0] = __('Name'); + $this->tablewidths[0] = 90; + $this->colTitles[1] = __('Time'); + $this->tablewidths[1] = 80; + $this->colTitles[2] = __('Event'); + $this->tablewidths[2] = 40; + $this->colTitles[3] = __('Definition'); + $this->tablewidths[3] = 240; + + for ($columns_cnt = 0; $columns_cnt < 4; $columns_cnt++) { + $this->colAlign[$columns_cnt] = 'L'; + $this->display_column[$columns_cnt] = true; + } + + // Starting to fill table with required info + + $this->setY($this->tMargin); + $this->AddPage(); + $this->SetFont(PdfLib::PMA_PDF_FONT, '', 9); + + $l = $this->lMargin; + $startheight = $h = $this->dataY; + $startpage = $currpage = $this->page; + + // calculate the whole width + $fullwidth = 0; + foreach ($this->tablewidths as $width) { + $fullwidth += $width; + } + + $row = 0; + $tmpheight = array(); + $maxpage = $this->page; + $data = array(); + + $triggers = $GLOBALS['dbi']->getTriggers($db, $table); + + foreach ($triggers as $trigger) { + $data[] = $trigger['name']; + $data[] = $trigger['action_timing']; + $data[] = $trigger['event_manipulation']; + $data[] = $trigger['definition']; + $this->page = $currpage; + // write the horizontal borders + $this->Line($l, $h, $fullwidth + $l, $h); + // write the content and remember the height of the highest col + foreach ($data as $col => $txt) { + $this->page = $currpage; + $this->SetXY($l, $h); + if ($this->tablewidths[$col] > 0) { + $this->MultiCell( + $this->tablewidths[$col], + $this->FontSizePt, + $txt, + 0, + $this->colAlign[$col] + ); + $l += $this->tablewidths[$col]; + } + + if (!isset($tmpheight[$row . '-' . $this->page])) { + $tmpheight[$row . '-' . $this->page] = 0; + } + if ($tmpheight[$row . '-' . $this->page] < $this->GetY()) { + $tmpheight[$row . '-' . $this->page] = $this->GetY(); + } + if ($this->page > $maxpage) { + $maxpage = $this->page; + } + } + // get the height we were in the last used page + $h = $tmpheight[$row . '-' . $maxpage]; + // set the "pointer" to the left margin + $l = $this->lMargin; + // set the $currpage to the last page + $currpage = $maxpage; + unset($data); + $row++; + } + // draw the borders + // we start adding a horizontal line on the last page + $this->page = $maxpage; + $this->Line($l, $h, $fullwidth + $l, $h); + // now we start at the top of the document and walk down + for ($i = $startpage; $i <= $maxpage; $i++) { + $this->page = $i; + $l = $this->lMargin; + $t = ($i == $startpage) ? $startheight : $this->tMargin; + $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; + $this->Line($l, $t, $l, $lh); + foreach ($this->tablewidths as $width) { + $l += $width; + $this->Line($l, $t, $l, $lh); + } + } + // set it to the last page, if not it'll cause some problems + $this->page = $maxpage; + } + + /** + * Print $table's CREATE definition + * + * @param string $db the database name + * @param string $table the table name + * @param bool $do_relation whether to include relation comments + * @param bool $do_comments whether to include the pmadb-style column + * comments as comments in the structure; + * this is deprecated but the parameter is + * left here because export.php calls + * PMA_exportStructure() also for other + * export types which use this parameter + * @param bool $do_mime whether to include mime comments + * @param bool $view whether we're handling a view + * @param array $aliases aliases of db/table/columns + * + * @return void + */ + public function getTableDef( + $db, + $table, + $do_relation, + $do_comments, + $do_mime, + $view = false, + array $aliases = array() + ) { + // set $cfgRelation here, because there is a chance that it's modified + // since the class initialization + global $cfgRelation; + + unset($this->tablewidths); + unset($this->colTitles); + unset($this->titleWidth); + unset($this->colFits); + unset($this->display_column); + unset($this->colAlign); + + /** + * Gets fields properties + */ + $GLOBALS['dbi']->selectDb($db); + + /** + * All these three checks do_relation, do_comment and do_mime is + * not required. As presently all are set true by default. + * But when, methods to take user input will be developed, + * it will be of use + */ + // Check if we can use Relations + if ($do_relation) { + // Find which tables are related with the current one and write it in + // an array + $res_rel = $this->relation->getForeigners($db, $table); + $have_rel = !empty($res_rel); + } else { + $have_rel = false; + } // end if + + //column count and table heading + + $this->colTitles[0] = __('Column'); + $this->tablewidths[0] = 90; + $this->colTitles[1] = __('Type'); + $this->tablewidths[1] = 80; + $this->colTitles[2] = __('Null'); + $this->tablewidths[2] = 40; + $this->colTitles[3] = __('Default'); + $this->tablewidths[3] = 120; + + for ($columns_cnt = 0; $columns_cnt < 4; $columns_cnt++) { + $this->colAlign[$columns_cnt] = 'L'; + $this->display_column[$columns_cnt] = true; + } + + if ($do_relation && $have_rel) { + $this->colTitles[$columns_cnt] = __('Links to'); + $this->display_column[$columns_cnt] = true; + $this->colAlign[$columns_cnt] = 'L'; + $this->tablewidths[$columns_cnt] = 120; + $columns_cnt++; + } + if ($do_comments /*&& $cfgRelation['commwork']*/) { + $this->colTitles[$columns_cnt] = __('Comments'); + $this->display_column[$columns_cnt] = true; + $this->colAlign[$columns_cnt] = 'L'; + $this->tablewidths[$columns_cnt] = 120; + $columns_cnt++; + } + if ($do_mime && $cfgRelation['mimework']) { + $this->colTitles[$columns_cnt] = __('MIME'); + $this->display_column[$columns_cnt] = true; + $this->colAlign[$columns_cnt] = 'L'; + $this->tablewidths[$columns_cnt] = 120; + $columns_cnt++; + } + + // Starting to fill table with required info + + $this->setY($this->tMargin); + $this->AddPage(); + $this->SetFont(PdfLib::PMA_PDF_FONT, '', 9); + + // Now let's start to write the table structure + + if ($do_comments) { + $comments = $this->relation->getComments($db, $table); + } + if ($do_mime && $cfgRelation['mimework']) { + $mime_map = Transformations::getMIME($db, $table, true); + } + + $columns = $GLOBALS['dbi']->getColumns($db, $table); + /** + * Get the unique keys in the table. + * Presently, this information is not used. We will have to find out + * way of displaying it. + */ + $unique_keys = array(); + $keys = $GLOBALS['dbi']->getTableIndexes($db, $table); + foreach ($keys as $key) { + if ($key['Non_unique'] == 0) { + $unique_keys[] = $key['Column_name']; + } + } + + // some things to set and 'remember' + $l = $this->lMargin; + $startheight = $h = $this->dataY; + $startpage = $currpage = $this->page; + // calculate the whole width + $fullwidth = 0; + foreach ($this->tablewidths as $width) { + $fullwidth += $width; + } + + $row = 0; + $tmpheight = array(); + $maxpage = $this->page; + $data = array(); + + // fun begin + foreach ($columns as $column) { + $extracted_columnspec + = Util::extractColumnSpec($column['Type']); + + $type = $extracted_columnspec['print_type']; + if (empty($type)) { + $type = ' '; + } + + if (!isset($column['Default'])) { + if ($column['Null'] != 'NO') { + $column['Default'] = 'NULL'; + } + } + $data [] = $column['Field']; + $data [] = $type; + $data [] = ($column['Null'] == '' || $column['Null'] == 'NO') + ? 'No' + : 'Yes'; + $data [] = isset($column['Default']) ? $column['Default'] : ''; + + $field_name = $column['Field']; + + if ($do_relation && $have_rel) { + $data [] = isset($res_rel[$field_name]) + ? $res_rel[$field_name]['foreign_table'] + . ' (' . $res_rel[$field_name]['foreign_field'] + . ')' + : ''; + } + if ($do_comments) { + $data [] = isset($comments[$field_name]) + ? $comments[$field_name] + : ''; + } + if ($do_mime) { + $data [] = isset($mime_map[$field_name]) + ? $mime_map[$field_name]['mimetype'] + : ''; + } + + $this->page = $currpage; + // write the horizontal borders + $this->Line($l, $h, $fullwidth + $l, $h); + // write the content and remember the height of the highest col + foreach ($data as $col => $txt) { + $this->page = $currpage; + $this->SetXY($l, $h); + if ($this->tablewidths[$col] > 0) { + $this->MultiCell( + $this->tablewidths[$col], + $this->FontSizePt, + $txt, + 0, + $this->colAlign[$col] + ); + $l += $this->tablewidths[$col]; + } + + if (!isset($tmpheight[$row . '-' . $this->page])) { + $tmpheight[$row . '-' . $this->page] = 0; + } + if ($tmpheight[$row . '-' . $this->page] < $this->GetY()) { + $tmpheight[$row . '-' . $this->page] = $this->GetY(); + } + if ($this->page > $maxpage) { + $maxpage = $this->page; + } + } + + // get the height we were in the last used page + $h = $tmpheight[$row . '-' . $maxpage]; + // set the "pointer" to the left margin + $l = $this->lMargin; + // set the $currpage to the last page + $currpage = $maxpage; + unset($data); + $row++; + } + // draw the borders + // we start adding a horizontal line on the last page + $this->page = $maxpage; + $this->Line($l, $h, $fullwidth + $l, $h); + // now we start at the top of the document and walk down + for ($i = $startpage; $i <= $maxpage; $i++) { + $this->page = $i; + $l = $this->lMargin; + $t = ($i == $startpage) ? $startheight : $this->tMargin; + $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; + $this->Line($l, $t, $l, $lh); + foreach ($this->tablewidths as $width) { + $l += $width; + $this->Line($l, $t, $l, $lh); + } + } + // set it to the last page, if not it'll cause some problems + $this->page = $maxpage; + } + + /** + * MySQL report + * + * @param string $query Query to execute + * + * @return void + */ + public function mysqlReport($query) + { + unset($this->tablewidths); + unset($this->colTitles); + unset($this->titleWidth); + unset($this->colFits); + unset($this->display_column); + unset($this->colAlign); + + /** + * Pass 1 for column widths + */ + $this->results = $GLOBALS['dbi']->query( + $query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $this->numFields = $GLOBALS['dbi']->numFields($this->results); + $this->fields = $GLOBALS['dbi']->getFieldsMeta($this->results); + + // sColWidth = starting col width (an average size width) + $availableWidth = $this->w - $this->lMargin - $this->rMargin; + $this->sColWidth = $availableWidth / $this->numFields; + $totalTitleWidth = 0; + + // loop through results header and set initial + // col widths/ titles/ alignment + // if a col title is less than the starting col width, + // reduce that column size + $colFits = array(); + $titleWidth = array(); + for ($i = 0; $i < $this->numFields; $i++) { + $col_as = $this->fields[$i]->name; + $db = $this->currentDb; + $table = $this->currentTable; + if (!empty($this->aliases[$db]['tables'][$table]['columns'][$col_as])) { + $col_as = $this->aliases[$db]['tables'][$table]['columns'][$col_as]; + } + $stringWidth = $this->getstringwidth($col_as) + 6; + // save the real title's width + $titleWidth[$i] = $stringWidth; + $totalTitleWidth += $stringWidth; + + // set any column titles less than the start width to + // the column title width + if ($stringWidth < $this->sColWidth) { + $colFits[$i] = $stringWidth; + } + $this->colTitles[$i] = $col_as; + $this->display_column[$i] = true; + + switch ($this->fields[$i]->type) { + case 'int': + $this->colAlign[$i] = 'R'; + break; + case 'blob': + case 'tinyblob': + case 'mediumblob': + case 'longblob': + /** + * @todo do not deactivate completely the display + * but show the field's name and [BLOB] + */ + if (stristr($this->fields[$i]->flags, 'BINARY')) { + $this->display_column[$i] = false; + unset($this->colTitles[$i]); + } + $this->colAlign[$i] = 'L'; + break; + default: + $this->colAlign[$i] = 'L'; + } + } + + // title width verification + if ($totalTitleWidth > $availableWidth) { + $adjustingMode = true; + } else { + $adjustingMode = false; + // we have enough space for all the titles at their + // original width so use the true title's width + foreach ($titleWidth as $key => $val) { + $colFits[$key] = $val; + } + } + + // loop through the data; any column whose contents + // is greater than the column size is resized + /** + * @todo force here a LIMIT to avoid reading all rows + */ + while ($row = $GLOBALS['dbi']->fetchRow($this->results)) { + foreach ($colFits as $key => $val) { + $stringWidth = $this->getstringwidth($row[$key]) + 6; + if ($adjustingMode && ($stringWidth > $this->sColWidth)) { + // any column whose data's width is bigger than + // the start width is now discarded + unset($colFits[$key]); + } else { + // if data's width is bigger than the current column width, + // enlarge the column (but avoid enlarging it if the + // data's width is very big) + if ($stringWidth > $val + && $stringWidth < ($this->sColWidth * 3) + ) { + $colFits[$key] = $stringWidth; + } + } + } + } + + $totAlreadyFitted = 0; + foreach ($colFits as $key => $val) { + // set fitted columns to smallest size + $this->tablewidths[$key] = $val; + // to work out how much (if any) space has been freed up + $totAlreadyFitted += $val; + } + + if ($adjustingMode) { + $surplus = (sizeof($colFits) * $this->sColWidth) - $totAlreadyFitted; + $surplusToAdd = $surplus / ($this->numFields - sizeof($colFits)); + } else { + $surplusToAdd = 0; + } + + for ($i = 0; $i < $this->numFields; $i++) { + if (!in_array($i, array_keys($colFits))) { + $this->tablewidths[$i] = $this->sColWidth + $surplusToAdd; + } + if ($this->display_column[$i] == false) { + $this->tablewidths[$i] = 0; + } + } + + ksort($this->tablewidths); + + $GLOBALS['dbi']->freeResult($this->results); + + // Pass 2 + + $this->results = $GLOBALS['dbi']->query( + $query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_UNBUFFERED + ); + $this->setY($this->tMargin); + $this->AddPage(); + $this->SetFont(PdfLib::PMA_PDF_FONT, '', 9); + $this->morepagestable($this->FontSizePt); + $GLOBALS['dbi']->freeResult($this->results); + } // end of mysqlReport function +} // end of Pdf class diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/Helpers/TableProperty.php b/phpMyAdmin/libraries/classes/Plugins/Export/Helpers/TableProperty.php new file mode 100755 index 0000000..de8bff2 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/Helpers/TableProperty.php @@ -0,0 +1,285 @@ +name = trim($row[0]); + $this->type = trim($row[1]); + $this->nullable = trim($row[2]); + $this->key = trim($row[3]); + $this->defaultValue = trim($row[4]); + $this->ext = trim($row[5]); + } + + /** + * Gets the pure type + * + * @return string type + */ + public function getPureType() + { + $pos = mb_strpos($this->type, "("); + if ($pos > 0) { + return mb_substr($this->type, 0, $pos); + } + return $this->type; + } + + /** + * Tells whether the key is null or not + * + * @return bool true if the key is not null, false otherwise + */ + public function isNotNull() + { + return $this->nullable == "NO" ? "true" : "false"; + } + + /** + * Tells whether the key is unique or not + * + * @return bool true if the key is unique, false otherwise + */ + public function isUnique() + { + return $this->key == "PRI" || $this->key == "UNI" ? "true" : "false"; + } + + /** + * Gets the .NET primitive type + * + * @return string type + */ + public function getDotNetPrimitiveType() + { + if (mb_strpos($this->type, "int") === 0) { + return "int"; + } + if (mb_strpos($this->type, "longtext") === 0) { + return "string"; + } + if (mb_strpos($this->type, "long") === 0) { + return "long"; + } + if (mb_strpos($this->type, "char") === 0) { + return "string"; + } + if (mb_strpos($this->type, "varchar") === 0) { + return "string"; + } + if (mb_strpos($this->type, "text") === 0) { + return "string"; + } + if (mb_strpos($this->type, "tinyint") === 0) { + return "bool"; + } + if (mb_strpos($this->type, "datetime") === 0) { + return "DateTime"; + } + return "unknown"; + } + + /** + * Gets the .NET object type + * + * @return string type + */ + public function getDotNetObjectType() + { + if (mb_strpos($this->type, "int") === 0) { + return "Int32"; + } + if (mb_strpos($this->type, "longtext") === 0) { + return "String"; + } + if (mb_strpos($this->type, "long") === 0) { + return "Long"; + } + if (mb_strpos($this->type, "char") === 0) { + return "String"; + } + if (mb_strpos($this->type, "varchar") === 0) { + return "String"; + } + if (mb_strpos($this->type, "text") === 0) { + return "String"; + } + if (mb_strpos($this->type, "tinyint") === 0) { + return "Boolean"; + } + if (mb_strpos($this->type, "datetime") === 0) { + return "DateTime"; + } + return "Unknown"; + } + + /** + * Gets the index name + * + * @return string containing the name of the index + */ + public function getIndexName() + { + if (strlen($this->key) > 0) { + return "index=\"" + . htmlspecialchars($this->name, ENT_COMPAT, 'UTF-8') + . "\""; + } + return ""; + } + + /** + * Tells whether the key is primary or not + * + * @return bool true if the key is primary, false otherwise + */ + public function isPK() + { + return $this->key == "PRI"; + } + + /** + * Formats a string for C# + * + * @param string $text string to be formatted + * + * @return string formatted text + */ + public function formatCs($text) + { + $text = str_replace( + "#name#", + ExportCodegen::cgMakeIdentifier($this->name, false), + $text + ); + return $this->format($text); + } + + /** + * Formats a string for XML + * + * @param string $text string to be formatted + * + * @return string formatted text + */ + public function formatXml($text) + { + $text = str_replace( + "#name#", + htmlspecialchars($this->name, ENT_COMPAT, 'UTF-8'), + $text + ); + $text = str_replace( + "#indexName#", + $this->getIndexName(), + $text + ); + return $this->format($text); + } + + /** + * Formats a string + * + * @param string $text string to be formatted + * + * @return string formatted text + */ + public function format($text) + { + $text = str_replace( + "#ucfirstName#", + ExportCodegen::cgMakeIdentifier($this->name), + $text + ); + $text = str_replace( + "#dotNetPrimitiveType#", + $this->getDotNetPrimitiveType(), + $text + ); + $text = str_replace( + "#dotNetObjectType#", + $this->getDotNetObjectType(), + $text + ); + $text = str_replace( + "#type#", + $this->getPureType(), + $text + ); + $text = str_replace( + "#notNull#", + $this->isNotNull(), + $text + ); + $text = str_replace( + "#unique#", + $this->isUnique(), + $text + ); + return $text; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Export/README b/phpMyAdmin/libraries/classes/Plugins/Export/README new file mode 100755 index 0000000..a05dc8a --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Export/README @@ -0,0 +1,257 @@ +This directory holds export plugins for phpMyAdmin. Any new plugin should +basically follow the structure presented here. Official plugins need to +have str* messages with their definition in language files, but if you build +some plugins for your use, you can directly use texts in plugin. + +setProperties(); + } + + // optional - declare global variables and use getters later + /** + * Initialize the local variables that are used specific for export SQL + * + * @global type $global_variable_name + * [..] + * + * @return void + */ + protected function initSpecificVariables() + { + global $global_variable_name; + $this->_setGlobalVariableName($global_variable_name); + } + + /** + * Sets the export plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + $exportPluginProperties = new PhpMyAdmin\Properties\Plugins\ExportPluginProperties(); + $exportPluginProperties->setText('[name]'); // the name of your plug-in + $exportPluginProperties->setExtension('[ext]'); // extension this plug-in can handle + $exportPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $exportPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup( + "general_opts" + ); + + // optional : + // create primary items and add them to the group + // type - one of the classes listed in libraries/properties/options/items/ + // name - form element name + // text - description in GUI + // size - size of text element + // len - maximal size of input + // values - possible values of the item + $leaf = new PhpMyAdmin\Properties\Options\Items\RadioPropertyItem( + "structure_or_data" + ); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data') + ) + ); + $generalOptions->addProperty($leaf); + + // add the main group to the root group + $exportSpecificOptions->addProperty($generalOptions); + + // set the options for the export plugin property item + $exportPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $exportPluginProperties; + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + public function exportHeader () + { + // implementation + return true; + } + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + public function exportFooter () + { + // implementation + return true; + } + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBHeader ($db, $db_alias = '') + { + // implementation + return true; + } + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + public function exportDBFooter ($db) + { + // implementation + return true; + } + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + public function exportDBCreate($db, $db_alias = '') + { + // implementation + return true; + } + + /** + * Outputs the content of a table in [Name] format + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportData( + $db, $table, $crlf, $error_url, $sql_query, $aliases = array() + ) { + // implementation; + return true; + } + + // optional - implement other methods defined in PhpMyAdmin\Plugins\ExportPlugin.class.php: + // - exportRoutines() + // - exportStructure() + // - getTableDefStandIn() + // - getTriggers() + + // optional - implement other private methods in order to avoid + // having huge methods or avoid duplicate code. Make use of them + // as well as of the getters and setters declared both here + // and in the PhpMyAdmin\Plugins\ExportPlugin class + + + // optional: + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + + /** + * Getter description + * + * @return type + */ + private function _getMyOptionalVariable() + { + return $this->_myOptionalVariable; + } + + /** + * Setter description + * + * @param type $my_optional_variable description + * + * @return void + */ + private function _setMyOptionalVariable($my_optional_variable) + { + $this->_myOptionalVariable = $my_optional_variable; + } + + /** + * Getter description + * + * @return type + */ + private function _getGlobalVariableName() + { + return $this->_globalVariableName; + } + + /** + * Setter description + * + * @param type $global_variable_name description + * + * @return void + */ + private function _setGlobalVariableName($global_variable_name) + { + $this->_globalVariableName = $global_variable_name; + } +} +?> diff --git a/phpMyAdmin/libraries/classes/Plugins/ExportPlugin.php b/phpMyAdmin/libraries/classes/Plugins/ExportPlugin.php new file mode 100755 index 0000000..56710ad --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/ExportPlugin.php @@ -0,0 +1,378 @@ +relation = new Relation(); + } + + /** + * Outputs export header + * + * @return bool Whether it succeeded + */ + abstract public function exportHeader(); + + /** + * Outputs export footer + * + * @return bool Whether it succeeded + */ + abstract public function exportFooter(); + + /** + * Outputs database header + * + * @param string $db Database name + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + abstract public function exportDBHeader($db, $db_alias = ''); + + /** + * Outputs database footer + * + * @param string $db Database name + * + * @return bool Whether it succeeded + */ + abstract public function exportDBFooter($db); + + /** + * Outputs CREATE DATABASE statement + * + * @param string $db Database name + * @param string $export_type 'server', 'database', 'table' + * @param string $db_alias Aliases of db + * + * @return bool Whether it succeeded + */ + abstract public function exportDBCreate($db, $export_type, $db_alias = ''); + + /** + * Outputs the content of a table + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $sql_query SQL query for obtaining data + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + abstract public function exportData( + $db, + $table, + $crlf, + $error_url, + $sql_query, + array $aliases = array() + ); + + /** + * The following methods are used in export.php or in db_operations.php, + * but they are not implemented by all export plugins + */ + + /** + * Exports routines (procedures and functions) + * + * @param string $db Database + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportRoutines($db, array $aliases = array()) + { + ; + } + + /** + * Exports events + * + * @param string $db Database + * + * @return bool Whether it succeeded + */ + public function exportEvents($db) + { + ; + } + + /** + * Outputs table's structure + * + * @param string $db database name + * @param string $table table name + * @param string $crlf the end of line sequence + * @param string $error_url the url to go back in case of error + * @param string $export_mode 'create_table','triggers','create_view', + * 'stand_in' + * @param string $export_type 'server', 'database', 'table' + * @param bool $relation whether to include relation comments + * @param bool $comments whether to include the pmadb-style column comments + * as comments in the structure; this is deprecated + * but the parameter is left here because export.php + * calls exportStructure() also for other export + * types which use this parameter + * @param bool $mime whether to include mime comments + * @param bool $dates whether to include creation/update/check dates + * @param array $aliases Aliases of db/table/columns + * + * @return bool Whether it succeeded + */ + public function exportStructure( + $db, + $table, + $crlf, + $error_url, + $export_mode, + $export_type, + $relation = false, + $comments = false, + $mime = false, + $dates = false, + array $aliases = array() + ) { + ; + } + + /** + * Exports metadata from Configuration Storage + * + * @param string $db database being exported + * @param string|array $tables table(s) being exported + * @param array $metadataTypes types of metadata to export + * + * @return bool Whether it succeeded + */ + public function exportMetadata( + $db, + $tables, + array $metadataTypes + ) { + ; + } + + /** + * Returns a stand-in CREATE definition to resolve view dependencies + * + * @param string $db the database name + * @param string $view the view name + * @param string $crlf the end of line sequence + * @param array $aliases Aliases of db/table/columns + * + * @return string resulting definition + */ + public function getTableDefStandIn($db, $view, $crlf, $aliases = array()) + { + ; + } + + /** + * Outputs triggers + * + * @param string $db database name + * @param string $table table name + * + * @return string Formatted triggers list + */ + protected function getTriggers($db, $table) + { + ; + } + + /** + * Initialize the specific variables for each export plugin + * + * @return void + */ + protected function initSpecificVariables() + { + ; + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the export specific format plugin properties + * + * @return ExportPluginProperties + */ + public function getProperties() + { + return $this->properties; + } + + /** + * Sets the export plugins properties and is implemented by each export + * plugin + * + * @return void + */ + abstract protected function setProperties(); + + /** + * The following methods are implemented here so that they + * can be used by all export plugin without overriding it. + * Note: If you are creating a export plugin then don't include + * below methods unless you want to override them. + */ + + /** + * Initialize aliases + * + * @param array $aliases Alias information for db/table/column + * @param string &$db the database + * @param string &$table the table + * + * @return void + */ + public function initAlias($aliases, &$db, &$table = null) + { + if (!empty($aliases[$db]['tables'][$table]['alias'])) { + $table = $aliases[$db]['tables'][$table]['alias']; + } + if (!empty($aliases[$db]['alias'])) { + $db = $aliases[$db]['alias']; + } + } + + /** + * Search for alias of a identifier. + * + * @param array $aliases Alias information for db/table/column + * @param string $id the identifier to be searched + * @param string $type db/tbl/col or any combination of them + * representing what to be searched + * @param string $db the database in which search is to be done + * @param string $tbl the table in which search is to be done + * + * @return string alias of the identifier if found or '' + */ + public function getAlias(array $aliases, $id, $type = 'dbtblcol', $db = '', $tbl = '') + { + if (!empty($db) && isset($aliases[$db])) { + $aliases = array( + $db => $aliases[$db], + ); + } + // search each database + foreach ($aliases as $db_key => $db) { + // check if id is database and has alias + if (stristr($type, 'db') !== false + && $db_key === $id + && !empty($db['alias']) + ) { + return $db['alias']; + } + if (empty($db['tables'])) { + continue; + } + if (!empty($tbl) && isset($db['tables'][$tbl])) { + $db['tables'] = array( + $tbl => $db['tables'][$tbl], + ); + } + // search each of its tables + foreach ($db['tables'] as $table_key => $table) { + // check if id is table and has alias + if (stristr($type, 'tbl') !== false + && $table_key === $id + && !empty($table['alias']) + ) { + return $table['alias']; + } + if (empty($table['columns'])) { + continue; + } + // search each of its columns + foreach ($table['columns'] as $col_key => $col) { + // check if id is column + if (stristr($type, 'col') !== false + && $col_key === $id + && !empty($col) + ) { + return $col; + } + } + } + } + + return ''; + } + + /** + * Gives the relation string and + * also substitutes with alias if required + * in this format: + * [Foreign Table] ([Foreign Field]) + * + * @param array $res_rel the foreigners array + * @param string $field_name the field name + * @param string $db the field name + * @param array $aliases Alias information for db/table/column + * + * @return string the Relation string + */ + public function getRelationString( + array $res_rel, + $field_name, + $db, + array $aliases = array() + ) { + $relation = ''; + $foreigner = $this->relation->searchColumnInForeigners($res_rel, $field_name); + if ($foreigner) { + $ftable = $foreigner['foreign_table']; + $ffield = $foreigner['foreign_field']; + if (!empty($aliases[$db]['tables'][$ftable]['columns'][$ffield])) { + $ffield = $aliases[$db]['tables'][$ftable]['columns'][$ffield]; + } + if (!empty($aliases[$db]['tables'][$ftable]['alias'])) { + $ftable = $aliases[$db]['tables'][$ftable]['alias']; + } + $relation = $ftable . ' (' . $ffield . ')'; + } + + return $relation; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/IOTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/IOTransformationsPlugin.php new file mode 100755 index 0000000..084923d --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/IOTransformationsPlugin.php @@ -0,0 +1,96 @@ +error; + } + + /** + * Returns the success status + * + * @return bool + */ + public function isSuccess() + { + return $this->success; + } + + /** + * Resets the object properties + * + * @return void + */ + public function reset() + { + $this->success = true; + $this->error = ''; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/AbstractImportCsv.php b/phpMyAdmin/libraries/classes/Plugins/Import/AbstractImportCsv.php new file mode 100755 index 0000000..25cdcbc --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/AbstractImportCsv.php @@ -0,0 +1,92 @@ +setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $importPluginProperties + // this will be shown as "Format specific options" + $importSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + + // create common items and add them to the group + $leaf = new BoolPropertyItem( + "replace", + __( + 'Update data when duplicate keys found on import (add ON DUPLICATE ' + . 'KEY UPDATE)' + ) + ); + $generalOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "terminated", + __('Columns separated with:') + ); + $leaf->setSize(2); + $generalOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "enclosed", + __('Columns enclosed with:') + ); + $leaf->setSize(2); + $leaf->setLen(2); + $generalOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "escaped", + __('Columns escaped with:') + ); + $leaf->setSize(2); + $leaf->setLen(2); + $generalOptions->addProperty($leaf); + $leaf = new TextPropertyItem( + "new_line", + __('Lines terminated with:') + ); + $leaf->setSize(2); + $generalOptions->addProperty($leaf); + + // add the main group to the root group + $importSpecificOptions->addProperty($generalOptions); + + // set the options for the import plugin property item + $importPluginProperties->setOptions($importSpecificOptions); + $this->properties = $importPluginProperties; + + return $generalOptions; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/ImportCsv.php b/phpMyAdmin/libraries/classes/Plugins/Import/ImportCsv.php new file mode 100755 index 0000000..b68fcea --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/ImportCsv.php @@ -0,0 +1,718 @@ +setProperties(); + } + + /** + * Sets the import plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + $this->_setAnalyze(false); + + if ($GLOBALS['plugin_param'] !== 'table') { + $this->_setAnalyze(true); + } + + $generalOptions = parent::setProperties(); + $this->properties->setText('CSV'); + $this->properties->setExtension('csv'); + + if ($GLOBALS['plugin_param'] !== 'table') { + $leaf = new BoolPropertyItem( + "col_names", + __( + 'The first line of the file contains the table column names' + . ' (if this is unchecked, the first line will become part' + . ' of the data)' + ) + ); + $generalOptions->addProperty($leaf); + } else { + $hint = new Message( + __( + 'If the data in each row of the file is not' + . ' in the same order as in the database, list the corresponding' + . ' column names here. Column names must be separated by commas' + . ' and not enclosed in quotations.' + ) + ); + $leaf = new TextPropertyItem( + "columns", + __('Column names: ') . Util::showHint($hint) + ); + $generalOptions->addProperty($leaf); + } + + $leaf = new BoolPropertyItem( + "ignore", + __('Do not abort on INSERT error') + ); + $generalOptions->addProperty($leaf); + } + + /** + * Handles the whole import logic + * + * @param array &$sql_data 2-element array with sql data + * + * @return void + */ + public function doImport(array &$sql_data = array()) + { + global $db, $table, $csv_terminated, $csv_enclosed, $csv_escaped, + $csv_new_line, $csv_columns, $err_url; + // $csv_replace and $csv_ignore should have been here, + // but we use directly from $_POST + global $error, $timeout_passed, $finished, $message; + + $replacements = array( + '\\n' => "\n", + '\\t' => "\t", + '\\r' => "\r", + ); + $csv_terminated = strtr($csv_terminated, $replacements); + $csv_enclosed = strtr($csv_enclosed, $replacements); + $csv_escaped = strtr($csv_escaped, $replacements); + $csv_new_line = strtr($csv_new_line, $replacements); + + $param_error = false; + if (strlen($csv_terminated) === 0) { + $message = Message::error( + __('Invalid parameter for CSV import: %s') + ); + $message->addParam(__('Columns terminated with')); + $error = true; + $param_error = true; + // The default dialog of MS Excel when generating a CSV produces a + // semi-colon-separated file with no chance of specifying the + // enclosing character. Thus, users who want to import this file + // tend to remove the enclosing character on the Import dialog. + // I could not find a test case where having no enclosing characters + // confuses this script. + // But the parser won't work correctly with strings so we allow just + // one character. + } elseif (mb_strlen($csv_enclosed) > 1) { + $message = Message::error( + __('Invalid parameter for CSV import: %s') + ); + $message->addParam(__('Columns enclosed with')); + $error = true; + $param_error = true; + // I could not find a test case where having no escaping characters + // confuses this script. + // But the parser won't work correctly with strings so we allow just + // one character. + } elseif (mb_strlen($csv_escaped) > 1) { + $message = Message::error( + __('Invalid parameter for CSV import: %s') + ); + $message->addParam(__('Columns escaped with')); + $error = true; + $param_error = true; + } elseif (mb_strlen($csv_new_line) != 1 + && $csv_new_line != 'auto' + ) { + $message = Message::error( + __('Invalid parameter for CSV import: %s') + ); + $message->addParam(__('Lines terminated with')); + $error = true; + $param_error = true; + } + + // If there is an error in the parameters entered, + // indicate that immediately. + if ($param_error) { + Util::mysqlDie( + $message->getMessage(), + '', + false, + $err_url + ); + } + + $buffer = ''; + $required_fields = 0; + + if (!$this->_getAnalyze()) { + $sql_template = 'INSERT'; + if (isset($_POST['csv_ignore'])) { + $sql_template .= ' IGNORE'; + } + $sql_template .= ' INTO ' . Util::backquote($table); + + $tmp_fields = $GLOBALS['dbi']->getColumns($db, $table); + + if (empty($csv_columns)) { + $fields = $tmp_fields; + } else { + $sql_template .= ' ('; + $fields = array(); + $tmp = preg_split('/,( ?)/', $csv_columns); + foreach ($tmp as $key => $val) { + if (count($fields) > 0) { + $sql_template .= ', '; + } + /* Trim also `, if user already included backquoted fields */ + $val = trim($val, " \t\r\n\0\x0B`"); + $found = false; + foreach ($tmp_fields as $field) { + if ($field['Field'] == $val) { + $found = true; + break; + } + } + if (!$found) { + $message = Message::error( + __( + 'Invalid column (%s) specified! Ensure that columns' + . ' names are spelled correctly, separated by commas' + . ', and not enclosed in quotes.' + ) + ); + $message->addParam($val); + $error = true; + break; + } + $fields[] = $field; + $sql_template .= Util::backquote($val); + } + $sql_template .= ') '; + } + + $required_fields = count($fields); + + $sql_template .= ' VALUES ('; + } + + // Defaults for parser + $i = 0; + $len = 0; + $lastlen = null; + $line = 1; + $lasti = -1; + $values = array(); + $csv_finish = false; + + $tempRow = array(); + $rows = array(); + $col_names = array(); + $tables = array(); + + $col_count = 0; + $max_cols = 0; + $csv_terminated_len = mb_strlen($csv_terminated); + while (!($finished && $i >= $len) && !$error && !$timeout_passed) { + $data = Import::getNextChunk(); + if ($data === false) { + // subtract data we didn't handle yet and stop processing + $GLOBALS['offset'] -= strlen($buffer); + break; + } elseif ($data === true) { + // Handle rest of buffer + } else { + // Append new data to buffer + $buffer .= $data; + unset($data); + + // Force a trailing new line at EOF to prevent parsing problems + if ($finished && $buffer) { + $finalch = mb_substr($buffer, -1); + if ($csv_new_line == 'auto' + && $finalch != "\r" + && $finalch != "\n" + ) { + $buffer .= "\n"; + } elseif ($csv_new_line != 'auto' + && $finalch != $csv_new_line + ) { + $buffer .= $csv_new_line; + } + } + + // Do not parse string when we're not at the end + // and don't have new line inside + if (($csv_new_line == 'auto' + && mb_strpos($buffer, "\r") === false + && mb_strpos($buffer, "\n") === false) + || ($csv_new_line != 'auto' + && mb_strpos($buffer, $csv_new_line) === false) + ) { + continue; + } + } + + // Current length of our buffer + $len = mb_strlen($buffer); + // Currently parsed char + + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { + $ch = $this->readCsvTerminatedString( + $buffer, + $ch, + $i, + $csv_terminated_len + ); + $i += $csv_terminated_len - 1; + } + while ($i < $len) { + // Deadlock protection + if ($lasti == $i && $lastlen == $len) { + $message = Message::error( + __('Invalid format of CSV input on line %d.') + ); + $message->addParam($line); + $error = true; + break; + } + $lasti = $i; + $lastlen = $len; + + // This can happen with auto EOL and \r at the end of buffer + if (!$csv_finish) { + // Grab empty field + if ($ch == $csv_terminated) { + if ($i == $len - 1) { + break; + } + $values[] = ''; + $i++; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { + $ch = $this->readCsvTerminatedString( + $buffer, + $ch, + $i, + $csv_terminated_len + ); + $i += $csv_terminated_len - 1; + } + continue; + } + + // Grab one field + $fallbacki = $i; + if ($ch == $csv_enclosed) { + if ($i == $len - 1) { + break; + } + $need_end = true; + $i++; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { + $ch = $this->readCsvTerminatedString( + $buffer, + $ch, + $i, + $csv_terminated_len + ); + $i += $csv_terminated_len - 1; + } + } else { + $need_end = false; + } + $fail = false; + $value = ''; + while (($need_end + && ($ch != $csv_enclosed + || $csv_enclosed == $csv_escaped)) + || (!$need_end + && !($ch == $csv_terminated + || $ch == $csv_new_line + || ($csv_new_line == 'auto' + && ($ch == "\r" || $ch == "\n")))) + ) { + if ($ch == $csv_escaped) { + if ($i == $len - 1) { + $fail = true; + break; + } + $i++; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 + && $ch == $csv_terminated[0] + ) { + $ch = $this->readCsvTerminatedString( + $buffer, + $ch, + $i, + $csv_terminated_len + ); + $i += $csv_terminated_len - 1; + } + if ($csv_enclosed == $csv_escaped + && ($ch == $csv_terminated + || $ch == $csv_new_line + || ($csv_new_line == 'auto' + && ($ch == "\r" || $ch == "\n"))) + ) { + break; + } + } + $value .= $ch; + if ($i == $len - 1) { + if (!$finished) { + $fail = true; + } + break; + } + $i++; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { + $ch = $this->readCsvTerminatedString( + $buffer, + $ch, + $i, + $csv_terminated_len + ); + $i += $csv_terminated_len - 1; + } + } + + // unquoted NULL string + if (false === $need_end && $value === 'NULL') { + $value = null; + } + + if ($fail) { + $i = $fallbacki; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 && $ch == $csv_terminated[0]) { + $i += $csv_terminated_len - 1; + } + break; + } + // Need to strip trailing enclosing char? + if ($need_end && $ch == $csv_enclosed) { + if ($finished && $i == $len - 1) { + $ch = null; + } elseif ($i == $len - 1) { + $i = $fallbacki; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 + && $ch == $csv_terminated[0] + ) { + $i += $csv_terminated_len - 1; + } + break; + } else { + $i++; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 + && $ch == $csv_terminated[0] + ) { + $ch = $this->readCsvTerminatedString( + $buffer, + $ch, + $i, + $csv_terminated_len + ); + $i += $csv_terminated_len - 1; + } + } + } + // Are we at the end? + if ($ch == $csv_new_line + || ($csv_new_line == 'auto' && ($ch == "\r" || $ch == "\n")) + || ($finished && $i == $len - 1) + ) { + $csv_finish = true; + } + // Go to next char + if ($ch == $csv_terminated) { + if ($i == $len - 1) { + $i = $fallbacki; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 + && $ch == $csv_terminated[0] + ) { + $i += $csv_terminated_len - 1; + } + break; + } + $i++; + $ch = mb_substr($buffer, $i, 1); + if ($csv_terminated_len > 1 + && $ch == $csv_terminated[0] + ) { + $ch = $this->readCsvTerminatedString( + $buffer, + $ch, + $i, + $csv_terminated_len + ); + $i += $csv_terminated_len - 1; + } + } + // If everything went okay, store value + $values[] = $value; + } + + // End of line + if ($csv_finish + || $ch == $csv_new_line + || ($csv_new_line == 'auto' && ($ch == "\r" || $ch == "\n")) + ) { + if ($csv_new_line == 'auto' && $ch == "\r") { // Handle "\r\n" + if ($i >= ($len - 2) && !$finished) { + break; // We need more data to decide new line + } + if (mb_substr($buffer, $i + 1, 1) == "\n") { + $i++; + } + } + // We didn't parse value till the end of line, so there was + // empty one + if (!$csv_finish) { + $values[] = ''; + } + + if ($this->_getAnalyze()) { + foreach ($values as $val) { + $tempRow[] = $val; + ++$col_count; + } + + if ($col_count > $max_cols) { + $max_cols = $col_count; + } + $col_count = 0; + + $rows[] = $tempRow; + $tempRow = array(); + } else { + // Do we have correct count of values? + if (count($values) != $required_fields) { + + // Hack for excel + if ($values[count($values) - 1] == ';') { + unset($values[count($values) - 1]); + } else { + $message = Message::error( + __( + 'Invalid column count in CSV input' + . ' on line %d.' + ) + ); + $message->addParam($line); + $error = true; + break; + } + } + + $first = true; + $sql = $sql_template; + foreach ($values as $key => $val) { + if (!$first) { + $sql .= ', '; + } + if ($val === null) { + $sql .= 'NULL'; + } else { + $sql .= '\'' + . $GLOBALS['dbi']->escapeString($val) + . '\''; + } + + $first = false; + } + $sql .= ')'; + if (isset($_POST['csv_replace'])) { + $sql .= " ON DUPLICATE KEY UPDATE "; + foreach ($fields as $field) { + $fieldName = Util::backquote( + $field['Field'] + ); + $sql .= $fieldName . " = VALUES(" . $fieldName + . "), "; + } + $sql = rtrim($sql, ', '); + } + + /** + * @todo maybe we could add original line to verbose + * SQL in comment + */ + Import::runQuery($sql, $sql, $sql_data); + } + + $line++; + $csv_finish = false; + $values = array(); + $buffer = mb_substr($buffer, $i + 1); + $len = mb_strlen($buffer); + $i = 0; + $lasti = -1; + $ch = mb_substr($buffer, 0, 1); + } + } // End of parser loop + } // End of import loop + + if ($this->_getAnalyze()) { + /* Fill out all rows */ + $num_rows = count($rows); + for ($i = 0; $i < $num_rows; ++$i) { + for ($j = count($rows[$i]); $j < $max_cols; ++$j) { + $rows[$i][] = 'NULL'; + } + } + + if (isset($_REQUEST['csv_col_names'])) { + $col_names = array_splice($rows, 0, 1); + $col_names = $col_names[0]; + // MySQL column names can't end with a space character. + foreach ($col_names as $key => $col_name) { + $col_names[$key] = rtrim($col_name); + } + } + + if ((isset($col_names) && count($col_names) != $max_cols) + || !isset($col_names) + ) { + // Fill out column names + for ($i = 0; $i < $max_cols; ++$i) { + $col_names[] = 'COL ' . ($i + 1); + } + } + + if (mb_strlen($db)) { + $result = $GLOBALS['dbi']->fetchResult('SHOW TABLES'); + $tbl_name = 'TABLE ' . (count($result) + 1); + } else { + $tbl_name = 'TBL_NAME'; + } + + $tables[] = array($tbl_name, $col_names, $rows); + + /* Obtain the best-fit MySQL types for each column */ + $analyses = array(); + $analyses[] = Import::analyzeTable($tables[0]); + + /** + * string $db_name (no backquotes) + * + * array $table = array(table_name, array() column_names, array()() rows) + * array $tables = array of "$table"s + * + * array $analysis = array(array() column_types, array() column_sizes) + * array $analyses = array of "$analysis"s + * + * array $create = array of SQL strings + * + * array $options = an associative array of options + */ + + /* Set database name to the currently selected one, if applicable */ + list($db_name, $options) = $this->getDbnameAndOptions($db, 'CSV_DB'); + + /* Non-applicable parameters */ + $create = null; + + /* Created and execute necessary SQL statements from data */ + Import::buildSql($db_name, $tables, $analyses, $create, $options, $sql_data); + + unset($tables); + unset($analyses); + } + + // Commit any possible data in buffers + Import::runQuery('', '', $sql_data); + + if (count($values) != 0 && !$error) { + $message = Message::error( + __('Invalid format of CSV input on line %d.') + ); + $message->addParam($line); + $error = true; + } + } + + /** + * Read the expected column_separated_with String of length + * $csv_terminated_len from the $buffer + * into variable $ch and return the read string $ch + * + * @param string $buffer The original string buffer read from + * csv file + * @param string $ch Partially read "column Separated with" + * string, also used to return after + * reading length equal $csv_terminated_len + * @param int $i Current read counter of buffer string + * @param int $csv_terminated_len The length of "column separated with" + * String + * + * @return string + */ + public function readCsvTerminatedString($buffer, $ch, $i, $csv_terminated_len) + { + for ($j = 0; $j < $csv_terminated_len - 1; $j++) { + $i++; + $ch .= mb_substr($buffer, $i, 1); + } + + return $ch; + } + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Returns true if the table should be analyzed, false otherwise + * + * @return bool + */ + private function _getAnalyze() + { + return $this->_analyze; + } + + /** + * Sets to true if the table should be analyzed, false otherwise + * + * @param bool $analyze status + * + * @return void + */ + private function _setAnalyze($analyze) + { + $this->_analyze = $analyze; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/ImportLdi.php b/phpMyAdmin/libraries/classes/Plugins/Import/ImportLdi.php new file mode 100755 index 0000000..e41e6f0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/ImportLdi.php @@ -0,0 +1,177 @@ +setProperties(); + } + + /** + * Sets the import plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + if ($GLOBALS['cfg']['Import']['ldi_local_option'] == 'auto') { + $GLOBALS['cfg']['Import']['ldi_local_option'] = false; + + $result = $GLOBALS['dbi']->tryQuery( + 'SELECT @@local_infile;' + ); + if ($result != false && $GLOBALS['dbi']->numRows($result) > 0) { + $tmp = $GLOBALS['dbi']->fetchRow($result); + if ($tmp[0] == 'ON') { + $GLOBALS['cfg']['Import']['ldi_local_option'] = true; + } + } + $GLOBALS['dbi']->freeResult($result); + unset($result); + } + + $generalOptions = parent::setProperties(); + $this->properties->setText('CSV using LOAD DATA'); + $this->properties->setExtension('ldi'); + + $leaf = new TextPropertyItem( + "columns", + __('Column names: ') + ); + $generalOptions->addProperty($leaf); + + $leaf = new BoolPropertyItem( + "ignore", + __('Do not abort on INSERT error') + ); + $generalOptions->addProperty($leaf); + + $leaf = new BoolPropertyItem( + "local_option", + __('Use LOCAL keyword') + ); + $generalOptions->addProperty($leaf); + } + + /** + * Handles the whole import logic + * + * @param array &$sql_data 2-element array with sql data + * + * @return void + */ + public function doImport(array &$sql_data = array()) + { + global $finished, $import_file, $charset_conversion, $table; + global $ldi_local_option, $ldi_replace, $ldi_ignore, $ldi_terminated, + $ldi_enclosed, $ldi_escaped, $ldi_new_line, $skip_queries, $ldi_columns; + + $compression = $GLOBALS['import_handle']->getCompression(); + + if ($import_file == 'none' + || $compression != 'none' + || $charset_conversion + ) { + // We handle only some kind of data! + $GLOBALS['message'] = Message::error( + __('This plugin does not support compressed imports!') + ); + $GLOBALS['error'] = true; + + return; + } + + $sql = 'LOAD DATA'; + if (isset($ldi_local_option)) { + $sql .= ' LOCAL'; + } + $sql .= ' INFILE \'' . $GLOBALS['dbi']->escapeString($import_file) + . '\''; + if (isset($ldi_replace)) { + $sql .= ' REPLACE'; + } elseif (isset($ldi_ignore)) { + $sql .= ' IGNORE'; + } + $sql .= ' INTO TABLE ' . Util::backquote($table); + + if (strlen($ldi_terminated) > 0) { + $sql .= ' FIELDS TERMINATED BY \'' . $ldi_terminated . '\''; + } + if (strlen($ldi_enclosed) > 0) { + $sql .= ' ENCLOSED BY \'' + . $GLOBALS['dbi']->escapeString($ldi_enclosed) . '\''; + } + if (strlen($ldi_escaped) > 0) { + $sql .= ' ESCAPED BY \'' + . $GLOBALS['dbi']->escapeString($ldi_escaped) . '\''; + } + if (strlen($ldi_new_line) > 0) { + if ($ldi_new_line == 'auto') { + $ldi_new_line + = (PHP_EOL == "\n") + ? '\n' + : '\r\n'; + } + $sql .= ' LINES TERMINATED BY \'' . $ldi_new_line . '\''; + } + if ($skip_queries > 0) { + $sql .= ' IGNORE ' . $skip_queries . ' LINES'; + $skip_queries = 0; + } + if (strlen($ldi_columns) > 0) { + $sql .= ' ('; + $tmp = preg_split('/,( ?)/', $ldi_columns); + $cnt_tmp = count($tmp); + for ($i = 0; $i < $cnt_tmp; $i++) { + if ($i > 0) { + $sql .= ', '; + } + /* Trim also `, if user already included backquoted fields */ + $sql .= Util::backquote( + trim($tmp[$i], " \t\r\n\0\x0B`") + ); + } // end for + $sql .= ')'; + } + + Import::runQuery($sql, $sql, $sql_data); + Import::runQuery('', '', $sql_data); + $finished = true; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/ImportMediawiki.php b/phpMyAdmin/libraries/classes/Plugins/Import/ImportMediawiki.php new file mode 100755 index 0000000..852110e --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/ImportMediawiki.php @@ -0,0 +1,599 @@ +setProperties(); + } + + /** + * Sets the import plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + $this->_setAnalyze(false); + if ($GLOBALS['plugin_param'] !== 'table') { + $this->_setAnalyze(true); + } + + $importPluginProperties = new ImportPluginProperties(); + $importPluginProperties->setText(__('MediaWiki Table')); + $importPluginProperties->setExtension('txt'); + $importPluginProperties->setMimeType('text/plain'); + $importPluginProperties->setOptions(array()); + $importPluginProperties->setOptionsText(__('Options')); + + $this->properties = $importPluginProperties; + } + + /** + * Handles the whole import logic + * + * @param array &$sql_data 2-element array with sql data + * + * @return void + */ + public function doImport(array &$sql_data = array()) + { + global $error, $timeout_passed, $finished; + + // Defaults for parser + + // The buffer that will be used to store chunks read from the imported file + $buffer = ''; + + // Used as storage for the last part of the current chunk data + // Will be appended to the first line of the next chunk, if there is one + $last_chunk_line = ''; + + // Remembers whether the current buffer line is part of a comment + $inside_comment = false; + // Remembers whether the current buffer line is part of a data comment + $inside_data_comment = false; + // Remembers whether the current buffer line is part of a structure comment + $inside_structure_comment = false; + + // MediaWiki only accepts "\n" as row terminator + $mediawiki_new_line = "\n"; + + // Initialize the name of the current table + $cur_table_name = ""; + + while (!$finished && !$error && !$timeout_passed) { + $data = Import::getNextChunk(); + + if ($data === false) { + // Subtract data we didn't handle yet and stop processing + $GLOBALS['offset'] -= mb_strlen($buffer); + break; + } elseif ($data === true) { + // Handle rest of buffer + } else { + // Append new data to buffer + $buffer = $data; + unset($data); + // Don't parse string if we're not at the end + // and don't have a new line inside + if (mb_strpos($buffer, $mediawiki_new_line) === false) { + continue; + } + } + + // Because of reading chunk by chunk, the first line from the buffer + // contains only a portion of an actual line from the imported file. + // Therefore, we have to append it to the last line from the previous + // chunk. If we are at the first chunk, $last_chunk_line should be empty. + $buffer = $last_chunk_line . $buffer; + + // Process the buffer line by line + $buffer_lines = explode($mediawiki_new_line, $buffer); + + $full_buffer_lines_count = count($buffer_lines); + // If the reading is not finalised, the final line of the current chunk + // will not be complete + if (! $finished) { + $last_chunk_line = $buffer_lines[--$full_buffer_lines_count]; + } + + for ($line_nr = 0; $line_nr < $full_buffer_lines_count; ++$line_nr) { + $cur_buffer_line = trim($buffer_lines[$line_nr]); + + // If the line is empty, go to the next one + if ($cur_buffer_line === '') { + continue; + } + + $first_character = $cur_buffer_line[0]; + $matches = array(); + + // Check beginning of comment + if (!strcmp(mb_substr($cur_buffer_line, 0, 4), "") + ) { + // Only data comments are closed. The structure comments + // will be closed when a data comment begins (in order to + // skip structure tables) + if ($inside_data_comment) { + $inside_data_comment = false; + } + + // End comments that are not related to table structure + if (!$inside_structure_comment) { + $inside_comment = false; + } + } else { + // Check table name + $match_table_name = array(); + if (preg_match( + "/^Table data for `(.*)`$/", + $cur_buffer_line, + $match_table_name + ) + ) { + $cur_table_name = $match_table_name[1]; + $inside_data_comment = true; + + $inside_structure_comment + = $this->_mngInsideStructComm( + $inside_structure_comment + ); + } elseif (preg_match( + "/^Table structure for `(.*)`$/", + $cur_buffer_line, + $match_table_name + ) + ) { + // The structure comments will be ignored + $inside_structure_comment = true; + } + } + continue; + } elseif (preg_match('/^\{\|(.*)$/', $cur_buffer_line, $matches)) { + // Check start of table + + // This will store all the column info on all rows from + // the current table read from the buffer + $cur_temp_table = array(); + + // Will be used as storage for the current row in the buffer + // Once all its columns are read, it will be added to + // $cur_temp_table and then it will be emptied + $cur_temp_line = array(); + + // Helps us differentiate the header columns + // from the normal columns + $in_table_header = false; + // End processing because the current line does not + // contain any column information + } elseif (mb_substr($cur_buffer_line, 0, 2) === '|-' + || mb_substr($cur_buffer_line, 0, 2) === '|+' + || mb_substr($cur_buffer_line, 0, 2) === '|}' + ) { + // Check begin row or end table + + // Add current line to the values storage + if (!empty($cur_temp_line)) { + // If the current line contains header cells + // ( marked with '!' ), + // it will be marked as table header + if ($in_table_header) { + // Set the header columns + $cur_temp_table_headers = $cur_temp_line; + } else { + // Normal line, add it to the table + $cur_temp_table [] = $cur_temp_line; + } + } + + // Empty the temporary buffer + $cur_temp_line = array(); + + // No more processing required at the end of the table + if (mb_substr($cur_buffer_line, 0, 2) === '|}') { + $current_table = array( + $cur_table_name, + $cur_temp_table_headers, + $cur_temp_table, + ); + + // Import the current table data into the database + $this->_importDataOneTable($current_table, $sql_data); + + // Reset table name + $cur_table_name = ""; + } + // What's after the row tag is now only attributes + + } elseif (($first_character === '|') || ($first_character === '!')) { + // Check cell elements + + // Header cells + if ($first_character === '!') { + // Mark as table header, but treat as normal row + $cur_buffer_line = str_replace('!!', '||', $cur_buffer_line); + // Will be used to set $cur_temp_line as table header + $in_table_header = true; + } else { + $in_table_header = false; + } + + // Loop through each table cell + $cells = $this->_explodeMarkup($cur_buffer_line); + foreach ($cells as $cell) { + $cell = $this->_getCellData($cell); + + // Delete the beginning of the column, if there is one + $cell = trim($cell); + $col_start_chars = array("|", "!"); + foreach ($col_start_chars as $col_start_char) { + $cell = $this->_getCellContent($cell, $col_start_char); + } + + // Add the cell to the row + $cur_temp_line [] = $cell; + } // foreach $cells + } else { + // If it's none of the above, then the current line has a bad + // format + $message = Message::error( + __('Invalid format of mediawiki input on line:
    %s.') + ); + $message->addParam($cur_buffer_line); + $error = true; + } + } // End treating full buffer lines + } // while - finished parsing buffer + } + + /** + * Imports data from a single table + * + * @param array $table containing all table info: + * + * $table[0] - string containing table name + * $table[1] - array[] of table headers + * $table[2] - array[][] of table content rows + * + * + * @param array &$sql_data 2-element array with sql data + * + * @global bool $analyze whether to scan for column types + * + * @return void + */ + private function _importDataOneTable(array $table, array &$sql_data) + { + $analyze = $this->_getAnalyze(); + if ($analyze) { + // Set the table name + $this->_setTableName($table[0]); + + // Set generic names for table headers if they don't exist + $this->_setTableHeaders($table[1], $table[2][0]); + + // Create the tables array to be used in Import::buildSql() + $tables = array(); + $tables [] = array($table[0], $table[1], $table[2]); + + // Obtain the best-fit MySQL types for each column + $analyses = array(); + $analyses [] = Import::analyzeTable($tables[0]); + + $this->_executeImportTables($tables, $analyses, $sql_data); + } + + // Commit any possible data in buffers + Import::runQuery('', '', $sql_data); + } + + /** + * Sets the table name + * + * @param string &$table_name reference to the name of the table + * + * @return void + */ + private function _setTableName(&$table_name) + { + if (empty($table_name)) { + $result = $GLOBALS['dbi']->fetchResult('SHOW TABLES'); + // todo check if the name below already exists + $table_name = 'TABLE ' . (count($result) + 1); + } + } + + /** + * Set generic names for table headers, if they don't exist + * + * @param array &$table_headers reference to the array containing the headers + * of a table + * @param array $table_row array containing the first content row + * + * @return void + */ + private function _setTableHeaders(array &$table_headers, array $table_row) + { + if (empty($table_headers)) { + // The first table row should contain the number of columns + // If they are not set, generic names will be given (COL 1, COL 2, etc) + $num_cols = count($table_row); + for ($i = 0; $i < $num_cols; ++$i) { + $table_headers [$i] = 'COL ' . ($i + 1); + } + } + } + + /** + * Sets the database name and additional options and calls Import::buildSql() + * Used in PMA_importDataAllTables() and $this->_importDataOneTable() + * + * @param array &$tables structure: + * array( + * array(table_name, array() column_names, array()() + * rows) + * ) + * @param array &$analyses structure: + * $analyses = array( + * array(array() column_types, array() column_sizes) + * ) + * @param array &$sql_data 2-element array with sql data + * + * @global string $db name of the database to import in + * + * @return void + */ + private function _executeImportTables(array &$tables, array &$analyses, array &$sql_data) + { + global $db; + + // $db_name : The currently selected database name, if applicable + // No backquotes + // $options : An associative array of options + list($db_name, $options) = $this->getDbnameAndOptions($db, 'mediawiki_DB'); + + // Array of SQL strings + // Non-applicable parameters + $create = null; + + // Create and execute necessary SQL statements from data + Import::buildSql($db_name, $tables, $analyses, $create, $options, $sql_data); + + unset($tables); + unset($analyses); + } + + /** + * Replaces all instances of the '||' separator between delimiters + * in a given string + * + * @param string $replace the string to be replaced with + * @param string $subject the text to be replaced + * + * @return string with replacements + */ + private function _delimiterReplace($replace, $subject) + { + // String that will be returned + $cleaned = ""; + // Possible states of current character + $inside_tag = false; + $inside_attribute = false; + // Attributes can be declared with either " or ' + $start_attribute_character = false; + + // The full separator is "||"; + // This remembers if the previous character was '|' + $partial_separator = false; + + // Parse text char by char + for ($i = 0; $i < strlen($subject); $i++) { + $cur_char = $subject[$i]; + // Check for separators + if ($cur_char == '|') { + // If we're not inside a tag, then this is part of a real separator, + // so we append it to the current segment + if (!$inside_attribute) { + $cleaned .= $cur_char; + if ($partial_separator) { + $inside_tag = false; + $inside_attribute = false; + } + } elseif ($partial_separator) { + // If we are inside a tag, we replace the current char with + // the placeholder and append that to the current segment + $cleaned .= $replace; + } + + // If the previous character was also '|', then this ends a + // full separator. If not, this may be the beginning of one + $partial_separator = !$partial_separator; + } else { + // If we're inside a tag attribute and the current character is + // not '|', but the previous one was, it means that the single '|' + // was not appended, so we append it now + if ($partial_separator && $inside_attribute) { + $cleaned .= "|"; + } + // If the char is different from "|", no separator can be formed + $partial_separator = false; + + // any other character should be appended to the current segment + $cleaned .= $cur_char; + + if ($cur_char == '<' && !$inside_attribute) { + // start of a tag + $inside_tag = true; + } elseif ($cur_char == '>' && !$inside_attribute) { + // end of a tag + $inside_tag = false; + } elseif (($cur_char == '"' || $cur_char == "'") && $inside_tag) { + // start or end of an attribute + if (!$inside_attribute) { + $inside_attribute = true; + // remember the attribute`s declaration character (" or ') + $start_attribute_character = $cur_char; + } else { + if ($cur_char == $start_attribute_character) { + $inside_attribute = false; + // unset attribute declaration character + $start_attribute_character = false; + } + } + } + } + } // end for each character in $subject + + return $cleaned; + } + + /** + * Separates a string into items, similarly to explode + * Uses the '||' separator (which is standard in the mediawiki format) + * and ignores any instances of it inside markup tags + * Used in parsing buffer lines containing data cells + * + * @param string $text text to be split + * + * @return array + */ + private function _explodeMarkup($text) + { + $separator = "||"; + $placeholder = "\x00"; + + // Remove placeholder instances + $text = str_replace($placeholder, '', $text); + + // Replace instances of the separator inside HTML-like + // tags with the placeholder + $cleaned = $this->_delimiterReplace($placeholder, $text); + // Explode, then put the replaced separators back in + $items = explode($separator, $cleaned); + foreach ($items as $i => $str) { + $items[$i] = str_replace($placeholder, $separator, $str); + } + + return $items; + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Returns true if the table should be analyzed, false otherwise + * + * @return bool + */ + private function _getAnalyze() + { + return $this->_analyze; + } + + /** + * Sets to true if the table should be analyzed, false otherwise + * + * @param bool $analyze status + * + * @return void + */ + private function _setAnalyze($analyze) + { + $this->_analyze = $analyze; + } + + /** + * Get cell + * + * @param string $cell Cell + * + * @return mixed + */ + private function _getCellData($cell) + { + // A cell could contain both parameters and data + $cell_data = explode('|', $cell, 2); + + // A '|' inside an invalid link should not + // be mistaken as delimiting cell parameters + if (mb_strpos($cell_data[0], '[[') === false) { + return $cell; + } + + if (count($cell_data) == 1) { + return $cell_data[0]; + } + + return $cell_data[1]; + } + + /** + * Manage $inside_structure_comment + * + * @param boolean $inside_structure_comment Value to test + * + * @return bool + */ + private function _mngInsideStructComm($inside_structure_comment) + { + // End ignoring structure rows + if ($inside_structure_comment) { + $inside_structure_comment = false; + } + + return $inside_structure_comment; + } + + /** + * Get cell content + * + * @param string $cell Cell + * @param string $col_start_char Start char + * + * @return string + */ + private function _getCellContent($cell, $col_start_char) + { + if (mb_strpos($cell, $col_start_char) === 0) { + $cell = trim(mb_substr($cell, 1)); + } + + return $cell; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/ImportOds.php b/phpMyAdmin/libraries/classes/Plugins/Import/ImportOds.php new file mode 100755 index 0000000..7100fad --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/ImportOds.php @@ -0,0 +1,422 @@ +setProperties(); + } + + /** + * Sets the import plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + $importPluginProperties = new ImportPluginProperties(); + $importPluginProperties->setText('OpenDocument Spreadsheet'); + $importPluginProperties->setExtension('ods'); + $importPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $importPluginProperties + // this will be shown as "Format specific options" + $importSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new BoolPropertyItem( + "col_names", + __( + 'The first line of the file contains the table column names' + . ' (if this is unchecked, the first line will become part' + . ' of the data)' + ) + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + "empty_rows", + __('Do not import empty rows') + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + "recognize_percentages", + __( + 'Import percentages as proper decimals (ex. 12.00% to .12)' + ) + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + "recognize_currency", + __('Import currencies (ex. $5.00 to 5.00)') + ); + $generalOptions->addProperty($leaf); + + // add the main group to the root group + $importSpecificOptions->addProperty($generalOptions); + + // set the options for the import plugin property item + $importPluginProperties->setOptions($importSpecificOptions); + $this->properties = $importPluginProperties; + } + + /** + * Handles the whole import logic + * + * @param array &$sql_data 2-element array with sql data + * + * @return void + */ + public function doImport(array &$sql_data = array()) + { + global $db, $error, $timeout_passed, $finished; + + $i = 0; + $len = 0; + $buffer = ""; + + /** + * Read in the file via Import::getNextChunk so that + * it can process compressed files + */ + while (!($finished && $i >= $len) && !$error && !$timeout_passed) { + $data = Import::getNextChunk(); + if ($data === false) { + /* subtract data we didn't handle yet and stop processing */ + $GLOBALS['offset'] -= strlen($buffer); + break; + } elseif ($data === true) { + /* Handle rest of buffer */ + } else { + /* Append new data to buffer */ + $buffer .= $data; + unset($data); + } + } + + unset($data); + + /** + * Disable loading of external XML entities. + */ + libxml_disable_entity_loader(); + + /** + * Load the XML string + * + * The option LIBXML_COMPACT is specified because it can + * result in increased performance without the need to + * alter the code in any way. It's basically a freebee. + */ + $xml = @simplexml_load_string($buffer, "SimpleXMLElement", LIBXML_COMPACT); + + unset($buffer); + + if ($xml === false) { + $sheets = array(); + $GLOBALS['message'] = Message::error( + __( + 'The XML file specified was either malformed or incomplete.' + . ' Please correct the issue and try again.' + ) + ); + $GLOBALS['error'] = true; + } else { + /** @var SimpleXMLElement $root */ + $root = $xml->children('office', true)->{'body'}->{'spreadsheet'}; + if (empty($root)) { + $sheets = array(); + $GLOBALS['message'] = Message::error( + __('Could not parse OpenDocument Spreadsheet!') + ); + $GLOBALS['error'] = true; + } else { + $sheets = $root->children('table', true); + } + } + + $tables = array(); + + $max_cols = 0; + + $col_count = 0; + $col_names = array(); + + $tempRow = array(); + $tempRows = array(); + $rows = array(); + + /* Iterate over tables */ + /** @var SimpleXMLElement $sheet */ + foreach ($sheets as $sheet) { + $col_names_in_first_row = isset($_REQUEST['ods_col_names']); + + /* Iterate over rows */ + /** @var SimpleXMLElement $row */ + foreach ($sheet as $row) { + $type = $row->getName(); + if (strcmp('table-row', $type)) { + continue; + } + /* Iterate over columns */ + $cellCount = count($row); + $a = 0; + /** @var SimpleXMLElement $cell */ + foreach ($row as $cell) { + $a++; + $text = $cell->children('text', true); + $cell_attrs = $cell->attributes('office', true); + + if (count($text) != 0) { + $attr = $cell->attributes('table', true); + $num_repeat = (int)$attr['number-columns-repeated']; + $num_iterations = $num_repeat ? $num_repeat : 1; + + for ($k = 0; $k < $num_iterations; $k++) { + $value = $this->getValue($cell_attrs, $text); + if (!$col_names_in_first_row) { + $tempRow[] = $value; + } else { + // MySQL column names can't end with a space + // character. + $col_names[] = rtrim($value); + } + + ++$col_count; + } + continue; + } + + // skip empty repeats in the last row + if ($a == $cellCount) { + continue; + } + + $attr = $cell->attributes('table', true); + $num_null = (int)$attr['number-columns-repeated']; + + if ($num_null) { + if (!$col_names_in_first_row) { + for ($i = 0; $i < $num_null; ++$i) { + $tempRow[] = 'NULL'; + ++$col_count; + } + } else { + for ($i = 0; $i < $num_null; ++$i) { + $col_names[] = Import::getColumnAlphaName( + $col_count + 1 + ); + ++$col_count; + } + } + } else { + if (!$col_names_in_first_row) { + $tempRow[] = 'NULL'; + } else { + $col_names[] = Import::getColumnAlphaName( + $col_count + 1 + ); + } + + ++$col_count; + } + } //Endforeach + + /* Find the widest row */ + if ($col_count > $max_cols) { + $max_cols = $col_count; + } + + /* Don't include a row that is full of NULL values */ + if (!$col_names_in_first_row) { + if ($_REQUEST['ods_empty_rows']) { + foreach ($tempRow as $cell) { + if (strcmp('NULL', $cell)) { + $tempRows[] = $tempRow; + break; + } + } + } else { + $tempRows[] = $tempRow; + } + } + + $col_count = 0; + $col_names_in_first_row = false; + $tempRow = array(); + } + + /* Skip over empty sheets */ + if (count($tempRows) == 0 || count($tempRows[0]) == 0) { + $col_names = array(); + $tempRow = array(); + $tempRows = array(); + continue; + } + + /** + * Fill out each row as necessary to make + * every one exactly as wide as the widest + * row. This included column names. + */ + + /* Fill out column names */ + for ($i = count($col_names); $i < $max_cols; ++$i) { + $col_names[] = Import::getColumnAlphaName($i + 1); + } + + /* Fill out all rows */ + $num_rows = count($tempRows); + for ($i = 0; $i < $num_rows; ++$i) { + for ($j = count($tempRows[$i]); $j < $max_cols; ++$j) { + $tempRows[$i][] = 'NULL'; + } + } + + /* Store the table name so we know where to place the row set */ + $tbl_attr = $sheet->attributes('table', true); + $tables[] = array((string)$tbl_attr['name']); + + /* Store the current sheet in the accumulator */ + $rows[] = array((string)$tbl_attr['name'], $col_names, $tempRows); + $tempRows = array(); + $col_names = array(); + $max_cols = 0; + } + + unset($tempRow); + unset($tempRows); + unset($col_names); + unset($sheets); + unset($xml); + + /** + * Bring accumulated rows into the corresponding table + */ + $num_tables = count($tables); + for ($i = 0; $i < $num_tables; ++$i) { + $num_rows = count($rows); + for ($j = 0; $j < $num_rows; ++$j) { + if (strcmp($tables[$i][Import::TBL_NAME], $rows[$j][Import::TBL_NAME])) { + continue; + } + + if (!isset($tables[$i][Import::COL_NAMES])) { + $tables[$i][] = $rows[$j][Import::COL_NAMES]; + } + + $tables[$i][Import::ROWS] = $rows[$j][Import::ROWS]; + } + } + + /* No longer needed */ + unset($rows); + + /* Obtain the best-fit MySQL types for each column */ + $analyses = array(); + + $len = count($tables); + for ($i = 0; $i < $len; ++$i) { + $analyses[] = Import::analyzeTable($tables[$i]); + } + + /** + * string $db_name (no backquotes) + * + * array $table = array(table_name, array() column_names, array()() rows) + * array $tables = array of "$table"s + * + * array $analysis = array(array() column_types, array() column_sizes) + * array $analyses = array of "$analysis"s + * + * array $create = array of SQL strings + * + * array $options = an associative array of options + */ + + /* Set database name to the currently selected one, if applicable */ + list($db_name, $options) = $this->getDbnameAndOptions($db, 'ODS_DB'); + + /* Non-applicable parameters */ + $create = null; + + /* Created and execute necessary SQL statements from data */ + Import::buildSql($db_name, $tables, $analyses, $create, $options, $sql_data); + + unset($tables); + unset($analyses); + + /* Commit any possible data in buffers */ + Import::runQuery('', '', $sql_data); + } + + /** + * Get value + * + * @param array $cell_attrs Cell attributes + * @param array $text Texts + * + * @return float|string + */ + protected function getValue($cell_attrs, $text) + { + if ($_REQUEST['ods_recognize_percentages'] + && !strcmp( + 'percentage', + $cell_attrs['value-type'] + ) + ) { + $value = (double)$cell_attrs['value']; + + return $value; + } elseif ($_REQUEST['ods_recognize_currency'] + && !strcmp('currency', $cell_attrs['value-type']) + ) { + $value = (double)$cell_attrs['value']; + + return $value; + } + + /* We need to concatenate all paragraphs */ + $values = array(); + foreach ($text as $paragraph) { + $values[] = (string)$paragraph; + } + $value = implode("\n", $values); + + return $value; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/ImportShp.php b/phpMyAdmin/libraries/classes/Plugins/Import/ImportShp.php new file mode 100755 index 0000000..c5d8b52 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/ImportShp.php @@ -0,0 +1,318 @@ +setProperties(); + if (extension_loaded('zip')) { + $this->zipExtension = new ZipExtension(); + } + } + + /** + * Sets the import plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + $importPluginProperties = new ImportPluginProperties(); + $importPluginProperties->setText(__('ESRI Shape File')); + $importPluginProperties->setExtension('shp'); + $importPluginProperties->setOptions(array()); + $importPluginProperties->setOptionsText(__('Options')); + + $this->properties = $importPluginProperties; + } + + /** + * Handles the whole import logic + * + * @param array &$sql_data 2-element array with sql data + * + * @return void + */ + public function doImport(array &$sql_data = array()) + { + global $db, $error, $finished, + $import_file, $local_import_file, $message; + + $GLOBALS['finished'] = false; + + $compression = $GLOBALS['import_handle']->getCompression(); + + $shp = new ShapeFileImport(1); + // If the zip archive has more than one file, + // get the correct content to the buffer from .shp file. + if ($compression == 'application/zip' + && $this->zipExtension->getNumberOfFiles($import_file) > 1 + ) { + if ($GLOBALS['import_handle']->openZip('/^.*\.shp$/i') === false) { + $message = Message::error( + __('There was an error importing the ESRI shape file: "%s".') + ); + $message->addParam($GLOBALS['import_handle']->getError()); + + return; + } + } + + $temp_dbf_file = false; + // We need dbase extension to handle .dbf file + if (extension_loaded('dbase')) { + $temp = $GLOBALS['PMA_Config']->getTempDir('shp'); + // If we can extract the zip archive to 'TempDir' + // and use the files in it for import + if ($compression == 'application/zip' && ! is_null($temp)) { + $dbf_file_name = $this->zipExtension->findFile( + $import_file, + '/^.*\.dbf$/i' + ); + // If the corresponding .dbf file is in the zip archive + if ($dbf_file_name) { + // Extract the .dbf file and point to it. + $extracted = $this->zipExtension->extract( + $import_file, + $dbf_file_name + ); + if ($extracted !== false) { + $dbf_file_path = $temp . (PMA_IS_WINDOWS ? '\\' : '/') + . Sanitize::sanitizeFilename($dbf_file_name, true); + $handle = fopen($dbf_file_path, 'wb'); + if ($handle !== false) { + fwrite($handle, $extracted); + fclose($handle); + $temp_dbf_file = true; + // Replace the .dbf with .*, as required + // by the bsShapeFiles library. + $file_name = substr( + $dbf_file_path, 0, strlen($dbf_file_path) - 4 + ) . '.*'; + $shp->FileName = $file_name; + } + } + } + } elseif (!empty($local_import_file) + && !empty($GLOBALS['cfg']['UploadDir']) + && $compression == 'none' + ) { + // If file is in UploadDir, use .dbf file in the same UploadDir + // to load extra data. + // Replace the .shp with .*, + // so the bsShapeFiles library correctly locates .dbf file. + $file_name = mb_substr( + $import_file, + 0, + mb_strlen($import_file) - 4 + ) . '.*'; + $shp->FileName = $file_name; + } + } + + // Delete the .dbf file extracted to 'TempDir' + if ($temp_dbf_file + && isset($dbf_file_path) + && @file_exists($dbf_file_path) + ) { + unlink($dbf_file_path); + } + + // Load data + $shp->loadFromFile(''); + if ($shp->lastError != "") { + $error = true; + $message = Message::error( + __('There was an error importing the ESRI shape file: "%s".') + ); + $message->addParam($shp->lastError); + + return; + } + + switch ($shp->shapeType) { + // ESRI Null Shape + case 0: + break; + // ESRI Point + case 1: + $gis_type = 'point'; + break; + // ESRI PolyLine + case 3: + $gis_type = 'multilinestring'; + break; + // ESRI Polygon + case 5: + $gis_type = 'multipolygon'; + break; + // ESRI MultiPoint + case 8: + $gis_type = 'multipoint'; + break; + default: + $error = true; + $message = Message::error( + __('MySQL Spatial Extension does not support ESRI type "%s".') + ); + $message->addParam($shp->getShapeName()); + return; + } + + if (isset($gis_type)) { + /** @var GisMultiLineString|\PhpMyAdmin\Gis\GisMultiPoint|\PhpMyAdmin\Gis\GisPoint|GisPolygon $gis_obj */ + $gis_obj = GisFactory::factory($gis_type); + } else { + $gis_obj = null; + } + + $num_rows = count($shp->records); + // If .dbf file is loaded, the number of extra data columns + $num_data_cols = isset($shp->DBFHeader) ? count($shp->DBFHeader) : 0; + + $rows = array(); + $col_names = array(); + if ($num_rows != 0) { + foreach ($shp->records as $record) { + $tempRow = array(); + if ($gis_obj == null) { + $tempRow[] = null; + } else { + $tempRow[] = "GeomFromText('" + . $gis_obj->getShape($record->SHPData) . "')"; + } + + if (isset($shp->DBFHeader)) { + foreach ($shp->DBFHeader as $c) { + $cell = trim($record->DBFData[$c[0]]); + + if (!strcmp($cell, '')) { + $cell = 'NULL'; + } + + $tempRow[] = $cell; + } + } + $rows[] = $tempRow; + } + } + + if (count($rows) == 0) { + $error = true; + $message = Message::error( + __('The imported file does not contain any data!') + ); + + return; + } + + // Column names for spatial column and the rest of the columns, + // if they are available + $col_names[] = 'SPATIAL'; + for ($n = 0; $n < $num_data_cols; $n++) { + $col_names[] = $shp->DBFHeader[$n][0]; + } + + // Set table name based on the number of tables + if (strlen($db) > 0) { + $result = $GLOBALS['dbi']->fetchResult('SHOW TABLES'); + $table_name = 'TABLE ' . (count($result) + 1); + } else { + $table_name = 'TBL_NAME'; + } + $tables = array(array($table_name, $col_names, $rows)); + + // Use data from shape file to chose best-fit MySQL types for each column + $analyses = array(); + $analyses[] = Import::analyzeTable($tables[0]); + + $table_no = 0; + $spatial_col = 0; + $analyses[$table_no][Import::TYPES][$spatial_col] = Import::GEOMETRY; + $analyses[$table_no][Import::FORMATTEDSQL][$spatial_col] = true; + + // Set database name to the currently selected one, if applicable + if (strlen($db) > 0) { + $db_name = $db; + $options = array('create_db' => false); + } else { + $db_name = 'SHP_DB'; + $options = null; + } + + // Created and execute necessary SQL statements from data + $null_param = null; + Import::buildSql($db_name, $tables, $analyses, $null_param, $options, $sql_data); + + unset($tables); + unset($analyses); + + $finished = true; + $error = false; + + // Commit any possible data in buffers + Import::runQuery('', '', $sql_data); + } + + /** + * Returns specified number of bytes from the buffer. + * Buffer automatically fetches next chunk of data when the buffer + * falls short. + * Sets $eof when $GLOBALS['finished'] is set and the buffer falls short. + * + * @param int $length number of bytes + * + * @return string + */ + public static function readFromBuffer($length) + { + global $buffer, $eof; + + if (strlen($buffer) < $length) { + if ($GLOBALS['finished']) { + $eof = true; + } else { + $buffer .= Import::getNextChunk(); + } + } + $result = substr($buffer, 0, $length); + $buffer = substr($buffer, $length); + + return $result; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/ImportSql.php b/phpMyAdmin/libraries/classes/Plugins/Import/ImportSql.php new file mode 100755 index 0000000..240b8ba --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/ImportSql.php @@ -0,0 +1,198 @@ +setProperties(); + } + + /** + * Sets the import plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + $importPluginProperties = new ImportPluginProperties(); + $importPluginProperties->setText('SQL'); + $importPluginProperties->setExtension('sql'); + $importPluginProperties->setOptionsText(__('Options')); + + $compats = $GLOBALS['dbi']->getCompatibilities(); + if (count($compats) > 0) { + $values = array(); + foreach ($compats as $val) { + $values[$val] = $val; + } + + // create the root group that will be the options field for + // $importPluginProperties + // this will be shown as "Format specific options" + $importSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new OptionsPropertyMainGroup("general_opts"); + // create primary items and add them to the group + $leaf = new SelectPropertyItem( + "compatibility", + __('SQL compatibility mode:') + ); + $leaf->setValues($values); + $leaf->setDoc( + array( + 'manual_MySQL_Database_Administration', + 'Server_SQL_mode', + ) + ); + $generalOptions->addProperty($leaf); + $leaf = new BoolPropertyItem( + "no_auto_value_on_zero", + __('Do not use AUTO_INCREMENT for zero values') + ); + $leaf->setDoc( + array( + 'manual_MySQL_Database_Administration', + 'Server_SQL_mode', + 'sqlmode_no_auto_value_on_zero', + ) + ); + $generalOptions->addProperty($leaf); + + // add the main group to the root group + $importSpecificOptions->addProperty($generalOptions); + // set the options for the import plugin property item + $importPluginProperties->setOptions($importSpecificOptions); + } + + $this->properties = $importPluginProperties; + } + + /** + * Handles the whole import logic + * + * @param array &$sql_data 2-element array with sql data + * + * @return void + */ + public function doImport(array &$sql_data = array()) + { + global $error, $timeout_passed; + + // Handle compatibility options. + $this->_setSQLMode($GLOBALS['dbi'], $_REQUEST); + + $bq = new BufferedQuery(); + if (isset($_POST['sql_delimiter'])) { + $bq->setDelimiter($_POST['sql_delimiter']); + } + + /** + * Will be set in Import::getNextChunk(). + * + * @global bool $GLOBALS ['finished'] + */ + $GLOBALS['finished'] = false; + + while ((!$error) && (!$timeout_passed)) { + + // Getting the first statement, the remaining data and the last + // delimiter. + $statement = $bq->extract(); + + // If there is no full statement, we are looking for more data. + if (empty($statement)) { + + // Importing new data. + $newData = Import::getNextChunk(); + + // Subtract data we didn't handle yet and stop processing. + if ($newData === false) { + $GLOBALS['offset'] -= mb_strlen($bq->query); + break; + } + + // Checking if the input buffer has finished. + if ($newData === true) { + $GLOBALS['finished'] = true; + break; + } + + // Convert CR (but not CRLF) to LF otherwise all queries may + // not get executed on some platforms. + $bq->query .= preg_replace("/\r($|[^\n])/", "\n$1", $newData); + + continue; + } + + // Executing the query. + Import::runQuery($statement, $statement, $sql_data); + } + + // Extracting remaining statements. + while ((!$error) && (!$timeout_passed) && (!empty($bq->query))) { + $statement = $bq->extract(true); + if (!empty($statement)) { + Import::runQuery($statement, $statement, $sql_data); + } + } + + // Finishing. + Import::runQuery('', '', $sql_data); + } + + /** + * Handle compatibility options + * + * @param PhpMyAdmin\DatabaseInterface $dbi Database interface + * @param array $request Request array + * + * @return void + */ + private function _setSQLMode($dbi, array $request) + { + $sql_modes = array(); + if (isset($request['sql_compatibility']) + && 'NONE' != $request['sql_compatibility'] + ) { + $sql_modes[] = $request['sql_compatibility']; + } + if (isset($request['sql_no_auto_value_on_zero'])) { + $sql_modes[] = 'NO_AUTO_VALUE_ON_ZERO'; + } + if (count($sql_modes) > 0) { + $dbi->tryQuery( + 'SET SQL_MODE="' . implode(',', $sql_modes) . '"' + ); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/ImportXml.php b/phpMyAdmin/libraries/classes/Plugins/Import/ImportXml.php new file mode 100755 index 0000000..6de2ace --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/ImportXml.php @@ -0,0 +1,371 @@ +setProperties(); + } + + /** + * Sets the import plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + $importPluginProperties = new ImportPluginProperties(); + $importPluginProperties->setText(__('XML')); + $importPluginProperties->setExtension('xml'); + $importPluginProperties->setMimeType('text/xml'); + $importPluginProperties->setOptions(array()); + $importPluginProperties->setOptionsText(__('Options')); + + $this->properties = $importPluginProperties; + } + + /** + * Handles the whole import logic + * + * @param array &$sql_data 2-element array with sql data + * + * @return void + */ + public function doImport(array &$sql_data = array()) + { + global $error, $timeout_passed, $finished, $db; + + $i = 0; + $len = 0; + $buffer = ""; + + /** + * Read in the file via Import::getNextChunk so that + * it can process compressed files + */ + while (!($finished && $i >= $len) && !$error && !$timeout_passed) { + $data = Import::getNextChunk(); + if ($data === false) { + /* subtract data we didn't handle yet and stop processing */ + $GLOBALS['offset'] -= strlen($buffer); + break; + } elseif ($data === true) { + /* Handle rest of buffer */ + } else { + /* Append new data to buffer */ + $buffer .= $data; + unset($data); + } + } + + unset($data); + + /** + * Disable loading of external XML entities. + */ + libxml_disable_entity_loader(); + + /** + * Load the XML string + * + * The option LIBXML_COMPACT is specified because it can + * result in increased performance without the need to + * alter the code in any way. It's basically a freebee. + */ + $xml = @simplexml_load_string($buffer, "SimpleXMLElement", LIBXML_COMPACT); + + unset($buffer); + + /** + * The XML was malformed + */ + if ($xml === false) { + Message::error( + __( + 'The XML file specified was either malformed or incomplete.' + . ' Please correct the issue and try again.' + ) + ) + ->display(); + unset($xml); + $GLOBALS['finished'] = false; + + return; + } + + /** + * Table accumulator + */ + $tables = array(); + /** + * Row accumulator + */ + $rows = array(); + + /** + * Temp arrays + */ + $tempRow = array(); + $tempCells = array(); + + /** + * CREATE code included (by default: no) + */ + $struct_present = false; + + /** + * Analyze the data in each table + */ + $namespaces = $xml->getNameSpaces(true); + + /** + * Get the database name, collation and charset + */ + $db_attr = $xml->children(isset($namespaces['pma']) ? $namespaces['pma'] : null) + ->{'structure_schemas'}->{'database'}; + + if ($db_attr instanceof SimpleXMLElement) { + $db_attr = $db_attr->attributes(); + $db_name = (string)$db_attr['name']; + $collation = (string)$db_attr['collation']; + $charset = (string)$db_attr['charset']; + } else { + /** + * If the structure section is not present + * get the database name from the data section + */ + $db_attr = $xml->children() + ->attributes(); + $db_name = (string)$db_attr['name']; + $collation = null; + $charset = null; + } + + /** + * The XML was malformed + */ + if ($db_name === null) { + Message::error( + __( + 'The XML file specified was either malformed or incomplete.' + . ' Please correct the issue and try again.' + ) + ) + ->display(); + unset($xml); + $GLOBALS['finished'] = false; + + return; + } + + /** + * Retrieve the structure information + */ + if (isset($namespaces['pma'])) { + /** + * Get structures for all tables + * + * @var SimpleXMLElement $struct + */ + $struct = $xml->children($namespaces['pma']); + + $create = array(); + + /** @var SimpleXMLElement $val1 */ + foreach ($struct as $val1) { + /** @var SimpleXMLElement $val2 */ + foreach ($val1 as $val2) { + // Need to select the correct database for the creation of + // tables, views, triggers, etc. + /** + * @todo Generating a USE here blocks importing of a table + * into another database. + */ + $attrs = $val2->attributes(); + $create[] = "USE " + . Util::backquote( + $attrs["name"] + ); + + foreach ($val2 as $val3) { + /** + * Remove the extra cosmetic spacing + */ + $val3 = str_replace(" ", "", (string)$val3); + $create[] = $val3; + } + } + } + + $struct_present = true; + } + + /** + * Move down the XML tree to the actual data + */ + $xml = $xml->children() + ->children(); + + $data_present = false; + + /** + * Only attempt to analyze/collect data if there is data present + */ + if ($xml && @count($xml->children())) { + $data_present = true; + + /** + * Process all database content + */ + foreach ($xml as $v1) { + $tbl_attr = $v1->attributes(); + + $isInTables = false; + $num_tables = count($tables); + for ($i = 0; $i < $num_tables; ++$i) { + if (!strcmp($tables[$i][Import::TBL_NAME], (string)$tbl_attr['name'])) { + $isInTables = true; + break; + } + } + + if (!$isInTables) { + $tables[] = array((string)$tbl_attr['name']); + } + + foreach ($v1 as $v2) { + $row_attr = $v2->attributes(); + if (!array_search((string)$row_attr['name'], $tempRow)) { + $tempRow[] = (string)$row_attr['name']; + } + $tempCells[] = (string)$v2; + } + + $rows[] = array((string)$tbl_attr['name'], $tempRow, $tempCells); + + $tempRow = array(); + $tempCells = array(); + } + + unset($tempRow); + unset($tempCells); + unset($xml); + + /** + * Bring accumulated rows into the corresponding table + */ + $num_tables = count($tables); + for ($i = 0; $i < $num_tables; ++$i) { + $num_rows = count($rows); + for ($j = 0; $j < $num_rows; ++$j) { + if (!strcmp($tables[$i][Import::TBL_NAME], $rows[$j][Import::TBL_NAME])) { + if (!isset($tables[$i][Import::COL_NAMES])) { + $tables[$i][] = $rows[$j][Import::COL_NAMES]; + } + + $tables[$i][Import::ROWS][] = $rows[$j][Import::ROWS]; + } + } + } + + unset($rows); + + if (!$struct_present) { + $analyses = array(); + + $len = count($tables); + for ($i = 0; $i < $len; ++$i) { + $analyses[] = Import::analyzeTable($tables[$i]); + } + } + } + + unset($xml); + unset($tempCells); + unset($rows); + + /** + * Only build SQL from data if there is data present + */ + if ($data_present) { + /** + * Set values to NULL if they were not present + * to maintain Import::buildSql() call integrity + */ + if (!isset($analyses)) { + $analyses = null; + if (!$struct_present) { + $create = null; + } + } + } + + /** + * string $db_name (no backquotes) + * + * array $table = array(table_name, array() column_names, array()() rows) + * array $tables = array of "$table"s + * + * array $analysis = array(array() column_types, array() column_sizes) + * array $analyses = array of "$analysis"s + * + * array $create = array of SQL strings + * + * array $options = an associative array of options + */ + + /* Set database name to the currently selected one, if applicable */ + if (strlen($db)) { + /* Override the database name in the XML file, if one is selected */ + $db_name = $db; + $options = array('create_db' => false); + } else { + if ($db_name === null) { + $db_name = 'XML_DB'; + } + + /* Set database collation/charset */ + $options = array( + 'db_collation' => $collation, + 'db_charset' => $charset, + ); + } + + /* Created and execute necessary SQL statements from data */ + Import::buildSql($db_name, $tables, $analyses, $create, $options, $sql_data); + + unset($analyses); + unset($tables); + unset($create); + + /* Commit any possible data in buffers */ + Import::runQuery('', '', $sql_data); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/README b/phpMyAdmin/libraries/classes/Plugins/Import/README new file mode 100755 index 0000000..20b856e --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/README @@ -0,0 +1,153 @@ +This directory holds import plugins for phpMyAdmin. Any new plugin should +basically follow the structure presented here. The messages must use our +gettext mechanism, see https://wiki.phpmyadmin.net/pma/Gettext_for_developers. + +setProperties(); + } + + /** + * Sets the import plugin properties. + * Called in the constructor. + * + * @return void + */ + protected function setProperties() + { + $importPluginProperties = new PhpMyAdmin\Properties\Plugins\ImportPluginProperties(); + $importPluginProperties->setText('[name]'); // the name of your plug-in + $importPluginProperties->setExtension('[ext]'); // extension this plug-in can handle + $importPluginProperties->setOptionsText(__('Options')); + + // create the root group that will be the options field for + // $importPluginProperties + // this will be shown as "Format specific options" + $importSpecificOptions = new + PhpMyAdmin\Properties\Options\Groups\OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // general options main group + $generalOptions = new PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup( + "general_opts" + ); + + // optional : + // create primary items and add them to the group + // type - one of the classes listed in libraries/properties/options/items/ + // name - form element name + // text - description in GUI + // size - size of text element + // len - maximal size of input + // values - possible values of the item + $leaf = new PhpMyAdmin\Properties\Options\Items\RadioPropertyItem( + "structure_or_data" + ); + $leaf->setValues( + array( + 'structure' => __('structure'), + 'data' => __('data'), + 'structure_and_data' => __('structure and data') + ) + ); + $generalOptions->addProperty($leaf); + + // add the main group to the root group + $importSpecificOptions->addProperty($generalOptions); + + // set the options for the import plugin property item + $importPluginProperties->setOptions($importSpecificOptions); + $this->properties = $importPluginProperties; + } + + /** + * Handles the whole import logic + * + * @param array &$sql_data 2-element array with sql data + * + * @return void + */ + public function doImport(&$sql_data = array()) + { + // get globals (others are optional) + global $error, $timeout_passed, $finished; + + $buffer = ''; + while (! ($finished && $i >= $len) && ! $error && ! $timeout_passed) { + $data = Import::getNextChunk(); + if ($data === false) { + // subtract data we didn't handle yet and stop processing + $GLOBALS['offset'] -= strlen($buffer); + break; + } elseif ($data === true) { + // Handle rest of buffer + } else { + // Append new data to buffer + $buffer .= $data; + } + // PARSE $buffer here, post sql queries using: + Import::runQuery($sql, $verbose_sql_with_comments, $sql_data); + } // End of import loop + // Commit any possible data in buffers + Import::runQuery('', '', $sql_data); + } + + + // optional: + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + + /** + * Getter description + * + * @return type + */ + private function _getMyOptionalVariable() + { + return $this->_myOptionalVariable; + } + + /** + * Setter description + * + * @param type $my_optional_variable description + * + * @return void + */ + private function _setMyOptionalVariable($my_optional_variable) + { + $this->_myOptionalVariable = $my_optional_variable; + } +} +?> diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/ShapeFileImport.php b/phpMyAdmin/libraries/classes/Plugins/Import/ShapeFileImport.php new file mode 100755 index 0000000..eadb52e --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/ShapeFileImport.php @@ -0,0 +1,44 @@ + $id, + 'finished' => false, + 'percent' => 0, + 'total' => 0, + 'complete' => 0, + 'plugin' => UploadApc::getIdKey(), + ); + } + $ret = $_SESSION[$SESSION_KEY][$id]; + + if (!ImportAjax::apcCheck() || $ret['finished']) { + return $ret; + } + $status = apc_fetch('upload_' . $id); + + if ($status) { + $ret['finished'] = (bool)$status['done']; + $ret['total'] = $status['total']; + $ret['complete'] = $status['current']; + + if ($ret['total'] > 0) { + $ret['percent'] = $ret['complete'] / $ret['total'] * 100; + } + + if ($ret['percent'] == 100) { + $ret['finished'] = (bool)true; + } + + $_SESSION[$SESSION_KEY][$id] = $ret; + } + + return $ret; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadNoplugin.php b/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadNoplugin.php new file mode 100755 index 0000000..b2539fe --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadNoplugin.php @@ -0,0 +1,60 @@ + $id, + 'finished' => false, + 'percent' => 0, + 'total' => 0, + 'complete' => 0, + 'plugin' => UploadNoplugin::getIdKey(), + ); + } + $ret = $_SESSION[$SESSION_KEY][$id]; + + return $ret; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadProgress.php b/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadProgress.php new file mode 100755 index 0000000..bc68c73 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadProgress.php @@ -0,0 +1,92 @@ + $id, + 'finished' => false, + 'percent' => 0, + 'total' => 0, + 'complete' => 0, + 'plugin' => UploadProgress::getIdKey(), + ); + } + $ret = $_SESSION[$SESSION_KEY][$id]; + + if (!ImportAjax::progressCheck() || $ret['finished']) { + return $ret; + } + + $status = uploadprogress_get_info($id); + + if ($status) { + if ($status['bytes_uploaded'] == $status['bytes_total']) { + $ret['finished'] = true; + } else { + $ret['finished'] = false; + } + $ret['total'] = $status['bytes_total']; + $ret['complete'] = $status['bytes_uploaded']; + + if ($ret['total'] > 0) { + $ret['percent'] = $ret['complete'] / $ret['total'] * 100; + } + } else { + $ret = array( + 'id' => $id, + 'finished' => true, + 'percent' => 100, + 'total' => $ret['total'], + 'complete' => $ret['total'], + 'plugin' => UploadProgress::getIdKey(), + ); + } + + $_SESSION[$SESSION_KEY][$id] = $ret; + + return $ret; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadSession.php b/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadSession.php new file mode 100755 index 0000000..5c2ded0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Import/Upload/UploadSession.php @@ -0,0 +1,93 @@ + $id, + 'finished' => false, + 'percent' => 0, + 'total' => 0, + 'complete' => 0, + 'plugin' => UploadSession::getIdKey(), + ); + } + $ret = $_SESSION[$SESSION_KEY][$id]; + + if (!ImportAjax::sessionCheck() || $ret['finished']) { + return $ret; + } + + $status = false; + $sessionkey = ini_get('session.upload_progress.prefix') . $id; + + if (isset($_SESSION[$sessionkey])) { + $status = $_SESSION[$sessionkey]; + } + + if ($status) { + $ret['finished'] = $status['done']; + $ret['total'] = $status['content_length']; + $ret['complete'] = $status['bytes_processed']; + + if ($ret['total'] > 0) { + $ret['percent'] = $ret['complete'] / $ret['total'] * 100; + } + } else { + $ret = array( + 'id' => $id, + 'finished' => true, + 'percent' => 100, + 'total' => $ret['total'], + 'complete' => $ret['total'], + 'plugin' => UploadSession::getIdKey(), + ); + } + + $_SESSION[$SESSION_KEY][$id] = $ret; + + return $ret; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/ImportPlugin.php b/phpMyAdmin/libraries/classes/Plugins/ImportPlugin.php new file mode 100755 index 0000000..42ed228 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/ImportPlugin.php @@ -0,0 +1,76 @@ +properties; + } + + /** + * Sets the export plugins properties and is implemented by each import + * plugin + * + * @return void + */ + abstract protected function setProperties(); + + /** + * Define DB name and options + * + * @param string $currentDb DB + * @param string $defaultDb Default DB name + * + * @return array DB name and options (an associative array of options) + */ + protected function getDbnameAndOptions($currentDb, $defaultDb) + { + if (strlen($currentDb) > 0) { + $db_name = $currentDb; + $options = array('create_db' => false); + } else { + $db_name = $defaultDb; + $options = null; + } + + return array($db_name, $options); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/Dia.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/Dia.php new file mode 100755 index 0000000..4690382 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/Dia.php @@ -0,0 +1,188 @@ +openMemory(); + /* + * Set indenting using three spaces, + * so output is formatted + */ + $this->setIndent(true); + $this->setIndentString(' '); + /* + * Create the XML document + */ + $this->startDocument('1.0', 'UTF-8'); + } + + /** + * Starts Dia Document + * + * dia document starts by first initializing dia:diagram tag + * then dia:diagramdata contains all the attributes that needed + * to define the document, then finally a Layer starts which + * holds all the objects. + * + * @param string $paper the size of the paper/document + * @param float $topMargin top margin of the paper/document in cm + * @param float $bottomMargin bottom margin of the paper/document in cm + * @param float $leftMargin left margin of the paper/document in cm + * @param float $rightMargin right margin of the paper/document in cm + * @param string $orientation orientation of the document, portrait or landscape + * + * @return void + * + * @access public + * @see XMLWriter::startElement(),XMLWriter::writeAttribute(), + * XMLWriter::writeRaw() + */ + public function startDiaDoc( + $paper, + $topMargin, + $bottomMargin, + $leftMargin, + $rightMargin, + $orientation + ) { + if ($orientation == 'P') { + $isPortrait = 'true'; + } else { + $isPortrait = 'false'; + } + $this->startElement('dia:diagram'); + $this->writeAttribute('xmlns:dia', 'http://www.lysator.liu.se/~alla/dia/'); + $this->startElement('dia:diagramdata'); + $this->writeRaw( + ' + + + + + + + + + #' . $paper . '# + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ' + ); + $this->endElement(); + $this->startElement('dia:layer'); + $this->writeAttribute('name', 'Background'); + $this->writeAttribute('visible', 'true'); + $this->writeAttribute('active', 'true'); + } + + /** + * Ends Dia Document + * + * @return void + * @access public + * @see XMLWriter::endElement(),XMLWriter::endDocument() + */ + public function endDiaDoc() + { + $this->endElement(); + $this->endDocument(); + } + + /** + * Output Dia Document for download + * + * @param string $fileName name of the dia document + * + * @return void + * @access public + * @see XMLWriter::flush() + */ + public function showOutput($fileName) + { + if (ob_get_clean()) { + ob_end_clean(); + } + $output = $this->flush(); + Response::getInstance()->disable(); + Core::downloadHeader( + $fileName, + 'application/x-dia-diagram', + strlen($output) + ); + print $output; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php new file mode 100755 index 0000000..8797961 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php @@ -0,0 +1,228 @@ +setShowColor(isset($_REQUEST['dia_show_color'])); + $this->setShowKeys(isset($_REQUEST['dia_show_keys'])); + $this->setOrientation($_REQUEST['dia_orientation']); + $this->setPaper($_REQUEST['dia_paper']); + + $this->diagram->startDiaDoc( + $this->paper, + $this->_topMargin, + $this->_bottomMargin, + $this->_leftMargin, + $this->_rightMargin, + $this->orientation + ); + + $alltables = $this->getTablesFromRequest(); + + foreach ($alltables as $table) { + if (!isset($this->tables[$table])) { + $this->_tables[$table] = new TableStatsDia( + $this->diagram, $this->db, $table, $this->pageNumber, + $this->showKeys, $this->offline + ); + } + } + + $seen_a_relation = false; + foreach ($alltables as $one_table) { + $exist_rel = $this->relation->getForeigners($this->db, $one_table, '', 'both'); + if (!$exist_rel) { + continue; + } + + $seen_a_relation = true; + foreach ($exist_rel as $master_field => $rel) { + /* put the foreign table on the schema only if selected + * by the user + * (do not use array_search() because we would have to + * to do a === false and this is not PHP3 compatible) + */ + if ($master_field != 'foreign_keys_data') { + if (in_array($rel['foreign_table'], $alltables)) { + $this->_addRelation( + $one_table, + $master_field, + $rel['foreign_table'], + $rel['foreign_field'], + $this->showKeys + ); + } + continue; + } + + foreach ($rel as $one_key) { + if (!in_array($one_key['ref_table_name'], $alltables)) { + continue; + } + + foreach ($one_key['index_list'] as $index => $one_field) { + $this->_addRelation( + $one_table, + $one_field, + $one_key['ref_table_name'], + $one_key['ref_index_list'][$index], + $this->showKeys + ); + } + } + } + } + $this->_drawTables(); + + if ($seen_a_relation) { + $this->_drawRelations(); + } + $this->diagram->endDiaDoc(); + } + + /** + * Output Dia Document for download + * + * @return void + * @access public + */ + public function showOutput() + { + $this->diagram->showOutput($this->getFileName('.dia')); + } + + /** + * Defines relation objects + * + * @param string $masterTable The master table name + * @param string $masterField The relation field in the master table + * @param string $foreignTable The foreign table name + * @param string $foreignField The relation field in the foreign table + * @param bool $showKeys Whether to display ONLY keys or not + * + * @return void + * + * @access private + * @see TableStatsDia::__construct(),RelationStatsDia::__construct() + */ + private function _addRelation( + $masterTable, + $masterField, + $foreignTable, + $foreignField, + $showKeys + ) { + if (!isset($this->_tables[$masterTable])) { + $this->_tables[$masterTable] = new TableStatsDia( + $this->diagram, $this->db, $masterTable, $this->pageNumber, $showKeys + ); + } + if (!isset($this->_tables[$foreignTable])) { + $this->_tables[$foreignTable] = new TableStatsDia( + $this->diagram, + $this->db, + $foreignTable, + $this->pageNumber, + $showKeys + ); + } + $this->_relations[] = new RelationStatsDia( + $this->diagram, + $this->_tables[$masterTable], + $masterField, + $this->_tables[$foreignTable], + $foreignField + ); + } + + /** + * Draws relation references + * + * connects master table's master field to + * foreign table's foreign field using Dia object + * type Database - Reference + * + * @return void + * + * @access private + * @see RelationStatsDia::relationDraw() + */ + private function _drawRelations() + { + foreach ($this->_relations as $relation) { + $relation->relationDraw($this->showColor); + } + } + + /** + * Draws tables + * + * Tables are generated using Dia object type Database - Table + * primary fields are underlined and bold in tables + * + * @return void + * + * @access private + * @see TableStatsDia::tableDraw() + */ + private function _drawTables() + { + foreach ($this->_tables as $table) { + $table->tableDraw($this->showColor); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/RelationStatsDia.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/RelationStatsDia.php new file mode 100755 index 0000000..d645f66 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/RelationStatsDia.php @@ -0,0 +1,214 @@ +diagram = $diagram; + $src_pos = $this->_getXy($master_table, $master_field); + $dest_pos = $this->_getXy($foreign_table, $foreign_field); + $this->srcConnPointsLeft = $src_pos[0]; + $this->srcConnPointsRight = $src_pos[1]; + $this->destConnPointsLeft = $dest_pos[0]; + $this->destConnPointsRight = $dest_pos[1]; + $this->masterTablePos = $src_pos[2]; + $this->foreignTablePos = $dest_pos[2]; + $this->masterTableId = $master_table->tableId; + $this->foreignTableId = $foreign_table->tableId; + } + + /** + * Each Table object have connection points + * which is used to connect to other objects in Dia + * we detect the position of key in fields and + * then determines its left and right connection + * points. + * + * @param string $table The current table name + * @param string $column The relation column name + * + * @return array Table right,left connection points and key position + * + * @access private + */ + private function _getXy($table, $column) + { + $pos = array_search($column, $table->fields); + // left, right, position + $value = 12; + if ($pos != 0) { + return array($pos + $value + $pos, $pos + $value + $pos + 1, $pos); + } + return array($pos + $value , $pos + $value + 1, $pos); + } + + /** + * Draws relation references + * + * connects master table's master field to foreign table's + * foreign field using Dia object type Database - Reference + * Dia object is used to generate the XML of Dia Document. + * Database reference Object and their attributes are involved + * in the combination of displaying Database - reference on Dia Document. + * + * @param boolean $showColor Whether to use one color per relation or not + * if showColor is true then an array of $listOfColors + * will be used to choose the random colors for + * references lines. we can change/add more colors to + * this + * + * @return boolean|void + * + * @access public + * @see PDF + */ + public function relationDraw($showColor) + { + ++DiaRelationSchema::$objectId; + /* + * if source connection points and destination connection + * points are same then return it false and don't draw that + * relation + */ + if ($this->srcConnPointsRight == $this->destConnPointsRight) { + if ($this->srcConnPointsLeft == $this->destConnPointsLeft) { + return false; + } + } + + if ($showColor) { + $listOfColors = array( + 'FF0000', + '000099', + '00FF00', + ); + shuffle($listOfColors); + $this->referenceColor = '#' . $listOfColors[0] . ''; + } else { + $this->referenceColor = '#000000'; + } + + $this->diagram->writeRaw( + ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #1# + + + #n# + + + + + + + + + + + + ' + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/TableStatsDia.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/TableStatsDia.php new file mode 100755 index 0000000..470f762 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Dia/TableStatsDia.php @@ -0,0 +1,229 @@ +tableId = ++DiaRelationSchema::$objectId; + } + + /** + * Displays an error when the table cannot be found. + * + * @return void + */ + protected function showMissingTableError() + { + ExportRelationSchema::dieSchema( + $this->pageNumber, + "DIA", + sprintf(__('The %s table doesn\'t exist!'), $this->tableName) + ); + } + + /** + * Do draw the table + * + * Tables are generated using object type Database - Table + * primary fields are underlined in tables. Dia object + * is used to generate the XML of Dia Document. Database Table + * Object and their attributes are involved in the combination + * of displaying Database - Table on Dia Document. + * + * @param boolean $showColor Whether to show color for tables text or not + * if showColor is true then an array of $listOfColors + * will be used to choose the random colors for tables + * text we can change/add more colors to this array + * + * @return void + * + * @access public + * @see Dia + */ + public function tableDraw($showColor) + { + if ($showColor) { + $listOfColors = array( + 'FF0000', + '000099', + '00FF00' + ); + shuffle($listOfColors); + $this->tableColor = '#' . $listOfColors[0] . ''; + } else { + $this->tableColor = '#000000'; + } + + $factor = 0.1; + + $this->diagram->startElement('dia:object'); + $this->diagram->writeAttribute('type', 'Database - Table'); + $this->diagram->writeAttribute('version', '0'); + $this->diagram->writeAttribute('id', '' . $this->tableId . ''); + $this->diagram->writeRaw( + ' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + #' . $this->tableName . '# + + + ## + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ' + ); + + $this->diagram->startElement('dia:attribute'); + $this->diagram->writeAttribute('name', 'attributes'); + + foreach ($this->fields as $field) { + $this->diagram->writeRaw( + ' + + #' . $field . '# + + + ## + + + ## + ' + ); + unset($pm); + $pm = 'false'; + if (in_array($field, $this->primary)) { + $pm = 'true'; + } + if ($field == $this->displayfield) { + $pm = 'false'; + } + $this->diagram->writeRaw( + ' + + + + + + + + + ' + ); + } + $this->diagram->endElement(); + $this->diagram->endElement(); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/Eps.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/Eps.php new file mode 100755 index 0000000..4f037e7 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/Eps.php @@ -0,0 +1,278 @@ +stringCommands = ""; + $this->stringCommands .= "%!PS-Adobe-3.0 EPSF-3.0 \n"; + } + + /** + * Set document title + * + * @param string $value sets the title text + * + * @return void + */ + public function setTitle($value) + { + $this->stringCommands .= '%%Title: ' . $value . "\n"; + } + + /** + * Set document author + * + * @param string $value sets the author + * + * @return void + */ + public function setAuthor($value) + { + $this->stringCommands .= '%%Creator: ' . $value . "\n"; + } + + /** + * Set document creation date + * + * @param string $value sets the date + * + * @return void + */ + public function setDate($value) + { + $this->stringCommands .= '%%CreationDate: ' . $value . "\n"; + } + + /** + * Set document orientation + * + * @param string $orientation sets the orientation + * + * @return void + */ + public function setOrientation($orientation) + { + $this->stringCommands .= "%%PageOrder: Ascend \n"; + if ($orientation == "L") { + $orientation = "Landscape"; + $this->stringCommands .= '%%Orientation: ' . $orientation . "\n"; + } else { + $orientation = "Portrait"; + $this->stringCommands .= '%%Orientation: ' . $orientation . "\n"; + } + $this->stringCommands .= "%%EndComments \n"; + $this->stringCommands .= "%%Pages 1 \n"; + $this->stringCommands .= "%%BoundingBox: 72 150 144 170 \n"; + } + + /** + * Set the font and size + * + * font can be set whenever needed in EPS + * + * @param string $value sets the font name e.g Arial + * @param integer $size sets the size of the font e.g 10 + * + * @return void + */ + public function setFont($value, $size) + { + $this->font = $value; + $this->fontSize = $size; + $this->stringCommands .= "/" . $value . " findfont % Get the basic font\n"; + $this->stringCommands .= "" + . $size . " scalefont % Scale the font to $size points\n"; + $this->stringCommands + .= "setfont % Make it the current font\n"; + } + + /** + * Get the font + * + * @return string return the font name e.g Arial + */ + public function getFont() + { + return $this->font; + } + + /** + * Get the font Size + * + * @return string return the size of the font e.g 10 + */ + public function getFontSize() + { + return $this->fontSize; + } + + /** + * Draw the line + * + * drawing the lines from x,y source to x,y destination and set the + * width of the line. lines helps in showing relationships of tables + * + * @param integer $x_from The x_from attribute defines the start + * left position of the element + * @param integer $y_from The y_from attribute defines the start + * right position of the element + * @param integer $x_to The x_to attribute defines the end + * left position of the element + * @param integer $y_to The y_to attribute defines the end + * right position of the element + * @param integer $lineWidth Sets the width of the line e.g 2 + * + * @return void + */ + public function line( + $x_from = 0, + $y_from = 0, + $x_to = 0, + $y_to = 0, + $lineWidth = 0 + ) { + $this->stringCommands .= $lineWidth . " setlinewidth \n"; + $this->stringCommands .= $x_from . ' ' . $y_from . " moveto \n"; + $this->stringCommands .= $x_to . ' ' . $y_to . " lineto \n"; + $this->stringCommands .= "stroke \n"; + } + + /** + * Draw the rectangle + * + * drawing the rectangle from x,y source to x,y destination and set the + * width of the line. rectangles drawn around the text shown of fields + * + * @param integer $x_from The x_from attribute defines the start + * left position of the element + * @param integer $y_from The y_from attribute defines the start + * right position of the element + * @param integer $x_to The x_to attribute defines the end + * left position of the element + * @param integer $y_to The y_to attribute defines the end + * right position of the element + * @param integer $lineWidth Sets the width of the line e.g 2 + * + * @return void + */ + public function rect($x_from, $y_from, $x_to, $y_to, $lineWidth) + { + $this->stringCommands .= $lineWidth . " setlinewidth \n"; + $this->stringCommands .= "newpath \n"; + $this->stringCommands .= $x_from . " " . $y_from . " moveto \n"; + $this->stringCommands .= "0 " . $y_to . " rlineto \n"; + $this->stringCommands .= $x_to . " 0 rlineto \n"; + $this->stringCommands .= "0 -" . $y_to . " rlineto \n"; + $this->stringCommands .= "closepath \n"; + $this->stringCommands .= "stroke \n"; + } + + /** + * Set the current point + * + * The moveto operator takes two numbers off the stack and treats + * them as x and y coordinates to which to move. The coordinates + * specified become the current point. + * + * @param integer $x The x attribute defines the left position of the element + * @param integer $y The y attribute defines the right position of the element + * + * @return void + */ + public function moveTo($x, $y) + { + $this->stringCommands .= $x . ' ' . $y . " moveto \n"; + } + + /** + * Output/Display the text + * + * @param string $text The string to be displayed + * + * @return void + */ + public function show($text) + { + $this->stringCommands .= '(' . $text . ") show \n"; + } + + /** + * Output the text at specified co-ordinates + * + * @param string $text String to be displayed + * @param integer $x X attribute defines the left position of the element + * @param integer $y Y attribute defines the right position of the element + * + * @return void + */ + public function showXY($text, $x, $y) + { + $this->moveTo($x, $y); + $this->show($text); + } + + /** + * Ends EPS Document + * + * @return void + */ + public function endEpsDoc() + { + $this->stringCommands .= "showpage \n"; + } + + /** + * Output EPS Document for download + * + * @param string $fileName name of the eps document + * + * @return void + */ + public function showOutput($fileName) + { + // if(ob_get_clean()){ + //ob_end_clean(); + //} + $output = $this->stringCommands; + Response::getInstance() + ->disable(); + Core::downloadHeader( + $fileName, + 'image/x-eps', + strlen($output) + ); + print $output; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php new file mode 100755 index 0000000..6056b15 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php @@ -0,0 +1,224 @@ +setShowColor(isset($_REQUEST['eps_show_color'])); + $this->setShowKeys(isset($_REQUEST['eps_show_keys'])); + $this->setTableDimension(isset($_REQUEST['eps_show_table_dimension'])); + $this->setAllTablesSameWidth(isset($_REQUEST['eps_all_tables_same_width'])); + $this->setOrientation($_REQUEST['eps_orientation']); + + $this->diagram->setTitle( + sprintf( + __('Schema of the %s database - Page %s'), + $this->db, + $this->pageNumber + ) + ); + $this->diagram->setAuthor('phpMyAdmin ' . PMA_VERSION); + $this->diagram->setDate(date("j F Y, g:i a")); + $this->diagram->setOrientation($this->orientation); + $this->diagram->setFont('Verdana', '10'); + + $alltables = $this->getTablesFromRequest(); + + foreach ($alltables as $table) { + if (! isset($this->_tables[$table])) { + $this->_tables[$table] = new TableStatsEps( + $this->diagram, $this->db, + $table, $this->diagram->getFont(), + $this->diagram->getFontSize(), $this->pageNumber, + $this->_tablewidth, $this->showKeys, + $this->tableDimension, $this->offline + ); + } + + if ($this->sameWide) { + $this->_tables[$table]->width = $this->_tablewidth; + } + } + + $seen_a_relation = false; + foreach ($alltables as $one_table) { + $exist_rel = $this->relation->getForeigners($this->db, $one_table, '', 'both'); + if (!$exist_rel) { + continue; + } + + $seen_a_relation = true; + foreach ($exist_rel as $master_field => $rel) { + /* put the foreign table on the schema only if selected + * by the user + * (do not use array_search() because we would have to + * to do a === false and this is not PHP3 compatible) + */ + if ($master_field != 'foreign_keys_data') { + if (in_array($rel['foreign_table'], $alltables)) { + $this->_addRelation( + $one_table, $this->diagram->getFont(), $this->diagram->getFontSize(), + $master_field, $rel['foreign_table'], + $rel['foreign_field'], $this->tableDimension + ); + } + continue; + } + + foreach ($rel as $one_key) { + if (!in_array($one_key['ref_table_name'], $alltables)) { + continue; + } + + foreach ($one_key['index_list'] + as $index => $one_field + ) { + $this->_addRelation( + $one_table, $this->diagram->getFont(), + $this->diagram->getFontSize(), + $one_field, $one_key['ref_table_name'], + $one_key['ref_index_list'][$index], + $this->tableDimension + ); + } + } + } + } + if ($seen_a_relation) { + $this->_drawRelations(); + } + + $this->_drawTables(); + $this->diagram->endEpsDoc(); + } + + /** + * Output Eps Document for download + * + * @return void + */ + public function showOutput() + { + $this->diagram->showOutput($this->getFileName('.eps')); + } + + /** + * Defines relation objects + * + * @param string $masterTable The master table name + * @param string $font The font + * @param int $fontSize The font size + * @param string $masterField The relation field in the master table + * @param string $foreignTable The foreign table name + * @param string $foreignField The relation field in the foreign table + * @param boolean $tableDimension Whether to display table position or not + * + * @return void + * + * @see _setMinMax,Table_Stats_Eps::__construct(), + * PhpMyAdmin\Plugins\Schema\Eps\RelationStatsEps::__construct() + */ + private function _addRelation( + $masterTable, $font, $fontSize, $masterField, + $foreignTable, $foreignField, $tableDimension + ) { + if (! isset($this->_tables[$masterTable])) { + $this->_tables[$masterTable] = new TableStatsEps( + $this->diagram, $this->db, $masterTable, $font, $fontSize, + $this->pageNumber, $this->_tablewidth, false, $tableDimension + ); + } + if (! isset($this->_tables[$foreignTable])) { + $this->_tables[$foreignTable] = new TableStatsEps( + $this->diagram, $this->db, $foreignTable, $font, $fontSize, + $this->pageNumber, $this->_tablewidth, false, $tableDimension + ); + } + $this->_relations[] = new RelationStatsEps( + $this->diagram, + $this->_tables[$masterTable], + $masterField, + $this->_tables[$foreignTable], + $foreignField + ); + } + + /** + * Draws relation arrows and lines connects master table's master field to + * foreign table's foreign field + * + * @return void + * + * @see Relation_Stats_Eps::relationDraw() + */ + private function _drawRelations() + { + foreach ($this->_relations as $relation) { + $relation->relationDraw(); + } + } + + /** + * Draws tables + * + * @return void + * + * @see Table_Stats_Eps::Table_Stats_tableDraw() + */ + private function _drawTables() + { + foreach ($this->_tables as $table) { + $table->tableDraw($this->showColor); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/RelationStatsEps.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/RelationStatsEps.php new file mode 100755 index 0000000..61b7f6c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/RelationStatsEps.php @@ -0,0 +1,110 @@ +wTick = 10; + parent::__construct( + $diagram, $master_table, $master_field, $foreign_table, $foreign_field + ); + $this->ySrc += 10; + $this->yDest += 10; + } + + /** + * draws relation links and arrows + * shows foreign key relations + * + * @see PMA_EPS + * + * @return void + */ + public function relationDraw() + { + // draw a line like -- to foreign field + $this->diagram->line( + $this->xSrc, + $this->ySrc, + $this->xSrc + $this->srcDir * $this->wTick, + $this->ySrc, + 1 + ); + // draw a line like -- to master field + $this->diagram->line( + $this->xDest + $this->destDir * $this->wTick, + $this->yDest, + $this->xDest, + $this->yDest, + 1 + ); + // draw a line that connects to master field line and foreign field line + $this->diagram->line( + $this->xSrc + $this->srcDir * $this->wTick, + $this->ySrc, + $this->xDest + $this->destDir * $this->wTick, + $this->yDest, + 1 + ); + $root2 = 2 * sqrt(2); + $this->diagram->line( + $this->xSrc + $this->srcDir * $this->wTick * 0.75, + $this->ySrc, + $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, + $this->ySrc + $this->wTick / $root2, + 1 + ); + $this->diagram->line( + $this->xSrc + $this->srcDir * $this->wTick * 0.75, + $this->ySrc, + $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, + $this->ySrc - $this->wTick / $root2, + 1 + ); + $this->diagram->line( + $this->xDest + $this->destDir * $this->wTick / 2, + $this->yDest, + $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, + $this->yDest + $this->wTick / $root2, + 1 + ); + $this->diagram->line( + $this->xDest + $this->destDir * $this->wTick / 2, + $this->yDest, + $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, + $this->yDest - $this->wTick / $root2, + 1 + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/TableStatsEps.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/TableStatsEps.php new file mode 100755 index 0000000..c1059de --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Eps/TableStatsEps.php @@ -0,0 +1,182 @@ +_setHeightTable($fontSize); + // setWidth must me after setHeight, because title + // can include table height which changes table width + $this->_setWidthTable($font, $fontSize); + if ($same_wide_width < $this->width) { + $same_wide_width = $this->width; + } + } + + /** + * Displays an error when the table cannot be found. + * + * @return void + */ + protected function showMissingTableError() + { + ExportRelationSchema::dieSchema( + $this->pageNumber, + "EPS", + sprintf(__('The %s table doesn\'t exist!'), $this->tableName) + ); + } + + /** + * Sets the width of the table + * + * @param string $font The font name + * @param integer $fontSize The font size + * + * @return void + * + * @see PMA_EPS + */ + private function _setWidthTable($font, $fontSize) + { + foreach ($this->fields as $field) { + $this->width = max( + $this->width, + Font::getStringWidth($field, $font, $fontSize) + ); + } + $this->width += Font::getStringWidth( + ' ', + $font, + $fontSize + ); + /* + * it is unknown what value must be added, because + * table title is affected by the table width value + */ + while ($this->width + < Font::getStringWidth( + $this->getTitle(), + $font, + $fontSize + )) { + $this->width += 7; + } + } + + /** + * Sets the height of the table + * + * @param integer $fontSize The font size + * + * @return void + */ + private function _setHeightTable($fontSize) + { + $this->heightCell = $fontSize + 4; + $this->height = (count($this->fields) + 1) * $this->heightCell; + } + + /** + * Draw the table + * + * @param boolean $showColor Whether to display color + * + * @return void + * + * @see PMA_EPS,PMA_EPS::line,PMA_EPS::rect + */ + public function tableDraw($showColor) + { + //echo $this->tableName.'
    '; + $this->diagram->rect( + $this->x, + $this->y + 12, + $this->width, + $this->heightCell, + 1 + ); + $this->diagram->showXY($this->getTitle(), $this->x + 5, $this->y + 14); + foreach ($this->fields as $field) { + $this->currentCell += $this->heightCell; + $this->diagram->rect( + $this->x, + $this->y + 12 + $this->currentCell, + $this->width, + $this->heightCell, + 1 + ); + $this->diagram->showXY( + $field, + $this->x + 5, + $this->y + 14 + $this->currentCell + ); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/ExportRelationSchema.php b/phpMyAdmin/libraries/classes/Plugins/Schema/ExportRelationSchema.php new file mode 100755 index 0000000..ca9ca56 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/ExportRelationSchema.php @@ -0,0 +1,307 @@ +db = $db; + $this->diagram = $diagram; + $this->setPageNumber($_REQUEST['page_number']); + $this->setOffline(isset($_REQUEST['offline_export'])); + $this->relation = new Relation(); + } + + /** + * Set Page Number + * + * @param integer $value Page Number of the document to be created + * + * @return void + */ + public function setPageNumber($value) + { + $this->pageNumber = intval($value); + } + + /** + * Returns the schema page number + * + * @return integer schema page number + */ + public function getPageNumber() + { + return $this->pageNumber; + } + + /** + * Sets showColor + * + * @param boolean $value whether to show colors + * + * @return void + */ + public function setShowColor($value) + { + $this->showColor = $value; + } + + /** + * Returns whether to show colors + * + * @return boolean whether to show colors + */ + public function isShowColor() + { + return $this->showColor; + } + + /** + * Set Table Dimension + * + * @param boolean $value show table co-ordinates or not + * + * @return void + */ + public function setTableDimension($value) + { + $this->tableDimension = $value; + } + + /** + * Returns whether to show table dimensions + * + * @return boolean whether to show table dimensions + */ + public function isTableDimension() + { + return $this->tableDimension; + } + + /** + * Set same width of All Tables + * + * @param boolean $value set same width of all tables or not + * + * @return void + */ + public function setAllTablesSameWidth($value) + { + $this->sameWide = $value; + } + + /** + * Returns whether to use same width for all tables or not + * + * @return boolean whether to use same width for all tables or not + */ + public function isAllTableSameWidth() + { + return $this->sameWide; + } + + /** + * Set Show only keys + * + * @param boolean $value show only keys or not + * + * @return void + * + * @access public + */ + public function setShowKeys($value) + { + $this->showKeys = $value; + } + + /** + * Returns whether to show keys + * + * @return boolean whether to show keys + */ + public function isShowKeys() + { + return $this->showKeys; + } + + /** + * Set Orientation + * + * @param string $value Orientation will be portrait or landscape + * + * @return void + * + * @access public + */ + public function setOrientation($value) + { + $this->orientation = ($value == 'P') ? 'P' : 'L'; + } + + /** + * Returns orientation + * + * @return string orientation + */ + public function getOrientation() + { + return $this->orientation; + } + + /** + * Set type of paper + * + * @param string $value paper type can be A4 etc + * + * @return void + * + * @access public + */ + public function setPaper($value) + { + $this->paper = $value; + } + + /** + * Returns the paper size + * + * @return string paper size + */ + public function getPaper() + { + return $this->paper; + } + + /** + * Set whether the document is generated from client side DB + * + * @param boolean $value offline or not + * + * @return void + * + * @access public + */ + public function setOffline($value) + { + $this->offline = $value; + } + + /** + * Returns whether the client side database is used + * + * @return boolean + * + * @access public + */ + public function isOffline() + { + return $this->offline; + } + + /** + * Get the table names from the request + * + * @return array an array of table names + */ + protected function getTablesFromRequest() + { + $tables = []; + if (isset($_POST['t_tbl'])) { + foreach($_POST['t_tbl'] as $table) { + $tables[] = rawurldecode($table); + } + } + return $tables; + } + + /** + * Returns the file name + * + * @param String $extension file extension + * + * @return string file name + */ + protected function getFileName($extension) + { + $filename = $this->db . $extension; + // Get the name of this page to use as filename + if ($this->pageNumber != -1 && !$this->offline) { + $_name_sql = 'SELECT page_descr FROM ' + . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' + . Util::backquote($GLOBALS['cfgRelation']['pdf_pages']) + . ' WHERE page_nr = ' . $this->pageNumber; + $_name_rs = $this->relation->queryAsControlUser($_name_sql); + $_name_row = $GLOBALS['dbi']->fetchRow($_name_rs); + $filename = $_name_row[0] . $extension; + } + + return $filename; + } + + /** + * Displays an error message + * + * @param integer $pageNumber ID of the chosen page + * @param string $type Schema Type + * @param string $error_message The error message + * + * @access public + * + * @return void + */ + public static function dieSchema($pageNumber, $type = '', $error_message = '') + { + echo "

    " , __("SCHEMA ERROR: ") , $type , "

    " , "\n"; + if (!empty($error_message)) { + $error_message = htmlspecialchars($error_message); + } + echo '

    ' , "\n"; + echo ' ' , $error_message , "\n"; + echo '

    ' , "\n"; + echo '' , __('Back') , ''; + echo "\n"; + exit; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/Pdf.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/Pdf.php new file mode 100755 index 0000000..138c56c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/Pdf.php @@ -0,0 +1,403 @@ +_pageNumber = $pageNumber; + $this->_withDoc = $withDoc; + $this->_db = $db; + $this->relation = new Relation(); + } + + /** + * Sets the value for margins + * + * @param float $c_margin margin + * + * @return void + */ + public function setCMargin($c_margin) + { + $this->cMargin = $c_margin; + } + + /** + * Sets the scaling factor, defines minimum coordinates and margins + * + * @param float|int $scale The scaling factor + * @param float|int $xMin The minimum X coordinate + * @param float|int $yMin The minimum Y coordinate + * @param float|int $leftMargin The left margin + * @param float|int $topMargin The top margin + * + * @return void + */ + public function setScale($scale = 1, $xMin = 0, $yMin = 0, + $leftMargin = -1, $topMargin = -1 + ) { + $this->scale = $scale; + $this->_xMin = $xMin; + $this->_yMin = $yMin; + if ($this->leftMargin != -1) { + $this->leftMargin = $leftMargin; + } + if ($this->topMargin != -1) { + $this->topMargin = $topMargin; + } + } + + /** + * Outputs a scaled cell + * + * @param float|int $w The cell width + * @param float|int $h The cell height + * @param string $txt The text to output + * @param mixed $border Whether to add borders or not + * @param integer $ln Where to put the cursor once the output is done + * @param string $align Align mode + * @param integer $fill Whether to fill the cell with a color or not + * @param string $link Link + * + * @return void + * + * @see TCPDF::Cell() + */ + public function cellScale($w, $h = 0, $txt = '', $border = 0, $ln = 0, + $align = '', $fill = 0, $link = '' + ) { + $h = $h / $this->scale; + $w = $w / $this->scale; + $this->Cell($w, $h, $txt, $border, $ln, $align, $fill, $link); + } + + /** + * Draws a scaled line + * + * @param float $x1 The horizontal position of the starting point + * @param float $y1 The vertical position of the starting point + * @param float $x2 The horizontal position of the ending point + * @param float $y2 The vertical position of the ending point + * + * @return void + * + * @see TCPDF::Line() + */ + public function lineScale($x1, $y1, $x2, $y2) + { + $x1 = ($x1 - $this->_xMin) / $this->scale + $this->leftMargin; + $y1 = ($y1 - $this->_yMin) / $this->scale + $this->topMargin; + $x2 = ($x2 - $this->_xMin) / $this->scale + $this->leftMargin; + $y2 = ($y2 - $this->_yMin) / $this->scale + $this->topMargin; + $this->Line($x1, $y1, $x2, $y2); + } + + /** + * Sets x and y scaled positions + * + * @param float $x The x position + * @param float $y The y position + * + * @return void + * + * @see TCPDF::SetXY() + */ + public function setXyScale($x, $y) + { + $x = ($x - $this->_xMin) / $this->scale + $this->leftMargin; + $y = ($y - $this->_yMin) / $this->scale + $this->topMargin; + $this->SetXY($x, $y); + } + + /** + * Sets the X scaled positions + * + * @param float $x The x position + * + * @return void + * + * @see TCPDF::SetX() + */ + public function setXScale($x) + { + $x = ($x - $this->_xMin) / $this->scale + $this->leftMargin; + $this->SetX($x); + } + + /** + * Sets the scaled font size + * + * @param float $size The font size (in points) + * + * @return void + * + * @see TCPDF::SetFontSize() + */ + public function setFontSizeScale($size) + { + // Set font size in points + $size = $size / $this->scale; + $this->SetFontSize($size); + } + + /** + * Sets the scaled line width + * + * @param float $width The line width + * + * @return void + * + * @see TCPDF::SetLineWidth() + */ + public function setLineWidthScale($width) + { + $width = $width / $this->scale; + $this->SetLineWidth($width); + } + + /** + * This method is used to render the page header. + * + * @return void + * + * @see TCPDF::Header() + */ + // @codingStandardsIgnoreLine + public function Header() + { + // We only show this if we find something in the new pdf_pages table + + // This function must be named "Header" to work with the TCPDF library + if ($this->_withDoc) { + if ($this->_offline || $this->_pageNumber == -1) { + $pg_name = __("PDF export page"); + } else { + $test_query = 'SELECT * FROM ' + . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' + . Util::backquote($GLOBALS['cfgRelation']['pdf_pages']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($this->_db) + . '\' AND page_nr = \'' . $this->_pageNumber . '\''; + $test_rs = $this->relation->queryAsControlUser($test_query); + $pages = @$GLOBALS['dbi']->fetchAssoc($test_rs); + $pg_name = ucfirst($pages['page_descr']); + } + + $this->SetFont($this->_ff, 'B', 14); + $this->Cell(0, 6, $pg_name, 'B', 1, 'C'); + $this->SetFont($this->_ff, ''); + $this->Ln(); + } + } + + /** + * This function must be named "Footer" to work with the TCPDF library + * + * @return void + * + * @see PDF::Footer() + */ + // @codingStandardsIgnoreLine + public function Footer() + { + if ($this->_withDoc) { + parent::Footer(); + } + } + + /** + * Sets widths + * + * @param array $w array of widths + * + * @return void + */ + public function setWidths(array $w) + { + // column widths + $this->widths = $w; + } + + /** + * Generates table row. + * + * @param array $data Data for table + * @param array $links Links for table cells + * + * @return void + */ + public function row(array $data, array $links) + { + // line height + $nb = 0; + $data_cnt = count($data); + for ($i = 0;$i < $data_cnt;$i++) { + $nb = max($nb, $this->numLines($this->widths[$i], $data[$i])); + } + $il = $this->FontSize; + $h = ($il + 1) * $nb; + // page break if necessary + $this->CheckPageBreak($h); + // draw the cells + $data_cnt = count($data); + for ($i = 0;$i < $data_cnt;$i++) { + $w = $this->widths[$i]; + // save current position + $x = $this->GetX(); + $y = $this->GetY(); + // draw the border + $this->Rect($x, $y, $w, $h); + if (isset($links[$i])) { + $this->Link($x, $y, $w, $h, $links[$i]); + } + // print text + $this->MultiCell($w, $il + 1, $data[$i], 0, 'L'); + // go to right side + $this->SetXY($x + $w, $y); + } + // go to line + $this->Ln($h); + } + + /** + * Compute number of lines used by a multicell of width w + * + * @param int $w width + * @param string $txt text + * + * @return int + */ + public function numLines($w, $txt) + { + $cw = &$this->CurrentFont['cw']; + if ($w == 0) { + $w = $this->w - $this->rMargin - $this->x; + } + $wmax = ($w-2 * $this->cMargin) * 1000 / $this->FontSize; + $s = str_replace("\r", '', $txt); + $nb = strlen($s); + if ($nb > 0 && $s[$nb-1] == "\n") { + $nb--; + } + $sep = -1; + $i = 0; + $j = 0; + $l = 0; + $nl = 1; + while ($i < $nb) { + $c = $s[$i]; + if ($c == "\n") { + $i++; + $sep = -1; + $j = $i; + $l = 0; + $nl++; + continue; + } + if ($c == ' ') { + $sep = $i; + } + $l += isset($cw[mb_ord($c)])?$cw[mb_ord($c)]:0 ; + if ($l > $wmax) { + if ($sep == -1) { + if ($i == $j) { + $i++; + } + } else { + $i = $sep + 1; + } + $sep = -1; + $j = $i; + $l = 0; + $nl++; + } else { + $i++; + } + } + return $nl; + } + + /** + * Set whether the document is generated from client side DB + * + * @param string $value whether offline + * + * @return void + * + * @access private + */ + public function setOffline($value) + { + $this->_offline = $value; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php new file mode 100755 index 0000000..aa4fc72 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php @@ -0,0 +1,732 @@ +setShowGrid(isset($_REQUEST['pdf_show_grid'])); + $this->setShowColor(isset($_REQUEST['pdf_show_color'])); + $this->setShowKeys(isset($_REQUEST['pdf_show_keys'])); + $this->setTableDimension(isset($_REQUEST['pdf_show_table_dimension'])); + $this->setAllTablesSameWidth(isset($_REQUEST['pdf_all_tables_same_width'])); + $this->setWithDataDictionary(isset($_REQUEST['pdf_with_doc'])); + $this->setTableOrder($_REQUEST['pdf_table_order']); + $this->setOrientation($_REQUEST['pdf_orientation']); + $this->setPaper($_REQUEST['pdf_paper']); + + // Initializes a new document + parent::__construct( + $db, + new Pdf( + $this->orientation, 'mm', $this->paper, + $this->pageNumber, $this->_withDoc, $db + ) + ); + $this->diagram->SetTitle( + sprintf( + __('Schema of the %s database'), + $this->db + ) + ); + $this->diagram->setCMargin(0); + $this->diagram->Open(); + $this->diagram->SetAutoPageBreak('auto'); + $this->diagram->setOffline($this->offline); + + $alltables = $this->getTablesFromRequest(); + if ($this->getTableOrder() == 'name_asc') { + sort($alltables); + } elseif ($this->getTableOrder() == 'name_desc') { + rsort($alltables); + } + + if ($this->_withDoc) { + $this->diagram->SetAutoPageBreak('auto', 15); + $this->diagram->setCMargin(1); + $this->dataDictionaryDoc($alltables); + $this->diagram->SetAutoPageBreak('auto'); + $this->diagram->setCMargin(0); + } + + $this->diagram->Addpage(); + + if ($this->_withDoc) { + $this->diagram->SetLink($this->diagram->PMA_links['RT']['-'], -1); + $this->diagram->Bookmark(__('Relational schema')); + $this->diagram->setAlias('{00}', $this->diagram->PageNo()); + $this->_topMargin = 28; + $this->_bottomMargin = 28; + } + + /* snip */ + foreach ($alltables as $table) { + if (! isset($this->_tables[$table])) { + $this->_tables[$table] = new TableStatsPdf( + $this->diagram, + $this->db, + $table, + null, + $this->pageNumber, + $this->_tablewidth, + $this->showKeys, + $this->tableDimension, + $this->offline + ); + } + if ($this->sameWide) { + $this->_tables[$table]->width = $this->_tablewidth; + } + $this->_setMinMax($this->_tables[$table]); + } + + // Defines the scale factor + $innerWidth = $this->diagram->getPageWidth() - $this->_rightMargin + - $this->_leftMargin; + $innerHeight = $this->diagram->getPageHeight() - $this->_topMargin + - $this->_bottomMargin; + $this->_scale = ceil( + max( + ($this->_xMax - $this->_xMin) / $innerWidth, + ($this->_yMax - $this->_yMin) / $innerHeight + ) * 100 + ) / 100; + + $this->diagram->setScale( + $this->_scale, + $this->_xMin, + $this->_yMin, + $this->_leftMargin, + $this->_topMargin + ); + // Builds and save the PDF document + $this->diagram->setLineWidthScale(0.1); + + if ($this->_showGrid) { + $this->diagram->SetFontSize(10); + $this->_strokeGrid(); + } + $this->diagram->setFontSizeScale(14); + // previous logic was checking master tables and foreign tables + // but I think that looping on every table of the pdf page as a master + // and finding its foreigns is OK (then we can support innodb) + $seen_a_relation = false; + foreach ($alltables as $one_table) { + $exist_rel = $this->relation->getForeigners($this->db, $one_table, '', 'both'); + if (!$exist_rel) { + continue; + } + + $seen_a_relation = true; + foreach ($exist_rel as $master_field => $rel) { + // put the foreign table on the schema only if selected + // by the user + // (do not use array_search() because we would have to + // to do a === false and this is not PHP3 compatible) + if ($master_field != 'foreign_keys_data') { + if (in_array($rel['foreign_table'], $alltables)) { + $this->_addRelation( + $one_table, + $master_field, + $rel['foreign_table'], + $rel['foreign_field'] + ); + } + continue; + } + + foreach ($rel as $one_key) { + if (!in_array($one_key['ref_table_name'], $alltables)) { + continue; + } + + foreach ($one_key['index_list'] + as $index => $one_field + ) { + $this->_addRelation( + $one_table, + $one_field, + $one_key['ref_table_name'], + $one_key['ref_index_list'][$index] + ); + } + } + } // end while + } // end while + + if ($seen_a_relation) { + $this->_drawRelations(); + } + $this->_drawTables(); + } + + /** + * Set Show Grid + * + * @param boolean $value show grid of the document or not + * + * @return void + */ + public function setShowGrid($value) + { + $this->_showGrid = $value; + } + + /** + * Returns whether to show grid + * + * @return boolean whether to show grid + */ + public function isShowGrid() + { + return $this->_showGrid; + } + + /** + * Set Data Dictionary + * + * @param boolean $value show selected database data dictionary or not + * + * @return void + */ + public function setWithDataDictionary($value) + { + $this->_withDoc = $value; + } + + /** + * Return whether to show selected database data dictionary or not + * + * @return boolean whether to show selected database data dictionary or not + */ + public function isWithDataDictionary() + { + return $this->_withDoc; + } + + /** + * Sets the order of the table in data dictionary + * + * @param string $value table order + * + * @return void + */ + public function setTableOrder($value) + { + $this->_tableOrder = $value; + } + + /** + * Returns the order of the table in data dictionary + * + * @return string table order + */ + public function getTableOrder() + { + return $this->_tableOrder; + } + + /** + * Output Pdf Document for download + * + * @return void + */ + public function showOutput() + { + $this->diagram->download($this->getFileName('.pdf')); + } + + /** + * Sets X and Y minimum and maximum for a table cell + * + * @param TableStatsPdf $table The table name of which sets XY co-ordinates + * + * @return void + */ + private function _setMinMax($table) + { + $this->_xMax = max($this->_xMax, $table->x + $table->width); + $this->_yMax = max($this->_yMax, $table->y + $table->height); + $this->_xMin = min($this->_xMin, $table->x); + $this->_yMin = min($this->_yMin, $table->y); + } + + /** + * Defines relation objects + * + * @param string $masterTable The master table name + * @param string $masterField The relation field in the master table + * @param string $foreignTable The foreign table name + * @param string $foreignField The relation field in the foreign table + * + * @return void + * + * @see _setMinMax + */ + private function _addRelation($masterTable, $masterField, $foreignTable, + $foreignField + ) { + if (! isset($this->_tables[$masterTable])) { + $this->_tables[$masterTable] = new TableStatsPdf( + $this->diagram, + $this->db, + $masterTable, + null, + $this->pageNumber, + $this->_tablewidth, + $this->showKeys, + $this->tableDimension + ); + $this->_setMinMax($this->_tables[$masterTable]); + } + if (! isset($this->_tables[$foreignTable])) { + $this->_tables[$foreignTable] = new TableStatsPdf( + $this->diagram, + $this->db, + $foreignTable, + null, + $this->pageNumber, + $this->_tablewidth, + $this->showKeys, + $this->tableDimension + ); + $this->_setMinMax($this->_tables[$foreignTable]); + } + $this->relations[] = new RelationStatsPdf( + $this->diagram, + $this->_tables[$masterTable], + $masterField, + $this->_tables[$foreignTable], + $foreignField + ); + } + + /** + * Draws the grid + * + * @return void + * + * @see PMA_Schema_PDF + */ + private function _strokeGrid() + { + $gridSize = 10; + $labelHeight = 4; + $labelWidth = 5; + if ($this->_withDoc) { + $topSpace = 6; + $bottomSpace = 15; + } else { + $topSpace = 0; + $bottomSpace = 0; + } + + $this->diagram->SetMargins(0, 0); + $this->diagram->SetDrawColor(200, 200, 200); + // Draws horizontal lines + $innerHeight = $this->diagram->getPageHeight() - $topSpace - $bottomSpace; + for ($l = 0, + $size = intval($innerHeight / $gridSize); + $l <= $size; + $l++ + ) { + $this->diagram->line( + 0, $l * $gridSize + $topSpace, + $this->diagram->getPageWidth(), $l * $gridSize + $topSpace + ); + // Avoid duplicates + if ($l > 0 + && $l <= intval(($innerHeight - $labelHeight) / $gridSize) + ) { + $this->diagram->SetXY(0, $l * $gridSize + $topSpace); + $label = (string) sprintf( + '%.0f', + ($l * $gridSize + $topSpace - $this->_topMargin) + * $this->_scale + $this->_yMin + ); + $this->diagram->Cell($labelWidth, $labelHeight, ' ' . $label); + } // end if + } // end for + // Draws vertical lines + for ( + $j = 0, $size = intval($this->diagram->getPageWidth() / $gridSize); + $j <= $size; + $j++ + ) { + $this->diagram->line( + $j * $gridSize, + $topSpace, + $j * $gridSize, + $this->diagram->getPageHeight() - $bottomSpace + ); + $this->diagram->SetXY($j * $gridSize, $topSpace); + $label = (string) sprintf( + '%.0f', + ($j * $gridSize - $this->_leftMargin) * $this->_scale + $this->_xMin + ); + $this->diagram->Cell($labelWidth, $labelHeight, $label); + } + } + + /** + * Draws relation arrows + * + * @return void + * + * @see Relation_Stats_Pdf::relationdraw() + */ + private function _drawRelations() + { + $i = 0; + foreach ($this->relations as $relation) { + $relation->relationDraw($this->showColor, $i); + $i++; + } + } + + /** + * Draws tables + * + * @return void + * + * @see Table_Stats_Pdf::tableDraw() + */ + private function _drawTables() + { + foreach ($this->_tables as $table) { + $table->tableDraw(null, $this->_withDoc, $this->showColor); + } + } + + /** + * Generates data dictionary pages. + * + * @param array $alltables Tables to document. + * + * @return void + */ + public function dataDictionaryDoc(array $alltables) + { + // TOC + $this->diagram->addpage($this->orientation); + $this->diagram->Cell(0, 9, __('Table of contents'), 1, 0, 'C'); + $this->diagram->Ln(15); + $i = 1; + foreach ($alltables as $table) { + $this->diagram->PMA_links['doc'][$table]['-'] + = $this->diagram->AddLink(); + $this->diagram->SetX(10); + // $this->diagram->Ln(1); + $this->diagram->Cell( + 0, 6, __('Page number:') . ' {' . sprintf("%02d", $i) . '}', 0, 0, + 'R', 0, $this->diagram->PMA_links['doc'][$table]['-'] + ); + $this->diagram->SetX(10); + $this->diagram->Cell( + 0, 6, $i . ' ' . $table, 0, 1, + 'L', 0, $this->diagram->PMA_links['doc'][$table]['-'] + ); + // $this->diagram->Ln(1); + $fields = $GLOBALS['dbi']->getColumns($this->db, $table); + foreach ($fields as $row) { + $this->diagram->SetX(20); + $field_name = $row['Field']; + $this->diagram->PMA_links['doc'][$table][$field_name] + = $this->diagram->AddLink(); + //$this->diagram->Cell( + // 0, 6, $field_name, 0, 1, + // 'L', 0, $this->diagram->PMA_links['doc'][$table][$field_name] + //); + } + $i++; + } + $this->diagram->PMA_links['RT']['-'] = $this->diagram->AddLink(); + $this->diagram->SetX(10); + $this->diagram->Cell( + 0, 6, __('Page number:') . ' {00}', 0, 0, + 'R', 0, $this->diagram->PMA_links['RT']['-'] + ); + $this->diagram->SetX(10); + $this->diagram->Cell( + 0, 6, $i . ' ' . __('Relational schema'), 0, 1, + 'L', 0, $this->diagram->PMA_links['RT']['-'] + ); + $z = 0; + foreach ($alltables as $table) { + $z++; + $this->diagram->SetAutoPageBreak(true, 15); + $this->diagram->addpage($this->orientation); + $this->diagram->Bookmark($table); + $this->diagram->setAlias( + '{' . sprintf("%02d", $z) . '}', $this->diagram->PageNo() + ); + $this->diagram->PMA_links['RT'][$table]['-'] + = $this->diagram->AddLink(); + $this->diagram->SetLink( + $this->diagram->PMA_links['doc'][$table]['-'], -1 + ); + $this->diagram->SetFont($this->_ff, 'B', 18); + $this->diagram->Cell( + 0, 8, $z . ' ' . $table, 1, 1, + 'C', 0, $this->diagram->PMA_links['RT'][$table]['-'] + ); + $this->diagram->SetFont($this->_ff, '', 8); + $this->diagram->ln(); + + $cfgRelation = $this->relation->getRelationsParam(); + $comments = $this->relation->getComments($this->db, $table); + if ($cfgRelation['mimework']) { + $mime_map = Transformations::getMIME($this->db, $table, true); + } + + /** + * Gets table information + */ + $showtable = $GLOBALS['dbi']->getTable($this->db, $table) + ->getStatusInfo(); + $show_comment = isset($showtable['Comment']) + ? $showtable['Comment'] + : ''; + $create_time = isset($showtable['Create_time']) + ? Util::localisedDate( + strtotime($showtable['Create_time']) + ) + : ''; + $update_time = isset($showtable['Update_time']) + ? Util::localisedDate( + strtotime($showtable['Update_time']) + ) + : ''; + $check_time = isset($showtable['Check_time']) + ? Util::localisedDate( + strtotime($showtable['Check_time']) + ) + : ''; + + /** + * Gets fields properties + */ + $columns = $GLOBALS['dbi']->getColumns($this->db, $table); + + // Find which tables are related with the current one and write it in + // an array + $res_rel = $this->relation->getForeigners($this->db, $table); + + /** + * Displays the comments of the table if MySQL >= 3.23 + */ + + $break = false; + if (! empty($show_comment)) { + $this->diagram->Cell( + 0, 3, __('Table comments:') . ' ' . $show_comment, 0, 1 + ); + $break = true; + } + + if (! empty($create_time)) { + $this->diagram->Cell( + 0, 3, __('Creation:') . ' ' . $create_time, 0, 1 + ); + $break = true; + } + + if (! empty($update_time)) { + $this->diagram->Cell( + 0, 3, __('Last update:') . ' ' . $update_time, 0, 1 + ); + $break = true; + } + + if (! empty($check_time)) { + $this->diagram->Cell( + 0, 3, __('Last check:') . ' ' . $check_time, 0, 1 + ); + $break = true; + } + + if ($break == true) { + $this->diagram->Cell(0, 3, '', 0, 1); + $this->diagram->Ln(); + } + + $this->diagram->SetFont($this->_ff, 'B'); + if (isset($this->orientation) && $this->orientation == 'L') { + $this->diagram->Cell(25, 8, __('Column'), 1, 0, 'C'); + $this->diagram->Cell(20, 8, __('Type'), 1, 0, 'C'); + $this->diagram->Cell(20, 8, __('Attributes'), 1, 0, 'C'); + $this->diagram->Cell(10, 8, __('Null'), 1, 0, 'C'); + $this->diagram->Cell(20, 8, __('Default'), 1, 0, 'C'); + $this->diagram->Cell(25, 8, __('Extra'), 1, 0, 'C'); + $this->diagram->Cell(45, 8, __('Links to'), 1, 0, 'C'); + + if ($this->paper == 'A4') { + $comments_width = 67; + } else { + // this is really intended for 'letter' + /** + * @todo find optimal width for all formats + */ + $comments_width = 50; + } + $this->diagram->Cell($comments_width, 8, __('Comments'), 1, 0, 'C'); + $this->diagram->Cell(45, 8, 'MIME', 1, 1, 'C'); + $this->diagram->setWidths( + array(25, 20, 20, 10, 20, 25, 45, $comments_width, 45) + ); + } else { + $this->diagram->Cell(20, 8, __('Column'), 1, 0, 'C'); + $this->diagram->Cell(20, 8, __('Type'), 1, 0, 'C'); + $this->diagram->Cell(20, 8, __('Attributes'), 1, 0, 'C'); + $this->diagram->Cell(10, 8, __('Null'), 1, 0, 'C'); + $this->diagram->Cell(15, 8, __('Default'), 1, 0, 'C'); + $this->diagram->Cell(15, 8, __('Extra'), 1, 0, 'C'); + $this->diagram->Cell(30, 8, __('Links to'), 1, 0, 'C'); + $this->diagram->Cell(30, 8, __('Comments'), 1, 0, 'C'); + $this->diagram->Cell(30, 8, 'MIME', 1, 1, 'C'); + $this->diagram->setWidths(array(20, 20, 20, 10, 15, 15, 30, 30, 30)); + } + $this->diagram->SetFont($this->_ff, ''); + + foreach ($columns as $row) { + $extracted_columnspec + = Util::extractColumnSpec($row['Type']); + $type = $extracted_columnspec['print_type']; + $attribute = $extracted_columnspec['attribute']; + if (! isset($row['Default'])) { + if ($row['Null'] != '' && $row['Null'] != 'NO') { + $row['Default'] = 'NULL'; + } + } + $field_name = $row['Field']; + // $this->diagram->Ln(); + $this->diagram->PMA_links['RT'][$table][$field_name] + = $this->diagram->AddLink(); + $this->diagram->Bookmark($field_name, 1, -1); + $this->diagram->SetLink( + $this->diagram->PMA_links['doc'][$table][$field_name], -1 + ); + $foreigner = $this->relation->searchColumnInForeigners($res_rel, $field_name); + + $linksTo = ''; + if ($foreigner) { + $linksTo = '-> '; + if ($foreigner['foreign_db'] != $this->db) { + $linksTo .= $foreigner['foreign_db'] . '.'; + } + $linksTo .= $foreigner['foreign_table'] + . '.' . $foreigner['foreign_field']; + + if (isset($foreigner['on_update'])) { // not set for internal + $linksTo .= "\n" . 'ON UPDATE ' . $foreigner['on_update']; + $linksTo .= "\n" . 'ON DELETE ' . $foreigner['on_delete']; + } + } + + $this->diagram_row = array( + $field_name, + $type, + $attribute, + (($row['Null'] == '' || $row['Null'] == 'NO') + ? __('No') + : __('Yes')), + (isset($row['Default']) ? $row['Default'] : ''), + $row['Extra'], + $linksTo, + (isset($comments[$field_name]) + ? $comments[$field_name] + : ''), + (isset($mime_map) && isset($mime_map[$field_name]) + ? str_replace('_', '/', $mime_map[$field_name]['mimetype']) + : '') + ); + $links = array(); + $links[0] = $this->diagram->PMA_links['RT'][$table][$field_name]; + if ($foreigner + && isset($this->diagram->PMA_links['doc'][$foreigner['foreign_table']][$foreigner['foreign_field']]) + ) { + $links[6] = $this->diagram->PMA_links['doc'] + [$foreigner['foreign_table']][$foreigner['foreign_field']]; + } else { + unset($links[6]); + } + $this->diagram->row($this->diagram_row, $links); + } // end foreach + $this->diagram->SetFont($this->_ff, '', 14); + } //end each + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/RelationStatsPdf.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/RelationStatsPdf.php new file mode 100755 index 0000000..66a46b5 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/RelationStatsPdf.php @@ -0,0 +1,130 @@ +wTick = 5; + parent::__construct( + $diagram, $master_table, $master_field, $foreign_table, $foreign_field + ); + } + + /** + * draws relation links and arrows shows foreign key relations + * + * @param boolean $showColor Whether to use one color per relation or not + * @param integer $i The id of the link to draw + * + * @access public + * + * @return void + * + * @see Pdf + */ + public function relationDraw($showColor, $i) + { + if ($showColor) { + $d = $i % 6; + $j = ($i - $d) / 6; + $j = $j % 4; + $j++; + $case = array( + array(1, 0, 0), + array(0, 1, 0), + array(0, 0, 1), + array(1, 1, 0), + array(1, 0, 1), + array(0, 1, 1) + ); + list ($a, $b, $c) = $case[$d]; + $e = (1 - ($j - 1) / 6); + $this->diagram->SetDrawColor($a * 255 * $e, $b * 255 * $e, $c * 255 * $e); + } else { + $this->diagram->SetDrawColor(0); + } + $this->diagram->setLineWidthScale(0.2); + $this->diagram->lineScale( + $this->xSrc, + $this->ySrc, + $this->xSrc + $this->srcDir * $this->wTick, + $this->ySrc + ); + $this->diagram->lineScale( + $this->xDest + $this->destDir * $this->wTick, + $this->yDest, + $this->xDest, + $this->yDest + ); + $this->diagram->setLineWidthScale(0.1); + $this->diagram->lineScale( + $this->xSrc + $this->srcDir * $this->wTick, + $this->ySrc, + $this->xDest + $this->destDir * $this->wTick, + $this->yDest + ); + /* + * Draws arrows -> + */ + $root2 = 2 * sqrt(2); + $this->diagram->lineScale( + $this->xSrc + $this->srcDir * $this->wTick * 0.75, + $this->ySrc, + $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, + $this->ySrc + $this->wTick / $root2 + ); + $this->diagram->lineScale( + $this->xSrc + $this->srcDir * $this->wTick * 0.75, + $this->ySrc, + $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, + $this->ySrc - $this->wTick / $root2 + ); + + $this->diagram->lineScale( + $this->xDest + $this->destDir * $this->wTick / 2, + $this->yDest, + $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, + $this->yDest + $this->wTick / $root2 + ); + $this->diagram->lineScale( + $this->xDest + $this->destDir * $this->wTick / 2, + $this->yDest, + $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, + $this->yDest - $this->wTick / $root2 + ); + $this->diagram->SetDrawColor(0); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php new file mode 100755 index 0000000..9f930ca --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php @@ -0,0 +1,231 @@ +heightCell = 6; + $this->_setHeight(); + /* + * setWidth must me after setHeight, because title + * can include table height which changes table width + */ + $this->_setWidth($fontSize); + if ($sameWideWidth < $this->width) { + $sameWideWidth = $this->width; + } + } + + /** + * Displays an error when the table cannot be found. + * + * @return void + */ + protected function showMissingTableError() + { + ExportRelationSchema::dieSchema( + $this->pageNumber, + "PDF", + sprintf(__('The %s table doesn\'t exist!'), $this->tableName) + ); + } + + /** + * Returns title of the current table, + * title can have the dimensions of the table + * + * @return string + */ + protected function getTitle() + { + $ret = ''; + if ($this->tableDimension) { + $ret = sprintf('%.0fx%0.f', $this->width, $this->height); + } + + return $ret . ' ' . $this->tableName; + } + + /** + * Sets the width of the table + * + * @param integer $fontSize The font size + * + * @access private + * + * @return void + * + * @see PMA_Schema_PDF + */ + private function _setWidth($fontSize) + { + foreach ($this->fields as $field) { + $this->width = max($this->width, $this->diagram->GetStringWidth($field)); + } + $this->width += $this->diagram->GetStringWidth(' '); + $this->diagram->SetFont($this->_ff, 'B', $fontSize); + /* + * it is unknown what value must be added, because + * table title is affected by the table width value + */ + while ($this->width < $this->diagram->GetStringWidth($this->getTitle())) { + $this->width += 5; + } + $this->diagram->SetFont($this->_ff, '', $fontSize); + } + + /** + * Sets the height of the table + * + * @return void + * + * @access private + */ + private function _setHeight() + { + $this->height = (count($this->fields) + 1) * $this->heightCell; + } + + /** + * Do draw the table + * + * @param integer $fontSize The font size + * @param boolean $withDoc Whether to include links to documentation + * @param boolean|integer $setColor Whether to display color + * + * @access public + * + * @return void + * + * @see PMA_Schema_PDF + */ + public function tableDraw($fontSize, $withDoc, $setColor = 0) + { + $this->diagram->setXyScale($this->x, $this->y); + $this->diagram->SetFont($this->_ff, 'B', $fontSize); + if ($setColor) { + $this->diagram->SetTextColor(200); + $this->diagram->SetFillColor(0, 0, 128); + } + if ($withDoc) { + $this->diagram->SetLink( + $this->diagram->PMA_links['RT'][$this->tableName]['-'], + -1 + ); + } else { + $this->diagram->PMA_links['doc'][$this->tableName]['-'] = ''; + } + + $this->diagram->cellScale( + $this->width, + $this->heightCell, + $this->getTitle(), + 1, + 1, + 'C', + $setColor, + $this->diagram->PMA_links['doc'][$this->tableName]['-'] + ); + $this->diagram->setXScale($this->x); + $this->diagram->SetFont($this->_ff, '', $fontSize); + $this->diagram->SetTextColor(0); + $this->diagram->SetFillColor(255); + + foreach ($this->fields as $field) { + if ($setColor) { + if (in_array($field, $this->primary)) { + $this->diagram->SetFillColor(215, 121, 123); + } + if ($field == $this->displayfield) { + $this->diagram->SetFillColor(142, 159, 224); + } + } + if ($withDoc) { + $this->diagram->SetLink( + $this->diagram->PMA_links['RT'][$this->tableName][$field], + -1 + ); + } else { + $this->diagram->PMA_links['doc'][$this->tableName][$field] = ''; + } + + $this->diagram->cellScale( + $this->width, + $this->heightCell, + ' ' . $field, + 1, + 1, + 'L', + $setColor, + $this->diagram->PMA_links['doc'][$this->tableName][$field] + ); + $this->diagram->setXScale($this->x); + $this->diagram->SetFillColor(255); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/RelationStats.php b/phpMyAdmin/libraries/classes/Plugins/Schema/RelationStats.php new file mode 100755 index 0000000..8fe9f30 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/RelationStats.php @@ -0,0 +1,114 @@ +diagram = $diagram; + + $src_pos = $this->_getXy($master_table, $master_field); + $dest_pos = $this->_getXy($foreign_table, $foreign_field); + /* + * [0] is x-left + * [1] is x-right + * [2] is y + */ + $src_left = $src_pos[0] - $this->wTick; + $src_right = $src_pos[1] + $this->wTick; + $dest_left = $dest_pos[0] - $this->wTick; + $dest_right = $dest_pos[1] + $this->wTick; + + $d1 = abs($src_left - $dest_left); + $d2 = abs($src_right - $dest_left); + $d3 = abs($src_left - $dest_right); + $d4 = abs($src_right - $dest_right); + $d = min($d1, $d2, $d3, $d4); + + if ($d == $d1) { + $this->xSrc = $src_pos[0]; + $this->srcDir = -1; + $this->xDest = $dest_pos[0]; + $this->destDir = -1; + } elseif ($d == $d2) { + $this->xSrc = $src_pos[1]; + $this->srcDir = 1; + $this->xDest = $dest_pos[0]; + $this->destDir = -1; + } elseif ($d == $d3) { + $this->xSrc = $src_pos[0]; + $this->srcDir = -1; + $this->xDest = $dest_pos[1]; + $this->destDir = 1; + } else { + $this->xSrc = $src_pos[1]; + $this->srcDir = 1; + $this->xDest = $dest_pos[1]; + $this->destDir = 1; + } + $this->ySrc = $src_pos[2]; + $this->yDest = $dest_pos[2]; + } + + /** + * Gets arrows coordinates + * + * @param string $table The current table name + * @param string $column The relation column name + * + * @return array Arrows coordinates + * + * @access private + */ + private function _getXy($table, $column) + { + $pos = array_search($column, $table->fields); + + // x_left, x_right, y + return array( + $table->x, + $table->x + $table->width, + $table->y + ($pos + 1.5) * $table->heightCell, + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaDia.php b/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaDia.php new file mode 100755 index 0000000..02dd75a --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaDia.php @@ -0,0 +1,97 @@ +setProperties(); + } + + /** + * Sets the schema export Dia properties + * + * @return void + */ + protected function setProperties() + { + $schemaPluginProperties = new SchemaPluginProperties(); + $schemaPluginProperties->setText('Dia'); + $schemaPluginProperties->setExtension('dia'); + $schemaPluginProperties->setMimeType('application/dia'); + + // create the root group that will be the options field for + // $schemaPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // specific options main group + $specificOptions = new OptionsPropertyMainGroup("general_opts"); + // add options common to all plugins + $this->addCommonOptions($specificOptions); + + $leaf = new SelectPropertyItem( + "orientation", + __('Orientation') + ); + $leaf->setValues( + array( + 'L' => __('Landscape'), + 'P' => __('Portrait'), + ) + ); + $specificOptions->addProperty($leaf); + + $leaf = new SelectPropertyItem( + "paper", + __('Paper size') + ); + $leaf->setValues($this->getPaperSizeArray()); + $specificOptions->addProperty($leaf); + + // add the main group to the root group + $exportSpecificOptions->addProperty($specificOptions); + + // set the options for the schema export plugin property item + $schemaPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $schemaPluginProperties; + } + + /** + * Exports the schema into DIA format. + * + * @param string $db database name + * + * @return bool Whether it succeeded + */ + public function exportSchema($db) + { + $export = new DiaRelationSchema($db); + $export->showOutput(); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaEps.php b/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaEps.php new file mode 100755 index 0000000..1df342f --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaEps.php @@ -0,0 +1,98 @@ +setProperties(); + } + + /** + * Sets the schema export EPS properties + * + * @return void + */ + protected function setProperties() + { + $schemaPluginProperties = new SchemaPluginProperties(); + $schemaPluginProperties->setText('EPS'); + $schemaPluginProperties->setExtension('eps'); + $schemaPluginProperties->setMimeType('application/eps'); + + // create the root group that will be the options field for + // $schemaPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // specific options main group + $specificOptions = new OptionsPropertyMainGroup("general_opts"); + // add options common to all plugins + $this->addCommonOptions($specificOptions); + + // create leaf items and add them to the group + $leaf = new BoolPropertyItem( + 'all_tables_same_width', + __('Same width for all tables') + ); + $specificOptions->addProperty($leaf); + + $leaf = new SelectPropertyItem( + "orientation", + __('Orientation') + ); + $leaf->setValues( + array( + 'L' => __('Landscape'), + 'P' => __('Portrait'), + ) + ); + $specificOptions->addProperty($leaf); + + // add the main group to the root group + $exportSpecificOptions->addProperty($specificOptions); + + // set the options for the schema export plugin property item + $schemaPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $schemaPluginProperties; + } + + /** + * Exports the schema into EPS format. + * + * @param string $db database name + * + * @return bool Whether it succeeded + */ + public function exportSchema($db) + { + $export = new EpsRelationSchema($db); + $export->showOutput(); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaPdf.php b/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaPdf.php new file mode 100755 index 0000000..0c12fb4 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaPdf.php @@ -0,0 +1,130 @@ +setProperties(); + } + + /** + * Sets the schema export PDF properties + * + * @return void + */ + protected function setProperties() + { + $schemaPluginProperties = new SchemaPluginProperties(); + $schemaPluginProperties->setText('PDF'); + $schemaPluginProperties->setExtension('pdf'); + $schemaPluginProperties->setMimeType('application/pdf'); + + // create the root group that will be the options field for + // $schemaPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // specific options main group + $specificOptions = new OptionsPropertyMainGroup("general_opts"); + // add options common to all plugins + $this->addCommonOptions($specificOptions); + + // create leaf items and add them to the group + $leaf = new BoolPropertyItem( + 'all_tables_same_width', + __('Same width for all tables') + ); + $specificOptions->addProperty($leaf); + + $leaf = new SelectPropertyItem( + "orientation", + __('Orientation') + ); + $leaf->setValues( + array( + 'L' => __('Landscape'), + 'P' => __('Portrait'), + ) + ); + $specificOptions->addProperty($leaf); + + $leaf = new SelectPropertyItem( + "paper", + __('Paper size') + ); + $leaf->setValues($this->getPaperSizeArray()); + $specificOptions->addProperty($leaf); + + $leaf = new BoolPropertyItem( + 'show_grid', + __('Show grid') + ); + $specificOptions->addProperty($leaf); + + $leaf = new BoolPropertyItem( + 'with_doc', + __('Data dictionary') + ); + $specificOptions->addProperty($leaf); + + $leaf = new SelectPropertyItem( + "table_order", + __('Order of the tables') + ); + $leaf->setValues( + array( + '' => __('None'), + 'name_asc' => __('Name (Ascending)'), + 'name_desc' => __('Name (Descending)'), + ) + ); + $specificOptions->addProperty($leaf); + + // add the main group to the root group + $exportSpecificOptions->addProperty($specificOptions); + + // set the options for the schema export plugin property item + $schemaPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $schemaPluginProperties; + } + + /** + * Exports the schema into PDF format. + * + * @param string $db database name + * + * @return bool Whether it succeeded + */ + public function exportSchema($db) + { + $export = new PdfRelationSchema($db); + $export->showOutput(); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaSvg.php b/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaSvg.php new file mode 100755 index 0000000..fce8104 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/SchemaSvg.php @@ -0,0 +1,85 @@ +setProperties(); + } + + /** + * Sets the schema export SVG properties + * + * @return void + */ + protected function setProperties() + { + $schemaPluginProperties = new SchemaPluginProperties(); + $schemaPluginProperties->setText('SVG'); + $schemaPluginProperties->setExtension('svg'); + $schemaPluginProperties->setMimeType('application/svg'); + + // create the root group that will be the options field for + // $schemaPluginProperties + // this will be shown as "Format specific options" + $exportSpecificOptions = new OptionsPropertyRootGroup( + "Format Specific Options" + ); + + // specific options main group + $specificOptions = new OptionsPropertyMainGroup("general_opts"); + // add options common to all plugins + $this->addCommonOptions($specificOptions); + + // create leaf items and add them to the group + $leaf = new BoolPropertyItem( + 'all_tables_same_width', + __('Same width for all tables') + ); + $specificOptions->addProperty($leaf); + + // add the main group to the root group + $exportSpecificOptions->addProperty($specificOptions); + + // set the options for the schema export plugin property item + $schemaPluginProperties->setOptions($exportSpecificOptions); + $this->properties = $schemaPluginProperties; + } + + /** + * Exports the schema into SVG format. + * + * @param string $db database name + * + * @return bool Whether it succeeded + */ + public function exportSchema($db) + { + $export = new SvgRelationSchema($db); + $export->showOutput(); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/RelationStatsSvg.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/RelationStatsSvg.php new file mode 100755 index 0000000..b0f44d4 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/RelationStatsSvg.php @@ -0,0 +1,138 @@ +wTick = 10; + parent::__construct( + $diagram, + $master_table, + $master_field, + $foreign_table, + $foreign_field + ); + } + + /** + * draws relation links and arrows shows foreign key relations + * + * @param boolean $showColor Whether to use one color per relation or not + * + * @return void + * @access public + * + * @see PMA_SVG + */ + public function relationDraw($showColor) + { + if ($showColor) { + $listOfColors = array( + '#c00', + '#bbb', + '#333', + '#cb0', + '#0b0', + '#0bf', + '#b0b', + ); + shuffle($listOfColors); + $color = $listOfColors[0]; + } else { + $color = '#333'; + } + + $this->diagram->printElementLine( + 'line', + $this->xSrc, + $this->ySrc, + $this->xSrc + $this->srcDir * $this->wTick, + $this->ySrc, + 'stroke:' . $color . ';stroke-width:1;' + ); + $this->diagram->printElementLine( + 'line', + $this->xDest + $this->destDir * $this->wTick, + $this->yDest, + $this->xDest, + $this->yDest, + 'stroke:' . $color . ';stroke-width:1;' + ); + $this->diagram->printElementLine( + 'line', + $this->xSrc + $this->srcDir * $this->wTick, + $this->ySrc, + $this->xDest + $this->destDir * $this->wTick, + $this->yDest, + 'stroke:' . $color . ';stroke-width:1;' + ); + $root2 = 2 * sqrt(2); + $this->diagram->printElementLine( + 'line', + $this->xSrc + $this->srcDir * $this->wTick * 0.75, + $this->ySrc, + $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, + $this->ySrc + $this->wTick / $root2, + 'stroke:' . $color . ';stroke-width:2;' + ); + $this->diagram->printElementLine( + 'line', + $this->xSrc + $this->srcDir * $this->wTick * 0.75, + $this->ySrc, + $this->xSrc + $this->srcDir * (0.75 - 1 / $root2) * $this->wTick, + $this->ySrc - $this->wTick / $root2, + 'stroke:' . $color . ';stroke-width:2;' + ); + $this->diagram->printElementLine( + 'line', + $this->xDest + $this->destDir * $this->wTick / 2, + $this->yDest, + $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, + $this->yDest + $this->wTick / $root2, + 'stroke:' . $color . ';stroke-width:2;' + ); + $this->diagram->printElementLine( + 'line', + $this->xDest + $this->destDir * $this->wTick / 2, + $this->yDest, + $this->xDest + $this->destDir * (0.5 + 1 / $root2) * $this->wTick, + $this->yDest - $this->wTick / $root2, + 'stroke:' . $color . ';stroke-width:2;' + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/Svg.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/Svg.php new file mode 100755 index 0000000..c41012b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/Svg.php @@ -0,0 +1,279 @@ +openMemory(); + /* + * Set indenting using three spaces, + * so output is formatted + */ + + $this->setIndent(true); + $this->setIndentString(' '); + /* + * Create the XML document + */ + + $this->startDocument('1.0', 'UTF-8'); + $this->startDtd( + 'svg', + '-//W3C//DTD SVG 1.1//EN', + 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd' + ); + $this->endDtd(); + } + + /** + * Set document title + * + * @param string $value sets the title text + * + * @return void + */ + public function setTitle($value) + { + $this->title = $value; + } + + /** + * Set document author + * + * @param string $value sets the author + * + * @return void + */ + public function setAuthor($value) + { + $this->author = $value; + } + + /** + * Set document font + * + * @param string $value sets the font e.g Arial, Sans-serif etc + * + * @return void + */ + public function setFont($value) + { + $this->font = $value; + } + + /** + * Get document font + * + * @return string returns the font name + */ + public function getFont() + { + return $this->font; + } + + /** + * Set document font size + * + * @param integer $value sets the font size in pixels + * + * @return void + */ + public function setFontSize($value) + { + $this->fontSize = $value; + } + + /** + * Get document font size + * + * @return integer returns the font size + */ + public function getFontSize() + { + return $this->fontSize; + } + + /** + * Starts RelationStatsSvg Document + * + * svg document starts by first initializing svg tag + * which contains all the attributes and namespace that needed + * to define the svg document + * + * @param integer $width total width of the RelationStatsSvg document + * @param integer $height total height of the RelationStatsSvg document + * @param integer $x min-x of the view box + * @param integer $y min-y of the view box + * + * @return void + * + * @see XMLWriter::startElement(),XMLWriter::writeAttribute() + */ + public function startSvgDoc($width, $height, $x = 0, $y = 0) + { + $this->startElement('svg'); + + if (!is_int($width)) { + $width = intval($width); + } + + if (!is_int($height)) { + $height = intval($height); + } + + if ($x != 0 || $y != 0) { + $this->writeAttribute('viewBox', "$x $y $width $height"); + } + $this->writeAttribute('width', ($width - $x) . 'px'); + $this->writeAttribute('height', ($height - $y) . 'px'); + $this->writeAttribute('xmlns', 'http://www.w3.org/2000/svg'); + $this->writeAttribute('version', '1.1'); + } + + /** + * Ends RelationStatsSvg Document + * + * @return void + * @see XMLWriter::endElement(),XMLWriter::endDocument() + */ + public function endSvgDoc() + { + $this->endElement(); + $this->endDocument(); + } + + /** + * output RelationStatsSvg Document + * + * svg document prompted to the user for download + * RelationStatsSvg document saved in .svg extension and can be + * easily changeable by using any svg IDE + * + * @param string $fileName file name + * + * @return void + * @see XMLWriter::startElement(),XMLWriter::writeAttribute() + */ + public function showOutput($fileName) + { + //ob_get_clean(); + $output = $this->flush(); + Response::getInstance()->disable(); + Core::downloadHeader( + $fileName, + 'image/svg+xml', + strlen($output) + ); + print $output; + } + + /** + * Draws RelationStatsSvg elements + * + * SVG has some predefined shape elements like rectangle & text + * and other elements who have x,y co-ordinates are drawn. + * specify their width and height and can give styles too. + * + * @param string $name RelationStatsSvg element name + * @param int $x The x attr defines the left position of the element + * (e.g. x="0" places the element 0 pixels from the + * left of the browser window) + * @param integer $y The y attribute defines the top position of the + * element (e.g. y="0" places the element 0 pixels + * from the top of the browser window) + * @param int|string $width The width attribute defines the width the element + * @param int|string $height The height attribute defines the height the element + * @param string $text The text attribute defines the text the element + * @param string $styles The style attribute defines the style the element + * styles can be defined like CSS styles + * + * @return void + * + * @see XMLWriter::startElement(), XMLWriter::writeAttribute(), + * XMLWriter::text(), XMLWriter::endElement() + */ + public function printElement( + $name, + $x, + $y, + $width = '', + $height = '', + $text = '', + $styles = '' + ) { + $this->startElement($name); + $this->writeAttribute('width', $width); + $this->writeAttribute('height', $height); + $this->writeAttribute('x', $x); + $this->writeAttribute('y', $y); + $this->writeAttribute('style', $styles); + if (isset($text)) { + $this->writeAttribute('font-family', $this->font); + $this->writeAttribute('font-size', $this->fontSize . 'px'); + $this->text($text); + } + $this->endElement(); + } + + /** + * Draws RelationStatsSvg Line element + * + * RelationStatsSvg line element is drawn for connecting the tables. + * arrows are also drawn by specify its start and ending + * co-ordinates + * + * @param string $name RelationStatsSvg element name i.e line + * @param integer $x1 Defines the start of the line on the x-axis + * @param integer $y1 Defines the start of the line on the y-axis + * @param integer $x2 Defines the end of the line on the x-axis + * @param integer $y2 Defines the end of the line on the y-axis + * @param string $styles The style attribute defines the style the element + * styles can be defined like CSS styles + * + * @return void + * + * @see XMLWriter::startElement(), XMLWriter::writeAttribute(), + * XMLWriter::endElement() + */ + public function printElementLine($name, $x1, $y1, $x2, $y2, $styles) + { + $this->startElement($name); + $this->writeAttribute('x1', $x1); + $this->writeAttribute('y1', $y1); + $this->writeAttribute('x2', $x2); + $this->writeAttribute('y2', $y2); + $this->writeAttribute('style', $styles); + $this->endElement(); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php new file mode 100755 index 0000000..846b8fa --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php @@ -0,0 +1,268 @@ +setShowColor(isset($_REQUEST['svg_show_color'])); + $this->setShowKeys(isset($_REQUEST['svg_show_keys'])); + $this->setTableDimension(isset($_REQUEST['svg_show_table_dimension'])); + $this->setAllTablesSameWidth(isset($_REQUEST['svg_all_tables_same_width'])); + + $this->diagram->setTitle( + sprintf( + __('Schema of the %s database - Page %s'), + $this->db, + $this->pageNumber + ) + ); + $this->diagram->SetAuthor('phpMyAdmin ' . PMA_VERSION); + $this->diagram->setFont('Arial'); + $this->diagram->setFontSize(16); + + $alltables = $this->getTablesFromRequest(); + + foreach ($alltables as $table) { + if (!isset($this->_tables[$table])) { + $this->_tables[$table] = new TableStatsSvg( + $this->diagram, $this->db, + $table, $this->diagram->getFont(), + $this->diagram->getFontSize(), $this->pageNumber, + $this->_tablewidth, $this->showKeys, $this->tableDimension, + $this->offline + ); + } + + if ($this->sameWide) { + $this->_tables[$table]->width = &$this->_tablewidth; + } + $this->_setMinMax($this->_tables[$table]); + } + + $border = 15; + $this->diagram->startSvgDoc( + $this->_xMax + $border, + $this->_yMax + $border, + $this->_xMin - $border, + $this->_yMin - $border + ); + + $seen_a_relation = false; + foreach ($alltables as $one_table) { + $exist_rel = $this->relation->getForeigners($this->db, $one_table, '', 'both'); + if (!$exist_rel) { + continue; + } + + $seen_a_relation = true; + foreach ($exist_rel as $master_field => $rel) { + /* put the foreign table on the schema only if selected + * by the user + * (do not use array_search() because we would have to + * to do a === false and this is not PHP3 compatible) + */ + if ($master_field != 'foreign_keys_data') { + if (in_array($rel['foreign_table'], $alltables)) { + $this->_addRelation( + $one_table, + $this->diagram->getFont(), + $this->diagram->getFontSize(), + $master_field, + $rel['foreign_table'], + $rel['foreign_field'], + $this->tableDimension + ); + } + continue; + } + + foreach ($rel as $one_key) { + if (!in_array($one_key['ref_table_name'], $alltables)) { + continue; + } + + foreach ( + $one_key['index_list'] + as $index => $one_field + ) { + $this->_addRelation( + $one_table, + $this->diagram->getFont(), + $this->diagram->getFontSize(), + $one_field, + $one_key['ref_table_name'], + $one_key['ref_index_list'][$index], + $this->tableDimension + ); + } + } + } + } + if ($seen_a_relation) { + $this->_drawRelations(); + } + + $this->_drawTables(); + $this->diagram->endSvgDoc(); + } + + /** + * Output RelationStatsSvg Document for download + * + * @return void + */ + public function showOutput() + { + $this->diagram->showOutput($this->getFileName('.svg')); + } + + /** + * Sets X and Y minimum and maximum for a table cell + * + * @param string $table The table name + * + * @return void + */ + private function _setMinMax($table) + { + $this->_xMax = max($this->_xMax, $table->x + $table->width); + $this->_yMax = max($this->_yMax, $table->y + $table->height); + $this->_xMin = min($this->_xMin, $table->x); + $this->_yMin = min($this->_yMin, $table->y); + } + + /** + * Defines relation objects + * + * @param string $masterTable The master table name + * @param string $font The font face + * @param int $fontSize Font size + * @param string $masterField The relation field in the master table + * @param string $foreignTable The foreign table name + * @param string $foreignField The relation field in the foreign table + * @param boolean $tableDimension Whether to display table position or not + * + * @return void + * + * @see _setMinMax,Table_Stats_Svg::__construct(), + * PhpMyAdmin\Plugins\Schema\Svg\RelationStatsSvg::__construct() + */ + private function _addRelation( + $masterTable, + $font, + $fontSize, + $masterField, + $foreignTable, + $foreignField, + $tableDimension + ) { + if (!isset($this->_tables[$masterTable])) { + $this->_tables[$masterTable] = new TableStatsSvg( + $this->diagram, $this->db, + $masterTable, $font, $fontSize, $this->pageNumber, + $this->_tablewidth, false, $tableDimension + ); + $this->_setMinMax($this->_tables[$masterTable]); + } + if (!isset($this->_tables[$foreignTable])) { + $this->_tables[$foreignTable] = new TableStatsSvg( + $this->diagram, $this->db, + $foreignTable, $font, $fontSize, $this->pageNumber, + $this->_tablewidth, false, $tableDimension + ); + $this->_setMinMax($this->_tables[$foreignTable]); + } + $this->_relations[] = new RelationStatsSvg( + $this->diagram, + $this->_tables[$masterTable], + $masterField, + $this->_tables[$foreignTable], + $foreignField + ); + } + + /** + * Draws relation arrows and lines + * connects master table's master field to + * foreign table's foreign field + * + * @return void + * + * @see Relation_Stats_Svg::relationDraw() + */ + private function _drawRelations() + { + foreach ($this->_relations as $relation) { + $relation->relationDraw($this->showColor); + } + } + + /** + * Draws tables + * + * @return void + * + * @see Table_Stats_Svg::Table_Stats_tableDraw() + */ + private function _drawTables() + { + foreach ($this->_tables as $table) { + $table->tableDraw($this->showColor); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/TableStatsSvg.php b/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/TableStatsSvg.php new file mode 100755 index 0000000..29cbc9a --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/Svg/TableStatsSvg.php @@ -0,0 +1,202 @@ +_setHeightTable($fontSize); + // setWidth must me after setHeight, because title + // can include table height which changes table width + $this->_setWidthTable($font, $fontSize); + if ($same_wide_width < $this->width) { + $same_wide_width = $this->width; + } + } + + /** + * Displays an error when the table cannot be found. + * + * @return void + */ + protected function showMissingTableError() + { + ExportRelationSchema::dieSchema( + $this->pageNumber, + "SVG", + sprintf(__('The %s table doesn\'t exist!'), $this->tableName) + ); + } + + /** + * Sets the width of the table + * + * @param string $font The font size + * @param integer $fontSize The font size + * + * @return void + * @access private + * + * @see PMA_SVG + */ + private function _setWidthTable($font, $fontSize) + { + foreach ($this->fields as $field) { + $this->width = max( + $this->width, + Font::getStringWidth($field, $font, $fontSize) + ); + } + $this->width += Font::getStringWidth(' ', $font, $fontSize); + + /* + * it is unknown what value must be added, because + * table title is affected by the table width value + */ + while ($this->width + < Font::getStringWidth($this->getTitle(), $font, $fontSize) + ) { + $this->width += 7; + } + } + + /** + * Sets the height of the table + * + * @param integer $fontSize font size + * + * @return void + */ + private function _setHeightTable($fontSize) + { + $this->heightCell = $fontSize + 4; + $this->height = (count($this->fields) + 1) * $this->heightCell; + } + + /** + * draw the table + * + * @param boolean $showColor Whether to display color + * + * @access public + * @return void + * + * @see PMA_SVG,PMA_SVG::printElement + */ + public function tableDraw($showColor) + { + $this->diagram->printElement( + 'rect', + $this->x, + $this->y, + $this->width, + $this->heightCell, + null, + 'fill:#007;stroke:black;' + ); + $this->diagram->printElement( + 'text', + $this->x + 5, + $this->y + 14, + $this->width, + $this->heightCell, + $this->getTitle(), + 'fill:#fff;' + ); + foreach ($this->fields as $field) { + $this->currentCell += $this->heightCell; + $fillColor = 'none'; + if ($showColor) { + if (in_array($field, $this->primary)) { + $fillColor = '#aea'; + } + if ($field == $this->displayfield) { + $fillColor = 'none'; + } + } + $this->diagram->printElement( + 'rect', + $this->x, + $this->y + $this->currentCell, + $this->width, + $this->heightCell, + null, + 'fill:' . $fillColor . ';stroke:black;' + ); + $this->diagram->printElement( + 'text', + $this->x + 5, + $this->y + 14 + $this->currentCell, + $this->width, + $this->heightCell, + $field, + 'fill:black;' + ); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Schema/TableStats.php b/phpMyAdmin/libraries/classes/Plugins/Schema/TableStats.php new file mode 100755 index 0000000..420618d --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Schema/TableStats.php @@ -0,0 +1,191 @@ +diagram = $diagram; + $this->db = $db; + $this->pageNumber = $pageNumber; + $this->tableName = $tableName; + + $this->showKeys = $showKeys; + $this->tableDimension = $tableDimension; + + $this->offline = $offline; + + $this->relation = new Relation(); + + // checks whether the table exists + // and loads fields + $this->validateTableAndLoadFields(); + // load table coordinates + $this->loadCoordinates(); + // loads display field + $this->loadDisplayField(); + // loads primary keys + $this->loadPrimaryKey(); + } + + /** + * Validate whether the table exists. + * + * @return void + */ + protected function validateTableAndLoadFields() + { + $sql = 'DESCRIBE ' . Util::backquote($this->tableName); + $result = $GLOBALS['dbi']->tryQuery( + $sql, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + if (! $result || ! $GLOBALS['dbi']->numRows($result)) { + $this->showMissingTableError(); + } + + if ($this->showKeys) { + $indexes = Index::getFromTable($this->tableName, $this->db); + $all_columns = array(); + foreach ($indexes as $index) { + $all_columns = array_merge( + $all_columns, + array_flip(array_keys($index->getColumns())) + ); + } + $this->fields = array_keys($all_columns); + } else { + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $this->fields[] = $row[0]; + } + } + } + + /** + * Displays an error when the table cannot be found. + * + * @return void + * @abstract + */ + protected abstract function showMissingTableError(); + + /** + * Loads coordinates of a table + * + * @return void + */ + protected function loadCoordinates() + { + if (isset($_POST['t_h'])) { + foreach ($_POST['t_h'] as $key => $value) { + $db = rawurldecode($_POST['t_db'][$key]); + $tbl = rawurldecode($_POST['t_tbl'][$key]); + if ($this->db . '.' . $this->tableName === $db . '.' . $tbl) { + $this->x = (double) $_POST['t_x'][$key]; + $this->y = (double) $_POST['t_y'][$key]; + break; + } + } + } + } + + /** + * Loads the table's display field + * + * @return void + */ + protected function loadDisplayField() + { + $this->displayfield = $this->relation->getDisplayField($this->db, $this->tableName); + } + + /** + * Loads the PRIMARY key. + * + * @return void + */ + protected function loadPrimaryKey() + { + $result = $GLOBALS['dbi']->query( + 'SHOW INDEX FROM ' . Util::backquote($this->tableName) . ';', + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + if ($GLOBALS['dbi']->numRows($result) > 0) { + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + if ($row['Key_name'] == 'PRIMARY') { + $this->primary[] = $row['Column_name']; + } + } + } + } + + /** + * Returns title of the current table, + * title can have the dimensions/co-ordinates of the table + * + * @return string title of the current table + */ + protected function getTitle() + { + return ($this->tableDimension + ? sprintf('%.0fx%0.f', $this->width, $this->heightCell) + : '' + ) + . ' ' . $this->tableName; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/SchemaPlugin.php b/phpMyAdmin/libraries/classes/Plugins/SchemaPlugin.php new file mode 100755 index 0000000..7be1959 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/SchemaPlugin.php @@ -0,0 +1,89 @@ +properties; + } + + /** + * Sets the export plugins properties and is implemented by + * each schema export plugin + * + * @return void + */ + protected abstract function setProperties(); + + /** + * Exports the schema into the specified format. + * + * @param string $db database name + * + * @return bool Whether it succeeded + */ + public abstract function exportSchema($db); + + /** + * Adds export options common to all plugins. + * + * @param \PhpMyAdmin\Properties\Options\Groups\OptionsPropertyMainGroup $propertyGroup property group + * + * @return void + */ + protected function addCommonOptions(OptionsPropertyMainGroup $propertyGroup) + { + $leaf = new BoolPropertyItem('show_color', __('Show color')); + $propertyGroup->addProperty($leaf); + $leaf = new BoolPropertyItem('show_keys', __('Only show keys')); + $propertyGroup->addProperty($leaf); + } + + /** + * Returns the array of paper sizes + * + * @return array array of paper sizes + */ + protected function getPaperSizeArray() + { + $ret = array(); + foreach ($GLOBALS['cfg']['PDFPageSizes'] as $val) { + $ret[$val] = $val; + } + + return $ret; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php new file mode 100755 index 0000000..49a1c09 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/Bool2TextTransformationsPlugin.php @@ -0,0 +1,66 @@ +getOptions($options, $cfg['DefaultTransformations']['Bool2Text']); + + if ($buffer == '0') { + return $options[1]; // return false label + } + + return $options[0]; // or true one if nonzero + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Bool2Text"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/CodeMirrorEditorTransformationPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/CodeMirrorEditorTransformationPlugin.php new file mode 100755 index 0000000..129da8e --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/CodeMirrorEditorTransformationPlugin.php @@ -0,0 +1,72 @@ +'; + } + $class = 'transform_' . strtolower(static::getName()) . '_editor'; + $html .= ''; + + return $html; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php new file mode 100755 index 0000000..595872c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/DateFormatTransformationsPlugin.php @@ -0,0 +1,161 @@ +getOptions($options, $cfg['DefaultTransformations']['DateFormat']); + + // further operations on $buffer using the $options[] array. + $options[2] = mb_strtolower($options[2]); + + if (empty($options[1])) { + if ($options[2] == 'local') { + $options[1] = __('%B %d, %Y at %I:%M %p'); + } else { + $options[1] = 'Y-m-d H:i:s'; + } + } + + $timestamp = -1; + + // INT columns will be treated as UNIX timestamps + // and need to be detected before the verification for + // MySQL TIMESTAMP + if ($meta->type == 'int') { + $timestamp = $buffer; + + // Detect TIMESTAMP(6 | 8 | 10 | 12 | 14) + // TIMESTAMP (2 | 4) not supported here. + // (Note: prior to MySQL 4.1, TIMESTAMP has a display size + // for example TIMESTAMP(8) means YYYYMMDD) + } else { + if (preg_match('/^(\d{2}){3,7}$/', $buffer)) { + + if (mb_strlen($buffer) == 14 || mb_strlen($buffer) == 8) { + $offset = 4; + } else { + $offset = 2; + } + + $aDate = array(); + $aDate['year'] = (int) + mb_substr($buffer, 0, $offset); + $aDate['month'] = (int) + mb_substr($buffer, $offset, 2); + $aDate['day'] = (int) + mb_substr($buffer, $offset + 2, 2); + $aDate['hour'] = (int) + mb_substr($buffer, $offset + 4, 2); + $aDate['minute'] = (int) + mb_substr($buffer, $offset + 6, 2); + $aDate['second'] = (int) + mb_substr($buffer, $offset + 8, 2); + + if (checkdate($aDate['month'], $aDate['day'], $aDate['year'])) { + $timestamp = mktime( + $aDate['hour'], + $aDate['minute'], + $aDate['second'], + $aDate['month'], + $aDate['day'], + $aDate['year'] + ); + } + // If all fails, assume one of the dozens of valid strtime() syntaxes + // (https://www.gnu.org/manual/tar-1.12/html_chapter/tar_7.html) + } else { + if (preg_match('/^[0-9]\d{1,9}$/', $buffer)) { + $timestamp = (int)$buffer; + } else { + $timestamp = strtotime($buffer); + } + } + } + + // If all above failed, maybe it's a Unix timestamp already? + if ($timestamp < 0 && preg_match('/^[1-9]\d{1,9}$/', $buffer)) { + $timestamp = $buffer; + } + + // Reformat a valid timestamp + if ($timestamp >= 0) { + $timestamp -= $options[0] * 60 * 60; + $source = $buffer; + if ($options[2] == 'local') { + $text = Util::localisedDate( + $timestamp, + $options[1] + ); + } elseif ($options[2] == 'utc') { + $text = gmdate($options[1], $timestamp); + } else { + $text = 'INVALID DATE TYPE'; + } + return '' . htmlspecialchars($text) . ''; + } + + return htmlspecialchars($buffer); + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Date Format"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php new file mode 100755 index 0000000..d205b9f --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/DownloadTransformationsPlugin.php @@ -0,0 +1,90 @@ + $val) { + if ($val->name == $options[1]) { + $pos = $key; + break; + } + } + if (isset($pos)) { + $cn = $row[$pos]; + } + } + if (empty($cn)) { + $cn = 'binary_file.dat'; + } + } + + return sprintf( + '%s', + $options['wrapper_link'], + htmlspecialchars(urlencode($cn)), + htmlspecialchars($cn), + htmlspecialchars($cn) + ); + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Download"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php new file mode 100755 index 0000000..41c2a88 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php @@ -0,0 +1,161 @@ +getOptions( + $options, + $cfg['DefaultTransformations']['External'] + ); + + if (isset($allowed_programs[$options[0]])) { + $program = $allowed_programs[$options[0]]; + } else { + $program = $allowed_programs[0]; + } + + if (isset($options[1]) && strlen((string) $options[1]) > 0) { + trigger_error(sprintf( + __( + 'You are using the external transformation command line options field, which has been deprecated for security reasons. ' + . 'Add all command line options directly to the definition in %s.' + ), + '[code]libraries/classes/Plugins/Transformations/Abs/ExternalTransformationsPlugin.php[/code]' + ), E_USER_DEPRECATED); + } + + // needs PHP >= 4.3.0 + $newstring = ''; + $descriptorspec = array( + 0 => array("pipe", "r"), + 1 => array("pipe", "w"), + ); + $process = proc_open($program . ' ' . $options[1], $descriptorspec, $pipes); + if (is_resource($process)) { + fwrite($pipes[0], $buffer); + fclose($pipes[0]); + + while (!feof($pipes[1])) { + $newstring .= fgets($pipes[1], 1024); + } + fclose($pipes[1]); + // we don't currently use the return value + proc_close($process); + } + + if ($options[2] == 1 || $options[2] == '2') { + $retstring = htmlspecialchars($newstring); + } else { + $retstring = $newstring; + } + + return $retstring; + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "External"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php new file mode 100755 index 0000000..c97f126 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/FormattedTransformationsPlugin.php @@ -0,0 +1,62 @@ +'; + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Formatted"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php new file mode 100755 index 0000000..627de1f --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/HexTransformationsPlugin.php @@ -0,0 +1,68 @@ +getOptions($options, $cfg['DefaultTransformations']['Hex']); + $options[0] = intval($options[0]); + + if ($options[0] < 1) { + return bin2hex($buffer); + } else { + return chunk_split(bin2hex($buffer), $options[0], ' '); + } + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Hex"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php new file mode 100755 index 0000000..6dca346 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ImageLinkTransformationsPlugin.php @@ -0,0 +1,64 @@ +[BLOB]'; + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "ImageLink"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php new file mode 100755 index 0000000..3909149 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/ImageUploadTransformationsPlugin.php @@ -0,0 +1,118 @@ +'; + $html .= ''; + $src = 'transformation_wrapper.php' . $options['wrapper_link']; + } + $html .= ''
+            . __('Image preview here') . ''; + $html .= '
    '; + + return $html; + } + + /** + * Returns the array of scripts (filename) required for plugin + * initialization and handling + * + * @return array javascripts to be included + */ + public function getScripts() + { + return array( + 'transformations/image_upload.js', + ); + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Image upload"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php new file mode 100755 index 0000000..a56fd80 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/InlineTransformationsPlugin.php @@ -0,0 +1,79 @@ +getOptions($options, $cfg['DefaultTransformations']['Inline']); + + if (PMA_IS_GD2) { + return '[' . htmlspecialchars($buffer) . ']'; + } else { + return '[' . htmlspecialchars($buffer) . ']'; + } + } + + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Inline"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php new file mode 100755 index 0000000..217c46b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/LongToIPv4TransformationsPlugin.php @@ -0,0 +1,63 @@ + 4294967295) { + return htmlspecialchars($buffer); + } + + return long2ip((int) $buffer); + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Long To IPv4"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php new file mode 100755 index 0000000..401e34b --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/PreApPendTransformationsPlugin.php @@ -0,0 +1,65 @@ +getOptions($options, $cfg['DefaultTransformations']['PreApPend']); + + //just prepend and/or append the options to the original text + return htmlspecialchars($options[0]) . htmlspecialchars($buffer) + . htmlspecialchars($options[1]); + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "PreApPend"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php new file mode 100755 index 0000000..158cad7 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/RegexValidationTransformationsPlugin.php @@ -0,0 +1,71 @@ +reset(); + if (!empty($options[0]) && !preg_match($options[0], $buffer)) { + $this->success = false; + $this->error = sprintf( + __('Validation failed for the input string %s.'), + htmlspecialchars($buffer) + ); + } + + return $buffer; + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Regex Validation"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php new file mode 100755 index 0000000..bd1ad74 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/SQLTransformationsPlugin.php @@ -0,0 +1,62 @@ +getOptions($options, $cfg['DefaultTransformations']['Substring']); + + if ($options[1] != 'all') { + $newtext = mb_substr( + $buffer, + $options[0], + $options[1] + ); + } else { + $newtext = mb_substr($buffer, $options[0]); + } + + $length = mb_strlen($newtext); + $baselength = mb_strlen($buffer); + if ($length != $baselength) { + if ($options[0] != 0) { + $newtext = $options[2] . $newtext; + } + + if (($length + $options[0]) != $baselength) { + $newtext .= $options[2]; + } + } + + return htmlspecialchars($newtext); + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Substring"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php new file mode 100755 index 0000000..ff90bf9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextFileUploadTransformationsPlugin.php @@ -0,0 +1,100 @@ +'; + $html .= ''; + } + $html .= ''; + + return $html; + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Text file upload"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php new file mode 100755 index 0000000..1229f84 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextImageLinkTransformationsPlugin.php @@ -0,0 +1,76 @@ +getOptions($options, $cfg['DefaultTransformations']['TextImageLink']); + $url = $options[0] . $buffer; + /* Do not allow javascript links */ + if (! Sanitize::checkLink($url, true, true)) { + return htmlspecialchars($url); + } + return '' + . htmlspecialchars($buffer) . ''; + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "Image Link"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php new file mode 100755 index 0000000..29a4d74 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Abs/TextLinkTransformationsPlugin.php @@ -0,0 +1,78 @@ +getOptions($options, $cfg['DefaultTransformations']['TextLink']); + $url = (isset($options[0]) ? $options[0] : '') . ((isset($options[2]) && $options[2]) ? '' : $buffer); + /* Do not allow javascript links */ + if (! Sanitize::checkLink($url, true, true)) { + return htmlspecialchars($url); + } + return '' + . htmlspecialchars(isset($options[1]) ? $options[1] : $buffer) + . ''; + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "TextLink"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php new file mode 100755 index 0000000..2478658 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Input/Image_JPEG_Upload.php @@ -0,0 +1,42 @@ +'; + } + $class = 'transform_IPToBin'; + $html .= ''; + + return $html; + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the transformation name of the plugin + * + * @return string + */ + public static function getName() + { + return "IPv4/IPv6 To Binary"; + } + + /** + * Gets the plugin`s MIME type + * + * @return string + */ + public static function getMIMEType() + { + return "Text"; + } + + /** + * Gets the plugin`s MIME subtype + * + * @return string + */ + public static function getMIMESubtype() + { + return "Plain"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php new file mode 100755 index 0000000..75ae8a5 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Input/Text_Plain_JsonEditor.php @@ -0,0 +1,83 @@ +getHeader() + ->getScripts(); + $scripts->addFile('vendor/codemirror/lib/codemirror.js'); + $scripts->addFile('vendor/codemirror/mode/javascript/javascript.js'); + $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js'); + $scripts->addFile('transformations/json.js'); + } + } + + /** + * Gets the transformation description of the specific plugin + * + * @return string + */ + public static function getInfo() + { + return __( + 'Formats text as JSON with syntax highlighting.' + ); + } + + /** + * Does the actual work of each specific transformations plugin. + * + * @param string $buffer text to be transformed + * @param array $options transformation options + * @param string $meta meta information + * + * @return string + */ + public function applyTransformation($buffer, array $options = array(), $meta = '') + { + return '
    ' . "\n"
    +        . htmlspecialchars($buffer) . "\n"
    +        . '
    '; + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the plugin`s MIME type + * + * @return string + */ + public static function getMIMEType() + { + return "Text"; + } + + /** + * Gets the plugin`s MIME subtype + * + * @return string + */ + public static function getMIMESubtype() + { + return "Plain"; + } + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "JSON"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php new file mode 100755 index 0000000..ebd9c5e --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Sql.php @@ -0,0 +1,58 @@ +getHeader() + ->getScripts(); + $scripts->addFile('vendor/codemirror/lib/codemirror.js'); + $scripts->addFile('vendor/codemirror/mode/sql/sql.js'); + $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js'); + $scripts->addFile('functions.js'); + } + } + + /** + * Gets the plugin`s MIME type + * + * @return string + */ + public static function getMIMEType() + { + return "Text"; + } + + /** + * Gets the plugin`s MIME subtype + * + * @return string + */ + public static function getMIMESubtype() + { + return "Plain"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php new file mode 100755 index 0000000..44bf6c0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Output/Text_Plain_Xml.php @@ -0,0 +1,98 @@ +getHeader() + ->getScripts(); + $scripts->addFile('vendor/codemirror/lib/codemirror.js'); + $scripts->addFile('vendor/codemirror/mode/xml/xml.js'); + $scripts->addFile('vendor/codemirror/addon/runmode/runmode.js'); + $scripts->addFile('transformations/xml.js'); + } + } + + /** + * Gets the transformation description of the specific plugin + * + * @return string + */ + public static function getInfo() + { + return __( + 'Formats text as XML with syntax highlighting.' + ); + } + + /** + * Does the actual work of each specific transformations plugin. + * + * @param string $buffer text to be transformed + * @param array $options transformation options + * @param string $meta meta information + * + * @return string + */ + public function applyTransformation($buffer, array $options = array(), $meta = '') + { + return '
    ' . "\n"
    +        . htmlspecialchars($buffer) . "\n"
    +        . '
    '; + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the plugin`s MIME type + * + * @return string + */ + public static function getMIMEType() + { + return "Text"; + } + + /** + * Gets the plugin`s MIME subtype + * + * @return string + */ + public static function getMIMESubtype() + { + return "Plain"; + } + + /** + * Gets the transformation name of the specific plugin + * + * @return string + */ + public static function getName() + { + return "XML"; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/README b/phpMyAdmin/libraries/classes/Plugins/Transformations/README new file mode 100755 index 0000000..7d7a125 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/README @@ -0,0 +1,4 @@ +TRANSFORMATION USAGE (Garvin Hicking, ) +==================== + +See the documentation for complete instructions on how to use transformation plugins. diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/TEMPLATE b/phpMyAdmin/libraries/classes/Plugins/Transformations/TEMPLATE new file mode 100755 index 0000000..0f9c48d --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/TEMPLATE @@ -0,0 +1,47 @@ + diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT b/phpMyAdmin/libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT new file mode 100755 index 0000000..fc81543 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/TEMPLATE_ABSTRACT @@ -0,0 +1,74 @@ +mimetype contains the original MimeType of the field (i.e. 'text/plain', 'image/jpeg' etc.) + + return $buffer; + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + + /** + * Gets the TransformationName of the specific plugin + * + * @return string + */ + public static function getName() + { + return "[TransformationName]"; + } +} +?> diff --git a/phpMyAdmin/libraries/classes/Plugins/Transformations/Text_Plain_Link.php b/phpMyAdmin/libraries/classes/Plugins/Transformations/Text_Plain_Link.php new file mode 100755 index 0000000..90c4bd3 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/Transformations/Text_Plain_Link.php @@ -0,0 +1,41 @@ + $value) { + if (isset($options[$key]) && $options[$key] !== '') { + $result[$key] = $options[$key]; + } else { + $result[$key] = $value; + } + } + + return $result; + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Application.php b/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Application.php new file mode 100755 index 0000000..c739b98 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Application.php @@ -0,0 +1,158 @@ +_google2fa = new Google2FA(); + $this->_google2fa->setWindow(8); + if (!isset($this->_twofactor->config['settings']['secret'])) { + $this->_twofactor->config['settings']['secret'] = ''; + } + } + + /** + * Get any property of this class + * + * @param string $property name of the property + * + * @return mixed|void if property exist, value of the relevant property + */ + public function __get($property) + { + switch ($property) { + case 'google2fa': + return $this->_google2fa; + } + } + + /** + * Checks authentication, returns true on success + * + * @return boolean + */ + public function check() + { + $this->_provided = false; + if (!isset($_POST['2fa_code'])) { + return false; + } + $this->_provided = true; + return $this->_google2fa->verifyKey( + $this->_twofactor->config['settings']['secret'], $_POST['2fa_code'] + ); + } + + /** + * Renders user interface to enter two-factor authentication + * + * @return string HTML code + */ + public function render() + { + return Template::get('login/twofactor/application')->render(); + } + + /** + * Renders user interface to configure two-factor authentication + * + * @return string HTML code + */ + public function setup() + { + $secret = $this->_twofactor->config['settings']['secret']; + $renderArray = ['secret' => $secret]; + if (extension_loaded('gd')) { + $inlineUrl = $this->_google2fa->getQRCodeInline( + 'phpMyAdmin (' . $this->getAppId(false) . ')', + $this->_twofactor->user, + $secret + ); + $renderArray['image'] = $inlineUrl; + } else { + $inlineUrl = $this->_google2fa->getQRCodeUrl( + 'phpMyAdmin (' . $this->getAppId(false) . ')', + $this->_twofactor->user, + $secret + ); + trigger_error( + __( + 'The gd PHP extension was not found.' + . ' The QRcode can not be displayed without the gd PHP extension.' + ), + E_USER_WARNING + ); + $renderArray['url'] = $inlineUrl; + } + return Template::get('login/twofactor/application_configure')->render($renderArray); + } + + /** + * Performs backend configuration + * + * @return boolean + */ + public function configure() + { + if (! isset($_SESSION['2fa_application_key'])) { + $_SESSION['2fa_application_key'] = $this->_google2fa->generateSecretKey(); + } + $this->_twofactor->config['settings']['secret'] = $_SESSION['2fa_application_key']; + + $result = $this->check(); + if ($result) { + unset($_SESSION['2fa_application_key']); + } + return $result; + } + + /** + * Get user visible name + * + * @return string + */ + public static function getName() + { + return __('Authentication Application (2FA)'); + } + + /** + * Get user visible description + * + * @return string + */ + public static function getDescription() + { + return __('Provides authentication using HOTP and TOTP applications such as FreeOTP, Google Authenticator or Authy.'); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Invalid.php b/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Invalid.php new file mode 100755 index 0000000..b4fbfd5 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Invalid.php @@ -0,0 +1,65 @@ +render(); + } + + /** + * Get user visible name + * + * @return string + */ + public static function getName() + { + return 'Invalid two-factor authentication'; + } + + /** + * Get user visible description + * + * @return string + */ + public static function getDescription() + { + return 'Error fallback only!'; + } +} + diff --git a/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Key.php b/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Key.php new file mode 100755 index 0000000..3ce4b23 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Key.php @@ -0,0 +1,198 @@ +_twofactor->config['settings']['registrations'])) { + $this->_twofactor->config['settings']['registrations'] = []; + } + } + + /** + * Returns array of U2F registration objects + * + * @return array + */ + public function getRegistrations() + { + $result = []; + foreach ($this->_twofactor->config['settings']['registrations'] as $index => $data) { + $reg = new \StdClass; + $reg->keyHandle = $data['keyHandle']; + $reg->publicKey = $data['publicKey']; + $reg->certificate = $data['certificate']; + $reg->counter = $data['counter']; + $reg->index = $index; + $result[] = $reg; + } + return $result; + } + + /** + * Checks authentication, returns true on success + * + * @return boolean + */ + public function check() + { + $this->_provided = false; + if (!isset($_POST['u2f_authentication_response']) || !isset($_SESSION['authenticationRequest'])) { + return false; + } + $this->_provided = true; + try { + $response = json_decode($_POST['u2f_authentication_response']); + if (is_null($response)) { + return false; + } + $authentication = U2FServer::authenticate( + $_SESSION['authenticationRequest'], + $this->getRegistrations(), + $response + ); + $this->_twofactor->config['settings']['registrations'][$authentication->index]['counter'] = $authentication->counter; + $this->_twofactor->save(); + return true; + } catch (U2FException $e) { + $this->_message = $e->getMessage(); + return false; + } + } + + /** + * Loads needed javascripts into the page + * + * @return void + */ + public function loadScripts() + { + $response = Response::getInstance(); + $scripts = $response->getHeader()->getScripts(); + $scripts->addFile('vendor/u2f-api-polyfill.js'); + $scripts->addFile('u2f.js'); + } + + /** + * Renders user interface to enter two-factor authentication + * + * @return string HTML code + */ + public function render() + { + $request = U2FServer::makeAuthentication( + $this->getRegistrations(), + $this->getAppId(true) + ); + $_SESSION['authenticationRequest'] = $request; + $this->loadScripts(); + return Template::get('login/twofactor/key')->render([ + 'request' => json_encode($request), + 'is_https' => $GLOBALS['PMA_Config']->isHttps(), + ]); + } + + /** + * Renders user interface to configure two-factor authentication + * + * @return string HTML code + */ + public function setup() + { + $registrationData = U2FServer::makeRegistration( + $this->getAppId(true), + $this->getRegistrations() + ); + $_SESSION['registrationRequest'] = $registrationData['request']; + + $this->loadScripts(); + return Template::get('login/twofactor/key_configure')->render([ + 'request' => json_encode($registrationData['request']), + 'signatures' => json_encode($registrationData['signatures']), + 'is_https' => $GLOBALS['PMA_Config']->isHttps(), + ]); + } + + /** + * Performs backend configuration + * + * @return boolean + */ + public function configure() + { + $this->_provided = false; + if (! isset($_POST['u2f_registration_response']) || ! isset($_SESSION['registrationRequest'])) { + return false; + } + $this->_provided = true; + try { + $response = json_decode($_POST['u2f_registration_response']); + if (is_null($response)) { + return false; + } + $registration = U2FServer::register( + $_SESSION['registrationRequest'], $response + ); + $this->_twofactor->config['settings']['registrations'][] = [ + 'keyHandle' => $registration->getKeyHandle(), + 'publicKey' => $registration->getPublicKey(), + 'certificate' => $registration->getCertificate(), + 'counter' => $registration->getCounter(), + ]; + return true; + } catch (U2FException $e) { + $this->_message = $e->getMessage(); + return false; + } + } + + /** + * Get user visible name + * + * @return string + */ + public static function getName() + { + return __('Hardware Security Key (FIDO U2F)'); + } + + /** + * Get user visible description + * + * @return string + */ + public static function getDescription() + { + return __('Provides authentication using hardware security tokens supporting FIDO U2F.'); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Simple.php b/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Simple.php new file mode 100755 index 0000000..70d3a61 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/TwoFactor/Simple.php @@ -0,0 +1,64 @@ +render(); + } + + /** + * Get user visible name + * + * @return string + */ + public static function getName() + { + return __('Simple two-factor authentication'); + } + + /** + * Get user visible description + * + * @return string + */ + public static function getDescription() + { + return __('For testing purposes only!'); + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/TwoFactorPlugin.php b/phpMyAdmin/libraries/classes/Plugins/TwoFactorPlugin.php new file mode 100755 index 0000000..8e91b78 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/TwoFactorPlugin.php @@ -0,0 +1,170 @@ +_twofactor = $twofactor; + $this->_provided = false; + $this->_message = ''; + } + + /** + * Returns authentication error message + * + * @return string + */ + public function getError() + { + if ($this->_provided) { + if (!empty($this->_message)) { + return Message::rawError( + sprintf(__('Two-factor authentication failed: %s'), $this->_message) + )->getDisplay(); + } + return Message::rawError( + __('Two-factor authentication failed.') + )->getDisplay(); + } + return ''; + } + + /** + * Checks authentication, returns true on success + * + * @return boolean + */ + public function check() + { + return true; + } + + /** + * Renders user interface to enter two-factor authentication + * + * @return string HTML code + */ + public function render() + { + return ''; + } + + /** + * Renders user interface to configure two-factor authentication + * + * @return string HTML code + */ + public function setup() + { + return ''; + } + + /** + * Performs backend configuration + * + * @return boolean + */ + public function configure() + { + return true; + } + + /** + * Get user visible name + * + * @return string + */ + public static function getName() + { + return __('No Two-Factor'); + } + + /** + * Get user visible description + * + * @return string + */ + public static function getDescription() + { + return __('Login using password only.'); + } + + /** + * Return an applicaiton ID + * + * Either hostname or hostname with scheme. + * + * @param boolean $return_url Whether to generate URL + * + * @return string + */ + public function getAppId($return_url) + { + global $PMA_Config; + + $url = $PMA_Config->get('PmaAbsoluteUri'); + $parsed = []; + if (!empty($url)) { + $parsed = parse_url($url); + } + if (empty($parsed['scheme'])) { + $parsed['scheme'] = $PMA_Config->isHttps() ? 'https' : 'http'; + } + if (empty($parsed['host'])) { + $parsed['host'] = Core::getenv('HTTP_HOST'); + } + if ($return_url) { + return $parsed['scheme'] . '://' . $parsed['host'] . (!empty($parsed['port']) ? ':' . $parsed['port'] : ''); + } else { + return $parsed['host']; + } + } +} diff --git a/phpMyAdmin/libraries/classes/Plugins/UploadInterface.php b/phpMyAdmin/libraries/classes/Plugins/UploadInterface.php new file mode 100755 index 0000000..28bf9d0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Plugins/UploadInterface.php @@ -0,0 +1,33 @@ +upload plugins + * + * @package PhpMyAdmin + */ +namespace PhpMyAdmin\Plugins; + +/** + * Provides a common interface that will have to implemented by all of the + * import->upload plugins. + * + * @package PhpMyAdmin + */ +interface UploadInterface +{ + /** + * Gets the specific upload ID Key + * + * @return string ID Key + */ + public static function getIdKey(); + + /** + * Returns upload status. + * + * @param string $id upload id + * + * @return array|null + */ + public static function getUploadStatus($id); +} diff --git a/phpMyAdmin/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php b/phpMyAdmin/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php new file mode 100755 index 0000000..d976da5 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Properties/Options/Groups/OptionsPropertyMainGroup.php @@ -0,0 +1,33 @@ +_subgroupHeader; + } + + /** + * Sets the subgroup header + * + * @param \PhpMyAdmin\Properties\PropertyItem $subgroupHeader subgroup header + * + * @return void + */ + public function setSubgroupHeader($subgroupHeader) + { + $this->_subgroupHeader = $subgroupHeader; + } +} diff --git a/phpMyAdmin/libraries/classes/Properties/Options/Items/BoolPropertyItem.php b/phpMyAdmin/libraries/classes/Properties/Options/Items/BoolPropertyItem.php new file mode 100755 index 0000000..2a45cf0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Properties/Options/Items/BoolPropertyItem.php @@ -0,0 +1,33 @@ +getProperties() == null + && in_array($property, $this->getProperties(), true) + ) { + return; + } + $this->_properties [] = $property; + } + + /** + * Removes a property from the group of properties + * + * @param OptionsPropertyItem $property the property instance to be removed + * from the group + * + * @return void + */ + public function removeProperty($property) + { + $this->_properties = array_diff( + $this->getProperties(), + array($property) + ); + } + + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the instance of the class + * + * @return array + */ + public function getGroup() + { + return $this; + } + + /** + * Gets the group of properties + * + * @return array + */ + public function getProperties() + { + return $this->_properties; + } + + /** + * Gets the number of properties + * + * @return int + */ + public function getNrOfProperties() + { + if (is_null($this->_properties)) { + return 0; + } + return count($this->_properties); + } + + /** + * Countable interface implementation. + * + * @return int + */ + public function count() { + return $this->getNrOfProperties(); + } +} diff --git a/phpMyAdmin/libraries/classes/Properties/Options/OptionsPropertyItem.php b/phpMyAdmin/libraries/classes/Properties/Options/OptionsPropertyItem.php new file mode 100755 index 0000000..2e4d6ac --- /dev/null +++ b/phpMyAdmin/libraries/classes/Properties/Options/OptionsPropertyItem.php @@ -0,0 +1,134 @@ +_name = $name; + } + if ($text) { + $this->_text = $text; + } + } + + /* ~~~~~~~~~~~~~~~~~~~~ Getters and Setters ~~~~~~~~~~~~~~~~~~~~ */ + + /** + * Gets the name + * + * @return string + */ + public function getName() + { + return $this->_name; + } + + /** + * Sets the name + * + * @param string $name name + * + * @return void + */ + public function setName($name) + { + $this->_name = $name; + } + + /** + * Gets the text + * + * @return string + */ + public function getText() + { + return $this->_text; + } + + /** + * Sets the text + * + * @param string $text text + * + * @return void + */ + public function setText($text) + { + $this->_text = $text; + } + + /** + * Gets the force parameter + * + * @return string + */ + public function getForce() + { + return $this->_force; + } + + /** + * Sets the force parameter + * + * @param string $force force parameter + * + * @return void + */ + public function setForce($force) + { + $this->_force = $force; + } + + /** + * Returns the property type ( either "options", or "plugin" ). + * + * @return string + */ + public function getPropertyType() + { + return "options"; + } +} diff --git a/phpMyAdmin/libraries/classes/Properties/Options/OptionsPropertyOneItem.php b/phpMyAdmin/libraries/classes/Properties/Options/OptionsPropertyOneItem.php new file mode 100755 index 0000000..d44a7fe --- /dev/null +++ b/phpMyAdmin/libraries/classes/Properties/Options/OptionsPropertyOneItem.php @@ -0,0 +1,159 @@ +_force_one; + } + + /** + * Sets the force parameter + * + * @param bool $force force parameter + * + * @return void + */ + public function setForce($force) + { + $this->_force_one = $force; + } + + /** + * Gets the values + * + * @return string + */ + public function getValues() + { + return $this->_values; + } + + /** + * Sets the values + * + * @param array $values values + * + * @return void + */ + public function setValues(array $values) + { + $this->_values = $values; + } + + /** + * Gets MySQL documentation pointer + * + * @return array + */ + public function getDoc() + { + return $this->_doc; + } + + /** + * Sets the doc + * + * @param string $doc MySQL documentation pointer + * + * @return void + */ + public function setDoc($doc) + { + $this->_doc = $doc; + } + + /** + * Gets the length + * + * @return int + */ + public function getLen() + { + return $this->_len; + } + + /** + * Sets the length + * + * @param int $len length + * + * @return void + */ + public function setLen($len) + { + $this->_len = $len; + } + + /** + * Gets the size + * + * @return int + */ + public function getSize() + { + return $this->_size; + } + + /** + * Sets the size + * + * @param int $size size + * + * @return void + */ + public function setSize($size) + { + $this->_size = $size; + } +} diff --git a/phpMyAdmin/libraries/classes/Properties/Plugins/ExportPluginProperties.php b/phpMyAdmin/libraries/classes/Properties/Plugins/ExportPluginProperties.php new file mode 100755 index 0000000..a5a19da --- /dev/null +++ b/phpMyAdmin/libraries/classes/Properties/Plugins/ExportPluginProperties.php @@ -0,0 +1,62 @@ +_forceFile; + } + + /** + * Sets the force file parameter + * + * @param bool $forceFile the force file parameter + * + * @return void + */ + public function setForceFile($forceFile) + { + $this->_forceFile = $forceFile; + } +} diff --git a/phpMyAdmin/libraries/classes/Properties/Plugins/ImportPluginProperties.php b/phpMyAdmin/libraries/classes/Properties/Plugins/ImportPluginProperties.php new file mode 100755 index 0000000..bbcdd59 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Properties/Plugins/ImportPluginProperties.php @@ -0,0 +1,31 @@ +_text; + } + + /** + * Sets the text + * + * @param string $text text + * + * @return void + */ + public function setText($text) + { + $this->_text = $text; + } + + /** + * Gets the extension + * + * @return string + */ + public function getExtension() + { + return $this->_extension; + } + + /** + * Sets the extension + * + * @param string $extension extension + * + * @return void + */ + public function setExtension($extension) + { + $this->_extension = $extension; + } + + /** + * Gets the options + * + * @return OptionsPropertyRootGroup + */ + public function getOptions() + { + return $this->_options; + } + + /** + * Sets the options + * + * @param OptionsPropertyRootGroup $options options + * + * @return void + */ + public function setOptions($options) + { + $this->_options = $options; + } + + /** + * Gets the options text + * + * @return string + */ + public function getOptionsText() + { + return $this->_optionsText; + } + + /** + * Sets the options text + * + * @param string $optionsText optionsText + * + * @return void + */ + public function setOptionsText($optionsText) + { + $this->_optionsText = $optionsText; + } + + /** + * Gets the MIME type + * + * @return string + */ + public function getMimeType() + { + return $this->_mimeType; + } + + /** + * Sets the MIME type + * + * @param string $mimeType MIME type + * + * @return void + */ + public function setMimeType($mimeType) + { + $this->_mimeType = $mimeType; + } + + /** + * Returns the property type ( either "options", or "plugin" ). + * + * @return string + */ + public function getPropertyType() + { + return "plugin"; + } +} diff --git a/phpMyAdmin/libraries/classes/Properties/Plugins/SchemaPluginProperties.php b/phpMyAdmin/libraries/classes/Properties/Plugins/SchemaPluginProperties.php new file mode 100755 index 0000000..e363533 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Properties/Plugins/SchemaPluginProperties.php @@ -0,0 +1,44 @@ +relation = new Relation(); + $this->_tableType = $type; + $server_id = $GLOBALS['server']; + if (! isset($_SESSION['tmpval'][$this->_tableType . '_tables'][$server_id]) + ) { + $_SESSION['tmpval'][$this->_tableType . '_tables'][$server_id] + = $this->_getPmaTable() ? $this->getFromDb() : array(); + } + $this->_tables + =& $_SESSION['tmpval'][$this->_tableType . '_tables'][$server_id]; + } + + /** + * Returns class instance. + * + * @param string $type the table type + * + * @return RecentFavoriteTable + */ + public static function getInstance($type) + { + if (! array_key_exists($type, self::$_instances)) { + self::$_instances[$type] = new RecentFavoriteTable($type); + } + return self::$_instances[$type]; + } + + /** + * Returns the recent/favorite tables array + * + * @return array + */ + public function getTables() + { + return $this->_tables; + } + + /** + * Returns recently used tables or favorite from phpMyAdmin database. + * + * @return array + */ + public function getFromDb() + { + // Read from phpMyAdmin database, if recent tables is not in session + $sql_query + = " SELECT `tables` FROM " . $this->_getPmaTable() . + " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'"; + + $return = array(); + $result = $this->relation->queryAsControlUser($sql_query, false); + if ($result) { + $row = $GLOBALS['dbi']->fetchArray($result); + if (isset($row[0])) { + $return = json_decode($row[0], true); + } + } + return $return; + } + + /** + * Save recent/favorite tables into phpMyAdmin database. + * + * @return true|Message + */ + public function saveToDb() + { + $username = $GLOBALS['cfg']['Server']['user']; + $sql_query + = " REPLACE INTO " . $this->_getPmaTable() . " (`username`, `tables`)" . + " VALUES ('" . $GLOBALS['dbi']->escapeString($username) . "', '" + . $GLOBALS['dbi']->escapeString( + json_encode($this->_tables) + ) . "')"; + + $success = $GLOBALS['dbi']->tryQuery($sql_query, DatabaseInterface::CONNECT_CONTROL); + + if (! $success) { + $error_msg = ''; + switch ($this->_tableType) { + case 'recent': + $error_msg = __('Could not save recent table!'); + break; + + case 'favorite': + $error_msg = __('Could not save favorite table!'); + break; + } + $message = Message::error($error_msg); + $message->addMessage( + Message::rawError( + $GLOBALS['dbi']->getError(DatabaseInterface::CONNECT_CONTROL) + ), + '

    ' + ); + return $message; + } + return true; + } + + /** + * Trim recent.favorite table according to the + * NumRecentTables/NumFavoriteTables configuration. + * + * @return boolean True if trimming occurred + */ + public function trim() + { + $max = max( + $GLOBALS['cfg']['Num' . ucfirst($this->_tableType) . 'Tables'], 0 + ); + $trimming_occurred = count($this->_tables) > $max; + while (count($this->_tables) > $max) { + array_pop($this->_tables); + } + return $trimming_occurred; + } + + /** + * Return HTML ul. + * + * @return string + */ + public function getHtmlList() + { + $html = ''; + if (count($this->_tables)) { + if ($this->_tableType == 'recent') { + foreach ($this->_tables as $table) { + $html .= '
  • '; + } + } else { + foreach ($this->_tables as $table) { + $html .= ''; + } + } + } else { + $html .= ''; + } + return $html; + } + + /** + * Return HTML. + * + * @return string + */ + public function getHtml() + { + $html = '
    '; + if ($this->_tableType == 'recent') { + $html .= '' + . __('Recent') . '
      '; + } else { + $html .= '' + . __('Favorites') . '
        '; + } + $html .= $this->getHtmlList(); + $html .= '
    '; + return $html; + } + + /** + * Add recently used or favorite tables. + * + * @param string $db database name where the table is located + * @param string $table table name + * + * @return true|Message True if success, Message if not + */ + public function add($db, $table) + { + // If table does not exist, do not add._getPmaTable() + if (! $GLOBALS['dbi']->getColumns($db, $table)) { + return true; + } + + $table_arr = array(); + $table_arr['db'] = $db; + $table_arr['table'] = $table; + + // add only if this is new table + if (! isset($this->_tables[0]) || $this->_tables[0] != $table_arr) { + array_unshift($this->_tables, $table_arr); + $this->_tables = array_merge(array_unique($this->_tables, SORT_REGULAR)); + $this->trim(); + if ($this->_getPmaTable()) { + return $this->saveToDb(); + } + } + return true; + } + + /** + * Removes recent/favorite tables that don't exist. + * + * @param string $db database + * @param string $table table + * + * @return boolean|Message True if invalid and removed, False if not invalid, + * Message if error while removing + */ + public function removeIfInvalid($db, $table) + { + foreach ($this->_tables as $tbl) { + if ($tbl['db'] == $db && $tbl['table'] == $table) { + // TODO Figure out a better way to find the existence of a table + if (! $GLOBALS['dbi']->getColumns($tbl['db'], $tbl['table'])) { + return $this->remove($tbl['db'], $tbl['table']); + } + } + } + return false; + } + + /** + * Remove favorite tables. + * + * @param string $db database name where the table is located + * @param string $table table name + * + * @return true|Message True if success, Message if not + */ + public function remove($db, $table) + { + $table_arr = array(); + $table_arr['db'] = $db; + $table_arr['table'] = $table; + foreach ($this->_tables as $key => $value) { + if ($value['db'] == $db && $value['table'] == $table) { + unset($this->_tables[$key]); + } + } + if ($this->_getPmaTable()) { + return $this->saveToDb(); + } + return true; + } + + /** + * Generate Html for sync Favorite tables anchor. (from localStorage to pmadb) + * + * @return string + */ + public function getHtmlSyncFavoriteTables() + { + $retval = ''; + $server_id = $GLOBALS['server']; + if ($server_id == 0) { + return ''; + } + $cfgRelation = $this->relation->getRelationsParam(); + // Not to show this once list is synchronized. + if ($cfgRelation['favoritework'] && ! isset($_SESSION['tmpval']['favorites_synced'][$server_id])) { + $params = array('ajax_request' => true, 'favorite_table' => true, + 'sync_favorite_tables' => true); + $url = 'db_structure.php' . Url::getCommon($params); + $retval = ''; + } + return $retval; + } + + /** + * Generate Html to update recent tables. + * + * @return string html + */ + public static function getHtmlUpdateRecentTables() + { + $params = array('ajax_request' => true, 'recent_table' => true); + $url = 'index.php' . Url::getCommon($params); + $retval = ''; + return $retval; + } + + /** + * Return the name of the configuration storage table + * + * @return string|null pma table name + */ + private function _getPmaTable() + { + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['recentwork']) { + return null; + } + + if (! empty($cfgRelation['db']) + && ! empty($cfgRelation[$this->_tableType]) + ) { + return Util::backquote($cfgRelation['db']) . "." + . Util::backquote($cfgRelation[$this->_tableType]); + } + return null; + } +} diff --git a/phpMyAdmin/libraries/classes/Relation.php b/phpMyAdmin/libraries/classes/Relation.php new file mode 100755 index 0000000..ff622b1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Relation.php @@ -0,0 +1,2170 @@ +query( + $sql, + DatabaseInterface::CONNECT_CONTROL, + $options, + $cache_affected_rows + ); + } else { + $result = @$GLOBALS['dbi']->tryQuery( + $sql, + DatabaseInterface::CONNECT_CONTROL, + $options, + $cache_affected_rows + ); + } // end if... else... + + if ($result) { + return $result; + } + + return false; + } + + /** + * Returns current relation parameters + * + * @return array $cfgRelation + */ + public function getRelationsParam() + { + if (empty($_SESSION['relation'][$GLOBALS['server']]) + || (empty($_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'])) + || $_SESSION['relation'][$GLOBALS['server']]['PMA_VERSION'] != PMA_VERSION + ) { + $_SESSION['relation'][$GLOBALS['server']] = $this->checkRelationsParam(); + } + + // just for BC but needs to be before getRelationsParamDiagnostic() + // which uses it + $GLOBALS['cfgRelation'] = $_SESSION['relation'][$GLOBALS['server']]; + + return $_SESSION['relation'][$GLOBALS['server']]; + } + + /** + * prints out diagnostic info for pma relation feature + * + * @param array $cfgRelation Relation configuration + * + * @return string + */ + public function getRelationsParamDiagnostic(array $cfgRelation) + { + $retval = '
    '; + + $messages = array(); + $messages['error'] = '' + . __('not OK') + . ''; + + $messages['ok'] = '' + . _pgettext('Correctly working', 'OK') + . ''; + + $messages['enabled'] = '' . __('Enabled') . ''; + $messages['disabled'] = '' . __('Disabled') . ''; + + if (strlen($cfgRelation['db']) == 0) { + $retval .= __('Configuration of pmadb鈥�') . ' ' + . $messages['error'] + . Util::showDocu('setup', 'linked-tables') + . '
    ' . "\n" + . __('General relation features') + . ' ' . __('Disabled') + . '' . "\n"; + if ($GLOBALS['cfg']['ZeroConf']) { + if (strlen($GLOBALS['db']) == 0) { + $retval .= $this->getHtmlFixPmaTables(true, true); + } else { + $retval .= $this->getHtmlFixPmaTables(true); + } + } + } else { + $retval .= '' . "\n"; + + if (! $cfgRelation['allworks'] + && $GLOBALS['cfg']['ZeroConf'] + // Avoid showing a "Create missing tables" link if it's a + // problem of missing definition + && $this->arePmadbTablesDefined() + ) { + $retval .= $this->getHtmlFixPmaTables(false); + $retval .= '
    '; + } + + $retval .= $this->getDiagMessageForParameter( + 'pmadb', + $cfgRelation['db'], + $messages, + 'pmadb' + ); + $retval .= $this->getDiagMessageForParameter( + 'relation', + isset($cfgRelation['relation']), + $messages, + 'relation' + ); + $retval .= $this->getDiagMessageForFeature( + __('General relation features'), + 'relwork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'table_info', + isset($cfgRelation['table_info']), + $messages, + 'table_info' + ); + $retval .= $this->getDiagMessageForFeature( + __('Display Features'), + 'displaywork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'table_coords', + isset($cfgRelation['table_coords']), + $messages, + 'table_coords' + ); + $retval .= $this->getDiagMessageForParameter( + 'pdf_pages', + isset($cfgRelation['pdf_pages']), + $messages, + 'pdf_pages' + ); + $retval .= $this->getDiagMessageForFeature( + __('Designer and creation of PDFs'), + 'pdfwork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'column_info', + isset($cfgRelation['column_info']), + $messages, + 'column_info' + ); + $retval .= $this->getDiagMessageForFeature( + __('Displaying Column Comments'), + 'commwork', + $messages, + false + ); + $retval .= $this->getDiagMessageForFeature( + __('Browser transformation'), + 'mimework', + $messages + ); + if ($cfgRelation['commwork'] && ! $cfgRelation['mimework']) { + $retval .= ''; + } + $retval .= $this->getDiagMessageForParameter( + 'bookmarktable', + isset($cfgRelation['bookmark']), + $messages, + 'bookmark' + ); + $retval .= $this->getDiagMessageForFeature( + __('Bookmarked SQL query'), + 'bookmarkwork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'history', + isset($cfgRelation['history']), + $messages, + 'history' + ); + $retval .= $this->getDiagMessageForFeature( + __('SQL history'), + 'historywork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'recent', + isset($cfgRelation['recent']), + $messages, + 'recent' + ); + $retval .= $this->getDiagMessageForFeature( + __('Persistent recently used tables'), + 'recentwork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'favorite', + isset($cfgRelation['favorite']), + $messages, + 'favorite' + ); + $retval .= $this->getDiagMessageForFeature( + __('Persistent favorite tables'), + 'favoritework', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'table_uiprefs', + isset($cfgRelation['table_uiprefs']), + $messages, + 'table_uiprefs' + ); + $retval .= $this->getDiagMessageForFeature( + __('Persistent tables\' UI preferences'), + 'uiprefswork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'tracking', + isset($cfgRelation['tracking']), + $messages, + 'tracking' + ); + $retval .= $this->getDiagMessageForFeature( + __('Tracking'), + 'trackingwork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'userconfig', + isset($cfgRelation['userconfig']), + $messages, + 'userconfig' + ); + $retval .= $this->getDiagMessageForFeature( + __('User preferences'), + 'userconfigwork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'users', + isset($cfgRelation['users']), + $messages, + 'users' + ); + $retval .= $this->getDiagMessageForParameter( + 'usergroups', + isset($cfgRelation['usergroups']), + $messages, + 'usergroups' + ); + $retval .= $this->getDiagMessageForFeature( + __('Configurable menus'), + 'menuswork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'navigationhiding', + isset($cfgRelation['navigationhiding']), + $messages, + 'navigationhiding' + ); + $retval .= $this->getDiagMessageForFeature( + __('Hide/show navigation items'), + 'navwork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'savedsearches', + isset($cfgRelation['savedsearches']), + $messages, + 'savedsearches' + ); + $retval .= $this->getDiagMessageForFeature( + __('Saving Query-By-Example searches'), + 'savedsearcheswork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'central_columns', + isset($cfgRelation['central_columns']), + $messages, + 'central_columns' + ); + $retval .= $this->getDiagMessageForFeature( + __('Managing Central list of columns'), + 'centralcolumnswork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'designer_settings', + isset($cfgRelation['designer_settings']), + $messages, + 'designer_settings' + ); + $retval .= $this->getDiagMessageForFeature( + __('Remembering Designer Settings'), + 'designersettingswork', + $messages + ); + $retval .= $this->getDiagMessageForParameter( + 'export_templates', + isset($cfgRelation['export_templates']), + $messages, + 'export_templates' + ); + $retval .= $this->getDiagMessageForFeature( + __('Saving export templates'), + 'exporttemplateswork', + $messages + ); + $retval .= '
    '; + $retval .= __( + 'Please see the documentation on how to' + . ' update your column_info table.' + ); + $retval .= Util::showDocu( + 'config', + 'cfg_Servers_column_info' + ); + $retval .= '
    ' . "\n"; + + if (! $cfgRelation['allworks']) { + + $retval .= '

    ' . __('Quick steps to set up advanced features:') + . '

    '; + + $items = array(); + $items[] = sprintf( + __( + 'Create the needed tables with the ' + . '%screate_tables.sql.' + ), + htmlspecialchars(SQL_DIR) + ) . ' ' . Util::showDocu('setup', 'linked-tables'); + $items[] = __('Create a pma user and give access to these tables.') . ' ' + . Util::showDocu('config', 'cfg_Servers_controluser'); + $items[] = __( + 'Enable advanced features in configuration file ' + . '(config.inc.php), for example by ' + . 'starting from config.sample.inc.php.' + ) . ' ' . Util::showDocu('setup', 'quick-install'); + $items[] = __( + 'Re-login to phpMyAdmin to load the updated configuration file.' + ); + + $retval .= Template::get('list/unordered')->render( + array('items' => $items,) + ); + } + } + + return $retval; + } + + /** + * prints out one diagnostic message for a feature + * + * @param string $feature_name feature name in a message string + * @param string $relation_parameter the $GLOBALS['cfgRelation'] parameter to check + * @param array $messages utility messages + * @param boolean $skip_line whether to skip a line after the message + * + * @return string + */ + public function getDiagMessageForFeature($feature_name, + $relation_parameter, array $messages, $skip_line = true + ) { + $retval = ' ' . $feature_name . ': '; + if (isset($GLOBALS['cfgRelation'][$relation_parameter]) + && $GLOBALS['cfgRelation'][$relation_parameter] + ) { + $retval .= $messages['enabled']; + } else { + $retval .= $messages['disabled']; + } + $retval .= ''; + if ($skip_line) { + $retval .= ' '; + } + return $retval; + } + + /** + * prints out one diagnostic message for a configuration parameter + * + * @param string $parameter config parameter name to display + * @param boolean $relationParameterSet whether this parameter is set + * @param array $messages utility messages + * @param string $docAnchor anchor in documentation + * + * @return string + */ + public function getDiagMessageForParameter($parameter, + $relationParameterSet, array $messages, $docAnchor + ) { + $retval = ''; + $retval .= '$cfg[\'Servers\'][$i][\'' . $parameter . '\'] ... '; + $retval .= ''; + if ($relationParameterSet) { + $retval .= $messages['ok']; + } else { + $retval .= sprintf( + $messages['error'], + Util::getDocuLink('config', 'cfg_Servers_' . $docAnchor) + ); + } + $retval .= '' . "\n"; + return $retval; + } + + /** + * Defines the relation parameters for the current user + * just a copy of the functions used for relations ;-) + * but added some stuff to check what will work + * + * @access protected + * @return array the relation parameters for the current user + */ + public function checkRelationsParam() + { + $cfgRelation = array(); + $cfgRelation['PMA_VERSION'] = PMA_VERSION; + + $workToTable = array( + 'relwork' => 'relation', + 'displaywork' => array('relation', 'table_info'), + 'bookmarkwork' => 'bookmarktable', + 'pdfwork' => array('table_coords', 'pdf_pages'), + 'commwork' => 'column_info', + 'mimework' => 'column_info', + 'historywork' => 'history', + 'recentwork' => 'recent', + 'favoritework' => 'favorite', + 'uiprefswork' => 'table_uiprefs', + 'trackingwork' => 'tracking', + 'userconfigwork' => 'userconfig', + 'menuswork' => array('users', 'usergroups'), + 'navwork' => 'navigationhiding', + 'savedsearcheswork' => 'savedsearches', + 'centralcolumnswork' => 'central_columns', + 'designersettingswork' => 'designer_settings', + 'exporttemplateswork' => 'export_templates', + ); + + foreach ($workToTable as $work => $table) { + $cfgRelation[$work] = false; + } + $cfgRelation['allworks'] = false; + $cfgRelation['user'] = null; + $cfgRelation['db'] = null; + + if ($GLOBALS['server'] == 0 + || empty($GLOBALS['cfg']['Server']['pmadb']) + || ! $GLOBALS['dbi']->selectDb( + $GLOBALS['cfg']['Server']['pmadb'], DatabaseInterface::CONNECT_CONTROL + ) + ) { + // No server selected -> no bookmark table + // we return the array with the falses in it, + // to avoid some 'Uninitialized string offset' errors later + $GLOBALS['cfg']['Server']['pmadb'] = false; + return $cfgRelation; + } + + $cfgRelation['user'] = $GLOBALS['cfg']['Server']['user']; + $cfgRelation['db'] = $GLOBALS['cfg']['Server']['pmadb']; + + // Now I just check if all tables that i need are present so I can for + // example enable relations but not pdf... + // I was thinking of checking if they have all required columns but I + // fear it might be too slow + + $tab_query = 'SHOW TABLES FROM ' + . Util::backquote( + $GLOBALS['cfg']['Server']['pmadb'] + ); + $tab_rs = $this->queryAsControlUser( + $tab_query, false, DatabaseInterface::QUERY_STORE + ); + + if (! $tab_rs) { + // query failed ... ? + //$GLOBALS['cfg']['Server']['pmadb'] = false; + return $cfgRelation; + } + + while ($curr_table = @$GLOBALS['dbi']->fetchRow($tab_rs)) { + if ($curr_table[0] == $GLOBALS['cfg']['Server']['bookmarktable']) { + $cfgRelation['bookmark'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['relation']) { + $cfgRelation['relation'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['table_info']) { + $cfgRelation['table_info'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['table_coords']) { + $cfgRelation['table_coords'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['column_info']) { + $cfgRelation['column_info'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['pdf_pages']) { + $cfgRelation['pdf_pages'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['history']) { + $cfgRelation['history'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['recent']) { + $cfgRelation['recent'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['favorite']) { + $cfgRelation['favorite'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['table_uiprefs']) { + $cfgRelation['table_uiprefs'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['tracking']) { + $cfgRelation['tracking'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['userconfig']) { + $cfgRelation['userconfig'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['users']) { + $cfgRelation['users'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['usergroups']) { + $cfgRelation['usergroups'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['navigationhiding']) { + $cfgRelation['navigationhiding'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['savedsearches']) { + $cfgRelation['savedsearches'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['central_columns']) { + $cfgRelation['central_columns'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['designer_settings']) { + $cfgRelation['designer_settings'] = $curr_table[0]; + } elseif ($curr_table[0] == $GLOBALS['cfg']['Server']['export_templates']) { + $cfgRelation['export_templates'] = $curr_table[0]; + } + } // end while + $GLOBALS['dbi']->freeResult($tab_rs); + + if (isset($cfgRelation['relation'])) { + if ($this->canAccessStorageTable($cfgRelation['relation'])) { + $cfgRelation['relwork'] = true; + } + } + + if (isset($cfgRelation['relation']) && isset($cfgRelation['table_info'])) { + if ($this->canAccessStorageTable($cfgRelation['table_info'])) { + $cfgRelation['displaywork'] = true; + } + } + + if (isset($cfgRelation['table_coords']) && isset($cfgRelation['pdf_pages'])) { + if ($this->canAccessStorageTable($cfgRelation['table_coords'])) { + if ($this->canAccessStorageTable($cfgRelation['pdf_pages'])) { + $cfgRelation['pdfwork'] = true; + } + } + } + + if (isset($cfgRelation['column_info'])) { + if ($this->canAccessStorageTable($cfgRelation['column_info'])) { + $cfgRelation['commwork'] = true; + // phpMyAdmin 4.3+ + // Check for input transformations upgrade. + $cfgRelation['mimework'] = $this->tryUpgradeTransformations(); + } + } + + if (isset($cfgRelation['history'])) { + if ($this->canAccessStorageTable($cfgRelation['history'])) { + $cfgRelation['historywork'] = true; + } + } + + if (isset($cfgRelation['recent'])) { + if ($this->canAccessStorageTable($cfgRelation['recent'])) { + $cfgRelation['recentwork'] = true; + } + } + + if (isset($cfgRelation['favorite'])) { + if ($this->canAccessStorageTable($cfgRelation['favorite'])) { + $cfgRelation['favoritework'] = true; + } + } + + if (isset($cfgRelation['table_uiprefs'])) { + if ($this->canAccessStorageTable($cfgRelation['table_uiprefs'])) { + $cfgRelation['uiprefswork'] = true; + } + } + + if (isset($cfgRelation['tracking'])) { + if ($this->canAccessStorageTable($cfgRelation['tracking'])) { + $cfgRelation['trackingwork'] = true; + } + } + + if (isset($cfgRelation['userconfig'])) { + if ($this->canAccessStorageTable($cfgRelation['userconfig'])) { + $cfgRelation['userconfigwork'] = true; + } + } + + if (isset($cfgRelation['bookmark'])) { + if ($this->canAccessStorageTable($cfgRelation['bookmark'])) { + $cfgRelation['bookmarkwork'] = true; + } + } + + if (isset($cfgRelation['users']) && isset($cfgRelation['usergroups'])) { + if ($this->canAccessStorageTable($cfgRelation['users'])) { + if ($this->canAccessStorageTable($cfgRelation['usergroups'])) { + $cfgRelation['menuswork'] = true; + } + } + } + + if (isset($cfgRelation['navigationhiding'])) { + if ($this->canAccessStorageTable($cfgRelation['navigationhiding'])) { + $cfgRelation['navwork'] = true; + } + } + + if (isset($cfgRelation['savedsearches'])) { + if ($this->canAccessStorageTable($cfgRelation['savedsearches'])) { + $cfgRelation['savedsearcheswork'] = true; + } + } + + if (isset($cfgRelation['central_columns'])) { + if ($this->canAccessStorageTable($cfgRelation['central_columns'])) { + $cfgRelation['centralcolumnswork'] = true; + } + } + + if (isset($cfgRelation['designer_settings'])) { + if ($this->canAccessStorageTable($cfgRelation['designer_settings'])) { + $cfgRelation['designersettingswork'] = true; + } + } + + if (isset($cfgRelation['export_templates'])) { + if ($this->canAccessStorageTable($cfgRelation['export_templates'])) { + $cfgRelation['exporttemplateswork'] = true; + } + } + + $allWorks = true; + foreach ($workToTable as $work => $table) { + if (! $cfgRelation[$work]) { + if (is_string($table)) { + if (isset($GLOBALS['cfg']['Server'][$table]) + && $GLOBALS['cfg']['Server'][$table] !== false + ) { + $allWorks = false; + break; + } + } elseif (is_array($table)) { + $oneNull = false; + foreach ($table as $t) { + if (isset($GLOBALS['cfg']['Server'][$t]) + && $GLOBALS['cfg']['Server'][$t] === false + ) { + $oneNull = true; + break; + } + } + if (! $oneNull) { + $allWorks = false; + break; + } + } + } + } + $cfgRelation['allworks'] = $allWorks; + + return $cfgRelation; + } + + /** + * Check if the table is accessible + * + * @param string $tableDbName The table or table.db + * @return boolean The table is accessible + */ + public function canAccessStorageTable($tableDbName) { + $result = $this->queryAsControlUser( + 'SELECT NULL FROM ' . $tableDbName . ' LIMIT 0', + false, + DatabaseInterface::QUERY_STORE + ); + return $result !== false; + } + + /** + * Check whether column_info table input transformation + * upgrade is required and try to upgrade silently + * + * @return bool false if upgrade failed + * + * @access public + */ + public function tryUpgradeTransformations() + { + // From 4.3, new input oriented transformation feature was introduced. + // Check whether column_info table has input transformation columns + $new_cols = array( + "input_transformation", + "input_transformation_options" + ); + $query = 'SHOW COLUMNS FROM ' + . Util::backquote($GLOBALS['cfg']['Server']['pmadb']) + . '.' . Util::backquote( + $GLOBALS['cfg']['Server']['column_info'] + ) + . ' WHERE Field IN (\'' . implode('\', \'', $new_cols) . '\')'; + $result = $this->queryAsControlUser( + $query, false, DatabaseInterface::QUERY_STORE + ); + if ($result) { + $rows = $GLOBALS['dbi']->numRows($result); + $GLOBALS['dbi']->freeResult($result); + // input transformations are present + // no need to upgrade + if ($rows === 2) { + return true; + // try silent upgrade without disturbing the user + } + + // read upgrade query file + $query = @file_get_contents(SQL_DIR . 'upgrade_column_info_4_3_0+.sql'); + // replace database name from query to with set in config.inc.php + $query = str_replace( + '`phpmyadmin`', + Util::backquote($GLOBALS['cfg']['Server']['pmadb']), + $query + ); + // replace pma__column_info table name from query + // to with set in config.inc.php + $query = str_replace( + '`pma__column_info`', + Util::backquote( + $GLOBALS['cfg']['Server']['column_info'] + ), + $query + ); + $GLOBALS['dbi']->tryMultiQuery($query, DatabaseInterface::CONNECT_CONTROL); + // skips result sets of query as we are not interested in it + while ($GLOBALS['dbi']->moreResults(DatabaseInterface::CONNECT_CONTROL) + && $GLOBALS['dbi']->nextResult(DatabaseInterface::CONNECT_CONTROL) + ) { + } + $error = $GLOBALS['dbi']->getError(DatabaseInterface::CONNECT_CONTROL); + // return true if no error exists otherwise false + return empty($error); + } + // some failure, either in upgrading or something else + // make some noise, time to wake up user. + return false; + } + + /** + * Gets all Relations to foreign tables for a given table or + * optionally a given column in a table + * + * @param string $db the name of the db to check for + * @param string $table the name of the table to check for + * @param string $column the name of the column to check for + * @param string $source the source for foreign key information + * + * @return array db,table,column + * + * @access public + */ + public function getForeigners($db, $table, $column = '', $source = 'both') + { + $cfgRelation = $this->getRelationsParam(); + $foreign = array(); + + if ($cfgRelation['relwork'] && ($source == 'both' || $source == 'internal')) { + $rel_query = ' + SELECT `master_field`, + `foreign_db`, + `foreign_table`, + `foreign_field` + FROM ' . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['relation']) . ' + WHERE `master_db` = \'' . $GLOBALS['dbi']->escapeString($db) . '\' + AND `master_table` = \'' . $GLOBALS['dbi']->escapeString($table) + . '\' '; + if (strlen($column) > 0) { + $rel_query .= ' AND `master_field` = ' + . '\'' . $GLOBALS['dbi']->escapeString($column) . '\''; + } + $foreign = $GLOBALS['dbi']->fetchResult( + $rel_query, 'master_field', null, DatabaseInterface::CONNECT_CONTROL + ); + } + + if (($source == 'both' || $source == 'foreign') && strlen($table) > 0) { + $tableObj = new Table($table, $db); + $show_create_table = $tableObj->showCreate(); + if ($show_create_table) { + $parser = new Parser($show_create_table); + /** + * @var \PhpMyAdmin\SqlParser\Statements\CreateStatement $stmt + */ + $stmt = $parser->statements[0]; + $foreign['foreign_keys_data'] = TableUtils::getForeignKeys( + $stmt + ); + } + } + + /** + * Emulating relations for some information_schema tables + */ + $isInformationSchema = mb_strtolower($db) == 'information_schema'; + $isMysql = mb_strtolower($db) == 'mysql'; + if (($isInformationSchema || $isMysql) + && ($source == 'internal' || $source == 'both') + ) { + if ($isInformationSchema) { + $relations_key = 'information_schema_relations'; + include_once './libraries/information_schema_relations.inc.php'; + } else { + $relations_key = 'mysql_relations'; + include_once './libraries/mysql_relations.inc.php'; + } + if (isset($GLOBALS[$relations_key][$table])) { + foreach ($GLOBALS[$relations_key][$table] as $field => $relations) { + if ((strlen($column) === 0 || $column == $field) + && (! isset($foreign[$field]) + || strlen($foreign[$field]) === 0) + ) { + $foreign[$field] = $relations; + } + } + } + } + + return $foreign; + } + + /** + * Gets the display field of a table + * + * @param string $db the name of the db to check for + * @param string $table the name of the table to check for + * + * @return string field name + * + * @access public + */ + public function getDisplayField($db, $table) + { + $cfgRelation = $this->getRelationsParam(); + + /** + * Try to fetch the display field from DB. + */ + if ($cfgRelation['displaywork']) { + $disp_query = ' + SELECT `display_field` + FROM ' . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['table_info']) . ' + WHERE `db_name` = \'' . $GLOBALS['dbi']->escapeString($db) . '\' + AND `table_name` = \'' . $GLOBALS['dbi']->escapeString($table) + . '\''; + + $row = $GLOBALS['dbi']->fetchSingleRow( + $disp_query, 'ASSOC', DatabaseInterface::CONNECT_CONTROL + ); + if (isset($row['display_field'])) { + return $row['display_field']; + } + } + + /** + * Emulating the display field for some information_schema tables. + */ + if ($db == 'information_schema') { + switch ($table) { + case 'CHARACTER_SETS': + return 'DESCRIPTION'; + case 'TABLES': + return 'TABLE_COMMENT'; + } + } + + /** + * Pick first char field + */ + $columns = $GLOBALS['dbi']->getColumnsFull($db, $table); + if ($columns) { + foreach ($columns as $column) { + if ($GLOBALS['dbi']->types->getTypeClass($column['DATA_TYPE']) == 'CHAR') { + return $column['COLUMN_NAME']; + } + } + } + return false; + } + + /** + * Gets the comments for all columns of a table or the db itself + * + * @param string $db the name of the db to check for + * @param string $table the name of the table to check for + * + * @return array [column_name] = comment + * + * @access public + */ + public function getComments($db, $table = '') + { + $comments = array(); + + if ($table != '') { + // MySQL native column comments + $columns = $GLOBALS['dbi']->getColumns($db, $table, null, true); + if ($columns) { + foreach ($columns as $column) { + if (! empty($column['Comment'])) { + $comments[$column['Field']] = $column['Comment']; + } + } + } + } else { + $comments[] = $this->getDbComment($db); + } + + return $comments; + } + + /** + * Gets the comment for a db + * + * @param string $db the name of the db to check for + * + * @return string comment + * + * @access public + */ + public function getDbComment($db) + { + $cfgRelation = $this->getRelationsParam(); + $comment = ''; + + if ($cfgRelation['commwork']) { + // pmadb internal db comment + $com_qry = " + SELECT `comment` + FROM " . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['column_info']) + . " + WHERE db_name = '" . $GLOBALS['dbi']->escapeString($db) . "' + AND table_name = '' + AND column_name = '(db_comment)'"; + $com_rs = $this->queryAsControlUser( + $com_qry, false, DatabaseInterface::QUERY_STORE + ); + + if ($com_rs && $GLOBALS['dbi']->numRows($com_rs) > 0) { + $row = $GLOBALS['dbi']->fetchAssoc($com_rs); + $comment = $row['comment']; + } + $GLOBALS['dbi']->freeResult($com_rs); + } + + return $comment; + } + + /** + * Gets the comment for a db + * + * @access public + * + * @return string comment + */ + public function getDbComments() + { + $cfgRelation = $this->getRelationsParam(); + $comments = array(); + + if ($cfgRelation['commwork']) { + // pmadb internal db comment + $com_qry = " + SELECT `db_name`, `comment` + FROM " . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['column_info']) + . " + WHERE `column_name` = '(db_comment)'"; + $com_rs = $this->queryAsControlUser( + $com_qry, false, DatabaseInterface::QUERY_STORE + ); + + if ($com_rs && $GLOBALS['dbi']->numRows($com_rs) > 0) { + while ($row = $GLOBALS['dbi']->fetchAssoc($com_rs)) { + $comments[$row['db_name']] = $row['comment']; + } + } + $GLOBALS['dbi']->freeResult($com_rs); + } + + return $comments; + } + + /** + * Set a database comment to a certain value. + * + * @param string $db the name of the db + * @param string $comment the value of the column + * + * @return boolean true, if comment-query was made. + * + * @access public + */ + public function setDbComment($db, $comment = '') + { + $cfgRelation = $this->getRelationsParam(); + + if (! $cfgRelation['commwork']) { + return false; + } + + if (strlen($comment) > 0) { + $upd_query = 'INSERT INTO ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['column_info']) + . ' (`db_name`, `table_name`, `column_name`, `comment`)' + . ' VALUES (\'' + . $GLOBALS['dbi']->escapeString($db) + . "', '', '(db_comment)', '" + . $GLOBALS['dbi']->escapeString($comment) + . "') " + . ' ON DUPLICATE KEY UPDATE ' + . "`comment` = '" . $GLOBALS['dbi']->escapeString($comment) . "'"; + } else { + $upd_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['column_info']) + . ' WHERE `db_name` = \'' . $GLOBALS['dbi']->escapeString($db) + . '\' + AND `table_name` = \'\' + AND `column_name` = \'(db_comment)\''; + } + + if (isset($upd_query)) { + return $this->queryAsControlUser($upd_query); + } + + return false; + } + + /** + * Set a SQL history entry + * + * @param string $db the name of the db + * @param string $table the name of the table + * @param string $username the username + * @param string $sqlquery the sql query + * + * @return void + * + * @access public + */ + public function setHistory($db, $table, $username, $sqlquery) + { + $maxCharactersInDisplayedSQL = $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']; + // Prevent to run this automatically on Footer class destroying in testsuite + if (defined('TESTSUITE') + || mb_strlen($sqlquery) > $maxCharactersInDisplayedSQL + ) { + return; + } + + $cfgRelation = $this->getRelationsParam(); + + if (! isset($_SESSION['sql_history'])) { + $_SESSION['sql_history'] = array(); + } + + $_SESSION['sql_history'][] = array( + 'db' => $db, + 'table' => $table, + 'sqlquery' => $sqlquery, + ); + + if (count($_SESSION['sql_history']) > $GLOBALS['cfg']['QueryHistoryMax']) { + // history should not exceed a maximum count + array_shift($_SESSION['sql_history']); + } + + if (! $cfgRelation['historywork'] || ! $GLOBALS['cfg']['QueryHistoryDB']) { + return; + } + + $this->queryAsControlUser( + 'INSERT INTO ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['history']) . ' + (`username`, + `db`, + `table`, + `timevalue`, + `sqlquery`) + VALUES + (\'' . $GLOBALS['dbi']->escapeString($username) . '\', + \'' . $GLOBALS['dbi']->escapeString($db) . '\', + \'' . $GLOBALS['dbi']->escapeString($table) . '\', + NOW(), + \'' . $GLOBALS['dbi']->escapeString($sqlquery) . '\')' + ); + + $this->purgeHistory($username); + } + + /** + * Gets a SQL history entry + * + * @param string $username the username + * + * @return array list of history items + * + * @access public + */ + public function getHistory($username) + { + $cfgRelation = $this->getRelationsParam(); + + if (! $cfgRelation['historywork']) { + return false; + } + + /** + * if db-based history is disabled but there exists a session-based + * history, use it + */ + if (! $GLOBALS['cfg']['QueryHistoryDB']) { + if (isset($_SESSION['sql_history'])) { + return array_reverse($_SESSION['sql_history']); + } + return false; + } + + $hist_query = ' + SELECT `db`, + `table`, + `sqlquery`, + `timevalue` + FROM ' . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['history']) . ' + WHERE `username` = \'' . $GLOBALS['dbi']->escapeString($username) . '\' + ORDER BY `id` DESC'; + + return $GLOBALS['dbi']->fetchResult( + $hist_query, null, null, DatabaseInterface::CONNECT_CONTROL + ); + } + + /** + * purges SQL history + * + * deletes entries that exceeds $cfg['QueryHistoryMax'], oldest first, for the + * given user + * + * @param string $username the username + * + * @return void + * + * @access public + */ + public function purgeHistory($username) + { + $cfgRelation = $this->getRelationsParam(); + if (! $GLOBALS['cfg']['QueryHistoryDB'] || ! $cfgRelation['historywork']) { + return; + } + + if (! $cfgRelation['historywork']) { + return; + } + + $search_query = ' + SELECT `timevalue` + FROM ' . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['history']) . ' + WHERE `username` = \'' . $GLOBALS['dbi']->escapeString($username) . '\' + ORDER BY `timevalue` DESC + LIMIT ' . $GLOBALS['cfg']['QueryHistoryMax'] . ', 1'; + + if ($max_time = $GLOBALS['dbi']->fetchValue( + $search_query, 0, 0, DatabaseInterface::CONNECT_CONTROL + )) { + $this->queryAsControlUser( + 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['history']) . ' + WHERE `username` = \'' . $GLOBALS['dbi']->escapeString($username) + . '\' + AND `timevalue` <= \'' . $max_time . '\'' + ); + } + } + + /** + * Prepares the dropdown for one mode + * + * @param array $foreign the keys and values for foreigns + * @param string $data the current data of the dropdown + * @param string $mode the needed mode + * + * @return array the '; + } elseif ($mode == 'id-content') { + $reloptions[] = $reloption . '>' + . htmlspecialchars($key) . ' - ' . $value . ''; + } elseif ($mode == 'id-only') { + $reloptions[] = $reloption . '>' + . htmlspecialchars($key) . ''; + } + } // end foreach + + return $reloptions; + } + + /** + * Outputs dropdown with values of foreign fields + * + * @param array $disp_row array of the displayed row + * @param string $foreign_field the foreign field + * @param string $foreign_display the foreign field to display + * @param string $data the current data of the dropdown (field in row) + * @param int $max maximum number of items in the dropdown + * + * @return string the '; + $top_count = count($top); + if ($max == -1 || $top_count < $max) { + $ret .= implode('', $top); + if ($foreign_display && $top_count > 0) { + // this empty option is to visually mark the beginning of the + // second series of values (bottom) + $ret .= ''; + } + } + if ($foreign_display) { + $ret .= implode('', $bottom); + } + + return $ret; + } + + /** + * Gets foreign keys in preparation for a drop-down selector + * + * @param array|boolean $foreigners array of the foreign keys + * @param string $field the foreign field name + * @param bool $override_total whether to override the total + * @param string $foreign_filter a possible filter + * @param string $foreign_limit a possible LIMIT clause + * @param bool $get_total optional, whether to get total num of rows + * in $foreignData['the_total;] + * (has an effect of performance) + * + * @return array data about the foreign keys + * + * @access public + */ + public function getForeignData( + $foreigners, $field, $override_total, + $foreign_filter, $foreign_limit, $get_total=false + ) { + // we always show the foreign field in the drop-down; if a display + // field is defined, we show it besides the foreign field + $foreign_link = false; + do { + if (! $foreigners) { + break; + } + $foreigner = $this->searchColumnInForeigners($foreigners, $field); + if ($foreigner != false) { + $foreign_db = $foreigner['foreign_db']; + $foreign_table = $foreigner['foreign_table']; + $foreign_field = $foreigner['foreign_field']; + } else { + break; + } + + // Count number of rows in the foreign table. Currently we do + // not use a drop-down if more than ForeignKeyMaxLimit rows in the + // foreign table, + // for speed reasons and because we need a better interface for this. + // + // We could also do the SELECT anyway, with a LIMIT, and ensure that + // the current value of the field is one of the choices. + + // Check if table has more rows than specified by + // $GLOBALS['cfg']['ForeignKeyMaxLimit'] + $moreThanLimit = $GLOBALS['dbi']->getTable($foreign_db, $foreign_table) + ->checkIfMinRecordsExist($GLOBALS['cfg']['ForeignKeyMaxLimit']); + + if ($override_total == true + || !$moreThanLimit + ) { + // foreign_display can be false if no display field defined: + $foreign_display = $this->getDisplayField($foreign_db, $foreign_table); + + $f_query_main = 'SELECT ' . Util::backquote($foreign_field) + . ( + ($foreign_display == false) + ? '' + : ', ' . Util::backquote($foreign_display) + ); + $f_query_from = ' FROM ' . Util::backquote($foreign_db) + . '.' . Util::backquote($foreign_table); + $f_query_filter = empty($foreign_filter) ? '' : ' WHERE ' + . Util::backquote($foreign_field) + . ' LIKE "%' . $GLOBALS['dbi']->escapeString($foreign_filter) . '%"' + . ( + ($foreign_display == false) + ? '' + : ' OR ' . Util::backquote($foreign_display) + . ' LIKE "%' . $GLOBALS['dbi']->escapeString($foreign_filter) + . '%"' + ); + $f_query_order = ($foreign_display == false) ? '' :' ORDER BY ' + . Util::backquote($foreign_table) . '.' + . Util::backquote($foreign_display); + + $f_query_limit = ! empty($foreign_limit) ? ($foreign_limit) : ''; + + if (!empty($foreign_filter)) { + $the_total = $GLOBALS['dbi']->fetchValue( + 'SELECT COUNT(*)' . $f_query_from . $f_query_filter + ); + if ($the_total === false) { + $the_total = 0; + } + } + + $disp = $GLOBALS['dbi']->tryQuery( + $f_query_main . $f_query_from . $f_query_filter + . $f_query_order . $f_query_limit + ); + if ($disp && $GLOBALS['dbi']->numRows($disp) > 0) { + // If a resultset has been created, pre-cache it in the $disp_row + // array. This helps us from not needing to use mysql_data_seek by + // accessing a pre-cached PHP array. Usually those resultsets are + // not that big, so a performance hit should not be expected. + $disp_row = array(); + while ($single_disp_row = @$GLOBALS['dbi']->fetchAssoc($disp)) { + $disp_row[] = $single_disp_row; + } + @$GLOBALS['dbi']->freeResult($disp); + } else { + // Either no data in the foreign table or + // user does not have select permission to foreign table/field + // Show an input field with a 'Browse foreign values' link + $disp_row = null; + $foreign_link = true; + } + } else { + $disp_row = null; + $foreign_link = true; + } + } while (false); + + if ($get_total) { + $the_total = $GLOBALS['dbi']->getTable($foreign_db, $foreign_table) + ->countRecords(true); + } + + $foreignData = array(); + $foreignData['foreign_link'] = $foreign_link; + $foreignData['the_total'] = isset($the_total) ? $the_total : null; + $foreignData['foreign_display'] = ( + isset($foreign_display) ? $foreign_display : null + ); + $foreignData['disp_row'] = isset($disp_row) ? $disp_row : null; + $foreignData['foreign_field'] = isset($foreign_field) ? $foreign_field : null; + + return $foreignData; + } + + /** + * Rename a field in relation tables + * + * usually called after a column in a table was renamed + * + * @param string $db database name + * @param string $table table name + * @param string $field old field name + * @param string $new_name new field name + * + * @return void + */ + public function renameField($db, $table, $field, $new_name) + { + $cfgRelation = $this->getRelationsParam(); + + if ($cfgRelation['displaywork']) { + $table_query = 'UPDATE ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['table_info']) + . ' SET display_field = \'' . $GLOBALS['dbi']->escapeString( + $new_name + ) . '\'' + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) + . '\'' + . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' AND display_field = \'' . $GLOBALS['dbi']->escapeString($field) + . '\''; + $this->queryAsControlUser($table_query); + } + + if ($cfgRelation['relwork']) { + $table_query = 'UPDATE ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['relation']) + . ' SET master_field = \'' . $GLOBALS['dbi']->escapeString( + $new_name + ) . '\'' + . ' WHERE master_db = \'' . $GLOBALS['dbi']->escapeString($db) + . '\'' + . ' AND master_table = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' AND master_field = \'' . $GLOBALS['dbi']->escapeString($field) + . '\''; + $this->queryAsControlUser($table_query); + + $table_query = 'UPDATE ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['relation']) + . ' SET foreign_field = \'' . $GLOBALS['dbi']->escapeString( + $new_name + ) . '\'' + . ' WHERE foreign_db = \'' . $GLOBALS['dbi']->escapeString($db) + . '\'' + . ' AND foreign_table = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' AND foreign_field = \'' . $GLOBALS['dbi']->escapeString($field) + . '\''; + $this->queryAsControlUser($table_query); + } + } + + + /** + * Performs SQL query used for renaming table. + * + * @param string $table Relation table to use + * @param string $source_db Source database name + * @param string $target_db Target database name + * @param string $source_table Source table name + * @param string $target_table Target table name + * @param string $db_field Name of database field + * @param string $table_field Name of table field + * + * @return void + */ + public function renameSingleTable($table, + $source_db, $target_db, + $source_table, $target_table, + $db_field, $table_field + ) { + $query = 'UPDATE ' + . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' + . Util::backquote($GLOBALS['cfgRelation'][$table]) + . ' SET ' + . $db_field . ' = \'' . $GLOBALS['dbi']->escapeString($target_db) + . '\', ' + . $table_field . ' = \'' . $GLOBALS['dbi']->escapeString($target_table) + . '\'' + . ' WHERE ' + . $db_field . ' = \'' . $GLOBALS['dbi']->escapeString($source_db) . '\'' + . ' AND ' + . $table_field . ' = \'' . $GLOBALS['dbi']->escapeString($source_table) + . '\''; + $this->queryAsControlUser($query); + } + + + /** + * Rename a table in relation tables + * + * usually called after table has been moved + * + * @param string $source_db Source database name + * @param string $target_db Target database name + * @param string $source_table Source table name + * @param string $target_table Target table name + * + * @return void + */ + public function renameTable($source_db, $target_db, $source_table, $target_table) + { + // Move old entries from PMA-DBs to new table + if ($GLOBALS['cfgRelation']['commwork']) { + $this->renameSingleTable( + 'column_info', + $source_db, $target_db, + $source_table, $target_table, + 'db_name', 'table_name' + ); + } + + // updating bookmarks is not possible since only a single table is + // moved, and not the whole DB. + + if ($GLOBALS['cfgRelation']['displaywork']) { + $this->renameSingleTable( + 'table_info', + $source_db, $target_db, + $source_table, $target_table, + 'db_name', 'table_name' + ); + } + + if ($GLOBALS['cfgRelation']['relwork']) { + $this->renameSingleTable( + 'relation', + $source_db, $target_db, + $source_table, $target_table, + 'foreign_db', 'foreign_table' + ); + + $this->renameSingleTable( + 'relation', + $source_db, $target_db, + $source_table, $target_table, + 'master_db', 'master_table' + ); + } + + if ($GLOBALS['cfgRelation']['pdfwork']) { + if ($source_db == $target_db) { + // rename within the database can be handled + $this->renameSingleTable( + 'table_coords', + $source_db, $target_db, + $source_table, $target_table, + 'db_name', 'table_name' + ); + } else { + // if the table is moved out of the database we can no loger keep the + // record for table coordinate + $remove_query = "DELETE FROM " + . Util::backquote($GLOBALS['cfgRelation']['db']) . "." + . Util::backquote($GLOBALS['cfgRelation']['table_coords']) + . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($source_db) . "'" + . " AND table_name = '" . $GLOBALS['dbi']->escapeString($source_table) + . "'"; + $this->queryAsControlUser($remove_query); + } + } + + if ($GLOBALS['cfgRelation']['uiprefswork']) { + $this->renameSingleTable( + 'table_uiprefs', + $source_db, $target_db, + $source_table, $target_table, + 'db_name', 'table_name' + ); + } + + if ($GLOBALS['cfgRelation']['navwork']) { + // update hidden items inside table + $this->renameSingleTable( + 'navigationhiding', + $source_db, $target_db, + $source_table, $target_table, + 'db_name', 'table_name' + ); + + // update data for hidden table + $query = "UPDATE " + . Util::backquote($GLOBALS['cfgRelation']['db']) . "." + . Util::backquote( + $GLOBALS['cfgRelation']['navigationhiding'] + ) + . " SET db_name = '" . $GLOBALS['dbi']->escapeString($target_db) + . "'," + . " item_name = '" . $GLOBALS['dbi']->escapeString($target_table) + . "'" + . " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($source_db) + . "'" + . " AND item_name = '" . $GLOBALS['dbi']->escapeString($source_table) + . "'" + . " AND item_type = 'table'"; + $this->queryAsControlUser($query); + } + } + + /** + * Create a PDF page + * + * @param string $newpage name of the new PDF page + * @param array $cfgRelation Relation configuration + * @param string $db database name + * + * @return int $pdf_page_number + */ + public function createPage($newpage, array $cfgRelation, $db) + { + if (! isset($newpage) || $newpage == '') { + $newpage = __('no description'); + } + $ins_query = 'INSERT INTO ' + . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' + . Util::backquote($cfgRelation['pdf_pages']) + . ' (db_name, page_descr)' + . ' VALUES (\'' + . $GLOBALS['dbi']->escapeString($db) . '\', \'' + . $GLOBALS['dbi']->escapeString($newpage) . '\')'; + $this->queryAsControlUser($ins_query, false); + + return $GLOBALS['dbi']->insertId(DatabaseInterface::CONNECT_CONTROL); + } + + /** + * Get child table references for a table column. + * This works only if 'DisableIS' is false. An empty array is returned otherwise. + * + * @param string $db name of master table db. + * @param string $table name of master table. + * @param string $column name of master table column. + * + * @return array $child_references + */ + public function getChildReferences($db, $table, $column = '') + { + $child_references = array(); + if (! $GLOBALS['cfg']['Server']['DisableIS']) { + $rel_query = "SELECT `column_name`, `table_name`," + . " `table_schema`, `referenced_column_name`" + . " FROM `information_schema`.`key_column_usage`" + . " WHERE `referenced_table_name` = '" + . $GLOBALS['dbi']->escapeString($table) . "'" + . " AND `referenced_table_schema` = '" + . $GLOBALS['dbi']->escapeString($db) . "'"; + if ($column) { + $rel_query .= " AND `referenced_column_name` = '" + . $GLOBALS['dbi']->escapeString($column) . "'"; + } + + $child_references = $GLOBALS['dbi']->fetchResult( + $rel_query, array('referenced_column_name', null) + ); + } + return $child_references; + } + + /** + * Check child table references and foreign key for a table column. + * + * @param string $db name of master table db. + * @param string $table name of master table. + * @param string $column name of master table column. + * @param array|null $foreigners_full foreiners array for the whole table. + * @param array|null $child_references_full child references for the whole table. + * + * @return array $column_status telling about references if foreign key. + */ + public function checkChildForeignReferences( + $db, $table, $column, $foreigners_full = null, $child_references_full = null + ) { + $column_status = array(); + $column_status['isEditable'] = false; + $column_status['isReferenced'] = false; + $column_status['isForeignKey'] = false; + $column_status['references'] = array(); + + $foreigners = array(); + if ($foreigners_full !== null) { + if (isset($foreigners_full[$column])) { + $foreigners[$column] = $foreigners_full[$column]; + } + if (isset($foreigners_full['foreign_keys_data'])) { + $foreigners['foreign_keys_data'] = $foreigners_full['foreign_keys_data']; + } + } else { + $foreigners = $this->getForeigners($db, $table, $column, 'foreign'); + } + $foreigner = $this->searchColumnInForeigners($foreigners, $column); + + $child_references = array(); + if ($child_references_full !== null) { + if (isset($child_references_full[$column])) { + $child_references = $child_references_full[$column]; + } + } else { + $child_references = $this->getChildReferences($db, $table, $column); + } + + if (sizeof($child_references, 0) > 0 + || $foreigner + ) { + if (sizeof($child_references, 0) > 0) { + $column_status['isReferenced'] = true; + foreach ($child_references as $columns) { + array_push( + $column_status['references'], + Util::backquote($columns['table_schema']) + . '.' . Util::backquote($columns['table_name']) + ); + } + } + + if ($foreigner) { + $column_status['isForeignKey'] = true; + } + } else { + $column_status['isEditable'] = true; + } + + return $column_status; + } + + /** + * Search a table column in foreign data. + * + * @param array $foreigners Table Foreign data + * @param string $column Column name + * + * @return bool|array + */ + public function searchColumnInForeigners(array $foreigners, $column) + { + if (isset($foreigners[$column])) { + return $foreigners[$column]; + } + + $foreigner = array(); + foreach ($foreigners['foreign_keys_data'] as $one_key) { + $column_index = array_search($column, $one_key['index_list']); + if ($column_index !== false) { + $foreigner['foreign_field'] + = $one_key['ref_index_list'][$column_index]; + $foreigner['foreign_db'] = isset($one_key['ref_db_name']) + ? $one_key['ref_db_name'] + : $GLOBALS['db']; + $foreigner['foreign_table'] = $one_key['ref_table_name']; + $foreigner['constraint'] = $one_key['constraint']; + $foreigner['on_update'] = isset($one_key['on_update']) + ? $one_key['on_update'] + : 'RESTRICT'; + $foreigner['on_delete'] = isset($one_key['on_delete']) + ? $one_key['on_delete'] + : 'RESTRICT'; + + return $foreigner; + } + } + + return false; + } + + /** + * Returns default PMA table names and their create queries. + * + * @return array table name, create query + */ + public function getDefaultPmaTableNames() + { + $pma_tables = array(); + $create_tables_file = file_get_contents( + SQL_DIR . 'create_tables.sql' + ); + + $queries = explode(';', $create_tables_file); + + foreach ($queries as $query) { + if (preg_match( + '/CREATE TABLE IF NOT EXISTS `(.*)` \(/', + $query, + $table + ) + ) { + $pma_tables[$table[1]] = $query . ';'; + } + } + + return $pma_tables; + } + + /** + * Create a table named phpmyadmin to be used as configuration storage + * + * @return bool + */ + public function createPmaDatabase() + { + $GLOBALS['dbi']->tryQuery("CREATE DATABASE IF NOT EXISTS `phpmyadmin`"); + if ($error = $GLOBALS['dbi']->getError()) { + if ($GLOBALS['errno'] == 1044) { + $GLOBALS['message'] = __( + 'You do not have necessary privileges to create a database named' + . ' \'phpmyadmin\'. You may go to \'Operations\' tab of any' + . ' database to set up the phpMyAdmin configuration storage there.' + ); + } else { + $GLOBALS['message'] = $error; + } + return false; + } + return true; + } + + /** + * Creates PMA tables in the given db, updates if already exists. + * + * @param string $db database + * @param boolean $create whether to create tables if they don't exist. + * + * @return void + */ + public function fixPmaTables($db, $create = true) + { + $tablesToFeatures = array( + 'pma__bookmark' => 'bookmarktable', + 'pma__relation' => 'relation', + 'pma__table_info' => 'table_info', + 'pma__table_coords' => 'table_coords', + 'pma__pdf_pages' => 'pdf_pages', + 'pma__column_info' => 'column_info', + 'pma__history' => 'history', + 'pma__recent' => 'recent', + 'pma__favorite' => 'favorite', + 'pma__table_uiprefs' => 'table_uiprefs', + 'pma__tracking' => 'tracking', + 'pma__userconfig' => 'userconfig', + 'pma__users' => 'users', + 'pma__usergroups' => 'usergroups', + 'pma__navigationhiding' => 'navigationhiding', + 'pma__savedsearches' => 'savedsearches', + 'pma__central_columns' => 'central_columns', + 'pma__designer_settings' => 'designer_settings', + 'pma__export_templates' => 'export_templates', + ); + + $existingTables = $GLOBALS['dbi']->getTables($db, DatabaseInterface::CONNECT_CONTROL); + + $createQueries = null; + $foundOne = false; + foreach ($tablesToFeatures as $table => $feature) { + if (! in_array($table, $existingTables)) { + if ($create) { + if ($createQueries == null) { // first create + $createQueries = $this->getDefaultPmaTableNames(); + $GLOBALS['dbi']->selectDb($db); + } + $GLOBALS['dbi']->tryQuery($createQueries[$table]); + if ($error = $GLOBALS['dbi']->getError()) { + $GLOBALS['message'] = $error; + return; + } + $foundOne = true; + $GLOBALS['cfg']['Server'][$feature] = $table; + } + } else { + $foundOne = true; + $GLOBALS['cfg']['Server'][$feature] = $table; + } + } + + if (! $foundOne) { + return; + } + $GLOBALS['cfg']['Server']['pmadb'] = $db; + $_SESSION['relation'][$GLOBALS['server']] = $this->checkRelationsParam(); + + $cfgRelation = $this->getRelationsParam(); + if ($cfgRelation['recentwork'] || $cfgRelation['favoritework']) { + // Since configuration storage is updated, we need to + // re-initialize the favorite and recent tables stored in the + // session from the current configuration storage. + if ($cfgRelation['favoritework']) { + $fav_tables = RecentFavoriteTable::getInstance('favorite'); + $_SESSION['tmpval']['favorite_tables'][$GLOBALS['server']] + = $fav_tables->getFromDb(); + } + + if ($cfgRelation['recentwork']) { + $recent_tables = RecentFavoriteTable::getInstance('recent'); + $_SESSION['tmpval']['recent_tables'][$GLOBALS['server']] + = $recent_tables->getFromDb(); + } + + // Reload navi panel to update the recent/favorite lists. + $GLOBALS['reload'] = true; + } + } + + /** + * Get Html for PMA tables fixing anchor. + * + * @param boolean $allTables whether to create all tables + * @param boolean $createDb whether to create the pmadb also + * + * @return string Html + */ + public function getHtmlFixPmaTables($allTables, $createDb = false) + { + $retval = ''; + + $url_query = Url::getCommon(array('db' => $GLOBALS['db']), ''); + if ($allTables) { + if ($createDb) { + $url_query .= '&goto=db_operations.php&create_pmadb=1'; + $message = Message::notice( + __( + '%sCreate%s a database named \'phpmyadmin\' and setup ' + . 'the phpMyAdmin configuration storage there.' + ) + ); + } else { + $url_query .= '&goto=db_operations.php&fixall_pmadb=1'; + $message = Message::notice( + __( + '%sCreate%s the phpMyAdmin configuration storage in the ' + . 'current database.' + ) + ); + } + } else { + $url_query .= '&goto=db_operations.php&fix_pmadb=1'; + $message = Message::notice( + __('%sCreate%s missing phpMyAdmin configuration storage tables.') + ); + } + $message->addParamHtml(''); + $message->addParamHtml(''); + + $retval .= $message->getDisplay(); + + return $retval; + } + + /** + * Gets the relations info and status, depending on the condition + * + * @param boolean $condition whether to look for foreigners or not + * @param string $db database name + * @param string $table table name + * + * @return array ($res_rel, $have_rel) + */ + public function getRelationsAndStatus($condition, $db, $table) + { + if ($condition) { + // Find which tables are related with the current one and write it in + // an array + $res_rel = $this->getForeigners($db, $table); + + if (count($res_rel) > 0) { + $have_rel = true; + } else { + $have_rel = false; + } + } else { + $have_rel = false; + $res_rel = array(); + } // end if + return(array($res_rel, $have_rel)); + } + + /** + * Verifies if all the pmadb tables are defined + * + * @return boolean + */ + public function arePmadbTablesDefined() + { + if (empty($GLOBALS['cfg']['Server']['bookmarktable']) + || empty($GLOBALS['cfg']['Server']['relation']) + || empty($GLOBALS['cfg']['Server']['table_info']) + || empty($GLOBALS['cfg']['Server']['table_coords']) + || empty($GLOBALS['cfg']['Server']['column_info']) + || empty($GLOBALS['cfg']['Server']['pdf_pages']) + || empty($GLOBALS['cfg']['Server']['history']) + || empty($GLOBALS['cfg']['Server']['recent']) + || empty($GLOBALS['cfg']['Server']['favorite']) + || empty($GLOBALS['cfg']['Server']['table_uiprefs']) + || empty($GLOBALS['cfg']['Server']['tracking']) + || empty($GLOBALS['cfg']['Server']['userconfig']) + || empty($GLOBALS['cfg']['Server']['users']) + || empty($GLOBALS['cfg']['Server']['usergroups']) + || empty($GLOBALS['cfg']['Server']['navigationhiding']) + || empty($GLOBALS['cfg']['Server']['savedsearches']) + || empty($GLOBALS['cfg']['Server']['central_columns']) + || empty($GLOBALS['cfg']['Server']['designer_settings']) + || empty($GLOBALS['cfg']['Server']['export_templates']) + ) { + return false; + } + + return true; + } + + /** + * Get tables for foreign key constraint + * + * @param string $foreignDb Database name + * @param string $tblStorageEngine Table storage engine + * + * @return array Table names + */ + public function getTables($foreignDb, $tblStorageEngine) + { + $tables = array(); + $tablesRows = $GLOBALS['dbi']->query( + 'SHOW TABLE STATUS FROM ' . Util::backquote($foreignDb), + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + while ($row = $GLOBALS['dbi']->fetchRow($tablesRows)) { + if (isset($row[1]) && mb_strtoupper($row[1]) == $tblStorageEngine) { + $tables[] = $row[0]; + } + } + if ($GLOBALS['cfg']['NaturalOrder']) { + usort($tables, 'strnatcasecmp'); + } + return $tables; + } +} diff --git a/phpMyAdmin/libraries/classes/RelationCleanup.php b/phpMyAdmin/libraries/classes/RelationCleanup.php new file mode 100755 index 0000000..0f2d022 --- /dev/null +++ b/phpMyAdmin/libraries/classes/RelationCleanup.php @@ -0,0 +1,371 @@ +getRelationsParam(); + + if ($cfgRelation['commwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['column_info']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' + . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' AND column_name = \'' . $GLOBALS['dbi']->escapeString($column) + . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['displaywork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['table_info']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' + . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' AND display_field = \'' . $GLOBALS['dbi']->escapeString($column) + . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['relwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . ' WHERE master_db = \'' . $GLOBALS['dbi']->escapeString($db) + . '\'' + . ' AND master_table = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' AND master_field = \'' . $GLOBALS['dbi']->escapeString($column) + . '\''; + $relation->queryAsControlUser($remove_query); + + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . ' WHERE foreign_db = \'' . $GLOBALS['dbi']->escapeString($db) + . '\'' + . ' AND foreign_table = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' AND foreign_field = \'' . $GLOBALS['dbi']->escapeString($column) + . '\''; + $relation->queryAsControlUser($remove_query); + } + } + + /** + * Cleanup table related relation stuff + * + * @param string $db database name + * @param string $table table name + * + * @return void + */ + public static function table($db, $table) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + + if ($cfgRelation['commwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['column_info']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' + . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['displaywork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['table_info']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' + . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['pdfwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['table_coords']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' + . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['relwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . ' WHERE master_db = \'' . $GLOBALS['dbi']->escapeString($db) + . '\'' + . ' AND master_table = \'' . $GLOBALS['dbi']->escapeString($table) + . '\''; + $relation->queryAsControlUser($remove_query); + + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . ' WHERE foreign_db = \'' . $GLOBALS['dbi']->escapeString($db) + . '\'' + . ' AND foreign_table = \'' . $GLOBALS['dbi']->escapeString($table) + . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['uiprefswork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['table_uiprefs']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' + . ' AND table_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['navwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['navigationhiding']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\'' + . ' AND (table_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' OR (item_name = \'' . $GLOBALS['dbi']->escapeString($table) + . '\'' + . ' AND item_type = \'table\'))'; + $relation->queryAsControlUser($remove_query); + } + } + + /** + * Cleanup database related relation stuff + * + * @param string $db database name + * + * @return void + */ + public static function database($db) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + + if ($cfgRelation['commwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['column_info']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['bookmarkwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['bookmark']) + . ' WHERE dbase = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['displaywork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['table_info']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['pdfwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['pdf_pages']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['table_coords']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['relwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . ' WHERE master_db = \'' + . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . ' WHERE foreign_db = \'' . $GLOBALS['dbi']->escapeString($db) + . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['uiprefswork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['table_uiprefs']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['navwork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['navigationhiding']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['savedsearcheswork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['savedsearches']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['centralcolumnswork']) { + $remove_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['central_columns']) + . ' WHERE db_name = \'' . $GLOBALS['dbi']->escapeString($db) . '\''; + $relation->queryAsControlUser($remove_query); + } + } + + /** + * Cleanup user related relation stuff + * + * @param string $username username + * + * @return void + */ + public static function user($username) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + + if ($cfgRelation['bookmarkwork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['bookmark']) + . " WHERE `user` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['historywork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['history']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['recentwork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['recent']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['favoritework']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['favorite']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['uiprefswork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['table_uiprefs']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['userconfigwork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['userconfig']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['menuswork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['users']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['navwork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['navigationhiding']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['savedsearcheswork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['savedsearches']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + + if ($cfgRelation['designersettingswork']) { + $remove_query = "DELETE FROM " + . Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['designer_settings']) + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) + . "'"; + $relation->queryAsControlUser($remove_query); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Replication.php b/phpMyAdmin/libraries/classes/Replication.php new file mode 100755 index 0000000..d53fada --- /dev/null +++ b/phpMyAdmin/libraries/classes/Replication.php @@ -0,0 +1,173 @@ +tryQuery($action . " SLAVE " . $control . ";", $link); + } + + /** + * Changes master for replication slave + * + * @param string $user replication user on master + * @param string $password password for the user + * @param string $host master's hostname or IP + * @param int $port port, where mysql is running + * @param array $pos position of mysql replication, + * array should contain fields File and Position + * @param bool $stop shall we stop slave? + * @param bool $start shall we start slave? + * @param mixed $link mysql link + * + * @return string output of CHANGE MASTER mysql command + */ + public static function slaveChangeMaster($user, $password, $host, $port, + array $pos, $stop = true, $start = true, $link = null + ) { + if ($stop) { + self::slaveControl("STOP", null, $link); + } + + $out = $GLOBALS['dbi']->tryQuery( + 'CHANGE MASTER TO ' . + 'MASTER_HOST=\'' . $host . '\',' . + 'MASTER_PORT=' . ($port * 1) . ',' . + 'MASTER_USER=\'' . $user . '\',' . + 'MASTER_PASSWORD=\'' . $password . '\',' . + 'MASTER_LOG_FILE=\'' . $pos["File"] . '\',' . + 'MASTER_LOG_POS=' . $pos["Position"] . ';', $link + ); + + if ($start) { + self::slaveControl("START", null, $link); + } + + return $out; + } + + /** + * This function provides connection to remote mysql server + * + * @param string $user mysql username + * @param string $password password for the user + * @param string $host mysql server's hostname or IP + * @param int $port mysql remote port + * @param string $socket path to unix socket + * + * @return mixed $link mysql link on success + */ + public static function connectToMaster( + $user, $password, $host = null, $port = null, $socket = null + ) { + $server = array(); + $server['user'] = $user; + $server['password'] = $password; + $server["host"] = Core::sanitizeMySQLHost($host); + $server["port"] = $port; + $server["socket"] = $socket; + + // 5th parameter set to true means that it's an auxiliary connection + // and we must not go back to login page if it fails + return $GLOBALS['dbi']->connect(DatabaseInterface::CONNECT_AUXILIARY, $server); + } + + /** + * Fetches position and file of current binary log on master + * + * @param mixed $link mysql link + * + * @return array an array containing File and Position in MySQL replication + * on master server, useful for self::slaveChangeMaster + */ + public static function slaveBinLogMaster($link = null) + { + $data = $GLOBALS['dbi']->fetchResult('SHOW MASTER STATUS', null, null, $link); + $output = array(); + + if (! empty($data)) { + $output["File"] = $data[0]["File"]; + $output["Position"] = $data[0]["Position"]; + } + return $output; + } +} diff --git a/phpMyAdmin/libraries/classes/ReplicationGui.php b/phpMyAdmin/libraries/classes/ReplicationGui.php new file mode 100755 index 0000000..e1f0e1e --- /dev/null +++ b/phpMyAdmin/libraries/classes/ReplicationGui.php @@ -0,0 +1,1094 @@ +getDisplay(); + $_SESSION['replication']['sr_action_status'] = 'unknown'; + } elseif ($_SESSION['replication']['sr_action_status'] == 'success') { + $success_message = $_SESSION['replication']['sr_action_info']; + $html .= Message::success($success_message)->getDisplay(); + $_SESSION['replication']['sr_action_status'] = 'unknown'; + } + } + return $html; + } + + /** + * returns HTML for master replication + * + * @return String HTML code + */ + public static function getHtmlForMasterReplication() + { + $html = ''; + if (! isset($_POST['repl_clear_scr'])) { + $html .= '
    '; + $html .= '' . __('Master replication') . ''; + $html .= __('This server is configured as master in a replication process.'); + $html .= '
      '; + $html .= '
    • '; + $html .= __('Show master status') . ''; + $html .= self::getHtmlForReplicationStatusTable('master', true, false); + $html .= '
    • '; + + $html .= '
    • '; + $html .= __('Show connected slaves') . ''; + $html .= self::getHtmlForReplicationSlavesTable(true); + $html .= '
    • '; + + $_url_params = $GLOBALS['url_params']; + $_url_params['mr_adduser'] = true; + $_url_params['repl_clear_scr'] = true; + + $html .= '
    • '; + $html .= __('Add slave replication user') . '
    • '; + } + + // Display 'Add replication slave user' form + if (isset($_POST['mr_adduser'])) { + $html .= self::getHtmlForReplicationMasterAddSlaveUser(); + } elseif (! isset($_POST['repl_clear_scr'])) { + $html .= "
    "; + $html .= "
    "; + } + + return $html; + } + + /** + * returns HTML for master replication configuration + * + * @return String HTML code + */ + public static function getHtmlForMasterConfiguration() + { + $html = '
    '; + $html .= '' . __('Master configuration') . ''; + $html .= __( + 'This server is not configured as a master server in a ' + . 'replication process. You can choose from either replicating ' + . 'all databases and ignoring some of them (useful if you want to ' + . 'replicate a majority of the databases) or you can choose to ignore ' + . 'all databases by default and allow only certain databases to be ' + . 'replicated. Please select the mode:' + ) . '

    '; + + $html .= ''; + $html .= '

    '; + $html .= __('Please select databases:') . '
    '; + $html .= self::getHtmlForReplicationDbMultibox(); + $html .= '

    '; + $html .= __( + 'Now, add the following lines at the end of [mysqld] section' + . ' in your my.cnf and please restart the MySQL server afterwards.' + ) . '
    '; + $html .= '
    ';
    +        $html .= __(
    +            'Once you restarted MySQL server, please click on Go button. '
    +            . 'Afterwards, you should see a message informing you, that this server'
    +            . ' is configured as master.'
    +        );
    +        $html .= '
    '; + $html .= '
    '; + $html .= '
    '; + $html .= Url::getHiddenInputs('', ''); + $html .= ' '; + $html .= '
    '; + $html .= '
    '; + + return $html; + } + + /** + * returns HTML for slave replication configuration + * + * @param bool $server_slave_status Whether it is Master or Slave + * @param array $server_slave_replication Slave replication + * + * @return String HTML code + */ + public static function getHtmlForSlaveConfiguration( + $server_slave_status, array $server_slave_replication + ) { + $html = '
    '; + $html .= '' . __('Slave replication') . ''; + /** + * check for multi-master replication functionality + */ + $server_slave_multi_replication = $GLOBALS['dbi']->fetchResult( + 'SHOW ALL SLAVES STATUS' + ); + if ($server_slave_multi_replication) { + $html .= __('Master connection:'); + $html .= '
    '; + $html .= Url::getHiddenInputs($GLOBALS['url_params']); + $html .= ' '; + $html .= ' '; + $html .= '
    '; + $html .= '

    '; + } + if ($server_slave_status) { + $html .= '
    '; + + $_url_params = $GLOBALS['url_params']; + $_url_params['sr_take_action'] = true; + $_url_params['sr_slave_server_control'] = true; + + if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') { + $_url_params['sr_slave_action'] = 'start'; + } else { + $_url_params['sr_slave_action'] = 'stop'; + } + + $_url_params['sr_slave_control_parm'] = 'IO_THREAD'; + $slave_control_io_link = Url::getCommon($_url_params, '', false); + + if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') { + $_url_params['sr_slave_action'] = 'start'; + } else { + $_url_params['sr_slave_action'] = 'stop'; + } + + $_url_params['sr_slave_control_parm'] = 'SQL_THREAD'; + $slave_control_sql_link = Url::getCommon($_url_params, '', false); + + if ($server_slave_replication[0]['Slave_IO_Running'] == 'No' + || $server_slave_replication[0]['Slave_SQL_Running'] == 'No' + ) { + $_url_params['sr_slave_action'] = 'start'; + } else { + $_url_params['sr_slave_action'] = 'stop'; + } + + $_url_params['sr_slave_control_parm'] = null; + $slave_control_full_link = Url::getCommon($_url_params, '', false); + + $_url_params['sr_slave_action'] = 'reset'; + $slave_control_reset_link = Url::getCommon($_url_params, '', false); + + $_url_params = $GLOBALS['url_params']; + $_url_params['sr_take_action'] = true; + $_url_params['sr_slave_skip_error'] = true; + $slave_skip_error_link = Url::getCommon($_url_params, '', false); + + if ($server_slave_replication[0]['Slave_SQL_Running'] == 'No') { + $html .= Message::error( + __('Slave SQL Thread not running!') + )->getDisplay(); + } + if ($server_slave_replication[0]['Slave_IO_Running'] == 'No') { + $html .= Message::error( + __('Slave IO Thread not running!') + )->getDisplay(); + } + + $_url_params = $GLOBALS['url_params']; + $_url_params['sl_configure'] = true; + $_url_params['repl_clear_scr'] = true; + + $reconfiguremaster_link = Url::getCommon($_url_params, '', false); + + $html .= __( + 'Server is configured as slave in a replication process. Would you ' . + 'like to:' + ); + $html .= '
    '; + $html .= ''; + $html .= '
    '; + + } elseif (! isset($_POST['sl_configure'])) { + $_url_params = $GLOBALS['url_params']; + $_url_params['sl_configure'] = true; + $_url_params['repl_clear_scr'] = true; + + $html .= sprintf( + __( + 'This server is not configured as slave in a replication process. ' + . 'Would you like to %sconfigure%s it?' + ), + '', + '' + ); + } + $html .= '
    '; + + return $html; + } + + /** + * returns HTML for Slave Error Management + * + * @param String $slave_skip_error_link error link + * + * @return String HTML code + */ + public static function getHtmlForSlaveErrorManagement($slave_skip_error_link) + { + $html = ''; + $html .= __('Error management:') . ''; + $html .= '
    '; + $html .= Message::error( + __('Skipping errors might lead into unsynchronized master and slave!') + )->getDisplay(); + $html .= '
      '; + $html .= '
    • '; + $html .= __('Skip current error') . '
    • '; + $html .= '
    • '; + $html .= '
      '; + $html .= Url::getHiddenInputs('', ''); + $html .= sprintf( + __('Skip next %s errors.'), + '' + ); + $html .= ' '; + $html .= ' '; + $html .= '
    • '; + $html .= '
    '; + $html .= '
    '; + return $html; + } + + /** + * returns HTML for not configure for a server replication + * + * @return String HTML code + */ + public static function getHtmlForNotServerReplication() + { + $_url_params = $GLOBALS['url_params']; + $_url_params['mr_configure'] = true; + + $html = '
    '; + $html .= '' . __('Master replication') . ''; + $html .= sprintf( + __( + 'This server is not configured as master in a replication process. ' + . 'Would you like to %sconfigure%s it?' + ), + '', + '' + ); + $html .= '
    '; + return $html; + } + + /** + * returns HTML code for selecting databases + * + * @return String HTML code + */ + public static function getHtmlForReplicationDbMultibox() + { + $multi_values = ''; + $multi_values .= '
    '; + $multi_values .= '' . __('Select all') . ''; + $multi_values .= ' / '; + $multi_values .= '' . __('Unselect all') . ''; + + return $multi_values; + } + + /** + * returns HTML for changing master + * + * @param String $submitname - submit button name + * + * @return String HTML code + */ + public static function getHtmlForReplicationChangeMaster($submitname) + { + $html = ''; + list($username_length, $hostname_length) + = self::getUsernameHostnameLength(); + + $html .= '
    '; + $html .= Url::getHiddenInputs('', ''); + $html .= '
    '; + $html .= ' ' . __('Slave configuration'); + $html .= ' - ' . __('Change or reconfigure master server') . ''; + $html .= __( + 'Make sure you have a unique server-id in your configuration file (my.cnf). ' + . 'If not, please add the following line into [mysqld] section:' + ); + $html .= '
    '; + $html .= '
    server-id=' . time() . '
    '; + + $html .= self::getHtmlForAddUserInputDiv( + array('text'=>__('User name:'), 'for'=>"text_username"), + array( + 'type'=>'text', + 'name'=>'username', + 'id'=>'text_username', + 'maxlength'=>$username_length, + 'title'=>__('User name'), + 'required'=>'required' + ) + ); + + $html .= self::getHtmlForAddUserInputDiv( + array('text'=>__('Password:'), 'for'=>"text_pma_pw"), + array( + 'type'=>'password', + 'name'=>'pma_pw', + 'id'=>'text_pma_pw', + 'title'=>__('Password'), + 'required'=>'required' + ) + ); + + $html .= self::getHtmlForAddUserInputDiv( + array('text'=>__('Host:'), 'for'=>"text_hostname"), + array( + 'type'=>'text', + 'name'=>'hostname', + 'id'=>'text_hostname', + 'maxlength'=>$hostname_length, + 'value'=>'', + 'required'=>'required' + ) + ); + + $html .= self::getHtmlForAddUserInputDiv( + array('text'=>__('Port:'), 'for'=>"text_port"), + array( + 'type'=>'number', + 'name'=>'text_port', + 'id'=>'text_port', + 'maxlength'=>6, + 'value'=>'3306', + 'required'=>'required' + ) + ); + + $html .= '
    '; + $html .= ' '; + $html .= '
    '; + + return $html; + } + + /** + * returns HTML code for Add user input div + * + * @param array $label_array label tag elements + * @param array $input_array input tag elements + * + * @return String HTML code + */ + public static function getHtmlForAddUserInputDiv(array $label_array, array $input_array) + { + $html = '
    '; + $html .= ' '; + + $html .= ' $value) { + $html .= ' ' . $key . '="' . $value . '" '; + } + $html .= ' />'; + $html .= '
    '; + return $html; + } + + /** + * This function returns html code for table with replication status. + * + * @param string $type either master or slave + * @param boolean $hidden if true, then default style is set to hidden, + * default value false + * @param boolean $title if true, then title is displayed, default true + * + * @return String HTML code + */ + public static function getHtmlForReplicationStatusTable($type, $hidden = false, $title = true) + { + global ${"{$type}_variables"}; + global ${"{$type}_variables_alerts"}; + global ${"{$type}_variables_oks"}; + global ${"server_{$type}_replication"}; + global ${"strReplicationStatus_{$type}"}; + + $html = ''; + + // TODO check the Masters server id? + // seems to default to '1' when queried via SHOW VARIABLES , + // but resulted in error on the master when slave connects + // [ERROR] Error reading packet from server: Misconfigured master + // - server id was not set ( server_errno=1236) + // [ERROR] Got fatal error 1236: 'Misconfigured master + // - server id was not set' from master when reading data from binary log + // + //$server_id = $GLOBALS['dbi']->fetchValue( + // "SHOW VARIABLES LIKE 'server_id'", 0, 1 + //); + + $html .= '
    '; + + if ($title) { + if ($type == 'master') { + $html .= '

    '; + $html .= __('Master status') . '

    '; + } else { + $html .= '

    '; + $html .= __('Slave status') . '

    '; + } + } else { + $html .= '
    '; + } + + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + + foreach (${"{$type}_variables"} as $variable) { + $serverReplicationVariable = + is_array(${"server_{$type}_replication"}) && isset(${"server_{$type}_replication"}[0]) + ? ${"server_{$type}_replication"}[0][$variable] : ''; + + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + } + + $html .= ' '; + $html .= '
    ' . __('Variable') . '' . __('Value') . '
    '; + $html .= htmlspecialchars($variable); + $html .= ' '; + + // TODO change to regexp or something, to allow for negative match + if (isset(${"{$type}_variables_alerts"}[$variable]) + && ${"{$type}_variables_alerts"}[$variable] == $serverReplicationVariable + ) { + $html .= ''; + + } elseif (isset(${"{$type}_variables_oks"}[$variable]) + && ${"{$type}_variables_oks"}[$variable] == $serverReplicationVariable + ) { + $html .= ''; + } else { + $html .= ''; + } + // allow wrapping long table lists into multiple lines + static $variables_wrap = array( + 'Replicate_Do_DB', 'Replicate_Ignore_DB', + 'Replicate_Do_Table', 'Replicate_Ignore_Table', + 'Replicate_Wild_Do_Table', 'Replicate_Wild_Ignore_Table'); + if (in_array($variable, $variables_wrap)) { + $html .= htmlspecialchars(str_replace( + ',', + ', ', + $serverReplicationVariable + )); + } else { + $html .= htmlspecialchars($serverReplicationVariable); + } + $html .= ''; + + $html .= '
    '; + $html .= '
    '; + $html .= '
    '; + + return $html; + } + + /** + * returns html code for table with slave users connected to this master + * + * @param boolean $hidden - if true, then default style is set to hidden, + * - default value false + * + * @return string + */ + public static function getHtmlForReplicationSlavesTable($hidden = false) + { + $html = ''; + // Fetch data + $data = $GLOBALS['dbi']->fetchResult('SHOW SLAVE HOSTS', null, null); + + $html .= '
    '; + $html .= '
    '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + + foreach ($data as $slave) { + $html .= ' '; + $html .= ' '; + $html .= ' '; + $html .= ' '; + } + + $html .= ' '; + $html .= '
    ' . __('Server ID') . '' . __('Host') . '
    ' . $slave['Server_id'] . '' . $slave['Host'] . '
    '; + $html .= '
    '; + $html .= Message::notice( + __( + 'Only slaves started with the ' + . '--report-host=host_name option are visible in this list.' + ) + )->getDisplay(); + $html .= '
    '; + $html .= '
    '; + + return $html; + } + + /** + * get the correct username and hostname lengths for this MySQL server + * + * @return array username length, hostname length + */ + public static function getUsernameHostnameLength() + { + $fields_info = $GLOBALS['dbi']->getColumns('mysql', 'user'); + $username_length = 16; + $hostname_length = 41; + foreach ($fields_info as $val) { + if ($val['Field'] == 'User') { + strtok($val['Type'], '()'); + $v = strtok('()'); + if (is_int($v)) { + $username_length = $v; + } + } elseif ($val['Field'] == 'Host') { + strtok($val['Type'], '()'); + $v = strtok('()'); + if (is_int($v)) { + $hostname_length = $v; + } + } + } + return array($username_length, $hostname_length); + } + + /** + * returns html code to add a replication slave user to the master + * + * @return String HTML code + */ + public static function getHtmlForReplicationMasterAddSlaveUser() + { + $html = ''; + list($username_length, $hostname_length) + = self::getUsernameHostnameLength(); + + if (isset($_POST['username']) && strlen($_POST['username']) === 0) { + $GLOBALS['pred_username'] = 'any'; + } + $html .= '
    '; + $html .= '
    ' . __('Add slave replication user') . '' + . self::getHtmlForAddUserLoginForm($username_length) + . '
    ' + . '' + . '' + . ' ' + . '' + . '' + . ' ' + . '' + . '
    ' + . '' + . '' + . ' ' + . '' + . '' + . '
    '; + + return $html; + } + + /** + * returns HTML for TableInfoForm + * + * @param int $hostname_length Selected hostname length + * + * @return String HTML code + */ + public static function getHtmlForTableInfoForm($hostname_length) + { + $html = ' ' + . ' ' + . ' ' + . '
    ' + . '' + . Util::showHint( + __( + 'When Host table is used, this field is ignored ' + . 'and values stored in Host table are used instead.' + ) + ) + . '
    ' + . '
    ' + . '' + . '' + . ' ' + . '' + . '' + . '
    ' + . '
    ' + . '' + . ' ' + . '' + . '
    ' + . '
    ' + . '' + . '' + . ' ' + . '' + . '' + . '
    ' + . ''; + $html .= ''; + return $html; + } + + /** + * handle control requests + * + * @return NULL + */ + public static function handleControlRequest() + { + if (isset($_POST['sr_take_action'])) { + $refresh = false; + $result = false; + $messageSuccess = null; + $messageError = null; + + if (isset($_POST['slave_changemaster']) && ! $GLOBALS['cfg']['AllowArbitraryServer']) { + $_SESSION['replication']['sr_action_status'] = 'error'; + $_SESSION['replication']['sr_action_info'] = __('Connection to server is disabled, please enable $cfg[\'AllowArbitraryServer\'] in phpMyAdmin configuration.'); + } elseif (isset($_POST['slave_changemaster'])) { + $result = self::handleRequestForSlaveChangeMaster(); + } elseif (isset($_POST['sr_slave_server_control'])) { + $result = self::handleRequestForSlaveServerControl(); + $refresh = true; + + switch ($_POST['sr_slave_action']) { + case 'start': + $messageSuccess = __('Replication started successfully.'); + $messageError = __('Error starting replication.'); + break; + case 'stop': + $messageSuccess = __('Replication stopped successfully.'); + $messageError = __('Error stopping replication.'); + break; + case 'reset': + $messageSuccess = __('Replication resetting successfully.'); + $messageError = __('Error resetting replication.'); + break; + default: + $messageSuccess = __('Success.'); + $messageError = __('Error.'); + break; + } + } elseif (isset($_POST['sr_slave_skip_error'])) { + $result = self::handleRequestForSlaveSkipError(); + } + + if ($refresh) { + $response = Response::getInstance(); + if ($response->isAjax()) { + $response->setRequestStatus($result); + $response->addJSON( + 'message', + $result + ? Message::success($messageSuccess) + : Message::error($messageError) + ); + } else { + Core::sendHeaderLocation( + './server_replication.php' + . Url::getCommonRaw($GLOBALS['url_params']) + ); + } + } + unset($refresh); + } + } + + /** + * handle control requests for Slave Change Master + * + * @return boolean + */ + public static function handleRequestForSlaveChangeMaster() + { + $sr = array(); + $_SESSION['replication']['m_username'] = $sr['username'] + = $GLOBALS['dbi']->escapeString($_POST['username']); + $_SESSION['replication']['m_password'] = $sr['pma_pw'] + = $GLOBALS['dbi']->escapeString($_POST['pma_pw']); + $_SESSION['replication']['m_hostname'] = $sr['hostname'] + = $GLOBALS['dbi']->escapeString($_POST['hostname']); + $_SESSION['replication']['m_port'] = $sr['port'] + = $GLOBALS['dbi']->escapeString($_POST['text_port']); + $_SESSION['replication']['m_correct'] = ''; + $_SESSION['replication']['sr_action_status'] = 'error'; + $_SESSION['replication']['sr_action_info'] = __('Unknown error'); + + // Attempt to connect to the new master server + $link_to_master = Replication::connectToMaster( + $sr['username'], $sr['pma_pw'], $sr['hostname'], $sr['port'] + ); + + if (! $link_to_master) { + $_SESSION['replication']['sr_action_status'] = 'error'; + $_SESSION['replication']['sr_action_info'] = sprintf( + __('Unable to connect to master %s.'), + htmlspecialchars($sr['hostname']) + ); + } else { + // Read the current master position + $position = Replication::slaveBinLogMaster($link_to_master); + + if (empty($position)) { + $_SESSION['replication']['sr_action_status'] = 'error'; + $_SESSION['replication']['sr_action_info'] + = __( + 'Unable to read master log position. ' + . 'Possible privilege problem on master.' + ); + } else { + $_SESSION['replication']['m_correct'] = true; + + if (! Replication::slaveChangeMaster( + $sr['username'], + $sr['pma_pw'], + $sr['hostname'], + $sr['port'], + $position, + true, + false + ) + ) { + $_SESSION['replication']['sr_action_status'] = 'error'; + $_SESSION['replication']['sr_action_info'] + = __('Unable to change master!'); + } else { + $_SESSION['replication']['sr_action_status'] = 'success'; + $_SESSION['replication']['sr_action_info'] = sprintf( + __('Master server changed successfully to %s.'), + htmlspecialchars($sr['hostname']) + ); + } + } + } + + return $_SESSION['replication']['sr_action_status'] === 'success'; + } + + /** + * handle control requests for Slave Server Control + * + * @return boolean + */ + public static function handleRequestForSlaveServerControl() + { + if (empty($_POST['sr_slave_control_parm'])) { + $_POST['sr_slave_control_parm'] = null; + } + if ($_POST['sr_slave_action'] == 'reset') { + $qStop = Replication::slaveControl("STOP", null, DatabaseInterface::CONNECT_USER); + $qReset = $GLOBALS['dbi']->tryQuery("RESET SLAVE;"); + $qStart = Replication::slaveControl("START", null, DatabaseInterface::CONNECT_USER); + + $result = ($qStop !== false && $qStop !== -1 && + $qReset !== false && $qReset !== -1 && + $qStart !== false && $qStart !== -1); + } else { + $qControl = Replication::slaveControl( + $_POST['sr_slave_action'], + $_POST['sr_slave_control_parm'], + DatabaseInterface::CONNECT_USER + ); + + $result = ($qControl !== false && $qControl !== -1); + } + + return $result; + } + + /** + * handle control requests for Slave Skip Error + * + * @return boolean + */ + public static function handleRequestForSlaveSkipError() + { + $count = 1; + if (isset($_POST['sr_skip_errors_count'])) { + $count = $_POST['sr_skip_errors_count'] * 1; + } + + $qStop = Replication::slaveControl("STOP", null, DatabaseInterface::CONNECT_USER); + $qSkip = $GLOBALS['dbi']->tryQuery( + "SET GLOBAL SQL_SLAVE_SKIP_COUNTER = " . $count . ";" + ); + $qStart = Replication::slaveControl("START", null, DatabaseInterface::CONNECT_USER); + + $result = ($qStop !== false && $qStop !== -1 && + $qSkip !== false && $qSkip !== -1 && + $qStart !== false && $qStart !== -1); + + return $result; + } +} diff --git a/phpMyAdmin/libraries/classes/Response.php b/phpMyAdmin/libraries/classes/Response.php new file mode 100755 index 0000000..4594e46 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Response.php @@ -0,0 +1,572 @@ +start(); + register_shutdown_function(array($this, 'response')); + } + $this->_header = new Header(); + $this->_HTML = ''; + $this->_JSON = array(); + $this->_footer = new Footer(); + + $this->_isSuccess = true; + $this->_isDisabled = false; + $this->setAjax(! empty($_REQUEST['ajax_request'])); + $this->_CWD = getcwd(); + } + + /** + * Set the ajax flag to indicate whether + * we are servicing an ajax request + * + * @param bool $isAjax Whether we are servicing an ajax request + * + * @return void + */ + public function setAjax($isAjax) + { + $this->_isAjax = (boolean) $isAjax; + $this->_header->setAjax($this->_isAjax); + $this->_footer->setAjax($this->_isAjax); + } + + /** + * Returns the singleton Response object + * + * @return Response object + */ + public static function getInstance() + { + if (empty(self::$_instance)) { + self::$_instance = new Response(); + } + return self::$_instance; + } + + /** + * Set the status of an ajax response, + * whether it is a success or an error + * + * @param bool $state Whether the request was successfully processed + * + * @return void + */ + public function setRequestStatus($state) + { + $this->_isSuccess = ($state == true); + } + + /** + * Returns true or false depending on whether + * we are servicing an ajax request + * + * @return bool + */ + public function isAjax() + { + return $this->_isAjax; + } + + /** + * Returns the path to the current working directory + * Necessary to work around a PHP bug where the CWD is + * reset after the initial script exits + * + * @return string + */ + public function getCWD() + { + return $this->_CWD; + } + + /** + * Disables the rendering of the header + * and the footer in responses + * + * @return void + */ + public function disable() + { + $this->_header->disable(); + $this->_footer->disable(); + $this->_isDisabled = true; + } + + /** + * Returns a PhpMyAdmin\Header object + * + * @return Header + */ + public function getHeader() + { + return $this->_header; + } + + /** + * Returns a PhpMyAdmin\Footer object + * + * @return Footer + */ + public function getFooter() + { + return $this->_footer; + } + + /** + * Add HTML code to the response + * + * @param string $content A string to be appended to + * the current output buffer + * + * @return void + */ + public function addHTML($content) + { + if (is_array($content)) { + foreach ($content as $msg) { + $this->addHTML($msg); + } + } elseif ($content instanceof Message) { + $this->_HTML .= $content->getDisplay(); + } else { + $this->_HTML .= $content; + } + } + + /** + * Add JSON code to the response + * + * @param mixed $json Either a key (string) or an + * array or key-value pairs + * @param mixed $value Null, if passing an array in $json otherwise + * it's a string value to the key + * + * @return void + */ + public function addJSON($json, $value = null) + { + if (is_array($json)) { + foreach ($json as $key => $value) { + $this->addJSON($key, $value); + } + } else { + if ($value instanceof Message) { + $this->_JSON[$json] = $value->getDisplay(); + } else { + $this->_JSON[$json] = $value; + } + } + + } + + /** + * Renders the HTML response text + * + * @return string + */ + private function _getDisplay() + { + // The header may contain nothing at all, + // if its content was already rendered + // and, in this case, the header will be + // in the content part of the request + $retval = $this->_header->getDisplay(); + $retval .= $this->_HTML; + $retval .= $this->_footer->getDisplay(); + return $retval; + } + + /** + * Sends an HTML response to the browser + * + * @return void + */ + private function _htmlResponse() + { + echo $this->_getDisplay(); + } + + /** + * Sends a JSON response to the browser + * + * @return void + */ + private function _ajaxResponse() + { + /* Avoid wrapping in case we're disabled */ + if ($this->_isDisabled) { + echo $this->_getDisplay(); + return; + } + + if (! isset($this->_JSON['message'])) { + $this->_JSON['message'] = $this->_getDisplay(); + } elseif ($this->_JSON['message'] instanceof Message) { + $this->_JSON['message'] = $this->_JSON['message']->getDisplay(); + } + + if ($this->_isSuccess) { + $this->_JSON['success'] = true; + } else { + $this->_JSON['success'] = false; + $this->_JSON['error'] = $this->_JSON['message']; + unset($this->_JSON['message']); + } + + if ($this->_isSuccess) { + $this->addJSON('_title', $this->getHeader()->getTitleTag()); + + if (isset($GLOBALS['dbi'])) { + $menuHash = $this->getHeader()->getMenu()->getHash(); + $this->addJSON('_menuHash', $menuHash); + $hashes = array(); + if (isset($_REQUEST['menuHashes'])) { + $hashes = explode('-', $_REQUEST['menuHashes']); + } + if (! in_array($menuHash, $hashes)) { + $this->addJSON( + '_menu', + $this->getHeader() + ->getMenu() + ->getDisplay() + ); + } + } + + $this->addJSON('_scripts', $this->getHeader()->getScripts()->getFiles()); + $this->addJSON('_selflink', $this->getFooter()->getSelfUrl()); + $this->addJSON('_displayMessage', $this->getHeader()->getMessage()); + + $debug = $this->_footer->getDebugMessage(); + if (empty($_REQUEST['no_debug']) + && strlen($debug) > 0 + ) { + $this->addJSON('_debug', $debug); + } + + $errors = $this->_footer->getErrorMessages(); + if (strlen($errors) > 0) { + $this->addJSON('_errors', $errors); + } + $promptPhpErrors = $GLOBALS['error_handler']->hasErrorsForPrompt(); + $this->addJSON('_promptPhpErrors', $promptPhpErrors); + + if (empty($GLOBALS['error_message'])) { + // set current db, table and sql query in the querywindow + // (this is for the bottom console) + $query = ''; + $maxChars = $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']; + if (isset($GLOBALS['sql_query']) + && mb_strlen($GLOBALS['sql_query']) < $maxChars + ) { + $query = $GLOBALS['sql_query']; + } + $this->addJSON( + '_reloadQuerywindow', + array( + 'db' => Core::ifSetOr($GLOBALS['db'], ''), + 'table' => Core::ifSetOr($GLOBALS['table'], ''), + 'sql_query' => $query + ) + ); + if (! empty($GLOBALS['focus_querywindow'])) { + $this->addJSON('_focusQuerywindow', $query); + } + if (! empty($GLOBALS['reload'])) { + $this->addJSON('_reloadNavigation', 1); + } + $this->addJSON('_params', $this->getHeader()->getJsParams()); + } + } + + // Set the Content-Type header to JSON so that jQuery parses the + // response correctly. + Core::headerJSON(); + + $result = json_encode($this->_JSON); + if ($result === false) { + switch (json_last_error()) { + case JSON_ERROR_NONE: + $error = 'No errors'; + break; + case JSON_ERROR_DEPTH: + $error = 'Maximum stack depth exceeded'; + break; + case JSON_ERROR_STATE_MISMATCH: + $error = 'Underflow or the modes mismatch'; + break; + case JSON_ERROR_CTRL_CHAR: + $error = 'Unexpected control character found'; + break; + case JSON_ERROR_SYNTAX: + $error = 'Syntax error, malformed JSON'; + break; + case JSON_ERROR_UTF8: + $error = 'Malformed UTF-8 characters, possibly incorrectly encoded'; + break; + case JSON_ERROR_RECURSION: + $error = 'One or more recursive references in the value to be encoded'; + break; + case JSON_ERROR_INF_OR_NAN: + $error = 'One or more NAN or INF values in the value to be encoded'; + break; + case JSON_ERROR_UNSUPPORTED_TYPE: + $error = 'A value of a type that cannot be encoded was given'; + default: + $error = 'Unknown error'; + break; + } + echo json_encode( + array( + 'success' => false, + 'error' => 'JSON encoding failed: ' . $error, + ) + ); + } else { + echo $result; + } + } + + /** + * Sends an HTML response to the browser + * + * @return void + */ + public function response() + { + chdir($this->getCWD()); + $buffer = OutputBuffering::getInstance(); + if (empty($this->_HTML)) { + $this->_HTML = $buffer->getContents(); + } + if ($this->isAjax()) { + $this->_ajaxResponse(); + } else { + $this->_htmlResponse(); + } + $buffer->flush(); + exit; + } + + /** + * Wrapper around PHP's header() function. + * + * @param string $text header string + * + * @return void + */ + public function header($text) + { + header($text); + } + + /** + * Wrapper around PHP's headers_sent() function. + * + * @return bool + */ + public function headersSent() + { + return headers_sent(); + } + + /** + * Wrapper around PHP's http_response_code() function. + * + * @param int $response_code will set the response code. + * + * @return void + */ + public function httpResponseCode($response_code) + { + http_response_code($response_code); + } + + /** + * Sets http response code. + * + * @param int $response_code will set the response code. + * + * @return void + */ + public function setHttpResponseCode($response_code) + { + $this->httpResponseCode($response_code); + switch ($response_code) { + case 100: $httpStatusMsg = ' Continue'; break; + case 101: $httpStatusMsg = ' Switching Protocols'; break; + case 200: $httpStatusMsg = ' OK'; break; + case 201: $httpStatusMsg = ' Created'; break; + case 202: $httpStatusMsg = ' Accepted'; break; + case 203: $httpStatusMsg = ' Non-Authoritative Information'; break; + case 204: $httpStatusMsg = ' No Content'; break; + case 205: $httpStatusMsg = ' Reset Content'; break; + case 206: $httpStatusMsg = ' Partial Content'; break; + case 300: $httpStatusMsg = ' Multiple Choices'; break; + case 301: $httpStatusMsg = ' Moved Permanently'; break; + case 302: $httpStatusMsg = ' Moved Temporarily'; break; + case 303: $httpStatusMsg = ' See Other'; break; + case 304: $httpStatusMsg = ' Not Modified'; break; + case 305: $httpStatusMsg = ' Use Proxy'; break; + case 400: $httpStatusMsg = ' Bad Request'; break; + case 401: $httpStatusMsg = ' Unauthorized'; break; + case 402: $httpStatusMsg = ' Payment Required'; break; + case 403: $httpStatusMsg = ' Forbidden'; break; + case 404: $httpStatusMsg = ' Not Found'; break; + case 405: $httpStatusMsg = ' Method Not Allowed'; break; + case 406: $httpStatusMsg = ' Not Acceptable'; break; + case 407: $httpStatusMsg = ' Proxy Authentication Required'; break; + case 408: $httpStatusMsg = ' Request Time-out'; break; + case 409: $httpStatusMsg = ' Conflict'; break; + case 410: $httpStatusMsg = ' Gone'; break; + case 411: $httpStatusMsg = ' Length Required'; break; + case 412: $httpStatusMsg = ' Precondition Failed'; break; + case 413: $httpStatusMsg = ' Request Entity Too Large'; break; + case 414: $httpStatusMsg = ' Request-URI Too Large'; break; + case 415: $httpStatusMsg = ' Unsupported Media Type'; break; + case 500: $httpStatusMsg = ' Internal Server Error'; break; + case 501: $httpStatusMsg = ' Not Implemented'; break; + case 502: $httpStatusMsg = ' Bad Gateway'; break; + case 503: $httpStatusMsg = ' Service Unavailable'; break; + case 504: $httpStatusMsg = ' Gateway Time-out'; break; + case 505: $httpStatusMsg = ' HTTP Version not supported'; break; + default: $httpStatusMsg = ' Web server is down'; break; + } + if (php_sapi_name() !== 'cgi-fcgi') { + $this->header('status: ' . $response_code . $httpStatusMsg); + } + } + + /** + * Generate header for 303 + * + * @param string $location will set location to redirect. + * + * @return void + */ + public function generateHeader303($location) + { + $this->setHttpResponseCode(303); + $this->header('Location: '.$location); + if (!defined('TESTSUITE')) { + exit; + } + } + + /** + * Configures response for the login page + * + * @return bool Whether caller should exit + */ + public function loginPage() + { + /* Handle AJAX redirection */ + if ($this->isAjax()) { + $this->setRequestStatus(false); + // redirect_flag redirects to the login page + $this->addJSON('redirect_flag', '1'); + return true; + } + + $this->getFooter()->setMinimal(); + $header = $this->getHeader(); + $header->setBodyId('loginform'); + $header->setTitle('phpMyAdmin'); + $header->disableMenuAndConsole(); + $header->disableWarnings(); + return false; + } +} diff --git a/phpMyAdmin/libraries/classes/Rte/Events.php b/phpMyAdmin/libraries/classes/Rte/Events.php new file mode 100755 index 0000000..0306b1d --- /dev/null +++ b/phpMyAdmin/libraries/classes/Rte/Events.php @@ -0,0 +1,629 @@ + array('ENABLE', + 'DISABLE', + 'DISABLE ON SLAVE'), + 'display' => array('ENABLED', + 'DISABLED', + 'SLAVESIDE_DISABLED') + ); + $event_type = array('RECURRING', + 'ONE TIME'); + $event_interval = array('YEAR', + 'QUARTER', + 'MONTH', + 'DAY', + 'HOUR', + 'MINUTE', + 'WEEK', + 'SECOND', + 'YEAR_MONTH', + 'DAY_HOUR', + 'DAY_MINUTE', + 'DAY_SECOND', + 'HOUR_MINUTE', + 'HOUR_SECOND', + 'MINUTE_SECOND'); + } + + /** + * Main function for the events functionality + * + * @return void + */ + public static function main() + { + global $db; + + self::setGlobals(); + /** + * Process all requests + */ + self::handleEditor(); + Export::events(); + /** + * Display a list of available events + */ + $items = $GLOBALS['dbi']->getEvents($db); + echo RteList::get('event', $items); + /** + * Display a link for adding a new event, if + * the user has the privileges and a link to + * toggle the state of the event scheduler. + */ + echo Footer::events(); + } // end self::main() + + /** + * Handles editor requests for adding or editing an item + * + * @return void + */ + public static function handleEditor() + { + global $_REQUEST, $_POST, $errors, $db; + + if (! empty($_POST['editor_process_add']) + || ! empty($_POST['editor_process_edit']) + ) { + $sql_query = ''; + + $item_query = self::getQueryFromRequest(); + + if (! count($errors)) { // set by PhpMyAdmin\Rte\Routines::getQueryFromRequest() + // Execute the created query + if (! empty($_POST['editor_process_edit'])) { + // Backup the old trigger, in case something goes wrong + $create_item = $GLOBALS['dbi']->getDefinition( + $db, + 'EVENT', + $_POST['item_original_name'] + ); + $drop_item = "DROP EVENT " + . Util::backquote($_POST['item_original_name']) + . ";\n"; + $result = $GLOBALS['dbi']->tryQuery($drop_item); + if (! $result) { + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($drop_item) + ) + . '
    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + } else { + $result = $GLOBALS['dbi']->tryQuery($item_query); + if (! $result) { + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($item_query) + ) + . '
    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + // We dropped the old item, but were unable to create + // the new one. Try to restore the backup query + $result = $GLOBALS['dbi']->tryQuery($create_item); + $errors = General::checkResult( + $result, + __( + 'Sorry, we failed to restore the dropped event.' + ), + $create_item, + $errors + ); + } else { + $message = Message::success( + __('Event %1$s has been modified.') + ); + $message->addParam( + Util::backquote($_POST['item_name']) + ); + $sql_query = $drop_item . $item_query; + } + } + } else { + // 'Add a new item' mode + $result = $GLOBALS['dbi']->tryQuery($item_query); + if (! $result) { + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($item_query) + ) + . '

    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + } else { + $message = Message::success( + __('Event %1$s has been created.') + ); + $message->addParam( + Util::backquote($_POST['item_name']) + ); + $sql_query = $item_query; + } + } + } + + if (count($errors)) { + $message = Message::error( + '' + . __( + 'One or more errors have occurred while processing your request:' + ) + . '' + ); + $message->addHtml('
      '); + foreach ($errors as $string) { + $message->addHtml('
    • ' . $string . '
    • '); + } + $message->addHtml('
    '); + } + + $output = Util::getMessage($message, $sql_query); + $response = Response::getInstance(); + if ($response->isAjax()) { + if ($message->isSuccess()) { + $events = $GLOBALS['dbi']->getEvents($db, $_POST['item_name']); + $event = $events[0]; + $response->addJSON( + 'name', + htmlspecialchars( + mb_strtoupper($_POST['item_name']) + ) + ); + if (! empty($event)) { + $response->addJSON('new_row', RteList::getEventRow($event)); + } + $response->addJSON('insert', ! empty($event)); + $response->addJSON('message', $output); + } else { + $response->setRequestStatus(false); + $response->addJSON('message', $message); + } + exit; + } + } + /** + * Display a form used to add/edit a trigger, if necessary + */ + if (count($errors) + || (empty($_POST['editor_process_add']) + && empty($_POST['editor_process_edit']) + && (! empty($_REQUEST['add_item']) + || ! empty($_REQUEST['edit_item']) + || ! empty($_POST['item_changetype']))) + ) { // FIXME: this must be simpler than that + $operation = ''; + if (! empty($_POST['item_changetype'])) { + $operation = 'change'; + } + // Get the data for the form (if any) + if (! empty($_REQUEST['add_item'])) { + $title = Words::get('add'); + $item = self::getDataFromRequest(); + $mode = 'add'; + } elseif (! empty($_REQUEST['edit_item'])) { + $title = __("Edit event"); + if (! empty($_REQUEST['item_name']) + && empty($_POST['editor_process_edit']) + && empty($_POST['item_changetype']) + ) { + $item = self::getDataFromName($_REQUEST['item_name']); + if ($item !== false) { + $item['item_original_name'] = $item['item_name']; + } + } else { + $item = self::getDataFromRequest(); + } + $mode = 'edit'; + } + General::sendEditor('EVN', $mode, $item, $title, $db, $operation); + } + } // end self::handleEditor() + + /** + * This function will generate the values that are required to for the editor + * + * @return array Data necessary to create the editor. + */ + public static function getDataFromRequest() + { + $retval = array(); + $indices = array('item_name', + 'item_original_name', + 'item_status', + 'item_execute_at', + 'item_interval_value', + 'item_interval_field', + 'item_starts', + 'item_ends', + 'item_definition', + 'item_preserve', + 'item_comment', + 'item_definer'); + foreach ($indices as $index) { + $retval[$index] = isset($_POST[$index]) ? $_POST[$index] : ''; + } + $retval['item_type'] = 'ONE TIME'; + $retval['item_type_toggle'] = 'RECURRING'; + if (isset($_POST['item_type']) && $_POST['item_type'] == 'RECURRING') { + $retval['item_type'] = 'RECURRING'; + $retval['item_type_toggle'] = 'ONE TIME'; + } + return $retval; + } // end self::getDataFromRequest() + + /** + * This function will generate the values that are required to complete + * the "Edit event" form given the name of a event. + * + * @param string $name The name of the event. + * + * @return array Data necessary to create the editor. + */ + public static function getDataFromName($name) + { + global $db; + + $retval = array(); + $columns = "`EVENT_NAME`, `STATUS`, `EVENT_TYPE`, `EXECUTE_AT`, " + . "`INTERVAL_VALUE`, `INTERVAL_FIELD`, `STARTS`, `ENDS`, " + . "`EVENT_DEFINITION`, `ON_COMPLETION`, `DEFINER`, `EVENT_COMMENT`"; + $where = "EVENT_SCHEMA " . Util::getCollateForIS() . "=" + . "'" . $GLOBALS['dbi']->escapeString($db) . "' " + . "AND EVENT_NAME='" . $GLOBALS['dbi']->escapeString($name) . "'"; + $query = "SELECT $columns FROM `INFORMATION_SCHEMA`.`EVENTS` WHERE $where;"; + $item = $GLOBALS['dbi']->fetchSingleRow($query); + if (! $item) { + return false; + } + $retval['item_name'] = $item['EVENT_NAME']; + $retval['item_status'] = $item['STATUS']; + $retval['item_type'] = $item['EVENT_TYPE']; + if ($retval['item_type'] == 'RECURRING') { + $retval['item_type_toggle'] = 'ONE TIME'; + } else { + $retval['item_type_toggle'] = 'RECURRING'; + } + $retval['item_execute_at'] = $item['EXECUTE_AT']; + $retval['item_interval_value'] = $item['INTERVAL_VALUE']; + $retval['item_interval_field'] = $item['INTERVAL_FIELD']; + $retval['item_starts'] = $item['STARTS']; + $retval['item_ends'] = $item['ENDS']; + $retval['item_preserve'] = ''; + if ($item['ON_COMPLETION'] == 'PRESERVE') { + $retval['item_preserve'] = " checked='checked'"; + } + $retval['item_definition'] = $item['EVENT_DEFINITION']; + $retval['item_definer'] = $item['DEFINER']; + $retval['item_comment'] = $item['EVENT_COMMENT']; + + return $retval; + } // end self::getDataFromName() + + /** + * Displays a form used to add/edit an event + * + * @param string $mode If the editor will be used to edit an event + * or add a new one: 'edit' or 'add'. + * @param string $operation If the editor was previously invoked with + * JS turned off, this will hold the name of + * the current operation + * @param array $item Data for the event returned by + * self::getDataFromRequest() or + * self::getDataFromName() + * + * @return string HTML code for the editor. + */ + public static function getEditorForm($mode, $operation, array $item) + { + global $db, $table, $event_status, $event_type, $event_interval; + + $modeToUpper = mb_strtoupper($mode); + + $response = Response::getInstance(); + + // Escape special characters + $need_escape = array( + 'item_original_name', + 'item_name', + 'item_type', + 'item_execute_at', + 'item_interval_value', + 'item_starts', + 'item_ends', + 'item_definition', + 'item_definer', + 'item_comment' + ); + foreach ($need_escape as $index) { + $item[$index] = htmlentities($item[$index], ENT_QUOTES); + } + $original_data = ''; + if ($mode == 'edit') { + $original_data = "\n"; + } + // Handle some logic first + if ($operation == 'change') { + if ($item['item_type'] == 'RECURRING') { + $item['item_type'] = 'ONE TIME'; + $item['item_type_toggle'] = 'RECURRING'; + } else { + $item['item_type'] = 'RECURRING'; + $item['item_type_toggle'] = 'ONE TIME'; + } + } + if ($item['item_type'] == 'ONE TIME') { + $isrecurring_class = ' hide'; + $isonetime_class = ''; + } else { + $isrecurring_class = ''; + $isonetime_class = ' hide'; + } + // Create the output + $retval = ""; + $retval .= "\n\n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= $original_data; + $retval .= Url::getHiddenInputs($db, $table) . "\n"; + $retval .= "
    \n"; + $retval .= "" . __('Details') . "\n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "\n"; + + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + + return $retval; + } // end self::getParameterRow() + + /** + * Displays a form used to add/edit a routine + * + * @param string $mode If the editor will be used to edit a routine + * or add a new one: 'edit' or 'add'. + * @param string $operation If the editor was previously invoked with + * JS turned off, this will hold the name of + * the current operation + * @param array $routine Data for the routine returned by + * self::getDataFromRequest() or + * self::getDataFromName() + * + * @return string HTML code for the editor. + */ + public static function getEditorForm($mode, $operation, array $routine) + { + global $db, $errors, $param_sqldataaccess, $param_opts_num; + + $response = Response::getInstance(); + + // Escape special characters + $need_escape = array( + 'item_original_name', + 'item_name', + 'item_returnlength', + 'item_definition', + 'item_definer', + 'item_comment' + ); + foreach ($need_escape as $key => $index) { + $routine[$index] = htmlentities($routine[$index], ENT_QUOTES, 'UTF-8'); + } + for ($i = 0; $i < $routine['item_num_params']; $i++) { + $routine['item_param_name'][$i] = htmlentities( + $routine['item_param_name'][$i], + ENT_QUOTES + ); + $routine['item_param_length'][$i] = htmlentities( + $routine['item_param_length'][$i], + ENT_QUOTES + ); + } + + // Handle some logic first + if ($operation == 'change') { + if ($routine['item_type'] == 'PROCEDURE') { + $routine['item_type'] = 'FUNCTION'; + $routine['item_type_toggle'] = 'PROCEDURE'; + } else { + $routine['item_type'] = 'PROCEDURE'; + $routine['item_type_toggle'] = 'FUNCTION'; + } + } elseif ($operation == 'add' + || ($routine['item_num_params'] == 0 && $mode == 'add' && ! $errors) + ) { + $routine['item_param_dir'][] = ''; + $routine['item_param_name'][] = ''; + $routine['item_param_type'][] = ''; + $routine['item_param_length'][] = ''; + $routine['item_param_opts_num'][] = ''; + $routine['item_param_opts_text'][] = ''; + $routine['item_num_params']++; + } elseif ($operation == 'remove') { + unset($routine['item_param_dir'][$routine['item_num_params'] - 1]); + unset($routine['item_param_name'][$routine['item_num_params'] - 1]); + unset($routine['item_param_type'][$routine['item_num_params'] - 1]); + unset($routine['item_param_length'][$routine['item_num_params'] - 1]); + unset($routine['item_param_opts_num'][$routine['item_num_params'] - 1]); + unset($routine['item_param_opts_text'][$routine['item_num_params'] - 1]); + $routine['item_num_params']--; + } + $disableRemoveParam = ''; + if (! $routine['item_num_params']) { + $disableRemoveParam = " color: gray;' disabled='disabled"; + } + $original_routine = ''; + if ($mode == 'edit') { + $original_routine = "\n" + . "\n"; + } + $isfunction_class = ''; + $isprocedure_class = ''; + $isfunction_select = ''; + $isprocedure_select = ''; + if ($routine['item_type'] == 'PROCEDURE') { + $isfunction_class = ' hide'; + $isprocedure_select = " selected='selected'"; + } else { + $isprocedure_class = ' hide'; + $isfunction_select = " selected='selected'"; + } + + // Create the output + $retval = ""; + $retval .= "\n\n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= $original_routine; + $retval .= Url::getHiddenInputs($db) . "\n"; + $retval .= "
    \n"; + $retval .= "" . __('Details') . "\n"; + $retval .= "
    " . __('Event name') . "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "
    " . __('Event type') . "\n"; + if ($response->isAjax()) { + $retval .= " \n"; + } else { + $retval .= " \n"; + $retval .= " {$item['item_type']}\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " $value) { + $selected = ""; + if (! empty($item['item_interval_field']) + && $item['item_interval_field'] == $value + ) { + $selected = " selected='selected'"; + } + $retval .= "$value"; + } + $retval .= " \n"; + $retval .= "
    " . _pgettext('Start of recurring event', 'Start'); + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "
    " . __('On completion preserve') . "\n"; + $retval .= " \n"; + $retval .= " isAjax()) { + $retval .= "\n"; + $retval .= "\n"; + } + $retval .= "\n\n"; + $retval .= "\n\n"; + + return $retval; + } // end self::getEditorForm() + + /** + * Composes the query necessary to create an event from an HTTP request. + * + * @return string The CREATE EVENT query. + */ + public static function getQueryFromRequest() + { + global $_REQUEST, $errors, $event_status, $event_type, $event_interval; + + $query = 'CREATE '; + if (! empty($_POST['item_definer'])) { + if (mb_strpos($_POST['item_definer'], '@') !== false + ) { + $arr = explode('@', $_POST['item_definer']); + $query .= 'DEFINER=' . Util::backquote($arr[0]); + $query .= '@' . Util::backquote($arr[1]) . ' '; + } else { + $errors[] = __('The definer must be in the "username@hostname" format!'); + } + } + $query .= 'EVENT '; + if (! empty($_POST['item_name'])) { + $query .= Util::backquote($_POST['item_name']) . ' '; + } else { + $errors[] = __('You must provide an event name!'); + } + $query .= 'ON SCHEDULE '; + if (! empty($_POST['item_type']) + && in_array($_POST['item_type'], $event_type) + ) { + if ($_POST['item_type'] == 'RECURRING') { + if (! empty($_POST['item_interval_value']) + && !empty($_POST['item_interval_field']) + && in_array($_POST['item_interval_field'], $event_interval) + ) { + $query .= 'EVERY ' . intval($_POST['item_interval_value']) . ' '; + $query .= $_POST['item_interval_field'] . ' '; + } else { + $errors[] + = __('You must provide a valid interval value for the event.'); + } + if (! empty($_POST['item_starts'])) { + $query .= "STARTS '" + . $GLOBALS['dbi']->escapeString($_POST['item_starts']) + . "' "; + } + if (! empty($_POST['item_ends'])) { + $query .= "ENDS '" + . $GLOBALS['dbi']->escapeString($_POST['item_ends']) + . "' "; + } + } else { + if (! empty($_POST['item_execute_at'])) { + $query .= "AT '" + . $GLOBALS['dbi']->escapeString($_POST['item_execute_at']) + . "' "; + } else { + $errors[] + = __('You must provide a valid execution time for the event.'); + } + } + } else { + $errors[] = __('You must provide a valid type for the event.'); + } + $query .= 'ON COMPLETION '; + if (empty($_POST['item_preserve'])) { + $query .= 'NOT '; + } + $query .= 'PRESERVE '; + if (! empty($_POST['item_status'])) { + foreach ($event_status['display'] as $key => $value) { + if ($value == $_POST['item_status']) { + $query .= $event_status['query'][$key] . ' '; + break; + } + } + } + if (! empty($_POST['item_comment'])) { + $query .= "COMMENT '" . $GLOBALS['dbi']->escapeString( + $_POST['item_comment'] + ) . "' "; + } + $query .= 'DO '; + if (! empty($_POST['item_definition'])) { + $query .= $_POST['item_definition']; + } else { + $errors[] = __('You must provide an event definition.'); + } + + return $query; + } // end self::getQueryFromRequest() +} diff --git a/phpMyAdmin/libraries/classes/Rte/Export.php b/phpMyAdmin/libraries/classes/Rte/Export.php new file mode 100755 index 0000000..731b050 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Rte/Export.php @@ -0,0 +1,145 @@ +isAjax()) { + $response->addJSON('message', $export_data); + $response->addJSON('title', $title); + exit; + } else { + $export_data = ''; + echo "
    \n" + , "$title\n" + , $export_data + , "
    \n"; + } + } else { + $_db = htmlspecialchars(Util::backquote($db)); + $message = __('Error in processing request:') . ' ' + . sprintf(Words::get('no_view'), $item_name, $_db); + $message = Message::error($message); + + if ($response->isAjax()) { + $response->setRequestStatus(false); + $response->addJSON('message', $message); + exit; + } else { + $message->display(); + } + } + } // end self::handle() + + /** + * If necessary, prepares event information and passes + * it to self::handle() for the actual export. + * + * @return void + */ + public static function events() + { + global $_GET, $db; + + if (! empty($_GET['export_item']) && ! empty($_GET['item_name'])) { + $item_name = $_GET['item_name']; + $export_data = $GLOBALS['dbi']->getDefinition($db, 'EVENT', $item_name); + if (! $export_data) { + $export_data = false; + } + self::handle($export_data); + } + } // end self::events() + + /** + * If necessary, prepares routine information and passes + * it to self::handle() for the actual export. + * + * @return void + */ + public static function routines() + { + global $_GET, $db; + + if (! empty($_GET['export_item']) + && ! empty($_GET['item_name']) + && ! empty($_GET['item_type']) + ) { + if ($_GET['item_type'] == 'FUNCTION' || $_GET['item_type'] == 'PROCEDURE') { + $rtn_definition + = $GLOBALS['dbi']->getDefinition( + $db, + $_GET['item_type'], + $_GET['item_name'] + ); + if (! $rtn_definition) { + $export_data = false; + } else { + $export_data = "DELIMITER $$\n" + . $rtn_definition + . "$$\nDELIMITER ;\n"; + } + + self::handle($export_data); + } + } + } // end self::routines() + + /** + * If necessary, prepares trigger information and passes + * it to self::handle() for the actual export. + * + * @return void + */ + public static function triggers() + { + global $_GET, $db, $table; + + if (! empty($_GET['export_item']) && ! empty($_GET['item_name'])) { + $item_name = $_GET['item_name']; + $triggers = $GLOBALS['dbi']->getTriggers($db, $table, ''); + $export_data = false; + foreach ($triggers as $trigger) { + if ($trigger['name'] === $item_name) { + $export_data = $trigger['create']; + break; + } + } + self::handle($export_data); + } + } // end self::triggers() +} diff --git a/phpMyAdmin/libraries/classes/Rte/Footer.php b/phpMyAdmin/libraries/classes/Rte/Footer.php new file mode 100755 index 0000000..2fdb258 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Rte/Footer.php @@ -0,0 +1,137 @@ +\n"; + $retval .= "
    \n"; + $retval .= "" . _pgettext('Create new procedure', 'New') . "\n"; + $retval .= " \n"; + $retval .= "
    \n"; + $retval .= "\n\n"; + + return $retval; + } // end self::getLinks() + + /** + * Creates a fieldset for adding a new routine, if the user has the privileges. + * + * @return string HTML code with containing the footer fieldset + */ + public static function routines() + { + return self::getLinks('CREATE_PROCEDURE', 'CREATE ROUTINE', 'ROUTINE'); + }// end self::routines() + + /** + * Creates a fieldset for adding a new trigger, if the user has the privileges. + * + * @return string HTML code with containing the footer fieldset + */ + public static function triggers() + { + return self::getLinks('CREATE_TRIGGER', 'TRIGGER', 'TRIGGER'); + } // end self::triggers() + + /** + * Creates a fieldset for adding a new event, if the user has the privileges. + * + * @return string HTML code with containing the footer fieldset + */ + public static function events() + { + global $db, $url_query; + + /** + * For events, we show the usual 'Add event' form and also + * a form for toggling the state of the event scheduler + */ + // Init options for the event scheduler toggle functionality + $es_state = $GLOBALS['dbi']->fetchValue( + "SHOW GLOBAL VARIABLES LIKE 'event_scheduler'", + 0, + 1 + ); + $es_state = mb_strtolower($es_state); + $options = array( + 0 => array( + 'label' => __('OFF'), + 'value' => "SET GLOBAL event_scheduler=\"OFF\"", + 'selected' => ($es_state != 'on') + ), + 1 => array( + 'label' => __('ON'), + 'value' => "SET GLOBAL event_scheduler=\"ON\"", + 'selected' => ($es_state == 'on') + ) + ); + // Generate output + $retval = "\n"; + $retval .= "
    \n"; + // show the usual footer + $retval .= self::getLinks('CREATE_EVENT', 'EVENT', 'EVENT'); + $retval .= "
    \n"; + $retval .= " \n"; + $retval .= " " . __('Event scheduler status') . "\n"; + $retval .= " \n"; + $retval .= "
    \n"; + // show the toggle button + $retval .= Util::toggleButton( + "sql.php$url_query&goto=db_events.php" . urlencode("?db=$db"), + 'sql_query', + $options, + 'PMA_slidingMessage(data.sql_query);' + ); + $retval .= "
    \n"; + $retval .= "
    \n"; + $retval .= "
    \n"; + $retval .= "
    "; + $retval .= "\n"; + + return $retval; + } // end self::events() +} diff --git a/phpMyAdmin/libraries/classes/Rte/General.php b/phpMyAdmin/libraries/classes/Rte/General.php new file mode 100755 index 0000000..9b13380 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Rte/General.php @@ -0,0 +1,100 @@ +' + . __('The backed up query was:') + . "\"" . htmlspecialchars($createStatement) . "\"" . '
    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + + return $errors; + } + + /** + * Send TRI or EVN editor via ajax or by echoing. + * + * @param string $type TRI or EVN + * @param string $mode Editor mode 'add' or 'edit' + * @param array $item Data necessary to create the editor + * @param string $title Title of the editor + * @param string $db Database + * @param string $operation Operation 'change' or '' + * + * @return void + */ + public static function sendEditor($type, $mode, array $item, $title, $db, $operation = null) + { + $response = Response::getInstance(); + if ($item !== false) { + // Show form + if ($type == 'TRI') { + $editor = Triggers::getEditorForm($mode, $item); + } else { // EVN + $editor = Events::getEditorForm($mode, $operation, $item); + } + if ($response->isAjax()) { + $response->addJSON('message', $editor); + $response->addJSON('title', $title); + } else { + echo "\n\n

    $title

    \n\n$editor"; + unset($_POST); + } + exit; + } else { + $message = __('Error in processing request:') . ' '; + $message .= sprintf( + Words::get('not_found'), + htmlspecialchars(Util::backquote($_REQUEST['item_name'])), + htmlspecialchars(Util::backquote($db)) + ); + $message = Message::error($message); + if ($response->isAjax()) { + $response->setRequestStatus(false); + $response->addJSON('message', $message); + exit; + } else { + $message->display(); + } + } + } +} diff --git a/phpMyAdmin/libraries/classes/Rte/Routines.php b/phpMyAdmin/libraries/classes/Rte/Routines.php new file mode 100755 index 0000000..5c49f70 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Rte/Routines.php @@ -0,0 +1,1722 @@ +getRoutines($db, $type); + echo RteList::get('routine', $items); + /** + * Display the form for adding a new routine, if the user has the privileges. + */ + echo Footer::routines(); + /** + * Display a warning for users with PHP's old "mysql" extension. + */ + if (! DatabaseInterface::checkDbExtension('mysqli')) { + trigger_error( + __( + 'You are using PHP\'s deprecated \'mysql\' extension, ' + . 'which is not capable of handling multi queries. ' + . '[strong]The execution of some stored routines may fail![/strong] ' + . 'Please use the improved \'mysqli\' extension to ' + . 'avoid any problems.' + ), + E_USER_WARNING + ); + } + } // end self::main() + + /** + * Handles editor requests for adding or editing an item + * + * @return void + */ + public static function handleEditor() + { + global $_GET, $_POST, $_REQUEST, $GLOBALS, $db, $errors; + + $errors = self::handleRequestCreateOrEdit($errors, $db); + $response = Response::getInstance(); + + /** + * Display a form used to add/edit a routine, if necessary + */ + // FIXME: this must be simpler than that + if (count($errors) + || ( empty($_POST['editor_process_add']) + && empty($_POST['editor_process_edit']) + && (! empty($_REQUEST['add_item']) || ! empty($_REQUEST['edit_item']) + || ! empty($_POST['routine_addparameter']) + || ! empty($_POST['routine_removeparameter']) + || ! empty($_POST['routine_changetype']))) + ) { + // Handle requests to add/remove parameters and changing routine type + // This is necessary when JS is disabled + $operation = ''; + if (! empty($_POST['routine_addparameter'])) { + $operation = 'add'; + } elseif (! empty($_POST['routine_removeparameter'])) { + $operation = 'remove'; + } elseif (! empty($_POST['routine_changetype'])) { + $operation = 'change'; + } + // Get the data for the form (if any) + if (! empty($_REQUEST['add_item'])) { + $title = Words::get('add'); + $routine = self::getDataFromRequest(); + $mode = 'add'; + } elseif (! empty($_REQUEST['edit_item'])) { + $title = __("Edit routine"); + if (! $operation && ! empty($_GET['item_name']) + && empty($_POST['editor_process_edit']) + ) { + $routine = self::getDataFromName( + $_GET['item_name'], $_GET['item_type'] + ); + if ($routine !== false) { + $routine['item_original_name'] = $routine['item_name']; + $routine['item_original_type'] = $routine['item_type']; + } + } else { + $routine = self::getDataFromRequest(); + } + $mode = 'edit'; + } + if ($routine !== false) { + // Show form + $editor = self::getEditorForm($mode, $operation, $routine); + if ($response->isAjax()) { + $response->addJSON('message', $editor); + $response->addJSON('title', $title); + $response->addJSON('param_template', self::getParameterRow()); + $response->addJSON('type', $routine['item_type']); + } else { + echo "\n\n

    $title

    \n\n$editor"; + } + exit; + } else { + $message = __('Error in processing request:') . ' '; + $message .= sprintf( + Words::get('no_edit'), + htmlspecialchars( + Util::backquote($_REQUEST['item_name']) + ), + htmlspecialchars(Util::backquote($db)) + ); + + $message = Message::error($message); + if ($response->isAjax()) { + $response->setRequestStatus(false); + $response->addJSON('message', $message); + exit; + } else { + $message->display(); + } + } + } + } + + /** + * Handle request to create or edit a routine + * + * @param array $errors Errors + * @param string $db DB name + * + * @return array + */ + public static function handleRequestCreateOrEdit(array $errors, $db) + { + if (empty($_POST['editor_process_add']) + && empty($_POST['editor_process_edit']) + ) { + return $errors; + } + + $sql_query = ''; + $routine_query = self::getQueryFromRequest(); + if (!count($errors)) { // set by self::getQueryFromRequest() + // Execute the created query + if (!empty($_POST['editor_process_edit'])) { + $isProcOrFunc = in_array( + $_POST['item_original_type'], + array('PROCEDURE', 'FUNCTION') + ); + + if (!$isProcOrFunc) { + $errors[] = sprintf( + __('Invalid routine type: "%s"'), + htmlspecialchars($_POST['item_original_type']) + ); + } else { + // Backup the old routine, in case something goes wrong + $create_routine = $GLOBALS['dbi']->getDefinition( + $db, + $_POST['item_original_type'], + $_POST['item_original_name'] + ); + + $privilegesBackup = self::backupPrivileges(); + + $drop_routine = "DROP {$_POST['item_original_type']} " + . Util::backquote($_POST['item_original_name']) + . ";\n"; + $result = $GLOBALS['dbi']->tryQuery($drop_routine); + if (!$result) { + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($drop_routine) + ) + . '
    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + } else { + list($newErrors, $message) = self::create( + $routine_query, + $create_routine, + $privilegesBackup + ); + if (empty($newErrors)) { + $sql_query = $drop_routine . $routine_query; + } else { + $errors = array_merge($errors, $newErrors); + } + unset($newErrors); + if (null === $message) { + unset($message); + } + } + } + } else { + // 'Add a new routine' mode + $result = $GLOBALS['dbi']->tryQuery($routine_query); + if (!$result) { + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($routine_query) + ) + . '

    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + } else { + $message = Message::success( + __('Routine %1$s has been created.') + ); + $message->addParam( + Util::backquote($_POST['item_name']) + ); + $sql_query = $routine_query; + } + } + } + + if (count($errors)) { + $message = Message::error( + __( + 'One or more errors have occurred while' + . ' processing your request:' + ) + ); + $message->addHtml('
      '); + foreach ($errors as $string) { + $message->addHtml('
    • ' . $string . '
    • '); + } + $message->addHtml('
    '); + } + + $output = Util::getMessage($message, $sql_query); + $response = Response::getInstance(); + if (!$response->isAjax()) { + return $errors; + } + + if (!$message->isSuccess()) { + $response->setRequestStatus(false); + $response->addJSON('message', $output); + exit; + } + + $routines = $GLOBALS['dbi']->getRoutines( + $db, + $_POST['item_type'], + $_POST['item_name'] + ); + $routine = $routines[0]; + $response->addJSON( + 'name', + htmlspecialchars( + mb_strtoupper($_POST['item_name']) + ) + ); + $response->addJSON('new_row', RteList::getRoutineRow($routine)); + $response->addJSON('insert', !empty($routine)); + $response->addJSON('message', $output); + exit; + } + + /** + * Backup the privileges + * + * @return array + */ + public static function backupPrivileges() + { + if (! $GLOBALS['proc_priv'] || ! $GLOBALS['is_reload_priv']) { + return array(); + } + + // Backup the Old Privileges before dropping + // if $_POST['item_adjust_privileges'] set + if (! isset($_POST['item_adjust_privileges']) + || empty($_POST['item_adjust_privileges']) + ) { + return array(); + } + + $privilegesBackupQuery = 'SELECT * FROM ' . Util::backquote( + 'mysql' + ) + . '.' . Util::backquote('procs_priv') + . ' where Routine_name = "' . $_POST['item_original_name'] + . '" AND Routine_type = "' . $_POST['item_original_type'] + . '";'; + + $privilegesBackup = $GLOBALS['dbi']->fetchResult( + $privilegesBackupQuery, + 0 + ); + + return $privilegesBackup; + } + + /** + * Create the routine + * + * @param string $routine_query Query to create routine + * @param string $create_routine Query to restore routine + * @param array $privilegesBackup Privileges backup + * + * @return array + */ + public static function create( + $routine_query, + $create_routine, + array $privilegesBackup + ) { + $result = $GLOBALS['dbi']->tryQuery($routine_query); + if (!$result) { + $errors = array(); + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($routine_query) + ) + . '
    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + // We dropped the old routine, + // but were unable to create the new one + // Try to restore the backup query + $result = $GLOBALS['dbi']->tryQuery($create_routine); + $errors = General::checkResult( + $result, + __( + 'Sorry, we failed to restore' + . ' the dropped routine.' + ), + $create_routine, + $errors + ); + + return array($errors, null); + } + + // Default value + $resultAdjust = false; + + if ($GLOBALS['proc_priv'] + && $GLOBALS['is_reload_priv'] + ) { + // Insert all the previous privileges + // but with the new name and the new type + foreach ($privilegesBackup as $priv) { + $adjustProcPrivilege = 'INSERT INTO ' + . Util::backquote('mysql') . '.' + . Util::backquote('procs_priv') + . ' VALUES("' . $priv[0] . '", "' + . $priv[1] . '", "' . $priv[2] . '", "' + . $_POST['item_name'] . '", "' + . $_POST['item_type'] . '", "' + . $priv[5] . '", "' + . $priv[6] . '", "' + . $priv[7] . '");'; + $resultAdjust = $GLOBALS['dbi']->query( + $adjustProcPrivilege + ); + } + } + + $message = self::flushPrivileges($resultAdjust); + + return array(array(), $message); + } + + /** + * Flush privileges and get message + * + * @param bool $flushPrivileges Flush privileges + * + * @return Message + */ + public static function flushPrivileges($flushPrivileges) + { + if ($flushPrivileges) { + // Flush the Privileges + $flushPrivQuery = 'FLUSH PRIVILEGES;'; + $GLOBALS['dbi']->query($flushPrivQuery); + + $message = Message::success( + __( + 'Routine %1$s has been modified. Privileges have been adjusted.' + ) + ); + } else { + $message = Message::success( + __('Routine %1$s has been modified.') + ); + } + $message->addParam( + Util::backquote($_POST['item_name']) + ); + + return $message; + } // end self::handleEditor() + + /** + * This function will generate the values that are required to + * complete the editor form. It is especially necessary to handle + * the 'Add another parameter', 'Remove last parameter' and + * 'Change routine type' functionalities when JS is disabled. + * + * @return array Data necessary to create the routine editor. + */ + public static function getDataFromRequest() + { + global $_REQUEST, $param_directions, $param_sqldataaccess; + + $retval = array(); + $indices = array('item_name', + 'item_original_name', + 'item_returnlength', + 'item_returnopts_num', + 'item_returnopts_text', + 'item_definition', + 'item_comment', + 'item_definer'); + foreach ($indices as $index) { + $retval[$index] = isset($_POST[$index]) ? $_POST[$index] : ''; + } + + $retval['item_type'] = 'PROCEDURE'; + $retval['item_type_toggle'] = 'FUNCTION'; + if (isset($_REQUEST['item_type']) && $_REQUEST['item_type'] == 'FUNCTION') { + $retval['item_type'] = 'FUNCTION'; + $retval['item_type_toggle'] = 'PROCEDURE'; + } + $retval['item_original_type'] = 'PROCEDURE'; + if (isset($_POST['item_original_type']) + && $_POST['item_original_type'] == 'FUNCTION' + ) { + $retval['item_original_type'] = 'FUNCTION'; + } + $retval['item_num_params'] = 0; + $retval['item_param_dir'] = array(); + $retval['item_param_name'] = array(); + $retval['item_param_type'] = array(); + $retval['item_param_length'] = array(); + $retval['item_param_opts_num'] = array(); + $retval['item_param_opts_text'] = array(); + if (isset($_POST['item_param_name']) + && isset($_POST['item_param_type']) + && isset($_POST['item_param_length']) + && isset($_POST['item_param_opts_num']) + && isset($_POST['item_param_opts_text']) + && is_array($_POST['item_param_name']) + && is_array($_POST['item_param_type']) + && is_array($_POST['item_param_length']) + && is_array($_POST['item_param_opts_num']) + && is_array($_POST['item_param_opts_text']) + ) { + if ($_POST['item_type'] == 'PROCEDURE') { + $retval['item_param_dir'] = $_POST['item_param_dir']; + foreach ($retval['item_param_dir'] as $key => $value) { + if (! in_array($value, $param_directions, true)) { + $retval['item_param_dir'][$key] = ''; + } + } + } + $retval['item_param_name'] = $_POST['item_param_name']; + $retval['item_param_type'] = $_POST['item_param_type']; + foreach ($retval['item_param_type'] as $key => $value) { + if (! in_array($value, Util::getSupportedDatatypes(), true)) { + $retval['item_param_type'][$key] = ''; + } + } + $retval['item_param_length'] = $_POST['item_param_length']; + $retval['item_param_opts_num'] = $_POST['item_param_opts_num']; + $retval['item_param_opts_text'] = $_POST['item_param_opts_text']; + $retval['item_num_params'] = max( + count($retval['item_param_name']), + count($retval['item_param_type']), + count($retval['item_param_length']), + count($retval['item_param_opts_num']), + count($retval['item_param_opts_text']) + ); + } + $retval['item_returntype'] = ''; + if (isset($_POST['item_returntype']) + && in_array($_POST['item_returntype'], Util::getSupportedDatatypes()) + ) { + $retval['item_returntype'] = $_POST['item_returntype']; + } + + $retval['item_isdeterministic'] = ''; + if (isset($_POST['item_isdeterministic']) + && mb_strtolower($_POST['item_isdeterministic']) == 'on' + ) { + $retval['item_isdeterministic'] = " checked='checked'"; + } + $retval['item_securitytype_definer'] = ''; + $retval['item_securitytype_invoker'] = ''; + if (isset($_POST['item_securitytype'])) { + if ($_POST['item_securitytype'] === 'DEFINER') { + $retval['item_securitytype_definer'] = " selected='selected'"; + } elseif ($_POST['item_securitytype'] === 'INVOKER') { + $retval['item_securitytype_invoker'] = " selected='selected'"; + } + } + $retval['item_sqldataaccess'] = ''; + if (isset($_POST['item_sqldataaccess']) + && in_array($_POST['item_sqldataaccess'], $param_sqldataaccess, true) + ) { + $retval['item_sqldataaccess'] = $_POST['item_sqldataaccess']; + } + + return $retval; + } // end self::getDataFromRequest() + + /** + * This function will generate the values that are required to complete + * the "Edit routine" form given the name of a routine. + * + * @param string $name The name of the routine. + * @param string $type Type of routine (ROUTINE|PROCEDURE) + * @param bool $all Whether to return all data or just the info about parameters. + * + * @return array Data necessary to create the routine editor. + */ + public static function getDataFromName($name, $type, $all = true) + { + global $db; + + $retval = array(); + + // Build and execute the query + $fields = "SPECIFIC_NAME, ROUTINE_TYPE, DTD_IDENTIFIER, " + . "ROUTINE_DEFINITION, IS_DETERMINISTIC, SQL_DATA_ACCESS, " + . "ROUTINE_COMMENT, SECURITY_TYPE"; + $where = "ROUTINE_SCHEMA " . Util::getCollateForIS() . "=" + . "'" . $GLOBALS['dbi']->escapeString($db) . "' " + . "AND SPECIFIC_NAME='" . $GLOBALS['dbi']->escapeString($name) . "'" + . "AND ROUTINE_TYPE='" . $GLOBALS['dbi']->escapeString($type) . "'"; + $query = "SELECT $fields FROM INFORMATION_SCHEMA.ROUTINES WHERE $where;"; + + $routine = $GLOBALS['dbi']->fetchSingleRow($query, 'ASSOC'); + + if (! $routine) { + return false; + } + + // Get required data + $retval['item_name'] = $routine['SPECIFIC_NAME']; + $retval['item_type'] = $routine['ROUTINE_TYPE']; + + $definition + = $GLOBALS['dbi']->getDefinition( + $db, + $routine['ROUTINE_TYPE'], + $routine['SPECIFIC_NAME'] + ); + + if ($definition == null) { + return false; + } + + $parser = new Parser($definition); + + /** + * @var CreateStatement $stmt + */ + $stmt = $parser->statements[0]; + + $params = Routine::getParameters($stmt); + $retval['item_num_params'] = $params['num']; + $retval['item_param_dir'] = $params['dir']; + $retval['item_param_name'] = $params['name']; + $retval['item_param_type'] = $params['type']; + $retval['item_param_length'] = $params['length']; + $retval['item_param_length_arr'] = $params['length_arr']; + $retval['item_param_opts_num'] = $params['opts']; + $retval['item_param_opts_text'] = $params['opts']; + + // Get extra data + if (!$all) { + return $retval; + } + + if ($retval['item_type'] == 'FUNCTION') { + $retval['item_type_toggle'] = 'PROCEDURE'; + } else { + $retval['item_type_toggle'] = 'FUNCTION'; + } + $retval['item_returntype'] = ''; + $retval['item_returnlength'] = ''; + $retval['item_returnopts_num'] = ''; + $retval['item_returnopts_text'] = ''; + + if (! empty($routine['DTD_IDENTIFIER'])) { + $options = array(); + foreach ($stmt->return->options->options as $opt) { + $options[] = is_string($opt) ? $opt : $opt['value']; + } + + $retval['item_returntype'] = $stmt->return->name; + $retval['item_returnlength'] = implode(',', $stmt->return->parameters); + $retval['item_returnopts_num'] = implode(' ', $options); + $retval['item_returnopts_text'] = implode(' ', $options); + } + + $retval['item_definer'] = $stmt->options->has('DEFINER'); + $retval['item_definition'] = $routine['ROUTINE_DEFINITION']; + $retval['item_isdeterministic'] = ''; + if ($routine['IS_DETERMINISTIC'] == 'YES') { + $retval['item_isdeterministic'] = " checked='checked'"; + } + $retval['item_securitytype_definer'] = ''; + $retval['item_securitytype_invoker'] = ''; + if ($routine['SECURITY_TYPE'] == 'DEFINER') { + $retval['item_securitytype_definer'] = " selected='selected'"; + } elseif ($routine['SECURITY_TYPE'] == 'INVOKER') { + $retval['item_securitytype_invoker'] = " selected='selected'"; + } + $retval['item_sqldataaccess'] = $routine['SQL_DATA_ACCESS']; + $retval['item_comment'] = $routine['ROUTINE_COMMENT']; + + return $retval; + } // self::getDataFromName() + + /** + * Creates one row for the parameter table used in the routine editor. + * + * @param array $routine Data for the routine returned by + * self::getDataFromRequest() or + * self::getDataFromName() + * @param mixed $index Either a numeric index of the row being processed + * or NULL to create a template row for AJAX request + * @param string $class Class used to hide the direction column, if the + * row is for a stored function. + * + * @return string HTML code of one row of parameter table for the editor. + */ + public static function getParameterRow(array $routine = array(), $index = null, $class = '') + { + $titles = Util::buildActionTitles(); + global $param_directions, $param_opts_num; + + if ($index === null) { + // template row for AJAX request + $i = 0; + $index = '%s'; + $drop_class = ''; + $routine = array( + 'item_param_dir' => array(0 => ''), + 'item_param_name' => array(0 => ''), + 'item_param_type' => array(0 => ''), + 'item_param_length' => array(0 => ''), + 'item_param_opts_num' => array(0 => ''), + 'item_param_opts_text' => array(0 => '') + ); + } elseif (! empty($routine)) { + // regular row for routine editor + $drop_class = ' hide'; + $i = $index; + } else { + // No input data. This shouldn't happen, + // but better be safe than sorry. + return ''; + } + + // Create the output + $retval = ""; + $retval .= "
    " + . "" + . "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " ---\n"; + $retval .= Charsets::getCharsetDropdownBox( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['DisableIS'], + "item_param_opts_text[$index]", + null, + $routine['item_param_opts_text'][$i] + ); + $retval .= " ---\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " {$titles['Drop']}\n"; + $retval .= " \n"; + $retval .= "
    \n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " "; + $retval .= ""; + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + // parameter handling end + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= " "; + $retval .= ""; + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + if (isset($_REQUEST['edit_item']) + && ! empty($_REQUEST['edit_item']) + ) { + $retval .= ""; + $retval .= " "; + if ($GLOBALS['proc_priv'] + && $GLOBALS['is_reload_priv'] + ) { + $retval .= " "; + } else { + $retval .= " "; + } + $retval .= ""; + } + + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + $retval .= ""; + $retval .= " "; + $retval .= " "; + $retval .= ""; + $retval .= "
    " . __('Routine name') . "\n"; + $retval .= " \n"; + if ($response->isAjax()) { + $retval .= " \n"; + } else { + $retval .= "\n" + . "
    \n" + . $routine['item_type'] . "\n" + . "
    \n" + . "\n"; + } + $retval .= "
    " . __('Parameters') . "\n"; + // parameter handling start + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " "; + $retval .= " \n"; + $retval .= " \n"; + for ($i = 0; $i < $routine['item_num_params']; $i++) { // each parameter + $retval .= self::getParameterRow($routine, $i, $isprocedure_class); + } + $retval .= " \n"; + $retval .= "
    " + . __('Direction') . "" . __('Name') . "" . __('Type') . "" . __('Length/Values') . "" . __('Options') . " 
    "; + $retval .= "
     "; + $retval .= " "; + $retval .= " "; + $retval .= "
    " . __('Return type') . "
    " . __('Return length/values') . "---
    " . __('Return options') . "
    "; + $retval .= Charsets::getCharsetDropdownBox( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['DisableIS'], + "item_returnopts_text", + null, + $routine['item_returnopts_text'] + ); + $retval .= "
    "; + $retval .= "
    "; + $retval .= "
    ---
    "; + $retval .= "
    " . __('Definition') . "
    " . __('Is deterministic') . "
    " . __('Adjust privileges'); + $retval .= Util::showDocu('faq', 'faq6-39'); + $retval .= "
    " . __('Definer') . "
    " . __('Security type') . "
    " . __('SQL data access') . "
    " . __('Comment') . "
    "; + $retval .= "
    "; + if ($response->isAjax()) { + $retval .= ""; + $retval .= ""; + } + $retval .= ""; + $retval .= ""; + + return $retval; + } // end self::getEditorForm() + + /** + * Composes the query necessary to create a routine from an HTTP request. + * + * @return string The CREATE [ROUTINE | PROCEDURE] query. + */ + public static function getQueryFromRequest() + { + global $_REQUEST, $errors, $param_sqldataaccess, $param_directions, $dbi; + + $_POST['item_type'] = isset($_POST['item_type']) + ? $_POST['item_type'] : ''; + + $query = 'CREATE '; + if (! empty($_POST['item_definer'])) { + if (mb_strpos($_POST['item_definer'], '@') !== false) { + $arr = explode('@', $_POST['item_definer']); + + $do_backquote = true; + if (substr($arr[0], 0, 1) === "`" + && substr($arr[0], -1) === "`" + ) { + $do_backquote = false; + } + $query .= 'DEFINER=' . Util::backquote($arr[0], $do_backquote); + + $do_backquote = true; + if (substr($arr[1], 0, 1) === "`" + && substr($arr[1], -1) === "`" + ) { + $do_backquote = false; + } + $query .= '@' . Util::backquote($arr[1], $do_backquote) . ' '; + } else { + $errors[] = __('The definer must be in the "username@hostname" format!'); + } + } + if ($_POST['item_type'] == 'FUNCTION' + || $_POST['item_type'] == 'PROCEDURE' + ) { + $query .= $_POST['item_type'] . ' '; + } else { + $errors[] = sprintf( + __('Invalid routine type: "%s"'), + htmlspecialchars($_POST['item_type']) + ); + } + if (! empty($_POST['item_name'])) { + $query .= Util::backquote($_POST['item_name']); + } else { + $errors[] = __('You must provide a routine name!'); + } + $params = ''; + $warned_about_dir = false; + $warned_about_length = false; + + if (! empty($_POST['item_param_name']) + && ! empty($_POST['item_param_type']) + && ! empty($_POST['item_param_length']) + && is_array($_POST['item_param_name']) + && is_array($_POST['item_param_type']) + && is_array($_POST['item_param_length']) + ) { + $item_param_name = $_POST['item_param_name']; + $item_param_type = $_POST['item_param_type']; + $item_param_length = $_POST['item_param_length']; + + for ($i=0, $nb = count($item_param_name); $i < $nb; $i++) { + if (! empty($item_param_name[$i]) + && ! empty($item_param_type[$i]) + ) { + if ($_POST['item_type'] == 'PROCEDURE' + && ! empty($_POST['item_param_dir'][$i]) + && in_array($_POST['item_param_dir'][$i], $param_directions) + ) { + $params .= $_POST['item_param_dir'][$i] . " " + . Util::backquote($item_param_name[$i]) + . " " . $item_param_type[$i]; + } elseif ($_POST['item_type'] == 'FUNCTION') { + $params .= Util::backquote($item_param_name[$i]) + . " " . $item_param_type[$i]; + } elseif (! $warned_about_dir) { + $warned_about_dir = true; + $errors[] = sprintf( + __('Invalid direction "%s" given for parameter.'), + htmlspecialchars($_POST['item_param_dir'][$i]) + ); + } + if ($item_param_length[$i] != '' + && !preg_match( + '@^(DATE|TINYBLOB|TINYTEXT|BLOB|TEXT|' + . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|' + . 'SERIAL|BOOLEAN)$@i', + $item_param_type[$i] + ) + ) { + $params .= "(" . $item_param_length[$i] . ")"; + } elseif ($item_param_length[$i] == '' + && preg_match( + '@^(ENUM|SET|VARCHAR|VARBINARY)$@i', + $item_param_type[$i] + ) + ) { + if (! $warned_about_length) { + $warned_about_length = true; + $errors[] = __( + 'You must provide length/values for routine parameters' + . ' of type ENUM, SET, VARCHAR and VARBINARY.' + ); + } + } + if (! empty($_POST['item_param_opts_text'][$i])) { + if ($dbi->types->getTypeClass($item_param_type[$i]) == 'CHAR') { + if(! in_array($item_param_type[$i], array('VARBINARY', 'BINARY'))) { + $params .= ' CHARSET ' + . mb_strtolower( + $_POST['item_param_opts_text'][$i] + ); + } + } + } + if (! empty($_POST['item_param_opts_num'][$i])) { + if ($dbi->types->getTypeClass($item_param_type[$i]) == 'NUMBER') { + $params .= ' ' + . mb_strtoupper( + $_POST['item_param_opts_num'][$i] + ); + } + } + if ($i != (count($item_param_name) - 1)) { + $params .= ", "; + } + } else { + $errors[] = __( + 'You must provide a name and a type for each routine parameter.' + ); + break; + } + } + } + $query .= "(" . $params . ") "; + if ($_POST['item_type'] == 'FUNCTION') { + $item_returntype = isset($_POST['item_returntype']) + ? $_POST['item_returntype'] + : null; + + if (! empty($item_returntype) + && in_array( + $item_returntype, Util::getSupportedDatatypes() + ) + ) { + $query .= "RETURNS " . $item_returntype; + } else { + $errors[] = __('You must provide a valid return type for the routine.'); + } + if (! empty($_POST['item_returnlength']) + && !preg_match( + '@^(DATE|DATETIME|TIME|TINYBLOB|TINYTEXT|BLOB|TEXT|' + . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN)$@i', + $item_returntype + ) + ) { + $query .= "(" . $_POST['item_returnlength'] . ")"; + } elseif (empty($_POST['item_returnlength']) + && preg_match( + '@^(ENUM|SET|VARCHAR|VARBINARY)$@i', $item_returntype + ) + ) { + if (! $warned_about_length) { + $errors[] = __( + 'You must provide length/values for routine parameters' + . ' of type ENUM, SET, VARCHAR and VARBINARY.' + ); + } + } + if (! empty($_POST['item_returnopts_text'])) { + if ($dbi->types->getTypeClass($item_returntype) == 'CHAR') { + $query .= ' CHARSET ' + . mb_strtolower($_POST['item_returnopts_text']); + } + } + if (! empty($_POST['item_returnopts_num'])) { + if ($dbi->types->getTypeClass($item_returntype) == 'NUMBER') { + $query .= ' ' + . mb_strtoupper($_POST['item_returnopts_num']); + } + } + $query .= ' '; + } + if (! empty($_POST['item_comment'])) { + $query .= "COMMENT '" . $GLOBALS['dbi']->escapeString($_POST['item_comment']) + . "' "; + } + if (isset($_POST['item_isdeterministic'])) { + $query .= 'DETERMINISTIC '; + } else { + $query .= 'NOT DETERMINISTIC '; + } + if (! empty($_POST['item_sqldataaccess']) + && in_array($_POST['item_sqldataaccess'], $param_sqldataaccess) + ) { + $query .= $_POST['item_sqldataaccess'] . ' '; + } + if (! empty($_POST['item_securitytype'])) { + if ($_POST['item_securitytype'] == 'DEFINER' + || $_POST['item_securitytype'] == 'INVOKER' + ) { + $query .= 'SQL SECURITY ' . $_POST['item_securitytype'] . ' '; + } + } + if (! empty($_POST['item_definition'])) { + $query .= $_POST['item_definition']; + } else { + $errors[] = __('You must provide a routine definition.'); + } + + return $query; + } // end self::getQueryFromRequest() + + /** + * Handles requests for executing a routine + * + * @return void + */ + public static function handleExecute() + { + global $_GET, $_POST, $_REQUEST, $GLOBALS, $db; + + $response = Response::getInstance(); + + /** + * Handle all user requests other than the default of listing routines + */ + if (! empty($_POST['execute_routine']) && ! empty($_POST['item_name'])) { + // Build the queries + $routine = self::getDataFromName( + $_POST['item_name'], $_POST['item_type'], false + ); + if ($routine === false) { + $message = __('Error in processing request:') . ' '; + $message .= sprintf( + Words::get('not_found'), + htmlspecialchars(Util::backquote($_POST['item_name'])), + htmlspecialchars(Util::backquote($db)) + ); + $message = Message::error($message); + if ($response->isAjax()) { + $response->setRequestStatus(false); + $response->addJSON('message', $message); + exit; + } else { + echo $message->getDisplay(); + unset($_POST); + } + } + + $queries = array(); + $end_query = array(); + $args = array(); + $all_functions = $GLOBALS['dbi']->types->getAllFunctions(); + for ($i = 0; $i < $routine['item_num_params']; $i++) { + if (isset($_POST['params'][$routine['item_param_name'][$i]])) { + $value = $_POST['params'][$routine['item_param_name'][$i]]; + if (is_array($value)) { // is SET type + $value = implode(',', $value); + } + $value = $GLOBALS['dbi']->escapeString($value); + if (! empty($_POST['funcs'][$routine['item_param_name'][$i]]) + && in_array( + $_POST['funcs'][$routine['item_param_name'][$i]], + $all_functions + ) + ) { + $queries[] = "SET @p$i=" + . $_POST['funcs'][$routine['item_param_name'][$i]] + . "('$value');\n"; + } else { + $queries[] = "SET @p$i='$value';\n"; + } + $args[] = "@p$i"; + } else { + $args[] = "@p$i"; + } + if ($routine['item_type'] == 'PROCEDURE') { + if ($routine['item_param_dir'][$i] == 'OUT' + || $routine['item_param_dir'][$i] == 'INOUT' + ) { + $end_query[] = "@p$i AS " + . Util::backquote($routine['item_param_name'][$i]); + } + } + } + if ($routine['item_type'] == 'PROCEDURE') { + $queries[] = "CALL " . Util::backquote($routine['item_name']) + . "(" . implode(', ', $args) . ");\n"; + if (count($end_query)) { + $queries[] = "SELECT " . implode(', ', $end_query) . ";\n"; + } + } else { + $queries[] = "SELECT " . Util::backquote($routine['item_name']) + . "(" . implode(', ', $args) . ") " + . "AS " . Util::backquote($routine['item_name']) + . ";\n"; + } + + // Get all the queries as one SQL statement + $multiple_query = implode("", $queries); + + $outcome = true; + $affected = 0; + + // Execute query + if (! $GLOBALS['dbi']->tryMultiQuery($multiple_query)) { + $outcome = false; + } + + // Generate output + if ($outcome) { + + // Pass the SQL queries through the "pretty printer" + $output = Util::formatSql(implode($queries, "\n")); + + // Display results + $output .= "
    "; + $output .= sprintf( + __('Execution results of routine %s'), + Util::backquote(htmlspecialchars($routine['item_name'])) + ); + $output .= ""; + + $nbResultsetToDisplay = 0; + + do { + + $result = $GLOBALS['dbi']->storeResult(); + $num_rows = $GLOBALS['dbi']->numRows($result); + + if (($result !== false) && ($num_rows > 0)) { + + $output .= ""; + foreach ($GLOBALS['dbi']->getFieldsMeta($result) as $field) { + $output .= ""; + } + $output .= ""; + + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $output .= "" . self::browseRow($row) . ""; + } + + $output .= "
    "; + $output .= htmlspecialchars($field->name); + $output .= "
    "; + $nbResultsetToDisplay++; + $affected = $num_rows; + + } + + if (! $GLOBALS['dbi']->moreResults()) { + break; + } + + $output .= "
    "; + + $GLOBALS['dbi']->freeResult($result); + + } while ($outcome = $GLOBALS['dbi']->nextResult()); + } + + if ($outcome) { + + $output .= "
    "; + + $message = __('Your SQL query has been executed successfully.'); + if ($routine['item_type'] == 'PROCEDURE') { + $message .= '
    '; + + // TODO : message need to be modified according to the + // output from the routine + $message .= sprintf( + _ngettext( + '%d row affected by the last statement inside the ' + . 'procedure.', + '%d rows affected by the last statement inside the ' + . 'procedure.', + $affected + ), + $affected + ); + } + $message = Message::success($message); + + if ($nbResultsetToDisplay == 0) { + $notice = __( + 'MySQL returned an empty result set (i.e. zero rows).' + ); + $output .= Message::notice($notice)->getDisplay(); + } + + } else { + $output = ''; + $message = Message::error( + sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($multiple_query) + ) + . '

    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError() + ); + } + + // Print/send output + if ($response->isAjax()) { + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('message', $message->getDisplay() . $output); + $response->addJSON('dialog', false); + exit; + } else { + echo $message->getDisplay() , $output; + if ($message->isError()) { + // At least one query has failed, so shouldn't + // execute any more queries, so we quit. + exit; + } + unset($_POST); + // Now deliberately fall through to displaying the routines list + } + return; + } elseif (! empty($_GET['execute_dialog']) && ! empty($_GET['item_name'])) { + /** + * Display the execute form for a routine. + */ + $routine = self::getDataFromName( + $_GET['item_name'], $_GET['item_type'], true + ); + if ($routine !== false) { + $form = self::getExecuteForm($routine); + if ($response->isAjax()) { + $title = __("Execute routine") . " " . Util::backquote( + htmlentities($_GET['item_name'], ENT_QUOTES) + ); + $response->addJSON('message', $form); + $response->addJSON('title', $title); + $response->addJSON('dialog', true); + } else { + echo "\n\n

    " . __("Execute routine") . "

    \n\n"; + echo $form; + } + exit; + } elseif (($response->isAjax())) { + $message = __('Error in processing request:') . ' '; + $message .= sprintf( + Words::get('not_found'), + htmlspecialchars(Util::backquote($_GET['item_name'])), + htmlspecialchars(Util::backquote($db)) + ); + $message = Message::error($message); + + $response->setRequestStatus(false); + $response->addJSON('message', $message); + exit; + } + } + } + + /** + * Browse row array + * + * @param array $row Columns + * + * @return string + */ + private static function browseRow(array $row) + { + $output = null; + foreach ($row as $value) { + if ($value === null) { + $value = 'NULL'; + } else { + $value = htmlspecialchars($value); + } + $output .= "" . $value . ""; + } + return $output; + } + + /** + * Creates the HTML code that shows the routine execution dialog. + * + * @param array $routine Data for the routine returned by + * self::getDataFromName() + * + * @return string HTML code for the routine execution dialog. + */ + public static function getExecuteForm(array $routine) + { + global $db, $cfg; + + $response = Response::getInstance(); + + // Escape special characters + $routine['item_name'] = htmlentities($routine['item_name'], ENT_QUOTES); + for ($i = 0; $i < $routine['item_num_params']; $i++) { + $routine['item_param_name'][$i] = htmlentities( + $routine['item_param_name'][$i], + ENT_QUOTES + ); + } + + // Create the output + $retval = ""; + $retval .= "\n\n"; + $retval .= "
    isAjax()) { + $retval .= "{$routine['item_name']}\n"; + $retval .= "\n"; + $retval .= "\n"; + } else { + $retval .= "" . __('Routine parameters') . "\n"; + $retval .= "
    \n"; + $retval .= __('Routine parameters'); + $retval .= "
    \n"; + } + $retval .= "\n"; + $retval .= "\n"; + $retval .= "\n"; + if ($cfg['ShowFunctionFields']) { + $retval .= "\n"; + } + $retval .= "\n"; + $retval .= "\n"; + // Get a list of data types that are not yet supported. + $no_support_types = Util::unsupportedDatatypes(); + for ($i = 0; $i < $routine['item_num_params']; $i++) { // Each parameter + if ($routine['item_type'] == 'PROCEDURE' + && $routine['item_param_dir'][$i] == 'OUT' + ) { + continue; + } + $retval .= "\n\n"; + $retval .= "\n"; + $retval .= "\n"; + if ($cfg['ShowFunctionFields']) { + $retval .= "\n"; + } + // Append a class to date/time fields so that + // jQuery can attach a datepicker to them + $class = ''; + if ($routine['item_param_type'][$i] == 'DATETIME' + || $routine['item_param_type'][$i] == 'TIMESTAMP' + ) { + $class = 'datetimefield'; + } elseif ($routine['item_param_type'][$i] == 'DATE') { + $class = 'datefield'; + } + $retval .= "\n"; + $retval .= "\n"; + } + $retval .= "\n
    " . __('Name') . "" . __('Type') . "" . __('Function') . "" . __('Value') . "
    {$routine['item_param_name'][$i]}{$routine['item_param_type'][$i]}\n"; + if (stristr($routine['item_param_type'][$i], 'enum') + || stristr($routine['item_param_type'][$i], 'set') + || in_array( + mb_strtolower($routine['item_param_type'][$i]), + $no_support_types + ) + ) { + $retval .= "--\n"; + } else { + $field = array( + 'True_Type' => mb_strtolower( + $routine['item_param_type'][$i] + ), + 'Type' => '', + 'Key' => '', + 'Field' => '', + 'Default' => '', + 'first_timestamp' => false + ); + $retval .= ""; + } + $retval .= "\n"; + if (in_array($routine['item_param_type'][$i], array('ENUM', 'SET'))) { + if ($routine['item_param_type'][$i] == 'ENUM') { + $input_type = 'radio'; + } else { + $input_type = 'checkbox'; + } + foreach ($routine['item_param_length_arr'][$i] as $value) { + $value = htmlentities(Util::unquote($value), ENT_QUOTES); + $retval .= "" + . $value . "
    \n"; + } + } elseif (in_array( + mb_strtolower($routine['item_param_type'][$i]), + $no_support_types + )) { + $retval .= "\n"; + } else { + $retval .= "\n"; + } + $retval .= "
    \n"; + if (! $response->isAjax()) { + $retval .= "\n\n"; + $retval .= "
    \n"; + $retval .= " \n"; + $retval .= "
    \n"; + } else { + $retval .= ""; + $retval .= ""; + } + $retval .= "
    \n\n"; + $retval .= "\n\n"; + + return $retval; + } // end self::getExecuteForm() +} diff --git a/phpMyAdmin/libraries/classes/Rte/RteList.php b/phpMyAdmin/libraries/classes/Rte/RteList.php new file mode 100755 index 0000000..677a5c7 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Rte/RteList.php @@ -0,0 +1,498 @@ +\n"; + $retval .= '
    '; + $retval .= Url::getHiddenInputs($GLOBALS['db'], $GLOBALS['table']); + $retval .= "
    \n"; + $retval .= " \n"; + $retval .= " " . Words::get('title') . "\n"; + $retval .= " " + . Util::showMySQLDocu(Words::get('docu')) . "\n"; + $retval .= " \n"; + $retval .= "
    \n"; + $retval .= " " . Words::get('nothing') . "\n"; + $retval .= "
    \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + // th cells with a colspan need corresponding td cells, according to W3C + switch ($type) { + case 'routine': + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; // see comment above + for ($i = 0; $i < 7; $i++) { + $retval .= " \n"; + } + break; + case 'trigger': + $retval .= " \n"; + $retval .= " \n"; + if (empty($table)) { + $retval .= " \n"; + } + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; // see comment above + for ($i = 0; $i < (empty($table) ? 7 : 6); $i++) { + $retval .= " \n"; + } + break; + case 'event': + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; // see comment above + for ($i = 0; $i < 6; $i++) { + $retval .= " \n"; + } + break; + default: + break; + } + $retval .= " \n"; + $retval .= " \n"; + $count = 0; + $response = Response::getInstance(); + foreach ($items as $item) { + if ($response->isAjax() && empty($_REQUEST['ajax_page_request'])) { + $rowclass = 'ajaxInsert hide'; + } else { + $rowclass = ''; + } + // Get each row from the correct function + switch ($type) { + case 'routine': + $retval .= self::getRoutineRow($item, $rowclass); + break; + case 'trigger': + $retval .= self::getTriggerRow($item, $rowclass); + break; + case 'event': + $retval .= self::getEventRow($item, $rowclass); + break; + default: + break; + } + $count++; + } + $retval .= "
    " . __('Name') . "" . __('Action') . "" . __('Type') . "" . __('Returns') . "
    " . __('Name') . "" . __('Table') . "" . __('Action') . "" . __('Time') . "" . __('Event') . "
    " . __('Name') . "" . __('Status') . "" . __('Action') . "" . __('Type') . "
    \n"; + + if (count($items)) { + $retval .= '
    '; + $retval .= Template::get('select_all') + ->render( + array( + 'pma_theme_image' => $GLOBALS['pmaThemeImage'], + 'text_dir' => $GLOBALS['text_dir'], + 'form_name' => 'rteListForm', + ) + ); + $retval .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Export'), 'b_export', 'export' + ); + $retval .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Drop'), 'b_drop', 'drop' + ); + $retval .= '
    '; + } + + $retval .= "
    \n"; + $retval .= "
    \n"; + $retval .= "\n"; + + return $retval; + } // end self::get() + + /** + * Creates the contents for a row in the list of routines + * + * @param array $routine An array of routine data + * @param string $rowclass Additional class + * + * @return string HTML code of a row for the list of routines + */ + public static function getRoutineRow(array $routine, $rowclass = '') + { + global $url_query, $url_params, $db, $titles; + + $sql_drop = sprintf( + 'DROP %s IF EXISTS %s', + $routine['type'], + Util::backquote($routine['name']) + ); + $type_link = "item_type={$routine['type']}"; + + $retval = " \n"; + $retval .= " \n"; + $retval .= ' '; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " " + . htmlspecialchars($sql_drop) . "\n"; + $retval .= " \n"; + $retval .= " " + . htmlspecialchars($routine['name']) . "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + + // this is for our purpose to decide whether to + // show the edit link or not, so we need the DEFINER for the routine + $where = "ROUTINE_SCHEMA " . Util::getCollateForIS() . "=" + . "'" . $GLOBALS['dbi']->escapeString($db) . "' " + . "AND SPECIFIC_NAME='" . $GLOBALS['dbi']->escapeString($routine['name']) . "'" + . "AND ROUTINE_TYPE='" . $GLOBALS['dbi']->escapeString($routine['type']) . "'"; + $query = "SELECT `DEFINER` FROM INFORMATION_SCHEMA.ROUTINES WHERE $where;"; + $routine_definer = $GLOBALS['dbi']->fetchValue($query); + + $curr_user = $GLOBALS['dbi']->getCurrentUser(); + + // Since editing a procedure involved dropping and recreating, check also for + // CREATE ROUTINE privilege to avoid lost procedures. + if ((Util::currentUserHasPrivilege('CREATE ROUTINE', $db) + && $curr_user == $routine_definer) + || $GLOBALS['dbi']->isSuperuser() + ) { + $retval .= ' ' . $titles['Edit'] . "\n"; + } else { + $retval .= " {$titles['NoEdit']}\n"; + } + $retval .= " \n"; + $retval .= " \n"; + + // There is a problem with Util::currentUserHasPrivilege(): + // it does not detect all kinds of privileges, for example + // a direct privilege on a specific routine. So, at this point, + // we show the Execute link, hoping that the user has the correct rights. + // Also, information_schema might be hiding the ROUTINE_DEFINITION + // but a routine with no input parameters can be nonetheless executed. + + // Check if the routine has any input parameters. If it does, + // we will show a dialog to get values for these parameters, + // otherwise we can execute it directly. + + $definition = $GLOBALS['dbi']->getDefinition( + $db, $routine['type'], $routine['name'] + ); + if ($definition !== false) { + $parser = new Parser($definition); + + /** + * @var CreateStatement $stmt + */ + $stmt = $parser->statements[0]; + + $params = Routine::getParameters($stmt); + + if (Util::currentUserHasPrivilege('EXECUTE', $db)) { + $execute_action = 'execute_routine'; + for ($i = 0; $i < $params['num']; $i++) { + if ($routine['type'] == 'PROCEDURE' + && $params['dir'][$i] == 'OUT' + ) { + continue; + } + $execute_action = 'execute_dialog'; + break; + } + $query_part = $execute_action . '=1&item_name=' + . urlencode($routine['name']) . '&' . $type_link; + $retval .= ' ' . $titles['Execute'] . "\n"; + } else { + $retval .= " {$titles['NoExecute']}\n"; + } + } + + $retval .= " \n"; + $retval .= " \n"; + if ((Util::currentUserHasPrivilege('CREATE ROUTINE', $db) + && $curr_user == $routine_definer) + || $GLOBALS['dbi']->isSuperuser() + ) { + $retval .= ' ' . $titles['Export'] . "\n"; + } else { + $retval .= " {$titles['NoExport']}\n"; + } + $retval .= " \n"; + $retval .= " \n"; + $retval .= Util::linkOrButton( + 'sql.php', + array_merge( + $url_params, + ['sql_query' => $sql_drop, 'goto' => 'db_routines.php' . Url::getCommon(['db' => $db])] + ), + $titles['Drop'], + ['class' => 'ajax drop_anchor'] + ); + $retval .= " \n"; + $retval .= " \n"; + $retval .= " {$routine['type']}\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " " + . htmlspecialchars($routine['returns']) . "\n"; + $retval .= " \n"; + $retval .= " \n"; + + return $retval; + } // end self::getRoutineRow() + + /** + * Creates the contents for a row in the list of triggers + * + * @param array $trigger An array of routine data + * @param string $rowclass Additional class + * + * @return string HTML code of a cell for the list of triggers + */ + public static function getTriggerRow(array $trigger, $rowclass = '') + { + global $url_query, $url_params, $db, $table, $titles; + + $retval = " \n"; + $retval .= " \n"; + $retval .= ' '; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " " + . htmlspecialchars($trigger['drop']) . "\n"; + $retval .= " \n"; + $retval .= " " . htmlspecialchars($trigger['name']) . "\n"; + $retval .= " \n"; + $retval .= " \n"; + if (empty($table)) { + $retval .= " \n"; + $retval .= " $trigger['table']])) . "'>" + . htmlspecialchars($trigger['table']) . ""; + $retval .= " \n"; + } + $retval .= " \n"; + if (Util::currentUserHasPrivilege('TRIGGER', $db, $table)) { + $retval .= ' ' . $titles['Edit'] . "\n"; + } else { + $retval .= " {$titles['NoEdit']}\n"; + } + $retval .= " \n"; + $retval .= " \n"; + $retval .= ' ' . $titles['Export'] . "\n"; + $retval .= " \n"; + $retval .= " \n"; + if (Util::currentUserHasPrivilege('TRIGGER', $db)) { + $retval .= Util::linkOrButton( + 'sql.php', + array_merge( + $url_params, + ['sql_query' => $trigger['drop'], 'goto' => 'db_triggers.php' . Url::getCommon(['db' => $db])] + ), + $titles['Drop'], + ['class' => 'ajax drop_anchor'] + ); + } else { + $retval .= " {$titles['NoDrop']}\n"; + } + $retval .= " \n"; + $retval .= " \n"; + $retval .= " {$trigger['action_timing']}\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " {$trigger['event_manipulation']}\n"; + $retval .= " \n"; + $retval .= " \n"; + + return $retval; + } // end self::getTriggerRow() + + /** + * Creates the contents for a row in the list of events + * + * @param array $event An array of routine data + * @param string $rowclass Additional class + * + * @return string HTML code of a cell for the list of events + */ + public static function getEventRow(array $event, $rowclass = '') + { + global $url_query, $url_params, $db, $titles; + + $sql_drop = sprintf( + 'DROP EVENT IF EXISTS %s', + Util::backquote($event['name']) + ); + + $retval = " \n"; + $retval .= " \n"; + $retval .= ' '; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " " + . htmlspecialchars($sql_drop) . "\n"; + $retval .= " \n"; + $retval .= " " + . htmlspecialchars($event['name']) . "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= " {$event['status']}\n"; + $retval .= " \n"; + $retval .= " \n"; + if (Util::currentUserHasPrivilege('EVENT', $db)) { + $retval .= ' ' . $titles['Edit'] . "\n"; + } else { + $retval .= " {$titles['NoEdit']}\n"; + } + $retval .= " \n"; + $retval .= " \n"; + $retval .= ' ' . $titles['Export'] . "\n"; + $retval .= " \n"; + $retval .= " \n"; + if (Util::currentUserHasPrivilege('EVENT', $db)) { + $retval .= Util::linkOrButton( + 'sql.php', + array_merge( + $url_params, + ['sql_query' => $sql_drop, 'goto' => 'db_events.php' . Url::getCommon(['db' => $db])] + ), + $titles['Drop'], + ['class' => 'ajax drop_anchor'] + ); + } else { + $retval .= " {$titles['NoDrop']}\n"; + } + $retval .= " \n"; + $retval .= " \n"; + $retval .= " {$event['type']}\n"; + $retval .= " \n"; + $retval .= " \n"; + + return $retval; + } // end self::getEventRow() +} diff --git a/phpMyAdmin/libraries/classes/Rte/Triggers.php b/phpMyAdmin/libraries/classes/Rte/Triggers.php new file mode 100755 index 0000000..c79d3ec --- /dev/null +++ b/phpMyAdmin/libraries/classes/Rte/Triggers.php @@ -0,0 +1,478 @@ +getTriggers($db, $table); + echo RteList::get('trigger', $items); + /** + * Display a link for adding a new trigger, + * if the user has the necessary privileges + */ + echo Footer::triggers(); + } // end self::main() + + /** + * Handles editor requests for adding or editing an item + * + * @return void + */ + public static function handleEditor() + { + global $_REQUEST, $_POST, $errors, $db, $table; + + if (! empty($_POST['editor_process_add']) + || ! empty($_POST['editor_process_edit']) + ) { + $sql_query = ''; + + $item_query = self::getQueryFromRequest(); + + if (! count($errors)) { // set by PhpMyAdmin\Rte\Routines::getQueryFromRequest() + // Execute the created query + if (! empty($_POST['editor_process_edit'])) { + // Backup the old trigger, in case something goes wrong + $trigger = self::getDataFromName($_POST['item_original_name']); + $create_item = $trigger['create']; + $drop_item = $trigger['drop'] . ';'; + $result = $GLOBALS['dbi']->tryQuery($drop_item); + if (! $result) { + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($drop_item) + ) + . '
    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + } else { + $result = $GLOBALS['dbi']->tryQuery($item_query); + if (! $result) { + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($item_query) + ) + . '
    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + // We dropped the old item, but were unable to create the + // new one. Try to restore the backup query. + $result = $GLOBALS['dbi']->tryQuery($create_item); + + $errors = General::checkResult( + $result, + __( + 'Sorry, we failed to restore the dropped trigger.' + ), + $create_item, + $errors + ); + } else { + $message = Message::success( + __('Trigger %1$s has been modified.') + ); + $message->addParam( + Util::backquote($_POST['item_name']) + ); + $sql_query = $drop_item . $item_query; + } + } + } else { + // 'Add a new item' mode + $result = $GLOBALS['dbi']->tryQuery($item_query); + if (! $result) { + $errors[] = sprintf( + __('The following query has failed: "%s"'), + htmlspecialchars($item_query) + ) + . '

    ' + . __('MySQL said: ') . $GLOBALS['dbi']->getError(); + } else { + $message = Message::success( + __('Trigger %1$s has been created.') + ); + $message->addParam( + Util::backquote($_POST['item_name']) + ); + $sql_query = $item_query; + } + } + } + + if (count($errors)) { + $message = Message::error( + '' + . __( + 'One or more errors have occurred while processing your request:' + ) + . '' + ); + $message->addHtml('
      '); + foreach ($errors as $string) { + $message->addHtml('
    • ' . $string . '
    • '); + } + $message->addHtml('
    '); + } + + $output = Util::getMessage($message, $sql_query); + $response = Response::getInstance(); + if ($response->isAjax()) { + if ($message->isSuccess()) { + $items = $GLOBALS['dbi']->getTriggers($db, $table, ''); + $trigger = false; + foreach ($items as $value) { + if ($value['name'] == $_POST['item_name']) { + $trigger = $value; + } + } + $insert = false; + if (empty($table) + || ($trigger !== false && $table == $trigger['table']) + ) { + $insert = true; + $response->addJSON('new_row', RteList::getTriggerRow($trigger)); + $response->addJSON( + 'name', + htmlspecialchars( + mb_strtoupper( + $_POST['item_name'] + ) + ) + ); + } + $response->addJSON('insert', $insert); + $response->addJSON('message', $output); + } else { + $response->addJSON('message', $message); + $response->setRequestStatus(false); + } + exit; + } + } + + /** + * Display a form used to add/edit a trigger, if necessary + */ + if (count($errors) + || (empty($_POST['editor_process_add']) + && empty($_POST['editor_process_edit']) + && (! empty($_REQUEST['add_item']) + || ! empty($_REQUEST['edit_item']))) // FIXME: this must be simpler than that + ) { + // Get the data for the form (if any) + if (! empty($_REQUEST['add_item'])) { + $title = Words::get('add'); + $item = self::getDataFromRequest(); + $mode = 'add'; + } elseif (! empty($_REQUEST['edit_item'])) { + $title = __("Edit trigger"); + if (! empty($_REQUEST['item_name']) + && empty($_POST['editor_process_edit']) + ) { + $item = self::getDataFromName($_REQUEST['item_name']); + if ($item !== false) { + $item['item_original_name'] = $item['item_name']; + } + } else { + $item = self::getDataFromRequest(); + } + $mode = 'edit'; + } + General::sendEditor('TRI', $mode, $item, $title, $db); + } + } // end self::handleEditor() + + /** + * This function will generate the values that are required to for the editor + * + * @return array Data necessary to create the editor. + */ + public static function getDataFromRequest() + { + $retval = array(); + $indices = array('item_name', + 'item_table', + 'item_original_name', + 'item_action_timing', + 'item_event_manipulation', + 'item_definition', + 'item_definer'); + foreach ($indices as $index) { + $retval[$index] = isset($_POST[$index]) ? $_POST[$index] : ''; + } + return $retval; + } // end self::getDataFromRequest() + + /** + * This function will generate the values that are required to complete + * the "Edit trigger" form given the name of a trigger. + * + * @param string $name The name of the trigger. + * + * @return array Data necessary to create the editor. + */ + public static function getDataFromName($name) + { + global $db, $table, $_REQUEST; + + $temp = array(); + $items = $GLOBALS['dbi']->getTriggers($db, $table, ''); + foreach ($items as $value) { + if ($value['name'] == $name) { + $temp = $value; + } + } + if (empty($temp)) { + return false; + } else { + $retval = array(); + $retval['create'] = $temp['create']; + $retval['drop'] = $temp['drop']; + $retval['item_name'] = $temp['name']; + $retval['item_table'] = $temp['table']; + $retval['item_action_timing'] = $temp['action_timing']; + $retval['item_event_manipulation'] = $temp['event_manipulation']; + $retval['item_definition'] = $temp['definition']; + $retval['item_definer'] = $temp['definer']; + return $retval; + } + } // end self::getDataFromName() + + /** + * Displays a form used to add/edit a trigger + * + * @param string $mode If the editor will be used to edit a trigger + * or add a new one: 'edit' or 'add'. + * @param array $item Data for the trigger returned by self::getDataFromRequest() + * or self::getDataFromName() + * + * @return string HTML code for the editor. + */ + public static function getEditorForm($mode, array $item) + { + global $db, $table, $event_manipulations, $action_timings; + + $modeToUpper = mb_strtoupper($mode); + $response = Response::getInstance(); + + // Escape special characters + $need_escape = array( + 'item_original_name', + 'item_name', + 'item_definition', + 'item_definer' + ); + foreach ($need_escape as $key => $index) { + $item[$index] = htmlentities($item[$index], ENT_QUOTES, 'UTF-8'); + } + $original_data = ''; + if ($mode == 'edit') { + $original_data = "\n"; + } + $query = "SELECT `TABLE_NAME` FROM `INFORMATION_SCHEMA`.`TABLES` "; + $query .= "WHERE `TABLE_SCHEMA`='" . $GLOBALS['dbi']->escapeString($db) . "' "; + $query .= "AND `TABLE_TYPE` IN ('BASE TABLE', 'SYSTEM VERSIONED')"; + $tables = $GLOBALS['dbi']->fetchResult($query); + + // Create the output + $retval = ""; + $retval .= "\n\n"; + $retval .= "
    \n"; + $retval .= "\n"; + $retval .= $original_data; + $retval .= Url::getHiddenInputs($db, $table) . "\n"; + $retval .= "
    \n"; + $retval .= "" . __('Details') . "\n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "\n"; + $retval .= "\n"; + $retval .= " \n"; + $retval .= " '; + + $html_output .= ''; + + $html_output .= '' + . '' + . '' + . '' + . ''; + $current_user = $row['User']; + $current_host = $row['Host']; + $routine = $row['Routine_name']; + $html_output .= ''; + $html_output .= ''; + + $html_output .= ''; + + } + return $html_output; + } + + /** + * Get the HTML for user form and check the privileges for a particular database. + * + * @param string $db database name + * + * @return string $html_output + */ + public static function getHtmlForSpecificDbPrivileges($db) + { + $html_output = ''; + + if ($GLOBALS['dbi']->isSuperuser()) { + // check the privileges for a particular database. + $html_output = ''; + $html_output .= Url::getHiddenInputs($db); + $html_output .= '
    '; + $html_output .= '
    '; + $html_output .= '' . "\n" + . Util::getIcon('b_usrcheck') + . ' ' + . sprintf( + __('Users having access to "%s"'), + '' + . htmlspecialchars($db) + . '' + ) + . "\n" + . '' . "\n"; + + $html_output .= '
    '; + $html_output .= '
    " . __('Trigger name') . "\n"; + $retval .= " \n"; + $retval .= " \n"; + $retval .= "
    " . _pgettext('Trigger action time', 'Time') . "
    " . __('Event') . "
    " . __('Definition') . "
    " . __('Definer') . "isAjax()) { + $retval .= "\n"; + $retval .= "\n"; + } + $retval .= "\n\n"; + $retval .= "\n\n"; + + return $retval; + } // end self::getEditorForm() + + /** + * Composes the query necessary to create a trigger from an HTTP request. + * + * @return string The CREATE TRIGGER query. + */ + public static function getQueryFromRequest() + { + global $_REQUEST, $db, $errors, $action_timings, $event_manipulations; + + $query = 'CREATE '; + if (! empty($_POST['item_definer'])) { + if (mb_strpos($_POST['item_definer'], '@') !== false + ) { + $arr = explode('@', $_POST['item_definer']); + $query .= 'DEFINER=' . Util::backquote($arr[0]); + $query .= '@' . Util::backquote($arr[1]) . ' '; + } else { + $errors[] = __('The definer must be in the "username@hostname" format!'); + } + } + $query .= 'TRIGGER '; + if (! empty($_POST['item_name'])) { + $query .= Util::backquote($_POST['item_name']) . ' '; + } else { + $errors[] = __('You must provide a trigger name!'); + } + if (! empty($_POST['item_timing']) + && in_array($_POST['item_timing'], $action_timings) + ) { + $query .= $_POST['item_timing'] . ' '; + } else { + $errors[] = __('You must provide a valid timing for the trigger!'); + } + if (! empty($_POST['item_event']) + && in_array($_POST['item_event'], $event_manipulations) + ) { + $query .= $_POST['item_event'] . ' '; + } else { + $errors[] = __('You must provide a valid event for the trigger!'); + } + $query .= 'ON '; + if (! empty($_POST['item_table']) + && in_array($_POST['item_table'], $GLOBALS['dbi']->getTables($db)) + ) { + $query .= Util::backquote($_POST['item_table']); + } else { + $errors[] = __('You must provide a valid table name!'); + } + $query .= ' FOR EACH ROW '; + if (! empty($_POST['item_definition'])) { + $query .= $_POST['item_definition']; + } else { + $errors[] = __('You must provide a trigger definition.'); + } + + return $query; + } // end self::getQueryFromRequest() +} diff --git a/phpMyAdmin/libraries/classes/Rte/Words.php b/phpMyAdmin/libraries/classes/Rte/Words.php new file mode 100755 index 0000000..ce3c305 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Rte/Words.php @@ -0,0 +1,87 @@ + __('Add routine'), + 'docu' => 'STORED_ROUTINES', + 'export' => __('Export of routine %s'), + 'human' => __('routine'), + 'no_create' => __( + 'You do not have the necessary privileges to create a routine.' + ), + 'no_edit' => __( + 'No routine with name %1$s found in database %2$s. ' + . 'You might be lacking the necessary privileges to edit this routine.' + ), + 'no_view' => __( + 'No routine with name %1$s found in database %2$s. ' + . 'You might be lacking the necessary privileges to view/export this routine.' + ), + 'not_found' => __('No routine with name %1$s found in database %2$s.'), + 'nothing' => __('There are no routines to display.'), + 'title' => __('Routines'), + ); + break; + case 'TRI': + $words = array( + 'add' => __('Add trigger'), + 'docu' => 'TRIGGERS', + 'export' => __('Export of trigger %s'), + 'human' => __('trigger'), + 'no_create' => __( + 'You do not have the necessary privileges to create a trigger.' + ), + 'not_found' => __('No trigger with name %1$s found in database %2$s.'), + 'nothing' => __('There are no triggers to display.'), + 'title' => __('Triggers'), + ); + break; + case 'EVN': + $words = array( + 'add' => __('Add event'), + 'docu' => 'EVENTS', + 'export' => __('Export of event %s'), + 'human' => __('event'), + 'no_create' => __( + 'You do not have the necessary privileges to create an event.' + ), + 'not_found' => __('No event with name %1$s found in database %2$s.'), + 'nothing' => __('There are no events to display.'), + 'title' => __('Events'), + ); + break; + default: + $words = array(); + break; + } + + return isset($words[$index]) ? $words[$index] : ''; + } // end self::get() +} diff --git a/phpMyAdmin/libraries/classes/Sanitize.php b/phpMyAdmin/libraries/classes/Sanitize.php new file mode 100755 index 0000000..e8ee32d --- /dev/null +++ b/phpMyAdmin/libraries/classes/Sanitize.php @@ -0,0 +1,466 @@ +get('is_setup'); + // Adjust path to setup script location + if ($is_setup) { + foreach ($valid_starts as $key => $value) { + if (substr($value, 0, 2) === './') { + $valid_starts[$key] = '.' . $value; + } + } + } + if ($other) { + $valid_starts[] = 'mailto:'; + $valid_starts[] = 'ftp://'; + } + if ($http) { + $valid_starts[] = 'http://'; + } + if ($is_setup) { + $valid_starts[] = '?page=form&'; + $valid_starts[] = '?page=servers&'; + } + foreach ($valid_starts as $val) { + if (substr($url, 0, strlen($val)) == $val) { + return true; + } + } + return false; + } + + /** + * Callback function for replacing [a@link@target] links in bb code. + * + * @param array $found Array of preg matches + * + * @return string Replaced string + */ + public static function replaceBBLink(array $found) + { + /* Check for valid link */ + if (! self::checkLink($found[1])) { + return $found[0]; + } + /* a-z and _ allowed in target */ + if (! empty($found[3]) && preg_match('/[^a-z_]+/i', $found[3])) { + return $found[0]; + } + + /* Construct target */ + $target = ''; + if (! empty($found[3])) { + $target = ' target="' . $found[3] . '"'; + if ($found[3] == '_blank') { + $target .= ' rel="noopener noreferrer"'; + } + } + + /* Construct url */ + if (substr($found[1], 0, 4) == 'http') { + $url = Core::linkURL($found[1]); + } else { + $url = $found[1]; + } + + return ''; + } + + /** + * Callback function for replacing [doc@anchor] links in bb code. + * + * @param array $found Array of preg matches + * + * @return string Replaced string + */ + public static function replaceDocLink(array $found) + { + if (count($found) >= 4) { + $page = $found[1]; + $anchor = $found[3]; + } else { + $anchor = $found[1]; + if (strncmp('faq', $anchor, 3) == 0) { + $page = 'faq'; + } elseif (strncmp('cfg', $anchor, 3) == 0) { + $page = 'config'; + } else { + /* Guess */ + $page = 'setup'; + } + } + $link = Util::getDocuLink($page, $anchor); + return ''; + } + + /** + * Sanitizes $message, taking into account our special codes + * for formatting. + * + * If you want to include result in element attribute, you should escape it. + * + * Examples: + * + *

    + * + *
    bar + * + * @param string $message the message + * @param boolean $escape whether to escape html in result + * @param boolean $safe whether string is safe (can keep < and > chars) + * + * @return string the sanitized message + */ + public static function sanitize($message, $escape = false, $safe = false) + { + if (!$safe) { + $message = strtr($message, array('<' => '<', '>' => '>')); + } + + /* Interpret bb code */ + $replace_pairs = array( + '[em]' => '', + '[/em]' => '', + '[strong]' => '', + '[/strong]' => '', + '[code]' => '', + '[/code]' => '', + '[kbd]' => '', + '[/kbd]' => '', + '[br]' => '
    ', + '[/a]' => '', + '[/doc]' => '', + '[sup]' => '', + '[/sup]' => '', + // used in common.inc.php: + '[conferr]' => '', + // used in libraries/Util.php + '[dochelpicon]' => Util::getImage('b_help', __('Documentation')), + ); + + $message = strtr($message, $replace_pairs); + + /* Match links in bb code ([a@url@target], where @target is options) */ + $pattern = '/\[a@([^]"@]*)(@([^]"]*))?\]/'; + + /* Find and replace all links */ + $message = preg_replace_callback($pattern, function($match){ + return self::replaceBBLink($match); + }, $message); + + /* Replace documentation links */ + $message = preg_replace_callback( + '/\[doc@([a-zA-Z0-9_-]+)(@([a-zA-Z0-9_-]*))?\]/', + function($match){ + return self::replaceDocLink($match); + }, + $message + ); + + /* Possibly escape result */ + if ($escape) { + $message = htmlspecialchars($message); + } + + return $message; + } + + + /** + * Sanitize a filename by removing anything besides legit characters + * + * Intended usecase: + * When using a filename in a Content-Disposition header + * the value should not contain ; or " + * + * When exporting, avoiding generation of an unexpected double-extension file + * + * @param string $filename The filename + * @param boolean $replaceDots Whether to also replace dots + * + * @return string the sanitized filename + * + */ + public static function sanitizeFilename($filename, $replaceDots = false) + { + $pattern = '/[^A-Za-z0-9_'; + // if we don't have to replace dots + if (! $replaceDots) { + // then add the dot to the list of legit characters + $pattern .= '.'; + } + $pattern .= '-]/'; + $filename = preg_replace($pattern, '_', $filename); + return $filename; + } + + /** + * Format a string so it can be a string inside JavaScript code inside an + * eventhandler (onclick, onchange, on..., ). + * This function is used to displays a javascript confirmation box for + * "DROP/DELETE/ALTER" queries. + * + * @param string $a_string the string to format + * @param boolean $add_backquotes whether to add backquotes to the string or not + * + * @return string the formatted string + * + * @access public + */ + public static function jsFormat($a_string = '', $add_backquotes = true) + { + $a_string = htmlspecialchars($a_string); + $a_string = self::escapeJsString($a_string); + // Needed for inline javascript to prevent some browsers + // treating it as a anchor + $a_string = str_replace('#', '\\#', $a_string); + + return $add_backquotes + ? Util::backquote($a_string) + : $a_string; + } // end of the 'jsFormat' function + + /** + * escapes a string to be inserted as string a JavaScript block + * enclosed by + * this requires only to escape ' with \' and end of script block + * + * We also remove NUL byte as some browsers (namely MSIE) ignore it and + * inserting it anywhere inside '', + '\\' => '\\\\', + '\'' => '\\\'', + '"' => '\"', + "\n" => '\n', + "\r" => '\r' + ) + ) + ); + } + + /** + * Formats a value for javascript code. + * + * @param string $value String to be formatted. + * + * @return string formatted value. + */ + public static function formatJsVal($value) + { + if (is_bool($value)) { + if ($value) { + return 'true'; + } + + return 'false'; + } + + if (is_int($value)) { + return (int)$value; + } + + return '"' . self::escapeJsString($value) . '"'; + } + + /** + * Formats an javascript assignment with proper escaping of a value + * and support for assigning array of strings. + * + * @param string $key Name of value to set + * @param mixed $value Value to set, can be either string or array of strings + * @param bool $escape Whether to escape value or keep it as it is + * (for inclusion of js code) + * + * @return string Javascript code. + */ + public static function getJsValue($key, $value, $escape = true) + { + $result = $key . ' = '; + if (!$escape) { + $result .= $value; + } elseif (is_array($value)) { + $result .= '['; + foreach ($value as $val) { + $result .= self::formatJsVal($val) . ","; + } + $result .= "];\n"; + } else { + $result .= self::formatJsVal($value) . ";\n"; + } + return $result; + } + + /** + * Prints an javascript assignment with proper escaping of a value + * and support for assigning array of strings. + * + * @param string $key Name of value to set + * @param mixed $value Value to set, can be either string or array of strings + * + * @return void + */ + public static function printJsValue($key, $value) + { + echo self::getJsValue($key, $value); + } + + /** + * Formats javascript assignment for form validation api + * with proper escaping of a value. + * + * @param string $key Name of value to set + * @param string $value Value to set + * @param boolean $addOn Check if $.validator.format is required or not + * @param boolean $comma Check if comma is required + * + * @return string Javascript code. + */ + public static function getJsValueForFormValidation($key, $value, $addOn, $comma) + { + $result = $key . ': '; + if ($addOn) { + $result .= '$.validator.format('; + } + $result .= self::formatJsVal($value); + if ($addOn) { + $result .= ')'; + } + if ($comma) { + $result .= ', '; + } + return $result; + } + + /** + * Prints javascript assignment for form validation api + * with proper escaping of a value. + * + * @param string $key Name of value to set + * @param string $value Value to set + * @param boolean $addOn Check if $.validator.format is required or not + * @param boolean $comma Check if comma is required + * + * @return void + */ + public static function printJsValueForFormValidation($key, $value, $addOn=false, $comma=true) + { + echo self::getJsValueForFormValidation($key, $value, $addOn, $comma); + } + + /** + * Removes all variables from request except whitelisted ones. + * + * @param string &$whitelist list of variables to allow + * + * @return void + * @access public + */ + public static function removeRequestVars(&$whitelist) + { + // do not check only $_REQUEST because it could have been overwritten + // and use type casting because the variables could have become + // strings + if (! isset($_REQUEST)) { + $_REQUEST = array(); + } + if (! isset($_GET)) { + $_GET = array(); + } + if (! isset($_POST)) { + $_POST = array(); + } + if (! isset($_COOKIE)) { + $_COOKIE = array(); + } + $keys = array_keys( + array_merge((array)$_REQUEST, (array)$_GET, (array)$_POST, (array)$_COOKIE) + ); + + foreach ($keys as $key) { + if (! in_array($key, $whitelist)) { + unset($_REQUEST[$key], $_GET[$key], $_POST[$key]); + continue; + } + + // allowed stuff could be compromised so escape it + // we require it to be a string + if (isset($_REQUEST[$key]) && ! is_string($_REQUEST[$key])) { + unset($_REQUEST[$key]); + } + if (isset($_POST[$key]) && ! is_string($_POST[$key])) { + unset($_POST[$key]); + } + if (isset($_COOKIE[$key]) && ! is_string($_COOKIE[$key])) { + unset($_COOKIE[$key]); + } + if (isset($_GET[$key]) && ! is_string($_GET[$key])) { + unset($_GET[$key]); + } + } + } +} diff --git a/phpMyAdmin/libraries/classes/SavedSearches.php b/phpMyAdmin/libraries/classes/SavedSearches.php new file mode 100755 index 0000000..968abf4 --- /dev/null +++ b/phpMyAdmin/libraries/classes/SavedSearches.php @@ -0,0 +1,468 @@ +setConfig($config); + $this->relation = new Relation(); + } + + /** + * Setter of id + * + * @param int|null $searchId Id of search + * + * @return static + */ + public function setId($searchId) + { + $searchId = (int)$searchId; + if (empty($searchId)) { + $searchId = null; + } + + $this->_id = $searchId; + return $this; + } + + /** + * Getter of id + * + * @return int|null + */ + public function getId() + { + return $this->_id; + } + + /** + * Setter of searchName + * + * @param string $searchName Saved search name + * + * @return static + */ + public function setSearchName($searchName) + { + $this->_searchName = $searchName; + return $this; + } + + /** + * Getter of searchName + * + * @return string + */ + public function getSearchName() + { + return $this->_searchName; + } + + /** + * Setter of config + * + * @param array $config Global configuration + * + * @return static + */ + public function setConfig(array $config) + { + $this->_config = $config; + return $this; + } + + /** + * Getter of config + * + * @return array + */ + public function getConfig() + { + return $this->_config; + } + + /** + * Setter for criterias + * + * @param array|string $criterias Criterias of saved searches + * @param bool $json Criterias are in JSON format + * + * @return static + */ + public function setCriterias($criterias, $json = false) + { + if (true === $json && is_string($criterias)) { + $this->_criterias = json_decode($criterias, true); + return $this; + } + + $aListFieldsToGet = array( + 'criteriaColumn', + 'criteriaSort', + 'criteriaShow', + 'criteria', + 'criteriaAndOrRow', + 'criteriaAndOrColumn', + 'rows', + 'TableList' + ); + + $data = array(); + + $data['criteriaColumnCount'] = count($criterias['criteriaColumn']); + + foreach ($aListFieldsToGet as $field) { + if (isset($criterias[$field])) { + $data[$field] = $criterias[$field]; + } + } + + /* Limit amount of rows */ + if (!isset($data['rows'])) { + $data['rows'] = 0; + } else { + $data['rows'] = min( + max(0, intval($data['rows'])), + 100 + ); + } + + for ($i = 0; $i <= $data['rows']; $i++) { + $data['Or' . $i] = $criterias['Or' . $i]; + } + + $this->_criterias = $data; + return $this; + } + + /** + * Getter for criterias + * + * @return array + */ + public function getCriterias() + { + return $this->_criterias; + } + + /** + * Setter for username + * + * @param string $username Username + * + * @return static + */ + public function setUsername($username) + { + $this->_username = $username; + return $this; + } + + /** + * Getter for username + * + * @return string + */ + public function getUsername() + { + return $this->_username; + } + + /** + * Setter for DB name + * + * @param string $dbname DB name + * + * @return static + */ + public function setDbname($dbname) + { + $this->_dbname = $dbname; + return $this; + } + + /** + * Getter for DB name + * + * @return string + */ + public function getDbname() + { + return $this->_dbname; + } + + /** + * Save the search + * + * @return boolean + */ + public function save() + { + if (null == $this->getSearchName()) { + $message = Message::error( + __('Please provide a name for this bookmarked search.') + ); + $response = Response::getInstance(); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('fieldWithError', 'searchName'); + $response->addJSON('message', $message); + exit; + } + + if (null == $this->getUsername() + || null == $this->getDbname() + || null == $this->getSearchName() + || null == $this->getCriterias() + ) { + $message = Message::error( + __('Missing information to save the bookmarked search.') + ); + $response = Response::getInstance(); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('message', $message); + exit; + } + + $savedSearchesTbl + = Util::backquote($this->_config['cfgRelation']['db']) . "." + . Util::backquote($this->_config['cfgRelation']['savedsearches']); + + //If it's an insert. + if (null === $this->getId()) { + $wheres = array( + "search_name = '" . $GLOBALS['dbi']->escapeString($this->getSearchName()) + . "'" + ); + $existingSearches = $this->getList($wheres); + + if (!empty($existingSearches)) { + $message = Message::error( + __('An entry with this name already exists.') + ); + $response = Response::getInstance(); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('fieldWithError', 'searchName'); + $response->addJSON('message', $message); + exit; + } + + $sqlQuery = "INSERT INTO " . $savedSearchesTbl + . "(`username`, `db_name`, `search_name`, `search_data`)" + . " VALUES (" + . "'" . $GLOBALS['dbi']->escapeString($this->getUsername()) . "'," + . "'" . $GLOBALS['dbi']->escapeString($this->getDbname()) . "'," + . "'" . $GLOBALS['dbi']->escapeString($this->getSearchName()) . "'," + . "'" . $GLOBALS['dbi']->escapeString(json_encode($this->getCriterias())) + . "')"; + + $result = (bool) $this->relation->queryAsControlUser($sqlQuery); + if (!$result) { + return false; + } + + $this->setId($GLOBALS['dbi']->insertId()); + + return true; + } + + //Else, it's an update. + $wheres = array( + "id != " . $this->getId(), + "search_name = '" . $GLOBALS['dbi']->escapeString($this->getSearchName()) . "'" + ); + $existingSearches = $this->getList($wheres); + + if (!empty($existingSearches)) { + $message = Message::error( + __('An entry with this name already exists.') + ); + $response = Response::getInstance(); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('fieldWithError', 'searchName'); + $response->addJSON('message', $message); + exit; + } + + $sqlQuery = "UPDATE " . $savedSearchesTbl + . "SET `search_name` = '" + . $GLOBALS['dbi']->escapeString($this->getSearchName()) . "', " + . "`search_data` = '" + . $GLOBALS['dbi']->escapeString(json_encode($this->getCriterias())) . "' " + . "WHERE id = " . $this->getId(); + return (bool) $this->relation->queryAsControlUser($sqlQuery); + } + + /** + * Delete the search + * + * @return boolean + */ + public function delete() + { + if (null == $this->getId()) { + $message = Message::error( + __('Missing information to delete the search.') + ); + $response = Response::getInstance(); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('fieldWithError', 'searchId'); + $response->addJSON('message', $message); + exit; + } + + $savedSearchesTbl + = Util::backquote($this->_config['cfgRelation']['db']) . "." + . Util::backquote($this->_config['cfgRelation']['savedsearches']); + + $sqlQuery = "DELETE FROM " . $savedSearchesTbl + . "WHERE id = '" . $GLOBALS['dbi']->escapeString($this->getId()) . "'"; + + return (bool) $this->relation->queryAsControlUser($sqlQuery); + } + + /** + * Load the current search from an id. + * + * @return bool Success + */ + public function load() + { + if (null == $this->getId()) { + $message = Message::error( + __('Missing information to load the search.') + ); + $response = Response::getInstance(); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('fieldWithError', 'searchId'); + $response->addJSON('message', $message); + exit; + } + + $savedSearchesTbl = Util::backquote($this->_config['cfgRelation']['db']) + . "." + . Util::backquote($this->_config['cfgRelation']['savedsearches']); + $sqlQuery = "SELECT id, search_name, search_data " + . "FROM " . $savedSearchesTbl . " " + . "WHERE id = '" . $GLOBALS['dbi']->escapeString($this->getId()) . "' "; + + $resList = $this->relation->queryAsControlUser($sqlQuery); + + if (false === ($oneResult = $GLOBALS['dbi']->fetchArray($resList))) { + $message = Message::error(__('Error while loading the search.')); + $response = Response::getInstance(); + $response->setRequestStatus($message->isSuccess()); + $response->addJSON('fieldWithError', 'searchId'); + $response->addJSON('message', $message); + exit; + } + + $this->setSearchName($oneResult['search_name']) + ->setCriterias($oneResult['search_data'], true); + + return true; + } + + /** + * Get the list of saved searches of a user on a DB + * + * @param string[] $wheres List of filters + * + * @return array List of saved searches or empty array on failure + */ + public function getList(array $wheres = array()) + { + if (null == $this->getUsername() + || null == $this->getDbname() + ) { + return array(); + } + + $savedSearchesTbl = Util::backquote($this->_config['cfgRelation']['db']) + . "." + . Util::backquote($this->_config['cfgRelation']['savedsearches']); + $sqlQuery = "SELECT id, search_name " + . "FROM " . $savedSearchesTbl . " " + . "WHERE " + . "username = '" . $GLOBALS['dbi']->escapeString($this->getUsername()) . "' " + . "AND db_name = '" . $GLOBALS['dbi']->escapeString($this->getDbname()) . "' "; + + foreach ($wheres as $where) { + $sqlQuery .= "AND " . $where . " "; + } + + $sqlQuery .= "order by search_name ASC "; + + $resList = $this->relation->queryAsControlUser($sqlQuery); + + $list = array(); + while ($oneResult = $GLOBALS['dbi']->fetchArray($resList)) { + $list[$oneResult['id']] = $oneResult['search_name']; + } + + return $list; + } +} diff --git a/phpMyAdmin/libraries/classes/Scripts.php b/phpMyAdmin/libraries/classes/Scripts.php new file mode 100755 index 0000000..481ebff --- /dev/null +++ b/phpMyAdmin/libraries/classes/Scripts.php @@ -0,0 +1,214 @@ + PMA_VERSION)); + $result .= "\n"; + } else { + $result .= '' . "\n"; + } + } + return $result; + } + + /** + * Generates new Scripts objects + * + */ + public function __construct() + { + $this->_files = array(); + $this->_code = ''; + + } + + /** + * Adds a new file to the list of scripts + * + * @param string $filename The name of the file to include + * @param array $params Additional parameters to pass to the file + * + * @return void + */ + public function addFile( + $filename, + array $params = array() + ) { + $hash = md5($filename); + if (!empty($this->_files[$hash])) { + return; + } + + $has_onload = $this->_eventBlacklist($filename); + $this->_files[$hash] = array( + 'has_onload' => $has_onload, + 'filename' => $filename, + 'params' => $params, + ); + } + + /** + * Add new files to the list of scripts + * + * @param array $filelist The array of file names + * + * @return void + */ + public function addFiles(array $filelist) + { + foreach ($filelist as $filename) { + $this->addFile($filename); + } + } + + /** + * Determines whether to fire up an onload event for a file + * + * @param string $filename The name of the file to be checked + * against the blacklist + * + * @return int 1 to fire up the event, 0 not to + */ + private function _eventBlacklist($filename) + { + if (strpos($filename, 'jquery') !== false + || strpos($filename, 'codemirror') !== false + || strpos($filename, 'messages.php') !== false + || strpos($filename, 'ajax.js') !== false + || strpos($filename, 'cross_framing_protection.js') !== false + ) { + return 0; + } + + return 1; + } + + /** + * Adds a new code snippet to the code to be executed + * + * @param string $code The JS code to be added + * + * @return void + */ + public function addCode($code) + { + $this->_code .= "$code\n"; + } + + /** + * Returns a list with filenames and a flag to indicate + * whether to register onload events for this file + * + * @return array + */ + public function getFiles() + { + $retval = array(); + foreach ($this->_files as $file) { + //If filename contains a "?", continue. + if (strpos($file['filename'], "?") !== false) { + continue; + } + $retval[] = array( + 'name' => $file['filename'], + 'fire' => $file['has_onload'] + ); + + } + return $retval; + } + + /** + * Renders all the JavaScript file inclusions, code and events + * + * @return string + */ + public function getDisplay() + { + $retval = ''; + + if (count($this->_files) > 0) { + $retval .= $this->_includeFiles( + $this->_files + ); + } + + $code = 'AJAX.scriptHandler'; + foreach ($this->_files as $file) { + $code .= sprintf( + '.add("%s",%d)', + Sanitize::escapeJsString($file['filename']), + $file['has_onload'] ? 1 : 0 + ); + } + $code .= ';'; + $this->addCode($code); + + $code = '$(function() {'; + foreach ($this->_files as $file) { + if ($file['has_onload']) { + $code .= 'AJAX.fireOnload("'; + $code .= Sanitize::escapeJsString($file['filename']); + $code .= '");'; + } + } + $code .= '});'; + $this->addCode($code); + + $retval .= ''; + + return $retval; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Privileges.php b/phpMyAdmin/libraries/classes/Server/Privileges.php new file mode 100755 index 0000000..eb34b25 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Privileges.php @@ -0,0 +1,5444 @@ +isAjax()) { + $response->addJSON('message', $dialog); + exit; + } else { + $html .= $dialog; + } + } + + return $html; + } + + /** + * Escapes wildcard in a database+table specification + * before using it in a GRANT statement. + * + * Escaping a wildcard character in a GRANT is only accepted at the global + * or database level, not at table level; this is why I remove + * the escaping character. Internally, in mysql.tables_priv.Db there are + * no escaping (for example test_db) but in mysql.db you'll see test\_db + * for a db-specific privilege. + * + * @param string $dbname Database name + * @param string $tablename Table name + * + * @return string the escaped (if necessary) database.table + */ + public static function wildcardEscapeForGrant($dbname, $tablename) + { + if (strlen($dbname) === 0) { + $db_and_table = '*.*'; + } else { + if (strlen($tablename) > 0) { + $db_and_table = Util::backquote( + Util::unescapeMysqlWildcards($dbname) + ) + . '.' . Util::backquote($tablename); + } else { + $db_and_table = Util::backquote($dbname) . '.*'; + } + } + return $db_and_table; + } + + /** + * Generates a condition on the user name + * + * @param string $initial the user's initial + * + * @return string the generated condition + */ + public static function rangeOfUsers($initial = '') + { + // strtolower() is used because the User field + // might be BINARY, so LIKE would be case sensitive + if ($initial === null || $initial === '') { + return ''; + } + + $ret = " WHERE `User` LIKE '" + . $GLOBALS['dbi']->escapeString($initial) . "%'" + . " OR `User` LIKE '" + . $GLOBALS['dbi']->escapeString(mb_strtolower($initial)) + . "%'"; + return $ret; + } // end function + + /** + * Formats privilege name for a display + * + * @param array $privilege Privilege information + * @param boolean $html Whether to use HTML + * + * @return string + */ + public static function formatPrivilege(array $privilege, $html) + { + if ($html) { + return '' + . $privilege[1] . ''; + } + + return $privilege[1]; + } + + /** + * Parses privileges into an array, it modifies the array + * + * @param array &$row Results row from + * + * @return void + */ + public static function fillInTablePrivileges(array &$row) + { + $row1 = $GLOBALS['dbi']->fetchSingleRow( + 'SHOW COLUMNS FROM `mysql`.`tables_priv` LIKE \'Table_priv\';', + 'ASSOC' + ); + // note: in MySQL 5.0.3 we get "Create View', 'Show view'; + // the View for Create is spelled with uppercase V + // the view for Show is spelled with lowercase v + // and there is a space between the words + + $av_grants = explode( + '\',\'', + mb_substr( + $row1['Type'], + mb_strpos($row1['Type'], '(') + 2, + mb_strpos($row1['Type'], ')') + - mb_strpos($row1['Type'], '(') - 3 + ) + ); + + $users_grants = explode(',', $row['Table_priv']); + + foreach ($av_grants as $current_grant) { + $row[$current_grant . '_priv'] + = in_array($current_grant, $users_grants) ? 'Y' : 'N'; + } + unset($row['Table_priv']); + } + + + /** + * Extracts the privilege information of a priv table row + * + * @param array|null $row the row + * @param boolean $enableHTML add tag with tooltips + * @param boolean $tablePrivs whether row contains table privileges + * + * @global resource $user_link the database connection + * + * @return array + */ + public static function extractPrivInfo($row = null, $enableHTML = false, $tablePrivs = false) + { + if ($tablePrivs) { + $grants = self::getTableGrantsArray(); + } else { + $grants = self::getGrantsArray(); + } + + if (! is_null($row) && isset($row['Table_priv'])) { + self::fillInTablePrivileges($row); + } + + $privs = array(); + $allPrivileges = true; + foreach ($grants as $current_grant) { + if ((! is_null($row) && isset($row[$current_grant[0]])) + || (is_null($row) && isset($GLOBALS[$current_grant[0]])) + ) { + if ((! is_null($row) && $row[$current_grant[0]] == 'Y') + || (is_null($row) + && ($GLOBALS[$current_grant[0]] == 'Y' + || (is_array($GLOBALS[$current_grant[0]]) + && count($GLOBALS[$current_grant[0]]) == $_REQUEST['column_count'] + && empty($GLOBALS[$current_grant[0] . '_none'])))) + ) { + $privs[] = self::formatPrivilege($current_grant, $enableHTML); + } elseif (! empty($GLOBALS[$current_grant[0]]) + && is_array($GLOBALS[$current_grant[0]]) + && empty($GLOBALS[$current_grant[0] . '_none']) + ) { + // Required for proper escaping of ` (backtick) in a column name + $grant_cols = array_map( + function($val) { + return Util::backquote($val); + }, + $GLOBALS[$current_grant[0]] + ); + + $privs[] = self::formatPrivilege($current_grant, $enableHTML) + . ' (' . join(', ', $grant_cols) . ')'; + } else { + $allPrivileges = false; + } + } + } + if (empty($privs)) { + if ($enableHTML) { + $privs[] = 'USAGE'; + } else { + $privs[] = 'USAGE'; + } + } elseif ($allPrivileges + && (! isset($_POST['grant_count']) || count($privs) == $_POST['grant_count']) + ) { + if ($enableHTML) { + $privs = array('ALL PRIVILEGES' + ); + } else { + $privs = array('ALL PRIVILEGES'); + } + } + return $privs; + } // end of the 'self::extractPrivInfo()' function + + /** + * Returns an array of table grants and their descriptions + * + * @return array array of table grants + */ + public static function getTableGrantsArray() + { + return array( + array( + 'Delete', + 'DELETE', + $GLOBALS['strPrivDescDelete'] + ), + array( + 'Create', + 'CREATE', + $GLOBALS['strPrivDescCreateTbl'] + ), + array( + 'Drop', + 'DROP', + $GLOBALS['strPrivDescDropTbl'] + ), + array( + 'Index', + 'INDEX', + $GLOBALS['strPrivDescIndex'] + ), + array( + 'Alter', + 'ALTER', + $GLOBALS['strPrivDescAlter'] + ), + array( + 'Create View', + 'CREATE_VIEW', + $GLOBALS['strPrivDescCreateView'] + ), + array( + 'Show view', + 'SHOW_VIEW', + $GLOBALS['strPrivDescShowView'] + ), + array( + 'Trigger', + 'TRIGGER', + $GLOBALS['strPrivDescTrigger'] + ), + ); + } + + /** + * Get the grants array which contains all the privilege types + * and relevant grant messages + * + * @return array + */ + public static function getGrantsArray() + { + return array( + array( + 'Select_priv', + 'SELECT', + __('Allows reading data.') + ), + array( + 'Insert_priv', + 'INSERT', + __('Allows inserting and replacing data.') + ), + array( + 'Update_priv', + 'UPDATE', + __('Allows changing data.') + ), + array( + 'Delete_priv', + 'DELETE', + __('Allows deleting data.') + ), + array( + 'Create_priv', + 'CREATE', + __('Allows creating new databases and tables.') + ), + array( + 'Drop_priv', + 'DROP', + __('Allows dropping databases and tables.') + ), + array( + 'Reload_priv', + 'RELOAD', + __('Allows reloading server settings and flushing the server\'s caches.') + ), + array( + 'Shutdown_priv', + 'SHUTDOWN', + __('Allows shutting down the server.') + ), + array( + 'Process_priv', + 'PROCESS', + __('Allows viewing processes of all users.') + ), + array( + 'File_priv', + 'FILE', + __('Allows importing data from and exporting data into files.') + ), + array( + 'References_priv', + 'REFERENCES', + __('Has no effect in this MySQL version.') + ), + array( + 'Index_priv', + 'INDEX', + __('Allows creating and dropping indexes.') + ), + array( + 'Alter_priv', + 'ALTER', + __('Allows altering the structure of existing tables.') + ), + array( + 'Show_db_priv', + 'SHOW DATABASES', + __('Gives access to the complete list of databases.') + ), + array( + 'Super_priv', + 'SUPER', + __( + 'Allows connecting, even if maximum number of connections ' + . 'is reached; required for most administrative operations ' + . 'like setting global variables or killing threads of other users.' + ) + ), + array( + 'Create_tmp_table_priv', + 'CREATE TEMPORARY TABLES', + __('Allows creating temporary tables.') + ), + array( + 'Lock_tables_priv', + 'LOCK TABLES', + __('Allows locking tables for the current thread.') + ), + array( + 'Repl_slave_priv', + 'REPLICATION SLAVE', + __('Needed for the replication slaves.') + ), + array( + 'Repl_client_priv', + 'REPLICATION CLIENT', + __('Allows the user to ask where the slaves / masters are.') + ), + array( + 'Create_view_priv', + 'CREATE VIEW', + __('Allows creating new views.') + ), + array( + 'Event_priv', + 'EVENT', + __('Allows to set up events for the event scheduler.') + ), + array( + 'Trigger_priv', + 'TRIGGER', + __('Allows creating and dropping triggers.') + ), + // for table privs: + array( + 'Create View_priv', + 'CREATE VIEW', + __('Allows creating new views.') + ), + array( + 'Show_view_priv', + 'SHOW VIEW', + __('Allows performing SHOW CREATE VIEW queries.') + ), + // for table privs: + array( + 'Show view_priv', + 'SHOW VIEW', + __('Allows performing SHOW CREATE VIEW queries.') + ), + array( + 'Delete_history_priv', + 'DELETE HISTORY', + $GLOBALS['strPrivDescDeleteHistoricalRows'] + ), + array( + 'Delete versioning rows_priv', + 'DELETE HISTORY', + $GLOBALS['strPrivDescDeleteHistoricalRows'] + ), + array( + 'Create_routine_priv', + 'CREATE ROUTINE', + __('Allows creating stored routines.') + ), + array( + 'Alter_routine_priv', + 'ALTER ROUTINE', + __('Allows altering and dropping stored routines.') + ), + array( + 'Create_user_priv', + 'CREATE USER', + __('Allows creating, dropping and renaming user accounts.') + ), + array( + 'Execute_priv', + 'EXECUTE', + __('Allows executing stored routines.') + ), + ); + } + + /** + * Displays on which column(s) a table-specific privilege is granted + * + * @param array $columns columns array + * @param array $row first row from result or boolean false + * @param string $name_for_select privilege types - Select_priv, Insert_priv + * Update_priv, References_priv + * @param string $priv_for_header privilege for header + * @param string $name privilege name: insert, select, update, references + * @param string $name_for_dfn name for dfn + * @param string $name_for_current name for current + * + * @return string $html_output html snippet + */ + public static function getHtmlForColumnPrivileges(array $columns, array $row, $name_for_select, + $priv_for_header, $name, $name_for_dfn, $name_for_current + ) { + $data = array( + 'columns' => $columns, + 'row' => $row, + 'name_for_select' => $name_for_select, + 'priv_for_header' => $priv_for_header, + 'name' => $name, + 'name_for_dfn' => $name_for_dfn, + 'name_for_current' => $name_for_current + ); + + $html_output = Template::get('privileges/column_privileges') + ->render($data); + + return $html_output; + } // end function + + /** + * Get sql query for display privileges table + * + * @param string $db the database + * @param string $table the table + * @param string $username username for database connection + * @param string $hostname hostname for database connection + * + * @return string sql query + */ + public static function getSqlQueryForDisplayPrivTable($db, $table, $username, $hostname) + { + if ($db == '*') { + return "SELECT * FROM `mysql`.`user`" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" + . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; + } elseif ($table == '*') { + return "SELECT * FROM `mysql`.`db`" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" + . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "'" + . " AND '" . $GLOBALS['dbi']->escapeString(Util::unescapeMysqlWildcards($db)) . "'" + . " LIKE `Db`;"; + } + return "SELECT `Table_priv`" + . " FROM `mysql`.`tables_priv`" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" + . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "'" + . " AND `Db` = '" . $GLOBALS['dbi']->escapeString(Util::unescapeMysqlWildcards($db)) . "'" + . " AND `Table_name` = '" . $GLOBALS['dbi']->escapeString($table) . "';"; + } + + /** + * Displays a dropdown to select the user group + * with menu items configured to each of them. + * + * @param string $username username + * + * @return string html to select the user group + */ + public static function getHtmlToChooseUserGroup($username) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + $groupTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['usergroups']); + $userTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['users']); + + $userGroup = ''; + if (isset($GLOBALS['username'])) { + $sql_query = "SELECT `usergroup` FROM " . $userTable + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) . "'"; + $userGroup = $GLOBALS['dbi']->fetchValue( + $sql_query, 0, 0, DatabaseInterface::CONNECT_CONTROL + ); + } + + $allUserGroups = array('' => ''); + $sql_query = "SELECT DISTINCT `usergroup` FROM " . $groupTable; + $result = $relation->queryAsControlUser($sql_query, false); + if ($result) { + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $allUserGroups[$row[0]] = $row[0]; + } + } + $GLOBALS['dbi']->freeResult($result); + + // render the template + $data = array( + 'all_user_groups' => $allUserGroups, + 'user_group' => $userGroup, + 'params' => array('username' => $username) + ); + $html_output = Template::get('privileges/choose_user_group') + ->render($data); + + return $html_output; + } + + /** + * Sets the user group from request values + * + * @param string $username username + * @param string $userGroup user group to set + * + * @return void + */ + public static function setUserGroup($username, $userGroup) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + if (empty($cfgRelation['db']) || empty($cfgRelation['users']) || empty($cfgRelation['usergroups'])) { + return; + } + + $userTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['users']); + + $sql_query = "SELECT `usergroup` FROM " . $userTable + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($username) . "'"; + $oldUserGroup = $GLOBALS['dbi']->fetchValue( + $sql_query, 0, 0, DatabaseInterface::CONNECT_CONTROL + ); + + if ($oldUserGroup === false) { + $upd_query = "INSERT INTO " . $userTable . "(`username`, `usergroup`)" + . " VALUES ('" . $GLOBALS['dbi']->escapeString($username) . "', " + . "'" . $GLOBALS['dbi']->escapeString($userGroup) . "')"; + } else { + if (empty($userGroup)) { + $upd_query = "DELETE FROM " . $userTable + . " WHERE `username`='" . $GLOBALS['dbi']->escapeString($username) . "'"; + } elseif ($oldUserGroup != $userGroup) { + $upd_query = "UPDATE " . $userTable + . " SET `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) . "'" + . " WHERE `username`='" . $GLOBALS['dbi']->escapeString($username) . "'"; + } + } + if (isset($upd_query)) { + $relation->queryAsControlUser($upd_query); + } + } + + /** + * Displays the privileges form table + * + * @param string $db the database + * @param string $table the table + * @param boolean $submit whether to display the submit button or not + * + * @global array $cfg the phpMyAdmin configuration + * @global resource $user_link the database connection + * + * @return string html snippet + */ + public static function getHtmlToDisplayPrivilegesTable($db = '*', + $table = '*', $submit = true + ) { + $html_output = ''; + $sql_query = ''; + + if ($db == '*') { + $table = '*'; + } + + if (isset($GLOBALS['username'])) { + $username = $GLOBALS['username']; + $hostname = $GLOBALS['hostname']; + $sql_query = self::getSqlQueryForDisplayPrivTable( + $db, $table, $username, $hostname + ); + $row = $GLOBALS['dbi']->fetchSingleRow($sql_query); + } + if (empty($row)) { + if ($table == '*' && $GLOBALS['dbi']->isSuperuser()) { + $row = array(); + if ($db == '*') { + $sql_query = 'SHOW COLUMNS FROM `mysql`.`user`;'; + } elseif ($table == '*') { + $sql_query = 'SHOW COLUMNS FROM `mysql`.`db`;'; + } + $res = $GLOBALS['dbi']->query($sql_query); + while ($row1 = $GLOBALS['dbi']->fetchRow($res)) { + if (mb_substr($row1[0], 0, 4) == 'max_') { + $row[$row1[0]] = 0; + } elseif (mb_substr($row1[0], 0, 5) == 'x509_' + || mb_substr($row1[0], 0, 4) == 'ssl_' + ) { + $row[$row1[0]] = ''; + } else { + $row[$row1[0]] = 'N'; + } + } + $GLOBALS['dbi']->freeResult($res); + } elseif ($table == '*') { + $row = array(); + } else { + $row = array('Table_priv' => ''); + } + } + if (isset($row['Table_priv'])) { + self::fillInTablePrivileges($row); + + // get columns + $res = $GLOBALS['dbi']->tryQuery( + 'SHOW COLUMNS FROM ' + . Util::backquote( + Util::unescapeMysqlWildcards($db) + ) + . '.' . Util::backquote($table) . ';' + ); + $columns = array(); + if ($res) { + while ($row1 = $GLOBALS['dbi']->fetchRow($res)) { + $columns[$row1[0]] = array( + 'Select' => false, + 'Insert' => false, + 'Update' => false, + 'References' => false + ); + } + $GLOBALS['dbi']->freeResult($res); + } + unset($res, $row1); + } + // table-specific privileges + if (! empty($columns)) { + $html_output .= self::getHtmlForTableSpecificPrivileges( + $username, $hostname, $db, $table, $columns, $row + ); + } else { + // global or db-specific + $html_output .= self::getHtmlForGlobalOrDbSpecificPrivs($db, $table, $row); + } + $html_output .= '' . "\n"; + if ($submit) { + $html_output .= '' . "\n"; + } + return $html_output; + } // end of the 'PMA_displayPrivTable()' function + + /** + * Get HTML for "Require" + * + * @param array $row privilege array + * + * @return string html snippet + */ + public static function getHtmlForRequires(array $row) + { + $specified = (isset($row['ssl_type']) && $row['ssl_type'] == 'SPECIFIED'); + $require_options = array( + array( + 'name' => 'ssl_type', + 'value' => 'NONE', + 'description' => __( + 'Does not require SSL-encrypted connections.' + ), + 'label' => 'REQUIRE NONE', + 'checked' => ((isset($row['ssl_type']) + && ($row['ssl_type'] == 'NONE' + || $row['ssl_type'] == '')) + ? 'checked="checked"' + : '' + ), + 'disabled' => false, + 'radio' => true + ), + array( + 'name' => 'ssl_type', + 'value' => 'ANY', + 'description' => __( + 'Requires SSL-encrypted connections.' + ), + 'label' => 'REQUIRE SSL', + 'checked' => (isset($row['ssl_type']) && ($row['ssl_type'] == 'ANY') + ? 'checked="checked"' + : '' + ), + 'disabled' => false, + 'radio' => true + ), + array( + 'name' => 'ssl_type', + 'value' => 'X509', + 'description' => __( + 'Requires a valid X509 certificate.' + ), + 'label' => 'REQUIRE X509', + 'checked' => (isset($row['ssl_type']) && ($row['ssl_type'] == 'X509') + ? 'checked="checked"' + : '' + ), + 'disabled' => false, + 'radio' => true + ), + array( + 'name' => 'ssl_type', + 'value' => 'SPECIFIED', + 'description' => '', + 'label' => 'SPECIFIED', + 'checked' => ($specified ? 'checked="checked"' : ''), + 'disabled' => false, + 'radio' => true + ), + array( + 'name' => 'ssl_cipher', + 'value' => (isset($row['ssl_cipher']) + ? htmlspecialchars($row['ssl_cipher']) : '' + ), + 'description' => __( + 'Requires that a specific cipher method be used for a connection.' + ), + 'label' => 'REQUIRE CIPHER', + 'checked' => '', + 'disabled' => ! $specified, + 'radio' => false + ), + array( + 'name' => 'x509_issuer', + 'value' => (isset($row['x509_issuer']) + ? htmlspecialchars($row['x509_issuer']) : '' + ), + 'description' => __( + 'Requires that a valid X509 certificate issued by this CA be presented.' + ), + 'label' => 'REQUIRE ISSUER', + 'checked' => '', + 'disabled' => ! $specified, + 'radio' => false + ), + array( + 'name' => 'x509_subject', + 'value' => (isset($row['x509_subject']) + ? htmlspecialchars($row['x509_subject']) : '' + ), + 'description' => __( + 'Requires that a valid X509 certificate with this subject be presented.' + ), + 'label' => 'REQUIRE SUBJECT', + 'checked' => '', + 'disabled' => ! $specified, + 'radio' => false + ), + ); + + $html_output = Template::get('privileges/require_options') + ->render(array('require_options' => $require_options)); + + return $html_output; + } + + /** + * Get HTML for "Resource limits" + * + * @param array $row first row from result or boolean false + * + * @return string html snippet + */ + public static function getHtmlForResourceLimits(array $row) + { + $limits = array( + array( + 'input_name' => 'max_questions', + 'name_main' => 'MAX QUERIES PER HOUR', + 'value' => (isset($row['max_questions']) ? $row['max_questions'] : '0'), + 'description' => __( + 'Limits the number of queries the user may send to the server per hour.' + ) + ), + array( + 'input_name' => 'max_updates', + 'name_main' => 'MAX UPDATES PER HOUR', + 'value' => (isset($row['max_updates']) ? $row['max_updates'] : '0'), + 'description' => __( + 'Limits the number of commands that change any table ' + . 'or database the user may execute per hour.' + ) + ), + array( + 'input_name' => 'max_connections', + 'name_main' => 'MAX CONNECTIONS PER HOUR', + 'value' => (isset($row['max_connections']) ? $row['max_connections'] : '0'), + 'description' => __( + 'Limits the number of new connections the user may open per hour.' + ) + ), + array( + 'input_name' => 'max_user_connections', + 'name_main' => 'MAX USER_CONNECTIONS', + 'value' => (isset($row['max_user_connections']) ? + $row['max_user_connections'] : '0'), + 'description' => __( + 'Limits the number of simultaneous connections ' + . 'the user may have.' + ) + ) + ); + + return Template::get('privileges/resource_limits') + ->render(array('limits' => $limits)); + } + + /** + * Get the HTML snippet for routine specific privileges + * + * @param string $username username for database connection + * @param string $hostname hostname for database connection + * @param string $db the database + * @param string $routine the routine + * @param string $url_dbname url encoded db name + * + * @return string $html_output + */ + public static function getHtmlForRoutineSpecificPrivileges( + $username, $hostname, $db, $routine, $url_dbname + ) { + $header = self::getHtmlHeaderForUserProperties( + false, $url_dbname, $db, $username, $hostname, + $routine, 'routine' + ); + + $sql = "SELECT `Proc_priv`" + . " FROM `mysql`.`procs_priv`" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" + . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "'" + . " AND `Db` = '" + . $GLOBALS['dbi']->escapeString(Util::unescapeMysqlWildcards($db)) . "'" + . " AND `Routine_name` LIKE '" . $GLOBALS['dbi']->escapeString($routine) . "';"; + $res = $GLOBALS['dbi']->fetchValue($sql); + + $privs = self::parseProcPriv($res); + + $routineArray = array(self::getTriggerPrivilegeTable()); + $privTableNames = array(__('Routine')); + $privCheckboxes = self::getHtmlForGlobalPrivTableWithCheckboxes( + $routineArray, $privTableNames, $privs + ); + + $data = array( + 'username' => $username, + 'hostname' => $hostname, + 'database' => $db, + 'routine' => $routine, + 'grant_count' => count($privs), + 'priv_checkboxes' => $privCheckboxes, + 'header' => $header, + ); + $html_output = Template::get('privileges/edit_routine_privileges') + ->render($data); + + return $html_output; + } + + /** + * Get routine privilege table as an array + * + * @return privilege type array + */ + public static function getTriggerPrivilegeTable() + { + $routinePrivTable = array( + array( + 'Grant', + 'GRANT', + __( + 'Allows user to give to other users or remove from other users ' + . 'privileges that user possess on this routine.' + ) + ), + array( + 'Alter_routine', + 'ALTER ROUTINE', + __('Allows altering and dropping this routine.') + ), + array( + 'Execute', + 'EXECUTE', + __('Allows executing this routine.') + ) + ); + return $routinePrivTable; + } + + /** + * Get the HTML snippet for table specific privileges + * + * @param string $username username for database connection + * @param string $hostname hostname for database connection + * @param string $db the database + * @param string $table the table + * @param array $columns columns array + * @param array $row current privileges row + * + * @return string $html_output + */ + public static function getHtmlForTableSpecificPrivileges( + $username, $hostname, $db, $table, array $columns, array $row + ) { + $res = $GLOBALS['dbi']->query( + 'SELECT `Column_name`, `Column_priv`' + . ' FROM `mysql`.`columns_priv`' + . ' WHERE `User`' + . ' = \'' . $GLOBALS['dbi']->escapeString($username) . "'" + . ' AND `Host`' + . ' = \'' . $GLOBALS['dbi']->escapeString($hostname) . "'" + . ' AND `Db`' + . ' = \'' . $GLOBALS['dbi']->escapeString( + Util::unescapeMysqlWildcards($db) + ) . "'" + . ' AND `Table_name`' + . ' = \'' . $GLOBALS['dbi']->escapeString($table) . '\';' + ); + + while ($row1 = $GLOBALS['dbi']->fetchRow($res)) { + $row1[1] = explode(',', $row1[1]); + foreach ($row1[1] as $current) { + $columns[$row1[0]][$current] = true; + } + } + $GLOBALS['dbi']->freeResult($res); + unset($res, $row1, $current); + + $html_output = '' . "\n" + . '' . "\n" + . '
    ' . "\n" + . '' . __('Table-specific privileges') + . '' + . '

    ' + . __('Note: MySQL privilege names are expressed in English.') + . '

    '; + + // privs that are attached to a specific column + $html_output .= self::getHtmlForAttachedPrivilegesToTableSpecificColumn( + $columns, $row + ); + + // privs that are not attached to a specific column + $html_output .= '
    ' . "\n" + . self::getHtmlForNotAttachedPrivilegesToTableSpecificColumn($row) + . '
    ' . "\n"; + + // for Safari 2.0.2 + $html_output .= '
    ' . "\n"; + + return $html_output; + } + + /** + * Get HTML snippet for privileges that are attached to a specific column + * + * @param array $columns columns array + * @param array $row first row from result or boolean false + * + * @return string $html_output + */ + public static function getHtmlForAttachedPrivilegesToTableSpecificColumn(array $columns, array $row) + { + $html_output = self::getHtmlForColumnPrivileges( + $columns, $row, 'Select_priv', 'SELECT', + 'select', __('Allows reading data.'), 'Select' + ); + + $html_output .= self::getHtmlForColumnPrivileges( + $columns, $row, 'Insert_priv', 'INSERT', + 'insert', __('Allows inserting and replacing data.'), 'Insert' + ); + + $html_output .= self::getHtmlForColumnPrivileges( + $columns, $row, 'Update_priv', 'UPDATE', + 'update', __('Allows changing data.'), 'Update' + ); + + $html_output .= self::getHtmlForColumnPrivileges( + $columns, $row, 'References_priv', 'REFERENCES', 'references', + __('Has no effect in this MySQL version.'), 'References' + ); + return $html_output; + } + + /** + * Get HTML for privileges that are not attached to a specific column + * + * @param array $row first row from result or boolean false + * + * @return string $html_output + */ + public static function getHtmlForNotAttachedPrivilegesToTableSpecificColumn(array $row) + { + $html_output = ''; + + foreach ($row as $current_grant => $current_grant_value) { + $grant_type = substr($current_grant, 0, -5); + if (in_array($grant_type, array('Select', 'Insert', 'Update', 'References')) + ) { + continue; + } + // make a substitution to match the messages variables; + // also we must substitute the grant we get, because we can't generate + // a form variable containing blanks (those would get changed to + // an underscore when receiving the POST) + if ($current_grant == 'Create View_priv') { + $tmp_current_grant = 'CreateView_priv'; + $current_grant = 'Create_view_priv'; + } elseif ($current_grant == 'Show view_priv') { + $tmp_current_grant = 'ShowView_priv'; + $current_grant = 'Show_view_priv'; + } elseif ($current_grant == 'Delete versioning rows_priv') { + $tmp_current_grant = 'DeleteHistoricalRows_priv'; + $current_grant = 'Delete_history_priv'; + } else { + $tmp_current_grant = $current_grant; + } + + $html_output .= '
    ' . "\n" + . '' . "\n"; + + $privGlobalName1 = 'strPrivDesc' + . mb_substr( + $tmp_current_grant, + 0, + - 5 + ); + $html_output .= '' . "\n" + . '
    ' . "\n"; + } // end foreach () + return $html_output; + } + + /** + * Get HTML for global or database specific privileges + * + * @param string $db the database + * @param string $table the table + * @param array $row first row from result or boolean false + * + * @return string $html_output + */ + public static function getHtmlForGlobalOrDbSpecificPrivs($db, $table, array $row) + { + $privTable_names = array(0 => __('Data'), + 1 => __('Structure'), + 2 => __('Administration') + ); + $privTable = array(); + // d a t a + $privTable[0] = self::getDataPrivilegeTable($db); + + // s t r u c t u r e + $privTable[1] = self::getStructurePrivilegeTable($table, $row); + + // a d m i n i s t r a t i o n + $privTable[2] = self::getAdministrationPrivilegeTable($db); + + $html_output = ''; + if ($db == '*') { + $legend = __('Global privileges'); + $menu_label = __('Global'); + } elseif ($table == '*') { + $legend = __('Database-specific privileges'); + $menu_label = __('Database'); + } else { + $legend = __('Table-specific privileges'); + $menu_label = __('Table'); + } + $html_output .= '
    ' + . '' . $legend + . ' ' + . ' ' + . '' + . '

    ' + . __('Note: MySQL privilege names are expressed in English.') + . '

    '; + + // Output the Global privilege tables with checkboxes + $html_output .= self::getHtmlForGlobalPrivTableWithCheckboxes( + $privTable, $privTable_names, $row + ); + + // The "Resource limits" box is not displayed for db-specific privs + if ($db == '*') { + $html_output .= self::getHtmlForResourceLimits($row); + $html_output .= self::getHtmlForRequires($row); + } + // for Safari 2.0.2 + $html_output .= '
    '; + + return $html_output; + } + + /** + * Get data privilege table as an array + * + * @param string $db the database + * + * @return string data privilege table + */ + public static function getDataPrivilegeTable($db) + { + $data_privTable = array( + array('Select', 'SELECT', __('Allows reading data.')), + array('Insert', 'INSERT', __('Allows inserting and replacing data.')), + array('Update', 'UPDATE', __('Allows changing data.')), + array('Delete', 'DELETE', __('Allows deleting data.')) + ); + if ($db == '*') { + $data_privTable[] + = array('File', + 'FILE', + __('Allows importing data from and exporting data into files.') + ); + } + return $data_privTable; + } + + /** + * Get structure privilege table as an array + * + * @param string $table the table + * @param array $row first row from result or boolean false + * + * @return string structure privilege table + */ + public static function getStructurePrivilegeTable($table, array $row) + { + $structure_privTable = array( + array('Create', + 'CREATE', + ($table == '*' + ? __('Allows creating new databases and tables.') + : __('Allows creating new tables.') + ) + ), + array('Alter', + 'ALTER', + __('Allows altering the structure of existing tables.') + ), + array('Index', 'INDEX', __('Allows creating and dropping indexes.')), + array('Drop', + 'DROP', + ($table == '*' + ? __('Allows dropping databases and tables.') + : __('Allows dropping tables.') + ) + ), + array('Create_tmp_table', + 'CREATE TEMPORARY TABLES', + __('Allows creating temporary tables.') + ), + array('Show_view', + 'SHOW VIEW', + __('Allows performing SHOW CREATE VIEW queries.') + ), + array('Create_routine', + 'CREATE ROUTINE', + __('Allows creating stored routines.') + ), + array('Alter_routine', + 'ALTER ROUTINE', + __('Allows altering and dropping stored routines.') + ), + array('Execute', 'EXECUTE', __('Allows executing stored routines.')), + ); + // this one is for a db-specific priv: Create_view_priv + if (isset($row['Create_view_priv'])) { + $structure_privTable[] = array('Create_view', + 'CREATE VIEW', + __('Allows creating new views.') + ); + } + // this one is for a table-specific priv: Create View_priv + if (isset($row['Create View_priv'])) { + $structure_privTable[] = array('Create View', + 'CREATE VIEW', + __('Allows creating new views.') + ); + } + if (isset($row['Event_priv'])) { + // MySQL 5.1.6 + $structure_privTable[] = array('Event', + 'EVENT', + __('Allows to set up events for the event scheduler.') + ); + $structure_privTable[] = array('Trigger', + 'TRIGGER', + __('Allows creating and dropping triggers.') + ); + } + return $structure_privTable; + } + + /** + * Get administration privilege table as an array + * + * @param string $db the table + * + * @return string administration privilege table + */ + public static function getAdministrationPrivilegeTable($db) + { + if ($db == '*') { + $adminPrivTable = array( + array('Grant', + 'GRANT', + __( + 'Allows adding users and privileges ' + . 'without reloading the privilege tables.' + ) + ), + ); + $adminPrivTable[] = array('Super', + 'SUPER', + __( + 'Allows connecting, even if maximum number ' + . 'of connections is reached; required for ' + . 'most administrative operations like ' + . 'setting global variables or killing threads of other users.' + ) + ); + $adminPrivTable[] = array('Process', + 'PROCESS', + __('Allows viewing processes of all users.') + ); + $adminPrivTable[] = array('Reload', + 'RELOAD', + __('Allows reloading server settings and flushing the server\'s caches.') + ); + $adminPrivTable[] = array('Shutdown', + 'SHUTDOWN', + __('Allows shutting down the server.') + ); + $adminPrivTable[] = array('Show_db', + 'SHOW DATABASES', + __('Gives access to the complete list of databases.') + ); + } + else { + $adminPrivTable = array( + array('Grant', + 'GRANT', + __( + 'Allows user to give to other users or remove from other' + . ' users the privileges that user possess yourself.' + ) + ), + ); + } + $adminPrivTable[] = array('Lock_tables', + 'LOCK TABLES', + __('Allows locking tables for the current thread.') + ); + $adminPrivTable[] = array('References', + 'REFERENCES', + __('Has no effect in this MySQL version.') + ); + if ($db == '*') { + $adminPrivTable[] = array('Repl_client', + 'REPLICATION CLIENT', + __('Allows the user to ask where the slaves / masters are.') + ); + $adminPrivTable[] = array('Repl_slave', + 'REPLICATION SLAVE', + __('Needed for the replication slaves.') + ); + $adminPrivTable[] = array('Create_user', + 'CREATE USER', + __('Allows creating, dropping and renaming user accounts.') + ); + } + return $adminPrivTable; + } + + /** + * Get HTML snippet for global privileges table with check boxes + * + * @param array $privTable privileges table array + * @param array $privTableNames names of the privilege tables + * (Data, Structure, Administration) + * @param array $row first row from result or boolean false + * + * @return string $html_output + */ + public static function getHtmlForGlobalPrivTableWithCheckboxes( + array $privTable, array $privTableNames, array $row + ) { + return Template::get('privileges/global_priv_table')->render(array( + 'priv_table' => $privTable, + 'priv_table_names' => $privTableNames, + 'row' => $row, + )); + } + + /** + * Gets the currently active authentication plugins + * + * @param string $orig_auth_plugin Default Authentication plugin + * @param string $mode are we creating a new user or are we just + * changing one? + * (allowed values: 'new', 'edit', 'change_pw') + * @param string $versions Is MySQL version newer or older than 5.5.7 + * + * @return string $html_output + */ + public static function getHtmlForAuthPluginsDropdown( + $orig_auth_plugin, + $mode = 'new', + $versions = 'new' + ) { + $select_id = 'select_authentication_plugin' + . ($mode =='change_pw' ? '_cp' : ''); + + if ($versions == 'new') { + $active_auth_plugins = self::getActiveAuthPlugins(); + + if (isset($active_auth_plugins['mysql_old_password'])) { + unset($active_auth_plugins['mysql_old_password']); + } + } else { + $active_auth_plugins = array( + 'mysql_native_password' => __('Native MySQL authentication') + ); + } + + $html_output = Util::getDropdown( + 'authentication_plugin', + $active_auth_plugins, + $orig_auth_plugin, + $select_id + ); + + return $html_output; + } + + /** + * Gets the currently active authentication plugins + * + * @return array $result array of plugin names and descriptions + */ + public static function getActiveAuthPlugins() + { + $get_plugins_query = "SELECT `PLUGIN_NAME`, `PLUGIN_DESCRIPTION`" + . " FROM `information_schema`.`PLUGINS` " + . "WHERE `PLUGIN_TYPE` = 'AUTHENTICATION';"; + $resultset = $GLOBALS['dbi']->query($get_plugins_query); + + $result = array(); + + while ($row = $GLOBALS['dbi']->fetchAssoc($resultset)) { + // if description is known, enable its translation + if ('mysql_native_password' == $row['PLUGIN_NAME']) { + $row['PLUGIN_DESCRIPTION'] = __('Native MySQL authentication'); + } elseif ('sha256_password' == $row['PLUGIN_NAME']) { + $row['PLUGIN_DESCRIPTION'] = __('SHA256 password authentication'); + } + + $result[$row['PLUGIN_NAME']] = $row['PLUGIN_DESCRIPTION']; + } + + return $result; + } + + /** + * Displays the fields used by the "new user" form as well as the + * "change login information / copy user" form. + * + * @param string $mode are we creating a new user or are we just + * changing one? (allowed values: 'new', 'change') + * @param string $username User name + * @param string $hostname Host name + * + * @global array $cfg the phpMyAdmin configuration + * @global resource $user_link the database connection + * + * @return string $html_output a HTML snippet + */ + public static function getHtmlForLoginInformationFields( + $mode = 'new', + $username = null, + $hostname = null + ) { + list($username_length, $hostname_length) = self::getUsernameAndHostnameLength(); + + if (isset($GLOBALS['username']) && strlen($GLOBALS['username']) === 0) { + $GLOBALS['pred_username'] = 'any'; + } + $html_output = '
    ' . "\n" + . '' . __('Login Information') . '' . "\n" + . '
    ' . "\n" + . '' . "\n" + . '' . "\n"; + + $html_output .= '' . "\n" + . '' . "\n"; + + $html_output .= '' . "\n"; + + $html_output .= '
    ' + . Message::notice( + __( + 'An account already exists with the same username ' + . 'but possibly a different hostname.' + ) + )->getDisplay() + . '
    '; + $html_output .= '
    '; + + $html_output .= '
    ' . "\n" + . '' . "\n"; + + $html_output .= '' . "\n" + . ' ' . "\n" + . '' . "\n"; + + $html_output .= '' . "\n" + . Util::showHint( + __( + 'When Host table is used, this field is ignored ' + . 'and values stored in Host table are used instead.' + ) + ) + . '
    ' . "\n"; + + $html_output .= '
    ' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n" + . 'Strength: ' + . ' ' + . '' . "\n" + . '
    ' . "\n"; + + $html_output .= '
    ' . "\n" + . '' . "\n" + . ' ' . "\n" + . '' . "\n" + . '
    ' . "\n" + . '
    ' + . ' ' . "\n"; + + $auth_plugin_dropdown = self::getHtmlForAuthPluginsDropdown( + $orig_auth_plugin, $mode, 'new' + ); + } else { + $html_output .= __('Password Hashing Method') + . ' ' . "\n"; + $auth_plugin_dropdown = self::getHtmlForAuthPluginsDropdown( + $orig_auth_plugin, $mode, 'old' + ); + } + $html_output .= $auth_plugin_dropdown; + + $html_output .= '' + . Message::notice( + __( + 'This method requires using an \'SSL connection\' ' + . 'or an \'unencrypted connection that encrypts the password ' + . 'using RSA\'; while connecting to the server.' + ) + . Util::showMySQLDocu('sha256-authentication-plugin') + ) + ->getDisplay() + . '
    '; + + $html_output .= '' . "\n" + // Generate password added here via jQuery + . '
    ' . "\n"; + + return $html_output; + } // end of the 'self::getHtmlForLoginInformationFields()' function + + /** + * Get username and hostname length + * + * @return array username length and hostname length + */ + public static function getUsernameAndHostnameLength() + { + /* Fallback values */ + $username_length = 16; + $hostname_length = 41; + + /* Try to get real lengths from the database */ + $fields_info = $GLOBALS['dbi']->fetchResult( + 'SELECT COLUMN_NAME, CHARACTER_MAXIMUM_LENGTH ' + . 'FROM information_schema.columns ' + . "WHERE table_schema = 'mysql' AND table_name = 'user' " + . "AND COLUMN_NAME IN ('User', 'Host')" + ); + foreach ($fields_info as $val) { + if ($val['COLUMN_NAME'] == 'User') { + $username_length = $val['CHARACTER_MAXIMUM_LENGTH']; + } elseif ($val['COLUMN_NAME'] == 'Host') { + $hostname_length = $val['CHARACTER_MAXIMUM_LENGTH']; + } + } + return array($username_length, $hostname_length); + } + + /** + * Get current authentication plugin in use - for a user or globally + * + * @param string $mode are we creating a new user or are we just + * changing one? (allowed values: 'new', 'change') + * @param string $username User name + * @param string $hostname Host name + * + * @return string authentication plugin in use + */ + public static function getCurrentAuthenticationPlugin( + $mode = 'new', + $username = null, + $hostname = null + ) { + /* Fallback (standard) value */ + $authentication_plugin = 'mysql_native_password'; + $serverVersion = $GLOBALS['dbi']->getVersion(); + + if (isset($username) && isset($hostname) + && $mode == 'change' + ) { + $row = $GLOBALS['dbi']->fetchSingleRow( + 'SELECT `plugin` FROM `mysql`.`user` WHERE `User` = "' + . $GLOBALS['dbi']->escapeString($username) + . '" AND `Host` = "' + . $GLOBALS['dbi']->escapeString($hostname) + . '" LIMIT 1' + ); + // Table 'mysql'.'user' may not exist for some previous + // versions of MySQL - in that case consider fallback value + if (isset($row) && $row) { + $authentication_plugin = $row['plugin']; + } + } elseif ($mode == 'change') { + list($username, $hostname) = $GLOBALS['dbi']->getCurrentUserAndHost(); + + $row = $GLOBALS['dbi']->fetchSingleRow( + 'SELECT `plugin` FROM `mysql`.`user` WHERE `User` = "' + . $GLOBALS['dbi']->escapeString($username) + . '" AND `Host` = "' + . $GLOBALS['dbi']->escapeString($hostname) + . '"' + ); + if (isset($row) && $row && ! empty($row['plugin'])) { + $authentication_plugin = $row['plugin']; + } + } elseif ($serverVersion >= 50702) { + $row = $GLOBALS['dbi']->fetchSingleRow( + 'SELECT @@default_authentication_plugin' + ); + $authentication_plugin = is_array($row) ? $row['@@default_authentication_plugin'] : null; + } + + return $authentication_plugin; + } + + /** + * Returns all the grants for a certain user on a certain host + * Used in the export privileges for all users section + * + * @param string $user User name + * @param string $host Host name + * + * @return string containing all the grants text + */ + public static function getGrants($user, $host) + { + $grants = $GLOBALS['dbi']->fetchResult( + "SHOW GRANTS FOR '" + . $GLOBALS['dbi']->escapeString($user) . "'@'" + . $GLOBALS['dbi']->escapeString($host) . "'" + ); + $response = ''; + foreach ($grants as $one_grant) { + $response .= $one_grant . ";\n\n"; + } + return $response; + } // end of the 'self::getGrants()' function + + /** + * Update password and get message for password updating + * + * @param string $err_url error url + * @param string $username username + * @param string $hostname hostname + * + * @return string $message success or error message after updating password + */ + public static function updatePassword($err_url, $username, $hostname) + { + // similar logic in user_password.php + $message = ''; + + if (empty($_POST['nopass']) + && isset($_POST['pma_pw']) + && isset($_POST['pma_pw2']) + ) { + if ($_POST['pma_pw'] != $_POST['pma_pw2']) { + $message = Message::error(__('The passwords aren\'t the same!')); + } elseif (empty($_POST['pma_pw']) || empty($_POST['pma_pw2'])) { + $message = Message::error(__('The password is empty!')); + } + } + + // here $nopass could be == 1 + if (empty($message)) { + $hashing_function = 'PASSWORD'; + $serverType = Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); + $authentication_plugin + = (isset($_POST['authentication_plugin']) + ? $_POST['authentication_plugin'] + : self::getCurrentAuthenticationPlugin( + 'change', + $username, + $hostname + )); + + // Use 'ALTER USER ...' syntax for MySQL 5.7.6+ + if ($serverType == 'MySQL' + && $serverVersion >= 50706 + ) { + if ($authentication_plugin != 'mysql_old_password') { + $query_prefix = "ALTER USER '" + . $GLOBALS['dbi']->escapeString($username) + . "'@'" . $GLOBALS['dbi']->escapeString($hostname) . "'" + . " IDENTIFIED WITH " + . $authentication_plugin + . " BY '"; + } else { + $query_prefix = "ALTER USER '" + . $GLOBALS['dbi']->escapeString($username) + . "'@'" . $GLOBALS['dbi']->escapeString($hostname) . "'" + . " IDENTIFIED BY '"; + } + + // in $sql_query which will be displayed, hide the password + $sql_query = $query_prefix . "*'"; + + $local_query = $query_prefix + . $GLOBALS['dbi']->escapeString($_POST['pma_pw']) . "'"; + } elseif ($serverType == 'MariaDB' && $serverVersion >= 10000) { + // MariaDB uses "SET PASSWORD" syntax to change user password. + // On Galera cluster only DDL queries are replicated, since + // users are stored in MyISAM storage engine. + $query_prefix = "SET PASSWORD FOR '" + . $GLOBALS['dbi']->escapeString($username) + . "'@'" . $GLOBALS['dbi']->escapeString($hostname) . "'" + . " = PASSWORD ('"; + $sql_query = $local_query = $query_prefix + . $GLOBALS['dbi']->escapeString($_POST['pma_pw']) . "')"; + } elseif ($serverType == 'MariaDB' + && $serverVersion >= 50200 + && $GLOBALS['dbi']->isSuperuser() + ) { + // Use 'UPDATE `mysql`.`user` ...' Syntax for MariaDB 5.2+ + if ($authentication_plugin == 'mysql_native_password') { + // Set the hashing method used by PASSWORD() + // to be 'mysql_native_password' type + $GLOBALS['dbi']->tryQuery('SET old_passwords = 0;'); + + } elseif ($authentication_plugin == 'sha256_password') { + // Set the hashing method used by PASSWORD() + // to be 'sha256_password' type + $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 2;'); + } + + $hashedPassword = self::getHashedPassword($_POST['pma_pw']); + + $sql_query = 'SET PASSWORD FOR \'' + . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\' = ' + . (($_POST['pma_pw'] == '') + ? '\'\'' + : $hashing_function . '(\'' + . preg_replace('@.@s', '*', $_POST['pma_pw']) . '\')'); + + $local_query = "UPDATE `mysql`.`user` SET " + . " `authentication_string` = '" . $hashedPassword + . "', `Password` = '', " + . " `plugin` = '" . $authentication_plugin . "'" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) + . "' AND Host = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; + } else { + // USE 'SET PASSWORD ...' syntax for rest of the versions + // Backup the old value, to be reset later + $row = $GLOBALS['dbi']->fetchSingleRow( + 'SELECT @@old_passwords;' + ); + $orig_value = $row['@@old_passwords']; + $update_plugin_query = "UPDATE `mysql`.`user` SET" + . " `plugin` = '" . $authentication_plugin . "'" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) + . "' AND Host = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; + + // Update the plugin for the user + if (!($GLOBALS['dbi']->tryQuery($update_plugin_query))) { + Util::mysqlDie( + $GLOBALS['dbi']->getError(), + $update_plugin_query, + false, $err_url + ); + } + $GLOBALS['dbi']->tryQuery("FLUSH PRIVILEGES;"); + + if ($authentication_plugin == 'mysql_native_password') { + // Set the hashing method used by PASSWORD() + // to be 'mysql_native_password' type + $GLOBALS['dbi']->tryQuery('SET old_passwords = 0;'); + } elseif ($authentication_plugin == 'sha256_password') { + // Set the hashing method used by PASSWORD() + // to be 'sha256_password' type + $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 2;'); + } + $sql_query = 'SET PASSWORD FOR \'' + . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\' = ' + . (($_POST['pma_pw'] == '') + ? '\'\'' + : $hashing_function . '(\'' + . preg_replace('@.@s', '*', $_POST['pma_pw']) . '\')'); + + $local_query = 'SET PASSWORD FOR \'' + . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\' = ' + . (($_POST['pma_pw'] == '') ? '\'\'' : $hashing_function + . '(\'' . $GLOBALS['dbi']->escapeString($_POST['pma_pw']) . '\')'); + } + + if (!($GLOBALS['dbi']->tryQuery($local_query))) { + Util::mysqlDie( + $GLOBALS['dbi']->getError(), $sql_query, false, $err_url + ); + } + // Flush privileges after successful password change + $GLOBALS['dbi']->tryQuery("FLUSH PRIVILEGES;"); + + $message = Message::success( + __('The password for %s was changed successfully.') + ); + $message->addParam('\'' . $username . '\'@\'' . $hostname . '\''); + if (isset($orig_value)) { + $GLOBALS['dbi']->tryQuery( + 'SET `old_passwords` = ' . $orig_value . ';' + ); + } + } + return $message; + } + + /** + * Revokes privileges and get message and SQL query for privileges revokes + * + * @param string $dbname database name + * @param string $tablename table name + * @param string $username username + * @param string $hostname host name + * @param string $itemType item type + * + * @return array ($message, $sql_query) + */ + public static function getMessageAndSqlQueryForPrivilegesRevoke($dbname, + $tablename, $username, $hostname, $itemType + ) { + $db_and_table = self::wildcardEscapeForGrant($dbname, $tablename); + + $sql_query0 = 'REVOKE ALL PRIVILEGES ON ' . $itemType . ' ' . $db_and_table + . ' FROM \'' + . $GLOBALS['dbi']->escapeString($username) . '\'@\'' + . $GLOBALS['dbi']->escapeString($hostname) . '\';'; + + $sql_query1 = 'REVOKE GRANT OPTION ON ' . $itemType . ' ' . $db_and_table + . ' FROM \'' . $GLOBALS['dbi']->escapeString($username) . '\'@\'' + . $GLOBALS['dbi']->escapeString($hostname) . '\';'; + + $GLOBALS['dbi']->query($sql_query0); + if (! $GLOBALS['dbi']->tryQuery($sql_query1)) { + // this one may fail, too... + $sql_query1 = ''; + } + $sql_query = $sql_query0 . ' ' . $sql_query1; + $message = Message::success( + __('You have revoked the privileges for %s.') + ); + $message->addParam('\'' . $username . '\'@\'' . $hostname . '\''); + + return array($message, $sql_query); + } + + /** + * Get REQUIRE cluase + * + * @return string REQUIRE clause + */ + public static function getRequireClause() + { + $arr = isset($_POST['ssl_type']) ? $_POST : $GLOBALS; + if (isset($arr['ssl_type']) && $arr['ssl_type'] == 'SPECIFIED') { + $require = array(); + if (! empty($arr['ssl_cipher'])) { + $require[] = "CIPHER '" + . $GLOBALS['dbi']->escapeString($arr['ssl_cipher']) . "'"; + } + if (! empty($arr['x509_issuer'])) { + $require[] = "ISSUER '" + . $GLOBALS['dbi']->escapeString($arr['x509_issuer']) . "'"; + } + if (! empty($arr['x509_subject'])) { + $require[] = "SUBJECT '" + . $GLOBALS['dbi']->escapeString($arr['x509_subject']) . "'"; + } + if (count($require)) { + $require_clause = " REQUIRE " . implode(" AND ", $require); + } else { + $require_clause = " REQUIRE NONE"; + } + } elseif (isset($arr['ssl_type']) && $arr['ssl_type'] == 'X509') { + $require_clause = " REQUIRE X509"; + } elseif (isset($arr['ssl_type']) && $arr['ssl_type'] == 'ANY') { + $require_clause = " REQUIRE SSL"; + } else { + $require_clause = " REQUIRE NONE"; + } + + return $require_clause; + } + + /** + * Get a WITH clause for 'update privileges' and 'add user' + * + * @return string $sql_query + */ + public static function getWithClauseForAddUserAndUpdatePrivs() + { + $sql_query = ''; + if (((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y') + || (isset($GLOBALS['Grant_priv']) && $GLOBALS['Grant_priv'] == 'Y')) + && ! ((Util::getServerType() == 'MySQL' || Util::getServerType() == 'Percona Server') + && $GLOBALS['dbi']->getVersion() >= 80011) + ) { + $sql_query .= ' GRANT OPTION'; + } + if (isset($_POST['max_questions']) || isset($GLOBALS['max_questions'])) { + $max_questions = isset($_POST['max_questions']) + ? (int)$_POST['max_questions'] : (int)$GLOBALS['max_questions']; + $max_questions = max(0, $max_questions); + $sql_query .= ' MAX_QUERIES_PER_HOUR ' . $max_questions; + } + if (isset($_POST['max_connections']) || isset($GLOBALS['max_connections'])) { + $max_connections = isset($_POST['max_connections']) + ? (int)$_POST['max_connections'] : (int)$GLOBALS['max_connections']; + $max_connections = max(0, $max_connections); + $sql_query .= ' MAX_CONNECTIONS_PER_HOUR ' . $max_connections; + } + if (isset($_POST['max_updates']) || isset($GLOBALS['max_updates'])) { + $max_updates = isset($_POST['max_updates']) + ? (int)$_POST['max_updates'] : (int)$GLOBALS['max_updates']; + $max_updates = max(0, $max_updates); + $sql_query .= ' MAX_UPDATES_PER_HOUR ' . $max_updates; + } + if (isset($_POST['max_user_connections']) + || isset($GLOBALS['max_user_connections']) + ) { + $max_user_connections = isset($_POST['max_user_connections']) + ? (int)$_POST['max_user_connections'] + : (int)$GLOBALS['max_user_connections']; + $max_user_connections = max(0, $max_user_connections); + $sql_query .= ' MAX_USER_CONNECTIONS ' . $max_user_connections; + } + return ((!empty($sql_query)) ? ' WITH' . $sql_query : ''); + } + + /** + * Get HTML for addUsersForm, This function call if isset($_GET['adduser']) + * + * @param string $dbname database name + * + * @return string HTML for addUserForm + */ + public static function getHtmlForAddUser($dbname) + { + $html_output = '

    ' . "\n" + . Util::getIcon('b_usradd') . __('Add user account') . "\n" + . '

    ' . "\n" + . '
    ' . "\n" + . Url::getHiddenInputs('', '') + . self::getHtmlForLoginInformationFields('new'); + + $html_output .= '
    ' . "\n" + . '' . __('Database for user account') . '' . "\n"; + + $html_output .= Template::get('checkbox') + ->render( + array( + 'html_field_name' => 'createdb-1', + 'label' => __('Create database with same name and grant all privileges.'), + 'checked' => false, + 'onclick' => false, + 'html_field_id' => 'createdb-1', + ) + ); + $html_output .= '
    ' . "\n"; + $html_output .= Template::get('checkbox') + ->render( + array( + 'html_field_name' => 'createdb-2', + 'label' => __('Grant all privileges on wildcard name (username\\_%).'), + 'checked' => false, + 'onclick' => false, + 'html_field_id' => 'createdb-2', + ) + ); + $html_output .= '
    ' . "\n"; + + if (! empty($dbname) ) { + $html_output .= Template::get('checkbox') + ->render( + array( + 'html_field_name' => 'createdb-3', + 'label' => sprintf(__('Grant all privileges on database %s.'), htmlspecialchars($dbname)), + 'checked' => true, + 'onclick' => false, + 'html_field_id' => 'createdb-3', + ) + ); + $html_output .= '' . "\n"; + $html_output .= '
    ' . "\n"; + } + + $html_output .= '
    ' . "\n"; + if ($GLOBALS['is_grantuser']) { + $html_output .= self::getHtmlToDisplayPrivilegesTable('*', '*', false); + } + $html_output .= '' . "\n" + . '
    ' . "\n"; + + return $html_output; + } + + /** + * Get the list of privileges and list of compared privileges as strings + * and return a array that contains both strings + * + * @return array $list_of_privileges, $list_of_compared_privileges + */ + public static function getListOfPrivilegesAndComparedPrivileges() + { + $list_of_privileges + = '`User`, ' + . '`Host`, ' + . '`Select_priv`, ' + . '`Insert_priv`, ' + . '`Update_priv`, ' + . '`Delete_priv`, ' + . '`Create_priv`, ' + . '`Drop_priv`, ' + . '`Grant_priv`, ' + . '`Index_priv`, ' + . '`Alter_priv`, ' + . '`References_priv`, ' + . '`Create_tmp_table_priv`, ' + . '`Lock_tables_priv`, ' + . '`Create_view_priv`, ' + . '`Show_view_priv`, ' + . '`Create_routine_priv`, ' + . '`Alter_routine_priv`, ' + . '`Execute_priv`'; + + $listOfComparedPrivs + = '`Select_priv` = \'N\'' + . ' AND `Insert_priv` = \'N\'' + . ' AND `Update_priv` = \'N\'' + . ' AND `Delete_priv` = \'N\'' + . ' AND `Create_priv` = \'N\'' + . ' AND `Drop_priv` = \'N\'' + . ' AND `Grant_priv` = \'N\'' + . ' AND `References_priv` = \'N\'' + . ' AND `Create_tmp_table_priv` = \'N\'' + . ' AND `Lock_tables_priv` = \'N\'' + . ' AND `Create_view_priv` = \'N\'' + . ' AND `Show_view_priv` = \'N\'' + . ' AND `Create_routine_priv` = \'N\'' + . ' AND `Alter_routine_priv` = \'N\'' + . ' AND `Execute_priv` = \'N\''; + + $list_of_privileges .= + ', `Event_priv`, ' + . '`Trigger_priv`'; + $listOfComparedPrivs .= + ' AND `Event_priv` = \'N\'' + . ' AND `Trigger_priv` = \'N\''; + return array($list_of_privileges, $listOfComparedPrivs); + } + + /** + * Get the HTML for routine based privileges + * + * @param string $db database name + * @param string $index_checkbox starting index for rows to be added + * + * @return string $html_output + */ + public static function getHtmlTableBodyForSpecificDbRoutinePrivs($db, $index_checkbox) + { + $sql_query = 'SELECT * FROM `mysql`.`procs_priv` WHERE Db = \'' . $GLOBALS['dbi']->escapeString($db) . '\';'; + $res = $GLOBALS['dbi']->query($sql_query); + $html_output = ''; + while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { + + $html_output .= '
    ' . htmlspecialchars($row['User']) + . '' . htmlspecialchars($row['Host']) + . '' . 'routine' + . '' . '' . htmlspecialchars($row['Routine_name']) . '' + . '' . 'Yes' + . ''; + if ($GLOBALS['is_grantuser']) { + $specific_db = (isset($row['Db']) && $row['Db'] != '*') + ? $row['Db'] : ''; + $specific_table = (isset($row['Table_name']) + && $row['Table_name'] != '*') + ? $row['Table_name'] : ''; + $html_output .= self::getUserLink( + 'edit', + $current_user, + $current_host, + $specific_db, + $specific_table, + $routine + ); + } + $html_output .= ''; + $html_output .= self::getUserLink( + 'export', + $current_user, + $current_host, + $specific_db, + $specific_table, + $routine + ); + $html_output .= '
    '; + $html_output .= self::getHtmlForPrivsTableHead(); + $privMap = self::getPrivMap($db); + $html_output .= self::getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db); + $html_output .= '
    '; + $html_output .= '
    '; + + $html_output .= '
    '; + $html_output .= Template::get('select_all') + ->render( + array( + 'pma_theme_image' => $GLOBALS['pmaThemeImage'], + 'text_dir' => $GLOBALS['text_dir'], + 'form_name' => "usersForm", + ) + ); + $html_output .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Export'), 'b_tblexport', 'export' + ); + + $html_output .= ''; + $html_output .= '
    '; + $html_output .= ''; + } else { + $html_output .= self::getHtmlForViewUsersError(); + } + + $response = Response::getInstance(); + if ($response->isAjax() == true + && empty($_REQUEST['ajax_page_request']) + ) { + $message = Message::success(__('User has been added.')); + $response->addJSON('message', $message); + $response->addJSON('user_form', $html_output); + exit; + } else { + // Offer to create a new user for the current database + $html_output .= self::getAddUserHtmlFieldset($db); + } + return $html_output; + } + + /** + * Get the HTML for user form and check the privileges for a particular table. + * + * @param string $db database name + * @param string $table table name + * + * @return string $html_output + */ + public static function getHtmlForSpecificTablePrivileges($db, $table) + { + $html_output = ''; + if ($GLOBALS['dbi']->isSuperuser()) { + // check the privileges for a particular table. + $html_output = '
    '; + $html_output .= Url::getHiddenInputs($db, $table); + $html_output .= '
    '; + $html_output .= '' + . Util::getIcon('b_usrcheck') + . sprintf( + __('Users having access to "%s"'), + '' + . htmlspecialchars($db) . '.' . htmlspecialchars($table) + . '' + ) + . ''; + + $html_output .= '
    '; + $html_output .= ''; + $html_output .= self::getHtmlForPrivsTableHead(); + $privMap = self::getPrivMap($db); + $sql_query = "SELECT `User`, `Host`, `Db`," + . " 't' AS `Type`, `Table_name`, `Table_priv`" + . " FROM `mysql`.`tables_priv`" + . " WHERE '" . $GLOBALS['dbi']->escapeString($db) . "' LIKE `Db`" + . " AND '" . $GLOBALS['dbi']->escapeString($table) . "' LIKE `Table_name`" + . " AND NOT (`Table_priv` = '' AND Column_priv = '')" + . " ORDER BY `User` ASC, `Host` ASC, `Db` ASC, `Table_priv` ASC;"; + $res = $GLOBALS['dbi']->query($sql_query); + self::mergePrivMapFromResult($privMap, $res); + $html_output .= self::getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db); + $html_output .= '
    '; + + $html_output .= '
    '; + $html_output .= Template::get('select_all') + ->render( + array( + 'pma_theme_image' => $GLOBALS['pmaThemeImage'], + 'text_dir' => $GLOBALS['text_dir'], + 'form_name' => "usersForm", + ) + ); + $html_output .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Export'), 'b_tblexport', 'export' + ); + + $html_output .= '
    '; + $html_output .= '
    '; + } else { + $html_output .= self::getHtmlForViewUsersError(); + } + // Offer to create a new user for the current database + $html_output .= self::getAddUserHtmlFieldset($db, $table); + return $html_output; + } + + /** + * gets privilege map + * + * @param string $db the database + * + * @return array $privMap the privilege map + */ + public static function getPrivMap($db) + { + list($listOfPrivs, $listOfComparedPrivs) + = self::getListOfPrivilegesAndComparedPrivileges(); + $sql_query + = "(" + . " SELECT " . $listOfPrivs . ", '*' AS `Db`, 'g' AS `Type`" + . " FROM `mysql`.`user`" + . " WHERE NOT (" . $listOfComparedPrivs . ")" + . ")" + . " UNION " + . "(" + . " SELECT " . $listOfPrivs . ", `Db`, 'd' AS `Type`" + . " FROM `mysql`.`db`" + . " WHERE '" . $GLOBALS['dbi']->escapeString($db) . "' LIKE `Db`" + . " AND NOT (" . $listOfComparedPrivs . ")" + . ")" + . " ORDER BY `User` ASC, `Host` ASC, `Db` ASC;"; + $res = $GLOBALS['dbi']->query($sql_query); + $privMap = array(); + self::mergePrivMapFromResult($privMap, $res); + return $privMap; + } + + /** + * merge privilege map and rows from resultset + * + * @param array &$privMap the privilege map reference + * @param object $result the resultset of query + * + * @return void + */ + public static function mergePrivMapFromResult(array &$privMap, $result) + { + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $user = $row['User']; + $host = $row['Host']; + if (! isset($privMap[$user])) { + $privMap[$user] = array(); + } + if (! isset($privMap[$user][$host])) { + $privMap[$user][$host] = array(); + } + $privMap[$user][$host][] = $row; + } + } + + /** + * Get HTML snippet for privileges table head + * + * @return string $html_output + */ + public static function getHtmlForPrivsTableHead() + { + return '' + . '' + . '' + . '' . __('User name') . '' + . '' . __('Host name') . '' + . '' . __('Type') . '' + . '' . __('Privileges') . '' + . '' . __('Grant') . '' + . '' . __('Action') . '' + . '' + . ''; + } + + /** + * Get HTML error for View Users form + * For non superusers such as grant/create users + * + * @return string $html_output + */ + public static function getHtmlForViewUsersError() + { + return Message::error( + __('Not enough privilege to view users.') + )->getDisplay(); + } + + /** + * Get HTML snippet for table body of specific database or table privileges + * + * @param array $privMap privilege map + * @param string $db database + * + * @return string $html_output + */ + public static function getHtmlTableBodyForSpecificDbOrTablePrivs($privMap, $db) + { + $html_output = ''; + $index_checkbox = 0; + if (empty($privMap)) { + $html_output .= '' + . '' + . __('No user found.') + . '' + . '' + . ''; + return $html_output; + } + + foreach ($privMap as $current_user => $val) { + foreach ($val as $current_host => $current_privileges) { + $nbPrivileges = count($current_privileges); + $html_output .= ''; + + $value = htmlspecialchars($current_user . '&#27;' . $current_host); + $html_output .= ' 1) { + $html_output .= ' rowspan="' . $nbPrivileges . '"'; + } + $html_output .= '>'; + $html_output .= '' . "\n"; + + // user + $html_output .= ' 1) { + $html_output .= ' rowspan="' . $nbPrivileges . '"'; + } + $html_output .= '>'; + if (empty($current_user)) { + $html_output .= '' + . __('Any') . ''; + } else { + $html_output .= htmlspecialchars($current_user); + } + $html_output .= ''; + + // host + $html_output .= ' 1) { + $html_output .= ' rowspan="' . $nbPrivileges . '"'; + } + $html_output .= '>'; + $html_output .= htmlspecialchars($current_host); + $html_output .= ''; + + $html_output .= self::getHtmlListOfPrivs( + $db, $current_privileges, $current_user, + $current_host + ); + } + } + + //For fetching routine based privileges + $html_output .= self::getHtmlTableBodyForSpecificDbRoutinePrivs($db, $index_checkbox); + $html_output .= ''; + + return $html_output; + } + + /** + * Get HTML to display privileges + * + * @param string $db Database name + * @param array $current_privileges List of privileges + * @param string $current_user Current user + * @param string $current_host Current host + * + * @return string HTML to display privileges + */ + public static function getHtmlListOfPrivs( + $db, array $current_privileges, $current_user, + $current_host + ) { + $nbPrivileges = count($current_privileges); + $html_output = null; + for ($i = 0; $i < $nbPrivileges; $i++) { + $current = $current_privileges[$i]; + + // type + $html_output .= ''; + if ($current['Type'] == 'g') { + $html_output .= __('global'); + } elseif ($current['Type'] == 'd') { + if ($current['Db'] == Util::escapeMysqlWildcards($db)) { + $html_output .= __('database-specific'); + } else { + $html_output .= __('wildcard') . ': ' + . '' + . htmlspecialchars($current['Db']) + . ''; + } + } elseif ($current['Type'] == 't') { + $html_output .= __('table-specific'); + } + $html_output .= ''; + + // privileges + $html_output .= ''; + if (isset($current['Table_name'])) { + $privList = explode(',', $current['Table_priv']); + $privs = array(); + $grantsArr = self::getTableGrantsArray(); + foreach ($grantsArr as $grant) { + $privs[$grant[0]] = 'N'; + foreach ($privList as $priv) { + if ($grant[0] == $priv) { + $privs[$grant[0]] = 'Y'; + } + } + } + $html_output .= '' + . join( + ',', + self::extractPrivInfo($privs, true, true) + ) + . ''; + } else { + $html_output .= '' + . join( + ',', + self::extractPrivInfo($current, true, false) + ) + . ''; + } + $html_output .= ''; + + // grant + $html_output .= ''; + $containsGrant = false; + if (isset($current['Table_name'])) { + $privList = explode(',', $current['Table_priv']); + foreach ($privList as $priv) { + if ($priv == 'Grant') { + $containsGrant = true; + } + } + } else { + $containsGrant = $current['Grant_priv'] == 'Y'; + } + $html_output .= ($containsGrant ? __('Yes') : __('No')); + $html_output .= ''; + + // action + $html_output .= ''; + $specific_db = (isset($current['Db']) && $current['Db'] != '*') + ? $current['Db'] : ''; + $specific_table = (isset($current['Table_name']) + && $current['Table_name'] != '*') + ? $current['Table_name'] : ''; + if ($GLOBALS['is_grantuser']) { + $html_output .= self::getUserLink( + 'edit', + $current_user, + $current_host, + $specific_db, + $specific_table + ); + } + $html_output .= ''; + $html_output .= '' + . self::getUserLink( + 'export', + $current_user, + $current_host, + $specific_db, + $specific_table + ) + . ''; + + $html_output .= ''; + if (($i + 1) < $nbPrivileges) { + $html_output .= ''; + } + } + return $html_output; + } + + /** + * Returns edit, revoke or export link for a user. + * + * @param string $linktype The link type (edit | revoke | export) + * @param string $username User name + * @param string $hostname Host name + * @param string $dbname Database name + * @param string $tablename Table name + * @param string $routinename Routine name + * @param string $initial Initial value + * + * @return string HTML code with link + */ + public static function getUserLink( + $linktype, $username, $hostname, $dbname = '', + $tablename = '', $routinename = '', $initial = '' + ) { + $html = ' $username, + 'hostname' => $hostname + ); + switch($linktype) { + case 'edit': + $params['dbname'] = $dbname; + $params['tablename'] = $tablename; + $params['routinename'] = $routinename; + break; + case 'revoke': + $params['dbname'] = $dbname; + $params['tablename'] = $tablename; + $params['routinename'] = $routinename; + $params['revokeall'] = 1; + break; + case 'export': + $params['initial'] = $initial; + $params['export'] = 1; + break; + } + + $html .= ' href="server_privileges.php'; + if ($linktype == 'revoke') { + $html .= '" data-post="' . Url::getCommon($params, '', false); + } else { + $html .= Url::getCommon($params); + } + $html .= '">'; + + switch($linktype) { + case 'edit': + $html .= Util::getIcon('b_usredit', __('Edit privileges')); + break; + case 'revoke': + $html .= Util::getIcon('b_usrdrop', __('Revoke')); + break; + case 'export': + $html .= Util::getIcon('b_tblexport', __('Export')); + break; + } + $html .= ''; + + return $html; + } + + /** + * Returns user group edit link + * + * @param string $username User name + * + * @return string HTML code with link + */ + public static function getUserGroupEditLink($username) + { + return '' + . Util::getIcon('b_usrlist', __('Edit user group')) + . ''; + } + + /** + * Returns number of defined user groups + * + * @return integer $user_group_count + */ + public static function getUserGroupCount() + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + $user_group_table = Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['usergroups']); + $sql_query = 'SELECT COUNT(*) FROM ' . $user_group_table; + $user_group_count = $GLOBALS['dbi']->fetchValue( + $sql_query, 0, 0, DatabaseInterface::CONNECT_CONTROL + ); + + return $user_group_count; + } + + /** + * Returns name of user group that user is part of + * + * @param string $username User name + * + * @return mixed usergroup if found or null if not found + */ + public static function getUserGroupForUser($username) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + + if (empty($cfgRelation['db']) + || empty($cfgRelation['users']) + ) { + return null; + } + + $user_table = Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['users']); + $sql_query = 'SELECT `usergroup` FROM ' . $user_table + . ' WHERE `username` = \'' . $username . '\'' + . ' LIMIT 1'; + + $usergroup = $GLOBALS['dbi']->fetchValue( + $sql_query, 0, 0, DatabaseInterface::CONNECT_CONTROL + ); + + if ($usergroup === false) { + return null; + } + + return $usergroup; + } + + /** + * This function return the extra data array for the ajax behavior + * + * @param string $password password + * @param string $sql_query sql query + * @param string $hostname hostname + * @param string $username username + * + * @return array $extra_data + */ + public static function getExtraDataForAjaxBehavior( + $password, $sql_query, $hostname, $username + ) { + $relation = new Relation(); + if (isset($GLOBALS['dbname'])) { + //if (preg_match('/\\\\(?:_|%)/i', $dbname)) { + if (preg_match('/(? 0) { + $extra_data['sql_query'] = Util::getMessage(null, $sql_query); + } + + if (isset($_POST['change_copy'])) { + /** + * generate html on the fly for the new user that was just created. + */ + $new_user_string = '' . "\n" + . ' ' + . '' . "\n" + . '' . "\n" + . '' . htmlspecialchars($hostname) . '' . "\n"; + + $new_user_string .= ''; + + if (! empty($password) || isset($_POST['pma_pw'])) { + $new_user_string .= __('Yes'); + } else { + $new_user_string .= '' + . __('No') + . ''; + }; + + $new_user_string .= '' . "\n"; + $new_user_string .= '' + . '' . join(', ', self::extractPrivInfo(null, true)) . '' + . ''; //Fill in privileges here + + // if $cfg['Servers'][$i]['users'] and $cfg['Servers'][$i]['usergroups'] are + // enabled + $cfgRelation = $relation->getRelationsParam(); + if (!empty($cfgRelation['users']) && !empty($cfgRelation['usergroups'])) { + $new_user_string .= ''; + } + + $new_user_string .= ''; + if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y')) { + $new_user_string .= __('Yes'); + } else { + $new_user_string .= __('No'); + } + $new_user_string .=''; + + if ($GLOBALS['is_grantuser']) { + $new_user_string .= '' + . self::getUserLink('edit', $username, $hostname) + . '' . "\n"; + } + + if ($cfgRelation['menuswork'] && $user_group_count > 0) { + $new_user_string .= '' + . self::getUserGroupEditLink($username) + . '' . "\n"; + } + + $new_user_string .= '' + . self::getUserLink( + 'export', + $username, + $hostname, + '', + '', + '', + isset($_GET['initial']) ? $_GET['initial'] : '' + ) + . '' . "\n"; + + $new_user_string .= ''; + + $extra_data['new_user_string'] = $new_user_string; + + /** + * Generate the string for this alphabet's initial, to update the user + * pagination + */ + $new_user_initial = mb_strtoupper( + mb_substr($username, 0, 1) + ); + $newUserInitialString = '' + . $new_user_initial . ''; + $extra_data['new_user_initial'] = $new_user_initial; + $extra_data['new_user_initial_string'] = $newUserInitialString; + } + + if (isset($_POST['update_privs'])) { + $extra_data['db_specific_privs'] = false; + $extra_data['db_wildcard_privs'] = false; + if (isset($dbname_is_wildcard)) { + $extra_data['db_specific_privs'] = ! $dbname_is_wildcard; + $extra_data['db_wildcard_privs'] = $dbname_is_wildcard; + } + $new_privileges = join(', ', self::extractPrivInfo(null, true)); + + $extra_data['new_privileges'] = $new_privileges; + } + + if (isset($_GET['validate_username'])) { + $sql_query = "SELECT * FROM `mysql`.`user` WHERE `User` = '" + . $GLOBALS['dbi']->escapeString($_GET['username']) . "';"; + $res = $GLOBALS['dbi']->query($sql_query); + $row = $GLOBALS['dbi']->fetchRow($res); + if (empty($row)) { + $extra_data['user_exists'] = false; + } else { + $extra_data['user_exists'] = true; + } + } + + return $extra_data; + } + + /** + * Get the HTML snippet for change user login information + * + * @param string $username username + * @param string $hostname host name + * + * @return string HTML snippet + */ + public static function getChangeLoginInformationHtmlForm($username, $hostname) + { + $choices = array( + '4' => __('鈥� keep the old one.'), + '1' => __('鈥� delete the old one from the user tables.'), + '2' => __( + '鈥� revoke all active privileges from ' + . 'the old one and delete it afterwards.' + ), + '3' => __( + '鈥� delete the old one from the user tables ' + . 'and reload the privileges afterwards.' + ) + ); + + $html_output = '' . "\n"; + + return $html_output; + } + + /** + * Provide a line with links to the relevant database and table + * + * @param string $url_dbname url database name that urlencode() string + * @param string $dbname database name + * @param string $tablename table name + * + * @return string HTML snippet + */ + public static function getLinkToDbAndTable($url_dbname, $dbname, $tablename) + { + $html_output = '[ ' . __('Database') + . ' ' + . htmlspecialchars(Util::unescapeMysqlWildcards($dbname)) . ': ' + . Util::getTitleForTarget( + $GLOBALS['cfg']['DefaultTabDatabase'] + ) + . " ]\n"; + + if (strlen($tablename) > 0) { + $html_output .= ' [ ' . __('Table') . ' ' . htmlspecialchars($tablename) . ': ' + . Util::getTitleForTarget( + $GLOBALS['cfg']['DefaultTabTable'] + ) + . " ]\n"; + } + return $html_output; + } + + /** + * no db name given, so we want all privs for the given user + * db name was given, so we want all user specific rights for this db + * So this function returns user rights as an array + * + * @param string $username username + * @param string $hostname host name + * @param string $type database or table + * @param string $dbname database name + * + * @return array $db_rights database rights + */ + public static function getUserSpecificRights($username, $hostname, $type, $dbname = '') + { + $user_host_condition = " WHERE `User`" + . " = '" . $GLOBALS['dbi']->escapeString($username) . "'" + . " AND `Host`" + . " = '" . $GLOBALS['dbi']->escapeString($hostname) . "'"; + + if ($type == 'database') { + $tables_to_search_for_users = array( + 'tables_priv', 'columns_priv', 'procs_priv' + ); + $dbOrTableName = 'Db'; + } elseif ($type == 'table') { + $user_host_condition .= " AND `Db` LIKE '" + . $GLOBALS['dbi']->escapeString($dbname) . "'"; + $tables_to_search_for_users = array('columns_priv',); + $dbOrTableName = 'Table_name'; + } else { // routine + $user_host_condition .= " AND `Db` LIKE '" + . $GLOBALS['dbi']->escapeString($dbname) . "'"; + $tables_to_search_for_users = array('procs_priv',); + $dbOrTableName = 'Routine_name'; + } + + // we also want privileges for this user not in table `db` but in other table + $tables = $GLOBALS['dbi']->fetchResult('SHOW TABLES FROM `mysql`;'); + + $db_rights_sqls = array(); + foreach ($tables_to_search_for_users as $table_search_in) { + if (in_array($table_search_in, $tables)) { + $db_rights_sqls[] = ' + SELECT DISTINCT `' . $dbOrTableName . '` + FROM `mysql`.' . Util::backquote($table_search_in) + . $user_host_condition; + } + } + + $user_defaults = array( + $dbOrTableName => '', + 'Grant_priv' => 'N', + 'privs' => array('USAGE'), + 'Column_priv' => true, + ); + + // for the rights + $db_rights = array(); + + $db_rights_sql = '(' . implode(') UNION (', $db_rights_sqls) . ')' + . ' ORDER BY `' . $dbOrTableName . '` ASC'; + + $db_rights_result = $GLOBALS['dbi']->query($db_rights_sql); + + while ($db_rights_row = $GLOBALS['dbi']->fetchAssoc($db_rights_result)) { + $db_rights_row = array_merge($user_defaults, $db_rights_row); + if ($type == 'database') { + // only Db names in the table `mysql`.`db` uses wildcards + // as we are in the db specific rights display we want + // all db names escaped, also from other sources + $db_rights_row['Db'] = Util::escapeMysqlWildcards( + $db_rights_row['Db'] + ); + } + $db_rights[$db_rights_row[$dbOrTableName]] = $db_rights_row; + } + + $GLOBALS['dbi']->freeResult($db_rights_result); + + if ($type == 'database') { + $sql_query = 'SELECT * FROM `mysql`.`db`' + . $user_host_condition . ' ORDER BY `Db` ASC'; + } elseif ($type == 'table') { + $sql_query = 'SELECT `Table_name`,' + . ' `Table_priv`,' + . ' IF(`Column_priv` = _latin1 \'\', 0, 1)' + . ' AS \'Column_priv\'' + . ' FROM `mysql`.`tables_priv`' + . $user_host_condition + . ' ORDER BY `Table_name` ASC;'; + } else { + $sql_query = "SELECT `Routine_name`, `Proc_priv`" + . " FROM `mysql`.`procs_priv`" + . $user_host_condition + . " ORDER BY `Routine_name`"; + + } + + $result = $GLOBALS['dbi']->query($sql_query); + + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + if (isset($db_rights[$row[$dbOrTableName]])) { + $db_rights[$row[$dbOrTableName]] + = array_merge($db_rights[$row[$dbOrTableName]], $row); + } else { + $db_rights[$row[$dbOrTableName]] = $row; + } + if ($type == 'database') { + // there are db specific rights for this user + // so we can drop this db rights + $db_rights[$row['Db']]['can_delete'] = true; + } + } + $GLOBALS['dbi']->freeResult($result); + return $db_rights; + } + + /** + * Parses Proc_priv data + * + * @param string $privs Proc_priv + * + * @return array + */ + public static function parseProcPriv($privs) + { + $result = array( + 'Alter_routine_priv' => 'N', + 'Execute_priv' => 'N', + 'Grant_priv' => 'N', + ); + foreach (explode(',', $privs) as $priv) { + if ($priv == 'Alter Routine') { + $result['Alter_routine_priv'] = 'Y'; + } else { + $result[$priv . '_priv'] = 'Y'; + } + } + return $result; + } + + /** + * Get a HTML table for display user's tabel specific or database specific rights + * + * @param string $username username + * @param string $hostname host name + * @param string $type database, table or routine + * @param string $dbname database name + * + * @return array $html_output + */ + public static function getHtmlForAllTableSpecificRights( + $username, $hostname, $type, $dbname = '' + ) { + $uiData = array( + 'database' => array( + 'form_id' => 'database_specific_priv', + 'sub_menu_label' => __('Database'), + 'legend' => __('Database-specific privileges'), + 'type_label' => __('Database'), + ), + 'table' => array( + 'form_id' => 'table_specific_priv', + 'sub_menu_label' => __('Table'), + 'legend' => __('Table-specific privileges'), + 'type_label' => __('Table'), + ), + 'routine' => array( + 'form_id' => 'routine_specific_priv', + 'sub_menu_label' => __('Routine'), + 'legend' => __('Routine-specific privileges'), + 'type_label' => __('Routine'), + ), + ); + + /** + * no db name given, so we want all privs for the given user + * db name was given, so we want all user specific rights for this db + */ + $db_rights = self::getUserSpecificRights($username, $hostname, $type, $dbname); + ksort($db_rights); + + $foundRows = array(); + $privileges = array(); + foreach ($db_rights as $row) { + $onePrivilege = array(); + + $paramTableName = ''; + $paramRoutineName = ''; + + if ($type == 'database') { + $name = $row['Db']; + $onePrivilege['grant'] = $row['Grant_priv'] == 'Y'; + $onePrivilege['table_privs'] = ! empty($row['Table_priv']) + || ! empty($row['Column_priv']); + $onePrivilege['privileges'] = join(',', self::extractPrivInfo($row, true)); + + $paramDbName = $row['Db']; + + } elseif ($type == 'table') { + $name = $row['Table_name']; + $onePrivilege['grant'] = in_array( + 'Grant', + explode(',', $row['Table_priv']) + ); + $onePrivilege['column_privs'] = ! empty($row['Column_priv']); + $onePrivilege['privileges'] = join(',', self::extractPrivInfo($row, true)); + + $paramDbName = $dbname; + $paramTableName = $row['Table_name']; + + } else { // routine + $name = $row['Routine_name']; + $onePrivilege['grant'] = in_array( + 'Grant', + explode(',', $row['Proc_priv']) + ); + + $privs = self::parseProcPriv($row['Proc_priv']); + $onePrivilege['privileges'] = join( + ',', + self::extractPrivInfo($privs, true) + ); + + $paramDbName = $dbname; + $paramRoutineName = $row['Routine_name']; + } + + $foundRows[] = $name; + $onePrivilege['name'] = $name; + + $onePrivilege['edit_link'] = ''; + if ($GLOBALS['is_grantuser']) { + $onePrivilege['edit_link'] = self::getUserLink( + 'edit', + $username, + $hostname, + $paramDbName, + $paramTableName, + $paramRoutineName + ); + } + + $onePrivilege['revoke_link'] = ''; + if ($type != 'database' || ! empty($row['can_delete'])) { + $onePrivilege['revoke_link'] = self::getUserLink( + 'revoke', + $username, + $hostname, + $paramDbName, + $paramTableName, + $paramRoutineName + ); + } + + $privileges[] = $onePrivilege; + } + + $data = $uiData[$type]; + $data['privileges'] = $privileges; + $data['username'] = $username; + $data['hostname'] = $hostname; + $data['database'] = $dbname; + $data['type'] = $type; + + if ($type == 'database') { + + // we already have the list of databases from libraries/common.inc.php + // via $pma = new PMA; + $pred_db_array = $GLOBALS['dblist']->databases; + $databases_to_skip = array('information_schema', 'performance_schema'); + + $databases = array(); + if (! empty($pred_db_array)) { + foreach ($pred_db_array as $current_db) { + if (in_array($current_db, $databases_to_skip)) { + continue; + } + $current_db_escaped = Util::escapeMysqlWildcards($current_db); + // cannot use array_diff() once, outside of the loop, + // because the list of databases has special characters + // already escaped in $foundRows, + // contrary to the output of SHOW DATABASES + if (! in_array($current_db_escaped, $foundRows)) { + $databases[] = $current_db; + } + } + } + $data['databases'] = $databases; + + } elseif ($type == 'table') { + $result = @$GLOBALS['dbi']->tryQuery( + "SHOW TABLES FROM " . Util::backquote($dbname), + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + + $tables = array(); + if ($result) { + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + if (! in_array($row[0], $foundRows)) { + $tables[] = $row[0]; + } + } + $GLOBALS['dbi']->freeResult($result); + } + $data['tables'] = $tables; + + } else { // routine + $routineData = $GLOBALS['dbi']->getRoutines($dbname); + + $routines = array(); + foreach ($routineData as $routine) { + if (! in_array($routine['name'], $foundRows)) { + $routines[] = $routine['name']; + } + } + $data['routines'] = $routines; + } + + $html_output = Template::get('privileges/privileges_summary') + ->render($data); + + return $html_output; + } + + /** + * Get HTML for display the users overview + * (if less than 50 users, display them immediately) + * + * @param array $result ran sql query + * @param array $db_rights user's database rights array + * @param string $pmaThemeImage a image source link + * @param string $text_dir text directory + * + * @return string HTML snippet + */ + public static function getUsersOverview($result, array $db_rights, $pmaThemeImage, $text_dir) + { + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $row['privs'] = self::extractPrivInfo($row, true); + $db_rights[$row['User']][$row['Host']] = $row; + } + $GLOBALS['dbi']->freeResult($result); + $user_group_count = 0; + if ($GLOBALS['cfgRelation']['menuswork']) { + $user_group_count = self::getUserGroupCount(); + } + + $html_output + = '
    ' . "\n" + . Url::getHiddenInputs('', '') + . '
    ' + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n"; + if ($GLOBALS['cfgRelation']['menuswork']) { + $html_output .= '' . "\n"; + } + $html_output .= '' . "\n" + . '' . "\n" + . '' . "\n" + . '' . "\n"; + + $html_output .= '' . "\n"; + $html_output .= self::getHtmlTableBodyForUserRights($db_rights); + $html_output .= '' + . '
    ' . __('User name') . '' . __('Host name') . '' . __('Password') . '' . __('Global privileges') . ' ' + . Util::showHint( + __('Note: MySQL privilege names are expressed in English.') + ) + . '' . __('User group') . '' . __('Grant') . '' + . __('Action') . '
    ' . "\n"; + + $html_output .= '
    ' + . Template::get('select_all') + ->render( + array( + 'pma_theme_image' => $pmaThemeImage, + 'text_dir' => $text_dir, + 'form_name' => 'usersForm', + ) + ) . "\n"; + $html_output .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Export'), 'b_tblexport', 'export' + ); + $html_output .= ''; + $html_output .= '
    ' + . '
    '; + + // add/delete user fieldset + $html_output .= self::getFieldsetForAddDeleteUser(); + $html_output .= '
    ' . "\n"; + + return $html_output; + } + + /** + * Get table body for 'tableuserrights' table in userform + * + * @param array $db_rights user's database rights array + * + * @return string HTML snippet + */ + public static function getHtmlTableBodyForUserRights(array $db_rights) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + if ($cfgRelation['menuswork']) { + $users_table = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['users']); + $sql_query = 'SELECT * FROM ' . $users_table; + $result = $relation->queryAsControlUser($sql_query, false); + $group_assignment = array(); + if ($result) { + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $group_assignment[$row['username']] = $row['usergroup']; + } + } + $GLOBALS['dbi']->freeResult($result); + + $user_group_count = self::getUserGroupCount(); + } + + $index_checkbox = 0; + $html_output = ''; + foreach ($db_rights as $user) { + ksort($user); + foreach ($user as $host) { + $index_checkbox++; + $html_output .= '' + . "\n"; + $html_output .= '' + . '' . "\n"; + + $html_output .= '' . "\n" + . '' . htmlspecialchars($host['Host']) . '' . "\n"; + + $html_output .= ''; + + $password_column = 'Password'; + + $check_plugin_query = "SELECT * FROM `mysql`.`user` WHERE " + . "`User` = '" . $host['User'] . "' AND `Host` = '" + . $host['Host'] . "'"; + $res = $GLOBALS['dbi']->fetchSingleRow($check_plugin_query); + + if ((isset($res['authentication_string']) + && ! empty($res['authentication_string'])) + || (isset($res['Password']) + && ! empty($res['Password'])) + ) { + $host[$password_column] = 'Y'; + } else { + $host[$password_column] = 'N'; + } + + switch ($host[$password_column]) { + case 'Y': + $html_output .= __('Yes'); + break; + case 'N': + $html_output .= '' . __('No') + . ''; + break; + // this happens if this is a definition not coming from mysql.user + default: + $html_output .= '--'; // in future version, replace by "not present" + break; + } // end switch + + if (! isset($host['Select_priv'])) { + $html_output .= Util::showHint( + __('The selected user was not found in the privilege table.') + ); + } + + $html_output .= '' . "\n"; + + $html_output .= '' . "\n" + . '' . implode(',' . "\n" . ' ', $host['privs']) . "\n" + . '' . "\n"; + if ($cfgRelation['menuswork']) { + $html_output .= '' . "\n" + . (isset($group_assignment[$host['User']]) + ? htmlspecialchars($group_assignment[$host['User']]) + : '' + ) + . '' . "\n"; + } + $html_output .= '' + . ($host['Grant_priv'] == 'Y' ? __('Yes') : __('No')) + . '' . "\n"; + + if ($GLOBALS['is_grantuser']) { + $html_output .= '' + . self::getUserLink( + 'edit', + $host['User'], + $host['Host'] + ) + . ''; + } + if ($cfgRelation['menuswork'] && $user_group_count > 0) { + if (empty($host['User'])) { + $html_output .= ''; + } else { + $html_output .= '' + . self::getUserGroupEditLink($host['User']) + . ''; + } + } + $html_output .= '' + . self::getUserLink( + 'export', + $host['User'], + $host['Host'], + '', + '', + '', + isset($_GET['initial']) ? $_GET['initial'] : '' + ) + . ''; + $html_output .= ''; + } + } + return $html_output; + } + + /** + * Get HTML fieldset for Add/Delete user + * + * @return string HTML snippet + */ + public static function getFieldsetForAddDeleteUser() + { + $html_output = self::getAddUserHtmlFieldset(); + + $html_output .= Template::get('privileges/delete_user_fieldset') + ->render(array()); + + return $html_output; + } + + /** + * Get HTML for Displays the initials + * + * @param array $array_initials array for all initials, even non A-Z + * + * @return string HTML snippet + */ + public static function getHtmlForInitials(array $array_initials) + { + // initialize to false the letters A-Z + for ($letter_counter = 1; $letter_counter < 27; $letter_counter++) { + if (! isset($array_initials[mb_chr($letter_counter + 64)])) { + $array_initials[mb_chr($letter_counter + 64)] = false; + } + } + + $initials = $GLOBALS['dbi']->tryQuery( + 'SELECT DISTINCT UPPER(LEFT(`User`,1)) FROM `user`' + . ' ORDER BY UPPER(LEFT(`User`,1)) ASC', + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + if ($initials) { + while (list($tmp_initial) = $GLOBALS['dbi']->fetchRow($initials)) { + $array_initials[$tmp_initial] = true; + } + } + + // Display the initials, which can be any characters, not + // just letters. For letters A-Z, we add the non-used letters + // as greyed out. + + uksort($array_initials, "strnatcasecmp"); + + $html_output = Template::get('privileges/initials_row') + ->render( + array( + 'array_initials' => $array_initials, + 'initial' => isset($_GET['initial']) ? $_GET['initial'] : null, + ) + ); + + return $html_output; + } + + /** + * Get the database rights array for Display user overview + * + * @return array $db_rights database rights array + */ + public static function getDbRightsForUserOverview() + { + // we also want users not in table `user` but in other table + $tables = $GLOBALS['dbi']->fetchResult('SHOW TABLES FROM `mysql`;'); + + $tablesSearchForUsers = array( + 'user', 'db', 'tables_priv', 'columns_priv', 'procs_priv', + ); + + $db_rights_sqls = array(); + foreach ($tablesSearchForUsers as $table_search_in) { + if (in_array($table_search_in, $tables)) { + $db_rights_sqls[] = 'SELECT DISTINCT `User`, `Host` FROM `mysql`.`' + . $table_search_in . '` ' + . (isset($_GET['initial']) + ? self::rangeOfUsers($_GET['initial']) + : ''); + } + } + $user_defaults = array( + 'User' => '', + 'Host' => '%', + 'Password' => '?', + 'Grant_priv' => 'N', + 'privs' => array('USAGE'), + ); + + // for the rights + $db_rights = array(); + + $db_rights_sql = '(' . implode(') UNION (', $db_rights_sqls) . ')' + . ' ORDER BY `User` ASC, `Host` ASC'; + + $db_rights_result = $GLOBALS['dbi']->query($db_rights_sql); + + while ($db_rights_row = $GLOBALS['dbi']->fetchAssoc($db_rights_result)) { + $db_rights_row = array_merge($user_defaults, $db_rights_row); + $db_rights[$db_rights_row['User']][$db_rights_row['Host']] + = $db_rights_row; + } + $GLOBALS['dbi']->freeResult($db_rights_result); + ksort($db_rights); + + return $db_rights; + } + + /** + * Delete user and get message and sql query for delete user in privileges + * + * @param array $queries queries + * + * @return array Message + */ + public static function deleteUser(array $queries) + { + $sql_query = ''; + if (empty($queries)) { + $message = Message::error(__('No users selected for deleting!')); + } else { + if ($_POST['mode'] == 3) { + $queries[] = '# ' . __('Reloading the privileges') . ' 鈥�'; + $queries[] = 'FLUSH PRIVILEGES;'; + } + $drop_user_error = ''; + foreach ($queries as $sql_query) { + if ($sql_query[0] != '#') { + if (! $GLOBALS['dbi']->tryQuery($sql_query)) { + $drop_user_error .= $GLOBALS['dbi']->getError() . "\n"; + } + } + } + // tracking sets this, causing the deleted db to be shown in navi + unset($GLOBALS['db']); + + $sql_query = join("\n", $queries); + if (! empty($drop_user_error)) { + $message = Message::rawError($drop_user_error); + } else { + $message = Message::success( + __('The selected users have been deleted successfully.') + ); + } + } + return array($sql_query, $message); + } + + /** + * Update the privileges and return the success or error message + * + * @param string $username username + * @param string $hostname host name + * @param string $tablename table name + * @param string $dbname database name + * @param string $itemType item type + * + * @return Message success message or error message for update + */ + public static function updatePrivileges($username, $hostname, $tablename, $dbname, $itemType) + { + $db_and_table = self::wildcardEscapeForGrant($dbname, $tablename); + + $sql_query0 = 'REVOKE ALL PRIVILEGES ON ' . $itemType . ' ' . $db_and_table + . ' FROM \'' . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\';'; + + if (! isset($_POST['Grant_priv']) || $_POST['Grant_priv'] != 'Y') { + $sql_query1 = 'REVOKE GRANT OPTION ON ' . $itemType . ' ' . $db_and_table + . ' FROM \'' . $GLOBALS['dbi']->escapeString($username) . '\'@\'' + . $GLOBALS['dbi']->escapeString($hostname) . '\';'; + } else { + $sql_query1 = ''; + } + + // Should not do a GRANT USAGE for a table-specific privilege, it + // causes problems later (cannot revoke it) + if (! (strlen($tablename) > 0 + && 'USAGE' == implode('', self::extractPrivInfo())) + ) { + $sql_query2 = 'GRANT ' . join(', ', self::extractPrivInfo()) + . ' ON ' . $itemType . ' ' . $db_and_table + . ' TO \'' . $GLOBALS['dbi']->escapeString($username) . '\'@\'' + . $GLOBALS['dbi']->escapeString($hostname) . '\''; + + if (strlen($dbname) === 0) { + // add REQUIRE clause + $sql_query2 .= self::getRequireClause(); + } + + if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y') + || (strlen($dbname) === 0 + && (isset($_POST['max_questions']) || isset($_POST['max_connections']) + || isset($_POST['max_updates']) + || isset($_POST['max_user_connections']))) + ) { + $sql_query2 .= self::getWithClauseForAddUserAndUpdatePrivs(); + } + $sql_query2 .= ';'; + } + if (! $GLOBALS['dbi']->tryQuery($sql_query0)) { + // This might fail when the executing user does not have + // ALL PRIVILEGES himself. + // See https://github.com/phpmyadmin/phpmyadmin/issues/9673 + $sql_query0 = ''; + } + if (! empty($sql_query1) && ! $GLOBALS['dbi']->tryQuery($sql_query1)) { + // this one may fail, too... + $sql_query1 = ''; + } + if (! empty($sql_query2)) { + $GLOBALS['dbi']->query($sql_query2); + } else { + $sql_query2 = ''; + } + $sql_query = $sql_query0 . ' ' . $sql_query1 . ' ' . $sql_query2; + $message = Message::success(__('You have updated the privileges for %s.')); + $message->addParam('\'' . $username . '\'@\'' . $hostname . '\''); + + return array($sql_query, $message); + } + + /** + * Get List of information: Changes / copies a user + * + * @return array + */ + public static function getDataForChangeOrCopyUser() + { + $queries = null; + $password = null; + + if (isset($_POST['change_copy'])) { + $user_host_condition = ' WHERE `User` = ' + . "'" . $GLOBALS['dbi']->escapeString($_POST['old_username']) . "'" + . ' AND `Host` = ' + . "'" . $GLOBALS['dbi']->escapeString($_POST['old_hostname']) . "';"; + $row = $GLOBALS['dbi']->fetchSingleRow( + 'SELECT * FROM `mysql`.`user` ' . $user_host_condition + ); + if (! $row) { + $response = Response::getInstance(); + $response->addHTML( + Message::notice(__('No user found.'))->getDisplay() + ); + unset($_POST['change_copy']); + } else { + extract($row, EXTR_OVERWRITE); + foreach ($row as $key => $value) { + $GLOBALS[$key] = $value; + } + $serverVersion = $GLOBALS['dbi']->getVersion(); + // Recent MySQL versions have the field "Password" in mysql.user, + // so the previous extract creates $Password but this script + // uses $password + if (! isset($password) && isset($Password)) { + $password = $Password; + } + if (Util::getServerType() == 'MySQL' + && $serverVersion >= 50606 + && $serverVersion < 50706 + && ((isset($authentication_string) + && empty($password)) + || (isset($plugin) + && $plugin == 'sha256_password')) + ) { + $password = $authentication_string; + } + + if (Util::getServerType() == 'MariaDB' + && $serverVersion >= 50500 + && isset($authentication_string) + && empty($password) + ) { + $password = $authentication_string; + } + + // Always use 'authentication_string' column + // for MySQL 5.7.6+ since it does not have + // the 'password' column at all + if (in_array(Util::getServerType(), array('MySQL', 'Percona Server')) + && $serverVersion >= 50706 + && isset($authentication_string) + ) { + $password = $authentication_string; + } + + $queries = array(); + } + } + + return array($queries, $password); + } + + /** + * Update Data for information: Deletes users + * + * @param array $queries queries array + * + * @return array + */ + public static function getDataForDeleteUsers($queries) + { + if (isset($_POST['change_copy'])) { + $selected_usr = array( + $_POST['old_username'] . '&#27;' . $_POST['old_hostname'] + ); + } else { + $selected_usr = $_POST['selected_usr']; + $queries = array(); + } + + // this happens, was seen in https://reports.phpmyadmin.net/reports/view/17146 + if (! is_array($selected_usr)) { + return array(); + } + + foreach ($selected_usr as $each_user) { + list($this_user, $this_host) = explode('&#27;', $each_user); + $queries[] = '# ' + . sprintf( + __('Deleting %s'), + '\'' . $this_user . '\'@\'' . $this_host . '\'' + ) + . ' ...'; + $queries[] = 'DROP USER \'' + . $GLOBALS['dbi']->escapeString($this_user) + . '\'@\'' . $GLOBALS['dbi']->escapeString($this_host) . '\';'; + RelationCleanup::user($this_user); + + if (isset($_POST['drop_users_db'])) { + $queries[] = 'DROP DATABASE IF EXISTS ' + . Util::backquote($this_user) . ';'; + $GLOBALS['reload'] = true; + } + } + return $queries; + } + + /** + * update Message For Reload + * + * @return array + */ + public static function updateMessageForReload() + { + $message = null; + if (isset($_GET['flush_privileges'])) { + $sql_query = 'FLUSH PRIVILEGES;'; + $GLOBALS['dbi']->query($sql_query); + $message = Message::success( + __('The privileges were reloaded successfully.') + ); + } + + if (isset($_GET['validate_username'])) { + $message = Message::success(); + } + + return $message; + } + + /** + * update Data For Queries from queries_for_display + * + * @param array $queries queries array + * @param array|null $queries_for_display queries array for display + * + * @return null + */ + public static function getDataForQueries(array $queries, $queries_for_display) + { + $tmp_count = 0; + foreach ($queries as $sql_query) { + if ($sql_query[0] != '#') { + $GLOBALS['dbi']->query($sql_query); + } + // when there is a query containing a hidden password, take it + // instead of the real query sent + if (isset($queries_for_display[$tmp_count])) { + $queries[$tmp_count] = $queries_for_display[$tmp_count]; + } + $tmp_count++; + } + + return $queries; + } + + /** + * update Data for information: Adds a user + * + * @param string $dbname db name + * @param string $username user name + * @param string $hostname host name + * @param string $password password + * @param bool $is_menuwork is_menuwork set? + * + * @return array + */ + public static function addUser( + $dbname, $username, $hostname, + $password, $is_menuwork + ) { + $_add_user_error = false; + $message = null; + $queries = null; + $queries_for_display = null; + $sql_query = null; + + if (!isset($_POST['adduser_submit']) && !isset($_POST['change_copy'])) { + return array( + $message, $queries, $queries_for_display, $sql_query, $_add_user_error + ); + } + + $sql_query = ''; + if ($_POST['pred_username'] == 'any') { + $username = ''; + } + switch ($_POST['pred_hostname']) { + case 'any': + $hostname = '%'; + break; + case 'localhost': + $hostname = 'localhost'; + break; + case 'hosttable': + $hostname = ''; + break; + case 'thishost': + $_user_name = $GLOBALS['dbi']->fetchValue('SELECT USER()'); + $hostname = mb_substr( + $_user_name, + (mb_strrpos($_user_name, '@') + 1) + ); + unset($_user_name); + break; + } + $sql = "SELECT '1' FROM `mysql`.`user`" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" + . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; + if ($GLOBALS['dbi']->fetchValue($sql) == 1) { + $message = Message::error(__('The user %s already exists!')); + $message->addParam('[em]\'' . $username . '\'@\'' . $hostname . '\'[/em]'); + $_GET['adduser'] = true; + $_add_user_error = true; + + return array( + $message, + $queries, + $queries_for_display, + $sql_query, + $_add_user_error + ); + } + + list( + $create_user_real, $create_user_show, $real_sql_query, $sql_query, + $password_set_real, $password_set_show, + $alter_real_sql_query, + $alter_sql_query + ) = self::getSqlQueriesForDisplayAndAddUser( + $username, $hostname, (isset($password) ? $password : '') + ); + + if (empty($_POST['change_copy'])) { + $_error = false; + + if (isset($create_user_real)) { + if (!$GLOBALS['dbi']->tryQuery($create_user_real)) { + $_error = true; + } + if (isset($password_set_real) && !empty($password_set_real) + && isset($_POST['authentication_plugin']) + ) { + self::setProperPasswordHashing( + $_POST['authentication_plugin'] + ); + if ($GLOBALS['dbi']->tryQuery($password_set_real)) { + $sql_query .= $password_set_show; + } + } + $sql_query = $create_user_show . $sql_query; + } + + list($sql_query, $message) = self::addUserAndCreateDatabase( + $_error, + $real_sql_query, + $sql_query, + $username, + $hostname, + isset($dbname) ? $dbname : null, + $alter_real_sql_query, + $alter_sql_query + ); + if (!empty($_POST['userGroup']) && $is_menuwork) { + self::setUserGroup($GLOBALS['username'], $_POST['userGroup']); + } + + return array( + $message, + $queries, + $queries_for_display, + $sql_query, + $_add_user_error + ); + } + + // Copy the user group while copying a user + $old_usergroup = + isset($_POST['old_usergroup']) ? $_POST['old_usergroup'] : null; + self::setUserGroup($_POST['username'], $old_usergroup); + + if (isset($create_user_real)) { + $queries[] = $create_user_real; + } + $queries[] = $real_sql_query; + + if (isset($password_set_real) && ! empty($password_set_real) + && isset($_POST['authentication_plugin']) + ) { + self::setProperPasswordHashing( + $_POST['authentication_plugin'] + ); + + $queries[] = $password_set_real; + } + // we put the query containing the hidden password in + // $queries_for_display, at the same position occupied + // by the real query in $queries + $tmp_count = count($queries); + if (isset($create_user_real)) { + $queries_for_display[$tmp_count - 2] = $create_user_show; + } + if (isset($password_set_real) && ! empty($password_set_real)) { + $queries_for_display[$tmp_count - 3] = $create_user_show; + $queries_for_display[$tmp_count - 2] = $sql_query; + $queries_for_display[$tmp_count - 1] = $password_set_show; + } else { + $queries_for_display[$tmp_count - 1] = $sql_query; + } + + return array( + $message, $queries, $queries_for_display, $sql_query, $_add_user_error + ); + } + + /** + * Sets proper value of `old_passwords` according to + * the authentication plugin selected + * + * @param string $auth_plugin authentication plugin selected + * + * @return void + */ + public static function setProperPasswordHashing($auth_plugin) + { + // Set the hashing method used by PASSWORD() + // to be of type depending upon $authentication_plugin + if ($auth_plugin == 'sha256_password') { + $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 2;'); + } elseif ($auth_plugin == 'mysql_old_password') { + $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 1;'); + } else { + $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 0;'); + } + } + + /** + * Update DB information: DB, Table, isWildcard + * + * @return array + */ + public static function getDataForDBInfo() + { + $username = null; + $hostname = null; + $dbname = null; + $tablename = null; + $routinename = null; + $dbname_is_wildcard = null; + + if (isset($_REQUEST['username'])) { + $username = $_REQUEST['username']; + } + if (isset($_REQUEST['hostname'])) { + $hostname = $_REQUEST['hostname']; + } + /** + * Checks if a dropdown box has been used for selecting a database / table + */ + if (Core::isValid($_POST['pred_tablename'])) { + $tablename = $_POST['pred_tablename']; + } elseif (Core::isValid($_REQUEST['tablename'])) { + $tablename = $_REQUEST['tablename']; + } else { + unset($tablename); + } + + if (Core::isValid($_POST['pred_routinename'])) { + $routinename = $_POST['pred_routinename']; + } elseif (Core::isValid($_REQUEST['routinename'])) { + $routinename = $_REQUEST['routinename']; + } else { + unset($routinename); + } + + if (isset($_POST['pred_dbname'])) { + $is_valid_pred_dbname = true; + foreach ($_POST['pred_dbname'] as $key => $db_name) { + if (! Core::isValid($db_name)) { + $is_valid_pred_dbname = false; + break; + } + } + } + + if (isset($_REQUEST['dbname'])) { + $is_valid_dbname = true; + if (is_array($_REQUEST['dbname'])) { + foreach ($_REQUEST['dbname'] as $key => $db_name) { + if (! Core::isValid($db_name)) { + $is_valid_dbname = false; + break; + } + } + } else { + if (! Core::isValid($_REQUEST['dbname'])) { + $is_valid_dbname = false; + } + } + } + + if (isset($is_valid_pred_dbname) && $is_valid_pred_dbname) { + $dbname = $_POST['pred_dbname']; + // If dbname contains only one database. + if (count($dbname) == 1) { + $dbname = $dbname[0]; + } + } elseif (isset($is_valid_dbname) && $is_valid_dbname) { + $dbname = $_REQUEST['dbname']; + } else { + unset($dbname); + unset($tablename); + } + + if (isset($dbname)) { + if (is_array($dbname)) { + $db_and_table = $dbname; + foreach ($db_and_table as $key => $db_name) { + $db_and_table[$key] .= '.'; + } + } else { + $unescaped_db = Util::unescapeMysqlWildcards($dbname); + $db_and_table = Util::backquote($unescaped_db) . '.'; + } + if (isset($tablename)) { + $db_and_table .= Util::backquote($tablename); + } else { + if (is_array($db_and_table)) { + foreach ($db_and_table as $key => $db_name) { + $db_and_table[$key] .= '*'; + } + } else { + $db_and_table .= '*'; + } + } + } else { + $db_and_table = '*.*'; + } + + // check if given $dbname is a wildcard or not + if (isset($dbname)) { + //if (preg_match('/\\\\(?:_|%)/i', $dbname)) { + if (! is_array($dbname) && preg_match('/(?'; + + if (isset($_POST['selected_usr'])) { + // export privileges for selected users + $title = __('Privileges'); + + //For removing duplicate entries of users + $_POST['selected_usr'] = array_unique($_POST['selected_usr']); + + foreach ($_POST['selected_usr'] as $export_user) { + $export_username = mb_substr( + $export_user, 0, mb_strpos($export_user, '&') + ); + $export_hostname = mb_substr( + $export_user, mb_strrpos($export_user, ';') + 1 + ); + $export .= '# ' + . sprintf( + __('Privileges for %s'), + '`' . htmlspecialchars($export_username) + . '`@`' . htmlspecialchars($export_hostname) . '`' + ) + . "\n\n"; + $export .= self::getGrants($export_username, $export_hostname) . "\n"; + } + } else { + // export privileges for a single user + $title = __('User') . ' `' . htmlspecialchars($username) + . '`@`' . htmlspecialchars($hostname) . '`'; + $export .= self::getGrants($username, $hostname); + } + // remove trailing whitespace + $export = trim($export); + + $export .= ''; + + return array($title, $export); + } + + /** + * Get HTML for display Add userfieldset + * + * @param string $db the database + * @param string $table the table name + * + * @return string html output + */ + public static function getAddUserHtmlFieldset($db = '', $table = '') + { + if (!$GLOBALS['is_createuser']) { + return ''; + } + $rel_params = array(); + $url_params = array( + 'adduser' => 1 + ); + if (!empty($db)) { + $url_params['dbname'] + = $rel_params['checkprivsdb'] + = $db; + } + if (!empty($table)) { + $url_params['tablename'] + = $rel_params['checkprivstable'] + = $table; + } + + return Template::get('privileges/add_user_fieldset') + ->render( + array( + 'url_params' => $url_params, + 'rel_params' => $rel_params + ) + ); + } + + /** + * Get HTML header for display User's properties + * + * @param boolean $dbname_is_wildcard whether database name is wildcard or not + * @param string $url_dbname url database name that urlencode() string + * @param string $dbname database name + * @param string $username username + * @param string $hostname host name + * @param string $entity_name entity (table or routine) name + * @param string $entity_type optional, type of entity ('table' or 'routine') + * + * @return string $html_output + */ + public static function getHtmlHeaderForUserProperties( + $dbname_is_wildcard, $url_dbname, $dbname, + $username, $hostname, $entity_name, $entity_type='table' + ) { + $html_output = '

    ' . "\n" + . Util::getIcon('b_usredit') + . __('Edit privileges:') . ' ' + . __('User account'); + + if (! empty($dbname)) { + $html_output .= ' \'' . htmlspecialchars($username) + . '\'@\'' . htmlspecialchars($hostname) + . '\'' . "\n"; + + $html_output .= ' - '; + $html_output .= ($dbname_is_wildcard + || is_array($dbname) && count($dbname) > 1) + ? __('Databases') : __('Database'); + if (! empty($entity_name) && $entity_type === 'table') { + $html_output .= ' ' . htmlspecialchars($dbname) + . ''; + + $html_output .= ' - ' . __('Table') + . ' ' . htmlspecialchars($entity_name) . ''; + } elseif (! empty($entity_name)) { + $html_output .= ' ' . htmlspecialchars($dbname) + . ''; + + $html_output .= ' - ' . __('Routine') + . ' ' . htmlspecialchars($entity_name) . ''; + } else { + if (! is_array($dbname)) { + $dbname = array($dbname); + } + $html_output .= ' ' + . htmlspecialchars(implode(', ', $dbname)) + . ''; + } + + } else { + $html_output .= ' \'' . htmlspecialchars($username) + . '\'@\'' . htmlspecialchars($hostname) + . '\'' . "\n"; + + } + $html_output .= '

    ' . "\n"; + $cur_user = $GLOBALS['dbi']->getCurrentUser(); + $user = $username . '@' . $hostname; + // Add a short notice for the user + // to remind him that he is editing his own privileges + if ($user === $cur_user) { + $html_output .= Message::notice( + __( + 'Note: You are attempting to edit privileges of the ' + . 'user with which you are currently logged in.' + ) + )->getDisplay(); + } + return $html_output; + } + + /** + * Get HTML snippet for display user overview page + * + * @param string $pmaThemeImage a image source link + * @param string $text_dir text directory + * + * @return string $html_output + */ + public static function getHtmlForUserOverview($pmaThemeImage, $text_dir) + { + $html_output = '

    ' . "\n" + . Util::getIcon('b_usrlist') + . __('User accounts overview') . "\n" + . '

    ' . "\n"; + + $password_column = 'Password'; + $server_type = Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); + if (($server_type == 'MySQL' || $server_type == 'Percona Server') + && $serverVersion >= 50706 + ) { + $password_column = 'authentication_string'; + } + // $sql_query is for the initial-filtered, + // $sql_query_all is for counting the total no. of users + + $sql_query = $sql_query_all = 'SELECT *,' . + " IF(`" . $password_column . "` = _latin1 '', 'N', 'Y') AS 'Password'" . + ' FROM `mysql`.`user`'; + + $sql_query .= (isset($_GET['initial']) + ? self::rangeOfUsers($_GET['initial']) + : ''); + + $sql_query .= ' ORDER BY `User` ASC, `Host` ASC;'; + $sql_query_all .= ' ;'; + + $res = $GLOBALS['dbi']->tryQuery( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + $res_all = $GLOBALS['dbi']->tryQuery( + $sql_query_all, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + + if (! $res) { + // the query failed! This may have two reasons: + // - the user does not have enough privileges + // - the privilege tables use a structure of an earlier version. + // so let's try a more simple query + + $GLOBALS['dbi']->freeResult($res); + $GLOBALS['dbi']->freeResult($res_all); + $sql_query = 'SELECT * FROM `mysql`.`user`'; + $res = $GLOBALS['dbi']->tryQuery( + $sql_query, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + + if (! $res) { + $html_output .= self::getHtmlForViewUsersError(); + $html_output .= self::getAddUserHtmlFieldset(); + } else { + // This message is hardcoded because I will replace it by + // a automatic repair feature soon. + $raw = 'Your privilege table structure seems to be older than' + . ' this MySQL version!
    ' + . 'Please run the mysql_upgrade command' + . ' that should be included in your MySQL server distribution' + . ' to solve this problem!'; + $html_output .= Message::rawError($raw)->getDisplay(); + } + $GLOBALS['dbi']->freeResult($res); + } else { + $db_rights = self::getDbRightsForUserOverview(); + // for all initials, even non A-Z + $array_initials = array(); + + foreach ($db_rights as $right) { + foreach ($right as $account) { + if (empty($account['User']) && $account['Host'] == 'localhost') { + $html_output .= Message::notice( + __( + 'A user account allowing any user from localhost to ' + . 'connect is present. This will prevent other users ' + . 'from connecting if the host part of their account ' + . 'allows a connection from any (%) host.' + ) + . Util::showMySQLDocu('problems-connecting') + )->getDisplay(); + break 2; + } + } + } + + /** + * Displays the initials + * Also not necessary if there is less than 20 privileges + */ + if ($GLOBALS['dbi']->numRows($res_all) > 20) { + $html_output .= self::getHtmlForInitials($array_initials); + } + + /** + * Display the user overview + * (if less than 50 users, display them immediately) + */ + if (isset($_GET['initial']) + || isset($_GET['showall']) + || $GLOBALS['dbi']->numRows($res) < 50 + ) { + $html_output .= self::getUsersOverview( + $res, $db_rights, $pmaThemeImage, $text_dir + ); + } else { + $html_output .= self::getAddUserHtmlFieldset(); + } // end if (display overview) + + $response = Response::getInstance(); + if (! $response->isAjax() + || ! empty($_REQUEST['ajax_page_request']) + ) { + if ($GLOBALS['is_reload_priv']) { + $flushnote = new Message( + __( + 'Note: phpMyAdmin gets the users鈥� privileges directly ' + . 'from MySQL鈥檚 privilege tables. The content of these ' + . 'tables may differ from the privileges the server uses, ' + . 'if they have been changed manually. In this case, ' + . 'you should %sreload the privileges%s before you continue.' + ), + Message::NOTICE + ); + $flushnote->addParamHtml( + '' + ); + $flushnote->addParamHtml(''); + } else { + $flushnote = new Message( + __( + 'Note: phpMyAdmin gets the users鈥� privileges directly ' + . 'from MySQL鈥檚 privilege tables. The content of these ' + . 'tables may differ from the privileges the server uses, ' + . 'if they have been changed manually. In this case, ' + . 'the privileges have to be reloaded but currently, you ' + . 'don\'t have the RELOAD privilege.' + ) + . Util::showMySQLDocu( + 'privileges-provided', + false, + 'priv_reload' + ), + Message::NOTICE + ); + } + $html_output .= $flushnote->getDisplay(); + } + } + + return $html_output; + } + + /** + * Get HTML snippet for display user properties + * + * @param boolean $dbname_is_wildcard whether database name is wildcard or not + * @param string $url_dbname url database name that urlencode() string + * @param string $username username + * @param string $hostname host name + * @param string $dbname database name + * @param string $tablename table name + * + * @return string $html_output + */ + public static function getHtmlForUserProperties($dbname_is_wildcard, $url_dbname, + $username, $hostname, $dbname, $tablename + ) { + $html_output = '
    '; + $html_output .= self::getHtmlHeaderForUserProperties( + $dbname_is_wildcard, $url_dbname, $dbname, $username, $hostname, + $tablename, 'table' + ); + + $sql = "SELECT '1' FROM `mysql`.`user`" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) . "'" + . " AND `Host` = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; + + $user_does_not_exists = (bool) ! $GLOBALS['dbi']->fetchValue($sql); + + if ($user_does_not_exists) { + $html_output .= Message::error( + __('The selected user was not found in the privilege table.') + )->getDisplay(); + $html_output .= self::getHtmlForLoginInformationFields(); + } + + $_params = array( + 'username' => $username, + 'hostname' => $hostname, + ); + if (! is_array($dbname) && strlen($dbname) > 0) { + $_params['dbname'] = $dbname; + if (strlen($tablename) > 0) { + $_params['tablename'] = $tablename; + } + } else { + $_params['dbname'] = $dbname; + } + + $html_output .= '' . "\n"; + + if (! is_array($dbname) && strlen($tablename) === 0 + && empty($dbname_is_wildcard) + ) { + // no table name was given, display all table specific rights + // but only if $dbname contains no wildcards + if (strlen($dbname) === 0) { + $html_output .= self::getHtmlForAllTableSpecificRights( + $username, $hostname, 'database' + ); + } else { + // unescape wildcards in dbname at table level + $unescaped_db = Util::unescapeMysqlWildcards($dbname); + + $html_output .= self::getHtmlForAllTableSpecificRights( + $username, $hostname, 'table', $unescaped_db + ); + $html_output .= self::getHtmlForAllTableSpecificRights( + $username, $hostname, 'routine', $unescaped_db + ); + } + } + + // Provide a line with links to the relevant database and table + if (! is_array($dbname) && strlen($dbname) > 0 && empty($dbname_is_wildcard)) { + $html_output .= self::getLinkToDbAndTable($url_dbname, $dbname, $tablename); + + } + + if (! is_array($dbname) && strlen($dbname) === 0 && ! $user_does_not_exists) { + //change login information + $html_output .= ChangePassword::getHtml( + 'edit_other', + $username, + $hostname + ); + $html_output .= self::getChangeLoginInformationHtmlForm($username, $hostname); + } + $html_output .= '
    '; + + return $html_output; + } + + /** + * Get queries for Table privileges to change or copy user + * + * @param string $user_host_condition user host condition to + * select relevant table privileges + * @param array $queries queries array + * @param string $username username + * @param string $hostname host name + * + * @return array $queries + */ + public static function getTablePrivsQueriesForChangeOrCopyUser($user_host_condition, + array $queries, $username, $hostname + ) { + $res = $GLOBALS['dbi']->query( + 'SELECT `Db`, `Table_name`, `Table_priv` FROM `mysql`.`tables_priv`' + . $user_host_condition, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { + + $res2 = $GLOBALS['dbi']->query( + 'SELECT `Column_name`, `Column_priv`' + . ' FROM `mysql`.`columns_priv`' + . ' WHERE `User`' + . ' = \'' . $GLOBALS['dbi']->escapeString($_POST['old_username']) . "'" + . ' AND `Host`' + . ' = \'' . $GLOBALS['dbi']->escapeString($_POST['old_username']) . '\'' + . ' AND `Db`' + . ' = \'' . $GLOBALS['dbi']->escapeString($row['Db']) . "'" + . ' AND `Table_name`' + . ' = \'' . $GLOBALS['dbi']->escapeString($row['Table_name']) . "'" + . ';', + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + + $tmp_privs1 = self::extractPrivInfo($row); + $tmp_privs2 = array( + 'Select' => array(), + 'Insert' => array(), + 'Update' => array(), + 'References' => array() + ); + + while ($row2 = $GLOBALS['dbi']->fetchAssoc($res2)) { + $tmp_array = explode(',', $row2['Column_priv']); + if (in_array('Select', $tmp_array)) { + $tmp_privs2['Select'][] = $row2['Column_name']; + } + if (in_array('Insert', $tmp_array)) { + $tmp_privs2['Insert'][] = $row2['Column_name']; + } + if (in_array('Update', $tmp_array)) { + $tmp_privs2['Update'][] = $row2['Column_name']; + } + if (in_array('References', $tmp_array)) { + $tmp_privs2['References'][] = $row2['Column_name']; + } + } + if (count($tmp_privs2['Select']) > 0 && ! in_array('SELECT', $tmp_privs1)) { + $tmp_privs1[] = 'SELECT (`' . join('`, `', $tmp_privs2['Select']) . '`)'; + } + if (count($tmp_privs2['Insert']) > 0 && ! in_array('INSERT', $tmp_privs1)) { + $tmp_privs1[] = 'INSERT (`' . join('`, `', $tmp_privs2['Insert']) . '`)'; + } + if (count($tmp_privs2['Update']) > 0 && ! in_array('UPDATE', $tmp_privs1)) { + $tmp_privs1[] = 'UPDATE (`' . join('`, `', $tmp_privs2['Update']) . '`)'; + } + if (count($tmp_privs2['References']) > 0 + && ! in_array('REFERENCES', $tmp_privs1) + ) { + $tmp_privs1[] + = 'REFERENCES (`' . join('`, `', $tmp_privs2['References']) . '`)'; + } + + $queries[] = 'GRANT ' . join(', ', $tmp_privs1) + . ' ON ' . Util::backquote($row['Db']) . '.' + . Util::backquote($row['Table_name']) + . ' TO \'' . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\'' + . (in_array('Grant', explode(',', $row['Table_priv'])) + ? ' WITH GRANT OPTION;' + : ';'); + } + return $queries; + } + + /** + * Get queries for database specific privileges for change or copy user + * + * @param array $queries queries array with string + * @param string $username username + * @param string $hostname host name + * + * @return array $queries + */ + public static function getDbSpecificPrivsQueriesForChangeOrCopyUser( + array $queries, $username, $hostname + ) { + $user_host_condition = ' WHERE `User`' + . ' = \'' . $GLOBALS['dbi']->escapeString($_POST['old_username']) . "'" + . ' AND `Host`' + . ' = \'' . $GLOBALS['dbi']->escapeString($_POST['old_hostname']) . '\';'; + + $res = $GLOBALS['dbi']->query( + 'SELECT * FROM `mysql`.`db`' . $user_host_condition + ); + + while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { + $queries[] = 'GRANT ' . join(', ', self::extractPrivInfo($row)) + . ' ON ' . Util::backquote($row['Db']) . '.*' + . ' TO \'' . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\'' + . ($row['Grant_priv'] == 'Y' ? ' WITH GRANT OPTION;' : ';'); + } + $GLOBALS['dbi']->freeResult($res); + + $queries = self::getTablePrivsQueriesForChangeOrCopyUser( + $user_host_condition, $queries, $username, $hostname + ); + + return $queries; + } + + /** + * Prepares queries for adding users and + * also create database and return query and message + * + * @param boolean $_error whether user create or not + * @param string $real_sql_query SQL query for add a user + * @param string $sql_query SQL query to be displayed + * @param string $username username + * @param string $hostname host name + * @param string $dbname database name + * @param string $alter_real_sql_query SQL query for ALTER USER + * @param string $alter_sql_query SQL query for ALTER USER to be displayed + * + * @return array $sql_query, $message + */ + public static function addUserAndCreateDatabase( + $_error, + $real_sql_query, + $sql_query, + $username, + $hostname, + $dbname, + $alter_real_sql_query, + $alter_sql_query + ) { + if ($_error || (!empty($real_sql_query) + && !$GLOBALS['dbi']->tryQuery($real_sql_query)) + ) { + $_POST['createdb-1'] = $_POST['createdb-2'] + = $_POST['createdb-3'] = null; + $message = Message::rawError($GLOBALS['dbi']->getError()); + } elseif ($alter_real_sql_query !== '' && !$GLOBALS['dbi']->tryQuery($alter_real_sql_query)) { + $_POST['createdb-1'] = $_POST['createdb-2'] + = $_POST['createdb-3'] = null; + $message = Message::rawError($GLOBALS['dbi']->getError()); + } else { + $sql_query .= $alter_sql_query; + $message = Message::success(__('You have added a new user.')); + } + + if (isset($_POST['createdb-1'])) { + // Create database with same name and grant all privileges + $q = 'CREATE DATABASE IF NOT EXISTS ' + . Util::backquote( + $GLOBALS['dbi']->escapeString($username) + ) . ';'; + $sql_query .= $q; + if (! $GLOBALS['dbi']->tryQuery($q)) { + $message = Message::rawError($GLOBALS['dbi']->getError()); + } + + /** + * Reload the navigation + */ + $GLOBALS['reload'] = true; + $GLOBALS['db'] = $username; + + $q = 'GRANT ALL PRIVILEGES ON ' + . Util::backquote( + Util::escapeMysqlWildcards( + $GLOBALS['dbi']->escapeString($username) + ) + ) . '.* TO \'' + . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\';'; + $sql_query .= $q; + if (! $GLOBALS['dbi']->tryQuery($q)) { + $message = Message::rawError($GLOBALS['dbi']->getError()); + } + } + + if (isset($_POST['createdb-2'])) { + // Grant all privileges on wildcard name (username\_%) + $q = 'GRANT ALL PRIVILEGES ON ' + . Util::backquote( + Util::escapeMysqlWildcards( + $GLOBALS['dbi']->escapeString($username) + ) . '\_%' + ) . '.* TO \'' + . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\';'; + $sql_query .= $q; + if (! $GLOBALS['dbi']->tryQuery($q)) { + $message = Message::rawError($GLOBALS['dbi']->getError()); + } + } + + if (isset($_POST['createdb-3'])) { + // Grant all privileges on the specified database to the new user + $q = 'GRANT ALL PRIVILEGES ON ' + . Util::backquote( + $GLOBALS['dbi']->escapeString($dbname) + ) . '.* TO \'' + . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\';'; + $sql_query .= $q; + if (! $GLOBALS['dbi']->tryQuery($q)) { + $message = Message::rawError($GLOBALS['dbi']->getError()); + } + } + return array($sql_query, $message); + } + + /** + * Get the hashed string for password + * + * @param string $password password + * + * @return string $hashedPassword + */ + public static function getHashedPassword($password) + { + $password = $GLOBALS['dbi']->escapeString($password); + $result = $GLOBALS['dbi']->fetchSingleRow( + "SELECT PASSWORD('" . $password . "') AS `password`;" + ); + + $hashedPassword = $result['password']; + + return $hashedPassword; + } + + /** + * Check if MariaDB's 'simple_password_check' + * OR 'cracklib_password_check' is ACTIVE + * + * @return boolean if atleast one of the plugins is ACTIVE + */ + public static function checkIfMariaDBPwdCheckPluginActive() + { + $serverVersion = $GLOBALS['dbi']->getVersion(); + if (!(Util::getServerType() == 'MariaDB' && $serverVersion >= 100002)) { + return false; + } + + $result = $GLOBALS['dbi']->tryQuery( + 'SHOW PLUGINS SONAME LIKE \'%_password_check%\'' + ); + + /* Plugins are not working, for example directory does not exists */ + if ($result === false) { + return false; + } + + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + if ($row['Status'] === 'ACTIVE') { + return true; + } + } + + return false; + } + + + /** + * Get SQL queries for Display and Add user + * + * @param string $username username + * @param string $hostname host name + * @param string $password password + * + * @return array ($create_user_real, $create_user_show, $real_sql_query, $sql_query + * $password_set_real, $password_set_show, $alter_real_sql_query, $alter_sql_query) + */ + public static function getSqlQueriesForDisplayAndAddUser($username, $hostname, $password) + { + $slashedUsername = $GLOBALS['dbi']->escapeString($username); + $slashedHostname = $GLOBALS['dbi']->escapeString($hostname); + $slashedPassword = $GLOBALS['dbi']->escapeString($password); + $serverType = Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); + + $create_user_stmt = sprintf( + 'CREATE USER \'%s\'@\'%s\'', + $slashedUsername, + $slashedHostname + ); + $isMariaDBPwdPluginActive = self::checkIfMariaDBPwdCheckPluginActive(); + + // See https://github.com/phpmyadmin/phpmyadmin/pull/11560#issuecomment-147158219 + // for details regarding details of syntax usage for various versions + + // 'IDENTIFIED WITH auth_plugin' + // is supported by MySQL 5.5.7+ + if (($serverType == 'MySQL' || $serverType == 'Percona Server') + && $serverVersion >= 50507 + && isset($_POST['authentication_plugin']) + ) { + $create_user_stmt .= ' IDENTIFIED WITH ' + . $_POST['authentication_plugin']; + } + + // 'IDENTIFIED VIA auth_plugin' + // is supported by MariaDB 5.2+ + if ($serverType == 'MariaDB' + && $serverVersion >= 50200 + && isset($_POST['authentication_plugin']) + && ! $isMariaDBPwdPluginActive + ) { + $create_user_stmt .= ' IDENTIFIED VIA ' + . $_POST['authentication_plugin']; + } + + $create_user_real = $create_user_show = $create_user_stmt; + + $password_set_stmt = 'SET PASSWORD FOR \'%s\'@\'%s\' = \'%s\''; + $password_set_show = sprintf( + $password_set_stmt, + $slashedUsername, + $slashedHostname, + '***' + ); + + $sql_query_stmt = sprintf( + 'GRANT %s ON *.* TO \'%s\'@\'%s\'', + join(', ', self::extractPrivInfo()), + $slashedUsername, + $slashedHostname + ); + $real_sql_query = $sql_query = $sql_query_stmt; + + // Set the proper hashing method + if (isset($_POST['authentication_plugin'])) { + self::setProperPasswordHashing( + $_POST['authentication_plugin'] + ); + } + + // Use 'CREATE USER ... WITH ... AS ..' syntax for + // newer MySQL versions + // and 'CREATE USER ... VIA .. USING ..' syntax for + // newer MariaDB versions + if ((($serverType == 'MySQL' || $serverType == 'Percona Server') + && $serverVersion >= 50706) + || ($serverType == 'MariaDB' + && $serverVersion >= 50200) + ) { + $password_set_real = null; + + // Required for binding '%' with '%s' + $create_user_stmt = str_replace( + '%', '%%', $create_user_stmt + ); + + // MariaDB uses 'USING' whereas MySQL uses 'AS' + // but MariaDB with validation plugin needs cleartext password + if ($serverType == 'MariaDB' + && ! $isMariaDBPwdPluginActive + ) { + $create_user_stmt .= ' USING \'%s\''; + } elseif ($serverType == 'MariaDB') { + $create_user_stmt .= ' IDENTIFIED BY \'%s\''; + } elseif (($serverType == 'MySQL' || $serverType == 'Percona Server') && $serverVersion >= 80011) { + $create_user_stmt .= ' BY \'%s\''; + } else { + $create_user_stmt .= ' AS \'%s\''; + } + + if ($_POST['pred_password'] == 'keep') { + $create_user_real = sprintf( + $create_user_stmt, + $slashedPassword + ); + $create_user_show = sprintf( + $create_user_stmt, + '***' + ); + } elseif ($_POST['pred_password'] == 'none') { + $create_user_real = sprintf( + $create_user_stmt, + null + ); + $create_user_show = sprintf( + $create_user_stmt, + '***' + ); + } else { + if (! (($serverType == 'MariaDB' && $isMariaDBPwdPluginActive) + || ($serverType == 'MySQL' || $serverType == 'Percona Server') && $serverVersion >= 80011)) { + $hashedPassword = self::getHashedPassword($_POST['pma_pw']); + } else { + // MariaDB with validation plugin needs cleartext password + $hashedPassword = $_POST['pma_pw']; + } + $create_user_real = sprintf( + $create_user_stmt, + $hashedPassword + ); + $create_user_show = sprintf( + $create_user_stmt, + '***' + ); + } + } else { + // Use 'SET PASSWORD' syntax for pre-5.7.6 MySQL versions + // and pre-5.2.0 MariaDB versions + if ($_POST['pred_password'] == 'keep') { + $password_set_real = sprintf( + $password_set_stmt, + $slashedUsername, + $slashedHostname, + $slashedPassword + ); + } elseif ($_POST['pred_password'] == 'none') { + $password_set_real = sprintf( + $password_set_stmt, + $slashedUsername, + $slashedHostname, + null + ); + } else { + $hashedPassword = self::getHashedPassword($_POST['pma_pw']); + $password_set_real = sprintf( + $password_set_stmt, + $slashedUsername, + $slashedHostname, + $hashedPassword + ); + } + } + + $alter_real_sql_query = ''; + $alter_sql_query = ''; + if (($serverType == 'MySQL' || $serverType == 'Percona Server') && $serverVersion >= 80011) { + $sql_query_stmt = ''; + if ((isset($_POST['Grant_priv']) && $_POST['Grant_priv'] == 'Y') + || (isset($GLOBALS['Grant_priv']) && $GLOBALS['Grant_priv'] == 'Y') + ) { + $sql_query_stmt = ' WITH GRANT OPTION'; + } + $real_sql_query .= $sql_query_stmt; + $sql_query .= $sql_query_stmt; + + $alter_sql_query_stmt = sprintf( + 'ALTER USER \'%s\'@\'%s\'', + $slashedUsername, + $slashedHostname + ); + $alter_real_sql_query = $alter_sql_query_stmt; + $alter_sql_query = $alter_sql_query_stmt; + } + + // add REQUIRE clause + $require_clause = self::getRequireClause(); + $with_clause = self::getWithClauseForAddUserAndUpdatePrivs(); + + if (($serverType == 'MySQL' || $serverType == 'Percona Server') && $serverVersion >= 80011) { + $alter_real_sql_query .= $require_clause; + $alter_sql_query .= $require_clause; + $alter_real_sql_query .= $with_clause; + $alter_sql_query .= $with_clause; + } else { + $real_sql_query .= $require_clause; + $sql_query .= $require_clause; + $real_sql_query .= $with_clause; + $sql_query .= $with_clause; + } + + if (isset($create_user_real)) { + $create_user_real .= ';'; + $create_user_show .= ';'; + } + if ($alter_real_sql_query !== '') { + $alter_real_sql_query .= ';'; + $alter_sql_query .= ';'; + } + $real_sql_query .= ';'; + $sql_query .= ';'; + // No Global GRANT_OPTION privilege + if (!$GLOBALS['is_grantuser']) { + $real_sql_query = ''; + $sql_query = ''; + } + + // Use 'SET PASSWORD' for pre-5.7.6 MySQL versions + // and pre-5.2.0 MariaDB + if (($serverType == 'MySQL' + && $serverVersion >= 50706) + || ($serverType == 'MariaDB' + && $serverVersion >= 50200) + ) { + $password_set_real = null; + $password_set_show = null; + } else { + if ($password_set_real !== null) { + $password_set_real .= ";"; + } + $password_set_show .= ";"; + } + + return array( + $create_user_real, + $create_user_show, + $real_sql_query, + $sql_query, + $password_set_real, + $password_set_show, + $alter_real_sql_query, + $alter_sql_query + ); + } + + /** + * Returns the type ('PROCEDURE' or 'FUNCTION') of the routine + * + * @param string $dbname database + * @param string $routineName routine + * + * @return string type + */ + public static function getRoutineType($dbname, $routineName) + { + $routineData = $GLOBALS['dbi']->getRoutines($dbname); + + foreach ($routineData as $routine) { + if ($routine['name'] === $routineName) { + return $routine['type']; + } + } + return ''; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Select.php b/phpMyAdmin/libraries/classes/Server/Select.php new file mode 100755 index 0000000..b5b434d --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Select.php @@ -0,0 +1,125 @@ +'; + + if (! $omit_fieldset) { + $retval .= '
    '; + } + + $retval .= Url::getHiddenFields(array()); + $retval .= ' '; + + $retval .= ''; + if (! $omit_fieldset) { + $retval .= '
    '; + } + $retval .= ''; + } elseif ($list) { + $retval .= ''; + } + + return $retval; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Status.php b/phpMyAdmin/libraries/classes/Server/Status.php new file mode 100755 index 0000000..d670543 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Status.php @@ -0,0 +1,335 @@ +fetchValue( + 'SELECT UNIX_TIMESTAMP() - ' . $serverStatusData->status['Uptime'] + ); + + $retval = '

    '; + $bytes_received = $serverStatusData->status['Bytes_received']; + $bytes_sent = $serverStatusData->status['Bytes_sent']; + $retval .= sprintf( + __('Network traffic since startup: %s'), + implode( + ' ', + Util::formatByteDown( + $bytes_received + $bytes_sent, + 3, + 1 + ) + ) + ); + $retval .= '

    '; + $retval .= '

    '; + $retval .= sprintf( + __('This MySQL server has been running for %1$s. It started up on %2$s.'), + Util::timespanFormat($serverStatusData->status['Uptime']), + Util::localisedDate($start_time) + ) . "\n"; + $retval .= '

    '; + + return $retval; + } + + /** + * Returns HTML to display replication information + * + * @return string HTML on replication + */ + public static function getHtmlForReplicationInfo() + { + $retval = '

    '; + if ($GLOBALS['replication_info']['master']['status'] + && $GLOBALS['replication_info']['slave']['status'] + ) { + $retval .= __( + 'This MySQL server works as master and ' + . 'slave in replication process.' + ); + } elseif ($GLOBALS['replication_info']['master']['status']) { + $retval .= __( + 'This MySQL server works as master ' + . 'in replication process.' + ); + } elseif ($GLOBALS['replication_info']['slave']['status']) { + $retval .= __( + 'This MySQL server works as slave ' + . 'in replication process.' + ); + } + $retval .= '

    '; + + /* + * if the server works as master or slave in replication process, + * display useful information + */ + $retval .= '
    '; + $retval .= '

    '; + $retval .= __('Replication status'); + $retval .= '

    '; + foreach ($GLOBALS['replication_types'] as $type) { + if (isset($GLOBALS['replication_info'][$type]['status']) + && $GLOBALS['replication_info'][$type]['status'] + ) { + $retval .= ReplicationGui::getHtmlForReplicationStatusTable($type); + } + } + + return $retval; + } + + /** + * Prints server state traffic information + * + * @param Data $serverStatusData Server status data + * + * @return string + */ + public static function getHtmlForServerStateTraffic(Data $serverStatusData) + { + $hour_factor = 3600 / $serverStatusData->status['Uptime']; + $retval = ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= '
    '; + $retval .= __('Traffic') . ' '; + $retval .= Util::showHint( + __( + 'On a busy server, the byte counters may overrun, so those statistics ' + . 'as reported by the MySQL server may be incorrect.' + ) + ); + $retval .= '#ø ' . __('per hour') . '
    ' . __('Received') . ''; + $retval .= implode( + ' ', + Util::formatByteDown( + $serverStatusData->status['Bytes_received'], 3, 1 + ) + ); + $retval .= ''; + $retval .= implode( + ' ', + Util::formatByteDown( + $serverStatusData->status['Bytes_received'] * $hour_factor, 3, 1 + ) + ); + $retval .= '
    ' . __('Sent') . ''; + $retval .= implode( + ' ', + Util::formatByteDown( + $serverStatusData->status['Bytes_sent'], 3, 1 + ) + ); + $retval .= ''; + $retval .= implode( + ' ', + Util::formatByteDown( + $serverStatusData->status['Bytes_sent'] * $hour_factor, 3, 1 + ) + ); + $retval .= '
    ' . __('Total') . ''; + $bytes_received = $serverStatusData->status['Bytes_received']; + $bytes_sent = $serverStatusData->status['Bytes_sent']; + $retval .= implode( + ' ', + Util::formatByteDown( + $bytes_received + $bytes_sent, 3, 1 + ) + ); + $retval .= ''; + $bytes_received = $serverStatusData->status['Bytes_received']; + $bytes_sent = $serverStatusData->status['Bytes_sent']; + $retval .= implode( + ' ', + Util::formatByteDown( + ($bytes_received + $bytes_sent) * $hour_factor, 3, 1 + ) + ); + $retval .= '
    '; + return $retval; + } + + /** + * Prints server state connections information + * + * @param Data $serverStatusData Server status data + * + * @return string + */ + public static function getHtmlForServerStateConnections(Data $serverStatusData) + { + $hour_factor = 3600 / $serverStatusData->status['Uptime']; + $retval = ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= '
    ' . __('Connections') . '#ø ' . __('per hour') . '%
    ' . __('Max. concurrent connections') . ''; + $retval .= Util::formatNumber( + $serverStatusData->status['Max_used_connections'], 0 + ); + $retval .= '--- ---
    ' . __('Failed attempts') . ''; + $retval .= Util::formatNumber( + $serverStatusData->status['Aborted_connects'], 4, 1, true + ); + $retval .= ''; + $retval .= Util::formatNumber( + $serverStatusData->status['Aborted_connects'] * $hour_factor, 4, 2, true + ); + $retval .= ''; + if ($serverStatusData->status['Connections'] > 0) { + $abortNum = $serverStatusData->status['Aborted_connects']; + $connectNum = $serverStatusData->status['Connections']; + + $retval .= Util::formatNumber( + $abortNum * 100 / $connectNum, + 0, 2, true + ); + $retval .= '%'; + } else { + $retval .= '--- '; + } + $retval .= '
    ' . __('Aborted') . ''; + $retval .= Util::formatNumber( + $serverStatusData->status['Aborted_clients'], 4, 1, true + ); + $retval .= ''; + $retval .= Util::formatNumber( + $serverStatusData->status['Aborted_clients'] * $hour_factor, 4, 2, true + ); + $retval .= ''; + if ($serverStatusData->status['Connections'] > 0) { + $abortNum = $serverStatusData->status['Aborted_clients']; + $connectNum = $serverStatusData->status['Connections']; + + $retval .= Util::formatNumber( + $abortNum * 100 / $connectNum, + 0, 2, true + ); + $retval .= '%'; + } else { + $retval .= '--- '; + } + $retval .= '
    ' . __('Total') . ''; + $retval .= Util::formatNumber( + $serverStatusData->status['Connections'], 4, 0 + ); + $retval .= ''; + $retval .= Util::formatNumber( + $serverStatusData->status['Connections'] * $hour_factor, 4, 2 + ); + $retval .= ''; + $retval .= Util::formatNumber(100, 0, 2); + $retval .= '%
    '; + + return $retval; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Status/Advisor.php b/phpMyAdmin/libraries/classes/Server/Status/Advisor.php new file mode 100755 index 0000000..2356c71 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Status/Advisor.php @@ -0,0 +1,73 @@ +'; + $output .= Util::getIcon('b_help', __('Instructions')); + $output .= ''; + $output .= '
    '; + $output .= '
    '; + $output .= '

    '; + $output .= __( + 'The Advisor system can provide recommendations ' + . 'on server variables by analyzing the server status variables.' + ); + $output .= '

    '; + $output .= '

    '; + $output .= __( + 'Do note however that this system provides recommendations ' + . 'based on simple calculations and by rule of thumb which may ' + . 'not necessarily apply to your system.' + ); + $output .= '

    '; + $output .= '

    '; + $output .= __( + 'Prior to changing any of the configuration, be sure to know ' + . 'what you are changing (by reading the documentation) and how ' + . 'to undo the change. Wrong tuning can have a very negative ' + . 'effect on performance.' + ); + $output .= '

    '; + $output .= '

    '; + $output .= __( + 'The best way to tune your system would be to change only one ' + . 'setting at a time, observe or benchmark your database, and undo ' + . 'the change if there was no clearly measurable improvement.' + ); + $output .= '

    '; + $output .= '
    '; + $output .= '
    '; + $advisor = new PmaAdvisor($GLOBALS['dbi'], new ExpressionLanguage()); + $output .= htmlspecialchars( + json_encode( + $advisor->run() + ) + ); + $output .= '
    '; + + return $output; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Status/Data.php b/phpMyAdmin/libraries/classes/Server/Status/Data.php new file mode 100755 index 0000000..0192657 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Status/Data.php @@ -0,0 +1,504 @@ + section + // variable names match when they begin with the given string + + 'Com_' => 'com', + 'Innodb_' => 'innodb', + 'Ndb_' => 'ndb', + 'Handler_' => 'handler', + 'Qcache_' => 'qcache', + 'Threads_' => 'threads', + 'Slow_launch_threads' => 'threads', + + 'Binlog_cache_' => 'binlog_cache', + 'Created_tmp_' => 'created_tmp', + 'Key_' => 'key', + + 'Delayed_' => 'delayed', + 'Not_flushed_delayed_rows' => 'delayed', + + 'Flush_commands' => 'query', + 'Last_query_cost' => 'query', + 'Slow_queries' => 'query', + 'Queries' => 'query', + 'Prepared_stmt_count' => 'query', + + 'Select_' => 'select', + 'Sort_' => 'sort', + + 'Open_tables' => 'table', + 'Opened_tables' => 'table', + 'Open_table_definitions' => 'table', + 'Opened_table_definitions' => 'table', + 'Table_locks_' => 'table', + + 'Rpl_status' => 'repl', + 'Slave_' => 'repl', + + 'Tc_' => 'tc', + + 'Ssl_' => 'ssl', + + 'Open_files' => 'files', + 'Open_streams' => 'files', + 'Opened_files' => 'files', + ); + } + + /** + * Gets the sections for constructor + * + * @return array + */ + private function _getSections() + { + return array( + // section => section name (description) + 'com' => 'Com', + 'query' => __('SQL query'), + 'innodb' => 'InnoDB', + 'ndb' => 'NDB', + 'handler' => __('Handler'), + 'qcache' => __('Query cache'), + 'threads' => __('Threads'), + 'binlog_cache' => __('Binary log'), + 'created_tmp' => __('Temporary data'), + 'delayed' => __('Delayed inserts'), + 'key' => __('Key cache'), + 'select' => __('Joins'), + 'repl' => __('Replication'), + 'sort' => __('Sorting'), + 'table' => __('Tables'), + 'tc' => __('Transaction coordinator'), + 'files' => __('Files'), + 'ssl' => 'SSL', + 'other' => __('Other') + ); + } + + /** + * Gets the links for constructor + * + * @return array + */ + private function _getLinks() + { + $links = array(); + // variable or section name => (name => url) + + $links['table'][__('Flush (close) all tables')] = [ + 'url' => $this->selfUrl, + 'params' => Url::getCommon(['flush' => 'TABLES'], ''), + ]; + $links['table'][__('Show open tables')] = [ + 'url' => 'sql.php', + 'params' => Url::getCommon([ + 'sql_query' => 'SHOW OPEN TABLES', + 'goto' => $this->selfUrl, + ], ''), + ]; + + if ($GLOBALS['replication_info']['master']['status']) { + $links['repl'][__('Show slave hosts')] = [ + 'url' => 'sql.php', + 'params' => Url::getCommon([ + 'sql_query' => 'SHOW SLAVE HOSTS', + 'goto' => $this->selfUrl, + ], ''), + ]; + $links['repl'][__('Show master status')] = [ + 'url' => '#replication_master', + 'params' => '', + ]; + } + if ($GLOBALS['replication_info']['slave']['status']) { + $links['repl'][__('Show slave status')] = [ + 'url' => '#replication_slave', + 'params' => '', + ]; + } + + $links['repl']['doc'] = 'replication'; + + $links['qcache'][__('Flush query cache')] = [ + 'url' => $this->selfUrl, + 'params' => Url::getCommon(['flush' => 'QUERY CACHE'], ''), + ]; + $links['qcache']['doc'] = 'query_cache'; + + $links['threads']['doc'] = 'mysql_threads'; + + $links['key']['doc'] = 'myisam_key_cache'; + + $links['binlog_cache']['doc'] = 'binary_log'; + + $links['Slow_queries']['doc'] = 'slow_query_log'; + + $links['innodb'][__('Variables')] = [ + 'url' => 'server_engines.php', + 'params' => Url::getCommon(['engine' => 'InnoDB'], ''), + ]; + $links['innodb'][__('InnoDB Status')] = [ + 'url' => 'server_engines.php', + 'params' => Url::getCommon([ + 'engine' => 'InnoDB', + 'page' => 'Status', + ], ''), + ]; + $links['innodb']['doc'] = 'innodb'; + + return($links); + } + + /** + * Calculate some values + * + * @param array $server_status contains results of SHOW GLOBAL STATUS + * @param array $server_variables contains results of SHOW GLOBAL VARIABLES + * + * @return array $server_status + */ + private function _calculateValues(array $server_status, array $server_variables) + { + // Key_buffer_fraction + if (isset($server_status['Key_blocks_unused']) + && isset($server_variables['key_cache_block_size']) + && isset($server_variables['key_buffer_size']) + && $server_variables['key_buffer_size'] != 0 + ) { + $server_status['Key_buffer_fraction_%'] + = 100 + - $server_status['Key_blocks_unused'] + * $server_variables['key_cache_block_size'] + / $server_variables['key_buffer_size'] + * 100; + } elseif (isset($server_status['Key_blocks_used']) + && isset($server_variables['key_buffer_size']) + && $server_variables['key_buffer_size'] != 0 + ) { + $server_status['Key_buffer_fraction_%'] + = $server_status['Key_blocks_used'] + * 1024 + / $server_variables['key_buffer_size']; + } + + // Ratio for key read/write + if (isset($server_status['Key_writes']) + && isset($server_status['Key_write_requests']) + && $server_status['Key_write_requests'] > 0 + ) { + $key_writes = $server_status['Key_writes']; + $key_write_requests = $server_status['Key_write_requests']; + $server_status['Key_write_ratio_%'] + = 100 * $key_writes / $key_write_requests; + } + + if (isset($server_status['Key_reads']) + && isset($server_status['Key_read_requests']) + && $server_status['Key_read_requests'] > 0 + ) { + $key_reads = $server_status['Key_reads']; + $key_read_requests = $server_status['Key_read_requests']; + $server_status['Key_read_ratio_%'] + = 100 * $key_reads / $key_read_requests; + } + + // Threads_cache_hitrate + if (isset($server_status['Threads_created']) + && isset($server_status['Connections']) + && $server_status['Connections'] > 0 + ) { + + $server_status['Threads_cache_hitrate_%'] + = 100 - $server_status['Threads_created'] + / $server_status['Connections'] * 100; + } + return $server_status; + } + + /** + * Sort variables into arrays + * + * @param array $server_status contains results of SHOW GLOBAL STATUS + * @param array $allocations allocations for sections + * @param array $allocationMap map variables to their section + * @param array $sectionUsed is a section used? + * @param array $used_queries used queries + * + * @return array ($allocationMap, $sectionUsed, $used_queries) + */ + private function _sortVariables( + array $server_status, array $allocations, array $allocationMap, array $sectionUsed, + array $used_queries + ) { + foreach ($server_status as $name => $value) { + $section_found = false; + foreach ($allocations as $filter => $section) { + if (mb_strpos($name, $filter) !== false) { + $allocationMap[$name] = $section; + $sectionUsed[$section] = true; + $section_found = true; + if ($section == 'com' && $value > 0) { + $used_queries[$name] = $value; + } + break; // Only exits inner loop + } + } + if (! $section_found) { + $allocationMap[$name] = 'other'; + $sectionUsed['other'] = true; + } + } + return array($allocationMap, $sectionUsed, $used_queries); + } + + /** + * Constructor + */ + public function __construct() + { + $this->selfUrl = basename($GLOBALS['PMA_PHP_SELF']); + + // get status from server + $server_status_result = $GLOBALS['dbi']->tryQuery('SHOW GLOBAL STATUS'); + $server_status = array(); + if ($server_status_result === false) { + $this->dataLoaded = false; + } else { + $this->dataLoaded = true; + while ($arr = $GLOBALS['dbi']->fetchRow($server_status_result)) { + $server_status[$arr[0]] = $arr[1]; + } + $GLOBALS['dbi']->freeResult($server_status_result); + } + + // for some calculations we require also some server settings + $server_variables = $GLOBALS['dbi']->fetchResult( + 'SHOW GLOBAL VARIABLES', 0, 1 + ); + + // cleanup of some deprecated values + $server_status = self::cleanDeprecated($server_status); + + // calculate some values + $server_status = $this->_calculateValues( + $server_status, $server_variables + ); + + // split variables in sections + $allocations = $this->_getAllocations(); + + $sections = $this->_getSections(); + + // define some needful links/commands + $links = $this->_getLinks(); + + // Variable to contain all com_ variables (query statistics) + $used_queries = array(); + + // Variable to map variable names to their respective section name + // (used for js category filtering) + $allocationMap = array(); + + // Variable to mark used sections + $sectionUsed = array(); + + // sort vars into arrays + list( + $allocationMap, $sectionUsed, $used_queries + ) = $this->_sortVariables( + $server_status, $allocations, $allocationMap, $sectionUsed, + $used_queries + ); + + // admin commands are not queries (e.g. they include COM_PING, + // which is excluded from $server_status['Questions']) + unset($used_queries['Com_admin_commands']); + + // Set all class properties + $this->db_isLocal = false; + $serverHostToLower = mb_strtolower( + $GLOBALS['cfg']['Server']['host'] + ); + if ($serverHostToLower === 'localhost' + || $GLOBALS['cfg']['Server']['host'] === '127.0.0.1' + || $GLOBALS['cfg']['Server']['host'] === '::1' + ) { + $this->db_isLocal = true; + } + $this->status = $server_status; + $this->sections = $sections; + $this->variables = $server_variables; + $this->used_queries = $used_queries; + $this->allocationMap = $allocationMap; + $this->links = $links; + $this->sectionUsed = $sectionUsed; + } + + /** + * cleanup of some deprecated values + * + * @param array $server_status status array to process + * + * @return array + */ + public static function cleanDeprecated(array $server_status) + { + $deprecated = array( + 'Com_prepare_sql' => 'Com_stmt_prepare', + 'Com_execute_sql' => 'Com_stmt_execute', + 'Com_dealloc_sql' => 'Com_stmt_close', + ); + foreach ($deprecated as $old => $new) { + if (isset($server_status[$old]) && isset($server_status[$new])) { + unset($server_status[$old]); + } + } + return $server_status; + } + + /** + * Generates menu HTML + * + * @return string + */ + public function getMenuHtml() + { + $url_params = Url::getCommon(); + $items = array( + array( + 'name' => __('Server'), + 'url' => 'server_status.php' + ), + array( + 'name' => __('Processes'), + 'url' => 'server_status_processes.php' + ), + array( + 'name' => __('Query statistics'), + 'url' => 'server_status_queries.php' + ), + array( + 'name' => __('All status variables'), + 'url' => 'server_status_variables.php' + ), + array( + 'name' => __('Monitor'), + 'url' => 'server_status_monitor.php' + ), + array( + 'name' => __('Advisor'), + 'url' => 'server_status_advisor.php' + ) + ); + + $retval = '
      '; + foreach ($items as $item) { + $class = ''; + if ($item['url'] === $this->selfUrl) { + $class = ' class="tabactive"'; + } + $retval .= '
    • '; + $retval .= ''; + $retval .= $item['name']; + $retval .= ''; + $retval .= '
    • '; + } + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } + + /** + * Builds a '; + foreach ($refreshRates as $rate) { + $selected = ($rate == $defaultRate)?' selected="selected"':''; + $return .= ''; + } + $return .= ''; + return $return; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Status/Monitor.php b/phpMyAdmin/libraries/classes/Server/Status/Monitor.php new file mode 100755 index 0000000..b040193 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Status/Monitor.php @@ -0,0 +1,829 @@ +'; + $retval .= '
    '; + $retval .= '
    '; + $retval .= '
    '; + + $retval .= ''; + + return $retval; + } + + /** + * Returns html for Analyse Dialog + * + * @return string + */ + public static function getHtmlForAnalyseDialog() + { + $retval = '
    '; + $retval .= '

    ' . __('Selected time range:'); + $retval .= ' - '; + $retval .= ''; + $retval .= '

    '; + $retval .= ''; + $retval .= ''; + $retval .= '
    '; + $retval .= ''; + $retval .= ''; + $retval .= '

    '; + $retval .= __( + 'Choose from which log you want the statistics to be generated from.' + ); + $retval .= '

    '; + $retval .= '

    '; + $retval .= __('Results are grouped by query text.'); + $retval .= '

    '; + $retval .= '
    '; + $retval .= '
    '; + $retval .= ''; + $retval .= '

    '; + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } + + /** + * Returns html for Instructions Dialog + * + * @return string + */ + public static function getHtmlForInstructionsDialog() + { + $retval = '
    '; + $retval .= __( + 'The phpMyAdmin Monitor can assist you in optimizing the server' + . ' configuration and track down time intensive queries. For the latter you' + . ' will need to set log_output to \'TABLE\' and have either the' + . ' slow_query_log or general_log enabled. Note however, that the' + . ' general_log produces a lot of data and increases server load' + . ' by up to 15%.' + ); + + $retval .= '

    '; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= '

    '; + $retval .= ''; + $retval .= __('Using the monitor:'); + $retval .= '

    '; + $retval .= __( + 'Your browser will refresh all displayed charts in a regular interval.' + . ' You may add charts and change the refresh rate under \'Settings\',' + . ' or remove any chart using the cog icon on each respective chart.' + ); + $retval .= '

    '; + $retval .= __( + 'To display queries from the logs, select the relevant time span on any' + . ' chart by holding down the left mouse button and panning over the' + . ' chart. Once confirmed, this will load a table of grouped queries,' + . ' there you may click on any occurring SELECT statements to further' + . ' analyze them.' + ); + $retval .= '

    '; + $retval .= '

    '; + $retval .= Util::getImage('s_attention'); + $retval .= ''; + $retval .= __('Please note:'); + $retval .= '
    '; + $retval .= __( + 'Enabling the general_log may increase the server load by' + . ' 5-15%. Also be aware that generating statistics from the logs is a' + . ' load intensive task, so it is advisable to select only a small time' + . ' span and to disable the general_log and empty its table once' + . ' monitoring is not required any more.' + ); + $retval .= '

    '; + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } + + /** + * Returns html for addChartDialog + * + * @return string + */ + public static function getHtmlForAddChartDialog() + { + $retval = '
    '; + $retval .= '
    '; + $retval .= '

    '; + $retval .= ''; + $retval .= ''; + $retval .= '
    '; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= '
    '; + $retval .= '
    '; + $retval .= ''; + $retval .= ''; + $retval .= '

    '; + $retval .= ''; + $retval .= '
    '; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= '(' . __('KiB') . ', '; + $retval .= '' . __('MiB') . ')'; + $retval .= '
    '; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= '

    '; + $retval .= '' . __('Add this series') . ''; + $retval .= ''; + $retval .= ' | ' . __('Clear series') . ''; + $retval .= ''; + $retval .= '

    '; + $retval .= __('Series in chart:'); + $retval .= '
    '; + $retval .= ''; + $retval .= '' . __('None') . ''; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } + + /** + * Returns html with Tab Links + * + * @return string + */ + public static function getHtmlForTabLinks() + { + $retval = ''; + + return $retval; + } + + /** + * Returns html with Settings dialog + * + * @return string + */ + public static function getHtmlForSettingsDialog() + { + $retval = '
    '; + $retval .= ''; + $retval .= Util::getImage('b_chart') . __('Add chart'); + $retval .= ''; + $retval .= ''; + $retval .= Util::getImage('b_tblops') + . __('Enable charts dragging'); + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= __('Refresh rate') . '
    '; + $retval .= Data::getHtmlForRefreshList( + 'gridChartRefresh', + 5, + Array(2, 3, 4, 5, 10, 20, 40, 60, 120, 300, 600, 1200) + ); + $retval .= '
    '; + $retval .= '
    '; + $retval .= '
    '; + $retval .= __('Chart columns'); + $retval .= '
    '; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= '' . __('Chart arrangement') . ' '; + $retval .= Util::showHint( + __( + 'The arrangement of the charts is stored to the browsers local storage. ' + . 'You may want to export it if you have a complicated set up.' + ) + ); + $retval .= '
    '; + $retval .= ''; + $retval .= __('Import'); + $retval .= ''; + $retval .= '  '; + $retval .= ''; + $retval .= __('Export'); + $retval .= ''; + $retval .= '  '; + $retval .= ''; + $retval .= __('Reset to default'); + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } + + + /** + * Define some data and links needed on the client side + * + * @param Data $serverStatusData Server status data + * + * @return string + */ + public static function getHtmlForClientSideDataAndLinks(Data $serverStatusData) + { + /** + * Define some data needed on the client side + */ + $input = ''; + $form = '
    '; + $form .= sprintf($input, 'server_time', microtime(true) * 1000); + $form .= sprintf($input, 'server_os', SysInfo::getOs()); + $form .= sprintf($input, 'is_superuser', $GLOBALS['dbi']->isSuperuser()); + $form .= sprintf($input, 'server_db_isLocal', $serverStatusData->db_isLocal); + $form .= '
    '; + /** + * Define some links used on client side + */ + $links = '
    '; + $links .= Util::showMySQLDocu('general-thread-states'); + $links .= '
    '; + $links .= '
    '; + $links .= Util::showMySQLDocu('explain-output'); + $links .= '
    '; + + return $form . $links; + } + + /***************************Ajax request function***********************************/ + + /** + * Returns JSon for real-time charting data + * + * @return array + */ + public static function getJsonForChartingData() + { + $ret = json_decode($_POST['requiredData'], true); + $statusVars = array(); + $serverVars = array(); + $sysinfo = $cpuload = $memory = 0; + + /* Accumulate all required variables and data */ + list($serverVars, $statusVars, $ret) = self::getJsonForChartingDataGet( + $ret, $serverVars, $statusVars, $sysinfo, $cpuload, $memory + ); + + // Retrieve all required status variables + if (count($statusVars)) { + $statusVarValues = $GLOBALS['dbi']->fetchResult( + "SHOW GLOBAL STATUS WHERE Variable_name='" + . implode("' OR Variable_name='", $statusVars) . "'", + 0, + 1 + ); + } else { + $statusVarValues = array(); + } + + // Retrieve all required server variables + if (count($serverVars)) { + $serverVarValues = $GLOBALS['dbi']->fetchResult( + "SHOW GLOBAL VARIABLES WHERE Variable_name='" + . implode("' OR Variable_name='", $serverVars) . "'", + 0, + 1 + ); + } else { + $serverVarValues = array(); + } + + // ...and now assign them + $ret = self::getJsonForChartingDataSet($ret, $statusVarValues, $serverVarValues); + + $ret['x'] = microtime(true) * 1000; + return $ret; + } + + /** + * Assign the variables for real-time charting data + * + * @param array $ret Real-time charting data + * @param array $statusVarValues Status variable values + * @param array $serverVarValues Server variable values + * + * @return array + */ + public static function getJsonForChartingDataSet(array $ret, array $statusVarValues, array $serverVarValues) + { + foreach ($ret as $chart_id => $chartNodes) { + foreach ($chartNodes as $node_id => $nodeDataPoints) { + foreach ($nodeDataPoints as $point_id => $dataPoint) { + switch ($dataPoint['type']) { + case 'statusvar': + $ret[$chart_id][$node_id][$point_id]['value'] + = $statusVarValues[$dataPoint['name']]; + break; + case 'servervar': + $ret[$chart_id][$node_id][$point_id]['value'] + = $serverVarValues[$dataPoint['name']]; + break; + } + } + } + } + return $ret; + } + + /** + * Get called to get JSON for charting data + * + * @param array $ret Real-time charting data + * @param array $serverVars Server variable values + * @param array $statusVars Status variable values + * @param mixed $sysinfo System info + * @param mixed $cpuload CPU load + * @param mixed $memory Memory + * + * @return array + */ + public static function getJsonForChartingDataGet( + array $ret, array $serverVars, array $statusVars, $sysinfo, $cpuload, $memory + ) { + // For each chart + foreach ($ret as $chart_id => $chartNodes) { + // For each data series + foreach ($chartNodes as $node_id => $nodeDataPoints) { + // For each data point in the series (usually just 1) + foreach ($nodeDataPoints as $point_id => $dataPoint) { + list($serverVars, $statusVars, $ret[$chart_id][$node_id][$point_id]) + = self::getJsonForChartingDataSwitch( + $dataPoint['type'], $dataPoint['name'], $serverVars, + $statusVars, $ret[$chart_id][$node_id][$point_id], + $sysinfo, $cpuload, $memory + ); + } /* foreach */ + } /* foreach */ + } + return array($serverVars, $statusVars, $ret); + } + + /** + * Switch called to get JSON for charting data + * + * @param string $type Type + * @param string $pName Name + * @param array $serverVars Server variable values + * @param array $statusVars Status variable values + * @param array $ret Real-time charting data + * @param mixed $sysinfo System info + * @param mixed $cpuload CPU load + * @param mixed $memory Memory + * + * @return array + */ + public static function getJsonForChartingDataSwitch( + $type, $pName, array $serverVars, array $statusVars, array $ret, + $sysinfo, $cpuload, $memory + ) { + switch ($type) { + /* We only collect the status and server variables here to + * read them all in one query, + * and only afterwards assign them. + * Also do some white list filtering on the names + */ + case 'servervar': + if (!preg_match('/[^a-zA-Z_]+/', $pName)) { + $serverVars[] = $pName; + } + break; + + case 'statusvar': + if (!preg_match('/[^a-zA-Z_]+/', $pName)) { + $statusVars[] = $pName; + } + break; + + case 'proc': + $result = $GLOBALS['dbi']->query('SHOW PROCESSLIST'); + $ret['value'] = $GLOBALS['dbi']->numRows($result); + break; + + case 'cpu': + if (!$sysinfo) { + $sysinfo = SysInfo::get(); + } + if (!$cpuload) { + $cpuload = $sysinfo->loadavg(); + } + + if (SysInfo::getOs() == 'Linux') { + $ret['idle'] = $cpuload['idle']; + $ret['busy'] = $cpuload['busy']; + } else { + $ret['value'] = $cpuload['loadavg']; + } + + break; + + case 'memory': + if (!$sysinfo) { + $sysinfo = SysInfo::get(); + } + if (!$memory) { + $memory = $sysinfo->memory(); + } + + $ret['value'] = isset($memory[$pName]) ? $memory[$pName] : 0; + break; + } + + return array($serverVars, $statusVars, $ret); + } + + /** + * Returns JSon for log data with type: slow + * + * @param int $start Unix Time: Start time for query + * @param int $end Unix Time: End time for query + * + * @return array + */ + public static function getJsonForLogDataTypeSlow($start, $end) + { + $query = 'SELECT start_time, user_host, '; + $query .= 'Sec_to_Time(Sum(Time_to_Sec(query_time))) as query_time, '; + $query .= 'Sec_to_Time(Sum(Time_to_Sec(lock_time))) as lock_time, '; + $query .= 'SUM(rows_sent) AS rows_sent, '; + $query .= 'SUM(rows_examined) AS rows_examined, db, sql_text, '; + $query .= 'COUNT(sql_text) AS \'#\' '; + $query .= 'FROM `mysql`.`slow_log` '; + $query .= 'WHERE start_time > FROM_UNIXTIME(' . $start . ') '; + $query .= 'AND start_time < FROM_UNIXTIME(' . $end . ') GROUP BY sql_text'; + + $result = $GLOBALS['dbi']->tryQuery($query); + + $return = array('rows' => array(), 'sum' => array()); + + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $type = mb_strtolower( + mb_substr( + $row['sql_text'], + 0, + mb_strpos($row['sql_text'], ' ') + ) + ); + + switch($type) { + case 'insert': + case 'update': + //Cut off big inserts and updates, but append byte count instead + if (mb_strlen($row['sql_text']) > 220) { + $implode_sql_text = implode( + ' ', + Util::formatByteDown( + mb_strlen($row['sql_text']), 2, 2 + ) + ); + $row['sql_text'] = mb_substr($row['sql_text'], 0, 200) + . '... [' . $implode_sql_text . ']'; + } + break; + default: + break; + } + + if (! isset($return['sum'][$type])) { + $return['sum'][$type] = 0; + } + $return['sum'][$type] += $row['#']; + $return['rows'][] = $row; + } + + $return['sum']['TOTAL'] = array_sum($return['sum']); + $return['numRows'] = count($return['rows']); + + $GLOBALS['dbi']->freeResult($result); + return $return; + } + + /** + * Returns JSon for log data with type: general + * + * @param int $start Unix Time: Start time for query + * @param int $end Unix Time: End time for query + * + * @return array + */ + public static function getJsonForLogDataTypeGeneral($start, $end) + { + $limitTypes = ''; + if (isset($_POST['limitTypes']) && $_POST['limitTypes']) { + $limitTypes + = 'AND argument REGEXP \'^(INSERT|SELECT|UPDATE|DELETE)\' '; + } + + $query = 'SELECT TIME(event_time) as event_time, user_host, thread_id, '; + $query .= 'server_id, argument, count(argument) as \'#\' '; + $query .= 'FROM `mysql`.`general_log` '; + $query .= 'WHERE command_type=\'Query\' '; + $query .= 'AND event_time > FROM_UNIXTIME(' . $start . ') '; + $query .= 'AND event_time < FROM_UNIXTIME(' . $end . ') '; + $query .= $limitTypes . 'GROUP by argument'; // HAVING count > 1'; + + $result = $GLOBALS['dbi']->tryQuery($query); + + $return = array('rows' => array(), 'sum' => array()); + $insertTables = array(); + $insertTablesFirst = -1; + $i = 0; + $removeVars = isset($_POST['removeVariables']) + && $_POST['removeVariables']; + + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + preg_match('/^(\w+)\s/', $row['argument'], $match); + $type = mb_strtolower($match[1]); + + if (! isset($return['sum'][$type])) { + $return['sum'][$type] = 0; + } + $return['sum'][$type] += $row['#']; + + switch($type) { + /** @noinspection PhpMissingBreakStatementInspection */ + case 'insert': + // Group inserts if selected + if ($removeVars + && preg_match( + '/^INSERT INTO (`|\'|"|)([^\s\\1]+)\\1/i', + $row['argument'], $matches + ) + ) { + $insertTables[$matches[2]]++; + if ($insertTables[$matches[2]] > 1) { + $return['rows'][$insertTablesFirst]['#'] + = $insertTables[$matches[2]]; + + // Add a ... to the end of this query to indicate that + // there's been other queries + $temp = $return['rows'][$insertTablesFirst]['argument']; + $return['rows'][$insertTablesFirst]['argument'] + .= self::getSuspensionPoints( + $temp[strlen($temp) - 1] + ); + + // Group this value, thus do not add to the result list + continue 2; + } else { + $insertTablesFirst = $i; + $insertTables[$matches[2]] += $row['#'] - 1; + } + } + // No break here + + case 'update': + // Cut off big inserts and updates, + // but append byte count therefor + if (mb_strlen($row['argument']) > 220) { + $row['argument'] = mb_substr($row['argument'], 0, 200) + . '... [' + . implode( + ' ', + Util::formatByteDown( + mb_strlen($row['argument']), + 2, + 2 + ) + ) + . ']'; + } + break; + + default: + break; + } + + $return['rows'][] = $row; + $i++; + } + + $return['sum']['TOTAL'] = array_sum($return['sum']); + $return['numRows'] = count($return['rows']); + + $GLOBALS['dbi']->freeResult($result); + + return $return; + } + + /** + * Return suspension points if needed + * + * @param string $lastChar Last char + * + * @return null|string Return suspension points if needed + */ + public static function getSuspensionPoints($lastChar) + { + if ($lastChar != '.') { + return '
    ...'; + } + + return null; + } + + /** + * Returns JSon for logging vars + * + * @return array + */ + public static function getJsonForLoggingVars() + { + if (isset($_POST['varName']) && isset($_POST['varValue'])) { + $value = $GLOBALS['dbi']->escapeString($_POST['varValue']); + if (! is_numeric($value)) { + $value="'" . $value . "'"; + } + + if (! preg_match("/[^a-zA-Z0-9_]+/", $_POST['varName'])) { + $GLOBALS['dbi']->query( + 'SET GLOBAL ' . $_POST['varName'] . ' = ' . $value + ); + } + + } + + $loggingVars = $GLOBALS['dbi']->fetchResult( + 'SHOW GLOBAL VARIABLES WHERE Variable_name IN' + . ' ("general_log","slow_query_log","long_query_time","log_output")', + 0, + 1 + ); + return $loggingVars; + } + + /** + * Returns JSon for query_analyzer + * + * @return array + */ + public static function getJsonForQueryAnalyzer() + { + $return = array(); + + if (strlen($_POST['database']) > 0) { + $GLOBALS['dbi']->selectDb($_POST['database']); + } + + if ($profiling = Util::profilingSupported()) { + $GLOBALS['dbi']->query('SET PROFILING=1;'); + } + + // Do not cache query + $query = preg_replace( + '/^(\s*SELECT)/i', + '\\1 SQL_NO_CACHE', + $_POST['query'] + ); + + $GLOBALS['dbi']->tryQuery($query); + $return['affectedRows'] = $GLOBALS['cached_affected_rows']; + + $result = $GLOBALS['dbi']->tryQuery('EXPLAIN ' . $query); + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $return['explain'][] = $row; + } + + // In case an error happened + $return['error'] = $GLOBALS['dbi']->getError(); + + $GLOBALS['dbi']->freeResult($result); + + if ($profiling) { + $return['profiling'] = array(); + $result = $GLOBALS['dbi']->tryQuery( + 'SELECT seq,state,duration FROM INFORMATION_SCHEMA.PROFILING' + . ' WHERE QUERY_ID=1 ORDER BY seq' + ); + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $return['profiling'][]= $row; + } + $GLOBALS['dbi']->freeResult($result); + } + return $return; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Status/Processes.php b/phpMyAdmin/libraries/classes/Server/Status/Processes.php new file mode 100755 index 0000000..df888b1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Status/Processes.php @@ -0,0 +1,305 @@ +getDisplay(); + $retval = $notice . ''; + return $retval; + } + + /** + * Prints Server Process list + * + * @return string + */ + public static function getHtmlForServerProcesslist() + { + $show_full_sql = ! empty($_POST['full']); + + // This array contains display name and real column name of each + // sortable column in the table + $sortable_columns = array( + array( + 'column_name' => __('ID'), + 'order_by_field' => 'Id' + ), + array( + 'column_name' => __('User'), + 'order_by_field' => 'User' + ), + array( + 'column_name' => __('Host'), + 'order_by_field' => 'Host' + ), + array( + 'column_name' => __('Database'), + 'order_by_field' => 'db' + ), + array( + 'column_name' => __('Command'), + 'order_by_field' => 'Command' + ), + array( + 'column_name' => __('Time'), + 'order_by_field' => 'Time' + ), + array( + 'column_name' => __('Status'), + 'order_by_field' => 'State' + ), + array( + 'column_name' => __('Progress'), + 'order_by_field' => 'Progress' + ), + array( + 'column_name' => __('SQL query'), + 'order_by_field' => 'Info' + ) + ); + $sortableColCount = count($sortable_columns); + + $sql_query = $show_full_sql + ? 'SHOW FULL PROCESSLIST' + : 'SHOW PROCESSLIST'; + if ((! empty($_POST['order_by_field']) + && ! empty($_POST['sort_order'])) + || (! empty($_POST['showExecuting'])) + ) { + $sql_query = 'SELECT * FROM `INFORMATION_SCHEMA`.`PROCESSLIST` '; + } + if (! empty($_POST['showExecuting'])) { + $sql_query .= ' WHERE state != "" '; + } + if (!empty($_POST['order_by_field']) && !empty($_POST['sort_order'])) { + $sql_query .= ' ORDER BY ' + . Util::backquote($_POST['order_by_field']) + . ' ' . $_POST['sort_order']; + } + + $result = $GLOBALS['dbi']->query($sql_query); + + $retval = '
    '; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + foreach ($sortable_columns as $column) { + + $is_sorted = ! empty($_POST['order_by_field']) + && ! empty($_POST['sort_order']) + && ($_POST['order_by_field'] == $column['order_by_field']); + + $column['sort_order'] = 'ASC'; + if ($is_sorted && $_POST['sort_order'] === 'ASC') { + $column['sort_order'] = 'DESC'; + } + if (isset($_POST['showExecuting'])) { + $column['showExecuting'] = 'on'; + } + + $retval .= ''; + } + + $retval .= ''; + $retval .= ''; + $retval .= ''; + + while ($process = $GLOBALS['dbi']->fetchAssoc($result)) { + $retval .= self::getHtmlForServerProcessItem( + $process, + $show_full_sql + ); + } + $retval .= ''; + $retval .= '
    ' . __('Processes') . ''; + $columnUrl = Url::getCommon($column, '', false); + $retval .= ''; + + $retval .= $column['column_name']; + + if ($is_sorted) { + $asc_display_style = 'inline'; + $desc_display_style = 'none'; + if ($_POST['sort_order'] === 'DESC') { + $desc_display_style = 'inline'; + $asc_display_style = 'none'; + } + $retval .= ''
+                    . __('Descending') . ''; + $retval .= ''
+                    . __('Ascending') . ''; + } + + $retval .= ''; + + if (0 === --$sortableColCount) { + $url_params = array(); + if ($show_full_sql) { + $url_params['full'] = ''; + } else { + $url_params['full'] = 1; + } + if (isset($_POST['showExecuting'])) { + $url_params['showExecuting'] = 'on'; + } + if (isset($_POST['order_by_field'])) { + $url_params['order_by_field'] = $_POST['order_by_field']; + } + if (isset($_POST['sort_order'])) { + $url_params['sort_order'] = $_POST['sort_order']; + } + $retval .= ''; + if ($show_full_sql) { + $retval .= Util::getImage('s_partialtext', + __('Truncate Shown Queries'), ['class' => 'icon_fulltext']); + } else { + $retval .= Util::getImage('s_fulltext', + __('Show Full Queries'), ['class' => 'icon_fulltext']); + } + $retval .= ''; + } + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } + + /** + * Returns the html for the list filter + * + * @return string + */ + public static function getHtmlForProcessListFilter() + { + $showExecuting = ''; + if (! empty($_POST['showExecuting'])) { + $showExecuting = ' checked="checked"'; + } + + $url_params = array( + 'ajax_request' => true, + 'full' => (isset($_POST['full']) ? $_POST['full'] : ''), + 'column_name' => (isset($_POST['column_name']) ? $_POST['column_name'] : ''), + 'order_by_field' + => (isset($_POST['order_by_field']) ? $_POST['order_by_field'] : ''), + 'sort_order' => (isset($_POST['sort_order']) ? $_POST['sort_order'] : ''), + ); + + $retval = ''; + $retval .= '
    '; + $retval .= '' . __('Filters') . ''; + $retval .= '
    '; + $retval .= Url::getHiddenInputs($url_params); + $retval .= ''; + $retval .= '
    '; + $retval .= ''; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } + + /** + * Prints Every Item of Server Process + * + * @param array $process data of Every Item of Server Process + * @param bool $show_full_sql show full sql or not + * + * @return string + */ + public static function getHtmlForServerProcessItem(array $process, $show_full_sql) + { + // Array keys need to modify due to the way it has used + // to display column values + if ((! empty($_POST['order_by_field']) && ! empty($_POST['sort_order'])) + || (! empty($_POST['showExecuting'])) + ) { + foreach (array_keys($process) as $key) { + $new_key = ucfirst(mb_strtolower($key)); + if ($new_key !== $key) { + $process[$new_key] = $process[$key]; + unset($process[$key]); + } + } + } + + $retval = ''; + $retval .= '' + . __('Kill') . ''; + $retval .= '' . $process['Id'] . ''; + $retval .= '' . htmlspecialchars($process['User']) . ''; + $retval .= '' . htmlspecialchars($process['Host']) . ''; + $retval .= '' . ((! isset($process['db']) + || strlen($process['db']) === 0) + ? '' . __('None') . '' + : htmlspecialchars($process['db'])) . ''; + $retval .= '' . htmlspecialchars($process['Command']) . ''; + $retval .= '' . $process['Time'] . ''; + $processStatusStr = empty($process['State']) ? '---' : $process['State']; + $retval .= '' . $processStatusStr . ''; + $processProgress = empty($process['Progress']) ? '---' : $process['Progress']; + $retval .= '' . $processProgress . ''; + $retval .= ''; + + if (empty($process['Info'])) { + $retval .= '---'; + } else { + $retval .= Util::formatSql($process['Info'], ! $show_full_sql); + } + $retval .= ''; + $retval .= ''; + + return $retval; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Status/Queries.php b/phpMyAdmin/libraries/classes/Server/Status/Queries.php new file mode 100755 index 0000000..948aca4 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Status/Queries.php @@ -0,0 +1,156 @@ +status['Uptime']; + $used_queries = $serverStatusData->used_queries; + $total_queries = array_sum($used_queries); + + $retval .= '

    '; + /* l10n: Questions is the name of a MySQL Status variable */ + $retval .= sprintf( + __('Questions since startup: %s'), + Util::formatNumber($total_queries, 0) + ); + $retval .= ' '; + $retval .= Util::showMySQLDocu( + 'server-status-variables', + false, + 'statvar_Questions' + ); + $retval .= '
    '; + $retval .= ''; + $retval .= 'ø ' . __('per hour:') . ' '; + $retval .= Util::formatNumber($total_queries * $hour_factor, 0); + $retval .= '
    '; + $retval .= 'ø ' . __('per minute:') . ' '; + $retval .= Util::formatNumber( + $total_queries * 60 / $serverStatusData->status['Uptime'], + 0 + ); + $retval .= '
    '; + if ($total_queries / $serverStatusData->status['Uptime'] >= 1) { + $retval .= 'ø ' . __('per second:') . ' '; + $retval .= Util::formatNumber( + $total_queries / $serverStatusData->status['Uptime'], + 0 + ); + } + $retval .= '
    '; + $retval .= '

    '; + + $retval .= self::getHtmlForDetails($serverStatusData); + + return $retval; + } + + /** + * Returns the html content for the query details + * + * @param Data $serverStatusData Server status data + * + * @return string + */ + public static function getHtmlForDetails(Data $serverStatusData) + { + $hour_factor = 3600 / $serverStatusData->status['Uptime']; + $used_queries = $serverStatusData->used_queries; + $total_queries = array_sum($used_queries); + // reverse sort by value to show most used statements first + arsort($used_queries); + + //(- $serverStatusData->status['Connections']); + $perc_factor = 100 / $total_queries; + + $retval = ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + + $chart_json = array(); + $query_sum = array_sum($used_queries); + $other_sum = 0; + foreach ($used_queries as $name => $value) { + // For the percentage column, use Questions - Connections, because + // the number of connections is not an item of the Query types + // but is included in Questions. Then the total of the percentages is 100. + $name = str_replace(array('Com_', '_'), array('', ' '), $name); + // Group together values that make out less than 2% into "Other", but only + // if we have more than 6 fractions already + if ($value < $query_sum * 0.02 && count($chart_json)>6) { + $other_sum += $value; + } else { + $chart_json[$name] = $value; + } + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + } + $retval .= ''; + $retval .= '
    ' . __('Statements') . ''; + /* l10n: # = Amount of queries */ + $retval .= __('#'); + $retval .= 'ø ' . __('per hour') + . '%
    ' . htmlspecialchars($name) . ''; + $retval .= htmlspecialchars( + Util::formatNumber($value, 5, 0, true) + ); + $retval .= ''; + $retval .= htmlspecialchars( + Util::formatNumber($value * $hour_factor, 4, 1, true) + ); + $retval .= ''; + $retval .= htmlspecialchars( + Util::formatNumber($value * $perc_factor, 0, 2) + ); + $retval .= '
    '; + + $retval .= '
    '; + + return $retval; + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Status/Variables.php b/phpMyAdmin/libraries/classes/Server/Status/Variables.php new file mode 100755 index 0000000..2fcdea7 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Status/Variables.php @@ -0,0 +1,776 @@ +'; + $retval .= '' . __('Filters') . ''; + $retval .= '
    '; + $retval .= Url::getHiddenInputs(); + $retval .= ''; + $retval .= '
    '; + $retval .= ''; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= ''; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= ''; + $retval .= ''; + $retval .= '
    '; + $retval .= '
    '; + $retval .= ''; + + return $retval; + } + + /** + * Prints the suggestion links + * + * @param Data $serverStatusData Server status data + * + * @return string + */ + public static function getHtmlForLinkSuggestions(Data $serverStatusData) + { + $retval = ''; + + return $retval; + } + + /** + * Returns a table with variables information + * + * @param Data $serverStatusData Server status data + * + * @return string + */ + public static function getHtmlForVariablesList(Data $serverStatusData) + { + $retval = ''; + $strShowStatus = self::getDescriptions(); + /** + * define some alerts + */ + // name => max value before alert + $alerts = array( + // lower is better + // variable => max value + 'Aborted_clients' => 0, + 'Aborted_connects' => 0, + + 'Binlog_cache_disk_use' => 0, + + 'Created_tmp_disk_tables' => 0, + + 'Handler_read_rnd' => 0, + 'Handler_read_rnd_next' => 0, + + 'Innodb_buffer_pool_pages_dirty' => 0, + 'Innodb_buffer_pool_reads' => 0, + 'Innodb_buffer_pool_wait_free' => 0, + 'Innodb_log_waits' => 0, + 'Innodb_row_lock_time_avg' => 10, // ms + 'Innodb_row_lock_time_max' => 50, // ms + 'Innodb_row_lock_waits' => 0, + + 'Slow_queries' => 0, + 'Delayed_errors' => 0, + 'Select_full_join' => 0, + 'Select_range_check' => 0, + 'Sort_merge_passes' => 0, + 'Opened_tables' => 0, + 'Table_locks_waited' => 0, + 'Qcache_lowmem_prunes' => 0, + + 'Qcache_free_blocks' => + isset($serverStatusData->status['Qcache_total_blocks']) + ? $serverStatusData->status['Qcache_total_blocks'] / 5 + : 0, + 'Slow_launch_threads' => 0, + + // depends on Key_read_requests + // normally lower then 1:0.01 + 'Key_reads' => isset($serverStatusData->status['Key_read_requests']) + ? (0.01 * $serverStatusData->status['Key_read_requests']) : 0, + // depends on Key_write_requests + // normally nearly 1:1 + 'Key_writes' => isset($serverStatusData->status['Key_write_requests']) + ? (0.9 * $serverStatusData->status['Key_write_requests']) : 0, + + 'Key_buffer_fraction' => 0.5, + + // alert if more than 95% of thread cache is in use + 'Threads_cached' => isset($serverStatusData->variables['thread_cache_size']) + ? 0.95 * $serverStatusData->variables['thread_cache_size'] : 0 + + // higher is better + // variable => min value + //'Handler read key' => '> ', + ); + + $retval .= self::getHtmlForRenderVariables( + $serverStatusData, + $alerts, + $strShowStatus + ); + + return $retval; + } + + /** + * Returns HTML for render variables list + * + * @param Data $serverStatusData Server status data + * @param array $alerts Alert Array + * @param array $strShowStatus Status Array + * + * @return string + */ + public static function getHtmlForRenderVariables(Data $serverStatusData, array $alerts, array $strShowStatus) + { + $retval = '
    '; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + $retval .= ''; + + foreach ($serverStatusData->status as $name => $value) { + $retval .= ''; + + $retval .= ''; + + $retval .= ''; + $retval .= ''; + $retval .= ''; + } + $retval .= ''; + $retval .= '
    ' . __('Variable') . '' . __('Value') . '' . __('Description') . '
    '; + $retval .= htmlspecialchars(str_replace('_', ' ', $name)); + // Fields containing % are calculated, + // they can not be described in MySQL documentation + if (mb_strpos($name, '%') === false) { + $retval .= Util::showMySQLDocu( + 'server-status-variables', + false, + 'statvar_' . $name + ); + } + $retval .= ''; + if (isset($alerts[$name])) { + if ($value > $alerts[$name]) { + $retval .= ''; + } else { + $retval .= ''; + } + } + if (substr($name, -1) === '%') { + $retval .= htmlspecialchars( + Util::formatNumber($value, 0, 2) + ) . ' %'; + } elseif (strpos($name, 'Uptime') !== false) { + $retval .= htmlspecialchars( + Util::timespanFormat($value) + ); + } elseif (is_numeric($value) && $value > 1000) { + $retval .= '' + . htmlspecialchars(Util::formatNumber($value, 3, 1)) + . ''; + } elseif (is_numeric($value)) { + $retval .= htmlspecialchars( + Util::formatNumber($value, 3, 1) + ); + } else { + $retval .= htmlspecialchars($value); + } + if (isset($alerts[$name])) { + $retval .= ''; + } + $retval .= ''; + $retval .= ''; + if (isset($alerts[$name])) { + if ($value > $alerts[$name]) { + $retval .= ''; + } else { + $retval .= ''; + } + } + $retval .= htmlspecialchars($value); + if (isset($alerts[$name])) { + $retval .= ''; + } + $retval .= ''; + $retval .= ''; + + if (isset($strShowStatus[$name])) { + $retval .= $strShowStatus[$name]; + } + + if (isset($serverStatusData->links[$name])) { + foreach ($serverStatusData->links[$name] as $link_name => $link_url) { + if ('doc' == $link_name) { + $retval .= Util::showMySQLDocu($link_url); + } else { + $retval .= ' ' + . $link_name . ''; + } + } + unset($link_url, $link_name); + } + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } + + /** + * Returns a list of variable descriptions + * + * @return array + */ + public static function getDescriptions() + { + /** + * Messages are built using the message name + */ + return array( + 'Aborted_clients' => __( + 'The number of connections that were aborted because the client died' + . ' without closing the connection properly.' + ), + 'Aborted_connects' => __( + 'The number of failed attempts to connect to the MySQL server.' + ), + 'Binlog_cache_disk_use' => __( + 'The number of transactions that used the temporary binary log cache' + . ' but that exceeded the value of binlog_cache_size and used a' + . ' temporary file to store statements from the transaction.' + ), + 'Binlog_cache_use' => __( + 'The number of transactions that used the temporary binary log cache.' + ), + 'Connections' => __( + 'The number of connection attempts (successful or not)' + . ' to the MySQL server.' + ), + 'Created_tmp_disk_tables' => __( + 'The number of temporary tables on disk created automatically by' + . ' the server while executing statements. If' + . ' Created_tmp_disk_tables is big, you may want to increase the' + . ' tmp_table_size value to cause temporary tables to be' + . ' memory-based instead of disk-based.' + ), + 'Created_tmp_files' => __( + 'How many temporary files mysqld has created.' + ), + 'Created_tmp_tables' => __( + 'The number of in-memory temporary tables created automatically' + . ' by the server while executing statements.' + ), + 'Delayed_errors' => __( + 'The number of rows written with INSERT DELAYED for which some' + . ' error occurred (probably duplicate key).' + ), + 'Delayed_insert_threads' => __( + 'The number of INSERT DELAYED handler threads in use. Every' + . ' different table on which one uses INSERT DELAYED gets' + . ' its own thread.' + ), + 'Delayed_writes' => __( + 'The number of INSERT DELAYED rows written.' + ), + 'Flush_commands' => __( + 'The number of executed FLUSH statements.' + ), + 'Handler_commit' => __( + 'The number of internal COMMIT statements.' + ), + 'Handler_delete' => __( + 'The number of times a row was deleted from a table.' + ), + 'Handler_discover' => __( + 'The MySQL server can ask the NDB Cluster storage engine if it' + . ' knows about a table with a given name. This is called discovery.' + . ' Handler_discover indicates the number of time tables have been' + . ' discovered.' + ), + 'Handler_read_first' => __( + 'The number of times the first entry was read from an index. If this' + . ' is high, it suggests that the server is doing a lot of full' + . ' index scans; for example, SELECT col1 FROM foo, assuming that' + . ' col1 is indexed.' + ), + 'Handler_read_key' => __( + 'The number of requests to read a row based on a key. If this is' + . ' high, it is a good indication that your queries and tables' + . ' are properly indexed.' + ), + 'Handler_read_next' => __( + 'The number of requests to read the next row in key order. This is' + . ' incremented if you are querying an index column with a range' + . ' constraint or if you are doing an index scan.' + ), + 'Handler_read_prev' => __( + 'The number of requests to read the previous row in key order.' + . ' This read method is mainly used to optimize ORDER BY 鈥� DESC.' + ), + 'Handler_read_rnd' => __( + 'The number of requests to read a row based on a fixed position.' + . ' This is high if you are doing a lot of queries that require' + . ' sorting of the result. You probably have a lot of queries that' + . ' require MySQL to scan whole tables or you have joins that' + . ' don\'t use keys properly.' + ), + 'Handler_read_rnd_next' => __( + 'The number of requests to read the next row in the data file.' + . ' This is high if you are doing a lot of table scans. Generally' + . ' this suggests that your tables are not properly indexed or that' + . ' your queries are not written to take advantage of the indexes' + . ' you have.' + ), + 'Handler_rollback' => __( + 'The number of internal ROLLBACK statements.' + ), + 'Handler_update' => __( + 'The number of requests to update a row in a table.' + ), + 'Handler_write' => __( + 'The number of requests to insert a row in a table.' + ), + 'Innodb_buffer_pool_pages_data' => __( + 'The number of pages containing data (dirty or clean).' + ), + 'Innodb_buffer_pool_pages_dirty' => __( + 'The number of pages currently dirty.' + ), + 'Innodb_buffer_pool_pages_flushed' => __( + 'The number of buffer pool pages that have been requested' + . ' to be flushed.' + ), + 'Innodb_buffer_pool_pages_free' => __( + 'The number of free pages.' + ), + 'Innodb_buffer_pool_pages_latched' => __( + 'The number of latched pages in InnoDB buffer pool. These are pages' + . ' currently being read or written or that can\'t be flushed or' + . ' removed for some other reason.' + ), + 'Innodb_buffer_pool_pages_misc' => __( + 'The number of pages busy because they have been allocated for' + . ' administrative overhead such as row locks or the adaptive' + . ' hash index. This value can also be calculated as' + . ' Innodb_buffer_pool_pages_total - Innodb_buffer_pool_pages_free' + . ' - Innodb_buffer_pool_pages_data.' + ), + 'Innodb_buffer_pool_pages_total' => __( + 'Total size of buffer pool, in pages.' + ), + 'Innodb_buffer_pool_read_ahead_rnd' => __( + 'The number of "random" read-aheads InnoDB initiated. This happens' + . ' when a query is to scan a large portion of a table but in' + . ' random order.' + ), + 'Innodb_buffer_pool_read_ahead_seq' => __( + 'The number of sequential read-aheads InnoDB initiated. This' + . ' happens when InnoDB does a sequential full table scan.' + ), + 'Innodb_buffer_pool_read_requests' => __( + 'The number of logical read requests InnoDB has done.' + ), + 'Innodb_buffer_pool_reads' => __( + 'The number of logical reads that InnoDB could not satisfy' + . ' from buffer pool and had to do a single-page read.' + ), + 'Innodb_buffer_pool_wait_free' => __( + 'Normally, writes to the InnoDB buffer pool happen in the' + . ' background. However, if it\'s necessary to read or create a page' + . ' and no clean pages are available, it\'s necessary to wait for' + . ' pages to be flushed first. This counter counts instances of' + . ' these waits. If the buffer pool size was set properly, this' + . ' value should be small.' + ), + 'Innodb_buffer_pool_write_requests' => __( + 'The number writes done to the InnoDB buffer pool.' + ), + 'Innodb_data_fsyncs' => __( + 'The number of fsync() operations so far.' + ), + 'Innodb_data_pending_fsyncs' => __( + 'The current number of pending fsync() operations.' + ), + 'Innodb_data_pending_reads' => __( + 'The current number of pending reads.' + ), + 'Innodb_data_pending_writes' => __( + 'The current number of pending writes.' + ), + 'Innodb_data_read' => __( + 'The amount of data read so far, in bytes.' + ), + 'Innodb_data_reads' => __( + 'The total number of data reads.' + ), + 'Innodb_data_writes' => __( + 'The total number of data writes.' + ), + 'Innodb_data_written' => __( + 'The amount of data written so far, in bytes.' + ), + 'Innodb_dblwr_pages_written' => __( + 'The number of pages that have been written for' + . ' doublewrite operations.' + ), + 'Innodb_dblwr_writes' => __( + 'The number of doublewrite operations that have been performed.' + ), + 'Innodb_log_waits' => __( + 'The number of waits we had because log buffer was too small and' + . ' we had to wait for it to be flushed before continuing.' + ), + 'Innodb_log_write_requests' => __( + 'The number of log write requests.' + ), + 'Innodb_log_writes' => __( + 'The number of physical writes to the log file.' + ), + 'Innodb_os_log_fsyncs' => __( + 'The number of fsync() writes done to the log file.' + ), + 'Innodb_os_log_pending_fsyncs' => __( + 'The number of pending log file fsyncs.' + ), + 'Innodb_os_log_pending_writes' => __( + 'Pending log file writes.' + ), + 'Innodb_os_log_written' => __( + 'The number of bytes written to the log file.' + ), + 'Innodb_pages_created' => __( + 'The number of pages created.' + ), + 'Innodb_page_size' => __( + 'The compiled-in InnoDB page size (default 16KB). Many values are' + . ' counted in pages; the page size allows them to be easily' + . ' converted to bytes.' + ), + 'Innodb_pages_read' => __( + 'The number of pages read.' + ), + 'Innodb_pages_written' => __( + 'The number of pages written.' + ), + 'Innodb_row_lock_current_waits' => __( + 'The number of row locks currently being waited for.' + ), + 'Innodb_row_lock_time_avg' => __( + 'The average time to acquire a row lock, in milliseconds.' + ), + 'Innodb_row_lock_time' => __( + 'The total time spent in acquiring row locks, in milliseconds.' + ), + 'Innodb_row_lock_time_max' => __( + 'The maximum time to acquire a row lock, in milliseconds.' + ), + 'Innodb_row_lock_waits' => __( + 'The number of times a row lock had to be waited for.' + ), + 'Innodb_rows_deleted' => __( + 'The number of rows deleted from InnoDB tables.' + ), + 'Innodb_rows_inserted' => __( + 'The number of rows inserted in InnoDB tables.' + ), + 'Innodb_rows_read' => __( + 'The number of rows read from InnoDB tables.' + ), + 'Innodb_rows_updated' => __( + 'The number of rows updated in InnoDB tables.' + ), + 'Key_blocks_not_flushed' => __( + 'The number of key blocks in the key cache that have changed but' + . ' haven\'t yet been flushed to disk. It used to be known as' + . ' Not_flushed_key_blocks.' + ), + 'Key_blocks_unused' => __( + 'The number of unused blocks in the key cache. You can use this' + . ' value to determine how much of the key cache is in use.' + ), + 'Key_blocks_used' => __( + 'The number of used blocks in the key cache. This value is a' + . ' high-water mark that indicates the maximum number of blocks' + . ' that have ever been in use at one time.' + ), + 'Key_buffer_fraction_%' => __( + 'Percentage of used key cache (calculated value)' + ), + 'Key_read_requests' => __( + 'The number of requests to read a key block from the cache.' + ), + 'Key_reads' => __( + 'The number of physical reads of a key block from disk. If Key_reads' + . ' is big, then your key_buffer_size value is probably too small.' + . ' The cache miss rate can be calculated as' + . ' Key_reads/Key_read_requests.' + ), + 'Key_read_ratio_%' => __( + 'Key cache miss calculated as rate of physical reads compared' + . ' to read requests (calculated value)' + ), + 'Key_write_requests' => __( + 'The number of requests to write a key block to the cache.' + ), + 'Key_writes' => __( + 'The number of physical writes of a key block to disk.' + ), + 'Key_write_ratio_%' => __( + 'Percentage of physical writes compared' + . ' to write requests (calculated value)' + ), + 'Last_query_cost' => __( + 'The total cost of the last compiled query as computed by the query' + . ' optimizer. Useful for comparing the cost of different query' + . ' plans for the same query. The default value of 0 means that' + . ' no query has been compiled yet.' + ), + 'Max_used_connections' => __( + 'The maximum number of connections that have been in use' + . ' simultaneously since the server started.' + ), + 'Not_flushed_delayed_rows' => __( + 'The number of rows waiting to be written in INSERT DELAYED queues.' + ), + 'Opened_tables' => __( + 'The number of tables that have been opened. If opened tables is' + . ' big, your table cache value is probably too small.' + ), + 'Open_files' => __( + 'The number of files that are open.' + ), + 'Open_streams' => __( + 'The number of streams that are open (used mainly for logging).' + ), + 'Open_tables' => __( + 'The number of tables that are open.' + ), + 'Qcache_free_blocks' => __( + 'The number of free memory blocks in query cache. High numbers can' + . ' indicate fragmentation issues, which may be solved by issuing' + . ' a FLUSH QUERY CACHE statement.' + ), + 'Qcache_free_memory' => __( + 'The amount of free memory for query cache.' + ), + 'Qcache_hits' => __( + 'The number of cache hits.' + ), + 'Qcache_inserts' => __( + 'The number of queries added to the cache.' + ), + 'Qcache_lowmem_prunes' => __( + 'The number of queries that have been removed from the cache to' + . ' free up memory for caching new queries. This information can' + . ' help you tune the query cache size. The query cache uses a' + . ' least recently used (LRU) strategy to decide which queries' + . ' to remove from the cache.' + ), + 'Qcache_not_cached' => __( + 'The number of non-cached queries (not cachable, or not cached' + . ' due to the query_cache_type setting).' + ), + 'Qcache_queries_in_cache' => __( + 'The number of queries registered in the cache.' + ), + 'Qcache_total_blocks' => __( + 'The total number of blocks in the query cache.' + ), + 'Rpl_status' => __( + 'The status of failsafe replication (not yet implemented).' + ), + 'Select_full_join' => __( + 'The number of joins that do not use indexes. If this value is' + . ' not 0, you should carefully check the indexes of your tables.' + ), + 'Select_full_range_join' => __( + 'The number of joins that used a range search on a reference table.' + ), + 'Select_range_check' => __( + 'The number of joins without keys that check for key usage after' + . ' each row. (If this is not 0, you should carefully check the' + . ' indexes of your tables.)' + ), + 'Select_range' => __( + 'The number of joins that used ranges on the first table. (It\'s' + . ' normally not critical even if this is big.)' + ), + 'Select_scan' => __( + 'The number of joins that did a full scan of the first table.' + ), + 'Slave_open_temp_tables' => __( + 'The number of temporary tables currently' + . ' open by the slave SQL thread.' + ), + 'Slave_retried_transactions' => __( + 'Total (since startup) number of times the replication slave SQL' + . ' thread has retried transactions.' + ), + 'Slave_running' => __( + 'This is ON if this server is a slave that is connected to a master.' + ), + 'Slow_launch_threads' => __( + 'The number of threads that have taken more than slow_launch_time' + . ' seconds to create.' + ), + 'Slow_queries' => __( + 'The number of queries that have taken more than long_query_time' + . ' seconds.' + ), + 'Sort_merge_passes' => __( + 'The number of merge passes the sort algorithm has had to do.' + . ' If this value is large, you should consider increasing the' + . ' value of the sort_buffer_size system variable.' + ), + 'Sort_range' => __( + 'The number of sorts that were done with ranges.' + ), + 'Sort_rows' => __( + 'The number of sorted rows.' + ), + 'Sort_scan' => __( + 'The number of sorts that were done by scanning the table.' + ), + 'Table_locks_immediate' => __( + 'The number of times that a table lock was acquired immediately.' + ), + 'Table_locks_waited' => __( + 'The number of times that a table lock could not be acquired' + . ' immediately and a wait was needed. If this is high, and you have' + . ' performance problems, you should first optimize your queries,' + . ' and then either split your table or tables or use replication.' + ), + 'Threads_cached' => __( + 'The number of threads in the thread cache. The cache hit rate can' + . ' be calculated as Threads_created/Connections. If this value is' + . ' red you should raise your thread_cache_size.' + ), + 'Threads_connected' => __( + 'The number of currently open connections.' + ), + 'Threads_created' => __( + 'The number of threads created to handle connections. If' + . ' Threads_created is big, you may want to increase the' + . ' thread_cache_size value. (Normally this doesn\'t give a notable' + . ' performance improvement if you have a good thread' + . ' implementation.)' + ), + 'Threads_cache_hitrate_%' => __( + 'Thread cache hit rate (calculated value)' + ), + 'Threads_running' => __( + 'The number of threads that are not sleeping.' + ) + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Server/UserGroups.php b/phpMyAdmin/libraries/classes/Server/UserGroups.php new file mode 100755 index 0000000..35ecac2 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/UserGroups.php @@ -0,0 +1,379 @@ +' + . sprintf(__('Users of \'%s\' user group'), htmlspecialchars($userGroup)) + . ''; + + $cfgRelation = $relation->getRelationsParam(); + $usersTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['users']); + $sql_query = "SELECT `username` FROM " . $usersTable + . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) + . "'"; + $result = $relation->queryAsControlUser($sql_query, false); + if ($result) { + if ($GLOBALS['dbi']->numRows($result) == 0) { + $html_output .= '

    ' + . __('No users were found belonging to this user group.') + . '

    '; + } else { + $html_output .= '' + . '' + . ''; + $i = 0; + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $i++; + $html_output .= '' + . '' + . '' + . ''; + } + $html_output .= '' + . '
    #' . __('User') . '
    ' . $i . ' ' . htmlspecialchars($row[0]) . '
    '; + } + } + $GLOBALS['dbi']->freeResult($result); + return $html_output; + } + + /** + * Returns HTML for the 'user groups' table + * + * @return string HTML for the 'user groups' table + */ + public static function getHtmlForUserGroupsTable() + { + $relation = new Relation(); + $html_output = '

    ' . __('User groups') . '

    '; + $cfgRelation = $relation->getRelationsParam(); + $groupTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['usergroups']); + $sql_query = "SELECT * FROM " . $groupTable . " ORDER BY `usergroup` ASC"; + $result = $relation->queryAsControlUser($sql_query, false); + + if ($result && $GLOBALS['dbi']->numRows($result)) { + $html_output .= '
    '; + $html_output .= Url::getHiddenInputs(); + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + + $userGroups = array(); + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $groupName = $row['usergroup']; + if (! isset($userGroups[$groupName])) { + $userGroups[$groupName] = array(); + } + $userGroups[$groupName][$row['tab']] = $row['allowed']; + } + foreach ($userGroups as $groupName => $tabs) { + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + $html_output .= ''; + + $html_output .= ''; + + $html_output .= ''; + } + + $html_output .= ''; + $html_output .= '
    ' + . __('User group') . '' . __('Server level tabs') . '' . __('Database level tabs') . '' . __('Table level tabs') . '' . __('Action') . '
    ' . htmlspecialchars($groupName) . '' . self::getAllowedTabNames($tabs, 'server') . '' . self::getAllowedTabNames($tabs, 'db') . '' . self::getAllowedTabNames($tabs, 'table') . ''; + $html_output .= '' + . Util::getIcon('b_usrlist', __('View users')) + . ''; + $html_output .= '  '; + $html_output .= '' + . Util::getIcon('b_edit', __('Edit')) . ''; + $html_output .= '  '; + $html_output .= '' + . Util::getIcon('b_drop', __('Delete')) . ''; + $html_output .= '
    '; + $html_output .= '
    '; + } + $GLOBALS['dbi']->freeResult($result); + + $html_output .= '
    '; + $html_output .= '' + . Util::getIcon('b_usradd') + . __('Add user group') . ''; + $html_output .= '
    '; + + return $html_output; + } + + /** + * Returns the list of allowed menu tab names + * based on a data row from usergroup table. + * + * @param array $row row of usergroup table + * @param string $level 'server', 'db' or 'table' + * + * @return string comma separated list of allowed menu tab names + */ + public static function getAllowedTabNames(array $row, $level) + { + $tabNames = array(); + $tabs = Util::getMenuTabList($level); + foreach ($tabs as $tab => $tabName) { + if (! isset($row[$level . '_' . $tab]) + || $row[$level . '_' . $tab] == 'Y' + ) { + $tabNames[] = $tabName; + } + } + return implode(', ', $tabNames); + } + + /** + * Deletes a user group + * + * @param string $userGroup user group name + * + * @return void + */ + public static function delete($userGroup) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + $userTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['users']); + $groupTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['usergroups']); + $sql_query = "DELETE FROM " . $userTable + . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) + . "'"; + $relation->queryAsControlUser($sql_query, true); + $sql_query = "DELETE FROM " . $groupTable + . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) + . "'"; + $relation->queryAsControlUser($sql_query, true); + } + + /** + * Returns HTML for add/edit user group dialog + * + * @param string $userGroup name of the user group in case of editing + * + * @return string HTML for add/edit user group dialog + */ + public static function getHtmlToEditUserGroup($userGroup = null) + { + $relation = new Relation(); + $html_output = ''; + if ($userGroup == null) { + $html_output .= '

    ' . __('Add user group') . '

    '; + } else { + $html_output .= '

    ' + . sprintf(__('Edit user group: \'%s\''), htmlspecialchars($userGroup)) + . '

    '; + } + + $html_output .= '
    '; + $urlParams = array(); + if ($userGroup != null) { + $urlParams['userGroup'] = $userGroup; + $urlParams['editUserGroupSubmit'] = '1'; + } else { + $urlParams['addUserGroupSubmit'] = '1'; + } + $html_output .= Url::getHiddenInputs($urlParams); + + $html_output .= '
    '; + $html_output .= '' . __('User group menu assignments') + . '   ' + . '' + . '' + . ''; + + if ($userGroup == null) { + $html_output .= ''; + $html_output .= ''; + $html_output .= '
    '; + } + + $allowedTabs = array( + 'server' => array(), + 'db' => array(), + 'table' => array() + ); + if ($userGroup != null) { + $cfgRelation = $relation->getRelationsParam(); + $groupTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['usergroups']); + $sql_query = "SELECT * FROM " . $groupTable + . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) + . "'"; + $result = $relation->queryAsControlUser($sql_query, false); + if ($result) { + while ($row = $GLOBALS['dbi']->fetchAssoc($result)) { + $key = $row['tab']; + $value = $row['allowed']; + if (substr($key, 0, 7) == 'server_' && $value == 'Y') { + $allowedTabs['server'][] = mb_substr($key, 7); + } elseif (substr($key, 0, 3) == 'db_' && $value == 'Y') { + $allowedTabs['db'][] = mb_substr($key, 3); + } elseif (substr($key, 0, 6) == 'table_' + && $value == 'Y' + ) { + $allowedTabs['table'][] = mb_substr($key, 6); + } + } + } + $GLOBALS['dbi']->freeResult($result); + } + + $html_output .= self::getTabList( + __('Server-level tabs'), 'server', $allowedTabs['server'] + ); + $html_output .= self::getTabList( + __('Database-level tabs'), 'db', $allowedTabs['db'] + ); + $html_output .= self::getTabList( + __('Table-level tabs'), 'table', $allowedTabs['table'] + ); + + $html_output .= '
    '; + + $html_output .= ''; + + return $html_output; + } + + /** + * Returns HTML for checkbox groups to choose + * tabs of 'server', 'db' or 'table' levels. + * + * @param string $title title of the checkbox group + * @param string $level 'server', 'db' or 'table' + * @param array $selected array of selected allowed tabs + * + * @return string HTML for checkbox groups + */ + public static function getTabList($title, $level, array $selected) + { + $tabs = Util::getMenuTabList($level); + $html_output = '
    '; + $html_output .= '' . $title . ''; + foreach ($tabs as $tab => $tabName) { + $html_output .= '
    '; + $html_output .= ''; + $html_output .= ''; + $html_output .= '
    '; + } + $html_output .= '
    '; + return $html_output; + } + + /** + * Add/update a user group with allowed menu tabs. + * + * @param string $userGroup user group name + * @param boolean $new whether this is a new user group + * + * @return void + */ + public static function edit($userGroup, $new = false) + { + $relation = new Relation(); + $tabs = Util::getMenuTabList(); + $cfgRelation = $relation->getRelationsParam(); + $groupTable = Util::backquote($cfgRelation['db']) + . "." . Util::backquote($cfgRelation['usergroups']); + + if (! $new) { + $sql_query = "DELETE FROM " . $groupTable + . " WHERE `usergroup`='" . $GLOBALS['dbi']->escapeString($userGroup) + . "';"; + $relation->queryAsControlUser($sql_query, true); + } + + $sql_query = "INSERT INTO " . $groupTable + . "(`usergroup`, `tab`, `allowed`)" + . " VALUES "; + $first = true; + foreach ($tabs as $tabGroupName => $tabGroup) { + foreach ($tabGroup as $tab => $tabName) { + if (! $first) { + $sql_query .= ", "; + } + $tabName = $tabGroupName . '_' . $tab; + $allowed = isset($_POST[$tabName]) && $_POST[$tabName] == 'Y'; + $sql_query .= "('" . $GLOBALS['dbi']->escapeString($userGroup) . "', '" . $tabName . "', '" + . ($allowed ? "Y" : "N") . "')"; + $first = false; + } + } + $sql_query .= ";"; + $relation->queryAsControlUser($sql_query, true); + } +} diff --git a/phpMyAdmin/libraries/classes/Server/Users.php b/phpMyAdmin/libraries/classes/Server/Users.php new file mode 100755 index 0000000..bd50589 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Server/Users.php @@ -0,0 +1,62 @@ + __('User accounts overview'), + 'url' => 'server_privileges.php', + 'params' => Url::getCommon(array('viewing_mode' => 'server')), + ) + ); + + if ($GLOBALS['dbi']->isSuperuser()) { + $items[] = array( + 'name' => __('User groups'), + 'url' => 'server_user_groups.php', + 'params' => Url::getCommon(), + ); + } + + $retval = '
      '; + foreach ($items as $item) { + $class = ''; + if ($item['url'] === $selfUrl) { + $class = ' class="tabactive"'; + } + $retval .= '
    • '; + $retval .= ''; + $retval .= $item['name']; + $retval .= ''; + $retval .= '
    • '; + } + $retval .= '
    '; + $retval .= '
    '; + + return $retval; + } +} diff --git a/phpMyAdmin/libraries/classes/Session.php b/phpMyAdmin/libraries/classes/Session.php new file mode 100755 index 0000000..df66a28 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Session.php @@ -0,0 +1,236 @@ +getMessage()) + ); + } + + /* + * Session initialization is done before selecting language, so we + * can not use translations here. + */ + Core::fatalError( + 'Error during session start; please check your PHP and/or ' + . 'webserver log file and configure your PHP ' + . 'installation properly. Also ensure that cookies are enabled ' + . 'in your browser.' + . '

    ' + . implode('

    ', $messages) + ); + } + + /** + * Set up session + * + * @param PhpMyAdmin\Config $config Configuration handler + * @param PhpMyAdmin\ErrorHandler $errorHandler Error handler + * @return void + */ + public static function setUp(Config $config, ErrorHandler $errorHandler) + { + // verify if PHP supports session, die if it does not + if (!function_exists('session_name')) { + Core::warnMissingExtension('session', true); + } elseif (! empty(ini_get('session.auto_start')) + && session_name() != 'phpMyAdmin' + && !empty(session_id())) { + // Do not delete the existing non empty session, it might be used by + // other applications; instead just close it. + if (empty($_SESSION)) { + // Ignore errors as this might have been destroyed in other + // request meanwhile + @session_destroy(); + } elseif (function_exists('session_abort')) { + // PHP 5.6 and newer + session_abort(); + } else { + session_write_close(); + } + } + + // session cookie settings + session_set_cookie_params( + 0, $config->getRootPath(), + '', $config->isHttps(), true + ); + + // cookies are safer (use ini_set() in case this function is disabled) + ini_set('session.use_cookies', 'true'); + + // optionally set session_save_path + $path = $config->get('SessionSavePath'); + if (!empty($path)) { + session_save_path($path); + // We can not do this unconditionally as this would break + // any more complex setup (eg. cluster), see + // https://github.com/phpmyadmin/phpmyadmin/issues/8346 + ini_set('session.save_handler', 'files'); + } + + // use cookies only + ini_set('session.use_only_cookies', '1'); + // strict session mode (do not accept random string as session ID) + ini_set('session.use_strict_mode', '1'); + // make the session cookie HttpOnly + ini_set('session.cookie_httponly', '1'); + // do not force transparent session ids + ini_set('session.use_trans_sid', '0'); + + // delete session/cookies when browser is closed + ini_set('session.cookie_lifetime', '0'); + + // warn but don't work with bug + ini_set('session.bug_compat_42', 'false'); + ini_set('session.bug_compat_warn', 'true'); + + // use more secure session ids + ini_set('session.hash_function', '1'); + + // some pages (e.g. stylesheet) may be cached on clients, but not in shared + // proxy servers + session_cache_limiter('private'); + + $httpCookieName = $config->getCookieName('phpMyAdmin'); + @session_name($httpCookieName); + + // Restore correct sesion ID (it might have been reset by auto started session + if ($config->issetCookie('phpMyAdmin')) { + session_id($config->getCookie('phpMyAdmin')); + } + + // on first start of session we check for errors + // f.e. session dir cannot be accessed - session file not created + $orig_error_count = $errorHandler->countErrors(false); + + $session_result = session_start(); + + if ($session_result !== true + || $orig_error_count != $errorHandler->countErrors(false) + ) { + setcookie($httpCookieName, '', 1); + $errors = $errorHandler->sliceErrors($orig_error_count); + self::sessionFailed($errors); + } + unset($orig_error_count, $session_result); + + /** + * Disable setting of session cookies for further session_start() calls. + */ + if(session_status() !== PHP_SESSION_ACTIVE) { + ini_set('session.use_cookies', 'true'); + } + + /** + * Token which is used for authenticating access queries. + * (we use "space PMA_token space" to prevent overwriting) + */ + if (empty($_SESSION[' PMA_token '])) { + self::generateToken(); + + /** + * Check for disk space on session storage by trying to write it. + * + * This seems to be most reliable approach to test if sessions are working, + * otherwise the check would fail with custom session backends. + */ + $orig_error_count = $errorHandler->countErrors(); + session_write_close(); + if ($errorHandler->countErrors() > $orig_error_count) { + $errors = $errorHandler->sliceErrors($orig_error_count); + self::sessionFailed($errors); + } + session_start(); + if (empty($_SESSION[' PMA_token '])) { + Core::fatalError( + 'Failed to store CSRF token in session! ' . + 'Probably sessions are not working properly.' + ); + } + } + } +} diff --git a/phpMyAdmin/libraries/classes/Sql.php b/phpMyAdmin/libraries/classes/Sql.php new file mode 100755 index 0000000..e7e6619 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Sql.php @@ -0,0 +1,2338 @@ +relation = new Relation(); + } + + /** + * Parses and analyzes the given SQL query. + * + * @param string $sql_query SQL query + * @param string $db DB name + * + * @return mixed + */ + public function parseAndAnalyze($sql_query, $db = null) + { + if (is_null($db) && isset($GLOBALS['db']) && strlen($GLOBALS['db'])) { + $db = $GLOBALS['db']; + } + list($analyzed_sql_results,,) = ParseAnalyze::sqlQuery($sql_query, $db); + return $analyzed_sql_results; + } + + /** + * Handle remembered sorting order, only for single table query + * + * @param string $db database name + * @param string $table table name + * @param array &$analyzed_sql_results the analyzed query results + * @param string &$full_sql_query SQL query + * + * @return void + */ + private function handleSortOrder( + $db, $table, array &$analyzed_sql_results, &$full_sql_query + ) { + $pmatable = new Table($table, $db); + + if (empty($analyzed_sql_results['order'])) { + + // Retrieving the name of the column we should sort after. + $sortCol = $pmatable->getUiProp(Table::PROP_SORTED_COLUMN); + if (empty($sortCol)) { + return; + } + + // Remove the name of the table from the retrieved field name. + $sortCol = str_replace( + Util::backquote($table) . '.', + '', + $sortCol + ); + + // Create the new query. + $full_sql_query = Query::replaceClause( + $analyzed_sql_results['statement'], + $analyzed_sql_results['parser']->list, + 'ORDER BY ' . $sortCol + ); + + // TODO: Avoid reparsing the query. + $analyzed_sql_results = Query::getAll($full_sql_query); + } else { + // Store the remembered table into session. + $pmatable->setUiProp( + Table::PROP_SORTED_COLUMN, + Query::getClause( + $analyzed_sql_results['statement'], + $analyzed_sql_results['parser']->list, + 'ORDER BY' + ) + ); + } + } + + /** + * Append limit clause to SQL query + * + * @param array &$analyzed_sql_results the analyzed query results + * + * @return string limit clause appended SQL query + */ + private function getSqlWithLimitClause(array &$analyzed_sql_results) + { + return Query::replaceClause( + $analyzed_sql_results['statement'], + $analyzed_sql_results['parser']->list, + 'LIMIT ' . $_SESSION['tmpval']['pos'] . ', ' + . $_SESSION['tmpval']['max_rows'] + ); + } + + /** + * Verify whether the result set has columns from just one table + * + * @param array $fields_meta meta fields + * + * @return boolean whether the result set has columns from just one table + */ + private function resultSetHasJustOneTable(array $fields_meta) + { + $just_one_table = true; + $prev_table = ''; + foreach ($fields_meta as $one_field_meta) { + if ($one_field_meta->table != '' + && $prev_table != '' + && $one_field_meta->table != $prev_table + ) { + $just_one_table = false; + } + if ($one_field_meta->table != '') { + $prev_table = $one_field_meta->table; + } + } + return $just_one_table && $prev_table != ''; + } + + /** + * Verify whether the result set contains all the columns + * of at least one unique key + * + * @param string $db database name + * @param string $table table name + * @param array $fields_meta meta fields + * + * @return boolean whether the result set contains a unique key + */ + private function resultSetContainsUniqueKey($db, $table, array $fields_meta) + { + $columns = $GLOBALS['dbi']->getColumns($db, $table); + $resultSetColumnNames = array(); + foreach ($fields_meta as $oneMeta) { + $resultSetColumnNames[] = $oneMeta->name; + } + foreach (Index::getFromTable($table, $db) as $index) { + if ($index->isUnique()) { + $indexColumns = $index->getColumns(); + $numberFound = 0; + foreach ($indexColumns as $indexColumnName => $dummy) { + if (in_array($indexColumnName, $resultSetColumnNames)) { + $numberFound++; + } else if (!in_array($indexColumnName, $columns)) { + $numberFound++; + } else if (strpos($columns[$indexColumnName]['Extra'], 'INVISIBLE') !== false) { + $numberFound++; + } + } + if ($numberFound == count($indexColumns)) { + return true; + } + } + } + return false; + } + + /** + * Get the HTML for relational column dropdown + * During grid edit, if we have a relational field, returns the html for the + * dropdown + * + * @param string $db current database + * @param string $table current table + * @param string $column current column + * @param string $curr_value current selected value + * + * @return string $dropdown html for the dropdown + */ + private function getHtmlForRelationalColumnDropdown($db, $table, $column, $curr_value) + { + $foreigners = $this->relation->getForeigners($db, $table, $column); + + $foreignData = $this->relation->getForeignData($foreigners, $column, false, '', ''); + + if ($foreignData['disp_row'] == null) { + //Handle the case when number of values + //is more than $cfg['ForeignKeyMaxLimit'] + $_url_params = array( + 'db' => $db, + 'table' => $table, + 'field' => $column + ); + + $dropdown = '' + . htmlspecialchars($_POST['curr_value']) + . '' + . '' + . __('Browse foreign values') + . ''; + } else { + $dropdown = $this->relation->foreignDropdown( + $foreignData['disp_row'], + $foreignData['foreign_field'], + $foreignData['foreign_display'], + $curr_value, + $GLOBALS['cfg']['ForeignKeyMaxLimit'] + ); + $dropdown = ''; + } + + return $dropdown; + } + + /** + * Get the HTML for the profiling table and accompanying chart if profiling is set. + * Otherwise returns null + * + * @param string $url_query url query + * @param string $db current database + * @param array $profiling_results array containing the profiling info + * + * @return string $profiling_table html for the profiling table and chart + */ + private function getHtmlForProfilingChart($url_query, $db, $profiling_results) + { + if (! empty($profiling_results)) { + $url_query = isset($url_query) + ? $url_query + : Url::getCommon(array('db' => $db)); + + $profiling_table = ''; + $profiling_table .= '
    ' . __('Profiling') + . '' . "\n"; + $profiling_table .= '
    '; + $profiling_table .= '

    ' . __('Detailed profile') . '

    '; + $profiling_table .= '' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + list($detailed_table, $chart_json, $profiling_stats) + = $this->analyzeAndGetTableHtmlForProfilingResults($profiling_results); + $profiling_table .= $detailed_table; + $profiling_table .= '
    ' . __('Order') + . '
    ' . __('State') + . Util::showMySQLDocu('general-thread-states') + . '
    ' . __('Time') + . '
    ' . "\n"; + $profiling_table .= '
    '; + + $profiling_table .= '
    '; + $profiling_table .= '

    ' . __('Summary by state') . '

    '; + $profiling_table .= '' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= ' ' . "\n"; + $profiling_table .= $this->getTableHtmlForProfilingSummaryByState( + $profiling_stats + ); + $profiling_table .= '
    ' . __('State') + . Util::showMySQLDocu('general-thread-states') + . '
    ' . __('Total Time') + . '
    ' . __('% Time') + . '
    ' . __('Calls') + . '
    ' . __('酶 Time') + . '
    ' . "\n"; + + $profiling_table .= << + url_query = '$url_query'; + +EOT; + $profiling_table .= "
    "; + $profiling_table .= "
    "; + + //require_once 'libraries/chart.lib.php'; + $profiling_table .= '
    '; + $profiling_table .= json_encode($chart_json); + $profiling_table .= '
    '; + $profiling_table .= '
    '; + $profiling_table .= '
    '; + $profiling_table .= ''; + $profiling_table .= '
    ' . "\n"; + } else { + $profiling_table = null; + } + return $profiling_table; + } + + /** + * Function to get HTML for detailed profiling results table, profiling stats, and + * $chart_json for displaying the chart. + * + * @param array $profiling_results profiling results + * + * @return mixed + */ + private function analyzeAndGetTableHtmlForProfilingResults( + $profiling_results + ) { + $profiling_stats = array( + 'total_time' => 0, + 'states' => array(), + ); + $chart_json = Array(); + $i = 1; + $table = ''; + foreach ($profiling_results as $one_result) { + if (isset($profiling_stats['states'][ucwords($one_result['Status'])])) { + $states = $profiling_stats['states']; + $states[ucwords($one_result['Status'])]['total_time'] + += $one_result['Duration']; + $states[ucwords($one_result['Status'])]['calls']++; + } else { + $profiling_stats['states'][ucwords($one_result['Status'])] = array( + 'total_time' => $one_result['Duration'], + 'calls' => 1, + ); + } + $profiling_stats['total_time'] += $one_result['Duration']; + + $table .= ' ' . "\n"; + $table .= '' . $i++ . '' . "\n"; + $table .= '' . ucwords($one_result['Status']) + . '' . "\n"; + $table .= '' + . (Util::formatNumber($one_result['Duration'], 3, 1)) + . 's' + . $one_result['Duration'] . '' . "\n"; + if (isset($chart_json[ucwords($one_result['Status'])])) { + $chart_json[ucwords($one_result['Status'])] + += $one_result['Duration']; + } else { + $chart_json[ucwords($one_result['Status'])] + = $one_result['Duration']; + } + } + return array($table, $chart_json, $profiling_stats); + } + + /** + * Function to get HTML for summary by state table + * + * @param array $profiling_stats profiling stats + * + * @return string $table html for the table + */ + private function getTableHtmlForProfilingSummaryByState(array $profiling_stats) + { + $table = ''; + foreach ($profiling_stats['states'] as $name => $stats) { + $table .= ' ' . "\n"; + $table .= '' . $name . '' . "\n"; + $table .= '' + . Util::formatNumber($stats['total_time'], 3, 1) + . 's' + . $stats['total_time'] . '' . "\n"; + $table .= '' + . Util::formatNumber( + 100 * ($stats['total_time'] / $profiling_stats['total_time']), + 0, 2 + ) + . '%' . "\n"; + $table .= '' . $stats['calls'] . '' + . "\n"; + $table .= '' + . Util::formatNumber( + $stats['total_time'] / $stats['calls'], 3, 1 + ) + . 's' + . number_format($stats['total_time'] / $stats['calls'], 8, '.', '') + . '' . "\n"; + $table .= ' ' . "\n"; + } + return $table; + } + + /** + * Get the HTML for the enum column dropdown + * During grid edit, if we have a enum field, returns the html for the + * dropdown + * + * @param string $db current database + * @param string $table current table + * @param string $column current column + * @param string $curr_value currently selected value + * + * @return string $dropdown html for the dropdown + */ + private function getHtmlForEnumColumnDropdown($db, $table, $column, $curr_value) + { + $values = $this->getValuesForColumn($db, $table, $column); + $dropdown = ''; + $dropdown .= $this->getHtmlForOptionsList($values, array($curr_value)); + $dropdown = ''; + return $dropdown; + } + + /** + * Get value of a column for a specific row (marked by $where_clause) + * + * @param string $db current database + * @param string $table current table + * @param string $column current column + * @param string $where_clause where clause to select a particular row + * + * @return string with value + */ + private function getFullValuesForSetColumn($db, $table, $column, $where_clause) + { + $result = $GLOBALS['dbi']->fetchSingleRow( + "SELECT `$column` FROM `$db`.`$table` WHERE $where_clause" + ); + + return $result[$column]; + } + + /** + * Get the HTML for the set column dropdown + * During grid edit, if we have a set field, returns the html for the + * dropdown + * + * @param string $db current database + * @param string $table current table + * @param string $column current column + * @param string $curr_value currently selected value + * + * @return string $dropdown html for the set column + */ + private function getHtmlForSetColumn($db, $table, $column, $curr_value) + { + $values = $this->getValuesForColumn($db, $table, $column); + $dropdown = ''; + $full_values = + isset($_POST['get_full_values']) ? $_POST['get_full_values'] : false; + $where_clause = + isset($_POST['where_clause']) ? $_POST['where_clause'] : null; + + // If the $curr_value was truncated, we should + // fetch the correct full values from the table + if ($full_values && ! empty($where_clause)) { + $curr_value = $this->getFullValuesForSetColumn( + $db, $table, $column, $where_clause + ); + } + + //converts characters of $curr_value to HTML entities + $converted_curr_value = htmlentities( + $curr_value, ENT_COMPAT, "UTF-8" + ); + + $selected_values = explode(',', $converted_curr_value); + + $dropdown .= $this->getHtmlForOptionsList($values, $selected_values); + + $select_size = (sizeof($values) > 10) ? 10 : sizeof($values); + $dropdown = ''; + + return $dropdown; + } + + /** + * Get all the values for a enum column or set column in a table + * + * @param string $db current database + * @param string $table current table + * @param string $column current column + * + * @return array $values array containing the value list for the column + */ + private function getValuesForColumn($db, $table, $column) + { + $field_info_query = $GLOBALS['dbi']->getColumnsSql($db, $table, $column); + + $field_info_result = $GLOBALS['dbi']->fetchResult( + $field_info_query, + null, + null, + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + + $values = Util::parseEnumSetValues($field_info_result[0]['Type']); + + return $values; + } + + /** + * Get HTML for options list + * + * @param array $values set of values + * @param array $selected_values currently selected values + * + * @return string $options HTML for options list + */ + private function getHtmlForOptionsList(array $values, array $selected_values) + { + $options = ''; + foreach ($values as $value) { + $options .= '
    '; + + } else { + $html = null; + } + + return $html; + } + + /** + * Function to check whether to remember the sorting order or not + * + * @param array $analyzed_sql_results the analyzed query and other variables set + * after analyzing the query + * + * @return boolean + */ + private function isRememberSortingOrder(array $analyzed_sql_results) + { + return $GLOBALS['cfg']['RememberSorting'] + && ! ($analyzed_sql_results['is_count'] + || $analyzed_sql_results['is_export'] + || $analyzed_sql_results['is_func'] + || $analyzed_sql_results['is_analyse']) + && $analyzed_sql_results['select_from'] + && isset($analyzed_sql_results['select_expr']) + && isset($analyzed_sql_results['select_tables']) + && ((empty($analyzed_sql_results['select_expr'])) + || ((count($analyzed_sql_results['select_expr']) == 1) + && ($analyzed_sql_results['select_expr'][0] == '*'))) + && count($analyzed_sql_results['select_tables']) == 1; + } + + /** + * Function to check whether the LIMIT clause should be appended or not + * + * @param array $analyzed_sql_results the analyzed query and other variables set + * after analyzing the query + * + * @return boolean + */ + private function isAppendLimitClause(array $analyzed_sql_results) + { + // Assigning LIMIT clause to an syntactically-wrong query + // is not needed. Also we would want to show the true query + // and the true error message to the query executor + + return (isset($analyzed_sql_results['parser']) + && count($analyzed_sql_results['parser']->errors) === 0) + && ($_SESSION['tmpval']['max_rows'] != 'all') + && ! ($analyzed_sql_results['is_export'] + || $analyzed_sql_results['is_analyse']) + && ($analyzed_sql_results['select_from'] + || $analyzed_sql_results['is_subquery']) + && empty($analyzed_sql_results['limit']); + } + + /** + * Function to check whether this query is for just browsing + * + * @param array $analyzed_sql_results the analyzed query and other variables set + * after analyzing the query + * @param boolean $find_real_end whether the real end should be found + * + * @return boolean + */ + public function isJustBrowsing(array $analyzed_sql_results, $find_real_end) + { + return ! $analyzed_sql_results['is_group'] + && ! $analyzed_sql_results['is_func'] + && empty($analyzed_sql_results['union']) + && empty($analyzed_sql_results['distinct']) + && $analyzed_sql_results['select_from'] + && (count($analyzed_sql_results['select_tables']) === 1) + && (empty($analyzed_sql_results['statement']->where) + || (count($analyzed_sql_results['statement']->where) == 1 + && $analyzed_sql_results['statement']->where[0]->expr ==='1')) + && empty($analyzed_sql_results['group']) + && ! isset($find_real_end) + && ! $analyzed_sql_results['is_subquery'] + && ! $analyzed_sql_results['join'] + && empty($analyzed_sql_results['having']); + } + + /** + * Function to check whether the related transformation information should be deleted + * + * @param array $analyzed_sql_results the analyzed query and other variables set + * after analyzing the query + * + * @return boolean + */ + private function isDeleteTransformationInfo(array $analyzed_sql_results) + { + return !empty($analyzed_sql_results['querytype']) + && (($analyzed_sql_results['querytype'] == 'ALTER') + || ($analyzed_sql_results['querytype'] == 'DROP')); + } + + /** + * Function to check whether the user has rights to drop the database + * + * @param array $analyzed_sql_results the analyzed query and other variables set + * after analyzing the query + * @param boolean $allowUserDropDatabase whether the user is allowed to drop db + * @param boolean $is_superuser whether this user is a superuser + * + * @return boolean + */ + public function hasNoRightsToDropDatabase(array $analyzed_sql_results, + $allowUserDropDatabase, $is_superuser + ) { + return ! $allowUserDropDatabase + && isset($analyzed_sql_results['drop_database']) + && $analyzed_sql_results['drop_database'] + && ! $is_superuser; + } + + /** + * Function to set a column property + * + * @param Table $pmatable Table instance + * @param string $request_index col_order|col_visib + * + * @return boolean $retval + */ + private function setColumnProperty($pmatable, $request_index) + { + $property_value = array_map('intval', explode(',', $_POST[$request_index])); + switch($request_index) { + case 'col_order': + $property_to_set = Table::PROP_COLUMN_ORDER; + break; + case 'col_visib': + $property_to_set = Table::PROP_COLUMN_VISIB; + break; + default: + $property_to_set = ''; + } + $retval = $pmatable->setUiProp( + $property_to_set, + $property_value, + isset($_POST['table_create_time']) ? $_POST['table_create_time'] : null + ); + if (gettype($retval) != 'boolean') { + $response = Response::getInstance(); + $response->setRequestStatus(false); + $response->addJSON('message', $retval->getString()); + exit; + } + + return $retval; + } + + /** + * Function to check the request for setting the column order or visibility + * + * @param string $table the current table + * @param string $db the current database + * + * @return void + */ + public function setColumnOrderOrVisibility($table, $db) + { + $pmatable = new Table($table, $db); + $retval = false; + + // set column order + if (isset($_POST['col_order'])) { + $retval = $this->setColumnProperty($pmatable, 'col_order'); + } + + // set column visibility + if ($retval === true && isset($_POST['col_visib'])) { + $retval = $this->setColumnProperty($pmatable, 'col_visib'); + } + + $response = Response::getInstance(); + $response->setRequestStatus($retval == true); + exit; + } + + /** + * Function to add a bookmark + * + * @param string $goto goto page URL + * + * @return void + */ + public function addBookmark($goto) + { + $bookmark = Bookmark::createBookmark( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $_POST['bkm_fields'], + (isset($_POST['bkm_all_users']) + && $_POST['bkm_all_users'] == 'true' ? true : false + ) + ); + $result = $bookmark->save(); + $response = Response::getInstance(); + if ($response->isAjax()) { + if ($result) { + $msg = Message::success(__('Bookmark %s has been created.')); + $msg->addParam($_POST['bkm_fields']['bkm_label']); + $response->addJSON('message', $msg); + } else { + $msg = Message::error(__('Bookmark not created!')); + $response->setRequestStatus(false); + $response->addJSON('message', $msg); + } + exit; + } else { + // go back to sql.php to redisplay query; do not use & in this case: + /** + * @todo In which scenario does this happen? + */ + Core::sendHeaderLocation( + './' . $goto + . '&label=' . $_POST['bkm_fields']['bkm_label'] + ); + } + } + + /** + * Function to find the real end of rows + * + * @param string $db the current database + * @param string $table the current table + * + * @return mixed the number of rows if "retain" param is true, otherwise true + */ + public function findRealEndOfRows($db, $table) + { + $unlim_num_rows = $GLOBALS['dbi']->getTable($db, $table)->countRecords(true); + $_SESSION['tmpval']['pos'] = $this->getStartPosToDisplayRow($unlim_num_rows); + + return $unlim_num_rows; + } + + /** + * Function to get values for the relational columns + * + * @param string $db the current database + * @param string $table the current table + * + * @return void + */ + public function getRelationalValues($db, $table) + { + $column = $_POST['column']; + if ($_SESSION['tmpval']['relational_display'] == 'D' + && isset($_POST['relation_key_or_display_column']) + && $_POST['relation_key_or_display_column'] + ) { + $curr_value = $_POST['relation_key_or_display_column']; + } else { + $curr_value = $_POST['curr_value']; + } + $dropdown = $this->getHtmlForRelationalColumnDropdown( + $db, $table, $column, $curr_value + ); + $response = Response::getInstance(); + $response->addJSON('dropdown', $dropdown); + exit; + } + + /** + * Function to get values for Enum or Set Columns + * + * @param string $db the current database + * @param string $table the current table + * @param string $columnType whether enum or set + * + * @return void + */ + public function getEnumOrSetValues($db, $table, $columnType) + { + $column = $_POST['column']; + $curr_value = $_POST['curr_value']; + $response = Response::getInstance(); + if ($columnType == "enum") { + $dropdown = $this->getHtmlForEnumColumnDropdown( + $db, $table, $column, $curr_value + ); + $response->addJSON('dropdown', $dropdown); + } else { + $select = $this->getHtmlForSetColumn( + $db, $table, $column, $curr_value + ); + $response->addJSON('select', $select); + } + exit; + } + + /** + * Function to get the default sql query for browsing page + * + * @param string $db the current database + * @param string $table the current table + * + * @return string $sql_query the default $sql_query for browse page + */ + public function getDefaultSqlQueryForBrowse($db, $table) + { + $bookmark = Bookmark::get( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $db, + $table, + 'label', + false, + true + ); + + if (! empty($bookmark) && ! empty($bookmark->getQuery())) { + $GLOBALS['using_bookmark_message'] = Message::notice( + __('Using bookmark "%s" as default browse query.') + ); + $GLOBALS['using_bookmark_message']->addParam($table); + $GLOBALS['using_bookmark_message']->addHtml( + Util::showDocu('faq', 'faq6-22') + ); + $sql_query = $bookmark->getQuery(); + } else { + + $defaultOrderByClause = ''; + + if (isset($GLOBALS['cfg']['TablePrimaryKeyOrder']) + && ($GLOBALS['cfg']['TablePrimaryKeyOrder'] !== 'NONE') + ) { + + $primaryKey = null; + $primary = Index::getPrimary($table, $db); + + if ($primary !== false) { + + $primarycols = $primary->getColumns(); + + foreach ($primarycols as $col) { + $primaryKey = $col->getName(); + break; + } + + if ($primaryKey != null) { + $defaultOrderByClause = ' ORDER BY ' + . Util::backquote($table) . '.' + . Util::backquote($primaryKey) . ' ' + . $GLOBALS['cfg']['TablePrimaryKeyOrder']; + } + + } + + } + + $sql_query = 'SELECT * FROM ' . Util::backquote($table) + . $defaultOrderByClause; + + } + + return $sql_query; + } + + /** + * Responds an error when an error happens when executing the query + * + * @param boolean $is_gotofile whether goto file or not + * @param string $error error after executing the query + * @param string $full_sql_query full sql query + * + * @return void + */ + private function handleQueryExecuteError($is_gotofile, $error, $full_sql_query) + { + if ($is_gotofile) { + $message = Message::rawError($error); + $response = Response::getInstance(); + $response->setRequestStatus(false); + $response->addJSON('message', $message); + } else { + Util::mysqlDie($error, $full_sql_query, '', ''); + } + exit; + } + + /** + * Function to store the query as a bookmark + * + * @param string $db the current database + * @param string $bkm_user the bookmarking user + * @param string $sql_query_for_bookmark the query to be stored in bookmark + * @param string $bkm_label bookmark label + * @param boolean $bkm_replace whether to replace existing bookmarks + * + * @return void + */ + public function storeTheQueryAsBookmark($db, $bkm_user, $sql_query_for_bookmark, + $bkm_label, $bkm_replace + ) { + $bfields = array( + 'bkm_database' => $db, + 'bkm_user' => $bkm_user, + 'bkm_sql_query' => $sql_query_for_bookmark, + 'bkm_label' => $bkm_label, + ); + + // Should we replace bookmark? + if (isset($bkm_replace)) { + $bookmarks = Bookmark::getList( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $db + ); + foreach ($bookmarks as $bookmark) { + if ($bookmark->getLabel() == $bkm_label) { + $bookmark->delete(); + } + } + } + + $bookmark = Bookmark::createBookmark( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $bfields, + isset($_POST['bkm_all_users']) + ); + $bookmark->save(); + } + + /** + * Executes the SQL query and measures its execution time + * + * @param string $full_sql_query the full sql query + * + * @return array ($result, $querytime) + */ + private function executeQueryAndMeasureTime($full_sql_query) + { + // close session in case the query takes too long + session_write_close(); + + // Measure query time. + $querytime_before = array_sum(explode(' ', microtime())); + + $result = @$GLOBALS['dbi']->tryQuery( + $full_sql_query, DatabaseInterface::CONNECT_USER, DatabaseInterface::QUERY_STORE + ); + $querytime_after = array_sum(explode(' ', microtime())); + + // reopen session + session_start(); + + return array($result, $querytime_after - $querytime_before); + } + + /** + * Function to get the affected or changed number of rows after executing a query + * + * @param boolean $is_affected whether the query affected a table + * @param mixed $result results of executing the query + * + * @return int $num_rows number of rows affected or changed + */ + private function getNumberOfRowsAffectedOrChanged($is_affected, $result) + { + if (! $is_affected) { + $num_rows = ($result) ? @$GLOBALS['dbi']->numRows($result) : 0; + } else { + $num_rows = @$GLOBALS['dbi']->affectedRows(); + } + + return $num_rows; + } + + /** + * Checks if the current database has changed + * This could happen if the user sends a query like "USE `database`;" + * + * @param string $db the database in the query + * + * @return int $reload whether to reload the navigation(1) or not(0) + */ + private function hasCurrentDbChanged($db) + { + if (strlen($db) > 0) { + $current_db = $GLOBALS['dbi']->fetchValue('SELECT DATABASE()'); + // $current_db is false, except when a USE statement was sent + return ($current_db != false) && ($db !== $current_db); + } + + return false; + } + + /** + * If a table, database or column gets dropped, clean comments. + * + * @param string $db current database + * @param string $table current table + * @param string $column current column + * @param bool $purge whether purge set or not + * + * @return array $extra_data + */ + private function cleanupRelations($db, $table, $column, $purge) + { + if (! empty($purge) && strlen($db) > 0) { + if (strlen($table) > 0) { + if (isset($column) && strlen($column) > 0) { + RelationCleanup::column($db, $table, $column); + } else { + RelationCleanup::table($db, $table); + } + } else { + RelationCleanup::database($db); + } + } + } + + /** + * Function to count the total number of rows for the same 'SELECT' query without + * the 'LIMIT' clause that may have been programatically added + * + * @param int $num_rows number of rows affected/changed by the query + * @param bool $justBrowsing whether just browsing or not + * @param string $db the current database + * @param string $table the current table + * @param array $analyzed_sql_results the analyzed query and other variables set + * after analyzing the query + * + * @return int $unlim_num_rows unlimited number of rows + */ + private function countQueryResults( + $num_rows, $justBrowsing, $db, $table, array $analyzed_sql_results + ) { + + /* Shortcut for not analyzed/empty query */ + if (empty($analyzed_sql_results)) { + return 0; + } + + if (!$this->isAppendLimitClause($analyzed_sql_results)) { + // if we did not append a limit, set this to get a correct + // "Showing rows..." message + // $_SESSION['tmpval']['max_rows'] = 'all'; + $unlim_num_rows = $num_rows; + } elseif ($this->isAppendLimitClause($analyzed_sql_results) && $_SESSION['tmpval']['max_rows'] > $num_rows) { + // When user has not defined a limit in query and total rows in + // result are less than max_rows to display, there is no need + // to count total rows for that query again + $unlim_num_rows = $_SESSION['tmpval']['pos'] + $num_rows; + } elseif ($analyzed_sql_results['querytype'] == 'SELECT' + || $analyzed_sql_results['is_subquery'] + ) { + // c o u n t q u e r y + + // If we are "just browsing", there is only one table (and no join), + // and no WHERE clause (or just 'WHERE 1 '), + // we do a quick count (which uses MaxExactCount) because + // SQL_CALC_FOUND_ROWS is not quick on large InnoDB tables + + // However, do not count again if we did it previously + // due to $find_real_end == true + if ($justBrowsing) { + // Get row count (is approximate for InnoDB) + $unlim_num_rows = $GLOBALS['dbi']->getTable($db, $table)->countRecords(); + /** + * @todo Can we know at this point that this is InnoDB, + * (in this case there would be no need for getting + * an exact count)? + */ + if ($unlim_num_rows < $GLOBALS['cfg']['MaxExactCount']) { + // Get the exact count if approximate count + // is less than MaxExactCount + /** + * @todo In countRecords(), MaxExactCount is also verified, + * so can we avoid checking it twice? + */ + $unlim_num_rows = $GLOBALS['dbi']->getTable($db, $table) + ->countRecords(true); + } + + } else { + + // The SQL_CALC_FOUND_ROWS option of the SELECT statement is used. + + // For UNION statements, only a SQL_CALC_FOUND_ROWS is required + // after the first SELECT. + + $count_query = Query::replaceClause( + $analyzed_sql_results['statement'], + $analyzed_sql_results['parser']->list, + 'SELECT SQL_CALC_FOUND_ROWS', + null, + true + ); + + // Another LIMIT clause is added to avoid long delays. + // A complete result will be returned anyway, but the LIMIT would + // stop the query as soon as the result that is required has been + // computed. + + if (empty($analyzed_sql_results['union'])) { + $count_query .= ' LIMIT 1'; + } + + // Running the count query. + $GLOBALS['dbi']->tryQuery($count_query); + + $unlim_num_rows = $GLOBALS['dbi']->fetchValue('SELECT FOUND_ROWS()'); + } // end else "just browsing" + } else {// not $is_select + $unlim_num_rows = 0; + } + + return $unlim_num_rows; + } + + /** + * Function to handle all aspects relating to executing the query + * + * @param array $analyzed_sql_results analyzed sql results + * @param string $full_sql_query full sql query + * @param boolean $is_gotofile whether to go to a file + * @param string $db current database + * @param string $table current table + * @param boolean $find_real_end whether to find the real end + * @param string $sql_query_for_bookmark sql query to be stored as bookmark + * @param array $extra_data extra data + * + * @return mixed + */ + private function executeTheQuery(array $analyzed_sql_results, $full_sql_query, $is_gotofile, + $db, $table, $find_real_end, $sql_query_for_bookmark, $extra_data + ) { + $response = Response::getInstance(); + $response->getHeader()->getMenu()->setTable($table); + + // Only if we ask to see the php code + if (isset($GLOBALS['show_as_php'])) { + $result = null; + $num_rows = 0; + $unlim_num_rows = 0; + } else { // If we don't ask to see the php code + if (isset($_SESSION['profiling']) + && Util::profilingSupported() + ) { + $GLOBALS['dbi']->query('SET PROFILING=1;'); + } + + list( + $result, + $GLOBALS['querytime'] + ) = $this->executeQueryAndMeasureTime($full_sql_query); + + // Displays an error message if required and stop parsing the script + $error = $GLOBALS['dbi']->getError(); + if ($error && $GLOBALS['cfg']['IgnoreMultiSubmitErrors']) { + $extra_data['error'] = $error; + } elseif ($error) { + $this->handleQueryExecuteError($is_gotofile, $error, $full_sql_query); + } + + // If there are no errors and bookmarklabel was given, + // store the query as a bookmark + if (! empty($_POST['bkm_label']) && ! empty($sql_query_for_bookmark)) { + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + $this->storeTheQueryAsBookmark( + $db, $cfgBookmark['user'], + $sql_query_for_bookmark, $_POST['bkm_label'], + isset($_POST['bkm_replace']) ? $_POST['bkm_replace'] : null + ); + } // end store bookmarks + + // Gets the number of rows affected/returned + // (This must be done immediately after the query because + // mysql_affected_rows() reports about the last query done) + $num_rows = $this->getNumberOfRowsAffectedOrChanged( + $analyzed_sql_results['is_affected'], $result + ); + + // Grabs the profiling results + if (isset($_SESSION['profiling']) + && Util::profilingSupported() + ) { + $profiling_results = $GLOBALS['dbi']->fetchResult('SHOW PROFILE;'); + } + + $justBrowsing = $this->isJustBrowsing( + $analyzed_sql_results, isset($find_real_end) ? $find_real_end : null + ); + + $unlim_num_rows = $this->countQueryResults( + $num_rows, $justBrowsing, $db, $table, $analyzed_sql_results + ); + + $this->cleanupRelations( + isset($db) ? $db : '', + isset($table) ? $table : '', + isset($_POST['dropped_column']) ? $_POST['dropped_column'] : null, + isset($_POST['purge']) ? $_POST['purge'] : null + ); + + if (isset($_POST['dropped_column']) + && strlen($db) > 0 + && strlen($table) > 0 + ) { + // to refresh the list of indexes (Ajax mode) + $extra_data['indexes_list'] = Index::getHtmlForIndexes( + $table, + $db + ); + } + } + + return array($result, $num_rows, $unlim_num_rows, + isset($profiling_results) ? $profiling_results : null, $extra_data + ); + } + /** + * Delete related transformation information + * + * @param string $db current database + * @param string $table current table + * @param array $analyzed_sql_results analyzed sql results + * + * @return void + */ + private function deleteTransformationInfo($db, $table, array $analyzed_sql_results) + { + if (! isset($analyzed_sql_results['statement'])) { + return; + } + $statement = $analyzed_sql_results['statement']; + if ($statement instanceof AlterStatement) { + if (!empty($statement->altered[0]) + && $statement->altered[0]->options->has('DROP') + ) { + if (!empty($statement->altered[0]->field->column)) { + Transformations::clear( + $db, + $table, + $statement->altered[0]->field->column + ); + } + } + } elseif ($statement instanceof DropStatement) { + Transformations::clear($db, $table); + } + } + + /** + * Function to get the message for the no rows returned case + * + * @param string $message_to_show message to show + * @param array $analyzed_sql_results analyzed sql results + * @param int $num_rows number of rows + * + * @return string $message + */ + private function getMessageForNoRowsReturned($message_to_show, + array $analyzed_sql_results, $num_rows + ) { + if ($analyzed_sql_results['querytype'] == 'DELETE"') { + $message = Message::getMessageForDeletedRows($num_rows); + } elseif ($analyzed_sql_results['is_insert']) { + if ($analyzed_sql_results['querytype'] == 'REPLACE') { + // For REPLACE we get DELETED + INSERTED row count, + // so we have to call it affected + $message = Message::getMessageForAffectedRows($num_rows); + } else { + $message = Message::getMessageForInsertedRows($num_rows); + } + $insert_id = $GLOBALS['dbi']->insertId(); + if ($insert_id != 0) { + // insert_id is id of FIRST record inserted in one insert, + // so if we inserted multiple rows, we had to increment this + $message->addText('[br]'); + // need to use a temporary because the Message class + // currently supports adding parameters only to the first + // message + $_inserted = Message::notice(__('Inserted row id: %1$d')); + $_inserted->addParam($insert_id + $num_rows - 1); + $message->addMessage($_inserted); + } + } elseif ($analyzed_sql_results['is_affected']) { + $message = Message::getMessageForAffectedRows($num_rows); + + // Ok, here is an explanation for the !$is_select. + // The form generated by PhpMyAdmin\SqlQueryForm + // and db_sql.php has many submit buttons + // on the same form, and some confusion arises from the + // fact that $message_to_show is sent for every case. + // The $message_to_show containing a success message and sent with + // the form should not have priority over errors + } elseif (! empty($message_to_show) + && $analyzed_sql_results['querytype'] != 'SELECT' + ) { + $message = Message::rawSuccess(htmlspecialchars($message_to_show)); + } elseif (! empty($GLOBALS['show_as_php'])) { + $message = Message::success(__('Showing as PHP code')); + } elseif (isset($GLOBALS['show_as_php'])) { + /* User disable showing as PHP, query is only displayed */ + $message = Message::notice(__('Showing SQL query')); + } else { + $message = Message::success( + __('MySQL returned an empty result set (i.e. zero rows).') + ); + } + + if (isset($GLOBALS['querytime'])) { + $_querytime = Message::notice( + '(' . __('Query took %01.4f seconds.') . ')' + ); + $_querytime->addParam($GLOBALS['querytime']); + $message->addMessage($_querytime); + } + + // In case of ROLLBACK, notify the user. + if (isset($_POST['rollback_query'])) { + $message->addText(__('[ROLLBACK occurred.]')); + } + + return $message; + } + + /** + * Function to respond back when the query returns zero rows + * This method is called + * 1-> When browsing an empty table + * 2-> When executing a query on a non empty table which returns zero results + * 3-> When executing a query on an empty table + * 4-> When executing an INSERT, UPDATE, DELETE query from the SQL tab + * 5-> When deleting a row from BROWSE tab + * 6-> When searching using the SEARCH tab which returns zero results + * 7-> When changing the structure of the table except change operation + * + * @param array $analyzed_sql_results analyzed sql results + * @param string $db current database + * @param string $table current table + * @param string $message_to_show message to show + * @param int $num_rows number of rows + * @param DisplayResults $displayResultsObject DisplayResult instance + * @param array $extra_data extra data + * @param string $pmaThemeImage uri of the theme image + * @param array|null $profiling_results profiling results + * @param object $result executed query results + * @param string $sql_query sql query + * @param string $complete_query complete sql query + * + * @return string html + */ + private function getQueryResponseForNoResultsReturned(array $analyzed_sql_results, $db, + $table, $message_to_show, $num_rows, $displayResultsObject, $extra_data, + $pmaThemeImage, $profiling_results, $result, $sql_query, $complete_query + ) { + if ($this->isDeleteTransformationInfo($analyzed_sql_results)) { + $this->deleteTransformationInfo($db, $table, $analyzed_sql_results); + } + + if (isset($extra_data['error'])) { + $message = Message::rawError($extra_data['error']); + } else { + $message = $this->getMessageForNoRowsReturned( + isset($message_to_show) ? $message_to_show : null, + $analyzed_sql_results, $num_rows + ); + } + + $html_output = ''; + $html_message = Util::getMessage( + $message, $GLOBALS['sql_query'], 'success' + ); + $html_output .= $html_message; + if (!isset($GLOBALS['show_as_php'])) { + + if (! empty($GLOBALS['reload'])) { + $extra_data['reload'] = 1; + $extra_data['db'] = $GLOBALS['db']; + } + + // For ajax requests add message and sql_query as JSON + if (empty($_REQUEST['ajax_page_request'])) { + $extra_data['message'] = $message; + if ($GLOBALS['cfg']['ShowSQL']) { + $extra_data['sql_query'] = $html_message; + } + } + + $response = Response::getInstance(); + $response->addJSON(isset($extra_data) ? $extra_data : array()); + + if (!empty($analyzed_sql_results['is_select']) && + !isset($extra_data['error'])) { + $url_query = isset($url_query) ? $url_query : null; + + $displayParts = array( + 'edit_lnk' => null, + 'del_lnk' => null, + 'sort_lnk' => '1', + 'nav_bar' => '0', + 'bkm_form' => '1', + 'text_btn' => '1', + 'pview_lnk' => '1' + ); + + $html_output .= $this->getHtmlForSqlQueryResultsTable( + $displayResultsObject, + $pmaThemeImage, $url_query, $displayParts, + false, 0, $num_rows, true, $result, + $analyzed_sql_results, true + ); + + if (isset($profiling_results)) { + $header = $response->getHeader(); + $scripts = $header->getScripts(); + $scripts->addFile('sql.js'); + $html_output .= $this->getHtmlForProfilingChart( + $url_query, + $db, + isset($profiling_results) ? $profiling_results : [] + ); + } + + $html_output .= $displayResultsObject->getCreateViewQueryResultOp( + $analyzed_sql_results + ); + + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + if ($cfgBookmark) { + $html_output .= $this->getHtmlForBookmark( + $displayParts, + $cfgBookmark, + $sql_query, $db, $table, + isset($complete_query) ? $complete_query : $sql_query, + $cfgBookmark['user'] + ); + } + } + } + + return $html_output; + } + + /** + * Function to send response for ajax grid edit + * + * @param object $result result of the executed query + * + * @return void + */ + private function sendResponseForGridEdit($result) + { + $row = $GLOBALS['dbi']->fetchRow($result); + $field_flags = $GLOBALS['dbi']->fieldFlags($result, 0); + if (stristr($field_flags, DisplayResults::BINARY_FIELD)) { + $row[0] = bin2hex($row[0]); + } + $response = Response::getInstance(); + $response->addJSON('value', $row[0]); + exit; + } + + /** + * Function to get html for the sql query results div + * + * @param string $previous_update_query_html html for the previously executed query + * @param string $profiling_chart_html html for profiling + * @param Message $missing_unique_column_msg message for the missing unique column + * @param Message $bookmark_created_msg message for bookmark creation + * @param string $table_html html for the table for displaying sql + * results + * @param string $indexes_problems_html html for displaying errors in indexes + * @param string $bookmark_support_html html for displaying bookmark form + * + * @return string $html_output + */ + private function getHtmlForSqlQueryResults($previous_update_query_html, + $profiling_chart_html, $missing_unique_column_msg, $bookmark_created_msg, + $table_html, $indexes_problems_html, $bookmark_support_html + ) { + //begin the sqlqueryresults div here. container div + $html_output = '
    '; + $html_output .= isset($previous_update_query_html) + ? $previous_update_query_html : ''; + $html_output .= isset($profiling_chart_html) ? $profiling_chart_html : ''; + $html_output .= isset($missing_unique_column_msg) + ? $missing_unique_column_msg->getDisplay() : ''; + $html_output .= isset($bookmark_created_msg) + ? $bookmark_created_msg->getDisplay() : ''; + $html_output .= $table_html; + $html_output .= isset($indexes_problems_html) ? $indexes_problems_html : ''; + $html_output .= isset($bookmark_support_html) ? $bookmark_support_html : ''; + $html_output .= '
    '; // end sqlqueryresults div + + return $html_output; + } + + /** + * Returns a message for successful creation of a bookmark or null if a bookmark + * was not created + * + * @return Message $bookmark_created_msg + */ + private function getBookmarkCreatedMessage() + { + if (isset($_GET['label'])) { + $bookmark_created_msg = Message::success( + __('Bookmark %s has been created.') + ); + $bookmark_created_msg->addParam($_GET['label']); + } else { + $bookmark_created_msg = null; + } + + return $bookmark_created_msg; + } + + /** + * Function to get html for the sql query results table + * + * @param DisplayResults $displayResultsObject instance of DisplayResult + * @param string $pmaThemeImage theme image uri + * @param string $url_query url query + * @param array $displayParts the parts to display + * @param bool $editable whether the result table is + * editable or not + * @param int $unlim_num_rows unlimited number of rows + * @param int $num_rows number of rows + * @param bool $showtable whether to show table or not + * @param object $result result of the executed query + * @param array $analyzed_sql_results analyzed sql results + * @param bool $is_limited_display Show only limited operations or not + * + * @return string + */ + private function getHtmlForSqlQueryResultsTable($displayResultsObject, + $pmaThemeImage, $url_query, array $displayParts, + $editable, $unlim_num_rows, $num_rows, $showtable, $result, + array $analyzed_sql_results, $is_limited_display = false + ) { + $printview = isset($_POST['printview']) && $_POST['printview'] == '1' ? '1' : null; + $table_html = ''; + $browse_dist = ! empty($_POST['is_browse_distinct']); + + if ($analyzed_sql_results['is_procedure']) { + + do { + if (! isset($result)) { + $result = $GLOBALS['dbi']->storeResult(); + } + $num_rows = $GLOBALS['dbi']->numRows($result); + + if ($result !== false && $num_rows > 0) { + + $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); + if (! is_array($fields_meta)) { + $fields_cnt = 0; + } else { + $fields_cnt = count($fields_meta); + } + + $displayResultsObject->setProperties( + $num_rows, + $fields_meta, + $analyzed_sql_results['is_count'], + $analyzed_sql_results['is_export'], + $analyzed_sql_results['is_func'], + $analyzed_sql_results['is_analyse'], + $num_rows, + $fields_cnt, + $GLOBALS['querytime'], + $pmaThemeImage, + $GLOBALS['text_dir'], + $analyzed_sql_results['is_maint'], + $analyzed_sql_results['is_explain'], + $analyzed_sql_results['is_show'], + $showtable, + $printview, + $url_query, + $editable, + $browse_dist + ); + + $displayParts = array( + 'edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, + 'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, + 'sort_lnk' => '1', + 'nav_bar' => '1', + 'bkm_form' => '1', + 'text_btn' => '1', + 'pview_lnk' => '1' + ); + + $table_html .= $displayResultsObject->getTable( + $result, + $displayParts, + $analyzed_sql_results, + $is_limited_display + ); + } + + $GLOBALS['dbi']->freeResult($result); + unset($result); + + } while ($GLOBALS['dbi']->moreResults() && $GLOBALS['dbi']->nextResult()); + + } else { + $fields_meta = array(); + if (isset($result) && ! is_bool($result)) { + $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); + } + $fields_cnt = count($fields_meta); + $_SESSION['is_multi_query'] = false; + $displayResultsObject->setProperties( + $unlim_num_rows, + $fields_meta, + $analyzed_sql_results['is_count'], + $analyzed_sql_results['is_export'], + $analyzed_sql_results['is_func'], + $analyzed_sql_results['is_analyse'], + $num_rows, + $fields_cnt, $GLOBALS['querytime'], + $pmaThemeImage, $GLOBALS['text_dir'], + $analyzed_sql_results['is_maint'], + $analyzed_sql_results['is_explain'], + $analyzed_sql_results['is_show'], + $showtable, + $printview, + $url_query, + $editable, + $browse_dist + ); + + if (! is_bool($result)) { + $table_html .= $displayResultsObject->getTable( + $result, + $displayParts, + $analyzed_sql_results, + $is_limited_display + ); + } + $GLOBALS['dbi']->freeResult($result); + } + + return $table_html; + } + + /** + * Function to get html for the previous query if there is such. If not will return + * null + * + * @param string $disp_query display query + * @param bool $showSql whether to show sql + * @param array $sql_data sql data + * @param string $disp_message display message + * + * @return string $previous_update_query_html + */ + private function getHtmlForPreviousUpdateQuery($disp_query, $showSql, $sql_data, + $disp_message + ) { + // previous update query (from tbl_replace) + if (isset($disp_query) && ($showSql == true) && empty($sql_data)) { + $previous_update_query_html = Util::getMessage( + $disp_message, $disp_query, 'success' + ); + } else { + $previous_update_query_html = null; + } + + return $previous_update_query_html; + } + + /** + * To get the message if a column index is missing. If not will return null + * + * @param string $table current table + * @param string $db current database + * @param boolean $editable whether the results table can be editable or not + * @param boolean $has_unique whether there is a unique key + * + * @return Message $message + */ + private function getMessageIfMissingColumnIndex($table, $db, $editable, $has_unique) + { + if (!empty($table) && ($GLOBALS['dbi']->isSystemSchema($db) || !$editable)) { + $missing_unique_column_msg = Message::notice( + sprintf( + __( + 'Current selection does not contain a unique column.' + . ' Grid edit, checkbox, Edit, Copy and Delete features' + . ' are not available. %s' + ), + Util::showDocu( + 'config', + 'cfg_RowActionLinksWithoutUnique' + ) + ) + ); + } elseif (! empty($table) && ! $has_unique) { + $missing_unique_column_msg = Message::notice( + sprintf( + __( + 'Current selection does not contain a unique column.' + . ' Grid edit, Edit, Copy and Delete features may result in' + . ' undesired behavior. %s' + ), + Util::showDocu( + 'config', + 'cfg_RowActionLinksWithoutUnique' + ) + ) + ); + } else { + $missing_unique_column_msg = null; + } + + return $missing_unique_column_msg; + } + + /** + * Function to get html to display problems in indexes + * + * @param string $query_type query type + * @param array|null $selectedTables array of table names selected from the + * database structure page, for an action + * like check table, optimize table, + * analyze table or repair table + * @param string $db current database + * + * @return string + */ + private function getHtmlForIndexesProblems($query_type, $selectedTables, $db) + { + // BEGIN INDEX CHECK See if indexes should be checked. + if (isset($query_type) + && $query_type == 'check_tbl' + && isset($selectedTables) + && is_array($selectedTables) + ) { + $indexes_problems_html = ''; + foreach ($selectedTables as $tbl_name) { + $check = Index::findDuplicates($tbl_name, $db); + if (! empty($check)) { + $indexes_problems_html .= sprintf( + __('Problems with indexes of table `%s`'), $tbl_name + ); + $indexes_problems_html .= $check; + } + } + } else { + $indexes_problems_html = null; + } + + return $indexes_problems_html; + } + + /** + * Function to display results when the executed query returns non empty results + * + * @param object $result executed query results + * @param array $analyzed_sql_results analysed sql results + * @param string $db current database + * @param string $table current table + * @param string $message message to show + * @param array $sql_data sql data + * @param DisplayResults $displayResultsObject Instance of DisplayResults + * @param string $pmaThemeImage uri of the theme image + * @param int $unlim_num_rows unlimited number of rows + * @param int $num_rows number of rows + * @param string $disp_query display query + * @param string $disp_message display message + * @param array $profiling_results profiling results + * @param string $query_type query type + * @param array|null $selectedTables array of table names selected + * from the database structure page, for + * an action like check table, + * optimize table, analyze table or + * repair table + * @param string $sql_query sql query + * @param string $complete_query complete sql query + * + * @return string html + */ + private function getQueryResponseForResultsReturned($result, array $analyzed_sql_results, + $db, $table, $message, $sql_data, $displayResultsObject, $pmaThemeImage, + $unlim_num_rows, $num_rows, $disp_query, $disp_message, $profiling_results, + $query_type, $selectedTables, $sql_query, $complete_query + ) { + // If we are retrieving the full value of a truncated field or the original + // value of a transformed field, show it here + if (isset($_POST['grid_edit']) && $_POST['grid_edit'] == true) { + $this->sendResponseForGridEdit($result); + // script has exited at this point + } + + // Gets the list of fields properties + if (isset($result) && $result) { + $fields_meta = $GLOBALS['dbi']->getFieldsMeta($result); + } + + // Should be initialized these parameters before parsing + $showtable = isset($showtable) ? $showtable : null; + $url_query = isset($url_query) ? $url_query : null; + + $response = Response::getInstance(); + $header = $response->getHeader(); + $scripts = $header->getScripts(); + + $just_one_table = $this->resultSetHasJustOneTable($fields_meta); + + // hide edit and delete links: + // - for information_schema + // - if the result set does not contain all the columns of a unique key + // (unless this is an updatable view) + // - if the SELECT query contains a join or a subquery + + $updatableView = false; + + $statement = isset($analyzed_sql_results['statement']) ? $analyzed_sql_results['statement'] : null; + if ($statement instanceof SelectStatement) { + if (!empty($statement->expr)) { + if ($statement->expr[0]->expr === '*') { + $_table = new Table($table, $db); + $updatableView = $_table->isUpdatableView(); + } + } + + if ($analyzed_sql_results['join'] + || $analyzed_sql_results['is_subquery'] + || count($analyzed_sql_results['select_tables']) !== 1 + ) { + $just_one_table = false; + } + } + + $has_unique = $this->resultSetContainsUniqueKey( + $db, $table, $fields_meta + ); + + $editable = ($has_unique + || $GLOBALS['cfg']['RowActionLinksWithoutUnique'] + || $updatableView) + && $just_one_table; + + $_SESSION['tmpval']['possible_as_geometry'] = $editable; + + $displayParts = array( + 'edit_lnk' => $displayResultsObject::UPDATE_ROW, + 'del_lnk' => $displayResultsObject::DELETE_ROW, + 'sort_lnk' => '1', + 'nav_bar' => '1', + 'bkm_form' => '1', + 'text_btn' => '0', + 'pview_lnk' => '1' + ); + + if ($GLOBALS['dbi']->isSystemSchema($db) || !$editable) { + $displayParts = array( + 'edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, + 'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, + 'sort_lnk' => '1', + 'nav_bar' => '1', + 'bkm_form' => '1', + 'text_btn' => '1', + 'pview_lnk' => '1' + ); + + } + if (isset($_POST['printview']) && $_POST['printview'] == '1') { + $displayParts = array( + 'edit_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, + 'del_lnk' => $displayResultsObject::NO_EDIT_OR_DELETE, + 'sort_lnk' => '0', + 'nav_bar' => '0', + 'bkm_form' => '0', + 'text_btn' => '0', + 'pview_lnk' => '0' + ); + } + + if (isset($_POST['table_maintenance'])) { + $scripts->addFile('makegrid.js'); + $scripts->addFile('sql.js'); + $table_maintenance_html = ''; + if (isset($message)) { + $message = Message::success($message); + $table_maintenance_html = Util::getMessage( + $message, $GLOBALS['sql_query'], 'success' + ); + } + $table_maintenance_html .= $this->getHtmlForSqlQueryResultsTable( + $displayResultsObject, + $pmaThemeImage, $url_query, $displayParts, + false, $unlim_num_rows, $num_rows, $showtable, $result, + $analyzed_sql_results + ); + if (empty($sql_data) || ($sql_data['valid_queries'] = 1)) { + $response->addHTML($table_maintenance_html); + exit(); + } + } + + if (!isset($_POST['printview']) || $_POST['printview'] != '1') { + $scripts->addFile('makegrid.js'); + $scripts->addFile('sql.js'); + unset($GLOBALS['message']); + //we don't need to buffer the output in getMessage here. + //set a global variable and check against it in the function + $GLOBALS['buffer_message'] = false; + } + + $previous_update_query_html = $this->getHtmlForPreviousUpdateQuery( + isset($disp_query) ? $disp_query : null, + $GLOBALS['cfg']['ShowSQL'], isset($sql_data) ? $sql_data : null, + isset($disp_message) ? $disp_message : null + ); + + $profiling_chart_html = $this->getHtmlForProfilingChart( + $url_query, $db, isset($profiling_results) ? $profiling_results :array() + ); + + $missing_unique_column_msg = $this->getMessageIfMissingColumnIndex( + $table, $db, $editable, $has_unique + ); + + $bookmark_created_msg = $this->getBookmarkCreatedMessage(); + + $table_html = $this->getHtmlForSqlQueryResultsTable( + $displayResultsObject, + $pmaThemeImage, $url_query, $displayParts, + $editable, $unlim_num_rows, $num_rows, $showtable, $result, + $analyzed_sql_results + ); + + $indexes_problems_html = $this->getHtmlForIndexesProblems( + isset($query_type) ? $query_type : null, + isset($selectedTables) ? $selectedTables : null, $db + ); + + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + if ($cfgBookmark) { + $bookmark_support_html = $this->getHtmlForBookmark( + $displayParts, + $cfgBookmark, + $sql_query, $db, $table, + isset($complete_query) ? $complete_query : $sql_query, + $cfgBookmark['user'] + ); + } else { + $bookmark_support_html = ''; + } + + $html_output = isset($table_maintenance_html) ? $table_maintenance_html : ''; + + $html_output .= $this->getHtmlForSqlQueryResults( + $previous_update_query_html, $profiling_chart_html, + $missing_unique_column_msg, $bookmark_created_msg, + $table_html, $indexes_problems_html, $bookmark_support_html + ); + + return $html_output; + } + + /** + * Function to execute the query and send the response + * + * @param array $analyzed_sql_results analysed sql results + * @param bool $is_gotofile whether goto file or not + * @param string $db current database + * @param string $table current table + * @param bool|null $find_real_end whether to find real end or not + * @param string $sql_query_for_bookmark the sql query to be stored as bookmark + * @param array|null $extra_data extra data + * @param string $message_to_show message to show + * @param string $message message + * @param array|null $sql_data sql data + * @param string $goto goto page url + * @param string $pmaThemeImage uri of the PMA theme image + * @param string $disp_query display query + * @param string $disp_message display message + * @param string $query_type query type + * @param string $sql_query sql query + * @param array|null $selectedTables array of table names selected from the + * database structure page, for an action + * like check table, optimize table, + * analyze table or repair table + * @param string $complete_query complete query + * + * @return void + */ + public function executeQueryAndSendQueryResponse($analyzed_sql_results, + $is_gotofile, $db, $table, $find_real_end, $sql_query_for_bookmark, + $extra_data, $message_to_show, $message, $sql_data, $goto, $pmaThemeImage, + $disp_query, $disp_message, $query_type, $sql_query, $selectedTables, + $complete_query + ) { + if ($analyzed_sql_results == null) { + // Parse and analyze the query + list( + $analyzed_sql_results, + $db, + $table_from_sql + ) = ParseAnalyze::sqlQuery($sql_query, $db); + // @todo: possibly refactor + extract($analyzed_sql_results); + + if ($table != $table_from_sql && !empty($table_from_sql)) { + $table = $table_from_sql; + } + } + + $html_output = $this->executeQueryAndGetQueryResponse( + $analyzed_sql_results, // analyzed_sql_results + $is_gotofile, // is_gotofile + $db, // db + $table, // table + $find_real_end, // find_real_end + $sql_query_for_bookmark, // sql_query_for_bookmark + $extra_data, // extra_data + $message_to_show, // message_to_show + $message, // message + $sql_data, // sql_data + $goto, // goto + $pmaThemeImage, // pmaThemeImage + $disp_query, // disp_query + $disp_message, // disp_message + $query_type, // query_type + $sql_query, // sql_query + $selectedTables, // selectedTables + $complete_query // complete_query + ); + + $response = Response::getInstance(); + $response->addHTML($html_output); + } + + /** + * Function to execute the query and send the response + * + * @param array $analyzed_sql_results analysed sql results + * @param bool $is_gotofile whether goto file or not + * @param string $db current database + * @param string $table current table + * @param bool|null $find_real_end whether to find real end or not + * @param string $sql_query_for_bookmark the sql query to be stored as bookmark + * @param array|null $extra_data extra data + * @param string $message_to_show message to show + * @param string $message message + * @param array|null $sql_data sql data + * @param string $goto goto page url + * @param string $pmaThemeImage uri of the PMA theme image + * @param string $disp_query display query + * @param string $disp_message display message + * @param string $query_type query type + * @param string $sql_query sql query + * @param array|null $selectedTables array of table names selected from the + * database structure page, for an action + * like check table, optimize table, + * analyze table or repair table + * @param string $complete_query complete query + * + * @return string html + */ + public function executeQueryAndGetQueryResponse(array $analyzed_sql_results, + $is_gotofile, $db, $table, $find_real_end, $sql_query_for_bookmark, + $extra_data, $message_to_show, $message, $sql_data, $goto, $pmaThemeImage, + $disp_query, $disp_message, $query_type, $sql_query, $selectedTables, + $complete_query + ) { + // Handle disable/enable foreign key checks + $default_fk_check = Util::handleDisableFKCheckInit(); + + // Handle remembered sorting order, only for single table query. + // Handling is not required when it's a union query + // (the parser never sets the 'union' key to 0). + // Handling is also not required if we came from the "Sort by key" + // drop-down. + if (! empty($analyzed_sql_results) + && $this->isRememberSortingOrder($analyzed_sql_results) + && empty($analyzed_sql_results['union']) + && ! isset($_POST['sort_by_key']) + ) { + if (! isset($_SESSION['sql_from_query_box'])) { + $this->handleSortOrder($db, $table, $analyzed_sql_results, $sql_query); + } else { + unset($_SESSION['sql_from_query_box']); + } + + } + + $displayResultsObject = new DisplayResults( + $GLOBALS['db'], $GLOBALS['table'], $goto, $sql_query + ); + $displayResultsObject->setConfigParamsForDisplayTable(); + + // assign default full_sql_query + $full_sql_query = $sql_query; + + // Do append a "LIMIT" clause? + if ($this->isAppendLimitClause($analyzed_sql_results)) { + $full_sql_query = $this->getSqlWithLimitClause($analyzed_sql_results); + } + + $GLOBALS['reload'] = $this->hasCurrentDbChanged($db); + $GLOBALS['dbi']->selectDb($db); + + // Execute the query + list($result, $num_rows, $unlim_num_rows, $profiling_results, $extra_data) + = $this->executeTheQuery( + $analyzed_sql_results, + $full_sql_query, + $is_gotofile, + $db, + $table, + isset($find_real_end) ? $find_real_end : null, + isset($sql_query_for_bookmark) ? $sql_query_for_bookmark : null, + isset($extra_data) ? $extra_data : null + ); + + if ($GLOBALS['dbi']->moreResults()) { + $GLOBALS['dbi']->nextResult(); + } + + $operations = new Operations(); + $warning_messages = $operations->getWarningMessagesArray(); + + // No rows returned -> move back to the calling page + if ((0 == $num_rows && 0 == $unlim_num_rows) + || $analyzed_sql_results['is_affected'] + ) { + $html_output = $this->getQueryResponseForNoResultsReturned( + $analyzed_sql_results, $db, $table, + isset($message_to_show) ? $message_to_show : null, + $num_rows, $displayResultsObject, $extra_data, + $pmaThemeImage, $profiling_results, isset($result) ? $result : null, + $sql_query, isset($complete_query) ? $complete_query : null + ); + } else { + // At least one row is returned -> displays a table with results + $html_output = $this->getQueryResponseForResultsReturned( + isset($result) ? $result : null, + $analyzed_sql_results, + $db, + $table, + isset($message) ? $message : null, + isset($sql_data) ? $sql_data : null, + $displayResultsObject, + $pmaThemeImage, + $unlim_num_rows, + $num_rows, + isset($disp_query) ? $disp_query : null, + isset($disp_message) ? $disp_message : null, + $profiling_results, + isset($query_type) ? $query_type : null, + isset($selectedTables) ? $selectedTables : null, + $sql_query, + isset($complete_query) ? $complete_query : null + ); + } + + // Handle disable/enable foreign key checks + Util::handleDisableFKCheckCleanup($default_fk_check); + + foreach ($warning_messages as $warning) { + $message = Message::notice(Message::sanitize($warning)); + $html_output .= $message->getDisplay(); + } + + return $html_output; + } + + /** + * Function to define pos to display a row + * + * @param int $number_of_line Number of the line to display + * @param int $max_rows Number of rows by page + * + * @return int Start position to display the line + */ + private function getStartPosToDisplayRow($number_of_line, $max_rows = null) + { + if (null === $max_rows) { + $max_rows = $_SESSION['tmpval']['max_rows']; + } + + return @((ceil($number_of_line / $max_rows) - 1) * $max_rows); + } + + /** + * Function to calculate new pos if pos is higher than number of rows + * of displayed table + * + * @param string $db Database name + * @param string $table Table name + * @param int|null $pos Initial position + * + * @return int Number of pos to display last page + */ + public function calculatePosForLastPage($db, $table, $pos) + { + if (null === $pos) { + $pos = $_SESSION['tmpval']['pos']; + } + + $_table = new Table($table, $db); + $unlim_num_rows = $_table->countRecords(true); + //If position is higher than number of rows + if ($unlim_num_rows <= $pos && 0 != $pos) { + $pos = $this->getStartPosToDisplayRow($unlim_num_rows); + } + + return $pos; + } +} diff --git a/phpMyAdmin/libraries/classes/SqlQueryForm.php b/phpMyAdmin/libraries/classes/SqlQueryForm.php new file mode 100755 index 0000000..497d479 --- /dev/null +++ b/phpMyAdmin/libraries/classes/SqlQueryForm.php @@ -0,0 +1,446 @@ +' . "\n"; + + $html .= '' + . "\n" . Url::getHiddenInputs($db, $table) . "\n" + . '' . "\n" + . '' . "\n" + . '' + . "\n" . '' . "\n"; + + // display querybox + if ($display_tab === 'full' || $display_tab === 'sql') { + $html .= self::getHtmlForInsert( + $query, $delimiter + ); + } + + // Bookmark Support + if ($display_tab === 'full') { + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + if ($cfgBookmark) { + $html .= self::getHtmlForBookmark(); + } + } + + // Japanese encoding setting + if (Encoding::canConvertKanji()) { + $html .= Encoding::kanjiEncodingForm(); + } + + $html .= '' . "\n"; + // print an empty div, which will be later filled with + // the sql query results by ajax + $html .= '
    '; + + return $html; + } + + /** + * Get initial values for Sql Query Form Insert + * + * @param string $query query to display in the textarea + * + * @return array ($legend, $query, $columns_list) + * + * @usedby self::getHtmlForInsert() + */ + public static function init($query) + { + $columns_list = array(); + if (strlen($GLOBALS['db']) === 0) { + // prepare for server related + $legend = sprintf( + __('Run SQL query/queries on server 鈥�%s鈥�'), + htmlspecialchars( + ! empty($GLOBALS['cfg']['Servers'][$GLOBALS['server']]['verbose']) + ? $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['verbose'] + : $GLOBALS['cfg']['Servers'][$GLOBALS['server']]['host'] + ) + ); + } elseif (strlen($GLOBALS['table']) === 0) { + // prepare for db related + $db = $GLOBALS['db']; + // if you want navigation: + $tmp_db_link = ''; + $legend = sprintf(__('Run SQL query/queries on database %s'), $tmp_db_link); + if (empty($query)) { + $query = Util::expandUserString( + $GLOBALS['cfg']['DefaultQueryDatabase'], 'backquote' + ); + } + } else { + $db = $GLOBALS['db']; + $table = $GLOBALS['table']; + // Get the list and number of fields + // we do a try_query here, because we could be in the query window, + // trying to synchronize and the table has not yet been created + $columns_list = $GLOBALS['dbi']->getColumns( + $db, $GLOBALS['table'], null, true + ); + + $tmp_tbl_link = ''; + $tmp_tbl_link .= htmlspecialchars($db) + . '.' . htmlspecialchars($table) . ''; + $legend = sprintf(__('Run SQL query/queries on table %s'), $tmp_tbl_link); + if (empty($query)) { + $query = Util::expandUserString( + $GLOBALS['cfg']['DefaultQueryTable'], 'backquote' + ); + } + } + $legend .= ': ' . Util::showMySQLDocu('SELECT'); + + return array($legend, $query, $columns_list); + } + + /** + * return HTML for Sql Query Form Insert + * + * @param string $query query to display in the textarea + * @param string $delimiter default delimiter to use + * + * @return string + * + * @usedby self::getHtml() + */ + public static function getHtmlForInsert( + $query = '', $delimiter = ';' + ) { + // enable auto select text in textarea + if ($GLOBALS['cfg']['TextareaAutoSelect']) { + $auto_sel = ' onclick="selectContent(this, sql_box_locked, true);"'; + } else { + $auto_sel = ''; + } + + $locking = ''; + $height = $GLOBALS['cfg']['TextareaRows'] * 2; + + list($legend, $query, $columns_list) = self::init($query); + + if (! empty($columns_list)) { + $sqlquerycontainer_id = 'sqlquerycontainer'; + } else { + $sqlquerycontainer_id = 'sqlquerycontainerfull'; + } + + $html = '' + . '
    ' + . '
    '; + $html .= '' . $legend . ''; + $html .= '
    '; + $html .= '
    ' + . ''; + $html .= '
    '; + // Add buttons to generate query easily for + // select all, single select, insert, update and delete + if (! empty($columns_list)) { + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + } + $html .= ''; + if ($GLOBALS['cfg']['CodemirrorEnable']) { + $html .= ''; + } + $html .= ''; + + // parameter binding + $html .= '
    '; + $html .= ''; + $html .= ''; + $html .= Util::showDocu('faq', 'faq6-40'); + $html .= '
    '; + $html .= '
    '; + + $html .= '
    ' . "\n"; + + if (! empty($columns_list)) { + $html .= '
    ' + . '' + . '' + . '
    '; + if (Util::showIcons('ActionLinksMode')) { + $html .= ''; + } else { + $html .= ''; + } + $html .= '
    ' . "\n" + . '
    ' . "\n"; + } + + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + + $cfgBookmark = Bookmark::getParams($GLOBALS['cfg']['Server']['user']); + if ($cfgBookmark) { + $html .= '
    '; + $html .= '
    '; + $html .= ''; + $html .= ''; + $html .= '
    '; + $html .= '
    '; + $html .= ''; + $html .= ''; + $html .= '
    '; + $html .= '
    '; + $html .= ''; + $html .= ''; + $html .= '
    '; + $html .= '
    '; + } + + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n" + . '
    ' . "\n"; + + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + + $html .= '
    '; + $html .= '' . "\n"; + $html .= ' ]'; + $html .= '
    '; + + $html .= '
    '; + $html .= '' + . ''; + $html .= '
    '; + + $html .= '
    '; + $html .= '' + . ''; + $html .= '
    '; + + $html .= '
    '; + $html .= '' + . ''; + $html .= '
    '; + + // Disable/Enable foreign key checks + $html .= '
    '; + $html .= Util::getFKCheckbox(); + $html .= '
    '; + + $html .= '' . "\n"; + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + + return $html; + } + + /** + * return HTML for sql Query Form Bookmark + * + * @return string|null + * + * @usedby self::getHtml() + */ + public static function getHtmlForBookmark() + { + $bookmark_list = Bookmark::getList( + $GLOBALS['dbi'], + $GLOBALS['cfg']['Server']['user'], + $GLOBALS['db'] + ); + if (empty($bookmark_list) || count($bookmark_list) < 1) { + return null; + } + + $html = '
    '; + $html .= ''; + $html .= __('Bookmarked SQL query') . '' . "\n"; + $html .= '
    '; + $html .= ' ' . "\n"; + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + $html .= '' + . '' . "\n"; + $html .= '' + . '' . "\n"; + $html .= '' + . '' . "\n"; + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + $html .= __('Variables'); + $html .= Util::showDocu('faq', 'faqbookmark'); + $html .= '
    '; + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + + $html .= '
    '; + $html .= ''; + $html .= '
    ' . "\n"; + $html .= '
    ' . "\n"; + + return $html; + } +} diff --git a/phpMyAdmin/libraries/classes/StorageEngine.php b/phpMyAdmin/libraries/classes/StorageEngine.php new file mode 100755 index 0000000..c0e8662 --- /dev/null +++ b/phpMyAdmin/libraries/classes/StorageEngine.php @@ -0,0 +1,461 @@ +engine = $engine; + $this->title = $storage_engines[$engine]['Engine']; + $this->comment = (isset($storage_engines[$engine]['Comment']) + ? $storage_engines[$engine]['Comment'] + : ''); + switch ($storage_engines[$engine]['Support']) { + case 'DEFAULT': + $this->support = PMA_ENGINE_SUPPORT_DEFAULT; + break; + case 'YES': + $this->support = PMA_ENGINE_SUPPORT_YES; + break; + case 'DISABLED': + $this->support = PMA_ENGINE_SUPPORT_DISABLED; + break; + case 'NO': + default: + $this->support = PMA_ENGINE_SUPPORT_NO; + } + } + } + + /** + * Returns array of storage engines + * + * @static + * @staticvar array $storage_engines storage engines + * @access public + * @return string[] array of storage engines + */ + static public function getStorageEngines() + { + static $storage_engines = null; + + if (null == $storage_engines) { + $storage_engines + = $GLOBALS['dbi']->fetchResult('SHOW STORAGE ENGINES', 'Engine'); + if ($GLOBALS['dbi']->getVersion() >= 50708) { + $disabled = Util::cacheGet( + 'disabled_storage_engines', + function () { + return $GLOBALS['dbi']->fetchValue( + 'SELECT @@disabled_storage_engines' + ); + } + ); + foreach (explode(",", $disabled) as $engine) { + if (isset($storage_engines[$engine])) { + $storage_engines[$engine]['Support'] = 'DISABLED'; + } + } + } + } + + return $storage_engines; + } + + /** + * Returns HTML code for storage engine select box + * + * @param string $name The name of the select form element + * @param string $id The ID of the form field + * @param string $selected The selected engine + * @param boolean $offerUnavailableEngines Should unavailable storage + * engines be offered? + * @param boolean $addEmpty Whether to provide empty option + * + * @static + * @return string html selectbox + */ + static public function getHtmlSelect( + $name = 'engine', $id = null, + $selected = null, $offerUnavailableEngines = false, + $addEmpty = false + ) { + $selected = mb_strtolower($selected); + $output = '' . "\n"; + return $output; + } + + /** + * Loads the corresponding engine plugin, if available. + * + * @param string $engine The engine ID + * + * @return StorageEngine The engine plugin + * @static + */ + static public function getEngine($engine) + { + switch(mb_strtolower($engine)) { + case 'bdb': + return new Bdb($engine); + case 'berkeleydb': + return new Berkeleydb($engine); + case 'binlog': + return new Binlog($engine); + case 'innobase': + return new Innobase($engine); + case 'innodb': + return new Innodb($engine); + case 'memory': + return new Memory($engine); + case 'merge': + return new Merge($engine); + case 'mrg_myisam': + return new MrgMyisam($engine); + case 'myisam': + return new Myisam($engine); + case 'ndbcluster': + return new Ndbcluster($engine); + case 'pbxt': + return new Pbxt($engine); + case 'performance_schema': + return new PerformanceSchema($engine); + default: + return new StorageEngine($engine); + } + } + + /** + * Returns true if given engine name is supported/valid, otherwise false + * + * @param string $engine name of engine + * + * @static + * @return boolean whether $engine is valid or not + */ + static public function isValid($engine) + { + if ($engine == "PBMS") { + return true; + } + $storage_engines = self::getStorageEngines(); + return isset($storage_engines[$engine]); + } + + /** + * Returns as HTML table of the engine's server variables + * + * @return string The table that was generated based on the retrieved + * information + */ + public function getHtmlVariables() + { + $ret = ''; + + foreach ($this->getVariablesStatus() as $details) { + $ret .= '' . "\n" + . ' ' . "\n"; + if (! empty($details['desc'])) { + $ret .= ' ' + . Util::showHint($details['desc']) + . "\n"; + } + $ret .= ' ' . "\n" + . ' ' . htmlspecialchars($details['title']) . '' + . "\n" + . ' '; + switch ($details['type']) { + case PMA_ENGINE_DETAILS_TYPE_SIZE: + $parsed_size = $this->resolveTypeSize($details['value']); + $ret .= $parsed_size[0] . ' ' . $parsed_size[1]; + unset($parsed_size); + break; + case PMA_ENGINE_DETAILS_TYPE_NUMERIC: + $ret .= Util::formatNumber($details['value']) . ' '; + break; + default: + $ret .= htmlspecialchars($details['value']) . ' '; + } + $ret .= '' . "\n" + . '' . "\n"; + } + + if (! $ret) { + $ret = '

    ' . "\n" + . ' ' + . __( + 'There is no detailed status information available for this ' + . 'storage engine.' + ) + . "\n" + . '

    ' . "\n"; + } else { + $ret = '' . "\n" . $ret . '
    ' . "\n"; + } + + return $ret; + } + + /** + * Returns the engine specific handling for + * PMA_ENGINE_DETAILS_TYPE_SIZE type variables. + * + * This function should be overridden when + * PMA_ENGINE_DETAILS_TYPE_SIZE type needs to be + * handled differently for a particular engine. + * + * @param integer $value Value to format + * + * @return string the formatted value and its unit + */ + public function resolveTypeSize($value) + { + return Util::formatByteDown($value); + } + + /** + * Returns array with detailed info about engine specific server variables + * + * @return array array with detailed info about specific engine server variables + */ + public function getVariablesStatus() + { + $variables = $this->getVariables(); + $like = $this->getVariablesLikePattern(); + + if ($like) { + $like = " LIKE '" . $like . "' "; + } else { + $like = ''; + } + + $mysql_vars = array(); + + $sql_query = 'SHOW GLOBAL VARIABLES ' . $like . ';'; + $res = $GLOBALS['dbi']->query($sql_query); + while ($row = $GLOBALS['dbi']->fetchAssoc($res)) { + if (isset($variables[$row['Variable_name']])) { + $mysql_vars[$row['Variable_name']] + = $variables[$row['Variable_name']]; + } elseif (! $like + && mb_strpos(mb_strtolower($row['Variable_name']), mb_strtolower($this->engine)) !== 0 + ) { + continue; + } + $mysql_vars[$row['Variable_name']]['value'] = $row['Value']; + + if (empty($mysql_vars[$row['Variable_name']]['title'])) { + $mysql_vars[$row['Variable_name']]['title'] = $row['Variable_name']; + } + + if (! isset($mysql_vars[$row['Variable_name']]['type'])) { + $mysql_vars[$row['Variable_name']]['type'] + = PMA_ENGINE_DETAILS_TYPE_PLAINTEXT; + } + } + $GLOBALS['dbi']->freeResult($res); + + return $mysql_vars; + } + + /** + * Reveals the engine's title + * + * @return string The title + */ + public function getTitle() + { + return $this->title; + } + + /** + * Fetches the server's comment about this engine + * + * @return string The comment + */ + public function getComment() + { + return $this->comment; + } + + /** + * Information message on whether this storage engine is supported + * + * @return string The localized message. + */ + public function getSupportInformationMessage() + { + switch ($this->support) { + case PMA_ENGINE_SUPPORT_DEFAULT: + $message = __('%s is the default storage engine on this MySQL server.'); + break; + case PMA_ENGINE_SUPPORT_YES: + $message = __('%s is available on this MySQL server.'); + break; + case PMA_ENGINE_SUPPORT_DISABLED: + $message = __('%s has been disabled for this MySQL server.'); + break; + case PMA_ENGINE_SUPPORT_NO: + default: + $message = __( + 'This MySQL server does not support the %s storage engine.' + ); + } + return sprintf($message, htmlspecialchars($this->title)); + } + + /** + * Generates a list of MySQL variables that provide information about this + * engine. This function should be overridden when extending this class + * for a particular engine. + * + * @return array The list of variables. + */ + public function getVariables() + { + return array(); + } + + /** + * Returns string with filename for the MySQL helppage + * about this storage engine + * + * @return string MySQL help page filename + */ + public function getMysqlHelpPage() + { + return $this->engine . '-storage-engine'; + } + + /** + * Returns the pattern to be used in the query for SQL variables + * related to the storage engine + * + * @return string SQL query LIKE pattern + */ + public function getVariablesLikePattern() + { + return ''; + } + + /** + * Returns a list of available information pages with labels + * + * @return string[] The list + */ + public function getInfoPages() + { + return array(); + } + + /** + * Generates the requested information page + * + * @param string $id page id + * + * @return string html output + */ + public function getPage($id) + { + if (! array_key_exists($id, $this->getInfoPages())) { + return ''; + } + + $id = 'getPage' . $id; + + return $this->$id(); + } +} diff --git a/phpMyAdmin/libraries/classes/SubPartition.php b/phpMyAdmin/libraries/classes/SubPartition.php new file mode 100755 index 0000000..d3f6be1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/SubPartition.php @@ -0,0 +1,180 @@ +db = $row['TABLE_SCHEMA']; + $this->table = $row['TABLE_NAME']; + $this->loadData($row); + } + + /** + * Loads data from the fetched row from information_schema.PARTITIONS + * + * @param array $row fetched row + * + * @return void + */ + protected function loadData(array $row) + { + $this->name = $row['SUBPARTITION_NAME']; + $this->ordinal = $row['SUBPARTITION_ORDINAL_POSITION']; + $this->method = $row['SUBPARTITION_METHOD']; + $this->expression = $row['SUBPARTITION_EXPRESSION']; + $this->loadCommonData($row); + } + + /** + * Loads some data that is common to both partitions and sub partitions + * + * @param array $row fetched row + * + * @return void + */ + protected function loadCommonData(array $row) + { + $this->rows = $row['TABLE_ROWS']; + $this->dataLength = $row['DATA_LENGTH']; + $this->indexLength = $row['INDEX_LENGTH']; + $this->comment = $row['PARTITION_COMMENT']; + } + + /** + * Return the partition name + * + * @return string partition name + */ + public function getName() + { + return $this->name; + } + + /** + * Return the ordinal of the partition + * + * @return number the ordinal + */ + public function getOrdinal() + { + return $this->ordinal; + } + + /** + * Returns the partition method + * + * @return string partition method + */ + public function getMethod() + { + return $this->method; + } + + /** + * Returns the partition expression + * + * @return string partition expression + */ + public function getExpression() + { + return $this->expression; + } + + /** + * Returns the number of data rows + * + * @return integer number of rows + */ + public function getRows() + { + return $this->rows; + } + + /** + * Returns the data length + * + * @return integer data length + */ + public function getDataLength() + { + return $this->dataLength; + } + + /** + * Returns the index length + * + * @return integer index length + */ + public function getIndexLength() + { + return $this->indexLength; + } + + /** + * Returns the partition comment + * + * @return string partition comment + */ + public function getComment() + { + return $this->comment; + } +} diff --git a/phpMyAdmin/libraries/classes/SysInfo.php b/phpMyAdmin/libraries/classes/SysInfo.php new file mode 100755 index 0000000..f33d9e1 --- /dev/null +++ b/phpMyAdmin/libraries/classes/SysInfo.php @@ -0,0 +1,64 @@ +supported()) { + return $ret; + } + } + + return new SysInfoBase(); + } +} diff --git a/phpMyAdmin/libraries/classes/SysInfoBase.php b/phpMyAdmin/libraries/classes/SysInfoBase.php new file mode 100755 index 0000000..3052b1e --- /dev/null +++ b/phpMyAdmin/libraries/classes/SysInfoBase.php @@ -0,0 +1,48 @@ + 0); + } + + /** + * Gets information about memory usage + * + * @return array with memory usage data + */ + public function memory() + { + return array(); + } + + /** + * Checks whether class is supported in this environment + * + * @return true on success + */ + public function supported() + { + return true; + } +} diff --git a/phpMyAdmin/libraries/classes/SysInfoLinux.php b/phpMyAdmin/libraries/classes/SysInfoLinux.php new file mode 100755 index 0000000..3fc4f61 --- /dev/null +++ b/phpMyAdmin/libraries/classes/SysInfoLinux.php @@ -0,0 +1,94 @@ + $nums[1] + $nums[2] + $nums[3], + 'idle' => intval($nums[4]), + ); + } + + /** + * Checks whether class is supported in this environment + * + * @return true on success + */ + public function supported() + { + return @is_readable('/proc/meminfo') && @is_readable('/proc/stat'); + } + + /** + * Gets information about memory usage + * + * @return array with memory usage data + */ + function memory() + { + preg_match_all( + SysInfo::MEMORY_REGEXP, + file_get_contents('/proc/meminfo'), + $matches + ); + + $mem = array_combine($matches[1], $matches[2]); + + $defaults = array( + 'MemTotal' => 0, + 'MemFree' => 0, + 'Cached' => 0, + 'Buffers' => 0, + 'SwapTotal' => 0, + 'SwapFree' => 0, + 'SwapCached' => 0, + ); + + $mem = array_merge($defaults, $mem); + + foreach ($mem as $idx => $value) { + $mem[$idx] = intval($value); + } + + $mem['MemUsed'] = $mem['MemTotal'] + - $mem['MemFree'] - $mem['Cached'] - $mem['Buffers']; + + $mem['SwapUsed'] = $mem['SwapTotal'] + - $mem['SwapFree'] - $mem['SwapCached']; + + return $mem; + } +} diff --git a/phpMyAdmin/libraries/classes/SysInfoSunOS.php b/phpMyAdmin/libraries/classes/SysInfoSunOS.php new file mode 100755 index 0000000..99390e8 --- /dev/null +++ b/phpMyAdmin/libraries/classes/SysInfoSunOS.php @@ -0,0 +1,82 @@ +_kstat('unix:0:system_misc:avenrun_1min'); + + return array('loadavg' => $load1); + } + + /** + * Checks whether class is supported in this environment + * + * @return true on success + */ + public function supported() + { + return @is_readable('/proc/meminfo'); + } + + /** + * Gets information about memory usage + * + * @return array with memory usage data + */ + public function memory() + { + $pagesize = $this->_kstat('unix:0:seg_cache:slab_size'); + $mem = array(); + $mem['MemTotal'] + = $this->_kstat('unix:0:system_pages:pagestotal') * $pagesize; + $mem['MemUsed'] + = $this->_kstat('unix:0:system_pages:pageslocked') * $pagesize; + $mem['MemFree'] + = $this->_kstat('unix:0:system_pages:pagesfree') * $pagesize; + $mem['SwapTotal'] = $this->_kstat('unix:0:vminfo:swap_avail') / 1024; + $mem['SwapUsed'] = $this->_kstat('unix:0:vminfo:swap_alloc') / 1024; + $mem['SwapFree'] = $this->_kstat('unix:0:vminfo:swap_free') / 1024; + + return $mem; + } +} diff --git a/phpMyAdmin/libraries/classes/SysInfoWINNT.php b/phpMyAdmin/libraries/classes/SysInfoWINNT.php new file mode 100755 index 0000000..921d933 --- /dev/null +++ b/phpMyAdmin/libraries/classes/SysInfoWINNT.php @@ -0,0 +1,131 @@ +_wmi = null; + } else { + // initialize the wmi object + $objLocator = new COM('WbemScripting.SWbemLocator'); + $this->_wmi = $objLocator->ConnectServer(); + } + } + + /** + * Gets load information + * + * @return array with load data + */ + function loadavg() + { + $loadavg = ""; + $sum = 0; + $buffer = $this->_getWMI('Win32_Processor', array('LoadPercentage')); + + foreach ($buffer as $load) { + $value = $load['LoadPercentage']; + $loadavg .= $value . ' '; + $sum += $value; + } + + return array('loadavg' => $sum / count($buffer)); + } + + /** + * Checks whether class is supported in this environment + * + * @return true on success + */ + public function supported() + { + return !is_null($this->_wmi); + } + + /** + * Reads data from WMI + * + * @param string $strClass Class to read + * @param array $strValue Values to read + * + * @return array with results + */ + private function _getWMI($strClass, array $strValue = array()) + { + $arrData = array(); + + $objWEBM = $this->_wmi->Get($strClass); + $arrProp = $objWEBM->Properties_; + $arrWEBMCol = $objWEBM->Instances_(); + foreach ($arrWEBMCol as $objItem) { + $arrInstance = array(); + foreach ($arrProp as $propItem) { + $name = $propItem->Name; + if (empty($strValue) || in_array($name, $strValue)) { + $value = $objItem->$name; + if (is_string($value)) { + $arrInstance[$name] = trim($value); + } else { + $arrInstance[$name] = $value; + } + } + } + $arrData[] = $arrInstance; + } + + return $arrData; + } + + /** + * Gets information about memory usage + * + * @return array with memory usage data + */ + function memory() + { + $buffer = $this->_getWMI( + "Win32_OperatingSystem", + array('TotalVisibleMemorySize', 'FreePhysicalMemory') + ); + $mem = Array(); + $mem['MemTotal'] = $buffer[0]['TotalVisibleMemorySize']; + $mem['MemFree'] = $buffer[0]['FreePhysicalMemory']; + $mem['MemUsed'] = $mem['MemTotal'] - $mem['MemFree']; + + $buffer = $this->_getWMI('Win32_PageFileUsage'); + + $mem['SwapTotal'] = 0; + $mem['SwapUsed'] = 0; + $mem['SwapPeak'] = 0; + + foreach ($buffer as $swapdevice) { + $mem['SwapTotal'] += $swapdevice['AllocatedBaseSize'] * 1024; + $mem['SwapUsed'] += $swapdevice['CurrentUsage'] * 1024; + $mem['SwapPeak'] += $swapdevice['PeakUsage'] * 1024; + } + + return $mem; + } +} diff --git a/phpMyAdmin/libraries/classes/SystemDatabase.php b/phpMyAdmin/libraries/classes/SystemDatabase.php new file mode 100755 index 0000000..2242bed --- /dev/null +++ b/phpMyAdmin/libraries/classes/SystemDatabase.php @@ -0,0 +1,133 @@ +dbi = $dbi; + $this->relation = new Relation(); + } + + /** + * Get existing data on transformations applied for + * columns in a particular table + * + * @param string $db Database name looking for + * + * @return \mysqli_result Result of executed SQL query + */ + public function getExistingTransformationData($db) + { + $cfgRelation = $this->relation->getRelationsParam(); + + // Get the existing transformation details of the same database + // from pma__column_info table + $pma_transformation_sql = sprintf( + "SELECT * FROM %s.%s WHERE `db_name` = '%s'", + Util::backquote($cfgRelation['db']), + Util::backquote($cfgRelation['column_info']), + $GLOBALS['dbi']->escapeString($db) + ); + + return $this->dbi->tryQuery($pma_transformation_sql); + } + + /** + * Get SQL query for store new transformation details of a VIEW + * + * @param object $pma_transformation_data Result set of SQL execution + * @param array $column_map Details of VIEW columns + * @param string $view_name Name of the VIEW + * @param string $db Database name of the VIEW + * + * @return string $new_transformations_sql SQL query for new transformations + */ + function getNewTransformationDataSql( + $pma_transformation_data, array $column_map, $view_name, $db + ) { + $cfgRelation = $this->relation->getRelationsParam(); + + // Need to store new transformation details for VIEW + $new_transformations_sql = sprintf( + "INSERT INTO %s.%s (" + . "`db_name`, `table_name`, `column_name`, " + . "`comment`, `mimetype`, `transformation`, " + . "`transformation_options`) VALUES", + Util::backquote($cfgRelation['db']), + Util::backquote($cfgRelation['column_info']) + ); + + $column_count = 0; + $add_comma = false; + + while ($data_row = $this->dbi->fetchAssoc($pma_transformation_data)) { + + foreach ($column_map as $column) { + + if ($data_row['table_name'] != $column['table_name'] + || $data_row['column_name'] != $column['refering_column'] + ) { + continue; + } + + $new_transformations_sql .= sprintf( + "%s ('%s', '%s', '%s', '%s', '%s', '%s', '%s')", + $add_comma ? ', ' : '', + $db, + $view_name, + isset($column['real_column']) + ? $column['real_column'] + : $column['refering_column'], + $data_row['comment'], + $data_row['mimetype'], + $data_row['transformation'], + $GLOBALS['dbi']->escapeString( + $data_row['transformation_options'] + ) + ); + + $add_comma = true; + $column_count++; + break; + } + + if ($column_count == count($column_map)) { + break; + } + } + + return ($column_count > 0) ? $new_transformations_sql : ''; + } +} diff --git a/phpMyAdmin/libraries/classes/Table.php b/phpMyAdmin/libraries/classes/Table.php new file mode 100755 index 0000000..b9f7233 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Table.php @@ -0,0 +1,2648 @@ +_dbi = $dbi; + $this->_name = $table_name; + $this->_db_name = $db_name; + $this->relation = new Relation(); + } + + /** + * returns table name + * + * @see Table::getName() + * @return string table name + */ + public function __toString() + { + return $this->getName(); + } + + /** + * Table getter + * + * @param string $table_name table name + * @param string $db_name database name + * @param DatabaseInterface $dbi database interface for the table + * + * @return Table + */ + public static function get($table_name, $db_name, DatabaseInterface $dbi = null) + { + return new Table($table_name, $db_name, $dbi); + } + + /** + * return the last error + * + * @return string the last error + */ + public function getLastError() + { + return end($this->errors); + } + + /** + * return the last message + * + * @return string the last message + */ + public function getLastMessage() + { + return end($this->messages); + } + + /** + * returns table name + * + * @param boolean $backquoted whether to quote name with backticks `` + * + * @return string table name + */ + public function getName($backquoted = false) + { + if ($backquoted) { + return Util::backquote($this->_name); + } + return $this->_name; + } + + /** + * returns database name for this table + * + * @param boolean $backquoted whether to quote name with backticks `` + * + * @return string database name for this table + */ + public function getDbName($backquoted = false) + { + if ($backquoted) { + return Util::backquote($this->_db_name); + } + return $this->_db_name; + } + + /** + * returns full name for table, including database name + * + * @param boolean $backquoted whether to quote name with backticks `` + * + * @return string + */ + public function getFullName($backquoted = false) + { + return $this->getDbName($backquoted) . '.' + . $this->getName($backquoted); + } + + + /** + * Checks the storage engine used to create table + * + * @param array|string $engine Checks the table engine against an + * array of engine strings or a single string, should be uppercase + * + * @return bool True, if $engine matches the storage engine for the table, + * False otherwise. + */ + public function isEngine($engine) + { + $tbl_storage_engine = $this->getStorageEngine(); + + if (is_array($engine)){ + foreach($engine as $e){ + if($e == $tbl_storage_engine){ + return true; + } + } + return false; + }else{ + return $tbl_storage_engine == $engine; + } + } + + /** + * returns whether the table is actually a view + * + * @return boolean whether the given is a view + */ + public function isView() + { + $db = $this->_db_name; + $table = $this->_name; + if (empty($db) || empty($table)) { + return false; + } + + // use cached data or load information with SHOW command + if ($this->_dbi->getCachedTableContent(array($db, $table)) != null + || $GLOBALS['cfg']['Server']['DisableIS'] + ) { + $type = $this->getStatusInfo('TABLE_TYPE'); + return $type == 'VIEW' || $type == 'SYSTEM VIEW'; + } + + // information_schema tables are 'SYSTEM VIEW's + if ($db == 'information_schema') { + return true; + } + + // query information_schema + $result = $this->_dbi->fetchResult( + "SELECT TABLE_NAME + FROM information_schema.VIEWS + WHERE TABLE_SCHEMA = '" . $GLOBALS['dbi']->escapeString($db) . "' + AND TABLE_NAME = '" . $GLOBALS['dbi']->escapeString($table) . "'" + ); + return $result ? true : false; + } + + /** + * Returns whether the table is actually an updatable view + * + * @return boolean whether the given is an updatable view + */ + public function isUpdatableView() + { + if (empty($this->_db_name) || empty($this->_name)) { + return false; + } + + $result = $this->_dbi->fetchResult( + "SELECT TABLE_NAME + FROM information_schema.VIEWS + WHERE TABLE_SCHEMA = '" . $GLOBALS['dbi']->escapeString($this->_db_name) . "' + AND TABLE_NAME = '" . $GLOBALS['dbi']->escapeString($this->_name) . "' + AND IS_UPDATABLE = 'YES'" + ); + return $result ? true : false; + } + + /** + * Checks if this is a merge table + * + * If the ENGINE of the table is MERGE or MRG_MYISAM (alias), + * this is a merge table. + * + * @return boolean true if it is a merge table + */ + public function isMerge() + { + return $this->isEngine(array('MERGE', 'MRG_MYISAM')); + } + + /** + * Returns full table status info, or specific if $info provided + * this info is collected from information_schema + * + * @param string $info specific information to be fetched + * @param boolean $force_read read new rather than serving from cache + * @param boolean $disable_error if true, disables error message + * + * @todo DatabaseInterface::getTablesFull needs to be merged + * somehow into this class or at least better documented + * + * @return mixed + */ + public function getStatusInfo( + $info = null, + $force_read = false, + $disable_error = false + ) { + $db = $this->_db_name; + $table = $this->_name; + + if (! empty($_SESSION['is_multi_query'])) { + $disable_error = true; + } + + // sometimes there is only one entry (ExactRows) so + // we have to get the table's details + if ($this->_dbi->getCachedTableContent(array($db, $table)) == null + || $force_read + || count($this->_dbi->getCachedTableContent(array($db, $table))) == 1 + ) { + $this->_dbi->getTablesFull($db, $table); + } + + if ($this->_dbi->getCachedTableContent(array($db, $table)) == null) { + // happens when we enter the table creation dialog + // or when we really did not get any status info, for example + // when $table == 'TABLE_NAMES' after the user tried SHOW TABLES + return ''; + } + + if (null === $info) { + return $this->_dbi->getCachedTableContent(array($db, $table)); + } + + // array_key_exists allows for null values + if (!array_key_exists( + $info, $this->_dbi->getCachedTableContent(array($db, $table)) + ) + ) { + if (! $disable_error) { + trigger_error( + __('Unknown table status:') . ' ' . $info, + E_USER_WARNING + ); + } + return false; + } + + return $this->_dbi->getCachedTableContent(array($db, $table, $info)); + } + + /** + * Returns the Table storage Engine for current table. + * + * @return string Return storage engine info if it is set for + * the selected table else return blank. + */ + public function getStorageEngine() { + $table_storage_engine = $this->getStatusInfo('ENGINE', false, true); + if ($table_storage_engine === false) { + return ''; + } + return strtoupper($table_storage_engine); + } + + /** + * Returns the comments for current table. + * + * @return string Return comment info if it is set for the selected table or return blank. + */ + public function getComment() { + $table_comment = $this->getStatusInfo('TABLE_COMMENT', false, true); + if ($table_comment === false) { + return ''; + } + return $table_comment; + } + + /** + * Returns the collation for current table. + * + * @return string Return blank if collation is empty else return the collation info from table info. + */ + public function getCollation() { + $table_collation = $this->getStatusInfo('TABLE_COLLATION', false, true); + if ($table_collation === false) { + return ''; + } + return $table_collation; + } + + /** + * Returns the info about no of rows for current table. + * + * @return integer Return no of rows info if it is not null for the selected table or return 0. + */ + public function getNumRows() { + $table_num_row_info = $this->getStatusInfo('TABLE_ROWS', false, true); + if (false === $table_num_row_info) { + $table_num_row_info = $this->_dbi->getTable($this->_db_name, $showtable['Name']) + ->countRecords(true); + } + return $table_num_row_info ? $table_num_row_info : 0 ; + } + + /** + * Returns the Row format for current table. + * + * @return string Return table row format info if it is set for the selected table or return blank. + */ + public function getRowFormat() { + $table_row_format = $this->getStatusInfo('ROW_FORMAT', false, true); + if ($table_row_format === false) { + return ''; + } + return $table_row_format; + } + + /** + * Returns the auto increment option for current table. + * + * @return integer Return auto increment info if it is set for the selected table or return blank. + */ + public function getAutoIncrement() { + $table_auto_increment = $this->getStatusInfo('AUTO_INCREMENT', false, true); + return isset($table_auto_increment) ? $table_auto_increment : ''; + } + + /** + * Returns the array for CREATE statement for current table. + * @return array Return options array info if it is set for the selected table or return blank. + */ + public function getCreateOptions() { + $table_options = $this->getStatusInfo('CREATE_OPTIONS', false, true); + $create_options_tmp = empty($table_options) ? array() : explode(' ', $table_options); + $create_options = array(); + // export create options by its name as variables into global namespace + // f.e. pack_keys=1 becomes available as $pack_keys with value of '1' + // unset($pack_keys); + foreach ($create_options_tmp as $each_create_option) { + $each_create_option = explode('=', $each_create_option); + if (isset($each_create_option[1])) { + // ensure there is no ambiguity for PHP 5 and 7 + $create_options[$each_create_option[0]] = $each_create_option[1]; + } + } + // we need explicit DEFAULT value here (different from '0') + $create_options['pack_keys'] = (! isset($create_options['pack_keys']) || strlen($create_options['pack_keys']) == 0) + ? 'DEFAULT' + : $create_options['pack_keys']; + return $create_options; + } + + /** + * generates column specification for ALTER or CREATE TABLE syntax + * + * @param string $name name + * @param string $type type ('INT', 'VARCHAR', 'BIT', ...) + * @param string $length length ('2', '5,2', '', ...) + * @param string $attribute attribute + * @param string $collation collation + * @param bool|string $null with 'NULL' or 'NOT NULL' + * @param string $default_type whether default is CURRENT_TIMESTAMP, + * NULL, NONE, USER_DEFINED + * @param string $default_value default value for USER_DEFINED + * default type + * @param string $extra 'AUTO_INCREMENT' + * @param string $comment field comment + * @param string $virtuality virtuality of the column + * @param string $expression expression for the virtual column + * @param string $move_to new position for column + * + * @todo move into class PMA_Column + * @todo on the interface, some js to clear the default value when the + * default current_timestamp is checked + * + * @return string field specification + */ + static function generateFieldSpec($name, $type, $length = '', + $attribute = '', $collation = '', $null = false, + $default_type = 'USER_DEFINED', $default_value = '', $extra = '', + $comment = '', $virtuality = '', $expression = '', $move_to = '' + ) { + $is_timestamp = mb_strpos( + mb_strtoupper($type), + 'TIMESTAMP' + ) !== false; + + $query = Util::backquote($name) . ' ' . $type; + + // allow the possibility of a length for TIME, DATETIME and TIMESTAMP + // (will work on MySQL >= 5.6.4) + // + // MySQL permits a non-standard syntax for FLOAT and DOUBLE, + // see https://dev.mysql.com/doc/refman/5.5/en/floating-point-types.html + // + $pattern = '@^(DATE|TINYBLOB|TINYTEXT|BLOB|TEXT|' + . 'MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|SERIAL|BOOLEAN|UUID)$@i'; + if (strlen($length) !== 0 && ! preg_match($pattern, $type)) { + // Note: The variable $length here can contain several other things + // besides length - ENUM/SET value or length of DECIMAL (eg. 12,3) + // so we can't just convert it to integer + $query .= '(' . $length . ')'; + } + if ($attribute != '') { + $query .= ' ' . $attribute; + + if ($is_timestamp + && preg_match('/TIMESTAMP/i', $attribute) + && strlen($length) !== 0 + && $length !== 0 + ) { + $query .= '(' . $length . ')'; + } + } + + // if column is virtual, check if server type is Mysql as only Mysql server + // supports extra column properties + $isVirtualColMysql = $virtuality && in_array(Util::getServerType(), array('MySQL', 'Percona Server')); + // if column is virtual, check if server type is MariaDB as MariaDB server + // supports no extra virtual column properties except CHARACTER SET for text column types + $isVirtualColMariaDB = $virtuality && Util::getServerType() === 'MariaDB'; + + $matches = preg_match( + '@^(TINYTEXT|TEXT|MEDIUMTEXT|LONGTEXT|VARCHAR|CHAR|ENUM|SET)$@i', + $type + ); + if (! empty($collation) && $collation != 'NULL' && $matches) { + $query .= Util::getCharsetQueryPart( + $isVirtualColMariaDB ? preg_replace('~_.+~s', '', $collation) : $collation, + true + ); + } + + if ($virtuality) { + $query .= ' AS (' . $expression . ') ' . $virtuality; + } + + if (! $virtuality || $isVirtualColMysql) { + if ($null !== false) { + if ($null == 'YES') { + $query .= ' NULL'; + } else { + $query .= ' NOT NULL'; + } + } + + if (! $virtuality) { + switch ($default_type) { + case 'USER_DEFINED' : + if ($is_timestamp && $default_value === '0') { + // a TIMESTAMP does not accept DEFAULT '0' + // but DEFAULT 0 works + $query .= ' DEFAULT 0'; + } elseif ($type == 'BIT') { + $query .= ' DEFAULT b\'' + . preg_replace('/[^01]/', '0', $default_value) + . '\''; + } elseif ($type == 'BOOLEAN') { + if (preg_match('/^1|T|TRUE|YES$/i', $default_value)) { + $query .= ' DEFAULT TRUE'; + } elseif (preg_match('/^0|F|FALSE|NO$/i', $default_value)) { + $query .= ' DEFAULT FALSE'; + } else { + // Invalid BOOLEAN value + $query .= ' DEFAULT \'' + . $GLOBALS['dbi']->escapeString($default_value) . '\''; + } + } elseif ($type == 'BINARY' || $type == 'VARBINARY') { + $query .= ' DEFAULT 0x' . $default_value; + } else { + $query .= ' DEFAULT \'' + . $GLOBALS['dbi']->escapeString($default_value) . '\''; + } + break; + /** @noinspection PhpMissingBreakStatementInspection */ + case 'NULL' : + // If user uncheck null checkbox and not change default value null, + // default value will be ignored. + if ($null !== false && $null !== 'YES') { + break; + } + // else fall-through intended, no break here + case 'CURRENT_TIMESTAMP' : + case 'current_timestamp()': + $query .= ' DEFAULT ' . $default_type; + + if (strlen($length) !== 0 + && $length !== 0 + && $is_timestamp + && $default_type !== 'NULL' // Not to be added in case of NULL + ) { + $query .= '(' . $length . ')'; + } + break; + case 'NONE' : + default : + break; + } + } + + if (!empty($extra)) { + if ($virtuality) { + $extra = trim(preg_replace('~^\s*AUTO_INCREMENT\s*~is', ' ', $extra)); + } + + $query .= ' ' . $extra; + } + } + + if (!empty($comment)) { + $query .= " COMMENT '" . $GLOBALS['dbi']->escapeString($comment) . "'"; + } + + // move column + if ($move_to == '-first') { // dash can't appear as part of column name + $query .= ' FIRST'; + } elseif ($move_to != '') { + $query .= ' AFTER ' . Util::backquote($move_to); + } + return $query; + } // end function + + /** + * Checks if the number of records in a table is at least equal to + * $min_records + * + * @param int $min_records Number of records to check for in a table + * + * @return bool True, if at least $min_records exist, False otherwise. + */ + public function checkIfMinRecordsExist($min_records = 0) + { + $check_query = 'SELECT '; + $fieldsToSelect = ''; + + $uniqueFields = $this->getUniqueColumns(true, false); + if (count($uniqueFields) > 0) { + $fieldsToSelect = implode(', ', $uniqueFields); + } else { + $indexedCols = $this->getIndexedColumns(true, false); + if (count($indexedCols) > 0) { + $fieldsToSelect = implode(', ', $indexedCols); + } else { + $fieldsToSelect = '*'; + } + } + + $check_query .= $fieldsToSelect + . ' FROM ' . $this->getFullName(true) + . ' LIMIT ' . $min_records; + + $res = $GLOBALS['dbi']->tryQuery( + $check_query + ); + + if ($res !== false) { + $num_records = $GLOBALS['dbi']->numRows($res); + if ($num_records >= $min_records) { + return true; + } + } + + return false; + } + + /** + * Counts and returns (or displays) the number of records in a table + * + * @param bool $force_exact whether to force an exact count + * + * @return mixed the number of records if "retain" param is true, + * otherwise true + */ + public function countRecords($force_exact = false) + { + $is_view = $this->isView(); + $db = $this->_db_name; + $table = $this->_name; + + if ($this->_dbi->getCachedTableContent(array($db, $table, 'ExactRows')) != null) { + $row_count = $this->_dbi->getCachedTableContent( + array($db, $table, 'ExactRows') + ); + return $row_count; + } + $row_count = false; + + if (! $force_exact) { + if (($this->_dbi->getCachedTableContent(array($db, $table, 'Rows')) == null) + && !$is_view + ) { + $tmp_tables = $this->_dbi->getTablesFull($db, $table); + if (isset($tmp_tables[$table])) { + $this->_dbi->cacheTableContent( + array($db, $table), + $tmp_tables[$table] + ); + } + } + if ($this->_dbi->getCachedTableContent(array($db, $table, 'Rows')) != null) { + $row_count = $this->_dbi->getCachedTableContent( + array($db, $table, 'Rows') + ); + } else { + $row_count = false; + } + } + // for a VIEW, $row_count is always false at this point + if (false !== $row_count + && $row_count >= $GLOBALS['cfg']['MaxExactCount'] + ) { + return $row_count; + } + + if (! $is_view) { + $row_count = $this->_dbi->fetchValue( + 'SELECT COUNT(*) FROM ' . Util::backquote($db) . '.' + . Util::backquote($table) + ); + } else { + // For complex views, even trying to get a partial record + // count could bring down a server, so we offer an + // alternative: setting MaxExactCountViews to 0 will bypass + // completely the record counting for views + + if ($GLOBALS['cfg']['MaxExactCountViews'] == 0) { + $row_count = false; + } else { + // Counting all rows of a VIEW could be too long, + // so use a LIMIT clause. + // Use try_query because it can fail (when a VIEW is + // based on a table that no longer exists) + $result = $this->_dbi->tryQuery( + 'SELECT 1 FROM ' . Util::backquote($db) . '.' + . Util::backquote($table) . ' LIMIT ' + . $GLOBALS['cfg']['MaxExactCountViews'], + DatabaseInterface::CONNECT_USER, + DatabaseInterface::QUERY_STORE + ); + if (!$this->_dbi->getError()) { + $row_count = $this->_dbi->numRows($result); + $this->_dbi->freeResult($result); + } + } + } + if ($row_count) { + $this->_dbi->cacheTableContent(array($db, $table, 'ExactRows'), $row_count); + } + + return $row_count; + } // end of the 'Table::countRecords()' function + + /** + * Generates column specification for ALTER syntax + * + * @param string $oldcol old column name + * @param string $newcol new column name + * @param string $type type ('INT', 'VARCHAR', 'BIT', ...) + * @param string $length length ('2', '5,2', '', ...) + * @param string $attribute attribute + * @param string $collation collation + * @param bool|string $null with 'NULL' or 'NOT NULL' + * @param string $default_type whether default is CURRENT_TIMESTAMP, + * NULL, NONE, USER_DEFINED + * @param string $default_value default value for USER_DEFINED default + * type + * @param string $extra 'AUTO_INCREMENT' + * @param string $comment field comment + * @param string $virtuality virtuality of the column + * @param string $expression expression for the virtual column + * @param string $move_to new position for column + * + * @see Table::generateFieldSpec() + * + * @return string field specification + */ + public static function generateAlter($oldcol, $newcol, $type, $length, + $attribute, $collation, $null, $default_type, $default_value, + $extra, $comment, $virtuality, $expression, $move_to + ) { + return Util::backquote($oldcol) . ' ' + . self::generateFieldSpec( + $newcol, $type, $length, $attribute, + $collation, $null, $default_type, $default_value, $extra, + $comment, $virtuality, $expression, $move_to + ); + } // end function + + /** + * Inserts existing entries in a PMA_* table by reading a value from an old + * entry + * + * @param string $work The array index, which Relation feature to + * check ('relwork', 'commwork', ...) + * @param string $pma_table The array index, which PMA-table to update + * ('bookmark', 'relation', ...) + * @param array $get_fields Which fields will be SELECT'ed from the old entry + * @param array $where_fields Which fields will be used for the WHERE query + * (array('FIELDNAME' => 'FIELDVALUE')) + * @param array $new_fields Which fields will be used as new VALUES. + * These are the important keys which differ + * from the old entry + * (array('FIELDNAME' => 'NEW FIELDVALUE')) + * + * @global relation variable + * + * @return int|boolean + */ + public static function duplicateInfo($work, $pma_table, array $get_fields, + array $where_fields, array $new_fields + ) { + $relation = new Relation(); + $last_id = -1; + + if (!isset($GLOBALS['cfgRelation']) || !$GLOBALS['cfgRelation'][$work]) { + return true; + } + + $select_parts = array(); + $row_fields = array(); + foreach ($get_fields as $get_field) { + $select_parts[] = Util::backquote($get_field); + $row_fields[$get_field] = 'cc'; + } + + $where_parts = array(); + foreach ($where_fields as $_where => $_value) { + $where_parts[] = Util::backquote($_where) . ' = \'' + . $GLOBALS['dbi']->escapeString($_value) . '\''; + } + + $new_parts = array(); + $new_value_parts = array(); + foreach ($new_fields as $_where => $_value) { + $new_parts[] = Util::backquote($_where); + $new_value_parts[] = $GLOBALS['dbi']->escapeString($_value); + } + + $table_copy_query = ' + SELECT ' . implode(', ', $select_parts) . ' + FROM ' . Util::backquote($GLOBALS['cfgRelation']['db']) . '.' + . Util::backquote($GLOBALS['cfgRelation'][$pma_table]) . ' + WHERE ' . implode(' AND ', $where_parts); + + // must use DatabaseInterface::QUERY_STORE here, since we execute + // another query inside the loop + $table_copy_rs = $relation->queryAsControlUser( + $table_copy_query, true, DatabaseInterface::QUERY_STORE + ); + + while ($table_copy_row = @$GLOBALS['dbi']->fetchAssoc($table_copy_rs)) { + $value_parts = array(); + foreach ($table_copy_row as $_key => $_val) { + if (isset($row_fields[$_key]) && $row_fields[$_key] == 'cc') { + $value_parts[] = $GLOBALS['dbi']->escapeString($_val); + } + } + + $new_table_query = 'INSERT IGNORE INTO ' + . Util::backquote($GLOBALS['cfgRelation']['db']) + . '.' . Util::backquote($GLOBALS['cfgRelation'][$pma_table]) + . ' (' . implode(', ', $select_parts) . ', ' + . implode(', ', $new_parts) . ') VALUES (\'' + . implode('\', \'', $value_parts) . '\', \'' + . implode('\', \'', $new_value_parts) . '\')'; + + $relation->queryAsControlUser($new_table_query); + $last_id = $GLOBALS['dbi']->insertId(); + } // end while + + $GLOBALS['dbi']->freeResult($table_copy_rs); + + return $last_id; + } // end of 'Table::duplicateInfo()' function + + /** + * Copies or renames table + * + * @param string $source_db source database + * @param string $source_table source table + * @param string $target_db target database + * @param string $target_table target table + * @param string $what what to be moved or copied (data, dataonly) + * @param bool $move whether to move + * @param string $mode mode + * + * @return bool true if success, false otherwise + */ + public static function moveCopy($source_db, $source_table, $target_db, + $target_table, $what, $move, $mode + ) { + global $err_url; + + $relation = new Relation(); + + // Try moving the tables directly, using native `RENAME` statement. + if ($move && $what == 'data') { + $tbl = new Table($source_table, $source_db); + if ($tbl->rename($target_table, $target_db)) { + $GLOBALS['message'] = $tbl->getLastMessage(); + return true; + } + } + + // Setting required export settings. + $GLOBALS['sql_backquotes'] = 1; + $GLOBALS['asfile'] = 1; + + // Ensuring the target database is valid. + if (! $GLOBALS['dblist']->databases->exists($source_db, $target_db)) { + if (! $GLOBALS['dblist']->databases->exists($source_db)) { + $GLOBALS['message'] = Message::rawError( + sprintf( + __('Source database `%s` was not found!'), + htmlspecialchars($source_db) + ) + ); + } + if (! $GLOBALS['dblist']->databases->exists($target_db)) { + $GLOBALS['message'] = Message::rawError( + sprintf( + __('Target database `%s` was not found!'), + htmlspecialchars($target_db) + ) + ); + } + return false; + } + + /** + * The full name of source table, quoted. + * @var string $source + */ + $source = Util::backquote($source_db) + . '.' . Util::backquote($source_table); + + // If the target database is not specified, the operation is taking + // place in the same database. + if (! isset($target_db) || strlen($target_db) === 0) { + $target_db = $source_db; + } + + // Selecting the database could avoid some problems with replicated + // databases, when moving table from replicated one to not replicated one. + $GLOBALS['dbi']->selectDb($target_db); + + /** + * The full name of target table, quoted. + * @var string $target + */ + $target = Util::backquote($target_db) + . '.' . Util::backquote($target_table); + + // No table is created when this is a data-only operation. + if ($what != 'dataonly') { + /** + * Instance used for exporting the current structure of the table. + * + * @var PhpMyAdmin\Plugins\Export\ExportSql + */ + $export_sql_plugin = Plugins::getPlugin( + "export", + "sql", + 'libraries/classes/Plugins/Export/', + array( + 'export_type' => 'table', + 'single_table' => false, + ) + ); + + $no_constraints_comments = true; + $GLOBALS['sql_constraints_query'] = ''; + // set the value of global sql_auto_increment variable + if (isset($_POST['sql_auto_increment'])) { + $GLOBALS['sql_auto_increment'] = $_POST['sql_auto_increment']; + } + + /** + * The old structure of the table.. + * @var string $sql_structure + */ + $sql_structure = $export_sql_plugin->getTableDef( + $source_db, $source_table, "\n", $err_url, false, false + ); + + unset($no_constraints_comments); + + // ----------------------------------------------------------------- + // Phase 0: Preparing structures used. + + /** + * The destination where the table is moved or copied to. + * @var Expression + */ + $destination = new Expression( + $target_db, $target_table, '' + ); + + // Find server's SQL mode so the builder can generate correct + // queries. + // One of the options that alters the behaviour is `ANSI_QUOTES`. + Context::setMode( + $GLOBALS['dbi']->fetchValue("SELECT @@sql_mode") + ); + + // ----------------------------------------------------------------- + // Phase 1: Dropping existent element of the same name (if exists + // and required). + + if (isset($_POST['drop_if_exists']) + && $_POST['drop_if_exists'] == 'true' + ) { + + /** + * Drop statement used for building the query. + * @var DropStatement $statement + */ + $statement = new DropStatement(); + + $tbl = new Table($target_db, $target_table); + + $statement->options = new OptionsArray( + array( + $tbl->isView() ? 'VIEW' : 'TABLE', + 'IF EXISTS', + ) + ); + + $statement->fields = array($destination); + + // Building the query. + $drop_query = $statement->build() . ';'; + + // Executing it. + $GLOBALS['dbi']->query($drop_query); + $GLOBALS['sql_query'] .= "\n" . $drop_query; + + // If an existing table gets deleted, maintain any entries for + // the PMA_* tables. + $maintain_relations = true; + } + + // ----------------------------------------------------------------- + // Phase 2: Generating the new query of this structure. + + /** + * The parser responsible for parsing the old queries. + * @var Parser $parser + */ + $parser = new Parser($sql_structure); + + if (!empty($parser->statements[0])) { + + /** + * The CREATE statement of this structure. + * @var \PhpMyAdmin\SqlParser\Statements\CreateStatement $statement + */ + $statement = $parser->statements[0]; + + // Changing the destination. + $statement->name = $destination; + + // Building back the query. + $sql_structure = $statement->build() . ';'; + + // Executing it. + $GLOBALS['dbi']->query($sql_structure); + $GLOBALS['sql_query'] .= "\n" . $sql_structure; + } + + // ----------------------------------------------------------------- + // Phase 3: Adding constraints. + // All constraint names are removed because they must be unique. + + if (($move || isset($GLOBALS['add_constraints'])) + && !empty($GLOBALS['sql_constraints_query']) + ) { + + $parser = new Parser($GLOBALS['sql_constraints_query']); + + /** + * The ALTER statement that generates the constraints. + * @var \PhpMyAdmin\SqlParser\Statements\AlterStatement $statement + */ + $statement = $parser->statements[0]; + + // Changing the altered table to the destination. + $statement->table = $destination; + + // Removing the name of the constraints. + foreach ($statement->altered as $idx => $altered) { + // All constraint names are removed because they must be unique. + if ($altered->options->has('CONSTRAINT')) { + $altered->field = null; + } + } + + // Building back the query. + $GLOBALS['sql_constraints_query'] = $statement->build() . ';'; + + // Executing it. + if ($mode == 'one_table') { + $GLOBALS['dbi']->query($GLOBALS['sql_constraints_query']); + } + $GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_constraints_query']; + if ($mode == 'one_table') { + unset($GLOBALS['sql_constraints_query']); + } + } + + // ----------------------------------------------------------------- + // Phase 4: Adding indexes. + // View phase 3. + + if (!empty($GLOBALS['sql_indexes'])) { + + $parser = new Parser($GLOBALS['sql_indexes']); + + $GLOBALS['sql_indexes'] = ''; + /** + * The ALTER statement that generates the indexes. + * @var \PhpMyAdmin\SqlParser\Statements\AlterStatement $statement + */ + foreach ($parser->statements as $statement) { + + // Changing the altered table to the destination. + $statement->table = $destination; + + // Removing the name of the constraints. + foreach ($statement->altered as $idx => $altered) { + // All constraint names are removed because they must be unique. + if ($altered->options->has('CONSTRAINT')) { + $altered->field = null; + } + } + + // Building back the query. + $sql_index = $statement->build() . ';'; + + // Executing it. + if ($mode == 'one_table' || $mode == 'db_copy') { + $GLOBALS['dbi']->query($sql_index); + } + + $GLOBALS['sql_indexes'] .= $sql_index; + } + + $GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_indexes']; + if ($mode == 'one_table' || $mode == 'db_copy') { + unset($GLOBALS['sql_indexes']); + } + } + + // ----------------------------------------------------------------- + // Phase 5: Adding AUTO_INCREMENT. + + if (! empty($GLOBALS['sql_auto_increments'])) { + if ($mode == 'one_table' || $mode == 'db_copy') { + + $parser = new Parser($GLOBALS['sql_auto_increments']); + + /** + * The ALTER statement that alters the AUTO_INCREMENT value. + * @var \PhpMyAdmin\SqlParser\Statements\AlterStatement $statement + */ + $statement = $parser->statements[0]; + + // Changing the altered table to the destination. + $statement->table = $destination; + + // Building back the query. + $GLOBALS['sql_auto_increments'] = $statement->build() . ';'; + + // Executing it. + $GLOBALS['dbi']->query($GLOBALS['sql_auto_increments']); + $GLOBALS['sql_query'] .= "\n" . $GLOBALS['sql_auto_increments']; + unset($GLOBALS['sql_auto_increments']); + } + } + } else { + $GLOBALS['sql_query'] = ''; + } + + $_table = new Table($target_table, $target_db); + // Copy the data unless this is a VIEW + if (($what == 'data' || $what == 'dataonly') + && ! $_table->isView() + ) { + $sql_set_mode = "SET SQL_MODE='NO_AUTO_VALUE_ON_ZERO'"; + $GLOBALS['dbi']->query($sql_set_mode); + $GLOBALS['sql_query'] .= "\n\n" . $sql_set_mode . ';'; + + $_old_table = new Table($source_table, $source_db); + $nonGeneratedCols = $_old_table->getNonGeneratedColumns(true); + if (count($nonGeneratedCols) > 0) { + $sql_insert_data = 'INSERT INTO ' . $target . '(' + . implode(', ', $nonGeneratedCols) + . ') SELECT ' . implode(', ', $nonGeneratedCols) + . ' FROM ' . $source; + + $GLOBALS['dbi']->query($sql_insert_data); + $GLOBALS['sql_query'] .= "\n\n" . $sql_insert_data . ';'; + } + } + + $relation->getRelationsParam(); + + // Drops old table if the user has requested to move it + if ($move) { + + // This could avoid some problems with replicated databases, when + // moving table from replicated one to not replicated one + $GLOBALS['dbi']->selectDb($source_db); + + $_source_table = new Table($source_table, $source_db); + if ($_source_table->isView()) { + $sql_drop_query = 'DROP VIEW'; + } else { + $sql_drop_query = 'DROP TABLE'; + } + $sql_drop_query .= ' ' . $source; + $GLOBALS['dbi']->query($sql_drop_query); + + // Renable table in configuration storage + $relation->renameTable( + $source_db, $target_db, + $source_table, $target_table + ); + + $GLOBALS['sql_query'] .= "\n\n" . $sql_drop_query . ';'; + // end if ($move) + return true; + } + + // we are copying + // Create new entries as duplicates from old PMA DBs + if ($what == 'dataonly' || isset($maintain_relations)) { + return true; + } + + if ($GLOBALS['cfgRelation']['commwork']) { + // Get all comments and MIME-Types for current table + $comments_copy_rs = $relation->queryAsControlUser( + 'SELECT column_name, comment' + . ($GLOBALS['cfgRelation']['mimework'] + ? ', mimetype, transformation, transformation_options' + : '') + . ' FROM ' + . Util::backquote($GLOBALS['cfgRelation']['db']) + . '.' + . Util::backquote($GLOBALS['cfgRelation']['column_info']) + . ' WHERE ' + . ' db_name = \'' + . $GLOBALS['dbi']->escapeString($source_db) . '\'' + . ' AND ' + . ' table_name = \'' + . $GLOBALS['dbi']->escapeString($source_table) . '\'' + ); + + // Write every comment as new copied entry. [MIME] + while ($comments_copy_row + = $GLOBALS['dbi']->fetchAssoc($comments_copy_rs)) { + $new_comment_query = 'REPLACE INTO ' + . Util::backquote($GLOBALS['cfgRelation']['db']) + . '.' . Util::backquote( + $GLOBALS['cfgRelation']['column_info'] + ) + . ' (db_name, table_name, column_name, comment' + . ($GLOBALS['cfgRelation']['mimework'] + ? ', mimetype, transformation, transformation_options' + : '') + . ') ' . ' VALUES(' . '\'' . $GLOBALS['dbi']->escapeString($target_db) + . '\',\'' . $GLOBALS['dbi']->escapeString($target_table) . '\',\'' + . $GLOBALS['dbi']->escapeString($comments_copy_row['column_name']) + . '\',\'' + . $GLOBALS['dbi']->escapeString($comments_copy_row['comment']) + . '\'' + . ($GLOBALS['cfgRelation']['mimework'] + ? ',\'' . $GLOBALS['dbi']->escapeString( + $comments_copy_row['mimetype'] + ) + . '\',' . '\'' . $GLOBALS['dbi']->escapeString( + $comments_copy_row['transformation'] + ) + . '\',' . '\'' . $GLOBALS['dbi']->escapeString( + $comments_copy_row['transformation_options'] + ) + . '\'' + : '') + . ')'; + $relation->queryAsControlUser($new_comment_query); + } // end while + $GLOBALS['dbi']->freeResult($comments_copy_rs); + unset($comments_copy_rs); + } + + // duplicating the bookmarks must not be done here, but + // just once per db + + $get_fields = array('display_field'); + $where_fields = array( + 'db_name' => $source_db, + 'table_name' => $source_table + ); + $new_fields = array( + 'db_name' => $target_db, + 'table_name' => $target_table + ); + self::duplicateInfo( + 'displaywork', + 'table_info', + $get_fields, + $where_fields, + $new_fields + ); + + /** + * @todo revise this code when we support cross-db relations + */ + $get_fields = array( + 'master_field', + 'foreign_table', + 'foreign_field' + ); + $where_fields = array( + 'master_db' => $source_db, + 'master_table' => $source_table + ); + $new_fields = array( + 'master_db' => $target_db, + 'foreign_db' => $target_db, + 'master_table' => $target_table + ); + self::duplicateInfo( + 'relwork', + 'relation', + $get_fields, + $where_fields, + $new_fields + ); + + $get_fields = array( + 'foreign_field', + 'master_table', + 'master_field' + ); + $where_fields = array( + 'foreign_db' => $source_db, + 'foreign_table' => $source_table + ); + $new_fields = array( + 'master_db' => $target_db, + 'foreign_db' => $target_db, + 'foreign_table' => $target_table + ); + self::duplicateInfo( + 'relwork', + 'relation', + $get_fields, + $where_fields, + $new_fields + ); + + /** + * @todo Can't get duplicating PDFs the right way. The + * page numbers always get screwed up independently from + * duplication because the numbers do not seem to be stored on a + * per-database basis. Would the author of pdf support please + * have a look at it? + * + $get_fields = array('page_descr'); + $where_fields = array('db_name' => $source_db); + $new_fields = array('db_name' => $target_db); + $last_id = self::duplicateInfo( + 'pdfwork', + 'pdf_pages', + $get_fields, + $where_fields, + $new_fields + ); + + if (isset($last_id) && $last_id >= 0) { + $get_fields = array('x', 'y'); + $where_fields = array( + 'db_name' => $source_db, + 'table_name' => $source_table + ); + $new_fields = array( + 'db_name' => $target_db, + 'table_name' => $target_table, + 'pdf_page_number' => $last_id + ); + self::duplicateInfo( + 'pdfwork', + 'table_coords', + $get_fields, + $where_fields, + $new_fields + ); + } + */ + + return true; + } + + /** + * checks if given name is a valid table name, + * currently if not empty, trailing spaces, '.', '/' and '\' + * + * @param string $table_name name to check + * @param boolean $is_backquoted whether this name is used inside backquotes or not + * + * @todo add check for valid chars in filename on current system/os + * @see https://dev.mysql.com/doc/refman/5.0/en/legal-names.html + * + * @return boolean whether the string is valid or not + */ + static function isValidName($table_name, $is_backquoted = false) + { + if ($table_name !== rtrim($table_name)) { + // trailing spaces not allowed even in backquotes + return false; + } + + if (strlen($table_name) === 0) { + // zero length + return false; + } + + if (! $is_backquoted && $table_name !== trim($table_name)) { + // spaces at the start or in between only allowed inside backquotes + return false; + } + + if (! $is_backquoted && preg_match('/^[a-zA-Z0-9_$]+$/', $table_name)) { + // only allow the above regex in unquoted identifiers + // see : https://dev.mysql.com/doc/refman/5.7/en/identifiers.html + return true; + } elseif ($is_backquoted) { + // If backquoted, all characters should be allowed (except w/ trailing spaces) + return true; + } + + // If not backquoted and doesn't follow the above regex + return false; + } + + /** + * renames table + * + * @param string $new_name new table name + * @param string $new_db new database name + * + * @return bool success + */ + public function rename($new_name, $new_db = null) + { + if ($GLOBALS['dbi']->getLowerCaseNames() === '1') { + $new_name = strtolower($new_name); + } + + if (null !== $new_db && $new_db !== $this->getDbName()) { + // Ensure the target is valid + if (! $GLOBALS['dblist']->databases->exists($new_db)) { + $this->errors[] = __('Invalid database:') . ' ' . $new_db; + return false; + } + } else { + $new_db = $this->getDbName(); + } + + $new_table = new Table($new_name, $new_db); + + if ($this->getFullName() === $new_table->getFullName()) { + return true; + } + + // Allow whitespaces (not trailing) in $new_name, + // since we are using $backquoted in getting the fullName of table + // below to be used in the query + if (! self::isValidName($new_name, true)) { + $this->errors[] = __('Invalid table name:') . ' ' + . $new_table->getFullName(); + return false; + } + + // If the table is moved to a different database drop its triggers first + $triggers = $this->_dbi->getTriggers( + $this->getDbName(), $this->getName(), '' + ); + $handle_triggers = $this->getDbName() != $new_db && $triggers; + if ($handle_triggers) { + foreach ($triggers as $trigger) { + $sql = 'DROP TRIGGER IF EXISTS ' + . Util::backquote($this->getDbName()) + . '.' . Util::backquote($trigger['name']) . ';'; + $this->_dbi->query($sql); + } + } + + /* + * tested also for a view, in MySQL 5.0.92, 5.1.55 and 5.5.13 + */ + $GLOBALS['sql_query'] = ' + RENAME TABLE ' . $this->getFullName(true) . ' + TO ' . $new_table->getFullName(true) . ';'; + // I don't think a specific error message for views is necessary + if (! $this->_dbi->query($GLOBALS['sql_query'])) { + // Restore triggers in the old database + if ($handle_triggers) { + $this->_dbi->selectDb($this->getDbName()); + foreach ($triggers as $trigger) { + $this->_dbi->query($trigger['create']); + } + } + $this->errors[] = sprintf( + __('Failed to rename table %1$s to %2$s!'), + $this->getFullName(), + $new_table->getFullName() + ); + return false; + } + + $old_name = $this->getName(); + $old_db = $this->getDbName(); + $this->_name = $new_name; + $this->_db_name = $new_db; + + // Renable table in configuration storage + $this->relation->renameTable( + $old_db, $new_db, + $old_name, $new_name + ); + + $this->messages[] = sprintf( + __('Table %1$s has been renamed to %2$s.'), + htmlspecialchars($old_name), + htmlspecialchars($new_name) + ); + return true; + } + + /** + * Get all unique columns + * + * returns an array with all columns with unique content, in fact these are + * all columns being single indexed in PRIMARY or UNIQUE + * + * e.g. + * - PRIMARY(id) // id + * - UNIQUE(name) // name + * - PRIMARY(fk_id1, fk_id2) // NONE + * - UNIQUE(x,y) // NONE + * + * @param bool $backquoted whether to quote name with backticks `` + * @param bool $fullName whether to include full name of the table as a prefix + * + * @return array + */ + public function getUniqueColumns($backquoted = true, $fullName = true) + { + $sql = $this->_dbi->getTableIndexesSql( + $this->getDbName(), + $this->getName(), + 'Non_unique = 0' + ); + $uniques = $this->_dbi->fetchResult( + $sql, + array('Key_name', null), + 'Column_name' + ); + + $return = array(); + foreach ($uniques as $index) { + if (count($index) > 1) { + continue; + } + if ($fullName) { + $possible_column = $this->getFullName($backquoted) . '.'; + } else { + $possible_column = ''; + } + if ($backquoted) { + $possible_column .= Util::backquote($index[0]); + } else { + $possible_column .= $index[0]; + } + // a column might have a primary and an unique index on it + if (! in_array($possible_column, $return)) { + $return[] = $possible_column; + } + } + + return $return; + } + + /** + * Formats lists of columns + * + * returns an array with all columns that make use of an index + * + * e.g. index(col1, col2) would return col1, col2 + * + * @param array $indexed column data + * @param bool $backquoted whether to quote name with backticks `` + * @param bool $fullName whether to include full name of the table as a prefix + * + * @return array + */ + private function _formatColumns(array $indexed, $backquoted, $fullName) + { + $return = array(); + foreach ($indexed as $column) { + $return[] = ($fullName ? $this->getFullName($backquoted) . '.' : '') + . ($backquoted ? Util::backquote($column) : $column); + } + + return $return; + } + + /** + * Get all indexed columns + * + * returns an array with all columns that make use of an index + * + * e.g. index(col1, col2) would return col1, col2 + * + * @param bool $backquoted whether to quote name with backticks `` + * @param bool $fullName whether to include full name of the table as a prefix + * + * @return array + */ + public function getIndexedColumns($backquoted = true, $fullName = true) + { + $sql = $this->_dbi->getTableIndexesSql( + $this->getDbName(), + $this->getName(), + '' + ); + $indexed = $this->_dbi->fetchResult($sql, 'Column_name', 'Column_name'); + + return $this->_formatColumns($indexed, $backquoted, $fullName); + } + + /** + * Get all columns + * + * returns an array with all columns + * + * @param bool $backquoted whether to quote name with backticks `` + * @param bool $fullName whether to include full name of the table as a prefix + * + * @return array + */ + public function getColumns($backquoted = true, $fullName = true) + { + $sql = 'SHOW COLUMNS FROM ' . $this->getFullName(true); + $indexed = $this->_dbi->fetchResult($sql, 'Field', 'Field'); + + return $this->_formatColumns($indexed, $backquoted, $fullName); + } + + /** + * Get meta info for fields in table + * + * @return mixed + */ + public function getColumnsMeta() + { + $move_columns_sql_query = sprintf( + 'SELECT * FROM %s.%s LIMIT 1', + Util::backquote($this->_db_name), + Util::backquote($this->_name) + ); + $move_columns_sql_result = $this->_dbi->tryQuery($move_columns_sql_query); + if ($move_columns_sql_result !== false) { + return $this->_dbi->getFieldsMeta($move_columns_sql_result); + } else { + // unsure how to reproduce but it was seen on the reporting server + return array(); + } + } + + /** + * Get non-generated columns in table + * + * @param bool $backquoted whether to quote name with backticks `` + * + * @return array + */ + public function getNonGeneratedColumns($backquoted = true) + { + $columns_meta_query = 'SHOW COLUMNS FROM ' . $this->getFullName(true); + $ret = array(); + + $columns_meta_query_result = $this->_dbi->fetchResult( + $columns_meta_query + ); + + if ($columns_meta_query_result + && $columns_meta_query_result !== false + ) { + foreach ($columns_meta_query_result as $column) { + $value = $column['Field']; + if ($backquoted === true) { + $value = Util::backquote($value); + } + + if (( + strpos($column['Extra'], 'GENERATED') === false + && strpos($column['Extra'], 'VIRTUAL') === false + ) || $column['Extra'] === 'DEFAULT_GENERATED') { + array_push($ret, $value); + } + } + } + + return $ret; + } + + /** + * Return UI preferences for this table from phpMyAdmin database. + * + * @return array + */ + protected function getUiPrefsFromDb() + { + $cfgRelation = $this->relation->getRelationsParam(); + $pma_table = Util::backquote($cfgRelation['db']) . "." + . Util::backquote($cfgRelation['table_uiprefs']); + + // Read from phpMyAdmin database + $sql_query = " SELECT `prefs` FROM " . $pma_table + . " WHERE `username` = '" . $GLOBALS['dbi']->escapeString($GLOBALS['cfg']['Server']['user']) . "'" + . " AND `db_name` = '" . $GLOBALS['dbi']->escapeString($this->_db_name) . "'" + . " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($this->_name) . "'"; + + $row = $this->_dbi->fetchArray($this->relation->queryAsControlUser($sql_query)); + if (isset($row[0])) { + return json_decode($row[0], true); + } + + return array(); + } + + /** + * Save this table's UI preferences into phpMyAdmin database. + * + * @return true|Message + */ + protected function saveUiPrefsToDb() + { + $cfgRelation = $this->relation->getRelationsParam(); + $pma_table = Util::backquote($cfgRelation['db']) . "." + . Util::backquote($cfgRelation['table_uiprefs']); + + $secureDbName = $GLOBALS['dbi']->escapeString($this->_db_name); + + $username = $GLOBALS['cfg']['Server']['user']; + $sql_query = " REPLACE INTO " . $pma_table + . " (username, db_name, table_name, prefs) VALUES ('" + . $GLOBALS['dbi']->escapeString($username) . "', '" . $secureDbName + . "', '" . $GLOBALS['dbi']->escapeString($this->_name) . "', '" + . $GLOBALS['dbi']->escapeString(json_encode($this->uiprefs)) . "')"; + + $success = $this->_dbi->tryQuery($sql_query, DatabaseInterface::CONNECT_CONTROL); + + if (!$success) { + $message = Message::error( + __('Could not save table UI preferences!') + ); + $message->addMessage( + Message::rawError( + $this->_dbi->getError(DatabaseInterface::CONNECT_CONTROL) + ), + '

    ' + ); + return $message; + } + + // Remove some old rows in table_uiprefs if it exceeds the configured + // maximum rows + $sql_query = 'SELECT COUNT(*) FROM ' . $pma_table; + $rows_count = $this->_dbi->fetchValue($sql_query); + $max_rows = $GLOBALS['cfg']['Server']['MaxTableUiprefs']; + if ($rows_count > $max_rows) { + $num_rows_to_delete = $rows_count - $max_rows; + $sql_query + = ' DELETE FROM ' . $pma_table . + ' ORDER BY last_update ASC' . + ' LIMIT ' . $num_rows_to_delete; + $success = $this->_dbi->tryQuery( + $sql_query, DatabaseInterface::CONNECT_CONTROL + ); + + if (!$success) { + $message = Message::error( + sprintf( + __( + 'Failed to cleanup table UI preferences (see ' . + '$cfg[\'Servers\'][$i][\'MaxTableUiprefs\'] %s)' + ), + Util::showDocu('config', 'cfg_Servers_MaxTableUiprefs') + ) + ); + $message->addMessage( + Message::rawError( + $this->_dbi->getError(DatabaseInterface::CONNECT_CONTROL) + ), + '

    ' + ); + return $message; + } + } + + return true; + } + + /** + * Loads the UI preferences for this table. + * If pmadb and table_uiprefs is set, it will load the UI preferences from + * phpMyAdmin database. + * + * @return void + */ + protected function loadUiPrefs() + { + $cfgRelation = $this->relation->getRelationsParam(); + $server_id = $GLOBALS['server']; + + // set session variable if it's still undefined + if (!isset($_SESSION['tmpval']['table_uiprefs'][$server_id][$this->_db_name][$this->_name])) { + // check whether we can get from pmadb + $_SESSION['tmpval']['table_uiprefs'][$server_id][$this->_db_name] + [$this->_name] = $cfgRelation['uiprefswork'] + ? $this->getUiPrefsFromDb() + : array(); + } + $this->uiprefs =& $_SESSION['tmpval']['table_uiprefs'][$server_id] + [$this->_db_name][$this->_name]; + } + + /** + * Get a property from UI preferences. + * Return false if the property is not found. + * Available property: + * - PROP_SORTED_COLUMN + * - PROP_COLUMN_ORDER + * - PROP_COLUMN_VISIB + * + * @param string $property property + * + * @return mixed + */ + public function getUiProp($property) + { + if (! isset($this->uiprefs)) { + $this->loadUiPrefs(); + } + + // do checking based on property + if ($property == self::PROP_SORTED_COLUMN) { + if (!isset($this->uiprefs[$property])) { + return false; + } + + if (!isset($_POST['discard_remembered_sort'])) { + // check if the column name exists in this table + $tmp = explode(' ', $this->uiprefs[$property]); + $colname = $tmp[0]; + //remove backquoting from colname + $colname = str_replace('`', '', $colname); + //get the available column name without backquoting + $avail_columns = $this->getColumns(false); + + foreach ($avail_columns as $each_col) { + // check if $each_col ends with $colname + if (substr_compare( + $each_col, + $colname, + mb_strlen($each_col) - mb_strlen($colname) + ) === 0 + ) { + return $this->uiprefs[$property]; + } + } + } + // remove the property, since it no longer exists in database + $this->removeUiProp($property); + return false; + } + + if ($property == self::PROP_COLUMN_ORDER + || $property == self::PROP_COLUMN_VISIB + ) { + if ($this->isView() || !isset($this->uiprefs[$property])) { + return false; + } + + // check if the table has not been modified + if ($this->getStatusInfo('Create_time') == $this->uiprefs['CREATE_TIME'] + ) { + return array_map('intval', $this->uiprefs[$property]); + } + + // remove the property, since the table has been modified + $this->removeUiProp($property); + return false; + } + + // default behaviour for other property: + return isset($this->uiprefs[$property]) ? $this->uiprefs[$property] : false; + } + + /** + * Set a property from UI preferences. + * If pmadb and table_uiprefs is set, it will save the UI preferences to + * phpMyAdmin database. + * Available property: + * - PROP_SORTED_COLUMN + * - PROP_COLUMN_ORDER + * - PROP_COLUMN_VISIB + * + * @param string $property Property + * @param mixed $value Value for the property + * @param string $table_create_time Needed for PROP_COLUMN_ORDER + * and PROP_COLUMN_VISIB + * + * @return boolean|Message + */ + public function setUiProp($property, $value, $table_create_time = null) + { + if (! isset($this->uiprefs)) { + $this->loadUiPrefs(); + } + // we want to save the create time if the property is PROP_COLUMN_ORDER + if (! $this->isView() + && ($property == self::PROP_COLUMN_ORDER + || $property == self::PROP_COLUMN_VISIB) + ) { + $curr_create_time = $this->getStatusInfo('CREATE_TIME'); + if (isset($table_create_time) + && $table_create_time == $curr_create_time + ) { + $this->uiprefs['CREATE_TIME'] = $curr_create_time; + } else { + // there is no $table_create_time, or + // supplied $table_create_time is older than current create time, + // so don't save + return Message::error( + sprintf( + __( + 'Cannot save UI property "%s". The changes made will ' . + 'not be persistent after you refresh this page. ' . + 'Please check if the table structure has been changed.' + ), + $property + ) + ); + } + } + // save the value + $this->uiprefs[$property] = $value; + + // check if pmadb is set + $cfgRelation = $this->relation->getRelationsParam(); + if ($cfgRelation['uiprefswork']) { + return $this->saveUiprefsToDb(); + } + return true; + } + + /** + * Remove a property from UI preferences. + * + * @param string $property the property + * + * @return true|Message + */ + public function removeUiProp($property) + { + if (! isset($this->uiprefs)) { + $this->loadUiPrefs(); + } + if (isset($this->uiprefs[$property])) { + unset($this->uiprefs[$property]); + + // check if pmadb is set + $cfgRelation = $this->relation->getRelationsParam(); + if ($cfgRelation['uiprefswork']) { + return $this->saveUiprefsToDb(); + } + } + return true; + } + + /** + * Get all column names which are MySQL reserved words + * + * @return array + * @access public + */ + public function getReservedColumnNames() + { + $columns = $this->getColumns(false); + $return = array(); + foreach ($columns as $column) { + $temp = explode('.', $column); + $column_name = $temp[2]; + if (Context::isKeyword($column_name, true)) { + $return[] = $column_name; + } + } + return $return; + } + + /** + * Function to get the name and type of the columns of a table + * + * @return array + */ + public function getNameAndTypeOfTheColumns() + { + $columns = array(); + foreach ($this->_dbi->getColumnsFull( + $this->_db_name, $this->_name + ) as $row) { + if (preg_match('@^(set|enum)\((.+)\)$@i', $row['Type'], $tmp)) { + $tmp[2] = mb_substr( + preg_replace('@([^,])\'\'@', '\\1\\\'', ',' . $tmp[2]), 1 + ); + $columns[$row['Field']] = $tmp[1] . '(' + . str_replace(',', ', ', $tmp[2]) . ')'; + } else { + $columns[$row['Field']] = $row['Type']; + } + } + return $columns; + } + + /** + * Get index with index name + * + * @param string $index Index name + * + * @return Index + */ + public function getIndex($index) + { + return Index::singleton($this->_db_name, $this->_name, $index); + } + + /** + * Function to get the sql query for index creation or edit + * + * @param Index $index current index + * @param bool &$error whether error occurred or not + * + * @return string + */ + public function getSqlQueryForIndexCreateOrEdit($index, &$error) + { + // $sql_query is the one displayed in the query box + $sql_query = sprintf( + 'ALTER TABLE %s.%s', + Util::backquote($this->_db_name), + Util::backquote($this->_name) + ); + + // Drops the old index + if (! empty($_POST['old_index'])) { + if ($_POST['old_index'] == 'PRIMARY') { + $sql_query .= ' DROP PRIMARY KEY,'; + } else { + $sql_query .= sprintf( + ' DROP INDEX %s,', + Util::backquote($_POST['old_index']) + ); + } + } // end if + + // Builds the new one + switch ($index->getChoice()) { + case 'PRIMARY': + if ($index->getName() == '') { + $index->setName('PRIMARY'); + } elseif ($index->getName() != 'PRIMARY') { + $error = Message::error( + __('The name of the primary key must be "PRIMARY"!') + ); + } + $sql_query .= ' ADD PRIMARY KEY'; + break; + case 'FULLTEXT': + case 'UNIQUE': + case 'INDEX': + case 'SPATIAL': + if ($index->getName() == 'PRIMARY') { + $error = Message::error( + __('Can\'t rename index to PRIMARY!') + ); + } + $sql_query .= sprintf( + ' ADD %s ', + $index->getChoice() + ); + if ($index->getName()) { + $sql_query .= Util::backquote($index->getName()); + } + break; + } // end switch + + $index_fields = array(); + foreach ($index->getColumns() as $key => $column) { + $index_fields[$key] = Util::backquote($column->getName()); + if ($column->getSubPart()) { + $index_fields[$key] .= '(' . $column->getSubPart() . ')'; + } + } // end while + + if (empty($index_fields)) { + $error = Message::error(__('No index parts defined!')); + } else { + $sql_query .= ' (' . implode(', ', $index_fields) . ')'; + } + + $keyBlockSizes = $index->getKeyBlockSize(); + if (! empty($keyBlockSizes)) { + $sql_query .= sprintf( + ' KEY_BLOCK_SIZE = %s', + $GLOBALS['dbi']->escapeString($keyBlockSizes) + ); + } + + // specifying index type is allowed only for primary, unique and index only + // TokuDB is using Fractal Tree, Using Type is not useless + // Ref: https://mariadb.com/kb/en/mariadb/storage-engine-index-types/ + $type = $index->getType(); + if ($index->getChoice() != 'SPATIAL' + && $index->getChoice() != 'FULLTEXT' + && in_array($type, Index::getIndexTypes()) + && ! $this->isEngine(array('TOKUDB')) + ) { + $sql_query .= ' USING ' . $type; + } + + $parser = $index->getParser(); + if ($index->getChoice() == 'FULLTEXT' && ! empty($parser)) { + $sql_query .= ' WITH PARSER ' . $GLOBALS['dbi']->escapeString($parser); + } + + $comment = $index->getComment(); + if (! empty($comment)) { + $sql_query .= sprintf( + " COMMENT '%s'", + $GLOBALS['dbi']->escapeString($comment) + ); + } + + $sql_query .= ';'; + + return $sql_query; + } + + /** + * Function to handle update for display field + * + * @param string $display_field display field + * @param array $cfgRelation configuration relation + * + * @return boolean True on update succeed or False on failure + */ + public function updateDisplayField($display_field, array $cfgRelation) + { + $upd_query = false; + if ($display_field == '') { + $upd_query = 'DELETE FROM ' + . Util::backquote($GLOBALS['cfgRelation']['db']) + . '.' . Util::backquote($cfgRelation['table_info']) + . ' WHERE db_name = \'' + . $GLOBALS['dbi']->escapeString($this->_db_name) . '\'' + . ' AND table_name = \'' + . $GLOBALS['dbi']->escapeString($this->_name) . '\''; + } else { + $upd_query = 'REPLACE INTO ' + . Util::backquote($GLOBALS['cfgRelation']['db']) + . '.' . Util::backquote($cfgRelation['table_info']) + . '(db_name, table_name, display_field) VALUES(' + . '\'' . $GLOBALS['dbi']->escapeString($this->_db_name) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($this->_name) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($display_field) . '\')'; + } + + if ($upd_query) { + $this->_dbi->query( + $upd_query, + DatabaseInterface::CONNECT_CONTROL, + 0, + false + ); + return true; + } + return false; + } + + /** + * Function to get update query for updating internal relations + * + * @param array $multi_edit_columns_name multi edit column names + * @param array $destination_db destination tables + * @param array $destination_table destination tables + * @param array $destination_column destination columns + * @param array $cfgRelation configuration relation + * @param array|null $existrel db, table, column + * + * @return boolean + */ + public function updateInternalRelations(array $multi_edit_columns_name, + array $destination_db, array $destination_table, array $destination_column, + array $cfgRelation, $existrel + ) { + $updated = false; + foreach ($destination_db as $master_field_md5 => $foreign_db) { + $upd_query = null; + // Map the fieldname's md5 back to its real name + $master_field = $multi_edit_columns_name[$master_field_md5]; + $foreign_table = $destination_table[$master_field_md5]; + $foreign_field = $destination_column[$master_field_md5]; + if (! empty($foreign_db) + && ! empty($foreign_table) + && ! empty($foreign_field) + ) { + if (! isset($existrel[$master_field])) { + $upd_query = 'INSERT INTO ' + . Util::backquote($GLOBALS['cfgRelation']['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . '(master_db, master_table, master_field, foreign_db,' + . ' foreign_table, foreign_field)' + . ' values(' + . '\'' . $GLOBALS['dbi']->escapeString($this->_db_name) . '\', ' + . '\'' . $GLOBALS['dbi']->escapeString($this->_name) . '\', ' + . '\'' . $GLOBALS['dbi']->escapeString($master_field) . '\', ' + . '\'' . $GLOBALS['dbi']->escapeString($foreign_db) . '\', ' + . '\'' . $GLOBALS['dbi']->escapeString($foreign_table) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($foreign_field) . '\')'; + + } elseif ($existrel[$master_field]['foreign_db'] != $foreign_db + || $existrel[$master_field]['foreign_table'] != $foreign_table + || $existrel[$master_field]['foreign_field'] != $foreign_field + ) { + $upd_query = 'UPDATE ' + . Util::backquote($GLOBALS['cfgRelation']['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . ' SET foreign_db = \'' + . $GLOBALS['dbi']->escapeString($foreign_db) . '\', ' + . ' foreign_table = \'' + . $GLOBALS['dbi']->escapeString($foreign_table) . '\', ' + . ' foreign_field = \'' + . $GLOBALS['dbi']->escapeString($foreign_field) . '\' ' + . ' WHERE master_db = \'' + . $GLOBALS['dbi']->escapeString($this->_db_name) . '\'' + . ' AND master_table = \'' + . $GLOBALS['dbi']->escapeString($this->_name) . '\'' + . ' AND master_field = \'' + . $GLOBALS['dbi']->escapeString($master_field) . '\''; + } // end if... else.... + } elseif (isset($existrel[$master_field])) { + $upd_query = 'DELETE FROM ' + . Util::backquote($GLOBALS['cfgRelation']['db']) + . '.' . Util::backquote($cfgRelation['relation']) + . ' WHERE master_db = \'' + . $GLOBALS['dbi']->escapeString($this->_db_name) . '\'' + . ' AND master_table = \'' + . $GLOBALS['dbi']->escapeString($this->_name) . '\'' + . ' AND master_field = \'' + . $GLOBALS['dbi']->escapeString($master_field) . '\''; + } // end if... else.... + + if (isset($upd_query)) { + $this->_dbi->query( + $upd_query, + DatabaseInterface::CONNECT_CONTROL, + 0, + false + ); + $updated = true; + } + } + return $updated; + } + + /** + * Function to handle foreign key updates + * + * @param array $destination_foreign_db destination foreign database + * @param array $multi_edit_columns_name multi edit column names + * @param array $destination_foreign_table destination foreign table + * @param array $destination_foreign_column destination foreign column + * @param array $options_array options array + * @param string $table current table + * @param array $existrel_foreign db, table, column + * + * @return array + */ + public function updateForeignKeys(array $destination_foreign_db, + array $multi_edit_columns_name, array $destination_foreign_table, + array $destination_foreign_column, array $options_array, $table, array $existrel_foreign + ) { + $html_output = ''; + $preview_sql_data = ''; + $display_query = ''; + $seen_error = false; + + foreach ($destination_foreign_db as $master_field_md5 => $foreign_db) { + $create = false; + $drop = false; + + // Map the fieldname's md5 back to its real name + $master_field = $multi_edit_columns_name[$master_field_md5]; + + $foreign_table = $destination_foreign_table[$master_field_md5]; + $foreign_field = $destination_foreign_column[$master_field_md5]; + + if (isset($existrel_foreign[$master_field_md5]['ref_db_name'])) { + $ref_db_name = $existrel_foreign[$master_field_md5]['ref_db_name']; + } else { + $ref_db_name = $GLOBALS['db']; + } + + $empty_fields = false; + foreach ($master_field as $key => $one_field) { + if ((! empty($one_field) && empty($foreign_field[$key])) + || (empty($one_field) && ! empty($foreign_field[$key])) + ) { + $empty_fields = true; + } + + if (empty($one_field) && empty($foreign_field[$key])) { + unset($master_field[$key]); + unset($foreign_field[$key]); + } + } + + if (! empty($foreign_db) + && ! empty($foreign_table) + && ! $empty_fields + ) { + if (isset($existrel_foreign[$master_field_md5])) { + $constraint_name + = $existrel_foreign[$master_field_md5]['constraint']; + $on_delete = !empty( + $existrel_foreign[$master_field_md5]['on_delete'] + ) + ? $existrel_foreign[$master_field_md5]['on_delete'] + : 'RESTRICT'; + $on_update = ! empty( + $existrel_foreign[$master_field_md5]['on_update'] + ) + ? $existrel_foreign[$master_field_md5]['on_update'] + : 'RESTRICT'; + + if ($ref_db_name != $foreign_db + || $existrel_foreign[$master_field_md5]['ref_table_name'] != $foreign_table + || $existrel_foreign[$master_field_md5]['ref_index_list'] != $foreign_field + || $existrel_foreign[$master_field_md5]['index_list'] != $master_field + || $_POST['constraint_name'][$master_field_md5] != $constraint_name + || ($_POST['on_delete'][$master_field_md5] != $on_delete) + || ($_POST['on_update'][$master_field_md5] != $on_update) + ) { + // another foreign key is already defined for this field + // or an option has been changed for ON DELETE or ON UPDATE + $drop = true; + $create = true; + } // end if... else.... + } else { + // no key defined for this field(s) + $create = true; + } + } elseif (isset($existrel_foreign[$master_field_md5])) { + $drop = true; + } // end if... else.... + + $tmp_error_drop = false; + if ($drop) { + $drop_query = 'ALTER TABLE ' . Util::backquote($table) + . ' DROP FOREIGN KEY ' + . Util::backquote( + $existrel_foreign[$master_field_md5]['constraint'] + ) + . ';'; + + if (! isset($_POST['preview_sql'])) { + $display_query .= $drop_query . "\n"; + $this->_dbi->tryQuery($drop_query); + $tmp_error_drop = $this->_dbi->getError(); + + if (! empty($tmp_error_drop)) { + $seen_error = true; + $html_output .= Util::mysqlDie( + $tmp_error_drop, $drop_query, false, '', false + ); + continue; + } + } else { + $preview_sql_data .= $drop_query . "\n"; + } + } + $tmp_error_create = false; + if (!$create) { + continue; + } + + $create_query = $this->_getSQLToCreateForeignKey( + $table, $master_field, $foreign_db, $foreign_table, $foreign_field, + $_POST['constraint_name'][$master_field_md5], + $options_array[$_POST['on_delete'][$master_field_md5]], + $options_array[$_POST['on_update'][$master_field_md5]] + ); + + if (! isset($_POST['preview_sql'])) { + $display_query .= $create_query . "\n"; + $this->_dbi->tryQuery($create_query); + $tmp_error_create = $this->_dbi->getError(); + if (! empty($tmp_error_create)) { + $seen_error = true; + + if (substr($tmp_error_create, 1, 4) == '1005') { + $message = Message::error( + __( + 'Error creating foreign key on %1$s (check data ' . + 'types)' + ) + ); + $message->addParam(implode(', ', $master_field)); + $html_output .= $message->getDisplay(); + } else { + $html_output .= Util::mysqlDie( + $tmp_error_create, $create_query, false, '', false + ); + } + $html_output .= Util::showMySQLDocu( + 'InnoDB_foreign_key_constraints' + ) . "\n"; + } + } else { + $preview_sql_data .= $create_query . "\n"; + } + + // this is an alteration and the old constraint has been dropped + // without creation of a new one + if ($drop && $create && empty($tmp_error_drop) + && ! empty($tmp_error_create) + ) { + // a rollback may be better here + $sql_query_recreate = '# Restoring the dropped constraint...' . "\n"; + $sql_query_recreate .= $this->_getSQLToCreateForeignKey( + $table, + $master_field, + $existrel_foreign[$master_field_md5]['ref_db_name'], + $existrel_foreign[$master_field_md5]['ref_table_name'], + $existrel_foreign[$master_field_md5]['ref_index_list'], + $existrel_foreign[$master_field_md5]['constraint'], + $options_array[$existrel_foreign[$master_field_md5]['on_delete']], + $options_array[$existrel_foreign[$master_field_md5]['on_update']] + ); + if (! isset($_POST['preview_sql'])) { + $display_query .= $sql_query_recreate . "\n"; + $this->_dbi->tryQuery($sql_query_recreate); + } else { + $preview_sql_data .= $sql_query_recreate; + } + } + } // end foreach + + return array( + $html_output, + $preview_sql_data, + $display_query, + $seen_error + ); + } + + /** + * Returns the SQL query for foreign key constraint creation + * + * @param string $table table name + * @param array $field field names + * @param string $foreignDb foreign database name + * @param string $foreignTable foreign table name + * @param array $foreignField foreign field names + * @param string $name name of the constraint + * @param string $onDelete on delete action + * @param string $onUpdate on update action + * + * @return string SQL query for foreign key constraint creation + */ + private function _getSQLToCreateForeignKey( + $table, + array $field, + $foreignDb, + $foreignTable, + array $foreignField, + $name = null, + $onDelete = null, + $onUpdate = null + ) { + $sql_query = 'ALTER TABLE ' . Util::backquote($table) . ' ADD '; + // if user entered a constraint name + if (! empty($name)) { + $sql_query .= ' CONSTRAINT ' . Util::backquote($name); + } + + foreach ($field as $key => $one_field) { + $field[$key] = Util::backquote($one_field); + } + foreach ($foreignField as $key => $one_field) { + $foreignField[$key] = Util::backquote($one_field); + } + $sql_query .= ' FOREIGN KEY (' . implode(', ', $field) . ') REFERENCES ' + . ($this->_db_name != $foreignDb + ? Util::backquote($foreignDb) . '.' : '') + . Util::backquote($foreignTable) + . '(' . implode(', ', $foreignField) . ')'; + + if (! empty($onDelete)) { + $sql_query .= ' ON DELETE ' . $onDelete; + } + if (! empty($onUpdate)) { + $sql_query .= ' ON UPDATE ' . $onUpdate; + } + $sql_query .= ';'; + + return $sql_query; + } + + /** + * Returns the generation expression for virtual columns + * + * @param string $column name of the column + * + * @return array|boolean associative array of column name and their expressions + * or false on failure + */ + public function getColumnGenerationExpression($column = null) + { + $serverType = Util::getServerType(); + if ($serverType == 'MySQL' + && $GLOBALS['dbi']->getVersion() > 50705 + && ! $GLOBALS['cfg']['Server']['DisableIS'] + ) { + $sql + = "SELECT + `COLUMN_NAME` AS `Field`, + `GENERATION_EXPRESSION` AS `Expression` + FROM + `information_schema`.`COLUMNS` + WHERE + `TABLE_SCHEMA` = '" . $GLOBALS['dbi']->escapeString($this->_db_name) . "' + AND `TABLE_NAME` = '" . $GLOBALS['dbi']->escapeString($this->_name) . "'"; + if ($column != null) { + $sql .= " AND `COLUMN_NAME` = '" . $GLOBALS['dbi']->escapeString($column) + . "'"; + } + $columns = $this->_dbi->fetchResult($sql, 'Field', 'Expression'); + return $columns; + } + + $createTable = $this->showCreate(); + if (!$createTable) { + return false; + } + + $parser = new Parser($createTable); + /** + * @var \PhpMyAdmin\SqlParser\Statements\CreateStatement $stmt + */ + $stmt = $parser->statements[0]; + $fields = TableUtils::getFields($stmt); + if ($column != null) { + $expression = isset($fields[$column]['expr']) ? + substr($fields[$column]['expr'], 1, -1) : ''; + return array($column => $expression); + } + + $ret = array(); + foreach ($fields as $field => $options) { + if (isset($options['expr'])) { + $ret[$field] = substr($options['expr'], 1, -1); + } + } + return $ret; + } + + /** + * Returns the CREATE statement for this table + * + * @return mixed + */ + public function showCreate() + { + return $this->_dbi->fetchValue( + 'SHOW CREATE TABLE ' . Util::backquote($this->_db_name) . '.' + . Util::backquote($this->_name), + 0, 1 + ); + } + + /** + * Returns the real row count for a table + * + * @return number + */ + public function getRealRowCountTable() + { + // SQL query to get row count for a table. + $result = $this->_dbi->fetchSingleRow( + sprintf( + 'SELECT COUNT(*) AS %s FROM %s.%s', + Util::backquote('row_count'), + Util::backquote($this->_db_name), + Util::backquote($this->_name) + ) + ); + return $result['row_count']; + } + + /** + * Get columns with indexes + * + * @param int $types types bitmask + * + * @return array an array of columns + */ + public function getColumnsWithIndex($types) + { + $columns_with_index = array(); + foreach ( + Index::getFromTableByChoice( + $this->_name, + $this->_db_name, + $types + ) as $index + ) { + $columns = $index->getColumns(); + foreach ($columns as $column_name => $dummy) { + $columns_with_index[] = $column_name; + } + } + return $columns_with_index; + } +} diff --git a/phpMyAdmin/libraries/classes/Template.php b/phpMyAdmin/libraries/classes/Template.php new file mode 100755 index 0000000..02c9f6c --- /dev/null +++ b/phpMyAdmin/libraries/classes/Template.php @@ -0,0 +1,135 @@ +name = $name; + + if (is_null($this::$twig)) { + $loader = new FilesystemLoader(static::BASE_PATH); + $cache_dir = $GLOBALS['PMA_Config']->getTempDir('twig'); + /* Twig expects false when cache is not configured */ + if (is_null($cache_dir)) { + $cache_dir = false; + } + $twig = new Environment($loader, array( + 'auto_reload' => true, + 'cache' => $cache_dir, + 'debug' => false, + )); + $twig->addExtension(new CharsetsExtension()); + $twig->addExtension(new CoreExtension()); + $twig->addExtension(new I18nExtension()); + $twig->addExtension(new IndexExtension()); + $twig->addExtension(new MessageExtension()); + $twig->addExtension(new PartitionExtension()); + $twig->addExtension(new PhpFunctionsExtension()); + $twig->addExtension(new PluginsExtension()); + $twig->addExtension(new RelationExtension()); + $twig->addExtension(new SanitizeExtension()); + $twig->addExtension(new ServerPrivilegesExtension()); + $twig->addExtension(new StorageEngineExtension()); + $twig->addExtension(new TrackerExtension()); + $twig->addExtension(new TableExtension()); + $twig->addExtension(new TransformationsExtension()); + $twig->addExtension(new UrlExtension()); + $twig->addExtension(new UtilExtension()); + $this::$twig = $twig; + } + } + + /** + * Template getter + * + * @param string $name Template name + * + * @return Template + */ + public static function get($name) + { + return new Template($name); + } + + /** + * Render template + * + * @param array $data Variables to be provided to the template + * + * @return string + */ + public function render(array $data = array()) + { + try { + $template = $this::$twig->load($this->name . '.twig'); + } catch (\RuntimeException $e) { + /* Retry with disabled cache */ + $this::$twig->setCache(false); + $template = $this::$twig->load($this->name . '.twig'); + /* + * The trigger error is intentionally after second load + * to avoid triggering error when disabling cache does not + * solve it. + */ + trigger_error( + sprintf( + __('Error while working with template cache: %s'), + $e->getMessage() + ), + E_USER_WARNING + ); + } + return $template->render($data); + } +} diff --git a/phpMyAdmin/libraries/classes/Theme.php b/phpMyAdmin/libraries/classes/Theme.php new file mode 100755 index 0000000..d9ef652 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Theme.php @@ -0,0 +1,465 @@ +getPath() . '/theme.json'; + if (! @file_exists($infofile)) { + return false; + } + + if ($this->mtime_info === filemtime($infofile)) { + return true; + } + $content = @file_get_contents($infofile); + if ($content === false) { + return false; + } + $data = json_decode($content, true); + + // Did we get expected data? + if (! is_array($data)) { + return false; + } + // Check that all required data are there + $members = array('name', 'version', 'supports'); + foreach ($members as $member) { + if (! isset($data[$member])) { + return false; + } + } + + // Version check + if (! is_array($data['supports'])) { + return false; + } + if (! in_array(PMA_MAJOR_VERSION, $data['supports'])) { + return false; + } + + $this->mtime_info = filemtime($infofile); + $this->filesize_info = filesize($infofile); + + $this->setVersion($data['version']); + $this->setName($data['name']); + + return true; + } + + /** + * returns theme object loaded from given folder + * or false if theme is invalid + * + * @param string $folder path to theme + * + * @return Theme|false + * @static + * @access public + */ + static public function load($folder) + { + $theme = new Theme(); + + $theme->setPath($folder); + + if (! $theme->loadInfo()) { + return false; + } + + $theme->checkImgPath(); + + return $theme; + } + + /** + * checks image path for existence - if not found use img from fallback theme + * + * @access public + * @return bool + */ + public function checkImgPath() + { + // try current theme first + if (is_dir($this->getPath() . '/img/')) { + $this->setImgPath($this->getPath() . '/img/'); + return true; + } + + // try fallback theme + $fallback = './themes/' . ThemeManager::FALLBACK_THEME . '/img/'; + if (is_dir($fallback)) { + $this->setImgPath($fallback); + return true; + } + + // we failed + trigger_error( + sprintf( + __('No valid image path for theme %s found!'), + $this->getName() + ), + E_USER_ERROR + ); + return false; + } + + /** + * returns path to theme + * + * @access public + * @return string path to theme + */ + public function getPath() + { + return $this->path; + } + + /** + * returns layout file + * + * @access public + * @return string layout file + */ + public function getLayoutFile() + { + return $this->getPath() . '/layout.inc.php'; + } + + /** + * set path to theme + * + * @param string $path path to theme + * + * @return void + * @access public + */ + public function setPath($path) + { + $this->path = trim($path); + } + + /** + * sets version + * + * @param string $version version to set + * + * @return void + * @access public + */ + public function setVersion($version) + { + $this->version = trim($version); + } + + /** + * returns version + * + * @return string version + * @access public + */ + public function getVersion() + { + return $this->version; + } + + /** + * checks theme version against $version + * returns true if theme version is equal or higher to $version + * + * @param string $version version to compare to + * + * @return boolean true if theme version is equal or higher to $version + * @access public + */ + public function checkVersion($version) + { + return version_compare($this->getVersion(), $version, 'lt'); + } + + /** + * sets name + * + * @param string $name name to set + * + * @return void + * @access public + */ + public function setName($name) + { + $this->name = trim($name); + } + + /** + * returns name + * + * @access public + * @return string name + */ + public function getName() + { + return $this->name; + } + + /** + * sets id + * + * @param string $id new id + * + * @return void + * @access public + */ + public function setId($id) + { + $this->id = trim($id); + } + + /** + * returns id + * + * @return string id + * @access public + */ + public function getId() + { + return $this->id; + } + + /** + * Sets path to images for the theme + * + * @param string $path path to images for this theme + * + * @return void + * @access public + */ + public function setImgPath($path) + { + $this->img_path = $path; + } + + /** + * Returns the path to image for the theme. + * If filename is given, it possibly fallbacks to fallback + * theme for it if image does not exist. + * + * @param string $file file name for image + * @param string $fallback fallback image + * + * @access public + * @return string image path for this theme + */ + public function getImgPath($file = null, $fallback = null) + { + if (is_null($file)) { + return $this->img_path; + } + + if (is_readable($this->img_path . $file)) { + return $this->img_path . $file; + } + + if (! is_null($fallback)) { + return $this->getImgPath($fallback); + } + + return './themes/' . ThemeManager::FALLBACK_THEME . '/img/' . $file; + } + + /** + * load css (send to stdout, normally the browser) + * + * @return bool + * @access public + */ + public function loadCss() + { + $success = true; + + /* Variables to be used by the themes: */ + $theme = $this; + if ($GLOBALS['text_dir'] === 'ltr') { + $right = 'right'; + $left = 'left'; + } else { + $right = 'left'; + $left = 'right'; + } + + foreach ($this->_cssFiles as $file) { + $path = $this->getPath() . "/css/$file.css.php"; + $fallback = "./themes/" + . ThemeManager::FALLBACK_THEME . "/css/$file.css.php"; + + if (is_readable($path)) { + echo "\n/* FILE: " , $file , ".css.php */\n"; + include $path; + } elseif (is_readable($fallback)) { + echo "\n/* FILE: " , $file , ".css.php */\n"; + include $fallback; + } else { + $success = false; + } + } + return $success; + } + + /** + * Renders the preview for this theme + * + * @return string + * @access public + */ + public function getPrintPreview() + { + $url_params = ['set_theme' => $this->getId()]; + $screen = null; + $path = $this->getPath() . '/screen.png'; + if (@file_exists($path)) { + $screen = $path; + } + + return Template::get('theme_preview')->render([ + 'url_params' => $url_params, + 'name' => $this->getName(), + 'version' => $this->getVersion(), + 'id' => $this->getId(), + 'screen' => $screen, + ]); + } + + /** + * Gets currently configured font size. + * + * @return String with font size. + */ + function getFontSize() + { + $fs = $GLOBALS['PMA_Config']->get('FontSize'); + if (!is_null($fs)) { + return $fs; + } + return '82%'; + } + + /** + * Generates code for CSS gradient using various browser extensions. + * + * @param string $start_color Color of gradient start, hex value without # + * @param string $end_color Color of gradient end, hex value without # + * + * @return string CSS code. + */ + function getCssGradient($start_color, $end_color) + { + $result = array(); + // Opera 9.5+, IE 9 + $result[] = 'background-image: url(./themes/svg_gradient.php?from=' + . $start_color . '&to=' . $end_color . ');'; + $result[] = 'background-size: 100% 100%;'; + // Safari 4-5, Chrome 1-9 + $result[] = 'background: ' + . '-webkit-gradient(linear, left top, left bottom, from(#' + . $start_color . '), to(#' . $end_color . '));'; + // Safari 5.1, Chrome 10+ + $result[] = 'background: -webkit-linear-gradient(top, #' + . $start_color . ', #' . $end_color . ');'; + // Firefox 3.6+ + $result[] = 'background: -moz-linear-gradient(top, #' + . $start_color . ', #' . $end_color . ');'; + // IE 10 + $result[] = 'background: -ms-linear-gradient(top, #' + . $start_color . ', #' . $end_color . ');'; + // Opera 11.10 + $result[] = 'background: -o-linear-gradient(top, #' + . $start_color . ', #' . $end_color . ');'; + return implode("\n", $result); + } +} diff --git a/phpMyAdmin/libraries/classes/ThemeManager.php b/phpMyAdmin/libraries/classes/ThemeManager.php new file mode 100755 index 0000000..0ac38fc --- /dev/null +++ b/phpMyAdmin/libraries/classes/ThemeManager.php @@ -0,0 +1,456 @@ +themes = array(); + $this->theme_default = self::FALLBACK_THEME; + $this->active_theme = ''; + + if (! $this->setThemesPath('./themes/')) { + return; + } + + $this->setThemePerServer($GLOBALS['cfg']['ThemePerServer']); + + $this->loadThemes(); + + $this->theme = new Theme; + + if (! $this->checkTheme($GLOBALS['cfg']['ThemeDefault'])) { + trigger_error( + sprintf( + __('Default theme %s not found!'), + htmlspecialchars($GLOBALS['cfg']['ThemeDefault']) + ), + E_USER_ERROR + ); + $GLOBALS['cfg']['ThemeDefault'] = false; + } + + $this->theme_default = $GLOBALS['cfg']['ThemeDefault']; + + // check if user have a theme cookie + $cookie_theme = $this->getThemeCookie(); + if (! $cookie_theme || ! $this->setActiveTheme($cookie_theme)) { + if ($GLOBALS['cfg']['ThemeDefault']) { + // otherwise use default theme + $this->setActiveTheme($this->theme_default); + } else { + // or fallback theme + $this->setActiveTheme(self::FALLBACK_THEME); + } + } + } + + /** + * Returns the singleton Response object + * + * @return Response object + */ + public static function getInstance() + { + if (empty(self::$_instance)) { + self::$_instance = new ThemeManager(); + } + return self::$_instance; + } + + /** + * sets path to folder containing the themes + * + * @param string $path path to themes folder + * + * @access public + * @return boolean success + */ + public function setThemesPath($path) + { + if (! $this->_checkThemeFolder($path)) { + return false; + } + + $this->_themes_path = trim($path); + return true; + } + + /** + * sets if there are different themes per server + * + * @param boolean $per_server Whether to enable per server flag + * + * @access public + * @return void + */ + public function setThemePerServer($per_server) + { + $this->per_server = (bool) $per_server; + } + + /** + * Sets active theme + * + * @param string $theme theme name + * + * @access public + * @return bool true on success + */ + public function setActiveTheme($theme = null) + { + if (! $this->checkTheme($theme)) { + trigger_error( + sprintf( + __('Theme %s not found!'), + htmlspecialchars($theme) + ), + E_USER_ERROR + ); + return false; + } + + $this->active_theme = $theme; + $this->theme = $this->themes[$theme]; + + // need to set later + //$this->setThemeCookie(); + + return true; + } + + /** + * Returns name for storing theme + * + * @return string cookie name + * @access public + */ + public function getThemeCookieName() + { + // Allow different theme per server + if (isset($GLOBALS['server']) && $this->per_server) { + return $this->cookie_name . '-' . $GLOBALS['server']; + } + + return $this->cookie_name; + } + + /** + * returns name of theme stored in the cookie + * + * @return string theme name from cookie + * @access public + */ + public function getThemeCookie() + { + /** @var Config $PMA_Config */ + global $PMA_Config; + + $name = $this->getThemeCookieName(); + if ($PMA_Config->issetCookie($name)) { + return $PMA_Config->getCookie($name); + } + + return false; + } + + /** + * save theme in cookie + * + * @return bool true + * @access public + */ + public function setThemeCookie() + { + $GLOBALS['PMA_Config']->setCookie( + $this->getThemeCookieName(), + $this->theme->id, + $this->theme_default + ); + // force a change of a dummy session variable to avoid problems + // with the caching of phpmyadmin.css.php + $GLOBALS['PMA_Config']->set('theme-update', $this->theme->id); + return true; + } + + /** + * Checks whether folder is valid for storing themes + * + * @param string $folder Folder name to test + * + * @return boolean + * @access private + */ + private function _checkThemeFolder($folder) + { + if (! is_dir($folder)) { + trigger_error( + sprintf( + __('Theme path not found for theme %s!'), + htmlspecialchars($folder) + ), + E_USER_ERROR + ); + return false; + } + + return true; + } + + /** + * read all themes + * + * @return bool true + * @access public + */ + public function loadThemes() + { + $this->themes = array(); + + if (false === ($handleThemes = opendir($this->_themes_path))) { + trigger_error( + 'phpMyAdmin-ERROR: cannot open themes folder: ' + . $this->_themes_path, + E_USER_WARNING + ); + return false; + } + + // check for themes directory + while (false !== ($PMA_Theme = readdir($handleThemes))) { + // Skip non dirs, . and .. + if ($PMA_Theme == '.' + || $PMA_Theme == '..' + || ! @is_dir($this->_themes_path . $PMA_Theme) + ) { + continue; + } + if (array_key_exists($PMA_Theme, $this->themes)) { + continue; + } + $new_theme = Theme::load( + $this->_themes_path . $PMA_Theme + ); + if ($new_theme) { + $new_theme->setId($PMA_Theme); + $this->themes[$PMA_Theme] = $new_theme; + } + } // end get themes + closedir($handleThemes); + + ksort($this->themes); + return true; + } + + /** + * checks if given theme name is a known theme + * + * @param string $theme name fo theme to check for + * + * @return bool + * @access public + */ + public function checkTheme($theme) + { + return array_key_exists($theme, $this->themes); + } + + /** + * returns HTML selectbox, with or without form enclosed + * + * @param boolean $form whether enclosed by from tags or not + * + * @return string + * @access public + */ + public function getHtmlSelectBox($form = true) + { + $select_box = ''; + + if ($form) { + $select_box .= '
    '; + $select_box .= $theme_preview_href . __('Theme:') . '' . "\n"; + + $select_box .= ''; + + if ($form) { + $select_box .= '
    '; + } + + return $select_box; + } + + /** + * Renders the previews for all themes + * + * @return string + * @access public + */ + public function getPrintPreviews() + { + $retval = ''; + foreach ($this->themes as $each_theme) { + $retval .= $each_theme->getPrintPreview(); + } // end 'open themes' + return $retval; + } + + /** + * returns Theme object for fall back theme + * + * @return Theme fall back theme + * @access public + */ + public function getFallBackTheme() + { + if (isset($this->themes[self::FALLBACK_THEME])) { + return $this->themes[self::FALLBACK_THEME]; + } + + return false; + } + + /** + * prints css data + * + * @return bool + * @access public + */ + public function printCss() + { + if ($this->theme->loadCss()) { + return true; + } + + // if loading css for this theme failed, try default theme css + $fallback_theme = $this->getFallBackTheme(); + if ($fallback_theme && $fallback_theme->loadCss()) { + return true; + } + + return false; + } + + /** + * Theme initialization + * + * @return void + * @access public + */ + public static function initializeTheme() + { + $tmanager = self::getInstance(); + + /** + * the theme object + * + * @global Theme $GLOBALS['PMA_Theme'] + */ + $GLOBALS['PMA_Theme'] = $tmanager->theme; + + // BC + /** + * the theme path + * @global string $GLOBALS['pmaThemePath'] + */ + $GLOBALS['pmaThemePath'] = $GLOBALS['PMA_Theme']->getPath(); + /** + * the theme image path + * @global string $GLOBALS['pmaThemeImage'] + */ + $GLOBALS['pmaThemeImage'] = $GLOBALS['PMA_Theme']->getImgPath(); + + /** + * load layout file if exists + */ + if (@file_exists($GLOBALS['PMA_Theme']->getLayoutFile())) { + include $GLOBALS['PMA_Theme']->getLayoutFile(); + } + } +} diff --git a/phpMyAdmin/libraries/classes/Tracker.php b/phpMyAdmin/libraries/classes/Tracker.php new file mode 100755 index 0000000..a4e4dd9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Tracker.php @@ -0,0 +1,924 @@ +getRelationsParam(); + /* Restore original state */ + self::$enabled = true; + if (! $cfgRelation['trackingwork']) { + return false; + } + + $pma_table = self::_getTrackingTable(); + + return isset($pma_table); + } + + /** + * Parses the name of a table from a SQL statement substring. + * + * @param string $string part of SQL statement + * + * @static + * + * @return string the name of table + */ + static protected function getTableName($string) + { + if (mb_strstr($string, '.')) { + $temp = explode('.', $string); + $tablename = $temp[1]; + } else { + $tablename = $string; + } + + $str = explode("\n", $tablename); + $tablename = $str[0]; + + $tablename = str_replace(';', '', $tablename); + $tablename = str_replace('`', '', $tablename); + $tablename = trim($tablename); + + return $tablename; + } + + + /** + * Gets the tracking status of a table, is it active or deactive ? + * + * @param string $dbname name of database + * @param string $tablename name of table + * + * @static + * + * @return boolean true or false + */ + public static function isTracked($dbname, $tablename) + { + if (! self::$enabled) { + return false; + } + + if (isset(self::$_tracking_cache[$dbname][$tablename])) { + return self::$_tracking_cache[$dbname][$tablename]; + } + /* We need to avoid attempt to track any queries + * from Relation::getRelationsParam + */ + self::$enabled = false; + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + /* Restore original state */ + self::$enabled = true; + if (! $cfgRelation['trackingwork']) { + return false; + } + + $sql_query = " SELECT tracking_active FROM " . self::_getTrackingTable() . + " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . + " AND table_name = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . + " ORDER BY version DESC LIMIT 1"; + + $result = $GLOBALS['dbi']->fetchValue($sql_query, 0, 0, DatabaseInterface::CONNECT_CONTROL) == 1; + + self::$_tracking_cache[$dbname][$tablename] = $result; + + return $result; + } + + /** + * Returns the comment line for the log. + * + * @return string Comment, contains date and username + */ + public static function getLogComment() + { + $date = Util::date('Y-m-d H:i:s'); + $user = preg_replace('/\s+/', ' ', $GLOBALS['cfg']['Server']['user']); + + return "# log " . $date . " " . $user . "\n"; + } + + /** + * Creates tracking version of a table / view + * (in other words: create a job to track future changes on the table). + * + * @param string $dbname name of database + * @param string $tablename name of table + * @param string $version version + * @param string $tracking_set set of tracking statements + * @param bool $is_view if table is a view + * + * @static + * + * @return int result of version insertion + */ + public static function createVersion($dbname, $tablename, $version, + $tracking_set = '', $is_view = false + ) { + global $sql_backquotes, $export_type; + + $relation = new Relation(); + + if ($tracking_set == '') { + $tracking_set + = $GLOBALS['cfg']['Server']['tracking_default_statements']; + } + + // get Export SQL instance + /* @var $export_sql_plugin PhpMyAdmin\Plugins\Export\ExportSql */ + $export_sql_plugin = Plugins::getPlugin( + "export", + "sql", + 'libraries/classes/Plugins/Export/', + array( + 'export_type' => $export_type, + 'single_table' => false, + ) + ); + + $sql_backquotes = true; + + $date = Util::date('Y-m-d H:i:s'); + + // Get data definition snapshot of table + + $columns = $GLOBALS['dbi']->getColumns($dbname, $tablename, null, true); + // int indices to reduce size + $columns = array_values($columns); + // remove Privileges to reduce size + for ($i = 0, $nb = count($columns); $i < $nb; $i++) { + unset($columns[$i]['Privileges']); + } + + $indexes = $GLOBALS['dbi']->getTableIndexes($dbname, $tablename); + + $snapshot = array('COLUMNS' => $columns, 'INDEXES' => $indexes); + $snapshot = serialize($snapshot); + + // Get DROP TABLE / DROP VIEW and CREATE TABLE SQL statements + $sql_backquotes = true; + + $create_sql = ""; + + if ($GLOBALS['cfg']['Server']['tracking_add_drop_table'] == true + && $is_view == false + ) { + $create_sql .= self::getLogComment() + . 'DROP TABLE IF EXISTS ' . Util::backquote($tablename) . ";\n"; + + } + + if ($GLOBALS['cfg']['Server']['tracking_add_drop_view'] == true + && $is_view == true + ) { + $create_sql .= self::getLogComment() + . 'DROP VIEW IF EXISTS ' . Util::backquote($tablename) . ";\n"; + } + + $create_sql .= self::getLogComment() . + $export_sql_plugin->getTableDef($dbname, $tablename, "\n", ""); + + // Save version + + $sql_query = "/*NOTRACK*/\n" . + "INSERT INTO " . self::_getTrackingTable() . " (" . + "db_name, " . + "table_name, " . + "version, " . + "date_created, " . + "date_updated, " . + "schema_snapshot, " . + "schema_sql, " . + "data_sql, " . + "tracking " . + ") " . + "values ( + '" . $GLOBALS['dbi']->escapeString($dbname) . "', + '" . $GLOBALS['dbi']->escapeString($tablename) . "', + '" . $GLOBALS['dbi']->escapeString($version) . "', + '" . $GLOBALS['dbi']->escapeString($date) . "', + '" . $GLOBALS['dbi']->escapeString($date) . "', + '" . $GLOBALS['dbi']->escapeString($snapshot) . "', + '" . $GLOBALS['dbi']->escapeString($create_sql) . "', + '" . $GLOBALS['dbi']->escapeString("\n") . "', + '" . $GLOBALS['dbi']->escapeString($tracking_set) + . "' )"; + + $result = $relation->queryAsControlUser($sql_query); + + if ($result) { + // Deactivate previous version + self::deactivateTracking($dbname, $tablename, ($version - 1)); + } + + return $result; + } + + + /** + * Removes all tracking data for a table or a version of a table + * + * @param string $dbname name of database + * @param string $tablename name of table + * @param string $version version + * + * @static + * + * @return int result of version insertion + */ + public static function deleteTracking($dbname, $tablename, $version = '') + { + $relation = new Relation(); + + $sql_query = "/*NOTRACK*/\n" + . "DELETE FROM " . self::_getTrackingTable() + . " WHERE `db_name` = '" + . $GLOBALS['dbi']->escapeString($dbname) . "'" + . " AND `table_name` = '" + . $GLOBALS['dbi']->escapeString($tablename) . "'"; + if ($version) { + $sql_query .= " AND `version` = '" + . $GLOBALS['dbi']->escapeString($version) . "'"; + } + $result = $relation->queryAsControlUser($sql_query); + + return $result; + } + + /** + * Creates tracking version of a database + * (in other words: create a job to track future changes on the database). + * + * @param string $dbname name of database + * @param string $version version + * @param string $query query + * @param string $tracking_set set of tracking statements + * + * @static + * + * @return int result of version insertion + */ + public static function createDatabaseVersion($dbname, $version, $query, + $tracking_set = 'CREATE DATABASE,ALTER DATABASE,DROP DATABASE' + ) { + $relation = new Relation(); + + $date = Util::date('Y-m-d H:i:s'); + + if ($tracking_set == '') { + $tracking_set + = $GLOBALS['cfg']['Server']['tracking_default_statements']; + } + + $create_sql = ""; + + if ($GLOBALS['cfg']['Server']['tracking_add_drop_database'] == true) { + $create_sql .= self::getLogComment() + . 'DROP DATABASE IF EXISTS ' . Util::backquote($dbname) . ";\n"; + } + + $create_sql .= self::getLogComment() . $query; + + // Save version + $sql_query = "/*NOTRACK*/\n" . + "INSERT INTO " . self::_getTrackingTable() . " (" . + "db_name, " . + "table_name, " . + "version, " . + "date_created, " . + "date_updated, " . + "schema_snapshot, " . + "schema_sql, " . + "data_sql, " . + "tracking " . + ") " . + "values ( + '" . $GLOBALS['dbi']->escapeString($dbname) . "', + '" . $GLOBALS['dbi']->escapeString('') . "', + '" . $GLOBALS['dbi']->escapeString($version) . "', + '" . $GLOBALS['dbi']->escapeString($date) . "', + '" . $GLOBALS['dbi']->escapeString($date) . "', + '" . $GLOBALS['dbi']->escapeString('') . "', + '" . $GLOBALS['dbi']->escapeString($create_sql) . "', + '" . $GLOBALS['dbi']->escapeString("\n") . "', + '" . $GLOBALS['dbi']->escapeString($tracking_set) + . "' )"; + + $result = $relation->queryAsControlUser($sql_query); + + return $result; + } + + + + /** + * Changes tracking of a table. + * + * @param string $dbname name of database + * @param string $tablename name of table + * @param string $version version + * @param integer $new_state the new state of tracking + * + * @static + * + * @return int result of SQL query + */ + static private function _changeTracking($dbname, $tablename, + $version, $new_state + ) { + $relation = new Relation(); + + $sql_query = " UPDATE " . self::_getTrackingTable() . + " SET `tracking_active` = '" . $new_state . "' " . + " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . + " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . + " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) . "' "; + + $result = $relation->queryAsControlUser($sql_query); + + return $result; + } + + /** + * Changes tracking data of a table. + * + * @param string $dbname name of database + * @param string $tablename name of table + * @param string $version version + * @param string $type type of data(DDL || DML) + * @param string|array $new_data the new tracking data + * + * @static + * + * @return bool result of change + */ + public static function changeTrackingData($dbname, $tablename, + $version, $type, $new_data + ) { + $relation = new Relation(); + + if ($type == 'DDL') { + $save_to = 'schema_sql'; + } elseif ($type == 'DML') { + $save_to = 'data_sql'; + } else { + return false; + } + $date = Util::date('Y-m-d H:i:s'); + + $new_data_processed = ''; + if (is_array($new_data)) { + foreach ($new_data as $data) { + $new_data_processed .= '# log ' . $date . ' ' . $data['username'] + . $GLOBALS['dbi']->escapeString($data['statement']) . "\n"; + } + } else { + $new_data_processed = $new_data; + } + + $sql_query = " UPDATE " . self::_getTrackingTable() . + " SET `" . $save_to . "` = '" . $new_data_processed . "' " . + " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . + " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' " . + " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) . "' "; + + $result = $relation->queryAsControlUser($sql_query); + + return (boolean) $result; + } + + /** + * Activates tracking of a table. + * + * @param string $dbname name of database + * @param string $tablename name of table + * @param string $version version + * + * @static + * + * @return int result of SQL query + */ + public static function activateTracking($dbname, $tablename, $version) + { + return self::_changeTracking($dbname, $tablename, $version, 1); + } + + + /** + * Deactivates tracking of a table. + * + * @param string $dbname name of database + * @param string $tablename name of table + * @param string $version version + * + * @static + * + * @return int result of SQL query + */ + public static function deactivateTracking($dbname, $tablename, $version) + { + return self::_changeTracking($dbname, $tablename, $version, 0); + } + + + /** + * Gets the newest version of a tracking job + * (in other words: gets the HEAD version). + * + * @param string $dbname name of database + * @param string $tablename name of table + * @param string $statement tracked statement + * + * @static + * + * @return int (-1 if no version exists | > 0 if a version exists) + */ + public static function getVersion($dbname, $tablename, $statement = null) + { + $relation = new Relation(); + + $sql_query = " SELECT MAX(version) FROM " . self::_getTrackingTable() . + " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . + " AND `table_name` = '" . $GLOBALS['dbi']->escapeString($tablename) . "' "; + + if ($statement != "") { + $sql_query .= " AND FIND_IN_SET('" + . $statement . "',tracking) > 0" ; + } + $row = $GLOBALS['dbi']->fetchArray($relation->queryAsControlUser($sql_query)); + return isset($row[0]) + ? $row[0] + : -1; + } + + + /** + * Gets the record of a tracking job. + * + * @param string $dbname name of database + * @param string $tablename name of table + * @param string $version version number + * + * @static + * + * @return mixed record DDM log, DDL log, structure snapshot, tracked + * statements. + */ + public static function getTrackedData($dbname, $tablename, $version) + { + $relation = new Relation(); + + $sql_query = " SELECT * FROM " . self::_getTrackingTable() . + " WHERE `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' "; + if (! empty($tablename)) { + $sql_query .= " AND `table_name` = '" + . $GLOBALS['dbi']->escapeString($tablename) . "' "; + } + $sql_query .= " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) + . "' " . " ORDER BY `version` DESC LIMIT 1"; + + $mixed = $GLOBALS['dbi']->fetchAssoc($relation->queryAsControlUser($sql_query)); + + // PHP 7.4 fix for accessing array offset on null + if (!is_array($mixed)) { + $mixed = array( + 'schema_sql' => null, + 'data_sql' => null, + 'tracking' => null, + 'schema_snapshot' => null, + ); + } + + // Parse log + $log_schema_entries = explode('# log ', $mixed['schema_sql']); + $log_data_entries = explode('# log ', $mixed['data_sql']); + + $ddl_date_from = $date = Util::date('Y-m-d H:i:s'); + + $ddlog = array(); + $first_iteration = true; + + // Iterate tracked data definition statements + // For each log entry we want to get date, username and statement + foreach ($log_schema_entries as $log_entry) { + if (trim($log_entry) != '') { + $date = mb_substr($log_entry, 0, 19); + $username = mb_substr( + $log_entry, 20, mb_strpos($log_entry, "\n") - 20 + ); + if ($first_iteration) { + $ddl_date_from = $date; + $first_iteration = false; + } + $statement = rtrim(mb_strstr($log_entry, "\n")); + + $ddlog[] = array( 'date' => $date, + 'username'=> $username, + 'statement' => $statement ); + } + } + + $date_from = $ddl_date_from; + $ddl_date_to = $date; + + $dml_date_from = $date_from; + + $dmlog = array(); + $first_iteration = true; + + // Iterate tracked data manipulation statements + // For each log entry we want to get date, username and statement + foreach ($log_data_entries as $log_entry) { + if (trim($log_entry) != '') { + $date = mb_substr($log_entry, 0, 19); + $username = mb_substr( + $log_entry, 20, mb_strpos($log_entry, "\n") - 20 + ); + if ($first_iteration) { + $dml_date_from = $date; + $first_iteration = false; + } + $statement = rtrim(mb_strstr($log_entry, "\n")); + + $dmlog[] = array( 'date' => $date, + 'username' => $username, + 'statement' => $statement ); + } + } + + $dml_date_to = $date; + + // Define begin and end of date range for both logs + $data = array(); + if (strtotime($ddl_date_from) <= strtotime($dml_date_from)) { + $data['date_from'] = $ddl_date_from; + } else { + $data['date_from'] = $dml_date_from; + } + if (strtotime($ddl_date_to) >= strtotime($dml_date_to)) { + $data['date_to'] = $ddl_date_to; + } else { + $data['date_to'] = $dml_date_to; + } + $data['ddlog'] = $ddlog; + $data['dmlog'] = $dmlog; + $data['tracking'] = $mixed['tracking']; + $data['schema_snapshot'] = $mixed['schema_snapshot']; + + return $data; + } + + + /** + * Parses a query. Gets + * - statement identifier (UPDATE, ALTER TABLE, ...) + * - type of statement, is it part of DDL or DML ? + * - tablename + * + * @param string $query query + * + * @static + * @todo: using PMA SQL Parser when possible + * @todo: support multi-table/view drops + * + * @return mixed Array containing identifier, type and tablename. + * + */ + public static function parseQuery($query) + { + // Usage of PMA_SQP does not work here + // + // require_once("libraries/sqlparser.lib.php"); + // $parsed_sql = PMA_SQP_parse($query); + // $sql_info = PMA_SQP_analyze($parsed_sql); + + $parser = new Parser($query); + + $tokens = $parser->list->tokens; + + // Parse USE statement, need it for SQL dump imports + if ($tokens[0]->value == 'USE') { + $GLOBALS['db'] = $tokens[2]->value; + } + + $result = array(); + + if (!empty($parser->statements)) { + $statement = $parser->statements[0]; + $options = isset($statement->options) ? $statement->options->options : null; + + /* + * DDL statements + */ + $result['type'] = 'DDL'; + + // Parse CREATE statement + if ($statement instanceof CreateStatement) { + if (empty($options) || !isset($options[6])) { + return $result; + } + + if ($options[6] == 'VIEW' || $options[6] == 'TABLE') { + $result['identifier'] = 'CREATE ' . $options[6]; + $result['tablename'] = $statement->name->table ; + } elseif ($options[6] == 'DATABASE') { + $result['identifier'] = 'CREATE DATABASE' ; + $result['tablename'] = '' ; + + // In case of CREATE DATABASE, table field of the CreateStatement is actually name of the database + $GLOBALS['db'] = $statement->name->database; + } elseif ($options[6] == 'INDEX' + || $options[6] == 'UNIQUE INDEX' + || $options[6] == 'FULLTEXT INDEX' + || $options[6] == 'SPATIAL INDEX' + ){ + $result['identifier'] = 'CREATE INDEX'; + + // In case of CREATE INDEX, we have to get the table name from body of the statement + $result['tablename'] = $statement->body[3]->value == '.' ? $statement->body[4]->value + : $statement->body[2]->value ; + } + } + + // Parse ALTER statement + elseif ($statement instanceof AlterStatement) { + if (empty($options) || !isset($options[3])) { + return $result; + } + + if ($options[3] == 'VIEW' || $options[3] == 'TABLE') { + $result['identifier'] = 'ALTER ' . $options[3] ; + $result['tablename'] = $statement->table->table ; + } elseif ($options[3] == 'DATABASE') { + $result['identifier'] = 'ALTER DATABASE' ; + $result['tablename'] = '' ; + + $GLOBALS['db'] = $statement->table->table ; + } + } + + // Parse DROP statement + elseif ($statement instanceof DropStatement) { + if (empty($options) || !isset($options[1])) { + return $result; + } + + if ($options[1] == 'VIEW' || $options[1] == 'TABLE') { + $result['identifier'] = 'DROP ' . $options[1] ; + $result['tablename'] = $statement->fields[0]->table; + } elseif ($options[1] == 'DATABASE') { + $result['identifier'] = 'DROP DATABASE' ; + $result['tablename'] = ''; + + $GLOBALS['db'] = $statement->fields[0]->table; + } elseif ($options[1] == 'INDEX') { + $result['identifier'] = 'DROP INDEX' ; + $result['tablename'] = $statement->table->table; + } + } + + // Prase RENAME statement + elseif ($statement instanceof RenameStatement) { + $result['identifier'] = 'RENAME TABLE'; + $result['tablename'] = $statement->renames[0]->old->table; + $result['tablename_after_rename'] = $statement->renames[0]->new->table; + } + + if (isset($result['identifier'])) { + return $result ; + } + + /* + * DML statements + */ + $result['type'] = 'DML'; + + // Parse UPDATE statement + if ($statement instanceof UpdateStatement) { + $result['identifier'] = 'UPDATE'; + $result['tablename'] = $statement->tables[0]->table; + } + + // Parse INSERT INTO statement + if ($statement instanceof InsertStatement) { + $result['identifier'] = 'INSERT'; + $result['tablename'] = $statement->into->dest->table; + } + + // Parse DELETE statement + if ($statement instanceof DeleteStatement) { + $result['identifier'] = 'DELETE'; + $result['tablename'] = $statement->from[0]->table; + } + + // Parse TRUNCATE statement + if ($statement instanceof TruncateStatement) { + $result['identifier'] = 'TRUNCATE' ; + $result['tablename'] = $statement->table->table; + } + } + + return $result; + } + + + /** + * Analyzes a given SQL statement and saves tracking data. + * + * @param string $query a SQL query + * + * @static + * + * @return void + */ + public static function handleQuery($query) + { + $relation = new Relation(); + + // If query is marked as untouchable, leave + if (mb_strstr($query, "/*NOTRACK*/")) { + return; + } + + if (! (substr($query, -1) == ';')) { + $query = $query . ";\n"; + } + // Get some information about query + $result = self::parseQuery($query); + + // Get database name + $dbname = trim(isset($GLOBALS['db']) ? $GLOBALS['db'] : '', '`'); + // $dbname can be empty, for example when coming from Synchronize + // and this is a query for the remote server + if (empty($dbname)) { + return; + } + + // If we found a valid statement + if (isset($result['identifier'])) { + if (! self::isTracked($dbname, $result['tablename'])) { + return; + } + + $version = self::getVersion( + $dbname, $result['tablename'], $result['identifier'] + ); + + // If version not exists and auto-creation is enabled + if ($GLOBALS['cfg']['Server']['tracking_version_auto_create'] == true + && $version == -1 + ) { + // Create the version + + switch ($result['identifier']) { + case 'CREATE TABLE': + self::createVersion($dbname, $result['tablename'], '1'); + break; + case 'CREATE VIEW': + self::createVersion( + $dbname, $result['tablename'], '1', '', true + ); + break; + case 'CREATE DATABASE': + self::createDatabaseVersion($dbname, '1', $query); + break; + } // end switch + } + + // If version exists + if ($version != -1) { + if ($result['type'] == 'DDL') { + $save_to = 'schema_sql'; + } elseif ($result['type'] == 'DML') { + $save_to = 'data_sql'; + } else { + $save_to = ''; + } + $date = Util::date('Y-m-d H:i:s'); + + // Cut off `dbname`. from query + $query = preg_replace( + '/`' . preg_quote($dbname, '/') . '`\s?\./', + '', + $query + ); + + // Add log information + $query = self::getLogComment() . $query ; + + // Mark it as untouchable + $sql_query = " /*NOTRACK*/\n" + . " UPDATE " . self::_getTrackingTable() + . " SET " . Util::backquote($save_to) + . " = CONCAT( " . Util::backquote($save_to) . ",'\n" + . $GLOBALS['dbi']->escapeString($query) . "') ," + . " `date_updated` = '" . $date . "' "; + + // If table was renamed we have to change + // the tablename attribute in pma_tracking too + if ($result['identifier'] == 'RENAME TABLE') { + $sql_query .= ', `table_name` = \'' + . $GLOBALS['dbi']->escapeString($result['tablename_after_rename']) + . '\' '; + } + + // Save the tracking information only for + // 1. the database + // 2. the table / view + // 3. the statements + // we want to track + $sql_query .= + " WHERE FIND_IN_SET('" . $result['identifier'] . "',tracking) > 0" . + " AND `db_name` = '" . $GLOBALS['dbi']->escapeString($dbname) . "' " . + " AND `table_name` = '" + . $GLOBALS['dbi']->escapeString($result['tablename']) . "' " . + " AND `version` = '" . $GLOBALS['dbi']->escapeString($version) . "' "; + + $relation->queryAsControlUser($sql_query); + } + } + } + + /** + * Returns the tracking table + * + * @return string tracking table + */ + private static function _getTrackingTable() + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + return Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['tracking']); + } +} diff --git a/phpMyAdmin/libraries/classes/Tracking.php b/phpMyAdmin/libraries/classes/Tracking.php new file mode 100755 index 0000000..87c8d04 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Tracking.php @@ -0,0 +1,1274 @@ += $filter_ts_from + && $timestamp <= $filter_ts_to + && (in_array('*', $filter_users) || $filtered_user) + ) { + $tmp_entries[] = array( + 'id' => $id, + 'timestamp' => $timestamp, + 'username' => $entry['username'], + 'statement' => $entry['statement'] + ); + } + $id++; + } + return($tmp_entries); + } + + /** + * Function to get html for data definition and data manipulation statements + * + * @param string $urlQuery url query + * @param int $lastVersion last version + * @param string $db database + * @param array $selected selected tables + * @param string $type type of the table; table, view or both + * + * @return string HTML + */ + public static function getHtmlForDataDefinitionAndManipulationStatements( + $urlQuery, + $lastVersion, + $db, + array $selected, + $type = 'both' + ) { + return Template::get('table/tracking/create_version')->render([ + 'url_query' => $urlQuery, + 'last_version' => $lastVersion, + 'db' => $db, + 'selected' => $selected, + 'type' => $type, + 'default_statements' => $GLOBALS['cfg']['Server']['tracking_default_statements'], + ]); + } + + /** + * Function to get html for activate/deactivate tracking + * + * @param string $action activate|deactivate + * @param string $urlQuery url query + * @param int $lastVersion last version + * + * @return string HTML + */ + public static function getHtmlForActivateDeactivateTracking( + $action, + $urlQuery, + $lastVersion + ) { + return Template::get('table/tracking/activate_deactivate')->render([ + 'action' => $action, + 'url_query' => $urlQuery, + 'last_version' => $lastVersion, + 'db' => $GLOBALS['db'], + 'table' => $GLOBALS['table'], + ]); + } + + /** + * Function to get the list versions of the table + * + * @return array + */ + public static function getListOfVersionsOfTable() + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + $sql_query = " SELECT * FROM " . + Util::backquote($cfgRelation['db']) . "." . + Util::backquote($cfgRelation['tracking']) . + " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($GLOBALS['db']) . + "' " . + " AND table_name = '" . + $GLOBALS['dbi']->escapeString($GLOBALS['table']) . "' " . + " ORDER BY version DESC "; + + return $relation->queryAsControlUser($sql_query); + } + + /** + * Function to get html for displaying last version number + * + * @param array $sql_result sql result + * @param int $last_version last version + * @param array $url_params url parameters + * @param string $url_query url query + * @param string $pmaThemeImage path to theme's image folder + * @param string $text_dir text direction + * + * @return string + */ + public static function getHtmlForTableVersionDetails( + $sql_result, $last_version, array $url_params, + $url_query, $pmaThemeImage, $text_dir + ) { + $tracking_active = false; + + $html = '
    '; + $html .= Url::getHiddenInputs($GLOBALS['db'], $GLOBALS['table']); + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + + $GLOBALS['dbi']->dataSeek($sql_result, 0); + $delete = Util::getIcon('b_drop', __('Delete version')); + $report = Util::getIcon('b_report', __('Tracking report')); + $structure = Util::getIcon('b_props', __('Structure snapshot')); + + while ($version = $GLOBALS['dbi']->fetchArray($sql_result)) { + if ($version['version'] == $last_version) { + if ($version['tracking_active'] == 1) { + $tracking_active = true; + } else { + $tracking_active = false; + } + } + $checkbox_id = 'selected_versions_' . htmlspecialchars($version['version']); + + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= ''; + } + + $html .= ''; + $html .= '
    ' . __('Version') . '' . __('Created') . '' . __('Updated') . '' . __('Status') . '' . __('Action') . '' . __('Show') . '
    '; + $html .= ''; + $html .= ''; + $html .= ''; + $html .= '' . htmlspecialchars($version['date_created']) . '' . htmlspecialchars($version['date_updated']) . '' . self::getVersionStatus($version) . '' . $delete . '' . $report . ''; + $html .= '  '; + $html .= '' . $structure . ''; + $html .= '
    '; + + $html .= Template::get('select_all') + ->render( + array( + 'pma_theme_image' => $pmaThemeImage, + 'text_dir' => $text_dir, + 'form_name' => 'versionsForm', + ) + ); + $html .= Util::getButtonOrImage( + 'submit_mult', 'mult_submit', + __('Delete version'), 'b_drop', 'delete_version' + ); + + $html .= '
    '; + + if ($tracking_active) { + $html .= self::getHtmlForActivateDeactivateTracking( + 'deactivate', $url_query, $last_version + ); + } else { + $html .= self::getHtmlForActivateDeactivateTracking( + 'activate', $url_query, $last_version + ); + } + + return $html; + } + + /** + * Function to get the last version number of a table + * + * @param array $sql_result sql result + * + * @return int + */ + public static function getTableLastVersionNumber($sql_result) + { + $maxversion = $GLOBALS['dbi']->fetchArray($sql_result); + return intval(is_array($maxversion) ? $maxversion['version'] : null); + } + + /** + * Function to get sql results for selectable tables + * + * @return array + */ + public static function getSqlResultForSelectableTables() + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + + $sql_query = " SELECT DISTINCT db_name, table_name FROM " . + Util::backquote($cfgRelation['db']) . "." . + Util::backquote($cfgRelation['tracking']) . + " WHERE db_name = '" . $GLOBALS['dbi']->escapeString($GLOBALS['db']) . + "' " . + " ORDER BY db_name, table_name"; + + return $relation->queryAsControlUser($sql_query); + } + + /** + * Function to get html for selectable table rows + * + * @param array $selectableTablesSqlResult sql results for selectable rows + * @param string $urlQuery url query + * + * @return string + */ + public static function getHtmlForSelectableTables( + $selectableTablesSqlResult, + $urlQuery + ) { + $entries = []; + while ($entry = $GLOBALS['dbi']->fetchArray($selectableTablesSqlResult)) { + $entry['is_tracked'] = Tracker::isTracked( + $entry['db_name'], + $entry['table_name'] + ); + $entries[] = $entry; + } + + return Template::get('table/tracking/selectable_tables')->render([ + 'url_query' => $urlQuery, + 'db' => $GLOBALS['db'], + 'table' => $GLOBALS['table'], + 'entries' => $entries, + 'selected_table' => isset($_POST['table']) ? $_POST['table'] : null, + ]); + } + + /** + * Function to get html for tracking report and tracking report export + * + * @param string $url_query url query + * @param array $data data + * @param array $url_params url params + * @param boolean $selection_schema selection schema + * @param boolean $selection_data selection data + * @param boolean $selection_both selection both + * @param int $filter_ts_to filter time stamp from + * @param int $filter_ts_from filter time stamp tp + * @param array $filter_users filter users + * + * @return string + */ + public static function getHtmlForTrackingReport($url_query, array $data, array $url_params, + $selection_schema, $selection_data, $selection_both, $filter_ts_to, + $filter_ts_from, array $filter_users + ) { + $html = '

    ' . __('Tracking report') + . ' [' . __('Close') + . ']

    '; + + $html .= '' . __('Tracking statements') . ' ' + . htmlspecialchars($data['tracking']) . '
    '; + $html .= '
    '; + + list($str1, $str2, $str3, $str4, $str5) = self::getHtmlForElementsOfTrackingReport( + $selection_schema, $selection_data, $selection_both + ); + + // Prepare delete link content here + $drop_image_or_text = ''; + if (Util::showIcons('ActionLinksMode')) { + $drop_image_or_text .= Util::getImage( + 'b_drop', __('Delete tracking data row from report') + ); + } + if (Util::showText('ActionLinksMode')) { + $drop_image_or_text .= __('Delete'); + } + + /* + * First, list tracked data definition statements + */ + if (count($data['ddlog']) == 0 && count($data['dmlog']) == 0) { + $msg = Message::notice(__('No data')); + $msg->display(); + } + + $html .= self::getHtmlForTrackingReportExportForm1( + $data, $url_params, $selection_schema, $selection_data, $selection_both, + $filter_ts_to, $filter_ts_from, $filter_users, $str1, $str2, $str3, + $str4, $str5, $drop_image_or_text + ); + + $html .= self::getHtmlForTrackingReportExportForm2( + $url_params, $str1, $str2, $str3, $str4, $str5 + ); + + $html .= "



    \n"; + + return $html; + } + + /** + * Generate HTML element for report form + * + * @param boolean $selection_schema selection schema + * @param boolean $selection_data selection data + * @param boolean $selection_both selection both + * + * @return array + */ + public static function getHtmlForElementsOfTrackingReport( + $selection_schema, $selection_data, $selection_both + ) { + $str1 = ''; + $str2 = ''; + $str3 = ''; + $str4 = ''; + $str5 = '' + . ''; + return array($str1, $str2, $str3, $str4, $str5); + } + + /** + * Generate HTML for export form + * + * @param array $data data + * @param array $url_params url params + * @param boolean $selection_schema selection schema + * @param boolean $selection_data selection data + * @param boolean $selection_both selection both + * @param int $filter_ts_to filter time stamp from + * @param int $filter_ts_from filter time stamp tp + * @param array $filter_users filter users + * @param string $str1 HTML for logtype select + * @param string $str2 HTML for "from date" + * @param string $str3 HTML for "to date" + * @param string $str4 HTML for user + * @param string $str5 HTML for "list report" + * @param string $drop_image_or_text HTML for image or text + * + * @return string HTML for form + */ + public static function getHtmlForTrackingReportExportForm1( + array $data, array $url_params, $selection_schema, $selection_data, $selection_both, + $filter_ts_to, $filter_ts_from, array $filter_users, $str1, $str2, $str3, + $str4, $str5, $drop_image_or_text + ) { + $ddlog_count = 0; + + $html = '
    '; + $html .= Url::getHiddenInputs($url_params + [ + 'report' => 'true', + 'version' => $_POST['version'], + ]); + + $html .= sprintf( + __('Show %1$s with dates from %2$s to %3$s by user %4$s %5$s'), + $str1, $str2, $str3, $str4, $str5 + ); + + if ($selection_schema || $selection_both && count($data['ddlog']) > 0) { + list($temp, $ddlog_count) = self::getHtmlForDataDefinitionStatements( + $data, $filter_users, $filter_ts_from, $filter_ts_to, $url_params, + $drop_image_or_text + ); + $html .= $temp; + unset($temp); + } //endif + + /* + * Secondly, list tracked data manipulation statements + */ + if (($selection_data || $selection_both) && count($data['dmlog']) > 0) { + $html .= self::getHtmlForDataManipulationStatements( + $data, $filter_users, $filter_ts_from, $filter_ts_to, $url_params, + $ddlog_count, $drop_image_or_text + ); + } + $html .= '
    '; + return $html; + } + + /** + * Generate HTML for export form + * + * @param array $url_params Parameters + * @param string $str1 HTML for logtype select + * @param string $str2 HTML for "from date" + * @param string $str3 HTML for "to date" + * @param string $str4 HTML for user + * @param string $str5 HTML for "list report" + * + * @return string HTML for form + */ + public static function getHtmlForTrackingReportExportForm2( + array $url_params, $str1, $str2, $str3, $str4, $str5 + ) { + $html = '
    '; + $html .= Url::getHiddenInputs($url_params + [ + 'report' => 'true', + 'version' => $_POST['version'], + ]); + + $html .= sprintf( + __('Show %1$s with dates from %2$s to %3$s by user %4$s %5$s'), + $str1, $str2, $str3, $str4, $str5 + ); + $html .= '
    '; + + $html .= '
    '; + $html .= Url::getHiddenInputs($url_params + [ + 'report' => 'true', + 'version' => $_POST['version'], + 'logtype' => $_POST['logtype'], + 'date_from' => $_POST['date_from'], + 'date_to' => $_POST['date_to'], + 'users' => $_POST['users'], + 'report_export' => 'true', + ]); + + $str_export1 = ''; + + $str_export2 = ''; + + $html .= "
    " . sprintf(__('Export as %s'), $str_export1) + . $str_export2 . "
    "; + $html .= '
    '; + return $html; + } + + /** + * Function to get html for data manipulation statements + * + * @param array $data data + * @param array $filter_users filter users + * @param int $filter_ts_from filter time staml from + * @param int $filter_ts_to filter time stamp to + * @param array $url_params url parameters + * @param int $ddlog_count data definition log count + * @param string $drop_image_or_text drop image or text + * + * @return string + */ + public static function getHtmlForDataManipulationStatements(array $data, array $filter_users, + $filter_ts_from, $filter_ts_to, array $url_params, $ddlog_count, + $drop_image_or_text + ) { + // no need for the secondth returned parameter + list($html,) = self::getHtmlForDataStatements( + $data, $filter_users, $filter_ts_from, $filter_ts_to, $url_params, + $drop_image_or_text, 'dmlog', __('Data manipulation statement'), + $ddlog_count, 'dml_versions' + ); + + return $html; + } + + /** + * Function to get html for data definition statements in schema snapshot + * + * @param array $data data + * @param array $filter_users filter users + * @param int $filter_ts_from filter time stamp from + * @param int $filter_ts_to filter time stamp to + * @param array $url_params url parameters + * @param string $drop_image_or_text drop image or text + * + * @return array + */ + public static function getHtmlForDataDefinitionStatements(array $data, array $filter_users, + $filter_ts_from, $filter_ts_to, array $url_params, $drop_image_or_text + ) { + list($html, $line_number) = self::getHtmlForDataStatements( + $data, $filter_users, $filter_ts_from, $filter_ts_to, $url_params, + $drop_image_or_text, 'ddlog', __('Data definition statement'), + 1, 'ddl_versions' + ); + + return array($html, $line_number); + } + + /** + * Function to get html for data statements in schema snapshot + * + * @param array $data data + * @param array $filterUsers filter users + * @param int $filterTsFrom filter time stamp from + * @param int $filterTsTo filter time stamp to + * @param array $urlParams url parameters + * @param string $dropImageOrText drop image or text + * @param string $whichLog dmlog|ddlog + * @param string $headerMessage message for this section + * @param int $lineNumber line number + * @param string $tableId id for the table element + * + * @return array [$html, $lineNumber] + */ + private static function getHtmlForDataStatements( + array $data, + array $filterUsers, + $filterTsFrom, + $filterTsTo, + array $urlParams, + $dropImageOrText, + $whichLog, + $headerMessage, + $lineNumber, + $tableId + ) { + $offset = $lineNumber; + $entries = []; + foreach ($data[$whichLog] as $entry) { + $timestamp = strtotime($entry['date']); + if ($timestamp >= $filterTsFrom + && $timestamp <= $filterTsTo + && (in_array('*', $filterUsers) + || in_array($entry['username'], $filterUsers)) + ) { + $entry['formated_statement'] = Util::formatSql($entry['statement'], true); + $deleteParam = 'delete_' . $whichLog; + $entry['url_params'] = Url::getCommon($urlParams + [ + 'report' => 'true', + 'version' => $_POST['version'], + $deleteParam => ($lineNumber - $offset), + ], ''); + $entry['line_number'] = $lineNumber; + $entries[] = $entry; + } + $lineNumber++; + } + + $html = Template::get('table/tracking/report_table')->render([ + 'table_id' => $tableId, + 'header_message' => $headerMessage, + 'entries' => $entries, + 'drop_image_or_text' => $dropImageOrText, + ]); + + return [$html, $lineNumber]; + } + + /** + * Function to get html for schema snapshot + * + * @param string $url_query url query + * + * @return string + */ + public static function getHtmlForSchemaSnapshot($url_query) + { + $html = '

    ' . __('Structure snapshot') + . ' [' . __('Close') + . ']

    '; + $data = Tracker::getTrackedData( + $_POST['db'], $_POST['table'], $_POST['version'] + ); + + // Get first DROP TABLE/VIEW and CREATE TABLE/VIEW statements + $drop_create_statements = $data['ddlog'][0]['statement']; + + if (mb_strstr($data['ddlog'][0]['statement'], 'DROP TABLE') + || mb_strstr($data['ddlog'][0]['statement'], 'DROP VIEW') + ) { + $drop_create_statements .= $data['ddlog'][1]['statement']; + } + // Print SQL code + $html .= Util::getMessage( + sprintf( + __('Version %s snapshot (SQL code)'), + htmlspecialchars($_POST['version']) + ), + $drop_create_statements + ); + + // Unserialize snapshot + $temp = Core::safeUnserialize($data['schema_snapshot']); + if ($temp === null) { + $temp = array('COLUMNS' => array(), 'INDEXES' => array()); + } + $columns = $temp['COLUMNS']; + $indexes = $temp['INDEXES']; + $html .= self::getHtmlForColumns($columns); + + if (count($indexes) > 0) { + $html .= self::getHtmlForIndexes($indexes); + } // endif + $html .= '


    '; + + return $html; + } + + /** + * Function to get html for displaying columns in the schema snapshot + * + * @param array $columns columns + * + * @return string + */ + public static function getHtmlForColumns(array $columns) + { + return Template::get('table/tracking/structure_snapshot_columns')->render([ + 'columns' => $columns, + ]); + } + + /** + * Function to get html for the indexes in schema snapshot + * + * @param array $indexes indexes + * + * @return string + */ + public static function getHtmlForIndexes(array $indexes) + { + return Template::get('table/tracking/structure_snapshot_indexes')->render([ + 'indexes' => $indexes, + ]);; + } + + /** + * Function to handle the tracking report + * + * @param array &$data tracked data + * + * @return string HTML for the message + */ + public static function deleteTrackingReportRows(array &$data) + { + $html = ''; + if (isset($_POST['delete_ddlog'])) { + // Delete ddlog row data + $html .= self::deleteFromTrackingReportLog( + $data, + 'ddlog', + 'DDL', + __('Tracking data definition successfully deleted') + ); + } + + if (isset($_POST['delete_dmlog'])) { + // Delete dmlog row data + $html .= self::deleteFromTrackingReportLog( + $data, + 'dmlog', + 'DML', + __('Tracking data manipulation successfully deleted') + ); + } + return $html; + } + + /** + * Function to delete from a tracking report log + * + * @param array &$data tracked data + * @param string $which_log ddlog|dmlog + * @param string $type DDL|DML + * @param string $message success message + * + * @return string HTML for the message + */ + public static function deleteFromTrackingReportLog(array &$data, $which_log, $type, $message) + { + $html = ''; + $delete_id = $_POST['delete_' . $which_log]; + + // Only in case of valid id + if ($delete_id == (int)$delete_id) { + unset($data[$which_log][$delete_id]); + + $successfullyDeleted = Tracker::changeTrackingData( + $GLOBALS['db'], + $GLOBALS['table'], + $_POST['version'], + $type, + $data[$which_log] + ); + if ($successfullyDeleted) { + $msg = Message::success($message); + } else { + $msg = Message::rawError(__('Query error')); + } + $html .= $msg->getDisplay(); + } + return $html; + } + + /** + * Function to export as sql dump + * + * @param array $entries entries + * + * @return string HTML SQL query form + */ + public static function exportAsSqlDump(array $entries) + { + $html = ''; + $new_query = "# " + . __( + 'You can execute the dump by creating and using a temporary database. ' + . 'Please ensure that you have the privileges to do so.' + ) + . "\n" + . "# " . __('Comment out these two lines if you do not need them.') . "\n" + . "\n" + . "CREATE database IF NOT EXISTS pma_temp_db; \n" + . "USE pma_temp_db; \n" + . "\n"; + + foreach ($entries as $entry) { + $new_query .= $entry['statement']; + } + $msg = Message::success( + __('SQL statements exported. Please copy the dump or execute it.') + ); + $html .= $msg->getDisplay(); + + $db_temp = $GLOBALS['db']; + $table_temp = $GLOBALS['table']; + + $GLOBALS['db'] = $GLOBALS['table'] = ''; + + $html .= SqlQueryForm::getHtml($new_query, 'sql'); + + $GLOBALS['db'] = $db_temp; + $GLOBALS['table'] = $table_temp; + + return $html; + } + + /** + * Function to export as sql execution + * + * @param array $entries entries + * + * @return array + */ + public static function exportAsSqlExecution(array $entries) + { + $sql_result = array(); + foreach ($entries as $entry) { + $sql_result = $GLOBALS['dbi']->query("/*NOTRACK*/\n" . $entry['statement']); + } + + return $sql_result; + } + + /** + * Function to export as entries + * + * @param array $entries entries + * + * @return void + */ + public static function exportAsFileDownload(array $entries) + { + ini_set('url_rewriter.tags', ''); + + // Replace all multiple whitespaces by a single space + $table = htmlspecialchars(preg_replace('/\s+/', ' ', $_POST['table'])); + $dump = "# " . sprintf( + __('Tracking report for table `%s`'), $table + ) + . "\n" . "# " . date('Y-m-d H:i:s') . "\n"; + foreach ($entries as $entry) { + $dump .= $entry['statement']; + } + $filename = 'log_' . $table . '.sql'; + Response::getInstance()->disable(); + Core::downloadHeader( + $filename, + 'text/x-sql', + strlen($dump) + ); + echo $dump; + + exit(); + } + + /** + * Function to activate or deactivate tracking + * + * @param string $action activate|deactivate + * + * @return string HTML for the success message + */ + public static function changeTracking($action) + { + $html = ''; + if ($action == 'activate') { + $method = 'activateTracking'; + $message = __('Tracking for %1$s was activated at version %2$s.'); + } else { + $method = 'deactivateTracking'; + $message = __('Tracking for %1$s was deactivated at version %2$s.'); + } + $status = Tracker::$method( + $GLOBALS['db'], $GLOBALS['table'], $_POST['version'] + ); + if ($status) { + $msg = Message::success( + sprintf( + $message, + htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']), + htmlspecialchars($_POST['version']) + ) + ); + $html .= $msg->getDisplay(); + } + + return $html; + } + + /** + * Function to get tracking set + * + * @return string + */ + public static function getTrackingSet() + { + $tracking_set = ''; + + // a key is absent from the request if it has been removed from + // tracking_default_statements in the config + if (isset($_POST['alter_table']) && $_POST['alter_table'] == true) { + $tracking_set .= 'ALTER TABLE,'; + } + if (isset($_POST['rename_table']) && $_POST['rename_table'] == true) { + $tracking_set .= 'RENAME TABLE,'; + } + if (isset($_POST['create_table']) && $_POST['create_table'] == true) { + $tracking_set .= 'CREATE TABLE,'; + } + if (isset($_POST['drop_table']) && $_POST['drop_table'] == true) { + $tracking_set .= 'DROP TABLE,'; + } + if (isset($_POST['alter_view']) && $_POST['alter_view'] == true) { + $tracking_set .= 'ALTER VIEW,'; + } + if (isset($_POST['create_view']) && $_POST['create_view'] == true) { + $tracking_set .= 'CREATE VIEW,'; + } + if (isset($_POST['drop_view']) && $_POST['drop_view'] == true) { + $tracking_set .= 'DROP VIEW,'; + } + if (isset($_POST['create_index']) && $_POST['create_index'] == true) { + $tracking_set .= 'CREATE INDEX,'; + } + if (isset($_POST['drop_index']) && $_POST['drop_index'] == true) { + $tracking_set .= 'DROP INDEX,'; + } + if (isset($_POST['insert']) && $_POST['insert'] == true) { + $tracking_set .= 'INSERT,'; + } + if (isset($_POST['update']) && $_POST['update'] == true) { + $tracking_set .= 'UPDATE,'; + } + if (isset($_POST['delete']) && $_POST['delete'] == true) { + $tracking_set .= 'DELETE,'; + } + if (isset($_POST['truncate']) && $_POST['truncate'] == true) { + $tracking_set .= 'TRUNCATE,'; + } + $tracking_set = rtrim($tracking_set, ','); + + return $tracking_set; + } + + /** + * Deletes a tracking version + * + * @param string $version tracking version + * + * @return string HTML of the success message + */ + public static function deleteTrackingVersion($version) + { + $html = ''; + $versionDeleted = Tracker::deleteTracking( + $GLOBALS['db'], + $GLOBALS['table'], + $version + ); + if ($versionDeleted) { + $msg = Message::success( + sprintf( + __('Version %1$s of %2$s was deleted.'), + htmlspecialchars($version), + htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']) + ) + ); + $html .= $msg->getDisplay(); + } + + return $html; + } + + /** + * Function to create the tracking version + * + * @return string HTML of the success message + */ + public static function createTrackingVersion() + { + $html = ''; + $tracking_set = self::getTrackingSet(); + + $versionCreated = Tracker::createVersion( + $GLOBALS['db'], + $GLOBALS['table'], + $_POST['version'], + $tracking_set, + $GLOBALS['dbi']->getTable($GLOBALS['db'], $GLOBALS['table'])->isView() + ); + if ($versionCreated) { + $msg = Message::success( + sprintf( + __('Version %1$s was created, tracking for %2$s is active.'), + htmlspecialchars($_POST['version']), + htmlspecialchars($GLOBALS['db'] . '.' . $GLOBALS['table']) + ) + ); + $html .= $msg->getDisplay(); + } + + return $html; + } + + /** + * Create tracking version for multiple tables + * + * @param array $selected list of selected tables + * + * @return void + */ + public static function createTrackingForMultipleTables(array $selected) + { + $tracking_set = self::getTrackingSet(); + + foreach ($selected as $selected_table) { + Tracker::createVersion( + $GLOBALS['db'], + $selected_table, + $_POST['version'], + $tracking_set, + $GLOBALS['dbi']->getTable($GLOBALS['db'], $selected_table)->isView() + ); + } + } + + /** + * Function to get the entries + * + * @param array $data data + * @param int $filter_ts_from filter time stamp from + * @param int $filter_ts_to filter time stamp to + * @param array $filter_users filter users + * + * @return array + */ + public static function getEntries(array $data, $filter_ts_from, $filter_ts_to, array $filter_users) + { + $entries = array(); + // Filtering data definition statements + if ($_POST['logtype'] == 'schema' + || $_POST['logtype'] == 'schema_and_data' + ) { + $entries = array_merge( + $entries, + self::filterTracking( + $data['ddlog'], $filter_ts_from, $filter_ts_to, $filter_users + ) + ); + } + + // Filtering data manipulation statements + if ($_POST['logtype'] == 'data' + || $_POST['logtype'] == 'schema_and_data' + ) { + $entries = array_merge( + $entries, + self::filterTracking( + $data['dmlog'], $filter_ts_from, $filter_ts_to, $filter_users + ) + ); + } + + // Sort it + $ids = $timestamps = $usernames = $statements = array(); + foreach ($entries as $key => $row) { + $ids[$key] = $row['id']; + $timestamps[$key] = $row['timestamp']; + $usernames[$key] = $row['username']; + $statements[$key] = $row['statement']; + } + + array_multisort( + $timestamps, SORT_ASC, $ids, SORT_ASC, $usernames, + SORT_ASC, $statements, SORT_ASC, $entries + ); + + return $entries; + } + + /** + * Function to get version status + * + * @param array $version version info + * + * @return string $version_status The status message + */ + public static function getVersionStatus(array $version) + { + if ($version['tracking_active'] == 1) { + return __('active'); + } + + return __('not active'); + } + + /** + * Get HTML for untracked tables + * + * @param string $db current database + * @param array $untrackedTables untracked tables + * @param string $urlQuery url query string + * @param string $pmaThemeImage path to theme's image folder + * @param string $textDir text direction + * + * @return string HTML + */ + public static function getHtmlForUntrackedTables( + $db, + array $untrackedTables, + $urlQuery, + $pmaThemeImage, + $textDir + ) { + return Template::get('database/tracking/untracked_tables')->render([ + 'db' => $db, + 'untracked_tables' => $untrackedTables, + 'url_query' => $urlQuery, + 'pma_theme_image' => $pmaThemeImage, + 'text_dir' => $textDir, + ]); + } + + /** + * Helper function: Recursive function for getting table names from $table_list + * + * @param array $table_list Table list + * @param string $db Current database + * @param boolean $testing Testing + * + * @return array $untracked_tables + */ + public static function extractTableNames(array $table_list, $db, $testing = false) + { + $untracked_tables = array(); + $sep = $GLOBALS['cfg']['NavigationTreeTableSeparator']; + + foreach ($table_list as $key => $value) { + if (is_array($value) && array_key_exists(('is' . $sep . 'group'), $value) + && $value['is' . $sep . 'group'] + ) { + $untracked_tables = array_merge(self::extractTableNames($value, $db), $untracked_tables); //Recursion step + } + else { + if (is_array($value) && ($testing || Tracker::getVersion($db, $value['Name']) == -1)) { + $untracked_tables[] = $value['Name']; + } + } + } + return $untracked_tables; + } + + + /** + * Get untracked tables + * + * @param string $db current database + * + * @return array $untracked_tables + */ + public static function getUntrackedTables($db) + { + $table_list = Util::getTableList($db); + $untracked_tables = self::extractTableNames($table_list, $db); //Use helper function to get table list recursively. + return $untracked_tables; + } + + /** + * Get tracked tables + * + * @param string $db current database + * @param object $allTablesResult result set of tracked tables + * @param string $urlQuery url query string + * @param string $pmaThemeImage path to theme's image folder + * @param string $textDir text direction + * @param array $cfgRelation configuration storage info + * + * @return string HTML + */ + public static function getHtmlForTrackedTables( + $db, + $allTablesResult, + $urlQuery, + $pmaThemeImage, + $textDir, + array $cfgRelation + ) { + $relation = new Relation(); + $versions = []; + while ($oneResult = $GLOBALS['dbi']->fetchArray($allTablesResult)) { + list($tableName, $versionNumber) = $oneResult; + $tableQuery = ' SELECT * FROM ' . + Util::backquote($cfgRelation['db']) . '.' . + Util::backquote($cfgRelation['tracking']) . + ' WHERE `db_name` = \'' + . $GLOBALS['dbi']->escapeString($GLOBALS['db']) + . '\' AND `table_name` = \'' + . $GLOBALS['dbi']->escapeString($tableName) + . '\' AND `version` = \'' . $versionNumber . '\''; + + $tableResult = $relation->queryAsControlUser($tableQuery); + $versionData = $GLOBALS['dbi']->fetchArray($tableResult); + $versionData['status_button'] = self::getStatusButton( + $versionData, + $urlQuery + ); + $versions[] = $versionData; + } + return Template::get('database/tracking/tracked_tables')->render([ + 'db' => $db, + 'versions' => $versions, + 'text_dir' => $textDir, + 'pma_theme_image' => $pmaThemeImage, + ]); + } + + /** + * Get tracking status button + * + * @param array $versionData data about tracking versions + * @param string $urlQuery url query string + * + * @return string HTML + */ + private static function getStatusButton(array $versionData, $urlQuery) + { + $state = self::getVersionStatus($versionData); + $options = array( + 0 => array( + 'label' => __('not active'), + 'value' => 'deactivate_now', + 'selected' => ($state != 'active') + ), + 1 => array( + 'label' => __('active'), + 'value' => 'activate_now', + 'selected' => ($state == 'active') + ) + ); + $link = 'tbl_tracking.php' . $urlQuery . '&table=' + . htmlspecialchars($versionData['table_name']) + . '&version=' . $versionData['version']; + + return Util::toggleButton( + $link, + 'toggle_activation', + $options, + null + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Transformations.php b/phpMyAdmin/libraries/classes/Transformations.php new file mode 100755 index 0000000..9c52750 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Transformations.php @@ -0,0 +1,469 @@ + + * getOptions("'option ,, quoted',abd,'2,3',"); + * // array { + * // 'option ,, quoted', + * // 'abc', + * // '2,3', + * // '', + * // } + *
    + * + * @param string $option_string comma separated options + * + * @return array options + */ + public static function getOptions($option_string) + { + $result = array(); + + if (strlen($option_string) === 0 + || ! $transform_options = preg_split('/,/', $option_string) + ) { + return $result; + } + + while (($option = array_shift($transform_options)) !== null) { + $trimmed = trim($option); + if (strlen($trimmed) > 1 + && $trimmed[0] == "'" + && $trimmed[strlen($trimmed) - 1] == "'" + ) { + // '...' + $option = mb_substr($trimmed, 1, -1); + } elseif (isset($trimmed[0]) && $trimmed[0] == "'") { + // '..., + $trimmed = ltrim($option); + while (($option = array_shift($transform_options)) !== null) { + // ..., + $trimmed .= ',' . $option; + $rtrimmed = rtrim($trimmed); + if ($rtrimmed[strlen($rtrimmed) - 1] == "'") { + // ,...' + break; + } + } + $option = mb_substr($rtrimmed, 1, -1); + } + $result[] = stripslashes($option); + } + + return $result; + } + + /** + * Gets all available MIME-types + * + * @access public + * @staticvar array mimetypes + * @return array array[mimetype], array[transformation] + */ + public static function getAvailableMIMEtypes() + { + static $stack = null; + + if (null !== $stack) { + return $stack; + } + + $stack = array(); + $sub_dirs = array( + 'Input/' => 'input_', + 'Output/' => '', + '' => '' + ); + + foreach ($sub_dirs as $sd => $prefix) { + $handle = opendir('libraries/classes/Plugins/Transformations/' . $sd); + + if (! $handle) { + $stack[$prefix . 'transformation'] = array(); + $stack[$prefix . 'transformation_file'] = array(); + continue; + } + + $filestack = array(); + while ($file = readdir($handle)) { + // Ignore hidden files + if ($file[0] == '.') { + continue; + } + // Ignore old plugins (.class in filename) + if (strpos($file, '.class') !== false) { + continue; + } + $filestack[] = $file; + } + + closedir($handle); + sort($filestack); + + foreach ($filestack as $file) { + if (preg_match('|^[^.].*_.*_.*\.php$|', $file)) { + // File contains transformation functions. + $parts = explode('_', str_replace('.php', '', $file)); + $mimetype = $parts[0] . "/" . $parts[1]; + $stack['mimetype'][$mimetype] = $mimetype; + + $stack[$prefix . 'transformation'][] = $mimetype . ': ' . $parts[2]; + $stack[$prefix . 'transformation_file'][] = $sd . $file; + if ($sd === '') { + $stack['input_transformation'][] = $mimetype . ': ' . $parts[2]; + $stack['input_transformation_file'][] = $sd . $file; + } + + } elseif (preg_match('|^[^.].*\.php$|', $file)) { + // File is a plain mimetype, no functions. + $base = str_replace('.php', '', $file); + + if ($base != 'global') { + $mimetype = str_replace('_', '/', $base); + $stack['mimetype'][$mimetype] = $mimetype; + $stack['empty_mimetype'][$mimetype] = $mimetype; + } + } + } + } + return $stack; + } + + /** + * Returns the class name of the transformation + * + * @param string $filename transformation file name + * + * @return string the class name of transformation + */ + public static function getClassName($filename) + { + // get the transformation class name + $class_name = explode(".php", $filename); + $class_name = 'PhpMyAdmin\\' . str_replace('/', '\\', mb_substr($class_name[0], 18)); + + return $class_name; + } + + /** + * Returns the description of the transformation + * + * @param string $file transformation file + * + * @return string the description of the transformation + */ + public static function getDescription($file) + { + $include_file = 'libraries/classes/Plugins/Transformations/' . $file; + /* @var $class_name \PhpMyAdmin\Plugins\TransformationsInterface */ + $class_name = self::getClassName($include_file); + if (class_exists($class_name)) { + return $class_name::getInfo(); + } + return ''; + } + + /** + * Returns the name of the transformation + * + * @param string $file transformation file + * + * @return string the name of the transformation + */ + public static function getName($file) + { + $include_file = 'libraries/classes/Plugins/Transformations/' . $file; + /* @var $class_name \PhpMyAdmin\Plugins\TransformationsInterface */ + $class_name = self::getClassName($include_file); + if (class_exists($class_name)) { + return $class_name::getName(); + } + return ''; + } + + /** + * Fixups old MIME or transformation name to new one + * + * - applies some hardcoded fixups + * - adds spaces after _ and numbers + * - capitalizes words + * - removes back spaces + * + * @param string $value Value to fixup + * + * @return string + */ + static function fixupMIME($value) + { + $value = str_replace( + array("jpeg", "png"), array("JPEG", "PNG"), $value + ); + return str_replace( + ' ', + '', + ucwords( + preg_replace('/([0-9_]+)/', '$1 ', $value) + ) + ); + } + + /** + * Gets the mimetypes for all columns of a table + * + * @param string $db the name of the db to check for + * @param string $table the name of the table to check for + * @param boolean $strict whether to include only results having a mimetype set + * @param boolean $fullName whether to use full column names as the key + * + * @access public + * + * @return array [field_name][field_key] = field_value + */ + public static function getMIME($db, $table, $strict = false, $fullName = false) + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + + if (! $cfgRelation['mimework']) { + return false; + } + + $com_qry = ''; + if ($fullName) { + $com_qry .= "SELECT CONCAT(" + . "`db_name`, '.', `table_name`, '.', `column_name`" + . ") AS column_name, "; + } else { + $com_qry = "SELECT `column_name`, "; + } + $com_qry .= '`mimetype`, + `transformation`, + `transformation_options`, + `input_transformation`, + `input_transformation_options` + FROM ' . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['column_info']) . ' + WHERE `db_name` = \'' . $GLOBALS['dbi']->escapeString($db) . '\' + AND `table_name` = \'' . $GLOBALS['dbi']->escapeString($table) . '\' + AND ( `mimetype` != \'\'' . (!$strict ? ' + OR `transformation` != \'\' + OR `transformation_options` != \'\' + OR `input_transformation` != \'\' + OR `input_transformation_options` != \'\'' : '') . ')'; + $result = $GLOBALS['dbi']->fetchResult( + $com_qry, 'column_name', null, DatabaseInterface::CONNECT_CONTROL + ); + + foreach ($result as $column => $values) { + // convert mimetype to new format (f.e. Text_Plain, etc) + $delimiter_space = '- '; + $delimiter = "_"; + $values['mimetype'] = self::fixupMIME($values['mimetype']); + + // For transformation of form + // output/image_jpeg__inline.inc.php + // extract dir part. + $dir = explode('/', $values['transformation']); + $subdir = ''; + if (count($dir) === 2) { + $subdir = ucfirst($dir[0]) . '/'; + $values['transformation'] = $dir[1]; + } + + $values['transformation'] = self::fixupMIME($values['transformation']); + $values['transformation'] = $subdir . $values['transformation']; + $result[$column] = $values; + } + + return $result; + } // end of the 'getMIME()' function + + /** + * Set a single mimetype to a certain value. + * + * @param string $db the name of the db + * @param string $table the name of the table + * @param string $key the name of the column + * @param string $mimetype the mimetype of the column + * @param string $transformation the transformation of the column + * @param string $transformationOpts the transformation options of the column + * @param string $inputTransform the input transformation of the column + * @param string $inputTransformOpts the input transformation options of the column + * @param boolean $forcedelete force delete, will erase any existing + * comments for this column + * + * @access public + * + * @return boolean true, if comment-query was made. + */ + public static function setMIME($db, $table, $key, $mimetype, $transformation, + $transformationOpts, $inputTransform, $inputTransformOpts, $forcedelete = false + ) { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + + if (! $cfgRelation['mimework']) { + return false; + } + + // lowercase mimetype & transformation + $mimetype = mb_strtolower($mimetype); + $transformation = mb_strtolower($transformation); + + // Do we have any parameter to set? + $has_value = ( + strlen($mimetype) > 0 || + strlen($transformation) > 0 || + strlen($transformationOpts) > 0 || + strlen($inputTransform) > 0 || + strlen($inputTransformOpts) > 0 + ); + + $test_qry = ' + SELECT `mimetype`, + `comment` + FROM ' . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['column_info']) . ' + WHERE `db_name` = \'' . $GLOBALS['dbi']->escapeString($db) . '\' + AND `table_name` = \'' . $GLOBALS['dbi']->escapeString($table) . '\' + AND `column_name` = \'' . $GLOBALS['dbi']->escapeString($key) . '\''; + + $test_rs = $relation->queryAsControlUser( + $test_qry, true, DatabaseInterface::QUERY_STORE + ); + + if ($test_rs && $GLOBALS['dbi']->numRows($test_rs) > 0) { + $row = @$GLOBALS['dbi']->fetchAssoc($test_rs); + $GLOBALS['dbi']->freeResult($test_rs); + + if (! $forcedelete && ($has_value || strlen($row['comment']) > 0)) { + $upd_query = 'UPDATE ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['column_info']) + . ' SET ' + . '`mimetype` = \'' + . $GLOBALS['dbi']->escapeString($mimetype) . '\', ' + . '`transformation` = \'' + . $GLOBALS['dbi']->escapeString($transformation) . '\', ' + . '`transformation_options` = \'' + . $GLOBALS['dbi']->escapeString($transformationOpts) . '\', ' + . '`input_transformation` = \'' + . $GLOBALS['dbi']->escapeString($inputTransform) . '\', ' + . '`input_transformation_options` = \'' + . $GLOBALS['dbi']->escapeString($inputTransformOpts) . '\''; + } else { + $upd_query = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['column_info']); + } + $upd_query .= ' + WHERE `db_name` = \'' . $GLOBALS['dbi']->escapeString($db) . '\' + AND `table_name` = \'' . $GLOBALS['dbi']->escapeString($table) + . '\' + AND `column_name` = \'' . $GLOBALS['dbi']->escapeString($key) + . '\''; + } elseif ($has_value) { + + $upd_query = 'INSERT INTO ' + . Util::backquote($cfgRelation['db']) + . '.' . Util::backquote($cfgRelation['column_info']) + . ' (db_name, table_name, column_name, mimetype, ' + . 'transformation, transformation_options, ' + . 'input_transformation, input_transformation_options) ' + . ' VALUES(' + . '\'' . $GLOBALS['dbi']->escapeString($db) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($table) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($key) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($mimetype) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($transformation) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($transformationOpts) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($inputTransform) . '\',' + . '\'' . $GLOBALS['dbi']->escapeString($inputTransformOpts) . '\')'; + } + + if (isset($upd_query)) { + return $relation->queryAsControlUser($upd_query); + } + + return false; + } // end of 'setMIME()' function + + + /** + * GLOBAL Plugin functions + */ + + /** + * Delete related transformation details + * after deleting database. table or column + * + * @param string $db Database name + * @param string $table Table name + * @param string $column Column name + * + * @return boolean State of the query execution + */ + public static function clear($db, $table = '', $column = '') + { + $relation = new Relation(); + $cfgRelation = $relation->getRelationsParam(); + + if (! isset($cfgRelation['column_info'])) { + return false; + } + + $delete_sql = 'DELETE FROM ' + . Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['column_info']) + . ' WHERE '; + + if (($column != '') && ($table != '')) { + + $delete_sql .= '`db_name` = \'' . $db . '\' AND ' + . '`table_name` = \'' . $table . '\' AND ' + . '`column_name` = \'' . $column . '\' '; + + } elseif ($table != '') { + + $delete_sql .= '`db_name` = \'' . $db . '\' AND ' + . '`table_name` = \'' . $table . '\' '; + + } else { + $delete_sql .= '`db_name` = \'' . $db . '\' '; + } + + return $GLOBALS['dbi']->tryQuery($delete_sql); + + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/CharsetsExtension.php b/phpMyAdmin/libraries/classes/Twig/CharsetsExtension.php new file mode 100755 index 0000000..0bdd2c7 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/CharsetsExtension.php @@ -0,0 +1,44 @@ + array('html')) + ), + new TwigFunction( + 'Charsets_getCollationDropdownBox', + 'PhpMyAdmin\Charsets::getCollationDropdownBox', + array('is_safe' => array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/CoreExtension.php b/phpMyAdmin/libraries/classes/Twig/CoreExtension.php new file mode 100755 index 0000000..138fdcd --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/CoreExtension.php @@ -0,0 +1,35 @@ + array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/I18n/NodeTrans.php b/phpMyAdmin/libraries/classes/Twig/I18n/NodeTrans.php new file mode 100755 index 0000000..a24fe58 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/I18n/NodeTrans.php @@ -0,0 +1,169 @@ +node). + * The attributes are automatically made available as array items ($this['name']). + * + * @param Node $body Body of node trans + * @param Node $plural Node plural + * @param AbstractExpression $count Node count + * @param Node $context Node context + * @param Node $notes Node notes + * @param int $lineno The line number + * @param string $tag The tag name associated with the Node + */ + public function __construct( + Node $body, + Node $plural = null, + AbstractExpression $count = null, + Node $context = null, + Node $notes = null, + $lineno, + $tag = null + ) { + $nodes = array('body' => $body); + if (null !== $count) { + $nodes['count'] = $count; + } + if (null !== $plural) { + $nodes['plural'] = $plural; + } + if (null !== $context) { + $nodes['context'] = $context; + } + if (null !== $notes) { + $nodes['notes'] = $notes; + } + + Node::__construct($nodes, array(), $lineno, $tag); + } + + /** + * Compiles the node to PHP. + * + * @param Compiler $compiler Node compiler + * + * @return void + */ + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + list($msg, $vars) = $this->compileString($this->getNode('body')); + + if ($this->hasNode('plural')) { + list($msg1, $vars1) = $this->compileString($this->getNode('plural')); + + $vars = array_merge($vars, $vars1); + } + + $function = $this->getTransFunction( + $this->hasNode('plural'), + $this->hasNode('context') + ); + + if ($this->hasNode('notes')) { + $message = trim($this->getNode('notes')->getAttribute('data')); + + // line breaks are not allowed cause we want a single line comment + $message = str_replace(array("\n", "\r"), ' ', $message); + $compiler->write("// l10n: {$message}\n"); + } + + if ($vars) { + $compiler + ->write('echo strtr(' . $function . '(') + ->subcompile($msg) + ; + + if ($this->hasNode('plural')) { + $compiler + ->raw(', ') + ->subcompile($msg1) + ->raw(', abs(') + ->subcompile($this->hasNode('count') ? $this->getNode('count') : null) + ->raw(')') + ; + } + + $compiler->raw('), array('); + + foreach ($vars as $var) { + if ('count' === $var->getAttribute('name')) { + $compiler + ->string('%count%') + ->raw(' => abs(') + ->subcompile($this->hasNode('count') ? $this->getNode('count') : null) + ->raw('), ') + ; + } else { + $compiler + ->string('%' . $var->getAttribute('name') . '%') + ->raw(' => ') + ->subcompile($var) + ->raw(', ') + ; + } + } + + $compiler->raw("));\n"); + } else { + $compiler->write('echo ' . $function . '('); + + if ($this->hasNode('context')) { + $context = trim($this->getNode('context')->getAttribute('data')); + $compiler->write('"' . $context . '", '); + } + + $compiler->subcompile($msg); + + if ($this->hasNode('plural')) { + $compiler + ->raw(', ') + ->subcompile($msg1) + ->raw(', abs(') + ->subcompile($this->hasNode('count') ? $this->getNode('count') : null) + ->raw(')') + ; + } + + $compiler->raw(");\n"); + } + } + + /** + * @param bool $plural Return plural or singular function to use + * @param bool $hasMsgContext It has message context? + * + * @return string + */ + protected function getTransFunction($plural, $hasMsgContext = false) + { + if ($hasMsgContext) { + return $plural ? '_ngettext' : '_pgettext'; + } + + return $plural ? '_ngettext' : '_gettext'; + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/I18n/TokenParserTrans.php b/phpMyAdmin/libraries/classes/Twig/I18n/TokenParserTrans.php new file mode 100755 index 0000000..44743e9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/I18n/TokenParserTrans.php @@ -0,0 +1,81 @@ +getLine(); + $stream = $this->parser->getStream(); + $count = null; + $plural = null; + $notes = null; + $context = null; + + if (!$stream->test(Token::BLOCK_END_TYPE)) { + $body = $this->parser->getExpressionParser()->parseExpression(); + } else { + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(array($this, 'decideForFork')); + $next = $stream->next()->getValue(); + + if ('plural' === $next) { + $count = $this->parser->getExpressionParser()->parseExpression(); + $stream->expect(Token::BLOCK_END_TYPE); + $plural = $this->parser->subparse(array($this, 'decideForFork')); + + if ('notes' === $stream->next()->getValue()) { + $stream->expect(Token::BLOCK_END_TYPE); + $notes = $this->parser->subparse(array($this, 'decideForEnd'), true); + } + } elseif ('context' === $next) { + $stream->expect(Token::BLOCK_END_TYPE); + $context = $this->parser->subparse(array($this, 'decideForEnd'), true); + } elseif ('notes' === $next) { + $stream->expect(Token::BLOCK_END_TYPE); + $notes = $this->parser->subparse(array($this, 'decideForEnd'), true); + } + } + + $stream->expect(Token::BLOCK_END_TYPE); + + $this->checkTransString($body, $lineno); + + return new NodeTrans($body, $plural, $count, $context, $notes, $lineno, $this->getTag()); + } + + /** + * Tests the current token for a type. + * + * @param Token $token Twig token to test + * + * @return bool + */ + public function decideForFork(Token $token) + { + return $token->test(array('plural', 'context', 'notes', 'endtrans')); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/I18nExtension.php b/phpMyAdmin/libraries/classes/Twig/I18nExtension.php new file mode 100755 index 0000000..dc66830 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/I18nExtension.php @@ -0,0 +1,42 @@ + array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/MessageExtension.php b/phpMyAdmin/libraries/classes/Twig/MessageExtension.php new file mode 100755 index 0000000..c2d0796 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/MessageExtension.php @@ -0,0 +1,45 @@ +getDisplay(); + }, + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Message_error', + function ($string) { + return Message::error($string)->getDisplay(); + }, + array('is_safe' => array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/PartitionExtension.php b/phpMyAdmin/libraries/classes/Twig/PartitionExtension.php new file mode 100755 index 0000000..d4d49cd --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/PartitionExtension.php @@ -0,0 +1,35 @@ + array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/PhpFunctionsExtension.php b/phpMyAdmin/libraries/classes/Twig/PhpFunctionsExtension.php new file mode 100755 index 0000000..4cf7fc2 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/PhpFunctionsExtension.php @@ -0,0 +1,39 @@ + array('html')) + ), + new TwigFunction( + 'Plugins_getChoice', + 'PhpMyAdmin\Plugins::getChoice', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Plugins_getDefault', + 'PhpMyAdmin\Plugins::getDefault', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Plugins_getOptions', + 'PhpMyAdmin\Plugins::getOptions', + array('is_safe' => array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/RelationExtension.php b/phpMyAdmin/libraries/classes/Twig/RelationExtension.php new file mode 100755 index 0000000..ce69ffd --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/RelationExtension.php @@ -0,0 +1,54 @@ + array('html')) + ), + new TwigFunction( + 'Relation_getDisplayField', + [$relation, 'getDisplayField'], + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Relation_getForeignData', + [$relation, 'getForeignData'] + ), + new TwigFunction( + 'Relation_getTables', + [$relation, 'getTables'] + ), + new TwigFunction( + 'Relation_searchColumnInForeigners', + [$relation, 'searchColumnInForeigners'] + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/SanitizeExtension.php b/phpMyAdmin/libraries/classes/Twig/SanitizeExtension.php new file mode 100755 index 0000000..668e2ae --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/SanitizeExtension.php @@ -0,0 +1,45 @@ + array('html')) + ), + new TwigFunction( + 'Sanitize_jsFormat', + 'PhpMyAdmin\Sanitize::jsFormat', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Sanitize_sanitize', + 'PhpMyAdmin\Sanitize::sanitize', + array('is_safe' => array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/ServerPrivilegesExtension.php b/phpMyAdmin/libraries/classes/Twig/ServerPrivilegesExtension.php new file mode 100755 index 0000000..df7d4b8 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/ServerPrivilegesExtension.php @@ -0,0 +1,35 @@ + array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/StorageEngineExtension.php b/phpMyAdmin/libraries/classes/Twig/StorageEngineExtension.php new file mode 100755 index 0000000..9ce01f9 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/StorageEngineExtension.php @@ -0,0 +1,35 @@ + array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/TableExtension.php b/phpMyAdmin/libraries/classes/Twig/TableExtension.php new file mode 100755 index 0000000..c736e40 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/TableExtension.php @@ -0,0 +1,34 @@ + array('html')) + ), + new TwigFunction( + 'Url_getHiddenFields', + 'PhpMyAdmin\Url::getHiddenFields', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Url_getCommon', + 'PhpMyAdmin\Url::getCommon', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Url_getCommonRaw', + 'PhpMyAdmin\Url::getCommonRaw', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Url_link', + 'PhpMyAdmin\Core::linkURL' + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Twig/UtilExtension.php b/phpMyAdmin/libraries/classes/Twig/UtilExtension.php new file mode 100755 index 0000000..3a483d0 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Twig/UtilExtension.php @@ -0,0 +1,189 @@ + array('html')) + ), + new TwigFunction( + 'Util_convertBitDefaultValue', + 'PhpMyAdmin\Util::convertBitDefaultValue' + ), + new TwigFunction( + 'Util_escapeMysqlWildcards', + 'PhpMyAdmin\Util::escapeMysqlWildcards' + ), + new TwigFunction( + 'Util_extractColumnSpec', + 'PhpMyAdmin\Util::extractColumnSpec' + ), + new TwigFunction( + 'Util_formatByteDown', + 'PhpMyAdmin\Util::formatByteDown' + ), + new TwigFunction( + 'Util_formatNumber', + 'PhpMyAdmin\Util::formatNumber' + ), + new TwigFunction( + 'Util_formatSql', + 'PhpMyAdmin\Util::formatSql', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getButtonOrImage', + 'PhpMyAdmin\Util::getButtonOrImage', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getClassForType', + 'PhpMyAdmin\Util::getClassForType', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getDivForSliderEffect', + 'PhpMyAdmin\Util::getDivForSliderEffect', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getDocuLink', + 'PhpMyAdmin\Util::getDocuLink', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getListNavigator', + 'PhpMyAdmin\Util::getListNavigator', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_showDocu', + 'PhpMyAdmin\Util::showDocu', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getDropdown', + 'PhpMyAdmin\Util::getDropdown', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getFKCheckbox', + 'PhpMyAdmin\Util::getFKCheckbox', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getGISDatatypes', + 'PhpMyAdmin\Util::getGISDatatypes' + ), + new TwigFunction( + 'Util_getGISFunctions', + 'PhpMyAdmin\Util::getGISFunctions' + ), + new TwigFunction( + 'Util_getHtmlTab', + 'PhpMyAdmin\Util::getHtmlTab', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getIcon', + 'PhpMyAdmin\Util::getIcon', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getImage', + 'PhpMyAdmin\Util::getImage', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getRadioFields', + 'PhpMyAdmin\Util::getRadioFields', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getSelectUploadFileBlock', + 'PhpMyAdmin\Util::getSelectUploadFileBlock', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getScriptNameForOption', + 'PhpMyAdmin\Util::getScriptNameForOption', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getStartAndNumberOfRowsPanel', + 'PhpMyAdmin\Util::getStartAndNumberOfRowsPanel', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_getSupportedDatatypes', + 'PhpMyAdmin\Util::getSupportedDatatypes', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_isForeignKeySupported', + 'PhpMyAdmin\Util::isForeignKeySupported' + ), + new TwigFunction( + 'Util_linkOrButton', + 'PhpMyAdmin\Util::linkOrButton', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_localisedDate', + 'PhpMyAdmin\Util::localisedDate' + ), + new TwigFunction( + 'Util_showHint', + 'PhpMyAdmin\Util::showHint', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_showDocu', + 'PhpMyAdmin\Util::showDocu', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_showIcons', + 'PhpMyAdmin\Util::showIcons' + ), + new TwigFunction( + 'Util_showMySQLDocu', + 'PhpMyAdmin\Util::showMySQLDocu', + array('is_safe' => array('html')) + ), + new TwigFunction( + 'Util_sortableTableHeader', + 'PhpMyAdmin\Util::sortableTableHeader', + array('is_safe' => array('html')) + ), + ); + } +} diff --git a/phpMyAdmin/libraries/classes/TwoFactor.php b/phpMyAdmin/libraries/classes/TwoFactor.php new file mode 100755 index 0000000..efdf89b --- /dev/null +++ b/phpMyAdmin/libraries/classes/TwoFactor.php @@ -0,0 +1,292 @@ +initRelationParamsCache(); + + $this->userPreferences = new UserPreferences(); + $this->user = $user; + $this->_available = $this->getAvailable(); + $this->config = $this->readConfig(); + $this->_writable = ($this->config['type'] == 'db'); + $this->_backend = $this->getBackend(); + } + + /** + * Reads the configuration + * + * @return array + */ + public function readConfig() + { + $result = []; + $config = $this->userPreferences->load(); + if (isset($config['config_data']['2fa'])) { + $result = $config['config_data']['2fa']; + } + $result['type'] = $config['type']; + if (! isset($result['backend'])) { + $result['backend'] = ''; + } + if (! isset($result['settings'])) { + $result['settings'] = []; + } + return $result; + } + + /** + * Get any property of this class + * + * @param string $property name of the property + * + * @return mixed|void if property exist, value of the relevant property + */ + public function __get($property) + { + switch ($property) { + case 'backend': + return $this->_backend; + case 'available': + return $this->_available; + case 'writable': + return $this->_writable; + case 'showSubmit': + $backend = $this->_backend; + return $backend::$showSubmit; + } + } + + /** + * Returns list of available backends + * + * @return array + */ + public function getAvailable() + { + $result = []; + if ($GLOBALS['cfg']['DBG']['simple2fa']) { + $result[] = 'simple'; + } + if (class_exists('PragmaRX\Google2FA\Google2FA') && class_exists('BaconQrCode\Renderer\Image\Png')) { + $result[] = 'application'; + } + if (class_exists('Samyoul\U2F\U2FServer\U2FServer')) { + $result[] = 'key'; + } + return $result; + } + + /** + * Returns list of missing dependencies + * + * @return array + */ + public function getMissingDeps() + { + $result = []; + if (!class_exists('PragmaRX\Google2FA\Google2FA')) { + $result[] = [ + 'class' => \PhpMyAdmin\Plugins\TwoFactor\Application::getName(), + 'dep' => 'pragmarx/google2fa', + ]; + } + if (!class_exists('BaconQrCode\Renderer\Image\Png')) { + $result[] = [ + 'class' => \PhpMyAdmin\Plugins\TwoFactor\Application::getName(), + 'dep' => 'bacon/bacon-qr-code', + ]; + } + if (!class_exists('Samyoul\U2F\U2FServer\U2FServer')) { + $result[] = [ + 'class' => \PhpMyAdmin\Plugins\TwoFactor\Key::getName(), + 'dep' => 'samyoul/u2f-php-server', + ]; + } + return $result; + } + + /** + * Returns class name for given name + * + * @param string $name Backend name + * + * @return string + */ + public function getBackendClass($name) + { + $result = 'PhpMyAdmin\\Plugins\\TwoFactorPlugin'; + if (in_array($name, $this->_available)) { + $result = 'PhpMyAdmin\\Plugins\\TwoFactor\\' . ucfirst($name); + } elseif (! empty($name)) { + $result = 'PhpMyAdmin\\Plugins\\TwoFactor\\Invalid'; + } + return $result; + } + + /** + * Returns backend for current user + * + * @return PhpMyAdmin\Plugins\TwoFactorPlugin + */ + public function getBackend() + { + $name = $this->getBackendClass($this->config['backend']); + return new $name($this); + } + + /** + * Checks authentication, returns true on success + * + * @param boolean $skip_session Skip session cache + * + * @return boolean + */ + public function check($skip_session = false) + { + if ($skip_session) { + return $this->_backend->check(); + } + if (empty($_SESSION['two_factor_check'])) { + $_SESSION['two_factor_check'] = $this->_backend->check(); + } + return $_SESSION['two_factor_check']; + } + + /** + * Renders user interface to enter two-factor authentication + * + * @return string HTML code + */ + public function render() + { + return $this->_backend->getError() . $this->_backend->render(); + } + + /** + * Renders user interface to configure two-factor authentication + * + * @return string HTML code + */ + public function setup() + { + return $this->_backend->getError() . $this->_backend->setup(); + } + + /** + * Saves current configuration. + * + * @return true|PhpMyAdmin\Message + */ + public function save() + { + return $this->userPreferences->persistOption('2fa', $this->config, null); + } + + /** + * Changes two-factor authentication settings + * + * The object might stay in partialy changed setup + * if configuration fails. + * + * @param string $name Backend name + * + * @return boolean + */ + public function configure($name) + { + $this->config = [ + 'backend' => $name + ]; + if ($name === '') { + $cls = $this->getBackendClass($name); + $this->config['settings'] = []; + $this->_backend = new $cls($this); + } else { + if (! in_array($name, $this->_available)) { + return false; + } + $cls = $this->getBackendClass($name); + $this->config['settings'] = []; + $this->_backend = new $cls($this); + if (! $this->_backend->configure()) { + return false; + } + } + $result = $this->save(); + if ($result !== true) { + $result->display(); + } + return true; + } + + /** + * Returns array with all available backends + * + * @return array + */ + public function getAllBackends() + { + $all = array_merge([''], $this->available); + $backends = []; + foreach ($all as $name) { + $cls = $this->getBackendClass($name); + $backends[] = [ + 'id' => $cls::$id, + 'name' => $cls::getName(), + 'description' => $cls::getDescription(), + ]; + } + return $backends; + } +} diff --git a/phpMyAdmin/libraries/classes/Types.php b/phpMyAdmin/libraries/classes/Types.php new file mode 100755 index 0000000..d53bcc2 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Types.php @@ -0,0 +1,828 @@ +_dbi = $dbi; + } + + /** + * Returns list of unary operators. + * + * @return string[] + */ + public function getUnaryOperators() + { + return array( + 'IS NULL', + 'IS NOT NULL', + "= ''", + "!= ''", + ); + } + + /** + * Check whether operator is unary. + * + * @param string $op operator name + * + * @return boolean + */ + public function isUnaryOperator($op) + { + return in_array($op, $this->getUnaryOperators()); + } + + /** + * Returns list of operators checking for NULL. + * + * @return string[] + */ + public function getNullOperators() + { + return array( + 'IS NULL', + 'IS NOT NULL', + ); + } + + /** + * ENUM search operators + * + * @return string[] + */ + public function getEnumOperators() + { + return array( + '=', + '!=', + ); + } + + /** + * TEXT search operators + * + * @return string[] + */ + public function getTextOperators() + { + return array( + 'LIKE', + 'LIKE %...%', + 'NOT LIKE', + '=', + '!=', + 'REGEXP', + 'REGEXP ^...$', + 'NOT REGEXP', + "= ''", + "!= ''", + 'IN (...)', + 'NOT IN (...)', + 'BETWEEN', + 'NOT BETWEEN', + ); + } + + /** + * Number search operators + * + * @return string[] + */ + public function getNumberOperators() + { + return array( + '=', + '>', + '>=', + '<', + '<=', + '!=', + 'LIKE', + 'LIKE %...%', + 'NOT LIKE', + 'IN (...)', + 'NOT IN (...)', + 'BETWEEN', + 'NOT BETWEEN', + ); + } + + /** + * Returns operators for given type + * + * @param string $type Type of field + * @param boolean $null Whether field can be NULL + * + * @return string[] + */ + public function getTypeOperators($type, $null) + { + $ret = array(); + $class = $this->getTypeClass($type); + + if (strncasecmp($type, 'enum', 4) == 0) { + $ret = array_merge($ret, $this->getEnumOperators()); + } elseif ($class == 'CHAR') { + $ret = array_merge($ret, $this->getTextOperators()); + } else { + $ret = array_merge($ret, $this->getNumberOperators()); + } + + if ($null) { + $ret = array_merge($ret, $this->getNullOperators()); + } + + return $ret; + } + + /** + * Returns operators for given type as html options + * + * @param string $type Type of field + * @param boolean $null Whether field can be NULL + * @param string $selectedOperator Option to be selected + * + * @return string Generated Html + */ + public function getTypeOperatorsHtml($type, $null, $selectedOperator = null) + { + $html = ''; + + foreach ($this->getTypeOperators($type, $null) as $fc) { + if (isset($selectedOperator) && $selectedOperator == $fc) { + $selected = ' selected="selected"'; + } else { + $selected = ''; + } + $html .= ''; + } + + return $html; + } + + /** + * Returns the data type description. + * + * @param string $type The data type to get a description. + * + * @return string + * + */ + public function getTypeDescription($type) + { + $type = mb_strtoupper($type); + switch ($type) { + case 'TINYINT': + return __( + 'A 1-byte integer, signed range is -128 to 127, unsigned range is ' . + '0 to 255' + ); + case 'SMALLINT': + return __( + 'A 2-byte integer, signed range is -32,768 to 32,767, unsigned ' . + 'range is 0 to 65,535' + ); + case 'MEDIUMINT': + return __( + 'A 3-byte integer, signed range is -8,388,608 to 8,388,607, ' . + 'unsigned range is 0 to 16,777,215' + ); + case 'INT': + return __( + 'A 4-byte integer, signed range is ' . + '-2,147,483,648 to 2,147,483,647, unsigned range is 0 to ' . + '4,294,967,295' + ); + case 'BIGINT': + return __( + 'An 8-byte integer, signed range is -9,223,372,036,854,775,808 ' . + 'to 9,223,372,036,854,775,807, unsigned range is 0 to ' . + '18,446,744,073,709,551,615' + ); + case 'DECIMAL': + return __( + 'A fixed-point number (M, D) - the maximum number of digits (M) ' . + 'is 65 (default 10), the maximum number of decimals (D) is 30 ' . + '(default 0)' + ); + case 'FLOAT': + return __( + 'A small floating-point number, allowable values are ' . + '-3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38 to ' . + '3.402823466E+38' + ); + case 'DOUBLE': + return __( + 'A double-precision floating-point number, allowable values are ' . + '-1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and ' . + '2.2250738585072014E-308 to 1.7976931348623157E+308' + ); + case 'REAL': + return __( + 'Synonym for DOUBLE (exception: in REAL_AS_FLOAT SQL mode it is ' . + 'a synonym for FLOAT)' + ); + case 'BIT': + return __( + 'A bit-field type (M), storing M of bits per value (default is 1, ' . + 'maximum is 64)' + ); + case 'BOOLEAN': + return __( + 'A synonym for TINYINT(1), a value of zero is considered false, ' . + 'nonzero values are considered true' + ); + case 'SERIAL': + return __('An alias for BIGINT UNSIGNED NOT NULL AUTO_INCREMENT UNIQUE'); + case 'DATE': + return sprintf( + __('A date, supported range is %1$s to %2$s'), '1000-01-01', + '9999-12-31' + ); + case 'DATETIME': + return sprintf( + __('A date and time combination, supported range is %1$s to %2$s'), + '1000-01-01 00:00:00', '9999-12-31 23:59:59' + ); + case 'TIMESTAMP': + return __( + 'A timestamp, range is 1970-01-01 00:00:01 UTC to 2038-01-09 ' . + '03:14:07 UTC, stored as the number of seconds since the epoch ' . + '(1970-01-01 00:00:00 UTC)' + ); + case 'TIME': + return sprintf( + __('A time, range is %1$s to %2$s'), '-838:59:59', '838:59:59' + ); + case 'YEAR': + return __( + "A year in four-digit (4, default) or two-digit (2) format, the " . + "allowable values are 70 (1970) to 69 (2069) or 1901 to 2155 and " . + "0000" + ); + case 'CHAR': + return __( + 'A fixed-length (0-255, default 1) string that is always ' . + 'right-padded with spaces to the specified length when stored' + ); + case 'VARCHAR': + return sprintf( + __( + 'A variable-length (%s) string, the effective maximum length ' . + 'is subject to the maximum row size' + ), '0-65,535' + ); + case 'TINYTEXT': + return __( + 'A TEXT column with a maximum length of 255 (2^8 - 1) characters, ' . + 'stored with a one-byte prefix indicating the length of the value ' . + 'in bytes' + ); + case 'TEXT': + return __( + 'A TEXT column with a maximum length of 65,535 (2^16 - 1) ' . + 'characters, stored with a two-byte prefix indicating the length ' . + 'of the value in bytes' + ); + case 'MEDIUMTEXT': + return __( + 'A TEXT column with a maximum length of 16,777,215 (2^24 - 1) ' . + 'characters, stored with a three-byte prefix indicating the ' . + 'length of the value in bytes' + ); + case 'LONGTEXT': + return __( + 'A TEXT column with a maximum length of 4,294,967,295 or 4GiB ' . + '(2^32 - 1) characters, stored with a four-byte prefix indicating ' . + 'the length of the value in bytes' + ); + case 'BINARY': + return __( + 'Similar to the CHAR type, but stores binary byte strings rather ' . + 'than non-binary character strings' + ); + case 'VARBINARY': + return __( + 'Similar to the VARCHAR type, but stores binary byte strings ' . + 'rather than non-binary character strings' + ); + case 'TINYBLOB': + return __( + 'A BLOB column with a maximum length of 255 (2^8 - 1) bytes, ' . + 'stored with a one-byte prefix indicating the length of the value' + ); + case 'MEDIUMBLOB': + return __( + 'A BLOB column with a maximum length of 16,777,215 (2^24 - 1) ' . + 'bytes, stored with a three-byte prefix indicating the length of ' . + 'the value' + ); + case 'BLOB': + return __( + 'A BLOB column with a maximum length of 65,535 (2^16 - 1) bytes, ' . + 'stored with a two-byte prefix indicating the length of the value' + ); + case 'LONGBLOB': + return __( + 'A BLOB column with a maximum length of 4,294,967,295 or 4GiB ' . + '(2^32 - 1) bytes, stored with a four-byte prefix indicating the ' . + 'length of the value' + ); + case 'ENUM': + return __( + "An enumeration, chosen from the list of up to 65,535 values or " . + "the special '' error value" + ); + case 'SET': + return __("A single value chosen from a set of up to 64 members"); + case 'GEOMETRY': + return __('A type that can store a geometry of any type'); + case 'POINT': + return __('A point in 2-dimensional space'); + case 'LINESTRING': + return __('A curve with linear interpolation between points'); + case 'POLYGON': + return __('A polygon'); + case 'MULTIPOINT': + return __('A collection of points'); + case 'MULTILINESTRING': + return __( + 'A collection of curves with linear interpolation between points' + ); + case 'MULTIPOLYGON': + return __('A collection of polygons'); + case 'GEOMETRYCOLLECTION': + return __('A collection of geometry objects of any type'); + case 'JSON': + return __( + 'Stores and enables efficient access to data in JSON' + . ' (JavaScript Object Notation) documents' + ); + } + return ''; + } + + /** + * Returns class of a type, used for functions available for type + * or default values. + * + * @param string $type The data type to get a class. + * + * @return string + * + */ + public function getTypeClass($type) + { + $type = mb_strtoupper($type); + switch ($type) { + case 'TINYINT': + case 'SMALLINT': + case 'MEDIUMINT': + case 'INT': + case 'BIGINT': + case 'DECIMAL': + case 'FLOAT': + case 'DOUBLE': + case 'REAL': + case 'BIT': + case 'BOOLEAN': + case 'SERIAL': + return 'NUMBER'; + + case 'DATE': + case 'DATETIME': + case 'TIMESTAMP': + case 'TIME': + case 'YEAR': + return 'DATE'; + + case 'CHAR': + case 'VARCHAR': + case 'TINYTEXT': + case 'TEXT': + case 'MEDIUMTEXT': + case 'LONGTEXT': + case 'BINARY': + case 'VARBINARY': + case 'TINYBLOB': + case 'MEDIUMBLOB': + case 'BLOB': + case 'LONGBLOB': + case 'ENUM': + case 'SET': + return 'CHAR'; + + case 'GEOMETRY': + case 'POINT': + case 'LINESTRING': + case 'POLYGON': + case 'MULTIPOINT': + case 'MULTILINESTRING': + case 'MULTIPOLYGON': + case 'GEOMETRYCOLLECTION': + return 'SPATIAL'; + + case 'JSON': + return 'JSON'; + } + + return ''; + } + + /** + * Returns array of functions available for a class. + * + * @param string $class The class to get function list. + * + * @return string[] + * + */ + public function getFunctionsClass($class) + { + $isMariaDB = $this->_dbi->isMariaDB(); + $serverVersion = $this->_dbi->getVersion(); + + switch ($class) { + case 'CHAR': + $ret = array( + 'AES_DECRYPT', + 'AES_ENCRYPT', + 'BIN', + 'CHAR', + 'COMPRESS', + 'CURRENT_USER', + 'DATABASE', + 'DAYNAME', + 'DES_DECRYPT', + 'DES_ENCRYPT', + 'ENCRYPT', + 'HEX', + 'INET6_NTOA', + 'INET_NTOA', + 'LOAD_FILE', + 'LOWER', + 'LTRIM', + 'MD5', + 'MONTHNAME', + 'OLD_PASSWORD', + 'PASSWORD', + 'QUOTE', + 'REVERSE', + 'RTRIM', + 'SHA1', + 'SOUNDEX', + 'SPACE', + 'TRIM', + 'UNCOMPRESS', + 'UNHEX', + 'UPPER', + 'USER', + 'UUID', + 'VERSION', + ); + + if (($isMariaDB && $serverVersion < 100012) + || $serverVersion < 50603 + ) { + $ret = array_diff($ret, array('INET6_NTOA')); + } + return $ret; + + case 'DATE': + return array( + 'CURRENT_DATE', + 'CURRENT_TIME', + 'DATE', + 'FROM_DAYS', + 'FROM_UNIXTIME', + 'LAST_DAY', + 'NOW', + 'SEC_TO_TIME', + 'SYSDATE', + 'TIME', + 'TIMESTAMP', + 'UTC_DATE', + 'UTC_TIME', + 'UTC_TIMESTAMP', + 'YEAR', + ); + + case 'NUMBER': + $ret = array( + 'ABS', + 'ACOS', + 'ASCII', + 'ASIN', + 'ATAN', + 'BIT_LENGTH', + 'BIT_COUNT', + 'CEILING', + 'CHAR_LENGTH', + 'CONNECTION_ID', + 'COS', + 'COT', + 'CRC32', + 'DAYOFMONTH', + 'DAYOFWEEK', + 'DAYOFYEAR', + 'DEGREES', + 'EXP', + 'FLOOR', + 'HOUR', + 'INET6_ATON', + 'INET_ATON', + 'LENGTH', + 'LN', + 'LOG', + 'LOG2', + 'LOG10', + 'MICROSECOND', + 'MINUTE', + 'MONTH', + 'OCT', + 'ORD', + 'PI', + 'QUARTER', + 'RADIANS', + 'RAND', + 'ROUND', + 'SECOND', + 'SIGN', + 'SIN', + 'SQRT', + 'TAN', + 'TO_DAYS', + 'TO_SECONDS', + 'TIME_TO_SEC', + 'UNCOMPRESSED_LENGTH', + 'UNIX_TIMESTAMP', + 'UUID_SHORT', + 'WEEK', + 'WEEKDAY', + 'WEEKOFYEAR', + 'YEARWEEK', + ); + if (($isMariaDB && $serverVersion < 100012) + || $serverVersion < 50603 + ) { + $ret = array_diff($ret, array('INET6_ATON')); + } + return $ret; + + case 'SPATIAL': + if ($serverVersion >= 50600) { + return array( + 'ST_GeomFromText', + 'ST_GeomFromWKB', + + 'ST_GeomCollFromText', + 'ST_LineFromText', + 'ST_MLineFromText', + 'ST_PointFromText', + 'ST_MPointFromText', + 'ST_PolyFromText', + 'ST_MPolyFromText', + + 'ST_GeomCollFromWKB', + 'ST_LineFromWKB', + 'ST_MLineFromWKB', + 'ST_PointFromWKB', + 'ST_MPointFromWKB', + 'ST_PolyFromWKB', + 'ST_MPolyFromWKB', + ); + } else { + return array( + 'GeomFromText', + 'GeomFromWKB', + + 'GeomCollFromText', + 'LineFromText', + 'MLineFromText', + 'PointFromText', + 'MPointFromText', + 'PolyFromText', + 'MPolyFromText', + + 'GeomCollFromWKB', + 'LineFromWKB', + 'MLineFromWKB', + 'PointFromWKB', + 'MPointFromWKB', + 'PolyFromWKB', + 'MPolyFromWKB', + ); + + } + } + return array(); + } + + /** + * Returns array of functions available for a type. + * + * @param string $type The data type to get function list. + * + * @return string[] + * + */ + public function getFunctions($type) + { + $class = $this->getTypeClass($type); + return $this->getFunctionsClass($class); + } + + /** + * Returns array of all functions available. + * + * @return string[] + * + */ + public function getAllFunctions() + { + $ret = array_merge( + $this->getFunctionsClass('CHAR'), + $this->getFunctionsClass('NUMBER'), + $this->getFunctionsClass('DATE'), + $this->getFunctionsClass('UUID') + ); + sort($ret); + return $ret; + } + + /** + * Returns array of all attributes available. + * + * @return string[] + * + */ + public function getAttributes() + { + return array( + '', + 'BINARY', + 'UNSIGNED', + 'UNSIGNED ZEROFILL', + 'on update CURRENT_TIMESTAMP', + ); + } + + /** + * Returns array of all column types available. + * + * VARCHAR, TINYINT, TEXT and DATE are listed first, based on + * estimated popularity. + * + * @return string[] + * + */ + public function getColumns() + { + $isMariaDB = $this->_dbi->isMariaDB(); + $serverVersion = $this->_dbi->getVersion(); + + // most used types + $ret = array( + 'INT', + 'VARCHAR', + 'TEXT', + 'DATE', + ); + // numeric + $ret[_pgettext('numeric types', 'Numeric')] = array( + 'TINYINT', + 'SMALLINT', + 'MEDIUMINT', + 'INT', + 'BIGINT', + '-', + 'DECIMAL', + 'FLOAT', + 'DOUBLE', + 'REAL', + '-', + 'BIT', + 'BOOLEAN', + 'SERIAL', + ); + + // Date/Time + $ret[_pgettext('date and time types', 'Date and time')] = array( + 'DATE', + 'DATETIME', + 'TIMESTAMP', + 'TIME', + 'YEAR', + ); + + // Text + $ret[_pgettext('string types', 'String')] = array( + 'CHAR', + 'VARCHAR', + '-', + 'TINYTEXT', + 'TEXT', + 'MEDIUMTEXT', + 'LONGTEXT', + '-', + 'BINARY', + 'VARBINARY', + '-', + 'TINYBLOB', + 'MEDIUMBLOB', + 'BLOB', + 'LONGBLOB', + '-', + 'ENUM', + 'SET', + ); + + $ret[_pgettext('spatial types', 'Spatial')] = array( + 'GEOMETRY', + 'POINT', + 'LINESTRING', + 'POLYGON', + 'MULTIPOINT', + 'MULTILINESTRING', + 'MULTIPOLYGON', + 'GEOMETRYCOLLECTION', + ); + + if (($isMariaDB && $serverVersion > 100207) + || (!$isMariaDB && $serverVersion >= 50708)) { + $ret['JSON'] = array( + 'JSON', + ); + } + + return $ret; + } + + /** + * Returns an array of integer types + * + * @return string[] integer types + */ + public function getIntegerTypes() + { + return array('tinyint', 'smallint', 'mediumint', 'int', 'bigint'); + } + + /** + * Returns the min and max values of a given integer type + * + * @param string $type integer type + * @param boolean $signed whether signed + * + * @return string[] min and max values + */ + public function getIntegerRange($type, $signed = true) + { + static $min_max_data = array( + 'unsigned' => array( + 'tinyint' => array('0', '255'), + 'smallint' => array('0', '65535'), + 'mediumint' => array('0', '16777215'), + 'int' => array('0', '4294967295'), + 'bigint' => array('0', '18446744073709551615') + ), + 'signed' => array( + 'tinyint' => array('-128', '127'), + 'smallint' => array('-32768', '32767'), + 'mediumint' => array('-8388608', '8388607'), + 'int' => array('-2147483648', '2147483647'), + 'bigint' => array('-9223372036854775808', '9223372036854775807') + ) + ); + $relevantArray = $signed + ? $min_max_data['signed'] + : $min_max_data['unsigned']; + return isset($relevantArray[$type]) ? $relevantArray[$type] : array('', ''); + } +} diff --git a/phpMyAdmin/libraries/classes/Url.php b/phpMyAdmin/libraries/classes/Url.php new file mode 100755 index 0000000..9ff5164 --- /dev/null +++ b/phpMyAdmin/libraries/classes/Url.php @@ -0,0 +1,350 @@ + 0) { + $params['db'] = $db; + } + if (strlen($table) > 0) { + $params['table'] = $table; + } + } + + if (! empty($GLOBALS['server']) + && $GLOBALS['server'] != $GLOBALS['cfg']['ServerDefault'] + ) { + $params['server'] = $GLOBALS['server']; + } + if (empty($PMA_Config->getCookie('pma_lang')) && ! empty($GLOBALS['lang'])) { + $params['lang'] = $GLOBALS['lang']; + } + + if (! is_array($skip)) { + if (isset($params[$skip])) { + unset($params[$skip]); + } + } else { + foreach ($skip as $skipping) { + if (isset($params[$skipping])) { + unset($params[$skipping]); + } + } + } + + return Url::getHiddenFields($params); + } + + /** + * create hidden form fields from array with name => value + * + * + * $values = array( + * 'aaa' => aaa, + * 'bbb' => array( + * 'bbb_0', + * 'bbb_1', + * ), + * 'ccc' => array( + * 'a' => 'ccc_a', + * 'b' => 'ccc_b', + * ), + * ); + * echo Url::getHiddenFields($values); + * + * // produces: + * + * + * + * + * + * + * + * @param array $values hidden values + * @param string $pre prefix + * + * @return string form fields of type hidden + */ + public static function getHiddenFields(array $values, $pre = '') + { + $fields = ''; + + /* Always include token in plain forms */ + if ($pre === '') { + $values['token'] = $_SESSION[' PMA_token ']; + } + + foreach ($values as $name => $value) { + if (! empty($pre)) { + $name = $pre . '[' . $name . ']'; + } + + if (is_array($value)) { + $fields .= Url::getHiddenFields($value, $name); + } else { + // do not generate an ending "\n" because + // Url::getHiddenInputs() is sometimes called + // from a JS document.write() + $fields .= ''; + } + } + + return $fields; + } + + /** + * Generates text with URL parameters. + * + * + * $params['myparam'] = 'myvalue'; + * $params['db'] = 'mysql'; + * $params['table'] = 'rights'; + * // note the missing ? + * echo 'script.php' . Url::getCommon($params); + * // produces with cookies enabled: + * // script.php?myparam=myvalue&db=mysql&table=rights + * // with cookies disabled: + * // script.php?server=1&lang=en&myparam=myvalue&db=mysql + * // &table=rights + * + * // note the missing ? + * echo 'script.php' . Url::getCommon(); + * // produces with cookies enabled: + * // script.php + * // with cookies disabled: + * // script.php?server=1&lang=en + * + * + * @param mixed $params optional, Contains an associative array with url params + * @param string $divider optional character to use instead of '?' + * @param bool $encrypt whether to encrypt URL params + * + * @return string string with URL parameters + * @access public + */ + public static function getCommon($params = array(), $divider = '?', $encrypt = true) + { + return htmlspecialchars( + Url::getCommonRaw($params, $divider, $encrypt) + ); + } + + /** + * Generates text with URL parameters. + * + * + * $params['myparam'] = 'myvalue'; + * $params['db'] = 'mysql'; + * $params['table'] = 'rights'; + * // note the missing ? + * echo 'script.php' . Url::getCommon($params); + * // produces with cookies enabled: + * // script.php?myparam=myvalue&db=mysql&table=rights + * // with cookies disabled: + * // script.php?server=1&lang=en&myparam=myvalue&db=mysql + * // &table=rights + * + * // note the missing ? + * echo 'script.php' . Url::getCommon(); + * // produces with cookies enabled: + * // script.php + * // with cookies disabled: + * // script.php?server=1&lang=en + * + * + * @param mixed $params optional, Contains an associative array with url params + * @param string $divider optional character to use instead of '?' + * @param bool $encrypt whether to encrypt URL params + * + * @return string string with URL parameters + * @access public + */ + public static function getCommonRaw($params = array(), $divider = '?', $encrypt = true) + { + /** @var Config $PMA_Config */ + global $PMA_Config; + + // avoid overwriting when creating navi panel links to servers + if (isset($GLOBALS['server']) + && $GLOBALS['server'] != $GLOBALS['cfg']['ServerDefault'] + && ! isset($params['server']) + && ! $PMA_Config->get('is_setup') + ) { + $params['server'] = $GLOBALS['server']; + } + + if (empty($PMA_Config->getCookie('pma_lang')) && ! empty($GLOBALS['lang'])) { + $params['lang'] = $GLOBALS['lang']; + } + + $query = self::buildHttpQuery($params, $encrypt); + + if ($divider != '?' || strlen($query) > 0) { + return $divider . $query; + } + + return ''; + } + + /** + * @param array $params + * @param bool $encrypt whether to encrypt URL params + * + * @return string + */ + public static function buildHttpQuery($params, $encrypt = true) + { + global $PMA_Config; + + $separator = self::getArgSeparator(); + + if (! $encrypt || ! $PMA_Config->get('URLQueryEncryption')) { + return http_build_query($params, null, $separator); + } + + $data = $params; + $keys = [ + 'db', + 'table', + 'field', + 'sql_query', + 'sql_signature', + 'where_clause', + 'goto', + 'back', + 'message_to_show', + 'username', + 'hostname', + 'dbname', + 'tablename', + 'checkprivsdb', + 'checkprivstable', + ]; + $paramsToEncrypt = []; + foreach ($params as $paramKey => $paramValue) { + if (! in_array($paramKey, $keys)) { + continue; + } + + $paramsToEncrypt[$paramKey] = $paramValue; + unset($data[$paramKey]); + } + + if ($paramsToEncrypt !== []) { + $data['eq'] = self::encryptQuery(json_encode($paramsToEncrypt)); + } + + return http_build_query($data, null, $separator); + } + + /** + * @param string $query + * + * @return string + */ + public static function encryptQuery($query) + { + $crypto = new Crypto(); + + return strtr(base64_encode($crypto->encrypt($query)), '+/', '-_'); + } + + /** + * @param string $query + * + * @return string|null + */ + public static function decryptQuery($query) + { + $crypto = new Crypto(); + + return $crypto->decrypt(base64_decode(strtr($query, '-_', '+/'))); + } + + /** + * Returns url separator + * + * extracted from arg_separator.input as set in php.ini + * we do not use arg_separator.output to avoid problems with & and & + * + * @param string $encode whether to encode separator or not, + * currently 'none' or 'html' + * + * @return string character used for separating url parts usually ; or & + * @access public + */ + public static function getArgSeparator($encode = 'none') + { + static $separator = null; + static $html_separator = null; + + if (null === $separator) { + // use separators defined by php, but prefer ';' + // as recommended by W3C + // (see https://www.w3.org/TR/1999/REC-html401-19991224/appendix + // /notes.html#h-B.2.2) + $arg_separator = ini_get('arg_separator.input'); + if (mb_strpos($arg_separator, ';') !== false) { + $separator = ';'; + } elseif (strlen($arg_separator) > 0) { + $separator = $arg_separator[0]; + } else { + $separator = '&'; + } + $html_separator = htmlentities($separator); + } + + switch ($encode) { + case 'html': + return $html_separator; + case 'text' : + case 'none' : + default : + return $separator; + } + } +} diff --git a/phpMyAdmin/libraries/classes/UserPassword.php b/phpMyAdmin/libraries/classes/UserPassword.php new file mode 100755 index 0000000..be7d2e4 --- /dev/null +++ b/phpMyAdmin/libraries/classes/UserPassword.php @@ -0,0 +1,253 @@ +isAjax()) { + /** + * If in an Ajax request, we don't need to show the rest of the page + */ + if ($change_password_message['error']) { + $response->addJSON('message', $change_password_message['msg']); + $response->setRequestStatus(false); + } else { + $sql_query = Util::getMessage( + $change_password_message['msg'], + $sql_query, + 'success' + ); + $response->addJSON('message', $sql_query); + } + exit; + } + } + + /** + * Generate the message + * + * @return array error value and message + */ + public function setChangePasswordMsg() + { + $error = false; + $message = Message::success(__('The profile has been updated.')); + + if (($_POST['nopass'] != '1')) { + if (strlen($_POST['pma_pw']) === 0 || strlen($_POST['pma_pw2']) === 0) { + $message = Message::error(__('The password is empty!')); + $error = true; + } elseif ($_POST['pma_pw'] !== $_POST['pma_pw2']) { + $message = Message::error( + __('The passwords aren\'t the same!') + ); + $error = true; + } elseif (strlen($_POST['pma_pw']) > 256) { + $message = Message::error(__('Password is too long!')); + $error = true; + } + } + return array('error' => $error, 'msg' => $message); + } + + /** + * Change the password + * + * @param string $password New password + * @param string $message Message + * @param array $change_password_message Message to show + * + * @return void + */ + public function changePassword($password, $message, array $change_password_message) + { + global $auth_plugin; + + $hashing_function = $this->changePassHashingFunction(); + + list($username, $hostname) = $GLOBALS['dbi']->getCurrentUserAndHost(); + + $serverType = Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); + + if (isset($_POST['authentication_plugin']) + && ! empty($_POST['authentication_plugin']) + ) { + $orig_auth_plugin = $_POST['authentication_plugin']; + } else { + $orig_auth_plugin = Privileges::getCurrentAuthenticationPlugin( + 'change', $username, $hostname + ); + } + + $sql_query = 'SET password = ' + . (($password == '') ? '\'\'' : $hashing_function . '(\'***\')'); + + if ($serverType == 'MySQL' + && $serverVersion >= 50706 + ) { + $sql_query = 'ALTER USER \'' . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) + . '\' IDENTIFIED WITH ' . $orig_auth_plugin . ' BY ' + . (($password == '') ? '\'\'' : '\'***\''); + } elseif (($serverType == 'MySQL' + && $serverVersion >= 50507) + || ($serverType == 'MariaDB' + && $serverVersion >= 50200) + ) { + // For MySQL versions 5.5.7+ and MariaDB versions 5.2+, + // explicitly set value of `old_passwords` so that + // it does not give an error while using + // the PASSWORD() function + if ($orig_auth_plugin == 'sha256_password') { + $value = 2; + } else { + $value = 0; + } + $GLOBALS['dbi']->tryQuery('SET `old_passwords` = ' . $value . ';'); + } + + $this->changePassUrlParamsAndSubmitQuery( + $username, $hostname, $password, + $sql_query, $hashing_function, $orig_auth_plugin + ); + + $auth_plugin->handlePasswordChange($password); + $this->getChangePassMessage($change_password_message, $sql_query); + $this->changePassDisplayPage($message, $sql_query); + } + + /** + * Generate the hashing function + * + * @return string $hashing_function + */ + private function changePassHashingFunction() + { + if (Core::isValid( + $_POST['authentication_plugin'], 'identical', 'mysql_old_password' + )) { + $hashing_function = 'OLD_PASSWORD'; + } else { + $hashing_function = 'PASSWORD'; + } + return $hashing_function; + } + + /** + * Changes password for a user + * + * @param string $username Username + * @param string $hostname Hostname + * @param string $password Password + * @param string $sql_query SQL query + * @param string $hashing_function Hashing function + * @param string $orig_auth_plugin Original Authentication Plugin + * + * @return void + */ + private function changePassUrlParamsAndSubmitQuery( + $username, $hostname, $password, $sql_query, $hashing_function, $orig_auth_plugin + ) { + $err_url = 'user_password.php' . Url::getCommon(); + + $serverType = Util::getServerType(); + $serverVersion = $GLOBALS['dbi']->getVersion(); + + if ($serverType == 'MySQL' && $serverVersion >= 50706) { + $local_query = 'ALTER USER \'' . $GLOBALS['dbi']->escapeString($username) + . '\'@\'' . $GLOBALS['dbi']->escapeString($hostname) . '\'' + . ' IDENTIFIED with ' . $orig_auth_plugin . ' BY ' + . (($password == '') + ? '\'\'' + : '\'' . $GLOBALS['dbi']->escapeString($password) . '\''); + } elseif ($serverType == 'MariaDB' + && $serverVersion >= 50200 + && $serverVersion < 100100 + && $orig_auth_plugin !== '' + ) { + if ($orig_auth_plugin == 'mysql_native_password') { + // Set the hashing method used by PASSWORD() + // to be 'mysql_native_password' type + $GLOBALS['dbi']->tryQuery('SET old_passwords = 0;'); + } elseif ($orig_auth_plugin == 'sha256_password') { + // Set the hashing method used by PASSWORD() + // to be 'sha256_password' type + $GLOBALS['dbi']->tryQuery('SET `old_passwords` = 2;'); + } + + $hashedPassword = Privileges::getHashedPassword($_POST['pma_pw']); + + $local_query = "UPDATE `mysql`.`user` SET" + . " `authentication_string` = '" . $hashedPassword + . "', `Password` = '', " + . " `plugin` = '" . $orig_auth_plugin . "'" + . " WHERE `User` = '" . $GLOBALS['dbi']->escapeString($username) + . "' AND Host = '" . $GLOBALS['dbi']->escapeString($hostname) . "';"; + } else { + $local_query = 'SET password = ' . (($password == '') + ? '\'\'' + : $hashing_function . '(\'' + . $GLOBALS['dbi']->escapeString($password) . '\')'); + } + if (! @$GLOBALS['dbi']->tryQuery($local_query)) { + Util::mysqlDie( + $GLOBALS['dbi']->getError(), + $sql_query, + false, + $err_url + ); + } + + // Flush privileges after successful password change + $GLOBALS['dbi']->tryQuery("FLUSH PRIVILEGES;"); + } + + /** + * Display the page + * + * @param string $message Message + * @param string $sql_query SQL query + * + * @return void + */ + private function changePassDisplayPage($message, $sql_query) + { + echo '

    ' , __('Change password') , '

    ' , "\n\n"; + echo Util::getMessage( + $message, $sql_query, 'success' + ); + echo '' , "\n" + , '' , __('Back') , ''; + exit; + } +} diff --git a/phpMyAdmin/libraries/classes/UserPreferences.php b/phpMyAdmin/libraries/classes/UserPreferences.php new file mode 100755 index 0000000..76723fc --- /dev/null +++ b/phpMyAdmin/libraries/classes/UserPreferences.php @@ -0,0 +1,274 @@ +relation = new Relation(); + } + + /** + * Common initialization for user preferences modification pages + * + * @param ConfigFile $cf Config file instance + * + * @return void + */ + public function pageInit(ConfigFile $cf) + { + $forms_all_keys = UserFormList::getFields(); + $cf->resetConfigData(); // start with a clean instance + $cf->setAllowedKeys($forms_all_keys); + $cf->setCfgUpdateReadMapping( + array( + 'Server/hide_db' => 'Servers/1/hide_db', + 'Server/only_db' => 'Servers/1/only_db' + ) + ); + $cf->updateWithGlobalConfig($GLOBALS['cfg']); + } + + /** + * Loads user preferences + * + * Returns an array: + * * config_data - path => value pairs + * * mtime - last modification time + * * type - 'db' (config read from pmadb) or 'session' (read from user session) + * + * @return array + */ + public function load() + { + $cfgRelation = $this->relation->getRelationsParam(); + if (! $cfgRelation['userconfigwork']) { + // no pmadb table, use session storage + if (! isset($_SESSION['userconfig'])) { + $_SESSION['userconfig'] = array( + 'db' => array(), + 'ts' => time()); + } + return array( + 'config_data' => $_SESSION['userconfig']['db'], + 'mtime' => $_SESSION['userconfig']['ts'], + 'type' => 'session'); + } + // load configuration from pmadb + $query_table = Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['userconfig']); + $query = 'SELECT `config_data`, UNIX_TIMESTAMP(`timevalue`) ts' + . ' FROM ' . $query_table + . ' WHERE `username` = \'' + . $GLOBALS['dbi']->escapeString($cfgRelation['user']) + . '\''; + $row = $GLOBALS['dbi']->fetchSingleRow($query, 'ASSOC', DatabaseInterface::CONNECT_CONTROL); + + return array( + 'config_data' => $row ? json_decode($row['config_data'], true) : array(), + 'mtime' => $row ? $row['ts'] : time(), + 'type' => 'db'); + } + + /** + * Saves user preferences + * + * @param array $config_array configuration array + * + * @return true|PhpMyAdmin\Message + */ + public function save(array $config_array) + { + $cfgRelation = $this->relation->getRelationsParam(); + $server = isset($GLOBALS['server']) + ? $GLOBALS['server'] + : $GLOBALS['cfg']['ServerDefault']; + $cache_key = 'server_' . $server; + if (! $cfgRelation['userconfigwork']) { + // no pmadb table, use session storage + $_SESSION['userconfig'] = array( + 'db' => $config_array, + 'ts' => time()); + if (isset($_SESSION['cache'][$cache_key]['userprefs'])) { + unset($_SESSION['cache'][$cache_key]['userprefs']); + } + return true; + } + + // save configuration to pmadb + $query_table = Util::backquote($cfgRelation['db']) . '.' + . Util::backquote($cfgRelation['userconfig']); + $query = 'SELECT `username` FROM ' . $query_table + . ' WHERE `username` = \'' + . $GLOBALS['dbi']->escapeString($cfgRelation['user']) + . '\''; + + $has_config = $GLOBALS['dbi']->fetchValue( + $query, 0, 0, DatabaseInterface::CONNECT_CONTROL + ); + $config_data = json_encode($config_array); + if ($has_config) { + $query = 'UPDATE ' . $query_table + . ' SET `timevalue` = NOW(), `config_data` = \'' + . $GLOBALS['dbi']->escapeString($config_data) + . '\'' + . ' WHERE `username` = \'' + . $GLOBALS['dbi']->escapeString($cfgRelation['user']) + . '\''; + } else { + $query = 'INSERT INTO ' . $query_table + . ' (`username`, `timevalue`,`config_data`) ' + . 'VALUES (\'' + . $GLOBALS['dbi']->escapeString($cfgRelation['user']) . '\', NOW(), ' + . '\'' . $GLOBALS['dbi']->escapeString($config_data) . '\')'; + } + if (isset($_SESSION['cache'][$cache_key]['userprefs'])) { + unset($_SESSION['cache'][$cache_key]['userprefs']); + } + if (!$GLOBALS['dbi']->tryQuery($query, DatabaseInterface::CONNECT_CONTROL)) { + $message = Message::error(__('Could not save configuration')); + $message->addMessage( + Message::rawError( + $GLOBALS['dbi']->getError(DatabaseInterface::CONNECT_CONTROL) + ), + '

    ' + ); + return $message; + } + return true; + } + + /** + * Returns a user preferences array filtered by $cfg['UserprefsDisallow'] + * (blacklist) and keys from user preferences form (whitelist) + * + * @param array $config_data path => value pairs + * + * @return array + */ + public function apply(array $config_data) + { + $cfg = array(); + $blacklist = array_flip($GLOBALS['cfg']['UserprefsDisallow']); + $whitelist = array_flip(UserFormList::getFields()); + // whitelist some additional fields which are custom handled + $whitelist['ThemeDefault'] = true; + $whitelist['lang'] = true; + $whitelist['Server/hide_db'] = true; + $whitelist['Server/only_db'] = true; + $whitelist['2fa'] = true; + foreach ($config_data as $path => $value) { + if (! isset($whitelist[$path]) || isset($blacklist[$path])) { + continue; + } + Core::arrayWrite($path, $cfg, $value); + } + return $cfg; + } + + /** + * Updates one user preferences option (loads and saves to database). + * + * No validation is done! + * + * @param string $path configuration + * @param mixed $value value + * @param mixed $default_value default value + * + * @return true|PhpMyAdmin\Message + */ + public function persistOption($path, $value, $default_value) + { + $prefs = $this->load(); + if ($value === $default_value) { + if (isset($prefs['config_data'][$path])) { + unset($prefs['config_data'][$path]); + } else { + return true; + } + } else { + $prefs['config_data'][$path] = $value; + } + return $this->save($prefs['config_data']); + } + + /** + * Redirects after saving new user preferences + * + * @param string $file_name Filename + * @param array|null $params URL parameters + * @param string $hash Hash value + * + * @return void + */ + public function redirect($file_name, + $params = null, $hash = null + ) { + // redirect + $url_params = array('saved' => 1); + if (is_array($params)) { + $url_params = array_merge($params, $url_params); + } + if ($hash) { + $hash = '#' . urlencode($hash); + } + Core::sendHeaderLocation('./' . $file_name + . Url::getCommonRaw($url_params) . $hash + ); + } + + /** + * Shows form which allows to quickly load + * settings stored in browser's local storage + * + * @return string + */ + public function autoloadGetHeader() + { + if (isset($_REQUEST['prefs_autoload']) + && $_REQUEST['prefs_autoload'] == 'hide' + ) { + $_SESSION['userprefs_autoload'] = true; + return ''; + } + + $script_name = basename(basename($GLOBALS['PMA_PHP_SELF'])); + $return_url = $script_name . '?' . http_build_query($_GET, '', '&'); + + return Template::get('prefs_autoload') + ->render( + array( + 'hidden_inputs' => Url::getHiddenInputs(), + 'return_url' => $return_url, + ) + ); + } +} diff --git a/phpMyAdmin/libraries/classes/Util.php b/phpMyAdmin/libraries/classes/Util.php new file mode 100755 index 0000000..1cea07a --- /dev/null +++ b/phpMyAdmin/libraries/classes/Util.php @@ -0,0 +1,4773 @@ +'; + if ($include_icon) { + $button .= self::getImage($icon, $alternate); + } + if ($include_icon && $include_text) { + $button .= ' '; + } + if ($include_text) { + $button .= $alternate; + } + $button .= $menu_icon ? '' : ''; + + return $button; + } + + /** + * Returns an HTML IMG tag for a particular image from a theme + * + * The image name should match CSS class defined in icons.css.php + * + * @param string $image The name of the file to get + * @param string $alternate Used to set 'alt' and 'title' attributes + * of the image + * @param array $attributes An associative array of other attributes + * + * @return string an html IMG tag + */ + public static function getImage($image, $alternate = '', array $attributes = array()) + { + $alternate = htmlspecialchars($alternate); + + // Set $url accordingly + if (isset($GLOBALS['pmaThemeImage'])) { + $url = $GLOBALS['pmaThemeImage'] . $image; + } else { + $url = './themes/pmahomme/' . $image; + } + + if (isset($attributes['class'])) { + $attributes['class'] = "icon ic_$image " . $attributes['class']; + } else { + $attributes['class'] = "icon ic_$image"; + } + + // set all other attributes + $attr_str = ''; + foreach ($attributes as $key => $value) { + if (! in_array($key, array('alt', 'title'))) { + $attr_str .= " $key=\"$value\""; + } + } + + // override the alt attribute + if (isset($attributes['alt'])) { + $alt = $attributes['alt']; + } else { + $alt = $alternate; + } + + // override the title attribute + if (isset($attributes['title'])) { + $title = $attributes['title']; + } else { + $title = $alternate; + } + + // generate the IMG tag + $template = '%s'; + $retval = sprintf($template, $title, $alt, $attr_str); + + return $retval; + } + + /** + * Returns the formatted maximum size for an upload + * + * @param integer $max_upload_size the size + * + * @return string the message + * + * @access public + */ + public static function getFormattedMaximumUploadSize($max_upload_size) + { + // I have to reduce the second parameter (sensitiveness) from 6 to 4 + // to avoid weird results like 512 kKib + list($max_size, $max_unit) = self::formatByteDown($max_upload_size, 4); + return '(' . sprintf(__('Max: %s%s'), $max_size, $max_unit) . ')'; + } + + /** + * Generates a hidden field which should indicate to the browser + * the maximum size for upload + * + * @param integer $max_size the size + * + * @return string the INPUT field + * + * @access public + */ + public static function generateHiddenMaxFileSize($max_size) + { + return ''; + } + + /** + * Add slashes before "_" and "%" characters for using them in MySQL + * database, table and field names. + * Note: This function does not escape backslashes! + * + * @param string $name the string to escape + * + * @return string the escaped string + * + * @access public + */ + public static function escapeMysqlWildcards($name) + { + return strtr($name, array('_' => '\\_', '%' => '\\%')); + } // end of the 'escapeMysqlWildcards()' function + + /** + * removes slashes before "_" and "%" characters + * Note: This function does not unescape backslashes! + * + * @param string $name the string to escape + * + * @return string the escaped string + * + * @access public + */ + public static function unescapeMysqlWildcards($name) + { + return strtr($name, array('\\_' => '_', '\\%' => '%')); + } // end of the 'unescapeMysqlWildcards()' function + + /** + * removes quotes (',",`) from a quoted string + * + * checks if the string is quoted and removes this quotes + * + * @param string $quoted_string string to remove quotes from + * @param string $quote type of quote to remove + * + * @return string unqoted string + */ + public static function unQuote($quoted_string, $quote = null) + { + $quotes = array(); + + if ($quote === null) { + $quotes[] = '`'; + $quotes[] = '"'; + $quotes[] = "'"; + } else { + $quotes[] = $quote; + } + + foreach ($quotes as $quote) { + if (mb_substr($quoted_string, 0, 1) === $quote + && mb_substr($quoted_string, -1, 1) === $quote + ) { + $unquoted_string = mb_substr($quoted_string, 1, -1); + // replace escaped quotes + $unquoted_string = str_replace( + $quote . $quote, + $quote, + $unquoted_string + ); + return $unquoted_string; + } + } + + return $quoted_string; + } + + /** + * format sql strings + * + * @param string $sqlQuery raw SQL string + * @param boolean $truncate truncate the query if it is too long + * + * @return string the formatted sql + * + * @global array $cfg the configuration array + * + * @access public + * @todo move into PMA_Sql + */ + public static function formatSql($sqlQuery, $truncate = false) + { + global $cfg; + + if ($truncate + && mb_strlen($sqlQuery) > $cfg['MaxCharactersInDisplayedSQL'] + ) { + $sqlQuery = mb_substr( + $sqlQuery, + 0, + $cfg['MaxCharactersInDisplayedSQL'] + ) . '[...]'; + } + return '
    ' . "\n"
    +            . htmlspecialchars($sqlQuery) . "\n"
    +            . '
    '; + } // end of the "formatSql()" function + + /** + * Displays a link to the documentation as an icon + * + * @param string $link documentation link + * @param string $target optional link target + * @param boolean $bbcode optional flag indicating whether to output bbcode + * + * @return string the html link + * + * @access public + */ + public static function showDocLink($link, $target = 'documentation', $bbcode = false) + { + if($bbcode){ + return "[a@$link@$target][dochelpicon][/a]"; + } + + return '' + . self::getImage('b_help', __('Documentation')) + . ''; + } // end of the 'showDocLink()' function + + /** + * Get a URL link to the official MySQL documentation + * + * @param string $link contains name of page/anchor that is being linked + * @param string $anchor anchor to page part + * + * @return string the URL link + * + * @access public + */ + public static function getMySQLDocuURL($link, $anchor = '') + { + // Fixup for newly used names: + $link = str_replace('_', '-', mb_strtolower($link)); + + if (empty($link)) { + $link = 'index'; + } + $mysql = '5.5'; + $lang = 'en'; + if (isset($GLOBALS['dbi'])) { + $serverVersion = $GLOBALS['dbi']->getVersion(); + if ($serverVersion >= 50700) { + $mysql = '5.7'; + } elseif ($serverVersion >= 50600) { + $mysql = '5.6'; + } elseif ($serverVersion >= 50500) { + $mysql = '5.5'; + } + } + $url = 'https://dev.mysql.com/doc/refman/' + . $mysql . '/' . $lang . '/' . $link . '.html'; + if (! empty($anchor)) { + $url .= '#' . $anchor; + } + + return Core::linkURL($url); + } + + /** + * Displays a link to the official MySQL documentation + * + * @param string $link contains name of page/anchor that is being linked + * @param bool $big_icon whether to use big icon (like in left frame) + * @param string $anchor anchor to page part + * @param bool $just_open whether only the opening tag should be returned + * + * @return string the html link + * + * @access public + */ + public static function showMySQLDocu( + $link, + $big_icon = false, + $anchor = '', + $just_open = false + ) { + $url = self::getMySQLDocuURL($link, $anchor); + $open_link = ''; + if ($just_open) { + return $open_link; + } elseif ($big_icon) { + return $open_link + . self::getImage('b_sqlhelp', __('Documentation')) . ''; + } + + return self::showDocLink($url, 'mysql_doc'); + } // end of the 'showMySQLDocu()' function + + /** + * Returns link to documentation. + * + * @param string $page Page in documentation + * @param string $anchor Optional anchor in page + * + * @return string URL + */ + public static function getDocuLink($page, $anchor = '') + { + /* Construct base URL */ + $url = $page . '.html'; + if (!empty($anchor)) { + $url .= '#' . $anchor; + } + + /* Check if we have built local documentation, however + * provide consistent URL for testsuite + */ + if (! defined('TESTSUITE') && @file_exists('doc/html/index.html')) { + if ($GLOBALS['PMA_Config']->get('is_setup')) { + return '../doc/html/' . $url; + } + + return './doc/html/' . $url; + } + + return Core::linkURL('https://docs.phpmyadmin.net/en/latest/' . $url); + } + + /** + * Displays a link to the phpMyAdmin documentation + * + * @param string $page Page in documentation + * @param string $anchor Optional anchor in page + * @param boolean $bbcode Optional flag indicating whether to output bbcode + * + * @return string the html link + * + * @access public + */ + public static function showDocu($page, $anchor = '', $bbcode = false) + { + return self::showDocLink(self::getDocuLink($page, $anchor), 'documentation', $bbcode); + } // end of the 'showDocu()' function + + /** + * Displays a link to the PHP documentation + * + * @param string $target anchor in documentation + * + * @return string the html link + * + * @access public + */ + public static function showPHPDocu($target) + { + $url = Core::getPHPDocLink($target); + + return self::showDocLink($url); + } // end of the 'showPHPDocu()' function + + /** + * Returns HTML code for a tooltip + * + * @param string $message the message for the tooltip + * + * @return string + * + * @access public + */ + public static function showHint($message) + { + if ($GLOBALS['cfg']['ShowHint']) { + $classClause = ' class="pma_hint"'; + } else { + $classClause = ''; + } + return '' + . self::getImage('b_help') + . '' . $message . '' + . ''; + } + + /** + * Displays a MySQL error message in the main panel when $exit is true. + * Returns the error message otherwise. + * + * @param string|bool $server_msg Server's error message. + * @param string $sql_query The SQL query that failed. + * @param bool $is_modify_link Whether to show a "modify" link or not. + * @param string $back_url URL for the "back" link (full path is + * not required). + * @param bool $exit Whether execution should be stopped or + * the error message should be returned. + * + * @return string + * + * @global string $table The current table. + * @global string $db The current database. + * + * @access public + */ + public static function mysqlDie( + $server_msg = '', + $sql_query = '', + $is_modify_link = true, + $back_url = '', + $exit = true + ) { + global $table, $db; + + /** + * Error message to be built. + * @var string $error_msg + */ + $error_msg = ''; + + // Checking for any server errors. + if (empty($server_msg)) { + $server_msg = $GLOBALS['dbi']->getError(); + } + + // Finding the query that failed, if not specified. + if ((empty($sql_query) && (!empty($GLOBALS['sql_query'])))) { + $sql_query = $GLOBALS['sql_query']; + } + $sql_query = trim($sql_query); + + /** + * The lexer used for analysis. + * @var Lexer $lexer + */ + $lexer = new Lexer($sql_query); + + /** + * The parser used for analysis. + * @var Parser $parser + */ + $parser = new Parser($lexer->list); + + /** + * The errors found by the lexer and the parser. + * @var array $errors + */ + $errors = ParserError::get(array($lexer, $parser)); + + if (empty($sql_query)) { + $formatted_sql = ''; + } elseif (count($errors)) { + $formatted_sql = htmlspecialchars($sql_query); + } else { + $formatted_sql = self::formatSql($sql_query, true); + } + + $error_msg .= '

    ' . __('Error') . '

    '; + + // For security reasons, if the MySQL refuses the connection, the query + // is hidden so no details are revealed. + if ((!empty($sql_query)) && (!(mb_strstr($sql_query, 'connect')))) { + // Static analysis errors. + if (!empty($errors)) { + $error_msg .= '

    ' . __('Static analysis:') + . '

    '; + $error_msg .= '

    ' . sprintf( + __('%d errors were found during analysis.'), + count($errors) + ) . '

    '; + $error_msg .= '

      '; + $error_msg .= implode( + ParserError::format( + $errors, + '
    1. %2$s (near "%4$s" at position %5$d)
    2. ' + ) + ); + $error_msg .= '

    '; + } + + // Display the SQL query and link to MySQL documentation. + $error_msg .= '

    ' . __('SQL query:') . '' . "\n"; + $formattedSqlToLower = mb_strtolower($formatted_sql); + + // TODO: Show documentation for all statement types. + if (mb_strstr($formattedSqlToLower, 'select')) { + // please show me help to the error on select + $error_msg .= self::showMySQLDocu('SELECT'); + } + + if ($is_modify_link) { + $_url_params = array( + 'sql_query' => $sql_query, + 'show_query' => 1, + ); + if (strlen($table) > 0) { + $_url_params['db'] = $db; + $_url_params['table'] = $table; + $doedit_goto = ''; + } elseif (strlen($db) > 0) { + $_url_params['db'] = $db; + $doedit_goto = ''; + } else { + $doedit_goto = ''; + } + + $error_msg .= $doedit_goto + . self::getIcon('b_edit', __('Edit')) + . ''; + } + + $error_msg .= '

    ' . "\n" + . '

    ' . "\n" + . $formatted_sql . "\n" + . '

    ' . "\n"; + } + + // Display server's error. + if (!empty($server_msg)) { + $server_msg = preg_replace( + "@((\015\012)|(\015)|(\012)){3,}@", + "\n\n", + $server_msg + ); + + // Adds a link to MySQL documentation. + $error_msg .= '

    ' . "\n" + . ' ' . __('MySQL said: ') . '' + . self::showMySQLDocu('Error-messages-server') + . "\n" + . '

    ' . "\n"; + + // The error message will be displayed within a CODE segment. + // To preserve original formatting, but allow word-wrapping, + // a couple of replacements are done. + // All non-single blanks and TAB-characters are replaced with their + // HTML-counterpart + $server_msg = str_replace( + array(' ', "\t"), + array('  ', '    '), + $server_msg + ); + + // Replace line breaks + $server_msg = nl2br($server_msg); + + $error_msg .= '' . $server_msg . '
    '; + } + + $error_msg .= '
    '; + $_SESSION['Import_message']['message'] = $error_msg; + + if (!$exit) { + return $error_msg; + } + + /** + * If this is an AJAX request, there is no "Back" link and + * `Response()` is used to send the response. + */ + $response = Response::getInstance(); + if ($response->isAjax()) { + $response->setRequestStatus(false); + $response->addJSON('message', $error_msg); + exit; + } + + if (!empty($back_url)) { + if (mb_strstr($back_url, '?')) { + $back_url .= '&no_history=true'; + } else { + $back_url .= '?no_history=true'; + } + + $_SESSION['Import_message']['go_back_url'] = $back_url; + + $error_msg .= '
    ' + . '[ ' . __('Back') . ' ]' + . '
    ' . "\n\n"; + } + + exit($error_msg); + } + + /** + * Check the correct row count + * + * @param string $db the db name + * @param array $table the table infos + * + * @return int $rowCount the possibly modified row count + * + */ + private static function _checkRowCount($db, array $table) + { + $rowCount = 0; + + if ($table['Rows'] === null) { + // Do not check exact row count here, + // if row count is invalid possibly the table is defect + // and this would break the navigation panel; + // but we can check row count if this is a view or the + // information_schema database + // since Table::countRecords() returns a limited row count + // in this case. + + // set this because Table::countRecords() can use it + $tbl_is_view = $table['TABLE_TYPE'] == 'VIEW'; + + if ($tbl_is_view || $GLOBALS['dbi']->isSystemSchema($db)) { + $rowCount = $GLOBALS['dbi'] + ->getTable($db, $table['Name']) + ->countRecords(); + } + } + return $rowCount; + } + + /** + * returns array with tables of given db with extended information and grouped + * + * @param string $db name of db + * @param string $tables name of tables + * @param integer $limit_offset list offset + * @param int|bool $limit_count max tables to return + * + * @return array (recursive) grouped table list + */ + public static function getTableList( + $db, + $tables = null, + $limit_offset = 0, + $limit_count = false + ) { + $sep = $GLOBALS['cfg']['NavigationTreeTableSeparator']; + + if ($tables === null) { + $tables = $GLOBALS['dbi']->getTablesFull( + $db, + '', + false, + $limit_offset, + $limit_count + ); + if ($GLOBALS['cfg']['NaturalOrder']) { + uksort($tables, 'strnatcasecmp'); + } + } + + if (count($tables) < 1) { + return $tables; + } + + $default = array( + 'Name' => '', + 'Rows' => 0, + 'Comment' => '', + 'disp_name' => '', + ); + + $table_groups = array(); + + foreach ($tables as $table_name => $table) { + $table['Rows'] = self::_checkRowCount($db, $table); + + // in $group we save the reference to the place in $table_groups + // where to store the table info + if ($GLOBALS['cfg']['NavigationTreeEnableGrouping'] + && $sep && mb_strstr($table_name, $sep) + ) { + $parts = explode($sep, $table_name); + + $group =& $table_groups; + $i = 0; + $group_name_full = ''; + $parts_cnt = count($parts) - 1; + + while (($i < $parts_cnt) + && ($i < $GLOBALS['cfg']['NavigationTreeTableLevel']) + ) { + $group_name = $parts[$i] . $sep; + $group_name_full .= $group_name; + + if (! isset($group[$group_name])) { + $group[$group_name] = array(); + $group[$group_name]['is' . $sep . 'group'] = true; + $group[$group_name]['tab' . $sep . 'count'] = 1; + $group[$group_name]['tab' . $sep . 'group'] + = $group_name_full; + + } elseif (! isset($group[$group_name]['is' . $sep . 'group'])) { + $table = $group[$group_name]; + $group[$group_name] = array(); + $group[$group_name][$group_name] = $table; + $group[$group_name]['is' . $sep . 'group'] = true; + $group[$group_name]['tab' . $sep . 'count'] = 1; + $group[$group_name]['tab' . $sep . 'group'] + = $group_name_full; + + } else { + $group[$group_name]['tab' . $sep . 'count']++; + } + + $group =& $group[$group_name]; + $i++; + } + + } else { + if (! isset($table_groups[$table_name])) { + $table_groups[$table_name] = array(); + } + $group =& $table_groups; + } + + $table['disp_name'] = $table['Name']; + $group[$table_name] = array_merge($default, $table); + } + + return $table_groups; + } + + /* ----------------------- Set of misc functions ----------------------- */ + + /** + * Adds backquotes on both sides of a database, table or field name. + * and escapes backquotes inside the name with another backquote + * + * example: + * + * echo backquote('owner`s db'); // `owner``s db` + * + * + * + * @param mixed $a_name the database, table or field name to "backquote" + * or array of it + * @param boolean $do_it a flag to bypass this function (used by dump + * functions) + * + * @return mixed the "backquoted" database, table or field name + * + * @access public + */ + public static function backquote($a_name, $do_it = true) + { + if (is_array($a_name)) { + foreach ($a_name as &$data) { + $data = self::backquote($data, $do_it); + } + return $a_name; + } + + if (! $do_it) { + if (!(Context::isKeyword($a_name) & Token::FLAG_KEYWORD_RESERVED) + ) { + return $a_name; + } + } + + // '0' is also empty for php :-( + if (strlen($a_name) > 0 && $a_name !== '*') { + return '`' . str_replace('`', '``', $a_name) . '`'; + } + + return $a_name; + } // end of the 'backquote()' function + + /** + * Adds backquotes on both sides of a database, table or field name. + * in compatibility mode + * + * example: + * + * echo backquoteCompat('owner`s db'); // `owner``s db` + * + * + * + * @param mixed $a_name the database, table or field name to + * "backquote" or array of it + * @param string $compatibility string compatibility mode (used by dump + * functions) + * @param boolean $do_it a flag to bypass this function (used by dump + * functions) + * + * @return mixed the "backquoted" database, table or field name + * + * @access public + */ + public static function backquoteCompat( + $a_name, + $compatibility = 'MSSQL', + $do_it = true + ) { + if (is_array($a_name)) { + foreach ($a_name as &$data) { + $data = self::backquoteCompat($data, $compatibility, $do_it); + } + return $a_name; + } + + if (! $do_it) { + if (!Context::isKeyword($a_name)) { + return $a_name; + } + } + + // @todo add more compatibility cases (ORACLE for example) + switch ($compatibility) { + case 'MSSQL': + $quote = '"'; + break; + default: + $quote = "`"; + break; + } + + // '0' is also empty for php :-( + if (strlen($a_name) > 0 && $a_name !== '*') { + return $quote . $a_name . $quote; + } + + return $a_name; + } // end of the 'backquoteCompat()' function + + /** + * Prepare the message and the query + * usually the message is the result of the query executed + * + * @param Message|string $message the message to display + * @param string $sql_query the query to display + * @param string $type the type (level) of the message + * + * @return string + * + * @access public + */ + public static function getMessage( + $message, + $sql_query = null, + $type = 'notice' + ) { + global $cfg; + $retval = ''; + + if (null === $sql_query) { + if (! empty($GLOBALS['display_query'])) { + $sql_query = $GLOBALS['display_query']; + } elseif (! empty($GLOBALS['unparsed_sql'])) { + $sql_query = $GLOBALS['unparsed_sql']; + } elseif (! empty($GLOBALS['sql_query'])) { + $sql_query = $GLOBALS['sql_query']; + } else { + $sql_query = ''; + } + } + + $render_sql = $cfg['ShowSQL'] == true && ! empty($sql_query) && $sql_query !== ';'; + + if (isset($GLOBALS['using_bookmark_message'])) { + $retval .= $GLOBALS['using_bookmark_message']->getDisplay(); + unset($GLOBALS['using_bookmark_message']); + } + + if ($render_sql) { + $retval .= '
    ' . "\n"; + } + + if ($message instanceof Message) { + if (isset($GLOBALS['special_message'])) { + $message->addText($GLOBALS['special_message']); + unset($GLOBALS['special_message']); + } + $retval .= $message->getDisplay(); + } else { + $retval .= '
    '; + $retval .= Sanitize::sanitize($message); + if (isset($GLOBALS['special_message'])) { + $retval .= Sanitize::sanitize($GLOBALS['special_message']); + unset($GLOBALS['special_message']); + } + $retval .= '
    '; + } + + if ($render_sql) { + $query_too_big = false; + + $queryLength = mb_strlen($sql_query); + if ($queryLength > $cfg['MaxCharactersInDisplayedSQL']) { + // when the query is large (for example an INSERT of binary + // data), the parser chokes; so avoid parsing the query + $query_too_big = true; + $query_base = mb_substr( + $sql_query, + 0, + $cfg['MaxCharactersInDisplayedSQL'] + ) . '[...]'; + } else { + $query_base = $sql_query; + } + + // Html format the query to be displayed + // If we want to show some sql code it is easiest to create it here + /* SQL-Parser-Analyzer */ + + if (! empty($GLOBALS['show_as_php'])) { + $new_line = '\\n"
    ' . "\n" . '    . "'; + $query_base = htmlspecialchars(addslashes($query_base)); + $query_base = preg_replace( + '/((\015\012)|(\015)|(\012))/', + $new_line, + $query_base + ); + $query_base = '
    ' . "\n"
    +                    . '$sql = "' . $query_base . '";' . "\n"
    +                    . '
    '; + } elseif ($query_too_big) { + $query_base = '
    ' . "\n" .
    +                    htmlspecialchars($query_base) .
    +                    '
    '; + } else { + $query_base = self::formatSql($query_base); + } + + // Prepares links that may be displayed to edit/explain the query + // (don't go to default pages, we must go to the page + // where the query box is available) + + // Basic url query part + $url_params = array(); + if (! isset($GLOBALS['db'])) { + $GLOBALS['db'] = ''; + } + if (strlen($GLOBALS['db']) > 0) { + $url_params['db'] = $GLOBALS['db']; + if (strlen($GLOBALS['table']) > 0) { + $url_params['table'] = $GLOBALS['table']; + $edit_link = 'tbl_sql.php'; + } else { + $edit_link = 'db_sql.php'; + } + } else { + $edit_link = 'server_sql.php'; + } + + // Want to have the query explained + // but only explain a SELECT (that has not been explained) + /* SQL-Parser-Analyzer */ + $explain_link = ''; + $is_select = preg_match('@^SELECT[[:space:]]+@i', $sql_query); + if (! empty($cfg['SQLQuery']['Explain']) && ! $query_too_big) { + $explain_params = $url_params; + if ($is_select) { + $explain_params['sql_query'] = 'EXPLAIN ' . $sql_query; + $explain_link = ' [ ' + . self::linkOrButton( + 'import.php', + $explain_params, + __('Explain SQL') + ) . ' ]'; + } elseif (preg_match( + '@^EXPLAIN[[:space:]]+SELECT[[:space:]]+@i', + $sql_query + )) { + $explain_params['sql_query'] + = mb_substr($sql_query, 8); + $explain_link = ' [ ' + . self::linkOrButton( + 'import.php', + $explain_params, + __('Skip Explain SQL') + ) . ']'; + $url = 'https://mariadb.org/explain_analyzer/analyze/' + . '?client=phpMyAdmin&raw_explain=' + . urlencode(self::_generateRowQueryOutput($sql_query)); + $explain_link .= ' [' + . self::linkOrButton( + htmlspecialchars('url.php?url=' . urlencode($url)), + null, + sprintf(__('Analyze Explain at %s'), 'mariadb.org'), + array(), + '_blank' + ) . ' ]'; + } + } //show explain + + $url_params['sql_query'] = $sql_query; + $url_params['show_query'] = 1; + + // even if the query is big and was truncated, offer the chance + // to edit it (unless it's enormous, see linkOrButton() ) + if (! empty($cfg['SQLQuery']['Edit']) + && empty($GLOBALS['show_as_php']) + ) { + $edit_link = ' [ ' + . self::linkOrButton($edit_link, $url_params, __('Edit')) + . ' ]'; + } else { + $edit_link = ''; + } + + // Also we would like to get the SQL formed in some nice + // php-code + if (! empty($cfg['SQLQuery']['ShowAsPHP']) && ! $query_too_big) { + + if (! empty($GLOBALS['show_as_php'])) { + $php_link = ' [ ' + . self::linkOrButton( + 'import.php', + $url_params, + __('Without PHP code') + ) + . ' ]'; + + $php_link .= ' [ ' + . self::linkOrButton( + 'import.php', + $url_params, + __('Submit query') + ) + . ' ]'; + } else { + $php_params = $url_params; + $php_params['show_as_php'] = 1; + $php_link = ' [ ' + . self::linkOrButton( + 'import.php', + $php_params, + __('Create PHP code') + ) + . ' ]'; + } + } else { + $php_link = ''; + } //show as php + + // Refresh query + if (! empty($cfg['SQLQuery']['Refresh']) + && ! isset($GLOBALS['show_as_php']) // 'Submit query' does the same + && preg_match('@^(SELECT|SHOW)[[:space:]]+@i', $sql_query) + ) { + $refresh_link = 'import.php' . Url::getCommon($url_params); + $refresh_link = ' [ ' + . self::linkOrButton('import.php', $url_params, __('Refresh')) . ']'; + } else { + $refresh_link = ''; + } //refresh + + $retval .= '
    '; + $retval .= $query_base; + $retval .= '
    '; + + $retval .= ''; + + $retval .= '
    '; + } + + return $retval; + } // end of the 'getMessage()' function + + /** + * Execute an EXPLAIN query and formats results similar to MySQL command line + * utility. + * + * @param string $sqlQuery EXPLAIN query + * + * @return string query resuls + */ + private static function _generateRowQueryOutput($sqlQuery) + { + $ret = ''; + $result = $GLOBALS['dbi']->query($sqlQuery); + if ($result) { + $devider = '+'; + $columnNames = '|'; + $fieldsMeta = $GLOBALS['dbi']->getFieldsMeta($result); + foreach ($fieldsMeta as $meta) { + $devider .= '---+'; + $columnNames .= ' ' . $meta->name . ' |'; + } + $devider .= "\n"; + + $ret .= $devider . $columnNames . "\n" . $devider; + while ($row = $GLOBALS['dbi']->fetchRow($result)) { + $values = '|'; + foreach ($row as $value) { + if (is_null($value)) { + $value = 'NULL'; + } + $values .= ' ' . $value . ' |'; + } + $ret .= $values . "\n"; + } + $ret .= $devider; + } + return $ret; + } + + /** + * Verifies if current MySQL server supports profiling + * + * @access public + * + * @return boolean whether profiling is supported + */ + public static function profilingSupported() + { + if (!self::cacheExists('profiling_supported')) { + // 5.0.37 has profiling but for example, 5.1.20 does not + // (avoid a trip to the server for MySQL before 5.0.37) + // and do not set a constant as we might be switching servers + if ($GLOBALS['dbi']->fetchValue("SELECT @@have_profiling") + ) { + self::cacheSet('profiling_supported', true); + } else { + self::cacheSet('profiling_supported', false); + } + } + + return self::cacheGet('profiling_supported'); + } + + /** + * Formats $value to byte view + * + * @param double|int $value the value to format + * @param int $limes the sensitiveness + * @param int $comma the number of decimals to retain + * + * @return array the formatted value and its unit + * + * @access public + */ + public static function formatByteDown($value, $limes = 6, $comma = 0) + { + if ($value === null) { + return null; + } + + $byteUnits = array( + /* l10n: shortcuts for Byte */ + __('B'), + /* l10n: shortcuts for Kilobyte */ + __('KiB'), + /* l10n: shortcuts for Megabyte */ + __('MiB'), + /* l10n: shortcuts for Gigabyte */ + __('GiB'), + /* l10n: shortcuts for Terabyte */ + __('TiB'), + /* l10n: shortcuts for Petabyte */ + __('PiB'), + /* l10n: shortcuts for Exabyte */ + __('EiB') + ); + + $dh = pow(10, $comma); + $li = pow(10, $limes); + $unit = $byteUnits[0]; + + for ($d = 6, $ex = 15; $d >= 1; $d--, $ex-=3) { + $unitSize = $li * pow(10, $ex); + if (isset($byteUnits[$d]) && $value >= $unitSize) { + // use 1024.0 to avoid integer overflow on 64-bit machines + $value = round($value / (pow(1024, $d) / $dh)) /$dh; + $unit = $byteUnits[$d]; + break 1; + } // end if + } // end for + + if ($unit != $byteUnits[0]) { + // if the unit is not bytes (as represented in current language) + // reformat with max length of 5 + // 4th parameter=true means do not reformat if value < 1 + $return_value = self::formatNumber($value, 5, $comma, true, false); + } else { + // do not reformat, just handle the locale + $return_value = self::formatNumber($value, 0); + } + + return array(trim($return_value), $unit); + } // end of the 'formatByteDown' function + + + /** + * Formats $value to the given length and appends SI prefixes + * with a $length of 0 no truncation occurs, number is only formatted + * to the current locale + * + * examples: + * + * echo formatNumber(123456789, 6); // 123,457 k + * echo formatNumber(-123456789, 4, 2); // -123.46 M + * echo formatNumber(-0.003, 6); // -3 m + * echo formatNumber(0.003, 3, 3); // 0.003 + * echo formatNumber(0.00003, 3, 2); // 0.03 m + * echo formatNumber(0, 6); // 0 + * + * + * @param double $value the value to format + * @param integer $digits_left number of digits left of the comma + * @param integer $digits_right number of digits right of the comma + * @param boolean $only_down do not reformat numbers below 1 + * @param boolean $noTrailingZero removes trailing zeros right of the comma + * (default: true) + * + * @return string the formatted value and its unit + * + * @access public + */ + public static function formatNumber( + $value, + $digits_left = 3, + $digits_right = 0, + $only_down = false, + $noTrailingZero = true + ) { + if ($value == 0) { + return '0'; + } + + $originalValue = $value; + //number_format is not multibyte safe, str_replace is safe + if ($digits_left === 0) { + $value = number_format( + $value, + $digits_right, + /* l10n: Decimal separator */ + __('.'), + /* l10n: Thousands separator */ + __(',') + ); + if (($originalValue != 0) && (floatval($value) == 0)) { + $value = ' <' . (1 / pow(10, $digits_right)); + } + return $value; + } + + // this units needs no translation, ISO + $units = array( + -8 => 'y', + -7 => 'z', + -6 => 'a', + -5 => 'f', + -4 => 'p', + -3 => 'n', + -2 => 'µ', + -1 => 'm', + 0 => ' ', + 1 => 'k', + 2 => 'M', + 3 => 'G', + 4 => 'T', + 5 => 'P', + 6 => 'E', + 7 => 'Z', + 8 => 'Y' + ); + /* l10n: Decimal separator */ + $decimal_sep = __('.'); + /* l10n: Thousands separator */ + $thousands_sep = __(','); + + // check for negative value to retain sign + if ($value < 0) { + $sign = '-'; + $value = abs($value); + } else { + $sign = ''; + } + + $dh = pow(10, $digits_right); + + /* + * This gives us the right SI prefix already, + * but $digits_left parameter not incorporated + */ + $d = floor(log10($value) / 3); + /* + * Lowering the SI prefix by 1 gives us an additional 3 zeros + * So if we have 3,6,9,12.. free digits ($digits_left - $cur_digits) + * to use, then lower the SI prefix + */ + $cur_digits = floor(log10($value / pow(1000, $d))+1); + if ($digits_left > $cur_digits) { + $d -= floor(($digits_left - $cur_digits)/3); + } + + if ($d < 0 && $only_down) { + $d = 0; + } + + $value = round($value / (pow(1000, $d) / $dh)) /$dh; + $unit = $units[$d]; + + // number_format is not multibyte safe, str_replace is safe + $formattedValue = number_format( + $value, + $digits_right, + $decimal_sep, + $thousands_sep + ); + // If we don't want any zeros, remove them now + if ($noTrailingZero && strpos($formattedValue, $decimal_sep) !== false) { + $formattedValue = preg_replace('/' . preg_quote($decimal_sep) . '?0+$/', '', $formattedValue); + } + + if ($originalValue != 0 && floatval($value) == 0) { + return ' <' . number_format( + (1 / pow(10, $digits_right)), + $digits_right, + $decimal_sep, + $thousands_sep + ) + . ' ' . $unit; + } + + return $sign . $formattedValue . ' ' . $unit; + } // end of the 'formatNumber' function + + /** + * Returns the number of bytes when a formatted size is given + * + * @param string $formatted_size the size expression (for example 8MB) + * + * @return integer The numerical part of the expression (for example 8) + */ + public static function extractValueFromFormattedSize($formatted_size) + { + $return_value = -1; + + if (preg_match('/^[0-9]+GB$/', $formatted_size)) { + $return_value = mb_substr($formatted_size, 0, -2) + * pow(1024, 3); + } elseif (preg_match('/^[0-9]+MB$/', $formatted_size)) { + $return_value = mb_substr($formatted_size, 0, -2) + * pow(1024, 2); + } elseif (preg_match('/^[0-9]+K$/', $formatted_size)) { + $return_value = mb_substr($formatted_size, 0, -1) + * pow(1024, 1); + } + return $return_value; + }// end of the 'extractValueFromFormattedSize' function + + /** + * Writes localised date + * + * @param integer $timestamp the current timestamp + * @param string $format format + * + * @return string the formatted date + * + * @access public + */ + public static function localisedDate($timestamp = -1, $format = '') + { + $month = array( + /* l10n: Short month name */ + __('Jan'), + /* l10n: Short month name */ + __('Feb'), + /* l10n: Short month name */ + __('Mar'), + /* l10n: Short month name */ + __('Apr'), + /* l10n: Short month name */ + _pgettext('Short month name', 'May'), + /* l10n: Short month name */ + __('Jun'), + /* l10n: Short month name */ + __('Jul'), + /* l10n: Short month name */ + __('Aug'), + /* l10n: Short month name */ + __('Sep'), + /* l10n: Short month name */ + __('Oct'), + /* l10n: Short month name */ + __('Nov'), + /* l10n: Short month name */ + __('Dec')); + $day_of_week = array( + /* l10n: Short week day name for Sunday */ + _pgettext('Short week day name', 'Sun'), + /* l10n: Short week day name for Monday */ + __('Mon'), + /* l10n: Short week day name for Tuesday */ + __('Tue'), + /* l10n: Short week day name for Wednesday */ + __('Wed'), + /* l10n: Short week day name for Thursday */ + __('Thu'), + /* l10n: Short week day name for Friday */ + __('Fri'), + /* l10n: Short week day name for Saturday */ + __('Sat')); + + if ($format == '') { + /* l10n: See https://www.php.net/manual/en/function.strftime.php */ + $format = __('%B %d, %Y at %I:%M %p'); + } + + if ($timestamp == -1) { + $timestamp = time(); + } + + $date = preg_replace( + '@%[aA]@', + $day_of_week[(int)strftime('%w', $timestamp)], + $format + ); + $date = preg_replace( + '@%[bB]@', + $month[(int)strftime('%m', $timestamp)-1], + $date + ); + + /* Fill in AM/PM */ + $hours = (int)date('H', $timestamp); + if ($hours >= 12) { + $am_pm = _pgettext('AM/PM indication in time', 'PM'); + } else { + $am_pm = _pgettext('AM/PM indication in time', 'AM'); + } + $date = preg_replace('@%[pP]@', $am_pm, $date); + + $ret = strftime($date, $timestamp); + // Some OSes such as Win8.1 Traditional Chinese version did not produce UTF-8 + // output here. See https://github.com/phpmyadmin/phpmyadmin/issues/10598 + if (mb_detect_encoding($ret, 'UTF-8', true) != 'UTF-8') { + $ret = date('Y-m-d H:i:s', $timestamp); + } + + return $ret; + } // end of the 'localisedDate()' function + + /** + * returns a tab for tabbed navigation. + * If the variables $link and $args ar left empty, an inactive tab is created + * + * @param array $tab array with all options + * @param array $url_params tab specific URL parameters + * + * @return string html code for one tab, a link if valid otherwise a span + * + * @access public + */ + public static function getHtmlTab(array $tab, array $url_params = array()) + { + // default values + $defaults = array( + 'text' => '', + 'class' => '', + 'active' => null, + 'link' => '', + 'sep' => '?', + 'attr' => '', + 'args' => '', + 'warning' => '', + 'fragment' => '', + 'id' => '', + ); + + $tab = array_merge($defaults, $tab); + + // determine additional style-class + if (empty($tab['class'])) { + if (! empty($tab['active']) + || Core::isValid($GLOBALS['active_page'], 'identical', $tab['link']) + ) { + $tab['class'] = 'active'; + } elseif (is_null($tab['active']) && empty($GLOBALS['active_page']) + && (basename($GLOBALS['PMA_PHP_SELF']) == $tab['link']) + ) { + $tab['class'] = 'active'; + } + } + + // build the link + if (! empty($tab['link'])) { + // If there are any tab specific URL parameters, merge those with + // the general URL parameters + if (! empty($tab['args']) && is_array($tab['args'])) { + $url_params = array_merge($url_params, $tab['args']); + } + $tab['link'] = htmlentities($tab['link']) . Url::getCommon($url_params); + } + + if (! empty($tab['fragment'])) { + $tab['link'] .= $tab['fragment']; + } + + // display icon + if (isset($tab['icon'])) { + // avoid generating an alt tag, because it only illustrates + // the text that follows and if browser does not display + // images, the text is duplicated + $tab['text'] = self::getIcon( + $tab['icon'], + $tab['text'], + false, + true, + 'TabsMode' + ); + + } elseif (empty($tab['text'])) { + // check to not display an empty link-text + $tab['text'] = '?'; + trigger_error( + 'empty linktext in function ' . __FUNCTION__ . '()', + E_USER_NOTICE + ); + } + + //Set the id for the tab, if set in the params + $tabId = (empty($tab['id']) ? null : $tab['id']); + + $item = array(); + if (!empty($tab['link'])) { + $item = array( + 'content' => $tab['text'], + 'url' => array( + 'href' => empty($tab['link']) ? null : $tab['link'], + 'id' => $tabId, + 'class' => 'tab' . htmlentities($tab['class']), + ), + ); + } else { + $item['content'] = '' . $tab['text'] . ''; + } + + $item['class'] = $tab['class'] == 'active' ? 'active' : ''; + + return Template::get('list/item') + ->render($item); + } // end of the 'getHtmlTab()' function + + /** + * returns html-code for a tab navigation + * + * @param array $tabs one element per tab + * @param array $url_params additional URL parameters + * @param string $menu_id HTML id attribute for the menu container + * @param bool $resizable whether to add a "resizable" class + * + * @return string html-code for tab-navigation + */ + public static function getHtmlTabs( + array $tabs, + array $url_params, + $menu_id, + $resizable = false + ) { + $class = ''; + if ($resizable) { + $class = ' class="resizable-menu"'; + } + + $tab_navigation = '' . "\n"; + + return $tab_navigation; + } + + /** + * Displays a link, or a link with code to trigger POST request. + * + * POST is used in following cases: + * + * - URL is too long + * - URL components are over Suhosin limits + * - There is SQL query in the parameters + * + * @param string $urlPath the URL + * @param array|null $urlParams URL parameters + * @param string $message the link message + * @param mixed $tag_params string: js confirmation; array: additional tag params (f.e. style="") + * @param string $target target + * + * @return string the results to be echoed or saved in an array + */ + public static function linkOrButton( + $urlPath, $urlParams, $message, $tag_params = array(), $target = '' + ) { + $url = $urlPath; + if (is_array($urlParams)) { + $url = $urlPath . Url::getCommon($urlParams, '?', false); + } + + $url_length = strlen($url); + + if (! is_array($tag_params)) { + $tmp = $tag_params; + $tag_params = array(); + if (! empty($tmp)) { + $tag_params['onclick'] = 'return confirmLink(this, \'' + . Sanitize::escapeJsString($tmp) . '\')'; + } + unset($tmp); + } + if (! empty($target)) { + $tag_params['target'] = $target; + if ($target === '_blank' && strncmp($url, 'url.php?', 8) == 0) { + $tag_params['rel'] = 'noopener noreferrer'; + } + } + + // Suhosin: Check that each query parameter is not above maximum + $in_suhosin_limits = true; + if ($url_length <= $GLOBALS['cfg']['LinkLengthLimit']) { + $suhosin_get_MaxValueLength = ini_get('suhosin.get.max_value_length'); + if ($suhosin_get_MaxValueLength) { + $query_parts = self::splitURLQuery($url); + foreach ($query_parts as $query_pair) { + if (strpos($query_pair, '=') === false) { + continue; + } + + list(, $eachval) = explode('=', $query_pair); + if (strlen($eachval) > $suhosin_get_MaxValueLength + ) { + $in_suhosin_limits = false; + break; + } + } + } + } + + $tag_params_strings = array(); + if (($url_length > $GLOBALS['cfg']['LinkLengthLimit']) + || ! $in_suhosin_limits + // Has as sql_query without a signature + || ( strpos($url, 'sql_query=') !== false && strpos($url, 'sql_signature=') === false) + || strpos($url, 'view[as]=') !== false + ) { + $parts = explode('?', $url, 2); + /* + * The data-post indicates that client should do POST + * this is handled in js/ajax.js + */ + $tag_params_strings[] = 'data-post="' . (isset($parts[1]) ? $parts[1] : '') . '"'; + $url = $parts[0]; + if(array_key_exists('class', $tag_params) + && strpos($tag_params['class'], 'create_view') !== false + ) { + $url .= '?' . explode('&', $parts[1], 2)[0]; + } + } else { + $url = $urlPath; + if (is_array($urlParams)) { + $url = $urlPath . Url::getCommon($urlParams); + } + } + + foreach ($tag_params as $par_name => $par_value) { + $tag_params_strings[] = $par_name . '="' . htmlspecialchars($par_value) . '"'; + } + + // no whitespace within an else Safari will make it part of the link + return '' + . $message . ''; + } // end of the 'linkOrButton()' function + + /** + * Splits a URL string by parameter + * + * @param string $url the URL + * + * @return array the parameter/value pairs, for example [0] db=sakila + */ + public static function splitURLQuery($url) + { + // decode encoded url separators + $separator = Url::getArgSeparator(); + // on most places separator is still hard coded ... + if ($separator !== '&') { + // ... so always replace & with $separator + $url = str_replace(htmlentities('&'), $separator, $url); + $url = str_replace('&', $separator, $url); + } + + $url = str_replace(htmlentities($separator), $separator, $url); + // end decode + + $url_parts = parse_url($url); + + if (! empty($url_parts['query'])) { + return explode($separator, $url_parts['query']); + } + + return array(); + } + + /** + * Returns a given timespan value in a readable format. + * + * @param int $seconds the timespan + * + * @return string the formatted value + */ + public static function timespanFormat($seconds) + { + $days = floor($seconds / 86400); + if ($days > 0) { + $seconds -= $days * 86400; + } + + $hours = floor($seconds / 3600); + if ($days > 0 || $hours > 0) { + $seconds -= $hours * 3600; + } + + $minutes = floor($seconds / 60); + if ($days > 0 || $hours > 0 || $minutes > 0) { + $seconds -= $minutes * 60; + } + + return sprintf( + __('%s days, %s hours, %s minutes and %s seconds'), + (string)$days, + (string)$hours, + (string)$minutes, + (string)$seconds + ); + } + + /** + * Function added to avoid path disclosures. + * Called by each script that needs parameters, it displays + * an error message and, by default, stops the execution. + * + * @param string[] $params The names of the parameters needed by the calling + * script + * @param boolean $request Check parameters in request + * + * @return void + * + * @access public + */ + public static function checkParameters($params, $request=false) + { + $reported_script_name = basename($GLOBALS['PMA_PHP_SELF']); + $found_error = false; + $error_message = ''; + if ($request) { + $array = $_REQUEST; + } else { + $array = $GLOBALS; + } + + foreach ($params as $param) { + if (! isset($array[$param])) { + $error_message .= $reported_script_name + . ': ' . __('Missing parameter:') . ' ' + . $param + . self::showDocu('faq', 'faqmissingparameters',true) + . '[br]'; + $found_error = true; + } + } + if ($found_error) { + Core::fatalError($error_message); + } + } // end function + + /** + * Function to generate unique condition for specified row. + * + * @param resource $handle current query result + * @param integer $fields_cnt number of fields + * @param array $fields_meta meta information about fields + * @param array $row current row + * @param boolean $force_unique generate condition only on pk + * or unique + * @param string|boolean $restrict_to_table restrict the unique condition + * to this table or false if + * none + * @param array|null $analyzed_sql_results the analyzed query + * + * @access public + * + * @return array the calculated condition and whether condition is unique + */ + public static function getUniqueCondition( + $handle, $fields_cnt, array $fields_meta, array $row, $force_unique = false, + $restrict_to_table = false, $analyzed_sql_results = null + ) { + $primary_key = ''; + $unique_key = ''; + $nonprimary_condition = ''; + $preferred_condition = ''; + $primary_key_array = array(); + $unique_key_array = array(); + $nonprimary_condition_array = array(); + $condition_array = array(); + + for ($i = 0; $i < $fields_cnt; ++$i) { + + $con_val = ''; + $field_flags = $GLOBALS['dbi']->fieldFlags($handle, $i); + $meta = $fields_meta[$i]; + + // do not use a column alias in a condition + if (! isset($meta->orgname) || strlen($meta->orgname) === 0) { + $meta->orgname = $meta->name; + + if (!empty($analyzed_sql_results['statement']->expr)) { + foreach ($analyzed_sql_results['statement']->expr as $expr) { + if ((empty($expr->alias)) || (empty($expr->column))) { + continue; + } + if (strcasecmp($meta->name, $expr->alias) == 0) { + $meta->orgname = $expr->column; + break; + } + } + } + } + + // Do not use a table alias in a condition. + // Test case is: + // select * from galerie x WHERE + //(select count(*) from galerie y where y.datum=x.datum)>1 + // + // But orgtable is present only with mysqli extension so the + // fix is only for mysqli. + // Also, do not use the original table name if we are dealing with + // a view because this view might be updatable. + // (The isView() verification should not be costly in most cases + // because there is some caching in the function). + if (isset($meta->orgtable) + && ($meta->table != $meta->orgtable) + && ! $GLOBALS['dbi']->getTable($GLOBALS['db'], $meta->table)->isView() + ) { + $meta->table = $meta->orgtable; + } + + // If this field is not from the table which the unique clause needs + // to be restricted to. + if ($restrict_to_table && $restrict_to_table != $meta->table) { + continue; + } + + // to fix the bug where float fields (primary or not) + // can't be matched because of the imprecision of + // floating comparison, use CONCAT + // (also, the syntax "CONCAT(field) IS NULL" + // that we need on the next "if" will work) + if ($meta->type == 'real') { + $con_key = 'CONCAT(' . self::backquote($meta->table) . '.' + . self::backquote($meta->orgname) . ')'; + } else { + $con_key = self::backquote($meta->table) . '.' + . self::backquote($meta->orgname); + } // end if... else... + $condition = ' ' . $con_key . ' '; + + if (! isset($row[$i]) || is_null($row[$i])) { + $con_val = 'IS NULL'; + } else { + // timestamp is numeric on some MySQL 4.1 + // for real we use CONCAT above and it should compare to string + if ($meta->numeric + && ($meta->type != 'timestamp') + && ($meta->type != 'real') + ) { + $con_val = '= ' . $row[$i]; + } elseif ((($meta->type == 'blob') || ($meta->type == 'string')) + && stristr($field_flags, 'BINARY') + && ! empty($row[$i]) + ) { + // hexify only if this is a true not empty BLOB or a BINARY + + // do not waste memory building a too big condition + if (mb_strlen($row[$i]) < 1000) { + // use a CAST if possible, to avoid problems + // if the field contains wildcard characters % or _ + $con_val = '= CAST(0x' . bin2hex($row[$i]) . ' AS BINARY)'; + } elseif ($fields_cnt == 1) { + // when this blob is the only field present + // try settling with length comparison + $condition = ' CHAR_LENGTH(' . $con_key . ') '; + $con_val = ' = ' . mb_strlen($row[$i]); + } else { + // this blob won't be part of the final condition + $con_val = null; + } + } elseif (in_array($meta->type, self::getGISDatatypes()) + && ! empty($row[$i]) + ) { + // do not build a too big condition + if (mb_strlen($row[$i]) < 5000) { + $condition .= '=0x' . bin2hex($row[$i]) . ' AND'; + } else { + $condition = ''; + } + } elseif ($meta->type == 'bit') { + $con_val = "= b'" + . self::printableBitValue($row[$i], $meta->length) . "'"; + } else { + $con_val = '= \'' + . $GLOBALS['dbi']->escapeString($row[$i]) . '\''; + } + } + + if ($con_val != null) { + + $condition .= $con_val . ' AND'; + + if ($meta->primary_key > 0) { + $primary_key .= $condition; + $primary_key_array[$con_key] = $con_val; + } elseif ($meta->unique_key > 0) { + $unique_key .= $condition; + $unique_key_array[$con_key] = $con_val; + } + + $nonprimary_condition .= $condition; + $nonprimary_condition_array[$con_key] = $con_val; + } + } // end for + + // Correction University of Virginia 19991216: + // prefer primary or unique keys for condition, + // but use conjunction of all values if no primary key + $clause_is_unique = true; + + if ($primary_key) { + $preferred_condition = $primary_key; + $condition_array = $primary_key_array; + + } elseif ($unique_key) { + $preferred_condition = $unique_key; + $condition_array = $unique_key_array; + + } elseif (! $force_unique) { + $preferred_condition = $nonprimary_condition; + $condition_array = $nonprimary_condition_array; + $clause_is_unique = false; + } + + $where_clause = trim(preg_replace('|\s?AND$|', '', $preferred_condition)); + return(array($where_clause, $clause_is_unique, $condition_array)); + } // end function + + /** + * Generate the charset query part + * + * @param string $collation Collation + * @param boolean optional $override force 'CHARACTER SET' keyword + * + * @return string + */ + static function getCharsetQueryPart($collation, $override = false) + { + list($charset) = explode('_', $collation); + $keyword = ' CHARSET='; + + if ($override) { + $keyword = ' CHARACTER SET '; + } + return $keyword . $charset + . ($charset == $collation ? '' : ' COLLATE ' . $collation); + } + + /** + * Generate a button or image tag + * + * @param string $button_name name of button element + * @param string $button_class class of button or image element + * @param string $text text to display + * @param string $image image to display + * @param string $value value + * + * @return string html content + * + * @access public + */ + public static function getButtonOrImage( + $button_name, $button_class, $text, $image, $value = '' + ) { + if ($value == '') { + $value = $text; + } + if ($GLOBALS['cfg']['ActionLinksMode'] == 'text') { + return ' ' . "\n"; + } + return '' . "\n"; + } // end function + + /** + * Generate a pagination selector for browsing resultsets + * + * @param string $name The name for the request parameter + * @param int $rows Number of rows in the pagination set + * @param int $pageNow current page number + * @param int $nbTotalPage number of total pages + * @param int $showAll If the number of pages is lower than this + * variable, no pages will be omitted in pagination + * @param int $sliceStart How many rows at the beginning should always + * be shown? + * @param int $sliceEnd How many rows at the end should always be shown? + * @param int $percent Percentage of calculation page offsets to hop to a + * next page + * @param int $range Near the current page, how many pages should + * be considered "nearby" and displayed as well? + * @param string $prompt The prompt to display (sometimes empty) + * + * @return string + * + * @access public + */ + public static function pageselector( + $name, $rows, $pageNow = 1, $nbTotalPage = 1, $showAll = 200, + $sliceStart = 5, + $sliceEnd = 5, $percent = 20, $range = 10, $prompt = '' + ) { + $increment = floor($nbTotalPage / $percent); + $pageNowMinusRange = ($pageNow - $range); + $pageNowPlusRange = ($pageNow + $range); + + $gotopage = $prompt . ' '; + + return $gotopage; + } // end function + + + /** + * Calculate page number through position + * @param int $pos position of first item + * @param int $max_count number of items per page + * @return int $page_num + * @access public + */ + public static function getPageFromPosition($pos, $max_count) + { + return floor($pos / $max_count) + 1; + } + + /** + * Prepare navigation for a list + * + * @param int $count number of elements in the list + * @param int $pos current position in the list + * @param array $_url_params url parameters + * @param string $script script name for form target + * @param string $frame target frame + * @param int $max_count maximum number of elements to display from + * the list + * @param string $name the name for the request parameter + * @param string[] $classes additional classes for the container + * + * @return string $list_navigator_html the html content + * + * @access public + * + * @todo use $pos from $_url_params + */ + + public static function getListNavigator( + $count, $pos, array $_url_params, $script, $frame, $max_count, $name = 'pos', + $classes = array() + ) { + + // This is often coming from $cfg['MaxTableList'] and + // people sometimes set it to empty string + $max_count = intval($max_count); + if ($max_count <= 0) { + $max_count = 250; + } + + $class = $frame == 'frame_navigation' ? ' class="ajax"' : ''; + + $list_navigator_html = ''; + + if ($max_count < $count) { + + $classes[] = 'pageselector'; + $list_navigator_html .= '
    '; + + if ($frame != 'frame_navigation') { + $list_navigator_html .= __('Page number:'); + } + + // Move to the beginning or to the previous page + if ($pos > 0) { + $caption1 = ''; $caption2 = ''; + if (self::showIcons('TableNavigationLinksMode')) { + $caption1 .= '<< '; + $caption2 .= '< '; + } + if (self::showText('TableNavigationLinksMode')) { + $caption1 .= _pgettext('First page', 'Begin'); + $caption2 .= _pgettext('Previous page', 'Previous'); + } + $title1 = ' title="' . _pgettext('First page', 'Begin') . '"'; + $title2 = ' title="' . _pgettext('Previous page', 'Previous') . '"'; + + $_url_params[$name] = 0; + $list_navigator_html .= '' . $caption1 . ''; + + $_url_params[$name] = $pos - $max_count; + $list_navigator_html .= ' ' . $caption2 . ''; + } + + $list_navigator_html .= '
    '; + + $list_navigator_html .= Url::getHiddenInputs($_url_params); + $list_navigator_html .= self::pageselector( + $name, + $max_count, + self::getPageFromPosition($pos, $max_count), + ceil($count / $max_count) + ); + $list_navigator_html .= '
    '; + + if ($pos + $max_count < $count) { + $caption3 = ''; $caption4 = ''; + if (self::showText('TableNavigationLinksMode')) { + $caption3 .= _pgettext('Next page', 'Next'); + $caption4 .= _pgettext('Last page', 'End'); + } + if (self::showIcons('TableNavigationLinksMode')) { + $caption3 .= ' >'; + $caption4 .= ' >>'; + if (! self::showText('TableNavigationLinksMode')) { + + } + } + $title3 = ' title="' . _pgettext('Next page', 'Next') . '"'; + $title4 = ' title="' . _pgettext('Last page', 'End') . '"'; + + $_url_params[$name] = $pos + $max_count; + $list_navigator_html .= '' . $caption3 . ''; + + $_url_params[$name] = floor($count / $max_count) * $max_count; + if ($_url_params[$name] == $count) { + $_url_params[$name] = $count - $max_count; + } + + $list_navigator_html .= ' ' . $caption4 . ''; + } + $list_navigator_html .= '
    ' . "\n"; + } + + return $list_navigator_html; + } + + /** + * replaces %u in given path with current user name + * + * example: + * + * $user_dir = userDir('/var/pma_tmp/%u/'); // '/var/pma_tmp/root/' + * + * + * + * @param string $dir with wildcard for user + * + * @return string per user directory + */ + public static function userDir($dir) + { + // add trailing slash + if (mb_substr($dir, -1) != '/') { + $dir .= '/'; + } + + return str_replace('%u', Core::securePath($GLOBALS['cfg']['Server']['user']), $dir); + } + + /** + * returns html code for db link to default db page + * + * @param string $database database + * + * @return string html link to default db page + */ + public static function getDbLink($database = null) + { + if (strlen($database) === 0) { + if (strlen($GLOBALS['db']) === 0) { + return ''; + } + $database = $GLOBALS['db']; + } else { + $database = self::unescapeMysqlWildcards($database); + } + + return '' . htmlspecialchars($database) . ''; + } + + /** + * Prepare a lightbulb hint explaining a known external bug + * that affects a functionality + * + * @param string $functionality localized message explaining the func. + * @param string $component 'mysql' (eventually, 'php') + * @param string $minimum_version of this component + * @param string $bugref bug reference for this component + * + * @return String + */ + public static function getExternalBug( + $functionality, $component, $minimum_version, $bugref + ) { + $ext_but_html = ''; + if (($component == 'mysql') && ($GLOBALS['dbi']->getVersion() < $minimum_version)) { + $ext_but_html .= self::showHint( + sprintf( + __('The %s functionality is affected by a known bug, see %s'), + $functionality, + Core::linkURL('https://bugs.mysql.com/') . $bugref + ) + ); + } + return $ext_but_html; + } + + /** + * Generates a set of radio HTML fields + * + * @param string $html_field_name the radio HTML field + * @param array $choices the choices values and labels + * @param string $checked_choice the choice to check by default + * @param boolean $line_break whether to add HTML line break after a choice + * @param boolean $escape_label whether to use htmlspecialchars() on label + * @param string $class enclose each choice with a div of this class + * @param string $id_prefix prefix for the id attribute, name will be + * used if this is not supplied + * + * @return string set of html radio fiels + */ + public static function getRadioFields( + $html_field_name, array $choices, $checked_choice = '', + $line_break = true, $escape_label = true, $class = '', + $id_prefix = '' + ) { + $radio_html = ''; + + foreach ($choices as $choice_value => $choice_label) { + + if (! $id_prefix) { + $id_prefix = $html_field_name; + } + $html_field_id = $id_prefix . '_' . $choice_value; + + if ($choice_value == $checked_choice){ + $checked = 1; + } + else{ + $checked = 0; + } + $radio_html .= Template::get('radio_fields')->render([ + 'class' => $class, + 'html_field_name' => $html_field_name, + 'html_field_id' => $html_field_id, + 'choice_value' => $choice_value, + 'is_line_break' => $line_break, + 'choice_label' => $choice_label, + 'escape_label' => $escape_label, + 'checked' => $checked + ]); + } + + return $radio_html; + + } + + /** + * Generates and returns an HTML dropdown + * + * @param string $select_name name for the select element + * @param array $choices choices values + * @param string $active_choice the choice to select by default + * @param string $id id of the select element; can be different in + * case the dropdown is present more than once + * on the page + * @param string $class class for the select element + * @param string $placeholder Placeholder for dropdown if nothing else + * is selected + * + * @return string html content + * + * @todo support titles + */ + public static function getDropdown( + $select_name, array $choices, $active_choice, $id, $class = '', $placeholder = null + ) { + $resultOptions = []; + $selected = false; + + foreach ($choices as $one_choice_value => $one_choice_label) { + $resultOptions[$one_choice_value]['value'] = $one_choice_value; + $resultOptions[$one_choice_value]['selected'] = false; + + if ($one_choice_value == $active_choice) { + $resultOptions[$one_choice_value]['selected'] = true; + $selected = true; + } + $resultOptions[$one_choice_value]['label'] = $one_choice_label; + } + return Template::get('dropdown')->render([ + 'select_name' => $select_name, + 'id' => $id, + 'class' => $class, + 'placeholder' => $placeholder, + 'selected' => $selected, + 'result_options' => $resultOptions, + ]); + } + + /** + * Generates a slider effect (jQjuery) + * Takes care of generating the initial
    and the link + * controlling the slider; you have to generate the
    yourself + * after the sliding section. + * + * @param string $id the id of the
    on which to apply the effect + * @param string $message the message to show as a link + * @param string|null $overrideDefault override InitialSlidersState config + * + * @return string html div element + * + */ + public static function getDivForSliderEffect($id = '', $message = '', $overrideDefault = null) + { + return Template::get('div_for_slider_effect')->render([ + 'id' => $id, + 'initial_sliders_state' => ($overrideDefault != null) ? $overrideDefault : $GLOBALS['cfg']['InitialSlidersState'], + 'message' => $message, + ]); + } + + /** + * Creates an AJAX sliding toggle button + * (or and equivalent form when AJAX is disabled) + * + * @param string $action The URL for the request to be executed + * @param string $select_name The name for the dropdown box + * @param array $options An array of options (see PhpMyAdmin\Rte\Footer) + * @param string $callback A JS snippet to execute when the request is + * successfully processed + * + * @return string HTML code for the toggle button + */ + public static function toggleButton($action, $select_name, array $options, $callback) + { + // Do the logic first + $link = "$action&" . urlencode($select_name) . "="; + $link_on = $link . urlencode($options[1]['value']); + $link_off = $link . urlencode($options[0]['value']); + + if ($options[1]['selected'] == true) { + $state = 'on'; + } elseif ($options[0]['selected'] == true) { + $state = 'off'; + } else { + $state = 'on'; + } + + return Template::get('toggle_button')->render( + [ + 'pma_theme_image' => $GLOBALS['pmaThemeImage'], + 'text_dir' => $GLOBALS['text_dir'], + 'link_on' => $link_on, + 'link_off' => $link_off, + 'toggle_on' => $options[1]['label'], + 'toggle_off' => $options[0]['label'], + 'callback' => $callback, + 'state' => $state + ]); + } // end toggleButton() + + /** + * Clears cache content which needs to be refreshed on user change. + * + * @return void + */ + public static function clearUserCache() + { + self::cacheUnset('is_superuser'); + self::cacheUnset('is_createuser'); + self::cacheUnset('is_grantuser'); + } + + /** + * Calculates session cache key + * + * @return string + */ + public static function cacheKey() + { + if (isset($GLOBALS['cfg']['Server']['user'])) { + return 'server_' . $GLOBALS['server'] . '_' . $GLOBALS['cfg']['Server']['user']; + } + + return 'server_' . $GLOBALS['server']; + } + + /** + * Verifies if something is cached in the session + * + * @param string $var variable name + * + * @return boolean + */ + public static function cacheExists($var) + { + return isset($_SESSION['cache'][self::cacheKey()][$var]); + } + + /** + * Gets cached information from the session + * + * @param string $var variable name + * @param \Closure $callback callback to fetch the value + * + * @return mixed + */ + public static function cacheGet($var, $callback = null) + { + if (self::cacheExists($var)) { + return $_SESSION['cache'][self::cacheKey()][$var]; + } + + if ($callback) { + $val = $callback(); + self::cacheSet($var, $val); + return $val; + } + return null; + } + + /** + * Caches information in the session + * + * @param string $var variable name + * @param mixed $val value + * + * @return mixed + */ + public static function cacheSet($var, $val = null) + { + $_SESSION['cache'][self::cacheKey()][$var] = $val; + } + + /** + * Removes cached information from the session + * + * @param string $var variable name + * + * @return void + */ + public static function cacheUnset($var) + { + unset($_SESSION['cache'][self::cacheKey()][$var]); + } + + /** + * Converts a bit value to printable format; + * in MySQL a BIT field can be from 1 to 64 bits so we need this + * function because in PHP, decbin() supports only 32 bits + * on 32-bit servers + * + * @param integer $value coming from a BIT field + * @param integer $length length + * + * @return string the printable value + */ + public static function printableBitValue($value, $length) + { + // if running on a 64-bit server or the length is safe for decbin() + if (PHP_INT_SIZE == 8 || $length < 33) { + $printable = decbin($value); + } else { + // FIXME: does not work for the leftmost bit of a 64-bit value + $i = 0; + $printable = ''; + while ($value >= pow(2, $i)) { + ++$i; + } + if ($i != 0) { + --$i; + } + + while ($i >= 0) { + if ($value - pow(2, $i) < 0) { + $printable = '0' . $printable; + } else { + $printable = '1' . $printable; + $value = $value - pow(2, $i); + } + --$i; + } + $printable = strrev($printable); + } + $printable = str_pad($printable, $length, '0', STR_PAD_LEFT); + return $printable; + } + + /** + * Verifies whether the value contains a non-printable character + * + * @param string $value value + * + * @return integer + */ + public static function containsNonPrintableAscii($value) + { + return preg_match('@[^[:print:]]@', $value); + } + + /** + * Converts a BIT type default value + * for example, b'010' becomes 010 + * + * @param string $bit_default_value value + * + * @return string the converted value + */ + public static function convertBitDefaultValue($bit_default_value) + { + return rtrim(ltrim(htmlspecialchars_decode($bit_default_value, ENT_QUOTES), "b'"), "'"); + } + + /** + * Extracts the various parts from a column spec + * + * @param string $columnspec Column specification + * + * @return array associative array containing type, spec_in_brackets + * and possibly enum_set_values (another array) + */ + public static function extractColumnSpec($columnspec) + { + $first_bracket_pos = mb_strpos($columnspec, '('); + if ($first_bracket_pos) { + $spec_in_brackets = chop( + mb_substr( + $columnspec, + $first_bracket_pos + 1, + mb_strrpos($columnspec, ')') - $first_bracket_pos - 1 + ) + ); + // convert to lowercase just to be sure + $type = mb_strtolower( + chop(mb_substr($columnspec, 0, $first_bracket_pos)) + ); + } else { + // Split trailing attributes such as unsigned, + // binary, zerofill and get data type name + $type_parts = explode(' ', $columnspec); + $type = mb_strtolower($type_parts[0]); + $spec_in_brackets = ''; + } + + if ('enum' == $type || 'set' == $type) { + // Define our working vars + $enum_set_values = self::parseEnumSetValues($columnspec, false); + $printtype = $type + . '(' . str_replace("','", "', '", $spec_in_brackets) . ')'; + $binary = false; + $unsigned = false; + $zerofill = false; + } else { + $enum_set_values = array(); + + /* Create printable type name */ + $printtype = mb_strtolower($columnspec); + + // Strip the "BINARY" attribute, except if we find "BINARY(" because + // this would be a BINARY or VARBINARY column type; + // by the way, a BLOB should not show the BINARY attribute + // because this is not accepted in MySQL syntax. + if (preg_match('@binary@', $printtype) + && ! preg_match('@binary[\(]@', $printtype) + ) { + $printtype = preg_replace('@binary@', '', $printtype); + $binary = true; + } else { + $binary = false; + } + + $printtype = preg_replace( + '@zerofill@', '', $printtype, -1, $zerofill_cnt + ); + $zerofill = ($zerofill_cnt > 0); + $printtype = preg_replace( + '@unsigned@', '', $printtype, -1, $unsigned_cnt + ); + $unsigned = ($unsigned_cnt > 0); + $printtype = trim($printtype); + } + + $attribute = ' '; + if ($binary) { + $attribute = 'BINARY'; + } + if ($unsigned) { + $attribute = 'UNSIGNED'; + } + if ($zerofill) { + $attribute = 'UNSIGNED ZEROFILL'; + } + + $can_contain_collation = false; + if (! $binary + && preg_match( + "@^(char|varchar|text|tinytext|mediumtext|longtext|set|enum)@", $type + ) + ) { + $can_contain_collation = true; + } + + // for the case ENUM('–','“') + $displayed_type = htmlspecialchars($printtype); + if (mb_strlen($printtype) > $GLOBALS['cfg']['LimitChars']) { + $displayed_type = ''; + $displayed_type .= htmlspecialchars( + mb_substr( + $printtype, 0, $GLOBALS['cfg']['LimitChars'] + ) . '...' + ); + $displayed_type .= ''; + } + + return array( + 'type' => $type, + 'spec_in_brackets' => $spec_in_brackets, + 'enum_set_values' => $enum_set_values, + 'print_type' => $printtype, + 'binary' => $binary, + 'unsigned' => $unsigned, + 'zerofill' => $zerofill, + 'attribute' => $attribute, + 'can_contain_collation' => $can_contain_collation, + 'displayed_type' => $displayed_type + ); + } + + /** + * Verifies if this table's engine supports foreign keys + * + * @param string $engine engine + * + * @return boolean + */ + public static function isForeignKeySupported($engine) + { + $engine = strtoupper($engine); + if (($engine == 'INNODB') || ($engine == 'PBXT')) { + return true; + } elseif ($engine == 'NDBCLUSTER' || $engine == 'NDB') { + $ndbver = strtolower( + $GLOBALS['dbi']->fetchValue("SELECT @@ndb_version_string") + ); + if (substr($ndbver, 0, 4) == 'ndb-') { + $ndbver = substr($ndbver, 4); + } + return version_compare($ndbver, 7.3, '>='); + } + + return false; + } + + /** + * Is Foreign key check enabled? + * + * @return bool + */ + public static function isForeignKeyCheck() + { + if ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'enable') { + return true; + } elseif ($GLOBALS['cfg']['DefaultForeignKeyChecks'] === 'disable') { + return false; + } + return ($GLOBALS['dbi']->getVariable('FOREIGN_KEY_CHECKS') == 'ON'); + } + + /** + * Get HTML for Foreign key check checkbox + * + * @return string HTML for checkbox + */ + public static function getFKCheckbox() + { + return Template::get('fk_checkbox')->render([ + 'checked' => self::isForeignKeyCheck(), + ]); + } + + /** + * Handle foreign key check request + * + * @return bool Default foreign key checks value + */ + public static function handleDisableFKCheckInit() + { + $default_fk_check_value + = $GLOBALS['dbi']->getVariable('FOREIGN_KEY_CHECKS') == 'ON'; + if (isset($_REQUEST['fk_checks'])) { + if (empty($_REQUEST['fk_checks'])) { + // Disable foreign key checks + $GLOBALS['dbi']->setVariable('FOREIGN_KEY_CHECKS', 'OFF'); + } else { + // Enable foreign key checks + $GLOBALS['dbi']->setVariable('FOREIGN_KEY_CHECKS', 'ON'); + } + } // else do nothing, go with default + return $default_fk_check_value; + } + + /** + * Cleanup changes done for foreign key check + * + * @param bool $default_fk_check_value original value for 'FOREIGN_KEY_CHECKS' + * + * @return void + */ + public static function handleDisableFKCheckCleanup($default_fk_check_value) + { + $GLOBALS['dbi']->setVariable( + 'FOREIGN_KEY_CHECKS', $default_fk_check_value ? 'ON' : 'OFF' + ); + } + + /** + * Converts GIS data to Well Known Text format + * + * @param string $data GIS data + * @param bool $includeSRID Add SRID to the WKT + * + * @return string GIS data in Well Know Text format + */ + public static function asWKT($data, $includeSRID = false) + { + // Convert to WKT format + $hex = bin2hex($data); + $spatialAsText = 'ASTEXT'; + $spatialSrid = 'SRID'; + if ($GLOBALS['dbi']->getVersion() >= 50600) { + $spatialAsText = 'ST_ASTEXT'; + $spatialSrid = 'ST_SRID'; + } + $wktsql = "SELECT $spatialAsText(x'" . $hex . "')"; + if ($includeSRID) { + $wktsql .= ", $spatialSrid(x'" . $hex . "')"; + } + + $wktresult = $GLOBALS['dbi']->tryQuery( + $wktsql + ); + $wktarr = $GLOBALS['dbi']->fetchRow($wktresult, 0); + $wktval = isset($wktarr[0]) ? $wktarr[0] : null; + + if ($includeSRID) { + $srid = isset($wktarr[1]) ? $wktarr[1] : null; + $wktval = "'" . $wktval . "'," . $srid; + } + @$GLOBALS['dbi']->freeResult($wktresult); + + return $wktval; + } + + /** + * If the string starts with a \r\n pair (0x0d0a) add an extra \n + * + * @param string $string string + * + * @return string with the chars replaced + */ + public static function duplicateFirstNewline($string) + { + $first_occurence = mb_strpos($string, "\r\n"); + if ($first_occurence === 0) { + $string = "\n" . $string; + } + return $string; + } + + /** + * Get the action word corresponding to a script name + * in order to display it as a title in navigation panel + * + * @param string $target a valid value for $cfg['NavigationTreeDefaultTabTable'], + * $cfg['NavigationTreeDefaultTabTable2'], + * $cfg['DefaultTabTable'] or $cfg['DefaultTabDatabase'] + * + * @return string Title for the $cfg value + */ + public static function getTitleForTarget($target) + { + $mapping = array( + 'structure' => __('Structure'), + 'sql' => __('SQL'), + 'search' =>__('Search'), + 'insert' =>__('Insert'), + 'browse' => __('Browse'), + 'operations' => __('Operations'), + + // For backward compatiblity + + // Values for $cfg['DefaultTabTable'] + 'tbl_structure.php' => __('Structure'), + 'tbl_sql.php' => __('SQL'), + 'tbl_select.php' =>__('Search'), + 'tbl_change.php' =>__('Insert'), + 'sql.php' => __('Browse'), + // Values for $cfg['DefaultTabDatabase'] + 'db_structure.php' => __('Structure'), + 'db_sql.php' => __('SQL'), + 'db_search.php' => __('Search'), + 'db_operations.php' => __('Operations'), + ); + return isset($mapping[$target]) ? $mapping[$target] : false; + } + + /** + * Get the script name corresponding to a plain English config word + * in order to append in links on navigation and main panel + * + * @param string $target a valid value for + * $cfg['NavigationTreeDefaultTabTable'], + * $cfg['NavigationTreeDefaultTabTable2'], + * $cfg['DefaultTabTable'], $cfg['DefaultTabDatabase'] or + * $cfg['DefaultTabServer'] + * @param string $location one out of 'server', 'table', 'database' + * + * @return string script name corresponding to the config word + */ + public static function getScriptNameForOption($target, $location) + { + if ($location == 'server') { + // Values for $cfg['DefaultTabServer'] + switch ($target) { + case 'welcome': + return 'index.php'; + case 'databases': + return 'server_databases.php'; + case 'status': + return 'server_status.php'; + case 'variables': + return 'server_variables.php'; + case 'privileges': + return 'server_privileges.php'; + } + } elseif ($location == 'database') { + // Values for $cfg['DefaultTabDatabase'] + switch ($target) { + case 'structure': + return 'db_structure.php'; + case 'sql': + return 'db_sql.php'; + case 'search': + return 'db_search.php'; + case 'operations': + return 'db_operations.php'; + } + } elseif ($location == 'table') { + // Values for $cfg['DefaultTabTable'], + // $cfg['NavigationTreeDefaultTabTable'] and + // $cfg['NavigationTreeDefaultTabTable2'] + switch ($target) { + case 'structure': + return 'tbl_structure.php'; + case 'sql': + return 'tbl_sql.php'; + case 'search': + return 'tbl_select.php'; + case 'insert': + return 'tbl_change.php'; + case 'browse': + return 'sql.php'; + } + } + + return $target; + } + + /** + * Formats user string, expanding @VARIABLES@, accepting strftime format + * string. + * + * @param string $string Text where to do expansion. + * @param array|string $escape Function to call for escaping variable values. + * Can also be an array of: + * - the escape method name + * - the class that contains the method + * - location of the class (for inclusion) + * @param array $updates Array with overrides for default parameters + * (obtained from GLOBALS). + * + * @return string + */ + public static function expandUserString( + $string, $escape = null, array $updates = array() + ) { + /* Content */ + $vars = array(); + $vars['http_host'] = Core::getenv('HTTP_HOST'); + $vars['server_name'] = $GLOBALS['cfg']['Server']['host']; + $vars['server_verbose'] = $GLOBALS['cfg']['Server']['verbose']; + + if (empty($GLOBALS['cfg']['Server']['verbose'])) { + $vars['server_verbose_or_name'] = $GLOBALS['cfg']['Server']['host']; + } else { + $vars['server_verbose_or_name'] = $GLOBALS['cfg']['Server']['verbose']; + } + + $vars['database'] = $GLOBALS['db']; + $vars['table'] = $GLOBALS['table']; + $vars['phpmyadmin_version'] = 'phpMyAdmin ' . PMA_VERSION; + + /* Update forced variables */ + foreach ($updates as $key => $val) { + $vars[$key] = $val; + } + + /* Replacement mapping */ + /* + * The __VAR__ ones are for backward compatibility, because user + * might still have it in cookies. + */ + $replace = array( + '@HTTP_HOST@' => $vars['http_host'], + '@SERVER@' => $vars['server_name'], + '__SERVER__' => $vars['server_name'], + '@VERBOSE@' => $vars['server_verbose'], + '@VSERVER@' => $vars['server_verbose_or_name'], + '@DATABASE@' => $vars['database'], + '__DB__' => $vars['database'], + '@TABLE@' => $vars['table'], + '__TABLE__' => $vars['table'], + '@PHPMYADMIN@' => $vars['phpmyadmin_version'], + ); + + /* Optional escaping */ + if (! is_null($escape)) { + if (is_array($escape)) { + $escape_class = new $escape[1]; + $escape_method = $escape[0]; + } + foreach ($replace as $key => $val) { + if (is_array($escape)) { + $replace[$key] = $escape_class->$escape_method($val); + } else { + $replace[$key] = ($escape == 'backquote') + ? self::$escape($val) + : $escape($val); + } + } + } + + /* Backward compatibility in 3.5.x */ + if (mb_strpos($string, '@FIELDS@') !== false) { + $string = strtr($string, array('@FIELDS@' => '@COLUMNS@')); + } + + /* Fetch columns list if required */ + if (mb_strpos($string, '@COLUMNS@') !== false) { + $columns_list = $GLOBALS['dbi']->getColumns( + $GLOBALS['db'], $GLOBALS['table'] + ); + + // sometimes the table no longer exists at this point + if (! is_null($columns_list)) { + $column_names = array(); + foreach ($columns_list as $column) { + if (! is_null($escape)) { + $column_names[] = self::$escape($column['Field']); + } else { + $column_names[] = $column['Field']; + } + } + $replace['@COLUMNS@'] = implode(',', $column_names); + } else { + $replace['@COLUMNS@'] = '*'; + } + } + + /* Do the replacement */ + return strtr(strftime($string), $replace); + } + + /** + * Prepare the form used to browse anywhere on the local server for a file to + * import + * + * @param string $max_upload_size maximum upload size + * + * @return String + */ + public static function getBrowseUploadFileBlock($max_upload_size) + { + $block_html = ''; + + if ($GLOBALS['is_upload'] && ! empty($GLOBALS['cfg']['UploadDir'])) { + $block_html .= '
    {% endif %} + {% endfor %} + +
    + +
    + +
    + {% apply spaceless %} + + {% endapply %} +
    + + +
    + + +
    + +
    {# Slider div #} +
    diff --git a/phpMyAdmin/templates/database/qbe/column_select_cell.twig b/phpMyAdmin/templates/database/qbe/column_select_cell.twig new file mode 100755 index 0000000..071249f --- /dev/null +++ b/phpMyAdmin/templates/database/qbe/column_select_cell.twig @@ -0,0 +1,11 @@ + + + diff --git a/phpMyAdmin/templates/database/qbe/footer_options.twig b/phpMyAdmin/templates/database/qbe/footer_options.twig new file mode 100755 index 0000000..7f43f8d --- /dev/null +++ b/phpMyAdmin/templates/database/qbe/footer_options.twig @@ -0,0 +1,16 @@ +
    + {% if type == 'row' %} + {% trans 'Add/Delete criteria rows' %}: + {% else %} + {% trans 'Add/Delete columns' %}: + {% endif %} + +
    diff --git a/phpMyAdmin/templates/database/qbe/sort_order_select_cell.twig b/phpMyAdmin/templates/database/qbe/sort_order_select_cell.twig new file mode 100755 index 0000000..7a63d77 --- /dev/null +++ b/phpMyAdmin/templates/database/qbe/sort_order_select_cell.twig @@ -0,0 +1,10 @@ + + + diff --git a/phpMyAdmin/templates/database/qbe/sort_select_cell.twig b/phpMyAdmin/templates/database/qbe/sort_select_cell.twig new file mode 100755 index 0000000..4f0989e --- /dev/null +++ b/phpMyAdmin/templates/database/qbe/sort_select_cell.twig @@ -0,0 +1,9 @@ + + + diff --git a/phpMyAdmin/templates/database/search/result_divs.twig b/phpMyAdmin/templates/database/search/result_divs.twig new file mode 100755 index 0000000..9f5f19f --- /dev/null +++ b/phpMyAdmin/templates/database/search/result_divs.twig @@ -0,0 +1,13 @@ +{# These two table-image and table-link elements display the table name in browse search results #} +
    + +
    +{# Div for browsing results #} +
    + {# This browse-results div is used to load the browse and delete results in the db search #} +
    +
    + {# This sqlqueryform div is used to load the delete form in the db search #} +
    +{# Toggle query box link #} + diff --git a/phpMyAdmin/templates/database/search/results.twig b/phpMyAdmin/templates/database/search/results.twig new file mode 100755 index 0000000..efe5529 --- /dev/null +++ b/phpMyAdmin/templates/database/search/results.twig @@ -0,0 +1,62 @@ + + + {% for row in rows %} + + + {% if row.result_count > 0 %} + {% set url_params = { + 'db': db, + 'table': row.table, + 'goto': 'db_sql.php', + 'pos': 0, + 'is_js_confirmed': 0 + } %} + + + {% else %} + + + {% endif %} + + {% endfor %} +
    + {{ 'Search results for "%s" %s:'|format( + criteria_search_string, + search_type_description + )|raw }} +
    + {% set result_message %} + {% trans %} + %1$s match in %2$s + {% plural row.result_count %} + %1$s matches in %2$s + {% endtrans %} + {% endset %} + {{ result_message|format(row.result_count, row.table)|raw }} + + + {% trans 'Browse' %} + + + + {% trans 'Delete' %} + +
    + +{% if criteria_tables|length > 1 %} +

    + {% trans %} + Total: {{ count }} match + {% plural result_total %} + Total: {{ count }} matches + {% endtrans %} +

    +{% endif %} diff --git a/phpMyAdmin/templates/database/search/selection_form.twig b/phpMyAdmin/templates/database/search/selection_form.twig new file mode 100755 index 0000000..2a7ed8b --- /dev/null +++ b/phpMyAdmin/templates/database/search/selection_form.twig @@ -0,0 +1,63 @@ + +
    + {{ Url_getHiddenInputs(db) }} +
    + {% trans 'Search in database' %} +

    + + +

    + +
    + {% trans 'Find:' %} + {# 4th parameter set to true to add line breaks #} + {# 5th parameter set to false to avoid htmlspecialchars() escaping + in the label since we have some HTML in some labels #} + {{ Util_getRadioFields( + 'criteriaSearchType', + choices, + criteria_search_type, + true, + false + ) }} +
    + +
    + {% trans 'Inside tables:' %} +

    + + {% trans 'Select all' %} + / + + {% trans 'Unselect all' %} + +

    + +
    + +

    + {# Inputbox for column name entry #} + + +

    +
    +
    + +
    +
    +
    + +
    diff --git a/phpMyAdmin/templates/database/structure/body_for_table_summary.twig b/phpMyAdmin/templates/database/structure/body_for_table_summary.twig new file mode 100755 index 0000000..a06dc9e --- /dev/null +++ b/phpMyAdmin/templates/database/structure/body_for_table_summary.twig @@ -0,0 +1,95 @@ + + + + + {% set num_tables_trans -%} + {% trans %}%s table{% plural num_tables %}%s tables{% endtrans %} + {%- endset %} + {{ num_tables_trans|format(Util_formatNumber(num_tables, 0)) }} + + {% if server_slave_status %} + {% trans 'Replication' %} + {% endif %} + {% set sum_colspan = db_is_system_schema ? 4 : 7 %} + {% if num_favorite_tables == 0 %} + {% set sum_colspan = sum_colspan - 1 %} + {% endif %} + {% trans 'Sum' %} + {% set row_count_sum = Util_formatNumber(sum_entries, 0) %} + {# If a table shows approximate rows count, display update-all-real-count anchor. #} + {% set row_sum_url = [] %} + {% if approx_rows is defined %} + {% set row_sum_url = { + 'ajax_request': true, + 'db': db, + 'real_row_count': 'true', + 'real_row_count_all': 'true' + } %} + {% endif %} + {% if approx_rows %} + {% set cell_text -%} + ~ + {{- row_count_sum -}} + + {%- endset %} + {% else %} + {% set cell_text = row_count_sum %} + {% endif %} + {{ cell_text }} + {% if not (properties_num_columns > 1) %} + {# MySQL <= 5.5.2 #} + {% set default_engine = dbi.fetchValue('SELECT @@storage_engine;') %} + {% if default_engine is empty %} + {# MySQL >= 5.5.3 #} + {% set default_engine = dbi.fetchValue('SELECT @@default_storage_engine;') %} + {% endif %} + + + {{ default_engine }} + + + + {% if db_collation is not empty %} + + {{ db_collation }} + + {% endif %} + + {% endif %} + + {% if is_show_stats %} + {% set sum = Util_formatByteDown(sum_size, 3, 1) %} + {% set sum_formatted = sum[0] %} + {% set sum_unit = sum[1] %} + {{ sum_formatted }} {{ sum_unit }} + + {% set overhead = Util_formatByteDown(overhead_size, 3, 1) %} + {% set overhead_formatted = overhead[0] %} + {% set overhead_unit = overhead[1] %} + {{ overhead_formatted }} {{ overhead_unit }} + {% endif %} + + {% if show_charset %} + {{ db_charset }} + {% endif %} + {% if show_comment %} + + {% endif %} + {% if show_creation %} + + {{ create_time_all ? Util_localisedDate(strtotime(create_time_all)) : '-' }} + + {% endif %} + {% if show_last_update %} + + {{ update_time_all ? Util_localisedDate(strtotime(update_time_all)) : '-' }} + + {% endif %} + {% if show_last_check %} + + {{ check_time_all ? Util_localisedDate(strtotime(check_time_all)) : '-' }} + + {% endif %} + + diff --git a/phpMyAdmin/templates/database/structure/browse_table.twig b/phpMyAdmin/templates/database/structure/browse_table.twig new file mode 100755 index 0000000..826a599 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/browse_table.twig @@ -0,0 +1,3 @@ + + {{ title|raw }} + diff --git a/phpMyAdmin/templates/database/structure/browse_table_label.twig b/phpMyAdmin/templates/database/structure/browse_table_label.twig new file mode 100755 index 0000000..5cb8617 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/browse_table_label.twig @@ -0,0 +1,3 @@ + + {{ truename }} + diff --git a/phpMyAdmin/templates/database/structure/check_all_tables.twig b/phpMyAdmin/templates/database/structure/check_all_tables.twig new file mode 100755 index 0000000..25323f9 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/check_all_tables.twig @@ -0,0 +1,40 @@ + diff --git a/phpMyAdmin/templates/database/structure/empty_table.twig b/phpMyAdmin/templates/database/structure/empty_table.twig new file mode 100755 index 0000000..753556b --- /dev/null +++ b/phpMyAdmin/templates/database/structure/empty_table.twig @@ -0,0 +1,4 @@ + + {{ title|raw }} + diff --git a/phpMyAdmin/templates/database/structure/favorite_anchor.twig b/phpMyAdmin/templates/database/structure/favorite_anchor.twig new file mode 100755 index 0000000..34a97b3 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/favorite_anchor.twig @@ -0,0 +1,7 @@ + + {{ already_favorite ? titles['Favorite']|raw : titles['NoFavorite']|raw }} + diff --git a/phpMyAdmin/templates/database/structure/print_view_data_dictionary_link.twig b/phpMyAdmin/templates/database/structure/print_view_data_dictionary_link.twig new file mode 100755 index 0000000..81d5203 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/print_view_data_dictionary_link.twig @@ -0,0 +1,8 @@ + diff --git a/phpMyAdmin/templates/database/structure/search_table.twig b/phpMyAdmin/templates/database/structure/search_table.twig new file mode 100755 index 0000000..0bc2892 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/search_table.twig @@ -0,0 +1,3 @@ + + {{ title|raw }} + diff --git a/phpMyAdmin/templates/database/structure/show_create.twig b/phpMyAdmin/templates/database/structure/show_create.twig new file mode 100755 index 0000000..520e974 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/show_create.twig @@ -0,0 +1,31 @@ +
    +

    {% trans 'Showing create queries' %}

    + {% set views = [] %} + {% set tables = [] %} + {% for object in db_objects %} + {% if dbi.getTable(db, object).isView() %} + {% set views = views|merge([object]) %} + {% else %} + {% set tables = tables|merge([object]) %} + {% endif %} + {% endfor %} + {% if tables is not empty %} + {% include 'database/structure/show_create_row.twig' with { + 'db': db, + 'title': 'Tables'|trans, + 'raw_title': 'Table', + 'db_objects': tables, + 'dbi': dbi + } only %} + {% endif %} + + {% if views is not empty %} + {% include 'database/structure/show_create_row.twig' with { + 'db': db, + 'title': 'Views'|trans, + 'raw_title': 'View', + 'db_objects': views, + 'dbi': dbi + } only %} + {% endif %} +
    diff --git a/phpMyAdmin/templates/database/structure/show_create_row.twig b/phpMyAdmin/templates/database/structure/show_create_row.twig new file mode 100755 index 0000000..b0ce900 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/show_create_row.twig @@ -0,0 +1,19 @@ +
    + {{ title }} + + + + + + + + + {% for object in db_objects %} + + + + + {% endfor %} + +
    {{ raw_title }}{{ 'Create %s'|trans|format(raw_title) }}
    {{ Core_mimeDefaultFunction(object) }}{{ Core_mimeDefaultFunction(dbi.getTable(db, object).showCreate()) }}
    +
    diff --git a/phpMyAdmin/templates/database/structure/structure_table_row.twig b/phpMyAdmin/templates/database/structure/structure_table_row.twig new file mode 100755 index 0000000..0926eb7 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/structure_table_row.twig @@ -0,0 +1,225 @@ + + + + + + {{ browse_table_label|raw }} + {{ tracking_icon|raw }} + + {% if server_slave_status %} + + {{ ignored ? Util_getImage('s_cancel', 'Not replicated'|trans) }} + {{ do ? Util_getImage('s_success', 'Replicated'|trans) }} + + {% endif %} + + {# Favorite table anchor #} + {% if num_favorite_tables > 0 %} + + {# Check if current table is already in favorite list #} + {% set fav_params = { + 'db': db, + 'ajax_request': true, + 'favorite_table': current_table['TABLE_NAME'], + ((already_favorite ? 'remove' : 'add') ~ '_favorite'): true + } %} + {% include 'database/structure/favorite_anchor.twig' with { + 'table_name_hash': md5(current_table['TABLE_NAME']), + 'db_table_name_hash': md5(db ~ '.' ~ current_table['TABLE_NAME']), + 'fav_params': fav_params, + 'already_favorite': already_favorite, + 'titles': titles + } only %} + + {% endif %} + + + {{ browse_table|raw }} + + + + {{ titles['Structure']|raw }} + + + + {{ search_table|raw }} + + + {% if not db_is_system_schema %} + + {{ titles['Insert']|raw }} + + {{ empty_table|raw }} + + + {{ titles['Drop']|raw }} + + + {% endif %} + + {% if current_table['TABLE_ROWS'] is defined + and (current_table['ENGINE'] != null or table_is_view) %} + {# Get the row count #} + {% set row_count = Util_formatNumber(current_table['TABLE_ROWS'], 0) %} + + {# Content to be appended into 'tbl_rows' cell. + If row count is approximate, display it as an anchor to get real count. #} + + {% if approx_rows %} + + + ~{{ row_count }} + + + {% else %} + {{ row_count }} + {% endif %} + {{ show_superscript|raw }} + + + {% if not (properties_num_columns > 1) %} + + {% if current_table['ENGINE'] is not empty %} + {{ current_table['ENGINE'] }} + {% elseif table_is_view %} + {% trans 'View' %} + {% endif %} + + {% if collation|length > 0 %} + + {{ collation|raw }} + + {% endif %} + {% endif %} + + {% if is_show_stats %} + + + {{ formatted_size }} + {{ unit }} + + + + {{ overhead|raw }} + + {% endif %} + + {% if not (show_charset > 1) %} + {% if charset|length > 0 %} + + {{ charset|raw }} + + {% endif %} + {% endif %} + + {% if show_comment %} + {% set comment = current_table['Comment'] %} + + {% if comment|length > limit_chars %} + + {{ comment|slice(0, limit_chars) }} + ... + + {% else %} + {{ comment }} + {% endif %} + + {% endif %} + + {% if show_creation %} + + {{ create_time ? Util_localisedDate(strtotime(create_time)) : '-' }} + + {% endif %} + + {% if show_last_update %} + + {{ update_time ? Util_localisedDate(strtotime(update_time)) : '-'}} + + {% endif %} + + {% if show_last_check %} + + {{ check_time ? Util_localisedDate(strtotime(check_time)) : '-' }} + + {% endif %} + + {% elseif table_is_view %} + - + + {% trans 'View' %} + + --- + {% if is_show_stats %} + - + - + {% endif %} + {% if show_charset %} + + {% endif %} + {% if show_comment %} + + {% endif %} + {% if show_creation %} + - + {% endif %} + {% if show_last_update %} + - + {% endif %} + {% if show_last_check %} + - + {% endif %} + + {% else %} + {% set count = 0 %} + {% if properties_num_columns %} + {% set count = count + 2 %} + {% endif %} + {% if is_show_stats %} + {% set count = count + 2 %} + {% endif %} + {% if show_charset %} + {% set count = count + 1 %} + {% endif %} + {% if show_comment %} + {% set count = count + 1 %} + {% endif %} + {% if show_creation %} + {% set count = count + 1 %} + {% endif %} + {% if show_last_update %} + {% set count = count + 1 %} + {% endif %} + {% if show_last_check %} + {% set count = count + 1 %} + {% endif %} + + {% if db_is_system_schema %} + {% set action_colspan = 3 %} + {% else %} + {% set action_colspan = 6 %} + {% endif %} + {% if num_favorite_tables > 0 %} + {% set action_colspan = action_colspan + 1 %} + {% endif %} + + {% set colspan_for_structure = action_colspan + 3 %} + + {% trans 'in use' %} + + {% endif %} + diff --git a/phpMyAdmin/templates/database/structure/table_header.twig b/phpMyAdmin/templates/database/structure/table_header.twig new file mode 100755 index 0000000..19818a9 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/table_header.twig @@ -0,0 +1,80 @@ +
    +{{ Url_getHiddenInputs(db) }} +
    + + + + + + {% if replication %} + + {% endif %} + + {% if db_is_system_schema %} + {% set action_colspan = 3 %} + {% else %} + {% set action_colspan = 6 %} + {% endif %} + {% if num_favorite_tables > 0 %} + {% set action_colspan = action_colspan + 1 %} + {% endif %} + + {# larger values are more interesting so default sort order is DESC #} + + {% if not (properties_num_columns > 1) %} + + + {% endif %} + + {% if is_show_stats %} + {# larger values are more interesting so default sort order is DESC #} + + {# larger values are more interesting so default sort order is DESC #} + + {% endif %} + + {% if show_charset %} + + {% endif %} + + {% if show_comment %} + + {% endif %} + + {% if show_creation %} + {# newer values are more interesting so default sort order is DESC #} + + {% endif %} + + {% if show_last_update %} + {# newer values are more interesting so default sort order is DESC #} + + {% endif %} + + {% if show_last_check %} + {# newer values are more interesting so default sort order is DESC #} + + {% endif %} + + + + {% for structure_table_row in structure_table_rows %} + {% include 'database/structure/structure_table_row.twig' with structure_table_row only %} + {% endfor %} + + {% if body_for_table_summary %} + {% include 'database/structure/body_for_table_summary.twig' with body_for_table_summary only %} + {% endif %} +
    {{ Util_sortableTableHeader('Table'|trans, 'table') }}{% trans 'Replication' %} + {% trans 'Action' %} + + {{ Util_sortableTableHeader('Rows'|trans, 'records', 'DESC') }} + {{ Util_showHint(Sanitize_sanitize( + 'May be approximate. Click on the number to get the exact count. See [doc@faq3-11]FAQ 3.11[/doc].'|trans + )) }} + {{ Util_sortableTableHeader('Type'|trans, 'type') }}{{ Util_sortableTableHeader('Collation'|trans, 'collation') }}{{ Util_sortableTableHeader('Size'|trans, 'size', 'DESC') }}{{ Util_sortableTableHeader('Overhead'|trans, 'overhead', 'DESC') }}{{ Util_sortableTableHeader('Charset'|trans, 'charset') }}{{ Util_sortableTableHeader('Comment'|trans, 'comment') }}{{ Util_sortableTableHeader('Creation'|trans, 'creation', 'DESC') }}{{ Util_sortableTableHeader('Last update'|trans, 'last_update', 'DESC') }}{{ Util_sortableTableHeader('Last check'|trans, 'last_check', 'DESC') }}
    +
    +{% if check_all_tables %} + {% include 'database/structure/check_all_tables.twig' with check_all_tables only %} +{% endif %} +
    diff --git a/phpMyAdmin/templates/database/structure/tracking_icon.twig b/phpMyAdmin/templates/database/structure/tracking_icon.twig new file mode 100755 index 0000000..ca7e894 --- /dev/null +++ b/phpMyAdmin/templates/database/structure/tracking_icon.twig @@ -0,0 +1,7 @@ + + {% if is_tracked -%} + {{ Util_getImage('eye', 'Tracking is active.'|trans) }} + {%- else -%} + {{ Util_getImage('eye_grey', 'Tracking is not active.'|trans) }} + {%- endif %} + diff --git a/phpMyAdmin/templates/database/tracking/tracked_tables.twig b/phpMyAdmin/templates/database/tracking/tracked_tables.twig new file mode 100755 index 0000000..f5761e2 --- /dev/null +++ b/phpMyAdmin/templates/database/tracking/tracked_tables.twig @@ -0,0 +1,107 @@ +
    +

    {% trans 'Tracked tables' %}

    + +
    + {{ Url_getHiddenInputs(db) }} + + + + + + + + + + + + + + + {% for version in versions %} + + + + + + + + + + + {% endfor %} + +
    {% trans 'Table' %}{% trans 'Last version' %}{% trans 'Created' %}{% trans 'Updated' %}{% trans 'Status' %}{% trans 'Action' %}{% trans 'Show' %}
    + + + + + {{ version.version }} + + {{ version.date_created }} + + {{ version.date_updated }} + + {{ version.status_button|raw }} + + + {{ Util_getIcon('b_drop', 'Delete tracking'|trans) }} + + + + {{ Util_getIcon('b_versions', 'Versions'|trans) }} + + + {{ Util_getIcon('b_report', 'Tracking report'|trans) }} + + + {{ Util_getIcon('b_props', 'Structure snapshot'|trans) }} + +
    + {% include 'select_all.twig' with { + 'pma_theme_image': pma_theme_image, + 'text_dir': text_dir, + 'form_name': 'trackedForm' + } only %} + {{ Util_getButtonOrImage( + 'submit_mult', + 'mult_submit', + 'Delete tracking'|trans, + 'b_drop', + 'delete_tracking' + ) }} +
    +
    diff --git a/phpMyAdmin/templates/database/tracking/untracked_tables.twig b/phpMyAdmin/templates/database/tracking/untracked_tables.twig new file mode 100755 index 0000000..c621b39 --- /dev/null +++ b/phpMyAdmin/templates/database/tracking/untracked_tables.twig @@ -0,0 +1,49 @@ +

    {% trans 'Untracked tables' %}

    +
    + {{ Url_getHiddenInputs(db) }} + + + + + + + + + + {% for table_name in untracked_tables %} + {% if Tracker_getVersion(db, table_name) == -1 %} + + + + + + {% endif %} + {% endfor %} + +
    {% trans 'Table' %}{% trans 'Action' %}
    + + + + + + {{ Util_getIcon('eye', 'Track table'|trans) }} + +
    + {% include 'select_all.twig' with { + 'pma_theme_image': pma_theme_image, + 'text_dir': text_dir, + 'form_name': 'untrackedForm' + } only %} + {{ Util_getButtonOrImage( + 'submit_mult', + 'mult_submit', + 'Track table'|trans, + 'eye', + 'track' + ) }} +
    diff --git a/phpMyAdmin/templates/display/export/format_dropdown.twig b/phpMyAdmin/templates/display/export/format_dropdown.twig new file mode 100755 index 0000000..adda19b --- /dev/null +++ b/phpMyAdmin/templates/display/export/format_dropdown.twig @@ -0,0 +1,4 @@ +
    +

    {% trans 'Format:' %}

    + {{ dropdown|raw }} +
    diff --git a/phpMyAdmin/templates/display/export/hidden_inputs.twig b/phpMyAdmin/templates/display/export/hidden_inputs.twig new file mode 100755 index 0000000..fa01a18 --- /dev/null +++ b/phpMyAdmin/templates/display/export/hidden_inputs.twig @@ -0,0 +1,23 @@ +{% if export_type == 'server' %} + {{ Url_getHiddenInputs('', '', 1) }} +{% elseif export_type == 'database' %} + {{ Url_getHiddenInputs(db, '', 1) }} +{% else %} + {{ Url_getHiddenInputs(db, table, 1) }} +{% endif %} + +{# Just to keep this value for possible next display of this form after saving on server #} +{% if single_table is not empty %} + +{% endif %} + + + +{# The export method (quick, custom or custom-no-form) #} + + +{% if sql_query is not empty %} + +{% endif %} + + diff --git a/phpMyAdmin/templates/display/export/method.twig b/phpMyAdmin/templates/display/export/method.twig new file mode 100755 index 0000000..5521f57 --- /dev/null +++ b/phpMyAdmin/templates/display/export/method.twig @@ -0,0 +1,22 @@ +{% if export_method != 'custom-no-form' %} +
    +

    {% trans 'Export method:' %}

    +
      +
    • + + +
    • + +
    • + + +
    • +
    +
    +{% endif %} diff --git a/phpMyAdmin/templates/display/export/option_header.twig b/phpMyAdmin/templates/display/export/option_header.twig new file mode 100755 index 0000000..074586a --- /dev/null +++ b/phpMyAdmin/templates/display/export/option_header.twig @@ -0,0 +1,12 @@ + diff --git a/phpMyAdmin/templates/display/export/options_format.twig b/phpMyAdmin/templates/display/export/options_format.twig new file mode 100755 index 0000000..7cfbe13 --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_format.twig @@ -0,0 +1,24 @@ +
    +

    {% trans 'Format-specific options:' %}

    +

    + {% trans 'Scroll down to fill in the options for the selected format and ignore the options for other formats.' %} +

    + {{ options|raw }} +
    + +{% if can_convert_kanji %} + {# Japanese encoding setting #} +
    +

    {% trans 'Encoding Conversion:' %}

    + {% include 'encoding/kanji_encoding_form.twig' %} +
    +{% endif %} + +
    + 0 %} + onclick="check_time_out({{ exec_time_limit }})" + {%- endif %}> +
    diff --git a/phpMyAdmin/templates/display/export/options_output.twig b/phpMyAdmin/templates/display/export/options_output.twig new file mode 100755 index 0000000..60d721c --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_output.twig @@ -0,0 +1,54 @@ +
    +

    {% trans 'Output:' %}

    +
      +
    • + + +
    • + + {% if export_type != 'server' %} +
    • + + +
    • + {% endif %} + +
    • + + +
        + {% if save_dir is not empty %} + {{ options_output_save_dir|raw }} + {% endif %} + + {{ options_output_format|raw }} + + {% if is_encoding_supported %} + {{ options_output_charset|raw }} + {% endif %} + + {{ options_output_compression|raw }} + + {% if export_type == 'server' or export_type == 'database' %} + {{ options_output_separate_files|raw }} + {% endif %} +
      +
    • + + {{ options_output_radio|raw }} +
    + + ' + )|raw }} +
    diff --git a/phpMyAdmin/templates/display/export/options_output_charset.twig b/phpMyAdmin/templates/display/export/options_output_charset.twig new file mode 100755 index 0000000..bd316bf --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_output_charset.twig @@ -0,0 +1,16 @@ +
  • + + +
  • diff --git a/phpMyAdmin/templates/display/export/options_output_compression.twig b/phpMyAdmin/templates/display/export/options_output_compression.twig new file mode 100755 index 0000000..1905981 --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_output_compression.twig @@ -0,0 +1,24 @@ +{% if is_zip or is_gzip %} +
  • + + +
  • +{% else %} + +{% endif %} diff --git a/phpMyAdmin/templates/display/export/options_output_format.twig b/phpMyAdmin/templates/display/export/options_output_format.twig new file mode 100755 index 0000000..0039d87 --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_output_format.twig @@ -0,0 +1,13 @@ +
  • + + + + +
  • diff --git a/phpMyAdmin/templates/display/export/options_output_radio.twig b/phpMyAdmin/templates/display/export/options_output_radio.twig new file mode 100755 index 0000000..7adf21e --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_output_radio.twig @@ -0,0 +1,7 @@ +
  • + + +
  • diff --git a/phpMyAdmin/templates/display/export/options_output_save_dir.twig b/phpMyAdmin/templates/display/export/options_output_save_dir.twig new file mode 100755 index 0000000..b4526aa --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_output_save_dir.twig @@ -0,0 +1,15 @@ +
  • + + +
  • +
  • + + +
  • diff --git a/phpMyAdmin/templates/display/export/options_output_separate_files.twig b/phpMyAdmin/templates/display/export/options_output_separate_files.twig new file mode 100755 index 0000000..fec85c4 --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_output_separate_files.twig @@ -0,0 +1,12 @@ +
  • + + +
  • diff --git a/phpMyAdmin/templates/display/export/options_quick_export.twig b/phpMyAdmin/templates/display/export/options_quick_export.twig new file mode 100755 index 0000000..b3bd159 --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_quick_export.twig @@ -0,0 +1,20 @@ +
    +

    {% trans 'Output:' %}

    +
      +
    • + + +
    • +
    • + + +
    • +
    +
    diff --git a/phpMyAdmin/templates/display/export/options_rows.twig b/phpMyAdmin/templates/display/export/options_rows.twig new file mode 100755 index 0000000..1d4f866 --- /dev/null +++ b/phpMyAdmin/templates/display/export/options_rows.twig @@ -0,0 +1,35 @@ +
    +

    {% trans 'Rows:' %}

    +
      +
    • + + +
        +
      • + + +
      • +
      • + + +
      • +
      +
    • +
    • + + +
    • +
    +
    diff --git a/phpMyAdmin/templates/display/export/select_options.twig b/phpMyAdmin/templates/display/export/select_options.twig new file mode 100755 index 0000000..7b153a3 --- /dev/null +++ b/phpMyAdmin/templates/display/export/select_options.twig @@ -0,0 +1,19 @@ +
    +

    + + {% trans 'Select all' %} + + / + + {% trans 'Unselect all' %} + +

    + + +
    diff --git a/phpMyAdmin/templates/display/export/selection.twig b/phpMyAdmin/templates/display/export/selection.twig new file mode 100755 index 0000000..6f691f5 --- /dev/null +++ b/phpMyAdmin/templates/display/export/selection.twig @@ -0,0 +1,10 @@ +
    + {% if export_type == 'server' %} +

    {% trans 'Databases:' %}

    + {% elseif export_type == 'database' %} +

    {% trans 'Tables:' %}

    + {% endif %} + {% if multi_values is not empty %} + {{ multi_values|raw }} + {% endif %} +
    diff --git a/phpMyAdmin/templates/display/export/template_loading.twig b/phpMyAdmin/templates/display/export/template_loading.twig new file mode 100755 index 0000000..e1f57d8 --- /dev/null +++ b/phpMyAdmin/templates/display/export/template_loading.twig @@ -0,0 +1,27 @@ +
    +

    {% trans 'Export templates:' %}

    + +
    +
    +

    {% trans 'New template:' %}

    + + +
    +
    + +
    +
    +

    {% trans 'Existing templates:' %}

    + + + + +
    +
    + +
    +
    diff --git a/phpMyAdmin/templates/display/export/template_options.twig b/phpMyAdmin/templates/display/export/template_options.twig new file mode 100755 index 0000000..ddcd4f5 --- /dev/null +++ b/phpMyAdmin/templates/display/export/template_options.twig @@ -0,0 +1,7 @@ + + +{% for template in templates %} + +{% endfor %} diff --git a/phpMyAdmin/templates/display/import/import.twig b/phpMyAdmin/templates/display/import/import.twig new file mode 100755 index 0000000..331045a --- /dev/null +++ b/phpMyAdmin/templates/display/import/import.twig @@ -0,0 +1,194 @@ + +
    +
    + ajax clock + + + +
    + + + {% if import_type == 'server' %} + {{ Url_getHiddenInputs('', '', 1) }} + {% elseif import_type == 'database' %} + {{ Url_getHiddenInputs(db, '', 1) }} + {% else %} + {{ Url_getHiddenInputs(db, table, 1) }} + {% endif %} + + + + +
    +

    {% trans 'File to import:' %}

    + + {# We don't have show anything about compression, when no supported #} + {% if compressions is not empty %} +
    +

    + {{ 'File may be compressed (%s) or uncompressed.'|trans|format(compressions|join(', ')) }} +
    + {% trans 'A compressed file\'s name must end in .[format].[compression]. Example: .sql.zip' %} +

    +
    + {% endif %} + +
    + {% if is_upload and upload_dir is not empty %} +
      +
    • + + {{ Util_getBrowseUploadFileBlock(max_upload_size) }} + {% trans 'You may also drag and drop a file on any page.' %} +
    • +
    • + + {{ Util_getSelectUploadFileBlock( + import_list, + upload_dir + ) }} +
    • +
    + {% elseif is_upload %} + {{ Util_getBrowseUploadFileBlock(max_upload_size) }} +

    {% trans 'You may also drag and drop a file on any page.' %}

    + {% elseif not is_upload %} + {{ Message_notice('File uploads are not allowed on this server.'|trans) }} + {% elseif upload_dir is not empty %} + {{ Util_getSelectUploadFileBlock( + import_list, + upload_dir + ) }} + {% endif %} +
    + +
    + {# Charset of file #} + + {% if is_encoding_supported %} + + {% else %} + {{ Charsets_getCharsetDropdownBox( + dbi, + disable_is, + 'charset_of_file', + 'charset_of_file', + 'utf8', + false + ) }} + {% endif %} +
    +
    + +
    +

    {% trans 'Partial import:' %}

    + + {% if timeout_passed is defined and timeout_passed %} +
    + + {{ 'Previous import timed out, after resubmitting will continue from position %d.'|trans|format(offset) }} +
    + {% endif %} + +
    + + +
    + + {% if not (timeout_passed is defined and timeout_passed) %} +
    + + +
    + {% else %} + {# If timeout has passed, + do not show the Skip dialog to avoid the risk of someone + entering a value here that would interfere with "skip" #} + + {% endif %} +
    + +
    +

    {% trans 'Other options:' %}

    +
    + {{ Util_getFKCheckbox() }} +
    +
    + +
    +

    {% trans 'Format:' %}

    + {{ Plugins_getChoice('Import', 'format', import_list) }} +
    +
    + +
    +

    {% trans 'Format-specific options:' %}

    +

    + {% trans 'Scroll down to fill in the options for the selected format and ignore the options for other formats.' %} +

    + {{ Plugins_getOptions('Import', import_list) }} +
    +
    + + {# Japanese encoding setting #} + {% if can_convert_kanji %} +
    +

    {% trans 'Encoding Conversion:' %}

    + {% include 'encoding/kanji_encoding_form.twig' %} +
    + {% endif %} + +
    + +
    +
    +
    diff --git a/phpMyAdmin/templates/display/import/javascript.twig b/phpMyAdmin/templates/display/import/javascript.twig new file mode 100755 index 0000000..84af1b3 --- /dev/null +++ b/phpMyAdmin/templates/display/import/javascript.twig @@ -0,0 +1,171 @@ +$( function() { + {# Add event when user click on "Go" button #} + $("#buttonGo").bind("click", function() { + {# Hide form #} + $("#upload_form_form").css("display", "none"); + + {% if handler != 'PhpMyAdmin\\Plugins\\Import\\Upload\\UploadNoplugin' %} + {# Some variable for javascript #} + {% set ajax_url = 'import_status.php?id=' ~ upload_id ~ Url_getCommonRaw({ + 'import_status': 1 + }, '&') %} + {% set promot_str = Sanitize_jsFormat( + 'The file being uploaded is probably larger than the maximum allowed size or this is a known bug in webkit based (Safari, Google Chrome, Arora etc.) browsers.'|trans, + false + ) %} + {% set statustext_str = Sanitize_escapeJsString('%s of %s'|trans) %} + {% set second_str = Sanitize_jsFormat('%s/sec.'|trans, false) %} + {% set remaining_min = Sanitize_jsFormat('About %MIN min. %SEC sec. remaining.'|trans, false) %} + {% set remaining_second = Sanitize_jsFormat('About %SEC sec. remaining.'|trans, false) %} + {% set processed_str = Sanitize_jsFormat( + 'The file is being processed, please be patient.'|trans, + false + ) %} + {% set import_url = Url_getCommonRaw({'import_status': 1}, '&') %} + + {% set upload_html %} + {% apply spaceless %} +
    +
    +
    +
    +
    +
    +
    +
    + ajax clock {{ Sanitize_jsFormat('Uploading your import file鈥�'|trans, false) -}} +
    +
    +
    + {% endapply %} + {% endset %} + + {# Start output #} + var finished = false; + var percent = 0.0; + var total = 0; + var complete = 0; + var original_title = parent && parent.document ? parent.document.title : false; + var import_start; + + var perform_upload = function () { + new $.getJSON( + "{{ ajax_url|raw }}", + {}, + function(response) { + finished = response.finished; + percent = response.percent; + total = response.total; + complete = response.complete; + + if (total==0 && complete==0 && percent==0) { + $("#upload_form_status_info").html('ajax clock {{ promot_str|raw }}'); + $("#upload_form_status").css("display", "none"); + } else { + var now = new Date(); + now = Date.UTC( + now.getFullYear(), + now.getMonth(), + now.getDate(), + now.getHours(), + now.getMinutes(), + now.getSeconds()) + + now.getMilliseconds() - 1000; + var statustext = PMA_sprintf( + "{{ statustext_str|raw }}", + formatBytes( + complete, 1, PMA_messages.strDecimalSeparator + ), + formatBytes( + total, 1, PMA_messages.strDecimalSeparator + ) + ); + + if ($("#importmain").is(":visible")) { + {# Show progress UI #} + $("#importmain").hide(); + $("#import_form_status") + .html('{{ upload_html|raw }}') + .show(); + import_start = now; + } + else if (percent > 9 || complete > 2000000) { + {# Calculate estimated time #} + var used_time = now - import_start; + var seconds = parseInt(((total - complete) / complete) * used_time / 1000); + var speed = PMA_sprintf( + "{{ second_str|raw }}", + formatBytes(complete / used_time * 1000, 1, PMA_messages.strDecimalSeparator) + ); + + var minutes = parseInt(seconds / 60); + seconds %= 60; + var estimated_time; + if (minutes > 0) { + estimated_time = "{{ remaining_min|raw }}" + .replace("%MIN", minutes) + .replace("%SEC", seconds); + } + else { + estimated_time = "{{ remaining_second|raw }}" + .replace("%SEC", seconds); + } + + statustext += "
    " + speed + "

    " + estimated_time; + } + + var percent_str = Math.round(percent) + "%"; + $("#status").animate({width: percent_str}, 150); + $(".percentage").text(percent_str); + + {# Show percent in window title #} + if (original_title !== false) { + parent.document.title + = percent_str + " - " + original_title; + } + else { + document.title + = percent_str + " - " + original_title; + } + $("#statustext").html(statustext); + } + + if (finished == true) { + if (original_title !== false) { + parent.document.title = original_title; + } + else { + document.title = original_title; + } + $("#importmain").hide(); + {# Loads the message, either success or mysql error #} + $("#import_form_status") + .html('ajax clock {{ processed_str|raw }}') + .show(); + $("#import_form_status").load("import_status.php?message=true&{{ import_url|raw }}"); + PMA_reloadNavigation(); + + {# If finished #} + } + else { + setTimeout(perform_upload, 1000); + } + }); + }; + setTimeout(perform_upload, 1000); + {% else %} + {# No plugin available #} + {% set image_tag -%} + ajax clock + {{- Sanitize_jsFormat( + 'Please be patient, the file is being uploaded. Details about the upload are not available.'|trans, + false + ) -}} + {{- Util_showDocu('faq', 'faq2-9') -}} + {%- endset %} + $('#upload_form_status_info').html('{{ image_tag|raw }}'); + $("#upload_form_status").css("display", "none"); + {% endif %} + }); +}); diff --git a/phpMyAdmin/templates/display/results/additional_fields.twig b/phpMyAdmin/templates/display/results/additional_fields.twig new file mode 100755 index 0000000..745b3bb --- /dev/null +++ b/phpMyAdmin/templates/display/results/additional_fields.twig @@ -0,0 +1,14 @@ + + +{# Do not change the position when changing the number of rows #} + + +{% trans 'Number of rows:' %} +{{ Util_getDropdown( + 'session_max_rows', + number_of_rows_choices, + max_rows, + '', + 'autosubmit', + number_of_rows_placeholder +) }} diff --git a/phpMyAdmin/templates/display/results/comment_for_row.twig b/phpMyAdmin/templates/display/results/comment_for_row.twig new file mode 100755 index 0000000..5380b71 --- /dev/null +++ b/phpMyAdmin/templates/display/results/comment_for_row.twig @@ -0,0 +1,10 @@ +{% if comments_map[fields_meta.table] is defined + and comments_map[fields_meta.table][fields_meta.name] is defined %} + + {% if comments_map[fields_meta.table][fields_meta.name]|length > limit_chars %} + {{ comments_map[fields_meta.table][fields_meta.name]|slice(0, limit_chars) }}鈥� + {% else %} + {{ comments_map[fields_meta.table][fields_meta.name] }} + {% endif %} + +{% endif %} diff --git a/phpMyAdmin/templates/display/results/empty_display.twig b/phpMyAdmin/templates/display/results/empty_display.twig new file mode 100755 index 0000000..cd43ebc --- /dev/null +++ b/phpMyAdmin/templates/display/results/empty_display.twig @@ -0,0 +1 @@ + diff --git a/phpMyAdmin/templates/display/results/multi_row_operations_form.twig b/phpMyAdmin/templates/display/results/multi_row_operations_form.twig new file mode 100755 index 0000000..bf87c7e --- /dev/null +++ b/phpMyAdmin/templates/display/results/multi_row_operations_form.twig @@ -0,0 +1,12 @@ +{% if delete_link == delete_row or delete_link == kill_process %} +
    + {{ Url_getHiddenInputs(db, table, 1) }} + +{% endif %} + +
    + diff --git a/phpMyAdmin/templates/display/results/null_display.twig b/phpMyAdmin/templates/display/results/null_display.twig new file mode 100755 index 0000000..f2ea2e5 --- /dev/null +++ b/phpMyAdmin/templates/display/results/null_display.twig @@ -0,0 +1,7 @@ + diff --git a/phpMyAdmin/templates/display/results/options_block.twig b/phpMyAdmin/templates/display/results/options_block.twig new file mode 100755 index 0000000..465f9e3 --- /dev/null +++ b/phpMyAdmin/templates/display/results/options_block.twig @@ -0,0 +1,117 @@ + + {{ Url_getHiddenInputs({ + 'db': db, + 'table': table, + 'sql_query': sql_query, + 'goto': goto, + 'display_options_form': 1 + }) }} + + {{ Util_getDivForSliderEffect('', 'Options'|trans) }} +
    +
    + {# pftext means "partial or full texts" (done to reduce line lengths #} + {{ Util_getRadioFields( + 'pftext', + { + 'P': 'Partial texts'|trans, + 'F': 'Full texts'|trans + }, + pftext, + true, + true, + '', + 'pftext_' ~ unique_id + ) }} +
    + + {% if relwork and displaywork %} +
    + {{ Util_getRadioFields( + 'relational_display', + { + 'K': 'Relational key'|trans, + 'D': 'Display column for relationships'|trans + }, + relational_display, + true, + true, + '', + 'relational_display_' ~ unique_id + ) }} +
    + {% endif %} + +
    + {% include 'checkbox.twig' with { + 'html_field_name': 'display_binary', + 'label': 'Show binary contents'|trans, + 'checked': display_binary is not empty, + 'onclick': false, + 'html_field_id': 'display_binary_' ~ unique_id + } only %} + {% include 'checkbox.twig' with { + 'html_field_name': 'display_blob', + 'label': 'Show BLOB contents'|trans, + 'checked': display_blob is not empty, + 'onclick': false, + 'html_field_id': 'display_blob_' ~ unique_id + } only %} +
    + + {# I would have preferred to name this "display_transformation". + This is the only way I found to be able to keep this setting sticky + per SQL query, and at the same time have a default that displays + the transformations. #} +
    + {% include 'checkbox.twig' with { + 'html_field_name': 'hide_transformation', + 'label': 'Hide browser transformation'|trans, + 'checked': hide_transformation is not empty, + 'onclick': false, + 'html_field_id': 'hide_transformation_' ~ unique_id + } only %} +
    + + + {% if possible_as_geometry %} +
    + {{ Util_getRadioFields( + 'geoOption', + { + 'GEOM': 'Geometry'|trans, + 'WKT': 'Well Known Text'|trans, + 'WKB': 'Well Known Binary'|trans + }, + geo_option, + true, + true, + '', + 'geoOption_' ~ unique_id + ) }} +
    + {% else %} +
    + {{ possible_as_geometry }} + {{ Util_getRadioFields( + 'geoOption', + { + 'WKT': 'Well Known Text'|trans, + 'WKB': 'Well Known Binary'|trans + }, + geo_option, + true, + true, + '', + 'geoOption_' ~ unique_id + ) }} +
    + {% endif %} +
    +
    + +
    + +
    + {# slider effect div #} + diff --git a/phpMyAdmin/templates/display/results/show_all_checkbox.twig b/phpMyAdmin/templates/display/results/show_all_checkbox.twig new file mode 100755 index 0000000..b2674d3 --- /dev/null +++ b/phpMyAdmin/templates/display/results/show_all_checkbox.twig @@ -0,0 +1,13 @@ + diff --git a/phpMyAdmin/templates/display/results/table_navigation_button.twig b/phpMyAdmin/templates/display/results/table_navigation_button.twig new file mode 100755 index 0000000..eb4fa42 --- /dev/null +++ b/phpMyAdmin/templates/display/results/table_navigation_button.twig @@ -0,0 +1,12 @@ + diff --git a/phpMyAdmin/templates/display/results/value_display.twig b/phpMyAdmin/templates/display/results/value_display.twig new file mode 100755 index 0000000..35640b9 --- /dev/null +++ b/phpMyAdmin/templates/display/results/value_display.twig @@ -0,0 +1,3 @@ + diff --git a/phpMyAdmin/templates/div_for_slider_effect.twig b/phpMyAdmin/templates/div_for_slider_effect.twig new file mode 100755 index 0000000..6453999 --- /dev/null +++ b/phpMyAdmin/templates/div_for_slider_effect.twig @@ -0,0 +1,16 @@ +{% if initial_sliders_state == 'disabled' %} + +{% else %} + {# + Bad hack on the next line. document.write() conflicts with jQuery, + hence, opening the
    with PHP itself instead of JavaScript. + + @todo find a better solution that uses $.append(), the recommended + method maybe by using an additional param, the id of the div to + append to + #} +
    + NULL + +
    + {{ Url_getHiddenInputs(db, table) }} + + + + + + + +
    +
    +
    + {{ Url_getHiddenInputs(db, table) }} + + + + + {{ input_for_real_end|raw }} + +
    +
    + {{ value|raw }} +
    + + + + + + + + + + + + + + + + + + + + + + + +
    {% trans 'Define new aliases' %}
    + + + + + + + +
    + + + + + + + +
    + + + + + + + +
    diff --git a/phpMyAdmin/templates/export/alias_item.twig b/phpMyAdmin/templates/export/alias_item.twig new file mode 100755 index 0000000..b016861 --- /dev/null +++ b/phpMyAdmin/templates/export/alias_item.twig @@ -0,0 +1,10 @@ + + {{ type }} + {{ name }} + + + + + + + diff --git a/phpMyAdmin/templates/filter.twig b/phpMyAdmin/templates/filter.twig new file mode 100755 index 0000000..572ec46 --- /dev/null +++ b/phpMyAdmin/templates/filter.twig @@ -0,0 +1,8 @@ +
    + {% trans "Filters" %} +
    + + +
    +
    diff --git a/phpMyAdmin/templates/fk_checkbox.twig b/phpMyAdmin/templates/fk_checkbox.twig new file mode 100755 index 0000000..afcc615 --- /dev/null +++ b/phpMyAdmin/templates/fk_checkbox.twig @@ -0,0 +1,4 @@ + + + diff --git a/phpMyAdmin/templates/header_location.twig b/phpMyAdmin/templates/header_location.twig new file mode 100755 index 0000000..113dab3 --- /dev/null +++ b/phpMyAdmin/templates/header_location.twig @@ -0,0 +1,22 @@ +{# Manage HTML redirection #} + + + - - - + + + + + + + + + + diff --git a/phpMyAdmin/templates/javascript/display.twig b/phpMyAdmin/templates/javascript/display.twig new file mode 100755 index 0000000..12027ef --- /dev/null +++ b/phpMyAdmin/templates/javascript/display.twig @@ -0,0 +1,7 @@ + diff --git a/phpMyAdmin/templates/list/item.twig b/phpMyAdmin/templates/list/item.twig new file mode 100755 index 0000000..cfbc772 --- /dev/null +++ b/phpMyAdmin/templates/list/item.twig @@ -0,0 +1,19 @@ + + + {% if url is defined and url is iterable and url['href'] is not empty %} + + {% endif %} + {{ content|raw }} + {% if url is defined and url is iterable and url['href'] is not empty %} + + {% endif %} + {% if mysql_help_page is not empty %} + {{ Util_showMySQLDocu(mysql_help_page) }} + {% endif %} + diff --git a/phpMyAdmin/templates/list/unordered.twig b/phpMyAdmin/templates/list/unordered.twig new file mode 100755 index 0000000..11f114e --- /dev/null +++ b/phpMyAdmin/templates/list/unordered.twig @@ -0,0 +1,14 @@ + + + {% if items is not empty %} + {% for item in items %} + {% if item is not iterable %} + {% set item = {'content': item} %} + {% endif %} + {% include 'list/item.twig' with item only %} + {% endfor %} + {% elseif content is not empty %} + {{ content|raw }} + {% endif %} + diff --git a/phpMyAdmin/templates/login/footer.twig b/phpMyAdmin/templates/login/footer.twig new file mode 100755 index 0000000..04f5b84 --- /dev/null +++ b/phpMyAdmin/templates/login/footer.twig @@ -0,0 +1 @@ +
    diff --git a/phpMyAdmin/templates/login/header.twig b/phpMyAdmin/templates/login/header.twig new file mode 100755 index 0000000..e274ebc --- /dev/null +++ b/phpMyAdmin/templates/login/header.twig @@ -0,0 +1,13 @@ +
    + +

    {{ 'Welcome to %s'|trans|format('phpMyAdmin')|raw }}

    + + + +
    +{{ Message_error("There is mismatch between HTTPS indicated on the server and client. This can lead to non working phpMyAdmin or a security risk. Please fix your server configuration to indicate HTTPS properly."|trans) }} +
    diff --git a/phpMyAdmin/templates/login/twofactor.twig b/phpMyAdmin/templates/login/twofactor.twig new file mode 100755 index 0000000..52ca9c8 --- /dev/null +++ b/phpMyAdmin/templates/login/twofactor.twig @@ -0,0 +1,7 @@ +
    +{{ Url_getHiddenInputs() }} +{{ form|raw }} +{% if show_submit %} + +{% endif %} +
    diff --git a/phpMyAdmin/templates/login/twofactor/application.twig b/phpMyAdmin/templates/login/twofactor/application.twig new file mode 100755 index 0000000..8c0d748 --- /dev/null +++ b/phpMyAdmin/templates/login/twofactor/application.twig @@ -0,0 +1,4 @@ +

    + +

    +

    {% trans "Open the two-factor authentication app on your device to view your authentication code and verify your identity." %}

    diff --git a/phpMyAdmin/templates/login/twofactor/application_configure.twig b/phpMyAdmin/templates/login/twofactor/application_configure.twig new file mode 100755 index 0000000..97b069d --- /dev/null +++ b/phpMyAdmin/templates/login/twofactor/application_configure.twig @@ -0,0 +1,22 @@ +{{ Url_getHiddenInputs() }} +{% if image is defined %} +

    + {% trans "Please scan following QR code into the two-factor authentication app on your device and enter authentication code it generates." %} +

    +

    + +

    +{% else %} +

    + {% trans "Please enter following secret/key into the two-factor authentication app on your device and enter authentication code it generates." %} +

    +

    + {% trans "OTP url:" %} {{ url }} +

    +{% endif %} +

    + {% trans "Secret/key:" %} {{ secret }} +

    +

    + +

    diff --git a/phpMyAdmin/templates/login/twofactor/invalid.twig b/phpMyAdmin/templates/login/twofactor/invalid.twig new file mode 100755 index 0000000..568dd94 --- /dev/null +++ b/phpMyAdmin/templates/login/twofactor/invalid.twig @@ -0,0 +1,3 @@ +
    +{% trans "The configured two factor authentication is not available, please install missing dependencies." %} +
    diff --git a/phpMyAdmin/templates/login/twofactor/key-https-warning.twig b/phpMyAdmin/templates/login/twofactor/key-https-warning.twig new file mode 100755 index 0000000..d3f9c04 --- /dev/null +++ b/phpMyAdmin/templates/login/twofactor/key-https-warning.twig @@ -0,0 +1,5 @@ +{% if not is_https %} +
    +{% trans "You are not using https to access phpMyAdmin, therefore FIDO U2F device will most likely refuse to authenticate you." %} +
    +{% endif %} diff --git a/phpMyAdmin/templates/login/twofactor/key.twig b/phpMyAdmin/templates/login/twofactor/key.twig new file mode 100755 index 0000000..3781aaf --- /dev/null +++ b/phpMyAdmin/templates/login/twofactor/key.twig @@ -0,0 +1,5 @@ +{% include 'login/twofactor/key-https-warning.twig' %} +

    +{% trans "Please connect your FIDO U2F device into your computer's USB port. Then confirm login on the device." %} +

    + diff --git a/phpMyAdmin/templates/login/twofactor/key_configure.twig b/phpMyAdmin/templates/login/twofactor/key_configure.twig new file mode 100755 index 0000000..d89803d --- /dev/null +++ b/phpMyAdmin/templates/login/twofactor/key_configure.twig @@ -0,0 +1,5 @@ +{% include 'login/twofactor/key-https-warning.twig' %} +

    +{% trans "Please connect your FIDO U2F device into your computer's USB port. Then confirm registration on the device." %} +

    + diff --git a/phpMyAdmin/templates/login/twofactor/simple.twig b/phpMyAdmin/templates/login/twofactor/simple.twig new file mode 100755 index 0000000..7fd9824 --- /dev/null +++ b/phpMyAdmin/templates/login/twofactor/simple.twig @@ -0,0 +1 @@ + diff --git a/phpMyAdmin/templates/navigation/logo.twig b/phpMyAdmin/templates/navigation/logo.twig new file mode 100755 index 0000000..d4a01f7 --- /dev/null +++ b/phpMyAdmin/templates/navigation/logo.twig @@ -0,0 +1,12 @@ +{% if display_logo %} + +{% endif %} diff --git a/phpMyAdmin/templates/prefs_autoload.twig b/phpMyAdmin/templates/prefs_autoload.twig new file mode 100755 index 0000000..efe44a9 --- /dev/null +++ b/phpMyAdmin/templates/prefs_autoload.twig @@ -0,0 +1,15 @@ + diff --git a/phpMyAdmin/templates/prefs_twofactor.twig b/phpMyAdmin/templates/prefs_twofactor.twig new file mode 100755 index 0000000..e32ec21 --- /dev/null +++ b/phpMyAdmin/templates/prefs_twofactor.twig @@ -0,0 +1,58 @@ +
    +

    +{% trans "Two-factor authentication status" %} +{{ Util_showDocu('two_factor') }} +

    +
    +{% if enabled %} +{% if num_backends == 0 %} +

    {% trans "Two-factor authentication is not available, please install optional dependencies to enable authentication backends." %}

    +

    {% trans "Following composer packages are missing:" %}

    +
      +{% for item in missing %} +
    • {{ item.dep }} ({{ item.class }})
    • +{% endfor %} +
    +{% else %} +{% if backend_id %} +

    {% trans "Two-factor authentication is available and configured for this account." %}

    +{% else %} +

    {% trans "Two-factor authentication is available, but not configured for this account." %}

    +{% endif %} +{% endif %} +{% else %} +

    {% trans "Two-factor authentication is not available, enable phpMyAdmin configuration storage to use it." %}

    +{% endif %} +
    +
    + +{% if backend_id %} +
    +

    {{ backend_name }}

    +
    +

    {% trans "You have enabled two factor authentication." %}

    +

    {{ backend_description }}

    +
    +{{ Url_getHiddenInputs() }} + +
    +
    +
    +{% elseif num_backends > 0 %} +
    +

    {% trans "Configure two-factor authentication" %}

    +
    +
    +{{ Url_getHiddenInputs() }} +{% for backend in backends %} + +{% endfor %} + +
    +
    +
    +{% endif %} diff --git a/phpMyAdmin/templates/prefs_twofactor_configure.twig b/phpMyAdmin/templates/prefs_twofactor_configure.twig new file mode 100755 index 0000000..ce597a3 --- /dev/null +++ b/phpMyAdmin/templates/prefs_twofactor_configure.twig @@ -0,0 +1,13 @@ +
    +

    {% trans "Configure two-factor authentication" %}

    +
    +
    +{{ Url_getHiddenInputs() }} + +{{ form|raw }} + +
    +
    +
    + + diff --git a/phpMyAdmin/templates/prefs_twofactor_confirm.twig b/phpMyAdmin/templates/prefs_twofactor_confirm.twig new file mode 100755 index 0000000..7d785a7 --- /dev/null +++ b/phpMyAdmin/templates/prefs_twofactor_confirm.twig @@ -0,0 +1,12 @@ +
    +

    {% trans "Confirm disabling two-factor authentication" %}

    +
    +
    +{{ Message_notice("By disabling two factor authentication you will be again able to login using password only."|trans) }} +{{ Url_getHiddenInputs() }} +{{ form|raw }} + + +
    +
    +
    diff --git a/phpMyAdmin/templates/preview_sql.twig b/phpMyAdmin/templates/preview_sql.twig new file mode 100755 index 0000000..9219a17 --- /dev/null +++ b/phpMyAdmin/templates/preview_sql.twig @@ -0,0 +1,11 @@ +
    + {% if query_data is empty %} + {% trans 'No change' %} + {% elseif query_data is iterable %} + {% for query in query_data %} + {{ Util_formatSql(query) }} + {% endfor %} + {% else %} + {{ Util_formatSql(query_data) }} + {% endif %} +
    diff --git a/phpMyAdmin/templates/privileges/add_privileges_database.twig b/phpMyAdmin/templates/privileges/add_privileges_database.twig new file mode 100755 index 0000000..d48723f --- /dev/null +++ b/phpMyAdmin/templates/privileges/add_privileges_database.twig @@ -0,0 +1,14 @@ + + +{%- if databases is not empty %} + +{% endif -%} + + +{{ Util_showHint("Wildcards % and _ should be escaped with a \\ to use them literally."|trans) }} diff --git a/phpMyAdmin/templates/privileges/add_privileges_routine.twig b/phpMyAdmin/templates/privileges/add_privileges_routine.twig new file mode 100755 index 0000000..4e10129 --- /dev/null +++ b/phpMyAdmin/templates/privileges/add_privileges_routine.twig @@ -0,0 +1,14 @@ + + + + +{%- if routines is not empty %} + +{% endif -%} + + diff --git a/phpMyAdmin/templates/privileges/add_privileges_table.twig b/phpMyAdmin/templates/privileges/add_privileges_table.twig new file mode 100755 index 0000000..bdcaeb7 --- /dev/null +++ b/phpMyAdmin/templates/privileges/add_privileges_table.twig @@ -0,0 +1,14 @@ + + + + +{%- if tables is not empty %} + +{% endif -%} + + diff --git a/phpMyAdmin/templates/privileges/add_user_fieldset.twig b/phpMyAdmin/templates/privileges/add_user_fieldset.twig new file mode 100755 index 0000000..6483ec8 --- /dev/null +++ b/phpMyAdmin/templates/privileges/add_user_fieldset.twig @@ -0,0 +1,8 @@ +
    + {% trans %}New{% context %}Create new user{% endtrans %} + + {{ Util_getIcon('b_usradd') }}{% trans 'Add user account' %} +
    diff --git a/phpMyAdmin/templates/privileges/choose_user_group.twig b/phpMyAdmin/templates/privileges/choose_user_group.twig new file mode 100755 index 0000000..64a2e22 --- /dev/null +++ b/phpMyAdmin/templates/privileges/choose_user_group.twig @@ -0,0 +1,9 @@ +
    + {{ Url_getHiddenInputs(params) }} +
    + {% trans 'User group' %} + {% trans 'User group' %}: + {{ Util_getDropdown('userGroup', all_user_groups, user_group, 'userGroup_select') }} + +
    +
    diff --git a/phpMyAdmin/templates/privileges/column_privileges.twig b/phpMyAdmin/templates/privileges/column_privileges.twig new file mode 100755 index 0000000..50af9c2 --- /dev/null +++ b/phpMyAdmin/templates/privileges/column_privileges.twig @@ -0,0 +1,24 @@ +
    + + + + + {% trans 'Or' %} + +
    diff --git a/phpMyAdmin/templates/privileges/delete_user_fieldset.twig b/phpMyAdmin/templates/privileges/delete_user_fieldset.twig new file mode 100755 index 0000000..d948afe --- /dev/null +++ b/phpMyAdmin/templates/privileges/delete_user_fieldset.twig @@ -0,0 +1,17 @@ +
    + + {{ Util_getIcon('b_usrdrop') }}{% trans 'Remove selected user accounts' %} + + +

    ({% trans 'Revoke all active privileges from the users and delete them afterwards.' %})

    + + +
    + + diff --git a/phpMyAdmin/templates/privileges/edit_routine_privileges.twig b/phpMyAdmin/templates/privileges/edit_routine_privileges.twig new file mode 100755 index 0000000..be3c0b1 --- /dev/null +++ b/phpMyAdmin/templates/privileges/edit_routine_privileges.twig @@ -0,0 +1,26 @@ +
    + {{ header|raw }} + +
    diff --git a/phpMyAdmin/templates/privileges/global_priv_table.twig b/phpMyAdmin/templates/privileges/global_priv_table.twig new file mode 100755 index 0000000..8a6d115 --- /dev/null +++ b/phpMyAdmin/templates/privileges/global_priv_table.twig @@ -0,0 +1,18 @@ +{% for key, table in priv_table %} +
    + + + + + {% for priv in table %} + {% set checked = row[priv[0] ~ '_priv'] is defined and row[priv[0] ~ '_priv'] == 'Y' ? ' checked="checked"' %} + {% set formatted_priv = ServerPrivileges_formatPrivilege(priv, true) %} + {% include 'privileges/global_priv_tbl_item.twig' with { + 'checked': checked, + 'formatted_priv': formatted_priv, + 'priv': priv + } only %} + {% endfor %} +
    +{% endfor %} diff --git a/phpMyAdmin/templates/privileges/global_priv_tbl_item.twig b/phpMyAdmin/templates/privileges/global_priv_tbl_item.twig new file mode 100755 index 0000000..5a5c3b6 --- /dev/null +++ b/phpMyAdmin/templates/privileges/global_priv_tbl_item.twig @@ -0,0 +1,9 @@ +
    + + +
    diff --git a/phpMyAdmin/templates/privileges/initials_row.twig b/phpMyAdmin/templates/privileges/initials_row.twig new file mode 100755 index 0000000..3737851 --- /dev/null +++ b/phpMyAdmin/templates/privileges/initials_row.twig @@ -0,0 +1,26 @@ + + + {% for tmp_initial, initial_was_found in array_initials %} + {% if tmp_initial is not same as(null) %} + {% if initial_was_found %} + + {% else %} + + {% endif %} + {% endif %} + {% endfor %} + + +
    + + {{- tmp_initial|raw -}} + + {{ tmp_initial|raw }} + + {% trans 'Show all' %} + +
    diff --git a/phpMyAdmin/templates/privileges/privileges_summary.twig b/phpMyAdmin/templates/privileges/privileges_summary.twig new file mode 100755 index 0000000..31f2173 --- /dev/null +++ b/phpMyAdmin/templates/privileges/privileges_summary.twig @@ -0,0 +1,62 @@ + diff --git a/phpMyAdmin/templates/privileges/privileges_summary_row.twig b/phpMyAdmin/templates/privileges/privileges_summary_row.twig new file mode 100755 index 0000000..4470ca5 --- /dev/null +++ b/phpMyAdmin/templates/privileges/privileges_summary_row.twig @@ -0,0 +1,14 @@ + + {{ name }} + {{ privileges|raw }} + {{ grant ? 'Yes'|trans : 'No'|trans }} + + {% if type == 'database' %} + {{ table_privs ? 'Yes'|trans : 'No'|trans }} + {% elseif type == 'table' %} + {{ column_privs ? 'Yes'|trans : 'No'|trans }} + {% endif %} + + {{ edit_link|raw }} + {{ revoke_link|raw }} + diff --git a/phpMyAdmin/templates/privileges/require_options.twig b/phpMyAdmin/templates/privileges/require_options.twig new file mode 100755 index 0000000..157f272 --- /dev/null +++ b/phpMyAdmin/templates/privileges/require_options.twig @@ -0,0 +1,14 @@ +
    + SSL +
    + {% for require_option in require_options %} + {% if require_option['name'] is same as('ssl_cipher') %} +
    + {% endif %} + {% include 'privileges/require_options_item.twig' with { + 'require_option': require_option + } only %} + {% endfor %} +
    {# END specified_div #} +
    {# END require_ssl_div #} +
    diff --git a/phpMyAdmin/templates/privileges/require_options_item.twig b/phpMyAdmin/templates/privileges/require_options_item.twig new file mode 100755 index 0000000..9270daa --- /dev/null +++ b/phpMyAdmin/templates/privileges/require_options_item.twig @@ -0,0 +1,23 @@ +
    + {% if require_option['radio'] %} + + + {% else %} + + + {% endif %} +
    diff --git a/phpMyAdmin/templates/privileges/resource_limit_item.twig b/phpMyAdmin/templates/privileges/resource_limit_item.twig new file mode 100755 index 0000000..af0a358 --- /dev/null +++ b/phpMyAdmin/templates/privileges/resource_limit_item.twig @@ -0,0 +1,11 @@ +
    + + +
    diff --git a/phpMyAdmin/templates/privileges/resource_limits.twig b/phpMyAdmin/templates/privileges/resource_limits.twig new file mode 100755 index 0000000..8d61ac5 --- /dev/null +++ b/phpMyAdmin/templates/privileges/resource_limits.twig @@ -0,0 +1,13 @@ +
    + {% trans 'Resource limits' %} +

    + + {% trans 'Note: Setting these options to 0 (zero) removes the limit.' %} + +

    + {% for limit in limits %} + {% include 'privileges/resource_limit_item.twig' with { + 'limit': limit + } only %} + {% endfor %} +
    diff --git a/phpMyAdmin/templates/radio_fields.twig b/phpMyAdmin/templates/radio_fields.twig new file mode 100755 index 0000000..46d3a3c --- /dev/null +++ b/phpMyAdmin/templates/radio_fields.twig @@ -0,0 +1,11 @@ +{% if class is not empty %} +
    +{% endif %} + + +{% if is_line_break %} +
    +{% endif %} +{% if class is not empty %} +
    +{% endif %} diff --git a/phpMyAdmin/templates/secondary_tabs.twig b/phpMyAdmin/templates/secondary_tabs.twig new file mode 100755 index 0000000..20c9c11 --- /dev/null +++ b/phpMyAdmin/templates/secondary_tabs.twig @@ -0,0 +1,6 @@ +
      + {% for tab in sub_tabs %} + {{ Util_getHtmlTab(tab, url_params) }} + {% endfor %} +
    +
    diff --git a/phpMyAdmin/templates/select_all.twig b/phpMyAdmin/templates/select_all.twig new file mode 100755 index 0000000..b9c2102 --- /dev/null +++ b/phpMyAdmin/templates/select_all.twig @@ -0,0 +1,6 @@ +{% trans 'With selected:' %} + + +{% trans 'With selected:' %} diff --git a/phpMyAdmin/templates/select_lang.twig b/phpMyAdmin/templates/select_lang.twig new file mode 100755 index 0000000..98b5863 --- /dev/null +++ b/phpMyAdmin/templates/select_lang.twig @@ -0,0 +1,32 @@ +
    + {{ Url_getHiddenInputs(_form_params) }} + + {% if use_fieldset %} +
    + {{ language_title|raw }} + {% else %} + + + + {% endif %} + + + + {% if use_fieldset %} +
    + {% endif %} + +
    diff --git a/phpMyAdmin/templates/server/binlog/log_row.twig b/phpMyAdmin/templates/server/binlog/log_row.twig new file mode 100755 index 0000000..a5ffabd --- /dev/null +++ b/phpMyAdmin/templates/server/binlog/log_row.twig @@ -0,0 +1,10 @@ + + {{ value['Log_name'] }} + {{ value['Pos'] }} + {{ value['Event_type'] }} + {{ value['Server_id'] }} + + {{- value['Orig_log_pos'] is defined ? value['Orig_log_pos'] : value['End_log_pos'] -}} + + {{ Util_formatSql(value['Info'], not dontlimitchars) }} + diff --git a/phpMyAdmin/templates/server/binlog/log_selector.twig b/phpMyAdmin/templates/server/binlog/log_selector.twig new file mode 100755 index 0000000..bbdc382 --- /dev/null +++ b/phpMyAdmin/templates/server/binlog/log_selector.twig @@ -0,0 +1,29 @@ +
    + {{ Url_getHiddenInputs(url_params) }} +
    + + {% trans 'Select binary log to view' %} + + {% set full_size = 0 %} + + {{ binary_logs|length }} + {% trans 'Files' %}, + {% if full_size > 0 %} + {{ Util_formatByteDown(full_size)|join(' ') }} + {% endif %} +
    +
    + +
    +
    diff --git a/phpMyAdmin/templates/server/collations/charsets.twig b/phpMyAdmin/templates/server/collations/charsets.twig new file mode 100755 index 0000000..e23cf3c --- /dev/null +++ b/phpMyAdmin/templates/server/collations/charsets.twig @@ -0,0 +1,26 @@ +
    + + + + + + + + {% for current_charset in mysql_charsets %} + + + + {% for current_collation in mysql_collations[current_charset] %} + + + + + {% endfor %} + {% endfor %} +
    {% trans 'Collation' %}{% trans 'Description' %}
    + {{ current_charset }} + {% if mysql_charsets_desc[current_charset] is not empty %} + ({{ mysql_charsets_desc[current_charset] }}) + {% endif %} +
    {{ current_collation }}{{ Charsets_getCollationDescr(current_collation) }}
    +
    diff --git a/phpMyAdmin/templates/server/databases/create.twig b/phpMyAdmin/templates/server/databases/create.twig new file mode 100755 index 0000000..fff3c2d --- /dev/null +++ b/phpMyAdmin/templates/server/databases/create.twig @@ -0,0 +1,50 @@ +
      +
    • + {% if is_create_db_priv %} +
      +

      + + {{ Util_showMySQLDocu('CREATE_DATABASE') }} +

      + + {{ Url_getHiddenInputs('', '', 5) }} + + {% if dbstats is not empty %} + + {% endif %} + + + {{ Charsets_getCollationDropdownBox( + dbi, + disable_is, + 'db_collation', + null, + server_collation, + true + ) }} + +
      + {% else %} + {# db creation no privileges message #} +

      + {{ Util_getImage('b_newdb') }} + {% trans 'Create database' %} + {{ Util_showMySQLDocu('CREATE_DATABASE') }} +

      + + + {{ Util_getImage( + 's_error', + '', + {'hspace': 2, 'border': 0, 'align': 'middle'} + ) }} + {% trans 'No Privileges' %} + + {% endif %} +
    • +
    diff --git a/phpMyAdmin/templates/server/databases/databases_footer.twig b/phpMyAdmin/templates/server/databases/databases_footer.twig new file mode 100755 index 0000000..3efdcbf --- /dev/null +++ b/phpMyAdmin/templates/server/databases/databases_footer.twig @@ -0,0 +1,77 @@ + + + {% if is_superuser or allow_user_drop_database %} + + {% endif %} + + {% trans 'Total' %}: + {{- database_count -}} + + + {% for stat_name, stat in column_order %} + {% if stat_name in first_database|keys %} + {% if stat['format'] is same as('byte') %} + {% set byte_format = Util_formatByteDown(stat['footer'], 3, 1) %} + {% set value = byte_format[0] %} + {% set unit = byte_format[1] %} + {% elseif stat['format'] is same as('number') %} + {% set value = Util_formatNumber(stat['footer'], 0) %} + {% else %} + {% set value = htmlentities(stat['footer'], 0) %} + {% endif %} + + + {% if stat['description_function'] is defined %} + + {{ value }} + + {% else %} + {{ value }} + {% endif %} + + {% if stat['format'] is same as('byte') %} + {{ unit }} + {% endif %} + {% endif %} + {% endfor %} + {% if master_replication %} + + {% endif %} + {% if slave_replication %} + + {% endif %} + + + + +
    + +{# Footer buttons #} +{% if is_superuser or allow_user_drop_database %} + {% include 'select_all.twig' with { + 'pma_theme_image': pma_theme_image, + 'text_dir': text_dir, + 'form_name': 'dbStatsForm' + } only %} + + {{ Util_getButtonOrImage( + '', + 'mult_submit ajax', + 'Drop'|trans, + 'b_deltbl' + ) }} +{% endif %} + +{# Enable statistics #} +{% if dbstats is empty %} + {{ Message_notice('Note: Enabling the database statistics here might cause heavy traffic between the web server and the MySQL server.'|trans) }} + +{% endif %} + +
    diff --git a/phpMyAdmin/templates/server/databases/databases_header.twig b/phpMyAdmin/templates/server/databases/databases_header.twig new file mode 100755 index 0000000..996a851 --- /dev/null +++ b/phpMyAdmin/templates/server/databases/databases_header.twig @@ -0,0 +1,29 @@ +
    + {{ Util_getListNavigator( + database_count, + pos, + url_params, + 'server_databases.php', + 'frame_content', + max_db_list + ) }} +
    + {{ Url_getHiddenInputs(url_params) }} + {% set url_params = url_params|merge({ + 'sort_by': 'SCHEMA_NAME', + 'sort_order': sort_by == 'SCHEMA_NAME' and sort_order == 'asc' ? 'desc' : 'asc' + }) %} +
    + + {% include 'server/databases/table_header.twig' with { + 'url_params': url_params, + 'sort_by': sort_by, + 'sort_order': sort_order, + 'sort_order_text': sort_order == 'asc' ? 'Ascending'|trans : 'Descending'|trans, + 'column_order': column_order, + 'first_database': first_database, + 'master_replication': master_replication, + 'slave_replication': slave_replication, + 'is_superuser': is_superuser, + 'allow_user_drop_database': allow_user_drop_database + } only %} diff --git a/phpMyAdmin/templates/server/databases/index.twig b/phpMyAdmin/templates/server/databases/index.twig new file mode 100755 index 0000000..7d465e2 --- /dev/null +++ b/phpMyAdmin/templates/server/databases/index.twig @@ -0,0 +1,25 @@ +{# Displays the sub-page heading #} +{% include 'server/sub_page_header.twig' with { + 'type': dbstats ? 'database_statistics' : 'databases' +} only %} + +{# Displays For Create database #} +{% if show_create_db %} + {% include 'server/databases/create.twig' with { + 'is_create_db_priv': is_create_db_priv, + 'dbstats': dbstats, + 'db_to_create': db_to_create, + 'server_collation': server_collation, + 'dbi': dbi, + 'disable_is': disable_is + } only %} +{% endif %} + +{% include 'filter.twig' with {'filter_value': ''} only %} + +{# Displays the page #} +{% if databases is not null %} + {{ databases|raw }} +{% else %} +

    {% trans 'No databases' %}

    +{% endif %} diff --git a/phpMyAdmin/templates/server/databases/table_header.twig b/phpMyAdmin/templates/server/databases/table_header.twig new file mode 100755 index 0000000..6270f3a --- /dev/null +++ b/phpMyAdmin/templates/server/databases/table_header.twig @@ -0,0 +1,41 @@ + + + {% if is_superuser or allow_user_drop_database %} + + {% endif %} + + {% for stat_name, stat in column_order %} + {% if stat_name in first_database|keys %} + {% set url_params = url_params|merge({ + 'sort_by': stat_name, + 'sort_order': sort_by == stat_name and sort_order == 'desc' ? 'asc' : 'desc' + }) %} + + + + {{ stat['disp_name'] }} + {{ sort_by == stat_name ? Util_getImage( + 's_' ~ sort_order, + sort_order_text + ) }} + + + {% endif %} + {% endfor %} + {% if master_replication %} + + {% endif %} + {% if slave_replication %} + + {% endif %} + + + diff --git a/phpMyAdmin/templates/server/databases/table_row.twig b/phpMyAdmin/templates/server/databases/table_row.twig new file mode 100755 index 0000000..365fd82 --- /dev/null +++ b/phpMyAdmin/templates/server/databases/table_row.twig @@ -0,0 +1,67 @@ + + {% if is_superuser or allow_user_drop_database %} + + {% endif %} + + {% for stat_name, stat in column_order %} + {% if stat_name in current|keys %} + {% if stat['format'] is same as('byte') %} + {% set byte_format = Util_formatByteDown(current[stat_name], 3, 1) %} + {% set value = byte_format[0] %} + {% set unit = byte_format[1] %} + {% elseif stat['format'] is same as('number') %} + {% set value = Util_formatNumber(current[stat_name], 0) %} + {% else %} + {% set value = htmlentities(current[stat_name], 0) %} + {% endif %} + + + {% if stat['format'] is same as('byte') %} + + {% endif %} + {% endif %} + {% endfor %} + + {% if master_replication_status %} + + {% endif %} + + {% if slave_replication_status %} + + {% endif %} + + + diff --git a/phpMyAdmin/templates/server/engines/engine.twig b/phpMyAdmin/templates/server/engines/engine.twig new file mode 100755 index 0000000..7744ed1 --- /dev/null +++ b/phpMyAdmin/templates/server/engines/engine.twig @@ -0,0 +1,39 @@ +

    + {{ Util_getImage('b_engine') }} + {{ title }} + {{ Util_showMySQLDocu(help_page) }} +

    +

    {{ comment }}

    + +{% if info_pages is not empty and info_pages is iterable %} +

    + [ + {% if page is empty %} + {% trans 'Variables' %} + {% else %} + + {% trans 'Variables' %} + + {% endif %} + {% for current, label in info_pages %} + | + {% if page is defined and page == current %} + {{ label }} + {% else %} + + {{ label }} + + {% endif %} + {% endfor %} + ] +

    +{% endif %} + +{% if page_output is not empty %} + {{ page_output|raw }} +{% else %} +

    {{ support }}

    + {{ variables|raw }} +{% endif %} diff --git a/phpMyAdmin/templates/server/engines/engines.twig b/phpMyAdmin/templates/server/engines/engines.twig new file mode 100755 index 0000000..5a3d68c --- /dev/null +++ b/phpMyAdmin/templates/server/engines/engines.twig @@ -0,0 +1,22 @@ +
    + + {% trans 'Database' %} + {{ sort_by == 'SCHEMA_NAME' ? Util_getImage( + 's_' ~ sort_order, + sort_order_text + ) }} + + {% trans 'Master replication' %}{% trans 'Slave replication' %}{% trans 'Action' %}
    + + + + {{ current['SCHEMA_NAME'] }} + + + {% if stat['description_function'] is defined %} + + {{ value }} + + {% else %} + {{ value }} + {% endif %} + {{ unit }} + {{ master_replication|raw }} + + {{ slave_replication|raw }} + + + {{ Util_getIcon('s_rights', 'Check privileges'|trans) }} + +
    + + + + + + + + {% for engine, details in engines %} + + + + + {% endfor %} + +
    {% trans 'Storage Engine' %}{% trans 'Description' %}
    + + {{ details['Engine'] }} + + {{ details['Comment'] }}
    diff --git a/phpMyAdmin/templates/server/plugins/section.twig b/phpMyAdmin/templates/server/plugins/section.twig new file mode 100755 index 0000000..bca286d --- /dev/null +++ b/phpMyAdmin/templates/server/plugins/section.twig @@ -0,0 +1,35 @@ +
    + + + + + + + + + + + + + {% for plugin in plugin_list %} + + + + + + + + {% endfor %} + +
    + {{ plugin_type }} +
    {% trans 'Plugin' %}{% trans 'Description' %}{% trans 'Version' %}{% trans 'Author' %}{% trans 'License' %}
    + {{ plugin['plugin_name'] }} + {% if not plugin['is_active'] %} + + {% trans 'disabled' %} + + {% endif %} + {{ plugin['plugin_description'] }}{{ plugin['plugin_type_version'] }}{{ plugin['plugin_author'] }}{{ plugin['plugin_license'] }}
    +
    diff --git a/phpMyAdmin/templates/server/plugins/section_links.twig b/phpMyAdmin/templates/server/plugins/section_links.twig new file mode 100755 index 0000000..f686233 --- /dev/null +++ b/phpMyAdmin/templates/server/plugins/section_links.twig @@ -0,0 +1,7 @@ + diff --git a/phpMyAdmin/templates/server/sub_page_header.twig b/phpMyAdmin/templates/server/sub_page_header.twig new file mode 100755 index 0000000..eb85c71 --- /dev/null +++ b/phpMyAdmin/templates/server/sub_page_header.twig @@ -0,0 +1,48 @@ +{# array contains Sub page icon and text #} +{% set header = { + 'variables': { + 'image': 's_vars', + 'text': 'Server variables and settings'|trans + }, + 'engines': { + 'image': 'b_engine', + 'text': 'Storage engines'|trans + }, + 'plugins': { + 'image': 'b_plugin', + 'text': 'Plugins'|trans + }, + 'binlog': { + 'image': 's_tbl', + 'text': 'Binary log'|trans + }, + 'collations': { + 'image': 's_asci', + 'text': 'Character sets and collations'|trans + }, + 'replication': { + 'image': 's_replication', + 'text': 'Replication'|trans + }, + 'database_statistics': { + 'image': 's_db', + 'text': 'Databases statistics'|trans + }, + 'databases': { + 'image': 's_db', + 'text': 'Databases'|trans + }, + 'privileges': { + 'image': 'b_usrlist', + 'text': 'Privileges'|trans + } +} %} +

    + {% if is_image|default(true) %} + {{ Util_getImage(header[type]['image']) }} + {% else %} + {{ Util_getIcon(header[type]['image']) }} + {% endif %} + {{ header[type]['text'] }} + {{ link is defined ? Util_showMySQLDocu(link) }} +

    diff --git a/phpMyAdmin/templates/server/variables/link_template.twig b/phpMyAdmin/templates/server/variables/link_template.twig new file mode 100755 index 0000000..4bcbfb1 --- /dev/null +++ b/phpMyAdmin/templates/server/variables/link_template.twig @@ -0,0 +1,10 @@ + + {{ Util_getIcon('b_save', 'Save'|trans) }} + + + {{ Util_getIcon('b_close', 'Cancel'|trans) }} + +{{ Util_getImage('b_help', 'Documentation'|trans, { + 'class': 'hide', + 'id': 'docImage' +}) }} diff --git a/phpMyAdmin/templates/server/variables/session_variable_row.twig b/phpMyAdmin/templates/server/variables/session_variable_row.twig new file mode 100755 index 0000000..f6f286a --- /dev/null +++ b/phpMyAdmin/templates/server/variables/session_variable_row.twig @@ -0,0 +1,5 @@ + + + ({% trans 'Session value' %}) +  {{ value }} + diff --git a/phpMyAdmin/templates/server/variables/variable_row.twig b/phpMyAdmin/templates/server/variables/variable_row.twig new file mode 100755 index 0000000..174ac61 --- /dev/null +++ b/phpMyAdmin/templates/server/variables/variable_row.twig @@ -0,0 +1,29 @@ + + + {% if editable %} + {{ Util_getIcon('b_edit', 'Edit'|trans) }} + {% else %} + + {{ Util_getIcon('bd_edit', 'Edit'|trans) }} + + {% endif %} + + + {% if doc_link != null %} + + {{ Util_showMySQLDocu(doc_link[1], false, doc_link[2] ~ '_' ~ doc_link[0], true) }} + {{ name|e|replace({'_': ' '})|raw }} + + + {% else %} + {{ name|replace({'_': ' '}) }} + {% endif %} + + + {% if is_html_formatted == false %} + {{ value|e|replace({',': ',​'})|raw }} + {% else %} + {{ value|raw }} + {% endif %} + + diff --git a/phpMyAdmin/templates/server/variables/variable_table_head.twig b/phpMyAdmin/templates/server/variables/variable_table_head.twig new file mode 100755 index 0000000..9badd76 --- /dev/null +++ b/phpMyAdmin/templates/server/variables/variable_table_head.twig @@ -0,0 +1,7 @@ + + + {% trans 'Action' %} + {% trans 'Variable' %} + {% trans 'Value' %} + + diff --git a/phpMyAdmin/templates/start_and_number_of_rows_panel.twig b/phpMyAdmin/templates/start_and_number_of_rows_panel.twig new file mode 100755 index 0000000..7d27f8f --- /dev/null +++ b/phpMyAdmin/templates/start_and_number_of_rows_panel.twig @@ -0,0 +1,20 @@ +
    +
    + + 0 -%} + max="{{ unlim_num_rows - 1 }}" + {%- endif %} + value="{{ pos }}" /> + + + + + + +
    +
    diff --git a/phpMyAdmin/templates/table/browse_foreigners/column_element.twig b/phpMyAdmin/templates/table/browse_foreigners/column_element.twig new file mode 100755 index 0000000..f2ec2ba --- /dev/null +++ b/phpMyAdmin/templates/table/browse_foreigners/column_element.twig @@ -0,0 +1,12 @@ + + {{ is_selected ? '' }} + + {% if nowrap %} + {{ keyname }} + {% else %} + {{ description }} + {% endif %} + + {{ is_selected ? '' }} + diff --git a/phpMyAdmin/templates/table/browse_foreigners/show_all.twig b/phpMyAdmin/templates/table/browse_foreigners/show_all.twig new file mode 100755 index 0000000..12a5441 --- /dev/null +++ b/phpMyAdmin/templates/table/browse_foreigners/show_all.twig @@ -0,0 +1,5 @@ +{% if foreign_data.disp_row is iterable and + (show_all and foreign_data.the_total > max_rows) %} + +{% endif %} diff --git a/phpMyAdmin/templates/table/chart/tbl_chart.twig b/phpMyAdmin/templates/table/chart/tbl_chart.twig new file mode 100755 index 0000000..1458690 --- /dev/null +++ b/phpMyAdmin/templates/table/chart/tbl_chart.twig @@ -0,0 +1,161 @@ + +{# Display Chart options #} +
    + + {{ Url_getHiddenInputs(url_params) }} +
    + + {% trans 'Display chart' %} + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    + + + + + + + + + + + + +

    + + + + +

    + + +
    + {% set xaxis = null %} +
    + + +
    + + + + +
    +
    + + +
    + + +
    +
    +
    +
    + + +
    + + + + +
    + {{ Util_getStartAndNumberOfRowsPanel(sql_query) }} +
    + +
    + +
    diff --git a/phpMyAdmin/templates/table/gis_visualization/gis_visualization.twig b/phpMyAdmin/templates/table/gis_visualization/gis_visualization.twig new file mode 100755 index 0000000..49a7ce1 --- /dev/null +++ b/phpMyAdmin/templates/table/gis_visualization/gis_visualization.twig @@ -0,0 +1,80 @@ +
    +
    + {% trans 'Display GIS Visualization' %} +
    +
    + {{ Url_getHiddenInputs(url_params) }} + + + + + + + + + + + + {{ Util_getStartAndNumberOfRowsPanel(sql_query) }} +
    + +
    +
    + + {{ Util_getImage('b_saveimage', 'Save'|trans) }} + + +
    +
    +
    + +
    + +
    + {{ visualization|raw }} +
    +
    + + +
    +
    diff --git a/phpMyAdmin/templates/table/index_form.twig b/phpMyAdmin/templates/table/index_form.twig new file mode 100755 index 0000000..72f4774 --- /dev/null +++ b/phpMyAdmin/templates/table/index_form.twig @@ -0,0 +1,219 @@ +
    + + {{ Url_getHiddenInputs(form_params) }} + +
    +
    +
    +
    + + + +
    + + +
    + +
    +
    + + + +
    + {{ index.generateIndexChoiceSelector(create_edit_table)|raw }} +
    + + {{ Util_getDivForSliderEffect('indexoptions', 'Advanced Options'|trans) }} + +
    +
    + + + +
    + + +
    + +
    + +
    + + + +
    + {{ index.generateIndexTypeSelector()|raw }} +
    + +
    +
    + + + +
    + + +
    + +
    +
    + + + +
    + + +
    +
    + + +
    + + + + + + + + + + {% set spatial_types = [ + 'geometry', + 'point', + 'linestring', + 'polygon', + 'multipoint', + 'multilinestring', + 'multipolygon', + 'geomtrycollection' + ] %} + + {% for column in index.getColumns() %} + + + + + + {% endfor %} + {% if add_fields > 0 %} + {% for i in range(1, add_fields) %} + + + + + + {% endfor %} + {% endif %} + +
    + {% trans 'Column' %} + + {% trans 'Size' %} +
    + + + + + +
    + + + + + +
    +
    + +
    +
    + +
    +
    +
    +
    + + +
    +
    diff --git a/phpMyAdmin/templates/table/insert/continue_insertion_form.twig b/phpMyAdmin/templates/table/insert/continue_insertion_form.twig new file mode 100755 index 0000000..c39a96f --- /dev/null +++ b/phpMyAdmin/templates/table/insert/continue_insertion_form.twig @@ -0,0 +1,19 @@ +
    + {{ Url_getHiddenInputs(db, table) }} + + + + + {% if has_where_clause %} + {% for key_id, where_clause in where_clause_array %} + + {% endfor %} + {% endif %} + + {% set insert_rows %} + + {% endset %} + {{ 'Continue insertion with %s rows'|trans|format(insert_rows)|raw }} +
    diff --git a/phpMyAdmin/templates/table/relation/common_form.twig b/phpMyAdmin/templates/table/relation/common_form.twig new file mode 100755 index 0000000..8dd3069 --- /dev/null +++ b/phpMyAdmin/templates/table/relation/common_form.twig @@ -0,0 +1,191 @@ +
    + {{ Url_getHiddenInputs(db, table) }} + {# InnoDB #} + {% if Util_isForeignKeySupported(tbl_storage_engine) %} +
    + {% trans 'Foreign key constraints' %} +
    + + + + + {% if tbl_storage_engine|upper == 'INNODB' %} + + {% else %} + + {% endif %} + + + + + + + + + + + {% set i = 0 %} + {% if existrel_foreign is not empty %} + {% for key, one_key in existrel_foreign %} + {# Foreign database dropdown #} + {% set foreign_db = one_key['ref_db_name'] is defined + and one_key['ref_db_name'] is not null + ? one_key['ref_db_name'] : db %} + {% set foreign_table = false %} + {% if foreign_db %} + {% set foreign_table = one_key['ref_table_name'] is defined + and one_key['ref_table_name'] is not null + ? one_key['ref_table_name'] : false %} + {% endif %} + {% set unique_columns = [] %} + {% if foreign_db and foreign_table %} + {% set table_obj = Table_get(foreign_table, foreign_db) %} + {% set unique_columns = table_obj.getUniqueColumns(false, false) %} + {% endif %} + {% include 'table/relation/foreign_key_row.twig' with { + 'i': i, + 'one_key': one_key, + 'column_array': column_array, + 'options_array': options_array, + 'tbl_storage_engine': tbl_storage_engine, + 'db': db, + 'table': table, + 'url_params': url_params, + 'databases': databases, + 'foreign_db': foreign_db, + 'foreign_table': foreign_table, + 'unique_columns': unique_columns + } only %} + {% set i = i + 1 %} + {% endfor %} + {% endif %} + {% include 'table/relation/foreign_key_row.twig' with { + 'i': i, + 'one_key': [], + 'column_array': column_array, + 'options_array': options_array, + 'tbl_storage_engine': tbl_storage_engine, + 'db': db, + 'table': table, + 'url_params': url_params, + 'databases': databases, + 'foreign_db': foreign_db, + 'foreign_table': foreign_table, + 'unique_columns': unique_columns + } only %} + {% set i = i + 1 %} + + +
    {% trans 'Actions' %}{% trans 'Constraint properties' %} + {% trans 'Column' %} + {{ Util_showHint('Creating a foreign key over a non-indexed column would automatically create an index on it. Alternatively, you can define an index below, before creating the foreign key.'|trans) }} + + {% trans 'Column' %} + {{ Util_showHint('Only columns with index will be displayed. You can define an index below.'|trans) }} + + {% trans 'Foreign key constraint' %} + ({{ tbl_storage_engine }}) +
    {% trans 'Database' %}{% trans 'Table' %}{% trans 'Column' %}
    + + {% trans '+ Add constraint' %} + +
    +
    +
    + {% endif %} + + {% if cfg_relation['relwork'] %} + {% if Util_isForeignKeySupported(tbl_storage_engine) %} + {{ Util_getDivForSliderEffect('ir_div', 'Internal relationships'|trans) }} + {% endif %} + +
    + + {% trans 'Internal relationships' %} + {{ Util_showDocu('config', 'cfg_Servers_relation') }} + + + + + + {% set saved_row_cnt = save_row|length - 1 %} + {% for i in 0..saved_row_cnt %} + {% set myfield = save_row[i]['Field'] %} + {# Use an md5 as array index to avoid having special characters + in the name attribute (see bug #1746964 ) #} + {% set myfield_md5 = md5(myfield) %} + + {% set foreign_table = false %} + {% set foreign_column = false %} + + {# Database dropdown #} + {% if existrel[myfield] is defined %} + {% set foreign_db = existrel[myfield]['foreign_db'] %} + {% else %} + {% set foreign_db = db %} + {% endif %} + + {# Table dropdown #} + {% set tables = [] %} + {% if foreign_db %} + {% if existrel[myfield] is defined %} + {% set foreign_table = existrel[myfield]['foreign_table'] %} + {% endif %} + {% set tables = dbi.getTables(foreign_db) %} + {% endif %} + + {# Column dropdown #} + {% set unique_columns = [] %} + {% if foreign_db and foreign_table %} + {% if existrel[myfield] is defined %} + {% set foreign_column = existrel[myfield]['foreign_field'] %} + {% endif %} + {% set table_obj = Table_get(foreign_table, foreign_db) %} + {% set unique_columns = table_obj.getUniqueColumns(false, false) %} + {% endif %} + + {% include 'table/relation/internal_relational_row.twig' with { + 'myfield': myfield, + 'myfield_md5': myfield_md5, + 'databases': databases, + 'tables': tables, + 'columns': unique_columns, + 'foreign_db': foreign_db, + 'foreign_table': foreign_table, + 'foreign_column': foreign_column + } only %} + {% endfor %} +
    {% trans 'Column' %}{% trans 'Internal relation' %} + {% if Util_isForeignKeySupported(tbl_storage_engine) %} + {{ Util_showHint('An internal relation is not necessary when a corresponding FOREIGN KEY relation exists.'|trans) }} + {% endif %} +
    +
    + {% if Util_isForeignKeySupported(tbl_storage_engine) %} +
    + {% endif %} + {% endif %} + + {% if cfg_relation['displaywork'] %} + {% set disp = Relation_getDisplayField(db, table) %} +
    + + +
    + {% endif %} + +
    + + +
    + diff --git a/phpMyAdmin/templates/table/relation/dropdown_generate.twig b/phpMyAdmin/templates/table/relation/dropdown_generate.twig new file mode 100755 index 0000000..ff179bc --- /dev/null +++ b/phpMyAdmin/templates/table/relation/dropdown_generate.twig @@ -0,0 +1,9 @@ +{{ dropdown_question is not empty ? dropdown_question -}} + diff --git a/phpMyAdmin/templates/table/relation/foreign_key_row.twig b/phpMyAdmin/templates/table/relation/foreign_key_row.twig new file mode 100755 index 0000000..50e39d1 --- /dev/null +++ b/phpMyAdmin/templates/table/relation/foreign_key_row.twig @@ -0,0 +1,139 @@ + + {# Drop key anchor #} + + {% set js_msg = '' %} + {% set this_params = null %} + {% if one_key['constraint'] is defined %} + {% set drop_fk_query = 'ALTER TABLE ' ~ Util_backquote(db) ~ '.' ~ Util_backquote(table) + ~ ' DROP FOREIGN KEY ' + ~ Util_backquote(one_key['constraint']) ~ ';' + %} + {% set this_params = url_params %} + {% set this_params = { + 'goto': 'tbl_relation.php', + 'back': 'tbl_relation.php', + 'sql_query': drop_fk_query, + 'message_to_show': 'Foreign key constraint %s has been dropped'|trans|format( + one_key['constraint'] + ) + } %} + {% set js_msg = Sanitize_jsFormat( + 'ALTER TABLE ' ~ db ~ '.' ~ table + ~ ' DROP FOREIGN KEY ' + ~ one_key['constraint'] ~ ';' + ) %} + {% endif %} + {% if one_key['constraint'] is defined %} + + {% set drop_str = Util_getIcon('b_drop', 'Drop'|trans) %} + {{ Util_linkOrButton('sql.php', this_params, drop_str, {'class': 'drop_foreign_key_anchor ajax'}) }} + {% endif %} + + + + + +
    + {# For ON DELETE and ON UPDATE, the default action + is RESTRICT as per MySQL doc; however, a SHOW CREATE TABLE + won't display the clause if it's set as RESTRICT. #} + {% set on_delete = one_key['on_delete'] is defined + ? one_key['on_delete'] : 'RESTRICT' %} + {% set on_update = one_key['on_update'] is defined + ? one_key['on_update'] : 'RESTRICT' %} + + {% include 'table/relation/dropdown_generate.twig' with { + 'dropdown_question': 'ON DELETE', + 'select_name': 'on_delete[' ~ i ~ ']', + 'choices': options_array, + 'selected_value': on_delete + } only %} + + + {% include 'table/relation/dropdown_generate.twig' with { + 'dropdown_question': 'ON UPDATE', + 'select_name': 'on_update[' ~ i ~ ']', + 'choices': options_array, + 'selected_value': on_update + } only %} + +
    + + + {% if one_key['index_list'] is defined %} + {% for key, column in one_key['index_list'] %} + + {% include 'table/relation/dropdown_generate.twig' with { + 'dropdown_question': '', + 'select_name': 'foreign_key_fields_name[' ~ i ~ '][]', + 'choices': column_array, + 'selected_value': column + } only %} + + {% endfor %} + {% else %} + + {% include 'table/relation/dropdown_generate.twig' with { + 'dropdown_question': '', + 'select_name': 'foreign_key_fields_name[' ~ i ~ '][]', + 'choices': column_array, + 'selected_value': '' + } only %} + + {% endif %} + + {% trans '+ Add column' %} + + + {% set tables = [] %} + {% if foreign_db %} + {% set tables = Relation_getTables(foreign_db, tbl_storage_engine) %} + {% endif %} + + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_foreign_db[' ~ i ~ ']', + 'title': 'Database'|trans, + 'values': databases, + 'foreign': foreign_db + } only %} + + + + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_foreign_table[' ~ i ~ ']', + 'title': 'Table'|trans, + 'values': tables, + 'foreign': foreign_table + } only %} + + + + {% if foreign_db and foreign_table %} + {% for foreign_column in one_key['ref_index_list'] %} + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_foreign_column[' ~ i ~ '][]', + 'title': 'Column'|trans, + 'values': unique_columns, + 'foreign': foreign_column + } only %} + + {% endfor %} + {% else %} + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_foreign_column[' ~ i ~ '][]', + 'title': 'Column'|trans, + 'values': [], + 'foreign': '' + } only %} + + {% endif %} + + diff --git a/phpMyAdmin/templates/table/relation/internal_relational_row.twig b/phpMyAdmin/templates/table/relation/internal_relational_row.twig new file mode 100755 index 0000000..f588f22 --- /dev/null +++ b/phpMyAdmin/templates/table/relation/internal_relational_row.twig @@ -0,0 +1,30 @@ + + + {{ myfield }} + + + + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_db[' ~ myfield_md5 ~ ']', + 'title': 'Database'|trans, + 'values': databases, + 'foreign': foreign_db + } only %} + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_table[' ~ myfield_md5 ~ ']', + 'title': 'Table'|trans, + 'values': tables, + 'foreign': foreign_table + } only %} + + {% include 'table/relation/relational_dropdown.twig' with { + 'name': 'destination_column[' ~ myfield_md5 ~ ']', + 'title': 'Column'|trans, + 'values': columns, + 'foreign': foreign_column + } only %} + + diff --git a/phpMyAdmin/templates/table/relation/relational_dropdown.twig b/phpMyAdmin/templates/table/relation/relational_dropdown.twig new file mode 100755 index 0000000..9d5f3c9 --- /dev/null +++ b/phpMyAdmin/templates/table/relation/relational_dropdown.twig @@ -0,0 +1,18 @@ + diff --git a/phpMyAdmin/templates/table/search/column_comparison_operators.twig b/phpMyAdmin/templates/table/search/column_comparison_operators.twig new file mode 100755 index 0000000..b72e530 --- /dev/null +++ b/phpMyAdmin/templates/table/search/column_comparison_operators.twig @@ -0,0 +1,3 @@ + diff --git a/phpMyAdmin/templates/table/search/fields_table.twig b/phpMyAdmin/templates/table/search/fields_table.twig new file mode 100755 index 0000000..c2da41a --- /dev/null +++ b/phpMyAdmin/templates/table/search/fields_table.twig @@ -0,0 +1,23 @@ + + {% include 'table/search/table_header.twig' with { + 'geom_column_flag': geom_column_flag + } only %} + + {% if search_type == 'zoom' %} + {% include 'table/search/rows_zoom.twig' with { + 'self': self, + 'column_names': column_names, + 'criteria_column_names': criteria_column_names, + 'criteria_column_types': criteria_column_types + } only %} + {% else %} + {% include 'table/search/rows_normal.twig' with { + 'self': self, + 'geom_column_flag': geom_column_flag, + 'column_names': column_names, + 'column_types': column_types, + 'column_collations': column_collations + } only %} + {% endif %} + +
    diff --git a/phpMyAdmin/templates/table/search/form_tag.twig b/phpMyAdmin/templates/table/search/form_tag.twig new file mode 100755 index 0000000..827c051 --- /dev/null +++ b/phpMyAdmin/templates/table/search/form_tag.twig @@ -0,0 +1,4 @@ +
    + {{ Url_getHiddenInputs(db, table) }} + + diff --git a/phpMyAdmin/templates/table/search/geom_func.twig b/phpMyAdmin/templates/table/search/geom_func.twig new file mode 100755 index 0000000..3ac3000 --- /dev/null +++ b/phpMyAdmin/templates/table/search/geom_func.twig @@ -0,0 +1,19 @@ +{# Displays 'Function' column if it is present #} + + {% set geom_types = Util_getGISDatatypes() %} + {% if column_types[column_index] in geom_types %} + + {% else %} +   + {% endif %} + diff --git a/phpMyAdmin/templates/table/search/input_box.twig b/phpMyAdmin/templates/table/search/input_box.twig new file mode 100755 index 0000000..08cba65 --- /dev/null +++ b/phpMyAdmin/templates/table/search/input_box.twig @@ -0,0 +1,96 @@ +{# Get inputbox based on different column types (Foreign key, geometrical, enum) #} +{% if foreigners and Relation_searchColumnInForeigners(foreigners, column_name) %} + {% if foreign_data['disp_row'] is iterable %} + + {% elseif foreign_data['foreign_link'] == true %} + + + {{ titles['Browse']|replace({"'": "\\'"})|raw }} + + {% endif %} +{% elseif column_type in Util_getGISDatatypes() %} + + {% if in_fbs %} + {% set edit_str = Util_getIcon('b_edit', 'Edit/Insert'|trans) %} + + {{ Util_linkOrButton('gis_data_editor.php', [], edit_str, [], '_blank') }} + + {% endif %} +{% elseif column_type starts with 'enum' + or (column_type starts with 'set' and in_zoom_search_edit) %} + {% set in_zoom_search_edit = false %} + {% set value = column_type|e|slice(5, -1)|replace({''': ''})|split(', ') %} + {% set cnt_value = value|length %} + {# + Enum in edit mode --> dropdown + Enum in search mode --> multiselect + Set in edit mode --> multiselect + Set in search mode --> input (skipped here, so the 'else' section would handle it) + #} + {% if (column_type starts with 'enum' and not in_zoom_search_edit) + or (column_type starts with 'set' and in_zoom_search_edit) %} + + {% endif %} + {# Add select options #} + + {% for i in 0..cnt_value - 1 %} + {% if criteria_values[column_index] is defined + and criteria_values[column_index] is iterable + and value[i] in criteria_values[column_index] %} + + {% else %} + + {% endif %} + {% endfor %} + +{% else %} + {% set the_class = 'textfield' %} + {% if column_type == 'date' %} + {% set the_class = the_class ~ ' datefield' %} + {% elseif column_type == 'datetime' or column_type starts with 'timestamp' %} + {% set the_class = the_class ~ ' datetimefield' %} + {% elseif column_type starts with 'bit' %} + {% set the_class = the_class ~ ' bit' %} + {% endif %} + +{% endif %} diff --git a/phpMyAdmin/templates/table/search/options.twig b/phpMyAdmin/templates/table/search/options.twig new file mode 100755 index 0000000..99ae985 --- /dev/null +++ b/phpMyAdmin/templates/table/search/options.twig @@ -0,0 +1,67 @@ +{{ Util_getDivForSliderEffect('searchoptions', 'Options'|trans) }} + +{# Displays columns select list for selecting distinct columns in the search #} +
    + + {% trans 'Select columns (at least one):' %} + + + + +
    + +{# Displays input box for custom 'Where' clause to be used in the search #} +
    + + {% trans 'Or' %} + {% trans 'Add search conditions (body of the "where" clause):' %} + + {{ Util_showMySQLDocu('Functions') }} + +
    + +{# Displays option of changing default number of rows displayed per page #} +
    + {% trans 'Number of rows per page' %} + +
    + +{# Displays option for ordering search results by a column value (Asc or Desc) #} +
    + {% trans 'Display order:' %} + + + {{ Util_getRadioFields( + 'order', + { + 'ASC': 'Ascending'|trans, + 'DESC': 'Descending'|trans + }, + 'ASC', + false, + true, + 'formelement' + ) }} + +
    +
    diff --git a/phpMyAdmin/templates/table/search/options_zoom.twig b/phpMyAdmin/templates/table/search/options_zoom.twig new file mode 100755 index 0000000..328eb4a --- /dev/null +++ b/phpMyAdmin/templates/table/search/options_zoom.twig @@ -0,0 +1,43 @@ + + {# Select options for data label #} + + + + + {# Inputbox for changing default maximum rows to plot #} + + + + +
    + + + +
    + + + +
    diff --git a/phpMyAdmin/templates/table/search/replace_preview.twig b/phpMyAdmin/templates/table/search/replace_preview.twig new file mode 100755 index 0000000..dab10f0 --- /dev/null +++ b/phpMyAdmin/templates/table/search/replace_preview.twig @@ -0,0 +1,39 @@ + + {{ Url_getHiddenInputs(db, table) }} + + + + + + +
    + {% trans 'Find and replace - preview' %} + + + + + + + + + + {% if result is iterable %} + {% for row in result %} + + {# count #} + {# original #} + {# replaced #} + + {% endfor %} + {% endif %} + +
    {% trans 'Count' %}{% trans 'Original string' %}{% trans 'Replaced string' %}
    {{ row[2] }}{{ row[0] }}{{ row[1] }}
    +
    + +
    + +
    +
    diff --git a/phpMyAdmin/templates/table/search/rows_normal.twig b/phpMyAdmin/templates/table/search/rows_normal.twig new file mode 100755 index 0000000..37e3089 --- /dev/null +++ b/phpMyAdmin/templates/table/search/rows_normal.twig @@ -0,0 +1,39 @@ +{% for column_index in 0..column_names|length - 1 %} + + {# If 'Function' column is present trying to change comment #} + {% if geom_column_flag %} + {% include 'table/search/geom_func.twig' with { + 'column_index': column_index, + 'column_types': column_types + } only %} + {% endif %} + {# Displays column's name, type, collation and value #} + + {{ column_names[column_index] }} + + {% set properties = self.getColumnProperties(column_index, column_index) %} + + {{ properties['type'] }} + + + {{ properties['collation'] }} + + + {{ properties['func']|raw }} + + {# here, the data-type attribute is needed for a date/time picker #} + + {{ properties['value']|raw }} + {# Displays hidden fields #} + + + + + +{% endfor %} diff --git a/phpMyAdmin/templates/table/search/rows_zoom.twig b/phpMyAdmin/templates/table/search/rows_zoom.twig new file mode 100755 index 0000000..79ef78f --- /dev/null +++ b/phpMyAdmin/templates/table/search/rows_zoom.twig @@ -0,0 +1,74 @@ +{# Get already set search criteria (if any) #} +{% set type = [] %} +{% set collation = [] %} +{% set func = [] %} +{% set value = [] %} + +{% for i in 0..3 %} + {# After X-Axis and Y-Axis column rows, display additional criteria option #} + {% if i == 2 %} + + + {% trans 'Additional search criteria' %} + + + {% endif %} + + + + + {% if criteria_column_names is defined + and criteria_column_names[i] != 'pma_null' %} + {% set key = array_search(criteria_column_names[i], column_names) %} + {% set properties = self.getColumnProperties(i, key) %} + {% set type = type|merge({i: properties['type']}) %} + {% set collation = collation|merge({i: properties['collation']}) %} + {% set func = func|merge({i: properties['func']}) %} + {% set value = value|merge({i: properties['value']}) %} + {% endif %} + {# Column type #} + + {{ type[i] is defined ? type[i] }} + + {# Column Collation #} + + {{ collation[i] is defined ? collation[i] }} + + {# Select options for column operators #} + + {{ func[i] is defined ? func[i]|raw }} + + {# Inputbox for search criteria value #} + + + + {{ value[i] is defined ? value[i]|raw }} + {# Displays hidden fields #} + + + + +{% endfor %} diff --git a/phpMyAdmin/templates/table/search/search_and_replace.twig b/phpMyAdmin/templates/table/search/search_and_replace.twig new file mode 100755 index 0000000..530ea6d --- /dev/null +++ b/phpMyAdmin/templates/table/search/search_and_replace.twig @@ -0,0 +1,25 @@ +{% trans 'Find:' %} + +{% trans 'Replace with:' %} + + +{% trans 'Column:' %} + + +{% include 'checkbox.twig' with { + 'html_field_id': 'useRegex', + 'html_field_name': 'useRegex', + 'label': 'Use regular expression'|trans, + 'checked': false, + 'onclick': false +} only %} diff --git a/phpMyAdmin/templates/table/search/selection_form.twig b/phpMyAdmin/templates/table/search/selection_form.twig new file mode 100755 index 0000000..64d99dc --- /dev/null +++ b/phpMyAdmin/templates/table/search/selection_form.twig @@ -0,0 +1,102 @@ +{% if search_type == 'zoom' %} + {% include 'table/search/form_tag.twig' with { + 'script_name': 'tbl_zoom_select.php', + 'form_id': 'zoom_search_form', + 'db': db, + 'table': table, + 'goto': goto + } only %} + +{% elseif search_type == 'normal' %} + {% include 'table/search/form_tag.twig' with { + 'script_name': 'tbl_select.php', + 'form_id': 'tbl_search_form', + 'db': db, + 'table': table, + 'goto': goto + } only %} + +{% elseif search_type == 'replace' %} + {% include 'table/search/form_tag.twig' with { + 'script_name': 'tbl_find_replace.php', + 'form_id': 'find_replace_form', + 'db': db, + 'table': table, + 'goto': goto + } only %} +
    +
    + + {% trans 'Find and replace' %} + + {% include 'table/search/search_and_replace.twig' with { + 'column_names': column_names, + 'column_types': column_types, + 'sql_types': sql_types + } only %} +
    +
    +{% else %} + {% include 'table/search/form_tag.twig' with { + 'script_name': '', + 'form_id': '', + 'db': db, + 'table': table, + 'goto': goto + } only %} +{% endif %} + +{# Displays selection form's footer elements #} +
    + +
    + +
    diff --git a/phpMyAdmin/templates/table/search/table_header.twig b/phpMyAdmin/templates/table/search/table_header.twig new file mode 100755 index 0000000..4093f5b --- /dev/null +++ b/phpMyAdmin/templates/table/search/table_header.twig @@ -0,0 +1,12 @@ + + + {% if geom_column_flag %} + {% trans 'Function' %} + {% endif %} + {% trans 'Column' %} + {% trans 'Type' %} + {% trans 'Collation' %} + {% trans 'Operator' %} + {% trans 'Value' %} + + diff --git a/phpMyAdmin/templates/table/search/zoom_result_form.twig b/phpMyAdmin/templates/table/search/zoom_result_form.twig new file mode 100755 index 0000000..d76ae19 --- /dev/null +++ b/phpMyAdmin/templates/table/search/zoom_result_form.twig @@ -0,0 +1,85 @@ +
    + {{ Url_getHiddenInputs(db, table) }} + + + +
    + {% trans 'Browse/Edit the points' %} + + {# JSON encode the data(query result) #} +
    + {% if zoom_submit and data is not empty %} +
    +
    + + {% trans 'How to use' %} + +
    +
    + {{ data_json }} +
    +
    + +
    + {% endif %} +
    + + {# Displays rows in point edit form #} +
    + + + + + + + + + + {% for column_index in 0..column_names|length - 1 %} + {% set field_popup = column_names[column_index] %} + {% set foreign_data = Relation_getForeignData( + foreigners, + field_popup, + false, + '', + '' + ) %} + + + {# Null checkbox if column can be null #} + + {# Column's Input box #} + + + {% endfor %} + +
    {% trans 'Column' %}{% trans 'Null' %}{% trans 'Value' %}
    {{ column_names[column_index] }} + {% if column_null_flags[column_index] == 'YES' %} + + {% endif %} + + {% include 'table/search/input_box.twig' with { + 'str': '', + 'column_type': column_types[column_index], + 'column_id': column_types[column_index] ? 'edit_fieldID_' : 'fieldID_', + 'in_zoom_search_edit': true, + 'foreigners': foreigners, + 'column_name': field_popup, + 'column_name_hash': md5(field_popup), + 'foreign_data': foreign_data, + 'table': table, + 'column_index': column_index, + 'foreign_max_limit': foreign_max_limit, + 'criteria_values': '', + 'db': db, + 'titles': titles, + 'in_fbs': false + } only %} +
    +
    + + diff --git a/phpMyAdmin/templates/table/secondary_tabs.twig b/phpMyAdmin/templates/table/secondary_tabs.twig new file mode 100755 index 0000000..a38b039 --- /dev/null +++ b/phpMyAdmin/templates/table/secondary_tabs.twig @@ -0,0 +1,17 @@ +{% if cfg_relation['relwork'] or is_foreign_key_supported %} +
      + {{ Util_getHtmlTab({ + 'icon': 'b_props', + 'link': 'tbl_structure.php', + 'text': 'Table structure'|trans, + 'id': 'table_strucuture_id' + }, url_params) }} + {{ Util_getHtmlTab({ + 'icon': 'b_relations', + 'link': 'tbl_relation.php', + 'text': 'Relation view'|trans, + 'id': 'table_relation_id' + }, url_params) }} +
    +
    +{% endif %} diff --git a/phpMyAdmin/templates/table/structure/action_row_in_structure_table.twig b/phpMyAdmin/templates/table/structure/action_row_in_structure_table.twig new file mode 100755 index 0000000..45bf4a3 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/action_row_in_structure_table.twig @@ -0,0 +1,31 @@ +
  • +{% if type == 'text' + or type == 'blob' + or tbl_storage_engine == 'ARCHIVE' + or has_field %} + {{ titles['No' ~ action]|raw }} +{% else %} + + {{ titles[action]|raw }} + +{% endif %} +
  • diff --git a/phpMyAdmin/templates/table/structure/actions_in_table_structure.twig b/phpMyAdmin/templates/table/structure/actions_in_table_structure.twig new file mode 100755 index 0000000..6607f85 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/actions_in_table_structure.twig @@ -0,0 +1,140 @@ +
      + {% if hide_structure_actions %} + + {% endif %} +
    diff --git a/phpMyAdmin/templates/table/structure/add_column.twig b/phpMyAdmin/templates/table/structure/add_column.twig new file mode 100755 index 0000000..1d53cc9 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/add_column.twig @@ -0,0 +1,24 @@ +
    + {{ Url_getHiddenInputs(db, table) }} + {% if Util_showIcons('ActionLinksMode') %} + {{ Util_getImage('b_insrow', 'Add column'|trans) }}  + {% endif %} + {% set num_fields -%} + + {%- endset %} + {{ 'Add %s column(s)'|trans|format(num_fields)|raw }} +   + {# I tried displaying the drop-down inside the label but with Firefox the drop-down was blinking #} + + +
    diff --git a/phpMyAdmin/templates/table/structure/check_all_table_column.twig b/phpMyAdmin/templates/table/structure/check_all_table_column.twig new file mode 100755 index 0000000..57e6e11 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/check_all_table_column.twig @@ -0,0 +1,93 @@ + diff --git a/phpMyAdmin/templates/table/structure/display_partitions.twig b/phpMyAdmin/templates/table/structure/display_partitions.twig new file mode 100755 index 0000000..efda933 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/display_partitions.twig @@ -0,0 +1,145 @@ +
    +
    + + {% trans 'Partitions' %} + {{ Util_showMySQLDocu('partitioning') }} + + {% if partitions is empty %} + {{ Message_notice('No partitioning defined!'|trans) }} + {% else %} +

    + {% trans 'Partitioned by:' %} + {{ partition_method }}({{ partition_expression }}) +

    + {% if has_sub_partitions %} +

    + {% trans 'Sub partitioned by:' %} + {{ sub_partition_method }}({{ sub_partition_expression }}) +

    + {% endif %} + + + + + + {% if has_description %} + + {% endif %} + + + + + + + + + {% for partition in partitions %} + + {% if has_sub_partitions %} + + + {% else %} + + {% endif %} + + {% if has_description %} + + {% endif %} + + + + + {% for action, icon in action_icons %} + + {% endfor %} + + {% if has_sub_partitions %} + {% for sub_partition in partition.getSubPartitions() %} + + + + + {% if has_description %} + + {% endif %} + + + + + + + {% endfor %} + {% endif %} + + {% endfor %} + +
    #{% trans 'Partition' %}{% trans 'Expression' %}{% trans 'Rows' %}{% trans 'Data length' %}{% trans 'Index length' %}{% trans 'Comment' %} + {% trans 'Action' %} +
    {{ partition.getOrdinal() }}{{ partition.getOrdinal() }}{{ partition.getName() }} + + {{- partition.getExpression() -}} + {{- partition.getMethod() == 'LIST' ? ' IN (' : ' < ' -}} + {{- partition.getDescription() -}} + {{- partition.getMethod() == 'LIST' ? ')' -}} + + {{ partition.getRows() }} + {% set data_length = Util_formatByteDown( + partition.getDataLength(), + 3, + 1 + ) %} + {{ data_length[0] }} + {{ data_length[1] }} + + {% set index_length = Util_formatByteDown( + partition.getIndexLength(), + 3, + 1 + ) %} + {{ index_length[0] }} + {{ index_length[1] }} + {{ partition.getComment() }} + + {{ icon|raw }} + +
    {{ sub_partition.getOrdinal() }}{{ sub_partition.getName() }}{{ sub_partition.getRows() }} + {% set data_length = Util_formatByteDown( + sub_partition.getDataLength(), + 3, + 1 + ) %} + {{ data_length[0] }} + {{ data_length[1] }} + + {% set index_length = Util_formatByteDown( + sub_partition.getIndexLength(), + 3, + 1 + ) %} + {{ index_length[0] }} + {{ index_length[1] }} + {{ sub_partition.getComment() }}
    + {% endif %} +

    + +
    diff --git a/phpMyAdmin/templates/table/structure/display_structure.twig b/phpMyAdmin/templates/table/structure/display_structure.twig new file mode 100755 index 0000000..7302f6b --- /dev/null +++ b/phpMyAdmin/templates/table/structure/display_structure.twig @@ -0,0 +1,227 @@ +
    + {{ Url_getHiddenInputs(db, table) }} + +
    + + {# Table header #} + {% include 'table/structure/table_structure_header.twig' with { + 'db_is_system_schema': db_is_system_schema, + 'tbl_is_view': tbl_is_view, + 'show_column_comments': show_column_comments + } only %} + + {# Table body #} + {% set rownum = 0 %} + {% set columns_list = [] %} + {% for row in fields %} + {% set rownum = rownum + 1 %} + {% set columns_list = columns_list|merge([row['Field']]) %} + {% set field_charset = row['Collation'] %} + + {% set extracted_columnspec = Util_extractColumnSpec(row['Type']) %} + {% set attribute = extracted_columnspec['attribute'] %} + {% if strpos(row['Extra'], 'on update CURRENT_TIMESTAMP') + is not same as(false) %} + {% set attribute = 'on update CURRENT_TIMESTAMP' %} + {% endif %} + + {% if row['Default'] is null %} + {% if row['Null'] == 'YES' %} + {% set row = row|merge({'Default': 'NULL'}) %} + {% endif %} + {% else %} + {% set row = row|merge({'Default': row['Default']|e}) %} + {% endif %} + + {% set field_name = row['Field']|e %} + {% set displayed_field_name = field_name %} + {# For column comments #} + {% set comments = '' %} + {# Underline commented fields and display a hover-title (CSS only) #} + + {% if comments_map[row['Field']] is defined %} + {% set displayed_field_name -%} + + {{- field_name|raw -}} + + {%- endset %} + {% set comments = comments_map[row['Field']] %} + {% endif %} + + {% if primary and primary.hasColumn(field_name) %} + {% set displayed_field_name = displayed_field_name ~ Util_getImage( + 'b_primary', 'Primary'|trans + ) %} + {% endif %} + {% if field_name in columns_with_index %} + {% set displayed_field_name = displayed_field_name ~ Util_getImage( + 'bd_primary', 'Index'|trans + ) %} + {% endif %} + + {% include 'table/structure/table_structure_row.twig' with { + 'row': row, + 'rownum': rownum, + 'displayed_field_name': preg_replace( + '/[\\x00-\\x1F]/', + '⁑', + displayed_field_name + ), + 'type_nowrap': Util_getClassForType(extracted_columnspec['type']), + 'extracted_columnspec': extracted_columnspec, + 'attribute': attribute, + 'tbl_is_view': tbl_is_view, + 'db_is_system_schema': db_is_system_schema, + 'url_query': url_query, + 'titles': titles, + 'table': table, + 'tbl_storage_engine': tbl_storage_engine, + 'field_charset': field_charset, + 'comments': comments, + 'show_column_comments': show_column_comments, + 'relation_commwork': relation_commwork, + 'relation_mimework': relation_mimework, + 'browse_mime': browse_mime + } only %} + {% if not tbl_is_view and not db_is_system_schema %} + {% include 'table/structure/actions_in_table_structure.twig' with { + 'row': row, + 'rownum': rownum, + 'extracted_columnspec': extracted_columnspec, + 'type': extracted_columnspec['print_type'] is not empty ? extracted_columnspec['print_type'], + 'tbl_storage_engine': tbl_storage_engine, + 'primary': primary, + 'field_name': field_name, + 'url_query': url_query, + 'titles': titles, + 'columns_with_unique_index': columns_with_unique_index, + 'is_in_central_columns': row['Field'] in central_list ? true : false, + 'central_columns_work': central_columns_work, + 'table': table, + 'hide_structure_actions': hide_structure_actions, + 'mysql_int_version': mysql_int_version + } only %} + {% endif %} + + {% endfor %} + +
    +
    + {% include 'table/structure/check_all_table_column.twig' with { + 'pma_theme_image': pma_theme_image, + 'text_dir': text_dir, + 'tbl_is_view': tbl_is_view, + 'db_is_system_schema': db_is_system_schema, + 'tbl_storage_engine': tbl_storage_engine, + 'central_columns_work': central_columns_work + } only %} +
    + +{% include 'table/structure/move_columns_dialog.twig' with { + 'db': db, + 'table': table +} only %} +{# Work on the table #} + +{% if not tbl_is_view and not db_is_system_schema %} + {% include 'table/structure/add_column.twig' with { + 'columns_list': columns_list, + 'db': db, + 'table': table + } only %} +{% endif %} + +{# Displays indexes #} +{% if not tbl_is_view and not db_is_system_schema + and 'ARCHIVE' != tbl_storage_engine %} + {{ Index_getHtmlForDisplayIndexes() }} +{% endif %} + +{# Display partition details #} +{% if have_partitioning %} + {# Detect partitioning #} + {% if partition_names is not empty and partition_names[0] is not null %} + {% set partitions = Partition_getPartitions(db, table) %} + {% set first_partition = partitions[0] %} + {% set range_or_list = first_partition.getMethod() == 'RANGE' + or first_partition.getMethod() == 'RANGE COLUMNS' + or first_partition.getMethod() == 'LIST' + or first_partition.getMethod() == 'LIST COLUMNS' %} + {% set sub_partitions = first_partition.getSubPartitions() %} + {% set has_sub_partitions = first_partition.hasSubPartitions() %} + {% if has_sub_partitions %} + {% set first_sub_partition = sub_partitions[0] %} + {% endif %} + + {% set action_icons = { + 'ANALYZE': Util_getIcon('b_search', 'Analyze'|trans), + 'CHECK': Util_getIcon('eye', 'Check'|trans), + 'OPTIMIZE': Util_getIcon('normalize', 'Optimize'|trans), + 'REBUILD': Util_getIcon('s_tbl', 'Rebuild'|trans), + 'REPAIR': Util_getIcon('b_tblops', 'Repair'|trans), + 'TRUNCATE': Util_getIcon('b_empty', 'Truncate'|trans), + } %} + {% if range_or_list %} + {% set action_icons = action_icons|merge({'DROP': Util_getIcon('b_drop', 'Drop'|trans)}) %} + {% endif %} + + {{ Util_getDivForSliderEffect('partitions', 'Partitions'|trans) }} + + {% set remove_sql = 'ALTER TABLE ' ~ Util_backquote(table) ~ ' REMOVE PARTITIONING' %} + + {% include 'table/structure/display_partitions.twig' with { + 'db': db, + 'table': table, + 'url_query': url_query, + 'partitions': partitions, + 'partition_method': first_partition.getMethod(), + 'partition_expression': first_partition.getExpression(), + 'has_description': first_partition.getDescription() is not empty, + 'has_sub_partitions': has_sub_partitions, + 'sub_partition_method': has_sub_partitions ? first_sub_partition.getMethod(), + 'sub_partition_expression': has_sub_partitions ? first_sub_partition.getExpression(), + 'action_icons': action_icons, + 'range_or_list': range_or_list, + 'remove_url_params': url_params|merge({'sql_query': remove_sql}) + } only %} + {% else %} + {% include 'table/structure/display_partitions.twig' with { + 'db': db, + 'table': table + } only %} + {% endif %} + {# For closing Slider effect div #} +
    +{% endif %} + +{# Displays Space usage and row statistics #} +{% if show_stats %} + {{ table_stats|raw }} +{% endif %} +
    diff --git a/phpMyAdmin/templates/table/structure/display_table_stats.twig b/phpMyAdmin/templates/table/structure/display_table_stats.twig new file mode 100755 index 0000000..14e6ab3 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/display_table_stats.twig @@ -0,0 +1,79 @@ +
    +
    + {% trans 'Information' %} + {% if showtable['TABLE_COMMENT'] %} +

    + {% trans 'Table comments:' %} + {{ showtable['TABLE_COMMENT'] }} +

    + {% endif %} + + + {% if not tbl_is_view and not db_is_system_schema %} + + + + + + + + + + {% if index_size is defined %} + + + + + + {% endif %} + + {% if free_size is defined %} + + + + + + + + + + + {% endif %} + + {% if tot_size is defined and mergetable == false %} + + + + + + {% endif %} + + {# Optimize link if overhead #} + {% if free_size is defined + and (tbl_storage_engine == 'MYISAM' + or tbl_storage_engine == 'ARIA' + or tbl_storage_engine == 'MARIA' + or tbl_storage_engine == 'BDB') %} + + + + {% endif %} + +
    {% trans 'Space usage' %}
    {% trans 'Data' %}{{ data_size }}{{ data_unit }}
    {% trans 'Index' %}{{ index_size }}{{ index_unit }}
    {% trans 'Overhead' %}{{ free_size }}{{ free_unit }}
    {% trans 'Effective' %}{{ effect_size }}{{ effect_unit }}
    {% trans 'Total' %}{{ tot_size }}{{ tot_unit }}
    + {% endif %} + + {% include 'table/structure/row_stats_table.twig' with { + 'showtable': showtable, + 'tbl_collation': tbl_collation, + 'is_innodb': is_innodb, + 'mergetable': mergetable, + 'avg_size': avg_size is defined ? avg_size : null, + 'avg_unit': avg_unit is defined ? avg_unit : null + } only %} +
    +
    diff --git a/phpMyAdmin/templates/table/structure/move_columns_dialog.twig b/phpMyAdmin/templates/table/structure/move_columns_dialog.twig new file mode 100755 index 0000000..7e7a8e2 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/move_columns_dialog.twig @@ -0,0 +1,9 @@ +
    +

    {% trans 'Move the columns by dragging them up and down.' %}

    +
    +
    + {{ Url_getHiddenInputs(db, table) }} +
      +
      +
      +
      diff --git a/phpMyAdmin/templates/table/structure/optional_action_links.twig b/phpMyAdmin/templates/table/structure/optional_action_links.twig new file mode 100755 index 0000000..262b612 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/optional_action_links.twig @@ -0,0 +1,34 @@ +{{ Util_getIcon('b_print', 'Print'|trans, true) }} +{% if not tbl_is_view and not db_is_system_schema %} + {# Only display propose table structure for MySQL < 8.0 #} + {% if mysql_int_version < 80000 or is_mariadb %} + + {{ Util_getIcon( + 'b_tblanalyse', + 'Propose table structure'|trans, + true + ) }} + + {{ Util_showMySQLDocu('procedure_analyse') }} + {% endif %} + {% if is_active %} + + {{ Util_getIcon('eye', 'Track table'|trans, true) }} + + {% endif %} + + {{ Util_getIcon('b_move', 'Move columns'|trans, true) }} + + + {{ Util_getIcon('normalize', 'Normalize'|trans, true) }} + +{% endif %} +{% if tbl_is_view and not db_is_system_schema %} + {% if is_active %} + + {{ Util_getIcon('eye', 'Track view'|trans, true) }} + + {% endif %} +{% endif %} diff --git a/phpMyAdmin/templates/table/structure/partition_definition_form.twig b/phpMyAdmin/templates/table/structure/partition_definition_form.twig new file mode 100755 index 0000000..186a6c7 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/partition_definition_form.twig @@ -0,0 +1,14 @@ +
      + {{ Url_getHiddenInputs(db, table) }} + + +
      + {% trans 'Edit partitioning' %} + {% include 'columns_definitions/partitions.twig' with { + 'partition_details': partition_details + } only %} +
      +
      + +
      +
      diff --git a/phpMyAdmin/templates/table/structure/row_stats_table.twig b/phpMyAdmin/templates/table/structure/row_stats_table.twig new file mode 100755 index 0000000..e176e90 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/row_stats_table.twig @@ -0,0 +1,95 @@ + + + + {% if showtable['Row_format'] is defined %} + + + {% if showtable['Row_format'] == 'Fixed' %} + + {% elseif showtable['Row_format'] == 'Dynamic' %} + + {% else %} + + {% endif %} + + {% endif %} + + {% if showtable['Create_options'] is not empty %} + + + {% if showtable['Create_options'] == 'partitioned' %} + + {% else %} + + {% endif %} + + {% endif %} + + {% if tbl_collation is not empty %} + + + + + {% endif %} + + {% if not is_innodb and showtable['Rows'] is defined %} + + + + + {% endif %} + + {% if not is_innodb + and showtable['Avg_row_length'] is defined + and showtable['Avg_row_length'] > 0 %} + + + {% set avg_row_length = Util_formatByteDown(showtable['Avg_row_length'], 6, 1) %} + + + {% endif %} + + {% if not is_innodb + and showtable['Data_length'] is defined + and showtable['Rows'] is defined + and showtable['Rows'] > 0 + and mergetable == false %} + + + + + {% endif %} + + {% if showtable['Auto_increment'] is defined %} + + + + + {% endif %} + + {% if showtable['Create_time'] is defined %} + + + + + {% endif %} + + {% if showtable['Update_time'] is defined %} + + + + + {% endif %} + + {% if showtable['Check_time'] is defined %} + + + + + {% endif %} + +
      {% trans 'Row statistics' %}
      {% trans 'Format' %}{% trans 'static' %}{% trans 'dynamic' %}{{ showtable['Row_format'] }}
      {% trans 'Options' %}{% trans 'partitioned' %}{{ showtable['Create_options'] }}
      {% trans 'Collation' %} + + {{ tbl_collation }} + +
      {% trans 'Rows' %}{{ Util_formatNumber(showtable['Rows'], 0) }}
      {% trans 'Row length' %}{{ avg_row_length[0] }} {{ avg_row_length[1] }}
      {% trans 'Row size' %}{{ avg_size }} {{ avg_unit }}
      {% trans 'Next autoindex' %}{{ Util_formatNumber(showtable['Auto_increment'], 0) }}
      {% trans 'Creation' %}{{ Util_localisedDate(showtable['Create_time']|date('U')) }}
      {% trans 'Last update' %}{{ Util_localisedDate(showtable['Update_time']|date('U')) }}
      {% trans 'Last check' %}{{ Util_localisedDate(showtable['Check_time']|date('U')) }}
      diff --git a/phpMyAdmin/templates/table/structure/table_structure_header.twig b/phpMyAdmin/templates/table/structure/table_structure_header.twig new file mode 100755 index 0000000..5af1298 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/table_structure_header.twig @@ -0,0 +1,21 @@ + + + + # + {% trans 'Name' %} + {% trans 'Type' %} + {% trans 'Collation' %} + {% trans 'Attributes' %} + {% trans 'Null' %} + {% trans 'Default' %} + {% if show_column_comments -%} + {% trans 'Comments' %} + {%- endif %} + {% trans 'Extra' %} + {# @see tbl_structure.js, function moreOptsMenuResize() #} + {% if not db_is_system_schema and not tbl_is_view %} + {% trans 'Action' %} + {% endif %} + + diff --git a/phpMyAdmin/templates/table/structure/table_structure_row.twig b/phpMyAdmin/templates/table/structure/table_structure_row.twig new file mode 100755 index 0000000..e6942d7 --- /dev/null +++ b/phpMyAdmin/templates/table/structure/table_structure_row.twig @@ -0,0 +1,59 @@ + + + +{{ rownum }} + + + + + + {{ extracted_columnspec['displayed_type']|raw }} + {% if relation_commwork and relation_mimework and browse_mime + and mime_map[row['Field']]['mimetype'] is defined %} +
      MIME: {{ mime_map[row['Field']]['mimetype']|replace({'_': '/'})|lower }} + {% endif %} +
      + + +{% if field_charset is not empty %} + {{ field_charset }} +{% endif %} + +{{ attribute }} +{{ row['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }} + + {% if row['Default'] is not null %} + {% if extracted_columnspec['type'] == 'bit' %} + {{ Util_convertBitDefaultValue(row['Default']) }} + {% else %} + {{ row['Default']|raw }} + {% endif %} + {% else %} + {% trans %}None{% context %}None for default{% endtrans %} + {% endif %} + +{% if show_column_comments %} + + {{ comments }} + +{% endif %} +{{ row['Extra']|upper }} +{% if not tbl_is_view and not db_is_system_schema %} + + + {{ titles['Change']|raw }} + + + + + {{ titles['Drop']|raw }} + + +{% endif %} diff --git a/phpMyAdmin/templates/table/tracking/activate_deactivate.twig b/phpMyAdmin/templates/table/tracking/activate_deactivate.twig new file mode 100755 index 0000000..5817e42 --- /dev/null +++ b/phpMyAdmin/templates/table/tracking/activate_deactivate.twig @@ -0,0 +1,27 @@ +
      +
      + {{ Url_getHiddenInputs(db, table) }} +
      + + {% if action == 'activate' %} + {% set legend = 'Activate tracking for %s'|trans %} + {% set value = 'activate_now' %} + {% set button = 'Activate now'|trans %} + {% elseif action == 'deactivate' %} + {% set legend = 'Deactivate tracking for %s'|trans %} + {% set value = 'deactivate_now' %} + {% set button = 'Deactivate now'|trans %} + {% else %} + {% set legend = '' %} + {% set value = '' %} + {% set button = '' %} + {% endif %} + + {{ legend|format(db ~ '.' ~ table) }} + + + + +
      +
      +
      diff --git a/phpMyAdmin/templates/table/tracking/create_version.twig b/phpMyAdmin/templates/table/tracking/create_version.twig new file mode 100755 index 0000000..4a65576 --- /dev/null +++ b/phpMyAdmin/templates/table/tracking/create_version.twig @@ -0,0 +1,79 @@ +
      +
      + {{ Url_getHiddenInputs(db) }} + {% for selected_table in selected %} + + {% endfor %} + +
      + + {% if selected|length == 1 %} + {{ 'Create version %1$s of %2$s'|trans|format( + last_version + 1, + db ~ '.' ~ selected[0] + ) }} + {% else %} + {{ 'Create version %1$s'|trans|format(last_version + 1) }} + {% endif %} + + +

      {% trans 'Track these data definition statements:' %}

      + + {% if type == 'both' or type == 'table' %} + + ALTER TABLE
      + + RENAME TABLE
      + + CREATE TABLE
      + + DROP TABLE
      + {% endif %} + {% if type == 'both' %} +
      + {% endif %} + {% if type == 'both' or type == 'view' %} + + ALTER VIEW
      + + CREATE VIEW
      + + DROP VIEW
      + {% endif %} +
      + + + CREATE INDEX
      + + DROP INDEX
      + +

      {% trans 'Track these data manipulation statements:' %}

      + + INSERT
      + + UPDATE
      + + DELETE
      + + TRUNCATE
      +
      + +
      + + +
      +
      +
      diff --git a/phpMyAdmin/templates/table/tracking/report_table.twig b/phpMyAdmin/templates/table/tracking/report_table.twig new file mode 100755 index 0000000..fe00526 --- /dev/null +++ b/phpMyAdmin/templates/table/tracking/report_table.twig @@ -0,0 +1,27 @@ + + + + + + + + + + + + {% for entry in entries %} + + + + + + + + {% endfor %} + +
      {% trans %}#{% context %}Number{% endtrans %}{% trans 'Date' %}{% trans 'Username' %}{{ header_message }}{% trans 'Action' %}
      {{ entry.line_number }}{{ entry.date }}{{ entry.username }}{{ entry.formated_statement|raw }} + + {{ drop_image_or_text|raw }} + +
      diff --git a/phpMyAdmin/templates/table/tracking/selectable_tables.twig b/phpMyAdmin/templates/table/tracking/selectable_tables.twig new file mode 100755 index 0000000..eca71bf --- /dev/null +++ b/phpMyAdmin/templates/table/tracking/selectable_tables.twig @@ -0,0 +1,17 @@ +
      + {{ Url_getHiddenInputs(db, table) }} + + +
      diff --git a/phpMyAdmin/templates/table/tracking/structure_snapshot_columns.twig b/phpMyAdmin/templates/table/tracking/structure_snapshot_columns.twig new file mode 100755 index 0000000..c98dfbe --- /dev/null +++ b/phpMyAdmin/templates/table/tracking/structure_snapshot_columns.twig @@ -0,0 +1,56 @@ +

      {% trans 'Structure' %}

      + + + + + + + + + + + + + + + {% set index = 1 %} + {% for field in columns %} + + + {% set index = index + 1 %} + + + + + + + + + {% endfor %} + +
      {% trans %}#{% context %}Number{% endtrans %}{% trans 'Column' %}{% trans 'Type' %}{% trans 'Collation' %}{% trans 'Null' %}{% trans 'Default' %}{% trans 'Extra' %}{% trans 'Comment' %}
      {{ index }} + + {{ field['Field'] }} + {% if field['Key'] == 'PRI' %} + {{ Util_getImage('b_primary', 'Primary'|trans) }} + {% elseif field['Key'] is not empty %} + {{ Util_getImage('bd_primary', 'Index'|trans) }} + {% endif %} + + {{ field['Type'] }}{{ field['Collation'] }}{{ field['Null'] == 'YES' ? 'Yes'|trans : 'No'|trans }} + {% if field['Default'] is defined %} + {% set extracted_columnspec = Util_extractColumnSpec(field['Type']) %} + {% if extracted_columnspec['type'] == 'bit' %} + {# here, $field['Default'] contains something like b'010' #} + {{ Util_convertBitDefaultValue(field['Default']) }} + {% else %} + {{ field['Default'] }} + {% endif %} + {% else %} + {% if field['Null'] == 'YES' %} + NULL + {% else %} + {% trans %}None{% context %}None for default{% endtrans %} + {% endif %} + {% endif %} + {{ field['Extra'] }}{{ field['Comment'] }}
      diff --git a/phpMyAdmin/templates/table/tracking/structure_snapshot_indexes.twig b/phpMyAdmin/templates/table/tracking/structure_snapshot_indexes.twig new file mode 100755 index 0000000..a919252 --- /dev/null +++ b/phpMyAdmin/templates/table/tracking/structure_snapshot_indexes.twig @@ -0,0 +1,33 @@ +

      {% trans 'Indexes' %}

      + + + + + + + + + + + + + + + + {% for index in indexes %} + + + + + + + + + + + + {% endfor %} + +
      {% trans 'Keyname' %}{% trans 'Type' %}{% trans 'Unique' %}{% trans 'Packed' %}{% trans 'Column' %}{% trans 'Cardinality' %}{% trans 'Collation' %}{% trans 'Null' %}{% trans 'Comment' %}
      + {{ index['Key_name'] }} + {{ index['Index_type'] }}{{ index['Non_unique'] == 0 ? 'Yes'|trans : 'No'|trans }}{{ index['Packed'] != '' ? 'Yes'|trans : 'No'|trans }}{{ index['Column_name'] }}{{ index['Cardinality'] }}{{ index['Collation'] }}{{ index['Null'] }}{{ index['Comment'] }}
      diff --git a/phpMyAdmin/templates/test/add_data.twig b/phpMyAdmin/templates/test/add_data.twig new file mode 100755 index 0000000..d562612 --- /dev/null +++ b/phpMyAdmin/templates/test/add_data.twig @@ -0,0 +1,2 @@ +{{ variable1 }} +{{ variable2 }} diff --git a/phpMyAdmin/templates/test/echo.twig b/phpMyAdmin/templates/test/echo.twig new file mode 100755 index 0000000..9c5fc60 --- /dev/null +++ b/phpMyAdmin/templates/test/echo.twig @@ -0,0 +1 @@ +{{ variable -}} diff --git a/phpMyAdmin/templates/test/gettext/gettext.twig b/phpMyAdmin/templates/test/gettext/gettext.twig new file mode 100755 index 0000000..4fcf61b --- /dev/null +++ b/phpMyAdmin/templates/test/gettext/gettext.twig @@ -0,0 +1 @@ +{% trans "Text" %} diff --git a/phpMyAdmin/templates/test/gettext/notes.twig b/phpMyAdmin/templates/test/gettext/notes.twig new file mode 100755 index 0000000..e5a38e4 --- /dev/null +++ b/phpMyAdmin/templates/test/gettext/notes.twig @@ -0,0 +1,5 @@ +{% trans %} +Text +{% notes %} +Notes +{% endtrans %} diff --git a/phpMyAdmin/templates/test/gettext/pgettext.twig b/phpMyAdmin/templates/test/gettext/pgettext.twig new file mode 100755 index 0000000..5365027 --- /dev/null +++ b/phpMyAdmin/templates/test/gettext/pgettext.twig @@ -0,0 +1,5 @@ +{% trans %} +Text +{% context %} +Text context +{% endtrans %} diff --git a/phpMyAdmin/templates/test/gettext/plural.twig b/phpMyAdmin/templates/test/gettext/plural.twig new file mode 100755 index 0000000..5bc44e9 --- /dev/null +++ b/phpMyAdmin/templates/test/gettext/plural.twig @@ -0,0 +1,5 @@ +{% trans %} +One table +{% plural table_count %} +{{ count }} tables +{% endtrans %} diff --git a/phpMyAdmin/templates/test/gettext/plural_notes.twig b/phpMyAdmin/templates/test/gettext/plural_notes.twig new file mode 100755 index 0000000..0c6da18 --- /dev/null +++ b/phpMyAdmin/templates/test/gettext/plural_notes.twig @@ -0,0 +1,7 @@ +{% trans %} +One table +{% plural table_count %} +{{ count }} tables +{% notes %} +Number of tables +{% endtrans %} diff --git a/phpMyAdmin/templates/test/static.twig b/phpMyAdmin/templates/test/static.twig new file mode 100755 index 0000000..703390d --- /dev/null +++ b/phpMyAdmin/templates/test/static.twig @@ -0,0 +1 @@ +static content \ No newline at end of file diff --git a/phpMyAdmin/templates/theme_preview.twig b/phpMyAdmin/templates/theme_preview.twig new file mode 100755 index 0000000..9ec60ea --- /dev/null +++ b/phpMyAdmin/templates/theme_preview.twig @@ -0,0 +1,16 @@ + diff --git a/phpMyAdmin/templates/toggle_button.twig b/phpMyAdmin/templates/toggle_button.twig new file mode 100755 index 0000000..2a7cc1e --- /dev/null +++ b/phpMyAdmin/templates/toggle_button.twig @@ -0,0 +1,24 @@ +
      +
      +
      + + + + + + + + + +
      + {{ link_on|raw }} +
      {{ toggle_on }}
      +
       
      + {{ link_off|raw }} +
      {{ toggle_off }}
      +
      + {{ callback }} + {{ text_dir }} +
      +
      +
      diff --git a/phpMyAdmin/templates/view_create.twig b/phpMyAdmin/templates/view_create.twig new file mode 100755 index 0000000..a89b795 --- /dev/null +++ b/phpMyAdmin/templates/view_create.twig @@ -0,0 +1,120 @@ + +
      +
      + {{ Url_getHiddenInputs(url_params) }} +
      + + {% if ajax_dialog %} + {% trans 'Details' %} + {% else %} + {% if view['operation'] == 'create' %} + {% trans 'Create view' %} + {% else %} + {% trans 'Edit view' %} + {% endif %} + {% endif %} + + + {% if view['operation'] == 'create' %} + + + + + {% endif %} + + + + + + + + + + + + + + + + + {% if view['operation'] == 'create' %} + + + + + {% else %} + + + + {% endif %} + + + + + + + + + + + + + + + + +
      + +
      + +
      {% trans 'Definer' %}
      SQL SECURITY + +
      {% trans 'VIEW name' %} + +
      + +
      {% trans 'Column names' %} + +
      AS +
      + + +
      WITH CHECK OPTION + +
      +
      + + + + + {% if ajax_dialog == false %} + + + {% endif %} + +
      +
      diff --git a/phpMyAdmin/themes.php b/phpMyAdmin/themes.php new file mode 100755 index 0000000..760015b --- /dev/null +++ b/phpMyAdmin/themes.php @@ -0,0 +1,35 @@ +getFooter()->setMinimal(); +$header = $response->getHeader(); +$header->setBodyId('bodythemes'); +$header->setTitle('phpMyAdmin - ' . __('Theme')); +$header->disableMenuAndConsole(); + +$hash = '#pma_' . preg_replace('/([0-9]*)\.([0-9]*)\..*/', '\1_\2', PMA_VERSION); +$url = Core::linkURL('https://www.phpmyadmin.net/themes/') . $hash; +$output = '

      phpMyAdmin - ' . __('Theme') . '

      '; +$output .= '

      '; +$output .= ''; +$output .= __('Get more themes!'); +$output .= ''; +$output .= '

      '; +$output .= ThemeManager::getInstance()->getPrintPreviews(); + +$response->addHTML($output); diff --git a/phpMyAdmin/themes/dot.gif b/phpMyAdmin/themes/dot.gif new file mode 100755 index 0000000..35d42e8 Binary files /dev/null and b/phpMyAdmin/themes/dot.gif differ diff --git a/phpMyAdmin/themes/original/css/common.css.php b/phpMyAdmin/themes/original/css/common.css.php new file mode 100755 index 0000000..4db4618 --- /dev/null +++ b/phpMyAdmin/themes/original/css/common.css.php @@ -0,0 +1,3448 @@ + +/******************************************************************************/ + +/* general tags */ +html { + font-size: getFontSize(); ?> +} + +input, +select, +textarea { + font-size: 1em; +} + + +body { + + font-family: ; + + padding: 0; + margin: 0; + margin-: 240px; + color: ; + background: ; +} + +body#loginform { + margin: 0; +} + +#page_content { + margin: 0 .5em; +} + +.desktop50 { + width: 50%; +} + +.all100 { + width: 100%; +} + +.all85{ + width: 85%; +} + +.auth_config_tbl{ + margin: 0 auto; +} + + + textarea, tt, pre, code { + font-family: ; + } + +h1 { + font-size: 140%; + font-weight: bold; +} + +h2 { + font-size: 120%; + font-weight: bold; +} + +h3 { + font-weight: bold; +} + +a, a:link, +a:visited, +a:active, +button.mult_submit, +.checkall_box+label { + text-decoration: none; + color: #0000FF; + cursor: pointer; +} + +a:hover, +button.mult_submit:hover, +button.mult_submit:focus, +.checkall_box+label:hover { + text-decoration: underline; + color: #FF0000; +} + +dfn { + font-style: normal; +} + +dfn:hover { + font-style: normal; + cursor: help; +} + +th { + font-weight: bold; + color: ; + background: ; +} + +a img { + border: 0; +} + +hr { + color: ; + background-color: ; + border: 0; + height: 1px; +} + +form { + padding: 0; + margin: 0; + display: inline; +} + +textarea { + overflow: visible; +} + +fieldset { + margin-top: 1em; + border: solid 1px; + padding: 0.5em; + background: ; +} + +fieldset fieldset { + margin: 0.8em; +} + +fieldset legend { + font-weight: bold; + color: #444444; + background-color: ; +} + +.some-margin { + margin: .5em; + margin-top: 1em; +} + +/* buttons in some browsers (eg. Konqueror) are block elements, + this breaks design */ +button { + display: inline; +} + +table caption, +table th, +table td { + padding: 0.1em 0.5em 0.1em 0.5em; + margin: 0.1em; + vertical-align: top; +} + +img, +input, +select, +button { + vertical-align: middle; +} + +/******************************************************************************/ +/* classes */ +.clearfloat { + clear: both; +} + +.floatleft { + float: ; + margin-: 1em; +} + +.floatright { + float: ; +} + +table.nospacing { + border-spacing: 0; +} + +table.nopadding tr th, table.nopadding tr td { + padding: 0; +} + +th.left, td.left { + text-align: left; +} + +th.center, td.center { + text-align: center; +} + +th.right, td.right { + text-align: right; + padding-right: 1em; +} + +tr.vtop, th.vtop, td.vtop { + vertical-align: top; +} + +tr.vmiddle, th.vmiddle, td.vmiddle { + vertical-align: middle; +} + +tr.vbottom, th.vbottom, td.vbottom { + vertical-align: bottom; +} + +.paddingtop { + padding-top: 1em; +} + +div.tools { + border: 1px solid #000000; + padding: 0.2em; +} + +div.tools, +fieldset.tblFooters { + margin-top: 0; + margin-bottom: 0.5em; + /* avoid a thick line since this should be used under another fieldset */ + border-top: 0; + text-align: ; + float: none; + clear: both; +} + +div.null_div { + height: 20px; + text-align: center; + font-style:normal; + min-width:50px; +} + +fieldset .formelement { + float: ; + margin-: 0.5em; + /* IE */ + white-space: nowrap; +} + +/* revert for Gecko */ +fieldset div[class=formelement] { + white-space: normal; +} + +button.mult_submit { + border: none; + background-color: transparent; +} + +/* odd items 1,3,5,7,... */ +table tr:nth-child(odd), +#table_index tbody:nth-of-type(odd) tr, +#table_index tbody:nth-of-type(odd) th { + background: ; +} + +/* even items 2,4,6,8,... */ +table tr:nth-child(even), +#table_index tbody:nth-of-type(even) tr, +#table_index tbody:nth-of-type(even) th { + background: ; +} + +table tr th, +table tr { + text-align: ; +} + +/* marked table rows */ +td.marked:not(.nomarker), +table tr.marked:not(.nomarker) td, +table tr.marked:not(.nomarker) th, +table tr.marked:not(.nomarker) { + background: ; + color: ; +} + +/* hovered items */ +table tr:not(.nopointer):hover, +.hover:not(.nopointer) { + background: ; + color: ; +} + +/* hovered table rows */ +#table_index tbody:hover tr, +#table_index tbody:hover th, +table tr.hover:not(.nopointer) th { + background: ; + color: ; +} + +/** + * marks table rows/cells if the db field is in a where condition + */ +td.condition, +th.condition { + border: 1px solid ; +} + +/** + * cells with the value NULL + */ +td.null { + font-style: italic; + color: #7d7d7d; +} + +table .valueHeader { + text-align: ; + white-space: normal; +} +table .value { + text-align: ; + white-space: normal; +} +/* IE doesnt handles 'pre' right */ +table [class=value] { + white-space: normal; +} + + + + .value { + font-family: ; + } + +.attention { + color: red; + font-weight: bold; +} +.allfine { + color: green; +} + + +img.lightbulb { + cursor: pointer; +} + +.pdflayout { + overflow: hidden; + clip: inherit; + background-color: #FFFFFF; + display: none; + border: 1px solid #000000; + position: relative; +} + +.pdflayout_table { + background: #D3DCE3; + color: #000000; + overflow: hidden; + clip: inherit; + z-index: 2; + display: inline; + visibility: inherit; + cursor: move; + position: absolute; + font-size: 80%; + border: 1px dashed #000000; +} + +/* Doc links in SQL */ +.cm-sql-doc { + text-decoration: none; + border-bottom: 1px dotted #000; + color: inherit !important; +} + +/* leave some space between icons and text */ +.icon { + image-rendering: pixelated; + vertical-align: middle; + margin-: 0.3em; + background-repeat: no-repeat; + background-position: center; +} + +/* no extra space in table cells */ +td .icon { + margin: 0; +} + +.selectallarrow { + margin-: 0.3em; + margin-: 0.6em; +} + +/* message boxes: error, confirmation */ +#pma_errors, #pma_demo, #pma_footer { + position: relative; + padding: 0 0.5em; +} + +.success h1, +.notice h1, +div.error h1 { + border-bottom: 2px solid; + font-weight: bold; + text-align: ; + margin: 0 0 0.2em 0; +} + +div.success, +div.notice, +div.error { + margin: 0.3em 0 0 0; + border: 2px solid; + background-repeat: no-repeat; + clear: both; + + background-position: 10px 50%; + padding: 0.1em 0.1em 0.1em 42px; + + background-position: 99% 50%; + padding: 0.1em 40px 0.1em 0.1em; + +} +div.success img.icon, +div.notice img.icon, +div.error img.icon { + display: block; + float: ; + margin-: -22px; +} + +.success { + color: #000000; + background-color: #f0fff0; +} +h1.success, +div.success { + border-color: #00FF00; +} +.success h1 { + border-color: #00FF00; +} + +.notice { + color: #000000; + background-color: #FFFFDD; +} +h1.notice, +div.notice { + border-color: #FFD700; +} +.notice h1 { + border-color: #FFD700; +} + +.error { + background-color: #FFFFCC; + color: #ff0000; +} + +h1.error, +div.error { + border-color: #ff0000; +} +div.error h1 { + border-color: #ff0000; +} + +.confirmation { + background-color: #FFFFCC; +} +fieldset.confirmation { + border: 0.1em solid #FF0000; +} +fieldset.confirmation legend { + border-left: 0.1em solid #FF0000; + border-right: 0.1em solid #FF0000; + font-weight: bold; + background-image: url(getImgPath('s_really.png');?>); + background-repeat: no-repeat; + + background-position: 5px 50%; + padding: 0.2em 0.2em 0.2em 25px; + + background-position: 97% 50%; + padding: 0.2em 25px 0.2em 0.2em; + +} +/* end messageboxes */ + +.new_central_col{ + width: 100%; +} + +.tblcomment { + font-size: 70%; + font-weight: normal; + color: #000099; +} + +.tblHeaders { + font-weight: bold; + color: ; + background: ; +} + +div.tools, +.tblFooters { + font-weight: normal; + color: ; + background: ; +} + +.tblHeaders a:link, +.tblHeaders a:active, +.tblHeaders a:visited, +div.tools a:link, +div.tools a:visited, +div.tools a:active, +.tblFooters a:link, +.tblFooters a:active, +.tblFooters a:visited { + color: #0000FF; +} + +.tblHeaders a:hover, +div.tools a:hover, +.tblFooters a:hover { + color: #FF0000; +} + +/* forbidden, no privilegs */ +.noPrivileges { + color: #FF0000; + font-weight: bold; +} + +/* disabled text */ +.disabled, +.disabled a:link, +.disabled a:active, +.disabled a:visited { + color: #666666; +} + +.disabled a:hover { + color: #666666; + text-decoration: none; +} + +tr.disabled td, +td.disabled { + background-color: #cccccc; +} + +.nowrap { + white-space: nowrap; +} + +/** + * zoom search + */ +div#resizer { + width: 600px; + height: 400px; +} +div#querychart { + float: left; + width: 600px; +} + +/** + * login form + */ +body#loginform h1, +body#loginform a.logo { + display: block; + text-align: center; +} + +body#loginform { + margin-top: 1em; + text-align: center; +} + +body#loginform div.container { + text-align: ; + width: 30em; + margin: 0 auto; +} + +form.login label { + float: ; + width: 10em; + font-weight: bolder; +} + +.commented_column { + border-bottom: 1px dashed black; +} + +.column_attribute { + font-size: 70%; +} + +.cfg_dbg_demo{ + margin: 0.5em 1em 0.5em 1em; +} + +.central_columns_navigation{ + padding:1.5% 0em !important; +} + +.central_columns_add_column{ + display:inline-block; + margin-left:1%; + max-width:50% +} + +.message_errors_found{ + margin-top: 20px; +} + +.repl_gui_skip_err_cnt{ + width: 30px; +} + +.font_weight_bold{ + font-weight: bold; +} + +.color_gray{ + color: gray; +} + +.pma_sliding_message{ + display: inline-block; +} + +li.last.database{ + margin-bottom: 20px !important; +} + +/******************************************************************************/ +/* specific elements */ + +/* topmenu */ +ul#topmenu, ul#topmenu2, ul.tabs { + font-weight: bold; + list-style-type: none; + margin: 0; + padding: 0; +} + +ul#topmenu2 { + margin: 0.25em 0.5em 0; + height: 2em; + clear: both; +} + +ul#topmenu li, ul#topmenu2 li { + float: ; + margin: 0; + padding: 0; + vertical-align: middle; +} + +#topmenu img, #topmenu2 img { + vertical-align: middle; + margin-: 0.1em; +} + +/* default tab styles */ +ul#topmenu a, ul#topmenu span { + display: block; + margin: 2px 2px 0; + padding: 2px 2px 0; + white-space: nowrap; +} + +ul#topmenu2 a { + display: block; + margin: 0.1em; + padding: 0.2em; + white-space: nowrap; +} + +span.caution { + color: #FF0000; +} +fieldset.caution a { + color: #FF0000; +} +fieldset.caution a:hover { + color: #ffffff; + background-color: #FF0000; +} + +#topmenu { + margin-top: 0.5em; + padding: 0.1em 0.3em 0.1em 0.3em; +} + +ul#topmenu ul { + -moz-box-shadow: 2px 2px 3px #666; + -webkit-box-shadow: 2px 2px 3px #666; + box-shadow: 2px 2px 3px #666; +} + +ul#topmenu > li { + border-bottom: 1pt solid black; +} + +/* default tab styles */ +ul#topmenu a, ul#topmenu span { + background-color: ; + border: 0 solid ; + border-width: 1pt 1pt 0 1pt; + -moz-border-radius: 0.4em 0.4em 0 0; + border-radius: 0.4em 0.4em 0 0; +} + +ul#topmenu ul a { + border-width: 1pt 0 0 0; + -moz-border-radius: 0; + border-radius: 0; +} + +ul#topmenu ul li:first-child a { + border-width: 0; +} + +/* enabled hover/active tabs */ +ul#topmenu > li > a:hover, +ul#topmenu > li > .tabactive { + margin: 0; + padding: 2px 4px; + text-decoration: none; +} + +ul#topmenu ul a:hover, +ul#topmenu ul .tabactive { + text-decoration: none; +} + +ul#topmenu a.tab:hover, +ul#topmenu .tabactive { + background-color: ; +} + +ul#topmenu2 a.tab:hover, +ul#topmenu2 a.tabactive { + background-color: ; + -moz-border-radius: 0.3em; + border-radius: 0.3em; + text-decoration: none; +} + +/* to be able to cancel the bottom border, use
    • */ +ul#topmenu > li.active { + border-bottom: 1pt solid ; +} +/* end topmenu */ + +/* zoom search */ +div#dataDisplay input, div#dataDisplay select { + margin: 0; + margin-: 0.5em; +} +div#dataDisplay th { + line-height: 2em; +} +table#tableFieldsId { + width: 100%; +} + +/* Calendar */ +table.calendar { + width: 100%; +} +table.calendar td { + text-align: center; +} +table.calendar td a { + display: block; +} + +table.calendar td a:hover { + background-color: #CCFFCC; +} + +table.calendar th { + background-color: #D3DCE3; +} + +table.calendar td.selected { + background-color: #FFCC99; +} + +img.calendar { + border: none; +} +form.clock { + text-align: center; +} +/* end Calendar */ + + +/* table stats */ +div#tablestatistics table { + float: ; + margin-top: 0.5em; + margin-bottom: 0.5em; + margin-: 0.5em; + min-width: 16em; +} +/* end table stats */ + + +/* server privileges */ +#tableuserrights td, +#tablespecificuserrights td, +#tabledatabases td { + vertical-align: middle; +} +/* end server privileges */ + + + +/* Heading */ +#topmenucontainer { + background: white; + padding-: 1em; + width: 100%; +} + +#serverinfo { + background: white; + font-weight: bold; + padding-bottom: 0.5em; + padding-: 2.2em; + width: 10000px; + overflow: hidden; +} + +#serverinfo .item { + white-space: nowrap; +} + +#page_nav_icons { + position: fixed; + top: 0; + : 0; + z-index: 99; + padding: .1em 0; +} + +#goto_pagetop, #lock_page_icon, #page_settings_icon { + padding: .3em; + background: white; +} + +#page_settings_icon { + cursor: pointer; + display: none; +} + +#page_settings_modal { + display: none; +} + +#pma_navigation_settings { + display: none; +} + +#span_table_comment { + font-weight: bold; + font-style: italic; + white-space: nowrap; + margin-left: 10px; + color: #D6D6D6; + text-shadow: none; +} + +#serverinfo img { + margin: 0 0.1em 0 0.2em; +} + + +#textSQLDUMP { + width: 95%; + height: 95%; + font-family: "Courier New", Courier, mono; + font-size: 110%; +} + +#TooltipContainer { + position: absolute; + z-index: 99; + width: 20em; + height: auto; + overflow: visible; + visibility: hidden; + background-color: #ffffcc; + color: #006600; + border: 0.1em solid #000000; + padding: 0.5em; +} + +/* user privileges */ +#fieldset_add_user_login div.item { + border-bottom: 1px solid silver; + padding-bottom: 0.3em; + margin-bottom: 0.3em; +} + +#fieldset_add_user_login label { + float: ; + display: block; + width: 15em; + max-width: 100%; + text-align: ; + padding-: 0.5em; +} + +#fieldset_add_user_login span.options #select_pred_username, +#fieldset_add_user_login span.options #select_pred_hostname, +#fieldset_add_user_login span.options #select_pred_password { + width: 100%; + max-width: 100%; +} + +#fieldset_add_user_login span.options { + float: ; + display: block; + width: 12em; + max-width: 100%; + padding-: 0.5em; +} + +#fieldset_add_user_login input { + width: 12em; + clear: ; + max-width: 100%; +} + +#fieldset_add_user_login span.options input { + width: auto; +} + +#fieldset_user_priv div.item { + float: ; + width: 9em; + max-width: 100%; +} + +#fieldset_user_priv div.item div.item { + float: none; +} + +#fieldset_user_priv div.item label { + white-space: nowrap; +} + +#fieldset_user_priv div.item select { + width: 100%; +} + +#fieldset_user_global_rights fieldset { + float: ; +} + +#fieldset_user_group_rights fieldset { + float: ; +} + +#fieldset_user_global_rights>legend input { + margin-: 2em; +} +/* end user privileges */ + + +/* serverstatus */ + +.linkElem:hover { + text-decoration: underline; + color: #235a81; + cursor: pointer; +} + +h3#serverstatusqueries span { + font-size:60%; + display:inline; +} + +.buttonlinks { + float: ; + white-space: nowrap; +} + +/* Also used for the variables page */ +fieldset#tableFilter { + padding: 0.1em 1em; +} + +div#serverStatusTabs { + margin-top:1em; +} + +caption a.top { + float: ; +} + +div#serverstatusquerieschart { + float: ; + width: 500px; + height: 350px; + margin-: 50px; +} + +div#serverstatus table#serverstatusqueriesdetails { + float: ; +} + +table#serverstatustraffic { + float: ; +} +table#serverstatusconnections { + float: ; + margin-: 30px; +} + +table#serverstatusvariables { + width: 100%; + margin-bottom: 1em; +} +table#serverstatusvariables .name { + width: 18em; + white-space:nowrap; +} +table#serverstatusvariables .value { + width: 6em; +} +table#serverstatusconnections { + float: ; + margin-: 30px; +} + +div#serverstatus table tbody td.descr a, +div#serverstatus table .tblFooters a { + white-space: nowrap; +} + +div.liveChart { + clear:both; + min-width:500px; + height:400px; + padding-bottom:80px; +} + +#addChartDialog input[type="text"] { + margin: 0; + padding:3px; +} + +div#chartVariableSettings { + border:1px solid #ddd; + background-color:#E6E6E6; + margin-left:10px; +} + +table#chartGrid td { + padding: 3px; + margin: 0; +} + +table#chartGrid div.monitorChart { + background: #EBEBEB; + overflow: hidden; + border: none; +} + +div.tabLinks { + margin-left: 0.3em; + float: ; + padding: 5px 0; +} + +div.tabLinks a, div.tabLinks label { + margin-right: 7px; +} + +div.tabLinks .icon { + margin: -0.2em 0.3em 0 0; +} + +.popupContent { + display: none; + position: absolute; + border: 1px solid #CCC; + margin:0; + padding:3px; + -moz-box-shadow: 1px 1px 6px #ddd; + -webkit-box-shadow: 2px 2px 3px #666; + box-shadow: 2px 2px 3px #666; + background-color:white; + z-index: 2; +} + +div#logTable { + padding-top: 10px; + clear: both; +} + +div#logTable table { + width:100%; +} + +.smallIndent { + padding-left: 7px; +} + +/* end serverstatus */ + +#sectionlinks { + margin-bottom: 15px; + padding: 10px; + border: 1px solid #CCC; +} +#sectionlinks a { + margin-: 7px; +} + +/* server variables */ +#serverVariables { + width: 100%; +} +#serverVariables .var-row > tr { + line-height: 2em; +} + +#serverVariables .var-header { + font-weight: bold; + color: ; + background: ; + text-align: ; +} +#serverVariables .var-row { + padding: 0.5em; + min-height: 18px; +} +#serverVariables .var-name { + font-weight: bold; +} +#serverVariables .var-name.session { + font-weight: normal; + font-style: italic; +} +#serverVariables .var-value { + text-align: ; + float: ; +} + +/* server variables editor */ +#serverVariables .editLink { + padding-: 1em; + font-family: sans-serif; +} +#serverVariables .serverVariableEditor { + width: 100%; + overflow: hidden; +} +#serverVariables .serverVariableEditor input { + width: 100%; + margin: 0 0.5em; + box-sizing: border-box; + -ms-box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + height: 2.2em; +} +#serverVariables .serverVariableEditor div { + display: block; + overflow: hidden; + padding-: 1em; +} +#serverVariables .serverVariableEditor a { + margin: 0 0.5em; + line-height: 2em; +} +/* end server variables */ + +/* profiling */ + +div#profilingchart { + width: 850px; + height: 370px; + float: left; +} + +#profilingchart .jqplot-highlighter-tooltip{ + top: auto !important; + left: 11px; + bottom:24px; +} +/* end profiling */ + +/* table charting */ +.chartOption { + float: ; + margin-: 40px; +} +/* end table charting */ + +/* querybox */ + +div#sqlquerycontainer { + float: ; + width: 69%; + /* height: 15em; */ +} + +div#tablefieldscontainer { + float: ; + width: 29%; + /* height: 15em; */ +} + +div#tablefieldscontainer select { + width: 100%; + /* height: 12em; */ +} + +textarea#sqlquery { + width: 100%; + /* height: 100%; */ +} +textarea#sql_query_edit { + height: 7em; + width: 95%; + display: block; +} +div#queryboxcontainer div#bookmarkoptions { + margin-top: .5em; +} +/* end querybox */ + +/* main page */ +#maincontainer { + background-image: url(getImgPath('logo_right.png');?>); + background-position: bottom; + background-repeat: no-repeat; +} + +#mysqlmaininformation, +#pmamaininformation { + float: ; + width: 49%; +} + +#maincontainer ul { + list-style-type: disc; + vertical-align: middle; +} + +#maincontainer li { + margin: 0.2em 0; +} + +#full_name_layer { + position: absolute; + padding: 2px; + margin-top: -3px; + z-index: 801; + + border: solid 1px #888; + background: #fff; + +} +/* end main page */ + +/* iconic view for ul items */ + +li.no_bullets { + list-style-type:none !important; + margin-: -25px !important; //align with other list items which have bullets +} + +/* end iconic view for ul items */ + +#body_browse_foreigners { + background: ; + margin: .5em .5em 0 .5em; +} + +#bodythemes { + width: 500px; + margin: auto; + text-align: center; +} + +#bodythemes img { + border: .1em solid #000; +} + +#bodythemes a:hover img { + border: .1em solid red; +} + +#fieldset_select_fields { + float: ; +} + +#selflink { + clear: both; + display: block; + margin-top: 1em; + margin-bottom: 1em; + width: 98%; + margin-left: 1%; + border-top: .1em solid silver; + text-align: ; +} + +#table_innodb_bufferpool_usage, +#table_innodb_bufferpool_activity { + float: ; +} + +#div_mysql_charset_collations table { + float: ; +} + +#div_mysql_charset_collations table th, +#div_mysql_charset_collations table td { + padding: 0.4em; +} + +#div_mysql_charset_collations table th#collationHeader { + width: 35%; +} + +#qbe_div_table_list { + float: ; +} + +#qbe_div_sql_query { + float: ; +} + +label.desc { + width: 30em; + float: ; +} + +label.desc sup { + position: absolute; +} + +code.php { + display: block; + padding-left: 0.3em; + margin-top: 0; + margin-bottom: 0; + max-height: 10em; + overflow: auto; + direction: ltr; +} + +code.sql, +div.sqlvalidate { + display: block; + padding: 0.3em; + margin-top: 0; + margin-bottom: 0; + max-height: 10em; + overflow: auto; + direction: ltr; +} + +.result_query div.sqlOuter, +div.sqlvalidate { + border: solid 1px; + border-top: 0; + border-bottom: 0; + background: ; +} + +.result_query div.sqlOuter { + text-align: ; +} + +#PMA_slidingMessage code.sql { + border: solid 1px; + border-top: 0; + background: ; +} + +#main_pane_left { + width: 60%; + min-width: 260px; + float: ; + padding-top: 1em; +} + +#main_pane_right { + overflow: hidden; + min-width: 160px; + padding-top: 1em; + padding-: 1em; +} + +.group { + border-: 0.3em solid ; + margin-bottom: 1em; +} + +.group h2 { + background: ; + padding: 0.1em 0.3em; + margin-top: 0; +} + +.group-cnt { + padding: 0 0 0 0.5em; + display: inline-block; + width: 98%; +} + +textarea#partitiondefinition { + height:3em; +} + + +/* for elements that should be revealed only via js */ +.hide { + display: none; +} + +#list_server { + list-style-type: none; + padding: 0; +} + +/** + * Progress bar styles + */ +div.upload_progress +{ + width: 400px; + margin: 3em auto; + text-align: center; +} + +div.upload_progress_bar_outer +{ + border: 1px solid #000; + width: 202px; + position: relative; + margin: 0 auto 1em; + color: ; +} + +div.upload_progress_bar_inner +{ + background-color: ; + width: 0; + height: 12px; + margin: 1px; + overflow: hidden; + color: ; + position: relative; +} + +div.upload_progress_bar_outer div.percentage +{ + position: absolute; + top: 0; + left: 0; + width: 202px; +} + +div.upload_progress_bar_inner div.percentage +{ + top: -1px; + left: -1px; +} + +div#statustext { + margin-top: .5em; +} + +table#serverconnection_src_remote, +table#serverconnection_trg_remote, +table#serverconnection_src_local, +table#serverconnection_trg_local { + float: left; +} +/** + * Validation error message styles + */ +input[type=text].invalid_value, +input[type=password].invalid_value, +input[type=number].invalid_value, +input[type=date].invalid_value, +select.invalid_value, +.invalid_value { + background: #FFCCCC; +} + +/** + * Ajax notification styling + */ + .ajax_notification { + top: 0; /** The notification needs to be shown on the top of the page */ + position: fixed; + margin-top: 0; + margin-right: auto; + margin-bottom: 0; + margin-left: auto; + padding: 3px 5px; /** Keep a little space on the sides of the text */ + width: 350px; + background-color: #FFD700; + z-index: 1100; /** If this is not kept at a high z-index, the jQueryUI modal dialogs (z-index:1000) might hide this */ + text-align: center; + display: block; + left: 0; + right: 0; + background-image: url(getImgPath('ajax_clock_small.gif');?>); + background-repeat: no-repeat; + background-position: 2%; + } + + #loading_parent { + /** Need this parent to properly center the notification division */ + position: relative; + width: 100%; + } +/** + * Export and Import styles + */ + +.export_table_list_container { + display: inline-block; + max-height: 20em; + overflow-y: scroll; +} + +.export_table_select th { + text-align: center; + vertical-align: middle; +} + +.export_table_select .all { + font-weight: bold; + border-bottom: 1px solid black; +} + +.export_structure, .export_data { + text-align: center; +} + +.export_table_name { + vertical-align: middle; +} + +.exportoptions h2 { + word-wrap: break-word; +} + +.exportoptions h3, .importoptions h3 { + border-bottom: 1px #999999 solid; + font-size: 110%; +} + +.exportoptions ul, .importoptions ul, .format_specific_options ul { + list-style-type: none; + margin-bottom: 15px; +} + +.exportoptions li, .importoptions li { + margin: 7px; +} +.exportoptions label, .importoptions label, .exportoptions p, .importoptions p { + margin: 5px; + float: none; +} + +#csv_options label.desc, #ldi_options label.desc, #latex_options label.desc, #output label.desc{ + float: left; + width: 15em; +} + +.exportoptions, .importoptions { + margin: 20px 30px 30px 10px +} + +.format_specific_options h3 { + margin: 10px 0 0 10px; + border: 0; +} + +.format_specific_options { + border: 1px solid #999; + margin: 7px 0; + padding: 3px; +} + +p.desc { + margin: 5px; +} + +/** + * Export styles only + */ +select#db_select, +select#table_select { + width: 400px; +} + +.export_sub_options { + margin: 20px 0 0 30px; +} + +.export_sub_options h4 { + border-bottom: 1px #999 solid; +} + +.export_sub_options li.subgroup { + display: inline-block; + margin-top: 0; +} + +.export_sub_options li { + margin-bottom: 0; +} + +#output_quick_export { + display: none; +} +/** + * Import styles only + */ + +.importoptions #import_notification { + margin: 10px 0; + font-style: italic; +} + +input#input_import_file { + margin: 5px; +} + +.formelementrow { + margin: 5px 0 5px 0; +} + +#filterText { + vertical-align: baseline; +} + +#popup_background { + display: none; + position: fixed; + _position: absolute; /* hack for IE6 */ + width: 100%; + height: 100%; + top: 0; + left: 0; + background: #000; + z-index: 1000; + overflow: hidden; +} + +/** + * Create table styles + */ +#create_table_form table.table-name td { + vertical-align: middle; +} + +/** + * Table structure styles + */ +#fieldsForm ul.table-structure-actions { + margin: 0; + padding: 0; + list-style: none; +} +#fieldsForm ul.table-structure-actions li { + float: ; + margin-: 0.5em; /* same as padding of "table td" */ +} +#fieldsForm ul.table-structure-actions .submenu li { + padding: 0.3em; + margin: 0.1em; +} +#structure-action-links a { + margin-: 1em; +} +#addColumns input[type="radio"] { + margin: 0; + margin-: 1em; +} +#addColumns input[type="submit"] { + margin-: 1em; +} + +/** + * Indexes + */ +#index_frm .index_info input[type="text"], +#index_frm .index_info select { + width: 100%; + box-sizing: border-box; + -ms-box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +#index_frm .slider { + width: 10em; + margin: .6em; + float: ; +} + +#index_frm .add_fields { + float: ; +} + +#index_frm .add_fields input { + margin-: 1em; +} + +#index_frm input { + margin: 0; +} + +#index_frm td { + vertical-align: middle; +} + +table#index_columns { + width: 100%; +} + +table#index_columns select { + width: 85%; + float: right; +} + +#move_columns_dialog div { + padding: 1em; +} + +#move_columns_dialog ul { + list-style: none; + margin: 0; + padding: 0; +} + +#move_columns_dialog li { + background: ; + border: 1px solid #aaa; + color: ; + font-weight: bold; + margin: .4em; + padding: .2em; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +/* config forms */ +.config-form ul.tabs { + margin: 1.1em 0.2em 0; + padding: 0 0 0.3em 0; + list-style: none; + font-weight: bold; +} + +.config-form ul.tabs li { + float: ; +} + +.config-form ul.tabs li a { + display: block; + margin: 0.1em 0.2em 0; + padding: 0.1em 0.4em; + white-space: nowrap; + text-decoration: none; + border: 1px solid ; + border-bottom: none; +} + +.config-form ul.tabs li a:hover, +.config-form ul.tabs li a:active, +.config-form ul.tabs li a.active { + margin: 0; + padding: 0.1em 0.6em 0.2em; +} + +.config-form ul.tabs li.active a { + background-color: ; +} + +.config-form fieldset { + margin-top: 0; + padding: 0; + clear: both; + /*border-color: ;*/ +} + +.config-form legend { + display: none; +} + +.config-form fieldset p { + margin: 0; + padding: 0.5em; + background: ; +} + +.config-form fieldset .errors { /* form error list */ + margin: 0 -2px 1em -2px; + padding: .5em 1.5em; + background: #FBEAD9; + border: 0 #C83838 solid; + border-width: 1px 0; + list-style: none; + font-family: sans-serif; + font-size: small; +} + +.config-form fieldset .inline_errors { /* field error list */ + margin: .3em .3em .3em 0; + padding: 0; + list-style: none; + color: #9A0000; + font-size: small; +} + +.config-form fieldset th { + padding: .3em .3em .3em .5em; + text-align: left; + vertical-align: top; + width: 40%; + background: transparent; +} + +.config-form fieldset .doc, +.config-form fieldset .disabled-notice { + margin-left: 1em; +} + +.config-form fieldset .disabled-notice { + font-size: 80%; + text-transform: uppercase; + color: #E00; + cursor: help; +} + +.config-form fieldset td { + padding-top: .3em; + padding-bottom: .3em; + vertical-align: top; +} + +.config-form fieldset th small { + display: block; + font-weight: normal; + font-family: sans-serif; + font-size: x-small; + color: #444; +} + +.config-form fieldset th, +.config-form fieldset td { + border-top: 1px solid; +} + +fieldset .group-header th { + background: ; +} + +fieldset .group-header + tr th { + padding-top: .6em; +} + +fieldset .group-field-1 th, +fieldset .group-header-2 th { + padding-left: 1.5em; +} + +fieldset .group-field-2 th, +fieldset .group-header-3 th { + padding-left: 3em; +} + +fieldset .group-field-3 th { + padding-left: 4.5em; +} + +fieldset .disabled-field th, +fieldset .disabled-field th small, +fieldset .disabled-field td { + color: #666; + background-color: #ddd; +} + +.config-form .lastrow { + border-top: 1px #000 solid; +} + +.config-form .lastrow { + background: ; + padding: .5em; + text-align: center; +} + +.config-form .lastrow input { + font-weight: bold; +} + +/* form elements */ + +.config-form span.checkbox { + padding: 2px; + display: inline-block; +} + +.config-form .custom { /* customized field */ + background: #FFC; +} + +.config-form span.checkbox.custom { + padding: 1px; + border: 1px #EDEC90 solid; + background: #FFC; +} + +.config-form .field-error { + border-color: #A11 !important; +} + +.config-form input[type="text"], +.config-form input[type="password"], +.config-form input[type="number"], +.config-form select, +.config-form textarea { + border: 1px #A7A6AA solid; + height: auto; +} + +.config-form input[type="text"]:focus, +.config-form input[type="password"]:focus, +.config-form input[type="number"]:focus, +.config-form select:focus, +.config-form textarea:focus { + border: 1px #6676FF solid; + background: #F7FBFF; +} + +.config-form .field-comment-mark { + font-family: serif; + color: #007; + cursor: help; + padding: 0 0.2em; + font-weight: bold; + font-style: italic; +} + +.config-form .field-comment-warning { + color: #A00; +} + +/* error list */ +.config-form dd { + margin-left: .5em; +} + +.config-form dd:before { + content: "\25B8 "; +} + +.click-hide-message { + cursor: pointer; +} + +.prefsmanage_opts { + margin-: 2em; +} + +#prefs_autoload { + margin-bottom: .5em; + margin-left: .5em; +} + +#placeholder .button { + position: absolute; + cursor: pointer; +} + +#placeholder div.button { + font-size: smaller; + color: #999; + background-color: #eee; + padding: 2px; +} + +.wrapper { + float: ; + margin-bottom: 0.5em; +} +.toggleButton { + position: relative; + cursor: pointer; + font-size: .8em; + text-align: center; + line-height: 1.4em; + height: 1.55em; + overflow: hidden; + border-right: .1em solid #888; + border-left: .1em solid #888; +} +.toggleButton table, +.toggleButton td, +.toggleButton img { + padding: 0; + position: relative; +} +.toggleButton .container { + position: absolute; +} +.toggleButton .container td, +.toggleButton .container tr { + background-image: none; + background: none !important; +} +.toggleButton .toggleOn { + color: #fff; + padding: 0 1em; +} +.toggleButton .toggleOff { + padding: 0 1em; +} + +.doubleFieldset fieldset { + width: 48%; + float: ; + padding: 0; +} +.doubleFieldset fieldset.left { + margin-: 1%; +} +.doubleFieldset fieldset.right { + margin-: 1%; +} +.doubleFieldset legend { + margin-: 0.5em; +} +.doubleFieldset div.wrap { + padding: 0.5em; +} + +#table_name_col_no_outer { + margin-top: 30px; +} + +#table_name_col_no { + position: fixed; + top: 44px; + width: 100%; + background: ; +} + +#table_columns input[type="text"], +#table_columns input[type="password"], +#table_columns input[type="number"], +#table_columns input[type="date"], +#table_columns select { + width: 10em; + box-sizing: border-box; + -ms-box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +input#auto_increment_opt { + width: min-content; +} + +#placeholder { + position: relative; + border: 1px solid #aaa; + float: ; + overflow: hidden; + width: 450px; + height: 300px; +} + +#openlayersmap{ + width: 450px; + height: 300px; +} + +.placeholderDrag { + cursor: move; +} + +#placeholder .button { + position: absolute; +} + +#left_arrow { + left: 8px; + top: 26px; +} + +#right_arrow { + left: 26px; + top: 26px; +} + +#up_arrow { + left: 17px; + top: 8px; +} + +#down_arrow { + left: 17px; + top: 44px; +} + +#zoom_in { + left: 17px; + top: 67px; +} + +#zoom_world { + left: 17px; + top: 85px; +} + +#zoom_out { + left: 17px; + top: 103px; +} + +.colborder { + cursor: col-resize; + height: 100%; + margin-left: -5px; + position: absolute; + width: 5px; +} + +.colborder_active { + border-right: 2px solid #a44; +} + +.pma_table td { + position: static; +} + +.pma_table th.draggable span, +.sticky_columns th.draggable span, +.pma_table tbody td span { + display: block; + overflow: hidden; +} + +.pma_table tbody td span code span { + display: inline; +} + +.modal-copy input { + display: block; + width: 100%; + margin-top: 1.5em; + padding: .3em 0; +} + +.cRsz { + position: absolute; +} + +.draggable { + cursor: move; +} + +.cCpy { + background: #000; + color: #FFF; + font-weight: bold; + margin: 0.1em; + padding: 0.3em; + position: absolute; +} + +.cPointer { + background: url(getImgPath('col_pointer.png');?>); + height: 20px; + margin-left: -5px; /* must be minus half of its width */ + margin-top: -10px; + position: absolute; + width: 10px; +} + +.tooltip { + background: #333 !important; + opacity: .8 !important; + border: 1px solid #000 !important; + -moz-border-radius: .3em !important; + -webkit-border-radius: .3em !important; + border-radius: .3em !important; + text-shadow: -1px -1px #000 !important; + font-size: .8em !important; + font-weight: bold !important; + padding: 1px 3px !important; +} + +.tooltip * { + background: none !important; + color: #FFF !important; +} + + +.data_full_width { + width: 100%; +} + +.cDrop { + left: 0; + position: absolute; + top: 0; +} + +.coldrop { + background: url(getImgPath('col_drop.png');?>); + cursor: pointer; + height: 16px; + margin-left: 0.5em; + margin-top: 0.3em; + position: absolute; + width: 16px; +} + +.coldrop:hover, +.coldrop-hover { + background-color: #999; +} + +.cList { + background: #EEE; + border: solid 1px #999; + position: absolute; +} + +.cList .lDiv div { + padding: .2em .5em .2em .2em; +} + +.cList .lDiv div:hover { + background: #DDD; + cursor: pointer; +} + +.cList .lDiv div input { + cursor: pointer; +} + +.showAllColBtn { + border-bottom: solid 1px #999; + border-top: solid 1px #999; + cursor: pointer; + font-size: .9em; + font-weight: bold; + padding: .35em 1em; + text-align: center; +} + +.showAllColBtn:hover { + background: #DDD; +} + +.navigation { + background: #E5E5E5; + border: 1px solid black; + margin: 0.8em 0; +} + +.navigation td { + margin: 0; + padding: 0; + vertical-align: middle; + white-space: nowrap; +} + +.navigation_separator { + color: #555; + display: inline-block; + text-align: center; + width: 1.2em; + text-shadow: 1px 0 #FFF; +} + +.navigation input[type=submit] { + background: none; + border: 0; + margin: 0; + padding: 0.3em 0.5em; + min-width: 1.5em; + font-weight: bold; +} + +.navigation input[type=submit]:hover, .navigation input.edit_mode_active { + background: #333; + color: white; + cursor: pointer; +} + +.navigation select { + margin: 0 .8em; +} + +.cEdit { + margin: 0; + padding: 0; + position: absolute; +} + +.cEdit input[type=text], +.cEdit input[type=password], +.cEdit input[type=number] { + background: #FFF; + height: 100%; + margin: 0; + padding: 0; +} + +.cEdit .edit_area { + background: #FFF; + border: 1px solid #999; + min-width: 10em; + padding: .3em .5em; +} + +.cEdit .edit_area select, +.cEdit .edit_area textarea { + width: 97%; +} + +.cEdit .cell_edit_hint { + color: #555; + font-size: .8em; + margin: .3em .2em; +} + +.cEdit .edit_box { + overflow-x: hidden; + overflow-y: scroll; + padding: 0; +} + +.cEdit .edit_box_posting { + background: #FFF url(getImgPath('ajax_clock_small.gif');?>) no-repeat right center; + padding-right: 1.5em; +} + +.cEdit .edit_area_loading { + background: #FFF url(getImgPath('ajax_clock_small.gif');?>) no-repeat center; + height: 10em; +} + +.cEdit .goto_link { + background: #EEE; + color: #555; + padding: .2em .3em; +} + +.saving_edited_data { + background: url(getImgPath('ajax_clock_small.gif');?>) no-repeat left; + padding-left: 20px; +} + +/* css for timepicker */ +.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } +.ui-timepicker-div dl { text-align: ; } +.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } +.ui-timepicker-div dl dd { margin: 0 10px 10px 85px; } +.ui-timepicker-div td { font-size: 90%; } +.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } +.ui-timepicker-rtl { direction: rtl; } +.ui-timepicker-rtl dl { text-align: right; } +.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; } + +input.btn { + color: #333; + background-color: #D0DCE0; +} + +body .ui-widget { + font-size: 1em; +} + +body #ui-datepicker-div { + z-index: 9999 !important; +} + +.ui-dialog fieldset legend a { + color: #0000FF; +} + +.ui-draggable { + z-index: 801; +} + +/* jqPlot */ + +/*rules for the plot target div. These will be cascaded down to all plot elements +according to css rules*/ +.jqplot-target { + position: relative; + color: #222222; + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + font-size: 1em; +/* height: 300px; + width: 400px;*/ +} + +/*rules applied to all axes*/ +.jqplot-axis { + font-size: 0.75em; +} + +.jqplot-xaxis { + margin-top: 10px; +} + +.jqplot-x2axis { + margin-bottom: 10px; +} + +.jqplot-yaxis { + margin-right: 10px; +} + +.jqplot-y2axis, .jqplot-y3axis, .jqplot-y4axis, .jqplot-y5axis, .jqplot-y6axis, +.jqplot-y7axis, .jqplot-y8axis, .jqplot-y9axis, .jqplot-yMidAxis { + margin-left: 10px; + margin-right: 10px; +} + +/*rules applied to all axis tick divs*/ +.jqplot-axis-tick, .jqplot-xaxis-tick, .jqplot-yaxis-tick, .jqplot-x2axis-tick, +.jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, +.jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick, +.jqplot-yMidAxis-tick { + position: absolute; + white-space: pre; +} + + +.jqplot-xaxis-tick { + top: 0; + /* initial position untill tick is drawn in proper place */ + left: 15px; + vertical-align: top; +} + +.jqplot-x2axis-tick { + bottom: 0; + /* initial position untill tick is drawn in proper place */ + left: 15px; + vertical-align: bottom; +} + +.jqplot-yaxis-tick { + right: 0; + /* initial position untill tick is drawn in proper place */ + top: 15px; + text-align: right; +} + +.jqplot-yaxis-tick.jqplot-breakTick { + right: -20px; + margin-right: 0; + padding:1px 5px 1px 5px; + z-index: 2; + font-size: 1.5em; +} + +.jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, +.jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick { + left: 0; + /* initial position until tick is drawn in proper place */ + top: 15px; + text-align: left; +} + +.jqplot-yMidAxis-tick { + text-align: center; + white-space: nowrap; +} + +.jqplot-xaxis-label { + margin-top: 10px; + font-size: 11pt; + position: absolute; +} + +.jqplot-x2axis-label { + margin-bottom: 10px; + font-size: 11pt; + position: absolute; +} + +.jqplot-yaxis-label { + margin-right: 10px; +/* text-align: center;*/ + font-size: 11pt; + position: absolute; +} + +.jqplot-yMidAxis-label { + font-size: 11pt; + position: absolute; +} + +.jqplot-y2axis-label, .jqplot-y3axis-label, .jqplot-y4axis-label, +.jqplot-y5axis-label, .jqplot-y6axis-label, .jqplot-y7axis-label, +.jqplot-y8axis-label, .jqplot-y9axis-label { +/* text-align: center;*/ + font-size: 11pt; + margin-left: 10px; + position: absolute; +} + +.jqplot-meterGauge-tick { + font-size: 0.75em; + color: #999999; +} + +.jqplot-meterGauge-label { + font-size: 1em; + color: #999999; +} + +table.jqplot-table-legend { + margin-top: 12px; + margin-bottom: 12px; + margin-left: 12px; + margin-right: 12px; +} + +table.jqplot-table-legend, table.jqplot-cursor-legend { + background-color: rgba(255,255,255,0.6); + border: 1px solid #cccccc; + position: absolute; + font-size: 0.75em; +} + +td.jqplot-table-legend { + vertical-align:middle; +} + +/* +These rules could be used instead of assigning +element styles and relying on js object properties. +*/ + +/* +td.jqplot-table-legend-swatch { + padding-top: 0.5em; + text-align: center; +} + +tr.jqplot-table-legend:first td.jqplot-table-legend-swatch { + padding-top: 0px; +} +*/ + +td.jqplot-seriesToggle:hover, td.jqplot-seriesToggle:active { + cursor: pointer; +} + +.jqplot-table-legend .jqplot-series-hidden { + text-decoration: line-through; +} + +div.jqplot-table-legend-swatch-outline { + border: 1px solid #cccccc; + padding:1px; +} + +div.jqplot-table-legend-swatch { + width:0; + height:0; + border-top-width: 5px; + border-bottom-width: 5px; + border-left-width: 6px; + border-right-width: 6px; + border-top-style: solid; + border-bottom-style: solid; + border-left-style: solid; + border-right-style: solid; +} + +.jqplot-title { + top: 0; + left: 0; + padding-bottom: 0.5em; + font-size: 1.2em; +} + +table.jqplot-cursor-tooltip { + border: 1px solid #cccccc; + font-size: 0.75em; +} + + +.jqplot-cursor-tooltip { + border: 1px solid #cccccc; + font-size: 0.75em; + white-space: nowrap; + background: rgba(208,208,208,0.5); + padding: 1px; +} + +.jqplot-highlighter-tooltip, .jqplot-canvasOverlay-tooltip { + border: 1px solid #cccccc; + font-size: 0.75em; + white-space: nowrap; + background: rgba(208,208,208,0.5); + padding: 1px; +} + +.jqplot-point-label { + font-size: 0.75em; + z-index: 2; +} + +td.jqplot-cursor-legend-swatch { + vertical-align: middle; + text-align: center; +} + +div.jqplot-cursor-legend-swatch { + width: 1.2em; + height: 0.7em; +} + +.jqplot-error { +/* Styles added to the plot target container when there is an error go here.*/ + text-align: center; +} + +.jqplot-error-message { +/* Styling of the custom error message div goes here.*/ + position: relative; + top: 46%; + display: inline-block; +} + +div.jqplot-bubble-label { + font-size: 0.8em; +/* background: rgba(90%, 90%, 90%, 0.15);*/ + padding-left: 2px; + padding-right: 2px; + color: rgb(20%, 20%, 20%); +} + +div.jqplot-bubble-label.jqplot-bubble-label-highlight { + background: rgba(90%, 90%, 90%, 0.7); +} + +div.jqplot-noData-container { + text-align: center; + background-color: rgba(96%, 96%, 96%, 0.3); +} + +.relationalTable td { + vertical-align: top; +} + +.relationalTable select { + width: 125px; + margin-right: 5px; +} + +.report-data { + height:13em; + overflow:scroll; + width:570px; + border: solid 1px; + background: white; + padding: 2px; +} + +.report-description { + height:10em; + width:570px; +} + +div#page_content div#tableslistcontainer table.data { + border-top: 0.1px solid #EEEEEE; +} + +div#page_content div#tableslistcontainer, div#page_content div.notice, div#page_content div.result_query { + margin-top: 1em; +} + +table.show_create { + margin-top: 1em; +} + +table.show_create td { + border-right: 1px solid #bbb; +} + +#alias_modal table { + width: 100%; +} + +#alias_modal label { + font-weight: bold; +} + +.ui-dialog { + position: fixed; +} + +.small_font { + font-size: smaller; +} + +/* Console styles */ +#pma_console_container { + width: 100%; + position: fixed; + bottom: 0; + : 0; + z-index: 100; +} +#pma_console { + position: relative; + margin-: 240px; + z-index: 100; +} +#pma_console .templates { + display: none; +} +#pma_console .mid_text, +#pma_console .toolbar span { + vertical-align: middle; +} +#pma_console .toolbar { + position: relative; + background: #ccc; + border-top: solid 1px #aaa; + cursor: n-resize; +} +#pma_console .toolbar.collapsed:not(:hover) { + display: inline-block; + border-top--radius: 3px; + border-: solid 1px #aaa; +} +#pma_console .toolbar.collapsed { + cursor: default; +} +#pma_console .toolbar.collapsed>.button { + display: none; +} +#pma_console .message span.text, +#pma_console .message span.action, +#pma_console .toolbar .button, +#pma_console .toolbar .text, +#pma_console .switch_button { + padding: 0 3px; + display: inline-block; +} +#pma_console .message span.action, +#pma_console .toolbar .button, +#pma_console .switch_button { + cursor: pointer; +} +#pma_console .message span.action:hover, +#pma_console .toolbar .button:hover, +#pma_console .switch_button:hover, +#pma_console .toolbar .button.active { + background: #ddd; +} +#pma_console .toolbar .text { + font-weight: bold; +} +#pma_console .toolbar .button, +#pma_console .toolbar .text { + margin-: .4em; +} +#pma_console .toolbar .button, +#pma_console .toolbar .text { + float: ; +} +#pma_console .content { + overflow-x: hidden; + overflow-y: auto; + margin-bottom: -65px; + border-top: solid 1px #aaa; + background: #fff; + padding-top: .4em; +} +#pma_console .content.console_dark_theme { + background: #000; + color: #fff; +} +#pma_console .content.console_dark_theme .CodeMirror-wrap { + background: #000; + color: #fff; +} +#pma_console .content.console_dark_theme .action_content { + color: #000; +} +#pma_console .content.console_dark_theme .message { + border-color: #373B41; +} +#pma_console .content.console_dark_theme .CodeMirror-cursor { + border-color: #fff; +} +#pma_console .content.console_dark_theme .cm-keyword { + color: #de935f; +} +#pma_console .message, +#pma_console .query_input { + position: relative; + font-family: Monaco, Consolas, monospace; + cursor: text; + margin: 0 10px .2em 1.4em; +} +#pma_console .message { + border-bottom: solid 1px #ccc; + padding-bottom: .2em; +} +#pma_console .message.expanded>.action_content { + position: relative; +} +#pma_console .message:before, +#pma_console .query_input:before { + left: -0.7em; + position: absolute; + content: ">"; +} +#pma_console .query_input:before { + top: -2px; +} +#pma_console .query_input textarea { + width: 100%; + height: 4em; + resize: vertical; +} +#pma_console .message:hover:before { + color: #7cf; + font-weight: bold; +} +#pma_console .message.expanded:before { + content: "]"; +} +#pma_console .message.welcome:before { + display: none; +} +#pma_console .message.failed:before, +#pma_console .message.failed.expanded:before, +#pma_console .message.failed:hover:before { + content: "="; + color: #944; +} +#pma_console .message.pending:before { + opacity: .3; +} +#pma_console .message.collapsed>.query { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +#pma_console .message.expanded>.query { + display: block; + white-space: pre; + word-wrap: break-word; +} +#pma_console .message .text.targetdb, +#pma_console .message.collapsed .action.collapse, +#pma_console .message.expanded .action.expand, +#pma_console .message .action.requery, +#pma_console .message .action.profiling, +#pma_console .message .action.explain, +#pma_console .message .action.bookmark { + display: none; +} +#pma_console .message.select .action.profiling, +#pma_console .message.select .action.explain, +#pma_console .message.history .text.targetdb, +#pma_console .message.successed .text.targetdb, +#pma_console .message.history .action.requery, +#pma_console .message.history .action.bookmark, +#pma_console .message.bookmark .action.requery, +#pma_console .message.bookmark .action.bookmark, +#pma_console .message.successed .action.requery, +#pma_console .message.successed .action.bookmark { + display: inline-block; +} +#pma_console .message .action_content { + position: absolute; + bottom: 100%; + background: #ccc; + border: solid 1px #aaa; + border-top--radius: 3px; +} +html.ie8 #pma_console .message .action_content { + position: relative!important; +} +#pma_console .message.bookmark .text.targetdb, +#pma_console .message .text.query_time { + margin: 0; + display: inline-block; +} +#pma_console .message.failed .text.query_time, +#pma_console .message .text.failed { + display: none; +} +#pma_console .message.failed .text.failed { + display: inline-block; +} +#pma_console .message .text { + background: #fff; +} +#pma_console .message.collapsed>.action_content { + display: none; +} +#pma_console .message.collapsed:hover>.action_content { + display: block; +} +#pma_console .message .bookmark_label { + padding: 0 4px; + top: 0; + background: #369; + color: #fff; + border-radius: 3px; +} +#pma_console .message .bookmark_label.shared { + background: #396; +} +#pma_console .message.expanded .bookmark_label { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +#pma_console .query_input { + position: relative; +} +#pma_console .mid_layer { + height: 100%; + width: 100%; + position: absolute; + top: 0; + /* For support IE8, this layer doesn't use filter:opacity or opacity, + js code will fade this layer opacity to 0.18(using animation) */ + background: #666; + display: none; + cursor: pointer; + z-index: 200; +} +#pma_console .card { + position: absolute; + width: 94%; + height: 100%; + min-height: 48px; + : 100%; + top: 0; + border-: solid 1px #999; + z-index: 300; + transition: 0.2s; + -ms-transition: 0.2s; + -webkit-transition: 0.2s; + -moz-transition: 0.2s; +} +#pma_console .card.show { + : 6%; + box-shadow: -2px 1px 4px -1px #999; +} + +html.ie7 #pma_console .query_input { + display: none; +} + +#pma_bookmarks .content.add_bookmark, +#pma_console_options .content { + padding: 4px 6px; +} +#pma_bookmarks .content.add_bookmark .options { + margin-: 1.4em; + padding-bottom: .4em; + margin-bottom: .4em; + border-bottom: solid 1px #ccc; +} +#pma_bookmarks .content.add_bookmark .options button { + margin: 0 7px; + vertical-align: bottom; +} +#pma_bookmarks .content.add_bookmark input[type=text] { + margin: 0; + padding: 2px 4px; +} +#pma_console .button.hide, +#pma_console .message span.text.hide { + display: none; +} +#debug_console.grouped .ungroup_queries, +#debug_console.ungrouped .group_queries { + display: inline-block; +} +#debug_console.ungrouped .ungroup_queries, +#debug_console.ungrouped .sort_count, +#debug_console.grouped .group_queries { + display: none; +} +#debug_console .count { + margin-right: 8px; +} +#debug_console .show_trace .trace, +#debug_console .show_args .args { + display: block; +} +#debug_console .hide_trace .trace, +#debug_console .hide_args .args, +#debug_console .show_trace .action.dbg_show_trace, +#debug_console .hide_trace .action.dbg_hide_trace, +#debug_console .traceStep.hide_args .action.dbg_hide_args, +#debug_console .traceStep.show_args .action.dbg_show_args { + display: none; +} + +#debug_console .traceStep:after, +#debug_console .trace.welcome:after, +#debug_console .debug>.welcome:after { + content: ""; + display: table; + clear: both; +} +#debug_console .debug_summary { + float: left; +} +#debug_console .trace.welcome .time { + float: right; +} +#debug_console .traceStep .file, +#debug_console .script_name { + float: right; +} +#debug_console .traceStep .args pre { + margin: 0; +} + +/* Code mirror console style*/ + +.cm-s-pma .CodeMirror-code pre, +.cm-s-pma .CodeMirror-code { + font-family: Monaco, Consolas, monospace; +} +.cm-s-pma .CodeMirror-measure>pre, +.cm-s-pma .CodeMirror-code>pre, +.cm-s-pma .CodeMirror-lines { + padding: 0; +} +.cm-s-pma.CodeMirror { + resize: none; + height: auto; + width: 100%; + min-height: initial; + max-height: initial; +} +.cm-s-pma .CodeMirror-scroll { + cursor: text; +} + +/* PMA drop-improt style */ + +.pma_drop_handler { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + background: rgba(0, 0, 0, 0.6); + height: 100%; + z-index: 999; + color: white; + font-size: 30pt; + text-align: center; + padding-top: 20%; +} + +.pma_sql_import_status { + display: none; + position: fixed; + bottom: 0; + right: 25px; + width: 400px; + border: 1px solid #999; + background: #f3f3f3; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: 2px 2px 5px #ccc; + -webkit-box-shadow: 2px 2px 5px #ccc; + box-shadow: 2px 2px 5px #ccc; +} + +.pma_sql_import_status h2, +.pma_drop_result h2 { + background-color: #bbb; + padding: .1em .3em; + margin-top: 0; + margin-bottom: 0; + color: #fff; + font-size: 1.6em; + font-weight: normal; + text-shadow: 0 1px 0 #777; + -moz-box-shadow: 1px 1px 15px #999 inset; + -webkit-box-shadow: 1px 1px 15px #999 inset; + box-shadow: 1px 1px 15px #999 inset; +} + +.pma_sql_import_status div { + height: 270px; + overflow-y:auto; + overflow-x:hidden; + list-style-type: none; +} + +.pma_sql_import_status div li { + padding: 8px 10px; + border-bottom: 1px solid #bbb; + color: rgb(148, 14, 14); + background: white; +} + +.pma_sql_import_status div li .filesize { + float: right; +} + +.pma_sql_import_status h2 .minimize { + float: right; + margin-right: 5px; + padding: 0 10px; +} + +.pma_sql_import_status h2 .close { + float: right; + margin-right: 5px; + padding: 0 10px; + display: none; +} + +.pma_sql_import_status h2 .minimize:hover, +.pma_sql_import_status h2 .close:hover, +.pma_drop_result h2 .close:hover { + background: rgba(155, 149, 149, 0.78); + cursor: pointer; +} + +.pma_drop_file_status { + color: #235a81; +} + +.pma_drop_file_status span.underline:hover { + cursor: pointer; + text-decoration: underline; +} + +.pma_drop_result { + position: fixed; + top: 10%; + left: 20%; + width: 60%; + background: white; + min-height: 300px; + z-index: 800; + -webkit-box-shadow: 0 0 15px #999; + border-radius: 10px; + cursor: move; +} + +.pma_drop_result h2 .close { + float: right; + margin-right: 5px; + padding: 0 10px; +} + +#composite_index_list { + list-style-type: none; + list-style-position: inside; +} + +span.drag_icon { + display: inline-block; + background-image: url('getImgPath('s_sortable.png');?>'); + background-position: center center; + background-repeat: no-repeat; + width: 1em; + height: 3em; + cursor: move; +} + +.topmargin { + margin-top: 1em; +} + +/* styles for sortable tables created with tablesorter jquery plugin */ +th.header { + cursor: pointer; + color: #0000FF; +} + +th.header:hover { + text-decoration: underline; +} + +th.header .sorticon { + width: 16px; + height: 16px; + background-repeat: no-repeat; + background-position: right center; + display: inline-table; + vertical-align: middle; + float: right; +} + +th.headerSortUp .sorticon, th.headerSortDown:hover .sorticon { + background-image: url(getImgPath('s_desc.png');?>); +} + +th.headerSortDown .sorticon, th.headerSortUp:hover .sorticon { + background-image: url(getImgPath('s_asc.png');?>); +} +/* end of styles of sortable tables */ + +/* styles for jQuery-ui to support rtl languages */ +body .ui-dialog .ui-dialog-titlebar-close { + : .3em; + : initial; +} + +body .ui-dialog .ui-dialog-title { + float: ; +} + +body .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: ; +} +/* end of styles for jQuery-ui to support rtl languages */ + +/* Override some jQuery-ui styling to have square corners */ +body .ui-corner-all, +body .ui-corner-top, +body .ui-corner-left, +body .ui-corner-tl { + border-top-left-radius: 0; +} +body .ui-corner-all, +body .ui-corner-top, +body .ui-corner-right, +body .ui-corner-tr { + border-top-right-radius: 0; +} +body .ui-corner-all, +body .ui-corner-bottom, +body .ui-corner-left, +body .ui-corner-bl { + border-bottom-left-radius: 0; +} +body .ui-corner-all, +body .ui-corner-bottom, +body .ui-corner-right, +body .ui-corner-br { + border-bottom-right-radius: 0; +} +/* Override jQuery-ui styling for ui-dialog */ +body .ui-dialog { + padding: 0; + border-color: #000000; +} +body .ui-dialog .ui-dialog-titlebar { + padding: .3em .5em; + border: none; + border-bottom: 1px solid #000000; +} +body .ui-dialog .ui-dialog-titlebar button { + border: 1px solid #999999; +} +body .ui-dialog .ui-dialog-content { + padding: .2em .4em; +} +body .ui-dialog .ui-dialog-buttonpane { + background: #D3DCE3; + border-top: 1px solid #000000; +} +body .ui-dialog .ui-dialog-buttonpane button { + margin: .1em 0 .1em .4em; + border: 1px solid #999999; + color: #000000; +} +body .ui-dialog .ui-button-text-only .ui-button-text { + padding: .2em .6em; +} + +.scrollindicator { + display: none; +} + +@media only screen and (max-width: 768px) { + /* For mobile phones: */ + #main_pane_left { + width: 100%; + } + + #main_pane_right { + padding-top: 0; + padding-: 1px; + padding-: 1px; + } + + ul#topmenu, + ul.tabs { + display: flex; + } + + .navigationbar { + display: inline-flex; + margin: 0 !important; + border-radius: 0 !important; + overflow: auto; + } + + .scrollindicator { + padding: 5px; + cursor: pointer; + display: inline; + } + + .responsivetable { + overflow-x: auto; + } + + body#loginform div.container { + width: 100%; + } + + .largescreenonly { + display: none; + } + + .width100, .desktop50 { + width: 100%; + } + + .width96 { + width: 96% !important; + } + + #page_nav_icons { + display: none; + } + + table#serverstatusconnections { + margin-left: 0; + } + + #table_name_col_no { + top: 62px + } + + .tdblock tr td { + display: block; + } + + #table_columns { + margin-top: 60px; + } + + #table_columns .tablesorter { + min-width: 100%; + } + + .doubleFieldset fieldset { + width: 98%; + } + + div#serverstatusquerieschart { + width: 100%; + height: 450px; + } + + .ui-dialog { + margin: 1%; + width: 95% !important; + } + + #serverinfo .item { + margin: 4px; + } +} + +/* templates/database/designer */ +/* side menu */ +#name-panel { + overflow:hidden; +} diff --git a/phpMyAdmin/themes/original/css/navigation.css.php b/phpMyAdmin/themes/original/css/navigation.css.php new file mode 100755 index 0000000..9666b02 --- /dev/null +++ b/phpMyAdmin/themes/original/css/navigation.css.php @@ -0,0 +1,424 @@ + + +/******************************************************************************/ +/* Navigation */ + +#pma_navigation { + background: ; + color: ; + width: px; + overflow: hidden; + position: fixed; + top: 0; + : 0; + height: 100vh; + border-: 1px solid gray; + z-index: 800; +} + +#pma_navigation_content { + width: 100%; + height: 100%; + position: absolute; + top: 0; + : 0; + z-index: 0; + padding-bottom: 1em; +} + +#pma_navigation ul { + margin: 0; +} + +#pma_navigation form { + margin: 0; + padding: 0; + display: inline; +} + +#pma_navigation select#select_server, +#pma_navigation select#lightm_db { + width: 100%; +} + +/******************************************************************************/ +/* specific elements */ + +#pma_navigation div.pageselector { + text-align: center; + margin: 0 0 0; + margin-: 0.75em; + border-: 1px solid #666; +} + +#pma_navigation div#pmalogo { + + background-color: ; + padding: .3em; +} + +#pma_navigation div#recentTableList, +#pma_navigation div#FavoriteTableList { + text-align: center; + margin-bottom: 0.5em; +} + +#pma_navigation #recentTable, +#pma_navigation #FavoriteTable { + width: 200px; +} + +#pma_navigation #pmalogo, +#pma_navigation #serverChoice, +#pma_navigation #navipanellinks, +#pma_navigation #recentTableList, +#pma_navigation #FavoriteTableList, +#pma_navigation #databaseList, +#pma_navigation div.pageselector.dbselector { + text-align: center; + margin-bottom: 0.3em; + padding-bottom: 0.3em; + border: 0; +} + +#pma_navigation #recentTableList select, +#pma_navigation #FavoriteTableList select, +#pma_navigation #serverChoice select + { + width: 80%; +} + +#pma_navigation #recentTableList, +#pma_navigation #FavoriteTableList { + margin-bottom: 0; + padding-bottom: 0; +} + +#pma_navigation_content > img.throbber { + display: block; + margin: 0 auto; +} + +/* Navigation tree*/ +#pma_navigation_tree { + margin: 0; + margin-: 1em; + color: #444; + height: 74%; + position: relative; +} + +#pma_navigation_select_database { + text-align: left; + padding: 0 0 0; + border: 0; + margin: 0; +} + +#pma_navigation_db_select { + margin-top: 0.5em; + margin-: 0.75em; +} +#pma_navigation_db_select select { + background: url("./themes/pmahomme/img/select_bg.png") repeat scroll 0 0; + -webkit-border-radius: 2px; + border-radius: 2px; + border: 1px solid #bbb; + border-top: 1px solid #bbb; + color: #333; + padding: 4px 6px; + margin: 0 0 0; + width: 92%; + font-size: 1.11em; +} + +#pma_navigation_tree_content { + width: 100%; + overflow: hidden; + overflow-y: auto; + position: absolute; + height: 100%; +} +#pma_navigation_tree_content a.hover_show_full { + position: relative; + z-index: 100; + vertical-align: sub; +} +#pma_navigation_tree a { + color: ; +} +#pma_navigation_tree a:hover { + text-decoration: underline; +} +#pma_navigation_tree li.activePointer { + color: ; + background-color: ; +} +#pma_navigation_tree li.selected { + color: ; + background-color: ; +} +#pma_navigation_tree li .dbItemControls { + padding-left: 4px; +} +#pma_navigation_tree li .navItemControls { + display: none; + padding-left: 4px; +} +#pma_navigation_tree li.activePointer .navItemControls { + display: inline; + opacity: 0.5; +} +#pma_navigation_tree li.activePointer .navItemControls:hover { + display: inline; + opacity: 1.0; +} +#pma_navigation_tree ul { + clear: both; + padding: 0; + list-style-type: none; + margin: 0; +} +#pma_navigation_tree ul ul { + position: relative; +} +#pma_navigation_tree li { + white-space: nowrap; + clear: both; + min-height: 16px; +} +#pma_navigation_tree img { + margin: 0; +} +#pma_navigation_tree i { + display: block; +} +#pma_navigation_tree div.block { + position: relative; + width:1.5em; + height:1.5em; + min-width: 16px; + min-height: 16px; + float: ; +} +#pma_navigation_tree div.block.double { + width: 3em; +} +#pma_navigation_tree div.block i, +#pma_navigation_tree div.block b { + width: 1.5em; + height: 1.7em; + min-width: 16px; + min-height: 8px; + position: absolute; + bottom: 0.7em; + : 0.75em; + z-index: 0; +} +#pma_navigation_tree div.block i { + border-: 1px solid #666; + border-bottom: 1px solid #666; + position: relative; + z-index: 0; +} +#pma_navigation_tree div.block i.first { /* Removes top segment */ + border-: 0; +} +/* Bottom segment for the tree element connections */ +#pma_navigation_tree div.block b { + display: block; + height: 0.75em; + bottom: 0; + : 0.75em; + border-: 1px solid #666; +} +#pma_navigation_tree div.block a, +#pma_navigation_tree div.block u { + position: absolute; + : 50%; + top: 50%; + z-index: 10; +}#pma_navigation_tree div.block a + a { + : 100%; +} +#pma_navigation_tree div.block.double a, +#pma_navigation_tree div.block.double u { + : 25%; +} +#pma_navigation_tree div.block.double a + a { + : 70%; +} +#pma_navigation_tree div.block img { + position: relative; + top: -0.6em; + : 0; + margin-: -5px; +} +#pma_navigation_tree li.last > ul { + background: none; +} +#pma_navigation_tree li > a, #pma_navigation_tree li > i { + line-height: 1.5em; + height: 1.5em; + padding-: 0.3em; +} +#pma_navigation_tree .list_container { + border-: 1px solid #666; + margin-: 0.75em; + padding-: 0.75em; +} +#pma_navigation_tree .last > .list_container { + border-: 0 solid #666; +} + +/* Fast filter */ +li.fast_filter { + padding-: 0.75em; + margin-: 0.75em; + padding-: 35px; + border-: 1px solid #666; +} +li.fast_filter input { + padding-: 1.7em; + width: 100%; +} +li.fast_filter span { + position: relative; + : 1.5em; + padding: 0.2em; + cursor: pointer; + font-weight: bold; + color: #800; +} +/* IE10+ has its own reset X */ +html.ie li.fast_filter span { + display: none; +} +html.ie.ie9 li.fast_filter span, +html.ie.ie8 li.fast_filter span { + display: auto; +} +html.ie li.fast_filter input { + padding-: .2em; +} +html.ie.ie9 li.fast_filter input, +html.ie.ie8 li.fast_filter input { + padding-: 1.7em; +} +li.fast_filter.db_fast_filter { + border: 0; +} + +/* Resize handler */ +#pma_navigation_resizer { + width: 3px; + height: 100%; + background-color: #aaa; + cursor: col-resize; + position: fixed; + top: 0; + : 240px; + z-index: 801; +} +#pma_navigation_collapser { + width: 20px; + height: 22px; + line-height: 22px; + background: #eee; + color: #555; + font-weight: bold; + position: fixed; + top: 0; + : px; + text-align: center; + cursor: pointer; + z-index: 800; + text-shadow: 0 1px 0 #fff; + filter: dropshadow(color=#fff, offx=0, offy=1); + border: 1px solid #888; +} + +#navigation_controls_outer { + min-height: 21px !important; +} + +#navigation_controls_outer.activePointer { + background-color: transparent !important; +} + +#navigation_controls { + float: right; + padding-right: 23px; +} + +/* Quick warp links */ +.pma_quick_warp { + margin-top: 5px; + margin-: 2px; + position: relative; +} +.pma_quick_warp .drop_list { + float: ; + margin-: 3px; + padding: 2px 0; +} +.pma_quick_warp .drop_button{ + padding: 0 .3em; + border: 1px solid #ddd; + background: #f2f2f2; + cursor: pointer; +} +.pma_quick_warp .drop_list:hover .drop_button { + background: #fff; +} +.pma_quick_warp .drop_list ul { + position: absolute; + margin: 0; + padding: 0; + overflow: hidden; + overflow-y: auto; + list-style: none; + background: #fff; + border: 1px solid #ddd; + border-top--radius: 0; + border-bottom--radius: 0; + top: 100%; + : 3px; + : 0; + display: none; + z-index: 802; +} +.pma_quick_warp .drop_list:hover ul { + display: block; +} +.pma_quick_warp .drop_list li { + white-space: nowrap; +} +.pma_quick_warp .drop_list li img { + vertical-align: sub; +} +.pma_quick_warp .drop_list li:hover { + background: #f2f2f2; +} +.pma_quick_warp .drop_list a { + display: block; + padding: .1em .3em; +} +.pma_quick_warp .drop_list a.favorite_table_anchor { + clear: left; + float: left; + padding: .1em .3em 0; +} diff --git a/phpMyAdmin/themes/original/css/printview.css b/phpMyAdmin/themes/original/css/printview.css new file mode 100755 index 0000000..809cbdd --- /dev/null +++ b/phpMyAdmin/themes/original/css/printview.css @@ -0,0 +1,169 @@ +@media print { + #back_button_print_view, #print_button_print_view { + display: none; + } +} + +/* For removing element from Print View */ +.print_ignore { + display: none; +} + +.nowrap { + white-space: nowrap; +} + +.hide { + display: none; +} + +/* Standard CSS */ +body, table, th, td { + color: #000; + background-color: #fff; + font-size: 12px; +} + +/* To remove link text decoration */ +a:link { + color:#000; + text-decoration:none +} + +/* To remove any image borders */ +img { + border: 0; +} + +/* Table specific */ +table, th, td { + border: .1em solid #000; + background-color: #fff; +} + +table { + border-collapse: collapse; + border-spacing: 0.2em; +} + +thead { + border-collapse: collapse; + border-spacing: 0.2em; + border: .1em solid #000; + font-weight: 900; +} + +th, td { + padding: 0.2em; +} + +thead th { + font-weight: bold; + background-color: #e5e5e5; + border: .1em solid #000; +} + +th.vtop, td.vtop { + vertical-align: top; +} + +th.vbottom, td.vbottom { + vertical-align: bottom; +} + +/* Common Elements not to be included */ +/* Hide Navigation and Top Menu bar */ +#pma_navigation, #floating_menubar { + display: none; +} +/* Hide console */ +#pma_console_container { + display: none; +} + +/* Hide Navigation items (like Goto Top) */ +#page_nav_icons { + display: none; +} + +/* Hide the Create Table form */ +#create_table_form_minimal { + display: none; +} + +/* Hide the Page Settings Modal box */ +#page_settings_modal { + display: none; +} + +/* Hide footer, Demo notice, errors div */ +#pma_footer, #pma_demo, #pma_errors { + display: none; +} + +/* Hide the #selflink div */ +#selflink { + display: none; +} + +/* Position the main content */ +#page_content { + position: absolute; + left: 0; + top: 0; + width: 95%; + float: none; +} + +/* Specific Class for overriding while Print */ +.print { + background-color: #000; +} + +/* For the Success message div */ +div.success { + background-color: #fff; +} + +.sqlOuter { + color: black; + background-color: #000; +} + +/* For hiding 'Open a New phpMyAdmin Window' button */ +.ic_window-new, .ic_s_cog { + display: none; +} + +.sticky_columns tr { + display: none; +} + +#structure-action-links, #addColumns { + display: none; +} + +/* Hide extra menu on tbl_structure.php */ +#topmenu2 { + display: none; +} + +.cDrop, .cEdit, .cList, .cCpy, .cPointer { + display: none; +} + +/* odd items 1,3,5,7,... */ +table tbody:first-of-type tr:nth-child(odd), +table tbody:first-of-type tr:nth-child(odd) th { + background: #fff; +} + +/* even items 2,4,6,8,... */ +table tbody:first-of-type tr:nth-child(even), +table tbody:first-of-type tr:nth-child(even) th { + background: #DFDFDF; +} + +.column_attribute { + font-size: 100%; +} diff --git a/phpMyAdmin/themes/original/img/ajax_clock_small.gif b/phpMyAdmin/themes/original/img/ajax_clock_small.gif new file mode 100755 index 0000000..bde4932 Binary files /dev/null and b/phpMyAdmin/themes/original/img/ajax_clock_small.gif differ diff --git a/phpMyAdmin/themes/original/img/arrow_ltr.png b/phpMyAdmin/themes/original/img/arrow_ltr.png new file mode 100755 index 0000000..cd79ab4 Binary files /dev/null and b/phpMyAdmin/themes/original/img/arrow_ltr.png differ diff --git a/phpMyAdmin/themes/original/img/arrow_rtl.png b/phpMyAdmin/themes/original/img/arrow_rtl.png new file mode 100755 index 0000000..d035b9d Binary files /dev/null and b/phpMyAdmin/themes/original/img/arrow_rtl.png differ diff --git a/phpMyAdmin/themes/original/img/b_bookmark.png b/phpMyAdmin/themes/original/img/b_bookmark.png new file mode 100755 index 0000000..09b1b58 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_bookmark.png differ diff --git a/phpMyAdmin/themes/original/img/b_browse.png b/phpMyAdmin/themes/original/img/b_browse.png new file mode 100755 index 0000000..440b2e6 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_browse.png differ diff --git a/phpMyAdmin/themes/original/img/b_calendar.png b/phpMyAdmin/themes/original/img/b_calendar.png new file mode 100755 index 0000000..8dfe628 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_calendar.png differ diff --git a/phpMyAdmin/themes/original/img/b_chart.png b/phpMyAdmin/themes/original/img/b_chart.png new file mode 100755 index 0000000..a8c43e6 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_chart.png differ diff --git a/phpMyAdmin/themes/original/img/b_close.png b/phpMyAdmin/themes/original/img/b_close.png new file mode 100755 index 0000000..8d8e98e Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_close.png differ diff --git a/phpMyAdmin/themes/original/img/b_column_add.png b/phpMyAdmin/themes/original/img/b_column_add.png new file mode 100755 index 0000000..57e2a8a Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_column_add.png differ diff --git a/phpMyAdmin/themes/original/img/b_comment.png b/phpMyAdmin/themes/original/img/b_comment.png new file mode 100755 index 0000000..fa2ee94 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_comment.png differ diff --git a/phpMyAdmin/themes/original/img/b_dbstatistics.png b/phpMyAdmin/themes/original/img/b_dbstatistics.png new file mode 100755 index 0000000..fca48f9 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_dbstatistics.png differ diff --git a/phpMyAdmin/themes/original/img/b_deltbl.png b/phpMyAdmin/themes/original/img/b_deltbl.png new file mode 100755 index 0000000..2144bce Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_deltbl.png differ diff --git a/phpMyAdmin/themes/original/img/b_docs.png b/phpMyAdmin/themes/original/img/b_docs.png new file mode 100755 index 0000000..bd47ebc Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_docs.png differ diff --git a/phpMyAdmin/themes/original/img/b_drop.png b/phpMyAdmin/themes/original/img/b_drop.png new file mode 100755 index 0000000..42bea8d Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_drop.png differ diff --git a/phpMyAdmin/themes/original/img/b_edit.png b/phpMyAdmin/themes/original/img/b_edit.png new file mode 100755 index 0000000..2abf081 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_edit.png differ diff --git a/phpMyAdmin/themes/original/img/b_empty.png b/phpMyAdmin/themes/original/img/b_empty.png new file mode 100755 index 0000000..c507185 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_empty.png differ diff --git a/phpMyAdmin/themes/original/img/b_engine.png b/phpMyAdmin/themes/original/img/b_engine.png new file mode 100755 index 0000000..12efc88 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_engine.png differ diff --git a/phpMyAdmin/themes/original/img/b_event_add.png b/phpMyAdmin/themes/original/img/b_event_add.png new file mode 100755 index 0000000..1f31c7c Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_event_add.png differ diff --git a/phpMyAdmin/themes/original/img/b_events.png b/phpMyAdmin/themes/original/img/b_events.png new file mode 100755 index 0000000..07c60ff Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_events.png differ diff --git a/phpMyAdmin/themes/original/img/b_export.png b/phpMyAdmin/themes/original/img/b_export.png new file mode 100755 index 0000000..9a43efd Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_export.png differ diff --git a/phpMyAdmin/themes/original/img/b_favorite.png b/phpMyAdmin/themes/original/img/b_favorite.png new file mode 100755 index 0000000..d4f6578 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_favorite.png differ diff --git a/phpMyAdmin/themes/original/img/b_find_replace.png b/phpMyAdmin/themes/original/img/b_find_replace.png new file mode 100755 index 0000000..a0773af Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_find_replace.png differ diff --git a/phpMyAdmin/themes/original/img/b_ftext.png b/phpMyAdmin/themes/original/img/b_ftext.png new file mode 100755 index 0000000..2ae04d7 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_ftext.png differ diff --git a/phpMyAdmin/themes/original/img/b_globe.gif b/phpMyAdmin/themes/original/img/b_globe.gif new file mode 100755 index 0000000..ef03dcf Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_globe.gif differ diff --git a/phpMyAdmin/themes/original/img/b_group.png b/phpMyAdmin/themes/original/img/b_group.png new file mode 100755 index 0000000..4dd9d0b Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_group.png differ diff --git a/phpMyAdmin/themes/original/img/b_help.png b/phpMyAdmin/themes/original/img/b_help.png new file mode 100755 index 0000000..eddf4d9 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_help.png differ diff --git a/phpMyAdmin/themes/original/img/b_home.png b/phpMyAdmin/themes/original/img/b_home.png new file mode 100755 index 0000000..5bfd8ad Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_home.png differ diff --git a/phpMyAdmin/themes/original/img/b_import.png b/phpMyAdmin/themes/original/img/b_import.png new file mode 100755 index 0000000..ee313da Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_import.png differ diff --git a/phpMyAdmin/themes/original/img/b_index.png b/phpMyAdmin/themes/original/img/b_index.png new file mode 100755 index 0000000..8a76003 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_index.png differ diff --git a/phpMyAdmin/themes/original/img/b_index_add.png b/phpMyAdmin/themes/original/img/b_index_add.png new file mode 100755 index 0000000..78b1216 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_index_add.png differ diff --git a/phpMyAdmin/themes/original/img/b_inline_edit.png b/phpMyAdmin/themes/original/img/b_inline_edit.png new file mode 100755 index 0000000..0d2dab0 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_inline_edit.png differ diff --git a/phpMyAdmin/themes/original/img/b_insrow.png b/phpMyAdmin/themes/original/img/b_insrow.png new file mode 100755 index 0000000..ce32a0a Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_insrow.png differ diff --git a/phpMyAdmin/themes/original/img/b_key.png b/phpMyAdmin/themes/original/img/b_key.png new file mode 100755 index 0000000..9af0869 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_key.png differ diff --git a/phpMyAdmin/themes/original/img/b_minus.png b/phpMyAdmin/themes/original/img/b_minus.png new file mode 100755 index 0000000..668f0da Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_minus.png differ diff --git a/phpMyAdmin/themes/original/img/b_more.png b/phpMyAdmin/themes/original/img/b_more.png new file mode 100755 index 0000000..9d84943 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_more.png differ diff --git a/phpMyAdmin/themes/original/img/b_move.png b/phpMyAdmin/themes/original/img/b_move.png new file mode 100755 index 0000000..7ed238c Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_move.png differ diff --git a/phpMyAdmin/themes/original/img/b_newdb.png b/phpMyAdmin/themes/original/img/b_newdb.png new file mode 100755 index 0000000..9416660 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_newdb.png differ diff --git a/phpMyAdmin/themes/original/img/b_newtbl.png b/phpMyAdmin/themes/original/img/b_newtbl.png new file mode 100755 index 0000000..f675656 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_newtbl.png differ diff --git a/phpMyAdmin/themes/original/img/b_nextpage.png b/phpMyAdmin/themes/original/img/b_nextpage.png new file mode 100755 index 0000000..75a2c67 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_nextpage.png differ diff --git a/phpMyAdmin/themes/original/img/b_no_favorite.png b/phpMyAdmin/themes/original/img/b_no_favorite.png new file mode 100755 index 0000000..0217dc3 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_no_favorite.png differ diff --git a/phpMyAdmin/themes/original/img/b_plugin.png b/phpMyAdmin/themes/original/img/b_plugin.png new file mode 100755 index 0000000..205b9da Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_plugin.png differ diff --git a/phpMyAdmin/themes/original/img/b_plus.png b/phpMyAdmin/themes/original/img/b_plus.png new file mode 100755 index 0000000..22bb1a9 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_plus.png differ diff --git a/phpMyAdmin/themes/original/img/b_primary.png b/phpMyAdmin/themes/original/img/b_primary.png new file mode 100755 index 0000000..25a24ca Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_primary.png differ diff --git a/phpMyAdmin/themes/original/img/b_print.png b/phpMyAdmin/themes/original/img/b_print.png new file mode 100755 index 0000000..892e51f Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_print.png differ diff --git a/phpMyAdmin/themes/original/img/b_props.png b/phpMyAdmin/themes/original/img/b_props.png new file mode 100755 index 0000000..07ad49c Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_props.png differ diff --git a/phpMyAdmin/themes/original/img/b_relations.png b/phpMyAdmin/themes/original/img/b_relations.png new file mode 100755 index 0000000..7c16044 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_relations.png differ diff --git a/phpMyAdmin/themes/original/img/b_report.png b/phpMyAdmin/themes/original/img/b_report.png new file mode 100755 index 0000000..f5b57cd Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_report.png differ diff --git a/phpMyAdmin/themes/original/img/b_routine_add.png b/phpMyAdmin/themes/original/img/b_routine_add.png new file mode 100755 index 0000000..78517c1 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_routine_add.png differ diff --git a/phpMyAdmin/themes/original/img/b_routines.png b/phpMyAdmin/themes/original/img/b_routines.png new file mode 100755 index 0000000..439899b Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_routines.png differ diff --git a/phpMyAdmin/themes/original/img/b_save.png b/phpMyAdmin/themes/original/img/b_save.png new file mode 100755 index 0000000..c35f004 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_save.png differ diff --git a/phpMyAdmin/themes/original/img/b_saveimage.png b/phpMyAdmin/themes/original/img/b_saveimage.png new file mode 100755 index 0000000..0bc614a Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_saveimage.png differ diff --git a/phpMyAdmin/themes/original/img/b_sbrowse.png b/phpMyAdmin/themes/original/img/b_sbrowse.png new file mode 100755 index 0000000..f69952c Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_sbrowse.png differ diff --git a/phpMyAdmin/themes/original/img/b_search.png b/phpMyAdmin/themes/original/img/b_search.png new file mode 100755 index 0000000..6f34d0a Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_search.png differ diff --git a/phpMyAdmin/themes/original/img/b_select.png b/phpMyAdmin/themes/original/img/b_select.png new file mode 100755 index 0000000..a83a013 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_select.png differ diff --git a/phpMyAdmin/themes/original/img/b_snewtbl.png b/phpMyAdmin/themes/original/img/b_snewtbl.png new file mode 100755 index 0000000..f881dfd Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_snewtbl.png differ diff --git a/phpMyAdmin/themes/original/img/b_spatial.png b/phpMyAdmin/themes/original/img/b_spatial.png new file mode 100755 index 0000000..6498e45 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_spatial.png differ diff --git a/phpMyAdmin/themes/original/img/b_sql.png b/phpMyAdmin/themes/original/img/b_sql.png new file mode 100755 index 0000000..218a64c Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_sql.png differ diff --git a/phpMyAdmin/themes/original/img/b_sqlhelp.png b/phpMyAdmin/themes/original/img/b_sqlhelp.png new file mode 100755 index 0000000..3f4f59d Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_sqlhelp.png differ diff --git a/phpMyAdmin/themes/original/img/b_table_add.png b/phpMyAdmin/themes/original/img/b_table_add.png new file mode 100755 index 0000000..783e08b Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_table_add.png differ diff --git a/phpMyAdmin/themes/original/img/b_tblanalyse.png b/phpMyAdmin/themes/original/img/b_tblanalyse.png new file mode 100755 index 0000000..6809a2d Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_tblanalyse.png differ diff --git a/phpMyAdmin/themes/original/img/b_tblexport.png b/phpMyAdmin/themes/original/img/b_tblexport.png new file mode 100755 index 0000000..9886204 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_tblexport.png differ diff --git a/phpMyAdmin/themes/original/img/b_tblimport.png b/phpMyAdmin/themes/original/img/b_tblimport.png new file mode 100755 index 0000000..8d0c3d9 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_tblimport.png differ diff --git a/phpMyAdmin/themes/original/img/b_tblops.png b/phpMyAdmin/themes/original/img/b_tblops.png new file mode 100755 index 0000000..b71f7e0 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_tblops.png differ diff --git a/phpMyAdmin/themes/original/img/b_tbloptimize.png b/phpMyAdmin/themes/original/img/b_tbloptimize.png new file mode 100755 index 0000000..0c8425c Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_tbloptimize.png differ diff --git a/phpMyAdmin/themes/original/img/b_tipp.png b/phpMyAdmin/themes/original/img/b_tipp.png new file mode 100755 index 0000000..2cc774f Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_tipp.png differ diff --git a/phpMyAdmin/themes/original/img/b_trigger_add.png b/phpMyAdmin/themes/original/img/b_trigger_add.png new file mode 100755 index 0000000..920a2a4 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_trigger_add.png differ diff --git a/phpMyAdmin/themes/original/img/b_triggers.png b/phpMyAdmin/themes/original/img/b_triggers.png new file mode 100755 index 0000000..2ee1dc6 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_triggers.png differ diff --git a/phpMyAdmin/themes/original/img/b_undo.png b/phpMyAdmin/themes/original/img/b_undo.png new file mode 100755 index 0000000..fef0fa4 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_undo.png differ diff --git a/phpMyAdmin/themes/original/img/b_unique.png b/phpMyAdmin/themes/original/img/b_unique.png new file mode 100755 index 0000000..dc85077 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_unique.png differ diff --git a/phpMyAdmin/themes/original/img/b_usradd.png b/phpMyAdmin/themes/original/img/b_usradd.png new file mode 100755 index 0000000..5596b86 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_usradd.png differ diff --git a/phpMyAdmin/themes/original/img/b_usrcheck.png b/phpMyAdmin/themes/original/img/b_usrcheck.png new file mode 100755 index 0000000..dae06da Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_usrcheck.png differ diff --git a/phpMyAdmin/themes/original/img/b_usrdrop.png b/phpMyAdmin/themes/original/img/b_usrdrop.png new file mode 100755 index 0000000..b407e7b Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_usrdrop.png differ diff --git a/phpMyAdmin/themes/original/img/b_usredit.png b/phpMyAdmin/themes/original/img/b_usredit.png new file mode 100755 index 0000000..ed6c75a Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_usredit.png differ diff --git a/phpMyAdmin/themes/original/img/b_usrlist.png b/phpMyAdmin/themes/original/img/b_usrlist.png new file mode 100755 index 0000000..0b43fa0 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_usrlist.png differ diff --git a/phpMyAdmin/themes/original/img/b_versions.png b/phpMyAdmin/themes/original/img/b_versions.png new file mode 100755 index 0000000..c253dc0 Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_versions.png differ diff --git a/phpMyAdmin/themes/original/img/b_view.png b/phpMyAdmin/themes/original/img/b_view.png new file mode 100755 index 0000000..204b10d Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_view.png differ diff --git a/phpMyAdmin/themes/original/img/b_view_add.png b/phpMyAdmin/themes/original/img/b_view_add.png new file mode 100755 index 0000000..2a6cfaf Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_view_add.png differ diff --git a/phpMyAdmin/themes/original/img/b_views.png b/phpMyAdmin/themes/original/img/b_views.png new file mode 100755 index 0000000..a368d6a Binary files /dev/null and b/phpMyAdmin/themes/original/img/b_views.png differ diff --git a/phpMyAdmin/themes/original/img/bd_browse.png b/phpMyAdmin/themes/original/img/bd_browse.png new file mode 100755 index 0000000..f954786 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_browse.png differ diff --git a/phpMyAdmin/themes/original/img/bd_deltbl.png b/phpMyAdmin/themes/original/img/bd_deltbl.png new file mode 100755 index 0000000..b05b74b Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_deltbl.png differ diff --git a/phpMyAdmin/themes/original/img/bd_drop.png b/phpMyAdmin/themes/original/img/bd_drop.png new file mode 100755 index 0000000..4591b9d Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_drop.png differ diff --git a/phpMyAdmin/themes/original/img/bd_edit.png b/phpMyAdmin/themes/original/img/bd_edit.png new file mode 100755 index 0000000..722afc1 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_edit.png differ diff --git a/phpMyAdmin/themes/original/img/bd_empty.png b/phpMyAdmin/themes/original/img/bd_empty.png new file mode 100755 index 0000000..f1800d0 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_empty.png differ diff --git a/phpMyAdmin/themes/original/img/bd_export.png b/phpMyAdmin/themes/original/img/bd_export.png new file mode 100755 index 0000000..bfcacf4 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_export.png differ diff --git a/phpMyAdmin/themes/original/img/bd_ftext.png b/phpMyAdmin/themes/original/img/bd_ftext.png new file mode 100755 index 0000000..8e1a115 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_ftext.png differ diff --git a/phpMyAdmin/themes/original/img/bd_index.png b/phpMyAdmin/themes/original/img/bd_index.png new file mode 100755 index 0000000..b47a488 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_index.png differ diff --git a/phpMyAdmin/themes/original/img/bd_insrow.png b/phpMyAdmin/themes/original/img/bd_insrow.png new file mode 100755 index 0000000..b325ffa Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_insrow.png differ diff --git a/phpMyAdmin/themes/original/img/bd_nextpage.png b/phpMyAdmin/themes/original/img/bd_nextpage.png new file mode 100755 index 0000000..fd12125 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_nextpage.png differ diff --git a/phpMyAdmin/themes/original/img/bd_primary.png b/phpMyAdmin/themes/original/img/bd_primary.png new file mode 100755 index 0000000..e1d9152 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_primary.png differ diff --git a/phpMyAdmin/themes/original/img/bd_routine_add.png b/phpMyAdmin/themes/original/img/bd_routine_add.png new file mode 100755 index 0000000..6f45cbd Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_routine_add.png differ diff --git a/phpMyAdmin/themes/original/img/bd_sbrowse.png b/phpMyAdmin/themes/original/img/bd_sbrowse.png new file mode 100755 index 0000000..c820422 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_sbrowse.png differ diff --git a/phpMyAdmin/themes/original/img/bd_select.png b/phpMyAdmin/themes/original/img/bd_select.png new file mode 100755 index 0000000..2cc9498 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_select.png differ diff --git a/phpMyAdmin/themes/original/img/bd_spatial.png b/phpMyAdmin/themes/original/img/bd_spatial.png new file mode 100755 index 0000000..16f3b38 Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_spatial.png differ diff --git a/phpMyAdmin/themes/original/img/bd_unique.png b/phpMyAdmin/themes/original/img/bd_unique.png new file mode 100755 index 0000000..7aa38db Binary files /dev/null and b/phpMyAdmin/themes/original/img/bd_unique.png differ diff --git a/phpMyAdmin/themes/original/img/centralColumns.png b/phpMyAdmin/themes/original/img/centralColumns.png new file mode 100755 index 0000000..4b94c9f Binary files /dev/null and b/phpMyAdmin/themes/original/img/centralColumns.png differ diff --git a/phpMyAdmin/themes/original/img/centralColumns_add.png b/phpMyAdmin/themes/original/img/centralColumns_add.png new file mode 100755 index 0000000..7282564 Binary files /dev/null and b/phpMyAdmin/themes/original/img/centralColumns_add.png differ diff --git a/phpMyAdmin/themes/original/img/centralColumns_delete.png b/phpMyAdmin/themes/original/img/centralColumns_delete.png new file mode 100755 index 0000000..98d6b05 Binary files /dev/null and b/phpMyAdmin/themes/original/img/centralColumns_delete.png differ diff --git a/phpMyAdmin/themes/original/img/cleardot.gif b/phpMyAdmin/themes/original/img/cleardot.gif new file mode 100755 index 0000000..a9d7bea Binary files /dev/null and b/phpMyAdmin/themes/original/img/cleardot.gif differ diff --git a/phpMyAdmin/themes/original/img/col_drop.png b/phpMyAdmin/themes/original/img/col_drop.png new file mode 100755 index 0000000..9d84943 Binary files /dev/null and b/phpMyAdmin/themes/original/img/col_drop.png differ diff --git a/phpMyAdmin/themes/original/img/col_pointer.png b/phpMyAdmin/themes/original/img/col_pointer.png new file mode 100755 index 0000000..041fbf2 Binary files /dev/null and b/phpMyAdmin/themes/original/img/col_pointer.png differ diff --git a/phpMyAdmin/themes/original/img/col_pointer_ver.png b/phpMyAdmin/themes/original/img/col_pointer_ver.png new file mode 100755 index 0000000..79766f2 Binary files /dev/null and b/phpMyAdmin/themes/original/img/col_pointer_ver.png differ diff --git a/phpMyAdmin/themes/original/img/console.png b/phpMyAdmin/themes/original/img/console.png new file mode 100755 index 0000000..ad351da Binary files /dev/null and b/phpMyAdmin/themes/original/img/console.png differ diff --git a/phpMyAdmin/themes/original/img/east-mini.png b/phpMyAdmin/themes/original/img/east-mini.png new file mode 100755 index 0000000..6685939 Binary files /dev/null and b/phpMyAdmin/themes/original/img/east-mini.png differ diff --git a/phpMyAdmin/themes/original/img/error.ico b/phpMyAdmin/themes/original/img/error.ico new file mode 100755 index 0000000..b5c0618 Binary files /dev/null and b/phpMyAdmin/themes/original/img/error.ico differ diff --git a/phpMyAdmin/themes/original/img/eye.png b/phpMyAdmin/themes/original/img/eye.png new file mode 100755 index 0000000..6c9972e Binary files /dev/null and b/phpMyAdmin/themes/original/img/eye.png differ diff --git a/phpMyAdmin/themes/original/img/eye_grey.png b/phpMyAdmin/themes/original/img/eye_grey.png new file mode 100755 index 0000000..0dc92a9 Binary files /dev/null and b/phpMyAdmin/themes/original/img/eye_grey.png differ diff --git a/phpMyAdmin/themes/original/img/hide.png b/phpMyAdmin/themes/original/img/hide.png new file mode 100755 index 0000000..2c91443 Binary files /dev/null and b/phpMyAdmin/themes/original/img/hide.png differ diff --git a/phpMyAdmin/themes/original/img/lightbulb.png b/phpMyAdmin/themes/original/img/lightbulb.png new file mode 100755 index 0000000..0cead20 Binary files /dev/null and b/phpMyAdmin/themes/original/img/lightbulb.png differ diff --git a/phpMyAdmin/themes/original/img/lightbulb_off.png b/phpMyAdmin/themes/original/img/lightbulb_off.png new file mode 100755 index 0000000..dd3632d Binary files /dev/null and b/phpMyAdmin/themes/original/img/lightbulb_off.png differ diff --git a/phpMyAdmin/themes/original/img/logo_left.png b/phpMyAdmin/themes/original/img/logo_left.png new file mode 100755 index 0000000..004e705 Binary files /dev/null and b/phpMyAdmin/themes/original/img/logo_left.png differ diff --git a/phpMyAdmin/themes/original/img/logo_right.png b/phpMyAdmin/themes/original/img/logo_right.png new file mode 100755 index 0000000..a490289 Binary files /dev/null and b/phpMyAdmin/themes/original/img/logo_right.png differ diff --git a/phpMyAdmin/themes/original/img/more.png b/phpMyAdmin/themes/original/img/more.png new file mode 100755 index 0000000..ac803c4 Binary files /dev/null and b/phpMyAdmin/themes/original/img/more.png differ diff --git a/phpMyAdmin/themes/original/img/new_data.png b/phpMyAdmin/themes/original/img/new_data.png new file mode 100755 index 0000000..c173bc0 Binary files /dev/null and b/phpMyAdmin/themes/original/img/new_data.png differ diff --git a/phpMyAdmin/themes/original/img/new_data_hovered.png b/phpMyAdmin/themes/original/img/new_data_hovered.png new file mode 100755 index 0000000..73b09a6 Binary files /dev/null and b/phpMyAdmin/themes/original/img/new_data_hovered.png differ diff --git a/phpMyAdmin/themes/original/img/new_data_selected.png b/phpMyAdmin/themes/original/img/new_data_selected.png new file mode 100755 index 0000000..a75abe3 Binary files /dev/null and b/phpMyAdmin/themes/original/img/new_data_selected.png differ diff --git a/phpMyAdmin/themes/original/img/new_data_selected_hovered.png b/phpMyAdmin/themes/original/img/new_data_selected_hovered.png new file mode 100755 index 0000000..7091ae3 Binary files /dev/null and b/phpMyAdmin/themes/original/img/new_data_selected_hovered.png differ diff --git a/phpMyAdmin/themes/original/img/new_struct.png b/phpMyAdmin/themes/original/img/new_struct.png new file mode 100755 index 0000000..79fe646 Binary files /dev/null and b/phpMyAdmin/themes/original/img/new_struct.png differ diff --git a/phpMyAdmin/themes/original/img/new_struct_hovered.png b/phpMyAdmin/themes/original/img/new_struct_hovered.png new file mode 100755 index 0000000..b29aaed Binary files /dev/null and b/phpMyAdmin/themes/original/img/new_struct_hovered.png differ diff --git a/phpMyAdmin/themes/original/img/new_struct_selected.png b/phpMyAdmin/themes/original/img/new_struct_selected.png new file mode 100755 index 0000000..bc61749 Binary files /dev/null and b/phpMyAdmin/themes/original/img/new_struct_selected.png differ diff --git a/phpMyAdmin/themes/original/img/new_struct_selected_hovered.png b/phpMyAdmin/themes/original/img/new_struct_selected_hovered.png new file mode 100755 index 0000000..9a82bc4 Binary files /dev/null and b/phpMyAdmin/themes/original/img/new_struct_selected_hovered.png differ diff --git a/phpMyAdmin/themes/original/img/normalize.png b/phpMyAdmin/themes/original/img/normalize.png new file mode 100755 index 0000000..5f8e95f Binary files /dev/null and b/phpMyAdmin/themes/original/img/normalize.png differ diff --git a/phpMyAdmin/themes/original/img/north-mini.png b/phpMyAdmin/themes/original/img/north-mini.png new file mode 100755 index 0000000..c3b6062 Binary files /dev/null and b/phpMyAdmin/themes/original/img/north-mini.png differ diff --git a/phpMyAdmin/themes/original/img/pause.png b/phpMyAdmin/themes/original/img/pause.png new file mode 100755 index 0000000..0271217 Binary files /dev/null and b/phpMyAdmin/themes/original/img/pause.png differ diff --git a/phpMyAdmin/themes/original/img/play.png b/phpMyAdmin/themes/original/img/play.png new file mode 100755 index 0000000..75a2c67 Binary files /dev/null and b/phpMyAdmin/themes/original/img/play.png differ diff --git a/phpMyAdmin/themes/original/img/s_asc.png b/phpMyAdmin/themes/original/img/s_asc.png new file mode 100755 index 0000000..42ec955 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_asc.png differ diff --git a/phpMyAdmin/themes/original/img/s_asci.png b/phpMyAdmin/themes/original/img/s_asci.png new file mode 100755 index 0000000..57267f4 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_asci.png differ diff --git a/phpMyAdmin/themes/original/img/s_attention.png b/phpMyAdmin/themes/original/img/s_attention.png new file mode 100755 index 0000000..5a536e8 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_attention.png differ diff --git a/phpMyAdmin/themes/original/img/s_cancel.png b/phpMyAdmin/themes/original/img/s_cancel.png new file mode 100755 index 0000000..f101a88 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_cancel.png differ diff --git a/phpMyAdmin/themes/original/img/s_cog.png b/phpMyAdmin/themes/original/img/s_cog.png new file mode 100755 index 0000000..5f40f73 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_cog.png differ diff --git a/phpMyAdmin/themes/original/img/s_collapseall.png b/phpMyAdmin/themes/original/img/s_collapseall.png new file mode 100755 index 0000000..3d56b7c Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_collapseall.png differ diff --git a/phpMyAdmin/themes/original/img/s_db.png b/phpMyAdmin/themes/original/img/s_db.png new file mode 100755 index 0000000..2e35e05 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_db.png differ diff --git a/phpMyAdmin/themes/original/img/s_desc.png b/phpMyAdmin/themes/original/img/s_desc.png new file mode 100755 index 0000000..cc8804c Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_desc.png differ diff --git a/phpMyAdmin/themes/original/img/s_error.png b/phpMyAdmin/themes/original/img/s_error.png new file mode 100755 index 0000000..448225c Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_error.png differ diff --git a/phpMyAdmin/themes/original/img/s_fulltext.png b/phpMyAdmin/themes/original/img/s_fulltext.png new file mode 100755 index 0000000..b810b0c Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_fulltext.png differ diff --git a/phpMyAdmin/themes/original/img/s_host.png b/phpMyAdmin/themes/original/img/s_host.png new file mode 100755 index 0000000..4ff1ce8 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_host.png differ diff --git a/phpMyAdmin/themes/original/img/s_info.png b/phpMyAdmin/themes/original/img/s_info.png new file mode 100755 index 0000000..b697ddd Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_info.png differ diff --git a/phpMyAdmin/themes/original/img/s_lang.png b/phpMyAdmin/themes/original/img/s_lang.png new file mode 100755 index 0000000..abbb88a Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_lang.png differ diff --git a/phpMyAdmin/themes/original/img/s_link.png b/phpMyAdmin/themes/original/img/s_link.png new file mode 100755 index 0000000..609970a Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_link.png differ diff --git a/phpMyAdmin/themes/original/img/s_lock.png b/phpMyAdmin/themes/original/img/s_lock.png new file mode 100755 index 0000000..5525894 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_lock.png differ diff --git a/phpMyAdmin/themes/original/img/s_loggoff.png b/phpMyAdmin/themes/original/img/s_loggoff.png new file mode 100755 index 0000000..ac5ccde Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_loggoff.png differ diff --git a/phpMyAdmin/themes/original/img/s_notice.png b/phpMyAdmin/themes/original/img/s_notice.png new file mode 100755 index 0000000..64d1722 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_notice.png differ diff --git a/phpMyAdmin/themes/original/img/s_okay.png b/phpMyAdmin/themes/original/img/s_okay.png new file mode 100755 index 0000000..9bf9235 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_okay.png differ diff --git a/phpMyAdmin/themes/original/img/s_partialtext.png b/phpMyAdmin/themes/original/img/s_partialtext.png new file mode 100755 index 0000000..a8fbb34 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_partialtext.png differ diff --git a/phpMyAdmin/themes/original/img/s_passwd.png b/phpMyAdmin/themes/original/img/s_passwd.png new file mode 100755 index 0000000..c705bd5 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_passwd.png differ diff --git a/phpMyAdmin/themes/original/img/s_really.png b/phpMyAdmin/themes/original/img/s_really.png new file mode 100755 index 0000000..e48c9cd Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_really.png differ diff --git a/phpMyAdmin/themes/original/img/s_reload.png b/phpMyAdmin/themes/original/img/s_reload.png new file mode 100755 index 0000000..cc0b9e5 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_reload.png differ diff --git a/phpMyAdmin/themes/original/img/s_replication.png b/phpMyAdmin/themes/original/img/s_replication.png new file mode 100755 index 0000000..c5c5a5c Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_replication.png differ diff --git a/phpMyAdmin/themes/original/img/s_rights.png b/phpMyAdmin/themes/original/img/s_rights.png new file mode 100755 index 0000000..bae32e7 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_rights.png differ diff --git a/phpMyAdmin/themes/original/img/s_sortable.png b/phpMyAdmin/themes/original/img/s_sortable.png new file mode 100755 index 0000000..c64bd35 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_sortable.png differ diff --git a/phpMyAdmin/themes/original/img/s_status.png b/phpMyAdmin/themes/original/img/s_status.png new file mode 100755 index 0000000..d53c1eb Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_status.png differ diff --git a/phpMyAdmin/themes/original/img/s_success.png b/phpMyAdmin/themes/original/img/s_success.png new file mode 100755 index 0000000..fd2cee9 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_success.png differ diff --git a/phpMyAdmin/themes/original/img/s_sync.png b/phpMyAdmin/themes/original/img/s_sync.png new file mode 100755 index 0000000..5ced64c Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_sync.png differ diff --git a/phpMyAdmin/themes/original/img/s_tbl.png b/phpMyAdmin/themes/original/img/s_tbl.png new file mode 100755 index 0000000..a3782a9 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_tbl.png differ diff --git a/phpMyAdmin/themes/original/img/s_theme.png b/phpMyAdmin/themes/original/img/s_theme.png new file mode 100755 index 0000000..156cd43 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_theme.png differ diff --git a/phpMyAdmin/themes/original/img/s_top.png b/phpMyAdmin/themes/original/img/s_top.png new file mode 100755 index 0000000..dd57623 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_top.png differ diff --git a/phpMyAdmin/themes/original/img/s_unlink.png b/phpMyAdmin/themes/original/img/s_unlink.png new file mode 100755 index 0000000..551679e Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_unlink.png differ diff --git a/phpMyAdmin/themes/original/img/s_vars.png b/phpMyAdmin/themes/original/img/s_vars.png new file mode 100755 index 0000000..b7ff721 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_vars.png differ diff --git a/phpMyAdmin/themes/original/img/s_views.png b/phpMyAdmin/themes/original/img/s_views.png new file mode 100755 index 0000000..568d3c3 Binary files /dev/null and b/phpMyAdmin/themes/original/img/s_views.png differ diff --git a/phpMyAdmin/themes/original/img/show.png b/phpMyAdmin/themes/original/img/show.png new file mode 100755 index 0000000..666653f Binary files /dev/null and b/phpMyAdmin/themes/original/img/show.png differ diff --git a/phpMyAdmin/themes/original/img/south-mini.png b/phpMyAdmin/themes/original/img/south-mini.png new file mode 100755 index 0000000..654673b Binary files /dev/null and b/phpMyAdmin/themes/original/img/south-mini.png differ diff --git a/phpMyAdmin/themes/original/img/spacer.png b/phpMyAdmin/themes/original/img/spacer.png new file mode 100755 index 0000000..240ca4f Binary files /dev/null and b/phpMyAdmin/themes/original/img/spacer.png differ diff --git a/phpMyAdmin/themes/original/img/toggle-ltr.png b/phpMyAdmin/themes/original/img/toggle-ltr.png new file mode 100755 index 0000000..2ea417f Binary files /dev/null and b/phpMyAdmin/themes/original/img/toggle-ltr.png differ diff --git a/phpMyAdmin/themes/original/img/toggle-rtl.png b/phpMyAdmin/themes/original/img/toggle-rtl.png new file mode 100755 index 0000000..399b06d Binary files /dev/null and b/phpMyAdmin/themes/original/img/toggle-rtl.png differ diff --git a/phpMyAdmin/themes/original/img/vertical_line.png b/phpMyAdmin/themes/original/img/vertical_line.png new file mode 100755 index 0000000..a88a7c7 Binary files /dev/null and b/phpMyAdmin/themes/original/img/vertical_line.png differ diff --git a/phpMyAdmin/themes/original/img/west-mini.png b/phpMyAdmin/themes/original/img/west-mini.png new file mode 100755 index 0000000..61ad92e Binary files /dev/null and b/phpMyAdmin/themes/original/img/west-mini.png differ diff --git a/phpMyAdmin/themes/original/img/window-new.png b/phpMyAdmin/themes/original/img/window-new.png new file mode 100755 index 0000000..d18722f Binary files /dev/null and b/phpMyAdmin/themes/original/img/window-new.png differ diff --git a/phpMyAdmin/themes/original/img/zoom-minus-mini.png b/phpMyAdmin/themes/original/img/zoom-minus-mini.png new file mode 100755 index 0000000..1b8d84d Binary files /dev/null and b/phpMyAdmin/themes/original/img/zoom-minus-mini.png differ diff --git a/phpMyAdmin/themes/original/img/zoom-plus-mini.png b/phpMyAdmin/themes/original/img/zoom-plus-mini.png new file mode 100755 index 0000000..466cc7b Binary files /dev/null and b/phpMyAdmin/themes/original/img/zoom-plus-mini.png differ diff --git a/phpMyAdmin/themes/original/img/zoom-world-mini.png b/phpMyAdmin/themes/original/img/zoom-world-mini.png new file mode 100755 index 0000000..dcc60f1 Binary files /dev/null and b/phpMyAdmin/themes/original/img/zoom-world-mini.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100755 index 0000000..534c590 Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_65_ffffff_1x400.png b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100755 index 0000000..3e56dbd Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_75_dadada_1x400.png b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_75_dadada_1x400.png new file mode 100755 index 0000000..6b8b33a Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100755 index 0000000..81e2065 Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_95_fef1ec_1x400.png b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100755 index 0000000..7172755 Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/phpMyAdmin/themes/original/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100755 index 0000000..ae3ccae Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-icons_222222_256x240.png b/phpMyAdmin/themes/original/jquery/images/ui-icons_222222_256x240.png new file mode 100755 index 0000000..3201d9a Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-icons_222222_256x240.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-icons_2e83ff_256x240.png b/phpMyAdmin/themes/original/jquery/images/ui-icons_2e83ff_256x240.png new file mode 100755 index 0000000..1d920d7 Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-icons_2e83ff_256x240.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-icons_454545_256x240.png b/phpMyAdmin/themes/original/jquery/images/ui-icons_454545_256x240.png new file mode 100755 index 0000000..47da8e5 Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-icons_454545_256x240.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-icons_888888_256x240.png b/phpMyAdmin/themes/original/jquery/images/ui-icons_888888_256x240.png new file mode 100755 index 0000000..95e0c3e Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-icons_888888_256x240.png differ diff --git a/phpMyAdmin/themes/original/jquery/images/ui-icons_cd0a0a_256x240.png b/phpMyAdmin/themes/original/jquery/images/ui-icons_cd0a0a_256x240.png new file mode 100755 index 0000000..0ea8a5a Binary files /dev/null and b/phpMyAdmin/themes/original/jquery/images/ui-icons_cd0a0a_256x240.png differ diff --git a/phpMyAdmin/themes/original/jquery/jquery-ui.css b/phpMyAdmin/themes/original/jquery/jquery-ui.css new file mode 100755 index 0000000..1ebcbc9 --- /dev/null +++ b/phpMyAdmin/themes/original/jquery/jquery-ui.css @@ -0,0 +1,1312 @@ +/*! jQuery UI - v1.12.1 - 2016-12-21 +* http://jqueryui.com +* Includes: draggable.css, core.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=smoothness&cornerRadiusShadow=8px&offsetLeftShadow=-8px&offsetTopShadow=-8px&thicknessShadow=8px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=aaaaaa&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cd0a0a&fcError=cd0a0a&borderColorError=cd0a0a&bgImgOpacityError=95&bgTextureError=glass&bgColorError=fef1ec&iconColorHighlight=2e83ff&fcHighlight=363636&borderColorHighlight=fcefa1&bgImgOpacityHighlight=55&bgTextureHighlight=glass&bgColorHighlight=fbf9ee&iconColorActive=454545&fcActive=212121&borderColorActive=aaaaaa&bgImgOpacityActive=65&bgTextureActive=glass&bgColorActive=ffffff&iconColorHover=454545&fcHover=212121&borderColorHover=999999&bgImgOpacityHover=75&bgTextureHover=glass&bgColorHover=dadada&iconColorDefault=888888&fcDefault=555555&borderColorDefault=d3d3d3&bgImgOpacityDefault=75&bgTextureDefault=glass&bgColorDefault=e6e6e6&iconColorContent=222222&fcContent=222222&borderColorContent=aaaaaa&bgImgOpacityContent=75&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=222222&fcHeader=222222&borderColorHeader=aaaaaa&bgImgOpacityHeader=75&bgTextureHeader=highlight_soft&bgColorHeader=cccccc&cornerRadius=4px&fsDefault=1.1em&fwDefault=normal&ffDefault=Verdana%2CArial%2Csans-serif +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +.ui-draggable-handle { + -ms-touch-action: none; + touch-action: none; +} +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); /* support: IE8 */ +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; + pointer-events: none; +} + + +/* Icons +----------------------------------*/ +.ui-icon { + display: inline-block; + vertical-align: middle; + margin-top: -.25em; + position: relative; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + +.ui-widget-icon-block { + left: 50%; + margin-left: -8px; + display: block; +} + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable { + -ms-touch-action: none; + touch-action: none; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-sortable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + font-size: 100%; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: 0; +} +.ui-menu .ui-menu { + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + cursor: pointer; + /* support: IE10, see #8844 */ + list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); +} +.ui-menu .ui-menu-item-wrapper { + position: relative; + padding: 3px 1em 3px .4em; +} +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: -1px; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item-wrapper { + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + left: auto; + right: 0; +} +.ui-button { + padding: .4em 1em; + display: inline-block; + position: relative; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + /* Support: IE <= 11 */ + overflow: visible; +} + +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} + +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2em; + box-sizing: border-box; + text-indent: -9999px; + white-space: nowrap; +} + +/* no icon support for input elements */ +input.ui-button.ui-button-icon-only { + text-indent: 0; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon { + position: absolute; + top: 50%; + left: 50%; + margin-top: -8px; + margin-left: -8px; +} + +.ui-button.ui-icon-notext .ui-icon { + padding: 0; + width: 2.1em; + height: 2.1em; + text-indent: -9999px; + white-space: nowrap; + +} + +input.ui-button.ui-icon-notext .ui-icon { + width: auto; + height: auto; + text-indent: 0; + white-space: normal; + padding: .4em 1em; +} + +/* workarounds */ +/* Support: Firefox 5 - 40 */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-controlgroup { + vertical-align: middle; + display: inline-block; +} +.ui-controlgroup > .ui-controlgroup-item { + float: left; + margin-left: 0; + margin-right: 0; +} +.ui-controlgroup > .ui-controlgroup-item:focus, +.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { + z-index: 9999; +} +.ui-controlgroup-vertical > .ui-controlgroup-item { + display: block; + float: none; + width: 100%; + margin-top: 0; + margin-bottom: 0; + text-align: left; +} +.ui-controlgroup-vertical .ui-controlgroup-item { + box-sizing: border-box; +} +.ui-controlgroup .ui-controlgroup-label { + padding: .4em 1em; +} +.ui-controlgroup .ui-controlgroup-label span { + font-size: 80%; +} +.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { + border-left: none; +} +.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { + border-top: none; +} +.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { + border-right: none; +} +.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { + border-bottom: none; +} + +/* Spinner specific style fixes */ +.ui-controlgroup-vertical .ui-spinner-input { + + /* Support: IE8 only, Android < 4.4 only */ + width: 75%; + width: calc( 100% - 2.4em ); +} +.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { + border-top-style: solid; +} + +.ui-checkboxradio-label .ui-icon-background { + box-shadow: inset 1px 1px 1px #ccc; + border-radius: .12em; + border: none; +} +.ui-checkboxradio-radio-label .ui-icon-background { + width: 16px; + height: 16px; + border-radius: 1em; + overflow: visible; + border: none; +} +.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, +.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { + background-image: none; + width: 8px; + height: 8px; + border-width: 4px; + border-style: solid; +} +.ui-checkboxradio-disabled { + pointer-events: none; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 45%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} + +/* Icons */ +.ui-datepicker .ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; + left: .5em; + top: .3em; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-n { + height: 2px; + top: 0; +} +.ui-dialog .ui-resizable-e { + width: 2px; + right: 0; +} +.ui-dialog .ui-resizable-s { + height: 2px; + bottom: 0; +} +.ui-dialog .ui-resizable-w { + width: 2px; + left: 0; +} +.ui-dialog .ui-resizable-se, +.ui-dialog .ui-resizable-sw, +.ui-dialog .ui-resizable-ne, +.ui-dialog .ui-resizable-nw { + width: 7px; + height: 7px; +} +.ui-dialog .ui-resizable-se { + right: 0; + bottom: 0; +} +.ui-dialog .ui-resizable-sw { + left: 0; + bottom: 0; +} +.ui-dialog .ui-resizable-ne { + right: 0; + top: 0; +} +.ui-dialog .ui-resizable-nw { + left: 0; + top: 0; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); + height: 100%; + filter: alpha(opacity=25); /* support: IE8 */ + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-selectmenu-menu { + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + display: none; +} +.ui-selectmenu-menu .ui-menu { + overflow: auto; + overflow-x: hidden; + padding-bottom: 1px; +} +.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { + font-size: 1em; + font-weight: bold; + line-height: 1.5; + padding: 2px 0.4em; + margin: 0.5em 0 0 0; + height: auto; + border: 0; +} +.ui-selectmenu-open { + display: block; +} +.ui-selectmenu-text { + display: block; + margin-right: 20px; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-selectmenu-button.ui-button { + text-align: left; + white-space: nowrap; + width: 14em; +} +.ui-selectmenu-icon.ui-icon { + float: right; + margin-top: 0; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; + -ms-touch-action: none; + touch-action: none; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* support: IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: .222em 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 2em; +} +.ui-spinner-button { + width: 1.6em; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to override default borders */ +.ui-spinner a.ui-spinner-button { + border-top-style: none; + border-bottom-style: none; + border-right-style: none; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text; +} +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget.ui-widget-content { + border: 1px solid #d3d3d3; +} +.ui-widget-content { + border: 1px solid #aaaaaa; + background: #ffffff; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #aaaaaa; + background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default, +.ui-button, + +/* We use html here because we need a greater specificity to make sure disabled +works properly when clicked or hovered */ +html .ui-button.ui-state-disabled:hover, +html .ui-button.ui-state-disabled:active { + border: 1px solid #d3d3d3; + background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited, +a.ui-button, +a:link.ui-button, +a:visited.ui-button, +.ui-button { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus, +.ui-button:hover, +.ui-button:focus { + border: 1px solid #999999; + background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited, +a.ui-button:hover, +a.ui-button:focus { + color: #212121; + text-decoration: none; +} + +.ui-visual-focus { + box-shadow: 0 0 3px 1px rgb(94, 158, 214); +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + border: 1px solid #aaaaaa; + background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-icon-background, +.ui-state-active .ui-icon-background { + border: #aaaaaa; + background-color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; + color: #363636; +} +.ui-state-checked { + border: 1px solid #fcefa1; + background: #fbf9ee; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); /* support: IE8 */ + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); /* support: IE8 */ + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url("images/ui-icons_222222_256x240.png"); +} +.ui-widget-header .ui-icon { + background-image: url("images/ui-icons_222222_256x240.png"); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon, +.ui-button:hover .ui-icon, +.ui-button:focus .ui-icon { + background-image: url("images/ui-icons_454545_256x240.png"); +} +.ui-state-active .ui-icon, +.ui-button:active .ui-icon { + background-image: url("images/ui-icons_454545_256x240.png"); +} +.ui-state-highlight .ui-icon, +.ui-button .ui-state-highlight.ui-icon { + background-image: url("images/ui-icons_2e83ff_256x240.png"); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url("images/ui-icons_cd0a0a_256x240.png"); +} +.ui-button .ui-icon { + background-image: url("images/ui-icons_888888_256x240.png"); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-caret-1-n { background-position: 0 0; } +.ui-icon-caret-1-ne { background-position: -16px 0; } +.ui-icon-caret-1-e { background-position: -32px 0; } +.ui-icon-caret-1-se { background-position: -48px 0; } +.ui-icon-caret-1-s { background-position: -65px 0; } +.ui-icon-caret-1-sw { background-position: -80px 0; } +.ui-icon-caret-1-w { background-position: -96px 0; } +.ui-icon-caret-1-nw { background-position: -112px 0; } +.ui-icon-caret-2-n-s { background-position: -128px 0; } +.ui-icon-caret-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -65px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -65px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 1px -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa; + opacity: .3; + filter: Alpha(Opacity=30); /* support: IE8 */ +} +.ui-widget-shadow { + -webkit-box-shadow: -8px -8px 8px #aaaaaa; + box-shadow: -8px -8px 8px #aaaaaa; +} diff --git a/phpMyAdmin/themes/original/layout.inc.php b/phpMyAdmin/themes/original/layout.inc.php new file mode 100755 index 0000000..cfa1dc0 --- /dev/null +++ b/phpMyAdmin/themes/original/layout.inc.php @@ -0,0 +1,76 @@ + + +.CodeMirror { + height: em; + direction: ltr; +} +#inline_editor_outer .CodeMirror { + height: em; +} +.insertRowTable .CodeMirror { + height: em; + width: em; + border: 1px solid #a9a9a9; +} +#pma_console .CodeMirror-gutters { + background-color: initial; + border: none; +} +span.cm-keyword, span.cm-statement-verb { + color: #909; +} +span.cm-variable { + color: black; +} +span.cm-comment { + color: #808000; +} +span.cm-mysql-string { + color: #008000; +} +span.cm-operator { + color: fuchsia; +} +span.cm-mysql-word { + color: black; +} +span.cm-builtin { + color: #f00; +} +span.cm-variable-2 { + color: #f90; +} +span.cm-variable-3 { + color: #00f; +} +span.cm-separator { + color: fuchsia; +} +span.cm-number { + color: teal; +} +.autocomplete-column-name { + display: inline-block; +} +.autocomplete-column-hint { + display: inline-block; + float: right; + color: #666; + margin-left: 1em; +} +.CodeMirror-hints { + z-index: 999; +} +.CodeMirror-lint-tooltip { + z-index: 200; + font-family: inherit; +} +.CodeMirror-lint-tooltip code { + font-family: monospace; + font-weight: bold; +} diff --git a/phpMyAdmin/themes/pmahomme/css/common.css.php b/phpMyAdmin/themes/pmahomme/css/common.css.php new file mode 100755 index 0000000..8435877 --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/common.css.php @@ -0,0 +1,3697 @@ + +/******************************************************************************/ +/* general tags */ +html { + font-size: getFontSize(); ?> +} + +input, +select, +textarea { + font-size: 1em; +} + + +body { + + font-family: ; + + padding: 0; + margin: 0; + margin-: 240px; + color: ; + background: ; +} + +body#loginform { + margin: 0; +} + +#page_content { + margin: 0 .5em; +} + +.desktop50 { + width: 50%; +} + +.all100 { + width: 100%; +} + +.all85{ + width: 85%; +} + +.auth_config_tbl{ + margin: 0 auto; +} + + + textarea, + tt, + pre, + code { + font-family: ; + } + + + +h1 { + font-size: 140%; + font-weight: bold; +} + +h2 { + font-size: 2em; + font-weight: normal; + text-shadow: 0 1px 0 #fff; + padding: 10px 0 10px; + padding-: 3px; + color: #777; +} + +/* Hiding icons in the page titles */ +h2 img { + display: none; +} + +h2 a img { + display: inline; +} + +.data, +.data_full_width { + margin: 0 0 12px; +} + +.data_full_width { + width: 100%; +} + +h3 { + font-weight: bold; +} + +a, +a:link, +a:visited, +a:active, +button.mult_submit, +.checkall_box+label { + text-decoration: none; + color: #235a81; + cursor: pointer; + outline: none; + +} + +a:hover, +button.mult_submit:hover, +button.mult_submit:focus, +.checkall_box+label:hover { + text-decoration: underline; + color: #235a81; +} + +#initials_table { + background: #f3f3f3; + border: 1px solid #aaa; + margin-bottom: 10px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; +} + +#initials_table td { + padding: 8px !important; +} + +#initials_table a { + border: 1px solid #aaa; + background: #fff; + padding: 4px 8px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + getCssGradient('ffffff', 'e0e0e0'); ?> +} + +#initials_table a.active { + border: 1px solid #666; + box-shadow: 0 0 2px #999; + getCssGradient('bbbbbb', 'ffffff'); ?> +} + +dfn { + font-style: normal; +} + +dfn:hover { + font-style: normal; + cursor: help; +} + +th { + font-weight: bold; + color: ; + background: #f3f3f3; + getCssGradient('ffffff', 'cccccc'); ?> +} + +a img { + border: 0; +} + +hr { + color: ; + background-color: ; + border: 0; + height: 1px; +} + +form { + padding: 0; + margin: 0; + display: inline; +} + + +input, +select { + /* Fix outline in Chrome: */ + outline: none; +} + +input[type=text], +input[type=password], +input[type=number], +input[type=date] { + border-radius: 2px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + + + background: white; + border: 1px solid #aaa; + color: #555; + padding: 4px; +} + +input[type=text], +input[type=password], +input[type=number], +input[type=date], +input[type=checkbox], +select { + margin: 6px; +} + +input[type=number] { + width: 50px; +} + +input#auto_increment_opt { + width: min-content; +} + +input[type=text], +input[type=password], +input[type=number], +input[type=date], +select { + transition: all 0.2s; + -ms-transition: all 0.2s; + -webkit-transition: all 0.2s; + -moz-transition: all 0.2s; +} + +input[type=text][disabled], +input[type=text][disabled]:hover, +input[type=password][disabled], +input[type=password][disabled]:hover, +input[type=number][disabled], +input[type=number][disabled]:hover, +input[type=date][disabled], +input[type=date][disabled]:hover, +select[disabled], +select[disabled]:hover { + background: #e8e8e8; + box-shadow: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; +} + +input[type=text]:hover, +input[type=text]:focus, +input[type=password]:hover, +input[type=password]:focus, +input[type=number]:hover, +input[type=number]:focus, +input[type=date]:hover, +input[type=date]:focus, +select:focus { + border: 1px solid #7c7c7c; + background: #fff; +} + +input[type=text]:hover, +input[type=password]:hover, +input[type=number]:hover, +input[type=date]:hover { + box-shadow: 0 1px 3px #aaa; + -webkit-box-shadow: 0 1px 3px #aaa; + -moz-box-shadow: 0 1px 3px #aaa; +} + +input[type=submit], +input[type=button], +button[type=submit]:not(.mult_submit) { + font-weight: bold !important; +} + +input[type=submit], +input[type=button], +button[type=submit]:not(.mult_submit), +input[type=reset], +input[name=submit_reset], +input.button { + margin: 6px 14px; + border: 1px solid #aaa; + padding: 3px 7px; + color: #111; + text-decoration: none; + background: #ddd; + + border-radius: 12px; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + + text-shadow: 0 1px 0 #fff; + + getCssGradient('f8f8f8', 'd8d8d8'); ?> +} + +input[type=submit]:hover, +input[type=button]:hover, +button[type=submit]:not(.mult_submit):hover, +input[type=reset]:hover, +input[name=submit_reset]:hover, +input.button:hover { + position: relative; + getCssGradient('fff', 'ddd'); ?> + cursor: pointer; +} + +input[type=submit]:active, +input[type=button]:active, +button[type=submit]:not(.mult_submit):active, +input[type=reset]:active, +input[name=submit_reset]:active, +input.button:active { + position: relative; + getCssGradient('eee', 'ddd'); ?> + box-shadow: 0 1px 6px -2px #333 inset; + text-shadow: none; +} + +input[type=submit]:disabled, +input[type=button]:disabled, +button[type=submit]:not(.mult_submit):disabled, +input[type=reset]:disabled, +input[name=submit_reset]:disabled, +input.button:disabled { + background: #ccc; + color: #666; + text-shadow: none; +} + +textarea { + overflow: visible; + margin: 6px; +} + +textarea.char { + margin: 6px; +} + +fieldset, .preview_sql { + margin-top: 1em; + border-radius: 4px 4px 0 0; + -moz-border-radius: 4px 4px 0 0; + -webkit-border-radius: 4px 4px 0 0; + border: #aaa solid 1px; + padding: 0.5em; + background: #eee; + text-shadow: 1px 1px 2px #fff inset; + -moz-box-shadow: 1px 1px 2px #fff inset; + -webkit-box-shadow: 1px 1px 2px #fff inset; + box-shadow: 1px 1px 2px #fff inset; +} + +fieldset fieldset { + margin: .8em; + background: #fff; + border: 1px solid #aaa; + background: #E8E8E8; + +} + +fieldset legend { + font-weight: bold; + color: #444; + padding: 5px 10px; + border-radius: 2px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border: 1px solid #aaa; + background-color: #fff; + -moz-box-shadow: 3px 3px 15px #bbb; + -webkit-box-shadow: 3px 3px 15px #bbb; + box-shadow: 3px 3px 15px #bbb; + max-width: 100%; +} + +.some-margin { + margin: 1.5em; +} + +/* buttons in some browsers (eg. Konqueror) are block elements, this breaks design */ +button { + display: inline; +} + +table caption, +table th, +table td { + padding: .1em .3em; + margin: .1em; + vertical-align: middle; + text-shadow: 0 1px 0 #fff; +} + +/* 3.4 */ +.datatable{ + table-layout: fixed; +} + +table { + border-collapse: collapse; +} + +thead th { + border-right: 1px solid #fff; +} + +th { + text-align: left; +} + + +img, +button { + vertical-align: middle; +} + +input[type="checkbox"], +input[type="radio"] { + vertical-align: -11%; +} + + +select { + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + border-radius: 2px; + + border: 1px solid #bbb; + color: #333; + padding: 3px; + background: white; + margin:6px; +} + +select[multiple] { + getCssGradient('ffffff', 'f2f2f2'); ?> +} + +/******************************************************************************/ +/* classes */ +.clearfloat { + clear: both; +} + +.floatleft { + float: ; + margin-: 1em; +} + +.floatright { + float: ; +} + +.center { + text-align: center; +} + +.displayblock { + display: block; +} + +table.nospacing { + border-spacing: 0; +} + +table.nopadding tr th, table.nopadding tr td { + padding: 0; +} + +th.left, td.left { + text-align: left; +} + +th.center, td.center { + text-align: center; +} + +th.right, td.right { + text-align: right; + padding-right: 1em; +} + +tr.vtop th, tr.vtop td, th.vtop, td.vtop { + vertical-align: top; +} + +tr.vmiddle th, tr.vmiddle td, th.vmiddle, td.vmiddle { + vertical-align: middle; +} + +tr.vbottom th, tr.vbottom td, th.vbottom, td.vbottom { + vertical-align: bottom; +} + +.paddingtop { + padding-top: 1em; +} + +.separator { + color: #fff; + text-shadow: 0 1px 0 #000; +} + +div.tools { + /* border: 1px solid #000; */ + padding: .2em; +} + +div.tools a { + color: #3a7ead !important; +} + +div.tools, +fieldset.tblFooters { + margin-top: 0; + margin-bottom: .5em; + /* avoid a thick line since this should be used under another fieldset */ + border-top: 0; + text-align: ; + float: none; + clear: both; + -webkit-border-radius: 0 0 4px 4px; + -moz-border-radius: 0 0 4px 4px; + border-radius: 0 0 4px 5px; +} + +div.null_div { + height: 20px; + text-align: center; + font-style: normal; + min-width: 50px; +} + +fieldset .formelement { + float: ; + margin-: .5em; + /* IE */ + white-space: nowrap; +} + +/* revert for Gecko */ +fieldset div[class=formelement] { + white-space: normal; +} + +button.mult_submit { + border: none; + background-color: transparent; +} + +/* odd items 1,3,5,7,... */ +table tbody:first-of-type tr:nth-child(odd), +table tbody:first-of-type tr:nth-child(odd) th, +#table_index tbody:nth-of-type(odd) tr, +#table_index tbody:nth-of-type(odd) th { + background: #fff; +} + +/* even items 2,4,6,8,... */ +table tbody:first-of-type tr:nth-child(even), +table tbody:first-of-type tr:nth-child(even) th, +#table_index tbody:nth-of-type(even) tr, +#table_index tbody:nth-of-type(even) th { + background: #DFDFDF; +} + +table tr th, +table tr { + text-align: ; +} + +/* marked table rows */ +td.marked:not(.nomarker), +table tr.marked:not(.nomarker) td, +table tbody:first-of-type tr.marked:not(.nomarker) th, +table tr.marked:not(.nomarker) { + getCssGradient('ced6df', 'b6c6d7'); ?> + color: ; +} + +/* hovered items */ +table tbody:first-of-type tr:not(.nopointer):hover, +table tbody:first-of-type tr:not(.nopointer):hover th, +.hover:not(.nopointer) { + getCssGradient('ced6df', 'b6c6d7'); ?> + color: ; +} + +/* hovered table rows */ +#table_index tbody:hover tr, +#table_index tbody:hover th, +table tr.hover:not(.nopointer) th { + getCssGradient('ced6df', 'b6c6d7'); ?> + color: ; +} + +/** + * marks table rows/cells if the db field is in a where condition + */ +.condition { + border-color: !important; +} + +th.condition { + border-width: 1px 1px 0 1px; + border-style: solid; +} + +td.condition { + border-width: 0 1px 0 1px; + border-style: solid; +} + +tr:last-child td.condition { + border-width: 0 1px 1px 1px; +} + + + /* for first th which must have right border set (ltr only) */ + .before-condition { + border-right: 1px solid ; + } + + +/** + * cells with the value NULL + */ +td.null { + font-style: italic; + color: #7d7d7d; +} + +table .valueHeader { + text-align: ; + white-space: normal; +} +table .value { + text-align: ; + white-space: normal; +} +/* IE doesnt handles 'pre' right */ +table [class=value] { + white-space: normal; +} + + + + .value { + font-family: ; + } + +.attention { + color: red; + font-weight: bold; +} +.allfine { + color: green; +} + + +img.lightbulb { + cursor: pointer; +} + +.pdflayout { + overflow: hidden; + clip: inherit; + background-color: #fff; + display: none; + border: 1px solid #000; + position: relative; +} + +.pdflayout_table { + background: #D3DCE3; + color: #000; + overflow: hidden; + clip: inherit; + z-index: 2; + display: inline; + visibility: inherit; + cursor: move; + position: absolute; + font-size: 80%; + border: 1px dashed #000; +} + +/* Doc links in SQL */ +.cm-sql-doc { + text-decoration: none; + border-bottom: 1px dotted #000; + color: inherit !important; +} + +/* no extra space in table cells */ +td .icon { + image-rendering: pixelated; + margin: 0; +} + +.selectallarrow { + margin-: .3em; + margin-: .6em; +} + +/* message boxes: error, confirmation */ +#pma_errors, #pma_demo, #pma_footer { + position: relative; + padding: 0 0.5em; +} + +.success h1, +.notice h1, +div.error h1 { + border-bottom: 2px solid; + font-weight: bold; + text-align: ; + margin: 0 0 .2em 0; +} + +div.success, +div.notice, +div.error { + margin: .5em 0 0.5em; + border: 1px solid; + background-repeat: no-repeat; + + background-position: 10px 50%; + padding: 10px 10px 10px 10px; + + background-position: 99% 50%; + padding: 10px 35px 10px 10px; + + + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + + -moz-box-shadow: 0 1px 1px #fff inset; + -webkit-box-shadow: 0 1px 1px #fff inset; + box-shadow: 0 1px 1px #fff inset; +} + +.success a, +.notice a, +.error a { + text-decoration: underline; +} + +.success { + color: #000; + background-color: #ebf8a4; +} + +h1.success, +div.success { + border-color: #a2d246; +} +.success h1 { + border-color: #00FF00; +} + +.notice { + color: #000; + background-color: #e8eef1; +} + +h1.notice, +div.notice { + border-color: #3a6c7e; +} + +.notice h1 { + border-color: #ffb10a; +} + +.error { + border: 1px solid maroon !important; + color: #000; + background: pink; +} + +h1.error, +div.error { + border-color: #333; +} + +div.error h1 { + border-color: #ff0000; +} + +.confirmation { + color: #000; + background-color: pink; +} + +fieldset.confirmation { +} + +fieldset.confirmation legend { +} + +/* end messageboxes */ + +.new_central_col{ + width: 100%; +} + +.tblcomment { + font-size: 70%; + font-weight: normal; + color: #000099; +} + +.tblHeaders { + font-weight: bold; + color: ; + background: ; +} + +div.tools, +.tblFooters { + font-weight: normal; + color: ; + background: ; +} + +.tblHeaders a:link, +.tblHeaders a:active, +.tblHeaders a:visited, +div.tools a:link, +div.tools a:visited, +div.tools a:active, +.tblFooters a:link, +.tblFooters a:active, +.tblFooters a:visited { + color: #0000FF; +} + +.tblHeaders a:hover, +div.tools a:hover, +.tblFooters a:hover { + color: #FF0000; +} + +/* forbidden, no privileges */ +.noPrivileges { + color: #FF0000; + font-weight: bold; +} + +/* disabled text */ +.disabled, +.disabled a:link, +.disabled a:active, +.disabled a:visited { + color: #666; +} + +.disabled a:hover { + color: #666; + text-decoration: none; +} + +tr.disabled td, +td.disabled { + background-color: #f3f3f3; + color: #aaa; +} + +.nowrap { + white-space: nowrap; +} + +/** + * login form + */ +body#loginform h1, +body#loginform a.logo { + display: block; + text-align: center; +} + +body#loginform { + margin-top: 1em; + text-align: center; +} + +body#loginform div.container { + text-align: ; + width: 30em; + margin: 0 auto; +} + +form.login label { + width: 10em; + font-weight: bolder; + display: inline-block; + margin-: 2em; +} + +form.login input[type=text], +form.login input[type=password], +form.login select { + box-sizing: border-box; + width: 14em; +} + +.commented_column { + border-bottom: 1px dashed #000; +} + +.column_attribute { + font-size: 70%; +} + +.cfg_dbg_demo{ + margin: 0.5em 1em 0.5em 1em; +} + +.central_columns_navigation{ + padding:1.5% 0em !important; +} + +.central_columns_add_column{ + display:inline-block; + margin-left:1%; + max-width:50% +} + +.message_errors_found{ + margin-top: 20px; +} + +.repl_gui_skip_err_cnt{ + width: 30px; +} + +.font_weight_bold{ + font-weight: bold; +} + +.color_gray{ + color: gray; +} + +.pma_sliding_message{ + display: inline-block; +} + +li.last.database{ + margin-bottom: 15px !important; +} +/******************************************************************************/ +/* specific elements */ + +/* topmenu */ +#topmenu a { + text-shadow: 0 1px 0 #fff; +} + +#topmenu .error { + background: #eee;border: 0 !important;color: #aaa; +} + +ul#topmenu, +ul#topmenu2, +ul.tabs { + font-weight: bold; + list-style-type: none; + margin: 0; + padding: 0; +} + +ul#topmenu2 { + margin: .25em .5em 0; + height: 2em; + clear: both; +} + +ul#topmenu li, +ul#topmenu2 li { + float: ; + margin: 0; + vertical-align: middle; +} + +#topmenu img, +#topmenu2 img { + margin-right: .5em; + vertical-align: -3px; +} + +.menucontainer { + getCssGradient('ffffff', 'dcdcdc'); ?> + border-top: 1px solid #aaa; +} + +.scrollindicator { + display: none; +} + +/* default tab styles */ +.tabactive { + background: #fff !important; +} + +ul#topmenu2 a { + display: block; + margin: 7px 6px 7px; + margin-: 0; + padding: 4px 10px; + white-space: nowrap; + border: 1px solid #ddd; + border-radius: 20px; + -moz-border-radius: 20px; + -webkit-border-radius: 20px; + background: #f2f2f2; + +} + +span.caution { + color: #FF0000; +} +fieldset.caution a { + color: #FF0000; +} +fieldset.caution a:hover { + color: #fff; + background-color: #FF0000; +} + +#topmenu { + margin-top: .5em; + padding: .1em .3em; +} + +ul#topmenu ul { + -moz-box-shadow: 1px 1px 6px #ddd; + -webkit-box-shadow: 2px 2px 3px #666; + box-shadow: 2px 2px 3px #666; +} + +ul#topmenu ul.only { + : 0; +} + +ul#topmenu > li { + border-right: 1px solid #fff; + border-left: 1px solid #ccc; + border-bottom: 1px solid #ccc; +} + +ul#topmenu > li:first-child { + border-left: 0; +} + +/* default tab styles */ +ul#topmenu a, +ul#topmenu span { + padding: .6em; +} + +ul#topmenu ul a { + border-width: 1pt 0 0 0; + -moz-border-radius: 0; + -webkit-border-radius: 0; + border-radius: 0; +} + +ul#topmenu ul li:first-child a { + border-width: 0; +} + +/* enabled hover/active tabs */ +ul#topmenu > li > a:hover, +ul#topmenu > li > .tabactive { + text-decoration: none; +} + +ul#topmenu ul a:hover, +ul#topmenu ul .tabactive { + text-decoration: none; +} + +ul#topmenu a.tab:hover, +ul#topmenu .tabactive { + /* background-color: ; */ +} + +ul#topmenu2 a.tab:hover, +ul#topmenu2 a.tabactive { + background-color: ; + border-radius: .3em; + -moz-border-radius: .3em; + -webkit-border-radius: .3em; + text-decoration: none; +} + +/* to be able to cancel the bottom border, use
    • */ +ul#topmenu > li.active { + /* border-bottom: 0pt solid ; */ + border-right: 0; + border-bottom-color: #fff; +} +/* end topmenu */ + +/* zoom search */ +div#dataDisplay input, +div#dataDisplay select { + margin: 0; + margin-: .5em; +} +div#dataDisplay th { + line-height: 2em; +} +table#tableFieldsId { + width: 100%; +} + +/* Calendar */ +table.calendar { + width: 100%; +} +table.calendar td { + text-align: center; +} +table.calendar td a { + display: block; +} + +table.calendar td a:hover { + background-color: #CCFFCC; +} + +table.calendar th { + background-color: #D3DCE3; +} + +table.calendar td.selected { + background-color: #FFCC99; +} + +img.calendar { + border: none; +} +form.clock { + text-align: center; +} +/* end Calendar */ + + +/* table stats */ +div#tablestatistics table { + float: ; + margin-bottom: .5em; + margin-: 1.5em; + margin-top: .5em; + min-width: 16em; +} + +/* end table stats */ + + +/* server privileges */ +#tableuserrights td, +#tablespecificuserrights td, +#tabledatabases td { + vertical-align: middle; +} +/* end server privileges */ + + +/* Heading */ +#topmenucontainer { + padding-: 1em; + width: 100%; +} + +#serverinfo { + background: #888; + padding: .3em .9em; + padding-: 2.2em; + text-shadow: 0 1px 0 #000; + max-width: 100%; + max-height: 16px; + overflow: hidden; +} + +#serverinfo .item { + white-space: nowrap; + color: #fff; +} + +#page_nav_icons { + position: fixed; + top: 0; + : 0; + z-index: 99; + padding: .25em 0; +} + +#goto_pagetop, #lock_page_icon, #page_settings_icon { + padding: .25em; + background: #888; +} + +#page_settings_icon { + cursor: pointer; + display: none; +} + +#page_settings_modal { + display: none; +} + +#pma_navigation_settings { + display: none; +} + +#span_table_comment { + font-weight: bold; + font-style: italic; + white-space: nowrap; + margin-left: 10px; + color: #D6D6D6; + text-shadow: none; +} + +#serverinfo img { + margin: 0 .1em 0; + margin-: .2em; +} + + +#textSQLDUMP { + width: 95%; + height: 95%; + font-family: Consolas, "Courier New", Courier, mono; + font-size: 110%; +} + +#TooltipContainer { + position: absolute; + z-index: 99; + width: 20em; + height: auto; + overflow: visible; + visibility: hidden; + background-color: #ffffcc; + color: #006600; + border: .1em solid #000; + padding: .5em; +} + +/* user privileges */ +#fieldset_add_user_login div.item { + border-bottom: 1px solid silver; + padding-bottom: .3em; + margin-bottom: .3em; +} + +#fieldset_add_user_login label { + float: ; + display: block; + width: 10em; + max-width: 100%; + text-align: ; + padding-: .5em; +} + +#fieldset_add_user_login span.options #select_pred_username, +#fieldset_add_user_login span.options #select_pred_hostname, +#fieldset_add_user_login span.options #select_pred_password { + width: 100%; + max-width: 100%; +} + +#fieldset_add_user_login span.options { + float: ; + display: block; + width: 12em; + max-width: 100%; + padding-: .5em; +} + +#fieldset_add_user_login input { + width: 12em; + clear: ; + max-width: 100%; +} + +#fieldset_add_user_login span.options input { + width: auto; +} + +#fieldset_user_priv div.item { + float: ; + width: 9em; + max-width: 100%; +} + +#fieldset_user_priv div.item div.item { + float: none; +} + +#fieldset_user_priv div.item label { + white-space: nowrap; +} + +#fieldset_user_priv div.item select { + width: 100%; +} + +#fieldset_user_global_rights fieldset { + float: ; +} + +#fieldset_user_group_rights fieldset { + float: ; +} + +#fieldset_user_global_rights>legend input { + margin-: 2em; +} +/* end user privileges */ + + +/* serverstatus */ + +.linkElem:hover { + text-decoration: underline; + color: #235a81; + cursor: pointer; +} + +h3#serverstatusqueries span { + font-size: 60%; + display: inline; +} + +.buttonlinks { + float: ; + white-space: nowrap; +} + +/* Also used for the variables page */ +fieldset#tableFilter { + padding: 0.1em 1em; +} + +div#serverStatusTabs { + margin-top: 1em; +} + +caption a.top { + float: ; +} + +div#serverstatusquerieschart { + float: ; + width: 500px; + height: 350px; + margin-: 50px; +} + +table#serverstatusqueriesdetails, +table#serverstatustraffic { + float: ; +} + +table#serverstatusqueriesdetails th { + min-width: 35px; +} + +table#serverstatusvariables { + width: 100%; + margin-bottom: 1em; +} +table#serverstatusvariables .name { + width: 18em; + white-space: nowrap; +} +table#serverstatusvariables .value { + width: 6em; +} +table#serverstatusconnections { + float: ; + margin-: 30px; +} + +div#serverstatus table tbody td.descr a, +div#serverstatus table .tblFooters a { + white-space: nowrap; +} + +div.liveChart { + clear: both; + min-width: 500px; + height: 400px; + padding-bottom: 80px; +} + +#addChartDialog input[type="text"] { + margin: 0; + padding: 3px; +} + +div#chartVariableSettings { + border: 1px solid #ddd; + background-color: #E6E6E6; + margin-left: 10px; +} + +table#chartGrid td { + padding: 3px; + margin: 0; +} + +table#chartGrid div.monitorChart { + background: #EBEBEB; + overflow: hidden; + border: none; +} + +div.tabLinks { + margin-left: 0.3em; + float: ; + padding: 5px 0; +} + +div.tabLinks a, div.tabLinks label { + margin-right: 7px; +} + +div.tabLinks .icon { + margin: -0.2em 0.3em 0 0; +} + +.popupContent { + display: none; + position: absolute; + border: 1px solid #CCC; + margin: 0; + padding: 3px; + -moz-box-shadow: 2px 2px 3px #666; + -webkit-box-shadow: 2px 2px 3px #666; + box-shadow: 2px 2px 3px #666; + background-color: #fff; + z-index: 2; +} + +div#logTable { + padding-top: 10px; + clear: both; +} + +div#logTable table { + width: 100%; +} + +div#queryAnalyzerDialog { + min-width: 700px; +} + +div#queryAnalyzerDialog div.CodeMirror-scroll { + height: auto; +} + +div#queryAnalyzerDialog div#queryProfiling { + height: 300px; +} + +div#queryAnalyzerDialog td.explain { + width: 250px; +} + +div#queryAnalyzerDialog table.queryNums { + display: none; + border: 0; + text-align: left; +} + +.smallIndent { + padding-: 7px; +} + +/* end serverstatus */ + +/* server variables */ +#serverVariables { + width: 100%; +} +#serverVariables .var-row > td { + line-height: 2em; +} +#serverVariables .var-header { + color: ; + background: #f3f3f3; + getCssGradient('ffffff', 'cccccc'); ?> + font-weight: bold; + text-align: ; +} +#serverVariables .var-row { + padding: 0.5em; + min-height: 18px; +} +#serverVariables .var-name { + font-weight: bold; +} +#serverVariables .var-name.session { + font-weight: normal; + font-style: italic; +} +#serverVariables .var-value { + float: ; + text-align: ; +} +#serverVariables .var-doc { + overflow:visible; + float: ; +} + +/* server variables editor */ +#serverVariables .editLink { + padding-: 1em; + font-family: sans-serif; +} +#serverVariables .serverVariableEditor { + width: 100%; + overflow: hidden; +} +#serverVariables .serverVariableEditor input { + width: 100%; + margin: 0 0.5em; + box-sizing: border-box; + -ms-box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + height: 2.2em; +} +#serverVariables .serverVariableEditor div { + display: block; + overflow: hidden; + padding-: 1em; +} +#serverVariables .serverVariableEditor a { + margin: 0 0.5em; + line-height: 2em; +} +/* end server variables */ + + +p.notice { + margin: 1.5em 0; + border: 1px solid #000; + background-repeat: no-repeat; + + background-position: 10px 50%; + padding: 10px 10px 10px 25px; + + background-position: 99% 50%; + padding: 25px 10px 10px 10px + + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + -moz-box-shadow: 0 1px 2px #fff inset; + -webkit-box-shadow: 0 1px 2px #fff inset; + box-shadow: 0 1px 2px #fff inset; + background: #555; + color: #d4fb6a; +} + +p.notice a { + color: #fff; + text-decoration: underline; +} + +/* profiling */ + +div#profilingchart { + width: 850px; + height: 370px; + float: ; +} + +#profilingchart .jqplot-highlighter-tooltip{ + top: auto !important; + left: 11px; + bottom:24px; +} +/* end profiling */ + +/* table charting */ +#resizer { + border: 1px solid silver; +} +#inner-resizer { /* make room for the resize handle */ + padding: 10px; +} +.chartOption { + float: ; + margin-: 40px; +} +/* end table charting */ + +/* querybox */ + +#togglequerybox { + margin: 0 10px; +} + +#serverstatus h3 +{ + margin: 15px 0; + font-weight: normal; + color: #999; + font-size: 1.7em; +} +#sectionlinks { + margin-bottom: 15px; + padding: 16px; + background: #f3f3f3; + border: 1px solid #aaa; + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + box-shadow: 0 1px 1px #fff inset; + -webkit-box-shadow: 0 1px 1px #fff inset; + -moz-box-shadow: 0 1px 1px #fff inset; +} +#sectionlinks a, +.buttonlinks a, +a.button { + font-weight: bold; + text-shadow: 0 1px 0 #fff; + line-height: 35px; + margin-: 7px; + border: 1px solid #aaa; + padding: 3px 7px; + color: #111 !important; + text-decoration: none; + background: #ddd; + white-space: nowrap; + border-radius: 20px; + -webkit-border-radius: 20px; + -moz-border-radius: 20px; + getCssGradient('f8f8f8', 'd8d8d8'); ?> +} +#sectionlinks a:hover, +.buttonlinks a:hover, +a.button:hover { + getCssGradient('ffffff', 'dddddd'); ?> +} + +div#sqlquerycontainer { + float: ; + width: 69%; + /* height: 15em; */ +} + +div#tablefieldscontainer { + float: ; + width: 29%; + margin-top: -20px; + /* height: 15em; */ +} + +div#tablefieldscontainer select { + width: 100%; + background: #fff; + /* height: 12em; */ +} + +textarea#sqlquery { + width: 100%; + /* height: 100%; */ + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + border: 1px solid #aaa; + padding: 5px; + font-family: inherit; +} +textarea#sql_query_edit { + height: 7em; + width: 95%; + display: block; +} +div#queryboxcontainer div#bookmarkoptions { + margin-top: .5em; +} +/* end querybox */ + +/* main page */ +#maincontainer { + /* background-image: url(getImgPath('logo_right.png');?>); */ + /* background-position: bottom; */ + /* background-repeat: no-repeat; */ +} + +#mysqlmaininformation, +#pmamaininformation { + float: ; + width: 49%; +} + +#maincontainer ul { + list-style-type: disc; + vertical-align: middle; +} + +#maincontainer li { + margin-bottom: .3em; +} + +#full_name_layer { + position: absolute; + padding: 2px; + margin-top: -3px; + z-index: 801; + + border-radius: 3px; + border: solid 1px #888; + background: #fff; + +} +/* end main page */ + + +/* iconic view for ul items */ + +li.no_bullets { + list-style-type:none !important; + margin-left: -25px !important; //align with other list items which have bullets +} + +/* end iconic view for ul items */ + +#body_browse_foreigners { + background: ; + margin: .5em .5em 0 .5em; +} + +#bodythemes { + width: 500px; + margin: auto; + text-align: center; +} + +#bodythemes img { + border: .1em solid #000; +} + +#bodythemes a:hover img { + border: .1em solid red; +} + +#fieldset_select_fields { + float: ; +} + +#selflink { + clear: both; + display: block; + margin-top: 1em; + margin-bottom: 1em; + width: 98%; + margin-: 1%; + border-top: .1em solid silver; + text-align: ; +} + +#table_innodb_bufferpool_usage, +#table_innodb_bufferpool_activity { + float: ; +} + +#div_mysql_charset_collations table { + float: ; +} + +#div_mysql_charset_collations table th, +#div_mysql_charset_collations table td { + padding: 0.4em; +} + +#div_mysql_charset_collations table th#collationHeader { + width: 35%; +} + +#qbe_div_table_list { + float: ; +} + +#qbe_div_sql_query { + float: ; +} + +label.desc { + width: 30em; + float: ; +} + +label.desc sup { + position: absolute; +} + +code.php { + display: block; + padding-left: 1em; + margin-top: 0; + margin-bottom: 0; + max-height: 10em; + overflow: auto; + direction: ltr; +} + +code.sql, +div.sqlvalidate { + display: block; + padding: 1em; + margin-top: 0; + margin-bottom: 0; + max-height: 10em; + overflow: auto; + direction: ltr; +} + +.result_query div.sqlOuter { + background: ; + text-align: ; +} + +.result_query .success, .result_query .error { + margin-bottom: 0; + border-bottom: none !important; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + padding-bottom: 5px; +} + +#PMA_slidingMessage code.sql, +div.sqlvalidate { + background: ; +} + +#main_pane_left { + width: 60%; + min-width: 260px; + float: ; + padding-top: 1em; +} + +#main_pane_right { + overflow: hidden; + min-width: 160px; + padding-top: 1em; + padding-: 1em; + padding-: .5em; +} + +.group { + + border: 1px solid #999; + background: #f3f3f3; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: 2px 2px 5px #ccc; + -webkit-box-shadow: 2px 2px 5px #ccc; + box-shadow: 2px 2px 5px #ccc; + margin-bottom: 1em; + padding-bottom: 1em; +} + +.group h2 { + background-color: #bbb; + padding: .1em .3em; + margin-top: 0; + color: #fff; + font-size: 1.6em; + font-weight: normal; + text-shadow: 0 1px 0 #777; + -moz-box-shadow: 1px 1px 15px #999 inset; + -webkit-box-shadow: 1px 1px 15px #999 inset; + box-shadow: 1px 1px 15px #999 inset; +} + +.group-cnt { + padding: 0; + padding-: .5em; + display: inline-block; + width: 98%; +} + +textarea#partitiondefinition { + height: 3em; +} + + +/* for elements that should be revealed only via js */ +.hide { + display: none; +} + +#list_server { + list-style-type: none; + padding: 0; +} + +/** + * Progress bar styles + */ +div.upload_progress +{ + width: 400px; + margin: 3em auto; + text-align: center; +} + +div.upload_progress_bar_outer +{ + border: 1px solid #000; + width: 202px; + position: relative; + margin: 0 auto 1em; + color: ; +} + +div.upload_progress_bar_inner +{ + background-color: ; + width: 0; + height: 12px; + margin: 1px; + overflow: hidden; + color: ; + position: relative; +} + +div.upload_progress_bar_outer div.percentage +{ + position: absolute; + top: 0; + : 0; + width: 202px; +} + +div.upload_progress_bar_inner div.percentage +{ + top: -1px; + : -1px; +} + +div#statustext { + margin-top: .5em; +} + +table#serverconnection_src_remote, +table#serverconnection_trg_remote, +table#serverconnection_src_local, +table#serverconnection_trg_local { + float: ; +} +/** + * Validation error message styles + */ +input[type=text].invalid_value, +input[type=password].invalid_value, +input[type=number].invalid_value, +input[type=date].invalid_value, +select.invalid_value, +.invalid_value { + background: #FFCCCC; +} + +/** + * Ajax notification styling + */ + .ajax_notification { + top: 0; /** The notification needs to be shown on the top of the page */ + position: fixed; + margin-top: 0; + margin-right: auto; + margin-bottom: 0; + margin-: auto; + padding: 5px; /** Keep a little space on the sides of the text */ + width: 350px; + + z-index: 1100; /** If this is not kept at a high z-index, the jQueryUI modal dialogs (z-index: 1000) might hide this */ + text-align: center; + display: inline; + left: 0; + right: 0; + background-image: url(getImgPath('ajax_clock_small.gif');?>); + background-repeat: no-repeat; + background-position: 2%; + border: 1px solid #e2b709; + } + +/* additional styles */ +.ajax_notification { + margin-top: 200px; + background: #ffe57e; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + box-shadow: 0 5px 90px #888; + -moz-box-shadow: 0 5px 90px #888; + -webkit-box-shadow: 0 5px 90px #888; +} + +#loading_parent { + /** Need this parent to properly center the notification division */ + position: relative; + width: 100%; + } +/** + * Export and Import styles + */ + +.export_table_list_container { + display: inline-block; + max-height: 20em; + overflow-y: scroll; +} + +.export_table_select th { + text-align: center; + vertical-align: middle; +} + +.export_table_select .all { + font-weight: bold; + border-bottom: 1px solid black; +} + +.export_structure, .export_data { + text-align: center; +} + +.export_table_name { + vertical-align: middle; +} + +.exportoptions h2 { + word-wrap: break-word; +} + +.exportoptions h3, +.importoptions h3 { + border-bottom: 1px #999 solid; + font-size: 110%; +} + +.exportoptions ul, +.importoptions ul, +.format_specific_options ul { + list-style-type: none; + margin-bottom: 15px; +} + +.exportoptions li, +.importoptions li { + margin: 7px; +} +.exportoptions label, +.importoptions label, +.exportoptions p, +.importoptions p { + margin: 5px; + float: none; +} + +#csv_options label.desc, +#ldi_options label.desc, +#latex_options label.desc, +#output label.desc { + float: ; + width: 15em; +} + +.exportoptions, +.importoptions { + margin: 20px 30px 30px; + margin-: 10px; +} + +.exportoptions #buttonGo, +.importoptions #buttonGo { + font-weight: bold; + margin-: 14px; + border: 1px solid #aaa; + padding: 5px 12px; + color: #111; + text-decoration: none; + + border-radius: 12px; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + + text-shadow: 0 1px 0 #fff; + + getCssGradient('ffffff', 'cccccc'); ?> + cursor: pointer; +} + +.format_specific_options h3 { + margin: 10px 0 0; + margin-: 10px; + border: 0; +} + +.format_specific_options { + border: 1px solid #999; + margin: 7px 0; + padding: 3px; +} + +p.desc { + margin: 5px; +} + +/** + * Export styles only + */ +select#db_select, +select#table_select { + width: 400px; +} + +.export_sub_options { + margin: 20px 0 0; + margin-: 30px; +} + +.export_sub_options h4 { + border-bottom: 1px #999 solid; +} + +.export_sub_options li.subgroup { + display: inline-block; + margin-top: 0; +} + +.export_sub_options li { + margin-bottom: 0; +} +#export_refresh_form { + margin-left: 20px; +} +#export_back_button { + display: inline; +} +#output_quick_export { + display: none; +} +/** + * Import styles only + */ + +.importoptions #import_notification { + margin: 10px 0; + font-style: italic; +} + +input#input_import_file { + margin: 5px; +} + +.formelementrow { + margin: 5px 0 5px 0; +} + +#filterText { + vertical-align: baseline; +} + +#popup_background { + display: none; + position: fixed; + _position: absolute; /* hack for IE6 */ + width: 100%; + height: 100%; + top: 0; + : 0; + background: #000; + z-index: 1000; + overflow: hidden; +} + +/** + * Table structure styles + */ +#fieldsForm ul.table-structure-actions { + margin: 0; + padding: 0; + list-style: none; +} +#fieldsForm ul.table-structure-actions li { + float: ; + margin-: 0.3em; /* same as padding of "table td" */ +} +#fieldsForm ul.table-structure-actions .submenu li { + padding: 0; + margin: 0; +} +#fieldsForm ul.table-structure-actions .submenu li span { + padding: 0.3em; + margin: 0.1em; +} +#structure-action-links a { + margin-: 1em; +} +#addColumns input[type="radio"] { + margin: 3px 0 0; + margin-: 1em; +} +/** + * Indexes + */ +#index_frm .index_info input[type="text"], +#index_frm .index_info select { + width: 100%; + margin: 0; + box-sizing: border-box; + -ms-box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +#index_frm .index_info div { + padding: .2em 0; +} + +#index_frm .index_info .label { + float: ; + min-width: 12em; +} + +#index_frm .slider { + width: 10em; + margin: .6em; + float: ; +} + +#index_frm .add_fields { + float: ; +} + +#index_frm .add_fields input { + margin-: 1em; +} + +#index_frm input { + margin: 0; +} + +#index_frm td { + vertical-align: middle; +} + +table#index_columns { + width: 100%; +} + +table#index_columns select { + width: 85%; + float: ; +} + +#move_columns_dialog div { + padding: 1em; +} + +#move_columns_dialog ul { + list-style: none; + margin: 0; + padding: 0; +} + +#move_columns_dialog li { + background: ; + border: 1px solid #aaa; + color: ; + font-weight: bold; + margin: .4em; + padding: .2em; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; +} + +/* config forms */ +.config-form ul.tabs { + margin: 1.1em .2em 0; + padding: 0 0 .3em 0; + list-style: none; + font-weight: bold; +} + +.config-form ul.tabs li { + float: ; + margin-bottom: -1px; +} + +.config-form ul.tabs li a { + display: block; + margin: .1em .2em 0; + white-space: nowrap; + text-decoration: none; + border: 1px solid ; + border-bottom: 1px solid #aaa; +} + +.config-form ul.tabs li a { + padding: 7px 10px; + -webkit-border-radius: 5px 5px 0 0; + -moz-border-radius: 5px 5px 0 0; + border-radius: 5px 5px 0 0; + background: #f2f2f2; + color: #555; + text-shadow: 0 1px 0 #fff; +} + +.config-form ul.tabs li a:hover, +.config-form ul.tabs li a:active { + background: #e5e5e5; +} + +.config-form ul.tabs li.active a { + background-color: #fff; + margin-top: 1px; + color: #000; + text-shadow: none; + border-color: #aaa; + border-bottom: 1px solid #fff; +} + +.config-form fieldset { + margin-top: 0; + padding: 0; + clear: both; + -webkit-border-radius: 0; + -moz-border-radius: 0; + border-radius: 0; +} + +.config-form legend { + display: none; +} + +.config-form fieldset p { + margin: 0; + padding: .5em; + background: #fff; + border-top: 0; +} + +.config-form fieldset .errors { /* form error list */ + margin: 0 -2px 1em; + padding: .5em 1.5em; + background: #FBEAD9; + border: 0 #C83838 solid; + border-width: 1px 0; + list-style: none; + font-family: sans-serif; + font-size: small; +} + +.config-form fieldset .inline_errors { /* field error list */ + margin: .3em .3em .3em; + margin-: 0; + padding: 0; + list-style: none; + color: #9A0000; + font-size: small; +} + +.config-form fieldset th { + padding: .3em .3em .3em; + padding-: .5em; + text-align: ; + vertical-align: top; + width: 40%; + background: transparent; + filter: none; +} + +.config-form fieldset .doc, +.config-form fieldset .disabled-notice { + margin-: 1em; +} + +.config-form fieldset .disabled-notice { + font-size: 80%; + text-transform: uppercase; + color: #E00; + cursor: help; +} + +.config-form fieldset td { + padding-top: .3em; + padding-bottom: .3em; + vertical-align: top; +} + +.config-form fieldset th small { + display: block; + font-weight: normal; + font-family: sans-serif; + font-size: x-small; + color: #444; +} + +.config-form fieldset th, +.config-form fieldset td { + border-top: 1px solid; + border-: none; +} + +fieldset .group-header th { + background: ; +} + +fieldset .group-header + tr th { + padding-top: .6em; +} + +fieldset .group-field-1 th, +fieldset .group-header-2 th { + padding-: 1.5em; +} + +fieldset .group-field-2 th, +fieldset .group-header-3 th { + padding-: 3em; +} + +fieldset .group-field-3 th { + padding-: 4.5em; +} + +fieldset .disabled-field th, +fieldset .disabled-field th small, +fieldset .disabled-field td { + color: #666; + background-color: #ddd; +} + +.config-form .lastrow { + border-top: 1px #000 solid; +} + +.config-form .lastrow { + background: ; + padding: .5em; + text-align: center; +} + +.config-form .lastrow input { + font-weight: bold; +} + +/* form elements */ + +.config-form span.checkbox { + padding: 2px; + display: inline-block; +} + +.config-form .custom { /* customized field */ + background: #FFC; +} + +.config-form span.checkbox.custom { + padding: 1px; + border: 1px #EDEC90 solid; + background: #FFC; +} + +.config-form .field-error { + border-color: #A11 !important; +} + +.config-form input[type="text"], +.config-form input[type="password"], +.config-form input[type="number"], +.config-form select, +.config-form textarea { + border: 1px #A7A6AA solid; + height: auto; +} + +.config-form input[type="text"]:focus, +.config-form input[type="password"]:focus, +.config-form input[type="number"]:focus, +.config-form select:focus, +.config-form textarea:focus { + border: 1px #6676FF solid; + background: #F7FBFF; +} + +.config-form .field-comment-mark { + font-family: serif; + color: #007; + cursor: help; + padding: 0 .2em; + font-weight: bold; + font-style: italic; +} + +.config-form .field-comment-warning { + color: #A00; +} + +/* error list */ +.config-form dd { + margin-: .5em; +} + +.config-form dd:before { + content: "\25B8 "; +} + +.click-hide-message { + cursor: pointer; +} + +.prefsmanage_opts { + margin-: 2em; +} + +#prefs_autoload { + margin-bottom: .5em; + margin-left: .5em; +} + +#placeholder .button { + position: absolute; + cursor: pointer; +} + +#placeholder div.button { + font-size: smaller; + color: #999; + background-color: #eee; + padding: 2px; +} + +.wrapper { + float: ; + margin-bottom: 1.5em; +} +.toggleButton { + position: relative; + cursor: pointer; + font-size: .8em; + text-align: center; + line-height: 1.4em; + height: 1.55em; + overflow: hidden; + border-right: .1em solid #888; + border-left: .1em solid #888; + -webkit-border-radius: .3em; + -moz-border-radius: .3em; + border-radius: .3em; +} +.toggleButton table, +.toggleButton td, +.toggleButton img { + padding: 0; + position: relative; +} +.toggleButton .container { + position: absolute; +} +.toggleButton .container td, +.toggleButton .container tr { + background-image: none; + background: none !important; +} +.toggleButton .toggleOn { + color: #fff; + padding: 0 1em; + text-shadow: 0 0 .2em #000; +} +.toggleButton .toggleOff { + padding: 0 1em; +} + +.doubleFieldset fieldset { + width: 48%; + float: ; + padding: 0; +} +.doubleFieldset fieldset.left { + margin-: 1%; +} +.doubleFieldset fieldset.right { + margin-: 1%; +} +.doubleFieldset legend { + margin-: 1.5em; +} +.doubleFieldset div.wrap { + padding: 1.5em; +} + +#table_name_col_no_outer { + margin-top: 45px; +} + +#table_name_col_no { + position: fixed; + top: 55px; + width: 100%; + background: #ffffff; +} + +#table_columns input[type="text"], +#table_columns input[type="password"], +#table_columns input[type="number"], +#table_columns select { + width: 10em; + box-sizing: border-box; + -ms-box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +#placeholder { + position: relative; + border: 1px solid #aaa; + float: ; + overflow: hidden; + width: 450px; + height: 300px; +} + +#openlayersmap{ + width: 450px; + height: 300px; +} + +.placeholderDrag { + cursor: move; +} + +#placeholder .button { + position: absolute; +} + +#left_arrow { + left: 8px; + top: 26px; +} + +#right_arrow { + left: 26px; + top: 26px; +} + +#up_arrow { + left: 17px; + top: 8px; +} + +#down_arrow { + left: 17px; + top: 44px; +} + +#zoom_in { + left: 17px; + top: 67px; +} + +#zoom_world { + left: 17px; + top: 85px; +} + +#zoom_out { + left: 17px; + top: 103px; +} + +.colborder { + cursor: col-resize; + height: 100%; + margin-: -6px; + position: absolute; + width: 5px; +} + +.colborder_active { + border-: 2px solid #a44; +} + +.pma_table td { + position: static; +} + +.pma_table th.draggable span, +.sticky_columns th.draggable span, +.pma_table tbody td span { + display: block; + overflow: hidden; +} + +.pma_table tbody td span code span { + display: inline; +} + +.pma_table th.draggable.right span { + margin-: 0px; +} + +.pma_table th.draggable span { + margin-: 10px; +} + +.modal-copy input { + display: block; + width: 100%; + margin-top: 1.5em; + padding: .3em 0; +} + +.cRsz { + position: absolute; +} + +.cCpy { + background: #333; + color: #FFF; + font-weight: bold; + margin: .1em; + padding: .3em; + position: absolute; + text-shadow: -1px -1px #000; + + -moz-box-shadow: 0 0 .7em #000; + -webkit-box-shadow: 0 0 .7em #000; + box-shadow: 0 0 .7em #000; + -moz-border-radius: .3em; + -webkit-border-radius: .3em; + border-radius: .3em; +} + +.cPointer { + background: url(getImgPath('col_pointer.png');?>); + height: 20px; + margin-: -5px; /* must be minus half of its width */ + margin-top: -10px; + position: absolute; + width: 10px; +} + +.tooltip { + background: #333 !important; + opacity: .8 !important; + border: 1px solid #000 !important; + -moz-border-radius: .3em !important; + -webkit-border-radius: .3em !important; + border-radius: .3em !important; + text-shadow: -1px -1px #000 !important; + font-size: .8em !important; + font-weight: bold !important; + padding: 1px 3px !important; +} + +.tooltip * { + background: none !important; + color: #FFF !important; +} + +.cDrop { + left: 0; + position: absolute; + top: 0; +} + +.coldrop { + background: url(getImgPath('col_drop.png');?>); + cursor: pointer; + height: 16px; + margin-: .3em; + margin-top: .3em; + position: absolute; + width: 16px; +} + +.coldrop:hover, +.coldrop-hover { + background-color: #999; +} + +.cList { + background: #EEE; + border: solid 1px #999; + position: absolute; + -moz-box-shadow: 0 .2em .5em #333; + -webkit-box-shadow: 0 .2em .5em #333; + box-shadow: 0 .2em .5em #333; +} + +.cList .lDiv div { + padding: .2em .5em .2em; + padding-: .2em; +} + +.cList .lDiv div:hover { + background: #DDD; + cursor: pointer; +} + +.cList .lDiv div input { + cursor: pointer; +} + +.showAllColBtn { + border-bottom: solid 1px #999; + border-top: solid 1px #999; + cursor: pointer; + font-size: .9em; + font-weight: bold; + padding: .35em 1em; + text-align: center; +} + +.showAllColBtn:hover { + background: #DDD; +} + +.turnOffSelect { + -moz-user-select: none; + -khtml-user-select: none; + -webkit-user-select: none; + user-select: none; +} + +.navigation { + margin: .8em 0; + + border-radius: 5px; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + + getCssGradient('eeeeee', 'cccccc'); ?> +} + +.navigation td { + margin: 0; + padding: 0; + vertical-align: middle; + white-space: nowrap; +} + +.navigation_separator { + color: #999; + display: inline-block; + font-size: 1.5em; + text-align: center; + height: 1.4em; + width: 1.2em; + text-shadow: 1px 0 #FFF; +} + +.navigation input[type=submit] { + background: none; + border: 0; + filter: none; + margin: 0; + padding: .8em .5em; + + border-radius: 0; + -webkit-border-radius: 0; + -moz-border-radius: 0; +} + +.navigation input[type=submit]:hover, +.navigation input.edit_mode_active { + color: #fff; + cursor: pointer; + text-shadow: none; + + getCssGradient('333333', '555555'); ?> +} + +.navigation select { + margin: 0 .8em; +} + +.cEdit { + margin: 0; + padding: 0; + position: absolute; +} + +.cEdit input[type=text] { + background: #FFF; + height: 100%; + margin: 0; + padding: 0; +} + +.cEdit .edit_area { + background: #FFF; + border: 1px solid #999; + min-width: 10em; + padding: .3em .5em; +} + +.cEdit .edit_area select, +.cEdit .edit_area textarea { + width: 97%; +} + +.cEdit .cell_edit_hint { + color: #555; + font-size: .8em; + margin: .3em .2em; +} + +.cEdit .edit_box { + overflow-x: hidden; + overflow-y: scroll; + padding: 0; + margin: 0; +} + +.cEdit .edit_box_posting { + background: #FFF url(getImgPath('ajax_clock_small.gif');?>) no-repeat right center; + padding-: 1.5em; +} + +.cEdit .edit_area_loading { + background: #FFF url(getImgPath('ajax_clock_small.gif');?>) no-repeat center; + height: 10em; +} + +.cEdit .goto_link { + background: #EEE; + color: #555; + padding: .2em .3em; +} + +.saving_edited_data { + background: url(getImgPath('ajax_clock_small.gif');?>) no-repeat left; + padding-: 20px; +} + +.relationalTable td { + vertical-align: top; +} + +.relationalTable select { + width: 125px; + margin-right: 5px; +} + +/* css for timepicker */ +.ui-timepicker-div .ui-widget-header { margin-bottom: 8px; } +.ui-timepicker-div dl { text-align: ; } +.ui-timepicker-div dl dt { height: 25px; margin-bottom: -25px; } +.ui-timepicker-div dl dd { margin: 0 10px 10px 85px; } +.ui-timepicker-div td { font-size: 90%; } +.ui-tpicker-grid-label { background: none; border: none; margin: 0; padding: 0; } +.ui-timepicker-rtl { direction: rtl; } +.ui-timepicker-rtl dl { text-align: right; } +.ui-timepicker-rtl dl dd { margin: 0 65px 10px 10px; } + +input.btn { + color: #333; + background-color: #D0DCE0; +} + +body .ui-widget { + font-size: 1em; +} + +body #ui-datepicker-div { + z-index: 9999 !important; +} + +.ui-dialog fieldset legend a { + color: #235A81; +} + +.ui-draggable { + z-index: 801; +} + +/* over-riding jqplot-yaxis class */ +.jqplot-yaxis { + left:0 !important; + min-width:25px; + width:auto; +} +.jqplot-axis { + overflow:hidden; +} + +.report-data { + height:13em; + overflow:scroll; + width:570px; + border: solid 1px; + background: white; + padding: 2px; +} + +.report-description { + height:10em; + width:570px; +} + +div#page_content div#tableslistcontainer table.data { + border-top: 0.1px solid #EEEEEE; +} + +div#page_content div#tableslistcontainer, div#page_content div.notice, div#page_content div.result_query { + margin-top: 1em; +} + +table.show_create { + margin-top: 1em; +} + +table.show_create td { + border-right: 1px solid #bbb; +} + +#alias_modal table { + width: 100%; +} + +#alias_modal label { + font-weight: bold; +} + +.ui-dialog { + position: fixed; +} + + +.small_font { + font-size: smaller; +} + +/* Console styles */ +#pma_console_container { + width: 100%; + position: fixed; + bottom: 0; + : 0; + z-index: 100; +} +#pma_console { + position: relative; + margin-: 240px; +} +#pma_console .templates { + display: none; +} +#pma_console .mid_text, +#pma_console .toolbar span { + vertical-align: middle; +} +#pma_console .toolbar { + position: relative; + background: #ccc; + border-top: solid 1px #aaa; + cursor: n-resize; +} +#pma_console .toolbar.collapsed:not(:hover) { + display: inline-block; + border-top--radius: 3px; + border-: solid 1px #aaa; +} +#pma_console .toolbar.collapsed { + cursor: default; +} +#pma_console .toolbar.collapsed>.button { + display: none; +} +#pma_console .message span.text, +#pma_console .message span.action, +#pma_console .toolbar .button, +#pma_console .toolbar .text, +#pma_console .switch_button { + padding: 0 3px; + display: inline-block; +} +#pma_console .message span.action, +#pma_console .toolbar .button, +#pma_console .switch_button { + cursor: pointer; +} +#pma_console .message span.action:hover, +#pma_console .toolbar .button:hover, +#pma_console .switch_button:hover, +#pma_console .toolbar .button.active { + background: #ddd; +} +#pma_console .toolbar .text { + font-weight: bold; +} +#pma_console .toolbar .button, +#pma_console .toolbar .text { + margin-: .4em; +} +#pma_console .toolbar .button, +#pma_console .toolbar .text { + float: ; +} +#pma_console .content { + overflow-x: hidden; + overflow-y: auto; + margin-bottom: -65px; + border-top: solid 1px #aaa; + background: #fff; + padding-top: .4em; +} +#pma_console .content.console_dark_theme { + background: #000; + color: #fff; +} +#pma_console .content.console_dark_theme .CodeMirror-wrap { + background: #000; + color: #fff; +} +#pma_console .content.console_dark_theme .action_content { + color: #000; +} +#pma_console .content.console_dark_theme .message { + border-color: #373B41; +} +#pma_console .content.console_dark_theme .CodeMirror-cursor { + border-color: #fff; +} +#pma_console .content.console_dark_theme .cm-keyword { + color: #de935f; +} +#pma_console .message, +#pma_console .query_input { + position: relative; + font-family: Monaco, Consolas, monospace; + cursor: text; + margin: 0 10px .2em 1.4em; +} +#pma_console .message { + border-bottom: solid 1px #ccc; + padding-bottom: .2em; +} +#pma_console .message.expanded>.action_content { + position: relative; +} +#pma_console .message:before, +#pma_console .query_input:before { + left: -0.7em; + position: absolute; + content: ">"; +} +#pma_console .query_input:before { + top: -2px; +} +#pma_console .query_input textarea { + width: 100%; + height: 4em; + resize: vertical; +} +#pma_console .message:hover:before { + color: #7cf; + font-weight: bold; +} +#pma_console .message.expanded:before { + content: "]"; +} +#pma_console .message.welcome:before { + display: none; +} +#pma_console .message.failed:before, +#pma_console .message.failed.expanded:before, +#pma_console .message.failed:hover:before { + content: "="; + color: #944; +} +#pma_console .message.pending:before { + opacity: .3; +} +#pma_console .message.collapsed>.query { + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; +} +#pma_console .message.expanded>.query { + display: block; + white-space: pre; + word-wrap: break-word; +} +#pma_console .message .text.targetdb, +#pma_console .message.collapsed .action.collapse, +#pma_console .message.expanded .action.expand, +#pma_console .message .action.requery, +#pma_console .message .action.profiling, +#pma_console .message .action.explain, +#pma_console .message .action.bookmark { + display: none; +} +#pma_console .message.select .action.profiling, +#pma_console .message.select .action.explain, +#pma_console .message.history .text.targetdb, +#pma_console .message.successed .text.targetdb, +#pma_console .message.history .action.requery, +#pma_console .message.history .action.bookmark, +#pma_console .message.bookmark .action.requery, +#pma_console .message.bookmark .action.bookmark, +#pma_console .message.successed .action.requery, +#pma_console .message.successed .action.bookmark { + display: inline-block; +} +#pma_console .message .action_content { + position: absolute; + bottom: 100%; + background: #ccc; + border: solid 1px #aaa; + border-top--radius: 3px; +} +html.ie8 #pma_console .message .action_content { + position: relative!important; +} +#pma_console .message.bookmark .text.targetdb, +#pma_console .message .text.query_time { + margin: 0; + display: inline-block; +} +#pma_console .message.failed .text.query_time, +#pma_console .message .text.failed { + display: none; +} +#pma_console .message.failed .text.failed { + display: inline-block; +} +#pma_console .message .text { + background: #fff; +} +#pma_console .message.collapsed>.action_content { + display: none; +} +#pma_console .message.collapsed:hover>.action_content { + display: block; +} +#pma_console .message .bookmark_label { + padding: 0 4px; + top: 0; + background: #369; + color: #fff; + border-radius: 3px; +} +#pma_console .message .bookmark_label.shared { + background: #396; +} +#pma_console .message.expanded .bookmark_label { + border-top-left-radius: 0; + border-top-right-radius: 0; +} +#pma_console .query_input { + position: relative; +} +#pma_console .mid_layer { + height: 100%; + width: 100%; + position: absolute; + top: 0; + /* For support IE8, this layer doesn't use filter:opacity or opacity, + js code will fade this layer opacity to 0.18(using animation) */ + background: #666; + display: none; + cursor: pointer; + z-index: 200; +} +#pma_console .card { + position: absolute; + width: 94%; + height: 100%; + min-height: 48px; + : 100%; + top: 0; + border-: solid 1px #999; + z-index: 300; + transition: 0.2s; + -ms-transition: 0.2s; + -webkit-transition: 0.2s; + -moz-transition: 0.2s; +} +#pma_console .card.show { + : 6%; + box-shadow: -2px 1px 4px -1px #999; +} + +html.ie7 #pma_console .query_input { + display: none; +} + +#pma_bookmarks .content.add_bookmark, +#pma_console_options .content { + padding: 4px 6px; +} +#pma_bookmarks .content.add_bookmark .options { + margin-: 1.4em; + padding-bottom: .4em; + margin-bottom: .4em; + border-bottom: solid 1px #ccc; +} +#pma_bookmarks .content.add_bookmark .options button { + margin: 0 7px; + vertical-align: bottom; +} +#pma_bookmarks .content.add_bookmark input[type=text] { + margin: 0; + padding: 2px 4px; +} +#pma_console .button.hide, +#pma_console .message span.text.hide { + display: none; +} +#debug_console.grouped .ungroup_queries, +#debug_console.ungrouped .group_queries { + display: inline-block; +} +#debug_console.ungrouped .ungroup_queries, +#debug_console.ungrouped .sort_count, +#debug_console.grouped .group_queries { + display: none; +} +#debug_console .count { + margin-right: 8px; +} +#debug_console .show_trace .trace, +#debug_console .show_args .args { + display: block; +} +#debug_console .hide_trace .trace, +#debug_console .hide_args .args, +#debug_console .show_trace .action.dbg_show_trace, +#debug_console .hide_trace .action.dbg_hide_trace, +#debug_console .traceStep.hide_args .action.dbg_hide_args, +#debug_console .traceStep.show_args .action.dbg_show_args { + display: none; +} + +#debug_console .traceStep:after, +#debug_console .trace.welcome:after, +#debug_console .debug>.welcome:after { + content: ""; + display: table; + clear: both; +} +#debug_console .debug_summary { + float: left; +} +#debug_console .trace.welcome .time { + float: right; +} +#debug_console .traceStep .file, +#debug_console .script_name { + float: right; +} +#debug_console .traceStep .args pre { + margin: 0; +} + +/* Code mirror console style*/ + +.cm-s-pma .CodeMirror-code pre, +.cm-s-pma .CodeMirror-code { + font-family: Monaco, Consolas, monospace; +} +.cm-s-pma .CodeMirror-measure>pre, +.cm-s-pma .CodeMirror-code>pre, +.cm-s-pma .CodeMirror-lines { + padding: 0; +} +.cm-s-pma.CodeMirror { + resize: none; + height: auto; + width: 100%; + min-height: initial; + max-height: initial; +} +.cm-s-pma .CodeMirror-scroll { + cursor: text; +} + +/* PMA drop-improt style */ + +.pma_drop_handler { + display: none; + position: fixed; + top: 0; + left: 0; + width: 100%; + background: rgba(0, 0, 0, 0.6); + height: 100%; + z-index: 999; + color: white; + font-size: 30pt; + text-align: center; + padding-top: 20%; +} + +.pma_sql_import_status { + display: none; + position: fixed; + bottom: 0; + right: 25px; + width: 400px; + border: 1px solid #999; + background: #f3f3f3; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: 2px 2px 5px #ccc; + -webkit-box-shadow: 2px 2px 5px #ccc; + box-shadow: 2px 2px 5px #ccc; +} + +.pma_sql_import_status h2, +.pma_drop_result h2 { + background-color: #bbb; + padding: .1em .3em; + margin-top: 0; + margin-bottom: 0; + color: #fff; + font-size: 1.6em; + font-weight: normal; + text-shadow: 0 1px 0 #777; + -moz-box-shadow: 1px 1px 15px #999 inset; + -webkit-box-shadow: 1px 1px 15px #999 inset; + box-shadow: 1px 1px 15px #999 inset; +} + +.pma_sql_import_status div { + height: 270px; + overflow-y:auto; + overflow-x:hidden; + list-style-type: none; +} + +.pma_sql_import_status div li { + padding: 8px 10px; + border-bottom: 1px solid #bbb; + color: rgb(148, 14, 14); + background: white; +} + +.pma_sql_import_status div li .filesize { + float: right; +} + +.pma_sql_import_status h2 .minimize { + float: right; + margin-right: 5px; + padding: 0 10px; +} + +.pma_sql_import_status h2 .close { + float: right; + margin-right: 5px; + padding: 0 10px; + display: none; +} + +.pma_sql_import_status h2 .minimize:hover, +.pma_sql_import_status h2 .close:hover, +.pma_drop_result h2 .close:hover { + background: rgba(155, 149, 149, 0.78); + cursor: pointer; +} + +.pma_drop_file_status { + color: #235a81; +} + +.pma_drop_file_status span.underline:hover { + cursor: pointer; + text-decoration: underline; +} + +.pma_drop_result { + position: fixed; + top: 10%; + left: 20%; + width: 60%; + background: white; + min-height: 300px; + z-index: 800; + -webkit-box-shadow: 0 0 15px #999; + border-radius: 10px; + cursor: move; +} + +.pma_drop_result h2 .close { + float: right; + margin-right: 5px; + padding: 0 10px; +} + +.dependencies_box { + background-color: white; + border: 3px ridge black; +} + +#composite_index_list { + list-style-type: none; + list-style-position: inside; +} + +span.drag_icon { + display: inline-block; + background-image: url('getImgPath('s_sortable.png');?>'); + background-position: center center; + background-repeat: no-repeat; + width: 1em; + height: 3em; + cursor: move; +} + +.topmargin { + margin-top: 1em; +} + +meter[value="1"]::-webkit-meter-optimum-value { + background: linear-gradient(white 3%, #E32929 5%, transparent 10%, #E32929); +} +meter[value="2"]::-webkit-meter-optimum-value { + background: linear-gradient(white 3%, #FF6600 5%, transparent 10%, #FF6600); +} +meter[value="3"]::-webkit-meter-optimum-value { + background: linear-gradient(white 3%, #FFD700 5%, transparent 10%, #FFD700); +} + +/* styles for sortable tables created with tablesorter jquery plugin */ +th.header { + cursor: pointer; + color: #235a81; +} + +th.header:hover { + text-decoration: underline; +} + +th.header .sorticon { + width: 16px; + height: 16px; + background-repeat: no-repeat; + background-position: right center; + display: inline-table; + vertical-align: middle; + float: right; +} + +th.headerSortUp .sorticon, th.headerSortDown:hover .sorticon { + background-image: url(getImgPath('s_desc.png');?>); +} + +th.headerSortDown .sorticon, th.headerSortUp:hover .sorticon { + background-image: url(getImgPath('s_asc.png');?>); +} +/* end of styles of sortable tables */ + +/* styles for jQuery-ui to support rtl languages */ +body .ui-dialog .ui-dialog-titlebar-close { + : .3em; + : initial; +} + +body .ui-dialog .ui-dialog-title { + float: ; +} + +body .ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: ; +} +/* end of styles for jQuery-ui to support rtl languages */ + +@media only screen and (max-width: 768px) { + /* For mobile phones: */ + #main_pane_left { + width: 100%; + } + + #main_pane_right { + padding-top: 0; + padding-: 1px; + padding-: 1px; + } + + ul#topmenu, + ul.tabs { + display: flex; + } + + .navigationbar { + display: inline-flex; + margin: 0 !important; + border-radius: 0 !important; + overflow: auto; + } + + .scrollindicator { + padding: 5px; + cursor: pointer; + display: inline; + } + + .responsivetable { + overflow-x: auto; + } + + body#loginform div.container { + width: 100%; + } + + .largescreenonly { + display: none; + } + + .width100, .desktop50 { + width: 100%; + } + + .width96 { + width: 96% !important; + } + + #page_nav_icons { + display: none; + } + + table#serverstatusconnections { + margin-left: 0; + } + + #table_name_col_no { + top: 62px + } + + .tdblock tr td { + display: block; + } + + #table_columns { + margin-top: 60px; + } + + #table_columns .tablesorter { + min-width: 100%; + } + + .doubleFieldset fieldset { + width: 98%; + } + + div#serverstatusquerieschart { + width: 100%; + height: 450px; + } + + .ui-dialog { + margin: 1%; + width: 95% !important; + } +} +/* templates/database/designer */ +/* side menu */ +#name-panel { + overflow:hidden; +} diff --git a/phpMyAdmin/themes/pmahomme/css/designer.css.php b/phpMyAdmin/themes/pmahomme/css/designer.css.php new file mode 100755 index 0000000..6c5ecb0 --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/designer.css.php @@ -0,0 +1,515 @@ +getImgPath('designer/Header.png'); +$headerLinkedImg = $theme->getImgPath('designer/Header_Linked.png'); +$minusImg = $theme->getImgPath('designer/minus.png'); +$plusImg = $theme->getImgPath('designer/plus.png'); +$leftPanelButtonImg = $theme->getImgPath('designer/left_panel_butt.png'); +$topPanelImg = $theme->getImgPath('designer/top_panel.png'); +$smallTabImg = $theme->getImgPath('designer/small_tab.png'); +$frams1Img = $theme->getImgPath('designer/1.png'); +$frams2Img = $theme->getImgPath('designer/2.png'); +$frams3Img = $theme->getImgPath('designer/3.png'); +$frams4Img = $theme->getImgPath('designer/4.png'); +$frams5Img = $theme->getImgPath('designer/5.png'); +$frams6Img = $theme->getImgPath('designer/6.png'); +$frams7Img = $theme->getImgPath('designer/7.png'); +$frams8Img = $theme->getImgPath('designer/8.png'); +$resizeImg = $theme->getImgPath('designer/resize.png'); +?> + +/* Designer */ +.input_tab { + background-color: #A6C7E1; + color: #000; +} + +.content_fullscreen { + position: relative; + overflow: auto; +} + +#canvas_outer { + position: relative; + width: 100%; + display: block; +} + +#canvas { + background-color: #fff; + color: #000; +} + +canvas.designer { + display: inline-block; + overflow: hidden; + text-align: left; +} + +canvas.designer * { + behavior: url(#default#VML); +} + +.designer_tab { + background-color: #fff; + color: #000; + border-collapse: collapse; + border: 1px solid #aaa; + z-index: 1; + -moz-user-select: none; +} + +.designer_tab .header { + background-image: url(); + background-repeat: repeat-x; +} + +.tab_zag { + text-align: center; + cursor: move; + padding: 1px; + font-weight: bold; +} + +.tab_zag_2 { + background-image: url(); + background-repeat: repeat-x; + text-align: center; + cursor: move; + padding: 1px; + font-weight: bold; +} + +.tab_field { + background: #fff; + color: #000; + cursor: default; +} + +.tab_field:hover, .tab_field_3:hover { + background-color: #CCFFCC; + color: #000; + background-repeat: repeat-x; + cursor: default; +} + +.tab_field_3 { + background-color: #FFE6E6 !important; /*#DDEEFF*/ + color: #000; + cursor: default; +} + +#designer_hint { + white-space: nowrap; + position: absolute; + background-color: #99FF99; + color: #000; + z-index: 3; + border: #00CC66 solid 1px; + display: none; +} + +.scroll_tab { + overflow: auto; + width: 100%; + height: 500px; +} + +.designer_Tabs { + cursor: default; + color: #0055bb; + white-space: nowrap; + text-decoration: none; + text-indent: 3px; + font-weight: bold; + margin-left: 2px; + text-align: ; + background-color: #fff; + background-image: url(); + border: #ccc solid 1px; +} + +.designer_Tabs:hover { + cursor: default; + color: #0055bb; + background: #FFEE99; + text-indent: 3px; + font-weight: bold; + white-space: nowrap; + text-decoration: none; + border: #9999FF solid 1px; + text-align: ; +} + +.owner { + font-weight: normal; + color: #888; +} + +.option_tab { + padding-left: 2px; + padding-right: 2px; + width: 5px; +} + +.select_all { + vertical-align: top; + padding-left: 2px; + padding-right: 2px; + cursor: default; + width: 1px; + color: #000; + background-image: url(); + background-repeat: repeat-x; +} + +.small_tab { + vertical-align: top; + background-color: #0064ea; + color: #fff; + background-image: url(); + cursor: default; + text-align: center; + font-weight: bold; + padding-left: 2px; + padding-right: 2px; + width: 1px; + text-decoration: none; +} + +.small_tab:hover { + vertical-align: top; + color: #fff; + background-color: #FF9966; + cursor: default; + padding-left: 2px; + padding-right: 2px; + text-align: center; + font-weight: bold; + width: 1px; + text-decoration: none; +} + +.small_tab_pref { + background-image: url(); + background-repeat: repeat-x; + text-align: center; + width: 1px; +} + +.small_tab_pref:hover { + vertical-align: top; + color: #fff; + background-color: #FF9966; + cursor: default; + text-align: center; + font-weight: bold; + width: 1px; + text-decoration: none; +} + +.butt { + border: #4477aa solid 1px; + font-weight: bold; + height: 19px; + width: 70px; + background-color: #fff; + color: #000; + vertical-align: baseline; +} + +.L_butt2_1 { + padding: 1px; + text-decoration: none; + vertical-align: middle; + cursor: default; +} + +.L_butt2_1:hover { + padding: 0; + border: #0099CC solid 1px; + background: #FFEE99; + color: #000; + text-decoration: none; + vertical-align: middle; + cursor: default; +} + +/* ---------------------------------------------------------------------------*/ +.bor { + width: 10px; + height: 10px; +} + +.frams1 { + background: url() no-repeat right bottom; +} + +.frams2 { + background: url() no-repeat left bottom; +} + +.frams3 { + background: url() no-repeat left top; +} + +.frams4 { + background: url() no-repeat right top; +} + +.frams5 { + background: url() repeat-x center bottom; +} + +.frams6 { + background: url() repeat-y left; +} + +.frams7 { + background: url() repeat-x top; +} + +.frams8 { + background: url() repeat-y right; +} + +#osn_tab { + position: absolute; + background-color: #fff; + color: #000; +} + +.designer_header { + background-color: #EAEEF0; + color: #000; + text-align: center; + font-weight: bold; + margin: 0; + padding: 0; + background-image: url(); + background-position: top; + background-repeat: repeat-x; + border-right: #999 solid 1px; + border-left: #999 solid 1px; + height: 28px; + z-index: 101; + width: 100%; + position: fixed; +} + +.designer_header a, .designer_header span{ + display: block; + float: ; + margin: 3px 1px 4px; + height: 20px; + border: 1px dotted #fff; +} + +.designer_header .M_bord { + display: block; + float: ; + margin: 4px; + height: 20px; + width: 2px; +} + +.designer_header a.first { + margin-right: 1em; +} + +.designer_header a.last { + margin-left: 1em; +} + +a.M_butt_Selected_down_IE, +a.M_butt_Selected_down { + border: 1px solid #C0C0BB; + background-color: #99FF99; + color: #000; +} + +a.M_butt_Selected_down_IE:hover, +a.M_butt_Selected_down:hover, +a.M_butt:hover { + border: 1px solid #0099CC; + background-color: #FFEE99; + color: #000; +} + +#layer_menu { + z-index: 98; + position: relative; + float: right; + background-color: #EAEEF0; + border: #999 solid 1px; +} + +#layer_menu.left { + float: left; +} + +#layer_upd_relation { + position: absolute; + : 637px; + top: 224px; + z-index: 100; +} + +#layer_new_relation { + position: absolute; + : 636px; + top: 85px; + z-index: 100; + width: 153px; +} + +#designer_optionse { + position: absolute; + : 636px; + top: 85px; + z-index: 100; + width: 153px; +} + +#layer_menu_sizer { + background-image: url(); + cursor: ew-resize; +} + +#layer_menu_sizer .icon { + margin: 0; +} + +.panel { + position: fixed; + top: 60px; + : 0; + width: 350px; + max-height: 500px; + display: none; + overflow: auto; + padding-top: 34px; + z-index: 102; +} + +a.trigger { + position: fixed; + text-decoration: none; + top: 60px; + : 0; + color: #fff; + padding: 10px 40px 10px 15px; + background: #333 url() 85% 55% no-repeat; + border: 1px solid #444; + display: block; + z-index: 102; +} + +a.trigger:hover { + color: #080808; + background: #fff696 url() 85% 55% no-repeat; + border: 1px solid #999; +} + +a.active.trigger { + background: #222 url() 85% 55% no-repeat; + z-index: 999; +} + +a.active.trigger:hover { + background: #fff696 url() 85% 55% no-repeat; +} + +.toggle_container .block { + background-color: #DBE4E8; + border-top: 1px solid #999; +} + +.history_table { + text-align: center; + cursor: pointer; + background-color: #DBE4E8; +} + +.history_table:hover { + background-color: #9999CC; +} + +#ab { + min-width: 300px; +} + +#ab .ui-accordion-content { + padding: 0; +} + +#box { + display: none; +} + +#foreignkeychk { + text-align: ; + position: absolute; + cursor: pointer; +} + +.side-menu { + float: left; + position: fixed; + width: auto; + height: auto; + background: #efefef; + border: 1px solid grey; + overflow: hidden; + z-index: 50; + padding: 2px; +} + +.side-menu.right { + float: right; + right: 0; +} + +.side-menu .hide { + display: none; +} + +.side-menu a { + display: block; + float: none; + overflow: hidden; +} + +.side-menu img, +.side-menu .text { + float: left; +} + +#name-panel { + border-bottom: 1px solid grey; + text-align: center; + background: #efefef; + width: 100%; + font-size: 1.2em; + padding: 10px; + font-weight: bold; +} + +#container-form { + width: 100%; + position: absolute; + left: 0; +} diff --git a/phpMyAdmin/themes/pmahomme/css/enum_editor.css.php b/phpMyAdmin/themes/pmahomme/css/enum_editor.css.php new file mode 100755 index 0000000..6042953 --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/enum_editor.css.php @@ -0,0 +1,80 @@ + + +/** + * ENUM/SET editor styles + */ +p.enum_notice { + margin: 5px 2px; + font-size: 80%; +} + +#enum_editor p { + margin-top: 0; + font-style: italic; +} + +#enum_editor .values, +#enum_editor .add { + width: 100%; +} + +#enum_editor .add td { + vertical-align: middle; + width: 50%; + padding: 0 0 0; + padding-: 1em; +} + +#enum_editor .values td.drop { + width: 1.8em; + cursor: pointer; + vertical-align: middle; +} + +#enum_editor .values input { + margin: .1em 0; + padding-: 2em; + width: 100%; +} + +#enum_editor .values img { + width: 1.8em; + vertical-align: middle; +} + +#enum_editor input.add_value { + margin: 0; + margin-: 0.4em; +} + +#enum_editor_output textarea { + width: 100%; + float: ; + margin: 1em 0 0 0; +} + +/** + * ENUM/SET editor integration for the routines editor + */ +.enum_hint { + position: relative; +} + +.enum_hint a { + position: absolute; + : 81%; + bottom: .35em; +} diff --git a/phpMyAdmin/themes/pmahomme/css/gis.css.php b/phpMyAdmin/themes/pmahomme/css/gis.css.php new file mode 100755 index 0000000..5f7979a --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/gis.css.php @@ -0,0 +1,52 @@ + + +/** + * GIS data editor styles + */ +a.close_gis_editor { + float: ; +} + +#gis_editor { + display: none; + position: fixed; + _position: absolute; /* hack for IE */ + z-index: 1001; + overflow-y: auto; + overflow-x: hidden; +} + +#gis_data { + min-height: 230px; +} + +#gis_data_textarea { + height: 6em; +} + +#gis_data_editor { + background: #D0DCE0; + padding: 15px; + min-height: 500px; +} + +#gis_data_editor .choice { + display: none; +} + +#gis_data_editor input[type="text"] { + width: 75px; +} diff --git a/phpMyAdmin/themes/pmahomme/css/icons.css.php b/phpMyAdmin/themes/pmahomme/css/icons.css.php new file mode 100755 index 0000000..c23ca71 --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/icons.css.php @@ -0,0 +1,193 @@ +getImgPath('designer/left_panel_butt.png'); + +// unplanned execution path +if (! defined('PHPMYADMIN') && ! defined('TESTSUITE')) { + exit(); +} +?> +.icon { + margin: 0; + margin-left: .3em; + padding: 0 !important; + width: 16px; + height: 16px; +} +.icon_fulltext { + width: 50px; + height: 19px; +} +.ic_asc_order { background-image: url('getImgPath('asc_order.png'); ?>'); } +.ic_b_bookmark { background-image: url('getImgPath('b_bookmark.png'); ?>'); } +.ic_b_browse { background-image: url('getImgPath('b_browse.png'); ?>'); } +.ic_b_calendar { background-image: url('getImgPath('b_calendar.png'); ?>'); } +.ic_b_chart { background-image: url('getImgPath('b_chart.png'); ?>'); } +.ic_b_close { background-image: url('getImgPath('b_close.png'); ?>'); } +.ic_b_column_add { background-image: url('getImgPath('b_column_add.png'); ?>'); } +.ic_b_comment { background-image: url('getImgPath('b_comment.png'); ?>'); } +.ic_b_dbstatistics { background-image: url('getImgPath('b_dbstatistics.png'); ?>'); } +.ic_b_deltbl { background-image: url('getImgPath('b_deltbl.png'); ?>'); } +.ic_b_docs { background-image: url('getImgPath('b_docs.png'); ?>'); } +.ic_b_docsql { background-image: url('getImgPath('b_docsql.png'); ?>'); } +.ic_b_drop { background-image: url('getImgPath('b_drop.png'); ?>'); } +.ic_b_edit { background-image: url('getImgPath('b_edit.png'); ?>'); } +.ic_b_empty { background-image: url('getImgPath('b_empty.png'); ?>'); } +.ic_b_engine { background-image: url('getImgPath('b_engine.png'); ?>'); } +.ic_b_event_add { background-image: url('getImgPath('b_event_add.png'); ?>'); } +.ic_b_events { background-image: url('getImgPath('b_events.png'); ?>'); } +.ic_b_export { background-image: url('getImgPath('b_export.png'); ?>'); } +.ic_b_favorite { background-image: url('getImgPath('b_favorite.png'); ?>'); } +.ic_b_find_replace { background-image: url('getImgPath('b_find_replace.png'); ?>'); } +.ic_b_firstpage { background-image: url('getImgPath('b_firstpage.png'); ?>'); } +.ic_b_ftext { background-image: url('getImgPath('b_ftext.png'); ?>'); } +.ic_b_globe { background-image: url('getImgPath('b_globe.gif'); ?>'); } +.ic_b_group { background-image: url('getImgPath('b_group.png'); ?>'); } +.ic_b_help { background-image: url('getImgPath('b_help.png'); ?>'); } +.ic_b_home { background-image: url('getImgPath('b_home.png'); ?>'); } +.ic_b_import { background-image: url('getImgPath('b_import.png'); ?>'); } +.ic_b_index { background-image: url('getImgPath('b_index.png'); ?>'); } +.ic_b_index_add { background-image: url('getImgPath('b_index_add.png'); ?>'); } +.ic_b_inline_edit { background-image: url('getImgPath('b_inline_edit.png'); ?>'); } +.ic_b_insrow { background-image: url('getImgPath('b_insrow.png'); ?>'); } +.ic_b_lastpage { background-image: url('getImgPath('b_lastpage.png'); ?>'); } +.ic_b_minus { background-image: url('getImgPath('b_minus.png'); ?>'); } +.ic_b_more { background-image: url('getImgPath('b_more.png'); ?>'); } +.ic_b_move { background-image: url('getImgPath('b_move.png'); ?>'); } +.ic_b_newdb { background-image: url('getImgPath('b_newdb.png'); ?>'); } +.ic_b_newtbl { background-image: url('getImgPath('b_newtbl.png'); ?>'); } +.ic_b_nextpage { background-image: url('getImgPath('b_nextpage.png'); ?>'); } +.ic_b_no_favorite { background-image: url('getImgPath('b_no_favorite.png'); ?>'); } +.ic_b_pdfdoc { background-image: url('getImgPath('b_pdfdoc.png'); ?>'); } +.ic_b_plugin { background-image: url('getImgPath('b_plugin.png'); ?>'); } +.ic_b_plus { background-image: url('getImgPath('b_plus.png'); ?>'); } +.ic_b_prevpage { background-image: url('getImgPath('b_prevpage.png'); ?>'); } +.ic_b_primary { background-image: url('getImgPath('b_primary.png'); ?>'); } +.ic_b_print { background-image: url('getImgPath('b_print.png'); ?>'); } +.ic_b_props { background-image: url('getImgPath('b_props.png'); ?>'); } +.ic_b_relations { background-image: url('getImgPath('b_relations.png'); ?>'); } +.ic_b_report { background-image: url('getImgPath('b_report.png'); ?>'); } +.ic_b_routine_add { background-image: url('getImgPath('b_routine_add.png'); ?>'); } +.ic_b_routines { background-image: url('getImgPath('b_routines.png'); ?>'); } +.ic_b_save { background-image: url('getImgPath('b_save.png'); ?>'); } +.ic_b_saveimage { background-image: url('getImgPath('b_saveimage.png'); ?>'); } +.ic_b_sbrowse { background-image: url('getImgPath('b_sbrowse.png'); ?>'); } +.ic_b_sdb { background-image: url('getImgPath('b_sdb.png'); ?>'); width: 10px; height: 10px; } +.ic_b_search { background-image: url('getImgPath('b_search.png'); ?>'); } +.ic_b_select { background-image: url('getImgPath('b_select.png'); ?>'); } +.ic_b_snewtbl { background-image: url('getImgPath('b_snewtbl.png'); ?>'); } +.ic_b_spatial { background-image: url('getImgPath('b_spatial.png'); ?>'); } +.ic_b_sql { background-image: url('getImgPath('b_sql.png'); ?>'); } +.ic_b_sqldoc { background-image: url('getImgPath('b_sqldoc.png'); ?>'); } +.ic_b_sqlhelp { background-image: url('getImgPath('b_sqlhelp.png'); ?>'); } +.ic_b_table_add { background-image: url('getImgPath('b_table_add.png'); ?>'); } +.ic_b_tblanalyse { background-image: url('getImgPath('b_tblanalyse.png'); ?>'); } +.ic_b_tblexport { background-image: url('getImgPath('b_tblexport.png'); ?>'); } +.ic_b_tblimport { background-image: url('getImgPath('b_tblimport.png'); ?>'); } +.ic_b_tblops { background-image: url('getImgPath('b_tblops.png'); ?>'); } +.ic_b_tbloptimize { background-image: url('getImgPath('b_tbloptimize.png'); ?>'); } +.ic_b_tipp { background-image: url('getImgPath('b_tipp.png'); ?>'); } +.ic_b_trigger_add { background-image: url('getImgPath('b_trigger_add.png'); ?>'); } +.ic_b_triggers { background-image: url('getImgPath('b_triggers.png'); ?>'); } +.ic_b_undo { background-image: url('getImgPath('b_undo.png'); ?>'); } +.ic_b_unique { background-image: url('getImgPath('b_unique.png'); ?>'); } +.ic_b_usradd { background-image: url('getImgPath('b_usradd.png'); ?>'); } +.ic_b_usrcheck { background-image: url('getImgPath('b_usrcheck.png'); ?>'); } +.ic_b_usrdrop { background-image: url('getImgPath('b_usrdrop.png'); ?>'); } +.ic_b_usredit { background-image: url('getImgPath('b_usredit.png'); ?>'); } +.ic_b_usrlist { background-image: url('getImgPath('b_usrlist.png'); ?>'); } +.ic_b_versions { background-image: url('getImgPath('b_versions.png'); ?>'); } +.ic_b_view { background-image: url('getImgPath('b_view.png'); ?>'); } +.ic_b_view_add { background-image: url('getImgPath('b_view_add.png'); ?>'); } +.ic_b_views { background-image: url('getImgPath('b_views.png'); ?>'); } +.ic_b_left { background-image: url('getImgPath('b_left.png'); ?>'); } +.ic_b_right { background-image: url('getImgPath('b_right.png'); ?>'); } +.ic_bd_browse { background-image: url('getImgPath('bd_browse.png'); ?>'); } +.ic_bd_deltbl { background-image: url('getImgPath('bd_deltbl.png'); ?>'); } +.ic_bd_drop { background-image: url('getImgPath('bd_drop.png'); ?>'); } +.ic_bd_edit { background-image: url('getImgPath('bd_edit.png'); ?>'); } +.ic_bd_empty { background-image: url('getImgPath('bd_empty.png'); ?>'); } +.ic_bd_export { background-image: url('getImgPath('bd_export.png'); ?>'); } +.ic_bd_firstpage { background-image: url('getImgPath('bd_firstpage.png'); ?>'); } +.ic_bd_ftext { background-image: url('getImgPath('bd_ftext.png'); ?>'); } +.ic_bd_index { background-image: url('getImgPath('bd_index.png'); ?>'); } +.ic_bd_insrow { background-image: url('getImgPath('bd_insrow.png'); ?>'); } +.ic_bd_lastpage { background-image: url('getImgPath('bd_lastpage.png'); ?>'); } +.ic_bd_nextpage { background-image: url('getImgPath('bd_nextpage.png'); ?>'); } +.ic_bd_prevpage { background-image: url('getImgPath('bd_prevpage.png'); ?>'); } +.ic_bd_primary { background-image: url('getImgPath('bd_primary.png'); ?>'); } +.ic_bd_routine_add { background-image: url('getImgPath('bd_routine_add.png'); ?>'); } +.ic_bd_sbrowse { background-image: url('getImgPath('bd_sbrowse.png'); ?>'); } +.ic_bd_select { background-image: url('getImgPath('bd_select.png'); ?>'); } +.ic_bd_spatial { background-image: url('getImgPath('bd_spatial.png'); ?>'); } +.ic_bd_unique { background-image: url('getImgPath('bd_unique.png'); ?>'); } +.ic_centralColumns { background-image: url('getImgPath('centralColumns.png'); ?>'); } +.ic_centralColumns_add { background-image: url('getImgPath('centralColumns_add.png'); ?>'); } +.ic_centralColumns_delete { background-image: url('getImgPath('centralColumns_delete.png'); ?>'); } +.ic_col_drop { background-image: url('getImgPath('col_drop.png'); ?>'); } +.ic_console { background-image: url('getImgPath('console.png'); ?>'); } +.ic_database { background-image: url('getImgPath('database.png'); ?>'); } +.ic_eye { background-image: url('getImgPath('eye.png'); ?>'); } +.ic_eye_grey { background-image: url('getImgPath('eye_grey.png'); ?>'); } +.ic_hide { background-image: url('getImgPath('hide.png'); ?>'); } +.ic_item { background-image: url('getImgPath('item.png'); ?>'); width: 9px; height: 9px; } +.ic_lightbulb { background-image: url('getImgPath('lightbulb.png'); ?>'); } +.ic_lightbulb_off { background-image: url('getImgPath('lightbulb_off.png'); ?>'); } +.ic_more { background-image: url('getImgPath('more.png'); ?>'); width: 13px; } +.ic_new_data { background-image: url('getImgPath('new_data.png'); ?>'); } +.ic_new_data_hovered { background-image: url('getImgPath('new_data_hovered.png'); ?>'); } +.ic_new_data_selected { background-image: url('getImgPath('new_data_selected.png'); ?>'); } +.ic_new_data_selected_hovered { background-image: url('getImgPath('new_data_selected_hovered.png'); ?>'); } +.ic_new_struct { background-image: url('getImgPath('new_struct.png'); ?>'); } +.ic_new_struct_hovered { background-image: url('getImgPath('new_struct_hovered.png'); ?>'); } +.ic_new_struct_selected { background-image: url('getImgPath('new_struct_selected.png'); ?>'); } +.ic_new_struct_selected_hovered { background-image: url('getImgPath('new_struct_selected_hovered.png'); ?>'); } +.ic_normalize { background-image: url('getImgPath('normalize.png'); ?>'); } +.ic_pause { background-image: url('getImgPath('pause.png'); ?>'); } +.ic_php_sym { background-image: url('getImgPath('php_sym.png'); ?>'); } +.ic_play { background-image: url('getImgPath('play.png'); ?>'); } +.ic_s_asc { background-image: url('getImgPath('s_asc.png'); ?>'); } +.ic_s_asci { background-image: url('getImgPath('s_asci.png'); ?>'); } +.ic_s_attention { background-image: url('getImgPath('s_attention.png'); ?>'); } +.ic_s_cancel { background-image: url('getImgPath('s_cancel.png'); ?>'); } +.ic_s_cancel2 { background-image: url('getImgPath('s_cancel2.png'); ?>'); } +.ic_s_cog { background-image: url('getImgPath('s_cog.png'); ?>'); } +.ic_s_db { background-image: url('getImgPath('s_db.png'); ?>'); } +.ic_s_desc { background-image: url('getImgPath('s_desc.png'); ?>'); } +.ic_s_error { background-image: url('getImgPath('s_error.png'); ?>'); } +.ic_s_host { background-image: url('getImgPath('s_host.png'); ?>'); } +.ic_s_info { background-image: url('getImgPath('s_info.png'); ?>'); } +.ic_s_lang { background-image: url('getImgPath('s_lang.png'); ?>'); } +.ic_s_link { background-image: url('getImgPath('s_link.png'); ?>'); } +.ic_s_lock { background-image: url('getImgPath('s_lock.png'); ?>'); } +.ic_s_loggoff { background-image: url('getImgPath('s_loggoff.png'); ?>'); } +.ic_s_notice { background-image: url('getImgPath('s_notice.png'); ?>'); } +.ic_s_okay { background-image: url('getImgPath('s_okay.png'); ?>'); } +.ic_s_passwd { background-image: url('getImgPath('s_passwd.png'); ?>'); } +.ic_s_process { background-image: url('getImgPath('s_process.png'); ?>'); } +.ic_s_really { background-image: url('getImgPath('s_really.png'); ?>'); width: 11px; height: 11px; } +.ic_s_reload { background-image: url('getImgPath('s_reload.png'); ?>'); } +.ic_s_replication { background-image: url('getImgPath('s_replication.png'); ?>'); } +.ic_s_rights { background-image: url('getImgPath('s_rights.png'); ?>'); } +.ic_s_sortable { background-image: url('getImgPath('s_sortable.png'); ?>'); } +.ic_s_status { background-image: url('getImgPath('s_status.png'); ?>'); } +.ic_s_success { background-image: url('getImgPath('s_success.png'); ?>'); } +.ic_s_sync { background-image: url('getImgPath('s_sync.png'); ?>'); } +.ic_s_tbl { background-image: url('getImgPath('s_tbl.png'); ?>'); } +.ic_s_theme { background-image: url('getImgPath('s_theme.png'); ?>'); } +.ic_s_top { background-image: url('getImgPath('s_top.png'); ?>'); } +.ic_s_unlink { background-image: url('getImgPath('s_unlink.png'); ?>'); } +.ic_s_vars { background-image: url('getImgPath('s_vars.png'); ?>'); } +.ic_s_views { background-image: url('getImgPath('s_views.png'); ?>'); } +.ic_show { background-image: url('getImgPath('show.png'); ?>'); } +.ic_window-new { background-image: url('getImgPath('window-new.png'); ?>'); } +.ic_ajax_clock_small { background-image: url('getImgPath('ajax_clock_small.gif'); ?>'); } +.ic_s_partialtext { background-image: url('getImgPath('s_partialtext.png'); ?>'); } +.ic_s_fulltext { background-image: url('getImgPath('s_fulltext.png'); ?>'); } diff --git a/phpMyAdmin/themes/pmahomme/css/jqplot.css.php b/phpMyAdmin/themes/pmahomme/css/jqplot.css.php new file mode 100755 index 0000000..1c5c5ac --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/jqplot.css.php @@ -0,0 +1,273 @@ + + +/* jqPlot */ + +/*rules for the plot target div. These will be cascaded down to all plot elements according to css rules*/ +.jqplot-target { + position: relative; + color: #222222; + font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; + font-size: 1em; +/* height: 300px; + width: 590px;*/ +} + +/*rules applied to all axes*/ +.jqplot-axis { + font-size: 0.75em; +} + +.jqplot-xaxis { + margin-top: 10px; +} + +.jqplot-x2axis { + margin-bottom: 10px; +} + +.jqplot-yaxis { + margin-: 10px; +} + +.jqplot-y2axis, .jqplot-y3axis, .jqplot-y4axis, .jqplot-y5axis, .jqplot-y6axis, .jqplot-y7axis, .jqplot-y8axis, .jqplot-y9axis, .jqplot-yMidAxis { + margin-left: 10px; + margin-right: 10px; +} + +/*rules applied to all axis tick divs*/ +.jqplot-axis-tick, .jqplot-xaxis-tick, .jqplot-yaxis-tick, .jqplot-x2axis-tick, .jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick, .jqplot-yMidAxis-tick { + position: absolute; + white-space: pre; +} + + +.jqplot-xaxis-tick { + top: 0; + /* initial position untill tick is drawn in proper place */ + : 15px; + vertical-align: top; +} + +.jqplot-x2axis-tick { + bottom: 0; + /* initial position untill tick is drawn in proper place */ + : 15px; + vertical-align: bottom; +} + +.jqplot-yaxis-tick { + : 0px; + /* initial position untill tick is drawn in proper place */ + top: 15px; + text-align: ; +} + +.jqplot-yaxis-tick.jqplot-breakTick { + : -20px; + margin-: 0; + padding:1px 5px 1px; + z-index: 2; + font-size: 1.5em; +} + +.jqplot-y2axis-tick, .jqplot-y3axis-tick, .jqplot-y4axis-tick, .jqplot-y5axis-tick, .jqplot-y6axis-tick, .jqplot-y7axis-tick, .jqplot-y8axis-tick, .jqplot-y9axis-tick { + : 0px; + /* initial position untill tick is drawn in proper place */ + top: 15px; +/* padding-left: 10px;*/ +/* padding-right: 15px;*/ + text-align: ; +} + +.jqplot-yMidAxis-tick { + text-align: center; + white-space: nowrap; +} + +.jqplot-xaxis-label { + margin-top: 10px; + font-size: 11pt; + position: absolute; +} + +.jqplot-x2axis-label { + margin-bottom: 10px; + font-size: 11pt; + position: absolute; +} + +.jqplot-yaxis-label { + margin-right: 10px; +/* text-align: center;*/ + font-size: 11pt; + position: absolute; +} + +.jqplot-yMidAxis-label { + font-size: 11pt; + position: absolute; +} + +.jqplot-y2axis-label, .jqplot-y3axis-label, .jqplot-y4axis-label, .jqplot-y5axis-label, .jqplot-y6axis-label, .jqplot-y7axis-label, .jqplot-y8axis-label, .jqplot-y9axis-label { +/* text-align: center;*/ + font-size: 11pt; + margin-: 10px; + position: absolute; +} + +.jqplot-meterGauge-tick { + font-size: 0.75em; + color: #999999; +} + +.jqplot-meterGauge-label { + font-size: 1em; + color: #999999; +} + +table.jqplot-table-legend { + margin-top: 12px; + margin-bottom: 12px; + margin-left: 12px; + margin-right: 12px; +} + +table.jqplot-table-legend, table.jqplot-cursor-legend { + background-color: rgba(255,255,255,0.6); + border: 1px solid #cccccc; + position: absolute; + font-size: 0.75em; +} + +td.jqplot-table-legend { + vertical-align: middle; +} + +/* +These rules could be used instead of assigning +element styles and relying on js object properties. +*/ + +/* +td.jqplot-table-legend-swatch { + padding-top: 0.5em; + text-align: center; +} + +tr.jqplot-table-legend:first td.jqplot-table-legend-swatch { + padding-top: 0px; +} +*/ + +td.jqplot-seriesToggle:hover, td.jqplot-seriesToggle:active { + cursor: pointer; +} + +.jqplot-table-legend .jqplot-series-hidden { + text-decoration: line-through; +} + +div.jqplot-table-legend-swatch-outline { + border: 1px solid #cccccc; + padding: 1px; +} + +div.jqplot-table-legend-swatch { + width: 0; + height: 0; + border-top-width: 5px; + border-bottom-width: 5px; + border-left-width: 6px; + border-right-width: 6px; + border-top-style: solid; + border-bottom-style: solid; + border-left-style: solid; + border-right-style: solid; +} + +.jqplot-title { + top: 0; + : 0px; + padding-bottom: 0.5em; + font-size: 1.2em; +} + +table.jqplot-cursor-tooltip { + border: 1px solid #cccccc; + font-size: 0.75em; +} + + +.jqplot-cursor-tooltip { + border: 1px solid #cccccc; + font-size: 0.75em; + white-space: nowrap; + background: rgba(208,208,208,0.5); + padding: 1px; +} + +.jqplot-highlighter-tooltip, .jqplot-canvasOverlay-tooltip { + border: 1px solid #cccccc; + font-size: 0.75em; + white-space: nowrap; + background: rgba(208,208,208,0.5); + padding: 1px; +} + +.jqplot-point-label { + font-size: 0.75em; + z-index: 2; +} + +td.jqplot-cursor-legend-swatch { + vertical-align: middle; + text-align: center; +} + +div.jqplot-cursor-legend-swatch { + width: 1.2em; + height: 0.7em; +} + +.jqplot-error { +/* Styles added to the plot target container when there is an error go here.*/ + text-align: center; +} + +.jqplot-error-message { +/* Styling of the custom error message div goes here.*/ + position: relative; + top: 46%; + display: inline-block; +} + +div.jqplot-bubble-label { + font-size: 0.8em; +/* background: rgba(90%, 90%, 90%, 0.15);*/ + padding-left: 2px; + padding-right: 2px; + color: rgb(20%, 20%, 20%); +} + +div.jqplot-bubble-label.jqplot-bubble-label-highlight { + background: rgba(90%, 90%, 90%, 0.7); +} + +div.jqplot-noData-container { + text-align: center; + background-color: rgba(96%, 96%, 96%, 0.3); +} diff --git a/phpMyAdmin/themes/pmahomme/css/navigation.css.php b/phpMyAdmin/themes/pmahomme/css/navigation.css.php new file mode 100755 index 0000000..e93c0a1 --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/navigation.css.php @@ -0,0 +1,429 @@ + + +/******************************************************************************/ +/* Navigation */ + +#pma_navigation { + width: px; + position: fixed; + top: 0; + : 0; + height: 100vh; + background: url(./themes/pmahomme/img/left_nav_bg.png) repeat-y right 0 ; + color: ; + z-index: 800; +} + +#pma_navigation_header { + overflow: hidden; +} + +#pma_navigation_content { + width: 100%; + height: 100%; + position: absolute; + top: 0; + : 0; + z-index: 0; +} + +#pma_navigation ul { + margin: 0; +} + +#pma_navigation form { + margin: 0; + padding: 0; + display: inline; +} + +#pma_navigation select#select_server, +#pma_navigation select#lightm_db { + width: 100%; +} + +/******************************************************************************/ +/* specific elements */ + +#pma_navigation div.pageselector { + text-align: center; + margin: 0; + margin-: 0.75em; + border-: 1px solid #666; +} + +#pma_navigation div#pmalogo { + +} + +#pma_navigation #pmalogo, +#pma_navigation #serverChoice, +#pma_navigation #navipanellinks, +#pma_navigation #recentTableList, +#pma_navigation #favoriteTableList, +#pma_navigation #databaseList, +#pma_navigation div.pageselector.dbselector { + text-align: center; + padding: 5px 10px 0; + border: 0; +} + +#pma_navigation #recentTable, +#pma_navigation #favoriteTable { + width: 200px; +} + +#pma_navigation #favoriteTableList select, +#pma_navigation #serverChoice select + { + width: 80%; +} + +#pma_navigation_content > img.throbber { + display: none; + margin: .3em auto 0; +} + +/* Navigation tree*/ +#pma_navigation_tree { + margin: 0; + margin-: 5px; + overflow: hidden; + color: #444; + height: 74%; + position: relative; +} +#pma_navigation_select_database { + text-align: left; + padding: 0 0 0; + border: 0; + margin: 0; +} + +#pma_navigation_db_select { + margin-top: 0.5em; + margin-: 0.75em; +} +#pma_navigation_db_select select { + background: url("./themes/pmahomme/img/select_bg.png") repeat scroll 0 0; + -webkit-border-radius: 2px; + border-radius: 2px; + border: 1px solid #bbb; + border-top: 1px solid #bbb; + color: #333; + padding: 4px 6px; + margin: 0 0 0; + width: 92%; + font-size: 1.11em; +} + +#pma_navigation_tree_content { + width: 100%; + overflow: hidden; + overflow-y: auto; + position: absolute; + height: 100%; +} +#pma_navigation_tree_content a.hover_show_full { + position: relative; + z-index: 100; + vertical-align: sub; +} +#pma_navigation_tree a { + color: ; +} +#pma_navigation_tree a:hover { + text-decoration: underline; +} +#pma_navigation_tree li.activePointer { + color: ; + background-color: ; +} +#pma_navigation_tree li.selected { + color: ; + background-color: ; +} +#pma_navigation_tree li .dbItemControls { + padding-left: 4px; +} +#pma_navigation_tree li .navItemControls { + display: none; + padding-left: 4px; +} +#pma_navigation_tree li.activePointer .navItemControls { + display: inline; + opacity: 0.5; +} +#pma_navigation_tree li.activePointer .navItemControls:hover { + display: inline; + opacity: 1.0; +} +#pma_navigation_tree ul { + clear: both; + padding: 0; + list-style-type: none; + margin: 0; +} +#pma_navigation_tree ul ul { + position: relative; +} +#pma_navigation_tree li, +#pma_navigation_tree li.fast_filter { + white-space: nowrap; + clear: both; + min-height: 16px; +} +#pma_navigation_tree img { + margin: 0; +} +#pma_navigation_tree i { + display: block; +} +#pma_navigation_tree div.block { + position: relative; + width: 1.5em; + height: 1.5em; + min-width: 16px; + min-height: 16px; + float: ; +} +#pma_navigation_tree div.block.double { + width: 2.5em; +} +#pma_navigation_tree div.block i, +#pma_navigation_tree div.block b { + width: 1.5em; + height: 1.7em; + min-width: 16px; + min-height: 8px; + position: absolute; + bottom: 0.7em; + : 0.75em; + z-index: 0; +} +#pma_navigation_tree div.block i { /* Top and right segments for the tree element connections */ + display: block; + border-: 1px solid #666; + border-bottom: 1px solid #666; + position: relative; + z-index: 0; +} +#pma_navigation_tree div.block i.first { /* Removes top segment */ + border-: 0; +} +#pma_navigation_tree div.block b { /* Bottom segment for the tree element connections */ + display: block; + height: 0.75em; + bottom: 0; + : 0.75em; + border-: 1px solid #666; +} +#pma_navigation_tree div.block a, +#pma_navigation_tree div.block u { + position: absolute; + : 50%; + top: 50%; + z-index: 10; +} +#pma_navigation_tree div.block a + a { + : 100%; +} +#pma_navigation_tree div.block.double a, +#pma_navigation_tree div.block.double u { + : 33%; +} +#pma_navigation_tree div.block.double a + a { + : 85%; +} +#pma_navigation_tree div.block img { + position: relative; + top: -0.6em; + : 0; + margin-: -7px; +} +#pma_navigation_tree div.throbber img { + top: 2px; + : 2px; +} +#pma_navigation_tree li.last > ul { + background: none; +} +#pma_navigation_tree li > a, #pma_navigation_tree li > i { + line-height: 1.5em; + height: 1.5em; + padding-: 0.3em; +} +#pma_navigation_tree .list_container { + border-: 1px solid #666; + margin-: 0.75em; + padding-: 0.75em; +} +#pma_navigation_tree .last > .list_container { + border-: 0 solid #666; +} + +/* Fast filter */ +li.fast_filter { + padding-: 0.75em; + margin-: 0.75em; + padding-: 35px; + border-: 1px solid #666; + list-style: none; +} +li.fast_filter input { + margin: 3px 0 0 0; + font-size: 0.7em; + padding-top: 2px; + padding-bottom: 2px; + padding-: 4px; + padding-: 1.7em; + width: 100%; +} +li.fast_filter span { + position: relative; + : 1.5em; + padding: 0.2em; + cursor: pointer; + font-weight: bold; + color: #800; + font-size: 0.7em; +} +/* IE10+ has its own reset X */ +html.ie li.fast_filter span { + display: none; +} +html.ie.ie9 li.fast_filter span, +html.ie.ie8 li.fast_filter span { + display: auto; +} +html.ie li.fast_filter input { + padding-: .2em; +} +html.ie.ie9 li.fast_filter input, +html.ie.ie8 li.fast_filter input { + padding-: 1.7em; +} +li.fast_filter.db_fast_filter { + border: 0; + margin-left: 0; + margin-right: 10px; +} + +#navigation_controls_outer { + min-height: 21px !important; +} + +#navigation_controls_outer.activePointer { + background-color: transparent !important; +} + +#navigation_controls { + float: right; + padding-right: 23px; +} + +/* Resize handler */ +#pma_navigation_resizer { + width: 3px; + height: 100%; + background-color: #aaa; + cursor: col-resize; + position: fixed; + top: 0; + : 240px; + z-index: 801; +} +#pma_navigation_collapser { + width: 20px; + height: 22px; + line-height: 22px; + background: #eee; + color: #555; + font-weight: bold; + position: fixed; + top: 0; + : px; + text-align: center; + cursor: pointer; + z-index: 800; + text-shadow: 0 1px 0 #fff; + filter: dropshadow(color=#fff, offx=0, offy=1); + border: 1px solid #888; +} + +/* Quick warp links */ +.pma_quick_warp { + margin-top: 5px; + margin-: 2px; + position: relative; +} +.pma_quick_warp .drop_list { + float: ; + margin-: 3px; + padding: 2px 0; +} +.pma_quick_warp .drop_button { + padding: 0 .3em; + border: 1px solid #ddd; + border-radius: .3em; + background: #f2f2f2; + cursor: pointer; +} +.pma_quick_warp .drop_list:hover .drop_button { + background: #fff; +} +.pma_quick_warp .drop_list ul { + position: absolute; + margin: 0; + padding: 0; + overflow: hidden; + overflow-y: auto; + list-style: none; + background: #fff; + border: 1px solid #ddd; + border-radius: .3em; + border-top--radius: 0; + border-bottom--radius: 0; + box-shadow: 0 0 5px #ccc; + top: 100%; + : 3px; + : 0; + display: none; + z-index: 802; +} +.pma_quick_warp .drop_list:hover ul { + display: block; +} +.pma_quick_warp .drop_list li { + white-space: nowrap; + padding: 0; + border-radius: 0; +} +.pma_quick_warp .drop_list li img { + vertical-align: sub; +} +.pma_quick_warp .drop_list li:hover { + background: #f2f2f2; +} +.pma_quick_warp .drop_list a { + display: block; + padding: .2em .3em; +} +.pma_quick_warp .drop_list a.favorite_table_anchor { + clear: left; + float: left; + padding: .1em .3em 0; +} diff --git a/phpMyAdmin/themes/pmahomme/css/printview.css b/phpMyAdmin/themes/pmahomme/css/printview.css new file mode 100755 index 0000000..809cbdd --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/printview.css @@ -0,0 +1,169 @@ +@media print { + #back_button_print_view, #print_button_print_view { + display: none; + } +} + +/* For removing element from Print View */ +.print_ignore { + display: none; +} + +.nowrap { + white-space: nowrap; +} + +.hide { + display: none; +} + +/* Standard CSS */ +body, table, th, td { + color: #000; + background-color: #fff; + font-size: 12px; +} + +/* To remove link text decoration */ +a:link { + color:#000; + text-decoration:none +} + +/* To remove any image borders */ +img { + border: 0; +} + +/* Table specific */ +table, th, td { + border: .1em solid #000; + background-color: #fff; +} + +table { + border-collapse: collapse; + border-spacing: 0.2em; +} + +thead { + border-collapse: collapse; + border-spacing: 0.2em; + border: .1em solid #000; + font-weight: 900; +} + +th, td { + padding: 0.2em; +} + +thead th { + font-weight: bold; + background-color: #e5e5e5; + border: .1em solid #000; +} + +th.vtop, td.vtop { + vertical-align: top; +} + +th.vbottom, td.vbottom { + vertical-align: bottom; +} + +/* Common Elements not to be included */ +/* Hide Navigation and Top Menu bar */ +#pma_navigation, #floating_menubar { + display: none; +} +/* Hide console */ +#pma_console_container { + display: none; +} + +/* Hide Navigation items (like Goto Top) */ +#page_nav_icons { + display: none; +} + +/* Hide the Create Table form */ +#create_table_form_minimal { + display: none; +} + +/* Hide the Page Settings Modal box */ +#page_settings_modal { + display: none; +} + +/* Hide footer, Demo notice, errors div */ +#pma_footer, #pma_demo, #pma_errors { + display: none; +} + +/* Hide the #selflink div */ +#selflink { + display: none; +} + +/* Position the main content */ +#page_content { + position: absolute; + left: 0; + top: 0; + width: 95%; + float: none; +} + +/* Specific Class for overriding while Print */ +.print { + background-color: #000; +} + +/* For the Success message div */ +div.success { + background-color: #fff; +} + +.sqlOuter { + color: black; + background-color: #000; +} + +/* For hiding 'Open a New phpMyAdmin Window' button */ +.ic_window-new, .ic_s_cog { + display: none; +} + +.sticky_columns tr { + display: none; +} + +#structure-action-links, #addColumns { + display: none; +} + +/* Hide extra menu on tbl_structure.php */ +#topmenu2 { + display: none; +} + +.cDrop, .cEdit, .cList, .cCpy, .cPointer { + display: none; +} + +/* odd items 1,3,5,7,... */ +table tbody:first-of-type tr:nth-child(odd), +table tbody:first-of-type tr:nth-child(odd) th { + background: #fff; +} + +/* even items 2,4,6,8,... */ +table tbody:first-of-type tr:nth-child(even), +table tbody:first-of-type tr:nth-child(even) th { + background: #DFDFDF; +} + +.column_attribute { + font-size: 100%; +} diff --git a/phpMyAdmin/themes/pmahomme/css/resizable-menu.css.php b/phpMyAdmin/themes/pmahomme/css/resizable-menu.css.php new file mode 100755 index 0000000..6cebc89 --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/resizable-menu.css.php @@ -0,0 +1,57 @@ + +ul.resizable-menu a, +ul.resizable-menu span { + display: block; + margin: 0; + padding: 0; + white-space: nowrap; +} + +ul.resizable-menu .submenu { + display: none; + position: relative; +} + +ul.resizable-menu .shown { + display: inline-block; +} + +ul.resizable-menu ul { + margin: 0; + padding: 0; + position: absolute; + list-style-type: none; + display: none; + border: 1px #ddd solid; + z-index: 2; + : 0; +} + +ul.resizable-menu li:hover { + getCssGradient('ffffff', 'e5e5e5'); ?> +} + +ul.resizable-menu li:hover ul, +ul.resizable-menu .submenuhover ul { + display: block; + background: #fff; +} + +ul.resizable-menu ul li { + width: 100%; +} diff --git a/phpMyAdmin/themes/pmahomme/css/rte.css.php b/phpMyAdmin/themes/pmahomme/css/rte.css.php new file mode 100755 index 0000000..f70ffe2 --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/css/rte.css.php @@ -0,0 +1,50 @@ + + +.rte_table { + table-layout: fixed; +} + +.rte_table td { + vertical-align: middle; + padding: 0.2em; +} + +.rte_table tr td:nth-child(1) { + font-weight: bold; +} + +.rte_table input, +.rte_table select, +.rte_table textarea { + width: 100%; + margin: 0; + box-sizing: border-box; + -ms-box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; +} + +.rte_table input[type=button], +.rte_table input[type=checkbox], +.rte_table input[type=radio] { + width: auto; + margin-right: 6px; +} + +.rte_table .routine_params_table { + width: 100%; +} diff --git a/phpMyAdmin/themes/pmahomme/img/ajax_clock_small.gif b/phpMyAdmin/themes/pmahomme/img/ajax_clock_small.gif new file mode 100755 index 0000000..bde4932 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/ajax_clock_small.gif differ diff --git a/phpMyAdmin/themes/pmahomme/img/arrow_ltr.png b/phpMyAdmin/themes/pmahomme/img/arrow_ltr.png new file mode 100755 index 0000000..cd79ab4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/arrow_ltr.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/arrow_rtl.png b/phpMyAdmin/themes/pmahomme/img/arrow_rtl.png new file mode 100755 index 0000000..d035b9d Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/arrow_rtl.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/asc_order.png b/phpMyAdmin/themes/pmahomme/img/asc_order.png new file mode 100755 index 0000000..51ce21b Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/asc_order.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_bookmark.png b/phpMyAdmin/themes/pmahomme/img/b_bookmark.png new file mode 100755 index 0000000..275cfa6 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_bookmark.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_browse.png b/phpMyAdmin/themes/pmahomme/img/b_browse.png new file mode 100755 index 0000000..8fd62b4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_browse.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_calendar.png b/phpMyAdmin/themes/pmahomme/img/b_calendar.png new file mode 100755 index 0000000..0eed98c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_calendar.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_chart.png b/phpMyAdmin/themes/pmahomme/img/b_chart.png new file mode 100755 index 0000000..c97c278 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_chart.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_close.png b/phpMyAdmin/themes/pmahomme/img/b_close.png new file mode 100755 index 0000000..8d8e98e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_close.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_column_add.png b/phpMyAdmin/themes/pmahomme/img/b_column_add.png new file mode 100755 index 0000000..70fa63e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_column_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_comment.png b/phpMyAdmin/themes/pmahomme/img/b_comment.png new file mode 100755 index 0000000..e95e887 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_comment.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_dbstatistics.png b/phpMyAdmin/themes/pmahomme/img/b_dbstatistics.png new file mode 100755 index 0000000..c97c278 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_dbstatistics.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_deltbl.png b/phpMyAdmin/themes/pmahomme/img/b_deltbl.png new file mode 100755 index 0000000..de93628 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_deltbl.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_docs.png b/phpMyAdmin/themes/pmahomme/img/b_docs.png new file mode 100755 index 0000000..54d1215 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_docs.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_docsql.png b/phpMyAdmin/themes/pmahomme/img/b_docsql.png new file mode 100755 index 0000000..2f6f056 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_docsql.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_drop.png b/phpMyAdmin/themes/pmahomme/img/b_drop.png new file mode 100755 index 0000000..672e358 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_drop.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_edit.png b/phpMyAdmin/themes/pmahomme/img/b_edit.png new file mode 100755 index 0000000..003b5d7 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_edit.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_empty.png b/phpMyAdmin/themes/pmahomme/img/b_empty.png new file mode 100755 index 0000000..91e2257 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_empty.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_engine.png b/phpMyAdmin/themes/pmahomme/img/b_engine.png new file mode 100755 index 0000000..3a92d77 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_engine.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_event_add.png b/phpMyAdmin/themes/pmahomme/img/b_event_add.png new file mode 100755 index 0000000..1f31c7c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_event_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_events.png b/phpMyAdmin/themes/pmahomme/img/b_events.png new file mode 100755 index 0000000..07c60ff Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_events.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_export.png b/phpMyAdmin/themes/pmahomme/img/b_export.png new file mode 100755 index 0000000..ba8ecf5 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_export.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_favorite.png b/phpMyAdmin/themes/pmahomme/img/b_favorite.png new file mode 100755 index 0000000..c4e1787 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_favorite.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_find_replace.png b/phpMyAdmin/themes/pmahomme/img/b_find_replace.png new file mode 100755 index 0000000..aff56f5 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_find_replace.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_firstpage.png b/phpMyAdmin/themes/pmahomme/img/b_firstpage.png new file mode 100755 index 0000000..8e768ef Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_firstpage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_ftext.png b/phpMyAdmin/themes/pmahomme/img/b_ftext.png new file mode 100755 index 0000000..0d2cde2 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_ftext.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_globe.gif b/phpMyAdmin/themes/pmahomme/img/b_globe.gif new file mode 100755 index 0000000..ef03dcf Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_globe.gif differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_group.png b/phpMyAdmin/themes/pmahomme/img/b_group.png new file mode 100755 index 0000000..4dd9d0b Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_group.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_help.png b/phpMyAdmin/themes/pmahomme/img/b_help.png new file mode 100755 index 0000000..54d1215 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_help.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_home.png b/phpMyAdmin/themes/pmahomme/img/b_home.png new file mode 100755 index 0000000..d9fc35e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_home.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_import.png b/phpMyAdmin/themes/pmahomme/img/b_import.png new file mode 100755 index 0000000..a3b80bd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_import.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_index.png b/phpMyAdmin/themes/pmahomme/img/b_index.png new file mode 100755 index 0000000..a7a11a1 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_index.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_index_add.png b/phpMyAdmin/themes/pmahomme/img/b_index_add.png new file mode 100755 index 0000000..2cef18a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_index_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_inline_edit.png b/phpMyAdmin/themes/pmahomme/img/b_inline_edit.png new file mode 100755 index 0000000..c8fd606 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_inline_edit.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_insrow.png b/phpMyAdmin/themes/pmahomme/img/b_insrow.png new file mode 100755 index 0000000..ce32a0a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_insrow.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_key.png b/phpMyAdmin/themes/pmahomme/img/b_key.png new file mode 100755 index 0000000..d1b15d9 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_key.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_lastpage.png b/phpMyAdmin/themes/pmahomme/img/b_lastpage.png new file mode 100755 index 0000000..1b4ac09 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_lastpage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_left.png b/phpMyAdmin/themes/pmahomme/img/b_left.png new file mode 100755 index 0000000..db427f9 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_left.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_minus.png b/phpMyAdmin/themes/pmahomme/img/b_minus.png new file mode 100755 index 0000000..19ad78b Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_minus.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_more.png b/phpMyAdmin/themes/pmahomme/img/b_more.png new file mode 100755 index 0000000..9d84943 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_more.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_move.png b/phpMyAdmin/themes/pmahomme/img/b_move.png new file mode 100755 index 0000000..aeb7a55 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_move.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_newdb.png b/phpMyAdmin/themes/pmahomme/img/b_newdb.png new file mode 100755 index 0000000..25312ed Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_newdb.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_newtbl.png b/phpMyAdmin/themes/pmahomme/img/b_newtbl.png new file mode 100755 index 0000000..f675656 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_newtbl.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_nextpage.png b/phpMyAdmin/themes/pmahomme/img/b_nextpage.png new file mode 100755 index 0000000..75a2c67 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_nextpage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_no_favorite.png b/phpMyAdmin/themes/pmahomme/img/b_no_favorite.png new file mode 100755 index 0000000..925a17f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_no_favorite.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_pdfdoc.png b/phpMyAdmin/themes/pmahomme/img/b_pdfdoc.png new file mode 100755 index 0000000..a8074cf Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_pdfdoc.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_plugin.png b/phpMyAdmin/themes/pmahomme/img/b_plugin.png new file mode 100755 index 0000000..205b9da Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_plugin.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_plus.png b/phpMyAdmin/themes/pmahomme/img/b_plus.png new file mode 100755 index 0000000..c26fb24 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_plus.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_prevpage.png b/phpMyAdmin/themes/pmahomme/img/b_prevpage.png new file mode 100755 index 0000000..752478a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_prevpage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_primary.png b/phpMyAdmin/themes/pmahomme/img/b_primary.png new file mode 100755 index 0000000..7333d89 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_primary.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_print.png b/phpMyAdmin/themes/pmahomme/img/b_print.png new file mode 100755 index 0000000..18a28a8 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_print.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_props.png b/phpMyAdmin/themes/pmahomme/img/b_props.png new file mode 100755 index 0000000..5890669 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_props.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_relations.png b/phpMyAdmin/themes/pmahomme/img/b_relations.png new file mode 100755 index 0000000..7c16044 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_relations.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_report.png b/phpMyAdmin/themes/pmahomme/img/b_report.png new file mode 100755 index 0000000..f5b57cd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_report.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_right.png b/phpMyAdmin/themes/pmahomme/img/b_right.png new file mode 100755 index 0000000..462d1fe Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_right.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_routine_add.png b/phpMyAdmin/themes/pmahomme/img/b_routine_add.png new file mode 100755 index 0000000..78517c1 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_routine_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_routines.png b/phpMyAdmin/themes/pmahomme/img/b_routines.png new file mode 100755 index 0000000..439899b Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_routines.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_save.png b/phpMyAdmin/themes/pmahomme/img/b_save.png new file mode 100755 index 0000000..e82bfed Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_save.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_saveimage.png b/phpMyAdmin/themes/pmahomme/img/b_saveimage.png new file mode 100755 index 0000000..0bc614a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_saveimage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_sbrowse.png b/phpMyAdmin/themes/pmahomme/img/b_sbrowse.png new file mode 100755 index 0000000..8fd62b4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_sbrowse.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_sdb.png b/phpMyAdmin/themes/pmahomme/img/b_sdb.png new file mode 100755 index 0000000..ceb7934 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_sdb.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_search.png b/phpMyAdmin/themes/pmahomme/img/b_search.png new file mode 100755 index 0000000..1527a0a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_search.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_select.png b/phpMyAdmin/themes/pmahomme/img/b_select.png new file mode 100755 index 0000000..821d30f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_select.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_snewtbl.png b/phpMyAdmin/themes/pmahomme/img/b_snewtbl.png new file mode 100755 index 0000000..b2863b4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_snewtbl.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_spatial.png b/phpMyAdmin/themes/pmahomme/img/b_spatial.png new file mode 100755 index 0000000..6498e45 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_spatial.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_sql.png b/phpMyAdmin/themes/pmahomme/img/b_sql.png new file mode 100755 index 0000000..e52ff7f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_sql.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_sqldoc.png b/phpMyAdmin/themes/pmahomme/img/b_sqldoc.png new file mode 100755 index 0000000..7762f49 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_sqldoc.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_sqlhelp.png b/phpMyAdmin/themes/pmahomme/img/b_sqlhelp.png new file mode 100755 index 0000000..dbeacb6 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_sqlhelp.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_table_add.png b/phpMyAdmin/themes/pmahomme/img/b_table_add.png new file mode 100755 index 0000000..06b6d57 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_table_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_tblanalyse.png b/phpMyAdmin/themes/pmahomme/img/b_tblanalyse.png new file mode 100755 index 0000000..6809a2d Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_tblanalyse.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_tblexport.png b/phpMyAdmin/themes/pmahomme/img/b_tblexport.png new file mode 100755 index 0000000..ba8ecf5 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_tblexport.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_tblimport.png b/phpMyAdmin/themes/pmahomme/img/b_tblimport.png new file mode 100755 index 0000000..a3b80bd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_tblimport.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_tblops.png b/phpMyAdmin/themes/pmahomme/img/b_tblops.png new file mode 100755 index 0000000..82b88dd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_tblops.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_tbloptimize.png b/phpMyAdmin/themes/pmahomme/img/b_tbloptimize.png new file mode 100755 index 0000000..0c8425c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_tbloptimize.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_tipp.png b/phpMyAdmin/themes/pmahomme/img/b_tipp.png new file mode 100755 index 0000000..0cead20 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_tipp.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_trigger_add.png b/phpMyAdmin/themes/pmahomme/img/b_trigger_add.png new file mode 100755 index 0000000..920a2a4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_trigger_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_triggers.png b/phpMyAdmin/themes/pmahomme/img/b_triggers.png new file mode 100755 index 0000000..2ee1dc6 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_triggers.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_undo.png b/phpMyAdmin/themes/pmahomme/img/b_undo.png new file mode 100755 index 0000000..fef0fa4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_undo.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_unique.png b/phpMyAdmin/themes/pmahomme/img/b_unique.png new file mode 100755 index 0000000..94a520f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_unique.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_usradd.png b/phpMyAdmin/themes/pmahomme/img/b_usradd.png new file mode 100755 index 0000000..eb96e6c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_usradd.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_usrcheck.png b/phpMyAdmin/themes/pmahomme/img/b_usrcheck.png new file mode 100755 index 0000000..7fabcb2 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_usrcheck.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_usrdrop.png b/phpMyAdmin/themes/pmahomme/img/b_usrdrop.png new file mode 100755 index 0000000..2e0e7d6 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_usrdrop.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_usredit.png b/phpMyAdmin/themes/pmahomme/img/b_usredit.png new file mode 100755 index 0000000..143a397 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_usredit.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_usrlist.png b/phpMyAdmin/themes/pmahomme/img/b_usrlist.png new file mode 100755 index 0000000..07a620e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_usrlist.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_versions.png b/phpMyAdmin/themes/pmahomme/img/b_versions.png new file mode 100755 index 0000000..c253dc0 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_versions.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_view.png b/phpMyAdmin/themes/pmahomme/img/b_view.png new file mode 100755 index 0000000..204b10d Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_view.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_view_add.png b/phpMyAdmin/themes/pmahomme/img/b_view_add.png new file mode 100755 index 0000000..ebded82 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_view_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/b_views.png b/phpMyAdmin/themes/pmahomme/img/b_views.png new file mode 100755 index 0000000..65f64d7 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/b_views.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_browse.png b/phpMyAdmin/themes/pmahomme/img/bd_browse.png new file mode 100755 index 0000000..5a28d46 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_browse.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_deltbl.png b/phpMyAdmin/themes/pmahomme/img/bd_deltbl.png new file mode 100755 index 0000000..fb518fc Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_deltbl.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_drop.png b/phpMyAdmin/themes/pmahomme/img/bd_drop.png new file mode 100755 index 0000000..19ccf88 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_drop.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_edit.png b/phpMyAdmin/themes/pmahomme/img/bd_edit.png new file mode 100755 index 0000000..b884489 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_edit.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_empty.png b/phpMyAdmin/themes/pmahomme/img/bd_empty.png new file mode 100755 index 0000000..e6a855a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_empty.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_export.png b/phpMyAdmin/themes/pmahomme/img/bd_export.png new file mode 100755 index 0000000..1fbb604 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_export.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_firstpage.png b/phpMyAdmin/themes/pmahomme/img/bd_firstpage.png new file mode 100755 index 0000000..9abaad5 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_firstpage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_ftext.png b/phpMyAdmin/themes/pmahomme/img/bd_ftext.png new file mode 100755 index 0000000..818fcd4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_ftext.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_index.png b/phpMyAdmin/themes/pmahomme/img/bd_index.png new file mode 100755 index 0000000..fbade94 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_index.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_insrow.png b/phpMyAdmin/themes/pmahomme/img/bd_insrow.png new file mode 100755 index 0000000..b325ffa Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_insrow.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_lastpage.png b/phpMyAdmin/themes/pmahomme/img/bd_lastpage.png new file mode 100755 index 0000000..4898517 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_lastpage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_nextpage.png b/phpMyAdmin/themes/pmahomme/img/bd_nextpage.png new file mode 100755 index 0000000..5373f9a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_nextpage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_prevpage.png b/phpMyAdmin/themes/pmahomme/img/bd_prevpage.png new file mode 100755 index 0000000..f1e9832 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_prevpage.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_primary.png b/phpMyAdmin/themes/pmahomme/img/bd_primary.png new file mode 100755 index 0000000..d1b15d9 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_primary.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_routine_add.png b/phpMyAdmin/themes/pmahomme/img/bd_routine_add.png new file mode 100755 index 0000000..6f45cbd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_routine_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_sbrowse.png b/phpMyAdmin/themes/pmahomme/img/bd_sbrowse.png new file mode 100755 index 0000000..5a28d46 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_sbrowse.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_select.png b/phpMyAdmin/themes/pmahomme/img/bd_select.png new file mode 100755 index 0000000..f9a23ef Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_select.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_spatial.png b/phpMyAdmin/themes/pmahomme/img/bd_spatial.png new file mode 100755 index 0000000..ea16fed Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_spatial.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/bd_unique.png b/phpMyAdmin/themes/pmahomme/img/bd_unique.png new file mode 100755 index 0000000..ebacdf4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/bd_unique.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/centralColumns.png b/phpMyAdmin/themes/pmahomme/img/centralColumns.png new file mode 100755 index 0000000..4b94c9f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/centralColumns.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/centralColumns_add.png b/phpMyAdmin/themes/pmahomme/img/centralColumns_add.png new file mode 100755 index 0000000..7282564 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/centralColumns_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/centralColumns_delete.png b/phpMyAdmin/themes/pmahomme/img/centralColumns_delete.png new file mode 100755 index 0000000..98d6b05 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/centralColumns_delete.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/col_drop.png b/phpMyAdmin/themes/pmahomme/img/col_drop.png new file mode 100755 index 0000000..9d84943 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/col_drop.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/col_pointer.png b/phpMyAdmin/themes/pmahomme/img/col_pointer.png new file mode 100755 index 0000000..00d78c7 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/col_pointer.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/col_pointer_ver.png b/phpMyAdmin/themes/pmahomme/img/col_pointer_ver.png new file mode 100755 index 0000000..0b73552 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/col_pointer_ver.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/console.png b/phpMyAdmin/themes/pmahomme/img/console.png new file mode 100755 index 0000000..f84ce2c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/console.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/database.png b/phpMyAdmin/themes/pmahomme/img/database.png new file mode 100755 index 0000000..0d0e388 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/database.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/1.png b/phpMyAdmin/themes/pmahomme/img/designer/1.png new file mode 100755 index 0000000..a9da1dc Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/1.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/2.png b/phpMyAdmin/themes/pmahomme/img/designer/2.png new file mode 100755 index 0000000..c153fd1 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/2.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/2leftarrow.png b/phpMyAdmin/themes/pmahomme/img/designer/2leftarrow.png new file mode 100755 index 0000000..77d5edd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/2leftarrow.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/2leftarrow_m.png b/phpMyAdmin/themes/pmahomme/img/designer/2leftarrow_m.png new file mode 100755 index 0000000..9ab1807 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/2leftarrow_m.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/2rightarrow.png b/phpMyAdmin/themes/pmahomme/img/designer/2rightarrow.png new file mode 100755 index 0000000..f59f2f3 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/2rightarrow.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/2rightarrow_m.png b/phpMyAdmin/themes/pmahomme/img/designer/2rightarrow_m.png new file mode 100755 index 0000000..61af4d3 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/2rightarrow_m.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/3.png b/phpMyAdmin/themes/pmahomme/img/designer/3.png new file mode 100755 index 0000000..cf1d45e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/3.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/4.png b/phpMyAdmin/themes/pmahomme/img/designer/4.png new file mode 100755 index 0000000..bdb1ad0 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/4.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/5.png b/phpMyAdmin/themes/pmahomme/img/designer/5.png new file mode 100755 index 0000000..1e35a89 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/5.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/6.png b/phpMyAdmin/themes/pmahomme/img/designer/6.png new file mode 100755 index 0000000..c5da1cf Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/6.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/7.png b/phpMyAdmin/themes/pmahomme/img/designer/7.png new file mode 100755 index 0000000..2b4f80b Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/7.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/8.png b/phpMyAdmin/themes/pmahomme/img/designer/8.png new file mode 100755 index 0000000..292fdd0 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/8.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/FieldKey_small.png b/phpMyAdmin/themes/pmahomme/img/designer/FieldKey_small.png new file mode 100755 index 0000000..0b58894 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/FieldKey_small.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/Field_small.png b/phpMyAdmin/themes/pmahomme/img/designer/Field_small.png new file mode 100755 index 0000000..c396eb3 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/Field_small.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/Field_small_char.png b/phpMyAdmin/themes/pmahomme/img/designer/Field_small_char.png new file mode 100755 index 0000000..e35c2a3 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/Field_small_char.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/Field_small_date.png b/phpMyAdmin/themes/pmahomme/img/designer/Field_small_date.png new file mode 100755 index 0000000..21df4e2 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/Field_small_date.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/Field_small_int.png b/phpMyAdmin/themes/pmahomme/img/designer/Field_small_int.png new file mode 100755 index 0000000..6d6fe88 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/Field_small_int.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/Header.png b/phpMyAdmin/themes/pmahomme/img/designer/Header.png new file mode 100755 index 0000000..2d2090e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/Header.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/Header_Linked.png b/phpMyAdmin/themes/pmahomme/img/designer/Header_Linked.png new file mode 100755 index 0000000..afd3f04 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/Header_Linked.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/anchor.png b/phpMyAdmin/themes/pmahomme/img/designer/anchor.png new file mode 100755 index 0000000..576d435 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/anchor.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/and_icon.png b/phpMyAdmin/themes/pmahomme/img/designer/and_icon.png new file mode 100755 index 0000000..2ecce01 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/and_icon.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/ang_direct.png b/phpMyAdmin/themes/pmahomme/img/designer/ang_direct.png new file mode 100755 index 0000000..3ce29a6 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/ang_direct.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/bord.png b/phpMyAdmin/themes/pmahomme/img/designer/bord.png new file mode 100755 index 0000000..0b3191d Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/bord.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/bottom.png b/phpMyAdmin/themes/pmahomme/img/designer/bottom.png new file mode 100755 index 0000000..19cbbcd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/bottom.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/def.png b/phpMyAdmin/themes/pmahomme/img/designer/def.png new file mode 100755 index 0000000..ea02685 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/def.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/display_field.png b/phpMyAdmin/themes/pmahomme/img/designer/display_field.png new file mode 100755 index 0000000..9e5e2df Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/display_field.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/downarrow1.png b/phpMyAdmin/themes/pmahomme/img/designer/downarrow1.png new file mode 100755 index 0000000..a2d0954 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/downarrow1.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/downarrow2.png b/phpMyAdmin/themes/pmahomme/img/designer/downarrow2.png new file mode 100755 index 0000000..60827b3 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/downarrow2.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/downarrow2_m.png b/phpMyAdmin/themes/pmahomme/img/designer/downarrow2_m.png new file mode 100755 index 0000000..70f7f92 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/downarrow2_m.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/exec.png b/phpMyAdmin/themes/pmahomme/img/designer/exec.png new file mode 100755 index 0000000..06ce466 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/exec.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/exec_small.png b/phpMyAdmin/themes/pmahomme/img/designer/exec_small.png new file mode 100755 index 0000000..357166f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/exec_small.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/exitFullscreen.png b/phpMyAdmin/themes/pmahomme/img/designer/exitFullscreen.png new file mode 100755 index 0000000..4397aed Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/exitFullscreen.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/export.png b/phpMyAdmin/themes/pmahomme/img/designer/export.png new file mode 100755 index 0000000..64b58e3 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/export.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/favicon.ico b/phpMyAdmin/themes/pmahomme/img/designer/favicon.ico new file mode 100755 index 0000000..29c2595 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/favicon.ico differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/grid.png b/phpMyAdmin/themes/pmahomme/img/designer/grid.png new file mode 100755 index 0000000..f581a68 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/grid.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/help.png b/phpMyAdmin/themes/pmahomme/img/designer/help.png new file mode 100755 index 0000000..facf1a1 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/help.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/help_relation.png b/phpMyAdmin/themes/pmahomme/img/designer/help_relation.png new file mode 100755 index 0000000..321f074 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/help_relation.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/left_panel_butt.png b/phpMyAdmin/themes/pmahomme/img/designer/left_panel_butt.png new file mode 100755 index 0000000..0331730 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/left_panel_butt.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/left_panel_tab.png b/phpMyAdmin/themes/pmahomme/img/designer/left_panel_tab.png new file mode 100755 index 0000000..c596f92 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/left_panel_tab.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/minus.png b/phpMyAdmin/themes/pmahomme/img/designer/minus.png new file mode 100755 index 0000000..2feb935 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/minus.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/or_icon.png b/phpMyAdmin/themes/pmahomme/img/designer/or_icon.png new file mode 100755 index 0000000..75be472 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/or_icon.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/other_table.png b/phpMyAdmin/themes/pmahomme/img/designer/other_table.png new file mode 100755 index 0000000..9645396 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/other_table.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/page_add.png b/phpMyAdmin/themes/pmahomme/img/designer/page_add.png new file mode 100755 index 0000000..5d8a1d1 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/page_add.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/page_delete.png b/phpMyAdmin/themes/pmahomme/img/designer/page_delete.png new file mode 100755 index 0000000..a512c62 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/page_delete.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/page_edit.png b/phpMyAdmin/themes/pmahomme/img/designer/page_edit.png new file mode 100755 index 0000000..4f0ce4a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/page_edit.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/pdf.png b/phpMyAdmin/themes/pmahomme/img/designer/pdf.png new file mode 100755 index 0000000..616060a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/pdf.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/plus.png b/phpMyAdmin/themes/pmahomme/img/designer/plus.png new file mode 100755 index 0000000..ac3e602 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/plus.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/query_builder.png b/phpMyAdmin/themes/pmahomme/img/designer/query_builder.png new file mode 100755 index 0000000..6e54e8e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/query_builder.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/relation.png b/phpMyAdmin/themes/pmahomme/img/designer/relation.png new file mode 100755 index 0000000..6c09c7f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/relation.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/reload.png b/phpMyAdmin/themes/pmahomme/img/designer/reload.png new file mode 100755 index 0000000..6b5cda5 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/reload.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/resize.png b/phpMyAdmin/themes/pmahomme/img/designer/resize.png new file mode 100755 index 0000000..b3f4732 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/resize.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/resizeright.png b/phpMyAdmin/themes/pmahomme/img/designer/resizeright.png new file mode 100755 index 0000000..e984170 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/resizeright.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/rightarrow1.png b/phpMyAdmin/themes/pmahomme/img/designer/rightarrow1.png new file mode 100755 index 0000000..d2641d7 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/rightarrow1.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/rightarrow2.png b/phpMyAdmin/themes/pmahomme/img/designer/rightarrow2.png new file mode 100755 index 0000000..76f2fe0 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/rightarrow2.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/save.png b/phpMyAdmin/themes/pmahomme/img/designer/save.png new file mode 100755 index 0000000..6d5c052 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/save.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/save_as.png b/phpMyAdmin/themes/pmahomme/img/designer/save_as.png new file mode 100755 index 0000000..8c4d151 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/save_as.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/small_tab.png b/phpMyAdmin/themes/pmahomme/img/designer/small_tab.png new file mode 100755 index 0000000..fb84f54 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/small_tab.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/table.png b/phpMyAdmin/themes/pmahomme/img/designer/table.png new file mode 100755 index 0000000..aa2b1c7 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/table.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/toggle_lines.png b/phpMyAdmin/themes/pmahomme/img/designer/toggle_lines.png new file mode 100755 index 0000000..46d28c0 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/toggle_lines.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/top_panel.png b/phpMyAdmin/themes/pmahomme/img/designer/top_panel.png new file mode 100755 index 0000000..8a5dab9 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/top_panel.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/uparrow2_m.png b/phpMyAdmin/themes/pmahomme/img/designer/uparrow2_m.png new file mode 100755 index 0000000..5d1342d Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/uparrow2_m.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/designer/viewInFullscreen.png b/phpMyAdmin/themes/pmahomme/img/designer/viewInFullscreen.png new file mode 100755 index 0000000..a6c7691 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/designer/viewInFullscreen.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/east-mini.png b/phpMyAdmin/themes/pmahomme/img/east-mini.png new file mode 100755 index 0000000..6685939 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/east-mini.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/error.ico b/phpMyAdmin/themes/pmahomme/img/error.ico new file mode 100755 index 0000000..8f4d509 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/error.ico differ diff --git a/phpMyAdmin/themes/pmahomme/img/eye.png b/phpMyAdmin/themes/pmahomme/img/eye.png new file mode 100755 index 0000000..6c9972e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/eye.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/eye_grey.png b/phpMyAdmin/themes/pmahomme/img/eye_grey.png new file mode 100755 index 0000000..0dc92a9 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/eye_grey.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/hide.png b/phpMyAdmin/themes/pmahomme/img/hide.png new file mode 100755 index 0000000..2c91443 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/hide.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/item.png b/phpMyAdmin/themes/pmahomme/img/item.png new file mode 100755 index 0000000..f2c3390 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/item.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/left_nav_bg.png b/phpMyAdmin/themes/pmahomme/img/left_nav_bg.png new file mode 100755 index 0000000..42b6f38 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/left_nav_bg.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/lightbulb.png b/phpMyAdmin/themes/pmahomme/img/lightbulb.png new file mode 100755 index 0000000..0cead20 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/lightbulb.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/lightbulb_off.png b/phpMyAdmin/themes/pmahomme/img/lightbulb_off.png new file mode 100755 index 0000000..dd3632d Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/lightbulb_off.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/logo_left.png b/phpMyAdmin/themes/pmahomme/img/logo_left.png new file mode 100755 index 0000000..004e705 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/logo_left.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/logo_right.png b/phpMyAdmin/themes/pmahomme/img/logo_right.png new file mode 100755 index 0000000..a490289 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/logo_right.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/more.png b/phpMyAdmin/themes/pmahomme/img/more.png new file mode 100755 index 0000000..ac803c4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/more.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/new_data.png b/phpMyAdmin/themes/pmahomme/img/new_data.png new file mode 100755 index 0000000..c173bc0 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/new_data.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/new_data_hovered.png b/phpMyAdmin/themes/pmahomme/img/new_data_hovered.png new file mode 100755 index 0000000..73b09a6 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/new_data_hovered.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/new_data_selected.png b/phpMyAdmin/themes/pmahomme/img/new_data_selected.png new file mode 100755 index 0000000..a75abe3 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/new_data_selected.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/new_data_selected_hovered.png b/phpMyAdmin/themes/pmahomme/img/new_data_selected_hovered.png new file mode 100755 index 0000000..7091ae3 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/new_data_selected_hovered.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/new_struct.png b/phpMyAdmin/themes/pmahomme/img/new_struct.png new file mode 100755 index 0000000..79fe646 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/new_struct.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/new_struct_hovered.png b/phpMyAdmin/themes/pmahomme/img/new_struct_hovered.png new file mode 100755 index 0000000..b29aaed Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/new_struct_hovered.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/new_struct_selected.png b/phpMyAdmin/themes/pmahomme/img/new_struct_selected.png new file mode 100755 index 0000000..bc61749 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/new_struct_selected.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/new_struct_selected_hovered.png b/phpMyAdmin/themes/pmahomme/img/new_struct_selected_hovered.png new file mode 100755 index 0000000..9a82bc4 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/new_struct_selected_hovered.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/normalize.png b/phpMyAdmin/themes/pmahomme/img/normalize.png new file mode 100755 index 0000000..5475f34 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/normalize.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/north-mini.png b/phpMyAdmin/themes/pmahomme/img/north-mini.png new file mode 100755 index 0000000..c3b6062 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/north-mini.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/pause.png b/phpMyAdmin/themes/pmahomme/img/pause.png new file mode 100755 index 0000000..0271217 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/pause.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/php_sym.png b/phpMyAdmin/themes/pmahomme/img/php_sym.png new file mode 100755 index 0000000..20b8350 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/php_sym.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/play.png b/phpMyAdmin/themes/pmahomme/img/play.png new file mode 100755 index 0000000..75a2c67 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/play.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/pma_logo2.png b/phpMyAdmin/themes/pmahomme/img/pma_logo2.png new file mode 100755 index 0000000..30f22de Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/pma_logo2.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_asc.png b/phpMyAdmin/themes/pmahomme/img/s_asc.png new file mode 100755 index 0000000..51cf60d Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_asc.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_asci.png b/phpMyAdmin/themes/pmahomme/img/s_asci.png new file mode 100755 index 0000000..6a56ea1 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_asci.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_attention.png b/phpMyAdmin/themes/pmahomme/img/s_attention.png new file mode 100755 index 0000000..5a536e8 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_attention.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_cancel.png b/phpMyAdmin/themes/pmahomme/img/s_cancel.png new file mode 100755 index 0000000..65a6346 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_cancel.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_cancel2.png b/phpMyAdmin/themes/pmahomme/img/s_cancel2.png new file mode 100755 index 0000000..dd5dccc Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_cancel2.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_cog.png b/phpMyAdmin/themes/pmahomme/img/s_cog.png new file mode 100755 index 0000000..a9cbc24 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_cog.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_collapseall.png b/phpMyAdmin/themes/pmahomme/img/s_collapseall.png new file mode 100755 index 0000000..3d56b7c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_collapseall.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_db.png b/phpMyAdmin/themes/pmahomme/img/s_db.png new file mode 100755 index 0000000..0d0e388 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_db.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_desc.png b/phpMyAdmin/themes/pmahomme/img/s_desc.png new file mode 100755 index 0000000..51ce21b Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_desc.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_error.png b/phpMyAdmin/themes/pmahomme/img/s_error.png new file mode 100755 index 0000000..71d13a1 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_error.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_fulltext.png b/phpMyAdmin/themes/pmahomme/img/s_fulltext.png new file mode 100755 index 0000000..b810b0c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_fulltext.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_host.png b/phpMyAdmin/themes/pmahomme/img/s_host.png new file mode 100755 index 0000000..20a9b45 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_host.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_info.png b/phpMyAdmin/themes/pmahomme/img/s_info.png new file mode 100755 index 0000000..f3d221f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_info.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_lang.png b/phpMyAdmin/themes/pmahomme/img/s_lang.png new file mode 100755 index 0000000..5a1d7ab Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_lang.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_link.png b/phpMyAdmin/themes/pmahomme/img/s_link.png new file mode 100755 index 0000000..609970a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_link.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_lock.png b/phpMyAdmin/themes/pmahomme/img/s_lock.png new file mode 100755 index 0000000..5525894 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_lock.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_loggoff.png b/phpMyAdmin/themes/pmahomme/img/s_loggoff.png new file mode 100755 index 0000000..f2581cb Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_loggoff.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_notice.png b/phpMyAdmin/themes/pmahomme/img/s_notice.png new file mode 100755 index 0000000..5a536e8 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_notice.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_okay.png b/phpMyAdmin/themes/pmahomme/img/s_okay.png new file mode 100755 index 0000000..9bf9235 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_okay.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_partialtext.png b/phpMyAdmin/themes/pmahomme/img/s_partialtext.png new file mode 100755 index 0000000..a8fbb34 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_partialtext.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_passwd.png b/phpMyAdmin/themes/pmahomme/img/s_passwd.png new file mode 100755 index 0000000..c705bd5 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_passwd.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_process.png b/phpMyAdmin/themes/pmahomme/img/s_process.png new file mode 100755 index 0000000..a9cbc24 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_process.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_really.png b/phpMyAdmin/themes/pmahomme/img/s_really.png new file mode 100755 index 0000000..e48c9cd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_really.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_reload.png b/phpMyAdmin/themes/pmahomme/img/s_reload.png new file mode 100755 index 0000000..656519c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_reload.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_replication.png b/phpMyAdmin/themes/pmahomme/img/s_replication.png new file mode 100755 index 0000000..c5c5a5c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_replication.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_rights.png b/phpMyAdmin/themes/pmahomme/img/s_rights.png new file mode 100755 index 0000000..407a62f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_rights.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_sortable.png b/phpMyAdmin/themes/pmahomme/img/s_sortable.png new file mode 100755 index 0000000..879c3b5 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_sortable.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_status.png b/phpMyAdmin/themes/pmahomme/img/s_status.png new file mode 100755 index 0000000..aee657c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_status.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_success.png b/phpMyAdmin/themes/pmahomme/img/s_success.png new file mode 100755 index 0000000..4c79cd9 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_success.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_sync.png b/phpMyAdmin/themes/pmahomme/img/s_sync.png new file mode 100755 index 0000000..5ced64c Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_sync.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_tbl.png b/phpMyAdmin/themes/pmahomme/img/s_tbl.png new file mode 100755 index 0000000..6632aa2 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_tbl.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_theme.png b/phpMyAdmin/themes/pmahomme/img/s_theme.png new file mode 100755 index 0000000..a18b103 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_theme.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_top.png b/phpMyAdmin/themes/pmahomme/img/s_top.png new file mode 100755 index 0000000..dd57623 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_top.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_unlink.png b/phpMyAdmin/themes/pmahomme/img/s_unlink.png new file mode 100755 index 0000000..551679e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_unlink.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_vars.png b/phpMyAdmin/themes/pmahomme/img/s_vars.png new file mode 100755 index 0000000..b62dcd2 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_vars.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/s_views.png b/phpMyAdmin/themes/pmahomme/img/s_views.png new file mode 100755 index 0000000..65f64d7 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/s_views.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/select_bg.png b/phpMyAdmin/themes/pmahomme/img/select_bg.png new file mode 100755 index 0000000..22c3ea6 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/select_bg.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/show.png b/phpMyAdmin/themes/pmahomme/img/show.png new file mode 100755 index 0000000..666653f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/show.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/south-mini.png b/phpMyAdmin/themes/pmahomme/img/south-mini.png new file mode 100755 index 0000000..654673b Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/south-mini.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/spacer.png b/phpMyAdmin/themes/pmahomme/img/spacer.png new file mode 100755 index 0000000..240ca4f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/spacer.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/toggle-ltr.png b/phpMyAdmin/themes/pmahomme/img/toggle-ltr.png new file mode 100755 index 0000000..2dd681f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/toggle-ltr.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/toggle-rtl.png b/phpMyAdmin/themes/pmahomme/img/toggle-rtl.png new file mode 100755 index 0000000..a50f5bb Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/toggle-rtl.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/vertical_line.png b/phpMyAdmin/themes/pmahomme/img/vertical_line.png new file mode 100755 index 0000000..a88a7c7 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/vertical_line.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/west-mini.png b/phpMyAdmin/themes/pmahomme/img/west-mini.png new file mode 100755 index 0000000..61ad92e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/west-mini.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/window-new.png b/phpMyAdmin/themes/pmahomme/img/window-new.png new file mode 100755 index 0000000..d18722f Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/window-new.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/zoom-minus-mini.png b/phpMyAdmin/themes/pmahomme/img/zoom-minus-mini.png new file mode 100755 index 0000000..1b8d84d Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/zoom-minus-mini.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/zoom-plus-mini.png b/phpMyAdmin/themes/pmahomme/img/zoom-plus-mini.png new file mode 100755 index 0000000..466cc7b Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/zoom-plus-mini.png differ diff --git a/phpMyAdmin/themes/pmahomme/img/zoom-world-mini.png b/phpMyAdmin/themes/pmahomme/img/zoom-world-mini.png new file mode 100755 index 0000000..dcc60f1 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/img/zoom-world-mini.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100755 index 0000000..534c590 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_65_ffffff_1x400.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100755 index 0000000..3e56dbd Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_75_dadada_1x400.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_75_dadada_1x400.png new file mode 100755 index 0000000..6b8b33a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100755 index 0000000..81e2065 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_95_fef1ec_1x400.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100755 index 0000000..7172755 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100755 index 0000000..ae3ccae Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_222222_256x240.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_222222_256x240.png new file mode 100755 index 0000000..3201d9a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_222222_256x240.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_2e83ff_256x240.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_2e83ff_256x240.png new file mode 100755 index 0000000..1d920d7 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_2e83ff_256x240.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_454545_256x240.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_454545_256x240.png new file mode 100755 index 0000000..47da8e5 Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_454545_256x240.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_888888_256x240.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_888888_256x240.png new file mode 100755 index 0000000..95e0c3e Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_888888_256x240.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_cd0a0a_256x240.png b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_cd0a0a_256x240.png new file mode 100755 index 0000000..0ea8a5a Binary files /dev/null and b/phpMyAdmin/themes/pmahomme/jquery/images/ui-icons_cd0a0a_256x240.png differ diff --git a/phpMyAdmin/themes/pmahomme/jquery/jquery-ui.css b/phpMyAdmin/themes/pmahomme/jquery/jquery-ui.css new file mode 100755 index 0000000..1ebcbc9 --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/jquery/jquery-ui.css @@ -0,0 +1,1312 @@ +/*! jQuery UI - v1.12.1 - 2016-12-21 +* http://jqueryui.com +* Includes: draggable.css, core.css, resizable.css, selectable.css, sortable.css, accordion.css, autocomplete.css, menu.css, button.css, controlgroup.css, checkboxradio.css, datepicker.css, dialog.css, progressbar.css, selectmenu.css, slider.css, spinner.css, tabs.css, tooltip.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=smoothness&cornerRadiusShadow=8px&offsetLeftShadow=-8px&offsetTopShadow=-8px&thicknessShadow=8px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=aaaaaa&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=aaaaaa&iconColorError=cd0a0a&fcError=cd0a0a&borderColorError=cd0a0a&bgImgOpacityError=95&bgTextureError=glass&bgColorError=fef1ec&iconColorHighlight=2e83ff&fcHighlight=363636&borderColorHighlight=fcefa1&bgImgOpacityHighlight=55&bgTextureHighlight=glass&bgColorHighlight=fbf9ee&iconColorActive=454545&fcActive=212121&borderColorActive=aaaaaa&bgImgOpacityActive=65&bgTextureActive=glass&bgColorActive=ffffff&iconColorHover=454545&fcHover=212121&borderColorHover=999999&bgImgOpacityHover=75&bgTextureHover=glass&bgColorHover=dadada&iconColorDefault=888888&fcDefault=555555&borderColorDefault=d3d3d3&bgImgOpacityDefault=75&bgTextureDefault=glass&bgColorDefault=e6e6e6&iconColorContent=222222&fcContent=222222&borderColorContent=aaaaaa&bgImgOpacityContent=75&bgTextureContent=flat&bgColorContent=ffffff&iconColorHeader=222222&fcHeader=222222&borderColorHeader=aaaaaa&bgImgOpacityHeader=75&bgTextureHeader=highlight_soft&bgColorHeader=cccccc&cornerRadius=4px&fsDefault=1.1em&fwDefault=normal&ffDefault=Verdana%2CArial%2Csans-serif +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +.ui-draggable-handle { + -ms-touch-action: none; + touch-action: none; +} +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); /* support: IE8 */ +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; + pointer-events: none; +} + + +/* Icons +----------------------------------*/ +.ui-icon { + display: inline-block; + vertical-align: middle; + margin-top: -.25em; + position: relative; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + +.ui-widget-icon-block { + left: 50%; + margin-left: -8px; + display: block; +} + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; + -ms-touch-action: none; + touch-action: none; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable { + -ms-touch-action: none; + touch-action: none; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-sortable-handle { + -ms-touch-action: none; + touch-action: none; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin: 2px 0 0 0; + padding: .5em .5em .5em .7em; + font-size: 100%; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: 0; +} +.ui-menu .ui-menu { + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + cursor: pointer; + /* support: IE10, see #8844 */ + list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); +} +.ui-menu .ui-menu-item-wrapper { + position: relative; + padding: 3px 1em 3px .4em; +} +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: -1px; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item-wrapper { + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + left: auto; + right: 0; +} +.ui-button { + padding: .4em 1em; + display: inline-block; + position: relative; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + + /* Support: IE <= 11 */ + overflow: visible; +} + +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} + +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2em; + box-sizing: border-box; + text-indent: -9999px; + white-space: nowrap; +} + +/* no icon support for input elements */ +input.ui-button.ui-button-icon-only { + text-indent: 0; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon { + position: absolute; + top: 50%; + left: 50%; + margin-top: -8px; + margin-left: -8px; +} + +.ui-button.ui-icon-notext .ui-icon { + padding: 0; + width: 2.1em; + height: 2.1em; + text-indent: -9999px; + white-space: nowrap; + +} + +input.ui-button.ui-icon-notext .ui-icon { + width: auto; + height: auto; + text-indent: 0; + white-space: normal; + padding: .4em 1em; +} + +/* workarounds */ +/* Support: Firefox 5 - 40 */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-controlgroup { + vertical-align: middle; + display: inline-block; +} +.ui-controlgroup > .ui-controlgroup-item { + float: left; + margin-left: 0; + margin-right: 0; +} +.ui-controlgroup > .ui-controlgroup-item:focus, +.ui-controlgroup > .ui-controlgroup-item.ui-visual-focus { + z-index: 9999; +} +.ui-controlgroup-vertical > .ui-controlgroup-item { + display: block; + float: none; + width: 100%; + margin-top: 0; + margin-bottom: 0; + text-align: left; +} +.ui-controlgroup-vertical .ui-controlgroup-item { + box-sizing: border-box; +} +.ui-controlgroup .ui-controlgroup-label { + padding: .4em 1em; +} +.ui-controlgroup .ui-controlgroup-label span { + font-size: 80%; +} +.ui-controlgroup-horizontal .ui-controlgroup-label + .ui-controlgroup-item { + border-left: none; +} +.ui-controlgroup-vertical .ui-controlgroup-label + .ui-controlgroup-item { + border-top: none; +} +.ui-controlgroup-horizontal .ui-controlgroup-label.ui-widget-content { + border-right: none; +} +.ui-controlgroup-vertical .ui-controlgroup-label.ui-widget-content { + border-bottom: none; +} + +/* Spinner specific style fixes */ +.ui-controlgroup-vertical .ui-spinner-input { + + /* Support: IE8 only, Android < 4.4 only */ + width: 75%; + width: calc( 100% - 2.4em ); +} +.ui-controlgroup-vertical .ui-spinner .ui-spinner-up { + border-top-style: solid; +} + +.ui-checkboxradio-label .ui-icon-background { + box-shadow: inset 1px 1px 1px #ccc; + border-radius: .12em; + border: none; +} +.ui-checkboxradio-radio-label .ui-icon-background { + width: 16px; + height: 16px; + border-radius: 1em; + overflow: visible; + border: none; +} +.ui-checkboxradio-radio-label.ui-checkboxradio-checked .ui-icon, +.ui-checkboxradio-radio-label.ui-checkboxradio-checked:hover .ui-icon { + background-image: none; + width: 8px; + height: 8px; + border-width: 4px; + border-style: solid; +} +.ui-checkboxradio-disabled { + pointer-events: none; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 45%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} + +/* Icons */ +.ui-datepicker .ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; + left: .5em; + top: .3em; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 20px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-n { + height: 2px; + top: 0; +} +.ui-dialog .ui-resizable-e { + width: 2px; + right: 0; +} +.ui-dialog .ui-resizable-s { + height: 2px; + bottom: 0; +} +.ui-dialog .ui-resizable-w { + width: 2px; + left: 0; +} +.ui-dialog .ui-resizable-se, +.ui-dialog .ui-resizable-sw, +.ui-dialog .ui-resizable-ne, +.ui-dialog .ui-resizable-nw { + width: 7px; + height: 7px; +} +.ui-dialog .ui-resizable-se { + right: 0; + bottom: 0; +} +.ui-dialog .ui-resizable-sw { + left: 0; + bottom: 0; +} +.ui-dialog .ui-resizable-ne { + right: 0; + top: 0; +} +.ui-dialog .ui-resizable-nw { + left: 0; + top: 0; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("data:image/gif;base64,R0lGODlhKAAoAIABAAAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh+QQJAQABACwAAAAAKAAoAAACkYwNqXrdC52DS06a7MFZI+4FHBCKoDeWKXqymPqGqxvJrXZbMx7Ttc+w9XgU2FB3lOyQRWET2IFGiU9m1frDVpxZZc6bfHwv4c1YXP6k1Vdy292Fb6UkuvFtXpvWSzA+HycXJHUXiGYIiMg2R6W459gnWGfHNdjIqDWVqemH2ekpObkpOlppWUqZiqr6edqqWQAAIfkECQEAAQAsAAAAACgAKAAAApSMgZnGfaqcg1E2uuzDmmHUBR8Qil95hiPKqWn3aqtLsS18y7G1SzNeowWBENtQd+T1JktP05nzPTdJZlR6vUxNWWjV+vUWhWNkWFwxl9VpZRedYcflIOLafaa28XdsH/ynlcc1uPVDZxQIR0K25+cICCmoqCe5mGhZOfeYSUh5yJcJyrkZWWpaR8doJ2o4NYq62lAAACH5BAkBAAEALAAAAAAoACgAAAKVDI4Yy22ZnINRNqosw0Bv7i1gyHUkFj7oSaWlu3ovC8GxNso5fluz3qLVhBVeT/Lz7ZTHyxL5dDalQWPVOsQWtRnuwXaFTj9jVVh8pma9JjZ4zYSj5ZOyma7uuolffh+IR5aW97cHuBUXKGKXlKjn+DiHWMcYJah4N0lYCMlJOXipGRr5qdgoSTrqWSq6WFl2ypoaUAAAIfkECQEAAQAsAAAAACgAKAAAApaEb6HLgd/iO7FNWtcFWe+ufODGjRfoiJ2akShbueb0wtI50zm02pbvwfWEMWBQ1zKGlLIhskiEPm9R6vRXxV4ZzWT2yHOGpWMyorblKlNp8HmHEb/lCXjcW7bmtXP8Xt229OVWR1fod2eWqNfHuMjXCPkIGNileOiImVmCOEmoSfn3yXlJWmoHGhqp6ilYuWYpmTqKUgAAIfkECQEAAQAsAAAAACgAKAAAApiEH6kb58biQ3FNWtMFWW3eNVcojuFGfqnZqSebuS06w5V80/X02pKe8zFwP6EFWOT1lDFk8rGERh1TTNOocQ61Hm4Xm2VexUHpzjymViHrFbiELsefVrn6XKfnt2Q9G/+Xdie499XHd2g4h7ioOGhXGJboGAnXSBnoBwKYyfioubZJ2Hn0RuRZaflZOil56Zp6iioKSXpUAAAh+QQJAQABACwAAAAAKAAoAAACkoQRqRvnxuI7kU1a1UU5bd5tnSeOZXhmn5lWK3qNTWvRdQxP8qvaC+/yaYQzXO7BMvaUEmJRd3TsiMAgswmNYrSgZdYrTX6tSHGZO73ezuAw2uxuQ+BbeZfMxsexY35+/Qe4J1inV0g4x3WHuMhIl2jXOKT2Q+VU5fgoSUI52VfZyfkJGkha6jmY+aaYdirq+lQAACH5BAkBAAEALAAAAAAoACgAAAKWBIKpYe0L3YNKToqswUlvznigd4wiR4KhZrKt9Upqip61i9E3vMvxRdHlbEFiEXfk9YARYxOZZD6VQ2pUunBmtRXo1Lf8hMVVcNl8JafV38aM2/Fu5V16Bn63r6xt97j09+MXSFi4BniGFae3hzbH9+hYBzkpuUh5aZmHuanZOZgIuvbGiNeomCnaxxap2upaCZsq+1kAACH5BAkBAAEALAAAAAAoACgAAAKXjI8By5zf4kOxTVrXNVlv1X0d8IGZGKLnNpYtm8Lr9cqVeuOSvfOW79D9aDHizNhDJidFZhNydEahOaDH6nomtJjp1tutKoNWkvA6JqfRVLHU/QUfau9l2x7G54d1fl995xcIGAdXqMfBNadoYrhH+Mg2KBlpVpbluCiXmMnZ2Sh4GBqJ+ckIOqqJ6LmKSllZmsoq6wpQAAAh+QQJAQABACwAAAAAKAAoAAAClYx/oLvoxuJDkU1a1YUZbJ59nSd2ZXhWqbRa2/gF8Gu2DY3iqs7yrq+xBYEkYvFSM8aSSObE+ZgRl1BHFZNr7pRCavZ5BW2142hY3AN/zWtsmf12p9XxxFl2lpLn1rseztfXZjdIWIf2s5dItwjYKBgo9yg5pHgzJXTEeGlZuenpyPmpGQoKOWkYmSpaSnqKileI2FAAACH5BAkBAAEALAAAAAAoACgAAAKVjB+gu+jG4kORTVrVhRlsnn2dJ3ZleFaptFrb+CXmO9OozeL5VfP99HvAWhpiUdcwkpBH3825AwYdU8xTqlLGhtCosArKMpvfa1mMRae9VvWZfeB2XfPkeLmm18lUcBj+p5dnN8jXZ3YIGEhYuOUn45aoCDkp16hl5IjYJvjWKcnoGQpqyPlpOhr3aElaqrq56Bq7VAAAOw=="); + height: 100%; + filter: alpha(opacity=25); /* support: IE8 */ + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-selectmenu-menu { + padding: 0; + margin: 0; + position: absolute; + top: 0; + left: 0; + display: none; +} +.ui-selectmenu-menu .ui-menu { + overflow: auto; + overflow-x: hidden; + padding-bottom: 1px; +} +.ui-selectmenu-menu .ui-menu .ui-selectmenu-optgroup { + font-size: 1em; + font-weight: bold; + line-height: 1.5; + padding: 2px 0.4em; + margin: 0.5em 0 0 0; + height: auto; + border: 0; +} +.ui-selectmenu-open { + display: block; +} +.ui-selectmenu-text { + display: block; + margin-right: 20px; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-selectmenu-button.ui-button { + text-align: left; + white-space: nowrap; + width: 14em; +} +.ui-selectmenu-icon.ui-icon { + float: right; + margin-top: 0; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; + -ms-touch-action: none; + touch-action: none; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* support: IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: .222em 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 2em; +} +.ui-spinner-button { + width: 1.6em; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to override default borders */ +.ui-spinner a.ui-spinner-button { + border-top-style: none; + border-bottom-style: none; + border-right-style: none; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav .ui-tabs-anchor { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-state-disabled .ui-tabs-anchor, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading .ui-tabs-anchor { + cursor: text; +} +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active .ui-tabs-anchor { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget.ui-widget-content { + border: 1px solid #d3d3d3; +} +.ui-widget-content { + border: 1px solid #aaaaaa; + background: #ffffff; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #aaaaaa; + background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default, +.ui-button, + +/* We use html here because we need a greater specificity to make sure disabled +works properly when clicked or hovered */ +html .ui-button.ui-state-disabled:hover, +html .ui-button.ui-state-disabled:active { + border: 1px solid #d3d3d3; + background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited, +a.ui-button, +a:link.ui-button, +a:visited.ui-button, +.ui-button { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus, +.ui-button:hover, +.ui-button:focus { + border: 1px solid #999999; + background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited, +a.ui-button:hover, +a.ui-button:focus { + color: #212121; + text-decoration: none; +} + +.ui-visual-focus { + box-shadow: 0 0 3px 1px rgb(94, 158, 214); +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + border: 1px solid #aaaaaa; + background: #ffffff url("images/ui-bg_glass_65_ffffff_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-icon-background, +.ui-state-active .ui-icon-background { + border: #aaaaaa; + background-color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; + color: #363636; +} +.ui-state-checked { + border: 1px solid #fcefa1; + background: #fbf9ee; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); /* support: IE8 */ + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); /* support: IE8 */ + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url("images/ui-icons_222222_256x240.png"); +} +.ui-widget-header .ui-icon { + background-image: url("images/ui-icons_222222_256x240.png"); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon, +.ui-button:hover .ui-icon, +.ui-button:focus .ui-icon { + background-image: url("images/ui-icons_454545_256x240.png"); +} +.ui-state-active .ui-icon, +.ui-button:active .ui-icon { + background-image: url("images/ui-icons_454545_256x240.png"); +} +.ui-state-highlight .ui-icon, +.ui-button .ui-state-highlight.ui-icon { + background-image: url("images/ui-icons_2e83ff_256x240.png"); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url("images/ui-icons_cd0a0a_256x240.png"); +} +.ui-button .ui-icon { + background-image: url("images/ui-icons_888888_256x240.png"); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-caret-1-n { background-position: 0 0; } +.ui-icon-caret-1-ne { background-position: -16px 0; } +.ui-icon-caret-1-e { background-position: -32px 0; } +.ui-icon-caret-1-se { background-position: -48px 0; } +.ui-icon-caret-1-s { background-position: -65px 0; } +.ui-icon-caret-1-sw { background-position: -80px 0; } +.ui-icon-caret-1-w { background-position: -96px 0; } +.ui-icon-caret-1-nw { background-position: -112px 0; } +.ui-icon-caret-2-n-s { background-position: -128px 0; } +.ui-icon-caret-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -65px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -65px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 1px -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa; + opacity: .3; + filter: Alpha(Opacity=30); /* support: IE8 */ +} +.ui-widget-shadow { + -webkit-box-shadow: -8px -8px 8px #aaaaaa; + box-shadow: -8px -8px 8px #aaaaaa; +} diff --git a/phpMyAdmin/themes/pmahomme/layout.inc.php b/phpMyAdmin/themes/pmahomme/layout.inc.php new file mode 100755 index 0000000..6ac5ddc --- /dev/null +++ b/phpMyAdmin/themes/pmahomme/layout.inc.php @@ -0,0 +1,77 @@ + array('regexp' => '/^[a-z0-9]+$/i')); + $color = filter_input(INPUT_GET, $get_name, FILTER_VALIDATE_REGEXP, $opts); + if (preg_match('/^[a-f0-9]{6}$/', $color)) { + return '#' . $color; + } + return $color ? $color : $default; +} + +$from = PMA_gradientGetColor('from', 'white'); +$to = PMA_gradientGetColor('to', 'blank'); + +echo ''; +?> + + + + + + + + + diff --git a/phpMyAdmin/transformation_overview.php b/phpMyAdmin/transformation_overview.php new file mode 100755 index 0000000..761e5db --- /dev/null +++ b/phpMyAdmin/transformation_overview.php @@ -0,0 +1,73 @@ +getHeader(); +$header->disableMenuAndConsole(); + +$types = Transformations::getAvailableMIMEtypes(); +?> + +

      + $mimetype) { + + if (isset($types['empty_mimetype'][$mimetype])) { + echo '' , htmlspecialchars($mimetype) , '
      '; + } else { + echo htmlspecialchars($mimetype) , '
      '; + } + +} +$transformation_types = array( + 'transformation', 'input_transformation' +); +$label = array( + 'transformation' => __('Available browser display transformations'), + 'input_transformation' => __('Available input transformations') +); +$th = array( + 'transformation' => __('Browser display transformation'), + 'input_transformation' => __('Input transformation') +); +?> +
      + + +

      + + + + + + + + + $transform) { + $desc = Transformations::getDescription($types[$ttype . '_file'][$key]); + ?> + + + + + + +
      + getRelationsParam(); + +/** + * Ensures db and table are valid, else moves to the "parent" script + */ +require_once './libraries/db_table_exists.inc.php'; + + +/** + * Sets globals from $_REQUEST + */ +$request_params = array( + 'cn', + 'ct', + 'sql_query', + 'transform_key', + 'where_clause' +); +$size_params = array( + 'newHeight', + 'newWidth', +); +foreach ($request_params as $one_request_param) { + if (isset($_REQUEST[$one_request_param])) { + if (in_array($one_request_param, $size_params)) { + $GLOBALS[$one_request_param] = intval($_REQUEST[$one_request_param]); + if ($GLOBALS[$one_request_param] > 2000) { + $GLOBALS[$one_request_param] = 2000; + } + } else { + $GLOBALS[$one_request_param] = $_REQUEST[$one_request_param]; + } + } +} + + +/** + * Get the list of the fields of the current table + */ +$GLOBALS['dbi']->selectDb($db); +if (isset($where_clause)) { + + if (! Core::checkSqlQuerySignature($where_clause, isset($_GET['where_clause_sign']) ? $_GET['where_clause_sign'] : '')) { + /* l10n: In case a SQL query did not pass a security check */ + Core::fatalError(__('There is an issue with your request.')); + exit; + } + $result = $GLOBALS['dbi']->query( + 'SELECT * FROM ' . PhpMyAdmin\Util::backquote($table) + . ' WHERE ' . $where_clause . ';', + PhpMyAdmin\DatabaseInterface::CONNECT_USER, + PhpMyAdmin\DatabaseInterface::QUERY_STORE + ); + $row = $GLOBALS['dbi']->fetchAssoc($result); +} else { + $result = $GLOBALS['dbi']->query( + 'SELECT * FROM ' . PhpMyAdmin\Util::backquote($table) . ' LIMIT 1;', + PhpMyAdmin\DatabaseInterface::CONNECT_USER, + PhpMyAdmin\DatabaseInterface::QUERY_STORE + ); + $row = $GLOBALS['dbi']->fetchAssoc($result); +} + +// No row returned +if (! $row) { + exit; +} // end if (no record returned) + +$default_ct = 'application/octet-stream'; + +if ($cfgRelation['commwork'] && $cfgRelation['mimework']) { + $mime_map = Transformations::getMIME($db, $table); + $mime_options = Transformations::getOptions( + isset($mime_map[$transform_key]['transformation_options']) + ? $mime_map[$transform_key]['transformation_options'] : '' + ); + + foreach ($mime_options as $key => $option) { + if (substr($option, 0, 10) == '; charset=') { + $mime_options['charset'] = $option; + } + } +} + +// Only output the http headers +$response = Response::getInstance(); +$response->getHeader()->sendHttpHeaders(); + +// [MIME] +if (isset($ct) && ! empty($ct)) { + $mime_type = $ct; +} else { + $mime_type = (!empty($mime_map[$transform_key]['mimetype']) + ? str_replace('_', '/', $mime_map[$transform_key]['mimetype']) + : $default_ct) + . (isset($mime_options['charset']) ? $mime_options['charset'] : ''); +} + +Core::downloadHeader($cn, $mime_type); + +if (! isset($_REQUEST['resize'])) { + if (stripos($mime_type, 'html') === false) { + echo $row[$transform_key]; + } else { + echo htmlspecialchars($row[$transform_key]); + } +} else { + // if image_*__inline.inc.php finds that we can resize, + // it sets the resize parameter to jpeg or png + + $srcImage = imagecreatefromstring($row[$transform_key]); + $srcWidth = ImageSX($srcImage); + $srcHeight = ImageSY($srcImage); + + // Check to see if the width > height or if width < height + // if so adjust accordingly to make sure the image + // stays smaller than the new width and new height + + $ratioWidth = $srcWidth/$_REQUEST['newWidth']; + $ratioHeight = $srcHeight/$_REQUEST['newHeight']; + + if ($ratioWidth < $ratioHeight) { + $destWidth = $srcWidth/$ratioHeight; + $destHeight = $_REQUEST['newHeight']; + } else { + $destWidth = $_REQUEST['newWidth']; + $destHeight = $srcHeight/$ratioWidth; + } + + if ($_REQUEST['resize']) { + $destImage = ImageCreateTrueColor($destWidth, $destHeight); + } + + // ImageCopyResized($destImage, $srcImage, 0, 0, 0, 0, + // $destWidth, $destHeight, $srcWidth, $srcHeight); + // better quality but slower: + ImageCopyResampled( + $destImage, $srcImage, 0, 0, 0, 0, $destWidth, + $destHeight, $srcWidth, $srcHeight + ); + + if ($_REQUEST['resize'] == 'jpeg') { + ImageJPEG($destImage, null, 75); + } + if ($_REQUEST['resize'] == 'png') { + ImagePNG($destImage); + } + ImageDestroy($srcImage); + ImageDestroy($destImage); +} diff --git a/phpMyAdmin/url.php b/phpMyAdmin/url.php new file mode 100755 index 0000000..edaab5a --- /dev/null +++ b/phpMyAdmin/url.php @@ -0,0 +1,43 @@ +getHeader()->sendHttpHeaders(); +$response->disable(); + +if (! Core::isValid($_GET['url']) + || ! preg_match('/^https:\/\/[^\n\r]*$/', $_GET['url']) + || ! Core::isAllowedDomain($_GET['url']) +) { + Core::sendHeaderLocation('./'); +} else { + // JavaScript redirection is necessary. Because if header() is used + // then web browser sometimes does not change the HTTP_REFERER + // field and so with old URL as Referer, token also goes to + // external site. + echo ""; + // Display redirecting msg on screen. + // Do not display the value of $_GET['url'] to avoid showing injected content + echo __('Taking you to the target site.'); +} +die(); diff --git a/phpMyAdmin/user_password.php b/phpMyAdmin/user_password.php new file mode 100755 index 0000000..10663e9 --- /dev/null +++ b/phpMyAdmin/user_password.php @@ -0,0 +1,73 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('server_privileges.js'); +$scripts->addFile('vendor/zxcvbn.js'); + +$userPassword = new UserPassword(); + +/** + * Displays an error message and exits if the user isn't allowed to use this + * script + */ +if (! $GLOBALS['cfg']['ShowChgPassword']) { + $GLOBALS['cfg']['ShowChgPassword'] = $GLOBALS['dbi']->selectDb('mysql'); +} +if ($cfg['Server']['auth_type'] == 'config' || ! $cfg['ShowChgPassword']) { + Message::error( + __('You don\'t have sufficient privileges to be here right now!') + )->display(); + exit; +} // end if + +/** + * If the "change password" form has been submitted, checks for valid values + * and submit the query or logout + */ +if (isset($_POST['nopass'])) { + if ($_POST['nopass'] == '1') { + $password = ''; + } else { + $password = $_POST['pma_pw']; + } + $change_password_message = $userPassword->setChangePasswordMsg(); + $msg = $change_password_message['msg']; + if (! $change_password_message['error']) { + $userPassword->changePassword($password, $msg, $change_password_message); + } else { + $userPassword->getChangePassMessage($change_password_message); + } +} + +/** + * If the "change password" form hasn't been submitted or the values submitted + * aren't valid -> displays the form + */ + +// Displays an error message if required +if (isset($msg)) { + $msg->display(); + unset($msg); +} + +echo ChangePassword::getHtml('change_pw', $username, $hostname); +exit; diff --git a/phpMyAdmin/vendor/autoload.php b/phpMyAdmin/vendor/autoload.php new file mode 100755 index 0000000..5d1babe --- /dev/null +++ b/phpMyAdmin/vendor/autoload.php @@ -0,0 +1,7 @@ + array( + __DIR__ . '/autoload_classmap.php', + ), + 'Zend\Loader\StandardAutoloader' => array( + 'namespaces' => array( + __NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__, + ), + ), + ); + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/README.md b/phpMyAdmin/vendor/bacon/bacon-qr-code/README.md new file mode 100755 index 0000000..a836bd6 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/README.md @@ -0,0 +1,24 @@ +QR Code generator +================= + +Master: [![Build Status](https://api.travis-ci.org/Bacon/BaconQrCode.png?branch=master)](http://travis-ci.org/Bacon/BaconQrCode) + +Introduction +------------ +BaconQrCode is a port of QR code portion of the ZXing library. It currently +only features the encoder part, but could later receive the decoder part as +well. + +As the Reed Solomon codec implementation of the ZXing library performs quite +slow in PHP, it was exchanged with the implementation by Phil Karn. + + +Example usage +------------- +```php +$renderer = new \BaconQrCode\Renderer\Image\Png(); +$renderer->setHeight(256); +$renderer->setWidth(256); +$writer = new \BaconQrCode\Writer($renderer); +$writer->writeFile('Hello World!', 'qrcode.png'); +``` diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/autoload_classmap.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/autoload_classmap.php new file mode 100755 index 0000000..9fbeb35 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/autoload_classmap.php @@ -0,0 +1,43 @@ + __DIR__ . '/src/BaconQrCode/Common/AbstractEnum.php', + 'BaconQrCode\Common\BitArray' => __DIR__ . '/src/BaconQrCode/Common/BitArray.php', + 'BaconQrCode\Common\BitMatrix' => __DIR__ . '/src/BaconQrCode/Common/BitMatrix.php', + 'BaconQrCode\Common\BitUtils' => __DIR__ . '/src/BaconQrCode/Common/BitUtils.php', + 'BaconQrCode\Common\CharacterSetEci' => __DIR__ . '/src/BaconQrCode/Common/CharacterSetEci.php', + 'BaconQrCode\Common\EcBlock' => __DIR__ . '/src/BaconQrCode/Common/EcBlock.php', + 'BaconQrCode\Common\EcBlocks' => __DIR__ . '/src/BaconQrCode/Common/EcBlocks.php', + 'BaconQrCode\Common\ErrorCorrectionLevel' => __DIR__ . '/src/BaconQrCode/Common/ErrorCorrectionLevel.php', + 'BaconQrCode\Common\FormatInformation' => __DIR__ . '/src/BaconQrCode/Common/FormatInformation.php', + 'BaconQrCode\Common\Mode' => __DIR__ . '/src/BaconQrCode/Common/Mode.php', + 'BaconQrCode\Common\ReedSolomonCodec' => __DIR__ . '/src/BaconQrCode/Common/ReedSolomonCodec.php', + 'BaconQrCode\Common\Version' => __DIR__ . '/src/BaconQrCode/Common/Version.php', + 'BaconQrCode\Encoder\BlockPair' => __DIR__ . '/src/BaconQrCode/Encoder/BlockPair.php', + 'BaconQrCode\Encoder\ByteMatrix' => __DIR__ . '/src/BaconQrCode/Encoder/ByteMatrix.php', + 'BaconQrCode\Encoder\Encoder' => __DIR__ . '/src/BaconQrCode/Encoder/Encoder.php', + 'BaconQrCode\Encoder\MaskUtil' => __DIR__ . '/src/BaconQrCode/Encoder/MaskUtil.php', + 'BaconQrCode\Encoder\MatrixUtil' => __DIR__ . '/src/BaconQrCode/Encoder/MatrixUtil.php', + 'BaconQrCode\Encoder\QrCode' => __DIR__ . '/src/BaconQrCode/Encoder/QrCode.php', + 'BaconQrCode\Exception\ExceptionInterface' => __DIR__ . '/src/BaconQrCode/Exception/ExceptionInterface.php', + 'BaconQrCode\Exception\InvalidArgumentException' => __DIR__ . '/src/BaconQrCode/Exception/InvalidArgumentException.php', + 'BaconQrCode\Exception\OutOfBoundsException' => __DIR__ . '/src/BaconQrCode/Exception/OutOfBoundsException.php', + 'BaconQrCode\Exception\RuntimeException' => __DIR__ . '/src/BaconQrCode/Exception/RuntimeException.php', + 'BaconQrCode\Exception\UnexpectedValueException' => __DIR__ . '/src/BaconQrCode/Exception/UnexpectedValueException.php', + 'BaconQrCode\Exception\WriterException' => __DIR__ . '/src/BaconQrCode/Exception/WriterException.php', + 'BaconQrCode\Renderer\Color\Cmyk' => __DIR__ . '/src/BaconQrCode/Renderer/Color/Cmyk.php', + 'BaconQrCode\Renderer\Color\ColorInterface' => __DIR__ . '/src/BaconQrCode/Renderer/Color/ColorInterface.php', + 'BaconQrCode\Renderer\Color\Gray' => __DIR__ . '/src/BaconQrCode/Renderer/Color/Gray.php', + 'BaconQrCode\Renderer\Color\Rgb' => __DIR__ . '/src/BaconQrCode/Renderer/Color/Rgb.php', + 'BaconQrCode\Renderer\Image\AbstractRenderer' => __DIR__ . '/src/BaconQrCode/Renderer/Image/AbstractRenderer.php', + 'BaconQrCode\Renderer\Image\Decorator\DecoratorInterface' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Decorator/DecoratorInterface.php', + 'BaconQrCode\Renderer\Image\Decorator\FinderPattern' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Decorator/FinderPattern.php', + 'BaconQrCode\Renderer\Image\Eps' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Eps.php', + 'BaconQrCode\Renderer\Image\Png' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Png.php', + 'BaconQrCode\Renderer\Image\RendererInterface' => __DIR__ . '/src/BaconQrCode/Renderer/Image/RendererInterface.php', + 'BaconQrCode\Renderer\Image\Svg' => __DIR__ . '/src/BaconQrCode/Renderer/Image/Svg.php', + 'BaconQrCode\Renderer\RendererInterface' => __DIR__ . '/src/BaconQrCode/Renderer/RendererInterface.php', + 'BaconQrCode\Renderer\Text\Plain' => __DIR__ . '/src/BaconQrCode/Renderer/Text/Plain.php', + 'BaconQrCode\Renderer\Text\Html' => __DIR__ . '/src/BaconQrCode/Renderer/Text/Html.php', + 'BaconQrCode\Writer' => __DIR__ . '/src/BaconQrCode/Writer.php', +); \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/autoload_function.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/autoload_function.php new file mode 100755 index 0000000..9148da3 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/autoload_function.php @@ -0,0 +1,12 @@ +strict = $strict; + $this->change($initialValue); + } + + /** + * Changes the value of the enum. + * + * @param mixed $value + * @return void + */ + public function change($value) + { + if (!in_array($value, $this->getConstList(), $this->strict)) { + throw new Exception\UnexpectedValueException('Value not a const in enum ' . get_class($this)); + } + + $this->value = $value; + } + + /** + * Gets current value. + * + * @return mixed + */ + public function get() + { + return $this->value; + } + + /** + * Gets all constants (possible values) as an array. + * + * @param boolean $includeDefault + * @return array + */ + public function getConstList($includeDefault = true) + { + if ($this->constants === null) { + $reflection = new ReflectionClass($this); + $this->constants = $reflection->getConstants(); + } + + if ($includeDefault) { + return $this->constants; + } + + $constants = $this->constants; + unset($constants['__default']); + + return $constants; + } + + /** + * Gets the name of the enum. + * + * @return string + */ + public function __toString() + { + return array_search($this->value, $this->getConstList()); + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitArray.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitArray.php new file mode 100755 index 0000000..0a99d9a --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitArray.php @@ -0,0 +1,435 @@ +size = $size; + $this->bits = new SplFixedArray(($this->size + 31) >> 3); + } + + /** + * Gets the size in bits. + * + * @return integer + */ + public function getSize() + { + return $this->size; + } + + /** + * Gets the size in bytes. + * + * @return integer + */ + public function getSizeInBytes() + { + return ($this->size + 7) >> 3; + } + + /** + * Ensures that the array has a minimum capacity. + * + * @param integer $size + * @return void + */ + public function ensureCapacity($size) + { + if ($size > count($this->bits) << 5) { + $this->bits->setSize(($size + 31) >> 5); + } + } + + /** + * Gets a specific bit. + * + * @param integer $i + * @return boolean + */ + public function get($i) + { + return ($this->bits[$i >> 5] & (1 << ($i & 0x1f))) !== 0; + } + + /** + * Sets a specific bit. + * + * @param integer $i + * @return void + */ + public function set($i) + { + $this->bits[$i >> 5] = $this->bits[$i >> 5] | 1 << ($i & 0x1f); + } + + /** + * Flips a specific bit. + * + * @param integer $i + * @return void + */ + public function flip($i) + { + $this->bits[$i >> 5] ^= 1 << ($i & 0x1f); + } + + /** + * Gets the next set bit position from a given position. + * + * @param integer $from + * @return integer + */ + public function getNextSet($from) + { + if ($from >= $this->size) { + return $this->size; + } + + $bitsOffset = $from >> 5; + $currentBits = $this->bits[$bitsOffset]; + $bitsLength = count($this->bits); + + $currentBits &= ~((1 << ($from & 0x1f)) - 1); + + while ($currentBits === 0) { + if (++$bitsOffset === $bitsLength) { + return $this->size; + } + + $currentBits = $this->bits[$bitsOffset]; + } + + $result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits); + + return $result > $this->size ? $this->size : $result; + } + + /** + * Gets the next unset bit position from a given position. + * + * @param integer $from + * @return integer + */ + public function getNextUnset($from) + { + if ($from >= $this->size) { + return $this->size; + } + + $bitsOffset = $from >> 5; + $currentBits = ~$this->bits[$bitsOffset]; + $bitsLength = count($this->bits); + + $currentBits &= ~((1 << ($from & 0x1f)) - 1); + + while ($currentBits === 0) { + if (++$bitsOffset === $bitsLength) { + return $this->size; + } + + $currentBits = ~$this->bits[$bitsOffset]; + } + + $result = ($bitsOffset << 5) + BitUtils::numberOfTrailingZeros($currentBits); + + return $result > $this->size ? $this->size : $result; + } + + /** + * Sets a bulk of bits. + * + * @param integer $i + * @param integer $newBits + * @return void + */ + public function setBulk($i, $newBits) + { + $this->bits[$i >> 5] = $newBits; + } + + /** + * Sets a range of bits. + * + * @param integer $start + * @param integer $end + * @return void + * @throws Exception\InvalidArgumentException + */ + public function setRange($start, $end) + { + if ($end < $start) { + throw new Exception\InvalidArgumentException('End must be greater or equal to start'); + } + + if ($end === $start) { + return; + } + + $end--; + + $firstInt = $start >> 5; + $lastInt = $end >> 5; + + for ($i = $firstInt; $i <= $lastInt; $i++) { + $firstBit = $i > $firstInt ? 0 : $start & 0x1f; + $lastBit = $i < $lastInt ? 31 : $end & 0x1f; + + if ($firstBit === 0 && $lastBit === 31) { + $mask = 0x7fffffff; + } else { + $mask = 0; + + for ($j = $firstBit; $j < $lastBit; $j++) { + $mask |= 1 << $j; + } + } + + $this->bits[$i] = $this->bits[$i] | $mask; + } + } + + /** + * Clears the bit array, unsetting every bit. + * + * @return void + */ + public function clear() + { + $bitsLength = count($this->bits); + + for ($i = 0; $i < $bitsLength; $i++) { + $this->bits[$i] = 0; + } + } + + /** + * Checks if a range of bits is set or not set. + * + * @param integer $start + * @param integer $end + * @param integer $value + * @return boolean + * @throws Exception\InvalidArgumentException + */ + public function isRange($start, $end, $value) + { + if ($end < $start) { + throw new Exception\InvalidArgumentException('End must be greater or equal to start'); + } + + if ($end === $start) { + return; + } + + $end--; + + $firstInt = $start >> 5; + $lastInt = $end >> 5; + + for ($i = $firstInt; $i <= $lastInt; $i++) { + $firstBit = $i > $firstInt ? 0 : $start & 0x1f; + $lastBit = $i < $lastInt ? 31 : $end & 0x1f; + + if ($firstBit === 0 && $lastBit === 31) { + $mask = 0x7fffffff; + } else { + $mask = 0; + + for ($j = $firstBit; $j <= $lastBit; $j++) { + $mask |= 1 << $j; + } + } + + if (($this->bits[$i] & $mask) !== ($value ? $mask : 0)) { + return false; + } + } + + return true; + } + + /** + * Appends a bit to the array. + * + * @param boolean $bit + * @return void + */ + public function appendBit($bit) + { + $this->ensureCapacity($this->size + 1); + + if ($bit) { + $this->bits[$this->size >> 5] = $this->bits[$this->size >> 5] | (1 << ($this->size & 0x1f)); + } + + $this->size++; + } + + /** + * Appends a number of bits (up to 32) to the array. + * + * @param integer $value + * @param integer $numBits + * @return void + * @throws Exception\InvalidArgumentException + */ + public function appendBits($value, $numBits) + { + if ($numBits < 0 || $numBits > 32) { + throw new Exception\InvalidArgumentException('Num bits must be between 0 and 32'); + } + + $this->ensureCapacity($this->size + $numBits); + + for ($numBitsLeft = $numBits; $numBitsLeft > 0; $numBitsLeft--) { + $this->appendBit((($value >> ($numBitsLeft - 1)) & 0x01) === 1); + } + } + + /** + * Appends another bit array to this array. + * + * @param BitArray $other + * @return void + */ + public function appendBitArray(self $other) + { + $otherSize = $other->getSize(); + $this->ensureCapacity($this->size + $other->getSize()); + + for ($i = 0; $i < $otherSize; $i++) { + $this->appendBit($other->get($i)); + } + } + + /** + * Makes an exclusive-or comparision on the current bit array. + * + * @param BitArray $other + * @return void + * @throws Exception\InvalidArgumentException + */ + public function xorBits(self $other) + { + $bitsLength = count($this->bits); + $otherBits = $other->getBitArray(); + + if ($bitsLength !== count($otherBits)) { + throw new Exception\InvalidArgumentException('Sizes don\'t match'); + } + + for ($i = 0; $i < $bitsLength; $i++) { + $this->bits[$i] = $this->bits[$i] ^ $otherBits[$i]; + } + } + + /** + * Converts the bit array to a byte array. + * + * @param integer $bitOffset + * @param integer $numBytes + * @return SplFixedArray + */ + public function toBytes($bitOffset, $numBytes) + { + $bytes = new SplFixedArray($numBytes); + + for ($i = 0; $i < $numBytes; $i++) { + $byte = 0; + + for ($j = 0; $j < 8; $j++) { + if ($this->get($bitOffset)) { + $byte |= 1 << (7 - $j); + } + + $bitOffset++; + } + + $bytes[$i] = $byte; + } + + return $bytes; + } + + /** + * Gets the internal bit array. + * + * @return SplFixedArray + */ + public function getBitArray() + { + return $this->bits; + } + + /** + * Reverses the array. + * + * @return void + */ + public function reverse() + { + $newBits = new SplFixedArray(count($this->bits)); + + for ($i = 0; $i < $this->size; $i++) { + if ($this->get($this->size - $i - 1)) { + $newBits[$i >> 5] = $newBits[$i >> 5] | (1 << ($i & 0x1f)); + } + } + + $this->bits = newBits; + } + + /** + * Returns a string representation of the bit array. + * + * @return string + */ + public function __toString() + { + $result = ''; + + for ($i = 0; $i < $this->size; $i++) { + if (($i & 0x07) === 0) { + $result .= ' '; + } + + $result .= $this->get($i) ? 'X' : '.'; + } + + return $result; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitMatrix.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitMatrix.php new file mode 100755 index 0000000..b930f88 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitMatrix.php @@ -0,0 +1,350 @@ +width = $width; + $this->height = $height; + $this->rowSize = ($width + 31) >> 5; + $this->bits = new SplFixedArray($this->rowSize * $height); + } + + /** + * Gets the requested bit, where true means black. + * + * @param integer $x + * @param integer $y + * @return boolean + */ + public function get($x, $y) + { + $offset = $y * $this->rowSize + ($x >> 5); + return (BitUtils::unsignedRightShift($this->bits[$offset], ($x & 0x1f)) & 1) !== 0; + } + + /** + * Sets the given bit to true. + * + * @param integer $x + * @param integer $y + * @return void + */ + public function set($x, $y) + { + $offset = $y * $this->rowSize + ($x >> 5); + $this->bits[$offset] = $this->bits[$offset] | (1 << ($x & 0x1f)); + } + + /** + * Flips the given bit. + * + * @param integer $x + * @param integer $y + * @return void + */ + public function flip($x, $y) + { + $offset = $y * $this->rowSize + ($x >> 5); + $this->bits[$offset] = $this->bits[$offset] ^ (1 << ($x & 0x1f)); + } + + /** + * Clears all bits (set to false). + * + * @return void + */ + public function clear() + { + $max = count($this->bits); + + for ($i = 0; $i < $max; $i++) { + $this->bits[$i] = 0; + } + } + + /** + * Sets a square region of the bit matrix to true. + * + * @param integer $left + * @param integer $top + * @param integer $width + * @param integer $height + * @return void + */ + public function setRegion($left, $top, $width, $height) + { + if ($top < 0 || $left < 0) { + throw new Exception\InvalidArgumentException('Left and top must be non-negative'); + } + + if ($height < 1 || $width < 1) { + throw new Exception\InvalidArgumentException('Width and height must be at least 1'); + } + + $right = $left + $width; + $bottom = $top + $height; + + if ($bottom > $this->height || $right > $this->width) { + throw new Exception\InvalidArgumentException('The region must fit inside the matrix'); + } + + for ($y = $top; $y < $bottom; $y++) { + $offset = $y * $this->rowSize; + + for ($x = $left; $x < $right; $x++) { + $index = $offset + ($x >> 5); + $this->bits[$index] = $this->bits[$index] | (1 << ($x & 0x1f)); + } + } + } + + /** + * A fast method to retrieve one row of data from the matrix as a BitArray. + * + * @param integer $y + * @param BitArray $row + * @return BitArray + */ + public function getRow($y, BitArray $row = null) + { + if ($row === null || $row->getSize() < $this->width) { + $row = new BitArray($this->width); + } + + $offset = $y * $this->rowSize; + + for ($x = 0; $x < $this->rowSize; $x++) { + $row->setBulk($x << 5, $this->bits[$offset + $x]); + } + + return $row; + } + + /** + * Sets a row of data from a BitArray. + * + * @param integer $y + * @param BitArray $row + * @return void + */ + public function setRow($y, BitArray $row) + { + $bits = $row->getBitArray(); + + for ($i = 0; $i < $this->rowSize; $i++) { + $this->bits[$y * $this->rowSize + $i] = $bits[$i]; + } + } + + /** + * This is useful in detecting the enclosing rectangle of a 'pure' barcode. + * + * @return SplFixedArray + */ + public function getEnclosingRectangle() + { + $left = $this->width; + $top = $this->height; + $right = -1; + $bottom = -1; + + for ($y = 0; $y < $this->height; $y++) { + for ($x32 = 0; $x32 < $this->rowSize; $x32++) { + $bits = $this->bits[$y * $this->rowSize + $x32]; + + if ($bits !== 0) { + if ($y < $top) { + $top = $y; + } + + if ($y > $bottom) { + $bottom = $y; + } + + if ($x32 * 32 < $left) { + $bit = 0; + + while (($bits << (31 - $bit)) === 0) { + $bit++; + } + + if (($x32 * 32 + $bit) < $left) { + $left = $x32 * 32 + $bit; + } + } + } + + if ($x32 * 32 + 31 > $right) { + $bit = 31; + + while (BitUtils::unsignedRightShift($bits, $bit) === 0) { + $bit--; + } + + if (($x32 * 32 + $bit) > $right) { + $right = $x32 * 32 + $bit; + } + } + } + } + + $width = $right - $left; + $height = $bottom - $top; + + if ($width < 0 || $height < 0) { + return null; + } + + return SplFixedArray::fromArray(array($left, $top, $width, $height), false); + } + + /** + * Gets the most top left set bit. + * + * This is useful in detecting a corner of a 'pure' barcode. + * + * @return SplFixedArray + */ + public function getTopLeftOnBit() + { + $bitsOffset = 0; + + while ($bitsOffset < count($this->bits) && $this->bits[$bitsOffset] === 0) { + $bitsOffset++; + } + + if ($bitsOffset === count($this->bits)) { + return null; + } + + $x = intval($bitsOffset / $this->rowSize); + $y = ($bitsOffset % $this->rowSize) << 5; + + $bits = $this->bits[$bitsOffset]; + $bit = 0; + + while (($bits << (31 - $bit)) === 0) { + $bit++; + } + + $x += $bit; + + return SplFixedArray::fromArray(array($x, $y), false); + } + + /** + * Gets the most bottom right set bit. + * + * This is useful in detecting a corner of a 'pure' barcode. + * + * @return SplFixedArray + */ + public function getBottomRightOnBit() + { + $bitsOffset = count($this->bits) - 1; + + while ($bitsOffset >= 0 && $this->bits[$bitsOffset] === 0) { + $bitsOffset--; + } + + if ($bitsOffset < 0) { + return null; + } + + $x = intval($bitsOffset / $this->rowSize); + $y = ($bitsOffset % $this->rowSize) << 5; + + $bits = $this->bits[$bitsOffset]; + $bit = 0; + + while (BitUtils::unsignedRightShift($bits, $bit) === 0) { + $bit--; + } + + $x += $bit; + + return SplFixedArray::fromArray(array($x, $y), false); + } + + /** + * Gets the width of the matrix, + * + * @return integer + */ + public function getWidth() + { + return $this->width; + } + + /** + * Gets the height of the matrix. + * + * @return integer + */ + public function getHeight() + { + return $this->height; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitUtils.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitUtils.php new file mode 100755 index 0000000..a641244 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/BitUtils.php @@ -0,0 +1,51 @@ +>>" in other + * languages. + * + * @param integer $a + * @param integer $b + * @return integer + */ + public static function unsignedRightShift($a, $b) + { + return ( + $a >= 0 + ? $a >> $b + : (($a & 0x7fffffff) >> $b) | (0x40000000 >> ($b - 1)) + ); + } + + /** + * Gets the number of trailing zeros. + * + * @param integer $i + * @return integer + */ + public static function numberOfTrailingZeros($i) + { + $lastPos = strrpos(str_pad(decbin($i), 32, '0', STR_PAD_LEFT), '1'); + + return $lastPos === false ? 32 : 31 - $lastPos; + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/CharacterSetEci.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/CharacterSetEci.php new file mode 100755 index 0000000..7766236 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/CharacterSetEci.php @@ -0,0 +1,134 @@ + self::ISO8859_1, + 'ISO-8859-2' => self::ISO8859_2, + 'ISO-8859-3' => self::ISO8859_3, + 'ISO-8859-4' => self::ISO8859_4, + 'ISO-8859-5' => self::ISO8859_5, + 'ISO-8859-6' => self::ISO8859_6, + 'ISO-8859-7' => self::ISO8859_7, + 'ISO-8859-8' => self::ISO8859_8, + 'ISO-8859-9' => self::ISO8859_9, + 'ISO-8859-10' => self::ISO8859_10, + 'ISO-8859-11' => self::ISO8859_11, + 'ISO-8859-12' => self::ISO8859_12, + 'ISO-8859-13' => self::ISO8859_13, + 'ISO-8859-14' => self::ISO8859_14, + 'ISO-8859-15' => self::ISO8859_15, + 'ISO-8859-16' => self::ISO8859_16, + 'SHIFT-JIS' => self::SJIS, + 'WINDOWS-1250' => self::CP1250, + 'WINDOWS-1251' => self::CP1251, + 'WINDOWS-1252' => self::CP1252, + 'WINDOWS-1256' => self::CP1256, + 'UTF-16BE' => self::UNICODE_BIG_UNMARKED, + 'UTF-8' => self::UTF8, + 'ASCII' => self::ASCII, + 'GBK' => self::GB18030, + 'EUC-KR' => self::EUC_KR, + ); + + /** + * Additional possible values for character sets. + * + * @var array + */ + protected $additionalValues = array( + self::CP437 => 2, + self::ASCII => 170, + ); + + /** + * Gets character set ECI by value. + * + * @param string $name + * @return CharacterSetEci|null + */ + public static function getCharacterSetECIByValue($value) + { + if ($value < 0 || $value >= 900) { + throw new Exception\InvalidArgumentException('Value must be between 0 and 900'); + } + + if (false !== ($key = array_search($value, self::$additionalValues))) { + $value = $key; + } + + try { + return new self($value); + } catch (Exception\UnexpectedValueException $e) { + return null; + } + } + + /** + * Gets character set ECI by name. + * + * @param string $name + * @return CharacterSetEci|null + */ + public static function getCharacterSetECIByName($name) + { + $name = strtoupper($name); + + if (isset(self::$nameToEci[$name])) { + return new self(self::$nameToEci[$name]); + } + + return null; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/EcBlock.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/EcBlock.php new file mode 100755 index 0000000..cbcc2ba --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/EcBlock.php @@ -0,0 +1,65 @@ +count = $count; + $this->dataCodewords = $dataCodewords; + } + + /** + * Returns how many times the block is used. + * + * @return integer + */ + public function getCount() + { + return $this->count; + } + + /** + * Returns the number of data codewords. + * + * @return integer + */ + public function getDataCodewords() + { + return $this->dataCodewords; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/EcBlocks.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/EcBlocks.php new file mode 100755 index 0000000..87cef5d --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/EcBlocks.php @@ -0,0 +1,101 @@ +ecCodewordsPerBlock = $ecCodewordsPerBlock; + + $this->ecBlocks = new SplFixedArray($ecb2 === null ? 1 : 2); + $this->ecBlocks[0] = $ecb1; + + if ($ecb2 !== null) { + $this->ecBlocks[1] = $ecb2; + } + } + + /** + * Gets the number of EC codewords per block. + * + * @return integer + */ + public function getEcCodewordsPerBlock() + { + return $this->ecCodewordsPerBlock; + } + + /** + * Gets the total number of EC block appearances. + * + * @return integer + */ + public function getNumBlocks() + { + $total = 0; + + foreach ($this->ecBlocks as $ecBlock) { + $total += $ecBlock->getCount(); + } + + return $total; + } + + /** + * Gets the total count of EC codewords. + * + * @return integer + */ + public function getTotalEcCodewords() + { + return $this->ecCodewordsPerBlock * $this->getNumBlocks(); + } + + /** + * Gets the EC blocks included in this collection. + * + * @return SplFixedArray + */ + public function getEcBlocks() + { + return $this->ecBlocks; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/ErrorCorrectionLevel.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/ErrorCorrectionLevel.php new file mode 100755 index 0000000..bd0a60a --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/ErrorCorrectionLevel.php @@ -0,0 +1,62 @@ +value) { + case self::L: + return 0; + break; + + case self::M: + return 1; + break; + + case self::Q: + return 2; + break; + + case self::H: + return 3; + break; + } + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/FormatInformation.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/FormatInformation.php new file mode 100755 index 0000000..5ec9ffd --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/FormatInformation.php @@ -0,0 +1,236 @@ +ecLevel = new ErrorCorrectionLevel(($formatInfo >> 3) & 0x3); + $this->dataMask = $formatInfo & 0x7; + } + + /** + * Checks how many bits are different between two integers. + * + * @param integer $a + * @param integer $b + * @return integer + */ + public static function numBitsDiffering($a, $b) + { + $a ^= $b; + + return ( + self::$bitsSetInHalfByte[$a & 0xf] + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 4) & 0xf)] + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 8) & 0xf)] + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 12) & 0xf)] + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 16) & 0xf)] + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 20) & 0xf)] + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 24) & 0xf)] + + self::$bitsSetInHalfByte[(BitUtils::unsignedRightShift($a, 28) & 0xf)] + ); + } + + /** + * Decodes format information. + * + * @param integer $maskedFormatInfo1 + * @param integer $maskedFormatInfo2 + * @return FormatInformation|null + */ + public static function decodeFormatInformation($maskedFormatInfo1, $maskedFormatInfo2) + { + $formatInfo = self::doDecodeFormatInformation($maskedFormatInfo1, $maskedFormatInfo2); + + if ($formatInfo !== null) { + return $formatInfo; + } + + // Should return null, but, some QR codes apparently do not mask this + // info. Try again by actually masking the pattern first. + return self::doDecodeFormatInformation( + $maskedFormatInfo1 ^ self::FORMAT_INFO_MASK_QR, + $maskedFormatInfo2 ^ self::FORMAT_INFO_MASK_QR + ); + } + + /** + * Internal method for decoding format information. + * + * @param integer $maskedFormatInfo1 + * @param integer $maskedFormatInfo2 + * @return FormatInformation|null + */ + protected static function doDecodeFormatInformation($maskedFormatInfo1, $maskedFormatInfo2) + { + $bestDifference = PHP_INT_MAX; + $bestFormatInfo = 0; + + foreach (self::$formatInfoDecodeLookup as $decodeInfo) { + $targetInfo = $decodeInfo[0]; + + if ($targetInfo === $maskedFormatInfo1 || $targetInfo === $maskedFormatInfo2) { + // Found an exact match + return new self($decodeInfo[1]); + } + + $bitsDifference = self::numBitsDiffering($maskedFormatInfo1, $targetInfo); + + if ($bitsDifference < $bestDifference) { + $bestFormatInfo = $decodeInfo[1]; + $bestDifference = $bitsDifference; + } + + if ($maskedFormatInfo1 !== $maskedFormatInfo2) { + // Also try the other option + $bitsDifference = self::numBitsDiffering($maskedFormatInfo2, $targetInfo); + + if ($bitsDifference < $bestDifference) { + $bestFormatInfo = $decodeInfo[1]; + $bestDifference = $bitsDifference; + } + } + } + + // Hamming distance of the 32 masked codes is 7, by construction, so + // <= 3 bits differing means we found a match. + if ($bestDifference <= 3) { + return new self($bestFormatInfo); + } + + return null; + } + + /** + * Gets the error correction level. + * + * @return ErrorCorrectionLevel + */ + public function getErrorCorrectionLevel() + { + return $this->ecLevel; + } + + /** + * Gets the data mask. + * + * @return integer + */ + public function getDataMask() + { + return $this->dataMask; + } + + /** + * Hashes the code of the EC level. + * + * @return integer + */ + public function hashCode() + { + return ($this->ecLevel->get() << 3) | $this->dataMask; + } + + /** + * Verifies if this instance equals another one. + * + * @param mixed $other + * @return boolean + */ + public function equals($other) { + if (!$other instanceof self) { + return false; + } + + return ( + $this->ecLevel->get() === $other->getErrorCorrectionLevel()->get() + && $this->dataMask === $other->getDataMask() + ); + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/Mode.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/Mode.php new file mode 100755 index 0000000..8faf344 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/Mode.php @@ -0,0 +1,70 @@ + array(0, 0, 0), + self::NUMERIC => array(10, 12, 14), + self::ALPHANUMERIC => array(9, 11, 13), + self::STRUCTURED_APPEND => array(0, 0, 0), + self::BYTE => array(8, 16, 16), + self::ECI => array(0, 0, 0), + self::KANJI => array(8, 10, 12), + self::FNC1_FIRST_POSITION => array(0, 0, 0), + self::FNC1_SECOND_POSITION => array(0, 0, 0), + self::HANZI => array(8, 10, 12), + ); + + /** + * Gets the number of bits used in a specific QR code version. + * + * @param Version $version + * @return integer + */ + public function getCharacterCountBits(Version $version) + { + $number = $version->getVersionNumber(); + + if ($number <= 9) { + $offset = 0; + } elseif ($number <= 26) { + $offset = 1; + } else { + $offset = 2; + } + + return self::$characterCountBitsForVersions[$this->value][$offset]; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/ReedSolomonCodec.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/ReedSolomonCodec.php new file mode 100755 index 0000000..e8d45b9 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/ReedSolomonCodec.php @@ -0,0 +1,476 @@ + 8) { + throw new Exception\InvalidArgumentException('Symbol size must be between 0 and 8'); + } + + if ($firstRoot < 0 || $firstRoot >= (1 << $symbolSize)) { + throw new Exception\InvalidArgumentException('First root must be between 0 and ' . (1 << $symbolSize)); + } + + if ($numRoots < 0 || $numRoots >= (1 << $symbolSize)) { + throw new Exception\InvalidArgumentException('Num roots must be between 0 and ' . (1 << $symbolSize)); + } + + if ($padding < 0 || $padding >= ((1 << $symbolSize) - 1 - $numRoots)) { + throw new Exception\InvalidArgumentException('Padding must be between 0 and ' . ((1 << $symbolSize) - 1 - $numRoots)); + } + + $this->symbolSize = $symbolSize; + $this->blockSize = (1 << $symbolSize) - 1; + $this->padding = $padding; + $this->alphaTo = SplFixedArray::fromArray(array_fill(0, $this->blockSize + 1, 0), false); + $this->indexOf = SplFixedArray::fromArray(array_fill(0, $this->blockSize + 1, 0), false); + + // Generate galous field lookup table + $this->indexOf[0] = $this->blockSize; + $this->alphaTo[$this->blockSize] = 0; + + $sr = 1; + + for ($i = 0; $i < $this->blockSize; $i++) { + $this->indexOf[$sr] = $i; + $this->alphaTo[$i] = $sr; + + $sr <<= 1; + + if ($sr & (1 << $symbolSize)) { + $sr ^= $gfPoly; + } + + $sr &= $this->blockSize; + } + + if ($sr !== 1) { + throw new Exception\RuntimeException('Field generator polynomial is not primitive'); + } + + // Form RS code generator polynomial from its roots + $this->generatorPoly = SplFixedArray::fromArray(array_fill(0, $numRoots + 1, 0), false); + $this->firstRoot = $firstRoot; + $this->primitive = $primitive; + $this->numRoots = $numRoots; + + // Find prim-th root of 1, used in decoding + for ($iPrimitive = 1; ($iPrimitive % $primitive) !== 0; $iPrimitive += $this->blockSize); + $this->iPrimitive = intval($iPrimitive / $primitive); + + $this->generatorPoly[0] = 1; + + for ($i = 0, $root = $firstRoot * $primitive; $i < $numRoots; $i++, $root += $primitive) { + $this->generatorPoly[$i + 1] = 1; + + for ($j = $i; $j > 0; $j--) { + if ($this->generatorPoly[$j] !== 0) { + $this->generatorPoly[$j] = $this->generatorPoly[$j - 1] ^ $this->alphaTo[$this->modNn($this->indexOf[$this->generatorPoly[$j]] + $root)]; + } else { + $this->generatorPoly[$j] = $this->generatorPoly[$j - 1]; + } + } + + $this->generatorPoly[$j] = $this->alphaTo[$this->modNn($this->indexOf[$this->generatorPoly[0]] + $root)]; + } + + // Convert generator poly to index form for quicker encoding + for ($i = 0; $i <= $numRoots; $i++) { + $this->generatorPoly[$i] = $this->indexOf[$this->generatorPoly[$i]]; + } + } + + /** + * Encodes data and writes result back into parity array. + * + * @param SplFixedArray $data + * @param SplFixedArray $parity + * @return void + */ + public function encode(SplFixedArray $data, SplFixedArray $parity) + { + for ($i = 0; $i < $this->numRoots; $i++) { + $parity[$i] = 0; + } + + $iterations = $this->blockSize - $this->numRoots - $this->padding; + + for ($i = 0; $i < $iterations; $i++) { + $feedback = $this->indexOf[$data[$i] ^ $parity[0]]; + + if ($feedback !== $this->blockSize) { + // Feedback term is non-zero + $feedback = $this->modNn($this->blockSize - $this->generatorPoly[$this->numRoots] + $feedback); + + for ($j = 1; $j < $this->numRoots; $j++) { + $parity[$j] = $parity[$j] ^ $this->alphaTo[$this->modNn($feedback + $this->generatorPoly[$this->numRoots - $j])]; + } + } + + for ($j = 0; $j < $this->numRoots - 1; $j++) { + $parity[$j] = $parity[$j + 1]; + } + + if ($feedback !== $this->blockSize) { + $parity[$this->numRoots - 1] = $this->alphaTo[$this->modNn($feedback + $this->generatorPoly[0])]; + } else { + $parity[$this->numRoots - 1] = 0; + } + } + } + + /** + * Decodes received data. + * + * @param SplFixedArray $data + * @param SplFixedArray|null $erasures + * @return null|integer + */ + public function decode(SplFixedArray $data, SplFixedArray $erasures = null) + { + // This speeds up the initialization a bit. + $numRootsPlusOne = SplFixedArray::fromArray(array_fill(0, $this->numRoots + 1, 0), false); + $numRoots = SplFixedArray::fromArray(array_fill(0, $this->numRoots, 0), false); + + $lambda = clone $numRootsPlusOne; + $b = clone $numRootsPlusOne; + $t = clone $numRootsPlusOne; + $omega = clone $numRootsPlusOne; + $root = clone $numRoots; + $loc = clone $numRoots; + + $numErasures = ($erasures !== null ? count($erasures) : 0); + + // Form the Syndromes; i.e., evaluate data(x) at roots of g(x) + $syndromes = SplFixedArray::fromArray(array_fill(0, $this->numRoots, $data[0]), false); + + for ($i = 1; $i < $this->blockSize - $this->padding; $i++) { + for ($j = 0; $j < $this->numRoots; $j++) { + if ($syndromes[$j] === 0) { + $syndromes[$j] = $data[$i]; + } else { + $syndromes[$j] = $data[$i] ^ $this->alphaTo[ + $this->modNn($this->indexOf[$syndromes[$j]] + ($this->firstRoot + $j) * $this->primitive) + ]; + } + } + } + + // Convert syndromes to index form, checking for nonzero conditions + $syndromeError = 0; + + for ($i = 0; $i < $this->numRoots; $i++) { + $syndromeError |= $syndromes[$i]; + $syndromes[$i] = $this->indexOf[$syndromes[$i]]; + } + + if (!$syndromeError) { + // If syndrome is zero, data[] is a codeword and there are no errors + // to correct, so return data[] unmodified. + return 0; + } + + $lambda[0] = 1; + + if ($numErasures > 0) { + // Init lambda to be the erasure locator polynomial + $lambda[1] = $this->alphaTo[$this->modNn($this->primitive * ($this->blockSize - 1 - $erasures[0]))]; + + for ($i = 1; $i < $numErasures; $i++) { + $u = $this->modNn($this->primitive * ($this->blockSize - 1 - $erasures[$i])); + + for ($j = $i + 1; $j > 0; $j--) { + $tmp = $this->indexOf[$lambda[$j - 1]]; + + if ($tmp !== $this->blockSize) { + $lambda[$j] = $lambda[$j] ^ $this->alphaTo[$this->modNn($u + $tmp)]; + } + } + } + } + + for ($i = 0; $i <= $this->numRoots; $i++) { + $b[$i] = $this->indexOf[$lambda[$i]]; + } + + // Begin Berlekamp-Massey algorithm to determine error+erasure locator + // polynomial + $r = $numErasures; + $el = $numErasures; + + while (++$r <= $this->numRoots) { + // Compute discrepancy at the r-th step in poly form + $discrepancyR = 0; + + for ($i = 0; $i < $r; $i++) { + if ($lambda[$i] !== 0 && $syndromes[$r - $i - 1] !== $this->blockSize) { + $discrepancyR ^= $this->alphaTo[$this->modNn($this->indexOf[$lambda[$i]] + $syndromes[$r - $i - 1])]; + } + } + + $discrepancyR = $this->indexOf[$discrepancyR]; + + if ($discrepancyR === $this->blockSize) { + $tmp = $b->toArray(); + array_unshift($tmp, $this->blockSize); + array_pop($tmp); + $b = SplFixedArray::fromArray($tmp, false); + } else { + $t[0] = $lambda[0]; + + for ($i = 0; $i < $this->numRoots; $i++) { + if ($b[$i] !== $this->blockSize) { + $t[$i + 1] = $lambda[$i + 1] ^ $this->alphaTo[$this->modNn($discrepancyR + $b[$i])]; + } else { + $t[$i + 1] = $lambda[$i + 1]; + } + } + + if (2 * $el <= $r + $numErasures - 1) { + $el = $r + $numErasures - $el; + + for ($i = 0; $i <= $this->numRoots; $i++) { + $b[$i] = ( + $lambda[$i] === 0 + ? $this->blockSize + : $this->modNn($this->indexOf[$lambda[$i]] - $discrepancyR + $this->blockSize) + ); + } + } else { + $tmp = $b->toArray(); + array_unshift($tmp, $this->blockSize); + array_pop($tmp); + $b = SplFixedArray::fromArray($tmp, false); + } + + $lambda = clone $t; + } + } + + // Convert lambda to index form and compute deg(lambda(x)) + $degLambda = 0; + + for ($i = 0; $i <= $this->numRoots; $i++) { + $lambda[$i] = $this->indexOf[$lambda[$i]]; + + if ($lambda[$i] !== $this->blockSize) { + $degLambda = $i; + } + } + + // Find roots of the error+erasure locator polynomial by Chien search. + $reg = clone $lambda; + $reg[0] = 0; + $count = 0; + + for ($i = 1, $k = $this->iPrimitive - 1; $i <= $this->blockSize; $i++, $k = $this->modNn($k + $this->iPrimitive)) { + $q = 1; + + for ($j = $degLambda; $j > 0; $j--) { + if ($reg[$j] !== $this->blockSize) { + $reg[$j] = $this->modNn($reg[$j] + $j); + $q ^= $this->alphaTo[$reg[$j]]; + } + } + + if ($q !== 0) { + // Not a root + continue; + } + + // Store root (index-form) and error location number + $root[$count] = $i; + $loc[$count] = $k; + + if (++$count === $degLambda) { + break; + } + } + + if ($degLambda !== $count) { + // deg(lambda) unequal to number of roots: uncorreactable error + // detected + return null; + } + + // Compute err+eras evaluate poly omega(x) = s(x)*lambda(x) (modulo + // x**numRoots). In index form. Also find deg(omega). + $degOmega = $degLambda - 1; + + for ($i = 0; $i <= $degOmega; $i++) { + $tmp = 0; + + for ($j = $i; $j >= 0; $j--) { + if ($syndromes[$i - $j] !== $this->blockSize && $lambda[$j] !== $this->blockSize) { + $tmp ^= $this->alphaTo[$this->modNn($syndromes[$i - $j] + $lambda[$j])]; + } + } + + $omega[$i] = $this->indexOf[$tmp]; + } + + // Compute error values in poly-form. num1 = omega(inv(X(l))), num2 = + // inv(X(l))**(firstRoot-1) and den = lambda_pr(inv(X(l))) all in poly + // form. + for ($j = $count - 1; $j >= 0; $j--) { + $num1 = 0; + + for ($i = $degOmega; $i >= 0; $i--) { + if ($omega[$i] !== $this->blockSize) { + $num1 ^= $this->alphaTo[$this->modNn($omega[$i] + $i * $root[$j])]; + } + } + + $num2 = $this->alphaTo[$this->modNn($root[$j] * ($this->firstRoot - 1) + $this->blockSize)]; + $den = 0; + + // lambda[i+1] for i even is the formal derivativelambda_pr of + // lambda[i] + for ($i = min($degLambda, $this->numRoots - 1) & ~1; $i >= 0; $i -= 2) { + if ($lambda[$i + 1] !== $this->blockSize) { + $den ^= $this->alphaTo[$this->modNn($lambda[$i + 1] + $i * $root[$j])]; + } + } + + // Apply error to data + if ($num1 !== 0 && $loc[$j] >= $this->padding) { + $data[$loc[$j] - $this->padding] = $data[$loc[$j] - $this->padding] ^ ( + $this->alphaTo[ + $this->modNn( + $this->indexOf[$num1] + $this->indexOf[$num2] + $this->blockSize - $this->indexOf[$den] + ) + ] + ); + } + } + + if ($erasures !== null) { + if (count($erasures) < $count) { + $erasures->setSize($count); + } + + for ($i = 0; $i < $count; $i++) { + $erasures[$i] = $loc[$i]; + } + } + + return $count; + } + + /** + * Computes $x % GF_SIZE, where GF_SIZE is 2**GF_BITS - 1, without a slow + * divide. + * + * @param itneger $x + * @return integer + */ + protected function modNn($x) + { + while ($x >= $this->blockSize) { + $x -= $this->blockSize; + $x = ($x >> $this->symbolSize) + ($x & $this->blockSize); + } + + return $x; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/Version.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/Version.php new file mode 100755 index 0000000..d698639 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Common/Version.php @@ -0,0 +1,687 @@ +versionNumber = $versionNumber; + $this->alignmentPatternCenters = $alignmentPatternCenters; + $this->errorCorrectionBlocks = $ecBlocks; + + $totalCodewords = 0; + $ecCodewords = $ecBlocks[0]->getEcCodewordsPerBlock(); + + foreach ($ecBlocks[0]->getEcBlocks() as $ecBlock) { + $totalCodewords += $ecBlock->getCount() * ($ecBlock->getDataCodewords() + $ecCodewords); + } + + $this->totalCodewords = $totalCodewords; + } + + /** + * Gets the version number. + * + * @return integer + */ + public function getVersionNumber() + { + return $this->versionNumber; + } + + /** + * Gets the alignment pattern centers. + * + * @return SplFixedArray + */ + public function getAlignmentPatternCenters() + { + return $this->alignmentPatternCenters; + } + + /** + * Gets the total number of codewords. + * + * @return integer + */ + public function getTotalCodewords() + { + return $this->totalCodewords; + } + + /** + * Gets the dimension for the current version. + * + * @return integer + */ + public function getDimensionForVersion() + { + return 17 + 4 * $this->versionNumber; + } + + /** + * Gets the number of EC blocks for a specific EC level. + * + * @param ErrorCorrectionLevel $ecLevel + * @return integer + */ + public function getEcBlocksForLevel(ErrorCorrectionLevel $ecLevel) + { + return $this->errorCorrectionBlocks[$ecLevel->getOrdinal()]; + } + + /** + * Gets a provisional version number for a specific dimension. + * + * @param integer $dimension + * @return Version + * @throws Exception\InvalidArgumentException + */ + public static function getProvisionalVersionForDimension($dimension) + { + if ($dimension % 4 !== 1) { + throw new Exception\InvalidArgumentException('Dimension is not 1 mod 4'); + } + + return self::getVersionForNumber(($dimension - 17) >> 2); + } + + /** + * Gets a version instance for a specific version number. + * + * @param integer $versionNumber + * @return Version + * @throws Exception\InvalidArgumentException + */ + public static function getVersionForNumber($versionNumber) + { + if ($versionNumber < 1 || $versionNumber > 40) { + throw new Exception\InvalidArgumentException('Version number must be between 1 and 40'); + } + + if (!isset(self::$versions[$versionNumber])) { + self::buildVersion($versionNumber); + } + + return self::$versions[$versionNumber - 1]; + } + + /** + * Decodes version information from an integer and returns the version. + * + * @param integer $versionBits + * @return Version|null + */ + public static function decodeVersionInformation($versionBits) + { + $bestDifference = PHP_INT_MAX; + $bestVersion = 0; + + foreach (self::$versionDecodeInfo as $i => $targetVersion) { + if ($targetVersion === $versionBits) { + return self::getVersionForNumber($i + 7); + } + + $bitsDifference = FormatInformation::numBitsDiffering($versionBits, $targetVersion); + + if ($bitsDifference < $bestDifference) { + $bestVersion = $i + 7; + $bestDifference = $bitsDifference; + } + } + + if ($bestDifference <= 3) { + return self::getVersionForNumber($bestVersion); + } + + return null; + } + + /** + * Builds the function pattern for the current version. + * + * @return BitMatrix + */ + public function buildFunctionPattern() + { + $dimension = $this->getDimensionForVersion(); + $bitMatrix = new BitMatrix($dimension); + + // Top left finder pattern + separator + format + $bitMatrix->setRegion(0, 0, 9, 9); + // Top right finder pattern + separator + format + $bitMatrix->setRegion($dimension - 8, 0, 8, 9); + // Bottom left finder pattern + separator + format + $bitMatrix->setRegion(0, $dimension - 8, 9, 8); + + // Alignment patterns + $max = count($this->alignmentPatternCenters); + + for ($x = 0; $x < $max; $x++) { + $i = $this->alignmentPatternCenters[$x] - 2; + + for ($y = 0; $y < $max; $y++) { + if (($x === 0 && ($y === 0 || $y === $max - 1)) || ($x === $max - 1 && $y === 0)) { + // No alignment patterns near the three finder paterns + continue; + } + + $bitMatrix->setRegion($this->alignmentPatternCenters[$y] - 2, $i, 5, 5); + } + } + + // Vertical timing pattern + $bitMatrix->setRegion(6, 9, 1, $dimension - 17); + // Horizontal timing pattern + $bitMatrix->setRegion(9, 6, $dimension - 17, 1); + + if ($this->versionNumber > 6) { + // Version info, top right + $bitMatrix->setRegion($dimension - 11, 0, 3, 6); + // Version info, bottom left + $bitMatrix->setRegion(0, $dimension - 11, 6, 3); + } + + return $bitMatrix; + } + + /** + * Returns a string representation for the version. + * + * @return string + */ + public function __toString() + { + return (string) $this->versionNumber; + } + + /** + * Build and cache a specific version. + * + * See ISO 18004:2006 6.5.1 Table 9. + * + * @param integer $versionNumber + * @return void + */ + protected static function buildVersion($versionNumber) + { + switch ($versionNumber) { + case 1: + $patterns = array(); + $ecBlocks = array( + new EcBlocks(7, new EcBlock(1, 19)), + new EcBlocks(10, new EcBlock(1, 16)), + new EcBlocks(13, new EcBlock(1, 13)), + new EcBlocks(17, new EcBlock(1, 9)), + ); + break; + + case 2: + $patterns = array(6, 18); + $ecBlocks = array( + new EcBlocks(10, new EcBlock(1, 34)), + new EcBlocks(16, new EcBlock(1, 28)), + new EcBlocks(22, new EcBlock(1, 22)), + new EcBlocks(28, new EcBlock(1, 16)), + ); + break; + + case 3: + $patterns = array(6, 22); + $ecBlocks = array( + new EcBlocks(15, new EcBlock(1, 55)), + new EcBlocks(26, new EcBlock(1, 44)), + new EcBlocks(18, new EcBlock(2, 17)), + new EcBlocks(22, new EcBlock(2, 13)), + ); + break; + + case 4: + $patterns = array(6, 26); + $ecBlocks = array( + new EcBlocks(20, new EcBlock(1, 80)), + new EcBlocks(18, new EcBlock(2, 32)), + new EcBlocks(26, new EcBlock(3, 24)), + new EcBlocks(16, new EcBlock(4, 9)), + ); + break; + + case 5: + $patterns = array(6, 30); + $ecBlocks = array( + new EcBlocks(26, new EcBlock(1, 108)), + new EcBlocks(24, new EcBlock(2, 43)), + new EcBlocks(18, new EcBlock(2, 15), new EcBlock(2, 16)), + new EcBlocks(22, new EcBlock(2, 11), new EcBlock(2, 12)), + ); + break; + + case 6: + $patterns = array(6, 34); + $ecBlocks = array( + new EcBlocks(18, new EcBlock(2, 68)), + new EcBlocks(16, new EcBlock(4, 27)), + new EcBlocks(24, new EcBlock(4, 19)), + new EcBlocks(28, new EcBlock(4, 15)), + ); + break; + + case 7: + $patterns = array(6, 22, 38); + $ecBlocks = array( + new EcBlocks(20, new EcBlock(2, 78)), + new EcBlocks(18, new EcBlock(4, 31)), + new EcBlocks(18, new EcBlock(2, 14), new EcBlock(4, 15)), + new EcBlocks(26, new EcBlock(4, 13), new EcBlock(1, 14)), + ); + break; + + case 8: + $patterns = array(6, 24, 42); + $ecBlocks = array( + new EcBlocks(24, new EcBlock(2, 97)), + new EcBlocks(22, new EcBlock(2, 38), new EcBlock(2, 39)), + new EcBlocks(22, new EcBlock(4, 18), new EcBlock(2, 19)), + new EcBlocks(26, new EcBlock(4, 14), new EcBlock(2, 15)), + ); + break; + + case 9: + $patterns = array(6, 26, 46); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(2, 116)), + new EcBlocks(22, new EcBlock(3, 36), new EcBlock(2, 37)), + new EcBlocks(20, new EcBlock(4, 16), new EcBlock(4, 17)), + new EcBlocks(24, new EcBlock(4, 12), new EcBlock(4, 13)), + ); + break; + + case 10: + $patterns = array(6, 28, 50); + $ecBlocks = array( + new EcBlocks(18, new EcBlock(2, 68), new EcBlock(2, 69)), + new EcBlocks(26, new EcBlock(4, 43), new EcBlock(1, 44)), + new EcBlocks(24, new EcBlock(6, 19), new EcBlock(2, 20)), + new EcBlocks(28, new EcBlock(6, 15), new EcBlock(2, 16)), + ); + break; + + case 11: + $patterns = array(6, 30, 54); + $ecBlocks = array( + new EcBlocks(20, new EcBlock(4, 81)), + new EcBlocks(30, new EcBlock(1, 50), new EcBlock(4, 51)), + new EcBlocks(28, new EcBlock(4, 22), new EcBlock(4, 23)), + new EcBlocks(24, new EcBlock(3, 12), new EcBlock(8, 13)), + ); + break; + + case 12: + $patterns = array(6, 32, 58); + $ecBlocks = array( + new EcBlocks(24, new EcBlock(2, 92), new EcBlock(2, 93)), + new EcBlocks(22, new EcBlock(6, 36), new EcBlock(2, 37)), + new EcBlocks(26, new EcBlock(4, 20), new EcBlock(6, 21)), + new EcBlocks(28, new EcBlock(7, 14), new EcBlock(4, 15)), + ); + break; + + case 13: + $patterns = array(6, 34, 62); + $ecBlocks = array( + new EcBlocks(26, new EcBlock(4, 107)), + new EcBlocks(22, new EcBlock(8, 37), new EcBlock(1, 38)), + new EcBlocks(24, new EcBlock(8, 20), new EcBlock(4, 21)), + new EcBlocks(22, new EcBlock(12, 11), new EcBlock(4, 12)), + ); + break; + + case 14: + $patterns = array(6, 26, 46, 66); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(3, 115), new EcBlock(1, 116)), + new EcBlocks(24, new EcBlock(4, 40), new EcBlock(5, 41)), + new EcBlocks(20, new EcBlock(11, 16), new EcBlock(5, 17)), + new EcBlocks(24, new EcBlock(11, 12), new EcBlock(5, 13)), + ); + break; + + case 15: + $patterns = array(6, 26, 48, 70); + $ecBlocks = array( + new EcBlocks(22, new EcBlock(5, 87), new EcBlock(1, 88)), + new EcBlocks(24, new EcBlock(5, 41), new EcBlock(5, 42)), + new EcBlocks(30, new EcBlock(5, 24), new EcBlock(7, 25)), + new EcBlocks(24, new EcBlock(11, 12), new EcBlock(7, 13)), + ); + break; + + case 16: + $patterns = array(6, 26, 50, 74); + $ecBlocks = array( + new EcBlocks(24, new EcBlock(5, 98), new EcBlock(1, 99)), + new EcBlocks(28, new EcBlock(7, 45), new EcBlock(3, 46)), + new EcBlocks(24, new EcBlock(15, 19), new EcBlock(2, 20)), + new EcBlocks(30, new EcBlock(3, 15), new EcBlock(13, 16)), + ); + break; + + case 17: + $patterns = array(6, 30, 54, 78); + $ecBlocks = array( + new EcBlocks(28, new EcBlock(1, 107), new EcBlock(5, 108)), + new EcBlocks(28, new EcBlock(10, 46), new EcBlock(1, 47)), + new EcBlocks(28, new EcBlock(1, 22), new EcBlock(15, 23)), + new EcBlocks(28, new EcBlock(2, 14), new EcBlock(17, 15)), + ); + break; + + case 18: + $patterns = array(6, 30, 56, 82); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(5, 120), new EcBlock(1, 121)), + new EcBlocks(26, new EcBlock(9, 43), new EcBlock(4, 44)), + new EcBlocks(28, new EcBlock(17, 22), new EcBlock(1, 23)), + new EcBlocks(28, new EcBlock(2, 14), new EcBlock(19, 15)), + ); + break; + + case 19: + $patterns = array(6, 30, 58, 86); + $ecBlocks = array( + new EcBlocks(28, new EcBlock(3, 113), new EcBlock(4, 114)), + new EcBlocks(26, new EcBlock(3, 44), new EcBlock(11, 45)), + new EcBlocks(26, new EcBlock(17, 21), new EcBlock(4, 22)), + new EcBlocks(26, new EcBlock(9, 13), new EcBlock(16, 14)), + ); + break; + + case 20: + $patterns = array(6, 34, 62, 90); + $ecBlocks = array( + new EcBlocks(28, new EcBlock(3, 107), new EcBlock(5, 108)), + new EcBlocks(26, new EcBlock(3, 41), new EcBlock(13, 42)), + new EcBlocks(30, new EcBlock(15, 24), new EcBlock(5, 25)), + new EcBlocks(28, new EcBlock(15, 15), new EcBlock(10, 16)), + ); + break; + + case 21: + $patterns = array(6, 28, 50, 72, 94); + $ecBlocks = array( + new EcBlocks(28, new EcBlock(4, 116), new EcBlock(4, 117)), + new EcBlocks(26, new EcBlock(17, 42)), + new EcBlocks(28, new EcBlock(17, 22), new EcBlock(6, 23)), + new EcBlocks(30, new EcBlock(19, 16), new EcBlock(6, 17)), + ); + break; + + case 22: + $patterns = array(6, 26, 50, 74, 98); + $ecBlocks = array( + new EcBlocks(28, new EcBlock(2, 111), new EcBlock(7, 112)), + new EcBlocks(28, new EcBlock(17, 46)), + new EcBlocks(30, new EcBlock(7, 24), new EcBlock(16, 25)), + new EcBlocks(24, new EcBlock(34, 13)), + ); + break; + + case 23: + $patterns = array(6, 30, 54, 78, 102); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(4, 121), new EcBlock(5, 122)), + new EcBlocks(28, new EcBlock(4, 47), new EcBlock(14, 48)), + new EcBlocks(30, new EcBlock(11, 24), new EcBlock(14, 25)), + new EcBlocks(30, new EcBlock(16, 15), new EcBlock(14, 16)), + ); + break; + + case 24: + $patterns = array(6, 28, 54, 80, 106); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(6, 117), new EcBlock(4, 118)), + new EcBlocks(28, new EcBlock(6, 45), new EcBlock(14, 46)), + new EcBlocks(30, new EcBlock(11, 24), new EcBlock(16, 25)), + new EcBlocks(30, new EcBlock(30, 16), new EcBlock(2, 17)), + ); + break; + + case 25: + $patterns = array(6, 32, 58, 84, 110); + $ecBlocks = array( + new EcBlocks(26, new EcBlock(8, 106), new EcBlock(4, 107)), + new EcBlocks(28, new EcBlock(8, 47), new EcBlock(13, 48)), + new EcBlocks(30, new EcBlock(7, 24), new EcBlock(22, 25)), + new EcBlocks(30, new EcBlock(22, 15), new EcBlock(13, 16)), + ); + break; + + case 26: + $patterns = array(6, 30, 58, 86, 114); + $ecBlocks = array( + new EcBlocks(28, new EcBlock(10, 114), new EcBlock(2, 115)), + new EcBlocks(28, new EcBlock(19, 46), new EcBlock(4, 47)), + new EcBlocks(28, new EcBlock(28, 22), new EcBlock(6, 23)), + new EcBlocks(30, new EcBlock(33, 16), new EcBlock(4, 17)), + ); + break; + + case 27: + $patterns = array(6, 34, 62, 90, 118); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(8, 122), new EcBlock(4, 123)), + new EcBlocks(28, new EcBlock(22, 45), new EcBlock(3, 46)), + new EcBlocks(30, new EcBlock(8, 23), new EcBlock(26, 24)), + new EcBlocks(30, new EcBlock(12, 15), new EcBlock(28, 16)), + ); + break; + + case 28: + $patterns = array(6, 26, 50, 74, 98, 122); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(3, 117), new EcBlock(10, 118)), + new EcBlocks(28, new EcBlock(3, 45), new EcBlock(23, 46)), + new EcBlocks(30, new EcBlock(4, 24), new EcBlock(31, 25)), + new EcBlocks(30, new EcBlock(11, 15), new EcBlock(31, 16)), + ); + break; + + case 29: + $patterns = array(6, 30, 54, 78, 102, 126); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(7, 116), new EcBlock(7, 117)), + new EcBlocks(28, new EcBlock(21, 45), new EcBlock(7, 46)), + new EcBlocks(30, new EcBlock(1, 23), new EcBlock(37, 24)), + new EcBlocks(30, new EcBlock(19, 15), new EcBlock(26, 16)), + ); + break; + + case 30: + $patterns = array(6, 26, 52, 78, 104, 130); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(5, 115), new EcBlock(10, 116)), + new EcBlocks(28, new EcBlock(19, 47), new EcBlock(10, 48)), + new EcBlocks(30, new EcBlock(15, 24), new EcBlock(25, 25)), + new EcBlocks(30, new EcBlock(23, 15), new EcBlock(25, 16)), + ); + break; + + case 31: + $patterns = array(6, 30, 56, 82, 108, 134); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(13, 115), new EcBlock(3, 116)), + new EcBlocks(28, new EcBlock(2, 46), new EcBlock(29, 47)), + new EcBlocks(30, new EcBlock(42, 24), new EcBlock(1, 25)), + new EcBlocks(30, new EcBlock(23, 15), new EcBlock(28, 16)), + ); + break; + + case 32: + $patterns = array(6, 34, 60, 86, 112, 138); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(17, 115)), + new EcBlocks(28, new EcBlock(10, 46), new EcBlock(23, 47)), + new EcBlocks(30, new EcBlock(10, 24), new EcBlock(35, 25)), + new EcBlocks(30, new EcBlock(19, 15), new EcBlock(35, 16)), + ); + break; + + case 33: + $patterns = array(6, 30, 58, 86, 114, 142); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(17, 115), new EcBlock(1, 116)), + new EcBlocks(28, new EcBlock(14, 46), new EcBlock(21, 47)), + new EcBlocks(30, new EcBlock(29, 24), new EcBlock(19, 25)), + new EcBlocks(30, new EcBlock(11, 15), new EcBlock(46, 16)), + ); + break; + + case 34: + $patterns = array(6, 34, 62, 90, 118, 146); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(13, 115), new EcBlock(6, 116)), + new EcBlocks(28, new EcBlock(14, 46), new EcBlock(23, 47)), + new EcBlocks(30, new EcBlock(44, 24), new EcBlock(7, 25)), + new EcBlocks(30, new EcBlock(59, 16), new EcBlock(1, 17)), + ); + break; + + case 35: + $patterns = array(6, 30, 54, 78, 102, 126, 150); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(12, 121), new EcBlock(7, 122)), + new EcBlocks(28, new EcBlock(12, 47), new EcBlock(26, 48)), + new EcBlocks(30, new EcBlock(39, 24), new EcBlock(14, 25)), + new EcBlocks(30, new EcBlock(22, 15), new EcBlock(41, 16)), + ); + break; + + case 36: + $patterns = array(6, 24, 50, 76, 102, 128, 154); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(6, 121), new EcBlock(14, 122)), + new EcBlocks(28, new EcBlock(6, 47), new EcBlock(34, 48)), + new EcBlocks(30, new EcBlock(46, 24), new EcBlock(10, 25)), + new EcBlocks(30, new EcBlock(2, 15), new EcBlock(64, 16)), + ); + break; + + case 37: + $patterns = array(6, 28, 54, 80, 106, 132, 158); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(17, 122), new EcBlock(4, 123)), + new EcBlocks(28, new EcBlock(29, 46), new EcBlock(14, 47)), + new EcBlocks(30, new EcBlock(49, 24), new EcBlock(10, 25)), + new EcBlocks(30, new EcBlock(24, 15), new EcBlock(46, 16)), + ); + break; + + case 38: + $patterns = array(6, 32, 58, 84, 110, 136, 162); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(4, 122), new EcBlock(18, 123)), + new EcBlocks(28, new EcBlock(13, 46), new EcBlock(32, 47)), + new EcBlocks(30, new EcBlock(48, 24), new EcBlock(14, 25)), + new EcBlocks(30, new EcBlock(42, 15), new EcBlock(32, 16)), + ); + break; + + case 39: + $patterns = array(6, 26, 54, 82, 110, 138, 166); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(20, 117), new EcBlock(4, 118)), + new EcBlocks(28, new EcBlock(40, 47), new EcBlock(7, 48)), + new EcBlocks(30, new EcBlock(43, 24), new EcBlock(22, 25)), + new EcBlocks(30, new EcBlock(10, 15), new EcBlock(67, 16)), + ); + break; + + case 40: + $patterns = array(6, 30, 58, 86, 114, 142, 170); + $ecBlocks = array( + new EcBlocks(30, new EcBlock(19, 118), new EcBlock(6, 119)), + new EcBlocks(28, new EcBlock(18, 47), new EcBlock(31, 48)), + new EcBlocks(30, new EcBlock(34, 24), new EcBlock(34, 25)), + new EcBlocks(30, new EcBlock(20, 15), new EcBlock(61, 16)), + ); + break; + } + + self::$versions[$versionNumber - 1] = new self( + $versionNumber, + SplFixedArray::fromArray($patterns, false), + SplFixedArray::fromArray($ecBlocks, false) + ); + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/BlockPair.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/BlockPair.php new file mode 100755 index 0000000..090db29 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/BlockPair.php @@ -0,0 +1,64 @@ +dataBytes = $data; + $this->errorCorrectionBytes = $errorCorrection; + } + + /** + * Gets the data bytes. + * + * @return SplFixedArray + */ + public function getDataBytes() + { + return $this->dataBytes; + } + + /** + * Gets the error correction bytes. + * + * @return SplFixedArray + */ + public function getErrorCorrectionBytes() + { + return $this->errorCorrectionBytes; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/ByteMatrix.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/ByteMatrix.php new file mode 100755 index 0000000..a378f08 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/ByteMatrix.php @@ -0,0 +1,158 @@ +height = $height; + $this->width = $width; + $this->bytes = new SplFixedArray($height); + + for ($y = 0; $y < $height; $y++) { + $this->bytes[$y] = new SplFixedArray($width); + } + } + + /** + * Gets the width of the matrix. + * + * @return integer + */ + public function getWidth() + { + return $this->width; + } + + /** + * Gets the height of the matrix. + * + * @return integer + */ + public function getHeight() + { + return $this->height; + } + + /** + * Gets the internal representation of the matrix. + * + * @return SplFixedArray + */ + public function getArray() + { + return $this->bytes; + } + + /** + * Gets the byte for a specific position. + * + * @param integer $x + * @param integer $y + * @return integer + */ + public function get($x, $y) + { + return $this->bytes[$y][$x]; + } + + /** + * Sets the byte for a specific position. + * + * @param integer $x + * @param integer $y + * @param integer $value + * @return void + */ + public function set($x, $y, $value) + { + $this->bytes[$y][$x] = (int) $value; + } + + /** + * Clears the matrix with a specific value. + * + * @param integer $value + * @return void + */ + public function clear($value) + { + for ($y = 0; $y < $this->height; $y++) { + for ($x = 0; $x < $this->width; $x++) { + $this->bytes[$y][$x] = $value; + } + } + } + + /** + * Returns a string representation of the matrix. + * + * @return string + */ + public function __toString() + { + $result = ''; + + for ($y = 0; $y < $this->height; $y++) { + for ($x = 0; $x < $this->width; $x++) { + switch ($this->bytes[$y][$x]) { + case 0: + $result .= ' 0'; + break; + + case 1: + $result .= ' 1'; + break; + + default: + $result .= ' '; + break; + } + } + + $result .= "\n"; + } + + return $result; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/Encoder.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/Encoder.php new file mode 100755 index 0000000..c8efc35 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/Encoder.php @@ -0,0 +1,687 @@ +get() === Mode::BYTE && $encoding !== self::DEFAULT_BYTE_MODE_ECODING) { + $eci = CharacterSetEci::getCharacterSetEciByName($encoding); + + if ($eci !== null) { + self::appendEci($eci, $headerBits); + } + } + + // (With ECI in place,) Write the mode marker + self::appendModeInfo($mode, $headerBits); + + // Collect data within the main segment, separately, to count its size + // if needed. Don't add it to main payload yet. + $dataBits = new BitArray(); + self::appendBytes($content, $mode, $dataBits, $encoding); + + // Hard part: need to know version to know how many bits length takes. + // But need to know how many bits it takes to know version. First we + // take a guess at version by assuming version will be the minimum, 1: + $provisionalBitsNeeded = $headerBits->getSize() + + $mode->getCharacterCountBits(Version::getVersionForNumber(1)) + + $dataBits->getSize(); + $provisionalVersion = self::chooseVersion($provisionalBitsNeeded, $ecLevel); + + // Use that guess to calculate the right version. I am still not sure + // this works in 100% of cases. + $bitsNeeded = $headerBits->getSize() + + $mode->getCharacterCountBits($provisionalVersion) + + $dataBits->getSize(); + $version = self::chooseVersion($bitsNeeded, $ecLevel); + + $headerAndDataBits = new BitArray(); + $headerAndDataBits->appendBitArray($headerBits); + + // Find "length" of main segment and write it. + $numLetters = ($mode->get() === Mode::BYTE ? $dataBits->getSizeInBytes() : strlen($content)); + self::appendLengthInfo($numLetters, $version, $mode, $headerAndDataBits); + + // Put data together into the overall payload. + $headerAndDataBits->appendBitArray($dataBits); + $ecBlocks = $version->getEcBlocksForLevel($ecLevel); + $numDataBytes = $version->getTotalCodewords() - $ecBlocks->getTotalEcCodewords(); + + // Terminate the bits properly. + self::terminateBits($numDataBytes, $headerAndDataBits); + + // Interleave data bits with error correction code. + $finalBits = self::interleaveWithEcBytes( + $headerAndDataBits, + $version->getTotalCodewords(), + $numDataBytes, + $ecBlocks->getNumBlocks() + ); + + $qrCode = new QrCode(); + $qrCode->setErrorCorrectionLevel($ecLevel); + $qrCode->setMode($mode); + $qrCode->setVersion($version); + + // Choose the mask pattern and set to "qrCode". + $dimension = $version->getDimensionForVersion(); + $matrix = new ByteMatrix($dimension, $dimension); + $maskPattern = self::chooseMaskPattern($finalBits, $ecLevel, $version, $matrix); + $qrCode->setMaskPattern($maskPattern); + + // Build the matrix and set it to "qrCode". + MatrixUtil::buildMatrix($finalBits, $ecLevel, $version, $maskPattern, $matrix); + $qrCode->setMatrix($matrix); + + return $qrCode; + } + + /** + * Gets the alphanumeric code for a byte. + * + * @param string|integer $code + * @return integer + */ + protected static function getAlphanumericCode($code) + { + $code = (is_string($code) ? ord($code) : $code); + + if (isset(self::$alphanumericTable[$code])) { + return self::$alphanumericTable[$code]; + } + + return -1; + } + + /** + * Chooses the best mode for a given content. + * + * @param string $content + * @param string $encoding + * @return Mode + */ + protected static function chooseMode($content, $encoding = null) + { + if (strcasecmp($encoding, 'SHIFT-JIS') === 0) { + return self::isOnlyDoubleByteKanji($content) ? new Mode(Mode::KANJI) : new Mode(Mode::BYTE); + } + + $hasNumeric = false; + $hasAlphanumeric = false; + $contentLength = strlen($content); + + for ($i = 0; $i < $contentLength; $i++) { + $char = $content[$i]; + + if (ctype_digit($char)) { + $hasNumeric = true; + } elseif (self::getAlphanumericCode($char) !== -1) { + $hasAlphanumeric = true; + } else { + return new Mode(Mode::BYTE); + } + } + + if ($hasAlphanumeric) { + return new Mode(Mode::ALPHANUMERIC); + } elseif ($hasNumeric) { + return new Mode(Mode::NUMERIC); + } + + return new Mode(Mode::BYTE); + } + + /** + * Calculates the mask penalty for a matrix. + * + * @param ByteMatrix $matrix + * @return integer + */ + protected static function calculateMaskPenalty(ByteMatrix $matrix) + { + return ( + MaskUtil::applyMaskPenaltyRule1($matrix) + + MaskUtil::applyMaskPenaltyRule2($matrix) + + MaskUtil::applyMaskPenaltyRule3($matrix) + + MaskUtil::applyMaskPenaltyRule4($matrix) + ); + } + + /** + * Chooses the best mask pattern for a matrix. + * + * @param BitArray $bits + * @param ErrorCorrectionLevel $ecLevel + * @param Version $version + * @param ByteMatrix $matrix + * @return integer + */ + protected static function chooseMaskPattern( + BitArray $bits, + ErrorCorrectionLevel $ecLevel, + Version $version, + ByteMatrix $matrix + ) { + $minPenality = PHP_INT_MAX; + $bestMaskPattern = -1; + + for ($maskPattern = 0; $maskPattern < QrCode::NUM_MASK_PATTERNS; $maskPattern++) { + MatrixUtil::buildMatrix($bits, $ecLevel, $version, $maskPattern, $matrix); + $penalty = self::calculateMaskPenalty($matrix); + + if ($penalty < $minPenality) { + $minPenality = $penalty; + $bestMaskPattern = $maskPattern; + } + } + + return $bestMaskPattern; + } + + /** + * Chooses the best version for the input. + * + * @param integer $numInputBits + * @param ErrorCorrectionLevel $ecLevel + * @return Version + * @throws Exception\WriterException + */ + protected static function chooseVersion($numInputBits, ErrorCorrectionLevel $ecLevel) + { + for ($versionNum = 1; $versionNum <= 40; $versionNum++) { + $version = Version::getVersionForNumber($versionNum); + $numBytes = $version->getTotalCodewords(); + + $ecBlocks = $version->getEcBlocksForLevel($ecLevel); + $numEcBytes = $ecBlocks->getTotalEcCodewords(); + + $numDataBytes = $numBytes - $numEcBytes; + $totalInputBytes = intval(($numInputBits + 8) / 8); + + if ($numDataBytes >= $totalInputBytes) { + return $version; + } + } + + throw new Exception\WriterException('Data too big'); + } + + /** + * Terminates the bits in a bit array. + * + * @param integer $numDataBytes + * @param BitArray $bits + * @throws Exception\WriterException + */ + protected static function terminateBits($numDataBytes, BitArray $bits) + { + $capacity = $numDataBytes << 3; + + if ($bits->getSize() > $capacity) { + throw new Exception\WriterException('Data bits cannot fit in the QR code'); + } + + for ($i = 0; $i < 4 && $bits->getSize() < $capacity; $i++) { + $bits->appendBit(false); + } + + $numBitsInLastByte = $bits->getSize() & 0x7; + + if ($numBitsInLastByte > 0) { + for ($i = $numBitsInLastByte; $i < 8; $i++) { + $bits->appendBit(false); + } + } + + $numPaddingBytes = $numDataBytes - $bits->getSizeInBytes(); + + for ($i = 0; $i < $numPaddingBytes; $i++) { + $bits->appendBits(($i & 0x1) === 0 ? 0xec : 0x11, 8); + } + + if ($bits->getSize() !== $capacity) { + throw new Exception\WriterException('Bits size does not equal capacity'); + } + } + + /** + * Gets number of data- and EC bytes for a block ID. + * + * @param integer $numTotalBytes + * @param integer $numDataBytes + * @param integer $numRsBlocks + * @param integer $blockId + * @return array + * @throws Exception\WriterException + */ + protected static function getNumDataBytesAndNumEcBytesForBlockId( + $numTotalBytes, + $numDataBytes, + $numRsBlocks, + $blockId + ) { + if ($blockId >= $numRsBlocks) { + throw new Exception\WriterException('Block ID too large'); + } + + $numRsBlocksInGroup2 = $numTotalBytes % $numRsBlocks; + $numRsBlocksInGroup1 = $numRsBlocks - $numRsBlocksInGroup2; + $numTotalBytesInGroup1 = intval($numTotalBytes / $numRsBlocks); + $numTotalBytesInGroup2 = $numTotalBytesInGroup1 + 1; + $numDataBytesInGroup1 = intval($numDataBytes / $numRsBlocks); + $numDataBytesInGroup2 = $numDataBytesInGroup1 + 1; + $numEcBytesInGroup1 = $numTotalBytesInGroup1 - $numDataBytesInGroup1; + $numEcBytesInGroup2 = $numTotalBytesInGroup2 - $numDataBytesInGroup2; + + if ($numEcBytesInGroup1 !== $numEcBytesInGroup2) { + throw new Exception\WriterException('EC bytes mismatch'); + } + + if ($numRsBlocks !== $numRsBlocksInGroup1 + $numRsBlocksInGroup2) { + throw new Exception\WriterException('RS blocks mismatch'); + } + + if ($numTotalBytes !== + (($numDataBytesInGroup1 + $numEcBytesInGroup1) * $numRsBlocksInGroup1) + + (($numDataBytesInGroup2 + $numEcBytesInGroup2) * $numRsBlocksInGroup2) + ) { + throw new Exception\WriterException('Total bytes mismatch'); + } + + if ($blockId < $numRsBlocksInGroup1) { + return array($numDataBytesInGroup1, $numEcBytesInGroup1); + } else { + return array($numDataBytesInGroup2, $numEcBytesInGroup2); + } + } + + /** + * Interleaves data with EC bytes. + * + * @param BitArray $bits + * @param integer $numTotalBytes + * @param integer $numDataBytes + * @param integer $numRsBlocks + * @return BitArray + * @throws Exception\WriterException + */ + protected static function interleaveWithEcBytes(BitArray $bits, $numTotalBytes, $numDataBytes, $numRsBlocks) + { + if ($bits->getSizeInBytes() !== $numDataBytes) { + throw new Exception\WriterException('Number of bits and data bytes does not match'); + } + + $dataBytesOffset = 0; + $maxNumDataBytes = 0; + $maxNumEcBytes = 0; + + $blocks = new SplFixedArray($numRsBlocks); + + for ($i = 0; $i < $numRsBlocks; $i++) { + list($numDataBytesInBlock, $numEcBytesInBlock) = self::getNumDataBytesAndNumEcBytesForBlockId( + $numTotalBytes, + $numDataBytes, + $numRsBlocks, + $i + ); + + $size = $numDataBytesInBlock; + $dataBytes = $bits->toBytes(8 * $dataBytesOffset, $size); + $ecBytes = self::generateEcBytes($dataBytes, $numEcBytesInBlock); + $blocks[$i] = new BlockPair($dataBytes, $ecBytes); + + $maxNumDataBytes = max($maxNumDataBytes, $size); + $maxNumEcBytes = max($maxNumEcBytes, count($ecBytes)); + $dataBytesOffset += $numDataBytesInBlock; + } + + if ($numDataBytes !== $dataBytesOffset) { + throw new Exception\WriterException('Data bytes does not match offset'); + } + + $result = new BitArray(); + + for ($i = 0; $i < $maxNumDataBytes; $i++) { + foreach ($blocks as $block) { + $dataBytes = $block->getDataBytes(); + + if ($i < count($dataBytes)) { + $result->appendBits($dataBytes[$i], 8); + } + } + } + + for ($i = 0; $i < $maxNumEcBytes; $i++) { + foreach ($blocks as $block) { + $ecBytes = $block->getErrorCorrectionBytes(); + + if ($i < count($ecBytes)) { + $result->appendBits($ecBytes[$i], 8); + } + } + } + + if ($numTotalBytes !== $result->getSizeInBytes()) { + throw new Exception\WriterException('Interleaving error: ' . $numTotalBytes . ' and ' . $result->getSizeInBytes() . ' differ'); + } + + return $result; + } + + /** + * Generates EC bytes for given data. + * + * @param SplFixedArray $dataBytes + * @param integer $numEcBytesInBlock + * @return SplFixedArray + */ + protected static function generateEcBytes(SplFixedArray $dataBytes, $numEcBytesInBlock) + { + $numDataBytes = count($dataBytes); + $toEncode = new SplFixedArray($numDataBytes + $numEcBytesInBlock); + + for ($i = 0; $i < $numDataBytes; $i++) { + $toEncode[$i] = $dataBytes[$i] & 0xff; + } + + $ecBytes = new SplFixedArray($numEcBytesInBlock); + $codec = self::getCodec($numDataBytes, $numEcBytesInBlock); + $codec->encode($toEncode, $ecBytes); + + return $ecBytes; + } + + /** + * Gets an RS codec and caches it. + * + * @param integer $numDataBytes + * @param integer $numEcBytesInBlock + * @return ReedSolomonCodec + */ + protected static function getCodec($numDataBytes, $numEcBytesInBlock) + { + $cacheId = $numDataBytes . '-' . $numEcBytesInBlock; + + if (!isset(self::$codecs[$cacheId])) { + self::$codecs[$cacheId] = new ReedSolomonCodec( + 8, + 0x11d, + 0, + 1, + $numEcBytesInBlock, + 255 - $numDataBytes - $numEcBytesInBlock + ); + } + + return self::$codecs[$cacheId]; + } + + /** + * Appends mode information to a bit array. + * + * @param Mode $mode + * @param BitArray $bits + * @return void + */ + protected static function appendModeInfo(Mode $mode, BitArray $bits) + { + $bits->appendBits($mode->get(), 4); + } + + /** + * Appends length information to a bit array. + * + * @param integer $numLetters + * @param Version $version + * @param Mode $mode + * @param BitArray $bits + * @return void + * @throws Exception\WriterException + */ + protected static function appendLengthInfo($numLetters, Version $version, Mode $mode, BitArray $bits) + { + $numBits = $mode->getCharacterCountBits($version); + + if ($numLetters >= (1 << $numBits)) { + throw new Exception\WriterException($numLetters . ' is bigger than ' . ((1 << $numBits) - 1)); + } + + $bits->appendBits($numLetters, $numBits); + } + + /** + * Appends bytes to a bit array in a specific mode. + * + * @param stirng $content + * @param Mode $mode + * @param BitArray $bits + * @param string $encoding + * @return void + * @throws Exception\WriterException + */ + protected static function appendBytes($content, Mode $mode, BitArray $bits, $encoding) + { + switch ($mode->get()) { + case Mode::NUMERIC: + self::appendNumericBytes($content, $bits); + break; + + case Mode::ALPHANUMERIC: + self::appendAlphanumericBytes($content, $bits); + break; + + case Mode::BYTE: + self::append8BitBytes($content, $bits, $encoding); + break; + + case Mode::KANJI: + self::appendKanjiBytes($content, $bits); + break; + + default: + throw new Exception\WriterException('Invalid mode: ' . $mode->get()); + } + } + + /** + * Appends numeric bytes to a bit array. + * + * @param string $content + * @param BitArray $bits + * @return void + */ + protected static function appendNumericBytes($content, BitArray $bits) + { + $length = strlen($content); + $i = 0; + + while ($i < $length) { + $num1 = (int) $content[$i]; + + if ($i + 2 < $length) { + // Encode three numeric letters in ten bits. + $num2 = (int) $content[$i + 1]; + $num3 = (int) $content[$i + 2]; + $bits->appendBits($num1 * 100 + $num2 * 10 + $num3, 10); + $i += 3; + } elseif ($i + 1 < $length) { + // Encode two numeric letters in seven bits. + $num2 = (int) $content[$i + 1]; + $bits->appendBits($num1 * 10 + $num2, 7); + $i += 2; + } else { + // Encode one numeric letter in four bits. + $bits->appendBits($num1, 4); + $i++; + } + } + } + + /** + * Appends alpha-numeric bytes to a bit array. + * + * @param string $content + * @param BitArray $bits + * @return void + */ + protected static function appendAlphanumericBytes($content, BitArray $bits) + { + $length = strlen($content); + $i = 0; + + while ($i < $length) { + if (-1 === ($code1 = self::getAlphanumericCode($content[$i]))) { + throw new Exception\WriterException('Invalid alphanumeric code'); + } + + if ($i + 1 < $length) { + if (-1 === ($code2 = self::getAlphanumericCode($content[$i + 1]))) { + throw new Exception\WriterException('Invalid alphanumeric code'); + } + + // Encode two alphanumeric letters in 11 bits. + $bits->appendBits($code1 * 45 + $code2, 11); + $i += 2; + } else { + // Encode one alphanumeric letter in six bits. + $bits->appendBits($code1, 6); + $i++; + } + } + } + + /** + * Appends regular 8-bit bytes to a bit array. + * + * @param string $content + * @param BitArray $bits + * @return void + */ + protected static function append8BitBytes($content, BitArray $bits, $encoding) + { + if (false === ($bytes = @iconv('utf-8', $encoding, $content))) { + throw new Exception\WriterException('Could not encode content to ' . $encoding); + } + + $length = strlen($bytes); + + for ($i = 0; $i < $length; $i++) { + $bits->appendBits(ord($bytes[$i]), 8); + } + } + + /** + * Appends KANJI bytes to a bit array. + * + * @param string $content + * @param BitArray $bits + * @return void + */ + protected static function appendKanjiBytes($content, BitArray $bits) + { + if (strlen($content) % 2 > 0) { + // We just do a simple length check here. The for loop will check + // individual characters. + throw new Exception\WriterException('Content does not seem to be encoded in SHIFT-JIS'); + } + + $length = strlen($content); + + for ($i = 0; $i < $length; $i += 2) { + $byte1 = ord($content[$i]) & 0xff; + $byte2 = ord($content[$i + 1]) & 0xff; + $code = ($byte1 << 8) | $byte2; + + if ($code >= 0x8140 && $code <= 0x9ffc) { + $subtracted = $code - 0x8140; + } elseif ($code >= 0xe040 && $code <= 0xebbf) { + $subtracted = $code - 0xc140; + } else { + throw new Exception\WriterException('Invalid byte sequence'); + } + + $encoded = (($subtracted >> 8) * 0xc0) + ($subtracted & 0xff); + + $bits->appendBits($encoded, 13); + } + } + + /** + * Appends ECI information to a bit array. + * + * @param CharacterSetEci $eci + * @param BitArray $bits + * @return void + */ + protected static function appendEci(CharacterSetEci $eci, BitArray $bits) + { + $mode = new Mode(Mode::ECI); + $bits->appendBits($mode->get(), 4); + $bits->appendBits($eci->get(), 8); + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/MaskUtil.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/MaskUtil.php new file mode 100755 index 0000000..c294d55 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/MaskUtil.php @@ -0,0 +1,291 @@ +getArray(); + $width = $matrix->getWidth(); + $height = $matrix->getHeight(); + + for ($y = 0; $y < $height - 1; $y++) { + for ($x = 0; $x < $width - 1; $x++) { + $value = $array[$y][$x]; + + if ($value === $array[$y][$x + 1] && $value === $array[$y + 1][$x] && $value === $array[$y + 1][$x + 1]) { + $penalty++; + } + } + } + + return self::N2 * $penalty; + } + + /** + * Applies mask penalty rule 3 and returns the penalty. + * + * Finds consecutive cells of 00001011101 or 10111010000, and gives penalty + * to them. If we find patterns like 000010111010000, we give penalties + * twice (i.e. 40 * 2). + * + * @param ByteMatrix $matrix + * @return integer + */ + public static function applyMaskPenaltyRule3(ByteMatrix $matrix) + { + $penalty = 0; + $array = $matrix->getArray(); + $width = $matrix->getWidth(); + $height = $matrix->getHeight(); + + for ($y = 0; $y < $height; $y++) { + for ($x = 0; $x < $width; $x++) { + if ( + $x + 6 < $width + && $array[$y][$x] === 1 + && $array[$y][$x + 1] === 0 + && $array[$y][$x + 2] === 1 + && $array[$y][$x + 3] === 1 + && $array[$y][$x + 4] === 1 + && $array[$y][$x + 5] === 0 + && $array[$y][$x + 6] === 1 + && ( + ( + $x + 10 < $width + && $array[$y][$x + 7] === 0 + && $array[$y][$x + 8] === 0 + && $array[$y][$x + 9] === 0 + && $array[$y][$x + 10] === 0 + ) + || ( + $x - 4 >= 0 + && $array[$y][$x - 1] === 0 + && $array[$y][$x - 2] === 0 + && $array[$y][$x - 3] === 0 + && $array[$y][$x - 4] === 0 + ) + ) + ) { + $penalty += self::N3; + } + + if ( + $y + 6 < $height + && $array[$y][$x] === 1 + && $array[$y + 1][$x] === 0 + && $array[$y + 2][$x] === 1 + && $array[$y + 3][$x] === 1 + && $array[$y + 4][$x] === 1 + && $array[$y + 5][$x] === 0 + && $array[$y + 6][$x] === 1 + && ( + ( + $y + 10 < $height + && $array[$y + 7][$x] === 0 + && $array[$y + 8][$x] === 0 + && $array[$y + 9][$x] === 0 + && $array[$y + 10][$x] === 0 + ) + || ( + $y - 4 >= 0 + && $array[$y - 1][$x] === 0 + && $array[$y - 2][$x] === 0 + && $array[$y - 3][$x] === 0 + && $array[$y - 4][$x] === 0 + ) + ) + ) { + $penalty += self::N3; + } + } + } + + return $penalty; + } + + /** + * Applies mask penalty rule 4 and returns the penalty. + * + * Calculates the ratio of dark cells and gives penalty if the ratio is far + * from 50%. It gives 10 penalty for 5% distance. + * + * @param ByteMatrix $matrix + * @return integer + */ + public static function applyMaskPenaltyRule4(ByteMatrix $matrix) + { + $numDarkCells = 0; + + $array = $matrix->getArray(); + $width = $matrix->getWidth(); + $height = $matrix->getHeight(); + + for ($y = 0; $y < $height; $y++) { + $arrayY = $array[$y]; + + for ($x = 0; $x < $width; $x++) { + if ($arrayY[$x] === 1) { + $numDarkCells++; + } + } + } + + $numTotalCells = $height * $width; + $darkRatio = $numDarkCells / $numTotalCells; + $fixedPercentVariances = (int) (abs($darkRatio - 0.5) * 20); + + return $fixedPercentVariances * self::N4; + } + + /** + * Returns the mask bit for "getMaskPattern" at "x" and "y". + * + * See 8.8 of JISX0510:2004 for mask pattern conditions. + * + * @param integer $maskPattern + * @param integer $x + * @param integer $y + * @return integer + * @throws Exception\InvalidArgumentException + */ + public static function getDataMaskBit($maskPattern, $x, $y) + { + switch ($maskPattern) { + case 0: + $intermediate = ($y + $x) & 0x1; + break; + + case 1: + $intermediate = $y & 0x1; + break; + + case 2: + $intermediate = $x % 3; + break; + + case 3: + $intermediate = ($y + $x) % 3; + break; + + case 4: + $intermediate = (BitUtils::unsignedRightShift($y, 1) + ($x / 3)) & 0x1; + break; + + case 5: + $temp = $y * $x; + $intermediate = ($temp & 0x1) + ($temp % 3); + break; + + case 6: + $temp = $y * $x; + $intermediate = (($temp & 0x1) + ($temp % 3)) & 0x1; + break; + + case 7: + $temp = $y * $x; + $intermediate = (($temp % 3) + (($y + $x) & 0x1)) & 0x1; + break; + + default: + throw new Exception\InvalidArgumentException('Invalid mask pattern: ' . $maskPattern); + } + + return $intermediate === 0; + } + + /** + * Helper function for applyMaskPenaltyRule1. + * + * We need this for doing this calculation in both vertical and horizontal + * orders respectively. + * + * @param ByteMatrix $matrix + * @param boolean $isHorizontal + * @return integer + */ + protected static function applyMaskPenaltyRule1Internal(ByteMatrix $matrix, $isHorizontal) + { + $penalty = 0; + $iLimit = $isHorizontal ? $matrix->getHeight() : $matrix->getWidth(); + $jLimit = $isHorizontal ? $matrix->getWidth() : $matrix->getHeight(); + $array = $matrix->getArray(); + + for ($i = 0; $i < $iLimit; $i++) { + $numSameBitCells = 0; + $prevBit = -1; + + for ($j = 0; $j < $jLimit; $j++) { + $bit = $isHorizontal ? $array[$i][$j] : $array[$j][$i]; + + if ($bit === $prevBit) { + $numSameBitCells++; + } else { + if ($numSameBitCells >= 5) { + $penalty += self::N1 + ($numSameBitCells - 5); + } + + $numSameBitCells = 1; + $prevBit = $bit; + } + } + + if ($numSameBitCells >= 5) { + $penalty += self::N1 + ($numSameBitCells - 5); + } + } + + return $penalty; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/MatrixUtil.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/MatrixUtil.php new file mode 100755 index 0000000..8327381 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/MatrixUtil.php @@ -0,0 +1,580 @@ +clear(-1); + } + + /** + * Builds a complete matrix. + * + * @param BitArray $dataBits + * @param ErrorCorrectionLevel $level + * @param Version $version + * @param integer $maskPattern + * @param ByteMatrix $matrix + * @return void + */ + public static function buildMatrix( + BitArray $dataBits, + ErrorCorrectionLevel $level, + Version $version, + $maskPattern, + ByteMatrix $matrix + ) { + self::clearMatrix($matrix); + self::embedBasicPatterns($version, $matrix); + self::embedTypeInfo($level, $maskPattern, $matrix); + self::maybeEmbedVersionInfo($version, $matrix); + self::embedDataBits($dataBits, $maskPattern, $matrix); + } + + /** + * Embeds type information into a matrix. + * + * @param ErrorCorrectionLevel $level + * @param integer $maskPattern + * @param ByteMatrix $matrix + * @return void + */ + protected static function embedTypeInfo(ErrorCorrectionLevel $level, $maskPattern, ByteMatrix $matrix) + { + $typeInfoBits = new BitArray(); + self::makeTypeInfoBits($level, $maskPattern, $typeInfoBits); + + $typeInfoBitsSize = $typeInfoBits->getSize(); + + for ($i = 0; $i < $typeInfoBitsSize; $i++) { + $bit = $typeInfoBits->get($typeInfoBitsSize - 1 - $i); + + $x1 = self::$typeInfoCoordinates[$i][0]; + $y1 = self::$typeInfoCoordinates[$i][1]; + + $matrix->set($x1, $y1, $bit); + + if ($i < 8) { + $x2 = $matrix->getWidth() - $i - 1; + $y2 = 8; + } else { + $x2 = 8; + $y2 = $matrix->getHeight() - 7 + ($i - 8); + } + + $matrix->set($x2, $y2, $bit); + } + } + + /** + * Generates type information bits and appends them to a bit array. + * + * @param ErrorCorrectionLevel $level + * @param integer $maskPattern + * @param BitArray $bits + * @return void + * @throws Exception\RuntimeException + */ + protected static function makeTypeInfoBits(ErrorCorrectionLevel $level, $maskPattern, BitArray $bits) + { + $typeInfo = ($level->get() << 3) | $maskPattern; + $bits->appendBits($typeInfo, 5); + + $bchCode = self::calculateBchCode($typeInfo, self::$typeInfoPoly); + $bits->appendBits($bchCode, 10); + + $maskBits = new BitArray(); + $maskBits->appendBits(self::$typeInfoMaskPattern, 15); + $bits->xorBits($maskBits); + + if ($bits->getSize() !== 15) { + throw new Exception\RuntimeException('Bit array resulted in invalid size: ' . $bits->getSize()); + } + } + + /** + * Embeds version information if required. + * + * @param Version $version + * @param ByteMatrix $matrix + * @return void + */ + protected static function maybeEmbedVersionInfo(Version $version, ByteMatrix $matrix) + { + if ($version->getVersionNumber() < 7) { + return; + } + + $versionInfoBits = new BitArray(); + self::makeVersionInfoBits($version, $versionInfoBits); + + $bitIndex = 6 * 3 - 1; + + for ($i = 0; $i < 6; $i++) { + for ($j = 0; $j < 3; $j++) { + $bit = $versionInfoBits->get($bitIndex); + $bitIndex--; + + $matrix->set($i, $matrix->getHeight() - 11 + $j, $bit); + $matrix->set($matrix->getHeight() - 11 + $j, $i, $bit); + } + } + } + + /** + * Generates version information bits and appends them to a bit array. + * + * @param Version $version + * @param BitArray $bits + * @return void + * @throws Exception\RuntimeException + */ + protected static function makeVersionInfoBits(Version $version, BitArray $bits) + { + $bits->appendBits($version->getVersionNumber(), 6); + + $bchCode = self::calculateBchCode($version->getVersionNumber(), self::$versionInfoPoly); + $bits->appendBits($bchCode, 12); + + if ($bits->getSize() !== 18) { + throw new Exception\RuntimeException('Bit array resulted in invalid size: ' . $bits->getSize()); + } + } + + /** + * Calculates the BHC code for a value and a polynomial. + * + * @param integer $value + * @param integer $poly + * @return integer + */ + protected static function calculateBchCode($value, $poly) + { + $msbSetInPoly = self::findMsbSet($poly); + $value <<= $msbSetInPoly - 1; + + while (self::findMsbSet($value) >= $msbSetInPoly) { + $value ^= $poly << (self::findMsbSet($value) - $msbSetInPoly); + } + + return $value; + } + + /** + * Finds and MSB set. + * + * @param integer $value + * @return integer + */ + protected static function findMsbSet($value) + { + $numDigits = 0; + + while ($value !== 0) { + $value >>= 1; + $numDigits++; + } + + return $numDigits; + } + + /** + * Embeds basic patterns into a matrix. + * + * @param Version $version + * @param ByteMatrix $matrix + * @return void + */ + protected static function embedBasicPatterns(Version $version, ByteMatrix $matrix) + { + self::embedPositionDetectionPatternsAndSeparators($matrix); + self::embedDarkDotAtLeftBottomCorner($matrix); + self::maybeEmbedPositionAdjustmentPatterns($version, $matrix); + self::embedTimingPatterns($matrix); + } + + /** + * Embeds position detection patterns and separators into a byte matrix. + * + * @param ByteMatrix $matrix + * @return void + */ + protected static function embedPositionDetectionPatternsAndSeparators(ByteMatrix $matrix) + { + $pdpWidth = count(self::$positionDetectionPattern[0]); + + self::embedPositionDetectionPattern(0, 0, $matrix); + self::embedPositionDetectionPattern($matrix->getWidth() - $pdpWidth, 0, $matrix); + self::embedPositionDetectionPattern(0, $matrix->getWidth() - $pdpWidth, $matrix); + + $hspWidth = 8; + + self::embedHorizontalSeparationPattern(0, $hspWidth - 1, $matrix); + self::embedHorizontalSeparationPattern($matrix->getWidth() - $hspWidth, $hspWidth - 1, $matrix); + self::embedHorizontalSeparationPattern(0, $matrix->getWidth() - $hspWidth, $matrix); + + $vspSize = 7; + + self::embedVerticalSeparationPattern($vspSize, 0, $matrix); + self::embedVerticalSeparationPattern($matrix->getHeight() - $vspSize - 1, 0, $matrix); + self::embedVerticalSeparationPattern($vspSize, $matrix->getHeight() - $vspSize, $matrix); + } + + /** + * Embeds a single position detection pattern into a byte matrix. + * + * @param integer $xStart + * @param integer $yStart + * @param ByteMatrix $matrix + * @return void + */ + protected static function embedPositionDetectionPattern($xStart, $yStart, ByteMatrix $matrix) + { + for ($y = 0; $y < 7; $y++) { + for ($x = 0; $x < 7; $x++) { + $matrix->set($xStart + $x, $yStart + $y, self::$positionDetectionPattern[$y][$x]); + } + } + } + + /** + * Embeds a single horizontal separation pattern. + * + * @param integer $xStart + * @param integer $yStart + * @param ByteMatrix $matrix + * @return void + * @throws Exception\RuntimeException + */ + protected static function embedHorizontalSeparationPattern($xStart, $yStart, ByteMatrix $matrix) + { + for ($x = 0; $x < 8; $x++) { + if ($matrix->get($xStart + $x, $yStart) !== -1) { + throw new Exception\RuntimeException('Byte already set'); + } + + $matrix->set($xStart + $x, $yStart, 0); + } + } + + /** + * Embeds a single vertical separation pattern. + * + * @param integer $xStart + * @param integer $yStart + * @param ByteMatrix $matrix + * @return void + * @throws Exception\RuntimeException + */ + protected static function embedVerticalSeparationPattern($xStart, $yStart, ByteMatrix $matrix) + { + for ($y = 0; $y < 7; $y++) { + if ($matrix->get($xStart, $yStart + $y) !== -1) { + throw new Exception\RuntimeException('Byte already set'); + } + + $matrix->set($xStart, $yStart + $y, 0); + } + } + + /** + * Embeds a dot at the left bottom corner. + * + * @param ByteMatrix $matrix + * @return void + * @throws Exception\RuntimeException + */ + protected static function embedDarkDotAtLeftBottomCorner(ByteMatrix $matrix) + { + if ($matrix->get(8, $matrix->getHeight() - 8) === 0) { + throw new Exception\RuntimeException('Byte already set to 0'); + } + + $matrix->set(8, $matrix->getHeight() - 8, 1); + } + + /** + * Embeds position adjustment patterns if required. + * + * @param Version $version + * @param ByteMatrix $matrix + * @return void + */ + protected static function maybeEmbedPositionAdjustmentPatterns(Version $version, ByteMatrix $matrix) + { + if ($version->getVersionNumber() < 2) { + return; + } + + $index = $version->getVersionNumber() - 1; + + $coordinates = self::$positionAdjustmentPatternCoordinateTable[$index]; + $numCoordinates = count($coordinates); + + for ($i = 0; $i < $numCoordinates; $i++) { + for ($j = 0; $j < $numCoordinates; $j++) { + $y = $coordinates[$i]; + $x = $coordinates[$j]; + + if ($x === null || $y === null) { + continue; + } + + if ($matrix->get($x, $y) === -1) { + self::embedPositionAdjustmentPattern($x - 2, $y - 2, $matrix); + } + } + } + } + + /** + * Embeds a single position adjustment pattern. + * + * @param integer $xStart + * @param intger $yStart + * @param ByteMatrix $matrix + * @return void + */ + protected static function embedPositionAdjustmentPattern($xStart, $yStart, ByteMatrix $matrix) + { + for ($y = 0; $y < 5; $y++) { + for ($x = 0; $x < 5; $x++) { + $matrix->set($xStart + $x, $yStart + $y, self::$positionAdjustmentPattern[$y][$x]); + } + } + } + + /** + * Embeds timing patterns into a matrix. + * + * @param ByteMatrix $matrix + * @return void + */ + protected static function embedTimingPatterns(ByteMatrix $matrix) + { + $matrixWidth = $matrix->getWidth(); + + for ($i = 8; $i < $matrixWidth - 8; $i++) { + $bit = ($i + 1) % 2; + + if ($matrix->get($i, 6) === -1) { + $matrix->set($i, 6, $bit); + } + + if ($matrix->get(6, $i) === -1) { + $matrix->set(6, $i, $bit); + } + } + } + + /** + * Embeds "dataBits" using "getMaskPattern". + * + * For debugging purposes, it skips masking process if "getMaskPattern" is + * -1. See 8.7 of JISX0510:2004 (p.38) for how to embed data bits. + * + * @param BitArray $dataBits + * @param integer $maskPattern + * @param ByteMatrix $matrix + * @return void + * @throws Exception\WriterException + */ + protected static function embedDataBits(BitArray $dataBits, $maskPattern, ByteMatrix $matrix) + { + $bitIndex = 0; + $direction = -1; + + // Start from the right bottom cell. + $x = $matrix->getWidth() - 1; + $y = $matrix->getHeight() - 1; + + while ($x > 0) { + // Skip vertical timing pattern. + if ($x === 6) { + $x--; + } + + while ($y >= 0 && $y < $matrix->getHeight()) { + for ($i = 0; $i < 2; $i++) { + $xx = $x - $i; + + // Skip the cell if it's not empty. + if ($matrix->get($xx, $y) !== -1) { + continue; + } + + if ($bitIndex < $dataBits->getSize()) { + $bit = $dataBits->get($bitIndex); + $bitIndex++; + } else { + // Padding bit. If there is no bit left, we'll fill the + // left cells with 0, as described in 8.4.9 of + // JISX0510:2004 (p. 24). + $bit = false; + } + + // Skip masking if maskPattern is -1. + if ($maskPattern !== -1 && MaskUtil::getDataMaskBit($maskPattern, $xx, $y)) { + $bit = !$bit; + } + + $matrix->set($xx, $y, $bit); + } + + $y += $direction; + } + + $direction = -$direction; + $y += $direction; + $x -= 2; + } + + // All bits should be consumed + if ($bitIndex !== $dataBits->getSize()) { + throw new Exception\WriterException('Not all bits consumed (' . $bitIndex . ' out of ' . $dataBits->getSize() .')'); + } + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/QrCode.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/QrCode.php new file mode 100755 index 0000000..07e1c38 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Encoder/QrCode.php @@ -0,0 +1,201 @@ +mode; + } + + /** + * Sets the mode. + * + * @param Mode $mode + * @return void + */ + public function setMode(Mode $mode) + { + $this->mode = $mode; + } + + /** + * Gets the EC level. + * + * @return ErrorCorrectionLevel + */ + public function getErrorCorrectionLevel() + { + return $this->errorCorrectionLevel; + } + + /** + * Sets the EC level. + * + * @param ErrorCorrectionLevel $errorCorrectionLevel + * @return void + */ + public function setErrorCorrectionLevel(ErrorCorrectionLevel $errorCorrectionLevel) + { + $this->errorCorrectionLevel = $errorCorrectionLevel; + } + + /** + * Gets the version. + * + * @return Version + */ + public function getVersion() + { + return $this->version; + } + + /** + * Sets the version. + * + * @param Version $version + * @return void + */ + public function setVersion(Version $version) + { + $this->version = $version; + } + + /** + * Gets the mask pattern. + * + * @return integer + */ + public function getMaskPattern() + { + return $this->maskPattern; + } + + /** + * Sets the mask pattern. + * + * @param integer $maskPattern + * @return void + */ + public function setMaskPattern($maskPattern) + { + $this->maskPattern = $maskPattern; + } + + /** + * Gets the matrix. + * + * @return ByteMatrix + */ + public function getMatrix() + { + return $this->matrix; + } + + /** + * Sets the matrix. + * + * @param ByteMatrix $matrix + * @return void + */ + public function setMatrix(ByteMatrix $matrix) + { + $this->matrix = $matrix; + } + + /** + * Validates whether a mask pattern is valid. + * + * @param integer $maskPattern + * @return boolean + */ + public static function isValidMaskPattern($maskPattern) + { + return $maskPattern > 0 && $maskPattern < self::NUM_MASK_PATTERNS; + } + + /** + * Returns a string representation of the QR code. + * + * @return string + */ + public function __toString() + { + $result = "<<\n" + . " mode: " . $this->mode . "\n" + . " ecLevel: " . $this->errorCorrectionLevel . "\n" + . " version: " . $this->version . "\n" + . " maskPattern: " . $this->maskPattern . "\n"; + + if ($this->matrix === null) { + $result .= " matrix: null\n"; + } else { + $result .= " matrix:\n"; + $result .= $this->matrix; + } + + $result .= ">>\n"; + + return $result; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Exception/ExceptionInterface.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Exception/ExceptionInterface.php new file mode 100755 index 0000000..5c58fc5 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Exception/ExceptionInterface.php @@ -0,0 +1,14 @@ + 100) { + throw new Exception\InvalidArgumentException('Cyan must be between 0 and 100'); + } + + if ($magenta < 0 || $magenta > 100) { + throw new Exception\InvalidArgumentException('Magenta must be between 0 and 100'); + } + + if ($yellow < 0 || $yellow > 100) { + throw new Exception\InvalidArgumentException('Yellow must be between 0 and 100'); + } + + if ($black < 0 || $black > 100) { + throw new Exception\InvalidArgumentException('Black must be between 0 and 100'); + } + + $this->cyan = (int) $cyan; + $this->magenta = (int) $magenta; + $this->yellow = (int) $yellow; + $this->black = (int) $black; + } + + /** + * Returns the cyan value. + * + * @return integer + */ + public function getCyan() + { + return $this->cyan; + } + + /** + * Returns the magenta value. + * + * @return integer + */ + public function getMagenta() + { + return $this->magenta; + } + + /** + * Returns the yellow value. + * + * @return integer + */ + public function getYellow() + { + return $this->yellow; + } + + /** + * Returns the black value. + * + * @return integer + */ + public function getBlack() + { + return $this->black; + } + + /** + * toRgb(): defined by ColorInterface. + * + * @see ColorInterface::toRgb() + * @return Rgb + */ + public function toRgb() + { + $k = $this->black / 100; + $c = (-$k * $this->cyan + $k * 100 + $this->cyan) / 100; + $m = (-$k * $this->magenta + $k * 100 + $this->magenta) / 100; + $y = (-$k * $this->yellow + $k * 100 + $this->yellow) / 100; + + return new Rgb( + -$c * 255 + 255, + -$m * 255 + 255, + -$y * 255 + 255 + ); + } + + /** + * toCmyk(): defined by ColorInterface. + * + * @see ColorInterface::toCmyk() + * @return Cmyk + */ + public function toCmyk() + { + return $this; + } + + /** + * toGray(): defined by ColorInterface. + * + * @see ColorInterface::toGray() + * @return Gray + */ + public function toGray() + { + return $this->toRgb()->toGray(); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Color/ColorInterface.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Color/ColorInterface.php new file mode 100755 index 0000000..747accc --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Color/ColorInterface.php @@ -0,0 +1,37 @@ + 100) { + throw new Exception\InvalidArgumentException('Gray must be between 0 and 100'); + } + + $this->gray = (int) $gray; + } + + /** + * Returns the gray value. + * + * @return integer + */ + public function getGray() + { + return $this->gray; + } + + /** + * toRgb(): defined by ColorInterface. + * + * @see ColorInterface::toRgb() + * @return Rgb + */ + public function toRgb() + { + return new Rgb($this->gray * 2.55, $this->gray * 2.55, $this->gray * 2.55); + } + + /** + * toCmyk(): defined by ColorInterface. + * + * @see ColorInterface::toCmyk() + * @return Cmyk + */ + public function toCmyk() + { + return new Cmyk(0, 0, 0, 100 - $this->gray); + } + + /** + * toGray(): defined by ColorInterface. + * + * @see ColorInterface::toGray() + * @return Gray + */ + public function toGray() + { + return $this; + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Color/Rgb.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Color/Rgb.php new file mode 100755 index 0000000..44e4060 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Color/Rgb.php @@ -0,0 +1,148 @@ + 255) { + throw new Exception\InvalidArgumentException('Red must be between 0 and 255'); + } + + if ($green < 0 || $green > 255) { + throw new Exception\InvalidArgumentException('Green must be between 0 and 255'); + } + + if ($blue < 0 || $blue > 255) { + throw new Exception\InvalidArgumentException('Blue must be between 0 and 255'); + } + + $this->red = (int) $red; + $this->green = (int) $green; + $this->blue = (int) $blue; + } + + /** + * Returns the red value. + * + * @return integer + */ + public function getRed() + { + return $this->red; + } + + /** + * Returns the green value. + * + * @return integer + */ + public function getGreen() + { + return $this->green; + } + + /** + * Returns the blue value. + * + * @return integer + */ + public function getBlue() + { + return $this->blue; + } + + /** + * Returns a hexadecimal string representation of the RGB value. + * + * @return string + */ + public function __toString() + { + return sprintf('%02x%02x%02x', $this->red, $this->green, $this->blue); + } + + /** + * toRgb(): defined by ColorInterface. + * + * @see ColorInterface::toRgb() + * @return Rgb + */ + public function toRgb() + { + return $this; + } + + /** + * toCmyk(): defined by ColorInterface. + * + * @see ColorInterface::toCmyk() + * @return Cmyk + */ + public function toCmyk() + { + $c = 1 - ($this->red / 255); + $m = 1 - ($this->green / 255); + $y = 1 - ($this->blue / 255); + $k = min($c, $m, $y); + + return new Cmyk( + 100 * ($c - $k) / (1 - $k), + 100 * ($m - $k) / (1 - $k), + 100 * ($y - $k) / (1 - $k), + 100 * $k + ); + } + + /** + * toGray(): defined by ColorInterface. + * + * @see ColorInterface::toGray() + * @return Gray + */ + public function toGray() + { + return new Gray(($this->red * 0.21 + $this->green * 0.71 + $this->blue * 0.07) / 2.55); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/AbstractRenderer.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/AbstractRenderer.php new file mode 100755 index 0000000..b0bb02a --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/AbstractRenderer.php @@ -0,0 +1,338 @@ +margin = (int) $margin; + return $this; + } + + /** + * Gets the margin around the QR code. + * + * @return integer + */ + public function getMargin() + { + return $this->margin; + } + + /** + * Sets the height around the renderd image. + * + * If the width is smaller than the matrix width plus padding, the renderer + * will automatically use that as the width instead of the specified one. + * + * @param integer $width + * @return AbstractRenderer + */ + public function setWidth($width) + { + $this->width = (int) $width; + return $this; + } + + /** + * Gets the width of the rendered image. + * + * @return integer + */ + public function getWidth() + { + return $this->width; + } + + /** + * Sets the height around the renderd image. + * + * If the height is smaller than the matrix height plus padding, the + * renderer will automatically use that as the height instead of the + * specified one. + * + * @param integer $height + * @return AbstractRenderer + */ + public function setHeight($height) + { + $this->height = (int) $height; + return $this; + } + + /** + * Gets the height around the rendered image. + * + * @return integer + */ + public function getHeight() + { + return $this->height; + } + + /** + * Sets whether dimensions should be rounded down. + * + * @param boolean $flag + * @return AbstractRenderer + */ + public function setRoundDimensions($flag) + { + $this->floorToClosestDimension = $flag; + return $this; + } + + /** + * Gets whether dimensions should be rounded down. + * + * @return boolean + */ + public function shouldRoundDimensions() + { + return $this->floorToClosestDimension; + } + + /** + * Sets background color. + * + * @param Color\ColorInterface $color + * @return AbstractRenderer + */ + public function setBackgroundColor(Color\ColorInterface $color) + { + $this->backgroundColor = $color; + return $this; + } + + /** + * Gets background color. + * + * @return Color\ColorInterface + */ + public function getBackgroundColor() + { + if ($this->backgroundColor === null) { + $this->backgroundColor = new Color\Gray(100); + } + + return $this->backgroundColor; + } + + /** + * Sets foreground color. + * + * @param Color\ColorInterface $color + * @return AbstractRenderer + */ + public function setForegroundColor(Color\ColorInterface $color) + { + $this->foregroundColor = $color; + return $this; + } + + /** + * Gets foreground color. + * + * @return Color\ColorInterface + */ + public function getForegroundColor() + { + if ($this->foregroundColor === null) { + $this->foregroundColor = new Color\Gray(0); + } + + return $this->foregroundColor; + } + + /** + * Adds a decorator to the renderer. + * + * @param DecoratorInterface $decorator + * @return AbstractRenderer + */ + public function addDecorator(DecoratorInterface $decorator) + { + $this->decorators[] = $decorator; + return $this; + } + + /** + * render(): defined by RendererInterface. + * + * @see RendererInterface::render() + * @param QrCode $qrCode + * @return string + */ + public function render(QrCode $qrCode) + { + $input = $qrCode->getMatrix(); + $inputWidth = $input->getWidth(); + $inputHeight = $input->getHeight(); + $qrWidth = $inputWidth + ($this->getMargin() << 1); + $qrHeight = $inputHeight + ($this->getMargin() << 1); + $outputWidth = max($this->getWidth(), $qrWidth); + $outputHeight = max($this->getHeight(), $qrHeight); + $multiple = (int) min($outputWidth / $qrWidth, $outputHeight / $qrHeight); + + if ($this->shouldRoundDimensions()) { + $outputWidth -= $outputWidth % $multiple; + $outputHeight -= $outputHeight % $multiple; + } + + // Padding includes both the quiet zone and the extra white pixels to + // accommodate the requested dimensions. For example, if input is 25x25 + // the QR will be 33x33 including the quiet zone. If the requested size + // is 200x160, the multiple will be 4, for a QR of 132x132. These will + // handle all the padding from 100x100 (the actual QR) up to 200x160. + $leftPadding = (int) (($outputWidth - ($inputWidth * $multiple)) / 2); + $topPadding = (int) (($outputHeight - ($inputHeight * $multiple)) / 2); + + // Store calculated parameters + $this->finalWidth = $outputWidth; + $this->finalHeight = $outputHeight; + $this->blockSize = $multiple; + + $this->init(); + $this->addColor('background', $this->getBackgroundColor()); + $this->addColor('foreground', $this->getForegroundColor()); + $this->drawBackground('background'); + + foreach ($this->decorators as $decorator) { + $decorator->preProcess( + $qrCode, + $this, + $outputWidth, + $outputHeight, + $leftPadding, + $topPadding, + $multiple + ); + } + + for ($inputY = 0, $outputY = $topPadding; $inputY < $inputHeight; $inputY++, $outputY += $multiple) { + for ($inputX = 0, $outputX = $leftPadding; $inputX < $inputWidth; $inputX++, $outputX += $multiple) { + if ($input->get($inputX, $inputY) === 1) { + $this->drawBlock($outputX, $outputY, 'foreground'); + } + } + } + + foreach ($this->decorators as $decorator) { + $decorator->postProcess( + $qrCode, + $this, + $outputWidth, + $outputHeight, + $leftPadding, + $topPadding, + $multiple + ); + } + + return $this->getByteStream(); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Decorator/DecoratorInterface.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Decorator/DecoratorInterface.php new file mode 100755 index 0000000..e67268b --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Decorator/DecoratorInterface.php @@ -0,0 +1,63 @@ +outerColor = $color; + return $this; + } + + /** + * Gets outer color. + * + * @return Color\ColorInterface + */ + public function getOuterColor() + { + if ($this->outerColor === null) { + $this->outerColor = new Color\Gray(100); + } + + return $this->outerColor; + } + + /** + * Sets inner color. + * + * @param Color\ColorInterface $color + * @return FinderPattern + */ + public function setInnerColor(Color\ColorInterface $color) + { + $this->innerColor = $color; + return $this; + } + + /** + * Gets inner color. + * + * @return Color\ColorInterface + */ + public function getInnerColor() + { + if ($this->innerColor === null) { + $this->innerColor = new Color\Gray(0); + } + + return $this->innerColor; + } + + /** + * preProcess(): defined by DecoratorInterface. + * + * @see DecoratorInterface::preProcess() + * @param QrCode $qrCode + * @param RendererInterface $renderer + * @param integer $outputWidth + * @param integer $outputHeight + * @param integer $leftPadding + * @param integer $topPadding + * @param integer $multiple + * @return void + */ + public function preProcess( + QrCode $qrCode, + RendererInterface $renderer, + $outputWidth, + $outputHeight, + $leftPadding, + $topPadding, + $multiple + ) { + $matrix = $qrCode->getMatrix(); + $positions = array( + array(0, 0), + array($matrix->getWidth() - 7, 0), + array(0, $matrix->getHeight() - 7), + ); + + foreach (self::$outerPositionDetectionPattern as $y => $row) { + foreach ($row as $x => $isSet) { + foreach ($positions as $position) { + $matrix->set($x + $position[0], $y + $position[1], 0); + } + } + } + } + + /** + * postProcess(): defined by DecoratorInterface. + * + * @see DecoratorInterface::postProcess() + * + * @param QrCode $qrCode + * @param RendererInterface $renderer + * @param integer $outputWidth + * @param integer $outputHeight + * @param integer $leftPadding + * @param integer $topPadding + * @param integer $multiple + * @return void + */ + public function postProcess( + QrCode $qrCode, + RendererInterface $renderer, + $outputWidth, + $outputHeight, + $leftPadding, + $topPadding, + $multiple + ) { + $matrix = $qrCode->getMatrix(); + $positions = array( + array(0, 0), + array($matrix->getWidth() - 7, 0), + array(0, $matrix->getHeight() - 7), + ); + + $renderer->addColor('finder-outer', $this->getOuterColor()); + $renderer->addColor('finder-inner', $this->getInnerColor()); + + foreach (self::$outerPositionDetectionPattern as $y => $row) { + foreach ($row as $x => $isOuterSet) { + $isInnerSet = self::$innerPositionDetectionPattern[$y][$x]; + + if ($isOuterSet) { + foreach ($positions as $position) { + $renderer->drawBlock( + $leftPadding + $x * $multiple + $position[0] * $multiple, + $topPadding + $y * $multiple + $position[1] * $multiple, + 'finder-outer' + ); + } + } + + if ($isInnerSet) { + foreach ($positions as $position) { + $renderer->drawBlock( + $leftPadding + $x * $multiple + $position[0] * $multiple, + $topPadding + $y * $multiple + $position[1] * $multiple, + 'finder-inner' + ); + } + } + } + } + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Eps.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Eps.php new file mode 100755 index 0000000..9766195 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Eps.php @@ -0,0 +1,152 @@ +eps = "%!PS-Adobe-3.0 EPSF-3.0\n" + . "%%BoundingBox: 0 0 " . $this->finalWidth . " " . $this->finalHeight . "\n" + . "/F { rectfill } def\n"; + } + + /** + * addColor(): defined by RendererInterface. + * + * @see ImageRendererInterface::addColor() + * @param string $id + * @param ColorInterface $color + * @return void + */ + public function addColor($id, ColorInterface $color) + { + if ( + !$color instanceof Rgb + && !$color instanceof Cmyk + && !$color instanceof Gray + ) { + $color = $color->toCmyk(); + } + + $this->colors[$id] = $color; + } + + /** + * drawBackground(): defined by RendererInterface. + * + * @see ImageRendererInterface::drawBackground() + * @param string $colorId + * @return void + */ + public function drawBackground($colorId) + { + $this->setColor($colorId); + $this->eps .= "0 0 " . $this->finalWidth . " " . $this->finalHeight . " F\n"; + } + + /** + * drawBlock(): defined by RendererInterface. + * + * @see ImageRendererInterface::drawBlock() + * @param integer $x + * @param integer $y + * @param string $colorId + * @return void + */ + public function drawBlock($x, $y, $colorId) + { + $this->setColor($colorId); + $this->eps .= $x . " " . ($this->finalHeight - $y - $this->blockSize) . " " . $this->blockSize . " " . $this->blockSize . " F\n"; + } + + /** + * getByteStream(): defined by RendererInterface. + * + * @see ImageRendererInterface::getByteStream() + * @return string + */ + public function getByteStream() + { + return $this->eps; + } + + /** + * Sets color to use. + * + * @param string $colorId + * @return void + */ + protected function setColor($colorId) + { + if ($colorId !== $this->currentColor) { + $color = $this->colors[$colorId]; + + if ($color instanceof Rgb) { + $this->eps .= sprintf( + "%F %F %F setrgbcolor\n", + $color->getRed() / 100, + $color->getGreen() / 100, + $color->getBlue() / 100 + ); + } elseif ($color instanceof Cmyk) { + $this->eps .= sprintf( + "%F %F %F %F setcmykcolor\n", + $color->getCyan() / 100, + $color->getMagenta() / 100, + $color->getYellow() / 100, + $color->getBlack() / 100 + ); + } elseif ($color instanceof Gray) { + $this->eps .= sprintf( + "%F setgray\n", + $color->getGray() / 100 + ); + } + + $this->currentColor = $colorId; + } + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Png.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Png.php new file mode 100755 index 0000000..dd593a8 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/Png.php @@ -0,0 +1,115 @@ +image = imagecreatetruecolor($this->finalWidth, $this->finalHeight); + } + + /** + * addColor(): defined by RendererInterface. + * + * @see ImageRendererInterface::addColor() + * @param string $id + * @param ColorInterface $color + * @return void + * @throws Exception\RuntimeException + */ + public function addColor($id, ColorInterface $color) + { + if ($this->image === null) { + throw new Exception\RuntimeException('Colors can only be added after init'); + } + + $color = $color->toRgb(); + + $this->colors[$id] = imagecolorallocate( + $this->image, + $color->getRed(), + $color->getGreen(), + $color->getBlue() + ); + } + + /** + * drawBackground(): defined by RendererInterface. + * + * @see ImageRendererInterface::drawBackground() + * @param string $colorId + * @return void + */ + public function drawBackground($colorId) + { + imagefill($this->image, 0, 0, $this->colors[$colorId]); + } + + /** + * drawBlock(): defined by RendererInterface. + * + * @see ImageRendererInterface::drawBlock() + * @param integer $x + * @param integer $y + * @param string $colorId + * @return void + */ + public function drawBlock($x, $y, $colorId) + { + imagefilledrectangle( + $this->image, + $x, + $y, + $x + $this->blockSize - 1, + $y + $this->blockSize - 1, + $this->colors[$colorId] + ); + } + + /** + * getByteStream(): defined by RendererInterface. + * + * @see ImageRendererInterface::getByteStream() + * @return string + */ + public function getByteStream() + { + ob_start(); + imagepng($this->image); + return ob_get_clean(); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/RendererInterface.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/RendererInterface.php new file mode 100755 index 0000000..52101a6 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Image/RendererInterface.php @@ -0,0 +1,61 @@ +svg = new SimpleXMLElement( + '' + . '' + ); + $this->svg->addAttribute('version', '1.1'); + $this->svg->addAttribute('width', $this->finalWidth . 'px'); + $this->svg->addAttribute('height', $this->finalHeight . 'px'); + $this->svg->addAttribute('viewBox', '0 0 ' . $this->finalWidth . ' ' . $this->finalHeight); + $this->svg->addChild('defs'); + } + + /** + * addColor(): defined by RendererInterface. + * + * @see ImageRendererInterface::addColor() + * @param string $id + * @param ColorInterface $color + * @return void + * @throws Exception\InvalidArgumentException + */ + public function addColor($id, ColorInterface $color) + { + $this->colors[$id] = (string) $color->toRgb(); + } + + /** + * drawBackground(): defined by RendererInterface. + * + * @see ImageRendererInterface::drawBackground() + * @param string $colorId + * @return void + */ + public function drawBackground($colorId) + { + $rect = $this->svg->addChild('rect'); + $rect->addAttribute('x', 0); + $rect->addAttribute('y', 0); + $rect->addAttribute('width', $this->finalWidth); + $rect->addAttribute('height', $this->finalHeight); + $rect->addAttribute('fill', '#' . $this->colors[$colorId]); + } + + /** + * drawBlock(): defined by RendererInterface. + * + * @see ImageRendererInterface::drawBlock() + * @param integer $x + * @param integer $y + * @param string $colorId + * @return void + */ + public function drawBlock($x, $y, $colorId) + { + $use = $this->svg->addChild('use'); + $use->addAttribute('x', $x); + $use->addAttribute('y', $y); + $use->addAttribute( + 'xlink:href', + $this->getRectPrototypeId($colorId), + 'http://www.w3.org/1999/xlink' + ); + } + + /** + * getByteStream(): defined by RendererInterface. + * + * @see ImageRendererInterface::getByteStream() + * @return string + */ + public function getByteStream() + { + return $this->svg->asXML(); + } + + /** + * Get the prototype ID for a color. + * + * @param integer $colorId + * @return string + */ + protected function getRectPrototypeId($colorId) + { + if (!isset($this->prototypeIds[$colorId])) { + $id = 'r' . dechex(count($this->prototypeIds)); + + $rect = $this->svg->defs->addChild('rect'); + $rect->addAttribute('id', $id); + $rect->addAttribute('width', $this->blockSize); + $rect->addAttribute('height', $this->blockSize); + $rect->addAttribute('fill', '#' . $this->colors[$colorId]); + + $this->prototypeIds[$colorId] = '#' . $id; + } + + return $this->prototypeIds[$colorId]; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/RendererInterface.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/RendererInterface.php new file mode 100755 index 0000000..554e1d8 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/RendererInterface.php @@ -0,0 +1,26 @@ +class = $class; + } + + /** + * Get CSS class name. + * + * @return string + */ + public function getClass() + { + return $this->class; + } + + /** + * Set CSS style value. + * + * @param string $style + */ + public function setStyle($style) + { + $this->style = $style; + } + + /** + * Get CSS style value. + * + * @return string + */ + public function getStyle() + { + return $this->style; + } + + /** + * render(): defined by RendererInterface. + * + * @see RendererInterface::render() + * @param QrCode $qrCode + * @return string + */ + public function render(QrCode $qrCode) + { + $textCode = parent::render($qrCode); + + $result = '' . $textCode . ''; + + return $result; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Text/Plain.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Text/Plain.php new file mode 100755 index 0000000..a7e4cfb --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Renderer/Text/Plain.php @@ -0,0 +1,150 @@ +fullBlock = $fullBlock; + } + + /** + * Get char used as full block (occupied space, "black"). + * + * @return string + */ + public function getFullBlock() + { + return $this->fullBlock; + } + + /** + * Set char used as empty block (empty space, "white"). + * + * @param string $emptyBlock + */ + public function setEmptyBlock($emptyBlock) + { + $this->emptyBlock = $emptyBlock; + } + + /** + * Get char used as empty block (empty space, "white"). + * + * @return string + */ + public function getEmptyBlock() + { + return $this->emptyBlock; + } + + /** + * Sets the margin around the QR code. + * + * @param integer $margin + * @return AbstractRenderer + * @throws Exception\InvalidArgumentException + */ + public function setMargin($margin) + { + if ($margin < 0) { + throw new Exception\InvalidArgumentException('Margin must be equal to greater than 0'); + } + + $this->margin = (int) $margin; + + return $this; + } + + /** + * Gets the margin around the QR code. + * + * @return integer + */ + public function getMargin() + { + return $this->margin; + } + + /** + * render(): defined by RendererInterface. + * + * @see RendererInterface::render() + * @param QrCode $qrCode + * @return string + */ + public function render(QrCode $qrCode) + { + $result = ''; + $matrix = $qrCode->getMatrix(); + $width = $matrix->getWidth(); + + // Top margin + for ($x = 0; $x < $this->margin; $x++) { + $result .= str_repeat($this->emptyBlock, $width + 2 * $this->margin)."\n"; + } + + // Body + $array = $matrix->getArray(); + + foreach ($array as $row) { + $result .= str_repeat($this->emptyBlock, $this->margin); // left margin + foreach ($row as $byte) { + $result .= $byte ? $this->fullBlock : $this->emptyBlock; + } + $result .= str_repeat($this->emptyBlock, $this->margin); // right margin + $result .= "\n"; + } + + // Bottom margin + for ($x = 0; $x < $this->margin; $x++) { + $result .= str_repeat($this->emptyBlock, $width + 2 * $this->margin)."\n"; + } + + return $result; + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Writer.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Writer.php new file mode 100755 index 0000000..0f80313 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/src/BaconQrCode/Writer.php @@ -0,0 +1,105 @@ +renderer = $renderer; + } + + /** + * Sets the renderer used to create a byte stream. + * + * @param RendererInterface $renderer + * @return Writer + */ + public function setRenderer(RendererInterface $renderer) + { + $this->renderer = $renderer; + return $this; + } + + /** + * Gets the renderer used to create a byte stream. + * + * @return RendererInterface + */ + public function getRenderer() + { + return $this->renderer; + } + + /** + * Writes QR code and returns it as string. + * + * Content is a string which *should* be encoded in UTF-8, in case there are + * non ASCII-characters present. + * + * @param string $content + * @param string $encoding + * @param integer $ecLevel + * @return string + * @throws Exception\InvalidArgumentException + */ + public function writeString( + $content, + $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING, + $ecLevel = ErrorCorrectionLevel::L + ) { + if (strlen($content) === 0) { + throw new Exception\InvalidArgumentException('Found empty contents'); + } + + $qrCode = Encoder::encode($content, new ErrorCorrectionLevel($ecLevel), $encoding); + + return $this->getRenderer()->render($qrCode); + } + + /** + * Writes QR code to a file. + * + * @see Writer::writeString() + * @param string $content + * @param string $filename + * @param string $encoding + * @param integer $ecLevel + * @return void + */ + public function writeFile( + $content, + $filename, + $encoding = Encoder::DEFAULT_BYTE_MODE_ECODING, + $ecLevel = ErrorCorrectionLevel::L + ) { + file_put_contents($filename, $this->writeString($content, $encoding, $ecLevel)); + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitArrayTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitArrayTest.php new file mode 100755 index 0000000..81bcbce --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitArrayTest.php @@ -0,0 +1,201 @@ +assertFalse($array->get($i)); + $array->set($i); + $this->assertTrue($array->get($i)); + } + } + + public function testGetNextSet1() + { + $array = new BitArray(32); + + for ($i = 0; $i < $array->getSize(); $i++) { + $this->assertEquals($i, 32, '', $array->getNextSet($i)); + } + + $array = new BitArray(33); + + for ($i = 0; $i < $array->getSize(); $i++) { + $this->assertEquals($i, 33, '', $array->getNextSet($i)); + } + } + + public function testGetNextSet2() + { + $array = new BitArray(33); + + for ($i = 0; $i < $array->getSize(); $i++) { + $this->assertEquals($i, $i <= 31 ? 31 : 33, '', $array->getNextSet($i)); + } + + $array = new BitArray(33); + + for ($i = 0; $i < $array->getSize(); $i++) { + $this->assertEquals($i, 32, '', $array->getNextSet($i)); + } + } + + public function testGetNextSet3() + { + $array = new BitArray(63); + $array->set(31); + $array->set(32); + + for ($i = 0; $i < $array->getSize(); $i++) { + if ($i <= 31) { + $expected = 31; + } elseif ($i <= 32) { + $expected = 32; + } else { + $expected = 63; + } + + $this->assertEquals($i, $expected, '', $array->getNextSet($i)); + } + } + + public function testGetNextSet4() + { + $array = new BitArray(63); + $array->set(33); + $array->set(40); + + for ($i = 0; $i < $array->getSize(); $i++) { + if ($i <= 33) { + $expected = 33; + } elseif ($i <= 40) { + $expected = 40; + } else { + $expected = 63; + } + + $this->assertEquals($i, $expected, '', $array->getNextSet($i)); + } + } + + public function testGetNextSet5() + { + if (defined('MT_RAND_PHP')) { + mt_srand(0xdeadbeef, MT_RAND_PHP); + } else { + mt_srand(0xdeadbeef); + } + + for ($i = 0; $i < 10; $i++) { + $array = new BitArray(mt_rand(1, 100)); + $numSet = mt_rand(0, 19); + + for ($j = 0; $j < $numSet; $j++) { + $array->set(mt_rand(0, $array->getSize() - 1)); + } + + $numQueries = mt_rand(0, 19); + + for ($j = 0; $j < $numQueries; $j++) { + $query = mt_rand(0, $array->getSize() - 1); + $expected = $query; + + while ($expected < $array->getSize() && !$array->get($expected)) { + $expected++; + } + + $actual = $array->getNextSet($query); + + if ($actual !== $expected) { + $array->getNextSet($query); + } + + $this->assertEquals($expected, $actual); + } + } + } + + public function testSetBulk() + { + $array = new BitArray(64); + $array->setBulk(32, 0xFFFF0000); + + for ($i = 0; $i < 48; $i++) { + $this->assertFalse($array->get($i)); + } + + for ($i = 48; $i < 64; $i++) { + $this->assertTrue($array->get($i)); + } + } + + public function testClear() + { + $array = new BitArray(32); + + for ($i = 0; $i < 32; $i++) { + $array->set($i); + } + + $array->clear(); + + for ($i = 0; $i < 32; $i++) { + $this->assertFalse($array->get($i)); + } + } + + public function testGetArray() + { + $array = new BitArray(64); + $array->set(0); + $array->set(63); + + $ints = $array->getBitArray(); + + $this->assertEquals(1, $ints[0]); + $this->assertEquals(0x80000000, $ints[1]); + } + + public function testIsRange() + { + $array = new BitArray(64); + $this->assertTrue($array->isRange(0, 64, false)); + $this->assertFalse($array->isRange(0, 64, true)); + + $array->set(32); + $this->assertTrue($array->isRange(32, 33, true)); + + $array->set(31); + $this->assertTrue($array->isRange(31, 33, true)); + + $array->set(34); + $this->assertFalse($array->isRange(31, 35, true)); + + for ($i = 0; $i < 31; $i++) { + $array->set($i); + } + + $this->assertTrue($array->isRange(0, 33, true)); + + for ($i = 33; $i < 64; $i++) { + $array->set($i); + } + + $this->assertTrue($array->isRange(0, 64, true)); + $this->assertFalse($array->isRange(0, 64, false)); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitMatrixTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitMatrixTest.php new file mode 100755 index 0000000..89a5881 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitMatrixTest.php @@ -0,0 +1,119 @@ +assertEquals(33, $matrix->getHeight()); + + for ($y = 0; $y < 33; $y++) { + for ($x = 0; $x < 33; $x++) { + if ($y * $x % 3 === 0) { + $matrix->set($x, $y); + } + } + } + + for ($y = 0; $y < 33; $y++) { + for ($x = 0; $x < 33; $x++) { + $this->assertEquals($x * $y % 3 === 0, $matrix->get($x, $y)); + } + } + } + + public function testSetRegion() + { + $matrix = new BitMatrix(5); + $matrix->setRegion(1, 1, 3, 3); + + for ($y = 0; $y < 5; $y++) { + for ($x = 0; $x < 5; $x++) { + $this->assertEquals($y >= 1 && $y <= 3 && $x >= 1 && $x <= 3, $matrix->get($x, $y)); + } + } + } + + public function testRectangularMatrix() + { + $matrix = new BitMatrix(75, 20); + $this->assertEquals(75, $matrix->getWidth()); + $this->assertEquals(20, $matrix->getHeight()); + + $matrix->set(10, 0); + $matrix->set(11, 1); + $matrix->set(50, 2); + $matrix->set(51, 3); + $matrix->flip(74, 4); + $matrix->flip(0, 5); + + $this->assertTrue($matrix->get(10, 0)); + $this->assertTrue($matrix->get(11, 1)); + $this->assertTrue($matrix->get(50, 2)); + $this->assertTrue($matrix->get(51, 3)); + $this->assertTrue($matrix->get(74, 4)); + $this->assertTrue($matrix->get(0, 5)); + + $matrix->flip(50, 2); + $matrix->flip(51, 3); + + $this->assertFalse($matrix->get(50, 2)); + $this->assertFalse($matrix->get(51, 3)); + } + + public function testRectangularSetRegion() + { + $matrix = new BitMatrix(320, 240); + $this->assertEquals(320, $matrix->getWidth()); + $this->assertEquals(240, $matrix->getHeight()); + + $matrix->setRegion(105, 22, 80, 12); + + for ($y = 0; $y < 240; $y++) { + for ($x = 0; $x < 320; $x++) { + $this->assertEquals($y >= 22 && $y < 34 && $x >= 105 && $x < 185, $matrix->get($x, $y)); + } + } + } + + public function testGetRow() + { + $matrix = new BitMatrix(102, 5); + + for ($x = 0; $x < 102; $x++) { + if ($x & 3 === 0) { + $matrix->set($x, 2); + } + } + + $array1 = $matrix->getRow(2, null); + $this->assertEquals(102, $array1->getSize()); + + $array2 = new BitArray(60); + $array2 = $matrix->getRow(2, $array2); + $this->assertEquals(102, $array2->getSize()); + + $array3 = new BitArray(200); + $array3 = $matrix->getRow(2, $array3); + $this->assertEquals(200, $array3->getSize()); + + for ($x = 0; $x < 102; $x++) { + $on = ($x & 3 === 0); + + $this->assertEquals($on, $array1->get($x)); + $this->assertEquals($on, $array2->get($x)); + $this->assertEquals($on, $array3->get($x)); + } + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitUtilsTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitUtilsTest.php new file mode 100755 index 0000000..b80ff7d --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/BitUtilsTest.php @@ -0,0 +1,30 @@ +assertEquals(1, BitUtils::unsignedRightShift(1, 0)); + $this->assertEquals(1, BitUtils::unsignedRightShift(10, 3)); + $this->assertEquals(536870910, BitUtils::unsignedRightShift(-10, 3)); + } + + public function testNumberOfTrailingZeros() + { + $this->assertEquals(32, BitUtils::numberOfTrailingZeros(0)); + $this->assertEquals(1, BitUtils::numberOfTrailingZeros(10)); + $this->assertEquals(0, BitUtils::numberOfTrailingZeros(15)); + $this->assertEquals(2, BitUtils::numberOfTrailingZeros(20)); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ErrorCorrectionLevelTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ErrorCorrectionLevelTest.php new file mode 100755 index 0000000..736e995 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ErrorCorrectionLevelTest.php @@ -0,0 +1,40 @@ +assertEquals(0x0, ErrorCorrectionLevel::M); + $this->assertEquals(0x1, ErrorCorrectionLevel::L); + $this->assertEquals(0x2, ErrorCorrectionLevel::H); + $this->assertEquals(0x3, ErrorCorrectionLevel::Q); + } + + public function testInvalidErrorCorrectionLevelThrowsException() + { + $this->setExpectedException( + 'BaconQrCode\Exception\UnexpectedValueException', + 'Value not a const in enum BaconQrCode\Common\ErrorCorrectionLevel' + ); + new ErrorCorrectionLevel(4); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/FormatInformationTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/FormatInformationTest.php new file mode 100755 index 0000000..5f6ee58 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/FormatInformationTest.php @@ -0,0 +1,104 @@ +unmaskedTestFormatInfo = $this->maskedTestFormatInfo ^ 0x5412; + } + + + public function testBitsDiffering() + { + $this->assertEquals(0, FormatInformation::numBitsDiffering(1, 1)); + $this->assertEquals(1, FormatInformation::numBitsDiffering(0, 2)); + $this->assertEquals(2, FormatInformation::numBitsDiffering(1, 2)); + $this->assertEquals(32, FormatInformation::numBitsDiffering(-1, 0)); + } + + public function testDecode() + { + $expected = FormatInformation::decodeFormatInformation( + $this->maskedTestFormatInfo, + $this->maskedTestFormatInfo + ); + + $this->assertNotNull($expected); + $this->assertEquals(7, $expected->getDataMask()); + $this->assertEquals(ErrorCorrectionLevel::Q, $expected->getErrorCorrectionLevel()->get()); + + $this->assertEquals( + $expected, + FormatInformation::decodeFormatInformation( + $this->unmaskedTestFormatInfo, + $this->maskedTestFormatInfo + ) + ); + } + + public function testDecodeWithBitDifference() + { + $expected = FormatInformation::decodeFormatInformation( + $this->maskedTestFormatInfo, + $this->maskedTestFormatInfo + ); + + $this->assertEquals( + $expected, + FormatInformation::decodeFormatInformation( + $this->maskedTestFormatInfo ^ 0x1, + $this->maskedTestFormatInfo ^ 0x1 + ) + ); + $this->assertEquals( + $expected, + FormatInformation::decodeFormatInformation( + $this->maskedTestFormatInfo ^ 0x3, + $this->maskedTestFormatInfo ^ 0x3 + ) + ); + $this->assertEquals( + $expected, + FormatInformation::decodeFormatInformation( + $this->maskedTestFormatInfo ^ 0x7, + $this->maskedTestFormatInfo ^ 0x7 + ) + ); + $this->assertNull( + FormatInformation::decodeFormatInformation( + $this->maskedTestFormatInfo ^ 0xf, + $this->maskedTestFormatInfo ^ 0xf + ) + ); + } + + public function testDecodeWithMisRead() + { + $expected = FormatInformation::decodeFormatInformation( + $this->maskedTestFormatInfo, + $this->maskedTestFormatInfo + ); + + $this->assertEquals( + $expected, + FormatInformation::decodeFormatInformation( + $this->maskedTestFormatInfo ^ 0x3, + $this->maskedTestFormatInfo ^ 0xf + ) + ); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ModeTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ModeTest.php new file mode 100755 index 0000000..4daab7c --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ModeTest.php @@ -0,0 +1,42 @@ +assertEquals(0x0, Mode::TERMINATOR); + $this->assertEquals(0x1, Mode::NUMERIC); + $this->assertEquals(0x2, Mode::ALPHANUMERIC); + $this->assertEquals(0x4, Mode::BYTE); + $this->assertEquals(0x8, Mode::KANJI); + } + + public function testInvalidModeThrowsException() + { + $this->setExpectedException( + 'BaconQrCode\Exception\UnexpectedValueException', + 'Value not a const in enum BaconQrCode\Common\Mode' + ); + new Mode(10); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ReedSolomonCodecTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ReedSolomonCodecTest.php new file mode 100755 index 0000000..604641a --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/ReedSolomonCodecTest.php @@ -0,0 +1,111 @@ +encode($block, $parity); + + // Copy parity into test blocks + for ($i = 0; $i < $numRoots; $i++) { + $block[$i + $dataSize] = $parity[$i]; + $tBlock[$i + $dataSize] = $parity[$i]; + } + + // Seed with errors + for ($i = 0; $i < $errors; $i++) { + $errorValue = mt_rand(1, $blockSize); + + do { + $errorLocation = mt_rand(0, $blockSize); + } while ($errorLocations[$errorLocation] !== 0); + + $errorLocations[$errorLocation] = 1; + + if (mt_rand(0, 1)) { + $erasures[] = $errorLocation; + } + + $tBlock[$errorLocation] ^= $errorValue; + } + + $erasures = SplFixedArray::fromArray($erasures, false); + + // Decode the errored block + $foundErrors = $codec->decode($tBlock, $erasures); + + if ($errors > 0 && $foundErrors === null) { + $this->assertEquals($block, $tBlock, 'Decoder failed to correct errors'); + } + + $this->assertEquals($errors, $foundErrors, 'Found errors do not equal expected errors'); + + for ($i = 0; $i < $foundErrors; $i++) { + if ($errorLocations[$erasures[$i]] === 0) { + $this->fail(sprintf('Decoder indicates error in location %d without error', $erasures[$i])); + } + } + + $this->assertEquals($block, $tBlock, 'Decoder did not correct errors'); + } + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/VersionTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/VersionTest.php new file mode 100755 index 0000000..8b3fc01 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Common/VersionTest.php @@ -0,0 +1,88 @@ +assertNotNull($version); + $this->assertEquals($versionNumber, $version->getVersionNumber()); + $this->assertNotNull($version->getAlignmentPatternCenters()); + + if ($versionNumber > 1) { + $this->assertTrue(count($version->getAlignmentPatternCenters()) > 0); + } + + $this->assertEquals($dimension, $version->getDimensionForVersion()); + $this->assertNotNull($version->getEcBlocksForLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::H))); + $this->assertNotNull($version->getEcBlocksForLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::L))); + $this->assertNotNull($version->getEcBlocksForLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::M))); + $this->assertNotNull($version->getEcBlocksForLevel(new ErrorCorrectionLevel(ErrorCorrectionLevel::Q))); + $this->assertNotNull($version->buildFunctionPattern()); + } + + /** + * @dataProvider versionProvider + * @param integer $versionNumber + * @param integer $dimension + */ + public function testGetProvisionalVersionForDimension($versionNumber, $dimension) + { + $this->assertEquals( + $versionNumber, + Version::getProvisionalVersionForDimension($dimension)->getVersionNumber() + ); + } + + /** + * @dataProvider decodeInformationProvider + * @param integer $expectedVersion + * @param integer $mask + */ + public function testDecodeVersionInformation($expectedVersion, $mask) + { + $version = Version::decodeVersionInformation($mask); + $this->assertNotNull($version); + $this->assertEquals($expectedVersion, $version->getVersionNumber()); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/EncoderTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/EncoderTest.php new file mode 100755 index 0000000..31cdaa4 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/EncoderTest.php @@ -0,0 +1,468 @@ +getMethods(ReflectionMethod::IS_STATIC) as $method) { + $method->setAccessible(true); + $this->methods[$method->getName()] = $method; + } + } + + public function testGetAlphanumericCode() + { + // The first ten code points are numbers. + for ($i = 0; $i < 10; $i++) { + $this->assertEquals($i, $this->methods['getAlphanumericCode']->invoke(null, ord('0') + $i)); + } + + // The next 26 code points are capital alphabet letters. + for ($i = 10; $i < 36; $i++) { + // The first ten code points are numbers + $this->assertEquals($i, $this->methods['getAlphanumericCode']->invoke(null, ord('A') + $i - 10)); + } + + // Others are symbol letters. + $this->assertEquals(36, $this->methods['getAlphanumericCode']->invoke(null, ' ')); + $this->assertEquals(37, $this->methods['getAlphanumericCode']->invoke(null, '$')); + $this->assertEquals(38, $this->methods['getAlphanumericCode']->invoke(null, '%')); + $this->assertEquals(39, $this->methods['getAlphanumericCode']->invoke(null, '*')); + $this->assertEquals(40, $this->methods['getAlphanumericCode']->invoke(null, '+')); + $this->assertEquals(41, $this->methods['getAlphanumericCode']->invoke(null, '-')); + $this->assertEquals(42, $this->methods['getAlphanumericCode']->invoke(null, '.')); + $this->assertEquals(43, $this->methods['getAlphanumericCode']->invoke(null, '/')); + $this->assertEquals(44, $this->methods['getAlphanumericCode']->invoke(null, ':')); + + // Should return -1 for other letters. + $this->assertEquals(-1, $this->methods['getAlphanumericCode']->invoke(null, 'a')); + $this->assertEquals(-1, $this->methods['getAlphanumericCode']->invoke(null, '#')); + $this->assertEquals(-1, $this->methods['getAlphanumericCode']->invoke(null, "\0")); + } + + public function testChooseMode() + { + // Numeric mode + $this->assertSame(Mode::NUMERIC, $this->methods['chooseMode']->invoke(null, '0')->get()); + $this->assertSame(Mode::NUMERIC, $this->methods['chooseMode']->invoke(null, '0123456789')->get()); + + // Alphanumeric mode + $this->assertSame(Mode::ALPHANUMERIC, $this->methods['chooseMode']->invoke(null, 'A')->get()); + $this->assertSame(Mode::ALPHANUMERIC, $this->methods['chooseMode']->invoke(null, '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:')->get()); + + // 8-bit byte mode + $this->assertSame(Mode::BYTE, $this->methods['chooseMode']->invoke(null, 'a')->get()); + $this->assertSame(Mode::BYTE, $this->methods['chooseMode']->invoke(null, '#')->get()); + $this->assertSame(Mode::BYTE, $this->methods['chooseMode']->invoke(null, '')->get()); + + // AIUE in Hiragana in SHIFT-JIS + $this->assertSame(Mode::BYTE, $this->methods['chooseMode']->invoke(null, "\x8\xa\x8\xa\x8\xa\x8\xa6")->get()); + + // Nihon in Kanji in SHIFT-JIS + $this->assertSame(Mode::BYTE, $this->methods['chooseMode']->invoke(null, "\x9\xf\x9\x7b")->get()); + + // Sou-Utso-Byou in Kanji in SHIFT-JIS + $this->assertSame(Mode::BYTE, $this->methods['chooseMode']->invoke(null, "\xe\x4\x9\x5\x9\x61")->get()); + } + + public function testEncode() + { + $qrCode = Encoder::encode('ABCDEF', new ErrorCorrectionLevel(ErrorCorrectionLevel::H)); + $expected = "<<\n" + . " mode: ALPHANUMERIC\n" + . " ecLevel: H\n" + . " version: 1\n" + . " maskPattern: 0\n" + . " matrix:\n" + . " 1 1 1 1 1 1 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1\n" + . " 1 0 0 0 0 0 1 0 0 1 1 1 0 0 1 0 0 0 0 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 1 1 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 1 1 1 0 1 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 1\n" + . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n" + . " 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0 0 0\n" + . " 0 0 1 0 1 1 1 0 1 1 0 0 1 1 0 0 0 1 0 0 1\n" + . " 1 0 1 1 1 0 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0\n" + . " 0 0 1 1 0 0 1 0 1 0 0 0 1 0 1 0 1 0 1 1 0\n" + . " 1 1 0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 1 0\n" + . " 0 0 1 1 0 1 1 1 1 0 0 0 1 0 1 0 1 1 1 1 0\n" + . " 0 0 0 0 0 0 0 0 1 0 0 1 1 1 0 1 0 1 0 0 0\n" + . " 1 1 1 1 1 1 1 0 0 0 1 0 1 0 1 1 0 0 0 0 1\n" + . " 1 0 0 0 0 0 1 0 1 1 1 1 0 1 0 1 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 1 0 1 1 0 1 0 1 0 0 0 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 0 1 0\n" + . " 1 0 1 1 1 0 1 0 1 0 0 0 1 0 1 0 1 1 1 0 1\n" + . " 1 0 0 0 0 0 1 0 0 1 1 0 1 1 0 1 0 0 0 1 1\n" + . " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 1 0 1\n" + . ">>\n"; + + $this->assertEquals($expected, $qrCode->__toString()); + } + + public function testSimpleUtf8Eci() + { + $qrCode = Encoder::encode('hello', new ErrorCorrectionLevel(ErrorCorrectionLevel::H), 'utf-8'); + $expected = "<<\n" + . " mode: BYTE\n" + . " ecLevel: H\n" + . " version: 1\n" + . " maskPattern: 3\n" + . " matrix:\n" + . " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1\n" + . " 1 0 0 0 0 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 1 0 1 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 0 1\n" + . " 1 0 0 0 0 0 1 0 0 0 0 0 1 0 1 0 0 0 0 0 1\n" + . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n" + . " 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0\n" + . " 0 0 1 1 0 0 1 1 1 1 0 0 0 1 1 0 1 0 0 0 0\n" + . " 0 0 1 1 1 0 0 0 0 0 1 1 0 0 0 1 0 1 1 1 0\n" + . " 0 1 0 1 0 1 1 1 0 1 0 1 0 0 0 0 0 1 1 1 1\n" + . " 1 1 0 0 1 0 0 1 1 0 0 1 1 1 1 0 1 0 1 1 0\n" + . " 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 1 0 0 1 0 0\n" + . " 0 0 0 0 0 0 0 0 1 1 1 1 0 0 1 1 1 0 0 0 1\n" + . " 1 1 1 1 1 1 1 0 1 1 1 0 1 0 1 1 0 0 1 0 0\n" + . " 1 0 0 0 0 0 1 0 0 0 1 0 0 1 1 1 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 0 0 0 1 1 0 0 0 0 0\n" + . " 1 0 1 1 1 0 1 0 1 1 1 0 1 0 0 0 1 1 0 0 0\n" + . " 1 0 1 1 1 0 1 0 1 1 0 0 0 1 0 0 1 0 0 0 0\n" + . " 1 0 0 0 0 0 1 0 0 0 0 1 1 0 1 0 1 0 1 1 0\n" + . " 1 1 1 1 1 1 1 0 0 1 0 1 1 1 0 1 1 0 0 0 0\n" + . ">>\n"; + + $this->assertEquals($expected, $qrCode->__toString()); + } + + public function testAppendModeInfo() + { + $bits = new BitArray(); + $this->methods['appendModeInfo']->invoke(null, new Mode(Mode::NUMERIC), $bits); + $this->assertEquals(' ...X', $bits->__toString()); + } + + public function testAppendLengthInfo() + { + // 1 letter (1/1), 10 bits. + $bits = new BitArray(); + $this->methods['appendLengthInfo']->invoke( + null, + 1, + Version::getVersionForNumber(1), + new Mode(Mode::NUMERIC), + $bits + ); + $this->assertEquals(' ........ .X', $bits->__toString()); + + // 2 letters (2/1), 11 bits. + $bits = new BitArray(); + $this->methods['appendLengthInfo']->invoke( + null, + 2, + Version::getVersionForNumber(10), + new Mode(Mode::ALPHANUMERIC), + $bits + ); + $this->assertEquals(' ........ .X.', $bits->__toString()); + + // 255 letters (255/1), 16 bits. + $bits = new BitArray(); + $this->methods['appendLengthInfo']->invoke( + null, + 255, + Version::getVersionForNumber(27), + new Mode(Mode::BYTE), + $bits + ); + $this->assertEquals(' ........ XXXXXXXX', $bits->__toString()); + + // 512 letters (1024/2), 12 bits. + $bits = new BitArray(); + $this->methods['appendLengthInfo']->invoke( + null, + 512, + Version::getVersionForNumber(40), + new Mode(Mode::KANJI), + $bits + ); + $this->assertEquals(' ..X..... ....', $bits->__toString()); + } + + public function testAppendBytes() + { + // Should use appendNumericBytes. + // 1 = 01 = 0001 in 4 bits. + $bits = new BitArray(); + $this->methods['appendBytes']->invoke( + null, + '1', + new Mode(Mode::NUMERIC), + $bits, + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->assertEquals(' ...X', $bits->__toString()); + + // Should use appendAlphaNumericBytes. + // A = 10 = 0xa = 001010 in 6 bits. + $bits = new BitArray(); + $this->methods['appendBytes']->invoke( + null, + 'A', + new Mode(Mode::ALPHANUMERIC), + $bits, + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->assertEquals(' ..X.X.', $bits->__toString()); + + // Should use append8BitBytes. + // 0x61, 0x62, 0x63 + $bits = new BitArray(); + $this->methods['appendBytes']->invoke( + null, + 'abc', + new Mode(Mode::BYTE), + $bits, + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->assertEquals(' .XX....X .XX...X. .XX...XX', $bits->__toString()); + + // Should use appendKanjiBytes. + // 0x93, 0x5f + $bits = new BitArray(); + $this->methods['appendBytes']->invoke( + null, + "\x93\x5f", + new Mode(Mode::KANJI), + $bits, + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->assertEquals(' .XX.XX.. XXXXX', $bits->__toString()); + + // Lower letters such as 'a' cannot be encoded in alphanumeric mode. + $this->setExpectedException( + 'BaconQrCode\Exception\WriterException', + 'Invalid alphanumeric code' + ); + $this->methods['appendBytes']->invoke( + null, + "a", + new Mode(Mode::ALPHANUMERIC), + $bits, + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + } + + public function testTerminateBits() + { + $bits = new BitArray(); + $this->methods['terminateBits']->invoke(null, 0, $bits); + $this->assertEquals('', $bits->__toString()); + + $bits = new BitArray(); + $this->methods['terminateBits']->invoke(null, 1, $bits); + $this->assertEquals(' ........', $bits->__toString()); + + $bits = new BitArray(); + $bits->appendBits(0, 3); + $this->methods['terminateBits']->invoke(null, 1, $bits); + $this->assertEquals(' ........', $bits->__toString()); + + $bits = new BitArray(); + $bits->appendBits(0, 5); + $this->methods['terminateBits']->invoke(null, 1, $bits); + $this->assertEquals(' ........', $bits->__toString()); + + $bits = new BitArray(); + $bits->appendBits(0, 8); + $this->methods['terminateBits']->invoke(null, 1, $bits); + $this->assertEquals(' ........', $bits->__toString()); + + $bits = new BitArray(); + $this->methods['terminateBits']->invoke(null, 2, $bits); + $this->assertEquals(' ........ XXX.XX..', $bits->__toString()); + + $bits = new BitArray(); + $bits->appendBits(0, 1); + $this->methods['terminateBits']->invoke(null, 3, $bits); + $this->assertEquals(' ........ XXX.XX.. ...X...X', $bits->__toString()); + } + + public function testGetNumDataBytesAndNumEcBytesForBlockId() + { + // Version 1-H. + list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']->invoke(null, 26, 9, 1, 0); + $this->assertEquals(9, $numDataBytes); + $this->assertEquals(17, $numEcBytes); + + // Version 3-H. 2 blocks. + list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']->invoke(null, 70, 26, 2, 0); + $this->assertEquals(13, $numDataBytes); + $this->assertEquals(22, $numEcBytes); + list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']->invoke(null, 70, 26, 2, 1); + $this->assertEquals(13, $numDataBytes); + $this->assertEquals(22, $numEcBytes); + + // Version 7-H. (4 + 1) blocks. + list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']->invoke(null, 196, 66, 5, 0); + $this->assertEquals(13, $numDataBytes); + $this->assertEquals(26, $numEcBytes); + list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']->invoke(null, 196, 66, 5, 4); + $this->assertEquals(14, $numDataBytes); + $this->assertEquals(26, $numEcBytes); + + // Version 40-H. (20 + 61) blocks. + list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']->invoke(null, 3706, 1276, 81, 0); + $this->assertEquals(15, $numDataBytes); + $this->assertEquals(30, $numEcBytes); + list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']->invoke(null, 3706, 1276, 81, 20); + $this->assertEquals(16, $numDataBytes); + $this->assertEquals(30, $numEcBytes); + list($numDataBytes, $numEcBytes) = $this->methods['getNumDataBytesAndNumEcBytesForBlockId']->invoke(null, 3706, 1276, 81, 80); + $this->assertEquals(16, $numDataBytes); + $this->assertEquals(30, $numEcBytes); + } + + public function testInterleaveWithEcBytes() + { + $dataBytes = SplFixedArray::fromArray(array(32, 65, 205, 69, 41, 220, 46, 128, 236), false); + $in = new BitArray(); + + foreach ($dataBytes as $dataByte) { + $in->appendBits($dataByte, 8); + } + + $outBits = $this->methods['interleaveWithEcBytes']->invoke(null, $in, 26, 9, 1); + $expected = SplFixedArray::fromArray(array( + // Data bytes. + 32, 65, 205, 69, 41, 220, 46, 128, 236, + // Error correction bytes. + 42, 159, 74, 221, 244, 169, 239, 150, 138, 70, 237, 85, 224, 96, 74, 219, 61, + ), false); + + $out = $outBits->toBytes(0, count($expected)); + + $this->assertEquals($expected, $out); + } + + public function testAppendNumericBytes() + { + // 1 = 01 = 0001 in 4 bits. + $bits = new BitArray(); + $this->methods['appendNumericBytes']->invoke(null, '1', $bits); + $this->assertEquals(' ...X', $bits->__toString()); + + // 12 = 0xc = 0001100 in 7 bits. + $bits = new BitArray(); + $this->methods['appendNumericBytes']->invoke(null, '12', $bits); + $this->assertEquals(' ...XX..', $bits->__toString()); + + // 123 = 0x7b = 0001111011 in 10 bits. + $bits = new BitArray(); + $this->methods['appendNumericBytes']->invoke(null, '123', $bits); + $this->assertEquals(' ...XXXX. XX', $bits->__toString()); + + // 1234 = "123" + "4" = 0001111011 + 0100 in 14 bits. + $bits = new BitArray(); + $this->methods['appendNumericBytes']->invoke(null, '1234', $bits); + $this->assertEquals(' ...XXXX. XX.X..', $bits->__toString()); + + // Empty + $bits = new BitArray(); + $this->methods['appendNumericBytes']->invoke(null, '', $bits); + $this->assertEquals('', $bits->__toString()); + } + + public function testAppendAlphanumericBytes() + { + $bits = new BitArray(); + $this->methods['appendAlphanumericBytes']->invoke(null, 'A', $bits); + $this->assertEquals(' ..X.X.', $bits->__toString()); + + $bits = new BitArray(); + $this->methods['appendAlphanumericBytes']->invoke(null, 'AB', $bits); + $this->assertEquals(' ..XXX..X X.X', $bits->__toString()); + + $bits = new BitArray(); + $this->methods['appendAlphanumericBytes']->invoke(null, 'ABC', $bits); + $this->assertEquals(' ..XXX..X X.X..XX. .', $bits->__toString()); + + // Empty + $bits = new BitArray(); + $this->methods['appendAlphanumericBytes']->invoke(null, '', $bits); + $this->assertEquals('', $bits->__toString()); + + // Invalid data + $this->setExpectedException('BaconQrCode\Exception\WriterException', 'Invalid alphanumeric code'); + $bits = new BitArray(); + $this->methods['appendAlphanumericBytes']->invoke(null, 'abc', $bits); + } + + public function testAppend8BitBytes() + { + // 0x61, 0x62, 0x63 + $bits = new BitArray(); + $this->methods['append8BitBytes']->invoke(null, 'abc', $bits, Encoder::DEFAULT_BYTE_MODE_ECODING); + $this->assertEquals(' .XX....X .XX...X. .XX...XX', $bits->__toString()); + + // Empty + $bits = new BitArray(); + $this->methods['append8BitBytes']->invoke(null, '', $bits, Encoder::DEFAULT_BYTE_MODE_ECODING); + $this->assertEquals('', $bits->__toString()); + } + + public function testAppendKanjiBytes() + { + // Numbers are from page 21 of JISX0510:2004 + $bits = new BitArray(); + $this->methods['appendKanjiBytes']->invoke(null, "\x93\x5f", $bits); + $this->assertEquals(' .XX.XX.. XXXXX', $bits->__toString()); + + $this->methods['appendKanjiBytes']->invoke(null, "\xe4\xaa", $bits); + $this->assertEquals(' .XX.XX.. XXXXXXX. X.X.X.X. X.', $bits->__toString()); + } + + public function testGenerateEcBytes() + { + // Numbers are from http://www.swetake.com/qr/qr3.html and + // http://www.swetake.com/qr/qr9.html + $dataBytes = SplFixedArray::fromArray(array(32, 65, 205, 69, 41, 220, 46, 128, 236), false); + $ecBytes = $this->methods['generateEcBytes']->invoke(null, $dataBytes, 17); + $expected = SplFixedArray::fromArray(array(42, 159, 74, 221, 244, 169, 239, 150, 138, 70, 237, 85, 224, 96, 74, 219, 61), false); + $this->assertEquals($expected, $ecBytes); + + $dataBytes = SplFixedArray::fromArray(array(67, 70, 22, 38, 54, 70, 86, 102, 118, 134, 150, 166, 182, 198, 214), false); + $ecBytes = $this->methods['generateEcBytes']->invoke(null, $dataBytes, 18); + $expected = SplFixedArray::fromArray(array(175, 80, 155, 64, 178, 45, 214, 233, 65, 209, 12, 155, 117, 31, 140, 214, 27, 187), false); + $this->assertEquals($expected, $ecBytes); + + // High-order zero coefficient case. + $dataBytes = SplFixedArray::fromArray(array(32, 49, 205, 69, 42, 20, 0, 236, 17), false); + $ecBytes = $this->methods['generateEcBytes']->invoke(null, $dataBytes, 17); + $expected = SplFixedArray::fromArray(array(0, 3, 130, 179, 194, 0, 55, 211, 110, 79, 98, 72, 170, 96, 211, 137, 213), false); + $this->assertEquals($expected, $ecBytes); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/MaskUtilTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/MaskUtilTest.php new file mode 100755 index 0000000..a5c3865 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/MaskUtilTest.php @@ -0,0 +1,281 @@ +fail('Data mask bit did not match'); + } + } + } + } + + public function testApplyMaskPenaltyRule1() + { + $matrix = new ByteMatrix(4, 1); + $matrix->set(0, 0, 0); + $matrix->set(1, 0, 0); + $matrix->set(2, 0, 0); + $matrix->set(3, 0, 0); + + $this->assertEquals(0, MaskUtil::applyMaskPenaltyRule1($matrix)); + + // Horizontal + $matrix = new ByteMatrix(6, 1); + $matrix->set(0, 0, 0); + $matrix->set(1, 0, 0); + $matrix->set(2, 0, 0); + $matrix->set(3, 0, 0); + $matrix->set(4, 0, 0); + $matrix->set(5, 0, 1); + $this->assertEquals(3, MaskUtil::applyMaskPenaltyRule1($matrix)); + $matrix->set(5, 0, 0); + $this->assertEquals(4, MaskUtil::applyMaskPenaltyRule1($matrix)); + + // Vertical + $matrix = new ByteMatrix(1, 6); + $matrix->set(0, 0, 0); + $matrix->set(0, 1, 0); + $matrix->set(0, 2, 0); + $matrix->set(0, 3, 0); + $matrix->set(0, 4, 0); + $matrix->set(0, 5, 1); + $this->assertEquals(3, MaskUtil::applyMaskPenaltyRule1($matrix)); + $matrix->set(0, 5, 0); + $this->assertEquals(4, MaskUtil::applyMaskPenaltyRule1($matrix)); + } + + public function testApplyMaskPenaltyRule2() + { + $matrix = new ByteMatrix(1, 1); + $matrix->set(0, 0, 0); + $this->assertEquals(0, MaskUtil::applyMaskPenaltyRule2($matrix)); + + $matrix = new ByteMatrix(2, 2); + $matrix->set(0, 0, 0); + $matrix->set(1, 0, 0); + $matrix->set(0, 1, 0); + $matrix->set(1, 1, 1); + $this->assertEquals(0, MaskUtil::applyMaskPenaltyRule2($matrix)); + + $matrix = new ByteMatrix(2, 2); + $matrix->set(0, 0, 0); + $matrix->set(1, 0, 0); + $matrix->set(0, 1, 0); + $matrix->set(1, 1, 0); + $this->assertEquals(3, MaskUtil::applyMaskPenaltyRule2($matrix)); + + $matrix = new ByteMatrix(3, 3); + $matrix->set(0, 0, 0); + $matrix->set(1, 0, 0); + $matrix->set(2, 0, 0); + $matrix->set(0, 1, 0); + $matrix->set(1, 1, 0); + $matrix->set(2, 1, 0); + $matrix->set(0, 2, 0); + $matrix->set(1, 2, 0); + $matrix->set(2, 2, 0); + $this->assertEquals(3 * 4, MaskUtil::applyMaskPenaltyRule2($matrix)); + } + + public function testApplyMaskPenalty3() + { + // Horizontal 00001011101 + $matrix = new ByteMatrix(11, 1); + $matrix->set(0, 0, 0); + $matrix->set(1, 0, 0); + $matrix->set(2, 0, 0); + $matrix->set(3, 0, 0); + $matrix->set(4, 0, 1); + $matrix->set(5, 0, 0); + $matrix->set(6, 0, 1); + $matrix->set(7, 0, 1); + $matrix->set(8, 0, 1); + $matrix->set(9, 0, 0); + $matrix->set(10, 0, 1); + $this->assertEquals(40, MaskUtil::applyMaskPenaltyRule3($matrix)); + + // Horizontal 10111010000 + $matrix = new ByteMatrix(11, 1); + $matrix->set(0, 0, 1); + $matrix->set(1, 0, 0); + $matrix->set(2, 0, 1); + $matrix->set(3, 0, 1); + $matrix->set(4, 0, 1); + $matrix->set(5, 0, 0); + $matrix->set(6, 0, 1); + $matrix->set(7, 0, 0); + $matrix->set(8, 0, 0); + $matrix->set(9, 0, 0); + $matrix->set(10, 0, 0); + $this->assertEquals(40, MaskUtil::applyMaskPenaltyRule3($matrix)); + + // Vertical 00001011101 + $matrix = new ByteMatrix(1, 11); + $matrix->set(0, 0, 0); + $matrix->set(0, 1, 0); + $matrix->set(0, 2, 0); + $matrix->set(0, 3, 0); + $matrix->set(0, 4, 1); + $matrix->set(0, 5, 0); + $matrix->set(0, 6, 1); + $matrix->set(0, 7, 1); + $matrix->set(0, 8, 1); + $matrix->set(0, 9, 0); + $matrix->set(0, 10, 1); + $this->assertEquals(40, MaskUtil::applyMaskPenaltyRule3($matrix)); + + // Vertical 10111010000 + $matrix = new ByteMatrix(1, 11); + $matrix->set(0, 0, 1); + $matrix->set(0, 1, 0); + $matrix->set(0, 2, 1); + $matrix->set(0, 3, 1); + $matrix->set(0, 4, 1); + $matrix->set(0, 5, 0); + $matrix->set(0, 6, 1); + $matrix->set(0, 7, 0); + $matrix->set(0, 8, 0); + $matrix->set(0, 9, 0); + $matrix->set(0, 10, 0); + $this->assertEquals(40, MaskUtil::applyMaskPenaltyRule3($matrix)); + } + + public function testApplyMaskPenaltyRule4() + { + // Dark cell ratio = 0% + $matrix = new ByteMatrix(1, 1); + $matrix->set(0, 0, 0); + $this->assertEquals(100, MaskUtil::applyMaskPenaltyRule4($matrix)); + + // Dark cell ratio = 5% + $matrix = new ByteMatrix(2, 1); + $matrix->set(0, 0, 0); + $matrix->set(0, 0, 1); + $this->assertEquals(0, MaskUtil::applyMaskPenaltyRule4($matrix)); + + // Dark cell ratio = 66.67% + $matrix = new ByteMatrix(6, 1); + $matrix->set(0, 0, 0); + $matrix->set(1, 0, 1); + $matrix->set(2, 0, 1); + $matrix->set(3, 0, 1); + $matrix->set(4, 0, 1); + $matrix->set(5, 0, 0); + $this->assertEquals(30, MaskUtil::applyMaskPenaltyRule4($matrix)); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/MatrixUtilTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/MatrixUtilTest.php new file mode 100755 index 0000000..bf3544f --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Encoder/MatrixUtilTest.php @@ -0,0 +1,336 @@ +getMethods(ReflectionMethod::IS_STATIC) as $method) { + $method->setAccessible(true); + $this->methods[$method->getName()] = $method; + } + } + + public function testToString() + { + $matrix= new ByteMatrix(3, 3); + $matrix->set(0, 0, 0); + $matrix->set(1, 0, 1); + $matrix->set(2, 0, 0); + $matrix->set(0, 1, 1); + $matrix->set(1, 1, 0); + $matrix->set(2, 1, 1); + $matrix->set(0, 2, -1); + $matrix->set(1, 2, -1); + $matrix->set(2, 2, -1); + + $expected = " 0 1 0\n 1 0 1\n \n"; + $this->assertEquals($expected, $matrix->__toString()); + } + + public function testClearMatrix() + { + $matrix = new ByteMatrix(2, 2); + MatrixUtil::clearMatrix($matrix); + + $this->assertEquals(-1, $matrix->get(0, 0)); + $this->assertEquals(-1, $matrix->get(1, 0)); + $this->assertEquals(-1, $matrix->get(0, 1)); + $this->assertEquals(-1, $matrix->get(1, 1)); + } + + public function testEmbedBasicPatterns1() + { + $matrix = new ByteMatrix(21, 21); + MatrixUtil::clearMatrix($matrix); + $this->methods['embedBasicPatterns']->invoke( + null, + Version::getVersionForNumber(1), + $matrix + ); + $expected = " 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1\n" + . " 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1\n" + . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n" + . " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 \n" + . " 0 \n" + . " 1 \n" + . " 0 \n" + . " 1 \n" + . " 0 0 0 0 0 0 0 0 1 \n" + . " 1 1 1 1 1 1 1 0 \n" + . " 1 0 0 0 0 0 1 0 \n" + . " 1 0 1 1 1 0 1 0 \n" + . " 1 0 1 1 1 0 1 0 \n" + . " 1 0 1 1 1 0 1 0 \n" + . " 1 0 0 0 0 0 1 0 \n" + . " 1 1 1 1 1 1 1 0 \n"; + + $this->assertEquals($expected, $matrix->__toString()); + } + + public function testEmbedBasicPatterns2() + { + $matrix = new ByteMatrix(25, 25); + MatrixUtil::clearMatrix($matrix); + $this->methods['embedBasicPatterns']->invoke( + null, + Version::getVersionForNumber(2), + $matrix + ); + $expected = " 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1\n" + . " 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1\n" + . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n" + . " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 \n" + . " 0 \n" + . " 1 \n" + . " 0 \n" + . " 1 \n" + . " 0 \n" + . " 1 \n" + . " 0 \n" + . " 1 1 1 1 1 1 \n" + . " 0 0 0 0 0 0 0 0 1 1 0 0 0 1 \n" + . " 1 1 1 1 1 1 1 0 1 0 1 0 1 \n" + . " 1 0 0 0 0 0 1 0 1 0 0 0 1 \n" + . " 1 0 1 1 1 0 1 0 1 1 1 1 1 \n" + . " 1 0 1 1 1 0 1 0 \n" + . " 1 0 1 1 1 0 1 0 \n" + . " 1 0 0 0 0 0 1 0 \n" + . " 1 1 1 1 1 1 1 0 \n"; + + $this->assertEquals($expected, $matrix->__toString()); + } + + public function testEmbedTypeInfo() + { + $matrix = new ByteMatrix(21, 21); + MatrixUtil::clearMatrix($matrix); + $this->methods['embedTypeInfo']->invoke( + null, + new ErrorCorrectionLevel(ErrorCorrectionLevel::M), + 5, + $matrix + ); + $expected = " 0 \n" + . " 1 \n" + . " 1 \n" + . " 1 \n" + . " 0 \n" + . " 0 \n" + . " \n" + . " 1 \n" + . " 1 0 0 0 0 0 0 1 1 1 0 0 1 1 1 0\n" + . " \n" + . " \n" + . " \n" + . " \n" + . " \n" + . " 0 \n" + . " 0 \n" + . " 0 \n" + . " 0 \n" + . " 0 \n" + . " 0 \n" + . " 1 \n"; + + $this->assertEquals($expected, $matrix->__toString()); + } + + public function testEmbedVersionInfo() + { + $matrix = new ByteMatrix(21, 21); + MatrixUtil::clearMatrix($matrix); + $this->methods['maybeEmbedVersionInfo']->invoke( + null, + Version::getVersionForNumber(7), + $matrix + ); + $expected = " 0 0 1 \n" + . " 0 1 0 \n" + . " 0 1 0 \n" + . " 0 1 1 \n" + . " 1 1 1 \n" + . " 0 0 0 \n" + . " \n" + . " \n" + . " \n" + . " \n" + . " 0 0 0 0 1 0 \n" + . " 0 1 1 1 1 0 \n" + . " 1 0 0 1 1 0 \n" + . " \n" + . " \n" + . " \n" + . " \n" + . " \n" + . " \n" + . " \n" + . " \n"; + + $this->assertEquals($expected, $matrix->__toString()); + } + + public function testEmbedDataBits() + { + $matrix = new ByteMatrix(21, 21); + MatrixUtil::clearMatrix($matrix); + $this->methods['embedBasicPatterns']->invoke( + null, + Version::getVersionForNumber(1), + $matrix + ); + + $bits = new BitArray(); + $this->methods['embedDataBits']->invoke( + null, + $bits, + -1, + $matrix + ); + + $expected = " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1\n" + . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1\n" + . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 1 0 1 1 1 0 1\n" + . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1\n" + . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n" + . " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 0 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n" + . " 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n"; + + $this->assertEquals($expected, $matrix->__toString()); + } + + public function testBuildMatrix() + { + $bytes = array( + 32, 65, 205, 69, 41, 220, 46, 128, 236, 42, 159, 74, 221, 244, 169, + 239, 150, 138, 70, 237, 85, 224, 96, 74, 219 , 61 + ); + $bits = new BitArray(); + + foreach ($bytes as $byte) { + $bits->appendBits($byte, 8); + } + + $matrix = new ByteMatrix(21, 21); + MatrixUtil::buildMatrix( + $bits, + new ErrorCorrectionLevel(ErrorCorrectionLevel::H), + Version::getVersionForNumber(1), + 3, + $matrix + ); + + $expected = " 1 1 1 1 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 1 1\n" + . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 1\n" + . " 1 0 1 1 1 0 1 0 0 0 0 1 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 0 1 1 0 0 0 1 0 1 1 1 0 1\n" + . " 1 0 1 1 1 0 1 0 1 1 0 0 1 0 1 0 1 1 1 0 1\n" + . " 1 0 0 0 0 0 1 0 0 0 1 1 1 0 1 0 0 0 0 0 1\n" + . " 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1\n" + . " 0 0 0 0 0 0 0 0 1 1 0 1 1 0 0 0 0 0 0 0 0\n" + . " 0 0 1 1 0 0 1 1 1 0 0 1 1 1 1 0 1 0 0 0 0\n" + . " 1 0 1 0 1 0 0 0 0 0 1 1 1 0 0 1 0 1 1 1 0\n" + . " 1 1 1 1 0 1 1 0 1 0 1 1 1 0 0 1 1 1 0 1 0\n" + . " 1 0 1 0 1 1 0 1 1 1 0 0 1 1 1 0 0 1 0 1 0\n" + . " 0 0 1 0 0 1 1 1 0 0 0 0 0 0 1 0 1 1 1 1 1\n" + . " 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 1 0 1 1\n" + . " 1 1 1 1 1 1 1 0 1 1 1 1 0 0 0 0 1 0 1 1 0\n" + . " 1 0 0 0 0 0 1 0 0 0 0 1 0 1 1 1 0 0 0 0 0\n" + . " 1 0 1 1 1 0 1 0 0 1 0 0 1 1 0 0 1 0 0 1 1\n" + . " 1 0 1 1 1 0 1 0 1 1 0 1 0 0 0 0 0 1 1 1 0\n" + . " 1 0 1 1 1 0 1 0 1 1 1 1 0 0 0 0 1 1 1 0 0\n" + . " 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 1 0 0\n" + . " 1 1 1 1 1 1 1 0 0 0 1 1 1 1 1 0 1 0 0 1 0\n"; + + $this->assertEquals($expected, $matrix->__toString()); + } + + public function testFindMsbSet() + { + $this->assertEquals(0, $this->methods['findMsbSet']->invoke(null, 0)); + $this->assertEquals(1, $this->methods['findMsbSet']->invoke(null, 1)); + $this->assertEquals(8, $this->methods['findMsbSet']->invoke(null, 0x80)); + $this->assertEquals(32, $this->methods['findMsbSet']->invoke(null, 0x80000000)); + } + + public function testCalculateBchCode() + { + // Encoding of type information. + // From Appendix C in JISX0510:2004 (p 65) + $this->assertEquals(0xdc, $this->methods['calculateBchCode']->invoke(null, 5, 0x537)); + // From http://www.swetake.com/qr/qr6.html + $this->assertEquals(0x1c2, $this->methods['calculateBchCode']->invoke(null, 0x13, 0x537)); + // From http://www.swetake.com/qr/qr11.html + $this->assertEquals(0x214, $this->methods['calculateBchCode']->invoke(null, 0x1b, 0x537)); + + // Encoding of version information. + // From Appendix D in JISX0510:2004 (p 68) + $this->assertEquals(0xc94, $this->methods['calculateBchCode']->invoke(null, 7, 0x1f25)); + $this->assertEquals(0x5bc, $this->methods['calculateBchCode']->invoke(null, 8, 0x1f25)); + $this->assertEquals(0xa99, $this->methods['calculateBchCode']->invoke(null, 9, 0x1f25)); + $this->assertEquals(0x4d3, $this->methods['calculateBchCode']->invoke(null, 10, 0x1f25)); + $this->assertEquals(0x9a6, $this->methods['calculateBchCode']->invoke(null, 20, 0x1f25)); + $this->assertEquals(0xd75, $this->methods['calculateBchCode']->invoke(null, 30, 0x1f25)); + $this->assertEquals(0xc69, $this->methods['calculateBchCode']->invoke(null, 40, 0x1f25)); + } + + public function testMakeVersionInfoBits() + { + // From Appendix D in JISX0510:2004 (p 68) + $bits = new BitArray(); + $this->methods['makeVersionInfoBits']->invoke(null, Version::getVersionForNumber(7), $bits); + $this->assertEquals(' ...XXXXX ..X..X.X ..', $bits->__toString()); + } + + public function testMakeTypeInfoBits() + { + // From Appendix D in JISX0510:2004 (p 68) + $bits = new BitArray(); + $this->methods['makeTypeInfoBits']->invoke(null, new ErrorCorrectionLevel(ErrorCorrectionLevel::M), 5, $bits); + $this->assertEquals(' X......X X..XXX.', $bits->__toString()); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Renderer/Text/HtmlTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Renderer/Text/HtmlTest.php new file mode 100755 index 0000000..0c69dd2 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Renderer/Text/HtmlTest.php @@ -0,0 +1,99 @@ +renderer = new Html(); + $this->writer = new Writer($this->renderer); + } + + public function testBasicRender() + { + $content = 'foobar'; + $expected = + '
      ' .
      +            "                       \n" .
      +            " 鈻堚枅鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅鈻堚枅鈻� \n" .
      +            " 鈻�     鈻�  鈻� 鈻�  鈻�     鈻� \n" .
      +            " 鈻� 鈻堚枅鈻� 鈻�  鈻堚枅   鈻� 鈻堚枅鈻� 鈻� \n" .
      +            " 鈻� 鈻堚枅鈻� 鈻�  鈻堚枅鈻�  鈻� 鈻堚枅鈻� 鈻� \n" .
      +            " 鈻� 鈻堚枅鈻� 鈻�   鈻� 鈻� 鈻� 鈻堚枅鈻� 鈻� \n" .
      +            " 鈻�     鈻�    鈻堚枅 鈻�     鈻� \n" .
      +            " 鈻堚枅鈻堚枅鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻堚枅鈻堚枅鈻堚枅鈻� \n" .
      +            "         鈻堚枅鈻堚枅鈻�         \n" .
      +            " 鈻堚枅 鈻堚枅 鈻�  鈻堚枅 鈻� 鈻�     鈻� \n" .
      +            "    鈻堚枅    鈻堚枅 鈻� 鈻� 鈻堚枅    \n" .
      +            "  鈻堚枅鈻堚枅鈻堚枅鈻堚枅 鈻�  鈻堚枅 鈻�  鈻堚枅 \n" .
      +            "           鈻堚枅      鈻� 鈻� \n" .
      +            "  鈻堚枅  鈻堚枅鈻�  鈻�   鈻�  鈻�  鈻� \n" .
      +            "         鈻� 鈻堚枅鈻�    鈻� 鈻�  \n" .
      +            " 鈻堚枅鈻堚枅鈻堚枅鈻�  鈻堚枅 鈻堚枅鈻堚枅鈻堚枅    \n" .
      +            " 鈻�     鈻�   鈻堚枅鈻堚枅   鈻堚枅   \n" .
      +            " 鈻� 鈻堚枅鈻� 鈻� 鈻堚枅 鈻堚枅 鈻堚枅 鈻� 鈻堚枅 \n" .
      +            " 鈻� 鈻堚枅鈻� 鈻� 鈻堚枅 鈻堚枅  鈻� 鈻堚枅   \n" .
      +            " 鈻� 鈻堚枅鈻� 鈻�   鈻�   鈻� 鈻堚枅 鈻堚枅 \n" .
      +            " 鈻�     鈻� 鈻堚枅鈻�  鈻堚枅鈻� 鈻堚枅鈻堚枅 \n" .
      +            " 鈻堚枅鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅   鈻堚枅     \n" .
      +            "                       \n" .
      +            '
      ' + ; + + $qrCode = Encoder::encode( + $content, + new ErrorCorrectionLevel(ErrorCorrectionLevel::L), + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->assertEquals($expected, $this->renderer->render($qrCode)); + } + + public function testSetStyle() + { + $content = 'foobar'; + $qrCode = Encoder::encode( + $content, + new ErrorCorrectionLevel(ErrorCorrectionLevel::L), + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->renderer->setStyle('bar'); + $this->assertEquals('bar', $this->renderer->getStyle()); + $this->assertStringMatchesFormat('%astyle="bar"%a', $this->renderer->render($qrCode)); + } + + public function testSetClass() + { + $content = 'foobar'; + $qrCode = Encoder::encode( + $content, + new ErrorCorrectionLevel(ErrorCorrectionLevel::L), + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->renderer->setClass('bar'); + $this->assertEquals('bar', $this->renderer->getClass()); + $this->assertStringMatchesFormat('%aclass="bar"%a', $this->renderer->render($qrCode)); + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Renderer/Text/TextTest.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Renderer/Text/TextTest.php new file mode 100755 index 0000000..d94e8e5 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/BaconQrCode/Renderer/Text/TextTest.php @@ -0,0 +1,149 @@ +renderer = new Plain(); + $this->writer = new Writer($this->renderer); + } + + public function testBasicRender() + { + $content = 'foobar'; + $expected = + " \n" . + " 鈻堚枅鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅鈻堚枅鈻� \n" . + " 鈻� 鈻� 鈻� 鈻� 鈻� 鈻� \n" . + " 鈻� 鈻堚枅鈻� 鈻� 鈻堚枅 鈻� 鈻堚枅鈻� 鈻� \n" . + " 鈻� 鈻堚枅鈻� 鈻� 鈻堚枅鈻� 鈻� 鈻堚枅鈻� 鈻� \n" . + " 鈻� 鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻� 鈻堚枅鈻� 鈻� \n" . + " 鈻� 鈻� 鈻堚枅 鈻� 鈻� \n" . + " 鈻堚枅鈻堚枅鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻堚枅鈻堚枅鈻堚枅鈻� \n" . + " 鈻堚枅鈻堚枅鈻� \n" . + " 鈻堚枅 鈻堚枅 鈻� 鈻堚枅 鈻� 鈻� 鈻� \n" . + " 鈻堚枅 鈻堚枅 鈻� 鈻� 鈻堚枅 \n" . + " 鈻堚枅鈻堚枅鈻堚枅鈻堚枅 鈻� 鈻堚枅 鈻� 鈻堚枅 \n" . + " 鈻堚枅 鈻� 鈻� \n" . + " 鈻堚枅 鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻� \n" . + " 鈻� 鈻堚枅鈻� 鈻� 鈻� \n" . + " 鈻堚枅鈻堚枅鈻堚枅鈻� 鈻堚枅 鈻堚枅鈻堚枅鈻堚枅 \n" . + " 鈻� 鈻� 鈻堚枅鈻堚枅 鈻堚枅 \n" . + " 鈻� 鈻堚枅鈻� 鈻� 鈻堚枅 鈻堚枅 鈻堚枅 鈻� 鈻堚枅 \n" . + " 鈻� 鈻堚枅鈻� 鈻� 鈻堚枅 鈻堚枅 鈻� 鈻堚枅 \n" . + " 鈻� 鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻堚枅 鈻堚枅 \n" . + " 鈻� 鈻� 鈻堚枅鈻� 鈻堚枅鈻� 鈻堚枅鈻堚枅 \n" . + " 鈻堚枅鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅 鈻堚枅 \n" . + " \n" + ; + + $qrCode = Encoder::encode( + $content, + new ErrorCorrectionLevel(ErrorCorrectionLevel::L), + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->assertEquals($expected, $this->renderer->render($qrCode)); + } + + public function testBasicRenderNoMargins() + { + $content = 'foobar'; + $expected = + "鈻堚枅鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅鈻堚枅鈻圽n" . + "鈻� 鈻� 鈻� 鈻� 鈻� 鈻圽n" . + "鈻� 鈻堚枅鈻� 鈻� 鈻堚枅 鈻� 鈻堚枅鈻� 鈻圽n" . + "鈻� 鈻堚枅鈻� 鈻� 鈻堚枅鈻� 鈻� 鈻堚枅鈻� 鈻圽n" . + "鈻� 鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻� 鈻堚枅鈻� 鈻圽n" . + "鈻� 鈻� 鈻堚枅 鈻� 鈻圽n" . + "鈻堚枅鈻堚枅鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻堚枅鈻堚枅鈻堚枅鈻圽n" . + " 鈻堚枅鈻堚枅鈻� \n" . + "鈻堚枅 鈻堚枅 鈻� 鈻堚枅 鈻� 鈻� 鈻圽n" . + " 鈻堚枅 鈻堚枅 鈻� 鈻� 鈻堚枅 \n" . + " 鈻堚枅鈻堚枅鈻堚枅鈻堚枅 鈻� 鈻堚枅 鈻� 鈻堚枅\n" . + " 鈻堚枅 鈻� 鈻圽n" . + " 鈻堚枅 鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻圽n" . + " 鈻� 鈻堚枅鈻� 鈻� 鈻� \n" . + "鈻堚枅鈻堚枅鈻堚枅鈻� 鈻堚枅 鈻堚枅鈻堚枅鈻堚枅 \n" . + "鈻� 鈻� 鈻堚枅鈻堚枅 鈻堚枅 \n" . + "鈻� 鈻堚枅鈻� 鈻� 鈻堚枅 鈻堚枅 鈻堚枅 鈻� 鈻堚枅\n" . + "鈻� 鈻堚枅鈻� 鈻� 鈻堚枅 鈻堚枅 鈻� 鈻堚枅 \n" . + "鈻� 鈻堚枅鈻� 鈻� 鈻� 鈻� 鈻堚枅 鈻堚枅\n" . + "鈻� 鈻� 鈻堚枅鈻� 鈻堚枅鈻� 鈻堚枅鈻堚枅\n" . + "鈻堚枅鈻堚枅鈻堚枅鈻� 鈻堚枅鈻堚枅 鈻堚枅 \n" + ; + + $qrCode = Encoder::encode( + $content, + new ErrorCorrectionLevel(ErrorCorrectionLevel::L), + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->renderer->setMargin(0); + $this->assertEquals(0, $this->renderer->getMargin()); + $this->assertEquals($expected, $this->renderer->render($qrCode)); + } + + public function testBasicRenderCustomChar() + { + $content = 'foobar'; + $expected = + "-----------------------\n" . + "-#######-#####-#######-\n" . + "-#-----#--#-#--#-----#-\n" . + "-#-###-#--##---#-###-#-\n" . + "-#-###-#--###--#-###-#-\n" . + "-#-###-#---#-#-#-###-#-\n" . + "-#-----#----##-#-----#-\n" . + "-#######-#-#-#-#######-\n" . + "---------#####---------\n" . + "-##-##-#--##-#-#-----#-\n" . + "----##----##-#-#-##----\n" . + "--########-#--##-#--##-\n" . + "-----------##------#-#-\n" . + "--##--###--#---#--#--#-\n" . + "---------#-###----#-#--\n" . + "-#######--##-######----\n" . + "-#-----#---####---##---\n" . + "-#-###-#-##-##-##-#-##-\n" . + "-#-###-#-##-##--#-##---\n" . + "-#-###-#---#---#-##-##-\n" . + "-#-----#-###--###-####-\n" . + "-#######-####---##-----\n" . + "-----------------------\n" + ; + + $qrCode = Encoder::encode( + $content, + new ErrorCorrectionLevel(ErrorCorrectionLevel::L), + Encoder::DEFAULT_BYTE_MODE_ECODING + ); + $this->renderer->setFullBlock('#'); + $this->renderer->setEmptyBlock('-'); + $this->assertEquals('#', $this->renderer->getFullBlock()); + $this->assertEquals('-', $this->renderer->getEmptyBlock()); + $this->assertEquals($expected, $this->renderer->render($qrCode)); + } +} diff --git a/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/bootstrap.php b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/bootstrap.php new file mode 100755 index 0000000..05a4941 --- /dev/null +++ b/phpMyAdmin/vendor/bacon/bacon-qr-code/tests/bootstrap.php @@ -0,0 +1,10 @@ + + + + . + + + + ../src/ + + + diff --git a/phpMyAdmin/vendor/bin/highlight-query b/phpMyAdmin/vendor/bin/highlight-query new file mode 100755 index 0000000..9d1c68e --- /dev/null +++ b/phpMyAdmin/vendor/bin/highlight-query @@ -0,0 +1,107 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/phpmyadmin/sql-parser/bin/highlight-query'); + exit(0); + } +} + +include __DIR__ . '/..'.'/phpmyadmin/sql-parser/bin/highlight-query'; diff --git a/phpMyAdmin/vendor/bin/lint-query b/phpMyAdmin/vendor/bin/lint-query new file mode 100755 index 0000000..bdc74e3 --- /dev/null +++ b/phpMyAdmin/vendor/bin/lint-query @@ -0,0 +1,107 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/phpmyadmin/sql-parser/bin/lint-query'); + exit(0); + } +} + +include __DIR__ . '/..'.'/phpmyadmin/sql-parser/bin/lint-query'; diff --git a/phpMyAdmin/vendor/bin/tokenize-query b/phpMyAdmin/vendor/bin/tokenize-query new file mode 100755 index 0000000..92f88ec --- /dev/null +++ b/phpMyAdmin/vendor/bin/tokenize-query @@ -0,0 +1,107 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) { + include("phpvfscomposer://" . __DIR__ . '/..'.'/phpmyadmin/sql-parser/bin/tokenize-query'); + exit(0); + } +} + +include __DIR__ . '/..'.'/phpmyadmin/sql-parser/bin/tokenize-query'; diff --git a/phpMyAdmin/vendor/composer/ClassLoader.php b/phpMyAdmin/vendor/composer/ClassLoader.php new file mode 100755 index 0000000..afef3fa --- /dev/null +++ b/phpMyAdmin/vendor/composer/ClassLoader.php @@ -0,0 +1,572 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer\Autoload; + +/** + * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. + * + * $loader = new \Composer\Autoload\ClassLoader(); + * + * // register classes with namespaces + * $loader->add('Symfony\Component', __DIR__.'/component'); + * $loader->add('Symfony', __DIR__.'/framework'); + * + * // activate the autoloader + * $loader->register(); + * + * // to enable searching the include path (eg. for PEAR packages) + * $loader->setUseIncludePath(true); + * + * In this example, if you try to use a class in the Symfony\Component + * namespace or one of its children (Symfony\Component\Console for instance), + * the autoloader will first look for the class under the component/ + * directory, and it will then fallback to the framework/ directory if not + * found before giving up. + * + * This class is loosely based on the Symfony UniversalClassLoader. + * + * @author Fabien Potencier + * @author Jordi Boggiano + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ + */ +class ClassLoader +{ + /** @var ?string */ + private $vendorDir; + + // PSR-4 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixLengthsPsr4 = array(); + /** + * @var array[] + * @psalm-var array> + */ + private $prefixDirsPsr4 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr4 = array(); + + // PSR-0 + /** + * @var array[] + * @psalm-var array> + */ + private $prefixesPsr0 = array(); + /** + * @var array[] + * @psalm-var array + */ + private $fallbackDirsPsr0 = array(); + + /** @var bool */ + private $useIncludePath = false; + + /** + * @var string[] + * @psalm-var array + */ + private $classMap = array(); + + /** @var bool */ + private $classMapAuthoritative = false; + + /** + * @var bool[] + * @psalm-var array + */ + private $missingClasses = array(); + + /** @var ?string */ + private $apcuPrefix; + + /** + * @var self[] + */ + private static $registeredLoaders = array(); + + /** + * @param ?string $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + } + + /** + * @return string[] + */ + public function getPrefixes() + { + if (!empty($this->prefixesPsr0)) { + return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); + } + + return array(); + } + + /** + * @return array[] + * @psalm-return array> + */ + public function getPrefixesPsr4() + { + return $this->prefixDirsPsr4; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirs() + { + return $this->fallbackDirsPsr0; + } + + /** + * @return array[] + * @psalm-return array + */ + public function getFallbackDirsPsr4() + { + return $this->fallbackDirsPsr4; + } + + /** + * @return string[] Array of classname => path + * @psalm-return array + */ + public function getClassMap() + { + return $this->classMap; + } + + /** + * @param string[] $classMap Class to filename map + * @psalm-param array $classMap + * + * @return void + */ + public function addClassMap(array $classMap) + { + if ($this->classMap) { + $this->classMap = array_merge($this->classMap, $classMap); + } else { + $this->classMap = $classMap; + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, either + * appending or prepending to the ones previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories + * + * @return void + */ + public function add($prefix, $paths, $prepend = false) + { + if (!$prefix) { + if ($prepend) { + $this->fallbackDirsPsr0 = array_merge( + (array) $paths, + $this->fallbackDirsPsr0 + ); + } else { + $this->fallbackDirsPsr0 = array_merge( + $this->fallbackDirsPsr0, + (array) $paths + ); + } + + return; + } + + $first = $prefix[0]; + if (!isset($this->prefixesPsr0[$first][$prefix])) { + $this->prefixesPsr0[$first][$prefix] = (array) $paths; + + return; + } + if ($prepend) { + $this->prefixesPsr0[$first][$prefix] = array_merge( + (array) $paths, + $this->prefixesPsr0[$first][$prefix] + ); + } else { + $this->prefixesPsr0[$first][$prefix] = array_merge( + $this->prefixesPsr0[$first][$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, either + * appending or prepending to the ones previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function addPsr4($prefix, $paths, $prepend = false) + { + if (!$prefix) { + // Register directories for the root namespace. + if ($prepend) { + $this->fallbackDirsPsr4 = array_merge( + (array) $paths, + $this->fallbackDirsPsr4 + ); + } else { + $this->fallbackDirsPsr4 = array_merge( + $this->fallbackDirsPsr4, + (array) $paths + ); + } + } elseif (!isset($this->prefixDirsPsr4[$prefix])) { + // Register directories for a new namespace. + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } elseif ($prepend) { + // Prepend directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + (array) $paths, + $this->prefixDirsPsr4[$prefix] + ); + } else { + // Append directories for an already registered namespace. + $this->prefixDirsPsr4[$prefix] = array_merge( + $this->prefixDirsPsr4[$prefix], + (array) $paths + ); + } + } + + /** + * Registers a set of PSR-0 directories for a given prefix, + * replacing any others previously set for this prefix. + * + * @param string $prefix The prefix + * @param string[]|string $paths The PSR-0 base directories + * + * @return void + */ + public function set($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr0 = (array) $paths; + } else { + $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; + } + } + + /** + * Registers a set of PSR-4 directories for a given namespace, + * replacing any others previously set for this namespace. + * + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param string[]|string $paths The PSR-4 base directories + * + * @throws \InvalidArgumentException + * + * @return void + */ + public function setPsr4($prefix, $paths) + { + if (!$prefix) { + $this->fallbackDirsPsr4 = (array) $paths; + } else { + $length = strlen($prefix); + if ('\\' !== $prefix[$length - 1]) { + throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); + } + $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; + $this->prefixDirsPsr4[$prefix] = (array) $paths; + } + } + + /** + * Turns on searching the include path for class files. + * + * @param bool $useIncludePath + * + * @return void + */ + public function setUseIncludePath($useIncludePath) + { + $this->useIncludePath = $useIncludePath; + } + + /** + * Can be used to check if the autoloader uses the include path to check + * for classes. + * + * @return bool + */ + public function getUseIncludePath() + { + return $this->useIncludePath; + } + + /** + * Turns off searching the prefix and fallback directories for classes + * that have not been registered with the class map. + * + * @param bool $classMapAuthoritative + * + * @return void + */ + public function setClassMapAuthoritative($classMapAuthoritative) + { + $this->classMapAuthoritative = $classMapAuthoritative; + } + + /** + * Should class lookup fail if not found in the current class map? + * + * @return bool + */ + public function isClassMapAuthoritative() + { + return $this->classMapAuthoritative; + } + + /** + * APCu prefix to use to cache found/not-found classes, if the extension is enabled. + * + * @param string|null $apcuPrefix + * + * @return void + */ + public function setApcuPrefix($apcuPrefix) + { + $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; + } + + /** + * The APCu prefix in use, or null if APCu caching is not enabled. + * + * @return string|null + */ + public function getApcuPrefix() + { + return $this->apcuPrefix; + } + + /** + * Registers this instance as an autoloader. + * + * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void + */ + public function register($prepend = false) + { + spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } + } + + /** + * Unregisters this instance as an autoloader. + * + * @return void + */ + public function unregister() + { + spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } + } + + /** + * Loads the given class or interface. + * + * @param string $class The name of the class + * @return true|null True if loaded, null otherwise + */ + public function loadClass($class) + { + if ($file = $this->findFile($class)) { + includeFile($file); + + return true; + } + + return null; + } + + /** + * Finds the path to the file where the class is defined. + * + * @param string $class The name of the class + * + * @return string|false The path if found, false otherwise + */ + public function findFile($class) + { + // class map lookup + if (isset($this->classMap[$class])) { + return $this->classMap[$class]; + } + if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { + return false; + } + if (null !== $this->apcuPrefix) { + $file = apcu_fetch($this->apcuPrefix.$class, $hit); + if ($hit) { + return $file; + } + } + + $file = $this->findFileWithExtension($class, '.php'); + + // Search for Hack files if we are running on HHVM + if (false === $file && defined('HHVM_VERSION')) { + $file = $this->findFileWithExtension($class, '.hh'); + } + + if (null !== $this->apcuPrefix) { + apcu_add($this->apcuPrefix.$class, $file); + } + + if (false === $file) { + // Remember that this class does not exist. + $this->missingClasses[$class] = true; + } + + return $file; + } + + /** + * Returns the currently registered loaders indexed by their corresponding vendor directories. + * + * @return self[] + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ + private function findFileWithExtension($class, $ext) + { + // PSR-4 lookup + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; + + $first = $class[0]; + if (isset($this->prefixLengthsPsr4[$first])) { + $subPath = $class; + while (false !== $lastPos = strrpos($subPath, '\\')) { + $subPath = substr($subPath, 0, $lastPos); + $search = $subPath . '\\'; + if (isset($this->prefixDirsPsr4[$search])) { + $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); + foreach ($this->prefixDirsPsr4[$search] as $dir) { + if (file_exists($file = $dir . $pathEnd)) { + return $file; + } + } + } + } + } + + // PSR-4 fallback dirs + foreach ($this->fallbackDirsPsr4 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { + return $file; + } + } + + // PSR-0 lookup + if (false !== $pos = strrpos($class, '\\')) { + // namespaced class name + $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) + . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); + } else { + // PEAR-like class name + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; + } + + if (isset($this->prefixesPsr0[$first])) { + foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { + if (0 === strpos($class, $prefix)) { + foreach ($dirs as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + } + } + } + + // PSR-0 fallback dirs + foreach ($this->fallbackDirsPsr0 as $dir) { + if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { + return $file; + } + } + + // PSR-0 include paths. + if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { + return $file; + } + + return false; + } +} + +/** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + * @private + */ +function includeFile($file) +{ + include $file; +} diff --git a/phpMyAdmin/vendor/composer/InstalledVersions.php b/phpMyAdmin/vendor/composer/InstalledVersions.php new file mode 100755 index 0000000..d50e0c9 --- /dev/null +++ b/phpMyAdmin/vendor/composer/InstalledVersions.php @@ -0,0 +1,350 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * See also https://getcomposer.org/doc/07-runtime.md#installed-versions + * + * To require its presence, you can require `composer-runtime-api ^2.0` + */ +class InstalledVersions +{ + /** + * @var mixed[]|null + * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints($constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + */ + public static function getRootPackage() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. + * @return array[] + * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + */ + public static function reload($data) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($vendorDir.'/composer/installed.php')) { + $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { + self::$installed = $installed[count($installed) - 1]; + } + } + } + } + + if (null === self::$installed) { + // only require the installed.php file if this file is loaded from its dumped location, + // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 + if (substr(__DIR__, -8, 1) !== 'C') { + self::$installed = require __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + $installed[] = self::$installed; + + return $installed; + } +} diff --git a/phpMyAdmin/vendor/composer/LICENSE b/phpMyAdmin/vendor/composer/LICENSE new file mode 100755 index 0000000..f27399a --- /dev/null +++ b/phpMyAdmin/vendor/composer/LICENSE @@ -0,0 +1,21 @@ + +Copyright (c) Nils Adermann, Jordi Boggiano + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + diff --git a/phpMyAdmin/vendor/composer/autoload_classmap.php b/phpMyAdmin/vendor/composer/autoload_classmap.php new file mode 100755 index 0000000..d713d79 --- /dev/null +++ b/phpMyAdmin/vendor/composer/autoload_classmap.php @@ -0,0 +1,24 @@ + $vendorDir . '/composer/InstalledVersions.php', + 'Datamatrix' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php', + 'PDF417' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/pdf417.php', + 'QRcode' => $vendorDir . '/tecnickcom/tcpdf/include/barcodes/qrcode.php', + 'TCPDF' => $vendorDir . '/tecnickcom/tcpdf/tcpdf.php', + 'TCPDF2DBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php', + 'TCPDFBarcode' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php', + 'TCPDF_COLORS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_colors.php', + 'TCPDF_FILTERS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_filters.php', + 'TCPDF_FONTS' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_fonts.php', + 'TCPDF_FONT_DATA' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_font_data.php', + 'TCPDF_IMAGES' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_images.php', + 'TCPDF_IMPORT' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_import.php', + 'TCPDF_PARSER' => $vendorDir . '/tecnickcom/tcpdf/tcpdf_parser.php', + 'TCPDF_STATIC' => $vendorDir . '/tecnickcom/tcpdf/include/tcpdf_static.php', +); diff --git a/phpMyAdmin/vendor/composer/autoload_files.php b/phpMyAdmin/vendor/composer/autoload_files.php new file mode 100755 index 0000000..f5d9cda --- /dev/null +++ b/phpMyAdmin/vendor/composer/autoload_files.php @@ -0,0 +1,14 @@ + $vendorDir . '/paragonie/random_compat/lib/random.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', + 'bd9634f2d41831496de0d3dfe4c94881' => $vendorDir . '/symfony/polyfill-php56/bootstrap.php', + 'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php', +); diff --git a/phpMyAdmin/vendor/composer/autoload_namespaces.php b/phpMyAdmin/vendor/composer/autoload_namespaces.php new file mode 100755 index 0000000..1792159 --- /dev/null +++ b/phpMyAdmin/vendor/composer/autoload_namespaces.php @@ -0,0 +1,12 @@ + array($vendorDir . '/twig/extensions/lib'), + 'Twig_' => array($vendorDir . '/twig/twig/lib'), + 'BaconQrCode' => array($vendorDir . '/bacon/bacon-qr-code/src'), +); diff --git a/phpMyAdmin/vendor/composer/autoload_psr4.php b/phpMyAdmin/vendor/composer/autoload_psr4.php new file mode 100755 index 0000000..773ba19 --- /dev/null +++ b/phpMyAdmin/vendor/composer/autoload_psr4.php @@ -0,0 +1,28 @@ + array($vendorDir . '/phpseclib/phpseclib/phpseclib'), + 'Twig\\Extensions\\' => array($vendorDir . '/twig/extensions/src'), + 'Twig\\' => array($vendorDir . '/twig/twig/src'), + 'Symfony\\Polyfill\\Util\\' => array($vendorDir . '/symfony/polyfill-util'), + 'Symfony\\Polyfill\\Php56\\' => array($vendorDir . '/symfony/polyfill-php56'), + 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), + 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), + 'Symfony\\Component\\ExpressionLanguage\\' => array($vendorDir . '/symfony/expression-language'), + 'Samyoul\\U2F\\U2FServer\\' => array($vendorDir . '/samyoul/u2f-php-server/src'), + 'ReCaptcha\\' => array($vendorDir . '/google/recaptcha/src/ReCaptcha'), + 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), + 'PragmaRX\\Google2FA\\Tests\\' => array($vendorDir . '/pragmarx/google2fa/tests'), + 'PragmaRX\\Google2FA\\' => array($vendorDir . '/pragmarx/google2fa/src'), + 'PhpMyAdmin\\SqlParser\\' => array($vendorDir . '/phpmyadmin/sql-parser/src'), + 'PhpMyAdmin\\ShapeFile\\' => array($vendorDir . '/phpmyadmin/shapefile/src'), + 'PhpMyAdmin\\Setup\\' => array($baseDir . '/setup/lib'), + 'PhpMyAdmin\\MoTranslator\\' => array($vendorDir . '/phpmyadmin/motranslator/src'), + 'PhpMyAdmin\\' => array($baseDir . '/libraries/classes'), + 'ParagonIE\\ConstantTime\\' => array($vendorDir . '/paragonie/constant_time_encoding/src'), +); diff --git a/phpMyAdmin/vendor/composer/autoload_real.php b/phpMyAdmin/vendor/composer/autoload_real.php new file mode 100755 index 0000000..d5f4e43 --- /dev/null +++ b/phpMyAdmin/vendor/composer/autoload_real.php @@ -0,0 +1,80 @@ += 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); + if ($useStaticLoader) { + require __DIR__ . '/autoload_static.php'; + + call_user_func(\Composer\Autoload\ComposerStaticInit3199a2d18f5fba981addb1142bd22d5b::getInitializer($loader)); + } else { + $map = require __DIR__ . '/autoload_namespaces.php'; + foreach ($map as $namespace => $path) { + $loader->set($namespace, $path); + } + + $map = require __DIR__ . '/autoload_psr4.php'; + foreach ($map as $namespace => $path) { + $loader->setPsr4($namespace, $path); + } + + $classMap = require __DIR__ . '/autoload_classmap.php'; + if ($classMap) { + $loader->addClassMap($classMap); + } + } + + $loader->register(true); + + if ($useStaticLoader) { + $includeFiles = Composer\Autoload\ComposerStaticInit3199a2d18f5fba981addb1142bd22d5b::$files; + } else { + $includeFiles = require __DIR__ . '/autoload_files.php'; + } + foreach ($includeFiles as $fileIdentifier => $file) { + composerRequire3199a2d18f5fba981addb1142bd22d5b($fileIdentifier, $file); + } + + return $loader; + } +} + +/** + * @param string $fileIdentifier + * @param string $file + * @return void + */ +function composerRequire3199a2d18f5fba981addb1142bd22d5b($fileIdentifier, $file) +{ + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } +} diff --git a/phpMyAdmin/vendor/composer/autoload_static.php b/phpMyAdmin/vendor/composer/autoload_static.php new file mode 100755 index 0000000..d4046b9 --- /dev/null +++ b/phpMyAdmin/vendor/composer/autoload_static.php @@ -0,0 +1,182 @@ + __DIR__ . '/..' . '/paragonie/random_compat/lib/random.php', + '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', + '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', + 'bd9634f2d41831496de0d3dfe4c94881' => __DIR__ . '/..' . '/symfony/polyfill-php56/bootstrap.php', + 'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php', + ); + + public static $prefixLengthsPsr4 = array ( + 'p' => + array ( + 'phpseclib\\' => 10, + ), + 'T' => + array ( + 'Twig\\Extensions\\' => 16, + 'Twig\\' => 5, + ), + 'S' => + array ( + 'Symfony\\Polyfill\\Util\\' => 22, + 'Symfony\\Polyfill\\Php56\\' => 23, + 'Symfony\\Polyfill\\Mbstring\\' => 26, + 'Symfony\\Polyfill\\Ctype\\' => 23, + 'Symfony\\Component\\ExpressionLanguage\\' => 37, + 'Samyoul\\U2F\\U2FServer\\' => 22, + ), + 'R' => + array ( + 'ReCaptcha\\' => 10, + ), + 'P' => + array ( + 'Psr\\Container\\' => 14, + 'PragmaRX\\Google2FA\\Tests\\' => 25, + 'PragmaRX\\Google2FA\\' => 19, + 'PhpMyAdmin\\SqlParser\\' => 21, + 'PhpMyAdmin\\ShapeFile\\' => 21, + 'PhpMyAdmin\\Setup\\' => 17, + 'PhpMyAdmin\\MoTranslator\\' => 24, + 'PhpMyAdmin\\' => 11, + 'ParagonIE\\ConstantTime\\' => 23, + ), + ); + + public static $prefixDirsPsr4 = array ( + 'phpseclib\\' => + array ( + 0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib', + ), + 'Twig\\Extensions\\' => + array ( + 0 => __DIR__ . '/..' . '/twig/extensions/src', + ), + 'Twig\\' => + array ( + 0 => __DIR__ . '/..' . '/twig/twig/src', + ), + 'Symfony\\Polyfill\\Util\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-util', + ), + 'Symfony\\Polyfill\\Php56\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php56', + ), + 'Symfony\\Polyfill\\Mbstring\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', + ), + 'Symfony\\Polyfill\\Ctype\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', + ), + 'Symfony\\Component\\ExpressionLanguage\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/expression-language', + ), + 'Samyoul\\U2F\\U2FServer\\' => + array ( + 0 => __DIR__ . '/..' . '/samyoul/u2f-php-server/src', + ), + 'ReCaptcha\\' => + array ( + 0 => __DIR__ . '/..' . '/google/recaptcha/src/ReCaptcha', + ), + 'Psr\\Container\\' => + array ( + 0 => __DIR__ . '/..' . '/psr/container/src', + ), + 'PragmaRX\\Google2FA\\Tests\\' => + array ( + 0 => __DIR__ . '/..' . '/pragmarx/google2fa/tests', + ), + 'PragmaRX\\Google2FA\\' => + array ( + 0 => __DIR__ . '/..' . '/pragmarx/google2fa/src', + ), + 'PhpMyAdmin\\SqlParser\\' => + array ( + 0 => __DIR__ . '/..' . '/phpmyadmin/sql-parser/src', + ), + 'PhpMyAdmin\\ShapeFile\\' => + array ( + 0 => __DIR__ . '/..' . '/phpmyadmin/shapefile/src', + ), + 'PhpMyAdmin\\Setup\\' => + array ( + 0 => __DIR__ . '/../..' . '/setup/lib', + ), + 'PhpMyAdmin\\MoTranslator\\' => + array ( + 0 => __DIR__ . '/..' . '/phpmyadmin/motranslator/src', + ), + 'PhpMyAdmin\\' => + array ( + 0 => __DIR__ . '/../..' . '/libraries/classes', + ), + 'ParagonIE\\ConstantTime\\' => + array ( + 0 => __DIR__ . '/..' . '/paragonie/constant_time_encoding/src', + ), + ); + + public static $prefixesPsr0 = array ( + 'T' => + array ( + 'Twig_Extensions_' => + array ( + 0 => __DIR__ . '/..' . '/twig/extensions/lib', + ), + 'Twig_' => + array ( + 0 => __DIR__ . '/..' . '/twig/twig/lib', + ), + ), + 'B' => + array ( + 'BaconQrCode' => + array ( + 0 => __DIR__ . '/..' . '/bacon/bacon-qr-code/src', + ), + ), + ); + + public static $classMap = array ( + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', + 'Datamatrix' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/datamatrix.php', + 'PDF417' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/pdf417.php', + 'QRcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/barcodes/qrcode.php', + 'TCPDF' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf.php', + 'TCPDF2DBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_2d.php', + 'TCPDFBarcode' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_barcodes_1d.php', + 'TCPDF_COLORS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_colors.php', + 'TCPDF_FILTERS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_filters.php', + 'TCPDF_FONTS' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_fonts.php', + 'TCPDF_FONT_DATA' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_font_data.php', + 'TCPDF_IMAGES' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_images.php', + 'TCPDF_IMPORT' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_import.php', + 'TCPDF_PARSER' => __DIR__ . '/..' . '/tecnickcom/tcpdf/tcpdf_parser.php', + 'TCPDF_STATIC' => __DIR__ . '/..' . '/tecnickcom/tcpdf/include/tcpdf_static.php', + ); + + public static function getInitializer(ClassLoader $loader) + { + return \Closure::bind(function () use ($loader) { + $loader->prefixLengthsPsr4 = ComposerStaticInit3199a2d18f5fba981addb1142bd22d5b::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit3199a2d18f5fba981addb1142bd22d5b::$prefixDirsPsr4; + $loader->prefixesPsr0 = ComposerStaticInit3199a2d18f5fba981addb1142bd22d5b::$prefixesPsr0; + $loader->classMap = ComposerStaticInit3199a2d18f5fba981addb1142bd22d5b::$classMap; + + }, null, ClassLoader::class); + } +} diff --git a/phpMyAdmin/vendor/composer/installed.json b/phpMyAdmin/vendor/composer/installed.json new file mode 100755 index 0000000..02e1a98 --- /dev/null +++ b/phpMyAdmin/vendor/composer/installed.json @@ -0,0 +1,1294 @@ +{ + "packages": [ + { + "name": "bacon/bacon-qr-code", + "version": "1.0.3", + "version_normalized": "1.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/Bacon/BaconQrCode.git", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": "^5.4|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "suggest": { + "ext-gd": "to generate QR code images" + }, + "time": "2017-10-17T09:59:25+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "BaconQrCode": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "http://www.dasprids.de", + "role": "Developer" + } + ], + "description": "BaconQrCode is a QR code generator for PHP.", + "homepage": "https://github.com/Bacon/BaconQrCode", + "support": { + "issues": "https://github.com/Bacon/BaconQrCode/issues", + "source": "https://github.com/Bacon/BaconQrCode/tree/master" + }, + "install-path": "../bacon/bacon-qr-code" + }, + { + "name": "google/recaptcha", + "version": "1.2.4", + "version_normalized": "1.2.4.0", + "source": { + "type": "git", + "url": "https://github.com/google/recaptcha.git", + "reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/google/recaptcha/zipball/614f25a9038be4f3f2da7cbfd778dc5b357d2419", + "reference": "614f25a9038be4f3f2da7cbfd778dc5b357d2419", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.2.20|^2.15", + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11" + }, + "time": "2020-03-31T17:50:54+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "ReCaptcha\\": "src/ReCaptcha" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "description": "Client library for reCAPTCHA, a free service that protects websites from spam and abuse.", + "homepage": "https://www.google.com/recaptcha/", + "keywords": [ + "Abuse", + "captcha", + "recaptcha", + "spam" + ], + "support": { + "forum": "https://groups.google.com/forum/#!forum/recaptcha", + "issues": "https://github.com/google/recaptcha/issues", + "source": "https://github.com/google/recaptcha" + }, + "install-path": "../google/recaptcha" + }, + { + "name": "paragonie/constant_time_encoding", + "version": "v1.1.0", + "version_normalized": "1.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "317718fb438e60151f72b20404f040cb5ae1d494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/317718fb438e60151f72b20404f040cb5ae1d494", + "reference": "317718fb438e60151f72b20404f040cb5ae1d494", + "shasum": "" + }, + "require": { + "php": "^5.3|^7|^8" + }, + "require-dev": { + "paragonie/random_compat": "^1.4|^2", + "phpunit/phpunit": ">= 4" + }, + "time": "2022-01-17T05:23:46+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "install-path": "../paragonie/constant_time_encoding" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.21", + "version_normalized": "2.0.21.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "96c132c7f2f7bc3230723b66e89f8f150b29d5ae" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/96c132c7f2f7bc3230723b66e89f8f150b29d5ae", + "reference": "96c132c7f2f7bc3230723b66e89f8f150b29d5ae", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "time": "2022-02-16T17:07:03+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "install-path": "../paragonie/random_compat" + }, + { + "name": "phpmyadmin/motranslator", + "version": "4.0", + "version_normalized": "4.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/motranslator.git", + "reference": "fcb370254998fda7eeccfd7c787b4deb71b0d77c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/motranslator/zipball/fcb370254998fda7eeccfd7c787b4deb71b0d77c", + "reference": "fcb370254998fda7eeccfd7c787b4deb71b0d77c", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "symfony/expression-language": "^4.0 || ^3.2 || ^2.8" + }, + "require-dev": { + "apigen/apigen": "^4.1", + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5" + }, + "time": "2018-02-12T13:22:52+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PhpMyAdmin\\MoTranslator\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "Translation API for PHP using Gettext MO files", + "homepage": "https://github.com/phpmyadmin/motranslator", + "keywords": [ + "gettext", + "i18n", + "mo", + "translator" + ], + "support": { + "issues": "https://github.com/phpmyadmin/motranslator/issues", + "source": "https://github.com/phpmyadmin/motranslator" + }, + "install-path": "../phpmyadmin/motranslator" + }, + { + "name": "phpmyadmin/shapefile", + "version": "2.1", + "version_normalized": "2.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/shapefile.git", + "reference": "e23b767f2a81f61fee3fc09fc062879985f3e224" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/shapefile/zipball/e23b767f2a81f61fee3fc09fc062879985f3e224", + "reference": "e23b767f2a81f61fee3fc09fc062879985f3e224", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "~4.8 || ~5.7" + }, + "suggest": { + "ext-dbase": "For dbf files parsing" + }, + "time": "2017-05-15T08:31:47+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PhpMyAdmin\\ShapeFile\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "ESRI ShapeFile library for PHP", + "homepage": "https://github.com/phpmyadmin/shapefile", + "keywords": [ + "ESRI", + "Shapefile", + "dbf", + "geo", + "geospatial", + "shape", + "shp" + ], + "support": { + "issues": "https://github.com/phpmyadmin/shapefile/issues", + "source": "https://github.com/phpmyadmin/shapefile" + }, + "install-path": "../phpmyadmin/shapefile" + }, + { + "name": "phpmyadmin/sql-parser", + "version": "4.7.3", + "version_normalized": "4.7.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpmyadmin/sql-parser.git", + "reference": "a88f051b5bd5b336779b30111b26b9cd1fc42013" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpmyadmin/sql-parser/zipball/a88f051b5bd5b336779b30111b26b9cd1fc42013", + "reference": "a88f051b5bd5b336779b30111b26b9cd1fc42013", + "shasum": "" + }, + "require": { + "php": "^5.3.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.3" + }, + "conflict": { + "phpmyadmin/motranslator": "<3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5 || ^7.0", + "squizlabs/php_codesniffer": "~2.9 || ~3.4" + }, + "suggest": { + "ext-mbstring": "For best performance", + "phpmyadmin/motranslator": "Translate messages to your favorite locale" + }, + "time": "2021-12-09T04:30:40+00:00", + "bin": [ + "bin/highlight-query", + "bin/lint-query", + "bin/tokenize-query" + ], + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "PhpMyAdmin\\SqlParser\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "description": "A validating SQL lexer and parser with a focus on MySQL dialect.", + "homepage": "https://github.com/phpmyadmin/sql-parser", + "keywords": [ + "analysis", + "lexer", + "parser", + "sql" + ], + "support": { + "issues": "https://github.com/phpmyadmin/sql-parser/issues", + "source": "https://github.com/phpmyadmin/sql-parser" + }, + "install-path": "../phpmyadmin/sql-parser" + }, + { + "name": "phpseclib/phpseclib", + "version": "2.0.41", + "version_normalized": "2.0.41.0", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "7e763c6f97ec1fcb37c46aa8ecfc20a2c71d9c1b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/7e763c6f97ec1fcb37c46aa8ecfc20a2c71d9c1b", + "reference": "7e763c6f97ec1fcb37c46aa8ecfc20a2c71d9c1b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phing/phing": "~2.7", + "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", + "squizlabs/php_codesniffer": "~2.0" + }, + "suggest": { + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.", + "ext-xml": "Install the XML extension to load XML formatted public keys." + }, + "time": "2022-12-23T16:44:18+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-J眉rgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/2.0.41" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "install-path": "../phpseclib/phpseclib" + }, + { + "name": "pragmarx/google2fa", + "version": "v3.0.3", + "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/antonioribeiro/google2fa.git", + "reference": "6949226739e4424f40031e6f1c96b1fd64047335" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/antonioribeiro/google2fa/zipball/6949226739e4424f40031e6f1c96b1fd64047335", + "reference": "6949226739e4424f40031e6f1c96b1fd64047335", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "~1.0|~2.0", + "paragonie/random_compat": ">=1", + "php": ">=5.4", + "symfony/polyfill-php56": "~1.2" + }, + "require-dev": { + "bacon/bacon-qr-code": "~1.0", + "phpunit/phpunit": "~4|~5|~6" + }, + "suggest": { + "bacon/bacon-qr-code": "Required to generate inline QR Codes." + }, + "time": "2018-08-29T13:28:06+00:00", + "type": "library", + "extra": { + "component": "package", + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "PragmaRX\\Google2FA\\": "src/", + "PragmaRX\\Google2FA\\Tests\\": "tests/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Antonio Carlos Ribeiro", + "email": "acr@antoniocarlosribeiro.com", + "role": "Creator & Designer" + } + ], + "description": "A One Time Password Authentication package, compatible with Google Authenticator.", + "keywords": [ + "2fa", + "Authentication", + "Two Factor Authentication", + "google2fa", + "laravel" + ], + "support": { + "issues": "https://github.com/antonioribeiro/google2fa/issues", + "source": "https://github.com/antonioribeiro/google2fa/tree/master" + }, + "install-path": "../pragmarx/google2fa" + }, + { + "name": "psr/container", + "version": "1.0.0", + "version_normalized": "1.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2017-02-14T16:28:37+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/master" + }, + "install-path": "../psr/container" + }, + { + "name": "samyoul/u2f-php-server", + "version": "v1.1.4", + "version_normalized": "1.1.4.0", + "source": { + "type": "git", + "url": "https://github.com/Samyoul/U2F-php-server.git", + "reference": "0625202c79d570e58525ed6c4ae38500ea3f0883" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Samyoul/U2F-php-server/zipball/0625202c79d570e58525ed6c4ae38500ea3f0883", + "reference": "0625202c79d570e58525ed6c4ae38500ea3f0883", + "shasum": "" + }, + "require": { + "ext-openssl": "*" + }, + "time": "2018-10-26T12:43:39+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Samyoul\\U2F\\U2FServer\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Samuel Hawksby-Robinson", + "email": "samuel@samyoul.com" + } + ], + "description": "Server side handling class for FIDO U2F registration and authentication", + "support": { + "issues": "https://github.com/Samyoul/U2F-php-server/issues", + "source": "https://github.com/Samyoul/U2F-php-server/tree/master" + }, + "install-path": "../samyoul/u2f-php-server" + }, + { + "name": "symfony/expression-language", + "version": "v2.8.52", + "version_normalized": "2.8.52.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/expression-language.git", + "reference": "fa9be1b831859b56d244137fabbfd01a46dbdb36" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/expression-language/zipball/fa9be1b831859b56d244137fabbfd01a46dbdb36", + "reference": "fa9be1b831859b56d244137fabbfd01a46dbdb36", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "time": "2018-11-11T11:18:13+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\ExpressionLanguage\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony ExpressionLanguage Component", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/expression-language/tree/v2.8.50" + }, + "install-path": "../symfony/expression-language" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.19.0", + "version_normalized": "1.19.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b", + "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "time": "2020-10-23T09:01:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-ctype" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.19.0", + "version_normalized": "1.19.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "reference": "b5f7b932ee6fa802fc792eabd77c4c88084517ce", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2020-10-23T09:01:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "symfony/polyfill-php56", + "version": "v1.19.0", + "version_normalized": "1.19.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "ea19621731cbd973a6702cfedef3419768bf3372" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/ea19621731cbd973a6702cfedef3419768bf3372", + "reference": "ea19621731cbd973a6702cfedef3419768bf3372", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-util": "~1.0" + }, + "time": "2020-10-23T09:01:57+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php56\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php56/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php56" + }, + { + "name": "symfony/polyfill-util", + "version": "v1.19.0", + "version_normalized": "1.19.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-util.git", + "reference": "8df0c3e6a4b85df9a5c6f3f2f46fba5c5c47058a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/8df0c3e6a4b85df9a5c6f3f2f46fba5c5c47058a", + "reference": "8df0c3e6a4b85df9a5c6f3f2f46fba5c5c47058a", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "time": "2020-10-21T09:57:48+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Util\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony utilities for portability of PHP codes", + "homepage": "https://symfony.com", + "keywords": [ + "compat", + "compatibility", + "polyfill", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-util/tree/v1.19.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-util" + }, + { + "name": "tecnickcom/tcpdf", + "version": "6.6.2", + "version_normalized": "6.6.2.0", + "source": { + "type": "git", + "url": "https://github.com/tecnickcom/TCPDF.git", + "reference": "e3cffc9bcbc76e89e167e9eb0bbda0cab7518459" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/e3cffc9bcbc76e89e167e9eb0bbda0cab7518459", + "reference": "e3cffc9bcbc76e89e167e9eb0bbda0cab7518459", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2022-12-17T10:28:59+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "config", + "include", + "tcpdf.php", + "tcpdf_parser.php", + "tcpdf_import.php", + "tcpdf_barcodes_1d.php", + "tcpdf_barcodes_2d.php", + "include/tcpdf_colors.php", + "include/tcpdf_filters.php", + "include/tcpdf_font_data.php", + "include/tcpdf_fonts.php", + "include/tcpdf_images.php", + "include/tcpdf_static.php", + "include/barcodes/datamatrix.php", + "include/barcodes/pdf417.php", + "include/barcodes/qrcode.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-only" + ], + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "homepage": "http://www.tcpdf.org/", + "keywords": [ + "PDFD32000-2008", + "TCPDF", + "barcodes", + "datamatrix", + "pdf", + "pdf417", + "qrcode" + ], + "support": { + "issues": "https://github.com/tecnickcom/TCPDF/issues", + "source": "https://github.com/tecnickcom/TCPDF/tree/6.6.2" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20tcpdf%20project", + "type": "custom" + } + ], + "install-path": "../tecnickcom/tcpdf" + }, + { + "name": "twig/extensions", + "version": "v1.5.4", + "version_normalized": "1.5.4.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig-extensions.git", + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/57873c8b0c1be51caa47df2cdb824490beb16202", + "reference": "57873c8b0c1be51caa47df2cdb824490beb16202", + "shasum": "" + }, + "require": { + "twig/twig": "^1.27|^2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.4", + "symfony/translation": "^2.7|^3.4" + }, + "suggest": { + "symfony/translation": "Allow the time_diff output to be translated" + }, + "time": "2018-12-05T18:34:18+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_Extensions_": "lib/" + }, + "psr-4": { + "Twig\\Extensions\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "description": "Common additional features for Twig that do not directly belong in core", + "keywords": [ + "i18n", + "text" + ], + "support": { + "issues": "https://github.com/twigphp/Twig-extensions/issues", + "source": "https://github.com/twigphp/Twig-extensions/tree/master" + }, + "abandoned": true, + "install-path": "../twig/extensions" + }, + { + "name": "twig/twig", + "version": "v1.42.5", + "version_normalized": "1.42.5.0", + "source": { + "type": "git", + "url": "https://github.com/twigphp/Twig.git", + "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", + "reference": "87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e", + "shasum": "" + }, + "require": { + "php": ">=5.5.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "psr/container": "^1.0", + "symfony/phpunit-bridge": "^4.4|^5.0" + }, + "time": "2020-02-11T05:59:23+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.42-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-0": { + "Twig_": "lib/" + }, + "psr-4": { + "Twig\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "description": "Twig, the flexible, fast, and secure template language for PHP", + "homepage": "https://twig.symfony.com", + "keywords": [ + "templating" + ], + "support": { + "issues": "https://github.com/twigphp/Twig/issues", + "source": "https://github.com/twigphp/Twig/tree/1.x" + }, + "install-path": "../twig/twig" + } + ], + "dev": false, + "dev-package-names": [] +} diff --git a/phpMyAdmin/vendor/composer/installed.php b/phpMyAdmin/vendor/composer/installed.php new file mode 100755 index 0000000..14094bb --- /dev/null +++ b/phpMyAdmin/vendor/composer/installed.php @@ -0,0 +1,198 @@ + array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array( + 0 => '4.9.x-dev', + ), + 'reference' => 'f1047bc018079214594983a1cb6669efaa8b9bf4', + 'name' => 'phpmyadmin/phpmyadmin', + 'dev' => false, + ), + 'versions' => array( + 'bacon/bacon-qr-code' => array( + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../bacon/bacon-qr-code', + 'aliases' => array(), + 'reference' => '5a91b62b9d37cee635bbf8d553f4546057250bee', + 'dev_requirement' => false, + ), + 'google/recaptcha' => array( + 'pretty_version' => '1.2.4', + 'version' => '1.2.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/recaptcha', + 'aliases' => array(), + 'reference' => '614f25a9038be4f3f2da7cbfd778dc5b357d2419', + 'dev_requirement' => false, + ), + 'paragonie/constant_time_encoding' => array( + 'pretty_version' => 'v1.1.0', + 'version' => '1.1.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paragonie/constant_time_encoding', + 'aliases' => array(), + 'reference' => '317718fb438e60151f72b20404f040cb5ae1d494', + 'dev_requirement' => false, + ), + 'paragonie/random_compat' => array( + 'pretty_version' => 'v2.0.21', + 'version' => '2.0.21.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paragonie/random_compat', + 'aliases' => array(), + 'reference' => '96c132c7f2f7bc3230723b66e89f8f150b29d5ae', + 'dev_requirement' => false, + ), + 'phpmyadmin/motranslator' => array( + 'pretty_version' => '4.0', + 'version' => '4.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpmyadmin/motranslator', + 'aliases' => array(), + 'reference' => 'fcb370254998fda7eeccfd7c787b4deb71b0d77c', + 'dev_requirement' => false, + ), + 'phpmyadmin/phpmyadmin' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'type' => 'project', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array( + 0 => '4.9.x-dev', + ), + 'reference' => 'f1047bc018079214594983a1cb6669efaa8b9bf4', + 'dev_requirement' => false, + ), + 'phpmyadmin/shapefile' => array( + 'pretty_version' => '2.1', + 'version' => '2.1.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpmyadmin/shapefile', + 'aliases' => array(), + 'reference' => 'e23b767f2a81f61fee3fc09fc062879985f3e224', + 'dev_requirement' => false, + ), + 'phpmyadmin/sql-parser' => array( + 'pretty_version' => '4.7.3', + 'version' => '4.7.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpmyadmin/sql-parser', + 'aliases' => array(), + 'reference' => 'a88f051b5bd5b336779b30111b26b9cd1fc42013', + 'dev_requirement' => false, + ), + 'phpseclib/phpseclib' => array( + 'pretty_version' => '2.0.41', + 'version' => '2.0.41.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpseclib/phpseclib', + 'aliases' => array(), + 'reference' => '7e763c6f97ec1fcb37c46aa8ecfc20a2c71d9c1b', + 'dev_requirement' => false, + ), + 'pragmarx/google2fa' => array( + 'pretty_version' => 'v3.0.3', + 'version' => '3.0.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../pragmarx/google2fa', + 'aliases' => array(), + 'reference' => '6949226739e4424f40031e6f1c96b1fd64047335', + 'dev_requirement' => false, + ), + 'psr/container' => array( + 'pretty_version' => '1.0.0', + 'version' => '1.0.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/container', + 'aliases' => array(), + 'reference' => 'b7ce3b176482dbbc1245ebf52b181af44c2cf55f', + 'dev_requirement' => false, + ), + 'samyoul/u2f-php-server' => array( + 'pretty_version' => 'v1.1.4', + 'version' => '1.1.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../samyoul/u2f-php-server', + 'aliases' => array(), + 'reference' => '0625202c79d570e58525ed6c4ae38500ea3f0883', + 'dev_requirement' => false, + ), + 'symfony/expression-language' => array( + 'pretty_version' => 'v2.8.52', + 'version' => '2.8.52.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/expression-language', + 'aliases' => array(), + 'reference' => 'fa9be1b831859b56d244137fabbfd01a46dbdb36', + 'dev_requirement' => false, + ), + 'symfony/polyfill-ctype' => array( + 'pretty_version' => 'v1.19.0', + 'version' => '1.19.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', + 'aliases' => array(), + 'reference' => 'aed596913b70fae57be53d86faa2e9ef85a2297b', + 'dev_requirement' => false, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.19.0', + 'version' => '1.19.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'reference' => 'b5f7b932ee6fa802fc792eabd77c4c88084517ce', + 'dev_requirement' => false, + ), + 'symfony/polyfill-php56' => array( + 'pretty_version' => 'v1.19.0', + 'version' => '1.19.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php56', + 'aliases' => array(), + 'reference' => 'ea19621731cbd973a6702cfedef3419768bf3372', + 'dev_requirement' => false, + ), + 'symfony/polyfill-util' => array( + 'pretty_version' => 'v1.19.0', + 'version' => '1.19.0.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-util', + 'aliases' => array(), + 'reference' => '8df0c3e6a4b85df9a5c6f3f2f46fba5c5c47058a', + 'dev_requirement' => false, + ), + 'tecnickcom/tcpdf' => array( + 'pretty_version' => '6.6.2', + 'version' => '6.6.2.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../tecnickcom/tcpdf', + 'aliases' => array(), + 'reference' => 'e3cffc9bcbc76e89e167e9eb0bbda0cab7518459', + 'dev_requirement' => false, + ), + 'twig/extensions' => array( + 'pretty_version' => 'v1.5.4', + 'version' => '1.5.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../twig/extensions', + 'aliases' => array(), + 'reference' => '57873c8b0c1be51caa47df2cdb824490beb16202', + 'dev_requirement' => false, + ), + 'twig/twig' => array( + 'pretty_version' => 'v1.42.5', + 'version' => '1.42.5.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../twig/twig', + 'aliases' => array(), + 'reference' => '87b2ea9d8f6fd014d0621ca089bb1b3769ea3f8e', + 'dev_requirement' => false, + ), + ), +); diff --git a/phpMyAdmin/vendor/composer/platform_check.php b/phpMyAdmin/vendor/composer/platform_check.php new file mode 100755 index 0000000..454eefd --- /dev/null +++ b/phpMyAdmin/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 50500)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 5.5.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/phpMyAdmin/vendor/google/recaptcha/.github/ISSUE_TEMPLATE/bug_report.md b/phpMyAdmin/vendor/google/recaptcha/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100755 index 0000000..a14dcfe --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,28 @@ +--- +name: PHP client issue +about: Report an issue with the PHP client library + +--- + +**Issue description** + + +**Environment** + + + * OS name and version: + * PHP version: + * Web server name and version: + * `google/recaptcha` version: + * Browser name and version: + +**Reproducing the issue** + + + * URL (optional): + * Code (optional): + + ***User steps*** + + + 1. Visit page... diff --git a/phpMyAdmin/vendor/google/recaptcha/.travis.yml b/phpMyAdmin/vendor/google/recaptcha/.travis.yml new file mode 100755 index 0000000..a625795 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/.travis.yml @@ -0,0 +1,33 @@ +dist: trusty + +language: php + +sudo: false + +php: + - '5.5' + - '5.6' + - '7.0' + - '7.1' + - '7.2' + - '7.3' + +before_script: + - composer install + - phpenv version-name | grep ^5.[34] && echo "extension=apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; true + - phpenv version-name | grep ^5.[34] && echo "apc.enable_cli=1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini ; true + +script: + - mkdir -p build/logs + - composer run-script lint + - composer run-script test + +after_success: + - travis_retry php vendor/bin/php-coveralls + +cache: + directories: + - "$HOME/.composer/cache/files" + +git: + depth: 5 diff --git a/phpMyAdmin/vendor/google/recaptcha/ARCHITECTURE.md b/phpMyAdmin/vendor/google/recaptcha/ARCHITECTURE.md new file mode 100755 index 0000000..13add26 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/ARCHITECTURE.md @@ -0,0 +1,64 @@ +# Architecture + +The general pattern of usage is to instantiate the `ReCaptcha` class with your +secret key, specify any additional validation rules, and then call `verify()` +with the reCAPTCHA response and user's IP address. For example: + +```php +setExpectedHostname('recaptcha-demo.appspot.com') + ->verify($gRecaptchaResponse, $remoteIp); +if ($resp->isSuccess()) { + // Verified! +} else { + $errors = $resp->getErrorCodes(); +} +``` + +By default, this will use the +[`stream_context_create()`](https://secure.php.net/stream_context_create) and +[`file_get_contents()`](https://secure.php.net/file_get_contents) to make a POST +request to the reCAPTCHA service. This is handled by the +[`RequestMethod\Post`](./src/ReCaptcha/RequestMethod/Post.php) class. + +## Alternate request methods + +You may need to use other methods for making requests in your environment. The +[`ReCaptcha`](./src/ReCaptcha/ReCaptcha.php) class allows an optional +[`RequestMethod`](./src/ReCaptcha/RequestMethod.php) instance to configure this. +For example, if you want to use [cURL](https://secure.php.net/curl) instead you +can do this: + +```php +setExpectedHostname('recaptcha-demo.appspot.com') + ->verify($gRecaptchaResponse, $remoteIp); +if ($resp->isSuccess()) { + // Verified! +} else { + $errors = $resp->getErrorCodes(); +} +``` + +The following methods are available: + +- `setExpectedHostname($hostname)`: ensures the hostname matches. You must do + this if you have disabled "Domain/Package Name Validation" for your + credentials. +- `setExpectedApkPackageName($apkPackageName)`: if you're verifying a response + from an Android app. Again, you must do this if you have disabled + "Domain/Package Name Validation" for your credentials. +- `setExpectedAction($action)`: ensures the action matches for the v3 API. +- `setScoreThreshold($threshold)`: set a score threshold for responses from the + v3 API +- `setChallengeTimeout($timeoutSeconds)`: set a timeout between the user passing + the reCAPTCHA and your server processing it. + +Each of the `set`\*`()` methods return the `ReCaptcha` instance so you can chain +them together. For example: + +```php +setExpectedHostname('recaptcha-demo.appspot.com') + ->setExpectedAction('homepage') + ->setScoreThreshold(0.5) + ->verify($gRecaptchaResponse, $remoteIp); + +if ($resp->isSuccess()) { + // Verified! +} else { + $errors = $resp->getErrorCodes(); +} +``` + +You can find the constants for the libraries error codes in the `ReCaptcha` +class constants, e.g. `ReCaptcha::E_HOSTNAME_MISMATCH` + +For more details on usage and structure, see [ARCHITECTURE](ARCHITECTURE.md). + +### Examples + +You can see examples of each reCAPTCHA type in [examples/](examples/). You can +run the examples locally by using the Composer script: + +```sh +composer run-script serve-examples +``` + +This makes use of the in-built PHP dev server to host the examples at +http://localhost:8080/ + +These are also hosted on Google AppEngine Flexible environment at +https://recaptcha-demo.appspot.com/. This is configured by +[`app.yaml`](./app.yaml) which you can also use to [deploy to your own AppEngine +project](https://cloud.google.com/appengine/docs/flexible/php/download). + +## Contributing + +No one ever has enough engineers, so we're very happy to accept contributions +via Pull Requests. For details, see [CONTRIBUTING](CONTRIBUTING.md) diff --git a/phpMyAdmin/vendor/google/recaptcha/app.yaml b/phpMyAdmin/vendor/google/recaptcha/app.yaml new file mode 100755 index 0000000..b6ccaf1 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/app.yaml @@ -0,0 +1,8 @@ +runtime: php +env: flex + +skip_files: +- tests + +runtime_config: + document_root: examples diff --git a/phpMyAdmin/vendor/google/recaptcha/composer.json b/phpMyAdmin/vendor/google/recaptcha/composer.json new file mode 100755 index 0000000..ab6b4f1 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/composer.json @@ -0,0 +1,39 @@ +{ + "name": "google/recaptcha", + "description": "Client library for reCAPTCHA, a free service that protects websites from spam and abuse.", + "type": "library", + "keywords": ["recaptcha", "captcha", "spam", "abuse"], + "homepage": "https://www.google.com/recaptcha/", + "license": "BSD-3-Clause", + "support": { + "forum": "https://groups.google.com/forum/#!forum/recaptcha", + "source": "https://github.com/google/recaptcha" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36|^5.7.27|^6.59|^7.5.11", + "friendsofphp/php-cs-fixer": "^2.2.20|^2.15", + "php-coveralls/php-coveralls": "^2.1" + }, + "autoload": { + "psr-4": { + "ReCaptcha\\": "src/ReCaptcha" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "scripts": { + "lint": "vendor/bin/php-cs-fixer -vvv fix --using-cache=no --dry-run .", + "lint-fix": "vendor/bin/php-cs-fixer -vvv fix --using-cache=no .", + "test": "vendor/bin/phpunit --colors=always", + "serve-examples": "@php -S localhost:8080 -t examples" + }, + "config": { + "process-timeout": 0 + } +} diff --git a/phpMyAdmin/vendor/google/recaptcha/phpunit.xml.dist b/phpMyAdmin/vendor/google/recaptcha/phpunit.xml.dist new file mode 100755 index 0000000..ae86610 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/phpunit.xml.dist @@ -0,0 +1,20 @@ + + + + + tests/ReCaptcha/ + + + + + src/ReCaptcha/ + + + + + + diff --git a/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php new file mode 100755 index 0000000..31ec44a --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/ReCaptcha.php @@ -0,0 +1,269 @@ +secret = $secret; + $this->requestMethod = (is_null($requestMethod)) ? new RequestMethod\Post() : $requestMethod; + } + + /** + * Calls the reCAPTCHA siteverify API to verify whether the user passes + * CAPTCHA test and additionally runs any specified additional checks + * + * @param string $response The user response token provided by reCAPTCHA, verifying the user on your site. + * @param string $remoteIp The end user's IP address. + * @return Response Response from the service. + */ + public function verify($response, $remoteIp = null) + { + // Discard empty solution submissions + if (empty($response)) { + $recaptchaResponse = new Response(false, array(self::E_MISSING_INPUT_RESPONSE)); + return $recaptchaResponse; + } + + $params = new RequestParameters($this->secret, $response, $remoteIp, self::VERSION); + $rawResponse = $this->requestMethod->submit($params); + $initialResponse = Response::fromJson($rawResponse); + $validationErrors = array(); + + if (isset($this->hostname) && strcasecmp($this->hostname, $initialResponse->getHostname()) !== 0) { + $validationErrors[] = self::E_HOSTNAME_MISMATCH; + } + + if (isset($this->apkPackageName) && strcasecmp($this->apkPackageName, $initialResponse->getApkPackageName()) !== 0) { + $validationErrors[] = self::E_APK_PACKAGE_NAME_MISMATCH; + } + + if (isset($this->action) && strcasecmp($this->action, $initialResponse->getAction()) !== 0) { + $validationErrors[] = self::E_ACTION_MISMATCH; + } + + if (isset($this->threshold) && $this->threshold > $initialResponse->getScore()) { + $validationErrors[] = self::E_SCORE_THRESHOLD_NOT_MET; + } + + if (isset($this->timeoutSeconds)) { + $challengeTs = strtotime($initialResponse->getChallengeTs()); + + if ($challengeTs > 0 && time() - $challengeTs > $this->timeoutSeconds) { + $validationErrors[] = self::E_CHALLENGE_TIMEOUT; + } + } + + if (empty($validationErrors)) { + return $initialResponse; + } + + return new Response( + false, + array_merge($initialResponse->getErrorCodes(), $validationErrors), + $initialResponse->getHostname(), + $initialResponse->getChallengeTs(), + $initialResponse->getApkPackageName(), + $initialResponse->getScore(), + $initialResponse->getAction() + ); + } + + /** + * Provide a hostname to match against in verify() + * This should be without a protocol or trailing slash, e.g. www.google.com + * + * @param string $hostname Expected hostname + * @return ReCaptcha Current instance for fluent interface + */ + public function setExpectedHostname($hostname) + { + $this->hostname = $hostname; + return $this; + } + + /** + * Provide an APK package name to match against in verify() + * + * @param string $apkPackageName Expected APK package name + * @return ReCaptcha Current instance for fluent interface + */ + public function setExpectedApkPackageName($apkPackageName) + { + $this->apkPackageName = $apkPackageName; + return $this; + } + + /** + * Provide an action to match against in verify() + * This should be set per page. + * + * @param string $action Expected action + * @return ReCaptcha Current instance for fluent interface + */ + public function setExpectedAction($action) + { + $this->action = $action; + return $this; + } + + /** + * Provide a threshold to meet or exceed in verify() + * Threshold should be a float between 0 and 1 which will be tested as response >= threshold. + * + * @param float $threshold Expected threshold + * @return ReCaptcha Current instance for fluent interface + */ + public function setScoreThreshold($threshold) + { + $this->threshold = floatval($threshold); + return $this; + } + + /** + * Provide a timeout in seconds to test against the challenge timestamp in verify() + * + * @param int $timeoutSeconds Expected hostname + * @return ReCaptcha Current instance for fluent interface + */ + public function setChallengeTimeout($timeoutSeconds) + { + $this->timeoutSeconds = $timeoutSeconds; + return $this; + } +} diff --git a/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod.php b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod.php new file mode 100755 index 0000000..0a2a671 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod.php @@ -0,0 +1,50 @@ +curl = (is_null($curl)) ? new Curl() : $curl; + $this->siteVerifyUrl = (is_null($siteVerifyUrl)) ? ReCaptcha::SITE_VERIFY_URL : $siteVerifyUrl; + } + + /** + * Submit the cURL request with the specified parameters. + * + * @param RequestParameters $params Request parameters + * @return string Body of the reCAPTCHA response + */ + public function submit(RequestParameters $params) + { + $handle = $this->curl->init($this->siteVerifyUrl); + + $options = array( + CURLOPT_POST => true, + CURLOPT_POSTFIELDS => $params->toQueryString(), + CURLOPT_HTTPHEADER => array( + 'Content-Type: application/x-www-form-urlencoded' + ), + CURLINFO_HEADER_OUT => false, + CURLOPT_HEADER => false, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_SSL_VERIFYPEER => true + ); + $this->curl->setoptArray($handle, $options); + + $response = $this->curl->exec($handle); + $this->curl->close($handle); + + if ($response !== false) { + return $response; + } + + return '{"success": false, "error-codes": ["'.ReCaptcha::E_CONNECTION_FAILED.'"]}'; + } +} diff --git a/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php new file mode 100755 index 0000000..a4ff716 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Post.php @@ -0,0 +1,88 @@ +siteVerifyUrl = (is_null($siteVerifyUrl)) ? ReCaptcha::SITE_VERIFY_URL : $siteVerifyUrl; + } + + /** + * Submit the POST request with the specified parameters. + * + * @param RequestParameters $params Request parameters + * @return string Body of the reCAPTCHA response + */ + public function submit(RequestParameters $params) + { + $options = array( + 'http' => array( + 'header' => "Content-type: application/x-www-form-urlencoded\r\n", + 'method' => 'POST', + 'content' => $params->toQueryString(), + // Force the peer to validate (not needed in 5.6.0+, but still works) + 'verify_peer' => true, + ), + ); + $context = stream_context_create($options); + $response = file_get_contents($this->siteVerifyUrl, false, $context); + + if ($response !== false) { + return $response; + } + + return '{"success": false, "error-codes": ["'.ReCaptcha::E_CONNECTION_FAILED.'"]}'; + } +} diff --git a/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Socket.php b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Socket.php new file mode 100755 index 0000000..236bd5f --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/Socket.php @@ -0,0 +1,112 @@ +handle = fsockopen($hostname, $port, $errno, $errstr, (is_null($timeout) ? ini_get("default_socket_timeout") : $timeout)); + + if ($this->handle != false && $errno === 0 && $errstr === '') { + return $this->handle; + } + return false; + } + + /** + * fwrite + * + * @see http://php.net/fwrite + * @param string $string + * @param int $length + * @return int | bool + */ + public function fwrite($string, $length = null) + { + return fwrite($this->handle, $string, (is_null($length) ? strlen($string) : $length)); + } + + /** + * fgets + * + * @see http://php.net/fgets + * @param int $length + * @return string + */ + public function fgets($length = null) + { + return fgets($this->handle, $length); + } + + /** + * feof + * + * @see http://php.net/feof + * @return bool + */ + public function feof() + { + return feof($this->handle); + } + + /** + * fclose + * + * @see http://php.net/fclose + * @return bool + */ + public function fclose() + { + return fclose($this->handle); + } +} diff --git a/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/SocketPost.php b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/SocketPost.php new file mode 100755 index 0000000..464bc28 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestMethod/SocketPost.php @@ -0,0 +1,108 @@ +socket = (is_null($socket)) ? new Socket() : $socket; + $this->siteVerifyUrl = (is_null($siteVerifyUrl)) ? ReCaptcha::SITE_VERIFY_URL : $siteVerifyUrl; + } + + /** + * Submit the POST request with the specified parameters. + * + * @param RequestParameters $params Request parameters + * @return string Body of the reCAPTCHA response + */ + public function submit(RequestParameters $params) + { + $errno = 0; + $errstr = ''; + $urlParsed = parse_url($this->siteVerifyUrl); + + if (false === $this->socket->fsockopen('ssl://' . $urlParsed['host'], 443, $errno, $errstr, 30)) { + return '{"success": false, "error-codes": ["'.ReCaptcha::E_CONNECTION_FAILED.'"]}'; + } + + $content = $params->toQueryString(); + + $request = "POST " . $urlParsed['path'] . " HTTP/1.0\r\n"; + $request .= "Host: " . $urlParsed['host'] . "\r\n"; + $request .= "Content-Type: application/x-www-form-urlencoded\r\n"; + $request .= "Content-length: " . strlen($content) . "\r\n"; + $request .= "Connection: close\r\n\r\n"; + $request .= $content . "\r\n\r\n"; + + $this->socket->fwrite($request); + $response = ''; + + while (!$this->socket->feof()) { + $response .= $this->socket->fgets(4096); + } + + $this->socket->fclose(); + + if (0 !== strpos($response, 'HTTP/1.0 200 OK')) { + return '{"success": false, "error-codes": ["'.ReCaptcha::E_BAD_RESPONSE.'"]}'; + } + + $parts = preg_split("#\n\s*\n#Uis", $response); + + return $parts[1]; + } +} diff --git a/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestParameters.php b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestParameters.php new file mode 100755 index 0000000..e9ba453 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/RequestParameters.php @@ -0,0 +1,111 @@ +secret = $secret; + $this->response = $response; + $this->remoteIp = $remoteIp; + $this->version = $version; + } + + /** + * Array representation. + * + * @return array Array formatted parameters. + */ + public function toArray() + { + $params = array('secret' => $this->secret, 'response' => $this->response); + + if (!is_null($this->remoteIp)) { + $params['remoteip'] = $this->remoteIp; + } + + if (!is_null($this->version)) { + $params['version'] = $this->version; + } + + return $params; + } + + /** + * Query string representation for HTTP request. + * + * @return string Query string formatted parameters. + */ + public function toQueryString() + { + return http_build_query($this->toArray(), '', '&'); + } +} diff --git a/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/Response.php b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/Response.php new file mode 100755 index 0000000..55838c0 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/src/ReCaptcha/Response.php @@ -0,0 +1,218 @@ +success = $success; + $this->hostname = $hostname; + $this->challengeTs = $challengeTs; + $this->apkPackageName = $apkPackageName; + $this->score = $score; + $this->action = $action; + $this->errorCodes = $errorCodes; + } + + /** + * Is success? + * + * @return boolean + */ + public function isSuccess() + { + return $this->success; + } + + /** + * Get error codes. + * + * @return array + */ + public function getErrorCodes() + { + return $this->errorCodes; + } + + /** + * Get hostname. + * + * @return string + */ + public function getHostname() + { + return $this->hostname; + } + + /** + * Get challenge timestamp + * + * @return string + */ + public function getChallengeTs() + { + return $this->challengeTs; + } + + /** + * Get APK package name + * + * @return string + */ + public function getApkPackageName() + { + return $this->apkPackageName; + } + /** + * Get score + * + * @return float + */ + public function getScore() + { + return $this->score; + } + + /** + * Get action + * + * @return string + */ + public function getAction() + { + return $this->action; + } + + public function toArray() + { + return array( + 'success' => $this->isSuccess(), + 'hostname' => $this->getHostname(), + 'challenge_ts' => $this->getChallengeTs(), + 'apk_package_name' => $this->getApkPackageName(), + 'score' => $this->getScore(), + 'action' => $this->getAction(), + 'error-codes' => $this->getErrorCodes(), + ); + } +} diff --git a/phpMyAdmin/vendor/google/recaptcha/src/autoload.php b/phpMyAdmin/vendor/google/recaptcha/src/autoload.php new file mode 100755 index 0000000..7947a10 --- /dev/null +++ b/phpMyAdmin/vendor/google/recaptcha/src/autoload.php @@ -0,0 +1,69 @@ +=4" + + - name: PHPUnit tests + uses: php-actions/phpunit@v2 + timeout-minutes: 30 + with: + memory_limit: 256M + + - name: Static Analysis + run: vendor/bin/psalm + + modern: + name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} + runs-on: ${{ matrix.operating-system }} + strategy: + matrix: + operating-system: ['ubuntu-latest'] + php-versions: ['7.4', '8.0'] + phpunit-versions: ['latest'] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-versions }} + extensions: mbstring, intl, sodium + ini-values: post_max_size=256M, max_execution_time=180 + tools: psalm, phpunit:${{ matrix.phpunit-versions }} + + - name: Install dependencies + run: composer require vimeo/psalm; composer install + - name: PHPUnit tests + uses: php-actions/phpunit@v2 + timeout-minutes: 30 + with: + memory_limit: 256M + + - name: Static Analysis + run: vendor/bin/psalm diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/LICENSE.txt b/phpMyAdmin/vendor/paragonie/constant_time_encoding/LICENSE.txt new file mode 100755 index 0000000..7cb6fd8 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/LICENSE.txt @@ -0,0 +1,48 @@ +The MIT License (MIT) + +Copyright (c) 2016 - 2018 Paragon Initiative Enterprises + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +------------------------------------------------------------------------------ +This library was based on the work of Steve "Sc00bz" Thomas. +------------------------------------------------------------------------------ + +The MIT License (MIT) + +Copyright (c) 2014 Steve Thomas + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/README.md b/phpMyAdmin/vendor/paragonie/constant_time_encoding/README.md new file mode 100755 index 0000000..5e9afc2 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/README.md @@ -0,0 +1,74 @@ +# Constant-Time Encoding + +[![Build Status](https://travis-ci.org/paragonie/constant_time_encoding.svg?branch=v1.x)](https://travis-ci.org/paragonie/constant_time_encoding) + +Based on the [constant-time base64 implementation made by Steve "Sc00bz" Thomas](https://github.com/Sc00bz/ConstTimeEncoding), +this library aims to offer character encoding functions that do not leak +information about what you are encoding/decoding via processor cache +misses. Further reading on [cache-timing attacks](http://blog.ircmaxell.com/2014/11/its-all-about-time.html). + +Our fork offers the following enchancements: + +* `mbstring.func_overload` resistance +* Unit tests +* Composer- and Packagist-ready +* Base16 encoding +* Base32 encoding +* Uses `pack()` and `unpack()` instead of `chr()` and `ord()` + +## PHP Version Requirements + +This library should work on any [supported version of PHP](https://secure.php.net/supported-versions.php). +It *may* work on earlier versions, but we **do not** guarantee it. If it +doesn't, we **will not** fix it to work on earlier versions of PHP. + +## How to Install + +```sh +composer require paragonie/constant_time_encoding +``` + +## How to Use + +```php +use \ParagonIE\ConstantTime\Encoding; + +// possibly (if applicable): +// require 'vendor/autoload.php'; + +$data = random_bytes(32); +echo Encoding::base64Encode($data), "\n"; +echo Encoding::base32EncodeUpper($data), "\n"; +echo Encoding::base32Encode($data), "\n"; +echo Encoding::hexEncode($data), "\n"; +echo Encoding::hexEncodeUpper($data), "\n"; +``` + +Example output: + +``` +1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE= +2VMKKPSHSWVCVZJ6E7SONRY3ZXCNG3GE6ZZFU7TGJSX7KUKFNLAQ==== +2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq==== +d558a53e4795aa2ae53e27e4e6c71bcdc4d36cc4f6725a7e664caff551456ac1 +D558A53E4795AA2AE53E27E4E6C71BDCC4D36CC4F6725A7E664CAFF551456AC1 +``` + +If you only need a particular variant, you can just reference the +required class like so: + +```php +use \ParagonIE\ConstantTime\Base64; +use \ParagonIE\ConstantTime\Base32; + +$data = random_bytes(32); +echo Base64::encode($data), "\n"; +echo Base32::encode($data), "\n"; +``` + +Example output: + +``` +1VilPkeVqirlPifk5scbzcTTbMT2clp+Zkyv9VFFasE= +2vmkkpshswvcvzj6e7sonry3zxcng3ge6zzfu7tgjsx7kukfnlaq==== +``` \ No newline at end of file diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/composer.json b/phpMyAdmin/vendor/paragonie/constant_time_encoding/composer.json new file mode 100755 index 0000000..741374f --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/composer.json @@ -0,0 +1,40 @@ +{ + "name": "paragonie/constant_time_encoding", + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base64", "encoding", "rfc4648", "base32", "base16", "hex", "bin2hex", "hex2bin", "base64_encode", "base64_decode", "base32_encode", "base32_decode" + ], + "license": "MIT", + "type": "library", + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "support": { + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "email": "info@paragonie.com", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "require": { + "php": "^5.3|^7|^8" + }, + "require-dev": { + "phpunit/phpunit": ">= 4", + "paragonie/random_compat": "^1.4|^2" + }, + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/phpunit.xml.dist b/phpMyAdmin/vendor/paragonie/constant_time_encoding/phpunit.xml.dist new file mode 100755 index 0000000..6b22d38 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./tests + + + diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/psalm.xml b/phpMyAdmin/vendor/paragonie/constant_time_encoding/psalm.xml new file mode 100755 index 0000000..33310b8 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/psalm.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base32.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base32.php new file mode 100755 index 0000000..704b6a9 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base32.php @@ -0,0 +1,430 @@ + 96 && $src < 123) $ret += $src - 97 + 1; // -64 + $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 96); + + // if ($src > 0x31 && $src < 0x38) $ret += $src - 24 + 1; // -23 + $ret += (((0x31 - $src) & ($src - 0x38)) >> 8) & ($src - 23); + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 5-bit integers + * into 8-bit integers. + * + * Uppercase variant. + * + * @param int $src + * @return int + */ + protected static function decode5BitsUpper($src) + { + $ret = -1; + + // if ($src > 64 && $src < 91) $ret += $src - 65 + 1; // -64 + $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64); + + // if ($src > 0x31 && $src < 0x38) $ret += $src - 24 + 1; // -23 + $ret += (((0x31 - $src) & ($src - 0x38)) >> 8) & ($src - 23); + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 5-bit integers. + * + * @param int $src + * @return string + */ + protected static function encode5Bits($src) + { + $diff = 0x61; + + // if ($src > 25) $ret -= 72; + $diff -= ((25 - $src) >> 8) & 73; + + return \pack('C', $src + $diff); + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 5-bit integers. + * + * Uppercase variant. + * + * @param int $src + * @return string + */ + protected static function encode5BitsUpper($src) + { + $diff = 0x41; + + // if ($src > 25) $ret -= 40; + $diff -= ((25 - $src) >> 8) & 41; + + return \pack('C', $src + $diff); + } + + + /** + * Base32 decoding + * + * @param string $src + * @param bool $upper + * @param bool $strictPadding + * @return string + */ + protected static function doDecode($src, $upper = \false, $strictPadding = \true) + { + // We do this to reduce code duplication: + $method = $upper + ? 'decode5BitsUpper' + : 'decode5Bits'; + + // Remove padding + $srcLen = Binary::safeStrlen($src); + if ($srcLen === 0) { + return ''; + } + if ($strictPadding) { + if (($srcLen & 7) === 0) { + for ($j = 0; $j < 7; ++$j) { + if ($src[$srcLen - 1] === '=') { + $srcLen--; + } else { + break; + } + } + } + if (($srcLen & 7) === 1) { + throw new \RangeException( + 'Incorrect padding' + ); + } + } else { + $src = \rtrim($src, '='); + $srcLen = Binary::safeStrlen($src); + } + + $err = 0; + $dest = ''; + // Main loop (no padding): + for ($i = 0; $i + 8 <= $srcLen; $i += 8) { + $chunk = \unpack('C*', Binary::safeSubstr($src, $i, 8)); + $c0 = static::$method($chunk[1]); + $c1 = static::$method($chunk[2]); + $c2 = static::$method($chunk[3]); + $c3 = static::$method($chunk[4]); + $c4 = static::$method($chunk[5]); + $c5 = static::$method($chunk[6]); + $c6 = static::$method($chunk[7]); + $c7 = static::$method($chunk[8]); + + $dest .= \pack( + 'CCCCC', + (($c0 << 3) | ($c1 >> 2) ) & 0xff, + (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff, + (($c3 << 4) | ($c4 >> 1) ) & 0xff, + (($c4 << 7) | ($c5 << 2) | ($c6 >> 3)) & 0xff, + (($c6 << 5) | ($c7 ) ) & 0xff + ); + $err |= ($c0 | $c1 | $c2 | $c3 | $c4 | $c5 | $c6 | $c7) >> 8; + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + $chunk = \unpack('C*', Binary::safeSubstr($src, $i, $srcLen - $i)); + $c0 = static::$method($chunk[1]); + + if ($i + 6 < $srcLen) { + $c1 = static::$method($chunk[2]); + $c2 = static::$method($chunk[3]); + $c3 = static::$method($chunk[4]); + $c4 = static::$method($chunk[5]); + $c5 = static::$method($chunk[6]); + $c6 = static::$method($chunk[7]); + + $dest .= \pack( + 'CCCC', + (($c0 << 3) | ($c1 >> 2) ) & 0xff, + (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff, + (($c3 << 4) | ($c4 >> 1) ) & 0xff, + (($c4 << 7) | ($c5 << 2) | ($c6 >> 3)) & 0xff + ); + $err |= ($c0 | $c1 | $c2 | $c3 | $c4 | $c5 | $c6) >> 8; + } elseif ($i + 5 < $srcLen) { + $c1 = static::$method($chunk[2]); + $c2 = static::$method($chunk[3]); + $c3 = static::$method($chunk[4]); + $c4 = static::$method($chunk[5]); + $c5 = static::$method($chunk[6]); + + $dest .= \pack( + 'CCCC', + (($c0 << 3) | ($c1 >> 2) ) & 0xff, + (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff, + (($c3 << 4) | ($c4 >> 1) ) & 0xff, + (($c4 << 7) | ($c5 << 2) ) & 0xff + ); + $err |= ($c0 | $c1 | $c2 | $c3 | $c4 | $c5) >> 8; + } elseif ($i + 4 < $srcLen) { + $c1 = static::$method($chunk[2]); + $c2 = static::$method($chunk[3]); + $c3 = static::$method($chunk[4]); + $c4 = static::$method($chunk[5]); + + $dest .= \pack( + 'CCC', + (($c0 << 3) | ($c1 >> 2) ) & 0xff, + (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff, + (($c3 << 4) | ($c4 >> 1) ) & 0xff + ); + $err |= ($c0 | $c1 | $c2 | $c3 | $c4) >> 8; + } elseif ($i + 3 < $srcLen) { + $c1 = static::$method($chunk[2]); + $c2 = static::$method($chunk[3]); + $c3 = static::$method($chunk[4]); + + $dest .= \pack( + 'CC', + (($c0 << 3) | ($c1 >> 2) ) & 0xff, + (($c1 << 6) | ($c2 << 1) | ($c3 >> 4)) & 0xff + ); + $err |= ($c0 | $c1 | $c2 | $c3) >> 8; + } elseif ($i + 2 < $srcLen) { + $c1 = static::$method($chunk[2]); + $c2 = static::$method($chunk[3]); + + $dest .= \pack( + 'CC', + (($c0 << 3) | ($c1 >> 2) ) & 0xff, + (($c1 << 6) | ($c2 << 1) ) & 0xff + ); + $err |= ($c0 | $c1 | $c2) >> 8; + } elseif ($i + 1 < $srcLen) { + $c1 = static::$method($chunk[2]); + + $dest .= \pack( + 'C', + (($c0 << 3) | ($c1 >> 2) ) & 0xff + ); + $err |= ($c0 | $c1) >> 8; + } else { + $dest .= \pack( + 'C', + (($c0 << 3) ) & 0xff + ); + $err |= ($c0) >> 8; + } + } + if ($err !== 0) { + throw new \RangeException( + 'Base32::doDecode() only expects characters in the correct base32 alphabet' + ); + } + return $dest; + } + + /** + * Base32 Decoding + * + * @param string $src + * @param bool $upper + * @param bool $pad + * @return string + */ + protected static function doEncode($src, $upper = \false, $pad = \true) + { + // We do this to reduce code duplication: + $method = $upper + ? 'encode5BitsUpper' + : 'encode5Bits'; + + $dest = ''; + $srcLen = Binary::safeStrlen($src); + + // Main loop (no padding): + for ($i = 0; $i + 5 <= $srcLen; $i += 5) { + $chunk = \unpack('C*', Binary::safeSubstr($src, $i, 5)); + $b0 = $chunk[1]; + $b1 = $chunk[2]; + $b2 = $chunk[3]; + $b3 = $chunk[4]; + $b4 = $chunk[5]; + $dest .= + static::$method( ($b0 >> 3) & 31) . + static::$method((($b0 << 2) | ($b1 >> 6)) & 31) . + static::$method((($b1 >> 1) ) & 31) . + static::$method((($b1 << 4) | ($b2 >> 4)) & 31) . + static::$method((($b2 << 1) | ($b3 >> 7)) & 31) . + static::$method((($b3 >> 2) ) & 31) . + static::$method((($b3 << 3) | ($b4 >> 5)) & 31) . + static::$method( $b4 & 31); + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + $chunk = \unpack('C*', Binary::safeSubstr($src, $i, $srcLen - $i)); + $b0 = $chunk[1]; + if ($i + 3 < $srcLen) { + $b1 = $chunk[2]; + $b2 = $chunk[3]; + $b3 = $chunk[4]; + $dest .= + static::$method( ($b0 >> 3) & 31) . + static::$method((($b0 << 2) | ($b1 >> 6)) & 31) . + static::$method((($b1 >> 1) ) & 31) . + static::$method((($b1 << 4) | ($b2 >> 4)) & 31) . + static::$method((($b2 << 1) | ($b3 >> 7)) & 31) . + static::$method((($b3 >> 2) ) & 31) . + static::$method((($b3 << 3) ) & 31); + if ($pad) { + $dest .= '='; + } + } elseif ($i + 2 < $srcLen) { + $b1 = $chunk[2]; + $b2 = $chunk[3]; + $dest .= + static::$method( ($b0 >> 3) & 31) . + static::$method((($b0 << 2) | ($b1 >> 6)) & 31) . + static::$method((($b1 >> 1) ) & 31) . + static::$method((($b1 << 4) | ($b2 >> 4)) & 31) . + static::$method((($b2 << 1) ) & 31); + if ($pad) { + $dest .= '==='; + } + } elseif ($i + 1 < $srcLen) { + $b1 = $chunk[2]; + $dest .= + static::$method( ($b0 >> 3) & 31) . + static::$method((($b0 << 2) | ($b1 >> 6)) & 31) . + static::$method((($b1 >> 1) ) & 31) . + static::$method((($b1 << 4) ) & 31); + if ($pad) { + $dest .= '===='; + } + } else { + $dest .= + static::$method( ($b0 >> 3) & 31) . + static::$method( ($b0 << 2) & 31); + if ($pad) { + $dest .= '======'; + } + } + } + return $dest; + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base32Hex.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base32Hex.php new file mode 100755 index 0000000..0b19041 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base32Hex.php @@ -0,0 +1,110 @@ + 0x30 && $src < 0x3a) ret += $src - 0x2e + 1; // -47 + $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src - 47); + + // if ($src > 0x60 && $src < 0x77) ret += $src - 0x61 + 10 + 1; // -86 + $ret += (((0x60 - $src) & ($src - 0x77)) >> 8) & ($src - 86); + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 5-bit integers + * into 8-bit integers. + * + * @param int $src + * @return int + */ + protected static function decode5BitsUpper($src) + { + $ret = -1; + + // if ($src > 0x30 && $src < 0x3a) ret += $src - 0x2e + 1; // -47 + $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src - 47); + + // if ($src > 0x40 && $src < 0x57) ret += $src - 0x41 + 10 + 1; // -54 + $ret += (((0x40 - $src) & ($src - 0x57)) >> 8) & ($src - 54); + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 5-bit integers. + * + * @param int $src + * @return string + */ + protected static function encode5Bits($src) + { + $src += 0x30; + + // if ($src > 0x39) $src += 0x61 - 0x3a; // 39 + $src += ((0x39 - $src) >> 8) & 39; + + return \pack('C', $src); + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 5-bit integers. + * + * Uppercase variant. + * + * @param int $src + * @return string + */ + protected static function encode5BitsUpper($src) + { + $src += 0x30; + + // if ($src > 0x39) $src += 0x41 - 0x3a; // 7 + $src += ((0x39 - $src) >> 8) & 7; + + return \pack('C', $src); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64.php new file mode 100755 index 0000000..bf76b89 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64.php @@ -0,0 +1,252 @@ +> 2 ) . + static::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + static::encode6Bits((($b1 << 2) | ($b2 >> 6)) & 63) . + static::encode6Bits( $b2 & 63); + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + $chunk = \unpack('C*', Binary::safeSubstr($src, $i, $srcLen - $i)); + $b0 = $chunk[1]; + if ($i + 1 < $srcLen) { + $b1 = $chunk[2]; + $dest .= + static::encode6Bits( $b0 >> 2 ) . + static::encode6Bits((($b0 << 4) | ($b1 >> 4)) & 63) . + static::encode6Bits( ($b1 << 2) & 63); + if ($pad) { + $dest .= '='; + } + } else { + $dest .= + static::encode6Bits( $b0 >> 2) . + static::encode6Bits(($b0 << 4) & 63); + if ($pad) { + $dest .= '=='; + } + } + } + return $dest; + } + + /** + * decode from base64 into binary + * + * Base64 character set "./[A-Z][a-z][0-9]" + * + * @param string $encoded_string + * @param bool $strictPadding + * @return string + * @throws \RangeException + */ + public static function decode($encoded_string, $strictPadding = \false) + { + // Remove padding + $srcLen = Binary::safeStrlen($encoded_string); + if ($srcLen === 0) { + return ''; + } + if ($strictPadding) { + if (($srcLen & 3) === 0) { + if ($encoded_string[$srcLen - 1] === '=') { + $srcLen--; + if ($encoded_string[$srcLen - 1] === '=') { + $srcLen--; + } + } + } + if (($srcLen & 3) === 1) { + throw new \RangeException( + 'Incorrect padding' + ); + } + } else { + $encoded_string = \rtrim($encoded_string, '='); + $srcLen = Binary::safeStrlen($encoded_string); + } + + $err = 0; + $dest = ''; + // Main loop (no padding): + for ($i = 0; $i + 4 <= $srcLen; $i += 4) { + $chunk = \unpack('C*', Binary::safeSubstr($encoded_string, $i, 4)); + $c0 = static::decode6Bits($chunk[1]); + $c1 = static::decode6Bits($chunk[2]); + $c2 = static::decode6Bits($chunk[3]); + $c3 = static::decode6Bits($chunk[4]); + + $dest .= \pack( + 'CCC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff), + ((($c2 << 6) | $c3 ) & 0xff) + ); + $err |= ($c0 | $c1 | $c2 | $c3) >> 8; + } + // The last chunk, which may have padding: + if ($i < $srcLen) { + $chunk = \unpack('C*', Binary::safeSubstr($encoded_string, $i, $srcLen - $i)); + $c0 = static::decode6Bits($chunk[1]); + if ($i + 2 < $srcLen) { + $c1 = static::decode6Bits($chunk[2]); + $c2 = static::decode6Bits($chunk[3]); + $dest .= \pack( + 'CC', + ((($c0 << 2) | ($c1 >> 4)) & 0xff), + ((($c1 << 4) | ($c2 >> 2)) & 0xff) + ); + $err |= ($c0 | $c1 | $c2) >> 8; + } elseif($i + 1 < $srcLen) { + $c1 = static::decode6Bits($chunk[2]); + $dest .= \pack( + 'C', + ((($c0 << 2) | ($c1 >> 4)) & 0xff) + ); + $err |= ($c0 | $c1) >> 8; + } elseif ($i < $srcLen && $strictPadding) { + $err |= 1; + } + } + if ($err !== 0) { + throw new \RangeException( + 'Base64::decode() only expects characters in the correct base64 alphabet' + ); + } + return $dest; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 6-bit integers + * into 8-bit integers. + * + * Base64 character set: + * [A-Z] [a-z] [0-9] + / + * 0x41-0x5a, 0x61-0x7a, 0x30-0x39, 0x2b, 0x2f + * + * @param int $src + * @return int + */ + protected static function decode6Bits($src) + { + $ret = -1; + + // if ($src > 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64 + $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64); + + // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70 + $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70); + + // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5 + $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5); + + // if ($src == 0x2b) $ret += 62 + 1; + $ret += (((0x2a - $src) & ($src - 0x2c)) >> 8) & 63; + + // if ($src == 0x2f) ret += 63 + 1; + $ret += (((0x2e - $src) & ($src - 0x30)) >> 8) & 64; + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 6-bit integers. + * + * @param int $src + * @return string + */ + protected static function encode6Bits($src) + { + $diff = 0x41; + + // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6 + $diff += ((25 - $src) >> 8) & 6; + + // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75 + $diff -= ((51 - $src) >> 8) & 75; + + // if ($src > 61) $diff += 0x2b - 0x30 - 10; // -15 + $diff -= ((61 - $src) >> 8) & 15; + + // if ($src > 62) $diff += 0x2f - 0x2b - 1; // 3 + $diff += ((62 - $src) >> 8) & 3; + + return \pack('C', $src + $diff); + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php new file mode 100755 index 0000000..8107824 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64DotSlash.php @@ -0,0 +1,87 @@ + 0x2d && $src < 0x30) ret += $src - 0x2e + 1; // -45 + $ret += (((0x2d - $src) & ($src - 0x30)) >> 8) & ($src - 45); + + // if ($src > 0x40 && $src < 0x5b) ret += $src - 0x41 + 2 + 1; // -62 + $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 62); + + // if ($src > 0x60 && $src < 0x7b) ret += $src - 0x61 + 28 + 1; // -68 + $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 68); + + // if ($src > 0x2f && $src < 0x3a) ret += $src - 0x30 + 54 + 1; // 7 + $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 7); + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 6-bit integers. + * + * @param int $src + * @return string + */ + protected static function encode6Bits($src) + { + $src += 0x2e; + + // if ($src > 0x2f) $src += 0x41 - 0x30; // 17 + $src += ((0x2f - $src) >> 8) & 17; + + // if ($src > 0x5a) $src += 0x61 - 0x5b; // 6 + $src += ((0x5a - $src) >> 8) & 6; + + // if ($src > 0x7a) $src += 0x30 - 0x7b; // -75 + $src -= ((0x7a - $src) >> 8) & 75; + + return \pack('C', $src); + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php new file mode 100755 index 0000000..0199687 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64DotSlashOrdered.php @@ -0,0 +1,81 @@ + 0x2d && $src < 0x3a) ret += $src - 0x2e + 1; // -45 + $ret += (((0x2d - $src) & ($src - 0x3a)) >> 8) & ($src - 45); + + // if ($src > 0x40 && $src < 0x5b) ret += $src - 0x41 + 12 + 1; // -52 + $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 52); + + // if ($src > 0x60 && $src < 0x7b) ret += $src - 0x61 + 38 + 1; // -58 + $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 58); + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 6-bit integers. + * + * @param int $src + * @return string + */ + protected static function encode6Bits($src) + { + $src += 0x2e; + + // if ($src > 0x39) $src += 0x41 - 0x3a; // 7 + $src += ((0x39 - $src) >> 8) & 7; + + // if ($src > 0x5a) $src += 0x61 - 0x5b; // 6 + $src += ((0x5a - $src) >> 8) & 6; + + return \pack('C', $src); + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php new file mode 100755 index 0000000..b094632 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Base64UrlSafe.php @@ -0,0 +1,94 @@ + 0x40 && $src < 0x5b) $ret += $src - 0x41 + 1; // -64 + $ret += (((0x40 - $src) & ($src - 0x5b)) >> 8) & ($src - 64); + + // if ($src > 0x60 && $src < 0x7b) $ret += $src - 0x61 + 26 + 1; // -70 + $ret += (((0x60 - $src) & ($src - 0x7b)) >> 8) & ($src - 70); + + // if ($src > 0x2f && $src < 0x3a) $ret += $src - 0x30 + 52 + 1; // 5 + $ret += (((0x2f - $src) & ($src - 0x3a)) >> 8) & ($src + 5); + + // if ($src == 0x2c) $ret += 62 + 1; + $ret += (((0x2c - $src) & ($src - 0x2e)) >> 8) & 63; + + // if ($src == 0x5f) ret += 63 + 1; + $ret += (((0x5e - $src) & ($src - 0x60)) >> 8) & 64; + + return $ret; + } + + /** + * Uses bitwise operators instead of table-lookups to turn 8-bit integers + * into 6-bit integers. + * + * @param int $src + * @return string + */ + protected static function encode6Bits($src) + { + $diff = 0x41; + + // if ($src > 25) $diff += 0x61 - 0x41 - 26; // 6 + $diff += ((25 - $src) >> 8) & 6; + + // if ($src > 51) $diff += 0x30 - 0x61 - 26; // -75 + $diff -= ((51 - $src) >> 8) & 75; + + // if ($src > 61) $diff += 0x2d - 0x30 - 10; // -13 + $diff -= ((61 - $src) >> 8) & 13; + + // if ($src > 62) $diff += 0x5f - 0x2b - 1; // 3 + $diff += ((62 - $src) >> 8) & 49; + + return \pack('C', $src + $diff); + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Binary.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Binary.php new file mode 100755 index 0000000..7aa3480 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/Binary.php @@ -0,0 +1,97 @@ += 0) { + $length = self::safeStrlen($str) - $start; + } else { + $length = -$start; + } + } + // $length calculation above might result in a 0-length string + if ($length === 0) { + return ''; + } + return \mb_substr($str, $start, $length, '8bit'); + } + if ($length === 0) { + return ''; + } + // Unlike mb_substr(), substr() doesn't accept null for length + if (!is_null($length)) { + return \substr($str, $start, $length); + } else { + return \substr($str, $start); + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php new file mode 100755 index 0000000..ac50038 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/EncoderInterface.php @@ -0,0 +1,50 @@ +> 4; + $hex .= pack( + 'CC', + (87 + $b + ((($b - 10) >> 8) & ~38)), + (87 + $c + ((($c - 10) >> 8) & ~38)) + ); + } + return $hex; + } + + /** + * Convert a binary string into a hexadecimal string without cache-timing + * leaks, returning uppercase letters (as per RFC 4648) + * + * @param string $bin_string (raw binary) + * @return string + */ + public static function encodeUpper($bin_string) + { + $hex = ''; + $len = Binary::safeStrlen($bin_string); + for ($i = 0; $i < $len; ++$i) { + $chunk = \unpack('C', Binary::safeSubstr($bin_string, $i, 2)); + $c = $chunk[1] & 0xf; + $b = $chunk[1] >> 4; + $hex .= pack( + 'CC', + (55 + $b + ((($b - 10) >> 8) & ~6)), + (55 + $c + ((($c - 10) >> 8) & ~6)) + ); + } + return $hex; + } + + /** + * Convert a hexadecimal string into a binary string without cache-timing + * leaks + * + * @param string $encoded_string + * @return string (raw binary) + * @throws \RangeException + */ + public static function decode($encoded_string) + { + $hex_pos = 0; + $bin = ''; + $c_acc = 0; + $hex_len = Binary::safeStrlen($encoded_string); + $state = 0; + if (($hex_len & 1) !== 0) { + throw new \RangeException( + 'Expected an even number of hexadecimal characters' + ); + } + + $chunk = \unpack('C*', $encoded_string); + while ($hex_pos < $hex_len) { + ++$hex_pos; + $c = $chunk[$hex_pos]; + $c_num = $c ^ 48; + $c_num0 = ($c_num - 10) >> 8; + $c_alpha = ($c & ~32) - 55; + $c_alpha0 = (($c_alpha - 10) ^ ($c_alpha - 16)) >> 8; + if (($c_num0 | $c_alpha0) === 0) { + throw new \RangeException( + 'hexEncode() only expects hexadecimal characters' + ); + } + $c_val = ($c_num0 & $c_num) | ($c_alpha & $c_alpha0); + if ($state === 0) { + $c_acc = $c_val * 16; + } else { + $bin .= \pack('C', $c_acc | $c_val); + } + $state ^= 1; + } + return $bin; + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/RFC4648.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/RFC4648.php new file mode 100755 index 0000000..460a4fa --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/src/RFC4648.php @@ -0,0 +1,165 @@ + "Zm9v" + * + * @param string $str + * @return string + */ + public function base64Encode($str) + { + return Base64::encode($str); + } + + /** + * RFC 4648 Base64 decoding + * + * "Zm9v" -> "foo" + * + * @param string $str + * @return string + */ + public function base64Decode($str) + { + return Base64::decode($str); + } + + /** + * RFC 4648 Base64 (URL Safe) encoding + * + * "foo" -> "Zm9v" + * + * @param string $str + * @return string + */ + public function base64UrlSafeEncode($str) + { + return Base64UrlSafe::encode($str); + } + + /** + * RFC 4648 Base64 (URL Safe) decoding + * + * "Zm9v" -> "foo" + * + * @param string $str + * @return string + */ + public function base64UrlSafeDecode($str) + { + return Base64UrlSafe::decode($str); + } + + /** + * RFC 4648 Base32 encoding + * + * "foo" -> "MZXW6===" + * + * @param string $str + * @return string + */ + public function base32Encode($str) + { + return Base32::encodeUpper($str); + } + + /** + * RFC 4648 Base32 encoding + * + * "MZXW6===" -> "foo" + * + * @param string $str + * @return string + */ + public function base32Decode($str) + { + return Base32::decodeUpper($str); + } + + /** + * RFC 4648 Base32-Hex encoding + * + * "foo" -> "CPNMU===" + * + * @param string $str + * @return string + */ + public function base32HexEncode($str) + { + return Base32::encodeUpper($str); + } + + /** + * RFC 4648 Base32-Hex decoding + * + * "CPNMU===" -> "foo" + * + * @param string $str + * @return string + */ + public function base32HexDecode($str) + { + return Base32::decodeUpper($str); + } + + /** + * RFC 4648 Base16 decoding + * + * "foo" -> "666F6F" + * + * @param string $str + * @return string + */ + public function base16Encode($str) + { + return Hex::encodeUpper($str); + } + + /** + * RFC 4648 Base16 decoding + * + * "666F6F" -> "foo" + * + * @param string $str + * @return string + */ + public function base16Decode($str) + { + return Hex::decode($str); + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base32HexTest.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base32HexTest.php new file mode 100755 index 0000000..68bf46a --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base32HexTest.php @@ -0,0 +1,32 @@ +assertSame( + $random, + Base32Hex::decode($enc) + ); + + $enc = Base32Hex::encodeUpper($random); + $this->assertSame( + $random, + Base32Hex::decodeUpper($enc) + ); + } + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base32Test.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base32Test.php new file mode 100755 index 0000000..12c17e5 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base32Test.php @@ -0,0 +1,42 @@ +assertSame( + $random, + Base32::decode($enc) + ); + + $this->assertSame( + Base32::encodeUnpadded($random), + \rtrim(Base32::encode($random), '=') + ); + + $enc = Base32::encodeUpper($random); + $this->assertSame( + $random, + Base32::decodeUpper($enc) + ); + + $this->assertSame( + Base32::encodeUpperUnpadded($random), + \rtrim(Base32::encodeUpper($random), '=') + ); + } + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashOrderedTest.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashOrderedTest.php new file mode 100755 index 0000000..cf6a0ef --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashOrderedTest.php @@ -0,0 +1,24 @@ +assertSame( + $random, + Base64DotSlashOrdered::decode($enc) + ); + } + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashTest.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashTest.php new file mode 100755 index 0000000..565f010 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64DotSlashTest.php @@ -0,0 +1,24 @@ +assertSame( + $random, + Base64DotSlash::decode($enc) + ); + } + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64Test.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64Test.php new file mode 100755 index 0000000..d134f59 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64Test.php @@ -0,0 +1,83 @@ +assertSame( + $random, + Base64::decode($enc) + ); + $this->assertSame( + \base64_encode($random), + $enc + ); + + $unpadded = \rtrim($enc, '='); + $this->assertSame( + $random, + Base64::decode($unpadded, false) + ); + $extra_pad = $enc . '======='; + + $this->assertSame( + $random, + Base64::decode($extra_pad, false) + ); + } + } + + $str = 'MIIFzzCCBLegAwIBAgIDAfdlMA0GCSqGSIb3DQEBBQUAMHMxCzAJBgNVBAYTAlBM' . + 'MSgwJgYDVQQKDB9LcmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMSQwIgYDVQQ' . + 'DDBtDT1BFIFNaQUZJUiAtIEt3YWxpZmlrb3dhbnkxFDASBgNVBAUTC05yIHdwaXN1Oi' . + 'A2MB4XDTExMTEwOTA2MDAwMFoXDTEzMTEwOTA2MDAwMFowgdkxCzAJBgNVBAYTAlBMM' . + 'RwwGgYDVQQKDBNVcnrEhWQgTWlhc3RhIEdkeW5pMRswGQYDVQQFExJQRVNFTDogNjEw' . + 'NjA2MDMxMTgxGTAXBgNVBAMMEEplcnp5IFByemV3b3Jza2kxTzBNBgNVBBAwRgwiQWw' . + 'uIE1hcnN6YcWCa2EgUGnFgnN1ZHNraWVnbyA1Mi81NAwNODEtMzgyIEdkeW5pYQwGUG' . + '9sc2thDAlwb21vcnNraWUxDjAMBgNVBCoMBUplcnp5MRMwEQYDVQQEDApQcnpld29yc' . + '2tpMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMm5vjGqHPthJCMqKpqssSISRo' . + 's0PYDTcEQzyyurfX67EJWKtZj6HNwuDMEGJ02iBNZfjUl7r8dIi28bSKhNlsfycXZKY' . + 'RcIjp0+r5RqtR2auo9GQ6veKb61DEAGIqaR+uLLcJVTHCu0w9oXLGbRlGth5eNoj03C' . + 'xXVAH2IfhbNwIDAQABo4IChzCCAoMwDAYDVR0TAQH/BAIwADCCAUgGA1UdIAEB/wSCA' . + 'TwwggE4MIIBNAYJKoRoAYb3IwEBMIIBJTCB3QYIKwYBBQUHAgIwgdAMgc1EZWtsYXJh' . + 'Y2phIHRhIGplc3Qgb8Wbd2lhZGN6ZW5pZW0gd3lkYXdjeSwgxbxlIHRlbiBjZXJ0eWZ' . + 'pa2F0IHpvc3RhxYIgd3lkYW55IGpha28gY2VydHlmaWthdCBrd2FsaWZpa293YW55IH' . + 'pnb2RuaWUgeiB3eW1hZ2FuaWFtaSB1c3Rhd3kgbyBwb2RwaXNpZSBlbGVrdHJvbmlje' . + 'm55bSBvcmF6IHRvd2FyenlzesSFY3ltaSBqZWogcm96cG9yesSFZHplbmlhbWkuMEMG' . + 'CCsGAQUFBwIBFjdodHRwOi8vd3d3Lmtpci5jb20ucGwvY2VydHlmaWthY2phX2tsdWN' . + '6eS9wb2xpdHlrYS5odG1sMAkGA1UdCQQCMAAwIQYDVR0RBBowGIEWai5wcnpld29yc2' . + 'tpQGdkeW5pYS5wbDAOBgNVHQ8BAf8EBAMCBkAwgZ4GA1UdIwSBljCBk4AU3TGldJXip' . + 'N4oGS3ZYmnBDMFs8gKhd6R1MHMxCzAJBgNVBAYTAlBMMSgwJgYDVQQKDB9LcmFqb3dh' . + 'IEl6YmEgUm96bGljemVuaW93YSBTLkEuMSQwIgYDVQQDDBtDT1BFIFNaQUZJUiAtIEt' . + '3YWxpZmlrb3dhbnkxFDASBgNVBAUTC05yIHdwaXN1OiA2ggJb9jBIBgNVHR8EQTA/MD' . + '2gO6A5hjdodHRwOi8vd3d3Lmtpci5jb20ucGwvY2VydHlmaWthY2phX2tsdWN6eS9DU' . + 'kxfT1pLMzIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQBYPIqnAreyeql7/opJjcar/qWZ' . + 'y9ruhB2q0lZFsJOhwgMnbQXzp/4vv93YJqcHGAXdHP6EO8FQX47mjo2ZKQmi+cIHJHL' . + 'ONdX/3Im+M17V0iNAh7Z1lOSfTRT+iiwe/F8phcEaD5q2RmvYusR7zXZq/cLL0If0hX' . + 'oPZ/EHQxjN8pxzxiUx6bJAgturnIMEfRNesxwghdr1dkUjOhGLf3kHVzgM6j3VAM7oF' . + 'mMUb5y5s96Bzl10DodWitjOEH0vvnIcsppSxH1C1dCAi0o9f/1y2XuLNhBNHMAyTqpY' . + 'PX8Yvav1c+Z50OMaSXHAnTa20zv8UtiHbaAhwlifCelUMj93S'; + + $str = preg_replace('#[\r\n]#', '', $str); + $this->assertSame( + Base64::decode($str), + \base64_decode($str) + ); + + $str = 'zbhle48rXrbJUdodb6FAQvkj0W/vDhBzt/mZiCTpaJ/zumnG1wCDuEQBoh9P'; + $this->assertSame( + Base64::decode($str), + \base64_decode($str) + ); + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64UrlSafeTest.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64UrlSafeTest.php new file mode 100755 index 0000000..01737cd --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/Base64UrlSafeTest.php @@ -0,0 +1,37 @@ +assertSame( + $random, + Base64UrlSafe::decode($enc) + ); + $this->assertSame( + \strtr(\base64_encode($random), '+/', '-_'), + $enc + ); + $unpadded = \rtrim($enc, '='); + $this->assertSame( + $unpadded, + Base64UrlSafe::encodeUnpadded($random) + ); + $this->assertSame( + $random, + Base64UrlSafe::decode($unpadded) + ); + } + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/EncodingTest.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/EncodingTest.php new file mode 100755 index 0000000..0c3ebaf --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/EncodingTest.php @@ -0,0 +1,307 @@ +assertSame( + Encoding::base32Encode("\x00"), + 'aa======' + ); + $this->assertSame( + Encoding::base32Encode("\x00\x00"), + 'aaaa====' + ); + $this->assertSame( + Encoding::base32Encode("\x00\x00\x00"), + 'aaaaa===' + ); + $this->assertSame( + Encoding::base32Encode("\x00\x00\x00\x00"), + 'aaaaaaa=' + ); + $this->assertSame( + Encoding::base32Encode("\x00\x00\x00\x00\x00"), + 'aaaaaaaa' + ); + $this->assertSame( + Encoding::base32Encode("\x00\x00\x0F\xFF\xFF"), + 'aaaa7777' + ); + $this->assertSame( + Encoding::base32Encode("\xFF\xFF\xF0\x00\x00"), + '7777aaaa' + ); + + $this->assertSame( + Encoding::base32Encode("\xce\x73\x9c\xe7\x39"), + 'zzzzzzzz' + ); + $this->assertSame( + Encoding::base32Encode("\xd6\xb5\xad\x6b\x5a"), + '22222222' + ); + $this->assertSame( + Base32::encodeUpper("\x00"), + 'AA======' + ); + $this->assertSame( + Base32::encodeUpper("\x00\x00"), + 'AAAA====' + ); + $this->assertSame( + Base32::encodeUpper("\x00\x00\x00"), + 'AAAAA===' + ); + $this->assertSame( + Base32::encodeUpper("\x00\x00\x00\x00"), + 'AAAAAAA=' + ); + $this->assertSame( + Base32::encodeUpper("\x00\x00\x00\x00\x00"), + 'AAAAAAAA' + ); + $this->assertSame( + Base32::encodeUpper("\x00\x00\x0F\xFF\xFF"), + 'AAAA7777' + ); + $this->assertSame( + Base32::encodeUpper("\xFF\xFF\xF0\x00\x00"), + '7777AAAA' + ); + + $this->assertSame( + Base32::encodeUpper("\xce\x73\x9c\xe7\x39"), + 'ZZZZZZZZ' + ); + $this->assertSame( + Base32::encodeUpper("\xd6\xb5\xad\x6b\x5a"), + '22222222' + ); + } + + public function testBase32Hex() + { + $this->assertSame( + Base32Hex::encode("\x00"), + '00======' + ); + $this->assertSame( + Base32Hex::encode("\x00\x00"), + '0000====' + ); + $this->assertSame( + Base32Hex::encode("\x00\x00\x00"), + '00000===' + ); + $this->assertSame( + Base32Hex::encode("\x00\x00\x00\x00"), + '0000000=' + ); + $this->assertSame( + Base32Hex::encode("\x00\x00\x00\x00\x00"), + '00000000' + ); + $this->assertSame( + Base32Hex::encode("\x00\x00\x0F\xFF\xFF"), + '0000vvvv' + ); + $this->assertSame( + Base32Hex::encode("\xFF\xFF\xF0\x00\x00"), + 'vvvv0000' + ); + + + } + + /** + * Based on test vectors from RFC 4648 + */ + public function testBase32Decode() + { + $this->assertSame( + "\x00\x00\x00\x00\x00\x00", + Encoding::base32Decode('aaaaaaaaaa======') + ); + $this->assertSame( + "\x00\x00\x00\x00\x00\x00\x00", + Encoding::base32Decode('aaaaaaaaaaaa====') + ); + $this->assertSame( + "\x00\x00\x00\x00\x00\x00\x00\x00", + Encoding::base32Decode('aaaaaaaaaaaaa===') + ); + $this->assertSame( + "\x00\x00\x00\x00\x00\x00\x00\x00\x00", + Encoding::base32Decode('aaaaaaaaaaaaaaa=') + ); + $this->assertSame( + "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", + Encoding::base32Decode('aaaaaaaaaaaaaaaa') + ); + $this->assertSame( + "\x00", + Encoding::base32Decode('aa======') + ); + $this->assertSame( + "\x00\x00", + Encoding::base32Decode('aaaa====') + ); + $this->assertSame( + "\x00\x00\x00", + Encoding::base32Decode('aaaaa===') + ); + $this->assertSame( + "\x00\x00\x00\x00", + Encoding::base32Decode('aaaaaaa=') + ); + $this->assertSame( + "\x00\x00\x00\x00\x00", + Encoding::base32Decode('aaaaaaaa') + ); + $this->assertSame( + "\x00\x00\x0F\xFF\xFF", + Encoding::base32Decode('aaaa7777') + ); + $this->assertSame( + "\xFF\xFF\xF0\x00\x00", + Encoding::base32Decode('7777aaaa') + ); + $this->assertSame( + "\xce\x73\x9c\xe7\x39", + Encoding::base32Decode('zzzzzzzz') + ); + $this->assertSame( + "\xd6\xb5\xad\x6b\x5a", + Encoding::base32Decode('22222222') + ); + $this->assertSame( + 'foobar', + Encoding::base32Decode('mzxw6ytboi======') + ); + + $rand = random_bytes(9); + $enc = Encoding::base32Encode($rand); + + $this->assertSame( + Encoding::base32Encode($rand), + Encoding::base32Encode(Encoding::base32Decode($enc)) + ); + $this->assertSame( + $rand, + Encoding::base32Decode($enc) + ); + } + + /** + * @covers Encoding::hexDecode() + * @covers Encoding::hexEncode() + * @covers Encoding::base32Decode() + * @covers Encoding::base32Encode() + * @covers Encoding::base64Decode() + * @covers Encoding::base64Encode() + * @covers Encoding::base64DotSlashDecode() + * @covers Encoding::base64DotSlashEncode() + * @covers Encoding::base64DotSlashOrderedDecode() + * @covers Encoding::base64DotSlashOrderedEncode() + */ + public function testBasicEncoding() + { + // Re-run the test at least 3 times for each length + for ($j = 0; $j < 3; ++$j) { + for ($i = 1; $i < 84; ++$i) { + $rand = random_bytes($i); + $enc = Encoding::hexEncode($rand); + $this->assertSame( + \bin2hex($rand), + $enc, + "Hex Encoding - Length: " . $i + ); + $this->assertSame( + $rand, + Encoding::hexDecode($enc), + "Hex Encoding - Length: " . $i + ); + + // Uppercase variant: + $enc = Hex::encodeUpper($rand); + $this->assertSame( + \strtoupper(\bin2hex($rand)), + $enc, + "Hex Encoding - Length: " . $i + ); + $this->assertSame( + $rand, + Hex::decode($enc), + "HexUpper Encoding - Length: " . $i + ); + + $enc = Encoding::base32Encode($rand); + $this->assertSame( + $rand, + Encoding::base32Decode($enc), + "Base32 Encoding - Length: " . $i + ); + + $enc = Encoding::base32EncodeUpper($rand); + $this->assertSame( + $rand, + Encoding::base32DecodeUpper($enc), + "Base32Upper Encoding - Length: " . $i + ); + + $enc = Encoding::base32HexEncode($rand); + $this->assertSame( + bin2hex($rand), + bin2hex(Encoding::base32HexDecode($enc)), + "Base32Hex Encoding - Length: " . $i + ); + + $enc = Encoding::base32HexEncodeUpper($rand); + $this->assertSame( + bin2hex($rand), + bin2hex(Encoding::base32HexDecodeUpper($enc)), + "Base32HexUpper Encoding - Length: " . $i + ); + + $enc = Encoding::base64Encode($rand); + $this->assertSame( + $rand, + Encoding::base64Decode($enc), + "Base64 Encoding - Length: " . $i + ); + + $enc = Encoding::base64EncodeDotSlash($rand); + $this->assertSame( + $rand, + Encoding::base64DecodeDotSlash($enc), + "Base64 DotSlash Encoding - Length: " . $i + ); + $enc = Encoding::base64EncodeDotSlashOrdered($rand); + $this->assertSame( + $rand, + Encoding::base64DecodeDotSlashOrdered($enc), + "Base64 Ordered DotSlash Encoding - Length: " . $i + ); + + $enc = Base64UrlSafe::encode($rand); + $this->assertSame( + \strtr(\base64_encode($rand), '+/', '-_'), + $enc + ); + $this->assertSame( + $rand, + Base64UrlSafe::decode($enc) + ); + } + } + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/HexTest.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/HexTest.php new file mode 100755 index 0000000..18fafdb --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/HexTest.php @@ -0,0 +1,39 @@ +assertSame( + $random, + Hex::decode($enc) + ); + $this->assertSame( + \bin2hex($random), + $enc + ); + + $enc = Hex::encodeUpper($random); + $this->assertSame( + $random, + Hex::decode($enc) + ); + $this->assertSame( + \strtoupper(\bin2hex($random)), + $enc + ); + } + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/RFC4648Test.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/RFC4648Test.php new file mode 100755 index 0000000..8dfbb12 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/RFC4648Test.php @@ -0,0 +1,84 @@ +assertSame(Base64::encode(''), ''); + $this->assertSame(Base64::encode('f'), 'Zg=='); + $this->assertSame(Base64::encode('fo'), 'Zm8='); + $this->assertSame(Base64::encode('foo'), 'Zm9v'); + $this->assertSame(Base64::encode('foob'), 'Zm9vYg=='); + $this->assertSame(Base64::encode('fooba'), 'Zm9vYmE='); + $this->assertSame(Base64::encode('foobar'), 'Zm9vYmFy'); + } + + public function testVectorBase32() + { + $this->assertSame(Base32::encode(''), ''); + $this->assertSame(Base32::encode('f'), 'my======'); + $this->assertSame(Base32::encode('fo'), 'mzxq===='); + $this->assertSame(Base32::encode('foo'), 'mzxw6==='); + $this->assertSame(Base32::encode('foob'), 'mzxw6yq='); + $this->assertSame(Base32::encode('fooba'), 'mzxw6ytb'); + $this->assertSame(Base32::encode('foobar'), 'mzxw6ytboi======'); + + $this->assertSame(Base32::encodeUpper(''), ''); + $this->assertSame(Base32::encodeUpper('f'), 'MY======'); + $this->assertSame(Base32::encodeUpper('fo'), 'MZXQ===='); + $this->assertSame(Base32::encodeUpper('foo'), 'MZXW6==='); + $this->assertSame(Base32::encodeUpper('foob'), 'MZXW6YQ='); + $this->assertSame(Base32::encodeUpper('fooba'), 'MZXW6YTB'); + $this->assertSame(Base32::encodeUpper('foobar'), 'MZXW6YTBOI======'); + } + + public function testVectorBase32Hex() + { + $this->assertSame(Base32Hex::encode(''), ''); + $this->assertSame(Base32Hex::encode('f'), 'co======'); + $this->assertSame(Base32Hex::encode('fo'), 'cpng===='); + $this->assertSame(Base32Hex::encode('foo'), 'cpnmu==='); + $this->assertSame(Base32Hex::encode('foob'), 'cpnmuog='); + $this->assertSame(Base32Hex::encode('fooba'), 'cpnmuoj1'); + $this->assertSame(Base32Hex::encode('foobar'), 'cpnmuoj1e8======'); + + $this->assertSame(Base32Hex::encodeUpper(''), ''); + $this->assertSame(Base32Hex::encodeUpper('f'), 'CO======'); + $this->assertSame(Base32Hex::encodeUpper('fo'), 'CPNG===='); + $this->assertSame(Base32Hex::encodeUpper('foo'), 'CPNMU==='); + $this->assertSame(Base32Hex::encodeUpper('foob'), 'CPNMUOG='); + $this->assertSame(Base32Hex::encodeUpper('fooba'), 'CPNMUOJ1'); + $this->assertSame(Base32Hex::encodeUpper('foobar'), 'CPNMUOJ1E8======'); + } + + public function testVectorBase16() + { + $this->assertSame(Hex::encode(''), ''); + $this->assertSame(Hex::encode('f'), '66'); + $this->assertSame(Hex::encode('fo'), '666f'); + $this->assertSame(Hex::encode('foo'), '666f6f'); + $this->assertSame(Hex::encode('foob'), '666f6f62'); + $this->assertSame(Hex::encode('fooba'), '666f6f6261'); + $this->assertSame(Hex::encode('foobar'), '666f6f626172'); + + $this->assertSame(Hex::encodeUpper(''), ''); + $this->assertSame(Hex::encodeUpper('f'), '66'); + $this->assertSame(Hex::encodeUpper('fo'), '666F'); + $this->assertSame(Hex::encodeUpper('foo'), '666F6F'); + $this->assertSame(Hex::encodeUpper('foob'), '666F6F62'); + $this->assertSame(Hex::encodeUpper('fooba'), '666F6F6261'); + $this->assertSame(Hex::encodeUpper('foobar'), '666F6F626172'); + } +} diff --git a/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/autoload.php b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/autoload.php new file mode 100755 index 0000000..fe67835 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/constant_time_encoding/tests/autoload.php @@ -0,0 +1,10 @@ +=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "autoload": { + "files": [ + "lib/random.php" + ] + } +} diff --git a/phpMyAdmin/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey b/phpMyAdmin/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey new file mode 100755 index 0000000..eb50ebf --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey @@ -0,0 +1,5 @@ +-----BEGIN PUBLIC KEY----- +MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEEd+wCqJDrx5B4OldM0dQE0ZMX+lx1ZWm +pui0SUqD4G29L3NGsz9UhJ/0HjBdbnkhIK5xviT0X5vtjacF6ajgcCArbTB+ds+p ++h7Q084NuSuIpNb6YPfoUFgC/CL9kAoc +-----END PUBLIC KEY----- diff --git a/phpMyAdmin/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc b/phpMyAdmin/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc new file mode 100755 index 0000000..6a1d7f3 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/dist/random_compat.phar.pubkey.asc @@ -0,0 +1,11 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.22 (MingW32) + +iQEcBAABAgAGBQJWtW1hAAoJEGuXocKCZATaJf0H+wbZGgskK1dcRTsuVJl9IWip +QwGw/qIKI280SD6/ckoUMxKDCJiFuPR14zmqnS36k7N5UNPnpdTJTS8T11jttSpg +1LCmgpbEIpgaTah+cELDqFCav99fS+bEiAL5lWDAHBTE/XPjGVCqeehyPYref4IW +NDBIEsvnHPHPLsn6X5jq4+Yj5oUixgxaMPiR+bcO4Sh+RzOVB6i2D0upWfRXBFXA +NNnsg9/zjvoC7ZW73y9uSH+dPJTt/Vgfeiv52/v41XliyzbUyLalf02GNPY+9goV +JHG1ulEEBJOCiUD9cE1PUIJwHA/HqyhHIvV350YoEFiHl8iSwm7SiZu5kPjaq74= +=B6+8 +-----END PGP SIGNATURE----- diff --git a/phpMyAdmin/vendor/paragonie/random_compat/lib/byte_safe_strings.php b/phpMyAdmin/vendor/paragonie/random_compat/lib/byte_safe_strings.php new file mode 100755 index 0000000..ef24488 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/lib/byte_safe_strings.php @@ -0,0 +1,195 @@ + RandomCompat_strlen($binary_string)) { + return ''; + } + + return (string) mb_substr( + (string) $binary_string, + (int) $start, + (int) $length, + '8bit' + ); + } + + } else { + + /** + * substr() implementation that isn't brittle to mbstring.func_overload + * + * This version just uses the default substr() + * + * @param string $binary_string + * @param int $start + * @param int|null $length (optional) + * + * @throws TypeError + * + * @return string + */ + function RandomCompat_substr($binary_string, $start, $length = null) + { + if (!is_string($binary_string)) { + throw new TypeError( + 'RandomCompat_substr(): First argument should be a string' + ); + } + + if (!is_int($start)) { + throw new TypeError( + 'RandomCompat_substr(): Second argument should be an integer' + ); + } + + if ($length !== null) { + if (!is_int($length)) { + throw new TypeError( + 'RandomCompat_substr(): Third argument should be an integer, or omitted' + ); + } + + return (string) substr( + (string )$binary_string, + (int) $start, + (int) $length + ); + } + + return (string) substr( + (string) $binary_string, + (int) $start + ); + } + } +} diff --git a/phpMyAdmin/vendor/paragonie/random_compat/lib/cast_to_int.php b/phpMyAdmin/vendor/paragonie/random_compat/lib/cast_to_int.php new file mode 100755 index 0000000..1b1bbfe --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/lib/cast_to_int.php @@ -0,0 +1,77 @@ + operators might accidentally let a float + * through. + * + * @param int|float $number The number we want to convert to an int + * @param bool $fail_open Set to true to not throw an exception + * + * @return float|int + * @psalm-suppress InvalidReturnType + * + * @throws TypeError + */ + function RandomCompat_intval($number, $fail_open = false) + { + if (is_int($number) || is_float($number)) { + $number += 0; + } elseif (is_numeric($number)) { + /** @psalm-suppress InvalidOperand */ + $number += 0; + } + /** @var int|float $number */ + + if ( + is_float($number) + && + $number > ~PHP_INT_MAX + && + $number < PHP_INT_MAX + ) { + $number = (int) $number; + } + + if (is_int($number)) { + return (int) $number; + } elseif (!$fail_open) { + throw new TypeError( + 'Expected an integer.' + ); + } + return $number; + } +} diff --git a/phpMyAdmin/vendor/paragonie/random_compat/lib/error_polyfill.php b/phpMyAdmin/vendor/paragonie/random_compat/lib/error_polyfill.php new file mode 100755 index 0000000..c02c5c8 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/lib/error_polyfill.php @@ -0,0 +1,49 @@ += 70000) { + return; +} + +if (!defined('RANDOM_COMPAT_READ_BUFFER')) { + define('RANDOM_COMPAT_READ_BUFFER', 8); +} + +$RandomCompatDIR = dirname(__FILE__); + +require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'byte_safe_strings.php'; +require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'cast_to_int.php'; +require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'error_polyfill.php'; + +if (!is_callable('random_bytes')) { + /** + * PHP 5.2.0 - 5.6.x way to implement random_bytes() + * + * We use conditional statements here to define the function in accordance + * to the operating environment. It's a micro-optimization. + * + * In order of preference: + * 1. Use libsodium if available. + * 2. fread() /dev/urandom if available (never on Windows) + * 3. mcrypt_create_iv($bytes, MCRYPT_DEV_URANDOM) + * 4. COM('CAPICOM.Utilities.1')->GetRandom() + * + * See RATIONALE.md for our reasoning behind this particular order + */ + if (extension_loaded('libsodium')) { + // See random_bytes_libsodium.php + if (PHP_VERSION_ID >= 50300 && is_callable('\\Sodium\\randombytes_buf')) { + require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_libsodium.php'; + } elseif (method_exists('Sodium', 'randombytes_buf')) { + require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_libsodium_legacy.php'; + } + } + + /** + * Reading directly from /dev/urandom: + */ + if (DIRECTORY_SEPARATOR === '/') { + // DIRECTORY_SEPARATOR === '/' on Unix-like OSes -- this is a fast + // way to exclude Windows. + $RandomCompatUrandom = true; + $RandomCompat_basedir = ini_get('open_basedir'); + + if (!empty($RandomCompat_basedir)) { + $RandomCompat_open_basedir = explode( + PATH_SEPARATOR, + strtolower($RandomCompat_basedir) + ); + $RandomCompatUrandom = (array() !== array_intersect( + array('/dev', '/dev/', '/dev/urandom'), + $RandomCompat_open_basedir + )); + $RandomCompat_open_basedir = null; + } + + if ( + !is_callable('random_bytes') + && + $RandomCompatUrandom + && + @is_readable('/dev/urandom') + ) { + // Error suppression on is_readable() in case of an open_basedir + // or safe_mode failure. All we care about is whether or not we + // can read it at this point. If the PHP environment is going to + // panic over trying to see if the file can be read in the first + // place, that is not helpful to us here. + + // See random_bytes_dev_urandom.php + require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_dev_urandom.php'; + } + // Unset variables after use + $RandomCompat_basedir = null; + } else { + $RandomCompatUrandom = false; + } + + /** + * mcrypt_create_iv() + * + * We only want to use mcypt_create_iv() if: + * + * - random_bytes() hasn't already been defined + * - the mcrypt extensions is loaded + * - One of these two conditions is true: + * - We're on Windows (DIRECTORY_SEPARATOR !== '/') + * - We're not on Windows and /dev/urandom is readabale + * (i.e. we're not in a chroot jail) + * - Special case: + * - If we're not on Windows, but the PHP version is between + * 5.6.10 and 5.6.12, we don't want to use mcrypt. It will + * hang indefinitely. This is bad. + * - If we're on Windows, we want to use PHP >= 5.3.7 or else + * we get insufficient entropy errors. + */ + if ( + !is_callable('random_bytes') + && + // Windows on PHP < 5.3.7 is broken, but non-Windows is not known to be. + (DIRECTORY_SEPARATOR === '/' || PHP_VERSION_ID >= 50307) + && + // Prevent this code from hanging indefinitely on non-Windows; + // see https://bugs.php.net/bug.php?id=69833 + ( + DIRECTORY_SEPARATOR !== '/' || + (PHP_VERSION_ID <= 50609 || PHP_VERSION_ID >= 50613) + ) + && + extension_loaded('mcrypt') + ) { + // See random_bytes_mcrypt.php + require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_mcrypt.php'; + } + $RandomCompatUrandom = null; + + /** + * This is a Windows-specific fallback, for when the mcrypt extension + * isn't loaded. + */ + if ( + !is_callable('random_bytes') + && + extension_loaded('com_dotnet') + && + class_exists('COM') + ) { + $RandomCompat_disabled_classes = preg_split( + '#\s*,\s*#', + strtolower(ini_get('disable_classes')) + ); + + if (!in_array('com', $RandomCompat_disabled_classes)) { + try { + $RandomCompatCOMtest = new COM('CAPICOM.Utilities.1'); + /** @psalm-suppress TypeDoesNotContainType */ + if (is_callable(array($RandomCompatCOMtest, 'GetRandom'))) { + // See random_bytes_com_dotnet.php + require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_bytes_com_dotnet.php'; + } + } catch (com_exception $e) { + // Don't try to use it. + } + } + $RandomCompat_disabled_classes = null; + $RandomCompatCOMtest = null; + } + + /** + * throw new Exception + */ + if (!is_callable('random_bytes')) { + /** + * We don't have any more options, so let's throw an exception right now + * and hope the developer won't let it fail silently. + * + * @param mixed $length + * @psalm-suppress InvalidReturnType + * @throws Exception + * @return string + */ + function random_bytes($length) + { + unset($length); // Suppress "variable not used" warnings. + throw new Exception( + 'There is no suitable CSPRNG installed on your system' + ); + return ''; + } + } +} + +if (!is_callable('random_int')) { + require_once $RandomCompatDIR.DIRECTORY_SEPARATOR.'random_int.php'; +} + +$RandomCompatDIR = null; diff --git a/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php new file mode 100755 index 0000000..537d02b --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_com_dotnet.php @@ -0,0 +1,91 @@ +GetRandom($bytes, 0)); + if (RandomCompat_strlen($buf) >= $bytes) { + /** + * Return our random entropy buffer here: + */ + return (string) RandomCompat_substr($buf, 0, $bytes); + } + ++$execCount; + } while ($execCount < $bytes); + + /** + * If we reach here, PHP has failed us. + */ + throw new Exception( + 'Could not gather sufficient random data' + ); + } +} diff --git a/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_dev_urandom.php b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_dev_urandom.php new file mode 100755 index 0000000..c4e31cc --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_dev_urandom.php @@ -0,0 +1,190 @@ + $st */ + $st = fstat($fp); + if (($st['mode'] & 0170000) !== 020000) { + fclose($fp); + $fp = false; + } + } + } + + if (is_resource($fp)) { + /** + * stream_set_read_buffer() does not exist in HHVM + * + * If we don't set the stream's read buffer to 0, PHP will + * internally buffer 8192 bytes, which can waste entropy + * + * stream_set_read_buffer returns 0 on success + */ + if (is_callable('stream_set_read_buffer')) { + stream_set_read_buffer($fp, RANDOM_COMPAT_READ_BUFFER); + } + if (is_callable('stream_set_chunk_size')) { + stream_set_chunk_size($fp, RANDOM_COMPAT_READ_BUFFER); + } + } + } + + try { + /** @var int $bytes */ + $bytes = RandomCompat_intval($bytes); + } catch (TypeError $ex) { + throw new TypeError( + 'random_bytes(): $bytes must be an integer' + ); + } + + if ($bytes < 1) { + throw new Error( + 'Length must be greater than 0' + ); + } + + /** + * This if() block only runs if we managed to open a file handle + * + * It does not belong in an else {} block, because the above + * if (empty($fp)) line is logic that should only be run once per + * page load. + */ + if (is_resource($fp)) { + /** + * @var int + */ + $remaining = $bytes; + + /** + * @var string|bool + */ + $buf = ''; + + /** + * We use fread() in a loop to protect against partial reads + */ + do { + /** + * @var string|bool + */ + $read = fread($fp, $remaining); + if (!is_string($read)) { + /** + * We cannot safely read from the file. Exit the + * do-while loop and trigger the exception condition + * + * @var string|bool + */ + $buf = false; + break; + } + /** + * Decrease the number of bytes returned from remaining + */ + $remaining -= RandomCompat_strlen($read); + /** + * @var string $buf + */ + $buf .= $read; + } while ($remaining > 0); + + /** + * Is our result valid? + * @var string|bool $buf + */ + if (is_string($buf)) { + if (RandomCompat_strlen($buf) === $bytes) { + /** + * Return our random entropy buffer here: + */ + return $buf; + } + } + } + + /** + * If we reach here, PHP has failed us. + */ + throw new Exception( + 'Error reading from source device' + ); + } +} diff --git a/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_libsodium.php b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_libsodium.php new file mode 100755 index 0000000..2e56290 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_libsodium.php @@ -0,0 +1,91 @@ + 2147483647) { + $buf = ''; + for ($i = 0; $i < $bytes; $i += 1073741824) { + $n = ($bytes - $i) > 1073741824 + ? 1073741824 + : $bytes - $i; + $buf .= \Sodium\randombytes_buf($n); + } + } else { + /** @var string|bool $buf */ + $buf = \Sodium\randombytes_buf($bytes); + } + + if (is_string($buf)) { + if (RandomCompat_strlen($buf) === $bytes) { + return $buf; + } + } + + /** + * If we reach here, PHP has failed us. + */ + throw new Exception( + 'Could not gather sufficient random data' + ); + } +} diff --git a/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php new file mode 100755 index 0000000..f78b219 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_libsodium_legacy.php @@ -0,0 +1,93 @@ + 2147483647) { + for ($i = 0; $i < $bytes; $i += 1073741824) { + $n = ($bytes - $i) > 1073741824 + ? 1073741824 + : $bytes - $i; + $buf .= Sodium::randombytes_buf((int) $n); + } + } else { + $buf .= Sodium::randombytes_buf((int) $bytes); + } + + if (is_string($buf)) { + if (RandomCompat_strlen($buf) === $bytes) { + return $buf; + } + } + + /** + * If we reach here, PHP has failed us. + */ + throw new Exception( + 'Could not gather sufficient random data' + ); + } +} diff --git a/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php new file mode 100755 index 0000000..0b13fa7 --- /dev/null +++ b/phpMyAdmin/vendor/paragonie/random_compat/lib/random_bytes_mcrypt.php @@ -0,0 +1,79 @@ + operators might accidentally let a float + * through. + */ + + try { + /** @var int $min */ + $min = RandomCompat_intval($min); + } catch (TypeError $ex) { + throw new TypeError( + 'random_int(): $min must be an integer' + ); + } + + try { + /** @var int $max */ + $max = RandomCompat_intval($max); + } catch (TypeError $ex) { + throw new TypeError( + 'random_int(): $max must be an integer' + ); + } + + /** + * Now that we've verified our weak typing system has given us an integer, + * let's validate the logic then we can move forward with generating random + * integers along a given range. + */ + if ($min > $max) { + throw new Error( + 'Minimum value must be less than or equal to the maximum value' + ); + } + + if ($max === $min) { + return (int) $min; + } + + /** + * Initialize variables to 0 + * + * We want to store: + * $bytes => the number of random bytes we need + * $mask => an integer bitmask (for use with the &) operator + * so we can minimize the number of discards + */ + $attempts = $bits = $bytes = $mask = $valueShift = 0; + /** @var int $attempts */ + /** @var int $bits */ + /** @var int $bytes */ + /** @var int $mask */ + /** @var int $valueShift */ + + /** + * At this point, $range is a positive number greater than 0. It might + * overflow, however, if $max - $min > PHP_INT_MAX. PHP will cast it to + * a float and we will lose some precision. + * + * @var int|float $range + */ + $range = $max - $min; + + /** + * Test for integer overflow: + */ + if (!is_int($range)) { + + /** + * Still safely calculate wider ranges. + * Provided by @CodesInChaos, @oittaa + * + * @ref https://gist.github.com/CodesInChaos/03f9ea0b58e8b2b8d435 + * + * We use ~0 as a mask in this case because it generates all 1s + * + * @ref https://eval.in/400356 (32-bit) + * @ref http://3v4l.org/XX9r5 (64-bit) + */ + $bytes = PHP_INT_SIZE; + /** @var int $mask */ + $mask = ~0; + + } else { + + /** + * $bits is effectively ceil(log($range, 2)) without dealing with + * type juggling + */ + while ($range > 0) { + if ($bits % 8 === 0) { + ++$bytes; + } + ++$bits; + $range >>= 1; + /** @var int $mask */ + $mask = $mask << 1 | 1; + } + $valueShift = $min; + } + + /** @var int $val */ + $val = 0; + /** + * Now that we have our parameters set up, let's begin generating + * random integers until one falls between $min and $max + */ + /** @psalm-suppress RedundantCondition */ + do { + /** + * The rejection probability is at most 0.5, so this corresponds + * to a failure probability of 2^-128 for a working RNG + */ + if ($attempts > 128) { + throw new Exception( + 'random_int: RNG is broken - too many rejections' + ); + } + + /** + * Let's grab the necessary number of random bytes + */ + $randomByteString = random_bytes($bytes); + + /** + * Let's turn $randomByteString into an integer + * + * This uses bitwise operators (<< and |) to build an integer + * out of the values extracted from ord() + * + * Example: [9F] | [6D] | [32] | [0C] => + * 159 + 27904 + 3276800 + 201326592 => + * 204631455 + */ + $val &= 0; + for ($i = 0; $i < $bytes; ++$i) { + $val |= ord($randomByteString[$i]) << ($i * 8); + } + /** @var int $val */ + + /** + * Apply mask + */ + $val &= $mask; + $val += $valueShift; + + ++$attempts; + /** + * If $val overflows to a floating point number, + * ... or is larger than $max, + * ... or smaller than $min, + * then try again. + */ + } while (!is_int($val) || $val > $max || $val < $min); + + return (int) $val; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/.github/stale.yml b/phpMyAdmin/vendor/phpmyadmin/motranslator/.github/stale.yml new file mode 100755 index 0000000..8ed0f30 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/.github/stale.yml @@ -0,0 +1,23 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 60 +# Number of days of inactivity before a stale Issue or Pull Request is closed +daysUntilClose: 7 +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: + - pinned + - security +# Label to use when marking as stale +staleLabel: wontfix +# Comment to post when marking as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your contributions. +# Comment to post when removing the stale label. Set to `false` to disable +unmarkComment: false +# Comment to post when closing a stale Issue or Pull Request. Set to `false` to disable +closeComment: false +# Limit to only `issues` or `pulls` +only: pulls diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/CHANGES.md b/phpMyAdmin/vendor/phpmyadmin/motranslator/CHANGES.md new file mode 100755 index 0000000..6a8a1c7 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/CHANGES.md @@ -0,0 +1,86 @@ +# Version 4.0 + +* Released on 2018-02-12. +* The library no longer changes system locales. + +# Version 3.4 + +* Released on 2017-12-15. +* Added Translator::setTranslation method. + +# Version 3.3 + +* Released on 2017-06-01. +* Add support for switching locales for Loader instance. + +# Version 3.2 + +* Released on 2017-05-23. +* Various fixes when handling corrupted mo files. + +# Version 3.1 + +* Released on 2017-05-15. +* Documentation improvements. + +# Version 3.0 + +* Released on 2017-01-23. +* All classes moved to the PhpMyAdmin namespace. + +# Version 2.2 + +* Released on 2017-01-07. +* Coding style cleanup. +* Avoid installing tests using composer. + +# Version 2.1 + +* Released on 2016-12-21. +* Various code cleanups. +* Added support for PHP 5.3. + +# Version 2.0 + +* Released on 2016-10-13. +* Consistently use camelCase in API. +* No more relies on using eval(). +* Depends on symfony/expression-language for calculations. + +# Version 1.2 + +* Released on 2016-09-22. +* Stricter validation of plural expression. + +# Version 1.1 + +* Released on 2016-08-29. +* Improved handling of corrupted mo files. +* Minor performance improvements. +* Stricter validation of plural expression. + +# Version 1.0 + +* Released on 2016-04-27. +* Documentation improvements. +* Testsuite improvements. + +# Version 0.4 + +* Released on 2016-03-02. +* Fixed test failures with hhvm due to broken putenv. + +# Version 0.3 + +* Released on 2016-03-01. +* Added Loader::detectlocale method. + +# Version 0.2 + +* Released on 2016-02-24. +* Marked PHP 5.4 and 5.5 as supported. + +# Version 0.1 + +* Released on 2016-02-23. +* Initial release. diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/CONTRIBUTING.md b/phpMyAdmin/vendor/phpmyadmin/motranslator/CONTRIBUTING.md new file mode 100755 index 0000000..e211ff2 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/CONTRIBUTING.md @@ -0,0 +1,42 @@ +# Contributing to motranslator + +## Reporting issues + +Our issue tracker is hosted at GitHub: + +https://github.com/phpmyadmin/motranslator/issues + +Please search for existing issues before reporting new ones. + +## Working with Git checkout + +The dependencies are managed by Composer, to get them all installed (or update +on consequent runs) do: + +``` +composer update +``` + +## Submitting patches + +Please submit your patches using GitHub pull requests, this allows us to review +them and to run automated tests on the code. + +## Coding standards + +We do follow PSR-1 and PSR-2 coding standards. + +You can use php-cs-fixer to fix the code to match our expectations: + +``` +php-cs-fixer fix . +``` + +## Testsuite + +Our code comes with quite comprehensive testsuite, it is automatically executed +on every commit and pull request, you can also run it locally: + +``` +./vendor/bin/phpunit -c phpunit.xml +``` diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/LICENSE b/phpMyAdmin/vendor/phpmyadmin/motranslator/LICENSE new file mode 100755 index 0000000..23cb790 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/PERFORMANCE.md b/phpMyAdmin/vendor/phpmyadmin/motranslator/PERFORMANCE.md new file mode 100755 index 0000000..334c5b7 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/PERFORMANCE.md @@ -0,0 +1,28 @@ +# Performance + +This library was tweaked for best performance for single use - translating +application with many strings using mo file. Current benchmarks show it's about +four times faster than original php-gettext. + +There are two benchmark scripts in the code: + +* ``benchmark-context.php`` - benchmarks context usage +* ``benchmark-plural.php`` - benchmarks plural evaluation +* ``benchmark.php`` - benchmarks file parsing + +## Performance measurements + +The performance improvements based on individual changes in the code: + +| Stage | Seconds | +| -------------- | --------------- | +| Original code | 4.7929680347443 | +| Remove nocache | 4.6308250427246 | +| Direct endian | 4.5883052349091 | +| Remove attribs | 4.5297479629517 | +| String reader | 1.8148958683014 | +| No offset | 1.2436759471893 | +| Less attribs | 1.1722540855408 | +| Remove shift | 1.0970499515533 | +| Magic order | 1.0868430137634 | + diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/README.md b/phpMyAdmin/vendor/phpmyadmin/motranslator/README.md new file mode 100755 index 0000000..470df2d --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/README.md @@ -0,0 +1,147 @@ +# motranslator + +Translation API for PHP using Gettext MO files. + +[![Build Status](https://travis-ci.org/phpmyadmin/motranslator.svg?branch=master)](https://travis-ci.org/phpmyadmin/motranslator) +[![codecov.io](https://codecov.io/github/phpmyadmin/motranslator/coverage.svg?branch=master)](https://codecov.io/github/phpmyadmin/motranslator?branch=master) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phpmyadmin/motranslator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phpmyadmin/motranslator/?branch=master) +[![Packagist](https://img.shields.io/packagist/dt/phpmyadmin/motranslator.svg)](https://packagist.org/packages/phpmyadmin/motranslator) + +## Features + +* All strings are stored in memory for fast lookup +* Fast loading of MO files +* Low level API for reading MO files +* Emulation of Gettext API +* No use of `eval()` for plural equation + +## Limitations + +* Not suitable for huge MO files which you don't want to store in memory +* Input and output encoding has to match (preferably UTF-8) + +## Installation + +Please use [Composer][1] to install: + +``` +composer require phpmyadmin/motranslator +``` + +## Documentation + +The API documentation is available at +. + + +## Object API usage + +```php +// Create loader object +$loader = new PhpMyAdmin\MoTranslator\Loader(); + +// Set locale +$loader->setlocale('cs'); + +// Set default text domain +$loader->textdomain('domain'); + +// Set path where to look for a domain +$loader->bindtextdomain('domain', __DIR__ . '/data/locale/'); + +// Get translator +$translator = $loader->getTranslator(); + +// Now you can use Translator API (see below) +``` + +## Low level API usage + +```php +// Directly load the mo file +$translator = new PhpMyAdmin\MoTranslator\Translator('./path/to/file.mo'); + +// Now you can use Translator API (see below) +``` + +## Translator API usage + +```php +// Translate string +echo $translator->gettext('String'); + +// Translate plural string +echo $translator->ngettext('String', 'Plural string', $count); + +// Translate string with context +echo $translator->pgettext('Context', 'String'); + +// Translate plural string with context +echo $translator->npgettext('Context', 'String', 'Plural string', $count); +``` + +## Gettext compatibility usage + +```php +// Load compatibility layer +PhpMyAdmin\MoTranslator\Loader::loadFunctions(); + +// Configure +_setlocale(LC_MESSAGES, 'cs'); +_textdomain('phpmyadmin'); +_bindtextdomain('phpmyadmin', __DIR__ . '/data/locale/'); +_bind_textdomain_codeset('phpmyadmin', 'UTF-8'); + +// Use functions +echo _gettext('Type'); +echo __('Type'); + +// It also support other Gettext functions +_dnpgettext($domain, $msgctxt, $msgid, $msgidPlural, $number); +_dngettext($domain, $msgid, $msgidPlural, $number); +_npgettext($msgctxt, $msgid, $msgidPlural, $number); +_ngettext($msgid, $msgidPlural, $number); +_dpgettext($domain, $msgctxt, $msgid); +_dgettext($domain, $msgid); +_pgettext($msgctxt, $msgid); +``` + +## History + +This library is based on [php-gettext][2]. It adds some performance +improvements and ability to install using [Composer][1]. + +## Motivation + +Motivation for this library includes: + +* The [php-gettext][2] library is not maintained anymore +* It doesn't work with recent PHP version (phpMyAdmin has patched version) +* It relies on `eval()` function for plural equations what can have severe security implications, see CVE-2016-6175 +* It's not possible to install it using [Composer][1] +* There was place for performance improvements in the library + +### Why not to use native gettext in PHP? + +We've tried that, but it's not a viable solution: + +* You can not use locales not known to system, what is something you can not + control from web application. This gets even more tricky with minimalist + virtualisation containers. +* Changing the MO file usually leads to PHP segmentation fault. It (or rather + Gettext library) caches headers of MO file and if it's content is changed + (for example new version is uploaded to server) it tries to access new data + with old references. This is bug known for ages: + https://bugs.php.net/bug.php?id=45943 + +### Why use Gettext and not JSON, YAML or whatever? + +We want translators to be able to use their favorite tools and we want us to be +able to use wide range of tools available with Gettext as well such as +[web based translation using Weblate][3]. Using custom format usually adds +another barrier for translators and we want to make it easy for them to +contribute. + +[1]:https://getcomposer.org/ +[2]:https://launchpad.net/php-gettext +[3]:https://weblate.org/ diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/codecov.yml b/phpMyAdmin/vendor/phpmyadmin/motranslator/codecov.yml new file mode 100755 index 0000000..99d09da --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/codecov.yml @@ -0,0 +1,3 @@ +comment: + layout: header, changes, diff +coverage: {} diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/composer.json b/phpMyAdmin/vendor/phpmyadmin/motranslator/composer.json new file mode 100755 index 0000000..f7726f8 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/composer.json @@ -0,0 +1,37 @@ +{ + "name": "phpmyadmin/motranslator", + "description": "Translation API for PHP using Gettext MO files", + "license": "GPL-2.0-or-later", + "keywords": ["gettext", "mo", "translator", "i18n"], + "homepage": "https://github.com/phpmyadmin/motranslator", + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "support": { + "issues": "https://github.com/phpmyadmin/motranslator/issues", + "source": "https://github.com/phpmyadmin/motranslator" + }, + "require": { + "php": ">=5.3.0", + "symfony/expression-language": "^4.0 || ^3.2 || ^2.8" + }, + "require-dev": { + "apigen/apigen": "^4.1", + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5" + }, + "autoload": { + "psr-4": { + "PhpMyAdmin\\MoTranslator\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "PhpMyAdmin\\MoTranslator\\Tests\\": "tests" + } + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/phpunit.xml b/phpMyAdmin/vendor/phpmyadmin/motranslator/phpunit.xml new file mode 100755 index 0000000..85c5abd --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/phpunit.xml @@ -0,0 +1,32 @@ + + + + + + + + ./tests + + + + + src/ + + + + + + + + diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/src/Loader.php b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/Loader.php new file mode 100755 index 0000000..e32d7c4 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/Loader.php @@ -0,0 +1,247 @@ + + Copyright (c) 2009 Danilo Segan + Copyright (c) 2016 Michal 膶iha艡 + + This file is part of MoTranslator. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +namespace PhpMyAdmin\MoTranslator; + +class Loader +{ + /** + * Loader instance. + * + * @static + * + * @var Loader + */ + private static $_instance; + + /** + * Default gettext domain to use. + * + * @var string + */ + private $default_domain = ''; + + /** + * Configured locale. + * + * @var string + */ + private $locale = ''; + + /** + * Loaded domains. + * + * @var array + */ + private $domains = array(); + + /** + * Bound paths for domains. + * + * @var array + */ + private $paths = array('' => './'); + + /** + * Returns the singleton Loader object. + * + * @return Loader object + */ + public static function getInstance() + { + if (empty(self::$_instance)) { + self::$_instance = new self(); + } + + return self::$_instance; + } + + /** + * Loads global localizaton functions. + */ + public static function loadFunctions() + { + require_once __DIR__ . '/functions.php'; + } + + /** + * Figure out all possible locale names and start with the most + * specific ones. I.e. for sr_CS.UTF-8@latin, look through all of + * sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr. + * + * @param string $locale Locale code + * + * @return array list of locales to try for any POSIX-style locale specification + */ + public static function listLocales($locale) + { + $locale_names = array(); + + $lang = null; + $country = null; + $charset = null; + $modifier = null; + + if ($locale) { + if (preg_match('/^(?P[a-z]{2,3})' // language code + . '(?:_(?P[A-Z]{2}))?' // country code + . '(?:\\.(?P[-A-Za-z0-9_]+))?' // charset + . '(?:@(?P[-A-Za-z0-9_]+))?$/', // @ modifier + $locale, $matches)) { + extract($matches); + + if ($modifier) { + if ($country) { + if ($charset) { + array_push($locale_names, "${lang}_$country.$charset@$modifier"); + } + array_push($locale_names, "${lang}_$country@$modifier"); + } elseif ($charset) { + array_push($locale_names, "${lang}.$charset@$modifier"); + } + array_push($locale_names, "$lang@$modifier"); + } + if ($country) { + if ($charset) { + array_push($locale_names, "${lang}_$country.$charset"); + } + array_push($locale_names, "${lang}_$country"); + } elseif ($charset) { + array_push($locale_names, "${lang}.$charset"); + } + array_push($locale_names, $lang); + } + + // If the locale name doesn't match POSIX style, just include it as-is. + if (!in_array($locale, $locale_names)) { + array_push($locale_names, $locale); + } + } + + return $locale_names; + } + + /** + * Returns Translator object for domain or for default domain. + * + * @param string $domain Translation domain + * + * @return Translator + */ + public function getTranslator($domain = '') + { + if (empty($domain)) { + $domain = $this->default_domain; + } + + if (!isset($this->domains[$this->locale])) { + $this->domains[$this->locale] = array(); + } + + if (!isset($this->domains[$this->locale][$domain])) { + if (isset($this->paths[$domain])) { + $base = $this->paths[$domain]; + } else { + $base = './'; + } + + $locale_names = $this->listLocales($this->locale); + + $filename = ''; + foreach ($locale_names as $locale) { + $filename = "$base/$locale/LC_MESSAGES/$domain.mo"; + if (file_exists($filename)) { + break; + } + } + + // We don't care about invalid path, we will get fallback + // translator here + $this->domains[$this->locale][$domain] = new Translator($filename); + } + + return $this->domains[$this->locale][$domain]; + } + + /** + * Sets the path for a domain. + * + * @param string $domain Domain name + * @param string $path Path where to find locales + */ + public function bindtextdomain($domain, $path) + { + $this->paths[$domain] = $path; + } + + /** + * Sets the default domain. + * + * @param string $domain Domain name + */ + public function textdomain($domain) + { + $this->default_domain = $domain; + } + + /** + * Sets a requested locale. + * + * @param string $locale Locale name + * + * @return string Set or current locale + */ + public function setlocale($locale) + { + if (!empty($locale)) { + $this->locale = $locale; + } + + return $this->locale; + } + + /** + * Detects currently configured locale. + * + * It checks: + * + * - global lang variable + * - environment for LC_ALL, LC_MESSAGES and LANG + * + * @return string with locale name + */ + public function detectlocale() + { + if (isset($GLOBALS['lang'])) { + return $GLOBALS['lang']; + } elseif (getenv('LC_ALL')) { + return getenv('LC_ALL'); + } elseif (getenv('LC_MESSAGES')) { + return getenv('LC_MESSAGES'); + } elseif (getenv('LANG')) { + return getenv('LANG'); + } + + return 'en'; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/src/ReaderException.php b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/ReaderException.php new file mode 100755 index 0000000..e2b18bc --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/ReaderException.php @@ -0,0 +1,30 @@ +. + Copyright (c) 2016 Michal 膶iha艡 + + This file is part of MoTranslator. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +namespace PhpMyAdmin\MoTranslator; + +/** + * Exception thrown when file can not be read. + */ +class ReaderException extends \Exception +{ +} diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/src/StringReader.php b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/StringReader.php new file mode 100755 index 0000000..06d1916 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/StringReader.php @@ -0,0 +1,97 @@ +. + Copyright (c) 2016 Michal 膶iha艡 + + This file is part of MoTranslator. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +namespace PhpMyAdmin\MoTranslator; + +/** + * Simple wrapper around string buffer for + * random access and values parsing. + */ +class StringReader +{ + private $_str; + private $_len; + + /** + * Constructor. + * + * @param string $filename Name of file to load + */ + public function __construct($filename) + { + $this->_str = file_get_contents($filename); + $this->_len = strlen($this->_str); + } + + /** + * Read number of bytes from given offset. + * + * @param int $pos Offset + * @param int $bytes Number of bytes to read + * + * @return string + */ + public function read($pos, $bytes) + { + if ($pos + $bytes > $this->_len) { + throw new ReaderException('Not enough bytes!'); + } + + return substr($this->_str, $pos, $bytes); + } + + /** + * Reads a 32bit integer from the stream. + * + * @param string $unpack Unpack string + * @param int $pos Position + * + * @return int Ingerer from the stream + */ + public function readint($unpack, $pos) + { + $data = unpack($unpack, $this->read($pos, 4)); + $result = $data[1]; + + /* We're reading unsigned int, but PHP will happily + * give us negative number on 32-bit platforms. + * + * See also documentation: + * https://secure.php.net/manual/en/function.unpack.php#refsect1-function.unpack-notes + */ + return $result < 0 ? PHP_INT_MAX : $result; + } + + /** + * Reads an array of integers from the stream. + * + * @param string $unpack Unpack string + * @param int $pos Position + * @param int $count How many elements should be read + * + * @return array Array of Integers + */ + public function readintarray($unpack, $pos, $count) + { + return unpack($unpack . $count, $this->read($pos, 4 * $count)); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/src/Translator.php b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/Translator.php new file mode 100755 index 0000000..53a66a6 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/Translator.php @@ -0,0 +1,375 @@ +. + Copyright (c) 2005 Nico Kaiser + Copyright (c) 2016 Michal 膶iha艡 + + This file is part of MoTranslator. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +namespace PhpMyAdmin\MoTranslator; + +use Symfony\Component\ExpressionLanguage\ExpressionLanguage; + +/** + * Provides a simple gettext replacement that works independently from + * the system's gettext abilities. + * It can read MO files and use them for translating strings. + * + * It caches ll strings and translations to speed up the string lookup. + */ +class Translator +{ + /** + * None error. + */ + const ERROR_NONE = 0; + /** + * File does not exist. + */ + const ERROR_DOES_NOT_EXIST = 1; + /** + * File has bad magic number. + */ + const ERROR_BAD_MAGIC = 2; + /** + * Error while reading file, probably too short. + */ + const ERROR_READING = 3; + + /** + * Big endian mo file magic bytes. + */ + const MAGIC_BE = "\x95\x04\x12\xde"; + /** + * Little endian mo file magic bytes. + */ + const MAGIC_LE = "\xde\x12\x04\x95"; + + /** + * Parse error code (0 if no error). + * + * @var int + */ + public $error = self::ERROR_NONE; + + /** + * Cache header field for plural forms. + * + * @var string|null + */ + private $pluralequation = null; + /** + * @var ExpressionLanguage|null Evaluator for plurals + */ + private $pluralexpression = null; + /** + * @var int|null number of plurals + */ + private $pluralcount = null; + /** + * Array with original -> translation mapping. + * + * @var array + */ + private $cache_translations = array(); + + /** + * Constructor. + * + * @param string $filename Name of mo file to load + */ + public function __construct($filename) + { + if (!is_readable($filename)) { + $this->error = self::ERROR_DOES_NOT_EXIST; + + return; + } + + $stream = new StringReader($filename); + + try { + $magic = $stream->read(0, 4); + if (strcmp($magic, self::MAGIC_LE) == 0) { + $unpack = 'V'; + } elseif (strcmp($magic, self::MAGIC_BE) == 0) { + $unpack = 'N'; + } else { + $this->error = self::ERROR_BAD_MAGIC; + + return; + } + + /* Parse header */ + $total = $stream->readint($unpack, 8); + $originals = $stream->readint($unpack, 12); + $translations = $stream->readint($unpack, 16); + + /* get original and translations tables */ + $table_originals = $stream->readintarray($unpack, $originals, $total * 2); + $table_translations = $stream->readintarray($unpack, $translations, $total * 2); + + /* read all strings to the cache */ + for ($i = 0; $i < $total; ++$i) { + $original = $stream->read($table_originals[$i * 2 + 2], $table_originals[$i * 2 + 1]); + $translation = $stream->read($table_translations[$i * 2 + 2], $table_translations[$i * 2 + 1]); + $this->cache_translations[$original] = $translation; + } + } catch (ReaderException $e) { + $this->error = self::ERROR_READING; + + return; + } + } + + /** + * Translates a string. + * + * @param string $msgid String to be translated + * + * @return string translated string (or original, if not found) + */ + public function gettext($msgid) + { + if (array_key_exists($msgid, $this->cache_translations)) { + return $this->cache_translations[$msgid]; + } + + return $msgid; + } + + /** + * Check if a string is translated. + * + * @param string $msgid String to be checked + * + * @return bool + */ + public function exists($msgid) + { + return array_key_exists($msgid, $this->cache_translations); + } + + /** + * Sanitize plural form expression for use in ExpressionLanguage. + * + * @param string $expr Expression to sanitize + * + * @return string sanitized plural form expression + */ + public static function sanitizePluralExpression($expr) + { + // Parse equation + $expr = explode(';', $expr); + if (count($expr) >= 2) { + $expr = $expr[1]; + } else { + $expr = $expr[0]; + } + $expr = trim(strtolower($expr)); + // Strip plural prefix + if (substr($expr, 0, 6) === 'plural') { + $expr = ltrim(substr($expr, 6)); + } + // Strip equals + if (substr($expr, 0, 1) === '=') { + $expr = ltrim(substr($expr, 1)); + } + + // Cleanup from unwanted chars + $expr = preg_replace('@[^n0-9:\(\)\?=!<>/%&| ]@', '', $expr); + + return $expr; + } + + /** + * Extracts number of plurals from plurals form expression. + * + * @param string $expr Expression to process + * + * @return int Total number of plurals + */ + public static function extractPluralCount($expr) + { + $parts = explode(';', $expr, 2); + $nplurals = explode('=', trim($parts[0]), 2); + if (strtolower(rtrim($nplurals[0])) != 'nplurals') { + return 1; + } + if (count($nplurals) == 1) { + return 1; + } + + return intval($nplurals[1]); + } + + /** + * Parse full PO header and extract only plural forms line. + * + * @param string $header Gettext header + * + * @return string verbatim plural form header field + */ + public static function extractPluralsForms($header) + { + $headers = explode("\n", $header); + $expr = 'nplurals=2; plural=n == 1 ? 0 : 1;'; + foreach ($headers as $header) { + if (stripos($header, 'Plural-Forms:') === 0) { + $expr = substr($header, 13); + } + } + + return $expr; + } + + /** + * Get possible plural forms from MO header. + * + * @return string plural form header + */ + private function getPluralForms() + { + // lets assume message number 0 is header + // this is true, right? + + // cache header field for plural forms + if (is_null($this->pluralequation)) { + if (isset($this->cache_translations[''])) { + $header = $this->cache_translations['']; + } else { + $header = ''; + } + $expr = $this->extractPluralsForms($header); + $this->pluralequation = $this->sanitizePluralExpression($expr); + $this->pluralcount = $this->extractPluralCount($expr); + } + + return $this->pluralequation; + } + + /** + * Detects which plural form to take. + * + * @param int $n count of objects + * + * @return int array index of the right plural form + */ + private function selectString($n) + { + if (is_null($this->pluralexpression)) { + $this->pluralexpression = new ExpressionLanguage(); + } + try { + $plural = $this->pluralexpression->evaluate( + $this->getPluralForms(), array('n' => $n) + ); + } catch (\Exception $e) { + $plural = 0; + } + + if ($plural >= $this->pluralcount) { + $plural = $this->pluralcount - 1; + } + + return $plural; + } + + /** + * Plural version of gettext. + * + * @param string $msgid Single form + * @param string $msgidPlural Plural form + * @param int $number Number of objects + * + * @return string translated plural form + */ + public function ngettext($msgid, $msgidPlural, $number) + { + // this should contains all strings separated by NULLs + $key = implode(chr(0), array($msgid, $msgidPlural)); + if (!array_key_exists($key, $this->cache_translations)) { + return ($number != 1) ? $msgidPlural : $msgid; + } + + // find out the appropriate form + $select = $this->selectString($number); + + $result = $this->cache_translations[$key]; + $list = explode(chr(0), $result); + + if (!isset($list[$select])) { + return $list[0]; + } + + return $list[$select]; + } + + /** + * Translate with context. + * + * @param string $msgctxt Context + * @param string $msgid String to be translated + * + * @return string translated plural form + */ + public function pgettext($msgctxt, $msgid) + { + $key = implode(chr(4), array($msgctxt, $msgid)); + $ret = $this->gettext($key); + if (strpos($ret, chr(4)) !== false) { + return $msgid; + } + + return $ret; + } + + /** + * Plural version of pgettext. + * + * @param string $msgctxt Context + * @param string $msgid Single form + * @param string $msgidPlural Plural form + * @param int $number Number of objects + * + * @return string translated plural form + */ + public function npgettext($msgctxt, $msgid, $msgidPlural, $number) + { + $key = implode(chr(4), array($msgctxt, $msgid)); + $ret = $this->ngettext($key, $msgidPlural, $number); + if (strpos($ret, chr(4)) !== false) { + return $msgid; + } + + return $ret; + } + + /** + * Set translation in place + * + * @param string $msgid String to be set + * @param string $msgstr Translation + * + * @return void + */ + public function setTranslation($msgid, $msgstr) + { + $this->cache_translations[$msgid] = $msgstr; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/motranslator/src/functions.php b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/functions.php new file mode 100755 index 0000000..559715a --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/motranslator/src/functions.php @@ -0,0 +1,215 @@ + + Copyright (c) 2009 Danilo Segan + Copyright (c) 2016 Michal 膶iha艡 + + This file is part of MoTranslator. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +use PhpMyAdmin\MoTranslator\Loader; + +/** + * Sets a requested locale. + * + * @param int $category Locale category, ignored + * @param string $locale Locale name + * + * @return string Set or current locale + */ +function _setlocale($category, $locale) +{ + return Loader::getInstance()->setlocale($locale); +} + +/** + * Sets the path for a domain. + * + * @param string $domain Domain name + * @param string $path Path where to find locales + */ +function _bindtextdomain($domain, $path) +{ + Loader::getInstance()->bindtextdomain($domain, $path); +} + +/** + * Dummy compatibility function, MoTranslator assumes + * everything is using same character set on input and + * output. + * + * Generally it is wise to output in UTF-8 and have + * mo files in UTF-8. + * + * @param mixed $domain Domain where to set character set + * @param mixed $codeset Character set to set + */ +function _bind_textdomain_codeset($domain, $codeset) +{ +} + +/** + * Sets the default domain. + * + * @param string $domain Domain name + */ +function _textdomain($domain) +{ + Loader::getInstance()->textdomain($domain); +} + +/** + * Translates a string. + * + * @param string $msgid String to be translated + * + * @return string translated string (or original, if not found) + */ +function _gettext($msgid) +{ + return Loader::getInstance()->getTranslator()->gettext( + $msgid + ); +} + +/** + * Translates a string, alias for _gettext. + * + * @param string $msgid String to be translated + * + * @return string translated string (or original, if not found) + */ +function __($msgid) +{ + return Loader::getInstance()->getTranslator()->gettext( + $msgid + ); +} + +/** + * Plural version of gettext. + * + * @param string $msgid Single form + * @param string $msgidPlural Plural form + * @param int $number Number of objects + * + * @return string translated plural form + */ +function _ngettext($msgid, $msgidPlural, $number) +{ + return Loader::getInstance()->getTranslator()->ngettext( + $msgid, $msgidPlural, $number + ); +} + +/** + * Translate with context. + * + * @param string $msgctxt Context + * @param string $msgid String to be translated + * + * @return string translated plural form + */ +function _pgettext($msgctxt, $msgid) +{ + return Loader::getInstance()->getTranslator()->pgettext( + $msgctxt, $msgid + ); +} + +/** + * Plural version of pgettext. + * + * @param string $msgctxt Context + * @param string $msgid Single form + * @param string $msgidPlural Plural form + * @param int $number Number of objects + * + * @return string translated plural form + */ +function _npgettext($msgctxt, $msgid, $msgidPlural, $number) +{ + return Loader::getInstance()->getTranslator()->npgettext( + $msgctxt, $msgid, $msgidPlural, $number + ); +} + +/** + * Translates a string. + * + * @param string $domain Domain to use + * @param string $msgid String to be translated + * + * @return string translated string (or original, if not found) + */ +function _dgettext($domain, $msgid) +{ + return Loader::getInstance()->getTranslator($domain)->gettext( + $msgid + ); +} + +/** + * Plural version of gettext. + * + * @param string $domain Domain to use + * @param string $msgid Single form + * @param string $msgidPlural Plural form + * @param int $number Number of objects + * + * @return string translated plural form + */ +function _dngettext($domain, $msgid, $msgidPlural, $number) +{ + return Loader::getInstance()->getTranslator($domain)->ngettext( + $msgid, $msgidPlural, $number + ); +} + +/** + * Translate with context. + * + * @param string $domain Domain to use + * @param string $msgctxt Context + * @param string $msgid String to be translated + * + * @return string translated plural form + */ +function _dpgettext($domain, $msgctxt, $msgid) +{ + return Loader::getInstance()->getTranslator($domain)->pgettext( + $msgctxt, $msgid + ); +} + +/** + * Plural version of pgettext. + * + * @param string $domain Domain to use + * @param string $msgctxt Context + * @param string $msgid Single form + * @param string $msgidPlural Plural form + * @param int $number Number of objects + * + * @return string translated plural form + */ +function _dnpgettext($domain, $msgctxt, $msgid, $msgidPlural, $number) +{ + return Loader::getInstance()->getTranslator($domain)->npgettext( + $msgctxt, $msgid, $msgidPlural, $number + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/CHANGELOG.md b/phpMyAdmin/vendor/phpmyadmin/shapefile/CHANGELOG.md new file mode 100755 index 0000000..c572456 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/CHANGELOG.md @@ -0,0 +1,80 @@ +# Change Log + +## [2.1] - 2017-05-15 + +* Documentation improvements. + +## [2.0] - 2017-01-23 + +* Switched to PhpMyAdmin vendor namespace to follow PSR-4. + +## [1.2] - 2017-01-07 + +* Coding style cleanup. +* PHP 7.2 support. +* Avoid installing tests and test data using composer. + +## [1.1] - 2016-11-21 + +* Fixed adjusting of record bouding box + +## [1.0] - 2016-11-21 + +* Documentation improvements +* Code cleanups + +## [0.12] - 2016-11-17 + +* Fixed DBF search +* Improved test coverage + +## [0.11] - 2016-11-16 + +* Code cleanups +* Fixed behavior without configured DBF header + +## [0.11] - 2016-11-16 + +* Fixed saving Polygon/Polyline creation with multiple parts +* Fixed saving Multipont records + +## [0.10] - 2016-09-05 + +* Improved error handling on loading + +## [0.9] - 2016-08-04 + +* Code cleanups + +## [0.8] - 2016-06-24 + +* Code cleanups +* Fixed loading of records with optional data + +## [0.7] - 2016-06-24 + +* Properly fail on loading corrupted files + +## [0.6] - 2016-06-24 + +* Fixed detection of end of file when loading + +## [0.5] - 2016-06-24 + +* Added getShapeName method to ShapeFile + +## [0.4] - 2016-06-24 + +* Make API work even without real file open + +## [0.3] - 2016-06-24 + +* Better support for subclassing + +## [0.2] - 2016-06-24 + +* Make the dbase extension optional dependency + +## [0.1] - 2016-06-14 + +* Inital release based on bfShapeFiles diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/CONTRIBUTING.md b/phpMyAdmin/vendor/phpmyadmin/shapefile/CONTRIBUTING.md new file mode 100755 index 0000000..d5d8705 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/CONTRIBUTING.md @@ -0,0 +1,42 @@ +# Contributing to shapefile + +## Reporting issues + +Our issue tracker is hosted at GitHub: + +https://github.com/phpmyadmin/shapefile/issues + +Please search for existing issues before reporting new ones. + +## Working with Git checkout + +The dependencies are managed by Composer, to get them all installed (or update +on consequent runs) do: + +``` +composer update +``` + +## Submitting patches + +Please submit your patches using GitHub pull requests, this allows us to review +them and to run automated tests on the code. + +## Coding standards + +We do follow PSR-1 and PSR-2 coding standards. + +You can use php-cs-fixer to fix the code to match our expectations: + +``` +php-cs-fixer fix . +``` + +## Testsuite + +Our code comes with quite comprehensive testsuite, it is automatically executed +on every commit and pull request, you can also run it locally: + +``` +./vendor/bin/phpunit -c phpunit.xml +``` diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/LICENSE b/phpMyAdmin/vendor/phpmyadmin/shapefile/LICENSE new file mode 100755 index 0000000..23cb790 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + {signature of Ty Coon}, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/README.md b/phpMyAdmin/vendor/phpmyadmin/shapefile/README.md new file mode 100755 index 0000000..3e0bf23 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/README.md @@ -0,0 +1,57 @@ +# shapefile +ShapeFile library for PHP + +[![Build Status](https://travis-ci.org/phpmyadmin/shapefile.svg?branch=master)](https://travis-ci.org/phpmyadmin/shapefile) +[![codecov.io](https://codecov.io/github/phpmyadmin/shapefile/coverage.svg?branch=master)](https://codecov.io/github/phpmyadmin/shapefile?branch=master) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phpmyadmin/shapefile/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phpmyadmin/shapefile/?branch=master) +[![Packagist](https://img.shields.io/packagist/dt/phpmyadmin/shapefile.svg)](https://packagist.org/packages/phpmyadmin/shapefile) + +## Features + +Currently the 2D and 3D variants except MultiPatch of the ShapeFile format as +defined in https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf. The +library currently supports reading and editing of ShapeFiles and the Associated +information (DBF file). There are a lot of things that can be improved in the +code, if you are interested in developing, helping with the documentation, +making translations or offering new ideas please contact us. + +## Installation + +Please use [Composer][1] to install: + +``` +composer require phpmyadmin/shapefile +``` + +To be able to read and write the associated DBF file, you need ``dbase`` +extension: + +``` +pecl install dbase +echo "extension=dbase.so" > /etc/php5/conf.d/dbase.ini +``` + +## Documentation + +The API documentation is available at +. + +## Usage + +To read shape file: + +```php +$shp = new \PhpMyAdmin\ShapeFile\ShapeFile(0); +$shp->loadFromFile('path/file.*'); +``` + +## History + +This library is based on BytesFall ShapeFiles library written by Ovidio (ovidio +AT users.sourceforge.net). The library has been embedded in phpMyAdmin for +years and slowly developed there. At one point people started to use our +version rather than the original library and that was the point we decided to +make it separate package. + +[1]:https://getcomposer.org/ + diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/codecov.yml b/phpMyAdmin/vendor/phpmyadmin/shapefile/codecov.yml new file mode 100755 index 0000000..99d09da --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/codecov.yml @@ -0,0 +1,3 @@ +comment: + layout: header, changes, diff +coverage: {} diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/composer.json b/phpMyAdmin/vendor/phpmyadmin/shapefile/composer.json new file mode 100755 index 0000000..b4968ec --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/composer.json @@ -0,0 +1,33 @@ +{ + "name": "phpmyadmin/shapefile", + "description": "ESRI ShapeFile library for PHP", + "license": "GPL-2.0+", + "keywords": ["shapefile", "shp", "geo", "geospatial", "dbf", "ESRI", "shape"], + "homepage": "https://github.com/phpmyadmin/shapefile", + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "support": { + "issues": "https://github.com/phpmyadmin/shapefile/issues", + "source": "https://github.com/phpmyadmin/shapefile" + }, + "require": { + "php": ">=5.4.0" + }, + "suggest": { + "ext-dbase": "For dbf files parsing" + }, + "require-dev": { + "phpunit/php-code-coverage": "*", + "phpunit/phpunit": "~4.8 || ~5.7" + }, + "autoload": { + "psr-4": { + "PhpMyAdmin\\ShapeFile\\": "src" + } + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/phpunit.xml b/phpMyAdmin/vendor/phpmyadmin/shapefile/phpunit.xml new file mode 100755 index 0000000..77935db --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/phpunit.xml @@ -0,0 +1,25 @@ + + + + + + + + ./tests + + + + + src/ + + + diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/src/ShapeFile.php b/phpMyAdmin/vendor/phpmyadmin/shapefile/src/ShapeFile.php new file mode 100755 index 0000000..5995a82 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/src/ShapeFile.php @@ -0,0 +1,647 @@ +. + * + * Copyright 2006-2007 Ovidio + * Copyright 2016 - 2017 Michal 膶iha艡 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you can download one from + * https://www.gnu.org/copyleft/gpl.html. + */ + +namespace PhpMyAdmin\ShapeFile; + +/** + * ShapeFile class. + */ +class ShapeFile +{ + const MAGIC = 0x270a; + + public $FileName; + + private $SHPFile = null; + private $SHXFile = null; + private $DBFFile = null; + + private $DBFHeader; + + public $lastError = ''; + + public $boundingBox = array('xmin' => 0.0, 'ymin' => 0.0, 'xmax' => 0.0, 'ymax' => 0.0); + private $fileLength = 0; + public $shapeType = 0; + + public $records = array(); + + /** + * Checks whether dbase manipuations are supported. + * + * @return bool + */ + public static function supports_dbase() + { + return extension_loaded('dbase'); + } + + /** + * @param int $shapeType File shape type, should be same as all records + * @param array $boundingBox File bounding box + * @param null|mixed $FileName File name + */ + public function __construct($shapeType, $boundingBox = array('xmin' => 0.0, 'ymin' => 0.0, 'xmax' => 0.0, 'ymax' => 0.0), $FileName = null) + { + $this->shapeType = $shapeType; + $this->boundingBox = $boundingBox; + $this->FileName = $FileName; + $this->fileLength = 50; // The value for file length is the total length of the file in 16-bit words (including the fifty 16-bit words that make up the header). + } + + /** + * Loads shapefile and dbase (if supported). + * + * @param string $FileName File mask to load (eg. example.*) + */ + public function loadFromFile($FileName) + { + if (!empty($FileName)) { + $this->FileName = $FileName; + $result = $this->_openSHPFile(); + } else { + /* We operate on buffer emulated by readSHP / eofSHP */ + $result = true; + } + + if ($result && ($this->_openDBFFile())) { + if (!$this->_loadHeaders()) { + $this->_closeSHPFile(); + $this->_closeDBFFile(); + + return false; + } + if (!$this->_loadRecords()) { + $this->_closeSHPFile(); + $this->_closeDBFFile(); + + return false; + } + $this->_closeSHPFile(); + $this->_closeDBFFile(); + + return true; + } + + return false; + } + + /** + * Saves shapefile. + * + * @param string|null $FileName Name of file, otherwise existing is used + */ + public function saveToFile($FileName = null) + { + if (!is_null($FileName)) { + $this->FileName = $FileName; + } + + if (($this->_openSHPFile(true)) && ($this->_openSHXFile(true)) && ($this->_createDBFFile())) { + $this->_saveHeaders(); + $this->_saveRecords(); + $this->_closeSHPFile(); + $this->_closeSHXFile(); + $this->_closeDBFFile(); + } else { + return false; + } + } + + /** + * Generates filename with given extension. + * + * @param string $extension Extension to use (including dot) + * + * @return string + */ + private function _getFilename($extension) + { + return str_replace('.*', $extension, $this->FileName); + } + + /** + * Updates bounding box based on SHPData. + * + * @param string $type Type of box + * @param array $data ShapeRecord SHPData + */ + private function updateBBox($type, $data) + { + $min = $type . 'min'; + $max = $type . 'max'; + + if (!isset($this->boundingBox[$min]) || $this->boundingBox[$min] == 0.0 || ($this->boundingBox[$min] > $data[$min])) { + $this->boundingBox[$min] = $data[$min]; + } + if (!isset($this->boundingBox[$max]) || $this->boundingBox[$max] == 0.0 || ($this->boundingBox[$max] < $data[$max])) { + $this->boundingBox[$max] = $data[$max]; + } + } + + /** + * Adds record to shape file. + * + * @param ShapeRecord $record + * + * @return int Number of added record + */ + public function addRecord($record) + { + if ((isset($this->DBFHeader)) && (is_array($this->DBFHeader))) { + $record->updateDBFInfo($this->DBFHeader); + } + + $this->fileLength += ($record->getContentLength() + 4); + $this->records[] = $record; + $this->records[count($this->records) - 1]->recordNumber = count($this->records); + + $this->updateBBox('x', $record->SHPData); + $this->updateBBox('y', $record->SHPData); + + if (in_array($this->shapeType, array(11, 13, 15, 18, 21, 23, 25, 28))) { + $this->updateBBox('m', $record->SHPData); + } + + if (in_array($this->shapeType, array(11, 13, 15, 18))) { + $this->updateBBox('z', $record->SHPData); + } + + return count($this->records) - 1; + } + + /** + * Deletes record from shapefile. + * + * @param int $index + */ + public function deleteRecord($index) + { + if (isset($this->records[$index])) { + $this->fileLength -= ($this->records[$index]->getContentLength() + 4); + $count = count($this->records) - 1; + for ($i = $index; $i < $count; ++$i) { + $this->records[$i] = $this->records[$i + 1]; + } + unset($this->records[count($this->records) - 1]); + $this->_deleteRecordFromDBF($index); + } + } + + /** + * Returns array defining fields in DBF file. + * + * @return array see setDBFHeader for more information + */ + public function getDBFHeader() + { + return $this->DBFHeader; + } + + /** + * Changes array defining fields in DBF file, used in dbase_create call. + * + * @param array $header An array of arrays, each array describing the + * format of one field of the database. Each + * field consists of a name, a character indicating + * the field type, and optionally, a length, + * a precision and a nullable flag. + */ + public function setDBFHeader($header) + { + $this->DBFHeader = $header; + + $count = count($this->records); + for ($i = 0; $i < $count; ++$i) { + $this->records[$i]->updateDBFInfo($header); + } + } + + /** + * Lookups value in the DBF file and returs index. + * + * @param string $field Field to match + * @param mixed $value Value to match + * + * @return int + */ + public function getIndexFromDBFData($field, $value) + { + foreach ($this->records as $index => $record) { + if (isset($record->DBFData[$field]) && + (trim(strtoupper($record->DBFData[$field])) == strtoupper($value)) + ) { + return $index; + } + } + + return -1; + } + + /** + * Loads DBF metadata. + */ + private function _loadDBFHeader() + { + $DBFFile = fopen($this->_getFilename('.dbf'), 'r'); + + $result = array(); + $i = 1; + $inHeader = true; + + while ($inHeader) { + if (!feof($DBFFile)) { + $buff32 = fread($DBFFile, 32); + if ($i > 1) { + if (substr($buff32, 0, 1) == chr(13)) { + $inHeader = false; + } else { + $pos = strpos(substr($buff32, 0, 10), chr(0)); + $pos = ($pos == 0 ? 10 : $pos); + + $fieldName = substr($buff32, 0, $pos); + $fieldType = substr($buff32, 11, 1); + $fieldLen = ord(substr($buff32, 16, 1)); + $fieldDec = ord(substr($buff32, 17, 1)); + + array_push($result, array($fieldName, $fieldType, $fieldLen, $fieldDec)); + } + } + ++$i; + } else { + $inHeader = false; + } + } + + fclose($DBFFile); + + return $result; + } + + /** + * Deletes record from the DBF file. + * + * @param int $index + */ + private function _deleteRecordFromDBF($index) + { + if (@dbase_delete_record($this->DBFFile, $index)) { + dbase_pack($this->DBFFile); + } + } + + /** + * Loads SHP file metadata. + * + * @return bool + */ + private function _loadHeaders() + { + if (Util::loadData('N', $this->readSHP(4)) != self::MAGIC) { + $this->setError('Not a SHP file (file code mismatch)'); + + return false; + } + + /* Skip 20 unused bytes */ + $this->readSHP(20); + + $this->fileLength = Util::loadData('N', $this->readSHP(4)); + + /* We currently ignore version */ + $this->readSHP(4); + + $this->shapeType = Util::loadData('V', $this->readSHP(4)); + + $this->boundingBox = array(); + $this->boundingBox['xmin'] = Util::loadData('d', $this->readSHP(8)); + $this->boundingBox['ymin'] = Util::loadData('d', $this->readSHP(8)); + $this->boundingBox['xmax'] = Util::loadData('d', $this->readSHP(8)); + $this->boundingBox['ymax'] = Util::loadData('d', $this->readSHP(8)); + $this->boundingBox['zmin'] = Util::loadData('d', $this->readSHP(8)); + $this->boundingBox['zmax'] = Util::loadData('d', $this->readSHP(8)); + $this->boundingBox['mmin'] = Util::loadData('d', $this->readSHP(8)); + $this->boundingBox['mmax'] = Util::loadData('d', $this->readSHP(8)); + + if (self::supports_dbase()) { + $this->DBFHeader = $this->_loadDBFHeader(); + } + + return true; + } + + /** + * Saves bounding box record, possibly using 0 instead of not set values. + * + * @param file $file File object + * @param string $type Bounding box dimension (eg. xmax, mmin...) + */ + private function _saveBBoxRecord($file, $type) + { + fwrite($file, Util::packDouble( + isset($this->boundingBox[$type]) ? $this->boundingBox[$type] : 0) + ); + } + + /** + * Saves bounding box to a file. + * + * @param file $file File object + */ + private function _saveBBox($file) + { + $this->_saveBBoxRecord($file, 'xmin'); + $this->_saveBBoxRecord($file, 'ymin'); + $this->_saveBBoxRecord($file, 'xmax'); + $this->_saveBBoxRecord($file, 'ymax'); + $this->_saveBBoxRecord($file, 'zmin'); + $this->_saveBBoxRecord($file, 'zmax'); + $this->_saveBBoxRecord($file, 'mmin'); + $this->_saveBBoxRecord($file, 'mmax'); + } + + /** + * Saves SHP and SHX file metadata. + */ + private function _saveHeaders() + { + fwrite($this->SHPFile, pack('NNNNNN', self::MAGIC, 0, 0, 0, 0, 0)); + fwrite($this->SHPFile, pack('N', $this->fileLength)); + fwrite($this->SHPFile, pack('V', 1000)); + fwrite($this->SHPFile, pack('V', $this->shapeType)); + $this->_saveBBox($this->SHPFile); + + fwrite($this->SHXFile, pack('NNNNNN', self::MAGIC, 0, 0, 0, 0, 0)); + fwrite($this->SHXFile, pack('N', 50 + 4 * count($this->records))); + fwrite($this->SHXFile, pack('V', 1000)); + fwrite($this->SHXFile, pack('V', $this->shapeType)); + $this->_saveBBox($this->SHXFile); + } + + /** + * Loads records from SHP file (and DBF). + * + * @return bool + */ + private function _loadRecords() + { + /* Need to start at offset 100 */ + while (!$this->eofSHP()) { + $record = new ShapeRecord(-1); + $record->loadFromFile($this, $this->SHPFile, $this->DBFFile); + if ($record->lastError != '') { + $this->setError($record->lastError); + + return false; + } + if (($record->shapeType === false || $record->shapeType === '') && $this->eofSHP()) { + break; + } + + $this->records[] = $record; + } + + return true; + } + + /** + * Saves records to SHP and SHX files. + */ + private function _saveRecords() + { + $offset = 50; + if (is_array($this->records) && (count($this->records) > 0)) { + foreach ($this->records as $index => $record) { + //Save the record to the .shp file + $record->saveToFile($this->SHPFile, $this->DBFFile, $index + 1); + + //Save the record to the .shx file + fwrite($this->SHXFile, pack('N', $offset)); + fwrite($this->SHXFile, pack('N', $record->getContentLength())); + $offset += (4 + $record->getContentLength()); + } + } + } + + /** + * Generic interface to open files. + * + * @param bool $toWrite Whether file should be opened for writing + * @param string $extension File extension + * @param string $name Verbose file name to report errors + * + * @return file|false File handle + */ + private function _openFile($toWrite, $extension, $name) + { + $shp_name = $this->_getFilename($extension); + $result = @fopen($shp_name, ($toWrite ? 'wb+' : 'rb')); + if (!$result) { + $this->setError(sprintf('It wasn\'t possible to open the %s file "%s"', $name, $shp_name)); + + return false; + } + + return $result; + } + + /** + * Opens SHP file. + * + * @param bool $toWrite Whether file should be opened for writing + * + * @return bool + */ + private function _openSHPFile($toWrite = false) + { + $this->SHPFile = $this->_openFile($toWrite, '.shp', 'Shape'); + if (!$this->SHPFile) { + return false; + } + + return true; + } + + /** + * Closes SHP file. + */ + private function _closeSHPFile() + { + if ($this->SHPFile) { + fclose($this->SHPFile); + $this->SHPFile = null; + } + } + + /** + * Opens SHX file. + * + * @param bool $toWrite Whether file should be opened for writing + * + * @return bool + */ + private function _openSHXFile($toWrite = false) + { + $this->SHXFile = $this->_openFile($toWrite, '.shx', 'Index'); + if (!$this->SHXFile) { + return false; + } + + return true; + } + + /** + * Closes SHX file. + */ + private function _closeSHXFile() + { + if ($this->SHXFile) { + fclose($this->SHXFile); + $this->SHXFile = null; + } + } + + /** + * Creates DBF file. + * + * @return bool + */ + private function _createDBFFile() + { + if (!self::supports_dbase() || !is_array($this->DBFHeader) || count($this->DBFHeader) == 0) { + $this->DBFFile = null; + + return true; + } + $dbf_name = $this->_getFilename('.dbf'); + + /* Unlink existing file */ + if (file_exists($dbf_name)) { + unlink($dbf_name); + } + + /* Create new file */ + $this->DBFFile = @dbase_create($dbf_name, $this->DBFHeader); + if ($this->DBFFile === false) { + $this->setError(sprintf('It wasn\'t possible to create the DBase file "%s"', $dbf_name)); + + return false; + } + + return true; + } + + /** + * Loads DBF file if supported. + * + * @return bool + */ + private function _openDBFFile() + { + if (!self::supports_dbase()) { + $this->DBFFile = null; + + return true; + } + $dbf_name = $this->_getFilename('.dbf'); + if (is_readable($dbf_name)) { + $this->DBFFile = @dbase_open($dbf_name, 0); + if (!$this->DBFFile) { + $this->setError(sprintf('It wasn\'t possible to open the DBase file "%s"', $dbf_name)); + + return false; + } + } else { + $this->setError(sprintf('It wasn\'t possible to find the DBase file "%s"', $dbf_name)); + + return false; + } + + return true; + } + + /** + * Closes DBF file. + */ + private function _closeDBFFile() + { + if ($this->DBFFile) { + dbase_close($this->DBFFile); + $this->DBFFile = null; + } + } + + /** + * Sets error message. + * + * @param string $error + */ + public function setError($error) + { + $this->lastError = $error; + } + + /** + * Reads given number of bytes from SHP file. + * + * @param int $bytes + * + * @return string + */ + public function readSHP($bytes) + { + return fread($this->SHPFile, $bytes); + } + + /** + * Checks whether file is at EOF. + * + * @return bool + */ + public function eofSHP() + { + return feof($this->SHPFile); + } + + /** + * Returns shape name. + * + * @return string + */ + public function getShapeName() + { + return Util::nameShape($this->shapeType); + } + + /** + * Check whether file contains measure data. + * + * For some reason this is distinguished by zero bounding box in the + * specification. + * + * @return bool + */ + public function hasMeasure() + { + return $this->boundingBox['mmin'] != 0 || $this->boundingBox['mmax'] != 0; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/src/ShapeRecord.php b/phpMyAdmin/vendor/phpmyadmin/shapefile/src/ShapeRecord.php new file mode 100755 index 0000000..0d5cfe7 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/src/ShapeRecord.php @@ -0,0 +1,849 @@ +. + * + * Copyright 2006-2007 Ovidio + * Copyright 2016 - 2017 Michal 膶iha艡 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you can download one from + * https://www.gnu.org/copyleft/gpl.html. + */ + +namespace PhpMyAdmin\ShapeFile; + +/** + * ShapeFile record class. + */ +class ShapeRecord +{ + private $SHPFile = null; + private $DBFFile = null; + private $ShapeFile = null; + + private $size = 0; + private $read = 0; + + public $recordNumber = null; + public $shapeType = null; + + public $lastError = ''; + + public $SHPData = array(); + public $DBFData = array(); + + /** + * @param int $shapeType + */ + public function __construct($shapeType) + { + $this->shapeType = $shapeType; + } + + /** + * Loads record from files. + * + * @param ShapeFile $ShapeFile + * @param file &$SHPFile Opened SHP file + * @param file &$DBFFile Opened DBF file + */ + public function loadFromFile(&$ShapeFile, &$SHPFile, &$DBFFile) + { + $this->ShapeFile = $ShapeFile; + $this->SHPFile = $SHPFile; + $this->DBFFile = $DBFFile; + $this->_loadHeaders(); + + /* No header read */ + if ($this->read == 0) { + return; + } + + switch ($this->shapeType) { + case 0: + $this->_loadNullRecord(); + break; + case 1: + $this->_loadPointRecord(); + break; + case 21: + $this->_loadPointMRecord(); + break; + case 11: + $this->_loadPointZRecord(); + break; + case 3: + $this->_loadPolyLineRecord(); + break; + case 23: + $this->_loadPolyLineMRecord(); + break; + case 13: + $this->_loadPolyLineZRecord(); + break; + case 5: + $this->_loadPolygonRecord(); + break; + case 25: + $this->_loadPolygonMRecord(); + break; + case 15: + $this->_loadPolygonZRecord(); + break; + case 8: + $this->_loadMultiPointRecord(); + break; + case 28: + $this->_loadMultiPointMRecord(); + break; + case 18: + $this->_loadMultiPointZRecord(); + break; + default: + $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType)); + break; + } + + /* We need to skip rest of the record */ + while ($this->read < $this->size) { + $this->_loadData('V', 4); + } + + /* Check if we didn't read too much */ + if ($this->read != $this->size) { + $this->setError(sprintf('Failed to parse record, read=%d, size=%d', $this->read, $this->size)); + } + + if (ShapeFile::supports_dbase() && isset($this->DBFFile)) { + $this->_loadDBFData(); + } + } + + /** + * Saves record to files. + * + * @param file &$SHPFile Opened SHP file + * @param file &$DBFFile Opened DBF file + * @param int $recordNumber Record number + */ + public function saveToFile(&$SHPFile, &$DBFFile, $recordNumber) + { + $this->SHPFile = $SHPFile; + $this->DBFFile = $DBFFile; + $this->recordNumber = $recordNumber; + $this->_saveHeaders(); + + switch ($this->shapeType) { + case 0: + // Nothing to save + break; + case 1: + $this->_savePointRecord(); + break; + case 21: + $this->_savePointMRecord(); + break; + case 11: + $this->_savePointZRecord(); + break; + case 3: + $this->_savePolyLineRecord(); + break; + case 23: + $this->_savePolyLineMRecord(); + break; + case 13: + $this->_savePolyLineZRecord(); + break; + case 5: + $this->_savePolygonRecord(); + break; + case 25: + $this->_savePolygonMRecord(); + break; + case 15: + $this->_savePolygonZRecord(); + break; + case 8: + $this->_saveMultiPointRecord(); + break; + case 28: + $this->_saveMultiPointMRecord(); + break; + case 18: + $this->_saveMultiPointZRecord(); + break; + default: + $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType)); + break; + } + if (ShapeFile::supports_dbase() && !is_null($this->DBFFile)) { + $this->_saveDBFData(); + } + } + + /** + * Updates DBF data to match header. + * + * @param array $header DBF structure header + */ + public function updateDBFInfo($header) + { + $tmp = $this->DBFData; + unset($this->DBFData); + $this->DBFData = array(); + foreach ($header as $value) { + $this->DBFData[$value[0]] = (isset($tmp[$value[0]])) ? $tmp[$value[0]] : ''; + } + } + + /** + * Reads data. + * + * @param string $type type for unpack() + * @param int $count number of bytes + * + * @return mixed + */ + private function _loadData($type, $count) + { + $data = $this->ShapeFile->readSHP($count); + if ($data === false) { + return false; + } + $this->read += strlen($data); + + return Util::loadData($type, $data); + } + + /** + * Loads metadata header from a file. + */ + private function _loadHeaders() + { + $this->shapeType = false; + $this->recordNumber = $this->_loadData('N', 4); + if ($this->recordNumber === false) { + return; + } + // We read the length of the record + $this->size = $this->_loadData('N', 4); + if ($this->size === false) { + return; + } + $this->size = $this->size * 2 + 8; + $this->shapeType = $this->_loadData('V', 4); + } + + /** + * Saves metadata header to a file. + */ + private function _saveHeaders() + { + fwrite($this->SHPFile, pack('N', $this->recordNumber)); + fwrite($this->SHPFile, pack('N', $this->getContentLength())); + fwrite($this->SHPFile, pack('V', $this->shapeType)); + } + + private function _loadPoint() + { + $data = array(); + + $data['x'] = $this->_loadData('d', 8); + $data['y'] = $this->_loadData('d', 8); + + return $data; + } + + private function _loadPointM() + { + $data = $this->_loadPoint(); + + $data['m'] = $this->_loadData('d', 8); + + return $data; + } + + private function _loadPointZ() + { + $data = $this->_loadPoint(); + + $data['z'] = $this->_loadData('d', 8); + $data['m'] = $this->_loadData('d', 8); + + return $data; + } + + private function _savePoint($data) + { + fwrite($this->SHPFile, Util::packDouble($data['x'])); + fwrite($this->SHPFile, Util::packDouble($data['y'])); + } + + private function _savePointM($data) + { + fwrite($this->SHPFile, Util::packDouble($data['x'])); + fwrite($this->SHPFile, Util::packDouble($data['y'])); + fwrite($this->SHPFile, Util::packDouble($data['m'])); + } + + private function _savePointZ($data) + { + fwrite($this->SHPFile, Util::packDouble($data['x'])); + fwrite($this->SHPFile, Util::packDouble($data['y'])); + fwrite($this->SHPFile, Util::packDouble($data['z'])); + fwrite($this->SHPFile, Util::packDouble($data['m'])); + } + + private function _loadNullRecord() + { + $this->SHPData = array(); + } + + private function _loadPointRecord() + { + $this->SHPData = $this->_loadPoint(); + } + + private function _loadPointMRecord() + { + $this->SHPData = $this->_loadPointM(); + } + + private function _loadPointZRecord() + { + $this->SHPData = $this->_loadPointZ(); + } + + private function _savePointRecord() + { + $this->_savePoint($this->SHPData); + } + + private function _savePointMRecord() + { + $this->_savePointM($this->SHPData); + } + + private function _savePointZRecord() + { + $this->_savePointZ($this->SHPData); + } + + private function _loadBBox() + { + $this->SHPData['xmin'] = $this->_loadData('d', 8); + $this->SHPData['ymin'] = $this->_loadData('d', 8); + $this->SHPData['xmax'] = $this->_loadData('d', 8); + $this->SHPData['ymax'] = $this->_loadData('d', 8); + } + + private function _loadMultiPointRecord() + { + $this->SHPData = array(); + $this->_loadBBox(); + + $this->SHPData['numpoints'] = $this->_loadData('V', 4); + + for ($i = 0; $i < $this->SHPData['numpoints']; ++$i) { + $this->SHPData['points'][] = $this->_loadPoint(); + } + } + + /** + * @param string $type + */ + private function _loadMultiPointMZRecord($type) + { + /* The m dimension is optional, depends on bounding box data */ + if ($type == 'm' && !$this->ShapeFile->hasMeasure()) { + return; + } + + $this->SHPData[$type . 'min'] = $this->_loadData('d', 8); + $this->SHPData[$type . 'max'] = $this->_loadData('d', 8); + + for ($i = 0; $i < $this->SHPData['numpoints']; ++$i) { + $this->SHPData['points'][$i][$type] = $this->_loadData('d', 8); + } + } + + private function _loadMultiPointMRecord() + { + $this->_loadMultiPointRecord(); + + $this->_loadMultiPointMZRecord('m'); + } + + private function _loadMultiPointZRecord() + { + $this->_loadMultiPointRecord(); + + $this->_loadMultiPointMZRecord('z'); + $this->_loadMultiPointMZRecord('m'); + } + + private function _saveMultiPointRecord() + { + fwrite($this->SHPFile, pack('dddd', $this->SHPData['xmin'], $this->SHPData['ymin'], $this->SHPData['xmax'], $this->SHPData['ymax'])); + + fwrite($this->SHPFile, pack('V', $this->SHPData['numpoints'])); + + for ($i = 0; $i < $this->SHPData['numpoints']; ++$i) { + $this->_savePoint($this->SHPData['points'][$i]); + } + } + + /** + * @param string $type + */ + private function _saveMultiPointMZRecord($type) + { + fwrite($this->SHPFile, pack('dd', $this->SHPData[$type . 'min'], $this->SHPData[$type . 'max'])); + + for ($i = 0; $i < $this->SHPData['numpoints']; ++$i) { + fwrite($this->SHPFile, Util::packDouble($this->SHPData['points'][$i][$type])); + } + } + + private function _saveMultiPointMRecord() + { + $this->_saveMultiPointRecord(); + + $this->_saveMultiPointMZRecord('m'); + } + + private function _saveMultiPointZRecord() + { + $this->_saveMultiPointRecord(); + + $this->_saveMultiPointMZRecord('z'); + $this->_saveMultiPointMZRecord('m'); + } + + private function _loadPolyLineRecord() + { + $this->SHPData = array(); + $this->_loadBBox(); + + $this->SHPData['numparts'] = $this->_loadData('V', 4); + $this->SHPData['numpoints'] = $this->_loadData('V', 4); + + $numparts = $this->SHPData['numparts']; + $numpoints = $this->SHPData['numpoints']; + + for ($i = 0; $i < $numparts; ++$i) { + $this->SHPData['parts'][$i] = $this->_loadData('V', 4); + } + + $part = 0; + for ($i = 0; $i < $numpoints; ++$i) { + if ($part + 1 < $numparts && $this->SHPData['parts'][$part + 1] == $i) { + ++$part; + } + if (!isset($this->SHPData['parts'][$part]['points']) || !is_array($this->SHPData['parts'][$part]['points'])) { + $this->SHPData['parts'][$part] = array('points' => array()); + } + $this->SHPData['parts'][$part]['points'][] = $this->_loadPoint(); + } + } + + /** + * @param string $type + */ + private function _loadPolyLineMZRecord($type) + { + /* The m dimension is optional, depends on bounding box data */ + if ($type == 'm' && !$this->ShapeFile->hasMeasure()) { + return; + } + + $this->SHPData[$type . 'min'] = $this->_loadData('d', 8); + $this->SHPData[$type . 'max'] = $this->_loadData('d', 8); + + $numparts = $this->SHPData['numparts']; + $numpoints = $this->SHPData['numpoints']; + + $part = 0; + for ($i = 0; $i < $numpoints; ++$i) { + if ($part + 1 < $numparts && $this->SHPData['parts'][$part + 1] == $i) { + ++$part; + } + $this->SHPData['parts'][$part]['points'][$i][$type] = $this->_loadData('d', 8); + } + } + + private function _loadPolyLineMRecord() + { + $this->_loadPolyLineRecord(); + + $this->_loadPolyLineMZRecord('m'); + } + + private function _loadPolyLineZRecord() + { + $this->_loadPolyLineRecord(); + + $this->_loadPolyLineMZRecord('z'); + $this->_loadPolyLineMZRecord('m'); + } + + private function _savePolyLineRecord() + { + fwrite($this->SHPFile, pack('dddd', $this->SHPData['xmin'], $this->SHPData['ymin'], $this->SHPData['xmax'], $this->SHPData['ymax'])); + + fwrite($this->SHPFile, pack('VV', $this->SHPData['numparts'], $this->SHPData['numpoints'])); + + $part_index = 0; + for ($i = 0; $i < $this->SHPData['numparts']; ++$i) { + fwrite($this->SHPFile, pack('V', $part_index)); + $part_index += count($this->SHPData['parts'][$i]['points']); + } + + foreach ($this->SHPData['parts'] as $partData) { + foreach ($partData['points'] as $pointData) { + $this->_savePoint($pointData); + } + } + } + + /** + * @param string $type + */ + private function _savePolyLineMZRecord($type) + { + fwrite($this->SHPFile, pack('dd', $this->SHPData[$type . 'min'], $this->SHPData[$type . 'max'])); + + foreach ($this->SHPData['parts'] as $partData) { + foreach ($partData['points'] as $pointData) { + fwrite($this->SHPFile, Util::packDouble($pointData[$type])); + } + } + } + + private function _savePolyLineMRecord() + { + $this->_savePolyLineRecord(); + + $this->_savePolyLineMZRecord('m'); + } + + private function _savePolyLineZRecord() + { + $this->_savePolyLineRecord(); + + $this->_savePolyLineMZRecord('z'); + $this->_savePolyLineMZRecord('m'); + } + + private function _loadPolygonRecord() + { + $this->_loadPolyLineRecord(); + } + + private function _loadPolygonMRecord() + { + $this->_loadPolyLineMRecord(); + } + + private function _loadPolygonZRecord() + { + $this->_loadPolyLineZRecord(); + } + + private function _savePolygonRecord() + { + $this->_savePolyLineRecord(); + } + + private function _savePolygonMRecord() + { + $this->_savePolyLineMRecord(); + } + + private function _savePolygonZRecord() + { + $this->_savePolyLineZRecord(); + } + + private function _adjustBBox($point) + { + // Adjusts bounding box based on point + $directions = array('x', 'y', 'z', 'm'); + foreach ($directions as $direction) { + if (!isset($point[$direction])) { + continue; + } + $min = $direction . 'min'; + $max = $direction . 'max'; + if (!isset($this->SHPData[$min]) || ($this->SHPData[$min] > $point[$direction])) { + $this->SHPData[$min] = $point[$direction]; + } + if (!isset($this->SHPData[$max]) || ($this->SHPData[$max] < $point[$direction])) { + $this->SHPData[$max] = $point[$direction]; + } + } + } + + /** + * Sets dimension to 0 if not set. + * + * @param array $point Point to check + * @param string $dimension Dimension to check + * + * @return array + */ + private function _fixPoint($point, $dimension) + { + if (!isset($point[$dimension])) { + $point[$dimension] = 0.0; // no_value + } + + return $point; + } + + /** + * Adjust point and bounding box when adding point. + * + * @param array $point Point data + * + * @return array Fixed point data + */ + private function _adjustPoint($point) + { + $type = $this->shapeType / 10; + if ($type >= 2) { + $point = $this->_fixPoint($point, 'm'); + } elseif ($type >= 1) { + $point = $this->_fixPoint($point, 'z'); + $point = $this->_fixPoint($point, 'm'); + } + + return $point; + } + + /** + * Adds point to a record. + * + * @param array $point Point data + * @param int $partIndex Part index + */ + public function addPoint($point, $partIndex = 0) + { + $point = $this->_adjustPoint($point); + switch ($this->shapeType) { + case 0: + //Don't add anything + return; + case 1: + case 11: + case 21: + //Substitutes the value of the current point + $this->SHPData = $point; + break; + case 3: + case 5: + case 13: + case 15: + case 23: + case 25: + //Adds a new point to the selected part + $this->SHPData['parts'][$partIndex]['points'][] = $point; + $this->SHPData['numparts'] = count($this->SHPData['parts']); + $this->SHPData['numpoints'] = 1 + (isset($this->SHPData['numpoints']) ? $this->SHPData['numpoints'] : 0); + break; + case 8: + case 18: + case 28: + //Adds a new point + $this->SHPData['points'][] = $point; + $this->SHPData['numpoints'] = 1 + (isset($this->SHPData['numpoints']) ? $this->SHPData['numpoints'] : 0); + break; + default: + $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType)); + + return; + } + $this->_adjustBBox($point); + } + + /** + * Deletes point from a record. + * + * @param int $pointIndex Point index + * @param int $partIndex Part index + */ + public function deletePoint($pointIndex = 0, $partIndex = 0) + { + switch ($this->shapeType) { + case 0: + //Don't delete anything + break; + case 1: + case 11: + case 21: + //Sets the value of the point to zero + $this->SHPData['x'] = 0.0; + $this->SHPData['y'] = 0.0; + if (in_array($this->shapeType, array(11, 21))) { + $this->SHPData['m'] = 0.0; + } + if (in_array($this->shapeType, array(11))) { + $this->SHPData['z'] = 0.0; + } + break; + case 3: + case 5: + case 13: + case 15: + case 23: + case 25: + //Deletes the point from the selected part, if exists + if (isset($this->SHPData['parts'][$partIndex]) && isset($this->SHPData['parts'][$partIndex]['points'][$pointIndex])) { + $count = count($this->SHPData['parts'][$partIndex]['points']) - 1; + for ($i = $pointIndex; $i < $count; ++$i) { + $this->SHPData['parts'][$partIndex]['points'][$i] = $this->SHPData['parts'][$partIndex]['points'][$i + 1]; + } + unset($this->SHPData['parts'][$partIndex]['points'][count($this->SHPData['parts'][$partIndex]['points']) - 1]); + + $this->SHPData['numparts'] = count($this->SHPData['parts']); + --$this->SHPData['numpoints']; + } + break; + case 8: + case 18: + case 28: + //Deletes the point, if exists + if (isset($this->SHPData['points'][$pointIndex])) { + $count = count($this->SHPData['points']) - 1; + for ($i = $pointIndex; $i < $count; ++$i) { + $this->SHPData['points'][$i] = $this->SHPData['points'][$i + 1]; + } + unset($this->SHPData['points'][count($this->SHPData['points']) - 1]); + + --$this->SHPData['numpoints']; + } + break; + default: + $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType)); + break; + } + } + + /** + * Returns length of content. + * + * @return int + */ + public function getContentLength() + { + // The content length for a record is the length of the record contents section measured in 16-bit words. + // one coordinate makes 4 16-bit words (64 bit double) + switch ($this->shapeType) { + case 0: + $result = 0; + break; + case 1: + $result = 10; + break; + case 21: + $result = 10 + 4; + break; + case 11: + $result = 10 + 8; + break; + case 3: + case 5: + $count = count($this->SHPData['parts']); + $result = 22 + 2 * $count; + for ($i = 0; $i < $count; ++$i) { + $result += 8 * count($this->SHPData['parts'][$i]['points']); + } + break; + case 23: + case 25: + $count = count($this->SHPData['parts']); + $result = 22 + (2 * 4) + 2 * $count; + for ($i = 0; $i < $count; ++$i) { + $result += (8 + 4) * count($this->SHPData['parts'][$i]['points']); + } + break; + case 13: + case 15: + $count = count($this->SHPData['parts']); + $result = 22 + (4 * 4) + 2 * $count; + for ($i = 0; $i < $count; ++$i) { + $result += (8 + 8) * count($this->SHPData['parts'][$i]['points']); + } + break; + case 8: + $result = 20 + 8 * count($this->SHPData['points']); + break; + case 28: + $result = 20 + (2 * 4) + (8 + 4) * count($this->SHPData['points']); + break; + case 18: + $result = 20 + (4 * 4) + (8 + 8) * count($this->SHPData['points']); + break; + default: + $result = false; + $this->setError(sprintf('The Shape Type "%s" is not supported.', $this->shapeType)); + break; + } + + return $result; + } + + private function _loadDBFData() + { + $this->DBFData = @dbase_get_record_with_names($this->DBFFile, $this->recordNumber); + unset($this->DBFData['deleted']); + } + + private function _saveDBFData() + { + if (count($this->DBFData) == 0) { + return; + } + unset($this->DBFData['deleted']); + if ($this->recordNumber <= dbase_numrecords($this->DBFFile)) { + if (!dbase_replace_record($this->DBFFile, array_values($this->DBFData), $this->recordNumber)) { + $this->setError('I wasn\'t possible to update the information in the DBF file.'); + } + } else { + if (!dbase_add_record($this->DBFFile, array_values($this->DBFData))) { + $this->setError('I wasn\'t possible to add the information to the DBF file.'); + } + } + } + + /** + * Sets error message. + * + * @param string $error + */ + public function setError($error) + { + $this->lastError = $error; + } + + /** + * Returns shape name. + * + * @return string + */ + public function getShapeName() + { + return Util::nameShape($this->shapeType); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/shapefile/src/Util.php b/phpMyAdmin/vendor/phpmyadmin/shapefile/src/Util.php new file mode 100755 index 0000000..f4e2878 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/shapefile/src/Util.php @@ -0,0 +1,118 @@ +. + * + * Copyright 2006-2007 Ovidio + * Copyright 2016 - 2017 Michal 膶iha艡 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, you can download one from + * https://www.gnu.org/copyleft/gpl.html. + */ + +namespace PhpMyAdmin\ShapeFile; + +class Util +{ + private static $little_endian = null; + + private static $shape_names = array( + 0 => 'Null Shape', + 1 => 'Point', + 3 => 'PolyLine', + 5 => 'Polygon', + 8 => 'MultiPoint', + 11 => 'PointZ', + 13 => 'PolyLineZ', + 15 => 'PolygonZ', + 18 => 'MultiPointZ', + 21 => 'PointM', + 23 => 'PolyLineM', + 25 => 'PolygonM', + 28 => 'MultiPointM', + 31 => 'MultiPatch', + ); + + /** + * Reads data. + * + * @param string $type type for unpack() + * @param string $data Data to process + * + * @return mixed + */ + public static function loadData($type, $data) + { + if ($data === false || strlen($data) == 0) { + return false; + } + $tmp = unpack($type, $data); + + return current($tmp); + } + + /** + * Changes endianity. + * + * @param string $binValue Binary value + * + * @return string + */ + public static function swap($binValue) + { + $result = $binValue[strlen($binValue) - 1]; + for ($i = strlen($binValue) - 2; $i >= 0; --$i) { + $result .= $binValue[$i]; + } + + return $result; + } + + /** + * Encodes double value to correct endianity. + * + * @param float $value Value to pack + * + * @return string + */ + public static function packDouble($value) + { + $bin = pack('d', (float) $value); + + if (is_null(self::$little_endian)) { + self::$little_endian = (pack('L', 1) == pack('V', 1)); + } + + if (self::$little_endian) { + return $bin; + } + + return self::swap($bin); + } + + /** + * Returns shape name. + * + * @param int $type + * + * @return string + */ + public static function nameShape($type) + { + if (isset(self::$shape_names[$type])) { + return self::$shape_names[$type]; + } + + return sprintf('Shape %d', $type); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/CHANGELOG.md b/phpMyAdmin/vendor/phpmyadmin/sql-parser/CHANGELOG.md new file mode 100755 index 0000000..0651d9c --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/CHANGELOG.md @@ -0,0 +1,407 @@ +# Change Log + +## [4.7.3] - 2021-12-08 + +- Fixed BufferedQuery when it has an odd number of backslashes in the end (#340) +- Fixed the issue that ignored the body tokens when creating views with union (#343) +- Fixed parser errors on "ALTER TABLE" statements to add columns with SET type (#168) +- Fixed parser errors for "ALTER USER" with options (#342) +- Fixed handling of the procedures and functions's options where part of the body (#339) +- Fix PHP notice "Undefined index: name in src/Components/Key.php#206" for table keys using functions (#347) +- Fix MySQL 8.0 table structure KEY expression not recognized (#347) +- Fix KEY order (ASC/DESC) not part of the KEY definition (#296) +- Fix missing KEY options for MySQL and MariaDB (#348) +- Fix validation error when using ENFORCED option (#341) + +## [4.7.2] - 2021-02-05 + +- Added check for quoted symbol to avoid parser error in case of keyword (#317) +- Adjust PHP version constraint to not support PHP 8.0 on the 4.7 series (5.x series supports it) + +## [4.7.1] - 2020-10-15 + +* Fix array_key_exists warning when parsing a "DEFAULT FALSE" token (#299) + +## [4.7.0] - 2020-10-08 + +* EXISTS is also a function. (#297) +* Remove some useless dev-dependencies +* Fix lexer to not allow numbers with letters (#300) +* Add support for INVISIBLE keyword (#292) +* Fix the "$" might be a character used in a name (#301) +* Fix use stream_select instead of non-blocking STDIN (#309) +* Add select validation to a create view statement (#310) + +## [4.6.1] - 2020-03-20 + +* Revert some changes with the understanding of ANSI_QUOTES mode and identifiers +* Suggest motranslator 4.0 in README + +## [4.6.0] - 2020-03-20 + +* Stop instanciating an object to check its class name. (#290) +* Replace sscanf by equivalent native PHP functions because sscanf can be disabled for security reasons. (#270) +* Allow phpunit 7 +* Fix for php error when "INSERT INTO x SET a = 1" is "INSERT INTO x SET = 1" (#295) +* Fixed lexer fails to detect "*" as a wildcard (#288) +* Fixed ANSI_QUOTES support (#284) +* Fixed parser mistakes with comments (#156) + +## [4.5.0] - 2020-01-07 + +* Fix ALTER TABLE ... PRIMARY/UNIQUE KEY results in error (#267) +* Prevent overwrite of offset in Limit clause by parenthesis (#275) +* Allow SCHEMA to be used in CREATE Database statement (#231) +* Add missing options in SET statement (#255) +* Add support for DROP USER statement (#259) +* Fix php error "undefined index" when replacing a non existing clause (#249) + +## [4.4.0] - 2019-11-12 + +* Fix for PHP deprecations messages about implode for php 7.4+ (#258) +* Parse CHECK keyword on table definition (#264) +* Parse truncate statement (#221) +* Fix wrong parsing of partitions (#265) + +## [4.3.2] - 2019-06-03 + +* Fix redundant whitespaces in build() outputs (#228) +* Fix incorrect error on DEFAULT keyword in ALTER operation (#229) +* Fix incorrect outputs from Query::getClause (#233) +* Add support for reading an SQL file from stdin +* Fix for missing tokenize-query in Composer's vendor/bin/ directory +* Fix for PHP warnings with an incomplete CASE expression (#241) +* Fix for error message with multiple CALL statements (#223) +* Recognize the question mark character as a parameter (#242) + +## [4.3.1] - 2019-01-05 + +* Fixed incorrect error thrown on DEFAULT keyword in ALTER statement (#218) + +## [4.3.0] - 2018-12-25 + +* Add support for aliases on CASE expressions (#162 and #192) +* Add support for INDEX hints in SELECT statement (#199) +* Add support for LOCK and UNLOCK TABLES statement (#180) +* Add detection of extraneous comma in UPDATE statement (#160) +* Add detection of a missing comma between two ALTER operations (#189) +* Add missing support for STRAIGHT_JOIN (#196) +* Add support for end options in SET statement (#190) +* Fix building of RENAME statements (#201) +* Add support for PURGE statements (#207) +* Add support for COLLATE keyword (#190) + +## [4.2.5] - 2018-10-31 + +* Fix issue with CREATE OR REPLACE VIEW. + +## [4.2.4] - 2017-12-06 + +* Fix parsing of CREATE TABLE with per field COLLATE. +* Improved Context::loadClosest to better deal with corner cases. +* Localization updates. + +## [4.2.3] - 2017-10-10 + +* Make mbstring extension optional (though Symfony polyfill). +* Fixed build CREATE TABLE query with PARTITIONS having ENGINE but not VALUES. + +## [4.2.2] - 2017-09-28 + +* Added support for binding parameters. + +## [4.2.1] - 2017-09-08 + +* Fixed minor bug in Query::getFlags. +* Localization updates. + +## [4.2.0] - 2017-08-30 + +* Initial support for MariaDB SQL contexts. +* Add support for MariaDB 10.3 INTERSECT and EXCEPT. + +## [4.1.10] - 2017-08-21 + +* Use custom LoaderException for context loading errors. + +## [4.1.9] - 2017-07-12 + +* Various code cleanups. +* Improved error handling of several invalid statements. + +## [4.1.8] - 2017-07-09 + +* Fixed parsing SQL comment at the end of query. +* Improved handing of non utf-8 strings. +* Added query flag for SET queries. + +## [4.1.7] - 2017-06-06 + +* Fixed setting combination SQL Modes. + +## [4.1.6] - 2017-06-01 + +* Fixed building query with GROUP BY clause. + +## [4.1.5] - 2017-05-15 + +* Fixed invalid lexing of queries with : in strings. +* Properly handle maximal length of delimiter. + +## [4.1.4] - 2017-05-05 + +* Fixed wrong extract of string tokens with escaped characters. +* Properly handle lowercase begin statement. + +## [4.1.3] - 2017-04-06 + +* Added support for DELETE ... JOIN clauses. +* Changed BufferedQuery to include comments in output. +* Fixed parsing of inline comments. + +## [4.1.2] - 2017-02-20 + +* Coding style improvements. +* Chinese localization. +* Improved order validatin for JOIN clauses. +* Improved pretty printing of JOIN clauses. +* Added support for LOAD DATA statements. + +## [4.1.1] - 2017-02-07 + +* Localization using phpmyadmin/motranslator is now optional. +* Improved testsuite. +* Better handling of non upper cased not reserved keywords. +* Minor performance and coding style improvements. + +## [4.1.0] - 2017-01-23 + +* Use phpmyadmin/motranslator to localize messages. + +## [4.0.1] - 2017-01-23 + +* Fixed CLI wrappers for new API. +* Fixed README for new API. + +## [4.0.0] - 2017-01-23 + +* Added PhpMyAdmin namespace prefix to follow PSR-4. + +## [3.4.17] - 2017-01-20 + +* Coding style fixes. +* Fixed indentation in HTML formatting. +* Fixed parsing of unterminated variables. +* Improved comments lexing. + +## [3.4.16] - 2017-01-06 + +* Coding style fixes. +* Properly handle operators AND, NOT, OR, XOR, DIV, MOD + +## [3.4.15] - 2017-01-02 + +* Fix return value of Formatter.toString() when type is text +* Fix parsing of FIELDS and LINES options in SELECT..INTO +* PHP 7.2 compatibility. +* Better parameter passing to query formatter. + +## [3.4.14] - 2016-11-30 + +* Improved parsing of UNION queries. +* Recognize BINARY function. + +## [3.4.13] - 2016-11-15 + +* Fix broken incorrect clause order detection for Joins. +* Add parsing of end options in Select statements. + +## [3.4.12] - 2016-11-09 + +* Added verification order of SELECT statement clauses. + +## [3.4.11] - 2016-10-25 + +* Fixed parsing of ON UPDATE option in field definition of TIMESTAMP type with precision +* Fixed parsing of NATURAL JOIN, CROSS JOIN and related joins. +* Fixed parsing of BEGIN/END labels. + +## [3.4.10] - 2016-10-03 + +* Fixed API regression on DELETE statement + +## [3.4.9] - 2016-10-03 + +* Added support for CASE expressions +* Support for parsing and building DELETE statement +* Support for parsing subqueries in FROM clause + +## [3.4.8] - 2016-09-22 + +* No change release to sync GitHub releases with Packagist + +## [3.4.7] - 2016-09-20 + +* Fix parsing of DEFINER without backquotes +* Fixed escaping HTML entities in HTML formatter +* Fixed escaping of control chars in CLI formatter + +## [3.4.6] - 2016-09-13 + +* Fix parsing of REPLACE INTO ... +* Fix parsing of INSERT ... ON DUPLICATE KEY UPDATE ... +* Extended testsuite +* Re-enabled PHP 5.3 support + +## [3.4.5] - 2016-09-13 + +* Fix parsing of INSERT...SELECT and INSERT...SET syntax +* Fix parsing of CREATE TABLE ... PARTITION +* Fix parsing of SET CHARACTER SET, CHARSET, NAMES +* Add Support for 'CREATE TABLE `table_copy` LIKE `table` + +## [3.4.4] - 2016-04-26 + +* Add support for FULL OUTER JOIN + +## [3.4.3] - 2016-04-19 + +* Fix parsing of query with \ + +## [3.4.2] - 2016-04-07 + +* Recognize UNION DISTINCT +* Recognize REGEXP and RLIKE operators + +## [3.4.1] - 2016-04-06 + +* Add FULLTEXT and SPATIAL keywords +* Properly parse CREATE TABLE [AS] SELECT +* Fix parsing of table with DEFAULT and COMMENT + +## [3.4.0] - 2016-02-23 + +* Fix parsing DEFAULT value on CREATE +* Fix parsing of ALTER VIEW + +## [3.3.1] - 2016-02-12 + +* Condition: Allow keyword `INTERVAL`. + +## [3.3.0] - 2016-02-12 + +* Expression: Refactored parsing options. + +## [3.2.0] - 2016-02-11 + +* Context: Added custom mode that avoids escaping when possible. + +## [3.1.0] - 2016-02-10 + +* ArrayObj: Handle more complex expressions in arrays. +* BufferedQuery: Backslashes in comments escaped characters in comments. +* Condition: Allow `IF` in conditions. +* Context: Add `;` as operator. +* Context: Updated contexts to contain `BIT` data type. +* CreateStatement: The `DEFAULT` option may be an expression. +* DescribeStatement: Added `DESC` as alias for `DESCRIBE`. +* Expression: Rewrote expression parsing. +* Misc: Added PHPUnit's Code Coverage 3.0 as a dependency. +* Misc: Added support for PHP 5.4 back. +* Misc: Removed dependency to Ctype. +* Misc: Repository transferred from @udan11 to @phpMyAdmin. +* Misc: Updated `.gitignore` to ignore `composer.lock`. +* Misc: Updated Composer and Travis configuration for PHP 7 and PHPUnit 5. +* Tools: Documented tags in `ContextGenerator`. + +## [3.0.8] - 2015-12-18 + +* Allow `NULL` in expressions. +* Downgraded PHPUnit to 4.8. Removed old PHP versions. +* Updated PHPUnit to 5.1 and fixed some of the tests. +* Added `UNION ALL` as a type of `UNION`. +* Expressions are permitted in `SET` operations. +* Added `STRAIGHT_JOIN` as a known type of join. +* Added missing definitions for `MATCH` and `AGAINST`. +* Added missing statement (`FLUSH` and `DEALLOCATE`). + +## [3.0.7] - 2015-11-12 + +* Expressions may begin with a function that is also a reserved keyword (e.g. `IF`). + +## [3.0.6] - 2015-11-12 + +* Fixed a bug where formatter split the function name and the parameters list. + +## [3.0.5] - 2015-11-08 + +* Add GRANT as known statement. +* Use JOIN expressions for flag detection. +* Fix the order of clauses in SELECT statements involving UNIONs. +* Added dummy parsers for CREATE USER and SET PASSWORD statements. +* Accept NOT operator in conditions. +* Fixed DELIMITER statements in BufferedQuery. +* Added INSERT statement builder. + +## [3.0.4] - 2015-10-21 + +* Fix error message in `SqlParser\Components\OptionsArray`. + +## [3.0.3] - 2015-10-10 + +* Avoid building a field multiple times if clause has synonyms. + +## [3.0.2] - 2015-10-10 + +* Add EXISTS as an acceptable keyword in conditions. + +## [3.0.1] - 2015-10-06 + +* Handle backslashes separately for `SqlParser\Utils\BufferedQuery`. Fixes a bug where backslashes in combination with strings weren't handled properly. + +## [3.0.0] - 2015-10-02 + +__Breaking changes:__ + +* `SqlParser\Components\Reference::$table` is now an instance of `SqlParser\Components\Expression` to support references from other tables. + +## [2.1.3] - 2015-10-02 + +* Add definitions for all JOIN clauses. + +## [2.1.2] - 2015-10-02 + +* Properly parse options when the value of the option is '='. + +## [2.1.1] - 2015-09-30 + +* Only RANGE and LIST type partitions support VALUES. + +## [2.1.0] - 2015-09-30 + +* Added utilities for handling tokens and tokens list. + +## [2.0.3] - 2015-09-30 + +* Added missing NOT IN operator. This caused troubles when parsing conditions that contained the `NOT IN` operator. + +## [2.0.2] - 2015-09-30 + +* Added support for `OUTER` as an optional keyword in joins. + +## [2.0.1] - 2015-09-30 + +* Fixed a bug related to (sub)partitions options not being included in the built component. Also, the option `ENGINE` was unrecognized. + +## [2.0.0] - 2015-09-25 + +* Better parsing for CREATE TABLE statements (related to breaking change 1). +* Added support for JSON data type. +* Refactoring and minor documentation improvements. + +__Breaking changes:__ +* `SqlParser\Components\Key::$columns` is now an array of arrays. Each array must contain a `name` key which represents the name of the column and an optional `length` key which represents the length of the column. + +## [1.0.0] - 2015-08-20 + +* First release of this library. diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/CODE_OF_CONDUCT.md b/phpMyAdmin/vendor/phpmyadmin/sql-parser/CODE_OF_CONDUCT.md new file mode 100755 index 0000000..4c40291 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at info@phpmyadmin.net. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/CONTRIBUTING.md b/phpMyAdmin/vendor/phpmyadmin/sql-parser/CONTRIBUTING.md new file mode 100755 index 0000000..f89dacb --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/CONTRIBUTING.md @@ -0,0 +1,53 @@ +# Contributing to SQL Parser + +## Reporting issues + +Our issue tracker is hosted at GitHub: + +https://github.com/phpmyadmin/sql-parser/issues + +Please search for existing issues before reporting new ones. + +## Working with Git checkout + +The dependencies are managed by Composer, to get them all installed (or update +on consequent runs) do: + +``` +composer update +``` + +## Submitting patches + +Please submit your patches using GitHub pull requests, this allows us to review +them and to run automated tests on the code. + +## Coding standards + +We do follow PSR-1 and PSR-2 coding standards. + +You can use phpcbf to fix the code to match our expectations: + +``` +./vendor/bin/phpcbf +``` + +## Testsuite + +Our code comes with quite comprehensive testsuite, it is automatically executed +on every commit and pull request, you can also run it locally: + +``` +./vendor/bin/phpunit +``` + +The testsuite relies on fixtures of parser states, in case you need to +regenerate some of these there are helper scripts in tools directory: + +``` +# Remove file you want to regenerate +rm tests/data/parser/parse.out + +# Run the generator located in the tools directory +./tools/run_generators.sh +``` diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/LICENSE.txt b/phpMyAdmin/vendor/phpmyadmin/sql-parser/LICENSE.txt new file mode 100755 index 0000000..d159169 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/README.md b/phpMyAdmin/vendor/phpmyadmin/sql-parser/README.md new file mode 100755 index 0000000..d805cf5 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/README.md @@ -0,0 +1,132 @@ +# SQL Parser + +A validating SQL lexer and parser with a focus on MySQL dialect. + +## Code status + +![Tests](https://github.com/phpmyadmin/sql-parser/workflows/Run%20tests/badge.svg?branch=QA) +[![Code Coverage](https://scrutinizer-ci.com/g/phpmyadmin/sql-parser/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/phpmyadmin/sql-parser/?branch=master) +[![codecov.io](https://codecov.io/github/phpmyadmin/sql-parser/coverage.svg?branch=QA)](https://codecov.io/github/phpmyadmin/sql-parser?branch=QA) +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/phpmyadmin/sql-parser/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/phpmyadmin/sql-parser/?branch=master) +[![Translation status](https://hosted.weblate.org/widgets/phpmyadmin/-/svg-badge.svg)](https://hosted.weblate.org/engage/phpmyadmin/?utm_source=widget) +[![Packagist](https://img.shields.io/packagist/dt/phpmyadmin/sql-parser.svg)](https://packagist.org/packages/phpmyadmin/sql-parser) +[![Open Source Helpers](https://www.codetriage.com/phpmyadmin/sql-parser/badges/users.svg)](https://www.codetriage.com/phpmyadmin/sql-parser) + +## Installation + +Please use [Composer][1] to install: + +```sh +composer require phpmyadmin/sql-parser +``` + +## Documentation + +The API documentation is available at +. + +## Usage + +### Command line utilities + +Command line utility to syntax highlight SQL query: + +```sh +./vendor/bin/highlight-query --query "SELECT 1" +``` + +Command line utility to lint SQL query: + +```sh +./vendor/bin/lint-query --query "SELECT 1" +``` + +Command line utility to tokenize SQL query: + +```sh +./vendor/bin/tokenize-query --query "SELECT 1" +``` + +All commands are able to parse input from stdin (standard in), such as: + +```sh +echo "SELECT 1" | ./vendor/bin/highlight-query +cat example.sql | ./vendor/bin/lint-query +``` + +### Formatting SQL query + +```php +echo PhpMyAdmin\SqlParser\Utils\Formatter::format($query, array('type' => 'html')); +``` + +### Discoverying query type + +```php +use PhpMyAdmin\SqlParser\Parser; +use PhpMyAdmin\SqlParser\Utils\Query; + +$query = 'OPTIMIZE TABLE tbl'; +$parser = new Parser($query); +$flags = Query::getFlags($parser->statements[0]); + +echo $flags['querytype']; +``` + +### Parsing and building SQL query + +```php +require __DIR__ . '/vendor/autoload.php'; + +$query1 = "select * from a"; +$parser = new PhpMyAdmin\SqlParser\Parser($query1); + +// inspect query +var_dump($parser->statements[0]); // outputs object(PhpMyAdmin\SqlParser\Statements\SelectStatement) + +// modify query by replacing table a with table b +$table2 = new \PhpMyAdmin\SqlParser\Components\Expression("", "b", "", ""); +$parser->statements[0]->from[0] = $table2; + +// build query again from an array of object(PhpMyAdmin\SqlParser\Statements\SelectStatement) to a string +$statement = $parser->statements[0]; +$query2 = $statement->build(); +var_dump($query2); // outputs string(19) "SELECT * FROM `b` " + +// Change SQL mode +PhpMyAdmin\SqlParser\Context::setMode('ANSI_QUOTES'); + +// build the query again using different quotes +$query2 = $statement->build(); +var_dump($query2); // outputs string(19) "SELECT * FROM "b" " +``` + +## Localization + +You can localize error messages installing `phpmyadmin/motranslator` version `4.0` or newer: +```sh +composer require phpmyadmin/motranslator:^4.0 +``` + +The locale is automatically detected from your environment, you can also set a different locale + +**From cli**: +```sh +LC_ALL=pl ./vendor/bin/lint-query --query "SELECT 1" +``` + +**From php**: +```php +require __DIR__ . '/vendor/autoload.php'; + +$GLOBALS['lang'] = 'pl'; + +$query1 = "select * from a"; +$parser = new PhpMyAdmin\SqlParser\Parser($query1); +``` + +## More information + +This library was originally created during the Google Summer of Code 2015 and has been used by phpMyAdmin since version 4.5. + +[1]:https://getcomposer.org/ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/highlight-query b/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/highlight-query new file mode 100755 index 0000000..577e4fb --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/highlight-query @@ -0,0 +1,29 @@ +#!/usr/bin/env php +runHighlight()); diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/lint-query b/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/lint-query new file mode 100755 index 0000000..67e7114 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/lint-query @@ -0,0 +1,30 @@ +#!/usr/bin/env php +runLint()); + diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/tokenize-query b/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/tokenize-query new file mode 100755 index 0000000..f32a4e0 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/bin/tokenize-query @@ -0,0 +1,29 @@ +#!/usr/bin/env php +runTokenize()); diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/composer.json b/phpMyAdmin/vendor/phpmyadmin/sql-parser/composer.json new file mode 100755 index 0000000..be4612f --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/composer.json @@ -0,0 +1,48 @@ +{ + "name": "phpmyadmin/sql-parser", + "description": "A validating SQL lexer and parser with a focus on MySQL dialect.", + "license": "GPL-2.0-or-later", + "keywords": ["sql", "lexer", "parser", "analysis"], + "homepage": "https://github.com/phpmyadmin/sql-parser", + "authors": [ + { + "name": "The phpMyAdmin Team", + "email": "developers@phpmyadmin.net", + "homepage": "https://www.phpmyadmin.net/team/" + } + ], + "support": { + "issues": "https://github.com/phpmyadmin/sql-parser/issues", + "source": "https://github.com/phpmyadmin/sql-parser" + }, + "require": { + "php": "^5.3.0 || ^7.0", + "symfony/polyfill-mbstring": "^1.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8 || ~5.7 || ~6.5 || ^7.0", + "squizlabs/php_codesniffer": "~2.9 || ~3.4" + }, + "conflict": { + "phpmyadmin/motranslator": "<3.0" + }, + "suggest": { + "ext-mbstring": "For best performance", + "phpmyadmin/motranslator": "Translate messages to your favorite locale" + }, + "bin": [ + "bin/highlight-query", + "bin/lint-query", + "bin/tokenize-query" + ], + "autoload": { + "psr-4": { + "PhpMyAdmin\\SqlParser\\": "src" + } + }, + "autoload-dev": { + "psr-4": { + "PhpMyAdmin\\SqlParser\\Tests\\": "tests" + } + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/af/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/af/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..51f466c Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/af/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ar/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ar/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..71c7686 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ar/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ast/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ast/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..a4ef8de Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ast/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/az/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/az/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..013c273 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/az/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/be/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/be/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..08adf11 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/be/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/be@latin/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/be@latin/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..f985708 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/be@latin/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bg/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bg/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..2201811 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bg/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bn/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bn/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..30c0d62 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bn/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/br/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/br/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..1efc086 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/br/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/brx/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/brx/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..5cee1dd Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/brx/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bs/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bs/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..831fa44 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/bs/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ca/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ca/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..4df19d2 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ca/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ckb/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ckb/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..3ea16c3 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ckb/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/cs/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/cs/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..d90e509 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/cs/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/cy/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/cy/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..b57e1d0 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/cy/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/da/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/da/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..6332c56 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/da/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/de/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/de/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..bc7e60a Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/de/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/el/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/el/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..8a6ceb3 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/el/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/en_GB/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/en_GB/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..40ba959 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/en_GB/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/eo/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/eo/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..3f4f65a Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/eo/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/es/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/es/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..aec2a26 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/es/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/et/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/et/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..45098b2 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/et/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/eu/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/eu/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..831ffa8 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/eu/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fa/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fa/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..131b094 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fa/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fi/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fi/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..fa60e3e Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fi/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fr/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fr/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..f348d3e Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fr/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fy/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fy/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..94ab1f1 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/fy/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/gl/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/gl/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..80242e2 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/gl/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/gu/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/gu/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..84b897d Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/gu/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/he/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/he/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..2fda426 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/he/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hi/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hi/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..781fe5e Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hi/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hr/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hr/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..265163f Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hr/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hu/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hu/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..27db8b5 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hu/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hy/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hy/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..ba09bc9 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/hy/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ia/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ia/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..acfca6f Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ia/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/id/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/id/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..ca04a13 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/id/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/it/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/it/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..05b2da8 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/it/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ja/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ja/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..836f25d Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ja/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ka/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ka/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..67b95ea Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ka/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/kk/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/kk/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..86d6c2e Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/kk/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/km/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/km/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..0701c80 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/km/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/kn/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/kn/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..6ff4ed9 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/kn/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ko/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ko/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..c9f39f3 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ko/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ksh/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ksh/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..3d6d131 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ksh/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ky/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ky/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..e455f0a Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ky/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/li/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/li/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..487866f Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/li/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/lt/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/lt/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..5d19aea Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/lt/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/lv/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/lv/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..f288727 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/lv/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/mk/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/mk/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..e622229 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/mk/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ml/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ml/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..5fb194e Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ml/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/mn/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/mn/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..d38bdc1 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/mn/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ms/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ms/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..87965e1 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ms/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/nb/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/nb/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..de94a72 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/nb/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ne/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ne/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..fae4322 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ne/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/nl/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/nl/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..b002cfd Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/nl/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pa/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pa/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..dfa4270 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pa/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pl/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pl/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..ba6d7f7 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pl/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pt/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pt/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..d540173 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pt/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pt_BR/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pt_BR/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..8a05f24 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/pt_BR/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ro/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ro/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..9cf4b16 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ro/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ru/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ru/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..550cd11 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ru/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/si/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/si/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..ce5d946 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/si/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sk/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sk/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..eb55db6 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sk/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sl/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sl/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..9f2f909 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sl/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sq/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sq/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..06e2f54 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sq/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sqlparser.pot b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sqlparser.pot new file mode 100755 index 0000000..0d1e1e2 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sqlparser.pot @@ -0,0 +1,217 @@ +# phpMyAdmin SQL parser translation. +# Copyright (C) 2015 - 2017 phpMyAdmin devel team +# This file is distributed under the same license as the SQL parser package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: SQL parser 0\n" +"Report-Msgid-Bugs-To: translators@phpmyadmin.net\n" +"POT-Creation-Date: 2017-08-21 12:54+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: src/Component.php:43 src/Component.php:63 +msgid "Not implemented yet." +msgstr "" + +#: src/Components/AlterOperation.php:241 src/Statement.php:334 +msgid "" +"A new statement was found, but no delimiter between it and the previous one." +msgstr "" + +#: src/Components/AlterOperation.php:253 +msgid "Unrecognized alter operation." +msgstr "" + +#: src/Components/Array2d.php:88 +#, php-format +msgid "%1$d values were expected, but found %2$d." +msgstr "" + +#: src/Components/Array2d.php:111 +msgid "An opening bracket followed by a set of values was expected." +msgstr "" + +#: src/Components/ArrayObj.php:114 src/Components/CreateDefinition.php:201 +msgid "An opening bracket was expected." +msgstr "" + +#: src/Components/CaseExpression.php:135 src/Components/CaseExpression.php:164 +#: src/Components/CaseExpression.php:176 src/Components/CaseExpression.php:190 +#: src/Statements/DeleteStatement.php:227 +#: src/Statements/DeleteStatement.php:244 +#: src/Statements/DeleteStatement.php:292 +#: src/Statements/DeleteStatement.php:303 +#: src/Statements/DeleteStatement.php:333 +#: src/Statements/DeleteStatement.php:344 +#: src/Statements/InsertStatement.php:189 +#: src/Statements/InsertStatement.php:217 src/Statements/LoadStatement.php:258 +#: src/Statements/ReplaceStatement.php:155 +#: src/Statements/ReplaceStatement.php:182 +msgid "Unexpected keyword." +msgstr "" + +#: src/Components/CaseExpression.php:199 +msgid "Unexpected end of CASE expression" +msgstr "" + +#: src/Components/CreateDefinition.php:223 +msgid "" +"A symbol name was expected! A reserved keyword can not be used as a column " +"name without backquotes." +msgstr "" + +#: src/Components/CreateDefinition.php:237 +msgid "A symbol name was expected!" +msgstr "" + +#: src/Components/CreateDefinition.php:270 +msgid "A comma or a closing bracket was expected." +msgstr "" + +#: src/Components/CreateDefinition.php:286 +msgid "A closing bracket was expected." +msgstr "" + +#: src/Components/DataType.php:123 +msgid "Unrecognized data type." +msgstr "" + +#: src/Components/Expression.php:244 src/Components/Expression.php:394 +msgid "An alias was expected." +msgstr "" + +#: src/Components/Expression.php:332 src/Components/Expression.php:351 +#: src/Components/Expression.php:383 +msgid "An alias was previously found." +msgstr "" + +#: src/Components/Expression.php:364 +msgid "Unexpected dot." +msgstr "" + +#: src/Components/ExpressionArray.php:102 +msgid "An expression was expected." +msgstr "" + +#: src/Components/Limit.php:86 src/Components/Limit.php:108 +msgid "An offset was expected." +msgstr "" + +#: src/Components/OptionsArray.php:143 +#, php-format +msgid "This option conflicts with \"%1$s\"." +msgstr "" + +#: src/Components/RenameOperation.php:109 +msgid "The old name of the table was expected." +msgstr "" + +#: src/Components/RenameOperation.php:119 +msgid "Keyword \"TO\" was expected." +msgstr "" + +#: src/Components/RenameOperation.php:135 +msgid "The new name of the table was expected." +msgstr "" + +#: src/Components/RenameOperation.php:153 +msgid "A rename operation was expected." +msgstr "" + +#: src/Components/SetOperation.php:117 +msgid "Missing expression." +msgstr "" + +#: src/Lexer.php:237 +msgid "Unexpected character." +msgstr "" + +#: src/Lexer.php:278 +msgid "Expected whitespace(s) before delimiter." +msgstr "" + +#: src/Lexer.php:296 src/Lexer.php:314 +msgid "Expected delimiter." +msgstr "" + +#: src/Lexer.php:843 +#, php-format +msgid "Ending quote %1$s was expected." +msgstr "" + +#: src/Lexer.php:884 +msgid "Variable name was expected." +msgstr "" + +#: src/Parser.php:423 +msgid "Unexpected beginning of statement." +msgstr "" + +#: src/Parser.php:442 +msgid "Unrecognized statement type." +msgstr "" + +#: src/Parser.php:527 +msgid "No transaction was previously started." +msgstr "" + +#: src/Statement.php:242 src/Statements/DeleteStatement.php:254 +#: src/Statements/DeleteStatement.php:306 +#: src/Statements/InsertStatement.php:226 +#: src/Statements/InsertStatement.php:246 src/Statements/LoadStatement.php:261 +#: src/Statements/LoadStatement.php:291 src/Statements/LoadStatement.php:310 +#: src/Statements/ReplaceStatement.php:190 +msgid "Unexpected token." +msgstr "" + +#: src/Statement.php:306 +msgid "This type of clause was previously parsed." +msgstr "" + +#: src/Statement.php:366 +msgid "Unrecognized keyword." +msgstr "" + +#: src/Statement.php:377 +msgid "Keyword at end of statement." +msgstr "" + +#: src/Statement.php:503 +msgid "Unexpected ordering of clauses." +msgstr "" + +#: src/Statements/CreateStatement.php:375 +msgid "The name of the entity was expected." +msgstr "" + +#: src/Statements/CreateStatement.php:430 +msgid "A table name was expected." +msgstr "" + +#: src/Statements/CreateStatement.php:438 +msgid "At least one column definition was expected." +msgstr "" + +#: src/Statements/CreateStatement.php:550 +msgid "A \"RETURNS\" keyword was expected." +msgstr "" + +#: src/Statements/DeleteStatement.php:314 +msgid "This type of clause is not valid in Multi-table queries." +msgstr "" + +#: tests/Lexer/LexerTest.php:19 tests/Parser/ParserTest.php:58 +msgid "error #1" +msgstr "" + +#: tests/Lexer/LexerTest.php:46 tests/Parser/ParserTest.php:80 +msgid "strict error" +msgstr "" diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sr/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sr/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..815f3d4 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sr/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sr@latin/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sr@latin/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..a9592f7 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sr@latin/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sv/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sv/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..d0b01c1 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/sv/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ta/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ta/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..406863d Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ta/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/te/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/te/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..7ca8ae7 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/te/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/th/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/th/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..42a74f8 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/th/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tk/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tk/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..91144a3 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tk/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tr/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tr/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..c684db5 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tr/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tt/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tt/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..ccddede Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/tt/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ug/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ug/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..d8bd2e8 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ug/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uk/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uk/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..0503299 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uk/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ur/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ur/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..81aea0b Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/ur/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uz/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uz/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..9f13bd4 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uz/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uz@latin/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uz@latin/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..ddb2b40 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/uz@latin/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/vi/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/vi/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..cf65110 Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/vi/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/vls/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/vls/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..30fcbed Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/vls/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/zh_CN/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/zh_CN/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..700ea4a Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/zh_CN/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/zh_TW/LC_MESSAGES/sqlparser.mo b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/zh_TW/LC_MESSAGES/sqlparser.mo new file mode 100755 index 0000000..ebe8e5c Binary files /dev/null and b/phpMyAdmin/vendor/phpmyadmin/sql-parser/locale/zh_TW/LC_MESSAGES/sqlparser.mo differ diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/phpunit.xml.dist b/phpMyAdmin/vendor/phpmyadmin/sql-parser/phpunit.xml.dist new file mode 100755 index 0000000..c47097d --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/phpunit.xml.dist @@ -0,0 +1,46 @@ + + + + + + + + ./tests/Builder + + + ./tests/Components + + + ./tests/Lexer + + + ./tests/Misc + + + ./tests/Parser + + + ./tests/Utils + + + + + src/ + + + + + + + + diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Component.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Component.php new file mode 100755 index 0000000..bb230c2 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Component.php @@ -0,0 +1,77 @@ + array( + 1, + 'var' + ), + 'CHARSET' => array( + 1, + 'var' + ), + 'DEFAULT CHARACTER SET' => array( + 1, + 'var' + ), + 'DEFAULT CHARSET' => array( + 1, + 'var' + ), + 'UPGRADE' => array( + 1, + 'var' + ), + 'COLLATE' => array( + 2, + 'var' + ), + 'DEFAULT COLLATE' => array( + 2, + 'var' + ) + ); + + /** + * All table options. + * + * @var array + */ + public static $TABLE_OPTIONS = array( + 'ENGINE' => array( + 1, + 'var=' + ), + 'AUTO_INCREMENT' => array( + 1, + 'var=' + ), + 'AVG_ROW_LENGTH' => array( + 1, + 'var' + ), + 'MAX_ROWS' => array( + 1, + 'var' + ), + 'ROW_FORMAT' => array( + 1, + 'var' + ), + 'COMMENT' => array( + 1, + 'var' + ), + 'ADD' => 1, + 'ALTER' => 1, + 'ANALYZE' => 1, + 'CHANGE' => 1, + 'CHARSET' => 1, + 'CHECK' => 1, + 'COALESCE' => 1, + 'CONVERT' => 1, + 'DEFAULT CHARSET' => 1, + 'DISABLE' => 1, + 'DISCARD' => 1, + 'DROP' => 1, + 'ENABLE' => 1, + 'IMPORT' => 1, + 'MODIFY' => 1, + 'OPTIMIZE' => 1, + 'ORDER' => 1, + 'PARTITION' => 1, + 'REBUILD' => 1, + 'REMOVE' => 1, + 'RENAME' => 1, + 'REORGANIZE' => 1, + 'REPAIR' => 1, + 'UPGRADE' => 1, + + 'COLUMN' => 2, + 'CONSTRAINT' => 2, + 'DEFAULT' => 2, + 'TO' => 2, + 'BY' => 2, + 'FOREIGN' => 2, + 'FULLTEXT' => 2, + 'KEY' => 2, + 'KEYS' => 2, + 'PARTITIONING' => 2, + 'PRIMARY KEY' => 2, + 'SPATIAL' => 2, + 'TABLESPACE' => 2, + 'INDEX' => 2, + + 'CHARACTER SET' => 3, + ); + + /** + * All user options. + * + * @var array + */ + public static $USER_OPTIONS = array( + 'ATTRIBUTE' => array( + 1, + 'var' + ), + 'COMMENT' => array( + 1, + 'var' + ), + 'REQUIRE' => array( + 1, + 'var' + ), + 'BY' => array( + 2, + 'expr' + ), + 'PASSWORD' => array( + 2, + 'var' + ), + 'WITH' => array( + 2, + 'var' + ), + + 'ACCOUNT' => 1, + 'DEFAULT' => 1, + + 'LOCK' => 2, + 'UNLOCK' => 2, + + 'IDENTIFIED' => 3, + ); + + /** + * All view options. + * + * @var array + */ + public static $VIEW_OPTIONS = array( + 'AS' => 1, + ); + + /** + * Options of this operation. + * + * @var OptionsArray + */ + public $options; + + /** + * The altered field. + * + * @var Expression + */ + public $field; + + /** + * Unparsed tokens. + * + * @var Token[]|string + */ + public $unknown = array(); + + /** + * Constructor. + * + * @param OptionsArray $options options of alter operation + * @param Expression $field altered field + * @param array $unknown unparsed tokens found at the end of operation + */ + public function __construct( + $options = null, + $field = null, + $unknown = array() + ) { + $this->options = $options; + $this->field = $field; + $this->unknown = $unknown; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return AlterOperation + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * Counts brackets. + * + * @var int + */ + $brackets = 0; + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------------[ options ]---------------------> 1 + * + * 1 ----------------------[ field ]----------------------> 2 + * + * 2 -------------------------[ , ]-----------------------> 0 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping comments. + if ($token->type === Token::TYPE_COMMENT) { + continue; + } + + // Skipping whitespaces. + if ($token->type === Token::TYPE_WHITESPACE) { + if ($state === 2) { + // When parsing the unknown part, the whitespaces are + // included to not break anything. + $ret->unknown[] = $token; + } + continue; + } + + if ($state === 0) { + $ret->options = OptionsArray::parse($parser, $list, $options); + + if ($ret->options->has('AS')) { + for (; $list->idx < $list->count; ++$list->idx) { + if ($list->tokens[$list->idx]->type === Token::TYPE_DELIMITER) { + break; + } + $ret->unknown[] = $list->tokens[$list->idx]; + } + break; + } + + $state = 1; + } elseif ($state === 1) { + $ret->field = Expression::parse( + $parser, + $list, + array( + 'breakOnAlias' => true, + 'parseField' => 'column' + ) + ); + if ($ret->field === null) { + // No field was read. We go back one token so the next + // iteration will parse the same token, but in state 2. + --$list->idx; + } + $state = 2; + } elseif ($state === 2) { + $array_key = ''; + if (is_string($token->value) || is_numeric($token->value)) { + $array_key = $token->value; + } else { + $array_key = $token->token; + } + if ($token->type === Token::TYPE_OPERATOR) { + if ($token->value === '(') { + ++$brackets; + } elseif ($token->value === ')') { + --$brackets; + } elseif (($token->value === ',') && ($brackets === 0)) { + break; + } + } elseif (! self::checkIfTokenQuotedSymbol($token)) { + if (! empty(Parser::$STATEMENT_PARSERS[$token->value])) { + // We want to get the next non-comment and non-space token after $token + // therefore, the first getNext call will start with the current $idx which's $token, + // will return it and increase $idx by 1, which's not guaranteed to be non-comment + // and non-space, that's why we're calling getNext again. + + $list->getNext(); + $nextToken = $list->getNext(); + + if ($token->value === 'SET' && $nextToken !== null && $nextToken->value === '(') { + // To avoid adding the tokens between the SET() parentheses to the unknown tokens + $list->getNextOfTypeAndValue(Token::TYPE_OPERATOR, ')'); + } elseif ($token->value === 'SET' && $nextToken !== null && $nextToken->value === 'DEFAULT') { + // to avoid adding the `DEFAULT` token to the unknown tokens. + ++$list->idx; + } else { + // We have reached the end of ALTER operation and suddenly found + // a start to new statement, but have not find a delimiter between them + $parser->error( + 'A new statement was found, but no delimiter between it and the previous one.', + $token + ); + break; + } + } elseif ((array_key_exists($array_key, self::$DB_OPTIONS) + || array_key_exists($array_key, self::$TABLE_OPTIONS)) + && ! self::checkIfColumnDefinitionKeyword($array_key) + ) { + // This alter operation has finished, which means a comma was missing before start of new alter operation + $parser->error( + 'Missing comma before start of a new alter operation.', + $token + ); + break; + } + } + $ret->unknown[] = $token; + } + } + + if ($ret->options->isEmpty()) { + $parser->error( + 'Unrecognized alter operation.', + $list->tokens[$list->idx] + ); + } + + --$list->idx; + + return $ret; + } + + /** + * @param AlterOperation $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + $ret = $component->options . ' '; + if ((isset($component->field)) && ($component->field !== '')) { + $ret .= $component->field . ' '; + } + $ret .= TokensList::build($component->unknown); + + return $ret; + } + + /** + * Check if token's value is one of the common keywords + * between column and table alteration + * + * @param string $tokenValue Value of current token + * @return bool + */ + private static function checkIfColumnDefinitionKeyword($tokenValue) + { + $common_options = array( + 'AUTO_INCREMENT', + 'COMMENT', + 'DEFAULT', + 'CHARACTER SET', + 'COLLATE', + 'PRIMARY', + 'UNIQUE', + 'PRIMARY KEY', + 'UNIQUE KEY' + ); + // Since these options can be used for + // both table as well as a specific column in the table + return in_array($tokenValue, $common_options); + } + + /** + * Check if token is symbol and quoted with backtick + * + * @param Token $token token to check + * @return bool + */ + private static function checkIfTokenQuotedSymbol($token) { + return $token->type === Token::TYPE_SYMBOL && $token->flags === Token::FLAG_SYMBOL_BACKTICK; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Array2d.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Array2d.php new file mode 100755 index 0000000..984179c --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Array2d.php @@ -0,0 +1,131 @@ + 1 + * + * 1 ------------------------[ , ]------------------------> 0 + * 1 -----------------------[ else ]----------------------> (END) + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + // No keyword is expected. + if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { + break; + } + + if ($state === 0) { + if ($token->value === '(') { + $arr = ArrayObj::parse($parser, $list, $options); + $arrCount = count($arr->values); + if ($count === -1) { + $count = $arrCount; + } elseif ($arrCount !== $count) { + $parser->error( + sprintf( + Translator::gettext('%1$d values were expected, but found %2$d.'), + $count, + $arrCount + ), + $token + ); + } + $ret[] = $arr; + $state = 1; + } else { + break; + } + } elseif ($state === 1) { + if ($token->value === ',') { + $state = 0; + } else { + break; + } + } + } + + if ($state === 0) { + $parser->error( + 'An opening bracket followed by a set of values was expected.', + $list->tokens[$list->idx] + ); + } + + --$list->idx; + + return $ret; + } + + /** + * @param ArrayObj[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + return ArrayObj::build($component); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ArrayObj.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ArrayObj.php new file mode 100755 index 0000000..2b2fe92 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ArrayObj.php @@ -0,0 +1,189 @@ +raw = $raw; + $this->values = $values; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return ArrayObj|Component[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = empty($options['type']) ? new self() : array(); + + /** + * The last raw expression. + * + * @var string + */ + $lastRaw = ''; + + /** + * The last value. + * + * @var string + */ + $lastValue = ''; + + /** + * Counts brackets. + * + * @var int + */ + $brackets = 0; + + /** + * Last separator (bracket or comma). + * + * @var bool + */ + $isCommaLast = false; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) + || ($token->type === Token::TYPE_COMMENT) + ) { + $lastRaw .= $token->token; + $lastValue = trim($lastValue) . ' '; + continue; + } + + if (($brackets === 0) + && (($token->type !== Token::TYPE_OPERATOR) + || ($token->value !== '(')) + ) { + $parser->error('An opening bracket was expected.', $token); + break; + } + + if ($token->type === Token::TYPE_OPERATOR) { + if ($token->value === '(') { + if (++$brackets === 1) { // 1 is the base level. + continue; + } + } elseif ($token->value === ')') { + if (--$brackets === 0) { // Array ended. + break; + } + } elseif ($token->value === ',') { + if ($brackets === 1) { + $isCommaLast = true; + if (empty($options['type'])) { + $ret->raw[] = trim($lastRaw); + $ret->values[] = trim($lastValue); + $lastRaw = $lastValue = ''; + } + } + continue; + } + } + + if (empty($options['type'])) { + $lastRaw .= $token->token; + $lastValue .= $token->value; + } else { + $ret[] = $options['type']::parse( + $parser, + $list, + empty($options['typeOptions']) ? array() : $options['typeOptions'] + ); + } + } + + // Handling last element. + // + // This is treated differently to treat the following cases: + // + // => array() + // (,) => array('', '') + // () => array() + // (a,) => array('a', '') + // (a) => array('a') + // + $lastRaw = trim($lastRaw); + if ((empty($options['type'])) + && ((strlen($lastRaw) > 0) || ($isCommaLast)) + ) { + $ret->raw[] = $lastRaw; + $ret->values[] = trim($lastValue); + } + + return $ret; + } + + /** + * @param ArrayObj|ArrayObj[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(', ', $component); + } elseif (! empty($component->raw)) { + return '(' . implode(', ', $component->raw) . ')'; + } + + return '(' . implode(', ', $component->values) . ')'; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/CaseExpression.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/CaseExpression.php new file mode 100755 index 0000000..f6b422c --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/CaseExpression.php @@ -0,0 +1,314 @@ +idx; // Skip 'CASE' + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) + || ($token->type === Token::TYPE_COMMENT) + ) { + continue; + } + + if ($state === 0) { + if ($token->type === Token::TYPE_KEYWORD) { + switch ($token->keyword) { + case 'WHEN': + ++$list->idx; // Skip 'WHEN' + $new_condition = Condition::parse($parser, $list); + $type = 1; + $state = 1; + $ret->conditions[] = $new_condition; + break; + case 'ELSE': + ++$list->idx; // Skip 'ELSE' + $ret->else_result = Expression::parse($parser, $list); + $state = 0; // last clause of CASE expression + break; + case 'END': + $state = 3; // end of CASE expression + ++$list->idx; + break 2; + default: + $parser->error('Unexpected keyword.', $token); + break 2; + } + } else { + $ret->value = Expression::parse($parser, $list); + $type = 0; + $state = 1; + } + } elseif ($state === 1) { + if ($type === 0) { + if ($token->type === Token::TYPE_KEYWORD) { + switch ($token->keyword) { + case 'WHEN': + ++$list->idx; // Skip 'WHEN' + $new_value = Expression::parse($parser, $list); + $state = 2; + $ret->compare_values[] = $new_value; + break; + case 'ELSE': + ++$list->idx; // Skip 'ELSE' + $ret->else_result = Expression::parse($parser, $list); + $state = 0; // last clause of CASE expression + break; + case 'END': + $state = 3; // end of CASE expression + ++$list->idx; + break 2; + default: + $parser->error('Unexpected keyword.', $token); + break 2; + } + } + } else { + if ($token->type === Token::TYPE_KEYWORD + && $token->keyword === 'THEN' + ) { + ++$list->idx; // Skip 'THEN' + $new_result = Expression::parse($parser, $list); + $state = 0; + $ret->results[] = $new_result; + } elseif ($token->type === Token::TYPE_KEYWORD) { + $parser->error('Unexpected keyword.', $token); + break; + } + } + } elseif ($state === 2) { + if ($type === 0) { + if ($token->type === Token::TYPE_KEYWORD + && $token->keyword === 'THEN' + ) { + ++$list->idx; // Skip 'THEN' + $new_result = Expression::parse($parser, $list); + $ret->results[] = $new_result; + $state = 1; + } elseif ($token->type === Token::TYPE_KEYWORD) { + $parser->error('Unexpected keyword.', $token); + break; + } + } + } + } + + if ($state !== 3) { + $parser->error( + 'Unexpected end of CASE expression', + $list->tokens[$list->idx - 1] + ); + } else { + // Parse for alias of CASE expression + $asFound = false; + for (; $list->idx < $list->count; ++$list->idx) { + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) + || ($token->type === Token::TYPE_COMMENT) + ) { + continue; + } + + // Handle optional AS keyword before alias + if ($token->type === Token::TYPE_KEYWORD + && $token->keyword === 'AS') { + if ($asFound || ! empty($ret->alias)) { + $parser->error('Potential duplicate alias of CASE expression.', $token); + break; + } + $asFound = true; + continue; + } + + if ($asFound + && $token->type === Token::TYPE_KEYWORD + && ($token->flags & Token::FLAG_KEYWORD_RESERVED || $token->flags & Token::FLAG_KEYWORD_FUNCTION)) { + $parser->error('An alias expected after AS but got ' . $token->value, $token); + $asFound = false; + break; + } + + if ($asFound + || $token->type === Token::TYPE_STRING + || ($token->type === Token::TYPE_SYMBOL && ! $token->flags & Token::FLAG_SYMBOL_VARIABLE) + || $token->type === Token::TYPE_NONE + ) { + // An alias is expected (the keyword `AS` was previously found). + if (! empty($ret->alias)) { + $parser->error('An alias was previously found.', $token); + break; + } + $ret->alias = $token->value; + $asFound = false; + + continue; + } + + break; + } + if ($asFound) { + $parser->error('An alias was expected after AS.', $list->tokens[$list->idx - 1]); + } + + $ret->expr = self::build($ret); + } + + --$list->idx; + + return $ret; + } + + /** + * @param CaseExpression $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + $ret = 'CASE '; + if (isset($component->value)) { + // Syntax type 0 + $ret .= $component->value . ' '; + $val_cnt = count($component->compare_values); + $res_cnt = count($component->results); + for ($i = 0; $i < $val_cnt && $i < $res_cnt; ++$i) { + $ret .= 'WHEN ' . $component->compare_values[$i] . ' '; + $ret .= 'THEN ' . $component->results[$i] . ' '; + } + } else { + // Syntax type 1 + $val_cnt = count($component->conditions); + $res_cnt = count($component->results); + for ($i = 0; $i < $val_cnt && $i < $res_cnt; ++$i) { + $ret .= 'WHEN ' . Condition::build($component->conditions[$i]) . ' '; + $ret .= 'THEN ' . $component->results[$i] . ' '; + } + } + if (isset($component->else_result)) { + $ret .= 'ELSE ' . $component->else_result . ' '; + } + $ret .= 'END'; + + if ($component->alias) { + $ret .= ' AS ' . Context::escape($component->alias); + } + + return $ret; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Condition.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Condition.php new file mode 100755 index 0000000..700b071 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Condition.php @@ -0,0 +1,233 @@ + 1, + 'AND' => 1, + 'BETWEEN' => 1, + 'EXISTS' => 1, + 'IF' => 1, + 'IN' => 1, + 'INTERVAL' => 1, + 'IS' => 1, + 'LIKE' => 1, + 'MATCH' => 1, + 'NOT IN' => 1, + 'NOT NULL' => 1, + 'NOT' => 1, + 'NULL' => 1, + 'OR' => 1, + 'REGEXP' => 1, + 'RLIKE' => 1, + 'XOR' => 1 + ); + + /** + * Identifiers recognized. + * + * @var array + */ + public $identifiers = array(); + + /** + * Whether this component is an operator. + * + * @var bool + */ + public $isOperator = false; + + /** + * The condition. + * + * @var string + */ + public $expr; + + /** + * Constructor. + * + * @param string $expr the condition or the operator + */ + public function __construct($expr = null) + { + $this->expr = trim($expr); + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return Condition[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + + $expr = new self(); + + /** + * Counts brackets. + * + * @var int + */ + $brackets = 0; + + /** + * Whether there was a `BETWEEN` keyword before or not. + * + * It is required to keep track of them because their structure contains + * the keyword `AND`, which is also an operator that delimits + * expressions. + * + * @var bool + */ + $betweenBefore = false; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if ($token->type === Token::TYPE_COMMENT) { + continue; + } + + // Replacing all whitespaces (new lines, tabs, etc.) with a single + // space character. + if ($token->type === Token::TYPE_WHITESPACE) { + $expr->expr .= ' '; + continue; + } + + // Conditions are delimited by logical operators. + if (in_array($token->value, static::$DELIMITERS, true)) { + if ($betweenBefore && ($token->value === 'AND')) { + // The syntax of keyword `BETWEEN` is hard-coded. + $betweenBefore = false; + } else { + // The expression ended. + $expr->expr = trim($expr->expr); + if (! empty($expr->expr)) { + $ret[] = $expr; + } + + // Adding the operator. + $expr = new self($token->value); + $expr->isOperator = true; + $ret[] = $expr; + + // Preparing to parse another condition. + $expr = new self(); + continue; + } + } + + if (($token->type === Token::TYPE_KEYWORD) + && ($token->flags & Token::FLAG_KEYWORD_RESERVED) + && ! ($token->flags & Token::FLAG_KEYWORD_FUNCTION) + ) { + if ($token->value === 'BETWEEN') { + $betweenBefore = true; + } + if (($brackets === 0) && empty(static::$ALLOWED_KEYWORDS[$token->value])) { + break; + } + } + + if ($token->type === Token::TYPE_OPERATOR) { + if ($token->value === '(') { + ++$brackets; + } elseif ($token->value === ')') { + if ($brackets === 0) { + break; + } + --$brackets; + } + } + + $expr->expr .= $token->token; + if (($token->type === Token::TYPE_NONE) + || (($token->type === Token::TYPE_KEYWORD) + && (! ($token->flags & Token::FLAG_KEYWORD_RESERVED))) + || ($token->type === Token::TYPE_STRING) + || ($token->type === Token::TYPE_SYMBOL) + ) { + if (! in_array($token->value, $expr->identifiers)) { + $expr->identifiers[] = $token->value; + } + } + } + + // Last iteration was not processed. + $expr->expr = trim($expr->expr); + if (! empty($expr->expr)) { + $ret[] = $expr; + } + + --$list->idx; + + return $ret; + } + + /** + * @param Condition[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(' ', $component); + } + + return $component->expr; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/CreateDefinition.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/CreateDefinition.php new file mode 100755 index 0000000..a55b26d --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/CreateDefinition.php @@ -0,0 +1,372 @@ + true, + + 'NOT NULL' => 1, + 'NULL' => 1, + 'DEFAULT' => array( + 2, + 'expr', + array('breakOnAlias' => true) + ), + /* Following are not according to grammar, but MySQL happily accepts + * these at any location */ + 'CHARSET' => array( + 2, + 'var', + ), + 'COLLATE' => array( + 3, + 'var', + ), + 'AUTO_INCREMENT' => 3, + 'PRIMARY' => 4, + 'PRIMARY KEY' => 4, + 'UNIQUE' => 4, + 'UNIQUE KEY' => 4, + 'COMMENT' => array( + 5, + 'var', + ), + 'COLUMN_FORMAT' => array( + 6, + 'var', + ), + 'ON UPDATE' => array( + 7, + 'expr', + ), + + // Generated columns options. + 'GENERATED ALWAYS' => 8, + 'AS' => array( + 9, + 'expr', + array('parenthesesDelimited' => true) + ), + 'VIRTUAL' => 10, + 'PERSISTENT' => 11, + 'STORED' => 11, + 'CHECK' => array( + 12, + 'expr', + array('parenthesesDelimited' => true), + ), + 'INVISIBLE' => 13, + 'ENFORCED' => 14, + 'NOT' => 15, + // Common entries. + // + // NOTE: Some of the common options are not in the same order which + // causes troubles when checking if the options are in the right order. + // I should find a way to define multiple sets of options and make the + // parser select the right set. + // + // 'UNIQUE' => 4, + // 'UNIQUE KEY' => 4, + // 'COMMENT' => array(5, 'var'), + // 'NOT NULL' => 1, + // 'NULL' => 1, + // 'PRIMARY' => 4, + // 'PRIMARY KEY' => 4, + ); + + /** + * The name of the new column. + * + * @var string + */ + public $name; + + /** + * Whether this field is a constraint or not. + * + * @var bool + */ + public $isConstraint; + + /** + * The data type of thew new column. + * + * @var DataType + */ + public $type; + + /** + * The key. + * + * @var Key + */ + public $key; + + /** + * The table that is referenced. + * + * @var Reference + */ + public $references; + + /** + * The options of this field. + * + * @var OptionsArray + */ + public $options; + + /** + * Constructor. + * + * @param string $name the name of the field + * @param OptionsArray $options the options of this field + * @param DataType|Key $type the data type of this field or the key + * @param bool $isConstraint whether this field is a constraint or not + * @param Reference $references references + */ + public function __construct( + $name = null, + $options = null, + $type = null, + $isConstraint = false, + $references = null + ) { + $this->name = $name; + $this->options = $options; + if ($type instanceof DataType) { + $this->type = $type; + } elseif ($type instanceof Key) { + $this->key = $type; + $this->isConstraint = $isConstraint; + $this->references = $references; + } + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return CreateDefinition[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + + $expr = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 -----------------------[ ( ]------------------------> 1 + * + * 1 --------------------[ CONSTRAINT ]------------------> 1 + * 1 -----------------------[ key ]----------------------> 2 + * 1 -------------[ constraint / column name ]-----------> 2 + * + * 2 --------------------[ data type ]-------------------> 3 + * + * 3 ---------------------[ options ]--------------------> 4 + * + * 4 --------------------[ REFERENCES ]------------------> 4 + * + * 5 ------------------------[ , ]-----------------------> 1 + * 5 ------------------------[ ) ]-----------------------> 6 (-1) + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + $state = 1; + } else { + $parser->error( + 'An opening bracket was expected.', + $token + ); + + break; + } + } elseif ($state === 1) { + if ($token->type === Token::TYPE_KEYWORD && $token->keyword === 'CONSTRAINT') { + $expr->isConstraint = true; + } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_KEY)) { + $expr->key = Key::parse($parser, $list); + $state = 4; + } elseif ($token->type === Token::TYPE_SYMBOL || $token->type === Token::TYPE_NONE) { + $expr->name = $token->value; + if (! $expr->isConstraint) { + $state = 2; + } + } elseif ($token->type === Token::TYPE_KEYWORD) { + if ($token->flags & Token::FLAG_KEYWORD_RESERVED) { + // Reserved keywords can't be used + // as field names without backquotes + $parser->error( + 'A symbol name was expected! ' + . 'A reserved keyword can not be used ' + . 'as a column name without backquotes.', + $token + ); + + return $ret; + } + + // Non-reserved keywords are allowed without backquotes + $expr->name = $token->value; + $state = 2; + } else { + $parser->error( + 'A symbol name was expected!', + $token + ); + + return $ret; + } + } elseif ($state === 2) { + $expr->type = DataType::parse($parser, $list); + $state = 3; + } elseif ($state === 3) { + $expr->options = OptionsArray::parse($parser, $list, static::$FIELD_OPTIONS); + $state = 4; + } elseif ($state === 4) { + if ($token->type === Token::TYPE_KEYWORD && $token->keyword === 'REFERENCES') { + ++$list->idx; // Skipping keyword 'REFERENCES'. + $expr->references = Reference::parse($parser, $list); + } else { + --$list->idx; + } + $state = 5; + } elseif ($state === 5) { + if (! empty($expr->type) || ! empty($expr->key)) { + $ret[] = $expr; + } + $expr = new self(); + if ($token->value === ',') { + $state = 1; + } elseif ($token->value === ')') { + $state = 6; + ++$list->idx; + break; + } else { + $parser->error( + 'A comma or a closing bracket was expected.', + $token + ); + $state = 0; + break; + } + } + } + + // Last iteration was not saved. + if (! empty($expr->type) || ! empty($expr->key)) { + $ret[] = $expr; + } + + if (($state !== 0) && ($state !== 6)) { + $parser->error( + 'A closing bracket was expected.', + $list->tokens[$list->idx - 1] + ); + } + + --$list->idx; + + return $ret; + } + + /** + * @param CreateDefinition|CreateDefinition[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return "(\n " . implode(",\n ", $component) . "\n)"; + } + + $tmp = ''; + + if ($component->isConstraint) { + $tmp .= 'CONSTRAINT '; + } + + if (isset($component->name) && ($component->name !== '')) { + $tmp .= Context::escape($component->name) . ' '; + } + + if (! empty($component->type)) { + $tmp .= DataType::build( + $component->type, + array('lowercase' => true) + ) . ' '; + } + + if (! empty($component->key)) { + $tmp .= $component->key . ' '; + } + + if (! empty($component->references)) { + $tmp .= 'REFERENCES ' . $component->references . ' '; + } + + $tmp .= $component->options; + + return trim($tmp); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/DataType.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/DataType.php new file mode 100755 index 0000000..d19d434 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/DataType.php @@ -0,0 +1,175 @@ + 1, + 'CHARACTER SET' => array( + 2, + 'var', + ), + 'CHARSET' => array( + 2, + 'var', + ), + 'COLLATE' => array( + 3, + 'var', + ), + 'UNSIGNED' => 4, + 'ZEROFILL' => 5 + ); + + /** + * The name of the data type. + * + * @var string + */ + public $name; + + /** + * The parameters of this data type. + * + * Some data types have no parameters. + * Numeric types might have parameters for the maximum number of digits, + * precision, etc. + * String types might have parameters for the maximum length stored. + * `ENUM` and `SET` have parameters for possible values. + * + * For more information, check the MySQL manual. + * + * @var array + */ + public $parameters = array(); + + /** + * The options of this data type. + * + * @var OptionsArray + */ + public $options; + + /** + * Constructor. + * + * @param string $name the name of this data type + * @param array $parameters the parameters (size or possible values) + * @param OptionsArray $options the options of this data type + */ + public function __construct( + $name = null, + array $parameters = array(), + $options = null + ) { + $this->name = $name; + $this->parameters = $parameters; + $this->options = $options; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return DataType|null + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 -------------------[ data type ]--------------------> 1 + * + * 1 ----------------[ size and options ]----------------> 2 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $ret->name = strtoupper($token->value); + if (($token->type !== Token::TYPE_KEYWORD) || (! ($token->flags & Token::FLAG_KEYWORD_DATA_TYPE))) { + $parser->error('Unrecognized data type.', $token); + } + $state = 1; + } elseif ($state === 1) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + $parameters = ArrayObj::parse($parser, $list); + ++$list->idx; + $ret->parameters = (($ret->name === 'ENUM') || ($ret->name === 'SET')) ? + $parameters->raw : $parameters->values; + } + $ret->options = OptionsArray::parse($parser, $list, static::$DATA_TYPE_OPTIONS); + ++$list->idx; + break; + } + } + + if (empty($ret->name)) { + return null; + } + + --$list->idx; + + return $ret; + } + + /** + * @param DataType $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + $name = empty($options['lowercase']) ? + $component->name : strtolower($component->name); + + $parameters = ''; + if (! empty($component->parameters)) { + $parameters = '(' . implode(',', $component->parameters) . ')'; + } + + return trim($name . $parameters . ' ' . $component->options); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Expression.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Expression.php new file mode 100755 index 0000000..62b9b1c --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Expression.php @@ -0,0 +1,462 @@ + 1, + 'DUAL' => 1, + 'NULL' => 1, + 'REGEXP' => 1, + 'CASE' => 1, + 'DIV' => 1, + 'AND' => 1, + 'OR' => 1, + 'XOR' => 1, + 'NOT' => 1, + 'MOD' => 1 + ); + + /** + * The name of this database. + * + * @var string + */ + public $database; + + /** + * The name of this table. + * + * @var string + */ + public $table; + + /** + * The name of the column. + * + * @var string + */ + public $column; + + /** + * The sub-expression. + * + * @var string + */ + public $expr = ''; + + /** + * The alias of this expression. + * + * @var string + */ + public $alias; + + /** + * The name of the function. + * + * @var mixed + */ + public $function; + + /** + * The type of subquery. + * + * @var string + */ + public $subquery; + + /** + * Constructor. + * + * Syntax: + * new Expression('expr') + * new Expression('expr', 'alias') + * new Expression('database', 'table', 'column') + * new Expression('database', 'table', 'column', 'alias') + * + * If the database, table or column name is not required, pass an empty + * string. + * + * @param string $database The name of the database or the the expression. + * the the expression. + * @param string $table The name of the table or the alias of the expression. + * the alias of the expression. + * @param string $column the name of the column + * @param string $alias the name of the alias + */ + public function __construct($database = null, $table = null, $column = null, $alias = null) + { + if (($column === null) && ($alias === null)) { + $this->expr = $database; // case 1 + $this->alias = $table; // case 2 + } else { + $this->database = $database; // case 3 + $this->table = $table; // case 3 + $this->column = $column; // case 3 + $this->alias = $alias; // case 4 + } + } + + /** + * Possible options:. + * + * `field` + * + * First field to be filled. + * If this is not specified, it takes the value of `parseField`. + * + * `parseField` + * + * Specifies the type of the field parsed. It may be `database`, + * `table` or `column`. These expressions may not include + * parentheses. + * + * `breakOnAlias` + * + * If not empty, breaks when the alias occurs (it is not included). + * + * `breakOnParentheses` + * + * If not empty, breaks when the first parentheses occurs. + * + * `parenthesesDelimited` + * + * If not empty, breaks after last parentheses occurred. + * + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return Expression|null + * @throws \PhpMyAdmin\SqlParser\Exceptions\ParserException + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * Whether current tokens make an expression or a table reference. + * + * @var bool + */ + $isExpr = false; + + /** + * Whether a period was previously found. + * + * @var bool + */ + $dot = false; + + /** + * Whether an alias is expected. Is 2 if `AS` keyword was found. + * + * @var bool + */ + $alias = false; + + /** + * Counts brackets. + * + * @var int + */ + $brackets = 0; + + /** + * Keeps track of the last two previous tokens. + * + * @var Token[] + */ + $prev = array( + null, + null + ); + + // When a field is parsed, no parentheses are expected. + if (! empty($options['parseField'])) { + $options['breakOnParentheses'] = true; + $options['field'] = $options['parseField']; + } + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) + || ($token->type === Token::TYPE_COMMENT) + ) { + if ($isExpr) { + $ret->expr .= $token->token; + } + continue; + } + + if ($token->type === Token::TYPE_KEYWORD) { + if (($brackets > 0) && empty($ret->subquery) + && ! empty(Parser::$STATEMENT_PARSERS[$token->keyword]) + ) { + // A `(` was previously found and this keyword is the + // beginning of a statement, so this is a subquery. + $ret->subquery = $token->keyword; + } elseif (($token->flags & Token::FLAG_KEYWORD_FUNCTION) + && (empty($options['parseField']) + && ! $alias) + ) { + $isExpr = true; + } elseif (($token->flags & Token::FLAG_KEYWORD_RESERVED) + && ($brackets === 0) + ) { + if (empty(self::$ALLOWED_KEYWORDS[$token->keyword])) { + // A reserved keyword that is not allowed in the + // expression was found so the expression must have + // ended and a new clause is starting. + break; + } + if ($token->keyword === 'AS') { + if (! empty($options['breakOnAlias'])) { + break; + } + if ($alias) { + $parser->error( + 'An alias was expected.', + $token + ); + break; + } + $alias = true; + continue; + } elseif ($token->keyword === 'CASE') { + // For a use of CASE like + // 'SELECT a = CASE .... END, b=1, `id`, ... FROM ...' + $tempCaseExpr = CaseExpression::parse($parser, $list); + $ret->expr .= CaseExpression::build($tempCaseExpr); + $isExpr = true; + continue; + } + $isExpr = true; + } elseif ($brackets === 0 && strlen($ret->expr) > 0 && ! $alias) { + /* End of expression */ + break; + } + } + + if (($token->type === Token::TYPE_NUMBER) + || ($token->type === Token::TYPE_BOOL) + || (($token->type === Token::TYPE_SYMBOL) + && ($token->flags & Token::FLAG_SYMBOL_VARIABLE)) + || (($token->type === Token::TYPE_SYMBOL) + && ($token->flags & Token::FLAG_SYMBOL_PARAMETER)) + || (($token->type === Token::TYPE_OPERATOR) + && ($token->value !== '.')) + ) { + if (! empty($options['parseField'])) { + break; + } + + // Numbers, booleans and operators (except dot) are usually part + // of expressions. + $isExpr = true; + } + + if ($token->type === Token::TYPE_OPERATOR) { + if (! empty($options['breakOnParentheses']) + && (($token->value === '(') || ($token->value === ')')) + ) { + // No brackets were expected. + break; + } + if ($token->value === '(') { + ++$brackets; + if (empty($ret->function) && ($prev[1] !== null) + && (($prev[1]->type === Token::TYPE_NONE) + || ($prev[1]->type === Token::TYPE_SYMBOL) + || (($prev[1]->type === Token::TYPE_KEYWORD) + && ($prev[1]->flags & Token::FLAG_KEYWORD_FUNCTION))) + ) { + $ret->function = $prev[1]->value; + } + } elseif ($token->value === ')') { + if ($brackets === 0) { + // Not our bracket + break; + } else { + --$brackets; + if ($brackets === 0) { + if (! empty($options['parenthesesDelimited'])) { + // The current token is the last bracket, the next + // one will be outside the expression. + $ret->expr .= $token->token; + ++$list->idx; + break; + } + } elseif ($brackets < 0) { + // $parser->error('Unexpected closing bracket.', $token); + // $brackets = 0; + break; + } + } + } elseif ($token->value === ',') { + // Expressions are comma-delimited. + if ($brackets === 0) { + break; + } + } + } + + // Saving the previous tokens. + $prev[0] = $prev[1]; + $prev[1] = $token; + + if ($alias) { + // An alias is expected (the keyword `AS` was previously found). + if (! empty($ret->alias)) { + $parser->error('An alias was previously found.', $token); + break; + } + $ret->alias = $token->value; + $alias = false; + } elseif ($isExpr) { + // Handling aliases. + if (/* (empty($ret->alias)) && */ ($brackets === 0) + && (($prev[0] === null) + || ((($prev[0]->type !== Token::TYPE_OPERATOR) + || ($prev[0]->token === ')')) + && (($prev[0]->type !== Token::TYPE_KEYWORD) + || (! ($prev[0]->flags & Token::FLAG_KEYWORD_RESERVED))))) + && (($prev[1]->type === Token::TYPE_STRING) + || (($prev[1]->type === Token::TYPE_SYMBOL) + && (! ($prev[1]->flags & Token::FLAG_SYMBOL_VARIABLE))) + || ($prev[1]->type === Token::TYPE_NONE)) + ) { + if (! empty($ret->alias)) { + $parser->error('An alias was previously found.', $token); + break; + } + $ret->alias = $prev[1]->value; + } else { + $ret->expr .= $token->token; + } + } elseif (! $isExpr) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '.')) { + // Found a `.` which means we expect a column name and + // the column name we parsed is actually the table name + // and the table name is actually a database name. + if (! empty($ret->database) || $dot) { + $parser->error('Unexpected dot.', $token); + } + $ret->database = $ret->table; + $ret->table = $ret->column; + $ret->column = null; + $dot = true; + $ret->expr .= $token->token; + } else { + $field = empty($options['field']) ? 'column' : $options['field']; + if (empty($ret->$field)) { + $ret->$field = $token->value; + $ret->expr .= $token->token; + $dot = false; + } else { + // No alias is expected. + if (! empty($options['breakOnAlias'])) { + break; + } + if (! empty($ret->alias)) { + $parser->error('An alias was previously found.', $token); + break; + } + $ret->alias = $token->value; + } + } + } + } + + if ($alias) { + $parser->error( + 'An alias was expected.', + $list->tokens[$list->idx - 1] + ); + } + + // White-spaces might be added at the end. + $ret->expr = trim($ret->expr); + + if ($ret->expr === '') { + return null; + } + + --$list->idx; + + return $ret; + } + + /** + * @param Expression|Expression[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(', ', $component); + } + + if ($component->expr !== '' && ! is_null($component->expr)) { + $ret = $component->expr; + } else { + $fields = array(); + if (isset($component->database) && ($component->database !== '')) { + $fields[] = $component->database; + } + if (isset($component->table) && ($component->table !== '')) { + $fields[] = $component->table; + } + if (isset($component->column) && ($component->column !== '')) { + $fields[] = $component->column; + } + $ret = implode('.', Context::escape($fields)); + } + + if (! empty($component->alias)) { + $ret .= ' AS ' . Context::escape($component->alias); + } + + return $ret; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ExpressionArray.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ExpressionArray.php new file mode 100755 index 0000000..2cde21a --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ExpressionArray.php @@ -0,0 +1,139 @@ + 1 + * + * 1 ------------------------[ , ]------------------------> 0 + * 1 -----------------------[ else ]----------------------> (END) + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if (($token->type === Token::TYPE_KEYWORD) + && ($token->flags & Token::FLAG_KEYWORD_RESERVED) + && ((~$token->flags & Token::FLAG_KEYWORD_FUNCTION)) + && ($token->value !== 'DUAL') + && ($token->value !== 'NULL') + && ($token->value !== 'CASE') + ) { + // No keyword is expected. + break; + } + + if ($state === 0) { + if ($token->type === Token::TYPE_KEYWORD + && $token->value === 'CASE' + ) { + $expr = CaseExpression::parse($parser, $list, $options); + } else { + $expr = Expression::parse($parser, $list, $options); + } + + if ($expr === null) { + break; + } + $ret[] = $expr; + $state = 1; + } elseif ($state === 1) { + if ($token->value === ',') { + $state = 0; + } else { + break; + } + } + } + + if ($state === 0) { + $parser->error( + 'An expression was expected.', + $list->tokens[$list->idx] + ); + } + + --$list->idx; + + if (is_array($ret)) { + $retIndex = count($ret) - 1; + if (isset($ret[$retIndex])) { + $expr = $ret[$retIndex]->expr; + if (preg_match('/\s*--\s.*$/', $expr, $matches)) { + $found = $matches[0]; + $ret[$retIndex]->expr = substr($expr, 0, strlen($expr) - strlen($found)); + } + } + } + + return $ret; + } + + /** + * @param Expression[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + $ret = array(); + foreach ($component as $frag) { + $ret[] = $frag::build($frag); + } + + return implode(', ', $ret); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/FunctionCall.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/FunctionCall.php new file mode 100755 index 0000000..8334676 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/FunctionCall.php @@ -0,0 +1,119 @@ +name = $name; + if (is_array($parameters)) { + $this->parameters = new ArrayObj($parameters); + } elseif ($parameters instanceof ArrayObj) { + $this->parameters = $parameters; + } + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return FunctionCall + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ----------------------[ name ]-----------------------> 1 + * + * 1 --------------------[ parameters ]-------------------> (END) + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $ret->name = $token->value; + $state = 1; + } elseif ($state === 1) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + $ret->parameters = ArrayObj::parse($parser, $list); + } + break; + } + } + + return $ret; + } + + /** + * @param FunctionCall $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + return $component->name . $component->parameters; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/GroupKeyword.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/GroupKeyword.php new file mode 100755 index 0000000..c782288 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/GroupKeyword.php @@ -0,0 +1,131 @@ +expr = $expr; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return GroupKeyword[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + + $expr = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 --------------------[ expression ]-------------------> 1 + * + * 1 ------------------------[ , ]------------------------> 0 + * 1 -------------------[ ASC / DESC ]--------------------> 1 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $expr->expr = Expression::parse($parser, $list); + $state = 1; + } elseif ($state === 1) { + if (($token->type === Token::TYPE_KEYWORD) + && (($token->keyword === 'ASC') || ($token->keyword === 'DESC')) + ) { + $expr->type = $token->keyword; + } elseif (($token->type === Token::TYPE_OPERATOR) + && ($token->value === ',') + ) { + if (! empty($expr->expr)) { + $ret[] = $expr; + } + $expr = new self(); + $state = 0; + } else { + break; + } + } + } + + // Last iteration was not processed. + if (! empty($expr->expr)) { + $ret[] = $expr; + } + + --$list->idx; + + return $ret; + } + + /** + * @param GroupKeyword|GroupKeyword[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(', ', $component); + } + + return trim($component->expr); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/IndexHint.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/IndexHint.php new file mode 100755 index 0000000..254152e --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/IndexHint.php @@ -0,0 +1,193 @@ +type = $type; + $this->indexOrKey = $indexOrKey; + $this->for = $for; + $this->indexes = $indexes; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return IndexHint|Component[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + $expr = new self(); + $expr->type = isset($options['type']) ? $options['type'] : null; + /** + * The state of the parser. + * + * Below are the states of the parser. + * 0 ----------------- [ USE/IGNORE/FORCE ]-----------------> 1 + * 1 -------------------- [ INDEX/KEY ] --------------------> 2 + * 2 ----------------------- [ FOR ] -----------------------> 3 + * 2 -------------------- [ expr_list ] --------------------> 0 + * 3 -------------- [ JOIN/GROUP BY/ORDER BY ] -------------> 4 + * 4 -------------------- [ expr_list ] --------------------> 0 + * @var int + */ + $state = 0; + + // By design, the parser will parse first token after the keyword. So, the keyword + // must be analyzed too, in order to determine the type of this index hint. + if ($list->idx > 0) { + --$list->idx; + } + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + switch ($state) { + case 0: + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'USE' || $token->keyword === 'IGNORE' || $token->keyword === 'FORCE') { + $expr->type = $token->keyword; + $state = 1; + } else { + break 2; + } + } + break; + case 1: + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'INDEX' || $token->keyword === 'KEY') { + $expr->indexOrKey = $token->keyword; + } else { + $parser->error('Unexpected keyword.', $token); + } + $state = 2; + } else { + // we expect the token to be a keyword + $parser->error('Unexpected token.', $token); + } + break; + case 2: + if ($token->type === Token::TYPE_KEYWORD && $token->keyword === 'FOR') { + $state = 3; + } else { + $expr->indexes = ExpressionArray::parse($parser, $list); + $state = 0; + $ret[] = $expr; + $expr = new self(); + } + break; + case 3: + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'JOIN' || $token->keyword === 'GROUP BY' || $token->keyword === 'ORDER BY') { + $expr->for = $token->keyword; + } else { + $parser->error('Unexpected keyword.', $token); + } + $state = 4; + } else { + // we expect the token to be a keyword + $parser->error('Unexpected token.', $token); + } + break; + case 4: + $expr->indexes = ExpressionArray::parse($parser, $list); + $state = 0; + $ret[] = $expr; + $expr = new self(); + break; + } + } + --$list->idx; + + return $ret; + } + + /** + * @param ArrayObj|ArrayObj[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(' ', $component); + } + + $ret = $component->type . ' ' . $component->indexOrKey . ' '; + if ($component->for !== null) { + $ret .= 'FOR ' . $component->for . ' '; + } + return $ret . ExpressionArray::build($component->indexes); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/IntoKeyword.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/IntoKeyword.php new file mode 100755 index 0000000..dea5d9d --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/IntoKeyword.php @@ -0,0 +1,297 @@ + array( + 1, + 'expr', + ), + 'OPTIONALLY' => 2, + 'ENCLOSED BY' => array( + 3, + 'expr', + ), + 'ESCAPED BY' => array( + 4, + 'expr', + ) + ); + + /** + * LINES Options for `SELECT...INTO` statements. + * + * @var array + */ + public static $LINES_OPTIONS = array( + 'STARTING BY' => array( + 1, + 'expr', + ), + 'TERMINATED BY' => array( + 2, + 'expr', + ) + ); + + /** + * Type of target (OUTFILE or SYMBOL). + * + * @var string + */ + public $type; + + /** + * The destination, which can be a table or a file. + * + * @var string|Expression + */ + public $dest; + + /** + * The name of the columns. + * + * @var array + */ + public $columns; + + /** + * The values to be selected into (SELECT .. INTO @var1). + * + * @var Expression[] + */ + public $values; + + /** + * Options for FIELDS/COLUMNS keyword. + * + * @var OptionsArray + * + * @see static::$FIELDS_OPTIONS + */ + public $fields_options; + + /** + * Whether to use `FIELDS` or `COLUMNS` while building. + * + * @var bool + */ + public $fields_keyword; + + /** + * Options for OPTIONS keyword. + * + * @var OptionsArray + * + * @see static::$LINES_OPTIONS + */ + public $lines_options; + + /** + * Constructor. + * + * @param string $type type of destination (may be OUTFILE) + * @param string|Expression $dest actual destination + * @param array $columns column list of destination + * @param array $values selected fields + * @param OptionsArray $fields_options options for FIELDS/COLUMNS keyword + * @param bool $fields_keyword options for OPTIONS keyword + */ + public function __construct( + $type = null, + $dest = null, + $columns = null, + $values = null, + $fields_options = null, + $fields_keyword = null + ) { + $this->type = $type; + $this->dest = $dest; + $this->columns = $columns; + $this->values = $values; + $this->fields_options = $fields_options; + $this->fields_keyword = $fields_keyword; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return IntoKeyword + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 -----------------------[ name ]----------------------> 1 + * 0 ---------------------[ OUTFILE ]---------------------> 2 + * + * 1 ------------------------[ ( ]------------------------> (END) + * + * 2 ---------------------[ filename ]--------------------> 1 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { + if (($state === 0) && ($token->keyword === 'OUTFILE')) { + $ret->type = 'OUTFILE'; + $state = 2; + continue; + } + + // No other keyword is expected except for $state = 4, which expects `LINES` + if ($state !== 4) { + break; + } + } + + if ($state === 0) { + if ((isset($options['fromInsert']) + && $options['fromInsert']) + || (isset($options['fromReplace']) + && $options['fromReplace']) + ) { + $ret->dest = Expression::parse( + $parser, + $list, + array( + 'parseField' => 'table', + 'breakOnAlias' => true + ) + ); + } else { + $ret->values = ExpressionArray::parse($parser, $list); + } + $state = 1; + } elseif ($state === 1) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + $ret->columns = ArrayObj::parse($parser, $list)->values; + ++$list->idx; + } + break; + } elseif ($state === 2) { + $ret->dest = $token->value; + + $state = 3; + } elseif ($state === 3) { + $ret->parseFileOptions($parser, $list, $token->value); + $state = 4; + } elseif ($state === 4) { + if ($token->type === Token::TYPE_KEYWORD && $token->keyword !== 'LINES') { + break; + } + + $ret->parseFileOptions($parser, $list, $token->value); + $state = 5; + } + } + + --$list->idx; + + return $ret; + } + + public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'FIELDS') + { + ++$list->idx; + + if ($keyword === 'FIELDS' || $keyword === 'COLUMNS') { + // parse field options + $this->fields_options = OptionsArray::parse( + $parser, + $list, + static::$FIELDS_OPTIONS + ); + + $this->fields_keyword = ($keyword === 'FIELDS'); + } else { + // parse line options + $this->lines_options = OptionsArray::parse( + $parser, + $list, + static::$LINES_OPTIONS + ); + } + } + + /** + * @param IntoKeyword $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if ($component->dest instanceof Expression) { + $columns = ! empty($component->columns) ? '(`' . implode('`, `', $component->columns) . '`)' : ''; + + return $component->dest . $columns; + } elseif (isset($component->values)) { + return ExpressionArray::build($component->values); + } + + $ret = 'OUTFILE "' . $component->dest . '"'; + + $fields_options_str = OptionsArray::build($component->fields_options); + if (trim($fields_options_str) !== '') { + $ret .= $component->fields_keyword ? ' FIELDS' : ' COLUMNS'; + $ret .= ' ' . $fields_options_str; + } + + $lines_options_str = OptionsArray::build($component->lines_options, array('expr' => true)); + if (trim($lines_options_str) !== '') { + $ret .= ' LINES ' . $lines_options_str; + } + + return $ret; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/JoinKeyword.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/JoinKeyword.php new file mode 100755 index 0000000..afc62ba --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/JoinKeyword.php @@ -0,0 +1,228 @@ + 'CROSS', + 'FULL JOIN' => 'FULL', + 'FULL OUTER JOIN' => 'FULL', + 'INNER JOIN' => 'INNER', + 'JOIN' => 'JOIN', + 'LEFT JOIN' => 'LEFT', + 'LEFT OUTER JOIN' => 'LEFT', + 'RIGHT JOIN' => 'RIGHT', + 'RIGHT OUTER JOIN' => 'RIGHT', + 'NATURAL JOIN' => 'NATURAL', + 'NATURAL LEFT JOIN' => 'NATURAL LEFT', + 'NATURAL RIGHT JOIN' => 'NATURAL RIGHT', + 'NATURAL LEFT OUTER JOIN' => 'NATURAL LEFT OUTER', + 'NATURAL RIGHT OUTER JOIN' => 'NATURAL RIGHT OUTER', + 'STRAIGHT_JOIN' => 'STRAIGHT' + ); + + /** + * Type of this join. + * + * @see static::$JOINS + * + * @var string + */ + public $type; + + /** + * Join expression. + * + * @var Expression + */ + public $expr; + + /** + * Join conditions. + * + * @var Condition[] + */ + public $on; + + /** + * Columns in Using clause. + * + * @var ArrayObj + */ + public $using; + + /** + * Constructor. + * + * @param string $type Join type + * @param Expression $expr join expression + * @param Condition[] $on join conditions + * @param ArrayObj $using columns joined + * + * @see JoinKeyword::$JOINS + */ + public function __construct($type = null, $expr = null, $on = null, $using = null) + { + $this->type = $type; + $this->expr = $expr; + $this->on = $on; + $this->using = $using; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return JoinKeyword[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + + $expr = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 -----------------------[ JOIN ]----------------------> 1 + * + * 1 -----------------------[ expr ]----------------------> 2 + * + * 2 ------------------------[ ON ]-----------------------> 3 + * 2 -----------------------[ USING ]---------------------> 4 + * + * 3 --------------------[ conditions ]-------------------> 0 + * + * 4 ----------------------[ columns ]--------------------> 0 + * + * @var int + */ + $state = 0; + + // By design, the parser will parse first token after the keyword. + // In this case, the keyword must be analyzed too, in order to determine + // the type of this join. + if ($list->idx > 0) { + --$list->idx; + } + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + if (($token->type === Token::TYPE_KEYWORD) + && ! empty(static::$JOINS[$token->keyword]) + ) { + $expr->type = static::$JOINS[$token->keyword]; + $state = 1; + } else { + break; + } + } elseif ($state === 1) { + $expr->expr = Expression::parse($parser, $list, array('field' => 'table')); + $state = 2; + } elseif ($state === 2) { + if ($token->type === Token::TYPE_KEYWORD) { + switch ($token->keyword) { + case 'ON': + $state = 3; + break; + case 'USING': + $state = 4; + break; + default: + if (! empty(static::$JOINS[$token->keyword]) + ) { + $ret[] = $expr; + $expr = new self(); + $expr->type = static::$JOINS[$token->keyword]; + $state = 1; + } else { + /* Next clause is starting */ + break 2; + } + break; + } + } + } elseif ($state === 3) { + $expr->on = Condition::parse($parser, $list); + $ret[] = $expr; + $expr = new self(); + $state = 0; + } elseif ($state === 4) { + $expr->using = ArrayObj::parse($parser, $list); + $ret[] = $expr; + $expr = new self(); + $state = 0; + } + } + + if (! empty($expr->type)) { + $ret[] = $expr; + } + + --$list->idx; + + return $ret; + } + + /** + * @param JoinKeyword[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + $ret = array(); + foreach ($component as $c) { + $ret[] = array_search($c->type, static::$JOINS) . ' ' . $c->expr + . (! empty($c->on) + ? ' ON ' . Condition::build($c->on) : '') + . (! empty($c->using) + ? ' USING ' . ArrayObj::build($c->using) : ''); + } + + return implode(' ', $ret); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Key.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Key.php new file mode 100755 index 0000000..3c1e114 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Key.php @@ -0,0 +1,315 @@ + array( + 1, + 'var=', + ), + 'USING' => array( + 2, + 'var', + ), + 'WITH PARSER' => array( + 3, + 'var', + ), + 'COMMENT' => array( + 4, + 'var', + ), + // MariaDB options + 'CLUSTERING' => array( + 4, + 'var=', + ), + 'ENGINE_ATTRIBUTE' => array( + 5, + 'var=', + ), + 'SECONDARY_ENGINE_ATTRIBUTE' => array( + 5, + 'var=', + ), + // MariaDB & MySQL options + 'VISIBLE' => 6, + 'INVISIBLE' => 6, + // MariaDB options + 'IGNORED' => 10, + 'NOT IGNORED' => 10, + ); + + /** + * The name of this key. + * + * @var string + */ + public $name; + + /** + * The key columns + * + * @var array[] + * @phpstan-var array{name?: string, length?: int, order?: string}[] + */ + public $columns; + + /** + * The type of this key. + * + * @var string + */ + public $type; + + /** + * The expression if the Key is not using column names + * + * @var string|null + */ + public $expr = null; + + /** + * The options of this key or null if none where found. + * + * @var OptionsArray|null + */ + public $options; + + /** + * Constructor. + * + * @param string $name the name of the key + * @param array $columns the columns covered by this key + * @param string $type the type of this key + * @param OptionsArray $options the options of this key + */ + public function __construct( + $name = null, + array $columns = array(), + $type = null, + $options = null + ) { + $this->name = $name; + $this->columns = $columns; + $this->type = $type; + $this->options = $options; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return Key + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * Last parsed column. + * + * @var array + */ + $lastColumn = array(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------------[ type ]---------------------------> 1 + * + * 1 ---------------------[ name ]---------------------------> 1 + * 1 ---------------------[ columns ]------------------------> 2 + * 1 ---------------------[ expression ]---------------------> 5 + * + * 2 ---------------------[ column length ]------------------> 3 + * 3 ---------------------[ column length ]------------------> 2 + * 2 ---------------------[ options ]------------------------> 4 + * 5 ---------------------[ expression ]---------------------> 4 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $ret->type = $token->value; + $state = 1; + } elseif ($state === 1) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + $positionBeforeSearch = $list->idx; + $list->idx++;// Ignore the current token "(" or the search condition will always be true + $nextToken = $list->getNext(); + $list->idx = $positionBeforeSearch;// Restore the position + + if ( + $nextToken !== null && $nextToken->value === '(' + ) { + // Switch to expression mode + $state = 5; + } else { + $state = 2; + } + } else { + $ret->name = $token->value; + } + } elseif ($state === 2) { + if ($token->type === Token::TYPE_OPERATOR) { + if ($token->value === '(') { + $state = 3; + } elseif (($token->value === ',') || ($token->value === ')')) { + $state = ($token->value === ',') ? 2 : 4; + if (! empty($lastColumn)) { + $ret->columns[] = $lastColumn; + $lastColumn = array(); + } + } + } elseif ( + ( + $token->type === Token::TYPE_KEYWORD + ) + && + ( + ($token->keyword === 'ASC') || ($token->keyword === 'DESC') + ) + ) { + $lastColumn['order'] = $token->keyword; + } else { + $lastColumn['name'] = $token->value; + } + } elseif ($state === 3) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ')')) { + $state = 2; + } else { + $lastColumn['length'] = $token->value; + } + } elseif ($state === 4) { + $ret->options = OptionsArray::parse($parser, $list, static::$KEY_OPTIONS); + ++$list->idx; + break; + } elseif ($state === 5) { + if ($token->type === Token::TYPE_OPERATOR) { + // This got back to here and we reached the end of the expression + if ($token->value === ')') { + $state = 4;// go back to state 4 to fetch options + continue; + } + // The expression is not finished, adding a separator for the next expression + if ($token->value === ',') { + $ret->expr .= ', '; + continue; + } + // Start of the expression + if ($token->value === '(') { + // This is the first expression, set to empty + if ($ret->expr === null) { + $ret->expr = ''; + } + + $ret->expr .= Expression::parse( + $parser, + $list, + array( + 'parenthesesDelimited' => true + ) + ); + continue; + } + // Another unexpected operator was found + } + // Something else than an operator was found + $parser->error('Unexpected token.', $token); + } + } + + --$list->idx; + + return $ret; + } + + /** + * @param Key $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + $ret = $component->type . ' '; + if (! empty($component->name)) { + $ret .= Context::escape($component->name) . ' '; + } + + if ($component->expr !== null) { + return $ret . '(' . $component->expr . ')' . ' ' . $component->options; + } + + $columns = array(); + foreach ($component->columns as $column) { + $tmp = ''; + if (isset($column['name'])) { + $tmp .= Context::escape($column['name']); + } + + if (isset($column['length'])) { + $tmp .= '(' . $column['length'] . ')'; + } + + if (isset($column['order'])) { + $tmp .= ' ' . $column['order']; + } + + $columns[] = $tmp; + } + + $ret .= '(' . implode(',', $columns) . ') ' . $component->options; + + return trim($ret); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Limit.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Limit.php new file mode 100755 index 0000000..a3903b5 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Limit.php @@ -0,0 +1,133 @@ +rowCount = $rowCount; + $this->offset = $offset; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return Limit + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + $offset = false; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if (($token->type === Token::TYPE_KEYWORD) && ($token->flags & Token::FLAG_KEYWORD_RESERVED)) { + break; + } + + if ($token->type === Token::TYPE_KEYWORD && $token->keyword === 'OFFSET') { + if ($offset) { + $parser->error('An offset was expected.', $token); + } + $offset = true; + continue; + } + + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ',')) { + $ret->offset = $ret->rowCount; + $ret->rowCount = 0; + continue; + } + + // Skip if not a number + if (($token->type !== Token::TYPE_NUMBER)) { + break; + } + + if ($offset) { + $ret->offset = $token->value; + $offset = false; + } else { + $ret->rowCount = $token->value; + } + } + + if ($offset) { + $parser->error( + 'An offset was expected.', + $list->tokens[$list->idx - 1] + ); + } + + --$list->idx; + + return $ret; + } + + /** + * @param Limit $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + return $component->offset . ', ' . $component->rowCount; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/LockExpression.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/LockExpression.php new file mode 100755 index 0000000..1a2479d --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/LockExpression.php @@ -0,0 +1,204 @@ + 1 + * 1 ---------------- [ lock_type ] ----------------> 2 + * 2 -------------------- [ , ] --------------------> break + * + * @var int + */ + $state = 0; + + $prevToken = null; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER + || ($token->type === Token::TYPE_OPERATOR + && $token->value === ',') + ) { + break; + } + + if ($state === 0) { + $ret->table = Expression::parse($parser, $list, array('parseField' => 'table')); + $state = 1; + } elseif ($state === 1) { + // parse lock type + $ret->type = self::parseLockType($parser, $list); + $state = 2; + } + $prevToken = $token; + } + + // 2 is the only valid end state + if ($state !== 2) { + $parser->error('Unexpected end of LOCK expression.', $prevToken); + } + + --$list->idx; + + return $ret; + } + + /** + * @param LockExpression|LockExpression[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(', ', $component); + } + + return $component->table . ' ' . $component->type; + } + + private static function parseLockType(Parser $parser, TokensList $list) + { + $lockType = ''; + + /** + * The state of the parser while parsing for lock type. + * + * Below are the states of the parser. + * + * 0 ---------------- [ READ ] -----------------> 1 + * 0 ------------- [ LOW_PRIORITY ] ------------> 2 + * 0 ---------------- [ WRITE ] ----------------> 3 + * 1 ---------------- [ LOCAL ] ----------------> 3 + * 2 ---------------- [ WRITE ] ----------------> 3 + * + * @var int + */ + $state = 0; + + $prevToken = null; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER + || ($token->type === Token::TYPE_OPERATOR + && $token->value === ',') + ) { + --$list->idx; + break; + } + + // Skipping whitespaces and comments. + if ($token->type === Token::TYPE_WHITESPACE || $token->type === Token::TYPE_COMMENT) { + continue; + } + + // We only expect keywords + if ($token->type !== Token::TYPE_KEYWORD) { + $parser->error('Unexpected token.', $token); + break; + } + + if ($state === 0) { + if ($token->keyword === 'READ') { + $state = 1; + } elseif ($token->keyword === 'LOW_PRIORITY') { + $state = 2; + } elseif ($token->keyword === 'WRITE') { + $state = 3; + } else { + $parser->error('Unexpected keyword.', $token); + break; + } + $lockType .= $token->keyword; + } elseif ($state === 1) { + if ($token->keyword === 'LOCAL') { + $lockType .= ' ' . $token->keyword; + $state = 3; + } else { + $parser->error('Unexpected keyword.', $token); + break; + } + } elseif ($state === 2) { + if ($token->keyword === 'WRITE') { + $lockType .= ' ' . $token->keyword; + $state = 3; // parsing over + } else { + $parser->error('Unexpected keyword.', $token); + break; + } + } + + $prevToken = $token; + } + + // Only two possible end states + if ($state !== 1 && $state !== 3) { + $parser->error('Unexpected end of Lock expression.', $prevToken); + } + + return $lockType; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/OptionsArray.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/OptionsArray.php new file mode 100755 index 0000000..69aabb3 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/OptionsArray.php @@ -0,0 +1,373 @@ +options = $options; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return OptionsArray + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * The ID that will be assigned to duplicate options. + * + * @var int + */ + $lastAssignedId = count($options) + 1; + + /** + * The option that was processed last time. + * + * @var array + */ + $lastOption = null; + + /** + * The index of the option that was processed last time. + * + * @var int + */ + $lastOptionId = 0; + + /** + * Counts brackets. + * + * @var int + */ + $brackets = 0; + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------------[ option ]----------------------> 1 + * + * 1 -------------------[ = (optional) ]------------------> 2 + * + * 2 ----------------------[ value ]----------------------> 0 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping comments. + if ($token->type === Token::TYPE_COMMENT) { + continue; + } + + // Skipping whitespace if not parsing value. + if (($token->type === Token::TYPE_WHITESPACE) && ($brackets === 0)) { + continue; + } + + if ($lastOption === null) { + $upper = strtoupper($token->token); + if (isset($options[$upper])) { + $lastOption = $options[$upper]; + $lastOptionId = is_array($lastOption) ? + $lastOption[0] : $lastOption; + $state = 0; + + // Checking for option conflicts. + // For example, in `SELECT` statements the keywords `ALL` + // and `DISTINCT` conflict and if used together, they + // produce an invalid query. + // + // Usually, tokens can be identified in the array by the + // option ID, but if conflicts occur, a generated option ID + // is used. + // + // The first pseudo duplicate ID is the maximum value of the + // real options (e.g. if there are 5 options, the first + // fake ID is 6). + if (isset($ret->options[$lastOptionId])) { + $parser->error( + sprintf( + Translator::gettext('This option conflicts with "%1$s".'), + is_array($ret->options[$lastOptionId]) + ? $ret->options[$lastOptionId]['name'] + : $ret->options[$lastOptionId] + ), + $token + ); + $lastOptionId = $lastAssignedId++; + } + } else { + // There is no option to be processed. + break; + } + } + + if ($state === 0) { + if (! is_array($lastOption)) { + // This is a just keyword option without any value. + // This is the beginning and the end of it. + $ret->options[$lastOptionId] = $token->value; + $lastOption = null; + $state = 0; + } elseif (($lastOption[1] === 'var') || ($lastOption[1] === 'var=')) { + // This is a keyword that is followed by a value. + // This is only the beginning. The value is parsed in state + // 1 and 2. State 1 is used to skip the first equals sign + // and state 2 to parse the actual value. + $ret->options[$lastOptionId] = array( + // @var string The name of the option. + 'name' => $token->value, + // @var bool Whether it contains an equal sign. + // This is used by the builder to rebuild it. + 'equals' => $lastOption[1] === 'var=', + // @var string Raw value. + 'expr' => '', + // @var string Processed value. + 'value' => '' + ); + $state = 1; + } elseif ($lastOption[1] === 'expr' || $lastOption[1] === 'expr=') { + // This is a keyword that is followed by an expression. + // The expression is used by the specialized parser. + + // Skipping this option in order to parse the expression. + ++$list->idx; + $ret->options[$lastOptionId] = array( + // @var string The name of the option. + 'name' => $token->value, + // @var bool Whether it contains an equal sign. + // This is used by the builder to rebuild it. + 'equals' => $lastOption[1] === 'expr=', + // @var Expression The parsed expression. + 'expr' => '' + ); + $state = 1; + } + } elseif ($state === 1) { + $state = 2; + if ($token->token === '=') { + $ret->options[$lastOptionId]['equals'] = true; + continue; + } + } + + // This is outside the `elseif` group above because the change might + // change this iteration. + if ($state === 2) { + if ($lastOption[1] === 'expr' || $lastOption[1] === 'expr=') { + $ret->options[$lastOptionId]['expr'] = Expression::parse( + $parser, + $list, + empty($lastOption[2]) ? array() : $lastOption[2] + ); + $ret->options[$lastOptionId]['value'] + = $ret->options[$lastOptionId]['expr']->expr; + $lastOption = null; + $state = 0; + } else { + if ($token->token === '(') { + ++$brackets; + } elseif ($token->token === ')') { + --$brackets; + } + + $ret->options[$lastOptionId]['expr'] .= $token->token; + + if (! ((($token->token === '(') && ($brackets === 1)) + || (($token->token === ')') && ($brackets === 0))) + ) { + // First pair of brackets is being skipped. + $ret->options[$lastOptionId]['value'] .= $token->value; + } + + // Checking if we finished parsing. + if ($brackets === 0) { + $lastOption = null; + } + } + } + } + + /* + * We reached the end of statement without getting a value + * for an option for which a value was required + */ + if ($state === 1 + && $lastOption + && ($lastOption[1] === 'expr' + || $lastOption[1] === 'var' + || $lastOption[1] === 'var=' + || $lastOption[1] === 'expr=') + ) { + $parser->error( + sprintf( + 'Value/Expression for the option %1$s was expected.', + $ret->options[$lastOptionId]['name'] + ), + $list->tokens[$list->idx - 1] + ); + } + + if (empty($options['_UNSORTED'])) { + ksort($ret->options); + } + + --$list->idx; + + return $ret; + } + + /** + * @param OptionsArray $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (empty($component->options)) { + return ''; + } + + $options = array(); + foreach ($component->options as $option) { + if (! is_array($option)) { + $options[] = $option; + } else { + $options[] = $option['name'] + . ((! empty($option['equals']) && $option['equals']) ? '=' : ' ') + . (! empty($option['expr']) ? $option['expr'] : $option['value']); + } + } + + return implode(' ', $options); + } + + /** + * Checks if it has the specified option and returns it value or true. + * + * @param string $key the key to be checked + * @param bool $getExpr Gets the expression instead of the value. + * The value is the processed form of the expression. + * + * @return mixed + */ + public function has($key, $getExpr = false) + { + foreach ($this->options as $option) { + if (is_array($option)) { + if (! strcasecmp($key, $option['name'])) { + return $getExpr ? $option['expr'] : $option['value']; + } + } elseif (! strcasecmp($key, $option)) { + return true; + } + } + + return false; + } + + /** + * Removes the option from the array. + * + * @param string $key the key to be removed + * + * @return bool whether the key was found and deleted or not + */ + public function remove($key) + { + foreach ($this->options as $idx => $option) { + if (is_array($option)) { + if (! strcasecmp($key, $option['name'])) { + unset($this->options[$idx]); + + return true; + } + } elseif (! strcasecmp($key, $option)) { + unset($this->options[$idx]); + + return true; + } + } + + return false; + } + + /** + * Merges the specified options with these ones. Values with same ID will be + * replaced. + * + * @param array|OptionsArray $options the options to be merged + */ + public function merge($options) + { + if (is_array($options)) { + $this->options = array_merge_recursive($this->options, $options); + } elseif ($options instanceof self) { + $this->options = array_merge_recursive($this->options, $options->options); + } + } + + /** + * Checks tf there are no options set. + * + * @return bool + */ + public function isEmpty() + { + return empty($this->options); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/OrderKeyword.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/OrderKeyword.php new file mode 100755 index 0000000..1e77f57 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/OrderKeyword.php @@ -0,0 +1,140 @@ +expr = $expr; + $this->type = $type; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return OrderKeyword[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + + $expr = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 --------------------[ expression ]-------------------> 1 + * + * 1 ------------------------[ , ]------------------------> 0 + * 1 -------------------[ ASC / DESC ]--------------------> 1 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $expr->expr = Expression::parse($parser, $list); + $state = 1; + } elseif ($state === 1) { + if (($token->type === Token::TYPE_KEYWORD) + && (($token->keyword === 'ASC') || ($token->keyword === 'DESC')) + ) { + $expr->type = $token->keyword; + } elseif (($token->type === Token::TYPE_OPERATOR) + && ($token->value === ',') + ) { + if (! empty($expr->expr)) { + $ret[] = $expr; + } + $expr = new self(); + $state = 0; + } else { + break; + } + } + } + + // Last iteration was not processed. + if (! empty($expr->expr)) { + $ret[] = $expr; + } + + --$list->idx; + + return $ret; + } + + /** + * @param OrderKeyword|OrderKeyword[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(', ', $component); + } + + return $component->expr . ' ' . $component->type; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ParameterDefinition.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ParameterDefinition.php new file mode 100755 index 0000000..831ee4b --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/ParameterDefinition.php @@ -0,0 +1,171 @@ +name = $name; + $this->inOut = $inOut; + $this->type = $type; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return ParameterDefinition[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + + $expr = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 -----------------------[ ( ]------------------------> 1 + * + * 1 ----------------[ IN / OUT / INOUT ]----------------> 1 + * 1 ----------------------[ name ]----------------------> 2 + * + * 2 -------------------[ data type ]--------------------> 3 + * + * 3 ------------------------[ , ]-----------------------> 1 + * 3 ------------------------[ ) ]-----------------------> (END) + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + $state = 1; + } + continue; + } elseif ($state === 1) { + if (($token->value === 'IN') || ($token->value === 'OUT') || ($token->value === 'INOUT')) { + $expr->inOut = $token->value; + ++$list->idx; + } elseif ($token->value === ')') { + ++$list->idx; + break; + } else { + $expr->name = $token->value; + $state = 2; + } + } elseif ($state === 2) { + $expr->type = DataType::parse($parser, $list); + $state = 3; + } elseif ($state === 3) { + $ret[] = $expr; + $expr = new self(); + if ($token->value === ',') { + $state = 1; + } elseif ($token->value === ')') { + ++$list->idx; + break; + } + } + } + + // Last iteration was not saved. + if (isset($expr->name) && ($expr->name !== '')) { + $ret[] = $expr; + } + + --$list->idx; + + return $ret; + } + + /** + * @param ParameterDefinition[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return '(' . implode(', ', $component) . ')'; + } + + $tmp = ''; + if (! empty($component->inOut)) { + $tmp .= $component->inOut . ' '; + } + + return trim( + $tmp . Context::escape($component->name) . ' ' . $component->type + ); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/PartitionDefinition.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/PartitionDefinition.php new file mode 100755 index 0000000..53da148 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/PartitionDefinition.php @@ -0,0 +1,253 @@ + array( + 1, + 'var', + ), + 'ENGINE' => array( + 1, + 'var', + ), + 'COMMENT' => array( + 2, + 'var', + ), + 'DATA DIRECTORY' => array( + 3, + 'var', + ), + 'INDEX DIRECTORY' => array( + 4, + 'var', + ), + 'MAX_ROWS' => array( + 5, + 'var', + ), + 'MIN_ROWS' => array( + 6, + 'var', + ), + 'TABLESPACE' => array( + 7, + 'var', + ), + 'NODEGROUP' => array( + 8, + 'var', + ) + ); + + /** + * Whether this entry is a subpartition or a partition. + * + * @var bool + */ + public $isSubpartition; + + /** + * The name of this partition. + * + * @var string + */ + public $name; + + /** + * The type of this partition (what follows the `VALUES` keyword). + * + * @var string + */ + public $type; + + /** + * The expression used to defined this partition. + * + * @var Expression|string + */ + public $expr; + + /** + * The subpartitions of this partition. + * + * @var PartitionDefinition[] + */ + public $subpartitions; + + /** + * The options of this field. + * + * @var OptionsArray + */ + public $options; + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return PartitionDefinition + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 -------------[ PARTITION | SUBPARTITION ]------------> 1 + * + * 1 -----------------------[ name ]----------------------> 2 + * + * 2 ----------------------[ VALUES ]---------------------> 3 + * + * 3 ---------------------[ LESS THAN ]-------------------> 4 + * 3 ------------------------[ IN ]-----------------------> 4 + * + * 4 -----------------------[ expr ]----------------------> 5 + * + * 5 ----------------------[ options ]--------------------> 6 + * + * 6 ------------------[ subpartitions ]------------------> (END) + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $ret->isSubpartition = ($token->type === Token::TYPE_KEYWORD) && ($token->keyword === 'SUBPARTITION'); + $state = 1; + } elseif ($state === 1) { + $ret->name = $token->value; + + // Looking ahead for a 'VALUES' keyword. + // Loop until the end of the partition name (delimited by a whitespace) + while ($nextToken = $list->tokens[++$list->idx]) { + if ($nextToken->type !== Token::TYPE_NONE) { + break; + } + $ret->name .= $nextToken->value; + } + $idx = $list->idx--; + // Get the first token after the white space. + $nextToken = $list->tokens[++$idx]; + + $state = ($nextToken->type === Token::TYPE_KEYWORD) + && ($nextToken->value === 'VALUES') + ? 2 : 5; + } elseif ($state === 2) { + $state = 3; + } elseif ($state === 3) { + $ret->type = $token->value; + $state = 4; + } elseif ($state === 4) { + if ($token->value === 'MAXVALUE') { + $ret->expr = $token->value; + } else { + $ret->expr = Expression::parse( + $parser, + $list, + array( + 'parenthesesDelimited' => true, + 'breakOnAlias' => true + ) + ); + } + $state = 5; + } elseif ($state === 5) { + $ret->options = OptionsArray::parse($parser, $list, static::$OPTIONS); + $state = 6; + } elseif ($state === 6) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + $ret->subpartitions = ArrayObj::parse( + $parser, + $list, + array( + 'type' => 'PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition' + ) + ); + ++$list->idx; + } + break; + } + } + + --$list->idx; + + return $ret; + } + + /** + * @param PartitionDefinition|PartitionDefinition[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return "(\n" . implode(",\n", $component) . "\n)"; + } + + if ($component->isSubpartition) { + return trim('SUBPARTITION ' . $component->name . ' ' . $component->options); + } + + $subpartitions = empty($component->subpartitions) ? '' : ' ' . self::build($component->subpartitions); + + return trim( + 'PARTITION ' . $component->name + . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr . ' ') + . ((! empty($component->options) && ! empty($component->type)) ? '' : ' ') . $component->options . $subpartitions + ); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Reference.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Reference.php new file mode 100755 index 0000000..38fc060 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/Reference.php @@ -0,0 +1,162 @@ + array( + 1, + 'var', + ), + 'ON DELETE' => array( + 2, + 'var', + ), + 'ON UPDATE' => array( + 3, + 'var', + ) + ); + + /** + * The referenced table. + * + * @var Expression + */ + public $table; + + /** + * The referenced columns. + * + * @var array + */ + public $columns; + + /** + * The options of the referencing. + * + * @var OptionsArray + */ + public $options; + + /** + * Constructor. + * + * @param Expression $table the name of the table referenced + * @param array $columns the columns referenced + * @param OptionsArray $options the options + */ + public function __construct($table = null, array $columns = array(), $options = null) + { + $this->table = $table; + $this->columns = $columns; + $this->options = $options; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return Reference + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ----------------------[ table ]---------------------> 1 + * + * 1 ---------------------[ columns ]--------------------> 2 + * + * 2 ---------------------[ options ]--------------------> (END) + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $ret->table = Expression::parse( + $parser, + $list, + array( + 'parseField' => 'table', + 'breakOnAlias' => true + ) + ); + $state = 1; + } elseif ($state === 1) { + $ret->columns = ArrayObj::parse($parser, $list)->values; + $state = 2; + } elseif ($state === 2) { + $ret->options = OptionsArray::parse($parser, $list, static::$REFERENCES_OPTIONS); + ++$list->idx; + break; + } + } + + --$list->idx; + + return $ret; + } + + /** + * @param Reference $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + return trim( + $component->table + . ' (' . implode(', ', Context::escape($component->columns)) . ') ' + . $component->options + ); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/RenameOperation.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/RenameOperation.php new file mode 100755 index 0000000..bf6167b --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/RenameOperation.php @@ -0,0 +1,182 @@ +old = $old; + $this->new = $new; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return RenameOperation[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + + $expr = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------------[ old name ]--------------------> 1 + * + * 1 ------------------------[ TO ]-----------------------> 2 + * + * 2 ---------------------[ new name ]--------------------> 3 + * + * 3 ------------------------[ , ]------------------------> 0 + * 3 -----------------------[ else ]----------------------> (END) + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $expr->old = Expression::parse( + $parser, + $list, + array( + 'breakOnAlias' => true, + 'parseField' => 'table' + ) + ); + if (empty($expr->old)) { + $parser->error( + 'The old name of the table was expected.', + $token + ); + } + $state = 1; + } elseif ($state === 1) { + if ($token->type === Token::TYPE_KEYWORD && $token->keyword === 'TO') { + $state = 2; + } else { + $parser->error( + 'Keyword "TO" was expected.', + $token + ); + break; + } + } elseif ($state === 2) { + $expr->new = Expression::parse( + $parser, + $list, + array( + 'breakOnAlias' => true, + 'parseField' => 'table' + ) + ); + if (empty($expr->new)) { + $parser->error( + 'The new name of the table was expected.', + $token + ); + } + $state = 3; + } elseif ($state === 3) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ',')) { + $ret[] = $expr; + $expr = new self(); + $state = 0; + } else { + break; + } + } + } + + if ($state !== 3) { + $parser->error( + 'A rename operation was expected.', + $list->tokens[$list->idx - 1] + ); + } + + // Last iteration was not saved. + if (! empty($expr->old)) { + $ret[] = $expr; + } + + --$list->idx; + + return $ret; + } + + /** + * @param RenameOperation $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(', ', $component); + } + + return $component->old . ' TO ' . $component->new; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/SetOperation.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/SetOperation.php new file mode 100755 index 0000000..e7d501a --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/SetOperation.php @@ -0,0 +1,161 @@ +column = $column; + $this->value = $value; + } + + /** + * @param Parser $parser the parser that serves as context + * @param TokensList $list the list of tokens that are being parsed + * @param array $options parameters for parsing + * + * @return SetOperation[] + */ + public static function parse(Parser $parser, TokensList $list, array $options = array()) + { + $ret = array(); + + $expr = new self(); + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------------[ col_name ]--------------------> 0 + * 0 ------------------------[ = ]------------------------> 1 + * 1 -----------------------[ value ]---------------------> 1 + * 1 ------------------------[ , ]------------------------> 0 + * + * @var int + */ + $state = 0; + + /** + * Token when the parser has seen the latest comma + * + * @var Token + */ + $commaLastSeenAt = null; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + // No keyword is expected. + if (($token->type === Token::TYPE_KEYWORD) + && ($token->flags & Token::FLAG_KEYWORD_RESERVED) + && ($state === 0) + ) { + break; + } + + if ($state === 0) { + if ($token->token === '=') { + $state = 1; + } elseif ($token->value !== ',') { + $expr->column .= $token->token; + } elseif ($token->value === ',') { + $commaLastSeenAt = $token; + } + } elseif ($state === 1) { + $tmp = Expression::parse( + $parser, + $list, + array( + 'breakOnAlias' => true + ) + ); + if (is_null($tmp)) { + $parser->error('Missing expression.', $token); + break; + } + $expr->column = trim($expr->column); + $expr->value = $tmp->expr; + $ret[] = $expr; + $expr = new self(); + $state = 0; + $commaLastSeenAt = null; + } + } + --$list->idx; + + // We saw a comma, but didn't see a column-value pair after it + if ($commaLastSeenAt !== null) { + $parser->error('Unexpected token.', $commaLastSeenAt); + } + + return $ret; + } + + /** + * @param SetOperation|SetOperation[] $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + if (is_array($component)) { + return implode(', ', $component); + } + + return $component->column . ' = ' . $component->value; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/UnionKeyword.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/UnionKeyword.php new file mode 100755 index 0000000..6867615 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Components/UnionKeyword.php @@ -0,0 +1,35 @@ + $component the component to be built + * @param array $options parameters for building + * + * @return string + */ + public static function build($component, array $options = array()) + { + $tmp = array(); + foreach ($component as $componentPart) { + $tmp[] = $componentPart[0] . ' ' . $componentPart[1]; + } + + return implode(' ', $tmp); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Context.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Context.php new file mode 100755 index 0000000..d95d5a4 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Context.php @@ -0,0 +1,620 @@ + 1, + '*' => 1, + '+' => 1, + '-' => 1, + '/' => 1, + + // @see Token::FLAG_OPERATOR_LOGICAL + '!' => 2, + '!=' => 2, + '&&' => 2, + '<' => 2, + '<=' => 2, + '<=>' => 2, + '<>' => 2, + '=' => 2, + '>' => 2, + '>=' => 2, + '||' => 2, + + // @see Token::FLAG_OPERATOR_BITWISE + '&' => 4, + '<<' => 4, + '>>' => 4, + '^' => 4, + '|' => 4, + '~' => 4, + + // @see Token::FLAG_OPERATOR_ASSIGNMENT + ':=' => 8, + + // @see Token::FLAG_OPERATOR_SQL + '(' => 16, + ')' => 16, + '.' => 16, + ',' => 16, + ';' => 16 + ); + + /** + * The mode of the MySQL server that will be used in lexing, parsing and + * building the statements. + * + * @var int + */ + public static $MODE = 0; + + /* + * Server SQL Modes + * https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html + */ + + // Compatibility mode for Microsoft's SQL server. + // This is the equivalent of ANSI_QUOTES. + const SQL_MODE_COMPAT_MYSQL = 2; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_allow_invalid_dates + const SQL_MODE_ALLOW_INVALID_DATES = 1; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_ansi_quotes + const SQL_MODE_ANSI_QUOTES = 2; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_error_for_division_by_zero + const SQL_MODE_ERROR_FOR_DIVISION_BY_ZERO = 4; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_high_not_precedence + const SQL_MODE_HIGH_NOT_PRECEDENCE = 8; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_ignore_space + const SQL_MODE_IGNORE_SPACE = 16; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_auto_create_user + const SQL_MODE_NO_AUTO_CREATE_USER = 32; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_auto_value_on_zero + const SQL_MODE_NO_AUTO_VALUE_ON_ZERO = 64; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_backslash_escapes + const SQL_MODE_NO_BACKSLASH_ESCAPES = 128; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_dir_in_create + const SQL_MODE_NO_DIR_IN_CREATE = 256; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_dir_in_create + const SQL_MODE_NO_ENGINE_SUBSTITUTION = 512; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_field_options + const SQL_MODE_NO_FIELD_OPTIONS = 1024; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_key_options + const SQL_MODE_NO_KEY_OPTIONS = 2048; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_table_options + const SQL_MODE_NO_TABLE_OPTIONS = 4096; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_unsigned_subtraction + const SQL_MODE_NO_UNSIGNED_SUBTRACTION = 8192; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_zero_date + const SQL_MODE_NO_ZERO_DATE = 16384; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_no_zero_in_date + const SQL_MODE_NO_ZERO_IN_DATE = 32768; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_only_full_group_by + const SQL_MODE_ONLY_FULL_GROUP_BY = 65536; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_pipes_as_concat + const SQL_MODE_PIPES_AS_CONCAT = 131072; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_real_as_float + const SQL_MODE_REAL_AS_FLOAT = 262144; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_all_tables + const SQL_MODE_STRICT_ALL_TABLES = 524288; + + // https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sqlmode_strict_trans_tables + const SQL_MODE_STRICT_TRANS_TABLES = 1048576; + + // Custom modes. + + // The table and column names and any other field that must be escaped will + // not be. + // Reserved keywords are being escaped regardless this mode is used or not. + const SQL_MODE_NO_ENCLOSING_QUOTES = 1073741824; + + /* + * Combination SQL Modes + * https://dev.mysql.com/doc/refman/5.0/en/sql-mode.html#sql-mode-combo + */ + + // REAL_AS_FLOAT, PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE + const SQL_MODE_ANSI = 393234; + + // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, + // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, + const SQL_MODE_DB2 = 138258; + + // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, + // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER + const SQL_MODE_MAXDB = 138290; + + // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, + // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS + const SQL_MODE_MSSQL = 138258; + + // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, + // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER + const SQL_MODE_ORACLE = 138290; + + // PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, NO_KEY_OPTIONS, + // NO_TABLE_OPTIONS, NO_FIELD_OPTIONS + const SQL_MODE_POSTGRESQL = 138258; + + // STRICT_TRANS_TABLES, STRICT_ALL_TABLES, NO_ZERO_IN_DATE, NO_ZERO_DATE, + // ERROR_FOR_DIVISION_BY_ZERO, NO_AUTO_CREATE_USER + const SQL_MODE_TRADITIONAL = 1622052; + + // ------------------------------------------------------------------------- + // Keyword. + + /** + * Checks if the given string is a keyword. + * + * @param string $str string to be checked + * @param bool $isReserved checks if the keyword is reserved + * + * @return int|null + */ + public static function isKeyword($str, $isReserved = false) + { + $str = strtoupper($str); + + if (isset(static::$KEYWORDS[$str])) { + if ($isReserved && ! (static::$KEYWORDS[$str] & Token::FLAG_KEYWORD_RESERVED)) { + return null; + } + + return static::$KEYWORDS[$str]; + } + + return null; + } + + // ------------------------------------------------------------------------- + // Operator. + + /** + * Checks if the given string is an operator. + * + * @param string $str string to be checked + * + * @return int|null the appropriate flag for the operator + */ + public static function isOperator($str) + { + if (! isset(static::$OPERATORS[$str])) { + return null; + } + + return static::$OPERATORS[$str]; + } + + // ------------------------------------------------------------------------- + // Whitespace. + + /** + * Checks if the given character is a whitespace. + * + * @param string $str string to be checked + * + * @return bool + */ + public static function isWhitespace($str) + { + return ($str === ' ') || ($str === "\r") || ($str === "\n") || ($str === "\t"); + } + + // ------------------------------------------------------------------------- + // Comment. + + /** + * Checks if the given string is the beginning of a whitespace. + * + * @param string $str string to be checked + * @param mixed $end + * + * @return int|null the appropriate flag for the comment type + */ + public static function isComment($str, $end = false) + { + $len = strlen($str); + if ($len === 0) { + return null; + } + + // If comment is Bash style (#): + if ($str[0] === '#') { + return Token::FLAG_COMMENT_BASH; + } + // If comment is opening C style (/*), warning, it could be a MySQL command (/*!) + if (($len > 1) && ($str[0] === '/') && ($str[1] === '*')) { + return ($len > 2) && ($str[2] === '!') ? + Token::FLAG_COMMENT_MYSQL_CMD : Token::FLAG_COMMENT_C; + } + // If comment is closing C style (*/), warning, it could conflicts with wildcard and a real opening C style. + // It would looks like the following valid SQL statement: "SELECT */* comment */ FROM...". + if (($len > 1) && ($str[0] === '*') && ($str[1] === '/')) { + return Token::FLAG_COMMENT_C; + } + // If comment is SQL style (--\s?): + if (($len > 2) && ($str[0] === '-') + && ($str[1] === '-') && static::isWhitespace($str[2]) + ) { + return Token::FLAG_COMMENT_SQL; + } + if (($len === 2) && $end && ($str[0] === '-') && ($str[1] === '-')) { + return Token::FLAG_COMMENT_SQL; + } + + return null; + } + + // ------------------------------------------------------------------------- + // Bool. + + /** + * Checks if the given string is a boolean value. + * This actually check only for `TRUE` and `FALSE` because `1` or `0` are + * actually numbers and are parsed by specific methods. + * + * @param string $str string to be checked + * + * @return bool + */ + public static function isBool($str) + { + $str = strtoupper($str); + + return ($str === 'TRUE') || ($str === 'FALSE'); + } + + // ------------------------------------------------------------------------- + // Number. + + /** + * Checks if the given character can be a part of a number. + * + * @param string $str string to be checked + * + * @return bool + */ + public static function isNumber($str) + { + return (($str >= '0') && ($str <= '9')) || ($str === '.') + || ($str === '-') || ($str === '+') || ($str === 'e') || ($str === 'E'); + } + + // ------------------------------------------------------------------------- + // Symbol. + + /** + * Checks if the given character is the beginning of a symbol. A symbol + * can be either a variable or a field name. + * + * @param string $str string to be checked + * + * @return int|null the appropriate flag for the symbol type + */ + public static function isSymbol($str) + { + if (strlen($str) === 0) { + return null; + } + if ($str[0] === '@') { + return Token::FLAG_SYMBOL_VARIABLE; + } elseif ($str[0] === '`') { + return Token::FLAG_SYMBOL_BACKTICK; + } elseif ($str[0] === ':' || $str[0] === '?') { + return Token::FLAG_SYMBOL_PARAMETER; + } + + return null; + } + + // ------------------------------------------------------------------------- + // String. + + /** + * Checks if the given character is the beginning of a string. + * + * @param string $str string to be checked + * + * @return int|null the appropriate flag for the string type + */ + public static function isString($str) + { + if (strlen($str) === 0) { + return null; + } + if ($str[0] === '\'') { + return Token::FLAG_STRING_SINGLE_QUOTES; + } elseif ($str[0] === '"') { + return Token::FLAG_STRING_DOUBLE_QUOTES; + } + + return null; + } + + // ------------------------------------------------------------------------- + // Delimiter. + + /** + * Checks if the given character can be a separator for two lexeme. + * + * @param string $str string to be checked + * + * @return bool + */ + public static function isSeparator($str) + { + // NOTES: Only non alphanumeric ASCII characters may be separators. + // `~` is the last printable ASCII character. + return ($str <= '~') + && ($str !== '_') + && ($str !== '$') + && (($str < '0') || ($str > '9')) + && (($str < 'a') || ($str > 'z')) + && (($str < 'A') || ($str > 'Z')); + } + + /** + * Loads the specified context. + * + * Contexts may be used by accessing the context directly. + * + * @param string $context name of the context or full class name that + * defines the context + * + * @throws LoaderException if the specified context doesn't exist + */ + public static function load($context = '') + { + if (empty($context)) { + $context = self::$defaultContext; + } + if ($context[0] !== '\\') { + // Short context name (must be formatted into class name). + $context = self::$contextPrefix . $context; + } + if (! class_exists($context)) { + throw @new LoaderException( + 'Specified context ("' . $context . '") does not exist.', + $context + ); + } + self::$loadedContext = $context; + self::$KEYWORDS = $context::$KEYWORDS; + } + + /** + * Loads the context with the closest version to the one specified. + * + * The closest context is found by replacing last digits with zero until one + * is loaded successfully. + * + * @see Context::load() + * + * @param string $context name of the context or full class name that + * defines the context + * + * @return string|null The loaded context. `null` if no context was loaded. + */ + public static function loadClosest($context = '') + { + $length = strlen($context); + for ($i = $length; $i > 0;) { + try { + /* Trying to load the new context */ + static::load($context); + return $context; + } catch (LoaderException $e) { + /* Replace last two non zero digits by zeroes */ + do { + $i -= 2; + $part = substr($context, $i, 2); + /* No more numeric parts to strip */ + if (! is_numeric($part)) { + break 2; + } + } while (intval($part) === 0 && $i > 0); + $context = substr($context, 0, $i) . '00' . substr($context, $i + 2); + } + } + /* Fallback to loading at least matching engine */ + if (strncmp($context, 'MariaDb', 7) === 0) { + return static::loadClosest('MariaDb100300'); + } elseif (strncmp($context, 'MySql', 5) === 0) { + return static::loadClosest('MySql50700'); + } + return null; + } + + /** + * Sets the SQL mode. + * + * @param string $mode The list of modes. If empty, the mode is reset. + */ + public static function setMode($mode = '') + { + static::$MODE = 0; + if (empty($mode)) { + return; + } + $mode = explode(',', $mode); + foreach ($mode as $m) { + static::$MODE |= constant('static::SQL_MODE_' . $m); + } + } + + /** + * Escapes the symbol by adding surrounding backticks. + * + * @param array|string $str the string to be escaped + * @param string $quote quote to be used when escaping + * + * @return string|array + */ + public static function escape($str, $quote = '`') + { + if (is_array($str)) { + foreach ($str as $key => $value) { + $str[$key] = static::escape($value); + } + + return $str; + } + + if ((static::$MODE & self::SQL_MODE_NO_ENCLOSING_QUOTES) + && (! static::isKeyword($str, true)) + ) { + return $str; + } + + if (static::$MODE & self::SQL_MODE_ANSI_QUOTES) { + $quote = '"'; + } + + return $quote . str_replace($quote, $quote . $quote, $str) . $quote; + } + + /** + * Returns char used to quote identifiers based on currently set SQL Mode (ie. standard or ANSI_QUOTES) + * @return string either " (double quote, ansi_quotes mode) or ` (backtick, standard mode) + */ + public static function getIdentifierQuote() + { + return self::hasMode(self::SQL_MODE_ANSI_QUOTES) ? '"' : '`'; + } + + /** + * Function verifies that given SQL Mode constant is currently set + * + * @return boolean false on empty param, true/false on given constant/int value + * @param int $flag for example Context::SQL_MODE_ANSI_QUOTES + */ + public static function hasMode($flag = null) + { + if (empty($flag)) { + return false; + } + return (self::$MODE & $flag) === $flag; + } +} + +// Initializing the default context. +Context::load(); diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100000.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100000.php new file mode 100755 index 0000000..995d29f --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100000.php @@ -0,0 +1,305 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, + 'ONE' => 1, 'ROW' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, + 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, + 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'OPEN' => 1, 'PAGE' => 1, 'PORT' => 1, + 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, 'THAN' => 1, + 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, + 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'OWNER' => 1, 'PHASE' => 1, 'PROXY' => 1, + 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, 'RTREE' => 1, + 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, + 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, + 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, + 'EVENTS' => 1, 'FAULTS' => 1, 'FIELDS' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, + 'IMPORT' => 1, 'INNODB' => 1, 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, + 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'OFFSET' => 1, 'PARSER' => 1, + 'PLUGIN' => 1, 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, + 'ROLLUP' => 1, 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, + 'SONAME' => 1, 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, + 'STRING' => 1, 'TABLES' => 1, + 'AUTHORS' => 1, 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, 'COMPACT' => 1, + 'CONTEXT' => 1, 'DEFINER' => 1, 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, + 'ENGINES' => 1, 'EXECUTE' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, + 'INSTALL' => 1, 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, + 'OPTIONS' => 1, 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, + 'REBUILD' => 1, 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, + 'SESSION' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, + 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'VIRTUAL' => 1, 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXTENDED' => 1, + 'FUNCTION' => 1, 'INNOBASE' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, + 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'ONE_SHOT' => 1, 'PRESERVE' => 1, + 'PROFILES' => 1, 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, + 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, + 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, 'REDUNDANT' => 1, + 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, + 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PRIVILEGES' => 1, + 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, 'SQL_THREAD' => 1, + 'TABLESPACE' => 1, 'TABLE_NAME' => 1, + 'COLUMN_NAME' => 1, 'CURSOR_NAME' => 1, 'EXTENT_SIZE' => 1, 'FRAC_SECOND' => 1, + 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, 'MYSQL_ERRNO' => 1, + 'PROCESSLIST' => 1, 'REPLICATION' => 1, 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, + 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'CONTRIBUTORS' => 1, 'DES_KEY_FILE' => 1, + 'INITIAL_SIZE' => 1, 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, 'RELAY_THREAD' => 1, + 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, + 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, 'SQL_TSI_MONTH' => 1, + 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, 'SQL_TSI_SECOND' => 1, + 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, 'MASTER_LOG_FILE' => 1, + 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'CONSTRAINT_SCHEMA' => 1, 'IGNORE_SERVER_IDS' => 1, 'MASTER_SSL_CAPATH' => 1, + 'MASTER_SSL_CIPHER' => 1, 'SQL_BUFFER_RESULT' => 1, + 'CONSTRAINT_CATALOG' => 1, + 'SQL_TSI_FRAC_SECOND' => 1, + 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, 'MAX_UPDATES_PER_HOUR' => 1, + 'MAX_USER_CONNECTIONS' => 1, + 'MASTER_HEARTBEAT_PERIOD' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, 'USE' => 3, + 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, + 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, 'REGEXP' => 3, + 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SIGNAL' => 3, + 'UNLOCK' => 3, 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESIGNAL' => 3, 'RESTRICT' => 3, + 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, + 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PARTITION' => 3, + 'PRECISION' => 3, 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'TRIM' => 33, + 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, + 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, + 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, + 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'CONCAT' => 33, 'DECODE' => 33, 'ENCODE' => 33, + 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, 'LENGTH' => 33, + 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, 'SECOND' => 33, + 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'QUARTER' => 33, 'RADIANS' => 33, 'REVERSE' => 33, 'SOUNDEX' => 33, + 'SUBDATE' => 33, 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, + 'VAR_POP' => 33, 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'ENDPOINT' => 33, + 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, + 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, + 'PASSWORD' => 33, 'POSITION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, + 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, + 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, + 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, + 'SUBSTRING' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, + 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, 'UUID_SHORT' => 33, + 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'GEOMFROMWKB' => 33, + 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, + 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, + 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'LINEFROMTEXT' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'INTERIORRINGN' => 33, 'MBRINTERSECTS' => 33, + 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, + 'POINTFROMTEXT' => 33, 'TIMESTAMPDIFF' => 33, + 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, 'POLYGONFROMWKB' => 33, 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'NUMINTERIORRINGS' => 33, + 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, + 'MULTIPOINTFROMTEXT' => 33, + 'MULTIPOLYGONFROMWKB' => 33, 'UNCOMPRESSED_LENGTH' => 33, + 'MULTIPOLYGONFROMTEXT' => 33, + 'MULTILINESTRINGFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, + 'GEOMETRYCOLLECTIONFROMWKB' => 33, + 'GEOMETRYCOLLECTIONFROMTEXT' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100100.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100100.php new file mode 100755 index 0000000..efd7b74 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100100.php @@ -0,0 +1,352 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, + 'ONE' => 1, 'ROW' => 1, 'XID' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, + 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, + 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'ONLY' => 1, 'OPEN' => 1, 'PAGE' => 1, + 'PORT' => 1, 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, + 'THAN' => 1, 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, + 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'NEVER' => 1, 'OWNER' => 1, 'PHASE' => 1, + 'PROXY' => 1, 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, + 'RTREE' => 1, 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, + 'SWAPS' => 1, 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'ALWAYS' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, + 'CLIENT' => 1, 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, + 'ESCAPE' => 1, 'EVENTS' => 1, 'EXPIRE' => 1, 'EXPORT' => 1, 'FAULTS' => 1, + 'FIELDS' => 1, 'FILTER' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, 'IMPORT' => 1, + 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, 'MEDIUM' => 1, 'MEMORY' => 1, + 'MODIFY' => 1, 'NUMBER' => 1, 'OFFSET' => 1, 'PARSER' => 1, 'PLUGIN' => 1, + 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, + 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, 'SONAME' => 1, + 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, 'STRING' => 1, + 'TABLES' => 1, + 'ACCOUNT' => 1, 'ANALYSE' => 1, 'CHANGED' => 1, 'CHANNEL' => 1, 'COLUMNS' => 1, + 'COMMENT' => 1, 'COMPACT' => 1, 'CONTEXT' => 1, 'CURRENT' => 1, 'DEFINER' => 1, + 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, 'EXECUTE' => 1, + 'FOLLOWS' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, + 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, + 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, + 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, + 'STACKED' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, + 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'WITHOUT' => 1, 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXCHANGE' => 1, + 'EXTENDED' => 1, 'FUNCTION' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, + 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'PRECEDES' => 1, 'PRESERVE' => 1, + 'PROFILES' => 1, 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, + 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, + 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, 'REDUNDANT' => 1, + 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, + 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PLUGIN_DIR' => 1, + 'PRIVILEGES' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, + 'SQL_THREAD' => 1, 'TABLESPACE' => 1, 'TABLE_NAME' => 1, 'VALIDATION' => 1, + 'COLUMN_NAME' => 1, 'COMPRESSION' => 1, 'CURSOR_NAME' => 1, 'DIAGNOSTICS' => 1, + 'EXTENT_SIZE' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, + 'MYSQL_ERRNO' => 1, 'NONBLOCKING' => 1, 'PROCESSLIST' => 1, 'REPLICATION' => 1, + 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'DEFAULT_AUTH' => 1, 'DES_KEY_FILE' => 1, + 'INITIAL_SIZE' => 1, 'MASTER_DELAY' => 1, 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, + 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, + 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'COLUMN_FORMAT' => 1, 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, + 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_CRL' => 1, 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, + 'SQL_TSI_SECOND' => 1, 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, 'FILE_BLOCK_SIZE' => 1, + 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'PARSE_GCOL_EXPR' => 1, + 'REPLICATE_DO_DB' => 1, 'SQL_AFTER_GTIDS' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'SQL_BEFORE_GTIDS' => 1, + 'STATS_PERSISTENT' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'CONSTRAINT_SCHEMA' => 1, 'GROUP_REPLICATION' => 1, 'IGNORE_SERVER_IDS' => 1, + 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'RETURNED_SQLSTATE' => 1, + 'SQL_BUFFER_RESULT' => 1, 'STATS_AUTO_RECALC' => 1, + 'CONSTRAINT_CATALOG' => 1, 'MASTER_RETRY_COUNT' => 1, 'MASTER_SSL_CRLPATH' => 1, + 'MAX_STATEMENT_TIME' => 1, 'REPLICATE_DO_TABLE' => 1, 'SQL_AFTER_MTS_GAPS' => 1, + 'STATS_SAMPLE_PAGES' => 1, + 'REPLICATE_IGNORE_DB' => 1, + 'MASTER_AUTO_POSITION' => 1, 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, + 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, 'REPLICATE_REWRITE_DB' => 1, + 'REPLICATE_IGNORE_TABLE' => 1, + 'MASTER_HEARTBEAT_PERIOD' => 1, 'REPLICATE_WILD_DO_TABLE' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + 'REPLICATE_WILD_IGNORE_TABLE' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'GET' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, + 'USE' => 3, 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, + 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, 'REGEXP' => 3, + 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SIGNAL' => 3, + 'STORED' => 3, 'UNLOCK' => 3, 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, 'VIRTUAL' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESIGNAL' => 3, 'RESTRICT' => 3, + 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, + 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'GENERATED' => 3, 'MIDDLEINT' => 3, + 'PARTITION' => 3, 'PRECISION' => 3, 'PROCEDURE' => 3, 'SENSITIVE' => 3, + 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'MASTER_BIND' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'IO_AFTER_GTIDS' => 3, 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, 'IO_BEFORE_GTIDS' => 3, 'OPTIMIZER_COSTS' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'ST_X' => 33, + 'ST_Y' => 33, 'TRIM' => 33, 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, + 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, + 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, + 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'BUFFER' => 33, 'CONCAT' => 33, 'DECODE' => 33, + 'ENCODE' => 33, 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, + 'LENGTH' => 33, 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, + 'SECOND' => 33, 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'IS_IPV4' => 33, 'IS_IPV6' => 33, 'QUARTER' => 33, 'RADIANS' => 33, + 'REVERSE' => 33, 'SOUNDEX' => 33, 'ST_AREA' => 33, 'ST_SRID' => 33, 'SUBDATE' => 33, + 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, 'VAR_POP' => 33, + 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'DISTANCE' => 33, + 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, + 'ISSIMPLE' => 33, 'JSON_SET' => 33, 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, + 'MBREQUAL' => 33, 'OVERLAPS' => 33, 'PASSWORD' => 33, 'POSITION' => 33, 'ST_ASWKB' => 33, + 'ST_ASWKT' => 33, 'ST_UNION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'ANY_VALUE' => 33, 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, + 'CONCAT_WS' => 33, 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, + 'FROM_DAYS' => 33, 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, + 'JSON_KEYS' => 33, 'JSON_TYPE' => 33, 'LOAD_FILE' => 33, 'MBRCOVERS' => 33, + 'MBREQUALS' => 33, 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, + 'ROW_COUNT' => 33, 'ST_ASTEXT' => 33, 'ST_BUFFER' => 33, 'ST_EQUALS' => 33, + 'ST_LENGTH' => 33, 'ST_POINTN' => 33, 'ST_WITHIN' => 33, 'SUBSTRING' => 33, + 'TO_BASE64' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'CONVEXHULL' => 33, 'DAYOFMONTH' => 33, + 'EXPORT_SET' => 33, 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INET6_ATON' => 33, + 'INET6_NTOA' => 33, 'INTERSECTS' => 33, 'JSON_ARRAY' => 33, 'JSON_DEPTH' => 33, + 'JSON_MERGE' => 33, 'JSON_QUOTE' => 33, 'JSON_VALID' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'ST_CROSSES' => 33, 'ST_GEOHASH' => 33, 'ST_ISEMPTY' => 33, + 'ST_ISVALID' => 33, 'ST_TOUCHES' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, + 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'FROM_BASE64' => 33, + 'GEOMFROMWKB' => 33, 'GTID_SUBSET' => 33, 'JSON_INSERT' => 33, 'JSON_LENGTH' => 33, + 'JSON_OBJECT' => 33, 'JSON_PRETTY' => 33, 'JSON_REMOVE' => 33, 'JSON_SEARCH' => 33, + 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, + 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, + 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'ST_ASBINARY' => 33, 'ST_CENTROID' => 33, + 'ST_CONTAINS' => 33, 'ST_DISJOINT' => 33, 'ST_DISTANCE' => 33, 'ST_ENDPOINT' => 33, + 'ST_ENVELOPE' => 33, 'ST_ISCLOSED' => 33, 'ST_ISSIMPLE' => 33, 'ST_OVERLAPS' => 33, + 'ST_SIMPLIFY' => 33, 'ST_VALIDATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'JSON_EXTRACT' => 33, 'JSON_REPLACE' => 33, 'JSON_UNQUOTE' => 33, 'LINEFROMTEXT' => 33, + 'MBRCOVEREDBY' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RANDOM_BYTES' => 33, 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'ST_ASGEOJSON' => 33, + 'ST_DIMENSION' => 33, 'ST_GEOMETRYN' => 33, 'ST_NUMPOINTS' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'GTID_SUBTRACT' => 33, 'INTERIORRINGN' => 33, + 'JSON_CONTAINS' => 33, 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, + 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, 'ST_CONVEXHULL' => 33, + 'ST_DIFFERENCE' => 33, 'ST_INTERSECTS' => 33, 'ST_STARTPOINT' => 33, 'TIMESTAMPDIFF' => 33, + 'WEIGHT_STRING' => 33, + 'IS_IPV4_COMPAT' => 33, 'IS_IPV4_MAPPED' => 33, 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, + 'POLYGONFROMWKB' => 33, 'ST_GEOMFROMWKB' => 33, 'ST_LINEFROMWKB' => 33, 'ST_POLYFROMWKB' => 33, + 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, 'ST_EXTERIORRING' => 33, + 'ST_GEOMETRYTYPE' => 33, 'ST_GEOMFROMTEXT' => 33, 'ST_INTERSECTION' => 33, 'ST_LINEFROMTEXT' => 33, + 'ST_MAKEENVELOPE' => 33, 'ST_MLINEFROMWKB' => 33, 'ST_MPOLYFROMWKB' => 33, 'ST_POINTFROMWKB' => 33, + 'ST_POLYFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'JSON_MERGE_PATCH' => 33, 'NUMINTERIORRINGS' => 33, 'ST_INTERIORRINGN' => 33, + 'ST_MLINEFROMTEXT' => 33, 'ST_MPOINTFROMWKB' => 33, 'ST_MPOLYFROMTEXT' => 33, + 'ST_NUMGEOMETRIES' => 33, 'ST_POINTFROMTEXT' => 33, 'ST_SYMDIFFERENCE' => 33, + 'JSON_ARRAY_APPEND' => 33, 'JSON_ARRAY_INSERT' => 33, 'JSON_STORAGE_FREE' => 33, + 'JSON_STORAGE_SIZE' => 33, 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, + 'RELEASE_ALL_LOCKS' => 33, 'ST_LATFROMGEOHASH' => 33, 'ST_MPOINTFROMTEXT' => 33, + 'ST_POLYGONFROMWKB' => 33, + 'JSON_CONTAINS_PATH' => 33, 'MULTIPOINTFROMTEXT' => 33, 'ST_BUFFER_STRATEGY' => 33, + 'ST_DISTANCE_SPHERE' => 33, 'ST_GEOMCOLLFROMTXT' => 33, 'ST_GEOMCOLLFROMWKB' => 33, + 'ST_GEOMFROMGEOJSON' => 33, 'ST_LONGFROMGEOHASH' => 33, 'ST_POLYGONFROMTEXT' => 33, + 'JSON_MERGE_PRESERVE' => 33, 'MULTIPOLYGONFROMWKB' => 33, 'ST_GEOMCOLLFROMTEXT' => 33, + 'ST_GEOMETRYFROMTEXT' => 33, 'ST_NUMINTERIORRINGS' => 33, 'ST_POINTFROMGEOHASH' => 33, + 'UNCOMPRESSED_LENGTH' => 33, + 'MULTIPOLYGONFROMTEXT' => 33, 'ST_LINESTRINGFROMWKB' => 33, 'ST_MULTIPOINTFROMWKB' => 33, + 'ST_MULTIPOINTFROMTEXT' => 33, + 'MULTILINESTRINGFROMWKB' => 33, 'ST_MULTIPOLYGONFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, 'ST_MULTIPOLYGONFROMTEXT' => 33, + 'GEOMETRYCOLLECTIONFROMWKB' => 33, 'ST_MULTILINESTRINGFROMWKB' => 33, + 'GEOMETRYCOLLECTIONFROMTEXT' => 33, 'ST_MULTILINESTRINGFROMTEXT' => 33, 'VALIDATE_PASSWORD_STRENGTH' => 33, + 'WAIT_FOR_EXECUTED_GTID_SET' => 33, + 'ST_GEOMETRYCOLLECTIONFROMWKB' => 33, + 'ST_GEOMETRYCOLLECTIONFROMTEXT' => 33, + 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100200.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100200.php new file mode 100755 index 0000000..a3cc639 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100200.php @@ -0,0 +1,352 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, + 'ONE' => 1, 'ROW' => 1, 'XID' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, + 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, + 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'ONLY' => 1, 'OPEN' => 1, 'PAGE' => 1, + 'PORT' => 1, 'PREV' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, 'THAN' => 1, + 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, + 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'NEVER' => 1, 'OWNER' => 1, 'PHASE' => 1, + 'PROXY' => 1, 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, + 'RTREE' => 1, 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, + 'SWAPS' => 1, 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'ALWAYS' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, + 'CLIENT' => 1, 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, + 'ESCAPE' => 1, 'EVENTS' => 1, 'EXPIRE' => 1, 'EXPORT' => 1, 'FAULTS' => 1, + 'FIELDS' => 1, 'FILTER' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, 'IMPORT' => 1, + 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, 'MEDIUM' => 1, 'MEMORY' => 1, + 'MODIFY' => 1, 'NUMBER' => 1, 'OFFSET' => 1, 'PARSER' => 1, 'PLUGIN' => 1, + 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, + 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, 'SONAME' => 1, + 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, 'STRING' => 1, + 'TABLES' => 1, + 'ACCOUNT' => 1, 'ANALYSE' => 1, 'CHANGED' => 1, 'CHANNEL' => 1, 'COLUMNS' => 1, + 'COMMENT' => 1, 'COMPACT' => 1, 'CONTEXT' => 1, 'CURRENT' => 1, 'DEFINER' => 1, + 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, 'EXECUTE' => 1, + 'FOLLOWS' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, + 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, + 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, + 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, + 'STACKED' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, + 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'WITHOUT' => 1, 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXCHANGE' => 1, + 'EXTENDED' => 1, 'FUNCTION' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, + 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'PRECEDES' => 1, 'PRESERVE' => 1, + 'PROFILES' => 1, 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, + 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, + 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, 'REDUNDANT' => 1, + 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, + 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PLUGIN_DIR' => 1, + 'PRIVILEGES' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, + 'SQL_THREAD' => 1, 'TABLESPACE' => 1, 'TABLE_NAME' => 1, 'VALIDATION' => 1, + 'COLUMN_NAME' => 1, 'COMPRESSION' => 1, 'CURSOR_NAME' => 1, 'DIAGNOSTICS' => 1, + 'EXTENT_SIZE' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, + 'MYSQL_ERRNO' => 1, 'NONBLOCKING' => 1, 'PROCESSLIST' => 1, 'REPLICATION' => 1, + 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'DEFAULT_AUTH' => 1, 'DES_KEY_FILE' => 1, + 'INITIAL_SIZE' => 1, 'MASTER_DELAY' => 1, 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, + 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, + 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'COLUMN_FORMAT' => 1, 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, + 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_CRL' => 1, 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, + 'SQL_TSI_SECOND' => 1, 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, 'FILE_BLOCK_SIZE' => 1, + 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'PARSE_GCOL_EXPR' => 1, + 'REPLICATE_DO_DB' => 1, 'SQL_AFTER_GTIDS' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'SQL_BEFORE_GTIDS' => 1, + 'STATS_PERSISTENT' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'CONSTRAINT_SCHEMA' => 1, 'GROUP_REPLICATION' => 1, 'IGNORE_SERVER_IDS' => 1, + 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'RETURNED_SQLSTATE' => 1, + 'SQL_BUFFER_RESULT' => 1, 'STATS_AUTO_RECALC' => 1, + 'CONSTRAINT_CATALOG' => 1, 'MASTER_RETRY_COUNT' => 1, 'MASTER_SSL_CRLPATH' => 1, + 'MAX_STATEMENT_TIME' => 1, 'REPLICATE_DO_TABLE' => 1, 'SQL_AFTER_MTS_GAPS' => 1, + 'STATS_SAMPLE_PAGES' => 1, + 'REPLICATE_IGNORE_DB' => 1, + 'MASTER_AUTO_POSITION' => 1, 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, + 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, 'REPLICATE_REWRITE_DB' => 1, + 'REPLICATE_IGNORE_TABLE' => 1, + 'MASTER_HEARTBEAT_PERIOD' => 1, 'REPLICATE_WILD_DO_TABLE' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + 'REPLICATE_WILD_IGNORE_TABLE' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'GET' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, + 'USE' => 3, 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'ROWS' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, + 'UNDO' => 3, 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, 'REGEXP' => 3, + 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SIGNAL' => 3, + 'STORED' => 3, 'UNLOCK' => 3, 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, 'VIRTUAL' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESIGNAL' => 3, 'RESTRICT' => 3, + 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, + 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'GENERATED' => 3, 'MIDDLEINT' => 3, + 'PARTITION' => 3, 'PRECISION' => 3, 'PROCEDURE' => 3, 'RECURSIVE' => 3, + 'SENSITIVE' => 3, 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'MASTER_BIND' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'IO_AFTER_GTIDS' => 3, 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, 'IO_BEFORE_GTIDS' => 3, 'OPTIMIZER_COSTS' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'ST_X' => 33, + 'ST_Y' => 33, 'TRIM' => 33, 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, + 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, + 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, + 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'BUFFER' => 33, 'CONCAT' => 33, 'DECODE' => 33, + 'ENCODE' => 33, 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, + 'LENGTH' => 33, 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, + 'SECOND' => 33, 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'IS_IPV4' => 33, 'IS_IPV6' => 33, 'QUARTER' => 33, 'RADIANS' => 33, + 'REVERSE' => 33, 'SOUNDEX' => 33, 'ST_AREA' => 33, 'ST_SRID' => 33, 'SUBDATE' => 33, + 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, 'VAR_POP' => 33, + 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'DISTANCE' => 33, + 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, + 'ISSIMPLE' => 33, 'JSON_SET' => 33, 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, + 'MBREQUAL' => 33, 'OVERLAPS' => 33, 'PASSWORD' => 33, 'POSITION' => 33, 'ST_ASWKB' => 33, + 'ST_ASWKT' => 33, 'ST_UNION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'ANY_VALUE' => 33, 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, + 'CONCAT_WS' => 33, 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, + 'FROM_DAYS' => 33, 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, + 'JSON_KEYS' => 33, 'JSON_TYPE' => 33, 'LOAD_FILE' => 33, 'MBRCOVERS' => 33, + 'MBREQUALS' => 33, 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, + 'ROW_COUNT' => 33, 'ST_ASTEXT' => 33, 'ST_BUFFER' => 33, 'ST_EQUALS' => 33, + 'ST_LENGTH' => 33, 'ST_POINTN' => 33, 'ST_WITHIN' => 33, 'SUBSTRING' => 33, + 'TO_BASE64' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'CONVEXHULL' => 33, 'DAYOFMONTH' => 33, + 'EXPORT_SET' => 33, 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INET6_ATON' => 33, + 'INET6_NTOA' => 33, 'INTERSECTS' => 33, 'JSON_ARRAY' => 33, 'JSON_DEPTH' => 33, + 'JSON_MERGE' => 33, 'JSON_QUOTE' => 33, 'JSON_VALID' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'ST_CROSSES' => 33, 'ST_GEOHASH' => 33, 'ST_ISEMPTY' => 33, + 'ST_ISVALID' => 33, 'ST_TOUCHES' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, + 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'FROM_BASE64' => 33, + 'GEOMFROMWKB' => 33, 'GTID_SUBSET' => 33, 'JSON_INSERT' => 33, 'JSON_LENGTH' => 33, + 'JSON_OBJECT' => 33, 'JSON_PRETTY' => 33, 'JSON_REMOVE' => 33, 'JSON_SEARCH' => 33, + 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, + 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, + 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'ST_ASBINARY' => 33, 'ST_CENTROID' => 33, + 'ST_CONTAINS' => 33, 'ST_DISJOINT' => 33, 'ST_DISTANCE' => 33, 'ST_ENDPOINT' => 33, + 'ST_ENVELOPE' => 33, 'ST_ISCLOSED' => 33, 'ST_ISSIMPLE' => 33, 'ST_OVERLAPS' => 33, + 'ST_SIMPLIFY' => 33, 'ST_VALIDATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'JSON_EXTRACT' => 33, 'JSON_REPLACE' => 33, 'JSON_UNQUOTE' => 33, 'LINEFROMTEXT' => 33, + 'MBRCOVEREDBY' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RANDOM_BYTES' => 33, 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'ST_ASGEOJSON' => 33, + 'ST_DIMENSION' => 33, 'ST_GEOMETRYN' => 33, 'ST_NUMPOINTS' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'GTID_SUBTRACT' => 33, 'INTERIORRINGN' => 33, + 'JSON_CONTAINS' => 33, 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, + 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, 'ST_CONVEXHULL' => 33, + 'ST_DIFFERENCE' => 33, 'ST_INTERSECTS' => 33, 'ST_STARTPOINT' => 33, 'TIMESTAMPDIFF' => 33, + 'WEIGHT_STRING' => 33, + 'IS_IPV4_COMPAT' => 33, 'IS_IPV4_MAPPED' => 33, 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, + 'POLYGONFROMWKB' => 33, 'ST_GEOMFROMWKB' => 33, 'ST_LINEFROMWKB' => 33, 'ST_POLYFROMWKB' => 33, + 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, 'ST_EXTERIORRING' => 33, + 'ST_GEOMETRYTYPE' => 33, 'ST_GEOMFROMTEXT' => 33, 'ST_INTERSECTION' => 33, 'ST_LINEFROMTEXT' => 33, + 'ST_MAKEENVELOPE' => 33, 'ST_MLINEFROMWKB' => 33, 'ST_MPOLYFROMWKB' => 33, 'ST_POINTFROMWKB' => 33, + 'ST_POLYFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'JSON_MERGE_PATCH' => 33, 'NUMINTERIORRINGS' => 33, 'ST_INTERIORRINGN' => 33, + 'ST_MLINEFROMTEXT' => 33, 'ST_MPOINTFROMWKB' => 33, 'ST_MPOLYFROMTEXT' => 33, + 'ST_NUMGEOMETRIES' => 33, 'ST_POINTFROMTEXT' => 33, 'ST_SYMDIFFERENCE' => 33, + 'JSON_ARRAY_APPEND' => 33, 'JSON_ARRAY_INSERT' => 33, 'JSON_STORAGE_FREE' => 33, + 'JSON_STORAGE_SIZE' => 33, 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, + 'RELEASE_ALL_LOCKS' => 33, 'ST_LATFROMGEOHASH' => 33, 'ST_MPOINTFROMTEXT' => 33, + 'ST_POLYGONFROMWKB' => 33, + 'JSON_CONTAINS_PATH' => 33, 'MULTIPOINTFROMTEXT' => 33, 'ST_BUFFER_STRATEGY' => 33, + 'ST_DISTANCE_SPHERE' => 33, 'ST_GEOMCOLLFROMTXT' => 33, 'ST_GEOMCOLLFROMWKB' => 33, + 'ST_GEOMFROMGEOJSON' => 33, 'ST_LONGFROMGEOHASH' => 33, 'ST_POLYGONFROMTEXT' => 33, + 'JSON_MERGE_PRESERVE' => 33, 'MULTIPOLYGONFROMWKB' => 33, 'ST_GEOMCOLLFROMTEXT' => 33, + 'ST_GEOMETRYFROMTEXT' => 33, 'ST_NUMINTERIORRINGS' => 33, 'ST_POINTFROMGEOHASH' => 33, + 'UNCOMPRESSED_LENGTH' => 33, + 'MULTIPOLYGONFROMTEXT' => 33, 'ST_LINESTRINGFROMWKB' => 33, 'ST_MULTIPOINTFROMWKB' => 33, + 'ST_MULTIPOINTFROMTEXT' => 33, + 'MULTILINESTRINGFROMWKB' => 33, 'ST_MULTIPOLYGONFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, 'ST_MULTIPOLYGONFROMTEXT' => 33, + 'GEOMETRYCOLLECTIONFROMWKB' => 33, 'ST_MULTILINESTRINGFROMWKB' => 33, + 'GEOMETRYCOLLECTIONFROMTEXT' => 33, 'ST_MULTILINESTRINGFROMTEXT' => 33, 'VALIDATE_PASSWORD_STRENGTH' => 33, + 'WAIT_FOR_EXECUTED_GTID_SET' => 33, + 'ST_GEOMETRYCOLLECTIONFROMWKB' => 33, + 'ST_GEOMETRYCOLLECTIONFROMTEXT' => 33, + 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100300.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100300.php new file mode 100755 index 0000000..b34adb6 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMariaDb100300.php @@ -0,0 +1,352 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, + 'ONE' => 1, 'ROW' => 1, 'XID' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, + 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, + 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'ONLY' => 1, 'OPEN' => 1, 'PAGE' => 1, + 'PORT' => 1, 'PREV' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, 'THAN' => 1, + 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, + 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'NEVER' => 1, 'OWNER' => 1, 'PHASE' => 1, + 'PROXY' => 1, 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, + 'RTREE' => 1, 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, + 'SWAPS' => 1, 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'ALWAYS' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, + 'CLIENT' => 1, 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, + 'ESCAPE' => 1, 'EVENTS' => 1, 'EXPIRE' => 1, 'EXPORT' => 1, 'FAULTS' => 1, + 'FIELDS' => 1, 'FILTER' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, 'IMPORT' => 1, + 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, 'MEDIUM' => 1, 'MEMORY' => 1, + 'MODIFY' => 1, 'NUMBER' => 1, 'OFFSET' => 1, 'PARSER' => 1, 'PLUGIN' => 1, + 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, + 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, 'SONAME' => 1, + 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, 'STRING' => 1, + 'TABLES' => 1, + 'ACCOUNT' => 1, 'ANALYSE' => 1, 'CHANGED' => 1, 'CHANNEL' => 1, 'COLUMNS' => 1, + 'COMMENT' => 1, 'COMPACT' => 1, 'CONTEXT' => 1, 'CURRENT' => 1, 'DEFINER' => 1, + 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, 'EXECUTE' => 1, + 'FOLLOWS' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, + 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, + 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, + 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, + 'STACKED' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, + 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'WITHOUT' => 1, 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXCHANGE' => 1, + 'EXTENDED' => 1, 'FUNCTION' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, + 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'PRECEDES' => 1, 'PRESERVE' => 1, + 'PROFILES' => 1, 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SEQUENCE' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, + 'TRIGGERS' => 1, 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'INVISIBLE' => 1, 'IO_THREAD' => 1, + 'ISOLATION' => 1, 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, + 'REDUNDANT' => 1, 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, + 'TEMPTABLE' => 1, 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PLUGIN_DIR' => 1, + 'PRIVILEGES' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, + 'SQL_THREAD' => 1, 'TABLESPACE' => 1, 'TABLE_NAME' => 1, 'VALIDATION' => 1, + 'COLUMN_NAME' => 1, 'COMPRESSION' => 1, 'CURSOR_NAME' => 1, 'DIAGNOSTICS' => 1, + 'EXTENT_SIZE' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, + 'MYSQL_ERRNO' => 1, 'NONBLOCKING' => 1, 'PROCESSLIST' => 1, 'REPLICATION' => 1, + 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'DEFAULT_AUTH' => 1, 'DES_KEY_FILE' => 1, + 'INITIAL_SIZE' => 1, 'MASTER_DELAY' => 1, 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, + 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, + 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'COLUMN_FORMAT' => 1, 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, + 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_CRL' => 1, 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, + 'SQL_TSI_SECOND' => 1, 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, 'FILE_BLOCK_SIZE' => 1, + 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'PARSE_GCOL_EXPR' => 1, + 'REPLICATE_DO_DB' => 1, 'SQL_AFTER_GTIDS' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'SQL_BEFORE_GTIDS' => 1, + 'STATS_PERSISTENT' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'CONSTRAINT_SCHEMA' => 1, 'GROUP_REPLICATION' => 1, 'IGNORE_SERVER_IDS' => 1, + 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'RETURNED_SQLSTATE' => 1, + 'SQL_BUFFER_RESULT' => 1, 'STATS_AUTO_RECALC' => 1, + 'CONSTRAINT_CATALOG' => 1, 'MASTER_RETRY_COUNT' => 1, 'MASTER_SSL_CRLPATH' => 1, + 'MAX_STATEMENT_TIME' => 1, 'REPLICATE_DO_TABLE' => 1, 'SQL_AFTER_MTS_GAPS' => 1, + 'STATS_SAMPLE_PAGES' => 1, + 'REPLICATE_IGNORE_DB' => 1, + 'MASTER_AUTO_POSITION' => 1, 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, + 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, 'REPLICATE_REWRITE_DB' => 1, + 'REPLICATE_IGNORE_TABLE' => 1, + 'MASTER_HEARTBEAT_PERIOD' => 1, 'REPLICATE_WILD_DO_TABLE' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + 'REPLICATE_WILD_IGNORE_TABLE' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'GET' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, + 'USE' => 3, 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'ROWS' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, + 'UNDO' => 3, 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'EXCEPT' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, + 'HAVING' => 3, 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, + 'REGEXP' => 3, 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, + 'SIGNAL' => 3, 'STORED' => 3, 'UNLOCK' => 3, 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, 'VIRTUAL' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESIGNAL' => 3, 'RESTRICT' => 3, + 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, + 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'GENERATED' => 3, 'INTERSECT' => 3, + 'MIDDLEINT' => 3, 'PARTITION' => 3, 'PRECISION' => 3, 'PROCEDURE' => 3, + 'RECURSIVE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'MASTER_BIND' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'IO_AFTER_GTIDS' => 3, 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, 'IO_BEFORE_GTIDS' => 3, 'OPTIMIZER_COSTS' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'ST_X' => 33, + 'ST_Y' => 33, 'TRIM' => 33, 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, + 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, + 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, + 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'BUFFER' => 33, 'CONCAT' => 33, 'DECODE' => 33, + 'ENCODE' => 33, 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, + 'LENGTH' => 33, 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, + 'SECOND' => 33, 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'IS_IPV4' => 33, 'IS_IPV6' => 33, 'QUARTER' => 33, 'RADIANS' => 33, + 'REVERSE' => 33, 'SOUNDEX' => 33, 'ST_AREA' => 33, 'ST_SRID' => 33, 'SUBDATE' => 33, + 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, 'VAR_POP' => 33, + 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'DISTANCE' => 33, + 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, + 'ISSIMPLE' => 33, 'JSON_SET' => 33, 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, + 'MBREQUAL' => 33, 'OVERLAPS' => 33, 'PASSWORD' => 33, 'POSITION' => 33, 'ST_ASWKB' => 33, + 'ST_ASWKT' => 33, 'ST_UNION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'ANY_VALUE' => 33, 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, + 'CONCAT_WS' => 33, 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, + 'FROM_DAYS' => 33, 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, + 'JSON_KEYS' => 33, 'JSON_TYPE' => 33, 'LOAD_FILE' => 33, 'MBRCOVERS' => 33, + 'MBREQUALS' => 33, 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, + 'ROW_COUNT' => 33, 'ST_ASTEXT' => 33, 'ST_BUFFER' => 33, 'ST_EQUALS' => 33, + 'ST_LENGTH' => 33, 'ST_POINTN' => 33, 'ST_WITHIN' => 33, 'SUBSTRING' => 33, + 'TO_BASE64' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'CONVEXHULL' => 33, 'DAYOFMONTH' => 33, + 'EXPORT_SET' => 33, 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INET6_ATON' => 33, + 'INET6_NTOA' => 33, 'INTERSECTS' => 33, 'JSON_ARRAY' => 33, 'JSON_DEPTH' => 33, + 'JSON_MERGE' => 33, 'JSON_QUOTE' => 33, 'JSON_VALID' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'ST_CROSSES' => 33, 'ST_GEOHASH' => 33, 'ST_ISEMPTY' => 33, + 'ST_ISVALID' => 33, 'ST_TOUCHES' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, + 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'FROM_BASE64' => 33, + 'GEOMFROMWKB' => 33, 'GTID_SUBSET' => 33, 'JSON_INSERT' => 33, 'JSON_LENGTH' => 33, + 'JSON_OBJECT' => 33, 'JSON_PRETTY' => 33, 'JSON_REMOVE' => 33, 'JSON_SEARCH' => 33, + 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, + 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, + 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'ST_ASBINARY' => 33, 'ST_CENTROID' => 33, + 'ST_CONTAINS' => 33, 'ST_DISJOINT' => 33, 'ST_DISTANCE' => 33, 'ST_ENDPOINT' => 33, + 'ST_ENVELOPE' => 33, 'ST_ISCLOSED' => 33, 'ST_ISSIMPLE' => 33, 'ST_OVERLAPS' => 33, + 'ST_SIMPLIFY' => 33, 'ST_VALIDATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'JSON_EXTRACT' => 33, 'JSON_REPLACE' => 33, 'JSON_UNQUOTE' => 33, 'LINEFROMTEXT' => 33, + 'MBRCOVEREDBY' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RANDOM_BYTES' => 33, 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'ST_ASGEOJSON' => 33, + 'ST_DIMENSION' => 33, 'ST_GEOMETRYN' => 33, 'ST_NUMPOINTS' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'GTID_SUBTRACT' => 33, 'INTERIORRINGN' => 33, + 'JSON_CONTAINS' => 33, 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, + 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, 'ST_CONVEXHULL' => 33, + 'ST_DIFFERENCE' => 33, 'ST_INTERSECTS' => 33, 'ST_STARTPOINT' => 33, 'TIMESTAMPDIFF' => 33, + 'WEIGHT_STRING' => 33, + 'IS_IPV4_COMPAT' => 33, 'IS_IPV4_MAPPED' => 33, 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, + 'POLYGONFROMWKB' => 33, 'ST_GEOMFROMWKB' => 33, 'ST_LINEFROMWKB' => 33, 'ST_POLYFROMWKB' => 33, + 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, 'ST_EXTERIORRING' => 33, + 'ST_GEOMETRYTYPE' => 33, 'ST_GEOMFROMTEXT' => 33, 'ST_INTERSECTION' => 33, 'ST_LINEFROMTEXT' => 33, + 'ST_MAKEENVELOPE' => 33, 'ST_MLINEFROMWKB' => 33, 'ST_MPOLYFROMWKB' => 33, 'ST_POINTFROMWKB' => 33, + 'ST_POLYFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'JSON_MERGE_PATCH' => 33, 'NUMINTERIORRINGS' => 33, 'ST_INTERIORRINGN' => 33, + 'ST_MLINEFROMTEXT' => 33, 'ST_MPOINTFROMWKB' => 33, 'ST_MPOLYFROMTEXT' => 33, + 'ST_NUMGEOMETRIES' => 33, 'ST_POINTFROMTEXT' => 33, 'ST_SYMDIFFERENCE' => 33, + 'JSON_ARRAY_APPEND' => 33, 'JSON_ARRAY_INSERT' => 33, 'JSON_STORAGE_FREE' => 33, + 'JSON_STORAGE_SIZE' => 33, 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, + 'RELEASE_ALL_LOCKS' => 33, 'ST_LATFROMGEOHASH' => 33, 'ST_MPOINTFROMTEXT' => 33, + 'ST_POLYGONFROMWKB' => 33, + 'JSON_CONTAINS_PATH' => 33, 'MULTIPOINTFROMTEXT' => 33, 'ST_BUFFER_STRATEGY' => 33, + 'ST_DISTANCE_SPHERE' => 33, 'ST_GEOMCOLLFROMTXT' => 33, 'ST_GEOMCOLLFROMWKB' => 33, + 'ST_GEOMFROMGEOJSON' => 33, 'ST_LONGFROMGEOHASH' => 33, 'ST_POLYGONFROMTEXT' => 33, + 'JSON_MERGE_PRESERVE' => 33, 'MULTIPOLYGONFROMWKB' => 33, 'ST_GEOMCOLLFROMTEXT' => 33, + 'ST_GEOMETRYFROMTEXT' => 33, 'ST_NUMINTERIORRINGS' => 33, 'ST_POINTFROMGEOHASH' => 33, + 'UNCOMPRESSED_LENGTH' => 33, + 'MULTIPOLYGONFROMTEXT' => 33, 'ST_LINESTRINGFROMWKB' => 33, 'ST_MULTIPOINTFROMWKB' => 33, + 'ST_MULTIPOINTFROMTEXT' => 33, + 'MULTILINESTRINGFROMWKB' => 33, 'ST_MULTIPOLYGONFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, 'ST_MULTIPOLYGONFROMTEXT' => 33, + 'GEOMETRYCOLLECTIONFROMWKB' => 33, 'ST_MULTILINESTRINGFROMWKB' => 33, + 'GEOMETRYCOLLECTIONFROMTEXT' => 33, 'ST_MULTILINESTRINGFROMTEXT' => 33, 'VALIDATE_PASSWORD_STRENGTH' => 33, + 'WAIT_FOR_EXECUTED_GTID_SET' => 33, + 'ST_GEOMETRYCOLLECTIONFROMWKB' => 33, + 'ST_GEOMETRYCOLLECTIONFROMTEXT' => 33, + 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50000.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50000.php new file mode 100755 index 0000000..8a95856 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50000.php @@ -0,0 +1,279 @@ + 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'BDB' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, + 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'FAST' => 1, + 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, 'LAST' => 1, 'LOGS' => 1, + 'MODE' => 1, 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'OPEN' => 1, 'PAGE' => 1, + 'PREV' => 1, 'ROWS' => 1, 'SOME' => 1, 'STOP' => 1, 'TYPE' => 1, 'VIEW' => 1, + 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, + 'FOUND' => 1, 'HOSTS' => 1, 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, + 'MERGE' => 1, 'MUTEX' => 1, 'NAMES' => 1, 'NCHAR' => 1, 'PHASE' => 1, + 'QUERY' => 1, 'QUICK' => 1, 'RAID0' => 1, 'RESET' => 1, 'RTREE' => 1, + 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, + 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, + 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, + 'EVENTS' => 1, 'FAULTS' => 1, 'FIELDS' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, + 'IMPORT' => 1, 'INNODB' => 1, 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, + 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'OFFSET' => 1, 'RELOAD' => 1, + 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, + 'SOUNDS' => 1, 'SOURCE' => 1, 'STATUS' => 1, 'STRING' => 1, 'TABLES' => 1, + 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, 'COMPACT' => 1, 'CONTEXT' => 1, + 'DEFINER' => 1, 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, + 'EXECUTE' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INVOKER' => 1, 'MIGRATE' => 1, + 'PARTIAL' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'RECOVER' => 1, 'RESTORE' => 1, + 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, 'STORAGE' => 1, 'STRIPED' => 1, + 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, 'UNKNOWN' => 1, 'UPGRADE' => 1, + 'USE_FRM' => 1, 'VIRTUAL' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DUMPFILE' => 1, 'EXTENDED' => 1, 'FUNCTION' => 1, + 'INNOBASE' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MIN_ROWS' => 1, 'NATIONAL' => 1, + 'NVARCHAR' => 1, 'ONE_SHOT' => 1, 'PROFILES' => 1, 'ROLLBACK' => 1, 'SECURITY' => 1, + 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, + 'PACK_KEYS' => 1, 'RAID_TYPE' => 1, 'REDUNDANT' => 1, 'SAVEPOINT' => 1, + 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, 'UNDEFINED' => 1, + 'VARIABLES' => 1, + 'BERKELEYDB' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PRIVILEGES' => 1, + 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, 'SQL_THREAD' => 1, 'TABLESPACE' => 1, + 'FRAC_SECOND' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, + 'PROCESSLIST' => 1, 'RAID_CHUNKS' => 1, 'REPLICATION' => 1, 'SQL_TSI_DAY' => 1, + 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'DES_KEY_FILE' => 1, 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, + 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, + 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, 'SQL_TSI_MONTH' => 1, + 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'MASTER_LOG_POS' => 1, 'MASTER_SSL_KEY' => 1, + 'RAID_CHUNKSIZE' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, 'SQL_TSI_SECOND' => 1, + 'USER_RESOURCES' => 1, + 'DELAY_KEY_WRITE' => 1, 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, + 'SQL_TSI_QUARTER' => 1, + 'MASTER_SERVER_ID' => 1, + 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'SQL_BUFFER_RESULT' => 1, + 'SQL_TSI_FRAC_SECOND' => 1, + 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, 'MAX_UPDATES_PER_HOUR' => 1, + 'MAX_USER_CONNECTIONS' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, 'USE' => 3, + 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, + 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, 'UNION' => 3, + 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'OPTION' => 3, 'REGEXP' => 3, 'RENAME' => 3, + 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SONAME' => 3, 'UNLOCK' => 3, + 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESTRICT' => 3, 'SPECIFIC' => 3, 'SQLSTATE' => 3, + 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PRECISION' => 3, + 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, + 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, 'DAY_SECOND' => 3, + 'OPTIONALLY' => 3, 'REFERENCES' => 3, 'SQLWARNING' => 3, 'TERMINATED' => 3, + 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'TRIM' => 33, 'USER' => 33, + 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ATAN2' => 33, 'COUNT' => 33, 'CRC32' => 33, 'FIELD' => 33, + 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, 'LEAST' => 33, 'LOG10' => 33, + 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, 'POWER' => 33, 'QUOTE' => 33, + 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, 'SPACE' => 33, 'UCASE' => 33, + 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'CONCAT' => 33, 'DECODE' => 33, 'ENCODE' => 33, + 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, 'LENGTH' => 33, + 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, 'SECOND' => 33, + 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'QUARTER' => 33, 'RADIANS' => 33, 'REVERSE' => 33, 'SOUNDEX' => 33, + 'SUBDATE' => 33, 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, + 'VAR_POP' => 33, 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'ENDPOINT' => 33, + 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, + 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, + 'PASSWORD' => 33, 'POSITION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, + 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, + 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, + 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, + 'SUBSTRING' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, + 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'UNCOMPRESS' => 33, 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'GEOMFROMWKB' => 33, + 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, + 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, + 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'GEOMETRYTYPE' => 33, 'GEOMFROMTEXT' => 33, + 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, 'LINEFROMTEXT' => 33, + 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, 'OCTET_LENGTH' => 33, + 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, 'RELEASE_LOCK' => 33, + 'SESSION_USER' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'INTERIORRINGN' => 33, 'MBRINTERSECTS' => 33, + 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, + 'POINTFROMTEXT' => 33, 'TIMESTAMPDIFF' => 33, + 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'NUMINTERIORRINGS' => 33, + 'UNCOMPRESSED_LENGTH' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50100.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50100.php new file mode 100755 index 0000000..e610306 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50100.php @@ -0,0 +1,299 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'BDB' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, + 'NEW' => 1, 'ONE' => 1, 'ROW' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'GOTO' => 1, 'HASH' => 1, + 'HELP' => 1, 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, + 'MODE' => 1, 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'OPEN' => 1, 'PAGE' => 1, + 'PORT' => 1, 'PREV' => 1, 'ROWS' => 1, 'SOME' => 1, 'STOP' => 1, 'THAN' => 1, + 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'EVENT' => 1, 'EVERY' => 1, 'FIRST' => 1, + 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, 'LABEL' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'OWNER' => 1, 'PHASE' => 1, 'QUERY' => 1, + 'QUICK' => 1, 'RAID0' => 1, 'RESET' => 1, 'RTREE' => 1, 'SHARE' => 1, + 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, 'TYPES' => 1, + 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, + 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, + 'EVENTS' => 1, 'FAULTS' => 1, 'FIELDS' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, + 'IMPORT' => 1, 'INNODB' => 1, 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, + 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'OFFSET' => 1, 'PARSER' => 1, + 'PLUGIN' => 1, 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, + 'ROLLUP' => 1, 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, + 'SONAME' => 1, 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, + 'STRING' => 1, 'TABLES' => 1, + 'AUTHORS' => 1, 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, 'COMPACT' => 1, + 'CONTEXT' => 1, 'DEFINER' => 1, 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, + 'ENGINES' => 1, 'EXECUTE' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, + 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, + 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, + 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, + 'STORAGE' => 1, 'STRIPED' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, + 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'VIRTUAL' => 1, 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXTENDED' => 1, + 'FUNCTION' => 1, 'INNOBASE' => 1, 'LANGUAGE' => 1, 'MAXVALUE' => 1, 'MAX_ROWS' => 1, + 'MAX_SIZE' => 1, 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'ONE_SHOT' => 1, + 'PRESERVE' => 1, 'PROFILES' => 1, 'REDOFILE' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, + 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, + 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'PARTITION' => 1, 'RAID_TYPE' => 1, + 'READ_ONLY' => 1, 'REDUNDANT' => 1, 'SAVEPOINT' => 1, 'SCHEDULER' => 1, + 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, 'UNDEFINED' => 1, + 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'BERKELEYDB' => 1, 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, + 'CONNECTION' => 1, 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, + 'MASTER_SSL' => 1, 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, + 'PRIVILEGES' => 1, 'REORGANISE' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, + 'ROW_FORMAT' => 1, 'SQL_THREAD' => 1, 'TABLESPACE' => 1, + 'EXTENT_SIZE' => 1, 'FRAC_SECOND' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, + 'MASTER_USER' => 1, 'PROCESSLIST' => 1, 'RAID_CHUNKS' => 1, 'REPLICATION' => 1, + 'SQL_TSI_DAY' => 1, 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CONTRIBUTORS' => 1, 'DES_KEY_FILE' => 1, 'INITIAL_SIZE' => 1, 'PARTITIONING' => 1, + 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, + 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'PAGE_CHECKSUM' => 1, 'RELAY_LOG_POS' => 1, + 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, 'TRANSACTIONAL' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_KEY' => 1, 'RAID_CHUNKSIZE' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, + 'SQL_TSI_SECOND' => 1, 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'DELAY_KEY_WRITE' => 1, 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, + 'MASTER_SSL_CERT' => 1, 'SQL_TSI_QUARTER' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'SQL_BUFFER_RESULT' => 1, + 'SQL_TSI_FRAC_SECOND' => 1, + 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, 'MAX_UPDATES_PER_HOUR' => 1, + 'MAX_USER_CONNECTIONS' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, 'USE' => 3, + 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, + 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, 'REGEXP' => 3, + 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'UNLOCK' => 3, + 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESTRICT' => 3, 'SPECIFIC' => 3, 'SQLSTATE' => 3, + 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PRECISION' => 3, + 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'TRIM' => 33, 'USER' => 33, + 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'DECOD' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, + 'LCASE' => 33, 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, + 'MONTH' => 33, 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, + 'SLEEP' => 33, 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'CONCAT' => 33, 'ENCODE' => 33, 'EQUALS' => 33, + 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, 'LENGTH' => 33, 'LOCATE' => 33, + 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, 'SECOND' => 33, 'STDDEV' => 33, + 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'QUARTER' => 33, 'RADIANS' => 33, 'REVERSE' => 33, 'SOUNDEX' => 33, + 'SUBDATE' => 33, 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, + 'VAR_POP' => 33, 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'ENDPOINT' => 33, + 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, + 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, + 'PASSWORD' => 33, 'POSITION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, + 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, + 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, + 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, + 'SUBSTRING' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, + 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'UNCOMPRESS' => 33, 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'GEOMFROMWKB' => 33, + 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, + 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, + 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'LINEFROMTEXT' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'INTERIORRINGN' => 33, 'MBRINTERSECTS' => 33, + 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, + 'POINTFROMTEXT' => 33, 'TIMESTAMPDIFF' => 33, + 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, 'POLYGONFROMWKB' => 33, 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'NUMINTERIORRINGS' => 33, + 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, + 'MULTIPOINTFROMTEXT' => 33, + 'MULTIPOLYGONFROMWKB' => 33, 'UNCOMPRESSED_LENGTH' => 33, + 'MULTIPOLYGONFROMTEXT' => 33, + 'MULTILINESTRINGFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, + 'GEOMETRYCOLLECTIONFROMWKB' => 33, + 'GEOMETRYCOLLECTIONFROMTEXT' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50500.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50500.php new file mode 100755 index 0000000..08b4624 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50500.php @@ -0,0 +1,305 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, + 'ONE' => 1, 'ROW' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, + 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, + 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'OPEN' => 1, 'PAGE' => 1, 'PORT' => 1, + 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, 'THAN' => 1, + 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, + 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'OWNER' => 1, 'PHASE' => 1, 'PROXY' => 1, + 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, 'RTREE' => 1, + 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, + 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, + 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, + 'EVENTS' => 1, 'FAULTS' => 1, 'FIELDS' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, + 'IMPORT' => 1, 'INNODB' => 1, 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, + 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'OFFSET' => 1, 'PARSER' => 1, + 'PLUGIN' => 1, 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, + 'ROLLUP' => 1, 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, + 'SONAME' => 1, 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, + 'STRING' => 1, 'TABLES' => 1, + 'AUTHORS' => 1, 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, 'COMPACT' => 1, + 'CONTEXT' => 1, 'DEFINER' => 1, 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, + 'ENGINES' => 1, 'EXECUTE' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, + 'INSTALL' => 1, 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, + 'OPTIONS' => 1, 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, + 'REBUILD' => 1, 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, + 'SESSION' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, + 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'VIRTUAL' => 1, 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXTENDED' => 1, + 'FUNCTION' => 1, 'INNOBASE' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, + 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'ONE_SHOT' => 1, 'PRESERVE' => 1, + 'PROFILES' => 1, 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, + 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, + 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'PARTITION' => 1, 'READ_ONLY' => 1, + 'REDUNDANT' => 1, 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, + 'TEMPTABLE' => 1, 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PRIVILEGES' => 1, + 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, 'SQL_THREAD' => 1, + 'TABLESPACE' => 1, 'TABLE_NAME' => 1, + 'COLUMN_NAME' => 1, 'CURSOR_NAME' => 1, 'EXTENT_SIZE' => 1, 'FRAC_SECOND' => 1, + 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, 'MYSQL_ERRNO' => 1, + 'PROCESSLIST' => 1, 'REPLICATION' => 1, 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, + 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'CONTRIBUTORS' => 1, 'DES_KEY_FILE' => 1, + 'INITIAL_SIZE' => 1, 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, 'RELAY_THREAD' => 1, + 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, + 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, 'SQL_TSI_MONTH' => 1, + 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, 'SQL_TSI_SECOND' => 1, + 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, 'MASTER_LOG_FILE' => 1, + 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'CONSTRAINT_SCHEMA' => 1, 'IGNORE_SERVER_IDS' => 1, 'MASTER_SSL_CAPATH' => 1, + 'MASTER_SSL_CIPHER' => 1, 'SQL_BUFFER_RESULT' => 1, + 'CONSTRAINT_CATALOG' => 1, + 'SQL_TSI_FRAC_SECOND' => 1, + 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, 'MAX_UPDATES_PER_HOUR' => 1, + 'MAX_USER_CONNECTIONS' => 1, + 'MASTER_HEARTBEAT_PERIOD' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, 'USE' => 3, + 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, + 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, 'REGEXP' => 3, + 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SIGNAL' => 3, + 'UNLOCK' => 3, 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESIGNAL' => 3, 'RESTRICT' => 3, + 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, + 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PRECISION' => 3, + 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'TRIM' => 33, + 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, + 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, + 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, + 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'CONCAT' => 33, 'DECODE' => 33, 'ENCODE' => 33, + 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, 'LENGTH' => 33, + 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, 'SECOND' => 33, + 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'QUARTER' => 33, 'RADIANS' => 33, 'REVERSE' => 33, 'SOUNDEX' => 33, + 'SUBDATE' => 33, 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, + 'VAR_POP' => 33, 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'ENDPOINT' => 33, + 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, + 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, + 'PASSWORD' => 33, 'POSITION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, + 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, + 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, + 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, + 'SUBSTRING' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, + 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, 'UUID_SHORT' => 33, + 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'GEOMFROMWKB' => 33, + 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, + 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, + 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'LINEFROMTEXT' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'INTERIORRINGN' => 33, 'MBRINTERSECTS' => 33, + 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, + 'POINTFROMTEXT' => 33, 'TIMESTAMPDIFF' => 33, + 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, 'POLYGONFROMWKB' => 33, 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'NUMINTERIORRINGS' => 33, + 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, + 'MULTIPOINTFROMTEXT' => 33, + 'MULTIPOLYGONFROMWKB' => 33, 'UNCOMPRESSED_LENGTH' => 33, + 'MULTIPOLYGONFROMTEXT' => 33, + 'MULTILINESTRINGFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, + 'GEOMETRYCOLLECTIONFROMWKB' => 33, + 'GEOMETRYCOLLECTIONFROMTEXT' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50600.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50600.php new file mode 100755 index 0000000..bf1372c --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50600.php @@ -0,0 +1,330 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, + 'ONE' => 1, 'ROW' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, + 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, + 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'ONLY' => 1, 'OPEN' => 1, 'PAGE' => 1, + 'PORT' => 1, 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, + 'THAN' => 1, 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, + 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'OWNER' => 1, 'PHASE' => 1, 'PROXY' => 1, + 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, 'RTREE' => 1, + 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, 'SWAPS' => 1, + 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, 'CLIENT' => 1, + 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, 'ESCAPE' => 1, + 'EVENTS' => 1, 'EXPIRE' => 1, 'EXPORT' => 1, 'FAULTS' => 1, 'FIELDS' => 1, + 'GLOBAL' => 1, 'GRANTS' => 1, 'IMPORT' => 1, 'ISSUER' => 1, 'LEAVES' => 1, + 'MASTER' => 1, 'MEDIUM' => 1, 'MEMORY' => 1, 'MODIFY' => 1, 'NUMBER' => 1, + 'OFFSET' => 1, 'PARSER' => 1, 'PLUGIN' => 1, 'RELOAD' => 1, 'REMOVE' => 1, + 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, 'SERVER' => 1, 'SIGNED' => 1, + 'SIMPLE' => 1, 'SOCKET' => 1, 'SONAME' => 1, 'SOUNDS' => 1, 'SOURCE' => 1, + 'STARTS' => 1, 'STATUS' => 1, 'STRING' => 1, 'TABLES' => 1, + 'ANALYSE' => 1, 'AUTHORS' => 1, 'CHANGED' => 1, 'COLUMNS' => 1, 'COMMENT' => 1, + 'COMPACT' => 1, 'CONTEXT' => 1, 'CURRENT' => 1, 'DEFINER' => 1, 'DISABLE' => 1, + 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, 'EXECUTE' => 1, 'GENERAL' => 1, + 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, 'INVOKER' => 1, 'LOGFILE' => 1, + 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, 'PARTIAL' => 1, 'PLUGINS' => 1, + 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, 'RECOVER' => 1, 'RESTORE' => 1, + 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, + 'SUSPEND' => 1, 'UNICODE' => 1, 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, + 'VIRTUAL' => 1, 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXCHANGE' => 1, + 'EXTENDED' => 1, 'FUNCTION' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, + 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'ONE_SHOT' => 1, 'PRESERVE' => 1, + 'PROFILES' => 1, 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, + 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, + 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, 'REDUNDANT' => 1, + 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, + 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PLUGIN_DIR' => 1, + 'PRIVILEGES' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, + 'SQL_THREAD' => 1, 'TABLESPACE' => 1, 'TABLE_NAME' => 1, + 'COLUMN_NAME' => 1, 'CURSOR_NAME' => 1, 'DIAGNOSTICS' => 1, 'EXTENT_SIZE' => 1, + 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, 'MYSQL_ERRNO' => 1, + 'PROCESSLIST' => 1, 'REPLICATION' => 1, 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, + 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'CONTRIBUTORS' => 1, 'DEFAULT_AUTH' => 1, + 'DES_KEY_FILE' => 1, 'INITIAL_SIZE' => 1, 'MASTER_DELAY' => 1, 'MESSAGE_TEXT' => 1, + 'PARTITIONING' => 1, 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, + 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'COLUMN_FORMAT' => 1, 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, + 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_CRL' => 1, 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, + 'SQL_TSI_SECOND' => 1, 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, 'MASTER_LOG_FILE' => 1, + 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'SQL_AFTER_GTIDS' => 1, 'SQL_TSI_QUARTER' => 1, + 'SUBCLASS_ORIGIN' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'SQL_BEFORE_GTIDS' => 1, + 'STATS_PERSISTENT' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'CONSTRAINT_SCHEMA' => 1, 'IGNORE_SERVER_IDS' => 1, 'MASTER_SSL_CAPATH' => 1, + 'MASTER_SSL_CIPHER' => 1, 'RETURNED_SQLSTATE' => 1, 'SQL_BUFFER_RESULT' => 1, + 'STATS_AUTO_RECALC' => 1, + 'CONSTRAINT_CATALOG' => 1, 'MASTER_RETRY_COUNT' => 1, 'MASTER_SSL_CRLPATH' => 1, + 'SQL_AFTER_MTS_GAPS' => 1, 'STATS_SAMPLE_PAGES' => 1, + 'MASTER_AUTO_POSITION' => 1, 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, + 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, + 'MASTER_HEARTBEAT_PERIOD' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'GET' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, + 'USE' => 3, 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, + 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, 'REGEXP' => 3, + 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SIGNAL' => 3, + 'UNLOCK' => 3, 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESIGNAL' => 3, 'RESTRICT' => 3, + 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, + 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'MIDDLEINT' => 3, 'PARTITION' => 3, + 'PRECISION' => 3, 'PROCEDURE' => 3, 'SENSITIVE' => 3, 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'MASTER_BIND' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'IO_AFTER_GTIDS' => 3, 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, 'IO_BEFORE_GTIDS' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'ST_X' => 33, + 'ST_Y' => 33, 'TRIM' => 33, 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, + 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, + 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, + 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'BUFFER' => 33, 'CONCAT' => 33, 'DECODE' => 33, + 'ENCODE' => 33, 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, + 'LENGTH' => 33, 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, + 'SECOND' => 33, 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'IS_IPV4' => 33, 'IS_IPV6' => 33, 'QUARTER' => 33, 'RADIANS' => 33, + 'REVERSE' => 33, 'SOUNDEX' => 33, 'ST_AREA' => 33, 'ST_SRID' => 33, 'SUBDATE' => 33, + 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, 'VAR_POP' => 33, + 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'ENDPOINT' => 33, + 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, 'ISSIMPLE' => 33, + 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, 'MBREQUAL' => 33, 'OVERLAPS' => 33, + 'PASSWORD' => 33, 'POSITION' => 33, 'ST_ASWKB' => 33, 'ST_ASWKT' => 33, 'ST_UNION' => 33, + 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, 'CONCAT_WS' => 33, + 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, 'FROM_DAYS' => 33, + 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, 'LOAD_FILE' => 33, + 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, 'ROW_COUNT' => 33, + 'ST_ASTEXT' => 33, 'ST_BUFFER' => 33, 'ST_EQUALS' => 33, 'ST_POINTN' => 33, + 'ST_WITHIN' => 33, 'SUBSTRING' => 33, 'TO_BASE64' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'DAYOFMONTH' => 33, 'EXPORT_SET' => 33, + 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INET6_ATON' => 33, 'INET6_NTOA' => 33, + 'INTERSECTS' => 33, 'MBRTOUCHES' => 33, 'MULTIPOINT' => 33, 'NAME_CONST' => 33, + 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, 'STDDEV_POP' => 33, 'ST_CROSSES' => 33, + 'ST_ISEMPTY' => 33, 'ST_TOUCHES' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, + 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'FROM_BASE64' => 33, + 'GEOMFROMWKB' => 33, 'GTID_SUBSET' => 33, 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, + 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, + 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, + 'ST_ASBINARY' => 33, 'ST_CENTROID' => 33, 'ST_CONTAINS' => 33, 'ST_DISJOINT' => 33, + 'ST_DISTANCE' => 33, 'ST_ENDPOINT' => 33, 'ST_ENVELOPE' => 33, 'ST_ISCLOSED' => 33, + 'ST_ISSIMPLE' => 33, 'ST_OVERLAPS' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'LINEFROMTEXT' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RANDOM_BYTES' => 33, 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'ST_DIMENSION' => 33, + 'ST_GEOMETRYN' => 33, 'ST_NUMPOINTS' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'CREATE_DIGEST' => 33, 'FROM_UNIXTIME' => 33, 'GTID_SUBTRACT' => 33, + 'INTERIORRINGN' => 33, 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, + 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, 'ST_DIFFERENCE' => 33, + 'ST_INTERSECTS' => 33, 'ST_STARTPOINT' => 33, 'TIMESTAMPDIFF' => 33, 'WEIGHT_STRING' => 33, + 'IS_IPV4_COMPAT' => 33, 'IS_IPV4_MAPPED' => 33, 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, + 'POLYGONFROMWKB' => 33, 'ST_GEOMFROMWKB' => 33, 'ST_LINEFROMWKB' => 33, 'ST_POLYFROMWKB' => 33, + 'UNIX_TIMESTAMP' => 33, + 'ASYMMETRIC_SIGN' => 33, 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, + 'ST_EXTERIORRING' => 33, 'ST_GEOMETRYTYPE' => 33, 'ST_GEOMFROMTEXT' => 33, 'ST_INTERSECTION' => 33, + 'ST_LINEFROMTEXT' => 33, 'ST_POINTFROMWKB' => 33, 'ST_POLYFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'NUMINTERIORRINGS' => 33, 'ST_INTERIORRINGN' => 33, 'ST_NUMGEOMETRIES' => 33, + 'ST_POINTFROMTEXT' => 33, 'ST_SYMDIFFERENCE' => 33, + 'ASYMMETRIC_DERIVE' => 33, 'ASYMMETRIC_VERIFY' => 33, 'LINESTRINGFROMWKB' => 33, + 'MULTIPOINTFROMWKB' => 33, 'ST_POLYGONFROMWKB' => 33, + 'ASYMMETRIC_DECRYPT' => 33, 'ASYMMETRIC_ENCRYPT' => 33, 'MULTIPOINTFROMTEXT' => 33, + 'ST_GEOMCOLLFROMTXT' => 33, 'ST_GEOMCOLLFROMWKB' => 33, 'ST_POLYGONFROMTEXT' => 33, + 'MULTIPOLYGONFROMWKB' => 33, 'ST_GEOMCOLLFROMTEXT' => 33, 'ST_GEOMETRYFROMTEXT' => 33, + 'ST_NUMINTERIORRINGS' => 33, 'UNCOMPRESSED_LENGTH' => 33, + 'CREATE_DH_PARAMETERS' => 33, 'MULTIPOLYGONFROMTEXT' => 33, 'ST_LINESTRINGFROMWKB' => 33, + 'MULTILINESTRINGFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, + 'CREATE_ASYMMETRIC_PUB_KEY' => 33, 'GEOMETRYCOLLECTIONFROMWKB' => 33, + 'CREATE_ASYMMETRIC_PRIV_KEY' => 33, 'GEOMETRYCOLLECTIONFROMTEXT' => 33, 'VALIDATE_PASSWORD_STRENGTH' => 33, + 'SQL_THREAD_WAIT_AFTER_GTIDS' => 33, + 'ST_GEOMETRYCOLLECTIONFROMWKB' => 33, + 'ST_GEOMETRYCOLLECTIONFROMTEXT' => 33, + 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50700.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50700.php new file mode 100755 index 0000000..4ee4f86 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql50700.php @@ -0,0 +1,352 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, + 'ONE' => 1, 'ROW' => 1, 'XID' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, + 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, + 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'ONLY' => 1, 'OPEN' => 1, 'PAGE' => 1, + 'PORT' => 1, 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, + 'THAN' => 1, 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, + 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'NEVER' => 1, 'OWNER' => 1, 'PHASE' => 1, + 'PROXY' => 1, 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, + 'RTREE' => 1, 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, + 'SWAPS' => 1, 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'ALWAYS' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, + 'CLIENT' => 1, 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, + 'ESCAPE' => 1, 'EVENTS' => 1, 'EXPIRE' => 1, 'EXPORT' => 1, 'FAULTS' => 1, + 'FIELDS' => 1, 'FILTER' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, 'IMPORT' => 1, + 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, 'MEDIUM' => 1, 'MEMORY' => 1, + 'MODIFY' => 1, 'NUMBER' => 1, 'OFFSET' => 1, 'PARSER' => 1, 'PLUGIN' => 1, + 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, + 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, 'SONAME' => 1, + 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, 'STRING' => 1, + 'TABLES' => 1, + 'ACCOUNT' => 1, 'ANALYSE' => 1, 'CHANGED' => 1, 'CHANNEL' => 1, 'COLUMNS' => 1, + 'COMMENT' => 1, 'COMPACT' => 1, 'CONTEXT' => 1, 'CURRENT' => 1, 'DEFINER' => 1, + 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, 'EXECUTE' => 1, + 'FOLLOWS' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, + 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, + 'PARTIAL' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, 'REBUILD' => 1, + 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, 'SESSION' => 1, + 'STACKED' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, 'UNICODE' => 1, + 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'WITHOUT' => 1, 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXCHANGE' => 1, + 'EXTENDED' => 1, 'FUNCTION' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, + 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'PRECEDES' => 1, 'PRESERVE' => 1, + 'PROFILES' => 1, 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, + 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'IO_THREAD' => 1, 'ISOLATION' => 1, + 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, 'REDUNDANT' => 1, + 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, 'TEMPTABLE' => 1, + 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PLUGIN_DIR' => 1, + 'PRIVILEGES' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, + 'SQL_THREAD' => 1, 'TABLESPACE' => 1, 'TABLE_NAME' => 1, 'VALIDATION' => 1, + 'COLUMN_NAME' => 1, 'COMPRESSION' => 1, 'CURSOR_NAME' => 1, 'DIAGNOSTICS' => 1, + 'EXTENT_SIZE' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, + 'MYSQL_ERRNO' => 1, 'NONBLOCKING' => 1, 'PROCESSLIST' => 1, 'REPLICATION' => 1, + 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'DEFAULT_AUTH' => 1, 'DES_KEY_FILE' => 1, + 'INITIAL_SIZE' => 1, 'MASTER_DELAY' => 1, 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, + 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, 'SQL_TSI_HOUR' => 1, + 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'COLUMN_FORMAT' => 1, 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, + 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_CRL' => 1, 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, + 'SQL_TSI_SECOND' => 1, 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, 'FILE_BLOCK_SIZE' => 1, + 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'PARSE_GCOL_EXPR' => 1, + 'REPLICATE_DO_DB' => 1, 'SQL_AFTER_GTIDS' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'SQL_BEFORE_GTIDS' => 1, + 'STATS_PERSISTENT' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'CONSTRAINT_SCHEMA' => 1, 'GROUP_REPLICATION' => 1, 'IGNORE_SERVER_IDS' => 1, + 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'RETURNED_SQLSTATE' => 1, + 'SQL_BUFFER_RESULT' => 1, 'STATS_AUTO_RECALC' => 1, + 'CONSTRAINT_CATALOG' => 1, 'MASTER_RETRY_COUNT' => 1, 'MASTER_SSL_CRLPATH' => 1, + 'MAX_STATEMENT_TIME' => 1, 'REPLICATE_DO_TABLE' => 1, 'SQL_AFTER_MTS_GAPS' => 1, + 'STATS_SAMPLE_PAGES' => 1, + 'REPLICATE_IGNORE_DB' => 1, + 'MASTER_AUTO_POSITION' => 1, 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, + 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, 'REPLICATE_REWRITE_DB' => 1, + 'REPLICATE_IGNORE_TABLE' => 1, + 'MASTER_HEARTBEAT_PERIOD' => 1, 'REPLICATE_WILD_DO_TABLE' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + 'REPLICATE_WILD_IGNORE_TABLE' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'GET' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, + 'USE' => 3, 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, + 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, 'REGEXP' => 3, + 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SIGNAL' => 3, + 'STORED' => 3, 'UNLOCK' => 3, 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, 'VIRTUAL' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESIGNAL' => 3, 'RESTRICT' => 3, + 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, + 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'GENERATED' => 3, 'MIDDLEINT' => 3, + 'PARTITION' => 3, 'PRECISION' => 3, 'PROCEDURE' => 3, 'SENSITIVE' => 3, + 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'MASTER_BIND' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'IO_AFTER_GTIDS' => 3, 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, 'IO_BEFORE_GTIDS' => 3, 'OPTIMIZER_COSTS' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'ST_X' => 33, + 'ST_Y' => 33, 'TRIM' => 33, 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, + 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, + 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, + 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'BUFFER' => 33, 'CONCAT' => 33, 'DECODE' => 33, + 'ENCODE' => 33, 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, + 'LENGTH' => 33, 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, + 'SECOND' => 33, 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'IS_IPV4' => 33, 'IS_IPV6' => 33, 'QUARTER' => 33, 'RADIANS' => 33, + 'REVERSE' => 33, 'SOUNDEX' => 33, 'ST_AREA' => 33, 'ST_SRID' => 33, 'SUBDATE' => 33, + 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, 'VAR_POP' => 33, + 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'DISTANCE' => 33, + 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, + 'ISSIMPLE' => 33, 'JSON_SET' => 33, 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, + 'MBREQUAL' => 33, 'OVERLAPS' => 33, 'PASSWORD' => 33, 'POSITION' => 33, 'ST_ASWKB' => 33, + 'ST_ASWKT' => 33, 'ST_UNION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'ANY_VALUE' => 33, 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, + 'CONCAT_WS' => 33, 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, + 'FROM_DAYS' => 33, 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, + 'JSON_KEYS' => 33, 'JSON_TYPE' => 33, 'LOAD_FILE' => 33, 'MBRCOVERS' => 33, + 'MBREQUALS' => 33, 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, + 'ROW_COUNT' => 33, 'ST_ASTEXT' => 33, 'ST_BUFFER' => 33, 'ST_EQUALS' => 33, + 'ST_LENGTH' => 33, 'ST_POINTN' => 33, 'ST_WITHIN' => 33, 'SUBSTRING' => 33, + 'TO_BASE64' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'CONVEXHULL' => 33, 'DAYOFMONTH' => 33, + 'EXPORT_SET' => 33, 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INET6_ATON' => 33, + 'INET6_NTOA' => 33, 'INTERSECTS' => 33, 'JSON_ARRAY' => 33, 'JSON_DEPTH' => 33, + 'JSON_MERGE' => 33, 'JSON_QUOTE' => 33, 'JSON_VALID' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'ST_CROSSES' => 33, 'ST_GEOHASH' => 33, 'ST_ISEMPTY' => 33, + 'ST_ISVALID' => 33, 'ST_TOUCHES' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, + 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'CHAR_LENGTH' => 33, 'DATE_FORMAT' => 33, + 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, 'FROM_BASE64' => 33, + 'GEOMFROMWKB' => 33, 'GTID_SUBSET' => 33, 'JSON_INSERT' => 33, 'JSON_LENGTH' => 33, + 'JSON_OBJECT' => 33, 'JSON_PRETTY' => 33, 'JSON_REMOVE' => 33, 'JSON_SEARCH' => 33, + 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, 'MBROVERLAPS' => 33, + 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, 'SEC_TO_TIME' => 33, + 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'ST_ASBINARY' => 33, 'ST_CENTROID' => 33, + 'ST_CONTAINS' => 33, 'ST_DISJOINT' => 33, 'ST_DISTANCE' => 33, 'ST_ENDPOINT' => 33, + 'ST_ENVELOPE' => 33, 'ST_ISCLOSED' => 33, 'ST_ISSIMPLE' => 33, 'ST_OVERLAPS' => 33, + 'ST_SIMPLIFY' => 33, 'ST_VALIDATE' => 33, 'SYSTEM_USER' => 33, 'TIME_FORMAT' => 33, + 'TIME_TO_SEC' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'JSON_EXTRACT' => 33, 'JSON_REPLACE' => 33, 'JSON_UNQUOTE' => 33, 'LINEFROMTEXT' => 33, + 'MBRCOVEREDBY' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RANDOM_BYTES' => 33, 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'ST_ASGEOJSON' => 33, + 'ST_DIMENSION' => 33, 'ST_GEOMETRYN' => 33, 'ST_NUMPOINTS' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'GTID_SUBTRACT' => 33, 'INTERIORRINGN' => 33, + 'JSON_CONTAINS' => 33, 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, + 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, 'ST_CONVEXHULL' => 33, + 'ST_DIFFERENCE' => 33, 'ST_INTERSECTS' => 33, 'ST_STARTPOINT' => 33, 'TIMESTAMPDIFF' => 33, + 'WEIGHT_STRING' => 33, + 'IS_IPV4_COMPAT' => 33, 'IS_IPV4_MAPPED' => 33, 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, + 'POLYGONFROMWKB' => 33, 'ST_GEOMFROMWKB' => 33, 'ST_LINEFROMWKB' => 33, 'ST_POLYFROMWKB' => 33, + 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, 'ST_EXTERIORRING' => 33, + 'ST_GEOMETRYTYPE' => 33, 'ST_GEOMFROMTEXT' => 33, 'ST_INTERSECTION' => 33, 'ST_LINEFROMTEXT' => 33, + 'ST_MAKEENVELOPE' => 33, 'ST_MLINEFROMWKB' => 33, 'ST_MPOLYFROMWKB' => 33, 'ST_POINTFROMWKB' => 33, + 'ST_POLYFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'JSON_MERGE_PATCH' => 33, 'NUMINTERIORRINGS' => 33, 'ST_INTERIORRINGN' => 33, + 'ST_MLINEFROMTEXT' => 33, 'ST_MPOINTFROMWKB' => 33, 'ST_MPOLYFROMTEXT' => 33, + 'ST_NUMGEOMETRIES' => 33, 'ST_POINTFROMTEXT' => 33, 'ST_SYMDIFFERENCE' => 33, + 'JSON_ARRAY_APPEND' => 33, 'JSON_ARRAY_INSERT' => 33, 'JSON_STORAGE_FREE' => 33, + 'JSON_STORAGE_SIZE' => 33, 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, + 'RELEASE_ALL_LOCKS' => 33, 'ST_LATFROMGEOHASH' => 33, 'ST_MPOINTFROMTEXT' => 33, + 'ST_POLYGONFROMWKB' => 33, + 'JSON_CONTAINS_PATH' => 33, 'MULTIPOINTFROMTEXT' => 33, 'ST_BUFFER_STRATEGY' => 33, + 'ST_DISTANCE_SPHERE' => 33, 'ST_GEOMCOLLFROMTXT' => 33, 'ST_GEOMCOLLFROMWKB' => 33, + 'ST_GEOMFROMGEOJSON' => 33, 'ST_LONGFROMGEOHASH' => 33, 'ST_POLYGONFROMTEXT' => 33, + 'JSON_MERGE_PRESERVE' => 33, 'MULTIPOLYGONFROMWKB' => 33, 'ST_GEOMCOLLFROMTEXT' => 33, + 'ST_GEOMETRYFROMTEXT' => 33, 'ST_NUMINTERIORRINGS' => 33, 'ST_POINTFROMGEOHASH' => 33, + 'UNCOMPRESSED_LENGTH' => 33, + 'MULTIPOLYGONFROMTEXT' => 33, 'ST_LINESTRINGFROMWKB' => 33, 'ST_MULTIPOINTFROMWKB' => 33, + 'ST_MULTIPOINTFROMTEXT' => 33, + 'MULTILINESTRINGFROMWKB' => 33, 'ST_MULTIPOLYGONFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, 'ST_MULTIPOLYGONFROMTEXT' => 33, + 'GEOMETRYCOLLECTIONFROMWKB' => 33, 'ST_MULTILINESTRINGFROMWKB' => 33, + 'GEOMETRYCOLLECTIONFROMTEXT' => 33, 'ST_MULTILINESTRINGFROMTEXT' => 33, 'VALIDATE_PASSWORD_STRENGTH' => 33, + 'WAIT_FOR_EXECUTED_GTID_SET' => 33, + 'ST_GEOMETRYCOLLECTIONFROMWKB' => 33, + 'ST_GEOMETRYCOLLECTIONFROMTEXT' => 33, + 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql80000.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql80000.php new file mode 100755 index 0000000..f303af1 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Contexts/ContextMySql80000.php @@ -0,0 +1,353 @@ + 1, 'DO' => 1, 'IO' => 1, 'NO' => 1, 'XA' => 1, + 'ANY' => 1, 'CPU' => 1, 'END' => 1, 'IPC' => 1, 'NDB' => 1, 'NEW' => 1, + 'ONE' => 1, 'ROW' => 1, 'XID' => 1, + 'BOOL' => 1, 'BYTE' => 1, 'CODE' => 1, 'CUBE' => 1, 'DATA' => 1, 'DISK' => 1, + 'ENDS' => 1, 'FAST' => 1, 'FILE' => 1, 'FULL' => 1, 'HASH' => 1, 'HELP' => 1, + 'HOST' => 1, 'LAST' => 1, 'LESS' => 1, 'LIST' => 1, 'LOGS' => 1, 'MODE' => 1, + 'NAME' => 1, 'NEXT' => 1, 'NONE' => 1, 'ONLY' => 1, 'OPEN' => 1, 'PAGE' => 1, + 'PORT' => 1, 'PREV' => 1, 'ROWS' => 1, 'SLOW' => 1, 'SOME' => 1, 'STOP' => 1, + 'THAN' => 1, 'TYPE' => 1, 'VIEW' => 1, 'WAIT' => 1, 'WORK' => 1, 'X509' => 1, + 'AFTER' => 1, 'BEGIN' => 1, 'BLOCK' => 1, 'BTREE' => 1, 'CACHE' => 1, + 'CHAIN' => 1, 'CLOSE' => 1, 'ERROR' => 1, 'EVENT' => 1, 'EVERY' => 1, + 'FIRST' => 1, 'FIXED' => 1, 'FLUSH' => 1, 'FOUND' => 1, 'HOSTS' => 1, + 'LEVEL' => 1, 'LOCAL' => 1, 'LOCKS' => 1, 'MERGE' => 1, 'MUTEX' => 1, + 'NAMES' => 1, 'NCHAR' => 1, 'NEVER' => 1, 'OWNER' => 1, 'PHASE' => 1, + 'PROXY' => 1, 'QUERY' => 1, 'QUICK' => 1, 'RELAY' => 1, 'RESET' => 1, + 'RTREE' => 1, 'SHARE' => 1, 'SLAVE' => 1, 'START' => 1, 'SUPER' => 1, + 'SWAPS' => 1, 'TYPES' => 1, 'UNTIL' => 1, 'VALUE' => 1, + 'ACTION' => 1, 'ALWAYS' => 1, 'BACKUP' => 1, 'BINLOG' => 1, 'CIPHER' => 1, + 'CLIENT' => 1, 'COMMIT' => 1, 'ENABLE' => 1, 'ENGINE' => 1, 'ERRORS' => 1, + 'ESCAPE' => 1, 'EVENTS' => 1, 'EXPIRE' => 1, 'EXPORT' => 1, 'FAULTS' => 1, + 'FIELDS' => 1, 'FILTER' => 1, 'GLOBAL' => 1, 'GRANTS' => 1, 'IMPORT' => 1, + 'ISSUER' => 1, 'LEAVES' => 1, 'MASTER' => 1, 'MEDIUM' => 1, 'MEMORY' => 1, + 'MODIFY' => 1, 'NUMBER' => 1, 'OFFSET' => 1, 'PARSER' => 1, 'PLUGIN' => 1, + 'RELOAD' => 1, 'REMOVE' => 1, 'REPAIR' => 1, 'RESUME' => 1, 'ROLLUP' => 1, + 'SERVER' => 1, 'SIGNED' => 1, 'SIMPLE' => 1, 'SOCKET' => 1, 'SONAME' => 1, + 'SOUNDS' => 1, 'SOURCE' => 1, 'STARTS' => 1, 'STATUS' => 1, 'STRING' => 1, + 'TABLES' => 1, + 'ACCOUNT' => 1, 'ANALYSE' => 1, 'CHANGED' => 1, 'CHANNEL' => 1, 'COLUMNS' => 1, + 'COMMENT' => 1, 'COMPACT' => 1, 'CONTEXT' => 1, 'CURRENT' => 1, 'DEFINER' => 1, + 'DISABLE' => 1, 'DISCARD' => 1, 'DYNAMIC' => 1, 'ENGINES' => 1, 'EXECUTE' => 1, + 'FOLLOWS' => 1, 'GENERAL' => 1, 'HANDLER' => 1, 'INDEXES' => 1, 'INSTALL' => 1, + 'INVOKER' => 1, 'LOGFILE' => 1, 'MIGRATE' => 1, 'NO_WAIT' => 1, 'OPTIONS' => 1, + 'PARTIAL' => 1, 'PERSIST' => 1, 'PLUGINS' => 1, 'PREPARE' => 1, 'PROFILE' => 1, + 'REBUILD' => 1, 'RECOVER' => 1, 'RESTORE' => 1, 'RETURNS' => 1, 'ROUTINE' => 1, + 'SESSION' => 1, 'STACKED' => 1, 'STORAGE' => 1, 'SUBJECT' => 1, 'SUSPEND' => 1, + 'UNICODE' => 1, 'UNKNOWN' => 1, 'UPGRADE' => 1, 'USE_FRM' => 1, 'WITHOUT' => 1, + 'WRAPPER' => 1, + 'CASCADED' => 1, 'CHECKSUM' => 1, 'DATAFILE' => 1, 'DUMPFILE' => 1, 'EXCHANGE' => 1, + 'EXTENDED' => 1, 'FUNCTION' => 1, 'LANGUAGE' => 1, 'MAX_ROWS' => 1, 'MAX_SIZE' => 1, + 'MIN_ROWS' => 1, 'NATIONAL' => 1, 'NVARCHAR' => 1, 'PRECEDES' => 1, 'PRESERVE' => 1, + 'PROFILES' => 1, 'REDOFILE' => 1, 'RELAYLOG' => 1, 'ROLLBACK' => 1, 'SCHEDULE' => 1, + 'SECURITY' => 1, 'SHUTDOWN' => 1, 'SNAPSHOT' => 1, 'SWITCHES' => 1, 'TRIGGERS' => 1, + 'UNDOFILE' => 1, 'WARNINGS' => 1, + 'AGGREGATE' => 1, 'ALGORITHM' => 1, 'COMMITTED' => 1, 'DIRECTORY' => 1, + 'DUPLICATE' => 1, 'EXPANSION' => 1, 'INVISIBLE' => 1, 'IO_THREAD' => 1, + 'ISOLATION' => 1, 'NODEGROUP' => 1, 'PACK_KEYS' => 1, 'READ_ONLY' => 1, + 'REDUNDANT' => 1, 'SAVEPOINT' => 1, 'SQL_CACHE' => 1, 'TEMPORARY' => 1, + 'TEMPTABLE' => 1, 'UNDEFINED' => 1, 'UNINSTALL' => 1, 'VARIABLES' => 1, + 'COMPLETION' => 1, 'COMPRESSED' => 1, 'CONCURRENT' => 1, 'CONNECTION' => 1, + 'CONSISTENT' => 1, 'DEALLOCATE' => 1, 'IDENTIFIED' => 1, 'MASTER_SSL' => 1, + 'NDBCLUSTER' => 1, 'PARTITIONS' => 1, 'PERSISTENT' => 1, 'PLUGIN_DIR' => 1, + 'PRIVILEGES' => 1, 'REORGANIZE' => 1, 'REPEATABLE' => 1, 'ROW_FORMAT' => 1, + 'SQL_THREAD' => 1, 'TABLESPACE' => 1, 'TABLE_NAME' => 1, 'VALIDATION' => 1, + 'COLUMN_NAME' => 1, 'COMPRESSION' => 1, 'CURSOR_NAME' => 1, 'DIAGNOSTICS' => 1, + 'EXTENT_SIZE' => 1, 'MASTER_HOST' => 1, 'MASTER_PORT' => 1, 'MASTER_USER' => 1, + 'MYSQL_ERRNO' => 1, 'NONBLOCKING' => 1, 'PROCESSLIST' => 1, 'REPLICATION' => 1, + 'SCHEMA_NAME' => 1, 'SQL_TSI_DAY' => 1, 'TRANSACTION' => 1, 'UNCOMMITTED' => 1, + 'CATALOG_NAME' => 1, 'CLASS_ORIGIN' => 1, 'DEFAULT_AUTH' => 1, 'DES_KEY_FILE' => 1, + 'INITIAL_SIZE' => 1, 'MASTER_DELAY' => 1, 'MESSAGE_TEXT' => 1, 'PARTITIONING' => 1, + 'PERSIST_ONLY' => 1, 'RELAY_THREAD' => 1, 'SERIALIZABLE' => 1, 'SQL_NO_CACHE' => 1, + 'SQL_TSI_HOUR' => 1, 'SQL_TSI_WEEK' => 1, 'SQL_TSI_YEAR' => 1, 'SUBPARTITION' => 1, + 'COLUMN_FORMAT' => 1, 'INSERT_METHOD' => 1, 'MASTER_SSL_CA' => 1, 'RELAY_LOG_POS' => 1, + 'SQL_TSI_MONTH' => 1, 'SUBPARTITIONS' => 1, + 'AUTO_INCREMENT' => 1, 'AVG_ROW_LENGTH' => 1, 'KEY_BLOCK_SIZE' => 1, 'MASTER_LOG_POS' => 1, + 'MASTER_SSL_CRL' => 1, 'MASTER_SSL_KEY' => 1, 'RELAY_LOG_FILE' => 1, 'SQL_TSI_MINUTE' => 1, + 'SQL_TSI_SECOND' => 1, 'TABLE_CHECKSUM' => 1, 'USER_RESOURCES' => 1, + 'AUTOEXTEND_SIZE' => 1, 'CONSTRAINT_NAME' => 1, 'DELAY_KEY_WRITE' => 1, 'FILE_BLOCK_SIZE' => 1, + 'MASTER_LOG_FILE' => 1, 'MASTER_PASSWORD' => 1, 'MASTER_SSL_CERT' => 1, 'PARSE_GCOL_EXPR' => 1, + 'REPLICATE_DO_DB' => 1, 'SQL_AFTER_GTIDS' => 1, 'SQL_TSI_QUARTER' => 1, 'SUBCLASS_ORIGIN' => 1, + 'MASTER_SERVER_ID' => 1, 'REDO_BUFFER_SIZE' => 1, 'SQL_BEFORE_GTIDS' => 1, + 'STATS_PERSISTENT' => 1, 'UNDO_BUFFER_SIZE' => 1, + 'CONSTRAINT_SCHEMA' => 1, 'GROUP_REPLICATION' => 1, 'IGNORE_SERVER_IDS' => 1, + 'MASTER_SSL_CAPATH' => 1, 'MASTER_SSL_CIPHER' => 1, 'RETURNED_SQLSTATE' => 1, + 'SQL_BUFFER_RESULT' => 1, 'STATS_AUTO_RECALC' => 1, + 'CONSTRAINT_CATALOG' => 1, 'MASTER_RETRY_COUNT' => 1, 'MASTER_SSL_CRLPATH' => 1, + 'MAX_STATEMENT_TIME' => 1, 'REPLICATE_DO_TABLE' => 1, 'SQL_AFTER_MTS_GAPS' => 1, + 'STATS_SAMPLE_PAGES' => 1, + 'REPLICATE_IGNORE_DB' => 1, + 'MASTER_AUTO_POSITION' => 1, 'MASTER_CONNECT_RETRY' => 1, 'MAX_QUERIES_PER_HOUR' => 1, + 'MAX_UPDATES_PER_HOUR' => 1, 'MAX_USER_CONNECTIONS' => 1, 'REPLICATE_REWRITE_DB' => 1, + 'REPLICATE_IGNORE_TABLE' => 1, + 'MASTER_HEARTBEAT_PERIOD' => 1, 'REPLICATE_WILD_DO_TABLE' => 1, + 'MAX_CONNECTIONS_PER_HOUR' => 1, + 'REPLICATE_WILD_IGNORE_TABLE' => 1, + + 'AS' => 3, 'BY' => 3, 'IS' => 3, 'ON' => 3, 'OR' => 3, 'TO' => 3, + 'ADD' => 3, 'ALL' => 3, 'AND' => 3, 'ASC' => 3, 'DEC' => 3, 'DIV' => 3, + 'FOR' => 3, 'GET' => 3, 'NOT' => 3, 'OUT' => 3, 'SQL' => 3, 'SSL' => 3, + 'USE' => 3, 'XOR' => 3, + 'BOTH' => 3, 'CALL' => 3, 'CASE' => 3, 'DESC' => 3, 'DROP' => 3, 'DUAL' => 3, + 'EACH' => 3, 'ELSE' => 3, 'EXIT' => 3, 'FROM' => 3, 'INT1' => 3, 'INT2' => 3, + 'INT3' => 3, 'INT4' => 3, 'INT8' => 3, 'INTO' => 3, 'JOIN' => 3, 'KEYS' => 3, + 'KILL' => 3, 'LIKE' => 3, 'LOAD' => 3, 'LOCK' => 3, 'LONG' => 3, 'LOOP' => 3, + 'NULL' => 3, 'READ' => 3, 'SHOW' => 3, 'THEN' => 3, 'TRUE' => 3, 'UNDO' => 3, + 'WHEN' => 3, 'WITH' => 3, + 'ALTER' => 3, 'CHECK' => 3, 'CROSS' => 3, 'FALSE' => 3, 'FETCH' => 3, + 'FORCE' => 3, 'GRANT' => 3, 'GROUP' => 3, 'INNER' => 3, 'INOUT' => 3, + 'LEAVE' => 3, 'LIMIT' => 3, 'LINES' => 3, 'ORDER' => 3, 'OUTER' => 3, + 'PURGE' => 3, 'RANGE' => 3, 'READS' => 3, 'RLIKE' => 3, 'TABLE' => 3, + 'UNION' => 3, 'USAGE' => 3, 'USING' => 3, 'WHERE' => 3, 'WHILE' => 3, + 'WRITE' => 3, + 'BEFORE' => 3, 'CHANGE' => 3, 'COLUMN' => 3, 'CREATE' => 3, 'CURSOR' => 3, + 'DELETE' => 3, 'ELSEIF' => 3, 'FLOAT4' => 3, 'FLOAT8' => 3, 'HAVING' => 3, + 'IGNORE' => 3, 'INFILE' => 3, 'LINEAR' => 3, 'OPTION' => 3, 'REGEXP' => 3, + 'RENAME' => 3, 'RETURN' => 3, 'REVOKE' => 3, 'SELECT' => 3, 'SIGNAL' => 3, + 'STORED' => 3, 'UNLOCK' => 3, 'UPDATE' => 3, + 'ANALYZE' => 3, 'BETWEEN' => 3, 'CASCADE' => 3, 'COLLATE' => 3, 'DECLARE' => 3, + 'DELAYED' => 3, 'ESCAPED' => 3, 'EXPLAIN' => 3, 'FOREIGN' => 3, 'ITERATE' => 3, + 'LEADING' => 3, 'NATURAL' => 3, 'OUTFILE' => 3, 'PRIMARY' => 3, 'RELEASE' => 3, + 'REQUIRE' => 3, 'SCHEMAS' => 3, 'TRIGGER' => 3, 'VARYING' => 3, 'VIRTUAL' => 3, + 'CONTINUE' => 3, 'DAY_HOUR' => 3, 'DESCRIBE' => 3, 'DISTINCT' => 3, 'ENCLOSED' => 3, + 'MAXVALUE' => 3, 'MODIFIES' => 3, 'OPTIMIZE' => 3, 'RESIGNAL' => 3, 'RESTRICT' => 3, + 'SPECIFIC' => 3, 'SQLSTATE' => 3, 'STARTING' => 3, 'TRAILING' => 3, 'UNSIGNED' => 3, + 'ZEROFILL' => 3, + 'CONDITION' => 3, 'DATABASES' => 3, 'GENERATED' => 3, 'MIDDLEINT' => 3, + 'PARTITION' => 3, 'PRECISION' => 3, 'PROCEDURE' => 3, 'SENSITIVE' => 3, + 'SEPARATOR' => 3, + 'ACCESSIBLE' => 3, 'ASENSITIVE' => 3, 'CONSTRAINT' => 3, 'DAY_MINUTE' => 3, + 'DAY_SECOND' => 3, 'OPTIONALLY' => 3, 'READ_WRITE' => 3, 'REFERENCES' => 3, + 'SQLWARNING' => 3, 'TERMINATED' => 3, 'YEAR_MONTH' => 3, + 'DISTINCTROW' => 3, 'HOUR_MINUTE' => 3, 'HOUR_SECOND' => 3, 'INSENSITIVE' => 3, + 'MASTER_BIND' => 3, + 'LOW_PRIORITY' => 3, 'SQLEXCEPTION' => 3, 'VARCHARACTER' => 3, + 'DETERMINISTIC' => 3, 'HIGH_PRIORITY' => 3, 'MINUTE_SECOND' => 3, 'STRAIGHT_JOIN' => 3, + 'IO_AFTER_GTIDS' => 3, 'SQL_BIG_RESULT' => 3, + 'DAY_MICROSECOND' => 3, 'IO_BEFORE_GTIDS' => 3, 'OPTIMIZER_COSTS' => 3, + 'HOUR_MICROSECOND' => 3, 'SQL_SMALL_RESULT' => 3, + 'MINUTE_MICROSECOND' => 3, 'NO_WRITE_TO_BINLOG' => 3, 'SECOND_MICROSECOND' => 3, + 'SQL_CALC_FOUND_ROWS' => 3, + 'MASTER_SSL_VERIFY_SERVER_CERT' => 3, + + 'GROUP BY' => 7, 'NOT NULL' => 7, 'ORDER BY' => 7, 'SET NULL' => 7, + 'AND CHAIN' => 7, 'FULL JOIN' => 7, 'IF EXISTS' => 7, 'LEFT JOIN' => 7, + 'LESS THAN' => 7, 'LOAD DATA' => 7, 'NO ACTION' => 7, 'ON DELETE' => 7, + 'ON UPDATE' => 7, 'UNION ALL' => 7, + 'CROSS JOIN' => 7, 'ESCAPED BY' => 7, 'FOR UPDATE' => 7, 'INNER JOIN' => 7, + 'LINEAR KEY' => 7, 'NO RELEASE' => 7, 'OR REPLACE' => 7, 'RIGHT JOIN' => 7, + 'ENCLOSED BY' => 7, 'LINEAR HASH' => 7, 'STARTING BY' => 7, + 'AND NO CHAIN' => 7, 'FOR EACH ROW' => 7, 'NATURAL JOIN' => 7, 'PARTITION BY' => 7, + 'SET PASSWORD' => 7, 'SQL SECURITY' => 7, + 'CHARACTER SET' => 7, 'IF NOT EXISTS' => 7, 'TERMINATED BY' => 7, + 'DATA DIRECTORY' => 7, 'UNION DISTINCT' => 7, + 'DEFAULT CHARSET' => 7, 'DEFAULT COLLATE' => 7, 'FULL OUTER JOIN' => 7, 'INDEX DIRECTORY' => 7, + 'LEFT OUTER JOIN' => 7, 'SUBPARTITION BY' => 7, + 'GENERATED ALWAYS' => 7, 'RIGHT OUTER JOIN' => 7, + 'NATURAL LEFT JOIN' => 7, 'START TRANSACTION' => 7, + 'LOCK IN SHARE MODE' => 7, 'NATURAL RIGHT JOIN' => 7, 'SELECT TRANSACTION' => 7, + 'DEFAULT CHARACTER SET' => 7, + 'NATURAL LEFT OUTER JOIN' => 7, + 'NATURAL RIGHT OUTER JOIN' => 7, 'WITH CONSISTENT SNAPSHOT' => 7, + + 'BIT' => 9, 'XML' => 9, + 'ENUM' => 9, 'JSON' => 9, 'TEXT' => 9, + 'ARRAY' => 9, + 'SERIAL' => 9, + 'BOOLEAN' => 9, + 'DATETIME' => 9, 'GEOMETRY' => 9, 'MULTISET' => 9, + 'MULTILINEPOINT' => 9, + 'MULTILINEPOLYGON' => 9, + + 'INT' => 11, 'SET' => 11, + 'BLOB' => 11, 'REAL' => 11, + 'FLOAT' => 11, + 'BIGINT' => 11, 'DOUBLE' => 11, + 'DECIMAL' => 11, 'INTEGER' => 11, 'NUMERIC' => 11, 'TINYINT' => 11, 'VARCHAR' => 11, + 'LONGBLOB' => 11, 'LONGTEXT' => 11, 'SMALLINT' => 11, 'TINYBLOB' => 11, 'TINYTEXT' => 11, + 'CHARACTER' => 11, 'MEDIUMINT' => 11, 'VARBINARY' => 11, + 'MEDIUMBLOB' => 11, 'MEDIUMTEXT' => 11, + + 'BINARY VARYING' => 15, + + 'KEY' => 19, + 'INDEX' => 19, + 'UNIQUE' => 19, + 'SPATIAL' => 19, + 'FULLTEXT' => 19, + + 'INDEX KEY' => 23, + 'UNIQUE KEY' => 23, + 'FOREIGN KEY' => 23, 'PRIMARY KEY' => 23, 'SPATIAL KEY' => 23, + 'FULLTEXT KEY' => 23, 'UNIQUE INDEX' => 23, + 'SPATIAL INDEX' => 23, + 'FULLTEXT INDEX' => 23, + + 'X' => 33, 'Y' => 33, + 'LN' => 33, 'PI' => 33, + 'ABS' => 33, 'AVG' => 33, 'BIN' => 33, 'COS' => 33, 'COT' => 33, 'DAY' => 33, + 'ELT' => 33, 'EXP' => 33, 'HEX' => 33, 'LOG' => 33, 'MAX' => 33, 'MD5' => 33, + 'MID' => 33, 'MIN' => 33, 'NOW' => 33, 'OCT' => 33, 'ORD' => 33, 'POW' => 33, + 'SHA' => 33, 'SIN' => 33, 'STD' => 33, 'SUM' => 33, 'TAN' => 33, + 'ACOS' => 33, 'AREA' => 33, 'ASIN' => 33, 'ATAN' => 33, 'CAST' => 33, 'CEIL' => 33, + 'CONV' => 33, 'HOUR' => 33, 'LOG2' => 33, 'LPAD' => 33, 'RAND' => 33, 'RPAD' => 33, + 'SHA1' => 33, 'SHA2' => 33, 'SIGN' => 33, 'SQRT' => 33, 'SRID' => 33, 'ST_X' => 33, + 'ST_Y' => 33, 'TRIM' => 33, 'USER' => 33, 'UUID' => 33, 'WEEK' => 33, + 'ASCII' => 33, 'ASWKB' => 33, 'ASWKT' => 33, 'ATAN2' => 33, 'COUNT' => 33, + 'CRC32' => 33, 'FIELD' => 33, 'FLOOR' => 33, 'INSTR' => 33, 'LCASE' => 33, + 'LEAST' => 33, 'LOG10' => 33, 'LOWER' => 33, 'LTRIM' => 33, 'MONTH' => 33, + 'POWER' => 33, 'QUOTE' => 33, 'ROUND' => 33, 'RTRIM' => 33, 'SLEEP' => 33, + 'SPACE' => 33, 'UCASE' => 33, 'UNHEX' => 33, 'UPPER' => 33, + 'ASTEXT' => 33, 'BIT_OR' => 33, 'BUFFER' => 33, 'CONCAT' => 33, 'DECODE' => 33, + 'ENCODE' => 33, 'EQUALS' => 33, 'FORMAT' => 33, 'IFNULL' => 33, 'ISNULL' => 33, + 'LENGTH' => 33, 'LOCATE' => 33, 'MINUTE' => 33, 'NULLIF' => 33, 'POINTN' => 33, + 'SECOND' => 33, 'STDDEV' => 33, 'STRCMP' => 33, 'SUBSTR' => 33, 'WITHIN' => 33, + 'ADDDATE' => 33, 'ADDTIME' => 33, 'AGAINST' => 33, 'BIT_AND' => 33, 'BIT_XOR' => 33, + 'CEILING' => 33, 'CHARSET' => 33, 'CROSSES' => 33, 'CURDATE' => 33, 'CURTIME' => 33, + 'DAYNAME' => 33, 'DEGREES' => 33, 'ENCRYPT' => 33, 'EXTRACT' => 33, 'GLENGTH' => 33, + 'ISEMPTY' => 33, 'IS_IPV4' => 33, 'IS_IPV6' => 33, 'IS_UUID' => 33, 'QUARTER' => 33, + 'RADIANS' => 33, 'REVERSE' => 33, 'SOUNDEX' => 33, 'ST_AREA' => 33, 'ST_SRID' => 33, + 'SUBDATE' => 33, 'SUBTIME' => 33, 'SYSDATE' => 33, 'TOUCHES' => 33, 'TO_DAYS' => 33, + 'VAR_POP' => 33, 'VERSION' => 33, 'WEEKDAY' => 33, + 'ASBINARY' => 33, 'CENTROID' => 33, 'COALESCE' => 33, 'COMPRESS' => 33, 'CONTAINS' => 33, + 'DATEDIFF' => 33, 'DATE_ADD' => 33, 'DATE_SUB' => 33, 'DISJOINT' => 33, 'DISTANCE' => 33, + 'ENDPOINT' => 33, 'ENVELOPE' => 33, 'GET_LOCK' => 33, 'GREATEST' => 33, 'ISCLOSED' => 33, + 'ISSIMPLE' => 33, 'JSON_SET' => 33, 'MAKEDATE' => 33, 'MAKETIME' => 33, 'MAKE_SET' => 33, + 'MBREQUAL' => 33, 'OVERLAPS' => 33, 'PASSWORD' => 33, 'POSITION' => 33, 'ST_ASWKB' => 33, + 'ST_ASWKT' => 33, 'ST_UNION' => 33, 'TIMEDIFF' => 33, 'TRUNCATE' => 33, 'VARIANCE' => 33, + 'VAR_SAMP' => 33, 'YEARWEEK' => 33, + 'ANY_VALUE' => 33, 'BENCHMARK' => 33, 'BIT_COUNT' => 33, 'COLLATION' => 33, + 'CONCAT_WS' => 33, 'DAYOFWEEK' => 33, 'DAYOFYEAR' => 33, 'DIMENSION' => 33, + 'FROM_DAYS' => 33, 'GEOMETRYN' => 33, 'INET_ATON' => 33, 'INET_NTOA' => 33, + 'JSON_KEYS' => 33, 'JSON_TYPE' => 33, 'LOAD_FILE' => 33, 'MBRCOVERS' => 33, + 'MBREQUALS' => 33, 'MBRWITHIN' => 33, 'MONTHNAME' => 33, 'NUMPOINTS' => 33, + 'ROW_COUNT' => 33, 'ST_ASTEXT' => 33, 'ST_BUFFER' => 33, 'ST_EQUALS' => 33, + 'ST_LENGTH' => 33, 'ST_POINTN' => 33, 'ST_WITHIN' => 33, 'SUBSTRING' => 33, + 'TO_BASE64' => 33, 'UPDATEXML' => 33, + 'BIT_LENGTH' => 33, 'CONVERT_TZ' => 33, 'CONVEXHULL' => 33, 'DAYOFMONTH' => 33, + 'EXPORT_SET' => 33, 'FOUND_ROWS' => 33, 'GET_FORMAT' => 33, 'INET6_ATON' => 33, + 'INET6_NTOA' => 33, 'INTERSECTS' => 33, 'JSON_ARRAY' => 33, 'JSON_DEPTH' => 33, + 'JSON_MERGE' => 33, 'JSON_QUOTE' => 33, 'JSON_VALID' => 33, 'MBRTOUCHES' => 33, + 'MULTIPOINT' => 33, 'NAME_CONST' => 33, 'PERIOD_ADD' => 33, 'STARTPOINT' => 33, + 'STDDEV_POP' => 33, 'ST_CROSSES' => 33, 'ST_GEOHASH' => 33, 'ST_ISEMPTY' => 33, + 'ST_ISVALID' => 33, 'ST_TOUCHES' => 33, 'TO_SECONDS' => 33, 'UNCOMPRESS' => 33, + 'UUID_SHORT' => 33, 'WEEKOFYEAR' => 33, + 'AES_DECRYPT' => 33, 'AES_ENCRYPT' => 33, 'BIN_TO_UUID' => 33, 'CHAR_LENGTH' => 33, + 'DATE_FORMAT' => 33, 'DES_DECRYPT' => 33, 'DES_ENCRYPT' => 33, 'FIND_IN_SET' => 33, + 'FROM_BASE64' => 33, 'GEOMFROMWKB' => 33, 'GTID_SUBSET' => 33, 'JSON_INSERT' => 33, + 'JSON_LENGTH' => 33, 'JSON_OBJECT' => 33, 'JSON_PRETTY' => 33, 'JSON_REMOVE' => 33, + 'JSON_SEARCH' => 33, 'LINEFROMWKB' => 33, 'MBRCONTAINS' => 33, 'MBRDISJOINT' => 33, + 'MBROVERLAPS' => 33, 'MICROSECOND' => 33, 'PERIOD_DIFF' => 33, 'POLYFROMWKB' => 33, + 'SEC_TO_TIME' => 33, 'STDDEV_SAMP' => 33, 'STR_TO_DATE' => 33, 'ST_ASBINARY' => 33, + 'ST_CENTROID' => 33, 'ST_CONTAINS' => 33, 'ST_DISJOINT' => 33, 'ST_DISTANCE' => 33, + 'ST_ENDPOINT' => 33, 'ST_ENVELOPE' => 33, 'ST_ISCLOSED' => 33, 'ST_ISSIMPLE' => 33, + 'ST_OVERLAPS' => 33, 'ST_SIMPLIFY' => 33, 'ST_VALIDATE' => 33, 'SYSTEM_USER' => 33, + 'TIME_FORMAT' => 33, 'TIME_TO_SEC' => 33, 'UUID_TO_BIN' => 33, + 'COERCIBILITY' => 33, 'EXTERIORRING' => 33, 'EXTRACTVALUE' => 33, 'GEOMETRYTYPE' => 33, + 'GEOMFROMTEXT' => 33, 'GROUP_CONCAT' => 33, 'IS_FREE_LOCK' => 33, 'IS_USED_LOCK' => 33, + 'JSON_EXTRACT' => 33, 'JSON_REPLACE' => 33, 'JSON_UNQUOTE' => 33, 'LINEFROMTEXT' => 33, + 'MBRCOVEREDBY' => 33, 'MLINEFROMWKB' => 33, 'MPOLYFROMWKB' => 33, 'MULTIPOLYGON' => 33, + 'OCTET_LENGTH' => 33, 'OLD_PASSWORD' => 33, 'POINTFROMWKB' => 33, 'POLYFROMTEXT' => 33, + 'RANDOM_BYTES' => 33, 'RELEASE_LOCK' => 33, 'SESSION_USER' => 33, 'ST_ASGEOJSON' => 33, + 'ST_DIMENSION' => 33, 'ST_GEOMETRYN' => 33, 'ST_NUMPOINTS' => 33, 'TIMESTAMPADD' => 33, + 'CONNECTION_ID' => 33, 'FROM_UNIXTIME' => 33, 'GTID_SUBTRACT' => 33, 'INTERIORRINGN' => 33, + 'JSON_CONTAINS' => 33, 'MBRINTERSECTS' => 33, 'MLINEFROMTEXT' => 33, 'MPOINTFROMWKB' => 33, + 'MPOLYFROMTEXT' => 33, 'NUMGEOMETRIES' => 33, 'POINTFROMTEXT' => 33, 'ST_CONVEXHULL' => 33, + 'ST_DIFFERENCE' => 33, 'ST_INTERSECTS' => 33, 'ST_STARTPOINT' => 33, 'TIMESTAMPDIFF' => 33, + 'WEIGHT_STRING' => 33, + 'IS_IPV4_COMPAT' => 33, 'IS_IPV4_MAPPED' => 33, 'LAST_INSERT_ID' => 33, 'MPOINTFROMTEXT' => 33, + 'POLYGONFROMWKB' => 33, 'ST_GEOMFROMWKB' => 33, 'ST_LINEFROMWKB' => 33, 'ST_POLYFROMWKB' => 33, + 'UNIX_TIMESTAMP' => 33, + 'GEOMCOLLFROMWKB' => 33, 'MASTER_POS_WAIT' => 33, 'POLYGONFROMTEXT' => 33, 'ST_EXTERIORRING' => 33, + 'ST_GEOMETRYTYPE' => 33, 'ST_GEOMFROMTEXT' => 33, 'ST_INTERSECTION' => 33, 'ST_LINEFROMTEXT' => 33, + 'ST_MAKEENVELOPE' => 33, 'ST_MLINEFROMWKB' => 33, 'ST_MPOLYFROMWKB' => 33, 'ST_POINTFROMWKB' => 33, + 'ST_POLYFROMTEXT' => 33, 'SUBSTRING_INDEX' => 33, + 'CHARACTER_LENGTH' => 33, 'GEOMCOLLFROMTEXT' => 33, 'GEOMETRYFROMTEXT' => 33, + 'JSON_MERGE_PATCH' => 33, 'NUMINTERIORRINGS' => 33, 'ST_INTERIORRINGN' => 33, + 'ST_MLINEFROMTEXT' => 33, 'ST_MPOINTFROMWKB' => 33, 'ST_MPOLYFROMTEXT' => 33, + 'ST_NUMGEOMETRIES' => 33, 'ST_POINTFROMTEXT' => 33, 'ST_SYMDIFFERENCE' => 33, + 'JSON_ARRAY_APPEND' => 33, 'JSON_ARRAY_INSERT' => 33, 'JSON_STORAGE_FREE' => 33, + 'JSON_STORAGE_SIZE' => 33, 'LINESTRINGFROMWKB' => 33, 'MULTIPOINTFROMWKB' => 33, + 'RELEASE_ALL_LOCKS' => 33, 'ST_LATFROMGEOHASH' => 33, 'ST_MPOINTFROMTEXT' => 33, + 'ST_POLYGONFROMWKB' => 33, + 'JSON_CONTAINS_PATH' => 33, 'MULTIPOINTFROMTEXT' => 33, 'ST_BUFFER_STRATEGY' => 33, + 'ST_DISTANCE_SPHERE' => 33, 'ST_GEOMCOLLFROMTXT' => 33, 'ST_GEOMCOLLFROMWKB' => 33, + 'ST_GEOMFROMGEOJSON' => 33, 'ST_LONGFROMGEOHASH' => 33, 'ST_POLYGONFROMTEXT' => 33, + 'JSON_MERGE_PRESERVE' => 33, 'MULTIPOLYGONFROMWKB' => 33, 'ST_GEOMCOLLFROMTEXT' => 33, + 'ST_GEOMETRYFROMTEXT' => 33, 'ST_NUMINTERIORRINGS' => 33, 'ST_POINTFROMGEOHASH' => 33, + 'UNCOMPRESSED_LENGTH' => 33, + 'MULTIPOLYGONFROMTEXT' => 33, 'ST_LINESTRINGFROMWKB' => 33, 'ST_MULTIPOINTFROMWKB' => 33, + 'ST_MULTIPOINTFROMTEXT' => 33, + 'MULTILINESTRINGFROMWKB' => 33, 'ST_MULTIPOLYGONFROMWKB' => 33, + 'MULTILINESTRINGFROMTEXT' => 33, 'ST_MULTIPOLYGONFROMTEXT' => 33, + 'GEOMETRYCOLLECTIONFROMWKB' => 33, 'ST_MULTILINESTRINGFROMWKB' => 33, + 'GEOMETRYCOLLECTIONFROMTEXT' => 33, 'ST_MULTILINESTRINGFROMTEXT' => 33, 'VALIDATE_PASSWORD_STRENGTH' => 33, + 'WAIT_FOR_EXECUTED_GTID_SET' => 33, + 'ST_GEOMETRYCOLLECTIONFROMWKB' => 33, + 'ST_GEOMETRYCOLLECTIONFROMTEXT' => 33, + 'WAIT_UNTIL_SQL_THREAD_AFTER_GTIDS' => 33, + + 'IF' => 35, 'IN' => 35, + 'MOD' => 35, + 'LEFT' => 35, + 'MATCH' => 35, 'RIGHT' => 35, + 'EXISTS' => 35, 'INSERT' => 35, 'REPEAT' => 35, 'SCHEMA' => 35, 'VALUES' => 35, + 'CONVERT' => 35, 'DEFAULT' => 35, 'REPLACE' => 35, + 'DATABASE' => 35, 'UTC_DATE' => 35, 'UTC_TIME' => 35, + 'LOCALTIME' => 35, + 'CURRENT_DATE' => 35, 'CURRENT_TIME' => 35, 'CURRENT_USER' => 35, + 'UTC_TIMESTAMP' => 35, + 'LOCALTIMESTAMP' => 35, + 'CURRENT_TIMESTAMP' => 35, + + 'NOT IN' => 39, + + 'DATE' => 41, 'TIME' => 41, 'YEAR' => 41, + 'POINT' => 41, + 'POLYGON' => 41, + 'TIMESTAMP' => 41, + 'LINESTRING' => 41, + 'MULTILINESTRING' => 41, + 'GEOMETRYCOLLECTION' => 41, + + 'CHAR' => 43, + 'BINARY' => 43, + 'INTERVAL' => 43, + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Core.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Core.php new file mode 100755 index 0000000..052ac5e --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Core.php @@ -0,0 +1,47 @@ +strict) { + throw $error; + } + $this->errors[] = $error; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/LexerException.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/LexerException.php new file mode 100755 index 0000000..61e88c9 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/LexerException.php @@ -0,0 +1,46 @@ +ch = $ch; + $this->pos = $pos; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/LoaderException.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/LoaderException.php new file mode 100755 index 0000000..bfbd4c3 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/LoaderException.php @@ -0,0 +1,37 @@ +name = $name; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/ParserException.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/ParserException.php new file mode 100755 index 0000000..eb13653 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Exceptions/ParserException.php @@ -0,0 +1,39 @@ +token = $token; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Lexer.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Lexer.php new file mode 100755 index 0000000..943dd3f --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Lexer.php @@ -0,0 +1,1017 @@ +list; + } + + /** + * Constructor. + * + * @param string|UtfString $str the query to be lexed + * @param bool $strict whether strict mode should be + * enabled or not + * @param string $delimiter the delimiter to be used + */ + public function __construct($str, $strict = false, $delimiter = null) + { + // `strlen` is used instead of `mb_strlen` because the lexer needs to + // parse each byte of the input. + $len = $str instanceof UtfString ? $str->length() : strlen($str); + + // For multi-byte strings, a new instance of `UtfString` is + // initialized (only if `UtfString` usage is forced. + if (! $str instanceof UtfString && USE_UTF_STRINGS && $len !== mb_strlen($str, 'UTF-8')) { + $str = new UtfString($str); + } + + $this->str = $str; + $this->len = $str instanceof UtfString ? $str->length() : $len; + + $this->strict = $strict; + + // Setting the delimiter. + $this->setDelimiter( + ! empty($delimiter) ? $delimiter : static::$DEFAULT_DELIMITER + ); + + $this->lex(); + } + + /** + * Sets the delimiter. + * + * @param string $delimiter the new delimiter + */ + public function setDelimiter($delimiter) + { + $this->delimiter = $delimiter; + $this->delimiterLen = strlen($delimiter); + } + + /** + * Parses the string and extracts lexemes. + */ + public function lex() + { + // TODO: Sometimes, static::parse* functions make unnecessary calls to + // is* functions. For a better performance, some rules can be deduced + // from context. + // For example, in `parseBool` there is no need to compare the token + // every time with `true` and `false`. The first step would be to + // compare with 'true' only and just after that add another letter from + // context and compare again with `false`. + // Another example is `parseComment`. + + $list = new TokensList(); + + /** + * Last processed token. + * + * @var Token + */ + $lastToken = null; + + for ($this->last = 0, $lastIdx = 0; $this->last < $this->len; $lastIdx = ++$this->last) { + /** + * The new token. + * + * @var Token + */ + $token = null; + + foreach (static::$PARSER_METHODS as $method) { + if ($token = $this->$method()) { + break; + } + } + + if ($token === null) { + // @assert($this->last === $lastIdx); + $token = new Token($this->str[$this->last]); + $this->error( + 'Unexpected character.', + $this->str[$this->last], + $this->last + ); + } elseif ($lastToken !== null + && $token->type === Token::TYPE_SYMBOL + && $token->flags & Token::FLAG_SYMBOL_VARIABLE + && ( + $lastToken->type === Token::TYPE_STRING + || ( + $lastToken->type === Token::TYPE_SYMBOL + && $lastToken->flags & Token::FLAG_SYMBOL_BACKTICK + ) + ) + ) { + // Handles ```... FROM 'user'@'%' ...```. + $lastToken->token .= $token->token; + $lastToken->type = Token::TYPE_SYMBOL; + $lastToken->flags = Token::FLAG_SYMBOL_USER; + $lastToken->value .= '@' . $token->value; + continue; + } elseif ($lastToken !== null + && $token->type === Token::TYPE_KEYWORD + && $lastToken->type === Token::TYPE_OPERATOR + && $lastToken->value === '.' + ) { + // Handles ```... tbl.FROM ...```. In this case, FROM is not + // a reserved word. + $token->type = Token::TYPE_NONE; + $token->flags = 0; + $token->value = $token->token; + } + + $token->position = $lastIdx; + + $list->tokens[$list->count++] = $token; + + // Handling delimiters. + if ($token->type === Token::TYPE_NONE && $token->value === 'DELIMITER') { + if ($this->last + 1 >= $this->len) { + $this->error( + 'Expected whitespace(s) before delimiter.', + '', + $this->last + 1 + ); + continue; + } + + // Skipping last R (from `delimiteR`) and whitespaces between + // the keyword `DELIMITER` and the actual delimiter. + $pos = ++$this->last; + if (($token = $this->parseWhitespace()) !== null) { + $token->position = $pos; + $list->tokens[$list->count++] = $token; + } + + // Preparing the token that holds the new delimiter. + if ($this->last + 1 >= $this->len) { + $this->error( + 'Expected delimiter.', + '', + $this->last + 1 + ); + continue; + } + $pos = $this->last + 1; + + // Parsing the delimiter. + $this->delimiter = null; + $delimiterLen = 0; + while (++$this->last < $this->len && ! Context::isWhitespace($this->str[$this->last]) && $delimiterLen < 15) { + $this->delimiter .= $this->str[$this->last]; + ++$delimiterLen; + } + + if (empty($this->delimiter)) { + $this->error( + 'Expected delimiter.', + '', + $this->last + ); + $this->delimiter = ';'; + } + + --$this->last; + + // Saving the delimiter and its token. + $this->delimiterLen = strlen($this->delimiter); + $token = new Token($this->delimiter, Token::TYPE_DELIMITER); + $token->position = $pos; + $list->tokens[$list->count++] = $token; + } + + $lastToken = $token; + } + + // Adding a final delimiter to mark the ending. + $list->tokens[$list->count++] = new Token(null, Token::TYPE_DELIMITER); + + // Saving the tokens list. + $this->list = $list; + + $this->solveAmbiguityOnStarOperator(); + } + + /** + * Resolves the ambiguity when dealing with the "*" operator. + * + * In SQL statements, the "*" operator can be an arithmetic operator (like in 2*3) or an SQL wildcard (like in + * SELECT a.* FROM ...). To solve this ambiguity, the solution is to find the next token, excluding whitespaces and + * comments, right after the "*" position. The "*" is for sure an SQL wildcard if the next token found is any of: + * - "FROM" (the FROM keyword like in "SELECT * FROM..."); + * - "USING" (the USING keyword like in "DELETE table_name.* USING..."); + * - "," (a comma separator like in "SELECT *, field FROM..."); + * - ")" (a closing parenthesis like in "COUNT(*)"). + * This methods will change the flag of the "*" tokens when any of those condition above is true. Otherwise, the + * default flag (arithmetic) will be kept. + * + * @return void + */ + private function solveAmbiguityOnStarOperator() + { + $iBak = $this->list->idx; + while (null !== ($starToken = $this->list->getNextOfTypeAndValue(Token::TYPE_OPERATOR, '*'))) { + // ::getNext already gets rid of whitespaces and comments. + if (($next = $this->list->getNext()) !== null) { + if (($next->type === Token::TYPE_KEYWORD && in_array($next->value, array('FROM', 'USING'), true)) + || ($next->type === Token::TYPE_OPERATOR && in_array($next->value, array(',', ')'), true)) + ) { + $starToken->flags = Token::FLAG_OPERATOR_SQL; + } + } + } + $this->list->idx = $iBak; + } + + /** + * Creates a new error log. + * + * @param string $msg the error message + * @param string $str the character that produced the error + * @param int $pos the position of the character + * @param int $code the code of the error + * + * @throws LexerException throws the exception, if strict mode is enabled + */ + public function error($msg, $str = '', $pos = 0, $code = 0) + { + $error = new LexerException( + Translator::gettext($msg), + $str, + $pos, + $code + ); + parent::error($error); + } + + /** + * Parses a keyword. + * + * @return null|Token + */ + public function parseKeyword() + { + $token = ''; + + /** + * Value to be returned. + * + * @var Token + */ + $ret = null; + + /** + * The value of `$this->last` where `$token` ends in `$this->str`. + * + * @var int + */ + $iEnd = $this->last; + + /** + * Whether last parsed character is a whitespace. + * + * @var bool + */ + $lastSpace = false; + + for ($j = 1; $j < Context::KEYWORD_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) { + // Composed keywords shouldn't have more than one whitespace between + // keywords. + if (Context::isWhitespace($this->str[$this->last])) { + if ($lastSpace) { + --$j; // The size of the keyword didn't increase. + continue; + } + $lastSpace = true; + } else { + $lastSpace = false; + } + + $token .= $this->str[$this->last]; + if (($this->last + 1 === $this->len || Context::isSeparator($this->str[$this->last + 1])) + && $flags = Context::isKeyword($token) + ) { + $ret = new Token($token, Token::TYPE_KEYWORD, $flags); + $iEnd = $this->last; + + // We don't break so we find longest keyword. + // For example, `OR` and `ORDER` have a common prefix `OR`. + // If we stopped at `OR`, the parsing would be invalid. + } + } + + $this->last = $iEnd; + + return $ret; + } + + /** + * Parses a label. + * + * @return null|Token + */ + public function parseLabel() + { + $token = ''; + + /** + * Value to be returned. + * + * @var Token + */ + $ret = null; + + /** + * The value of `$this->last` where `$token` ends in `$this->str`. + * + * @var int + */ + $iEnd = $this->last; + for ($j = 1; $j < Context::LABEL_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) { + if ($this->str[$this->last] === ':' && $j > 1) { + // End of label + $token .= $this->str[$this->last]; + $ret = new Token($token, Token::TYPE_LABEL); + $iEnd = $this->last; + break; + } elseif (Context::isWhitespace($this->str[$this->last]) && $j > 1) { + // Whitespace between label and : + // The size of the keyword didn't increase. + --$j; + } elseif (Context::isSeparator($this->str[$this->last])) { + // Any other separator + break; + } + $token .= $this->str[$this->last]; + } + + $this->last = $iEnd; + + return $ret; + } + + /** + * Parses an operator. + * + * @return null|Token + */ + public function parseOperator() + { + $token = ''; + + /** + * Value to be returned. + * + * @var Token + */ + $ret = null; + + /** + * The value of `$this->last` where `$token` ends in `$this->str`. + * + * @var int + */ + $iEnd = $this->last; + + for ($j = 1; $j < Context::OPERATOR_MAX_LENGTH && $this->last < $this->len; ++$j, ++$this->last) { + $token .= $this->str[$this->last]; + if ($flags = Context::isOperator($token)) { + $ret = new Token($token, Token::TYPE_OPERATOR, $flags); + $iEnd = $this->last; + } + } + + $this->last = $iEnd; + + return $ret; + } + + /** + * Parses a whitespace. + * + * @return null|Token + */ + public function parseWhitespace() + { + $token = $this->str[$this->last]; + + if (! Context::isWhitespace($token)) { + return null; + } + + while (++$this->last < $this->len && Context::isWhitespace($this->str[$this->last])) { + $token .= $this->str[$this->last]; + } + + --$this->last; + + return new Token($token, Token::TYPE_WHITESPACE); + } + + /** + * Parses a comment. + * + * @return null|Token + */ + public function parseComment() + { + $iBak = $this->last; + $token = $this->str[$this->last]; + + // Bash style comments. (#comment\n) + if (Context::isComment($token)) { + while (++$this->last < $this->len + && $this->str[$this->last] !== "\n" + ) { + $token .= $this->str[$this->last]; + } + // Include trailing \n as whitespace token + if ($this->last < $this->len) { + --$this->last; + } + + return new Token($token, Token::TYPE_COMMENT, Token::FLAG_COMMENT_BASH); + } + + // C style comments. (/*comment*\/) + if (++$this->last < $this->len) { + $token .= $this->str[$this->last]; + if (Context::isComment($token)) { + // There might be a conflict with "*" operator here, when string is "*/*". + // This can occurs in the following statements: + // - "SELECT */* comment */ FROM ..." + // - "SELECT 2*/* comment */3 AS `six`;" + $next = $this->last+1; + if (($next < $this->len) && $this->str[$next] === '*') { + // Conflict in "*/*": first "*" was not for ending a comment. + // Stop here and let other parsing method define the true behavior of that first star. + $this->last = $iBak; + + return null; + } + + $flags = Token::FLAG_COMMENT_C; + + // This comment already ended. It may be a part of a + // previous MySQL specific command. + if ($token === '*/') { + return new Token($token, Token::TYPE_COMMENT, $flags); + } + + // Checking if this is a MySQL-specific command. + if ($this->last + 1 < $this->len + && $this->str[$this->last + 1] === '!' + ) { + $flags |= Token::FLAG_COMMENT_MYSQL_CMD; + $token .= $this->str[++$this->last]; + + while (++$this->last < $this->len + && $this->str[$this->last] >= '0' + && $this->str[$this->last] <= '9' + ) { + $token .= $this->str[$this->last]; + } + --$this->last; + + // We split this comment and parse only its beginning + // here. + return new Token($token, Token::TYPE_COMMENT, $flags); + } + + // Parsing the comment. + while (++$this->last < $this->len + && ( + $this->str[$this->last - 1] !== '*' + || $this->str[$this->last] !== '/' + ) + ) { + $token .= $this->str[$this->last]; + } + + // Adding the ending. + if ($this->last < $this->len) { + $token .= $this->str[$this->last]; + } + + return new Token($token, Token::TYPE_COMMENT, $flags); + } + } + + // SQL style comments. (-- comment\n) + if (++$this->last < $this->len) { + $token .= $this->str[$this->last]; + $end = false; + } else { + --$this->last; + $end = true; + } + if (Context::isComment($token, $end)) { + // Checking if this comment did not end already (```--\n```). + if ($this->str[$this->last] !== "\n") { + while (++$this->last < $this->len + && $this->str[$this->last] !== "\n" + ) { + $token .= $this->str[$this->last]; + } + } + // Include trailing \n as whitespace token + if ($this->last < $this->len) { + --$this->last; + } + + return new Token($token, Token::TYPE_COMMENT, Token::FLAG_COMMENT_SQL); + } + + $this->last = $iBak; + + return null; + } + + /** + * Parses a boolean. + * + * @return null|Token + */ + public function parseBool() + { + if ($this->last + 3 >= $this->len) { + // At least `min(strlen('TRUE'), strlen('FALSE'))` characters are + // required. + return null; + } + + $iBak = $this->last; + $token = $this->str[$this->last] . $this->str[++$this->last] + . $this->str[++$this->last] . $this->str[++$this->last]; // _TRUE_ or _FALS_e + + if (Context::isBool($token)) { + return new Token($token, Token::TYPE_BOOL); + } elseif (++$this->last < $this->len) { + $token .= $this->str[$this->last]; // fals_E_ + if (Context::isBool($token)) { + return new Token($token, Token::TYPE_BOOL, 1); + } + } + + $this->last = $iBak; + + return null; + } + + /** + * Parses a number. + * + * @return null|Token + */ + public function parseNumber() + { + // A rudimentary state machine is being used to parse numbers due to + // the various forms of their notation. + // + // Below are the states of the machines and the conditions to change + // the state. + // + // 1 --------------------[ + or - ]-------------------> 1 + // 1 -------------------[ 0x or 0X ]------------------> 2 + // 1 --------------------[ 0 to 9 ]-------------------> 3 + // 1 -----------------------[ . ]---------------------> 4 + // 1 -----------------------[ b ]---------------------> 7 + // + // 2 --------------------[ 0 to F ]-------------------> 2 + // + // 3 --------------------[ 0 to 9 ]-------------------> 3 + // 3 -----------------------[ . ]---------------------> 4 + // 3 --------------------[ e or E ]-------------------> 5 + // + // 4 --------------------[ 0 to 9 ]-------------------> 4 + // 4 --------------------[ e or E ]-------------------> 5 + // + // 5 ---------------[ + or - or 0 to 9 ]--------------> 6 + // + // 7 -----------------------[ ' ]---------------------> 8 + // + // 8 --------------------[ 0 or 1 ]-------------------> 8 + // 8 -----------------------[ ' ]---------------------> 9 + // + // State 1 may be reached by negative numbers. + // State 2 is reached only by hex numbers. + // State 4 is reached only by float numbers. + // State 5 is reached only by numbers in approximate form. + // State 7 is reached only by numbers in bit representation. + // + // Valid final states are: 2, 3, 4 and 6. Any parsing that finished in a + // state other than these is invalid. + // Also, negative states are invalid states. + $iBak = $this->last; + $token = ''; + $flags = 0; + $state = 1; + for (; $this->last < $this->len; ++$this->last) { + if ($state === 1) { + if ($this->str[$this->last] === '-') { + $flags |= Token::FLAG_NUMBER_NEGATIVE; + } elseif ($this->last + 1 < $this->len + && $this->str[$this->last] === '0' + && ( + $this->str[$this->last + 1] === 'x' + || $this->str[$this->last + 1] === 'X' + ) + ) { + $token .= $this->str[$this->last++]; + $state = 2; + } elseif ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9') { + $state = 3; + } elseif ($this->str[$this->last] === '.') { + $state = 4; + } elseif ($this->str[$this->last] === 'b') { + $state = 7; + } elseif ($this->str[$this->last] !== '+') { + // `+` is a valid character in a number. + break; + } + } elseif ($state === 2) { + $flags |= Token::FLAG_NUMBER_HEX; + if (! ( + ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9') + || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'F') + || ($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'f') + ) + ) { + break; + } + } elseif ($state === 3) { + if ($this->str[$this->last] === '.') { + $state = 4; + } elseif ($this->str[$this->last] === 'e' || $this->str[$this->last] === 'E') { + $state = 5; + } elseif (($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'z') + || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'Z')) { + // A聽number can't be directly followed by a letter + $state = -$state; + } elseif ($this->str[$this->last] < '0' || $this->str[$this->last] > '9') { + // Just digits and `.`, `e` and `E` are valid characters. + break; + } + } elseif ($state === 4) { + $flags |= Token::FLAG_NUMBER_FLOAT; + if ($this->str[$this->last] === 'e' || $this->str[$this->last] === 'E') { + $state = 5; + } elseif (($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'z') + || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'Z')) { + // A聽number can't be directly followed by a letter + $state = -$state; + } elseif ($this->str[$this->last] < '0' || $this->str[$this->last] > '9') { + // Just digits, `e` and `E` are valid characters. + break; + } + } elseif ($state === 5) { + $flags |= Token::FLAG_NUMBER_APPROXIMATE; + if ($this->str[$this->last] === '+' || $this->str[$this->last] === '-' + || ($this->str[$this->last] >= '0' && $this->str[$this->last] <= '9') + ) { + $state = 6; + } elseif (($this->str[$this->last] >= 'a' && $this->str[$this->last] <= 'z') + || ($this->str[$this->last] >= 'A' && $this->str[$this->last] <= 'Z')) { + // A聽number can't be directly followed by a letter + $state = -$state; + } else { + break; + } + } elseif ($state === 6) { + if ($this->str[$this->last] < '0' || $this->str[$this->last] > '9') { + // Just digits are valid characters. + break; + } + } elseif ($state === 7) { + $flags |= Token::FLAG_NUMBER_BINARY; + if ($this->str[$this->last] === '\'') { + $state = 8; + } else { + break; + } + } elseif ($state === 8) { + if ($this->str[$this->last] === '\'') { + $state = 9; + } elseif ($this->str[$this->last] !== '0' + && $this->str[$this->last] !== '1' + ) { + break; + } + } elseif ($state === 9) { + break; + } + $token .= $this->str[$this->last]; + } + if ($state === 2 || $state === 3 + || ($token !== '.' && $state === 4) + || $state === 6 || $state === 9 + ) { + --$this->last; + + return new Token($token, Token::TYPE_NUMBER, $flags); + } + $this->last = $iBak; + + return null; + } + + /** + * Parses a string. + * + * @param string $quote additional starting symbol + * + * @return null|Token + * @throws LexerException + */ + public function parseString($quote = '') + { + $token = $this->str[$this->last]; + if (! ($flags = Context::isString($token)) && $token !== $quote) { + return null; + } + $quote = $token; + + while (++$this->last < $this->len) { + if ($this->last + 1 < $this->len + && ( + ($this->str[$this->last] === $quote && $this->str[$this->last + 1] === $quote) + || ($this->str[$this->last] === '\\' && $quote !== '`') + ) + ) { + $token .= $this->str[$this->last] . $this->str[++$this->last]; + } else { + if ($this->str[$this->last] === $quote) { + break; + } + $token .= $this->str[$this->last]; + } + } + + if ($this->last >= $this->len || $this->str[$this->last] !== $quote) { + $this->error( + sprintf( + Translator::gettext('Ending quote %1$s was expected.'), + $quote + ), + '', + $this->last + ); + } else { + $token .= $this->str[$this->last]; + } + + return new Token($token, Token::TYPE_STRING, $flags); + } + + /** + * Parses a symbol. + * + * @return null|Token + * @throws LexerException + */ + public function parseSymbol() + { + $token = $this->str[$this->last]; + if (! ($flags = Context::isSymbol($token))) { + return null; + } + + if ($flags & Token::FLAG_SYMBOL_VARIABLE) { + if ($this->last + 1 < $this->len && $this->str[++$this->last] === '@') { + // This is a system variable (e.g. `@@hostname`). + $token .= $this->str[$this->last++]; + $flags |= Token::FLAG_SYMBOL_SYSTEM; + } + } elseif ($flags & Token::FLAG_SYMBOL_PARAMETER) { + if ($token !== '?' && $this->last + 1 < $this->len) { + ++$this->last; + } + } else { + $token = ''; + } + + $str = null; + + if ($this->last < $this->len) { + if (($str = $this->parseString('`')) === null) { + if (($str = $this->parseUnknown()) === null) { + $this->error( + 'Variable name was expected.', + $this->str[$this->last], + $this->last + ); + } + } + } + + if ($str !== null) { + $token .= $str->token; + } + + return new Token($token, Token::TYPE_SYMBOL, $flags); + } + + /** + * Parses unknown parts of the query. + * + * @return null|Token + */ + public function parseUnknown() + { + $token = $this->str[$this->last]; + if (Context::isSeparator($token)) { + return null; + } + + while (++$this->last < $this->len && ! Context::isSeparator($this->str[$this->last])) { + $token .= $this->str[$this->last]; + + // Test if end of token equals the current delimiter. If so, remove it from the token. + if (substr($token, -$this->delimiterLen) === $this->delimiter) { + $token = substr($token, 0, -$this->delimiterLen); + $this->last -= $this->delimiterLen - 1; + break; + } + } + + --$this->last; + + return new Token($token); + } + + /** + * Parses the delimiter of the query. + * + * @return null|Token + */ + public function parseDelimiter() + { + $idx = 0; + + while ($idx < $this->delimiterLen && $this->last + $idx < $this->len) { + if ($this->delimiter[$idx] !== $this->str[$this->last + $idx]) { + return null; + } + ++$idx; + } + + $this->last += $this->delimiterLen - 1; + + return new Token($this->delimiter, Token::TYPE_DELIMITER); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Parser.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Parser.php new file mode 100755 index 0000000..f09a210 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Parser.php @@ -0,0 +1,612 @@ + 'PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement', + 'DESC' => 'PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement', + 'EXPLAIN' => 'PhpMyAdmin\\SqlParser\\Statements\\ExplainStatement', + 'FLUSH' => '', + 'GRANT' => '', + 'HELP' => '', + 'SET PASSWORD' => '', + 'STATUS' => '', + 'USE' => '', + + // Table Maintenance Statements + // https://dev.mysql.com/doc/refman/5.7/en/table-maintenance-sql.html + 'ANALYZE' => 'PhpMyAdmin\\SqlParser\\Statements\\AnalyzeStatement', + 'BACKUP' => 'PhpMyAdmin\\SqlParser\\Statements\\BackupStatement', + 'CHECK' => 'PhpMyAdmin\\SqlParser\\Statements\\CheckStatement', + 'CHECKSUM' => 'PhpMyAdmin\\SqlParser\\Statements\\ChecksumStatement', + 'OPTIMIZE' => 'PhpMyAdmin\\SqlParser\\Statements\\OptimizeStatement', + 'REPAIR' => 'PhpMyAdmin\\SqlParser\\Statements\\RepairStatement', + 'RESTORE' => 'PhpMyAdmin\\SqlParser\\Statements\\RestoreStatement', + + // Database Administration Statements + // https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-server-administration.html + 'SET' => 'PhpMyAdmin\\SqlParser\\Statements\\SetStatement', + 'SHOW' => 'PhpMyAdmin\\SqlParser\\Statements\\ShowStatement', + + // Data Definition Statements. + // https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-definition.html + 'ALTER' => 'PhpMyAdmin\\SqlParser\\Statements\\AlterStatement', + 'CREATE' => 'PhpMyAdmin\\SqlParser\\Statements\\CreateStatement', + 'DROP' => 'PhpMyAdmin\\SqlParser\\Statements\\DropStatement', + 'RENAME' => 'PhpMyAdmin\\SqlParser\\Statements\\RenameStatement', + 'TRUNCATE' => 'PhpMyAdmin\\SqlParser\\Statements\\TruncateStatement', + + // Data Manipulation Statements. + // https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-data-manipulation.html + 'CALL' => 'PhpMyAdmin\\SqlParser\\Statements\\CallStatement', + 'DELETE' => 'PhpMyAdmin\\SqlParser\\Statements\\DeleteStatement', + 'DO' => '', + 'HANDLER' => '', + 'INSERT' => 'PhpMyAdmin\\SqlParser\\Statements\\InsertStatement', + 'LOAD DATA' => 'PhpMyAdmin\\SqlParser\\Statements\\LoadStatement', + 'REPLACE' => 'PhpMyAdmin\\SqlParser\\Statements\\ReplaceStatement', + 'SELECT' => 'PhpMyAdmin\\SqlParser\\Statements\\SelectStatement', + 'UPDATE' => 'PhpMyAdmin\\SqlParser\\Statements\\UpdateStatement', + + // Prepared Statements. + // https://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.html + 'DEALLOCATE' => '', + 'EXECUTE' => '', + 'PREPARE' => '', + + // Transactional and Locking Statements + // https://dev.mysql.com/doc/refman/5.7/en/commit.html + 'BEGIN' => 'PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement', + 'COMMIT' => 'PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement', + 'ROLLBACK' => 'PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement', + 'START TRANSACTION' => 'PhpMyAdmin\\SqlParser\\Statements\\TransactionStatement', + + 'PURGE' => 'PhpMyAdmin\\SqlParser\\Statements\\PurgeStatement', + + // Lock statements + // https://dev.mysql.com/doc/refman/5.7/en/lock-tables.html + 'LOCK' => 'PhpMyAdmin\\SqlParser\\Statements\\LockStatement', + 'UNLOCK' => 'PhpMyAdmin\\SqlParser\\Statements\\LockStatement' + ); + + /** + * Array of classes that are used in parsing SQL components. + * + * @var array + */ + public static $KEYWORD_PARSERS = array( + // This is not a proper keyword and was added here to help the + // formatter. + 'PARTITION BY' => array(), + 'SUBPARTITION BY' => array(), + + // This is not a proper keyword and was added here to help the + // builder. + '_OPTIONS' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\OptionsArray', + 'field' => 'options', + ), + '_END_OPTIONS' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\OptionsArray', + 'field' => 'end_options', + ), + + 'INTERSECT' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\UnionKeyword', + 'field' => 'union', + ), + 'EXCEPT' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\UnionKeyword', + 'field' => 'union', + ), + 'UNION' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\UnionKeyword', + 'field' => 'union', + ), + 'UNION ALL' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\UnionKeyword', + 'field' => 'union', + ), + 'UNION DISTINCT' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\UnionKeyword', + 'field' => 'union', + ), + + // Actual clause parsers. + 'ALTER' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\Expression', + 'field' => 'table', + 'options' => array('parseField' => 'table'), + ), + 'ANALYZE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'tables', + 'options' => array('parseField' => 'table'), + ), + 'BACKUP' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'tables', + 'options' => array('parseField' => 'table'), + ), + 'CALL' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\FunctionCall', + 'field' => 'call', + ), + 'CHECK' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'tables', + 'options' => array('parseField' => 'table'), + ), + 'CHECKSUM' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'tables', + 'options' => array('parseField' => 'table'), + ), + 'CROSS JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'DROP' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'fields', + 'options' => array('parseField' => 'table'), + ), + 'FORCE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\IndexHint', + 'field' => 'index_hints', + ), + 'FROM' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'from', + 'options' => array('field' => 'table'), + ), + 'GROUP BY' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\GroupKeyword', + 'field' => 'group', + ), + 'HAVING' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\Condition', + 'field' => 'having', + ), + 'IGNORE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\IndexHint', + 'field' => 'index_hints', + ), + 'INTO' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\IntoKeyword', + 'field' => 'into', + ), + 'JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'LEFT JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'LEFT OUTER JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'ON' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\Expression', + 'field' => 'table', + 'options' => array('parseField' => 'table'), + ), + 'RIGHT JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'RIGHT OUTER JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'INNER JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'FULL JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'FULL OUTER JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'NATURAL JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'NATURAL LEFT JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'NATURAL RIGHT JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'NATURAL LEFT OUTER JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'NATURAL RIGHT OUTER JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'STRAIGHT_JOIN' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\JoinKeyword', + 'field' => 'join', + ), + 'LIMIT' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\Limit', + 'field' => 'limit', + ), + 'OPTIMIZE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'tables', + 'options' => array('parseField' => 'table'), + ), + 'ORDER BY' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\OrderKeyword', + 'field' => 'order', + ), + 'PARTITION' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ArrayObj', + 'field' => 'partition', + ), + 'PROCEDURE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\FunctionCall', + 'field' => 'procedure', + ), + 'RENAME' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\RenameOperation', + 'field' => 'renames', + ), + 'REPAIR' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'tables', + 'options' => array('parseField' => 'table'), + ), + 'RESTORE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'tables', + 'options' => array('parseField' => 'table'), + ), + 'SET' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\SetOperation', + 'field' => 'set', + ), + 'SELECT' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'expr', + ), + 'TRUNCATE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\Expression', + 'field' => 'table', + 'options' => array('parseField' => 'table'), + ), + 'UPDATE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\ExpressionArray', + 'field' => 'tables', + 'options' => array('parseField' => 'table'), + ), + 'USE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\IndexHint', + 'field' => 'index_hints', + ), + 'VALUE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\Array2d', + 'field' => 'values', + ), + 'VALUES' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\Array2d', + 'field' => 'values', + ), + 'WHERE' => array( + 'class' => 'PhpMyAdmin\\SqlParser\\Components\\Condition', + 'field' => 'where', + ) + ); + + /** + * The list of tokens that are parsed. + * + * @var TokensList + */ + public $list; + + /** + * List of statements parsed. + * + * @var Statement[] + */ + public $statements = array(); + + /** + * The number of opened brackets. + * + * @var int + */ + public $brackets = 0; + + /** + * Constructor. + * + * @param string|UtfString|TokensList $list the list of tokens to be parsed + * @param bool $strict whether strict mode should be enabled or not + */ + public function __construct($list = null, $strict = false) + { + if (is_string($list) || ($list instanceof UtfString)) { + $lexer = new Lexer($list, $strict); + $this->list = $lexer->list; + } elseif ($list instanceof TokensList) { + $this->list = $list; + } + + $this->strict = $strict; + + if ($list !== null) { + $this->parse(); + } + } + + /** + * Builds the parse trees. + * @throws ParserException + */ + public function parse() + { + /** + * Last transaction. + * + * @var TransactionStatement + */ + $lastTransaction = null; + + /** + * Last parsed statement. + * + * @var Statement + */ + $lastStatement = null; + + /** + * Union's type or false for no union. + * + * @var bool|string + */ + $unionType = false; + + /** + * The index of the last token from the last statement. + * + * @var int + */ + $prevLastIdx = -1; + + /** + * The list of tokens. + * + * @var TokensList + */ + $list = &$this->list; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // `DELIMITER` is not an actual statement and it requires + // special handling. + if (($token->type === Token::TYPE_NONE) + && (strtoupper($token->token) === 'DELIMITER') + ) { + // Skipping to the end of this statement. + $list->getNextOfType(Token::TYPE_DELIMITER); + $prevLastIdx = $list->idx; + continue; + } + + // Counting the brackets around statements. + if ($token->value === '(') { + ++$this->brackets; + continue; + } + + // Statements can start with keywords only. + // Comments, whitespaces, etc. are ignored. + if ($token->type !== Token::TYPE_KEYWORD) { + if (($token->type !== Token::TYPE_COMMENT) + && ($token->type !== Token::TYPE_WHITESPACE) + && ($token->type !== Token::TYPE_OPERATOR) // `(` and `)` + && ($token->type !== Token::TYPE_DELIMITER) + ) { + $this->error( + 'Unexpected beginning of statement.', + $token + ); + } + continue; + } + + if (($token->keyword === 'UNION') || + ($token->keyword === 'UNION ALL') || + ($token->keyword === 'UNION DISTINCT') || + ($token->keyword === 'EXCEPT') || + ($token->keyword === 'INTERSECT') + ) { + $unionType = $token->keyword; + continue; + } + + // Checking if it is a known statement that can be parsed. + if (empty(static::$STATEMENT_PARSERS[$token->keyword])) { + if (! isset(static::$STATEMENT_PARSERS[$token->keyword])) { + // A statement is considered recognized if the parser + // is aware that it is a statement, but it does not have + // a parser for it yet. + $this->error( + 'Unrecognized statement type.', + $token + ); + } + // Skipping to the end of this statement. + $list->getNextOfType(Token::TYPE_DELIMITER); + $prevLastIdx = $list->idx; + continue; + } + + /** + * The name of the class that is used for parsing. + * + * @var string + */ + $class = static::$STATEMENT_PARSERS[$token->keyword]; + + /** + * Processed statement. + * + * @var Statement + */ + $statement = new $class($this, $this->list); + + // The first token that is a part of this token is the next token + // unprocessed by the previous statement. + // There might be brackets around statements and this shouldn't + // affect the parser + $statement->first = $prevLastIdx + 1; + + // Storing the index of the last token parsed and updating the old + // index. + $statement->last = $list->idx; + $prevLastIdx = $list->idx; + + // Handles unions. + if (! empty($unionType) + && ($lastStatement instanceof SelectStatement) + && ($statement instanceof SelectStatement) + ) { + /* + * This SELECT statement. + * + * @var SelectStatement $statement + */ + + /* + * Last SELECT statement. + * + * @var SelectStatement $lastStatement + */ + $lastStatement->union[] = array( + $unionType, + $statement + ); + + // if there are no no delimiting brackets, the `ORDER` and + // `LIMIT` keywords actually belong to the first statement. + $lastStatement->order = $statement->order; + $lastStatement->limit = $statement->limit; + $statement->order = array(); + $statement->limit = null; + + // The statement actually ends where the last statement in + // union ends. + $lastStatement->last = $statement->last; + + $unionType = false; + + // Validate clause order + $statement->validateClauseOrder($this, $list); + continue; + } + + // Handles transactions. + if ($statement instanceof TransactionStatement) { + /* + * @var TransactionStatement + */ + if ($statement->type === TransactionStatement::TYPE_BEGIN) { + $lastTransaction = $statement; + $this->statements[] = $statement; + } elseif ($statement->type === TransactionStatement::TYPE_END) { + if ($lastTransaction === null) { + // Even though an error occurred, the query is being + // saved. + $this->statements[] = $statement; + $this->error( + 'No transaction was previously started.', + $token + ); + } else { + $lastTransaction->end = $statement; + } + $lastTransaction = null; + } + + // Validate clause order + $statement->validateClauseOrder($this, $list); + continue; + } + + // Validate clause order + $statement->validateClauseOrder($this, $list); + + // Finally, storing the statement. + if ($lastTransaction !== null) { + $lastTransaction->statements[] = $statement; + } else { + $this->statements[] = $statement; + } + $lastStatement = $statement; + } + } + + /** + * Creates a new error log. + * + * @param string $msg the error message + * @param Token $token the token that produced the error + * @param int $code the code of the error + * + * @throws ParserException throws the exception, if strict mode is enabled + */ + public function error($msg, Token $token = null, $code = 0) + { + $error = new ParserException( + Translator::gettext($msg), + $token, + $code + ); + parent::error($error); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statement.php new file mode 100755 index 0000000..4b47ea5 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statement.php @@ -0,0 +1,561 @@ +parse($parser, $list); + } + } + + /** + * Builds the string representation of this statement. + * + * @return string + */ + public function build() + { + /** + * Query to be returned. + * + * @var string + */ + $query = ''; + + /** + * Clauses which were built already. + * + * It is required to keep track of built clauses because some fields, + * for example `join` is used by multiple clauses (`JOIN`, `LEFT JOIN`, + * `LEFT OUTER JOIN`, etc.). The same happens for `VALUE` and `VALUES`. + * + * A clause is considered built just after fields' value + * (`$this->field`) was used in building. + * + * @var array + */ + $built = array(); + + /** + * Statement's clauses. + * + * @var array + */ + $clauses = $this->getClauses(); + + foreach ($clauses as $clause) { + /** + * The name of the clause. + * + * @var string + */ + $name = $clause[0]; + + /** + * The type of the clause. + * + * @see self::$CLAUSES + * + * @var int + */ + $type = $clause[1]; + + /** + * The builder (parser) of this clause. + * + * @var Component + */ + $class = Parser::$KEYWORD_PARSERS[$name]['class']; + + /** + * The name of the field that is used as source for the builder. + * Same field is used to store the result of parsing. + * + * @var string + */ + $field = Parser::$KEYWORD_PARSERS[$name]['field']; + + // The field is empty, there is nothing to be built. + if (empty($this->$field)) { + continue; + } + + // Checking if this field was already built. + if ($type & 1) { + if (! empty($built[$field])) { + continue; + } + $built[$field] = true; + } + + // Checking if the name of the clause should be added. + if ($type & 2) { + $query = trim($query) . ' ' . $name; + } + + // Checking if the result of the builder should be added. + if ($type & 1) { + $query = trim($query) . ' ' . $class::build($this->$field); + } + } + + return $query; + } + + /** + * Parses the statements defined by the tokens list. + * + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + * @throws Exceptions\ParserException + */ + public function parse(Parser $parser, TokensList $list) + { + /** + * Array containing all list of clauses parsed. + * This is used to check for duplicates. + * + * @var array + */ + $parsedClauses = array(); + + // This may be corrected by the parser. + $this->first = $list->idx; + + /** + * Whether options were parsed or not. + * For statements that do not have any options this is set to `true` by + * default. + * + * @var bool + */ + $parsedOptions = empty(static::$OPTIONS); + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Checking if this closing bracket is the pair for a bracket + // outside the statement. + if (($token->value === ')') && ($parser->brackets > 0)) { + --$parser->brackets; + continue; + } + + // Only keywords are relevant here. Other parts of the query are + // processed in the functions below. + if ($token->type !== Token::TYPE_KEYWORD) { + if (($token->type !== Token::TYPE_COMMENT) + && ($token->type !== Token::TYPE_WHITESPACE) + ) { + $parser->error('Unexpected token.', $token); + } + continue; + } + + // Unions are parsed by the parser because they represent more than + // one statement. + if (($token->keyword === 'UNION') || + ($token->keyword === 'UNION ALL') || + ($token->keyword === 'UNION DISTINCT') || + ($token->keyword === 'EXCEPT') || + ($token->keyword === 'INTERSECT') + ) { + break; + } + + $lastIdx = $list->idx; + + // ON DUPLICATE KEY UPDATE ... + // has to be parsed in parent statement (INSERT or REPLACE) + // so look for it and break + if ($this instanceof Statements\SelectStatement + && $token->value === 'ON' + ) { + ++$list->idx; // Skip ON + + // look for ON DUPLICATE KEY UPDATE + $first = $list->getNextOfType(Token::TYPE_KEYWORD); + $second = $list->getNextOfType(Token::TYPE_KEYWORD); + $third = $list->getNextOfType(Token::TYPE_KEYWORD); + + if ($first && $second && $third + && $first->value === 'DUPLICATE' + && $second->value === 'KEY' + && $third->value === 'UPDATE' + ) { + $list->idx = $lastIdx; + break; + } + } + $list->idx = $lastIdx; + + /** + * The name of the class that is used for parsing. + * + * @var Component + */ + $class = null; + + /** + * The name of the field where the result of the parsing is stored. + * + * @var string + */ + $field = null; + + /** + * Parser's options. + * + * @var array + */ + $options = array(); + + // Looking for duplicated clauses. + if (! empty(Parser::$KEYWORD_PARSERS[$token->value]) + || ! empty(Parser::$STATEMENT_PARSERS[$token->value]) + ) { + if (! empty($parsedClauses[$token->value])) { + $parser->error( + 'This type of clause was previously parsed.', + $token + ); + break; + } + $parsedClauses[$token->value] = true; + } + + // Checking if this is the beginning of a clause. + // Fix Issue #221: As `truncate` is not a keyword + // but it might be the beginning of a statement of truncate, + // so let the value use the keyword field for truncate type. + $token_value = in_array($token->keyword, array('TRUNCATE')) ? $token->keyword : $token->value; + if (! empty(Parser::$KEYWORD_PARSERS[$token_value]) && $list->idx < $list->count) { + $class = Parser::$KEYWORD_PARSERS[$token_value]['class']; + $field = Parser::$KEYWORD_PARSERS[$token_value]['field']; + if (! empty(Parser::$KEYWORD_PARSERS[$token_value]['options'])) { + $options = Parser::$KEYWORD_PARSERS[$token_value]['options']; + } + } + + // Checking if this is the beginning of the statement. + if (! empty(Parser::$STATEMENT_PARSERS[$token->keyword])) { + if (! empty(static::$CLAUSES) // Undefined for some statements. + && empty(static::$CLAUSES[$token->value]) + ) { + // Some keywords (e.g. `SET`) may be the beginning of a + // statement and a clause. + // If such keyword was found and it cannot be a clause of + // this statement it means it is a new statement, but no + // delimiter was found between them. + $parser->error( + 'A new statement was found, but no delimiter between it and the previous one.', + $token + ); + break; + } + if (! $parsedOptions) { + if (empty(static::$OPTIONS[$token->value])) { + // Skipping keyword because if it is not a option. + ++$list->idx; + } + $this->options = OptionsArray::parse( + $parser, + $list, + static::$OPTIONS + ); + $parsedOptions = true; + } + } elseif ($class === null) { + if ($this instanceof Statements\SelectStatement + && ($token->value === 'FOR UPDATE' + || $token->value === 'LOCK IN SHARE MODE') + ) { + // Handle special end options in Select statement + // See Statements\SelectStatement::$END_OPTIONS + $this->end_options = OptionsArray::parse( + $parser, + $list, + static::$END_OPTIONS + ); + } elseif ($this instanceof Statements\SetStatement + && ($token->value === 'COLLATE' + || $token->value === 'DEFAULT') + ) { + // Handle special end options in SET statement + // See Statements\SetStatement::$END_OPTIONS + $this->end_options = OptionsArray::parse( + $parser, + $list, + static::$END_OPTIONS + ); + } else { + // There is no parser for this keyword and isn't the beginning + // of a statement (so no options) either. + $parser->error('Unrecognized keyword.', $token); + continue; + } + } + + $this->before($parser, $list, $token); + + // Parsing this keyword. + if ($class !== null) { + // We can't parse keyword at the end of statement + if ($list->idx >= $list->count) { + $parser->error('Keyword at end of statement.', $token); + continue; + } + ++$list->idx; // Skipping keyword or last option. + $this->$field = $class::parse($parser, $list, $options); + } + + $this->after($parser, $list, $token); + + // #223 Here may make a patch, if last is delimiter, back one + // TODO: when not supporting PHP 5.3 anymore, replace this by FunctionCall::class. + if ($class === 'PhpMyAdmin\\SqlParser\\Components\\FunctionCall' + && $list->offsetGet($list->idx)->type === Token::TYPE_DELIMITER + ) { + --$list->idx; + } + } + + // This may be corrected by the parser. + $this->last = --$list->idx; // Go back to last used token. + } + + /** + * Function called before the token is processed. + * + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + * @param Token $token the token that is being parsed + */ + public function before(Parser $parser, TokensList $list, Token $token) + { + } + + /** + * Function called after the token was processed. + * + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + * @param Token $token the token that is being parsed + */ + public function after(Parser $parser, TokensList $list, Token $token) + { + } + + /** + * Gets the clauses of this statement. + * + * @return array + */ + public function getClauses() + { + return static::$CLAUSES; + } + + /** + * Builds the string representation of this statement. + * + * @see static::build + * + * @return string + */ + public function __toString() + { + return $this->build(); + } + + /** + * Validates the order of the clauses in parsed statement + * Ideally this should be called after successfully + * completing the parsing of each statement. + * + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + * + * @return bool + * @throws Exceptions\ParserException + */ + public function validateClauseOrder($parser, $list) + { + $clauses = array_flip(array_keys($this->getClauses())); + + if (empty($clauses) || count($clauses) === 0) { + return true; + } + + $minIdx = -1; + + /** + * For tracking JOIN clauses in a query + * = 0 - JOIN not found till now + * > 0 - Index of first JOIN clause in the statement. + * + * @var int + */ + $minJoin = 0; + + /** + * For tracking JOIN clauses in a query + * = 0 - JOIN not found till now + * > 0 - Index of last JOIN clause + * (which appears together with other JOINs) + * in the statement. + * + * @var int + */ + $maxJoin = 0; + + $error = 0; + $lastIdx = 0; + foreach ($clauses as $clauseType => $index) { + $clauseStartIdx = Utils\Query::getClauseStartOffset( + $this, + $list, + $clauseType + ); + + if ($clauseStartIdx !== -1 + && $this instanceof Statements\SelectStatement + && ($clauseType === 'FORCE' + || $clauseType === 'IGNORE' + || $clauseType === 'USE') + ) { + // TODO: ordering of clauses in a SELECT statement with + // Index hints is not supported + return true; + } + + // Handle ordering of Multiple Joins in a query + if ($clauseStartIdx !== -1) { + if ($minJoin === 0 && stripos($clauseType, 'JOIN')) { + // First JOIN clause is detected + $minJoin = $maxJoin = $clauseStartIdx; + } elseif ($minJoin !== 0 && ! stripos($clauseType, 'JOIN')) { + // After a previous JOIN clause, a non-JOIN clause has been detected + $maxJoin = $lastIdx; + } elseif ($maxJoin < $clauseStartIdx && stripos($clauseType, 'JOIN')) { + $error = 1; + } + } + + if ($clauseStartIdx !== -1 && $clauseStartIdx < $minIdx) { + if ($minJoin === 0 || $error === 1) { + $token = $list->tokens[$clauseStartIdx]; + $parser->error( + 'Unexpected ordering of clauses.', + $token + ); + + return false; + } + $minIdx = $clauseStartIdx; + } elseif ($clauseStartIdx !== -1) { + $minIdx = $clauseStartIdx; + } + + $lastIdx = ($clauseStartIdx !== -1) ? $clauseStartIdx : $lastIdx; + } + + return true; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/AlterStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/AlterStatement.php new file mode 100755 index 0000000..016960c --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/AlterStatement.php @@ -0,0 +1,153 @@ + 1, + 'OFFLINE' => 1, + 'IGNORE' => 2, + + 'DATABASE' => 3, + 'EVENT' => 3, + 'FUNCTION' => 3, + 'PROCEDURE' => 3, + 'SERVER' => 3, + 'TABLE' => 3, + 'TABLESPACE' => 3, + 'USER' => 3, + 'VIEW' => 3 + ); + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + ++$list->idx; // Skipping `ALTER`. + $this->options = OptionsArray::parse( + $parser, + $list, + static::$OPTIONS + ); + ++$list->idx; + + // Parsing affected table. + $this->table = Expression::parse( + $parser, + $list, + array( + 'parseField' => 'table', + 'breakOnAlias' => true + ) + ); + ++$list->idx; // Skipping field. + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 -----------------[ alter operation ]-----------------> 1 + * + * 1 -------------------------[ , ]-----------------------> 0 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + $options = array(); + if ($this->options->has('DATABASE')) { + $options = AlterOperation::$DB_OPTIONS; + } elseif ($this->options->has('TABLE')) { + $options = AlterOperation::$TABLE_OPTIONS; + } elseif ($this->options->has('VIEW')) { + $options = AlterOperation::$VIEW_OPTIONS; + } elseif ($this->options->has('USER')) { + $options = AlterOperation::$USER_OPTIONS; + } + + $this->altered[] = AlterOperation::parse($parser, $list, $options); + $state = 1; + } elseif ($state === 1) { + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === ',')) { + $state = 0; + } + } + } + } + + /** + * @return string + */ + public function build() + { + $tmp = array(); + foreach ($this->altered as $altered) { + $tmp[] = $altered::build($altered); + } + + return 'ALTER ' . OptionsArray::build($this->options) + . ' ' . Expression::build($this->table) + . ' ' . implode(', ', $tmp); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/AnalyzeStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/AnalyzeStatement.php new file mode 100755 index 0000000..4f6ea32 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/AnalyzeStatement.php @@ -0,0 +1,42 @@ + 1, + + 'NO_WRITE_TO_BINLOG' => 2, + 'LOCAL' => 3 + ); + + /** + * Analyzed tables. + * + * @var Expression[] + */ + public $tables; +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/BackupStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/BackupStatement.php new file mode 100755 index 0000000..52f136b --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/BackupStatement.php @@ -0,0 +1,36 @@ + 1, + + 'NO_WRITE_TO_BINLOG' => 2, + 'LOCAL' => 3, + + 'TO' => array( + 4, + 'var', + ) + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CallStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CallStatement.php new file mode 100755 index 0000000..00cb95c --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CallStatement.php @@ -0,0 +1,43 @@ +call->name . "(" . ($this->call->parameters ? implode(",", $this->call->parameters->raw) : "") . ")"; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CheckStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CheckStatement.php new file mode 100755 index 0000000..57e5cb7 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CheckStatement.php @@ -0,0 +1,35 @@ + 1, + + 'FOR UPGRADE' => 2, + 'QUICK' => 3, + 'FAST' => 4, + 'MEDIUM' => 5, + 'EXTENDED' => 6, + 'CHANGED' => 7 + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ChecksumStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ChecksumStatement.php new file mode 100755 index 0000000..1be2588 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ChecksumStatement.php @@ -0,0 +1,31 @@ + 1, + + 'QUICK' => 2, + 'EXTENDED' => 3 + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CreateStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CreateStatement.php new file mode 100755 index 0000000..0b176fc --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/CreateStatement.php @@ -0,0 +1,787 @@ + 1, + + // CREATE VIEW + 'OR REPLACE' => 2, + 'ALGORITHM' => array( + 3, + 'var=', + ), + // `DEFINER` is also used for `CREATE FUNCTION / PROCEDURE` + 'DEFINER' => array( + 4, + 'expr=', + ), + // Used in `CREATE VIEW` + 'SQL SECURITY' => array( + 5, + 'var', + ), + + 'DATABASE' => 6, + 'EVENT' => 6, + 'FUNCTION' => 6, + 'INDEX' => 6, + 'UNIQUE INDEX' => 6, + 'FULLTEXT INDEX' => 6, + 'SPATIAL INDEX' => 6, + 'PROCEDURE' => 6, + 'SERVER' => 6, + 'TABLE' => 6, + 'TABLESPACE' => 6, + 'TRIGGER' => 6, + 'USER' => 6, + 'VIEW' => 6, + 'SCHEMA' => 6, + + // CREATE TABLE + 'IF NOT EXISTS' => 7 + ); + + /** + * All database options. + * + * @var array + */ + public static $DB_OPTIONS = array( + 'CHARACTER SET' => array( + 1, + 'var=', + ), + 'CHARSET' => array( + 1, + 'var=', + ), + 'DEFAULT CHARACTER SET' => array( + 1, + 'var=', + ), + 'DEFAULT CHARSET' => array( + 1, + 'var=', + ), + 'DEFAULT COLLATE' => array( + 2, + 'var=', + ), + 'COLLATE' => array( + 2, + 'var=', + ) + ); + + /** + * All table options. + * + * @var array + */ + public static $TABLE_OPTIONS = array( + 'ENGINE' => array( + 1, + 'var=', + ), + 'AUTO_INCREMENT' => array( + 2, + 'var=', + ), + 'AVG_ROW_LENGTH' => array( + 3, + 'var', + ), + 'CHARACTER SET' => array( + 4, + 'var=', + ), + 'CHARSET' => array( + 4, + 'var=', + ), + 'DEFAULT CHARACTER SET' => array( + 4, + 'var=', + ), + 'DEFAULT CHARSET' => array( + 4, + 'var=', + ), + 'CHECKSUM' => array( + 5, + 'var', + ), + 'DEFAULT COLLATE' => array( + 6, + 'var=', + ), + 'COLLATE' => array( + 6, + 'var=', + ), + 'COMMENT' => array( + 7, + 'var=', + ), + 'CONNECTION' => array( + 8, + 'var', + ), + 'DATA DIRECTORY' => array( + 9, + 'var', + ), + 'DELAY_KEY_WRITE' => array( + 10, + 'var', + ), + 'INDEX DIRECTORY' => array( + 11, + 'var', + ), + 'INSERT_METHOD' => array( + 12, + 'var', + ), + 'KEY_BLOCK_SIZE' => array( + 13, + 'var', + ), + 'MAX_ROWS' => array( + 14, + 'var', + ), + 'MIN_ROWS' => array( + 15, + 'var', + ), + 'PACK_KEYS' => array( + 16, + 'var', + ), + 'PASSWORD' => array( + 17, + 'var', + ), + 'ROW_FORMAT' => array( + 18, + 'var', + ), + 'TABLESPACE' => array( + 19, + 'var', + ), + 'STORAGE' => array( + 20, + 'var', + ), + 'UNION' => array( + 21, + 'var', + ) + ); + + /** + * All function options. + * + * @var array + */ + public static $FUNC_OPTIONS = array( + 'NOT' => array( + 2, + 'var', + ), + 'FUNCTION' => array( + 3, + 'var=', + ), + 'PROCEDURE' => array( + 3, + 'var=', + ), + 'CONTAINS' => array( + 4, + 'expr', + ), + 'NO' => array( + 4, + 'var', + ), + 'READS' => array( + 4, + 'var', + ), + 'MODIFIES' => array( + 4, + 'expr', + ), + 'SQL SECURITY' => array( + 6, + 'var', + ), + 'LANGUAGE' => array( + 7, + 'var', + ), + 'COMMENT' => array( + 8, + 'var', + ), + + 'CREATE' => 1, + 'DETERMINISTIC' => 2, + 'DATA' => 5, + ); + + /** + * All trigger options. + * + * @var array + */ + public static $TRIGGER_OPTIONS = array( + 'BEFORE' => 1, + 'AFTER' => 1, + 'INSERT' => 2, + 'UPDATE' => 2, + 'DELETE' => 2 + ); + + /** + * The name of the entity that is created. + * + * Used by all `CREATE` statements. + * + * @var Expression + */ + public $name; + + /** + * The options of the entity (table, procedure, function, etc.). + * + * Used by `CREATE TABLE`, `CREATE FUNCTION` and `CREATE PROCEDURE`. + * + * @var OptionsArray + * + * @see static::$TABLE_OPTIONS + * @see static::$FUNC_OPTIONS + * @see static::$TRIGGER_OPTIONS + */ + public $entityOptions; + + /** + * If `CREATE TABLE`, a list of columns and keys. + * If `CREATE VIEW`, a list of columns. + * + * Used by `CREATE TABLE` and `CREATE VIEW`. + * + * @var CreateDefinition[]|ArrayObj + */ + public $fields; + + /** + * If `CREATE TABLE ... SELECT`. + * If `CREATE VIEW AS ` ... SELECT`. + * + * Used by `CREATE TABLE`, `CREATE VIEW` + * + * @var SelectStatement|null + */ + public $select; + + /** + * If `CREATE TABLE ... LIKE`. + * + * Used by `CREATE TABLE` + * + * @var Expression + */ + public $like; + + /** + * Expression used for partitioning. + * + * @var string + */ + public $partitionBy; + + /** + * The number of partitions. + * + * @var int + */ + public $partitionsNum; + + /** + * Expression used for subpartitioning. + * + * @var string + */ + public $subpartitionBy; + + /** + * The number of subpartitions. + * + * @var int + */ + public $subpartitionsNum; + + /** + * The partition of the new table. + * + * @var PartitionDefinition[] + */ + public $partitions; + + /** + * If `CREATE TRIGGER` the name of the table. + * + * Used by `CREATE TRIGGER`. + * + * @var Expression + */ + public $table; + + /** + * The return data type of this routine. + * + * Used by `CREATE FUNCTION`. + * + * @var DataType + */ + public $return; + + /** + * The parameters of this routine. + * + * Used by `CREATE FUNCTION` and `CREATE PROCEDURE`. + * + * @var ParameterDefinition[] + */ + public $parameters; + + /** + * The body of this function or procedure. + * For views, it is the select statement that creates the view. + * Used by `CREATE FUNCTION`, `CREATE PROCEDURE` and `CREATE VIEW`. + * + * @var Token[]|string + */ + public $body = array(); + + /** + * @return string + */ + public function build() + { + $fields = ''; + if (! empty($this->fields)) { + if (is_array($this->fields)) { + $fields = CreateDefinition::build($this->fields) . ' '; + } elseif ($this->fields instanceof ArrayObj) { + $fields = ArrayObj::build($this->fields); + } + } + if ($this->options->has('DATABASE') || $this->options->has('SCHEMA')) { + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' ' + . OptionsArray::build($this->entityOptions); + } elseif ($this->options->has('TABLE')) { + if (! is_null($this->select)) { + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' ' + . $this->select->build(); + } elseif (! is_null($this->like)) { + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' LIKE ' + . Expression::build($this->like); + } else { + $partition = ''; + + if (! empty($this->partitionBy)) { + $partition .= "\nPARTITION BY " . $this->partitionBy; + } + if (! empty($this->partitionsNum)) { + $partition .= "\nPARTITIONS " . $this->partitionsNum; + } + if (! empty($this->subpartitionBy)) { + $partition .= "\nSUBPARTITION BY " . $this->subpartitionBy; + } + if (! empty($this->subpartitionsNum)) { + $partition .= "\nSUBPARTITIONS " . $this->subpartitionsNum; + } + if (! empty($this->partitions)) { + $partition .= "\n" . PartitionDefinition::build($this->partitions); + } + + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' ' + . $fields + . OptionsArray::build($this->entityOptions) + . $partition; + } + } elseif ($this->options->has('VIEW')) { + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' ' + . $fields . ' AS ' . ($this->select ? $this->select->build() : '') . (! empty($this->body) ? TokensList::build($this->body) : '') . ' ' + . OptionsArray::build($this->entityOptions); + } elseif ($this->options->has('TRIGGER')) { + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' ' + . OptionsArray::build($this->entityOptions) . ' ' + . 'ON ' . Expression::build($this->table) . ' ' + . 'FOR EACH ROW ' . TokensList::build($this->body); + } elseif ($this->options->has('PROCEDURE') + || $this->options->has('FUNCTION') + ) { + $tmp = ''; + if ($this->options->has('FUNCTION')) { + $tmp = 'RETURNS ' . DataType::build($this->return); + } + + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' ' + . ParameterDefinition::build($this->parameters) . ' ' + . $tmp . ' ' . OptionsArray::build($this->entityOptions) . ' ' + . TokensList::build($this->body); + } + + return 'CREATE ' + . OptionsArray::build($this->options) . ' ' + . Expression::build($this->name) . ' ' + . TokensList::build($this->body); + } + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + ++$list->idx; // Skipping `CREATE`. + + // Parsing options. + $this->options = OptionsArray::parse($parser, $list, static::$OPTIONS); + ++$list->idx; // Skipping last option. + + $isDatabase = $this->options->has('DATABASE') || $this->options->has('SCHEMA'); + $fieldName = $isDatabase ? 'database' : 'table'; + + // Parsing the field name. + $this->name = Expression::parse( + $parser, + $list, + array( + 'parseField' => $fieldName, + 'breakOnAlias' => true + ) + ); + + if (! isset($this->name) || ($this->name === '')) { + $parser->error( + 'The name of the entity was expected.', + $list->tokens[$list->idx] + ); + } else { + ++$list->idx; // Skipping field. + } + + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + $nextidx = $list->idx + 1; + while ($nextidx < $list->count && $list->tokens[$nextidx]->type === Token::TYPE_WHITESPACE) { + ++$nextidx; + } + + if ($isDatabase) { + $this->entityOptions = OptionsArray::parse( + $parser, + $list, + static::$DB_OPTIONS + ); + } elseif ($this->options->has('TABLE')) { + if (($token->type === Token::TYPE_KEYWORD) + && ($token->keyword === 'SELECT')) { + /* CREATE TABLE ... SELECT */ + $this->select = new SelectStatement($parser, $list); + } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->keyword === 'AS') + && ($list->tokens[$nextidx]->type === Token::TYPE_KEYWORD) + && ($list->tokens[$nextidx]->value === 'SELECT')) { + /* CREATE TABLE ... AS SELECT */ + $list->idx = $nextidx; + $this->select = new SelectStatement($parser, $list); + } elseif ($token->type === Token::TYPE_KEYWORD + && $token->keyword === 'LIKE') { + /* CREATE TABLE `new_tbl` LIKE 'orig_tbl' */ + $list->idx = $nextidx; + $this->like = Expression::parse( + $parser, + $list, + array( + 'parseField' => 'table', + 'breakOnAlias' => true + ) + ); + // The 'LIKE' keyword was found, but no table_name was found next to it + if (is_null($this->like)) { + $parser->error( + 'A table name was expected.', + $list->tokens[$list->idx] + ); + } + } else { + $this->fields = CreateDefinition::parse($parser, $list); + if (empty($this->fields)) { + $parser->error( + 'At least one column definition was expected.', + $list->tokens[$list->idx] + ); + } + ++$list->idx; + + $this->entityOptions = OptionsArray::parse( + $parser, + $list, + static::$TABLE_OPTIONS + ); + + /** + * The field that is being filled (`partitionBy` or + * `subpartitionBy`). + * + * @var string + */ + $field = null; + + /** + * The number of brackets. `false` means no bracket was found + * previously. At least one bracket is required to validate the + * expression. + * + * @var int|bool + */ + $brackets = false; + + /* + * Handles partitions. + */ + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping comments. + if ($token->type === Token::TYPE_COMMENT) { + continue; + } + + if (($token->type === Token::TYPE_KEYWORD) && ($token->keyword === 'PARTITION BY')) { + $field = 'partitionBy'; + $brackets = false; + } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->keyword === 'SUBPARTITION BY')) { + $field = 'subpartitionBy'; + $brackets = false; + } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->keyword === 'PARTITIONS')) { + $token = $list->getNextOfType(Token::TYPE_NUMBER); + --$list->idx; // `getNextOfType` also advances one position. + $this->partitionsNum = $token->value; + } elseif (($token->type === Token::TYPE_KEYWORD) && ($token->keyword === 'SUBPARTITIONS')) { + $token = $list->getNextOfType(Token::TYPE_NUMBER); + --$list->idx; // `getNextOfType` also advances one position. + $this->subpartitionsNum = $token->value; + } elseif (! empty($field)) { + /* + * Handling the content of `PARTITION BY` and `SUBPARTITION BY`. + */ + + // Counting brackets. + if ($token->type === Token::TYPE_OPERATOR) { + if ($token->value === '(') { + // This is used instead of `++$brackets` because, + // initially, `$brackets` is `false` cannot be + // incremented. + $brackets = $brackets + 1; + } elseif ($token->value === ')') { + --$brackets; + } + } + + // Building the expression used for partitioning. + $this->$field .= ($token->type === Token::TYPE_WHITESPACE) ? ' ' : $token->token; + + // Last bracket was read, the expression ended. + // Comparing with `0` and not `false`, because `false` means + // that no bracket was found and at least one must is + // required. + if ($brackets === 0) { + $this->$field = trim($this->$field); + $field = null; + } + } elseif (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + if (! empty($this->partitionBy)) { + $this->partitions = ArrayObj::parse( + $parser, + $list, + array( + 'type' => 'PhpMyAdmin\\SqlParser\\Components\\PartitionDefinition' + ) + ); + } + break; + } + } + } + } elseif ($this->options->has('PROCEDURE') + || $this->options->has('FUNCTION') + ) { + $this->parameters = ParameterDefinition::parse($parser, $list); + if ($this->options->has('FUNCTION')) { + $prev_token = $token; + $token = $list->getNextOfType(Token::TYPE_KEYWORD); + if (is_null($token) || $token->keyword !== 'RETURNS') { + $parser->error( + 'A "RETURNS" keyword was expected.', + is_null($token) ? $prev_token : $token + ); + } else { + ++$list->idx; + $this->return = DataType::parse( + $parser, + $list + ); + } + } + ++$list->idx; + + $this->entityOptions = OptionsArray::parse( + $parser, + $list, + static::$FUNC_OPTIONS + ); + ++$list->idx; + + for (; $list->idx < $list->count; ++$list->idx) { + $token = $list->tokens[$list->idx]; + $this->body[] = $token; + } + } elseif ($this->options->has('VIEW')) { + /** @var Token $token */ + $token = $list->getNext(); // Skipping whitespaces and comments. + + // Parsing columns list. + if (($token->type === Token::TYPE_OPERATOR) && ($token->value === '(')) { + --$list->idx; // getNext() also goes forward one field. + $this->fields = ArrayObj::parse($parser, $list); + ++$list->idx; // Skipping last token from the array. + $list->getNext(); + } + + // Parsing the SELECT expression if the view started with it. + if ( + $token->type === Token::TYPE_KEYWORD + && $token->keyword === 'AS' + && $list->tokens[$nextidx]->type === Token::TYPE_KEYWORD + && $list->tokens[$nextidx]->value === 'SELECT' + ) { + $list->idx = $nextidx; + $this->select = new SelectStatement($parser, $list); + } + // Parsing all other tokens + for (; $list->idx < $list->count; ++$list->idx) { + $token = $list->tokens[$list->idx]; + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + $this->body[] = $token; + } + } elseif ($this->options->has('TRIGGER')) { + // Parsing the time and the event. + $this->entityOptions = OptionsArray::parse( + $parser, + $list, + static::$TRIGGER_OPTIONS + ); + ++$list->idx; + + $list->getNextOfTypeAndValue(Token::TYPE_KEYWORD, 'ON'); + ++$list->idx; // Skipping `ON`. + + // Parsing the name of the table. + $this->table = Expression::parse( + $parser, + $list, + array( + 'parseField' => 'table', + 'breakOnAlias' => true + ) + ); + ++$list->idx; + + $list->getNextOfTypeAndValue(Token::TYPE_KEYWORD, 'FOR EACH ROW'); + ++$list->idx; // Skipping `FOR EACH ROW`. + + for (; $list->idx < $list->count; ++$list->idx) { + $token = $list->tokens[$list->idx]; + $this->body[] = $token; + } + } else { + for (; $list->idx < $list->count; ++$list->idx) { + $token = $list->tokens[$list->idx]; + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + $this->body[] = $token; + } + } + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/DeleteStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/DeleteStatement.php new file mode 100755 index 0000000..088489d --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/DeleteStatement.php @@ -0,0 +1,380 @@ + 1, + 'QUICK' => 2, + 'IGNORE' => 3 + ); + + /** + * The clauses of this statement, in order. + * + * @see Statement::$CLAUSES + * + * @var array + */ + public static $CLAUSES = array( + 'DELETE' => array( + 'DELETE', + 2, + ), + // Used for options. + '_OPTIONS' => array( + '_OPTIONS', + 1, + ), + 'FROM' => array( + 'FROM', + 3, + ), + 'PARTITION' => array( + 'PARTITION', + 3, + ), + 'USING' => array( + 'USING', + 3, + ), + 'WHERE' => array( + 'WHERE', + 3, + ), + 'ORDER BY' => array( + 'ORDER BY', + 3, + ), + 'LIMIT' => array( + 'LIMIT', + 3, + ) + ); + + /** + * Table(s) used as sources for this statement. + * + * @var Expression[] + */ + public $from; + + /** + * Joins. + * + * @var JoinKeyword[] + */ + public $join; + + /** + * Tables used as sources for this statement. + * + * @var Expression[] + */ + public $using; + + /** + * Columns used in this statement. + * + * @var Expression[] + */ + public $columns; + + /** + * Partitions used as source for this statement. + * + * @var ArrayObj + */ + public $partition; + + /** + * Conditions used for filtering each row of the result set. + * + * @var Condition[] + */ + public $where; + + /** + * Specifies the order of the rows in the result set. + * + * @var OrderKeyword[] + */ + public $order; + + /** + * Conditions used for limiting the size of the result set. + * + * @var Limit + */ + public $limit; + + /** + * @return string + */ + public function build() + { + $ret = 'DELETE ' . OptionsArray::build($this->options); + + if (! is_null($this->columns) && count($this->columns) > 0) { + $ret .= ' ' . ExpressionArray::build($this->columns); + } + if (! is_null($this->from) && count($this->from) > 0) { + $ret .= ' FROM ' . ExpressionArray::build($this->from); + } + if (! is_null($this->join) && count($this->join) > 0) { + $ret .= ' ' . JoinKeyword::build($this->join); + } + if (! is_null($this->using) && count($this->using) > 0) { + $ret .= ' USING ' . ExpressionArray::build($this->using); + } + if (! is_null($this->where) && count($this->where) > 0) { + $ret .= ' WHERE ' . Condition::build($this->where); + } + if (! is_null($this->order) && count($this->order) > 0) { + $ret .= ' ORDER BY ' . ExpressionArray::build($this->order); + } + if (! is_null($this->limit) && strlen($this->limit) > 0) { + $ret .= ' LIMIT ' . Limit::build($this->limit); + } + + return $ret; + } + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + ++$list->idx; // Skipping `DELETE`. + + // parse any options if provided + $this->options = OptionsArray::parse( + $parser, + $list, + static::$OPTIONS + ); + ++$list->idx; + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------------------------[ FROM ]----------------------------------> 2 + * 0 ------------------------------[ table[.*] ]--------------------------------> 1 + * 1 ---------------------------------[ FROM ]----------------------------------> 2 + * 2 --------------------------------[ USING ]----------------------------------> 3 + * 2 --------------------------------[ WHERE ]----------------------------------> 4 + * 2 --------------------------------[ ORDER ]----------------------------------> 5 + * 2 --------------------------------[ LIMIT ]----------------------------------> 6 + * + * @var int + */ + $state = 0; + + /** + * If the query is multi-table or not. + * + * @var bool + */ + $multiTable = false; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + if ($state === 0) { + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword !== 'FROM') { + $parser->error('Unexpected keyword.', $token); + break; + } else { + ++$list->idx; // Skip 'FROM' + $this->from = ExpressionArray::parse($parser, $list); + + $state = 2; + } + } else { + $this->columns = ExpressionArray::parse($parser, $list); + $state = 1; + } + } elseif ($state === 1) { + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword !== 'FROM') { + $parser->error('Unexpected keyword.', $token); + break; + } else { + ++$list->idx; // Skip 'FROM' + $this->from = ExpressionArray::parse($parser, $list); + + $state = 2; + } + } else { + $parser->error('Unexpected token.', $token); + break; + } + } elseif ($state === 2) { + if ($token->type === Token::TYPE_KEYWORD) { + if (stripos($token->keyword, 'JOIN') !== false) { + ++$list->idx; + $this->join = JoinKeyword::parse($parser, $list); + + // remain in state = 2 + } else { + switch ($token->keyword) { + case 'USING': + ++$list->idx; // Skip 'USING' + $this->using = ExpressionArray::parse($parser, $list); + $state = 3; + + $multiTable = true; + break; + case 'WHERE': + ++$list->idx; // Skip 'WHERE' + $this->where = Condition::parse($parser, $list); + $state = 4; + break; + case 'ORDER BY': + ++$list->idx; // Skip 'ORDER BY' + $this->order = OrderKeyword::parse($parser, $list); + $state = 5; + break; + case 'LIMIT': + ++$list->idx; // Skip 'LIMIT' + $this->limit = Limit::parse($parser, $list); + $state = 6; + break; + default: + $parser->error('Unexpected keyword.', $token); + break 2; + } + } + } + } elseif ($state === 3) { + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'WHERE') { + ++$list->idx; // Skip 'WHERE' + $this->where = Condition::parse($parser, $list); + $state = 4; + } else { + $parser->error('Unexpected keyword.', $token); + break; + } + } else { + $parser->error('Unexpected token.', $token); + break; + } + } elseif ($state === 4) { + if ($multiTable === true + && $token->type === Token::TYPE_KEYWORD + ) { + $parser->error( + 'This type of clause is not valid in Multi-table queries.', + $token + ); + break; + } + + if ($token->type === Token::TYPE_KEYWORD) { + switch ($token->keyword) { + case 'ORDER BY': + ++$list->idx; // Skip 'ORDER BY' + $this->order = OrderKeyword::parse($parser, $list); + $state = 5; + break; + case 'LIMIT': + ++$list->idx; // Skip 'LIMIT' + $this->limit = Limit::parse($parser, $list); + $state = 6; + break; + default: + $parser->error('Unexpected keyword.', $token); + break 2; + } + } + } elseif ($state === 5) { + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'LIMIT') { + ++$list->idx; // Skip 'LIMIT' + $this->limit = Limit::parse($parser, $list); + $state = 6; + } else { + $parser->error('Unexpected keyword.', $token); + break; + } + } + } + } + + if ($state >= 2) { + foreach ($this->from as $from_expr) { + $from_expr->database = $from_expr->table; + $from_expr->table = $from_expr->column; + $from_expr->column = null; + } + } + + --$list->idx; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/DropStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/DropStatement.php new file mode 100755 index 0000000..7b9da2c --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/DropStatement.php @@ -0,0 +1,86 @@ + 1, + 'EVENT' => 1, + 'FUNCTION' => 1, + 'INDEX' => 1, + 'LOGFILE' => 1, + 'PROCEDURE' => 1, + 'SCHEMA' => 1, + 'SERVER' => 1, + 'TABLE' => 1, + 'VIEW' => 1, + 'TABLESPACE' => 1, + 'TRIGGER' => 1, + 'USER' => 1, + + 'TEMPORARY' => 2, + 'IF EXISTS' => 3 + ); + + /** + * The clauses of this statement, in order. + * + * @see Statement::$CLAUSES + * + * @var array + */ + public static $CLAUSES = array( + 'DROP' => array( + 'DROP', + 2, + ), + // Used for options. + '_OPTIONS' => array( + '_OPTIONS', + 1, + ), + // Used for select expressions. + 'DROP_' => array( + 'DROP', + 1, + ), + 'ON' => array( + 'ON', + 3, + ) + ); + + /** + * Dropped elements. + * + * @var Expression[] + */ + public $fields; + + /** + * Table of the dropped index. + * + * @var Expression + */ + public $table; +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ExplainStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ExplainStatement.php new file mode 100755 index 0000000..96a5828 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ExplainStatement.php @@ -0,0 +1,18 @@ + 1, + 'DELAYED' => 2, + 'HIGH_PRIORITY' => 3, + 'IGNORE' => 4 + ); + + /** + * Tables used as target for this statement. + * + * @var IntoKeyword + */ + public $into; + + /** + * Values to be inserted. + * + * @var ArrayObj[]|null + */ + public $values; + + /** + * If SET clause is present + * holds the SetOperation. + * + * @var SetOperation[] + */ + public $set; + + /** + * If SELECT clause is present + * holds the SelectStatement. + * + * @var SelectStatement + */ + public $select; + + /** + * If ON DUPLICATE KEY UPDATE clause is present + * holds the SetOperation. + * + * @var SetOperation[] + */ + public $onDuplicateSet; + + /** + * @return string + */ + public function build() + { + $ret = 'INSERT ' . $this->options; + $ret = trim($ret) . ' INTO ' . $this->into; + + if (! is_null($this->values) && count($this->values) > 0) { + $ret .= ' VALUES ' . Array2d::build($this->values); + } elseif (! is_null($this->set) && count($this->set) > 0) { + $ret .= ' SET ' . SetOperation::build($this->set); + } elseif (! is_null($this->select) && strlen($this->select) > 0) { + $ret .= ' ' . $this->select->build(); + } + + if (! is_null($this->onDuplicateSet) && count($this->onDuplicateSet) > 0) { + $ret .= ' ON DUPLICATE KEY UPDATE ' . SetOperation::build($this->onDuplicateSet); + } + + return $ret; + } + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + ++$list->idx; // Skipping `INSERT`. + + // parse any options if provided + $this->options = OptionsArray::parse( + $parser, + $list, + static::$OPTIONS + ); + ++$list->idx; + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------------------------[ INTO ]----------------------------------> 1 + * + * 1 -------------------------[ VALUES/VALUE/SET/SELECT ]-----------------------> 2 + * + * 2 -------------------------[ ON DUPLICATE KEY UPDATE ]-----------------------> 3 + * + * @var int + */ + $state = 0; + + /** + * For keeping track of semi-states on encountering + * ON DUPLICATE KEY UPDATE ... + */ + $miniState = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + if ($token->type === Token::TYPE_KEYWORD + && $token->keyword !== 'INTO' + ) { + $parser->error('Unexpected keyword.', $token); + break; + } + + ++$list->idx; + $this->into = IntoKeyword::parse( + $parser, + $list, + array('fromInsert' => true) + ); + + $state = 1; + } elseif ($state === 1) { + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'VALUE' + || $token->keyword === 'VALUES' + ) { + ++$list->idx; // skip VALUES + + $this->values = Array2d::parse($parser, $list); + } elseif ($token->keyword === 'SET') { + ++$list->idx; // skip SET + + $this->set = SetOperation::parse($parser, $list); + } elseif ($token->keyword === 'SELECT') { + $this->select = new SelectStatement($parser, $list); + } else { + $parser->error( + 'Unexpected keyword.', + $token + ); + break; + } + $state = 2; + $miniState = 1; + } else { + $parser->error( + 'Unexpected token.', + $token + ); + break; + } + } elseif ($state === 2) { + $lastCount = $miniState; + + if ($miniState === 1 && $token->keyword === 'ON') { + ++$miniState; + } elseif ($miniState === 2 && $token->keyword === 'DUPLICATE') { + ++$miniState; + } elseif ($miniState === 3 && $token->keyword === 'KEY') { + ++$miniState; + } elseif ($miniState === 4 && $token->keyword === 'UPDATE') { + ++$miniState; + } + + if ($lastCount === $miniState) { + $parser->error( + 'Unexpected token.', + $token + ); + break; + } + + if ($miniState === 5) { + ++$list->idx; + $this->onDuplicateSet = SetOperation::parse($parser, $list); + $state = 3; + } + } + } + + --$list->idx; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/LoadStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/LoadStatement.php new file mode 100755 index 0000000..422efc7 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/LoadStatement.php @@ -0,0 +1,423 @@ + 1, + 'CONCURRENT' => 1, + 'LOCAL' => 2 + ); + + /** + * FIELDS/COLUMNS Options for `LOAD DATA...INFILE` statements. + * + * @var array + */ + public static $FIELDS_OPTIONS = array( + 'TERMINATED BY' => array( + 1, + 'expr', + ), + 'OPTIONALLY' => 2, + 'ENCLOSED BY' => array( + 3, + 'expr', + ), + 'ESCAPED BY' => array( + 4, + 'expr', + ) + ); + + /** + * LINES Options for `LOAD DATA...INFILE` statements. + * + * @var array + */ + public static $LINES_OPTIONS = array( + 'STARTING BY' => array( + 1, + 'expr', + ), + 'TERMINATED BY' => array( + 2, + 'expr', + ) + ); + + /** + * File name being used to load data. + * + * @var Expression + */ + public $file_name; + + /** + * Table used as destination for this statement. + * + * @var Expression + */ + public $table; + + /** + * Partitions used as source for this statement. + * + * @var ArrayObj + */ + public $partition; + + /** + * Character set used in this statement. + * + * @var Expression + */ + public $charset_name; + + /** + * Options for FIELDS/COLUMNS keyword. + * + * @var OptionsArray + * + * @see static::$FIELDS_OPTIONS + */ + public $fields_options; + + /** + * Whether to use `FIELDS` or `COLUMNS` while building. + * + * @var string + */ + public $fields_keyword; + + /** + * Options for OPTIONS keyword. + * + * @var OptionsArray + * + * @see static::$LINES_OPTIONS + */ + public $lines_options; + + /** + * Column names or user variables. + * + * @var Expression[] + */ + public $col_name_or_user_var; + + /** + * SET clause's updated values(optional). + * + * @var SetOperation[] + */ + public $set; + + /** + * Ignore 'number' LINES/ROWS. + * + * @var Expression + */ + public $ignore_number; + + /** + * REPLACE/IGNORE Keyword. + * + * @var string + */ + public $replace_ignore; + + /** + * LINES/ROWS Keyword. + * + * @var string + */ + public $lines_rows; + + /** + * @return string + */ + public function build() + { + $ret = 'LOAD DATA ' . $this->options + . ' INFILE ' . $this->file_name; + + if ($this->replace_ignore !== null) { + $ret .= ' ' . trim($this->replace_ignore); + } + + $ret .= ' INTO TABLE ' . $this->table; + + if ($this->partition !== null && strlen($this->partition) > 0) { + $ret .= ' PARTITION ' . ArrayObj::build($this->partition); + } + + if ($this->charset_name !== null) { + $ret .= ' CHARACTER SET ' . $this->charset_name; + } + + if ($this->fields_keyword !== null) { + $ret .= ' ' . $this->fields_keyword . ' ' . $this->fields_options; + } + + if ($this->lines_options !== null && strlen($this->lines_options) > 0) { + $ret .= ' LINES ' . $this->lines_options; + } + + if ($this->ignore_number !== null) { + $ret .= ' IGNORE ' . $this->ignore_number . ' ' . $this->lines_rows; + } + + if ($this->col_name_or_user_var !== null && count($this->col_name_or_user_var) > 0) { + $ret .= ' ' . ExpressionArray::build($this->col_name_or_user_var); + } + + if ($this->set !== null && count($this->set) > 0) { + $ret .= ' SET ' . SetOperation::build($this->set); + } + + return $ret; + } + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + ++$list->idx; // Skipping `LOAD DATA`. + + // parse any options if provided + $this->options = OptionsArray::parse( + $parser, + $list, + static::$OPTIONS + ); + ++$list->idx; + + /** + * The state of the parser. + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + if ($token->type === Token::TYPE_KEYWORD + && $token->keyword !== 'INFILE' + ) { + $parser->error('Unexpected keyword.', $token); + break; + } elseif ($token->type !== Token::TYPE_KEYWORD) { + $parser->error('Unexpected token.', $token); + break; + } + + ++$list->idx; + $this->file_name = Expression::parse( + $parser, + $list, + array('parseField' => 'file') + ); + $state = 1; + } elseif ($state === 1) { + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'REPLACE' + || $token->keyword === 'IGNORE') { + $this->replace_ignore = trim($token->keyword); + } elseif ($token->keyword === 'INTO') { + $state = 2; + } + } + } elseif ($state === 2) { + if ($token->type === Token::TYPE_KEYWORD + && $token->keyword === 'TABLE' + ) { + ++$list->idx; + $this->table = Expression::parse($parser, $list, array('parseField' => 'table')); + $state = 3; + } else { + $parser->error('Unexpected token.', $token); + break; + } + } elseif ($state >= 3 && $state <= 7) { + if ($token->type === Token::TYPE_KEYWORD) { + $newState = $this->parseKeywordsAccordingToState( + $parser, + $list, + $state + ); + if ($newState === $state) { + // Avoid infinite loop + break; + } + } elseif ($token->type === Token::TYPE_OPERATOR + && $token->token === '(' + ) { + $this->col_name_or_user_var + = ExpressionArray::parse($parser, $list); + $state = 7; + } else { + $parser->error('Unexpected token.', $token); + break; + } + } + } + + --$list->idx; + } + + public function parseFileOptions(Parser $parser, TokensList $list, $keyword = 'FIELDS') + { + ++$list->idx; + + if ($keyword === 'FIELDS' || $keyword === 'COLUMNS') { + // parse field options + $this->fields_options = OptionsArray::parse( + $parser, + $list, + static::$FIELDS_OPTIONS + ); + + $this->fields_keyword = $keyword; + } else { + // parse line options + $this->lines_options = OptionsArray::parse( + $parser, + $list, + static::$LINES_OPTIONS + ); + } + } + + public function parseKeywordsAccordingToState($parser, $list, $state) + { + $token = $list->tokens[$list->idx]; + + switch ($state) { + case 3: + if ($token->keyword === 'PARTITION') { + ++$list->idx; + $this->partition = ArrayObj::parse($parser, $list); + $state = 4; + + return $state; + } + // no break + case 4: + if ($token->keyword === 'CHARACTER SET') { + ++$list->idx; + $this->charset_name = Expression::parse($parser, $list); + $state = 5; + + return $state; + } + // no break + case 5: + if ($token->keyword === 'FIELDS' + || $token->keyword === 'COLUMNS' + || $token->keyword === 'LINES' + ) { + $this->parseFileOptions($parser, $list, $token->value); + $state = 6; + + return $state; + } + // no break + case 6: + if ($token->keyword === 'IGNORE') { + ++$list->idx; + + $this->ignore_number = Expression::parse($parser, $list); + $nextToken = $list->getNextOfType(Token::TYPE_KEYWORD); + + if ($nextToken->type === Token::TYPE_KEYWORD + && (($nextToken->keyword === 'LINES') + || ($nextToken->keyword === 'ROWS')) + ) { + $this->lines_rows = $nextToken->token; + } + $state = 7; + + return $state; + } + // no break + case 7: + if ($token->keyword === 'SET') { + ++$list->idx; + $this->set = SetOperation::parse($parser, $list); + $state = 8; + + return $state; + } + // no break + default: + } + + return $state; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/LockStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/LockStatement.php new file mode 100755 index 0000000..d4c6cb1 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/LockStatement.php @@ -0,0 +1,128 @@ +tokens[$list->idx]->value === 'UNLOCK') { + // this is in fact an UNLOCK statement + $this->isLock = false; + } + ++$list->idx; // Skipping `LOCK`. + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------- [ TABLES ] -----------------> 1 + * 1 -------------- [ lock_expr ] ----------------> 2 + * 2 ------------------ [ , ] --------------------> 1 + * + * @var int + */ + $state = 0; + + /** + * Previous parsed token + */ + $prevToken = null; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword !== 'TABLES') { + $parser->error('Unexpected keyword.', $token); + break; + } + $state = 1; + continue; + } else { + $parser->error('Unexpected token.', $token); + break; + } + } elseif ($state === 1) { + if (! $this->isLock) { + // UNLOCK statement should not have any more tokens + $parser->error('Unexpected token.', $token); + break; + } + $this->locked[] = LockExpression::parse($parser, $list); + $state = 2; + } elseif ($state === 2) { + if ($token->value === ',') { + // move over to parsing next lock expression + $state = 1; + } + } + + $prevToken = $token; + } + + if ($state !== 2 && $prevToken != null) { + $parser->error('Unexpected end of LOCK statement.', $prevToken); + } + } + + /** + * @return string + */ + public function build() + { + return trim(($this->isLock ? 'LOCK' : 'UNLOCK') + . ' TABLES ' . LockExpression::build($this->locked)); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/MaintenanceStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/MaintenanceStatement.php new file mode 100755 index 0000000..ac3b8c9 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/MaintenanceStatement.php @@ -0,0 +1,61 @@ +idx; + $this->options->merge( + OptionsArray::parse( + $parser, + $list, + static::$OPTIONS + ) + ); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/NotImplementedStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/NotImplementedStatement.php new file mode 100755 index 0000000..e534cdf --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/NotImplementedStatement.php @@ -0,0 +1,61 @@ +unknown as $token) { + $query .= $token->token; + } + + return $query; + } + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + for (; $list->idx < $list->count; ++$list->idx) { + if ($list->tokens[$list->idx]->type === Token::TYPE_DELIMITER) { + break; + } + $this->unknown[] = $list->tokens[$list->idx]; + } + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/OptimizeStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/OptimizeStatement.php new file mode 100755 index 0000000..1aff056 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/OptimizeStatement.php @@ -0,0 +1,42 @@ + 1, + + 'NO_WRITE_TO_BINLOG' => 2, + 'LOCAL' => 3 + ); + + /** + * Optimized tables. + * + * @var Expression[] + */ + public $tables; +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/PurgeStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/PurgeStatement.php new file mode 100755 index 0000000..0374813 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/PurgeStatement.php @@ -0,0 +1,143 @@ +log_type . ' ' . 'LOGS ' + . ($this->end_option !== null ? ($this->end_option . ' ' . $this->end_expr) : ''); + return trim($ret); + } + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + ++$list->idx; // Skipping `PURGE`. + + /** + * The state of the parser. + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + switch ($state) { + case 0: + // parse `{ BINARY | MASTER }` + $this->log_type = self::parseExpectedKeyword($parser, $token, array('BINARY', 'MASTER')); + break; + case 1: + // parse `LOGS` + self::parseExpectedKeyword($parser, $token, array('LOGS')); + break; + case 2: + // parse `{ TO | BEFORE }` + $this->end_option = self::parseExpectedKeyword($parser, $token, array('TO', 'BEFORE')); + break; + case 3: + // parse `expr` + $this->end_expr = Expression::parse($parser, $list, array()); + break; + default: + $parser->error('Unexpected token.', $token); + break; + } + $state++; + $prevToken = $token; + } + + // Only one possible end state + if ($state != 4) { + $parser->error('Unexpected token.', $prevToken); + } + } + + /** + * Parse expected keyword (or throw relevant error) + * + * @param Parser $parser the instance that requests parsing + * @param Token $token token to be parsed + * @param Array $expected_keywords array of possibly expected keywords at this point + */ + private static function parseExpectedKeyword($parser, $token, $expected_keywords) + { + if ($token->type === Token::TYPE_KEYWORD) { + if (in_array($token->keyword, $expected_keywords)) { + return $token->keyword; + } else { + $parser->error('Unexpected keyword', $token); + } + } else { + $parser->error('Unexpected token.', $token); + } + return null; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RenameStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RenameStatement.php new file mode 100755 index 0000000..e1bcf0d --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RenameStatement.php @@ -0,0 +1,58 @@ +type === Token::TYPE_KEYWORD) && ($token->keyword === 'RENAME')) { + // Checking if it is the beginning of the query. + $list->getNextOfTypeAndValue(Token::TYPE_KEYWORD, 'TABLE'); + } + } + + /** + * @return string + */ + public function build() + { + return 'RENAME TABLE ' . RenameOperation::build($this->renames); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RepairStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RepairStatement.php new file mode 100755 index 0000000..fb76855 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RepairStatement.php @@ -0,0 +1,37 @@ + 1, + + 'NO_WRITE_TO_BINLOG' => 2, + 'LOCAL' => 3, + + 'QUICK' => 4, + 'EXTENDED' => 5, + 'USE_FRM' => 6 + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ReplaceStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ReplaceStatement.php new file mode 100755 index 0000000..d912da0 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ReplaceStatement.php @@ -0,0 +1,201 @@ + 1, + 'DELAYED' => 1 + ); + + /** + * Tables used as target for this statement. + * + * @var IntoKeyword + */ + public $into; + + /** + * Values to be replaced. + * + * @var Array2d + */ + public $values; + + /** + * If SET clause is present + * holds the SetOperation. + * + * @var SetOperation[] + */ + public $set; + + /** + * If SELECT clause is present + * holds the SelectStatement. + * + * @var SelectStatement + */ + public $select; + + /** + * @return string + */ + public function build() + { + $ret = 'REPLACE ' . $this->options; + $ret = trim($ret) . ' INTO ' . $this->into; + + if (! is_null($this->values) && count($this->values) > 0) { + $ret .= ' VALUES ' . Array2d::build($this->values); + } elseif (! is_null($this->set) && count($this->set) > 0) { + $ret .= ' SET ' . SetOperation::build($this->set); + } elseif (! is_null($this->select) && strlen($this->select) > 0) { + $ret .= ' ' . $this->select->build(); + } + + return $ret; + } + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + ++$list->idx; // Skipping `REPLACE`. + + // parse any options if provided + $this->options = OptionsArray::parse( + $parser, + $list, + static::$OPTIONS + ); + + ++$list->idx; + + /** + * The state of the parser. + * + * Below are the states of the parser. + * + * 0 ---------------------------------[ INTO ]----------------------------------> 1 + * + * 1 -------------------------[ VALUES/VALUE/SET/SELECT ]-----------------------> 2 + * + * @var int + */ + $state = 0; + + for (; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $token = $list->tokens[$list->idx]; + + // End of statement. + if ($token->type === Token::TYPE_DELIMITER) { + break; + } + + // Skipping whitespaces and comments. + if (($token->type === Token::TYPE_WHITESPACE) || ($token->type === Token::TYPE_COMMENT)) { + continue; + } + + if ($state === 0) { + if ($token->type === Token::TYPE_KEYWORD + && $token->keyword !== 'INTO' + ) { + $parser->error('Unexpected keyword.', $token); + break; + } + ++$list->idx; + $this->into = IntoKeyword::parse( + $parser, + $list, + array('fromReplace' => true) + ); + + $state = 1; + } elseif ($state === 1) { + if ($token->type === Token::TYPE_KEYWORD) { + if ($token->keyword === 'VALUE' + || $token->keyword === 'VALUES' + ) { + ++$list->idx; // skip VALUES + + $this->values = Array2d::parse($parser, $list); + } elseif ($token->keyword === 'SET') { + ++$list->idx; // skip SET + + $this->set = SetOperation::parse($parser, $list); + } elseif ($token->keyword === 'SELECT') { + $this->select = new SelectStatement($parser, $list); + } else { + $parser->error( + 'Unexpected keyword.', + $token + ); + break; + } + $state = 2; + } else { + $parser->error( + 'Unexpected token.', + $token + ); + break; + } + } + } + + --$list->idx; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RestoreStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RestoreStatement.php new file mode 100755 index 0000000..a7bf2c8 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/RestoreStatement.php @@ -0,0 +1,33 @@ + 1, + + 'FROM' => array( + 2, + 'var', + ) + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/SelectStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/SelectStatement.php new file mode 100755 index 0000000..895cd44 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/SelectStatement.php @@ -0,0 +1,352 @@ + 1, + 'DISTINCT' => 1, + 'DISTINCTROW' => 1, + 'HIGH_PRIORITY' => 2, + 'MAX_STATEMENT_TIME' => array( + 3, + 'var=', + ), + 'STRAIGHT_JOIN' => 4, + 'SQL_SMALL_RESULT' => 5, + 'SQL_BIG_RESULT' => 6, + 'SQL_BUFFER_RESULT' => 7, + 'SQL_CACHE' => 8, + 'SQL_NO_CACHE' => 8, + 'SQL_CALC_FOUND_ROWS' => 9 + ); + + public static $END_OPTIONS = array( + 'FOR UPDATE' => 1, + 'LOCK IN SHARE MODE' => 1 + ); + + /** + * The clauses of this statement, in order. + * + * @see Statement::$CLAUSES + * + * @var array + */ + public static $CLAUSES = array( + 'SELECT' => array( + 'SELECT', + 2, + ), + // Used for options. + '_OPTIONS' => array( + '_OPTIONS', + 1, + ), + // Used for selected expressions. + '_SELECT' => array( + 'SELECT', + 1, + ), + 'INTO' => array( + 'INTO', + 3, + ), + 'FROM' => array( + 'FROM', + 3, + ), + 'FORCE' => array( + 'FORCE', + 1, + ), + 'USE' => array( + 'USE', + 1, + ), + 'IGNORE' => array( + 'IGNORE', + 3, + ), + 'PARTITION' => array( + 'PARTITION', + 3, + ), + + 'JOIN' => array( + 'JOIN', + 1, + ), + 'FULL JOIN' => array( + 'FULL JOIN', + 1, + ), + 'INNER JOIN' => array( + 'INNER JOIN', + 1, + ), + 'LEFT JOIN' => array( + 'LEFT JOIN', + 1, + ), + 'LEFT OUTER JOIN' => array( + 'LEFT OUTER JOIN', + 1, + ), + 'RIGHT JOIN' => array( + 'RIGHT JOIN', + 1, + ), + 'RIGHT OUTER JOIN' => array( + 'RIGHT OUTER JOIN', + 1, + ), + 'NATURAL JOIN' => array( + 'NATURAL JOIN', + 1, + ), + 'NATURAL LEFT JOIN' => array( + 'NATURAL LEFT JOIN', + 1, + ), + 'NATURAL RIGHT JOIN' => array( + 'NATURAL RIGHT JOIN', + 1, + ), + 'NATURAL LEFT OUTER JOIN' => array( + 'NATURAL LEFT OUTER JOIN', + 1, + ), + 'NATURAL RIGHT OUTER JOIN' => array( + 'NATURAL RIGHT JOIN', + 1, + ), + + 'WHERE' => array( + 'WHERE', + 3, + ), + 'GROUP BY' => array( + 'GROUP BY', + 3, + ), + 'HAVING' => array( + 'HAVING', + 3, + ), + 'ORDER BY' => array( + 'ORDER BY', + 3, + ), + 'LIMIT' => array( + 'LIMIT', + 3, + ), + 'PROCEDURE' => array( + 'PROCEDURE', + 3, + ), + 'UNION' => array( + 'UNION', + 1, + ), + 'EXCEPT' => array( + 'EXCEPT', + 1, + ), + 'INTERSECT' => array( + 'INTERSECT', + 1, + ), + '_END_OPTIONS' => array( + '_END_OPTIONS', + 1, + ), + // These are available only when `UNION` is present. + // 'ORDER BY' => array('ORDER BY', 3), + // 'LIMIT' => array('LIMIT', 3) + ); + + /** + * Expressions that are being selected by this statement. + * + * @var Expression[] + */ + public $expr = array(); + + /** + * Tables used as sources for this statement. + * + * @var Expression[] + */ + public $from = array(); + + /** + * Index hints + * + * @var IndexHint[] + */ + public $index_hints; + + /** + * Partitions used as source for this statement. + * + * @var ArrayObj + */ + public $partition; + + /** + * Conditions used for filtering each row of the result set. + * + * @var Condition[] + */ + public $where; + + /** + * Conditions used for grouping the result set. + * + * @var GroupKeyword[] + */ + public $group; + + /** + * Conditions used for filtering the result set. + * + * @var Condition[] + */ + public $having; + + /** + * Specifies the order of the rows in the result set. + * + * @var OrderKeyword[] + */ + public $order; + + /** + * Conditions used for limiting the size of the result set. + * + * @var Limit + */ + public $limit; + + /** + * Procedure that should process the data in the result set. + * + * @var FunctionCall + */ + public $procedure; + + /** + * Destination of this result set. + * + * @var IntoKeyword + */ + public $into; + + /** + * Joins. + * + * @var JoinKeyword[] + */ + public $join; + + /** + * Unions. + * + * @var SelectStatement[] + */ + public $union = array(); + + /** + * The end options of this query. + * + * @var OptionsArray + * + * @see static::$END_OPTIONS + */ + public $end_options; + + /** + * Gets the clauses of this statement. + * + * @return array + */ + public function getClauses() + { + // This is a cheap fix for `SELECT` statements that contain `UNION`. + // The `ORDER BY` and `LIMIT` clauses should be at the end of the + // statement. + if (! empty($this->union)) { + $clauses = static::$CLAUSES; + unset($clauses['ORDER BY'], $clauses['LIMIT']); + $clauses['ORDER BY'] = array( + 'ORDER BY', + 3 + ); + $clauses['LIMIT'] = array( + 'LIMIT', + 3 + ); + + return $clauses; + } + + return static::$CLAUSES; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/SetStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/SetStatement.php new file mode 100755 index 0000000..d62b6f0 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/SetStatement.php @@ -0,0 +1,114 @@ + array( + 'SET', + 3 + ), + '_END_OPTIONS' => array( + '_END_OPTIONS', + 1 + ) + ); + + /** + * Possible exceptions in SET statment. + * + * @var array + */ + public static $OPTIONS = array( + 'CHARSET' => array( + 3, + 'var', + ), + 'CHARACTER SET' => array( + 3, + 'var', + ), + 'NAMES' => array( + 3, + 'var', + ), + 'PASSWORD' => array( + 3, + 'expr', + ), + 'SESSION' => 3, + 'GLOBAL' => 3, + 'PERSIST' => 3, + 'PERSIST_ONLY' => 3, + '@@SESSION' => 3, + '@@GLOBAL' => 3, + '@@PERSIST' => 3, + '@@PERSIST_ONLY' => 3, + ); + + public static $END_OPTIONS = array( + 'COLLATE' => array( + 1, + 'var', + ), + 'DEFAULT' => 1 + ); + + /** + * Options used in current statement. + * + * @var OptionsArray[] + */ + public $options; + + /** + * The end options of this query. + * + * @var OptionsArray + * + * @see static::$END_OPTIONS + */ + public $end_options; + + /** + * The updated values. + * + * @var SetOperation[] + */ + public $set; + + /** + * @return string + */ + public function build() + { + $ret = 'SET ' . OptionsArray::build($this->options) + . ' ' . SetOperation::build($this->set) + . ' ' . OptionsArray::build($this->end_options); + + return trim($ret); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ShowStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ShowStatement.php new file mode 100755 index 0000000..1e9e67e --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/ShowStatement.php @@ -0,0 +1,66 @@ + 1, + 'AUTHORS' => 2, + 'BINARY' => 2, + 'BINLOG' => 2, + 'CHARACTER' => 2, + 'CODE' => 2, + 'COLLATION' => 2, + 'COLUMNS' => 2, + 'CONTRIBUTORS' => 2, + 'DATABASE' => 2, + 'DATABASES' => 2, + 'ENGINE' => 2, + 'ENGINES' => 2, + 'ERRORS' => 2, + 'EVENT' => 2, + 'EVENTS' => 2, + 'FUNCTION' => 2, + 'GRANTS' => 2, + 'HOSTS' => 2, + 'INDEX' => 2, + 'INNODB' => 2, + 'LOGS' => 2, + 'MASTER' => 2, + 'OPEN' => 2, + 'PLUGINS' => 2, + 'PRIVILEGES' => 2, + 'PROCEDURE' => 2, + 'PROCESSLIST' => 2, + 'PROFILE' => 2, + 'PROFILES' => 2, + 'SCHEDULER' => 2, + 'SET' => 2, + 'SLAVE' => 2, + 'STATUS' => 2, + 'TABLE' => 2, + 'TABLES' => 2, + 'TRIGGER' => 2, + 'TRIGGERS' => 2, + 'VARIABLES' => 2, + 'VIEW' => 2, + 'WARNINGS' => 2 + ); +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/TransactionStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/TransactionStatement.php new file mode 100755 index 0000000..59bd9c6 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/TransactionStatement.php @@ -0,0 +1,114 @@ + 1, + 'BEGIN' => 1, + 'COMMIT' => 1, + 'ROLLBACK' => 1, + 'WITH CONSISTENT SNAPSHOT' => 2, + 'WORK' => 2, + 'AND NO CHAIN' => 3, + 'AND CHAIN' => 3, + 'RELEASE' => 4, + 'NO RELEASE' => 4 + ); + + /** + * @param Parser $parser the instance that requests parsing + * @param TokensList $list the list of tokens to be parsed + */ + public function parse(Parser $parser, TokensList $list) + { + parent::parse($parser, $list); + + // Checks the type of this query. + if ($this->options->has('START TRANSACTION') + || $this->options->has('BEGIN') + ) { + $this->type = self::TYPE_BEGIN; + } elseif ($this->options->has('COMMIT') + || $this->options->has('ROLLBACK') + ) { + $this->type = self::TYPE_END; + } + } + + /** + * @return string + */ + public function build() + { + $ret = OptionsArray::build($this->options); + if ($this->type === self::TYPE_BEGIN) { + foreach ($this->statements as $statement) { + /* + * @var SelectStatement $statement + */ + $ret .= ';' . $statement->build(); + } + $ret .= ';' . $this->end->build(); + } + + return $ret; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/TruncateStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/TruncateStatement.php new file mode 100755 index 0000000..13a4d21 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/TruncateStatement.php @@ -0,0 +1,46 @@ + 1 + ); + + /** + * The name of the truncated table. + * + * @var Expression + */ + public $table; + + /** + * Special build method for truncate statement as Statement::build would return empty string. + * + * @return string + */ + public function build() + { + return 'TRUNCATE TABLE ' . $this->table . ';'; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/UpdateStatement.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/UpdateStatement.php new file mode 100755 index 0000000..da7d741 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Statements/UpdateStatement.php @@ -0,0 +1,121 @@ + 1, + 'IGNORE' => 2 + ); + + /** + * The clauses of this statement, in order. + * + * @see Statement::$CLAUSES + * + * @var array + */ + public static $CLAUSES = array( + 'UPDATE' => array( + 'UPDATE', + 2, + ), + // Used for options. + '_OPTIONS' => array( + '_OPTIONS', + 1, + ), + // Used for updated tables. + '_UPDATE' => array( + 'UPDATE', + 1, + ), + 'SET' => array( + 'SET', + 3, + ), + 'WHERE' => array( + 'WHERE', + 3, + ), + 'ORDER BY' => array( + 'ORDER BY', + 3, + ), + 'LIMIT' => array( + 'LIMIT', + 3, + ) + ); + + /** + * Tables used as sources for this statement. + * + * @var Expression[] + */ + public $tables; + + /** + * The updated values. + * + * @var SetOperation[] + */ + public $set; + + /** + * Conditions used for filtering each row of the result set. + * + * @var Condition[] + */ + public $where; + + /** + * Specifies the order of the rows in the result set. + * + * @var OrderKeyword[] + */ + public $order; + + /** + * Conditions used for limiting the size of the result set. + * + * @var Limit + */ + public $limit; +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Token.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Token.php new file mode 100755 index 0000000..357d646 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Token.php @@ -0,0 +1,345 @@ +, !==, etc. + * Bitwise operators: &, |, ^, etc. + * Assignment operators: =, +=, -=, etc. + * SQL specific operators: . (e.g. .. WHERE database.table ..), + * * (e.g. SELECT * FROM ..) + * + * @var int + */ + const TYPE_OPERATOR = 2; + + /** + * Spaces, tabs, new lines, etc. + * + * @var int + */ + const TYPE_WHITESPACE = 3; + + /** + * Any type of legal comment. + * + * Bash (#), C (/* *\/) or SQL (--) comments: + * + * -- SQL-comment + * + * #Bash-like comment + * + * /*C-like comment*\/ + * + * or: + * + * /*C-like + * comment*\/ + * + * Backslashes were added to respect PHP's comments syntax. + * + * @var int + */ + const TYPE_COMMENT = 4; + + /** + * Boolean values: true or false. + * + * @var int + */ + const TYPE_BOOL = 5; + + /** + * Numbers: 4, 0x8, 15.16, 23e42, etc. + * + * @var int + */ + const TYPE_NUMBER = 6; + + /** + * Literal strings: 'string', "test". + * Some of these strings are actually symbols. + * + * @var int + */ + const TYPE_STRING = 7; + + /** + * Database, table names, variables, etc. + * For example: ```SELECT `foo`, `bar` FROM `database`.`table`;```. + * + * @var int + */ + const TYPE_SYMBOL = 8; + + /** + * Delimits an unknown string. + * For example: ```SELECT * FROM test;```, `test` is a delimiter. + * + * @var int + */ + const TYPE_DELIMITER = 9; + + /** + * Labels in LOOP statement, ITERATE statement etc. + * For example (only for begin label): + * begin_label: BEGIN [statement_list] END [end_label] + * begin_label: LOOP [statement_list] END LOOP [end_label] + * begin_label: REPEAT [statement_list] ... END REPEAT [end_label] + * begin_label: WHILE ... DO [statement_list] END WHILE [end_label]. + * + * @var int + */ + const TYPE_LABEL = 10; + + // Flags that describe the tokens in more detail. + // All keywords must have flag 1 so `Context::isKeyword` method doesn't + // require strict comparison. + const FLAG_KEYWORD_RESERVED = 2; + const FLAG_KEYWORD_COMPOSED = 4; + const FLAG_KEYWORD_DATA_TYPE = 8; + const FLAG_KEYWORD_KEY = 16; + const FLAG_KEYWORD_FUNCTION = 32; + + // Numbers related flags. + const FLAG_NUMBER_HEX = 1; + const FLAG_NUMBER_FLOAT = 2; + const FLAG_NUMBER_APPROXIMATE = 4; + const FLAG_NUMBER_NEGATIVE = 8; + const FLAG_NUMBER_BINARY = 16; + + // Strings related flags. + const FLAG_STRING_SINGLE_QUOTES = 1; + const FLAG_STRING_DOUBLE_QUOTES = 2; + + // Comments related flags. + const FLAG_COMMENT_BASH = 1; + const FLAG_COMMENT_C = 2; + const FLAG_COMMENT_SQL = 4; + const FLAG_COMMENT_MYSQL_CMD = 8; + + // Operators related flags. + const FLAG_OPERATOR_ARITHMETIC = 1; + const FLAG_OPERATOR_LOGICAL = 2; + const FLAG_OPERATOR_BITWISE = 4; + const FLAG_OPERATOR_ASSIGNMENT = 8; + const FLAG_OPERATOR_SQL = 16; + + // Symbols related flags. + const FLAG_SYMBOL_VARIABLE = 1; + const FLAG_SYMBOL_BACKTICK = 2; + const FLAG_SYMBOL_USER = 4; + const FLAG_SYMBOL_SYSTEM = 8; + const FLAG_SYMBOL_PARAMETER = 16; + + /** + * The token it its raw string representation. + * + * @var string + */ + public $token; + + /** + * The value this token contains (i.e. token after some evaluation). + * + * @var mixed + */ + public $value; + + /** + * The keyword value this token contains, always uppercase. + * + * @var mixed + */ + public $keyword; + + /** + * The type of this token. + * + * @var int + */ + public $type; + + /** + * The flags of this token. + * + * @var int + */ + public $flags; + + /** + * The position in the initial string where this token started. + * + * The position is counted in chars, not bytes, so you should + * use mb_* functions to properly handle utf-8 multibyte chars. + * + * @var int + */ + public $position; + + /** + * Constructor. + * + * @param string $token the value of the token + * @param int $type the type of the token + * @param int $flags the flags of the token + */ + public function __construct($token, $type = 0, $flags = 0) + { + $this->token = $token; + $this->type = $type; + $this->flags = $flags; + $this->keyword = null; + $this->value = $this->extract(); + } + + /** + * Does little processing to the token to extract a value. + * + * If no processing can be done it will return the initial string. + * + * @return mixed + */ + public function extract() + { + switch ($this->type) { + case self::TYPE_KEYWORD: + $this->keyword = strtoupper($this->token); + if (! ($this->flags & self::FLAG_KEYWORD_RESERVED)) { + // Unreserved keywords should stay the way they are because they + // might represent field names. + return $this->token; + } + + return $this->keyword; + case self::TYPE_WHITESPACE: + return ' '; + case self::TYPE_BOOL: + return strtoupper($this->token) === 'TRUE'; + case self::TYPE_NUMBER: + $ret = str_replace('--', '', $this->token); // e.g. ---42 === -42 + if ($this->flags & self::FLAG_NUMBER_HEX) { + if ($this->flags & self::FLAG_NUMBER_NEGATIVE) { + $ret = str_replace('-', '', $this->token); + $ret = -hexdec($ret); + } else { + $ret = hexdec($ret); + } + } elseif (($this->flags & self::FLAG_NUMBER_APPROXIMATE) + || ($this->flags & self::FLAG_NUMBER_FLOAT) + ) { + $ret = (float) $ret; + } elseif (! ($this->flags & self::FLAG_NUMBER_BINARY)) { + $ret = (int) $ret; + } + + return $ret; + case self::TYPE_STRING: + // Trims quotes. + $str = $this->token; + $str = mb_substr($str, 1, -1, 'UTF-8'); + + // Removes surrounding quotes. + $quote = $this->token[0]; + $str = str_replace($quote . $quote, $quote, $str); + + // Finally unescapes the string. + // + // `stripcslashes` replaces escape sequences with their + // representation. + // + // NOTE: In MySQL, `\f` and `\v` have no representation, + // even they usually represent: form-feed and vertical tab. + $str = str_replace('\f', 'f', $str); + $str = str_replace('\v', 'v', $str); + $str = stripcslashes($str); + + return $str; + case self::TYPE_SYMBOL: + $str = $this->token; + if (isset($str[0]) && ($str[0] === '@')) { + // `mb_strlen($str)` must be used instead of `null` because + // in PHP 5.3- the `null` parameter isn't handled correctly. + $str = mb_substr( + $str, + (! empty($str[1]) && ($str[1] === '@')) ? 2 : 1, + mb_strlen($str), + 'UTF-8' + ); + } + if (isset($str[0]) && ($str[0] === ':')) { + $str = mb_substr($str, 1, mb_strlen($str), 'UTF-8'); + } + if (isset($str[0]) && (($str[0] === '`') + || ($str[0] === '"') || ($str[0] === '\'')) + ) { + $quote = $str[0]; + $str = str_replace($quote . $quote, $quote, $str); + $str = mb_substr($str, 1, -1, 'UTF-8'); + } + + return $str; + } + + return $this->token; + } + + /** + * Converts the token into an inline token by replacing tabs and new lines. + * + * @return string + */ + public function getInlineToken() + { + return str_replace( + array( + "\r", + "\n", + "\t", + ), + array( + '\r', + '\n', + '\t', + ), + $this->token + ); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/TokensList.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/TokensList.php new file mode 100755 index 0000000..4a3eec6 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/TokensList.php @@ -0,0 +1,203 @@ +tokens = $tokens; + if ($count === -1) { + $this->count = count($tokens); + } + } + } + + /** + * Builds an array of tokens by merging their raw value. + * + * @param string|Token[]|TokensList $list the tokens to be built + * + * @return string + */ + public static function build($list) + { + if (is_string($list)) { + return $list; + } + + if ($list instanceof self) { + $list = $list->tokens; + } + + $ret = ''; + if (is_array($list)) { + foreach ($list as $tok) { + $ret .= $tok->token; + } + } + + return $ret; + } + + /** + * Adds a new token. + * + * @param Token $token token to be added in list + */ + public function add(Token $token) + { + $this->tokens[$this->count++] = $token; + } + + /** + * Gets the next token. Skips any irrelevant token (whitespaces and + * comments). + * + * @return Token|null + */ + public function getNext() + { + for (; $this->idx < $this->count; ++$this->idx) { + if (($this->tokens[$this->idx]->type !== Token::TYPE_WHITESPACE) + && ($this->tokens[$this->idx]->type !== Token::TYPE_COMMENT) + ) { + return $this->tokens[$this->idx++]; + } + } + + return null; + } + + /** + * Gets the next token. + * + * @param int $type the type + * + * @return Token|null + */ + public function getNextOfType($type) + { + for (; $this->idx < $this->count; ++$this->idx) { + if ($this->tokens[$this->idx]->type === $type) { + return $this->tokens[$this->idx++]; + } + } + + return null; + } + + /** + * Gets the next token. + * + * @param int $type the type of the token + * @param string $value the value of the token + * + * @return Token|null + */ + public function getNextOfTypeAndValue($type, $value) + { + for (; $this->idx < $this->count; ++$this->idx) { + if (($this->tokens[$this->idx]->type === $type) + && ($this->tokens[$this->idx]->value === $value) + ) { + return $this->tokens[$this->idx++]; + } + } + + return null; + } + + /** + * Sets an value inside the container. + * + * @param int $offset the offset to be set + * @param Token $value the token to be saved + */ + public function offsetSet($offset, $value) + { + if ($offset === null) { + $this->tokens[$this->count++] = $value; + } else { + $this->tokens[$offset] = $value; + } + } + + /** + * Gets a value from the container. + * + * @param int $offset the offset to be returned + * + * @return Token + */ + public function offsetGet($offset) + { + return $offset < $this->count ? $this->tokens[$offset] : null; + } + + /** + * Checks if an offset was previously set. + * + * @param int $offset the offset to be checked + * + * @return bool + */ + public function offsetExists($offset) + { + return $offset < $this->count; + } + + /** + * Unsets the value of an offset. + * + * @param int $offset the offset to be unset + */ + public function offsetUnset($offset) + { + unset($this->tokens[$offset]); + --$this->count; + for ($i = $offset; $i < $this->count; ++$i) { + $this->tokens[$i] = $this->tokens[$i + 1]; + } + unset($this->tokens[$this->count]); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Translator.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Translator.php new file mode 100755 index 0000000..5f0c8f8 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Translator.php @@ -0,0 +1,69 @@ +setlocale( + self::$loader->detectlocale() + ); + + // Set default text domain + self::$loader->textdomain('sqlparser'); + + // Set path where to look for a domain + self::$loader->bindtextdomain('sqlparser', __DIR__ . '/../locale/'); + } + + if (is_null(self::$translator)) { + // Get translator + self::$translator = self::$loader->getTranslator(); + } + } + + /** + * Translates a string. + * + * @param string $msgid String to be translated + * + * @return string translated string (or original, if not found) + */ + public static function gettext($msgid) + { + if (! class_exists('\PhpMyAdmin\MoTranslator\Loader', true)) { + return $msgid; + } + + self::load(); + + return self::$translator->gettext($msgid); + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/UtfString.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/UtfString.php new file mode 100755 index 0000000..5127b5b --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/UtfString.php @@ -0,0 +1,213 @@ +str = $str; + $this->byteIdx = 0; + $this->charIdx = 0; + $this->byteLen = mb_strlen($str, '8bit'); + if (! mb_check_encoding($str, 'UTF-8')) { + $this->charLen = 0; + } else { + $this->charLen = mb_strlen($str, 'UTF-8'); + } + } + + /** + * Checks if the given offset exists. + * + * @param int $offset the offset to be checked + * + * @return bool + */ + public function offsetExists($offset) + { + return ($offset >= 0) && ($offset < $this->charLen); + } + + /** + * Gets the character at given offset. + * + * @param int $offset the offset to be returned + * + * @return string|null + */ + public function offsetGet($offset) + { + if (($offset < 0) || ($offset >= $this->charLen)) { + return null; + } + + $delta = $offset - $this->charIdx; + + if ($delta > 0) { + // Fast forwarding. + while ($delta-- > 0) { + $this->byteIdx += static::getCharLength($this->str[$this->byteIdx]); + ++$this->charIdx; + } + } elseif ($delta < 0) { + // Rewinding. + while ($delta++ < 0) { + do { + $byte = ord($this->str[--$this->byteIdx]); + } while (($byte >= 128) && ($byte < 192)); + --$this->charIdx; + } + } + + $bytesCount = static::getCharLength($this->str[$this->byteIdx]); + + $ret = ''; + for ($i = 0; $bytesCount-- > 0; ++$i) { + $ret .= $this->str[$this->byteIdx + $i]; + } + + return $ret; + } + + /** + * Sets the value of a character. + * + * @param int $offset the offset to be set + * @param string $value the value to be set + * + * @throws \Exception not implemented + */ + public function offsetSet($offset, $value) + { + throw new \Exception('Not implemented.'); + } + + /** + * Unsets an index. + * + * @param int $offset the value to be unset + * + * @throws \Exception not implemented + */ + public function offsetUnset($offset) + { + throw new \Exception('Not implemented.'); + } + + /** + * Gets the length of an UTF-8 character. + * + * According to RFC 3629, a UTF-8 character can have at most 4 bytes. + * However, this implementation supports UTF-8 characters containing up to 6 + * bytes. + * + * @param string $byte the byte to be analyzed + * + * @see https://tools.ietf.org/html/rfc3629 + * + * @return int + */ + public static function getCharLength($byte) + { + $byte = ord($byte); + if ($byte < 128) { + return 1; + } elseif ($byte < 224) { + return 2; + } elseif ($byte < 240) { + return 3; + } elseif ($byte < 248) { + return 4; + } elseif ($byte < 252) { + return 5; // unofficial + } + + return 6; // unofficial + } + + /** + * Returns the length in characters of the string. + * + * @return int + */ + public function length() + { + return $this->charLen; + } + + /** + * Returns the contained string. + * + * @return string + */ + public function __toString() + { + return $this->str; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/BufferedQuery.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/BufferedQuery.php new file mode 100755 index 0000000..02f16a0 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/BufferedQuery.php @@ -0,0 +1,412 @@ +options = array_merge( + array( + /* + * The starting delimiter. + * + * @var string + */ + 'delimiter' => ';', + + /* + * Whether `DELIMITER` statements should be parsed. + * + * @var bool + */ + 'parse_delimiter' => false, + + /* + * Whether a delimiter should be added at the end of the + * statement. + * + * @var bool + */ + 'add_delimiter' => false, + ), + $options + ); + + $this->query = $query; + $this->setDelimiter($this->options['delimiter']); + } + + /** + * Sets the delimiter. + * + * Used to update the length of it too. + * + * @param string $delimiter + */ + public function setDelimiter($delimiter) + { + $this->delimiter = $delimiter; + $this->delimiterLen = strlen($delimiter); + } + + /** + * Extracts a statement from the buffer. + * + * @param bool $end whether the end of the buffer was reached + * + * @return string|false + */ + public function extract($end = false) + { + /** + * The last parsed position. + * + * This is statically defined because it is not used outside anywhere + * outside this method and there is probably a (minor) performance + * improvement to it. + * + * @var int + */ + static $i = 0; + + if (empty($this->query)) { + return false; + } + + /** + * The length of the buffer. + * + * @var int + */ + $len = strlen($this->query); + + /** + * The last index of the string that is going to be parsed. + * + * There must be a few characters left in the buffer so the parser can + * avoid confusing some symbols that may have multiple meanings. + * + * For example, if the buffer ends in `-` that may be an operator or the + * beginning of a comment. + * + * Another example if the buffer ends in `DELIMITE`. The parser is going + * to require a few more characters because that may be a part of the + * `DELIMITER` keyword or just a column named `DELIMITE`. + * + * Those extra characters are required only if there is more data + * expected (the end of the buffer was not reached). + * + * @var int + */ + $loopLen = $end ? $len : $len - 16; + + for (; $i < $loopLen; ++$i) { + /* + * Handling backslash. + * + * Even if the next character is a special character that should be + * treated differently, because of the preceding backslash, it will + * be ignored. + */ + if ((($this->status & static::STATUS_COMMENT) === 0) && ($this->query[$i] === '\\')) { + $this->current .= $this->query[$i] . ($i + 1 < $len ? $this->query[++$i] : ''); + continue; + } + + /* + * Handling special parses statuses. + */ + if ($this->status === static::STATUS_STRING_SINGLE_QUOTES) { + // Single-quoted strings like 'foo'. + if ($this->query[$i] === '\'') { + $this->status = 0; + } + $this->current .= $this->query[$i]; + continue; + } elseif ($this->status === static::STATUS_STRING_DOUBLE_QUOTES) { + // Double-quoted strings like "bar". + if ($this->query[$i] === '"') { + $this->status = 0; + } + $this->current .= $this->query[$i]; + continue; + } elseif ($this->status === static::STATUS_STRING_BACKTICK) { + if ($this->query[$i] === '`') { + $this->status = 0; + } + $this->current .= $this->query[$i]; + continue; + } elseif (($this->status === static::STATUS_COMMENT_BASH) + || ($this->status === static::STATUS_COMMENT_SQL) + ) { + // Bash-like (#) or SQL-like (-- ) comments end in new line. + if ($this->query[$i] === "\n") { + $this->status = 0; + } + $this->current .= $this->query[$i]; + continue; + } elseif ($this->status === static::STATUS_COMMENT_C) { + // C-like comments end in */. + if (($this->query[$i - 1] === '*') && ($this->query[$i] === '/')) { + $this->status = 0; + } + $this->current .= $this->query[$i]; + continue; + } + + /* + * Checking if a string started. + */ + if ($this->query[$i] === '\'') { + $this->status = static::STATUS_STRING_SINGLE_QUOTES; + $this->current .= $this->query[$i]; + continue; + } elseif ($this->query[$i] === '"') { + $this->status = static::STATUS_STRING_DOUBLE_QUOTES; + $this->current .= $this->query[$i]; + continue; + } elseif ($this->query[$i] === '`') { + $this->status = static::STATUS_STRING_BACKTICK; + $this->current .= $this->query[$i]; + continue; + } + + /* + * Checking if a comment started. + */ + if ($this->query[$i] === '#') { + $this->status = static::STATUS_COMMENT_BASH; + $this->current .= $this->query[$i]; + continue; + } elseif ($i + 2 < $len) { + if (($this->query[$i] === '-') + && ($this->query[$i + 1] === '-') + && Context::isWhitespace($this->query[$i + 2])) { + $this->status = static::STATUS_COMMENT_SQL; + $this->current .= $this->query[$i]; + continue; + } elseif (($this->query[$i] === '/') + && ($this->query[$i + 1] === '*') + && ($this->query[$i + 2] !== '!')) { + $this->status = static::STATUS_COMMENT_C; + $this->current .= $this->query[$i]; + continue; + } + } + + /* + * Handling `DELIMITER` statement. + * + * The code below basically checks for + * `strtoupper(substr($this->query, $i, 9)) === 'DELIMITER'` + * + * This optimization makes the code about 3 times faster. + * + * `DELIMITER` is not being considered a keyword. The only context + * it has a special meaning is when it is the beginning of a + * statement. This is the reason for the last condition. + */ + if (($i + 9 < $len) + && (($this->query[$i] === 'D') || ($this->query[$i] === 'd')) + && (($this->query[$i + 1] === 'E') || ($this->query[$i + 1] === 'e')) + && (($this->query[$i + 2] === 'L') || ($this->query[$i + 2] === 'l')) + && (($this->query[$i + 3] === 'I') || ($this->query[$i + 3] === 'i')) + && (($this->query[$i + 4] === 'M') || ($this->query[$i + 4] === 'm')) + && (($this->query[$i + 5] === 'I') || ($this->query[$i + 5] === 'i')) + && (($this->query[$i + 6] === 'T') || ($this->query[$i + 6] === 't')) + && (($this->query[$i + 7] === 'E') || ($this->query[$i + 7] === 'e')) + && (($this->query[$i + 8] === 'R') || ($this->query[$i + 8] === 'r')) + && Context::isWhitespace($this->query[$i + 9]) + ) { + // Saving the current index to be able to revert any parsing + // done in this block. + $iBak = $i; + $i += 9; // Skipping `DELIMITER`. + + // Skipping whitespaces. + while (($i < $len) && Context::isWhitespace($this->query[$i])) { + ++$i; + } + + // Parsing the delimiter. + $delimiter = ''; + while (($i < $len) && (! Context::isWhitespace($this->query[$i]))) { + $delimiter .= $this->query[$i++]; + } + + // Checking if the delimiter definition ended. + if (($delimiter !== '') + && ((($i < $len) && Context::isWhitespace($this->query[$i])) + || (($i === $len) && $end)) + ) { + // Saving the delimiter. + $this->setDelimiter($delimiter); + + // Whether this statement should be returned or not. + $ret = ''; + if (! empty($this->options['parse_delimiter'])) { + // Appending the `DELIMITER` statement that was just + // found to the current statement. + $ret = trim( + $this->current . ' ' . substr($this->query, $iBak, $i - $iBak) + ); + } + + // Removing the statement that was just extracted from the + // query. + $this->query = substr($this->query, $i); + $i = 0; + + // Resetting the current statement. + $this->current = ''; + + return $ret; + } + + // Incomplete statement. Reverting + $i = $iBak; + + return false; + } + + /* + * Checking if the current statement finished. + * + * The first letter of the delimiter is being checked as an + * optimization. This code is almost as fast as the one above. + * + * There is no point in checking if two strings match if not even + * the first letter matches. + */ + if (($this->query[$i] === $this->delimiter[0]) + && (($this->delimiterLen === 1) + || (substr($this->query, $i, $this->delimiterLen) === $this->delimiter)) + ) { + // Saving the statement that just ended. + $ret = $this->current; + + // If needed, adds a delimiter at the end of the statement. + if (! empty($this->options['add_delimiter'])) { + $ret .= $this->delimiter; + } + + // Removing the statement that was just extracted from the + // query. + $this->query = substr($this->query, $i + $this->delimiterLen); + $i = 0; + + // Resetting the current statement. + $this->current = ''; + + // Returning the statement. + return trim($ret); + } + + /* + * Appending current character to current statement. + */ + $this->current .= $this->query[$i]; + } + + if ($end && ($i === $len)) { + // If the end of the buffer was reached, the buffer is emptied and + // the current statement that was extracted is returned. + $ret = $this->current; + + // Emptying the buffer. + $this->query = ''; + $i = 0; + + // Resetting the current statement. + $this->current = ''; + + // Returning the statement. + return trim($ret); + } + + return ''; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/CLI.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/CLI.php new file mode 100755 index 0000000..40be349 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/CLI.php @@ -0,0 +1,254 @@ +getopt( + 'hq:f:a', + $longopts + ); + if ($params === false) { + return false; + } + $this->mergeLongOpts($params, $longopts); + if (! isset($params['f'])) { + $params['f'] = 'cli'; + } + if (! in_array($params['f'], array('html', 'cli', 'text'))) { + echo "ERROR: Invalid value for format!\n"; + + return false; + } + + return $params; + } + + public function runHighlight() + { + $params = $this->parseHighlight(); + if ($params === false) { + return 1; + } + if (isset($params['h'])) { + $this->usageHighlight(); + + return 0; + } + if (!isset($params['q'])) { + if ($stdIn = $this->readStdin()) { + $params['q'] = $stdIn; + } + } + + if (isset($params['a'])) { + Context::setMode('ANSI_QUOTES'); + } + if (isset($params['q'])) { + echo Formatter::format( + $params['q'], + array('type' => $params['f']) + ); + echo "\n"; + + return 0; + } + echo "ERROR: Missing parameters!\n"; + $this->usageHighlight(); + + return 1; + } + + public function usageLint() + { + echo "Usage: lint-query --query SQL [--ansi]\n"; + echo " cat file.sql | lint-query\n"; + } + + public function parseLint() + { + $longopts = array( + 'help', + 'query:', + 'context:', + 'ansi' + ); + $params = $this->getopt( + 'hq:c:a', + $longopts + ); + $this->mergeLongOpts($params, $longopts); + + return $params; + } + + public function runLint() + { + $params = $this->parseLint(); + if ($params === false) { + return 1; + } + if (isset($params['h'])) { + $this->usageLint(); + + return 0; + } + if (isset($params['c'])) { + Context::load($params['c']); + } + if (!isset($params['q'])) { + if ($stdIn = $this->readStdin()) { + $params['q'] = $stdIn; + } + } + if (isset($params['a'])) { + Context::setMode('ANSI_QUOTES'); + } + + if (isset($params['q'])) { + $lexer = new Lexer($params['q'], false); + $parser = new Parser($lexer->list); + $errors = Error::get(array($lexer, $parser)); + if (count($errors) === 0) { + return 0; + } + $output = Error::format($errors); + echo implode("\n", $output); + echo "\n"; + + return 10; + } + echo "ERROR: Missing parameters!\n"; + $this->usageLint(); + + return 1; + } + + public function usageTokenize() + { + echo "Usage: tokenize-query --query SQL [--ansi]\n"; + echo " cat file.sql | tokenize-query\n"; + } + + public function parseTokenize() + { + $longopts = array( + 'help', + 'query:', + 'ansi' + ); + $params = $this->getopt( + 'hq:a', + $longopts + ); + $this->mergeLongOpts($params, $longopts); + + return $params; + } + + public function runTokenize() + { + $params = $this->parseTokenize(); + if ($params === false) { + return 1; + } + if (isset($params['h'])) { + $this->usageTokenize(); + + return 0; + } + if (!isset($params['q'])) { + if ($stdIn = $this->readStdin()) { + $params['q'] = $stdIn; + } + } + + if (isset($params['a'])) { + Context::setMode('ANSI_QUOTES'); + } + if (isset($params['q'])) { + $lexer = new Lexer($params['q'], false); + foreach ($lexer->list->tokens as $idx => $token) { + echo '[TOKEN ', $idx, "]\n"; + echo 'Type = ', $token->type, "\n"; + echo 'Flags = ', $token->flags, "\n"; + echo 'Value = '; + var_export($token->value); + echo "\n"; + echo 'Token = '; + var_export($token->token); + echo "\n"; + echo "\n"; + } + + return 0; + } + echo "ERROR: Missing parameters!\n"; + $this->usageTokenize(); + + return 1; + } + + public function readStdin() + { + $read = array(STDIN); + $write = array(); + $except = array(); + + // Assume there's nothing to be read from STDIN. + $stdin = null; + + // Try to read from STDIN. Wait 0.2 second before timing out. + $result = stream_select($read, $write, $except, 0, 2000); + + if ($result > 0) { + $stdin = stream_get_contents(STDIN); + } + + return $stdin; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Error.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Error.php new file mode 100755 index 0000000..20310a1 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Error.php @@ -0,0 +1,96 @@ +errors as $err) { + $ret[] = array( + $err->getMessage(), + $err->getCode(), + $err->ch, + $err->pos + ); + } + } elseif ($obj instanceof Parser) { + foreach ($obj->errors as $err) { + $ret[] = array( + $err->getMessage(), + $err->getCode(), + $err->token->token, + $err->token->position + ); + } + } + } + + return $ret; + } + + /** + * Formats the specified errors. + * + * @param array $errors the errors to be formatted + * @param string $format The format of an error. + * '$1$d' is replaced by the position of this error. + * '$2$s' is replaced by the error message. + * '$3$d' is replaced by the error code. + * '$4$s' is replaced by the string that caused the + * issue. + * '$5$d' is replaced by the position of the string. + * + * @return array + */ + public static function format( + $errors, + $format = '#%1$d: %2$s (near "%4$s" at position %5$d)' + ) { + $ret = array(); + + $i = 0; + foreach ($errors as $key => $err) { + $ret[$key] = sprintf( + $format, + ++$i, + $err[0], + $err[1], + htmlspecialchars($err[2]), + $err[3] + ); + } + + return $ret; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Formatter.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Formatter.php new file mode 100755 index 0000000..b608b73 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Formatter.php @@ -0,0 +1,742 @@ + true, + 'INSERT' => true + ); + + /** + * Clauses that must be inlined. + * + * These clauses usually are short and it's nicer to have them inline. + * + * @var array + */ + public static $INLINE_CLAUSES = array( + 'CREATE' => true, + 'INTO' => true, + 'LIMIT' => true, + 'PARTITION BY' => true, + 'PARTITION' => true, + 'PROCEDURE' => true, + 'SUBPARTITION BY' => true, + 'VALUES' => true + ); + + /** + * Constructor. + * + * @param array $options the formatting options + */ + public function __construct(array $options = array()) + { + $this->options = $this->getMergedOptions($options); + } + + /** + * The specified formatting options are merged with the default values. + * + * @param array $options + * + * @return array + */ + private function getMergedOptions(array $options) + { + $options = array_merge( + $this->getDefaultOptions(), + $options + ); + + if (isset($options['formats'])) { + $options['formats'] = self::mergeFormats($this->getDefaultFormats(), $options['formats']); + } else { + $options['formats'] = $this->getDefaultFormats(); + } + + if (is_null($options['line_ending'])) { + $options['line_ending'] = $options['type'] === 'html' ? '
      ' : "\n"; + } + + if (is_null($options['indentation'])) { + $options['indentation'] = $options['type'] === 'html' ? '    ' : ' '; + } + + // `parts_newline` requires `clause_newline` + $options['parts_newline'] &= $options['clause_newline']; + + return $options; + } + + /** + * The default formatting options. + * + * @return array + */ + protected function getDefaultOptions() + { + return array( + /* + * The format of the result. + * + * @var string The type ('text', 'cli' or 'html') + */ + 'type' => php_sapi_name() === 'cli' ? 'cli' : 'text', + + /* + * The line ending used. + * By default, for text this is "\n" and for HTML this is "
      ". + * + * @var string + */ + 'line_ending' => null, + + /* + * The string used for indentation. + * + * @var string + */ + 'indentation' => null, + + /* + * Whether comments should be removed or not. + * + * @var bool + */ + 'remove_comments' => false, + + /* + * Whether each clause should be on a new line. + * + * @var bool + */ + 'clause_newline' => true, + + /* + * Whether each part should be on a new line. + * Parts are delimited by brackets and commas. + * + * @var bool + */ + 'parts_newline' => true, + + /* + * Whether each part of each clause should be indented. + * + * @var bool + */ + 'indent_parts' => true + ); + } + + /** + * The styles used for HTML formatting. + * array($type, $flags, $span, $callback). + * + * @return array + */ + protected function getDefaultFormats() + { + return array( + array( + 'type' => Token::TYPE_KEYWORD, + 'flags' => Token::FLAG_KEYWORD_RESERVED, + 'html' => 'class="sql-reserved"', + 'cli' => "\x1b[35m", + 'function' => 'strtoupper', + ), + array( + 'type' => Token::TYPE_KEYWORD, + 'flags' => 0, + 'html' => 'class="sql-keyword"', + 'cli' => "\x1b[95m", + 'function' => 'strtoupper', + ), + array( + 'type' => Token::TYPE_COMMENT, + 'flags' => 0, + 'html' => 'class="sql-comment"', + 'cli' => "\x1b[37m", + 'function' => '', + ), + array( + 'type' => Token::TYPE_BOOL, + 'flags' => 0, + 'html' => 'class="sql-atom"', + 'cli' => "\x1b[36m", + 'function' => 'strtoupper', + ), + array( + 'type' => Token::TYPE_NUMBER, + 'flags' => 0, + 'html' => 'class="sql-number"', + 'cli' => "\x1b[92m", + 'function' => 'strtolower', + ), + array( + 'type' => Token::TYPE_STRING, + 'flags' => 0, + 'html' => 'class="sql-string"', + 'cli' => "\x1b[91m", + 'function' => '', + ), + array( + 'type' => Token::TYPE_SYMBOL, + 'flags' => Token::FLAG_SYMBOL_PARAMETER, + 'html' => 'class="sql-parameter"', + 'cli' => "\x1b[31m", + 'function' => '', + ), + array( + 'type' => Token::TYPE_SYMBOL, + 'flags' => 0, + 'html' => 'class="sql-variable"', + 'cli' => "\x1b[36m", + 'function' => '', + ) + ); + } + + private static function mergeFormats(array $formats, array $newFormats) + { + $added = array(); + $integers = array( + 'flags', + 'type' + ); + $strings = array( + 'html', + 'cli', + 'function' + ); + + /* Sanitize the array so that we do not have to care later */ + foreach ($newFormats as $j => $new) { + foreach ($integers as $name) { + if (! isset($new[$name])) { + $newFormats[$j][$name] = 0; + } + } + foreach ($strings as $name) { + if (! isset($new[$name])) { + $newFormats[$j][$name] = ''; + } + } + } + + /* Process changes to existing formats */ + foreach ($formats as $i => $original) { + foreach ($newFormats as $j => $new) { + if ($new['type'] === $original['type'] + && $original['flags'] === $new['flags'] + ) { + $formats[$i] = $new; + $added[] = $j; + } + } + } + + /* Add not already handled formats */ + foreach ($newFormats as $j => $new) { + if (! in_array($j, $added)) { + $formats[] = $new; + } + } + + return $formats; + } + + /** + * Formats the given list of tokens. + * + * @param TokensList $list the list of tokens + * + * @return string + */ + public function formatList($list) + { + /** + * The query to be returned. + * + * @var string + */ + $ret = ''; + + /** + * The indentation level. + * + * @var int + */ + $indent = 0; + + /** + * Whether the line ended. + * + * @var bool + */ + $lineEnded = false; + + /** + * Whether current group is short (no linebreaks). + * + * @var bool + */ + $shortGroup = false; + + /** + * The name of the last clause. + * + * @var string + */ + $lastClause = ''; + + /** + * A stack that keeps track of the indentation level every time a new + * block is found. + * + * @var array + */ + $blocksIndentation = array(); + + /** + * A stack that keeps track of the line endings every time a new block + * is found. + * + * @var array + */ + $blocksLineEndings = array(); + + /** + * Whether clause's options were formatted. + * + * @var bool + */ + $formattedOptions = false; + + /** + * Previously parsed token. + * + * @var Token|null + */ + $prev = null; + + // In order to be able to format the queries correctly, the next token + // must be taken into consideration. The loop below uses two pointers, + // `$prev` and `$curr` which store two consecutive tokens. + // Actually, at every iteration the previous token is being used. + for ($list->idx = 0; $list->idx < $list->count; ++$list->idx) { + /** + * Token parsed at this moment. + * + * @var Token + */ + $curr = $list->tokens[$list->idx]; + if ($list->idx + 1 < $list->count) { + $next = $list->tokens[$list->idx + 1]; + } else { + $next = null; + } + + if ($curr->type === Token::TYPE_WHITESPACE) { + // Keep linebreaks before and after comments + if (strpos($curr->token, "\n") !== false && ( + ($prev !== null && $prev->type === Token::TYPE_COMMENT) || + ($next !== null && $next->type === Token::TYPE_COMMENT) + ) + ) { + $lineEnded = true; + } + // Whitespaces are skipped because the formatter adds its own. + continue; + } + + if ($curr->type === Token::TYPE_COMMENT && $this->options['remove_comments']) { + // Skip Comments if option `remove_comments` is enabled + continue; + } + + // Checking if pointers were initialized. + if ($prev !== null) { + // Checking if a new clause started. + if (static::isClause($prev) !== false) { + $lastClause = $prev->value; + $formattedOptions = false; + } + + // The options of a clause should stay on the same line and everything that follows. + if ($this->options['parts_newline'] + && ! $formattedOptions + && empty(self::$INLINE_CLAUSES[$lastClause]) + && ( + $curr->type !== Token::TYPE_KEYWORD + || ( + $curr->type === Token::TYPE_KEYWORD + && $curr->flags & Token::FLAG_KEYWORD_FUNCTION + ) + ) + ) { + $formattedOptions = true; + $lineEnded = true; + ++$indent; + } + + // Checking if this clause ended. + if ($isClause = static::isClause($curr)) { + if (($isClause === 2 || $this->options['clause_newline']) && empty(self::$SHORT_CLAUSES[$lastClause])) { + $lineEnded = true; + if ($this->options['parts_newline'] && $indent > 0) { + --$indent; + } + } + } + + // Inline JOINs + if (($prev->type === Token::TYPE_KEYWORD && isset(JoinKeyword::$JOINS[$prev->value])) + || (in_array($curr->value, array('ON', 'USING'), true) && isset(JoinKeyword::$JOINS[$list->tokens[$list->idx - 2]->value])) + || isset($list->tokens[$list->idx - 4], JoinKeyword::$JOINS[$list->tokens[$list->idx - 4]->value]) + || isset($list->tokens[$list->idx - 6], JoinKeyword::$JOINS[$list->tokens[$list->idx - 6]->value]) + ) { + $lineEnded = false; + } + + // Indenting BEGIN ... END blocks. + if ($prev->type === Token::TYPE_KEYWORD && $prev->keyword === 'BEGIN') { + $lineEnded = true; + $blocksIndentation[] = $indent; + ++$indent; + } elseif ($curr->type === Token::TYPE_KEYWORD && $curr->keyword === 'END') { + $lineEnded = true; + $indent = array_pop($blocksIndentation); + } + + // Formatting fragments delimited by comma. + if ($prev->type === Token::TYPE_OPERATOR && $prev->value === ',') { + // Fragments delimited by a comma are broken into multiple + // pieces only if the clause is not inlined or this fragment + // is between brackets that are on new line. + if (end($blocksLineEndings) === true + || ( + empty(self::$INLINE_CLAUSES[$lastClause]) + && ! $shortGroup + && $this->options['parts_newline'] + ) + ) { + $lineEnded = true; + } + } + + // Handling brackets. + // Brackets are indented only if the length of the fragment between + // them is longer than 30 characters. + if ($prev->type === Token::TYPE_OPERATOR && $prev->value === '(') { + $blocksIndentation[] = $indent; + $shortGroup = true; + if (static::getGroupLength($list) > 30) { + ++$indent; + $lineEnded = true; + $shortGroup = false; + } + $blocksLineEndings[] = $lineEnded; + } elseif ($curr->type === Token::TYPE_OPERATOR && $curr->value === ')') { + $indent = array_pop($blocksIndentation); + $lineEnded |= array_pop($blocksLineEndings); + $shortGroup = false; + } + + // Adding the token. + $ret .= $this->toString($prev); + + // Finishing the line. + if ($lineEnded) { + $ret .= $this->options['line_ending'] + . str_repeat($this->options['indentation'], $indent); + + $lineEnded = false; + } else { + // If the line ended there is no point in adding whitespaces. + // Also, some tokens do not have spaces before or after them. + if (// A space after delimiters that are longer than 2 characters. + $prev->keyword === 'DELIMITER' + || ! ( + ($prev->type === Token::TYPE_OPERATOR && ($prev->value === '.' || $prev->value === '(')) + // No space after . ( + || ($curr->type === Token::TYPE_OPERATOR && ($curr->value === '.' || $curr->value === ',' || $curr->value === '(' || $curr->value === ')')) + // No space before . , ( ) + || $curr->type === Token::TYPE_DELIMITER && mb_strlen($curr->value, 'UTF-8') < 2 + ) + ) { + $ret .= ' '; + } + } + } + + // Iteration finished, consider current token as previous. + $prev = $curr; + } + + if ($this->options['type'] === 'cli') { + return $ret . "\x1b[0m"; + } + + return $ret; + } + + public function escapeConsole($string) + { + return str_replace( + array( + "\x00", + "\x01", + "\x02", + "\x03", + "\x04", + "\x05", + "\x06", + "\x07", + "\x08", + "\x09", + "\x0A", + "\x0B", + "\x0C", + "\x0D", + "\x0E", + "\x0F", + "\x10", + "\x11", + "\x12", + "\x13", + "\x14", + "\x15", + "\x16", + "\x17", + "\x18", + "\x19", + "\x1A", + "\x1B", + "\x1C", + "\x1D", + "\x1E", + "\x1F", + ), + array( + '\x00', + '\x01', + '\x02', + '\x03', + '\x04', + '\x05', + '\x06', + '\x07', + '\x08', + '\x09', + '\x0A', + '\x0B', + '\x0C', + '\x0D', + '\x0E', + '\x0F', + '\x10', + '\x11', + '\x12', + '\x13', + '\x14', + '\x15', + '\x16', + '\x17', + '\x18', + '\x19', + '\x1A', + '\x1B', + '\x1C', + '\x1D', + '\x1E', + '\x1F', + ), + $string + ); + } + + /** + * Tries to print the query and returns the result. + * + * @param Token $token the token to be printed + * + * @return string + */ + public function toString($token) + { + $text = $token->token; + static $prev; + + foreach ($this->options['formats'] as $format) { + if ($token->type === $format['type'] + && ($token->flags & $format['flags']) === $format['flags'] + ) { + // Running transformation function. + if (! empty($format['function'])) { + $func = $format['function']; + $text = $func($text); + } + + // Formatting HTML. + if ($this->options['type'] === 'html') { + return '' . htmlspecialchars($text, ENT_NOQUOTES) . ''; + } elseif ($this->options['type'] === 'cli') { + if ($prev !== $format['cli']) { + $prev = $format['cli']; + + return $format['cli'] . $this->escapeConsole($text); + } + + return $this->escapeConsole($text); + } + + break; + } + } + + if ($this->options['type'] === 'cli') { + if ($prev !== "\x1b[39m") { + $prev = "\x1b[39m"; + + return "\x1b[39m" . $this->escapeConsole($text); + } + + return $this->escapeConsole($text); + } elseif ($this->options['type'] === 'html') { + return htmlspecialchars($text, ENT_NOQUOTES); + } + + return $text; + } + + /** + * Formats a query. + * + * @param string $query The query to be formatted + * @param array $options the formatting options + * + * @return string the formatted string + */ + public static function format($query, array $options = array()) + { + $lexer = new Lexer($query); + $formatter = new self($options); + + return $formatter->formatList($lexer->list); + } + + /** + * Computes the length of a group. + * + * A group is delimited by a pair of brackets. + * + * @param TokensList $list the list of tokens + * + * @return int + */ + public static function getGroupLength($list) + { + /** + * The number of opening brackets found. + * This counter starts at one because by the time this function called, + * the list already advanced one position and the opening bracket was + * already parsed. + * + * @var int + */ + $count = 1; + + /** + * The length of this group. + * + * @var int + */ + $length = 0; + + for ($idx = $list->idx; $idx < $list->count; ++$idx) { + // Counting the brackets. + if ($list->tokens[$idx]->type === Token::TYPE_OPERATOR) { + if ($list->tokens[$idx]->value === '(') { + ++$count; + } elseif ($list->tokens[$idx]->value === ')') { + --$count; + if ($count === 0) { + break; + } + } + } + + // Keeping track of this group's length. + $length += mb_strlen($list->tokens[$idx]->value, 'UTF-8'); + } + + return $length; + } + + /** + * Checks if a token is a statement or a clause inside a statement. + * + * @param Token $token the token to be checked + * + * @return int|bool + */ + public static function isClause($token) + { + if (($token->type === Token::TYPE_KEYWORD && isset(Parser::$STATEMENT_PARSERS[$token->keyword])) + || ($token->type === Token::TYPE_NONE && strtoupper($token->token) === 'DELIMITER') + ) { + return 2; + } elseif ($token->type === Token::TYPE_KEYWORD && isset(Parser::$KEYWORD_PARSERS[$token->keyword]) + ) { + return 1; + } + + return false; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Misc.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Misc.php new file mode 100755 index 0000000..7e6297f --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Misc.php @@ -0,0 +1,108 @@ +expr) + || empty($statement->from) + ) { + return array(); + } + + $retval = array(); + + $tables = array(); + + /** + * Expressions that may contain aliases. + * These are extracted from `FROM` and `JOIN` keywords. + * + * @var Expression[] + */ + $expressions = $statement->from; + + // Adding expressions from JOIN. + if (! empty($statement->join)) { + foreach ($statement->join as $join) { + $expressions[] = $join->expr; + } + } + + foreach ($expressions as $expr) { + if (! isset($expr->table) || ($expr->table === '')) { + continue; + } + + $thisDb = (isset($expr->database) && ($expr->database !== '')) ? + $expr->database : $database; + + if (! isset($retval[$thisDb])) { + $retval[$thisDb] = array( + 'alias' => null, + 'tables' => array() + ); + } + + if (! isset($retval[$thisDb]['tables'][$expr->table])) { + $retval[$thisDb]['tables'][$expr->table] = array( + 'alias' => (isset($expr->alias) && ($expr->alias !== '')) ? + $expr->alias : null, + 'columns' => array() + ); + } + + if (! isset($tables[$thisDb])) { + $tables[$thisDb] = array(); + } + $tables[$thisDb][$expr->alias] = $expr->table; + } + + foreach ($statement->expr as $expr) { + if (! isset($expr->column, $expr->alias) || ($expr->column === '') || ($expr->alias === '') + ) { + continue; + } + + $thisDb = (isset($expr->database) && ($expr->database !== '')) ? + $expr->database : $database; + + if (isset($expr->table) && ($expr->table !== '')) { + $thisTable = isset($tables[$thisDb][$expr->table]) ? + $tables[$thisDb][$expr->table] : $expr->table; + $retval[$thisDb]['tables'][$thisTable]['columns'][$expr->column] = $expr->alias; + } else { + foreach ($retval[$thisDb]['tables'] as &$table) { + $table['columns'][$expr->column] = $expr->alias; + } + } + } + + return $retval; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Query.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Query.php new file mode 100755 index 0000000..9494d96 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Query.php @@ -0,0 +1,875 @@ + false, + + /* + * drop ... DATABASE ... + */ + 'drop_database' => false, + + /* + * ... GROUP BY ... + */ + 'group' => false, + + /* + * ... HAVING ... + */ + 'having' => false, + + /* + * INSERT ... + * or + * REPLACE ... + * or + * DELETE ... + */ + 'is_affected' => false, + + /* + * select ... PROCEDURE ANALYSE( ... ) ... + */ + 'is_analyse' => false, + + /* + * select COUNT( ... ) ... + */ + 'is_count' => false, + + /* + * DELETE ... + */ + 'is_delete' => false, // @deprecated; use `querytype` + + /* + * EXPLAIN ... + */ + 'is_explain' => false, // @deprecated; use `querytype` + + /* + * select ... INTO OUTFILE ... + */ + 'is_export' => false, + + /* + * select FUNC( ... ) ... + */ + 'is_func' => false, + + /* + * select ... GROUP BY ... + * or + * select ... HAVING ... + */ + 'is_group' => false, + + /* + * INSERT ... + * or + * REPLACE ... + * or + * LOAD DATA ... + */ + 'is_insert' => false, + + /* + * ANALYZE ... + * or + * CHECK ... + * or + * CHECKSUM ... + * or + * OPTIMIZE ... + * or + * REPAIR ... + */ + 'is_maint' => false, + + /* + * CALL ... + */ + 'is_procedure' => false, + + /* + * REPLACE ... + */ + 'is_replace' => false, // @deprecated; use `querytype` + + /* + * SELECT ... + */ + 'is_select' => false, // @deprecated; use `querytype` + + /* + * SHOW ... + */ + 'is_show' => false, // @deprecated; use `querytype` + + /* + * Contains a subquery. + */ + 'is_subquery' => false, + + /* + * ... JOIN ... + */ + 'join' => false, + + /* + * ... LIMIT ... + */ + 'limit' => false, + + /* + * TODO + */ + 'offset' => false, + + /* + * ... ORDER ... + */ + 'order' => false, + + /* + * The type of the query (which is usually the first keyword of + * the statement). + */ + 'querytype' => false, + + /* + * Whether a page reload is required. + */ + 'reload' => false, + + /* + * SELECT ... FROM ... + */ + 'select_from' => false, + + /* + * ... UNION ... + */ + 'union' => false + ); + + /** + * Gets an array with flags select statement has. + * + * @param SelectStatement $statement the statement to be processed + * @param array $flags flags set so far + * + * @return array + */ + private static function getFlagsSelect($statement, $flags) + { + $flags['querytype'] = 'SELECT'; + $flags['is_select'] = true; + + if (! empty($statement->from)) { + $flags['select_from'] = true; + } + + if ($statement->options->has('DISTINCT')) { + $flags['distinct'] = true; + } + + if (! empty($statement->group) || ! empty($statement->having)) { + $flags['is_group'] = true; + } + + if (! empty($statement->into) + && ($statement->into->type === 'OUTFILE') + ) { + $flags['is_export'] = true; + } + + $expressions = $statement->expr; + if (! empty($statement->join)) { + foreach ($statement->join as $join) { + $expressions[] = $join->expr; + } + } + + foreach ($expressions as $expr) { + if (! empty($expr->function)) { + if ($expr->function === 'COUNT') { + $flags['is_count'] = true; + } elseif (in_array($expr->function, static::$FUNCTIONS)) { + $flags['is_func'] = true; + } + } + if (! empty($expr->subquery)) { + $flags['is_subquery'] = true; + } + } + + if (! empty($statement->procedure) + && ($statement->procedure->name === 'ANALYSE') + ) { + $flags['is_analyse'] = true; + } + + if (! empty($statement->group)) { + $flags['group'] = true; + } + + if (! empty($statement->having)) { + $flags['having'] = true; + } + + if (! empty($statement->union)) { + $flags['union'] = true; + } + + if (! empty($statement->join)) { + $flags['join'] = true; + } + + return $flags; + } + + /** + * Gets an array with flags this statement has. + * + * @param Statement|null $statement the statement to be processed + * @param bool $all if `false`, false values will not be included + * + * @return array + */ + public static function getFlags($statement, $all = false) + { + $flags = array('querytype' => false); + if ($all) { + $flags = self::$ALLFLAGS; + } + + if ($statement instanceof AlterStatement) { + $flags['querytype'] = 'ALTER'; + $flags['reload'] = true; + } elseif ($statement instanceof CreateStatement) { + $flags['querytype'] = 'CREATE'; + $flags['reload'] = true; + } elseif ($statement instanceof AnalyzeStatement) { + $flags['querytype'] = 'ANALYZE'; + $flags['is_maint'] = true; + } elseif ($statement instanceof CheckStatement) { + $flags['querytype'] = 'CHECK'; + $flags['is_maint'] = true; + } elseif ($statement instanceof ChecksumStatement) { + $flags['querytype'] = 'CHECKSUM'; + $flags['is_maint'] = true; + } elseif ($statement instanceof OptimizeStatement) { + $flags['querytype'] = 'OPTIMIZE'; + $flags['is_maint'] = true; + } elseif ($statement instanceof RepairStatement) { + $flags['querytype'] = 'REPAIR'; + $flags['is_maint'] = true; + } elseif ($statement instanceof CallStatement) { + $flags['querytype'] = 'CALL'; + $flags['is_procedure'] = true; + } elseif ($statement instanceof DeleteStatement) { + $flags['querytype'] = 'DELETE'; + $flags['is_delete'] = true; + $flags['is_affected'] = true; + } elseif ($statement instanceof DropStatement) { + $flags['querytype'] = 'DROP'; + $flags['reload'] = true; + + if ($statement->options->has('DATABASE') + || $statement->options->has('SCHEMA') + ) { + $flags['drop_database'] = true; + } + } elseif ($statement instanceof ExplainStatement) { + $flags['querytype'] = 'EXPLAIN'; + $flags['is_explain'] = true; + } elseif ($statement instanceof InsertStatement) { + $flags['querytype'] = 'INSERT'; + $flags['is_affected'] = true; + $flags['is_insert'] = true; + } elseif ($statement instanceof LoadStatement) { + $flags['querytype'] = 'LOAD'; + $flags['is_affected'] = true; + $flags['is_insert'] = true; + } elseif ($statement instanceof ReplaceStatement) { + $flags['querytype'] = 'REPLACE'; + $flags['is_affected'] = true; + $flags['is_replace'] = true; + $flags['is_insert'] = true; + } elseif ($statement instanceof SelectStatement) { + $flags = self::getFlagsSelect($statement, $flags); + } elseif ($statement instanceof ShowStatement) { + $flags['querytype'] = 'SHOW'; + $flags['is_show'] = true; + } elseif ($statement instanceof UpdateStatement) { + $flags['querytype'] = 'UPDATE'; + $flags['is_affected'] = true; + } elseif ($statement instanceof SetStatement) { + $flags['querytype'] = 'SET'; + } + + if (($statement instanceof SelectStatement) + || ($statement instanceof UpdateStatement) + || ($statement instanceof DeleteStatement) + ) { + if (! empty($statement->limit)) { + $flags['limit'] = true; + } + if (! empty($statement->order)) { + $flags['order'] = true; + } + } + + return $flags; + } + + /** + * Parses a query and gets all information about it. + * + * @param string $query the query to be parsed + * + * @return array The array returned is the one returned by + * `static::getFlags()`, with the following keys added: + * - parser - the parser used to analyze the query; + * - statement - the first statement resulted from parsing; + * - select_tables - the real name of the tables selected; + * if there are no table names in the `SELECT` + * expressions, the table names are fetched from the + * `FROM` expressions + * - select_expr - selected expressions + */ + public static function getAll($query) + { + $parser = new Parser($query); + + if (empty($parser->statements[0])) { + return static::getFlags(null, true); + } + + $statement = $parser->statements[0]; + + $ret = static::getFlags($statement, true); + + $ret['parser'] = $parser; + $ret['statement'] = $statement; + + if ($statement instanceof SelectStatement) { + $ret['select_tables'] = array(); + $ret['select_expr'] = array(); + + // Finding tables' aliases and their associated real names. + $tableAliases = array(); + foreach ($statement->from as $expr) { + if (isset($expr->table, $expr->alias) && ($expr->table !== '') && ($expr->alias !== '') + ) { + $tableAliases[$expr->alias] = array( + $expr->table, + isset($expr->database) ? $expr->database : null + ); + } + } + + // Trying to find selected tables only from the select expression. + // Sometimes, this is not possible because the tables aren't defined + // explicitly (e.g. SELECT * FROM film, SELECT film_id FROM film). + foreach ($statement->expr as $expr) { + if (isset($expr->table) && ($expr->table !== '')) { + if (isset($tableAliases[$expr->table])) { + $arr = $tableAliases[$expr->table]; + } else { + $arr = array( + $expr->table, + (isset($expr->database) && ($expr->database !== '')) ? + $expr->database : null + ); + } + if (! in_array($arr, $ret['select_tables'])) { + $ret['select_tables'][] = $arr; + } + } else { + $ret['select_expr'][] = $expr->expr; + } + } + + // If no tables names were found in the SELECT clause or if there + // are expressions like * or COUNT(*), etc. tables names should be + // extracted from the FROM clause. + if (empty($ret['select_tables'])) { + foreach ($statement->from as $expr) { + if (isset($expr->table) && ($expr->table !== '')) { + $arr = array( + $expr->table, + (isset($expr->database) && ($expr->database !== '')) ? + $expr->database : null + ); + if (! in_array($arr, $ret['select_tables'])) { + $ret['select_tables'][] = $arr; + } + } + } + } + } + + return $ret; + } + + /** + * Gets a list of all tables used in this statement. + * + * @param Statement $statement statement to be scanned + * + * @return array + */ + public static function getTables($statement) + { + $expressions = array(); + + if (($statement instanceof InsertStatement) + || ($statement instanceof ReplaceStatement) + ) { + $expressions = array($statement->into->dest); + } elseif ($statement instanceof UpdateStatement) { + $expressions = $statement->tables; + } elseif (($statement instanceof SelectStatement) + || ($statement instanceof DeleteStatement) + ) { + $expressions = $statement->from; + } elseif (($statement instanceof AlterStatement) + || ($statement instanceof TruncateStatement) + ) { + $expressions = array($statement->table); + } elseif ($statement instanceof DropStatement) { + if (! $statement->options->has('TABLE')) { + // No tables are dropped. + return array(); + } + $expressions = $statement->fields; + } elseif ($statement instanceof RenameStatement) { + foreach ($statement->renames as $rename) { + $expressions[] = $rename->old; + } + } + + $ret = array(); + foreach ($expressions as $expr) { + if (! empty($expr->table)) { + $expr->expr = null; // Force rebuild. + $expr->alias = null; // Aliases are not required. + $ret[] = Expression::build($expr); + } + } + + return $ret; + } + + /** + * Gets a specific clause. + * + * @param Statement $statement the parsed query that has to be modified + * @param TokensList $list the list of tokens + * @param string $clause the clause to be returned + * @param int|string $type The type of the search. + * If int, + * -1 for everything that was before + * 0 only for the clause + * 1 for everything after + * If string, the name of the first clause that + * should not be included. + * @param bool $skipFirst whether to skip the first keyword in clause + * + * @return string + */ + public static function getClause($statement, $list, $clause, $type = 0, $skipFirst = true) + { + /** + * The index of the current clause. + * + * @var int + */ + $currIdx = 0; + + /** + * The count of brackets. + * We keep track of them so we won't insert the clause in a subquery. + * + * @var int + */ + $brackets = 0; + + /** + * The string to be returned. + * + * @var string + */ + $ret = ''; + + /** + * The clauses of this type of statement and their index. + * + * @var array + */ + $clauses = array_flip(array_keys($statement->getClauses())); + + /** + * Lexer used for lexing the clause. + * + * @var Lexer + */ + $lexer = new Lexer($clause); + + /** + * The type of this clause. + * + * @var string + */ + $clauseType = $lexer->list->getNextOfType(Token::TYPE_KEYWORD)->keyword; + + /** + * The index of this clause. + * + * @var int + */ + $clauseIdx = isset($clauses[$clauseType]) ? $clauses[$clauseType] : -1; + + $firstClauseIdx = $clauseIdx; + $lastClauseIdx = $clauseIdx; + + // Determining the behavior of this function. + if ($type === -1) { + $firstClauseIdx = -1; // Something small enough. + $lastClauseIdx = $clauseIdx - 1; + } elseif ($type === 1) { + $firstClauseIdx = $clauseIdx + 1; + $lastClauseIdx = 10000; // Something big enough. + } elseif (is_string($type) && isset($clauses[$type])) { + if ($clauses[$type] > $clauseIdx) { + $firstClauseIdx = $clauseIdx + 1; + $lastClauseIdx = $clauses[$type] - 1; + } else { + $firstClauseIdx = $clauses[$type] + 1; + $lastClauseIdx = $clauseIdx - 1; + } + } + + // This option is unavailable for multiple clauses. + if ($type !== 0) { + $skipFirst = false; + } + + for ($i = $statement->first; $i <= $statement->last; ++$i) { + $token = $list->tokens[$i]; + + if ($token->type === Token::TYPE_COMMENT) { + continue; + } + + if ($token->type === Token::TYPE_OPERATOR) { + if ($token->value === '(') { + ++$brackets; + } elseif ($token->value === ')') { + --$brackets; + } + } + + if ($brackets === 0) { + // Checking if the section was changed. + if (($token->type === Token::TYPE_KEYWORD) + && isset($clauses[$token->keyword]) + && ($clauses[$token->keyword] >= $currIdx) + ) { + $currIdx = $clauses[$token->keyword]; + if ($skipFirst && ($currIdx === $clauseIdx)) { + // This token is skipped (not added to the old + // clause) because it will be replaced. + continue; + } + } + } + + if (($firstClauseIdx <= $currIdx) && ($currIdx <= $lastClauseIdx)) { + $ret .= $token->token; + } + } + + return trim($ret); + } + + /** + * Builds a query by rebuilding the statement from the tokens list supplied + * and replaces a clause. + * + * It is a very basic version of a query builder. + * + * @param Statement $statement the parsed query that has to be modified + * @param TokensList $list the list of tokens + * @param string $old The type of the clause that should be + * replaced. This can be an entire clause. + * @param string $new The new clause. If this parameter is omitted + * it is considered to be equal with `$old`. + * @param bool $onlyType whether only the type of the clause should + * be replaced or the entire clause + * + * @return string + */ + public static function replaceClause($statement, $list, $old, $new = null, $onlyType = false) + { + // TODO: Update the tokens list and the statement. + + if ($new === null) { + $new = $old; + } + + if ($onlyType) { + return static::getClause($statement, $list, $old, -1, false) . ' ' . + $new . ' ' . static::getClause($statement, $list, $old, 0) . ' ' . + static::getClause($statement, $list, $old, 1, false); + } + + return static::getClause($statement, $list, $old, -1, false) . ' ' . + $new . ' ' . static::getClause($statement, $list, $old, 1, false); + } + + /** + * Builds a query by rebuilding the statement from the tokens list supplied + * and replaces multiple clauses. + * + * @param Statement $statement the parsed query that has to be modified + * @param TokensList $list the list of tokens + * @param array $ops Clauses to be replaced. Contains multiple + * arrays having two values: array($old, $new). + * Clauses must be sorted. + * + * @return string + */ + public static function replaceClauses($statement, $list, array $ops) + { + $count = count($ops); + + // Nothing to do. + if ($count === 0) { + return ''; + } + + /** + * Value to be returned. + * + * @var string + */ + $ret = ''; + + // If there is only one clause, `replaceClause()` should be used. + if ($count === 1) { + return static::replaceClause( + $statement, + $list, + $ops[0][0], + $ops[0][1] + ); + } + + // Adding everything before first replacement. + $ret .= static::getClause($statement, $list, $ops[0][0], -1) . ' '; + + // Doing replacements. + foreach ($ops as $i => $clause) { + $ret .= $clause[1] . ' '; + + // Adding everything between this and next replacement. + if ($i + 1 !== $count) { + $ret .= static::getClause($statement, $list, $clause[0], $ops[$i + 1][0]) . ' '; + } + } + + // Adding everything after the last replacement. + $ret .= static::getClause($statement, $list, $ops[$count - 1][0], 1); + + return $ret; + } + + /** + * Gets the first full statement in the query. + * + * @param string $query the query to be analyzed + * @param string $delimiter the delimiter to be used + * + * @return array array containing the first full query, the + * remaining part of the query and the last + * delimiter + */ + public static function getFirstStatement($query, $delimiter = null) + { + $lexer = new Lexer($query, false, $delimiter); + $list = $lexer->list; + + /** + * Whether a full statement was found. + * + * @var bool + */ + $fullStatement = false; + + /** + * The first full statement. + * + * @var string + */ + $statement = ''; + + for ($list->idx = 0; $list->idx < $list->count; ++$list->idx) { + $token = $list->tokens[$list->idx]; + + if ($token->type === Token::TYPE_COMMENT) { + continue; + } + + $statement .= $token->token; + + if (($token->type === Token::TYPE_DELIMITER) && ! empty($token->token)) { + $delimiter = $token->token; + $fullStatement = true; + break; + } + } + + // No statement was found so we return the entire query as being the + // remaining part. + if (! $fullStatement) { + return array( + null, + $query, + $delimiter + ); + } + + // At least one query was found so we have to build the rest of the + // remaining query. + $query = ''; + for (++$list->idx; $list->idx < $list->count; ++$list->idx) { + $query .= $list->tokens[$list->idx]->token; + } + + return array( + trim($statement), + $query, + $delimiter + ); + } + + /** + * Gets a starting offset of a specific clause. + * + * @param Statement $statement the parsed query that has to be modified + * @param TokensList $list the list of tokens + * @param string $clause the clause to be returned + * + * @return int + */ + public static function getClauseStartOffset($statement, $list, $clause) + { + /** + * The count of brackets. + * We keep track of them so we won't insert the clause in a subquery. + * + * @var int + */ + $brackets = 0; + + /** + * The clauses of this type of statement and their index. + * + * @var array + */ + $clauses = array_flip(array_keys($statement->getClauses())); + + for ($i = $statement->first; $i <= $statement->last; ++$i) { + $token = $list->tokens[$i]; + + if ($token->type === Token::TYPE_COMMENT) { + continue; + } + + if ($token->type === Token::TYPE_OPERATOR) { + if ($token->value === '(') { + ++$brackets; + } elseif ($token->value === ')') { + --$brackets; + } + } + + if ($brackets === 0) { + if (($token->type === Token::TYPE_KEYWORD) + && isset($clauses[$token->keyword]) + && ($clause === $token->keyword) + ) { + return $i; + } elseif ($token->keyword === 'UNION') { + return -1; + } + } + } + + return -1; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Routine.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Routine.php new file mode 100755 index 0000000..9b075dc --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Routine.php @@ -0,0 +1,143 @@ +list); + + if ($type === null) { + return array( + '', + '', + '', + '', + '' + ); + } + + $options = array(); + foreach ($type->options->options as $opt) { + $options[] = is_string($opt) ? $opt : $opt['value']; + } + + return array( + '', + '', + $type->name, + implode(',', $type->parameters), + implode(' ', $options) + ); + } + + /** + * Parses a parameter of a routine. + * + * @param string $param parameter's definition + * + * @return array + */ + public static function getParameter($param) + { + $lexer = new Lexer('(' . $param . ')'); + + // A dummy parser is used for error reporting. + $param = ParameterDefinition::parse(new Parser(), $lexer->list); + + if (empty($param[0])) { + return array( + '', + '', + '', + '', + '' + ); + } + + $param = $param[0]; + + $options = array(); + foreach ($param->type->options->options as $opt) { + $options[] = is_string($opt) ? $opt : $opt['value']; + } + + return array( + empty($param->inOut) ? '' : $param->inOut, + $param->name, + $param->type->name, + implode(',', $param->type->parameters), + implode(' ', $options) + ); + } + + /** + * Gets the parameters of a routine from the parse tree. + * + * @param CreateStatement $statement the statement to be processed + * + * @return array + */ + public static function getParameters($statement) + { + $retval = array( + 'num' => 0, + 'dir' => array(), + 'name' => array(), + 'type' => array(), + 'length' => array(), + 'length_arr' => array(), + 'opts' => array() + ); + + if (! empty($statement->parameters)) { + $idx = 0; + foreach ($statement->parameters as $param) { + $retval['dir'][$idx] = $param->inOut; + $retval['name'][$idx] = $param->name; + $retval['type'][$idx] = $param->type->name; + $retval['length'][$idx] = implode(',', $param->type->parameters); + $retval['length_arr'][$idx] = $param->type->parameters; + $retval['opts'][$idx] = array(); + foreach ($param->type->options->options as $opt) { + $retval['opts'][$idx][] = is_string($opt) ? + $opt : $opt['value']; + } + $retval['opts'][$idx] = implode(' ', $retval['opts'][$idx]); + ++$idx; + } + + $retval['num'] = $idx; + } + + return $retval; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Table.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Table.php new file mode 100755 index 0000000..6679062 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Table.php @@ -0,0 +1,138 @@ +fields) + || (! is_array($statement->fields)) + || (! $statement->options->has('TABLE')) + ) { + return array(); + } + + $ret = array(); + + foreach ($statement->fields as $field) { + if (empty($field->key) || ($field->key->type !== 'FOREIGN KEY')) { + continue; + } + + $columns = array(); + foreach ($field->key->columns as $column) { + if (! isset($column['name'])) { + continue; + } + $columns[] = $column['name']; + } + + $tmp = array( + 'constraint' => $field->name, + 'index_list' => $columns + ); + + if (! empty($field->references)) { + $tmp['ref_db_name'] = $field->references->table->database; + $tmp['ref_table_name'] = $field->references->table->table; + $tmp['ref_index_list'] = $field->references->columns; + + if ($opt = $field->references->options->has('ON UPDATE')) { + $tmp['on_update'] = str_replace(' ', '_', $opt); + } + + if ($opt = $field->references->options->has('ON DELETE')) { + $tmp['on_delete'] = str_replace(' ', '_', $opt); + } + + // if (($opt = $field->references->options->has('MATCH'))) { + // $tmp['match'] = str_replace(' ', '_', $opt); + // } + } + + $ret[] = $tmp; + } + + return $ret; + } + + /** + * Gets fields of the table. + * + * @param CreateStatement $statement the statement to be processed + * + * @return array + */ + public static function getFields($statement) + { + if (empty($statement->fields) + || (! is_array($statement->fields)) + || (! $statement->options->has('TABLE')) + ) { + return array(); + } + + $ret = array(); + + foreach ($statement->fields as $field) { + // Skipping keys. + if (empty($field->type)) { + continue; + } + + $ret[$field->name] = array( + 'type' => $field->type->name, + 'timestamp_not_null' => false + ); + + if ($field->options) { + if ($field->type->name === 'TIMESTAMP') { + if ($field->options->has('NOT NULL')) { + $ret[$field->name]['timestamp_not_null'] = true; + } + } + + if ($option = $field->options->has('DEFAULT')) { + $ret[$field->name]['default_value'] = $option; + if ($option === 'CURRENT_TIMESTAMP') { + $ret[$field->name]['default_current_timestamp'] = true; + } + } + + if ($option = $field->options->has('ON UPDATE')) { + if ($option === 'CURRENT_TIMESTAMP') { + $ret[$field->name]['on_update_current_timestamp'] = true; + } + } + + if ($option = $field->options->has('AS')) { + $ret[$field->name]['generated'] = true; + $ret[$field->name]['expr'] = $option; + } + } + } + + return $ret; + } +} diff --git a/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Tokens.php b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Tokens.php new file mode 100755 index 0000000..9166085 --- /dev/null +++ b/phpMyAdmin/vendor/phpmyadmin/sql-parser/src/Utils/Tokens.php @@ -0,0 +1,168 @@ +token) + ) { + return false; + } + + // Value. + if (isset($pattern['value']) + && ($pattern['value'] !== $token->value) + ) { + return false; + } + + if (isset($pattern['value_str']) + && strcasecmp($pattern['value_str'], $token->value) + ) { + return false; + } + + // Type. + if (isset($pattern['type']) + && ($pattern['type'] !== $token->type) + ) { + return false; + } + + // Flags. + if (isset($pattern['flags']) + && (($pattern['flags'] & $token->flags) === 0) + ) { + return false; + } + + return true; + } + + public static function replaceTokens($list, array $find, array $replace) + { + /** + * Whether the first parameter is a list. + * + * @var bool + */ + $isList = $list instanceof TokensList; + + // Parsing the tokens. + if (! $isList) { + $list = Lexer::getTokens($list); + } + + /** + * The list to be returned. + * + * @var array + */ + $newList = array(); + + /** + * The length of the find pattern is calculated only once. + * + * @var int + */ + $findCount = count($find); + + /** + * The starting index of the pattern. + * + * @var int + */ + $i = 0; + + while ($i < $list->count) { + // A sequence may not start with a comment. + if ($list->tokens[$i]->type === Token::TYPE_COMMENT) { + $newList[] = $list->tokens[$i]; + ++$i; + continue; + } + + /** + * The index used to parse `$list->tokens`. + * + * This index might be running faster than `$k` because some tokens + * are skipped. + * + * @var int + */ + $j = $i; + + /** + * The index used to parse `$find`. + * + * This index might be running slower than `$j` because some tokens + * are skipped. + * + * @var int + */ + $k = 0; + + // Checking if the next tokens match the pattern described. + while (($j < $list->count) && ($k < $findCount)) { + // Comments are being skipped. + if ($list->tokens[$j]->type === Token::TYPE_COMMENT) { + ++$j; + } + + if (! static::match($list->tokens[$j], $find[$k])) { + // This token does not match the pattern. + break; + } + + // Going to next token and segment of find pattern. + ++$j; + ++$k; + } + + // Checking if the sequence was found. + if ($k === $findCount) { + // Inserting new tokens. + foreach ($replace as $token) { + $newList[] = $token; + } + + // Skipping next `$findCount` tokens. + $i = $j; + } else { + // Adding the same token. + $newList[] = $list->tokens[$i]; + ++$i; + } + } + + return $isList ? + new TokensList($newList) : TokensList::build($newList); + } +} diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/AUTHORS b/phpMyAdmin/vendor/phpseclib/phpseclib/AUTHORS new file mode 100755 index 0000000..9f10d26 --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/AUTHORS @@ -0,0 +1,7 @@ +phpseclib Lead Developer: TerraFrost (Jim Wigginton) + +phpseclib Developers: monnerat (Patrick Monnerat) + bantu (Andreas Fischer) + petrich (Hans-J眉rgen Petrich) + GrahamCampbell (Graham Campbell) + hc-jworman \ No newline at end of file diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/BACKERS.md b/phpMyAdmin/vendor/phpseclib/phpseclib/BACKERS.md new file mode 100755 index 0000000..f942f48 --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/BACKERS.md @@ -0,0 +1,14 @@ +# Backers + +phpseclib ongoing development is made possible by [Tidelift](https://tidelift.com/subscription/pkg/packagist-phpseclib-phpseclib?utm_source=packagist-phpseclib-phpseclib&utm_medium=referral&utm_campaign=readme) and by contributions by users like you. Thank you. + +## Backers + +- Allan Simon +- [ChargeOver](https://chargeover.com/) +- Raghu Veer Dendukuri +- Zane Hooper +- [Setasign](https://www.setasign.com/) +- [Charles Severance](https://github.com/csev) +- [Rachel Fish](https://github.com/itsrachelfish) +- Tharyrok \ No newline at end of file diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/LICENSE b/phpMyAdmin/vendor/phpseclib/phpseclib/LICENSE new file mode 100755 index 0000000..e7214eb --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/LICENSE @@ -0,0 +1,20 @@ +Copyright (c) 2011-2019 TerraFrost and other contributors + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/README.md b/phpMyAdmin/vendor/phpseclib/phpseclib/README.md new file mode 100755 index 0000000..9be5517 --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/README.md @@ -0,0 +1,101 @@ +# phpseclib - PHP Secure Communications Library + +[![Build Status](https://travis-ci.com/phpseclib/phpseclib.svg?branch=2.0)](https://travis-ci.com/github/phpseclib/phpseclib) + +## Supporting phpseclib + +- [Become a backer or sponsor on Patreon](https://www.patreon.com/phpseclib) +- [One-time donation via PayPal or crypto-currencies](http://sourceforge.net/donate/index.php?group_id=198487) +- [Subscribe to Tidelift](https://tidelift.com/subscription/pkg/packagist-phpseclib-phpseclib?utm_source=packagist-phpseclib-phpseclib&utm_medium=referral&utm_campaign=readme) + +## Introduction + +MIT-licensed pure-PHP implementations of the following: + +SSH-2, SFTP, X.509, an arbitrary-precision integer arithmetic library, Ed25519 / Ed449 / Curve25519 / Curve449, ECDSA / ECDH (with support for 66 curves), RSA (PKCS#1 v2.2 compliant), DSA / DH, DES / 3DES / RC4 / Rijndael / AES / Blowfish / Twofish / Salsa20 / ChaCha20, GCM / Poly1305 + +* [Browse Git](https://github.com/phpseclib/phpseclib) + +## Documentation + +* [Documentation / Manual](https://phpseclib.com/) +* [API Documentation](https://api.phpseclib.com/2.0/) (generated by Doctum) + +## Branches + +### master + +* Development Branch +* Unstable API +* Do not use in production + +### 3.0 + +* Long term support (LTS) release +* Major expansion of cryptographic primitives +* Minimum PHP version: 5.6.1 +* PSR-4 autoloading with namespace rooted at `\phpseclib3` +* Install via Composer: `composer require phpseclib/phpseclib:~3.0` + +### 2.0 + +* Long term support (LTS) release +* Modernized version of 1.0 +* Minimum PHP version: 5.3.3 +* PSR-4 autoloading with namespace rooted at `\phpseclib` +* Install via Composer: `composer require phpseclib/phpseclib:~2.0` + +### 1.0 + +* Long term support (LTS) release +* PHP4 compatible +* Composer compatible (PSR-0 autoloading) +* Install using Composer: `composer require phpseclib/phpseclib:~1.0` +* Install using PEAR: See [phpseclib PEAR Channel Documentation](http://phpseclib.sourceforge.net/pear.htm) +* [Download 1.0.20 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.20.zip/download) + +## Security contact information + +To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. + +## Support + +Need Support? + +* [Checkout Questions and Answers on Stack Overflow](http://stackoverflow.com/questions/tagged/phpseclib) +* [Create a Support Ticket on GitHub](https://github.com/phpseclib/phpseclib/issues/new) +* [Browse the Support Forum](http://www.frostjedi.com/phpbb/viewforum.php?f=46) (no longer in use) + +## Special Thanks + +Special Thanks to our $50+ sponsors!: + +- Allan Simon +- [ChargeOver](https://chargeover.com/) + +## Contributing + +1. Fork the Project + +2. Ensure you have Composer installed (see [Composer Download Instructions](https://getcomposer.org/download/)) + +3. Install Development Dependencies + + ``` sh + composer install + ``` + +4. Create a Feature Branch + +5. (Recommended) Run the Test Suite + + ``` sh + vendor/bin/phpunit + ``` +6. (Recommended) Check whether your code conforms to our Coding Standards by running + + ``` sh + vendor/bin/phing -f build/build.xml sniff + ``` + +7. Send us a Pull Request diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/appveyor.yml b/phpMyAdmin/vendor/phpseclib/phpseclib/appveyor.yml new file mode 100755 index 0000000..210a903 --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/appveyor.yml @@ -0,0 +1,27 @@ +build: false +shallow_clone: false +platform: + - x86 + - x64 +clone_folder: C:\projects\phpseclib + +install: + - cinst -y OpenSSL.Light + - SET PATH=C:\Program Files\OpenSSL;%PATH% + - sc config wuauserv start= auto + - net start wuauserv + - cinst -y php --version 5.6.30 + - cd c:\tools\php56 + - copy php.ini-production php.ini + - echo date.timezone="UTC" >> php.ini + - echo extension_dir=ext >> php.ini + - echo extension=php_openssl.dll >> php.ini + - echo extension=php_gmp.dll >> php.ini + - cd C:\projects\phpseclib + - SET PATH=C:\tools\php56;%PATH% + - php.exe -r "readfile('http://getcomposer.org/installer');" | php.exe + - php.exe composer.phar install --prefer-source --no-interaction + +test_script: + - cd C:\projects\phpseclib + - vendor\bin\phpunit.bat tests/Windows32Test.php \ No newline at end of file diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/composer.json b/phpMyAdmin/vendor/phpseclib/phpseclib/composer.json new file mode 100755 index 0000000..3fbffa6 --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/composer.json @@ -0,0 +1,76 @@ +{ + "name": "phpseclib/phpseclib", + "type": "library", + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "keywords": [ + "security", + "crypto", + "cryptography", + "encryption", + "signature", + "signing", + "rsa", + "aes", + "blowfish", + "twofish", + "ssh", + "sftp", + "x509", + "x.509", + "asn1", + "asn.1", + "BigInteger" + ], + "homepage": "http://phpseclib.sourceforge.net", + "license": "MIT", + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-J眉rgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phing/phing": "~2.7", + "phpunit/phpunit": "^4.8.35|^5.7|^6.0|^9.4", + "squizlabs/php_codesniffer": "~2.0" + }, + "suggest": { + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-xml": "Install the XML extension to load XML formatted public keys." + }, + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib\\": "phpseclib/" + } + } +} diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php new file mode 100755 index 0000000..7d8cb8b --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/AES.php @@ -0,0 +1,126 @@ + + * setKey('abcdefghijklmnop'); + * + * $size = 10 * 1024; + * $plaintext = ''; + * for ($i = 0; $i < $size; $i++) { + * $plaintext.= 'a'; + * } + * + * echo $aes->decrypt($aes->encrypt($plaintext)); + * ?> + * + * + * @category Crypt + * @package AES + * @author Jim Wigginton + * @copyright 2008 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +namespace phpseclib\Crypt; + +/** + * Pure-PHP implementation of AES. + * + * @package AES + * @author Jim Wigginton + * @access public + */ +class AES extends Rijndael +{ + /** + * Dummy function + * + * Since \phpseclib\Crypt\AES extends \phpseclib\Crypt\Rijndael, this function is, technically, available, but it doesn't do anything. + * + * @see \phpseclib\Crypt\Rijndael::setBlockLength() + * @access public + * @param int $length + */ + function setBlockLength($length) + { + return; + } + + /** + * Sets the key length + * + * Valid key lengths are 128, 192, and 256. If the length is less than 128, it will be rounded up to + * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. + * + * @see \phpseclib\Crypt\Rijndael:setKeyLength() + * @access public + * @param int $length + */ + function setKeyLength($length) + { + switch ($length) { + case 160: + $length = 192; + break; + case 224: + $length = 256; + } + parent::setKeyLength($length); + } + + /** + * Sets the key. + * + * Rijndael supports five different key lengths, AES only supports three. + * + * @see \phpseclib\Crypt\Rijndael:setKey() + * @see setKeyLength() + * @access public + * @param string $key + */ + function setKey($key) + { + parent::setKey($key); + + if (!$this->explicit_key_length) { + $length = strlen($key); + switch (true) { + case $length <= 16: + $this->key_length = 16; + break; + case $length <= 24: + $this->key_length = 24; + break; + default: + $this->key_length = 32; + } + $this->_setEngine(); + } + } +} diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php new file mode 100755 index 0000000..7bb357a --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Base.php @@ -0,0 +1,2907 @@ + + * @author Hans-Juergen Petrich + * @copyright 2007 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +namespace phpseclib\Crypt; + +/** + * Base Class for all \phpseclib\Crypt\* cipher classes + * + * @package Base + * @author Jim Wigginton + * @author Hans-Juergen Petrich + */ +abstract class Base +{ + /**#@+ + * @access public + * @see \phpseclib\Crypt\Base::encrypt() + * @see \phpseclib\Crypt\Base::decrypt() + */ + /** + * Encrypt / decrypt using the Counter mode. + * + * Set to -1 since that's what Crypt/Random.php uses to index the CTR mode. + * + * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Counter_.28CTR.29 + */ + const MODE_CTR = -1; + /** + * Encrypt / decrypt using the Electronic Code Book mode. + * + * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Electronic_codebook_.28ECB.29 + */ + const MODE_ECB = 1; + /** + * Encrypt / decrypt using the Code Book Chaining mode. + * + * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher-block_chaining_.28CBC.29 + */ + const MODE_CBC = 2; + /** + * Encrypt / decrypt using the Cipher Feedback mode. + * + * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Cipher_feedback_.28CFB.29 + */ + const MODE_CFB = 3; + /** + * Encrypt / decrypt using the Cipher Feedback mode (8bit) + */ + const MODE_CFB8 = 6; + /** + * Encrypt / decrypt using the Output Feedback mode (8bit) + */ + const MODE_OFB8 = 7; + /** + * Encrypt / decrypt using the Output Feedback mode. + * + * @link http://en.wikipedia.org/wiki/Block_cipher_modes_of_operation#Output_feedback_.28OFB.29 + */ + const MODE_OFB = 4; + /** + * Encrypt / decrypt using streaming mode. + */ + const MODE_STREAM = 5; + /**#@-*/ + + /** + * Whirlpool available flag + * + * @see \phpseclib\Crypt\Base::_hashInlineCryptFunction() + * @var bool + * @access private + */ + static $WHIRLPOOL_AVAILABLE; + + /**#@+ + * @access private + * @see \phpseclib\Crypt\Base::__construct() + */ + /** + * Base value for the internal implementation $engine switch + */ + const ENGINE_INTERNAL = 1; + /** + * Base value for the mcrypt implementation $engine switch + */ + const ENGINE_MCRYPT = 2; + /** + * Base value for the mcrypt implementation $engine switch + */ + const ENGINE_OPENSSL = 3; + /**#@-*/ + + /** + * The Encryption Mode + * + * @see self::__construct() + * @var int + * @access private + */ + var $mode; + + /** + * The Block Length of the block cipher + * + * @var int + * @access private + */ + var $block_size = 16; + + /** + * The Key + * + * @see self::setKey() + * @var string + * @access private + */ + var $key = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; + + /** + * The Initialization Vector + * + * @see self::setIV() + * @var string + * @access private + */ + var $iv = ''; + + /** + * A "sliding" Initialization Vector + * + * @see self::enableContinuousBuffer() + * @see self::_clearBuffers() + * @var string + * @access private + */ + var $encryptIV; + + /** + * A "sliding" Initialization Vector + * + * @see self::enableContinuousBuffer() + * @see self::_clearBuffers() + * @var string + * @access private + */ + var $decryptIV; + + /** + * Continuous Buffer status + * + * @see self::enableContinuousBuffer() + * @var bool + * @access private + */ + var $continuousBuffer = false; + + /** + * Encryption buffer for CTR, OFB and CFB modes + * + * @see self::encrypt() + * @see self::_clearBuffers() + * @var array + * @access private + */ + var $enbuffer; + + /** + * Decryption buffer for CTR, OFB and CFB modes + * + * @see self::decrypt() + * @see self::_clearBuffers() + * @var array + * @access private + */ + var $debuffer; + + /** + * mcrypt resource for encryption + * + * The mcrypt resource can be recreated every time something needs to be created or it can be created just once. + * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode. + * + * @see self::encrypt() + * @var resource + * @access private + */ + var $enmcrypt; + + /** + * mcrypt resource for decryption + * + * The mcrypt resource can be recreated every time something needs to be created or it can be created just once. + * Since mcrypt operates in continuous mode, by default, it'll need to be recreated when in non-continuous mode. + * + * @see self::decrypt() + * @var resource + * @access private + */ + var $demcrypt; + + /** + * Does the enmcrypt resource need to be (re)initialized? + * + * @see \phpseclib\Crypt\Twofish::setKey() + * @see \phpseclib\Crypt\Twofish::setIV() + * @var bool + * @access private + */ + var $enchanged = true; + + /** + * Does the demcrypt resource need to be (re)initialized? + * + * @see \phpseclib\Crypt\Twofish::setKey() + * @see \phpseclib\Crypt\Twofish::setIV() + * @var bool + * @access private + */ + var $dechanged = true; + + /** + * mcrypt resource for CFB mode + * + * mcrypt's CFB mode, in (and only in) buffered context, + * is broken, so phpseclib implements the CFB mode by it self, + * even when the mcrypt php extension is available. + * + * In order to do the CFB-mode work (fast) phpseclib + * use a separate ECB-mode mcrypt resource. + * + * @link http://phpseclib.sourceforge.net/cfb-demo.phps + * @see self::encrypt() + * @see self::decrypt() + * @see self::_setupMcrypt() + * @var resource + * @access private + */ + var $ecb; + + /** + * Optimizing value while CFB-encrypting + * + * Only relevant if $continuousBuffer enabled + * and $engine == self::ENGINE_MCRYPT + * + * It's faster to re-init $enmcrypt if + * $buffer bytes > $cfb_init_len than + * using the $ecb resource furthermore. + * + * This value depends of the chosen cipher + * and the time it would be needed for it's + * initialization [by mcrypt_generic_init()] + * which, typically, depends on the complexity + * on its internaly Key-expanding algorithm. + * + * @see self::encrypt() + * @var int + * @access private + */ + var $cfb_init_len = 600; + + /** + * Does internal cipher state need to be (re)initialized? + * + * @see self::setKey() + * @see self::setIV() + * @see self::disableContinuousBuffer() + * @var bool + * @access private + */ + var $changed = true; + + /** + * Padding status + * + * @see self::enablePadding() + * @var bool + * @access private + */ + var $padding = true; + + /** + * Is the mode one that is paddable? + * + * @see self::__construct() + * @var bool + * @access private + */ + var $paddable = false; + + /** + * Holds which crypt engine internaly should be use, + * which will be determined automatically on __construct() + * + * Currently available $engines are: + * - self::ENGINE_OPENSSL (very fast, php-extension: openssl, extension_loaded('openssl') required) + * - self::ENGINE_MCRYPT (fast, php-extension: mcrypt, extension_loaded('mcrypt') required) + * - self::ENGINE_INTERNAL (slower, pure php-engine, no php-extension required) + * + * @see self::_setEngine() + * @see self::encrypt() + * @see self::decrypt() + * @var int + * @access private + */ + var $engine; + + /** + * Holds the preferred crypt engine + * + * @see self::_setEngine() + * @see self::setPreferredEngine() + * @var int + * @access private + */ + var $preferredEngine; + + /** + * The mcrypt specific name of the cipher + * + * Only used if $engine == self::ENGINE_MCRYPT + * + * @link http://www.php.net/mcrypt_module_open + * @link http://www.php.net/mcrypt_list_algorithms + * @see self::_setupMcrypt() + * @var string + * @access private + */ + var $cipher_name_mcrypt; + + /** + * The openssl specific name of the cipher + * + * Only used if $engine == self::ENGINE_OPENSSL + * + * @link http://www.php.net/openssl-get-cipher-methods + * @var string + * @access private + */ + var $cipher_name_openssl; + + /** + * The openssl specific name of the cipher in ECB mode + * + * If OpenSSL does not support the mode we're trying to use (CTR) + * it can still be emulated with ECB mode. + * + * @link http://www.php.net/openssl-get-cipher-methods + * @var string + * @access private + */ + var $cipher_name_openssl_ecb; + + /** + * The default salt used by setPassword() + * + * @see self::setPassword() + * @var string + * @access private + */ + var $password_default_salt = 'phpseclib/salt'; + + /** + * The name of the performance-optimized callback function + * + * Used by encrypt() / decrypt() + * only if $engine == self::ENGINE_INTERNAL + * + * @see self::encrypt() + * @see self::decrypt() + * @see self::_setupInlineCrypt() + * @see self::$use_inline_crypt + * @var Callback + * @access private + */ + var $inline_crypt; + + /** + * Holds whether performance-optimized $inline_crypt() can/should be used. + * + * @see self::encrypt() + * @see self::decrypt() + * @see self::inline_crypt + * @var mixed + * @access private + */ + var $use_inline_crypt = true; + + /** + * If OpenSSL can be used in ECB but not in CTR we can emulate CTR + * + * @see self::_openssl_ctr_process() + * @var bool + * @access private + */ + var $openssl_emulate_ctr = false; + + /** + * Determines what options are passed to openssl_encrypt/decrypt + * + * @see self::isValidEngine() + * @var mixed + * @access private + */ + var $openssl_options; + + /** + * Has the key length explicitly been set or should it be derived from the key, itself? + * + * @see self::setKeyLength() + * @var bool + * @access private + */ + var $explicit_key_length = false; + + /** + * Don't truncate / null pad key + * + * @see self::_clearBuffers() + * @var bool + * @access private + */ + var $skip_key_adjustment = false; + + /** + * Default Constructor. + * + * Determines whether or not the mcrypt extension should be used. + * + * $mode could be: + * + * - self::MODE_ECB + * + * - self::MODE_CBC + * + * - self::MODE_CTR + * + * - self::MODE_CFB + * + * - self::MODE_OFB + * + * If not explicitly set, self::MODE_CBC will be used. + * + * @param int $mode + * @access public + */ + function __construct($mode = self::MODE_CBC) + { + // $mode dependent settings + switch ($mode) { + case self::MODE_ECB: + $this->paddable = true; + $this->mode = self::MODE_ECB; + break; + case self::MODE_CTR: + case self::MODE_CFB: + case self::MODE_CFB8: + case self::MODE_OFB8: + case self::MODE_OFB: + case self::MODE_STREAM: + $this->mode = $mode; + break; + case self::MODE_CBC: + default: + $this->paddable = true; + $this->mode = self::MODE_CBC; + } + + $this->_setEngine(); + + // Determining whether inline crypting can be used by the cipher + if ($this->use_inline_crypt !== false) { + $this->use_inline_crypt = version_compare(PHP_VERSION, '5.3.0') >= 0 || function_exists('create_function'); + } + + if (!defined('PHP_INT_SIZE')) { + define('PHP_INT_SIZE', 4); + } + + if (!defined('CRYPT_BASE_USE_REG_INTVAL')) { + switch (true) { + // PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster + case (PHP_OS & "\xDF\xDF\xDF") === 'WIN': + case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM': + case PHP_INT_SIZE == 8: + define('CRYPT_BASE_USE_REG_INTVAL', true); + break; + case (php_uname('m') & "\xDF\xDF\xDF") == 'ARM': + switch (true) { + /* PHP 7.0.0 introduced a bug that affected 32-bit ARM processors: + + https://github.com/php/php-src/commit/716da71446ebbd40fa6cf2cea8a4b70f504cc3cd + + altho the changelogs make no mention of it, this bug was fixed with this commit: + + https://github.com/php/php-src/commit/c1729272b17a1fe893d1a54e423d3b71470f3ee8 + + affected versions of PHP are: 7.0.x, 7.1.0 - 7.1.23 and 7.2.0 - 7.2.11 */ + case PHP_VERSION_ID >= 70000 && PHP_VERSION_ID <= 70123: + case PHP_VERSION_ID >= 70200 && PHP_VERSION_ID <= 70211: + define('CRYPT_BASE_USE_REG_INTVAL', false); + break; + default: + define('CRYPT_BASE_USE_REG_INTVAL', true); + } + } + } + } + + /** + * Sets the initialization vector. (optional) + * + * SetIV is not required when self::MODE_ECB (or ie for AES: \phpseclib\Crypt\AES::MODE_ECB) is being used. If not explicitly set, it'll be assumed + * to be all zero's. + * + * @access public + * @param string $iv + * @internal Can be overwritten by a sub class, but does not have to be + */ + function setIV($iv) + { + if ($this->mode == self::MODE_ECB) { + return; + } + + $this->iv = $iv; + $this->changed = true; + } + + /** + * Sets the key length. + * + * Keys with explicitly set lengths need to be treated accordingly + * + * @access public + * @param int $length + */ + function setKeyLength($length) + { + $this->explicit_key_length = true; + $this->changed = true; + $this->_setEngine(); + } + + /** + * Returns the current key length in bits + * + * @access public + * @return int + */ + function getKeyLength() + { + return $this->key_length << 3; + } + + /** + * Returns the current block length in bits + * + * @access public + * @return int + */ + function getBlockLength() + { + return $this->block_size << 3; + } + + /** + * Sets the key. + * + * The min/max length(s) of the key depends on the cipher which is used. + * If the key not fits the length(s) of the cipher it will paded with null bytes + * up to the closest valid key length. If the key is more than max length, + * we trim the excess bits. + * + * If the key is not explicitly set, it'll be assumed to be all null bytes. + * + * @access public + * @param string $key + * @internal Could, but not must, extend by the child Crypt_* class + */ + function setKey($key) + { + if (!$this->explicit_key_length) { + $this->setKeyLength(strlen($key) << 3); + $this->explicit_key_length = false; + } + + $this->key = $key; + $this->changed = true; + $this->_setEngine(); + } + + /** + * Sets the password. + * + * Depending on what $method is set to, setPassword()'s (optional) parameters are as follows: + * {@link http://en.wikipedia.org/wiki/PBKDF2 pbkdf2} or pbkdf1: + * $hash, $salt, $count, $dkLen + * + * Where $hash (default = sha1) currently supports the following hashes: see: Crypt/Hash.php + * {@link https://en.wikipedia.org/wiki/Bcrypt bcypt}: + * $salt, $rounds, $keylen + * + * This is a modified version of bcrypt used by OpenSSH. + * + * @see Crypt/Hash.php + * @param string $password + * @param string $method + * @return bool + * @access public + * @internal Could, but not must, extend by the child Crypt_* class + */ + function setPassword($password, $method = 'pbkdf2') + { + $key = ''; + + switch ($method) { + case 'bcrypt': + $func_args = func_get_args(); + + if (!isset($func_args[2])) { + return false; + } + + $salt = $func_args[2]; + + $rounds = isset($func_args[3]) ? $func_args[3] : 16; + $keylen = isset($func_args[4]) ? $func_args[4] : $this->key_length; + + $bf = new Blowfish(); + $key = $bf->bcrypt_pbkdf($password, $salt, $keylen + $this->block_size, $rounds); + if (!$key) { + return false; + } + + $this->setKey(substr($key, 0, $keylen)); + $this->setIV(substr($key, $keylen)); + + return true; + default: // 'pbkdf2' or 'pbkdf1' + $func_args = func_get_args(); + + // Hash function + $hash = isset($func_args[2]) ? $func_args[2] : 'sha1'; + + // WPA and WPA2 use the SSID as the salt + $salt = isset($func_args[3]) ? $func_args[3] : $this->password_default_salt; + + // RFC2898#section-4.2 uses 1,000 iterations by default + // WPA and WPA2 use 4,096. + $count = isset($func_args[4]) ? $func_args[4] : 1000; + + // Keylength + if (isset($func_args[5])) { + $dkLen = $func_args[5]; + } else { + $dkLen = $method == 'pbkdf1' ? 2 * $this->key_length : $this->key_length; + } + + switch (true) { + case $method == 'pbkdf1': + $hashObj = new Hash(); + $hashObj->setHash($hash); + if ($dkLen > $hashObj->getLength()) { + user_error('Derived key too long'); + return false; + } + $t = $password . $salt; + for ($i = 0; $i < $count; ++$i) { + $t = $hashObj->hash($t); + } + $key = substr($t, 0, $dkLen); + + $this->setKey(substr($key, 0, $dkLen >> 1)); + $this->setIV(substr($key, $dkLen >> 1)); + + return true; + // Determining if php[>=5.5.0]'s hash_pbkdf2() function avail- and useable + case !function_exists('hash_pbkdf2'): + case !function_exists('hash_algos'): + case !in_array($hash, hash_algos()): + $i = 1; + $hmac = new Hash(); + $hmac->setHash($hash); + $hmac->setKey($password); + while (strlen($key) < $dkLen) { + $f = $u = $hmac->hash($salt . pack('N', $i++)); + for ($j = 2; $j <= $count; ++$j) { + $u = $hmac->hash($u); + $f^= $u; + } + $key.= $f; + } + $key = substr($key, 0, $dkLen); + break; + default: + $key = hash_pbkdf2($hash, $password, $salt, $count, $dkLen, true); + } + } + + $this->setKey($key); + + return true; + } + + /** + * Encrypts a message. + * + * $plaintext will be padded with additional bytes such that it's length is a multiple of the block size. Other cipher + * implementations may or may not pad in the same manner. Other common approaches to padding and the reasons why it's + * necessary are discussed in the following + * URL: + * + * {@link http://www.di-mgt.com.au/cryptopad.html http://www.di-mgt.com.au/cryptopad.html} + * + * An alternative to padding is to, separately, send the length of the file. This is what SSH, in fact, does. + * strlen($plaintext) will still need to be a multiple of the block size, however, arbitrary values can be added to make it that + * length. + * + * @see self::decrypt() + * @access public + * @param string $plaintext + * @return string $ciphertext + * @internal Could, but not must, extend by the child Crypt_* class + */ + function encrypt($plaintext) + { + if ($this->paddable) { + $plaintext = $this->_pad($plaintext); + } + + if ($this->engine === self::ENGINE_OPENSSL) { + if ($this->changed) { + $this->_clearBuffers(); + $this->changed = false; + } + switch ($this->mode) { + case self::MODE_STREAM: + return openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options); + case self::MODE_ECB: + $result = @openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options); + return !defined('OPENSSL_RAW_DATA') ? substr($result, 0, -$this->block_size) : $result; + case self::MODE_CBC: + $result = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->encryptIV); + if (!defined('OPENSSL_RAW_DATA')) { + $result = substr($result, 0, -$this->block_size); + } + if ($this->continuousBuffer) { + $this->encryptIV = substr($result, -$this->block_size); + } + return $result; + case self::MODE_CTR: + return $this->_openssl_ctr_process($plaintext, $this->encryptIV, $this->enbuffer); + case self::MODE_CFB: + // cfb loosely routines inspired by openssl's: + // {@link http://cvs.openssl.org/fileview?f=openssl/crypto/modes/cfb128.c&v=1.3.2.2.2.1} + $ciphertext = ''; + if ($this->continuousBuffer) { + $iv = &$this->encryptIV; + $pos = &$this->enbuffer['pos']; + } else { + $iv = $this->encryptIV; + $pos = 0; + } + $len = strlen($plaintext); + $i = 0; + if ($pos) { + $orig_pos = $pos; + $max = $this->block_size - $pos; + if ($len >= $max) { + $i = $max; + $len-= $max; + $pos = 0; + } else { + $i = $len; + $pos+= $len; + $len = 0; + } + // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize + $ciphertext = substr($iv, $orig_pos) ^ $plaintext; + $iv = substr_replace($iv, $ciphertext, $orig_pos, $i); + $plaintext = substr($plaintext, $i); + } + + $overflow = $len % $this->block_size; + + if ($overflow) { + $ciphertext.= openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $this->block_size), $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); + $iv = $this->_string_pop($ciphertext, $this->block_size); + + $size = $len - $overflow; + $block = $iv ^ substr($plaintext, -$overflow); + $iv = substr_replace($iv, $block, 0, $overflow); + $ciphertext.= $block; + $pos = $overflow; + } elseif ($len) { + $ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); + $iv = substr($ciphertext, -$this->block_size); + } + + return $ciphertext; + case self::MODE_CFB8: + $ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->encryptIV); + if ($this->continuousBuffer) { + if (($len = strlen($ciphertext)) >= $this->block_size) { + $this->encryptIV = substr($ciphertext, -$this->block_size); + } else { + $this->encryptIV = substr($this->encryptIV, $len - $this->block_size) . substr($ciphertext, -$len); + } + } + return $ciphertext; + case self::MODE_OFB8: + // OpenSSL has built in support for cfb8 but not ofb8 + $ciphertext = ''; + $len = strlen($plaintext); + $iv = $this->encryptIV; + + for ($i = 0; $i < $len; ++$i) { + $xor = openssl_encrypt($iv, $this->cipher_name_openssl_ecb, $this->key, $this->openssl_options, $this->decryptIV); + $ciphertext.= $plaintext[$i] ^ $xor; + $iv = substr($iv, 1) . $xor[0]; + } + + if ($this->continuousBuffer) { + $this->encryptIV = $iv; + } + break; + case self::MODE_OFB: + return $this->_openssl_ofb_process($plaintext, $this->encryptIV, $this->enbuffer); + } + } + + if ($this->engine === self::ENGINE_MCRYPT) { + set_error_handler(array($this, 'do_nothing')); + + if ($this->changed) { + $this->_setupMcrypt(); + $this->changed = false; + } + if ($this->enchanged) { + mcrypt_generic_init($this->enmcrypt, $this->key, $this->encryptIV); + $this->enchanged = false; + } + + // re: {@link http://phpseclib.sourceforge.net/cfb-demo.phps} + // using mcrypt's default handing of CFB the above would output two different things. using phpseclib's + // rewritten CFB implementation the above outputs the same thing twice. + if ($this->mode == self::MODE_CFB && $this->continuousBuffer) { + $block_size = $this->block_size; + $iv = &$this->encryptIV; + $pos = &$this->enbuffer['pos']; + $len = strlen($plaintext); + $ciphertext = ''; + $i = 0; + if ($pos) { + $orig_pos = $pos; + $max = $block_size - $pos; + if ($len >= $max) { + $i = $max; + $len-= $max; + $pos = 0; + } else { + $i = $len; + $pos+= $len; + $len = 0; + } + $ciphertext = substr($iv, $orig_pos) ^ $plaintext; + $iv = substr_replace($iv, $ciphertext, $orig_pos, $i); + $this->enbuffer['enmcrypt_init'] = true; + } + if ($len >= $block_size) { + if ($this->enbuffer['enmcrypt_init'] === false || $len > $this->cfb_init_len) { + if ($this->enbuffer['enmcrypt_init'] === true) { + mcrypt_generic_init($this->enmcrypt, $this->key, $iv); + $this->enbuffer['enmcrypt_init'] = false; + } + $ciphertext.= mcrypt_generic($this->enmcrypt, substr($plaintext, $i, $len - $len % $block_size)); + $iv = substr($ciphertext, -$block_size); + $len%= $block_size; + } else { + while ($len >= $block_size) { + $iv = mcrypt_generic($this->ecb, $iv) ^ substr($plaintext, $i, $block_size); + $ciphertext.= $iv; + $len-= $block_size; + $i+= $block_size; + } + } + } + + if ($len) { + $iv = mcrypt_generic($this->ecb, $iv); + $block = $iv ^ substr($plaintext, -$len); + $iv = substr_replace($iv, $block, 0, $len); + $ciphertext.= $block; + $pos = $len; + } + + restore_error_handler(); + + return $ciphertext; + } + + $ciphertext = mcrypt_generic($this->enmcrypt, $plaintext); + + if (!$this->continuousBuffer) { + mcrypt_generic_init($this->enmcrypt, $this->key, $this->encryptIV); + } + + restore_error_handler(); + + return $ciphertext; + } + + if ($this->changed) { + $this->_setup(); + $this->changed = false; + } + if ($this->use_inline_crypt) { + $inline = $this->inline_crypt; + return $inline('encrypt', $this, $plaintext); + } + + $buffer = &$this->enbuffer; + $block_size = $this->block_size; + $ciphertext = ''; + switch ($this->mode) { + case self::MODE_ECB: + for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { + $ciphertext.= $this->_encryptBlock(substr($plaintext, $i, $block_size)); + } + break; + case self::MODE_CBC: + $xor = $this->encryptIV; + for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { + $block = substr($plaintext, $i, $block_size); + $block = $this->_encryptBlock($block ^ $xor); + $xor = $block; + $ciphertext.= $block; + } + if ($this->continuousBuffer) { + $this->encryptIV = $xor; + } + break; + case self::MODE_CTR: + $xor = $this->encryptIV; + if (strlen($buffer['ciphertext'])) { + for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { + $block = substr($plaintext, $i, $block_size); + if (strlen($block) > strlen($buffer['ciphertext'])) { + $buffer['ciphertext'].= $this->_encryptBlock($xor); + $this->_increment_str($xor); + } + $key = $this->_string_shift($buffer['ciphertext'], $block_size); + $ciphertext.= $block ^ $key; + } + } else { + for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { + $block = substr($plaintext, $i, $block_size); + $key = $this->_encryptBlock($xor); + $this->_increment_str($xor); + $ciphertext.= $block ^ $key; + } + } + if ($this->continuousBuffer) { + $this->encryptIV = $xor; + if ($start = strlen($plaintext) % $block_size) { + $buffer['ciphertext'] = substr($key, $start) . $buffer['ciphertext']; + } + } + break; + case self::MODE_CFB: + // cfb loosely routines inspired by openssl's: + // {@link http://cvs.openssl.org/fileview?f=openssl/crypto/modes/cfb128.c&v=1.3.2.2.2.1} + if ($this->continuousBuffer) { + $iv = &$this->encryptIV; + $pos = &$buffer['pos']; + } else { + $iv = $this->encryptIV; + $pos = 0; + } + $len = strlen($plaintext); + $i = 0; + if ($pos) { + $orig_pos = $pos; + $max = $block_size - $pos; + if ($len >= $max) { + $i = $max; + $len-= $max; + $pos = 0; + } else { + $i = $len; + $pos+= $len; + $len = 0; + } + // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize + $ciphertext = substr($iv, $orig_pos) ^ $plaintext; + $iv = substr_replace($iv, $ciphertext, $orig_pos, $i); + } + while ($len >= $block_size) { + $iv = $this->_encryptBlock($iv) ^ substr($plaintext, $i, $block_size); + $ciphertext.= $iv; + $len-= $block_size; + $i+= $block_size; + } + if ($len) { + $iv = $this->_encryptBlock($iv); + $block = $iv ^ substr($plaintext, $i); + $iv = substr_replace($iv, $block, 0, $len); + $ciphertext.= $block; + $pos = $len; + } + break; + case self::MODE_CFB8: + // compared to regular CFB, which encrypts a block at a time, + // here, we're encrypting a byte at a time + $ciphertext = ''; + $len = strlen($plaintext); + $iv = $this->encryptIV; + + for ($i = 0; $i < $len; ++$i) { + $ciphertext.= ($c = $plaintext[$i] ^ $this->_encryptBlock($iv)); + $iv = substr($iv, 1) . $c; + } + + if ($this->continuousBuffer) { + if ($len >= $block_size) { + $this->encryptIV = substr($ciphertext, -$block_size); + } else { + $this->encryptIV = substr($this->encryptIV, $len - $block_size) . substr($ciphertext, -$len); + } + } + break; + case self::MODE_OFB8: + $ciphertext = ''; + $len = strlen($plaintext); + $iv = $this->encryptIV; + + for ($i = 0; $i < $len; ++$i) { + $xor = $this->_encryptBlock($iv); + $ciphertext.= $plaintext[$i] ^ $xor; + $iv = substr($iv, 1) . $xor[0]; + } + + if ($this->continuousBuffer) { + $this->encryptIV = $iv; + } + break; + case self::MODE_OFB: + $xor = $this->encryptIV; + if (strlen($buffer['xor'])) { + for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { + $block = substr($plaintext, $i, $block_size); + if (strlen($block) > strlen($buffer['xor'])) { + $xor = $this->_encryptBlock($xor); + $buffer['xor'].= $xor; + } + $key = $this->_string_shift($buffer['xor'], $block_size); + $ciphertext.= $block ^ $key; + } + } else { + for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { + $xor = $this->_encryptBlock($xor); + $ciphertext.= substr($plaintext, $i, $block_size) ^ $xor; + } + $key = $xor; + } + if ($this->continuousBuffer) { + $this->encryptIV = $xor; + if ($start = strlen($plaintext) % $block_size) { + $buffer['xor'] = substr($key, $start) . $buffer['xor']; + } + } + break; + case self::MODE_STREAM: + $ciphertext = $this->_encryptBlock($plaintext); + break; + } + + return $ciphertext; + } + + /** + * Decrypts a message. + * + * If strlen($ciphertext) is not a multiple of the block size, null bytes will be added to the end of the string until + * it is. + * + * @see self::encrypt() + * @access public + * @param string $ciphertext + * @return string $plaintext + * @internal Could, but not must, extend by the child Crypt_* class + */ + function decrypt($ciphertext) + { + if ($this->paddable) { + // we pad with chr(0) since that's what mcrypt_generic does. to quote from {@link http://www.php.net/function.mcrypt-generic}: + // "The data is padded with "\0" to make sure the length of the data is n * blocksize." + $ciphertext = str_pad($ciphertext, strlen($ciphertext) + ($this->block_size - strlen($ciphertext) % $this->block_size) % $this->block_size, chr(0)); + } + + if ($this->engine === self::ENGINE_OPENSSL) { + if ($this->changed) { + $this->_clearBuffers(); + $this->changed = false; + } + switch ($this->mode) { + case self::MODE_STREAM: + $plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options); + break; + case self::MODE_ECB: + if (!defined('OPENSSL_RAW_DATA')) { + $ciphertext.= @openssl_encrypt('', $this->cipher_name_openssl_ecb, $this->key, true); + } + $plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options); + break; + case self::MODE_CBC: + if (!defined('OPENSSL_RAW_DATA')) { + $padding = str_repeat(chr($this->block_size), $this->block_size) ^ substr($ciphertext, -$this->block_size); + $ciphertext.= substr(@openssl_encrypt($padding, $this->cipher_name_openssl_ecb, $this->key, true), 0, $this->block_size); + $offset = 2 * $this->block_size; + } else { + $offset = $this->block_size; + } + $plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->decryptIV); + if ($this->continuousBuffer) { + $this->decryptIV = substr($ciphertext, -$offset, $this->block_size); + } + break; + case self::MODE_CTR: + $plaintext = $this->_openssl_ctr_process($ciphertext, $this->decryptIV, $this->debuffer); + break; + case self::MODE_CFB: + // cfb loosely routines inspired by openssl's: + // {@link http://cvs.openssl.org/fileview?f=openssl/crypto/modes/cfb128.c&v=1.3.2.2.2.1} + $plaintext = ''; + if ($this->continuousBuffer) { + $iv = &$this->decryptIV; + $pos = &$this->debuffer['pos']; + } else { + $iv = $this->decryptIV; + $pos = 0; + } + $len = strlen($ciphertext); + $i = 0; + if ($pos) { + $orig_pos = $pos; + $max = $this->block_size - $pos; + if ($len >= $max) { + $i = $max; + $len-= $max; + $pos = 0; + } else { + $i = $len; + $pos+= $len; + $len = 0; + } + // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $this->blocksize + $plaintext = substr($iv, $orig_pos) ^ $ciphertext; + $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i); + $ciphertext = substr($ciphertext, $i); + } + $overflow = $len % $this->block_size; + if ($overflow) { + $plaintext.= openssl_decrypt(substr($ciphertext, 0, -$overflow), $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); + if ($len - $overflow) { + $iv = substr($ciphertext, -$overflow - $this->block_size, -$overflow); + } + $iv = openssl_encrypt(str_repeat("\0", $this->block_size), $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); + $plaintext.= $iv ^ substr($ciphertext, -$overflow); + $iv = substr_replace($iv, substr($ciphertext, -$overflow), 0, $overflow); + $pos = $overflow; + } elseif ($len) { + $plaintext.= openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $iv); + $iv = substr($ciphertext, -$this->block_size); + } + break; + case self::MODE_CFB8: + $plaintext = openssl_decrypt($ciphertext, $this->cipher_name_openssl, $this->key, $this->openssl_options, $this->decryptIV); + if ($this->continuousBuffer) { + if (($len = strlen($ciphertext)) >= $this->block_size) { + $this->decryptIV = substr($ciphertext, -$this->block_size); + } else { + $this->decryptIV = substr($this->decryptIV, $len - $this->block_size) . substr($ciphertext, -$len); + } + } + break; + case self::MODE_OFB8: + $plaintext = ''; + $len = strlen($ciphertext); + $iv = $this->decryptIV; + + for ($i = 0; $i < $len; ++$i) { + $xor = openssl_encrypt($iv, $this->cipher_name_openssl_ecb, $this->key, $this->openssl_options, $this->decryptIV); + $plaintext.= $ciphertext[$i] ^ $xor; + $iv = substr($iv, 1) . $xor[0]; + } + + if ($this->continuousBuffer) { + $this->decryptIV = $iv; + } + break; + case self::MODE_OFB: + $plaintext = $this->_openssl_ofb_process($ciphertext, $this->decryptIV, $this->debuffer); + } + + return $this->paddable ? $this->_unpad($plaintext) : $plaintext; + } + + if ($this->engine === self::ENGINE_MCRYPT) { + set_error_handler(array($this, 'do_nothing')); + $block_size = $this->block_size; + if ($this->changed) { + $this->_setupMcrypt(); + $this->changed = false; + } + if ($this->dechanged) { + mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV); + $this->dechanged = false; + } + + if ($this->mode == self::MODE_CFB && $this->continuousBuffer) { + $iv = &$this->decryptIV; + $pos = &$this->debuffer['pos']; + $len = strlen($ciphertext); + $plaintext = ''; + $i = 0; + if ($pos) { + $orig_pos = $pos; + $max = $block_size - $pos; + if ($len >= $max) { + $i = $max; + $len-= $max; + $pos = 0; + } else { + $i = $len; + $pos+= $len; + $len = 0; + } + // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize + $plaintext = substr($iv, $orig_pos) ^ $ciphertext; + $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i); + } + if ($len >= $block_size) { + $cb = substr($ciphertext, $i, $len - $len % $block_size); + $plaintext.= mcrypt_generic($this->ecb, $iv . $cb) ^ $cb; + $iv = substr($cb, -$block_size); + $len%= $block_size; + } + if ($len) { + $iv = mcrypt_generic($this->ecb, $iv); + $plaintext.= $iv ^ substr($ciphertext, -$len); + $iv = substr_replace($iv, substr($ciphertext, -$len), 0, $len); + $pos = $len; + } + + restore_error_handler(); + + return $plaintext; + } + + $plaintext = mdecrypt_generic($this->demcrypt, $ciphertext); + + if (!$this->continuousBuffer) { + mcrypt_generic_init($this->demcrypt, $this->key, $this->decryptIV); + } + + restore_error_handler(); + + return $this->paddable ? $this->_unpad($plaintext) : $plaintext; + } + + if ($this->changed) { + $this->_setup(); + $this->changed = false; + } + if ($this->use_inline_crypt) { + $inline = $this->inline_crypt; + return $inline('decrypt', $this, $ciphertext); + } + + $block_size = $this->block_size; + + $buffer = &$this->debuffer; + $plaintext = ''; + switch ($this->mode) { + case self::MODE_ECB: + for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { + $plaintext.= $this->_decryptBlock(substr($ciphertext, $i, $block_size)); + } + break; + case self::MODE_CBC: + $xor = $this->decryptIV; + for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { + $block = substr($ciphertext, $i, $block_size); + $plaintext.= $this->_decryptBlock($block) ^ $xor; + $xor = $block; + } + if ($this->continuousBuffer) { + $this->decryptIV = $xor; + } + break; + case self::MODE_CTR: + $xor = $this->decryptIV; + if (strlen($buffer['ciphertext'])) { + for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { + $block = substr($ciphertext, $i, $block_size); + if (strlen($block) > strlen($buffer['ciphertext'])) { + $buffer['ciphertext'].= $this->_encryptBlock($xor); + $this->_increment_str($xor); + } + $key = $this->_string_shift($buffer['ciphertext'], $block_size); + $plaintext.= $block ^ $key; + } + } else { + for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { + $block = substr($ciphertext, $i, $block_size); + $key = $this->_encryptBlock($xor); + $this->_increment_str($xor); + $plaintext.= $block ^ $key; + } + } + if ($this->continuousBuffer) { + $this->decryptIV = $xor; + if ($start = strlen($ciphertext) % $block_size) { + $buffer['ciphertext'] = substr($key, $start) . $buffer['ciphertext']; + } + } + break; + case self::MODE_CFB: + if ($this->continuousBuffer) { + $iv = &$this->decryptIV; + $pos = &$buffer['pos']; + } else { + $iv = $this->decryptIV; + $pos = 0; + } + $len = strlen($ciphertext); + $i = 0; + if ($pos) { + $orig_pos = $pos; + $max = $block_size - $pos; + if ($len >= $max) { + $i = $max; + $len-= $max; + $pos = 0; + } else { + $i = $len; + $pos+= $len; + $len = 0; + } + // ie. $i = min($max, $len), $len-= $i, $pos+= $i, $pos%= $blocksize + $plaintext = substr($iv, $orig_pos) ^ $ciphertext; + $iv = substr_replace($iv, substr($ciphertext, 0, $i), $orig_pos, $i); + } + while ($len >= $block_size) { + $iv = $this->_encryptBlock($iv); + $cb = substr($ciphertext, $i, $block_size); + $plaintext.= $iv ^ $cb; + $iv = $cb; + $len-= $block_size; + $i+= $block_size; + } + if ($len) { + $iv = $this->_encryptBlock($iv); + $plaintext.= $iv ^ substr($ciphertext, $i); + $iv = substr_replace($iv, substr($ciphertext, $i), 0, $len); + $pos = $len; + } + break; + case self::MODE_CFB8: + $plaintext = ''; + $len = strlen($ciphertext); + $iv = $this->decryptIV; + + for ($i = 0; $i < $len; ++$i) { + $plaintext.= $ciphertext[$i] ^ $this->_encryptBlock($iv); + $iv = substr($iv, 1) . $ciphertext[$i]; + } + + if ($this->continuousBuffer) { + if ($len >= $block_size) { + $this->decryptIV = substr($ciphertext, -$block_size); + } else { + $this->decryptIV = substr($this->decryptIV, $len - $block_size) . substr($ciphertext, -$len); + } + } + break; + case self::MODE_OFB8: + $plaintext = ''; + $len = strlen($ciphertext); + $iv = $this->decryptIV; + + for ($i = 0; $i < $len; ++$i) { + $xor = $this->_encryptBlock($iv); + $plaintext.= $ciphertext[$i] ^ $xor; + $iv = substr($iv, 1) . $xor[0]; + } + + if ($this->continuousBuffer) { + $this->decryptIV = $iv; + } + break; + case self::MODE_OFB: + $xor = $this->decryptIV; + if (strlen($buffer['xor'])) { + for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { + $block = substr($ciphertext, $i, $block_size); + if (strlen($block) > strlen($buffer['xor'])) { + $xor = $this->_encryptBlock($xor); + $buffer['xor'].= $xor; + } + $key = $this->_string_shift($buffer['xor'], $block_size); + $plaintext.= $block ^ $key; + } + } else { + for ($i = 0; $i < strlen($ciphertext); $i+=$block_size) { + $xor = $this->_encryptBlock($xor); + $plaintext.= substr($ciphertext, $i, $block_size) ^ $xor; + } + $key = $xor; + } + if ($this->continuousBuffer) { + $this->decryptIV = $xor; + if ($start = strlen($ciphertext) % $block_size) { + $buffer['xor'] = substr($key, $start) . $buffer['xor']; + } + } + break; + case self::MODE_STREAM: + $plaintext = $this->_decryptBlock($ciphertext); + break; + } + return $this->paddable ? $this->_unpad($plaintext) : $plaintext; + } + + /** + * OpenSSL CTR Processor + * + * PHP's OpenSSL bindings do not operate in continuous mode so we'll wrap around it. Since the keystream + * for CTR is the same for both encrypting and decrypting this function is re-used by both Base::encrypt() + * and Base::decrypt(). Also, OpenSSL doesn't implement CTR for all of it's symmetric ciphers so this + * function will emulate CTR with ECB when necessary. + * + * @see self::encrypt() + * @see self::decrypt() + * @param string $plaintext + * @param string $encryptIV + * @param array $buffer + * @return string + * @access private + */ + function _openssl_ctr_process($plaintext, &$encryptIV, &$buffer) + { + $ciphertext = ''; + + $block_size = $this->block_size; + $key = $this->key; + + if ($this->openssl_emulate_ctr) { + $xor = $encryptIV; + if (strlen($buffer['ciphertext'])) { + for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { + $block = substr($plaintext, $i, $block_size); + if (strlen($block) > strlen($buffer['ciphertext'])) { + $result = @openssl_encrypt($xor, $this->cipher_name_openssl_ecb, $key, $this->openssl_options); + $result = !defined('OPENSSL_RAW_DATA') ? substr($result, 0, -$this->block_size) : $result; + $buffer['ciphertext'].= $result; + } + $this->_increment_str($xor); + $otp = $this->_string_shift($buffer['ciphertext'], $block_size); + $ciphertext.= $block ^ $otp; + } + } else { + for ($i = 0; $i < strlen($plaintext); $i+=$block_size) { + $block = substr($plaintext, $i, $block_size); + $otp = @openssl_encrypt($xor, $this->cipher_name_openssl_ecb, $key, $this->openssl_options); + $otp = !defined('OPENSSL_RAW_DATA') ? substr($otp, 0, -$this->block_size) : $otp; + $this->_increment_str($xor); + $ciphertext.= $block ^ $otp; + } + } + if ($this->continuousBuffer) { + $encryptIV = $xor; + if ($start = strlen($plaintext) % $block_size) { + $buffer['ciphertext'] = substr($key, $start) . $buffer['ciphertext']; + } + } + + return $ciphertext; + } + + if (strlen($buffer['ciphertext'])) { + $ciphertext = $plaintext ^ $this->_string_shift($buffer['ciphertext'], strlen($plaintext)); + $plaintext = substr($plaintext, strlen($ciphertext)); + + if (!strlen($plaintext)) { + return $ciphertext; + } + } + + $overflow = strlen($plaintext) % $block_size; + if ($overflow) { + $plaintext2 = $this->_string_pop($plaintext, $overflow); // ie. trim $plaintext to a multiple of $block_size and put rest of $plaintext in $plaintext2 + $encrypted = openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); + $temp = $this->_string_pop($encrypted, $block_size); + $ciphertext.= $encrypted . ($plaintext2 ^ $temp); + if ($this->continuousBuffer) { + $buffer['ciphertext'] = substr($temp, $overflow); + $encryptIV = $temp; + } + } elseif (!strlen($buffer['ciphertext'])) { + $ciphertext.= openssl_encrypt($plaintext . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); + $temp = $this->_string_pop($ciphertext, $block_size); + if ($this->continuousBuffer) { + $encryptIV = $temp; + } + } + if ($this->continuousBuffer) { + if (!defined('OPENSSL_RAW_DATA')) { + $encryptIV.= @openssl_encrypt('', $this->cipher_name_openssl_ecb, $key, $this->openssl_options); + } + $encryptIV = openssl_decrypt($encryptIV, $this->cipher_name_openssl_ecb, $key, $this->openssl_options); + if ($overflow) { + $this->_increment_str($encryptIV); + } + } + + return $ciphertext; + } + + /** + * OpenSSL OFB Processor + * + * PHP's OpenSSL bindings do not operate in continuous mode so we'll wrap around it. Since the keystream + * for OFB is the same for both encrypting and decrypting this function is re-used by both Base::encrypt() + * and Base::decrypt(). + * + * @see self::encrypt() + * @see self::decrypt() + * @param string $plaintext + * @param string $encryptIV + * @param array $buffer + * @return string + * @access private + */ + function _openssl_ofb_process($plaintext, &$encryptIV, &$buffer) + { + if (strlen($buffer['xor'])) { + $ciphertext = $plaintext ^ $buffer['xor']; + $buffer['xor'] = substr($buffer['xor'], strlen($ciphertext)); + $plaintext = substr($plaintext, strlen($ciphertext)); + } else { + $ciphertext = ''; + } + + $block_size = $this->block_size; + + $len = strlen($plaintext); + $key = $this->key; + $overflow = $len % $block_size; + + if (strlen($plaintext)) { + if ($overflow) { + $ciphertext.= openssl_encrypt(substr($plaintext, 0, -$overflow) . str_repeat("\0", $block_size), $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); + $xor = $this->_string_pop($ciphertext, $block_size); + if ($this->continuousBuffer) { + $encryptIV = $xor; + } + $ciphertext.= $this->_string_shift($xor, $overflow) ^ substr($plaintext, -$overflow); + if ($this->continuousBuffer) { + $buffer['xor'] = $xor; + } + } else { + $ciphertext = openssl_encrypt($plaintext, $this->cipher_name_openssl, $key, $this->openssl_options, $encryptIV); + if ($this->continuousBuffer) { + $encryptIV = substr($ciphertext, -$block_size) ^ substr($plaintext, -$block_size); + } + } + } + + return $ciphertext; + } + + /** + * phpseclib <-> OpenSSL Mode Mapper + * + * May need to be overwritten by classes extending this one in some cases + * + * @return int + * @access private + */ + function _openssl_translate_mode() + { + switch ($this->mode) { + case self::MODE_ECB: + return 'ecb'; + case self::MODE_CBC: + return 'cbc'; + case self::MODE_CTR: + return 'ctr'; + case self::MODE_CFB: + return 'cfb'; + case self::MODE_CFB8: + return 'cfb8'; + case self::MODE_OFB: + return 'ofb'; + } + } + + /** + * Pad "packets". + * + * Block ciphers working by encrypting between their specified [$this->]block_size at a time + * If you ever need to encrypt or decrypt something that isn't of the proper length, it becomes necessary to + * pad the input so that it is of the proper length. + * + * Padding is enabled by default. Sometimes, however, it is undesirable to pad strings. Such is the case in SSH, + * where "packets" are padded with random bytes before being encrypted. Unpad these packets and you risk stripping + * away characters that shouldn't be stripped away. (SSH knows how many bytes are added because the length is + * transmitted separately) + * + * @see self::disablePadding() + * @access public + */ + function enablePadding() + { + $this->padding = true; + } + + /** + * Do not pad packets. + * + * @see self::enablePadding() + * @access public + */ + function disablePadding() + { + $this->padding = false; + } + + /** + * Treat consecutive "packets" as if they are a continuous buffer. + * + * Say you have a 32-byte plaintext $plaintext. Using the default behavior, the two following code snippets + * will yield different outputs: + * + * + * echo $rijndael->encrypt(substr($plaintext, 0, 16)); + * echo $rijndael->encrypt(substr($plaintext, 16, 16)); + * + * + * echo $rijndael->encrypt($plaintext); + * + * + * The solution is to enable the continuous buffer. Although this will resolve the above discrepancy, it creates + * another, as demonstrated with the following: + * + * + * $rijndael->encrypt(substr($plaintext, 0, 16)); + * echo $rijndael->decrypt($rijndael->encrypt(substr($plaintext, 16, 16))); + * + * + * echo $rijndael->decrypt($rijndael->encrypt(substr($plaintext, 16, 16))); + * + * + * With the continuous buffer disabled, these would yield the same output. With it enabled, they yield different + * outputs. The reason is due to the fact that the initialization vector's change after every encryption / + * decryption round when the continuous buffer is enabled. When it's disabled, they remain constant. + * + * Put another way, when the continuous buffer is enabled, the state of the \phpseclib\Crypt\*() object changes after each + * encryption / decryption round, whereas otherwise, it'd remain constant. For this reason, it's recommended that + * continuous buffers not be used. They do offer better security and are, in fact, sometimes required (SSH uses them), + * however, they are also less intuitive and more likely to cause you problems. + * + * @see self::disableContinuousBuffer() + * @access public + * @internal Could, but not must, extend by the child Crypt_* class + */ + function enableContinuousBuffer() + { + if ($this->mode == self::MODE_ECB) { + return; + } + + $this->continuousBuffer = true; + + $this->_setEngine(); + } + + /** + * Treat consecutive packets as if they are a discontinuous buffer. + * + * The default behavior. + * + * @see self::enableContinuousBuffer() + * @access public + * @internal Could, but not must, extend by the child Crypt_* class + */ + function disableContinuousBuffer() + { + if ($this->mode == self::MODE_ECB) { + return; + } + if (!$this->continuousBuffer) { + return; + } + + $this->continuousBuffer = false; + $this->changed = true; + + $this->_setEngine(); + } + + /** + * Test for engine validity + * + * @see self::__construct() + * @param int $engine + * @access public + * @return bool + */ + function isValidEngine($engine) + { + switch ($engine) { + case self::ENGINE_OPENSSL: + if ($this->mode == self::MODE_STREAM && $this->continuousBuffer) { + return false; + } + $this->openssl_emulate_ctr = false; + $result = $this->cipher_name_openssl && + extension_loaded('openssl') && + // PHP 5.3.0 - 5.3.2 did not let you set IV's + version_compare(PHP_VERSION, '5.3.3', '>='); + if (!$result) { + return false; + } + + // prior to PHP 5.4.0 OPENSSL_RAW_DATA and OPENSSL_ZERO_PADDING were not defined. instead of expecting an integer + // $options openssl_encrypt expected a boolean $raw_data. + if (!defined('OPENSSL_RAW_DATA')) { + $this->openssl_options = true; + } else { + $this->openssl_options = OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING; + } + + $methods = openssl_get_cipher_methods(); + if (in_array($this->cipher_name_openssl, $methods)) { + return true; + } + // not all of openssl's symmetric cipher's support ctr. for those + // that don't we'll emulate it + switch ($this->mode) { + case self::MODE_CTR: + if (in_array($this->cipher_name_openssl_ecb, $methods)) { + $this->openssl_emulate_ctr = true; + return true; + } + } + return false; + case self::ENGINE_MCRYPT: + set_error_handler(array($this, 'do_nothing')); + $result = $this->cipher_name_mcrypt && + extension_loaded('mcrypt') && + in_array($this->cipher_name_mcrypt, mcrypt_list_algorithms()); + restore_error_handler(); + return $result; + case self::ENGINE_INTERNAL: + return true; + } + + return false; + } + + /** + * Sets the preferred crypt engine + * + * Currently, $engine could be: + * + * - \phpseclib\Crypt\Base::ENGINE_OPENSSL [very fast] + * + * - \phpseclib\Crypt\Base::ENGINE_MCRYPT [fast] + * + * - \phpseclib\Crypt\Base::ENGINE_INTERNAL [slow] + * + * If the preferred crypt engine is not available the fastest available one will be used + * + * @see self::__construct() + * @param int $engine + * @access public + */ + function setPreferredEngine($engine) + { + switch ($engine) { + //case self::ENGINE_OPENSSL; + case self::ENGINE_MCRYPT: + case self::ENGINE_INTERNAL: + $this->preferredEngine = $engine; + break; + default: + $this->preferredEngine = self::ENGINE_OPENSSL; + } + + $this->_setEngine(); + } + + /** + * Returns the engine currently being utilized + * + * @see self::_setEngine() + * @access public + */ + function getEngine() + { + return $this->engine; + } + + /** + * Sets the engine as appropriate + * + * @see self::__construct() + * @access private + */ + function _setEngine() + { + $this->engine = null; + + $candidateEngines = array( + $this->preferredEngine, + self::ENGINE_OPENSSL, + self::ENGINE_MCRYPT + ); + foreach ($candidateEngines as $engine) { + if ($this->isValidEngine($engine)) { + $this->engine = $engine; + break; + } + } + if (!$this->engine) { + $this->engine = self::ENGINE_INTERNAL; + } + + if ($this->engine != self::ENGINE_MCRYPT && $this->enmcrypt) { + set_error_handler(array($this, 'do_nothing')); + // Closing the current mcrypt resource(s). _mcryptSetup() will, if needed, + // (re)open them with the module named in $this->cipher_name_mcrypt + mcrypt_module_close($this->enmcrypt); + mcrypt_module_close($this->demcrypt); + $this->enmcrypt = null; + $this->demcrypt = null; + + if ($this->ecb) { + mcrypt_module_close($this->ecb); + $this->ecb = null; + } + restore_error_handler(); + } + + $this->changed = true; + } + + /** + * Encrypts a block + * + * Note: Must be extended by the child \phpseclib\Crypt\* class + * + * @access private + * @param string $in + * @return string + */ + abstract function _encryptBlock($in); + + /** + * Decrypts a block + * + * Note: Must be extended by the child \phpseclib\Crypt\* class + * + * @access private + * @param string $in + * @return string + */ + abstract function _decryptBlock($in); + + /** + * Setup the key (expansion) + * + * Only used if $engine == self::ENGINE_INTERNAL + * + * Note: Must extend by the child \phpseclib\Crypt\* class + * + * @see self::_setup() + * @access private + */ + abstract function _setupKey(); + + /** + * Setup the self::ENGINE_INTERNAL $engine + * + * (re)init, if necessary, the internal cipher $engine and flush all $buffers + * Used (only) if $engine == self::ENGINE_INTERNAL + * + * _setup() will be called each time if $changed === true + * typically this happens when using one or more of following public methods: + * + * - setKey() + * + * - setIV() + * + * - disableContinuousBuffer() + * + * - First run of encrypt() / decrypt() with no init-settings + * + * @see self::setKey() + * @see self::setIV() + * @see self::disableContinuousBuffer() + * @access private + * @internal _setup() is always called before en/decryption. + * @internal Could, but not must, extend by the child Crypt_* class + */ + function _setup() + { + $this->_clearBuffers(); + $this->_setupKey(); + + if ($this->use_inline_crypt) { + $this->_setupInlineCrypt(); + } + } + + /** + * Setup the self::ENGINE_MCRYPT $engine + * + * (re)init, if necessary, the (ext)mcrypt resources and flush all $buffers + * Used (only) if $engine = self::ENGINE_MCRYPT + * + * _setupMcrypt() will be called each time if $changed === true + * typically this happens when using one or more of following public methods: + * + * - setKey() + * + * - setIV() + * + * - disableContinuousBuffer() + * + * - First run of encrypt() / decrypt() + * + * @see self::setKey() + * @see self::setIV() + * @see self::disableContinuousBuffer() + * @access private + * @internal Could, but not must, extend by the child Crypt_* class + */ + function _setupMcrypt() + { + $this->_clearBuffers(); + $this->enchanged = $this->dechanged = true; + + if (!isset($this->enmcrypt)) { + static $mcrypt_modes = array( + self::MODE_CTR => 'ctr', + self::MODE_ECB => MCRYPT_MODE_ECB, + self::MODE_CBC => MCRYPT_MODE_CBC, + self::MODE_CFB => 'ncfb', + self::MODE_CFB8 => MCRYPT_MODE_CFB, + self::MODE_OFB => MCRYPT_MODE_NOFB, + self::MODE_OFB8 => MCRYPT_MODE_OFB, + self::MODE_STREAM => MCRYPT_MODE_STREAM, + ); + + $this->demcrypt = mcrypt_module_open($this->cipher_name_mcrypt, '', $mcrypt_modes[$this->mode], ''); + $this->enmcrypt = mcrypt_module_open($this->cipher_name_mcrypt, '', $mcrypt_modes[$this->mode], ''); + + // we need the $ecb mcrypt resource (only) in MODE_CFB with enableContinuousBuffer() + // to workaround mcrypt's broken ncfb implementation in buffered mode + // see: {@link http://phpseclib.sourceforge.net/cfb-demo.phps} + if ($this->mode == self::MODE_CFB) { + $this->ecb = mcrypt_module_open($this->cipher_name_mcrypt, '', MCRYPT_MODE_ECB, ''); + } + } // else should mcrypt_generic_deinit be called? + + if ($this->mode == self::MODE_CFB) { + mcrypt_generic_init($this->ecb, $this->key, str_repeat("\0", $this->block_size)); + } + } + + /** + * Pads a string + * + * Pads a string using the RSA PKCS padding standards so that its length is a multiple of the blocksize. + * $this->block_size - (strlen($text) % $this->block_size) bytes are added, each of which is equal to + * chr($this->block_size - (strlen($text) % $this->block_size) + * + * If padding is disabled and $text is not a multiple of the blocksize, the string will be padded regardless + * and padding will, hence forth, be enabled. + * + * @see self::_unpad() + * @param string $text + * @access private + * @return string + */ + function _pad($text) + { + $length = strlen($text); + + if (!$this->padding) { + if ($length % $this->block_size == 0) { + return $text; + } else { + user_error("The plaintext's length ($length) is not a multiple of the block size ({$this->block_size})"); + $this->padding = true; + } + } + + $pad = $this->block_size - ($length % $this->block_size); + + return str_pad($text, $length + $pad, chr($pad)); + } + + /** + * Unpads a string. + * + * If padding is enabled and the reported padding length is invalid the encryption key will be assumed to be wrong + * and false will be returned. + * + * @see self::_pad() + * @param string $text + * @access private + * @return string + */ + function _unpad($text) + { + if (!$this->padding) { + return $text; + } + + $length = ord($text[strlen($text) - 1]); + + if (!$length || $length > $this->block_size) { + return false; + } + + return substr($text, 0, -$length); + } + + /** + * Clears internal buffers + * + * Clearing/resetting the internal buffers is done everytime + * after disableContinuousBuffer() or on cipher $engine (re)init + * ie after setKey() or setIV() + * + * @access public + * @internal Could, but not must, extend by the child Crypt_* class + */ + function _clearBuffers() + { + $this->enbuffer = $this->debuffer = array('ciphertext' => '', 'xor' => '', 'pos' => 0, 'enmcrypt_init' => true); + + // mcrypt's handling of invalid's $iv: + // $this->encryptIV = $this->decryptIV = strlen($this->iv) == $this->block_size ? $this->iv : str_repeat("\0", $this->block_size); + $this->encryptIV = $this->decryptIV = str_pad(substr($this->iv, 0, $this->block_size), $this->block_size, "\0"); + + if (!$this->skip_key_adjustment) { + $this->key = str_pad(substr($this->key, 0, $this->key_length), $this->key_length, "\0"); + } + } + + /** + * String Shift + * + * Inspired by array_shift + * + * @param string $string + * @param int $index + * @access private + * @return string + */ + function _string_shift(&$string, $index = 1) + { + $substr = substr($string, 0, $index); + $string = substr($string, $index); + return $substr; + } + + /** + * String Pop + * + * Inspired by array_pop + * + * @param string $string + * @param int $index + * @access private + * @return string + */ + function _string_pop(&$string, $index = 1) + { + $substr = substr($string, -$index); + $string = substr($string, 0, -$index); + return $substr; + } + + /** + * Increment the current string + * + * @see self::decrypt() + * @see self::encrypt() + * @param string $var + * @access private + */ + function _increment_str(&$var) + { + if (function_exists('sodium_increment')) { + $var = strrev($var); + sodium_increment($var); + $var = strrev($var); + return; + } + + for ($i = 4; $i <= strlen($var); $i+= 4) { + $temp = substr($var, -$i, 4); + switch ($temp) { + case "\xFF\xFF\xFF\xFF": + $var = substr_replace($var, "\x00\x00\x00\x00", -$i, 4); + break; + case "\x7F\xFF\xFF\xFF": + $var = substr_replace($var, "\x80\x00\x00\x00", -$i, 4); + return; + default: + $temp = unpack('Nnum', $temp); + $var = substr_replace($var, pack('N', $temp['num'] + 1), -$i, 4); + return; + } + } + + $remainder = strlen($var) % 4; + + if ($remainder == 0) { + return; + } + + $temp = unpack('Nnum', str_pad(substr($var, 0, $remainder), 4, "\0", STR_PAD_LEFT)); + $temp = substr(pack('N', $temp['num'] + 1), -$remainder); + $var = substr_replace($var, $temp, 0, $remainder); + } + + /** + * Setup the performance-optimized function for de/encrypt() + * + * Stores the created (or existing) callback function-name + * in $this->inline_crypt + * + * Internally for phpseclib developers: + * + * _setupInlineCrypt() would be called only if: + * + * - $engine == self::ENGINE_INTERNAL and + * + * - $use_inline_crypt === true + * + * - each time on _setup(), after(!) _setupKey() + * + * + * This ensures that _setupInlineCrypt() has always a + * full ready2go initializated internal cipher $engine state + * where, for example, the keys allready expanded, + * keys/block_size calculated and such. + * + * It is, each time if called, the responsibility of _setupInlineCrypt(): + * + * - to set $this->inline_crypt to a valid and fully working callback function + * as a (faster) replacement for encrypt() / decrypt() + * + * - NOT to create unlimited callback functions (for memory reasons!) + * no matter how often _setupInlineCrypt() would be called. At some + * point of amount they must be generic re-useable. + * + * - the code of _setupInlineCrypt() it self, + * and the generated callback code, + * must be, in following order: + * - 100% safe + * - 100% compatible to encrypt()/decrypt() + * - using only php5+ features/lang-constructs/php-extensions if + * compatibility (down to php4) or fallback is provided + * - readable/maintainable/understandable/commented and... not-cryptic-styled-code :-) + * - >= 10% faster than encrypt()/decrypt() [which is, by the way, + * the reason for the existence of _setupInlineCrypt() :-)] + * - memory-nice + * - short (as good as possible) + * + * Note: - _setupInlineCrypt() is using _createInlineCryptFunction() to create the full callback function code. + * - In case of using inline crypting, _setupInlineCrypt() must extend by the child \phpseclib\Crypt\* class. + * - The following variable names are reserved: + * - $_* (all variable names prefixed with an underscore) + * - $self (object reference to it self. Do not use $this, but $self instead) + * - $in (the content of $in has to en/decrypt by the generated code) + * - The callback function should not use the 'return' statement, but en/decrypt'ing the content of $in only + * + * + * @see self::_setup() + * @see self::_createInlineCryptFunction() + * @see self::encrypt() + * @see self::decrypt() + * @access private + * @internal If a Crypt_* class providing inline crypting it must extend _setupInlineCrypt() + */ + function _setupInlineCrypt() + { + // If, for any reason, an extending \phpseclib\Crypt\Base() \phpseclib\Crypt\* class + // not using inline crypting then it must be ensured that: $this->use_inline_crypt = false + // ie in the class var declaration of $use_inline_crypt in general for the \phpseclib\Crypt\* class, + // in the constructor at object instance-time + // or, if it's runtime-specific, at runtime + + $this->use_inline_crypt = false; + } + + /** + * Creates the performance-optimized function for en/decrypt() + * + * Internally for phpseclib developers: + * + * _createInlineCryptFunction(): + * + * - merge the $cipher_code [setup'ed by _setupInlineCrypt()] + * with the current [$this->]mode of operation code + * + * - create the $inline function, which called by encrypt() / decrypt() + * as its replacement to speed up the en/decryption operations. + * + * - return the name of the created $inline callback function + * + * - used to speed up en/decryption + * + * + * + * The main reason why can speed up things [up to 50%] this way are: + * + * - using variables more effective then regular. + * (ie no use of expensive arrays but integers $k_0, $k_1 ... + * or even, for example, the pure $key[] values hardcoded) + * + * - avoiding 1000's of function calls of ie _encryptBlock() + * but inlining the crypt operations. + * in the mode of operation for() loop. + * + * - full loop unroll the (sometimes key-dependent) rounds + * avoiding this way ++$i counters and runtime-if's etc... + * + * The basic code architectur of the generated $inline en/decrypt() + * lambda function, in pseudo php, is: + * + * + * +----------------------------------------------------------------------------------------------+ + * | callback $inline = create_function: | + * | lambda_function_0001_crypt_ECB($action, $text) | + * | { | + * | INSERT PHP CODE OF: | + * | $cipher_code['init_crypt']; // general init code. | + * | // ie: $sbox'es declarations used for | + * | // encrypt and decrypt'ing. | + * | | + * | switch ($action) { | + * | case 'encrypt': | + * | INSERT PHP CODE OF: | + * | $cipher_code['init_encrypt']; // encrypt sepcific init code. | + * | ie: specified $key or $box | + * | declarations for encrypt'ing. | + * | | + * | foreach ($ciphertext) { | + * | $in = $block_size of $ciphertext; | + * | | + * | INSERT PHP CODE OF: | + * | $cipher_code['encrypt_block']; // encrypt's (string) $in, which is always: | + * | // strlen($in) == $this->block_size | + * | // here comes the cipher algorithm in action | + * | // for encryption. | + * | // $cipher_code['encrypt_block'] has to | + * | // encrypt the content of the $in variable | + * | | + * | $plaintext .= $in; | + * | } | + * | return $plaintext; | + * | | + * | case 'decrypt': | + * | INSERT PHP CODE OF: | + * | $cipher_code['init_decrypt']; // decrypt sepcific init code | + * | ie: specified $key or $box | + * | declarations for decrypt'ing. | + * | foreach ($plaintext) { | + * | $in = $block_size of $plaintext; | + * | | + * | INSERT PHP CODE OF: | + * | $cipher_code['decrypt_block']; // decrypt's (string) $in, which is always | + * | // strlen($in) == $this->block_size | + * | // here comes the cipher algorithm in action | + * | // for decryption. | + * | // $cipher_code['decrypt_block'] has to | + * | // decrypt the content of the $in variable | + * | $ciphertext .= $in; | + * | } | + * | return $ciphertext; | + * | } | + * | } | + * +----------------------------------------------------------------------------------------------+ + * + * + * See also the \phpseclib\Crypt\*::_setupInlineCrypt()'s for + * productive inline $cipher_code's how they works. + * + * Structure of: + * + * $cipher_code = array( + * 'init_crypt' => (string) '', // optional + * 'init_encrypt' => (string) '', // optional + * 'init_decrypt' => (string) '', // optional + * 'encrypt_block' => (string) '', // required + * 'decrypt_block' => (string) '' // required + * ); + * + * + * @see self::_setupInlineCrypt() + * @see self::encrypt() + * @see self::decrypt() + * @param array $cipher_code + * @access private + * @return string (the name of the created callback function) + */ + function _createInlineCryptFunction($cipher_code) + { + $block_size = $this->block_size; + + // optional + $init_crypt = isset($cipher_code['init_crypt']) ? $cipher_code['init_crypt'] : ''; + $init_encrypt = isset($cipher_code['init_encrypt']) ? $cipher_code['init_encrypt'] : ''; + $init_decrypt = isset($cipher_code['init_decrypt']) ? $cipher_code['init_decrypt'] : ''; + // required + $encrypt_block = $cipher_code['encrypt_block']; + $decrypt_block = $cipher_code['decrypt_block']; + + // Generating mode of operation inline code, + // merged with the $cipher_code algorithm + // for encrypt- and decryption. + switch ($this->mode) { + case self::MODE_ECB: + $encrypt = $init_encrypt . ' + $_ciphertext = ""; + $_plaintext_len = strlen($_text); + + for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { + $in = substr($_text, $_i, '.$block_size.'); + '.$encrypt_block.' + $_ciphertext.= $in; + } + + return $_ciphertext; + '; + + $decrypt = $init_decrypt . ' + $_plaintext = ""; + $_text = str_pad($_text, strlen($_text) + ('.$block_size.' - strlen($_text) % '.$block_size.') % '.$block_size.', chr(0)); + $_ciphertext_len = strlen($_text); + + for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { + $in = substr($_text, $_i, '.$block_size.'); + '.$decrypt_block.' + $_plaintext.= $in; + } + + return $self->_unpad($_plaintext); + '; + break; + case self::MODE_CTR: + $encrypt = $init_encrypt . ' + $_ciphertext = ""; + $_plaintext_len = strlen($_text); + $_xor = $self->encryptIV; + $_buffer = &$self->enbuffer; + if (strlen($_buffer["ciphertext"])) { + for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { + $_block = substr($_text, $_i, '.$block_size.'); + if (strlen($_block) > strlen($_buffer["ciphertext"])) { + $in = $_xor; + '.$encrypt_block.' + $self->_increment_str($_xor); + $_buffer["ciphertext"].= $in; + } + $_key = $self->_string_shift($_buffer["ciphertext"], '.$block_size.'); + $_ciphertext.= $_block ^ $_key; + } + } else { + for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { + $_block = substr($_text, $_i, '.$block_size.'); + $in = $_xor; + '.$encrypt_block.' + $self->_increment_str($_xor); + $_key = $in; + $_ciphertext.= $_block ^ $_key; + } + } + if ($self->continuousBuffer) { + $self->encryptIV = $_xor; + if ($_start = $_plaintext_len % '.$block_size.') { + $_buffer["ciphertext"] = substr($_key, $_start) . $_buffer["ciphertext"]; + } + } + + return $_ciphertext; + '; + + $decrypt = $init_encrypt . ' + $_plaintext = ""; + $_ciphertext_len = strlen($_text); + $_xor = $self->decryptIV; + $_buffer = &$self->debuffer; + + if (strlen($_buffer["ciphertext"])) { + for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { + $_block = substr($_text, $_i, '.$block_size.'); + if (strlen($_block) > strlen($_buffer["ciphertext"])) { + $in = $_xor; + '.$encrypt_block.' + $self->_increment_str($_xor); + $_buffer["ciphertext"].= $in; + } + $_key = $self->_string_shift($_buffer["ciphertext"], '.$block_size.'); + $_plaintext.= $_block ^ $_key; + } + } else { + for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { + $_block = substr($_text, $_i, '.$block_size.'); + $in = $_xor; + '.$encrypt_block.' + $self->_increment_str($_xor); + $_key = $in; + $_plaintext.= $_block ^ $_key; + } + } + if ($self->continuousBuffer) { + $self->decryptIV = $_xor; + if ($_start = $_ciphertext_len % '.$block_size.') { + $_buffer["ciphertext"] = substr($_key, $_start) . $_buffer["ciphertext"]; + } + } + + return $_plaintext; + '; + break; + case self::MODE_CFB: + $encrypt = $init_encrypt . ' + $_ciphertext = ""; + $_buffer = &$self->enbuffer; + + if ($self->continuousBuffer) { + $_iv = &$self->encryptIV; + $_pos = &$_buffer["pos"]; + } else { + $_iv = $self->encryptIV; + $_pos = 0; + } + $_len = strlen($_text); + $_i = 0; + if ($_pos) { + $_orig_pos = $_pos; + $_max = '.$block_size.' - $_pos; + if ($_len >= $_max) { + $_i = $_max; + $_len-= $_max; + $_pos = 0; + } else { + $_i = $_len; + $_pos+= $_len; + $_len = 0; + } + $_ciphertext = substr($_iv, $_orig_pos) ^ $_text; + $_iv = substr_replace($_iv, $_ciphertext, $_orig_pos, $_i); + } + while ($_len >= '.$block_size.') { + $in = $_iv; + '.$encrypt_block.'; + $_iv = $in ^ substr($_text, $_i, '.$block_size.'); + $_ciphertext.= $_iv; + $_len-= '.$block_size.'; + $_i+= '.$block_size.'; + } + if ($_len) { + $in = $_iv; + '.$encrypt_block.' + $_iv = $in; + $_block = $_iv ^ substr($_text, $_i); + $_iv = substr_replace($_iv, $_block, 0, $_len); + $_ciphertext.= $_block; + $_pos = $_len; + } + return $_ciphertext; + '; + + $decrypt = $init_encrypt . ' + $_plaintext = ""; + $_buffer = &$self->debuffer; + + if ($self->continuousBuffer) { + $_iv = &$self->decryptIV; + $_pos = &$_buffer["pos"]; + } else { + $_iv = $self->decryptIV; + $_pos = 0; + } + $_len = strlen($_text); + $_i = 0; + if ($_pos) { + $_orig_pos = $_pos; + $_max = '.$block_size.' - $_pos; + if ($_len >= $_max) { + $_i = $_max; + $_len-= $_max; + $_pos = 0; + } else { + $_i = $_len; + $_pos+= $_len; + $_len = 0; + } + $_plaintext = substr($_iv, $_orig_pos) ^ $_text; + $_iv = substr_replace($_iv, substr($_text, 0, $_i), $_orig_pos, $_i); + } + while ($_len >= '.$block_size.') { + $in = $_iv; + '.$encrypt_block.' + $_iv = $in; + $cb = substr($_text, $_i, '.$block_size.'); + $_plaintext.= $_iv ^ $cb; + $_iv = $cb; + $_len-= '.$block_size.'; + $_i+= '.$block_size.'; + } + if ($_len) { + $in = $_iv; + '.$encrypt_block.' + $_iv = $in; + $_plaintext.= $_iv ^ substr($_text, $_i); + $_iv = substr_replace($_iv, substr($_text, $_i), 0, $_len); + $_pos = $_len; + } + + return $_plaintext; + '; + break; + case self::MODE_CFB8: + $encrypt = $init_encrypt . ' + $_ciphertext = ""; + $_len = strlen($_text); + $_iv = $self->encryptIV; + + for ($_i = 0; $_i < $_len; ++$_i) { + $in = $_iv; + '.$encrypt_block.' + $_ciphertext.= ($_c = $_text[$_i] ^ $in); + $_iv = substr($_iv, 1) . $_c; + } + + if ($self->continuousBuffer) { + if ($_len >= '.$block_size.') { + $self->encryptIV = substr($_ciphertext, -'.$block_size.'); + } else { + $self->encryptIV = substr($self->encryptIV, $_len - '.$block_size.') . substr($_ciphertext, -$_len); + } + } + + return $_ciphertext; + '; + $decrypt = $init_encrypt . ' + $_plaintext = ""; + $_len = strlen($_text); + $_iv = $self->decryptIV; + + for ($_i = 0; $_i < $_len; ++$_i) { + $in = $_iv; + '.$encrypt_block.' + $_plaintext.= $_text[$_i] ^ $in; + $_iv = substr($_iv, 1) . $_text[$_i]; + } + + if ($self->continuousBuffer) { + if ($_len >= '.$block_size.') { + $self->decryptIV = substr($_text, -'.$block_size.'); + } else { + $self->decryptIV = substr($self->decryptIV, $_len - '.$block_size.') . substr($_text, -$_len); + } + } + + return $_plaintext; + '; + break; + case self::MODE_OFB8: + $encrypt = $init_encrypt . ' + $_ciphertext = ""; + $_len = strlen($_text); + $_iv = $self->encryptIV; + + for ($_i = 0; $_i < $_len; ++$_i) { + $in = $_iv; + '.$encrypt_block.' + $_ciphertext.= $_text[$_i] ^ $in; + $_iv = substr($_iv, 1) . $in[0]; + } + + if ($self->continuousBuffer) { + $self->encryptIV = $_iv; + } + + return $_ciphertext; + '; + $decrypt = $init_encrypt . ' + $_plaintext = ""; + $_len = strlen($_text); + $_iv = $self->decryptIV; + + for ($_i = 0; $_i < $_len; ++$_i) { + $in = $_iv; + '.$encrypt_block.' + $_plaintext.= $_text[$_i] ^ $in; + $_iv = substr($_iv, 1) . $in[0]; + } + + if ($self->continuousBuffer) { + $self->decryptIV = $_iv; + } + + return $_plaintext; + '; + break; + case self::MODE_OFB: + $encrypt = $init_encrypt . ' + $_ciphertext = ""; + $_plaintext_len = strlen($_text); + $_xor = $self->encryptIV; + $_buffer = &$self->enbuffer; + + if (strlen($_buffer["xor"])) { + for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { + $_block = substr($_text, $_i, '.$block_size.'); + if (strlen($_block) > strlen($_buffer["xor"])) { + $in = $_xor; + '.$encrypt_block.' + $_xor = $in; + $_buffer["xor"].= $_xor; + } + $_key = $self->_string_shift($_buffer["xor"], '.$block_size.'); + $_ciphertext.= $_block ^ $_key; + } + } else { + for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { + $in = $_xor; + '.$encrypt_block.' + $_xor = $in; + $_ciphertext.= substr($_text, $_i, '.$block_size.') ^ $_xor; + } + $_key = $_xor; + } + if ($self->continuousBuffer) { + $self->encryptIV = $_xor; + if ($_start = $_plaintext_len % '.$block_size.') { + $_buffer["xor"] = substr($_key, $_start) . $_buffer["xor"]; + } + } + return $_ciphertext; + '; + + $decrypt = $init_encrypt . ' + $_plaintext = ""; + $_ciphertext_len = strlen($_text); + $_xor = $self->decryptIV; + $_buffer = &$self->debuffer; + + if (strlen($_buffer["xor"])) { + for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { + $_block = substr($_text, $_i, '.$block_size.'); + if (strlen($_block) > strlen($_buffer["xor"])) { + $in = $_xor; + '.$encrypt_block.' + $_xor = $in; + $_buffer["xor"].= $_xor; + } + $_key = $self->_string_shift($_buffer["xor"], '.$block_size.'); + $_plaintext.= $_block ^ $_key; + } + } else { + for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { + $in = $_xor; + '.$encrypt_block.' + $_xor = $in; + $_plaintext.= substr($_text, $_i, '.$block_size.') ^ $_xor; + } + $_key = $_xor; + } + if ($self->continuousBuffer) { + $self->decryptIV = $_xor; + if ($_start = $_ciphertext_len % '.$block_size.') { + $_buffer["xor"] = substr($_key, $_start) . $_buffer["xor"]; + } + } + return $_plaintext; + '; + break; + case self::MODE_STREAM: + $encrypt = $init_encrypt . ' + $_ciphertext = ""; + '.$encrypt_block.' + return $_ciphertext; + '; + $decrypt = $init_decrypt . ' + $_plaintext = ""; + '.$decrypt_block.' + return $_plaintext; + '; + break; + // case self::MODE_CBC: + default: + $encrypt = $init_encrypt . ' + $_ciphertext = ""; + $_plaintext_len = strlen($_text); + + $in = $self->encryptIV; + + for ($_i = 0; $_i < $_plaintext_len; $_i+= '.$block_size.') { + $in = substr($_text, $_i, '.$block_size.') ^ $in; + '.$encrypt_block.' + $_ciphertext.= $in; + } + + if ($self->continuousBuffer) { + $self->encryptIV = $in; + } + + return $_ciphertext; + '; + + $decrypt = $init_decrypt . ' + $_plaintext = ""; + $_text = str_pad($_text, strlen($_text) + ('.$block_size.' - strlen($_text) % '.$block_size.') % '.$block_size.', chr(0)); + $_ciphertext_len = strlen($_text); + + $_iv = $self->decryptIV; + + for ($_i = 0; $_i < $_ciphertext_len; $_i+= '.$block_size.') { + $in = $_block = substr($_text, $_i, '.$block_size.'); + '.$decrypt_block.' + $_plaintext.= $in ^ $_iv; + $_iv = $_block; + } + + if ($self->continuousBuffer) { + $self->decryptIV = $_iv; + } + + return $self->_unpad($_plaintext); + '; + break; + } + + // Create the $inline function and return its name as string. Ready to run! + eval('$func = function ($_action, &$self, $_text) { ' . $init_crypt . 'if ($_action == "encrypt") { ' . $encrypt . ' } else { ' . $decrypt . ' } };'); + return $func; + } + + /** + * Holds the lambda_functions table (classwide) + * + * Each name of the lambda function, created from + * _setupInlineCrypt() && _createInlineCryptFunction() + * is stored, classwide (!), here for reusing. + * + * The string-based index of $function is a classwide + * unique value representing, at least, the $mode of + * operation (or more... depends of the optimizing level) + * for which $mode the lambda function was created. + * + * @access private + * @return array &$functions + */ + function &_getLambdaFunctions() + { + static $functions = array(); + return $functions; + } + + /** + * Generates a digest from $bytes + * + * @see self::_setupInlineCrypt() + * @access private + * @param string $bytes + * @return string + */ + function _hashInlineCryptFunction($bytes) + { + if (!isset(self::$WHIRLPOOL_AVAILABLE)) { + self::$WHIRLPOOL_AVAILABLE = extension_loaded('hash') && in_array('whirlpool', hash_algos()); + } + + $result = ''; + $hash = $bytes; + + switch (true) { + case self::$WHIRLPOOL_AVAILABLE: + foreach (str_split($bytes, 64) as $t) { + $hash = hash('whirlpool', $hash, true); + $result .= $t ^ $hash; + } + return $result . hash('whirlpool', $hash, true); + default: + $len = strlen($bytes); + for ($i = 0; $i < $len; $i+=20) { + $t = substr($bytes, $i, 20); + $hash = pack('H*', sha1($hash)); + $result .= $t ^ $hash; + } + return $result . pack('H*', sha1($hash)); + } + } + + /** + * Convert float to int + * + * On ARM CPUs converting floats to ints doesn't always work + * + * @access private + * @param string $x + * @return int + */ + function safe_intval($x) + { + if (is_int($x)) { + return $x; + } + return (fmod($x, 0x80000000) & 0x7FFFFFFF) | + ((fmod(floor($x / 0x80000000), 2) & 1) << 31); + } + + /** + * eval()'able string for in-line float to int + * + * @access private + * @return string + */ + function safe_intval_inline() + { + if (CRYPT_BASE_USE_REG_INTVAL) { + return PHP_INT_SIZE == 4 ? 'intval(%s)' : '%s'; + } + + $safeint = '(is_int($temp = %s) ? $temp : (fmod($temp, 0x80000000) & 0x7FFFFFFF) | '; + return $safeint . '((fmod(floor($temp / 0x80000000), 2) & 1) << 31))'; + } + + /** + * Dummy error handler to suppress mcrypt errors + * + * @access private + */ + function do_nothing() + { + } + + /** + * Is the continuous buffer enabled? + * + * @access public + * @return boolean + */ + function continuousBufferEnabled() + { + return $this->continuousBuffer; + } +} diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php new file mode 100755 index 0000000..e039340 --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Random.php @@ -0,0 +1,280 @@ + + * + *
      + * + * @category Crypt + * @package Random + * @author Jim Wigginton + * @copyright 2007 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +namespace phpseclib\Crypt; + +/** + * Pure-PHP Random Number Generator + * + * @package Random + * @author Jim Wigginton + * @access public + */ +class Random +{ + /** + * Generate a random string. + * + * Although microoptimizations are generally discouraged as they impair readability this function is ripe with + * microoptimizations because this function has the potential of being called a huge number of times. + * eg. for RSA key generation. + * + * @param int $length + * @return string + */ + static function string($length) + { + if (!$length) { + return ''; + } + + if (version_compare(PHP_VERSION, '7.0.0', '>=')) { + try { + return \random_bytes($length); + } catch (\Throwable $e) { + // If a sufficient source of randomness is unavailable, random_bytes() will throw an + // object that implements the Throwable interface (Exception, TypeError, Error). + // We don't actually need to do anything here. The string() method should just continue + // as normal. Note, however, that if we don't have a sufficient source of randomness for + // random_bytes(), most of the other calls here will fail too, so we'll end up using + // the PHP implementation. + } + } + + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { + // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call. + // ie. class_alias is a function that was introduced in PHP 5.3 + if (extension_loaded('mcrypt') && function_exists('class_alias')) { + return @mcrypt_create_iv($length); + } + // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was, + // to quote , "possible blocking behavior". as of 5.3.4 + // openssl_random_pseudo_bytes and mcrypt_create_iv do the exact same thing on Windows. ie. they both + // call php_win32_get_random_bytes(): + // + // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/openssl/openssl.c#L5008 + // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1392 + // + // php_win32_get_random_bytes() is defined thusly: + // + // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/win32/winutil.c#L80 + // + // we're calling it, all the same, in the off chance that the mcrypt extension is not available + if (extension_loaded('openssl') && version_compare(PHP_VERSION, '5.3.4', '>=')) { + return openssl_random_pseudo_bytes($length); + } + } else { + // method 1. the fastest + if (extension_loaded('openssl')) { + return openssl_random_pseudo_bytes($length); + } + // method 2 + static $fp = true; + if ($fp === true) { + // warning's will be output unles the error suppression operator is used. errors such as + // "open_basedir restriction in effect", "Permission denied", "No such file or directory", etc. + $fp = @fopen('/dev/urandom', 'rb'); + } + if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource() + $temp = fread($fp, $length); + if (strlen($temp) == $length) { + return $temp; + } + } + // method 3. pretty much does the same thing as method 2 per the following url: + // https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391 + // surprisingly slower than method 2. maybe that's because mcrypt_create_iv does a bunch of error checking that we're + // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir + // restrictions or some such + if (extension_loaded('mcrypt')) { + return @mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); + } + } + // at this point we have no choice but to use a pure-PHP CSPRNG + + // cascade entropy across multiple PHP instances by fixing the session and collecting all + // environmental variables, including the previous session data and the current session + // data. + // + // mt_rand seeds itself by looking at the PID and the time, both of which are (relatively) + // easy to guess at. linux uses mouse clicks, keyboard timings, etc, as entropy sources, but + // PHP isn't low level to be able to use those as sources and on a web server there's not likely + // going to be a ton of keyboard or mouse action. web servers do have one thing that we can use + // however, a ton of people visiting the website. obviously you don't want to base your seeding + // soley on parameters a potential attacker sends but (1) not everything in $_SERVER is controlled + // by the user and (2) this isn't just looking at the data sent by the current user - it's based + // on the data sent by all users. one user requests the page and a hash of their info is saved. + // another user visits the page and the serialization of their data is utilized along with the + // server envirnment stuff and a hash of the previous http request data (which itself utilizes + // a hash of the session data before that). certainly an attacker should be assumed to have + // full control over his own http requests. he, however, is not going to have control over + // everyone's http requests. + static $crypto = false, $v; + if ($crypto === false) { + // save old session data + $old_session_id = session_id(); + $old_use_cookies = ini_get('session.use_cookies'); + $old_session_cache_limiter = session_cache_limiter(); + $_OLD_SESSION = isset($_SESSION) ? $_SESSION : false; + if ($old_session_id != '') { + session_write_close(); + } + + session_id(1); + ini_set('session.use_cookies', 0); + session_cache_limiter(''); + session_start(); + + $v = $seed = $_SESSION['seed'] = pack('H*', sha1( + (isset($_SERVER) ? phpseclib_safe_serialize($_SERVER) : '') . + (isset($_POST) ? phpseclib_safe_serialize($_POST) : '') . + (isset($_GET) ? phpseclib_safe_serialize($_GET) : '') . + (isset($_COOKIE) ? phpseclib_safe_serialize($_COOKIE) : '') . + // as of PHP 8.1 $GLOBALS can't be accessed by reference, which eliminates + // the need for phpseclib_safe_serialize. see https://wiki.php.net/rfc/restrict_globals_usage + // for more info + (version_compare(PHP_VERSION, '8.1.0', '>=') ? serialize($GLOBALS) : phpseclib_safe_serialize($GLOBALS)) . + phpseclib_safe_serialize($_SESSION) . + phpseclib_safe_serialize($_OLD_SESSION) + )); + if (!isset($_SESSION['count'])) { + $_SESSION['count'] = 0; + } + $_SESSION['count']++; + + session_write_close(); + + // restore old session data + if ($old_session_id != '') { + session_id($old_session_id); + session_start(); + ini_set('session.use_cookies', $old_use_cookies); + session_cache_limiter($old_session_cache_limiter); + } else { + if ($_OLD_SESSION !== false) { + $_SESSION = $_OLD_SESSION; + unset($_OLD_SESSION); + } else { + unset($_SESSION); + } + } + + // in SSH2 a shared secret and an exchange hash are generated through the key exchange process. + // the IV client to server is the hash of that "nonce" with the letter A and for the encryption key it's the letter C. + // if the hash doesn't produce enough a key or an IV that's long enough concat successive hashes of the + // original hash and the current hash. we'll be emulating that. for more info see the following URL: + // + // http://tools.ietf.org/html/rfc4253#section-7.2 + // + // see the is_string($crypto) part for an example of how to expand the keys + $key = pack('H*', sha1($seed . 'A')); + $iv = pack('H*', sha1($seed . 'C')); + + // ciphers are used as per the nist.gov link below. also, see this link: + // + // http://en.wikipedia.org/wiki/Cryptographically_secure_pseudorandom_number_generator#Designs_based_on_cryptographic_primitives + switch (true) { + case class_exists('\phpseclib\Crypt\AES'): + $crypto = new AES(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\Twofish'): + $crypto = new Twofish(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\Blowfish'): + $crypto = new Blowfish(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\TripleDES'): + $crypto = new TripleDES(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\DES'): + $crypto = new DES(Base::MODE_CTR); + break; + case class_exists('\phpseclib\Crypt\RC4'): + $crypto = new RC4(); + break; + default: + user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded'); + return false; + } + + $crypto->setKey($key); + $crypto->setIV($iv); + $crypto->enableContinuousBuffer(); + } + + //return $crypto->encrypt(str_repeat("\0", $length)); + + // the following is based off of ANSI X9.31: + // + // http://csrc.nist.gov/groups/STM/cavp/documents/rng/931rngext.pdf + // + // OpenSSL uses that same standard for it's random numbers: + // + // http://www.opensource.apple.com/source/OpenSSL/OpenSSL-38/openssl/fips-1.0/rand/fips_rand.c + // (do a search for "ANS X9.31 A.2.4") + $result = ''; + while (strlen($result) < $length) { + $i = $crypto->encrypt(microtime()); // strlen(microtime()) == 21 + $r = $crypto->encrypt($i ^ $v); // strlen($v) == 20 + $v = $crypto->encrypt($r ^ $i); // strlen($r) == 20 + $result.= $r; + } + return substr($result, 0, $length); + } +} + +if (!function_exists('phpseclib_safe_serialize')) { + /** + * Safely serialize variables + * + * If a class has a private __sleep() method it'll give a fatal error on PHP 5.2 and earlier. + * PHP 5.3 will emit a warning. + * + * @param mixed $arr + * @access public + */ + function phpseclib_safe_serialize(&$arr) + { + if (is_object($arr)) { + return ''; + } + if (!is_array($arr)) { + return serialize($arr); + } + // prevent circular array recursion + if (isset($arr['__phpseclib_marker'])) { + return ''; + } + $safearr = array(); + $arr['__phpseclib_marker'] = true; + foreach (array_keys($arr) as $key) { + // do not recurse on the '__phpseclib_marker' key itself, for smaller memory usage + if ($key !== '__phpseclib_marker') { + $safearr[$key] = phpseclib_safe_serialize($arr[$key]); + } + } + unset($arr['__phpseclib_marker']); + return serialize($safearr); + } +} diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php new file mode 100755 index 0000000..7a6be2a --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php @@ -0,0 +1,941 @@ + + * setKey('abcdefghijklmnop'); + * + * $size = 10 * 1024; + * $plaintext = ''; + * for ($i = 0; $i < $size; $i++) { + * $plaintext.= 'a'; + * } + * + * echo $rijndael->decrypt($rijndael->encrypt($plaintext)); + * ?> + * + * + * @category Crypt + * @package Rijndael + * @author Jim Wigginton + * @copyright 2008 Jim Wigginton + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @link http://phpseclib.sourceforge.net + */ + +namespace phpseclib\Crypt; + +/** + * Pure-PHP implementation of Rijndael. + * + * @package Rijndael + * @author Jim Wigginton + * @access public + */ +class Rijndael extends Base +{ + /** + * The mcrypt specific name of the cipher + * + * Mcrypt is useable for 128/192/256-bit $block_size/$key_length. For 160/224 not. + * \phpseclib\Crypt\Rijndael determines automatically whether mcrypt is useable + * or not for the current $block_size/$key_length. + * In case of, $cipher_name_mcrypt will be set dynamically at run time accordingly. + * + * @see \phpseclib\Crypt\Base::cipher_name_mcrypt + * @see \phpseclib\Crypt\Base::engine + * @see self::isValidEngine() + * @var string + * @access private + */ + var $cipher_name_mcrypt = 'rijndael-128'; + + /** + * The default salt used by setPassword() + * + * @see \phpseclib\Crypt\Base::password_default_salt + * @see \phpseclib\Crypt\Base::setPassword() + * @var string + * @access private + */ + var $password_default_salt = 'phpseclib'; + + /** + * The Key Schedule + * + * @see self::_setup() + * @var array + * @access private + */ + var $w; + + /** + * The Inverse Key Schedule + * + * @see self::_setup() + * @var array + * @access private + */ + var $dw; + + /** + * The Block Length divided by 32 + * + * @see self::setBlockLength() + * @var int + * @access private + * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4. Exists in conjunction with $block_size + * because the encryption / decryption / key schedule creation requires this number and not $block_size. We could + * derive this from $block_size or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu + * of that, we'll just precompute it once. + */ + var $Nb = 4; + + /** + * The Key Length (in bytes) + * + * @see self::setKeyLength() + * @var int + * @access private + * @internal The max value is 256 / 8 = 32, the min value is 128 / 8 = 16. Exists in conjunction with $Nk + * because the encryption / decryption / key schedule creation requires this number and not $key_length. We could + * derive this from $key_length or vice versa, but that'd mean we'd have to do multiple shift operations, so in lieu + * of that, we'll just precompute it once. + */ + var $key_length = 16; + + /** + * The Key Length divided by 32 + * + * @see self::setKeyLength() + * @var int + * @access private + * @internal The max value is 256 / 32 = 8, the min value is 128 / 32 = 4 + */ + var $Nk = 4; + + /** + * The Number of Rounds + * + * @var int + * @access private + * @internal The max value is 14, the min value is 10. + */ + var $Nr; + + /** + * Shift offsets + * + * @var array + * @access private + */ + var $c; + + /** + * Holds the last used key- and block_size information + * + * @var array + * @access private + */ + var $kl; + + /** + * Sets the key length. + * + * Valid key lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to + * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. + * + * Note: phpseclib extends Rijndael (and AES) for using 160- and 224-bit keys but they are officially not defined + * and the most (if not all) implementations are not able using 160/224-bit keys but round/pad them up to + * 192/256 bits as, for example, mcrypt will do. + * + * That said, if you want be compatible with other Rijndael and AES implementations, + * you should not setKeyLength(160) or setKeyLength(224). + * + * Additional: In case of 160- and 224-bit keys, phpseclib will/can, for that reason, not use + * the mcrypt php extension, even if available. + * This results then in slower encryption. + * + * @access public + * @param int $length + */ + function setKeyLength($length) + { + switch (true) { + case $length <= 128: + $this->key_length = 16; + break; + case $length <= 160: + $this->key_length = 20; + break; + case $length <= 192: + $this->key_length = 24; + break; + case $length <= 224: + $this->key_length = 28; + break; + default: + $this->key_length = 32; + } + + parent::setKeyLength($length); + } + + /** + * Sets the block length + * + * Valid block lengths are 128, 160, 192, 224, and 256. If the length is less than 128, it will be rounded up to + * 128. If the length is greater than 128 and invalid, it will be rounded down to the closest valid amount. + * + * @access public + * @param int $length + */ + function setBlockLength($length) + { + $length >>= 5; + if ($length > 8) { + $length = 8; + } elseif ($length < 4) { + $length = 4; + } + $this->Nb = $length; + $this->block_size = $length << 2; + $this->changed = true; + $this->_setEngine(); + } + + /** + * Test for engine validity + * + * This is mainly just a wrapper to set things up for \phpseclib\Crypt\Base::isValidEngine() + * + * @see \phpseclib\Crypt\Base::__construct() + * @param int $engine + * @access public + * @return bool + */ + function isValidEngine($engine) + { + switch ($engine) { + case self::ENGINE_OPENSSL: + if ($this->block_size != 16) { + return false; + } + $this->cipher_name_openssl_ecb = 'aes-' . ($this->key_length << 3) . '-ecb'; + $this->cipher_name_openssl = 'aes-' . ($this->key_length << 3) . '-' . $this->_openssl_translate_mode(); + break; + case self::ENGINE_MCRYPT: + $this->cipher_name_mcrypt = 'rijndael-' . ($this->block_size << 3); + if ($this->key_length % 8) { // is it a 160/224-bit key? + // mcrypt is not usable for them, only for 128/192/256-bit keys + return false; + } + } + + return parent::isValidEngine($engine); + } + + /** + * Encrypts a block + * + * @access private + * @param string $in + * @return string + */ + function _encryptBlock($in) + { + static $tables; + if (empty($tables)) { + $tables = &$this->_getTables(); + } + $t0 = $tables[0]; + $t1 = $tables[1]; + $t2 = $tables[2]; + $t3 = $tables[3]; + $sbox = $tables[4]; + + $state = array(); + $words = unpack('N*', $in); + + $c = $this->c; + $w = $this->w; + $Nb = $this->Nb; + $Nr = $this->Nr; + + // addRoundKey + $wc = $Nb - 1; + foreach ($words as $word) { + $state[] = $word ^ $w[++$wc]; + } + + // fips-197.pdf#page=19, "Figure 5. Pseudo Code for the Cipher", states that this loop has four components - + // subBytes, shiftRows, mixColumns, and addRoundKey. fips-197.pdf#page=30, "Implementation Suggestions Regarding + // Various Platforms" suggests that performs enhanced implementations are described in Rijndael-ammended.pdf. + // Rijndael-ammended.pdf#page=20, "Implementation aspects / 32-bit processor", discusses such an optimization. + // Unfortunately, the description given there is not quite correct. Per aes.spec.v316.pdf#page=19 [1], + // equation (7.4.7) is supposed to use addition instead of subtraction, so we'll do that here, as well. + + // [1] http://fp.gladman.plus.com/cryptography_technology/rijndael/aes.spec.v316.pdf + $temp = array(); + for ($round = 1; $round < $Nr; ++$round) { + $i = 0; // $c[0] == 0 + $j = $c[1]; + $k = $c[2]; + $l = $c[3]; + + while ($i < $Nb) { + $temp[$i] = $t0[$state[$i] >> 24 & 0x000000FF] ^ + $t1[$state[$j] >> 16 & 0x000000FF] ^ + $t2[$state[$k] >> 8 & 0x000000FF] ^ + $t3[$state[$l] & 0x000000FF] ^ + $w[++$wc]; + ++$i; + $j = ($j + 1) % $Nb; + $k = ($k + 1) % $Nb; + $l = ($l + 1) % $Nb; + } + $state = $temp; + } + + // subWord + for ($i = 0; $i < $Nb; ++$i) { + $state[$i] = $sbox[$state[$i] & 0x000000FF] | + ($sbox[$state[$i] >> 8 & 0x000000FF] << 8) | + ($sbox[$state[$i] >> 16 & 0x000000FF] << 16) | + ($sbox[$state[$i] >> 24 & 0x000000FF] << 24); + } + + // shiftRows + addRoundKey + $i = 0; // $c[0] == 0 + $j = $c[1]; + $k = $c[2]; + $l = $c[3]; + while ($i < $Nb) { + $temp[$i] = ($state[$i] & intval(0xFF000000)) ^ + ($state[$j] & 0x00FF0000) ^ + ($state[$k] & 0x0000FF00) ^ + ($state[$l] & 0x000000FF) ^ + $w[$i]; + ++$i; + $j = ($j + 1) % $Nb; + $k = ($k + 1) % $Nb; + $l = ($l + 1) % $Nb; + } + + switch ($Nb) { + case 8: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]); + case 7: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]); + case 6: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]); + case 5: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]); + default: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]); + } + } + + /** + * Decrypts a block + * + * @access private + * @param string $in + * @return string + */ + function _decryptBlock($in) + { + static $invtables; + if (empty($invtables)) { + $invtables = &$this->_getInvTables(); + } + $dt0 = $invtables[0]; + $dt1 = $invtables[1]; + $dt2 = $invtables[2]; + $dt3 = $invtables[3]; + $isbox = $invtables[4]; + + $state = array(); + $words = unpack('N*', $in); + + $c = $this->c; + $dw = $this->dw; + $Nb = $this->Nb; + $Nr = $this->Nr; + + // addRoundKey + $wc = $Nb - 1; + foreach ($words as $word) { + $state[] = $word ^ $dw[++$wc]; + } + + $temp = array(); + for ($round = $Nr - 1; $round > 0; --$round) { + $i = 0; // $c[0] == 0 + $j = $Nb - $c[1]; + $k = $Nb - $c[2]; + $l = $Nb - $c[3]; + + while ($i < $Nb) { + $temp[$i] = $dt0[$state[$i] >> 24 & 0x000000FF] ^ + $dt1[$state[$j] >> 16 & 0x000000FF] ^ + $dt2[$state[$k] >> 8 & 0x000000FF] ^ + $dt3[$state[$l] & 0x000000FF] ^ + $dw[++$wc]; + ++$i; + $j = ($j + 1) % $Nb; + $k = ($k + 1) % $Nb; + $l = ($l + 1) % $Nb; + } + $state = $temp; + } + + // invShiftRows + invSubWord + addRoundKey + $i = 0; // $c[0] == 0 + $j = $Nb - $c[1]; + $k = $Nb - $c[2]; + $l = $Nb - $c[3]; + + while ($i < $Nb) { + $word = ($state[$i] & intval(0xFF000000)) | + ($state[$j] & 0x00FF0000) | + ($state[$k] & 0x0000FF00) | + ($state[$l] & 0x000000FF); + + $temp[$i] = $dw[$i] ^ ($isbox[$word & 0x000000FF] | + ($isbox[$word >> 8 & 0x000000FF] << 8) | + ($isbox[$word >> 16 & 0x000000FF] << 16) | + ($isbox[$word >> 24 & 0x000000FF] << 24)); + ++$i; + $j = ($j + 1) % $Nb; + $k = ($k + 1) % $Nb; + $l = ($l + 1) % $Nb; + } + + switch ($Nb) { + case 8: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6], $temp[7]); + case 7: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5], $temp[6]); + case 6: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4], $temp[5]); + case 5: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3], $temp[4]); + default: + return pack('N*', $temp[0], $temp[1], $temp[2], $temp[3]); + } + } + + /** + * Setup the key (expansion) + * + * @see \phpseclib\Crypt\Base::_setupKey() + * @access private + */ + function _setupKey() + { + // Each number in $rcon is equal to the previous number multiplied by two in Rijndael's finite field. + // See http://en.wikipedia.org/wiki/Finite_field_arithmetic#Multiplicative_inverse + static $rcon; + + if (!isset($rcon)) { + $rcon = array(0, + 0x01000000, 0x02000000, 0x04000000, 0x08000000, 0x10000000, + 0x20000000, 0x40000000, 0x80000000, 0x1B000000, 0x36000000, + 0x6C000000, 0xD8000000, 0xAB000000, 0x4D000000, 0x9A000000, + 0x2F000000, 0x5E000000, 0xBC000000, 0x63000000, 0xC6000000, + 0x97000000, 0x35000000, 0x6A000000, 0xD4000000, 0xB3000000, + 0x7D000000, 0xFA000000, 0xEF000000, 0xC5000000, 0x91000000 + ); + $rcon = array_map('intval', $rcon); + } + + if (isset($this->kl['key']) && $this->key === $this->kl['key'] && $this->key_length === $this->kl['key_length'] && $this->block_size === $this->kl['block_size']) { + // already expanded + return; + } + $this->kl = array('key' => $this->key, 'key_length' => $this->key_length, 'block_size' => $this->block_size); + + $this->Nk = $this->key_length >> 2; + // see Rijndael-ammended.pdf#page=44 + $this->Nr = max($this->Nk, $this->Nb) + 6; + + // shift offsets for Nb = 5, 7 are defined in Rijndael-ammended.pdf#page=44, + // "Table 8: Shift offsets in Shiftrow for the alternative block lengths" + // shift offsets for Nb = 4, 6, 8 are defined in Rijndael-ammended.pdf#page=14, + // "Table 2: Shift offsets for different block lengths" + switch ($this->Nb) { + case 4: + case 5: + case 6: + $this->c = array(0, 1, 2, 3); + break; + case 7: + $this->c = array(0, 1, 2, 4); + break; + case 8: + $this->c = array(0, 1, 3, 4); + } + + $w = array_values(unpack('N*words', $this->key)); + + $length = $this->Nb * ($this->Nr + 1); + for ($i = $this->Nk; $i < $length; $i++) { + $temp = $w[$i - 1]; + if ($i % $this->Nk == 0) { + // according to , "the size of an integer is platform-dependent". + // on a 32-bit machine, it's 32-bits, and on a 64-bit machine, it's 64-bits. on a 32-bit machine, + // 0xFFFFFFFF << 8 == 0xFFFFFF00, but on a 64-bit machine, it equals 0xFFFFFFFF00. as such, doing 'and' + // with 0xFFFFFFFF (or 0xFFFFFF00) on a 32-bit machine is unnecessary, but on a 64-bit machine, it is. + $temp = (($temp << 8) & intval(0xFFFFFF00)) | (($temp >> 24) & 0x000000FF); // rotWord + $temp = $this->_subWord($temp) ^ $rcon[$i / $this->Nk]; + } elseif ($this->Nk > 6 && $i % $this->Nk == 4) { + $temp = $this->_subWord($temp); + } + $w[$i] = $w[$i - $this->Nk] ^ $temp; + } + + // convert the key schedule from a vector of $Nb * ($Nr + 1) length to a matrix with $Nr + 1 rows and $Nb columns + // and generate the inverse key schedule. more specifically, + // according to (section 5.3.3), + // "The key expansion for the Inverse Cipher is defined as follows: + // 1. Apply the Key Expansion. + // 2. Apply InvMixColumn to all Round Keys except the first and the last one." + // also, see fips-197.pdf#page=27, "5.3.5 Equivalent Inverse Cipher" + list($dt0, $dt1, $dt2, $dt3) = $this->_getInvTables(); + $temp = $this->w = $this->dw = array(); + for ($i = $row = $col = 0; $i < $length; $i++, $col++) { + if ($col == $this->Nb) { + if ($row == 0) { + $this->dw[0] = $this->w[0]; + } else { + // subWord + invMixColumn + invSubWord = invMixColumn + $j = 0; + while ($j < $this->Nb) { + $dw = $this->_subWord($this->w[$row][$j]); + $temp[$j] = $dt0[$dw >> 24 & 0x000000FF] ^ + $dt1[$dw >> 16 & 0x000000FF] ^ + $dt2[$dw >> 8 & 0x000000FF] ^ + $dt3[$dw & 0x000000FF]; + $j++; + } + $this->dw[$row] = $temp; + } + + $col = 0; + $row++; + } + $this->w[$row][$col] = $w[$i]; + } + + $this->dw[$row] = $this->w[$row]; + + // Converting to 1-dim key arrays (both ascending) + $this->dw = array_reverse($this->dw); + $w = array_pop($this->w); + $dw = array_pop($this->dw); + foreach ($this->w as $r => $wr) { + foreach ($wr as $c => $wc) { + $w[] = $wc; + $dw[] = $this->dw[$r][$c]; + } + } + $this->w = $w; + $this->dw = $dw; + } + + /** + * Performs S-Box substitutions + * + * @access private + * @param int $word + */ + function _subWord($word) + { + static $sbox; + if (empty($sbox)) { + list(, , , , $sbox) = $this->_getTables(); + } + + return $sbox[$word & 0x000000FF] | + ($sbox[$word >> 8 & 0x000000FF] << 8) | + ($sbox[$word >> 16 & 0x000000FF] << 16) | + ($sbox[$word >> 24 & 0x000000FF] << 24); + } + + /** + * Provides the mixColumns and sboxes tables + * + * @see self::_encryptBlock() + * @see self::_setupInlineCrypt() + * @see self::_subWord() + * @access private + * @return array &$tables + */ + function &_getTables() + { + static $tables; + if (empty($tables)) { + // according to (section 5.2.1), + // precomputed tables can be used in the mixColumns phase. in that example, they're assigned t0...t3, so + // those are the names we'll use. + $t3 = array_map('intval', array( + // with array_map('intval', ...) we ensure we have only int's and not + // some slower floats converted by php automatically on high values + 0x6363A5C6, 0x7C7C84F8, 0x777799EE, 0x7B7B8DF6, 0xF2F20DFF, 0x6B6BBDD6, 0x6F6FB1DE, 0xC5C55491, + 0x30305060, 0x01010302, 0x6767A9CE, 0x2B2B7D56, 0xFEFE19E7, 0xD7D762B5, 0xABABE64D, 0x76769AEC, + 0xCACA458F, 0x82829D1F, 0xC9C94089, 0x7D7D87FA, 0xFAFA15EF, 0x5959EBB2, 0x4747C98E, 0xF0F00BFB, + 0xADADEC41, 0xD4D467B3, 0xA2A2FD5F, 0xAFAFEA45, 0x9C9CBF23, 0xA4A4F753, 0x727296E4, 0xC0C05B9B, + 0xB7B7C275, 0xFDFD1CE1, 0x9393AE3D, 0x26266A4C, 0x36365A6C, 0x3F3F417E, 0xF7F702F5, 0xCCCC4F83, + 0x34345C68, 0xA5A5F451, 0xE5E534D1, 0xF1F108F9, 0x717193E2, 0xD8D873AB, 0x31315362, 0x15153F2A, + 0x04040C08, 0xC7C75295, 0x23236546, 0xC3C35E9D, 0x18182830, 0x9696A137, 0x05050F0A, 0x9A9AB52F, + 0x0707090E, 0x12123624, 0x80809B1B, 0xE2E23DDF, 0xEBEB26CD, 0x2727694E, 0xB2B2CD7F, 0x75759FEA, + 0x09091B12, 0x83839E1D, 0x2C2C7458, 0x1A1A2E34, 0x1B1B2D36, 0x6E6EB2DC, 0x5A5AEEB4, 0xA0A0FB5B, + 0x5252F6A4, 0x3B3B4D76, 0xD6D661B7, 0xB3B3CE7D, 0x29297B52, 0xE3E33EDD, 0x2F2F715E, 0x84849713, + 0x5353F5A6, 0xD1D168B9, 0x00000000, 0xEDED2CC1, 0x20206040, 0xFCFC1FE3, 0xB1B1C879, 0x5B5BEDB6, + 0x6A6ABED4, 0xCBCB468D, 0xBEBED967, 0x39394B72, 0x4A4ADE94, 0x4C4CD498, 0x5858E8B0, 0xCFCF4A85, + 0xD0D06BBB, 0xEFEF2AC5, 0xAAAAE54F, 0xFBFB16ED, 0x4343C586, 0x4D4DD79A, 0x33335566, 0x85859411, + 0x4545CF8A, 0xF9F910E9, 0x02020604, 0x7F7F81FE, 0x5050F0A0, 0x3C3C4478, 0x9F9FBA25, 0xA8A8E34B, + 0x5151F3A2, 0xA3A3FE5D, 0x4040C080, 0x8F8F8A05, 0x9292AD3F, 0x9D9DBC21, 0x38384870, 0xF5F504F1, + 0xBCBCDF63, 0xB6B6C177, 0xDADA75AF, 0x21216342, 0x10103020, 0xFFFF1AE5, 0xF3F30EFD, 0xD2D26DBF, + 0xCDCD4C81, 0x0C0C1418, 0x13133526, 0xECEC2FC3, 0x5F5FE1BE, 0x9797A235, 0x4444CC88, 0x1717392E, + 0xC4C45793, 0xA7A7F255, 0x7E7E82FC, 0x3D3D477A, 0x6464ACC8, 0x5D5DE7BA, 0x19192B32, 0x737395E6, + 0x6060A0C0, 0x81819819, 0x4F4FD19E, 0xDCDC7FA3, 0x22226644, 0x2A2A7E54, 0x9090AB3B, 0x8888830B, + 0x4646CA8C, 0xEEEE29C7, 0xB8B8D36B, 0x14143C28, 0xDEDE79A7, 0x5E5EE2BC, 0x0B0B1D16, 0xDBDB76AD, + 0xE0E03BDB, 0x32325664, 0x3A3A4E74, 0x0A0A1E14, 0x4949DB92, 0x06060A0C, 0x24246C48, 0x5C5CE4B8, + 0xC2C25D9F, 0xD3D36EBD, 0xACACEF43, 0x6262A6C4, 0x9191A839, 0x9595A431, 0xE4E437D3, 0x79798BF2, + 0xE7E732D5, 0xC8C8438B, 0x3737596E, 0x6D6DB7DA, 0x8D8D8C01, 0xD5D564B1, 0x4E4ED29C, 0xA9A9E049, + 0x6C6CB4D8, 0x5656FAAC, 0xF4F407F3, 0xEAEA25CF, 0x6565AFCA, 0x7A7A8EF4, 0xAEAEE947, 0x08081810, + 0xBABAD56F, 0x787888F0, 0x25256F4A, 0x2E2E725C, 0x1C1C2438, 0xA6A6F157, 0xB4B4C773, 0xC6C65197, + 0xE8E823CB, 0xDDDD7CA1, 0x74749CE8, 0x1F1F213E, 0x4B4BDD96, 0xBDBDDC61, 0x8B8B860D, 0x8A8A850F, + 0x707090E0, 0x3E3E427C, 0xB5B5C471, 0x6666AACC, 0x4848D890, 0x03030506, 0xF6F601F7, 0x0E0E121C, + 0x6161A3C2, 0x35355F6A, 0x5757F9AE, 0xB9B9D069, 0x86869117, 0xC1C15899, 0x1D1D273A, 0x9E9EB927, + 0xE1E138D9, 0xF8F813EB, 0x9898B32B, 0x11113322, 0x6969BBD2, 0xD9D970A9, 0x8E8E8907, 0x9494A733, + 0x9B9BB62D, 0x1E1E223C, 0x87879215, 0xE9E920C9, 0xCECE4987, 0x5555FFAA, 0x28287850, 0xDFDF7AA5, + 0x8C8C8F03, 0xA1A1F859, 0x89898009, 0x0D0D171A, 0xBFBFDA65, 0xE6E631D7, 0x4242C684, 0x6868B8D0, + 0x4141C382, 0x9999B029, 0x2D2D775A, 0x0F0F111E, 0xB0B0CB7B, 0x5454FCA8, 0xBBBBD66D, 0x16163A2C + )); + + foreach ($t3 as $t3i) { + $t0[] = (($t3i << 24) & intval(0xFF000000)) | (($t3i >> 8) & 0x00FFFFFF); + $t1[] = (($t3i << 16) & intval(0xFFFF0000)) | (($t3i >> 16) & 0x0000FFFF); + $t2[] = (($t3i << 8) & intval(0xFFFFFF00)) | (($t3i >> 24) & 0x000000FF); + } + + $tables = array( + // The Precomputed mixColumns tables t0 - t3 + $t0, + $t1, + $t2, + $t3, + // The SubByte S-Box + array( + 0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F, 0xC5, 0x30, 0x01, 0x67, 0x2B, 0xFE, 0xD7, 0xAB, 0x76, + 0xCA, 0x82, 0xC9, 0x7D, 0xFA, 0x59, 0x47, 0xF0, 0xAD, 0xD4, 0xA2, 0xAF, 0x9C, 0xA4, 0x72, 0xC0, + 0xB7, 0xFD, 0x93, 0x26, 0x36, 0x3F, 0xF7, 0xCC, 0x34, 0xA5, 0xE5, 0xF1, 0x71, 0xD8, 0x31, 0x15, + 0x04, 0xC7, 0x23, 0xC3, 0x18, 0x96, 0x05, 0x9A, 0x07, 0x12, 0x80, 0xE2, 0xEB, 0x27, 0xB2, 0x75, + 0x09, 0x83, 0x2C, 0x1A, 0x1B, 0x6E, 0x5A, 0xA0, 0x52, 0x3B, 0xD6, 0xB3, 0x29, 0xE3, 0x2F, 0x84, + 0x53, 0xD1, 0x00, 0xED, 0x20, 0xFC, 0xB1, 0x5B, 0x6A, 0xCB, 0xBE, 0x39, 0x4A, 0x4C, 0x58, 0xCF, + 0xD0, 0xEF, 0xAA, 0xFB, 0x43, 0x4D, 0x33, 0x85, 0x45, 0xF9, 0x02, 0x7F, 0x50, 0x3C, 0x9F, 0xA8, + 0x51, 0xA3, 0x40, 0x8F, 0x92, 0x9D, 0x38, 0xF5, 0xBC, 0xB6, 0xDA, 0x21, 0x10, 0xFF, 0xF3, 0xD2, + 0xCD, 0x0C, 0x13, 0xEC, 0x5F, 0x97, 0x44, 0x17, 0xC4, 0xA7, 0x7E, 0x3D, 0x64, 0x5D, 0x19, 0x73, + 0x60, 0x81, 0x4F, 0xDC, 0x22, 0x2A, 0x90, 0x88, 0x46, 0xEE, 0xB8, 0x14, 0xDE, 0x5E, 0x0B, 0xDB, + 0xE0, 0x32, 0x3A, 0x0A, 0x49, 0x06, 0x24, 0x5C, 0xC2, 0xD3, 0xAC, 0x62, 0x91, 0x95, 0xE4, 0x79, + 0xE7, 0xC8, 0x37, 0x6D, 0x8D, 0xD5, 0x4E, 0xA9, 0x6C, 0x56, 0xF4, 0xEA, 0x65, 0x7A, 0xAE, 0x08, + 0xBA, 0x78, 0x25, 0x2E, 0x1C, 0xA6, 0xB4, 0xC6, 0xE8, 0xDD, 0x74, 0x1F, 0x4B, 0xBD, 0x8B, 0x8A, + 0x70, 0x3E, 0xB5, 0x66, 0x48, 0x03, 0xF6, 0x0E, 0x61, 0x35, 0x57, 0xB9, 0x86, 0xC1, 0x1D, 0x9E, + 0xE1, 0xF8, 0x98, 0x11, 0x69, 0xD9, 0x8E, 0x94, 0x9B, 0x1E, 0x87, 0xE9, 0xCE, 0x55, 0x28, 0xDF, + 0x8C, 0xA1, 0x89, 0x0D, 0xBF, 0xE6, 0x42, 0x68, 0x41, 0x99, 0x2D, 0x0F, 0xB0, 0x54, 0xBB, 0x16 + ) + ); + } + return $tables; + } + + /** + * Provides the inverse mixColumns and inverse sboxes tables + * + * @see self::_decryptBlock() + * @see self::_setupInlineCrypt() + * @see self::_setupKey() + * @access private + * @return array &$tables + */ + function &_getInvTables() + { + static $tables; + if (empty($tables)) { + $dt3 = array_map('intval', array( + 0xF4A75051, 0x4165537E, 0x17A4C31A, 0x275E963A, 0xAB6BCB3B, 0x9D45F11F, 0xFA58ABAC, 0xE303934B, + 0x30FA5520, 0x766DF6AD, 0xCC769188, 0x024C25F5, 0xE5D7FC4F, 0x2ACBD7C5, 0x35448026, 0x62A38FB5, + 0xB15A49DE, 0xBA1B6725, 0xEA0E9845, 0xFEC0E15D, 0x2F7502C3, 0x4CF01281, 0x4697A38D, 0xD3F9C66B, + 0x8F5FE703, 0x929C9515, 0x6D7AEBBF, 0x5259DA95, 0xBE832DD4, 0x7421D358, 0xE0692949, 0xC9C8448E, + 0xC2896A75, 0x8E7978F4, 0x583E6B99, 0xB971DD27, 0xE14FB6BE, 0x88AD17F0, 0x20AC66C9, 0xCE3AB47D, + 0xDF4A1863, 0x1A3182E5, 0x51336097, 0x537F4562, 0x6477E0B1, 0x6BAE84BB, 0x81A01CFE, 0x082B94F9, + 0x48685870, 0x45FD198F, 0xDE6C8794, 0x7BF8B752, 0x73D323AB, 0x4B02E272, 0x1F8F57E3, 0x55AB2A66, + 0xEB2807B2, 0xB5C2032F, 0xC57B9A86, 0x3708A5D3, 0x2887F230, 0xBFA5B223, 0x036ABA02, 0x16825CED, + 0xCF1C2B8A, 0x79B492A7, 0x07F2F0F3, 0x69E2A14E, 0xDAF4CD65, 0x05BED506, 0x34621FD1, 0xA6FE8AC4, + 0x2E539D34, 0xF355A0A2, 0x8AE13205, 0xF6EB75A4, 0x83EC390B, 0x60EFAA40, 0x719F065E, 0x6E1051BD, + 0x218AF93E, 0xDD063D96, 0x3E05AEDD, 0xE6BD464D, 0x548DB591, 0xC45D0571, 0x06D46F04, 0x5015FF60, + 0x98FB2419, 0xBDE997D6, 0x4043CC89, 0xD99E7767, 0xE842BDB0, 0x898B8807, 0x195B38E7, 0xC8EEDB79, + 0x7C0A47A1, 0x420FE97C, 0x841EC9F8, 0x00000000, 0x80868309, 0x2BED4832, 0x1170AC1E, 0x5A724E6C, + 0x0EFFFBFD, 0x8538560F, 0xAED51E3D, 0x2D392736, 0x0FD9640A, 0x5CA62168, 0x5B54D19B, 0x362E3A24, + 0x0A67B10C, 0x57E70F93, 0xEE96D2B4, 0x9B919E1B, 0xC0C54F80, 0xDC20A261, 0x774B695A, 0x121A161C, + 0x93BA0AE2, 0xA02AE5C0, 0x22E0433C, 0x1B171D12, 0x090D0B0E, 0x8BC7ADF2, 0xB6A8B92D, 0x1EA9C814, + 0xF1198557, 0x75074CAF, 0x99DDBBEE, 0x7F60FDA3, 0x01269FF7, 0x72F5BC5C, 0x663BC544, 0xFB7E345B, + 0x4329768B, 0x23C6DCCB, 0xEDFC68B6, 0xE4F163B8, 0x31DCCAD7, 0x63851042, 0x97224013, 0xC6112084, + 0x4A247D85, 0xBB3DF8D2, 0xF93211AE, 0x29A16DC7, 0x9E2F4B1D, 0xB230F3DC, 0x8652EC0D, 0xC1E3D077, + 0xB3166C2B, 0x70B999A9, 0x9448FA11, 0xE9642247, 0xFC8CC4A8, 0xF03F1AA0, 0x7D2CD856, 0x3390EF22, + 0x494EC787, 0x38D1C1D9, 0xCAA2FE8C, 0xD40B3698, 0xF581CFA6, 0x7ADE28A5, 0xB78E26DA, 0xADBFA43F, + 0x3A9DE42C, 0x78920D50, 0x5FCC9B6A, 0x7E466254, 0x8D13C2F6, 0xD8B8E890, 0x39F75E2E, 0xC3AFF582, + 0x5D80BE9F, 0xD0937C69, 0xD52DA96F, 0x2512B3CF, 0xAC993BC8, 0x187DA710, 0x9C636EE8, 0x3BBB7BDB, + 0x267809CD, 0x5918F46E, 0x9AB701EC, 0x4F9AA883, 0x956E65E6, 0xFFE67EAA, 0xBCCF0821, 0x15E8E6EF, + 0xE79BD9BA, 0x6F36CE4A, 0x9F09D4EA, 0xB07CD629, 0xA4B2AF31, 0x3F23312A, 0xA59430C6, 0xA266C035, + 0x4EBC3774, 0x82CAA6FC, 0x90D0B0E0, 0xA7D81533, 0x04984AF1, 0xECDAF741, 0xCD500E7F, 0x91F62F17, + 0x4DD68D76, 0xEFB04D43, 0xAA4D54CC, 0x9604DFE4, 0xD1B5E39E, 0x6A881B4C, 0x2C1FB8C1, 0x65517F46, + 0x5EEA049D, 0x8C355D01, 0x877473FA, 0x0B412EFB, 0x671D5AB3, 0xDBD25292, 0x105633E9, 0xD647136D, + 0xD7618C9A, 0xA10C7A37, 0xF8148E59, 0x133C89EB, 0xA927EECE, 0x61C935B7, 0x1CE5EDE1, 0x47B13C7A, + 0xD2DF599C, 0xF2733F55, 0x14CE7918, 0xC737BF73, 0xF7CDEA53, 0xFDAA5B5F, 0x3D6F14DF, 0x44DB8678, + 0xAFF381CA, 0x68C43EB9, 0x24342C38, 0xA3405FC2, 0x1DC37216, 0xE2250CBC, 0x3C498B28, 0x0D9541FF, + 0xA8017139, 0x0CB3DE08, 0xB4E49CD8, 0x56C19064, 0xCB84617B, 0x32B670D5, 0x6C5C7448, 0xB85742D0 + )); + + foreach ($dt3 as $dt3i) { + $dt0[] = (($dt3i << 24) & intval(0xFF000000)) | (($dt3i >> 8) & 0x00FFFFFF); + $dt1[] = (($dt3i << 16) & intval(0xFFFF0000)) | (($dt3i >> 16) & 0x0000FFFF); + $dt2[] = (($dt3i << 8) & intval(0xFFFFFF00)) | (($dt3i >> 24) & 0x000000FF); + }; + + $tables = array( + // The Precomputed inverse mixColumns tables dt0 - dt3 + $dt0, + $dt1, + $dt2, + $dt3, + // The inverse SubByte S-Box + array( + 0x52, 0x09, 0x6A, 0xD5, 0x30, 0x36, 0xA5, 0x38, 0xBF, 0x40, 0xA3, 0x9E, 0x81, 0xF3, 0xD7, 0xFB, + 0x7C, 0xE3, 0x39, 0x82, 0x9B, 0x2F, 0xFF, 0x87, 0x34, 0x8E, 0x43, 0x44, 0xC4, 0xDE, 0xE9, 0xCB, + 0x54, 0x7B, 0x94, 0x32, 0xA6, 0xC2, 0x23, 0x3D, 0xEE, 0x4C, 0x95, 0x0B, 0x42, 0xFA, 0xC3, 0x4E, + 0x08, 0x2E, 0xA1, 0x66, 0x28, 0xD9, 0x24, 0xB2, 0x76, 0x5B, 0xA2, 0x49, 0x6D, 0x8B, 0xD1, 0x25, + 0x72, 0xF8, 0xF6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xD4, 0xA4, 0x5C, 0xCC, 0x5D, 0x65, 0xB6, 0x92, + 0x6C, 0x70, 0x48, 0x50, 0xFD, 0xED, 0xB9, 0xDA, 0x5E, 0x15, 0x46, 0x57, 0xA7, 0x8D, 0x9D, 0x84, + 0x90, 0xD8, 0xAB, 0x00, 0x8C, 0xBC, 0xD3, 0x0A, 0xF7, 0xE4, 0x58, 0x05, 0xB8, 0xB3, 0x45, 0x06, + 0xD0, 0x2C, 0x1E, 0x8F, 0xCA, 0x3F, 0x0F, 0x02, 0xC1, 0xAF, 0xBD, 0x03, 0x01, 0x13, 0x8A, 0x6B, + 0x3A, 0x91, 0x11, 0x41, 0x4F, 0x67, 0xDC, 0xEA, 0x97, 0xF2, 0xCF, 0xCE, 0xF0, 0xB4, 0xE6, 0x73, + 0x96, 0xAC, 0x74, 0x22, 0xE7, 0xAD, 0x35, 0x85, 0xE2, 0xF9, 0x37, 0xE8, 0x1C, 0x75, 0xDF, 0x6E, + 0x47, 0xF1, 0x1A, 0x71, 0x1D, 0x29, 0xC5, 0x89, 0x6F, 0xB7, 0x62, 0x0E, 0xAA, 0x18, 0xBE, 0x1B, + 0xFC, 0x56, 0x3E, 0x4B, 0xC6, 0xD2, 0x79, 0x20, 0x9A, 0xDB, 0xC0, 0xFE, 0x78, 0xCD, 0x5A, 0xF4, + 0x1F, 0xDD, 0xA8, 0x33, 0x88, 0x07, 0xC7, 0x31, 0xB1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xEC, 0x5F, + 0x60, 0x51, 0x7F, 0xA9, 0x19, 0xB5, 0x4A, 0x0D, 0x2D, 0xE5, 0x7A, 0x9F, 0x93, 0xC9, 0x9C, 0xEF, + 0xA0, 0xE0, 0x3B, 0x4D, 0xAE, 0x2A, 0xF5, 0xB0, 0xC8, 0xEB, 0xBB, 0x3C, 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2B, 0x04, 0x7E, 0xBA, 0x77, 0xD6, 0x26, 0xE1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0C, 0x7D + ) + ); + } + return $tables; + } + + /** + * Setup the performance-optimized function for de/encrypt() + * + * @see \phpseclib\Crypt\Base::_setupInlineCrypt() + * @access private + */ + function _setupInlineCrypt() + { + // Note: _setupInlineCrypt() will be called only if $this->changed === true + // So here we are'nt under the same heavy timing-stress as we are in _de/encryptBlock() or de/encrypt(). + // However...the here generated function- $code, stored as php callback in $this->inline_crypt, must work as fast as even possible. + + $lambda_functions =& self::_getLambdaFunctions(); + + // We create max. 10 hi-optimized code for memory reason. Means: For each $key one ultra fast inline-crypt function. + // (Currently, for Crypt_Rijndael/AES, one generated $lambda_function cost on php5.5@32bit ~80kb unfreeable mem and ~130kb on php5.5@64bit) + // After that, we'll still create very fast optimized code but not the hi-ultimative code, for each $mode one. + $gen_hi_opt_code = (bool)(count($lambda_functions) < 10); + + // Generation of a uniqe hash for our generated code + $code_hash = "Crypt_Rijndael, {$this->mode}, {$this->Nr}, {$this->Nb}"; + if ($gen_hi_opt_code) { + $code_hash = str_pad($code_hash, 32) . $this->_hashInlineCryptFunction($this->key); + } + + if (!isset($lambda_functions[$code_hash])) { + switch (true) { + case $gen_hi_opt_code: + // The hi-optimized $lambda_functions will use the key-words hardcoded for better performance. + $w = $this->w; + $dw = $this->dw; + $init_encrypt = ''; + $init_decrypt = ''; + break; + default: + for ($i = 0, $cw = count($this->w); $i < $cw; ++$i) { + $w[] = '$w[' . $i . ']'; + $dw[] = '$dw[' . $i . ']'; + } + $init_encrypt = '$w = $self->w;'; + $init_decrypt = '$dw = $self->dw;'; + } + + $Nr = $this->Nr; + $Nb = $this->Nb; + $c = $this->c; + + // Generating encrypt code: + $init_encrypt.= ' + static $tables; + if (empty($tables)) { + $tables = &$self->_getTables(); + } + $t0 = $tables[0]; + $t1 = $tables[1]; + $t2 = $tables[2]; + $t3 = $tables[3]; + $sbox = $tables[4]; + '; + + $s = 'e'; + $e = 's'; + $wc = $Nb - 1; + + // Preround: addRoundKey + $encrypt_block = '$in = unpack("N*", $in);'."\n"; + for ($i = 0; $i < $Nb; ++$i) { + $encrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$w[++$wc].";\n"; + } + + // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey + for ($round = 1; $round < $Nr; ++$round) { + list($s, $e) = array($e, $s); + for ($i = 0; $i < $Nb; ++$i) { + $encrypt_block.= + '$'.$e.$i.' = + $t0[($'.$s.$i .' >> 24) & 0xff] ^ + $t1[($'.$s.(($i + $c[1]) % $Nb).' >> 16) & 0xff] ^ + $t2[($'.$s.(($i + $c[2]) % $Nb).' >> 8) & 0xff] ^ + $t3[ $'.$s.(($i + $c[3]) % $Nb).' & 0xff] ^ + '.$w[++$wc].";\n"; + } + } + + // Finalround: subWord + shiftRows + addRoundKey + for ($i = 0; $i < $Nb; ++$i) { + $encrypt_block.= + '$'.$e.$i.' = + $sbox[ $'.$e.$i.' & 0xff] | + ($sbox[($'.$e.$i.' >> 8) & 0xff] << 8) | + ($sbox[($'.$e.$i.' >> 16) & 0xff] << 16) | + ($sbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n"; + } + $encrypt_block .= '$in = pack("N*"'."\n"; + for ($i = 0; $i < $Nb; ++$i) { + $encrypt_block.= ', + ($'.$e.$i .' & '.((int)0xFF000000).') ^ + ($'.$e.(($i + $c[1]) % $Nb).' & 0x00FF0000 ) ^ + ($'.$e.(($i + $c[2]) % $Nb).' & 0x0000FF00 ) ^ + ($'.$e.(($i + $c[3]) % $Nb).' & 0x000000FF ) ^ + '.$w[$i]."\n"; + } + $encrypt_block .= ');'; + + // Generating decrypt code: + $init_decrypt.= ' + static $invtables; + if (empty($invtables)) { + $invtables = &$self->_getInvTables(); + } + $dt0 = $invtables[0]; + $dt1 = $invtables[1]; + $dt2 = $invtables[2]; + $dt3 = $invtables[3]; + $isbox = $invtables[4]; + '; + + $s = 'e'; + $e = 's'; + $wc = $Nb - 1; + + // Preround: addRoundKey + $decrypt_block = '$in = unpack("N*", $in);'."\n"; + for ($i = 0; $i < $Nb; ++$i) { + $decrypt_block .= '$s'.$i.' = $in['.($i + 1).'] ^ '.$dw[++$wc].';'."\n"; + } + + // Mainrounds: shiftRows + subWord + mixColumns + addRoundKey + for ($round = 1; $round < $Nr; ++$round) { + list($s, $e) = array($e, $s); + for ($i = 0; $i < $Nb; ++$i) { + $decrypt_block.= + '$'.$e.$i.' = + $dt0[($'.$s.$i .' >> 24) & 0xff] ^ + $dt1[($'.$s.(($Nb + $i - $c[1]) % $Nb).' >> 16) & 0xff] ^ + $dt2[($'.$s.(($Nb + $i - $c[2]) % $Nb).' >> 8) & 0xff] ^ + $dt3[ $'.$s.(($Nb + $i - $c[3]) % $Nb).' & 0xff] ^ + '.$dw[++$wc].";\n"; + } + } + + // Finalround: subWord + shiftRows + addRoundKey + for ($i = 0; $i < $Nb; ++$i) { + $decrypt_block.= + '$'.$e.$i.' = + $isbox[ $'.$e.$i.' & 0xff] | + ($isbox[($'.$e.$i.' >> 8) & 0xff] << 8) | + ($isbox[($'.$e.$i.' >> 16) & 0xff] << 16) | + ($isbox[($'.$e.$i.' >> 24) & 0xff] << 24);'."\n"; + } + $decrypt_block .= '$in = pack("N*"'."\n"; + for ($i = 0; $i < $Nb; ++$i) { + $decrypt_block.= ', + ($'.$e.$i. ' & '.((int)0xFF000000).') ^ + ($'.$e.(($Nb + $i - $c[1]) % $Nb).' & 0x00FF0000 ) ^ + ($'.$e.(($Nb + $i - $c[2]) % $Nb).' & 0x0000FF00 ) ^ + ($'.$e.(($Nb + $i - $c[3]) % $Nb).' & 0x000000FF ) ^ + '.$dw[$i]."\n"; + } + $decrypt_block .= ');'; + + $lambda_functions[$code_hash] = $this->_createInlineCryptFunction( + array( + 'init_crypt' => '', + 'init_encrypt' => $init_encrypt, + 'init_decrypt' => $init_decrypt, + 'encrypt_block' => $encrypt_block, + 'decrypt_block' => $decrypt_block + ) + ); + } + $this->inline_crypt = $lambda_functions[$code_hash]; + } +} diff --git a/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php new file mode 100755 index 0000000..547688f --- /dev/null +++ b/phpMyAdmin/vendor/phpseclib/phpseclib/phpseclib/bootstrap.php @@ -0,0 +1,17 @@ + + Latest Stable Version + License + Code Quality + Build +

      +

      + Downloads + Coverage + StyleCI + PHP +

      + +### Google Two-Factor Authentication for PHP Package + +Google2FA is a PHP implementation of the Google Two-Factor Authentication Module, supporting the HMAC-Based One-time Password (HOTP) algorithm specified in [RFC 4226](https://tools.ietf.org/html/rfc4226) and the Time-based One-time Password (TOTP) algorithm specified in [RFC 6238](https://tools.ietf.org/html/rfc6238). + +This package is agnostic, but there's a [Laravel bridge](https://github.com/antonioribeiro/google2fa-laravel). + +## Demos, Example & Playground + +Please check the [Google2FA Package Playground](http://pragmarx.com/playground/google2fa). + +![playground](docs/playground.jpg) + +Here's an demo app showing how to use Google2FA: [google2fa-example](https://github.com/antonioribeiro/google2fa-example). + +You can scan the QR code on [this (old) demo page](https://antoniocarlosribeiro.com/technology/google2fa) with a Google Authenticator app and view the code changing (almost) in real time. + +## Requirements + +- PHP 5.4+ + +## Installing + +Use Composer to install it: + + composer require pragmarx/google2fa + +If you prefer inline QRCodes instead of a Google generated url, you'll need to install [BaconQrCode](https://github.com/Bacon/BaconQrCode): + + composer require bacon/bacon-qr-code + +## Using It + +### Instantiate it directly + +```php +use PragmaRX\Google2FA\Google2FA; + +$google2fa = new Google2FA(); + +return $google2fa->generateSecretKey(); +``` + +## How To Generate And Use Two Factor Authentication + +Generate a secret key for your user and save it: + +```php +$user->google2fa_secret = $google2fa->generateSecretKey(); +``` + +## Generating QRCodes + +The securer way of creating QRCode is to do it yourself or using a library. First you have to install the BaconQrCode package, as stated above, then you just have to generate the inline string using: + +```php +$inlineUrl = $google2fa->getQRCodeInline( + $companyName, + $companyEmail, + $secretKey +); +``` + +And use it in your blade template this way: + +```html + +``` + +```php +$secretKey = $google2fa->generateSecretKey(16, $userId); +``` + +## Show the QR Code to your user, via Google Apis + +It's insecure to use it via Google Apis, so you have to enable it before using it. + +```php +$google2fa->setAllowInsecureCallToGoogleApis(true); + +$google2fa_url = $google2fa->getQRCodeGoogleUrl( + 'YourCompany', + $user->email, + $user->google2fa_secret +); + +/// and in your view: + + +``` + +And they should see and scan the QR code to their applications: + +![QRCode](https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth%3A%2F%2Ftotp%2FPragmaRX%3Aacr%2Bpragmarx%40antoniocarlosribeiro.com%3Fsecret%3DADUMJO5634NPDEKW%26issuer%3DPragmaRX) + +And to verify, you just have to: + +```php +$secret = $request->input('secret'); + +$valid = $google2fa->verifyKey($user->google2fa_secret, $secret); +``` + +## QR Code Packages + +This package suggests the use of Bacon/QRCode because it is known as a good QR Code package, but you can use it with any other package, for instance [Simple QrCode](https://www.simplesoftware.io/docs/simple-qrcode), which uses Bacon/QRCode to produce QR Codes. + +Usually you'll need a 2FA URL, so you just have to use the URL generator: + +```php + $google2fa->getQRCodeUrl($companyName, $companyEmail, $secretKey) +``` + +Here's an example using Simple QrCode: + +```php +
      + {!! QrCode::size(100)->generate($google2fa->getQRCodeUrl($companyName, $companyEmail, $secretKey)); !!} +

      Scan me to return to the original page.

      +
      +``` + +## Server Time + +It's really important that you keep your server time in sync with some NTP server, on Ubuntu you can add this to the crontab: + + sudo service ntp stop + sudo ntpd -gq + sudo service ntp start + +## Validation Window + +To avoid problems with clocks that are slightly out of sync, we do not check against the current key only but also consider `$window` keys each from the past and future. You can pass `$window` as optional third parameter to `verifyKey`, it defaults to `4`. A new key is generated every 30 seconds, so this window includes keys from the previous two and next two minutes. + +```php +$secret = $request->input('secret'); + +$window = 8; // 8 keys (respectively 4 minutes) past and future + +$valid = $google2fa->verifyKey($user->google2fa_secret, $secret, $window); +``` + +An attacker might be able to watch the user entering his credentials and one time key. +Without further precautions, the key remains valid until it is no longer within the window of the server time. In order to prevent usage of a one time key that has already been used, you can utilize the `verifyKeyNewer` function. + +```php +$secret = $request->input('secret'); + +$timestamp = $google2fa->verifyKeyNewer($user->google2fa_secret, $secret, $user->google2fa_ts); + +if ($timestamp !== false) { + $user->update(['google2fa_ts' => $timestamp]); + // successful +} else { + // failed +} +``` + +Note that `$timestamp` either `false` (if the key is invalid or has been used before) or the provided key's unix timestamp divided by the key regeneration period of 30 seconds. + +## Using a Bigger and Prefixing the Secret Key + +Although the probability of collision of a 16 bytes (128 bits) random string is very low, you can harden it by: + +#### Use a bigger key + +```php +$secretKey = $google2fa->generateSecretKey(32); // defaults to 16 bytes +``` + +#### You cn prefix your secret keys + +You may prefix your secret keys, but you have to understand that, as your secret key must have length in power of 2, your prefix will have to have a complementary size. So if your key is 16 bytes long, if you add a prefix it must be also 16 bytes long, but as your prefixes will be converted to base 32, the max length of your prefix is 10 bytes. So, those are the sizes you can use in your prefixes: + +``` +1, 2, 5, 10, 20, 40, 80... +``` + +And it can be used like so: + +```php +$prefix = strpad($userId, 10, 'X'); + +$secretKey = $google2fa->generateSecretKey(16, $prefix); +``` + +#### Window + +The Window property defines how long a OTP will work, or how many cycles it will last. A key has a 30 seconds cycle, setting the window to 0 will make the key lasts for those 30 seconds, setting it to 2 will make it last for 120 seconds. This is how you set the window: + +```php +$secretKey = $google2fa->setWindow(4); +``` + +But you can also set the window while checking the key. If you need to set a window of 4 during key verification, this is how you do: + +```php +$isValid = $google2fa->verifyKey($seed, $key, 4); +``` + +#### Key Regeneration Interval + +You can change key regeneration interval, which defaults to 30 seconds, but remember that this is a default value on most authentication apps, like Google Authenticator, which will, basically, make your app out of sync with them. + +```php +$google2fa->setKeyRegeneration(40); +``` + +## Google Authenticator secret key compatibility + +To be compatible with Google Authenticator, your (converted to base 32) secret key length must be at least 8 chars and be a power of 2: 8, 16, 32, 64... + +So, to prevent errors, you can do something like this while generating it: + +```php +$secretKey = '123456789'; + +$secretKey = str_pad($secretKey, pow(2,ceil(log(strlen($secretKey),2))), 'X'); +``` + +And it will generate + +``` +123456789XXXXXXX +``` + +By default, this package will enforce compatibility, but, if Google Authenticator is not a target, you can disable it by doing + +```php +$google2fa->setEnforceGoogleAuthenticatorCompatibility(false); +``` + +## Google Authenticator Apps: + +To use the two factor authentication, your user will have to install a Google Authenticator compatible app, those are some of the currently available: + +* [Authy for iOS, Android, Chrome, OS X](https://www.authy.com/) +* [FreeOTP for iOS, Android and Pebble](https://apps.getpebble.com/en_US/application/52f1a4c3c4117252f9000bb8) +* [Google Authenticator for iOS](https://itunes.apple.com/us/app/google-authenticator/id388497605?mt=8) +* [Google Authenticator for Android](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) +* [Google Authenticator (port) on Windows Store](https://www.microsoft.com/en-us/store/p/google-authenticator/9wzdncrdnkrf) +* [Microsoft Authenticator for Windows Phone](https://www.microsoft.com/en-us/store/apps/authenticator/9wzdncrfj3rj) +* [LastPass Authenticator for iOS, Android, OS X, Windows](https://lastpass.com/auth/) +* [1Password for iOS, Android, OS X, Windows](https://1password.com) + +## Tests + +The package tests were written with [phpspec](http://www.phpspec.net/en/latest/). + +## Authors + +- [Antonio Carlos Ribeiro](http://twitter.com/iantonioribeiro) +- [Phil (Orginal author of this class)](https://www.idontplaydarts.com/static/ga.php_.txt) +- [All Contributors](https://github.com/antonioribeiro/google2fa/graphs/contributors) + +## License + +Google2FA is licensed under the MIT License - see the [LICENSE](LICENSE.md) file for details. + +## Contributing + +Pull requests and issues are more than welcome. diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/RELICENSED.md b/phpMyAdmin/vendor/pragmarx/google2fa/RELICENSED.md new file mode 100755 index 0000000..28e582d --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/RELICENSED.md @@ -0,0 +1,29 @@ +# Package Relicensed + +As per [Issue #100](https://github.com/antonioribeiro/google2fa/issues/100) the relicensing of this package from GPLv3 to MIT was approved by the original developer of the Google2FA class (Phil) and the majority of the contributors, by contributions, of this package. + +# Original License + +``` php +/** + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * PHP Google two-factor authentication module. + * + * See https://www.idontplaydarts.com/2011/07/google-totp-two-factor-authentication-for-php/ + * for more details + * + * @author Phil + **/ +``` diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/changelog.md b/phpMyAdmin/vendor/pragmarx/google2fa/changelog.md new file mode 100755 index 0000000..087d27a --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/changelog.md @@ -0,0 +1,69 @@ +## Change Log + +## [3.0.1] - 2018-03-15 +### Changed +- Relicensed to MIT + +## [3.0.0] - 2018-03-07 +### Changed +- It's now mandatory to enable Google Api secret key access by executing `setAllowInsecureCallToGoogleApis(true);` + +## [2.0.4] - 2017-06-22 +### Fixed +- Fix Base32 to keep supporting PHP 5.4 && 5.5. + +## [2.0.3] - 2017-06-22 +## [2.0.2] - 2017-06-21 +## [2.0.1] - 2017-06-20 +### Fixed +- Minor bugs + +## [2.0.0] - 2017-06-20 +### Changed +- Drop the Laravel support in favor of a bridge package (https://github.com/antonioribeiro/google2fa-laravel). +- Using a more secure Base 32 algorithm, to prevent cache-timing attacks. +- Added verifyKeyNewer() method to prevent reuse of keys. +- Refactored to remove complexity, by extracting support methods. +- Created a package playground page (https://pragmarx.com/google2fa) + +## [2.0.0] - 2017-06-20 +### Changed +- Drop the Laravel support in favor of a bridge package (https://github.com/antonioribeiro/google2fa-laravel). +- Using a more secure Base 32 algorithm, to prevent cache-timing attacks. +- Added verifyKeyNewer() method to prevent reuse of keys. +- Refactored to remove complexity, by extracting support methods. +- Created a package playground page (https://pragmarx.com/google2fa) + +## [1.0.1] - 2016-07-18 +### Changed +- Drop support for PHP 5.3.7, require PHP 5.4+. +- Coding style is now PSR-2 automatically enforced by StyleCI. + +## [1.0.0] - 2016-07-17 +### Changed +- Package bacon/bacon-qr-code was moved to "suggest". + +## [0.8.1] - 2016-07-17 +### Fixed +- Allow paragonie/random_compat ~1.4|~2.0. + +## [0.8.0] - 2016-07-17 +### Changed +- Bumped christian-riesen/base32 to ~1.3 +- Use paragonie/random_compat to generate cryptographically secure random secret keys +- Readme improvements +- Drop simple-qrcode in favor of bacon/bacon-qr-code +- Fix tavis setup for phpspec, PHP 7, hhvm and improve cache + +## [0.7.0] - 2015-11-07 +### Changed +- Fixed URL generation for QRCodes +- Avoid time attacks + +## [0.2.0] - 2015-02-19 +### Changed +- Laravel 5 compatibility. + +## [0.1.0] - 2014-07-06 +### Added +- First version. diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/composer.json b/phpMyAdmin/vendor/pragmarx/google2fa/composer.json new file mode 100755 index 0000000..780fa55 --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/composer.json @@ -0,0 +1,40 @@ +{ + "name": "pragmarx/google2fa", + "description": "A One Time Password Authentication package, compatible with Google Authenticator.", + "keywords": ["authentication", "two factor authentication", "google2fa", "laravel", "2fa"], + "license": "MIT", + "authors": [ + { + "name": "Antonio Carlos Ribeiro", + "email": "acr@antoniocarlosribeiro.com", + "role": "Creator & Designer" + } + ], + "require": { + "php": ">=5.4", + "paragonie/constant_time_encoding": "~1.0|~2.0", + "paragonie/random_compat": ">=1", + "symfony/polyfill-php56": "~1.2" + }, + "require-dev": { + "phpunit/phpunit": "~4|~5|~6", + "bacon/bacon-qr-code": "~1.0" + }, + "autoload": { + "psr-4": { + "PragmaRX\\Google2FA\\": "src/", + "PragmaRX\\Google2FA\\Tests\\": "tests/" + } + }, + "extra": { + "component": "package", + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "suggest": { + "bacon/bacon-qr-code": "Required to generate inline QR Codes." + }, + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/composer.lock b/phpMyAdmin/vendor/pragmarx/google2fa/composer.lock new file mode 100755 index 0000000..f0bac1c --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/composer.lock @@ -0,0 +1,1742 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "This file is @generated automatically" + ], + "content-hash": "f0f90c5128c6c9067f83afae918475f4", + "packages": [ + { + "name": "paragonie/constant_time_encoding", + "version": "v2.2.1", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "7c74c5d08761ead7b5e89d07c854bc28eb0b2186" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/7c74c5d08761ead7b5e89d07c854bc28eb0b2186", + "reference": "7c74c5d08761ead7b5e89d07c854bc28eb0b2186", + "shasum": "" + }, + "require": { + "php": "^7" + }, + "require-dev": { + "phpunit/phpunit": "^6", + "vimeo/psalm": "^0.3|^1" + }, + "type": "library", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "time": "2018-01-23T00:54:57+00:00" + }, + { + "name": "paragonie/random_compat", + "version": "v2.0.11", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", + "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", + "shasum": "" + }, + "require": { + "php": ">=5.2.0" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "autoload": { + "files": [ + "lib/random.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "pseudorandom", + "random" + ], + "time": "2017-09-27T21:40:39+00:00" + }, + { + "name": "symfony/polyfill-php56", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php56.git", + "reference": "ebc999ce5f14204c5150b9bd15f8f04e621409d8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php56/zipball/ebc999ce5f14204c5150b9bd15f8f04e621409d8", + "reference": "ebc999ce5f14204c5150b9bd15f8f04e621409d8", + "shasum": "" + }, + "require": { + "php": ">=5.3.3", + "symfony/polyfill-util": "~1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Php56\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "time": "2018-01-30T19:27:44+00:00" + }, + { + "name": "symfony/polyfill-util", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-util.git", + "reference": "e17c808ec4228026d4f5a8832afa19be85979563" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-util/zipball/e17c808ec4228026d4f5a8832afa19be85979563", + "reference": "e17c808ec4228026d4f5a8832afa19be85979563", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Util\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony utilities for portability of PHP codes", + "homepage": "https://symfony.com", + "keywords": [ + "compat", + "compatibility", + "polyfill", + "shim" + ], + "time": "2018-01-31T18:08:44+00:00" + } + ], + "packages-dev": [ + { + "name": "bacon/bacon-qr-code", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/Bacon/BaconQrCode.git", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Bacon/BaconQrCode/zipball/5a91b62b9d37cee635bbf8d553f4546057250bee", + "reference": "5a91b62b9d37cee635bbf8d553f4546057250bee", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": "^5.4|^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8" + }, + "suggest": { + "ext-gd": "to generate QR code images" + }, + "type": "library", + "autoload": { + "psr-0": { + "BaconQrCode": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-2-Clause" + ], + "authors": [ + { + "name": "Ben Scholzen 'DASPRiD'", + "email": "mail@dasprids.de", + "homepage": "http://www.dasprids.de", + "role": "Developer" + } + ], + "description": "BaconQrCode is a QR code generator for PHP.", + "homepage": "https://github.com/Bacon/BaconQrCode", + "time": "2017-10-17T09:59:25+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "reference": "185b8868aa9bf7159f5f953ed5afb2d7fcdc3bda", + "shasum": "" + }, + "require": { + "php": "^7.1" + }, + "require-dev": { + "athletic/athletic": "~0.1.8", + "ext-pdo": "*", + "ext-phar": "*", + "phpunit/phpunit": "^6.2.3", + "squizlabs/php_codesniffer": "^3.0.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.2.x-dev" + } + }, + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "http://ocramius.github.com/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://github.com/doctrine/instantiator", + "keywords": [ + "constructor", + "instantiate" + ], + "time": "2017-07-22T11:58:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "doctrine/collections": "^1.0", + "doctrine/common": "^2.6", + "phpunit/phpunit": "^4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + }, + "files": [ + "src/DeepCopy/deep_copy.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2017-10-19T19:58:43+00:00" + }, + { + "name": "phar-io/manifest", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", + "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-phar": "*", + "phar-io/version": "^1.0.1", + "php": "^5.6 || ^7.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "time": "2017-03-05T18:14:27+00:00" + }, + { + "name": "phar-io/version", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", + "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "time": "2017-03-05T17:38:23+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "^4.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "time": "2017-09-11T18:02:19+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "4.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/94fd0001232e47129dd3504189fa1c7225010d08", + "reference": "94fd0001232e47129dd3504189fa1c7225010d08", + "shasum": "" + }, + "require": { + "php": "^7.0", + "phpdocumentor/reflection-common": "^1.0.0", + "phpdocumentor/type-resolver": "^0.4.0", + "webmozart/assert": "^1.0" + }, + "require-dev": { + "doctrine/instantiator": "~1.0.5", + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "time": "2017-11-30T07:14:17+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "0.4.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", + "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", + "shasum": "" + }, + "require": { + "php": "^5.5 || ^7.0", + "phpdocumentor/reflection-common": "^1.0" + }, + "require-dev": { + "mockery/mockery": "^0.9.4", + "phpunit/phpunit": "^5.2||^4.8.24" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "time": "2017-07-14T14:27:02+00:00" + }, + { + "name": "phpspec/prophecy", + "version": "1.7.5", + "source": { + "type": "git", + "url": "https://github.com/phpspec/prophecy.git", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", + "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", + "sebastian/comparator": "^1.1|^2.0", + "sebastian/recursion-context": "^1.0|^2.0|^3.0" + }, + "require-dev": { + "phpspec/phpspec": "^2.5|^3.2", + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.7.x-dev" + } + }, + "autoload": { + "psr-0": { + "Prophecy\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Konstantin Kudryashov", + "email": "ever.zet@gmail.com", + "homepage": "http://everzet.com" + }, + { + "name": "Marcello Duarte", + "email": "marcello.duarte@gmail.com" + } + ], + "description": "Highly opinionated mocking framework for PHP 5.3+", + "homepage": "https://github.com/phpspec/prophecy", + "keywords": [ + "Double", + "Dummy", + "fake", + "mock", + "spy", + "stub" + ], + "time": "2018-02-19T10:16:54+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlwriter": "*", + "php": "^7.0", + "phpunit/php-file-iterator": "^1.4.2", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-token-stream": "^2.0.1", + "sebastian/code-unit-reverse-lookup": "^1.0.1", + "sebastian/environment": "^3.0", + "sebastian/version": "^2.0.1", + "theseer/tokenizer": "^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-xdebug": "^2.5.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.3.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "time": "2017-12-06T09:29:45+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "1.4.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", + "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.4.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "time": "2017-11-27T13:52:08+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "time": "2015-06-21T13:50:34+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "1.0.9", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sb@sebastian-bergmann.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "time": "2017-02-26T11:10:40+00:00" + }, + { + "name": "phpunit/php-token-stream", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-token-stream.git", + "reference": "791198a2c6254db10131eecfe8c06670700904db" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", + "reference": "791198a2c6254db10131eecfe8c06670700904db", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Wrapper around PHP's tokenizer extension.", + "homepage": "https://github.com/sebastianbergmann/php-token-stream/", + "keywords": [ + "tokenizer" + ], + "time": "2017-11-27T05:48:46+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "6.5.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "6bd77b57707c236833d2b57b968e403df060c9d9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6bd77b57707c236833d2b57b968e403df060c9d9", + "reference": "6bd77b57707c236833d2b57b968e403df060c9d9", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "^1.6.1", + "phar-io/manifest": "^1.0.1", + "phar-io/version": "^1.0", + "php": "^7.0", + "phpspec/prophecy": "^1.7", + "phpunit/php-code-coverage": "^5.3", + "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-text-template": "^1.2.1", + "phpunit/php-timer": "^1.0.9", + "phpunit/phpunit-mock-objects": "^5.0.5", + "sebastian/comparator": "^2.1", + "sebastian/diff": "^2.0", + "sebastian/environment": "^3.1", + "sebastian/exporter": "^3.1", + "sebastian/global-state": "^2.0", + "sebastian/object-enumerator": "^3.0.3", + "sebastian/resource-operations": "^1.0", + "sebastian/version": "^2.0.1" + }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2", + "phpunit/dbunit": "<3.0" + }, + "require-dev": { + "ext-pdo": "*" + }, + "suggest": { + "ext-xdebug": "*", + "phpunit/php-invoker": "^1.1" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.5.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "time": "2018-02-26T07:01:09+00:00" + }, + { + "name": "phpunit/phpunit-mock-objects", + "version": "5.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", + "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf", + "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.0.5", + "php": "^7.0", + "phpunit/php-text-template": "^1.2.1", + "sebastian/exporter": "^3.1" + }, + "conflict": { + "phpunit/phpunit": "<6.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.5" + }, + "suggest": { + "ext-soap": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Mock Object library for PHPUnit", + "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", + "keywords": [ + "mock", + "xunit" + ], + "time": "2018-01-06T05:45:45+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "reference": "4419fcdb5eabb9caa61a27c7a1db532a6b55dd18", + "shasum": "" + }, + "require": { + "php": "^5.6 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7 || ^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2017-03-04T06:30:41+00:00" + }, + { + "name": "sebastian/comparator", + "version": "2.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", + "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/diff": "^2.0 || ^3.0", + "sebastian/exporter": "^3.1" + }, + "require-dev": { + "phpunit/phpunit": "^6.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "time": "2018-02-01T13:46:46+00:00" + }, + { + "name": "sebastian/diff", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff" + ], + "time": "2017-08-03T08:09:46+00:00" + }, + { + "name": "sebastian/environment", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "time": "2017-07-01T08:51:00+00:00" + }, + { + "name": "sebastian/exporter", + "version": "3.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/234199f4528de6d12aaa58b612e98f7d36adb937", + "reference": "234199f4528de6d12aaa58b612e98f7d36adb937", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "http://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "time": "2017-04-03T13:19:02+00:00" + }, + { + "name": "sebastian/global-state", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "reference": "e8ba02eed7bbbb9e59e43dedd3dddeff4a56b0c4", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "time": "2017-04-27T15:39:26+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "reference": "7cfd9e65d11ffb5af41198476395774d4c8a84c5", + "shasum": "" + }, + "require": { + "php": "^7.0", + "sebastian/object-reflector": "^1.1.1", + "sebastian/recursion-context": "^3.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2017-08-03T12:35:26+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "1.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "773f97c67f28de00d397be301821b06708fca0be" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/773f97c67f28de00d397be301821b06708fca0be", + "reference": "773f97c67f28de00d397be301821b06708fca0be", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "time": "2017-03-29T09:07:27+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "reference": "5b0cd723502bac3b006cbf3dbf7a1e3fcefe4fa8", + "shasum": "" + }, + "require": { + "php": "^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "http://www.github.com/sebastianbergmann/recursion-context", + "time": "2017-03-03T06:23:57+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28T20:34:47+00:00" + }, + { + "name": "sebastian/version", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", + "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "time": "2016-10-03T07:35:21+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "reference": "cb2f008f3f05af2893a87208fe6a6c4985483f8b", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "time": "2017-04-07T12:08:54+00:00" + }, + { + "name": "webmozart/assert", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/webmozart/assert.git", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", + "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "shasum": "" + }, + "require": { + "php": "^5.3.3 || ^7.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.3-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "time": "2018-01-29T19:49:41+00:00" + } + ], + "aliases": [], + "minimum-stability": "dev", + "stability-flags": [], + "prefer-stable": true, + "prefer-lowest": false, + "platform": { + "php": ">=5.4" + }, + "platform-dev": [] +} diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/docs/playground.jpg b/phpMyAdmin/vendor/pragmarx/google2fa/docs/playground.jpg new file mode 100755 index 0000000..0561403 Binary files /dev/null and b/phpMyAdmin/vendor/pragmarx/google2fa/docs/playground.jpg differ diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/phpunit.xml b/phpMyAdmin/vendor/pragmarx/google2fa/phpunit.xml new file mode 100755 index 0000000..5398c13 --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/phpunit.xml @@ -0,0 +1,34 @@ + + + + + + ./tests + + + + + + + + + + + + ./src + + + + diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/src/Exceptions/IncompatibleWithGoogleAuthenticatorException.php b/phpMyAdmin/vendor/pragmarx/google2fa/src/Exceptions/IncompatibleWithGoogleAuthenticatorException.php new file mode 100755 index 0000000..dd4e640 --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/src/Exceptions/IncompatibleWithGoogleAuthenticatorException.php @@ -0,0 +1,10 @@ +setAllowInsecureCallToGoogleApis(true).'; +} diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/src/Exceptions/InvalidCharactersException.php b/phpMyAdmin/vendor/pragmarx/google2fa/src/Exceptions/InvalidCharactersException.php new file mode 100755 index 0000000..41f8c19 --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/src/Exceptions/InvalidCharactersException.php @@ -0,0 +1,10 @@ +getWindow($window); $startingTimestamp++) { + if (hash_equals($this->oathHotp($secret, $startingTimestamp), $key)) { + return + $oldTimestamp === Constants::ARGUMENT_NOT_SET + ? true + : $startingTimestamp; + } + } + + return false; + } + + /** + * Generate a digit secret key in base32 format. + * + * @param int $length + * @param string $prefix + * + * @return string + */ + public function generateSecretKey($length = 16, $prefix = '') + { + return $this->generateBase32RandomKey($length, $prefix); + } + + /** + * Get the current one time password for a key. + * + * @param $secret + * + * @return string + */ + public function getCurrentOtp($secret) + { + return $this->oathHotp($secret, $this->getTimestamp()); + } + + /** + * Get key regeneration. + * + * @return mixed + */ + public function getKeyRegeneration() + { + return $this->keyRegeneration; + } + + /** + * Get OTP length. + * + * @return mixed + */ + public function getOneTimePasswordLength() + { + return $this->oneTimePasswordLength; + } + + /** + * Get secret. + * + * @param string|null $secret + * + * @return mixed + */ + public function getSecret($secret = null) + { + return + is_null($secret) + ? $this->secret + : $secret; + } + + /** + * Returns the current Unix Timestamp divided by the $keyRegeneration + * period. + * + * @return int + **/ + public function getTimestamp() + { + return (int) floor(microtime(true) / $this->keyRegeneration); + } + + /** + * Get the OTP window. + * + * @param null|int $window + * + * @return mixed + */ + public function getWindow($window = null) + { + return + is_null($window) + ? $this->window + : $window; + } + + /** + * Make a window based starting timestamp. + * + * @param $window + * @param $timestamp + * @param $oldTimestamp + * + * @return mixed + */ + private function makeStartingTimestamp($window, $timestamp, $oldTimestamp) + { + return $oldTimestamp === Constants::ARGUMENT_NOT_SET + ? $timestamp - $this->getWindow($window) + : max($timestamp - $this->getWindow($window), $oldTimestamp + 1); + } + + /** + * Get/use a starting timestamp for key verification. + * + * @param string|int|null $timestamp + * + * @return int + */ + protected function makeTimestamp($timestamp = null) + { + if (is_null($timestamp)) { + return $this->getTimestamp(); + } + + return (int) $timestamp; + } + + /** + * Takes the secret key and the timestamp and returns the one time + * password. + * + * @param string $secret - Secret key in binary form. + * @param int $counter - Timestamp as returned by getTimestamp. + * + * @throws SecretKeyTooShortException + * + * @return string + */ + public function oathHotp($secret, $counter) + { + $secret = $this->base32Decode($this->getSecret($secret)); + + if (strlen($secret) < 8) { + throw new SecretKeyTooShortException(); + } + + // Counter must be 64-bit int + $bin_counter = pack('N*', 0, $counter); + + $hash = hash_hmac('sha1', $bin_counter, $secret, true); + + return str_pad($this->oathTruncate($hash), $this->getOneTimePasswordLength(), '0', STR_PAD_LEFT); + } + + /** + * Extracts the OTP from the SHA1 hash. + * + * @param string $hash + * + * @return int + **/ + public function oathTruncate($hash) + { + $offset = ord($hash[19]) & 0xf; + + $temp = unpack('N', substr($hash, $offset, 4)); + + return substr($temp[1] & 0x7fffffff, -$this->getOneTimePasswordLength()); + } + + /** + * Remove invalid chars from a base 32 string. + * + * @param $string + * + * @return mixed + */ + public function removeInvalidChars($string) + { + return preg_replace('/[^'.Constants::VALID_FOR_B32.']/', '', $string); + } + + /** + * Setter for the enforce Google Authenticator compatibility property. + * + * @param mixed $enforceGoogleAuthenticatorCompatibility + * + * @return $this + */ + public function setEnforceGoogleAuthenticatorCompatibility($enforceGoogleAuthenticatorCompatibility) + { + $this->enforceGoogleAuthenticatorCompatibility = $enforceGoogleAuthenticatorCompatibility; + + return $this; + } + + /** + * Set key regeneration. + * + * @param mixed $keyRegeneration + */ + public function setKeyRegeneration($keyRegeneration) + { + $this->keyRegeneration = $keyRegeneration; + } + + /** + * Set OTP length. + * + * @param mixed $oneTimePasswordLength + */ + public function setOneTimePasswordLength($oneTimePasswordLength) + { + $this->oneTimePasswordLength = $oneTimePasswordLength; + } + + /** + * Set secret. + * + * @param mixed $secret + */ + public function setSecret($secret) + { + $this->secret = $secret; + } + + /** + * Set the OTP window. + * + * @param mixed $window + */ + public function setWindow($window) + { + $this->window = $window; + } + + /** + * Verifies a user inputted key against the current timestamp. Checks $window + * keys either side of the timestamp. + * + * @param string $key - User specified key + * @param null|string $secret + * @param null|int $window + * @param null|int $timestamp + * @param null|string|int $oldTimestamp + * + * @return bool|int + */ + public function verify($key, $secret = null, $window = null, $timestamp = null, $oldTimestamp = Constants::ARGUMENT_NOT_SET) + { + return $this->verifyKey( + $secret, + $key, + $window, + $timestamp, + $oldTimestamp + ); + } + + /** + * Verifies a user inputted key against the current timestamp. Checks $window + * keys either side of the timestamp. + * + * @param string $secret + * @param string $key - User specified key + * @param null|int $window + * @param null|int $timestamp + * @param null|string|int $oldTimestamp + * + * @return bool|int + */ + public function verifyKey($secret, $key, $window = null, $timestamp = null, $oldTimestamp = Constants::ARGUMENT_NOT_SET) + { + $timestamp = $this->makeTimestamp($timestamp); + + return $this->findValidOTP( + $secret, + $key, + $window, + $this->makeStartingTimestamp($window, $timestamp, $oldTimestamp), + $timestamp, + $oldTimestamp + ); + } + + /** + * Verifies a user inputted key against the current timestamp. Checks $window + * keys either side of the timestamp, but ensures that the given key is newer than + * the given oldTimestamp. Useful if you need to ensure that a single key cannot + * be used twice. + * + * @param string $secret + * @param string $key - User specified key + * @param int $oldTimestamp - The timestamp from the last verified key + * @param int|null $window + * @param int|null $timestamp + * + * @return bool|int - false (not verified) or the timestamp of the verified key + **/ + public function verifyKeyNewer($secret, $key, $oldTimestamp, $window = null, $timestamp = null) + { + return $this->verifyKey($secret, $key, $window, $timestamp, $oldTimestamp); + } +} diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Base32.php b/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Base32.php new file mode 100755 index 0000000..769d4de --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Base32.php @@ -0,0 +1,135 @@ +toBase32($prefix) : ''; + + $secret = $this->strPadBase32($secret, $length); + + $this->validateSecret($secret); + + return $secret; + } + + /** + * Decodes a base32 string into a binary string. + * + * @param string $b32 + * + * @throws InvalidCharactersException + * + * @return int + */ + public function base32Decode($b32) + { + $b32 = strtoupper($b32); + + $this->validateSecret($b32); + + return ParagonieBase32::decodeUpper($b32); + } + + /** + * Pad string with random base 32 chars. + * + * @param $string + * @param $length + * + * @return string + */ + private function strPadBase32($string, $length) + { + for ($i = 0; $i < $length; $i++) { + $string .= substr(Constants::VALID_FOR_B32_SCRAMBLED, $this->getRandomNumber(), 1); + } + + return $string; + } + + /** + * Encode a string to Base32. + * + * @param $string + * + * @return mixed + */ + public function toBase32($string) + { + $encoded = ParagonieBase32::encodeUpper($string); + + return str_replace('=', '', $encoded); + } + + /** + * Get a random number. + * + * @param $from + * @param $to + * + * @return int + */ + protected function getRandomNumber($from = 0, $to = 31) + { + return random_int($from, $to); + } + + /** + * Validate the secret. + * + * @param $b32 + */ + protected function validateSecret($b32) + { + $this->checkForValidCharacters($b32); + + $this->checkGoogleAuthenticatorCompatibility($b32); + } + + /** + * Check if the secret key is compatible with Google Authenticator. + * + * @param $b32 + * + * @throws IncompatibleWithGoogleAuthenticatorException + */ + protected function checkGoogleAuthenticatorCompatibility($b32) + { + if ($this->enforceGoogleAuthenticatorCompatibility && ((strlen($b32) & (strlen($b32) - 1)) !== 0)) { + throw new IncompatibleWithGoogleAuthenticatorException(); + } + } + + /** + * Check if all secret key characters are valid. + * + * @param $b32 + * + * @throws InvalidCharactersException + */ + protected function checkForValidCharacters($b32) + { + if (preg_replace('/[^'.Constants::VALID_FOR_B32.']/', '', $b32) !== $b32) { + throw new InvalidCharactersException(); + } + } +} diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Constants.php b/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Constants.php new file mode 100755 index 0000000..ba37e62 --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Constants.php @@ -0,0 +1,21 @@ +allowInsecureCallToGoogleApis) { + throw new InsecureCallException('It\'s not secure to send secret keys to Google Apis, you have to explicitly allow it by calling $google2fa->setAllowInsecureCallToGoogleApis(true).'); + } + + $url = $this->getQRCodeUrl($company, $holder, $secret); + + return Url::generateGoogleQRCodeUrl('https://chart.googleapis.com/', 'chart', 'chs='.$size.'x'.$size.'&chld=M|0&cht=qr&chl=', $url); + } + + /** + * Generates a QR code data url to display inline. + * + * @param string $company + * @param string $holder + * @param string $secret + * @param int $size + * @param string $encoding Default to UTF-8 + * + * @return string + */ + public function getQRCodeInline($company, $holder, $secret, $size = 200, $encoding = 'utf-8') + { + $url = $this->getQRCodeUrl($company, $holder, $secret); + + $renderer = new Png(); + $renderer->setWidth($size); + $renderer->setHeight($size); + + $bacon = new BaconQrCodeWriter($renderer); + $data = $bacon->writeString($url, $encoding); + + return 'data:image/png;base64,'.base64_encode($data); + } + + /** + * Creates a QR code url. + * + * @param $company + * @param $holder + * @param $secret + * + * @return string + */ + public function getQRCodeUrl($company, $holder, $secret) + { + return 'otpauth://totp/'.rawurlencode($company).':'.rawurlencode($holder).'?secret='.$secret.'&issuer='.rawurlencode($company).''; + } + + /** + * AllowInsecureCallToGoogleApis setter. + * + * @param mixed $allowInsecureCallToGoogleApis + * + * @return QRCode + */ + public function setAllowInsecureCallToGoogleApis($allowInsecureCallToGoogleApis) + { + $this->allowInsecureCallToGoogleApis = $allowInsecureCallToGoogleApis; + + return $this; + } +} diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Url.php b/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Url.php new file mode 100755 index 0000000..bcaed87 --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/src/Support/Url.php @@ -0,0 +1,16 @@ +google2fa = new Google2FA(); + } + + public function testIsInitializable() + { + $this->assertInstanceOf('PragmaRX\Google2FA\Google2FA', $this->google2fa); + } + + public function testGeneratesAValidSecretKey() + { + $this->assertEquals(16, strlen($this->google2fa->generateSecretKey())); + + $this->assertEquals(32, strlen($this->google2fa->generateSecretKey(32))); + + $this->assertStringStartsWith('MFXHI', $this->google2fa->generateSecretKey(59, 'ant')); + + $this->assertStringStartsWith('MFXHI', $this->google2fa->generateSecretKey(59, 'ant')); + + $this->assertEquals($key = $this->google2fa->generateSecretKey(), preg_replace('/[^'.Google2FAConstants::VALID_FOR_B32.']/', '', $key)); + } + + /** + * @expectedException \PragmaRX\Google2FA\Exceptions\IncompatibleWithGoogleAuthenticatorException + */ + public function testGeneratesASecretKeysCompatibleWithGoogleAuthenticatorOrNot() + { + $this->google2fa->setEnforceGoogleAuthenticatorCompatibility(true)->generateSecretKey(17); + + $this->assertEquals(17, strlen($this->google2fa->setEnforceGoogleAuthenticatorCompatibility(false)->generateSecretKey(17))); + } + + public function testConvertsInvalidCharsToBase32() + { + $converted = $this->google2fa->generateBase32RandomKey(16, '1234'.chr(250).chr(251).chr(252).chr(253).chr(254).chr(255)); + + $valid = preg_replace('/[^'.Google2FAConstants::VALID_FOR_B32.']/', '', $converted); + + $this->assertEquals($converted, $valid); + } + + public function testGetsValidTimestamps() + { + $ts = $this->google2fa->getTimestamp(); + + $this->assertLessThanOrEqual(PHP_INT_MAX, $ts); + + $this->assertGreaterThanOrEqual(~PHP_INT_MAX, $ts); + } + + public function testDecodesBase32Strings() + { + $result = chr(0) + .chr(232) + .chr(196) + .chr(187) + .chr(190) + .chr(223) + .chr(26) + .chr(241) + .chr(145) + .chr(86); + + $this->assertEquals($result, $this->google2fa->base32Decode(Constants::SECRET)); + } + + public function testCreatesAOneTimePassword() + { + $this->assertEquals(6, strlen($this->google2fa->getCurrentOtp(Constants::SECRET))); + } + + public function testVerifiesKeys() + { + // $ts 26213400 with KEY_REGENERATION 30 seconds is + // timestamp 786402000, which is 1994-12-02 21:00:00 UTC + + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '558854', 2, 26213400)); // 26213398 + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '981084', 2, 26213400)); // 26213399 + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '512396', 2, 26213400)); // 26213400 + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '410272', 2, 26213400)); // 26213401 + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '239815', 2, 26213400)); // 26213402 + + $this->assertFalse($this->google2fa->verifyKey(Constants::SECRET, '313366', 2, 26213400)); // 26213403 + $this->assertFalse($this->google2fa->verifyKey(Constants::SECRET, '093183', 2, 26213400)); // 26213397 + } + + public function testVerifiesKeysNewer() + { + $this->assertFalse($this->google2fa->verifyKeyNewer(Constants::SECRET, '512396', 26213401, 2, 26213400)); + $this->assertFalse($this->google2fa->verifyKeyNewer(Constants::SECRET, '410272', 26213401, 2, 26213400)); + $this->assertEquals(26213402, $this->google2fa->verifyKeyNewer(Constants::SECRET, '239815', 26213401, 2, 26213400)); + $this->assertFalse($this->google2fa->verifyKeyNewer(Constants::SECRET, '313366', 26213401, 2, 26213400)); + + $this->assertEquals(26213400, $this->google2fa->verifyKeyNewer(Constants::SECRET, '512396', null, 2, 26213400)); + $this->assertEquals(26213401, $this->google2fa->verifyKeyNewer(Constants::SECRET, '410272', null, 2, 26213400)); + $this->assertEquals(26213402, $this->google2fa->verifyKeyNewer(Constants::SECRET, '239815', null, 2, 26213400)); + $this->assertFalse($this->google2fa->verifyKeyNewer(Constants::SECRET, '313366', null, 2, 26213400)); + } + + public function testRemovesInvalidCharsFromSecret() + { + $this->assertEquals(Constants::SECRET, $this->google2fa->removeInvalidChars(Constants::SECRET.'!1-@@@')); + } + + public function testCreatesAQrCode() + { + $this->assertEquals(Constants::URL, $this->google2fa->setAllowInsecureCallToGoogleApis(true)->getQRCodeGoogleUrl('PragmaRX', 'acr+pragmarx@antoniocarlosribeiro.com', Constants::SECRET)); + } + + /** + * @expectedException \PragmaRX\Google2FA\Exceptions\InsecureCallException + */ + public function testGetExceptionWhenUsingGoogleApis() + { + $this->assertEquals(Constants::URL, $this->google2fa->getQRCodeGoogleUrl('PragmaRX', 'acr+pragmarx@antoniocarlosribeiro.com', Constants::SECRET)); + } + + public function testConvertsToBase32() + { + $this->assertEquals('KBZGCZ3NMFJFQ', $this->google2fa->toBase32('PragmaRX')); + } + + public function testSetsTheWindow() + { + $this->google2fa->setWindow(6); + + $this->assertEquals(6, $this->google2fa->getWindow()); + + $this->assertEquals(1, $this->google2fa->getWindow(1)); + + $this->google2fa->setWindow(0); + + $this->assertFalse($this->google2fa->verifyKey(Constants::SECRET, '558854', null, 26213400)); + + $this->google2fa->setWindow(2); + + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '558854', null, 26213400)); + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '558854', null, 26213399)); + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '558854', null, 26213398)); + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '558854', null, 26213396)); + $this->assertFalse($this->google2fa->verifyKey(Constants::SECRET, '558854', null, 26213395)); + } + + public function testSetsTheSecret() + { + $this->assertFalse($this->google2fa->verify('558854', Constants::WRONG_SECRET)); + + $this->google2fa->setWindow(2); + + $this->assertTrue($this->google2fa->verify('558854', Constants::SECRET, null, 26213400)); + + $this->google2fa->setSecret(Constants::SECRET); + + $this->assertTrue($this->google2fa->verify('558854', null, null, 26213400)); + } + + public function testGetsKeyRegeneration() + { + $this->google2fa->setKeyRegeneration(11); + + $this->assertEquals(11, $this->google2fa->getKeyRegeneration()); + } + + public function testGetsOtpLength() + { + $this->google2fa->setOneTimePasswordLength(7); + + $this->assertEquals(7, $this->google2fa->getOneTimePasswordLength()); + } + + public function testGeneratesPasswordsInManyDifferentSizes() + { + $this->google2fa->setWindow(2); + + $this->google2fa->setOneTimePasswordLength(6); + + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '558854', null, 26213400)); + + $this->google2fa->setOneTimePasswordLength(7); + + $this->assertTrue($this->google2fa->verifyKey(Constants::SECRET, '8981084', null, 26213400)); + } + + /** + * @expectedException \PragmaRX\Google2FA\Exceptions\SecretKeyTooShortException + */ + public function testShortSecretKey() + { + $this->google2fa->setEnforceGoogleAuthenticatorCompatibility(false); + + $this->google2fa->verifyKey(Constants::SHORT_SECRET, '558854', null, 26213400); + } + + /** + * @expectedException \PragmaRX\Google2FA\Exceptions\InvalidCharactersException + */ + public function testValidateKey() + { + $this->assertTrue(is_numeric($this->google2fa->getCurrentOtp(Constants::SECRET))); + + $this->google2fa->setEnforceGoogleAuthenticatorCompatibility(false); + + $this->google2fa->getCurrentOtp(Constants::INVALID_SECRET); + } + + public function testQrcodeInline() + { + $this->assertEquals( + phpversion() >= '7.2' ? Constants::QRCODEPHPABOVE72 : Constants::QRCODEPHPBELOW72, + $this->google2fa->getQRCodeInline('PragmaRX', 'acr+pragmarx@antoniocarlosribeiro.com', Constants::SECRET) + ); + } +} diff --git a/phpMyAdmin/vendor/pragmarx/google2fa/tests/bootstrap.php b/phpMyAdmin/vendor/pragmarx/google2fa/tests/bootstrap.php new file mode 100755 index 0000000..56032ea --- /dev/null +++ b/phpMyAdmin/vendor/pragmarx/google2fa/tests/bootstrap.php @@ -0,0 +1,42 @@ +=5.3.0" + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + } +} diff --git a/phpMyAdmin/vendor/psr/container/src/ContainerExceptionInterface.php b/phpMyAdmin/vendor/psr/container/src/ContainerExceptionInterface.php new file mode 100755 index 0000000..d35c6b4 --- /dev/null +++ b/phpMyAdmin/vendor/psr/container/src/ContainerExceptionInterface.php @@ -0,0 +1,13 @@ + + + U2F Key Registration + + +

      U2F Registration

      +

      Please enter your FIDO U2F device into your computer's USB port. Then confirm registration on the device.

      + +
      +
      + +
      +
      + + + + + +``` + +#### Registration Step 3: +**Validation and Key Storage** + +This is the last stage of registration. Validate the registration response data against the original request data. + +```php +storeRegistration($validatedRegistration); + + // Then let your user know what happened + $userMessage = "Success"; +} catch( Exception $e ) { + $userMessage = "We had an error: ". $e->getMessage(); +} + +//Fictitious view. +echo View::make('template/location/u2f-registration-result.html', compact('userMessage')); +``` + +--- + +### Authentication Code + +#### Authentication Step 1: +**Starting the authentication process:** + +We assume that user has successfully authenticated and has previously registered to use FIDO U2F. + +```php +U2FRegistrations(); + +// This can be anything, but usually easier if you choose your applications domain and top level domain. +$appId = "yourdomain.tld"; + +// Call the U2F makeAuthentication method, passing in the user's registration(s) and the app ID +$authenticationRequest = U2F::makeAuthentication($registrations, $appId); + +// Store the request for later +$_SESSION['authenticationRequest'] = $authenticationRequest; + +// now pass the data to a fictitious view. +echo View::make('template/location/u2f-authentication.html', compact("authenticationRequest")); +``` + +#### Authentication Step 2: +**Client-side, Talking To The USB** + +Non-AJAX client-side authentication of U2F key token. AJAX can of course be used in your application, but it is easier to demonstrate a linear process without AJAX and callbacks. + + +```html + + + U2F Key Authentication + + +

      U2F Authentication

      +

      Please enter your FIDO U2F device into your computer's USB port. Then confirm authentication on the device.

      + +
      +
      + +
      +
      + + + + + +``` + +#### Authentication Step 3: +**Validation** + +This is the last stage of authentication. Validate the authentication response data against the original request data. + +```php +U2FRegistrations(); + +try { + + // Validate the authentication response against the registration request. + // The output are the credentials you need to store for U2F authentication. + $validatedAuthentication = U2F::authenticate( + $_SESSION['authenticationRequest'], + $registrations, + json_decode($_POST['u2f_authentication_response']) + ); + + // Fictitious function representing the updating of the U2F token count integer. + $user->updateU2FRegistrationCount($validatedAuthentication); + + // Then let your user know what happened + $userMessage = "Success"; +} catch( Exception $e ) { + $userMessage = "We had an error: ". $e->getMessage(); +} + +//Fictitious view. +echo View::make('template/location/u2f-authentication-result.html', compact('userMessage')); +``` + +--- + +Again, if you want to just download some example code to play with just install the full working code examples written for this repository please see [the dedicated example repository](https://github.com/Samyoul/U2F-php-server-examples) + +You can also install it with the following: + +```bash +$ git clone https://github.com/Samyoul/U2F-php-server-examples.git +$ cd u2f-php-server-examples +$ composer install +``` + +## Frameworks + +### Laravel Framework + +See the dedicated repository : https://github.com/Samyoul/U2F-Laravel-server + +Installation: + +`composer require u2f-laravel-server` + +### Yii Framework + +See the dedicated repository : https://github.com/Samyoul/U2F-Yii-server + +Installation: + +`composer require u2f-yii-server` + +### CodeIgniter Framework + +See the dedicated repository : https://github.com/Samyoul/U2F-CodeIgniter-server + +Installation: + +`composer require u2f-codeigniter-server` + +### Can't see yours? + +**Your favourite php framework not in this list? Get coding and submit a pull request and get your framework extension included here.** + +## Licence + +The repository is licensed under a BSD license. [Read details here](https://github.com/Samyoul/U2F-php-server/blob/master/LICENCE.md) + +## Credits + +This repo was originally based on the Yubico php-u2flib-server https://github.com/Yubico/php-u2flib-server diff --git a/phpMyAdmin/vendor/samyoul/u2f-php-server/composer.json b/phpMyAdmin/vendor/samyoul/u2f-php-server/composer.json new file mode 100755 index 0000000..8da2271 --- /dev/null +++ b/phpMyAdmin/vendor/samyoul/u2f-php-server/composer.json @@ -0,0 +1,17 @@ +{ + "name": "samyoul/u2f-php-server", + "description": "Server side handling class for FIDO U2F registration and authentication", + "license":"BSD-2-Clause", + "authors": [ + { + "name": "Samuel Hawksby-Robinson", + "email": "samuel@samyoul.com" + } + ], + "require": { + "ext-openssl":"*" + }, + "autoload": { + "psr-4": { "Samyoul\\U2F\\U2FServer\\": ["src/"] } + } +} diff --git a/phpMyAdmin/vendor/samyoul/u2f-php-server/src/Registration.php b/phpMyAdmin/vendor/samyoul/u2f-php-server/src/Registration.php new file mode 100755 index 0000000..dbc1c9a --- /dev/null +++ b/phpMyAdmin/vendor/samyoul/u2f-php-server/src/Registration.php @@ -0,0 +1,81 @@ +keyHandle = $keyHandle; + } + + /** + * @param string $publicKey + */ + public function setPublicKey($publicKey) + { + $this->publicKey = $publicKey; + } + + /** + * @param string $certificate + */ + public function setCertificate($certificate) + { + $this->certificate = $certificate; + } + + /** + * @return string + */ + public function getKeyHandle() + { + return $this->keyHandle; + } + + /** + * @return string + */ + public function getPublicKey() + { + return $this->publicKey; + } + + /** + * @return string + */ + public function getCertificate() + { + return $this->certificate; + } + + /** + * @return string + */ + public function getCounter() + { + return $this->counter; + } +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/samyoul/u2f-php-server/src/RegistrationRequest.php b/phpMyAdmin/vendor/samyoul/u2f-php-server/src/RegistrationRequest.php new file mode 100755 index 0000000..5204d4b --- /dev/null +++ b/phpMyAdmin/vendor/samyoul/u2f-php-server/src/RegistrationRequest.php @@ -0,0 +1,56 @@ +challenge = $challenge; + $this->appId = $appId; + } + + public function version() + { + return $this->version; + } + + public function challenge() + { + return $this->challenge; + } + + public function appId() + { + return $this->appId; + } + + public function jsonSerialize() + { + return [ + 'version' => $this->version, + 'challenge' => $this->challenge, + 'appId' => $this->appId, + ]; + } + +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/samyoul/u2f-php-server/src/SignRequest.php b/phpMyAdmin/vendor/samyoul/u2f-php-server/src/SignRequest.php new file mode 100755 index 0000000..8a825aa --- /dev/null +++ b/phpMyAdmin/vendor/samyoul/u2f-php-server/src/SignRequest.php @@ -0,0 +1,75 @@ +challenge = $parameters['challenge']; + $this->keyHandle = $parameters['keyHandle']; + $this->appId = $parameters['appId']; + } + + /** + * @return string + */ + public function version() + { + return $this->version; + } + + /** + * @return string + */ + public function challenge() + { + return $this->challenge; + } + + /** + * @return string + */ + public function keyHandle() + { + return $this->keyHandle; + } + + /** + * @return string + */ + public function appId() + { + return $this->appId; + } + + public function jsonSerialize() + { + return [ + 'version' => $this->version, + 'challenge' => $this->challenge, + 'keyHandle' => $this->keyHandle, + 'appId' => $this->appId, + ]; + } + +} \ No newline at end of file diff --git a/phpMyAdmin/vendor/samyoul/u2f-php-server/src/U2FException.php b/phpMyAdmin/vendor/samyoul/u2f-php-server/src/U2FException.php new file mode 100755 index 0000000..03c5eaf --- /dev/null +++ b/phpMyAdmin/vendor/samyoul/u2f-php-server/src/U2FException.php @@ -0,0 +1,60 @@ + $request, + "signatures" => $signatures + ]; + } + + /** + * Called to verify and unpack a registration message. + * + * @param RegistrationRequest $request this is a reply to + * @param object $response response from a user + * @param string $attestDir + * @param bool $includeCert set to true if the attestation certificate should be + * included in the returned Registration object + * @return Registration + * @throws U2FException + */ + public static function register(RegistrationRequest $request, $response, $attestDir = null, $includeCert = true) + { + // Parameter Checks + if( !is_object( $request ) ) { + throw new \InvalidArgumentException('$request of register() method only accepts object.'); + } + + if( !is_object( $response ) ) { + throw new \InvalidArgumentException('$response of register() method only accepts object.'); + } + + if( property_exists( $response, 'errorCode') && $response->errorCode !== 0 ) { + throw new U2FException( + 'User-agent returned error. Error code: ' . $response->errorCode, + U2FException::BAD_UA_RETURNING + ); + } + + if( !is_bool( $includeCert ) ) { + throw new \InvalidArgumentException('$include_cert of register() method only accepts boolean.'); + } + + // Unpack the registration data coming from the client-side token + $rawRegistration = static::base64u_decode($response->registrationData); + $registrationData = array_values(unpack('C*', $rawRegistration)); + $clientData = static::base64u_decode($response->clientData); + $clientToken = json_decode($clientData); + + // Check Client's challenge matches the original request's challenge + if($clientToken->challenge !== $request->challenge()) { + throw new U2FException( + 'Registration challenge does not match', + U2FException::UNMATCHED_CHALLENGE + ); + } + + // Begin validating and building the registration + $registration = new Registration(); + $offset = 1; + $pubKey = substr($rawRegistration, $offset, static::PUBKEY_LEN); + $offset += static::PUBKEY_LEN; + + // Validate and set the public key + if(static::publicKeyToPem($pubKey) === null) { + throw new U2FException( + 'Decoding of public key failed', + U2FException::PUBKEY_DECODE + ); + } + $registration->setPublicKey(base64_encode($pubKey)); + + // Build and set the key handle. + $keyHandleLength = $registrationData[$offset++]; + $keyHandle = substr($rawRegistration, $offset, $keyHandleLength); + $offset += $keyHandleLength; + $registration->setKeyHandle(static::base64u_encode($keyHandle)); + + // Build certificate + // Set certificate length + // Note: length of certificate is stored in byte 3 and 4 (excluding the first 4 bytes) + $certLength = 4; + $certLength += ($registrationData[$offset + 2] << 8); + $certLength += $registrationData[$offset + 3]; + + // Write the certificate from the returning registration data + $rawCert = static::fixSignatureUnusedBits(substr($rawRegistration, $offset, $certLength)); + $offset += $certLength; + $pemCert = "-----BEGIN CERTIFICATE-----\r\n"; + $pemCert .= chunk_split(base64_encode($rawCert), 64); + $pemCert .= "-----END CERTIFICATE-----"; + if($includeCert) { + $registration->setCertificate( base64_encode($rawCert) ); + } + + // If we've set the attestDir, check the given certificate can be used. + if($attestDir) { + if(openssl_x509_checkpurpose($pemCert, -1, static::get_certs($attestDir)) !== true) { + throw new U2FException( + 'Attestation certificate can not be validated', + U2FException::ATTESTATION_VERIFICATION + ); + } + } + + // Attempt to extract public key from the certificate, if we can't something went wrong in making it. + if(!openssl_pkey_get_public($pemCert)) { + throw new U2FException( + 'Decoding of public key failed', + U2FException::PUBKEY_DECODE + ); + } + + // Generate signature from the remaining part of the raw registration data + $signature = substr($rawRegistration, $offset); + + // Build a verification string from the components we've made in this function + $dataToVerify = chr(0); + $dataToVerify .= hash('sha256', $request->appId(), true); + $dataToVerify .= hash('sha256', $clientData, true); + $dataToVerify .= $keyHandle; + $dataToVerify .= $pubKey; + + // Verify our data against the signature and the certificate, on success return the registration object + if(openssl_verify($dataToVerify, $signature, $pemCert, 'sha256') === 1) { + return $registration; + } else { + throw new U2FException( + 'Attestation signature does not match', + U2FException::ATTESTATION_SIGNATURE + ); + } + } + + /** + * Called to get an authentication request. + * + * @param array $registrations An array of the registrations to create authentication requests for. + * @param string $appId Application id for the running application, Basically the app's URL + * @return array An array of SignRequest + * @throws \InvalidArgumentException + */ + public static function makeAuthentication(array $registrations, $appId) + { + $signatures = []; + $challenge = static::createChallenge(); + foreach ($registrations as $reg) { + if( !is_object( $reg ) ) { + throw new \InvalidArgumentException('$registrations of makeAuthentication() method only accepts array of object.'); + } + + $signatures[] = new SignRequest([ + 'appId' => $appId, + 'keyHandle' => $reg->keyHandle, + 'challenge' => $challenge, + ]); + } + return $signatures; + } + + /** + * Called to verify an authentication response + * + * @param array $requests An array of outstanding authentication requests + * @param array $registrations An array of current registrations + * @param object $response A response from the authenticator + * @return \stdClass + * @throws U2FException + * + * The Registration object returned on success contains an updated counter + * that should be saved for future authentications. + * If the Error returned is ERR_COUNTER_TOO_LOW this is an indication of + * token cloning or similar and appropriate action should be taken. + */ + public static function authenticate(array $requests, array $registrations, $response) + { + // Parameter checks + if( !is_object( $response ) ) { + throw new \InvalidArgumentException('$response of authenticate() method only accepts object.'); + } + + if( property_exists( $response, 'errorCode') && $response->errorCode !== 0 ) { + throw new U2FException( + 'User-agent returned error. Error code: ' . $response->errorCode, + U2FException::BAD_UA_RETURNING + ); + } + + // Set default values to null, so we get fails by default + /** @var object|null $req */ + $req = null; + + /** @var object|null $reg */ + $reg = null; + + // Extract client response data + $clientData = static::base64u_decode($response->clientData); + $decodedClient = json_decode($clientData); + + // Check we have a match among the requests and the response + foreach ($requests as $req) { + if( !is_object( $req ) ) { + throw new \InvalidArgumentException('$requests of authenticate() method only accepts an array of objects.'); + } + + if($req->keyHandle() === $response->keyHandle && $req->challenge() === $decodedClient->challenge) { + break; + } + + $req = null; + } + if($req === null) { + throw new U2FException( + 'No matching request found', + U2FException::NO_MATCHING_REQUEST + ); + } + + // Check for a match for the response among a list of registrations + foreach ($registrations as $reg) { + if( !is_object( $reg ) ) { + throw new \InvalidArgumentException('$registrations of authenticate() method only accepts an array of objects.'); + } + + if($reg->keyHandle === $response->keyHandle) { + break; + } + $reg = null; + } + if($reg === null) { + throw new U2FException( + 'No matching registration found', + U2FException::NO_MATCHING_REGISTRATION + ); + } + + // On Success, check we have a valid public key + $pemKey = static::publicKeyToPem(static::base64u_decode($reg->publicKey)); + if($pemKey === null) { + throw new U2FException( + 'Decoding of public key failed', + U2FException::PUBKEY_DECODE + ); + } + + // Build signature and data from response + $signData = static::base64u_decode($response->signatureData); + $dataToVerify = hash('sha256', $req->appId(), true); + $dataToVerify .= substr($signData, 0, 5); + $dataToVerify .= hash('sha256', $clientData, true); + $signature = substr($signData, 5); + + // Verify the response data against the public key + if(openssl_verify($dataToVerify, $signature, $pemKey, 'sha256') === 1) { + $ctr = unpack("Nctr", substr($signData, 1, 4)); + $counter = $ctr['ctr']; + /* TODO: wrap-around should be handled somehow.. */ + if($counter > $reg->counter) { + $reg->counter = $counter; + return $reg; + } else { + throw new U2FException( + 'Counter too low.', + U2FException::COUNTER_TOO_LOW + ); + } + } else { + throw new U2FException( + 'Authentication failed', + U2FException::AUTHENTICATION_FAILURE + ); + } + } + + /** + * @param string $attestDir + * @return array + */ + private static function get_certs($attestDir) + { + $files = []; + $dir = $attestDir; + if($dir && $handle = opendir($dir)) { + while(false !== ($entry = readdir($handle))) { + if(is_file("$dir/$entry")) { + $files[] = "$dir/$entry"; + } + } + closedir($handle); + } + return $files; + } + + /** + * @param string $data + * @return string + */ + private static function base64u_encode($data) + { + return trim(strtr(base64_encode($data), '+/', '-_'), '='); + } + + /** + * @param string $data + * @return string + */ + private static function base64u_decode($data) + { + return base64_decode(strtr($data, '-_', '+/')); + } + + /** + * @param string $key + * @return null|string + */ + private static function publicKeyToPem($key) + { + if(strlen($key) !== static::PUBKEY_LEN || $key[0] !== "\x04") { + return null; + } + + /* + * Convert the public key to binary DER format first + * Using the ECC SubjectPublicKeyInfo OIDs from RFC 5480 + * + * SEQUENCE(2 elem) 30 59 + * SEQUENCE(2 elem) 30 13 + * OID1.2.840.10045.2.1 (id-ecPublicKey) 06 07 2a 86 48 ce 3d 02 01 + * OID1.2.840.10045.3.1.7 (secp256r1) 06 08 2a 86 48 ce 3d 03 01 07 + * BIT STRING(520 bit) 03 42 ..key.. + */ + $der = "\x30\x59\x30\x13\x06\x07\x2a\x86\x48\xce\x3d\x02\x01"; + $der .= "\x06\x08\x2a\x86\x48\xce\x3d\x03\x01\x07\x03\x42"; + $der .= "\0".$key; + + $pem = "-----BEGIN PUBLIC KEY-----\r\n"; + $pem .= chunk_split(base64_encode($der), 64); + $pem .= "-----END PUBLIC KEY-----"; + + return $pem; + } + + /** + * @return string + * @throws U2FException + */ + private static function createChallenge() + { + $challenge = openssl_random_pseudo_bytes(32, $crypto_strong ); + if( $crypto_strong !== true ) { + throw new U2FException( + 'Unable to obtain a good source of randomness', + U2FException::BAD_RANDOM + ); + } + + $challenge = static::base64u_encode( $challenge ); + + return $challenge; + } + + /** + * Fixes a certificate where the signature contains unused bits. + * + * @param string $cert + * @return mixed + */ + private static function fixSignatureUnusedBits($cert) + { + if(in_array(hash('sha256', $cert), static::$FIXCERTS)) { + $cert[strlen($cert) - 257] = "\0"; + } + return $cert; + } + +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/CHANGELOG.md b/phpMyAdmin/vendor/symfony/expression-language/CHANGELOG.md new file mode 100755 index 0000000..d00d17c --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/CHANGELOG.md @@ -0,0 +1,12 @@ +CHANGELOG +========= + +2.6.0 +----- + + * Added ExpressionFunction and ExpressionFunctionProviderInterface + +2.4.0 +----- + + * added the component diff --git a/phpMyAdmin/vendor/symfony/expression-language/Compiler.php b/phpMyAdmin/vendor/symfony/expression-language/Compiler.php new file mode 100755 index 0000000..acfb618 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Compiler.php @@ -0,0 +1,146 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * Compiles a node to PHP code. + * + * @author Fabien Potencier + */ +class Compiler +{ + private $source; + private $functions; + + public function __construct(array $functions) + { + $this->functions = $functions; + } + + public function getFunction($name) + { + return $this->functions[$name]; + } + + /** + * Gets the current PHP code after compilation. + * + * @return string The PHP code + */ + public function getSource() + { + return $this->source; + } + + public function reset() + { + $this->source = ''; + + return $this; + } + + /** + * Compiles a node. + * + * @return $this + */ + public function compile(Node\Node $node) + { + $node->compile($this); + + return $this; + } + + public function subcompile(Node\Node $node) + { + $current = $this->source; + $this->source = ''; + + $node->compile($this); + + $source = $this->source; + $this->source = $current; + + return $source; + } + + /** + * Adds a raw string to the compiled code. + * + * @param string $string The string + * + * @return $this + */ + public function raw($string) + { + $this->source .= $string; + + return $this; + } + + /** + * Adds a quoted string to the compiled code. + * + * @param string $value The string + * + * @return $this + */ + public function string($value) + { + $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\")); + + return $this; + } + + /** + * Returns a PHP representation of a given value. + * + * @param mixed $value The value to convert + * + * @return $this + */ + public function repr($value) + { + if (\is_int($value) || \is_float($value)) { + if (false !== $locale = setlocale(LC_NUMERIC, 0)) { + setlocale(LC_NUMERIC, 'C'); + } + + $this->raw($value); + + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + } elseif (null === $value) { + $this->raw('null'); + } elseif (\is_bool($value)) { + $this->raw($value ? 'true' : 'false'); + } elseif (\is_array($value)) { + $this->raw('array('); + $first = true; + foreach ($value as $key => $value) { + if (!$first) { + $this->raw(', '); + } + $first = false; + $this->repr($key); + $this->raw(' => '); + $this->repr($value); + } + $this->raw(')'); + } else { + $this->string($value); + } + + return $this; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Expression.php b/phpMyAdmin/vendor/symfony/expression-language/Expression.php new file mode 100755 index 0000000..ac656cc --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Expression.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * Represents an expression. + * + * @author Fabien Potencier + */ +class Expression +{ + protected $expression; + + /** + * @param string $expression An expression + */ + public function __construct($expression) + { + $this->expression = (string) $expression; + } + + /** + * Gets the expression. + * + * @return string The expression + */ + public function __toString() + { + return $this->expression; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/ExpressionFunction.php b/phpMyAdmin/vendor/symfony/expression-language/ExpressionFunction.php new file mode 100755 index 0000000..dfb18d1 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/ExpressionFunction.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * Represents a function that can be used in an expression. + * + * A function is defined by two PHP callables. The callables are used + * by the language to compile and/or evaluate the function. + * + * The "compiler" function is used at compilation time and must return a + * PHP representation of the function call (it receives the function + * arguments as arguments). + * + * The "evaluator" function is used for expression evaluation and must return + * the value of the function call based on the values defined for the + * expression (it receives the values as a first argument and the function + * arguments as remaining arguments). + * + * @author Fabien Potencier + */ +class ExpressionFunction +{ + private $name; + private $compiler; + private $evaluator; + + /** + * @param string $name The function name + * @param callable $compiler A callable able to compile the function + * @param callable $evaluator A callable able to evaluate the function + */ + public function __construct($name, $compiler, $evaluator) + { + $this->name = $name; + $this->compiler = $compiler; + $this->evaluator = $evaluator; + } + + public function getName() + { + return $this->name; + } + + public function getCompiler() + { + return $this->compiler; + } + + public function getEvaluator() + { + return $this->evaluator; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/ExpressionFunctionProviderInterface.php b/phpMyAdmin/vendor/symfony/expression-language/ExpressionFunctionProviderInterface.php new file mode 100755 index 0000000..414b013 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/ExpressionFunctionProviderInterface.php @@ -0,0 +1,23 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * @author Fabien Potencier + */ +interface ExpressionFunctionProviderInterface +{ + /** + * @return ExpressionFunction[] An array of Function instances + */ + public function getFunctions(); +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/ExpressionLanguage.php b/phpMyAdmin/vendor/symfony/expression-language/ExpressionLanguage.php new file mode 100755 index 0000000..e2b93b9 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/ExpressionLanguage.php @@ -0,0 +1,170 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +use Symfony\Component\ExpressionLanguage\ParserCache\ArrayParserCache; +use Symfony\Component\ExpressionLanguage\ParserCache\ParserCacheInterface; + +/** + * Allows to compile and evaluate expressions written in your own DSL. + * + * @author Fabien Potencier + */ +class ExpressionLanguage +{ + private $cache; + private $lexer; + private $parser; + private $compiler; + + protected $functions = array(); + + /** + * @param ParserCacheInterface $cache + * @param ExpressionFunctionProviderInterface[] $providers + */ + public function __construct(ParserCacheInterface $cache = null, array $providers = array()) + { + $this->cache = $cache ?: new ArrayParserCache(); + $this->registerFunctions(); + foreach ($providers as $provider) { + $this->registerProvider($provider); + } + } + + /** + * Compiles an expression source code. + * + * @param Expression|string $expression The expression to compile + * @param array $names An array of valid names + * + * @return string The compiled PHP source code + */ + public function compile($expression, $names = array()) + { + return $this->getCompiler()->compile($this->parse($expression, $names)->getNodes())->getSource(); + } + + /** + * Evaluate an expression. + * + * @param Expression|string $expression The expression to compile + * @param array $values An array of values + * + * @return mixed The result of the evaluation of the expression + */ + public function evaluate($expression, $values = array()) + { + return $this->parse($expression, array_keys($values))->getNodes()->evaluate($this->functions, $values); + } + + /** + * Parses an expression. + * + * @param Expression|string $expression The expression to parse + * @param array $names An array of valid names + * + * @return ParsedExpression A ParsedExpression instance + */ + public function parse($expression, $names) + { + if ($expression instanceof ParsedExpression) { + return $expression; + } + + asort($names); + $cacheKeyItems = array(); + + foreach ($names as $nameKey => $name) { + $cacheKeyItems[] = \is_int($nameKey) ? $name : $nameKey.':'.$name; + } + + $key = $expression.'//'.implode('|', $cacheKeyItems); + + if (null === $parsedExpression = $this->cache->fetch($key)) { + $nodes = $this->getParser()->parse($this->getLexer()->tokenize((string) $expression), $names); + $parsedExpression = new ParsedExpression((string) $expression, $nodes); + + $this->cache->save($key, $parsedExpression); + } + + return $parsedExpression; + } + + /** + * Registers a function. + * + * @param string $name The function name + * @param callable $compiler A callable able to compile the function + * @param callable $evaluator A callable able to evaluate the function + * + * @throws \LogicException when registering a function after calling evaluate(), compile() or parse() + * + * @see ExpressionFunction + */ + public function register($name, $compiler, $evaluator) + { + if (null !== $this->parser) { + throw new \LogicException('Registering functions after calling evaluate(), compile() or parse() is not supported.'); + } + + $this->functions[$name] = array('compiler' => $compiler, 'evaluator' => $evaluator); + } + + public function addFunction(ExpressionFunction $function) + { + $this->register($function->getName(), $function->getCompiler(), $function->getEvaluator()); + } + + public function registerProvider(ExpressionFunctionProviderInterface $provider) + { + foreach ($provider->getFunctions() as $function) { + $this->addFunction($function); + } + } + + protected function registerFunctions() + { + $this->register('constant', function ($constant) { + return sprintf('constant(%s)', $constant); + }, function (array $values, $constant) { + return \constant($constant); + }); + } + + private function getLexer() + { + if (null === $this->lexer) { + $this->lexer = new Lexer(); + } + + return $this->lexer; + } + + private function getParser() + { + if (null === $this->parser) { + $this->parser = new Parser($this->functions); + } + + return $this->parser; + } + + private function getCompiler() + { + if (null === $this->compiler) { + $this->compiler = new Compiler($this->functions); + } + + return $this->compiler->reset(); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/LICENSE b/phpMyAdmin/vendor/symfony/expression-language/LICENSE new file mode 100755 index 0000000..21d7fb9 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2004-2018 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/phpMyAdmin/vendor/symfony/expression-language/Lexer.php b/phpMyAdmin/vendor/symfony/expression-language/Lexer.php new file mode 100755 index 0000000..bd54e89 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Lexer.php @@ -0,0 +1,103 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * Lexes an expression. + * + * @author Fabien Potencier + */ +class Lexer +{ + /** + * Tokenizes an expression. + * + * @param string $expression The expression to tokenize + * + * @return TokenStream A token stream instance + * + * @throws SyntaxError + */ + public function tokenize($expression) + { + $expression = str_replace(array("\r", "\n", "\t", "\v", "\f"), ' ', $expression); + $cursor = 0; + $tokens = array(); + $brackets = array(); + $end = \strlen($expression); + + while ($cursor < $end) { + if (' ' == $expression[$cursor]) { + ++$cursor; + + continue; + } + + if (preg_match('/[0-9]+(?:\.[0-9]+)?/A', $expression, $match, 0, $cursor)) { + // numbers + $number = (float) $match[0]; // floats + if (preg_match('/^[0-9]+$/', $match[0]) && $number <= PHP_INT_MAX) { + $number = (int) $match[0]; // integers lower than the maximum + } + $tokens[] = new Token(Token::NUMBER_TYPE, $number, $cursor + 1); + $cursor += \strlen($match[0]); + } elseif (false !== strpos('([{', $expression[$cursor])) { + // opening bracket + $brackets[] = array($expression[$cursor], $cursor); + + $tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1); + ++$cursor; + } elseif (false !== strpos(')]}', $expression[$cursor])) { + // closing bracket + if (empty($brackets)) { + throw new SyntaxError(sprintf('Unexpected "%s"', $expression[$cursor]), $cursor, $expression); + } + + list($expect, $cur) = array_pop($brackets); + if ($expression[$cursor] != strtr($expect, '([{', ')]}')) { + throw new SyntaxError(sprintf('Unclosed "%s"', $expect), $cur, $expression); + } + + $tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1); + ++$cursor; + } elseif (preg_match('/"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As', $expression, $match, 0, $cursor)) { + // strings + $tokens[] = new Token(Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1)), $cursor + 1); + $cursor += \strlen($match[0]); + } elseif (preg_match('/not in(?=[\s(])|\!\=\=|not(?=[\s(])|and(?=[\s(])|\=\=\=|\>\=|or(?=[\s(])|\<\=|\*\*|\.\.|in(?=[\s(])|&&|\|\||matches|\=\=|\!\=|\*|~|%|\/|\>|\||\!|\^|&|\+|\<|\-/A', $expression, $match, 0, $cursor)) { + // operators + $tokens[] = new Token(Token::OPERATOR_TYPE, $match[0], $cursor + 1); + $cursor += \strlen($match[0]); + } elseif (false !== strpos('.,?:', $expression[$cursor])) { + // punctuation + $tokens[] = new Token(Token::PUNCTUATION_TYPE, $expression[$cursor], $cursor + 1); + ++$cursor; + } elseif (preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A', $expression, $match, 0, $cursor)) { + // names + $tokens[] = new Token(Token::NAME_TYPE, $match[0], $cursor + 1); + $cursor += \strlen($match[0]); + } else { + // unlexable + throw new SyntaxError(sprintf('Unexpected character "%s"', $expression[$cursor]), $cursor, $expression); + } + } + + $tokens[] = new Token(Token::EOF_TYPE, null, $cursor + 1); + + if (!empty($brackets)) { + list($expect, $cur) = array_pop($brackets); + throw new SyntaxError(sprintf('Unclosed "%s"', $expect), $cur, $expression); + } + + return new TokenStream($tokens, $expression); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/ArgumentsNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/ArgumentsNode.php new file mode 100755 index 0000000..d970579 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/ArgumentsNode.php @@ -0,0 +1,27 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class ArgumentsNode extends ArrayNode +{ + public function compile(Compiler $compiler) + { + $this->compileArguments($compiler, false); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/ArrayNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/ArrayNode.php new file mode 100755 index 0000000..08e2a56 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/ArrayNode.php @@ -0,0 +1,88 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class ArrayNode extends Node +{ + protected $index; + + public function __construct() + { + $this->index = -1; + } + + public function addElement(Node $value, Node $key = null) + { + if (null === $key) { + $key = new ConstantNode(++$this->index); + } + + array_push($this->nodes, $key, $value); + } + + /** + * Compiles the node to PHP. + */ + public function compile(Compiler $compiler) + { + $compiler->raw('array('); + $this->compileArguments($compiler); + $compiler->raw(')'); + } + + public function evaluate($functions, $values) + { + $result = array(); + foreach ($this->getKeyValuePairs() as $pair) { + $result[$pair['key']->evaluate($functions, $values)] = $pair['value']->evaluate($functions, $values); + } + + return $result; + } + + protected function getKeyValuePairs() + { + $pairs = array(); + foreach (array_chunk($this->nodes, 2) as $pair) { + $pairs[] = array('key' => $pair[0], 'value' => $pair[1]); + } + + return $pairs; + } + + protected function compileArguments(Compiler $compiler, $withKeys = true) + { + $first = true; + foreach ($this->getKeyValuePairs() as $pair) { + if (!$first) { + $compiler->raw(', '); + } + $first = false; + + if ($withKeys) { + $compiler + ->compile($pair['key']) + ->raw(' => ') + ; + } + + $compiler->compile($pair['value']); + } + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/BinaryNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/BinaryNode.php new file mode 100755 index 0000000..2067d70 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/BinaryNode.php @@ -0,0 +1,157 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class BinaryNode extends Node +{ + private static $operators = array( + '~' => '.', + 'and' => '&&', + 'or' => '||', + ); + + private static $functions = array( + '**' => 'pow', + '..' => 'range', + 'in' => 'in_array', + 'not in' => '!in_array', + ); + + public function __construct($operator, Node $left, Node $right) + { + parent::__construct( + array('left' => $left, 'right' => $right), + array('operator' => $operator) + ); + } + + public function compile(Compiler $compiler) + { + $operator = $this->attributes['operator']; + + if ('matches' == $operator) { + $compiler + ->raw('preg_match(') + ->compile($this->nodes['right']) + ->raw(', ') + ->compile($this->nodes['left']) + ->raw(')') + ; + + return; + } + + if (isset(self::$functions[$operator])) { + $compiler + ->raw(sprintf('%s(', self::$functions[$operator])) + ->compile($this->nodes['left']) + ->raw(', ') + ->compile($this->nodes['right']) + ->raw(')') + ; + + return; + } + + if (isset(self::$operators[$operator])) { + $operator = self::$operators[$operator]; + } + + $compiler + ->raw('(') + ->compile($this->nodes['left']) + ->raw(' ') + ->raw($operator) + ->raw(' ') + ->compile($this->nodes['right']) + ->raw(')') + ; + } + + public function evaluate($functions, $values) + { + $operator = $this->attributes['operator']; + $left = $this->nodes['left']->evaluate($functions, $values); + + if (isset(self::$functions[$operator])) { + $right = $this->nodes['right']->evaluate($functions, $values); + + if ('not in' === $operator) { + return !\in_array($left, $right); + } + $f = self::$functions[$operator]; + + return $f($left, $right); + } + + switch ($operator) { + case 'or': + case '||': + return $left || $this->nodes['right']->evaluate($functions, $values); + case 'and': + case '&&': + return $left && $this->nodes['right']->evaluate($functions, $values); + } + + $right = $this->nodes['right']->evaluate($functions, $values); + + switch ($operator) { + case '|': + return $left | $right; + case '^': + return $left ^ $right; + case '&': + return $left & $right; + case '==': + return $left == $right; + case '===': + return $left === $right; + case '!=': + return $left != $right; + case '!==': + return $left !== $right; + case '<': + return $left < $right; + case '>': + return $left > $right; + case '>=': + return $left >= $right; + case '<=': + return $left <= $right; + case 'not in': + return !\in_array($left, $right); + case 'in': + return \in_array($left, $right); + case '+': + return $left + $right; + case '-': + return $left - $right; + case '~': + return $left.$right; + case '*': + return $left * $right; + case '/': + return $left / $right; + case '%': + return $left % $right; + case 'matches': + return preg_match($right, $left); + } + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/ConditionalNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/ConditionalNode.php new file mode 100755 index 0000000..5d326fa --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/ConditionalNode.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class ConditionalNode extends Node +{ + public function __construct(Node $expr1, Node $expr2, Node $expr3) + { + parent::__construct( + array('expr1' => $expr1, 'expr2' => $expr2, 'expr3' => $expr3) + ); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('((') + ->compile($this->nodes['expr1']) + ->raw(') ? (') + ->compile($this->nodes['expr2']) + ->raw(') : (') + ->compile($this->nodes['expr3']) + ->raw('))') + ; + } + + public function evaluate($functions, $values) + { + if ($this->nodes['expr1']->evaluate($functions, $values)) { + return $this->nodes['expr2']->evaluate($functions, $values); + } + + return $this->nodes['expr3']->evaluate($functions, $values); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/ConstantNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/ConstantNode.php new file mode 100755 index 0000000..9369d85 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/ConstantNode.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class ConstantNode extends Node +{ + public function __construct($value) + { + parent::__construct( + array(), + array('value' => $value) + ); + } + + public function compile(Compiler $compiler) + { + $compiler->repr($this->attributes['value']); + } + + public function evaluate($functions, $values) + { + return $this->attributes['value']; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/FunctionNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/FunctionNode.php new file mode 100755 index 0000000..41efdf0 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/FunctionNode.php @@ -0,0 +1,52 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class FunctionNode extends Node +{ + public function __construct($name, Node $arguments) + { + parent::__construct( + array('arguments' => $arguments), + array('name' => $name) + ); + } + + public function compile(Compiler $compiler) + { + $arguments = array(); + foreach ($this->nodes['arguments']->nodes as $node) { + $arguments[] = $compiler->subcompile($node); + } + + $function = $compiler->getFunction($this->attributes['name']); + + $compiler->raw(\call_user_func_array($function['compiler'], $arguments)); + } + + public function evaluate($functions, $values) + { + $arguments = array($values); + foreach ($this->nodes['arguments']->nodes as $node) { + $arguments[] = $node->evaluate($functions, $values); + } + + return \call_user_func_array($functions[$this->attributes['name']]['evaluator'], $arguments); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/GetAttrNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/GetAttrNode.php new file mode 100755 index 0000000..be9f234 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/GetAttrNode.php @@ -0,0 +1,100 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class GetAttrNode extends Node +{ + const PROPERTY_CALL = 1; + const METHOD_CALL = 2; + const ARRAY_CALL = 3; + + public function __construct(Node $node, Node $attribute, ArrayNode $arguments, $type) + { + parent::__construct( + array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), + array('type' => $type) + ); + } + + public function compile(Compiler $compiler) + { + switch ($this->attributes['type']) { + case self::PROPERTY_CALL: + $compiler + ->compile($this->nodes['node']) + ->raw('->') + ->raw($this->nodes['attribute']->attributes['value']) + ; + break; + + case self::METHOD_CALL: + $compiler + ->compile($this->nodes['node']) + ->raw('->') + ->raw($this->nodes['attribute']->attributes['value']) + ->raw('(') + ->compile($this->nodes['arguments']) + ->raw(')') + ; + break; + + case self::ARRAY_CALL: + $compiler + ->compile($this->nodes['node']) + ->raw('[') + ->compile($this->nodes['attribute'])->raw(']') + ; + break; + } + } + + public function evaluate($functions, $values) + { + switch ($this->attributes['type']) { + case self::PROPERTY_CALL: + $obj = $this->nodes['node']->evaluate($functions, $values); + if (!\is_object($obj)) { + throw new \RuntimeException('Unable to get a property on a non-object.'); + } + + $property = $this->nodes['attribute']->attributes['value']; + + return $obj->$property; + + case self::METHOD_CALL: + $obj = $this->nodes['node']->evaluate($functions, $values); + if (!\is_object($obj)) { + throw new \RuntimeException('Unable to get a property on a non-object.'); + } + if (!\is_callable($toCall = array($obj, $this->nodes['attribute']->attributes['value']))) { + throw new \RuntimeException(sprintf('Unable to call method "%s" of object "%s".', $this->nodes['attribute']->attributes['value'], \get_class($obj))); + } + + return \call_user_func_array($toCall, $this->nodes['arguments']->evaluate($functions, $values)); + + case self::ARRAY_CALL: + $array = $this->nodes['node']->evaluate($functions, $values); + if (!\is_array($array) && !$array instanceof \ArrayAccess) { + throw new \RuntimeException('Unable to get an item on a non-array.'); + } + + return $array[$this->nodes['attribute']->evaluate($functions, $values)]; + } + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/NameNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/NameNode.php new file mode 100755 index 0000000..30336ba --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/NameNode.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class NameNode extends Node +{ + public function __construct($name) + { + parent::__construct( + array(), + array('name' => $name) + ); + } + + public function compile(Compiler $compiler) + { + $compiler->raw('$'.$this->attributes['name']); + } + + public function evaluate($functions, $values) + { + return $values[$this->attributes['name']]; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/Node.php b/phpMyAdmin/vendor/symfony/expression-language/Node/Node.php new file mode 100755 index 0000000..f50487c --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/Node.php @@ -0,0 +1,76 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * Represents a node in the AST. + * + * @author Fabien Potencier + */ +class Node +{ + public $nodes = array(); + public $attributes = array(); + + /** + * @param array $nodes An array of nodes + * @param array $attributes An array of attributes + */ + public function __construct(array $nodes = array(), array $attributes = array()) + { + $this->nodes = $nodes; + $this->attributes = $attributes; + } + + public function __toString() + { + $attributes = array(); + foreach ($this->attributes as $name => $value) { + $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true))); + } + + $repr = array(str_replace('Symfony\Component\ExpressionLanguage\Node\\', '', \get_class($this)).'('.implode(', ', $attributes)); + + if (\count($this->nodes)) { + foreach ($this->nodes as $node) { + foreach (explode("\n", (string) $node) as $line) { + $repr[] = ' '.$line; + } + } + + $repr[] = ')'; + } else { + $repr[0] .= ')'; + } + + return implode("\n", $repr); + } + + public function compile(Compiler $compiler) + { + foreach ($this->nodes as $node) { + $node->compile($compiler); + } + } + + public function evaluate($functions, $values) + { + $results = array(); + foreach ($this->nodes as $node) { + $results[] = $node->evaluate($functions, $values); + } + + return $results; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Node/UnaryNode.php b/phpMyAdmin/vendor/symfony/expression-language/Node/UnaryNode.php new file mode 100755 index 0000000..68fec55 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Node/UnaryNode.php @@ -0,0 +1,61 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\Node; + +use Symfony\Component\ExpressionLanguage\Compiler; + +/** + * @author Fabien Potencier + * + * @internal + */ +class UnaryNode extends Node +{ + private static $operators = array( + '!' => '!', + 'not' => '!', + '+' => '+', + '-' => '-', + ); + + public function __construct($operator, Node $node) + { + parent::__construct( + array('node' => $node), + array('operator' => $operator) + ); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('(') + ->raw(self::$operators[$this->attributes['operator']]) + ->compile($this->nodes['node']) + ->raw(')') + ; + } + + public function evaluate($functions, $values) + { + $value = $this->nodes['node']->evaluate($functions, $values); + switch ($this->attributes['operator']) { + case 'not': + case '!': + return !$value; + case '-': + return -$value; + } + + return $value; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/ParsedExpression.php b/phpMyAdmin/vendor/symfony/expression-language/ParsedExpression.php new file mode 100755 index 0000000..a5603fc --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/ParsedExpression.php @@ -0,0 +1,40 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +use Symfony\Component\ExpressionLanguage\Node\Node; + +/** + * Represents an already parsed expression. + * + * @author Fabien Potencier + */ +class ParsedExpression extends Expression +{ + private $nodes; + + /** + * @param string $expression An expression + * @param Node $nodes A Node representing the expression + */ + public function __construct($expression, Node $nodes) + { + parent::__construct($expression); + + $this->nodes = $nodes; + } + + public function getNodes() + { + return $this->nodes; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Parser.php b/phpMyAdmin/vendor/symfony/expression-language/Parser.php new file mode 100755 index 0000000..bebfc5b --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Parser.php @@ -0,0 +1,384 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * Parsers a token stream. + * + * This parser implements a "Precedence climbing" algorithm. + * + * @see http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm + * @see http://en.wikipedia.org/wiki/Operator-precedence_parser + * + * @author Fabien Potencier + */ +class Parser +{ + const OPERATOR_LEFT = 1; + const OPERATOR_RIGHT = 2; + + private $stream; + private $unaryOperators; + private $binaryOperators; + private $functions; + private $names; + + public function __construct(array $functions) + { + $this->functions = $functions; + + $this->unaryOperators = array( + 'not' => array('precedence' => 50), + '!' => array('precedence' => 50), + '-' => array('precedence' => 500), + '+' => array('precedence' => 500), + ); + $this->binaryOperators = array( + 'or' => array('precedence' => 10, 'associativity' => self::OPERATOR_LEFT), + '||' => array('precedence' => 10, 'associativity' => self::OPERATOR_LEFT), + 'and' => array('precedence' => 15, 'associativity' => self::OPERATOR_LEFT), + '&&' => array('precedence' => 15, 'associativity' => self::OPERATOR_LEFT), + '|' => array('precedence' => 16, 'associativity' => self::OPERATOR_LEFT), + '^' => array('precedence' => 17, 'associativity' => self::OPERATOR_LEFT), + '&' => array('precedence' => 18, 'associativity' => self::OPERATOR_LEFT), + '==' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + '===' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + '!=' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + '!==' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + '<' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + '>' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + '>=' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + '<=' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + 'not in' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + 'in' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + 'matches' => array('precedence' => 20, 'associativity' => self::OPERATOR_LEFT), + '..' => array('precedence' => 25, 'associativity' => self::OPERATOR_LEFT), + '+' => array('precedence' => 30, 'associativity' => self::OPERATOR_LEFT), + '-' => array('precedence' => 30, 'associativity' => self::OPERATOR_LEFT), + '~' => array('precedence' => 40, 'associativity' => self::OPERATOR_LEFT), + '*' => array('precedence' => 60, 'associativity' => self::OPERATOR_LEFT), + '/' => array('precedence' => 60, 'associativity' => self::OPERATOR_LEFT), + '%' => array('precedence' => 60, 'associativity' => self::OPERATOR_LEFT), + '**' => array('precedence' => 200, 'associativity' => self::OPERATOR_RIGHT), + ); + } + + /** + * Converts a token stream to a node tree. + * + * The valid names is an array where the values + * are the names that the user can use in an expression. + * + * If the variable name in the compiled PHP code must be + * different, define it as the key. + * + * For instance, ['this' => 'container'] means that the + * variable 'container' can be used in the expression + * but the compiled code will use 'this'. + * + * @param TokenStream $stream A token stream instance + * @param array $names An array of valid names + * + * @return Node\Node A node tree + * + * @throws SyntaxError + */ + public function parse(TokenStream $stream, $names = array()) + { + $this->stream = $stream; + $this->names = $names; + + $node = $this->parseExpression(); + if (!$stream->isEOF()) { + throw new SyntaxError(sprintf('Unexpected token "%s" of value "%s"', $stream->current->type, $stream->current->value), $stream->current->cursor, $stream->getExpression()); + } + + return $node; + } + + public function parseExpression($precedence = 0) + { + $expr = $this->getPrimary(); + $token = $this->stream->current; + while ($token->test(Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->value]) && $this->binaryOperators[$token->value]['precedence'] >= $precedence) { + $op = $this->binaryOperators[$token->value]; + $this->stream->next(); + + $expr1 = $this->parseExpression(self::OPERATOR_LEFT === $op['associativity'] ? $op['precedence'] + 1 : $op['precedence']); + $expr = new Node\BinaryNode($token->value, $expr, $expr1); + + $token = $this->stream->current; + } + + if (0 === $precedence) { + return $this->parseConditionalExpression($expr); + } + + return $expr; + } + + protected function getPrimary() + { + $token = $this->stream->current; + + if ($token->test(Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->value])) { + $operator = $this->unaryOperators[$token->value]; + $this->stream->next(); + $expr = $this->parseExpression($operator['precedence']); + + return $this->parsePostfixExpression(new Node\UnaryNode($token->value, $expr)); + } + + if ($token->test(Token::PUNCTUATION_TYPE, '(')) { + $this->stream->next(); + $expr = $this->parseExpression(); + $this->stream->expect(Token::PUNCTUATION_TYPE, ')', 'An opened parenthesis is not properly closed'); + + return $this->parsePostfixExpression($expr); + } + + return $this->parsePrimaryExpression(); + } + + protected function parseConditionalExpression($expr) + { + while ($this->stream->current->test(Token::PUNCTUATION_TYPE, '?')) { + $this->stream->next(); + if (!$this->stream->current->test(Token::PUNCTUATION_TYPE, ':')) { + $expr2 = $this->parseExpression(); + if ($this->stream->current->test(Token::PUNCTUATION_TYPE, ':')) { + $this->stream->next(); + $expr3 = $this->parseExpression(); + } else { + $expr3 = new Node\ConstantNode(null); + } + } else { + $this->stream->next(); + $expr2 = $expr; + $expr3 = $this->parseExpression(); + } + + $expr = new Node\ConditionalNode($expr, $expr2, $expr3); + } + + return $expr; + } + + public function parsePrimaryExpression() + { + $token = $this->stream->current; + switch ($token->type) { + case Token::NAME_TYPE: + $this->stream->next(); + switch ($token->value) { + case 'true': + case 'TRUE': + return new Node\ConstantNode(true); + + case 'false': + case 'FALSE': + return new Node\ConstantNode(false); + + case 'null': + case 'NULL': + return new Node\ConstantNode(null); + + default: + if ('(' === $this->stream->current->value) { + if (false === isset($this->functions[$token->value])) { + throw new SyntaxError(sprintf('The function "%s" does not exist', $token->value), $token->cursor, $this->stream->getExpression()); + } + + $node = new Node\FunctionNode($token->value, $this->parseArguments()); + } else { + if (!\in_array($token->value, $this->names, true)) { + throw new SyntaxError(sprintf('Variable "%s" is not valid', $token->value), $token->cursor, $this->stream->getExpression()); + } + + // is the name used in the compiled code different + // from the name used in the expression? + if (\is_int($name = array_search($token->value, $this->names))) { + $name = $token->value; + } + + $node = new Node\NameNode($name); + } + } + break; + + case Token::NUMBER_TYPE: + case Token::STRING_TYPE: + $this->stream->next(); + + return new Node\ConstantNode($token->value); + + default: + if ($token->test(Token::PUNCTUATION_TYPE, '[')) { + $node = $this->parseArrayExpression(); + } elseif ($token->test(Token::PUNCTUATION_TYPE, '{')) { + $node = $this->parseHashExpression(); + } else { + throw new SyntaxError(sprintf('Unexpected token "%s" of value "%s"', $token->type, $token->value), $token->cursor, $this->stream->getExpression()); + } + } + + return $this->parsePostfixExpression($node); + } + + public function parseArrayExpression() + { + $this->stream->expect(Token::PUNCTUATION_TYPE, '[', 'An array element was expected'); + + $node = new Node\ArrayNode(); + $first = true; + while (!$this->stream->current->test(Token::PUNCTUATION_TYPE, ']')) { + if (!$first) { + $this->stream->expect(Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma'); + + // trailing ,? + if ($this->stream->current->test(Token::PUNCTUATION_TYPE, ']')) { + break; + } + } + $first = false; + + $node->addElement($this->parseExpression()); + } + $this->stream->expect(Token::PUNCTUATION_TYPE, ']', 'An opened array is not properly closed'); + + return $node; + } + + public function parseHashExpression() + { + $this->stream->expect(Token::PUNCTUATION_TYPE, '{', 'A hash element was expected'); + + $node = new Node\ArrayNode(); + $first = true; + while (!$this->stream->current->test(Token::PUNCTUATION_TYPE, '}')) { + if (!$first) { + $this->stream->expect(Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma'); + + // trailing ,? + if ($this->stream->current->test(Token::PUNCTUATION_TYPE, '}')) { + break; + } + } + $first = false; + + // a hash key can be: + // + // * a number -- 12 + // * a string -- 'a' + // * a name, which is equivalent to a string -- a + // * an expression, which must be enclosed in parentheses -- (1 + 2) + if ($this->stream->current->test(Token::STRING_TYPE) || $this->stream->current->test(Token::NAME_TYPE) || $this->stream->current->test(Token::NUMBER_TYPE)) { + $key = new Node\ConstantNode($this->stream->current->value); + $this->stream->next(); + } elseif ($this->stream->current->test(Token::PUNCTUATION_TYPE, '(')) { + $key = $this->parseExpression(); + } else { + $current = $this->stream->current; + + throw new SyntaxError(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s"', $current->type, $current->value), $current->cursor, $this->stream->getExpression()); + } + + $this->stream->expect(Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)'); + $value = $this->parseExpression(); + + $node->addElement($value, $key); + } + $this->stream->expect(Token::PUNCTUATION_TYPE, '}', 'An opened hash is not properly closed'); + + return $node; + } + + public function parsePostfixExpression($node) + { + $token = $this->stream->current; + while (Token::PUNCTUATION_TYPE == $token->type) { + if ('.' === $token->value) { + $this->stream->next(); + $token = $this->stream->current; + $this->stream->next(); + + if ( + Token::NAME_TYPE !== $token->type + && + // Operators like "not" and "matches" are valid method or property names, + // + // In other words, besides NAME_TYPE, OPERATOR_TYPE could also be parsed as a property or method. + // This is because operators are processed by the lexer prior to names. So "not" in "foo.not()" or "matches" in "foo.matches" will be recognized as an operator first. + // But in fact, "not" and "matches" in such expressions shall be parsed as method or property names. + // + // And this ONLY works if the operator consists of valid characters for a property or method name. + // + // Other types, such as STRING_TYPE and NUMBER_TYPE, can't be parsed as property nor method names. + // + // As a result, if $token is NOT an operator OR $token->value is NOT a valid property or method name, an exception shall be thrown. + (Token::OPERATOR_TYPE !== $token->type || !preg_match('/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A', $token->value)) + ) { + throw new SyntaxError('Expected name', $token->cursor, $this->stream->getExpression()); + } + + $arg = new Node\ConstantNode($token->value); + + $arguments = new Node\ArgumentsNode(); + if ($this->stream->current->test(Token::PUNCTUATION_TYPE, '(')) { + $type = Node\GetAttrNode::METHOD_CALL; + foreach ($this->parseArguments()->nodes as $n) { + $arguments->addElement($n); + } + } else { + $type = Node\GetAttrNode::PROPERTY_CALL; + } + + $node = new Node\GetAttrNode($node, $arg, $arguments, $type); + } elseif ('[' === $token->value) { + if ($node instanceof Node\GetAttrNode && Node\GetAttrNode::METHOD_CALL === $node->attributes['type'] && \PHP_VERSION_ID < 50400) { + throw new SyntaxError('Array calls on a method call is only supported on PHP 5.4+', $token->cursor, $this->stream->getExpression()); + } + + $this->stream->next(); + $arg = $this->parseExpression(); + $this->stream->expect(Token::PUNCTUATION_TYPE, ']'); + + $node = new Node\GetAttrNode($node, $arg, new Node\ArgumentsNode(), Node\GetAttrNode::ARRAY_CALL); + } else { + break; + } + + $token = $this->stream->current; + } + + return $node; + } + + /** + * Parses arguments. + */ + public function parseArguments() + { + $args = array(); + $this->stream->expect(Token::PUNCTUATION_TYPE, '(', 'A list of arguments must begin with an opening parenthesis'); + while (!$this->stream->current->test(Token::PUNCTUATION_TYPE, ')')) { + if (!empty($args)) { + $this->stream->expect(Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma'); + } + + $args[] = $this->parseExpression(); + } + $this->stream->expect(Token::PUNCTUATION_TYPE, ')', 'A list of arguments must be closed by a parenthesis'); + + return new Node\Node($args); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/ParserCache/ArrayParserCache.php b/phpMyAdmin/vendor/symfony/expression-language/ParserCache/ArrayParserCache.php new file mode 100755 index 0000000..405a060 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/ParserCache/ArrayParserCache.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\ParserCache; + +use Symfony\Component\ExpressionLanguage\ParsedExpression; + +/** + * @author Adrien Brault + */ +class ArrayParserCache implements ParserCacheInterface +{ + private $cache = array(); + + /** + * {@inheritdoc} + */ + public function fetch($key) + { + return isset($this->cache[$key]) ? $this->cache[$key] : null; + } + + /** + * {@inheritdoc} + */ + public function save($key, ParsedExpression $expression) + { + $this->cache[$key] = $expression; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/ParserCache/ParserCacheInterface.php b/phpMyAdmin/vendor/symfony/expression-language/ParserCache/ParserCacheInterface.php new file mode 100755 index 0000000..4b7a4b6 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/ParserCache/ParserCacheInterface.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage\ParserCache; + +use Symfony\Component\ExpressionLanguage\ParsedExpression; + +/** + * @author Adrien Brault + */ +interface ParserCacheInterface +{ + /** + * Saves an expression in the cache. + * + * @param string $key The cache key + * @param ParsedExpression $expression A ParsedExpression instance to store in the cache + */ + public function save($key, ParsedExpression $expression); + + /** + * Fetches an expression from the cache. + * + * @param string $key The cache key + * + * @return ParsedExpression|null + */ + public function fetch($key); +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/README.md b/phpMyAdmin/vendor/symfony/expression-language/README.md new file mode 100755 index 0000000..08b310d --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/README.md @@ -0,0 +1,15 @@ +ExpressionLanguage Component +============================ + +The ExpressionLanguage component provides an engine that can compile and +evaluate expressions. An expression is a one-liner that returns a value +(mostly, but not limited to, Booleans). + +Resources +--------- + + * [Documentation](https://symfony.com/doc/current/components/expression_language/introduction.html) + * [Contributing](https://symfony.com/doc/current/contributing/index.html) + * [Report issues](https://github.com/symfony/symfony/issues) and + [send Pull Requests](https://github.com/symfony/symfony/pulls) + in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/phpMyAdmin/vendor/symfony/expression-language/SerializedParsedExpression.php b/phpMyAdmin/vendor/symfony/expression-language/SerializedParsedExpression.php new file mode 100755 index 0000000..dd763f7 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/SerializedParsedExpression.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * Represents an already parsed expression. + * + * @author Fabien Potencier + */ +class SerializedParsedExpression extends ParsedExpression +{ + private $nodes; + + /** + * @param string $expression An expression + * @param string $nodes The serialized nodes for the expression + */ + public function __construct($expression, $nodes) + { + $this->expression = (string) $expression; + $this->nodes = $nodes; + } + + public function getNodes() + { + return unserialize($this->nodes); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/SyntaxError.php b/phpMyAdmin/vendor/symfony/expression-language/SyntaxError.php new file mode 100755 index 0000000..9373e99 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/SyntaxError.php @@ -0,0 +1,26 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +class SyntaxError extends \LogicException +{ + public function __construct($message, $cursor = 0, $expression = '') + { + $message = sprintf('%s around position %d', $message, $cursor); + if ($expression) { + $message = sprintf('%s for expression `%s`', $message, $expression); + } + $message .= '.'; + + parent::__construct($message); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/Token.php b/phpMyAdmin/vendor/symfony/expression-language/Token.php new file mode 100755 index 0000000..4517335 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/Token.php @@ -0,0 +1,66 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * Represents a Token. + * + * @author Fabien Potencier + */ +class Token +{ + public $value; + public $type; + public $cursor; + + const EOF_TYPE = 'end of expression'; + const NAME_TYPE = 'name'; + const NUMBER_TYPE = 'number'; + const STRING_TYPE = 'string'; + const OPERATOR_TYPE = 'operator'; + const PUNCTUATION_TYPE = 'punctuation'; + + /** + * @param string $type The type of the token (self::*_TYPE) + * @param string|int|float|null $value The token value + * @param int $cursor The cursor position in the source + */ + public function __construct($type, $value, $cursor) + { + $this->type = $type; + $this->value = $value; + $this->cursor = $cursor; + } + + /** + * Returns a string representation of the token. + * + * @return string A string representation of the token + */ + public function __toString() + { + return sprintf('%3d %-11s %s', $this->cursor, strtoupper($this->type), $this->value); + } + + /** + * Tests the current token for a type and/or a value. + * + * @param array|int $type The type to test + * @param string|null $value The token value + * + * @return bool + */ + public function test($type, $value = null) + { + return $this->type === $type && (null === $value || $this->value == $value); + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/TokenStream.php b/phpMyAdmin/vendor/symfony/expression-language/TokenStream.php new file mode 100755 index 0000000..9096b18 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/TokenStream.php @@ -0,0 +1,97 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\ExpressionLanguage; + +/** + * Represents a token stream. + * + * @author Fabien Potencier + */ +class TokenStream +{ + public $current; + + private $tokens; + private $position = 0; + private $expression; + + /** + * @param array $tokens An array of tokens + * @param string $expression + */ + public function __construct(array $tokens, $expression = '') + { + $this->tokens = $tokens; + $this->current = $tokens[0]; + $this->expression = $expression; + } + + /** + * Returns a string representation of the token stream. + * + * @return string + */ + public function __toString() + { + return implode("\n", $this->tokens); + } + + /** + * Sets the pointer to the next token and returns the old one. + */ + public function next() + { + ++$this->position; + + if (!isset($this->tokens[$this->position])) { + throw new SyntaxError('Unexpected end of expression', $this->current->cursor, $this->expression); + } + + $this->current = $this->tokens[$this->position]; + } + + /** + * Tests a token. + * + * @param array|int $type The type to test + * @param string|null $value The token value + * @param string|null $message The syntax error message + */ + public function expect($type, $value = null, $message = null) + { + $token = $this->current; + if (!$token->test($type, $value)) { + throw new SyntaxError(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s)', $message ? $message.'. ' : '', $token->type, $token->value, $type, $value ? sprintf(' with value "%s"', $value) : ''), $token->cursor, $this->expression); + } + $this->next(); + } + + /** + * Checks if end of stream was reached. + * + * @return bool + */ + public function isEOF() + { + return Token::EOF_TYPE === $this->current->type; + } + + /** + * @internal + * + * @return string + */ + public function getExpression() + { + return $this->expression; + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/composer.json b/phpMyAdmin/vendor/symfony/expression-language/composer.json new file mode 100755 index 0000000..f0344e1 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/composer.json @@ -0,0 +1,33 @@ +{ + "name": "symfony/expression-language", + "type": "library", + "description": "Symfony ExpressionLanguage Component", + "keywords": [], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.9" + }, + "autoload": { + "psr-4": { "Symfony\\Component\\ExpressionLanguage\\": "" }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-master": "2.8-dev" + } + } +} diff --git a/phpMyAdmin/vendor/symfony/expression-language/phpunit.xml.dist b/phpMyAdmin/vendor/symfony/expression-language/phpunit.xml.dist new file mode 100755 index 0000000..ae84dcd --- /dev/null +++ b/phpMyAdmin/vendor/symfony/expression-language/phpunit.xml.dist @@ -0,0 +1,30 @@ + + + + + + + + + + ./Tests/ + + + + + + ./ + + ./Tests + ./vendor + + + + diff --git a/phpMyAdmin/vendor/symfony/polyfill-ctype/Ctype.php b/phpMyAdmin/vendor/symfony/polyfill-ctype/Ctype.php new file mode 100755 index 0000000..58414dc --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-ctype/Ctype.php @@ -0,0 +1,227 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Ctype; + +/** + * Ctype implementation through regex. + * + * @internal + * + * @author Gert de Pagter + */ +final class Ctype +{ + /** + * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. + * + * @see https://php.net/ctype-alnum + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_alnum($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); + } + + /** + * Returns TRUE if every character in text is a letter, FALSE otherwise. + * + * @see https://php.net/ctype-alpha + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_alpha($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); + } + + /** + * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. + * + * @see https://php.net/ctype-cntrl + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_cntrl($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); + } + + /** + * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. + * + * @see https://php.net/ctype-digit + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_digit($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); + } + + /** + * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. + * + * @see https://php.net/ctype-graph + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_graph($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); + } + + /** + * Returns TRUE if every character in text is a lowercase letter. + * + * @see https://php.net/ctype-lower + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_lower($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); + } + + /** + * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. + * + * @see https://php.net/ctype-print + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_print($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); + } + + /** + * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. + * + * @see https://php.net/ctype-punct + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_punct($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); + } + + /** + * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. + * + * @see https://php.net/ctype-space + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_space($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); + } + + /** + * Returns TRUE if every character in text is an uppercase letter. + * + * @see https://php.net/ctype-upper + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_upper($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); + } + + /** + * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. + * + * @see https://php.net/ctype-xdigit + * + * @param string|int $text + * + * @return bool + */ + public static function ctype_xdigit($text) + { + $text = self::convert_int_to_char_for_ctype($text); + + return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); + } + + /** + * Converts integers to their char versions according to normal ctype behaviour, if needed. + * + * If an integer between -128 and 255 inclusive is provided, + * it is interpreted as the ASCII value of a single character + * (negative values have 256 added in order to allow characters in the Extended ASCII range). + * Any other integer is interpreted as a string containing the decimal digits of the integer. + * + * @param string|int $int + * + * @return mixed + */ + private static function convert_int_to_char_for_ctype($int) + { + if (!\is_int($int)) { + return $int; + } + + if ($int < -128 || $int > 255) { + return (string) $int; + } + + if ($int < 0) { + $int += 256; + } + + return \chr($int); + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-ctype/LICENSE b/phpMyAdmin/vendor/symfony/polyfill-ctype/LICENSE new file mode 100755 index 0000000..3f853aa --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-ctype/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2018-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/phpMyAdmin/vendor/symfony/polyfill-ctype/README.md b/phpMyAdmin/vendor/symfony/polyfill-ctype/README.md new file mode 100755 index 0000000..8add1ab --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-ctype/README.md @@ -0,0 +1,12 @@ +Symfony Polyfill / Ctype +======================== + +This component provides `ctype_*` functions to users who run php versions without the ctype extension. + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/phpMyAdmin/vendor/symfony/polyfill-ctype/bootstrap.php b/phpMyAdmin/vendor/symfony/polyfill-ctype/bootstrap.php new file mode 100755 index 0000000..0bc45cf --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-ctype/bootstrap.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Ctype as p; + +if (!function_exists('ctype_alnum')) { + function ctype_alnum($input) { return p\Ctype::ctype_alnum($input); } +} +if (!function_exists('ctype_alpha')) { + function ctype_alpha($input) { return p\Ctype::ctype_alpha($input); } +} +if (!function_exists('ctype_cntrl')) { + function ctype_cntrl($input) { return p\Ctype::ctype_cntrl($input); } +} +if (!function_exists('ctype_digit')) { + function ctype_digit($input) { return p\Ctype::ctype_digit($input); } +} +if (!function_exists('ctype_graph')) { + function ctype_graph($input) { return p\Ctype::ctype_graph($input); } +} +if (!function_exists('ctype_lower')) { + function ctype_lower($input) { return p\Ctype::ctype_lower($input); } +} +if (!function_exists('ctype_print')) { + function ctype_print($input) { return p\Ctype::ctype_print($input); } +} +if (!function_exists('ctype_punct')) { + function ctype_punct($input) { return p\Ctype::ctype_punct($input); } +} +if (!function_exists('ctype_space')) { + function ctype_space($input) { return p\Ctype::ctype_space($input); } +} +if (!function_exists('ctype_upper')) { + function ctype_upper($input) { return p\Ctype::ctype_upper($input); } +} +if (!function_exists('ctype_xdigit')) { + function ctype_xdigit($input) { return p\Ctype::ctype_xdigit($input); } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-ctype/composer.json b/phpMyAdmin/vendor/symfony/polyfill-ctype/composer.json new file mode 100755 index 0000000..d7c9abb --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-ctype/composer.json @@ -0,0 +1,38 @@ +{ + "name": "symfony/polyfill-ctype", + "type": "library", + "description": "Symfony polyfill for ctype functions", + "keywords": ["polyfill", "compatibility", "portable", "ctype"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, + "files": [ "bootstrap.php" ] + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-mbstring/LICENSE b/phpMyAdmin/vendor/symfony/polyfill-mbstring/LICENSE new file mode 100755 index 0000000..4cd8bdd --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-mbstring/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/phpMyAdmin/vendor/symfony/polyfill-mbstring/Mbstring.php b/phpMyAdmin/vendor/symfony/polyfill-mbstring/Mbstring.php new file mode 100755 index 0000000..dc7801f --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-mbstring/Mbstring.php @@ -0,0 +1,848 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Mbstring; + +/** + * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. + * + * Implemented: + * - mb_chr - Returns a specific character from its Unicode code point + * - mb_convert_encoding - Convert character encoding + * - mb_convert_variables - Convert character code in variable(s) + * - mb_decode_mimeheader - Decode string in MIME header field + * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED + * - mb_decode_numericentity - Decode HTML numeric string reference to character + * - mb_encode_numericentity - Encode character to HTML numeric string reference + * - mb_convert_case - Perform case folding on a string + * - mb_detect_encoding - Detect character encoding + * - mb_get_info - Get internal settings of mbstring + * - mb_http_input - Detect HTTP input character encoding + * - mb_http_output - Set/Get HTTP output character encoding + * - mb_internal_encoding - Set/Get internal character encoding + * - mb_list_encodings - Returns an array of all supported encodings + * - mb_ord - Returns the Unicode code point of a character + * - mb_output_handler - Callback function converts character encoding in output buffer + * - mb_scrub - Replaces ill-formed byte sequences with substitute characters + * - mb_strlen - Get string length + * - mb_strpos - Find position of first occurrence of string in a string + * - mb_strrpos - Find position of last occurrence of a string in a string + * - mb_str_split - Convert a string to an array + * - mb_strtolower - Make a string lowercase + * - mb_strtoupper - Make a string uppercase + * - mb_substitute_character - Set/Get substitution character + * - mb_substr - Get part of string + * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive + * - mb_stristr - Finds first occurrence of a string within another, case insensitive + * - mb_strrchr - Finds the last occurrence of a character in a string within another + * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive + * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive + * - mb_strstr - Finds first occurrence of a string within another + * - mb_strwidth - Return width of string + * - mb_substr_count - Count the number of substring occurrences + * + * Not implemented: + * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) + * - mb_ereg_* - Regular expression with multibyte support + * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable + * - mb_preferred_mime_name - Get MIME charset string + * - mb_regex_encoding - Returns current encoding for multibyte regex as string + * - mb_regex_set_options - Set/Get the default options for mbregex functions + * - mb_send_mail - Send encoded mail + * - mb_split - Split multibyte string using regular expression + * - mb_strcut - Get part of string + * - mb_strimwidth - Get truncated string with specified width + * + * @author Nicolas Grekas + * + * @internal + */ +final class Mbstring +{ + const MB_CASE_FOLD = PHP_INT_MAX; + + private static $encodingList = array('ASCII', 'UTF-8'); + private static $language = 'neutral'; + private static $internalEncoding = 'UTF-8'; + private static $caseFold = array( + array('碌', '趴', "\xCD\x85", '蟼', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"), + array('渭', 's', '喂', '蟽', '尾', '胃', '蠁', '蟺', '魏', '蟻', '蔚', "\xE1\xB9\xA1", '喂'), + ); + + public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) + { + if (\is_array($fromEncoding) || false !== strpos($fromEncoding, ',')) { + $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); + } else { + $fromEncoding = self::getEncoding($fromEncoding); + } + + $toEncoding = self::getEncoding($toEncoding); + + if ('BASE64' === $fromEncoding) { + $s = base64_decode($s); + $fromEncoding = $toEncoding; + } + + if ('BASE64' === $toEncoding) { + return base64_encode($s); + } + + if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { + if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { + $fromEncoding = 'Windows-1252'; + } + if ('UTF-8' !== $fromEncoding) { + $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); + } + + return preg_replace_callback('/[\x80-\xFF]+/', array(__CLASS__, 'html_encoding_callback'), $s); + } + + if ('HTML-ENTITIES' === $fromEncoding) { + $s = html_entity_decode($s, ENT_COMPAT, 'UTF-8'); + $fromEncoding = 'UTF-8'; + } + + return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); + } + + public static function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) + { + $vars = array(&$a, &$b, &$c, &$d, &$e, &$f); + + $ok = true; + array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { + if (false === $v = Mbstring::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { + $ok = false; + } + }); + + return $ok ? $fromEncoding : false; + } + + public static function mb_decode_mimeheader($s) + { + return iconv_mime_decode($s, 2, self::$internalEncoding); + } + + public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) + { + trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', E_USER_WARNING); + } + + public static function mb_decode_numericentity($s, $convmap, $encoding = null) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { + trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || !$convmap) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); + + return ''; // Instead of null (cf. mb_encode_numericentity). + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $cnt = floor(\count($convmap) / 4) * 4; + + for ($i = 0; $i < $cnt; $i += 4) { + // collector_decode_htmlnumericentity ignores $convmap[$i + 3] + $convmap[$i] += $convmap[$i + 2]; + $convmap[$i + 1] += $convmap[$i + 2]; + } + + $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { + $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; + for ($i = 0; $i < $cnt; $i += 4) { + if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { + return Mbstring::mb_chr($c - $convmap[$i + 2]); + } + } + + return $m[0]; + }, $s); + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) + { + if (null !== $s && !\is_scalar($s) && !(\is_object($s) && \method_exists($s, '__toString'))) { + trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', E_USER_WARNING); + + return null; + } + + if (!\is_array($convmap) || !$convmap) { + return false; + } + + if (null !== $encoding && !\is_scalar($encoding)) { + trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', E_USER_WARNING); + + return null; // Instead of '' (cf. mb_decode_numericentity). + } + + if (null !== $is_hex && !\is_scalar($is_hex)) { + trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', E_USER_WARNING); + + return null; + } + + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + + $cnt = floor(\count($convmap) / 4) * 4; + $i = 0; + $len = \strlen($s); + $result = ''; + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + $c = self::mb_ord($uchr); + + for ($j = 0; $j < $cnt; $j += 4) { + if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { + $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; + $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; + continue 2; + } + } + $result .= $uchr; + } + + if (null === $encoding) { + return $result; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $result); + } + + public static function mb_convert_case($s, $mode, $encoding = null) + { + $s = (string) $s; + if ('' === $s) { + return ''; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding) { + $encoding = null; + if (!preg_match('//u', $s)) { + $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); + } + } else { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + if (MB_CASE_TITLE == $mode) { + static $titleRegexp = null; + if (null === $titleRegexp) { + $titleRegexp = self::getData('titleCaseRegexp'); + } + $s = preg_replace_callback($titleRegexp, array(__CLASS__, 'title_case'), $s); + } else { + if (MB_CASE_UPPER == $mode) { + static $upper = null; + if (null === $upper) { + $upper = self::getData('upperCase'); + } + $map = $upper; + } else { + if (self::MB_CASE_FOLD === $mode) { + $s = str_replace(self::$caseFold[0], self::$caseFold[1], $s); + } + + static $lower = null; + if (null === $lower) { + $lower = self::getData('lowerCase'); + } + $map = $lower; + } + + static $ulenMask = array("\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4); + + $i = 0; + $len = \strlen($s); + + while ($i < $len) { + $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; + $uchr = substr($s, $i, $ulen); + $i += $ulen; + + if (isset($map[$uchr])) { + $uchr = $map[$uchr]; + $nlen = \strlen($uchr); + + if ($nlen == $ulen) { + $nlen = $i; + do { + $s[--$nlen] = $uchr[--$ulen]; + } while ($ulen); + } else { + $s = substr_replace($s, $uchr, $i - $ulen, $ulen); + $len += $nlen - $ulen; + $i += $nlen - $ulen; + } + } + } + } + + if (null === $encoding) { + return $s; + } + + return iconv('UTF-8', $encoding.'//IGNORE', $s); + } + + public static function mb_internal_encoding($encoding = null) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + $encoding = self::getEncoding($encoding); + + if ('UTF-8' === $encoding || false !== @iconv($encoding, $encoding, ' ')) { + self::$internalEncoding = $encoding; + + return true; + } + + return false; + } + + public static function mb_language($lang = null) + { + if (null === $lang) { + return self::$language; + } + + switch ($lang = strtolower($lang)) { + case 'uni': + case 'neutral': + self::$language = $lang; + + return true; + } + + return false; + } + + public static function mb_list_encodings() + { + return array('UTF-8'); + } + + public static function mb_encoding_aliases($encoding) + { + switch (strtoupper($encoding)) { + case 'UTF8': + case 'UTF-8': + return array('utf8'); + } + + return false; + } + + public static function mb_check_encoding($var = null, $encoding = null) + { + if (null === $encoding) { + if (null === $var) { + return false; + } + $encoding = self::$internalEncoding; + } + + return self::mb_detect_encoding($var, array($encoding)) || false !== @iconv($encoding, $encoding, $var); + } + + public static function mb_detect_encoding($str, $encodingList = null, $strict = false) + { + if (null === $encodingList) { + $encodingList = self::$encodingList; + } else { + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + } + + foreach ($encodingList as $enc) { + switch ($enc) { + case 'ASCII': + if (!preg_match('/[\x80-\xFF]/', $str)) { + return $enc; + } + break; + + case 'UTF8': + case 'UTF-8': + if (preg_match('//u', $str)) { + return 'UTF-8'; + } + break; + + default: + if (0 === strncmp($enc, 'ISO-8859-', 9)) { + return $enc; + } + } + } + + return false; + } + + public static function mb_detect_order($encodingList = null) + { + if (null === $encodingList) { + return self::$encodingList; + } + + if (!\is_array($encodingList)) { + $encodingList = array_map('trim', explode(',', $encodingList)); + } + $encodingList = array_map('strtoupper', $encodingList); + + foreach ($encodingList as $enc) { + switch ($enc) { + default: + if (strncmp($enc, 'ISO-8859-', 9)) { + return false; + } + // no break + case 'ASCII': + case 'UTF8': + case 'UTF-8': + } + } + + self::$encodingList = $encodingList; + + return true; + } + + public static function mb_strlen($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return \strlen($s); + } + + return @iconv_strlen($s, $encoding); + } + + public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strpos($haystack, $needle, $offset); + } + + $needle = (string) $needle; + if ('' === $needle) { + trigger_error(__METHOD__.': Empty delimiter', E_USER_WARNING); + + return false; + } + + return iconv_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return strrpos($haystack, $needle, $offset); + } + + if ($offset != (int) $offset) { + $offset = 0; + } elseif ($offset = (int) $offset) { + if ($offset < 0) { + if (0 > $offset += self::mb_strlen($needle)) { + $haystack = self::mb_substr($haystack, 0, $offset, $encoding); + } + $offset = 0; + } else { + $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); + } + } + + $pos = iconv_strrpos($haystack, $needle, $encoding); + + return false !== $pos ? $offset + $pos : false; + } + + public static function mb_str_split($string, $split_length = 1, $encoding = null) + { + if (null !== $string && !\is_scalar($string) && !(\is_object($string) && \method_exists($string, '__toString'))) { + trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', E_USER_WARNING); + + return null; + } + + if (1 > $split_length = (int) $split_length) { + trigger_error('The length of each segment must be greater than zero', E_USER_WARNING); + + return false; + } + + if (null === $encoding) { + $encoding = mb_internal_encoding(); + } + + if ('UTF-8' === $encoding = self::getEncoding($encoding)) { + $rx = '/('; + while (65535 < $split_length) { + $rx .= '.{65535}'; + $split_length -= 65535; + } + $rx .= '.{'.$split_length.'})/us'; + + return preg_split($rx, $string, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY); + } + + $result = array(); + $length = mb_strlen($string, $encoding); + + for ($i = 0; $i < $length; $i += $split_length) { + $result[] = mb_substr($string, $i, $split_length, $encoding); + } + + return $result; + } + + public static function mb_strtolower($s, $encoding = null) + { + return self::mb_convert_case($s, MB_CASE_LOWER, $encoding); + } + + public static function mb_strtoupper($s, $encoding = null) + { + return self::mb_convert_case($s, MB_CASE_UPPER, $encoding); + } + + public static function mb_substitute_character($c = null) + { + if (0 === strcasecmp($c, 'none')) { + return true; + } + + return null !== $c ? false : 'none'; + } + + public static function mb_substr($s, $start, $length = null, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + return (string) substr($s, $start, null === $length ? 2147483647 : $length); + } + + if ($start < 0) { + $start = iconv_strlen($s, $encoding) + $start; + if ($start < 0) { + $start = 0; + } + } + + if (null === $length) { + $length = 2147483647; + } elseif ($length < 0) { + $length = iconv_strlen($s, $encoding) + $length - $start; + if ($length < 0) { + return ''; + } + } + + return (string) iconv_substr($s, $start, $length, $encoding); + } + + public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) + { + $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); + $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + + return self::mb_strpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) + { + $pos = self::mb_stripos($haystack, $needle, 0, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) + { + $encoding = self::getEncoding($encoding); + if ('CP850' === $encoding || 'ASCII' === $encoding) { + $pos = strrpos($haystack, $needle); + } else { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = iconv_strrpos($haystack, $needle, $encoding); + } + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) + { + $needle = self::mb_substr($needle, 0, 1, $encoding); + $pos = self::mb_strripos($haystack, $needle, $encoding); + + return self::getSubpart($pos, $part, $haystack, $encoding); + } + + public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) + { + $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); + $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); + + return self::mb_strrpos($haystack, $needle, $offset, $encoding); + } + + public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) + { + $pos = strpos($haystack, $needle); + if (false === $pos) { + return false; + } + if ($part) { + return substr($haystack, 0, $pos); + } + + return substr($haystack, $pos); + } + + public static function mb_get_info($type = 'all') + { + $info = array( + 'internal_encoding' => self::$internalEncoding, + 'http_output' => 'pass', + 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', + 'func_overload' => 0, + 'func_overload_list' => 'no overload', + 'mail_charset' => 'UTF-8', + 'mail_header_encoding' => 'BASE64', + 'mail_body_encoding' => 'BASE64', + 'illegal_chars' => 0, + 'encoding_translation' => 'Off', + 'language' => self::$language, + 'detect_order' => self::$encodingList, + 'substitute_character' => 'none', + 'strict_detection' => 'Off', + ); + + if ('all' === $type) { + return $info; + } + if (isset($info[$type])) { + return $info[$type]; + } + + return false; + } + + public static function mb_http_input($type = '') + { + return false; + } + + public static function mb_http_output($encoding = null) + { + return null !== $encoding ? 'pass' === $encoding : 'pass'; + } + + public static function mb_strwidth($s, $encoding = null) + { + $encoding = self::getEncoding($encoding); + + if ('UTF-8' !== $encoding) { + $s = iconv($encoding, 'UTF-8//IGNORE', $s); + } + + $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); + + return ($wide << 1) + iconv_strlen($s, 'UTF-8'); + } + + public static function mb_substr_count($haystack, $needle, $encoding = null) + { + return substr_count($haystack, $needle); + } + + public static function mb_output_handler($contents, $status) + { + return $contents; + } + + public static function mb_chr($code, $encoding = null) + { + if (0x80 > $code %= 0x200000) { + $s = \chr($code); + } elseif (0x800 > $code) { + $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); + } elseif (0x10000 > $code) { + $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } else { + $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); + } + + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, $encoding, 'UTF-8'); + } + + return $s; + } + + public static function mb_ord($s, $encoding = null) + { + if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { + $s = mb_convert_encoding($s, 'UTF-8', $encoding); + } + + if (1 === \strlen($s)) { + return \ord($s); + } + + $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $s[2] - 0x80; + } + + return $code; + } + + private static function getSubpart($pos, $part, $haystack, $encoding) + { + if (false === $pos) { + return false; + } + if ($part) { + return self::mb_substr($haystack, 0, $pos, $encoding); + } + + return self::mb_substr($haystack, $pos, null, $encoding); + } + + private static function html_encoding_callback(array $m) + { + $i = 1; + $entities = ''; + $m = unpack('C*', htmlentities($m[0], ENT_COMPAT, 'UTF-8')); + + while (isset($m[$i])) { + if (0x80 > $m[$i]) { + $entities .= \chr($m[$i++]); + continue; + } + if (0xF0 <= $m[$i]) { + $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } elseif (0xE0 <= $m[$i]) { + $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; + } else { + $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; + } + + $entities .= '&#'.$c.';'; + } + + return $entities; + } + + private static function title_case(array $s) + { + return self::mb_convert_case($s[1], MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], MB_CASE_LOWER, 'UTF-8'); + } + + private static function getData($file) + { + if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { + return require $file; + } + + return false; + } + + private static function getEncoding($encoding) + { + if (null === $encoding) { + return self::$internalEncoding; + } + + if ('UTF-8' === $encoding) { + return 'UTF-8'; + } + + $encoding = strtoupper($encoding); + + if ('8BIT' === $encoding || 'BINARY' === $encoding) { + return 'CP850'; + } + + if ('UTF8' === $encoding) { + return 'UTF-8'; + } + + return $encoding; + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-mbstring/README.md b/phpMyAdmin/vendor/symfony/polyfill-mbstring/README.md new file mode 100755 index 0000000..4efb599 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-mbstring/README.md @@ -0,0 +1,13 @@ +Symfony Polyfill / Mbstring +=========================== + +This component provides a partial, native PHP implementation for the +[Mbstring](https://php.net/mbstring) extension. + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8 b/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8 new file mode 100755 index 0000000..d22d058 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8 @@ -0,0 +1,31 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_convert_variables')) { + /** + * Convert character code in variable(s) + */ + function mb_convert_variables($to_encoding, $from_encoding, &$var, &...$vars) + { + $vars = [&$var, ...$vars]; + + $ok = true; + array_walk_recursive($vars, function (&$v) use (&$ok, $to_encoding, $from_encoding) { + if (false === $v = p\Mbstring::mb_convert_encoding($v, $to_encoding, $from_encoding)) { + $ok = false; + } + }); + + return $ok ? $from_encoding : false; + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php new file mode 100755 index 0000000..a22eca5 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php @@ -0,0 +1,1397 @@ + 'a', + 'B' => 'b', + 'C' => 'c', + 'D' => 'd', + 'E' => 'e', + 'F' => 'f', + 'G' => 'g', + 'H' => 'h', + 'I' => 'i', + 'J' => 'j', + 'K' => 'k', + 'L' => 'l', + 'M' => 'm', + 'N' => 'n', + 'O' => 'o', + 'P' => 'p', + 'Q' => 'q', + 'R' => 'r', + 'S' => 's', + 'T' => 't', + 'U' => 'u', + 'V' => 'v', + 'W' => 'w', + 'X' => 'x', + 'Y' => 'y', + 'Z' => 'z', + '脌' => '脿', + '脕' => '谩', + '脗' => '芒', + '脙' => '茫', + '脛' => '盲', + '脜' => '氓', + '脝' => '忙', + '脟' => '莽', + '脠' => '猫', + '脡' => '茅', + '脢' => '锚', + '脣' => '毛', + '脤' => '矛', + '脥' => '铆', + '脦' => '卯', + '脧' => '茂', + '脨' => '冒', + '脩' => '帽', + '脪' => '貌', + '脫' => '贸', + '脭' => '么', + '脮' => '玫', + '脰' => '枚', + '脴' => '酶', + '脵' => '霉', + '脷' => '煤', + '脹' => '没', + '脺' => '眉', + '脻' => '媒', + '脼' => '镁', + '膧' => '膩', + '膫' => '膬', + '膭' => '膮', + '膯' => '膰', + '膱' => '膲', + '膴' => '膵', + '膶' => '膷', + '膸' => '膹', + '膼' => '膽', + '膾' => '膿', + '臄' => '臅', + '臇' => '臈', + '臉' => '臋', + '臍' => '臎', + '臏' => '臐', + '臑' => '臒', + '臓' => '摹', + '蘑' => '模', + '膜' => '磨', + '摩' => '魔', + '抹' => '末', + '莫' => '墨', + '默' => '沫', + '漠' => '寞', + '陌' => 'i', + '牟' => '某', + '拇' => '牡', + '亩' => '姆', + '墓' => '暮', + '幕' => '募', + '慕' => '木', + '目' => '艀', + '艁' => '艂', + '艃' => '艅', + '艆' => '艈', + '艊' => '艌', + '艎' => '艐', + '艑' => '艒', + '艓' => '艔', + '艕' => '艖', + '艗' => '艙', + '艛' => '艜', + '艝' => '艞', + '艠' => '艡', + '艢' => '艣', + '艤' => '艥', + '艦' => '艧', + '艩' => '拧', + '泞' => '牛', + '扭' => '钮', + '纽' => '脓', + '浓' => '农', + '弄' => '奴', + '努' => '怒', + '女' => '暖', + '虐' => '疟', + '挪' => '懦', + '糯' => '诺', + '哦' => '欧', + '鸥' => '每', + '殴' => '藕', + '呕' => '偶', + '沤' => '啪', + '苼' => '蓳', + '苽' => '苾', + '苿' => '茀', + '茊' => '蓴', + '茋' => '茍', + '茐' => '蓶', + '茒' => '蓷', + '茓' => '茖', + '茙' => '菨', + '茝' => '蓹', + '茞' => '蓻', + '茟' => '茠', + '茡' => '蔂', + '茢' => '桑', + '茤' => '嫂', + '茥' => '扫', + '茦' => '茩', + '茰' => '莎', + '茲' => '刹', + '茻' => '傻', + '茽' => '啤', + '脾' => '疲', + '皮' => '匹', + '痞' => '蕗', + '僻' => '屁', + '譬' => '蕛', + '片' => '骗', + '飘' => '蕡', + '漂' => '瓢', + '票' => '蕣', + '撇' => '蕥', + '瞥' => '拼', + '频' => '贫', + '品' => '蕭', + '聘' => '乒', + '萍' => '平', + '莿' => '菃', + '菂' => '菃', + '菄' => '菈', + '菆' => '菈', + '菉' => '菍', + '菋' => '菍', + '菎' => '菐', + '菑' => '菒', + '菓' => '菕', + '菗' => '菙', + '菚' => '菛', + '菞' => '菢', + '菣' => '菤', + '菦' => '菧', + '菫' => '菬', + '菭' => '恰', + '洽' => '牵', + '扦' => '钎', + '铅' => '千', + '迁' => '签', + '仟' => '谦', + '乾' => '黔', + '钱' => '钳', + '潜' => '浅', + '遣' => '浅', + '谴' => '堑', + '嵌' => '茣', + '欠' => '瓶', + '歉' => '枪', + '呛' => '腔', + '羌' => '墙', + '蔷' => '强', + '葊' => '葋', + '葌' => '葍', + '葎' => '葏', + '葐' => '葒', + '葓' => '葔', + '葕' => '葖', + '葘' => '葝', + '葞' => '葟', + '葠' => '葢', + '葤' => '葥', + '葦' => '葧', + '葨' => '葪', + '葮' => '葯', + '葰' => '葲', + '葴' => '葷', + '葹' => '葻', + '葼' => '茷', + '娶' => '龋', + '趣' => '去', + '圈' => '颧', + '权' => '醛', + '泉' => '全', + '痊' => '拳', + '犬' => '券', + '劝' => '缺', + '炔' => '瘸', + '群' => '獗�', + '然' => '燃', + '冉' => '茪', + '染' => '獗�', + '蓙' => '蓚', + '蓛' => '苺', + '蓜' => '蕢', + '蓞' => '蕦', + '蓡' => '蓢', + '蓤' => '蓧', + '蓨' => '蓩', + '蓪' => '蓫', + '蓭' => '蓮', + '桶' => '捅', + '筒' => '统', + '投' => '头', + '涂' => '铣', + '螁' => '维', + '螆' => '苇', + '螇' => '萎', + '螉' => '委', + '螌' => '蠈', + '螏' => '蠉', + '螐' => '蠋', + '螒' => '伪', + '螔' => '尾', + '螕' => '纬', + '螖' => '未', + '螘' => '蔚', + '螙' => '味', + '螚' => '畏', + '螛' => '胃', + '螜' => '喂', + '螝' => '魏', + '螞' => '位', + '螠' => '渭', + '螡' => '谓', + '螢' => '尉', + '螣' => '慰', + '螤' => '蟺', + '巍' => '蟻', + '危' => '蟽', + '韦' => '蟿', + '违' => '蠀', + '桅' => '蠁', + '围' => '蠂', + '唯' => '蠄', + '惟' => '蠅', + '为' => '蠆', + '潍' => '蠇', + '蠌' => '蠗', + '蠘' => '蠙', + '蠚' => '蠜', + '蠝' => '蠞', + '蠟' => '蠠', + '蠣' => '稀', + '息' => '希', + '悉' => '膝', + '夕' => '惜', + '熄' => '烯', + '溪' => '汐', + '犀' => '檄', + '袭' => '席', + '洗' => '胃', + '戏' => '细', + '瞎' => '喜', + '虾' => '匣', + '辖' => '突', + '暇' => '图', + '峡' => '徒', + '衻' => '褠', + '衼' => '褢', + '袀' => '褣', + '袃' => '褤', + '袆' => '褦', + '袇' => '褧', + '袉' => '褨', + '袊' => '褩', + '袌' => '褬', + '袎' => '褭', + '袏' => '褮', + '袐' => '褯', + '袑' => '褱', + '袓' => '褲', + '袔' => '褳', + '袕' => '褵', + '袗' => '邪', + '袘' => '斜', + '袙' => '胁', + '袚' => '谐', + '袛' => '写', + '袝' => '械', + '袞' => '卸', + '袟' => '蟹', + '袠' => '懈', + '袡' => '泄', + '袣' => '泻', + '袥' => '谢', + '袦' => '屑', + '袧' => '薪', + '袨' => '芯', + '袩' => '锌', + '袪' => '褉', + '小' => '褋', + '孝' => '褌', + '校' => '褍', + '肖' => '褎', + '啸' => '褏', + '笑' => '褑', + '效' => '褔', + '楔' => '褕', + '些' => '褖', + '歇' => '褗', + '蝎' => '褘', + '鞋' => '褜', + '协' => '褝', + '挟' => '褞', + '携' => '褟', + '褷' => '选', + '癣' => '眩', + '绚' => '靴', + '薛' => '学', + '穴' => '雪', + '血' => '勋', + '熏' => '循', + '旬' => '询', + '寻' => '驯', + '巡' => '殉', + '汛' => '训', + '讯' => '逊', + '迅' => '压', + '押' => '鸦', + '鸭' => '呀', + '丫' => '芽', + '襽' => '襾', + '見' => '覌', + '覍' => '覎', + '規' => '覐', + '覑' => '覒', + '覓' => '覔', + '覕' => '視', + '覗' => '覘', + '覙' => '覚', + '覛' => '覜', + '覝' => '覞', + '覟' => '覠', + '覡' => '摇', + '尧' => '遥', + '窑' => '谣', + '姚' => '咬', + '舀' => '药', + '要' => '耀', + '椰' => '噎', + '耶' => '爷', + '野' => '冶', + '也' => '页', + '掖' => '业', + '叶' => '曳', + '腋' => '夜', + '液' => '一', + '壹' => '医', + '揖' => '铱', + '觻' => '訌', + '觼' => '觽', + '觾' => '觿', + '訁' => '訂', + '訃' => '訄', + '訅' => '訆', + '計' => '訉', + '訊' => '訋', + '訍' => '討', + '訏' => '訐', + '訑' => '訒', + '訓' => '訔', + '訕' => '訖', + '託' => '記', + '訙' => '訚', + '訛' => '訜', + '訝' => '印', + '英' => '樱', + '婴' => '鹰', + '应' => '缨', + '莹' => '萤', + '营' => '荧', + '蝇' => '迎', + '赢' => '盈', + '影' => '颖', + '硬' => '映', + '哟' => '拥', + '佣' => '臃', + '痈' => '庸', + '雍' => '踊', + '蛹' => '咏', + '泳' => '涌', + '詟' => '詠', + '詡' => '詢', + '詣' => '詤', + '詥' => '試', + '詧' => '詨', + '詩' => '詪', + '詫' => '詬', + '詭' => '詮', + '詯' => '詰', + '話' => '該', + '詳' => '詴', + '詵' => '詶', + '詷' => '詸', + '詺' => '詻', + '詼' => '詽', + '詾' => '詿', + '誀' => '浴', + '寓' => '裕', + '预' => '豫', + '驭' => '鸳', + '渊' => '冤', + '元' => '垣', + '袁' => '原', + '援' => '辕', + '员' => '铡', + '圆' => '闸', + '猿' => '眨', + '源' => '栅', + '缘' => '榨', + '远' => '咋', + '苑' => '乍', + '愿' => '炸', + '怨' => '诈', + '院' => '摘', + '曰' => '斋', + '约' => '宅', + '越' => '窄', + '跃' => '债', + '钥' => '寨', + '諃' => '瞻', + '諄' => '毡', + '諅' => '詹', + '諆' => '粘', + '談' => '沾', + '諈' => '盏', + '諉' => '斩', + '諊' => '辗', + '請' => '崭', + '諌' => '展', + '諍' => '蘸', + '諎' => '栈', + '諏' => '占', + '諐' => '战', + '諑' => '站', + '諒' => '湛', + '諓' => '謤', + '諔' => '謥', + '諕' => '謧', + '論' => '謨', + '諗' => '謩', + '諘' => '謪', + '諙' => '謫', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醾�' => '獯�', + '醿�' => '獯�', + '醿�' => '獯�', + '醿�' => '獯�', + '醿�' => '獯�', + '醿�' => '獯�', + '醿�' => '獯�', + '醿�' => '獯�', + '醿�' => '獯�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戥�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釒�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '戤�', + '釓�' => '釓�', + '釓�' => '釓�', + '釓�' => '釓�', + '釓�' => '釓�', + '釓�' => '釓�', + '釓�' => '釓�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岵�' => '醿�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '脽', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峤�', + '峋�' => '峤�', + '峋�' => '峋�', + '峥�' => '峤�', + '峥�' => '峤�', + '峥�' => '峤�', + '峥�' => '峤�', + '峥�' => '峥�', + '峥�' => '峥�', + '峥�' => '峥�', + '峥�' => '峤�', + '峥�' => '峤�', + '峥�' => '峥�', + '峥�' => '峥�', + '峥�' => '峤�', + '峥�' => '峤�', + '峥�' => '峥�', + '峥�' => '峤�', + '峥�' => '峤�', + '峥�' => '峤�', + '峥�' => '峤�', + '峥�' => '峥�', + '鈩�' => '蠅', + '鈩�' => 'k', + '鈩�' => '氓', + '鈩�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈫�' => '鈫�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈷�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獍�' => '獗�', + '獗�' => '獗�', + '獗�' => '色', + '獗�' => '岬�', + '獗�' => '山', + '獗�' => '獗�', + '獗�' => '獗�', + '獗�' => '獗�', + '獗�' => '蓱', + '獗�' => '杀', + '獗�' => '蓯', + '獗�' => '蓲', + '獗�' => '獗�', + '獗�' => '獗�', + '獗�' => '瓤', + '獗�' => '蓘', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '岬�', + '隄�' => '隄�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '丧', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '搔', + '隇�' => '蓽', + '隇�' => '伞', + '隇�' => '涩', + '隇�' => '瑟', + '隇�' => '蕿', + '隇�' => '蕠', + '隇�' => '蕽', + '隇�' => '戥�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隉�' => '隉�', + '隉�' => '隇�', + '隉�' => '蕚', + '隉�' => '岫�', + '隉�' => '隉�', + '隉�' => '隉�', + '隉�' => '隉�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '锛�' => '锝�', + '饜悁' => '饜惃', + '饜悂' => '饜惄', + '饜悅' => '饜惇', + '饜悆' => '饜惈', + '饜悇' => '饜惉', + '饜悈' => '饜惌', + '饜悊' => '饜惍', + '饜悋' => '饜惎', + '饜悎' => '饜惏', + '饜悏' => '饜惐', + '饜悐' => '饜惒', + '饜悑' => '饜惓', + '饜悓' => '饜惔', + '饜悕' => '饜惖', + '饜悗' => '饜惗', + '饜悘' => '饜惙', + '饜悙' => '饜惛', + '饜悜' => '饜惞', + '饜悞' => '饜惡', + '饜悡' => '饜惢', + '饜悢' => '饜惣', + '饜悤' => '饜惤', + '饜悥' => '饜惥', + '饜悧' => '饜惪', + '饜悩' => '饜憖', + '饜悪' => '饜憗', + '饜悮' => '饜憘', + '饜悰' => '饜憙', + '饜悳' => '饜憚', + '饜悵' => '饜憛', + '饜悶' => '饜憜', + '饜悷' => '饜憞', + '饜悹' => '饜憟', + '饜悺' => '饜憠', + '饜悽' => '饜憡', + '饜悾' => '饜憢', + '饜悿' => '饜憣', + '饜惀' => '饜憤', + '饜惁' => '饜憥', + '饜惂' => '饜憦', + '饜挵' => '饜摌', + '饜挶' => '饜摍', + '饜挷' => '饜摎', + '饜挸' => '饜摏', + '饜挻' => '饜摐', + '饜挼' => '饜摑', + '饜挾' => '饜摓', + '饜挿' => '饜摕', + '饜捀' => '饜摖', + '饜捁' => '饜摗', + '饜捄' => '饜摙', + '饜捇' => '饜摚', + '饜捈' => '饜摛', + '饜捊' => '饜摜', + '饜捑' => '饜摝', + '饜捒' => '饜摟', + '饜搥' => '饜摠', + '饜搧' => '饜摡', + '饜搨' => '饜摢', + '饜搩' => '饜摣', + '饜搫' => '饜摤', + '饜搮' => '饜摥', + '饜搯' => '饜摦', + '饜搰' => '饜摨', + '饜搱' => '饜摪', + '饜搲' => '饜摫', + '饜搳' => '饜摬', + '饜搵' => '饜摮', + '饜搶' => '饜摯', + '饜搷' => '饜摰', + '饜搸' => '饜摱', + '饜搹' => '饜摲', + '饜搻' => '饜摳', + '饜搼' => '饜摴', + '饜搾' => '饜摵', + '饜摀' => '饜摶', + '饜瞼' => '饜硛', + '饜瞾' => '饜硜', + '饜矀' => '饜硞', + '饜矁' => '饜硟', + '饜矂' => '饜硠', + '饜矃' => '饜硡', + '饜矄' => '饜硢', + '饜矅' => '饜硣', + '饜矆' => '饜硤', + '饜矇' => '饜硥', + '饜矈' => '饜硦', + '饜矉' => '饜硧', + '饜矊' => '饜硨', + '饜矋' => '饜硩', + '饜矌' => '饜硯', + '饜矎' => '饜硰', + '饜矏' => '饜硱', + '饜矐' => '饜硲', + '饜矑' => '饜硳', + '饜矒' => '饜硴', + '饜矓' => '饜硵', + '饜矔' => '饜硶', + '饜矕' => '饜硸', + '饜矖' => '饜硹', + '饜矘' => '饜硺', + '饜矙' => '饜硻', + '饜矚' => '饜硽', + '饜矝' => '饜硾', + '饜矞' => '饜硿', + '饜矟' => '饜碀', + '饜矠' => '饜碁', + '饜矡' => '饜碂', + '饜矤' => '饜碃', + '饜病' => '饜场', + '饜并' => '饜尝', + '饜玻' => '饜常', + '饜菠' => '饜长', + '饜播' => '饜偿', + '饜拨' => '饜肠', + '饜钵' => '饜厂', + '饜波' => '饜敞', + '饜博' => '饜畅', + '饜勃' => '饜唱', + '饜搏' => '饜倡', + '饜铂' => '饜超', + '饜箔' => '饜抄', + '饜伯' => '饜钞', + '饜帛' => '饜朝', + '饜舶' => '饜嘲', + '饜脖' => '饜潮', + '饜膊' => '饜巢', + '饝' => '饝', + '饝ⅰ' => '饝', + '饝ⅱ' => '饝', + '饝ⅲ' => '饝', + '饝ⅳ' => '饝', + '饝ⅴ' => '饝', + '饝ⅵ' => '饝', + '饝ⅶ' => '饝', + '饝ⅷ' => '饝', + '饝ⅸ' => '饝', + '饝ⅹ' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝⒈' => '饝', + '饝⒉' => '饝', + '饝⒊' => '饝', + '饝⒋' => '饝', + '饝⒌' => '饝', + '饝⒍' => '饝', + '饝⒎' => '饝', + '饝⒏' => '饝', + '饝⒐' => '饝', + '饝⒑' => '饝', + '饝⒒' => '饝', + '饝⒓' => '饝', + '饝⒔' => '饝', + '饝⒕' => '饝', + '饝⒖' => '饝', + '饢箑' => '饢範', + '饢箒' => '饢埂', + '饢箓' => '饢耿', + '饢箖' => '饢梗', + '饢箘' => '饢工', + '饢箙' => '饢攻', + '饢箚' => '饢功', + '饢箛' => '饢恭', + '饢箞' => '饢龚', + '饢箟' => '饢供', + '饢箠' => '饢躬', + '饢箣' => '饢公', + '饢箤' => '饢宫', + '饢箥' => '饢弓', + '饢箮' => '饢巩', + '饢箯' => '饢汞', + '饢箰' => '饢拱', + '饢箲' => '饢贡', + '饢箳' => '饢共', + '饢箵' => '饢钩', + '饢箶' => '饢勾', + '饢箷' => '饢沟', + '饢箹' => '饢苟', + '饢箺' => '饢狗', + '饢箻' => '饢垢', + '饢箼' => '饢构', + '饢箽' => '饢购', + '饢箾' => '饢够', + '饢箿' => '饢辜', + '饢節' => '饢菇', + '饢篂' => '饢咕', + '饢篃' => '饢箍', + '馂' => '馂あ', + '馂' => '馂ぃ', + '馂' => '馂い', + '馂' => '馂ぅ', + '馂' => '馂う', + '馂' => '馂ぇ', + '馂' => '馂え', + '馂' => '馂ぉ', + '馂' => '馂お', + '馂' => '馂か', + '馂' => '馂が', + '馂' => '馂き', + '馂' => '馂ぎ', + '馂' => '馂く', + '馂' => '馂ぐ', + '馂' => '馂け', + '馂' => '馂げ', + '馂' => '馂こ', + '馂' => '馂ご', + '馂' => '馂さ', + '馂' => '馂ざ', + '馂' => '馂し', + '馂' => '馂じ', + '馂' => '馂す', + '馂' => '馂ず', + '馂' => '馂せ', + '馂' => '馂ぜ', + '馂' => '馂そ', + '馂' => '馂ぞ', + '馂' => '馂た', + '馂' => '馂', + '馂' => '馂', + '馂' => '馂', + '馂ぁ' => '馂', +); diff --git a/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php new file mode 100755 index 0000000..2a8f6e7 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php @@ -0,0 +1,5 @@ + 'A', + 'b' => 'B', + 'c' => 'C', + 'd' => 'D', + 'e' => 'E', + 'f' => 'F', + 'g' => 'G', + 'h' => 'H', + 'i' => 'I', + 'j' => 'J', + 'k' => 'K', + 'l' => 'L', + 'm' => 'M', + 'n' => 'N', + 'o' => 'O', + 'p' => 'P', + 'q' => 'Q', + 'r' => 'R', + 's' => 'S', + 't' => 'T', + 'u' => 'U', + 'v' => 'V', + 'w' => 'W', + 'x' => 'X', + 'y' => 'Y', + 'z' => 'Z', + '碌' => '螠', + '脿' => '脌', + '谩' => '脕', + '芒' => '脗', + '茫' => '脙', + '盲' => '脛', + '氓' => '脜', + '忙' => '脝', + '莽' => '脟', + '猫' => '脠', + '茅' => '脡', + '锚' => '脢', + '毛' => '脣', + '矛' => '脤', + '铆' => '脥', + '卯' => '脦', + '茂' => '脧', + '冒' => '脨', + '帽' => '脩', + '貌' => '脪', + '贸' => '脫', + '么' => '脭', + '玫' => '脮', + '枚' => '脰', + '酶' => '脴', + '霉' => '脵', + '煤' => '脷', + '没' => '脹', + '眉' => '脺', + '媒' => '脻', + '镁' => '脼', + '每' => '鸥', + '膩' => '膧', + '膬' => '膫', + '膮' => '膭', + '膰' => '膯', + '膲' => '膱', + '膵' => '膴', + '膷' => '膶', + '膹' => '膸', + '膽' => '膼', + '膿' => '膾', + '臅' => '臄', + '臈' => '臇', + '臋' => '臉', + '臎' => '臍', + '臐' => '臏', + '臒' => '臑', + '摹' => '臓', + '模' => '蘑', + '磨' => '膜', + '魔' => '摩', + '末' => '抹', + '墨' => '莫', + '沫' => '默', + '寞' => '漠', + '谋' => 'I', + '某' => '牟', + '牡' => '拇', + '姆' => '亩', + '暮' => '墓', + '募' => '幕', + '木' => '慕', + '艀' => '目', + '艂' => '艁', + '艅' => '艃', + '艈' => '艆', + '艌' => '艊', + '艐' => '艎', + '艒' => '艑', + '艔' => '艓', + '艖' => '艕', + '艙' => '艗', + '艜' => '艛', + '艞' => '艝', + '艡' => '艠', + '艣' => '艢', + '艥' => '艤', + '艧' => '艦', + '拧' => '艩', + '牛' => '泞', + '钮' => '扭', + '脓' => '纽', + '农' => '浓', + '奴' => '弄', + '怒' => '努', + '暖' => '女', + '疟' => '虐', + '懦' => '挪', + '诺' => '糯', + '欧' => '哦', + '藕' => '殴', + '偶' => '呕', + '啪' => '沤', + '趴' => 'S', + '苺' => '蓛', + '苾' => '苽', + '茀' => '苿', + '茍' => '茋', + '茖' => '茓', + '茠' => '茟', + '茣' => '嵌', + '茩' => '茦', + '茪' => '冉', + '茷' => '葼', + '啤' => '茽', + '疲' => '脾', + '匹' => '皮', + '屁' => '僻', + '骗' => '片', + '瓢' => '漂', + '拼' => '瞥', + '贫' => '频', + '乒' => '聘', + '平' => '萍', + '瓶' => '欠', + '菂' => '莿', + '菃' => '莿', + '菆' => '菄', + '菈' => '菄', + '菋' => '菉', + '菍' => '菉', + '菐' => '菎', + '菒' => '菑', + '菕' => '菓', + '菙' => '菗', + '菛' => '菚', + '菢' => '菞', + '菤' => '菣', + '菧' => '菦', + '菨' => '茙', + '菬' => '菫', + '恰' => '菭', + '牵' => '洽', + '钎' => '扦', + '千' => '铅', + '签' => '迁', + '谦' => '仟', + '黔' => '乾', + '钳' => '钱', + '遣' => '潜', + '浅' => '潜', + '堑' => '谴', + '枪' => '歉', + '腔' => '呛', + '墙' => '羌', + '强' => '蔷', + '葋' => '葊', + '葍' => '葌', + '葏' => '葎', + '葒' => '葐', + '葔' => '葓', + '葖' => '葕', + '葝' => '葘', + '葟' => '葞', + '葢' => '葠', + '葥' => '葤', + '葧' => '葦', + '葪' => '葨', + '葯' => '葮', + '葲' => '葰', + '葷' => '葴', + '葻' => '葹', + '龋' => '娶', + '去' => '趣', + '颧' => '圈', + '醛' => '权', + '全' => '泉', + '拳' => '痊', + '券' => '犬', + '缺' => '劝', + '瘸' => '炔', + '燃' => '然', + '瓤' => '獗�', + '蓘' => '獗�', + '蓚' => '蓙', + '蓢' => '蓡', + '蓧' => '蓤', + '蓩' => '蓨', + '蓫' => '蓪', + '蓮' => '蓭', + '蓯' => '獗�', + '蓱' => '獗�', + '蓲' => '獗�', + '蓳' => '苼', + '蓴' => '茊', + '蓶' => '茐', + '蓷' => '茒', + '蓹' => '茝', + '蓻' => '茞', + '蓽' => '隇�', + '蔂' => '茡', + '伞' => '隇�', + '桑' => '茢', + '丧' => '隇�', + '搔' => '隇�', + '扫' => '茥', + '嫂' => '茤', + '瑟' => '隇�', + '色' => '獗�', + '涩' => '隇�', + '莎' => '茰', + '杀' => '獗�', + '刹' => '茲', + '傻' => '茻', + '山' => '獗�', + '蕗' => '痞', + '蕚' => '隉�', + '蕛' => '譬', + '蕠' => '隇�', + '蕡' => '飘', + '蕢' => '蓜', + '蕣' => '票', + '蕥' => '撇', + '蕦' => '蓞', + '蕭' => '品', + '蕽' => '隇�', + '蕿' => '隇�', + '蛥' => '螜', + '捅' => '桶', + '统' => '筒', + '头' => '投', + '突' => '辖', + '图' => '暇', + '徒' => '峡', + '维' => '螁', + '苇' => '螆', + '萎' => '螇', + '委' => '螉', + '伪' => '螒', + '尾' => '螔', + '纬' => '螕', + '未' => '螖', + '蔚' => '螘', + '味' => '螙', + '畏' => '螚', + '胃' => '螛', + '喂' => '螜', + '魏' => '螝', + '位' => '螞', + '渭' => '螠', + '谓' => '螡', + '尉' => '螢', + '慰' => '螣', + '蟺' => '螤', + '蟻' => '巍', + '蟼' => '危', + '蟽' => '危', + '蟿' => '韦', + '蠀' => '违', + '蠁' => '桅', + '蠂' => '围', + '蠄' => '唯', + '蠅' => '惟', + '蠆' => '为', + '蠇' => '潍', + '蠈' => '螌', + '蠉' => '螏', + '蠋' => '螐', + '蠍' => '螔', + '蠎' => '螛', + '蠒' => '桅', + '蠔' => '螤', + '蠗' => '蠌', + '蠙' => '蠘', + '蠜' => '蠚', + '蠞' => '蠝', + '蠠' => '蠟', + '稀' => '蠣', + '希' => '息', + '膝' => '悉', + '惜' => '夕', + '烯' => '熄', + '汐' => '溪', + '檄' => '犀', + '席' => '袭', + '习' => '螝', + '媳' => '巍', + '喜' => '瞎', + '铣' => '涂', + '系' => '螘', + '细' => '戏', + '匣' => '虾', + '邪' => '袗', + '斜' => '袘', + '胁' => '袙', + '谐' => '袚', + '写' => '袛', + '械' => '袝', + '卸' => '袞', + '蟹' => '袟', + '懈' => '袠', + '泄' => '袡', + '泻' => '袣', + '谢' => '袥', + '屑' => '袦', + '薪' => '袧', + '芯' => '袨', + '锌' => '袩', + '褉' => '袪', + '褋' => '小', + '褌' => '孝', + '褍' => '校', + '褎' => '肖', + '褏' => '啸', + '褑' => '笑', + '褔' => '效', + '褕' => '楔', + '褖' => '些', + '褗' => '歇', + '褘' => '蝎', + '褜' => '鞋', + '褝' => '协', + '褞' => '挟', + '褟' => '携', + '褠' => '衻', + '褢' => '衼', + '褣' => '袀', + '褤' => '袃', + '褦' => '袆', + '褧' => '袇', + '褨' => '袉', + '褩' => '袊', + '褬' => '袌', + '褭' => '袎', + '褮' => '袏', + '褯' => '袐', + '褱' => '袑', + '褲' => '袓', + '褳' => '袔', + '褵' => '袕', + '选' => '褷', + '眩' => '癣', + '靴' => '绚', + '学' => '薛', + '雪' => '穴', + '勋' => '血', + '循' => '熏', + '询' => '旬', + '驯' => '寻', + '殉' => '巡', + '训' => '汛', + '逊' => '讯', + '压' => '迅', + '鸦' => '押', + '呀' => '鸭', + '芽' => '丫', + '襾' => '襽', + '覌' => '見', + '覎' => '覍', + '覐' => '規', + '覒' => '覑', + '覔' => '覓', + '視' => '覕', + '覘' => '覗', + '覚' => '覙', + '覜' => '覛', + '覞' => '覝', + '覠' => '覟', + '摇' => '覡', + '遥' => '尧', + '谣' => '窑', + '咬' => '姚', + '药' => '舀', + '耀' => '要', + '噎' => '椰', + '爷' => '耶', + '冶' => '野', + '页' => '也', + '业' => '掖', + '曳' => '叶', + '夜' => '腋', + '一' => '液', + '医' => '壹', + '铱' => '揖', + '觽' => '觼', + '觿' => '觾', + '訂' => '訁', + '訄' => '訃', + '訆' => '訅', + '訉' => '計', + '訋' => '訊', + '訌' => '觻', + '討' => '訍', + '訐' => '訏', + '訒' => '訑', + '訔' => '訓', + '訖' => '訕', + '記' => '託', + '訚' => '訙', + '訜' => '訛', + '印' => '訝', + '樱' => '英', + '鹰' => '婴', + '缨' => '应', + '萤' => '莹', + '荧' => '营', + '迎' => '蝇', + '盈' => '赢', + '颖' => '影', + '映' => '硬', + '拥' => '哟', + '臃' => '佣', + '庸' => '痈', + '踊' => '雍', + '咏' => '蛹', + '涌' => '泳', + '詠' => '詟', + '詢' => '詡', + '詤' => '詣', + '試' => '詥', + '詨' => '詧', + '詪' => '詩', + '詬' => '詫', + '詮' => '詭', + '詰' => '詯', + '該' => '話', + '詴' => '詳', + '詶' => '詵', + '詸' => '詷', + '詻' => '詺', + '詽' => '詼', + '詿' => '詾', + '浴' => '誀', + '裕' => '寓', + '豫' => '预', + '鸳' => '驭', + '冤' => '渊', + '垣' => '元', + '原' => '袁', + '辕' => '援', + '铡' => '员', + '闸' => '圆', + '眨' => '猿', + '栅' => '源', + '榨' => '缘', + '咋' => '远', + '乍' => '苑', + '炸' => '愿', + '诈' => '怨', + '摘' => '院', + '斋' => '曰', + '宅' => '约', + '窄' => '越', + '债' => '跃', + '寨' => '钥', + '瞻' => '諃', + '毡' => '諄', + '詹' => '諅', + '粘' => '諆', + '沾' => '談', + '盏' => '諈', + '斩' => '諉', + '辗' => '諊', + '崭' => '請', + '展' => '諌', + '蘸' => '諍', + '栈' => '諎', + '占' => '諏', + '战' => '諐', + '站' => '諑', + '湛' => '諒', + '謤' => '諓', + '謥' => '諔', + '謧' => '諕', + '謨' => '論', + '謩' => '諗', + '謪' => '諘', + '謫' => '諙', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '醿�' => '岵�', + '釓�' => '釓�', + '釓�' => '釓�', + '釓�' => '釓�', + '釓�' => '釓�', + '釓�' => '釓�', + '釓�' => '釓�', + '岵�' => '袙', + '岵�' => '袛', + '岵�' => '袨', + '岵�' => '小', + '岵�' => '孝', + '岵�' => '孝', + '岵�' => '歇', + '岵�' => '癣', + '岵�' => '隀�', + '岬�' => '隄�', + '岬�' => '獗�', + '岫�' => '隉�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '岣�' => '岣�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '峁�' => '峁�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '峁�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '岷�' => '岷�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峄�' => '峄�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峒�' => '峒�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峤�', + '峤�' => '峋�', + '峤�' => '峋�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峤�' => '峥�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '峋�', + '峋�' => '螜', + '峥�' => '峥�', + '峥�' => '峥�', + '峥�' => '峥�', + '峥�' => '峥�', + '峥�' => '峥�', + '峥�' => '峥�', + '峥�' => '峥�', + '鈪�' => '鈩�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈪�' => '鈪�', + '鈫�' => '鈫�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈷�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '鈸�' => '鈸�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獍�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獍�', + '獗�' => '獗�', + '獗�' => '群', + '獗�' => '染', + '獗�' => '獗�', + '獗�' => '獗�', + '獗�' => '獗�', + '獗�' => '獗�', + '獗�' => '獗�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獠�' => '獠�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獬�' => '獬�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醾�', + '獯�' => '醿�', + '獯�' => '醿�', + '獯�' => '醿�', + '獯�' => '醿�', + '獯�' => '醿�', + '獯�' => '醿�', + '獯�' => '醿�', + '獯�' => '醿�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隀�' => '隀�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隁�' => '隁�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隃�' => '隃�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隄�' => '隄�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隉�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隇�' => '隇�', + '隉�' => '隉�', + '隉�' => '隉�', + '隉�' => '隉�', + '隉�' => '隉�', + '戥�' => '隇�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戥�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釒�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '戤�' => '釓�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '锝�' => '锛�', + '饜惃' => '饜悁', + '饜惄' => '饜悂', + '饜惇' => '饜悅', + '饜惈' => '饜悆', + '饜惉' => '饜悇', + '饜惌' => '饜悈', + '饜惍' => '饜悊', + '饜惎' => '饜悋', + '饜惏' => '饜悎', + '饜惐' => '饜悏', + '饜惒' => '饜悐', + '饜惓' => '饜悑', + '饜惔' => '饜悓', + '饜惖' => '饜悕', + '饜惗' => '饜悗', + '饜惙' => '饜悘', + '饜惛' => '饜悙', + '饜惞' => '饜悜', + '饜惡' => '饜悞', + '饜惢' => '饜悡', + '饜惣' => '饜悢', + '饜惤' => '饜悤', + '饜惥' => '饜悥', + '饜惪' => '饜悧', + '饜憖' => '饜悩', + '饜憗' => '饜悪', + '饜憘' => '饜悮', + '饜憙' => '饜悰', + '饜憚' => '饜悳', + '饜憛' => '饜悵', + '饜憜' => '饜悶', + '饜憞' => '饜悷', + '饜憟' => '饜悹', + '饜憠' => '饜悺', + '饜憡' => '饜悽', + '饜憢' => '饜悾', + '饜憣' => '饜悿', + '饜憤' => '饜惀', + '饜憥' => '饜惁', + '饜憦' => '饜惂', + '饜摌' => '饜挵', + '饜摍' => '饜挶', + '饜摎' => '饜挷', + '饜摏' => '饜挸', + '饜摐' => '饜挻', + '饜摑' => '饜挼', + '饜摓' => '饜挾', + '饜摕' => '饜挿', + '饜摖' => '饜捀', + '饜摗' => '饜捁', + '饜摙' => '饜捄', + '饜摚' => '饜捇', + '饜摛' => '饜捈', + '饜摜' => '饜捊', + '饜摝' => '饜捑', + '饜摟' => '饜捒', + '饜摠' => '饜搥', + '饜摡' => '饜搧', + '饜摢' => '饜搨', + '饜摣' => '饜搩', + '饜摤' => '饜搫', + '饜摥' => '饜搮', + '饜摦' => '饜搯', + '饜摨' => '饜搰', + '饜摪' => '饜搱', + '饜摫' => '饜搲', + '饜摬' => '饜搳', + '饜摮' => '饜搵', + '饜摯' => '饜搶', + '饜摰' => '饜搷', + '饜摱' => '饜搸', + '饜摲' => '饜搹', + '饜摳' => '饜搻', + '饜摴' => '饜搼', + '饜摵' => '饜搾', + '饜摶' => '饜摀', + '饜硛' => '饜瞼', + '饜硜' => '饜瞾', + '饜硞' => '饜矀', + '饜硟' => '饜矁', + '饜硠' => '饜矂', + '饜硡' => '饜矃', + '饜硢' => '饜矄', + '饜硣' => '饜矅', + '饜硤' => '饜矆', + '饜硥' => '饜矇', + '饜硦' => '饜矈', + '饜硧' => '饜矉', + '饜硨' => '饜矊', + '饜硩' => '饜矋', + '饜硯' => '饜矌', + '饜硰' => '饜矎', + '饜硱' => '饜矏', + '饜硲' => '饜矐', + '饜硳' => '饜矑', + '饜硴' => '饜矒', + '饜硵' => '饜矓', + '饜硶' => '饜矔', + '饜硸' => '饜矕', + '饜硹' => '饜矖', + '饜硺' => '饜矘', + '饜硻' => '饜矙', + '饜硽' => '饜矚', + '饜硾' => '饜矝', + '饜硿' => '饜矞', + '饜碀' => '饜矟', + '饜碁' => '饜矠', + '饜碂' => '饜矡', + '饜碃' => '饜矤', + '饜场' => '饜病', + '饜尝' => '饜并', + '饜常' => '饜玻', + '饜长' => '饜菠', + '饜偿' => '饜播', + '饜肠' => '饜拨', + '饜厂' => '饜钵', + '饜敞' => '饜波', + '饜畅' => '饜博', + '饜唱' => '饜勃', + '饜倡' => '饜搏', + '饜超' => '饜铂', + '饜抄' => '饜箔', + '饜钞' => '饜伯', + '饜朝' => '饜帛', + '饜嘲' => '饜舶', + '饜潮' => '饜脖', + '饜巢' => '饜膊', + '饝' => '饝', + '饝' => '饝ⅰ', + '饝' => '饝ⅱ', + '饝' => '饝ⅲ', + '饝' => '饝ⅳ', + '饝' => '饝ⅴ', + '饝' => '饝ⅵ', + '饝' => '饝ⅶ', + '饝' => '饝ⅷ', + '饝' => '饝ⅸ', + '饝' => '饝ⅹ', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝', + '饝' => '饝⒈', + '饝' => '饝⒉', + '饝' => '饝⒊', + '饝' => '饝⒋', + '饝' => '饝⒌', + '饝' => '饝⒍', + '饝' => '饝⒎', + '饝' => '饝⒏', + '饝' => '饝⒐', + '饝' => '饝⒑', + '饝' => '饝⒒', + '饝' => '饝⒓', + '饝' => '饝⒔', + '饝' => '饝⒕', + '饝' => '饝⒖', + '饢範' => '饢箑', + '饢埂' => '饢箒', + '饢耿' => '饢箓', + '饢梗' => '饢箖', + '饢工' => '饢箘', + '饢攻' => '饢箙', + '饢功' => '饢箚', + '饢恭' => '饢箛', + '饢龚' => '饢箞', + '饢供' => '饢箟', + '饢躬' => '饢箠', + '饢公' => '饢箣', + '饢宫' => '饢箤', + '饢弓' => '饢箥', + '饢巩' => '饢箮', + '饢汞' => '饢箯', + '饢拱' => '饢箰', + '饢贡' => '饢箲', + '饢共' => '饢箳', + '饢钩' => '饢箵', + '饢勾' => '饢箶', + '饢沟' => '饢箷', + '饢苟' => '饢箹', + '饢狗' => '饢箺', + '饢垢' => '饢箻', + '饢构' => '饢箼', + '饢购' => '饢箽', + '饢够' => '饢箾', + '饢辜' => '饢箿', + '饢菇' => '饢節', + '饢咕' => '饢篂', + '饢箍' => '饢篃', + '馂あ' => '馂', + '馂ぃ' => '馂', + '馂い' => '馂', + '馂ぅ' => '馂', + '馂う' => '馂', + '馂ぇ' => '馂', + '馂え' => '馂', + '馂ぉ' => '馂', + '馂お' => '馂', + '馂か' => '馂', + '馂が' => '馂', + '馂き' => '馂', + '馂ぎ' => '馂', + '馂く' => '馂', + '馂ぐ' => '馂', + '馂け' => '馂', + '馂げ' => '馂', + '馂こ' => '馂', + '馂ご' => '馂', + '馂さ' => '馂', + '馂ざ' => '馂', + '馂し' => '馂', + '馂じ' => '馂', + '馂す' => '馂', + '馂ず' => '馂', + '馂せ' => '馂', + '馂ぜ' => '馂', + '馂そ' => '馂', + '馂ぞ' => '馂', + '馂た' => '馂', + '馂' => '馂', + '馂' => '馂', + '馂' => '馂', + '馂' => '馂ぁ', +); diff --git a/phpMyAdmin/vendor/symfony/polyfill-mbstring/bootstrap.php b/phpMyAdmin/vendor/symfony/polyfill-mbstring/bootstrap.php new file mode 100755 index 0000000..a48f7e6 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-mbstring/bootstrap.php @@ -0,0 +1,145 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Mbstring as p; + +if (!function_exists('mb_convert_encoding')) { + function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); } +} +if (!function_exists('mb_decode_mimeheader')) { + function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } +} +if (!function_exists('mb_encode_mimeheader')) { + function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = null, $indent = null) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); } +} +if (!function_exists('mb_decode_numericentity')) { + function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } +} +if (!function_exists('mb_encode_numericentity')) { + function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); } +} +if (!function_exists('mb_convert_case')) { + function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } +} +if (!function_exists('mb_internal_encoding')) { + function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } +} +if (!function_exists('mb_language')) { + function mb_language($language = null) { return p\Mbstring::mb_language($language); } +} +if (!function_exists('mb_list_encodings')) { + function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } +} +if (!function_exists('mb_encoding_aliases')) { + function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } +} +if (!function_exists('mb_check_encoding')) { + function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); } +} +if (!function_exists('mb_detect_encoding')) { + function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); } +} +if (!function_exists('mb_detect_order')) { + function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } +} +if (!function_exists('mb_parse_str')) { + function mb_parse_str($string, &$result = array()) { parse_str($string, $result); } +} +if (!function_exists('mb_strlen')) { + function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } +} +if (!function_exists('mb_strpos')) { + function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strtolower')) { + function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } +} +if (!function_exists('mb_strtoupper')) { + function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } +} +if (!function_exists('mb_substitute_character')) { + function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } +} +if (!function_exists('mb_substr')) { + function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } +} +if (!function_exists('mb_stripos')) { + function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_stristr')) { + function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrchr')) { + function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strrichr')) { + function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_strripos')) { + function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strrpos')) { + function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } +} +if (!function_exists('mb_strstr')) { + function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); } +} +if (!function_exists('mb_get_info')) { + function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } +} +if (!function_exists('mb_http_output')) { + function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } +} +if (!function_exists('mb_strwidth')) { + function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } +} +if (!function_exists('mb_substr_count')) { + function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } +} +if (!function_exists('mb_output_handler')) { + function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } +} +if (!function_exists('mb_http_input')) { + function mb_http_input($type = '') { return p\Mbstring::mb_http_input($type); } +} + +if (PHP_VERSION_ID >= 80000) { + require_once __DIR__.'/Resources/mb_convert_variables.php8'; +} elseif (!function_exists('mb_convert_variables')) { + function mb_convert_variables($toEncoding, $fromEncoding, &$a = null, &$b = null, &$c = null, &$d = null, &$e = null, &$f = null) { return p\Mbstring::mb_convert_variables($toEncoding, $fromEncoding, $a, $b, $c, $d, $e, $f); } +} + +if (!function_exists('mb_ord')) { + function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } +} +if (!function_exists('mb_chr')) { + function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } +} +if (!function_exists('mb_scrub')) { + function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); } +} +if (!function_exists('mb_str_split')) { + function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } +} + +if (extension_loaded('mbstring')) { + return; +} + +if (!defined('MB_CASE_UPPER')) { + define('MB_CASE_UPPER', 0); +} +if (!defined('MB_CASE_LOWER')) { + define('MB_CASE_LOWER', 1); +} +if (!defined('MB_CASE_TITLE')) { + define('MB_CASE_TITLE', 2); +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-mbstring/composer.json b/phpMyAdmin/vendor/symfony/polyfill-mbstring/composer.json new file mode 100755 index 0000000..abdfd3e --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-mbstring/composer.json @@ -0,0 +1,38 @@ +{ + "name": "symfony/polyfill-mbstring", + "type": "library", + "description": "Symfony polyfill for the Mbstring extension", + "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, + "files": [ "bootstrap.php" ] + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-php56/LICENSE b/phpMyAdmin/vendor/symfony/polyfill-php56/LICENSE new file mode 100755 index 0000000..4cd8bdd --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-php56/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/phpMyAdmin/vendor/symfony/polyfill-php56/Php56.php b/phpMyAdmin/vendor/symfony/polyfill-php56/Php56.php new file mode 100755 index 0000000..dbbc0e1 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-php56/Php56.php @@ -0,0 +1,138 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php56; + +use Symfony\Polyfill\Util\Binary; + +/** + * @internal + */ +final class Php56 +{ + const LDAP_ESCAPE_FILTER = 1; + const LDAP_ESCAPE_DN = 2; + + public static function hash_equals($knownString, $userInput) + { + if (!\is_string($knownString)) { + trigger_error('Expected known_string to be a string, '.\gettype($knownString).' given', E_USER_WARNING); + + return false; + } + + if (!\is_string($userInput)) { + trigger_error('Expected user_input to be a string, '.\gettype($userInput).' given', E_USER_WARNING); + + return false; + } + + $knownLen = Binary::strlen($knownString); + $userLen = Binary::strlen($userInput); + + if ($knownLen !== $userLen) { + return false; + } + + $result = 0; + + for ($i = 0; $i < $knownLen; ++$i) { + $result |= \ord($knownString[$i]) ^ \ord($userInput[$i]); + } + + return 0 === $result; + } + + /** + * Stub implementation of the {@link ldap_escape()} function of the ldap + * extension. + * + * Escape strings for safe use in LDAP filters and DNs. + * + * @author Chris Wright + * + * @param string $subject + * @param string $ignore + * @param int $flags + * + * @return string + * + * @see http://stackoverflow.com/a/8561604 + */ + public static function ldap_escape($subject, $ignore = '', $flags = 0) + { + static $charMaps = null; + + if (null === $charMaps) { + $charMaps = array( + self::LDAP_ESCAPE_FILTER => array('\\', '*', '(', ')', "\x00"), + self::LDAP_ESCAPE_DN => array('\\', ',', '=', '+', '<', '>', ';', '"', '#', "\r"), + ); + + $charMaps[0] = array(); + + for ($i = 0; $i < 256; ++$i) { + $charMaps[0][\chr($i)] = sprintf('\\%02x', $i); + } + + for ($i = 0, $l = \count($charMaps[self::LDAP_ESCAPE_FILTER]); $i < $l; ++$i) { + $chr = $charMaps[self::LDAP_ESCAPE_FILTER][$i]; + unset($charMaps[self::LDAP_ESCAPE_FILTER][$i]); + $charMaps[self::LDAP_ESCAPE_FILTER][$chr] = $charMaps[0][$chr]; + } + + for ($i = 0, $l = \count($charMaps[self::LDAP_ESCAPE_DN]); $i < $l; ++$i) { + $chr = $charMaps[self::LDAP_ESCAPE_DN][$i]; + unset($charMaps[self::LDAP_ESCAPE_DN][$i]); + $charMaps[self::LDAP_ESCAPE_DN][$chr] = $charMaps[0][$chr]; + } + } + + // Create the base char map to escape + $flags = (int) $flags; + $charMap = array(); + + if ($flags & self::LDAP_ESCAPE_FILTER) { + $charMap += $charMaps[self::LDAP_ESCAPE_FILTER]; + } + + if ($flags & self::LDAP_ESCAPE_DN) { + $charMap += $charMaps[self::LDAP_ESCAPE_DN]; + } + + if (!$charMap) { + $charMap = $charMaps[0]; + } + + // Remove any chars to ignore from the list + $ignore = (string) $ignore; + + for ($i = 0, $l = \strlen($ignore); $i < $l; ++$i) { + unset($charMap[$ignore[$i]]); + } + + // Do the main replacement + $result = strtr($subject, $charMap); + + // Encode leading/trailing spaces if self::LDAP_ESCAPE_DN is passed + if ($flags & self::LDAP_ESCAPE_DN) { + if (' ' === $result[0]) { + $result = '\\20'.substr($result, 1); + } + + if (' ' === $result[\strlen($result) - 1]) { + $result = substr($result, 0, -1).'\\20'; + } + } + + return $result; + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-php56/README.md b/phpMyAdmin/vendor/symfony/polyfill-php56/README.md new file mode 100755 index 0000000..5ad570b --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-php56/README.md @@ -0,0 +1,15 @@ +Symfony Polyfill / Php56 +======================== + +This component provides functions unavailable in releases prior to PHP 5.6: + +- [`hash_equals`](https://php.net/hash_equals) (part of [hash](https://php.net/hash) extension) +- [`ldap_escape`](https://php.net/ldap_escape) (part of [ldap](https://php.net/ldap) extension) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/phpMyAdmin/vendor/symfony/polyfill-php56/bootstrap.php b/phpMyAdmin/vendor/symfony/polyfill-php56/bootstrap.php new file mode 100755 index 0000000..b8e4cee --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-php56/bootstrap.php @@ -0,0 +1,44 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php56 as p; + +if (PHP_VERSION_ID >= 50600) { + return; +} + +if (!function_exists('hash_equals')) { + function hash_equals($known_string, $user_string) { return p\Php56::hash_equals($known_string, $user_string); } +} +if (extension_loaded('ldap') && !defined('LDAP_ESCAPE_FILTER')) { + define('LDAP_ESCAPE_FILTER', 1); +} +if (extension_loaded('ldap') && !defined('LDAP_ESCAPE_DN')) { + define('LDAP_ESCAPE_DN', 2); +} + +if (extension_loaded('ldap') && !function_exists('ldap_escape')) { + function ldap_escape($value, $ignore = '', $flags = 0) { return p\Php56::ldap_escape($value, $ignore, $flags); } +} + +if (50509 === PHP_VERSION_ID && 4 === PHP_INT_SIZE) { + // Missing functions in PHP 5.5.9 - affects 32 bit builds of Ubuntu 14.04LTS + // See https://bugs.launchpad.net/ubuntu/+source/php5/+bug/1315888 + if (!function_exists('gzopen') && function_exists('gzopen64')) { + function gzopen($filename, $mode, $use_include_path = 0) { return gzopen64($filename, $mode, $use_include_path); } + } + if (!function_exists('gzseek') && function_exists('gzseek64')) { + function gzseek($fp, $offset, $whence = SEEK_SET) { return gzseek64($fp, $offset, $whence); } + } + if (!function_exists('gztell') && function_exists('gztell64')) { + function gztell($fp) { return gztell64($fp); } + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-php56/composer.json b/phpMyAdmin/vendor/symfony/polyfill-php56/composer.json new file mode 100755 index 0000000..8cc5543 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-php56/composer.json @@ -0,0 +1,36 @@ +{ + "name": "symfony/polyfill-php56", + "type": "library", + "description": "Symfony polyfill backporting some PHP 5.6+ features to lower PHP versions", + "keywords": ["polyfill", "shim", "compatibility", "portable"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3", + "symfony/polyfill-util": "~1.0" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Php56\\": "" }, + "files": [ "bootstrap.php" ] + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/Binary.php b/phpMyAdmin/vendor/symfony/polyfill-util/Binary.php new file mode 100755 index 0000000..23ff974 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/Binary.php @@ -0,0 +1,22 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Util; + +if (\extension_loaded('mbstring')) { + class Binary extends BinaryOnFuncOverload + { + } +} else { + class Binary extends BinaryNoFuncOverload + { + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/BinaryNoFuncOverload.php b/phpMyAdmin/vendor/symfony/polyfill-util/BinaryNoFuncOverload.php new file mode 100755 index 0000000..800ad75 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/BinaryNoFuncOverload.php @@ -0,0 +1,65 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Util; + +/** + * @author Nicolas Grekas + * + * @internal + */ +class BinaryNoFuncOverload +{ + public static function strlen($s) + { + return \strlen($s); + } + + public static function strpos($haystack, $needle, $offset = 0) + { + return strpos($haystack, $needle, $offset); + } + + public static function strrpos($haystack, $needle, $offset = 0) + { + return strrpos($haystack, $needle, $offset); + } + + public static function substr($string, $start, $length = PHP_INT_MAX) + { + return substr($string, $start, $length); + } + + public static function stripos($s, $needle, $offset = 0) + { + return stripos($s, $needle, $offset); + } + + public static function stristr($s, $needle, $part = false) + { + return stristr($s, $needle, $part); + } + + public static function strrchr($s, $needle, $part = false) + { + return strrchr($s, $needle, $part); + } + + public static function strripos($s, $needle, $offset = 0) + { + return strripos($s, $needle, $offset); + } + + public static function strstr($s, $needle, $part = false) + { + return strstr($s, $needle, $part); + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/BinaryOnFuncOverload.php b/phpMyAdmin/vendor/symfony/polyfill-util/BinaryOnFuncOverload.php new file mode 100755 index 0000000..e1b886e --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/BinaryOnFuncOverload.php @@ -0,0 +1,67 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Util; + +/** + * Binary safe version of string functions overloaded when MB_OVERLOAD_STRING is enabled. + * + * @author Nicolas Grekas + * + * @internal + */ +class BinaryOnFuncOverload +{ + public static function strlen($s) + { + return mb_strlen($s, '8bit'); + } + + public static function strpos($haystack, $needle, $offset = 0) + { + return mb_strpos($haystack, $needle, $offset, '8bit'); + } + + public static function strrpos($haystack, $needle, $offset = 0) + { + return mb_strrpos($haystack, $needle, $offset, '8bit'); + } + + public static function substr($string, $start, $length = 2147483647) + { + return mb_substr($string, $start, $length, '8bit'); + } + + public static function stripos($s, $needle, $offset = 0) + { + return mb_stripos($s, $needle, $offset, '8bit'); + } + + public static function stristr($s, $needle, $part = false) + { + return mb_stristr($s, $needle, $part, '8bit'); + } + + public static function strrchr($s, $needle, $part = false) + { + return mb_strrchr($s, $needle, $part, '8bit'); + } + + public static function strripos($s, $needle, $offset = 0) + { + return mb_strripos($s, $needle, $offset, '8bit'); + } + + public static function strstr($s, $needle, $part = false) + { + return mb_strstr($s, $needle, $part, '8bit'); + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/LICENSE b/phpMyAdmin/vendor/symfony/polyfill-util/LICENSE new file mode 100755 index 0000000..4cd8bdd --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2015-2019 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/README.md b/phpMyAdmin/vendor/symfony/polyfill-util/README.md new file mode 100755 index 0000000..1c655fc --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/README.md @@ -0,0 +1,13 @@ +Symfony Polyfill / Util +======================= + +This component provides binary-safe string functions, using the +[mbstring](https://php.net/mbstring) extension when available. + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/TestListener.php b/phpMyAdmin/vendor/symfony/polyfill-util/TestListener.php new file mode 100755 index 0000000..6b17d45 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/TestListener.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Util; + +if (class_exists('PHPUnit_Runner_Version') && version_compare(\PHPUnit_Runner_Version::id(), '6.0.0', '<')) { + class_alias('Symfony\Polyfill\Util\TestListenerForV5', 'Symfony\Polyfill\Util\TestListener'); +// Using an early return instead of a else does not work when using the PHPUnit phar due to some weird PHP behavior (the class +// gets defined without executing the code before it and so the definition is not properly conditional) +} elseif (version_compare(\PHPUnit\Runner\Version::id(), '7.0.0', '<')) { + class_alias('Symfony\Polyfill\Util\TestListenerForV6', 'Symfony\Polyfill\Util\TestListener'); +} else { + class_alias('Symfony\Polyfill\Util\TestListenerForV7', 'Symfony\Polyfill\Util\TestListener'); +} + +if (false) { + class TestListener + { + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV5.php b/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV5.php new file mode 100755 index 0000000..501053d --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV5.php @@ -0,0 +1,89 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Util; + +/** + * @author Nicolas Grekas + */ +class TestListenerForV5 extends \PHPUnit_Framework_TestSuite implements \PHPUnit_Framework_TestListener +{ + private $suite; + private $trait; + + public function __construct(\PHPUnit_Framework_TestSuite $suite = null) + { + if ($suite) { + $this->suite = $suite; + $this->setName($suite->getName().' with polyfills enabled'); + $this->addTest($suite); + } + $this->trait = new TestListenerTrait(); + } + + public function startTestSuite(\PHPUnit_Framework_TestSuite $suite) + { + $this->trait->startTestSuite($suite); + } + + public function addError(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + $this->trait->addError($test, $e, $time); + } + + public function addWarning(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_Warning $e, $time) + { + } + + public function addFailure(\PHPUnit_Framework_Test $test, \PHPUnit_Framework_AssertionFailedError $e, $time) + { + $this->trait->addError($test, $e, $time); + } + + public function addIncompleteTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + } + + public function addRiskyTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + } + + public function addSkippedTest(\PHPUnit_Framework_Test $test, \Exception $e, $time) + { + } + + public function endTestSuite(\PHPUnit_Framework_TestSuite $suite) + { + } + + public function startTest(\PHPUnit_Framework_Test $test) + { + } + + public function endTest(\PHPUnit_Framework_Test $test, $time) + { + } + + public static function warning($message) + { + return parent::warning($message); + } + + protected function setUp() + { + TestListenerTrait::$enabledPolyfills = $this->suite->getName(); + } + + protected function tearDown() + { + TestListenerTrait::$enabledPolyfills = false; + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV6.php b/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV6.php new file mode 100755 index 0000000..e9e87cb --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV6.php @@ -0,0 +1,95 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Util; + +use PHPUnit\Framework\AssertionFailedError; +use PHPUnit\Framework\Test; +use PHPUnit\Framework\TestListener as TestListenerInterface; +use PHPUnit\Framework\TestSuite; +use PHPUnit\Framework\Warning; + +/** + * @author Nicolas Grekas + */ +class TestListenerForV6 extends TestSuite implements TestListenerInterface +{ + private $suite; + private $trait; + + public function __construct(TestSuite $suite = null) + { + if ($suite) { + $this->suite = $suite; + $this->setName($suite->getName().' with polyfills enabled'); + $this->addTest($suite); + } + $this->trait = new TestListenerTrait(); + } + + public function startTestSuite(TestSuite $suite) + { + $this->trait->startTestSuite($suite); + } + + public function addError(Test $test, \Exception $e, $time) + { + $this->trait->addError($test, $e, $time); + } + + public function addWarning(Test $test, Warning $e, $time) + { + } + + public function addFailure(Test $test, AssertionFailedError $e, $time) + { + $this->trait->addError($test, $e, $time); + } + + public function addIncompleteTest(Test $test, \Exception $e, $time) + { + } + + public function addRiskyTest(Test $test, \Exception $e, $time) + { + } + + public function addSkippedTest(Test $test, \Exception $e, $time) + { + } + + public function endTestSuite(TestSuite $suite) + { + } + + public function startTest(Test $test) + { + } + + public function endTest(Test $test, $time) + { + } + + public static function warning($message) + { + return parent::warning($message); + } + + protected function setUp() + { + TestListenerTrait::$enabledPolyfills = $this->suite->getName(); + } + + protected function tearDown() + { + TestListenerTrait::$enabledPolyfills = false; + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV7.php b/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV7.php new file mode 100755 index 0000000..a5c3759 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerForV7.php @@ -0,0 +1,96 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Util; + +use PHPUnit\Framework\AssertionFailedError; +use PHPUnit\Framework\Test; +use PHPUnit\Framework\TestListener as TestListenerInterface; +use PHPUnit\Framework\TestSuite; +use PHPUnit\Framework\Warning; +use PHPUnit\Framework\WarningTestCase; + +/** + * @author Ion Bazan + */ +class TestListenerForV7 extends TestSuite implements TestListenerInterface +{ + private $suite; + private $trait; + + public function __construct(TestSuite $suite = null) + { + if ($suite) { + $this->suite = $suite; + $this->setName($suite->getName().' with polyfills enabled'); + $this->addTest($suite); + } + $this->trait = new TestListenerTrait(); + } + + public function startTestSuite(TestSuite $suite): void + { + $this->trait->startTestSuite($suite); + } + + public function addError(Test $test, \Throwable $t, float $time): void + { + $this->trait->addError($test, $t, $time); + } + + public function addWarning(Test $test, Warning $e, float $time): void + { + } + + public function addFailure(Test $test, AssertionFailedError $e, float $time): void + { + $this->trait->addError($test, $e, $time); + } + + public function addIncompleteTest(Test $test, \Throwable $t, float $time): void + { + } + + public function addRiskyTest(Test $test, \Throwable $t, float $time): void + { + } + + public function addSkippedTest(Test $test, \Throwable $t, float $time): void + { + } + + public function endTestSuite(TestSuite $suite): void + { + } + + public function startTest(Test $test): void + { + } + + public function endTest(Test $test, float $time): void + { + } + + public static function warning($message): WarningTestCase + { + return new WarningTestCase($message); + } + + protected function setUp(): void + { + TestListenerTrait::$enabledPolyfills = $this->suite->getName(); + } + + protected function tearDown(): void + { + TestListenerTrait::$enabledPolyfills = false; + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerTrait.php b/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerTrait.php new file mode 100755 index 0000000..777fb48 --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/TestListenerTrait.php @@ -0,0 +1,129 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Util; + +/** + * @author Nicolas Grekas + */ +class TestListenerTrait +{ + public static $enabledPolyfills; + + public function startTestSuite($mainSuite) + { + if (null !== self::$enabledPolyfills) { + return; + } + self::$enabledPolyfills = false; + $SkippedTestError = class_exists('PHPUnit\Framework\SkippedTestError') ? 'PHPUnit\Framework\SkippedTestError' : 'PHPUnit_Framework_SkippedTestError'; + + foreach ($mainSuite->tests() as $suite) { + $testClass = $suite->getName(); + if (!$tests = $suite->tests()) { + continue; + } + $testedClass = new \ReflectionClass($testClass); + if (preg_match('{^ \* @requires PHP (.*)}mi', $testedClass->getDocComment(), $m) && version_compare($m[1], \PHP_VERSION, '>')) { + continue; + } + if (!preg_match('/^(.+)\\\\Tests(\\\\.*)Test$/', $testClass, $m)) { + $mainSuite->addTest(TestListener::warning('Unknown naming convention for '.$testClass)); + continue; + } + if (!class_exists($m[1].$m[2])) { + continue; + } + $testedClass = new \ReflectionClass($m[1].$m[2]); + $bootstrap = new \SplFileObject(\dirname($testedClass->getFileName()).'/bootstrap.php'); + $warnings = array(); + $defLine = null; + + foreach (new \RegexIterator($bootstrap, '/define\(\'/') as $defLine) { + preg_match('/define\(\'(?P.+)\'/', $defLine, $matches); + if (\defined($matches['name'])) { + continue; + } + + try { + eval($defLine); + } catch (\PHPUnit_Framework_Exception $ex){ + $warnings[] = TestListener::warning($ex->getMessage()); + } catch (\PHPUnit\Framework\Exception $ex) { + $warnings[] = TestListener::warning($ex->getMessage()); + } + } + + $bootstrap->rewind(); + + foreach (new \RegexIterator($bootstrap, '/return p\\\\'.$testedClass->getShortName().'::/') as $defLine) { + if (!preg_match('/^\s*function (?P[^\(]++)(?P\(.*\)(?: ?: [^ ]++)?) \{ (?return p\\\\'.$testedClass->getShortName().'::[^\(]++)(?P\([^\)]*+\)); \}$/', $defLine, $f)) { + $warnings[] = TestListener::warning('Invalid line in bootstrap.php: '.trim($defLine)); + continue; + } + $testNamespace = substr($testClass, 0, strrpos($testClass, '\\')); + if (\function_exists($testNamespace.'\\'.$f['name'])) { + continue; + } + + try { + $r = new \ReflectionFunction($f['name']); + if ($r->isUserDefined()) { + throw new \ReflectionException(); + } + if ('idn_to_ascii' === $f['name'] || 'idn_to_utf8' === $f['name']) { + $defLine = sprintf('return INTL_IDNA_VARIANT_2003 === $variant ? \\%s($domain, $options, $variant) : \\%1$s%s', $f['name'], $f['args']); + } elseif (false !== strpos($f['signature'], '&') && 'idn_to_ascii' !== $f['name'] && 'idn_to_utf8' !== $f['name']) { + $defLine = sprintf('return \\%s%s', $f['name'], $f['args']); + } else { + $defLine = sprintf("return \\call_user_func_array('%s', \\func_get_args())", $f['name']); + } + } catch (\ReflectionException $e) { + $defLine = sprintf("throw new \\{$SkippedTestError}('Internal function not found: %s')", $f['name']); + } + + eval(<<getNamespaceName()} as p; + +function {$f['name']}{$f['signature']} +{ + if ('{$testClass}' === TestListenerTrait::\$enabledPolyfills) { + {$f['return']}{$f['args']}; + } + + {$defLine}; +} +EOPHP + ); + } + if (!$warnings && null === $defLine) { + $warnings[] = new $SkippedTestError('No Polyfills found in bootstrap.php for '.$testClass); + } else { + $mainSuite->addTest(new TestListener($suite)); + } + } + foreach ($warnings as $w) { + $mainSuite->addTest($w); + } + } + + public function addError($test, \Exception $e, $time) + { + if (false !== self::$enabledPolyfills) { + $r = new \ReflectionProperty('Exception', 'message'); + $r->setAccessible(true); + $r->setValue($e, 'Polyfills enabled, '.$r->getValue($e)); + } + } +} diff --git a/phpMyAdmin/vendor/symfony/polyfill-util/composer.json b/phpMyAdmin/vendor/symfony/polyfill-util/composer.json new file mode 100755 index 0000000..318bf5d --- /dev/null +++ b/phpMyAdmin/vendor/symfony/polyfill-util/composer.json @@ -0,0 +1,34 @@ +{ + "name": "symfony/polyfill-util", + "type": "library", + "description": "Symfony utilities for portability of PHP codes", + "keywords": ["polyfill", "shim", "compat", "compatibility"], + "homepage": "https://symfony.com", + "license": "MIT", + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "require": { + "php": ">=5.3.3" + }, + "autoload": { + "psr-4": { "Symfony\\Polyfill\\Util\\": "" } + }, + "minimum-stability": "dev", + "extra": { + "branch-alias": { + "dev-main": "1.19-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + } +} diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/CHANGELOG.TXT b/phpMyAdmin/vendor/tecnickcom/tcpdf/CHANGELOG.TXT new file mode 100755 index 0000000..39970db --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/CHANGELOG.TXT @@ -0,0 +1,3106 @@ +6.6.2 (2022-12-17) + - Ensure pregSplit return type is always array. + - Add ability to run tests on various operating systems (#566) + - Avoid a deprecated error from PHP8.1 (#573) + +6.6.1 (2022-12-12) + - Add PHPStan and fix level 1 errors (#307) + +6.6.0 (2022-12-06) + - Multi-byte character support for filename during output (#561). (#562) + - Fix garbage collection (#509) + - FIX: PDF417 corrupt output problem, solution set bcmath scale parameter to zero (#534) + - Fix TypeError: count() in PHP8 (#556) + - Fix-getHTMLFontUnits (#547) + - Improved embedded image in HTML allowing src="data:..." format (#552) + - Fix image abscissa when in RTL (#510) + - fix: php 8.1 notices (#548) + - Optimize PNG files (#563) + - Update documentation for a known issue. (#569) + - Fix for PHP 8.1 (#571) + +6.5.0 (2022-08-12) + - encodeUrlQuery takes into account the port (#493) + - Fixing undefined offset error in writeHTML() when last DOM element ha鈥� + - correct some type hints (#495) + - fix: php 8.1 notices (#481) + - Fixed: null check for PHP 8.1 (#476) + - Fix Infinite Loop in Multicell with Auto Page Breaks Off (#473) + - GetCssBorderStyle Has Problem When !important Is Specified (#467) + - Support Apache 2.4 directives in htaccess file (#530) + - Remove examples from dist package (#542) + +6.4.4 (2021-12-31) + - PHP 8.1 fixes + +6.4.3 (2021-12-28) + - Fix MultiCell PHPDoc typehint (#407) + - Fix type hint for \TCPDF_STATIC::_freadint (#414) + - Footer and Header font phpdoc fixes + constructor $pdfa phpdoc fix + setHeaderData lw param fix (#402) + - Fix text-annotation state options (#412) + - Fix - Named links have been broken. This fixes. (#415) + - Fixed type in comment for $lw header image logo width in mm + - Change Set to set. Fixes #419 (#421) + - Fix failing tests and failing tests not marking exit code as 1 (#426) + - Fix phpdoc and prefer null as default value (#444) + - Run on PHP 8.1 normally and add nightly PHP as allowed to fail (#452) + - Fix AES128 encryption if the OpenSSL extension is installed (#453) + - Explicitly cast values to int for imagesetpixel (#460) + - Fix cell_height_ratio type (#405) + - Leave &NBSP; lowercase when using text-transform (#403) + +6.4.2 (2021-07-20) + - Fix PHP 8.1 type error with TCPDF_STATIC::pregSplit on preg_split + - Fix a PHP array offset error + - Fixed phpdoc blocks + - Drop a PHP 4 polyfill and add a .gitattributes file + - Added a test-suite + - Removed pointless assignments + - Fix docblock spelling error + - Update version info + - Fix color being filled to type 0 with PHP 8 + - Fix warnings for undefined tags for $lineStyle + - Normalized composer.json + - Allowed transparency in PDF/A-2 and PDF/A-3 + - Add a TCPDF composer example + - Fixed implicit conversion from float to int for PHP 8.1 + - Removed status.txt from font directories, because of filesize + - Fixed type hints + - Removed "U" modifier from regexes + +6.4.1 (2021-03-27) + - Update tcpdf version (no code changes) + +6.4.0 (2021-03-27) + - allow styles on
      tags + - check if file exists before calling unlink + - Fix image file type for urls with query params + - Fix SVGPath should accept 1.19.30 (equiv 1.19,.30) compacted values list + - Fix Second parameter of TCPDF::cell() must be a number + - PHP 8.0 function signature fixes + - Fix vulnerability to roman numeral bombs + - Optimized a regular expression + - Cache file get contents calls + - Remove mb_internal encoding handling + +6.3.5 (2020-02-14) + - Fixed curly braces in pdf417 + - Fixed a syntax error issue when accessing an index of a casted variable + +6.3.4 (2020-02-12) + - Check if imagekeys exist + - Unlink only images in cache + +6.3.3 (2020-02-12) + - Fixed PHP 7.4 - cannot use array offset on integers + - Fixed PDF/A-3B validation issue caused by missing pdfaSchema:property. + - Removed backup changelog files from repo + - Prevents the deletion of non-existent files in /tmp + - Prevent crash in case of no list access in cache path + - Check existence of file before delete it + - Fixed erase users pictures + - Fixed problem with $imagekeys undefined or unlinked + - Fix SVGPath elliptical arc with rx/ry=0 + z should return to initial point + - Fixed PHP 7.4 errors + - handle integers for pages + - Fixed background image doesn't work in RTL + - Fixed PDF/A validity + - Fixed datamatrix.php for PHP 7.4 + - Fixed deprecated PHP features + +6.3.2 (2019-09-20) + - Update ICC profile + +6.3.1 (2019-09-20) + - Fix reported version + - Fix Undefined property: GLPIPDF::$imagekeys + +6.3.0 (2019-09-19) + - fix SpotColor handling in HTML + - Add an additional empty test to prevent error in PHP 7.2 + - Fix the documentation how to calculate the cell height + - Drop duplicated array indices + - Fix TCPDF_STATIC::fileGetContents() + - Introduce other version of pdfA (2 and 3) + - Add UF and AFRelationship missing + - Fix performance issue of cloned instances + - Change glob to readdir which performs better + - URI in PDF can result in E_NOTICE + - Fix a warning for PHP 7.4 + - Fixed gradient offsets for percentage-based stops. + - Fixed file_get_contents return value should also be checked for a non-empty string + - Fix Array and string offset access syntax with curly braces is deprecated + - Fix PHP Warning: chr() expects parameter 1 to be int + - Add a VERSION file + +6.2.26 (2018-10-16) + - Update sRGB.icc with the one from the Debian package icc-profiles-free + - Fix unsupported operand types error when codepoints arrays are merged + +6.2.25 (2018-09-23) + - Fix support for image URLs. + +6.2.24 + - Support remote urls when checking if file exists. + +6.2.23 (2018-09-22) + - Simplify file_exists function. + +6.2.22 (2018-09-14) + - Fixes on `include/tcpdf_images.php`, `include/tcpdf_static.php` and `tcpdf.php` about file handling + +6.2.21 (2018-09-14) + - _no code changes_ + +6.2.20 (2018-09-14) + - Fix for security vulnerability: Using the phar:// wrapper it was possible to trigger the unserialization of user provided data. + +6.2.19 (2018-09-14) + - Merge various fixes for PHP 7.3 compatibility and security. + +6.2.13 (2016-06-10) + - IMPORTANT: A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support. This version should be considered obsolete, new projects should use the new version as soon it will become stable. + +6.2.12 (2015-09-12) + - fix composer package name to tecnickcom/tcpdf + +6.2.11 (2015-08-02) + - Bug #1070 "PNG regression in 6.2.9 (they appear as their alpha channel)" was fixed. + - Bug #1069 "Encoded SRC URLs in tags don't work anymore" was fixed. + +6.2.10 (2015-07-28) + - Minor mod to PNG parsing. + - Make dependency on mcrypt optional. + +6.2.8 (2015-04-29) + - Removed unwanted file. + +6.2.7 (2015-04-28) + - Merged PR 17: Avoid warning when iterating a non-array variable. + - Merged PR 16: Improve MuliCell param definition. + - Improved column check (PR 15). + - Merged PR 11: Use stream_is_local instead of limit to file://. + - Merged PR 10: ImageMagick link on README.txt. + +6.2.6 (2015-01-28) + - Bug #1008 "UTC offset sing breaks PDF/A-1b compliance" was fixed. + +6.2.5 (2015-01-24) + - Bug #1019 "$this in static context" was fixed. + - Bug #1015 "Infinite loop in getIndirectObject method of parser" was fixed. + +6.2.4 (2015-01-08) + - fix warning related to empty K_PATH_URL. + - fix error when a $table_colwidths key is not set. + +6.2.3 (2014-12-18) + - New comment. + - Moved the K_PATH_IMAGES definition in tcpdf_autoconfig. + +6.2.2 (2014-12-18) + - Fixed mispelled words. + - Fixed version number. + +6.2.1 (2014-12-18) + - The constant K_TCPDF_THROW_EXCEPTION_ERROR is now set to false in the default configuration file. + - An issue with the _destroy() method was fixed. + +6.2.0 (2014-12-10) + - Bug #1005 "Security Report, LFI posting internal files externally abusing default parameter" was fixed. + - Static methods serializeTCPDFtagParameters() and unserializeTCPDFtagParameters() were moved as non static to the main TCPDF class (see changes in example n. 49). + - Deprecated methods were removed, please use the equivalents defined in other classes (i.e. TCPDF_STATIC and TCPDF_FONTS). + - The constant K_TCPDF_CALLS_IN_HTML is now set by default to FALSE. + - DLE, DLX and DLP page format was added. + - Page format are now defined as a public property in TCPDF_STATIC. + +6.1.1 (2014-12-09) + - Fixed bug with the register_shutdown_function(). + +6.1.0 (2014-12-07) + - The method TCPDF_STATIC::getRandomSeed() was improved. + - The disk caching feature was removed. + - Bug #1003 "Backslashes become duplicated in table, using WriteHTML" was fixed. + - Bug #1002 "SVG radialGradient within non-square Rect" was fixed. + +6.0.099 (2014-11-15) + - Added basic support for nested SVG images (adapted PR from SamMousa). + - A bug related to setGDImageTransparency() was fixed (thanks to Maarten Boerema). + +6.0.098 (2014-11-08) + - Bug item #996 "getCharBBox($char) returns incorrect results for TTF glyphs without outlines" was fixed. + - Bug item #991 "Text problem with SVG" was fixed (only the font style part). + +6.0.097 (2014-10-20) + - Bug item #988 "hyphenateText - charmin parameter not work" was fixed. + - New 1D barcode method to print pre-formatted IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200. + +6.0.096 (2014-10-06) + - Bug item #982 "Display style is not inherited in SVG" was fixed. + - Bug item #984 "Double quote url in CSS" was fixed. + +6.0.095 (2014-10-02) + - Bug item #979 "New Timezone option overwriting current timezone" was fixed. + +6.0.094 (2014-09-30) + - Bug item #978 "Variable Undefined: $cborder" was fixed. + +6.0.093 (2014-09-02) + - Security fix: some serialize/unserialize methods were replaced with json_encode/json_decode to avoid a potential object injection with user supplied content. Thanks to ownCloud Inc. for reporting this issue. + - K_TIMEZONE constant was added to the default configuration to suppress date-time warnings. + +6.0.092 (2014-09-01) + - Bug item #956 "Monospaced fonts are not alignd at the baseline" was fixed. + - Bug item #964 "Problem when changing font size" was fixed. + - Bug item #969 "ImageSVG with radialGradient problem" was fixed. + - sRGB.icc file was replaced with the one from the Debian package icc-profiles-free (2.0.1+dfsg-1) + +6.0.091 (2014-08-13) + - Issue #325"Division by zero when css fontsize equals 0" was fixed. + +6.0.090 (2014-08-08) + - Starting from this version TCPDF is also available in GitHub at https://github.com/tecnickcom/TCPDF + - Function getmypid() was removed for better compatibility with shared hosting environments. + - Support for pulling SVG stroke opacity value from RGBa color was mergeg [adf006]. + - Bug item #951 "HTML Table within TCPDF columns doesnt flow correctly on page break ..." was fixed. + +6.0.089 (2014-07-16) + - Bug item #948 "bottom line of rowspan cell not work correctly" was fixed. + +6.0.088 (2014-07-09) + - Bug item #946 "Case sensitive type check causes broken match for SVG" was fixed. + - Bug item #945 "Imagick load doesn't account for passed data string " was fixed. + +6.0.087 (2014-06-25) + - A bug affecting fitcell option in Multicell was fixed. + +6.0.086 (2014-06-20) + - Bug item #938 "Hyphenation-dash extends outside of cell" was fixed (collateral effect). + +6.0.085 (2014-06-19) + - Some example images were replaced. + - A race condition bug was fixed. + - Bug item #938 "Hyphenation-dash extends outside of cell" was fixed. + +6.0.084 (2014-06-13) + - A bug related to MultiCell fitcell feature was fixed. + - Bug item #931 "Documentation error for setPageFormat()" was fixed. + +6.0.083 (2014-05-29) + - Bug item #928 "setHtmlVSpace with HR element" was fixed. + +6.0.082 (2014-05-23) + - Bug item #926 "test statement instead of assignment used in tcpdf_fonts.php" was fixed. + - Bug item #925 "924 transparent images bug" was fixed. + +6.0.081 (2014-05-22) + - Bug item #922 "writehtml tables thead repeating" was fixed. + - Patch #71 "External and internal links, local and remote" wa applied. + +6.0.080 (2014-05-20) + - Bug item #921 "Fatal error in hyphenateText() function" was fixed. + - Bug item #923 "Automatic Hyphenation error" was fixed. + - Patch #70 "Augument TCPDFBarcode classes with ability to return raw png image data" was applied. + +6.0.079 (2014-05-19) + - Patch item #69 "Named destinations, HTML internal and external links" was merged. + - Bug item #920 "hyphenateText() should not hyphenate the content of style-tags in HTML mode" was fixed. + - Image method now trigs an error in case the cache is now writeable. + - Fixed issue with layer default status. + +6.0.078 (2014-05-12) + - A warning issue in addTTFfont() method was fixed. + - Fonts were updated to include cbbox metrics. + +6.0.077 (2014-05-06) + - A Datamatrix barcode bug was fixed. + +6.0.076 (2014-05-06) + - A bug in Datamatrix Base256 encoding was fixed. + - Merged fix for SVG use/clip-gradient. + - Now it is possible to prefix a page number in Link methods with the * character to avoid been changed when adding/deleting/moving pages (see example_045.php). + +6.0.075 (2014-05-05) + - Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed. + +6.0.074 (2014-05-03) + - Part of Bug #917 "Using realtive Units like ex or em for images distort output in HTML mode" was fixed. + - Bug #915 "Problem with SVG Image using Radial Gradients" was fixed. + +6.0.073 (2014-04-29) + - Bug #913 "Possible bug with line-height" was fixed. + - Bug #914 "MultiCell and FitCell" was fixed. + - Bug #915 "Problem with SVG Image using Radial Gradients" was fixed. + +6.0.072 (2014-04-27) + - Deprecated curly braces substring syntax was replaced with square braces. + +6.0.071 (2014-04-25) + - Bug #911 "error with buffered png pics" was fixed. + +6.0.070 (2014-04-24) + - Bug #910 "An SVG image is being cut off (with clipping mask) when you use align options" was fixed. + +6.0.069 (2014-04-24) + - Datamatrix Base256 encoding was fixed. + +6.0.068 (2014-04-22) + - Some Datamatrix barcode bugs were fixed. + +6.0.067 (2014-04-21) + - startLayer() method signature was changed to include a new "lock" parameter. + +6.0.066 (2014-04-20) + - Bug #908 "Linebreak is not considered when getting length of the next string" was fixed. + +6.0.065 (2014-04-10) + - Bug #905 "RGB percentage color bug in convertHTMLColorToDec()" was fixed. + +6.0.064 (2014-04-07) + - Header and Footer fonts are now set by default. + - Bug #904 "PDF corrupted" was fixed. + +6.0.063 (2014-04-03) + - Method TCPDF_IMAGES::_parsepng() was fixed to support transparency in Indexed images. + +6.0.062 (2014-03-02) + - The method startLayer() now accepts the NULL value for the $print parameter to not set the print layer option. + +6.0.061 (2014-02-18) + - Bug #893 "Parsing error on streamed xref for secured pdf" was fixed. + +6.0.060 (2014-02-16) + - Bug #891 "Error on parsing hexa fields" was fixed. + - Bug #892 "Parsing pdf with trailing space at start" was fixed. + +6.0.059 (2014-02-03) + - SVG 'use' support was imporved. + +6.0.058 (2014-01-31) + - Bug #886 "Bugs with SVG using and " was fixed. + +6.0.057 (2014-01-26) + - Bug #883 "Parsing error" was fixed. + +6.0.056 (2014-01-25) + - The automatic cache folder selection now works also with some restricted hosting environments. + - CSS text-transform property is now supported (requires the multibyte string library for php) - see examle n. 061 (Thanks to Walter Ferraz). + - Bug #884 "Parsing error prev tag looking for" was fixed. + +6.0.055 (2014-01-15) + - Bug #880 "Error detecting hX tags (h1,h2..)" was fixed + - Bug #879 "Thead on the second page inherits style of previous tr" was fixed + +6.0.054 (2014-01-13) + - Bug #877 "Parenteses causing corrupt text" was fixed. + +6.0.053 (2014-01-03) + - Bug #876 "Cell padding should not be multiplied with number of lines in getStringHeight" was fixed. + - Patch #68 "Empty img src attribute leads to access of uninitialized string offset" was applied. + +6.0.052 (2013-12-12) + - Bug #871 "Datamatrix coding" was fixed. + +6.0.051 (2013-12-02) + - cbbox array values in addTTFfont() were converted to integers. + +6.0.050 (2013-12-01) + - The method getNumLines() was extended to support hyphenation. + - The CSS property line-height now supports non percentage values. + +6.0.050 (2013-11-27) + - A bug related to PNG images was fixed. + +6.0.048 (2013-11-24) + - SVG vars are now reset in ImageSVG() method. + +6.0.047 (2013-11-19) + - SVG support was extended to support some nested defs. + +6.0.046 (2013-11-17) + - preg_replace_callback functions were replaced to improve memory performances. + +6.0.045 (2013-11-17) + - Bug #862 "Parsing error on flate filter" was fixed. + +6.0.044 (2013-11-10) + - Bug #857 "Undefined offset error" was fixed. + - The uniord method now uses a static cache to improve performances (thanks to Mathieu Masseboeuf for the sugegstion). + - Two bugs in the TCPDF_FONTS class were fixed. + +6.0.043 (2013-10-29) + - Bug #854 "CSS instruction display" was fixed. + +6.0.042 (2013-10-25) + - Bug #852 "CMYK Colors Bug" was fixed. + +6.0.041 (2013-10-21) + - Bug #851 "Problem with images in PDF. PHP timing out" was fixed. + +6.0.040 (2013-10-20) + - Bug #849 "SVG import bug" was fixed. + +6.0.039 (2013-10-13) + - Bug #843 "Wrong call in parser" was fixed. + - Bug #844 "Wrong object type named" was fixed. + - Bug #845 "Parsing error on obj ref prefixed by '000000'" was fixed. + +6.0.038 (2013-10-06) + - Bug #841 "Division by zero warning at writeHTML a
    • tag" was fixed. + +6.0.037 (2013-09-30) + - Method getAllSpotColors() was added to return all spot colors. + - Method colorRegistrationBar() was extended to automatically print all spot colors and support individual spot colors. + - The method registrationMarkCMYK() was added to print a registration mark for CMYK colors. + - A bug related to page groups was fixed. + - Gradient() method now supports CMYK equivalents of spot colors. + - Example n. 56 was updated. + +6.0.036 (2013-09-29) + - Methods for registration bars and crop marks were extended to support registration color (see example n. 56). + - New default spot colors were added to tcpdf_colors.php, including the 'All' and 'None' special registration colors. + +6.0.035 (2013-09-25) + - TCPDF_PARSER class was improved. + +6.0.034 (2013-09-24) + - Bug #839 "Error in xref parsing in mixed newline chars" was fixed. + +6.0.033 (2013-09-23) + - Bug fix related to PNG image transparency using GD library. + +6.0.032 (2013-09-23) + - Bug #838 "Fatal error when imagick cannot handle the image, even though GD is available and can" was fixed. + +6.0.031 (2013-09-18) + - Bug #836 "Optional EOL marker before endstream" was fixed. + - Some additional controls were added to avoid "division by zero" error with badly formatted input. + +6.0.030 (2013-09-17) + - Bug #835 "PDF417 and Cyrilic simbols" was fixed. + +6.0.029 (2013-09-15) + - Constants K_TCPDF_PARSER_THROW_EXCEPTION_ERROR and K_TCPDF_PARSER_IGNORE_DECODING_ERRORS where removed in favor of a new configuration array in the TCPDF_PARSER class. + - The TCPDF_PARSER class can now be configured using the new $cfg parameter. + +6.0.028 (2013-09-15) + - A debug print_r was removed form tcpdf_parser.php. + - TCPDF_FILTERS class now throws an exception in case of error. + - TCPDF_PARSER class now throws an exception in case of error unless you define the constant K_TCPDF_PARSER_THROW_EXCEPTION_ERROR to false. + - The constant K_TCPDF_PARSER_IGNORE_DECODING_ERRORS can be set to tru eto ignore decoding errors on TCPDF_PARSER. + +6.0.027 (2013-09-14) + - A bug in tcpdf_parser wen parsing hexadecimal strings was fixed. + - A bug in tcpdf_parser wen looking for statxref was fixed. + - A bug on RC4 encryption was fixed. + +6.0.026 (2013-09-14) + - A bug in tcpdf_parser wen decoding streams was fixed. + +6.0.025 (2013-09-04) + - A pregSplit() bug was fixed. + - Improved content loading from URLs. + - Improved font path loading. + +6.0.024 (2013-09-02) + - Bug #826 "addEmptySignatureAppearance issue" was fixed. + +6.0.023 (2013-08-05) + - GNU Freefont fonts were updated. + - Licensing and copyright information about fonts were improved. + - PNG image support was improved. + +6.0.022 (2013-08-02) + - fixing initialization problem for signature_appearance property. + +6.0.021 (2013-07-18) + - The bug caused by the preg_split function on some PHP 5.2.x versions was fixed. + +6.0.020 (2013-06-04) + - The method addTTFfont() was fixed (Bug item #813 Undefined offset). + +6.0.019 (2013-06-04) + - The magic constant __DIR__ was replaced with dirname(__FILE__) for php 5.2 compatibility. + - The exceptions raised by file_exists() function were suppressed. + +6.0.018 (2013-05-19) + - The barcode examples were changed to automatically search for the barcode class path (in case the examples directory is not installed under the TCPDF root). + +6.0.017 (2013-05-16) + - The command line tool tcpdf_addfont.php was improved. + - The php logic was removed from configuration files that now contains only constant defines. + - The tcpdf_autoconfig.php file was added to automatically set missing configuration values. + +6.0.016 (2013-05-15) + - The tcpdf_addfont.php tool was improved (thanks to Remi Collet). + - Constant K_PATH_IMAGES is now automatically set in configuration file. + +6.0.015 (2013-05-14) + - Some unused vars were removed from AddFont() method. + - Some directories were moved inside the examples directory. + - All examples were updated to reflect the new default structure. + - Source code were clean-up up to be more compatible with system packaging. + - Files encodings and permissions were reset. + - The command line tool tcpdf_addfont.php was added on the tools directory. + +6.0.014 (2013-04-13) + - The signature of addTTFfont() method includes a new parameter to link existing fonts instead of copying and compressing them. + +6.0.013 (2013-04-10) + - Add support for SVG dx and dy text/tspan attributes. + - replace require() with require_once(). + - fix some minor typos on documentation. + - fix a problem when deleting all pages. + +6.0.012 (2013-04-24) + - An error condition in addHtmlLink() method was fixed (bug #799). + +6.0.011 (2013-04-22) + - Minor documentation changes. + +6.0.010 (2013-04-03) + - The method Rect() was fixed to print borders correctly. + +6.0.009 (2013-04-02) + - Adding back some files that were not properly committed on the latest release. + +6.0.008 (2013-04-01) + - Duplicated encoding maps was removed from tcpdf_font_data.php. + - Fixing bug on AddTTFFont(). + +6.0.007 (2013-03-29) + - HTML/CSS font size conversion were improved. + +6.0.006 (2013-03-27) + - Bug related to SVG and EPS files on xobjects were fixed. + +6.0.005 (2013-03-26) + - Default font path was fixed. + +6.0.004 (2013-03-21) + - Return value of addTTFfont() method was fixed. + +6.0.003 (2013-03-20) + - A bug related to non-unicode mode was fixed. + +6.0.002 (2013-03-18) + - _getFIXED call on tcpdf_fonts.php was fixed. + +6.0.001 (2013-03-18) + - Fixed $uni_type call on tcpdf.php. + +6.0.000 (2013-03-17) + - IMPORTANT: PHP4 support has been removed starting from this version. + - Several TCPDF methods and vars were moved to new class files: tcpdf_static.php, tcpdf_colors.php, tcpdf_images.php, tcpdf_font_data.php, tcpdf_fonts.php. + - Files htmlcolors.php, spotcolors.php, unicode_data.php and ecodings_maps.php were removed. + - Barcode classes were renamed and new barcode examples were added. + - Class TCPDF_PARSER was improved. + +******************************************************************************** + +5.9.209 (2013-03-15) + - Image method was improved. + +5.9.208 (2013-03-15) + - objclone function was patched to support old imagick extensions. + - tcpdf_parser was improved to support Cross-Reference Streams and large streams. + +5.9.207 (2013-03-04) + - Datamatrix class was fixed (a debug echo was removed). + +5.9.206 (2013-02-22) + - Bug item #754 "PNG with alpha channel becomes gray scale" was fixed. + - Minor documentation fixes. + +5.9.205 (2013-02-06) + - The constant K_TCPDF_THROW_EXCEPTION_ERROR was added on configuration file to change the behavior of Error() method. + - PDF417 barcode bug was fixed. + +5.9.204 (2013-01-23) + - The method Bookmark() was extended to include named destinations, URLs, internal links or embedded files (see example n. 15). + - automatic path calculation on configuration file was fixed. + - Error() method was extended to throw new Exception if PHP > 5. + +5.9.203 (2013-01-22) + - Horizontal position of radiobuttons and checkboxes was adjusted. + +5.9.202 (2012-12-16) + - Vertical space problem after table was fixed. + +5.9.201 (2012-12-10) + - First 256 chars are now always included on font subset to overcome a problem reported on the forum. + +5.9.200 (2012-12-05) + - Bug item #768 "Rowspan with Pagebreak error" was fixed. + - Page regions now works also with limited MultiCell() cells. + +5.9.199 (2012-11-29) + - Internal setImageBuffer() method was improved. + +5.9.198 (2012-11-19) + - Datamatrix EDIFACT mode was fixed. + +5.9.197 (2012-11-06) + - Bug item #756 "TCPDF 5.9.196 shows line on top of all PDFs" was fixed. + +5.9.196 (2012-11-02) + - Several methods were improved to avoid output when the context is out of page. + - Bug item #755 "remove cached files before unsetting" was fixed. + +5.9.195 (2012-10-24) + - Method _putfonts() was improved. + +5.9.194 (2012-10-23) + - Text alignment on TextField() method was fixed. + +5.9.193 (2012-09-25) + - Support for named destinations on HTML links was added (i.e.: link to named destination). + +5.9.192 (2012-09-24) + - A problem on the releasing process was fixed. + +5.9.191 (2012-09-24) + - SVG image naow support svg and eps images. + +5.9.190 (2012-09-23) + - "page" word translation is now set to empty if not defined. + - Tooltip feature was added on the radiobutton annotation. + +5.9.189 (2012-09-18) + - Bug item #3568969 "ini_get safe_mode error" was fixed. + +5.9.188 (2012-09-15) + - A datamatrix barcode bug was fixed. + +5.9.187 (2012-09-14) + - Subset feature was extended to include the first 256 characters. + +5.9.186 (2012-09-13) + - barcodes.php file was resynced. + - Methods SetAbsX, SetAbsY, SetAbsXY where added to set the absolute pointer coordinates. + - Method getCharBBox were added to get single character bounding box. + - Signature of addTTFfont method was changed ($addcbbox parameter was added). + +5.9.185 (2012-09-12) + - Method _putfontwidths() was fixed. + +5.9.184 (2012-09-11) + - A problem with EAN barcodes was fixed. + +5.9.183 (2012-09-07) + - A problem with font names normalization was fixed. + +5.9.182 (2012-09-05) + - Bug item #3564982 "Infinite loop in Write() method" was fixed. + +5.9.181 (2012-08-31) + - composer.json file was added. + - Bug item #3563369 "Cached images are not unlinked some time" was fixed. + +5.9.180 (2012-08-22) + - Bug item #3560493 "Problems with nested cells in HTML" was fixed. + +5.9.179 (2012-08-04) + - SVG 'use' tag was fixed for 'circle' and 'ellipse' shift problem. + - Alpha status is now correctly stored and restored by getGraphicVars() and SetGraphicVars() methods. + +5.9.178 (2012-08-02) + - SVG 'use' tag was fixed for 'circle' and 'ellipse'. + +5.9.177 (2012-08-02) + - An additional control on annotations was fixed. + +5.9.176 (2012-07-25) + - A bug related to stroke width was fixed. + - A problem related to font spacing in HTML was fixed. + +5.9.175 (2012-07-25) + - The problem of missing letter on hyphen break was fixed. + +5.9.174 (2012-07-25) + - The problem of wrong filename when downloading PDF from an Android device was fixed. + - The method setHeaderData() was extended to set text and line color for header (see example n. 1). + - The method setFooterData() was added to set text and line color for footer (see example n. 1). + - The methods setTextShadow() and getTextShadow() were added to set text shadows (see example n. 1). + - The GetCharWidth() method was fixed for negative character spacing. + - A 'none' border mode is now correctly recognized. + - Break on hyphen problem was fixed. + +5.9.173 (2012-07-23) + - Some additional control wher added on barcode methods. + - The option CURLOPT_FOLLOWLOCATION on Image method is now disabled if PHP safe_mode is on or open_basedir is set. + - Method Bookmark() was extended to include X parameter. + - Method setDestination() was extended to include X parameter. + - A problem with Thai language was fixed. + +5.9.172 (2012-07-02) + - A PNG color profile issue was fixed. + +5.9.171 (2012-07-01) + - Some SVG rendering problems were fixed. + +5.9.170 (2012-06-27) + - Bug #3538227 "Numerous errors inserting shared images" was fixed. + +5.9.169 (2012-06-25) + - Some SVG rendering problems were fixed. + +5.9.168 (2012-06-22) + - Thai language rendering was fixed. + +5.9.167 (2012-06-22) + - Thai language rendering was fixed and improved. + - Method isCharDefined() was improved. + - Protected method replaceChar() was added. + - Font "kerning" word was corrected to "tracking". + +5.9.166 (2012-06-21) + - Array to string conversion on file_id creation was fixed. + - Thai language rendering was fixed (thanks to Atsawin Chaowanakritsanakul). + +5.9.165 (2012-06-07) + - Some HTML form related bugs were fixed. + +5.9.164 (2012-06-06) + - A bug introduced on the latest release was fixed. + +5.9.163 (2012-06-05) + - Method getGDgamma() was changed. + - Rendering performances of PNG images with alpha channel were improved. + +5.9.162 (2012-05-11) + - A bug related to long text on TD cells was fixed. + +5.9.161 (2012-05-09) + - A bug on XREF table was fixed (Bug ID: 3525051). + - Deprecated Imagick:clone was replaced. + - Method objclone() was fixed for PHP4. + +5.9.160 (2012-05-03) + - A bug on tcpdf_parser.php was fixed. + +5.9.159 (2012-04-30) + - Barcode classes were updated to fix PNG export Bug (ID: 3522291). + +5.9.158 (2012-04-22) + - Some SVG-related bugs were fixed. + +5.9.157 (2012-04-16) + - Some SVG-related bugs were fixed. + +5.9.156 (2012-04-10) + - Bug item #3515885 "TOC and booklet: left and right page exchanged". + - SetAutoPageBreak(false) now works also in multicolumn mode. + +5.9.155 (2012-04-02) + - Bug item #3512596 "font import problems" was fixed. + - Method addTTFfont() was modified to extract only specified Platform ID and Encoding ID (check the source code documentation). + - All fonts were updated. + - Bug item #3513867 "booklet and setHeaderTemplateAutoreset: header shifted left" was fixed. + - Bug item #3513749 "TCPDF Superscript/Subscript" was fixed. + +5.9.154 (2012-03-29) + - A debug echo was removed. + +5.9.153 (2012-03-28) + - A bug on font conversion was fixed. + - All fonts were updated. + - Method isCharDefined() was added to find if a character is defined on the selected font. + - Method replaceMissingChars() was added to automatically replace missing chars on selected font. + - SetFont() method was fixed. + +5.9.152 (2012-03-23) + - The following overprint methods were added: setOverprint(), getOverprint(). + - Signature of setAlpha() method was changed and method getAlpha() was added. + - stroke-opacity support was added on SVG. + - The following date methods were added: setDocCreationTimestamp(), setDocModificationTimestamp(), getDocCreationTimestamp(), getDocModificationTimestamp(), getFormattedDate(), getTimestamp(). + - Signature of _datestring() method was changed. + - Method getFontBBox() was added. + - Method setPageBoxTypes() was aded. + +5.9.151 (2012-03-22) + - Bug item #3509889 "Transform() distorts PDF" was fixed. + - Precision of real number were extended. + - ComboBox and ListBox methods were fixed. + - Bulgarian language file was added. + - addTOC() method was improved to include bookmark color and font style. + +5.9.150 (2012-03-16) + - A bug related to form fields in PDF/A mode was fixed. + +5.9.149 (2012-02-21) + - Bug item #3489933 "SVG Parser treats tspan like text" was fixed. + +5.9.148 (2012-02-17) + - Bug item #3488600 "Multiple radiobutton sets get first set value" was fixed. + +5.9.147 (2012-02-14) + - A problem with SVG gradients has been fixed. + +5.9.146 (2012-02-12) + - Bug item #3486880 "$filehash undefine error" was fixed. + - The default font is now the one specified at PDF_FONT_NAME_MAIN constant. + +5.9.145 (2012-01-28) + - Japanese language file was added. + - TCPDF license and README.TXT files were updated. + +5.9.144 (2012-01-12) + - HTML output on barcode classes was improved. + +5.9.143 (2012-01-08) + - Bug item #3471057 "setCreator() has no effect" was fixed. + +5.9.142 (2011-12-23) + - Source code documentation was updated. + +5.9.141 (2011-12-14) + - Some minor bugs were fixed. + +5.9.140 (2011-12-13) + - SVG now supports embedded images encoded as base64. + +5.9.139 (2011-12-11) + - Spot color methods were fixed. + +5.9.138 (2011-12-10) + - cropMark() method was improved (check source code documentation). + - Example n. 56 was updated. + - Bug item #3452390 "Check Box still not ticked when set to true" was fixed. + +5.9.137 (2011-12-01) + - Bug item #3447005 "Background color and border of Form Elements is printed" was fixed. + - Color support for Form elements was improved. + +5.9.136 (2011-11-27) + - Bug item #3443387 "SetMargins with keep option does not work for top margin" was fixed. + +5.9.135 (2011-11-04) + - Bug item #3433406 "Double keywords in description" was fixed. + +5.9.134 (2011-10-29) + - The default value for $defcol parameter on convertHTMLColorToDec() method was fixed. + - Deafult HTTP headers were changed to avoid browser caching. + - Some deprecated syntax were replaced. + +5.9.133 (2011-10-26) + - Bug item #3428446 "copyPage method not working when diskcache enabled" was fixed. + +5.9.132 (2011-10-20) + - Bug item #3426167 "bug in function convertHTMLColorToDec()" was fixed. + +5.9.131 (2011-10-13) + - An error message was added to ImagePngAlpha() method. + +5.9.130 (2011-10-12) + - Now you can set image data strings on HTML img tag by encoding the image binary data in this way: $imgsrc = '@'.base64_encode($imgdata); + +5.9.129 (2011-10-07) + - Core fonts metrics was fixed (replace all helvetica and times php files on fonts folder). + - Form fields support was improved and some problems were fixed (check the example n. 14). + - Bug item #3420249 "Issue with booklet and MultiCell" was fixed. + +5.9.128 (2011-10-06) + - Method addTTFfont() was improved (check the source code documentation). + - Method setExtraXMP() to set custom XMP data was added. + +5.9.127 (2011-10-04) + - Readonly mode option was activated for radiobuttons. + +5.9.126 (2011-10-03) + - Bug item #3417989 "Graphics State operator in form XObject fails to render" was fixed. + - Xobjects problems with transparency, gradients and spot colors were fixed. + +5.9.125 (2011-10-03) + - Support for 8-digit CMYK hexadecimal color representation was added (to be used with XHTML and SVG). + - Spot colors support was improved (check example n. 37). + - Color methods were improved. + +5.9.124 (2011-10-02) + - Core fonts were updated. + +5.9.123 (2011-10-02) + - The method addTTFfont() wad added to automatically convert TTF fonts (check the new fonts guide at http://www.tcpdf.org). + - Old font utils were removed. + - All fonts were updated and new arabic fonts were added (almohanad were removed and replaced by aefurat and aealarabiya). + - The file unicode_data.php was updated. + - The file encodings_maps.php was added. + - PDF/A files are now compressed to save space. + - XHTML input form fields now support text-alignment attribute. + +5.9.122 (2011-09-29) + - PDF/A-1b compliance was improved to pass some online testing. + +5.9.121 (2011-09-28) + - This version includes support for PDF/A-1b format (the class constructor signature was changed - see example n. 65). + - Method setSRGBmode() was added to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document (file sRGB.icc was added). + - 14 new fonts were added to allow embedding core fonts (for PDF/A compliance). + - Font utils were fixed. + +5.9.120 (2011-09-22) + - This version includes a fix for _getTrueTypeFontSubset() method. + +5.9.119 (2011-09-19) + - This version includes a fix for extra page numbering on TOC. + +5.9.118 (2011-09-17) + - This version includes some changes that allows you to add a bookmark for a page that do not exist. + +5.9.117 (2011-09-15) + - TCPDFBarcode and TCPDF2DBarcode classes were extended to include a method for exporting barcodes as PNG images. + +5.9.116 (2011-09-14) + - Datamatrix class was improved and documentation was fixed. + +5.9.115 (2011-09-13) + - Datamatrix ECC200 barcode support was added (a new datamatrix.php file was added) - check example n. 50. + - getBarcodeHTML() method was added on TCPDFBarcode and TCPDF2DBarcode classes to return an HTML representation of the barcode. + - cURL options on Image() method were improved. + - A bug on write2DBarcode() was fixed. + +5.9.114 (2011-09-04) + - A bug related to column position was fixed. + +5.9.113 (2011-08-24) + - This release include two new experimental files for parsing an existing PDF document (the integration with TCPDF is under development). + +5.9.112 (2011-08-18) + - A newline character was added after the 'trailer' keyword for compatibility with some parsers. + - Support for layers was improved. + +5.9.111 (2011-08-17) + - Barcode CODE 39 default gap was restored at 1. + +5.9.110 (2011-08-17) + - Barcode CODE 39 was fixed. + +5.9.109 (2011-08-12) + - Method getNumLines() was fixed. + - A bug related to page break in multi-column mode was fixed. + +5.9.108 (2011-08-09) + - A bug on PHP4 version was fixed. + +5.9.107 (2011-08-08) + - This version includes a minor bugfix. + +5.9.106 (2011-08-04) + - This version includes transparency groups: check the new parameter on startTemplate() method and example 62. + +5.9.105 (2011-08-04) + - Bug item #3386153 "Check Box not ticked when set to true" was fixed. + +5.9.104 (2011-08-01) + - Bug item #3383698 "imagemagick, resize and dpi" was fixed. + +5.9.103 (2011-07-16) + - Alignment of XHTML lines was improved. + - Spell of the "length" word was fixed. + +5.9.102 (2011-07-13) + - Methods startLayer() and endLayer() were added to support arbitrary PDF layers. + - Some improvements/fixes for images were added (thanks to Brendan Abbott). + +5.9.101 (2011-07-07) + - Support for JPEG and PNG ICC Color Profiles was added. + - Method addEmptySignatureAppearance() was added to add empty signature fields (see example n. 52). + - Bug item #3354332 "Strange line spacing with reduced font-size in writeHTML" was fixed. + +5.9.100 (2011-06-29) + - An SVG bug has been fixed. + +5.9.099 (2011-06-27) + - Bug item #3335045 "Font freesans seems somehow corrupted in footer" was fixed. + +5.9.098 (2011-06-23) + - The Named Destination feature was fixed. + +5.9.097 (2011-06-23) + - The method setHtmlVSpace() now can be used also for tags: div, li, br, dt and dd. + - The Named Destination feature was added (check the example n. 15) - thanks to Christian Deligant. + +5.9.096 (2011-06-19) + - Bug item #3322234 "Surrogate pairs codes in arrUTF8ToUTF16BE" was fixed. + +5.9.095 (2011-06-18) + - Numbers alignment for Table-Of-Content methods was improved and fixed. + - Font subsetting was fixed to include all parts of composite fonts. + +5.9.094 (2011-06-17) + - Bug item #3317898 "Page Group numbering broken in 5.9.093" was fixed. + +5.9.093 (2011-06-16) + - Method setStartingPageNumber() was added to set starting page number (for automatic page numbering). + +5.9.092 (2011-06-15) + - Method _putpages() was improved. + - Bug item #3316678 "Memory overflow when use Rotate and SetAutoPageBreak" was fixed. + - Right alignment of page numbers was improved. + +5.9.090 (2011-06-14) + - Methods AliasNbPages() and AliasNumPage() were re-added as deprecated for backward compatibility. + +5.9.089 (2011-06-13) + - Example n. 8 was updated. + - Method sendOutputData() was changed to remove default compression (it was incompatible with some server settings). + - Bugs related to page group numbers were fixed. + - Method copyPage() was fixed. + - Method Image() was improved to include support for alternative and external images. + +5.9.088 (2011-06-01) + - Method getAutoPageBreak() was added (see example n. 51). + - Example n. 51 (full page background) was updated. + +5.9.087 (2011-06-01) + - Method sendOutputData() was improved to include deflate encoding. + - Barcode classes on PHP 4 version were fixed. + +5.9.086 (2011-05-31) + - Font files were updated (the ones on the previous release were broken). + - The script fonts/utils/makeallttffonts.php was updated and fixed. + - Output() method was improved to use compression when available. + +5.9.085 (2011-05-31) + - TCPDFBarcode class (barcodes.php) now includes getBarcodeSVG() and getBarcodeSVGcode() methods to get SVG image representation of the barcode. + - TCPDF2DBarcode class (2dbarcodes.php) now includes getBarcodeSVG() and getBarcodeSVGcode() methods to get SVG image representation of the barcode. + +5.9.084 (2011-05-29) + - Font files were updated. + - The file fonts/utils/makeallttffonts.php was updated. + - Bug item# 3308774 "Problems with font subsetting" was fixed. + +5.9.083 (2011-05-24) + - Bug item #3308387 "line height & SetCellHeightRatio" was fixed. + +5.9.082 (2011-05-22) + - Bug item #3305592 "Setting fill color <> text color breaks text clipping" was fixed. + +5.9.081 (2011-05-18) + - Method resetHeaderTemplate() was added to reset the xobject template used by Header() method. + - Method setHeaderTemplateAutoreset() was added to automatically reset the xobject template used by Header() method at each page. + +5.9.080 (2011-05-17) + - A problem related to file path calculation for images was fixed. + - A problem related to unsuppressed getimagesize() error was fixed. + +5.9.079 (2011-05-16) + - Footer() method was changed to use C128 barcode as default (instead of the previous C128B). + +5.9.078 (2011-05-12) + - Bug item #3300878 "wrong rendering for html bullet list in some case" was fixed. + - Bug item #3301017 "Emphasized vs. font-weight" was fixed. + - Barcode Code 128 was improved to include AUTO mode (automatically switch between A, B and C modes). + - Examples n. 27 and 49 were updated. + +5.9.077 (2011-05-07) + - Bug item #3298591 "error code93" was fixed. + - SetLineStyle() function was improved. + +5.9.076 (2011-05-06) + - Bug item #3298264 "codebar 93 error" was fixed. + +5.9.075 (2011-05-02) + - Table header alignment when using WriteHTMLCell() or MultiCell() was fixed. + +5.9.074 (2011-04-28) + - Bug item #3294306 "CSS classes not work in table section" was fixed. + +5.9.073 (2011-04-27) + - A bug related to character entities on HTML cells was fixed. + +5.9.072 (2011-04-26) + - Method resetColumns() was added to remove multiple columns and reset page margins (example n. 10 was updated). + +5.9.071 (2011-04-19) + - Bug #3288574 "
      trouble" was fixed. + +5.9.069 (2011-04-19) + - Bug #3288763 "HTML-Table: non-breaking table rows: Bug" was fixed. + +5.9.068 (2011-04-15) + - Bookmark, addTOC and addHTMLTOC methods were improved to include font style and color (Examples 15, 49 and 59 were updated). + - Default $_SERVER['DOCUMENT_ROOT'] value on tcpdf_config.php file was changed. + +5.9.067 (2011-04-10) + - Performances were drastically improved (PDF documents are now created more quickly). + +5.9.066 (2011-04-09) + - A bug related to digital signature + encryption was fixed. + - A bug related to encryption + xobject templates was fixed. + +5.9.065 (2011-04-08) + - Bug item #3280512 "Text encoding iso-8859-2 crashes" was fixed. + +5.9.064 (2011-04-05) + - A bug related to character entities on HTML cells was fixed. + +5.9.063 (2011-04-01) + - Bug item #3267235 "WriteHTML() and image that doesn't fit on the page" was fixed. + +5.9.062 (2011-03-23) + - Bug item #3232650 "Using Write if there are pageRegions active creates error" was fixed. + - Bug item #3221891 "text input borders" was fixed. + - Bug item #3228958 "Adobe Reader 9.4.2 crash" was fixed. + +5.9.061 (2011-03-15) + - Bug item #3213488 "wrong function call in function Write" was fixed. + - Bug item #3203007 "list element with black background" was fixed. + +5.9.060 (2011-03-08) + - addTOC() method was fixed for text alignment problems. + +5.9.059 (2011-02-27) + - Default Header() method was improved to reduce document size. + +5.9.058 (2011-02-25) + - Image() method was improved to cache images with transparency layers (thanks to Korneliusz Jarz臋bski for reporting this problem). + +5.9.057 (2011-02-24) + - A problem with image caching system was fixed (thanks to Korneliusz Jarz臋bski for reporting this problem). + +5.9.056 (2011-02-22) + - A bug on fixHTMLCode() method was fixed. + - Automatic line break for HTML was fixed. + +5.9.055 (2011-02-17) + - Another bug related to HTML table page break was fixed. + +5.9.054 (2011-02-16) + - A bug related to HTML table page break was fixed. + +5.9.053 (2011-02-16) + - Support for HTML attribute display="none" was added. + +5.9.052 (2011-02-15) + - A bug related to HTML automatic newlines was fixed. + +5.9.051 (2011-02-12) + - "Commas at beginning of new lines" problem was fixed. + +5.9.050 (2011-02-11) + - Bug #3177606 "SVG Bar chart error" was fixed. + +5.9.049 (2011-02-03) + - Bug #3170777 "TCPDF creates a new page after a single line in writeHTML" was fixed. + +5.9.048 (2011-02-02) + - No changes. Just released to override previous release that was not uploaded correctly. + +5.9.047 (2011-01-28) + - Bug #3167115 "PDF error in (example 48)" was fixed (was introduced in 5.8.046). + +5.9.046 (2011-01-18) + - PDF view/print layers are now automatically turned off if not used (see setVisibility() method). + +5.9.045 (2011-01-17) + - HTML list support were improved. + +5.9.044 (2011-01-15) + - Bug #3158422 "writeHTMLCell Loop" was fixed. + - Some HTML image alignment problems were fixed. + +5.9.043 (2011-01-14) + - Bug #3158178 "PHP Notice" was fixed. + - Bug #3158193 "Endless loop in writeHTML" was fixed. + - Bug #3157764 "SVG Pie chart incorrectly rendered2". + +5.9.042 (2011-01-14) + - Some problems of the PHP4 version were fixed. + +5.9.041 (2011-01-13) + - A problem with SVG elliptical arc path was fixed (ref. bug #3156574). + - A problem related to font weight on HTML table headers was fixed. + +5.9.040 (2011-01-12) + - A bug related to empty pages after table was fixed. + +5.9.039 (2011-01-12) + - Bug item #3155759 "openssl_random_pseudo_bytes() slow under Windows" was fixed. + +5.9.038 (2011-01-11) + - Minor bugs were fixed. + +5.9.037 (2011-01-09) + - An alignment problem for HTML texts was fixed. + +5.9.036 (2011-01-07) + - A bug related to HTML tables on header was fixed. + +5.9.035 (2011-01-03) + - A problem related to HTML table border alignment was fixed. + - Bug #2996366 "FastCGI and Header Problems" was fixed. + +5.9.034 (2010-12-19) + - DejaVu and GNU Free fonts were updated. + +5.9.033 (2010-12-18) + - Source code documetnation was improved. + +5.9.032 (2010-12-18) + - Default font stretching and spacing values are now inherited by HTML methods. + +5.9.031 (2010-12-16) + - Source code documentation errors were fixed. + +5.9.030 (2010-12-16) + - Several source code documentation errors were fixed. + - Source code style was changed for Doxygen. + - Source code documentation was moved online to http://www.tcpdf.org + +5.9.029 (2010-12-04) + - The $fitbox parameter on Image() method was extended to specify image alignment inside the box (check the example n. 9). + +5.9.028 (2010-12-03) + - Font utils makefont.php and makeallttffonts.php were updated. + +5.9.027 (2010-12-01) + - Spot Colors are now better integrated with HTML mode. + - Method SetDocInfoUnicode() was added to turn on/off Unicode mode for document information dictionary (meta tags) - check the example n. 19. + +5.9.026 (2010-12-01) + - A problem with mixed text directions on HTML was fixed. + +5.9.025 (2010-12-01) + - The AddSpotColor() now automatically fills the spotcolor array (defined on spotcolors.php file). + +5.9.024 (2010-11-30) + - Bug item #3123612 "SVG not use gradientTransform in percentage mode" was fixed. + +5.9.023 (2010-11-25) + - A potential bug on SVG transcoder was fixed. + +5.9.022 (2010-11-21) + - Method ImageEPS includes support for EPS/AI Spot colors. + - Method ImageEPS includes a new parameter $fixoutvals to remove values outside the bounding box. + +5.9.021 (2010-11-20) + - Support for custom bullet points images was added (check the example n.6) + - Examples n. 6 and 61 were update (check the comments inside). + +5.9.020 (2010-11-19) + - A problem related to additional page when using multicolumn mode was fixed. + +5.9.019 (2010-11-19) + - An SVG bug was fixed. + - ImageSVG() and ImageEPS() methods now accepts image data streams (put the string on the $file parameter preceded by '@' character). + - Option 'E' was added to the $dest parameter of Output() method to return the document as base64 mime multi-part email attachment (RFC 2045). + +5.9.018 (2010-11-19) + - An SVG bug was fixed. + +5.9.017 (2010-11-16) + - Tagline color was set to transparent. + - The method fixHTMLCode() was added to automatically clean up HTML code (requires HTML Tidy). + +5.9.016 (2010-11-16) + - Bug item #3109705 "list item page break hanging bullet" was fixed. + +5.9.015 (2010-11-16) + - Bug item affecting QRCode was fixed. + - Some bugs affecting HTML lists were fixed. + - ImageSVG() and fitBlock() methods were improved to handle some SVG problems. + - Some problems with PHP4 compatibility were fixed. + +5.9.014 (2010-11-15) + - Bug item #3109464 "QRCode error" was fixed. + +5.9.013 (2010-11-15) + - Bug item #3109257 "Problem with interlaced GIFs and PNGs" was fixed. + - Image function now accepts image data streams (check example n. 9). + +5.9.012 (2010-11-12) + - Method getTCPDFVersion() was added. + - PDF_PRODUCER constant was removed. + - Method convertHTMLColorToDec() was improved. + - HTML colors now support spot color names defined on the new spotcolors.php file. + - The default method Header() was improved to support SVG and EPS/AI images. + - A bug on SVG importer was fixed. + +5.9.011 (2010-11-02) + - Bug item #3101486 "Bug Fix for image loading" was fixed. + +5.9.010 (2010-10-27) + - Support for CSS properties 'border-spacing' and 'padding' for tables were added. + - Several language files were added. + +5.9.009 (2010-10-21) + - HTML text alignment was improved to include the case of RTL text on LTR direction and LTR text on RTL direction. + +5.9.008 (2010-10-21) + - Bug item #3091502 "Bookmark oddity" was fixed. + - HTML internal links now accepts page number and Y position. + - The method write1DBarcode() was improved to accept separate horizontal and vertical padding (see example n. 27). + +5.9.007 (2010-10-20) + - Method adjustCellPadding() was fixed to handle bad input. + +5.9.006 (2010-10-19) + - Support for AES 256 bit encryption was added (see example n. 16). + - Method getNumLines() was fixed for the empty string case. + +5.9.005 (2010-10-18) + - Method addPageRegion() was changed to accept regions starting exactly from the top of the page. + +5.9.004 (2010-10-18) + - A bug related to annotations was fixed. + - The file unicode_data.php was canged to encapsulate all data in a class. + - The file htmlcolors.php was changed to remove the global variable. + +5.9.003 (2010-10-15) + - Support for no-write page regions was added. Check the example n. 64 and new methods setPageRegions(), addPageRegion(), getPageRegions(), removePageRegion(). + - A bug on Right-To-Left alignment was fixed. + +5.9.002 (2010-10-08) + - Cell method was improved to preserve the font stretching and spacing values when using the $stretch parameter (see example n. 4). + +5.9.001 (2010-10-07) + - The problem of blank page for nobr table higher than a single page was fixed. + +5.9.000 (2010-10-06) + - Support for text stretching and spacing (tracking) was added, see example n. 63 and methods setFontStretching(), getFontStretching(), setFontSpacing(), getFontSpacing(). + - Support for CSS properties 'font-stretch' and 'letter-spacing' was added (see example n. 63). + - The cMargin state was replaced by cell_padding array that can be set/get using setCellPadding() and getCellPadding() methods. + - Methods getCellPaddings() and setCellPaddings() were added to fine tune cell paddings (see example n. 5). + - Methods getCellMargins() and setCellMargins() were added to fine tune cell margins (see example n. 5). + - Method write1DBarcode() was improved to permit custom labels (see example n. 27). + - Method ImagePngAlpha() now includes support for ImageMagick to improve performances. + - XObject Template support was extended to support Multicell(), writeHTML() and writeHTMLCell() methods. + - The signature of getNumLines() and getStringHeight() methods is changed. + - Example n. 57 was updated. + +// ------------------------------------------------------------------- + +5.8.034 (2010-09-27) + - A bug related to SetFont on XObject templates was fixed. + +5.8.033 (2010-09-25) + - A problem with Footer() and multiple columns was fixed. + +5.8.032 (2010-09-22) + - Bug #3073165 "Issues with changes to addHTMLVertSpace()" was fixed. + +5.8.031 (2010-09-20) + - Bug #3071961 "Spaces in HTML" was fixed. + +5.8.030 (2010-09-17) + - SVG support was improved and some bugs were fixed. + +5.8.029 (2010-09-16) + - A problem with HTML borders was fixed. + +5.8.028 (2010-09-13) + - Bug #3065224 "mcrypt_create_iv error on TCPDF 5.8.027 on PHP 5.3.2" was fixed. + +5.8.027 (2010-09-13) + - Bug #3065118 "mcrypt_decrypt error on TCPDF 5.8.026 on PHP 5.3.2" was fixed. + +5.8.026 (2010-09-13) + - A bug on addHTMLTOC() method was fixed. Note: be sure that the #TOC_PAGE_NUMBER# template has enough width to be printed correctly. + +5.8.025 (2010-09-09) + - Bug #3062692 "Textarea inside a table" was fixed. + +5.8.024 (2010-09-08) + - Bug #3062005 "Undefined variable: ann_obj_id" was fixed. + +5.8.023 (2010-08-31) + - Forms bug added on version 5.8.019 was fixed. + +5.8.022 (2010-08-31) + - Bug #3056632 "SVG rendered vertically flipped" was fixed. + +5.8.021 (2010-08-30) + - A new CID-0 'chinese' font was added for traditional Chinese. + - Bug #3054287 'Inner tags are ignored due to "align" attribute' was fixed. + +5.8.020 (2010-08-26) + - CSS "catch-all" class selector is now supported. + +5.8.019 (2010-08-26) + - XObject Templates now includes support for links and annotations. + - A problem related to link alignment on cell was fixed. + - A problem related to SVG styles was fixed. + +5.8.018 (2010-08-25) + - Method getNumberOfColumns() was added. + - A problem related to table header was fixed. + - Method getSVGTransformMatrix() was fixed to apply SVG transformations in the correct order. + - SVG support was improved and several bugs were fixed. + +5.8.017 (2010-08-25) + - This version includes support for XObject Templates (see the new example n. 62). + - Methods starttemplate(), endTemplate() and printTemplate() were added (see the new example n. 62). + +5.8.016 (2010-08-24) + - Alignment problem on write2DBarcode was fixed. + +5.8.015 (2010-08-24) + - A problem arose with the latest bugfix was fixed. + +5.8.014 (2010-08-23) + - Method _getxobjectdict() was added for better compatibility with external extensions. + - A bug related to radiobuttons was fixed. + - Bug #3051509 "new line after punctuation marks" was fixed (partially). + +5.8.013 (2010-08-23) + - SVG support for 'direction' property was added. + - A problem on default width calculation for linear barcodes was fixed. + - New option was added to write1DBarcode() method to improve alignments (see example n. 27). + - Bug #3050896 "Nested HTML tables: styles are not applied" was fixed. + - Method _putresourcedict() was improved to include external XObject templates. + +5.8.012 (2010-08-22) + - Support for SVG 'text-anchor' property was added. + +5.8.011 (2010-08-21) + - Method write1DBarcode() was improved to be backward compatible (check the new example n. 27). + - Support for CSS width and height properties on images were added. + +5.8.010 (2010-08-20) + - Documentation of unhtmlentities() was fixed. + - The 'fitwidth' option was added and border color problem was fixed on write1DBarcode() method (check the example n. 27). + +5.8.009 (2010-08-20) + - Internal object numbering was improved. + - Some errors in object encryption were fixed. + +5.8.008 (2010-08-19) + - Method write1DBarcode() was changed, check the example n. 27. + - Method Footer() was changed to account for barcode changes. + - Automatic calculation of K_PATH_URL constant was fixed on configuration file. + - Method setEqualColumns() was fixed for $width=0 case. + - Method AddTOC() was fixed for multipage and multicolumn modes. + - Better support for SVG "font-family" property. + - A problem on default Page Zoom mode was fixed. + - Several Annotation bugs were fixed. + +5.8.007 (2010-08-18) + - A bug affecting HTML tables was fixed. + - Bug #3047500 "SVG not rendering paths properly" was fixed. + +5.8.006 (2010-08-17) + - A bug affecting HTML table nesting was fixed. + +5.8.005 (2010-08-17) + - A bug affecting the HTML 'select' tag in certain conditions was fixed. + +5.8.004 (2010-08-17) + - Better support for HTML "font-family" property. + - A bug related to HTML multicolumn was fixed. + +5.8.003 (2010-08-16) + - Better support for HTML "font-family" property. + +5.8.002 (2010-08-14) + - HTML alignments were improved + - IMPORTANT: Default regular expression to find spaces has been changed to exclude the non-breaking-space (160 DEC- A0 HEX). If you are using setSpacesRE() method, please read the new documentation. + - Example n. 1 was updated. + +5.8.001 (2010-08-12) + - Bug #3043650 "subsetchars incorrectly cached" was fixed. + +5.8.000 (2010-08-11) + - A control to avoid bookmarking page 0 was added. + - addTOC() method now includes support for multicolumn mode. + - Support for tables in multicolumn mode was improved. + - Example n.10 was updated. + - All trimming functions were replaced with stringLeftTrim(), stringRightTrim() and stringTrim(). + - HTML alignments were improved. + +------------------------------------------------------------ + +5.7.003 (2010-08-08) + - Bug #3041263 "php source ending is bad" was fixed (all PHP files were updated, including fonts). + +5.7.002 (2010-08-06) + - Methods copyPage(), movePage() and deletePage() were changed to account for internal markings. + +5.7.001 (2010-08-05) + - Bug #3040105 "Broken PDF when using TOC (example 45)" was fixed. + +5.7.000 (2010-08-03) + - CSS borders are now supported for HTML tables and other block tags (see example n. 61); + - Cell borders were improved (see example n. 57); + - Minor bugs were fixed. + +------------------------------------------------------------ + +5.6.000 (2010-07-31) + - A bug with object IDs was fixes. + - Performances were improved. + +------------------------------------------------------------ + +5.5.015 (2010-07-29) + - Automatic fix for unclosed self-closing tag. + - Support for deprecated 's' and 'strike' tags was added. + - Empty list items problem was fixed. + +5.5.014 (2010-07-15) + - Support for external images was improved. + +5.5.013 (2010-07-14) + - Bug #3029338 "FI and FO output destination filename bug" was fixed (previous fix was wrong). + +5.5.012 (2010-07-14) + - Bug #3029310 "Font baseline inconsistencies with line-height and font-size" was fixed. + - Bug #3029338 "FI and FO output destination filename bug" was fixed. + +5.5.011 (2010-07-09) + - Support for multiple CSS classes was added. + - The method getColumn() was added to return the current column number. + - Some regular Expressions were fixed to be more compatible with UTF-8. + +5.5.010 (2010-07-06) + - Bug item #3025772 "Borders in all image functions are still flawed" was fixed. + +5.5.009 (2010-07-05) + - A problem related to last page footer was fixed. + - Image alignments and fit-on-page features were improved. + +5.5.008 (2010-07-02) + - A problem on table header alignment in booklet mode was fixed. + - Default graphic vars are now applied for setHeader(); + +5.5.007 (2010-07-02) + - Attribute "readonly" was added to input and textarea form fields. + - Vertical alignment feature was added on MultiCell() method only for simple text mode (see example n. 5). + - Text-Fit feature was added on MultiCell() method only for simple text mode (see example n. 5). + +5.5.006 (2010-06-29) + - getStringHeight() and getNumLines() methods were fixed. + +5.5.005 (2010-06-28) + - Bug #3022170 "getFontDescent() does not return correct descent value" was fixed. + - Some problems with multicolumn mode were fixed. + +5.5.004 (2010-06-27) + - Bug #3021803 "SVG Border" was fixed. + +5.5.003 (2010-06-26) + - On Write() method, blank lines at the beginning of a page or column are now automatically removed. + +5.5.002 (2010-06-24) + - ToUnicode Identity-H name was replaced with a full CMap (to avoid preflight syntax error). + - Bug #3020638 "str_split() not available in php4" was fixed. + - Bug #3020665 "file_get_contents() too many parameters for php4" was fixed. + +5.5.001 (2010-06-23) + - A problem on image streams was fixed. + +5.5.000 (2010-06-22) + - Several PDF syntax errors (and related bugs) were fixed. + - Bug #3019090 "/Length values are wrong if AES encryption is used" was fixed. + +------------------------------------------------------------ + +5.4.003 (2010-06-19) + - A problem related to page boxes was fixed. + - Bug #3016920 "Font subsetting issues when editing pdf" was partially fixed (Note that flattening transparency layers is currently incompatible with TrueTypeUnicode fonts). + +5.4.002 (2010-06-18) + - A problem related with setProtection() method was fixed. + +5.4.001 (2010-06-18) + - A problem related with setProtection() method was fixed. + +5.4.000 (2010-06-18) + - The method setSignatureAppearance() was added, check the example n. 52. + - Several problems related to font subsetting were fixed. + +------------------------------------------------------------ + +5.3.010 (2010-06-15) + - Previous release was corrupted. + +5.3.009 (2010-06-15) + - Bug #3015934 "Bullets don't display correctly" was fixed. + +5.3.008 (2010-06-13) + - This version fixes some problems of SVG rasterization. + +5.3.007 (2010-06-13) + - This version improves SVG support. + +5.3.006 (2010-06-10) + - This version includes a change in uniqid calls for backward compatibility with PHP4. + +5.3.005 (2010-06-09) + - The method getPageSizeFromFormat() was changed to include all standard page formats (includes 281 page formats + variation). + +5.3.004 (2010-06-08) + - Bug #3013291 "HTML table cell width" was fixed. + - Bug #3013294 "HTML table cell alignment" was fixed. + - The columns widths of HTML tables are now inherited from the first row. + +5.3.003 (2010-06-08) + - Bug #3013102 "HTML table header misaligned after page break" was fixed. + +5.3.002 (2010-06-07) + - The methods setFontSubsetting() and setFontSubsetting() were added to control the default font subsetting mode (see example n. 1). + - Bug #3012596 "Whitespace should not appeared after use Thai top characters" was fixed. + - Examples n. 1, 14, and 54 were updated. + +5.3.001 (2010-06-06) + - Barcode PDF417 was improved to support Macro Code Blocks (see example n. 50). + +5.3.000 (2010-06-05) + - License was changed to GNU-LGPLv3 (see the updated LICENSE.TXT file). + - PDF417 barcode support was added (check the example n. 50). + - The method write2DBarcode() was improved (some parameters were added and other changed - check example n. 50). + +------------------------------------------------------------ + +5.2.000 (2010-06-02) + - IMPORTANT: Support for font subsetting was added by default to reduce the size of documents using large unicode font files. + If you embed the whole font in the PDF, the person on the other end can make changes to it even if he didn't have your font. + If you subset the font, file size of the PDF will be smaller but the person who receives your PDF would need to have your same font in order to make changes to your PDF. + - The signature of the SetFont() and AddFont() methods were changed to include the font subsetting option (subsetting is applied by default). + - Examples 14 and 54 were updated. + +------------------------------------------------------------ + +5.1.002 (2010-05-27) + - Bug #3007818 "SetAutoPageBreak fails with MultiCell" was fixed. + - A bug related to MultiCell() minimun height was fixed. + +5.1.001 (2010-05-26) + - The problem of blank page after table was fixed. + +5.1.000 (2010-05-25) + - This version includes support for CSS (Cascading Style Sheets) (see example n. 61). + - The convertHTMLColorToDec() method was improved. + +------------------------------------------------------------ + +5.0.014 (2010-05-21) + - A problem on color and style of HTML links was fixed. + - A bug relative to gradients was fixed. + - The getStringHeight() method was added and getNumLines() method was improved. + - All examples were updated. + +5.0.013 (2010-05-19) + - A bug related to page-breaks and table cells was fixed. + +5.0.012 (2010-05-19) + - Page orientation bug was fixed. + - The access to method setPageFormat() was changed to 'protected' because it is not intended to be directly called. + +5.0.011 (2010-05-19) + - Page orientation bug was fixed. + - Bug #3003966 "Multiple columns and nested lists" was fixed. + +5.0.010 (2010-05-17) + - The methods setPageFormat(), setPageOrientation() and related methods were extended to include page boxes, page rotations and page transitions. + - The method setPageBoxes() was added to set page boundaries (MediaBox, CropBox, BleedBox, TrimBox, ArtBox); + - A bug relative to underline, overline and linethrough was fixed. + +5.0.009 (2010-05-16) + - Bug #3002381 "Multiple columns and nested lists" was fixed. + +5.0.008 (2010-05-15) + - Bug "Columns WriteHTML and Justification" was fixed. + +5.0.007 (2010-05-14) + - Bug #3001347 "Bug when using WriteHTML with setEqualColumns()" was fixed. + - Bug #3001505 "problem with sup and sub tags at the beginning of a line" was fixed. + +5.0.006 (2010-05-13) + - Length of hr tag was fixed. + - An error on 2d barcode method was fixed. + +5.0.005 (2010-05-12) + - WARNING: The logic of permissions on the SetProtection() method has been inverted and extended (see example 16). Now you have to specify the features you want to block. + - SetProtection() method was extended to support RSA and AES 128 encryption and public-keys (see example 16). + - Bug #2999489 "setEqualColumns() and TOC uses wrong columns" was fixed (see the example 10). + +5.0.004 (2010-05-10) + - HTML line alignment when using sub and sup tags was fixed. + +5.0.003 (2010-05-07) + - Horizontal alignment was fixed for images and barcodes. Now the X coordinate is always relative to the left margin. Use GetAbsX() instead of GetX() to get the X relative to left margin. + - Header() method was changed to account for new image alignment rules. + +5.0.002 (2010-05-06) + - Bookmark() and related methods were fixed to accept HTML code. + - A problem on HTML links was fixed. + +5.0.001 (2010-05-06) + - Protected method _putstream was re-added for backward compatibility. + - The following method were added to display HTML Table Of Content (see example n. 59): + addTOCPage(), endTOCPage(), addHTMLTOC(). + +5.0.000 (2010-05-05) + - Method ImageSVG() was added to embedd SVG images (see example n. 58). Note that not all SVG images are supported. + - Method setRasterizeVectorImages() was added to enable/disable rasterization for vector images via ImageMagick library. + - Method RoundedRectXY() was added. + - Method PieSectorXY() was added. + - Gradient() method is now public and support new features. + - Shading to transparency is now supported. + - Image alignments were fixed. + - Support for dynamic images were improved. + - PDF_IMAGE_SCALE_RATIO has been changed to 1.25 for better compatibility with SVG. + - RAW and RAW2 modes were added to 2D Barcodes (see example n. 50). + - Automatic padding feature was added on barcodes (see examples n. 27 and 50). + - Bug #2995003 "Reproduced thead bug" was fixed. + - The Output() method now accepts FI and FD destinations to save the document on server before sending it to the client. + - Ellipse() method was improved and fixed (see page 2 of example n. 12). + +------------------------------------------------------------ + +4.9.018 (2010-04-21) + - Bug item #2990356 "Current font size not respected with more than two HTML

      " was fixed. + +4.9.017 (2010-04-21) + - Bug item #2990224 "Different behaviour for equivalent HTML strings" was fixed. + - Bug item #2990314 "Dash is not appearing with SHY character" was fixed. + +4.9.016 (2010-04-20) + - An error on htmlcolors.php was fixed. + - getImageFileType() method was improved. + - GIF images with transparency are now better supported. + - Automatic page orientation was improved. + +4.9.015 (2010-04-20) + - A new method copyPage() was added to clone pages (see example n. 44). + - Support for text overline was added. + - Underline and linethrough methods were fixed. + - Bug #2989058 "SHY character causes unnecessary word-wrapping" was fixed. + +4.9.014 (2010-04-18) + - Bug item #2988845 was fixed. + +4.9.013 (2010-04-15) + - Image() and ImageEPS() methods were fixed and improved; $fitonpage parameter was added. + +4.9.012 (2010-04-12) + - The hyphenateText() method was added to automatically hyphenate text (see example n. 46). + +4.9.011 (2010-04-07) + - Vertical alignments for Cell() method were improved (see example n. 57). + +4.9.010 (2010-04-06) + - Signature of Cell() method now includes new parameters for vertical alignment (see example n. 57). + - Text() method was extended to include all Cell() parameters. + - HTML line alignment procedure was changed to fix some bugs. + +4.9.009 (2010-04-05) + - Text() method was fixed for backward compatibility. + +4.9.008 (2010-04-03) + - Additional line space after table header was removed. + - Support for HTML lists in multicolumn mode was added. + - The method setTextRenderingMode() was added to set text rendering modes (see the example n. 26). + - The following HTML attributes were added to set text rendering modes (see the example n. 26): stroke, strokecolor, fill. + +4.9.007 (2010-04-03) + - Font Descent computation was fixed (patch #2981441). + +4.9.006 (2010-04-02) + - The constant K_TCPDF_CALLS_IN_HTML was added on configuration file to enable/disable the ability to call TCPDF methods in HTML. + - The usage of tcpdf tag in HTML mode was changed to remove the possible security flaw offered by the eval() function (thanks to Matthias Hecker for spotting this security problem). See the new example n. 49 for further information. + +4.9.005 (2010-04-01) + - Bug# 2980354 "Wrong File attachment description with security" was fixed. + - Several problems with HTML line alignment were fixed. + - The constant K_THAI_TOPCHAR was added on configuration file to enable/disable the special procedure used to avoid the overlappind of symbols on Thai language. + - A problem with font name directory was fixed. + - A bug on _destroy() method was fixed. + +4.9.004 (2010-03-31) + - Patch #979681 "GetCharWidth - default character width" was applied (bugfix). + +4.9.003 (2010-03-30) + - Problem of first
      on multiple columns was fixed. + - HTML line alignment was fixed. + - A QR-code bug was fixed. + +4.9.002 (2010-03-29) + - Patch #2978349 "$ignore_min_height is ignored in function Cell()" was applied. + - Bug #2978607 "2D Barcodes are wrong" was fixed. + - A problem with HTML block tags was fixed. + - Artificial italic for CID-0 fonts was added. + - Several multicolumn bugs were fixed. + - Support for HTML tables on multicolumn was added. + +4.9.001 (2010-03-28) + - QR Code minor bug was fixed. + - Multicolumn mode was added (see the new example n. 10). + - The following methods were added: setEqualColumns(), setColumnsArray(), selectColumn(). + - Thai diacritics support were changed (note that this is incompatible with html justification). + +4.9.000 (2010-03-27) + - QR Code (2D barcode) support was added (see example n. 50). + - The following methods were added to print crop and registration marks (see example n. 56): colorRegistrationBar(), cropMark(), registrationMark(). + - Limited support for CSS line-height property was added. + - Gradient method now supports Gray, RGB and CMYK space color. + - Example n. 51 was updated. + - Vertical alignment of font inside cell was fixed. + - Support for multiple Thai diacritics was added. + - Bug item #2974929 "Duplicate case values" was fixed. + - Bug item #2976729 "File attachment not working with security" was fixed. + +------------------------------------------------------------ + +4.8.039 (2010-03-20) + - Problems related to custom locale settings were fixed. + - Problems related to HTML on Header and Footer were fixed. + +4.8.038 (2010-03-13) + - Various bugs related to page-break in HTML mode were fixed. + - Bug item #2968974 "Another

      pagebreak problem" was fixed. + - Bug item #2969276 "justification problem" was fixed. + - Bug item #2969289 "bug when using justified text and custom headers" was fixed. + - Images are now automatically resized to be contained on the page. + - Some HTML line alignments were fixed. + - Signature of AddPage() and SetMargins() methods were changed to include an option to set default page margins. + +4.8.037 (2010-03-03) + - Bug item #2962068 was fixed. + - Bug item #2967017 "Problems with and pagebreaks" was fixed. + - Bug item #2967023 "table header lost with pagebreak" was fixed. + - Bug item #2967032 "Header lost with nested tables" was fixed. + +4.8.036 (2010-02-24) + - Automatic page break for HTML images was improved. + - Example 10 was updated. + - Japanese was removed from example 8 because the freeserif font doesn't contain japanese (you can display it using arialunicid0 font). + +4.8.035 (2010-02-23) + - Automatic page break for HTML images was added. + - Support for multicolumn HTML was added (example 10 was updated). + +4.8.034 (2010-02-17) + - Language files were updated. + +4.8.033 (2010-02-12) + - A bug related to protection mode with links was fixed. + +4.8.032 (2010-02-04) + - A bug related to $maxh parameter on Write() and MultiCell() was fixed. + - Support for body tag was added. + +4.8.031 (2010-01-30) + - Bug item #2941589 "paragraph justify not working on some non-C locales" was fixed. + +4.8.030 (2010-01-27) + - Some text alignment cases were fixed. + +4.8.029 (2010-01-27) + - Bug item #2941057 "TOC Error in PDF File Output" was fixed. + - Some text alignment cases were fixed. + +4.8.028 (2010-01-26) + - Text alignment for RTL mode was fixed. + +4.8.027 (2010-01-25) + - Bug item #2938412 "Table related problems - thead, nobr, table width" was fixed. + +4.8.026 (2010-01-19) + - The misspelled word "length" was replaced with "length" in some variables and comments. + +4.8.025 (2010-01-18) + - addExtGState() method was improved to reuse existing ExtGState objects. + +4.8.024 (2010-01-15) + - Justification mode for HTML was fixed (Bug item #2932470). + +4.8.023 (2010-01-15) + - Bug item #2932470 "Some HTML entities breaks justification" was fixed. + +4.8.022 (2010-01-14) + - Source code documentation was fixed. + +4.8.021 (2010-01-03) + - A Bug relative to Table Of Content index was fixed. + +4.8.020 (2009-12-21) + - Bug item #2918545 "Display problem of the first row of a table with larger font" was fixed. + - A Bug relative to table rowspan mode was fixed. + +4.8.019 (2009-12-16) + - Bug item #2915684 "Image size" was fixed. + - Bug item #2914995 "Image jpeg quality" was fixed. + - The signature of the Image() method was changed (check the documentation for the $resize parameter). + +4.8.018 (2009-12-15) + - Bug item #2914352 "write error" was fixed. + +4.8.017 (2009-11-27) + - THEAD problem when table is used on header/footer was fixed. + - A first line alignment on HTML justification was fixed. + - Method getImageFileType() was added. + - Images with unknown extension and type are now supported via ImageMagick PHP extension. + +4.8.016 (2009-11-21) + - Document Information Dictionary was fixed. + - CSS attributes 'page-break-before', 'page-break-after' and 'page-break-inside' are now supported. + - Problem of unclosed last page was fixed. + - Problem of 'thead' unnecessarily repeated on the next page was fixed. + +4.8.015 (2009-11-20) + - A problem with some PNG transparency images was fixed. + - Bug #2900762 "Sort issues in Bookmarks" was fixed. + - Text justification was fixed for various modes: underline, strikeout and background. + +4.8.014 (2009-11-04) + - Bug item #2891316 "writeHTML, underlining replacing spaces" was fixed. + - The handling of temporary RTL text direction mode was fixed. + +4.8.013 (2009-10-26) + - Bug item #2884729 "Problem with word-wrap and hyphen" was fixed. + +4.8.012 (2009-10-23) + - Table cell alignments for RTL booklet mode were fixed. + - Images and barcode alignments for booklet mode were fixed. + +4.8.011 (2009-10-22) + - DejaVu fonts were updated to latest version. + +4.8.010 (2009-10-21) + - Bookmark for TOC page was added. + - Signature of addTOC() method is changed. + - Bookmarks are now automatically sorted by page and Y position. + - Example n. 45 was updated. + - Example n. 55 was added to display all charactes available on core fonts. + +4.8.009 (2009-09-30) + - Compatibility with PHP 5.3 was improved. + - All examples were updated. + - Index file for examples was added. + +4.8.008 (2009-09-29) + - Example 49 was updated. + - Underline and linethrough now works with cell stretching mode. + +4.8.007 (2009-09-23) + - Infinite loop problem caused by nobr attribute was fixed. + +4.8.006 (2009-09-23) + - Bug item #2864522 "No images if DOCUMENT_ROOT=='/'" was fixed. + - Support for text-indent CSS attribute was added. + - Method rollbackTransaction() was changed to support self-reassignment of previous object (check source code documentation). + - Support for the HTML "nobr" attribute was added to avoid splitting a table or a table row on two pages (i.e.: ...). + +4.8.005 (2009-09-17) + - A bug relative to multiple transformations and annotations was fixed. + +4.8.004 (2009-09-16) + - A bug on _putannotsrefs() method was fixed. + +4.8.003 (2009-09-15) + - Bug item #2858754 "Division by zero" was fixed. + - A bug relative to HTML list items was fixed. + - A bug relative to form fields on multiple pages was fixed. + - PolyLine() method was added (see example n. 12). + - Signature of Polygon() method was changed. + +4.8.002 (2009-09-12) + - A problem related to CID-0 fonts offset was fixed: if the $cw[1] entry on the CID-0 font file is not defined, then a CID keys offset is introduced. + +4.8.001 (2009-09-09) + - The appearance streams (AP) for anotations form fields was fixed (see examples n. 14 and 54). + - Radiobuttons were fixed. + +4.8.000 (2009-09-07) + - This version includes some support for Forms fields (see example n. 14) and XHTML forms (see example n. 54). + - The following methods were changed to work without JavaScript: TextField(), RadioButton(), ListBox(), ComboBox(), CheckBox(), Button(). + - Support for Widget annotations was improved. + - Alignment of annotation objects was fixed (examples 36 and 41 were updated). + - addJavascriptObject() method was added. + - Signature of Image() method was changed. + - htmlcolors.php file was updated. + +------------------------------------------------------------ + +4.7.003 (2009-09-03) + - Support for TCPDF methods on HTML was improved (see example n. 49). + +4.7.002 (2009-09-02) + - Bug item #2848892 "writeHTML + table: Gaps between rows" was fixed. + - JavaScript support was fixed (see example n. 53). + +4.7.001 (2009-08-30) + - The Polygon() and Arrow() methods were fixed and improved (see example n. 12). + +4.7.000 (2009-08-29) + - This is a major release. + - Some procedures were internally optimized. + - The problem of mixed signature and annotations was fixed (example n. 52). + +4.6.030 (2009-08-29) + - IMPORTANT: percentages on table cell widths are now relative to the full table width (as in standard HTML). + - Various minor bugs were fixed. + - Example n. 52 (digital signature) was updated. + +4.6.029 (2009-08-26) + - PHP4 version was fixed. + +4.6.028 (2009-08-25) + - Signature algorithm was finally fixed (see example n. 52). + +4.6.027 (2009-08-24) + - TCPDF now supports unembedded TrueTypeUnicode Fonts (just comment the $file entry on the fonts' php file. + +4.6.026 (2009-08-21) + - Bug #2841693 "Problem with MultiCell and ishtml and justification" was fixed. + - Signature functions were improved but not yet fixed (tcpdf.crt and example n. 52 were updated). + +4.6.025 (2009-08-17) + - Carriage returns (\r) were removed from source code. + - Problem related to set_magic_quotes_runtime() depracated was fixed. + +4.6.024 (2009-08-07) + - Bug item #2833556 "justification using other units than mm" was fixed. + - Documentation was fixed/updated. + +4.6.023 (2009-08-02) + - Bug item #2830537 "MirrorH can show mask for transparent PNGs" was fixed. + +4.6.022 (2009-07-24) + - A bug relative to single line printing when using WriteHTMLCell() was fixed. + - Signature support were improved but is still experimental. + - Fonts Free and Dejavu were updated to latest versions. + +4.6.021 (2009-07-20) + - Bug item #2824015 "XHTML Ampersand & in hyperlink bug" was fixed. + - Bug item #2824036 "Image as hyperlink in table, text displaced at page break" was fixed. + - Links alignment on justified text was fixed. + - Unicode "\u" modifier was added to re_spaces variable by default. + +4.6.020 (2009-07-16) + - Bug item #2821921 "issue in example 18" was fixed. + - Signature of SetRTL() method was changed. + +4.6.019 (2009-07-13) + - Bug item #2820703 "xref table broken" was fixed. + +4.6.018 (2009-07-10) + - Bug item #2819319 "Text over text" was fixed. + - Method Arrow() was added to print graphic arrows (example 12 was updated). + +4.6.017 (2009-07-05) + - Bug item #2816079 "Example 48 not working" was fixed. + - The signature of the checkPageBreak() was changed. The parameter $addpage was added to turn off the automatic page creation. + +4.6.016 (2009-06-16) + - Method setSpacesRE() was added to set the regular expression used for detecting withespaces or word separators. If you are using chinese, try: setSpacesRE('/[\s\p{Z}\p{Lo}]/');, otherwise you can use setSpacesRE('/[\s\p{Z}]/'); + - The method _putinfo() now automatically fills the metadata with '?' in case of empty string. + +4.6.015 (2009-06-11) + - Bug #2804667 "word wrap bug" was fixed. + +4.6.014 (2009-06-04) + - Bug #2800931 "Table thead tag bug" was fixed. + - A bug related to
       tag was fixed.
      +
      +4.6.013 (2009-05-28)
      +	- List bullets position was fixed for RTL languages.
      +
      +4.6.012 (2009-05-23)
      +	- setUserRights() method doesn't work anymore unless you call the setSignature() method with the Adobe private key!
      +
      +4.6.011 (2009-05-18)
      +	- Signature of the Image() method was changed to include the new $fitbox parameter (see source code documentation).
      +
      +4.6.010 (2009-05-17)
      +	- Image() method was improved: now is possible to specify the maximum dimensions for a constraint box defined by $w and $h parameters, and setting the $resize parameter to null.
      +	-  tag indent problem was fixed.
      +	- $y parameter was added to checkPageBreak() method.
      +	- Bug n. 2791773 "writeHTML" was fixed.
      +
      +4.6.009 (2009-05-13)
      +	- xref table for embedded files was fixed.
      +
      +4.6.008 (2009-05-07)
      +	- setSignature() method was improved (but is still experimental).
      +	- Example n. 52 was added.
      +
      +4.6.007 (2009-05-05)
      +	- Bug #2786685 "writeHtmlCell and 
      in custom footer" was fixed. + - Table header repeating bug was fixed. + - Some newlines and tabs are now automatically removed from HTML strings. + +4.6.006 (2009-04-28) + - Support for "..." was added. + - By default TCPDF requires PCRE Unicode support turned on but now works also without it (with limited ability to detect some Unicode blank spaces). + +4.6.005 (2009-04-25) + - Points (pt) conversion in getHTMLUnitToUnits() was fixed. + - Default tcpdf.pem certificate file was added. + - Experimental support for signing document was added but it is not yet completed (some help is needed - I think that the calculation of the ByteRange is OK and the problem is on the signature calculation). + +4.6.004 (2009-04-23) + - Method deletePage() was added to delete pages (see example n. 44). + +4.6.003 (2009-04-21) + - The caching mechanism of the UTF8StringToArray() method was fixed. + +4.6.002 (2009-04-20) + - Documentation of rollbackTransaction() method was fixed. + - The setImageScale() and getImageScale() methods now set and get the adjusting parameter used by pixelsToUnits() method. + - HTML images now support other units of measure than pixels (getHTMLUnitToUnits() is now used instead of pixelsToUnits()). + - WARNING: PDF_IMAGE_SCALE_RATIO has been changed by default to 1. + +4.6.001 (2009-04-17) + - Spaces between HTML block tags are now automatically removed. + - The bug related to cMargin changes between tables was fixed. + +4.6.000 (2009-04-16) + - WARNING: THIS VERSION CHANGES THE BEHAVIOUR OF $x and $y parameters for several TCPDF methods: + zero coordinates for $x and $y are now valid coordinates; + set $x and $y as empty strings to get the current value. + - Some error caused by 'empty' function were fixed. + - Default color for convertHTMLColorToDec() method was changed to white and the return value for invalid color is false. + - HTML on footer bug was fixed. + - The following examples were fixed: 5,7,10,17,19,20,21,33,42,43. + +4.5.043 (2009-04-15) + - Barcode class (barcode.php) was extended to include new linear barcode types (see example n. 27): + C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9 + C39+ : CODE 39 with checksum + C39E : CODE 39 EXTENDED + C39E+ : CODE 39 EXTENDED + CHECKSUM + C93 : CODE 93 - USS-93 + S25 : Standard 2 of 5 + S25+ : Standard 2 of 5 + CHECKSUM + I25 : Interleaved 2 of 5 + I25+ : Interleaved 2 of 5 + CHECKSUM + C128A : CODE 128 A + C128B : CODE 128 B + C128C : CODE 128 C + EAN2 : 2-Digits UPC-Based Extension + EAN5 : 5-Digits UPC-Based Extension + EAN8 : EAN 8 + EAN13 : EAN 13 + UPCA : UPC-A + UPCE : UPC-E + MSI : MSI (Variation of Plessey code) + MSI+ : MSI + CHECKSUM (modulo 11) + POSTNET : POSTNET + PLANET : PLANET + RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) + KIX : KIX (Klant index - Customer index) + IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200 (NOTE: requires BCMath PHP extension) + CODABAR : CODABAR + CODE11 : CODE 11 + PHARMA : PHARMACODE + PHARMA2T : PHARMACODE TWO-TRACKS + +4.5.042 (2009-04-15) + - Method Write() was fixed for the strings containing only zero value. + +4.5.041 (2009-04-14) + - Barcode methods were fixed. + +4.5.040 (2009-04-14) + - Method Write() was fixed to handle empty strings. + +4.5.039 (2009-04-11) + - Support for linear barcodes was extended (see example n. 27 and barcodes.php documentation). + +4.5.038 (2009-04-10) + - Write() method was improved to support separators for Japanese, Korean, Chinese Traditional and Chinese Simplified. + +4.5.037 (2009-04-09) + - General performances were improved. + - The signature of the method utf8Bidi() was changed. + - The method UniArrSubString() was added. + - Experimental support for 2D barcodes were added (see example n. 50 and 2dbarcodes.php class). + +4.5.036 (2009-04-03) + - TCPDF methods can be called inside the HTML code (see example n. 49). + - All tag attributes, such as

      must be enclosed within double quotes. + +4.5.035 (2009-03-28) + - Bug #2717436 "writeHTML rowspan problem (continued)" was fixed. + - Bug #2719090 "writeHTML fix follow up" was fixed. + - The method _putuserrights() was changed to avoid Adobe Reader 9.1 crash. This broken the 'trick' that was used to display forms in Acrobat Reader. + +4.5.034 (2009-03-27) + - Bug #2716914 "Bug writeHTML of a table in body and footer related with pb" was fixed. + - Bug #2717056 ] "writeHTML problem when setting tr style" was fixed. + - The signature of the Cell() method was changed. + +4.5.033 (2009-03-27) + - The support for rowspan/colspan on HTML tables was improved (see example n. 48). + +4.5.032 (2009-03-23) + - setPrintFooter(false) bug was fixed. + +4.5.031 (2009-03-20) + - Table header support was extended to multiple pages. + +4.5.030 (2009-03-20) + - thead tag is now supported on HTML tables (header rows are repeated after page breaks). + - The startTransaction() was improved to autocommit. + - List bullets now uses the foreground color (putHtmlListBullet()). + +4.5.029 (2009-03-19) + - The following methods were added to UNDO commands (see example 47): startTransaction(), commitTransaction(), rollbackTransaction(). + - All examples were updated. + +4.5.028 (2009-03-18) + - Bug #2690945 "List Bugs" was fixed. + - HTML text alignment on lists was fixed. + - The constant PDF_FONT_MONOSPACED was added to the configuration file to define the default monospaced font. + - The following methods were fixed: getPageWidth(), getPageHeight(), getBreakMargin(). + - All examples were updated. + +4.5.027 (2009-03-16) + - Method getPageDimensions() was added to get page dimensions. + - The signature of the following methos were changed: getPageWidth(), getPageHeight(), getBreakMargin(). + - _parsepng() method was fixed for PNG URL images (fread bug). + +4.5.026 (2009-03-11) + - Bug #2681793 affecting URL images with spaces was fixed. + +4.5.025 (2009-03-10) + - A small bug affecting hyphenation support was fixed. + - The method SetDefaultMonospacedFont() was added to define the default monospaced font. + +4.5.024 (2009-03-07) + - The bug #2666493 was fixed "Footer corrupts document". + +4.5.023 (2009-03-06) + - The bug #2666688 was fixed "Rowspan in tables". + +4.5.022 (2009-03-05) + - The bug #2659676 was fixed "refer to #2157099 test 4 < BR > problem still not fixed". + - addTOC() function bug was fixed. + +4.5.020 (2009-03-03) + - The following bug was fixed: "function removeSHY corrupts unicode". + +4.5.019 (2009-02-28) + - The problem of decimal separator using different locale was fixed. + - The text hyphenation is now supported (see example n. 46). + +4.5.018 (2009-02-26) + - The _destroy() method was added to unset all class variables and frees memory. + - Now it's possible to call Output() method multiple times. + +4.5.017 (2009-02-24) + - A minor bug that raises a PHP warning was fixed. + +4.5.016 (2009-02-24) + - Bug item #2631200 "getNumLines() counts wrong" was fixed. + - Multiple attachments bug was fixed. + - All class variables are now cleared on Output() for memory otpimization. + +4.5.015 (2009-02-18) + - Bug item #2612553 "function Write() must not break a line on   character" was fixed. + +4.5.014 (2009-02-13) + - Bug item #2595015 "POSTNET Barcode Checksum Error" was fixed (on barcode.php). + - Pagebreak bug for barcode was fixed. + +4.5.013 (2009-02-12) + - border attribute is now supported on HTML images (only accepts the same values accepted by Cell()). + +4.5.012 (2009-02-12) + - An error on image border feature was fixed. + +4.5.011 (2009-02-12) + - HTML links for images are now supported. + - height attribute is now supported on HTML cells. + - $border parameter was added to Image() and ImageEps() methods. + - The method getNumLines() was added to estimate the number of lines required for the specified text. + +4.5.010 (2009-01-29) + - Bug n. 2546108 "BarCode Y position" was fixed. + +4.5.009 (2009-01-26) + - Bug n. 2538094 "Empty pdf file created" was fixed. + +4.5.008 (2009-01-26) + - setPage() method was fixed to correctly restore graphic states. + - Source code was cleaned up for performances. + +4.5.007 (2009-01-24) + - checkPageBreak() and write1DBarcode() methods were fixed. + - Source code was cleaned up for performances. + - barcodes.php was updated. + +4.5.006 (2009-01-23) + - getHTMLUnitToPoints() method was replaced by getHTMLUnitToUnits() to fix HTML units bugs. + +4.5.005 (2009-01-23) + - Page closing bug was fixed. + +4.5.004 (2009-01-21) + - The access of convertHTMLColorToDec() method was changed to public + - Fixed bug on UL tag. + +4.5.003 (2009-01-19) + - Fonts on different folders are now supported. + +4.5.002 (2009-01-07) + - addTOC() function was improved (see example n. 45). + +4.5.001 (2009-01-04) + - The signature of startPageGroup() function was changed. + - Method Footer() was improved to automatically print page or page-group number (see example n. 23). + - Protected method formatTOCPageNumber() was added to customize the format of page numbers on the Table Of Content. + - The signature of addTOC() was changed to include the font used for page numbers. + +4.5.000 (2009-01-03) + - A new $diskcache parameter was added to class constructor to enable disk caching and reduce RAM memory usage (see example n. 43). + - The method movePageTo() was added to move pages to previous positions (see example n. 44). + - The methods getAliasNumPage() and getPageNumGroupAlias() were added to get the alias for page number (needed when using movepageTo()). + - The methods addTOC() was added to print a Table Of Content (see example n. 45). + - Imagick class constant was removed for better compatibility with PHP4. + - All existing examples were updated and new examples were added. + +4.4.009 (2008-12-29) + - Examples 1 and 35 were fixed. + +4.4.008 (2008-12-28) + - Bug #2472169 "Unordered bullet size not adjusted for unit type" was fixed. + +4.4.007 (2008-12-23) + - Bug #2459935 "no unit conversion for header line" was fixed. + - Example n. 42 for image alpha channel was added. + - All examples were updated. + +4.4.006 (2008-12-11) + - Method setLIsymbol() was changed to reflect latest changes in HTML list handling. + +4.4.005 (2008-12-10) + - Bug item #2413870 "ordered list override value" was fixed. + +4.4.004 (2008-12-10) + - The protected method getHTMLUnitToPoints() was added to accept various HTML units of measure (em, ex, px, in, cm, mm, pt, pc, %). + - The method intToRoman() was added to convert integer number to Roman representation. + - Support fot HTML lists was improved: the CSS property list-style-type is now supported. + +4.4.003 (2008-12-09) + - Bug item #2412147 "Warning on line 3367" was fixed. + - Method setHtmlLinksStyle() was added to set default HTML link colors and font style. + - Method addHtmlLink() was changed to use color and style defined on the inline CSS. + +4.4.002 (2008-12-09) + - Borders on Multicell() were fixed. + - Problem of Multicell() on Header function (Bug item #2407579) was fixed. + - Problem on graphics tranformations applied to Multicell() was fixed. + - Support for ImageMagick was added. + - Width calculation for nested tables was fixed. + +4.4.001 (2008-12-08) + - Some missing core fonts were added on fonts directory. + - CID0 fonts rendering was fixed. + - HTML support was improved (

       and  tags are now supported).
      +	- Bug item #2406022 "Left padding bug in MultiCell with maxh" was fixed.
      +
      +4.4.000 (2008-12-07)
      +	- File attachments are now supported (see example n. 41).
      +	- Font functions were optimized to reduce document size.
      +	- makefont.php was updated.
      +	- Linux binaries were added on /fonts/utils
      +	- All fonts were updated.
      +	- $autopadding parameter was added to Multicell() to disable automatic padding features.
      +	- $maxh parameter was added to Multicell() and Write() to set a maximum height.
      +
      +4.3.009 (2008-12-05)
      +	- Bug item #2392989 (Custom header + setlinewidth + cell border bug) was fixed.
      +
      +4.3.008 (2008-12-05)
      +	- Bug item #2390566 "rect bug" was fixed.
      +	- File path was fixed for font embedded files.
      +	- SetFont() method signature was changed to include the font filename.
      +	- Some font-related methods were improved.
      +	- Methods getFontFamily() and getFontStyle() were added.
      +
      +4.3.007 (2008-12-03)
      +	- PNG alpha channel is now supported (GD library is required).
      +	- AddFont() function now support custom font file path on $file parameter.
      +	- The default width variable ($dw) is now always defined for any font.
      +	- The 'Style' attribute on CID-0 fonts was removed because of protection bug.
      +
      +4.3.006 (2008-12-01)
      +	- A regular expression on getHtmlDomArray() to find HTML tags was fixed.
      +
      +4.3.005 (2008-11-25)
      +	- makefont.php was fixed.
      +	- Bug item #2339877 was fixed (false loop condition detected on WriteHTML()).
      +	- Bug item #2336733 was fixed (lasth value update on Multicell() when border and fill are disabled).
      +	- Bug item #2342303 was fixed (automatic page-break on Image() and ImageEPS()).
      +
      +4.3.004 (2008-11-19)
      +	- Function _textstring() was fixed (bug 2309051).
      +	- All examples were updated.
      +
      +4.3.003 (2008-11-18)
      +	- CID-0 font bug was fixed.
      +	- Some functions were optimized.
      +	- Function getGroupPageNoFormatted() was added.
      +	- Example n. 23 was updated.
      +
      +4.3.002 (2008-11-17)
      +	- Bug item #2305518 "CID-0 font don't work with encryption" was fixed.
      +
      +4.3.001 (2008-11-17)
      +	- Bug item #2300007 "download mimetype pdf" was fixed.
      +	- Double quotes were replaced by single quotes to improve PHP performances.
      +	- A bug relative to HTML cell borders was fixed.
      +
      +4.3.000 (2008-11-14)
      +	- The function setOpenCell() was added to set the top/bottom cell sides to be open or closed when the cell cross the page.
      +	- A bug relative to list items indentation was fixed.
      +	- A bug relative to borders on HTML tables and Multicell was fixed.
      +	- A bug relative to rowspanned cells was fixed.
      +	- A bug relative to html images across pages was fixed.
      +
      +4.2.009 (2008-11-13)
      +	- Spaces between li tags are now automatically removed.
      +
      +4.2.008 (2008-11-12)
      +	- A bug relative to fill color on next page was fixed.
      +
      +4.2.007 (2008-11-12)
      +	- The function setListIndentWidth() was added to set custom indentation widht for HTML lists.
      +
      +4.2.006 (2008-11-06)
      +	- A bug relative to HTML justification was fixed.
      +
      +4.2.005 (2008-11-06)
      +	- A bug relative to HTML justification was fixed.
      +	- The methods formatPageNumber() and PageNoFormatted() were added to format page numbers.
      +	- Default Footer() method was changed to use PageNoFormatted() instead of PageNo().
      +	- Example 6 was updated.
      +
      +4.2.004 (2008-11-04)
      +	- Bug item n. 2217039 "filename handling improvement" was fixed.
      +
      +4.2.003 (2008-10-31)
      +	- Font style bug was fixed.
      +
      +4.2.002 (2008-10-31)
      +	- Bug item #2210922 (htm element br not work) was fixed.
      +	- Write() function was improved to support margin changes.
      +
      +4.2.001 (2008-10-30)
      +	- setHtmlVSpace($tagvs) function was added to set custom vertical spaces for HTML tags.
      +	- writeHTML() function now support margin changes during execution.
      +	- Signature of addHTMLVertSpace() function is changed.
      +
      +4.2.000 (2008-10-29)
      +	- htmlcolors.php was changed to support class-loaders.
      +	- ImageEps() function was improved in performances.
      +	- Signature of Link() And Annotation() functions were changed.
      +	- (Bug item #2198926) Links and Annotations alignment were fixed (support for geometric tranformations was added).
      +	- rowspan mode for HTML table cells was improved and fixed.
      +	- Booklet mode for double-sided pages was added; see SetBooklet() function and example n. 40.
      +	- lastPage() signature is changed.
      +	- Signature of Write() function is changed.
      +	- Some HTML justification problems were fixed.
      +	- Some functions were fixed to better support RTL mode.
      +	- Example n. 10 was changed to support RTL mode.
      +	- All examples were updated.
      +
      +4.1.004 (2008-10-23)
      +	- unicode_data.php was changed to support class-loaders.
      +	- Bug item #2186040/2 (writeHTML margin problem) was fixed.
      +
      +4.1.003 (2008-10-22)
      +	- Bug item #2185399 was fixed (rowspan and page break).
      +	- Bugs item #2186040 was fixed (writeHTML margin problem).
      +	- Newline after table was removed.
      +
      +4.1.002 (2008-10-21)
      +	- Bug item #2184525 was fixed (rowspan on HTML cell).
      +
      +4.1.001 (2008-10-21)
      +	- Support for "start" attribute was added to HTML ordered list.
      +	- unicode_data.php file was changed to include UTF-8 to ASCII table.
      +	- Some functions were modified to better support UTF-8 extensions to core fonts.
      +	- Support for images on HTML lists was improved.
      +	- Examples n. 1 and 6 were updated.
      +
      +4.1.000 (2008-10-18)
      +	- Page-break bug using HTML content was fixed.
      +	- The "false" parameter was reintroduced to class_exists function on PHP5 version to avoid autoload.
      +	- addHtmlLink() function was improved to support internal links (i.e.: link to page 23).
      +	- Justification alignment is now supported on HTML (see example n. 39).
      +	- example_006.php was updated.
      +
      +4.0.033 (2008-10-13)
      +	- Bug n. 2157099 was fixed.
      +	- SetX() and SetY() functions were improved.
      +	- SetY() includes a new parameter to avoid the X reset.
      +
      +4.0.032 (2008-10-10)
      +	- Bug n. 2156926 was fixed (bold, italic, underlined, linethrough).
      +	- setStyle() method was removed.
      +	- Configuration file was changed to use helvetica (non-unicode) font by default.
      +	- The use of mixed font types was improved.
      +	- All examples were updated.
      +
      +4.0.031 (2008-10-09)
      +	- _putannots() and _putbookmarks() links alignments were fixed.
      +
      +4.0.030 (2008-10-07)
      +	- _putbookmarks() function was fixed.
      +	- _putannots() was fixed to include internal links.
      +
      +4.0.029 (2008-09-27)
      +	- Infinite loop bug was fixed [Bug item #130309].
      +	- Multicell() problem on Header() was fixed.
      +
      +4.0.028 (2008-09-26)
      +	- setLIsymbol() was added to set the LI symbol used on UL lists.
      +	- Missing $padding and $encryption_key variables declarations were added [Bug item #2129058].
      +
      +4.0.027 (2008-09-19)
      +	- Bug #2118588 "Undefined offset in tcpdf.php on line 9581" was fixed.
      +	- arailunicid0.php font was updated.
      +	- The problem of javascript form fields duplication after saving was fixed.
      +
      +4.0.026 (2008-09-17)
      +	- convertHTMLColorToDec() function was improved to support rgb(RR,GG,BB) notation.
      +	- The following inline CSS attributes are now supported: text-decoration, color, background-color and font-size names: xx-small, x-small, small, medium, large, x-large, xx-large
      +	- Example n. 6 was updated.
      +
      +4.0.025 (2008-09-15)
      +	- _putcidfont0 function was improved to include CJK fonts (Chinese, Japanese, Korean, CJK, Asian fonts) without embedding.
      +	- arialunicid0 font was added (see the new example n. 38).
      +	- The following Unicode to CID-0 tables were added on fonts folder: uni2cid_ak12.php, uni2cid_aj16.php, uni2cid_ag15.php, uni2cid_ac15.php.
      +
      +4.0.024 (2008-09-12)
      +	- "stripos" function was replaced with "strpos + strtolower" for backward compatibility with PHP4.
      +	- support for Spot Colors were added. Check the new example n. 37 and the following new functions:
      +		AddSpotColor()
      +		SetDrawSpotColor()
      +		SetFillSpotColor()
      +		SetTextSpotColor()
      +		_putspotcolors()
      +	- Bookmark() function was improved to fix wrong levels.
      +	- $lasth changes after header/footer calls were fixed.
      +
      +4.0.023 (2008-09-05)
      +	- Some HTML related problems were fixed.
      +	- Image alignment on HTML was changed, now it always defaults to the normal mode (see example_006.php).
      +
      +4.0.022 (2008-08-28)
      +	- Line height on HTML was fixed.
      +	- Image inside an HTML cell problem was fixed.
      +	- A new "zarbold" persian font was added.
      +
      +4.0.021 (2008-08-24)
      +	- HTTP headers were fixed on Output function().
      +	- getAliasNbPages() and getPageGroupAlias() functions were changed to support non-unicode fonts on unicode documents.
      +	- Function Write() was fixed.
      +	- The problem of additional vertical spaces on HTML was fixed.
      +	- The problem of frame around HTML links was fixed.
      +
      +4.0.020 (2008-08-15)
      +	- "[2052259] WriteHTML  & " bug was fixed.
      +
      +4.0.019 (2008-08-13)
      +	- "Rowspan on first cell" bug was fixed.
      +
      +4.0.018 (2008-08-08)
      +	- Default cellpadding for HTML tables was fixed.
      +	- Annotation() function was added to support some PDF annotations (see example_036.php and section 8.4 of PDF reference 1.7).
      +	- HTML links are now correclty shifted during line alignments.
      +	- function getAliasNbPages() was added and Footer() was updated.
      +	- RowSpan mode for HTML tables was fixed.
      +	- Bugs item #2043610 "Multiple sizes vertical align wrong" was fixed.
      +	- ImageEPS() function was improved and RTL alignment was fixed (see example_032.php).
      +
      +4.0.017 (2008-08-05)
      +	- Missing CNZ and CEO style modes were added to Rect() function.
      +	- Fonts utils were updated to include support for OpenType fonts.
      +	- getLastH() function was added.
      +
      +4.0.016 (2008-07-30)
      +	- setPageMark() function was added. This function must be called after calling Image() function for a background image.
      +
      +4.0.015 (2008-07-29)
      +	- Some functions were changed to support different page formats (see example_028.php).
      +	- The signature of setPage() function is changed.
      +
      +4.0.014 (2008-07-29)
      +	- K_PATH_MAIN calculation on tcpdf_config.php was fixed.
      +	- HTML support for EPS/AI images was added (see example_006.php).
      +	- Bugs item #2030807 "Truncated text on multipage html fields" was fixed.
      +	- PDF header bug was fixed.
      +	- helvetica was added as default font family.
      +	- Stroke mode was fixed on Text function.
      +	- several minor bugs were fixed.
      +
      +4.0.013 (2008-07-27)
      +	- Bugs item #2027799 " Big spaces between lines after page break" was fixed.
      +	- K_PATH_MAIN calculation on tcpdf_config.php was changed.
      +	- Function setVisibility() was fixed to avoid the "Incorrect PDEObject type" error message.
      +
      +4.0.012 (2008-07-24)
      +	- Addpage(), Header() and Footer() functions were changed to simplify the implementation of external header/footer functions.
      +	- The following functions were added:
      +			setHeader()
      +			setFooter()
      +			getImageRBX()
      +			getImageRBY()
      +			getCellHeightRatio()
      +			getHeaderFont()
      +			getFooterFont()
      +			getRTL()
      +			getBarcode()
      +			getHeaderData()
      +			getHeaderMargin()
      +			getFooterMargin()
      +
      +4.0.011 (2008-07-23)
      +	- Font support was improved.
      +	- The folder /fonts/utils contains new utilities and instructions for embedd font files.
      +	- Documentation was updated.
      +
      +4.0.010 (2008-07-22)
      +	- HTML tables were fixed to work across pages.
      +	- Header() and Footer() functions were updated to preserve previous settings.
      +	- example_035.php was added.
      +
      +4.0.009 (2008-07-21)
      +	- UTF8StringToArray() function was fixed for non-unicode mode.
      +
      +4.0.008 (2008-07-21)
      +	- Barcodes alignment was fixed (see example_027.php).
      +	- unicode_data.php was updated.
      +	- Arabic shaping for "Zero-Width Non-Joiner" character (U+200C) was fixed.
      +
      +4.0.007 (2008-07-18)
      +	- str_split was replaced by preg_split for compatibility with PHP4 version.
      +	- Clipping mode was added to all graphic functions by using parameter $style = "CNZ" or "CEO" (see example_034.php).
      +
      +4.0.006 (2008-07-16)
      +	- HTML rowspan bug was fixed.
      +	- Line style for MultiCell() was fixed.
      +	- WriteHTML() function was improved.
      +	- CODE128C barcode was fixed (barcodes.php).
      +
      +4.0.005 (2008-07-11)
      +	- Bug [2015715] "PHP Error/Warning" was fixed.
      +
      +4.0.004 (2008-07-09)
      +	- HTML cell internal padding was fixed.
      +
      +4.0.003 (2008-07-08)
      +	- Removed URL encoding when F option is selected on Output() function.
      +	- fixed some minor bugs in html tables.
      +
      +4.0.002 (2008-07-07)
      +	- Bug [2000861] was still unfixed and has been fixed.
      +
      +4.0.001 (2008-07-05)
      +	- Bug [2000861] was fixed.
      +
      +4.0.000 (2008-07-03)
      +	- THIS IS A MAIN RELEASE THAT INCLUDES SEVERAL NEW FEATURES AND BUGFIXES
      +	- Signature fo SetTextColor() and SetFillColor() functions was changed (parameter $storeprev was removed).
      +	- HTML support was completely rewritten and improved (see example 6).
      +	- Alignments parameters were fixed.
      +	- Functions GetArrStringWidth() and GetStringWidth() now include font parameters.
      +	- Fonts support was improved.
      +	- All core fonts were replaced and moved to fonts/ directory.
      +	- The following functions were added: getMargins(), getFontSize(), getFontSizePt().
      +	- File config/tcpdf_config_old.php was renamed tcpdf_config_alt.php and updated.
      +	- Multicell and WriteHTMLCell fill function was fixed.
      +	- Several minor bugs were fixed.
      +	- barcodes.php was updated.
      +	- All examples were updated.
      +
      +------------------------------------------------------------
      +
      +3.1.001 (2008-06-13)
      +	- Bug [1992515] "K_PATH_FONTS default value wrong" was fixed.
      +	- Vera font was removed, DejaVu font and Free fonts were updated.
      +	- Image handling was improved.
      +	- All examples were updated.
      +
      +3.1.000 (2008-06-11)
      +	- setPDFVersion() was added to change the default PDF version (currently 1.7).
      +	- setViewerPreferences() was added to control the way the document is to be presented on the screen or printed (see example 29).
      +	- SetDisplayMode() signature was changed (new options were added).
      +	- LinearGradient(), RadialGradient(), CoonsPatchMesh() functions were added to print various color gradients (see example 30).
      +	- PieSector() function was added to render render pie charts (see example 31).
      +	- ImageEps() was added to display EPS and AI images with limited support (see example 32).
      +	- writeBarcode() function is now depracated, a new write1DBarcode() function was added. The barcode directory was removed and a new barcodes.php file was added.
      +	- The new write1DBarcode() function support more barcodes and do not need the GD library (see example 027). All barcodes are directly written to PDF using graphic functions.
      +	- HTML lists were improved and could be nested (you may now represent trees).
      +	- AddFont() bug was fixed.
      +	- _putfonts() bug was fixed.
      +	- graphics functions were fixed.
      +	- unicode_data.php file was updated (fixed).
      +	- almohanad font was updated.
      +	- example 18 was updated (Farsi and Arabic languages).
      +	- source code cleanup.
      +	- All examples were updated and new examples were added.
      +
      +3.0.015 (2008-06-06)
      +	- AddPage() function signature is changed to include page format.
      +	- example 28 was added to show page format changes.
      +	- setPageUnit() function was added to change the page units of measure.
      +	- setPageFormat() function was added to change the page format and orientation between pages.
      +	- setPageOrientation() function was added to change the page orientation.
      +	- Arabic font shaping was fixed for laa letter and square boxes (see the example 18).
      +
      +3.0.014 (2008-06-04)
      +	- Arabic font shaping was fixed.
      +	- setDefaultTableColumns() function was added.
      +	- $cell_height_ratio variable was added.
      +	- setCellHeightRatio() function was added to define the default height of cell repect font height.
      +
      +3.0.013 (2008-06-03)
      +	- Multicell height parameter was fixed.
      +	- Arabic font shaping was improved.
      +	- unicode_data.php was updated.
      +
      +3.0.012 (2008-05-30)
      +	- K_PATH_MAIN and K_PATH_URL constants are now automatically set on config file.
      +	- DOCUMENT_ROOT constant was fixed for IIS Webserver (config file was updated).
      +	- Arabic font shaping was improved.
      +	- TranslateY() function was fixed (bug [1977962]).
      +	- setVisibility() function was fixed.
      +	- writeBarcode() function was fixed to scale using $xref parameter.
      +	- All examples were updated.
      +
      +3.0.011 (2008-05-23)
      +	- CMYK color support was added to all graphic functions.
      +	- HTML table support was improved:
      +	  -- now it's possible to include additional html tags inside a cell;
      +	  -- colspan attribute was added.
      +	- example 006 was updated.
      +
      +3.0.010 (2008-05-21)
      +	- fixed $laa_array inclusion on utf8Bidi() function.
      +
      +3.0.009 (2008-05-20)
      +	- unicode_data.php was updated.
      +	- Arabic laa letter problem was fixed.
      +
      +3.0.008 (2008-05-12)
      +	- Arabic support was fixed and improved (unicode_data.php was updated).
      +	- Polycurve() function was added to draw a poly-Bezier curve.
      +	- list items alignment was fixed.
      +	- example 6 was updated.
      +
      +3.0.007 (2008-05-06)
      +	- Arabic support was fixed and improved.
      +	- AlMohanad (arabic) font was added.
      +	- C128 barcode bugs were fixed.
      +
      +3.0.006 (2008-04-21)
      +	- Condition to check negative width values was added.
      +
      +3.0.005 (2008-04-18)
      +	- back-Slash character escape was fixed on writeHTML() function.
      +	- Exampe 6 was updated.
      +
      +3.0.004 (2008-04-11)
      +	- Bug [1939304] (Right to Left Issue) was fixed.
      +
      +3.0.003 (2008-04-07)
      +	- Bug [1934523](Words between HTML tags in cell not kept on one line) was fixed.
      +	- "face" attribute of "font" tag is now fully supported.
      +
      +3.0.002 (2008-04-01)
      +	- Write() functions now return the number of cells and not the number of lines.
      +	- TCPDF is released under LGPL 2.1, or any later version.
      +
      +3.0.001 (2008-05-28)
      +	- _legacyparsejpeg() and _legacyparsepng() were renamed _parsejpeg() and _parsepng().
      +	- function writeBarcode() was fixed.
      +	- all examples were updated.
      +	- example 27 was added to show various barcodes.
      +
      +3.0.000 (2008-03-27)
      +	- private function pixelsToMillimeters() was changed to public function pixelsToUnits() to fix html image size bug.
      +	- Image-related functions were rewritten.
      +	- resize parameter was added to Image() signature to reduce the image size and fit width and height (see example 9).
      +	- TCPDF now supports all images supported by GD library: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM.
      +	- CMYK support was added to SetDrawColor(), SetFillColor(), SetTextColor() (see example 22).
      +	- Page Groups were added (see example 23).
      +	- setVisibility() function was added to restrict the rendering of some elements to screen or printout (see example 24).
      +	- All private variables and functions were changed to protected.
      +	- setAlpha() function was added to give transparency support for all objects (see example 25).
      +	- Clipping and stroke modes were added to Text() function (see example 26).
      +	- All examples were moved to "examples" directory.
      +	- function setJPEGQuality() was added to set the JPEG image comrpession (see example 9).
      +
      +2.9.000 (2008-03-26)
      +	- htmlcolors.php file was added to include html colors.
      +	- Support for HTML color names and three-digit hexadecimal color codes was added.
      +	- private function convertColorHexToDec() was renamed convertHTMLColorToDec().
      +	- color and bgcolor attributes are now supported on all HTML tags (color nesting is also supported).
      +	- Write() function were fixed.
      +	- example_006.php was updated.
      +	- private function setUserRights() was added to release user rights on Acrobat Reader (this allows to display forms, see example 14)
      +
      +2.8.000 (2008-03-20)
      +	- Private variables were changed to protected.
      +	- Function Write() was fixed and improved.
      +	- Support for dl, dt, dd, del HTML tags was introduced.
      +	- Line-trought mode was added for HTML and text.
      +	- Text vertical alignment on cells were fixed.
      +	- Examples were updated to reflect changes.
      +
      +2.7.002 (2008-03-13)
      +	- Bug "[1912142] Encrypted PDF created/modified date" was fixed.
      +
      +2.7.001 (2008-03-10)
      +	- Cell justification was fixed for non-unicode mode.
      +
      +2.7.000 (2008-03-09)
      +	- Cell() stretching mode 4 (forced character spacing) was fixed.
      +	- writeHTMLCell() now uses Multicell() to write.
      +	- Multicell() has a new parameter $ishtml to act as writeHTMLCell().
      +	- Write() speed was improved for non-arabic strings.
      +	- Example n. 20 was changed.
      +
      +2.6.000 (2008-03-07)
      +	- various alignments bugs were fixed.
      +
      +2.5.000 (2008-03-07)
      +	- Several bugs were fixed.
      +	- example_019.php was added to test non-unicode mode using old fonts.
      +
      +2.4.000 (2008-03-06)
      +	- RTL support was deeply improved.
      +	- GetStringWidth() was fixed to support RTL languages.
      +	- Text() RTL alignment was fixed.
      +	- Some functions were added: GetArrStringWidth(), GetCharWidth(), uniord(), utf8Bidi().
      +	- example_018.php was added and test_unicode.php was removed.
      +
      +2.3.000 (2008-03-05)
      +	- MultiCell() signature is changed. Now support multiple columns across pages (see example_017).
      +	- Write() signature is changed. Now support the cell mode to be used with MultiCell.
      +	- Header() and Footer() were changed.
      +	- The following functions were added: UTF8ArrSubString() and unichr().
      +	- Examples were updated to reflect last changes.
      +
      +2.2.004 (2008-03-04)
      +	- Several examples were added.
      +	- AddPage() Header() and Footer() were fixed.
      +	- Documentation is now available on http://www.tcpdf.org
      +
      +2.2.003 (2008-03-03)
      +	- [1894853] Performance of MultiCell() was improved.
      +	- RadioButton and ListBox functions were added.
      +	- javascript form functions were rewritten and properties names are changed. The properties function supported by form fields are listed on Possible values are listed on http://www.adobe.com/devnet/acrobat/pdfs/js_developer_guide.pdf.
      +
      +2.2.002 (2008-02-28)
      +	- [1900495] html images path was fixed.
      +	- Legacy image functions were reintroduced to allow PNG and JPEG support without GD library.
      +
      +2.2.001 (2008-02-16)
      +	- The bug "[1894700] bug with replace relative path" was fixed
      +	- Justification was fixed
      +
      +2.2.000 (2008-02-12)
      +	- fixed javascript bug introduced with latest release
      +
      +2.1.002 (2008-02-12)
      +	- Justify function was fixed on PHP4 version.
      +	- Bookmank function was added ([1578250] Table of contents).
      +	- Javascript and Form fields support was added ([1796359] Form fields).
      +
      +2.1.001 (2008-02-10)
      +	- The bug "[1885776] Race Condition in function justitfy" was fixed.
      +	- The bug "[1890217] xpdf complains that pdf is incorrect" was fixed.
      +
      +2.1.000 (2008-01-07)
      +	- FPDF_FONTPATH constant was changed to K_PATH_FONTS on config file
      +	- Bidirectional Algorithm to correctly reverse bidirectional languages was added.
      +	- SetLeftMargin, SetTopMargin, SetRightMargin functions were fixed.
      +	- SetCellPadding function was added.
      +	- writeHTML was updated with new parameters.
      +	- Text function was fixed.
      +	- MultiCell function was fixed, now works also across multiple pages.
      +	- Line width was fixed on Header and Footer functions and 
      tag. + - "GetImageSize" was renamed "getimagesize". + - Document version was changed from 1.3 to 1.5. + - _begindoc() function was fixed. + - ChangeDate was fixed and ModDate was added. + - The following functions were added: + setPage() : Move pointer to the specified document page. + getPage() : Get current document page number. + lastpage() : Reset pointer to the last document page. + getNumPages() : Get the total number of inserted pages. + GetNumChars() : count the number of (UTF-8) characters in a string. + - $stretch parameter was added to Cell() function to fit text on cell: + 0 = disabled + 1 = horizontal scaling only if necessary + 2 = forced horizontal scaling + 3 = character spacing only if necessary + 4 = forced character spacing + - Line function was fixed for RTL. + - Graphic transformation functions were added [1811158]: + StartTransform() + StopTransform() + ScaleX() + ScaleY() + ScaleXY() + Scale() + MirrorH() + MirrorV() + MirrorP() + MirrorL() + TranslateX() + TranslateY() + Translate() + Rotate() + SkewX() + SkewY() + Skew() + - Graphic function were added/updated [1688549]: + SetLineStyle() + _outPoint() + _outLine() + _outRect() + _outCurve() + Line() + Rect() + Curve + Ellipse + Circle + Polygon + RegularPolygon + +2.0.000 (2008-01-04) + - RTL (Right-To-Left) languages support was added. Language direction is set using the $l['a_meta_dir'] setting on /configure/language/xxx.php language files. + - setRTL($enable) method was added to manually enable/disable the RTL text direction. + - The attribute "dir" was added to support custom text direction on HTML tags. Possible values are: ltr - for Left-To-Right and RTL for Right-To-Left. + - RC4 40bit encryption was added. Check the SetProtection method. + - [1815213] Improved image support for GIF, JPEG, PNG formats. + - [1800094] Attribute "value" was added to ordered list items
    • . + - Image function now has a new "align" parameter that indicates the alignment of the pointer next to image insertion and relative to image height. The value can be: + T: top-right for LTR or top-left for RTL + M: middle-right for LTR or middle-left for RTL + B: bottom-right for LTR or bottom-left for RTL + N: next line + - Attribute "align" was added to html tag to set the above image "align" parameter. Possible values are: + top: top-right for LTR or top-left for RTL + middle: middle-right for LTR or middle-left for RTL + bottom: bottom-right for LTR or bottom-left for RTL + - [1798103] newline was added after , and

      tages. + - [1816393] Documentation was updated. + - 'ln' parameter was fixed on writeHTMLCell. Now it's possible to print two or more columns across several pages; + - The method lastPage() was added to move the pointer on the last page; + +------------------------------------------------------------ + +1.53.0.TC034 (2007-07-30) + - fixed htmlentities conversion. + - MultiCell() function returns the number of cells. + +1.53.0.TC033 (2007-07-30) + - fixed bug 1762550: case sensitive for font files + - NOTE: all fonts files names must be in lowercase! + +1.53.0.TC032 (2007-07-27) + - setLastH method was added to resolve bug 1689071. + - all fonts names were converted in lowercase (bug 1713005). + - bug 1740954 was fixed. + - justification was added as Cell option. + +1.53.0.TC031 (2007-03-20) + - ToUnicode CMap were added on _puttruetypeunicode function. Now you may search and copy unicode text. + +1.53.0.TC030 (2007-03-06) + - fixed bug on PHP4 version. + +1.53.0.TC029 (2007-03-06) + - DejaVu Fonts were added. + +1.53.0.TC028 (2007-03-03) + - MultiCell function signature were changed: the $ln parameter were added. Check documentation for further information. + - Greek language were added on example sentences. + - setPrintHeader() and setPrintFooter() functions were added to enable or disable page header and footer. + +1.53.0.TC027 (2006-12-14) + - $attr['face'] bug were fixed. + - K_TCPDF_EXTERNAL_CONFIG control where introduced on /config/tcpdf_config.php to use external configuration files. + +1.53.0.TC026 (2006-10-28) + - writeHTML function call were fixed on examples. + +1.53.0.TC025 (2006-10-27) + - Bugs item #1421290 were fixed (0D - 0A substitution in some characters) + - Bugs item #1573174 were fixed (MultiCell documentation) + +1.53.0.TC024 (2006-09-26) + - getPageHeight() function were fixed (bug 1543476). + - fixed missing breaks on closedHTMLTagHandler function (bug 1535263). + - fixed extra spaces on Write function (bug 1535262). + +1.53.0.TC023 (2006-08-04) + - paths to barcode directory were fixed. + - documentation were updated. + +1.53.0.TC022 (2006-07-16) + - fixed bug: [ 1516858 ] Probs with PHP autoloader and class_exists() + +1.53.0.TC021 (2006-07-01) + - HTML attributes with whitespaces are now supported (thanks to Nelson Benitez for his support) + +1.53.0.TC020 (2006-06-23) + - code cleanup + +1.53.0.TC019 (2006-05-21) + - fixed and closing tags + +1.53.0.TC018 (2006-05-18) + - fixed font names bug + +1.53.0.TC017 (2006-05-18) + - the TTF2UFM utility to convert True Type fonts for TCPDF were included on fonts folder. + - new free unicode fonts were included on /fonts/freefont. + - test_unicode.php example were exended. + - parameter $fill were added on Write, writeHTML and writeHTMLCell functions. + - documentation were updated. + +1.53.0.TC016 (2006-03-09) + - fixed closing tag on html parser. + +1.53.0.TC016 (2005-08-28) + - fpdf.php and tcpdf.php files were joined in one single class (you can still extend TCPDF with your own class). + - fixed problem when mb_internal_encoding is set. + +1.53.0.TC014 (2005-05-29) + - fixed WriteHTMLCell new page issue. + +1.53.0.TC013 (2005-05-29) + - fixed WriteHTMLCell across pages. + +1.53.0.TC012 (2005-05-29) + - font color attribute bug were fixed. + +1.53.0.TC011 (2005-03-31) + - SetFont function were fixed (thank Sjaak Lauwers for bug notice). + +1.53.0.TC010 (2005-03-22) + - the html functions were improved (thanks to Manfred Vervuert for bug reporting). + +1.53.0.TC009 (2005-03-19) + - a wrong reference to convertColorHexToDec were fixed. + +1.53.0.TC008 (2005-02-07) + - removed some extra bytes from PHP files. + +1.53.0.TC007 (2005-01-08) + - fill attribute were removed from writeHTMLCell method. + +1.53.0.TC006 (2005-01-08) + - the documentation were updated. + +1.53.0.TC005 (2005-01-05) + - Steven Wittens's unicode methods were removed. + - All unicode methods were rewritten from scratch. + - TCPDF is now licensed as LGPL. + +1.53.0.TC004 (2005-01-04) + - this changelog were added. + - removed commercial fonts for licensing issue. + - Bitstream Vera Fonts were added (http://www.bitstream.com/font_rendering/products/dev_fonts/vera.html). + - Now the AddFont and SetFont functions returns the basic font if the styled version do not exist. + +EOF -------------------------------------------------------- diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/LICENSE.TXT b/phpMyAdmin/vendor/tecnickcom/tcpdf/LICENSE.TXT new file mode 100755 index 0000000..ec191e2 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/LICENSE.TXT @@ -0,0 +1,860 @@ +********************************************************************** +* TCPDF LICENSE +********************************************************************** + + TCPDF is free software: you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + 2002-2022 Nicola Asuni - Tecnick.com LTD + +********************************************************************** +********************************************************************** + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. + +********************************************************************** +********************************************************************** + + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. + +********************************************************************** +********************************************************************** diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/README.md b/phpMyAdmin/vendor/tecnickcom/tcpdf/README.md new file mode 100755 index 0000000..cf84322 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/README.md @@ -0,0 +1,84 @@ +# TCPDF +*PHP PDF Library* + +[![Donate via PayPal](https://img.shields.io/badge/donate-paypal-87ceeb.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20TCPDF%20project) +*Please consider supporting this project by making a donation via [PayPal](https://www.paypal.com/cgi-bin/webscr?cmd=_donations¤cy_code=GBP&business=paypal@tecnick.com&item_name=donation%20for%20TCPDF%20project)* + +* **category** Library +* **author** Nicola Asuni +* **copyright** 2002-2022 Nicola Asuni - Tecnick.com LTD +* **license** http://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE.TXT) +* **link** http://www.tcpdf.org +* **source** https://github.com/tecnickcom/TCPDF + + +## IMPORTANT +A new version of this library is under development at https://github.com/tecnickcom/tc-lib-pdf and as a consequence this version will not receive any additional development or support. +This version should be considered obsolete, new projects should use the new version as soon it will become stable. + + + +## Description + +PHP library for generating PDF documents on-the-fly. + +### Main Features: +* no external libraries are required for the basic functions; +* all standard page formats, custom page formats, custom margins and units of measure; +* UTF-8 Unicode and Right-To-Left languages; +* TrueTypeUnicode, OpenTypeUnicode v1, TrueType, OpenType v1, Type1 and CID-0 fonts; +* font subsetting; +* methods to publish some XHTML + CSS code, Javascript and Forms; +* images, graphic (geometric figures) and transformation methods; +* supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/script/formats.php) +* 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extension, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417; +* JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies; +* automatic page header and footer management; +* document encryption up to 256 bit and digital signature certifications; +* transactions to UNDO commands; +* PDF annotations, including links, text and file attachments; +* text rendering modes (fill, stroke and clipping); +* multiple columns mode; +* no-write page regions; +* bookmarks, named destinations and table of content; +* text hyphenation; +* text stretching and spacing (tracking); +* automatic page break, line break and text alignments including justification; +* automatic page numbering and page groups; +* move and delete pages; +* page compression (requires php-zlib extension); +* XOBject Templates; +* Layers and object visibility. +* PDF/A-1b support. + +### Third party fonts: + +This library may include third party font files released with different licenses. + +All the PHP files on the fonts directory are subject to the general TCPDF license (GNU-LGPLv3), +they do not contain any binary data but just a description of the general properties of a particular font. +These files can be also generated on the fly using the font utilities and TCPDF methods. + +All the original binary TTF font files have been renamed for compatibility with TCPDF and compressed using the gzcompress PHP function that uses the ZLIB data format (.z files). + +The binary files (.z) that begins with the prefix "free" have been extracted from the GNU FreeFont collection (GNU-GPLv3). +The binary files (.z) that begins with the prefix "pdfa" have been derived from the GNU FreeFont, so they are subject to the same license. +For the details of Copyright, License and other information, please check the files inside the directory fonts/freefont-20120503 +Link : http://www.gnu.org/software/freefont/ + +The binary files (.z) that begins with the prefix "dejavu" have been extracted from the DejaVu fonts 2.33 (Bitstream) collection. +For the details of Copyright, License and other information, please check the files inside the directory fonts/dejavu-fonts-ttf-2.33 +Link : http://dejavu-fonts.org + +The binary files (.z) that begins with the prefix "ae" have been extracted from the Arabeyes.org collection (GNU-GPLv2). +Link : http://projects.arabeyes.org/ + +### ICC profile: + +TCPDF includes the sRGB.icc profile from the icc-profiles-free Debian package: +https://packages.debian.org/source/stable/icc-profiles-free + + +## Developer(s) Contact + +* Nicola Asuni diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/VERSION b/phpMyAdmin/vendor/tecnickcom/tcpdf/VERSION new file mode 100755 index 0000000..28179fc --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/VERSION @@ -0,0 +1 @@ +6.6.2 diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/composer.json b/phpMyAdmin/vendor/tecnickcom/tcpdf/composer.json new file mode 100755 index 0000000..f06c733 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/composer.json @@ -0,0 +1,52 @@ +{ + "name": "tecnickcom/tcpdf", + "type": "library", + "description": "TCPDF is a PHP class for generating PDF documents and barcodes.", + "keywords": [ + "PDF", + "tcpdf", + "PDFD32000-2008", + "qrcode", + "datamatrix", + "pdf417", + "barcodes" + ], + "homepage": "http://www.tcpdf.org/", + "version": "6.6.2", + "license": "LGPL-3.0-only", + "authors": [ + { + "name": "Nicola Asuni", + "email": "info@tecnick.com", + "role": "lead" + } + ], + "require": { + "php": ">=5.3.0" + }, + "autoload": { + "classmap": [ + "config", + "include", + "tcpdf.php", + "tcpdf_parser.php", + "tcpdf_import.php", + "tcpdf_barcodes_1d.php", + "tcpdf_barcodes_2d.php", + "include/tcpdf_colors.php", + "include/tcpdf_filters.php", + "include/tcpdf_font_data.php", + "include/tcpdf_fonts.php", + "include/tcpdf_images.php", + "include/tcpdf_static.php", + "include/barcodes/datamatrix.php", + "include/barcodes/pdf417.php", + "include/barcodes/qrcode.php" + ] + }, + "archive": { + "exclude": [ + "/examples" + ] + } +} diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/config/tcpdf_config.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/config/tcpdf_config.php new file mode 100755 index 0000000..92317b1 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/config/tcpdf_config.php @@ -0,0 +1,227 @@ +. +// +// See LICENSE.TXT file for more information. +//============================================================+ + +/** + * Configuration file for TCPDF. + * @author Nicola Asuni + * @package com.tecnick.tcpdf + * @version 4.9.005 + * @since 2004-10-27 + */ + +// IMPORTANT: +// If you define the constant K_TCPDF_EXTERNAL_CONFIG, all the following settings will be ignored. +// If you use the tcpdf_autoconfig.php, then you can overwrite some values here. + + +/** + * Installation path (/var/www/tcpdf/). + * By default it is automatically calculated but you can also set it as a fixed string to improve performances. + */ +//define ('K_PATH_MAIN', ''); + +/** + * URL path to tcpdf installation folder (http://localhost/tcpdf/). + * By default it is automatically set but you can also set it as a fixed string to improve performances. + */ +//define ('K_PATH_URL', ''); + +/** + * Path for PDF fonts. + * By default it is automatically set but you can also set it as a fixed string to improve performances. + */ +//define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); + +/** + * Default images directory. + * By default it is automatically set but you can also set it as a fixed string to improve performances. + */ +//define ('K_PATH_IMAGES', ''); + +/** + * Deafult image logo used be the default Header() method. + * Please set here your own logo or an empty string to disable it. + */ +//define ('PDF_HEADER_LOGO', ''); + +/** + * Header logo image width in user units. + */ +//define ('PDF_HEADER_LOGO_WIDTH', 0); + +/** + * Cache directory for temporary files (full path). + */ +//define ('K_PATH_CACHE', '/tmp/'); + +/** + * Generic name for a blank image. + */ +define ('K_BLANK_IMAGE', '_blank.png'); + +/** + * Page format. + */ +define ('PDF_PAGE_FORMAT', 'A4'); + +/** + * Page orientation (P=portrait, L=landscape). + */ +define ('PDF_PAGE_ORIENTATION', 'P'); + +/** + * Document creator. + */ +define ('PDF_CREATOR', 'TCPDF'); + +/** + * Document author. + */ +define ('PDF_AUTHOR', 'TCPDF'); + +/** + * Header title. + */ +define ('PDF_HEADER_TITLE', 'TCPDF Example'); + +/** + * Header description string. + */ +define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); + +/** + * Document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]. + */ +define ('PDF_UNIT', 'mm'); + +/** + * Header margin. + */ +define ('PDF_MARGIN_HEADER', 5); + +/** + * Footer margin. + */ +define ('PDF_MARGIN_FOOTER', 10); + +/** + * Top margin. + */ +define ('PDF_MARGIN_TOP', 27); + +/** + * Bottom margin. + */ +define ('PDF_MARGIN_BOTTOM', 25); + +/** + * Left margin. + */ +define ('PDF_MARGIN_LEFT', 15); + +/** + * Right margin. + */ +define ('PDF_MARGIN_RIGHT', 15); + +/** + * Default main font name. + */ +define ('PDF_FONT_NAME_MAIN', 'helvetica'); + +/** + * Default main font size. + */ +define ('PDF_FONT_SIZE_MAIN', 10); + +/** + * Default data font name. + */ +define ('PDF_FONT_NAME_DATA', 'helvetica'); + +/** + * Default data font size. + */ +define ('PDF_FONT_SIZE_DATA', 8); + +/** + * Default monospaced font name. + */ +define ('PDF_FONT_MONOSPACED', 'courier'); + +/** + * Ratio used to adjust the conversion of pixels to user units. + */ +define ('PDF_IMAGE_SCALE_RATIO', 1.25); + +/** + * Magnification factor for titles. + */ +define('HEAD_MAGNIFICATION', 1.1); + +/** + * Height of cell respect font height. + */ +define('K_CELL_HEIGHT_RATIO', 1.25); + +/** + * Title magnification respect main font size. + */ +define('K_TITLE_MAGNIFICATION', 1.3); + +/** + * Reduction factor for small font. + */ +define('K_SMALL_RATIO', 2/3); + +/** + * Set to true to enable the special procedure used to avoid the overlappind of symbols on Thai language. + */ +define('K_THAI_TOPCHARS', true); + +/** + * If true allows to call TCPDF methods using HTML syntax + * IMPORTANT: For security reason, disable this feature if you are printing user HTML content. + */ +define('K_TCPDF_CALLS_IN_HTML', false); + +/** + * If true and PHP version is greater than 5, then the Error() method throw new exception instead of terminating the execution. + */ +define('K_TCPDF_THROW_EXCEPTION_ERROR', false); + +/** + * Default timezone for datetime functions + */ +define('K_TIMEZONE', 'UTC'); + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/AUTHORS b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/AUTHORS new file mode 100755 index 0000000..94df1e3 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/AUTHORS @@ -0,0 +1,54 @@ +abysta at yandex.ru +Adrian Schroeter +Aleksey Chalabyan +Andrey Valentinovich Panov +Ben Laenen +Besarion Gugushvili +Bhikkhu Pesala +Clayborne Arevalo +Dafydd Harries +Danilo Segan +Davide Viti +David Jez +David Lawrence Ramsey +Denis Jacquerye +Dwayne Bailey +Eugeniy Meshcheryakov +Gee Fung Sit +Heikki Lindroos +James Cloos +James Crippen +John Karp +Keenan Pepper +Lars Naesbye Christensen +Lior Halphon +MaEr +Mashrab Kuvatov +Max Berger +Mederic Boquien +Michael Everson +MihailJP +Misu Moldovan +Nguyen Thai Ngoc Duy +Nicolas Mailhot +Norayr Chilingarian +Ognyan Kulev +Ondrej Koala Vacha +Peter Cernak +Remy Oudompheng +Roozbeh Pournader +Rouben Hakobian +Sahak Petrosyan +Sander Vesik +Stepan Roh +Stephen Hartke +Steve Tinney +Tavmjong Bah +Thomas Henlich +Tim May +Valentin Stoykov +Vasek Stodulka +Wesley Transue +Yoshiki Ohshima + +$Id: AUTHORS 2495 2011-11-14 22:56:26Z noct_dreamer $ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/BUGS b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/BUGS new file mode 100755 index 0000000..49b36de --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/BUGS @@ -0,0 +1,3 @@ +See http://dejavu.sourceforge.net/wiki/index.php/Bugs + +$Id: BUGS 80 2004-11-13 13:12:02Z src $ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE new file mode 100755 index 0000000..254e2cc --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/LICENSE @@ -0,0 +1,99 @@ +Fonts are (c) Bitstream (see below). DejaVu changes are in public domain. +Glyphs imported from Arev fonts are (c) Tavmjong Bah (see below) + +Bitstream Vera Fonts Copyright +------------------------------ + +Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream Vera is +a trademark of Bitstream, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of the fonts accompanying this license ("Fonts") and associated +documentation files (the "Font Software"), to reproduce and distribute the +Font Software, including without limitation the rights to use, copy, merge, +publish, distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to the +following conditions: + +The above copyright and trademark notices and this permission notice shall +be included in all copies of one or more of the Font Software typefaces. + +The Font Software may be modified, altered, or added to, and in particular +the designs of glyphs or characters in the Fonts may be modified and +additional glyphs or characters may be added to the Fonts, only if the fonts +are renamed to names not containing either the words "Bitstream" or the word +"Vera". + +This License becomes null and void to the extent applicable to Fonts or Font +Software that has been modified and is distributed under the "Bitstream +Vera" names. + +The Font Software may be sold as part of a larger software package but no +copy of one or more of the Font Software typefaces may be sold by itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF COPYRIGHT, PATENT, +TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL BITSTREAM OR THE GNOME +FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, INCLUDING +ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF +THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE +FONT SOFTWARE. + +Except as contained in this notice, the names of Gnome, the Gnome +Foundation, and Bitstream Inc., shall not be used in advertising or +otherwise to promote the sale, use or other dealings in this Font Software +without prior written authorization from the Gnome Foundation or Bitstream +Inc., respectively. For further information, contact: fonts at gnome dot +org. + +Arev Fonts Copyright +------------------------------ + +Copyright (c) 2006 by Tavmjong Bah. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the fonts accompanying this license ("Fonts") and +associated documentation files (the "Font Software"), to reproduce +and distribute the modifications to the Bitstream Vera Font Software, +including without limitation the rights to use, copy, merge, publish, +distribute, and/or sell copies of the Font Software, and to permit +persons to whom the Font Software is furnished to do so, subject to +the following conditions: + +The above copyright and trademark notices and this permission notice +shall be included in all copies of one or more of the Font Software +typefaces. + +The Font Software may be modified, altered, or added to, and in +particular the designs of glyphs or characters in the Fonts may be +modified and additional glyphs or characters may be added to the +Fonts, only if the fonts are renamed to names not containing either +the words "Tavmjong Bah" or the word "Arev". + +This License becomes null and void to the extent applicable to Fonts +or Font Software that has been modified and is distributed under the +"Tavmjong Bah Arev" names. + +The Font Software may be sold as part of a larger software package but +no copy of one or more of the Font Software typefaces may be sold by +itself. + +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL +TAVMJONG BAH BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +Except as contained in this notice, the name of Tavmjong Bah shall not +be used in advertising or otherwise to promote the sale, use or other +dealings in this Font Software without prior written authorization +from Tavmjong Bah. For further information, contact: tavmjong @ free +. fr. + +$Id: LICENSE 2133 2007-11-28 02:46:28Z lechimp $ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/NEWS b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/NEWS new file mode 100755 index 0000000..c846d49 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/NEWS @@ -0,0 +1,1373 @@ +Changes from 2.33 to 2.34 +* Sans, SansMono, Serif: unlinked references of U+2596 for bug 50848 + (by Denis Jacquerye) +* Sans, SansMono, Serif: added U+A7AA (by Denis Jacquerye) +* Sans, SansMono, Serif: added U+2A6A, U+2A6B, U+2E1F based on U+223B + (by Denis Jacquerye) +* Sans, Serif: removed superfluous ligature definitions for ffl und ffi + (bug 55363) (by Gee Fung Sit 钖涜嚦宄�) +* Sans, Serif: swapped glyphs for U+25D2 and U+25D3 (bug 55197) + (by Gee Fung Sit 钖涜嚦宄�) +* Sans, Serif: added U+A740, U+A741 (by Denis Jacquerye) +* Sans: added U+20BA Turkish Lira sign (by Denis Jacquerye) +* Sans: replaced Georgian Asomtavruli U+10A0-U+10C5 and Mkhedruli U+10D0-U+10FC + with new version (by Besarion Gugushvili) +* Sans: added Georgian Nuskhuri U+2D00-U+U+2D25 (by Besarion Gugushvili) +* Sans: added Private Use Area glyphs for Georgian U+F400-U+F441 + (by Besarion Gugushvili) +* Sans: tweaked U+0250, U+0254 (by Denis Jacquerye) +* Sans: adjusted hinting of U+032C-U+032D, avoiding problem on some platforms + (by Denis Jacquerye) +* Sans: added U+A7A0-U+A7A9, pre-1921 Latvian letters with oblique stroke + (by Denis Jacquerye) +* Sans: added anchors to U+2C6D (by Denis Jacquerye) +* Sans: added cedilla anchor to some Latin characters (by Denis Jacquerye) +* Sans: added ogonek anchor to A, E, O, U, Y (by Denis Jacquerye) +* Sans: adjusted ogonek reference in U+0172, U+01EA, U+01EB + (by Denis Jacquerye) +* Sans: added anchors to U+0104, U+0105 (by Denis Jacquerye) +* Sans: added U+1F600, U+1F611, U+1F615, U+1F617, U+1F619, U+1F61B, U+1F61F, + U+1F626-U+1F627, U+1F62E-U+1F62F, U+1F634 (by Gee Fung Sit 钖涜嚦宄�) +* Sans: replaced U+27A1 with mirror image of U+2B05 for consistency + (by Gee Fung Sit 钖涜嚦宄�) +* Sans: copied hints from U+14A3, U+14A7 to U+2142-U+2143 + (by Gee Fung Sit 钖涜嚦宄�) +* Sans: added Lisu block (by Gee Fung Sit 钖涜嚦宄�) +* Sans: typographical improvements to U+0166-U+0167, U+02A6, U+02AA + (by Gee Fung Sit 钖涜嚦宄�) +* Sans: slightly change hinting of "2" to fix bug 37395 (by Ben Laenen) +* Sans: fixed U+1444 which had wrong top dot that shouldn't be there + (by Denis Jacquerye) +* Sans: added anchors for diacritics to U+01B7, U+01B8, U+01B9, U+0292 + (by Denis Jacquerye) +* Sans: added U+01B7, U+01B8 to context for case diacritics above +* SansMono: fixed U+0574 (by Ruben Hakobian) +* SansMono: added U+2016, U+27C2 (by Yoshiki Ohshima) +* SansMono: added U+02CE, U+02CF (by Denis Jacquerye) +* SansMono: added U+2148, U+27E6-U+27E7, U+2B05-U+2B0D, U+1D55A + (by Gee Fung Sit 钖涜嚦宄�) +* Serif: added U+02BA, U+02C2-U+02C5, U+02CA-U+02CB, U+02D7, U+02F3, U+02F7, + U+046C-U+046D, U+0476-U+0477, U+1D7C-U+1D7F, U+20B8, U+2132, U+214E, U+2C7B + to Serif (by Gee Fung Sit 钖涜嚦宄�) +* Serif: typographic improvements to U+0194, U+01B1, U+0263, U+028A, U+02A6, + U+02A8, U+02AA, U+02E0, U+03DC, U+1D3B, U+1D7B (by Gee Fung Sit 钖涜嚦宄�) +* Serif: added small cap versions of q, x (in italic styles), delta, theta, xi, + sigma, phi, omega, not wired in yet (by Gee Fung Sit 钖涜嚦宄�) +* Serif: added anchors to U+0234-U+0236 (by Gee Fung Sit 钖涜嚦宄�) +* Serif: added U+02EC, U+02EF, U+02F0, U+0360 (by Denis Jacquerye) + +Changes from 2.32 to 2.33 + +* added Old Italic block to Sans (by MaEr) +* added U+051E, U+051F to Sans (by MaEr) +* added U+01BA, U+0372-U+0373, U+0376-U+0377, U+03CF, U+1D00-U+1D01, + U+1D03-U+1D07, U+1D0A-U+1D13, U+1D15, U+1D18-U+1D1C, U+1D20-U+1D2B, + U+1D2F, U+1D3D, U+1D5C-U+1D61, U+1D66-U+1D6B, U+1DB8, U+1E9C-U+1E9D, + U+1EFA-U+1EFB, U+2C60-U+2C61, U+2C63, U+A726-U+A73C, U+A73E-U+A73F, + U+A746-U+A747, U+A74A-U+A74B, U+A74E+U+A74F, U+A768-U+A769, U+A77B-U+A77C, + U+A780-U+A787, U+A790-U+A791, U+A7FA-U+A7FF to Serif (by Gee Fung Sit 钖涜嚦宄�) +* added alternate forms to U+014A and U+01B7 in Serif (by Gee Fung Sit 钖涜嚦宄�) +* typographical improvements to U+0166-U+0167, U+0197, U+01B5-U+01B6, U+01BB, + U+0222-U+0223, U+023D, U+0250-U+0252, U+026E, U+0274, U+028F, U+029F, + U+02A3-U+02A5, U+02AB, U+03FE-U+03FF, U+1D02, U+1D14, U+1D1D-U+1D1F, U+1D3B, + U+1D43-U+1D46, U+1D59, U+1D9B, U+2C71, U+2C73 in Serif (by Gee Fung Sit 钖涜嚦宄�) +* fixed bugs #31762 and #34700 plus other small fixes (wrong direction, + duplicate points, etc.) for Sans and Serif (by Gee Fung Sit 钖涜嚦宄�) +* added U+204B to Mono (by Gee Fung Sit 钖涜嚦宄�) +* added U+26E2 to Sans (by Gee Fung Sit 钖涜嚦宄�) +* added Playing Cards block (U+1F0A0-U+1F0DF) to Sans (by Gee Fung Sit 钖涜嚦宄�) +* emoticons in Sans: replace U+2639-U+263B with better versions, add + U+1F601-U+1F610, U+1F612-U+1F614, U+1F616, U+1F618, U+1F61A, U+1F61C-U+1F61E, + U+1F620-U+1F624, U+1F625, U+1F628-U+1F62B, U+1F62D, U+1F630-U+1F633, + U+1F635-U+1F640 (by Ben Laenen and Denis Jacquerye) +* added U+A78E, U+A790-U+A791 to Sans and Mono (by Denis Jacquerye) +* added U+A7FA to Sans (by Denis Jacquerye) +* subscripts: added U+2095-U+209C to Sans, Serif and Mono, adjusted + U+1D49-U+1D4A in Sans and Mono (by Denis Jacquerye) +* added U+0243 to Mono (by Denis Jacquerye) +* adjusted U+0307 to match dot of i, replaced dotaccent U+02D9 with U+0307 in +most dependencies in Sans (by Denis Jacquerye) +* adjusted anchors of f and added them to long s in Sans (by Denis Jacquerye) +* added anchors to precomposed dependencies of D and d (by Denis Jacquerye) +* added debug glyphs U+F002 and U+F003 which will show current point size (by + Ben Laenen) +* use correct version for Serbian italic be (by Eugeniy Meshcheryakov) +* added pictograms U+1F42D-U+1F42E, U+1F431, U+1F435 (by Denis Jacquerye) +* improved Hebrew in Sans (by Lior Halphon) +* improved Armenian in Sans, and added Armenian in Serif and Mono (by Rouben + Hakobian (Tarumian), Aleksey Chalabyan and Norayr Chilingarian) +* remove "locl" feature for Romanian for S/T/s/t with cedilla/comma accent (by + Ben Laenen) +* replace wrong "dflt" script tag in Mono with "DFLT" (by Ben Laenen) + +Changes from 2.31 to 2.32 + +* added to Sans: Latin small letter p with stroke (U+1D7D), Latin capital + letter p with stroke through descender (U+A750), Latin small letter p with + stroke through descender (U+A751), Latin capital letter thorn with stroke + (U+A764), Latin small letter thorn with stroke (U+A765), Latin capital letter + thorn with stroke through descender (U+A766), Latin small letter thorn with + stroke through descender (U+A767), Latin capital letter q with stroke through + descender (U+A756), Latin small letter q with stroke through descender + (U+A757), Latin capital letter p with flourish (U+A752), Latin small letter p + with flourish (U+A753) (by Ben Laenen) +* add new Indian rupee symbol (U+20B9) to Sans, Serif and Mono (although + standardization in Unicode not complete yet, UTC did assign this code point) + (by Ben Laenen) +* Sans: adjusted U+0E3F, U+20AB, U+20AD-U+20AE, U+20B1, U+20B5, U+20B8 to have + them take up the same width as digits (by Gee Fung Sit 钖涜嚦宄�) +* added U+23E8 to Sans (by Thomas Henlich) +* fixed numerous bugs (#22579, #28189, #28977, N'Ko in Windows, fixed U+FB4F, + anchors for U+0332-U+0333, made extensions in Misc. Technical connect, and + other small fixes) (by Gee Fung Sit 钖涜嚦宄�) +* added looptail g as stylistic variant to Serif (by Gee Fung Sit 钖涜嚦宄�) +* added the remaining precomposed characters in Latin Extended Additional in + Serif (by Gee Fung Sit 钖涜嚦宄�) +* added Georgian Mkhedruli (U+10D0-U+10FC) to Sans ExtraLight (by Besarion + Gugushvili) +* fix spacing in hinting of U+042E (挟) in Mono (by Ben Laenen) +* replaced U+2650 and minor changes to U+2640-U+2642, U+2699, U+26A2-U+26A5, + U+26B2-U+26B5, U+26B8 in Sans (by Gee Fung Sit 钖涜嚦宄�) +* added U+1E9C-U+1E9D, U+1EFA-U+1EFB, U+2028-U+2029, U+20B8, U+2150-U+2152, + U+2189, U+26C0-U+26C3, U+A722-U+A725, U+1F030-U+1F093 to Sans (by Gee Fung + Sit 钖涜嚦宄�) +* added U+1E9C-U+1E9E, U+1EFA-U+1EFB, U+2028-U+2029, U+20B8, U+2181-U+2182, + U+2185 U+A722-U+A725, to Sans ExtraLight (by Gee Fung Sit 钖涜嚦宄�) +* added U+20B8, U+22A2-U+22A5, U+A722-U+A725 to Mono (by Gee Fung Sit 钖涜嚦宄�) +* added U+02CD, U+01BF, U+01F7, U+0222-U+0223, U+0243-U+0244, U+0246-U+024F, + U+2150-U+2152, U+2189, U+239B-U+23AD and U+A73D to Serif (by Gee Fung Sit + 钖涜嚦宄�) + +Changes from 2.30 to 2.31 + +* fixed bug where Serif Condensed Italic wouldn't get proper subfamily tags (by + Ben Laenen) +* added math operators U+2234-U+2237 to Mono (by Ben Laenen) +* removed buggy instructions of U+032D (by Eugeniy Meshcheryakov) +* added U+2C70, U+2C7E, U+2C7F to Sans and Sans Mono (by Denis Jacquerye) +* added U+2C7D to Sans Mono (by Denis Jacquerye) +* added U+2C6D, U+2C70-2C73, U+2C7E-2C7F to Serif (by Denis Jacquerye) +* added extremas to alpha U+03B1 in Serif-Italic (by Denis Jacquerye) +* added U+4A4, U+4A5 to Mono (by Andrey V. Panov) +* added Arabic letters U+0657, U+0670, U+0688-U+0690, U+0693-U+0694, + U+0696-U+0697, U+0699-U+06A0, U+06A2-U+06A3, U+06A5, U+06A7-U+06A8, + U+06AA-U+06AE, U+06B0-U+06B4, U+06B6-U+06B9, U+06BB-U+06BE and their + contextual forms to Sans (by MihailJP) +* added U+A78D LATIN CAPITAL LETTER TURNED H for coming Unicode 6.0 (by Denis + Jacquerye) + +Changes from 2.29 to 2.30 + +* added U+0462-U+0463 to Mono (by Denis Jacquerye) +* corrected U+1E53 in Serif (by Gee Fung Sit) +* added U+1E4C-U+1E4D to Mono and Serif (by Gee Fung Sit) +* added U+1E78-U+1E79 to Mono (by Gee Fung Sit) +* fixed missing diacritics in Latin Extended Additional in Sans ExtraLight + (moved stacked diacritics out of PUA in the process) (by Gee Fung Sit) +* fixed anchors on U+1E78 in Serif (by Gee Fung Sit) +* added U+1DC4-U+1DC9 to Serif (by Denis Jacquerye) +* renamed above-mark to above-mark in Serif-Italic (by Denis Jacquerye) +* added U+1DC4-U+1DC9 to context class for dotless substitution (by Denis + Jacquerye) +* changed Doubleacute to Doublegrave in Sans ExtraLight (by Gee Fung Sit) +* removed redundant reference in U+01FB in Sans Oblique (by Gee Fung Sit) +* added U+A726-U+A727 to Mono (Denis Jacquerye) +* changed U+04BE and U+04BF according to recommedations of Sasha Ankwab in Sans + (by Andrey V. Panov) +* remove "Symbol Charset" from set of codepages in Sans (by Eugeniy + Meshcheryakov) + +Changes from 2.28 to 2.29 + +* modified U+10FB in Sans to be a mirror image of U+2056, since U+10FB is not + Georgian-specific (by Roozbeh Pournader) +* added U+2B1F, U+2B24, U+2B53, U+2B54 in Sans (by Roozbeh Pournader) +* fixed TUR opentype language tag to TRK in Serif (bug 19825) (by Ben Laenen) +* early implementation of Abkhaz letter U+0524-U+0525 in Sans + (by Michael Everson and abysta) +* flipped U+1D538 in Sans (by Gee Fung Sit) +* added U+26B3-U+26B8, U+1D7D8-U+1D7E1 in Sans (by Gee Fung Sit) +* corrected U+1D7A9 in Sans Bold Oblique (by Gee Fung Sit) +* Fixed U+0649 to be dual-joining in Sans Mono (by Roozbeh Pournader) +* Remove unnecessary 'isol' feature from Sans Mono (by Roozbeh Pournader) +* Remove 'cmap' mappings for U+066E, U+066F, U+067C, U+067D, U+0681, U+0682, + U+0685, U+0692, U+06A1, U+06B5, U+06BA, U+06C6, U+06CE, and U+06D5 + in Sans Mono (bug 20323) (by Roozbeh Pournader) +* add half brackets (U+2E22 - U+2E25, by Steve Tinney) + +Changes from 2.27 to 2.28 + +* added U+A789, U+A78A in Sans and Sans Mono (by Denis Jacquerye) +* modified U+02D6, U+02D7, U+02EE in Sans and Sans Mono (by Denis Jacquerye) +* added U+1E9E (German capital 脽) to Sans and Serif (by Denis Jacquerye) +* adjusted width of U+01B7-U+01B9 in Serif Italic (by Denis Jacquerye) +* modified U+021C, U+021D in Sans (by Denis Jacquerye) +* added U+021C, U+021D in Mono (by Denis Jacquerye) +* added U+F428 (Georgian Nuskhuri "f") in private use area (by Besarion + Gugushvili) +* updated Georgian mkhedruli (U+10D0-U+10FA) with new version (by Besarion + Gugushvili) +* updated Georgian asomtavruli (U+10A0-U+10C5) with new version (by Besarion + Gugushvili) +* added Georgian nuskhuri (U+2D00-U+2D25) (by Besarion Gugushvili) +* added Georgian mtavruli in private use area (U+F400-U+F426) (by Besarion + Gugushvili) +* added mark anchors above to Cyrillic U+0430-U+0438, U+043A-U+044F, + U+0454-U+0455 in Mono (by Ben Laenen) +* modified/moved up U+0318-U+0319, U+031C-U+031F, U+0329-U+032A, U+032C-U+032D, + U+0339-U+033B, U+0348 and U+0353 in Sans to prevent cut-off (by Gee Fung Sit) +* added U+035A to Sans (by Gee Fung Sit) +* updated fontconfig files (by Nicolas Mailhot) +* added U+2032-2037 to Mono (by Denis Jacquerye) +* added Ogham to Sans ExtraLight (by Gee Fung Sit) +* added U+2C6F, U+2C79, U+2C7C-2C7D to Mono (by Gee Fung Sit) +* added U+210F to Serif and Sans ExtraLight (by Gee Fung Sit) +* changed U+210F to a more common glyph in Sans and Mono (by Gee Fung Sit) + +Changes from 2.26 to 2.27 + +* added some of Michael Everson's new Cyrillic glyphs to Sans (by Wesley + Transue) +* removed blank glyph at U+05EF from Sans Bold Oblique (by Gee Fung Sit) +* small adjustments to existing tone bars in Sans and Mono (by Gee Fung Sit) +* added U+0372-U+0373, U+0376-U+0377, U+03CF, U+A668-U+A66E, U+A708-U+A711, + U+A71B-U+A71F to Sans (by Gee Fung Sit) +* copied U+02E5-U+02E9 over from Sans to fix inconsistencies in Serif (by Gee + Fung Sit) +* added U+021C-U+021D, U+0370-U+0371, U+037B-U+037D, U+0470-U+0471, + U+0510-U+0515, U+051A-U+051D, U+1E9F, U+2C64, U+2C6E-U+2C6F, U+2C79, + U+2C7C-U+2C7D, U+A644-U+A647, U+A650-U+A651, U+A654-U+A657, U+A708-U+A716, + U+A71B-U+A71F to Serif (by Gee Fung Sit) +* added U+A708-U+A716, U+A71B-U+A71F to Mono (by Gee Fung Sit) +* added anchors to U+017F (趴) and fixed U+1E9B (岷�) in Serif (by Gee Fung Sit) +* made U+0325 smaller in Sans Bold and Serif to match Sans Book (by Gee Fung + Sit) +* fixes to U+02F3 (moved up), U+228F-U+2294 (more square-like) and + U+22CE-U+22CF (stroke width) in Sans (by Gee Fung Sit) +* replaced U+2202 鈭� (Sans and Mono) and U+221D 鈭�, U+221E 鈭� (Sans) with glyphs + from Arev (with small changes) (by Gee Fung Sit) +* added U+22B0-U+22B1, U+22C7, U+22D0-U+22D5 from Arev to Sans to complete the + block (by Gee Fung Sit) +* added U+0514-U+0515 to Sans ExtraLight (by Gee Fung Sit) +* skewed U+A78C in all Oblique/Italic fonts (by Gee Fung Sit) +* moved U+2215 to U+2044 in Sans and Serif and replaced U+2215 with reference + to U+002F in all fonts (by Gee Fung Sit) +* added U+2C6E to Mono (by Denis Jacquerye) +* added U+A782 and U+A783 in Sans (by Wesley Transue) +* added U+0244, U+024C-024D, U+2C64 in Sans Mono (by Denis Jacquerye) +* modified U+01AE in Sans Mono (by Denis Jacquerye) +* added U+2C7A to all fonts (by Gee Fung Sit) +* italicized/small changes to U+2C76 in Serif (Bold) Italic (by Gee Fung Sit) +* improved outlines of U+2C68, U+2C6A, U+2C6C in Serif (Bold) Italic (by Gee + Fung Sit) +* rounded U+2C77 at the bottom in Serif (by Gee Fung Sit) +* added joining behavior for tone letters (U+02E5-U+02E9) in Sans (bug #15669) + (by Gee Fung Sit) +* fixed outline of y.alt in Sans Regular (by Denis Jacquerye) +* changed references of U+1D5A8, U+1D5C5, U+1D5DC, U+1D5F9, U+1D610, U+1D62D, + U+1D644 and U+1D661 to stylistic alternates to have a better distinction (by + Gee Fung Sit) +* hinted I.alt in Sans Regular (by Gee Fung Sit) +* added U+0487, completing Cyrillic block (by Gee Fung Sit) +* extended the bar of U+0463 to the right and moved the anchor (by Gee Fung + Sit) +* added anchors to glyphs in Cyrillic block (by Gee Fung Sit) +* added (preliminary) hints to tone letter forms (U+02E5.5, U+02E9.1, stem) in + Sans Book (by Gee Fung Sit) + +Changes from 2.25 to 2.26 + +- added glyphs for Cyrillic-B to Sans (by Wesley Transue) +- added U+0370-U+0371 to Sans (by Wesley Transue) +- added U+019C, U+01A2-U+01A3, U+01A6, U+01E4-U+01E5, U+024C-U+024D, U+0285, + U+0290, U+02A0, U+0370-U+0371, U+03F1, U+03FC to Sans ExtraLight (by Wesley + Transue) +- added U+20A0-U+20A5, U+20A7-U+20B3, U+2105, U+210D, U+210F, U+2115, U+2117, + U+2119-U+211A, U+211D, U+2124, U+212E, U+2200-U+2204 to Mono (by Heikki + Lindroos) +- added U+01BA and U+01BF to Mono (by Heikki Lindroos) +- merged OpenType "aalt" feature in Latin in Sans (by Denis Jacquerye) +- added alternative shape for y in Sans (by Denis Jacquerye) +- added saltillo (U+A78B-U+A78C) to all faces (by James Cloos) +- changed U+047C-U+047D to references instead of outlines in Sans (by Wesley + Transue) +- added Latin letter tresillo U+A72A-U+A72B to Sans (by Wesley Transue) +- added U+A734-U+A737 to Sans (by Wesley Transue) +- added U+2053 to Serif and fixed it bug:9425 in Sans (by Gee Fung Sit) +- removed problematic hints for U+0423 bug:10025 (by Gee Fung Sit) +- added U+27C5-U+27C6 bug:10255 to all faces (by Gee Fung Sit) +- fixed width of U+2016 in Sans Oblique (by Gee Fung Sit) +- added U+2016, U+2032-U+2038, U+2042, U+2045-U+2046, U+204B-U+204F, + U+2051-U+2052, U+2057 to Serif (by Gee Fung Sit) +- made U+2140 bigger to match other n-ary operators (by Gee Fung Sit) +- added U+0606-U+0607, U+0609-U+060A to Sans (by Gee Fung Sit) +- added U+221B-U+221C to Mono (by Gee Fung Sit) +- small adjustments to U+221B-U+221C in Sans and Serif (by Gee Fung Sit) +- update U+04B4-U+04B5 in Serif (by Andrey V. Panov) +- increased max-storage value from maxp table to 153 (by Andrey V. Panov) +- added U+0472-U+0473, U+0510-U+0511, U+051A-U+051D, U+0606-U+0607, + U+0609-U+060A, U+1E26-U+1E27, U+1E54-U+1E55, U+1E7C-U+1E7D, U+1E8C-U+1E8D, + U+1E90-U+1E91, U+1E97-U+1E99, U+1E9F, U+1EAC-U+1EAD, U+1EB6-U+1EB7, + U+1EC6-U+1EC7, U+1ED8-U+1EDD, U+1EE0-U+1EE3, U+1EE8-U+1EEB, U+1EEE-U+1EF1 to + Mono (by Gee Fung Sit) +- added locl rules for S/T cedilla for Romanian and Moldavian so they get + rendered as S/T with comma accent (see Redhat bug #455981) (by Ben Laenen) +- removed ligature rule from Armenian U+0587 bug:16113 (by Gee Fung Sit) + +Changes from 2.24 to 2.25 + +- moved/added U+2E18 (by Gee Fung Sit) +- added empty glyph for U+2064 in Sans and Serif (by Gee Fung Sit) +- added U+22CE-U+22CF to Sans (by Gee Fung Sit) +- Sans Oblique and Bold Oblique, Serif: reverted digits hinting instructions back to before revision 1590, which fixed mistaken debian bug #471024. This fixes Debian bug #411308. The original bug was in freetype not in the fonts (by Denis Jacquerye) +- added U+A726-U+A729, U+A730-U+A733, U+A738-U+A73F, U+A746-U+A74B, U+A74E-U+A74F, U+A780-U+A781, U+A7FB-U+A7FF to Sans (by Gee Fung Sit) +- added Macedonian italic glyph shape for U+0453 in Serif (by Ben Laenen) +- changed descenders in U+0446, U+0449, U+0497, U+04A3, U+04AD (by Andrey V. Panov) +- updated main SFD files to SplineFontDB 3.0 (Denis Jacquerye and Gee Fung Sit) +- moved U+0561 2 up since it wasn't aligned with the baseline well (by Ben Laenen) +- added U+2E2E to Sans (by Gee Fung Sit) +- replaced U+2699 with simpler version in Sans (by Gee Fung Sit) +- added a lot of hinting instructions to Latin Extended B, Greek and Coptic glyphs Sans Book (by Wesley Transue) +- differentiated U+2219 from U+22C5 and adjusted affected references in Sans and Mono (by Gee Fung Sit) +- made Hebrew narrower in Sans Bold and Sans Bold Oblique (by Denis Jacquerye) +- added Kurdish and Chuvash letters from Unicode 5.1 Cyrillic Extended block (by Wesley Transue) +- added U+1E9F, U+A644-U+A647, U+A64C-U+A64D, U+A650-U+A651, U+A654-U+A655, U+A712U+A716 to Sans (by Gee Fung Sit) +- added several glyphs to Sans ExtraLight (by Gee Fung Sit) +- added hinting instructions to U+046A-U+046B, U+0508-U+0509, U+050B, U+0512-U+0513 in Sans Book (by Wesley Transue) +- corrected width of U+027E in Sans Book (by Gee Fung Sit) +- added U+2C79, U+2C7B-U+2C7D to Sans (by Gee Fung Sit) +- added a bunch of glyphs+small corrections to Sans Light (by Gee Fung Sit) +- added U+0496, U+0497, U+04B0, U+04B1 (by Andrey V. Panov) +- updated U+0493, U+049B, U+04B3, U+04B7, U+04F7 (by Andrey V. Panov) +- further improvements in extended Cyrillic (by Andrey V. Panov) + +Changes from 2.23 to 2.24 + +- instructions for U+05C0 讇, U+05C3 變, U+05F3 壮, and U+05F4 状 in DejaVu + Sans. (by Wesley Transue) +- instructions for U+2116 in Sans (by Andrey V. Panov) +- Unicode 5.1 update: moved U+F208 to U+2C6D, U+F25F to U+2C71, added + U+2C6E-U+2C6F, U+2C72-U+2C73, updated outline of U+2C71 in Sans. (by + Denis Jacquerye) +- updated and instructed U+0401 in Sans (by Andrey V. Panov) +- fixed the bug in Sans faces where U+02EC 爽 faced the wrong direction. + Also, added a few more glyph instructions. (by Wesley Transue) +- removed OS2Sub and OS2Strike that weren't intentional in Sans + ExtraLight. (by Denis Jacquerye) +- updated instructions for U+401, U+44F in Serif Book. (by Andrey V. + Panov) +- instructions for U+02C4 藙, U+02C5 藚, U+03D8 蠘, U+03D9 蠙, U+0494 覕, and + U+0495 視 in Sans Book. (by Wesley Transue) +- instructions for U+01A6 痞, U+0238 雀, U+0239 裙, U+02EC 爽, and U+05C6 讍 + in Sans Book. (by Wesley Transue) +- DejaVuSans.sfd DejaVuSerif.sfd: updated instructions for U+447 and + U+451 using code generated with xgridfit (by Andrey V. Panov) +- instructions for a few glyphs in the Latin Extended-B Block, Greek + Block, Cyrillic Block, and N'Ko block. (by Wesley Transue) +- updated sfdnormalize.pl, and SFD files to new SFD format with empty + lines. (by Denis Jacquerye) + +Changes from 2.22 to 2.23 + +- fixed bug which made Condensed fonts appear instead of normal width ones +- added U+20DB, U+20DC, and U+20E1 to Sans (by Roozbeh Pournader) +- added hinting instructions to U+01A7, U+01AA-U+01AC, U+01AE-U+01AF, + U+01BC-U+01BD, U+01BF, U+01F7, U+0277, U+027F, U+0285-U+0286, U+0297, U+02AF, + U+02B4-U+02B5, U+02BD, U+030D, U+0311, U+0329, U+04A0-U+04A1 in Sans Book (by + Wesley Transue) +- modified hinting instructions of U+04A2 in Sans Book (by Wesley Transue) +- added hinting instructions to U+237D, U+2423 in Mono Book and Mono Bold (by + Wesley Transue) +- added mathematical alphanumeric symbols to all styles (by Max Berger) +- added Unicode 5.1 U+2E18 as U+2E18.u51 (not yet usable) to Sans (by Roozbeh + Pournader) +- dereferenced all glyphs with mixed references and outlines (by Denis + Jacquerye) +- removed non-zero width from U+0344 in Sans (by Denis Jacquerye) + +Changes from 2.21 to 2.22 + +- directory structure has changed, we now use the Makefile +- modified Armenian U+0565 in Sans (by 諐铡瞻铡寨 諍榨湛謤崭战盏铡斩) +- added double struck letters and numbers U+2102, U+210D, U+2115, + U+2119-U+211A, U+211D, U+2124, U+213C-U+2140, U+2145-U+2149, U+1D538-U+1D539, + U+1D53B-U+1D53E, U+1D540-U+1D544, U+1D546, U+1D54A-U+1D550, U+1D552-U+1D56B, + U+1D7D8-U+1D7E1 to Serif (by Stephen Hartke) +- added letterlike symbols U+2103, U+2109, U+2127, U+214B, U+2141-U+2144 to + Serif (by Ben Laenen) +- fixed outline direction of U+2143 in Sans Bold/Bold Oblique (by Ben Laenen) +- added arrow set in Serif: arrows: U+2194-U+21FF; dingbats: U+27A1; + supplemental arrows A: U+27F0-U+27FF; supplemental arrows B: U+2900-U+2975, + U+297A; miscellaneous symbols and arrows: U+2B00-U+2B11 (by Ben Laenen) +- added U+0180, U+01DE, U+01E0-01E1, U+022A, U+022C, U+0230, U+1E08-U+1E09, + U+1E10-U+1E11, U+1EB0-U+1EB1 to Mono (by Denis Jacquerye) +- adjusted U+01D5, U+01D7, U+01D9, U+1DB in Mono (by Denis Jacquerye) +- added Ogham in Sans (by Wesley Transue) +- added Yijing Hexagram Symbols in Sans (by Wesley Transue) +- hinting instructions added to Cyrillic U+0460, U+04A6-U+04A7, U+04AC-U+04AD, + U+04C7-U+04C8, U+04F6-U+04F7, U+04FA-U+04FB, U+050C-U+050D in Sans Book (by + Wesley Transue) +- adjusted Cyrillic letters U+042A, U+044A, U+044C, U+0459-U+045B, U+0462, + U+048C-U+048D in Serif (by Andrey V. Panov) +- hinting instructions added to Lao U+0EB7 in Sans (by Wesley Transue) +- added Roman numerals and Claudian letter U+2160-U+2184 in Serif (by Ben + Laenen) +- added U+FFF9-U+FFFD to Sans, Serif and Mono (by Lars N忙sbye Christensen) +- added mathematical symbols to Serif: U+2200, U+2203-U+2204, U+2213-U+2214, + U+2217-U+2218, U+2223-U+2226, U+2250-U+2255, U+2295-U+22AF, U+22C5 (by Ben + Laenen) +- modified bullet symbol U+2219 in Serif (by Ben Laenen) + +Changes from 2.20 to 2.21 + +- added U+FE20-U+FE23 (half diacritics) to Sans (by Denis Jacquerye) +- added anchor "half" to position right half of double marks, U+FE21 or U+FE23 + to Sans (by Denis Jacquerye) +- shifted U+0360 up to avoid collision with some outlines in Sans (by Denis + Jacquerye) +- added anchor above-mark anchor to U+035D, U+035E, U+0360, U+0361 in Sans (by + Denis Jacquerye) +- added instructions for ff, ffi, ffl ligatures in Serif Bold (by Eugeniy + Meshcheryakov) +- added instructions to some N'Ko glyphs (by Wesley Transue) +- added instructions to some Lao glyphs (by Wesley Transue) +- cleaning up 'liga' Standard Ligature in Latin, in Sans and Sans Mono (by + Denis Jacquerye) +- added U+046A, U+046B (big yus) in Serif (by Andrey V. Panov) +- added box drawing symbols to Sans and Serif (by Lars N忙sbye Christensen) +- added Makefile to improve font and packages generating (by Nicolas Mailhot) + +Changes from 2.19 to 2.20 + +- removed TeX and TeXData tags from all sfd files (by Eugeniy Meshcheryakov) +- removed all 'frac' lookups (by Eugeniy Meshcheryakov) +- fixed duplicate glyph names (by Eugeniy Meshcheryakov) +- removed standard ligatures with U+00B7 in Mono (by Eugeniy Meshcheryakov) +- use reference to U+002D in U+00AD in Sans Oblique, and adjust instructions + (by Eugeniy Meshcheryakov) +- updated Cyrillic in Sans Extra Light (by Andrey V. Panov) +- added instructions to N'Ko U+07C1-U+07C6, U+07CA, U+07CE-U+07CF, U+07D1, + U+07D3-U+07D4, U+07D8, U+07DB and U+07EB in Sans (by Wesley Transue) +- added instructions to Lao U+0E8A, U+0E95, U+0E97, U+EA5, U+0EB4 and U+0EB5 + (by Wesley Transue) +- adjusted instructions for Hebrew glyphs (by Denis Jacquerye) +- added instructions for U+0265 in Sans Bold (by Denis Jacquerye) +- fix U+1D68 in Sans: it had the shape of delta, where it should be a rho (by + Ben Laenen) +- remove U+1D5C glyph in Sans Oblique (it was empty) (by Ben Laenen) +- fix instructions of U+01AD in Sans Bold (by Ben Laenen) +- fix instructions of U+042D in Serif (by Ben Laenen) +- remove buggy instructions of U+2328 in Serif (by Ben Laenen) +- corrected width of U+2C75-U+2C76 in Sans Bold and Serif Bold (by Gee Fung Sit) +- added U+2C75-U+2C77 to Mono (by Gee Fung Sit) + +Changes from 2.18 to 2.19 + +- fixed misplaced symbols (U+2325,2326) in Sans Oblique (by John Karp) +- added Mark to Base anchors: 'cedilla' for combining cedilla and + 'above-legacy' for stacking above precomposed glyphs (just a,e,i,o,u with + macron for now) in Sans (by Denis Jacquerye). +- added contextual substitution for Case and Dotless forms in all Sans variants + (by Denis Jacquerye). +- renamed 'ccmp' lookups for RTL and Basic (LGC, etc.) (by Denis Jacquerye) +- added anchor 'cedilla' for vowels in Sans. (by Denis Jacquerye) +- extended contextual dotless and case substitutions to handle both below and + above diacritics (by Denis Jacquerye) +- renamed Dotless and Case Form GSUB lookups in Sans with meaningful names (by + Denis Jacquerye) + +Changes from 2.17 to 2.18 + +- Re-encoded the source files for Full Unicode (by Ben Laenen) +- Re-enabled the "ff", "fl", "fi", "ffl", "ffi" ligatures by default in Serif + (by Ben Laenen) +- Disabled the "fi", "ffi" ligatures for languages with dotless i in Serif (by + Ben Laenen) +- added Tifinagh to Sans Book and Bold, U+2D30-U+2D65, U+2D6F, partially hinted + in Sans Book. (by Denis Jacquerye) +- added Tai Xuan Jing Symbols (U+1D300-1D356) to Sans (by Remy Oudompheng) +- added double-struck letters (U+1D538-U+1D56B minus reserved code points) to + Sans (by Gee Fung Sit) +- added U+22EE-U+22F1 to Sans (by Gee Fung Sit) +- added U+2C67-U+2C6C, U+2C75-U+2C77 to Serif (by Gee Fung Sit) +- italicized various glyphs in Latin Extended-B, IPA Extensions, Spacing + Modifier Letters, Phonetic Extension (Supplement) and Super- and Subscripts + in Serif Oblique fonts (by Gee Fung Sit) +- modified outlines, bearings of Hebrew U+05D6, U+05D8, U+05DB, U+05DE, U+05E0, + U+05E1, U+05E2, U+05EA in Sans Book and Oblique, adjusted hinting in Book + based on Yotam Benshalom's comments. (by Denis Jacquerye) +- added Braille Patterns (U+2800-U+28FF) to Serif fonts (by Gee Fung Sit) +- added N'Ko to Sans Book and Bold: U+07C0-U+07E7, U+07EB-U+07F5, U+07F8-U+07FA + (by Eugeniy Meshcheryakov) +- added U+0ED8 (Lao digit 8) to Sans (by Remy Oudompheng) +- added Lao diacritics U+0EB0-0EB9, U+0EBB-0EBC, U+0EC8-0ECD to Mono (by Remy + Oudompheng) +- renamed Serif [Bold] Oblique, make it Italic (by Eugeniy Meshcheryakov) +- added U+29FA-U+29FB to Sans and Sans Mono (by Gee Fung Sit) +- swapped glyphs for Eng U+014A from Sami Eng to African Eng, the latter being + more common (by Denis Jacquerye) +- swapped ae U+00E6 and ae.alt in Serif Italics fonts, thus fixing #8213 (by + Denis Jacquerye) +- minor improvements to Misc. Symbols in Sans (by Gee Fung Sit) +- minor improvements and additions to Sans ExtraLight (by Gee Fung Sit) +- improved instructions for various Cyrillic letters (by Eugeniy Meshcheryakov) +- fixed hinting of theta and chi in Sans Book (by Ben Laenen) +- added Georgian Mkhedruli to Sans, Serif and Mono, ASumtavruli to Sans and + Serif (by Besarion Gugushvili) + +Changes from 2.16 to 2.17 + +- Sans fonts: fix position for certain combinations of Arabic fatha, kasra, + shadda, damma, kasratan, dammatan, fathatan and hamza (by Ben Laenen) +- added 'ae.alt' to Serif Oblique fonts, with design matching shape of italic + 'a' instead of slanted 'a', see bug #8213 (by Denis Jacquerye) +- added super- and subscripts to Serif and Mono: U+1D2C-U+1D2E, U+1D30-U+1D3C, + U+1D3E-U+1D42, U+1D62-U+1D65, U+1D78, U+2071, U+207A-U+207E, U+208A-U+208E, + U+2090-U+2094 (by Gee Fung Sit) + +Changes from 2.15 to 2.16 + +- fixed hinting instructions for digits in DejaVu Sans Oblique, Bold Oblique, + and Serif Book to not change glyph width (by Eugeniy Meshcheryakov) +- added instructions for U+0404, U+0411, U+0413, U+0414, U+0417-U+041B, U+041F, + U+0423, U+0424, U+0426-U+0429, U+042C, U+042E, U+042F, U+0490 in Serif Bold + (by Eugeniy Meshcheryakov) +- added U+0220 and Eng.alt to Serif fonts (by Denis Jacquerye) +- added U+232C, U+2394, U+23E3 to Sans fonts (by John Karp) +- added U+230C-U+230F, U+231C-U+231F to Sans fonts, fixing bug:9547 + (by John Karp) +- adjusted dot below, dot above, dieresis above, dieresis below in Sans fonts + (by Denis Jacquerye) +- added U+2300, U+2301, U+2303, U+2304, U+2305, U+2307, U+2326, U+2327, U+232B, + arrow.base to Sans fonts (by John Karp) +- adjusted dot and dieresis below and above in Serif fonts (by Denis Jacquerye) +- added U+1E1C-U+1E1D to Serif fonts (by Denis Jacquerye) +- added U+22BE, U+22BF (by Wesley Transue) +- added U+2324; modified U+2325: more standard proportions, and matches U+2324 + and U+2387; added U+2387 : flipped U+2325 with standard arrowhead + (by John Karp) +- added Lao digits U+0ED0-0ED7, U+0ED9 (by Remy Oudompheng) +- added to Mono in Arabic block : U+060C, U+0615, U+061B, U+061F, + U+0621-U+063A, U+0640-0655, U+065A, U+0660-066F, U+0674, U+0679-0687, U+0691, + U+0692, U+0698, U+06A1, U+06A4, U+06A9, U+06AF, U+06B5, U+06BA, U+06BE, + U+06C6, U+06CC, U+06CE, U+06D5, U+06F0-06F9 (by Remy Oudompheng) +- added to Mono in Arabic Presentations Forms-A : U+FB52-FB81, U+FB8A-FB95, + U+FB9E, U+FB9F, U+FBAA-FBAD, U+FBE8, U+FBE9, U+FBFC-FBFF (by Remy Oudompheng) +- added to Mono in Arabic Presentations Forms-B : U+FE70-FE74, U+FE76-FEFC, + U+FEFF (by Remy Oudompheng) +- added U+05BA, U+05BE, U+05F3, U+05F4, U+FB1E, U+FB21-U+FB28, U+FB4F to Sans + (by Eugeniy Meshcheryakov) +- added U+2102 to Mono (by Eugeniy Meshcheryakov) +- added U+2983-U+2984 to Sans (by Gee Fung Sit) +- added U+2A2F to Sans, Serif and Mono (by Gee Fung Sit) +- added U+2373-2375, U+237A to Sans (by John Karp) +- converted kern pairs to kern classes with Tavmjong Bah's scripts + (by Denis Jacquerye) +- set ScriptLang of kerning classes to just latn because of Pango bug + (by Denis Jacquerye) +- added DNK to ScriptLang latn otherwise it is excluded, and SRB and MDK to + cyrl (by Denis Jacquerye) +- removed flag 0x80 in generate.pe, otherwise it generates kerning tables some + systems don't like; thus loosing Apple tables (by Denis Jacquerye) +- removed ligature for precomposed legacy characters of Sans Oblique fonts + (by Denis Jacquerye) +- added bearings to en dash U+2013, em dash U+2014 and figure dash U+2012 + by making dashes shorter, preserving character width (by Denis Jacquerye) +- reduced U+031C, U+0325 (ring below), U+0339 to be entirely visible; + added instructions in Sans Book; changed U+1e00-U+1e01 to use new ring below + (by Denis Jacquerye) +- adjusted circumflex below on U+1E12-U+1E13, U+1E18-U+1E19, U+1E3C-U+1E3D, + U+1E4A-U+1E4B, U+1E70-U+1E71, U+1E76-U+1E77 in Sans fonts (by Denis Jacquerye) +- Added U+0ED4, U+0ED5 to DejaVu Sans (by Remy Oudompheng) +- Lao-specific anchors (by Remy Oudompheng) +- added alternate I to match the small capital in Sans (by Gee Fung Sit) + +Changes from 2.14 to 2.15 + +- improved hinting in Sans Oblique to deal with some spacing and inconsistency + issues (by Ben Laenen) +- added anchors to Mono Book, and added GPOS rules for combining diacritics to + show up as zero width glyphs (by Ben Laenen) +- removed U+F21C (PUA), it was copy of U+2C64 from Latin Extended C (by Eugeniy + Meshcheryakov) +- added U+27E6-U+27E7 to Sans (by Gee Fung Sit) +- added U+1407, U+1409, U+140C-U+141B, U+141D-U+1425, U+1427-U+142E, + U+1435-U+1438, U+143A-U+1449, U+1452, U+1454, U+1457-U+1465, U+1467-U+146A, + U+1471, U+1474-U+1482, U+1484-U+1488, U+148F, U+1492, U+14A0, U+14A2, U+14A9, + U+14AC-U+14BA, U+14BC, U+14BD, U+14C6, U+14C9-U+14CF, U+14D1, U+14D2, U+14D9, + U+14DC-U+14E9, U+14EC, U+14F3, U+14F6-U+1504, U+1506, U+1507, U+1510-U+1525, + U+152C, U+152F-U+153D, U+1540, U+1541, U+154E, U+154F, U+1552, U+155B, U+155C, + U+1568, U+1569, U+1574-U+157B, U+157D, U+15A7-U+15AE, U+1646, U+1647 (by + Eugeniy Meshcheryakov) +- fixed several contours to not intersect, use horizontal or vertical tangents, + use integer coordinates, etc in Sans Book (by Denis Jacquerye) +- added U+0496-U+0497 in Serif (by Andrey V. Panov) + +Changes from 2.13 to 2.14 + +- added Philippine peso glyph U+20B1 (by Clayborne Arevalo) +- made U+2012 have the same width as digits, according to Unicode 5.0, + page 206 (by Roozbeh Pournader) +- made all of the "above" combining characters remove the dot of "i", + "j", etc (Soft_Dotted characters), according to Unicode 5.0, + page 228 (by Roozbeh Pournader) +- made U+012F, U+03F3, U+0456, U+0458, U+1E2D, and U+1ECB (all fonts + except Mono), U+0249, U+2148, and U+2149 (Sans and Sans Condensed), + U+0268 (Sans ExtraLight, Serif and Serif Condensed), and U+029D (Serif + and Serif Condensed) respect the Soft_Dotted property (by Roozbeh + Pournader) +- added U+223E, U+223F, U+2240, U+22C2, U+22C3 to Sans (by Remy Oudompheng) +- added U+203D to Serif (by Gee Fung Sit) +- added zero-width glyphs for U+2061-U+2063 to Sans and Serif (by Gee + Fung Sit) +- changed isolated forms of Arabic waw (U+0648, U+0624 and U+06C6) (bug #9432) + (by Ben Laenen) +- added Lao consonants U+0E81, U+0E82, U+0E84, U+0E87, U+0E88, U+0E8A, + U+0E8D, U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA, + U+0EAB, U+0EAD-0EAF to Sans Mono (by Remy Oudompheng) +- added U+0200-U+0217, U+0226-U+0229, U+02F3, U+1E00-U+1E07, + U+1E0A-U+1E0B, U+1E18-U+1E1F, U+1E22-U+1E23, U+1E28-U+1E2D, + U+1E3A-U+1E3B, U+1E40, U+1E48-U+1E49, U+1E56, U+1E58-U+1E59, + U+1E5E-U+1E5F, U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, U+1E72-U+1E77, + U+1E86-U+1E8B, U+1E92-U+1E96, U+1EA0-U+1EA1, U+1EF4-U+1EF5 to Mono + (by Ben Laenen) +- renamed uppercase variants of diacritics (macron, breve, double grave, + double acute, inverted breve, dot above) to "uni03XX.case" in Mono + (by Ben Laenen) +- moved uppercase variants of diacritics up in Mono so they properly + vertically align on capitals (by Ben Laenen) +- precomposed glyphs with macron, breve, double grave, double acute, + inverted breve, dot above, macron below, breve below, inverted breve + below, dot below, cedilla, caron below, circumflex below, diaeresis + below, tilde below now reference to combining diacritics instead of + space modifiers in Mono (by Ben Laenen) +- made ring below (U+0325), and half rings below (U+031C and U+0339) + smaller in Mono (by Ben Laenen) +- added U+205F to all fonts (by Roozbeh Pournader) +- added U+035E-U+035F to Sans (by Roozbeh Pournader) +- added empty glyphs for U+034F, U+202A-U+202E, U+2060, U+206A-206F, + U+FE00-U+FE0F to non-Mono fonts (by Roozbeh Pournader) +- added U+2101, U+2107-U+2108, U+210B, U+210C, U+2110, U+2112, U+211B, + U+211F, U+2123, U+2125, U+2128-U+2129, U+212C-U+212D, U+212F, + U+2130-U+2131, U+2133, U+2136-U+213A, U+2141-U+2144, U+2B00-U+2B11, + U+2B20-U+2B23 to Sans (by John Karp) +- reshaped omega (U+03C9) in Mono (by Ben Laenen) +- added U+2205, U+22C6, U+2300-U+2301, U+2303-U+2306, U+230C-U+230F, + U+2312-U+2315, U+231C-U+231F, U+2335, U+2337-U+233E, U+2341-U+2344, + U+2347-U+2348, U+234B-U+234D, U+2349-U+2350, U+2352-U+2354, + U+2357-U+2359, U+235A-U+235C, U+235E-U+2360, U+2363-U+2365, + U+2368-U+2369, U+236B-U+2370, U+2373-U+237A, U+2380-U+2383, + U+2388-U+238B, U+2395 in Mono (by Ben Laenen) + +Changes from 2.12 to 2.13 + +- adjusted U+0198B, U+01B3-U+01B4 in Sans, hinted U+01B4 in Sans Book + (by Denis Jacquerye) +- added U+27F0-U+27FF, U+2906-U+2907, U+290A-U+290B, U+2940-U+2941 to Sans + (by Denis Jacquerye) +- added U+01E6-U+01E9, U+01EE-U+01EF, U+01F4-U+01F5, U+01FC-U+01FF, + U+021E-U+021F, U+0245, U+02BD, U+02C9, U+1E9B, U+2045-U+2046, U+2213, U+22C5, + U+22EF to Sans Mono (by Roozbeh Pournader) +- added U+04FA-U+04FD to Sans (by Michael Everson) +- removed U+2329 and U+232A because of their CJK properties, added U+27E8 + and U+27E9 in their stead, fixing part of bug #9038 (by Roozbeh Pournader) +- corrected and improvised U+0466-U+0469, U+046E-U+0471, U+047C-U+047D, U+0482, + U+0484-U+0486, U+0492-U+0493, U+04B0-U+04B1, U+050C-U+050D, and U+204A + in Sans (by Michael Everson) +- added instructions for U+0402, U+0409, U+040A, U+040B, U+044D, U+040F, + U+0452, U+0459-U+045B, U+045F to Sans Book (by Eugeniy Meshcheryakov) +- made italic shape for U+431, U+432, U+437, U+43B, U+43C, U+43D, U+444, U+447, + U+44D, U+44F, U+459, U+45A in SerifOblique and SerifBoldOblique + (by Andrey V. Panov) +- modified U+024C to match glyph in Unicode chart, fixing bug #9039 + (by Denis Jacquerye) +- made some canonically equivalent characters share the same glyph: + U+02B9 = U+0374, U+0343 = U+0313, and U+0387 = U+00B7 also adjusting U+02BA + to look like double U+02B9, fixing parts of bug #9038 (by Roozbeh Pournader) +- changed shapes for U+0478 and U+0479 in Sans to those in the Unicode charts, + based on a recent decision by Unicode Technical Committee to only use + the digraph form (by Michael Everson) +- adjusted width of NBSP U+00A0 and NNBSP U+202F, fixing bug #8401 + (by Denis Jacquerye) +- fixed several contours to not intersect, use horizontal or vertical tangents, + use integer coordinates, etc (by Roozbeh Pournader and Denis Jacquerye) +- added U+1402, U+1430, U+144D, U+146C, U+148A, U+14A4, U+14C1, U+14D4, U+14EE, + U+1527, U+1545, U+157E, U+158E, U+15AF to Sans (by Eugeniy Meshcheryakov) +- enlarged width of U+459 and U+45A in Serif (by Andrey V. Panov) +- made traditional shape for U+452, U+45B (by Andrey V. Panov) +- added euro sign U+20AC to Sans ExtraLight, making fontconfig recognize + the font as supporting English (by Denis Jacquerye) + +Changes from 2.11 to 2.12 + +- added U+0180 to Serif (by Denis Jacquerye) +- improved and/or hinted Armenian letters U+0542, U+0546, U+0562, + U+0563, U+0564, U+0577, U+0582 in Sans (by Ben Laenen) +- added U+4FE-U+4FF, U+512-U+513, U+2114, U+214E, U+26B2 to Sans + (by Gee Fung Sit) +- adjusted U+0496-U+0497, U+049A-U+04A1 in Sans to match U+0416, + U+041A, U+0436 and U+043A (by Gee Fung Sit) +- Mathematical Operators in Sans: changed U+22C0-U+22C1 to match + other n-ary operators, adjusted U+2203-U+2204, changed U+2220 in + Sans to match the style of U+2221 (by Gee Fung Sit) +- added U+1401, U+1403-U+1406, U+140A, U+140B, U+1426, U+142F, + U+1431-U+1434, U+1438, U+1439, U+1449, U+144A, U+144C, + U+144E-U+1451, U+1455, U+1456, U+1466, U+146B, U+146D-U+1470, + U+1472, U+1473, U+1483, U+1489, U+148B-U+148E, U+1490, U+1491, + U+14A1, U+14A3, U+14A5-U+14A8, U+14AA, U+14AB, U+14BB, U+14C0, + U+14C2-U+14C5, U+14C7, U+14C8, U+14D0, U+14D3, U+14D5-U+14D8, + U+14DA, U+14DB, U+14EA, U+14ED, U+14EF-U+14F2, U+14F4, U+14F5, + U+1405, U+1526, U+1528-U+152B, U+152D, U+152E, U+153E, + U+1542-U+1544, U+1546-U+154D, U+1550, U+1553, U+1555-U+155A, + U+1567, U+156A, U+157C, U+157F-U+1585, U+158A-U+158D, + U+158F-U+1596, U+15A0-U+15A6, U+15DE, U+15E1, U+166E-U+1676 to + Sans (by Eugeniy Meshcheryakov) +- re-enabled Latin ligatures fi, ffi, fl, ffl and ff in Sans + (by Ben Laenen) +- made italic shape for U+436, U+44A, U+44B, U+44C, U+44E, U+45F, + U+463 in SerifOblique and SerifBoldOblique (by Andrey V. Panov) +- fixed sub- and superscript metrics in Condensed Sans (bug #8848) + (by Ben Laenen) +- added U+474, U+475 in Serif (by Andrey V. Panov) +- hinted Greek glyphs U+03B7, U+30B8, U+03B9, U+03C1, U+03C3, + U+03C6 in Mono Book (by Ben Laenen) + +Changes from 2.10 to 2.11 + +- added instructions for Hebrew glyphs (Sans Book, by Eugeniy + Meshcheryakov) +- changed U+01A6 (Latin Yr) after bug #8212, in Sans, Serif and + Sans Mono fonts (by Denis Jacquerye). +- removed instruction for U+2600-U+26A1 (by Mederic Boquien) +- added U+202F and set width of U+00A0 (nobreakingspace) to the + same as U+0020, space (by Denis Jacquerye). +- added and improved instructions for various Cyrillic letters + (by Eugeniy Meshcheryakov) +- Changed U+416, U+42F, U+427 (non-Bold), U+436, U+447 (non-Bold), + U+44F, U+437 (Bold), corrected U+40F, U+414, U+424, U+426, U+429, + U+434, U+438 (Bold), U+446, U+449, U+44D (non-Bold), U+45F in + Sans Mono (by Andrey V. Panov) +- made small corrections to Cyrillic, most appreciable to U+409, + U+413, U+41B, U+427 and U+433, U+434, U+43B, U+447, U+459 + (upright fonts) to Serif (by Andrey V. Panov) +- adjusted bearings of U+410, U+416, U+41A, U+42F, U+436, U+43A, + U+443, U+44F in Serif (by Andrey V. Panov) +- enlarged width of U+44A, U+44B, U+44C, U+463 in Serif + (by Andrey V. Panov) +- added ligature "iacute" as "afii10103" (U+456) "acutecomb" in + Serif (by Andrey V. Panov) +- made italic shape to U+446, U+448, U+449 in Serif (by Andrey V. + Panov) +- added "afii10831" (U+F6C7), "afii10832" (U+F6C8) in Serif (by + Andrey V. Panov) +- new minimum version of fontforge is 20061014 (by Ben Laenen) + +Changes from 2.9 to 2.10: + +- added U+0242, U+024A-U+024B, U+024E-U+024F, U+037C-U+037D, U+0E3F, + U+1D2C-U+1D2E, U+1D30-U+1D42, U+1D5D-U+1D6A, U+1D78, U+1DB8, + U+2090-U+2094, U+20D0-U+20D1, U+2C60-U+2C66, U+2C6B-U+2C6C, U+2C74 and + U+FB29 to Sans (by Gee Fung Sit) +- added Lao glyphs : U+0E81-0E82, U+E084, U+0E87-0E88, U+0E8A, U+0E8D, + U+0E94-0E97, U+0E99-0E9F, U+0EA1-0EA3, U+0EA5, U+0EA7, U+0EAA-0EAB, + U+0EAD-0EB9, U+0EBB-0EBD, U+0EC0-0EC4, U+0EC6, U+0EC8-0ECD, U+0EDC-0EDD + (by Remy Oudompheng) +- fixed U+0193 not showing in Windows (bug #7897) (by Ben Laenen) +- changes to U+222B-222D in Sans Mono (by Remy Oudompheng) +- ported the three remaining currency symbols from Arev (U+20B0, + U+20B2-U+20B3), and replaced one (U+20AF) in Sans (by Lars Naesbye + Christensen) +- corrected U+20A5 in Sans (by Gee Fung Sit) +- merged Double-Struck Letters from Arev: U+2102, U+210D, U+2115, + U+2119-U+211A, U+2124, U+213C-U+2140 (by Gee Fung Sit) +- added U+2308-U+230B and U+2329-U+232A to Sans Mono and Serif faces, + fixed incorrect direction of U+2329 in Sans faces, and improved + U+2308-U+230B in Sans faces per Ben Laenen's suggestions (by David + Lawrence Ramsey) +- added U+06D5 and final form of it (needed for Kurdish) (by Ben Laenen) +- added two special glyphs U+F000 and U+F001 in Sans Book that show the + current ppem size (horizontal and vertical) (by Ben Laenen) +- added U+2318 and U+2325 to Sans Mono faces, based on the Sans versions + (by David Lawrence Ramsey) +- added U+2B14-U+2B1A to all faces except Sans ExtraLight (by David + Lawrence Ramsey) +- respaced all Geometric Shapes characters in Serif faces to match those + in Sans faces again, respaced U+23CF in Sans, Sans ExtraLight, and + Serif faces to match U+25A0 (or Sans in Sans ExtraLight's case) again, + and respaced U+2B12-U+2B13 in Sans and Serif faces to match U+25A1 + again (by David Lawrence Ramsey) +- corrected width of Modifier Small Letters U+1D43-1D5B in Sans Oblique + and U+1D9B-U+1DBF in Sans Oblique and Sans Bold Oblique (by Gee Fung Sit) +- added a bunch of glyphs to Sans ExtraLight (see SVN for details) (by + Gee Fung Sit) +- adjusted Cyrillic descenders in Sans ExtraLight to sync with Sans (by + Gee Fung Sit) +- added U+0242, U+0245 to Serif (by Gee Fung Sit) +- replaced the SHPIX routines which gave them bad spacing at certain + sizes in FreeType for A, V, Z, v and z in Sans Bold (by Ben Laenen) + +Changes from 2.8 to 2.9: + +- DejaVuSansExtraLight.sfd: changed family name from "DejaVu Sans" to + "DejaVu Sans Light" (in case we add a Light weight variant), so legacy + apps that understand only 4 styles are happy. (by Denis Jacquerye) +- added Name ID 16, aka preferred family name, and Name ID 17, aka + preferred style name, so contemporary apps that understand more that 4 + styles can use big fonts families "DejaVu Sans" and "DejaVu Serif". For + those, Extralight and Condensed are just styles not different families. + (by Denis Jacquerye) +- added U+22B6-22BD, U+22C0-22C1, U+22D6-22D7 to Sans. (by Remy Oudompheng) +- added U+037B, U+2184, U+2C67-U+2C6A and U+2C75-U+2C77 to Sans (by Gee + Fung Sit) +- adjusted asteriskmath (U+2217) for consistency with other mathematical + operators in Sans (by Ben Laenen) +- hinted some Armenian capitals in Sans Book (by Ben Laenen) +- added U+0246 - U+0249 (by Ben Laenen) +- BUGFIX : swapped U+224E and U+224F, in Sans, Sans Condensed and Sans Mono + (by Remy Oudompheng) +- adjusted U+20B5 (by Mederic Boquien) +- swapped U+21DA and U+21DB which were in wrong order (by Heikki Lindroos) +- added U+222E-2233, U+239B-23AD, U+2A00-2A02, U+2A0F-2A1C to Sans (by Remy + Oudompheng) +- added U+239B-23AD to Mono (by Remy Oudompheng) +- added U+2024-2025 to Serif (by Mederic Boquien) +- added U+222C-222D, U+2A0C-2A0E to Serif (by Remy Oudompheng) +- added U+2190-21FF to Mono (by Heikki Lindroos) +- added Hebrew glyphs - U+05B0-U+05BD, U+05BF-U+05C3, U+05C6, U+05C7, + U+05D0-U+05EA, U+05F0-U+05F2, U+FB1F, U+FB20, U+FB2A-U+FB36, + U+FB38-U+FB3C, U+FB3E, U+FB40, U+FB41, U+FB43, U+FB44, U+FB46-U+FB4E (by + Gee Fung Sit and Eugeniy Meshcheryakov) +- adjustments for Cyrillic in Sans (by Andrey V. Panov) +- made italic shape for U+0434, U+0456, U+0457 in SerifOblique and Serif + Bold Oblique (by Andrey V. Panov) + +Changes from 2.7 to 2.8: + +- fixed instructions for U+0423, U+0427, U+0447, U+0448 in Serif, so they + look good at large sizes too (by Eugeniy Meshcheryakov) +- added U+FB00 and U+FB03 to U+FB06 to Serif typefaces (by Heikki Lindroos) +- added U+26B0-U+26B1, U+2701-U+2704, U+2706-U+2709, U+270C-U+2727, U+2729 + to U+274B, U+274D, U+274F to U+2752, U+2756, U+2758-U+275E, U+2761 to + U+2775 (by Heikki Lindroos) +- added and improved instructions for Cyrillic letters in Mono and Serif + (Book, by Eugeniy Meshcheryakov) +- rotated U+26B0 (was too small in mono) (by Gee Fung Sit) +- adjusted U+1EDA-U+1EDD, U+1EE8-U+1EEB, capitals using capital specific + accent and moved diacritics to match position on U+00F2 (ograve), etc. + (by Denis Jacquerye) +- added U+20D6, U+20D7 to Sans (by Gee Fung Sit) +- made Armenian ligatures discretionary since the Firefox ligature problem + still isn't fixed (by Ben Laenen) +- moved Armenian hyphen U+058A to a higher position (bug #7436) (by Ben + Laenen) +- hinted Greek glyphs in Sans Bold (by Ben Laenen) +- enabled Arabic lam-alif ligatures when diacritics are used (by Ben Laenen) + +Changes from 2.6 to 2.7: + +- added glyphs needed for Kurdish: U+0695, U+06B5, U+06C6, U+06CE and their + init/medi/fina forms in Sans (by Ben Laenen) +- added U+02CD, U+01F8 - U+01F9, U+1E3E - U+1E3F, U+1E30 - U+1E35, U+1EBC - + U+1EBD, U+1EF8 - U+1EF9 (includes glyphs needed for Yoruba, Maori, Guarani + and Twi) (by Ben Laenen) +- added U+22C8-22CC, U+29CE-29D5, U+2A7D-2AA0, U+2AAE-2ABA, U+2AF9-2AFA to + Sans (by Remy Oudompheng) +- adjusted diacritics on Vietnamese, Pinyin and other characters: + U+01A0-U+01A1, U+01AF-U+01B0, U+01D5-U+01DC, U+01DE-01E1, U+01FA-U+01FB + U+022A-U+022D, U+0230-U+0231, U+1E14-U+1E17, U+1E4C-U+1E53, U+1E78-U+1E7B, + U+1EA4-U+1EF1 in Sans (Book, Bold and Oblique) (by Denis Jacquerye) +- added basic arrows U+2190-U+2193 in Serif, which completes MES-1 compliance + for Serif (by Ben Laenen) +- added U+01E4, U+01E5, U+01FA, U+01FB, U+02BD, U+02C9 and U+02EE to Serif + (by Ben Laenen) +- fixed U+0209 in Serif Bold Oblique (by Ben Laenen) +- adjusted Box Drawing block characters U+2500-257F in Mono to fit character + cell, shifting them up by 416 (Denis Jacquerye) +- redid U+0194 in Sans (by Ben Laenen) +- added U+2217-2218, U+2295-22A1 to Mono (by Remy Oudompheng) +- added U+0462 to Serif (by Andrey V. Panov) +- added U+226C, U+228C-228E, U+2293-2294, U+22F2-22FF to Sans (by Remy + Oudompheng) +- adjusted U+2208-220D in Sans (by Remy Oudompheng) +- improved some Cyrillic glyphs in Mono (by Andrey V. Panov), rewritten + instructions for changed glyphs (by Eugeniy Meshcheryakov) +- added U+1E0E-1E0F, U+1E8E-1E8F to Mono fonts (by Denis Jacquerye). (bug + #7166) +- renamed 'Dotabove' to 'Dotaccent' in Mono Sans Oblique to match other fonts + (by Denis Jacquerye). +- added U+200B-U+200F in Sans faces and Serif faces, U+200B and U+200C were + in Sans already (by Lars Naesbye Christensen) +- added U+2601-U+262F, U+263D, U+263E, U+2648-U+265F, U+2668, U+2670-U+268B, + U+2690-U+269C, U+26A0, U+26A1, U+2794, U+2798-U+27AF, U+27B1-U+27BE to Mono + (by Heikki Lindroos) +- replaced the references with unshifted ones for both 魏 U+03BA and 泻 U+043A + in Mono Book (by Denis Jacquerye) +- fixing glyph for U+04ED in Mono Book, consisted only of dieresis (by Andrey + V. Panov). + +Changes from 2.5 to 2.6: + +- redid U+2032 - U+2037, U+2057 based on Arev in Sans (by Gee Fung Sit) +- added U+0195, corrected U+039E, U+204B in Sans ExtraLight (by Gee Fung Sit) +- added instructions for some Cyrillic letters in Sans Bold (by Eugeniy + Meshcheryakov) +- added vulgar fractions U+2153-U+215F for Serif, made with references (by + Lars Naesbye Christensen) +- added U+228F-2292, U+2299-22AF, U+22B2-22B5, U+22CD, U+22D8-22ED to Sans + (by Remy Oudompheng) +- added U+2208-220D, U+2238-223D, U+2278-2281, U+228A-228B, U+228F-2292, + U+22CD, U+22DA-22E9 to Mono (by Remy Oudompheng) +- fixed misplaced dot in U+2250 in Mono (by Remy Oudompheng) +- added instructions for some Cyrillic letters in Mono Book and Bold(by + Eugeniy Meshcheryakov) +- minor changes to U+2241, U+2261-2263, U+22A4, U+22A5 in Sans (by Remy + Oudompheng) +- added hinting instructions to lowercase Armenian glyphs in Sans Book (by + Ben Laenen) +- changed U+2208, U+220B to match U+2209 and U+220C in Sans Bold (by Remy + Oudompheng) +- added Braille patterns U+2800-U+28FF to Sans (by Mederic Boquien) +- added instructions for some Cyrillic letters in Serif Book (by Eugeniy + Meshcheryakov) +- renamed BoldOblique fonts to Bold Oblique in TTF Name as originally in + Bitstream Vera fonts (by Denis Jacquerye) +- added hinting instructions to some Latin-B Extended and IPA characters in + Sans Book (by Denis Jacquerye and Ben Laenen) +- adjusted bearings, replaced diacritics, hinted hook and horn for + Vietnamese in Sans Book (by Denis Jacquerye) +- made FAX, TM, TEL, etc. discritionary ligatures in Sans and Serif fonts + (by Denis Jacquerye) +- removed ligatures of precomposed characters in Sans and Serif fonts (by + Denis Jacquerye) +- added U+F208, U+F20A, U+F215-F217, U+F21A-F21B, U+F25F in PUA (from SIL's + PUA, probably in Unicode 5.0): U+0243, U+0244, U+0245, U+024C, U+024D, + U+2C64, (U+2C6D), (U+2C71) +- modified some glyphs in Serif Oblique to make them more italic (by Denis + Jacquerye) + +Changes from 2.4 to 2.5: + +- fixed excessive kerning bug that occurs with Pango (by Denis Jacquerye) +- added U+20AF to Sans and Serif (by Lars Naesbye Christensen) +- regenerated Condensed faces (by Ben Laenen) +- added U+035C-U+035D to Sans, fixed U+0361 (by Denis Jacquerye) +- integrated 255 characters from Arev fonts: Latin Extended-B, Spacing + Modifiers, Combining Diacritical Marks, Cyrillic, Cyrillic supplement, + General Punctuation, Letterlike Symbols, Arrows, Mathematical Operators, + Miscellaneous Technical, Dingbats, Alphabetic Presentation Forms (by Denis + Jacquerye) +- added basic Cyrillic and basic Greek to Sans ExtraLight (by Denis Jacquerye) +- added U+0498, U+049A, U+04AA, U+04AB, U+04AF to Serif (by Eugeniy + Meshcheryakov) +- added U+0494, U+0495, U+0498, U+0499, U+04AA, U+04AB, U+04C3, U+04C4, + U+04C7, U+04C8 to Mono (by Eugeniy Meshcheryakov) +- adjusted weight of U+0256, U+0257, U+0260, U+0272, U+0273, U+0277, U+029B, + U+02A0 and modifed U+028B and U+027A in Mono (by Denis Jacquerye) +- added U+2000-200A to Mono (by Denis Jacquerye) +- added vulgar fractions U+2153 - U+215F to Mono (by Gee Fung Sit) +- adapted metrics of Arabic glyphs so they stay above cut-off height in Sans + (by Ben Laenen) +- fixed mkmk anchors for Arabic diacritics so they stack properly in Sans (by + Ben Laenen) +- fixed weight of lowercase upsilon in Sans Bold, make small adjustment to + lowercase omega in Sans (by Ben Laenen) +- added U+210E (by Mederic Boquien) +- unslanted U+2201, U+221B and U+221C in Sans Oblique (by Mederic Boquien) +- added several mathematical relation symbols to Sans and Mono (U+2241-224C, + U+2250-2255, U+2260-2269, U+226E-2277, U+2282-2287) modified U+223C to match + other tildes, and U+2282-2284 to have the same shape. (by Remy Oudompheng) +- made U+2234-U+2237 refer to U+2219 instead of U+00B7 in Sans (by Mederic + Boquien) +- added U+2238-223B, U+226A-226B, U+2278-2281, U+2288-228B to Sans (by Remy + Oudompheng) +- unslanted and changed reference of U+22C5 from U+00B7 to U+2219 in Sans (by + Mederic Boquien) +- added U+224D-225F, U+226D, U+22C6 to Sans and unslanted U+2219 in Sans + Oblique. (by Remy Oudompheng) +- added U+224D-225F, U+226D to Mono, shifted U+2266-2269 higher upwards and + unslanted U+2219 in Oblique. (by Remy Oudompheng) +- merged Coptic glyphs from Arev 0.2 (by Lars Naesbye Christensen) +- fixed and adjusted various Cyrillic glyphs in Serif (by Andrey V. Panov) +- made fi, fl... ligatures discretionary ligatures (by Ben Laenen) + +Changes from 2.3 to 2.4: + +- added U+04A2, U+04A3, U+04AC - U+04AF, U+04BA, U+04BB, U+04C0 - + U+04C2, U+04CB, U+04CD, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04E8 - U+04F5, + U+04F6 - U+04F9 to Mono (by Eugeniy Meshcheryakov) +- added U+048C, U+048D, U+0494, U+0495, U+049E - U+04A7, U+04AC - + U+04AE, U+04B4- U+04B7, U+04BA, U+04BB, U+04C0 - U+04C4, U+04C7, U+04C8, + U+04CB, U+04CC, U+04D8 - U+04DF, U+04E2 - U+04E5, U+04EC - U+04F9 to Serif + (by Eugeniy Meshcheryakov) +- added U+2134 to Sans (by Gee Fung Sit) +- added U+2080 - U+2089 to all faces (by Gee Fung Sit) +- several minor corrections to Sans (by Gee Fung Sit) +- major corrections to Sans Condensed (by Gee Fung Sit) +- corrected Superscripts and Subscripts in Sans (by Gee Fung Sit) +- corrected anchors of U+0316-U+0319 (by Denis Jacquerye) +- Verajja integrated (by Stepan Roh) +- copied U+2328, U+2600, U+2639-U+263C, U+263F-U+2647, U+2660-U+2667, + and U+2669-U+266F from Sans to Serif, and copied scaled-down versions of + them to Sans Mono (by David Lawrence Ramsey) +- added U+20B4 to all faces (by Eugeniy Meshcheryakov) +- added more minor positional adjustments to U+2638 in all faces to + match the other miscellaneous symbols in Verajja, and rescale it in Sans + Mono so that it looks better (by David Lawrence Ramsey) +- added U+2242, U+2243 and U+22A4 (by Mederic Boquien) +- corrected U+2245 in Sans (by Mederic Boquien) +- added U+0221, U+0234-0236 (by Denis Jacquerye) +- added in Arabic block to Sans: U+060C, U+0615, U+061B, U+061F, U+0621 +- U+063A, U+0640 - U+0655, U+0660 - U+066F, U+0679 - U+0687, U+0698, U+06A1, + U+06A9, U+06AF, U+06BA, U+06BF, U+06CC, U+06F0 - U+06F9 (by Ben Laenen) +- added in Arabic Presentation Forms A to Sans: U+FB52 - U+FB81, U+FB8A +- U+FB95, U+FB9E - U+FB9F, U+FBE8 - U+FBE9, U+FBFC - U+FBFF (by Ben Laenen) +- added complete Arabic Presentation Forms B to Sans: U+FE70 - U+FE74, + U+FE76 - U+FEFC, U+FEFF (by Ben Laenen) +- added complete Greek Extended block to Mono (by Ben Laenen) +- modified Greek capitals with tonos in Mono (by Ben Laenen) +- added U+01C4-01CC, U+01D5, U+01DE, U+01E0-U+01E1, U+01E6-U+01E9, + U+01EE-U+01F5, U+01F8-U+0217, U+021E-U+021F, U+0226-U+022A, U+022C to Serif + (by Denis Jacquerye) +- adjusted U+043B and U+044F in Serif (by Denis Jacquerye) +- added U+2000-U+200A (by Denis Jacquerye) +- added U+1E00-U+1E0B, U+1E0E-U+1E11, U+1E14-U+1E1C, U+1E1E-U+1E23, + U+1E26-U+1E2D, U+1E30-U+1E35, U+1E3A-U+1E3B, U+1E3E-U+1E40, U+1E48-U+1E49, + U+1E50-U+1E56, U+1E58-U+1E59, U+1E5E-U+1E60, U+1E68-U+1E6B, U+1E6E-U+1E6F, + U+1E72-U+1E7D, U+1E86-U+1E9B, U+1EA0-U+1EA3, U+1EAC-U+1EB7, U+1EBA-U+1EBD, + U+1EC6-U+1ECF, U+1ED8-U+1ED9, U+1EE6-U+1EE7, U+1EF4-U+1EF9 to Serif (by + Denis Jacquerye) +- added U+048E, U+048F, U+049C-U+049F, U+04B8, U+04B9, U+04BC-U+04BF, + U+04C3, U+04C4 to Sans (by Eugeniy Meshcheryakov) +- added DejaVu Sans Extra Light (by Denis Jacquerye) +- Adjusted underline position for (hopefully) improved legibility in + Sans, Serif, Mono (Tim May) +- added auto-generated DejaVu LGC (by Stepan Roh) + +Changes from 2.2 to 2.3: + +- fixed bug U+042B and U+044B behave badly in Sans Bold or Oblique (by + Keenan Pepper) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- added U+04D0-U+04D7, U+04E6, U+04E7 to Mono (by Eugeniy Meshcheryakov) +- added U+048A - U+048D, U+0498, U+0499, U+04AA, U+04AB, U+04B0, U+04B1, + U+04C0, U+04C9, U+04CA, U+04CE, U+04CD, U+04DA, U+04DB, U+04DE, U+04DF, + U+04E2 - U+04E5, U+04EC - U+04F8, U+04F9 to Sans (by Eugeniy Meshcheryakov) +- added U+04E0, U+04E1 to all faces (by Eugeniy Meshcheryakov) +- added Greek Extended to Sans and Serif: U+1F00-U+1F15, U+1F18-U+1F1D, + U+1F20-U+1F45, U+1F48-U+1F4D, U+1F50-U+1F57, U+1F59, U+1F5B, U+1F5D, + U+1F5F-U+1F7D, U+1F80-U+1FB4, U+1FB6-U+1FC4, U+1FC6-U+1FD3, U+1FD6-U+1FDB, + U+1FDD-U+1FEF, U+1FF2-U+1FF4, U+1FF6-U+1FFE (by Ben Laenen) +- added Greek variant letterforms, archaic letters and symbols to Mono: + U+03D0-U+03E1, U+03F0-U+03FF (by Ben Laenen) +- added Armenian block and Armenian ligatures to Sans (U+0531 - U+0556, + U+0559 - U+055F, U+0561 - U+0587, U+0589 - U+058A, U+FB13 - U+FB17) (by Ben + Laenen) +- redid some Greek characters in Sans and Mono to make them look better + and to correct some errors (by Ben Laenen) +- added U+27E0 to all faces (by David Lawrence Ramsey) +- added underscore (U+005F) consistency fixes: extended the Sans Mono + and Sans Mono Oblique underscores to touch both horizontal edges, and + reduced the height of the Sans Bold Oblique underscore to match the Sans + Bold underscore (by David Lawrence Ramsey) +- added underscore (U+005F) derivatives and consistency fixes for them: + made U+0332 a reference to underscore at Denis Jacquerye's suggestion; made + U+0333 two references to underscore; made U+033F two references to U+203E; + added U+2017 as two references to underscore, and made U+0333 a reference to + it; and added U+203E as a reference to underscore, and made U+0305 a + reference to it (by David Lawrence Ramsey) +- added U+201B, U+2220, U+2320-U+2321, U+23AE, U+23CF, all remaining + Geometric Shapes glyphs (U+25A0-U+25C9, U+25CB-U+25D7, U+25D9-U+25E5, + U+25E7-U+25FF), and U+2B12-U+2B13 to all faces (by David Lawrence Ramsey) +- added minor positional adjustments to U+2638 in all faces (by David + Lawrence Ramsey) +- added U+201F to Sans Mono and Serif faces (by David Lawrence Ramsey) +- added U+01B7, U+01F6, U+0464 - U+0465, U+2160 - U+2180, U+2183, + U+220A, U+220D, U+2329, U+232A, U+2422, U+27E8 - U+27EB, U+2680 - U+2685 to + Sans (by Gee Fung Sit ???) +- added U+2116 to Sans and Serif (by Gee Fung Sit) +- changed florin sign U+0192 in Sans (by Gee Fung Sit) +- added anchor points to some glyphs (by Denis Jacquerye) +- adjusted height of IPA superscripts U+02B0-02B8, U+02C0-02C1, + U+02E0-02E4, U+207F to match with height of U+00B2 (by Denis Jacquerye) +- added U+0184-U+0185, U+019C, U+019F, U+01A0-U+01A3, U+01A6, U+01AA, + U+01AF-U+01B0, U+01B2-U+01B4, U+01B7-U+01B8, U+01BC-U+01BC, U+0224-U+0225, + U+023A-U+0240, U+1D16-U+1D17, U+1D1D-U+1D1E, U+1D43-U+1D5B, U+1D7B, + U+1D85,U+1D9B-1DB7, U+1DB9-U+1DBF, U+20A6 to all fonts (by Denis Jacquerye) +- added added U+0182, U+018B, U+018E, U+01A0-U+01A1, U+01B1, U+01B9, + U+01C0-U+01C3, U+0238-U+0239, U+1D02, U+1D08-U+1D09, U+1D14, U+1D1F, U+1D77 + to Serif and Mono (by Denis Jacquerye) +- added U+0181, U+0183, U+0187-U+0188, U+018A-U+018F, U+0191, U+0193, + U+0195-U+019B, U+019D-U+019E, U+01A4-U+01A5, U+01AC-U+01AE, U+01B5-U+01B6, + U+01B9, U+01BB, U+01F6 to Serif (by Denis Jacquerye) +- added U+0181, U+0187-U+0188, U+018A, U+018D, U+018F, U+0191, U+0193, + U+0195-U+019F, U+01A4-01A5, U+01AC-01AD, U+01B5-U+01B6, U+1BB, U+01F6, + U+01D7-U+01DC, U+0238-U+0239, U+0241 to Mono (by Denis Jacquerye) +- added to Mono and Serif (by Denis Jacquerye) + +Changes from 2.1 to 2.2: + +- reworked the vertical orientation of the Blocks Elements characters + in all faces to remove their overly large descenders, in order to fix + problems with e.g. terminal emulators (by David Lawrence Ramsey) +- copied bullet in Sans faces to Serif faces for consistency (by David + Lawrence Ramsey) +- added U+2023, U+25D8, U+25E6, and U+29EB to all faces (by David + Lawrence Ramsey) +- added U+1EB8, U+1EB9, U+1ECA - U+1ECD, U+1EE4, U+1EE5 (by Tim May) +- added U+01DD, U+02BE, U+02BF, U+02D3 to all, changed U+02D2 in + non-Condensed and U+1EE5 in Serif (by Tim May) +- fixed U+01CE, replacing wrong circumflex by caron (by Denis Jacquerye) +- added anchor points to some glyphs (by Denis Jacquerye) +- added U+20B5 (by Denis Jacquerye) +- added U+0181 - U+0183, U+0187, U+0188, U+018A - U+018D, U+0191, + U+0193, U+0195 - U+019B, U+019D, U+019E, U+01A4, U+01A7 - U+01A9, U+01AB - + U+01AE, U+01B1, U+01B5, U+01B6, U+01BB, U+01C0 - U+01C3, U+01F1 - U+01F3, + U+0238, U+0239, U+1D02, U+1D08, U+1D09, U+1D14, U+1D1F, U+1D77, U+2103, + U+2126, U+2127, U+212A, U+212B, U+2132, U+214B, U+2210, U+2217, U+2218, + U+2A0C - U+2A0E, U+FB00, U+FB03 and U+FB04 to Sans (by Gee Fung Sit) +- added U+01A9, U+01C3 and U+2126 to Mono and Serif (by Gee Fung Sit) +- adjusted bearings of U+028B in Sans (by Gee Fung Sit) +- added U+018F, U+0494-U+0497, U+04A0-U+04A7, U+04AC-U+04AF, + U+04B4-U+04B7, U+04BA-U+04BB, U+04C1-U+04C2, U+04C5-U+04C8, U+04CB-U+04CC, + U+04D0-U+04D9, U+04DC-U+04DD, U+04E6-U+04EB to Sans (by Eugeniy + Meshcheryakov) +- replaced with references U+0391-U+0393, U+0395-U+0397, U+0399, U+039A, + U+039C, U+039D, U+039F-U+03A1, U+03A4, U+03A5, U+03A7, U+03BF, U+03DC, + U+0405, U+0406, U+0408, U+0410, U+0412, U+0415, U+0417, U+041A, + U+041C-U+041E, U+0420-U+0422, U+0425, U+0430, U+0435, U+043E, U+0440, + U+0441, U+0443, U+0445, U+0455-U+0458 in Serif and Mono (by Eugeniy + Meshcheryakov) +- added U+04D0-U+04D7, U+04E6-U+04EB to Serif (by Eugeniy Meshcheryakov) +- added U+212A and U+212B to the rest of the faces (by Lars Naesbye + Christensen) +- added U+2318 and U+2325 to Sans and Serif (by Lars Naesbye Christensen) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- completed basic Greek alphabet: added U+0374-U+0375, U+037A, U+037E, + U+0384-U+038A, U+038C, U+038E-U+0390, U+03AC-U+03BF, U+03C1-U+03CE (by Ben + Laenen) +- added U+2070 and U+2074-U+2079 (by Mederic Boquien) + +Changes from 2.0 to 2.1: + +*** Be aware that names of some TTF files changed since version 2.0. *** + +- added U+0323, U+1E0C, U+1E0D, U+1E24, U+1E25, U+1E36 - U+1E39, U+1E42, + U+1E43, U+1E46, U+1E47, U+1E5A - U+1E5D, U+1E62, U+1E63, U+1E6C, U+1E6D, + U+1E7E, U+1E7F (by Tim May) +- fixed bug where GNOME applications used Mono Bold Oblique instead of + Mono Oblique (by Keenan Pepper) +- added and improved TrueType instructions and related settings (by + Keenan Pepper) +- added U+1E41, U+1E57, U+1E61 (by Sander Vesik) +- added U+0189, U+0309, U+0313, U+0314, U+031A, U+031B, U+0327, U+0328, + U+032B, U+0333, U+033C (by Denis Jacquerye) +- adjusted and fixed U+0186, U+0254, U+0291, U+0316 - U+0319, U+031C - + U+0320, U+0323 - U+0326, U+0329 - U+032A, U+032C - U+0332, U+0339 - U+033B, + U+033E, U+033F (by Denis Jacquerye) +- fixed U+1E12, U+1E3C, U+1E4A, U+1E70 to have normal below diacritics + (by Denis Jacquerye) +- fixed U+1E82, U+1E84 and U+1EF2 to have uppercase above diacritics (by + Denis Jacquerye) +- added anchor points to some glyphs (by Denis Jacquerye) +- dropped "-Roman" from font names - affects both internal TTF names and + names of generated files (by Stepan Roh) +- attempt to fix bug Vertical spacing too big for Mono by exchanging + LineGap and OS2TypoLinegap values (proofed by Stefan Rank) +- added Greek capitals U+0391 - U+03A1, U+03A3 - U+03A9, U+03AA, U+03AB + in Mono (by Ben Laenen) +- added the per ten thousand sign U+2031 (by Mederic Boquien) +- added U+2207, U+221D, U+221F, U+2227 - U+222A, and U+2261 (by David + Lawrence Ramsey) +- new logo (by Gee Fung Sit) +- added U+0180, U+018E, U+201F, U+2024, U+2025, U+203D, U+2200, U+2203, + U+2213, U+222C, U+222D, U+2263 to Sans (by Gee Fung Sit) + +Changes from 1.15 to 2.0: + +- "Italized" basic glyphs in all Serif Oblique and their Condensed faces + (by David Jez) +- added and improved TrueType instructions and related settings (by Keenan + Pepper) +- added anchor points to some glyphs (by Denis Jacquerye) +- many new spacing and combining accents (by Denis Jacquerye) +- smart substitutions for transforming i and j to dottless form and for + using uppercase diacritics (by Denis Jacquerye) +- fixed remaining erroneously slanted characters in Serif Oblique faces (by + David Lawrence Ramsey) +- copied bullet in Sans faces to Sans Oblique faces for consistency (by + David Lawrence Ramsey) +- added U+203C and U+2047-U+2049 (by David Lawrence Ramsey) +- added Greek glyphs to Serif (by Ben Laenen, Condensed merge by David Jez) +- fixed bug LTR glyphs behaving like RTL (by Ben Laenen) +- fixed wrong glyph directions (by David Jez) +- fixed repositioned accents in Condensed faces (by David Jez) + +Changes from 1.14 to 1.15: + +- added and improved TrueType instructions and related settings (by Keenan + Pepper) +- fixed U+2302, U+2319 (by David Lawrence Ramsey) +- fixed yet another monospace bug (by Stepan Roh) +- fixed potential "too big ascender/descender" bug (by Stepan Roh) +- fixed U+026E and U+028E (by Denis Jacquerye) +- added U+0186, U+0190, U+0300 - U+0304, U+0306 - U+0308, U+030A - U+030C, + U+0321, U+0322 (by Denis Jacquerye) +- added rest of Block Elements: U+2591 - U+2593 (by David Lawrence Ramsey) +- added U+2311, U+237D and U+2638 (by David Lawrence Ramsey) +- added U+01CD - U+01D4 (by Denis Jacquerye) +- fixed accents of U+00F2 - U+00F6 by replacing them with references in Mono + Bold (by David Jez) +- added U+0490, U+0491 (by Eugeniy Meshcheryakov) +- added hints to U+0404 and U+0454 in Sans (by Eugeniy Meshcheryakov) +- completed Greek glyphs from U+0370 to U+03CF in Serif (by Ben Laenen) +- fixed shape of U+0255 in Sans Bold and Sans Bold Oblique (by Denis + Jacquerye) + +Changes from 1.13 to 1.14: + +- fixed bug where Mono faces were not recognized as fixed pitch in Windows + by correcting Venda glyphs (by David Jez) +- added and improved TrueType instructions (by Keenan Pepper) +- added 6 Uzbekian glyphs (by Mashrab Kuvatov) +- added Greek glyphs to Sans and Serif, changed pi and omega to fit in (by + Ben Laenen) +- added IPA and related superscript glyphs (by Denis Jacquerye) +- fixed buggy Venda glyphs (by David Lawrence Ramsey and Stepan Roh) +- added U+2302, U+2310, U+2319 (by David Lawrence Ramsey) +- fixed slanted U+00AC in Serif Oblique faces (by David Lawrence Ramsey) +- added 29 glyphs from Block Elements (by David Lawrence Ramsey) + +Changes from 1.12 to 1.13: + +- removed all stems (PS hints) (requested by David Jez) +- added U+01D6, U+01DF, U+022B, U+022D and U+0231 (by Sander Vesik) +- added 10 Venda glyphs (by Dwayne Bailey) +- fixed bug when fonts had no name on Microsoft Windows (by Stepan Roh) +- updated 'missing' glyph U+FFFD (by David Jez) +- set TTF flag fsType to 'Installable Embedding' (= unrestricted usage) + (idea by C. Tiffany) + +Changes from 1.11 to 1.12: + +- added long s (by James Cloos) +- prettier comma accent in gcommaaccent (by David Jez) +- added Hbar, hbar, kgreenlandic, napostrophe, Eng, eng, Tbar, tbar, + afii57929 (by David Jez) +- changed Iogonek, iogonek, IJ, ij to look better (by David Jez) +- glyph uni0237 renamed to dotlessj (requested by David Jez) +- fixed accents for dcaron, lcaron, tcaron, Uogonek, uogonek in Serif (by + David Jez) +- added U+2500 - U+257F box drawing glyphs to Sans Mono (by David Jez) +- fixed accents in Wcircumflex, Ycircumflex and Zdotaccent (by David Jez) +- extra kerning for F (by Sander Vesik) +- added 'missing' glyph U+FFFD (by David Jez) + +Changes from 1.10 to 1.11: + +- kerning updates (by Sander Vesik) +- added Iogonek, iogonek, IJ, ij, Uogonek, uogonek (from SuSE standard fonts + by Adrian Schroeter, SuSE AG) +- added Gcommaaccent, gcommaaccent, Kcommaaccent, kcommaaccent, + Lcommaaccent, lcommaaccent, Ncommaaccent, ncommaaccent, Rcommaaccent, + rcommaaccent (by Stepan Roh) + +Changes from 1.9 to 1.10: + +- added U+022E, U+022F (by Sander Vesik) +- kerning updates for DejaVu Sans (by Sander Vesik) +- fixed too wide cyrillic glyphs in DejaVu Sans Mono (by Valentin Stoykov) +- fixed ligatures bug in Mono (by Stepan Roh) + +Changes from 1.8 to 1.9: + +- integrated Arev Cyrillics (by Danilo Segan) +- added U+01EA, U+01EB, U+01EC, U+01ED (by Sander Vesik) + +Changes from 1.7 to 1.8: + +- fixed accents in Serif Oblique and Serif Bold Oblique (by Stepan Roh) + +Changes from 1.6 to 1.7: + +- added automatically generated Condensed typefaces (by Stepan Roh) + +Changes from 1.5 to 1.6: + +- monospace bug fixed (by Stepan Roh) +- incorrect Bitstream foundry assigned by fontconfig and KDE Font Installer +fixed (by Stepan Roh) +- added automatically generated Oblique version of Serif typefaces (by +Stepan Roh) +- corrected cyrillic D and d (by Danilo Segan and David Jez) +- fixed accents position in Oblique version of Serif typefaces (by Danilo +Segan and Sander Vesik) +- fixed incorrect computation of OS2Win* fields (by Stepan Roh) +- added visiblespace U+2423 (by David Jez) +- fixed 'line height' bug by fixing ascender and descender values (by David +Jez and Stepan Roh) +- fixed part of 'worse than Vera' bug (by Peter Cernak) +- smaller comma accent U+0326 (by David Jez) + +Changes from 1.4 to 1.5: + +- added Cyrillics (96 characters) and Dcroat to the rest of typefaces (by +Danilo Segan) +- fixed bugs in some Cyrillic characters, some of them reported by Sander +Vesik (by Danilo Segan) +- added U+0100, U+0101, U+0112, U+0113, U+012A, U+012B, U+014C, U+014D, +U+016A, U+016B, U+01E2, U+01E3, U+0232 and U+0233 (by Sander Vesik) +- added Romanian characters (by Misu Moldovan) +- added U+0108, U+0109, U+010A, U+010B, U+0114, U+0115, U+0116, U+0117, +U+011C, U+011D, U+0120, U+0121, U+0124, U+0125, U+0128, U+0129, U+012C, +U+012D, U+0134, U+0135, U+014E, U+014F, U+0150, U+0151, U+015C, U+015D, +U+0168, U+0169, U+016C, U+016D, U+0170, U+0171 and U+0237 (by James +Crippen) +- added U+02BB, U+2010, U+2011, U+2012 and U+2015 (by Stepan Roh) + +Changes from 1.3 to 1.4: + +- added Polish characters (Aogonek, aogonek, Eogonek, eogonek, Nacute, +nacute, Sacute, sacute, Zacute, zacute, Zdotaccent, zdotaccent) (by Stepan +Roh) + +Changes from 1.2 to 1.3: + +- added Cyrillics (96 characters) and Dcroat to Sans typefaces (by Danilo +Segan from his BePa fonts) + +Changes from 1.1 to 1.2: + +- added Ldot, ldot, Wcircumflex, wcircumflex, Ycircumflex, ycircumflex, + Wgrave, wgrave, Wacute, wacute, Wdieresis, wdieresis, Ygrave and ygrave + (from The Olwen Font Family 0.2 by Dafydd Harries) + +Changes from 1.0 to 1.1: + +- added Lacute, lacute, Lcaron, lcaron, Racute and racute (by Peter Cernak) + +Changes from 0.9.4 to 1.0: + +- none, just changed version and updated README + +Changes from 0.9.3 to 0.9.4: + +- fixed TTF generation (kerning tables were missing) + +Changes from 0.9.2 to 0.9.3: + +- kerning of added characters +- proper caron shape for dcaron in Mono (by Ondrej Koala Vacha) +- minor visual changes + +Changes from 0.9.1 to 0.9.2: + +- internal bugged version + +Changes from 0.9 to 0.9.1: + +- proper caron shape for dcaron and tcaron +- minor visual changes + +$Id: NEWS 2535 2013-08-25 15:21:17Z moyogo $ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/README b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/README new file mode 100755 index 0000000..162a893 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/README @@ -0,0 +1,59 @@ +DejaVu fonts 2.34 (c)2004-2013 DejaVu fonts team +------------------------------------------------ + +The DejaVu fonts are a font family based on the Bitstream Vera Fonts +(http://gnome.org/fonts/). Its purpose is to provide a wider range of +characters (see status.txt for more information) while maintaining the +original look and feel. + +DejaVu fonts are based on Bitstream Vera fonts version 1.10. + +Available fonts (Sans = sans serif, Mono = monospaced): + +DejaVu Sans Mono +DejaVu Sans Mono Bold +DejaVu Sans Mono Bold Oblique +DejaVu Sans Mono Oblique +DejaVu Sans +DejaVu Sans Bold +DejaVu Sans Bold Oblique +DejaVu Sans Oblique +DejaVu Sans ExtraLight (experimental) +DejaVu Serif +DejaVu Serif Bold +DejaVu Serif Bold Italic (experimental) +DejaVu Serif Italic (experimental) +DejaVu Sans Condensed (experimental) +DejaVu Sans Condensed Bold (experimental) +DejaVu Sans Condensed Bold Oblique (experimental) +DejaVu Sans Condensed Oblique (experimental) +DejaVu Serif Condensed (experimental) +DejaVu Serif Condensed Bold (experimental) +DejaVu Serif Condensed Bold Italic (experimental) +DejaVu Serif Condensed Italic (experimental) + +All fonts are also available as derivative called DejaVu LGC with support +only for Latin, Greek and Cyrillic scripts. + +For license information see LICENSE. What's new is described in NEWS. Known +bugs are in BUGS. All authors are mentioned in AUTHORS. + +Fonts are published in source form as SFD files (Spline Font Database from +FontForge - http://fontforge.sf.net/) and in compiled form as TTF files +(TrueType fonts). + +For more information go to http://dejavu.sourceforge.net/. + +Characters from Arev fonts, Copyright (c) 2006 by Tavmjong Bah: +--------------------------- +U+01BA, U+01BF, U+01F7, U+021C-U+021D, U+0220, U+0222-U+0223, +U+02B9, U+02BA, U+02BD, U+02C2-U+02C5, U+02d4-U+02D5, +U+02D7, U+02EC-U+02EE, U+0346-U+034E, U+0360, U+0362, +U+03E2-03EF, U+0460-0463, U+0466-U+0486, U+0488-U+0489, U+04A8-U+04A9, +U+0500-U+050F, U+2055-205E, U+20B0, U+20B2-U+20B3, U+2102, U+210D, U+210F, +U+2111, U+2113, U+2115, U+2118-U+211A, U+211C-U+211D, U+2124, U+2135, +U+213C-U+2140, U+2295-U+2298, U+2308-U+230B, U+26A2-U+26B1, U+2701-U+2704, +U+2706-U+2709, U+270C-U+274B, U+2758-U+275A, U+2761-U+2775, U+2780-U+2794, +U+2798-U+27AF, U+27B1-U+27BE, U+FB05-U+FB06 + +$Id: README 2535 2013-08-25 15:21:17Z moyogo $ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/langcover.txt b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/langcover.txt new file mode 100755 index 0000000..4db5bca --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/langcover.txt @@ -0,0 +1,249 @@ +This is the language coverage file for DejaVu fonts +($Id: langcover.txt 2538 2013-08-25 16:02:56Z moyogo $) + + Sans Serif Sans Mono +aa Afar 100% (62/62) 100% (62/62) 100% (62/62) +ab Abkhazia 100% (90/90) 93% (84/90) 84% (76/90) +af Afrikaans 100% (69/69) 100% (69/69) 100% (69/69) +ak Akan 100% (73/73) 100% (73/73) 100% (73/73) +am Amharic (0/264) (0/264) (0/264) +an Aragonese 100% (66/66) 100% (66/66) 100% (66/66) +ar Arabic 100% (36/36) (0/36) 100% (36/36) +as Assamese (0/64) (0/64) (0/64) +ast Asturian/Bable/Leonese/Asturleonese 100% (70/70) 100% (70/70) 100% (70/70) +av Avaric 100% (67/67) 100% (67/67) 100% (67/67) +ay Aymara 100% (60/60) 100% (60/60) 100% (60/60) +az-az Azerbaijani in Azerbaijan 100% (66/66) 100% (66/66) 100% (66/66) +az-ir Azerbaijani in Iran 100% (40/40) (0/40) 100% (40/40) +ba Bashkir 100% (82/82) 100% (82/82) 97% (80/82) +be Byelorussian 100% (68/68) 100% (68/68) 100% (68/68) +ber-dz Berber in Algeria 100% (70/70) 100% (70/70) 100% (70/70) +ber-ma Berber in Morocco 100% (32/32) (0/32) (0/32) +bg Bulgarian 100% (60/60) 100% (60/60) 100% (60/60) +bh Bihari (Devanagari script) (0/68) (0/68) (0/68) +bho Bhojpuri (Devanagari script) (0/68) (0/68) (0/68) +bi Bislama 100% (58/58) 100% (58/58) 100% (58/58) +bin Edo or Bini 100% (78/78) 100% (78/78) 100% (78/78) +bm Bambara 100% (60/60) 100% (60/60) 100% (60/60) +bn Bengali (0/63) (0/63) (0/63) +bo Tibetan (0/95) (0/95) (0/95) +br Breton 100% (64/64) 100% (64/64) 100% (64/64) +brx Bodo (Devanagari script) (0/82) (0/82) (0/82) +bs Bosnian 100% (62/62) 100% (62/62) 100% (62/62) +bua Buriat (Buryat) 100% (70/70) 100% (70/70) 100% (70/70) +byn Blin/Bilin (0/255) (0/255) (0/255) +ca Catalan 100% (74/74) 100% (74/74) 100% (74/74) +ce Chechen 100% (67/67) 100% (67/67) 100% (67/67) +ch Chamorro 100% (58/58) 100% (58/58) 100% (58/58) +chm Mari (Lower Cheremis / Upper Cheremis) 100% (76/76) 100% (76/76) 100% (76/76) +chr Cherokee (0/85) (0/85) (0/85) +co Corsican 100% (84/84) 100% (84/84) 100% (84/84) +crh Crimean Tatar/Crimean Turkish 100% (68/68) 100% (68/68) 100% (68/68) +cs Czech 100% (82/82) 100% (82/82) 100% (82/82) +csb Kashubian 100% (74/74) 100% (74/74) 100% (74/74) +cu Old Church Slavonic 100% (103/103) 90% (93/103) 78% (81/103) +cv Chuvash 100% (74/74) 100% (74/74) 100% (74/74) +cy Welsh 100% (78/78) 100% (78/78) 100% (78/78) +da Danish 100% (70/70) 100% (70/70) 100% (70/70) +de German 100% (59/59) 100% (59/59) 100% (59/59) +doi Dogri (0/85) (0/85) (0/85) +dv Divehi/Dhivehi/Maldivian (0/49) (0/49) (0/49) +dz Dzongkha (0/95) (0/95) (0/95) +ee Ewe 100% (99/99) 100% (99/99) 100% (99/99) +el Greek 100% (69/69) 100% (69/69) 100% (69/69) +en English 100% (72/72) 100% (72/72) 100% (72/72) +eo Esperanto 100% (64/64) 100% (64/64) 100% (64/64) +es Spanish 100% (66/66) 100% (66/66) 100% (66/66) +et Estonian 100% (64/64) 100% (64/64) 100% (64/64) +eu Basque 100% (56/56) 100% (56/56) 100% (56/56) +fa Persian 100% (40/40) (0/40) 100% (40/40) +fat Fanti 100% (73/73) 100% (73/73) 100% (73/73) +ff Fulah (Fula) 100% (62/62) 100% (62/62) 100% (62/62) +fi Finnish 100% (62/62) 100% (62/62) 100% (62/62) +fil Filipino 100% (84/84) 100% (84/84) 100% (84/84) +fj Fijian 100% (52/52) 100% (52/52) 100% (52/52) +fo Faroese 100% (68/68) 100% (68/68) 100% (68/68) +fr French 100% (84/84) 100% (84/84) 100% (84/84) +fur Friulian 100% (66/66) 100% (66/66) 100% (66/66) +fy Frisian 100% (75/75) 100% (75/75) 100% (75/75) +ga Irish 100% (80/80) 100% (80/80) 100% (80/80) +gd Scots Gaelic 100% (70/70) 100% (70/70) 100% (70/70) +gez Ethiopic (Geez) (0/218) (0/218) (0/218) +gl Galician 100% (66/66) 100% (66/66) 100% (66/66) +gn Guarani 100% (70/70) 100% (70/70) 100% (70/70) +gu Gujarati (0/68) (0/68) (0/68) +gv Manx Gaelic 100% (54/54) 100% (54/54) 100% (54/54) +ha Hausa 100% (60/60) 100% (60/60) 100% (60/60) +haw Hawaiian 100% (63/63) 100% (63/63) 100% (63/63) +he Hebrew 100% (27/27) (0/27) (0/27) +hi Hindi (Devanagari script) (0/68) (0/68) (0/68) +hne Chhattisgarhi (0/68) (0/68) (0/68) +ho Hiri Motu 100% (52/52) 100% (52/52) 100% (52/52) +hr Croatian 100% (62/62) 100% (62/62) 100% (62/62) +hsb Upper Sorbian 100% (72/72) 100% (72/72) 100% (72/72) +ht Haitian/Haitian Creole 100% (56/56) 100% (56/56) 100% (56/56) +hu Hungarian 100% (70/70) 100% (70/70) 100% (70/70) +hy Armenian 100% (77/77) 100% (77/77) 100% (77/77) +hz Herero 100% (57/57) 100% (57/57) 100% (57/57) +ia Interlingua 100% (52/52) 100% (52/52) 100% (52/52) +id Indonesian 100% (54/54) 100% (54/54) 100% (54/54) +ie Interlingue 100% (52/52) 100% (52/52) 100% (52/52) +ig Igbo 100% (58/58) 100% (58/58) 100% (58/58) +ii Sichuan Yi/Nuosu (0/1165) (0/1165) (0/1165) +ik Inupiaq (Inupiak, Eskimo) 100% (68/68) 100% (68/68) 100% (68/68) +io Ido 100% (52/52) 100% (52/52) 100% (52/52) +is Icelandic 100% (70/70) 100% (70/70) 100% (70/70) +it Italian 100% (72/72) 100% (72/72) 100% (72/72) +iu Inuktitut 100% (161/161) (0/161) (0/161) +ja Japanese (0/6537) (0/6537) (0/6537) +jv Javanese 100% (56/56) 100% (56/56) 100% (56/56) +ka Georgian 100% (33/33) 100% (33/33) 100% (33/33) +kaa Kara-Kalpak (Karakalpak) 100% (78/78) 100% (78/78) 100% (78/78) +kab Kabyle 100% (70/70) 100% (70/70) 100% (70/70) +ki Kikuyu 100% (56/56) 100% (56/56) 100% (56/56) +kj Kuanyama/Kwanyama 100% (52/52) 100% (52/52) 100% (52/52) +kk Kazakh 100% (77/77) 100% (77/77) 100% (77/77) +kl Greenlandic 100% (81/81) 100% (81/81) 100% (81/81) +km Central Khmer (0/63) (0/63) (0/63) +kn Kannada (0/70) (0/70) (0/70) +ko Korean (0/2443) (0/2443) (0/2443) +kok Kokani (Devanagari script) (0/68) (0/68) (0/68) +kr Kanuri 100% (56/56) 100% (56/56) 100% (56/56) +ks Kashmiri 78% (26/33) (0/33) 69% (23/33) +ku-am Kurdish in Armenia 100% (64/64) 100% (64/64) 100% (64/64) +ku-iq Kurdish in Iraq 100% (32/32) (0/32) 87% (28/32) +ku-ir Kurdish in Iran 100% (32/32) (0/32) 87% (28/32) +ku-tr Kurdish in Turkey 100% (62/62) 100% (62/62) 100% (62/62) +kum Kumyk 100% (66/66) 100% (66/66) 100% (66/66) +kv Komi (Komi-Permyak/Komi-Siryan) 100% (70/70) 100% (70/70) 100% (70/70) +kw Cornish 100% (64/64) 100% (64/64) 100% (64/64) +kwm Kwambi 100% (52/52) 100% (52/52) 100% (52/52) +ky Kirgiz 100% (70/70) 100% (70/70) 100% (70/70) +la Latin 100% (68/68) 100% (68/68) 100% (68/68) +lah Lahnda 92% (25/27) (0/27) 85% (23/27) +lb Luxembourgish (Letzeburgesch) 100% (75/75) 100% (75/75) 100% (75/75) +lez Lezghian (Lezgian) 100% (67/67) 100% (67/67) 100% (67/67) +lg Ganda 100% (54/54) 100% (54/54) 100% (54/54) +li Limburgan/Limburger/Limburgish 100% (62/62) 100% (62/62) 100% (62/62) +ln Lingala 100% (81/81) 100% (81/81) 100% (81/81) +lo Lao 100% (55/55) (0/55) 83% (46/55) +lt Lithuanian 100% (70/70) 100% (70/70) 100% (70/70) +lv Latvian 100% (78/78) 100% (78/78) 100% (78/78) +mai Maithili (Devanagari script) (0/68) (0/68) (0/68) +mg Malagasy 100% (56/56) 100% (56/56) 100% (56/56) +mh Marshallese 100% (62/62) 100% (62/62) 100% (62/62) +mi Maori 100% (64/64) 100% (64/64) 100% (64/64) +mk Macedonian 100% (42/42) 100% (42/42) 100% (42/42) +ml Malayalam (0/68) (0/68) (0/68) +mn-cn Mongolian in China (0/130) (0/130) (0/130) +mn-mn Mongolian in Mongolia 100% (70/70) 100% (70/70) 100% (70/70) +mni Maniputi (0/78) (0/78) (0/78) +mo Moldavian 100% (128/128) 100% (128/128) 100% (128/128) +mr Marathi (Devanagari script) (0/68) (0/68) (0/68) +ms Malay 100% (52/52) 100% (52/52) 100% (52/52) +mt Maltese 100% (72/72) 100% (72/72) 100% (72/72) +my Burmese (Myanmar) (0/48) (0/48) (0/48) +na Nauru 100% (60/60) 100% (60/60) 100% (60/60) +nb Norwegian Bokmal 100% (70/70) 100% (70/70) 100% (70/70) +nds Low Saxon 100% (59/59) 100% (59/59) 100% (59/59) +ne Nepali (0/72) (0/72) (0/72) +ng Ndonga 100% (52/52) 100% (52/52) 100% (52/52) +nl Dutch 100% (82/82) 100% (82/82) 100% (82/82) +nn Norwegian Nynorsk 100% (76/76) 100% (76/76) 100% (76/76) +no Norwegian (Bokmal) 100% (70/70) 100% (70/70) 100% (70/70) +nqo N'Ko 91% (54/59) (0/59) (0/59) +nr Ndebele, South 100% (52/52) 100% (52/52) 100% (52/52) +nso Northern Sotho 100% (58/58) 100% (58/58) 100% (58/58) +nv Navajo/Navaho 100% (72/72) 100% (72/72) 100% (72/72) +ny Chichewa 100% (54/54) 100% (54/54) 100% (54/54) +oc Occitan 100% (70/70) 100% (70/70) 100% (70/70) +om Oromo or Galla 100% (52/52) 100% (52/52) 100% (52/52) +or Oriya (0/68) (0/68) (0/68) +os Ossetic 100% (66/66) 100% (66/66) 100% (66/66) +ota Ottoman Turkish 100% (37/37) (0/37) 97% (36/37) +pa Panjabi/Punjabi (0/63) (0/63) (0/63) +pa-pk Panjabi/Punjabi in Pakistan 92% (25/27) (0/27) 85% (23/27) +pap-an Papiamento in Netherlands Antilles 100% (72/72) 100% (72/72) 100% (72/72) +pap-aw Papiamento in Aruba 100% (54/54) 100% (54/54) 100% (54/54) +pes Western Farsi 100% (40/40) (0/40) 100% (40/40) +pl Polish 100% (70/70) 100% (70/70) 100% (70/70) +prs Dari/Eastern Farsi 100% (40/40) (0/40) 100% (40/40) +ps-af Pashto in Afghanistan 95% (47/49) (0/49) 77% (38/49) +ps-pk Pashto in Pakistan 93% (46/49) (0/49) 75% (37/49) +pt Portuguese 100% (82/82) 100% (82/82) 100% (82/82) +qu Quechua 100% (55/55) 100% (55/55) 100% (55/55) +rm Rhaeto-Romance (Romansch) 100% (66/66) 100% (66/66) 100% (66/66) +rn Rundi 100% (52/52) 100% (52/52) 100% (52/52) +ro Romanian 100% (62/62) 100% (62/62) 100% (62/62) +ru Russian 100% (66/66) 100% (66/66) 100% (66/66) +rw Kinyarwanda 100% (52/52) 100% (52/52) 100% (52/52) +sa Sanskrit (Devanagari script) (0/68) (0/68) (0/68) +sah Yakut 100% (76/76) 100% (76/76) 100% (76/76) +sat Santali (Devanagari script) (0/70) (0/70) (0/70) +sc Sardinian 100% (62/62) 100% (62/62) 100% (62/62) +sco Scots 100% (56/56) 100% (56/56) 100% (56/56) +sd Sindhi 100% (54/54) (0/54) 79% (43/54) +se North Sami 100% (66/66) 100% (66/66) 100% (66/66) +sel Selkup (Ostyak-Samoyed) 100% (66/66) 100% (66/66) 100% (66/66) +sg Sango 100% (72/72) 100% (72/72) 100% (72/72) +sh Serbo-Croatian 100% (156/156) 100% (156/156) 98% (154/156) +shs Secwepemctsin 100% (48/48) 100% (48/48) 100% (48/48) +si Sinhala/Sinhalese (0/73) (0/73) (0/73) +sid Sidamo (0/281) (0/281) (0/281) +sk Slovak 100% (86/86) 100% (86/86) 100% (86/86) +sl Slovenian 100% (62/62) 100% (62/62) 100% (62/62) +sm Samoan 100% (53/53) 100% (53/53) 100% (53/53) +sma South Sami 100% (60/60) 100% (60/60) 100% (60/60) +smj Lule Sami 100% (60/60) 100% (60/60) 100% (60/60) +smn Inari Sami 100% (68/68) 100% (68/68) 100% (68/68) +sms Skolt Sami 100% (80/80) 100% (80/80) 97% (78/80) +sn Shona 100% (52/52) 100% (52/52) 100% (52/52) +so Somali 100% (52/52) 100% (52/52) 100% (52/52) +sq Albanian 100% (56/56) 100% (56/56) 100% (56/56) +sr Serbian 100% (60/60) 100% (60/60) 100% (60/60) +ss Swati 100% (52/52) 100% (52/52) 100% (52/52) +st Sotho, Southern 100% (52/52) 100% (52/52) 100% (52/52) +su Sundanese 100% (54/54) 100% (54/54) 100% (54/54) +sv Swedish 100% (68/68) 100% (68/68) 100% (68/68) +sw Swahili 100% (52/52) 100% (52/52) 100% (52/52) +syr Syriac (0/45) (0/45) (0/45) +ta Tamil (0/48) (0/48) (0/48) +te Telugu (0/70) (0/70) (0/70) +tg Tajik 100% (78/78) 100% (78/78) 97% (76/78) +th Thai 1% (1/74) (0/74) (0/74) +ti-er Eritrean Tigrinya (0/255) (0/255) (0/255) +ti-et Ethiopian Tigrinya (0/281) (0/281) (0/281) +tig Tigre (0/221) (0/221) (0/221) +tk Turkmen 100% (68/68) 100% (68/68) 100% (68/68) +tl Tagalog 100% (84/84) 100% (84/84) 100% (84/84) +tn Tswana 100% (58/58) 100% (58/58) 100% (58/58) +to Tonga 100% (53/53) 100% (53/53) 100% (53/53) +tr Turkish 100% (70/70) 100% (70/70) 100% (70/70) +ts Tsonga 100% (52/52) 100% (52/52) 100% (52/52) +tt Tatar 100% (76/76) 100% (76/76) 100% (76/76) +tw Twi 100% (73/73) 100% (73/73) 100% (73/73) +ty Tahitian 100% (65/65) 100% (65/65) 100% (65/65) +tyv Tuvinian 100% (70/70) 100% (70/70) 100% (70/70) +ug Uyghur 87% (29/33) (0/33) 78% (26/33) +uk Ukrainian 100% (72/72) 100% (72/72) 100% (72/72) +ur Urdu 92% (25/27) (0/27) 85% (23/27) +uz Uzbek 100% (52/52) 100% (52/52) 100% (52/52) +ve Venda 100% (62/62) 100% (62/62) 100% (62/62) +vi Vietnamese 100% (194/194) 100% (194/194) 76% (148/194) +vo Volapuk 100% (54/54) 100% (54/54) 100% (54/54) +vot Votic 100% (62/62) 100% (62/62) 100% (62/62) +wa Walloon 100% (70/70) 100% (70/70) 100% (70/70) +wal Wolaitta/Wolaytta (0/281) (0/281) (0/281) +wen Sorbian languages (lower and upper) 100% (76/76) 100% (76/76) 100% (76/76) +wo Wolof 100% (66/66) 100% (66/66) 100% (66/66) +xh Xhosa 100% (52/52) 100% (52/52) 100% (52/52) +yap Yapese 100% (58/58) 100% (58/58) 100% (58/58) +yi Yiddish 100% (27/27) (0/27) (0/27) +yo Yoruba 100% (119/119) 100% (119/119) 100% (119/119) +za Zhuang/Chuang 100% (52/52) 100% (52/52) 100% (52/52) +zh-cn Chinese (simplified) 0% (2/6765) 0% (2/6765) 0% (2/6765) +zh-hk Chinese Hong Kong Supplementary Character Set (0/2213) (0/2213) (0/2213) +zh-mo Chinese in Macau (0/2213) (0/2213) (0/2213) +zh-sg Chinese in Singapore 0% (2/6765) 0% (2/6765) 0% (2/6765) +zh-tw Chinese (traditional) (0/13063) (0/13063) (0/13063) +zu Zulu 100% (52/52) 100% (52/52) 100% (52/52) diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/unicover.txt b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/unicover.txt new file mode 100755 index 0000000..c86c056 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavu-fonts-ttf-2.34/unicover.txt @@ -0,0 +1,226 @@ +This is the Unicode coverage file for DejaVu fonts +($Id: unicover.txt 2538 2013-08-25 16:02:56Z moyogo $) + +Control and similar characters are discounted from totals. + + Sans Serif Sans Mono +U+0000 Basic Latin 100% (95/95) 100% (95/95) 100% (95/95) +U+0080 Latin-1 Supplement 100% (96/96) 100% (96/96) 100% (96/96) +U+0100 Latin Extended-A 100% (128/128) 100% (128/128) 100% (128/128) +U+0180 Latin Extended-B 100% (208/208) 100% (208/208) 86% (180/208) +U+0250 IPA Extensions 100% (96/96) 100% (96/96) 100% (96/96) +U+02b0 Spacing Modifier Letters 78% (63/80) 73% (59/80) 62% (50/80) +U+0300 Combining Diacritical Marks 83% (93/112) 61% (69/112) 59% (67/112) +U+0370 Greek and Coptic 100% (134/134) 89% (120/134) 82% (110/134) +U+0400 Cyrillic 100% (256/256) 79% (204/256) 70% (180/256) +U+0500 Cyrillic Supplement 95% (38/40) 25% (10/40) 15% (6/40) +U+0530 Armenian 98% (86/87) 98% (86/87) 98% (86/87) +U+0590 Hebrew 62% (54/87) (0/87) (0/87) +U+0600 Arabic 63% (161/253) (0/253) 39% (99/253) +U+0700 Syriac (0/77) (0/77) (0/77) +U+0750 Arabic Supplement (0/48) (0/48) (0/48) +U+0780 Thaana (0/50) (0/50) (0/50) +U+07c0 NKo 91% (54/59) (0/59) (0/59) +U+0800 Samaritan (0/61) (0/61) (0/61) +U+0840 Mandaic (0/29) (0/29) (0/29) +U+08a0 Arabic Extended-A (0/39) (0/39) (0/39) +U+0900 Devanagari (0/127) (0/127) (0/127) +U+0980 Bengali (0/92) (0/92) (0/92) +U+0a00 Gurmukhi (0/79) (0/79) (0/79) +U+0a80 Gujarati (0/84) (0/84) (0/84) +U+0b00 Oriya (0/90) (0/90) (0/90) +U+0b80 Tamil (0/72) (0/72) (0/72) +U+0c00 Telugu (0/93) (0/93) (0/93) +U+0c80 Kannada (0/86) (0/86) (0/86) +U+0d00 Malayalam (0/98) (0/98) (0/98) +U+0d80 Sinhala (0/80) (0/80) (0/80) +U+0e00 Thai 1% (1/87) (0/87) (0/87) +U+0e80 Lao 97% (65/67) (0/67) 68% (46/67) +U+0f00 Tibetan (0/211) (0/211) (0/211) +U+1000 Myanmar (0/160) (0/160) (0/160) +U+10a0 Georgian 94% (83/88) 94% (83/88) 51% (45/88) +U+1100 Hangul Jamo (0/256) (0/256) (0/256) +U+1200 Ethiopic (0/358) (0/358) (0/358) +U+1380 Ethiopic Supplement (0/26) (0/26) (0/26) +U+13a0 Cherokee (0/85) (0/85) (0/85) +U+1400 Unified Canadian Aboriginal Syllabics 63% (404/640) (0/640) (0/640) +U+1680 Ogham 100% (29/29) (0/29) (0/29) +U+16a0 Runic (0/81) (0/81) (0/81) +U+1700 Tagalog (0/20) (0/20) (0/20) +U+1720 Hanunoo (0/23) (0/23) (0/23) +U+1740 Buhid (0/20) (0/20) (0/20) +U+1760 Tagbanwa (0/18) (0/18) (0/18) +U+1780 Khmer (0/114) (0/114) (0/114) +U+1800 Mongolian (0/156) (0/156) (0/156) +U+18b0 Unified Canadian Aboriginal Syllabics Extended (0/70) (0/70) (0/70) +U+1900 Limbu (0/66) (0/66) (0/66) +U+1950 Tai Le (0/35) (0/35) (0/35) +U+1980 New Tai Lue (0/83) (0/83) (0/83) +U+19e0 Khmer Symbols (0/32) (0/32) (0/32) +U+1a00 Buginese (0/30) (0/30) (0/30) +U+1a20 Tai Tham (0/127) (0/127) (0/127) +U+1b00 Balinese (0/121) (0/121) (0/121) +U+1b80 Sundanese (0/64) (0/64) (0/64) +U+1bc0 Batak (0/56) (0/56) (0/56) +U+1c00 Lepcha (0/74) (0/74) (0/74) +U+1c50 Ol Chiki (0/48) (0/48) (0/48) +U+1cc0 Sundanese Supplement (0/8) (0/8) (0/8) +U+1cd0 Vedic Extensions (0/39) (0/39) (0/39) +U+1d00 Phonetic Extensions 82% (106/128) 89% (115/128) 48% (62/128) +U+1d80 Phonetic Extensions Supplement 59% (38/64) 59% (38/64) 57% (37/64) +U+1dc0 Combining Diacritical Marks Supplement 13% (6/43) 13% (6/43) (0/43) +U+1e00 Latin Extended Additional 98% (252/256) 98% (252/256) 71% (182/256) +U+1f00 Greek Extended 100% (233/233) 100% (233/233) 100% (233/233) +U+2000 General Punctuation 100% (107/107) 81% (87/107) 49% (53/107) +U+2070 Superscripts and Subscripts 100% (42/42) 100% (42/42) 100% (42/42) +U+20a0 Currency Symbols 92% (25/27) 29% (8/27) 88% (24/27) +U+20d0 Combining Diacritical Marks for Symbols 21% (7/33) (0/33) (0/33) +U+2100 Letterlike Symbols 93% (75/80) 42% (34/80) 22% (18/80) +U+2150 Number Forms 94% (55/58) 94% (55/58) 22% (13/58) +U+2190 Arrows 100% (112/112) 100% (112/112) 100% (112/112) +U+2200 Mathematical Operators 100% (256/256) 39% (100/256) 62% (159/256) +U+2300 Miscellaneous Technical 26% (65/244) 14% (35/244) 47% (117/244) +U+2400 Control Pictures 5% (2/39) 2% (1/39) 2% (1/39) +U+2440 Optical Character Recognition (0/11) (0/11) (0/11) +U+2460 Enclosed Alphanumerics 6% (10/160) (0/160) (0/160) +U+2500 Box Drawing 100% (128/128) 100% (128/128) 100% (128/128) +U+2580 Block Elements 100% (32/32) 100% (32/32) 100% (32/32) +U+25a0 Geometric Shapes 100% (96/96) 100% (96/96) 100% (96/96) +U+2600 Miscellaneous Symbols 73% (187/256) 11% (30/256) 58% (149/256) +U+2700 Dingbats 91% (174/191) 0% (1/191) 75% (144/191) +U+27c0 Miscellaneous Mathematical Symbols-A 18% (9/48) 10% (5/48) 16% (8/48) +U+27f0 Supplemental Arrows-A 100% (16/16) 100% (16/16) (0/16) +U+2800 Braille Patterns 100% (256/256) 100% (256/256) (0/256) +U+2900 Supplemental Arrows-B 4% (6/128) 100% (128/128) (0/128) +U+2980 Miscellaneous Mathematical Symbols-B 10% (13/128) 0% (1/128) 2% (3/128) +U+2a00 Supplemental Mathematical Operators 28% (74/256) 2% (6/256) 1% (3/256) +U+2b00 Miscellaneous Symbols and Arrows 40% (35/87) 31% (27/87) 20% (18/87) +U+2c00 Glagolitic (0/94) (0/94) (0/94) +U+2c60 Latin Extended-C 96% (31/32) 84% (27/32) 43% (14/32) +U+2c80 Coptic (0/123) (0/123) (0/123) +U+2d00 Georgian Supplement 95% (38/40) 95% (38/40) (0/40) +U+2d30 Tifinagh 93% (55/59) (0/59) (0/59) +U+2d80 Ethiopic Extended (0/79) (0/79) (0/79) +U+2de0 Cyrillic Extended-A (0/32) (0/32) (0/32) +U+2e00 Supplemental Punctuation 11% (7/60) 11% (7/60) 11% (7/60) +U+2e80 CJK Radicals Supplement (0/115) (0/115) (0/115) +U+2f00 Kangxi Radicals (0/214) (0/214) (0/214) +U+2ff0 Ideographic Description Characters (0/12) (0/12) (0/12) +U+3000 CJK Symbols and Punctuation (0/64) (0/64) (0/64) +U+3040 Hiragana (0/93) (0/93) (0/93) +U+30a0 Katakana (0/96) (0/96) (0/96) +U+3100 Bopomofo (0/41) (0/41) (0/41) +U+3130 Hangul Compatibility Jamo (0/94) (0/94) (0/94) +U+3190 Kanbun (0/16) (0/16) (0/16) +U+31a0 Bopomofo Extended (0/27) (0/27) (0/27) +U+31c0 CJK Strokes (0/36) (0/36) (0/36) +U+31f0 Katakana Phonetic Extensions (0/16) (0/16) (0/16) +U+3200 Enclosed CJK Letters and Months (0/254) (0/254) (0/254) +U+3300 CJK Compatibility (0/256) (0/256) (0/256) +U+3400 CJK Unified Ideographs Extension A (0/0) (0/0) (0/0) +U+4dc0 Yijing Hexagram Symbols 100% (64/64) (0/64) (0/64) +U+4e00 CJK Unified Ideographs (0/0) (0/0) (0/0) +U+a000 Yi Syllables (0/1165) (0/1165) (0/1165) +U+a490 Yi Radicals (0/55) (0/55) (0/55) +U+a4d0 Lisu 100% (48/48) (0/48) (0/48) +U+a500 Vai (0/300) (0/300) (0/300) +U+a640 Cyrillic Extended-B 34% (31/89) 11% (10/89) (0/89) +U+a6a0 Bamum (0/88) (0/88) (0/88) +U+a700 Modifier Tone Letters 62% (20/32) 62% (20/32) 62% (20/32) +U+a720 Latin Extended-D 55% (75/134) 43% (58/134) 11% (15/134) +U+a800 Syloti Nagri (0/44) (0/44) (0/44) +U+a830 Common Indic Number Forms (0/10) (0/10) (0/10) +U+a840 Phags-pa (0/56) (0/56) (0/56) +U+a880 Saurashtra (0/81) (0/81) (0/81) +U+a8e0 Devanagari Extended (0/28) (0/28) (0/28) +U+a900 Kayah Li (0/48) (0/48) (0/48) +U+a930 Rejang (0/37) (0/37) (0/37) +U+a960 Hangul Jamo Extended-A (0/29) (0/29) (0/29) +U+a980 Javanese (0/91) (0/91) (0/91) +U+aa00 Cham (0/83) (0/83) (0/83) +U+aa60 Myanmar Extended-A (0/28) (0/28) (0/28) +U+aa80 Tai Viet (0/72) (0/72) (0/72) +U+aae0 Meetei Mayek Extensions (0/23) (0/23) (0/23) +U+ab00 Ethiopic Extended-A (0/32) (0/32) (0/32) +U+abc0 Meetei Mayek (0/56) (0/56) (0/56) +U+ac00 Hangul Syllables (0/0) (0/0) (0/0) +U+d7b0 Hangul Jamo Extended-B (0/72) (0/72) (0/72) +U+d800 High Surrogates (0/0) (0/0) (0/0) +U+db80 High Private Use Surrogates (0/0) (0/0) (0/0) +U+dc00 Low Surrogates (0/0) (0/0) (0/0) +U+e000 Private Use Area (0/0) (0/0) (0/0) +U+f900 CJK Compatibility Ideographs (0/472) (0/472) (0/472) +U+fb00 Alphabetic Presentation Forms 100% (58/58) 12% (7/58) 3% (2/58) +U+fb50 Arabic Presentation Forms-A 16% (98/611) (0/611) 11% (72/611) +U+fe00 Variation Selectors 100% (16/16) 100% (16/16) (0/16) +U+fe10 Vertical Forms (0/10) (0/10) (0/10) +U+fe20 Combining Half Marks 57% (4/7) (0/7) (0/7) +U+fe30 CJK Compatibility Forms (0/32) (0/32) (0/32) +U+fe50 Small Form Variants (0/26) (0/26) (0/26) +U+fe70 Arabic Presentation Forms-B 100% (141/141) (0/141) 100% (141/141) +U+ff00 Halfwidth and Fullwidth Forms (0/225) (0/225) (0/225) +U+fff0 Specials 100% (5/5) 100% (5/5) 100% (5/5) +U+10000 Linear B Syllabary (0/88) (0/88) (0/88) +U+10080 Linear B Ideograms (0/123) (0/123) (0/123) +U+10100 Aegean Numbers (0/57) (0/57) (0/57) +U+10140 Ancient Greek Numbers (0/75) (0/75) (0/75) +U+10190 Ancient Symbols (0/12) (0/12) (0/12) +U+101d0 Phaistos Disc (0/46) (0/46) (0/46) +U+10280 Lycian (0/29) (0/29) (0/29) +U+102a0 Carian (0/49) (0/49) (0/49) +U+10300 Old Italic 100% (35/35) (0/35) (0/35) +U+10330 Gothic (0/27) (0/27) (0/27) +U+10380 Ugaritic (0/31) (0/31) (0/31) +U+103a0 Old Persian (0/50) (0/50) (0/50) +U+10400 Deseret (0/80) (0/80) (0/80) +U+10450 Shavian (0/48) (0/48) (0/48) +U+10480 Osmanya (0/40) (0/40) (0/40) +U+10800 Cypriot Syllabary (0/55) (0/55) (0/55) +U+10840 Imperial Aramaic (0/31) (0/31) (0/31) +U+10900 Phoenician (0/29) (0/29) (0/29) +U+10920 Lydian (0/27) (0/27) (0/27) +U+10980 Meroitic Hieroglyphs (0/32) (0/32) (0/32) +U+109a0 Meroitic Cursive (0/26) (0/26) (0/26) +U+10a00 Kharoshthi (0/65) (0/65) (0/65) +U+10a60 Old South Arabian (0/32) (0/32) (0/32) +U+10b00 Avestan (0/61) (0/61) (0/61) +U+10b40 Inscriptional Parthian (0/30) (0/30) (0/30) +U+10b60 Inscriptional Pahlavi (0/27) (0/27) (0/27) +U+10c00 Old Turkic (0/73) (0/73) (0/73) +U+10e60 Rumi Numeral Symbols (0/31) (0/31) (0/31) +U+11000 Brahmi (0/108) (0/108) (0/108) +U+11080 Kaithi (0/66) (0/66) (0/66) +U+110d0 Sora Sompeng (0/35) (0/35) (0/35) +U+11100 Chakma (0/67) (0/67) (0/67) +U+11180 Sharada (0/83) (0/83) (0/83) +U+11680 Takri (0/66) (0/66) (0/66) +U+12000 Cuneiform (0/879) (0/879) (0/879) +U+12400 Cuneiform Numbers and Punctuation (0/103) (0/103) (0/103) +U+13000 Egyptian Hieroglyphs (0/1071) (0/1071) (0/1071) +U+16800 Bamum Supplement (0/569) (0/569) (0/569) +U+16f00 Miao (0/133) (0/133) (0/133) +U+1b000 Kana Supplement (0/2) (0/2) (0/2) +U+1d000 Byzantine Musical Symbols (0/246) (0/246) (0/246) +U+1d100 Musical Symbols (0/220) (0/220) (0/220) +U+1d200 Ancient Greek Musical Notation (0/70) (0/70) (0/70) +U+1d300 Tai Xuan Jing Symbols 100% (87/87) (0/87) (0/87) +U+1d360 Counting Rod Numerals (0/18) (0/18) (0/18) +U+1d400 Mathematical Alphanumeric Symbols 11% (117/996) 5% (55/996) 6% (63/996) +U+1ee00 Arabic Mathematical Alphabetic Symbols (0/143) (0/143) (0/143) +U+1f000 Mahjong Tiles (0/44) (0/44) (0/44) +U+1f030 Domino Tiles 100% (100/100) (0/100) (0/100) +U+1f0a0 Playing Cards 100% (59/59) (0/59) (0/59) +U+1f100 Enclosed Alphanumeric Supplement (0/171) (0/171) (0/171) +U+1f200 Enclosed Ideographic Supplement (0/57) (0/57) (0/57) +U+1f300 Miscellaneous Symbols And Pictographs 0% (4/533) (0/533) (0/533) +U+1f600 Emoticons 82% (63/76) (0/76) (0/76) +U+1f680 Transport And Map Symbols (0/70) (0/70) (0/70) +U+1f700 Alchemical Symbols (0/116) (0/116) (0/116) +U+20000 CJK Unified Ideographs Extension B (0/0) (0/0) (0/0) +U+2a700 CJK Unified Ideographs Extension C (0/0) (0/0) (0/0) +U+2b740 CJK Unified Ideographs Extension D (0/0) (0/0) (0/0) +U+2f800 CJK Compatibility Ideographs Supplement (0/542) (0/542) (0/542) +U+e0000 Tags (0/98) (0/98) (0/98) +U+e0100 Variation Selectors Supplement (0/240) (0/240) (0/240) +U+f0000 Supplementary Private Use Area-A (0/0) (0/0) (0/0) +U+100000 Supplementary Private Use Area-B (0/0) (0/0) (0/0) diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.ctg.z b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.ctg.z new file mode 100755 index 0000000..df25b64 Binary files /dev/null and b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.ctg.z differ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.php new file mode 100755 index 0000000..72147be --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.php @@ -0,0 +1,16 @@ +32,'FontBBox'=>'[-1021 -415 1681 1167]','ItalicAngle'=>0,'Ascent'=>928,'Descent'=>-236,'Leading'=>0,'CapHeight'=>729,'XHeight'=>547,'StemV'=>34,'StemH'=>15,'AvgWidth'=>507,'MaxWidth'=>1735,'MissingWidth'=>600); +$cbbox=array(0=>array(50,-177,550,705),33=>array(151,0,250,729),34=>array(96,458,364,729),35=>array(77,0,761,718),36=>array(83,-147,553,760),37=>array(55,-14,895,742),38=>array(63,-14,749,742),39=>array(96,458,179,729),40=>array(86,-132,310,759),41=>array(80,-132,304,759),42=>array(30,286,470,742),43=>array(106,0,732,627),44=>array(77,-116,220,124),45=>array(49,234,312,314),46=>array(107,0,210,124),47=>array(0,-93,337,729),48=>array(66,-14,570,742),49=>array(110,0,544,729),50=>array(73,0,536,742),51=>array(76,-14,556,742),52=>array(49,0,580,729),53=>array(77,-14,549,729),54=>array(70,-14,573,742),55=>array(82,0,551,729),56=>array(68,-14,568,742),57=>array(63,-14,566,742),58=>array(117,0,220,517),59=>array(77,-116,220,517),60=>array(106,46,732,581),61=>array(106,172,732,454),62=>array(106,46,732,581),63=>array(72,0,461,742),64=>array(66,-174,930,704),65=>array(8,0,676,729),66=>array(98,0,615,729),67=>array(56,-14,644,742),68=>array(98,0,711,729),69=>array(98,0,568,729),70=>array(98,0,517,729),71=>array(56,-14,693,742),72=>array(98,0,654,729),73=>array(98,0,197,729),74=>array(-52,-200,197,729),75=>array(98,0,677,729),76=>array(98,0,552,729),77=>array(98,0,765,729),78=>array(98,0,650,729),79=>array(56,-14,731,742),80=>array(98,0,569,729),81=>array(56,-129,731,742),82=>array(98,0,666,729),83=>array(66,-14,579,742),84=>array(-3,0,614,729),85=>array(87,-14,645,729),86=>array(8,0,676,729),87=>array(33,0,956,729),88=>array(30,0,654,729),89=>array(-2,0,613,729),90=>array(45,0,640,729),91=>array(86,-132,293,760),92=>array(0,-93,337,729),93=>array(97,-132,304,760),94=>array(106,457,732,729),95=>array(-10,-236,510,-166),96=>array(83,617,317,800),97=>array(60,-14,522,560),98=>array(91,-14,580,760),99=>array(55,-14,488,560),100=>array(55,-14,544,760),101=>array(55,-14,562,560),102=>array(23,0,371,760),103=>array(55,-208,544,560),104=>array(91,0,549,760),105=>array(94,0,184,760),106=>array(-18,-208,184,760),107=>array(91,0,576,760),108=>array(94,0,184,760),109=>array(91,0,889,560),110=>array(91,0,549,560),111=>array(55,-14,557,560),112=>array(91,-208,580,560),113=>array(55,-208,544,560),114=>array(91,0,411,560),115=>array(54,-14,472,560),116=>array(27,0,368,702),117=>array(85,-14,543,560),118=>array(30,0,562,547),119=>array(42,0,776,547),120=>array(29,0,559,547),121=>array(30,-208,562,547),122=>array(43,0,482,547),123=>array(125,-163,511,760),124=>array(127,-236,210,764),125=>array(125,-163,511,760),126=>array(106,228,732,399),161=>array(151,0,250,729),162=>array(84,-153,517,699),163=>array(63,0,548,742),164=>array(46,40,592,587),165=>array(40,0,595,729),166=>array(127,-171,210,699),167=>array(45,-95,454,742),168=>array(105,659,395,758),169=>array(138,0,862,725),170=>array(56,229,404,742),171=>array(77,69,518,517),172=>array(106,140,732,421),173=>array(49,234,312,314),174=>array(138,0,862,725),175=>array(104,673,396,745),176=>array(95,432,405,742),177=>array(106,0,732,627),178=>array(46,326,338,742),179=>array(48,319,350,742),180=>array(181,616,415,800),181=>array(85,-208,612,547),182=>array(77,-96,528,729),183=>array(107,285,210,409),184=>array(142,-193,344,0),185=>array(67,326,346,734),186=>array(47,229,424,742),187=>array(94,69,535,517),188=>array(67,-14,937,742),189=>array(67,-14,906,742),190=>array(48,-14,937,742),191=>array(70,-14,459,729),192=>array(8,0,676,927),193=>array(8,0,676,927),194=>array(8,0,676,928),195=>array(8,0,676,921),196=>array(8,0,676,913),197=>array(8,0,676,928),198=>array(4,0,910,729),199=>array(56,-193,644,742),200=>array(98,0,568,927),201=>array(98,0,568,927),202=>array(98,0,568,928),203=>array(98,0,568,913),204=>array(29,0,216,927),205=>array(79,0,265,927),206=>array(-1,0,297,928),207=>array(3,0,293,913),208=>array(5,0,716,729),209=>array(98,0,650,921),210=>array(56,-14,731,927),211=>array(56,-14,731,927),212=>array(56,-14,731,928),213=>array(56,-14,731,921),214=>array(56,-14,731,913),215=>array(137,31,701,596),216=>array(50,-34,737,761),217=>array(87,-14,645,927),218=>array(87,-14,645,927),219=>array(87,-14,645,928),220=>array(87,-14,645,913),221=>array(-2,0,613,927),222=>array(98,0,569,729),223=>array(91,-14,584,760),224=>array(60,-14,522,800),225=>array(60,-14,522,800),226=>array(60,-14,522,800),227=>array(60,-14,522,777),228=>array(60,-14,522,758),229=>array(60,-14,522,878),230=>array(60,-14,929,560),231=>array(55,-193,488,560),232=>array(55,-14,562,800),233=>array(55,-14,562,800),234=>array(55,-14,562,800),235=>array(55,-14,562,758),236=>array(-28,0,206,800),237=>array(70,0,304,800),238=>array(-17,0,295,800),239=>array(-6,0,284,758),240=>array(55,-14,557,760),241=>array(91,0,549,777),242=>array(55,-14,557,800),243=>array(55,-14,557,800),244=>array(55,-14,557,800),245=>array(55,-14,557,777),246=>array(55,-14,557,758),247=>array(106,73,732,554),248=>array(35,-46,576,592),249=>array(85,-14,543,800),250=>array(85,-14,543,800),251=>array(85,-14,543,800),252=>array(85,-14,543,758),253=>array(30,-208,562,800),254=>array(91,-208,580,760),255=>array(30,-208,562,758),256=>array(8,0,676,899),257=>array(60,-14,522,745),258=>array(8,0,676,946),259=>array(60,-14,522,765),260=>array(8,-193,706,729),261=>array(60,-193,563,560),262=>array(56,-14,644,927),263=>array(55,-14,488,800),264=>array(56,-14,644,928),265=>array(55,-14,488,800),266=>array(56,-14,644,914),267=>array(55,-14,488,760),268=>array(56,-14,644,928),269=>array(55,-14,488,800),270=>array(98,0,711,928),271=>array(55,-14,732,760),272=>array(5,0,716,729),273=>array(55,-14,619,760),274=>array(98,0,568,900),275=>array(55,-14,562,745),276=>array(98,0,568,928),277=>array(55,-14,562,785),278=>array(98,0,568,914),279=>array(55,-14,562,760),280=>array(98,-193,569,729),281=>array(55,-193,562,560),282=>array(98,0,568,925),283=>array(55,-14,562,797),284=>array(56,-14,693,928),285=>array(55,-208,544,800),286=>array(56,-14,693,928),287=>array(55,-208,544,785),288=>array(56,-14,693,914),289=>array(55,-208,544,760),290=>array(56,-250,693,742),291=>array(55,-208,544,775),292=>array(98,0,654,928),293=>array(-13,0,549,928),294=>array(98,0,818,729),295=>array(59,0,578,760),296=>array(-14,0,309,921),297=>array(-22,0,300,777),298=>array(1,0,293,899),299=>array(-7,0,285,745),300=>array(-5,0,300,928),301=>array(-14,0,292,785),302=>array(86,-193,268,729),303=>array(73,-193,255,760),304=>array(98,0,198,914),305=>array(94,0,184,560),306=>array(98,-200,492,729),307=>array(94,-208,461,760),308=>array(-52,-200,296,928),309=>array(-18,-208,295,800),310=>array(98,-235,677,729),311=>array(91,-235,576,760),312=>array(91,0,576,547),313=>array(98,0,552,928),314=>array(94,0,286,928),315=>array(98,-235,552,729),316=>array(66,-235,209,760),317=>array(98,0,552,729),318=>array(94,0,375,760),319=>array(98,0,552,729),320=>array(94,0,314,760),321=>array(-7,0,557,729),322=>array(1,0,285,760),323=>array(98,0,650,928),324=>array(91,0,549,803),325=>array(98,-235,650,729),326=>array(91,-235,549,560),327=>array(98,0,650,921),328=>array(91,0,549,800),329=>array(100,0,715,729),330=>array(98,-208,637,742),331=>array(91,-208,549,560),332=>array(56,-14,731,899),333=>array(55,-14,557,745),334=>array(56,-14,731,928),335=>array(55,-14,557,785),336=>array(56,-14,731,927),337=>array(55,-14,557,800),338=>array(56,0,1006,729),339=>array(55,-14,970,560),340=>array(98,0,666,928),341=>array(91,0,447,803),342=>array(98,-235,666,729),343=>array(63,-235,411,560),344=>array(98,0,666,921),345=>array(91,0,419,800),346=>array(66,-14,579,928),347=>array(54,-14,472,803),348=>array(66,-14,579,928),349=>array(54,-14,472,800),350=>array(66,-193,579,742),351=>array(54,-193,472,560),352=>array(66,-14,579,928),353=>array(54,-14,472,800),354=>array(-3,-193,614,729),355=>array(27,-193,368,702),356=>array(-3,0,614,921),357=>array(27,0,374,813),358=>array(-3,0,614,729),359=>array(27,0,368,702),360=>array(87,-14,645,921),361=>array(85,-14,543,777),362=>array(87,-14,645,899),363=>array(85,-14,543,745),364=>array(87,-14,645,928),365=>array(85,-14,543,785),366=>array(87,-14,645,929),367=>array(85,-14,543,849),368=>array(87,-14,645,927),369=>array(85,-14,546,800),370=>array(87,-193,645,729),371=>array(85,-193,613,560),372=>array(33,0,956,932),373=>array(42,0,776,803),374=>array(-2,0,613,932),375=>array(30,-208,562,803),376=>array(-2,0,613,913),377=>array(45,0,640,928),378=>array(43,0,482,803),379=>array(45,0,640,914),380=>array(43,0,482,760),381=>array(45,0,640,928),382=>array(43,0,482,800),383=>array(23,0,371,760),384=>array(16,-14,580,760),385=>array(-51,0,664,729),386=>array(98,0,615,729),387=>array(91,-14,580,760),388=>array(0,0,615,729),389=>array(0,-14,580,760),390=>array(56,-14,644,742),391=>array(56,-14,794,924),392=>array(55,-14,600,760),393=>array(5,0,716,729),394=>array(-51,0,760,729),395=>array(98,0,615,729),396=>array(55,-14,544,760),397=>array(55,-208,557,548),398=>array(64,0,534,729),399=>array(57,-14,731,742),400=>array(80,-14,560,742),401=>array(-52,-200,517,729),402=>array(-63,-208,371,760),403=>array(56,-14,824,924),404=>array(4,-210,683,729),405=>array(91,0,910,760),406=>array(98,0,347,729),407=>array(5,0,290,729),408=>array(98,0,746,742),409=>array(90,0,576,760),410=>array(5,0,271,760),411=>array(30,0,562,760),412=>array(87,-14,894,729),413=>array(-52,-200,650,729),414=>array(91,-208,549,560),415=>array(56,-14,731,742),416=>array(50,-14,764,760),417=>array(58,-14,603,615),418=>array(56,-14,851,742),419=>array(55,-208,668,560),420=>array(-51,0,618,729),421=>array(90,-208,580,760),422=>array(98,-129,666,729),423=>array(56,-14,569,742),424=>array(49,-14,467,560),425=>array(98,0,568,729),426=>array(-132,-208,355,760),427=>array(27,-208,368,702),428=>array(12,0,614,729),429=>array(27,0,368,760),430=>array(-3,-200,614,729),431=>array(84,-4,796,760),432=>array(86,-14,676,615),433=>array(38,-14,726,724),434=>array(98,-15,683,729),435=>array(-2,0,742,742),436=>array(30,-208,730,560),437=>array(45,0,640,729),438=>array(43,0,482,547),439=>array(78,-31,621,729),440=>array(45,-31,588,729),441=>array(51,-213,531,547),442=>array(55,-208,488,547),443=>array(73,0,536,742),444=>array(45,-31,622,729),445=>array(51,-213,531,547),446=>array(43,-14,456,702),447=>array(91,-208,580,560),448=>array(98,-208,197,729),449=>array(98,-208,394,729),450=>array(10,-208,451,729),451=>array(98,0,197,729),452=>array(98,0,1352,928),453=>array(98,0,1211,800),454=>array(55,-14,1071,800),455=>array(98,-200,768,729),456=>array(98,-208,733,760),457=>array(94,-208,367,760),458=>array(98,-200,868,729),459=>array(98,-208,839,760),460=>array(91,-208,733,760),461=>array(8,0,676,928),462=>array(60,-14,522,800),463=>array(-1,0,297,928),464=>array(-16,0,296,800),465=>array(56,-14,731,928),466=>array(55,-14,557,800),467=>array(87,-14,645,928),468=>array(85,-14,543,800),469=>array(87,-14,645,1025),470=>array(85,-14,543,899),471=>array(87,-14,645,1044),472=>array(85,-14,543,892),473=>array(87,-14,645,1044),474=>array(85,-14,543,892),475=>array(87,-14,645,1047),476=>array(85,-14,543,892),477=>array(55,-14,562,560),478=>array(8,0,676,1025),479=>array(60,-14,522,899),480=>array(8,0,676,1025),481=>array(60,-14,522,869),482=>array(4,0,910,900),483=>array(60,-14,929,743),484=>array(56,-14,752,742),485=>array(55,-208,622,560),486=>array(56,-14,693,928),487=>array(55,-208,544,798),488=>array(98,0,677,928),489=>array(-11,0,576,928),490=>array(56,-193,731,742),491=>array(55,-193,557,560),492=>array(56,-193,731,899),493=>array(55,-193,557,745),494=>array(78,-31,621,928),495=>array(43,-213,523,800),496=>array(-18,-208,299,800),497=>array(98,0,1352,729),498=>array(98,0,1211,729),499=>array(55,-14,1071,760),500=>array(56,-14,693,928),501=>array(55,-208,544,798),502=>array(98,-14,1022,729),503=>array(98,-208,626,742),504=>array(98,0,650,927),505=>array(91,0,549,799),506=>array(8,0,676,931),507=>array(60,-14,607,931),508=>array(4,0,910,928),509=>array(60,-14,929,798),510=>array(50,-34,737,928),511=>array(35,-46,576,798),512=>array(8,0,676,930),513=>array(60,-14,522,799),514=>array(8,0,676,901),515=>array(60,-14,522,785),516=>array(98,0,568,930),517=>array(55,-14,562,798),518=>array(98,0,568,901),519=>array(55,-14,562,785),520=>array(-43,0,306,930),521=>array(-30,0,313,798),522=>array(2,0,308,901),523=>array(-14,0,292,785),524=>array(56,-14,731,930),525=>array(55,-14,557,799),526=>array(56,-14,731,901),527=>array(55,-14,557,785),528=>array(97,0,666,930),529=>array(63,0,411,798),530=>array(98,0,666,901),531=>array(91,0,421,785),532=>array(87,-14,645,930),533=>array(85,-14,543,799),534=>array(87,-14,645,901),535=>array(85,-14,543,785),536=>array(66,-240,579,742),537=>array(54,-240,472,560),538=>array(-3,-240,614,729),539=>array(27,-240,368,702),540=>array(76,-210,556,742),541=>array(35,-211,467,560),542=>array(98,0,654,928),543=>array(-8,0,549,928),544=>array(98,-208,637,742),545=>array(55,-70,783,760),546=>array(55,-14,643,742),547=>array(55,-14,555,632),548=>array(45,-208,640,729),549=>array(43,-208,482,547),550=>array(8,0,676,914),551=>array(60,-14,522,760),552=>array(98,-193,568,729),553=>array(55,-193,562,560),554=>array(56,-14,731,1025),555=>array(55,-14,557,899),556=>array(56,-14,731,1025),557=>array(55,-14,557,864),558=>array(56,-14,731,914),559=>array(55,-14,557,760),560=>array(56,-14,731,1025),561=>array(55,-14,557,899),562=>array(-2,0,613,899),563=>array(30,-208,562,745),564=>array(67,-70,420,757),565=>array(91,-70,788,560),566=>array(27,-70,422,702),567=>array(-18,-208,184,547),568=>array(55,-14,943,760),569=>array(55,-208,943,560),570=>array(-1,-34,686,761),571=>array(6,-34,692,761),572=>array(4,-46,545,592),573=>array(5,0,552,729),574=>array(-38,-34,649,761),575=>array(54,-242,512,560),576=>array(43,-242,525,547),577=>array(39,0,569,729),578=>array(39,0,445,560),579=>array(5,0,615,729),580=>array(6,-14,726,729),581=>array(8,0,676,729),582=>array(98,-93,568,822),583=>array(55,-93,562,640),584=>array(-52,-200,290,729),585=>array(-18,-208,264,760),586=>array(56,-200,836,743),587=>array(55,-208,656,560),588=>array(5,0,666,729),589=>array(7,0,411,560),590=>array(-5,0,615,729),591=>array(5,-208,588,547),592=>array(85,-14,547,560),593=>array(55,-14,544,560),594=>array(91,-14,580,560),595=>array(91,-14,580,760),596=>array(62,-14,495,560),597=>array(55,-69,488,560),598=>array(55,-208,656,760),599=>array(55,-14,715,760),600=>array(55,-14,562,560),601=>array(55,-14,562,560),602=>array(61,-14,814,560),603=>array(65,-14,473,561),604=>array(65,-14,473,561),605=>array(65,-14,771,561),606=>array(55,-14,596,561),607=>array(-18,-208,264,547),608=>array(55,-208,715,760),609=>array(55,-208,544,547),610=>array(55,-14,539,560),611=>array(47,-210,549,547),612=>array(47,-14,549,547),613=>array(85,-208,543,547),614=>array(91,0,549,760),615=>array(91,-208,549,760),616=>array(7,0,265,760),617=>array(81,0,304,547),618=>array(57,0,314,547),619=>array(37,0,359,760),620=>array(38,0,416,760),621=>array(94,-208,296,760),622=>array(94,-213,651,760),623=>array(91,-13,889,548),624=>array(91,-208,889,548),625=>array(91,-208,889,560),626=>array(-18,-208,552,560),627=>array(91,-208,661,560),628=>array(87,0,549,547),629=>array(55,-14,557,560),630=>array(55,0,768,547),631=>array(72,-18,655,561),632=>array(55,-208,602,760),633=>array(0,-13,320,547),634=>array(0,-13,320,755),635=>array(0,-208,433,547),636=>array(91,-207,411,560),637=>array(91,-208,411,560),638=>array(64,0,437,560),639=>array(57,0,437,560),640=>array(91,0,574,547),641=>array(91,0,574,547),642=>array(54,-208,472,560),643=>array(-19,-208,355,760),644=>array(-19,-208,355,760),645=>array(27,-208,401,549),646=>array(-132,-208,355,760),647=>array(27,-156,368,546),648=>array(27,-208,370,702),649=>array(0,-14,634,547),650=>array(55,-15,564,547),651=>array(94,0,545,548),652=>array(30,0,562,547),653=>array(42,0,776,547),654=>array(30,0,562,760),655=>array(50,0,552,547),656=>array(43,-208,593,547),657=>array(43,-54,482,547),658=>array(43,-213,523,547),659=>array(53,-213,553,547),660=>array(43,0,456,759),661=>array(43,0,456,759),662=>array(43,0,456,759),663=>array(43,-213,456,760),664=>array(56,-14,731,742),665=>array(91,0,530,547),666=>array(55,-14,596,561),667=>array(55,-14,724,760),668=>array(91,0,563,547),669=>array(-132,-208,272,760),670=>array(91,-213,576,547),671=>array(91,0,493,547),672=>array(55,-208,746,759),673=>array(43,0,456,759),674=>array(43,0,456,759),675=>array(55,-14,970,760),676=>array(55,-213,1014,760),677=>array(55,-54,970,760),678=>array(27,0,781,702),679=>array(27,-208,629,760),680=>array(27,-70,723,702),681=>array(23,-208,804,760),682=>array(94,0,657,760),683=>array(94,0,610,760),684=>array(26,-15,489,640),685=>array(26,84,489,640),686=>array(0,-214,570,760),687=>array(0,-208,683,760),688=>array(57,326,346,751),689=>array(57,326,346,751),690=>array(-11,209,116,751),691=>array(57,326,259,640),692=>array(35,319,236,632),693=>array(35,209,307,632),694=>array(16,326,320,632),695=>array(26,326,489,632),696=>array(19,209,354,632),697=>array(78,557,203,800),698=>array(78,557,384,800),699=>array(85,489,228,729),700=>array(87,499,230,729),701=>array(96,616,239,856),702=>array(57,492,191,760),703=>array(57,492,191,760),704=>array(57,326,317,751),705=>array(57,326,317,751),706=>array(130,524,370,836),707=>array(130,524,370,836),708=>array(94,561,406,800),709=>array(94,561,406,800),710=>array(94,616,406,800),711=>array(94,616,406,800),712=>array(104,488,171,759),713=>array(104,673,396,745),714=>array(181,616,415,800),715=>array(83,617,317,800),716=>array(104,-148,171,123),717=>array(104,-156,396,-84),718=>array(83,-236,317,-54),719=>array(181,-236,415,-53),720=>array(54,0,229,517),721=>array(54,356,229,517),722=>array(57,249,191,517),723=>array(57,249,191,517),724=>array(140,229,360,448),725=>array(140,229,360,448),726=>array(49,125,341,417),727=>array(49,234,269,307),728=>array(97,645,403,785),729=>array(200,658,300,758),730=>array(116,610,384,878),731=>array(162,-193,344,0),732=>array(89,639,411,777),733=>array(117,616,460,800),734=>array(-0,233,334,504),735=>array(117,616,383,800),736=>array(57,208,374,632),737=>array(60,326,116,751),738=>array(57,326,320,648),739=>array(57,326,391,632),740=>array(57,326,317,751),741=>array(104,0,389,668),742=>array(104,0,389,668),743=>array(104,0,389,668),744=>array(104,0,389,668),745=>array(104,0,389,668),748=>array(94,-260,406,-21),749=>array(104,610,396,808),750=>array(85,489,428,729),755=>array(116,-240,384,28),759=>array(89,-192,411,-55),768=>array(-418,560,-184,800),769=>array(-320,560,-86,800),770=>array(-406,560,-94,800),771=>array(-412,639,-90,777),772=>array(-394,673,-102,745),773=>array(-510,686,10,755),774=>array(-407,645,-101,785),775=>array(-296,560,-206,760),776=>array(-395,560,-105,758),777=>array(-348,618,-129,810),778=>array(-385,610,-117,878),779=>array(-381,616,-38,800),780=>array(-404,560,-92,800),781=>array(-283,615,-217,832),782=>array(-383,615,-117,832),783=>array(-455,616,-112,800),784=>array(-407,645,-101,917),785=>array(-407,645,-101,785),786=>array(-235,489,-92,645),787=>array(-305,595,-187,844),788=>array(-305,595,-187,844),789=>array(-66,575,66,759),790=>array(-418,-266,-184,-83),791=>array(-320,-267,-86,-83),792=>array(-357,-240,-221,-24),793=>array(-279,-240,-143,-24),794=>array(-208,690,31,930),795=>array(-133,427,60,609),796=>array(-313,-241,-208,-32),797=>array(-370,-240,-130,-87),798=>array(-370,-240,-130,-87),799=>array(-357,-240,-143,-24),800=>array(-370,-184,-130,-117),801=>array(-315,-208,-23,63),802=>array(-317,-208,-25,63),803=>array(-296,-183,-206,-69),804=>array(-396,-183,-106,-84),805=>array(-355,-241,-146,-32),806=>array(-323,-240,-180,-84),807=>array(-358,-193,-156,0),808=>array(-338,-193,-156,0),809=>array(-283,-240,-217,-47),810=>array(-383,-211,-114,-50),811=>array(-452,-222,-51,-82),812=>array(-404,-240,-92,-57),813=>array(-407,-240,-95,-57),814=>array(-407,-222,-101,-82),815=>array(-407,-224,-101,-83),816=>array(-412,-222,-90,-84),817=>array(-394,-156,-102,-84),818=>array(-510,-236,10,-166),819=>array(-510,-236,10,-9),820=>array(-557,240,-41,381),821=>array(-316,221,-59,301),822=>array(-634,221,-0,301),823=>array(-574,-46,-33,592),824=>array(-741,-34,-54,761),825=>array(-291,-241,-187,-32),826=>array(-382,-206,-113,-44),827=>array(-359,-240,-139,-21),828=>array(-452,-222,-51,-82),829=>array(-354,619,-138,834),830=>array(-247,595,-109,853),831=>array(-510,528,10,755),832=>array(-418,617,-184,800),833=>array(-320,616,-86,800),834=>array(-412,639,-90,777),835=>array(-305,595,-187,844),836=>array(-387,659,-77,978),837=>array(-278,-208,-171,-45),838=>array(-396,639,-104,786),839=>array(-360,-226,-140,-35),840=>array(-365,-240,-135,-47),841=>array(-360,-240,-140,-21),842=>array(-411,616,-89,800),843=>array(-411,567,-89,850),844=>array(-411,596,-89,820),845=>array(-452,-230,-48,-30),846=>array(-350,-240,-150,-45),849=>array(-316,610,-184,878),850=>array(-407,547,-101,855),851=>array(-354,-240,-138,-24),855=>array(-316,610,-184,878),856=>array(-103,658,-3,758),858=>array(-430,-241,-71,-32),860=>array(-445,-237,445,-60),861=>array(-445,802,445,979),862=>array(-445,855,445,927),863=>array(-445,-156,445,-84),864=>array(-354,756,354,894),865=>array(-445,752,445,929),866=>array(-442,-230,447,-30),880=>array(98,0,555,729),881=>array(94,0,477,547),882=>array(98,0,764,729),883=>array(98,0,549,729),884=>array(78,557,203,800),885=>array(78,-208,203,35),886=>array(98,0,650,729),887=>array(91,0,559,547),890=>array(214,-208,321,-45),891=>array(62,-14,495,560),892=>array(55,-14,488,560),893=>array(62,-14,495,560),894=>array(77,-116,220,517),900=>array(181,616,415,800),901=>array(105,659,415,978),902=>array(8,0,676,800),903=>array(107,285,210,409),904=>array(-12,0,682,800),905=>array(-6,0,765,800),906=>array(-9,0,311,800),908=>array(-7,-14,750,800),910=>array(-15,0,821,800),911=>array(-18,0,752,800),912=>array(2,0,313,978),913=>array(8,0,676,729),914=>array(98,0,615,729),915=>array(98,0,552,729),916=>array(8,0,676,729),917=>array(98,0,568,729),918=>array(45,0,640,729),919=>array(98,0,654,729),920=>array(56,-14,731,742),921=>array(98,0,197,729),922=>array(98,0,677,729),923=>array(8,0,676,729),924=>array(98,0,765,729),925=>array(98,0,650,729),926=>array(98,0,548,729),927=>array(56,-14,731,742),928=>array(98,0,654,729),929=>array(98,0,569,729),931=>array(98,0,568,729),932=>array(-3,0,614,729),933=>array(-2,0,613,729),934=>array(56,0,731,729),935=>array(30,0,654,729),936=>array(56,0,732,729),937=>array(38,0,726,738),938=>array(3,0,293,913),939=>array(-2,0,613,913),940=>array(55,-12,611,800),941=>array(65,-14,473,800),942=>array(91,-208,549,800),943=>array(81,0,324,800),944=>array(73,-14,521,978),945=>array(55,-12,611,559),946=>array(94,-208,566,766),947=>array(16,-208,562,547),948=>array(55,-14,557,742),949=>array(65,-14,473,561),950=>array(52,-210,496,760),951=>array(91,-208,549,560),952=>array(55,-11,557,768),953=>array(81,0,304,547),954=>array(93,0,565,547),955=>array(30,0,562,760),956=>array(85,-208,612,547),957=>array(36,0,512,547),958=>array(52,-210,500,760),959=>array(55,-14,557,560),960=>array(36,-19,574,547),961=>array(91,-208,580,560),962=>array(55,-210,488,560),963=>array(55,-14,604,547),964=>array(49,0,553,547),965=>array(73,-14,521,547),966=>array(55,-208,602,551),967=>array(29,-208,549,547),968=>array(55,-208,602,547),969=>array(66,-14,769,547),970=>array(2,0,311,758),971=>array(73,-14,521,758),972=>array(55,-14,557,800),973=>array(73,-14,521,800),974=>array(66,-14,769,800),975=>array(98,-208,677,729),976=>array(82,-11,538,768),977=>array(55,-11,557,768),978=>array(42,0,665,734),979=>array(-15,0,829,800),980=>array(42,0,665,913),981=>array(55,-208,602,760),982=>array(32,-14,803,547),983=>array(55,-206,600,550),984=>array(56,-207,731,742),985=>array(55,-208,557,560),986=>array(68,-210,583,729),987=>array(55,-210,540,547),988=>array(98,0,517,729),989=>array(-94,-208,409,760),990=>array(87,-2,604,729),991=>array(93,0,566,759),992=>array(56,-208,797,742),993=>array(58,-180,573,559),994=>array(56,-213,877,729),995=>array(66,-208,769,547),996=>array(56,-208,660,742),997=>array(55,-208,568,560),998=>array(98,-213,735,729),999=>array(22,-14,571,575),1000=>array(39,-208,630,745),1001=>array(49,-208,552,560),1002=>array(56,0,714,742),1003=>array(26,0,599,560),1004=>array(56,-14,643,758),1005=>array(55,-14,544,758),1006=>array(21,-208,589,729),1007=>array(27,-208,510,726),1008=>array(55,-7,600,550),1009=>array(91,-208,580,560),1010=>array(55,-14,488,560),1011=>array(-18,-208,184,760),1012=>array(56,-14,731,742),1013=>array(55,-14,480,560),1014=>array(96,-14,521,560),1015=>array(98,0,569,729),1016=>array(91,-208,580,760),1017=>array(56,-14,644,742),1018=>array(98,0,765,729),1019=>array(62,-208,587,547),1020=>array(42,-208,580,560),1021=>array(56,-14,644,742),1022=>array(56,-14,644,742),1023=>array(56,-14,644,742),1024=>array(98,0,568,927),1025=>array(98,0,568,913),1026=>array(-3,-200,709,729),1027=>array(98,0,552,927),1028=>array(56,-14,644,742),1029=>array(66,-14,579,742),1030=>array(98,0,197,729),1031=>array(3,0,293,913),1032=>array(-52,-200,197,729),1033=>array(41,0,1023,729),1034=>array(98,0,975,729),1035=>array(-3,0,709,729),1036=>array(98,0,690,927),1037=>array(98,0,650,927),1038=>array(17,0,592,928),1039=>array(98,-157,654,729),1040=>array(8,0,676,729),1041=>array(98,0,615,729),1042=>array(98,0,615,729),1043=>array(98,0,552,729),1044=>array(49,-157,732,729),1045=>array(98,0,568,729),1046=>array(20,0,1058,729),1047=>array(66,-14,575,742),1048=>array(98,0,650,729),1049=>array(98,0,650,928),1050=>array(98,0,690,729),1051=>array(41,0,653,729),1052=>array(98,0,765,729),1053=>array(98,0,654,729),1054=>array(56,-14,731,742),1055=>array(98,0,654,729),1056=>array(98,0,569,729),1057=>array(56,-14,644,742),1058=>array(-3,0,614,729),1059=>array(17,0,592,729),1060=>array(59,0,802,729),1061=>array(30,0,654,729),1062=>array(98,-157,737,729),1063=>array(85,0,587,729),1064=>array(98,0,971,729),1065=>array(98,-157,1054,729),1066=>array(29,0,762,729),1067=>array(98,0,784,729),1068=>array(98,0,615,729),1069=>array(54,-14,642,742),1070=>array(103,-14,1023,742),1071=>array(66,0,597,729),1072=>array(60,-14,522,560),1073=>array(55,-14,562,777),1074=>array(91,0,530,547),1075=>array(91,0,477,547),1076=>array(52,-138,639,547),1077=>array(55,-14,562,560),1078=>array(34,0,867,547),1079=>array(65,-14,473,561),1080=>array(91,0,559,547),1081=>array(91,0,559,760),1082=>array(91,0,571,547),1083=>array(37,0,556,547),1084=>array(91,0,664,547),1085=>array(91,0,563,547),1086=>array(55,-14,557,560),1087=>array(91,0,563,547),1088=>array(91,-208,580,560),1089=>array(55,-14,488,560),1090=>array(29,0,553,547),1091=>array(30,-208,562,547),1092=>array(55,-208,800,729),1093=>array(29,0,559,547),1094=>array(91,-138,635,547),1095=>array(73,0,500,547),1096=>array(91,0,824,547),1097=>array(91,-138,896,547),1098=>array(30,0,647,547),1099=>array(91,0,701,560),1100=>array(91,0,530,547),1101=>array(55,-14,488,560),1102=>array(94,-14,787,560),1103=>array(57,0,517,547),1104=>array(55,-14,562,802),1105=>array(55,-14,562,758),1106=>array(23,-208,570,760),1107=>array(91,0,480,803),1108=>array(55,-14,488,560),1109=>array(54,-14,472,560),1110=>array(94,0,184,760),1111=>array(-6,0,284,758),1112=>array(-18,-208,184,760),1113=>array(37,0,843,547),1114=>array(91,0,839,547),1115=>array(23,0,567,760),1116=>array(91,0,571,803),1117=>array(91,0,559,802),1118=>array(30,-208,562,760),1119=>array(91,-138,563,547),1120=>array(56,-14,877,729),1121=>array(66,-14,769,547),1122=>array(15,0,711,729),1123=>array(15,0,613,760),1124=>array(103,-14,888,742),1125=>array(94,-14,688,560),1126=>array(8,0,871,729),1127=>array(25,0,758,547),1128=>array(98,0,1135,729),1129=>array(94,0,977,547),1130=>array(56,0,731,729),1131=>array(52,0,560,547),1132=>array(98,0,971,729),1133=>array(94,0,772,547),1134=>array(56,-208,556,935),1135=>array(44,-193,473,753),1136=>array(8,0,844,729),1137=>array(24,-208,852,765),1138=>array(56,-14,731,742),1139=>array(55,-14,557,560),1140=>array(8,0,769,742),1141=>array(24,0,640,560),1142=>array(8,0,769,930),1143=>array(24,0,640,800),1144=>array(56,-208,962,742),1145=>array(55,-208,875,560),1146=>array(56,-14,897,742),1147=>array(55,-14,704,560),1148=>array(58,-14,1122,932),1149=>array(74,-14,954,758),1150=>array(56,-14,877,900),1151=>array(66,-14,769,734),1152=>array(56,-208,644,742),1153=>array(55,-208,488,560),1154=>array(29,-44,474,457),1155=>array(-519,608,-93,810),1156=>array(-372,645,4,788),1157=>array(-288,595,-169,797),1158=>array(-288,595,-169,797),1159=>array(-776,606,4,788),1160=>array(-1021,-180,409,922),1161=>array(-957,-280,345,1022),1162=>array(98,-208,748,928),1163=>array(94,-208,652,760),1164=>array(16,0,615,729),1165=>array(19,0,534,702),1166=>array(98,0,610,729),1167=>array(91,-208,580,560),1168=>array(98,0,552,878),1169=>array(91,0,477,700),1170=>array(35,0,617,729),1171=>array(27,0,542,547),1172=>array(98,-200,600,729),1173=>array(91,-208,505,547),1174=>array(20,-157,1071,729),1175=>array(34,-138,876,547),1176=>array(66,-193,575,742),1177=>array(65,-193,473,561),1178=>array(98,-157,713,729),1179=>array(91,-138,587,547),1180=>array(98,0,690,729),1181=>array(91,0,571,547),1182=>array(16,0,690,729),1183=>array(30,0,571,760),1184=>array(24,0,837,729),1185=>array(21,0,688,547),1186=>array(98,-157,752,729),1187=>array(94,-138,656,547),1188=>array(98,0,1009,729),1189=>array(94,0,862,547),1190=>array(98,-200,1057,729),1191=>array(94,-208,891,547),1192=>array(56,-14,871,743),1193=>array(55,-14,684,560),1194=>array(56,-193,644,742),1195=>array(55,-193,488,560),1196=>array(-3,-157,614,729),1197=>array(29,-138,553,547),1198=>array(-2,0,613,729),1199=>array(30,-208,562,547),1200=>array(-2,0,613,729),1201=>array(30,-208,562,547),1202=>array(30,-157,654,729),1203=>array(29,-138,559,547),1204=>array(-3,-157,910,729),1205=>array(2,-138,782,547),1206=>array(85,-157,686,729),1207=>array(73,-138,590,547),1208=>array(85,0,587,729),1209=>array(73,0,500,547),1210=>array(85,0,587,729),1211=>array(91,0,549,760),1212=>array(10,-14,885,742),1213=>array(7,-14,675,560),1214=>array(10,-184,885,742),1215=>array(7,-161,675,560),1216=>array(98,0,197,729),1217=>array(20,0,1058,928),1218=>array(34,0,867,785),1219=>array(98,-200,651,729),1220=>array(93,-208,566,547),1221=>array(26,-208,751,729),1222=>array(22,-208,646,547),1223=>array(98,-200,654,729),1224=>array(94,-208,566,547),1225=>array(98,-208,752,729),1226=>array(94,-208,656,547),1227=>array(85,-157,587,729),1228=>array(73,-138,500,547),1229=>array(98,-208,863,729),1230=>array(94,-208,750,547),1231=>array(94,0,184,760),1232=>array(8,0,676,946),1233=>array(60,-14,522,765),1234=>array(8,0,676,913),1235=>array(60,-14,522,758),1236=>array(4,0,910,729),1237=>array(60,-14,929,560),1238=>array(98,0,568,928),1239=>array(55,-14,562,785),1240=>array(57,-14,731,742),1241=>array(55,-14,562,560),1242=>array(57,-14,731,913),1243=>array(55,-14,562,758),1244=>array(20,0,1058,913),1245=>array(34,0,867,758),1246=>array(66,-14,575,913),1247=>array(65,-14,473,758),1248=>array(78,-31,621,729),1249=>array(43,-213,523,547),1250=>array(98,0,650,899),1251=>array(91,0,559,745),1252=>array(98,0,650,913),1253=>array(91,0,559,758),1254=>array(56,-14,731,913),1255=>array(55,-14,557,758),1256=>array(56,-14,731,742),1257=>array(55,-14,557,560),1258=>array(56,-14,731,913),1259=>array(55,-14,557,758),1260=>array(54,-14,642,913),1261=>array(55,-14,488,758),1262=>array(17,0,592,899),1263=>array(30,-208,562,745),1264=>array(17,0,592,913),1265=>array(30,-208,562,758),1266=>array(17,0,592,927),1267=>array(30,-208,562,800),1268=>array(85,0,587,913),1269=>array(73,0,500,758),1270=>array(98,-157,552,729),1271=>array(91,-138,477,547),1272=>array(98,0,784,913),1273=>array(91,0,701,758),1274=>array(35,-208,617,729),1275=>array(27,-208,542,547),1276=>array(30,-200,646,729),1277=>array(29,-208,549,547),1278=>array(30,0,654,729),1279=>array(29,0,559,547),1280=>array(71,0,588,729),1281=>array(55,0,495,547),1282=>array(71,-14,908,729),1283=>array(55,-14,806,547),1284=>array(98,-14,876,742),1285=>array(83,-14,784,561),1286=>array(98,-208,654,742),1287=>array(83,-208,564,561),1288=>array(26,-14,974,729),1289=>array(22,-14,866,547),1290=>array(98,-14,1022,729),1291=>array(94,-14,876,547),1292=>array(56,-14,692,742),1293=>array(55,-14,534,560),1294=>array(-3,-14,675,729),1295=>array(2,-14,620,547),1296=>array(80,-14,560,742),1297=>array(65,-14,473,561),1298=>array(41,-200,653,729),1299=>array(37,-208,556,547),1300=>array(41,0,1139,729),1301=>array(37,0,962,547),1302=>array(98,0,863,729),1303=>array(91,-208,832,560),1304=>array(66,0,967,729),1305=>array(57,-14,933,560),1306=>array(56,-129,731,742),1307=>array(55,-208,544,560),1308=>array(33,0,956,729),1309=>array(42,0,776,547),1310=>array(98,0,690,729),1311=>array(91,0,571,547),1312=>array(41,-200,1056,729),1313=>array(37,-208,881,547),1314=>array(98,-200,1057,729),1315=>array(91,-208,888,547),1316=>array(98,-157,752,729),1317=>array(91,-138,653,547),1329=>array(87,-29,680,729),1330=>array(87,0,650,743),1331=>array(45,0,729,743),1332=>array(44,0,724,743),1333=>array(87,-14,650,729),1334=>array(87,0,692,744),1335=>array(92,0,616,729),1336=>array(87,0,650,743),1337=>array(87,-14,835,743),1338=>array(45,-14,729,729),1339=>array(92,0,650,729),1340=>array(92,0,533,729),1341=>array(92,-14,849,729),1342=>array(129,-13,763,742),1343=>array(87,0,645,729),1344=>array(34,-26,638,729),1345=>array(82,-23,688,744),1346=>array(49,0,729,743),1347=>array(51,0,715,735),1348=>array(87,-14,767,729),1349=>array(71,-14,668,743),1350=>array(0,-14,680,729),1351=>array(78,-15,684,729),1352=>array(87,0,645,743),1353=>array(59,-28,664,744),1354=>array(44,0,713,743),1355=>array(82,0,686,744),1356=>array(87,0,767,743),1357=>array(87,-14,645,729),1358=>array(49,0,729,729),1359=>array(73,-14,632,741),1360=>array(87,0,645,743),1361=>array(78,-14,675,743),1362=>array(92,0,538,729),1363=>array(59,0,752,729),1364=>array(24,0,679,743),1365=>array(56,-14,731,742),1366=>array(54,-13,746,729),1369=>array(57,492,191,760),1370=>array(87,499,230,729),1371=>array(0,620,234,803),1372=>array(2,618,356,893),1373=>array(-0,617,233,800),1374=>array(4,613,401,866),1375=>array(44,618,462,760),1377=>array(85,-14,883,547),1378=>array(91,-208,549,560),1379=>array(55,-208,648,560),1380=>array(91,-208,653,560),1381=>array(85,-14,548,760),1382=>array(55,-208,648,560),1383=>array(91,0,490,760),1384=>array(91,-208,549,560),1385=>array(91,-208,738,560),1386=>array(55,-14,648,760),1387=>array(91,-208,549,760),1388=>array(91,-208,303,547),1389=>array(91,-208,889,760),1390=>array(55,-14,557,760),1391=>array(85,-208,543,760),1392=>array(91,0,549,760),1393=>array(52,-15,523,760),1394=>array(91,-208,653,560),1395=>array(68,-14,544,768),1396=>array(85,-14,647,760),1397=>array(-21,-208,181,547),1398=>array(-19,-14,543,760),1399=>array(0,-208,435,560),1400=>array(91,0,549,560),1401=>array(5,-208,370,547),1402=>array(85,-208,883,547),1403=>array(54,-208,494,561),1404=>array(91,0,609,560),1405=>array(85,-14,543,560),1406=>array(85,-208,647,760),1407=>array(85,-14,889,560),1408=>array(91,-208,549,560),1409=>array(54,-208,543,560),1410=>array(91,0,449,547),1411=>array(85,-208,889,760),1412=>array(20,-208,580,560),1413=>array(54,-14,556,560),1414=>array(34,-208,766,760),1415=>array(85,-14,812,760),1417=>array(117,0,220,415),1418=>array(49,212,312,314),1456=>array(283,-217,356,-22),1457=>array(83,-217,438,-22),1458=>array(125,-217,454,-22),1459=>array(125,-217,454,-22),1460=>array(283,-159,356,-85),1461=>array(222,-159,417,-85),1462=>array(222,-217,417,-22),1463=>array(173,-159,466,-85),1464=>array(173,-193,466,-46),1465=>array(0,625,73,698),1466=>array(0,625,73,698),1467=>array(148,-237,465,-17),1468=>array(288,237,361,310),1469=>array(283,-217,356,-22),1470=>array(49,472,312,552),1471=>array(173,625,466,698),1472=>array(102,-98,193,645),1473=>array(637,625,710,698),1474=>array(96,625,169,698),1475=>array(102,0,193,547),1478=>array(50,0,357,547),1479=>array(173,-217,466,-22),1488=>array(91,0,578,547),1489=>array(43,0,535,547),1490=>array(43,-5,383,547),1491=>array(43,0,511,547),1492=>array(91,0,563,547),1493=>array(91,0,182,547),1494=>array(43,0,303,547),1495=>array(91,0,563,547),1496=>array(90,-14,593,552),1497=>array(66,204,157,547),1498=>array(43,-208,446,547),1499=>array(43,0,474,547),1500=>array(43,0,492,729),1501=>array(91,0,573,547),1502=>array(43,0,588,555),1503=>array(91,-208,182,547),1504=>array(43,0,309,547),1505=>array(90,-14,593,547),1506=>array(43,-93,535,547),1507=>array(91,-208,549,547),1508=>array(91,0,569,547),1509=>array(43,-208,497,548),1510=>array(43,0,502,547),1511=>array(91,-208,633,546),1512=>array(43,0,474,547),1513=>array(43,0,666,547),1514=>array(10,-4,566,547),1520=>array(91,0,380,547),1521=>array(66,0,332,547),1522=>array(66,204,312,547),1523=>array(91,361,325,547),1524=>array(91,361,554,547),1542=>array(0,-20,607,892),1543=>array(0,-20,607,895),1545=>array(65,0,685,635),1546=>array(65,0,904,635),1548=>array(107,0,250,240),1557=>array(123,624,377,868),1563=>array(107,0,250,633),1567=>array(72,0,461,742),1569=>array(80,42,390,483),1570=>array(-37,0,315,939),1571=>array(53,0,220,999),1572=>array(-42,-244,406,588),1573=>array(53,-244,220,760),1574=>array(63,-131,719,588),1575=>array(94,0,184,760),1576=>array(63,-171,865,327),1577=>array(68,-28,453,513),1578=>array(63,-10,865,391),1579=>array(63,-10,865,513),1580=>array(77,-244,645,425),1581=>array(77,-244,645,425),1582=>array(77,-244,645,586),1583=>array(61,-19,388,415),1584=>array(61,-19,388,586),1585=>array(-42,-244,423,269),1586=>array(-42,-244,423,464),1587=>array(63,-244,1138,366),1588=>array(63,-244,1138,586),1589=>array(63,-244,1134,362),1590=>array(63,-244,1134,464),1591=>array(70,0,857,760),1592=>array(70,0,857,760),1593=>array(57,-244,587,521),1594=>array(57,-244,587,659),1600=>array(-10,0,303,90),1601=>array(63,-45,952,635),1602=>array(52,-215,701,635),1603=>array(70,-27,722,760),1604=>array(70,-152,637,760),1605=>array(68,-240,546,369),1606=>array(72,-162,660,464),1607=>array(68,-28,453,358),1608=>array(-42,-244,406,315),1609=>array(63,-131,719,411),1610=>array(63,-244,719,411),1611=>array(107,591,393,825),1612=>array(107,591,393,874),1613=>array(107,-239,393,-5),1614=>array(107,591,393,708),1615=>array(107,590,393,874),1616=>array(107,-137,393,-20),1617=>array(98,599,402,869),1618=>array(115,610,383,878),1619=>array(74,590,426,719),1620=>array(164,593,331,808),1621=>array(164,-244,331,-29),1623=>array(107,615,393,898),1626=>array(119,616,381,775),1632=>array(215,220,322,342),1633=>array(136,0,342,635),1634=>array(40,0,492,635),1635=>array(37,0,509,635),1636=>array(85,-10,457,641),1637=>array(66,-10,471,643),1638=>array(42,0,493,635),1639=>array(29,0,508,635),1640=>array(29,0,508,635),1641=>array(49,0,493,640),1642=>array(65,0,472,635),1643=>array(0,-110,300,318),1644=>array(87,499,230,729),1645=>array(42,101,502,537),1646=>array(63,-10,865,327),1647=>array(52,-215,701,481),1648=>array(223,602,277,887),1652=>array(60,649,227,864),1657=>array(63,-10,865,575),1658=>array(63,-10,865,513),1659=>array(63,-244,865,327),1660=>array(63,-180,865,391),1661=>array(63,-10,865,464),1662=>array(63,-244,865,327),1663=>array(63,-10,865,513),1664=>array(63,-244,865,327),1665=>array(77,-244,645,710),1666=>array(77,-244,645,708),1667=>array(77,-244,645,425),1668=>array(77,-244,645,425),1669=>array(77,-244,645,708),1670=>array(77,-244,645,425),1671=>array(77,-244,645,425),1672=>array(61,-19,388,746),1673=>array(61,-180,388,415),1674=>array(61,-171,388,415),1675=>array(61,-171,388,746),1676=>array(61,-19,388,586),1677=>array(61,-146,388,415),1678=>array(61,-19,388,708),1679=>array(61,-19,388,684),1680=>array(61,-19,388,708),1681=>array(-42,-244,469,648),1682=>array(-42,-244,473,556),1683=>array(-42,-244,507,269),1684=>array(-42,-244,474,269),1685=>array(-42,-244,634,269),1686=>array(-42,-244,474,269),1687=>array(-42,-244,439,464),1688=>array(-42,-244,439,586),1689=>array(-42,-244,439,586),1690=>array(63,-244,1138,464),1691=>array(63,-244,1138,366),1692=>array(63,-244,1138,586),1693=>array(63,-244,1134,362),1694=>array(63,-244,1134,586),1695=>array(70,0,857,760),1696=>array(57,-244,587,781),1697=>array(63,-45,952,481),1698=>array(63,-171,952,481),1699=>array(63,-171,952,635),1700=>array(63,-45,952,757),1701=>array(63,-293,952,481),1702=>array(63,-45,952,757),1703=>array(52,-215,701,635),1704=>array(52,-215,701,757),1705=>array(63,-43,895,760),1706=>array(63,-43,1000,760),1707=>array(63,-43,895,760),1708=>array(70,-27,722,760),1709=>array(70,-27,722,854),1710=>array(70,-293,722,760),1711=>array(63,-43,895,896),1712=>array(63,-43,895,896),1713=>array(63,-43,895,903),1714=>array(63,-171,895,896),1715=>array(63,-293,895,896),1716=>array(63,-43,895,1025),1717=>array(70,-152,723,971),1718=>array(70,-152,637,952),1719=>array(70,-152,684,1025),1720=>array(70,-391,637,760),1721=>array(72,-317,660,464),1722=>array(72,-162,660,366),1723=>array(72,-162,660,636),1724=>array(72,-330,660,464),1725=>array(72,-162,660,586),1726=>array(70,-33,638,487),1727=>array(77,-244,645,586),1734=>array(-42,-244,406,556),1740=>array(63,-131,719,411),1742=>array(63,-131,719,556),1749=>array(68,-28,453,358),1776=>array(215,220,322,342),1777=>array(136,0,342,635),1778=>array(40,0,492,635),1779=>array(37,0,509,635),1780=>array(40,0,471,643),1781=>array(52,-5,485,643),1782=>array(102,0,445,640),1783=>array(29,0,508,635),1784=>array(29,0,508,635),1785=>array(49,0,493,640),1984=>array(66,-14,570,742),1985=>array(110,0,544,729),1986=>array(110,0,530,729),1987=>array(110,0,530,729),1988=>array(110,0,530,729),1989=>array(110,0,530,729),1990=>array(110,0,530,729),1991=>array(104,0,532,729),1992=>array(104,0,532,729),1993=>array(77,0,560,741),1994=>array(94,0,184,729),1995=>array(55,-14,516,447),1996=>array(30,0,394,731),1997=>array(30,0,562,430),1998=>array(91,0,563,430),1999=>array(91,0,563,430),2000=>array(55,0,539,735),2001=>array(91,0,563,581),2002=>array(55,0,738,741),2003=>array(94,0,408,729),2004=>array(30,0,344,729),2005=>array(91,0,504,729),2006=>array(94,0,518,729),2007=>array(30,0,256,729),2008=>array(94,0,865,513),2009=>array(30,0,443,729),2010=>array(30,0,754,729),2011=>array(91,0,563,430),2012=>array(30,0,595,729),2013=>array(94,0,679,729),2014=>array(94,0,436,729),2015=>array(55,0,630,729),2016=>array(30,0,443,729),2017=>array(30,0,595,729),2018=>array(55,0,539,729),2019=>array(94,0,436,729),2020=>array(94,0,436,612),2021=>array(94,0,428,729),2022=>array(55,0,539,729),2023=>array(55,0,539,729),2027=>array(106,673,398,745),2028=>array(32,609,468,800),2029=>array(205,658,305,758),2030=>array(93,616,405,800),2031=>array(44,616,456,800),2032=>array(32,609,468,800),2033=>array(44,616,456,800),2034=>array(200,-184,300,-84),2035=>array(104,659,394,758),2036=>array(98,557,216,760),2037=>array(98,557,216,760),2040=>array(49,0,511,498),2041=>array(49,0,511,483),2042=>array(-10,0,371,72),3647=>array(86,-138,571,769),3713=>array(63,-10,607,560),3714=>array(68,-17,691,568),3716=>array(67,-10,619,568),3719=>array(53,-238,415,568),3720=>array(62,-0,574,575),3722=>array(68,-234,690,568),3725=>array(56,-8,619,573),3732=>array(91,-14,592,560),3733=>array(63,-15,564,579),3734=>array(0,-240,587,560),3735=>array(42,-8,599,571),3737=>array(46,-14,593,568),3738=>array(36,-8,556,561),3739=>array(36,-8,556,760),3740=>array(43,-8,725,614),3741=>array(91,-14,676,760),3742=>array(51,-8,636,561),3743=>array(51,-8,636,760),3745=>array(31,-14,636,547),3746=>array(56,-8,619,760),3747=>array(68,-8,634,568),3749=>array(39,-8,583,568),3751=>array(56,-13,558,560),3754=>array(39,-8,688,679),3755=>array(62,-12,762,575),3757=>array(56,-14,558,560),3758=>array(68,-8,684,605),3759=>array(99,-166,742,579),3760=>array(54,-13,589,563),3761=>array(-578,639,-43,880),3762=>array(60,0,473,560),3763=>array(-425,0,473,806),3764=>array(-594,615,-73,926),3765=>array(-594,615,0,926),3766=>array(-594,615,-73,926),3767=>array(-594,615,0,926),3768=>array(-376,-350,-161,-38),3769=>array(-418,-306,-152,-40),3771=>array(-578,639,-43,880),3772=>array(-611,-278,6,-39),3773=>array(63,-240,619,715),3776=>array(60,-14,324,560),3777=>array(60,-14,598,560),3778=>array(-22,-5,398,896),3779=>array(45,-14,490,892),3780=>array(92,-11,445,886),3782=>array(72,-232,574,557),3784=>array(-366,618,-278,792),3785=>array(-563,609,-45,891),3786=>array(-595,598,22,869),3787=>array(-462,609,-182,890),3788=>array(-611,636,6,875),3789=>array(-425,620,-220,806),3792=>array(66,-14,570,547),3793=>array(48,-75,582,576),3794=>array(48,-66,545,711),3795=>array(11,-9,692,830),3796=>array(48,-83,601,711),3797=>array(48,-83,601,711),3798=>array(43,-8,744,812),3799=>array(63,-240,607,560),3800=>array(73,-210,680,557),3801=>array(51,-4,621,571),3804=>array(62,-12,947,575),3805=>array(62,-12,973,575),4256=>array(59,-15,815,828),4257=>array(54,-0,704,828),4258=>array(54,-148,649,837),4259=>array(54,-15,781,828),4260=>array(49,0,552,837),4261=>array(39,0,714,837),4262=>array(29,-15,695,828),4263=>array(59,-15,885,837),4264=>array(29,0,390,874),4265=>array(59,0,561,828),4266=>array(29,-15,784,828),4267=>array(59,-15,824,828),4268=>array(63,0,566,828),4269=>array(49,-167,806,837),4270=>array(24,-15,717,837),4271=>array(39,0,566,828),4272=>array(54,-15,853,828),4273=>array(63,-15,567,828),4274=>array(63,-0,566,837),4275=>array(49,-182,806,837),4276=>array(49,0,817,834),4277=>array(44,0,680,828),4278=>array(64,-15,566,837),4279=>array(54,0,557,828),4280=>array(59,-15,562,828),4281=>array(63,0,566,828),4282=>array(59,-15,764,837),4283=>array(59,-15,810,828),4284=>array(63,-0,566,828),4285=>array(49,-15,574,837),4286=>array(63,-0,566,828),4287=>array(29,0,695,828),4288=>array(29,-15,785,828),4289=>array(63,0,566,828),4290=>array(54,-15,635,837),4291=>array(29,0,532,828),4292=>array(54,0,540,828),4293=>array(39,-15,699,837),4304=>array(49,-15,459,592),4305=>array(49,-14,469,837),4306=>array(44,-235,537,551),4307=>array(49,-230,759,547),4308=>array(49,-236,449,547),4309=>array(49,-236,459,547),4310=>array(20,-14,452,838),4311=>array(49,-14,752,547),4312=>array(49,0,469,547),4313=>array(44,-236,456,542),4314=>array(49,-230,1016,552),4315=>array(49,-15,459,837),4316=>array(63,-15,474,833),4317=>array(49,-0,737,547),4318=>array(49,-15,459,833),4319=>array(49,-236,458,551),4320=>array(49,0,747,833),4321=>array(63,-15,474,827),4322=>array(44,-236,610,680),4323=>array(5,-236,464,571),4324=>array(49,-236,766,547),4325=>array(49,-236,449,828),4326=>array(49,-230,737,546),4327=>array(49,-236,459,538),4328=>array(29,-15,454,837),4329=>array(63,0,474,837),4330=>array(44,-236,527,532),4331=>array(49,-14,458,828),4332=>array(64,-15,488,837),4333=>array(49,-236,471,827),4334=>array(63,-15,474,827),4335=>array(10,-235,444,572),4336=>array(49,-15,459,837),4337=>array(59,-15,469,837),4338=>array(49,-141,458,547),4339=>array(49,-236,459,546),4340=>array(49,-236,458,837),4341=>array(49,-15,515,837),4342=>array(49,-236,778,547),4343=>array(44,-236,508,547),4344=>array(49,-236,459,538),4345=>array(39,-236,532,551),4346=>array(49,-77,459,547),4347=>array(54,-10,394,484),4348=>array(49,420,270,837),5121=>array(8,1,676,730),5122=>array(8,0,676,1037),5123=>array(8,0,676,729),5124=>array(8,0,676,914),5125=>array(98,0,711,729),5126=>array(98,0,711,914),5127=>array(98,0,711,913),5129=>array(98,0,711,729),5130=>array(58,0,671,729),5131=>array(58,0,671,914),5132=>array(98,1,827,730),5133=>array(8,1,776,730),5134=>array(98,0,827,729),5135=>array(8,0,776,729),5136=>array(98,0,827,914),5137=>array(8,0,776,914),5138=>array(98,0,909,729),5139=>array(98,0,909,729),5140=>array(98,0,909,914),5141=>array(98,0,909,914),5142=>array(98,0,711,914),5143=>array(98,0,869,729),5144=>array(58,0,909,729),5145=>array(98,0,869,914),5146=>array(58,0,909,914),5147=>array(58,0,671,914),5149=>array(98,629,198,729),5150=>array(67,326,488,734),5151=>array(46,356,362,714),5152=>array(46,356,362,714),5153=>array(67,398,334,674),5154=>array(67,391,334,667),5155=>array(67,398,338,667),5156=>array(67,398,334,667),5157=>array(35,327,405,733),5158=>array(67,326,331,734),5159=>array(98,312,198,412),5160=>array(67,503,334,563),5161=>array(67,399,334,667),5162=>array(67,399,334,691),5163=>array(8,1,1028,730),5164=>array(8,0,847,729),5165=>array(98,0,892,729),5166=>array(58,0,1055,729),5167=>array(8,0,676,729),5168=>array(8,0,676,1037),5169=>array(8,0,676,729),5170=>array(8,0,676,914),5171=>array(58,0,671,729),5172=>array(58,0,671,914),5173=>array(58,0,671,913),5175=>array(58,0,671,729),5176=>array(58,0,671,729),5177=>array(58,0,671,914),5178=>array(98,0,827,729),5179=>array(8,0,776,729),5180=>array(98,0,827,729),5181=>array(8,0,776,729),5182=>array(98,0,827,914),5183=>array(8,0,776,914),5184=>array(98,0,869,729),5185=>array(58,0,909,729),5186=>array(98,0,869,914),5187=>array(58,0,909,914),5188=>array(98,0,869,729),5189=>array(58,0,909,729),5190=>array(98,0,869,914),5191=>array(58,0,909,914),5192=>array(58,0,671,913),5193=>array(67,326,453,734),5194=>array(67,326,137,734),5196=>array(87,-14,645,729),5197=>array(87,0,645,1037),5198=>array(87,0,645,743),5199=>array(87,0,645,914),5200=>array(58,0,671,729),5201=>array(58,0,671,914),5202=>array(58,0,671,913),5204=>array(58,0,671,729),5205=>array(59,0,672,729),5206=>array(59,0,672,914),5207=>array(98,-14,834,729),5208=>array(87,-14,831,729),5209=>array(98,0,834,743),5210=>array(87,0,831,743),5211=>array(98,0,834,914),5212=>array(87,0,831,914),5213=>array(98,0,869,729),5214=>array(58,0,842,729),5215=>array(98,0,869,914),5216=>array(58,0,842,914),5217=>array(98,0,889,729),5218=>array(59,0,842,729),5219=>array(98,0,889,914),5220=>array(59,0,842,914),5221=>array(117,0,889,729),5222=>array(67,326,379,734),5223=>array(87,-14,823,734),5224=>array(87,0,823,743),5225=>array(58,0,811,734),5226=>array(59,0,835,734),5227=>array(34,0,530,743),5228=>array(98,0,594,1037),5229=>array(98,0,594,743),5230=>array(98,0,594,914),5231=>array(34,-14,530,729),5232=>array(34,-14,530,914),5233=>array(34,-14,623,913),5234=>array(98,-14,594,729),5235=>array(98,-14,594,914),5236=>array(98,0,762,743),5237=>array(34,0,712,743),5238=>array(98,0,781,743),5239=>array(98,0,758,743),5240=>array(98,0,781,914),5241=>array(98,0,758,914),5242=>array(98,-14,762,729),5243=>array(34,-14,712,729),5244=>array(98,-14,762,914),5245=>array(34,-14,712,914),5246=>array(98,-14,781,729),5247=>array(98,-14,758,729),5248=>array(98,-14,781,914),5249=>array(98,-14,758,914),5250=>array(117,-14,781,729),5251=>array(67,318,379,734),5252=>array(27,318,340,734),5253=>array(34,0,696,743),5254=>array(98,0,720,743),5255=>array(34,-14,696,734),5256=>array(98,-14,720,734),5257=>array(34,0,530,743),5258=>array(98,0,594,1037),5259=>array(98,0,594,743),5260=>array(98,0,594,914),5261=>array(34,-14,530,729),5262=>array(34,-14,530,914),5263=>array(34,-14,623,913),5264=>array(98,-14,594,729),5265=>array(98,-14,594,914),5266=>array(98,0,762,743),5267=>array(34,0,712,743),5268=>array(98,0,781,743),5269=>array(98,0,758,743),5270=>array(98,0,781,914),5271=>array(98,0,758,914),5272=>array(98,-14,762,729),5273=>array(34,-14,712,729),5274=>array(98,-14,762,914),5275=>array(34,-14,712,914),5276=>array(98,-14,781,729),5277=>array(98,-14,758,729),5278=>array(98,-14,781,914),5279=>array(98,-14,758,914),5280=>array(117,-14,781,729),5281=>array(67,318,379,734),5282=>array(67,318,379,734),5283=>array(58,0,512,729),5284=>array(98,0,552,1037),5285=>array(98,0,552,729),5286=>array(98,0,552,914),5287=>array(58,0,512,729),5288=>array(58,0,512,914),5289=>array(58,0,607,913),5290=>array(98,0,552,729),5291=>array(98,0,552,914),5292=>array(98,0,651,729),5293=>array(58,0,710,729),5294=>array(98,0,741,729),5295=>array(98,0,706,729),5296=>array(98,0,741,914),5297=>array(98,0,706,914),5298=>array(98,0,651,729),5299=>array(58,0,710,729),5300=>array(98,0,651,914),5301=>array(58,0,710,914),5302=>array(98,0,741,729),5303=>array(98,0,706,729),5304=>array(98,0,741,914),5305=>array(98,0,706,914),5306=>array(117,0,741,729),5307=>array(67,326,331,734),5308=>array(67,326,453,734),5309=>array(67,326,331,734),5312=>array(58,-14,817,436),5313=>array(34,-14,793,755),5314=>array(34,-14,793,436),5315=>array(5,-14,765,636),5316=>array(58,0,817,450),5317=>array(58,0,817,636),5318=>array(58,0,817,635),5319=>array(34,0,793,450),5320=>array(34,0,793,636),5321=>array(98,-14,1035,436),5322=>array(58,-14,977,436),5323=>array(98,0,1025,450),5324=>array(34,0,793,450),5325=>array(98,0,1025,636),5326=>array(34,0,793,636),5327=>array(34,0,793,635),5328=>array(67,484,545,736),5329=>array(67,318,397,734),5330=>array(67,484,545,736),5331=>array(58,0,817,450),5332=>array(34,0,793,755),5333=>array(34,0,793,450),5334=>array(34,0,793,636),5335=>array(58,0,817,450),5336=>array(58,0,817,636),5337=>array(58,0,817,635),5338=>array(34,0,793,450),5339=>array(34,0,793,636),5340=>array(98,0,1035,450),5341=>array(58,0,977,450),5342=>array(98,0,1025,450),5343=>array(34,0,972,450),5344=>array(98,0,1025,636),5345=>array(34,0,972,636),5346=>array(98,0,1035,450),5347=>array(58,0,977,450),5348=>array(98,0,1035,636),5349=>array(58,0,977,636),5350=>array(98,0,1025,450),5351=>array(34,0,972,450),5352=>array(98,0,1025,636),5353=>array(34,0,972,636),5354=>array(67,484,545,736),5356=>array(58,0,671,729),5357=>array(34,0,505,729),5358=>array(98,0,649,1037),5359=>array(98,0,569,729),5360=>array(98,0,569,914),5361=>array(34,0,505,729),5362=>array(34,0,505,914),5363=>array(34,0,600,913),5364=>array(98,0,569,729),5365=>array(98,0,569,914),5366=>array(98,0,736,729),5367=>array(34,0,696,729),5368=>array(98,0,758,729),5369=>array(98,0,713,729),5370=>array(98,0,758,914),5371=>array(98,0,713,914),5372=>array(98,0,736,729),5373=>array(34,0,696,729),5374=>array(98,0,736,914),5375=>array(34,0,696,914),5376=>array(98,0,758,729),5377=>array(98,0,713,729),5378=>array(98,0,758,914),5379=>array(98,0,713,914),5380=>array(117,0,758,729),5381=>array(67,326,363,734),5382=>array(67,318,365,741),5383=>array(67,326,363,734),5392=>array(34,-14,678,743),5393=>array(34,-14,678,743),5394=>array(34,-14,678,914),5395=>array(34,-14,857,464),5396=>array(34,-14,857,636),5397=>array(34,-14,857,464),5398=>array(34,-14,857,636),5399=>array(98,-14,875,743),5400=>array(34,-14,814,743),5401=>array(98,-14,875,743),5402=>array(34,-14,814,743),5403=>array(98,-14,875,914),5404=>array(34,-14,814,914),5405=>array(98,-14,1106,464),5406=>array(34,-14,1042,464),5407=>array(98,-14,1106,636),5408=>array(34,-14,1042,636),5409=>array(98,-14,1106,464),5410=>array(34,-14,1042,464),5411=>array(98,-14,1106,636),5412=>array(34,-14,1042,636),5413=>array(67,476,585,737),5414=>array(58,0,529,729),5415=>array(98,0,569,1037),5416=>array(98,0,569,729),5417=>array(98,0,569,914),5418=>array(58,0,529,729),5419=>array(58,0,531,914),5420=>array(58,0,626,913),5421=>array(98,0,569,729),5422=>array(98,0,569,914),5423=>array(98,0,746,729),5424=>array(58,0,723,729),5425=>array(98,0,758,729),5426=>array(98,0,760,729),5427=>array(98,0,758,914),5428=>array(98,0,760,914),5429=>array(98,0,746,729),5430=>array(58,0,723,729),5431=>array(98,0,749,914),5432=>array(58,0,723,914),5433=>array(98,0,758,729),5434=>array(98,0,760,729),5435=>array(98,0,758,914),5436=>array(98,0,760,914),5437=>array(117,0,758,729),5438=>array(67,326,363,734),5440=>array(67,399,334,667),5441=>array(67,326,429,734),5442=>array(98,-14,857,436),5443=>array(58,-14,817,436),5444=>array(58,0,817,450),5445=>array(98,0,857,755),5446=>array(98,0,857,450),5447=>array(98,0,857,636),5448=>array(98,0,569,729),5449=>array(98,0,569,914),5450=>array(98,0,569,729),5451=>array(34,0,505,729),5452=>array(34,0,505,914),5453=>array(34,0,505,729),5454=>array(98,0,736,914),5455=>array(34,0,696,914),5456=>array(67,326,363,734),5458=>array(58,0,671,729),5459=>array(73,0,676,744),5460=>array(73,-15,676,1037),5461=>array(73,-15,676,729),5462=>array(73,-15,676,914),5463=>array(38,0,668,662),5464=>array(38,0,668,914),5465=>array(58,0,688,662),5466=>array(58,0,688,914),5467=>array(98,0,886,914),5468=>array(58,0,909,914),5469=>array(67,326,462,695),5470=>array(87,-14,645,743),5471=>array(87,-14,645,743),5472=>array(87,-14,645,743),5473=>array(87,-14,645,743),5474=>array(87,-14,645,914),5475=>array(87,-14,645,914),5476=>array(41,0,671,729),5477=>array(41,0,671,914),5478=>array(59,0,689,729),5479=>array(59,0,689,914),5480=>array(98,0,907,914),5481=>array(59,0,842,914),5482=>array(67,326,467,734),5492=>array(34,0,772,743),5493=>array(58,0,796,743),5494=>array(58,0,796,914),5495=>array(34,-14,772,729),5496=>array(34,-14,772,914),5497=>array(58,-14,796,729),5498=>array(58,-14,796,914),5499=>array(67,318,508,734),5500=>array(98,0,654,729),5501=>array(67,326,429,734),5502=>array(67,0,1013,1037),5503=>array(67,0,1013,743),5504=>array(67,0,1013,914),5505=>array(67,-14,949,734),5506=>array(67,-14,949,914),5507=>array(67,-14,1013,734),5508=>array(67,-14,1013,914),5509=>array(67,318,798,734),5514=>array(34,0,772,743),5515=>array(58,0,796,743),5516=>array(34,-14,772,729),5517=>array(58,-14,796,729),5518=>array(67,0,1225,1037),5519=>array(67,0,1225,743),5520=>array(67,0,1225,914),5521=>array(67,-14,904,736),5522=>array(67,-14,904,914),5523=>array(67,-14,1225,736),5524=>array(67,-14,1225,914),5525=>array(67,332,645,736),5526=>array(67,332,1018,736),5536=>array(34,0,793,692),5537=>array(34,0,793,692),5538=>array(58,-242,817,450),5539=>array(58,-242,817,636),5540=>array(34,-242,793,450),5541=>array(34,-242,793,636),5542=>array(67,338,545,736),5543=>array(58,0,627,729),5544=>array(16,0,585,729),5545=>array(16,0,585,914),5546=>array(58,0,627,729),5547=>array(58,0,627,914),5548=>array(16,0,585,729),5549=>array(16,0,585,914),5550=>array(5,326,363,734),5551=>array(98,-14,594,729),5598=>array(98,0,711,729),5601=>array(56,0,669,729),5702=>array(67,326,413,734),5703=>array(67,240,413,820),5742=>array(57,0,391,306),5743=>array(67,0,949,743),5744=>array(67,0,1211,743),5745=>array(67,0,1598,743),5746=>array(67,0,1598,914),5747=>array(67,-14,1277,736),5748=>array(67,-14,1277,914),5749=>array(67,-14,1598,736),5750=>array(67,-14,1598,914),5760=>array(-10,246,487,328),5761=>array(-10,-125,502,328),5762=>array(-10,-125,722,328),5763=>array(-10,-125,941,328),5764=>array(-10,-125,1160,328),5765=>array(-10,-125,1379,328),5766=>array(-10,246,502,697),5767=>array(-10,246,722,697),5768=>array(-10,246,941,697),5769=>array(-10,246,1160,697),5770=>array(-10,246,1379,697),5771=>array(-10,-125,508,697),5772=>array(-10,-125,728,697),5773=>array(-10,-125,948,697),5774=>array(-10,-125,1168,697),5775=>array(-10,-125,1389,697),5776=>array(-10,41,502,533),5777=>array(-10,41,722,533),5778=>array(-10,41,939,533),5779=>array(-10,41,1159,533),5780=>array(-10,41,1379,533),5781=>array(-10,-125,508,697),5782=>array(-10,-125,762,697),5783=>array(-10,-83,798,328),5784=>array(-10,-240,1214,328),5785=>array(-10,246,1160,902),5786=>array(-10,82,693,328),5787=>array(55,28,517,544),5788=>array(-10,28,452,544),7424=>array(30,0,562,547),7425=>array(5,0,669,547),7426=>array(60,-14,929,560),7427=>array(30,0,530,547),7428=>array(55,-14,488,560),7429=>array(91,0,550,547),7430=>array(18,0,550,547),7431=>array(91,0,443,547),7432=>array(63,-14,471,561),7433=>array(94,-213,184,547),7434=>array(0,-14,310,547),7435=>array(91,0,576,547),7436=>array(1,0,498,560),7437=>array(91,0,664,547),7438=>array(91,0,559,547),7439=>array(55,-14,557,560),7440=>array(62,-14,495,560),7441=>array(55,22,629,524),7442=>array(55,57,629,489),7443=>array(25,2,663,543),7444=>array(55,-14,970,560),7446=>array(55,273,557,560),7447=>array(55,-14,557,273),7448=>array(74,0,475,547),7449=>array(24,0,507,547),7450=>array(24,0,507,547),7451=>array(29,0,553,547),7452=>array(91,-16,510,547),7453=>array(85,37,646,495),7454=>array(85,38,857,496),7455=>array(23,-238,583,560),7456=>array(30,0,562,547),7457=>array(42,0,776,547),7458=>array(43,0,482,547),7459=>array(59,-14,466,547),7462=>array(87,0,498,560),7463=>array(30,0,562,547),7464=>array(74,0,490,547),7465=>array(74,0,475,547),7466=>array(44,0,546,547),7467=>array(37,0,556,547),7468=>array(5,326,426,734),7469=>array(2,326,573,734),7470=>array(62,326,388,734),7472=>array(62,326,448,734),7473=>array(62,326,358,734),7474=>array(41,326,336,734),7475=>array(35,318,437,742),7476=>array(62,326,412,734),7477=>array(62,326,124,734),7478=>array(-33,214,124,734),7479=>array(62,326,426,734),7480=>array(62,326,348,734),7481=>array(62,326,482,734),7482=>array(62,326,410,734),7483=>array(62,326,410,734),7484=>array(35,318,460,742),7485=>array(35,318,405,742),7486=>array(62,326,358,734),7487=>array(62,326,419,734),7488=>array(-2,326,387,734),7489=>array(55,318,406,734),7490=>array(21,326,603,734),7491=>array(38,318,329,640),7492=>array(38,318,329,640),7493=>array(35,318,343,640),7494=>array(38,318,585,640),7495=>array(57,318,365,751),7496=>array(35,318,343,751),7497=>array(35,318,354,640),7498=>array(35,318,354,640),7499=>array(41,318,298,640),7500=>array(40,318,297,640),7501=>array(35,209,343,640),7502=>array(60,207,116,632),7503=>array(57,326,363,751),7504=>array(57,326,560,640),7505=>array(57,209,346,640),7506=>array(35,318,351,640),7507=>array(35,318,307,640),7508=>array(35,479,351,640),7509=>array(35,318,351,479),7510=>array(57,209,365,640),7511=>array(17,326,232,719),7512=>array(54,318,342,632),7513=>array(54,347,407,604),7514=>array(57,319,560,633),7515=>array(19,326,354,632),7517=>array(59,209,357,755),7518=>array(10,209,354,632),7519=>array(35,318,351,742),7520=>array(35,209,379,635),7521=>array(18,209,346,633),7522=>array(60,0,116,425),7523=>array(57,0,259,313),7524=>array(54,-8,342,306),7525=>array(19,0,354,306),7526=>array(59,-117,357,429),7527=>array(10,-117,354,306),7528=>array(59,-117,367,313),7529=>array(35,-117,379,309),7530=>array(18,-117,346,307),7543=>array(91,-208,580,560),7544=>array(62,326,412,734),7547=>array(57,0,314,547),7549=>array(24,-208,643,560),7557=>array(71,-208,273,760),7579=>array(35,318,343,640),7580=>array(35,318,307,640),7581=>array(35,287,307,640),7582=>array(35,318,351,751),7583=>array(41,318,298,640),7584=>array(15,326,234,751),7585=>array(-11,209,170,632),7586=>array(35,209,343,632),7587=>array(54,209,342,632),7588=>array(36,326,198,751),7589=>array(60,326,187,632),7590=>array(36,326,198,632),7591=>array(36,326,198,632),7592=>array(-83,209,172,751),7593=>array(60,209,187,751),7594=>array(44,209,172,751),7595=>array(55,326,314,640),7596=>array(57,209,560,640),7597=>array(57,209,560,633),7598=>array(-11,209,348,640),7599=>array(57,209,417,640),7600=>array(55,326,346,640),7601=>array(35,318,351,640),7602=>array(35,210,351,751),7603=>array(34,209,297,640),7604=>array(-11,209,224,751),7605=>array(17,209,232,719),7606=>array(46,318,445,632),7607=>array(35,318,355,632),7608=>array(57,317,321,632),7609=>array(60,326,343,632),7610=>array(19,326,354,632),7611=>array(27,326,304,632),7612=>array(27,209,374,632),7613=>array(27,296,304,632),7614=>array(27,207,330,632),7615=>array(35,320,351,756),7620=>array(-456,616,-44,800),7621=>array(-456,616,-44,800),7622=>array(-456,616,-44,800),7623=>array(-456,616,-44,800),7624=>array(-468,616,-32,800),7625=>array(-468,616,-32,800),7680=>array(8,-241,676,729),7681=>array(60,-241,522,560),7682=>array(98,0,615,914),7683=>array(90,-14,580,915),7684=>array(98,-183,615,729),7685=>array(91,-183,580,760),7686=>array(98,-156,615,729),7687=>array(91,-156,580,760),7688=>array(56,-193,644,928),7689=>array(55,-193,488,800),7690=>array(98,0,711,914),7691=>array(55,-14,544,942),7692=>array(98,-183,711,729),7693=>array(55,-183,544,760),7694=>array(98,-156,711,729),7695=>array(55,-156,544,760),7696=>array(98,-192,711,729),7697=>array(55,-193,544,760),7698=>array(98,-240,711,729),7699=>array(55,-240,544,760),7700=>array(98,0,568,1044),7701=>array(55,-14,562,921),7702=>array(98,0,568,1044),7703=>array(55,-14,562,921),7704=>array(98,-213,568,729),7705=>array(55,-213,562,560),7706=>array(98,-192,568,729),7707=>array(55,-192,562,560),7708=>array(98,-193,568,928),7709=>array(55,-193,562,785),7710=>array(98,0,517,914),7711=>array(23,0,371,942),7712=>array(56,-14,693,887),7713=>array(55,-208,544,745),7714=>array(98,0,654,913),7715=>array(90,0,549,915),7716=>array(98,-183,654,729),7717=>array(91,-183,549,760),7718=>array(98,0,654,914),7719=>array(-9,0,549,913),7720=>array(8,-193,654,729),7721=>array(1,-193,549,760),7722=>array(98,-222,654,729),7723=>array(91,-222,549,760),7724=>array(0,-192,322,729),7725=>array(-22,-192,300,760),7726=>array(3,0,293,1044),7727=>array(-6,0,284,886),7728=>array(98,0,677,928),7729=>array(91,0,576,928),7730=>array(98,-183,677,729),7731=>array(91,-183,576,760),7732=>array(98,-156,677,729),7733=>array(91,-156,576,760),7734=>array(98,-183,552,729),7735=>array(98,-183,189,760),7736=>array(1,-183,552,927),7737=>array(-1,-183,291,899),7738=>array(98,-156,552,729),7739=>array(-6,-156,286,760),7740=>array(98,-240,552,729),7741=>array(-17,-240,295,760),7742=>array(98,0,765,928),7743=>array(91,0,889,800),7744=>array(98,0,765,914),7745=>array(91,0,889,760),7746=>array(98,-183,765,729),7747=>array(91,-183,889,560),7748=>array(98,0,650,914),7749=>array(91,0,549,760),7750=>array(98,-183,650,729),7751=>array(91,-183,549,560),7752=>array(98,-156,650,729),7753=>array(91,-156,549,560),7754=>array(98,-240,650,729),7755=>array(91,-240,549,560),7756=>array(56,-14,731,1044),7757=>array(55,-14,557,881),7758=>array(56,-14,731,1042),7759=>array(55,-14,557,882),7760=>array(56,-14,731,1044),7761=>array(55,-14,557,921),7762=>array(56,-14,731,1044),7763=>array(55,-14,557,921),7764=>array(98,0,569,928),7765=>array(91,-208,580,800),7766=>array(98,0,569,914),7767=>array(91,-208,580,760),7768=>array(98,0,666,913),7769=>array(91,0,411,760),7770=>array(98,-183,666,729),7771=>array(91,-183,411,560),7772=>array(98,-183,666,899),7773=>array(91,-183,411,745),7774=>array(98,-156,666,729),7775=>array(41,-156,411,560),7776=>array(66,-14,579,914),7777=>array(54,-14,472,760),7778=>array(66,-183,579,742),7779=>array(54,-183,472,560),7780=>array(66,-14,579,928),7781=>array(54,-14,485,800),7782=>array(66,-14,579,1042),7783=>array(54,-14,472,973),7784=>array(66,-183,579,914),7785=>array(54,-183,472,733),7786=>array(-3,0,614,914),7787=>array(27,0,368,942),7788=>array(-3,-183,614,729),7789=>array(27,-183,368,702),7790=>array(-3,-156,614,729),7791=>array(27,-156,390,702),7792=>array(-3,-240,614,729),7793=>array(27,-240,394,702),7794=>array(87,-183,645,729),7795=>array(85,-183,543,560),7796=>array(87,-192,645,729),7797=>array(85,-192,543,560),7798=>array(87,-213,645,729),7799=>array(85,-213,543,560),7800=>array(87,-14,645,1044),7801=>array(85,-14,543,990),7802=>array(87,-14,645,1025),7803=>array(85,-14,543,869),7804=>array(8,0,676,936),7805=>array(30,0,562,777),7806=>array(8,-183,676,729),7807=>array(30,-183,562,547),7808=>array(33,0,956,931),7809=>array(42,0,776,802),7810=>array(33,0,956,931),7811=>array(42,0,776,803),7812=>array(33,0,956,913),7813=>array(42,0,776,758),7814=>array(33,0,956,913),7815=>array(42,0,776,760),7816=>array(33,-183,956,729),7817=>array(42,-183,776,547),7818=>array(30,0,654,914),7819=>array(29,0,559,760),7820=>array(30,0,654,913),7821=>array(29,0,559,758),7822=>array(-2,0,613,914),7823=>array(30,-208,562,760),7824=>array(45,0,640,928),7825=>array(43,0,482,800),7826=>array(45,-183,640,729),7827=>array(43,-183,482,547),7828=>array(45,-156,640,729),7829=>array(43,-156,482,547),7830=>array(91,-156,549,760),7831=>array(2,0,368,913),7832=>array(42,0,776,878),7833=>array(30,-208,562,878),7834=>array(60,-14,672,760),7835=>array(23,0,371,942),7836=>array(1,0,371,760),7837=>array(23,0,371,760),7838=>array(87,-14,713,743),7839=>array(55,-14,557,742),7840=>array(8,-183,676,729),7841=>array(60,-183,522,560),7842=>array(8,0,676,992),7843=>array(60,-14,522,810),7844=>array(8,0,676,1028),7845=>array(60,-14,585,846),7846=>array(8,0,676,1028),7847=>array(60,-14,522,847),7848=>array(8,0,676,1044),7849=>array(60,-14,577,862),7850=>array(8,0,676,1057),7851=>array(60,-14,522,875),7852=>array(8,-183,676,928),7853=>array(60,-183,522,800),7854=>array(8,0,676,1044),7855=>array(60,-14,522,877),7856=>array(8,0,676,1044),7857=>array(60,-14,522,877),7858=>array(8,0,676,1068),7859=>array(60,-14,522,901),7860=>array(8,0,676,1043),7861=>array(60,-14,522,876),7862=>array(8,-183,676,946),7863=>array(60,-183,522,765),7864=>array(98,-183,568,729),7865=>array(55,-183,562,560),7866=>array(98,0,568,992),7867=>array(55,-14,562,810),7868=>array(98,0,568,921),7869=>array(55,-14,562,777),7870=>array(98,0,637,1028),7871=>array(55,-14,613,846),7872=>array(98,0,568,1028),7873=>array(55,-14,562,847),7874=>array(98,0,620,1044),7875=>array(55,-14,605,862),7876=>array(98,0,568,1057),7877=>array(55,-14,562,875),7878=>array(98,-183,568,928),7879=>array(55,-183,562,800),7880=>array(44,0,263,992),7881=>array(33,0,252,811),7882=>array(98,-183,197,729),7883=>array(93,-183,184,760),7884=>array(56,-183,731,742),7885=>array(55,-183,557,560),7886=>array(56,-14,731,992),7887=>array(55,-14,557,810),7888=>array(56,-14,731,1028),7889=>array(55,-14,601,846),7890=>array(56,-14,731,1028),7891=>array(55,-14,557,847),7892=>array(56,-14,731,1044),7893=>array(55,-14,592,862),7894=>array(56,-14,731,1057),7895=>array(55,-14,557,875),7896=>array(56,-183,731,928),7897=>array(55,-183,557,800),7898=>array(50,-14,764,927),7899=>array(58,-14,603,800),7900=>array(50,-14,764,927),7901=>array(58,-14,603,800),7902=>array(50,-14,764,992),7903=>array(58,-14,603,810),7904=>array(50,-14,764,921),7905=>array(58,-14,603,777),7906=>array(50,-183,764,760),7907=>array(58,-183,603,615),7908=>array(87,-183,645,729),7909=>array(85,-183,543,560),7910=>array(87,-14,645,992),7911=>array(85,-14,543,810),7912=>array(84,-4,796,927),7913=>array(86,-14,676,800),7914=>array(84,-4,796,927),7915=>array(86,-14,676,800),7916=>array(84,-4,796,992),7917=>array(86,-14,676,810),7918=>array(84,-4,796,921),7919=>array(86,-14,676,777),7920=>array(84,-183,796,760),7921=>array(86,-183,676,615),7922=>array(-2,0,613,931),7923=>array(30,-208,562,802),7924=>array(-2,-183,613,729),7925=>array(30,-208,562,547),7926=>array(-2,0,613,996),7927=>array(30,-208,562,813),7928=>array(-2,0,613,921),7929=>array(30,-208,562,777),7930=>array(98,0,764,729),7931=>array(16,0,462,760),7936=>array(55,-12,611,797),7937=>array(55,-12,611,797),7938=>array(55,-12,611,800),7939=>array(55,-12,611,800),7940=>array(55,-12,611,800),7941=>array(55,-12,611,800),7942=>array(55,-12,611,928),7943=>array(55,-12,611,928),7944=>array(8,0,676,797),7945=>array(8,0,676,797),7946=>array(2,0,869,800),7947=>array(3,0,869,800),7948=>array(3,0,761,800),7949=>array(2,0,793,800),7950=>array(3,0,700,928),7951=>array(2,0,734,928),7952=>array(65,-14,473,797),7953=>array(65,-14,473,797),7954=>array(65,-14,473,800),7955=>array(65,-14,473,800),7956=>array(65,-14,486,800),7957=>array(65,-14,501,800),7960=>array(3,0,647,797),7961=>array(3,0,647,797),7962=>array(2,0,902,800),7963=>array(3,0,911,800),7964=>array(3,0,834,800),7965=>array(2,0,864,800),7968=>array(91,-208,549,797),7969=>array(91,-208,549,797),7970=>array(91,-208,549,800),7971=>array(91,-208,549,800),7972=>array(91,-208,549,800),7973=>array(91,-208,549,800),7974=>array(91,-208,549,928),7975=>array(91,-208,549,928),7976=>array(3,0,739,797),7977=>array(3,0,737,797),7978=>array(2,0,988,800),7979=>array(3,0,991,800),7980=>array(3,0,929,800),7981=>array(2,0,953,800),7982=>array(3,0,835,928),7983=>array(2,0,849,928),7984=>array(76,0,304,797),7985=>array(71,0,304,797),7986=>array(-39,0,340,800),7987=>array(-34,0,347,800),7988=>array(2,0,362,800),7989=>array(-22,0,366,800),7990=>array(-26,0,304,928),7991=>array(-28,0,304,928),7992=>array(3,0,282,797),7993=>array(3,0,276,797),7994=>array(2,0,537,800),7995=>array(3,0,537,800),7996=>array(3,0,472,800),7997=>array(2,0,501,800),7998=>array(3,0,392,928),7999=>array(2,0,395,928),8000=>array(55,-14,557,797),8001=>array(55,-14,557,797),8002=>array(55,-14,557,800),8003=>array(55,-14,557,800),8004=>array(55,-14,557,800),8005=>array(55,-14,557,800),8008=>array(3,-14,748,797),8009=>array(3,-14,792,797),8010=>array(2,-14,1039,800),8011=>array(3,-14,1043,800),8012=>array(3,-14,882,800),8013=>array(2,-14,914,800),8016=>array(73,-14,521,797),8017=>array(73,-14,521,797),8018=>array(73,-14,521,800),8019=>array(73,-14,521,800),8020=>array(73,-14,521,800),8021=>array(73,-14,521,800),8022=>array(73,-14,521,928),8023=>array(73,-14,521,928),8025=>array(3,0,786,797),8027=>array(3,0,1000,800),8029=>array(2,0,1014,800),8031=>array(2,0,900,928),8032=>array(66,-14,769,797),8033=>array(66,-14,769,797),8034=>array(66,-14,769,800),8035=>array(66,-14,769,800),8036=>array(66,-14,769,800),8037=>array(66,-14,769,800),8038=>array(66,-14,769,928),8039=>array(66,-14,769,928),8040=>array(3,0,764,797),8041=>array(3,0,805,797),8042=>array(2,0,1051,800),8043=>array(3,0,1057,800),8044=>array(3,0,908,800),8045=>array(2,0,934,800),8046=>array(3,0,883,928),8047=>array(2,0,914,928),8048=>array(55,-12,611,800),8049=>array(55,-12,611,800),8050=>array(65,-14,473,800),8051=>array(65,-14,473,800),8052=>array(91,-208,549,800),8053=>array(91,-208,549,800),8054=>array(-56,0,304,800),8055=>array(81,0,324,800),8056=>array(55,-14,557,800),8057=>array(55,-14,557,800),8058=>array(73,-14,521,800),8059=>array(73,-14,521,800),8060=>array(66,-14,769,800),8061=>array(66,-14,769,800),8064=>array(55,-208,611,797),8065=>array(55,-208,611,797),8066=>array(55,-208,611,800),8067=>array(55,-208,611,800),8068=>array(55,-208,611,800),8069=>array(55,-208,611,800),8070=>array(55,-208,611,928),8071=>array(55,-208,611,928),8072=>array(8,-208,676,797),8073=>array(8,-208,676,797),8074=>array(2,-208,869,800),8075=>array(3,-208,869,800),8076=>array(3,-208,761,800),8077=>array(2,-208,793,800),8078=>array(3,-208,700,928),8079=>array(2,-208,734,928),8080=>array(91,-208,549,797),8081=>array(91,-208,549,797),8082=>array(91,-208,549,800),8083=>array(91,-208,549,800),8084=>array(91,-208,549,800),8085=>array(91,-208,549,800),8086=>array(91,-208,549,928),8087=>array(91,-208,549,928),8088=>array(3,-208,739,797),8089=>array(3,-208,737,797),8090=>array(2,-208,988,800),8091=>array(3,-208,991,800),8092=>array(3,-208,929,800),8093=>array(2,-208,953,800),8094=>array(3,-208,835,928),8095=>array(2,-208,849,928),8096=>array(66,-208,769,797),8097=>array(66,-208,769,797),8098=>array(66,-208,769,800),8099=>array(66,-208,769,800),8100=>array(66,-208,769,800),8101=>array(66,-208,769,800),8102=>array(66,-208,769,928),8103=>array(66,-208,769,928),8104=>array(3,-208,764,797),8105=>array(3,-208,805,797),8106=>array(2,-208,1051,800),8107=>array(3,-208,1057,800),8108=>array(3,-208,908,800),8109=>array(2,-208,934,800),8110=>array(3,-208,883,928),8111=>array(2,-208,914,928),8112=>array(55,-12,611,785),8113=>array(55,-12,611,745),8114=>array(55,-208,611,800),8115=>array(55,-208,611,559),8116=>array(55,-208,611,800),8118=>array(55,-12,611,777),8119=>array(55,-208,611,777),8120=>array(8,0,676,928),8121=>array(8,0,676,899),8122=>array(-2,0,708,800),8123=>array(8,0,676,800),8124=>array(8,-208,676,729),8125=>array(190,595,309,797),8126=>array(214,-208,321,-45),8127=>array(190,595,309,797),8128=>array(89,639,411,777),8129=>array(89,659,411,928),8130=>array(91,-208,549,800),8131=>array(91,-208,549,560),8132=>array(91,-208,549,800),8134=>array(91,-208,549,777),8135=>array(91,-208,549,777),8136=>array(-2,0,741,800),8137=>array(-12,0,682,800),8138=>array(-2,0,833,800),8139=>array(-6,0,765,800),8140=>array(98,-208,654,729),8141=>array(67,595,446,800),8142=>array(88,595,447,800),8143=>array(89,595,411,928),8144=>array(-10,0,304,785),8145=>array(-14,0,304,745),8146=>array(-20,0,304,978),8147=>array(2,0,313,978),8150=>array(-14,0,309,777),8151=>array(-13,0,310,928),8152=>array(-5,0,300,928),8153=>array(1,0,293,899),8154=>array(-2,0,377,800),8155=>array(-9,0,311,800),8157=>array(62,595,443,800),8158=>array(73,595,461,800),8159=>array(89,595,411,928),8160=>array(73,-14,521,785),8161=>array(73,-14,521,745),8162=>array(73,-14,521,978),8163=>array(73,-14,521,978),8164=>array(91,-208,580,797),8165=>array(91,-208,580,797),8166=>array(73,-14,521,777),8167=>array(73,-14,521,928),8168=>array(-2,0,613,928),8169=>array(-2,0,613,899),8170=>array(-2,0,847,800),8171=>array(-15,0,821,800),8172=>array(3,0,651,797),8173=>array(83,659,395,978),8174=>array(105,659,415,978),8175=>array(83,617,317,800),8178=>array(66,-208,769,800),8179=>array(66,-208,769,547),8180=>array(66,-208,769,800),8182=>array(66,-14,769,777),8183=>array(66,-208,769,777),8184=>array(-2,-14,885,800),8185=>array(-7,-14,750,800),8186=>array(-2,0,884,800),8187=>array(-18,0,752,800),8188=>array(38,-208,726,738),8189=>array(181,616,415,800),8190=>array(190,595,309,797),8208=>array(49,234,312,314),8209=>array(49,234,312,314),8210=>array(49,239,587,309),8211=>array(49,239,451,309),8212=>array(49,239,951,309),8213=>array(0,239,1000,309),8214=>array(127,-236,371,764),8215=>array(-10,-236,510,-9),8216=>array(85,489,228,729),8217=>array(87,499,230,729),8218=>array(85,-116,228,124),8219=>array(87,499,230,729),8220=>array(85,489,428,729),8221=>array(85,489,428,729),8222=>array(85,-116,428,124),8223=>array(85,489,428,729),8224=>array(28,-96,472,729),8225=>array(28,-96,472,729),8226=>array(150,227,440,516),8227=>array(150,188,479,555),8228=>array(115,0,219,124),8229=>array(115,0,552,124),8230=>array(115,0,885,124),8231=>array(107,302,210,426),8240=>array(55,-14,1287,742),8241=>array(55,-14,1681,742),8242=>array(20,547,203,729),8243=>array(20,547,350,729),8244=>array(20,547,496,729),8245=>array(20,547,203,729),8246=>array(20,547,350,729),8247=>array(20,547,496,729),8248=>array(5,-236,333,-30),8249=>array(77,69,306,517),8250=>array(94,69,323,517),8251=>array(95,2,740,725),8252=>array(72,0,414,729),8253=>array(72,0,461,742),8254=>array(-10,686,510,755),8255=>array(-43,-237,847,-60),8256=>array(-43,752,847,929),8257=>array(-42,-236,286,229),8258=>array(30,-29,970,814),8259=>array(108,313,400,421),8260=>array(-183,-14,350,742),8261=>array(86,-132,293,760),8262=>array(86,-132,293,760),8263=>array(36,0,886,742),8264=>array(72,0,661,742),8265=>array(72,0,661,742),8266=>array(49,-123,448,545),8267=>array(115,-96,566,729),8268=>array(105,220,395,509),8269=>array(105,220,395,509),8270=>array(30,-29,470,427),8271=>array(139,-116,282,517),8272=>array(-43,-237,847,929),8273=>array(30,-7,470,929),8274=>array(71,-93,408,729),8275=>array(49,228,951,399),8276=>array(-43,-240,847,-63),8277=>array(152,98,686,631),8278=>array(122,149,464,589),8279=>array(20,547,643,729),8280=>array(175,125,663,613),8281=>array(175,120,663,608),8282=>array(107,0,210,729),8283=>array(49,-138,749,867),8284=>array(55,0,783,729),8285=>array(107,39,210,655),8286=>array(107,8,210,683),8304=>array(42,319,366,742),8305=>array(60,326,116,751),8308=>array(31,326,369,734),8309=>array(50,319,353,734),8310=>array(45,319,369,742),8311=>array(53,326,354,734),8312=>array(43,319,365,742),8313=>array(41,319,364,742),8314=>array(67,326,461,677),8315=>array(67,479,461,525),8316=>array(67,422,461,581),8317=>array(54,252,195,751),8318=>array(50,252,191,751),8319=>array(57,326,346,640),8320=>array(42,-7,366,416),8321=>array(67,0,346,408),8322=>array(46,0,338,416),8323=>array(48,-7,350,416),8324=>array(31,0,369,408),8325=>array(50,-7,353,408),8326=>array(45,-7,369,416),8327=>array(53,0,354,408),8328=>array(43,-7,365,416),8329=>array(41,-7,364,416),8330=>array(67,0,461,351),8331=>array(67,152,461,199),8332=>array(67,96,461,254),8333=>array(54,-74,195,425),8334=>array(50,-74,191,425),8336=>array(38,-8,329,313),8337=>array(35,-8,354,313),8338=>array(35,-8,351,313),8339=>array(57,0,391,306),8340=>array(35,-8,354,313),8341=>array(57,0,346,425),8342=>array(57,0,363,425),8343=>array(60,0,116,425),8344=>array(57,0,560,313),8345=>array(57,0,346,313),8346=>array(57,-117,365,313),8347=>array(57,0,320,322),8348=>array(17,0,232,393),8352=>array(42,0,835,729),8353=>array(56,-44,593,778),8354=>array(47,-14,587,742),8355=>array(65,0,599,729),8356=>array(63,0,548,742),8357=>array(91,-93,889,640),8358=>array(57,0,691,729),8359=>array(98,-14,1226,729),8360=>array(98,-14,1025,729),8361=>array(29,0,960,729),8362=>array(46,-14,743,729),8363=>array(55,-156,619,760),8364=>array(0,-14,570,742),8365=>array(20,0,636,729),8366=>array(10,0,626,729),8367=>array(102,-222,1205,742),8368=>array(22,-14,569,742),8369=>array(33,0,579,729),8370=>array(45,-81,586,809),8371=>array(8,0,627,729),8372=>array(57,-14,717,742),8373=>array(81,-147,556,760),8376=>array(10,0,626,729),8377=>array(52,0,585,729),8378=>array(5,2,649,731),8400=>array(-491,635,-26,760),8401=>array(-470,635,-5,760),8406=>array(-470,560,-26,760),8407=>array(-470,560,-26,760),8411=>array(-491,560,-10,758),8412=>array(-586,560,86,758),8417=>array(-470,560,-26,760),8448=>array(33,-24,980,752),8449=>array(33,-24,999,752),8450=>array(56,-14,644,742),8451=>array(95,-14,1053,742),8452=>array(-21,0,637,729),8453=>array(29,-24,987,752),8454=>array(29,-24,1038,752),8455=>array(80,-14,560,742),8456=>array(54,-146,642,611),8457=>array(95,0,894,742),8459=>array(36,-14,943,748),8460=>array(1,-128,693,731),8461=>array(98,0,751,729),8462=>array(35,0,566,760),8463=>array(44,0,566,760),8464=>array(29,-15,432,742),8465=>array(52,-14,659,742),8466=>array(33,-14,679,743),8467=>array(-14,-14,353,742),8468=>array(16,-14,763,760),8469=>array(97,0,704,729),8470=>array(26,0,969,729),8471=>array(138,0,862,724),8472=>array(54,-221,658,495),8473=>array(98,0,666,729),8474=>array(56,-129,731,742),8475=>array(32,-9,764,774),8476=>array(41,-14,803,743),8477=>array(98,0,774,729),8478=>array(83,0,814,729),8479=>array(98,-107,666,847),8480=>array(126,443,770,730),8481=>array(-2,0,1023,547),8482=>array(144,447,784,729),8483=>array(8,-108,676,846),8484=>array(45,0,700,729),8485=>array(43,-213,523,760),8486=>array(38,0,726,738),8487=>array(38,-14,726,724),8488=>array(12,-149,573,783),8489=>array(33,0,255,547),8490=>array(98,0,677,729),8491=>array(8,0,676,928),8492=>array(45,0,734,772),8493=>array(63,-12,652,742),8494=>array(61,-12,793,647),8495=>array(42,-14,547,533),8496=>array(79,-14,565,742),8497=>array(41,-16,758,755),8498=>array(98,0,517,729),8499=>array(28,-28,1032,751),8500=>array(51,-12,411,395),8501=>array(50,-14,712,742),8502=>array(-2,-14,653,743),8503=>array(13,-35,407,742),8504=>array(42,-35,591,742),8505=>array(34,0,355,760),8506=>array(44,-21,915,654),8507=>array(74,0,1162,547),8508=>array(18,-8,685,547),8509=>array(0,-194,669,560),8510=>array(98,0,648,729),8511=>array(98,0,750,729),8512=>array(12,-192,791,719),8513=>array(80,-14,716,742),8514=>array(4,0,458,729),8515=>array(3,0,457,729),8516=>array(-2,0,613,729),8517=>array(42,0,786,729),8518=>array(44,-14,709,760),8519=>array(44,-14,572,560),8520=>array(39,0,313,760),8521=>array(-114,-208,313,760),8523=>array(29,-14,715,742),8526=>array(40,0,441,547),8528=>array(67,-14,922,742),8529=>array(67,-14,932,742),8530=>array(67,-14,1335,742),8531=>array(67,-14,918,742),8532=>array(46,-14,918,742),8533=>array(67,-14,921,742),8534=>array(46,-14,921,742),8535=>array(48,-14,921,742),8536=>array(31,-14,921,742),8537=>array(67,-14,937,742),8538=>array(50,-14,937,742),8539=>array(67,-14,933,742),8540=>array(48,-14,933,742),8541=>array(50,-14,933,742),8542=>array(53,-14,933,742),8543=>array(67,-14,751,742),8544=>array(98,0,197,729),8545=>array(98,0,394,729),8546=>array(98,0,591,729),8547=>array(98,0,915,729),8548=>array(8,0,676,729),8549=>array(8,0,824,729),8550=>array(8,0,1021,729),8551=>array(8,0,1219,729),8552=>array(98,0,886,729),8553=>array(30,0,654,729),8554=>array(30,0,835,729),8555=>array(30,0,1032,729),8556=>array(98,0,552,729),8557=>array(56,-14,644,742),8558=>array(98,0,711,729),8559=>array(98,0,765,729),8560=>array(94,0,184,760),8561=>array(94,0,364,760),8562=>array(94,0,543,760),8563=>array(94,0,782,760),8564=>array(30,0,562,547),8565=>array(30,0,717,760),8566=>array(30,0,897,760),8567=>array(30,0,1077,760),8568=>array(94,0,786,760),8569=>array(29,0,559,547),8570=>array(29,0,729,760),8571=>array(29,0,908,760),8572=>array(94,0,184,760),8573=>array(55,-14,488,560),8574=>array(55,-14,544,760),8575=>array(91,0,889,560),8576=>array(59,0,1186,729),8577=>array(98,0,711,729),8578=>array(59,0,1186,729),8579=>array(56,-14,644,742),8580=>array(62,-14,495,560),8581=>array(56,-208,644,742),8585=>array(42,-14,918,742),8592=>array(49,100,781,527),8593=>array(205,0,632,732),8594=>array(57,100,789,527),8595=>array(205,-3,632,729),8596=>array(49,100,789,527),8597=>array(205,-8,632,732),8598=>array(141,25,703,587),8599=>array(141,25,703,587),8600=>array(141,25,703,587),8601=>array(141,25,703,587),8602=>array(49,100,781,527),8603=>array(57,100,789,527),8604=>array(21,103,827,414),8605=>array(11,103,816,414),8606=>array(49,100,781,527),8607=>array(206,0,633,732),8608=>array(57,100,789,527),8609=>array(206,-3,633,729),8610=>array(49,100,781,527),8611=>array(57,100,789,527),8612=>array(49,100,781,527),8613=>array(206,0,632,732),8614=>array(57,100,789,527),8615=>array(206,-3,632,729),8616=>array(206,0,632,732),8617=>array(49,100,780,565),8618=>array(58,100,789,565),8619=>array(49,100,780,565),8620=>array(58,100,789,565),8621=>array(49,100,789,527),8622=>array(49,93,789,534),8623=>array(146,-2,702,730),8624=>array(169,0,629,743),8625=>array(209,0,669,743),8626=>array(169,-14,629,729),8627=>array(209,-14,669,729),8628=>array(233,-3,760,604),8629=>array(49,100,656,626),8630=>array(22,203,799,668),8631=>array(39,203,816,668),8632=>array(108,25,788,729),8633=>array(55,-46,783,673),8634=>array(103,62,762,680),8635=>array(77,62,736,680),8636=>array(49,272,781,527),8637=>array(49,100,781,355),8638=>array(377,0,632,732),8639=>array(205,0,460,732),8640=>array(57,272,789,527),8641=>array(57,100,789,355),8642=>array(377,0,632,732),8643=>array(205,0,460,732),8644=>array(49,-47,789,674),8645=>array(58,-3,779,732),8646=>array(49,-47,789,674),8647=>array(49,-47,781,674),8648=>array(59,0,779,732),8649=>array(58,-47,790,674),8650=>array(59,-3,779,729),8651=>array(49,7,789,620),8652=>array(49,7,789,620),8653=>array(49,100,781,527),8654=>array(49,94,789,533),8655=>array(57,100,789,527),8656=>array(49,100,781,527),8657=>array(206,0,633,732),8658=>array(57,100,789,527),8659=>array(206,-3,633,729),8660=>array(49,100,789,527),8661=>array(205,-8,633,732),8662=>array(141,-23,751,587),8663=>array(92,-23,703,587),8664=>array(92,25,703,636),8665=>array(141,25,751,636),8666=>array(49,100,781,527),8667=>array(57,100,789,527),8668=>array(49,100,781,527),8669=>array(57,100,789,527),8670=>array(205,0,632,732),8671=>array(205,-3,632,729),8672=>array(49,100,781,527),8673=>array(205,0,633,732),8674=>array(57,100,789,527),8675=>array(205,-3,633,729),8676=>array(52,99,781,528),8677=>array(57,99,786,528),8678=>array(27,65,781,562),8679=>array(171,0,667,754),8680=>array(35,65,789,562),8681=>array(171,-25,667,729),8682=>array(171,0,667,754),8683=>array(171,0,667,754),8684=>array(156,0,682,754),8685=>array(171,0,667,754),8686=>array(171,0,667,754),8687=>array(171,0,667,754),8688=>array(57,65,811,562),8689=>array(60,0,788,729),8690=>array(60,0,788,729),8691=>array(171,-25,667,754),8692=>array(57,100,789,527),8693=>array(58,-3,779,732),8694=>array(57,-193,789,820),8695=>array(49,94,781,533),8696=>array(57,94,789,533),8697=>array(49,94,789,533),8698=>array(49,94,781,533),8699=>array(57,94,789,533),8700=>array(49,94,789,533),8701=>array(27,96,781,531),8702=>array(57,96,811,531),8703=>array(27,96,811,531),8704=>array(8,0,676,729),8705=>array(66,-14,554,742),8706=>array(46,-14,471,662),8707=>array(98,0,568,729),8708=>array(98,-46,568,776),8709=>array(76,-10,795,710),8710=>array(-3,0,672,719),8711=>array(-3,0,672,719),8712=>array(85,-10,786,710),8713=>array(85,-138,786,835),8714=>array(106,76,612,550),8715=>array(85,-10,786,710),8716=>array(85,-138,786,835),8717=>array(106,76,612,550),8718=>array(146,0,490,485),8719=>array(76,-192,680,719),8720=>array(76,-192,680,719),8721=>array(12,-192,654,719),8722=>array(106,272,732,355),8723=>array(106,0,732,627),8724=>array(106,0,732,729),8725=>array(0,-93,337,729),8726=>array(192,-54,529,768),8727=>array(127,0,710,627),8728=>array(158,160,468,470),8729=>array(168,168,458,458),8730=>array(30,-20,637,811),8731=>array(30,-20,637,933),8732=>array(30,-20,637,924),8733=>array(107,112,607,487),8734=>array(107,112,726,487),8735=>array(138,99,700,661),8736=>array(85,0,786,729),8737=>array(85,-53,786,729),8738=>array(116,-3,732,727),8739=>array(211,-214,289,771),8740=>array(50,-214,451,771),8741=>array(133,-214,367,771),8742=>array(50,-214,451,771),8743=>array(129,0,603,579),8744=>array(129,0,603,579),8745=>array(129,0,603,579),8746=>array(129,0,603,579),8747=>array(57,-212,464,757),8748=>array(57,-212,732,757),8749=>array(57,-212,1000,757),8750=>array(57,-212,464,757),8751=>array(57,-212,732,757),8752=>array(57,-212,1000,757),8753=>array(57,-213,522,757),8754=>array(57,-212,514,757),8755=>array(57,-212,515,757),8756=>array(59,100,577,604),8757=>array(59,100,577,604),8758=>array(79,100,182,604),8759=>array(59,100,577,604),8760=>array(106,272,732,552),8761=>array(106,78,732,552),8762=>array(105,78,732,552),8763=>array(106,78,732,552),8764=>array(106,228,732,399),8765=>array(106,228,732,399),8766=>array(79,149,759,479),8767=>array(106,42,732,584),8768=>array(102,0,273,626),8769=>array(106,77,732,553),8770=>array(106,133,732,454),8771=>array(106,172,732,494),8772=>array(106,48,732,603),8773=>array(106,90,732,594),8774=>array(106,12,732,594),8775=>array(106,-5,732,657),8776=>array(106,133,732,494),8777=>array(106,2,732,625),8778=>array(106,90,732,598),8779=>array(106,59,732,602),8780=>array(106,90,732,594),8781=>array(105,105,732,521),8782=>array(106,26,732,601),8783=>array(106,172,732,601),8784=>array(106,172,732,625),8785=>array(106,1,732,625),8786=>array(106,2,733,625),8787=>array(106,2,733,625),8788=>array(101,151,899,476),8789=>array(100,151,900,475),8790=>array(106,172,732,454),8791=>array(106,172,732,760),8792=>array(106,172,732,662),8793=>array(106,172,732,812),8794=>array(106,172,732,812),8795=>array(106,172,732,849),8796=>array(106,172,732,854),8797=>array(106,172,732,764),8798=>array(106,172,732,760),8799=>array(106,172,732,856),8800=>array(106,19,732,608),8801=>array(106,90,732,537),8802=>array(106,-24,732,650),8803=>array(106,0,732,629),8804=>array(106,0,732,582),8805=>array(106,0,732,582),8806=>array(106,-83,732,638),8807=>array(106,-83,732,638),8808=>array(106,-164,732,638),8809=>array(106,-164,732,638),8810=>array(72,22,975,609),8811=>array(72,22,975,609),8812=>array(86,-132,378,759),8813=>array(105,13,732,613),8814=>array(106,2,732,674),8815=>array(106,-47,732,625),8816=>array(106,-102,732,667),8817=>array(106,-102,732,667),8818=>array(106,-55,732,582),8819=>array(106,-39,732,582),8820=>array(106,-105,732,664),8821=>array(106,-102,732,667),8822=>array(102,-87,732,686),8823=>array(102,-87,732,686),8824=>array(102,-197,732,797),8825=>array(102,-197,732,797),8826=>array(106,-38,732,664),8827=>array(106,-38,732,664),8828=>array(106,-105,732,667),8829=>array(106,-105,732,667),8830=>array(106,-85,732,667),8831=>array(106,-85,732,667),8832=>array(106,-61,732,764),8833=>array(106,-138,732,687),8834=>array(100,80,738,546),8835=>array(100,80,738,546),8836=>array(100,-96,738,726),8837=>array(100,-100,738,722),8838=>array(93,0,732,613),8839=>array(106,0,745,613),8840=>array(93,-116,732,730),8841=>array(106,-116,745,730),8842=>array(93,-73,732,614),8843=>array(93,-73,732,614),8844=>array(129,0,603,579),8845=>array(129,0,603,579),8846=>array(129,2,603,582),8847=>array(106,0,732,568),8848=>array(106,0,732,568),8849=>array(106,-83,732,630),8850=>array(106,-83,732,630),8851=>array(106,0,674,626),8852=>array(106,0,674,626),8853=>array(91,-14,747,643),8854=>array(91,-14,747,643),8855=>array(91,-14,747,643),8856=>array(91,-14,747,643),8857=>array(91,-14,747,643),8858=>array(91,-14,747,643),8859=>array(91,-14,747,643),8860=>array(91,-14,747,643),8861=>array(91,-14,747,643),8862=>array(91,-14,747,643),8863=>array(91,-14,747,643),8864=>array(91,-14,747,643),8865=>array(91,-14,747,643),8866=>array(85,0,786,700),8867=>array(85,0,786,700),8868=>array(85,0,786,700),8869=>array(85,0,786,700),8870=>array(85,0,436,700),8871=>array(85,0,436,700),8872=>array(85,0,786,700),8873=>array(85,0,786,700),8874=>array(85,0,786,700),8875=>array(85,0,786,700),8876=>array(85,-40,786,740),8877=>array(85,-40,786,740),8878=>array(85,-40,786,740),8879=>array(85,-40,786,740),8880=>array(106,-43,724,670),8881=>array(106,-43,724,670),8882=>array(106,15,732,612),8883=>array(106,15,732,612),8884=>array(106,-48,732,674),8885=>array(106,-48,732,674),8886=>array(59,175,941,454),8887=>array(59,175,941,454),8888=>array(48,175,790,454),8889=>array(59,-47,779,674),8890=>array(116,0,404,701),8891=>array(98,0,634,740),8892=>array(98,0,634,740),8893=>array(98,0,634,740),8894=>array(138,0,700,562),8895=>array(138,0,700,562),8896=>array(-3,-192,823,719),8897=>array(-3,-192,823,719),8898=>array(68,-192,752,719),8899=>array(68,-192,752,719),8900=>array(3,-233,491,807),8901=>array(107,285,210,409),8902=>array(122,149,504,512),8903=>array(106,15,732,613),8904=>array(106,-30,894,657),8905=>array(106,-30,894,657),8906=>array(106,-30,894,657),8907=>array(106,-30,894,657),8908=>array(106,-30,894,657),8909=>array(106,172,732,494),8910=>array(48,0,684,579),8911=>array(48,0,684,579),8912=>array(93,-3,732,630),8913=>array(106,-3,745,630),8914=>array(103,0,735,663),8915=>array(103,-14,735,649),8916=>array(186,0,652,729),8917=>array(106,-100,732,729),8918=>array(106,46,732,581),8919=>array(106,46,732,581),8920=>array(72,22,1350,609),8921=>array(72,22,1350,609),8922=>array(106,-228,732,854),8923=>array(106,-228,732,854),8924=>array(106,0,732,582),8925=>array(106,0,732,582),8926=>array(106,-105,732,667),8927=>array(106,-105,732,667),8928=>array(106,-178,732,764),8929=>array(106,-178,732,764),8930=>array(106,-141,732,767),8931=>array(106,-141,732,767),8932=>array(106,-94,732,619),8933=>array(106,-94,732,619),8934=>array(106,-138,732,582),8935=>array(106,-138,732,582),8936=>array(106,-169,732,667),8937=>array(110,-171,736,667),8938=>array(106,-130,732,756),8939=>array(106,-130,732,756),8940=>array(106,-189,732,815),8941=>array(104,-189,730,815),8942=>array(448,-93,551,715),8943=>array(115,249,884,373),8944=>array(115,-93,884,715),8945=>array(115,-93,884,715),8946=>array(43,-10,957,710),8947=>array(85,-10,786,710),8948=>array(106,76,612,550),8949=>array(85,-10,786,910),8950=>array(85,-10,786,853),8951=>array(106,76,612,686),8952=>array(85,-144,786,710),8953=>array(85,-10,786,710),8954=>array(43,-10,957,710),8955=>array(85,-10,786,710),8956=>array(106,76,612,550),8957=>array(85,-10,786,853),8958=>array(106,76,612,686),8959=>array(106,0,765,720),8960=>array(36,-18,567,514),8961=>array(56,162,540,443),8962=>array(71,0,563,596),8963=>array(205,481,632,732),8964=>array(205,0,632,251),8965=>array(205,0,632,406),8966=>array(205,0,632,513),8967=>array(154,-29,334,788),8968=>array(86,-132,293,760),8969=>array(97,-132,304,760),8970=>array(86,-132,293,760),8971=>array(97,-132,304,760),8972=>array(369,-77,759,313),8973=>array(49,-77,439,313),8974=>array(369,243,759,634),8975=>array(49,243,439,634),8976=>array(106,140,732,421),8977=>array(3,126,510,634),8984=>array(121,0,879,759),8985=>array(106,140,732,421),8988=>array(86,425,403,760),8989=>array(65,425,383,760),8990=>array(86,-70,403,264),8991=>array(65,-70,383,264),8992=>array(210,-250,497,928),8993=>array(21,-237,307,942),8996=>array(76,227,1076,575),8997=>array(76,0,1076,575),8998=>array(76,0,1414,760),8999=>array(76,0,1076,760),9000=>array(59,0,1385,729),9003=>array(0,0,1338,760),9004=>array(73,-91,800,748),9075=>array(81,0,304,547),9076=>array(91,-208,580,560),9077=>array(66,-14,769,547),9082=>array(55,-12,611,559),9085=>array(13,-228,745,102),9095=>array(76,0,1096,748),9108=>array(17,0,856,727),9115=>array(86,-252,414,946),9116=>array(86,-252,181,942),9117=>array(86,-240,414,942),9118=>array(86,-252,414,946),9119=>array(319,-252,414,942),9120=>array(86,-240,414,942),9121=>array(86,-252,414,928),9122=>array(86,-252,181,942),9123=>array(86,-240,414,942),9124=>array(86,-252,414,928),9125=>array(319,-252,414,935),9126=>array(86,-240,414,935),9127=>array(330,-261,668,928),9128=>array(82,-252,420,940),9129=>array(330,-240,668,940),9130=>array(330,-256,420,943),9131=>array(82,-261,420,928),9132=>array(330,-252,668,940),9133=>array(82,-240,420,940),9134=>array(210,-250,307,942),9166=>array(27,65,781,729),9167=>array(91,0,854,596),9187=>array(73,-91,800,748),9189=>array(3,75,766,444),9192=>array(43,-129,601,294),9250=>array(-62,-14,580,760),9251=>array(71,-228,563,102),9312=>array(74,-10,822,738),9313=>array(74,-10,822,738),9314=>array(74,-10,822,738),9315=>array(74,-10,822,738),9316=>array(74,-10,822,738),9317=>array(74,-10,822,738),9318=>array(74,-10,822,738),9319=>array(74,-10,822,738),9320=>array(74,-10,822,738),9321=>array(74,-10,822,738),9472=>array(-10,242,612,326),9473=>array(-10,200,612,368),9474=>array(262,-302,340,973),9475=>array(223,-302,379,973),9476=>array(-10,242,612,326),9477=>array(-10,200,612,368),9478=>array(262,-302,340,973),9479=>array(223,-302,379,973),9480=>array(-10,242,612,326),9481=>array(-10,200,612,368),9482=>array(262,-302,340,973),9483=>array(223,-302,379,973),9484=>array(262,-302,612,326),9485=>array(262,-302,612,368),9486=>array(223,-302,612,326),9487=>array(223,-302,612,368),9488=>array(-10,-302,340,326),9489=>array(-10,-302,340,368),9490=>array(-10,-302,379,326),9491=>array(-10,-302,379,368),9492=>array(262,242,612,973),9493=>array(262,200,612,973),9494=>array(223,242,612,973),9495=>array(223,200,612,973),9496=>array(-10,242,340,973),9497=>array(-10,200,340,973),9498=>array(-10,242,379,973),9499=>array(-10,200,379,973),9500=>array(262,-302,612,973),9501=>array(262,-302,612,973),9502=>array(223,-302,612,973),9503=>array(223,-302,612,973),9504=>array(223,-302,612,973),9505=>array(223,-302,612,973),9506=>array(223,-302,612,973),9507=>array(223,-302,612,973),9508=>array(-10,-302,340,973),9509=>array(-10,-302,340,973),9510=>array(-10,-302,379,973),9511=>array(-10,-302,379,973),9512=>array(-10,-302,379,973),9513=>array(-10,-302,379,973),9514=>array(-10,-302,379,973),9515=>array(-10,-302,379,973),9516=>array(-10,-302,612,326),9517=>array(-10,-302,612,368),9518=>array(-10,-302,612,368),9519=>array(-10,-302,612,368),9520=>array(-10,-302,612,326),9521=>array(-10,-302,612,368),9522=>array(-10,-302,612,368),9523=>array(-10,-302,612,368),9524=>array(-10,242,612,973),9525=>array(-10,200,612,973),9526=>array(-10,200,612,973),9527=>array(-10,200,612,973),9528=>array(-10,242,612,973),9529=>array(-10,200,612,973),9530=>array(-10,200,612,973),9531=>array(-10,200,612,973),9532=>array(-10,-302,612,973),9533=>array(-10,-302,612,973),9534=>array(-10,-302,612,973),9535=>array(-10,-302,612,973),9536=>array(-10,-302,612,973),9537=>array(-10,-302,612,973),9538=>array(-10,-302,612,973),9539=>array(-10,-302,612,973),9540=>array(-10,-302,612,973),9541=>array(-10,-302,612,973),9542=>array(-10,-302,612,973),9543=>array(-10,-302,612,973),9544=>array(-10,-302,612,973),9545=>array(-10,-302,612,973),9546=>array(-10,-302,612,973),9547=>array(-10,-302,612,973),9548=>array(-10,242,612,326),9549=>array(-10,200,612,368),9550=>array(262,-302,340,973),9551=>array(223,-302,379,973),9552=>array(-10,158,612,410),9553=>array(184,-302,418,973),9554=>array(262,-302,612,410),9555=>array(184,-302,612,326),9556=>array(184,-302,612,410),9557=>array(-10,-302,340,410),9558=>array(-10,-302,418,326),9559=>array(-10,-302,418,410),9560=>array(262,158,612,973),9561=>array(184,242,612,973),9562=>array(184,158,612,973),9563=>array(-10,158,340,973),9564=>array(-10,242,418,973),9565=>array(-10,158,418,973),9566=>array(262,-302,612,973),9567=>array(184,-302,612,973),9568=>array(184,-302,612,973),9569=>array(-10,-302,340,973),9570=>array(-10,-302,418,973),9571=>array(-10,-302,418,973),9572=>array(-10,-302,612,410),9573=>array(-10,-302,612,326),9574=>array(-10,-302,612,410),9575=>array(-10,158,612,973),9576=>array(-10,242,612,973),9577=>array(-10,158,612,973),9578=>array(-10,-302,612,973),9579=>array(-10,-302,612,973),9580=>array(-10,-302,612,973),9581=>array(262,-302,612,326),9582=>array(-10,-302,340,326),9583=>array(-10,242,340,973),9584=>array(262,242,612,973),9585=>array(-53,-302,655,973),9586=>array(-53,-302,655,973),9587=>array(-53,-302,655,973),9588=>array(-10,242,311,326),9589=>array(262,284,340,973),9590=>array(311,242,612,326),9591=>array(262,-302,340,284),9592=>array(-10,200,311,368),9593=>array(223,284,379,973),9594=>array(311,200,612,368),9595=>array(223,-302,379,284),9596=>array(-10,200,612,368),9597=>array(223,-302,379,973),9598=>array(-10,200,612,368),9599=>array(223,-302,379,973),9600=>array(-10,260,779,770),9601=>array(-10,-250,779,-123),9602=>array(-10,-250,779,-5),9603=>array(-10,-250,779,132),9604=>array(-10,-250,779,260),9605=>array(-10,-250,779,387),9606=>array(-10,-250,779,515),9607=>array(-10,-250,779,642),9608=>array(-10,-250,779,770),9609=>array(-10,-250,680,770),9610=>array(-10,-250,582,770),9611=>array(-10,-250,483,770),9612=>array(-10,-250,384,770),9613=>array(-10,-250,286,770),9614=>array(-10,-250,187,770),9615=>array(-10,-250,88,770),9616=>array(384,-250,778,770),9617=>array(-10,-250,680,770),9618=>array(-10,-250,775,770),9619=>array(-10,-250,779,770),9620=>array(-10,642,779,770),9621=>array(680,-250,778,770),9622=>array(-10,-250,385,260),9623=>array(384,-250,779,260),9624=>array(-10,260,385,770),9625=>array(-10,-250,779,770),9626=>array(-10,-250,779,770),9627=>array(-10,-250,779,770),9628=>array(-10,-250,779,770),9629=>array(384,260,779,770),9630=>array(-10,-250,779,770),9631=>array(-10,-250,779,770),9632=>array(91,-123,854,643),9633=>array(91,-123,854,643),9634=>array(91,-123,854,643),9635=>array(91,-123,854,643),9636=>array(91,-123,854,643),9637=>array(91,-123,854,643),9638=>array(91,-123,854,643),9639=>array(91,-123,854,643),9640=>array(91,-123,854,643),9641=>array(91,-123,854,643),9642=>array(91,11,587,509),9643=>array(91,11,587,509),9644=>array(91,75,854,444),9645=>array(91,75,854,444),9646=>array(91,-122,459,642),9647=>array(91,-122,459,642),9648=>array(3,75,766,444),9649=>array(3,75,766,444),9650=>array(3,-123,766,643),9651=>array(3,-123,766,643),9652=>array(3,11,499,509),9653=>array(3,11,499,509),9654=>array(3,-123,766,643),9655=>array(3,-123,766,643),9656=>array(3,11,499,509),9657=>array(3,11,499,509),9658=>array(3,11,766,509),9659=>array(3,11,766,509),9660=>array(3,-123,766,643),9661=>array(3,-123,766,643),9662=>array(3,11,499,509),9663=>array(3,11,499,509),9664=>array(3,-123,766,643),9665=>array(3,-123,766,643),9666=>array(3,11,499,509),9667=>array(3,11,499,509),9668=>array(3,11,766,509),9669=>array(3,11,766,509),9670=>array(3,-123,766,643),9671=>array(3,-123,766,643),9672=>array(3,-123,766,643),9673=>array(55,-125,818,645),9674=>array(3,-233,491,807),9675=>array(55,-125,818,645),9676=>array(56,-125,817,644),9677=>array(55,-125,818,645),9678=>array(55,-125,818,645),9679=>array(55,-123,818,641),9680=>array(55,-123,818,641),9681=>array(55,-123,818,641),9682=>array(55,-123,818,641),9683=>array(55,-123,818,641),9684=>array(55,-123,818,641),9685=>array(55,-123,818,641),9686=>array(55,-125,436,645),9687=>array(91,-125,472,645),9688=>array(91,-10,700,770),9689=>array(91,-250,879,770),9690=>array(91,260,879,770),9691=>array(91,-250,879,260),9692=>array(3,260,384,645),9693=>array(3,260,384,645),9694=>array(3,-125,384,260),9695=>array(3,-125,384,260),9696=>array(55,260,818,645),9697=>array(55,-125,818,260),9698=>array(3,-123,766,643),9699=>array(3,-123,766,643),9700=>array(3,-123,766,643),9701=>array(3,-123,766,643),9702=>array(150,227,440,516),9703=>array(91,-123,854,643),9704=>array(91,-123,854,643),9705=>array(91,-123,854,643),9706=>array(91,-123,854,643),9707=>array(91,-123,854,643),9708=>array(3,-123,766,643),9709=>array(3,-123,766,643),9710=>array(3,-123,766,643),9711=>array(55,-250,1064,770),9712=>array(91,-123,854,643),9713=>array(91,-123,854,643),9714=>array(91,-123,854,643),9715=>array(91,-123,854,643),9716=>array(55,-123,818,641),9717=>array(55,-123,818,641),9718=>array(55,-123,818,641),9719=>array(55,-123,818,641),9720=>array(3,-123,766,643),9721=>array(3,-123,766,643),9722=>array(3,-123,766,643),9723=>array(91,-66,739,585),9724=>array(91,-66,739,585),9725=>array(91,-17,642,537),9726=>array(91,-17,642,537),9727=>array(3,-123,766,643),9728=>array(83,0,813,729),9729=>array(51,-2,949,360),9730=>array(49,0,848,729),9731=>array(83,-0,813,927),9732=>array(64,0,833,880),9733=>array(65,-4,832,723),9734=>array(65,-4,832,723),9735=>array(83,2,490,729),9736=>array(83,0,813,731),9737=>array(83,0,813,730),9738=>array(61,0,828,727),9739=>array(61,0,828,723),9740=>array(61,-1,610,722),9741=>array(61,0,952,723),9742=>array(68,0,1177,729),9743=>array(71,0,1180,729),9744=>array(90,0,807,729),9745=>array(89,0,808,729),9746=>array(89,0,808,729),9747=>array(75,78,457,656),9748=>array(49,0,870,933),9749=>array(74,0,822,731),9750=>array(84,0,813,731),9751=>array(84,0,813,727),9752=>array(78,0,819,729),9753=>array(83,140,813,574),9754=>array(84,113,813,569),9755=>array(84,113,813,569),9756=>array(87,104,810,569),9757=>array(72,0,537,724),9758=>array(86,103,810,569),9759=>array(72,-3,537,720),9760=>array(61,0,835,730),9761=>array(84,0,813,730),9762=>array(83,0,813,730),9763=>array(49,0,848,730),9764=>array(49,-2,620,727),9765=>array(83,0,663,731),9766=>array(83,-1,566,731),9767=>array(83,0,701,911),9768=>array(83,0,462,730),9769=>array(83,-1,813,729),9770=>array(87,0,810,730),9771=>array(83,0,814,731),9772=>array(83,0,627,731),9773=>array(83,0,813,730),9774=>array(83,0,813,730),9775=>array(83,0,813,730),9776=>array(83,0,813,729),9777=>array(83,0,814,729),9778=>array(83,0,813,729),9779=>array(83,0,813,729),9780=>array(83,0,813,729),9781=>array(83,0,813,729),9782=>array(83,0,813,729),9783=>array(83,0,813,729),9784=>array(66,-11,831,735),9785=>array(83,-73,959,804),9786=>array(83,-73,959,804),9787=>array(83,-73,959,804),9788=>array(83,0,813,730),9789=>array(358,0,814,730),9790=>array(83,0,539,730),9791=>array(85,-102,528,732),9792=>array(85,-125,647,731),9793=>array(85,-14,647,843),9794=>array(79,-14,831,720),9795=>array(166,0,730,730),9796=>array(219,0,677,730),9797=>array(121,0,774,730),9798=>array(127,0,769,730),9799=>array(240,0,656,730),9800=>array(45,0,851,731),9801=>array(89,0,807,730),9802=>array(94,0,802,731),9803=>array(113,31,784,679),9804=>array(140,0,756,730),9805=>array(53,-180,843,730),9806=>array(83,52,813,653),9807=>array(34,-96,863,730),9808=>array(83,-0,813,730),9809=>array(94,0,802,730),9810=>array(86,153,810,579),9811=>array(157,0,739,730),9812=>array(98,0,798,730),9813=>array(110,0,786,730),9814=>array(167,-1,729,729),9815=>array(214,0,683,730),9816=>array(165,0,732,730),9817=>array(148,-0,748,730),9818=>array(98,0,798,730),9819=>array(110,0,786,730),9820=>array(167,-1,729,729),9821=>array(214,0,683,730),9822=>array(162,0,734,730),9823=>array(148,-0,748,730),9824=>array(158,0,738,729),9825=>array(90,0,806,727),9826=>array(168,0,728,729),9827=>array(111,0,785,729),9828=>array(157,0,739,729),9829=>array(89,0,808,729),9830=>array(168,0,728,729),9831=>array(111,0,785,732),9832=>array(105,-1,791,729),9833=>array(84,-5,339,729),9834=>array(84,-5,554,729),9835=>array(184,-102,712,729),9836=>array(92,-5,804,729),9837=>array(88,-3,392,731),9838=>array(84,0,273,731),9839=>array(84,0,400,731),9840=>array(84,0,664,731),9841=>array(64,0,701,731),9842=>array(84,0,813,709),9843=>array(76,16,820,731),9844=>array(76,16,820,731),9845=>array(76,16,820,731),9846=>array(76,16,820,731),9847=>array(76,16,820,731),9848=>array(76,16,820,731),9849=>array(76,16,820,731),9850=>array(76,16,820,731),9851=>array(84,0,812,704),9852=>array(83,0,814,731),9853=>array(83,0,814,731),9854=>array(83,0,814,731),9855=>array(149,1,747,731),9856=>array(73,0,797,725),9857=>array(73,0,797,725),9858=>array(73,0,797,725),9859=>array(73,0,797,725),9860=>array(73,0,797,725),9861=>array(73,0,797,725),9862=>array(83,0,813,731),9863=>array(83,0,813,731),9864=>array(83,0,813,731),9865=>array(83,0,813,731),9866=>array(83,0,813,98),9867=>array(83,0,813,98),9868=>array(83,0,813,413),9869=>array(83,0,813,413),9870=>array(83,0,813,413),9871=>array(83,0,813,413),9872=>array(168,3,728,731),9873=>array(168,3,728,731),9874=>array(52,0,844,731),9875=>array(97,-10,799,732),9876=>array(131,0,765,729),9877=>array(61,-10,479,732),9878=>array(59,-10,837,732),9879=>array(61,0,835,732),9880=>array(145,0,750,732),9881=>array(95,-17,802,727),9882=>array(128,-9,768,733),9883=>array(127,0,769,728),9884=>array(127,0,769,729),9888=>array(49,0,848,729),9889=>array(83,2,619,730),9890=>array(85,-125,919,731),9891=>array(79,-206,1023,720),9892=>array(85,-186,1109,856),9893=>array(85,-125,837,917),9894=>array(131,-14,727,869),9895=>array(101,-170,741,884),9896=>array(188,-14,650,869),9897=>array(4,133,829,596),9898=>array(187,133,651,596),9899=>array(187,133,651,596),9900=>array(247,194,591,537),9901=>array(174,194,664,537),9902=>array(41,169,797,560),9903=>array(5,194,833,536),9904=>array(103,237,757,540),9905=>array(211,42,626,698),9906=>array(85,-125,647,731),9907=>array(168,-125,646,731),9908=>array(86,-125,646,731),9909=>array(86,-125,646,731),9910=>array(59,-118,791,643),9911=>array(194,-104,595,710),9912=>array(158,-125,543,731),9920=>array(42,4,796,553),9921=>array(42,4,796,724),9922=>array(42,4,796,553),9923=>array(42,4,796,724),9954=>array(85,-14,647,843),9985=>array(11,190,803,635),9986=>array(42,141,784,588),9987=>array(11,94,803,539),9988=>array(36,119,824,613),9990=>array(42,-14,796,742),9991=>array(42,-14,796,742),9992=>array(59,21,782,708),9993=>array(64,107,773,622),9996=>array(212,0,561,742),9997=>array(21,83,802,678),9998=>array(89,75,724,710),9999=>array(26,198,819,530),10000=>array(89,75,724,710),10001=>array(43,185,757,544),10002=>array(67,209,757,520),10003=>array(150,97,667,630),10004=>array(116,87,721,631),10005=>array(126,72,711,657),10006=>array(85,31,752,698),10007=>array(118,-9,701,732),10008=>array(123,0,754,739),10009=>array(55,0,783,729),10010=>array(55,0,783,729),10011=>array(55,0,783,729),10012=>array(55,0,783,729),10013=>array(165,0,673,729),10014=>array(131,0,678,729),10015=>array(155,0,683,729),10016=>array(55,0,783,729),10017=>array(91,-13,747,744),10018=>array(41,-14,797,742),10019=>array(42,-12,796,742),10020=>array(41,-14,797,742),10021=>array(41,-13,797,743),10022=>array(42,-14,796,745),10023=>array(42,-14,796,745),10025=>array(23,-10,815,744),10026=>array(42,-14,796,742),10027=>array(23,-9,814,743),10028=>array(23,-10,815,744),10029=>array(23,-9,814,743),10030=>array(23,-9,814,743),10031=>array(23,-9,814,743),10032=>array(24,12,815,714),10033=>array(64,0,773,729),10034=>array(74,0,764,729),10035=>array(55,0,783,729),10036=>array(31,-14,787,742),10037=>array(41,-14,797,742),10038=>array(91,-14,747,742),10039=>array(41,-14,797,742),10040=>array(41,-14,797,742),10041=>array(41,-14,797,742),10042=>array(55,0,783,729),10043=>array(82,-14,756,742),10044=>array(82,-14,756,742),10045=>array(79,-14,759,742),10046=>array(79,-14,759,742),10047=>array(54,0,784,709),10048=>array(54,0,784,709),10049=>array(41,-14,797,742),10050=>array(42,-14,796,742),10051=>array(79,-14,759,742),10052=>array(89,0,749,729),10053=>array(76,0,762,729),10054=>array(63,2,773,729),10055=>array(79,-13,759,742),10056=>array(47,-13,791,730),10057=>array(47,-13,791,730),10058=>array(41,-13,797,743),10059=>array(41,-13,797,743),10061=>array(50,-10,847,738),10063=>array(60,-49,837,729),10064=>array(60,0,837,777),10065=>array(60,-49,837,729),10066=>array(60,0,837,777),10070=>array(83,-2,813,728),10072=>array(377,-240,460,760),10073=>array(336,-240,502,760),10074=>array(253,-240,585,760),10075=>array(85,395,264,729),10076=>array(59,395,237,729),10077=>array(85,395,479,729),10078=>array(59,395,453,729),10081=>array(155,-93,772,851),10082=>array(202,-17,636,742),10083=>array(163,-17,675,742),10084=>array(54,83,784,645),10085=>array(168,-1,729,729),10086=>array(62,21,724,702),10087=>array(78,169,759,564),10088=>array(196,-139,648,769),10089=>array(196,-139,648,769),10090=>array(264,-132,574,758),10091=>array(264,-132,574,758),10092=>array(215,-240,607,760),10093=>array(232,-240,623,760),10094=>array(142,-240,685,760),10095=>array(153,-240,696,760),10096=>array(167,-240,656,760),10097=>array(183,-240,672,760),10098=>array(346,-241,535,760),10099=>array(303,-241,492,760),10100=>array(175,-163,634,760),10101=>array(204,-163,663,760),10102=>array(74,-10,822,738),10103=>array(74,-10,822,738),10104=>array(74,-10,822,738),10105=>array(74,-10,822,738),10106=>array(74,-10,822,738),10107=>array(74,-10,822,738),10108=>array(74,-10,822,738),10109=>array(74,-10,822,738),10110=>array(74,-10,822,738),10111=>array(74,-10,822,738),10112=>array(4,-52,833,780),10113=>array(4,-52,833,780),10114=>array(4,-52,833,780),10115=>array(4,-52,833,780),10116=>array(4,-52,833,780),10117=>array(4,-52,833,780),10118=>array(4,-52,833,780),10119=>array(4,-52,833,780),10120=>array(4,-52,833,780),10121=>array(4,-52,833,780),10122=>array(4,-52,833,780),10123=>array(4,-52,833,780),10124=>array(4,-52,833,780),10125=>array(4,-52,833,780),10126=>array(4,-52,833,780),10127=>array(4,-52,833,780),10128=>array(4,-52,833,780),10129=>array(4,-52,833,780),10130=>array(4,-52,833,780),10131=>array(4,-52,833,780),10132=>array(57,75,789,552),10136=>array(123,55,682,614),10137=>array(57,100,789,527),10138=>array(123,13,682,572),10139=>array(57,129,789,498),10140=>array(57,57,764,570),10141=>array(57,100,789,527),10142=>array(57,100,789,527),10143=>array(57,100,789,527),10144=>array(57,100,789,527),10145=>array(57,65,811,562),10146=>array(111,94,789,533),10147=>array(111,94,789,533),10148=>array(111,-4,789,631),10149=>array(57,100,789,548),10150=>array(57,79,789,527),10151=>array(240,-7,606,634),10152=>array(57,100,789,527),10153=>array(57,75,765,552),10154=>array(57,75,765,552),10155=>array(21,12,794,586),10156=>array(21,12,794,586),10157=>array(135,0,774,574),10158=>array(135,0,774,574),10159=>array(62,49,799,574),10161=>array(62,49,799,574),10162=>array(154,-20,721,585),10163=>array(63,157,789,470),10164=>array(81,55,682,655),10165=>array(57,173,789,454),10166=>array(82,-29,682,572),10167=>array(82,55,682,655),10168=>array(57,172,789,455),10169=>array(82,-28,682,572),10170=>array(56,84,789,543),10171=>array(73,140,779,487),10172=>array(79,167,774,460),10173=>array(79,118,774,509),10174=>array(57,81,789,546),10181=>array(54,-163,352,769),10182=>array(39,-163,336,769),10208=>array(3,-233,491,807),10214=>array(86,-132,398,760),10215=>array(85,-132,398,760),10216=>array(89,-132,310,759),10217=>array(80,-132,301,759),10218=>array(89,-132,476,759),10219=>array(80,-132,467,759),10224=>array(44,0,794,732),10225=>array(43,-3,793,729),10226=>array(39,53,814,658),10227=>array(39,61,814,666),10228=>array(57,-14,1108,643),10229=>array(49,100,1376,527),10230=>array(57,100,1385,527),10231=>array(49,100,1385,527),10232=>array(49,100,1376,527),10233=>array(57,100,1385,527),10234=>array(49,100,1385,527),10235=>array(49,100,1376,527),10236=>array(57,100,1385,527),10237=>array(49,100,1376,527),10238=>array(57,100,1385,527),10239=>array(57,100,1385,527),10241=>array(146,635,293,781),10242=>array(146,358,293,504),10243=>array(146,358,293,781),10244=>array(146,82,293,228),10245=>array(146,82,293,781),10246=>array(146,82,293,504),10247=>array(146,82,293,781),10248=>array(439,635,586,781),10249=>array(146,635,586,781),10250=>array(146,358,586,781),10251=>array(146,358,586,781),10252=>array(146,82,586,781),10253=>array(146,82,586,781),10254=>array(146,82,586,781),10255=>array(146,82,586,781),10256=>array(439,358,586,504),10257=>array(146,358,586,781),10258=>array(146,358,586,504),10259=>array(146,358,586,781),10260=>array(146,82,586,504),10261=>array(146,82,586,781),10262=>array(146,82,586,504),10263=>array(146,82,586,781),10264=>array(439,358,586,781),10265=>array(146,358,586,781),10266=>array(146,358,586,781),10267=>array(146,358,586,781),10268=>array(146,82,586,781),10269=>array(146,82,586,781),10270=>array(146,82,586,781),10271=>array(146,82,586,781),10272=>array(439,82,586,228),10273=>array(146,82,586,781),10274=>array(146,82,586,504),10275=>array(146,82,586,781),10276=>array(146,82,586,228),10277=>array(146,82,586,781),10278=>array(146,82,586,504),10279=>array(146,82,586,781),10280=>array(439,82,586,781),10281=>array(146,82,586,781),10282=>array(146,82,586,781),10283=>array(146,82,586,781),10284=>array(146,82,586,781),10285=>array(146,82,586,781),10286=>array(146,82,586,781),10287=>array(146,82,586,781),10288=>array(439,82,586,504),10289=>array(146,82,586,781),10290=>array(146,82,586,504),10291=>array(146,82,586,781),10292=>array(146,82,586,504),10293=>array(146,82,586,781),10294=>array(146,82,586,504),10295=>array(146,82,586,781),10296=>array(439,82,586,781),10297=>array(146,82,586,781),10298=>array(146,82,586,781),10299=>array(146,82,586,781),10300=>array(146,82,586,781),10301=>array(146,82,586,781),10302=>array(146,82,586,781),10303=>array(146,82,586,781),10304=>array(146,-195,293,-49),10305=>array(146,-195,293,781),10306=>array(146,-195,293,504),10307=>array(146,-195,293,781),10308=>array(146,-195,293,228),10309=>array(146,-195,293,781),10310=>array(146,-195,293,504),10311=>array(146,-195,293,781),10312=>array(146,-195,586,781),10313=>array(146,-195,586,781),10314=>array(146,-195,586,781),10315=>array(146,-195,586,781),10316=>array(146,-195,586,781),10317=>array(146,-195,586,781),10318=>array(146,-195,586,781),10319=>array(146,-195,586,781),10320=>array(146,-195,586,504),10321=>array(146,-195,586,781),10322=>array(146,-195,586,504),10323=>array(146,-195,586,781),10324=>array(146,-195,586,504),10325=>array(146,-195,586,781),10326=>array(146,-195,586,504),10327=>array(146,-195,586,781),10328=>array(146,-195,586,781),10329=>array(146,-195,586,781),10330=>array(146,-195,586,781),10331=>array(146,-195,586,781),10332=>array(146,-195,586,781),10333=>array(146,-195,586,781),10334=>array(146,-195,586,781),10335=>array(146,-195,586,781),10336=>array(146,-195,586,228),10337=>array(146,-195,586,781),10338=>array(146,-195,586,504),10339=>array(146,-195,586,781),10340=>array(146,-195,586,228),10341=>array(146,-195,586,781),10342=>array(146,-195,586,504),10343=>array(146,-195,586,781),10344=>array(146,-195,586,781),10345=>array(146,-195,586,781),10346=>array(146,-195,586,781),10347=>array(146,-195,586,781),10348=>array(146,-195,586,781),10349=>array(146,-195,586,781),10350=>array(146,-195,586,781),10351=>array(146,-195,586,781),10352=>array(146,-195,586,504),10353=>array(146,-195,586,781),10354=>array(146,-195,586,504),10355=>array(146,-195,586,781),10356=>array(146,-195,586,504),10357=>array(146,-195,586,781),10358=>array(146,-195,586,504),10359=>array(146,-195,586,781),10360=>array(146,-195,586,781),10361=>array(146,-195,586,781),10362=>array(146,-195,586,781),10363=>array(146,-195,586,781),10364=>array(146,-195,586,781),10365=>array(146,-195,586,781),10366=>array(146,-195,586,781),10367=>array(146,-195,586,781),10368=>array(439,-195,586,-49),10369=>array(146,-195,586,781),10370=>array(146,-195,586,504),10371=>array(146,-195,586,781),10372=>array(146,-195,586,228),10373=>array(146,-195,586,781),10374=>array(146,-195,586,504),10375=>array(146,-195,586,781),10376=>array(439,-195,586,781),10377=>array(146,-195,586,781),10378=>array(146,-195,586,781),10379=>array(146,-195,586,781),10380=>array(146,-195,586,781),10381=>array(146,-195,586,781),10382=>array(146,-195,586,781),10383=>array(146,-195,586,781),10384=>array(439,-195,586,504),10385=>array(146,-195,586,781),10386=>array(146,-195,586,504),10387=>array(146,-195,586,781),10388=>array(146,-195,586,504),10389=>array(146,-195,586,781),10390=>array(146,-195,586,504),10391=>array(146,-195,586,781),10392=>array(439,-195,586,781),10393=>array(146,-195,586,781),10394=>array(146,-195,586,781),10395=>array(146,-195,586,781),10396=>array(146,-195,586,781),10397=>array(146,-195,586,781),10398=>array(146,-195,586,781),10399=>array(146,-195,586,781),10400=>array(439,-195,586,228),10401=>array(146,-195,586,781),10402=>array(146,-195,586,504),10403=>array(146,-195,586,781),10404=>array(146,-195,586,228),10405=>array(146,-195,586,781),10406=>array(146,-195,586,504),10407=>array(146,-195,586,781),10408=>array(439,-195,586,781),10409=>array(146,-195,586,781),10410=>array(146,-195,586,781),10411=>array(146,-195,586,781),10412=>array(146,-195,586,781),10413=>array(146,-195,586,781),10414=>array(146,-195,586,781),10415=>array(146,-195,586,781),10416=>array(439,-195,586,504),10417=>array(146,-195,586,781),10418=>array(146,-195,586,504),10419=>array(146,-195,586,781),10420=>array(146,-195,586,504),10421=>array(146,-195,586,781),10422=>array(146,-195,586,504),10423=>array(146,-195,586,781),10424=>array(439,-195,586,781),10425=>array(146,-195,586,781),10426=>array(146,-195,586,781),10427=>array(146,-195,586,781),10428=>array(146,-195,586,781),10429=>array(146,-195,586,781),10430=>array(146,-195,586,781),10431=>array(146,-195,586,781),10432=>array(146,-195,586,-49),10433=>array(146,-195,586,781),10434=>array(146,-195,586,504),10435=>array(146,-195,586,781),10436=>array(146,-195,586,228),10437=>array(146,-195,586,781),10438=>array(146,-195,586,504),10439=>array(146,-195,586,781),10440=>array(146,-195,586,781),10441=>array(146,-195,586,781),10442=>array(146,-195,586,781),10443=>array(146,-195,586,781),10444=>array(146,-195,586,781),10445=>array(146,-195,586,781),10446=>array(146,-195,586,781),10447=>array(146,-195,586,781),10448=>array(146,-195,586,504),10449=>array(146,-195,586,781),10450=>array(146,-195,586,504),10451=>array(146,-195,586,781),10452=>array(146,-195,586,504),10453=>array(146,-195,586,781),10454=>array(146,-195,586,504),10455=>array(146,-195,586,781),10456=>array(146,-195,586,781),10457=>array(146,-195,586,781),10458=>array(146,-195,586,781),10459=>array(146,-195,586,781),10460=>array(146,-195,586,781),10461=>array(146,-195,586,781),10462=>array(146,-195,586,781),10463=>array(146,-195,586,781),10464=>array(146,-195,586,228),10465=>array(146,-195,586,781),10466=>array(146,-195,586,504),10467=>array(146,-195,586,781),10468=>array(146,-195,586,228),10469=>array(146,-195,586,781),10470=>array(146,-195,586,504),10471=>array(146,-195,586,781),10472=>array(146,-195,586,781),10473=>array(146,-195,586,781),10474=>array(146,-195,586,781),10475=>array(146,-195,586,781),10476=>array(146,-195,586,781),10477=>array(146,-195,586,781),10478=>array(146,-195,586,781),10479=>array(146,-195,586,781),10480=>array(146,-195,586,504),10481=>array(146,-195,586,781),10482=>array(146,-195,586,504),10483=>array(146,-195,586,781),10484=>array(146,-195,586,504),10485=>array(146,-195,586,781),10486=>array(146,-195,586,504),10487=>array(146,-195,586,781),10488=>array(146,-195,586,781),10489=>array(146,-195,586,781),10490=>array(146,-195,586,781),10491=>array(146,-195,586,781),10492=>array(146,-195,586,781),10493=>array(146,-195,586,781),10494=>array(146,-195,586,781),10495=>array(146,-195,586,781),10502=>array(49,100,781,527),10503=>array(57,100,789,527),10506=>array(125,0,713,732),10507=>array(125,-3,713,729),10560=>array(39,63,644,838),10561=>array(39,63,644,838),10627=>array(125,-163,609,760),10628=>array(125,-163,609,760),10702=>array(106,-226,732,747),10703=>array(106,15,894,612),10704=>array(106,15,894,612),10705=>array(106,-30,894,657),10706=>array(106,-30,894,657),10707=>array(106,-30,894,657),10708=>array(106,-30,894,657),10709=>array(106,-30,894,657),10731=>array(3,-233,491,807),10746=>array(106,0,732,627),10747=>array(106,0,732,627),10752=>array(28,-198,972,748),10753=>array(28,-198,972,748),10754=>array(28,-198,972,748),10764=>array(57,-212,1268,757),10765=>array(57,-212,464,757),10766=>array(57,-212,464,757),10767=>array(57,-212,464,757),10768=>array(57,-212,464,757),10769=>array(57,-212,522,757),10770=>array(57,-212,464,757),10771=>array(57,-212,464,757),10772=>array(57,-212,555,757),10773=>array(57,-212,464,757),10774=>array(57,-212,464,757),10775=>array(-32,-212,553,757),10776=>array(57,-212,464,757),10777=>array(57,-212,464,757),10778=>array(57,-212,464,757),10779=>array(57,-212,469,872),10780=>array(52,-327,464,757),10799=>array(137,31,701,596),10858=>array(106,228,732,552),10859=>array(106,78,732,552),10877=>array(106,-123,732,581),10878=>array(106,-123,732,581),10879=>array(106,-123,733,581),10880=>array(106,-123,732,581),10881=>array(106,-123,732,644),10882=>array(106,-123,732,644),10883=>array(106,-123,733,759),10884=>array(106,-123,732,756),10885=>array(106,-132,732,663),10886=>array(106,-132,732,663),10887=>array(106,-121,732,582),10888=>array(106,-121,732,582),10889=>array(106,-204,732,663),10890=>array(106,-204,732,663),10891=>array(106,-311,732,791),10892=>array(106,-311,732,791),10893=>array(106,-124,732,663),10894=>array(106,-124,732,663),10895=>array(106,-241,732,756),10896=>array(106,-241,732,756),10897=>array(106,-229,732,730),10898=>array(106,-229,732,730),10899=>array(106,-224,732,741),10900=>array(106,-224,732,741),10901=>array(106,-61,732,644),10902=>array(106,-61,732,644),10903=>array(106,-61,733,644),10904=>array(106,-61,732,644),10905=>array(106,-36,732,685),10906=>array(106,-36,732,685),10907=>array(106,-31,732,725),10908=>array(106,-31,732,725),10909=>array(106,8,732,645),10910=>array(106,23,732,645),10911=>array(106,-176,732,729),10912=>array(106,-176,732,729),10926=>array(106,50,732,601),10927=>array(106,-24,732,667),10928=>array(106,-24,732,667),10929=>array(106,-145,732,667),10930=>array(106,-145,732,667),10931=>array(106,-121,732,662),10932=>array(106,-121,732,662),10933=>array(106,-195,732,662),10934=>array(106,-195,732,662),10935=>array(106,-191,732,693),10936=>array(106,-191,732,693),10937=>array(106,-259,732,693),10938=>array(106,-259,732,693),11001=>array(106,-171,732,585),11002=>array(106,-171,732,585),11008=>array(88,-27,703,587),11009=>array(141,-27,755,587),11010=>array(88,25,703,640),11011=>array(141,25,755,640),11012=>array(27,65,789,562),11013=>array(27,65,781,562),11014=>array(171,0,667,754),11015=>array(171,-25,667,729),11016=>array(88,-27,703,587),11017=>array(141,-27,755,587),11018=>array(88,25,703,640),11019=>array(141,25,755,640),11020=>array(27,65,789,562),11021=>array(171,-25,667,754),11022=>array(57,-3,790,355),11023=>array(57,272,790,630),11024=>array(35,-3,768,355),11025=>array(35,272,768,630),11026=>array(91,-123,854,643),11027=>array(91,-123,854,643),11028=>array(91,-123,854,643),11029=>array(91,-123,854,643),11030=>array(3,-123,766,643),11031=>array(3,-123,766,643),11032=>array(3,-123,766,643),11033=>array(3,-123,766,643),11034=>array(91,-123,854,643),11039=>array(18,-26,852,767),11040=>array(18,-26,852,767),11041=>array(73,-91,800,748),11042=>array(73,-91,800,748),11043=>array(17,-35,856,692),11044=>array(55,-250,1064,770),11091=>array(38,-47,832,788),11092=>array(38,-47,832,788),11360=>array(5,0,552,729),11361=>array(5,0,271,760),11362=>array(-20,0,552,729),11363=>array(5,0,569,729),11364=>array(98,-200,666,729),11365=>array(35,-46,576,592),11366=>array(-12,-93,384,822),11367=>array(98,-157,752,729),11368=>array(91,-138,639,760),11369=>array(98,-157,677,729),11370=>array(91,-138,576,760),11371=>array(45,-157,738,729),11372=>array(43,-138,572,547),11373=>array(56,-14,683,743),11374=>array(98,-200,765,729),11375=>array(8,0,676,729),11376=>array(56,-14,683,743),11377=>array(30,0,734,560),11378=>array(33,0,1128,742),11379=>array(42,0,961,560),11380=>array(51,0,562,587),11381=>array(98,0,555,729),11382=>array(94,0,477,547),11383=>array(55,-12,602,551),11385=>array(0,-13,320,760),11386=>array(55,-14,557,560),11387=>array(48,0,400,547),11388=>array(-11,-117,116,425),11389=>array(5,326,426,734),11390=>array(66,-242,598,742),11391=>array(45,-242,640,729),11520=>array(60,-63,544,547),11521=>array(24,-235,556,546),11522=>array(39,-235,535,546),11523=>array(62,-10,572,807),11524=>array(51,-235,537,546),11525=>array(39,-236,862,546),11526=>array(0,-8,575,816),11527=>array(53,0,900,546),11528=>array(69,0,542,546),11529=>array(51,-235,556,816),11530=>array(39,0,903,546),11531=>array(53,-8,595,816),11532=>array(39,0,544,816),11533=>array(51,0,887,546),11534=>array(51,0,556,546),11535=>array(69,-235,767,816),11536=>array(51,0,880,816),11537=>array(51,0,545,816),11538=>array(50,-235,536,546),11539=>array(51,-235,884,661),11540=>array(60,-235,892,546),11541=>array(49,-235,784,816),11542=>array(39,0,545,546),11543=>array(51,-235,556,547),11544=>array(51,-235,551,546),11545=>array(39,-235,541,816),11546=>array(42,-235,532,547),11547=>array(60,-9,596,816),11548=>array(39,-235,870,547),11549=>array(29,-235,545,546),11550=>array(47,-235,547,546),11551=>array(34,-235,547,567),11552=>array(39,0,875,546),11553=>array(49,-235,544,816),11554=>array(60,0,538,626),11555=>array(61,-235,553,816),11556=>array(51,-235,603,546),11557=>array(60,-8,841,816),11568=>array(55,-14,591,380),11569=>array(56,-14,832,742),11570=>array(56,-14,832,742),11571=>array(31,0,651,729),11572=>array(33,0,652,729),11573=>array(31,0,604,729),11574=>array(73,0,488,729),11575=>array(8,0,676,729),11576=>array(8,0,676,729),11577=>array(98,0,568,729),11578=>array(64,0,534,729),11579=>array(73,-14,609,742),11580=>array(107,0,811,729),11581=>array(45,0,665,729),11582=>array(73,0,437,729),11583=>array(45,0,665,729),11584=>array(56,-14,832,742),11585=>array(56,-52,832,781),11586=>array(73,0,197,729),11587=>array(20,0,610,729),11588=>array(98,0,654,729),11589=>array(30,0,654,729),11590=>array(73,0,454,729),11591=>array(45,0,629,729),11592=>array(73,301,571,426),11593=>array(98,0,568,729),11594=>array(54,0,448,729),11595=>array(54,-15,899,742),11596=>array(54,0,725,729),11597=>array(98,0,650,729),11598=>array(100,0,566,729),11599=>array(98,0,197,729),11600=>array(54,0,725,729),11601=>array(98,0,198,729),11602=>array(78,-14,705,729),11603=>array(48,-14,584,742),11604=>array(56,-14,832,742),11605=>array(56,-54,832,742),11606=>array(98,0,654,729),11607=>array(98,0,222,729),11608=>array(73,0,676,729),11609=>array(56,-14,832,742),11610=>array(56,-14,832,780),11611=>array(56,-14,681,742),11612=>array(49,0,719,729),11613=>array(30,0,654,729),11614=>array(56,-14,681,742),11615=>array(98,0,568,729),11616=>array(8,0,676,729),11617=>array(98,0,654,729),11618=>array(98,0,559,729),11619=>array(56,0,732,729),11620=>array(98,0,495,729),11621=>array(56,0,732,729),11631=>array(26,522,489,729),11800=>array(70,-14,459,728),11806=>array(106,78,732,399),11810=>array(86,403,293,760),11811=>array(97,403,304,760),11812=>array(86,-132,293,225),11813=>array(97,-132,304,225),11822=>array(72,0,461,742),19904=>array(83,-158,813,729),19905=>array(83,-158,813,729),19906=>array(83,-158,813,729),19907=>array(83,-158,813,729),19908=>array(83,-158,813,729),19909=>array(83,-158,813,729),19910=>array(83,-158,813,729),19911=>array(83,-158,813,729),19912=>array(83,-158,813,729),19913=>array(83,-158,814,729),19914=>array(83,-158,813,729),19915=>array(83,-158,813,729),19916=>array(83,-158,813,729),19917=>array(83,-158,813,729),19918=>array(83,-158,813,729),19919=>array(83,-158,813,729),19920=>array(83,-158,814,729),19921=>array(83,-158,813,729),19922=>array(83,-158,814,729),19923=>array(83,-158,813,729),19924=>array(83,-158,813,729),19925=>array(83,-158,813,729),19926=>array(83,-158,813,729),19927=>array(83,-158,813,729),19928=>array(83,-158,813,729),19929=>array(83,-158,813,729),19930=>array(83,-158,813,729),19931=>array(83,-158,814,729),19932=>array(83,-158,813,729),19933=>array(83,-158,813,729),19934=>array(83,-158,814,729),19935=>array(83,-158,813,729),19936=>array(83,-158,813,729),19937=>array(83,-158,813,729),19938=>array(83,-158,813,729),19939=>array(83,-158,813,729),19940=>array(83,-158,813,729),19941=>array(83,-158,814,729),19942=>array(83,-158,813,729),19943=>array(83,-158,813,729),19944=>array(83,-158,814,729),19945=>array(83,-158,813,729),19946=>array(83,-158,814,729),19947=>array(83,-158,813,729),19948=>array(83,-158,814,729),19949=>array(83,-158,813,729),19950=>array(83,-158,814,729),19951=>array(83,-158,813,729),19952=>array(83,-158,814,729),19953=>array(83,-158,813,729),19954=>array(83,-158,813,729),19955=>array(83,-158,813,729),19956=>array(83,-158,813,729),19957=>array(83,-158,814,729),19958=>array(83,-158,813,729),19959=>array(83,-158,813,729),19960=>array(83,-158,813,729),19961=>array(83,-158,814,729),19962=>array(83,-158,813,729),19963=>array(83,-158,814,729),19964=>array(83,-158,814,729),19965=>array(83,-158,813,729),19966=>array(83,-158,813,729),19967=>array(83,-158,813,729),42192=>array(98,0,615,729),42193=>array(98,0,569,729),42194=>array(34,0,505,729),42195=>array(98,0,711,729),42196=>array(-3,0,614,729),42197=>array(-3,0,614,729),42198=>array(56,-14,693,742),42199=>array(98,0,677,729),42200=>array(-21,0,558,729),42201=>array(0,-14,414,729),42202=>array(56,-14,644,742),42203=>array(56,-14,644,742),42204=>array(45,0,640,729),42205=>array(98,0,517,729),42206=>array(98,0,517,729),42207=>array(98,0,765,729),42208=>array(98,0,650,729),42209=>array(98,0,552,729),42210=>array(66,-14,579,742),42211=>array(98,0,666,729),42212=>array(29,0,597,729),42213=>array(8,0,676,729),42214=>array(8,0,676,729),42215=>array(98,0,654,729),42216=>array(80,-14,716,742),42217=>array(98,0,512,743),42218=>array(33,0,956,729),42219=>array(30,0,654,729),42220=>array(-2,0,613,729),42221=>array(71,0,588,729),42222=>array(8,0,676,729),42223=>array(8,0,676,729),42224=>array(98,0,568,729),42225=>array(64,0,534,729),42226=>array(98,0,197,729),42227=>array(56,-14,731,742),42228=>array(87,-14,645,729),42229=>array(87,0,645,743),42230=>array(4,0,458,729),42231=>array(56,0,669,729),42232=>array(85,0,214,155),42233=>array(71,-156,214,155),42234=>array(85,0,511,155),42235=>array(85,-156,511,155),42236=>array(71,-156,214,517),42237=>array(85,0,214,517),42238=>array(85,0,502,354),42239=>array(85,172,502,454),42564=>array(56,-14,569,742),42565=>array(49,-14,467,560),42566=>array(98,0,347,729),42567=>array(81,0,304,547),42572=>array(58,-14,1122,645),42573=>array(74,-14,954,471),42576=>array(29,0,931,729),42577=>array(30,0,817,560),42580=>array(56,-14,977,742),42581=>array(55,-14,748,560),42582=>array(103,0,968,729),42583=>array(94,-14,752,560),42594=>array(49,-157,1004,729),42595=>array(52,-138,863,547),42596=>array(41,0,1008,729),42597=>array(37,0,852,547),42598=>array(98,0,1120,729),42599=>array(91,0,959,547),42600=>array(56,-14,731,742),42601=>array(55,-14,557,560),42602=>array(56,-14,799,742),42603=>array(55,-14,658,560),42604=>array(56,-14,1302,742),42605=>array(55,-14,964,560),42606=>array(28,-208,851,743),42634=>array(-3,-200,758,729),42635=>array(29,-208,660,547),42636=>array(-3,0,614,729),42637=>array(29,0,553,547),42644=>array(85,0,587,729),42645=>array(91,0,549,760),42760=>array(104,0,389,668),42761=>array(104,0,389,668),42762=>array(104,0,389,668),42763=>array(104,0,389,668),42764=>array(104,0,389,668),42765=>array(104,0,389,668),42766=>array(104,0,389,668),42767=>array(104,0,389,668),42768=>array(104,0,389,668),42769=>array(104,0,389,668),42770=>array(104,0,389,668),42771=>array(104,0,389,668),42772=>array(104,0,389,668),42773=>array(104,0,389,668),42774=>array(104,0,389,668),42779=>array(50,326,319,736),42780=>array(50,324,319,734),42781=>array(95,326,158,734),42782=>array(95,326,158,734),42783=>array(95,0,158,408),42786=>array(67,0,350,729),42787=>array(67,0,321,547),42788=>array(56,224,411,742),42789=>array(56,42,411,560),42790=>array(98,-200,654,729),42791=>array(91,-208,549,760),42792=>array(-3,-213,819,729),42793=>array(27,-213,650,702),42794=>array(80,-14,560,742),42795=>array(65,-200,473,561),42800=>array(91,0,437,547),42801=>array(54,-14,472,560),42802=>array(8,0,1241,729),42803=>array(60,-14,894,560),42804=>array(8,-14,1147,742),42805=>array(60,-14,935,560),42806=>array(8,-14,1055,729),42807=>array(60,-14,890,560),42808=>array(8,0,963,729),42809=>array(60,-14,788,560),42810=>array(8,0,963,729),42811=>array(60,-14,788,560),42812=>array(8,-208,951,729),42813=>array(60,-208,788,560),42814=>array(56,-14,644,742),42815=>array(62,-14,495,560),42816=>array(5,0,677,729),42817=>array(7,0,580,760),42822=>array(98,0,675,729),42823=>array(94,0,298,760),42824=>array(41,0,576,729),42825=>array(59,0,368,760),42826=>array(5,-14,802,742),42827=>array(5,-14,694,560),42830=>array(56,-14,1302,742),42831=>array(55,-14,964,560),42832=>array(5,0,569,729),42833=>array(-2,-208,580,560),42834=>array(24,0,700,729),42835=>array(24,-208,720,560),42838=>array(56,-178,731,742),42839=>array(55,-208,637,560),42852=>array(5,0,569,729),42853=>array(-2,-208,580,760),42854=>array(5,0,569,729),42855=>array(-2,-208,580,760),42880=>array(5,0,459,729),42881=>array(94,-208,184,560),42882=>array(98,-208,637,742),42883=>array(91,-208,549,560),42889=>array(117,0,220,517),42890=>array(78,161,298,380),42891=>array(151,235,250,729),42892=>array(96,458,179,729),42893=>array(85,0,587,729),42894=>array(38,-208,416,760),42896=>array(98,-157,733,729),42897=>array(91,-138,621,560),42912=>array(2,-14,778,742),42913=>array(2,-208,633,560),42914=>array(2,0,677,729),42915=>array(2,0,577,760),42916=>array(2,0,746,729),42917=>array(2,0,633,560),42918=>array(2,0,693,729),42919=>array(2,0,411,560),42920=>array(2,-14,633,742),42921=>array(2,-14,519,560),42922=>array(-51,0,703,729),43002=>array(91,0,824,547),43003=>array(58,0,477,729),43004=>array(34,0,505,729),43005=>array(98,0,765,729),43006=>array(98,0,197,928),43007=>array(33,0,1167,729),61184=>array(95,602,323,668),61185=>array(69,451,342,668),61186=>array(54,301,361,668),61187=>array(47,150,368,668),61188=>array(44,0,372,668),61189=>array(69,451,342,668),61190=>array(95,451,323,518),61191=>array(69,301,342,518),61192=>array(54,150,361,518),61193=>array(47,0,368,518),61194=>array(54,301,361,668),61195=>array(69,301,342,518),61196=>array(95,301,323,367),61197=>array(69,150,342,367),61198=>array(54,0,361,367),61199=>array(47,150,368,668),61200=>array(54,150,361,518),61201=>array(69,150,342,367),61202=>array(95,150,323,217),61203=>array(69,0,342,217),61204=>array(44,0,372,668),61205=>array(47,0,368,518),61206=>array(54,0,361,367),61207=>array(69,0,342,217),61208=>array(95,0,323,66),61209=>array(104,0,171,668),61440=>array(73,0,903,732),61441=>array(73,0,903,732),61442=>array(73,0,903,732),61443=>array(73,0,903,732),62464=>array(54,-15,526,828),62465=>array(54,-15,526,828),62466=>array(54,-15,570,837),62467=>array(54,0,835,837),62468=>array(54,-15,526,837),62469=>array(54,-15,526,837),62470=>array(54,-15,599,837),62471=>array(54,-15,828,837),62472=>array(54,0,501,837),62473=>array(54,-15,526,828),62474=>array(54,0,1115,837),62475=>array(54,-15,525,837),62476=>array(63,-15,536,828),62477=>array(54,0,815,837),62478=>array(54,-15,526,828),62479=>array(54,-15,526,844),62480=>array(54,0,860,837),62481=>array(63,-15,536,828),62482=>array(54,-15,677,837),62483=>array(24,-15,519,837),62484=>array(54,-15,818,837),62485=>array(54,-15,526,828),62486=>array(54,-15,841,837),62487=>array(54,-15,525,829),62488=>array(54,-15,525,837),62489=>array(64,0,536,837),62490=>array(55,-15,595,828),62491=>array(54,-15,525,828),62492=>array(64,-15,536,837),62493=>array(54,-15,545,828),62494=>array(63,-15,536,828),62495=>array(24,-15,492,837),62496=>array(54,-15,526,837),62497=>array(59,-15,530,837),62498=>array(54,-79,526,837),62499=>array(54,-15,525,838),62500=>array(54,-15,532,838),62501=>array(54,-15,594,837),62502=>array(54,-15,901,838),62504=>array(60,-235,872,816),62505=>array(49,-230,759,853),62506=>array(49,-15,459,765),62507=>array(49,-15,459,777),62508=>array(49,-15,459,875),62509=>array(49,-15,459,818),62510=>array(49,-15,459,887),62511=>array(49,-15,459,809),62512=>array(49,-236,449,765),62513=>array(49,-236,449,799),62514=>array(49,-236,449,901),62515=>array(49,-236,449,809),62516=>array(49,0,469,765),62517=>array(49,0,469,799),62518=>array(49,0,469,809),62519=>array(49,-0,737,765),62520=>array(49,-0,737,777),62521=>array(49,-0,737,895),62522=>array(49,-0,737,799),62523=>array(49,-0,737,809),62524=>array(29,-236,488,765),62525=>array(29,-236,488,777),62526=>array(29,-236,488,904),62527=>array(29,-236,488,799),62528=>array(29,-236,488,809),62529=>array(29,-236,488,852),63173=>array(55,-14,557,760),64256=>array(23,0,708,760),64257=>array(23,0,536,760),64258=>array(23,0,536,760),64259=>array(23,0,873,760),64260=>array(23,0,873,760),64261=>array(23,0,662,760),64262=>array(54,-14,837,742),64275=>array(83,-14,1111,760),64276=>array(85,-14,1111,760),64277=>array(85,-208,1111,760),64278=>array(85,-208,1111,760),64279=>array(85,-208,1451,760),64285=>array(66,44,157,547),64286=>array(167,625,473,765),64287=>array(36,44,329,547),64288=>array(38,0,562,547),64289=>array(85,0,772,547),64290=>array(43,0,717,547),64291=>array(91,0,764,547),64292=>array(43,0,716,547),64293=>array(43,0,716,760),64294=>array(91,0,764,547),64295=>array(43,0,716,547),64296=>array(47,-4,716,547),64297=>array(106,272,732,627),64298=>array(43,0,666,698),64299=>array(38,0,666,698),64300=>array(43,0,666,698),64301=>array(43,0,666,698),64302=>array(91,-159,578,547),64303=>array(91,-193,578,547),64304=>array(91,-159,578,547),64305=>array(43,0,535,547),64306=>array(43,-5,383,547),64307=>array(43,0,511,547),64308=>array(91,0,563,547),64309=>array(43,0,265,547),64310=>array(43,0,363,547),64312=>array(90,-14,593,552),64313=>array(43,204,264,547),64314=>array(43,-208,446,547),64315=>array(43,0,474,547),64316=>array(43,0,492,729),64318=>array(43,0,588,555),64320=>array(43,0,309,547),64321=>array(90,-14,593,547),64323=>array(91,-208,549,547),64324=>array(91,0,569,547),64326=>array(43,0,502,547),64327=>array(91,-208,633,546),64328=>array(43,0,474,547),64329=>array(43,0,666,547),64330=>array(10,-4,566,547),64331=>array(91,0,182,698),64332=>array(43,0,535,698),64333=>array(43,0,474,698),64334=>array(91,0,569,698),64335=>array(43,0,571,760),64338=>array(63,-244,865,327),64339=>array(63,-244,992,327),64340=>array(-10,-244,191,293),64341=>array(-10,-244,312,293),64342=>array(63,-244,865,327),64343=>array(63,-244,992,327),64344=>array(-10,-244,244,293),64345=>array(-10,-244,312,293),64346=>array(63,-244,865,327),64347=>array(63,-244,992,327),64348=>array(-10,-244,244,293),64349=>array(-10,-244,312,293),64350=>array(63,-10,865,513),64351=>array(63,-10,992,513),64352=>array(-10,0,191,610),64353=>array(-10,0,312,610),64354=>array(63,-10,865,513),64355=>array(63,-10,992,513),64356=>array(-10,0,244,610),64357=>array(-10,0,312,610),64358=>array(63,-10,865,575),64359=>array(63,-10,992,575),64360=>array(-10,0,273,672),64361=>array(-10,0,312,672),64362=>array(63,-45,952,757),64363=>array(63,-44,1045,659),64364=>array(-10,0,406,757),64365=>array(-10,0,516,684),64366=>array(63,-45,952,757),64367=>array(63,-44,1045,659),64368=>array(-10,0,406,757),64369=>array(-10,0,516,684),64370=>array(77,-244,645,425),64371=>array(77,-244,655,425),64372=>array(-10,-220,545,398),64373=>array(-10,-220,655,398),64374=>array(77,-244,645,425),64375=>array(77,-244,655,425),64376=>array(-10,-98,545,398),64377=>array(-10,-98,655,398),64378=>array(77,-244,645,425),64379=>array(77,-244,655,425),64380=>array(-10,-220,545,398),64381=>array(-10,-220,655,398),64382=>array(77,-244,645,425),64383=>array(77,-244,655,425),64384=>array(-10,-220,545,398),64385=>array(-10,-220,655,398),64386=>array(61,-146,388,415),64387=>array(61,-146,535,415),64388=>array(61,-19,388,586),64389=>array(61,-19,535,586),64390=>array(61,-19,388,708),64391=>array(61,-19,535,708),64392=>array(61,-19,388,746),64393=>array(61,-19,535,746),64394=>array(-42,-244,439,586),64395=>array(-42,-244,562,586),64396=>array(-42,-244,469,648),64397=>array(-42,-244,562,648),64398=>array(63,-43,895,760),64399=>array(63,-43,981,760),64400=>array(-10,0,476,760),64401=>array(-10,0,562,760),64402=>array(63,-43,895,896),64403=>array(63,-43,981,896),64404=>array(-10,0,476,896),64405=>array(-10,0,562,896),64406=>array(63,-293,895,896),64407=>array(63,-293,981,896),64408=>array(-10,-269,476,896),64409=>array(-10,-269,562,896),64410=>array(63,-43,895,903),64411=>array(63,-43,981,903),64412=>array(-10,0,476,903),64413=>array(-10,0,562,903),64414=>array(72,-162,660,366),64415=>array(72,-244,771,284),64416=>array(72,-162,660,636),64417=>array(72,-244,771,514),64418=>array(-10,0,273,672),64419=>array(-10,0,312,672),64426=>array(70,-33,638,487),64427=>array(70,-244,642,333),64428=>array(-10,-33,467,487),64429=>array(-10,-244,471,333),64467=>array(70,-27,722,854),64468=>array(70,-27,853,854),64469=>array(-10,0,476,928),64470=>array(-10,0,562,928),64473=>array(-42,-244,406,556),64474=>array(-42,-244,526,556),64488=>array(-10,0,191,293),64489=>array(-10,0,312,293),64508=>array(63,-131,719,411),64509=>array(63,-133,843,251),64510=>array(-10,-146,244,293),64511=>array(-10,-146,312,293),65056=>array(-445,752,0,929),65057=>array(0,752,445,929),65058=>array(-354,756,0,894),65059=>array(0,756,354,894),65136=>array(4,591,289,825),65137=>array(-10,0,303,825),65138=>array(4,591,289,874),65139=>array(51,0,271,177),65140=>array(4,-239,289,-5),65142=>array(4,591,289,708),65143=>array(-10,0,303,708),65144=>array(4,590,289,874),65145=>array(-10,0,303,874),65146=>array(4,-137,289,-20),65147=>array(-10,-137,303,90),65148=>array(-6,599,299,869),65149=>array(-10,0,303,869),65150=>array(12,610,279,878),65151=>array(-10,0,303,878),65152=>array(80,42,390,483),65153=>array(-37,0,315,939),65154=>array(-37,0,315,939),65155=>array(53,0,220,1028),65156=>array(53,0,314,1028),65157=>array(-42,-244,406,588),65158=>array(-42,-244,526,588),65159=>array(53,-244,220,760),65160=>array(53,-244,314,760),65161=>array(63,-131,719,588),65162=>array(63,-133,843,466),65163=>array(-10,0,227,613),65164=>array(-10,0,312,613),65165=>array(94,0,184,760),65166=>array(94,0,314,760),65167=>array(63,-171,865,327),65168=>array(63,-171,992,327),65169=>array(-10,-146,191,293),65170=>array(-10,-146,312,293),65171=>array(68,-28,453,513),65172=>array(71,0,546,513),65173=>array(63,-10,865,391),65174=>array(63,-10,992,391),65175=>array(-10,0,244,488),65176=>array(-10,0,312,488),65177=>array(63,-10,865,513),65178=>array(63,-10,992,513),65179=>array(-10,0,244,610),65180=>array(-10,0,312,610),65181=>array(77,-244,645,425),65182=>array(77,-244,655,425),65183=>array(-10,-146,545,398),65184=>array(-10,-146,655,398),65185=>array(77,-244,645,425),65186=>array(77,-244,655,425),65187=>array(-10,0,545,398),65188=>array(-10,0,655,398),65189=>array(77,-244,645,586),65190=>array(77,-244,655,586),65191=>array(-10,0,545,537),65192=>array(-10,0,655,537),65193=>array(61,-19,388,415),65194=>array(61,-19,535,415),65195=>array(61,-19,388,586),65196=>array(61,-19,535,586),65197=>array(-42,-244,423,269),65198=>array(-42,-244,562,269),65199=>array(-42,-244,423,464),65200=>array(-42,-244,562,464),65201=>array(63,-244,1138,366),65202=>array(63,-244,1285,366),65203=>array(-10,-14,755,366),65204=>array(-10,-14,902,366),65205=>array(63,-244,1138,586),65206=>array(63,-244,1285,586),65207=>array(-10,-14,755,586),65208=>array(-10,-14,902,586),65209=>array(63,-244,1134,362),65210=>array(63,-244,1235,362),65211=>array(-10,0,774,362),65212=>array(-10,0,877,362),65213=>array(63,-244,1134,464),65214=>array(63,-244,1235,464),65215=>array(-10,0,774,464),65216=>array(-10,0,877,464),65217=>array(70,0,857,760),65218=>array(70,0,959,760),65219=>array(-10,0,729,760),65220=>array(-10,0,830,760),65221=>array(70,0,857,760),65222=>array(70,0,959,760),65223=>array(-10,0,729,760),65224=>array(-10,0,830,760),65225=>array(57,-244,587,521),65226=>array(57,-244,587,382),65227=>array(-10,0,496,521),65228=>array(-10,0,492,382),65229=>array(57,-244,587,659),65230=>array(57,-244,587,537),65231=>array(-10,0,496,659),65232=>array(-10,0,492,537),65233=>array(63,-45,952,635),65234=>array(63,-44,1045,537),65235=>array(-10,0,406,635),65236=>array(-10,0,516,562),65237=>array(52,-215,701,635),65238=>array(52,-244,844,500),65239=>array(-10,0,406,635),65240=>array(-10,0,516,562),65241=>array(70,-27,722,760),65242=>array(70,-27,853,760),65243=>array(-10,0,476,760),65244=>array(-10,0,562,760),65245=>array(70,-152,637,760),65246=>array(70,-152,767,760),65247=>array(-10,0,210,760),65248=>array(-10,0,341,760),65249=>array(68,-240,546,369),65250=>array(68,-240,675,307),65251=>array(-10,-25,456,303),65252=>array(-10,-24,588,303),65253=>array(72,-162,660,464),65254=>array(72,-244,771,342),65255=>array(-10,0,191,488),65256=>array(-10,0,312,488),65257=>array(68,-28,453,358),65258=>array(71,0,546,366),65259=>array(-10,-33,467,487),65260=>array(-10,-244,471,333),65261=>array(-42,-244,406,315),65262=>array(-42,-244,526,315),65263=>array(63,-131,719,411),65264=>array(63,-133,843,251),65265=>array(63,-244,719,411),65266=>array(63,-244,843,251),65267=>array(-10,-146,244,293),65268=>array(-10,-146,312,293),65269=>array(-103,-10,468,866),65270=>array(-103,-10,606,866),65271=>array(-13,-10,468,955),65272=>array(-13,-10,606,955),65273=>array(11,-244,468,760),65274=>array(11,-244,606,760),65275=>array(41,-10,468,760),65276=>array(41,-10,606,760),65533=>array(15,-84,1011,912),65535=>array(50,-177,550,705)); +$cw=array(0=>600,32=>318,33=>401,34=>460,35=>838,36=>636,37=>950,38=>780,39=>275,40=>390,41=>390,42=>500,43=>838,44=>318,45=>361,46=>318,47=>337,48=>636,49=>636,50=>636,51=>636,52=>636,53=>636,54=>636,55=>636,56=>636,57=>636,58=>337,59=>337,60=>838,61=>838,62=>838,63=>531,64=>1000,65=>684,66=>686,67=>698,68=>770,69=>632,70=>575,71=>775,72=>752,73=>295,74=>295,75=>656,76=>557,77=>863,78=>748,79=>787,80=>603,81=>787,82=>695,83=>635,84=>611,85=>732,86=>684,87=>989,88=>685,89=>611,90=>685,91=>390,92=>337,93=>390,94=>838,95=>500,96=>500,97=>613,98=>635,99=>550,100=>635,101=>615,102=>352,103=>635,104=>634,105=>278,106=>278,107=>579,108=>278,109=>974,110=>634,111=>612,112=>635,113=>635,114=>411,115=>521,116=>392,117=>634,118=>592,119=>818,120=>592,121=>592,122=>525,123=>636,124=>337,125=>636,126=>838,160=>318,161=>401,162=>636,163=>636,164=>636,165=>636,166=>337,167=>500,168=>500,169=>1000,170=>471,171=>612,172=>838,173=>361,174=>1000,175=>500,176=>500,177=>838,178=>401,179=>401,180=>500,181=>636,182=>636,183=>318,184=>500,185=>401,186=>471,187=>612,188=>969,189=>969,190=>969,191=>531,192=>684,193=>684,194=>684,195=>684,196=>684,197=>684,198=>974,199=>698,200=>632,201=>632,202=>632,203=>632,204=>295,205=>295,206=>295,207=>295,208=>775,209=>748,210=>787,211=>787,212=>787,213=>787,214=>787,215=>838,216=>787,217=>732,218=>732,219=>732,220=>732,221=>611,222=>605,223=>630,224=>613,225=>613,226=>613,227=>613,228=>613,229=>613,230=>982,231=>550,232=>615,233=>615,234=>615,235=>615,236=>278,237=>278,238=>278,239=>278,240=>612,241=>634,242=>612,243=>612,244=>612,245=>612,246=>612,247=>838,248=>612,249=>634,250=>634,251=>634,252=>634,253=>592,254=>635,255=>592,256=>684,257=>613,258=>684,259=>613,260=>684,261=>613,262=>698,263=>550,264=>698,265=>550,266=>698,267=>550,268=>698,269=>550,270=>770,271=>635,272=>775,273=>635,274=>632,275=>615,276=>632,277=>615,278=>632,279=>615,280=>632,281=>615,282=>632,283=>615,284=>775,285=>635,286=>775,287=>635,288=>775,289=>635,290=>775,291=>635,292=>752,293=>634,294=>916,295=>695,296=>295,297=>278,298=>295,299=>278,300=>295,301=>278,302=>295,303=>278,304=>295,305=>278,306=>590,307=>556,308=>295,309=>278,310=>656,311=>579,312=>579,313=>557,314=>278,315=>557,316=>278,317=>557,318=>375,319=>557,320=>342,321=>562,322=>284,323=>748,324=>634,325=>748,326=>634,327=>748,328=>634,329=>813,330=>748,331=>634,332=>787,333=>612,334=>787,335=>612,336=>787,337=>612,338=>1070,339=>1023,340=>695,341=>411,342=>695,343=>411,344=>695,345=>411,346=>635,347=>521,348=>635,349=>521,350=>635,351=>521,352=>635,353=>521,354=>611,355=>392,356=>611,357=>392,358=>611,359=>392,360=>732,361=>634,362=>732,363=>634,364=>732,365=>634,366=>732,367=>634,368=>732,369=>634,370=>732,371=>634,372=>989,373=>818,374=>611,375=>592,376=>611,377=>685,378=>525,379=>685,380=>525,381=>685,382=>525,383=>352,384=>635,385=>735,386=>686,387=>635,388=>686,389=>635,390=>703,391=>698,392=>550,393=>775,394=>819,395=>686,396=>635,397=>612,398=>632,399=>787,400=>614,401=>575,402=>352,403=>775,404=>687,405=>984,406=>354,407=>295,408=>746,409=>579,410=>278,411=>592,412=>974,413=>748,414=>634,415=>787,416=>913,417=>612,418=>949,419=>759,420=>652,421=>635,422=>695,423=>635,424=>521,425=>632,426=>336,427=>392,428=>611,429=>392,430=>611,431=>858,432=>634,433=>764,434=>721,435=>744,436=>730,437=>685,438=>525,439=>666,440=>666,441=>578,442=>525,443=>636,444=>666,445=>578,446=>510,447=>635,448=>295,449=>492,450=>459,451=>295,452=>1422,453=>1299,454=>1154,455=>835,456=>787,457=>457,458=>931,459=>924,460=>797,461=>684,462=>613,463=>295,464=>278,465=>787,466=>612,467=>732,468=>634,469=>732,470=>634,471=>732,472=>634,473=>732,474=>634,475=>732,476=>634,477=>615,478=>684,479=>613,480=>684,481=>613,482=>974,483=>982,484=>775,485=>635,486=>775,487=>635,488=>656,489=>579,490=>787,491=>612,492=>787,493=>612,494=>666,495=>578,496=>278,497=>1422,498=>1299,499=>1154,500=>775,501=>635,502=>1113,503=>682,504=>748,505=>634,506=>684,507=>613,508=>974,509=>982,510=>787,511=>612,512=>684,513=>613,514=>684,515=>613,516=>632,517=>615,518=>632,519=>615,520=>295,521=>278,522=>295,523=>278,524=>787,525=>612,526=>787,527=>612,528=>695,529=>411,530=>695,531=>411,532=>732,533=>634,534=>732,535=>634,536=>635,537=>521,538=>611,539=>392,540=>627,541=>521,542=>752,543=>634,544=>735,545=>838,546=>698,547=>610,548=>685,549=>525,550=>684,551=>613,552=>632,553=>615,554=>787,555=>612,556=>787,557=>612,558=>787,559=>612,560=>787,561=>612,562=>611,563=>592,564=>475,565=>843,566=>477,567=>278,568=>998,569=>998,570=>684,571=>698,572=>550,573=>557,574=>611,575=>521,576=>525,577=>603,578=>479,579=>686,580=>732,581=>684,582=>632,583=>615,584=>295,585=>278,586=>781,587=>635,588=>695,589=>411,590=>611,591=>592,592=>600,593=>635,594=>635,595=>635,596=>549,597=>550,598=>635,599=>696,600=>615,601=>615,602=>819,603=>541,604=>532,605=>775,606=>664,607=>278,608=>696,609=>635,610=>629,611=>596,612=>596,613=>634,614=>634,615=>634,616=>278,617=>338,618=>372,619=>396,620=>487,621=>278,622=>706,623=>974,624=>974,625=>974,626=>646,627=>642,628=>634,629=>612,630=>858,631=>728,632=>660,633=>414,634=>414,635=>414,636=>411,637=>411,638=>530,639=>530,640=>604,641=>604,642=>521,643=>336,644=>336,645=>461,646=>336,647=>392,648=>392,649=>634,650=>618,651=>598,652=>592,653=>818,654=>592,655=>611,656=>525,657=>525,658=>578,659=>578,660=>510,661=>510,662=>510,663=>510,664=>787,665=>580,666=>664,667=>708,668=>654,669=>292,670=>667,671=>507,672=>727,673=>510,674=>510,675=>1014,676=>1058,677=>1013,678=>830,679=>610,680=>778,681=>848,682=>706,683=>654,684=>515,685=>515,686=>661,687=>664,688=>404,689=>399,690=>175,691=>259,692=>295,693=>296,694=>379,695=>515,696=>373,697=>278,698=>460,699=>318,700=>318,701=>318,702=>307,703=>307,704=>370,705=>370,706=>500,707=>500,708=>500,709=>500,710=>500,711=>500,712=>275,713=>500,714=>500,715=>500,716=>275,717=>500,718=>500,719=>500,720=>337,721=>337,722=>307,723=>307,724=>500,725=>500,726=>390,727=>317,728=>500,729=>500,730=>500,731=>500,732=>500,733=>500,734=>315,735=>500,736=>426,737=>166,738=>373,739=>444,740=>370,741=>493,742=>493,743=>493,744=>493,745=>493,748=>500,749=>500,750=>518,755=>500,759=>500,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0,860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>654,881=>568,882=>862,883=>647,884=>278,885=>278,886=>748,887=>650,890=>500,891=>549,892=>550,893=>549,894=>337,900=>500,901=>500,902=>692,903=>318,904=>746,905=>871,906=>408,908=>813,910=>825,911=>826,912=>338,913=>684,914=>686,915=>557,916=>684,917=>632,918=>685,919=>752,920=>787,921=>295,922=>656,923=>684,924=>863,925=>748,926=>632,927=>787,928=>752,929=>603,931=>632,932=>611,933=>611,934=>787,935=>685,936=>787,937=>764,938=>295,939=>611,940=>659,941=>541,942=>634,943=>338,944=>579,945=>659,946=>638,947=>592,948=>612,949=>541,950=>544,951=>634,952=>612,953=>338,954=>589,955=>592,956=>636,957=>559,958=>558,959=>612,960=>602,961=>635,962=>587,963=>634,964=>602,965=>579,966=>660,967=>578,968=>660,969=>837,970=>338,971=>579,972=>612,973=>579,974=>837,975=>656,976=>614,977=>619,978=>699,979=>842,980=>699,981=>660,982=>837,983=>664,984=>787,985=>612,986=>648,987=>587,988=>575,989=>458,990=>660,991=>660,992=>865,993=>627,994=>934,995=>837,996=>758,997=>659,998=>792,999=>615,1000=>687,1001=>607,1002=>768,1003=>625,1004=>699,1005=>612,1006=>611,1007=>536,1008=>664,1009=>635,1010=>550,1011=>278,1012=>787,1013=>615,1014=>615,1015=>605,1016=>635,1017=>698,1018=>863,1019=>651,1020=>635,1021=>703,1022=>698,1023=>703,1024=>632,1025=>632,1026=>786,1027=>610,1028=>698,1029=>635,1030=>295,1031=>295,1032=>295,1033=>1094,1034=>1045,1035=>786,1036=>710,1037=>748,1038=>609,1039=>752,1040=>684,1041=>686,1042=>686,1043=>610,1044=>781,1045=>632,1046=>1077,1047=>641,1048=>748,1049=>748,1050=>710,1051=>752,1052=>863,1053=>752,1054=>787,1055=>752,1056=>603,1057=>698,1058=>611,1059=>609,1060=>861,1061=>685,1062=>776,1063=>686,1064=>1069,1065=>1094,1066=>833,1067=>882,1068=>686,1069=>698,1070=>1080,1071=>695,1072=>613,1073=>617,1074=>589,1075=>525,1076=>691,1077=>615,1078=>901,1079=>532,1080=>650,1081=>650,1082=>604,1083=>639,1084=>754,1085=>654,1086=>612,1087=>654,1088=>635,1089=>550,1090=>583,1091=>592,1092=>855,1093=>592,1094=>681,1095=>591,1096=>915,1097=>942,1098=>707,1099=>790,1100=>589,1101=>549,1102=>842,1103=>602,1104=>615,1105=>615,1106=>625,1107=>525,1108=>549,1109=>521,1110=>278,1111=>278,1112=>278,1113=>902,1114=>898,1115=>652,1116=>604,1117=>650,1118=>592,1119=>654,1120=>934,1121=>837,1122=>771,1123=>672,1124=>942,1125=>749,1126=>879,1127=>783,1128=>1160,1129=>1001,1130=>787,1131=>612,1132=>1027,1133=>824,1134=>636,1135=>541,1136=>856,1137=>876,1138=>787,1139=>612,1140=>781,1141=>665,1142=>781,1143=>665,1144=>992,1145=>904,1146=>953,1147=>758,1148=>1180,1149=>1028,1150=>934,1151=>837,1152=>698,1153=>550,1154=>502,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>418,1161=>418,1162=>772,1163=>677,1164=>686,1165=>589,1166=>603,1167=>635,1168=>610,1169=>525,1170=>675,1171=>590,1172=>624,1173=>530,1174=>1077,1175=>901,1176=>641,1177=>532,1178=>710,1179=>604,1180=>710,1181=>604,1182=>710,1183=>604,1184=>856,1185=>832,1186=>752,1187=>661,1188=>1014,1189=>877,1190=>1081,1191=>916,1192=>878,1193=>693,1194=>698,1195=>550,1196=>611,1197=>583,1198=>611,1199=>592,1200=>611,1201=>592,1202=>685,1203=>592,1204=>934,1205=>807,1206=>686,1207=>591,1208=>686,1209=>591,1210=>686,1211=>634,1212=>941,1213=>728,1214=>941,1215=>728,1216=>295,1217=>1077,1218=>901,1219=>656,1220=>604,1221=>776,1222=>670,1223=>752,1224=>661,1225=>776,1226=>681,1227=>686,1228=>591,1229=>888,1230=>774,1231=>278,1232=>684,1233=>613,1234=>684,1235=>613,1236=>974,1237=>982,1238=>632,1239=>615,1240=>787,1241=>615,1242=>787,1243=>615,1244=>1077,1245=>901,1246=>641,1247=>532,1248=>666,1249=>578,1250=>748,1251=>650,1252=>748,1253=>650,1254=>787,1255=>612,1256=>787,1257=>612,1258=>787,1259=>612,1260=>698,1261=>549,1262=>609,1263=>592,1264=>609,1265=>592,1266=>609,1267=>592,1268=>686,1269=>591,1270=>610,1271=>525,1272=>882,1273=>790,1274=>675,1275=>590,1276=>685,1277=>592,1278=>685,1279=>592,1280=>686,1281=>589,1282=>1006,1283=>897,1284=>975,1285=>869,1286=>679,1287=>588,1288=>1072,1289=>957,1290=>1113,1291=>967,1292=>775,1293=>660,1294=>773,1295=>711,1296=>614,1297=>541,1298=>752,1299=>639,1300=>1169,1301=>994,1302=>894,1303=>864,1304=>1032,1305=>986,1306=>787,1307=>635,1308=>989,1309=>818,1310=>710,1311=>604,1312=>1081,1313=>905,1314=>1081,1315=>912,1316=>793,1317=>683,1329=>766,1330=>732,1331=>753,1332=>753,1333=>732,1334=>772,1335=>640,1336=>732,1337=>859,1338=>753,1339=>691,1340=>533,1341=>922,1342=>863,1343=>732,1344=>716,1345=>766,1346=>753,1347=>767,1348=>792,1349=>728,1350=>729,1351=>757,1352=>732,1353=>713,1354=>800,1355=>768,1356=>792,1357=>732,1358=>753,1359=>705,1360=>694,1361=>744,1362=>538,1363=>811,1364=>757,1365=>787,1366=>790,1369=>307,1370=>318,1371=>234,1372=>361,1373=>238,1374=>405,1375=>500,1377=>974,1378=>634,1379=>658,1380=>663,1381=>634,1382=>635,1383=>515,1384=>634,1385=>738,1386=>658,1387=>634,1388=>271,1389=>980,1390=>623,1391=>634,1392=>634,1393=>608,1394=>634,1395=>629,1396=>634,1397=>271,1398=>634,1399=>499,1400=>634,1401=>404,1402=>974,1403=>560,1404=>648,1405=>634,1406=>634,1407=>974,1408=>634,1409=>633,1410=>435,1411=>974,1412=>636,1413=>609,1414=>805,1415=>812,1417=>337,1418=>361,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0,1467=>0,1468=>0,1469=>0,1470=>361,1471=>0,1472=>295,1473=>0,1474=>0,1475=>295,1478=>441,1479=>0,1488=>668,1489=>578,1490=>412,1491=>546,1492=>653,1493=>272,1494=>346,1495=>653,1496=>648,1497=>224,1498=>537,1499=>529,1500=>568,1501=>664,1502=>679,1503=>272,1504=>400,1505=>649,1506=>626,1507=>640,1508=>625,1509=>540,1510=>593,1511=>709,1512=>564,1513=>708,1514=>657,1520=>471,1521=>423,1522=>331,1523=>416,1524=>645,1542=>637,1543=>637,1545=>757,1546=>977,1548=>323,1557=>0,1563=>318,1567=>531,1569=>470,1570=>278,1571=>278,1572=>483,1573=>278,1574=>783,1575=>278,1576=>941,1577=>524,1578=>941,1579=>941,1580=>646,1581=>646,1582=>646,1583=>445,1584=>445,1585=>483,1586=>483,1587=>1221,1588=>1221,1589=>1209,1590=>1209,1591=>925,1592=>925,1593=>597,1594=>597,1600=>293,1601=>1037,1602=>776,1603=>824,1604=>727,1605=>619,1606=>734,1607=>524,1608=>483,1609=>783,1610=>783,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1619=>0,1620=>0,1621=>0,1623=>0,1626=>500,1632=>537,1633=>537,1634=>537,1635=>537,1636=>537,1637=>537,1638=>537,1639=>537,1640=>537,1641=>537,1642=>537,1643=>325,1644=>318,1645=>545,1646=>941,1647=>776,1648=>0,1652=>292,1657=>941,1658=>941,1659=>941,1660=>941,1661=>941,1662=>941,1663=>941,1664=>941,1665=>646,1666=>646,1667=>646,1668=>646,1669=>646,1670=>646,1671=>646,1672=>445,1673=>445,1674=>445,1675=>445,1676=>445,1677=>445,1678=>445,1679=>445,1680=>445,1681=>483,1682=>483,1683=>498,1684=>530,1685=>610,1686=>530,1687=>483,1688=>483,1689=>483,1690=>1221,1691=>1221,1692=>1221,1693=>1209,1694=>1209,1695=>925,1696=>597,1697=>1037,1698=>1037,1699=>1037,1700=>1037,1701=>1037,1702=>1037,1703=>776,1704=>776,1705=>895,1706=>1054,1707=>895,1708=>824,1709=>824,1710=>824,1711=>895,1712=>895,1713=>895,1714=>895,1715=>895,1716=>895,1717=>727,1718=>727,1719=>727,1720=>727,1721=>734,1722=>734,1723=>734,1724=>734,1725=>734,1726=>698,1727=>646,1734=>483,1740=>783,1742=>783,1749=>524,1776=>537,1777=>537,1778=>537,1779=>537,1780=>537,1781=>537,1782=>537,1783=>537,1784=>537,1785=>537,1984=>636,1985=>636,1986=>636,1987=>636,1988=>636,1989=>636,1990=>636,1991=>636,1992=>636,1993=>636,1994=>278,1995=>571,1996=>424,1997=>592,1998=>654,1999=>654,2000=>594,2001=>654,2002=>829,2003=>438,2004=>438,2005=>559,2006=>612,2007=>350,2008=>959,2009=>473,2010=>783,2011=>654,2012=>625,2013=>734,2014=>530,2015=>724,2016=>473,2017=>625,2018=>594,2019=>530,2020=>530,2021=>522,2022=>594,2023=>594,2027=>0,2028=>0,2029=>0,2030=>0,2031=>0,2032=>0,2033=>0,2034=>0,2035=>0,2036=>313,2037=>313,2040=>560,2041=>560,2042=>361,3647=>636,3713=>670,3714=>684,3716=>688,3719=>482,3720=>628,3722=>684,3725=>688,3732=>669,3733=>642,3734=>645,3735=>655,3737=>659,3738=>625,3739=>625,3740=>745,3741=>767,3742=>687,3743=>687,3745=>702,3746=>688,3747=>684,3749=>649,3751=>632,3754=>703,3755=>819,3757=>633,3758=>684,3759=>788,3760=>632,3761=>0,3762=>539,3763=>539,3764=>0,3765=>0,3766=>0,3767=>0,3768=>0,3769=>0,3771=>0,3772=>0,3773=>663,3776=>375,3777=>657,3778=>460,3779=>547,3780=>491,3782=>674,3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>636,3793=>641,3794=>641,3795=>670,3796=>625,3797=>625,3798=>703,3799=>670,3800=>674,3801=>677,3804=>1028,3805=>1028,4256=>874,4257=>733,4258=>679,4259=>834,4260=>615,4261=>768,4262=>753,4263=>914,4264=>453,4265=>620,4266=>843,4267=>882,4268=>625,4269=>854,4270=>781,4271=>629,4272=>912,4273=>621,4274=>620,4275=>854,4276=>866,4277=>724,4278=>630,4279=>621,4280=>625,4281=>620,4282=>818,4283=>874,4284=>615,4285=>623,4286=>625,4287=>725,4288=>844,4289=>596,4290=>688,4291=>596,4292=>594,4293=>738,4304=>508,4305=>518,4306=>581,4307=>818,4308=>508,4309=>513,4310=>500,4311=>801,4312=>518,4313=>510,4314=>1064,4315=>522,4316=>522,4317=>786,4318=>508,4319=>518,4320=>796,4321=>522,4322=>654,4323=>522,4324=>825,4325=>513,4326=>786,4327=>518,4328=>518,4329=>522,4330=>571,4331=>522,4332=>518,4333=>520,4334=>522,4335=>454,4336=>508,4337=>518,4338=>508,4339=>508,4340=>518,4341=>554,4342=>828,4343=>552,4344=>508,4345=>571,4346=>508,4347=>448,4348=>324,5121=>684,5122=>684,5123=>684,5124=>684,5125=>769,5126=>769,5127=>769,5129=>769,5130=>769,5131=>769,5132=>835,5133=>834,5134=>835,5135=>834,5136=>835,5137=>834,5138=>967,5139=>1007,5140=>967,5141=>1007,5142=>769,5143=>967,5144=>1007,5145=>967,5146=>1007,5147=>769,5149=>256,5150=>543,5151=>423,5152=>423,5153=>389,5154=>389,5155=>393,5156=>389,5157=>466,5158=>385,5159=>256,5160=>389,5161=>389,5162=>389,5163=>1090,5164=>909,5165=>953,5166=>1117,5167=>684,5168=>684,5169=>684,5170=>684,5171=>729,5172=>729,5173=>729,5175=>729,5176=>729,5177=>729,5178=>835,5179=>684,5180=>835,5181=>834,5182=>835,5183=>834,5184=>967,5185=>1007,5186=>967,5187=>1007,5188=>967,5189=>1007,5190=>967,5191=>1007,5192=>729,5193=>508,5194=>192,5196=>732,5197=>732,5198=>732,5199=>732,5200=>730,5201=>730,5202=>730,5204=>730,5205=>730,5206=>730,5207=>921,5208=>889,5209=>921,5210=>889,5211=>921,5212=>889,5213=>928,5214=>900,5215=>928,5216=>900,5217=>947,5218=>900,5219=>947,5220=>900,5221=>947,5222=>434,5223=>877,5224=>877,5225=>866,5226=>890,5227=>628,5228=>628,5229=>628,5230=>628,5231=>628,5232=>628,5233=>628,5234=>628,5235=>628,5236=>860,5237=>771,5238=>815,5239=>816,5240=>815,5241=>816,5242=>860,5243=>771,5244=>860,5245=>771,5246=>815,5247=>816,5248=>815,5249=>816,5250=>815,5251=>407,5252=>407,5253=>750,5254=>775,5255=>750,5256=>775,5257=>628,5258=>628,5259=>628,5260=>628,5261=>628,5262=>628,5263=>628,5264=>628,5265=>628,5266=>860,5267=>771,5268=>815,5269=>816,5270=>815,5271=>816,5272=>860,5273=>771,5274=>860,5275=>771,5276=>815,5277=>816,5278=>815,5279=>816,5280=>815,5281=>435,5282=>435,5283=>610,5284=>557,5285=>557,5286=>557,5287=>610,5288=>610,5289=>610,5290=>557,5291=>557,5292=>749,5293=>769,5294=>746,5295=>764,5296=>746,5297=>764,5298=>749,5299=>769,5300=>749,5301=>769,5302=>746,5303=>764,5304=>746,5305=>764,5306=>746,5307=>386,5308=>508,5309=>386,5312=>852,5313=>852,5314=>852,5315=>852,5316=>852,5317=>852,5318=>852,5319=>852,5320=>852,5321=>1069,5322=>1035,5323=>1059,5324=>852,5325=>1059,5326=>852,5327=>852,5328=>600,5329=>453,5330=>600,5331=>852,5332=>852,5333=>852,5334=>852,5335=>852,5336=>852,5337=>852,5338=>852,5339=>852,5340=>1069,5341=>1035,5342=>1059,5343=>1030,5344=>1059,5345=>1030,5346=>1069,5347=>1035,5348=>1069,5349=>1035,5350=>1083,5351=>1030,5352=>1083,5353=>1030,5354=>600,5356=>729,5357=>603,5358=>603,5359=>603,5360=>603,5361=>603,5362=>603,5363=>603,5364=>603,5365=>603,5366=>834,5367=>754,5368=>792,5369=>771,5370=>792,5371=>771,5372=>834,5373=>754,5374=>834,5375=>754,5376=>792,5377=>771,5378=>792,5379=>771,5380=>792,5381=>418,5382=>420,5383=>418,5392=>712,5393=>712,5394=>712,5395=>892,5396=>892,5397=>892,5398=>892,5399=>910,5400=>872,5401=>910,5402=>872,5403=>910,5404=>872,5405=>1140,5406=>1100,5407=>1140,5408=>1100,5409=>1140,5410=>1100,5411=>1140,5412=>1100,5413=>641,5414=>627,5415=>627,5416=>627,5417=>627,5418=>627,5419=>627,5420=>627,5421=>627,5422=>627,5423=>844,5424=>781,5425=>816,5426=>818,5427=>816,5428=>818,5429=>844,5430=>781,5431=>844,5432=>781,5433=>816,5434=>818,5435=>816,5436=>818,5437=>816,5438=>418,5440=>389,5441=>484,5442=>916,5443=>916,5444=>916,5445=>916,5446=>916,5447=>916,5448=>603,5449=>603,5450=>603,5451=>603,5452=>603,5453=>603,5454=>834,5455=>754,5456=>418,5458=>729,5459=>684,5460=>684,5461=>684,5462=>684,5463=>726,5464=>726,5465=>726,5466=>726,5467=>924,5468=>1007,5469=>508,5470=>732,5471=>732,5472=>732,5473=>732,5474=>732,5475=>732,5476=>730,5477=>730,5478=>730,5479=>730,5480=>947,5481=>900,5482=>508,5492=>831,5493=>831,5494=>831,5495=>831,5496=>831,5497=>831,5498=>831,5499=>563,5500=>752,5501=>484,5502=>1047,5503=>1047,5504=>1047,5505=>1047,5506=>1047,5507=>1047,5508=>1047,5509=>825,5514=>831,5515=>831,5516=>831,5517=>831,5518=>1259,5519=>1259,5520=>1259,5521=>1002,5522=>1002,5523=>1259,5524=>1259,5525=>700,5526=>1073,5536=>852,5537=>852,5538=>852,5539=>852,5540=>852,5541=>852,5542=>600,5543=>643,5544=>643,5545=>643,5546=>643,5547=>643,5548=>643,5549=>643,5550=>418,5551=>628,5598=>770,5601=>767,5702=>468,5703=>468,5742=>444,5743=>1047,5744=>1310,5745=>1632,5746=>1632,5747=>1375,5748=>1375,5749=>1632,5750=>1632,5760=>477,5761=>493,5762=>712,5763=>931,5764=>1150,5765=>1370,5766=>493,5767=>712,5768=>931,5769=>1150,5770=>1370,5771=>498,5772=>718,5773=>938,5774=>1159,5775=>1379,5776=>493,5777=>712,5778=>930,5779=>1149,5780=>1370,5781=>498,5782=>752,5783=>789,5784=>1205,5785=>1150,5786=>683,5787=>507,5788=>507,7424=>592,7425=>717,7426=>982,7427=>586,7428=>550,7429=>605,7430=>605,7431=>491,7432=>541,7433=>278,7434=>395,7435=>579,7436=>583,7437=>754,7438=>650,7439=>612,7440=>550,7441=>684,7442=>684,7443=>684,7444=>1023,7446=>612,7447=>612,7448=>524,7449=>602,7450=>602,7451=>583,7452=>574,7453=>737,7454=>948,7455=>638,7456=>592,7457=>818,7458=>525,7459=>526,7462=>583,7463=>592,7464=>564,7465=>524,7466=>590,7467=>639,7468=>431,7469=>613,7470=>432,7472=>485,7473=>398,7474=>398,7475=>488,7476=>474,7477=>186,7478=>186,7479=>413,7480=>351,7481=>543,7482=>471,7483=>471,7484=>496,7485=>439,7486=>380,7487=>438,7488=>385,7489=>461,7490=>623,7491=>392,7492=>392,7493=>405,7494=>648,7495=>428,7496=>405,7497=>417,7498=>417,7499=>360,7500=>359,7501=>405,7502=>179,7503=>426,7504=>623,7505=>409,7506=>414,7507=>370,7508=>414,7509=>414,7510=>428,7511=>295,7512=>405,7513=>470,7514=>623,7515=>417,7517=>402,7518=>373,7519=>385,7520=>416,7521=>364,7522=>179,7523=>259,7524=>405,7525=>417,7526=>402,7527=>373,7528=>412,7529=>416,7530=>364,7543=>635,7544=>474,7547=>372,7549=>667,7557=>278,7579=>405,7580=>370,7581=>370,7582=>414,7583=>360,7584=>296,7585=>233,7586=>405,7587=>405,7588=>261,7589=>250,7590=>261,7591=>261,7592=>234,7593=>250,7594=>235,7595=>376,7596=>623,7597=>623,7598=>411,7599=>479,7600=>409,7601=>414,7602=>414,7603=>360,7604=>287,7605=>295,7606=>508,7607=>418,7608=>361,7609=>406,7610=>417,7611=>366,7612=>437,7613=>366,7614=>392,7615=>414,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>684,7681=>613,7682=>686,7683=>635,7684=>686,7685=>635,7686=>686,7687=>635,7688=>698,7689=>550,7690=>770,7691=>635,7692=>770,7693=>635,7694=>770,7695=>635,7696=>770,7697=>635,7698=>770,7699=>635,7700=>632,7701=>615,7702=>632,7703=>615,7704=>632,7705=>615,7706=>632,7707=>615,7708=>632,7709=>615,7710=>575,7711=>352,7712=>775,7713=>635,7714=>752,7715=>634,7716=>752,7717=>634,7718=>752,7719=>634,7720=>752,7721=>634,7722=>752,7723=>634,7724=>295,7725=>278,7726=>295,7727=>278,7728=>656,7729=>579,7730=>656,7731=>579,7732=>656,7733=>579,7734=>557,7735=>288,7736=>557,7737=>288,7738=>557,7739=>278,7740=>557,7741=>278,7742=>863,7743=>974,7744=>863,7745=>974,7746=>863,7747=>974,7748=>748,7749=>634,7750=>748,7751=>634,7752=>748,7753=>634,7754=>748,7755=>634,7756=>787,7757=>612,7758=>787,7759=>612,7760=>787,7761=>612,7762=>787,7763=>612,7764=>603,7765=>635,7766=>603,7767=>635,7768=>695,7769=>411,7770=>695,7771=>411,7772=>695,7773=>411,7774=>695,7775=>411,7776=>635,7777=>521,7778=>635,7779=>521,7780=>635,7781=>521,7782=>635,7783=>521,7784=>635,7785=>521,7786=>611,7787=>392,7788=>611,7789=>392,7790=>611,7791=>392,7792=>611,7793=>392,7794=>732,7795=>634,7796=>732,7797=>634,7798=>732,7799=>634,7800=>732,7801=>634,7802=>732,7803=>634,7804=>684,7805=>592,7806=>684,7807=>592,7808=>989,7809=>818,7810=>989,7811=>818,7812=>989,7813=>818,7814=>989,7815=>818,7816=>989,7817=>818,7818=>685,7819=>592,7820=>685,7821=>592,7822=>611,7823=>592,7824=>685,7825=>525,7826=>685,7827=>525,7828=>685,7829=>525,7830=>634,7831=>392,7832=>818,7833=>592,7834=>613,7835=>352,7836=>352,7837=>352,7838=>769,7839=>612,7840=>684,7841=>613,7842=>684,7843=>613,7844=>684,7845=>613,7846=>684,7847=>613,7848=>684,7849=>613,7850=>684,7851=>613,7852=>684,7853=>613,7854=>684,7855=>613,7856=>684,7857=>613,7858=>684,7859=>613,7860=>684,7861=>613,7862=>684,7863=>613,7864=>632,7865=>615,7866=>632,7867=>615,7868=>632,7869=>615,7870=>632,7871=>615,7872=>632,7873=>615,7874=>632,7875=>615,7876=>632,7877=>615,7878=>632,7879=>615,7880=>295,7881=>278,7882=>295,7883=>278,7884=>787,7885=>612,7886=>787,7887=>612,7888=>787,7889=>612,7890=>787,7891=>612,7892=>787,7893=>612,7894=>787,7895=>612,7896=>787,7897=>612,7898=>913,7899=>612,7900=>913,7901=>612,7902=>913,7903=>612,7904=>913,7905=>612,7906=>913,7907=>612,7908=>732,7909=>634,7910=>732,7911=>634,7912=>858,7913=>634,7914=>858,7915=>634,7916=>858,7917=>634,7918=>858,7919=>634,7920=>858,7921=>634,7922=>611,7923=>592,7924=>611,7925=>592,7926=>611,7927=>592,7928=>611,7929=>592,7930=>769,7931=>477,7936=>659,7937=>659,7938=>659,7939=>659,7940=>659,7941=>659,7942=>659,7943=>659,7944=>684,7945=>684,7946=>877,7947=>877,7948=>769,7949=>801,7950=>708,7951=>743,7952=>541,7953=>541,7954=>541,7955=>541,7956=>541,7957=>541,7960=>711,7961=>711,7962=>966,7963=>975,7964=>898,7965=>928,7968=>634,7969=>634,7970=>634,7971=>634,7972=>634,7973=>634,7974=>634,7975=>634,7976=>837,7977=>835,7978=>1086,7979=>1089,7980=>1027,7981=>1051,7982=>934,7983=>947,7984=>338,7985=>338,7986=>338,7987=>338,7988=>338,7989=>338,7990=>338,7991=>338,7992=>380,7993=>374,7994=>635,7995=>635,7996=>570,7997=>600,7998=>489,7999=>493,8000=>612,8001=>612,8002=>612,8003=>612,8004=>612,8005=>612,8008=>804,8009=>848,8010=>1095,8011=>1100,8012=>938,8013=>970,8016=>579,8017=>579,8018=>579,8019=>579,8020=>579,8021=>579,8022=>579,8023=>579,8025=>784,8027=>998,8029=>1012,8031=>897,8032=>837,8033=>837,8034=>837,8035=>837,8036=>837,8037=>837,8038=>837,8039=>837,8040=>802,8041=>843,8042=>1089,8043=>1095,8044=>946,8045=>972,8046=>921,8047=>952,8048=>659,8049=>659,8050=>541,8051=>548,8052=>634,8053=>654,8054=>338,8055=>338,8056=>612,8057=>612,8058=>579,8059=>579,8060=>837,8061=>837,8064=>659,8065=>659,8066=>659,8067=>659,8068=>659,8069=>659,8070=>659,8071=>659,8072=>684,8073=>684,8074=>877,8075=>877,8076=>769,8077=>801,8078=>708,8079=>743,8080=>634,8081=>634,8082=>634,8083=>634,8084=>634,8085=>634,8086=>634,8087=>634,8088=>837,8089=>835,8090=>1086,8091=>1089,8092=>1027,8093=>1051,8094=>934,8095=>947,8096=>837,8097=>837,8098=>837,8099=>837,8100=>837,8101=>837,8102=>837,8103=>837,8104=>802,8105=>843,8106=>1089,8107=>1095,8108=>946,8109=>972,8110=>921,8111=>952,8112=>659,8113=>659,8114=>659,8115=>659,8116=>659,8118=>659,8119=>659,8120=>684,8121=>684,8122=>716,8123=>692,8124=>684,8125=>500,8126=>500,8127=>500,8128=>500,8129=>500,8130=>634,8131=>634,8132=>654,8134=>634,8135=>634,8136=>805,8137=>746,8138=>931,8139=>871,8140=>752,8141=>500,8142=>500,8143=>500,8144=>338,8145=>338,8146=>338,8147=>338,8150=>338,8151=>338,8152=>295,8153=>295,8154=>475,8155=>408,8157=>500,8158=>500,8159=>500,8160=>579,8161=>579,8162=>579,8163=>579,8164=>635,8165=>635,8166=>579,8167=>579,8168=>611,8169=>611,8170=>845,8171=>825,8172=>685,8173=>500,8174=>500,8175=>500,8178=>837,8179=>837,8180=>837,8182=>837,8183=>837,8184=>941,8185=>813,8186=>922,8187=>826,8188=>764,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250,8198=>167,8199=>636,8200=>318,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>361,8209=>361,8210=>636,8211=>500,8212=>1000,8213=>1000,8214=>500,8215=>500,8216=>318,8217=>318,8218=>318,8219=>318,8220=>518,8221=>518,8222=>518,8223=>518,8224=>500,8225=>500,8226=>590,8227=>590,8228=>334,8229=>667,8230=>1000,8231=>318,8232=>0,8233=>0,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>200,8240=>1342,8241=>1735,8242=>227,8243=>374,8244=>520,8245=>227,8246=>374,8247=>520,8248=>339,8249=>400,8250=>400,8251=>838,8252=>485,8253=>531,8254=>500,8255=>804,8256=>804,8257=>250,8258=>1000,8259=>500,8260=>167,8261=>390,8262=>390,8263=>922,8264=>733,8265=>733,8266=>497,8267=>636,8268=>500,8269=>500,8270=>500,8271=>337,8272=>804,8273=>500,8274=>450,8275=>1000,8276=>804,8277=>838,8278=>586,8279=>663,8280=>838,8281=>838,8282=>318,8283=>797,8284=>838,8285=>318,8286=>318,8287=>222,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>401,8305=>179,8308=>401,8309=>401,8310=>401,8311=>401,8312=>401,8313=>401,8314=>528,8315=>528,8316=>528,8317=>246,8318=>246,8319=>398,8320=>401,8321=>401,8322=>401,8323=>401,8324=>401,8325=>401,8326=>401,8327=>401,8328=>401,8329=>401,8330=>528,8331=>528,8332=>528,8333=>246,8334=>246,8336=>392,8337=>417,8338=>414,8339=>444,8340=>417,8341=>404,8342=>426,8343=>166,8344=>623,8345=>398,8346=>428,8347=>373,8348=>295,8352=>877,8353=>636,8354=>636,8355=>636,8356=>636,8357=>974,8358=>748,8359=>1272,8360=>1074,8361=>989,8362=>784,8363=>636,8364=>636,8365=>636,8366=>636,8367=>1272,8368=>636,8369=>636,8370=>636,8371=>636,8372=>774,8373=>636,8376=>636,8377=>636,8378=>679,8400=>0,8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>1019,8449=>1019,8450=>698,8451=>1123,8452=>642,8453=>1019,8454=>1067,8455=>614,8456=>698,8457=>952,8459=>988,8460=>754,8461=>850,8462=>634,8463=>634,8464=>470,8465=>697,8466=>720,8467=>413,8468=>818,8469=>801,8470=>1040,8471=>1000,8472=>697,8473=>701,8474=>787,8475=>798,8476=>814,8477=>792,8478=>896,8479=>684,8480=>1020,8481=>1074,8482=>1000,8483=>684,8484=>745,8485=>578,8486=>764,8487=>764,8488=>616,8489=>338,8490=>656,8491=>684,8492=>786,8493=>703,8494=>854,8495=>592,8496=>605,8497=>786,8498=>575,8499=>1069,8500=>462,8501=>745,8502=>674,8503=>466,8504=>645,8505=>380,8506=>926,8507=>1194,8508=>702,8509=>728,8510=>654,8511=>849,8512=>811,8513=>775,8514=>557,8515=>557,8516=>611,8517=>819,8518=>708,8519=>615,8520=>351,8521=>351,8523=>780,8526=>526,8528=>969,8529=>969,8530=>1370,8531=>969,8532=>969,8533=>969,8534=>969,8535=>969,8536=>969,8537=>969,8538=>969,8539=>969,8540=>969,8541=>969,8542=>969,8543=>568,8544=>295,8545=>492,8546=>689,8547=>923,8548=>684,8549=>922,8550=>1120,8551=>1317,8552=>917,8553=>685,8554=>933,8555=>1131,8556=>557,8557=>698,8558=>770,8559=>863,8560=>278,8561=>458,8562=>637,8563=>812,8564=>592,8565=>811,8566=>991,8567=>1170,8568=>819,8569=>592,8570=>822,8571=>1002,8572=>278,8573=>550,8574=>635,8575=>974,8576=>1245,8577=>770,8578=>1245,8579=>703,8580=>549,8581=>698,8585=>969,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838,8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838,8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838,8620=>838,8621=>838,8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838,8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838,8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838,8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838,8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838,8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838,8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838,8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838,8700=>838,8701=>838,8702=>838,8703=>838,8704=>684,8705=>636,8706=>517,8707=>632,8708=>632,8709=>871,8710=>669,8711=>669,8712=>871,8713=>871,8714=>718,8715=>871,8716=>871,8717=>718,8718=>636,8719=>757,8720=>757,8721=>674,8722=>838,8723=>838,8724=>838,8725=>337,8726=>637,8727=>838,8728=>626,8729=>626,8730=>637,8731=>637,8732=>637,8733=>714,8734=>833,8735=>838,8736=>896,8737=>896,8738=>838,8739=>500,8740=>500,8741=>500,8742=>500,8743=>732,8744=>732,8745=>732,8746=>732,8747=>521,8748=>789,8749=>1057,8750=>521,8751=>789,8752=>1057,8753=>521,8754=>521,8755=>521,8756=>636,8757=>636,8758=>260,8759=>636,8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838,8766=>838,8767=>838,8768=>375,8769=>838,8770=>838,8771=>838,8772=>838,8773=>838,8774=>838,8775=>838,8776=>838,8777=>838,8778=>838,8779=>838,8780=>838,8781=>838,8782=>838,8783=>838,8784=>838,8785=>838,8786=>839,8787=>839,8788=>1000,8789=>1000,8790=>838,8791=>838,8792=>838,8793=>838,8794=>838,8795=>838,8796=>838,8797=>838,8798=>838,8799=>838,8800=>838,8801=>838,8802=>838,8803=>838,8804=>838,8805=>838,8806=>838,8807=>838,8808=>838,8809=>838,8810=>1047,8811=>1047,8812=>464,8813=>838,8814=>838,8815=>838,8816=>838,8817=>838,8818=>838,8819=>838,8820=>838,8821=>838,8822=>838,8823=>838,8824=>838,8825=>838,8826=>838,8827=>838,8828=>838,8829=>838,8830=>838,8831=>838,8832=>838,8833=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8840=>838,8841=>838,8842=>838,8843=>838,8844=>732,8845=>732,8846=>732,8847=>838,8848=>838,8849=>838,8850=>838,8851=>780,8852=>780,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838,8862=>838,8863=>838,8864=>838,8865=>838,8866=>871,8867=>871,8868=>871,8869=>871,8870=>521,8871=>521,8872=>871,8873=>871,8874=>871,8875=>871,8876=>871,8877=>871,8878=>871,8879=>871,8880=>838,8881=>838,8882=>838,8883=>838,8884=>838,8885=>838,8886=>1000,8887=>1000,8888=>838,8889=>838,8890=>521,8891=>732,8892=>732,8893=>732,8894=>838,8895=>838,8896=>820,8897=>820,8898=>820,8899=>820,8900=>494,8901=>318,8902=>626,8903=>838,8904=>1000,8905=>1000,8906=>1000,8907=>1000,8908=>1000,8909=>838,8910=>732,8911=>732,8912=>838,8913=>838,8914=>838,8915=>838,8916=>838,8917=>838,8918=>838,8919=>838,8920=>1422,8921=>1422,8922=>838,8923=>838,8924=>838,8925=>838,8926=>838,8927=>838,8928=>838,8929=>838,8930=>838,8931=>838,8932=>838,8933=>838,8934=>838,8935=>838,8936=>838,8937=>838,8938=>838,8939=>838,8940=>838,8941=>838,8942=>1000,8943=>1000,8944=>1000,8945=>1000,8946=>1000,8947=>871,8948=>718,8949=>871,8950=>871,8951=>718,8952=>871,8953=>871,8954=>1000,8955=>871,8956=>718,8957=>871,8958=>718,8959=>871,8960=>602,8961=>602,8962=>635,8963=>838,8964=>838,8965=>838,8966=>838,8967=>488,8968=>390,8969=>390,8970=>390,8971=>390,8972=>809,8973=>809,8974=>809,8975=>809,8976=>838,8977=>513,8984=>1000,8985=>838,8988=>469,8989=>469,8990=>469,8991=>469,8992=>521,8993=>521,8996=>1152,8997=>1152,8998=>1414,8999=>1152,9000=>1443,9003=>1414,9004=>873,9075=>338,9076=>635,9077=>837,9082=>659,9085=>757,9095=>1152,9108=>873,9115=>500,9116=>500,9117=>500,9118=>500,9119=>500,9120=>500,9121=>500,9122=>500,9123=>500,9124=>500,9125=>500,9126=>500,9127=>750,9128=>750,9129=>750,9130=>750,9131=>750,9132=>750,9133=>750,9134=>521,9166=>838,9167=>945,9187=>873,9189=>769,9192=>636,9250=>635,9251=>635,9312=>896,9313=>896,9314=>896,9315=>896,9316=>896,9317=>896,9318=>896,9319=>896,9320=>896,9321=>896,9472=>602,9473=>602,9474=>602,9475=>602,9476=>602,9477=>602,9478=>602,9479=>602,9480=>602,9481=>602,9482=>602,9483=>602,9484=>602,9485=>602,9486=>602,9487=>602,9488=>602,9489=>602,9490=>602,9491=>602,9492=>602,9493=>602,9494=>602,9495=>602,9496=>602,9497=>602,9498=>602,9499=>602,9500=>602,9501=>602,9502=>602,9503=>602,9504=>602,9505=>602,9506=>602,9507=>602,9508=>602,9509=>602,9510=>602,9511=>602,9512=>602,9513=>602,9514=>602,9515=>602,9516=>602,9517=>602,9518=>602,9519=>602,9520=>602,9521=>602,9522=>602,9523=>602,9524=>602,9525=>602,9526=>602,9527=>602,9528=>602,9529=>602,9530=>602,9531=>602,9532=>602,9533=>602,9534=>602,9535=>602,9536=>602,9537=>602,9538=>602,9539=>602,9540=>602,9541=>602,9542=>602,9543=>602,9544=>602,9545=>602,9546=>602,9547=>602,9548=>602,9549=>602,9550=>602,9551=>602,9552=>602,9553=>602,9554=>602,9555=>602,9556=>602,9557=>602,9558=>602,9559=>602,9560=>602,9561=>602,9562=>602,9563=>602,9564=>602,9565=>602,9566=>602,9567=>602,9568=>602,9569=>602,9570=>602,9571=>602,9572=>602,9573=>602,9574=>602,9575=>602,9576=>602,9577=>602,9578=>602,9579=>602,9580=>602,9581=>602,9582=>602,9583=>602,9584=>602,9585=>602,9586=>602,9587=>602,9588=>602,9589=>602,9590=>602,9591=>602,9592=>602,9593=>602,9594=>602,9595=>602,9596=>602,9597=>602,9598=>602,9599=>602,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769,9606=>769,9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769,9616=>769,9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769,9626=>769,9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945,9636=>945,9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945,9646=>550,9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769,9656=>502,9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769,9666=>502,9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873,9676=>873,9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873,9686=>527,9687=>527,9688=>791,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387,9696=>873,9697=>873,9698=>769,9699=>769,9700=>769,9701=>769,9702=>590,9703=>945,9704=>945,9705=>945,9706=>945,9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945,9716=>873,9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732,9726=>732,9727=>769,9728=>896,9729=>1000,9730=>896,9731=>896,9732=>896,9733=>896,9734=>896,9735=>573,9736=>896,9737=>896,9738=>888,9739=>888,9740=>671,9741=>1013,9742=>1246,9743=>1250,9744=>896,9745=>896,9746=>896,9747=>532,9748=>896,9749=>896,9750=>896,9751=>896,9752=>896,9753=>896,9754=>896,9755=>896,9756=>896,9757=>609,9758=>896,9759=>609,9760=>896,9761=>896,9762=>896,9763=>896,9764=>669,9765=>746,9766=>649,9767=>784,9768=>545,9769=>896,9770=>896,9771=>896,9772=>710,9773=>896,9774=>896,9775=>896,9776=>896,9777=>896,9778=>896,9779=>896,9780=>896,9781=>896,9782=>896,9783=>896,9784=>896,9785=>1042,9786=>1042,9787=>1042,9788=>896,9789=>896,9790=>896,9791=>614,9792=>732,9793=>732,9794=>896,9795=>896,9796=>896,9797=>896,9798=>896,9799=>896,9800=>896,9801=>896,9802=>896,9803=>896,9804=>896,9805=>896,9806=>896,9807=>896,9808=>896,9809=>896,9810=>896,9811=>896,9812=>896,9813=>896,9814=>896,9815=>896,9816=>896,9817=>896,9818=>896,9819=>896,9820=>896,9821=>896,9822=>896,9823=>896,9824=>896,9825=>896,9826=>896,9827=>896,9828=>896,9829=>896,9830=>896,9831=>896,9832=>896,9833=>472,9834=>638,9835=>896,9836=>896,9837=>472,9838=>357,9839=>484,9840=>748,9841=>766,9842=>896,9843=>896,9844=>896,9845=>896,9846=>896,9847=>896,9848=>896,9849=>896,9850=>896,9851=>896,9852=>896,9853=>896,9854=>896,9855=>896,9856=>869,9857=>869,9858=>869,9859=>869,9860=>869,9861=>869,9862=>896,9863=>896,9864=>896,9865=>896,9866=>896,9867=>896,9868=>896,9869=>896,9870=>896,9871=>896,9872=>896,9873=>896,9874=>896,9875=>896,9876=>896,9877=>541,9878=>896,9879=>896,9880=>896,9881=>896,9882=>896,9883=>896,9884=>896,9888=>896,9889=>702,9890=>1004,9891=>1089,9892=>1175,9893=>903,9894=>838,9895=>838,9896=>838,9897=>838,9898=>838,9899=>838,9900=>838,9901=>838,9902=>838,9903=>838,9904=>844,9905=>838,9906=>732,9907=>732,9908=>732,9909=>732,9910=>850,9911=>732,9912=>732,9920=>838,9921=>838,9922=>838,9923=>838,9954=>732,9985=>838,9986=>838,9987=>838,9988=>838,9990=>838,9991=>838,9992=>838,9993=>838,9996=>838,9997=>838,9998=>838,9999=>838,10000=>838,10001=>838,10002=>838,10003=>838,10004=>838,10005=>838,10006=>838,10007=>838,10008=>838,10009=>838,10010=>838,10011=>838,10012=>838,10013=>838,10014=>838,10015=>838,10016=>838,10017=>838,10018=>838,10019=>838,10020=>838,10021=>838,10022=>838,10023=>838,10025=>838,10026=>838,10027=>838,10028=>838,10029=>838,10030=>838,10031=>838,10032=>838,10033=>838,10034=>838,10035=>838,10036=>838,10037=>838,10038=>838,10039=>838,10040=>838,10041=>838,10042=>838,10043=>838,10044=>838,10045=>838,10046=>838,10047=>838,10048=>838,10049=>838,10050=>838,10051=>838,10052=>838,10053=>838,10054=>838,10055=>838,10056=>838,10057=>838,10058=>838,10059=>838,10061=>896,10063=>896,10064=>896,10065=>896,10066=>896,10070=>896,10072=>838,10073=>838,10074=>838,10075=>322,10076=>322,10077=>538,10078=>538,10081=>838,10082=>838,10083=>838,10084=>838,10085=>838,10086=>838,10087=>838,10088=>838,10089=>838,10090=>838,10091=>838,10092=>838,10093=>838,10094=>838,10095=>838,10096=>838,10097=>838,10098=>838,10099=>838,10100=>838,10101=>838,10102=>896,10103=>896,10104=>896,10105=>896,10106=>896,10107=>896,10108=>896,10109=>896,10110=>896,10111=>896,10112=>838,10113=>838,10114=>838,10115=>838,10116=>838,10117=>838,10118=>838,10119=>838,10120=>838,10121=>838,10122=>838,10123=>838,10124=>838,10125=>838,10126=>838,10127=>838,10128=>838,10129=>838,10130=>838,10131=>838,10132=>838,10136=>838,10137=>838,10138=>838,10139=>838,10140=>838,10141=>838,10142=>838,10143=>838,10144=>838,10145=>838,10146=>838,10147=>838,10148=>838,10149=>838,10150=>838,10151=>838,10152=>838,10153=>838,10154=>838,10155=>838,10156=>838,10157=>838,10158=>838,10159=>838,10161=>838,10162=>838,10163=>838,10164=>838,10165=>838,10166=>838,10167=>838,10168=>838,10169=>838,10170=>838,10171=>838,10172=>838,10173=>838,10174=>838,10181=>390,10182=>390,10208=>494,10214=>495,10215=>495,10216=>390,10217=>390,10218=>556,10219=>556,10224=>838,10225=>838,10226=>838,10227=>838,10228=>1157,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434,10237=>1434,10238=>1434,10239=>1434,10240=>732,10241=>732,10242=>732,10243=>732,10244=>732,10245=>732,10246=>732,10247=>732,10248=>732,10249=>732,10250=>732,10251=>732,10252=>732,10253=>732,10254=>732,10255=>732,10256=>732,10257=>732,10258=>732,10259=>732,10260=>732,10261=>732,10262=>732,10263=>732,10264=>732,10265=>732,10266=>732,10267=>732,10268=>732,10269=>732,10270=>732,10271=>732,10272=>732,10273=>732,10274=>732,10275=>732,10276=>732,10277=>732,10278=>732,10279=>732,10280=>732,10281=>732,10282=>732,10283=>732,10284=>732,10285=>732,10286=>732,10287=>732,10288=>732,10289=>732,10290=>732,10291=>732,10292=>732,10293=>732,10294=>732,10295=>732,10296=>732,10297=>732,10298=>732,10299=>732,10300=>732,10301=>732,10302=>732,10303=>732,10304=>732,10305=>732,10306=>732,10307=>732,10308=>732,10309=>732,10310=>732,10311=>732,10312=>732,10313=>732,10314=>732,10315=>732,10316=>732,10317=>732,10318=>732,10319=>732,10320=>732,10321=>732,10322=>732,10323=>732,10324=>732,10325=>732,10326=>732,10327=>732,10328=>732,10329=>732,10330=>732,10331=>732,10332=>732,10333=>732,10334=>732,10335=>732,10336=>732,10337=>732,10338=>732,10339=>732,10340=>732,10341=>732,10342=>732,10343=>732,10344=>732,10345=>732,10346=>732,10347=>732,10348=>732,10349=>732,10350=>732,10351=>732,10352=>732,10353=>732,10354=>732,10355=>732,10356=>732,10357=>732,10358=>732,10359=>732,10360=>732,10361=>732,10362=>732,10363=>732,10364=>732,10365=>732,10366=>732,10367=>732,10368=>732,10369=>732,10370=>732,10371=>732,10372=>732,10373=>732,10374=>732,10375=>732,10376=>732,10377=>732,10378=>732,10379=>732,10380=>732,10381=>732,10382=>732,10383=>732,10384=>732,10385=>732,10386=>732,10387=>732,10388=>732,10389=>732,10390=>732,10391=>732,10392=>732,10393=>732,10394=>732,10395=>732,10396=>732,10397=>732,10398=>732,10399=>732,10400=>732,10401=>732,10402=>732,10403=>732,10404=>732,10405=>732,10406=>732,10407=>732,10408=>732,10409=>732,10410=>732,10411=>732,10412=>732,10413=>732,10414=>732,10415=>732,10416=>732,10417=>732,10418=>732,10419=>732,10420=>732,10421=>732,10422=>732,10423=>732,10424=>732,10425=>732,10426=>732,10427=>732,10428=>732,10429=>732,10430=>732,10431=>732,10432=>732,10433=>732,10434=>732,10435=>732,10436=>732,10437=>732,10438=>732,10439=>732,10440=>732,10441=>732,10442=>732,10443=>732,10444=>732,10445=>732,10446=>732,10447=>732,10448=>732,10449=>732,10450=>732,10451=>732,10452=>732,10453=>732,10454=>732,10455=>732,10456=>732,10457=>732,10458=>732,10459=>732,10460=>732,10461=>732,10462=>732,10463=>732,10464=>732,10465=>732,10466=>732,10467=>732,10468=>732,10469=>732,10470=>732,10471=>732,10472=>732,10473=>732,10474=>732,10475=>732,10476=>732,10477=>732,10478=>732,10479=>732,10480=>732,10481=>732,10482=>732,10483=>732,10484=>732,10485=>732,10486=>732,10487=>732,10488=>732,10489=>732,10490=>732,10491=>732,10492=>732,10493=>732,10494=>732,10495=>732,10502=>838,10503=>838,10506=>838,10507=>838,10560=>683,10561=>683,10627=>734,10628=>734,10702=>838,10703=>1000,10704=>1000,10705=>1000,10706=>1000,10707=>1000,10708=>1000,10709=>1000,10731=>494,10746=>838,10747=>838,10752=>1000,10753=>1000,10754=>1000,10764=>1325,10765=>521,10766=>521,10767=>521,10768=>521,10769=>521,10770=>521,10771=>521,10772=>521,10773=>521,10774=>521,10775=>521,10776=>521,10777=>521,10778=>521,10779=>521,10780=>521,10799=>838,10858=>838,10859=>838,10877=>838,10878=>838,10879=>838,10880=>838,10881=>838,10882=>838,10883=>838,10884=>838,10885=>838,10886=>838,10887=>838,10888=>838,10889=>838,10890=>838,10891=>838,10892=>838,10893=>838,10894=>838,10895=>838,10896=>838,10897=>838,10898=>838,10899=>838,10900=>838,10901=>838,10902=>838,10903=>838,10904=>838,10905=>838,10906=>838,10907=>838,10908=>838,10909=>838,10910=>838,10911=>838,10912=>838,10926=>838,10927=>838,10928=>838,10929=>838,10930=>838,10931=>838,10932=>838,10933=>838,10934=>838,10935=>838,10936=>838,10937=>838,10938=>838,11001=>838,11002=>838,11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838,11018=>838,11019=>838,11020=>838,11021=>838,11022=>836,11023=>836,11024=>836,11025=>836,11026=>945,11027=>945,11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11039=>869,11040=>869,11041=>873,11042=>873,11043=>873,11044=>1119,11091=>869,11092=>869,11360=>557,11361=>278,11362=>557,11363=>603,11364=>695,11365=>613,11366=>392,11367=>752,11368=>634,11369=>656,11370=>579,11371=>685,11372=>525,11373=>781,11374=>863,11375=>684,11376=>781,11377=>734,11378=>1128,11379=>961,11380=>592,11381=>654,11382=>568,11383=>660,11385=>414,11386=>612,11387=>491,11388=>175,11389=>431,11390=>635,11391=>685,11520=>591,11521=>595,11522=>564,11523=>602,11524=>587,11525=>911,11526=>626,11527=>952,11528=>595,11529=>607,11530=>954,11531=>620,11532=>595,11533=>926,11534=>595,11535=>806,11536=>931,11537=>584,11538=>592,11539=>923,11540=>953,11541=>828,11542=>596,11543=>595,11544=>590,11545=>592,11546=>592,11547=>621,11548=>920,11549=>589,11550=>586,11551=>581,11552=>914,11553=>596,11554=>595,11555=>592,11556=>642,11557=>901,11568=>646,11569=>888,11570=>888,11571=>682,11572=>684,11573=>635,11574=>562,11575=>684,11576=>684,11577=>632,11578=>632,11579=>683,11580=>875,11581=>685,11582=>491,11583=>685,11584=>888,11585=>888,11586=>300,11587=>627,11588=>752,11589=>656,11590=>527,11591=>685,11592=>645,11593=>632,11594=>502,11595=>953,11596=>778,11597=>748,11598=>621,11599=>295,11600=>778,11601=>295,11602=>752,11603=>633,11604=>888,11605=>888,11606=>752,11607=>320,11608=>749,11609=>888,11610=>888,11611=>698,11612=>768,11613=>685,11614=>698,11615=>622,11616=>684,11617=>752,11618=>632,11619=>788,11620=>567,11621=>788,11631=>515,11800=>531,11806=>838,11810=>390,11811=>390,11812=>390,11813=>390,11822=>531,19904=>896,19905=>896,19906=>896,19907=>896,19908=>896,19909=>896,19910=>896,19911=>896,19912=>896,19913=>896,19914=>896,19915=>896,19916=>896,19917=>896,19918=>896,19919=>896,19920=>896,19921=>896,19922=>896,19923=>896,19924=>896,19925=>896,19926=>896,19927=>896,19928=>896,19929=>896,19930=>896,19931=>896,19932=>896,19933=>896,19934=>896,19935=>896,19936=>896,19937=>896,19938=>896,19939=>896,19940=>896,19941=>896,19942=>896,19943=>896,19944=>896,19945=>896,19946=>896,19947=>896,19948=>896,19949=>896,19950=>896,19951=>896,19952=>896,19953=>896,19954=>896,19955=>896,19956=>896,19957=>896,19958=>896,19959=>896,19960=>896,19961=>896,19962=>896,19963=>896,19964=>896,19965=>896,19966=>896,19967=>896,42192=>686,42193=>603,42194=>603,42195=>770,42196=>611,42197=>611,42198=>775,42199=>656,42200=>656,42201=>512,42202=>698,42203=>703,42204=>685,42205=>575,42206=>575,42207=>863,42208=>748,42209=>557,42210=>635,42211=>695,42212=>695,42213=>684,42214=>684,42215=>752,42216=>775,42217=>512,42218=>989,42219=>685,42220=>611,42221=>686,42222=>684,42223=>684,42224=>632,42225=>632,42226=>295,42227=>787,42228=>732,42229=>732,42230=>557,42231=>767,42232=>300,42233=>300,42234=>596,42235=>596,42236=>300,42237=>300,42238=>588,42239=>588,42564=>635,42565=>521,42566=>354,42567=>338,42572=>1180,42573=>1028,42576=>1029,42577=>906,42580=>1080,42581=>842,42582=>977,42583=>843,42594=>1062,42595=>912,42596=>1066,42597=>901,42598=>1178,42599=>1008,42600=>787,42601=>612,42602=>855,42603=>712,42604=>1358,42605=>1019,42606=>879,42634=>782,42635=>685,42636=>611,42637=>583,42644=>686,42645=>634,42760=>493,42761=>493,42762=>493,42763=>493,42764=>493,42765=>493,42766=>493,42767=>493,42768=>493,42769=>493,42770=>493,42771=>493,42772=>493,42773=>493,42774=>493,42779=>369,42780=>369,42781=>252,42782=>252,42783=>252,42786=>385,42787=>356,42788=>472,42789=>472,42790=>752,42791=>634,42792=>878,42793=>709,42794=>614,42795=>541,42800=>491,42801=>521,42802=>1250,42803=>985,42804=>1203,42805=>990,42806=>1142,42807=>981,42808=>971,42809=>818,42810=>971,42811=>818,42812=>959,42813=>818,42814=>703,42815=>549,42816=>656,42817=>583,42822=>680,42823=>392,42824=>582,42825=>427,42826=>807,42827=>704,42830=>1358,42831=>1019,42832=>603,42833=>635,42834=>734,42835=>774,42838=>787,42839=>635,42852=>605,42853=>635,42854=>605,42855=>635,42880=>557,42881=>278,42882=>735,42883=>634,42889=>337,42890=>376,42891=>401,42892=>275,42893=>686,42894=>487,42896=>772,42897=>667,42912=>775,42913=>635,42914=>656,42915=>579,42916=>748,42917=>634,42918=>695,42919=>411,42920=>635,42921=>521,42922=>801,43002=>915,43003=>575,43004=>603,43005=>863,43006=>295,43007=>1199,61184=>213,61185=>238,61186=>257,61187=>264,61188=>267,61189=>238,61190=>213,61191=>238,61192=>257,61193=>264,61194=>257,61195=>238,61196=>213,61197=>238,61198=>257,61199=>264,61200=>257,61201=>238,61202=>213,61203=>238,61204=>267,61205=>264,61206=>257,61207=>238,61208=>213,61209=>275,61440=>977,61441=>977,61442=>977,61443=>977,62464=>580,62465=>580,62466=>624,62467=>889,62468=>585,62469=>580,62470=>653,62471=>882,62472=>555,62473=>580,62474=>1168,62475=>589,62476=>590,62477=>869,62478=>580,62479=>589,62480=>914,62481=>590,62482=>731,62483=>583,62484=>872,62485=>589,62486=>895,62487=>589,62488=>589,62489=>590,62490=>649,62491=>589,62492=>589,62493=>599,62494=>590,62495=>516,62496=>580,62497=>584,62498=>580,62499=>580,62500=>581,62501=>638,62502=>955,62504=>931,62505=>808,62506=>508,62507=>508,62508=>508,62509=>508,62510=>508,62511=>508,62512=>508,62513=>508,62514=>508,62515=>508,62516=>518,62517=>518,62518=>518,62519=>787,62520=>787,62521=>787,62522=>787,62523=>787,62524=>546,62525=>546,62526=>546,62527=>546,62528=>546,62529=>546,63173=>612,64256=>689,64257=>630,64258=>630,64259=>967,64260=>967,64261=>686,64262=>861,64275=>1202,64276=>1202,64277=>1196,64278=>1186,64279=>1529,64285=>224,64286=>0,64287=>331,64288=>636,64289=>856,64290=>774,64291=>906,64292=>771,64293=>843,64294=>855,64295=>807,64296=>875,64297=>838,64298=>708,64299=>708,64300=>708,64301=>708,64302=>668,64303=>668,64304=>668,64305=>578,64306=>412,64307=>546,64308=>653,64309=>355,64310=>406,64312=>648,64313=>330,64314=>537,64315=>529,64316=>568,64318=>679,64320=>399,64321=>649,64323=>640,64324=>625,64326=>593,64327=>709,64328=>564,64329=>708,64330=>657,64331=>272,64332=>578,64333=>529,64334=>625,64335=>629,64338=>941,64339=>982,64340=>278,64341=>302,64342=>941,64343=>982,64344=>278,64345=>302,64346=>941,64347=>982,64348=>278,64349=>302,64350=>941,64351=>982,64352=>278,64353=>302,64354=>941,64355=>982,64356=>278,64357=>302,64358=>941,64359=>982,64360=>278,64361=>302,64362=>1037,64363=>1035,64364=>478,64365=>506,64366=>1037,64367=>1035,64368=>478,64369=>506,64370=>646,64371=>646,64372=>618,64373=>646,64374=>646,64375=>646,64376=>618,64377=>646,64378=>646,64379=>646,64380=>618,64381=>646,64382=>646,64383=>646,64384=>618,64385=>646,64386=>445,64387=>525,64388=>445,64389=>525,64390=>445,64391=>525,64392=>445,64393=>525,64394=>483,64395=>552,64396=>483,64397=>552,64398=>895,64399=>895,64400=>476,64401=>552,64402=>895,64403=>895,64404=>476,64405=>552,64406=>895,64407=>895,64408=>476,64409=>552,64410=>895,64411=>895,64412=>476,64413=>552,64414=>734,64415=>761,64416=>734,64417=>761,64418=>278,64419=>302,64426=>698,64427=>632,64428=>527,64429=>461,64467=>824,64468=>843,64469=>476,64470=>552,64473=>483,64474=>517,64488=>278,64489=>302,64508=>783,64509=>833,64510=>278,64511=>302,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0,65059=>0,65136=>293,65137=>293,65138=>293,65139=>262,65140=>293,65142=>293,65143=>293,65144=>293,65145=>293,65146=>293,65147=>293,65148=>293,65149=>293,65150=>293,65151=>293,65152=>470,65153=>278,65154=>305,65155=>278,65156=>305,65157=>483,65158=>517,65159=>278,65160=>305,65161=>783,65162=>833,65163=>278,65164=>302,65165=>278,65166=>305,65167=>941,65168=>982,65169=>278,65170=>302,65171=>524,65172=>536,65173=>941,65174=>982,65175=>278,65176=>302,65177=>941,65178=>982,65179=>278,65180=>302,65181=>646,65182=>646,65183=>618,65184=>646,65185=>646,65186=>646,65187=>618,65188=>646,65189=>646,65190=>646,65191=>618,65192=>646,65193=>445,65194=>525,65195=>445,65196=>525,65197=>483,65198=>552,65199=>483,65200=>552,65201=>1221,65202=>1275,65203=>838,65204=>892,65205=>1221,65206=>1275,65207=>838,65208=>892,65209=>1209,65210=>1225,65211=>849,65212=>867,65213=>1209,65214=>1225,65215=>849,65216=>867,65217=>925,65218=>949,65219=>796,65220=>820,65221=>925,65222=>949,65223=>796,65224=>820,65225=>597,65226=>532,65227=>597,65228=>482,65229=>597,65230=>532,65231=>523,65232=>482,65233=>1037,65234=>1035,65235=>478,65236=>506,65237=>776,65238=>834,65239=>478,65240=>506,65241=>824,65242=>843,65243=>476,65244=>552,65245=>727,65246=>757,65247=>305,65248=>331,65249=>619,65250=>666,65251=>536,65252=>578,65253=>734,65254=>761,65255=>278,65256=>302,65257=>524,65258=>536,65259=>527,65260=>461,65261=>483,65262=>517,65263=>783,65264=>833,65265=>783,65266=>833,65267=>278,65268=>302,65269=>570,65270=>597,65271=>570,65272=>597,65273=>570,65274=>597,65275=>570,65276=>597,65279=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1025,65535=>600); +// --- EOF --- diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.z b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.z new file mode 100755 index 0000000..d0c4d3d Binary files /dev/null and b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusans.z differ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.ctg.z b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.ctg.z new file mode 100755 index 0000000..71cef63 Binary files /dev/null and b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.ctg.z differ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.php new file mode 100755 index 0000000..5214aef --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.php @@ -0,0 +1,16 @@ +32,'FontBBox'=>'[-1069 -415 1975 1174]','ItalicAngle'=>0,'Ascent'=>928,'Descent'=>-236,'Leading'=>0,'CapHeight'=>729,'XHeight'=>547,'StemV'=>60,'StemH'=>26,'AvgWidth'=>573,'MaxWidth'=>2016,'MissingWidth'=>600); +$cbbox=array(0=>array(50,-177,550,705),33=>array(140,0,316,729),34=>array(95,458,426,729),35=>array(68,0,770,718),36=>array(78,-147,628,760),37=>array(32,-14,970,742),38=>array(60,-14,830,742),39=>array(95,458,211,729),40=>array(86,-132,377,759),41=>array(80,-132,371,759),42=>array(20,278,503,742),43=>array(106,0,732,627),44=>array(53,-142,278,189),45=>array(54,217,361,359),46=>array(102,0,278,189),47=>array(0,-93,365,729),48=>array(48,-14,648,742),49=>array(113,0,627,729),50=>array(79,0,609,742),51=>array(67,-14,616,742),52=>array(45,0,650,729),53=>array(77,-14,626,729),54=>array(62,-14,642,741),55=>array(67,0,616,729),56=>array(61,-14,634,742),57=>array(52,-14,632,741),58=>array(112,0,288,547),59=>array(63,-142,288,547),60=>array(106,30,732,597),61=>array(106,144,732,482),62=>array(106,30,732,597),63=>array(69,0,515,742),64=>array(66,-174,929,703),65=>array(5,0,769,729),66=>array(92,0,692,729),67=>array(50,-14,670,742),68=>array(92,0,778,729),69=>array(92,0,610,729),70=>array(92,0,599,729),71=>array(50,-14,747,742),72=>array(92,0,745,729),73=>array(92,0,280,729),74=>array(-56,-200,280,729),75=>array(92,0,805,729),76=>array(92,0,610,729),77=>array(92,0,903,729),78=>array(92,0,745,729),79=>array(50,-14,800,742),80=>array(92,0,692,729),81=>array(50,-146,800,742),82=>array(92,0,750,729),83=>array(72,-14,647,742),84=>array(5,0,677,729),85=>array(92,-14,720,729),86=>array(5,0,769,729),87=>array(30,0,1072,729),88=>array(19,0,751,729),89=>array(-10,0,734,729),90=>array(45,0,680,729),91=>array(86,-132,389,760),92=>array(0,-93,365,729),93=>array(68,-132,371,760),94=>array(101,457,737,729),95=>array(0,-236,500,-143),96=>array(46,616,322,800),97=>array(43,-14,596,560),98=>array(84,-14,671,760),99=>array(43,-14,526,560),100=>array(45,-14,632,760),101=>array(43,-14,630,560),102=>array(19,0,444,760),103=>array(45,-216,632,559),104=>array(84,0,634,760),105=>array(84,0,259,760),106=>array(-33,-216,259,760),107=>array(84,0,684,760),108=>array(84,0,259,760),109=>array(83,0,963,560),110=>array(84,0,634,560),111=>array(43,-14,644,560),112=>array(84,-208,671,560),113=>array(45,-208,632,559),114=>array(84,0,490,560),115=>array(52,-14,548,560),116=>array(13,0,455,702),117=>array(78,-14,628,547),118=>array(15,0,637,547),119=>array(35,0,889,547),120=>array(15,0,630,547),121=>array(12,-216,634,547),122=>array(45,0,534,547),123=>array(125,-163,587,760),124=>array(127,-236,238,764),125=>array(125,-163,587,760),126=>array(106,212,732,415),161=>array(140,0,316,729),162=>array(85,-153,567,699),163=>array(61,0,613,742),164=>array(36,30,601,596),165=>array(12,0,684,729),166=>array(127,-171,238,699),167=>array(7,-95,496,742),168=>array(96,654,404,774),169=>array(138,0,862,725),170=>array(77,182,489,742),171=>array(77,67,552,519),172=>array(106,140,732,444),173=>array(54,217,361,359),174=>array(138,0,862,725),175=>array(96,668,404,760),176=>array(87,424,412,749),177=>array(106,0,732,627),178=>array(53,326,382,742),179=>array(44,319,384,742),180=>array(178,616,454,800),181=>array(85,-209,704,547),182=>array(63,-96,549,729),183=>array(102,253,278,442),184=>array(128,-196,349,0),185=>array(60,326,382,734),186=>array(57,182,507,742),187=>array(94,67,569,519),188=>array(49,-14,957,742),189=>array(49,-14,987,742),190=>array(51,-14,957,742),191=>array(69,-14,515,729),192=>array(5,0,769,927),193=>array(5,0,769,927),194=>array(5,0,769,927),195=>array(5,0,769,931),196=>array(5,0,769,927),197=>array(5,0,769,928),198=>array(0,0,1012,729),199=>array(50,-196,670,742),200=>array(92,0,610,927),201=>array(92,0,610,927),202=>array(92,0,610,927),203=>array(92,0,610,927),204=>array(11,0,280,927),205=>array(92,0,337,927),206=>array(1,0,370,927),207=>array(32,0,339,927),208=>array(16,0,787,729),209=>array(92,0,745,928),210=>array(50,-14,800,927),211=>array(50,-14,800,927),212=>array(50,-14,800,927),213=>array(50,-14,800,928),214=>array(50,-14,800,927),215=>array(125,20,713,607),216=>array(22,-36,823,765),217=>array(92,-14,720,927),218=>array(92,-14,720,927),219=>array(92,-14,720,927),220=>array(92,-14,720,927),221=>array(-10,0,734,927),222=>array(92,0,692,729),223=>array(84,-14,676,760),224=>array(43,-14,596,800),225=>array(43,-14,596,800),226=>array(43,-14,596,800),227=>array(43,-14,596,778),228=>array(43,-14,596,774),229=>array(43,-14,596,888),230=>array(43,-14,1000,560),231=>array(43,-196,526,560),232=>array(43,-14,630,800),233=>array(43,-14,630,800),234=>array(43,-14,630,800),235=>array(43,-14,630,774),236=>array(-21,0,259,800),237=>array(84,0,387,800),238=>array(-13,0,355,800),239=>array(17,0,325,774),240=>array(43,-14,644,760),241=>array(84,0,634,778),242=>array(43,-14,644,800),243=>array(43,-14,644,800),244=>array(43,-14,644,800),245=>array(43,-14,644,778),246=>array(43,-14,644,774),247=>array(106,42,732,585),248=>array(38,-46,645,594),249=>array(78,-14,628,800),250=>array(78,-14,628,800),251=>array(78,-14,628,800),252=>array(78,-14,628,774),253=>array(12,-216,634,800),254=>array(84,-208,671,760),255=>array(12,-216,634,774),256=>array(5,0,769,914),257=>array(43,-14,596,763),258=>array(5,0,769,935),259=>array(43,-14,596,780),260=>array(5,-196,769,729),261=>array(43,-196,596,560),262=>array(50,-14,670,927),263=>array(43,-14,557,800),264=>array(50,-14,670,927),265=>array(43,-14,542,800),266=>array(50,-14,670,927),267=>array(43,-14,526,760),268=>array(50,-14,670,927),269=>array(43,-14,537,800),270=>array(92,0,778,927),271=>array(45,-14,871,760),272=>array(16,0,787,729),273=>array(45,-14,707,760),274=>array(92,0,610,914),275=>array(43,-14,630,763),276=>array(92,0,610,927),277=>array(43,-14,630,784),278=>array(92,0,610,927),279=>array(43,-14,630,760),280=>array(92,-196,610,729),281=>array(43,-196,630,560),282=>array(92,0,610,927),283=>array(43,-14,630,800),284=>array(50,-14,747,927),285=>array(45,-216,632,800),286=>array(50,-14,747,927),287=>array(45,-216,632,784),288=>array(50,-14,747,927),289=>array(45,-216,632,760),290=>array(50,-224,747,742),291=>array(45,-216,632,765),292=>array(92,0,745,927),293=>array(-9,0,634,927),294=>array(92,0,882,729),295=>array(81,0,709,760),296=>array(16,0,355,928),297=>array(1,0,341,778),298=>array(32,0,339,914),299=>array(18,0,325,763),300=>array(21,0,350,927),301=>array(7,0,335,784),302=>array(92,-196,366,729),303=>array(84,-196,345,760),304=>array(92,0,280,927),305=>array(84,0,259,547),306=>array(92,-200,651,729),307=>array(84,-216,602,760),308=>array(-56,-200,370,927),309=>array(-33,-216,355,800),310=>array(92,-209,805,729),311=>array(84,-209,684,760),312=>array(84,0,684,547),313=>array(92,0,610,928),314=>array(84,0,357,928),315=>array(92,-209,610,729),316=>array(71,-209,273,760),317=>array(92,0,610,729),318=>array(84,0,479,760),319=>array(92,0,610,729),320=>array(84,0,484,760),321=>array(-45,0,615,729),322=>array(-18,0,390,760),323=>array(92,0,745,928),324=>array(84,0,634,803),325=>array(92,-209,745,729),326=>array(84,-209,634,560),327=>array(92,0,745,927),328=>array(84,0,634,800),329=>array(51,0,891,729),330=>array(84,-200,730,742),331=>array(84,-216,634,560),332=>array(50,-14,800,914),333=>array(43,-14,644,763),334=>array(50,-14,800,927),335=>array(43,-14,644,787),336=>array(50,-14,800,927),337=>array(43,-14,644,800),338=>array(50,-1,1094,730),339=>array(43,-14,1046,560),340=>array(92,0,750,928),341=>array(84,0,515,803),342=>array(92,-209,750,729),343=>array(71,-209,490,560),344=>array(92,0,750,927),345=>array(84,0,490,800),346=>array(72,-14,647,928),347=>array(52,-14,548,803),348=>array(72,-14,647,927),349=>array(52,-14,548,800),350=>array(72,-196,647,742),351=>array(52,-196,548,560),352=>array(72,-14,647,927),353=>array(52,-14,548,800),354=>array(5,-196,677,729),355=>array(13,-196,455,702),356=>array(5,0,677,930),357=>array(13,0,507,814),358=>array(5,0,677,729),359=>array(13,0,455,702),360=>array(92,-14,720,928),361=>array(78,-14,628,778),362=>array(92,-14,720,914),363=>array(78,-14,628,763),364=>array(92,-14,720,927),365=>array(78,-14,628,784),366=>array(92,-14,720,929),367=>array(78,-14,628,881),368=>array(92,-14,720,927),369=>array(78,-14,628,800),370=>array(92,-196,720,729),371=>array(78,-196,716,547),372=>array(30,0,1072,931),373=>array(35,0,889,800),374=>array(-10,0,734,931),375=>array(12,-216,634,800),376=>array(-10,0,734,927),377=>array(45,0,680,928),378=>array(45,0,534,803),379=>array(45,0,680,929),380=>array(45,0,534,760),381=>array(45,0,680,927),382=>array(45,0,534,800),383=>array(19,0,444,760),384=>array(9,-14,671,760),385=>array(-68,0,741,729),386=>array(92,0,692,729),387=>array(84,-14,671,760),388=>array(40,0,731,729),389=>array(25,-14,696,760),390=>array(50,-14,670,742),391=>array(50,-14,818,924),392=>array(43,-14,643,724),393=>array(16,0,787,729),394=>array(-68,0,827,729),395=>array(70,0,669,729),396=>array(45,-14,632,760),397=>array(43,-222,645,560),398=>array(92,0,610,729),399=>array(51,-14,800,742),400=>array(67,-14,616,742),401=>array(-56,-200,599,729),402=>array(-57,-208,444,760),403=>array(50,-14,868,924),404=>array(2,-211,793,730),405=>array(84,0,1000,760),406=>array(92,0,428,729),407=>array(5,0,384,729),408=>array(92,0,805,742),409=>array(84,0,684,760),410=>array(5,0,355,760),411=>array(-11,0,562,760),412=>array(83,-13,963,729),413=>array(-56,-200,745,729),414=>array(84,-208,634,560),415=>array(50,-14,800,742),416=>array(53,-14,854,761),417=>array(46,-14,708,609),418=>array(50,-14,1007,742),419=>array(43,-216,826,560),420=>array(-68,0,741,729),421=>array(84,-208,671,760),422=>array(92,-146,760,729),423=>array(26,-14,601,742),424=>array(15,-14,511,560),425=>array(92,0,610,729),426=>array(-31,-217,561,760),427=>array(13,-216,455,702),428=>array(15,0,701,729),429=>array(13,0,455,760),430=>array(5,-200,677,729),431=>array(91,-14,833,761),432=>array(75,-14,733,609),433=>array(27,-14,823,728),434=>array(92,0,772,729),435=>array(-10,0,796,742),436=>array(12,-216,778,560),437=>array(45,0,680,729),438=>array(45,0,534,547),439=>array(72,-33,728,729),440=>array(41,-33,696,729),441=>array(37,-215,586,547),442=>array(57,-208,534,547),443=>array(79,0,609,742),444=>array(41,-33,728,729),445=>array(37,-215,586,547),446=>array(36,-15,525,702),447=>array(84,-208,671,560),448=>array(92,-208,280,729),449=>array(92,-208,566,729),450=>array(5,-208,536,729),451=>array(99,0,274,729),452=>array(92,0,1510,927),453=>array(92,0,1364,800),454=>array(45,-14,1250,800),455=>array(92,-200,917,729),456=>array(92,-216,896,760),457=>array(84,-216,602,760),458=>array(92,-200,1117,729),459=>array(92,-216,1096,760),460=>array(84,-216,971,760),461=>array(5,0,769,927),462=>array(43,-14,596,800),463=>array(3,0,371,927),464=>array(2,0,370,800),465=>array(50,-14,800,927),466=>array(43,-14,644,800),467=>array(92,-14,720,927),468=>array(78,-14,628,800),469=>array(92,-14,720,1040),470=>array(78,-14,628,914),471=>array(92,-14,720,1114),472=>array(78,-14,628,917),473=>array(92,-14,720,1114),474=>array(78,-14,628,917),475=>array(92,-14,720,1114),476=>array(78,-14,628,917),477=>array(43,-14,630,560),478=>array(5,0,769,1040),479=>array(43,-14,596,914),480=>array(5,0,769,1042),481=>array(43,-14,596,914),482=>array(0,0,1012,914),483=>array(43,-14,1000,758),484=>array(50,-14,792,742),485=>array(45,-216,674,559),486=>array(50,-14,747,927),487=>array(45,-216,632,800),488=>array(92,0,805,927),489=>array(-5,0,684,927),490=>array(50,-196,800,742),491=>array(43,-196,644,560),492=>array(50,-196,800,914),493=>array(43,-196,644,763),494=>array(72,-33,728,927),495=>array(43,-215,593,793),496=>array(-33,-216,359,800),497=>array(92,0,1510,729),498=>array(92,0,1364,729),499=>array(45,-14,1250,760),500=>array(50,-14,747,928),501=>array(45,-216,632,800),502=>array(92,-14,1186,729),503=>array(92,-208,737,742),504=>array(92,0,745,927),505=>array(84,0,634,800),506=>array(5,0,769,931),507=>array(43,-14,708,931),508=>array(0,0,1012,927),509=>array(43,-14,1000,800),510=>array(22,-36,823,927),511=>array(38,-46,645,800),512=>array(5,0,769,928),513=>array(43,-14,596,800),514=>array(5,0,769,923),515=>array(43,-14,596,784),516=>array(92,0,610,928),517=>array(43,-14,630,800),518=>array(92,0,610,923),519=>array(43,-14,630,784),520=>array(-41,0,377,928),521=>array(-3,0,381,800),522=>array(23,0,351,923),523=>array(7,0,335,784),524=>array(50,-14,800,928),525=>array(43,-14,644,800),526=>array(50,-14,800,923),527=>array(43,-14,644,784),528=>array(92,0,750,928),529=>array(58,0,490,800),530=>array(92,0,750,923),531=>array(84,0,490,784),532=>array(92,-14,720,928),533=>array(78,-14,628,800),534=>array(92,-14,720,923),535=>array(78,-14,628,784),536=>array(72,-239,647,742),537=>array(52,-239,548,560),538=>array(5,-239,677,729),539=>array(13,-239,455,702),540=>array(67,-210,616,742),541=>array(49,-211,544,560),542=>array(92,0,745,927),543=>array(-12,0,634,927),544=>array(84,-208,730,742),545=>array(45,-75,822,760),546=>array(61,-14,748,742),547=>array(43,-14,616,646),548=>array(45,-216,680,729),549=>array(45,-216,534,547),550=>array(5,0,769,927),551=>array(43,-14,596,760),552=>array(92,-192,610,729),553=>array(43,-196,630,560),554=>array(50,-14,800,1040),555=>array(43,-14,644,914),556=>array(50,-14,800,1040),557=>array(43,-14,644,898),558=>array(50,-14,800,927),559=>array(43,-14,644,760),560=>array(50,-14,800,1042),561=>array(43,-14,644,914),562=>array(-10,0,734,914),563=>array(12,-216,634,763),564=>array(84,-75,449,760),565=>array(84,-75,824,560),566=>array(13,-76,469,702),567=>array(-33,-216,259,547),568=>array(45,-14,1043,760),569=>array(45,-208,1043,560),570=>array(-14,-36,788,765),571=>array(-34,-36,768,765),572=>array(-7,-46,600,594),573=>array(-1,0,610,729),574=>array(-60,-36,742,765),575=>array(52,-240,595,560),576=>array(45,-240,595,547),577=>array(40,0,741,729),578=>array(42,0,573,560),579=>array(6,0,692,729),580=>array(23,-14,789,729),581=>array(5,0,769,729),582=>array(92,-93,610,822),583=>array(43,-93,630,640),584=>array(-56,-200,360,729),585=>array(-33,-216,360,760),586=>array(48,-200,927,741),587=>array(45,-216,800,560),588=>array(6,0,750,729),589=>array(-21,0,490,560),590=>array(-10,0,734,729),591=>array(-4,-216,656,547),592=>array(78,-14,631,560),593=>array(45,-14,632,560),594=>array(84,-14,671,560),595=>array(84,-14,671,760),596=>array(43,-14,526,560),597=>array(43,-69,526,560),598=>array(45,-216,750,760),599=>array(45,-14,801,760),600=>array(43,-14,630,560),601=>array(43,-14,630,560),602=>array(59,-14,885,560),603=>array(54,-14,493,560),604=>array(54,-14,493,560),605=>array(54,-14,769,560),606=>array(54,-14,665,560),607=>array(-33,-216,360,547),608=>array(45,-216,801,760),609=>array(45,-216,632,547),610=>array(43,-14,545,546),611=>array(25,-211,619,547),612=>array(25,-21,619,547),613=>array(78,-214,628,547),614=>array(84,0,634,760),615=>array(84,-216,634,760),616=>array(84,0,461,760),617=>array(83,0,356,547),618=>array(84,0,461,547),619=>array(84,0,475,760),620=>array(84,0,609,760),621=>array(85,-216,429,760),622=>array(84,-215,793,760),623=>array(79,-14,959,546),624=>array(79,-209,959,546),625=>array(83,-216,964,560),626=>array(-33,-216,634,560),627=>array(84,-216,802,560),628=>array(84,0,623,547),629=>array(43,-14,644,560),630=>array(43,-1,826,547),631=>array(51,0,630,574),632=>array(60,-208,729,760),633=>array(84,-13,490,547),634=>array(84,-13,490,760),635=>array(84,-216,659,547),636=>array(84,-208,490,560),637=>array(83,-216,490,560),638=>array(84,0,530,547),639=>array(84,0,530,547),640=>array(52,0,590,547),641=>array(52,0,590,547),642=>array(52,-216,548,560),643=>array(-33,-216,431,760),644=>array(-11,-216,444,760),645=>array(84,-216,539,560),646=>array(-31,-217,561,760),647=>array(13,-155,455,547),648=>array(13,-216,455,702),649=>array(84,-14,836,547),650=>array(79,-14,693,547),651=>array(83,0,625,547),652=>array(15,0,637,547),653=>array(35,0,889,547),654=>array(12,0,634,763),655=>array(64,0,660,547),656=>array(45,-216,703,547),657=>array(45,-69,617,547),658=>array(43,-215,593,547),659=>array(57,-215,593,547),660=>array(36,0,525,759),661=>array(36,0,525,759),662=>array(36,0,525,759),663=>array(36,-208,525,759),664=>array(50,-14,800,742),665=>array(84,0,589,547),666=>array(54,-14,665,560),667=>array(43,0,693,760),668=>array(84,0,607,547),669=>array(-170,-216,341,760),670=>array(84,-213,684,547),671=>array(84,0,499,547),672=>array(45,-208,801,760),673=>array(36,0,525,759),674=>array(36,0,525,759),675=>array(45,-14,1108,760),676=>array(45,-215,1167,760),677=>array(45,-55,1107,760),678=>array(13,0,928,702),679=>array(13,-216,777,760),680=>array(13,-69,881,702),681=>array(19,-216,979,760),682=>array(84,0,815,760),683=>array(84,0,732,760),684=>array(22,0,569,641),685=>array(22,86,345,641),686=>array(-89,-214,629,760),687=>array(-89,-216,797,760),688=>array(54,326,406,751),689=>array(54,326,406,751),690=>array(-21,205,166,751),691=>array(54,326,314,640),692=>array(54,319,314,632),693=>array(54,205,421,632),694=>array(14,326,358,632),695=>array(22,326,569,632),696=>array(8,205,406,632),697=>array(78,557,218,800),698=>array(78,557,437,800),699=>array(103,418,318,729),700=>array(63,418,278,729),701=>array(124,616,296,856),702=>array(116,481,255,760),703=>array(116,481,255,760),704=>array(23,326,336,751),705=>array(23,326,336,751),706=>array(130,517,370,843),707=>array(130,517,370,843),708=>array(87,561,413,800),709=>array(87,561,413,800),710=>array(66,616,434,800),711=>array(66,616,434,800),712=>array(107,488,199,759),713=>array(96,668,404,760),714=>array(178,616,454,800),715=>array(46,616,322,800),716=>array(107,-81,199,190),717=>array(96,-184,404,-92),718=>array(46,-236,322,-52),719=>array(178,-236,454,-52),720=>array(45,0,246,547),721=>array(45,361,246,547),722=>array(116,269,255,547),723=>array(116,269,255,547),724=>array(138,238,357,458),725=>array(141,238,360,458),726=>array(54,119,362,427),727=>array(54,229,274,317),728=>array(86,639,414,784),729=>array(183,654,317,774),730=>array(111,610,389,888),731=>array(167,-196,376,0),732=>array(80,638,420,778),733=>array(94,616,479,800),734=>array(0,213,360,524),735=>array(111,616,387,800),736=>array(16,208,390,633),737=>array(54,326,166,751),738=>array(33,318,351,640),739=>array(10,326,403,632),740=>array(23,326,336,751),741=>array(96,0,404,693),742=>array(96,0,404,693),743=>array(96,0,404,693),744=>array(96,0,404,693),745=>array(96,0,404,693),748=>array(88,-260,414,-21),749=>array(96,605,404,822),750=>array(92,418,554,729),755=>array(111,-240,389,38),759=>array(80,-196,420,-84),768=>array(-455,616,-179,800),769=>array(-326,616,-50,800),770=>array(-435,616,-67,800),771=>array(-424,638,-84,778),772=>array(-405,668,-97,760),773=>array(-500,663,0,755),774=>array(-409,639,-81,784),775=>array(-338,617,-164,760),776=>array(-402,654,-94,774),777=>array(-370,616,-122,843),778=>array(-390,610,-112,888),779=>array(-404,616,-19,800),780=>array(-435,616,-67,800),781=>array(-297,615,-205,832),782=>array(-390,615,-113,832),783=>array(-484,616,-100,800),784=>array(-409,639,-81,882),785=>array(-409,639,-81,784),786=>array(-271,418,-69,563),787=>array(-266,595,-132,844),788=>array(-266,595,-132,844),789=>array(-89,616,89,800),790=>array(-455,-276,-179,-93),791=>array(-326,-276,-50,-93),792=>array(-380,-240,-211,-6),793=>array(-295,-240,-126,-6),794=>array(-224,658,47,929),795=>array(-175,400,21,609),796=>array(-331,-240,-216,-11),797=>array(-386,-240,-115,-59),798=>array(-389,-240,-118,-59),799=>array(-370,-240,-136,-6),800=>array(-389,-202,-118,-110),801=>array(-423,-216,-79,117),802=>array(-419,-216,-75,117),803=>array(-338,-212,-164,-70),804=>array(-402,-212,-94,-92),805=>array(-365,-240,-135,-11),806=>array(-327,-239,-125,-93),807=>array(-372,-196,-151,0),808=>array(-333,-196,-124,0),809=>array(-297,-240,-205,-47),810=>array(-405,-237,-97,-54),811=>array(-450,-239,-51,-94),812=>array(-435,-240,-67,-57),813=>array(-435,-240,-67,-57),814=>array(-409,-239,-81,-94),815=>array(-409,-240,-81,-95),816=>array(-424,-234,-84,-94),817=>array(-405,-184,-97,-92),818=>array(-500,-236,0,-143),819=>array(-500,-236,0,-9),820=>array(-625,212,1,415),821=>array(-471,214,-94,309),822=>array(-837,214,-86,309),823=>array(-655,-46,-48,594),824=>array(-825,-36,-24,765),825=>array(-285,-240,-170,-11),826=>array(-405,-238,-97,-55),827=>array(-332,-241,-98,-6),828=>array(-450,-239,-51,-94),829=>array(-379,585,-123,842),830=>array(-267,595,-127,867),831=>array(-500,528,0,755),832=>array(-455,616,-179,800),833=>array(-323,616,-47,800),834=>array(-421,638,-81,778),835=>array(-266,595,-132,844),836=>array(-404,654,-55,978),837=>array(-286,-208,-179,-45),838=>array(-403,639,-97,786),839=>array(-360,-226,-140,-35),840=>array(-379,-240,-121,-47),841=>array(-367,-240,-133,-21),842=>array(-420,616,-80,800),843=>array(-420,567,-80,850),844=>array(-420,573,-80,835),845=>array(-459,-230,-41,-30),846=>array(-357,-240,-143,-45),849=>array(-320,610,-179,888),850=>array(-409,640,-81,882),851=>array(-367,-240,-135,-9),855=>array(-320,610,-179,888),856=>array(-120,654,14,774),858=>array(-445,-240,-58,-11),860=>array(-433,-237,458,-79),861=>array(-433,802,458,960),862=>array(-445,797,445,889),863=>array(-445,-185,445,-93),864=>array(-362,756,362,894),865=>array(-445,769,445,927),866=>array(-449,-230,454,-30),880=>array(92,0,606,729),881=>array(84,0,481,547),882=>array(92,0,930,729),883=>array(92,0,744,729),884=>array(78,557,218,800),885=>array(78,-208,218,35),886=>array(92,0,745,729),887=>array(84,0,617,547),890=>array(202,-208,333,-45),891=>array(43,-14,526,560),892=>array(43,-14,526,560),893=>array(43,-14,526,560),894=>array(63,-142,288,547),900=>array(169,616,445,800),901=>array(96,654,445,978),902=>array(26,0,792,800),903=>array(102,253,278,442),904=>array(-24,0,771,800),905=>array(-18,0,915,800),906=>array(-21,0,450,800),908=>array(-19,-14,836,800),910=>array(-27,0,992,800),911=>array(-30,0,867,800),912=>array(23,-19,372,978),913=>array(5,0,769,729),914=>array(92,0,692,729),915=>array(92,0,610,729),916=>array(5,0,769,729),917=>array(92,0,610,729),918=>array(45,0,680,729),919=>array(92,0,745,729),920=>array(50,-14,800,742),921=>array(92,0,280,729),922=>array(92,0,805,729),923=>array(5,0,769,729),924=>array(92,0,903,729),925=>array(92,0,745,729),926=>array(98,0,548,729),927=>array(50,-14,800,742),928=>array(92,0,745,729),929=>array(92,0,692,729),931=>array(92,0,610,729),932=>array(5,0,677,729),933=>array(-10,0,734,729),934=>array(50,0,800,729),935=>array(19,0,751,729),936=>array(56,0,795,729),937=>array(27,0,823,742),938=>array(34,0,342,927),939=>array(-10,0,734,927),940=>array(48,-13,645,800),941=>array(54,-14,493,800),942=>array(84,-208,634,800),943=>array(77,-19,353,800),944=>array(78,-10,629,978),945=>array(48,-13,645,559),946=>array(84,-208,671,773),947=>array(15,-208,667,547),948=>array(43,-14,645,768),949=>array(54,-14,493,560),950=>array(43,-208,542,760),951=>array(84,-208,634,560),952=>array(43,-11,645,768),953=>array(78,-19,348,547),954=>array(84,0,655,547),955=>array(30,0,603,760),956=>array(85,-209,704,547),957=>array(15,0,635,547),958=>array(43,-208,542,760),959=>array(43,-14,644,560),960=>array(42,-19,732,547),961=>array(84,-208,671,562),962=>array(43,-208,526,560),963=>array(43,-14,727,547),964=>array(21,-19,612,547),965=>array(78,-10,629,547),966=>array(64,-208,725,552),967=>array(25,-208,620,547),968=>array(65,-208,724,547),969=>array(43,-13,826,547),970=>array(19,-19,355,774),971=>array(78,-10,629,774),972=>array(43,-14,644,800),973=>array(78,-10,629,800),974=>array(43,-13,826,800),975=>array(92,-208,805,729),976=>array(55,-11,575,768),977=>array(51,-11,612,768),978=>array(21,0,717,729),979=>array(-24,0,954,800),980=>array(21,0,717,927),981=>array(60,-208,729,760),982=>array(22,-13,843,547),983=>array(54,-205,688,548),984=>array(50,-208,800,742),985=>array(43,-208,644,560),986=>array(50,-208,678,729),987=>array(43,-208,541,547),988=>array(92,0,599,729),989=>array(-56,-208,437,760),990=>array(61,2,646,729),991=>array(82,0,571,759),992=>array(56,-208,843,742),993=>array(22,-180,537,559),994=>array(50,-213,1043,729),995=>array(59,-208,775,547),996=>array(50,-208,740,742),997=>array(45,-208,632,560),998=>array(92,-213,878,729),999=>array(21,-14,689,575),1000=>array(42,-208,692,745),1001=>array(46,-208,608,560),1002=>array(53,0,736,742),1003=>array(49,0,622,560),1004=>array(50,-14,715,758),1005=>array(83,-14,670,758),1006=>array(28,-208,654,729),1007=>array(27,-208,563,729),1008=>array(54,-7,688,548),1009=>array(84,-216,671,562),1010=>array(43,-14,526,560),1011=>array(-33,-216,259,760),1012=>array(50,-14,800,742),1013=>array(67,-14,550,560),1014=>array(81,-14,563,560),1015=>array(92,0,692,729),1016=>array(84,-208,671,760),1017=>array(50,-14,670,742),1018=>array(92,0,903,729),1019=>array(73,-208,649,547),1020=>array(33,-208,671,562),1021=>array(33,-14,653,742),1022=>array(50,-14,670,742),1023=>array(33,-14,653,742),1024=>array(92,0,610,927),1025=>array(92,0,610,927),1026=>array(5,-200,798,729),1027=>array(92,0,610,928),1028=>array(50,-14,670,742),1029=>array(72,-14,647,742),1030=>array(92,0,280,729),1031=>array(32,0,339,927),1032=>array(-56,-200,280,729),1033=>array(46,0,1102,729),1034=>array(92,0,1060,729),1035=>array(5,0,798,729),1036=>array(92,0,803,928),1037=>array(92,0,745,927),1038=>array(29,0,741,927),1039=>array(92,-157,745,729),1040=>array(5,0,769,729),1041=>array(92,0,692,729),1042=>array(92,0,692,729),1043=>array(92,0,610,729),1044=>array(60,-157,831,729),1045=>array(92,0,610,729),1046=>array(15,0,1209,729),1047=>array(66,-14,645,742),1048=>array(92,0,745,729),1049=>array(92,0,745,927),1050=>array(92,0,803,729),1051=>array(46,0,739,729),1052=>array(92,0,903,729),1053=>array(92,0,745,729),1054=>array(50,-14,800,742),1055=>array(92,0,745,729),1056=>array(92,0,692,729),1057=>array(50,-14,670,742),1058=>array(5,0,677,729),1059=>array(29,0,741,729),1060=>array(50,0,941,729),1061=>array(19,0,751,729),1062=>array(92,-157,868,729),1063=>array(81,0,716,729),1064=>array(92,0,1143,729),1065=>array(92,-157,1266,729),1066=>array(49,0,890,729),1067=>array(92,0,944,729),1068=>array(92,0,692,729),1069=>array(64,-14,684,742),1070=>array(92,-14,1119,742),1071=>array(64,0,678,729),1072=>array(43,-14,596,560),1073=>array(43,-14,655,792),1074=>array(84,0,589,547),1075=>array(84,0,499,547),1076=>array(56,-138,751,547),1077=>array(43,-14,630,560),1078=>array(15,0,980,547),1079=>array(49,-14,518,560),1080=>array(84,0,617,547),1081=>array(84,0,617,765),1082=>array(84,0,664,547),1083=>array(55,0,648,547),1084=>array(84,0,733,547),1085=>array(84,0,607,547),1086=>array(43,-14,644,560),1087=>array(84,0,607,547),1088=>array(84,-208,671,560),1089=>array(43,-14,526,560),1090=>array(4,0,575,547),1091=>array(12,-216,634,547),1092=>array(55,-208,937,760),1093=>array(15,0,630,547),1094=>array(84,-138,698,547),1095=>array(64,0,573,547),1096=>array(84,0,972,547),1097=>array(84,-138,1063,547),1098=>array(20,0,711,547),1099=>array(84,0,823,547),1100=>array(84,0,588,547),1101=>array(67,-14,550,560),1102=>array(84,-14,928,560),1103=>array(31,0,560,547),1104=>array(43,-14,630,803),1105=>array(43,-14,630,774),1106=>array(20,-216,669,760),1107=>array(84,0,520,803),1108=>array(43,-14,526,560),1109=>array(52,-14,548,560),1110=>array(84,0,259,760),1111=>array(17,0,325,774),1112=>array(-33,-216,259,760),1113=>array(44,0,942,547),1114=>array(84,0,912,547),1115=>array(20,0,656,760),1116=>array(84,0,664,803),1117=>array(84,0,617,803),1118=>array(12,-216,634,765),1119=>array(84,-138,607,547),1120=>array(50,-14,1043,729),1121=>array(43,-13,826,547),1122=>array(49,0,791,729),1123=>array(20,0,692,731),1124=>array(92,-14,948,742),1125=>array(84,-14,760,560),1126=>array(8,0,984,729),1127=>array(25,0,807,547),1128=>array(92,0,1351,729),1129=>array(84,0,1097,547),1130=>array(50,0,800,729),1131=>array(43,0,644,547),1132=>array(92,0,1137,729),1133=>array(84,0,964,547),1134=>array(54,-208,616,938),1135=>array(40,-193,493,756),1136=>array(9,0,1060,729),1137=>array(9,-208,1046,759),1138=>array(50,-14,800,742),1139=>array(43,-14,644,560),1140=>array(5,0,826,742),1141=>array(9,0,681,560),1142=>array(5,0,826,928),1143=>array(9,0,681,800),1144=>array(47,-216,1130,742),1145=>array(43,-216,1025,560),1146=>array(50,-14,1024,742),1147=>array(43,-14,820,560),1148=>array(57,-14,1348,928),1149=>array(47,-13,1126,828),1150=>array(50,-14,1043,910),1151=>array(43,-13,826,746),1152=>array(50,-208,670,742),1153=>array(43,-208,526,560),1154=>array(27,-33,521,488),1155=>array(-601,606,-85,822),1156=>array(-413,638,0,784),1157=>array(-365,595,-231,785),1158=>array(-365,595,-231,785),1159=>array(-796,592,4,788),1160=>array(-1069,-179,383,928),1161=>array(-996,-280,306,1022),1162=>array(92,-208,933,927),1163=>array(84,-208,782,765),1164=>array(23,0,692,729),1165=>array(0,0,567,702),1166=>array(92,0,702,729),1167=>array(84,-208,671,560),1168=>array(92,0,610,878),1169=>array(84,0,499,700),1170=>array(28,0,638,729),1171=>array(21,0,519,547),1172=>array(92,-200,728,729),1173=>array(84,-216,591,547),1174=>array(15,-157,1209,729),1175=>array(15,-138,980,547),1176=>array(66,-196,645,742),1177=>array(49,-196,518,560),1178=>array(92,-157,803,729),1179=>array(84,-138,664,547),1180=>array(92,0,803,729),1181=>array(84,0,664,547),1182=>array(23,0,803,729),1183=>array(7,0,664,760),1184=>array(24,0,1000,729),1185=>array(20,0,812,547),1186=>array(92,-157,932,729),1187=>array(84,-138,783,547),1188=>array(92,0,1075,729),1189=>array(84,0,847,547),1190=>array(92,-200,1193,729),1191=>array(84,-216,939,547),1192=>array(56,-14,924,743),1193=>array(55,-14,836,560),1194=>array(50,-196,670,742),1195=>array(43,-196,526,560),1196=>array(5,-157,677,729),1197=>array(4,-138,575,547),1198=>array(-10,0,734,729),1199=>array(12,-216,634,547),1200=>array(-10,0,734,729),1201=>array(12,-216,634,547),1202=>array(19,-157,751,729),1203=>array(15,-138,630,547),1204=>array(5,-157,1088,729),1205=>array(4,-138,976,547),1206=>array(81,-157,904,729),1207=>array(64,-138,749,547),1208=>array(81,0,716,729),1209=>array(64,0,573,547),1210=>array(81,0,716,729),1211=>array(84,0,634,760),1212=>array(7,-14,976,742),1213=>array(5,-14,761,560),1214=>array(7,-184,976,742),1215=>array(5,-161,761,560),1216=>array(92,0,280,729),1217=>array(15,0,1209,927),1218=>array(15,0,980,784),1219=>array(92,-200,769,729),1220=>array(84,-216,626,547),1221=>array(26,-208,926,729),1222=>array(21,-208,781,547),1223=>array(92,-200,745,729),1224=>array(84,-216,608,547),1225=>array(92,-208,933,729),1226=>array(84,-208,782,547),1227=>array(81,-157,716,729),1228=>array(64,-138,573,547),1229=>array(92,-208,1090,729),1230=>array(84,-208,908,547),1231=>array(84,0,259,760),1232=>array(5,0,769,935),1233=>array(43,-14,596,780),1234=>array(5,0,769,927),1235=>array(43,-14,596,774),1236=>array(0,0,1012,729),1237=>array(43,-14,1000,560),1238=>array(92,0,610,927),1239=>array(43,-14,630,784),1240=>array(51,-14,800,742),1241=>array(43,-14,630,560),1242=>array(51,-14,800,927),1243=>array(43,-14,630,774),1244=>array(15,0,1209,927),1245=>array(15,0,980,774),1246=>array(66,-14,645,927),1247=>array(49,-14,518,773),1248=>array(72,-33,728,729),1249=>array(43,-215,593,547),1250=>array(92,0,745,914),1251=>array(84,0,617,763),1252=>array(92,0,745,927),1253=>array(84,0,617,774),1254=>array(50,-14,800,927),1255=>array(43,-14,644,774),1256=>array(50,-14,800,742),1257=>array(43,-14,644,560),1258=>array(50,-14,800,927),1259=>array(43,-14,644,774),1260=>array(64,-14,684,927),1261=>array(67,-14,550,774),1262=>array(29,0,741,914),1263=>array(12,-216,634,763),1264=>array(29,0,741,927),1265=>array(12,-216,634,774),1266=>array(29,0,741,927),1267=>array(12,-216,634,800),1268=>array(81,0,716,927),1269=>array(64,0,573,774),1270=>array(92,-157,610,729),1271=>array(84,-138,499,547),1272=>array(92,0,944,927),1273=>array(84,0,823,774),1274=>array(28,-216,638,729),1275=>array(21,-217,519,547),1276=>array(19,-200,750,729),1277=>array(15,-216,620,547),1278=>array(19,0,751,729),1279=>array(15,0,630,547),1280=>array(70,0,670,729),1281=>array(44,0,524,547),1282=>array(70,-14,1081,729),1283=>array(44,-14,850,547),1284=>array(98,-14,1027,742),1285=>array(79,-14,836,560),1286=>array(98,-208,804,742),1287=>array(79,-208,668,560),1288=>array(26,-14,1150,729),1289=>array(21,-14,933,547),1290=>array(92,-14,1186,729),1291=>array(84,-14,939,547),1292=>array(50,-14,748,742),1293=>array(43,-14,544,546),1294=>array(5,-14,846,729),1295=>array(4,-14,709,547),1296=>array(67,-14,616,742),1297=>array(54,-14,493,560),1298=>array(46,-200,739,729),1299=>array(55,-216,648,547),1300=>array(46,0,1266,729),1301=>array(55,0,1053,547),1302=>array(92,0,1045,729),1303=>array(84,-208,964,560),1304=>array(64,0,1008,729),1305=>array(31,-14,965,560),1306=>array(50,-146,800,742),1307=>array(45,-208,632,559),1308=>array(30,0,1072,729),1309=>array(35,0,889,547),1310=>array(92,0,803,729),1311=>array(84,0,664,547),1312=>array(46,-200,1187,729),1313=>array(55,-216,980,547),1314=>array(92,-200,1193,729),1315=>array(84,-216,939,547),1316=>array(92,-157,933,729),1317=>array(84,-138,782,547),1329=>array(83,-38,731,729),1330=>array(83,0,655,743),1331=>array(26,0,728,743),1332=>array(22,0,731,743),1333=>array(83,-14,655,729),1334=>array(66,0,664,743),1335=>array(83,0,625,729),1336=>array(83,0,655,743),1337=>array(83,-13,903,742),1338=>array(26,-14,728,729),1339=>array(83,0,648,729),1340=>array(83,0,549,729),1341=>array(83,-14,888,729),1342=>array(62,-12,722,741),1343=>array(74,0,639,729),1344=>array(4,-46,598,729),1345=>array(66,-48,664,743),1346=>array(18,0,715,743),1347=>array(22,0,660,735),1348=>array(83,-14,780,729),1349=>array(57,-14,645,743),1350=>array(0,-14,697,729),1351=>array(57,-14,655,729),1352=>array(83,0,648,743),1353=>array(40,-48,638,743),1354=>array(18,0,789,743),1355=>array(57,0,654,743),1356=>array(83,0,780,743),1357=>array(92,-14,720,729),1358=>array(18,0,715,729),1359=>array(53,-14,641,743),1360=>array(83,0,648,743),1361=>array(57,-14,645,743),1362=>array(83,0,567,729),1363=>array(22,0,811,729),1364=>array(9,0,645,743),1365=>array(49,-14,799,742),1366=>array(44,-14,833,729),1369=>array(104,481,230,760),1370=>array(57,418,250,729),1371=>array(0,616,310,800),1372=>array(0,595,375,893),1373=>array(-7,614,290,847),1374=>array(0,586,460,878),1375=>array(40,618,434,893),1377=>array(71,-13,863,547),1378=>array(76,-208,571,560),1379=>array(40,-208,700,559),1380=>array(76,-208,703,560),1381=>array(71,-14,567,760),1382=>array(40,-208,700,559),1383=>array(76,0,532,760),1384=>array(76,-208,579,560),1385=>array(76,-208,756,560),1386=>array(40,-14,700,760),1387=>array(76,-208,571,760),1388=>array(76,-208,410,547),1389=>array(76,-208,909,760),1390=>array(40,-14,600,760),1391=>array(71,-208,567,760),1392=>array(76,0,571,760),1393=>array(26,-13,536,760),1394=>array(76,-208,703,560),1395=>array(62,-13,570,768),1396=>array(71,-13,699,760),1397=>array(-30,-216,233,547),1398=>array(-61,-13,567,760),1399=>array(13,-208,456,560),1400=>array(76,0,571,560),1401=>array(5,-208,375,547),1402=>array(71,-208,863,546),1403=>array(44,-208,533,560),1404=>array(76,0,622,560),1405=>array(71,-13,567,547),1406=>array(71,-208,699,760),1407=>array(71,-13,863,560),1408=>array(76,-208,571,560),1409=>array(44,-216,631,559),1410=>array(76,0,475,547),1411=>array(71,-208,863,760),1412=>array(-56,-208,604,560),1413=>array(44,-14,645,560),1414=>array(31,-190,774,760),1415=>array(71,-14,808,760),1417=>array(101,0,259,547),1418=>array(49,180,325,359),1456=>array(296,-229,394,-10),1457=>array(147,-229,501,-10),1458=>array(138,-229,492,-10),1459=>array(125,-229,492,-10),1460=>array(296,-171,394,-73),1461=>array(223,-171,467,-73),1462=>array(235,-229,455,-10),1463=>array(174,-171,516,0),1464=>array(187,-217,504,0),1465=>array(-24,547,73,723),1466=>array(-24,547,73,723),1467=>array(187,-239,528,-5),1468=>array(301,225,399,322),1469=>array(296,-217,394,-22),1470=>array(54,413,361,555),1471=>array(187,547,504,710),1472=>array(98,-98,273,645),1473=>array(753,613,851,710),1474=>array(137,613,235,710),1475=>array(98,0,273,547),1478=>array(78,0,462,547),1479=>array(187,-229,504,-10),1488=>array(84,0,644,547),1489=>array(43,0,567,547),1490=>array(43,-9,418,547),1491=>array(43,0,545,547),1492=>array(91,0,596,547),1493=>array(91,0,252,547),1494=>array(43,0,357,547),1495=>array(91,0,596,547),1496=>array(90,-13,624,553),1497=>array(66,164,228,547),1498=>array(43,-240,487,547),1499=>array(43,0,511,547),1500=>array(43,0,527,711),1501=>array(91,0,605,547),1502=>array(43,0,633,554),1503=>array(91,-240,252,547),1504=>array(43,0,362,547),1505=>array(90,-13,624,547),1506=>array(43,-101,575,547),1507=>array(91,-240,584,547),1508=>array(91,0,603,547),1509=>array(11,-240,543,548),1510=>array(33,0,564,547),1511=>array(91,-240,660,546),1512=>array(43,0,511,547),1513=>array(20,0,750,547),1514=>array(10,-4,592,547),1520=>array(91,0,574,547),1521=>array(66,0,524,547),1522=>array(66,164,500,547),1523=>array(84,361,360,547),1524=>array(84,361,626,547),1542=>array(-2,-20,630,892),1543=>array(-2,-20,630,897),1545=>array(65,0,811,635),1546=>array(65,0,1084,635),1548=>array(98,0,322,331),1557=>array(121,612,379,868),1563=>array(98,0,323,689),1567=>array(69,0,515,742),1569=>array(73,20,437,493),1570=>array(-20,0,362,955),1571=>array(75,0,259,993),1572=>array(-42,-244,547,603),1573=>array(76,-245,259,760),1574=>array(63,-107,863,603),1575=>array(84,0,259,760),1576=>array(63,-149,921,327),1577=>array(48,-30,540,513),1578=>array(63,-5,921,415),1579=>array(63,-5,921,537),1580=>array(77,-244,720,425),1581=>array(77,-244,720,425),1582=>array(77,-244,720,579),1583=>array(61,-15,442,415),1584=>array(61,-15,442,579),1585=>array(-42,-244,508,269),1586=>array(-42,-244,508,457),1587=>array(63,-244,1297,366),1588=>array(63,-244,1297,586),1589=>array(63,-244,1265,362),1590=>array(63,-244,1265,457),1591=>array(70,0,971,760),1592=>array(70,0,971,760),1593=>array(87,-244,720,521),1594=>array(87,-244,720,652),1600=>array(-10,0,352,125),1601=>array(63,-24,1082,627),1602=>array(52,-215,825,635),1603=>array(70,-27,814,760),1604=>array(70,-142,778,760),1605=>array(68,-244,660,369),1606=>array(62,-165,779,457),1607=>array(48,-30,540,358),1608=>array(-42,-244,547,322),1609=>array(63,-107,863,462),1610=>array(63,-244,863,462),1611=>array(107,591,393,825),1612=>array(107,591,393,881),1613=>array(107,-239,393,-5),1614=>array(107,591,393,723),1615=>array(107,590,393,881),1616=>array(107,-137,393,-5),1617=>array(88,599,412,869),1618=>array(115,610,383,878),1619=>array(59,584,441,735),1620=>array(154,601,335,822),1621=>array(155,-245,336,-23),1623=>array(107,615,393,906),1626=>array(99,616,401,775),1632=>array(218,195,392,366),1633=>array(140,0,431,635),1634=>array(12,0,598,635),1635=>array(12,0,597,635),1636=>array(74,-10,530,646),1637=>array(63,-10,547,643),1638=>array(37,0,574,635),1639=>array(15,0,596,635),1640=>array(15,0,596,635),1641=>array(32,0,590,640),1642=>array(65,0,545,635),1643=>array(0,-118,349,318),1644=>array(63,418,278,729),1645=>array(42,101,502,537),1646=>array(63,-5,921,327),1647=>array(52,-215,825,484),1648=>array(216,600,284,885),1652=>array(51,641,232,863),1657=>array(63,-5,921,599),1658=>array(63,-5,921,566),1659=>array(63,-244,921,327),1660=>array(63,-171,921,415),1661=>array(63,-5,921,566),1662=>array(63,-244,921,327),1663=>array(63,-5,921,566),1664=>array(63,-244,921,327),1665=>array(77,-244,720,725),1666=>array(77,-244,720,737),1667=>array(77,-244,720,425),1668=>array(77,-244,720,425),1669=>array(77,-244,720,737),1670=>array(77,-244,720,425),1671=>array(77,-244,720,425),1672=>array(61,-15,442,746),1673=>array(61,-180,442,415),1674=>array(61,-171,442,415),1675=>array(61,-171,442,746),1676=>array(61,-15,442,586),1677=>array(61,-146,442,415),1678=>array(61,-15,442,708),1679=>array(61,-15,442,684),1680=>array(61,-15,442,708),1681=>array(-42,-244,520,648),1682=>array(-42,-244,542,556),1683=>array(-42,-244,587,269),1684=>array(-42,-244,522,269),1685=>array(-42,-244,753,269),1686=>array(-42,-244,522,269),1687=>array(-42,-244,508,464),1688=>array(-42,-244,508,586),1689=>array(-42,-244,508,586),1690=>array(63,-244,1297,464),1691=>array(63,-244,1297,366),1692=>array(63,-244,1297,586),1693=>array(63,-244,1265,362),1694=>array(63,-244,1265,586),1695=>array(70,0,971,760),1696=>array(87,-244,720,781),1697=>array(63,-24,1082,484),1698=>array(63,-171,1082,484),1699=>array(63,-171,1082,635),1700=>array(63,-24,1082,786),1701=>array(63,-293,1082,484),1702=>array(63,-24,1082,786),1703=>array(52,-215,825,635),1704=>array(52,-215,825,757),1705=>array(63,-39,1024,760),1706=>array(63,-39,1194,760),1707=>array(63,-39,1024,760),1708=>array(70,-27,814,760),1709=>array(70,-27,814,854),1710=>array(70,-293,814,760),1711=>array(63,-39,1024,910),1712=>array(63,-39,1024,910),1713=>array(63,-39,1024,910),1714=>array(63,-171,1024,910),1715=>array(63,-293,1024,910),1716=>array(63,-39,1024,1025),1717=>array(70,-142,841,971),1718=>array(70,-142,778,952),1719=>array(70,-142,781,1025),1720=>array(70,-391,778,760),1721=>array(62,-317,779,464),1722=>array(62,-165,779,366),1723=>array(62,-165,779,636),1724=>array(62,-330,779,464),1725=>array(62,-165,779,586),1726=>array(70,-33,877,506),1727=>array(77,-244,720,579),1734=>array(-42,-244,547,556),1740=>array(63,-107,863,462),1742=>array(63,-107,863,556),1749=>array(48,-30,540,358),1776=>array(218,195,392,366),1777=>array(140,0,431,635),1778=>array(12,0,598,635),1779=>array(12,0,597,635),1780=>array(12,0,573,650),1781=>array(30,-8,580,643),1782=>array(85,0,514,645),1783=>array(15,0,596,635),1784=>array(15,0,596,635),1785=>array(32,0,590,640),1984=>array(48,-14,648,742),1985=>array(69,0,583,729),1986=>array(80,0,616,729),1987=>array(80,0,616,729),1988=>array(80,0,616,729),1989=>array(80,0,616,729),1990=>array(80,0,616,729),1991=>array(98,0,599,729),1992=>array(98,0,599,729),1993=>array(70,0,625,742),1994=>array(84,0,259,729),1995=>array(43,-14,504,465),1996=>array(15,0,529,729),1997=>array(15,0,637,451),1998=>array(84,0,607,451),1999=>array(84,0,607,451),2000=>array(46,0,548,742),2001=>array(84,0,607,667),2002=>array(43,0,820,742),2003=>array(84,0,467,729),2004=>array(84,0,467,729),2005=>array(84,0,584,729),2006=>array(84,0,604,729),2007=>array(15,0,360,729),2008=>array(84,0,938,532),2009=>array(15,0,491,729),2010=>array(15,0,811,729),2011=>array(84,0,607,451),2012=>array(15,0,637,729),2013=>array(84,0,869,729),2014=>array(84,0,543,729),2015=>array(43,0,692,729),2016=>array(15,0,491,729),2017=>array(15,0,637,729),2018=>array(43,0,531,729),2019=>array(84,0,543,729),2020=>array(84,0,543,581),2021=>array(84,0,543,729),2022=>array(43,0,531,729),2023=>array(43,0,531,729),2027=>array(95,668,403,760),2028=>array(63,638,438,777),2029=>array(185,654,319,774),2030=>array(65,616,433,800),2031=>array(33,616,438,803),2032=>array(63,638,438,777),2033=>array(33,616,438,803),2034=>array(183,-212,317,-92),2035=>array(96,654,404,774),2036=>array(63,418,278,729),2037=>array(103,418,318,729),2040=>array(84,0,607,562),2041=>array(84,0,607,564),2042=>array(-10,0,425,125),3647=>array(62,-147,638,760),3713=>array(43,-14,706,560),3714=>array(43,-14,723,560),3716=>array(43,-14,704,560),3719=>array(21,-241,521,561),3720=>array(42,0,705,560),3722=>array(40,-269,768,560),3725=>array(40,-24,713,610),3732=>array(42,-14,647,560),3733=>array(42,-19,647,561),3734=>array(-22,-240,684,560),3735=>array(20,-14,768,560),3737=>array(37,-15,681,560),3738=>array(38,-15,664,561),3739=>array(38,-15,664,760),3740=>array(60,-12,910,626),3741=>array(64,-14,762,760),3742=>array(76,-14,773,560),3743=>array(76,-14,773,760),3745=>array(24,-14,771,547),3746=>array(40,-23,713,760),3747=>array(48,-10,733,615),3749=>array(41,-33,693,560),3751=>array(33,-33,640,561),3754=>array(51,-21,819,724),3755=>array(44,-21,935,620),3757=>array(53,-20,662,606),3758=>array(48,-14,825,698),3759=>array(43,-259,897,648),3760=>array(36,-16,658,567),3761=>array(-653,610,-31,896),3762=>array(39,0,563,593),3763=>array(-479,0,563,875),3764=>array(-654,622,-62,950),3765=>array(-654,633,13,962),3766=>array(-654,622,-62,950),3767=>array(-654,633,13,962),3768=>array(-426,-385,-165,-55),3769=>array(-473,-316,-174,-28),3771=>array(-653,610,-31,896),3772=>array(-682,-311,15,-48),3773=>array(39,-220,691,776),3776=>array(83,-13,444,561),3777=>array(83,-13,818,561),3778=>array(-37,-14,458,936),3779=>array(23,-14,595,879),3780=>array(-15,-35,585,809),3782=>array(70,-240,688,582),3784=>array(-413,659,-297,844),3785=>array(-627,622,-22,918),3786=>array(-667,621,39,965),3787=>array(-521,612,-187,917),3788=>array(-682,603,15,866),3789=>array(-479,668,-229,875),3792=>array(66,-29,723,563),3793=>array(25,-139,721,586),3794=>array(31,-80,603,711),3795=>array(24,-14,882,981),3796=>array(48,-156,696,711),3797=>array(48,-156,696,711),3798=>array(64,-14,894,950),3799=>array(43,-240,706,560),3800=>array(72,-269,774,582),3801=>array(58,-14,858,564),3804=>array(44,-21,1301,620),3805=>array(44,-21,1305,620),4256=>array(47,-14,827,819),4257=>array(39,-0,719,819),4258=>array(37,-138,667,828),4259=>array(41,-15,793,819),4260=>array(29,0,572,828),4261=>array(24,0,729,828),4262=>array(15,-14,709,819),4263=>array(49,-14,890,828),4264=>array(4,0,415,862),4265=>array(39,0,581,819),4266=>array(18,-14,796,820),4267=>array(48,-14,837,819),4268=>array(43,0,586,819),4269=>array(37,-157,817,829),4270=>array(11,-14,731,822),4271=>array(20,0,585,823),4272=>array(43,-15,863,820),4273=>array(43,-15,587,820),4274=>array(43,-0,586,828),4275=>array(37,-170,817,828),4276=>array(37,0,828,825),4277=>array(28,0,695,820),4278=>array(44,0,586,828),4279=>array(34,0,577,820),4280=>array(39,-14,582,820),4281=>array(43,0,586,819),4282=>array(45,-14,778,827),4283=>array(46,-15,822,820),4284=>array(43,-0,586,819),4285=>array(29,-15,594,828),4286=>array(43,-0,586,819),4287=>array(15,0,726,819),4288=>array(18,-14,796,820),4289=>array(43,0,586,820),4290=>array(37,-15,652,828),4291=>array(9,0,552,820),4292=>array(33,0,561,820),4293=>array(24,-14,714,828),4304=>array(49,-14,505,599),4305=>array(49,-14,515,823),4306=>array(44,-232,578,561),4307=>array(49,-225,786,557),4308=>array(49,-232,496,557),4309=>array(49,-232,505,557),4310=>array(25,-14,502,828),4311=>array(49,-14,779,557),4312=>array(49,0,515,557),4313=>array(49,-232,506,542),4314=>array(49,-225,1025,562),4315=>array(49,-14,505,828),4316=>array(63,-14,520,819),4317=>array(49,-0,765,557),4318=>array(49,-14,505,818),4319=>array(49,-232,504,560),4320=>array(49,0,774,830),4321=>array(63,-14,520,818),4322=>array(49,-232,651,670),4323=>array(29,-232,533,604),4324=>array(49,-232,792,558),4325=>array(49,-232,496,818),4326=>array(49,-225,766,557),4327=>array(49,-232,505,549),4328=>array(20,-14,489,828),4329=>array(63,0,520,828),4330=>array(49,-232,573,548),4331=>array(49,-14,504,818),4332=>array(64,-15,534,828),4333=>array(49,-232,517,818),4334=>array(63,-14,520,818),4335=>array(24,-232,516,580),4336=>array(49,-15,505,823),4337=>array(49,-14,505,823),4338=>array(49,-146,504,557),4339=>array(49,-232,505,558),4340=>array(49,-232,504,828),4341=>array(49,-14,558,828),4342=>array(49,-232,803,557),4343=>array(49,-232,556,557),4344=>array(49,-232,505,549),4345=>array(44,-232,578,561),4346=>array(49,-111,505,557),4347=>array(49,0,399,500),4348=>array(24,400,294,828),5121=>array(5,0,769,729),5122=>array(5,0,769,1056),5123=>array(5,0,769,729),5124=>array(5,0,769,928),5125=>array(92,0,821,729),5126=>array(92,0,821,928),5127=>array(92,0,821,927),5129=>array(92,0,821,729),5130=>array(84,0,813,729),5131=>array(84,0,813,928),5132=>array(92,0,1013,729),5133=>array(5,0,925,729),5134=>array(92,0,1013,729),5135=>array(5,0,925,729),5136=>array(92,0,1013,928),5137=>array(5,0,925,928),5138=>array(92,0,1065,729),5139=>array(92,0,1056,729),5140=>array(92,0,1065,928),5141=>array(92,0,1056,928),5142=>array(92,0,821,928),5143=>array(92,0,1057,729),5144=>array(84,0,1058,729),5145=>array(92,0,1057,928),5146=>array(84,0,1058,928),5147=>array(84,0,813,928),5149=>array(92,607,226,728),5150=>array(60,326,473,734),5151=>array(31,338,379,722),5152=>array(31,338,379,722),5153=>array(60,392,338,711),5154=>array(60,352,338,670),5155=>array(60,392,338,670),5156=>array(60,392,338,670),5157=>array(31,327,518,749),5158=>array(60,326,414,734),5159=>array(92,304,226,424),5160=>array(60,494,338,569),5161=>array(60,392,338,670),5162=>array(60,392,338,693),5163=>array(5,0,1167,729),5164=>array(5,0,940,729),5165=>array(92,0,1170,729),5166=>array(84,0,1251,729),5167=>array(5,0,769,729),5168=>array(5,0,769,1056),5169=>array(5,0,769,729),5170=>array(5,0,769,928),5171=>array(73,0,802,729),5172=>array(73,0,802,928),5173=>array(73,0,802,927),5175=>array(73,0,802,729),5176=>array(73,0,802,729),5177=>array(73,0,802,928),5178=>array(92,0,1013,729),5179=>array(5,0,925,729),5180=>array(92,0,1013,729),5181=>array(5,0,925,729),5182=>array(92,0,1013,928),5183=>array(5,0,925,928),5184=>array(92,0,1046,729),5185=>array(73,0,1056,729),5186=>array(92,0,1046,928),5187=>array(73,0,1056,928),5188=>array(92,0,1046,729),5189=>array(73,0,1058,729),5190=>array(92,0,1046,928),5191=>array(73,0,1058,928),5192=>array(73,0,802,927),5193=>array(60,326,520,727),5194=>array(60,326,172,734),5196=>array(92,-14,720,729),5197=>array(92,0,720,1056),5198=>array(92,0,720,743),5199=>array(92,0,720,928),5200=>array(73,0,759,729),5201=>array(73,0,759,928),5202=>array(73,0,759,927),5204=>array(73,0,759,729),5205=>array(56,0,742,729),5206=>array(56,0,742,928),5207=>array(92,-14,964,729),5208=>array(92,-14,964,729),5209=>array(92,0,964,743),5210=>array(92,0,964,743),5211=>array(92,0,964,928),5212=>array(92,0,964,928),5213=>array(92,0,1003,729),5214=>array(73,0,970,729),5215=>array(92,0,1003,928),5216=>array(73,0,970,928),5217=>array(92,0,986,729),5218=>array(56,0,968,729),5219=>array(92,0,986,928),5220=>array(56,0,968,928),5221=>array(92,0,986,729),5222=>array(60,326,427,733),5223=>array(92,-14,949,734),5224=>array(92,0,949,743),5225=>array(73,0,967,734),5226=>array(56,0,960,734),5227=>array(41,0,651,743),5228=>array(92,0,702,1056),5229=>array(92,0,702,743),5230=>array(92,0,702,928),5231=>array(41,-14,651,729),5232=>array(41,-14,651,928),5233=>array(41,-14,708,927),5234=>array(92,-14,702,729),5235=>array(92,-14,702,928),5236=>array(92,0,937,743),5237=>array(41,0,891,743),5238=>array(92,0,939,743),5239=>array(92,0,891,743),5240=>array(92,0,939,928),5241=>array(92,0,891,928),5242=>array(92,-14,937,729),5243=>array(41,-14,891,729),5244=>array(92,-14,937,928),5245=>array(41,-14,891,928),5246=>array(92,-14,939,729),5247=>array(92,-14,891,729),5248=>array(92,-14,939,928),5249=>array(92,-14,891,928),5250=>array(92,-14,939,729),5251=>array(60,319,445,734),5252=>array(60,319,445,734),5253=>array(41,0,881,743),5254=>array(92,0,881,743),5255=>array(41,-14,881,734),5256=>array(92,-14,881,734),5257=>array(41,0,651,743),5258=>array(92,0,702,1056),5259=>array(92,0,702,743),5260=>array(92,0,702,928),5261=>array(41,-14,651,729),5262=>array(41,-14,651,928),5263=>array(41,-14,714,927),5264=>array(92,-14,702,729),5265=>array(92,-14,702,928),5266=>array(92,0,937,743),5267=>array(41,0,891,743),5268=>array(92,0,988,743),5269=>array(92,0,891,743),5270=>array(92,0,988,928),5271=>array(92,0,891,928),5272=>array(92,-14,937,729),5273=>array(41,-14,891,729),5274=>array(92,-14,937,928),5275=>array(41,-14,891,928),5276=>array(92,-14,988,729),5277=>array(92,-14,891,729),5278=>array(92,-14,988,928),5279=>array(92,-14,891,928),5280=>array(92,-14,988,729),5281=>array(60,319,445,734),5282=>array(60,319,445,734),5283=>array(27,0,535,729),5284=>array(92,0,599,1056),5285=>array(92,0,599,729),5286=>array(92,0,599,928),5287=>array(27,0,535,729),5288=>array(27,0,535,928),5289=>array(27,0,598,927),5290=>array(92,0,599,729),5291=>array(92,0,599,928),5292=>array(92,0,790,729),5293=>array(27,0,771,729),5294=>array(92,0,836,729),5295=>array(92,0,790,729),5296=>array(92,0,836,928),5297=>array(92,0,790,928),5298=>array(92,0,790,729),5299=>array(27,0,790,729),5300=>array(92,0,790,928),5301=>array(27,0,790,928),5302=>array(92,0,836,729),5303=>array(92,0,790,729),5304=>array(92,0,836,928),5305=>array(92,0,790,928),5306=>array(92,0,836,729),5307=>array(60,326,380,734),5308=>array(60,326,492,733),5309=>array(60,326,380,734),5312=>array(84,-14,947,468),5313=>array(41,-14,904,786),5314=>array(41,-14,904,468),5315=>array(41,-14,904,667),5316=>array(27,0,890,482),5317=>array(27,0,890,667),5318=>array(27,0,890,667),5319=>array(41,0,904,482),5320=>array(41,0,904,667),5321=>array(92,-14,1197,468),5322=>array(84,-14,1163,468),5323=>array(92,0,1172,482),5324=>array(41,0,1144,482),5325=>array(92,0,1172,667),5326=>array(41,0,1144,667),5327=>array(41,0,904,667),5328=>array(60,477,604,742),5329=>array(60,319,440,734),5330=>array(60,477,604,742),5331=>array(84,0,947,468),5332=>array(41,0,904,786),5333=>array(41,0,904,468),5334=>array(41,0,904,667),5335=>array(27,0,890,468),5336=>array(27,0,890,667),5337=>array(27,0,890,667),5338=>array(41,0,904,468),5339=>array(41,0,904,667),5340=>array(92,0,1190,468),5341=>array(84,0,1163,468),5342=>array(92,0,1199,468),5343=>array(41,0,1144,468),5344=>array(92,0,1199,667),5345=>array(41,0,1144,667),5346=>array(92,0,1187,468),5347=>array(27,0,1130,468),5348=>array(92,0,1187,667),5349=>array(27,0,1130,667),5350=>array(92,0,1199,468),5351=>array(41,0,1144,468),5352=>array(92,0,1199,667),5353=>array(41,0,1144,667),5354=>array(60,477,604,734),5356=>array(73,0,802,729),5357=>array(41,0,638,729),5358=>array(92,0,736,1056),5359=>array(92,0,689,729),5360=>array(92,0,689,928),5361=>array(41,0,638,729),5362=>array(41,0,638,928),5363=>array(41,0,694,927),5364=>array(92,0,689,729),5365=>array(92,0,689,928),5366=>array(92,0,906,729),5367=>array(41,0,875,729),5368=>array(92,0,926,729),5369=>array(92,0,905,729),5370=>array(92,0,926,928),5371=>array(92,0,905,928),5372=>array(92,0,906,729),5373=>array(41,0,875,729),5374=>array(92,0,906,928),5375=>array(41,0,875,928),5376=>array(92,0,926,729),5377=>array(92,0,905,729),5378=>array(92,0,926,928),5379=>array(92,0,905,928),5380=>array(92,0,926,729),5381=>array(60,326,437,734),5382=>array(60,319,404,742),5383=>array(60,326,437,734),5392=>array(41,-14,882,743),5393=>array(41,-14,882,743),5394=>array(41,-14,882,928),5395=>array(41,-14,1095,482),5396=>array(41,-14,1095,667),5397=>array(41,-14,1095,482),5398=>array(41,-14,1095,667),5399=>array(92,-14,1168,743),5400=>array(41,-14,1118,743),5401=>array(92,-14,1168,743),5402=>array(41,-14,1118,743),5403=>array(92,-14,1168,928),5404=>array(41,-14,1118,928),5405=>array(92,-14,1390,482),5406=>array(41,-14,1336,482),5407=>array(92,-14,1390,667),5408=>array(41,-14,1336,667),5409=>array(92,-14,1390,482),5410=>array(41,-14,1336,482),5411=>array(92,-14,1390,667),5412=>array(41,-14,1336,667),5413=>array(60,469,690,747),5414=>array(84,0,684,729),5415=>array(92,0,692,1056),5416=>array(92,0,692,729),5417=>array(92,0,692,928),5418=>array(84,0,684,729),5419=>array(84,0,684,928),5420=>array(84,0,750,927),5421=>array(92,0,692,729),5422=>array(92,0,692,928),5423=>array(92,0,911,729),5424=>array(84,0,919,729),5425=>array(92,0,929,729),5426=>array(92,0,912,729),5427=>array(92,0,929,928),5428=>array(92,0,912,928),5429=>array(92,0,911,729),5430=>array(84,0,919,729),5431=>array(92,0,911,928),5432=>array(84,0,919,928),5433=>array(92,0,929,729),5434=>array(92,0,912,729),5435=>array(92,0,929,928),5436=>array(92,0,912,928),5437=>array(92,0,929,928),5438=>array(60,326,438,734),5440=>array(60,392,338,670),5441=>array(60,326,454,734),5442=>array(92,-14,949,468),5443=>array(84,-14,941,468),5444=>array(27,0,884,482),5445=>array(92,0,949,786),5446=>array(92,0,949,482),5447=>array(92,0,949,667),5448=>array(92,0,692,729),5449=>array(92,0,692,928),5450=>array(92,0,692,729),5451=>array(41,0,641,729),5452=>array(41,0,641,928),5453=>array(41,0,641,729),5454=>array(92,0,911,928),5455=>array(41,0,875,928),5456=>array(60,326,438,727),5458=>array(73,0,802,729),5459=>array(51,0,769,743),5460=>array(51,-14,769,1056),5461=>array(51,-14,769,729),5462=>array(51,-14,769,928),5463=>array(73,0,844,663),5464=>array(73,0,844,928),5465=>array(84,0,855,663),5466=>array(84,0,855,928),5467=>array(92,0,1099,928),5468=>array(84,0,1058,928),5469=>array(60,311,546,675),5470=>array(92,-14,720,743),5471=>array(92,-14,720,743),5472=>array(92,-14,720,743),5473=>array(92,-14,720,743),5474=>array(92,-14,720,928),5475=>array(92,-14,720,928),5476=>array(54,0,759,729),5477=>array(54,0,759,928),5478=>array(56,0,762,729),5479=>array(56,0,762,928),5480=>array(92,0,1006,928),5481=>array(56,0,968,928),5482=>array(60,326,512,733),5492=>array(41,0,893,743),5493=>array(84,0,936,743),5494=>array(84,0,936,928),5495=>array(41,-14,893,729),5496=>array(41,-14,893,928),5497=>array(84,-14,936,729),5498=>array(84,-14,936,928),5499=>array(60,319,562,734),5500=>array(92,0,745,729),5501=>array(60,326,454,734),5502=>array(60,0,1197,1056),5503=>array(60,0,1197,743),5504=>array(60,0,1197,928),5505=>array(60,-14,1146,729),5506=>array(60,-14,1146,928),5507=>array(60,-14,1197,729),5508=>array(60,-14,1197,928),5509=>array(60,319,939,734),5514=>array(41,0,893,743),5515=>array(84,0,936,743),5516=>array(41,-14,893,729),5517=>array(84,-14,936,729),5518=>array(60,0,1550,1056),5519=>array(60,0,1550,743),5520=>array(60,0,1550,928),5521=>array(60,-14,1203,741),5522=>array(60,-14,1203,928),5523=>array(60,-14,1550,741),5524=>array(60,-14,1550,928),5525=>array(60,335,792,741),5526=>array(60,335,1217,741),5536=>array(41,0,904,709),5537=>array(41,0,904,709),5538=>array(27,-242,890,468),5539=>array(27,-242,890,667),5540=>array(41,-242,904,468),5541=>array(41,-242,904,667),5542=>array(60,344,604,734),5543=>array(84,0,771,729),5544=>array(5,0,692,729),5545=>array(5,0,692,928),5546=>array(84,0,771,729),5547=>array(84,0,771,928),5548=>array(5,0,692,729),5549=>array(5,0,692,928),5550=>array(15,326,438,734),5551=>array(92,-14,702,729),5598=>array(92,0,778,729),5601=>array(52,0,738,729),5702=>array(60,326,439,734),5703=>array(60,240,439,820),5742=>array(10,0,403,306),5743=>array(60,0,1146,743),5744=>array(60,0,1499,743),5745=>array(60,0,1975,743),5746=>array(60,0,1975,928),5747=>array(60,-14,1628,741),5748=>array(60,-14,1586,928),5749=>array(60,-14,1975,741),5750=>array(60,-14,1975,928),5760=>array(-10,219,553,354),5761=>array(-10,-125,646,354),5762=>array(-10,-125,955,354),5763=>array(-10,-125,1264,354),5764=>array(-10,-125,1572,354),5765=>array(-10,-125,1881,354),5766=>array(-10,219,637,697),5767=>array(-10,219,945,697),5768=>array(-10,219,1264,697),5769=>array(-10,219,1569,697),5770=>array(-10,219,1881,697),5771=>array(-10,-125,579,697),5772=>array(-10,-125,888,697),5773=>array(-10,-125,1198,697),5774=>array(-10,-125,1507,697),5775=>array(-10,-125,1817,697),5776=>array(-10,41,646,532),5777=>array(-10,41,955,532),5778=>array(-10,41,1264,532),5779=>array(-10,41,1572,532),5780=>array(-10,41,1881,532),5781=>array(-10,-125,579,697),5782=>array(-10,-125,948,697),5783=>array(-10,-109,798,354),5784=>array(-10,-254,1244,354),5785=>array(-10,219,1569,928),5786=>array(-10,14,750,354),5787=>array(55,-49,648,622),5788=>array(-10,-49,583,622),7424=>array(15,0,637,547),7425=>array(0,0,755,547),7426=>array(43,-14,1000,560),7427=>array(20,0,564,547),7428=>array(43,-14,526,560),7429=>array(84,-1,611,547),7430=>array(20,-1,611,547),7431=>array(92,0,480,547),7432=>array(54,-14,493,560),7433=>array(84,-213,259,547),7434=>array(44,-14,416,547),7435=>array(84,0,684,547),7436=>array(-18,0,499,547),7437=>array(84,0,733,547),7438=>array(84,0,617,547),7439=>array(43,-14,644,560),7440=>array(43,-14,526,560),7441=>array(43,-27,617,573),7442=>array(43,31,617,515),7443=>array(13,-28,653,579),7444=>array(43,-14,1046,560),7446=>array(43,273,644,560),7447=>array(44,-14,646,273),7448=>array(51,0,515,547),7449=>array(21,0,560,547),7450=>array(21,0,560,547),7451=>array(4,0,575,547),7452=>array(84,-14,607,547),7453=>array(85,10,646,560),7454=>array(69,10,857,561),7455=>array(19,-238,651,560),7456=>array(15,0,637,547),7457=>array(35,0,889,547),7458=>array(45,0,534,547),7459=>array(57,-14,581,547),7462=>array(84,0,499,547),7463=>array(15,0,637,547),7464=>array(84,0,607,547),7465=>array(51,0,515,547),7466=>array(84,0,698,547),7467=>array(55,0,648,547),7468=>array(3,326,484,734),7469=>array(0,326,638,734),7470=>array(58,326,436,734),7472=>array(58,326,490,734),7473=>array(58,326,384,734),7474=>array(58,326,384,734),7475=>array(31,318,471,742),7476=>array(58,326,469,734),7477=>array(58,326,176,734),7478=>array(-35,214,176,734),7479=>array(58,326,507,734),7480=>array(58,326,384,734),7481=>array(58,326,569,734),7482=>array(58,326,469,734),7483=>array(58,326,469,734),7484=>array(31,318,504,742),7485=>array(39,318,471,742),7486=>array(58,326,436,734),7487=>array(58,326,473,734),7488=>array(3,326,426,734),7489=>array(58,318,454,734),7490=>array(19,326,675,734),7491=>array(53,318,402,640),7492=>array(53,318,402,640),7493=>array(53,318,423,640),7494=>array(53,318,656,640),7495=>array(53,318,423,751),7496=>array(53,318,423,751),7497=>array(53,318,423,640),7498=>array(53,318,423,640),7499=>array(53,318,330,640),7500=>array(53,318,330,640),7501=>array(53,205,423,639),7502=>array(53,207,164,632),7503=>array(53,326,431,751),7504=>array(53,326,607,640),7505=>array(53,205,399,640),7506=>array(53,318,432,640),7507=>array(53,318,357,640),7508=>array(53,479,432,640),7509=>array(53,318,432,479),7510=>array(53,209,423,640),7511=>array(53,326,332,719),7512=>array(53,318,399,632),7513=>array(53,332,407,640),7514=>array(53,318,607,632),7515=>array(53,326,445,632),7517=>array(53,209,423,759),7518=>array(10,209,420,632),7519=>array(27,318,406,756),7520=>array(41,209,457,635),7521=>array(16,209,391,632),7522=>array(53,0,164,425),7523=>array(54,0,314,313),7524=>array(53,-8,399,306),7525=>array(53,0,445,306),7526=>array(53,-117,423,433),7527=>array(10,-117,420,306),7528=>array(53,-117,423,314),7529=>array(41,-117,457,309),7530=>array(16,-117,391,306),7543=>array(84,-216,671,559),7544=>array(58,326,469,734),7547=>array(84,0,461,547),7549=>array(5,-208,742,560),7557=>array(84,-216,434,760),7579=>array(53,318,423,640),7580=>array(53,318,357,640),7581=>array(53,288,357,640),7582=>array(53,318,432,751),7583=>array(53,318,330,640),7584=>array(53,326,321,751),7585=>array(53,205,292,632),7586=>array(53,205,423,632),7587=>array(53,207,399,632),7588=>array(53,326,291,751),7589=>array(53,326,226,632),7590=>array(53,326,291,632),7591=>array(53,326,291,632),7592=>array(53,205,375,751),7593=>array(53,205,270,751),7594=>array(53,205,274,751),7595=>array(53,326,314,632),7596=>array(53,205,608,640),7597=>array(53,209,607,632),7598=>array(53,205,506,640),7599=>array(53,205,505,640),7600=>array(53,326,393,632),7601=>array(53,318,432,640),7602=>array(53,209,486,751),7603=>array(53,205,366,640),7604=>array(53,205,340,751),7605=>array(53,205,332,719),7606=>array(53,318,527,632),7607=>array(53,298,438,632),7608=>array(53,318,383,632),7609=>array(53,326,395,632),7610=>array(53,326,445,632),7611=>array(53,326,361,632),7612=>array(53,205,468,632),7613=>array(53,288,414,632),7614=>array(53,206,399,632),7615=>array(53,320,370,756),7620=>array(-467,616,-35,800),7621=>array(-467,616,-35,800),7622=>array(-467,616,-35,800),7623=>array(-467,616,-35,800),7624=>array(-513,616,11,800),7625=>array(-513,616,11,800),7680=>array(5,-240,769,729),7681=>array(43,-240,596,560),7682=>array(92,0,692,928),7683=>array(84,-14,671,913),7684=>array(92,-212,692,729),7685=>array(84,-212,671,760),7686=>array(92,-184,692,729),7687=>array(84,-184,671,760),7688=>array(50,-196,670,927),7689=>array(43,-196,526,800),7690=>array(92,0,778,927),7691=>array(45,-14,632,942),7692=>array(92,-212,778,729),7693=>array(45,-212,632,760),7694=>array(92,-184,778,729),7695=>array(45,-184,632,760),7696=>array(92,-192,778,729),7697=>array(45,-196,632,760),7698=>array(92,-240,778,729),7699=>array(45,-240,632,760),7700=>array(92,0,610,1057),7701=>array(43,-14,630,927),7702=>array(92,0,610,1057),7703=>array(43,-14,630,927),7704=>array(92,-203,610,729),7705=>array(43,-203,630,560),7706=>array(92,-195,610,729),7707=>array(43,-195,630,560),7708=>array(92,-196,610,927),7709=>array(43,-196,630,784),7710=>array(92,0,599,928),7711=>array(19,0,444,942),7712=>array(50,-14,747,901),7713=>array(45,-216,632,760),7714=>array(92,0,745,928),7715=>array(84,0,634,913),7716=>array(92,-212,745,729),7717=>array(84,-212,634,760),7718=>array(92,0,745,927),7719=>array(23,0,634,927),7720=>array(45,-196,745,729),7721=>array(38,-196,634,760),7722=>array(92,-236,745,729),7723=>array(84,-236,634,760),7724=>array(16,-195,355,729),7725=>array(1,-195,341,760),7726=>array(40,0,378,1057),7727=>array(16,0,354,917),7728=>array(92,0,805,927),7729=>array(84,0,684,982),7730=>array(92,-212,805,729),7731=>array(84,-212,684,760),7732=>array(92,-184,805,729),7733=>array(84,-184,684,760),7734=>array(92,-212,610,729),7735=>array(83,-212,259,760),7736=>array(32,-212,610,942),7737=>array(18,-212,325,914),7738=>array(92,-184,610,729),7739=>array(20,-184,328,760),7740=>array(92,-240,610,729),7741=>array(-13,-240,355,760),7742=>array(92,0,903,927),7743=>array(83,0,963,800),7744=>array(92,0,903,928),7745=>array(83,0,963,760),7746=>array(92,-212,903,729),7747=>array(83,-212,963,560),7748=>array(92,0,745,928),7749=>array(84,0,634,760),7750=>array(92,-212,745,729),7751=>array(84,-212,634,560),7752=>array(92,-184,745,729),7753=>array(84,-184,634,560),7754=>array(92,-240,745,729),7755=>array(84,-240,634,560),7756=>array(50,-14,800,1057),7757=>array(43,-14,644,916),7758=>array(50,-14,800,1043),7759=>array(43,-14,644,900),7760=>array(50,-14,800,1057),7761=>array(43,-14,644,927),7762=>array(50,-14,800,1057),7763=>array(43,-14,644,927),7764=>array(92,0,692,927),7765=>array(84,-208,671,800),7766=>array(92,0,692,928),7767=>array(84,-208,671,760),7768=>array(92,0,750,928),7769=>array(84,0,490,760),7770=>array(92,-212,750,729),7771=>array(83,-212,490,560),7772=>array(92,-212,750,914),7773=>array(83,-212,490,759),7774=>array(92,-184,750,729),7775=>array(33,-184,490,560),7776=>array(72,-14,647,928),7777=>array(52,-14,548,760),7778=>array(72,-212,647,742),7779=>array(52,-212,548,560),7780=>array(72,-14,647,928),7781=>array(52,-14,548,816),7782=>array(72,-14,647,1053),7783=>array(52,-14,548,1002),7784=>array(72,-212,647,928),7785=>array(52,-212,548,762),7786=>array(5,0,677,927),7787=>array(13,0,455,942),7788=>array(5,-212,677,729),7789=>array(13,-212,455,702),7790=>array(5,-184,677,729),7791=>array(13,-184,455,702),7792=>array(5,-240,677,729),7793=>array(13,-240,455,702),7794=>array(92,-212,720,729),7795=>array(78,-212,628,547),7796=>array(92,-196,720,729),7797=>array(78,-195,628,547),7798=>array(92,-203,720,729),7799=>array(78,-203,628,547),7800=>array(92,-14,720,1057),7801=>array(78,-14,628,916),7802=>array(92,-14,720,1043),7803=>array(78,-14,628,887),7804=>array(5,0,769,928),7805=>array(15,0,637,778),7806=>array(5,-212,769,729),7807=>array(15,-212,637,547),7808=>array(30,0,1072,931),7809=>array(35,0,889,803),7810=>array(30,0,1072,931),7811=>array(35,0,889,803),7812=>array(30,0,1072,927),7813=>array(35,0,889,774),7814=>array(30,0,1072,927),7815=>array(35,0,889,760),7816=>array(30,-212,1072,729),7817=>array(35,-212,889,547),7818=>array(19,0,751,928),7819=>array(15,0,630,760),7820=>array(19,0,751,927),7821=>array(15,0,630,774),7822=>array(-10,0,734,928),7823=>array(12,-216,634,760),7824=>array(45,0,680,927),7825=>array(45,0,534,798),7826=>array(45,-212,680,729),7827=>array(45,-212,534,547),7828=>array(45,-184,680,729),7829=>array(45,-184,534,547),7830=>array(84,-184,634,760),7831=>array(13,0,455,927),7832=>array(35,0,889,888),7833=>array(12,-216,634,888),7834=>array(43,-14,758,760),7835=>array(19,0,444,942),7836=>array(-18,0,444,760),7837=>array(19,0,444,760),7838=>array(92,-14,823,743),7839=>array(43,-14,645,768),7840=>array(5,-212,769,729),7841=>array(43,-212,596,560),7842=>array(5,0,769,1025),7843=>array(43,-14,596,843),7844=>array(5,0,769,1054),7845=>array(43,-14,652,873),7846=>array(5,0,769,1054),7847=>array(43,-14,597,874),7848=>array(5,0,769,1093),7849=>array(43,-14,672,912),7850=>array(5,0,769,1068),7851=>array(43,-14,596,887),7852=>array(5,-212,769,927),7853=>array(43,-212,596,800),7854=>array(5,0,769,1057),7855=>array(43,-14,596,891),7856=>array(5,0,769,1057),7857=>array(43,-14,596,894),7858=>array(5,0,769,1123),7859=>array(43,-14,596,959),7860=>array(5,0,769,1068),7861=>array(43,-14,596,905),7862=>array(5,-212,769,935),7863=>array(43,-212,596,780),7864=>array(92,-212,610,729),7865=>array(43,-212,630,560),7866=>array(92,0,610,1025),7867=>array(43,-14,630,843),7868=>array(92,0,610,928),7869=>array(43,-14,630,778),7870=>array(92,0,684,1054),7871=>array(43,-14,688,873),7872=>array(92,0,621,1054),7873=>array(43,-14,630,874),7874=>array(92,0,686,1093),7875=>array(43,-14,681,912),7876=>array(92,0,610,1068),7877=>array(43,-14,630,887),7878=>array(92,-212,610,927),7879=>array(43,-212,630,800),7880=>array(66,0,313,1025),7881=>array(52,0,300,842),7882=>array(92,-212,280,729),7883=>array(83,-212,259,760),7884=>array(50,-212,800,742),7885=>array(43,-212,644,560),7886=>array(50,-14,800,1025),7887=>array(43,-14,644,843),7888=>array(50,-14,800,1054),7889=>array(43,-14,679,873),7890=>array(50,-14,800,1054),7891=>array(43,-14,644,874),7892=>array(50,-14,800,1093),7893=>array(43,-14,685,912),7894=>array(50,-14,800,1068),7895=>array(43,-14,644,887),7896=>array(50,-212,800,927),7897=>array(43,-212,644,800),7898=>array(53,-14,854,927),7899=>array(46,-14,708,800),7900=>array(53,-14,854,927),7901=>array(46,-14,708,800),7902=>array(53,-14,854,1025),7903=>array(46,-14,708,843),7904=>array(53,-14,854,928),7905=>array(46,-14,708,778),7906=>array(53,-212,854,761),7907=>array(46,-212,708,609),7908=>array(92,-212,720,729),7909=>array(78,-212,628,547),7910=>array(92,-14,720,1025),7911=>array(78,-14,628,843),7912=>array(91,-14,833,927),7913=>array(75,-14,733,800),7914=>array(91,-14,833,927),7915=>array(75,-14,733,800),7916=>array(91,-14,833,1025),7917=>array(75,-14,733,843),7918=>array(91,-14,833,928),7919=>array(75,-14,733,778),7920=>array(91,-212,833,761),7921=>array(75,-212,733,609),7922=>array(-10,0,734,931),7923=>array(12,-216,634,803),7924=>array(-10,-212,734,729),7925=>array(12,-216,634,547),7926=>array(-10,0,734,1029),7927=>array(12,-216,634,843),7928=>array(-10,0,734,928),7929=>array(12,-216,634,778),7930=>array(92,0,925,729),7931=>array(9,0,635,760),7936=>array(48,-13,645,785),7937=>array(48,-13,645,785),7938=>array(48,-13,645,800),7939=>array(48,-13,645,800),7940=>array(48,-13,645,800),7941=>array(48,-13,645,800),7942=>array(48,-13,645,928),7943=>array(48,-13,645,928),7944=>array(5,0,769,785),7945=>array(5,0,769,785),7946=>array(2,0,1036,800),7947=>array(3,0,1039,800),7948=>array(1,0,930,800),7949=>array(2,0,958,800),7950=>array(4,0,831,928),7951=>array(3,0,854,928),7952=>array(54,-14,493,785),7953=>array(54,-14,493,785),7954=>array(54,-14,498,800),7955=>array(54,-14,493,800),7956=>array(54,-14,531,800),7957=>array(54,-14,516,800),7960=>array(3,0,718,785),7961=>array(4,0,721,785),7962=>array(2,0,1026,800),7963=>array(3,0,1023,800),7964=>array(1,0,950,800),7965=>array(2,0,979,800),7968=>array(84,-208,634,785),7969=>array(84,-208,634,785),7970=>array(84,-208,634,800),7971=>array(84,-208,634,800),7972=>array(84,-208,634,800),7973=>array(84,-208,634,800),7974=>array(84,-208,634,928),7975=>array(84,-208,634,928),7976=>array(3,0,854,785),7977=>array(4,0,859,785),7978=>array(2,0,1159,800),7979=>array(3,0,1158,800),7980=>array(1,0,1088,800),7981=>array(2,0,1114,800),7982=>array(4,0,962,928),7983=>array(3,0,971,928),7984=>array(78,-19,348,785),7985=>array(78,-19,348,785),7986=>array(-27,-19,407,800),7987=>array(-58,-19,376,800),7988=>array(31,-19,446,800),7989=>array(-6,-19,438,800),7990=>array(-2,-19,348,928),7991=>array(-5,-19,348,928),7992=>array(3,0,391,785),7993=>array(4,0,397,785),7994=>array(2,0,685,800),7995=>array(3,0,693,800),7996=>array(1,0,620,800),7997=>array(2,0,646,800),7998=>array(4,0,512,928),7999=>array(3,0,512,928),8000=>array(43,-14,644,785),8001=>array(43,-14,644,785),8002=>array(43,-14,644,800),8003=>array(43,-14,644,800),8004=>array(43,-14,644,800),8005=>array(43,-14,644,800),8008=>array(3,-14,841,785),8009=>array(4,-14,883,785),8010=>array(2,-14,1171,800),8011=>array(3,-14,1173,800),8012=>array(1,-14,1002,800),8013=>array(2,-14,1032,800),8016=>array(78,-10,629,785),8017=>array(78,-10,629,785),8018=>array(78,-10,629,800),8019=>array(78,-10,629,800),8020=>array(78,-10,629,800),8021=>array(78,-10,629,800),8022=>array(78,-10,629,928),8023=>array(78,-10,629,928),8025=>array(4,0,940,785),8027=>array(3,0,1194,800),8029=>array(2,0,1208,800),8031=>array(3,0,1059,928),8032=>array(43,-13,826,785),8033=>array(43,-13,826,785),8034=>array(43,-13,826,800),8035=>array(43,-13,826,800),8036=>array(43,-13,826,800),8037=>array(43,-13,826,800),8038=>array(43,-13,826,928),8039=>array(43,-13,826,928),8040=>array(3,0,881,785),8041=>array(4,0,931,785),8042=>array(2,0,1219,800),8043=>array(3,-3,1224,800),8044=>array(1,0,1048,800),8045=>array(2,0,1078,800),8046=>array(4,0,1000,928),8047=>array(3,0,1048,928),8048=>array(48,-13,645,800),8049=>array(48,-13,645,800),8050=>array(54,-14,493,800),8051=>array(54,-14,493,800),8052=>array(84,-208,634,800),8053=>array(84,-208,634,800),8054=>array(-26,-19,348,800),8055=>array(77,-19,353,800),8056=>array(43,-14,644,800),8057=>array(43,-14,644,800),8058=>array(78,-10,629,800),8059=>array(78,-10,629,800),8060=>array(43,-13,826,800),8061=>array(43,-13,826,800),8064=>array(48,-208,645,785),8065=>array(48,-208,645,785),8066=>array(48,-208,645,800),8067=>array(48,-208,645,800),8068=>array(48,-208,645,800),8069=>array(48,-208,645,800),8070=>array(48,-208,645,928),8071=>array(48,-208,645,928),8072=>array(5,-208,769,785),8073=>array(5,-208,769,785),8074=>array(2,-208,1036,800),8075=>array(3,-208,1039,800),8076=>array(1,-208,930,800),8077=>array(2,-208,958,800),8078=>array(4,-208,831,928),8079=>array(3,-208,854,928),8080=>array(84,-208,634,785),8081=>array(84,-208,634,785),8082=>array(84,-208,634,800),8083=>array(84,-208,634,800),8084=>array(84,-208,634,800),8085=>array(84,-208,634,800),8086=>array(84,-208,634,928),8087=>array(84,-208,634,928),8088=>array(3,-208,854,785),8089=>array(4,-208,859,785),8090=>array(2,-208,1159,800),8091=>array(3,-208,1158,800),8092=>array(1,-208,1088,800),8093=>array(2,-208,1114,800),8094=>array(4,-208,962,928),8095=>array(3,-208,971,928),8096=>array(43,-208,826,785),8097=>array(43,-208,826,785),8098=>array(43,-208,826,800),8099=>array(43,-208,826,800),8100=>array(43,-208,826,800),8101=>array(43,-208,826,800),8102=>array(43,-208,826,928),8103=>array(43,-208,826,928),8104=>array(3,-208,881,785),8105=>array(4,-208,931,785),8106=>array(2,-208,1219,800),8107=>array(3,-208,1224,800),8108=>array(1,-208,1048,800),8109=>array(2,-208,1078,800),8110=>array(4,-208,1000,928),8111=>array(3,-208,1048,928),8112=>array(48,-13,645,784),8113=>array(48,-13,645,760),8114=>array(48,-208,645,800),8115=>array(48,-208,645,559),8116=>array(48,-208,645,800),8118=>array(48,-13,645,778),8119=>array(48,-208,645,778),8120=>array(5,0,769,927),8121=>array(5,0,769,914),8122=>array(-1,0,872,800),8123=>array(26,0,792,800),8124=>array(5,-208,769,729),8125=>array(183,595,317,785),8126=>array(202,-208,333,-45),8127=>array(183,595,317,785),8128=>array(80,638,420,778),8129=>array(80,654,420,928),8130=>array(84,-208,634,800),8131=>array(84,-208,634,560),8132=>array(84,-208,634,800),8134=>array(84,-208,634,778),8135=>array(84,-208,634,778),8136=>array(-1,0,856,800),8137=>array(-24,0,771,800),8138=>array(-1,0,988,800),8139=>array(-18,0,915,800),8140=>array(92,-208,745,729),8141=>array(34,595,468,800),8142=>array(63,595,478,800),8143=>array(80,595,420,928),8144=>array(3,-19,348,784),8145=>array(20,-19,348,760),8146=>array(-36,-19,348,978),8147=>array(23,-19,372,978),8150=>array(4,-19,348,778),8151=>array(-6,-19,348,928),8152=>array(21,0,350,927),8153=>array(32,0,339,914),8154=>array(-1,0,529,800),8155=>array(-21,0,450,800),8157=>array(40,595,474,800),8158=>array(45,595,489,800),8159=>array(80,595,420,928),8160=>array(78,-10,629,784),8161=>array(78,-10,629,760),8162=>array(78,-10,629,978),8163=>array(78,-10,629,978),8164=>array(84,-208,671,785),8165=>array(84,-208,671,785),8166=>array(78,-10,629,778),8167=>array(78,-10,629,928),8168=>array(-10,0,734,927),8169=>array(-10,0,734,914),8170=>array(-1,0,1030,800),8171=>array(-27,0,992,800),8172=>array(4,0,797,785),8173=>array(46,654,404,978),8174=>array(96,654,445,978),8175=>array(46,616,322,800),8178=>array(43,-208,826,800),8179=>array(43,-208,826,547),8180=>array(43,-208,826,800),8182=>array(43,-13,826,778),8183=>array(43,-208,826,778),8184=>array(-1,-14,1015,800),8185=>array(-19,-14,836,800),8186=>array(-1,0,1057,800),8187=>array(-30,0,867,800),8188=>array(27,-208,823,742),8189=>array(178,616,454,800),8190=>array(183,595,317,785),8208=>array(54,217,361,359),8209=>array(54,217,361,359),8210=>array(54,211,642,337),8211=>array(54,211,446,337),8212=>array(54,211,946,337),8213=>array(0,211,1000,337),8214=>array(127,-236,399,764),8215=>array(0,-236,500,-9),8216=>array(103,418,318,729),8217=>array(63,418,278,729),8218=>array(72,-122,287,189),8219=>array(63,418,278,729),8220=>array(103,418,565,729),8221=>array(92,418,554,729),8222=>array(72,-122,534,189),8223=>array(92,418,554,729),8224=>array(26,-96,470,729),8225=>array(25,-96,470,729),8226=>array(144,196,495,547),8227=>array(144,157,534,586),8228=>array(79,0,255,189),8229=>array(79,0,588,189),8230=>array(79,0,921,189),8231=>array(86,253,262,442),8240=>array(32,-14,1417,742),8241=>array(32,-14,1864,742),8242=>array(20,547,240,729),8243=>array(20,547,423,729),8244=>array(20,547,606,729),8245=>array(20,547,240,729),8246=>array(20,547,425,729),8247=>array(20,547,606,729),8248=>array(101,-238,632,29),8249=>array(77,67,318,519),8250=>array(94,67,335,519),8251=>array(72,0,900,829),8252=>array(69,0,558,729),8253=>array(69,0,515,742),8254=>array(0,663,500,755),8255=>array(-31,-237,859,-79),8256=>array(-31,769,859,927),8257=>array(-52,-235,296,231),8258=>array(20,-37,1003,832),8259=>array(96,220,404,358),8260=>array(-199,-14,366,742),8261=>array(86,-132,389,760),8262=>array(68,-132,371,760),8263=>array(34,0,996,742),8264=>array(69,0,760,742),8265=>array(69,0,760,742),8266=>array(49,-125,464,546),8267=>array(93,-96,579,729),8268=>array(75,189,425,541),8269=>array(75,189,425,541),8270=>array(20,0,503,464),8271=>array(104,-142,329,547),8272=>array(-31,-237,859,927),8273=>array(53,-14,439,797),8274=>array(30,-93,529,729),8275=>array(49,212,951,415),8276=>array(-31,-240,859,-82),8277=>array(152,98,686,631),8278=>array(110,93,574,645),8279=>array(20,547,789,729),8280=>array(76,21,762,708),8281=>array(126,71,712,657),8282=>array(102,0,280,729),8283=>array(49,-170,822,898),8284=>array(55,0,783,729),8285=>array(102,0,278,683),8286=>array(102,0,278,683),8304=>array(29,319,398,742),8305=>array(53,326,164,751),8308=>array(27,326,397,734),8309=>array(47,319,384,734),8310=>array(38,319,394,742),8311=>array(41,326,378,734),8312=>array(38,319,389,742),8313=>array(32,319,388,742),8314=>array(67,326,461,677),8315=>array(67,469,461,534),8316=>array(67,407,461,596),8317=>array(54,252,237,751),8318=>array(50,252,234,751),8319=>array(54,326,406,640),8320=>array(29,-7,398,416),8321=>array(60,0,382,408),8322=>array(53,0,382,416),8323=>array(44,-7,384,416),8324=>array(27,0,397,408),8325=>array(47,-7,384,408),8326=>array(38,-7,394,416),8327=>array(41,0,378,408),8328=>array(38,-7,389,416),8329=>array(32,-7,388,416),8330=>array(67,0,461,351),8331=>array(67,143,461,208),8332=>array(67,81,461,270),8333=>array(54,-74,237,425),8334=>array(50,-74,234,425),8336=>array(53,-8,402,313),8337=>array(53,-8,423,313),8338=>array(53,-8,432,313),8339=>array(10,0,403,306),8340=>array(53,-8,423,313),8341=>array(54,0,406,425),8342=>array(53,0,431,425),8343=>array(54,0,166,425),8344=>array(53,0,607,313),8345=>array(54,0,406,313),8346=>array(53,-117,423,313),8347=>array(33,-8,351,313),8348=>array(53,0,332,393),8352=>array(38,0,892,729),8353=>array(50,-44,634,778),8354=>array(29,-14,667,742),8355=>array(75,0,663,729),8356=>array(61,0,613,742),8357=>array(83,-93,963,640),8358=>array(43,0,794,729),8359=>array(92,-14,1470,729),8360=>array(92,-14,1157,729),8361=>array(13,0,1088,729),8362=>array(39,-14,859,729),8363=>array(30,-182,692,760),8364=>array(-19,-14,629,742),8365=>array(29,0,695,729),8366=>array(12,0,684,729),8367=>array(92,-223,1247,742),8368=>array(14,-14,648,742),8369=>array(34,0,696,729),8370=>array(50,-81,643,809),8371=>array(5,0,691,729),8372=>array(43,-14,816,742),8373=>array(72,-147,629,760),8376=>array(12,0,684,729),8377=>array(50,0,647,729),8378=>array(5,0,745,729),8400=>array(-498,628,-26,760),8401=>array(-470,628,1,760),8406=>array(-470,560,-26,760),8407=>array(-470,560,-26,760),8411=>array(-501,654,-1,774),8412=>array(-595,654,99,774),8417=>array(-470,560,-26,760),8448=>array(20,-24,1083,752),8449=>array(20,-24,1137,752),8450=>array(50,-14,670,742),8451=>array(87,-14,1147,749),8452=>array(64,0,832,729),8453=>array(20,-24,1064,752),8454=>array(20,-24,1117,752),8455=>array(67,-14,616,742),8456=>array(64,-146,684,611),8457=>array(87,0,1002,749),8459=>array(36,-14,1063,746),8460=>array(6,-125,809,747),8461=>array(100,0,788,729),8462=>array(31,0,654,760),8463=>array(10,0,625,760),8464=>array(36,-14,533,742),8465=>array(52,-14,659,743),8466=>array(37,-14,787,742),8467=>array(-14,-14,401,742),8468=>array(9,-14,936,760),8469=>array(92,0,745,729),8470=>array(34,0,1154,729),8471=>array(138,0,862,725),8472=>array(54,-221,658,495),8473=>array(92,0,709,729),8474=>array(50,-146,800,742),8475=>array(31,-14,904,768),8476=>array(41,-14,803,743),8477=>array(98,0,793,729),8478=>array(37,0,859,729),8479=>array(81,-112,694,887),8480=>array(127,444,792,731),8481=>array(3,0,1249,547),8482=>array(144,447,790,729),8483=>array(11,-113,729,885),8484=>array(45,0,709,729),8485=>array(26,-230,540,777),8486=>array(27,0,823,742),8487=>array(27,-14,823,728),8488=>array(-5,-159,670,729),8489=>array(1,0,271,566),8490=>array(92,0,805,729),8491=>array(5,0,769,928),8492=>array(41,-1,853,772),8493=>array(63,-19,767,742),8494=>array(61,-12,793,647),8495=>array(41,-14,591,533),8496=>array(72,-14,668,742),8497=>array(37,-14,860,773),8498=>array(92,0,599,729),8499=>array(38,-18,1156,751),8500=>array(29,-12,436,420),8501=>array(50,-14,761,742),8502=>array(19,-14,687,742),8503=>array(31,-35,439,742),8504=>array(63,-41,633,742),8505=>array(34,0,355,760),8506=>array(44,-27,932,723),8507=>array(69,0,1352,547),8508=>array(34,-14,765,547),8509=>array(-40,-208,700,561),8510=>array(92,0,627,729),8511=>array(92,0,771,729),8512=>array(12,-192,820,719),8513=>array(25,-14,723,742),8514=>array(9,0,527,729),8515=>array(43,0,561,729),8516=>array(0,0,744,729),8517=>array(21,0,786,729),8518=>array(34,-14,752,760),8519=>array(33,-14,635,560),8520=>array(15,0,353,760),8521=>array(-143,-216,354,760),8523=>array(41,-14,811,742),8526=>array(55,0,470,547),8528=>array(49,-14,983,742),8529=>array(49,-14,993,742),8530=>array(49,-14,1441,742),8531=>array(49,-14,989,742),8532=>array(53,-14,989,742),8533=>array(49,-14,989,742),8534=>array(53,-14,989,742),8535=>array(44,-14,989,742),8536=>array(27,-14,989,742),8537=>array(49,-14,999,742),8538=>array(47,-14,999,742),8539=>array(49,-14,994,742),8540=>array(44,-14,994,742),8541=>array(47,-14,994,742),8542=>array(41,-14,994,742),8543=>array(49,-14,814,742),8544=>array(92,0,280,729),8545=>array(92,0,566,729),8546=>array(92,0,853,729),8547=>array(92,0,1094,729),8548=>array(5,0,769,729),8549=>array(5,0,1007,729),8550=>array(5,0,1293,729),8551=>array(5,0,1580,729),8552=>array(92,0,1101,729),8553=>array(19,0,751,729),8554=>array(19,0,1028,729),8555=>array(19,0,1314,729),8556=>array(92,0,610,729),8557=>array(50,-14,670,742),8558=>array(92,0,778,729),8559=>array(92,0,903,729),8560=>array(84,0,259,760),8561=>array(84,0,523,760),8562=>array(84,0,788,760),8563=>array(84,0,946,760),8564=>array(15,0,637,547),8565=>array(15,0,878,760),8566=>array(15,0,1143,760),8567=>array(15,0,1407,760),8568=>array(84,0,954,760),8569=>array(15,0,630,547),8570=>array(15,0,885,760),8571=>array(15,0,1149,760),8572=>array(84,0,259,760),8573=>array(43,-14,526,560),8574=>array(45,-14,632,760),8575=>array(83,0,963,560),8576=>array(52,0,1236,729),8577=>array(92,0,778,729),8578=>array(52,0,1236,729),8579=>array(50,-14,670,742),8580=>array(43,-14,526,560),8581=>array(50,-208,670,742),8585=>array(29,-14,989,742),8592=>array(49,87,781,540),8593=>array(193,0,646,732),8594=>array(57,87,789,540),8595=>array(193,-3,646,729),8596=>array(49,87,789,540),8597=>array(193,-3,646,732),8598=>array(136,66,720,650),8599=>array(136,66,720,650),8600=>array(136,66,720,650),8601=>array(136,66,720,650),8602=>array(49,87,781,540),8603=>array(57,87,789,540),8604=>array(13,84,833,431),8605=>array(5,84,825,431),8606=>array(49,87,781,540),8607=>array(189,0,641,732),8608=>array(57,87,789,540),8609=>array(194,-3,646,729),8610=>array(49,87,793,540),8611=>array(45,87,789,540),8612=>array(49,87,781,540),8613=>array(193,0,646,732),8614=>array(57,87,789,540),8615=>array(193,0,646,732),8616=>array(193,0,646,732),8617=>array(49,87,781,565),8618=>array(57,87,789,565),8619=>array(49,87,781,565),8620=>array(57,87,789,565),8621=>array(49,87,789,540),8622=>array(49,86,789,541),8623=>array(123,-4,714,733),8624=>array(169,0,646,755),8625=>array(192,0,669,755),8626=>array(169,-26,646,729),8627=>array(192,-26,669,729),8628=>array(233,-3,772,621),8629=>array(49,87,673,626),8630=>array(11,198,816,685),8631=>array(22,198,828,685),8632=>array(118,13,788,729),8633=>array(49,-108,789,735),8634=>array(86,45,767,691),8635=>array(71,45,751,691),8636=>array(49,255,781,540),8637=>array(49,87,781,372),8638=>array(361,0,646,732),8639=>array(193,0,478,732),8640=>array(57,255,789,540),8641=>array(57,87,789,372),8642=>array(361,0,646,732),8643=>array(193,0,478,732),8644=>array(49,-59,789,686),8645=>array(47,-3,792,732),8646=>array(49,-59,789,686),8647=>array(49,-59,781,686),8648=>array(46,0,792,732),8649=>array(57,-59,789,686),8650=>array(46,-3,792,729),8651=>array(49,-5,789,632),8652=>array(49,-5,789,632),8653=>array(49,87,781,540),8654=>array(49,87,789,540),8655=>array(57,87,789,540),8656=>array(49,87,781,540),8657=>array(193,0,645,732),8658=>array(57,87,789,540),8659=>array(193,-3,645,729),8660=>array(49,87,789,540),8661=>array(193,-8,645,732),8662=>array(132,-26,755,596),8663=>array(88,-26,711,597),8664=>array(88,16,711,639),8665=>array(132,16,755,639),8666=>array(49,87,781,540),8667=>array(57,87,789,540),8668=>array(44,87,776,540),8669=>array(57,87,789,540),8670=>array(193,0,646,732),8671=>array(193,-3,646,729),8672=>array(49,87,781,540),8673=>array(193,0,646,732),8674=>array(57,87,789,540),8675=>array(193,-3,646,729),8676=>array(49,87,781,540),8677=>array(57,87,789,540),8678=>array(27,46,781,581),8679=>array(151,0,687,754),8680=>array(35,46,789,581),8681=>array(151,-25,687,729),8682=>array(151,0,687,754),8683=>array(151,0,687,754),8684=>array(151,0,687,754),8685=>array(151,0,687,754),8686=>array(151,0,687,754),8687=>array(151,0,687,754),8688=>array(35,46,789,581),8689=>array(60,0,788,729),8690=>array(60,0,788,729),8691=>array(151,-25,687,754),8692=>array(57,87,789,540),8693=>array(47,-3,792,732),8694=>array(57,-223,789,850),8695=>array(49,87,781,540),8696=>array(57,87,789,540),8697=>array(49,87,789,540),8698=>array(49,87,781,540),8699=>array(57,87,789,540),8700=>array(49,87,789,540),8701=>array(27,96,781,531),8702=>array(57,96,811,531),8703=>array(27,96,811,531),8704=>array(5,0,769,729),8705=>array(48,-14,629,742),8706=>array(29,-14,515,674),8707=>array(92,0,610,729),8708=>array(92,-46,610,775),8709=>array(47,-15,810,715),8710=>array(0,0,697,719),8711=>array(0,0,697,719),8712=>array(73,-2,824,730),8713=>array(73,-46,824,775),8714=>array(106,58,644,568),8715=>array(73,-2,824,730),8716=>array(73,-46,824,775),8717=>array(106,58,644,568),8718=>array(98,0,539,553),8719=>array(73,-192,712,719),8720=>array(73,-193,712,718),8721=>array(20,-192,697,719),8722=>array(106,256,732,371),8723=>array(106,0,732,627),8724=>array(49,0,647,729),8725=>array(0,-93,365,729),8726=>array(165,-49,530,772),8727=>array(118,0,720,626),8728=>array(150,151,475,477),8729=>array(102,253,278,442),8730=>array(37,-20,669,837),8731=>array(37,-20,669,933),8732=>array(36,-20,669,924),8733=>array(92,89,617,505),8734=>array(92,89,741,505),8735=>array(106,67,732,693),8736=>array(77,0,820,729),8737=>array(77,-44,820,729),8738=>array(116,-0,732,726),8739=>array(207,-207,322,773),8740=>array(48,-207,482,773),8741=>array(112,-207,417,773),8742=>array(48,-207,482,773),8743=>array(151,0,661,579),8744=>array(151,0,661,579),8745=>array(151,0,661,579),8746=>array(151,0,661,579),8747=>array(15,-227,548,754),8748=>array(15,-227,914,754),8749=>array(15,-227,1280,754),8750=>array(14,-227,548,754),8751=>array(38,-227,938,754),8752=>array(23,-227,1290,754),8753=>array(15,-227,616,754),8754=>array(14,-227,600,754),8755=>array(14,-227,588,754),8756=>array(60,78,637,647),8757=>array(60,78,637,647),8758=>array(59,79,235,647),8759=>array(60,78,637,647),8760=>array(106,256,732,631),8761=>array(106,45,800,584),8762=>array(106,-4,732,631),8763=>array(106,-34,732,660),8764=>array(106,212,732,415),8765=>array(106,212,732,415),8766=>array(65,131,772,497),8767=>array(106,42,732,584),8768=>array(85,0,289,626),8769=>array(106,76,732,551),8770=>array(106,110,732,482),8771=>array(106,144,732,517),8772=>array(106,0,732,637),8773=>array(106,37,732,628),8774=>array(106,-31,732,628),8775=>array(106,-86,732,726),8776=>array(106,110,732,517),8777=>array(106,8,732,614),8778=>array(106,37,732,628),8779=>array(106,-13,732,628),8780=>array(106,37,732,628),8781=>array(105,105,732,585),8782=>array(106,26,732,656),8783=>array(106,172,732,656),8784=>array(106,144,732,744),8785=>array(106,-117,732,743),8786=>array(105,-92,732,719),8787=>array(104,-92,731,719),8788=>array(98,102,965,520),8789=>array(96,102,966,520),8790=>array(106,144,732,482),8791=>array(106,144,732,839),8792=>array(106,144,732,704),8793=>array(106,144,732,840),8794=>array(106,144,732,840),8795=>array(106,144,732,959),8796=>array(106,144,732,952),8797=>array(106,144,732,762),8798=>array(106,144,732,786),8799=>array(106,144,732,903),8800=>array(106,-5,732,631),8801=>array(106,38,732,588),8802=>array(106,-69,732,695),8803=>array(106,-74,732,700),8804=>array(106,0,732,582),8805=>array(106,0,732,582),8806=>array(106,-106,732,617),8807=>array(106,-106,732,617),8808=>array(106,-185,732,617),8809=>array(106,-185,732,617),8810=>array(72,-34,974,660),8811=>array(72,-34,974,660),8812=>array(86,-132,414,759),8813=>array(105,-10,732,700),8814=>array(106,-4,732,690),8815=>array(106,-63,732,631),8816=>array(106,-112,732,645),8817=>array(106,-112,732,645),8818=>array(106,-84,732,582),8819=>array(106,-84,732,582),8820=>array(106,-112,732,645),8821=>array(106,-112,732,645),8822=>array(102,-119,732,678),8823=>array(102,-119,732,678),8824=>array(102,-221,732,779),8825=>array(102,-221,732,779),8826=>array(106,-55,732,681),8827=>array(106,-55,732,681),8828=>array(106,-177,732,684),8829=>array(106,-177,732,684),8830=>array(106,-132,732,684),8831=>array(106,-132,732,684),8832=>array(106,-89,732,781),8833=>array(106,-89,732,781),8834=>array(99,67,739,559),8835=>array(99,65,739,559),8836=>array(99,-96,739,726),8837=>array(99,-100,739,722),8838=>array(99,0,739,636),8839=>array(99,0,739,635),8840=>array(99,-124,739,759),8841=>array(99,-124,739,759),8842=>array(99,-97,739,636),8843=>array(99,-97,739,635),8844=>array(151,0,661,579),8845=>array(151,0,661,579),8846=>array(151,0,661,579),8847=>array(106,0,732,584),8848=>array(106,0,732,584),8849=>array(106,-115,732,667),8850=>array(106,-115,732,667),8851=>array(106,0,690,626),8852=>array(106,0,690,626),8853=>array(91,-14,747,643),8854=>array(91,-14,747,643),8855=>array(91,-14,747,643),8856=>array(91,-13,747,642),8857=>array(91,-14,747,643),8858=>array(91,-14,747,643),8859=>array(91,-14,747,643),8860=>array(91,-14,747,643),8861=>array(91,-14,747,643),8862=>array(77,-29,761,657),8863=>array(77,-29,761,657),8864=>array(77,-29,761,657),8865=>array(77,-29,761,657),8866=>array(85,0,829,705),8867=>array(85,0,829,705),8868=>array(85,0,829,705),8869=>array(85,0,829,705),8870=>array(85,0,457,705),8871=>array(85,0,457,705),8872=>array(85,0,829,705),8873=>array(85,0,829,705),8874=>array(85,0,829,705),8875=>array(85,0,829,705),8876=>array(85,-100,829,805),8877=>array(85,-100,829,805),8878=>array(85,-100,829,805),8879=>array(85,-100,829,805),8880=>array(106,-54,724,681),8881=>array(114,-54,732,681),8882=>array(106,-1,732,628),8883=>array(106,-1,732,628),8884=>array(106,-80,732,706),8885=>array(106,-80,732,706),8886=>array(60,151,940,477),8887=>array(60,151,940,477),8888=>array(60,151,778,477),8889=>array(43,-63,794,689),8890=>array(63,0,480,705),8891=>array(103,0,709,759),8892=>array(103,0,709,759),8893=>array(103,0,709,759),8894=>array(106,0,732,626),8895=>array(106,0,732,626),8896=>array(0,-192,843,719),8897=>array(0,-192,843,719),8898=>array(48,-192,794,719),8899=>array(48,-192,794,719),8900=>array(3,-233,491,807),8901=>array(102,253,278,442),8902=>array(83,112,543,549),8903=>array(106,-56,732,683),8904=>array(106,-48,894,674),8905=>array(106,-48,894,675),8906=>array(106,-48,894,675),8907=>array(106,-48,894,675),8908=>array(106,-48,894,675),8909=>array(106,144,732,517),8910=>array(49,0,763,579),8911=>array(49,0,763,579),8912=>array(93,-22,732,649),8913=>array(106,-22,745,649),8914=>array(83,0,755,639),8915=>array(83,-14,755,625),8916=>array(186,0,652,729),8917=>array(106,-100,732,729),8918=>array(106,30,732,597),8919=>array(106,30,732,597),8920=>array(72,-34,1350,660),8921=>array(72,-34,1350,660),8922=>array(106,-211,732,837),8923=>array(106,-211,732,837),8924=>array(106,0,732,582),8925=>array(106,0,732,582),8926=>array(106,-177,732,684),8927=>array(106,-177,732,684),8928=>array(106,-197,732,808),8929=>array(106,-263,732,742),8930=>array(106,-191,732,817),8931=>array(106,-191,732,817),8932=>array(106,-146,732,636),8933=>array(106,-146,732,636),8934=>array(106,-168,732,582),8935=>array(106,-168,732,582),8936=>array(106,-216,732,684),8937=>array(106,-216,732,684),8938=>array(106,-138,732,808),8939=>array(106,-138,732,808),8940=>array(106,-224,732,894),8941=>array(106,-224,732,894),8942=>array(412,-40,588,735),8943=>array(79,253,921,442),8944=>array(79,-40,921,735),8945=>array(79,-40,921,735),8946=>array(72,-2,1085,730),8947=>array(73,-2,824,730),8948=>array(106,58,644,568),8949=>array(73,-2,824,984),8950=>array(73,-2,824,919),8951=>array(106,58,644,741),8952=>array(73,-207,824,730),8953=>array(73,-2,824,730),8954=>array(72,-2,1085,730),8955=>array(73,-2,824,730),8956=>array(106,58,644,568),8957=>array(72,-2,824,919),8958=>array(106,58,644,741),8959=>array(106,0,791,732),8960=>array(31,-22,572,519),8961=>array(56,152,540,453),8962=>array(64,0,651,596),8963=>array(193,470,646,732),8964=>array(193,0,646,263),8965=>array(193,-12,646,423),8966=>array(193,-12,646,552),8967=>array(139,-39,349,798),8968=>array(86,-132,389,760),8969=>array(68,-132,371,760),8970=>array(86,-132,389,760),8971=>array(68,-132,371,760),8972=>array(352,-77,759,331),8973=>array(49,-77,457,331),8974=>array(352,226,759,634),8975=>array(49,226,457,634),8976=>array(106,140,732,444),8977=>array(3,113,536,646),8984=>array(84,0,843,759),8985=>array(106,140,732,444),8988=>array(86,425,403,760),8989=>array(65,425,383,760),8990=>array(86,-126,403,208),8991=>array(65,-126,383,208),8992=>array(235,-250,586,926),8993=>array(22,-240,373,940),8996=>array(76,215,1076,575),8997=>array(76,0,1076,575),8998=>array(76,0,1414,760),8999=>array(76,0,1076,760),9000=>array(59,0,1385,729),9003=>array(0,0,1338,760),9004=>array(73,-91,800,748),9075=>array(78,-19,348,547),9076=>array(84,-208,671,562),9077=>array(43,-13,826,547),9082=>array(48,-13,645,559),9085=>array(13,-228,850,99),9095=>array(76,0,1100,743),9108=>array(17,0,856,727),9115=>array(63,-252,438,928),9116=>array(63,-252,205,940),9117=>array(63,-240,438,940),9118=>array(63,-252,438,928),9119=>array(295,-252,438,940),9120=>array(63,-240,438,940),9121=>array(63,-252,438,928),9122=>array(63,-252,205,940),9123=>array(63,-240,438,940),9124=>array(63,-252,438,928),9125=>array(295,-252,438,940),9126=>array(63,-240,438,940),9127=>array(306,-261,668,928),9128=>array(82,-247,444,934),9129=>array(306,-240,668,934),9130=>array(306,-256,444,934),9131=>array(82,-261,444,928),9132=>array(306,-247,668,934),9133=>array(82,-240,444,934),9134=>array(235,-250,373,940),9166=>array(27,46,781,729),9167=>array(91,0,854,596),9187=>array(73,-91,800,748),9189=>array(3,75,766,444),9192=>array(39,-129,665,294),9250=>array(-81,-14,671,760),9251=>array(64,-228,651,99),9312=>array(59,-15,788,715),9313=>array(59,-15,788,715),9314=>array(59,-15,788,715),9315=>array(59,-15,788,715),9316=>array(59,-15,788,715),9317=>array(59,-15,788,715),9318=>array(59,-15,788,715),9319=>array(59,-15,788,715),9320=>array(59,-15,788,715),9321=>array(59,-15,788,715),9600=>array(-10,260,779,770),9601=>array(-10,-250,779,-123),9602=>array(-10,-250,779,-5),9603=>array(-10,-250,779,132),9604=>array(-10,-250,779,260),9605=>array(-10,-250,779,387),9606=>array(-10,-250,779,515),9607=>array(-10,-250,779,642),9608=>array(-10,-250,779,770),9609=>array(-10,-250,680,770),9610=>array(-10,-250,582,770),9611=>array(-10,-250,483,770),9612=>array(-10,-250,384,770),9613=>array(-10,-250,286,770),9614=>array(-10,-250,187,770),9615=>array(-10,-250,88,770),9616=>array(384,-250,778,770),9617=>array(-10,-250,680,770),9618=>array(-10,-250,779,770),9619=>array(-10,-250,779,770),9620=>array(-10,642,779,770),9621=>array(680,-250,778,770),9622=>array(-10,-250,385,260),9623=>array(384,-250,779,260),9624=>array(-10,260,385,770),9625=>array(-10,-250,779,770),9626=>array(-10,-250,779,770),9627=>array(-10,-250,779,770),9628=>array(-10,-250,779,770),9629=>array(384,260,779,770),9630=>array(-10,-250,779,770),9631=>array(-10,-250,779,770),9632=>array(91,-124,854,643),9633=>array(91,-124,854,643),9634=>array(91,-124,854,643),9635=>array(91,-124,854,643),9636=>array(91,-124,854,643),9637=>array(91,-124,854,643),9638=>array(91,-124,854,643),9639=>array(91,-124,854,643),9640=>array(91,-124,854,643),9641=>array(91,-124,854,643),9642=>array(91,11,587,509),9643=>array(91,11,587,509),9644=>array(91,75,854,444),9645=>array(91,75,854,444),9646=>array(91,-122,459,642),9647=>array(91,-122,459,642),9648=>array(3,75,766,444),9649=>array(3,75,766,444),9650=>array(3,-124,766,643),9651=>array(3,-124,766,643),9652=>array(3,11,499,509),9653=>array(3,11,499,509),9654=>array(3,-124,766,643),9655=>array(3,-124,766,643),9656=>array(3,11,499,509),9657=>array(3,11,499,509),9658=>array(3,11,766,509),9659=>array(3,11,766,509),9660=>array(3,-124,766,643),9661=>array(3,-124,766,643),9662=>array(3,11,499,509),9663=>array(3,11,499,509),9664=>array(3,-124,766,643),9665=>array(3,-124,766,643),9666=>array(3,11,499,509),9667=>array(3,11,499,509),9668=>array(3,11,766,509),9669=>array(3,11,766,509),9670=>array(3,-124,766,643),9671=>array(3,-124,766,643),9672=>array(3,-124,766,643),9673=>array(55,-125,818,645),9674=>array(3,-233,491,807),9675=>array(55,-125,818,645),9676=>array(56,-125,817,644),9677=>array(55,-125,818,645),9678=>array(55,-125,818,645),9679=>array(55,-123,818,641),9680=>array(55,-123,818,641),9681=>array(55,-123,818,641),9682=>array(55,-123,818,641),9683=>array(55,-123,818,641),9684=>array(55,-123,818,641),9685=>array(55,-123,818,641),9686=>array(55,-125,436,645),9687=>array(91,-125,472,645),9688=>array(91,-10,750,770),9689=>array(91,-250,879,770),9690=>array(91,260,879,770),9691=>array(91,-250,879,260),9692=>array(3,260,385,645),9693=>array(3,260,384,645),9694=>array(3,-125,384,260),9695=>array(3,-125,385,260),9696=>array(3,260,766,645),9697=>array(3,-125,766,260),9698=>array(3,-124,766,643),9699=>array(3,-124,766,643),9700=>array(3,-124,766,643),9701=>array(3,-124,766,643),9702=>array(144,196,495,547),9703=>array(91,-124,854,643),9704=>array(91,-124,854,643),9705=>array(91,-124,854,643),9706=>array(91,-124,854,643),9707=>array(91,-124,854,643),9708=>array(3,-124,766,643),9709=>array(3,-124,766,643),9710=>array(3,-124,766,643),9711=>array(55,-250,1064,770),9712=>array(91,-124,854,643),9713=>array(91,-124,854,643),9714=>array(91,-124,854,643),9715=>array(91,-124,854,643),9716=>array(55,-123,818,641),9717=>array(55,-123,818,641),9718=>array(55,-123,818,641),9719=>array(55,-123,818,641),9720=>array(3,-124,766,643),9721=>array(3,-124,766,643),9722=>array(3,-124,766,643),9723=>array(91,-66,739,585),9724=>array(91,-66,739,585),9725=>array(91,-17,642,537),9726=>array(91,-17,642,537),9727=>array(3,-124,766,643),9728=>array(83,0,813,729),9729=>array(51,-2,949,360),9730=>array(49,0,848,729),9731=>array(83,-0,813,927),9732=>array(64,0,833,880),9733=>array(65,-4,832,723),9734=>array(65,-4,832,723),9735=>array(83,2,490,729),9736=>array(83,0,813,731),9737=>array(83,0,813,730),9738=>array(61,0,828,727),9739=>array(61,0,828,723),9740=>array(61,-1,610,722),9741=>array(61,0,952,723),9742=>array(68,0,1177,729),9743=>array(71,0,1180,729),9744=>array(90,0,807,729),9745=>array(89,0,808,729),9746=>array(89,0,808,729),9747=>array(75,78,457,656),9748=>array(49,0,870,933),9749=>array(74,0,822,731),9750=>array(84,0,813,731),9751=>array(84,0,813,727),9752=>array(78,0,819,729),9753=>array(83,140,813,574),9754=>array(84,113,813,569),9755=>array(84,113,813,569),9756=>array(87,104,810,569),9757=>array(72,0,537,724),9758=>array(86,103,810,569),9759=>array(72,-3,537,720),9760=>array(61,0,835,730),9761=>array(84,0,813,730),9762=>array(83,0,813,730),9763=>array(49,0,848,730),9764=>array(49,-2,620,727),9765=>array(83,0,663,731),9766=>array(83,-1,566,731),9767=>array(83,0,701,911),9768=>array(83,0,462,730),9769=>array(83,-1,813,729),9770=>array(87,0,810,730),9771=>array(83,0,814,731),9772=>array(83,0,627,731),9773=>array(83,0,813,730),9774=>array(83,0,813,730),9775=>array(83,0,813,730),9776=>array(83,0,813,729),9777=>array(83,0,814,729),9778=>array(83,0,813,729),9779=>array(83,0,813,729),9780=>array(83,0,813,729),9781=>array(83,0,813,729),9782=>array(83,0,813,729),9783=>array(83,0,813,729),9784=>array(80,3,817,721),9785=>array(83,-73,959,804),9786=>array(83,-73,959,804),9787=>array(83,-73,959,804),9788=>array(83,0,813,730),9789=>array(358,0,814,730),9790=>array(83,0,539,730),9791=>array(85,-102,528,732),9792=>array(85,-125,647,731),9793=>array(85,-14,647,843),9794=>array(79,-14,831,720),9795=>array(166,0,730,730),9796=>array(219,0,677,730),9797=>array(121,0,774,730),9798=>array(127,0,769,730),9799=>array(240,0,656,730),9800=>array(45,0,851,731),9801=>array(89,0,807,730),9802=>array(94,0,802,731),9803=>array(113,31,784,679),9804=>array(140,0,756,730),9805=>array(53,-180,843,730),9806=>array(83,52,813,653),9807=>array(34,-96,863,730),9808=>array(83,-0,813,730),9809=>array(94,0,802,730),9810=>array(86,153,810,579),9811=>array(157,0,739,730),9812=>array(98,0,798,730),9813=>array(110,0,786,730),9814=>array(167,-1,729,729),9815=>array(214,0,683,730),9816=>array(165,0,732,730),9817=>array(148,-0,748,730),9818=>array(98,0,798,730),9819=>array(110,0,786,730),9820=>array(167,-1,729,729),9821=>array(214,0,683,730),9822=>array(162,0,734,730),9823=>array(148,-0,748,730),9824=>array(158,0,738,729),9825=>array(90,0,806,727),9826=>array(168,0,728,729),9827=>array(111,0,785,729),9828=>array(157,0,739,729),9829=>array(89,0,808,729),9830=>array(168,0,728,729),9831=>array(111,0,785,732),9832=>array(105,-1,791,729),9833=>array(84,-5,339,729),9834=>array(84,-5,554,729),9835=>array(184,-102,712,729),9836=>array(92,-5,804,729),9837=>array(88,-3,392,731),9838=>array(84,0,273,731),9839=>array(84,0,400,731),9840=>array(84,0,664,731),9841=>array(64,0,701,731),9842=>array(84,0,813,709),9843=>array(76,16,820,731),9844=>array(76,16,820,731),9845=>array(76,16,820,731),9846=>array(76,16,820,731),9847=>array(76,16,820,731),9848=>array(76,16,820,731),9849=>array(76,16,820,731),9850=>array(76,16,820,731),9851=>array(84,0,812,704),9852=>array(83,0,814,731),9853=>array(83,0,814,731),9854=>array(83,0,814,731),9855=>array(149,1,747,731),9856=>array(73,0,797,725),9857=>array(73,0,797,725),9858=>array(73,0,797,725),9859=>array(73,0,797,725),9860=>array(73,0,797,725),9861=>array(73,0,797,725),9862=>array(83,0,813,731),9863=>array(83,0,813,731),9864=>array(83,0,813,731),9865=>array(83,0,813,731),9866=>array(83,0,813,98),9867=>array(83,0,813,98),9868=>array(83,0,813,413),9869=>array(83,0,813,413),9870=>array(83,0,813,413),9871=>array(83,0,813,413),9872=>array(168,3,728,731),9873=>array(168,3,728,731),9874=>array(52,0,844,731),9875=>array(97,-10,799,732),9876=>array(131,0,765,729),9877=>array(61,-10,479,732),9878=>array(59,-10,837,732),9879=>array(61,0,835,732),9880=>array(145,0,750,732),9881=>array(95,-17,802,727),9882=>array(128,-9,768,733),9883=>array(127,0,769,728),9884=>array(127,0,769,729),9888=>array(49,0,848,729),9889=>array(83,2,619,730),9890=>array(85,-125,919,731),9891=>array(79,-206,1023,720),9892=>array(85,-186,1109,856),9893=>array(85,-125,837,917),9894=>array(131,-14,727,869),9895=>array(101,-170,741,884),9896=>array(188,-14,650,869),9897=>array(4,133,829,596),9898=>array(188,133,650,597),9899=>array(188,133,650,597),9900=>array(249,194,589,536),9901=>array(175,194,663,536),9902=>array(41,169,797,560),9903=>array(5,194,833,536),9904=>array(103,237,757,540),9905=>array(211,42,626,698),9906=>array(85,-125,647,731),9907=>array(168,-125,646,731),9908=>array(86,-125,646,731),9909=>array(86,-125,646,731),9910=>array(59,-118,791,643),9911=>array(194,-104,595,710),9912=>array(158,-125,543,731),9920=>array(42,4,796,553),9921=>array(42,4,796,724),9922=>array(42,4,796,553),9923=>array(42,4,796,724),9954=>array(85,-14,647,843),9985=>array(11,190,803,635),9986=>array(42,141,784,588),9987=>array(11,94,803,539),9988=>array(36,119,824,613),9990=>array(42,-14,796,742),9991=>array(42,-14,796,742),9992=>array(59,21,782,708),9993=>array(64,107,773,622),9996=>array(212,0,561,742),9997=>array(21,83,802,678),9998=>array(89,75,724,710),9999=>array(26,198,819,530),10000=>array(89,75,724,710),10001=>array(43,185,757,544),10002=>array(67,209,757,520),10003=>array(150,97,667,630),10004=>array(116,87,721,631),10005=>array(126,72,711,657),10006=>array(85,31,752,698),10007=>array(118,-9,701,732),10008=>array(123,0,754,739),10009=>array(55,0,783,729),10010=>array(55,0,783,729),10011=>array(55,0,783,729),10012=>array(55,0,783,729),10013=>array(165,0,673,729),10014=>array(131,0,678,729),10015=>array(155,0,683,729),10016=>array(55,0,783,729),10017=>array(91,-13,747,744),10018=>array(41,-14,797,742),10019=>array(42,-12,796,742),10020=>array(41,-14,797,742),10021=>array(41,-13,797,743),10022=>array(42,-14,796,745),10023=>array(42,-14,796,745),10025=>array(23,-9,814,743),10026=>array(42,-14,796,742),10027=>array(23,-9,814,743),10028=>array(23,-9,814,743),10029=>array(23,-9,814,743),10030=>array(23,-9,814,743),10031=>array(23,-9,814,743),10032=>array(24,12,815,714),10033=>array(64,0,773,729),10034=>array(74,0,764,729),10035=>array(55,0,783,729),10036=>array(31,-14,787,742),10037=>array(41,-14,797,742),10038=>array(91,-14,747,742),10039=>array(41,-14,797,742),10040=>array(41,-14,797,742),10041=>array(41,-14,797,742),10042=>array(55,0,783,729),10043=>array(82,-14,756,742),10044=>array(82,-14,756,742),10045=>array(84,-14,753,742),10046=>array(79,-14,759,742),10047=>array(54,0,784,709),10048=>array(54,0,784,709),10049=>array(41,-14,797,742),10050=>array(42,-14,796,742),10051=>array(79,-14,759,742),10052=>array(89,0,749,729),10053=>array(76,0,762,729),10054=>array(63,2,773,729),10055=>array(79,-13,759,742),10056=>array(47,-13,791,730),10057=>array(47,-13,791,730),10058=>array(41,-13,797,743),10059=>array(41,-13,797,743),10061=>array(50,-10,847,738),10063=>array(60,-49,837,729),10064=>array(60,0,837,777),10065=>array(60,-49,837,729),10066=>array(60,0,837,777),10070=>array(83,-2,813,728),10072=>array(377,-240,460,760),10073=>array(336,-240,502,760),10074=>array(253,-240,585,760),10075=>array(85,395,288,729),10076=>array(59,395,262,729),10077=>array(85,395,528,729),10078=>array(59,395,502,729),10081=>array(155,-93,772,851),10082=>array(202,-17,636,742),10083=>array(163,-17,675,742),10084=>array(54,83,784,645),10085=>array(168,-1,729,729),10086=>array(62,21,724,702),10087=>array(78,169,759,564),10088=>array(196,-139,648,769),10089=>array(196,-139,648,769),10090=>array(264,-132,574,758),10091=>array(264,-132,574,758),10092=>array(215,-240,607,760),10093=>array(232,-240,623,760),10094=>array(142,-240,685,760),10095=>array(153,-240,696,760),10096=>array(167,-240,656,760),10097=>array(183,-240,672,760),10098=>array(346,-241,535,760),10099=>array(303,-241,492,760),10100=>array(175,-163,634,760),10101=>array(204,-163,663,760),10102=>array(59,-15,788,715),10103=>array(59,-15,788,715),10104=>array(59,-15,788,715),10105=>array(59,-15,788,715),10106=>array(59,-15,788,715),10107=>array(59,-15,788,715),10108=>array(59,-15,788,715),10109=>array(59,-15,788,715),10110=>array(59,-15,788,715),10111=>array(59,-15,788,715),10112=>array(4,-52,833,780),10113=>array(4,-52,833,780),10114=>array(4,-52,833,780),10115=>array(4,-52,833,780),10116=>array(4,-52,833,780),10117=>array(4,-52,833,780),10118=>array(4,-52,833,780),10119=>array(4,-52,833,780),10120=>array(4,-52,833,780),10121=>array(4,-52,833,780),10122=>array(4,-52,833,780),10123=>array(4,-52,833,780),10124=>array(4,-52,833,780),10125=>array(4,-52,833,780),10126=>array(4,-52,833,780),10127=>array(4,-52,833,780),10128=>array(4,-52,833,780),10129=>array(4,-52,833,780),10130=>array(4,-52,833,780),10131=>array(4,-52,833,780),10132=>array(57,75,789,552),10136=>array(123,55,682,614),10137=>array(57,100,789,527),10138=>array(123,13,682,572),10139=>array(57,129,789,498),10140=>array(57,57,764,570),10141=>array(57,100,789,527),10142=>array(57,100,789,527),10143=>array(57,100,789,527),10144=>array(57,100,789,527),10145=>array(57,46,811,581),10146=>array(111,94,789,533),10147=>array(111,94,789,533),10148=>array(111,-4,789,631),10149=>array(57,100,789,548),10150=>array(57,79,789,527),10151=>array(240,-7,606,634),10152=>array(57,100,789,527),10153=>array(57,75,765,552),10154=>array(57,75,765,552),10155=>array(21,12,794,586),10156=>array(21,12,794,586),10157=>array(135,0,774,574),10158=>array(135,0,774,574),10159=>array(62,49,799,574),10161=>array(62,49,799,574),10162=>array(154,-20,721,585),10163=>array(63,157,789,470),10164=>array(81,55,682,655),10165=>array(57,173,789,454),10166=>array(82,-29,682,572),10167=>array(82,55,682,655),10168=>array(57,172,789,455),10169=>array(82,-28,682,572),10170=>array(56,84,789,543),10171=>array(73,140,779,487),10172=>array(79,167,774,460),10173=>array(79,118,774,509),10174=>array(57,81,789,546),10181=>array(54,-163,405,769),10182=>array(52,-163,403,769),10208=>array(3,-233,491,807),10214=>array(86,-132,419,760),10215=>array(86,-132,419,760),10216=>array(104,-132,377,759),10217=>array(80,-132,353,759),10218=>array(104,-132,641,759),10219=>array(80,-132,616,759),10224=>array(41,0,797,732),10225=>array(42,-3,798,729),10226=>array(9,45,816,685),10227=>array(22,45,830,685),10228=>array(57,-14,1108,643),10229=>array(49,87,1376,540),10230=>array(57,87,1385,540),10231=>array(49,87,1385,540),10232=>array(49,87,1376,540),10233=>array(57,87,1385,540),10234=>array(49,87,1385,540),10235=>array(49,87,1376,540),10236=>array(57,87,1385,540),10237=>array(49,87,1376,540),10238=>array(57,87,1385,540),10239=>array(57,87,1385,540),10241=>array(146,586,342,781),10242=>array(146,325,342,521),10243=>array(146,325,342,781),10244=>array(146,65,342,261),10245=>array(146,65,342,781),10246=>array(146,65,342,521),10247=>array(146,65,342,781),10248=>array(439,586,635,781),10249=>array(146,586,635,781),10250=>array(146,325,635,781),10251=>array(146,325,635,781),10252=>array(146,65,635,781),10253=>array(146,65,635,781),10254=>array(146,65,635,781),10255=>array(146,65,635,781),10256=>array(439,325,635,521),10257=>array(146,325,635,781),10258=>array(146,325,635,521),10259=>array(146,325,635,781),10260=>array(146,65,635,521),10261=>array(146,65,635,781),10262=>array(146,65,635,521),10263=>array(146,65,635,781),10264=>array(439,325,635,781),10265=>array(146,325,635,781),10266=>array(146,325,635,781),10267=>array(146,325,635,781),10268=>array(146,65,635,781),10269=>array(146,65,635,781),10270=>array(146,65,635,781),10271=>array(146,65,635,781),10272=>array(439,65,635,261),10273=>array(146,65,635,781),10274=>array(146,65,635,521),10275=>array(146,65,635,781),10276=>array(146,65,635,261),10277=>array(146,65,635,781),10278=>array(146,65,635,521),10279=>array(146,65,635,781),10280=>array(439,65,635,781),10281=>array(146,65,635,781),10282=>array(146,65,635,781),10283=>array(146,65,635,781),10284=>array(146,65,635,781),10285=>array(146,65,635,781),10286=>array(146,65,635,781),10287=>array(146,65,635,781),10288=>array(439,65,635,521),10289=>array(146,65,635,781),10290=>array(146,65,635,521),10291=>array(146,65,635,781),10292=>array(146,65,635,521),10293=>array(146,65,635,781),10294=>array(146,65,635,521),10295=>array(146,65,635,781),10296=>array(439,65,635,781),10297=>array(146,65,635,781),10298=>array(146,65,635,781),10299=>array(146,65,635,781),10300=>array(146,65,635,781),10301=>array(146,65,635,781),10302=>array(146,65,635,781),10303=>array(146,65,635,781),10304=>array(146,-195,342,0),10305=>array(146,-195,342,781),10306=>array(146,-195,342,521),10307=>array(146,-195,342,781),10308=>array(146,-195,342,261),10309=>array(146,-195,342,781),10310=>array(146,-195,342,521),10311=>array(146,-195,342,781),10312=>array(146,-195,635,781),10313=>array(146,-195,635,781),10314=>array(146,-195,635,781),10315=>array(146,-195,635,781),10316=>array(146,-195,635,781),10317=>array(146,-195,635,781),10318=>array(146,-195,635,781),10319=>array(146,-195,635,781),10320=>array(146,-195,635,521),10321=>array(146,-195,635,781),10322=>array(146,-195,635,521),10323=>array(146,-195,635,781),10324=>array(146,-195,635,521),10325=>array(146,-195,635,781),10326=>array(146,-195,635,521),10327=>array(146,-195,635,781),10328=>array(146,-195,635,781),10329=>array(146,-195,635,781),10330=>array(146,-195,635,781),10331=>array(146,-195,635,781),10332=>array(146,-195,635,781),10333=>array(146,-195,635,781),10334=>array(146,-195,635,781),10335=>array(146,-195,635,781),10336=>array(146,-195,635,261),10337=>array(146,-195,635,781),10338=>array(146,-195,635,521),10339=>array(146,-195,635,781),10340=>array(146,-195,635,261),10341=>array(146,-195,635,781),10342=>array(146,-195,635,521),10343=>array(146,-195,635,781),10344=>array(146,-195,635,781),10345=>array(146,-195,635,781),10346=>array(146,-195,635,781),10347=>array(146,-195,635,781),10348=>array(146,-195,635,781),10349=>array(146,-195,635,781),10350=>array(146,-195,635,781),10351=>array(146,-195,635,781),10352=>array(146,-195,635,521),10353=>array(146,-195,635,781),10354=>array(146,-195,635,521),10355=>array(146,-195,635,781),10356=>array(146,-195,635,521),10357=>array(146,-195,635,781),10358=>array(146,-195,635,521),10359=>array(146,-195,635,781),10360=>array(146,-195,635,781),10361=>array(146,-195,635,781),10362=>array(146,-195,635,781),10363=>array(146,-195,635,781),10364=>array(146,-195,635,781),10365=>array(146,-195,635,781),10366=>array(146,-195,635,781),10367=>array(146,-195,635,781),10368=>array(439,-195,635,0),10369=>array(146,-195,635,781),10370=>array(146,-195,635,521),10371=>array(146,-195,635,781),10372=>array(146,-195,635,261),10373=>array(146,-195,635,781),10374=>array(146,-195,635,521),10375=>array(146,-195,635,781),10376=>array(439,-195,635,781),10377=>array(146,-195,635,781),10378=>array(146,-195,635,781),10379=>array(146,-195,635,781),10380=>array(146,-195,635,781),10381=>array(146,-195,635,781),10382=>array(146,-195,635,781),10383=>array(146,-195,635,781),10384=>array(439,-195,635,521),10385=>array(146,-195,635,781),10386=>array(146,-195,635,521),10387=>array(146,-195,635,781),10388=>array(146,-195,635,521),10389=>array(146,-195,635,781),10390=>array(146,-195,635,521),10391=>array(146,-195,635,781),10392=>array(439,-195,635,781),10393=>array(146,-195,635,781),10394=>array(146,-195,635,781),10395=>array(146,-195,635,781),10396=>array(146,-195,635,781),10397=>array(146,-195,635,781),10398=>array(146,-195,635,781),10399=>array(146,-195,635,781),10400=>array(439,-195,635,261),10401=>array(146,-195,635,781),10402=>array(146,-195,635,521),10403=>array(146,-195,635,781),10404=>array(146,-195,635,261),10405=>array(146,-195,635,781),10406=>array(146,-195,635,521),10407=>array(146,-195,635,781),10408=>array(439,-195,635,781),10409=>array(146,-195,635,781),10410=>array(146,-195,635,781),10411=>array(146,-195,635,781),10412=>array(146,-195,635,781),10413=>array(146,-195,635,781),10414=>array(146,-195,635,781),10415=>array(146,-195,635,781),10416=>array(439,-195,635,521),10417=>array(146,-195,635,781),10418=>array(146,-195,635,521),10419=>array(146,-195,635,781),10420=>array(146,-195,635,521),10421=>array(146,-195,635,781),10422=>array(146,-195,635,521),10423=>array(146,-195,635,781),10424=>array(439,-195,635,781),10425=>array(146,-195,635,781),10426=>array(146,-195,635,781),10427=>array(146,-195,635,781),10428=>array(146,-195,635,781),10429=>array(146,-195,635,781),10430=>array(146,-195,635,781),10431=>array(146,-195,635,781),10432=>array(146,-195,635,0),10433=>array(146,-195,635,781),10434=>array(146,-195,635,521),10435=>array(146,-195,635,781),10436=>array(146,-195,635,261),10437=>array(146,-195,635,781),10438=>array(146,-195,635,521),10439=>array(146,-195,635,781),10440=>array(146,-195,635,781),10441=>array(146,-195,635,781),10442=>array(146,-195,635,781),10443=>array(146,-195,635,781),10444=>array(146,-195,635,781),10445=>array(146,-195,635,781),10446=>array(146,-195,635,781),10447=>array(146,-195,635,781),10448=>array(146,-195,635,521),10449=>array(146,-195,635,781),10450=>array(146,-195,635,521),10451=>array(146,-195,635,781),10452=>array(146,-195,635,521),10453=>array(146,-195,635,781),10454=>array(146,-195,635,521),10455=>array(146,-195,635,781),10456=>array(146,-195,635,781),10457=>array(146,-195,635,781),10458=>array(146,-195,635,781),10459=>array(146,-195,635,781),10460=>array(146,-195,635,781),10461=>array(146,-195,635,781),10462=>array(146,-195,635,781),10463=>array(146,-195,635,781),10464=>array(146,-195,635,261),10465=>array(146,-195,635,781),10466=>array(146,-195,635,521),10467=>array(146,-195,635,781),10468=>array(146,-195,635,261),10469=>array(146,-195,635,781),10470=>array(146,-195,635,521),10471=>array(146,-195,635,781),10472=>array(146,-195,635,781),10473=>array(146,-195,635,781),10474=>array(146,-195,635,781),10475=>array(146,-195,635,781),10476=>array(146,-195,635,781),10477=>array(146,-195,635,781),10478=>array(146,-195,635,781),10479=>array(146,-195,635,781),10480=>array(146,-195,635,521),10481=>array(146,-195,635,781),10482=>array(146,-195,635,521),10483=>array(146,-195,635,781),10484=>array(146,-195,635,521),10485=>array(146,-195,635,781),10486=>array(146,-195,635,521),10487=>array(146,-195,635,781),10488=>array(146,-195,635,781),10489=>array(146,-195,635,781),10490=>array(146,-195,635,781),10491=>array(146,-195,635,781),10492=>array(146,-195,635,781),10493=>array(146,-195,635,781),10494=>array(146,-195,635,781),10495=>array(146,-195,635,781),10502=>array(49,87,781,540),10503=>array(57,87,789,540),10506=>array(132,0,707,732),10507=>array(132,0,707,732),10560=>array(86,45,726,853),10561=>array(86,45,726,853),10627=>array(125,-163,628,760),10628=>array(125,-163,628,760),10702=>array(106,-258,732,800),10703=>array(106,-1,940,628),10704=>array(106,-1,940,628),10705=>array(106,-48,894,674),10706=>array(106,-48,894,674),10707=>array(106,-48,894,674),10708=>array(106,-48,894,675),10709=>array(106,-48,894,675),10731=>array(3,-233,491,807),10746=>array(106,0,732,627),10747=>array(106,0,732,627),10752=>array(28,-211,972,734),10753=>array(28,-211,972,734),10754=>array(28,-211,972,734),10764=>array(15,-227,1646,754),10765=>array(14,-227,548,754),10766=>array(14,-227,548,754),10767=>array(14,-227,548,754),10768=>array(14,-227,548,754),10769=>array(14,-227,576,754),10770=>array(14,-227,548,754),10771=>array(14,-227,548,754),10772=>array(14,-228,651,754),10773=>array(14,-227,548,754),10774=>array(14,-227,548,754),10775=>array(-30,-227,556,754),10776=>array(14,-227,548,754),10777=>array(14,-227,548,754),10778=>array(14,-227,548,754),10779=>array(15,-227,548,898),10780=>array(15,-372,548,754),10799=>array(125,20,713,607),10858=>array(106,212,732,660),10859=>array(106,-34,732,660),10877=>array(106,-150,732,632),10878=>array(106,-150,732,632),10879=>array(106,-150,732,632),10880=>array(106,-150,732,632),10881=>array(106,-150,732,688),10882=>array(106,-150,732,688),10883=>array(106,-150,732,827),10884=>array(106,-150,732,827),10885=>array(106,-217,732,630),10886=>array(106,-217,732,630),10887=>array(106,-124,732,582),10888=>array(106,-124,732,582),10889=>array(106,-281,732,630),10890=>array(106,-281,732,630),10891=>array(106,-303,732,814),10892=>array(106,-303,732,814),10893=>array(106,-183,732,653),10894=>array(106,-183,732,653),10895=>array(106,-245,732,765),10896=>array(106,-245,732,765),10897=>array(106,-278,732,782),10898=>array(106,-278,732,782),10899=>array(106,-263,732,771),10900=>array(106,-263,732,771),10901=>array(106,-50,732,733),10902=>array(106,-50,732,733),10903=>array(106,-50,732,733),10904=>array(106,-50,732,733),10905=>array(106,-45,732,678),10906=>array(106,-45,732,678),10907=>array(106,-81,732,724),10908=>array(106,-81,732,724),10909=>array(106,13,732,680),10910=>array(106,13,732,680),10911=>array(106,-239,732,746),10912=>array(106,-239,732,746),10926=>array(106,22,732,656),10927=>array(106,-83,732,684),10928=>array(106,-83,732,684),10929=>array(106,-246,732,684),10930=>array(106,-246,732,684),10931=>array(106,-205,732,672),10932=>array(106,-205,732,672),10933=>array(106,-304,732,672),10934=>array(106,-304,732,672),10935=>array(106,-252,732,713),10936=>array(106,-252,732,713),10937=>array(106,-316,732,713),10938=>array(106,-316,732,713),11001=>array(106,-195,732,609),11002=>array(106,-195,732,609),11008=>array(123,-23,744,598),11009=>array(94,-23,715,598),11010=>array(123,-23,744,598),11011=>array(94,-23,715,598),11012=>array(27,46,789,581),11013=>array(27,46,781,581),11014=>array(151,0,687,754),11015=>array(151,-25,687,729),11016=>array(123,-23,744,598),11017=>array(94,-23,715,598),11018=>array(123,-23,744,598),11019=>array(94,-23,715,598),11020=>array(27,46,789,581),11021=>array(151,-25,687,754),11022=>array(57,-25,800,372),11023=>array(57,255,800,652),11024=>array(38,-25,781,372),11025=>array(38,255,781,652),11026=>array(91,-124,854,643),11027=>array(91,-124,854,643),11028=>array(91,-124,854,643),11029=>array(91,-124,854,643),11030=>array(3,-124,766,643),11031=>array(3,-124,766,643),11032=>array(3,-124,766,643),11033=>array(3,-124,766,643),11034=>array(91,-124,854,643),11039=>array(18,-26,852,767),11040=>array(18,-26,852,767),11041=>array(73,-91,800,748),11042=>array(73,-91,800,748),11043=>array(17,-35,856,692),11044=>array(55,-250,1064,770),11091=>array(38,-47,832,788),11092=>array(38,-47,832,788),11360=>array(5,0,610,729),11361=>array(5,0,355,760),11362=>array(-17,0,610,729),11363=>array(6,0,692,729),11364=>array(92,-200,750,729),11365=>array(32,-46,639,594),11366=>array(13,-93,455,822),11367=>array(92,-157,932,729),11368=>array(84,-138,809,760),11369=>array(92,-157,805,729),11370=>array(84,-138,684,760),11371=>array(45,-157,768,729),11372=>array(45,-138,622,547),11373=>array(48,-14,769,741),11374=>array(92,-200,903,729),11375=>array(5,0,769,729),11376=>array(48,-14,769,741),11377=>array(15,0,778,560),11378=>array(30,0,1221,742),11379=>array(35,0,1056,560),11380=>array(38,0,637,586),11381=>array(92,0,606,729),11382=>array(84,0,481,547),11383=>array(64,0,725,552),11385=>array(84,-13,490,760),11386=>array(43,-14,644,560),11387=>array(78,0,467,547),11388=>array(-21,-121,166,425),11389=>array(3,326,484,734),11390=>array(72,-240,670,742),11391=>array(45,-240,680,729),11520=>array(45,-64,609,547),11521=>array(16,-232,625,546),11522=>array(41,-232,629,547),11523=>array(42,-10,585,807),11524=>array(40,-228,613,546),11525=>array(41,-228,988,546),11526=>array(20,-8,668,816),11527=>array(42,-9,974,547),11528=>array(39,0,589,547),11529=>array(41,-227,614,816),11530=>array(39,-9,985,546),11531=>array(42,-8,649,816),11532=>array(39,0,627,816),11533=>array(41,-8,988,546),11534=>array(41,-8,629,546),11535=>array(41,-228,846,816),11536=>array(42,-9,976,816),11537=>array(41,-9,630,816),11538=>array(46,-232,610,546),11539=>array(41,-228,984,661),11540=>array(45,-228,958,546),11541=>array(39,-228,978,816),11542=>array(44,0,628,546),11543=>array(41,-228,630,547),11544=>array(41,-232,627,546),11545=>array(44,-228,628,816),11546=>array(42,-232,610,547),11547=>array(43,-9,658,816),11548=>array(44,-228,989,547),11549=>array(44,-232,619,546),11550=>array(46,-232,639,546),11551=>array(44,-228,615,567),11552=>array(44,-9,1004,546),11553=>array(44,-228,619,816),11554=>array(42,-9,601,626),11555=>array(44,-228,622,816),11556=>array(42,-228,684,546),11557=>array(45,-8,959,816),11568=>array(55,-14,636,380),11569=>array(50,-14,892,742),11570=>array(50,-14,892,742),11571=>array(51,0,674,729),11572=>array(51,0,674,729),11573=>array(56,0,669,729),11574=>array(48,0,627,729),11575=>array(5,0,769,729),11576=>array(5,0,769,729),11577=>array(92,0,610,729),11578=>array(92,0,610,729),11579=>array(73,-14,729,742),11580=>array(73,0,916,729),11581=>array(92,0,754,729),11582=>array(92,0,549,729),11583=>array(92,0,754,729),11584=>array(50,-14,892,742),11585=>array(50,-84,892,815),11586=>array(92,0,281,729),11587=>array(21,0,720,729),11588=>array(92,0,745,729),11589=>array(-30,0,944,729),11590=>array(92,0,598,729),11591=>array(92,0,709,729),11592=>array(73,256,607,445),11593=>array(92,0,610,729),11594=>array(73,0,529,729),11595=>array(64,-14,892,742),11596=>array(82,0,695,729),11597=>array(92,0,745,729),11598=>array(92,0,610,729),11599=>array(92,0,280,729),11600=>array(82,0,695,729),11601=>array(92,0,281,729),11602=>array(42,-14,684,729),11603=>array(55,-14,636,742),11604=>array(50,-14,892,742),11605=>array(50,-95,892,742),11606=>array(92,0,745,729),11607=>array(92,0,281,729),11608=>array(92,0,744,729),11609=>array(50,-14,892,742),11610=>array(50,-14,892,823),11611=>array(50,-14,718,742),11612=>array(79,0,797,729),11613=>array(19,0,751,729),11614=>array(50,-14,718,742),11615=>array(92,0,610,729),11616=>array(5,0,769,729),11617=>array(92,0,745,729),11618=>array(92,0,599,729),11619=>array(50,0,800,729),11620=>array(92,0,654,729),11621=>array(50,0,800,729),11631=>array(64,490,651,729),11800=>array(69,-14,515,728),11807=>array(106,-34,732,415),11810=>array(86,403,389,760),11811=>array(68,403,371,760),11812=>array(86,-132,389,225),11813=>array(68,-132,371,225),11822=>array(69,0,515,742),19904=>array(83,-158,813,729),19905=>array(83,-158,813,729),19906=>array(83,-158,813,729),19907=>array(83,-158,813,729),19908=>array(83,-158,813,729),19909=>array(83,-158,813,729),19910=>array(83,-158,813,729),19911=>array(83,-158,813,729),19912=>array(83,-158,813,729),19913=>array(83,-158,814,729),19914=>array(83,-158,813,729),19915=>array(83,-158,813,729),19916=>array(83,-158,813,729),19917=>array(83,-158,813,729),19918=>array(83,-158,813,729),19919=>array(83,-158,813,729),19920=>array(83,-158,814,729),19921=>array(83,-158,813,729),19922=>array(83,-158,814,729),19923=>array(83,-158,813,729),19924=>array(83,-158,813,729),19925=>array(83,-158,813,729),19926=>array(83,-158,813,729),19927=>array(83,-158,813,729),19928=>array(83,-158,813,729),19929=>array(83,-158,813,729),19930=>array(83,-158,813,729),19931=>array(83,-158,814,729),19932=>array(83,-158,813,729),19933=>array(83,-158,813,729),19934=>array(83,-158,814,729),19935=>array(83,-158,813,729),19936=>array(83,-158,813,729),19937=>array(83,-158,813,729),19938=>array(83,-158,813,729),19939=>array(83,-158,813,729),19940=>array(83,-158,813,729),19941=>array(83,-158,814,729),19942=>array(83,-158,813,729),19943=>array(83,-158,813,729),19944=>array(83,-158,814,729),19945=>array(83,-158,813,729),19946=>array(83,-158,814,729),19947=>array(83,-158,813,729),19948=>array(83,-158,814,729),19949=>array(83,-158,813,729),19950=>array(83,-158,814,729),19951=>array(83,-158,813,729),19952=>array(83,-158,814,729),19953=>array(83,-158,813,729),19954=>array(83,-158,813,729),19955=>array(83,-158,813,729),19956=>array(83,-158,813,729),19957=>array(83,-158,814,729),19958=>array(83,-158,813,729),19959=>array(83,-158,813,729),19960=>array(83,-158,813,729),19961=>array(83,-158,814,729),19962=>array(83,-158,813,729),19963=>array(83,-158,814,729),19964=>array(83,-158,814,729),19965=>array(83,-158,813,729),19966=>array(83,-158,813,729),19967=>array(83,-158,813,729),42192=>array(92,0,692,729),42193=>array(92,0,692,729),42194=>array(41,0,641,729),42195=>array(92,0,778,729),42196=>array(5,0,677,729),42197=>array(5,0,677,729),42198=>array(50,-14,747,742),42199=>array(92,0,805,729),42200=>array(-30,0,683,729),42201=>array(0,-14,439,729),42202=>array(50,-14,670,742),42203=>array(50,-14,670,742),42204=>array(45,0,680,729),42205=>array(92,0,599,729),42206=>array(92,0,599,729),42207=>array(92,0,903,729),42208=>array(92,0,745,729),42209=>array(92,0,610,729),42210=>array(72,-14,647,742),42211=>array(92,0,750,729),42212=>array(20,0,678,729),42213=>array(5,0,769,729),42214=>array(5,0,769,729),42215=>array(92,0,745,729),42216=>array(25,-14,723,742),42217=>array(91,0,530,743),42218=>array(30,0,1072,729),42219=>array(19,0,751,729),42220=>array(-10,0,734,729),42221=>array(70,0,670,729),42222=>array(5,0,769,729),42223=>array(5,0,769,729),42224=>array(92,0,610,729),42225=>array(73,0,591,729),42226=>array(92,0,280,729),42227=>array(50,-14,800,742),42228=>array(92,-14,720,729),42229=>array(92,0,720,743),42230=>array(9,0,527,729),42231=>array(52,0,738,729),42232=>array(73,0,249,189),42233=>array(24,-142,249,189),42234=>array(73,0,601,189),42235=>array(73,-142,601,189),42236=>array(24,-142,249,547),42237=>array(73,0,249,547),42238=>array(73,0,515,405),42239=>array(73,134,515,492),42564=>array(26,-14,601,742),42565=>array(15,-14,511,560),42566=>array(92,0,428,729),42567=>array(83,0,356,547),42572=>array(57,-14,1348,654),42573=>array(47,-13,1126,547),42576=>array(49,0,1142,729),42577=>array(20,0,946,547),42580=>array(55,-14,1082,742),42581=>array(44,-14,888,560),42582=>array(92,0,1088,729),42583=>array(84,-14,880,560),42594=>array(60,-157,1058,729),42595=>array(56,-138,900,547),42596=>array(46,0,1069,729),42597=>array(55,0,888,547),42598=>array(92,0,1233,729),42599=>array(84,0,973,547),42600=>array(50,-14,800,742),42601=>array(43,-14,644,560),42602=>array(50,-14,987,742),42603=>array(43,-14,825,560),42604=>array(50,-14,1356,742),42605=>array(43,-14,1063,560),42606=>array(28,-208,933,743),42634=>array(5,-200,883,729),42635=>array(4,-216,709,547),42636=>array(5,0,677,729),42637=>array(4,0,575,547),42644=>array(81,0,716,729),42645=>array(84,0,634,760),42760=>array(96,0,404,693),42761=>array(96,0,404,693),42762=>array(96,0,404,693),42763=>array(96,0,404,693),42764=>array(96,0,404,693),42765=>array(96,0,404,693),42766=>array(96,0,404,693),42767=>array(96,0,404,693),42768=>array(96,0,404,693),42769=>array(96,0,404,693),42770=>array(96,0,404,693),42771=>array(96,0,404,693),42772=>array(96,0,404,693),42773=>array(96,0,404,693),42774=>array(96,0,404,693),42779=>array(58,326,342,736),42780=>array(58,324,342,734),42781=>array(88,326,199,734),42782=>array(88,326,199,734),42783=>array(88,0,199,408),42786=>array(67,0,409,729),42787=>array(67,0,355,547),42788=>array(56,224,479,742),42789=>array(56,42,479,560),42790=>array(92,-200,745,729),42791=>array(84,-216,634,760),42792=>array(5,-216,986,729),42793=>array(13,-215,810,702),42794=>array(67,-14,616,742),42795=>array(54,-202,493,560),42800=>array(92,0,473,547),42801=>array(52,-14,548,560),42802=>array(5,0,1344,729),42803=>array(43,-14,973,560),42804=>array(5,-14,1234,742),42805=>array(43,-14,1021,560),42806=>array(5,-14,1124,729),42807=>array(43,-14,970,560),42808=>array(5,0,1074,729),42809=>array(43,-14,907,560),42810=>array(5,0,1074,729),42811=>array(43,-14,907,560),42812=>array(5,-216,1030,729),42813=>array(43,-216,907,560),42814=>array(33,-14,653,742),42815=>array(43,-14,526,560),42816=>array(5,0,812,729),42817=>array(6,0,708,760),42822=>array(92,0,822,729),42823=>array(84,0,458,760),42824=>array(41,0,655,729),42825=>array(59,0,473,760),42826=>array(16,-14,902,742),42827=>array(5,-14,809,560),42830=>array(50,-14,1356,742),42831=>array(43,-14,1063,560),42832=>array(16,0,692,729),42833=>array(5,-208,671,560),42834=>array(34,0,907,729),42835=>array(34,-208,892,560),42838=>array(50,-188,800,742),42839=>array(45,-208,711,559),42852=>array(16,0,692,729),42853=>array(5,-208,671,760),42854=>array(16,0,692,729),42855=>array(5,-208,671,760),42880=>array(27,0,545,729),42881=>array(84,-208,259,547),42882=>array(84,-208,730,742),42883=>array(84,-208,634,560),42889=>array(112,0,288,547),42890=>array(83,141,303,405),42891=>array(140,245,316,729),42892=>array(95,458,211,729),42893=>array(81,0,716,729),42894=>array(84,-216,680,760),42896=>array(92,-157,868,729),42897=>array(84,-138,725,560),42912=>array(-11,-14,832,742),42913=>array(-11,-216,727,559),42914=>array(-11,0,805,729),42915=>array(-11,0,684,760),42916=>array(-11,0,848,729),42917=>array(-11,0,723,560),42918=>array(-11,0,781,729),42919=>array(-11,0,504,560),42920=>array(-11,-14,731,742),42921=>array(-11,-14,606,560),42922=>array(-68,0,794,729),43002=>array(84,0,972,547),43003=>array(84,0,591,729),43004=>array(41,0,641,729),43005=>array(92,0,903,729),43006=>array(92,0,280,928),43007=>array(31,0,1294,729),61184=>array(91,602,317,693),61185=>array(48,451,338,693),61186=>array(26,301,363,693),61187=>array(17,150,373,693),61188=>array(13,0,378,693),61189=>array(48,451,338,693),61190=>array(91,451,317,543),61191=>array(48,301,338,543),61192=>array(26,150,363,543),61193=>array(17,0,373,543),61194=>array(26,301,363,693),61195=>array(48,301,338,543),61196=>array(91,301,317,393),61197=>array(48,150,338,393),61198=>array(26,0,363,393),61199=>array(17,150,373,693),61200=>array(26,149,363,542),61201=>array(48,150,338,393),61202=>array(91,150,317,242),61203=>array(48,0,338,242),61204=>array(13,0,378,693),61205=>array(17,0,373,543),61206=>array(26,0,363,393),61207=>array(48,0,338,242),61208=>array(91,0,317,92),61209=>array(96,0,188,693),62464=>array(49,-14,563,819),62465=>array(49,-15,563,823),62466=>array(49,-14,604,828),62467=>array(49,0,853,828),62468=>array(49,-15,563,828),62469=>array(49,-15,563,828),62470=>array(29,-15,612,828),62471=>array(49,-14,846,828),62472=>array(49,0,541,828),62473=>array(49,-14,563,820),62474=>array(49,-6,1114,828),62475=>array(49,-14,563,828),62476=>array(63,-15,578,820),62477=>array(54,0,839,828),62478=>array(49,-15,563,819),62479=>array(49,-15,563,840),62480=>array(49,0,875,828),62481=>array(63,-14,578,819),62482=>array(44,-14,699,828),62483=>array(34,-14,570,828),62484=>array(49,-14,837,828),62485=>array(49,-14,563,819),62486=>array(49,0,858,828),62487=>array(49,-14,563,820),62488=>array(44,-14,558,828),62489=>array(64,0,579,828),62490=>array(50,-15,628,820),62491=>array(49,-14,563,819),62492=>array(63,-14,577,828),62493=>array(49,-14,581,820),62494=>array(63,-14,578,819),62495=>array(24,-14,546,828),62496=>array(49,-15,563,828),62497=>array(63,-15,577,828),62498=>array(49,-73,563,828),62499=>array(49,-15,563,830),62500=>array(49,-15,569,828),62501=>array(49,-14,627,828),62502=>array(49,-14,914,828),62504=>array(45,-228,960,816),62505=>array(54,-223,791,843),62506=>array(54,-14,510,761),62507=>array(54,-14,510,773),62508=>array(54,-14,510,866),62509=>array(54,-14,510,812),62510=>array(54,-14,510,877),62511=>array(54,-14,510,803),62512=>array(54,-232,501,761),62513=>array(54,-232,501,793),62514=>array(54,-232,501,891),62515=>array(54,-232,501,803),62516=>array(54,0,520,761),62517=>array(54,0,520,793),62518=>array(54,0,520,803),62519=>array(54,-0,770,761),62520=>array(54,-0,770,773),62521=>array(54,-0,770,884),62522=>array(54,-0,770,793),62523=>array(54,-0,770,803),62524=>array(54,-232,557,761),62525=>array(54,-232,557,773),62526=>array(54,-232,557,894),62527=>array(54,-232,557,793),62528=>array(54,-232,557,803),62529=>array(54,-232,557,844),63173=>array(43,-14,644,760),64256=>array(19,0,819,760),64257=>array(21,0,657,760),64258=>array(19,0,657,760),64259=>array(19,0,1031,760),64260=>array(19,0,1032,760),64261=>array(19,0,785,760),64262=>array(52,-14,997,742),64275=>array(74,-14,1300,760),64276=>array(78,-14,1301,760),64277=>array(78,-208,1300,760),64278=>array(78,-208,1300,760),64279=>array(78,-208,1629,760),64285=>array(66,32,228,547),64286=>array(182,635,510,780),64287=>array(66,32,500,547),64288=>array(38,0,590,547),64289=>array(85,0,855,547),64290=>array(43,0,731,547),64291=>array(91,0,778,547),64292=>array(43,0,730,547),64293=>array(43,0,730,739),64294=>array(91,0,778,547),64295=>array(43,0,730,547),64296=>array(47,-4,730,547),64297=>array(106,256,732,627),64298=>array(20,0,750,710),64299=>array(20,0,750,723),64300=>array(20,0,750,710),64301=>array(20,0,750,710),64302=>array(84,-171,644,547),64303=>array(84,-217,644,547),64304=>array(84,-171,644,547),64305=>array(43,0,567,547),64306=>array(43,-9,418,547),64307=>array(43,0,545,547),64308=>array(91,0,596,547),64309=>array(43,0,346,547),64310=>array(43,0,442,547),64312=>array(90,-13,624,553),64313=>array(43,164,369,547),64314=>array(43,-240,487,547),64315=>array(43,0,511,547),64316=>array(43,0,527,711),64318=>array(43,0,633,554),64320=>array(43,0,362,547),64321=>array(90,-13,624,547),64323=>array(91,-240,584,547),64324=>array(91,0,603,547),64326=>array(33,0,564,547),64327=>array(91,-240,660,546),64328=>array(43,0,511,547),64329=>array(20,0,750,547),64330=>array(10,-4,592,547),64331=>array(91,0,252,710),64332=>array(43,0,567,710),64333=>array(43,0,511,710),64334=>array(91,0,603,710),64335=>array(43,0,652,729),64338=>array(63,-244,921,327),64339=>array(63,-244,1068,327),64340=>array(-10,-244,292,293),64341=>array(-10,-244,418,293),64342=>array(63,-244,921,327),64343=>array(63,-244,1068,327),64344=>array(-10,-244,302,293),64345=>array(-10,-244,418,293),64346=>array(63,-244,921,327),64347=>array(63,-244,1068,327),64348=>array(-10,-244,302,293),64349=>array(-10,-244,418,293),64350=>array(63,-5,921,566),64351=>array(63,-5,1068,566),64352=>array(-10,0,292,640),64353=>array(-10,0,418,640),64354=>array(63,-5,921,566),64355=>array(63,-5,1068,566),64356=>array(-10,0,302,640),64357=>array(-10,0,418,640),64358=>array(63,-5,921,599),64359=>array(63,-5,1068,599),64360=>array(-10,0,333,672),64361=>array(-10,0,418,672),64362=>array(63,-24,1082,786),64363=>array(63,-29,1201,786),64364=>array(-10,0,575,786),64365=>array(-10,0,729,786),64366=>array(63,-24,1082,786),64367=>array(63,-29,1201,786),64368=>array(-10,0,575,786),64369=>array(-10,0,729,786),64370=>array(77,-244,720,425),64371=>array(77,-244,730,425),64372=>array(-10,-244,628,405),64373=>array(-10,-244,730,405),64374=>array(77,-244,720,425),64375=>array(77,-244,730,425),64376=>array(-10,-117,628,405),64377=>array(-10,-117,730,405),64378=>array(77,-244,720,425),64379=>array(77,-244,730,425),64380=>array(-10,-244,628,405),64381=>array(-10,-244,730,405),64382=>array(77,-244,720,425),64383=>array(77,-244,730,425),64384=>array(-10,-244,628,405),64385=>array(-10,-244,730,405),64386=>array(61,-146,442,415),64387=>array(61,-146,587,415),64388=>array(61,-15,442,586),64389=>array(61,-15,587,586),64390=>array(61,-15,442,708),64391=>array(61,-15,587,708),64392=>array(61,-15,442,746),64393=>array(61,-15,587,746),64394=>array(-42,-244,508,615),64395=>array(-42,-244,632,615),64396=>array(-42,-244,520,648),64397=>array(-42,-244,632,648),64398=>array(63,-39,1024,760),64399=>array(63,-39,1034,760),64400=>array(-10,0,582,760),64401=>array(-10,0,591,760),64402=>array(63,-39,1024,910),64403=>array(63,-39,1034,910),64404=>array(-10,0,582,910),64405=>array(-10,0,591,910),64406=>array(63,-293,1024,910),64407=>array(63,-293,1034,910),64408=>array(-10,-269,582,910),64409=>array(-10,-269,591,910),64410=>array(63,-39,1024,910),64411=>array(63,-39,1034,910),64412=>array(-10,0,582,910),64413=>array(-10,0,591,910),64414=>array(62,-165,779,366),64415=>array(62,-244,910,287),64416=>array(62,-165,779,636),64417=>array(62,-244,910,514),64418=>array(-10,0,333,672),64419=>array(-10,0,418,672),64426=>array(70,-33,877,506),64427=>array(70,-244,890,369),64428=>array(-10,-33,633,506),64429=>array(-10,-244,670,369),64467=>array(70,-27,814,854),64468=>array(70,-27,941,854),64469=>array(-10,0,582,928),64470=>array(-10,0,591,928),64473=>array(-42,-244,547,556),64474=>array(-42,-244,637,556),64488=>array(-10,0,292,293),64489=>array(-10,0,418,293),64508=>array(63,-107,863,462),64509=>array(63,-126,1021,291),64510=>array(-10,-166,302,293),64511=>array(-10,-166,418,293),65056=>array(-419,735,0,880),65057=>array(0,735,419,880),65058=>array(-362,756,0,894),65059=>array(0,756,362,894),65136=>array(28,591,313,825),65137=>array(-10,0,352,825),65138=>array(28,591,313,881),65139=>array(51,0,356,177),65140=>array(28,-239,313,-5),65142=>array(28,591,313,723),65143=>array(-10,0,352,723),65144=>array(28,590,313,881),65145=>array(-10,0,352,881),65146=>array(28,-137,313,-5),65147=>array(-10,-137,352,125),65148=>array(9,599,333,869),65149=>array(-10,0,352,869),65150=>array(36,610,304,878),65151=>array(-10,0,352,878),65152=>array(73,20,437,493),65153=>array(-20,0,362,955),65154=>array(-20,0,385,955),65155=>array(75,0,259,993),65156=>array(75,0,385,993),65157=>array(-42,-244,547,603),65158=>array(-42,-244,637,603),65159=>array(76,-245,259,760),65160=>array(76,-245,385,760),65161=>array(63,-107,863,603),65162=>array(63,-126,1021,480),65163=>array(-10,0,292,627),65164=>array(-10,0,418,627),65165=>array(84,0,259,760),65166=>array(84,0,385,760),65167=>array(63,-149,921,327),65168=>array(63,-149,1068,327),65169=>array(-10,-173,292,293),65170=>array(-10,-173,418,293),65171=>array(48,-30,540,513),65172=>array(65,0,616,513),65173=>array(63,-5,921,415),65174=>array(63,-5,1068,415),65175=>array(-10,0,302,488),65176=>array(-10,0,418,488),65177=>array(63,-5,921,537),65178=>array(63,-5,1068,537),65179=>array(-10,0,302,610),65180=>array(-10,0,418,610),65181=>array(77,-244,720,425),65182=>array(77,-244,730,425),65183=>array(-10,-173,628,405),65184=>array(-10,-173,730,405),65185=>array(77,-244,720,425),65186=>array(77,-244,730,425),65187=>array(-10,0,628,405),65188=>array(-10,0,730,405),65189=>array(77,-244,720,579),65190=>array(77,-244,730,579),65191=>array(-10,0,628,530),65192=>array(-10,0,730,530),65193=>array(61,-15,442,415),65194=>array(61,-15,587,415),65195=>array(61,-15,442,579),65196=>array(61,-15,587,579),65197=>array(-42,-244,508,269),65198=>array(-42,-244,632,269),65199=>array(-42,-244,508,457),65200=>array(-42,-244,632,457),65201=>array(63,-244,1297,366),65202=>array(63,-244,1423,366),65203=>array(-10,-14,901,366),65204=>array(-10,-14,1027,366),65205=>array(63,-244,1297,586),65206=>array(63,-244,1423,586),65207=>array(-10,-14,901,586),65208=>array(-10,-14,1027,586),65209=>array(63,-244,1265,362),65210=>array(63,-244,1374,362),65211=>array(-10,0,886,362),65212=>array(-10,0,995,362),65213=>array(63,-244,1265,457),65214=>array(63,-244,1374,457),65215=>array(-10,0,886,481),65216=>array(-10,0,995,481),65217=>array(70,0,971,760),65218=>array(70,0,1081,760),65219=>array(-10,0,875,760),65220=>array(-10,0,984,760),65221=>array(70,0,971,760),65222=>array(70,0,1081,760),65223=>array(-10,0,875,760),65224=>array(-10,0,984,760),65225=>array(87,-244,720,521),65226=>array(57,-244,693,382),65227=>array(-10,0,583,521),65228=>array(-10,0,574,382),65229=>array(87,-244,720,652),65230=>array(57,-244,693,530),65231=>array(-10,0,583,652),65232=>array(-10,0,574,530),65233=>array(63,-24,1082,627),65234=>array(63,-29,1201,627),65235=>array(-10,0,575,627),65236=>array(-10,0,729,627),65237=>array(52,-215,825,635),65238=>array(52,-244,911,476),65239=>array(-10,0,575,635),65240=>array(-10,0,729,635),65241=>array(70,-27,814,760),65242=>array(70,-27,941,760),65243=>array(-10,0,582,760),65244=>array(-10,0,591,760),65245=>array(70,-142,778,760),65246=>array(70,-142,902,760),65247=>array(-10,0,292,760),65248=>array(-10,0,418,760),65249=>array(68,-244,660,369),65250=>array(68,-244,794,311),65251=>array(-10,-23,546,311),65252=>array(-10,-23,680,311),65253=>array(62,-165,779,457),65254=>array(62,-244,910,383),65255=>array(-10,0,292,481),65256=>array(-10,0,418,481),65257=>array(48,-30,540,358),65258=>array(65,0,616,366),65259=>array(-10,-33,633,506),65260=>array(-10,-244,670,369),65261=>array(-42,-244,547,322),65262=>array(-42,-244,637,322),65263=>array(63,-107,863,462),65264=>array(63,-126,1021,291),65265=>array(63,-244,863,462),65266=>array(63,-244,1021,291),65267=>array(-10,-166,302,293),65268=>array(-10,-166,418,293),65269=>array(-62,-15,643,882),65270=>array(-62,-15,769,882),65271=>array(33,-15,643,944),65272=>array(33,-15,769,944),65273=>array(41,-245,643,760),65274=>array(41,-245,769,760),65275=>array(41,-15,643,760),65276=>array(41,-15,769,760),65533=>array(24,-139,1089,926),65535=>array(50,-177,550,705)); +$cw=array(0=>600,32=>348,33=>456,34=>521,35=>838,36=>696,37=>1002,38=>872,39=>306,40=>457,41=>457,42=>523,43=>838,44=>380,45=>415,46=>380,47=>365,48=>696,49=>696,50=>696,51=>696,52=>696,53=>696,54=>696,55=>696,56=>696,57=>696,58=>400,59=>400,60=>838,61=>838,62=>838,63=>580,64=>1000,65=>774,66=>762,67=>734,68=>830,69=>683,70=>683,71=>821,72=>837,73=>372,74=>372,75=>775,76=>637,77=>995,78=>837,79=>850,80=>733,81=>850,82=>770,83=>720,84=>682,85=>812,86=>774,87=>1103,88=>771,89=>724,90=>725,91=>457,92=>365,93=>457,94=>838,95=>500,96=>500,97=>675,98=>716,99=>593,100=>716,101=>678,102=>435,103=>716,104=>712,105=>343,106=>343,107=>665,108=>343,109=>1042,110=>712,111=>687,112=>716,113=>716,114=>493,115=>595,116=>478,117=>712,118=>652,119=>924,120=>645,121=>652,122=>582,123=>712,124=>365,125=>712,126=>838,160=>348,161=>456,162=>696,163=>696,164=>636,165=>696,166=>365,167=>500,168=>500,169=>1000,170=>564,171=>646,172=>838,173=>415,174=>1000,175=>500,176=>500,177=>838,178=>438,179=>438,180=>500,181=>736,182=>636,183=>380,184=>500,185=>438,186=>564,187=>646,188=>1035,189=>1035,190=>1035,191=>580,192=>774,193=>774,194=>774,195=>774,196=>774,197=>774,198=>1085,199=>734,200=>683,201=>683,202=>683,203=>683,204=>372,205=>372,206=>372,207=>372,208=>838,209=>837,210=>850,211=>850,212=>850,213=>850,214=>850,215=>838,216=>850,217=>812,218=>812,219=>812,220=>812,221=>724,222=>738,223=>719,224=>675,225=>675,226=>675,227=>675,228=>675,229=>675,230=>1048,231=>593,232=>678,233=>678,234=>678,235=>678,236=>343,237=>343,238=>343,239=>343,240=>687,241=>712,242=>687,243=>687,244=>687,245=>687,246=>687,247=>838,248=>687,249=>712,250=>712,251=>712,252=>712,253=>652,254=>716,255=>652,256=>774,257=>675,258=>774,259=>675,260=>774,261=>675,262=>734,263=>593,264=>734,265=>593,266=>734,267=>593,268=>734,269=>593,270=>830,271=>716,272=>838,273=>716,274=>683,275=>678,276=>683,277=>678,278=>683,279=>678,280=>683,281=>678,282=>683,283=>678,284=>821,285=>716,286=>821,287=>716,288=>821,289=>716,290=>821,291=>716,292=>837,293=>712,294=>974,295=>790,296=>372,297=>343,298=>372,299=>343,300=>372,301=>343,302=>372,303=>343,304=>372,305=>343,306=>744,307=>686,308=>372,309=>343,310=>775,311=>665,312=>665,313=>637,314=>343,315=>637,316=>343,317=>637,318=>479,319=>637,320=>557,321=>642,322=>371,323=>837,324=>712,325=>837,326=>712,327=>837,328=>712,329=>983,330=>837,331=>712,332=>850,333=>687,334=>850,335=>687,336=>850,337=>687,338=>1167,339=>1094,340=>770,341=>493,342=>770,343=>493,344=>770,345=>493,346=>720,347=>595,348=>720,349=>595,350=>720,351=>595,352=>720,353=>595,354=>682,355=>478,356=>682,357=>478,358=>682,359=>478,360=>812,361=>712,362=>812,363=>712,364=>812,365=>712,366=>812,367=>712,368=>812,369=>712,370=>812,371=>712,372=>1103,373=>924,374=>724,375=>652,376=>724,377=>725,378=>582,379=>725,380=>582,381=>725,382=>582,383=>435,384=>716,385=>811,386=>762,387=>716,388=>762,389=>716,390=>734,391=>734,392=>593,393=>838,394=>879,395=>757,396=>716,397=>688,398=>683,399=>849,400=>696,401=>683,402=>435,403=>821,404=>793,405=>1045,406=>436,407=>389,408=>775,409=>665,410=>360,411=>592,412=>1042,413=>837,414=>712,415=>850,416=>874,417=>687,418=>1083,419=>912,420=>782,421=>716,422=>770,423=>720,424=>595,425=>683,426=>552,427=>478,428=>707,429=>478,430=>682,431=>835,432=>712,433=>850,434=>813,435=>797,436=>778,437=>725,438=>582,439=>772,440=>772,441=>641,442=>582,443=>696,444=>772,445=>641,446=>573,447=>716,448=>372,449=>659,450=>544,451=>372,452=>1555,453=>1412,454=>1298,455=>1009,456=>980,457=>686,458=>1209,459=>1180,460=>1055,461=>774,462=>675,463=>372,464=>343,465=>850,466=>687,467=>812,468=>712,469=>812,470=>712,471=>812,472=>712,473=>812,474=>712,475=>812,476=>712,477=>678,478=>774,479=>675,480=>774,481=>675,482=>1085,483=>1048,484=>821,485=>716,486=>821,487=>716,488=>775,489=>665,490=>850,491=>687,492=>850,493=>687,494=>772,495=>582,496=>343,497=>1555,498=>1412,499=>1298,500=>821,501=>716,502=>1289,503=>787,504=>837,505=>712,506=>774,507=>675,508=>1085,509=>1048,510=>850,511=>687,512=>774,513=>675,514=>774,515=>675,516=>683,517=>678,518=>683,519=>678,520=>372,521=>343,522=>372,523=>343,524=>850,525=>687,526=>850,527=>687,528=>770,529=>493,530=>770,531=>493,532=>812,533=>712,534=>812,535=>712,536=>720,537=>595,538=>682,539=>478,540=>690,541=>607,542=>837,543=>712,544=>837,545=>865,546=>809,547=>659,548=>725,549=>582,550=>774,551=>675,552=>683,553=>678,554=>850,555=>687,556=>850,557=>687,558=>850,559=>687,560=>850,561=>687,562=>724,563=>652,564=>492,565=>867,566=>512,567=>343,568=>1088,569=>1088,570=>774,571=>734,572=>593,573=>637,574=>682,575=>595,576=>582,577=>782,578=>614,579=>762,580=>812,581=>774,582=>683,583=>678,584=>372,585=>343,586=>860,587=>791,588=>770,589=>493,590=>724,591=>652,592=>675,593=>716,594=>716,595=>716,596=>593,597=>593,598=>717,599=>792,600=>678,601=>678,602=>876,603=>557,604=>545,605=>815,606=>731,607=>343,608=>792,609=>716,610=>627,611=>644,612=>635,613=>712,614=>712,615=>712,616=>545,617=>440,618=>545,619=>559,620=>693,621=>343,622=>841,623=>1042,624=>1042,625=>1042,626=>712,627=>793,628=>707,629=>687,630=>909,631=>681,632=>796,633=>538,634=>538,635=>650,636=>493,637=>493,638=>596,639=>596,640=>642,641=>642,642=>595,643=>415,644=>435,645=>605,646=>552,647=>478,648=>478,649=>920,650=>772,651=>670,652=>652,653=>924,654=>652,655=>724,656=>694,657=>684,658=>641,659=>641,660=>573,661=>573,662=>573,663=>573,664=>850,665=>633,666=>731,667=>685,668=>691,669=>343,670=>732,671=>539,672=>792,673=>573,674=>573,675=>1156,676=>1214,677=>1155,678=>975,679=>769,680=>929,681=>1026,682=>862,683=>780,684=>591,685=>415,686=>677,687=>789,688=>456,689=>456,690=>219,691=>315,692=>315,693=>315,694=>411,695=>591,696=>417,697=>302,698=>521,699=>380,700=>380,701=>380,702=>366,703=>366,704=>326,705=>326,706=>500,707=>500,708=>500,709=>500,710=>500,711=>500,712=>306,713=>500,714=>500,715=>500,716=>306,717=>500,718=>500,719=>500,720=>337,721=>337,722=>366,723=>366,724=>500,725=>500,726=>416,727=>328,728=>500,729=>500,730=>500,731=>500,732=>500,733=>500,734=>351,735=>500,736=>412,737=>219,738=>381,739=>413,740=>326,741=>500,742=>500,743=>500,744=>500,745=>500,748=>500,749=>500,750=>657,755=>500,759=>500,768=>0,769=>0,770=>0,771=>0,772=>0,773=>0,774=>0,775=>0,776=>0,777=>0,778=>0,779=>0,780=>0,781=>0,782=>0,783=>0,784=>0,785=>0,786=>0,787=>0,788=>0,789=>0,790=>0,791=>0,792=>0,793=>0,794=>0,795=>0,796=>0,797=>0,798=>0,799=>0,800=>0,801=>0,802=>0,803=>0,804=>0,805=>0,806=>0,807=>0,808=>0,809=>0,810=>0,811=>0,812=>0,813=>0,814=>0,815=>0,816=>0,817=>0,818=>0,819=>0,820=>0,821=>0,822=>0,823=>0,824=>0,825=>0,826=>0,827=>0,828=>0,829=>0,830=>0,831=>0,832=>0,833=>0,834=>0,835=>0,836=>0,837=>0,838=>0,839=>0,840=>0,841=>0,842=>0,843=>0,844=>0,845=>0,846=>0,847=>0,849=>0,850=>0,851=>0,855=>0,856=>0,858=>0,860=>0,861=>0,862=>0,863=>0,864=>0,865=>0,866=>0,880=>698,881=>565,882=>1022,883=>836,884=>302,885=>302,886=>837,887=>701,890=>500,891=>593,892=>550,893=>549,894=>400,900=>441,901=>500,902=>797,903=>380,904=>846,905=>1009,906=>563,908=>891,910=>980,911=>894,912=>390,913=>774,914=>762,915=>637,916=>774,917=>683,918=>725,919=>837,920=>850,921=>372,922=>775,923=>774,924=>995,925=>837,926=>632,927=>850,928=>837,929=>733,931=>683,932=>682,933=>724,934=>850,935=>771,936=>850,937=>850,938=>372,939=>724,940=>687,941=>557,942=>712,943=>390,944=>675,945=>687,946=>716,947=>681,948=>687,949=>557,950=>591,951=>712,952=>687,953=>390,954=>710,955=>633,956=>736,957=>681,958=>591,959=>687,960=>791,961=>716,962=>593,963=>779,964=>638,965=>675,966=>782,967=>645,968=>794,969=>869,970=>390,971=>675,972=>687,973=>675,974=>869,975=>775,976=>651,977=>661,978=>746,979=>981,980=>746,981=>796,982=>869,983=>744,984=>850,985=>687,986=>734,987=>593,988=>683,989=>494,990=>702,991=>660,992=>919,993=>627,994=>1093,995=>837,996=>832,997=>716,998=>928,999=>744,1000=>733,1001=>650,1002=>789,1003=>671,1004=>752,1005=>716,1006=>682,1007=>590,1008=>744,1009=>716,1010=>593,1011=>343,1012=>850,1013=>645,1014=>644,1015=>738,1016=>716,1017=>734,1018=>995,1019=>732,1020=>716,1021=>698,1022=>734,1023=>698,1024=>683,1025=>683,1026=>878,1027=>637,1028=>734,1029=>720,1030=>372,1031=>372,1032=>372,1033=>1154,1034=>1130,1035=>878,1036=>817,1037=>837,1038=>771,1039=>837,1040=>774,1041=>762,1042=>762,1043=>637,1044=>891,1045=>683,1046=>1224,1047=>710,1048=>837,1049=>837,1050=>817,1051=>831,1052=>995,1053=>837,1054=>850,1055=>837,1056=>733,1057=>734,1058=>682,1059=>771,1060=>992,1061=>771,1062=>928,1063=>808,1064=>1235,1065=>1326,1066=>939,1067=>1036,1068=>762,1069=>734,1070=>1174,1071=>770,1072=>675,1073=>698,1074=>633,1075=>522,1076=>808,1077=>678,1078=>995,1079=>581,1080=>701,1081=>701,1082=>679,1083=>732,1084=>817,1085=>691,1086=>687,1087=>691,1088=>716,1089=>593,1090=>580,1091=>652,1092=>992,1093=>645,1094=>741,1095=>687,1096=>1062,1097=>1105,1098=>751,1099=>904,1100=>632,1101=>593,1102=>972,1103=>642,1104=>678,1105=>678,1106=>714,1107=>522,1108=>593,1109=>595,1110=>343,1111=>343,1112=>343,1113=>991,1114=>956,1115=>734,1116=>679,1117=>701,1118=>652,1119=>691,1120=>1093,1121=>869,1122=>840,1123=>736,1124=>1012,1125=>839,1126=>992,1127=>832,1128=>1358,1129=>1121,1130=>850,1131=>687,1132=>1236,1133=>1007,1134=>696,1135=>557,1136=>1075,1137=>1061,1138=>850,1139=>687,1140=>850,1141=>695,1142=>850,1143=>695,1144=>1148,1145=>1043,1146=>1074,1147=>863,1148=>1405,1149=>1173,1150=>1093,1151=>869,1152=>734,1153=>593,1154=>652,1155=>0,1156=>0,1157=>0,1158=>0,1159=>0,1160=>418,1161=>418,1162=>957,1163=>807,1164=>762,1165=>611,1166=>733,1167=>716,1168=>637,1169=>522,1170=>666,1171=>543,1172=>808,1173=>669,1174=>1224,1175=>995,1176=>710,1177=>581,1178=>775,1179=>679,1180=>817,1181=>679,1182=>817,1183=>679,1184=>1015,1185=>826,1186=>956,1187=>808,1188=>1103,1189=>874,1190=>1273,1191=>1017,1192=>952,1193=>858,1194=>734,1195=>593,1196=>682,1197=>580,1198=>724,1199=>652,1200=>724,1201=>652,1202=>771,1203=>645,1204=>1112,1205=>1000,1206=>808,1207=>687,1208=>808,1209=>687,1210=>808,1211=>712,1212=>1026,1213=>810,1214=>1026,1215=>810,1216=>372,1217=>1224,1218=>995,1219=>775,1220=>630,1221=>951,1222=>805,1223=>837,1224=>691,1225=>957,1226=>807,1227=>808,1228=>687,1229=>1115,1230=>933,1231=>343,1232=>774,1233=>675,1234=>774,1235=>675,1236=>1085,1237=>1048,1238=>683,1239=>678,1240=>849,1241=>678,1242=>849,1243=>678,1244=>1224,1245=>995,1246=>710,1247=>581,1248=>772,1249=>641,1250=>837,1251=>701,1252=>837,1253=>701,1254=>850,1255=>687,1256=>850,1257=>687,1258=>850,1259=>687,1260=>734,1261=>593,1262=>771,1263=>652,1264=>771,1265=>652,1266=>771,1267=>652,1268=>808,1269=>687,1270=>637,1271=>522,1272=>1036,1273=>904,1274=>666,1275=>543,1276=>771,1277=>645,1278=>771,1279=>645,1280=>762,1281=>608,1282=>1159,1283=>893,1284=>1119,1285=>920,1286=>828,1287=>693,1288=>1242,1289=>1017,1290=>1289,1291=>1013,1292=>839,1293=>638,1294=>938,1295=>803,1296=>696,1297=>557,1298=>831,1299=>732,1300=>1286,1301=>1068,1302=>1065,1303=>979,1304=>1082,1305=>1013,1306=>850,1307=>716,1308=>1103,1309=>924,1310=>817,1311=>679,1312=>1267,1313=>1059,1314=>1273,1315=>1017,1316=>957,1317=>807,1329=>813,1330=>729,1331=>728,1332=>731,1333=>729,1334=>733,1335=>652,1336=>720,1337=>903,1338=>728,1339=>666,1340=>558,1341=>961,1342=>788,1343=>713,1344=>651,1345=>730,1346=>715,1347=>704,1348=>780,1349=>689,1350=>715,1351=>708,1352=>731,1353=>677,1354=>867,1355=>711,1356=>780,1357=>731,1358=>715,1359=>693,1360=>666,1361=>698,1362=>576,1363=>833,1364=>698,1365=>763,1366=>855,1369=>330,1370=>342,1371=>308,1372=>374,1373=>313,1374=>461,1375=>468,1377=>938,1378=>642,1379=>704,1380=>708,1381=>642,1382=>644,1383=>565,1384=>642,1385=>756,1386=>704,1387=>643,1388=>310,1389=>984,1390=>638,1391=>643,1392=>643,1393=>603,1394=>643,1395=>642,1396=>643,1397=>309,1398=>643,1399=>486,1400=>643,1401=>366,1402=>938,1403=>573,1404=>666,1405=>643,1406=>643,1407=>934,1408=>643,1409=>643,1410=>479,1411=>934,1412=>648,1413=>620,1414=>813,1415=>812,1417=>360,1418=>374,1456=>0,1457=>0,1458=>0,1459=>0,1460=>0,1461=>0,1462=>0,1463=>0,1464=>0,1465=>0,1466=>0,1467=>0,1468=>0,1469=>0,1470=>415,1471=>0,1472=>372,1473=>0,1474=>0,1475=>372,1478=>497,1479=>0,1488=>728,1489=>610,1490=>447,1491=>588,1492=>687,1493=>343,1494=>400,1495=>687,1496=>679,1497=>294,1498=>578,1499=>566,1500=>605,1501=>696,1502=>724,1503=>343,1504=>453,1505=>680,1506=>666,1507=>675,1508=>658,1509=>661,1510=>653,1511=>736,1512=>602,1513=>758,1514=>683,1520=>664,1521=>567,1522=>519,1523=>444,1524=>710,1542=>667,1543=>667,1545=>884,1546=>1157,1548=>380,1557=>0,1563=>400,1567=>580,1569=>511,1570=>343,1571=>343,1572=>622,1573=>343,1574=>917,1575=>343,1576=>1005,1577=>590,1578=>1005,1579=>1005,1580=>721,1581=>721,1582=>721,1583=>513,1584=>513,1585=>576,1586=>576,1587=>1380,1588=>1380,1589=>1345,1590=>1345,1591=>1039,1592=>1039,1593=>683,1594=>683,1600=>342,1601=>1162,1602=>894,1603=>917,1604=>868,1605=>733,1606=>854,1607=>590,1608=>622,1609=>917,1610=>917,1611=>0,1612=>0,1613=>0,1614=>0,1615=>0,1616=>0,1617=>0,1618=>0,1619=>0,1620=>0,1621=>0,1623=>0,1626=>500,1632=>610,1633=>610,1634=>610,1635=>610,1636=>610,1637=>610,1638=>610,1639=>610,1640=>610,1641=>610,1642=>610,1643=>374,1644=>380,1645=>545,1646=>1005,1647=>894,1648=>0,1652=>292,1657=>1005,1658=>1005,1659=>1005,1660=>1005,1661=>1005,1662=>1005,1663=>1005,1664=>1005,1665=>721,1666=>721,1667=>721,1668=>721,1669=>721,1670=>721,1671=>721,1672=>445,1673=>445,1674=>445,1675=>445,1676=>445,1677=>445,1678=>445,1679=>445,1680=>445,1681=>576,1682=>576,1683=>576,1684=>576,1685=>681,1686=>576,1687=>576,1688=>576,1689=>576,1690=>1380,1691=>1380,1692=>1380,1693=>1345,1694=>1345,1695=>1039,1696=>683,1697=>1162,1698=>1162,1699=>1162,1700=>1162,1701=>1162,1702=>1162,1703=>894,1704=>894,1705=>1024,1706=>1271,1707=>1024,1708=>917,1709=>917,1710=>917,1711=>1024,1712=>1024,1713=>1024,1714=>1024,1715=>1024,1716=>1024,1717=>868,1718=>868,1719=>868,1720=>868,1721=>854,1722=>854,1723=>854,1724=>854,1725=>854,1726=>938,1727=>721,1734=>622,1740=>917,1742=>917,1749=>590,1776=>610,1777=>610,1778=>610,1779=>610,1780=>610,1781=>610,1782=>610,1783=>610,1784=>610,1785=>610,1984=>696,1985=>696,1986=>696,1987=>696,1988=>696,1989=>696,1990=>696,1991=>696,1992=>696,1993=>696,1994=>343,1995=>547,1996=>543,1997=>652,1998=>691,1999=>691,2000=>594,2001=>691,2002=>904,2003=>551,2004=>551,2005=>627,2006=>688,2007=>444,2008=>1022,2009=>506,2010=>826,2011=>691,2012=>652,2013=>912,2014=>627,2015=>707,2016=>506,2017=>652,2018=>574,2019=>627,2020=>627,2021=>627,2022=>574,2023=>574,2027=>0,2028=>0,2029=>0,2030=>0,2031=>0,2032=>0,2033=>0,2034=>0,2035=>0,2036=>380,2037=>380,2040=>691,2041=>691,2042=>415,3647=>696,3713=>790,3714=>748,3716=>749,3719=>569,3720=>742,3722=>744,3725=>761,3732=>706,3733=>704,3734=>747,3735=>819,3737=>730,3738=>727,3739=>727,3740=>922,3741=>827,3742=>866,3743=>866,3745=>836,3746=>761,3747=>770,3749=>769,3751=>713,3754=>827,3755=>1031,3757=>724,3758=>784,3759=>934,3760=>688,3761=>0,3762=>610,3763=>610,3764=>0,3765=>0,3766=>0,3767=>0,3768=>0,3769=>0,3771=>0,3772=>0,3773=>670,3776=>516,3777=>860,3778=>516,3779=>650,3780=>632,3782=>759,3784=>0,3785=>0,3786=>0,3787=>0,3788=>0,3789=>0,3792=>771,3793=>771,3794=>693,3795=>836,3796=>729,3797=>729,3798=>849,3799=>790,3800=>759,3801=>910,3804=>1363,3805=>1363,4256=>874,4257=>733,4258=>679,4259=>834,4260=>615,4261=>768,4262=>753,4263=>914,4264=>453,4265=>620,4266=>843,4267=>882,4268=>625,4269=>854,4270=>781,4271=>629,4272=>912,4273=>621,4274=>620,4275=>854,4276=>866,4277=>724,4278=>630,4279=>621,4280=>625,4281=>620,4282=>818,4283=>874,4284=>615,4285=>623,4286=>625,4287=>725,4288=>844,4289=>596,4290=>688,4291=>596,4292=>594,4293=>738,4304=>554,4305=>563,4306=>622,4307=>834,4308=>555,4309=>564,4310=>551,4311=>828,4312=>563,4313=>556,4314=>1074,4315=>568,4316=>568,4317=>814,4318=>554,4319=>563,4320=>823,4321=>568,4322=>700,4323=>591,4324=>852,4325=>560,4326=>814,4327=>563,4328=>553,4329=>568,4330=>622,4331=>568,4332=>553,4333=>566,4334=>568,4335=>540,4336=>554,4337=>559,4338=>553,4339=>554,4340=>553,4341=>587,4342=>853,4343=>604,4344=>563,4345=>622,4346=>554,4347=>448,4348=>324,5121=>774,5122=>774,5123=>774,5124=>774,5125=>905,5126=>905,5127=>905,5129=>905,5130=>905,5131=>905,5132=>1018,5133=>1009,5134=>1018,5135=>1009,5136=>1018,5137=>1009,5138=>1149,5139=>1140,5140=>1149,5141=>1140,5142=>905,5143=>1149,5144=>1142,5145=>1149,5146=>1142,5147=>905,5149=>310,5150=>529,5151=>425,5152=>425,5153=>395,5154=>395,5155=>395,5156=>395,5157=>564,5158=>470,5159=>310,5160=>395,5161=>395,5162=>395,5163=>1213,5164=>986,5165=>1216,5166=>1297,5167=>774,5168=>774,5169=>774,5170=>774,5171=>886,5172=>886,5173=>886,5175=>886,5176=>886,5177=>886,5178=>1018,5179=>1009,5180=>1018,5181=>1009,5182=>1018,5183=>1009,5184=>1149,5185=>1140,5186=>1149,5187=>1140,5188=>1149,5189=>1142,5190=>1149,5191=>1142,5192=>886,5193=>576,5194=>229,5196=>812,5197=>812,5198=>812,5199=>812,5200=>815,5201=>815,5202=>815,5204=>815,5205=>815,5206=>815,5207=>1056,5208=>1048,5209=>1056,5210=>1048,5211=>1056,5212=>1048,5213=>1060,5214=>1054,5215=>1060,5216=>1054,5217=>1060,5218=>1052,5219=>1060,5220=>1052,5221=>1060,5222=>483,5223=>1005,5224=>1005,5225=>1023,5226=>1017,5227=>743,5228=>743,5229=>743,5230=>743,5231=>743,5232=>743,5233=>743,5234=>743,5235=>743,5236=>1029,5237=>975,5238=>980,5239=>975,5240=>980,5241=>975,5242=>1029,5243=>975,5244=>1029,5245=>975,5246=>980,5247=>975,5248=>980,5249=>975,5250=>980,5251=>501,5252=>501,5253=>938,5254=>938,5255=>938,5256=>938,5257=>743,5258=>743,5259=>743,5260=>743,5261=>743,5262=>743,5263=>743,5264=>743,5265=>743,5266=>1029,5267=>975,5268=>1029,5269=>975,5270=>1029,5271=>975,5272=>1029,5273=>975,5274=>1029,5275=>975,5276=>1029,5277=>975,5278=>1029,5279=>975,5280=>1029,5281=>501,5282=>501,5283=>626,5284=>626,5285=>626,5286=>626,5287=>626,5288=>626,5289=>626,5290=>626,5291=>626,5292=>881,5293=>854,5294=>863,5295=>874,5296=>863,5297=>874,5298=>881,5299=>874,5300=>881,5301=>874,5302=>863,5303=>874,5304=>863,5305=>874,5306=>863,5307=>436,5308=>548,5309=>436,5312=>988,5313=>988,5314=>988,5315=>988,5316=>931,5317=>931,5318=>931,5319=>931,5320=>931,5321=>1238,5322=>1247,5323=>1200,5324=>1228,5325=>1200,5326=>1228,5327=>931,5328=>660,5329=>497,5330=>660,5331=>988,5332=>988,5333=>988,5334=>988,5335=>931,5336=>931,5337=>931,5338=>931,5339=>931,5340=>1231,5341=>1247,5342=>1283,5343=>1228,5344=>1283,5345=>1228,5346=>1228,5347=>1214,5348=>1228,5349=>1214,5350=>1283,5351=>1228,5352=>1283,5353=>1228,5354=>660,5356=>886,5357=>730,5358=>730,5359=>730,5360=>730,5361=>730,5362=>730,5363=>730,5364=>730,5365=>730,5366=>998,5367=>958,5368=>967,5369=>989,5370=>967,5371=>989,5372=>998,5373=>958,5374=>998,5375=>958,5376=>967,5377=>989,5378=>967,5379=>989,5380=>967,5381=>493,5382=>460,5383=>493,5392=>923,5393=>923,5394=>923,5395=>1136,5396=>1136,5397=>1136,5398=>1136,5399=>1209,5400=>1202,5401=>1209,5402=>1202,5403=>1209,5404=>1202,5405=>1431,5406=>1420,5407=>1431,5408=>1420,5409=>1431,5410=>1420,5411=>1431,5412=>1420,5413=>746,5414=>776,5415=>776,5416=>776,5417=>776,5418=>776,5419=>776,5420=>776,5421=>776,5422=>776,5423=>1003,5424=>1003,5425=>1013,5426=>996,5427=>1013,5428=>996,5429=>1003,5430=>1003,5431=>1003,5432=>1003,5433=>1013,5434=>996,5435=>1013,5436=>996,5437=>1013,5438=>495,5440=>395,5441=>510,5442=>1033,5443=>1033,5444=>976,5445=>976,5446=>976,5447=>976,5448=>733,5449=>733,5450=>733,5451=>733,5452=>733,5453=>733,5454=>1003,5455=>959,5456=>495,5458=>886,5459=>774,5460=>774,5461=>774,5462=>774,5463=>928,5464=>928,5465=>928,5466=>928,5467=>1172,5468=>1142,5469=>602,5470=>812,5471=>812,5472=>812,5473=>812,5474=>812,5475=>812,5476=>815,5477=>815,5478=>815,5479=>815,5480=>1060,5481=>1052,5482=>548,5492=>977,5493=>977,5494=>977,5495=>977,5496=>977,5497=>977,5498=>977,5499=>618,5500=>837,5501=>510,5502=>1238,5503=>1238,5504=>1238,5505=>1238,5506=>1238,5507=>1238,5508=>1238,5509=>989,5514=>977,5515=>977,5516=>977,5517=>977,5518=>1591,5519=>1591,5520=>1591,5521=>1295,5522=>1295,5523=>1591,5524=>1591,5525=>848,5526=>1273,5536=>988,5537=>988,5538=>931,5539=>931,5540=>931,5541=>931,5542=>660,5543=>776,5544=>776,5545=>776,5546=>776,5547=>776,5548=>776,5549=>776,5550=>495,5551=>743,5598=>830,5601=>830,5702=>496,5703=>496,5742=>413,5743=>1238,5744=>1591,5745=>2016,5746=>2016,5747=>1720,5748=>1678,5749=>2016,5750=>2016,5760=>543,5761=>637,5762=>945,5763=>1254,5764=>1563,5765=>1871,5766=>627,5767=>936,5768=>1254,5769=>1559,5770=>1871,5771=>569,5772=>877,5773=>1187,5774=>1497,5775=>1807,5776=>637,5777=>945,5778=>1240,5779=>1555,5780=>1871,5781=>569,5782=>569,5783=>789,5784=>1234,5785=>1559,5786=>740,5787=>638,5788=>638,7424=>652,7425=>833,7426=>1048,7427=>608,7428=>593,7429=>676,7430=>676,7431=>559,7432=>557,7433=>343,7434=>494,7435=>665,7436=>539,7437=>817,7438=>701,7439=>687,7440=>593,7441=>660,7442=>660,7443=>660,7444=>1094,7446=>687,7447=>687,7448=>556,7449=>642,7450=>642,7451=>580,7452=>634,7453=>737,7454=>948,7455=>695,7456=>652,7457=>924,7458=>582,7459=>646,7462=>539,7463=>652,7464=>691,7465=>556,7466=>781,7467=>732,7468=>487,7469=>683,7470=>480,7472=>523,7473=>430,7474=>430,7475=>517,7476=>527,7477=>234,7478=>234,7479=>488,7480=>401,7481=>626,7482=>527,7483=>527,7484=>535,7485=>509,7486=>461,7487=>485,7488=>430,7489=>511,7490=>695,7491=>458,7492=>458,7493=>479,7494=>712,7495=>479,7496=>479,7497=>479,7498=>479,7499=>386,7500=>386,7501=>479,7502=>219,7503=>487,7504=>664,7505=>456,7506=>488,7507=>414,7508=>488,7509=>488,7510=>479,7511=>388,7512=>456,7513=>462,7514=>664,7515=>501,7517=>451,7518=>429,7519=>433,7520=>493,7521=>406,7522=>219,7523=>315,7524=>456,7525=>501,7526=>451,7527=>429,7528=>451,7529=>493,7530=>406,7543=>716,7544=>527,7547=>545,7549=>747,7557=>514,7579=>479,7580=>414,7581=>414,7582=>488,7583=>386,7584=>377,7585=>348,7586=>479,7587=>456,7588=>347,7589=>281,7590=>347,7591=>347,7592=>431,7593=>326,7594=>330,7595=>370,7596=>664,7597=>664,7598=>562,7599=>562,7600=>448,7601=>488,7602=>542,7603=>422,7604=>396,7605=>388,7606=>583,7607=>494,7608=>399,7609=>451,7610=>501,7611=>417,7612=>523,7613=>470,7614=>455,7615=>425,7620=>0,7621=>0,7622=>0,7623=>0,7624=>0,7625=>0,7680=>774,7681=>675,7682=>762,7683=>716,7684=>762,7685=>716,7686=>762,7687=>716,7688=>734,7689=>593,7690=>830,7691=>716,7692=>830,7693=>716,7694=>830,7695=>716,7696=>830,7697=>716,7698=>830,7699=>716,7700=>683,7701=>678,7702=>683,7703=>678,7704=>683,7705=>678,7706=>683,7707=>678,7708=>683,7709=>678,7710=>683,7711=>435,7712=>821,7713=>716,7714=>837,7715=>712,7716=>837,7717=>712,7718=>837,7719=>712,7720=>837,7721=>712,7722=>837,7723=>712,7724=>372,7725=>343,7726=>372,7727=>343,7728=>775,7729=>665,7730=>775,7731=>665,7732=>775,7733=>665,7734=>637,7735=>343,7736=>637,7737=>343,7738=>637,7739=>343,7740=>637,7741=>343,7742=>995,7743=>1042,7744=>995,7745=>1042,7746=>995,7747=>1042,7748=>837,7749=>712,7750=>837,7751=>712,7752=>837,7753=>712,7754=>837,7755=>712,7756=>850,7757=>687,7758=>850,7759=>687,7760=>850,7761=>687,7762=>850,7763=>687,7764=>733,7765=>716,7766=>733,7767=>716,7768=>770,7769=>493,7770=>770,7771=>493,7772=>770,7773=>493,7774=>770,7775=>493,7776=>720,7777=>595,7778=>720,7779=>595,7780=>720,7781=>595,7782=>720,7783=>595,7784=>720,7785=>595,7786=>682,7787=>478,7788=>682,7789=>478,7790=>682,7791=>478,7792=>682,7793=>478,7794=>812,7795=>712,7796=>812,7797=>712,7798=>812,7799=>712,7800=>812,7801=>712,7802=>812,7803=>712,7804=>774,7805=>652,7806=>774,7807=>652,7808=>1103,7809=>924,7810=>1103,7811=>924,7812=>1103,7813=>924,7814=>1103,7815=>924,7816=>1103,7817=>924,7818=>771,7819=>645,7820=>771,7821=>645,7822=>724,7823=>652,7824=>725,7825=>582,7826=>725,7827=>582,7828=>725,7829=>582,7830=>712,7831=>478,7832=>924,7833=>652,7834=>675,7835=>435,7836=>435,7837=>435,7838=>896,7839=>687,7840=>774,7841=>675,7842=>774,7843=>675,7844=>774,7845=>675,7846=>774,7847=>675,7848=>774,7849=>675,7850=>774,7851=>675,7852=>774,7853=>675,7854=>774,7855=>675,7856=>774,7857=>675,7858=>774,7859=>675,7860=>774,7861=>675,7862=>774,7863=>675,7864=>683,7865=>678,7866=>683,7867=>678,7868=>683,7869=>678,7870=>683,7871=>678,7872=>683,7873=>678,7874=>683,7875=>678,7876=>683,7877=>678,7878=>683,7879=>678,7880=>372,7881=>343,7882=>372,7883=>343,7884=>850,7885=>687,7886=>850,7887=>687,7888=>850,7889=>687,7890=>850,7891=>687,7892=>850,7893=>687,7894=>850,7895=>687,7896=>850,7897=>687,7898=>874,7899=>687,7900=>874,7901=>687,7902=>874,7903=>687,7904=>874,7905=>687,7906=>874,7907=>687,7908=>812,7909=>712,7910=>812,7911=>712,7912=>835,7913=>712,7914=>835,7915=>712,7916=>835,7917=>712,7918=>835,7919=>712,7920=>835,7921=>712,7922=>724,7923=>652,7924=>724,7925=>652,7926=>724,7927=>652,7928=>724,7929=>652,7930=>953,7931=>644,7936=>687,7937=>687,7938=>687,7939=>687,7940=>687,7941=>687,7942=>687,7943=>687,7944=>774,7945=>774,7946=>1041,7947=>1043,7948=>935,7949=>963,7950=>835,7951=>859,7952=>557,7953=>557,7954=>557,7955=>557,7956=>557,7957=>557,7960=>792,7961=>794,7962=>1100,7963=>1096,7964=>1023,7965=>1052,7968=>712,7969=>712,7970=>712,7971=>712,7972=>712,7973=>712,7974=>712,7975=>712,7976=>945,7977=>951,7978=>1250,7979=>1250,7980=>1180,7981=>1206,7982=>1054,7983=>1063,7984=>390,7985=>390,7986=>390,7987=>390,7988=>390,7989=>390,7990=>390,7991=>390,7992=>483,7993=>489,7994=>777,7995=>785,7996=>712,7997=>738,7998=>604,7999=>604,8000=>687,8001=>687,8002=>687,8003=>687,8004=>687,8005=>687,8008=>892,8009=>933,8010=>1221,8011=>1224,8012=>1053,8013=>1082,8016=>675,8017=>675,8018=>675,8019=>675,8020=>675,8021=>675,8022=>675,8023=>675,8025=>930,8027=>1184,8029=>1199,8031=>1049,8032=>869,8033=>869,8034=>869,8035=>869,8036=>869,8037=>869,8038=>869,8039=>869,8040=>909,8041=>958,8042=>1246,8043=>1251,8044=>1076,8045=>1105,8046=>1028,8047=>1076,8048=>687,8049=>687,8050=>557,8051=>557,8052=>712,8053=>712,8054=>390,8055=>390,8056=>687,8057=>687,8058=>675,8059=>675,8060=>869,8061=>869,8064=>687,8065=>687,8066=>687,8067=>687,8068=>687,8069=>687,8070=>687,8071=>687,8072=>774,8073=>774,8074=>1041,8075=>1043,8076=>935,8077=>963,8078=>835,8079=>859,8080=>712,8081=>712,8082=>712,8083=>712,8084=>712,8085=>712,8086=>712,8087=>712,8088=>945,8089=>951,8090=>1250,8091=>1250,8092=>1180,8093=>1206,8094=>1054,8095=>1063,8096=>869,8097=>869,8098=>869,8099=>869,8100=>869,8101=>869,8102=>869,8103=>869,8104=>909,8105=>958,8106=>1246,8107=>1251,8108=>1076,8109=>1105,8110=>1028,8111=>1076,8112=>687,8113=>687,8114=>687,8115=>687,8116=>687,8118=>687,8119=>687,8120=>774,8121=>774,8122=>876,8123=>797,8124=>774,8125=>500,8126=>500,8127=>500,8128=>500,8129=>500,8130=>712,8131=>712,8132=>712,8134=>712,8135=>712,8136=>929,8137=>846,8138=>1080,8139=>1009,8140=>837,8141=>500,8142=>500,8143=>500,8144=>390,8145=>390,8146=>390,8147=>390,8150=>390,8151=>390,8152=>372,8153=>372,8154=>621,8155=>563,8157=>500,8158=>500,8159=>500,8160=>675,8161=>675,8162=>675,8163=>675,8164=>716,8165=>716,8166=>675,8167=>675,8168=>724,8169=>724,8170=>1020,8171=>980,8172=>838,8173=>500,8174=>500,8175=>500,8178=>869,8179=>869,8180=>869,8182=>869,8183=>869,8184=>1065,8185=>891,8186=>1084,8187=>894,8188=>850,8189=>500,8190=>500,8192=>500,8193=>1000,8194=>500,8195=>1000,8196=>330,8197=>250,8198=>167,8199=>696,8200=>380,8201=>200,8202=>100,8203=>0,8204=>0,8205=>0,8206=>0,8207=>0,8208=>415,8209=>415,8210=>696,8211=>500,8212=>1000,8213=>1000,8214=>500,8215=>500,8216=>380,8217=>380,8218=>380,8219=>380,8220=>657,8221=>657,8222=>657,8223=>657,8224=>500,8225=>500,8226=>639,8227=>639,8228=>333,8229=>667,8230=>1000,8231=>348,8232=>0,8233=>0,8234=>0,8235=>0,8236=>0,8237=>0,8238=>0,8239=>200,8240=>1440,8241=>1887,8242=>264,8243=>447,8244=>630,8245=>264,8246=>447,8247=>630,8248=>733,8249=>412,8250=>412,8251=>972,8252=>627,8253=>580,8254=>500,8255=>828,8256=>828,8257=>329,8258=>1023,8259=>500,8260=>167,8261=>457,8262=>457,8263=>1030,8264=>829,8265=>829,8266=>513,8267=>636,8268=>500,8269=>500,8270=>523,8271=>400,8272=>828,8273=>523,8274=>556,8275=>1000,8276=>828,8277=>838,8278=>684,8279=>813,8280=>838,8281=>838,8282=>380,8283=>872,8284=>838,8285=>380,8286=>380,8287=>222,8288=>0,8289=>0,8290=>0,8291=>0,8292=>0,8298=>0,8299=>0,8300=>0,8301=>0,8302=>0,8303=>0,8304=>438,8305=>219,8308=>438,8309=>438,8310=>438,8311=>438,8312=>438,8313=>438,8314=>528,8315=>528,8316=>528,8317=>288,8318=>288,8319=>456,8320=>438,8321=>438,8322=>438,8323=>438,8324=>438,8325=>438,8326=>438,8327=>438,8328=>438,8329=>438,8330=>528,8331=>528,8332=>528,8333=>288,8334=>288,8336=>458,8337=>479,8338=>488,8339=>413,8340=>479,8341=>456,8342=>487,8343=>219,8344=>664,8345=>456,8346=>479,8347=>381,8348=>388,8352=>929,8353=>696,8354=>696,8355=>696,8356=>696,8357=>1042,8358=>837,8359=>1518,8360=>1205,8361=>1103,8362=>904,8363=>696,8364=>696,8365=>696,8366=>696,8367=>1392,8368=>696,8369=>696,8370=>696,8371=>696,8372=>859,8373=>696,8376=>696,8377=>696,8378=>769,8400=>0,8401=>0,8406=>0,8407=>0,8411=>0,8412=>0,8417=>0,8448=>1120,8449=>1170,8450=>734,8451=>1211,8452=>896,8453=>1091,8454=>1144,8455=>614,8456=>698,8457=>1086,8459=>1073,8460=>913,8461=>888,8462=>712,8463=>712,8464=>597,8465=>697,8466=>856,8467=>472,8468=>974,8469=>837,8470=>1203,8471=>1000,8472=>697,8473=>750,8474=>850,8475=>938,8476=>814,8477=>801,8478=>896,8479=>710,8480=>1020,8481=>1281,8482=>1000,8483=>755,8484=>754,8485=>578,8486=>850,8487=>850,8488=>763,8489=>338,8490=>775,8491=>774,8492=>928,8493=>818,8494=>854,8495=>636,8496=>729,8497=>808,8498=>683,8499=>1184,8500=>465,8501=>794,8502=>731,8503=>494,8504=>684,8505=>380,8506=>945,8507=>1348,8508=>790,8509=>737,8510=>654,8511=>863,8512=>840,8513=>775,8514=>557,8515=>637,8516=>760,8517=>830,8518=>716,8519=>678,8520=>343,8521=>343,8523=>872,8526=>547,8528=>1035,8529=>1035,8530=>1483,8531=>1035,8532=>1035,8533=>1035,8534=>1035,8535=>1035,8536=>1035,8537=>1035,8538=>1035,8539=>1035,8540=>1035,8541=>1035,8542=>1035,8543=>615,8544=>372,8545=>659,8546=>945,8547=>1099,8548=>774,8549=>1099,8550=>1386,8551=>1672,8552=>1121,8553=>771,8554=>1120,8555=>1407,8556=>637,8557=>734,8558=>830,8559=>995,8560=>343,8561=>607,8562=>872,8563=>984,8564=>652,8565=>962,8566=>1227,8567=>1491,8568=>969,8569=>645,8570=>969,8571=>1233,8572=>343,8573=>593,8574=>716,8575=>1042,8576=>1289,8577=>830,8578=>1289,8579=>734,8580=>593,8581=>734,8585=>1035,8592=>838,8593=>838,8594=>838,8595=>838,8596=>838,8597=>838,8598=>838,8599=>838,8600=>838,8601=>838,8602=>838,8603=>838,8604=>838,8605=>838,8606=>838,8607=>838,8608=>838,8609=>838,8610=>838,8611=>838,8612=>838,8613=>838,8614=>838,8615=>838,8616=>838,8617=>838,8618=>838,8619=>838,8620=>838,8621=>838,8622=>838,8623=>838,8624=>838,8625=>838,8626=>838,8627=>838,8628=>838,8629=>838,8630=>838,8631=>838,8632=>838,8633=>838,8634=>838,8635=>838,8636=>838,8637=>838,8638=>838,8639=>838,8640=>838,8641=>838,8642=>838,8643=>838,8644=>838,8645=>838,8646=>838,8647=>838,8648=>838,8649=>838,8650=>838,8651=>838,8652=>838,8653=>838,8654=>838,8655=>838,8656=>838,8657=>838,8658=>838,8659=>838,8660=>838,8661=>838,8662=>838,8663=>838,8664=>838,8665=>838,8666=>838,8667=>838,8668=>838,8669=>838,8670=>838,8671=>838,8672=>838,8673=>838,8674=>838,8675=>838,8676=>838,8677=>838,8678=>838,8679=>838,8680=>838,8681=>838,8682=>838,8683=>838,8684=>838,8685=>838,8686=>838,8687=>838,8688=>838,8689=>838,8690=>838,8691=>838,8692=>838,8693=>838,8694=>838,8695=>838,8696=>838,8697=>838,8698=>838,8699=>838,8700=>838,8701=>838,8702=>838,8703=>838,8704=>774,8705=>696,8706=>544,8707=>683,8708=>683,8709=>856,8710=>697,8711=>697,8712=>896,8713=>896,8714=>750,8715=>896,8716=>896,8717=>750,8718=>636,8719=>787,8720=>787,8721=>718,8722=>838,8723=>838,8724=>696,8725=>365,8726=>696,8727=>838,8728=>626,8729=>380,8730=>667,8731=>667,8732=>667,8733=>712,8734=>833,8735=>838,8736=>896,8737=>896,8738=>838,8739=>500,8740=>500,8741=>500,8742=>500,8743=>812,8744=>812,8745=>812,8746=>812,8747=>610,8748=>929,8749=>1295,8750=>563,8751=>977,8752=>1313,8753=>563,8754=>563,8755=>563,8756=>696,8757=>696,8758=>294,8759=>696,8760=>838,8761=>838,8762=>838,8763=>838,8764=>838,8765=>838,8766=>838,8767=>838,8768=>375,8769=>838,8770=>838,8771=>838,8772=>838,8773=>838,8774=>838,8775=>838,8776=>838,8777=>838,8778=>838,8779=>838,8780=>838,8781=>838,8782=>838,8783=>838,8784=>838,8785=>838,8786=>838,8787=>838,8788=>1063,8789=>1063,8790=>838,8791=>838,8792=>838,8793=>838,8794=>838,8795=>838,8796=>838,8797=>838,8798=>838,8799=>838,8800=>838,8801=>838,8802=>838,8803=>838,8804=>838,8805=>838,8806=>838,8807=>838,8808=>841,8809=>841,8810=>1047,8811=>1047,8812=>500,8813=>838,8814=>838,8815=>838,8816=>838,8817=>838,8818=>838,8819=>838,8820=>838,8821=>838,8822=>838,8823=>838,8824=>838,8825=>838,8826=>838,8827=>838,8828=>838,8829=>838,8830=>838,8831=>838,8832=>838,8833=>838,8834=>838,8835=>838,8836=>838,8837=>838,8838=>838,8839=>838,8840=>838,8841=>838,8842=>838,8843=>838,8844=>812,8845=>812,8846=>812,8847=>838,8848=>838,8849=>838,8850=>838,8851=>796,8852=>796,8853=>838,8854=>838,8855=>838,8856=>838,8857=>838,8858=>838,8859=>838,8860=>838,8861=>838,8862=>838,8863=>838,8864=>838,8865=>838,8866=>914,8867=>914,8868=>914,8869=>914,8870=>542,8871=>542,8872=>914,8873=>914,8874=>914,8875=>914,8876=>914,8877=>914,8878=>914,8879=>914,8880=>838,8881=>838,8882=>838,8883=>838,8884=>838,8885=>838,8886=>1000,8887=>1000,8888=>838,8889=>838,8890=>542,8891=>812,8892=>812,8893=>812,8894=>838,8895=>838,8896=>843,8897=>843,8898=>843,8899=>843,8900=>494,8901=>380,8902=>626,8903=>838,8904=>1000,8905=>1000,8906=>1000,8907=>1000,8908=>1000,8909=>838,8910=>812,8911=>812,8912=>838,8913=>838,8914=>838,8915=>838,8916=>838,8917=>838,8918=>838,8919=>838,8920=>1422,8921=>1422,8922=>838,8923=>838,8924=>838,8925=>838,8926=>838,8927=>838,8928=>838,8929=>838,8930=>838,8931=>838,8932=>838,8933=>838,8934=>838,8935=>838,8936=>838,8937=>838,8938=>838,8939=>838,8940=>838,8941=>838,8942=>1000,8943=>1000,8944=>1000,8945=>1000,8946=>1158,8947=>896,8948=>750,8949=>896,8950=>896,8951=>750,8952=>896,8953=>896,8954=>1158,8955=>896,8956=>750,8957=>896,8958=>750,8959=>896,8960=>602,8961=>602,8962=>716,8963=>838,8964=>838,8965=>838,8966=>838,8967=>488,8968=>457,8969=>457,8970=>457,8971=>457,8972=>809,8973=>809,8974=>809,8975=>809,8976=>838,8977=>539,8984=>928,8985=>838,8988=>469,8989=>469,8990=>469,8991=>469,8992=>610,8993=>610,8996=>1152,8997=>1152,8998=>1414,8999=>1152,9000=>1443,9003=>1414,9004=>873,9075=>390,9076=>716,9077=>869,9082=>687,9085=>863,9095=>1152,9108=>873,9115=>500,9116=>500,9117=>500,9118=>500,9119=>500,9120=>500,9121=>500,9122=>500,9123=>500,9124=>500,9125=>500,9126=>500,9127=>750,9128=>750,9129=>750,9130=>750,9131=>750,9132=>750,9133=>750,9134=>610,9166=>838,9167=>945,9187=>873,9189=>769,9192=>696,9250=>716,9251=>716,9312=>847,9313=>847,9314=>847,9315=>847,9316=>847,9317=>847,9318=>847,9319=>847,9320=>847,9321=>847,9600=>769,9601=>769,9602=>769,9603=>769,9604=>769,9605=>769,9606=>769,9607=>769,9608=>769,9609=>769,9610=>769,9611=>769,9612=>769,9613=>769,9614=>769,9615=>769,9616=>769,9617=>769,9618=>769,9619=>769,9620=>769,9621=>769,9622=>769,9623=>769,9624=>769,9625=>769,9626=>769,9627=>769,9628=>769,9629=>769,9630=>769,9631=>769,9632=>945,9633=>945,9634=>945,9635=>945,9636=>945,9637=>945,9638=>945,9639=>945,9640=>945,9641=>945,9642=>678,9643=>678,9644=>945,9645=>945,9646=>550,9647=>550,9648=>769,9649=>769,9650=>769,9651=>769,9652=>502,9653=>502,9654=>769,9655=>769,9656=>502,9657=>502,9658=>769,9659=>769,9660=>769,9661=>769,9662=>502,9663=>502,9664=>769,9665=>769,9666=>502,9667=>502,9668=>769,9669=>769,9670=>769,9671=>769,9672=>769,9673=>873,9674=>494,9675=>873,9676=>873,9677=>873,9678=>873,9679=>873,9680=>873,9681=>873,9682=>873,9683=>873,9684=>873,9685=>873,9686=>527,9687=>527,9688=>840,9689=>970,9690=>970,9691=>970,9692=>387,9693=>387,9694=>387,9695=>387,9696=>769,9697=>769,9698=>769,9699=>769,9700=>769,9701=>769,9702=>639,9703=>945,9704=>945,9705=>945,9706=>945,9707=>945,9708=>769,9709=>769,9710=>769,9711=>1119,9712=>945,9713=>945,9714=>945,9715=>945,9716=>873,9717=>873,9718=>873,9719=>873,9720=>769,9721=>769,9722=>769,9723=>830,9724=>830,9725=>732,9726=>732,9727=>769,9728=>896,9729=>1000,9730=>896,9731=>896,9732=>896,9733=>896,9734=>896,9735=>573,9736=>896,9737=>896,9738=>888,9739=>888,9740=>671,9741=>1013,9742=>1246,9743=>1250,9744=>896,9745=>896,9746=>896,9747=>532,9748=>896,9749=>896,9750=>896,9751=>896,9752=>896,9753=>896,9754=>896,9755=>896,9756=>896,9757=>609,9758=>896,9759=>609,9760=>896,9761=>896,9762=>896,9763=>896,9764=>669,9765=>746,9766=>649,9767=>784,9768=>545,9769=>896,9770=>896,9771=>896,9772=>710,9773=>896,9774=>896,9775=>896,9776=>896,9777=>896,9778=>896,9779=>896,9780=>896,9781=>896,9782=>896,9783=>896,9784=>896,9785=>1042,9786=>1042,9787=>1042,9788=>896,9789=>896,9790=>896,9791=>614,9792=>732,9793=>732,9794=>896,9795=>896,9796=>896,9797=>896,9798=>896,9799=>896,9800=>896,9801=>896,9802=>896,9803=>896,9804=>896,9805=>896,9806=>896,9807=>896,9808=>896,9809=>896,9810=>896,9811=>896,9812=>896,9813=>896,9814=>896,9815=>896,9816=>896,9817=>896,9818=>896,9819=>896,9820=>896,9821=>896,9822=>896,9823=>896,9824=>896,9825=>896,9826=>896,9827=>896,9828=>896,9829=>896,9830=>896,9831=>896,9832=>896,9833=>472,9834=>638,9835=>896,9836=>896,9837=>472,9838=>357,9839=>484,9840=>748,9841=>766,9842=>896,9843=>896,9844=>896,9845=>896,9846=>896,9847=>896,9848=>896,9849=>896,9850=>896,9851=>896,9852=>896,9853=>896,9854=>896,9855=>896,9856=>869,9857=>869,9858=>869,9859=>869,9860=>869,9861=>869,9862=>896,9863=>896,9864=>896,9865=>896,9866=>896,9867=>896,9868=>896,9869=>896,9870=>896,9871=>896,9872=>896,9873=>896,9874=>896,9875=>896,9876=>896,9877=>541,9878=>896,9879=>896,9880=>896,9881=>896,9882=>896,9883=>896,9884=>896,9888=>896,9889=>702,9890=>1004,9891=>1089,9892=>1175,9893=>903,9894=>838,9895=>838,9896=>838,9897=>838,9898=>838,9899=>838,9900=>838,9901=>838,9902=>838,9903=>838,9904=>844,9905=>838,9906=>732,9907=>732,9908=>732,9909=>732,9910=>850,9911=>732,9912=>732,9920=>838,9921=>838,9922=>838,9923=>838,9954=>732,9985=>838,9986=>838,9987=>838,9988=>838,9990=>838,9991=>838,9992=>838,9993=>838,9996=>838,9997=>838,9998=>838,9999=>838,10000=>838,10001=>838,10002=>838,10003=>838,10004=>838,10005=>838,10006=>838,10007=>838,10008=>838,10009=>838,10010=>838,10011=>838,10012=>838,10013=>838,10014=>838,10015=>838,10016=>838,10017=>838,10018=>838,10019=>838,10020=>838,10021=>838,10022=>838,10023=>838,10025=>838,10026=>838,10027=>838,10028=>838,10029=>838,10030=>838,10031=>838,10032=>838,10033=>838,10034=>838,10035=>838,10036=>838,10037=>838,10038=>838,10039=>838,10040=>838,10041=>838,10042=>838,10043=>838,10044=>838,10045=>838,10046=>838,10047=>838,10048=>838,10049=>838,10050=>838,10051=>838,10052=>838,10053=>838,10054=>838,10055=>838,10056=>838,10057=>838,10058=>838,10059=>838,10061=>896,10063=>896,10064=>896,10065=>896,10066=>896,10070=>896,10072=>838,10073=>838,10074=>838,10075=>347,10076=>347,10077=>587,10078=>587,10081=>838,10082=>838,10083=>838,10084=>838,10085=>838,10086=>838,10087=>838,10088=>838,10089=>838,10090=>838,10091=>838,10092=>838,10093=>838,10094=>838,10095=>838,10096=>838,10097=>838,10098=>838,10099=>838,10100=>838,10101=>838,10102=>847,10103=>847,10104=>847,10105=>847,10106=>847,10107=>847,10108=>847,10109=>847,10110=>847,10111=>847,10112=>838,10113=>838,10114=>838,10115=>838,10116=>838,10117=>838,10118=>838,10119=>838,10120=>838,10121=>838,10122=>838,10123=>838,10124=>838,10125=>838,10126=>838,10127=>838,10128=>838,10129=>838,10130=>838,10131=>838,10132=>838,10136=>838,10137=>838,10138=>838,10139=>838,10140=>838,10141=>838,10142=>838,10143=>838,10144=>838,10145=>838,10146=>838,10147=>838,10148=>838,10149=>838,10150=>838,10151=>838,10152=>838,10153=>838,10154=>838,10155=>838,10156=>838,10157=>838,10158=>838,10159=>838,10161=>838,10162=>838,10163=>838,10164=>838,10165=>838,10166=>838,10167=>838,10168=>838,10169=>838,10170=>838,10171=>838,10172=>838,10173=>838,10174=>838,10181=>457,10182=>457,10208=>494,10214=>487,10215=>487,10216=>457,10217=>457,10218=>721,10219=>721,10224=>838,10225=>838,10226=>838,10227=>838,10228=>1157,10229=>1434,10230=>1434,10231=>1434,10232=>1434,10233=>1434,10234=>1434,10235=>1434,10236=>1434,10237=>1434,10238=>1434,10239=>1434,10240=>781,10241=>781,10242=>781,10243=>781,10244=>781,10245=>781,10246=>781,10247=>781,10248=>781,10249=>781,10250=>781,10251=>781,10252=>781,10253=>781,10254=>781,10255=>781,10256=>781,10257=>781,10258=>781,10259=>781,10260=>781,10261=>781,10262=>781,10263=>781,10264=>781,10265=>781,10266=>781,10267=>781,10268=>781,10269=>781,10270=>781,10271=>781,10272=>781,10273=>781,10274=>781,10275=>781,10276=>781,10277=>781,10278=>781,10279=>781,10280=>781,10281=>781,10282=>781,10283=>781,10284=>781,10285=>781,10286=>781,10287=>781,10288=>781,10289=>781,10290=>781,10291=>781,10292=>781,10293=>781,10294=>781,10295=>781,10296=>781,10297=>781,10298=>781,10299=>781,10300=>781,10301=>781,10302=>781,10303=>781,10304=>781,10305=>781,10306=>781,10307=>781,10308=>781,10309=>781,10310=>781,10311=>781,10312=>781,10313=>781,10314=>781,10315=>781,10316=>781,10317=>781,10318=>781,10319=>781,10320=>781,10321=>781,10322=>781,10323=>781,10324=>781,10325=>781,10326=>781,10327=>781,10328=>781,10329=>781,10330=>781,10331=>781,10332=>781,10333=>781,10334=>781,10335=>781,10336=>781,10337=>781,10338=>781,10339=>781,10340=>781,10341=>781,10342=>781,10343=>781,10344=>781,10345=>781,10346=>781,10347=>781,10348=>781,10349=>781,10350=>781,10351=>781,10352=>781,10353=>781,10354=>781,10355=>781,10356=>781,10357=>781,10358=>781,10359=>781,10360=>781,10361=>781,10362=>781,10363=>781,10364=>781,10365=>781,10366=>781,10367=>781,10368=>781,10369=>781,10370=>781,10371=>781,10372=>781,10373=>781,10374=>781,10375=>781,10376=>781,10377=>781,10378=>781,10379=>781,10380=>781,10381=>781,10382=>781,10383=>781,10384=>781,10385=>781,10386=>781,10387=>781,10388=>781,10389=>781,10390=>781,10391=>781,10392=>781,10393=>781,10394=>781,10395=>781,10396=>781,10397=>781,10398=>781,10399=>781,10400=>781,10401=>781,10402=>781,10403=>781,10404=>781,10405=>781,10406=>781,10407=>781,10408=>781,10409=>781,10410=>781,10411=>781,10412=>781,10413=>781,10414=>781,10415=>781,10416=>781,10417=>781,10418=>781,10419=>781,10420=>781,10421=>781,10422=>781,10423=>781,10424=>781,10425=>781,10426=>781,10427=>781,10428=>781,10429=>781,10430=>781,10431=>781,10432=>781,10433=>781,10434=>781,10435=>781,10436=>781,10437=>781,10438=>781,10439=>781,10440=>781,10441=>781,10442=>781,10443=>781,10444=>781,10445=>781,10446=>781,10447=>781,10448=>781,10449=>781,10450=>781,10451=>781,10452=>781,10453=>781,10454=>781,10455=>781,10456=>781,10457=>781,10458=>781,10459=>781,10460=>781,10461=>781,10462=>781,10463=>781,10464=>781,10465=>781,10466=>781,10467=>781,10468=>781,10469=>781,10470=>781,10471=>781,10472=>781,10473=>781,10474=>781,10475=>781,10476=>781,10477=>781,10478=>781,10479=>781,10480=>781,10481=>781,10482=>781,10483=>781,10484=>781,10485=>781,10486=>781,10487=>781,10488=>781,10489=>781,10490=>781,10491=>781,10492=>781,10493=>781,10494=>781,10495=>781,10502=>838,10503=>838,10506=>838,10507=>838,10560=>838,10561=>838,10627=>753,10628=>753,10702=>838,10703=>1046,10704=>1046,10705=>1000,10706=>1000,10707=>1000,10708=>1000,10709=>1000,10731=>494,10746=>838,10747=>838,10752=>1000,10753=>1000,10754=>1000,10764=>1661,10765=>563,10766=>563,10767=>563,10768=>563,10769=>563,10770=>563,10771=>563,10772=>563,10773=>563,10774=>563,10775=>563,10776=>563,10777=>563,10778=>563,10779=>563,10780=>563,10799=>838,10858=>838,10859=>838,10877=>838,10878=>838,10879=>838,10880=>838,10881=>838,10882=>838,10883=>838,10884=>838,10885=>838,10886=>838,10887=>838,10888=>838,10889=>838,10890=>838,10891=>838,10892=>838,10893=>838,10894=>838,10895=>838,10896=>838,10897=>838,10898=>838,10899=>838,10900=>838,10901=>838,10902=>838,10903=>838,10904=>838,10905=>838,10906=>838,10907=>838,10908=>838,10909=>838,10910=>838,10911=>838,10912=>838,10926=>838,10927=>838,10928=>838,10929=>838,10930=>838,10931=>838,10932=>838,10933=>838,10934=>838,10935=>838,10936=>838,10937=>838,10938=>838,11001=>838,11002=>838,11008=>838,11009=>838,11010=>838,11011=>838,11012=>838,11013=>838,11014=>838,11015=>838,11016=>838,11017=>838,11018=>838,11019=>838,11020=>838,11021=>838,11022=>838,11023=>838,11024=>838,11025=>838,11026=>945,11027=>945,11028=>945,11029=>945,11030=>769,11031=>769,11032=>769,11033=>769,11034=>945,11039=>869,11040=>869,11041=>873,11042=>873,11043=>873,11044=>1119,11091=>869,11092=>869,11360=>637,11361=>360,11362=>637,11363=>733,11364=>770,11365=>675,11366=>478,11367=>956,11368=>712,11369=>775,11370=>665,11371=>725,11372=>582,11373=>860,11374=>995,11375=>774,11376=>860,11377=>778,11378=>1221,11379=>1056,11380=>652,11381=>698,11382=>565,11383=>782,11385=>538,11386=>687,11387=>559,11388=>219,11389=>487,11390=>720,11391=>725,11520=>663,11521=>676,11522=>661,11523=>629,11524=>661,11525=>1032,11526=>718,11527=>1032,11528=>648,11529=>667,11530=>1032,11531=>673,11532=>677,11533=>1036,11534=>680,11535=>886,11536=>1032,11537=>683,11538=>674,11539=>1035,11540=>1033,11541=>1027,11542=>676,11543=>673,11544=>667,11545=>667,11546=>660,11547=>671,11548=>1039,11549=>673,11550=>692,11551=>659,11552=>1048,11553=>660,11554=>654,11555=>670,11556=>733,11557=>1017,11568=>691,11569=>941,11570=>941,11571=>725,11572=>725,11573=>725,11574=>676,11575=>774,11576=>774,11577=>683,11578=>683,11579=>802,11580=>989,11581=>761,11582=>623,11583=>761,11584=>941,11585=>941,11586=>373,11587=>740,11588=>837,11589=>914,11590=>672,11591=>737,11592=>680,11593=>683,11594=>602,11595=>1039,11596=>778,11597=>837,11598=>683,11599=>372,11600=>778,11601=>373,11602=>725,11603=>691,11604=>941,11605=>941,11606=>837,11607=>373,11608=>836,11609=>941,11610=>941,11611=>734,11612=>876,11613=>771,11614=>734,11615=>683,11616=>774,11617=>837,11618=>683,11619=>850,11620=>697,11621=>850,11631=>716,11800=>580,11807=>838,11810=>457,11811=>457,11812=>457,11813=>457,11822=>580,19904=>896,19905=>896,19906=>896,19907=>896,19908=>896,19909=>896,19910=>896,19911=>896,19912=>896,19913=>896,19914=>896,19915=>896,19916=>896,19917=>896,19918=>896,19919=>896,19920=>896,19921=>896,19922=>896,19923=>896,19924=>896,19925=>896,19926=>896,19927=>896,19928=>896,19929=>896,19930=>896,19931=>896,19932=>896,19933=>896,19934=>896,19935=>896,19936=>896,19937=>896,19938=>896,19939=>896,19940=>896,19941=>896,19942=>896,19943=>896,19944=>896,19945=>896,19946=>896,19947=>896,19948=>896,19949=>896,19950=>896,19951=>896,19952=>896,19953=>896,19954=>896,19955=>896,19956=>896,19957=>896,19958=>896,19959=>896,19960=>896,19961=>896,19962=>896,19963=>896,19964=>896,19965=>896,19966=>896,19967=>896,42192=>762,42193=>733,42194=>733,42195=>830,42196=>682,42197=>682,42198=>821,42199=>775,42200=>775,42201=>530,42202=>734,42203=>734,42204=>725,42205=>683,42206=>683,42207=>995,42208=>837,42209=>637,42210=>720,42211=>770,42212=>770,42213=>774,42214=>774,42215=>837,42216=>775,42217=>530,42218=>1103,42219=>771,42220=>724,42221=>762,42222=>774,42223=>774,42224=>683,42225=>683,42226=>372,42227=>850,42228=>812,42229=>812,42230=>557,42231=>830,42232=>322,42233=>322,42234=>674,42235=>674,42236=>322,42237=>322,42238=>588,42239=>588,42564=>720,42565=>595,42566=>436,42567=>440,42572=>1405,42573=>1173,42576=>1234,42577=>1027,42580=>1174,42581=>972,42582=>1093,42583=>958,42594=>1085,42595=>924,42596=>1096,42597=>912,42598=>1260,42599=>997,42600=>850,42601=>687,42602=>1037,42603=>868,42604=>1406,42605=>1106,42606=>961,42634=>963,42635=>787,42636=>682,42637=>580,42644=>808,42645=>712,42760=>500,42761=>500,42762=>500,42763=>500,42764=>500,42765=>500,42766=>500,42767=>500,42768=>500,42769=>500,42770=>500,42771=>500,42772=>500,42773=>500,42774=>500,42779=>400,42780=>400,42781=>287,42782=>287,42783=>287,42786=>444,42787=>390,42788=>540,42789=>540,42790=>837,42791=>712,42792=>1031,42793=>857,42794=>696,42795=>557,42800=>559,42801=>595,42802=>1349,42803=>1052,42804=>1284,42805=>1064,42806=>1216,42807=>1054,42808=>1079,42809=>922,42810=>1079,42811=>922,42812=>1035,42813=>922,42814=>698,42815=>549,42816=>656,42817=>688,42822=>850,42823=>542,42824=>683,42825=>531,42826=>918,42827=>814,42830=>1406,42831=>1106,42832=>733,42833=>716,42834=>948,42835=>937,42838=>850,42839=>716,42852=>738,42853=>716,42854=>738,42855=>716,42880=>637,42881=>343,42882=>837,42883=>712,42889=>400,42890=>386,42891=>456,42892=>306,42893=>808,42894=>693,42896=>928,42897=>768,42912=>821,42913=>716,42914=>775,42915=>665,42916=>837,42917=>712,42918=>770,42919=>493,42920=>720,42921=>595,42922=>886,43002=>1062,43003=>683,43004=>733,43005=>995,43006=>372,43007=>1325,61184=>216,61185=>242,61186=>267,61187=>277,61188=>282,61189=>242,61190=>216,61191=>242,61192=>267,61193=>277,61194=>267,61195=>242,61196=>216,61197=>242,61198=>267,61199=>277,61200=>267,61201=>242,61202=>216,61203=>242,61204=>282,61205=>277,61206=>267,61207=>242,61208=>216,61209=>282,62464=>612,62465=>612,62466=>653,62467=>902,62468=>622,62469=>622,62470=>661,62471=>895,62472=>589,62473=>622,62474=>1163,62475=>626,62476=>627,62477=>893,62478=>612,62479=>626,62480=>924,62481=>627,62482=>744,62483=>634,62484=>886,62485=>626,62486=>907,62487=>626,62488=>621,62489=>628,62490=>677,62491=>626,62492=>621,62493=>630,62494=>627,62495=>571,62496=>622,62497=>631,62498=>612,62499=>611,62500=>618,62501=>671,62502=>963,62504=>1023,62505=>844,62506=>563,62507=>563,62508=>563,62509=>563,62510=>563,62511=>563,62512=>555,62513=>555,62514=>555,62515=>555,62516=>573,62517=>573,62518=>573,62519=>824,62520=>824,62521=>824,62522=>824,62523=>824,62524=>611,62525=>611,62526=>611,62527=>611,62528=>611,62529=>611,63173=>687,64256=>810,64257=>741,64258=>741,64259=>1115,64260=>1116,64261=>808,64262=>1020,64275=>1388,64276=>1384,64277=>1378,64278=>1384,64279=>1713,64285=>294,64286=>0,64287=>519,64288=>665,64289=>939,64290=>788,64291=>920,64292=>786,64293=>857,64294=>869,64295=>821,64296=>890,64297=>838,64298=>758,64299=>758,64300=>758,64301=>758,64302=>728,64303=>728,64304=>728,64305=>610,64306=>447,64307=>588,64308=>687,64309=>437,64310=>485,64312=>679,64313=>435,64314=>578,64315=>566,64316=>605,64318=>724,64320=>453,64321=>680,64323=>675,64324=>658,64326=>653,64327=>736,64328=>602,64329=>758,64330=>683,64331=>343,64332=>610,64333=>566,64334=>658,64335=>710,64338=>1005,64339=>1059,64340=>375,64341=>408,64342=>1005,64343=>1059,64344=>375,64345=>408,64346=>1005,64347=>1059,64348=>375,64349=>408,64350=>1005,64351=>1059,64352=>375,64353=>408,64354=>1005,64355=>1059,64356=>375,64357=>408,64358=>1005,64359=>1059,64360=>375,64361=>408,64362=>1162,64363=>1191,64364=>655,64365=>720,64366=>1162,64367=>1191,64368=>655,64369=>720,64370=>721,64371=>721,64372=>721,64373=>721,64374=>721,64375=>721,64376=>721,64377=>721,64378=>721,64379=>721,64380=>721,64381=>721,64382=>721,64383=>721,64384=>721,64385=>721,64386=>513,64387=>578,64388=>513,64389=>578,64390=>513,64391=>578,64392=>513,64393=>578,64394=>576,64395=>622,64396=>576,64397=>622,64398=>1024,64399=>1024,64400=>582,64401=>582,64402=>1024,64403=>1024,64404=>582,64405=>582,64406=>1024,64407=>1024,64408=>582,64409=>582,64410=>1024,64411=>1024,64412=>582,64413=>582,64414=>854,64415=>900,64416=>854,64417=>900,64418=>375,64419=>408,64426=>938,64427=>880,64428=>693,64429=>660,64467=>824,64468=>843,64469=>476,64470=>552,64473=>622,64474=>627,64488=>375,64489=>408,64508=>917,64509=>1012,64510=>375,64511=>408,65024=>0,65025=>0,65026=>0,65027=>0,65028=>0,65029=>0,65030=>0,65031=>0,65032=>0,65033=>0,65034=>0,65035=>0,65036=>0,65037=>0,65038=>0,65039=>0,65056=>0,65057=>0,65058=>0,65059=>0,65136=>342,65137=>342,65138=>342,65139=>346,65140=>342,65142=>342,65143=>342,65144=>342,65145=>342,65146=>342,65147=>342,65148=>342,65149=>342,65150=>342,65151=>342,65152=>511,65153=>343,65154=>375,65155=>343,65156=>375,65157=>622,65158=>627,65159=>343,65160=>375,65161=>917,65162=>917,65163=>375,65164=>408,65165=>343,65166=>375,65167=>1005,65168=>1059,65169=>375,65170=>408,65171=>590,65172=>606,65173=>1005,65174=>1059,65175=>375,65176=>408,65177=>1005,65178=>1059,65179=>375,65180=>408,65181=>721,65182=>721,65183=>721,65184=>721,65185=>721,65186=>721,65187=>721,65188=>721,65189=>721,65190=>721,65191=>721,65192=>721,65193=>513,65194=>578,65195=>513,65196=>578,65197=>576,65198=>622,65199=>576,65200=>622,65201=>1380,65202=>1414,65203=>983,65204=>1018,65205=>1380,65206=>1414,65207=>983,65208=>1018,65209=>1345,65210=>1364,65211=>966,65212=>985,65213=>1345,65214=>1364,65215=>966,65216=>985,65217=>1039,65218=>1071,65219=>942,65220=>974,65221=>1039,65222=>1071,65223=>942,65224=>974,65225=>683,65226=>683,65227=>683,65228=>564,65229=>683,65230=>683,65231=>683,65232=>564,65233=>1162,65234=>1191,65235=>655,65236=>720,65237=>894,65238=>901,65239=>655,65240=>720,65241=>917,65242=>931,65243=>582,65244=>582,65245=>868,65246=>893,65247=>375,65248=>408,65249=>733,65250=>784,65251=>619,65252=>670,65253=>854,65254=>900,65255=>375,65256=>408,65257=>590,65258=>606,65259=>693,65260=>660,65261=>622,65262=>627,65263=>917,65264=>1012,65265=>917,65266=>1012,65267=>375,65268=>408,65269=>745,65270=>759,65271=>745,65272=>759,65273=>745,65274=>759,65275=>745,65276=>759,65279=>0,65529=>0,65530=>0,65531=>0,65532=>0,65533=>1113,65535=>600); +// --- EOF --- diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.z b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.z new file mode 100755 index 0000000..07031ce Binary files /dev/null and b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/dejavusansb.z differ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/helvetica.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/helvetica.php new file mode 100755 index 0000000..d1aa6d8 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/fonts/helvetica.php @@ -0,0 +1,13 @@ +32,'FontBBox'=>'[-166 -225 1000 931]','ItalicAngle'=>0,'Ascent'=>931,'Descent'=>-225,'Leading'=>0,'CapHeight'=>718,'XHeight'=>523,'StemV'=>88,'StemH'=>76,'AvgWidth'=>513,'MaxWidth'=>1015,'MissingWidth'=>513); +$cw=array(0=>500,1=>500,2=>500,3=>500,4=>500,5=>500,6=>500,7=>500,8=>500,9=>500,10=>500,11=>500,12=>500,13=>500,14=>500,15=>500,16=>500,17=>500,18=>500,19=>500,20=>500,21=>500,22=>500,23=>500,24=>500,25=>500,26=>500,27=>500,28=>500,29=>500,30=>500,31=>500,32=>278,33=>278,34=>355,35=>556,36=>556,37=>889,38=>667,39=>191,40=>333,41=>333,42=>389,43=>584,44=>278,45=>333,46=>278,47=>278,48=>556,49=>556,50=>556,51=>556,52=>556,53=>556,54=>556,55=>556,56=>556,57=>556,58=>278,59=>278,60=>584,61=>584,62=>584,63=>556,64=>1015,65=>667,66=>667,67=>722,68=>722,69=>667,70=>611,71=>778,72=>722,73=>278,74=>500,75=>667,76=>556,77=>833,78=>722,79=>778,80=>667,81=>778,82=>722,83=>667,84=>611,85=>722,86=>667,87=>944,88=>667,89=>667,90=>611,91=>278,92=>278,93=>277,94=>469,95=>556,96=>333,97=>556,98=>556,99=>500,100=>556,101=>556,102=>278,103=>556,104=>556,105=>222,106=>222,107=>500,108=>222,109=>833,110=>556,111=>556,112=>556,113=>556,114=>333,115=>500,116=>278,117=>556,118=>500,119=>722,120=>500,121=>500,122=>500,123=>334,124=>260,125=>334,126=>584,127=>500,128=>655,129=>500,130=>222,131=>278,132=>333,133=>1000,134=>556,135=>556,136=>333,137=>1000,138=>667,139=>250,140=>1000,141=>500,142=>611,143=>500,144=>500,145=>222,146=>221,147=>333,148=>333,149=>350,150=>556,151=>1000,152=>333,153=>1000,154=>500,155=>250,156=>938,157=>500,158=>500,159=>667,160=>278,161=>278,162=>556,163=>556,164=>556,165=>556,166=>260,167=>556,168=>333,169=>737,170=>370,171=>448,172=>584,173=>333,174=>737,175=>333,176=>606,177=>584,178=>350,179=>350,180=>333,181=>556,182=>537,183=>278,184=>333,185=>350,186=>365,187=>448,188=>869,189=>869,190=>879,191=>556,192=>667,193=>667,194=>667,195=>667,196=>667,197=>667,198=>1000,199=>722,200=>667,201=>667,202=>667,203=>667,204=>278,205=>278,206=>278,207=>278,208=>722,209=>722,210=>778,211=>778,212=>778,213=>778,214=>778,215=>584,216=>778,217=>722,218=>722,219=>722,220=>722,221=>667,222=>666,223=>611,224=>556,225=>556,226=>556,227=>556,228=>556,229=>556,230=>896,231=>500,232=>556,233=>556,234=>556,235=>556,236=>251,237=>251,238=>251,239=>251,240=>556,241=>556,242=>556,243=>556,244=>556,245=>556,246=>556,247=>584,248=>611,249=>556,250=>556,251=>556,252=>556,253=>500,254=>555,255=>500); + +// --- EOF --- diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/datamatrix.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/datamatrix.php new file mode 100755 index 0000000..d1cc6d2 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/datamatrix.php @@ -0,0 +1,1176 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// DESCRIPTION : +// +// Class to create DataMatrix ECC 200 barcode arrays for TCPDF class. +// DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code. +//============================================================+ + +/** +* @file +* Class to create DataMatrix ECC 200 barcode arrays for TCPDF class. +* DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code. +* +* @package com.tecnick.tcpdf +* @author Nicola Asuni +* @version 1.0.008 +*/ + +// custom definitions +if (!defined('DATAMATRIXDEFS')) { + + /** + * Indicate that definitions for this class are set + */ + define('DATAMATRIXDEFS', true); + + // ----------------------------------------------------- + +} // end of custom definitions + +// #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*# + + +/** +* ASCII encoding: ASCII character 0 to 127 (1 byte per CW) +*/ +define('ENC_ASCII', 0); + +/** +* C40 encoding: Upper-case alphanumeric (3/2 bytes per CW) +*/ +define('ENC_C40', 1); + +/** +* TEXT encoding: Lower-case alphanumeric (3/2 bytes per CW) +*/ +define('ENC_TXT', 2); + +/** +* X12 encoding: ANSI X12 (3/2 byte per CW) +*/ +define('ENC_X12', 3); + +/** +* EDIFACT encoding: ASCII character 32 to 94 (4/3 bytes per CW) +*/ +define('ENC_EDF', 4); + +/** +* BASE 256 encoding: ASCII character 0 to 255 (1 byte per CW) +*/ +define('ENC_BASE256', 5); + +/** +* ASCII extended encoding: ASCII character 128 to 255 (1/2 byte per CW) +*/ +define('ENC_ASCII_EXT', 6); + +/** +* ASCII number encoding: ASCII digits (2 bytes per CW) +*/ +define('ENC_ASCII_NUM', 7); + +/** +* @class Datamatrix +* Class to create DataMatrix ECC 200 barcode arrays for TCPDF class. +* DataMatrix (ISO/IEC 16022:2006) is a 2-dimensional bar code. +* +* @package com.tecnick.tcpdf +* @author Nicola Asuni +* @version 1.0.004 +*/ +class Datamatrix { + + /** + * Barcode array to be returned which is readable by TCPDF. + * @protected + */ + protected $barcode_array = array(); + + /** + * Store last used encoding for data codewords. + * @protected + */ + protected $last_enc = ENC_ASCII; + + /** + * Table of Data Matrix ECC 200 Symbol Attributes:
        + *
      • total matrix rows (including finder pattern)
      • + *
      • total matrix cols (including finder pattern)
      • + *
      • total matrix rows (without finder pattern)
      • + *
      • total matrix cols (without finder pattern)
      • + *
      • region data rows (with finder pattern)
      • + *
      • region data col (with finder pattern)
      • + *
      • region data rows (without finder pattern)
      • + *
      • region data col (without finder pattern)
      • + *
      • horizontal regions
      • + *
      • vertical regions
      • + *
      • regions
      • + *
      • data codewords
      • + *
      • error codewords
      • + *
      • blocks
      • + *
      • data codewords per block
      • + *
      • error codewords per block
      • + *
      + * @protected + */ + protected $symbattr = array( + // square form --------------------------------------------------------------------------------------- + array(0x00a,0x00a,0x008,0x008,0x00a,0x00a,0x008,0x008,0x001,0x001,0x001,0x003,0x005,0x001,0x003,0x005), // 10x10 + array(0x00c,0x00c,0x00a,0x00a,0x00c,0x00c,0x00a,0x00a,0x001,0x001,0x001,0x005,0x007,0x001,0x005,0x007), // 12x12 + array(0x00e,0x00e,0x00c,0x00c,0x00e,0x00e,0x00c,0x00c,0x001,0x001,0x001,0x008,0x00a,0x001,0x008,0x00a), // 14x14 + array(0x010,0x010,0x00e,0x00e,0x010,0x010,0x00e,0x00e,0x001,0x001,0x001,0x00c,0x00c,0x001,0x00c,0x00c), // 16x16 + array(0x012,0x012,0x010,0x010,0x012,0x012,0x010,0x010,0x001,0x001,0x001,0x012,0x00e,0x001,0x012,0x00e), // 18x18 + array(0x014,0x014,0x012,0x012,0x014,0x014,0x012,0x012,0x001,0x001,0x001,0x016,0x012,0x001,0x016,0x012), // 20x20 + array(0x016,0x016,0x014,0x014,0x016,0x016,0x014,0x014,0x001,0x001,0x001,0x01e,0x014,0x001,0x01e,0x014), // 22x22 + array(0x018,0x018,0x016,0x016,0x018,0x018,0x016,0x016,0x001,0x001,0x001,0x024,0x018,0x001,0x024,0x018), // 24x24 + array(0x01a,0x01a,0x018,0x018,0x01a,0x01a,0x018,0x018,0x001,0x001,0x001,0x02c,0x01c,0x001,0x02c,0x01c), // 26x26 + array(0x020,0x020,0x01c,0x01c,0x010,0x010,0x00e,0x00e,0x002,0x002,0x004,0x03e,0x024,0x001,0x03e,0x024), // 32x32 + array(0x024,0x024,0x020,0x020,0x012,0x012,0x010,0x010,0x002,0x002,0x004,0x056,0x02a,0x001,0x056,0x02a), // 36x36 + array(0x028,0x028,0x024,0x024,0x014,0x014,0x012,0x012,0x002,0x002,0x004,0x072,0x030,0x001,0x072,0x030), // 40x40 + array(0x02c,0x02c,0x028,0x028,0x016,0x016,0x014,0x014,0x002,0x002,0x004,0x090,0x038,0x001,0x090,0x038), // 44x44 + array(0x030,0x030,0x02c,0x02c,0x018,0x018,0x016,0x016,0x002,0x002,0x004,0x0ae,0x044,0x001,0x0ae,0x044), // 48x48 + array(0x034,0x034,0x030,0x030,0x01a,0x01a,0x018,0x018,0x002,0x002,0x004,0x0cc,0x054,0x002,0x066,0x02a), // 52x52 + array(0x040,0x040,0x038,0x038,0x010,0x010,0x00e,0x00e,0x004,0x004,0x010,0x118,0x070,0x002,0x08c,0x038), // 64x64 + array(0x048,0x048,0x040,0x040,0x012,0x012,0x010,0x010,0x004,0x004,0x010,0x170,0x090,0x004,0x05c,0x024), // 72x72 + array(0x050,0x050,0x048,0x048,0x014,0x014,0x012,0x012,0x004,0x004,0x010,0x1c8,0x0c0,0x004,0x072,0x030), // 80x80 + array(0x058,0x058,0x050,0x050,0x016,0x016,0x014,0x014,0x004,0x004,0x010,0x240,0x0e0,0x004,0x090,0x038), // 88x88 + array(0x060,0x060,0x058,0x058,0x018,0x018,0x016,0x016,0x004,0x004,0x010,0x2b8,0x110,0x004,0x0ae,0x044), // 96x96 + array(0x068,0x068,0x060,0x060,0x01a,0x01a,0x018,0x018,0x004,0x004,0x010,0x330,0x150,0x006,0x088,0x038), // 104x104 + array(0x078,0x078,0x06c,0x06c,0x014,0x014,0x012,0x012,0x006,0x006,0x024,0x41a,0x198,0x006,0x0af,0x044), // 120x120 + array(0x084,0x084,0x078,0x078,0x016,0x016,0x014,0x014,0x006,0x006,0x024,0x518,0x1f0,0x008,0x0a3,0x03e), // 132x132 + array(0x090,0x090,0x084,0x084,0x018,0x018,0x016,0x016,0x006,0x006,0x024,0x616,0x26c,0x00a,0x09c,0x03e), // 144x144 + // rectangular form (currently unused) --------------------------------------------------------------------------- + array(0x008,0x012,0x006,0x010,0x008,0x012,0x006,0x010,0x001,0x001,0x001,0x005,0x007,0x001,0x005,0x007), // 8x18 + array(0x008,0x020,0x006,0x01c,0x008,0x010,0x006,0x00e,0x001,0x002,0x002,0x00a,0x00b,0x001,0x00a,0x00b), // 8x32 + array(0x00c,0x01a,0x00a,0x018,0x00c,0x01a,0x00a,0x018,0x001,0x001,0x001,0x010,0x00e,0x001,0x010,0x00e), // 12x26 + array(0x00c,0x024,0x00a,0x020,0x00c,0x012,0x00a,0x010,0x001,0x002,0x002,0x00c,0x012,0x001,0x00c,0x012), // 12x36 + array(0x010,0x024,0x00e,0x020,0x010,0x012,0x00e,0x010,0x001,0x002,0x002,0x020,0x018,0x001,0x020,0x018), // 16x36 + array(0x010,0x030,0x00e,0x02c,0x010,0x018,0x00e,0x016,0x001,0x002,0x002,0x031,0x01c,0x001,0x031,0x01c) // 16x48 + ); + + /** + * Map encodation modes whit character sets. + * @protected + */ + protected $chset_id = array(ENC_C40 => 'C40', ENC_TXT => 'TXT', ENC_X12 =>'X12'); + + /** + * Basic set of characters for each encodation mode. + * @protected + */ + protected $chset = array( + 'C40' => array( // Basic set for C40 ---------------------------------------------------------------------------- + 'S1'=>0x00,'S2'=>0x01,'S3'=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, // + 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x41=>0x0e,0x42=>0x0f,0x43=>0x10,0x44=>0x11,0x45=>0x12,0x46=>0x13, // + 0x47=>0x14,0x48=>0x15,0x49=>0x16,0x4a=>0x17,0x4b=>0x18,0x4c=>0x19,0x4d=>0x1a,0x4e=>0x1b,0x4f=>0x1c,0x50=>0x1d, // + 0x51=>0x1e,0x52=>0x1f,0x53=>0x20,0x54=>0x21,0x55=>0x22,0x56=>0x23,0x57=>0x24,0x58=>0x25,0x59=>0x26,0x5a=>0x27),// + 'TXT' => array( // Basic set for TEXT --------------------------------------------------------------------------- + 'S1'=>0x00,'S2'=>0x01,'S3'=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, // + 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x61=>0x0e,0x62=>0x0f,0x63=>0x10,0x64=>0x11,0x65=>0x12,0x66=>0x13, // + 0x67=>0x14,0x68=>0x15,0x69=>0x16,0x6a=>0x17,0x6b=>0x18,0x6c=>0x19,0x6d=>0x1a,0x6e=>0x1b,0x6f=>0x1c,0x70=>0x1d, // + 0x71=>0x1e,0x72=>0x1f,0x73=>0x20,0x74=>0x21,0x75=>0x22,0x76=>0x23,0x77=>0x24,0x78=>0x25,0x79=>0x26,0x7a=>0x27),// + 'SH1' => array( // Shift 1 set ---------------------------------------------------------------------------------- + 0x00=>0x00,0x01=>0x01,0x02=>0x02,0x03=>0x03,0x04=>0x04,0x05=>0x05,0x06=>0x06,0x07=>0x07,0x08=>0x08,0x09=>0x09, // + 0x0a=>0x0a,0x0b=>0x0b,0x0c=>0x0c,0x0d=>0x0d,0x0e=>0x0e,0x0f=>0x0f,0x10=>0x10,0x11=>0x11,0x12=>0x12,0x13=>0x13, // + 0x14=>0x14,0x15=>0x15,0x16=>0x16,0x17=>0x17,0x18=>0x18,0x19=>0x19,0x1a=>0x1a,0x1b=>0x1b,0x1c=>0x1c,0x1d=>0x1d, // + 0x1e=>0x1e,0x1f=>0x1f), // + 'SH2' => array( // Shift 2 set ---------------------------------------------------------------------------------- + 0x21=>0x00,0x22=>0x01,0x23=>0x02,0x24=>0x03,0x25=>0x04,0x26=>0x05,0x27=>0x06,0x28=>0x07,0x29=>0x08,0x2a=>0x09, // + 0x2b=>0x0a,0x2c=>0x0b,0x2d=>0x0c,0x2e=>0x0d,0x2f=>0x0e,0x3a=>0x0f,0x3b=>0x10,0x3c=>0x11,0x3d=>0x12,0x3e=>0x13, // + 0x3f=>0x14,0x40=>0x15,0x5b=>0x16,0x5c=>0x17,0x5d=>0x18,0x5e=>0x19,0x5f=>0x1a,'F1'=>0x1b,'US'=>0x1e), // + 'S3C' => array( // Shift 3 set for C40 -------------------------------------------------------------------------- + 0x60=>0x00,0x61=>0x01,0x62=>0x02,0x63=>0x03,0x64=>0x04,0x65=>0x05,0x66=>0x06,0x67=>0x07,0x68=>0x08,0x69=>0x09, // + 0x6a=>0x0a,0x6b=>0x0b,0x6c=>0x0c,0x6d=>0x0d,0x6e=>0x0e,0x6f=>0x0f,0x70=>0x10,0x71=>0x11,0x72=>0x12,0x73=>0x13, // + 0x74=>0x14,0x75=>0x15,0x76=>0x16,0x77=>0x17,0x78=>0x18,0x79=>0x19,0x7a=>0x1a,0x7b=>0x1b,0x7c=>0x1c,0x7d=>0x1d, // + 0x7e=>0x1e,0x7f=>0x1f), + 'S3T' => array( // Shift 3 set for TEXT ------------------------------------------------------------------------- + 0x60=>0x00,0x41=>0x01,0x42=>0x02,0x43=>0x03,0x44=>0x04,0x45=>0x05,0x46=>0x06,0x47=>0x07,0x48=>0x08,0x49=>0x09, // + 0x4a=>0x0a,0x4b=>0x0b,0x4c=>0x0c,0x4d=>0x0d,0x4e=>0x0e,0x4f=>0x0f,0x50=>0x10,0x51=>0x11,0x52=>0x12,0x53=>0x13, // + 0x54=>0x14,0x55=>0x15,0x56=>0x16,0x57=>0x17,0x58=>0x18,0x59=>0x19,0x5a=>0x1a,0x7b=>0x1b,0x7c=>0x1c,0x7d=>0x1d, // + 0x7e=>0x1e,0x7f=>0x1f), // + 'X12' => array( // Set for X12 ---------------------------------------------------------------------------------- + 0x0d=>0x00,0x2a=>0x01,0x3e=>0x02,0x20=>0x03,0x30=>0x04,0x31=>0x05,0x32=>0x06,0x33=>0x07,0x34=>0x08,0x35=>0x09, // + 0x36=>0x0a,0x37=>0x0b,0x38=>0x0c,0x39=>0x0d,0x41=>0x0e,0x42=>0x0f,0x43=>0x10,0x44=>0x11,0x45=>0x12,0x46=>0x13, // + 0x47=>0x14,0x48=>0x15,0x49=>0x16,0x4a=>0x17,0x4b=>0x18,0x4c=>0x19,0x4d=>0x1a,0x4e=>0x1b,0x4f=>0x1c,0x50=>0x1d, // + 0x51=>0x1e,0x52=>0x1f,0x53=>0x20,0x54=>0x21,0x55=>0x22,0x56=>0x23,0x57=>0x24,0x58=>0x25,0x59=>0x26,0x5a=>0x27) // + ); + +// ----------------------------------------------------------------------------- + + /** + * This is the class constructor. + * Creates a datamatrix object + * @param string $code Code to represent using Datamatrix. + * @public + */ + public function __construct($code) { + $barcode_array = array(); + if ((is_null($code)) OR ($code == '\0') OR ($code == '')) { + return false; + } + // get data codewords + $cw = $this->getHighLevelEncoding($code); + // number of data codewords + $nd = count($cw); + // check size + if ($nd > 1558) { + return false; + } + // get minimum required matrix size. + foreach ($this->symbattr as $params) { + if ($params[11] >= $nd) { + break; + } + } + if ($params[11] < $nd) { + // too much data + return false; + } elseif ($params[11] > $nd) { + // add padding + if ((($params[11] - $nd) > 1) AND ($cw[($nd - 1)] != 254)) { + if ($this->last_enc == ENC_EDF) { + // switch to ASCII encoding + $cw[] = 124; + ++$nd; + } elseif (($this->last_enc != ENC_ASCII) AND ($this->last_enc != ENC_BASE256)) { + // switch to ASCII encoding + $cw[] = 254; + ++$nd; + } + } + if ($params[11] > $nd) { + // add first pad + $cw[] = 129; + ++$nd; + // add remaining pads + for ($i = $nd; $i < $params[11]; ++$i) { + $cw[] = $this->get253StateCodeword(129, $i); + } + } + } + // add error correction codewords + $cw = $this->getErrorCorrection($cw, $params[13], $params[14], $params[15]); + // initialize empty arrays + $grid = array_fill(0, ($params[2] * $params[3]), 0); + // get placement map + $places = $this->getPlacementMap($params[2], $params[3]); + // fill the grid with data + $grid = array(); + $i = 0; + // region data row max index + $rdri = ($params[4] - 1); + // region data column max index + $rdci = ($params[5] - 1); + // for each vertical region + for ($vr = 0; $vr < $params[9]; ++$vr) { + // for each row on region + for ($r = 0; $r < $params[4]; ++$r) { + // get row + $row = (($vr * $params[4]) + $r); + // for each horizontal region + for ($hr = 0; $hr < $params[8]; ++$hr) { + // for each column on region + for ($c = 0; $c < $params[5]; ++$c) { + // get column + $col = (($hr * $params[5]) + $c); + // braw bits by case + if ($r == 0) { + // top finder pattern + if ($c % 2) { + $grid[$row][$col] = 0; + } else { + $grid[$row][$col] = 1; + } + } elseif ($r == $rdri) { + // bottom finder pattern + $grid[$row][$col] = 1; + } elseif ($c == 0) { + // left finder pattern + $grid[$row][$col] = 1; + } elseif ($c == $rdci) { + // right finder pattern + if ($r % 2) { + $grid[$row][$col] = 1; + } else { + $grid[$row][$col] = 0; + } + } else { // data bit + if ($places[$i] < 2) { + $grid[$row][$col] = $places[$i]; + } else { + // codeword ID + $cw_id = (floor($places[$i] / 10) - 1); + // codeword BIT mask + $cw_bit = pow(2, (8 - ($places[$i] % 10))); + $grid[$row][$col] = (($cw[$cw_id] & $cw_bit) == 0) ? 0 : 1; + } + ++$i; + } + } + } + } + } + $this->barcode_array['num_rows'] = $params[0]; + $this->barcode_array['num_cols'] = $params[1]; + $this->barcode_array['bcode'] = $grid; + } + + /** + * Returns a barcode array which is readable by TCPDF + * @return array barcode array readable by TCPDF; + * @public + */ + public function getBarcodeArray() { + return $this->barcode_array; + } + + /** + * Product of two numbers in a Power-of-Two Galois Field + * @param int $a first number to multiply. + * @param int $b second number to multiply. + * @param array $log Log table. + * @param array $alog Anti-Log table. + * @param int $gf Number of Factors of the Reed-Solomon polynomial. + * @return int product + * @protected + */ + protected function getGFProduct($a, $b, $log, $alog, $gf) { + if (($a == 0) OR ($b == 0)) { + return 0; + } + return ($alog[($log[$a] + $log[$b]) % ($gf - 1)]); + } + + /** + * Add error correction codewords to data codewords array (ANNEX E). + * @param array $wd Array of datacodewords. + * @param int $nb Number of blocks. + * @param int $nd Number of data codewords per block. + * @param int $nc Number of correction codewords per block. + * @param int $gf numner of fields on log/antilog table (power of 2). + * @param int $pp The value of its prime modulus polynomial (301 for ECC200). + * @return array data codewords + error codewords + * @protected + */ + protected function getErrorCorrection($wd, $nb, $nd, $nc, $gf=256, $pp=301) { + // generate the log ($log) and antilog ($alog) tables + $log[0] = 0; + $alog[0] = 1; + for ($i = 1; $i < $gf; ++$i) { + $alog[$i] = ($alog[($i - 1)] * 2); + if ($alog[$i] >= $gf) { + $alog[$i] ^= $pp; + } + $log[$alog[$i]] = $i; + } + ksort($log); + // generate the polynomial coefficients (c) + $c = array_fill(0, ($nc + 1), 0); + $c[0] = 1; + for ($i = 1; $i <= $nc; ++$i) { + $c[$i] = $c[($i-1)]; + for ($j = ($i - 1); $j >= 1; --$j) { + $c[$j] = $c[($j - 1)] ^ $this->getGFProduct($c[$j], $alog[$i], $log, $alog, $gf); + } + $c[0] = $this->getGFProduct($c[0], $alog[$i], $log, $alog, $gf); + } + ksort($c); + // total number of data codewords + $num_wd = ($nb * $nd); + // total number of error codewords + $num_we = ($nb * $nc); + // for each block + for ($b = 0; $b < $nb; ++$b) { + // create interleaved data block + $block = array(); + for ($n = $b; $n < $num_wd; $n += $nb) { + $block[] = $wd[$n]; + } + // initialize error codewords + $we = array_fill(0, ($nc + 1), 0); + // calculate error correction codewords for this block + for ($i = 0; $i < $nd; ++$i) { + $k = ($we[0] ^ $block[$i]); + for ($j = 0; $j < $nc; ++$j) { + $we[$j] = ($we[($j + 1)] ^ $this->getGFProduct($k, $c[($nc - $j - 1)], $log, $alog, $gf)); + } + } + // add error codewords at the end of data codewords + $j = 0; + for ($i = $b; $i < $num_we; $i += $nb) { + $wd[($num_wd + $i)] = $we[$j]; + ++$j; + } + } + // reorder codewords + ksort($wd); + return $wd; + } + + /** + * Return the 253-state codeword + * @param int $cwpad Pad codeword. + * @param int $cwpos Number of data codewords from the beginning of encoded data. + * @return int pad codeword + * @protected + */ + protected function get253StateCodeword($cwpad, $cwpos) { + $pad = ($cwpad + (((149 * $cwpos) % 253) + 1)); + if ($pad > 254) { + $pad -= 254; + } + return $pad; + } + + /** + * Return the 255-state codeword + * @param int $cwpad Pad codeword. + * @param int $cwpos Number of data codewords from the beginning of encoded data. + * @return int pad codeword + * @protected + */ + protected function get255StateCodeword($cwpad, $cwpos) { + $pad = ($cwpad + (((149 * $cwpos) % 255) + 1)); + if ($pad > 255) { + $pad -= 256; + } + return $pad; + } + + /** + * Returns true if the char belongs to the selected mode + * @param int $chr Character (byte) to check. + * @param int $mode Current encoding mode. + * @return boolean true if the char is of the selected mode. + * @protected + */ + protected function isCharMode($chr, $mode) { + $status = false; + switch ($mode) { + case ENC_ASCII: { // ASCII character 0 to 127 + $status = (($chr >= 0) AND ($chr <= 127)); + break; + } + case ENC_C40: { // Upper-case alphanumeric + $status = (($chr == 32) OR (($chr >= 48) AND ($chr <= 57)) OR (($chr >= 65) AND ($chr <= 90))); + break; + } + case ENC_TXT: { // Lower-case alphanumeric + $status = (($chr == 32) OR (($chr >= 48) AND ($chr <= 57)) OR (($chr >= 97) AND ($chr <= 122))); + break; + } + case ENC_X12: { // ANSI X12 + $status = (($chr == 13) OR ($chr == 42) OR ($chr == 62)); + break; + } + case ENC_EDF: { // ASCII character 32 to 94 + $status = (($chr >= 32) AND ($chr <= 94)); + break; + } + case ENC_BASE256: { // Function character (FNC1, Structured Append, Reader Program, or Code Page) + $status = (($chr == 232) OR ($chr == 233) OR ($chr == 234) OR ($chr == 241)); + break; + } + case ENC_ASCII_EXT: { // ASCII character 128 to 255 + $status = (($chr >= 128) AND ($chr <= 255)); + break; + } + case ENC_ASCII_NUM: { // ASCII digits + $status = (($chr >= 48) AND ($chr <= 57)); + break; + } + } + return $status; + } + + /** + * The look-ahead test scans the data to be encoded to find the best mode (Annex P - steps from J to S). + * @param string $data data to encode + * @param int $pos current position + * @param int $mode current encoding mode + * @return int encoding mode + * @protected + */ + protected function lookAheadTest($data, $pos, $mode) { + $data_length = strlen($data); + if ($pos >= $data_length) { + return $mode; + } + $charscount = 0; // count processed chars + // STEP J + if ($mode == ENC_ASCII) { + $numch = array(0, 1, 1, 1, 1, 1.25); + } else { + $numch = array(1, 2, 2, 2, 2, 2.25); + $numch[$mode] = 0; + } + while (true) { + // STEP K + if (($pos + $charscount) == $data_length) { + if ($numch[ENC_ASCII] <= ceil(min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256]))) { + return ENC_ASCII; + } + if ($numch[ENC_BASE256] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF]))) { + return ENC_BASE256; + } + if ($numch[ENC_EDF] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_BASE256]))) { + return ENC_EDF; + } + if ($numch[ENC_TXT] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256]))) { + return ENC_TXT; + } + if ($numch[ENC_X12] < ceil(min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256]))) { + return ENC_X12; + } + return ENC_C40; + } + // get char + $chr = ord($data[$pos + $charscount]); + $charscount++; + // STEP L + if ($this->isCharMode($chr, ENC_ASCII_NUM)) { + $numch[ENC_ASCII] += (1 / 2); + } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) { + $numch[ENC_ASCII] = ceil($numch[ENC_ASCII]); + $numch[ENC_ASCII] += 2; + } else { + $numch[ENC_ASCII] = ceil($numch[ENC_ASCII]); + $numch[ENC_ASCII] += 1; + } + // STEP M + if ($this->isCharMode($chr, ENC_C40)) { + $numch[ENC_C40] += (2 / 3); + } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) { + $numch[ENC_C40] += (8 / 3); + } else { + $numch[ENC_C40] += (4 / 3); + } + // STEP N + if ($this->isCharMode($chr, ENC_TXT)) { + $numch[ENC_TXT] += (2 / 3); + } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) { + $numch[ENC_TXT] += (8 / 3); + } else { + $numch[ENC_TXT] += (4 / 3); + } + // STEP O + if ($this->isCharMode($chr, ENC_X12) OR $this->isCharMode($chr, ENC_C40)) { + $numch[ENC_X12] += (2 / 3); + } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) { + $numch[ENC_X12] += (13 / 3); + } else { + $numch[ENC_X12] += (10 / 3); + } + // STEP P + if ($this->isCharMode($chr, ENC_EDF)) { + $numch[ENC_EDF] += (3 / 4); + } elseif ($this->isCharMode($chr, ENC_ASCII_EXT)) { + $numch[ENC_EDF] += (17 / 4); + } else { + $numch[ENC_EDF] += (13 / 4); + } + // STEP Q + if ($this->isCharMode($chr, ENC_BASE256)) { + $numch[ENC_BASE256] += 4; + } else { + $numch[ENC_BASE256] += 1; + } + // STEP R + if ($charscount >= 4) { + if (($numch[ENC_ASCII] + 1) <= min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256])) { + return ENC_ASCII; + } + if ((($numch[ENC_BASE256] + 1) <= $numch[ENC_ASCII]) + OR (($numch[ENC_BASE256] + 1) < min($numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_EDF]))) { + return ENC_BASE256; + } + if (($numch[ENC_EDF] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_X12], $numch[ENC_BASE256])) { + return ENC_EDF; + } + if (($numch[ENC_TXT] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_X12], $numch[ENC_EDF], $numch[ENC_BASE256])) { + return ENC_TXT; + } + if (($numch[ENC_X12] + 1) < min($numch[ENC_ASCII], $numch[ENC_C40], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256])) { + return ENC_X12; + } + if (($numch[ENC_C40] + 1) < min($numch[ENC_ASCII], $numch[ENC_TXT], $numch[ENC_EDF], $numch[ENC_BASE256])) { + if ($numch[ENC_C40] < $numch[ENC_X12]) { + return ENC_C40; + } + if ($numch[ENC_C40] == $numch[ENC_X12]) { + $k = ($pos + $charscount + 1); + while ($k < $data_length) { + $tmpchr = ord($data[$k]); + if ($this->isCharMode($tmpchr, ENC_X12)) { + return ENC_X12; + } elseif (!($this->isCharMode($tmpchr, ENC_X12) OR $this->isCharMode($tmpchr, ENC_C40))) { + break; + } + ++$k; + } + return ENC_C40; + } + } + } + } // end of while + } + + /** + * Get the switching codeword to a new encoding mode (latch codeword) + * @param int $mode New encoding mode. + * @return int Switch codeword. + * @protected + */ + protected function getSwitchEncodingCodeword($mode) { + switch ($mode) { + case ENC_ASCII: { // ASCII character 0 to 127 + $cw = 254; + if ($this->last_enc == ENC_EDF) { + $cw = 124; + } + break; + } + case ENC_C40: { // Upper-case alphanumeric + $cw = 230; + break; + } + case ENC_TXT: { // Lower-case alphanumeric + $cw = 239; + break; + } + case ENC_X12: { // ANSI X12 + $cw = 238; + break; + } + case ENC_EDF: { // ASCII character 32 to 94 + $cw = 240; + break; + } + case ENC_BASE256: { // Function character (FNC1, Structured Append, Reader Program, or Code Page) + $cw = 231; + break; + } + } + return $cw; + } + + /** + * Choose the minimum matrix size and return the max number of data codewords. + * @param int $numcw Number of current codewords. + * @return int number of data codewords in matrix + * @protected + */ + protected function getMaxDataCodewords($numcw) { + foreach ($this->symbattr as $key => $matrix) { + if ($matrix[11] >= $numcw) { + return $matrix[11]; + } + } + return 0; + } + + /** + * Get high level encoding using the minimum symbol data characters for ECC 200 + * @param string $data data to encode + * @return array of codewords + * @protected + */ + protected function getHighLevelEncoding($data) { + // STEP A. Start in ASCII encodation. + $enc = ENC_ASCII; // current encoding mode + $pos = 0; // current position + $cw = array(); // array of codewords to be returned + $cw_num = 0; // number of data codewords + $data_length = strlen($data); // number of chars + while ($pos < $data_length) { + // set last used encoding + $this->last_enc = $enc; + switch ($enc) { + case ENC_ASCII: { // STEP B. While in ASCII encodation + if (($data_length > 1) AND ($pos < ($data_length - 1)) AND ($this->isCharMode(ord($data[$pos]), ENC_ASCII_NUM) AND $this->isCharMode(ord($data[$pos + 1]), ENC_ASCII_NUM))) { + // 1. If the next data sequence is at least 2 consecutive digits, encode the next two digits as a double digit in ASCII mode. + $cw[] = (intval(substr($data, $pos, 2)) + 130); + ++$cw_num; + $pos += 2; + } else { + // 2. If the look-ahead test (starting at step J) indicates another mode, switch to that mode. + $newenc = $this->lookAheadTest($data, $pos, $enc); + if ($newenc != $enc) { + // switch to new encoding + $enc = $newenc; + $cw[] = $this->getSwitchEncodingCodeword($enc); + ++$cw_num; + } else { + // get new byte + $chr = ord($data[$pos]); + ++$pos; + if ($this->isCharMode($chr, ENC_ASCII_EXT)) { + // 3. If the next data character is extended ASCII (greater than 127) encode it in ASCII mode first using the Upper Shift (value 235) character. + $cw[] = 235; + $cw[] = ($chr - 127); + $cw_num += 2; + } else { + // 4. Otherwise process the next data character in ASCII encodation. + $cw[] = ($chr + 1); + ++$cw_num; + } + } + } + break; + } + case ENC_C40 : // Upper-case alphanumeric + case ENC_TXT : // Lower-case alphanumeric + case ENC_X12 : { // ANSI X12 + $temp_cw = array(); + $p = 0; + $epos = $pos; + // get charset ID + $set_id = $this->chset_id[$enc]; + // get basic charset for current encoding + $charset = $this->chset[$set_id]; + do { + // 2. process the next character in C40 encodation. + $chr = ord($data[$epos]); + ++$epos; + // check for extended character + if ($chr & 0x80) { + if ($enc == ENC_X12) { + return false; + } + $chr = ($chr & 0x7f); + $temp_cw[] = 1; // shift 2 + $temp_cw[] = 30; // upper shift + $p += 2; + } + if (isset($charset[$chr])) { + $temp_cw[] = $charset[$chr]; + ++$p; + } else { + if (isset($this->chset['SH1'][$chr])) { + $temp_cw[] = 0; // shift 1 + $shiftset = $this->chset['SH1']; + } elseif (isset($this->chset['SH2'][$chr])) { + $temp_cw[] = 1; // shift 2 + $shiftset = $this->chset['SH2']; + } elseif (($enc == ENC_C40) AND isset($this->chset['S3C'][$chr])) { + $temp_cw[] = 2; // shift 3 + $shiftset = $this->chset['S3C']; + } elseif (($enc == ENC_TXT) AND isset($this->chset['S3T'][$chr])) { + $temp_cw[] = 2; // shift 3 + $shiftset = $this->chset['S3T']; + } else { + return false; + } + $temp_cw[] = $shiftset[$chr]; + $p += 2; + } + if ($p >= 3) { + $c1 = array_shift($temp_cw); + $c2 = array_shift($temp_cw); + $c3 = array_shift($temp_cw); + $p -= 3; + $tmp = ((1600 * $c1) + (40 * $c2) + $c3 + 1); + $cw[] = ($tmp >> 8); + $cw[] = ($tmp % 256); + $cw_num += 2; + $pos = $epos; + // 1. If the C40 encoding is at the point of starting a new double symbol character and if the look-ahead test (starting at step J) indicates another mode, switch to that mode. + $newenc = $this->lookAheadTest($data, $pos, $enc); + if ($newenc != $enc) { + // switch to new encoding + $enc = $newenc; + if ($enc != ENC_ASCII) { + // set unlatch character + $cw[] = $this->getSwitchEncodingCodeword(ENC_ASCII); + ++$cw_num; + } + $cw[] = $this->getSwitchEncodingCodeword($enc); + ++$cw_num; + $pos -= $p; + $p = 0; + break; + } + } + } while (($p > 0) AND ($epos < $data_length)); + // process last data (if any) + if ($p > 0) { + // get remaining number of data symbols + $cwr = ($this->getMaxDataCodewords($cw_num) - $cw_num); + if (($cwr == 1) AND ($p == 1)) { + // d. If one symbol character remains and one C40 value (data character) remains to be encoded + $c1 = array_shift($temp_cw); + --$p; + $cw[] = ($chr + 1); + ++$cw_num; + $pos = $epos; + $enc = ENC_ASCII; + $this->last_enc = $enc; + } elseif (($cwr == 2) AND ($p == 1)) { + // c. If two symbol characters remain and only one C40 value (data character) remains to be encoded + $c1 = array_shift($temp_cw); + --$p; + $cw[] = 254; + $cw[] = ($chr + 1); + $cw_num += 2; + $pos = $epos; + $enc = ENC_ASCII; + $this->last_enc = $enc; + } elseif (($cwr == 2) AND ($p == 2)) { + // b. If two symbol characters remain and two C40 values remain to be encoded + $c1 = array_shift($temp_cw); + $c2 = array_shift($temp_cw); + $p -= 2; + $tmp = ((1600 * $c1) + (40 * $c2) + 1); + $cw[] = ($tmp >> 8); + $cw[] = ($tmp % 256); + $cw_num += 2; + $pos = $epos; + $enc = ENC_ASCII; + $this->last_enc = $enc; + } else { + // switch to ASCII encoding + if ($enc != ENC_ASCII) { + $enc = ENC_ASCII; + $this->last_enc = $enc; + $cw[] = $this->getSwitchEncodingCodeword($enc); + ++$cw_num; + $pos = ($epos - $p); + } + } + } + break; + } + case ENC_EDF: { // F. While in EDIFACT (EDF) encodation + // initialize temporary array with 0 length + $temp_cw = array(); + $epos = $pos; + $field_length = 0; + $newenc = $enc; + do { + // 2. process the next character in EDIFACT encodation. + $chr = ord($data[$epos]); + if ($this->isCharMode($chr, ENC_EDF)) { + ++$epos; + $temp_cw[] = $chr; + ++$field_length; + } + if (($field_length == 4) OR ($epos == $data_length) OR !$this->isCharMode($chr, ENC_EDF)) { + if (($epos == $data_length) AND ($field_length < 3)) { + $enc = ENC_ASCII; + $cw[] = $this->getSwitchEncodingCodeword($enc); + ++$cw_num; + break; + } + if ($field_length < 4) { + // set unlatch character + $temp_cw[] = 0x1f; + ++$field_length; + // fill empty characters + for ($i = $field_length; $i < 4; ++$i) { + $temp_cw[] = 0; + } + $enc = ENC_ASCII; + $this->last_enc = $enc; + } + // encodes four data characters in three codewords + $tcw = (($temp_cw[0] & 0x3F) << 2) + (($temp_cw[1] & 0x30) >> 4); + if ($tcw > 0) { + $cw[] = $tcw; + $cw_num++; + } + $tcw= (($temp_cw[1] & 0x0F) << 4) + (($temp_cw[2] & 0x3C) >> 2); + if ($tcw > 0) { + $cw[] = $tcw; + $cw_num++; + } + $tcw = (($temp_cw[2] & 0x03) << 6) + ($temp_cw[3] & 0x3F); + if ($tcw > 0) { + $cw[] = $tcw; + $cw_num++; + } + $temp_cw = array(); + $pos = $epos; + $field_length = 0; + if ($enc == ENC_ASCII) { + break; // exit from EDIFACT mode + } + } + } while ($epos < $data_length); + break; + } + case ENC_BASE256: { // G. While in Base 256 (B256) encodation + // initialize temporary array with 0 length + $temp_cw = array(); + $field_length = 0; + while (($pos < $data_length) AND ($field_length <= 1555)) { + $newenc = $this->lookAheadTest($data, $pos, $enc); + if ($newenc != $enc) { + // 1. If the look-ahead test (starting at step J) indicates another mode, switch to that mode. + $enc = $newenc; + break; // exit from B256 mode + } else { + // 2. Otherwise, process the next character in Base 256 encodation. + $chr = ord($data[$pos]); + ++$pos; + $temp_cw[] = $chr; + ++$field_length; + } + } + // set field length + if ($field_length <= 249) { + $cw[] = $this->get255StateCodeword($field_length, ($cw_num + 1)); + ++$cw_num; + } else { + $cw[] = $this->get255StateCodeword((floor($field_length / 250) + 249), ($cw_num + 1)); + $cw[] = $this->get255StateCodeword(($field_length % 250), ($cw_num + 2)); + $cw_num += 2; + } + if (!empty($temp_cw)) { + // add B256 field + foreach ($temp_cw as $p => $cht) { + $cw[] = $this->get255StateCodeword($cht, ($cw_num + $p + 1)); + } + } + break; + } + } // end of switch enc + } // end of while + return $cw; + } + + /** + * Places "chr+bit" with appropriate wrapping within array[]. + * (Annex F - ECC 200 symbol character placement) + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $row Row number. + * @param int $col Column number. + * @param int $chr Char byte. + * @param int $bit Bit. + * @return array + * @protected + */ + protected function placeModule($marr, $nrow, $ncol, $row, $col, $chr, $bit) { + if ($row < 0) { + $row += $nrow; + $col += (4 - (($nrow + 4) % 8)); + } + if ($col < 0) { + $col += $ncol; + $row += (4 - (($ncol + 4) % 8)); + } + $marr[(($row * $ncol) + $col)] = ((10 * $chr) + $bit); + return $marr; + } + + /** + * Places the 8 bits of a utah-shaped symbol character. + * (Annex F - ECC 200 symbol character placement) + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $row Row number. + * @param int $col Column number. + * @param int $chr Char byte. + * @return array + * @protected + */ + protected function placeUtah($marr, $nrow, $ncol, $row, $col, $chr) { + $marr = $this->placeModule($marr, $nrow, $ncol, $row-2, $col-2, $chr, 1); + $marr = $this->placeModule($marr, $nrow, $ncol, $row-2, $col-1, $chr, 2); + $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col-2, $chr, 3); + $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col-1, $chr, 4); + $marr = $this->placeModule($marr, $nrow, $ncol, $row-1, $col, $chr, 5); + $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col-2, $chr, 6); + $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col-1, $chr, 7); + $marr = $this->placeModule($marr, $nrow, $ncol, $row, $col, $chr, 8); + return $marr; + } + + /** + * Places the 8 bits of the first special corner case. + * (Annex F - ECC 200 symbol character placement) + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $chr Char byte. + * @return array + * @protected + */ + protected function placeCornerA($marr, $nrow, $ncol, $chr) { + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 1); + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 1, $chr, 2); + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 2, $chr, 3); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5); + $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 6); + $marr = $this->placeModule($marr, $nrow, $ncol, 2, $ncol-1, $chr, 7); + $marr = $this->placeModule($marr, $nrow, $ncol, 3, $ncol-1, $chr, 8); + return $marr; + } + + /** + * Places the 8 bits of the second special corner case. + * (Annex F - ECC 200 symbol character placement) + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $chr Char byte. + * @return array + * @protected + */ + protected function placeCornerB($marr, $nrow, $ncol, $chr) { + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-3, 0, $chr, 1); + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-2, 0, $chr, 2); + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 3); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-4, $chr, 4); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-3, $chr, 5); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 6); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 7); + $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 8); + return $marr; + } + + /** + * Places the 8 bits of the third special corner case. + * (Annex F - ECC 200 symbol character placement) + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $chr Char byte. + * @return array + * @protected + */ + protected function placeCornerC($marr, $nrow, $ncol, $chr) { + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-3, 0, $chr, 1); + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-2, 0, $chr, 2); + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 3); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5); + $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 6); + $marr = $this->placeModule($marr, $nrow, $ncol, 2, $ncol-1, $chr, 7); + $marr = $this->placeModule($marr, $nrow, $ncol, 3, $ncol-1, $chr, 8); + return $marr; + } + + /** + * Places the 8 bits of the fourth special corner case. + * (Annex F - ECC 200 symbol character placement) + * @param array $marr Array of symbols. + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @param int $chr Char byte. + * @return array + * @protected + */ + protected function placeCornerD($marr, $nrow, $ncol, $chr) { + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, 0, $chr, 1); + $marr = $this->placeModule($marr, $nrow, $ncol, $nrow-1, $ncol-1, $chr, 2); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-3, $chr, 3); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-2, $chr, 4); + $marr = $this->placeModule($marr, $nrow, $ncol, 0, $ncol-1, $chr, 5); + $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-3, $chr, 6); + $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-2, $chr, 7); + $marr = $this->placeModule($marr, $nrow, $ncol, 1, $ncol-1, $chr, 8); + return $marr; + } + + /** + * Build a placement map. + * (Annex F - ECC 200 symbol character placement) + * @param int $nrow Number of rows. + * @param int $ncol Number of columns. + * @return array + * @protected + */ + protected function getPlacementMap($nrow, $ncol) { + // initialize array with zeros + $marr = array_fill(0, ($nrow * $ncol), 0); + // set starting values + $chr = 1; + $row = 4; + $col = 0; + do { + // repeatedly first check for one of the special corner cases, then + if (($row == $nrow) AND ($col == 0)) { + $marr = $this->placeCornerA($marr, $nrow, $ncol, $chr); + ++$chr; + } + if (($row == ($nrow - 2)) AND ($col == 0) AND ($ncol % 4)) { + $marr = $this->placeCornerB($marr, $nrow, $ncol, $chr); + ++$chr; + } + if (($row == ($nrow - 2)) AND ($col == 0) AND (($ncol % 8) == 4)) { + $marr = $this->placeCornerC($marr, $nrow, $ncol, $chr); + ++$chr; + } + if (($row == ($nrow + 4)) AND ($col == 2) AND (!($ncol % 8))) { + $marr = $this->placeCornerD($marr, $nrow, $ncol, $chr); + ++$chr; + } + // sweep upward diagonally, inserting successive characters, + do { + if (($row < $nrow) AND ($col >= 0) AND (!$marr[(($row * $ncol) + $col)])) { + $marr = $this->placeUtah($marr, $nrow, $ncol, $row, $col, $chr); + ++$chr; + } + $row -= 2; + $col += 2; + } while (($row >= 0) AND ($col < $ncol)); + ++$row; + $col += 3; + // & then sweep downward diagonally, inserting successive characters,... + do { + if (($row >= 0) AND ($col < $ncol) AND (!$marr[(($row * $ncol) + $col)])) { + $marr = $this->placeUtah($marr, $nrow, $ncol, $row, $col, $chr); + ++$chr; + } + $row += 2; + $col -= 2; + } while (($row < $nrow) AND ($col >= 0)); + $row += 3; + ++$col; + // ... until the entire array is scanned + } while (($row < $nrow) OR ($col < $ncol)); + // lastly, if the lower righthand corner is untouched, fill in fixed pattern + if (!$marr[(($nrow * $ncol) - 1)]) { + $marr[(($nrow * $ncol) - 1)] = 1; + $marr[(($nrow * $ncol) - $ncol - 2)] = 1; + } + return $marr; + } + +} // end DataMatrix class +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/pdf417.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/pdf417.php new file mode 100755 index 0000000..bda2482 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/pdf417.php @@ -0,0 +1,996 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// DESCRIPTION : +// +// Class to create PDF417 barcode arrays for TCPDF class. +// PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991. +// It is one of the most popular 2D codes because of its ability to be read with slightly modified handheld laser or linear CCD scanners. +// TECHNICAL DATA / FEATURES OF PDF417: +// Encodable Character Set: All 128 ASCII Characters (including extended) +// Code Type: Continuous, Multi-Row +// Symbol Height: 3 - 90 Rows +// Symbol Width: 90X - 583X +// Bidirectional Decoding: Yes +// Error Correction Characters: 2 - 512 +// Maximum Data Characters: 1850 text, 2710 digits, 1108 bytes +// +//============================================================+ + +/** + * @file + * Class to create PDF417 barcode arrays for TCPDF class. + * PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991. + * (requires PHP bcmath extension) + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.005 + */ + +// definitions +if (!defined('PDF417DEFS')) { + + /** + * Indicate that definitions for this class are set + */ + define('PDF417DEFS', true); + + // ----------------------------------------------------- + + /** + * Row height respect X dimension of single module + */ + define('ROWHEIGHT', 4); + + /** + * Horizontal quiet zone in modules + */ + define('QUIETH', 2); + + /** + * Vertical quiet zone in modules + */ + define('QUIETV', 2); + +} // end of definitions + +// #*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*#*# + +/** + * @class PDF417 + * Class to create PDF417 barcode arrays for TCPDF class. + * PDF417 (ISO/IEC 15438:2006) is a 2-dimensional stacked bar code created by Symbol Technologies in 1991. + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.003 + */ +class PDF417 { + + /** + * Barcode array to be returned which is readable by TCPDF. + * @protected + */ + protected $barcode_array = array(); + + /** + * Start pattern. + * @protected + */ + protected $start_pattern = '11111111010101000'; + + /** + * Stop pattern. + * @protected + */ + protected $stop_pattern = '111111101000101001'; + + /** + * Array of text Compaction Sub-Modes (values 0xFB - 0xFF are used for submode changers). + * @protected + */ + protected $textsubmodes = array( + array(0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x20,0xFD,0xFE,0xFF), // Alpha + array(0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x20,0xFD,0xFE,0xFF), // Lower + array(0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x26,0x0d,0x09,0x2c,0x3a,0x23,0x2d,0x2e,0x24,0x2f,0x2b,0x25,0x2a,0x3d,0x5e,0xFB,0x20,0xFD,0xFE,0xFF), // Mixed + array(0x3b,0x3c,0x3e,0x40,0x5b,0x5c,0x5d,0x5f,0x60,0x7e,0x21,0x0d,0x09,0x2c,0x3a,0x0a,0x2d,0x2e,0x24,0x2f,0x22,0x7c,0x2a,0x28,0x29,0x3f,0x7b,0x7d,0x27,0xFF) // Puntuaction + ); + + /** + * Array of switching codes for Text Compaction Sub-Modes. + * @protected + */ + protected $textlatch = array( + '01' => array(27), '02' => array(28), '03' => array(28,25), // + '10' => array(28,28), '12' => array(28), '13' => array(28,25), // + '20' => array(28), '21' => array(27), '23' => array(25), // + '30' => array(29), '31' => array(29,27), '32' => array(29,28) // + ); + + /** + * Clusters of codewords (0, 3, 6)
      + * Values are hex equivalents of binary representation of bars (1 = bar, 0 = space).
      + * The codewords numbered from 900 to 928 have special meaning, some enable to switch between modes in order to optimise the code:
        + *
      • 900 : Switch to "Text" mode
      • + *
      • 901 : Switch to "Byte" mode
      • + *
      • 902 : Switch to "Numeric" mode
      • + *
      • 903 - 912 : Reserved
      • + *
      • 913 : Switch to "Octet" only for the next codeword
      • + *
      • 914 - 920 : Reserved
      • + *
      • 921 : Initialization
      • + *
      • 922 : Terminator codeword for Macro PDF control block
      • + *
      • 923 : Sequence tag to identify the beginning of optional fields in the Macro PDF control block
      • + *
      • 924 : Switch to "Byte" mode (If the total number of byte is multiple of 6)
      • + *
      • 925 : Identifier for a user defined Extended Channel Interpretation (ECI)
      • + *
      • 926 : Identifier for a general purpose ECI format
      • + *
      • 927 : Identifier for an ECI of a character set or code page
      • + *
      • 928 : Macro marker codeword to indicate the beginning of a Macro PDF Control Block
      • + *
      + * @protected + */ + protected $clusters = array( + array( // cluster 0 ----------------------------------------------------------------------- + 0x1d5c0,0x1eaf0,0x1f57c,0x1d4e0,0x1ea78,0x1f53e,0x1a8c0,0x1d470,0x1a860,0x15040, // 10 + 0x1a830,0x15020,0x1adc0,0x1d6f0,0x1eb7c,0x1ace0,0x1d678,0x1eb3e,0x158c0,0x1ac70, // 20 + 0x15860,0x15dc0,0x1aef0,0x1d77c,0x15ce0,0x1ae78,0x1d73e,0x15c70,0x1ae3c,0x15ef0, // 30 + 0x1af7c,0x15e78,0x1af3e,0x15f7c,0x1f5fa,0x1d2e0,0x1e978,0x1f4be,0x1a4c0,0x1d270, // 40 + 0x1e93c,0x1a460,0x1d238,0x14840,0x1a430,0x1d21c,0x14820,0x1a418,0x14810,0x1a6e0, // 50 + 0x1d378,0x1e9be,0x14cc0,0x1a670,0x1d33c,0x14c60,0x1a638,0x1d31e,0x14c30,0x1a61c, // 60 + 0x14ee0,0x1a778,0x1d3be,0x14e70,0x1a73c,0x14e38,0x1a71e,0x14f78,0x1a7be,0x14f3c, // 70 + 0x14f1e,0x1a2c0,0x1d170,0x1e8bc,0x1a260,0x1d138,0x1e89e,0x14440,0x1a230,0x1d11c, // 80 + 0x14420,0x1a218,0x14410,0x14408,0x146c0,0x1a370,0x1d1bc,0x14660,0x1a338,0x1d19e, // 90 + 0x14630,0x1a31c,0x14618,0x1460c,0x14770,0x1a3bc,0x14738,0x1a39e,0x1471c,0x147bc, // 100 + 0x1a160,0x1d0b8,0x1e85e,0x14240,0x1a130,0x1d09c,0x14220,0x1a118,0x1d08e,0x14210, // 110 + 0x1a10c,0x14208,0x1a106,0x14360,0x1a1b8,0x1d0de,0x14330,0x1a19c,0x14318,0x1a18e, // 120 + 0x1430c,0x14306,0x1a1de,0x1438e,0x14140,0x1a0b0,0x1d05c,0x14120,0x1a098,0x1d04e, // 130 + 0x14110,0x1a08c,0x14108,0x1a086,0x14104,0x141b0,0x14198,0x1418c,0x140a0,0x1d02e, // 140 + 0x1a04c,0x1a046,0x14082,0x1cae0,0x1e578,0x1f2be,0x194c0,0x1ca70,0x1e53c,0x19460, // 150 + 0x1ca38,0x1e51e,0x12840,0x19430,0x12820,0x196e0,0x1cb78,0x1e5be,0x12cc0,0x19670, // 160 + 0x1cb3c,0x12c60,0x19638,0x12c30,0x12c18,0x12ee0,0x19778,0x1cbbe,0x12e70,0x1973c, // 170 + 0x12e38,0x12e1c,0x12f78,0x197be,0x12f3c,0x12fbe,0x1dac0,0x1ed70,0x1f6bc,0x1da60, // 180 + 0x1ed38,0x1f69e,0x1b440,0x1da30,0x1ed1c,0x1b420,0x1da18,0x1ed0e,0x1b410,0x1da0c, // 190 + 0x192c0,0x1c970,0x1e4bc,0x1b6c0,0x19260,0x1c938,0x1e49e,0x1b660,0x1db38,0x1ed9e, // 200 + 0x16c40,0x12420,0x19218,0x1c90e,0x16c20,0x1b618,0x16c10,0x126c0,0x19370,0x1c9bc, // 210 + 0x16ec0,0x12660,0x19338,0x1c99e,0x16e60,0x1b738,0x1db9e,0x16e30,0x12618,0x16e18, // 220 + 0x12770,0x193bc,0x16f70,0x12738,0x1939e,0x16f38,0x1b79e,0x16f1c,0x127bc,0x16fbc, // 230 + 0x1279e,0x16f9e,0x1d960,0x1ecb8,0x1f65e,0x1b240,0x1d930,0x1ec9c,0x1b220,0x1d918, // 240 + 0x1ec8e,0x1b210,0x1d90c,0x1b208,0x1b204,0x19160,0x1c8b8,0x1e45e,0x1b360,0x19130, // 250 + 0x1c89c,0x16640,0x12220,0x1d99c,0x1c88e,0x16620,0x12210,0x1910c,0x16610,0x1b30c, // 260 + 0x19106,0x12204,0x12360,0x191b8,0x1c8de,0x16760,0x12330,0x1919c,0x16730,0x1b39c, // 270 + 0x1918e,0x16718,0x1230c,0x12306,0x123b8,0x191de,0x167b8,0x1239c,0x1679c,0x1238e, // 280 + 0x1678e,0x167de,0x1b140,0x1d8b0,0x1ec5c,0x1b120,0x1d898,0x1ec4e,0x1b110,0x1d88c, // 290 + 0x1b108,0x1d886,0x1b104,0x1b102,0x12140,0x190b0,0x1c85c,0x16340,0x12120,0x19098, // 300 + 0x1c84e,0x16320,0x1b198,0x1d8ce,0x16310,0x12108,0x19086,0x16308,0x1b186,0x16304, // 310 + 0x121b0,0x190dc,0x163b0,0x12198,0x190ce,0x16398,0x1b1ce,0x1638c,0x12186,0x16386, // 320 + 0x163dc,0x163ce,0x1b0a0,0x1d858,0x1ec2e,0x1b090,0x1d84c,0x1b088,0x1d846,0x1b084, // 330 + 0x1b082,0x120a0,0x19058,0x1c82e,0x161a0,0x12090,0x1904c,0x16190,0x1b0cc,0x19046, // 340 + 0x16188,0x12084,0x16184,0x12082,0x120d8,0x161d8,0x161cc,0x161c6,0x1d82c,0x1d826, // 350 + 0x1b042,0x1902c,0x12048,0x160c8,0x160c4,0x160c2,0x18ac0,0x1c570,0x1e2bc,0x18a60, // 360 + 0x1c538,0x11440,0x18a30,0x1c51c,0x11420,0x18a18,0x11410,0x11408,0x116c0,0x18b70, // 370 + 0x1c5bc,0x11660,0x18b38,0x1c59e,0x11630,0x18b1c,0x11618,0x1160c,0x11770,0x18bbc, // 380 + 0x11738,0x18b9e,0x1171c,0x117bc,0x1179e,0x1cd60,0x1e6b8,0x1f35e,0x19a40,0x1cd30, // 390 + 0x1e69c,0x19a20,0x1cd18,0x1e68e,0x19a10,0x1cd0c,0x19a08,0x1cd06,0x18960,0x1c4b8, // 400 + 0x1e25e,0x19b60,0x18930,0x1c49c,0x13640,0x11220,0x1cd9c,0x1c48e,0x13620,0x19b18, // 410 + 0x1890c,0x13610,0x11208,0x13608,0x11360,0x189b8,0x1c4de,0x13760,0x11330,0x1cdde, // 420 + 0x13730,0x19b9c,0x1898e,0x13718,0x1130c,0x1370c,0x113b8,0x189de,0x137b8,0x1139c, // 430 + 0x1379c,0x1138e,0x113de,0x137de,0x1dd40,0x1eeb0,0x1f75c,0x1dd20,0x1ee98,0x1f74e, // 440 + 0x1dd10,0x1ee8c,0x1dd08,0x1ee86,0x1dd04,0x19940,0x1ccb0,0x1e65c,0x1bb40,0x19920, // 450 + 0x1eedc,0x1e64e,0x1bb20,0x1dd98,0x1eece,0x1bb10,0x19908,0x1cc86,0x1bb08,0x1dd86, // 460 + 0x19902,0x11140,0x188b0,0x1c45c,0x13340,0x11120,0x18898,0x1c44e,0x17740,0x13320, // 470 + 0x19998,0x1ccce,0x17720,0x1bb98,0x1ddce,0x18886,0x17710,0x13308,0x19986,0x17708, // 480 + 0x11102,0x111b0,0x188dc,0x133b0,0x11198,0x188ce,0x177b0,0x13398,0x199ce,0x17798, // 490 + 0x1bbce,0x11186,0x13386,0x111dc,0x133dc,0x111ce,0x177dc,0x133ce,0x1dca0,0x1ee58, // 500 + 0x1f72e,0x1dc90,0x1ee4c,0x1dc88,0x1ee46,0x1dc84,0x1dc82,0x198a0,0x1cc58,0x1e62e, // 510 + 0x1b9a0,0x19890,0x1ee6e,0x1b990,0x1dccc,0x1cc46,0x1b988,0x19884,0x1b984,0x19882, // 520 + 0x1b982,0x110a0,0x18858,0x1c42e,0x131a0,0x11090,0x1884c,0x173a0,0x13190,0x198cc, // 530 + 0x18846,0x17390,0x1b9cc,0x11084,0x17388,0x13184,0x11082,0x13182,0x110d8,0x1886e, // 540 + 0x131d8,0x110cc,0x173d8,0x131cc,0x110c6,0x173cc,0x131c6,0x110ee,0x173ee,0x1dc50, // 550 + 0x1ee2c,0x1dc48,0x1ee26,0x1dc44,0x1dc42,0x19850,0x1cc2c,0x1b8d0,0x19848,0x1cc26, // 560 + 0x1b8c8,0x1dc66,0x1b8c4,0x19842,0x1b8c2,0x11050,0x1882c,0x130d0,0x11048,0x18826, // 570 + 0x171d0,0x130c8,0x19866,0x171c8,0x1b8e6,0x11042,0x171c4,0x130c2,0x171c2,0x130ec, // 580 + 0x171ec,0x171e6,0x1ee16,0x1dc22,0x1cc16,0x19824,0x19822,0x11028,0x13068,0x170e8, // 590 + 0x11022,0x13062,0x18560,0x10a40,0x18530,0x10a20,0x18518,0x1c28e,0x10a10,0x1850c, // 600 + 0x10a08,0x18506,0x10b60,0x185b8,0x1c2de,0x10b30,0x1859c,0x10b18,0x1858e,0x10b0c, // 610 + 0x10b06,0x10bb8,0x185de,0x10b9c,0x10b8e,0x10bde,0x18d40,0x1c6b0,0x1e35c,0x18d20, // 620 + 0x1c698,0x18d10,0x1c68c,0x18d08,0x1c686,0x18d04,0x10940,0x184b0,0x1c25c,0x11b40, // 630 + 0x10920,0x1c6dc,0x1c24e,0x11b20,0x18d98,0x1c6ce,0x11b10,0x10908,0x18486,0x11b08, // 640 + 0x18d86,0x10902,0x109b0,0x184dc,0x11bb0,0x10998,0x184ce,0x11b98,0x18dce,0x11b8c, // 650 + 0x10986,0x109dc,0x11bdc,0x109ce,0x11bce,0x1cea0,0x1e758,0x1f3ae,0x1ce90,0x1e74c, // 660 + 0x1ce88,0x1e746,0x1ce84,0x1ce82,0x18ca0,0x1c658,0x19da0,0x18c90,0x1c64c,0x19d90, // 670 + 0x1cecc,0x1c646,0x19d88,0x18c84,0x19d84,0x18c82,0x19d82,0x108a0,0x18458,0x119a0, // 680 + 0x10890,0x1c66e,0x13ba0,0x11990,0x18ccc,0x18446,0x13b90,0x19dcc,0x10884,0x13b88, // 690 + 0x11984,0x10882,0x11982,0x108d8,0x1846e,0x119d8,0x108cc,0x13bd8,0x119cc,0x108c6, // 700 + 0x13bcc,0x119c6,0x108ee,0x119ee,0x13bee,0x1ef50,0x1f7ac,0x1ef48,0x1f7a6,0x1ef44, // 710 + 0x1ef42,0x1ce50,0x1e72c,0x1ded0,0x1ef6c,0x1e726,0x1dec8,0x1ef66,0x1dec4,0x1ce42, // 720 + 0x1dec2,0x18c50,0x1c62c,0x19cd0,0x18c48,0x1c626,0x1bdd0,0x19cc8,0x1ce66,0x1bdc8, // 730 + 0x1dee6,0x18c42,0x1bdc4,0x19cc2,0x1bdc2,0x10850,0x1842c,0x118d0,0x10848,0x18426, // 740 + 0x139d0,0x118c8,0x18c66,0x17bd0,0x139c8,0x19ce6,0x10842,0x17bc8,0x1bde6,0x118c2, // 750 + 0x17bc4,0x1086c,0x118ec,0x10866,0x139ec,0x118e6,0x17bec,0x139e6,0x17be6,0x1ef28, // 760 + 0x1f796,0x1ef24,0x1ef22,0x1ce28,0x1e716,0x1de68,0x1ef36,0x1de64,0x1ce22,0x1de62, // 770 + 0x18c28,0x1c616,0x19c68,0x18c24,0x1bce8,0x19c64,0x18c22,0x1bce4,0x19c62,0x1bce2, // 780 + 0x10828,0x18416,0x11868,0x18c36,0x138e8,0x11864,0x10822,0x179e8,0x138e4,0x11862, // 790 + 0x179e4,0x138e2,0x179e2,0x11876,0x179f6,0x1ef12,0x1de34,0x1de32,0x19c34,0x1bc74, // 800 + 0x1bc72,0x11834,0x13874,0x178f4,0x178f2,0x10540,0x10520,0x18298,0x10510,0x10508, // 810 + 0x10504,0x105b0,0x10598,0x1058c,0x10586,0x105dc,0x105ce,0x186a0,0x18690,0x1c34c, // 820 + 0x18688,0x1c346,0x18684,0x18682,0x104a0,0x18258,0x10da0,0x186d8,0x1824c,0x10d90, // 830 + 0x186cc,0x10d88,0x186c6,0x10d84,0x10482,0x10d82,0x104d8,0x1826e,0x10dd8,0x186ee, // 840 + 0x10dcc,0x104c6,0x10dc6,0x104ee,0x10dee,0x1c750,0x1c748,0x1c744,0x1c742,0x18650, // 850 + 0x18ed0,0x1c76c,0x1c326,0x18ec8,0x1c766,0x18ec4,0x18642,0x18ec2,0x10450,0x10cd0, // 860 + 0x10448,0x18226,0x11dd0,0x10cc8,0x10444,0x11dc8,0x10cc4,0x10442,0x11dc4,0x10cc2, // 870 + 0x1046c,0x10cec,0x10466,0x11dec,0x10ce6,0x11de6,0x1e7a8,0x1e7a4,0x1e7a2,0x1c728, // 880 + 0x1cf68,0x1e7b6,0x1cf64,0x1c722,0x1cf62,0x18628,0x1c316,0x18e68,0x1c736,0x19ee8, // 890 + 0x18e64,0x18622,0x19ee4,0x18e62,0x19ee2,0x10428,0x18216,0x10c68,0x18636,0x11ce8, // 900 + 0x10c64,0x10422,0x13de8,0x11ce4,0x10c62,0x13de4,0x11ce2,0x10436,0x10c76,0x11cf6, // 910 + 0x13df6,0x1f7d4,0x1f7d2,0x1e794,0x1efb4,0x1e792,0x1efb2,0x1c714,0x1cf34,0x1c712, // 920 + 0x1df74,0x1cf32,0x1df72,0x18614,0x18e34,0x18612,0x19e74,0x18e32,0x1bef4), // 929 + array( // cluster 3 ----------------------------------------------------------------------- + 0x1f560,0x1fab8,0x1ea40,0x1f530,0x1fa9c,0x1ea20,0x1f518,0x1fa8e,0x1ea10,0x1f50c, // 10 + 0x1ea08,0x1f506,0x1ea04,0x1eb60,0x1f5b8,0x1fade,0x1d640,0x1eb30,0x1f59c,0x1d620, // 20 + 0x1eb18,0x1f58e,0x1d610,0x1eb0c,0x1d608,0x1eb06,0x1d604,0x1d760,0x1ebb8,0x1f5de, // 30 + 0x1ae40,0x1d730,0x1eb9c,0x1ae20,0x1d718,0x1eb8e,0x1ae10,0x1d70c,0x1ae08,0x1d706, // 40 + 0x1ae04,0x1af60,0x1d7b8,0x1ebde,0x15e40,0x1af30,0x1d79c,0x15e20,0x1af18,0x1d78e, // 50 + 0x15e10,0x1af0c,0x15e08,0x1af06,0x15f60,0x1afb8,0x1d7de,0x15f30,0x1af9c,0x15f18, // 60 + 0x1af8e,0x15f0c,0x15fb8,0x1afde,0x15f9c,0x15f8e,0x1e940,0x1f4b0,0x1fa5c,0x1e920, // 70 + 0x1f498,0x1fa4e,0x1e910,0x1f48c,0x1e908,0x1f486,0x1e904,0x1e902,0x1d340,0x1e9b0, // 80 + 0x1f4dc,0x1d320,0x1e998,0x1f4ce,0x1d310,0x1e98c,0x1d308,0x1e986,0x1d304,0x1d302, // 90 + 0x1a740,0x1d3b0,0x1e9dc,0x1a720,0x1d398,0x1e9ce,0x1a710,0x1d38c,0x1a708,0x1d386, // 100 + 0x1a704,0x1a702,0x14f40,0x1a7b0,0x1d3dc,0x14f20,0x1a798,0x1d3ce,0x14f10,0x1a78c, // 110 + 0x14f08,0x1a786,0x14f04,0x14fb0,0x1a7dc,0x14f98,0x1a7ce,0x14f8c,0x14f86,0x14fdc, // 120 + 0x14fce,0x1e8a0,0x1f458,0x1fa2e,0x1e890,0x1f44c,0x1e888,0x1f446,0x1e884,0x1e882, // 130 + 0x1d1a0,0x1e8d8,0x1f46e,0x1d190,0x1e8cc,0x1d188,0x1e8c6,0x1d184,0x1d182,0x1a3a0, // 140 + 0x1d1d8,0x1e8ee,0x1a390,0x1d1cc,0x1a388,0x1d1c6,0x1a384,0x1a382,0x147a0,0x1a3d8, // 150 + 0x1d1ee,0x14790,0x1a3cc,0x14788,0x1a3c6,0x14784,0x14782,0x147d8,0x1a3ee,0x147cc, // 160 + 0x147c6,0x147ee,0x1e850,0x1f42c,0x1e848,0x1f426,0x1e844,0x1e842,0x1d0d0,0x1e86c, // 170 + 0x1d0c8,0x1e866,0x1d0c4,0x1d0c2,0x1a1d0,0x1d0ec,0x1a1c8,0x1d0e6,0x1a1c4,0x1a1c2, // 180 + 0x143d0,0x1a1ec,0x143c8,0x1a1e6,0x143c4,0x143c2,0x143ec,0x143e6,0x1e828,0x1f416, // 190 + 0x1e824,0x1e822,0x1d068,0x1e836,0x1d064,0x1d062,0x1a0e8,0x1d076,0x1a0e4,0x1a0e2, // 200 + 0x141e8,0x1a0f6,0x141e4,0x141e2,0x1e814,0x1e812,0x1d034,0x1d032,0x1a074,0x1a072, // 210 + 0x1e540,0x1f2b0,0x1f95c,0x1e520,0x1f298,0x1f94e,0x1e510,0x1f28c,0x1e508,0x1f286, // 220 + 0x1e504,0x1e502,0x1cb40,0x1e5b0,0x1f2dc,0x1cb20,0x1e598,0x1f2ce,0x1cb10,0x1e58c, // 230 + 0x1cb08,0x1e586,0x1cb04,0x1cb02,0x19740,0x1cbb0,0x1e5dc,0x19720,0x1cb98,0x1e5ce, // 240 + 0x19710,0x1cb8c,0x19708,0x1cb86,0x19704,0x19702,0x12f40,0x197b0,0x1cbdc,0x12f20, // 250 + 0x19798,0x1cbce,0x12f10,0x1978c,0x12f08,0x19786,0x12f04,0x12fb0,0x197dc,0x12f98, // 260 + 0x197ce,0x12f8c,0x12f86,0x12fdc,0x12fce,0x1f6a0,0x1fb58,0x16bf0,0x1f690,0x1fb4c, // 270 + 0x169f8,0x1f688,0x1fb46,0x168fc,0x1f684,0x1f682,0x1e4a0,0x1f258,0x1f92e,0x1eda0, // 280 + 0x1e490,0x1fb6e,0x1ed90,0x1f6cc,0x1f246,0x1ed88,0x1e484,0x1ed84,0x1e482,0x1ed82, // 290 + 0x1c9a0,0x1e4d8,0x1f26e,0x1dba0,0x1c990,0x1e4cc,0x1db90,0x1edcc,0x1e4c6,0x1db88, // 300 + 0x1c984,0x1db84,0x1c982,0x1db82,0x193a0,0x1c9d8,0x1e4ee,0x1b7a0,0x19390,0x1c9cc, // 310 + 0x1b790,0x1dbcc,0x1c9c6,0x1b788,0x19384,0x1b784,0x19382,0x1b782,0x127a0,0x193d8, // 320 + 0x1c9ee,0x16fa0,0x12790,0x193cc,0x16f90,0x1b7cc,0x193c6,0x16f88,0x12784,0x16f84, // 330 + 0x12782,0x127d8,0x193ee,0x16fd8,0x127cc,0x16fcc,0x127c6,0x16fc6,0x127ee,0x1f650, // 340 + 0x1fb2c,0x165f8,0x1f648,0x1fb26,0x164fc,0x1f644,0x1647e,0x1f642,0x1e450,0x1f22c, // 350 + 0x1ecd0,0x1e448,0x1f226,0x1ecc8,0x1f666,0x1ecc4,0x1e442,0x1ecc2,0x1c8d0,0x1e46c, // 360 + 0x1d9d0,0x1c8c8,0x1e466,0x1d9c8,0x1ece6,0x1d9c4,0x1c8c2,0x1d9c2,0x191d0,0x1c8ec, // 370 + 0x1b3d0,0x191c8,0x1c8e6,0x1b3c8,0x1d9e6,0x1b3c4,0x191c2,0x1b3c2,0x123d0,0x191ec, // 380 + 0x167d0,0x123c8,0x191e6,0x167c8,0x1b3e6,0x167c4,0x123c2,0x167c2,0x123ec,0x167ec, // 390 + 0x123e6,0x167e6,0x1f628,0x1fb16,0x162fc,0x1f624,0x1627e,0x1f622,0x1e428,0x1f216, // 400 + 0x1ec68,0x1f636,0x1ec64,0x1e422,0x1ec62,0x1c868,0x1e436,0x1d8e8,0x1c864,0x1d8e4, // 410 + 0x1c862,0x1d8e2,0x190e8,0x1c876,0x1b1e8,0x1d8f6,0x1b1e4,0x190e2,0x1b1e2,0x121e8, // 420 + 0x190f6,0x163e8,0x121e4,0x163e4,0x121e2,0x163e2,0x121f6,0x163f6,0x1f614,0x1617e, // 430 + 0x1f612,0x1e414,0x1ec34,0x1e412,0x1ec32,0x1c834,0x1d874,0x1c832,0x1d872,0x19074, // 440 + 0x1b0f4,0x19072,0x1b0f2,0x120f4,0x161f4,0x120f2,0x161f2,0x1f60a,0x1e40a,0x1ec1a, // 450 + 0x1c81a,0x1d83a,0x1903a,0x1b07a,0x1e2a0,0x1f158,0x1f8ae,0x1e290,0x1f14c,0x1e288, // 460 + 0x1f146,0x1e284,0x1e282,0x1c5a0,0x1e2d8,0x1f16e,0x1c590,0x1e2cc,0x1c588,0x1e2c6, // 470 + 0x1c584,0x1c582,0x18ba0,0x1c5d8,0x1e2ee,0x18b90,0x1c5cc,0x18b88,0x1c5c6,0x18b84, // 480 + 0x18b82,0x117a0,0x18bd8,0x1c5ee,0x11790,0x18bcc,0x11788,0x18bc6,0x11784,0x11782, // 490 + 0x117d8,0x18bee,0x117cc,0x117c6,0x117ee,0x1f350,0x1f9ac,0x135f8,0x1f348,0x1f9a6, // 500 + 0x134fc,0x1f344,0x1347e,0x1f342,0x1e250,0x1f12c,0x1e6d0,0x1e248,0x1f126,0x1e6c8, // 510 + 0x1f366,0x1e6c4,0x1e242,0x1e6c2,0x1c4d0,0x1e26c,0x1cdd0,0x1c4c8,0x1e266,0x1cdc8, // 520 + 0x1e6e6,0x1cdc4,0x1c4c2,0x1cdc2,0x189d0,0x1c4ec,0x19bd0,0x189c8,0x1c4e6,0x19bc8, // 530 + 0x1cde6,0x19bc4,0x189c2,0x19bc2,0x113d0,0x189ec,0x137d0,0x113c8,0x189e6,0x137c8, // 540 + 0x19be6,0x137c4,0x113c2,0x137c2,0x113ec,0x137ec,0x113e6,0x137e6,0x1fba8,0x175f0, // 550 + 0x1bafc,0x1fba4,0x174f8,0x1ba7e,0x1fba2,0x1747c,0x1743e,0x1f328,0x1f996,0x132fc, // 560 + 0x1f768,0x1fbb6,0x176fc,0x1327e,0x1f764,0x1f322,0x1767e,0x1f762,0x1e228,0x1f116, // 570 + 0x1e668,0x1e224,0x1eee8,0x1f776,0x1e222,0x1eee4,0x1e662,0x1eee2,0x1c468,0x1e236, // 580 + 0x1cce8,0x1c464,0x1dde8,0x1cce4,0x1c462,0x1dde4,0x1cce2,0x1dde2,0x188e8,0x1c476, // 590 + 0x199e8,0x188e4,0x1bbe8,0x199e4,0x188e2,0x1bbe4,0x199e2,0x1bbe2,0x111e8,0x188f6, // 600 + 0x133e8,0x111e4,0x177e8,0x133e4,0x111e2,0x177e4,0x133e2,0x177e2,0x111f6,0x133f6, // 610 + 0x1fb94,0x172f8,0x1b97e,0x1fb92,0x1727c,0x1723e,0x1f314,0x1317e,0x1f734,0x1f312, // 620 + 0x1737e,0x1f732,0x1e214,0x1e634,0x1e212,0x1ee74,0x1e632,0x1ee72,0x1c434,0x1cc74, // 630 + 0x1c432,0x1dcf4,0x1cc72,0x1dcf2,0x18874,0x198f4,0x18872,0x1b9f4,0x198f2,0x1b9f2, // 640 + 0x110f4,0x131f4,0x110f2,0x173f4,0x131f2,0x173f2,0x1fb8a,0x1717c,0x1713e,0x1f30a, // 650 + 0x1f71a,0x1e20a,0x1e61a,0x1ee3a,0x1c41a,0x1cc3a,0x1dc7a,0x1883a,0x1987a,0x1b8fa, // 660 + 0x1107a,0x130fa,0x171fa,0x170be,0x1e150,0x1f0ac,0x1e148,0x1f0a6,0x1e144,0x1e142, // 670 + 0x1c2d0,0x1e16c,0x1c2c8,0x1e166,0x1c2c4,0x1c2c2,0x185d0,0x1c2ec,0x185c8,0x1c2e6, // 680 + 0x185c4,0x185c2,0x10bd0,0x185ec,0x10bc8,0x185e6,0x10bc4,0x10bc2,0x10bec,0x10be6, // 690 + 0x1f1a8,0x1f8d6,0x11afc,0x1f1a4,0x11a7e,0x1f1a2,0x1e128,0x1f096,0x1e368,0x1e124, // 700 + 0x1e364,0x1e122,0x1e362,0x1c268,0x1e136,0x1c6e8,0x1c264,0x1c6e4,0x1c262,0x1c6e2, // 710 + 0x184e8,0x1c276,0x18de8,0x184e4,0x18de4,0x184e2,0x18de2,0x109e8,0x184f6,0x11be8, // 720 + 0x109e4,0x11be4,0x109e2,0x11be2,0x109f6,0x11bf6,0x1f9d4,0x13af8,0x19d7e,0x1f9d2, // 730 + 0x13a7c,0x13a3e,0x1f194,0x1197e,0x1f3b4,0x1f192,0x13b7e,0x1f3b2,0x1e114,0x1e334, // 740 + 0x1e112,0x1e774,0x1e332,0x1e772,0x1c234,0x1c674,0x1c232,0x1cef4,0x1c672,0x1cef2, // 750 + 0x18474,0x18cf4,0x18472,0x19df4,0x18cf2,0x19df2,0x108f4,0x119f4,0x108f2,0x13bf4, // 760 + 0x119f2,0x13bf2,0x17af0,0x1bd7c,0x17a78,0x1bd3e,0x17a3c,0x17a1e,0x1f9ca,0x1397c, // 770 + 0x1fbda,0x17b7c,0x1393e,0x17b3e,0x1f18a,0x1f39a,0x1f7ba,0x1e10a,0x1e31a,0x1e73a, // 780 + 0x1ef7a,0x1c21a,0x1c63a,0x1ce7a,0x1defa,0x1843a,0x18c7a,0x19cfa,0x1bdfa,0x1087a, // 790 + 0x118fa,0x139fa,0x17978,0x1bcbe,0x1793c,0x1791e,0x138be,0x179be,0x178bc,0x1789e, // 800 + 0x1785e,0x1e0a8,0x1e0a4,0x1e0a2,0x1c168,0x1e0b6,0x1c164,0x1c162,0x182e8,0x1c176, // 810 + 0x182e4,0x182e2,0x105e8,0x182f6,0x105e4,0x105e2,0x105f6,0x1f0d4,0x10d7e,0x1f0d2, // 820 + 0x1e094,0x1e1b4,0x1e092,0x1e1b2,0x1c134,0x1c374,0x1c132,0x1c372,0x18274,0x186f4, // 830 + 0x18272,0x186f2,0x104f4,0x10df4,0x104f2,0x10df2,0x1f8ea,0x11d7c,0x11d3e,0x1f0ca, // 840 + 0x1f1da,0x1e08a,0x1e19a,0x1e3ba,0x1c11a,0x1c33a,0x1c77a,0x1823a,0x1867a,0x18efa, // 850 + 0x1047a,0x10cfa,0x11dfa,0x13d78,0x19ebe,0x13d3c,0x13d1e,0x11cbe,0x13dbe,0x17d70, // 860 + 0x1bebc,0x17d38,0x1be9e,0x17d1c,0x17d0e,0x13cbc,0x17dbc,0x13c9e,0x17d9e,0x17cb8, // 870 + 0x1be5e,0x17c9c,0x17c8e,0x13c5e,0x17cde,0x17c5c,0x17c4e,0x17c2e,0x1c0b4,0x1c0b2, // 880 + 0x18174,0x18172,0x102f4,0x102f2,0x1e0da,0x1c09a,0x1c1ba,0x1813a,0x1837a,0x1027a, // 890 + 0x106fa,0x10ebe,0x11ebc,0x11e9e,0x13eb8,0x19f5e,0x13e9c,0x13e8e,0x11e5e,0x13ede, // 900 + 0x17eb0,0x1bf5c,0x17e98,0x1bf4e,0x17e8c,0x17e86,0x13e5c,0x17edc,0x13e4e,0x17ece, // 910 + 0x17e58,0x1bf2e,0x17e4c,0x17e46,0x13e2e,0x17e6e,0x17e2c,0x17e26,0x10f5e,0x11f5c, // 920 + 0x11f4e,0x13f58,0x19fae,0x13f4c,0x13f46,0x11f2e,0x13f6e,0x13f2c,0x13f26), // 929 + array( // cluster 6 ----------------------------------------------------------------------- + 0x1abe0,0x1d5f8,0x153c0,0x1a9f0,0x1d4fc,0x151e0,0x1a8f8,0x1d47e,0x150f0,0x1a87c, // 10 + 0x15078,0x1fad0,0x15be0,0x1adf8,0x1fac8,0x159f0,0x1acfc,0x1fac4,0x158f8,0x1ac7e, // 20 + 0x1fac2,0x1587c,0x1f5d0,0x1faec,0x15df8,0x1f5c8,0x1fae6,0x15cfc,0x1f5c4,0x15c7e, // 30 + 0x1f5c2,0x1ebd0,0x1f5ec,0x1ebc8,0x1f5e6,0x1ebc4,0x1ebc2,0x1d7d0,0x1ebec,0x1d7c8, // 40 + 0x1ebe6,0x1d7c4,0x1d7c2,0x1afd0,0x1d7ec,0x1afc8,0x1d7e6,0x1afc4,0x14bc0,0x1a5f0, // 50 + 0x1d2fc,0x149e0,0x1a4f8,0x1d27e,0x148f0,0x1a47c,0x14878,0x1a43e,0x1483c,0x1fa68, // 60 + 0x14df0,0x1a6fc,0x1fa64,0x14cf8,0x1a67e,0x1fa62,0x14c7c,0x14c3e,0x1f4e8,0x1fa76, // 70 + 0x14efc,0x1f4e4,0x14e7e,0x1f4e2,0x1e9e8,0x1f4f6,0x1e9e4,0x1e9e2,0x1d3e8,0x1e9f6, // 80 + 0x1d3e4,0x1d3e2,0x1a7e8,0x1d3f6,0x1a7e4,0x1a7e2,0x145e0,0x1a2f8,0x1d17e,0x144f0, // 90 + 0x1a27c,0x14478,0x1a23e,0x1443c,0x1441e,0x1fa34,0x146f8,0x1a37e,0x1fa32,0x1467c, // 100 + 0x1463e,0x1f474,0x1477e,0x1f472,0x1e8f4,0x1e8f2,0x1d1f4,0x1d1f2,0x1a3f4,0x1a3f2, // 110 + 0x142f0,0x1a17c,0x14278,0x1a13e,0x1423c,0x1421e,0x1fa1a,0x1437c,0x1433e,0x1f43a, // 120 + 0x1e87a,0x1d0fa,0x14178,0x1a0be,0x1413c,0x1411e,0x141be,0x140bc,0x1409e,0x12bc0, // 130 + 0x195f0,0x1cafc,0x129e0,0x194f8,0x1ca7e,0x128f0,0x1947c,0x12878,0x1943e,0x1283c, // 140 + 0x1f968,0x12df0,0x196fc,0x1f964,0x12cf8,0x1967e,0x1f962,0x12c7c,0x12c3e,0x1f2e8, // 150 + 0x1f976,0x12efc,0x1f2e4,0x12e7e,0x1f2e2,0x1e5e8,0x1f2f6,0x1e5e4,0x1e5e2,0x1cbe8, // 160 + 0x1e5f6,0x1cbe4,0x1cbe2,0x197e8,0x1cbf6,0x197e4,0x197e2,0x1b5e0,0x1daf8,0x1ed7e, // 170 + 0x169c0,0x1b4f0,0x1da7c,0x168e0,0x1b478,0x1da3e,0x16870,0x1b43c,0x16838,0x1b41e, // 180 + 0x1681c,0x125e0,0x192f8,0x1c97e,0x16de0,0x124f0,0x1927c,0x16cf0,0x1b67c,0x1923e, // 190 + 0x16c78,0x1243c,0x16c3c,0x1241e,0x16c1e,0x1f934,0x126f8,0x1937e,0x1fb74,0x1f932, // 200 + 0x16ef8,0x1267c,0x1fb72,0x16e7c,0x1263e,0x16e3e,0x1f274,0x1277e,0x1f6f4,0x1f272, // 210 + 0x16f7e,0x1f6f2,0x1e4f4,0x1edf4,0x1e4f2,0x1edf2,0x1c9f4,0x1dbf4,0x1c9f2,0x1dbf2, // 220 + 0x193f4,0x193f2,0x165c0,0x1b2f0,0x1d97c,0x164e0,0x1b278,0x1d93e,0x16470,0x1b23c, // 230 + 0x16438,0x1b21e,0x1641c,0x1640e,0x122f0,0x1917c,0x166f0,0x12278,0x1913e,0x16678, // 240 + 0x1b33e,0x1663c,0x1221e,0x1661e,0x1f91a,0x1237c,0x1fb3a,0x1677c,0x1233e,0x1673e, // 250 + 0x1f23a,0x1f67a,0x1e47a,0x1ecfa,0x1c8fa,0x1d9fa,0x191fa,0x162e0,0x1b178,0x1d8be, // 260 + 0x16270,0x1b13c,0x16238,0x1b11e,0x1621c,0x1620e,0x12178,0x190be,0x16378,0x1213c, // 270 + 0x1633c,0x1211e,0x1631e,0x121be,0x163be,0x16170,0x1b0bc,0x16138,0x1b09e,0x1611c, // 280 + 0x1610e,0x120bc,0x161bc,0x1209e,0x1619e,0x160b8,0x1b05e,0x1609c,0x1608e,0x1205e, // 290 + 0x160de,0x1605c,0x1604e,0x115e0,0x18af8,0x1c57e,0x114f0,0x18a7c,0x11478,0x18a3e, // 300 + 0x1143c,0x1141e,0x1f8b4,0x116f8,0x18b7e,0x1f8b2,0x1167c,0x1163e,0x1f174,0x1177e, // 310 + 0x1f172,0x1e2f4,0x1e2f2,0x1c5f4,0x1c5f2,0x18bf4,0x18bf2,0x135c0,0x19af0,0x1cd7c, // 320 + 0x134e0,0x19a78,0x1cd3e,0x13470,0x19a3c,0x13438,0x19a1e,0x1341c,0x1340e,0x112f0, // 330 + 0x1897c,0x136f0,0x11278,0x1893e,0x13678,0x19b3e,0x1363c,0x1121e,0x1361e,0x1f89a, // 340 + 0x1137c,0x1f9ba,0x1377c,0x1133e,0x1373e,0x1f13a,0x1f37a,0x1e27a,0x1e6fa,0x1c4fa, // 350 + 0x1cdfa,0x189fa,0x1bae0,0x1dd78,0x1eebe,0x174c0,0x1ba70,0x1dd3c,0x17460,0x1ba38, // 360 + 0x1dd1e,0x17430,0x1ba1c,0x17418,0x1ba0e,0x1740c,0x132e0,0x19978,0x1ccbe,0x176e0, // 370 + 0x13270,0x1993c,0x17670,0x1bb3c,0x1991e,0x17638,0x1321c,0x1761c,0x1320e,0x1760e, // 380 + 0x11178,0x188be,0x13378,0x1113c,0x17778,0x1333c,0x1111e,0x1773c,0x1331e,0x1771e, // 390 + 0x111be,0x133be,0x177be,0x172c0,0x1b970,0x1dcbc,0x17260,0x1b938,0x1dc9e,0x17230, // 400 + 0x1b91c,0x17218,0x1b90e,0x1720c,0x17206,0x13170,0x198bc,0x17370,0x13138,0x1989e, // 410 + 0x17338,0x1b99e,0x1731c,0x1310e,0x1730e,0x110bc,0x131bc,0x1109e,0x173bc,0x1319e, // 420 + 0x1739e,0x17160,0x1b8b8,0x1dc5e,0x17130,0x1b89c,0x17118,0x1b88e,0x1710c,0x17106, // 430 + 0x130b8,0x1985e,0x171b8,0x1309c,0x1719c,0x1308e,0x1718e,0x1105e,0x130de,0x171de, // 440 + 0x170b0,0x1b85c,0x17098,0x1b84e,0x1708c,0x17086,0x1305c,0x170dc,0x1304e,0x170ce, // 450 + 0x17058,0x1b82e,0x1704c,0x17046,0x1302e,0x1706e,0x1702c,0x17026,0x10af0,0x1857c, // 460 + 0x10a78,0x1853e,0x10a3c,0x10a1e,0x10b7c,0x10b3e,0x1f0ba,0x1e17a,0x1c2fa,0x185fa, // 470 + 0x11ae0,0x18d78,0x1c6be,0x11a70,0x18d3c,0x11a38,0x18d1e,0x11a1c,0x11a0e,0x10978, // 480 + 0x184be,0x11b78,0x1093c,0x11b3c,0x1091e,0x11b1e,0x109be,0x11bbe,0x13ac0,0x19d70, // 490 + 0x1cebc,0x13a60,0x19d38,0x1ce9e,0x13a30,0x19d1c,0x13a18,0x19d0e,0x13a0c,0x13a06, // 500 + 0x11970,0x18cbc,0x13b70,0x11938,0x18c9e,0x13b38,0x1191c,0x13b1c,0x1190e,0x13b0e, // 510 + 0x108bc,0x119bc,0x1089e,0x13bbc,0x1199e,0x13b9e,0x1bd60,0x1deb8,0x1ef5e,0x17a40, // 520 + 0x1bd30,0x1de9c,0x17a20,0x1bd18,0x1de8e,0x17a10,0x1bd0c,0x17a08,0x1bd06,0x17a04, // 530 + 0x13960,0x19cb8,0x1ce5e,0x17b60,0x13930,0x19c9c,0x17b30,0x1bd9c,0x19c8e,0x17b18, // 540 + 0x1390c,0x17b0c,0x13906,0x17b06,0x118b8,0x18c5e,0x139b8,0x1189c,0x17bb8,0x1399c, // 550 + 0x1188e,0x17b9c,0x1398e,0x17b8e,0x1085e,0x118de,0x139de,0x17bde,0x17940,0x1bcb0, // 560 + 0x1de5c,0x17920,0x1bc98,0x1de4e,0x17910,0x1bc8c,0x17908,0x1bc86,0x17904,0x17902, // 570 + 0x138b0,0x19c5c,0x179b0,0x13898,0x19c4e,0x17998,0x1bcce,0x1798c,0x13886,0x17986, // 580 + 0x1185c,0x138dc,0x1184e,0x179dc,0x138ce,0x179ce,0x178a0,0x1bc58,0x1de2e,0x17890, // 590 + 0x1bc4c,0x17888,0x1bc46,0x17884,0x17882,0x13858,0x19c2e,0x178d8,0x1384c,0x178cc, // 600 + 0x13846,0x178c6,0x1182e,0x1386e,0x178ee,0x17850,0x1bc2c,0x17848,0x1bc26,0x17844, // 610 + 0x17842,0x1382c,0x1786c,0x13826,0x17866,0x17828,0x1bc16,0x17824,0x17822,0x13816, // 620 + 0x17836,0x10578,0x182be,0x1053c,0x1051e,0x105be,0x10d70,0x186bc,0x10d38,0x1869e, // 630 + 0x10d1c,0x10d0e,0x104bc,0x10dbc,0x1049e,0x10d9e,0x11d60,0x18eb8,0x1c75e,0x11d30, // 640 + 0x18e9c,0x11d18,0x18e8e,0x11d0c,0x11d06,0x10cb8,0x1865e,0x11db8,0x10c9c,0x11d9c, // 650 + 0x10c8e,0x11d8e,0x1045e,0x10cde,0x11dde,0x13d40,0x19eb0,0x1cf5c,0x13d20,0x19e98, // 660 + 0x1cf4e,0x13d10,0x19e8c,0x13d08,0x19e86,0x13d04,0x13d02,0x11cb0,0x18e5c,0x13db0, // 670 + 0x11c98,0x18e4e,0x13d98,0x19ece,0x13d8c,0x11c86,0x13d86,0x10c5c,0x11cdc,0x10c4e, // 680 + 0x13ddc,0x11cce,0x13dce,0x1bea0,0x1df58,0x1efae,0x1be90,0x1df4c,0x1be88,0x1df46, // 690 + 0x1be84,0x1be82,0x13ca0,0x19e58,0x1cf2e,0x17da0,0x13c90,0x19e4c,0x17d90,0x1becc, // 700 + 0x19e46,0x17d88,0x13c84,0x17d84,0x13c82,0x17d82,0x11c58,0x18e2e,0x13cd8,0x11c4c, // 710 + 0x17dd8,0x13ccc,0x11c46,0x17dcc,0x13cc6,0x17dc6,0x10c2e,0x11c6e,0x13cee,0x17dee, // 720 + 0x1be50,0x1df2c,0x1be48,0x1df26,0x1be44,0x1be42,0x13c50,0x19e2c,0x17cd0,0x13c48, // 730 + 0x19e26,0x17cc8,0x1be66,0x17cc4,0x13c42,0x17cc2,0x11c2c,0x13c6c,0x11c26,0x17cec, // 740 + 0x13c66,0x17ce6,0x1be28,0x1df16,0x1be24,0x1be22,0x13c28,0x19e16,0x17c68,0x13c24, // 750 + 0x17c64,0x13c22,0x17c62,0x11c16,0x13c36,0x17c76,0x1be14,0x1be12,0x13c14,0x17c34, // 760 + 0x13c12,0x17c32,0x102bc,0x1029e,0x106b8,0x1835e,0x1069c,0x1068e,0x1025e,0x106de, // 770 + 0x10eb0,0x1875c,0x10e98,0x1874e,0x10e8c,0x10e86,0x1065c,0x10edc,0x1064e,0x10ece, // 780 + 0x11ea0,0x18f58,0x1c7ae,0x11e90,0x18f4c,0x11e88,0x18f46,0x11e84,0x11e82,0x10e58, // 790 + 0x1872e,0x11ed8,0x18f6e,0x11ecc,0x10e46,0x11ec6,0x1062e,0x10e6e,0x11eee,0x19f50, // 800 + 0x1cfac,0x19f48,0x1cfa6,0x19f44,0x19f42,0x11e50,0x18f2c,0x13ed0,0x19f6c,0x18f26, // 810 + 0x13ec8,0x11e44,0x13ec4,0x11e42,0x13ec2,0x10e2c,0x11e6c,0x10e26,0x13eec,0x11e66, // 820 + 0x13ee6,0x1dfa8,0x1efd6,0x1dfa4,0x1dfa2,0x19f28,0x1cf96,0x1bf68,0x19f24,0x1bf64, // 830 + 0x19f22,0x1bf62,0x11e28,0x18f16,0x13e68,0x11e24,0x17ee8,0x13e64,0x11e22,0x17ee4, // 840 + 0x13e62,0x17ee2,0x10e16,0x11e36,0x13e76,0x17ef6,0x1df94,0x1df92,0x19f14,0x1bf34, // 850 + 0x19f12,0x1bf32,0x11e14,0x13e34,0x11e12,0x17e74,0x13e32,0x17e72,0x1df8a,0x19f0a, // 860 + 0x1bf1a,0x11e0a,0x13e1a,0x17e3a,0x1035c,0x1034e,0x10758,0x183ae,0x1074c,0x10746, // 870 + 0x1032e,0x1076e,0x10f50,0x187ac,0x10f48,0x187a6,0x10f44,0x10f42,0x1072c,0x10f6c, // 880 + 0x10726,0x10f66,0x18fa8,0x1c7d6,0x18fa4,0x18fa2,0x10f28,0x18796,0x11f68,0x18fb6, // 890 + 0x11f64,0x10f22,0x11f62,0x10716,0x10f36,0x11f76,0x1cfd4,0x1cfd2,0x18f94,0x19fb4, // 900 + 0x18f92,0x19fb2,0x10f14,0x11f34,0x10f12,0x13f74,0x11f32,0x13f72,0x1cfca,0x18f8a, // 910 + 0x19f9a,0x10f0a,0x11f1a,0x13f3a,0x103ac,0x103a6,0x107a8,0x183d6,0x107a4,0x107a2, // 920 + 0x10396,0x107b6,0x187d4,0x187d2,0x10794,0x10fb4,0x10792,0x10fb2,0x1c7ea) // 929 + ); // end of $clusters array + + /** + * Array of factors of the Reed-Solomon polynomial equations used for error correction; one sub array for each correction level (0-8). + * @protected + */ + protected $rsfactors = array( + array( // ECL 0 (2 factors) ------------------------------------------------------------------------------- + 0x01b,0x395), // 2 + array( // ECL 1 (4 factors) ------------------------------------------------------------------------------- + 0x20a,0x238,0x2d3,0x329), // 4 + array( // ECL 2 (8 factors) ------------------------------------------------------------------------------- + 0x0ed,0x134,0x1b4,0x11c,0x286,0x28d,0x1ac,0x17b), // 8 + array( // ECL 3 (16 factors) ------------------------------------------------------------------------------ + 0x112,0x232,0x0e8,0x2f3,0x257,0x20c,0x321,0x084,0x127,0x074,0x1ba,0x1ac,0x127,0x02a,0x0b0,0x041),// 16 + array( // ECL 4 (32 factors) ------------------------------------------------------------------------------ + 0x169,0x23f,0x39a,0x20d,0x0b0,0x24a,0x280,0x141,0x218,0x2e6,0x2a5,0x2e6,0x2af,0x11c,0x0c1,0x205, // 16 + 0x111,0x1ee,0x107,0x093,0x251,0x320,0x23b,0x140,0x323,0x085,0x0e7,0x186,0x2ad,0x14a,0x03f,0x19a),// 32 + array( // ECL 5 (64 factors) ------------------------------------------------------------------------------ + 0x21b,0x1a6,0x006,0x05d,0x35e,0x303,0x1c5,0x06a,0x262,0x11f,0x06b,0x1f9,0x2dd,0x36d,0x17d,0x264, // 16 + 0x2d3,0x1dc,0x1ce,0x0ac,0x1ae,0x261,0x35a,0x336,0x21f,0x178,0x1ff,0x190,0x2a0,0x2fa,0x11b,0x0b8, // 32 + 0x1b8,0x023,0x207,0x01f,0x1cc,0x252,0x0e1,0x217,0x205,0x160,0x25d,0x09e,0x28b,0x0c9,0x1e8,0x1f6, // 48 + 0x288,0x2dd,0x2cd,0x053,0x194,0x061,0x118,0x303,0x348,0x275,0x004,0x17d,0x34b,0x26f,0x108,0x21f),// 64 + array( // ECL 6 (128 factors) ----------------------------------------------------------------------------- + 0x209,0x136,0x360,0x223,0x35a,0x244,0x128,0x17b,0x035,0x30b,0x381,0x1bc,0x190,0x39d,0x2ed,0x19f, // 16 + 0x336,0x05d,0x0d9,0x0d0,0x3a0,0x0f4,0x247,0x26c,0x0f6,0x094,0x1bf,0x277,0x124,0x38c,0x1ea,0x2c0, // 32 + 0x204,0x102,0x1c9,0x38b,0x252,0x2d3,0x2a2,0x124,0x110,0x060,0x2ac,0x1b0,0x2ae,0x25e,0x35c,0x239, // 48 + 0x0c1,0x0db,0x081,0x0ba,0x0ec,0x11f,0x0c0,0x307,0x116,0x0ad,0x028,0x17b,0x2c8,0x1cf,0x286,0x308, // 64 + 0x0ab,0x1eb,0x129,0x2fb,0x09c,0x2dc,0x05f,0x10e,0x1bf,0x05a,0x1fb,0x030,0x0e4,0x335,0x328,0x382, // 80 + 0x310,0x297,0x273,0x17a,0x17e,0x106,0x17c,0x25a,0x2f2,0x150,0x059,0x266,0x057,0x1b0,0x29e,0x268, // 96 + 0x09d,0x176,0x0f2,0x2d6,0x258,0x10d,0x177,0x382,0x34d,0x1c6,0x162,0x082,0x32e,0x24b,0x324,0x022, // 112 + 0x0d3,0x14a,0x21b,0x129,0x33b,0x361,0x025,0x205,0x342,0x13b,0x226,0x056,0x321,0x004,0x06c,0x21b),// 128 + array( // ECL 7 (256 factors) ----------------------------------------------------------------------------- + 0x20c,0x37e,0x04b,0x2fe,0x372,0x359,0x04a,0x0cc,0x052,0x24a,0x2c4,0x0fa,0x389,0x312,0x08a,0x2d0, // 16 + 0x35a,0x0c2,0x137,0x391,0x113,0x0be,0x177,0x352,0x1b6,0x2dd,0x0c2,0x118,0x0c9,0x118,0x33c,0x2f5, // 32 + 0x2c6,0x32e,0x397,0x059,0x044,0x239,0x00b,0x0cc,0x31c,0x25d,0x21c,0x391,0x321,0x2bc,0x31f,0x089, // 48 + 0x1b7,0x1a2,0x250,0x29c,0x161,0x35b,0x172,0x2b6,0x145,0x0f0,0x0d8,0x101,0x11c,0x225,0x0d1,0x374, // 64 + 0x13b,0x046,0x149,0x319,0x1ea,0x112,0x36d,0x0a2,0x2ed,0x32c,0x2ac,0x1cd,0x14e,0x178,0x351,0x209, // 80 + 0x133,0x123,0x323,0x2c8,0x013,0x166,0x18f,0x38c,0x067,0x1ff,0x033,0x008,0x205,0x0e1,0x121,0x1d6, // 96 + 0x27d,0x2db,0x042,0x0ff,0x395,0x10d,0x1cf,0x33e,0x2da,0x1b1,0x350,0x249,0x088,0x21a,0x38a,0x05a, // 112 + 0x002,0x122,0x2e7,0x0c7,0x28f,0x387,0x149,0x031,0x322,0x244,0x163,0x24c,0x0bc,0x1ce,0x00a,0x086, // 128 + 0x274,0x140,0x1df,0x082,0x2e3,0x047,0x107,0x13e,0x176,0x259,0x0c0,0x25d,0x08e,0x2a1,0x2af,0x0ea, // 144 + 0x2d2,0x180,0x0b1,0x2f0,0x25f,0x280,0x1c7,0x0c1,0x2b1,0x2c3,0x325,0x281,0x030,0x03c,0x2dc,0x26d, // 160 + 0x37f,0x220,0x105,0x354,0x28f,0x135,0x2b9,0x2f3,0x2f4,0x03c,0x0e7,0x305,0x1b2,0x1a5,0x2d6,0x210, // 176 + 0x1f7,0x076,0x031,0x31b,0x020,0x090,0x1f4,0x0ee,0x344,0x18a,0x118,0x236,0x13f,0x009,0x287,0x226, // 192 + 0x049,0x392,0x156,0x07e,0x020,0x2a9,0x14b,0x318,0x26c,0x03c,0x261,0x1b9,0x0b4,0x317,0x37d,0x2f2, // 208 + 0x25d,0x17f,0x0e4,0x2ed,0x2f8,0x0d5,0x036,0x129,0x086,0x036,0x342,0x12b,0x39a,0x0bf,0x38e,0x214, // 224 + 0x261,0x33d,0x0bd,0x014,0x0a7,0x01d,0x368,0x1c1,0x053,0x192,0x029,0x290,0x1f9,0x243,0x1e1,0x0ad, // 240 + 0x194,0x0fb,0x2b0,0x05f,0x1f1,0x22b,0x282,0x21f,0x133,0x09f,0x39c,0x22e,0x288,0x037,0x1f1,0x00a),// 256 + array( // ECL 8 (512 factors) ----------------------------------------------------------------------------- + 0x160,0x04d,0x175,0x1f8,0x023,0x257,0x1ac,0x0cf,0x199,0x23e,0x076,0x1f2,0x11d,0x17c,0x15e,0x1ec, // 16 + 0x0c5,0x109,0x398,0x09b,0x392,0x12b,0x0e5,0x283,0x126,0x367,0x132,0x058,0x057,0x0c1,0x160,0x30d, // 32 + 0x34e,0x04b,0x147,0x208,0x1b3,0x21f,0x0cb,0x29a,0x0f9,0x15a,0x30d,0x26d,0x280,0x10c,0x31a,0x216, // 48 + 0x21b,0x30d,0x198,0x186,0x284,0x066,0x1dc,0x1f3,0x122,0x278,0x221,0x025,0x35a,0x394,0x228,0x029, // 64 + 0x21e,0x121,0x07a,0x110,0x17f,0x320,0x1e5,0x062,0x2f0,0x1d8,0x2f9,0x06b,0x310,0x35c,0x292,0x2e5, // 80 + 0x122,0x0cc,0x2a9,0x197,0x357,0x055,0x063,0x03e,0x1e2,0x0b4,0x014,0x129,0x1c3,0x251,0x391,0x08e, // 96 + 0x328,0x2ac,0x11f,0x218,0x231,0x04c,0x28d,0x383,0x2d9,0x237,0x2e8,0x186,0x201,0x0c0,0x204,0x102, // 112 + 0x0f0,0x206,0x31a,0x18b,0x300,0x350,0x033,0x262,0x180,0x0a8,0x0be,0x33a,0x148,0x254,0x312,0x12f, // 128 + 0x23a,0x17d,0x19f,0x281,0x09c,0x0ed,0x097,0x1ad,0x213,0x0cf,0x2a4,0x2c6,0x059,0x0a8,0x130,0x192, // 144 + 0x028,0x2c4,0x23f,0x0a2,0x360,0x0e5,0x041,0x35d,0x349,0x200,0x0a4,0x1dd,0x0dd,0x05c,0x166,0x311, // 160 + 0x120,0x165,0x352,0x344,0x33b,0x2e0,0x2c3,0x05e,0x008,0x1ee,0x072,0x209,0x002,0x1f3,0x353,0x21f, // 176 + 0x098,0x2d9,0x303,0x05f,0x0f8,0x169,0x242,0x143,0x358,0x31d,0x121,0x033,0x2ac,0x1d2,0x215,0x334, // 192 + 0x29d,0x02d,0x386,0x1c4,0x0a7,0x156,0x0f4,0x0ad,0x023,0x1cf,0x28b,0x033,0x2bb,0x24f,0x1c4,0x242, // 208 + 0x025,0x07c,0x12a,0x14c,0x228,0x02b,0x1ab,0x077,0x296,0x309,0x1db,0x352,0x2fc,0x16c,0x242,0x38f, // 224 + 0x11b,0x2c7,0x1d8,0x1a4,0x0f5,0x120,0x252,0x18a,0x1ff,0x147,0x24d,0x309,0x2bb,0x2b0,0x02b,0x198, // 240 + 0x34a,0x17f,0x2d1,0x209,0x230,0x284,0x2ca,0x22f,0x03e,0x091,0x369,0x297,0x2c9,0x09f,0x2a0,0x2d9, // 256 + 0x270,0x03b,0x0c1,0x1a1,0x09e,0x0d1,0x233,0x234,0x157,0x2b5,0x06d,0x260,0x233,0x16d,0x0b5,0x304, // 272 + 0x2a5,0x136,0x0f8,0x161,0x2c4,0x19a,0x243,0x366,0x269,0x349,0x278,0x35c,0x121,0x218,0x023,0x309, // 288 + 0x26a,0x24a,0x1a8,0x341,0x04d,0x255,0x15a,0x10d,0x2f5,0x278,0x2b7,0x2ef,0x14b,0x0f7,0x0b8,0x02d, // 304 + 0x313,0x2a8,0x012,0x042,0x197,0x171,0x036,0x1ec,0x0e4,0x265,0x33e,0x39a,0x1b5,0x207,0x284,0x389, // 320 + 0x315,0x1a4,0x131,0x1b9,0x0cf,0x12c,0x37c,0x33b,0x08d,0x219,0x17d,0x296,0x201,0x038,0x0fc,0x155, // 336 + 0x0f2,0x31d,0x346,0x345,0x2d0,0x0e0,0x133,0x277,0x03d,0x057,0x230,0x136,0x2f4,0x299,0x18d,0x328, // 352 + 0x353,0x135,0x1d9,0x31b,0x17a,0x01f,0x287,0x393,0x1cb,0x326,0x24e,0x2db,0x1a9,0x0d8,0x224,0x0f9, // 368 + 0x141,0x371,0x2bb,0x217,0x2a1,0x30e,0x0d2,0x32f,0x389,0x12f,0x34b,0x39a,0x119,0x049,0x1d5,0x317, // 384 + 0x294,0x0a2,0x1f2,0x134,0x09b,0x1a6,0x38b,0x331,0x0bb,0x03e,0x010,0x1a9,0x217,0x150,0x11e,0x1b5, // 400 + 0x177,0x111,0x262,0x128,0x0b7,0x39b,0x074,0x29b,0x2ef,0x161,0x03e,0x16e,0x2b3,0x17b,0x2af,0x34a, // 416 + 0x025,0x165,0x2d0,0x2e6,0x14a,0x005,0x027,0x39b,0x137,0x1a8,0x0f2,0x2ed,0x141,0x036,0x29d,0x13c, // 432 + 0x156,0x12b,0x216,0x069,0x29b,0x1e8,0x280,0x2a0,0x240,0x21c,0x13c,0x1e6,0x2d1,0x262,0x02e,0x290, // 448 + 0x1bf,0x0ab,0x268,0x1d0,0x0be,0x213,0x129,0x141,0x2fa,0x2f0,0x215,0x0af,0x086,0x00e,0x17d,0x1b1, // 464 + 0x2cd,0x02d,0x06f,0x014,0x254,0x11c,0x2e0,0x08a,0x286,0x19b,0x36d,0x29d,0x08d,0x397,0x02d,0x30c, // 480 + 0x197,0x0a4,0x14c,0x383,0x0a5,0x2d6,0x258,0x145,0x1f2,0x28f,0x165,0x2f0,0x300,0x0df,0x351,0x287, // 496 + 0x03f,0x136,0x35f,0x0fb,0x16e,0x130,0x11a,0x2e2,0x2a3,0x19a,0x185,0x0f4,0x01f,0x079,0x12f,0x107) // 512 + ); + + /** + * This is the class constructor. + * Creates a PDF417 object + * @param string $code code to represent using PDF417 + * @param int $ecl error correction level (0-8); default -1 = automatic correction level + * @param float $aspectratio the width to height of the symbol (excluding quiet zones) + * @param array $macro information for macro block + * @public + */ + public function __construct($code, $ecl=-1, $aspectratio=2, $macro=array()) { + $barcode_array = array(); + if ((is_null($code)) OR ($code == '\0') OR ($code == '')) { + return false; + } + // get the input sequence array + $sequence = $this->getInputSequences($code); + $codewords = array(); // array of code-words + foreach($sequence as $seq) { + $cw = $this->getCompaction($seq[0], $seq[1], true); + $codewords = array_merge($codewords, $cw); + } + if ($codewords[0] == 900) { + // Text Alpha is the default mode, so remove the first code + array_shift($codewords); + } + // count number of codewords + $numcw = count($codewords); + if ($numcw > 925) { + // reached maximum data codeword capacity + return false; + } + // build macro control block codewords + if (!empty($macro)) { + $macrocw = array(); + // beginning of macro control block + $macrocw[] = 928; + // segment index + $cw = $this->getCompaction(902, sprintf('%05d', $macro['segment_index']), false); + $macrocw = array_merge($macrocw, $cw); + // file ID + $cw = $this->getCompaction(900, $macro['file_id'], false); + $macrocw = array_merge($macrocw, $cw); + // optional fields + $optmodes = array(900,902,902,900,900,902,902); + $optsize = array(-1,2,4,-1,-1,-1,2); + foreach ($optmodes as $k => $omode) { + if (isset($macro['option_'.$k])) { + $macrocw[] = 923; + $macrocw[] = $k; + if ($optsize[$k] == 2) { + $macro['option_'.$k] = sprintf('%05d', $macro['option_'.$k]); + } elseif ($optsize[$k] == 4) { + $macro['option_'.$k] = sprintf('%010d', $macro['option_'.$k]); + } + $cw = $this->getCompaction($omode, $macro['option_'.$k], false); + $macrocw = array_merge($macrocw, $cw); + } + } + if ($macro['segment_index'] == ($macro['segment_total'] - 1)) { + // end of control block + $macrocw[] = 922; + } + // update total codewords + $numcw += count($macrocw); + } + // set error correction level + $ecl = $this->getErrorCorrectionLevel($ecl, $numcw); + // number of codewords for error correction + $errsize = (2 << $ecl); + // calculate number of columns (number of codewords per row) and rows + $nce = ($numcw + $errsize + 1); + $cols = round((sqrt(4761 + (68 * $aspectratio * ROWHEIGHT * $nce)) - 69) / 34); + // adjust cols + if ($cols < 1) { + $cols = 1; + } elseif ($cols > 30) { + $cols = 30; + } + $rows = ceil($nce / $cols); + $size = ($cols * $rows); + // adjust rows + if (($rows < 3) OR ($rows > 90)) { + if ($rows < 3) { + $rows = 3; + } elseif ($rows > 90) { + $rows = 90; + } + $cols = ceil($size / $rows); + $size = ($cols * $rows); + } + if ($size > 928) { + // set dimensions to get maximum capacity + if (abs($aspectratio - (17 * 29 / 32)) < abs($aspectratio - (17 * 16 / 58))) { + $cols = 29; + $rows = 32; + } else { + $cols = 16; + $rows = 58; + } + $size = 928; + } + // calculate padding + $pad = ($size - $nce); + if ($pad > 0) { + if (($size - $rows) == $nce) { + --$rows; + $size -= $rows; + } else { + // add pading + $codewords = array_merge($codewords, array_fill(0, $pad, 900)); + } + } + if (!empty($macro)) { + // add macro section + $codewords = array_merge($codewords, $macrocw); + } + // Symbol Length Descriptor (number of data codewords including Symbol Length Descriptor and pad codewords) + $sld = $size - $errsize; + // add symbol length description + array_unshift($codewords, $sld); + // calculate error correction + $ecw = $this->getErrorCorrection($codewords, $ecl); + // add error correction codewords + $codewords = array_merge($codewords, $ecw); + // add horizontal quiet zones to start and stop patterns + $pstart = str_repeat('0', QUIETH).$this->start_pattern; + $pstop = $this->stop_pattern.str_repeat('0', QUIETH); + $barcode_array['num_rows'] = ($rows * ROWHEIGHT) + (2 * QUIETV); + $barcode_array['num_cols'] = (($cols + 2) * 17) + 35 + (2 * QUIETH); + $barcode_array['bcode'] = array(); + // build rows for vertical quiet zone + if (QUIETV > 0) { + $empty_row = array_fill(0, $barcode_array['num_cols'], 0); + for ($i = 0; $i < QUIETV; ++$i) { + // add vertical quiet rows + $barcode_array['bcode'][] = $empty_row; + } + } + $k = 0; // codeword index + $cid = 0; // initial cluster + // for each row + for ($r = 0; $r < $rows; ++$r) { + // row start code + $row = $pstart; + switch ($cid) { + case 0: { + $L = ((30 * intval($r / 3)) + intval(($rows - 1) / 3)); + break; + } + case 1: { + $L = ((30 * intval($r / 3)) + ($ecl * 3) + (($rows - 1) % 3)); + break; + } + case 2: { + $L = ((30 * intval($r / 3)) + ($cols - 1)); + break; + } + } + // left row indicator + $row .= sprintf('%17b', $this->clusters[$cid][$L]); + // for each column + for ($c = 0; $c < $cols; ++$c) { + $row .= sprintf('%17b', $this->clusters[$cid][$codewords[$k]]); + ++$k; + } + switch ($cid) { + case 0: { + $L = ((30 * intval($r / 3)) + ($cols - 1)); + break; + } + case 1: { + $L = ((30 * intval($r / 3)) + intval(($rows - 1) / 3)); + break; + } + case 2: { + $L = ((30 * intval($r / 3)) + ($ecl * 3) + (($rows - 1) % 3)); + break; + } + } + // right row indicator + $row .= sprintf('%17b', $this->clusters[$cid][$L]); + // row stop code + $row .= $pstop; + // convert the string to array + $arow = preg_split('//', $row, -1, PREG_SPLIT_NO_EMPTY); + // duplicate row to get the desired height + for ($h = 0; $h < ROWHEIGHT; ++$h) { + $barcode_array['bcode'][] = $arow; + } + ++$cid; + if ($cid > 2) { + $cid = 0; + } + } + if (QUIETV > 0) { + for ($i = 0; $i < QUIETV; ++$i) { + // add vertical quiet rows + $barcode_array['bcode'][] = $empty_row; + } + } + $this->barcode_array = $barcode_array; + } + + /** + * Returns a barcode array which is readable by TCPDF + * @return array barcode array readable by TCPDF; + * @public + */ + public function getBarcodeArray() { + return $this->barcode_array; + } + + /** + * Returns the error correction level (0-8) to be used + * @param int $ecl error correction level + * @param int $numcw number of data codewords + * @return int error correction level + * @protected + */ + protected function getErrorCorrectionLevel($ecl, $numcw) { + $maxecl = 8; // starting error level + // check for automatic levels + if (($ecl < 0) OR ($ecl > 8)) { + if ($numcw < 41) { + $ecl = 2; + } elseif ($numcw < 161) { + $ecl = 3; + } elseif ($numcw < 321) { + $ecl = 4; + } elseif ($numcw < 864) { + $ecl = 5; + } else { + $ecl = $maxecl; + } + } + // get maximum correction level + $maxerrsize = (928 - $numcw); // available codewords for error + while ($maxecl > 0) { + $errsize = (2 << $ecl); + if ($maxerrsize >= $errsize) { + break; + } + --$maxecl; + } + if ($ecl > $maxecl) { + $ecl = $maxecl; + } + return $ecl; + } + + /** + * Returns the error correction codewords + * @param array $cw array of codewords including Symbol Length Descriptor and pad + * @param int $ecl error correction level 0-8 + * @return array of error correction codewords + * @protected + */ + protected function getErrorCorrection($cw, $ecl) { + // get error correction coefficients + $ecc = $this->rsfactors[$ecl]; + // number of error correction factors + $eclsize = (2 << $ecl); + // maximum index for $rsfactors[$ecl] + $eclmaxid = ($eclsize - 1); + // initialize array of error correction codewords + $ecw = array_fill(0, $eclsize, 0); + // for each data codeword + foreach($cw as $k => $d) { + $t1 = ($d + $ecw[$eclmaxid]) % 929; + for ($j = $eclmaxid; $j > 0; --$j) { + $t2 = ($t1 * $ecc[$j]) % 929; + $t3 = 929 - $t2; + $ecw[$j] = ($ecw[($j - 1)] + $t3) % 929; + } + $t2 = ($t1 * $ecc[0]) % 929; + $t3 = 929 - $t2; + $ecw[0] = $t3 % 929; + } + foreach($ecw as $j => $e) { + if ($e != 0) { + $ecw[$j] = 929 - $e; + } + } + $ecw = array_reverse($ecw); + return $ecw; + } + + /** + * Create array of sequences from input + * @param string $code code + * @return array bi-dimensional array containing characters and classification + * @protected + */ + protected function getInputSequences($code) { + $sequence_array = array(); // array to be returned + $numseq = array(); + // get numeric sequences + preg_match_all('/([0-9]{13,44})/', $code, $numseq, PREG_OFFSET_CAPTURE); + $numseq[1][] = array('', strlen($code)); + $offset = 0; + foreach($numseq[1] as $seq) { + $seqlen = strlen($seq[0]); + if ($seq[1] > 0) { + // extract text sequence before the number sequence + $prevseq = substr($code, $offset, ($seq[1] - $offset)); + $textseq = array(); + // get text sequences + preg_match_all('/([\x09\x0a\x0d\x20-\x7e]{5,})/', $prevseq, $textseq, PREG_OFFSET_CAPTURE); + $textseq[1][] = array('', strlen($prevseq)); + $txtoffset = 0; + foreach($textseq[1] as $txtseq) { + $txtseqlen = strlen($txtseq[0]); + if ($txtseq[1] > 0) { + // extract byte sequence before the text sequence + $prevtxtseq = substr($prevseq, $txtoffset, ($txtseq[1] - $txtoffset)); + if (strlen($prevtxtseq) > 0) { + // add BYTE sequence + if ((strlen($prevtxtseq) == 1) AND ((count($sequence_array) > 0) AND ($sequence_array[(count($sequence_array) - 1)][0] == 900))) { + $sequence_array[] = array(913, $prevtxtseq); + } elseif ((strlen($prevtxtseq) % 6) == 0) { + $sequence_array[] = array(924, $prevtxtseq); + } else { + $sequence_array[] = array(901, $prevtxtseq); + } + } + } + if ($txtseqlen > 0) { + // add numeric sequence + $sequence_array[] = array(900, $txtseq[0]); + } + $txtoffset = $txtseq[1] + $txtseqlen; + } + } + if ($seqlen > 0) { + // add numeric sequence + $sequence_array[] = array(902, $seq[0]); + } + $offset = $seq[1] + $seqlen; + } + return $sequence_array; + } + + /** + * Compact data by mode. + * @param int $mode compaction mode number + * @param string $code data to compact + * @param boolean $addmode if true add the mode codeword at first position + * @return array of codewords + * @protected + */ + protected function getCompaction($mode, $code, $addmode=true) { + $cw = array(); // array of codewords to return + switch($mode) { + case 900: { // Text Compaction mode latch + $submode = 0; // default Alpha sub-mode + $txtarr = array(); // array of characters and sub-mode switching characters + $codelen = strlen($code); + for ($i = 0; $i < $codelen; ++$i) { + $chval = ord($code[$i]); + if (($k = array_search($chval, $this->textsubmodes[$submode])) !== false) { + // we are on the same sub-mode + $txtarr[] = $k; + } else { + // the sub-mode is changed + for ($s = 0; $s < 4; ++$s) { + // search new sub-mode + if (($s != $submode) AND (($k = array_search($chval, $this->textsubmodes[$s])) !== false)) { + // $s is the new submode + if (((($i + 1) == $codelen) OR ((($i + 1) < $codelen) AND (array_search(ord($code[($i + 1)]), $this->textsubmodes[$submode]) !== false))) AND (($s == 3) OR (($s == 0) AND ($submode == 1)))) { + // shift (temporary change only for this char) + if ($s == 3) { + // shift to puntuaction + $txtarr[] = 29; + } else { + // shift from lower to alpha + $txtarr[] = 27; + } + } else { + // latch + $txtarr = array_merge($txtarr, $this->textlatch[''.$submode.$s]); + // set new submode + $submode = $s; + } + // add characted code to array + $txtarr[] = $k; + break; + } + } + } + } + $txtarrlen = count($txtarr); + if (($txtarrlen % 2) != 0) { + // add padding + $txtarr[] = 29; + ++$txtarrlen; + } + // calculate codewords + for ($i = 0; $i < $txtarrlen; $i += 2) { + $cw[] = (30 * $txtarr[$i]) + $txtarr[($i + 1)]; + } + break; + } + case 901: + case 924: { // Byte Compaction mode latch + while (($codelen = strlen($code)) > 0) { + if ($codelen > 6) { + $rest = substr($code, 6); + $code = substr($code, 0, 6); + $sublen = 6; + } else { + $rest = ''; + $sublen = strlen($code); + } + if ($sublen == 6) { + $t = bcmul(''.ord($code[0]), '1099511627776'); + $t = bcadd($t, bcmul(''.ord($code[1]), '4294967296')); + $t = bcadd($t, bcmul(''.ord($code[2]), '16777216')); + $t = bcadd($t, bcmul(''.ord($code[3]), '65536')); + $t = bcadd($t, bcmul(''.ord($code[4]), '256')); + $t = bcadd($t, ''.ord($code[5])); + // tmp array for the 6 bytes block + $cw6 = array(); + do { + $d = bcmod($t, '900', 0); + $t = bcdiv($t, '900', 0); + // prepend the value to the beginning of the array + array_unshift($cw6, $d); + } while ($t != '0'); + // append the result array at the end + $cw = array_merge($cw, $cw6); + } else { + for ($i = 0; $i < $sublen; ++$i) { + $cw[] = ord($code[$i]); + } + } + $code = $rest; + } + break; + } + case 902: { // Numeric Compaction mode latch + while (($codelen = strlen($code)) > 0) { + if ($codelen > 44) { + $rest = substr($code, 44); + $code = substr($code, 0, 44); + } else { + $rest = ''; + } + $t = '1'.$code; + do { + $d = bcmod($t, '900', 0); + $t = bcdiv($t, '900', 0); + array_unshift($cw, $d); + } while ($t != '0'); + $code = $rest; + } + break; + } + case 913: { // Byte Compaction mode shift + $cw[] = ord($code); + break; + } + } + if ($addmode) { + // add the compaction mode codeword at the beginning + array_unshift($cw, $mode); + } + return $cw; + } + +} // end PDF417 class + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/qrcode.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/qrcode.php new file mode 100755 index 0000000..322cace --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/barcodes/qrcode.php @@ -0,0 +1,2842 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// DESCRIPTION : +// +// Class to create QR-code arrays for TCPDF class. +// QR Code symbol is a 2D barcode that can be scanned by +// handy terminals such as a mobile phone with CCD. +// The capacity of QR Code is up to 7000 digits or 4000 +// characters, and has high robustness. +// This class supports QR Code model 2, described in +// JIS (Japanese Industrial Standards) X0510:2004 +// or ISO/IEC 18004. +// Currently the following features are not supported: +// ECI and FNC1 mode, Micro QR Code, QR Code model 1, +// Structured mode. +// +// This class is derived from the following projects: +// --------------------------------------------------------- +// "PHP QR Code encoder" +// License: GNU-LGPLv3 +// Copyright (C) 2010 by Dominik Dzienia +// http://phpqrcode.sourceforge.net/ +// https://sourceforge.net/projects/phpqrcode/ +// +// The "PHP QR Code encoder" is based on +// "C libqrencode library" (ver. 3.1.1) +// License: GNU-LGPL 2.1 +// Copyright (C) 2006-2010 by Kentaro Fukuchi +// http://megaui.net/fukuchi/works/qrencode/index.en.html +// +// Reed-Solomon code encoder is written by Phil Karn, KA9Q. +// Copyright (C) 2002-2006 Phil Karn, KA9Q +// +// QR Code is registered trademark of DENSO WAVE INCORPORATED +// http://www.denso-wave.com/qrcode/index-e.html +// --------------------------------------------------------- +//============================================================+ + +/** + * @file + * Class to create QR-code arrays for TCPDF class. + * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD. + * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness. + * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. + * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode. + * + * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html). + * Please read comments on this class source file for full copyright and license information. + * + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.010 + */ + +// definitions +if (!defined('QRCODEDEFS')) { + + /** + * Indicate that definitions for this class are set + */ + define('QRCODEDEFS', true); + + // ----------------------------------------------------- + + // Encoding modes (characters which can be encoded in QRcode) + + /** + * Encoding mode + */ + define('QR_MODE_NL', -1); + + /** + * Encoding mode numeric (0-9). 3 characters are encoded to 10bit length. In theory, 7089 characters or less can be stored in a QRcode. + */ + define('QR_MODE_NM', 0); + + /** + * Encoding mode alphanumeric (0-9A-Z $%*+-./:) 45characters. 2 characters are encoded to 11bit length. In theory, 4296 characters or less can be stored in a QRcode. + */ + define('QR_MODE_AN', 1); + + /** + * Encoding mode 8bit byte data. In theory, 2953 characters or less can be stored in a QRcode. + */ + define('QR_MODE_8B', 2); + + /** + * Encoding mode KANJI. A KANJI character (multibyte character) is encoded to 13bit length. In theory, 1817 characters or less can be stored in a QRcode. + */ + define('QR_MODE_KJ', 3); + + /** + * Encoding mode STRUCTURED (currently unsupported) + */ + define('QR_MODE_ST', 4); + + // ----------------------------------------------------- + + // Levels of error correction. + // QRcode has a function of an error correcting for miss reading that white is black. + // Error correcting is defined in 4 level as below. + + /** + * Error correction level L : About 7% or less errors can be corrected. + */ + define('QR_ECLEVEL_L', 0); + + /** + * Error correction level M : About 15% or less errors can be corrected. + */ + define('QR_ECLEVEL_M', 1); + + /** + * Error correction level Q : About 25% or less errors can be corrected. + */ + define('QR_ECLEVEL_Q', 2); + + /** + * Error correction level H : About 30% or less errors can be corrected. + */ + define('QR_ECLEVEL_H', 3); + + // ----------------------------------------------------- + + // Version. Size of QRcode is defined as version. + // Version is from 1 to 40. + // Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. + // So version 40 is 177*177 matrix. + + /** + * Maximum QR Code version. + */ + define('QRSPEC_VERSION_MAX', 40); + + /** + * Maximum matrix size for maximum version (version 40 is 177*177 matrix). + */ + define('QRSPEC_WIDTH_MAX', 177); + + // ----------------------------------------------------- + + /** + * Matrix index to get width from $capacity array. + */ + define('QRCAP_WIDTH', 0); + + /** + * Matrix index to get number of words from $capacity array. + */ + define('QRCAP_WORDS', 1); + + /** + * Matrix index to get remainder from $capacity array. + */ + define('QRCAP_REMINDER', 2); + + /** + * Matrix index to get error correction level from $capacity array. + */ + define('QRCAP_EC', 3); + + // ----------------------------------------------------- + + // Structure (currently usupported) + + /** + * Number of header bits for structured mode + */ + define('STRUCTURE_HEADER_BITS', 20); + + /** + * Max number of symbols for structured mode + */ + define('MAX_STRUCTURED_SYMBOLS', 16); + + // ----------------------------------------------------- + + // Masks + + /** + * Down point base value for case 1 mask pattern (concatenation of same color in a line or a column) + */ + define('N1', 3); + + /** + * Down point base value for case 2 mask pattern (module block of same color) + */ + define('N2', 3); + + /** + * Down point base value for case 3 mask pattern (1:1:3:1:1(dark:bright:dark:bright:dark)pattern in a line or a column) + */ + define('N3', 40); + + /** + * Down point base value for case 4 mask pattern (ration of dark modules in whole) + */ + define('N4', 10); + + // ----------------------------------------------------- + + // Optimization settings + + /** + * if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code + */ + define('QR_FIND_BEST_MASK', true); + + /** + * if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly + */ + define('QR_FIND_FROM_RANDOM', 2); + + /** + * when QR_FIND_BEST_MASK === false + */ + define('QR_DEFAULT_MASK', 2); + + // ----------------------------------------------------- + +} // end of definitions + +/** + * @class QRcode + * Class to create QR-code arrays for TCPDF class. + * QR Code symbol is a 2D barcode that can be scanned by handy terminals such as a mobile phone with CCD. + * The capacity of QR Code is up to 7000 digits or 4000 characters, and has high robustness. + * This class supports QR Code model 2, described in JIS (Japanese Industrial Standards) X0510:2004 or ISO/IEC 18004. + * Currently the following features are not supported: ECI and FNC1 mode, Micro QR Code, QR Code model 1, Structured mode. + * + * This class is derived from "PHP QR Code encoder" by Dominik Dzienia (http://phpqrcode.sourceforge.net/) based on "libqrencode C library 3.1.1." by Kentaro Fukuchi (http://megaui.net/fukuchi/works/qrencode/index.en.html), contains Reed-Solomon code written by Phil Karn, KA9Q. QR Code is registered trademark of DENSO WAVE INCORPORATED (http://www.denso-wave.com/qrcode/index-e.html). + * Please read comments on this class source file for full copyright and license information. + * + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.010 + */ +class QRcode { + + /** + * Barcode array to be returned which is readable by TCPDF. + * @protected + */ + protected $barcode_array = array(); + + /** + * QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix. + * @protected + */ + protected $version = 0; + + /** + * Levels of error correction. See definitions for possible values. + * @protected + */ + protected $level = QR_ECLEVEL_L; + + /** + * Encoding mode. + * @protected + */ + protected $hint = QR_MODE_8B; + + /** + * Boolean flag, if true the input string will be converted to uppercase. + * @protected + */ + protected $casesensitive = true; + + /** + * Structured QR code (not supported yet). + * @protected + */ + protected $structured = 0; + + /** + * Mask data. + * @protected + */ + protected $data; + + // FrameFiller + + /** + * Width. + * @protected + */ + protected $width; + + /** + * Frame. + * @protected + */ + protected $frame; + + /** + * X position of bit. + * @protected + */ + protected $x; + + /** + * Y position of bit. + * @protected + */ + protected $y; + + /** + * Direction. + * @protected + */ + protected $dir; + + /** + * Single bit value. + * @protected + */ + protected $bit; + + // ---- QRrawcode ---- + + /** + * Data code. + * @protected + */ + protected $datacode = array(); + + /** + * Error correction code. + * @protected + */ + protected $ecccode = array(); + + /** + * Blocks. + * @protected + */ + protected $blocks; + + /** + * Reed-Solomon blocks. + * @protected + */ + protected $rsblocks = array(); //of RSblock + + /** + * Counter. + * @protected + */ + protected $count; + + /** + * Data length. + * @protected + */ + protected $dataLength; + + /** + * Error correction length. + * @protected + */ + protected $eccLength; + + /** + * Value b1. + * @protected + */ + protected $b1; + + // ---- QRmask ---- + + /** + * Run length. + * @protected + */ + protected $runLength = array(); + + // ---- QRsplit ---- + + /** + * Input data string. + * @protected + */ + protected $dataStr = ''; + + /** + * Input items. + * @protected + */ + protected $items; + + // Reed-Solomon items + + /** + * Reed-Solomon items. + * @protected + */ + protected $rsitems = array(); + + /** + * Array of frames. + * @protected + */ + protected $frames = array(); + + /** + * Alphabet-numeric convesion table. + * @protected + */ + protected $anTable = array( + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // + 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, // + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, // + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, // + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, // + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 // + ); + + /** + * Array Table of the capacity of symbols. + * See Table 1 (pp.13) and Table 12-16 (pp.30-36), JIS X0510:2004. + * @protected + */ + protected $capacity = array( + array( 0, 0, 0, array( 0, 0, 0, 0)), // + array( 21, 26, 0, array( 7, 10, 13, 17)), // 1 + array( 25, 44, 7, array( 10, 16, 22, 28)), // + array( 29, 70, 7, array( 15, 26, 36, 44)), // + array( 33, 100, 7, array( 20, 36, 52, 64)), // + array( 37, 134, 7, array( 26, 48, 72, 88)), // 5 + array( 41, 172, 7, array( 36, 64, 96, 112)), // + array( 45, 196, 0, array( 40, 72, 108, 130)), // + array( 49, 242, 0, array( 48, 88, 132, 156)), // + array( 53, 292, 0, array( 60, 110, 160, 192)), // + array( 57, 346, 0, array( 72, 130, 192, 224)), // 10 + array( 61, 404, 0, array( 80, 150, 224, 264)), // + array( 65, 466, 0, array( 96, 176, 260, 308)), // + array( 69, 532, 0, array( 104, 198, 288, 352)), // + array( 73, 581, 3, array( 120, 216, 320, 384)), // + array( 77, 655, 3, array( 132, 240, 360, 432)), // 15 + array( 81, 733, 3, array( 144, 280, 408, 480)), // + array( 85, 815, 3, array( 168, 308, 448, 532)), // + array( 89, 901, 3, array( 180, 338, 504, 588)), // + array( 93, 991, 3, array( 196, 364, 546, 650)), // + array( 97, 1085, 3, array( 224, 416, 600, 700)), // 20 + array(101, 1156, 4, array( 224, 442, 644, 750)), // + array(105, 1258, 4, array( 252, 476, 690, 816)), // + array(109, 1364, 4, array( 270, 504, 750, 900)), // + array(113, 1474, 4, array( 300, 560, 810, 960)), // + array(117, 1588, 4, array( 312, 588, 870, 1050)), // 25 + array(121, 1706, 4, array( 336, 644, 952, 1110)), // + array(125, 1828, 4, array( 360, 700, 1020, 1200)), // + array(129, 1921, 3, array( 390, 728, 1050, 1260)), // + array(133, 2051, 3, array( 420, 784, 1140, 1350)), // + array(137, 2185, 3, array( 450, 812, 1200, 1440)), // 30 + array(141, 2323, 3, array( 480, 868, 1290, 1530)), // + array(145, 2465, 3, array( 510, 924, 1350, 1620)), // + array(149, 2611, 3, array( 540, 980, 1440, 1710)), // + array(153, 2761, 3, array( 570, 1036, 1530, 1800)), // + array(157, 2876, 0, array( 570, 1064, 1590, 1890)), // 35 + array(161, 3034, 0, array( 600, 1120, 1680, 1980)), // + array(165, 3196, 0, array( 630, 1204, 1770, 2100)), // + array(169, 3362, 0, array( 660, 1260, 1860, 2220)), // + array(173, 3532, 0, array( 720, 1316, 1950, 2310)), // + array(177, 3706, 0, array( 750, 1372, 2040, 2430)) // 40 + ); + + /** + * Array Length indicator. + * @protected + */ + protected $lengthTableBits = array( + array(10, 12, 14), + array( 9, 11, 13), + array( 8, 16, 16), + array( 8, 10, 12) + ); + + /** + * Array Table of the error correction code (Reed-Solomon block). + * See Table 12-16 (pp.30-36), JIS X0510:2004. + * @protected + */ + protected $eccTable = array( + array(array( 0, 0), array( 0, 0), array( 0, 0), array( 0, 0)), // + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // 1 + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // + array(array( 1, 0), array( 1, 0), array( 2, 0), array( 2, 0)), // + array(array( 1, 0), array( 2, 0), array( 2, 0), array( 4, 0)), // + array(array( 1, 0), array( 2, 0), array( 2, 2), array( 2, 2)), // 5 + array(array( 2, 0), array( 4, 0), array( 4, 0), array( 4, 0)), // + array(array( 2, 0), array( 4, 0), array( 2, 4), array( 4, 1)), // + array(array( 2, 0), array( 2, 2), array( 4, 2), array( 4, 2)), // + array(array( 2, 0), array( 3, 2), array( 4, 4), array( 4, 4)), // + array(array( 2, 2), array( 4, 1), array( 6, 2), array( 6, 2)), // 10 + array(array( 4, 0), array( 1, 4), array( 4, 4), array( 3, 8)), // + array(array( 2, 2), array( 6, 2), array( 4, 6), array( 7, 4)), // + array(array( 4, 0), array( 8, 1), array( 8, 4), array(12, 4)), // + array(array( 3, 1), array( 4, 5), array(11, 5), array(11, 5)), // + array(array( 5, 1), array( 5, 5), array( 5, 7), array(11, 7)), // 15 + array(array( 5, 1), array( 7, 3), array(15, 2), array( 3, 13)), // + array(array( 1, 5), array(10, 1), array( 1, 15), array( 2, 17)), // + array(array( 5, 1), array( 9, 4), array(17, 1), array( 2, 19)), // + array(array( 3, 4), array( 3, 11), array(17, 4), array( 9, 16)), // + array(array( 3, 5), array( 3, 13), array(15, 5), array(15, 10)), // 20 + array(array( 4, 4), array(17, 0), array(17, 6), array(19, 6)), // + array(array( 2, 7), array(17, 0), array( 7, 16), array(34, 0)), // + array(array( 4, 5), array( 4, 14), array(11, 14), array(16, 14)), // + array(array( 6, 4), array( 6, 14), array(11, 16), array(30, 2)), // + array(array( 8, 4), array( 8, 13), array( 7, 22), array(22, 13)), // 25 + array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), // + array(array( 8, 4), array(22, 3), array( 8, 26), array(12, 28)), // + array(array( 3, 10), array( 3, 23), array( 4, 31), array(11, 31)), // + array(array( 7, 7), array(21, 7), array( 1, 37), array(19, 26)), // + array(array( 5, 10), array(19, 10), array(15, 25), array(23, 25)), // 30 + array(array(13, 3), array( 2, 29), array(42, 1), array(23, 28)), // + array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), // + array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), // + array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), // + array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), // 35 + array(array( 6, 14), array( 6, 34), array(46, 10), array( 2, 64)), // + array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), // + array(array( 4, 18), array(13, 32), array(48, 14), array(42, 32)), // + array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), // + array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)) // 40 + ); + + /** + * Array Positions of alignment patterns. + * This array includes only the second and the third position of the alignment patterns. Rest of them can be calculated from the distance between them. + * See Table 1 in Appendix E (pp.71) of JIS X0510:2004. + * @protected + */ + protected $alignmentPattern = array( + array( 0, 0), + array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5 + array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10 + array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), // 11-15 + array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), // 16-20 + array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), // 21-25 + array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), // 26-30 + array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), // 31-35 + array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58) // 35-40 + ); + + /** + * Array Version information pattern (BCH coded). + * See Table 1 in Appendix D (pp.68) of JIS X0510:2004. + * size: [QRSPEC_VERSION_MAX - 6] + * @protected + */ + protected $versionPattern = array( + 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, // + 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, // + 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, // + 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, // + 0x27541, 0x28c69 + ); + + /** + * Array Format information + * @protected + */ + protected $formatInfo = array( + array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), // + array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), // + array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), // + array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) // + ); + + + // ------------------------------------------------- + // ------------------------------------------------- + + + /** + * This is the class constructor. + * Creates a QRcode object + * @param string $code code to represent using QRcode + * @param string $eclevel error level:
      • L : About 7% or less errors can be corrected.
      • M : About 15% or less errors can be corrected.
      • Q : About 25% or less errors can be corrected.
      • H : About 30% or less errors can be corrected.
      + * @public + * @since 1.0.000 + */ + public function __construct($code, $eclevel = 'L') { + $barcode_array = array(); + if ((is_null($code)) OR ($code == '\0') OR ($code == '')) { + return false; + } + // set error correction level + $this->level = array_search($eclevel, array('L', 'M', 'Q', 'H')); + if ($this->level === false) { + $this->level = QR_ECLEVEL_L; + } + if (($this->hint != QR_MODE_8B) AND ($this->hint != QR_MODE_KJ)) { + return false; + } + if (($this->version < 0) OR ($this->version > QRSPEC_VERSION_MAX)) { + return false; + } + $this->items = array(); + $this->encodeString($code); + if (is_null($this->data)) { + return false; + } + $qrTab = $this->binarize($this->data); + $size = count($qrTab); + $barcode_array['num_rows'] = $size; + $barcode_array['num_cols'] = $size; + $barcode_array['bcode'] = array(); + foreach ($qrTab as $line) { + $arrAdd = array(); + foreach (str_split($line) as $char) { + $arrAdd[] = ($char=='1')?1:0; + } + $barcode_array['bcode'][] = $arrAdd; + } + $this->barcode_array = $barcode_array; + } + + /** + * Returns a barcode array which is readable by TCPDF + * @return array barcode array readable by TCPDF; + * @public + */ + public function getBarcodeArray() { + return $this->barcode_array; + } + + /** + * Convert the frame in binary form + * @param array $frame array to binarize + * @return array frame in binary form + */ + protected function binarize($frame) { + $len = count($frame); + // the frame is square (width = height) + foreach ($frame as &$frameLine) { + for ($i=0; $i<$len; $i++) { + $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0'; + } + } + return $frame; + } + + /** + * Encode the input string to QR code + * @param string $string input string to encode + */ + protected function encodeString($string) { + $this->dataStr = $string; + if (!$this->casesensitive) { + $this->toUpper(); + } + $ret = $this->splitString(); + if ($ret < 0) { + return NULL; + } + $this->encodeMask(-1); + } + + /** + * Encode mask + * @param int $mask masking mode + */ + protected function encodeMask($mask) { + $spec = array(0, 0, 0, 0, 0); + $this->datacode = $this->getByteStream($this->items); + + if (is_null($this->datacode)) { + return NULL; + } + $spec = $this->getEccSpec($this->version, $this->level, $spec); + $this->b1 = $this->rsBlockNum1($spec); + $this->dataLength = $this->rsDataLength($spec); + $this->eccLength = $this->rsEccLength($spec); + $this->ecccode = array_fill(0, $this->eccLength, 0); + $this->blocks = $this->rsBlockNum($spec); + $ret = $this->init($spec); + if ($ret < 0) { + return NULL; + } + $this->count = 0; + $this->width = $this->getWidth($this->version); + $this->frame = $this->newFrame($this->version); + $this->x = $this->width - 1; + $this->y = $this->width - 1; + $this->dir = -1; + $this->bit = -1; + // inteleaved data and ecc codes + for ($i=0; $i < ($this->dataLength + $this->eccLength); $i++) { + $code = $this->getCode(); + $bit = 0x80; + for ($j=0; $j<8; $j++) { + $addr = $this->getNextPosition(); + $this->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); + $bit = $bit >> 1; + } + } + // remainder bits + $j = $this->getRemainder($this->version); + for ($i=0; $i<$j; $i++) { + $addr = $this->getNextPosition(); + $this->setFrameAt($addr, 0x02); + } + // masking + $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0); + if ($mask < 0) { + if (QR_FIND_BEST_MASK) { + $masked = $this->mask($this->width, $this->frame, $this->level); + } else { + $masked = $this->makeMask($this->width, $this->frame, (intval(QR_DEFAULT_MASK) % 8), $this->level); + } + } else { + $masked = $this->makeMask($this->width, $this->frame, $mask, $this->level); + } + if ($masked == NULL) { + return NULL; + } + $this->data = $masked; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // FrameFiller + + /** + * Set frame value at specified position + * @param array $at x,y position + * @param int $val value of the character to set + */ + protected function setFrameAt($at, $val) { + $this->frame[$at['y']][$at['x']] = chr($val); + } + + /** + * Get frame value at specified position + * @param array $at x,y position + * @return value at specified position + */ + protected function getFrameAt($at) { + return ord($this->frame[$at['y']][$at['x']]); + } + + /** + * Return the next frame position + * @return array of x,y coordinates + */ + protected function getNextPosition() { + do { + if ($this->bit == -1) { + $this->bit = 0; + return array('x'=>$this->x, 'y'=>$this->y); + } + $x = $this->x; + $y = $this->y; + $w = $this->width; + if ($this->bit == 0) { + $x--; + $this->bit++; + } else { + $x++; + $y += $this->dir; + $this->bit--; + } + if ($this->dir < 0) { + if ($y < 0) { + $y = 0; + $x -= 2; + $this->dir = 1; + if ($x == 6) { + $x--; + $y = 9; + } + } + } else { + if ($y == $w) { + $y = $w - 1; + $x -= 2; + $this->dir = -1; + if ($x == 6) { + $x--; + $y -= 8; + } + } + } + if (($x < 0) OR ($y < 0)) { + return NULL; + } + $this->x = $x; + $this->y = $y; + } while(ord($this->frame[$y][$x]) & 0x80); + return array('x'=>$x, 'y'=>$y); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRrawcode + + /** + * Initialize code. + * @param array $spec array of ECC specification + * @return int 0 in case of success, -1 in case of error + */ + protected function init($spec) { + $dl = $this->rsDataCodes1($spec); + $el = $this->rsEccCodes1($spec); + $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + $blockNo = 0; + $dataPos = 0; + $eccPos = 0; + $endfor = $this->rsBlockNum1($spec); + for ($i=0; $i < $endfor; ++$i) { + $ecc = array_slice($this->ecccode, $eccPos); + $this->rsblocks[$blockNo] = array(); + $this->rsblocks[$blockNo]['dataLength'] = $dl; + $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos); + $this->rsblocks[$blockNo]['eccLength'] = $el; + $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc); + $this->rsblocks[$blockNo]['ecc'] = $ecc; + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + if ($this->rsBlockNum2($spec) == 0) { + return 0; + } + $dl = $this->rsDataCodes2($spec); + $el = $this->rsEccCodes2($spec); + $rs = $this->init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + if ($rs == NULL) { + return -1; + } + $endfor = $this->rsBlockNum2($spec); + for ($i=0; $i < $endfor; ++$i) { + $ecc = array_slice($this->ecccode, $eccPos); + $this->rsblocks[$blockNo] = array(); + $this->rsblocks[$blockNo]['dataLength'] = $dl; + $this->rsblocks[$blockNo]['data'] = array_slice($this->datacode, $dataPos); + $this->rsblocks[$blockNo]['eccLength'] = $el; + $ecc = $this->encode_rs_char($rs, $this->rsblocks[$blockNo]['data'], $ecc); + $this->rsblocks[$blockNo]['ecc'] = $ecc; + $this->ecccode = array_merge(array_slice($this->ecccode, 0, $eccPos), $ecc); + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + return 0; + } + + /** + * Return Reed-Solomon block code. + * @return array rsblocks + */ + protected function getCode() { + if ($this->count < $this->dataLength) { + $row = $this->count % $this->blocks; + $col = (int)($this->count / $this->blocks); + if ($col >= $this->rsblocks[0]['dataLength']) { + $row += $this->b1; + } + $ret = $this->rsblocks[$row]['data'][$col]; + } elseif ($this->count < $this->dataLength + $this->eccLength) { + $row = ($this->count - $this->dataLength) % $this->blocks; + $col = (int)(($this->count - $this->dataLength) / $this->blocks); + $ret = $this->rsblocks[$row]['ecc'][$col]; + } else { + return 0; + } + $this->count++; + return $ret; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRmask + + /** + * Write Format Information on frame and returns the number of black bits + * @param int $width frame width + * @param array $frame frame + * @param array $mask masking mode + * @param int $level error correction level + * @return int blacks + */ + protected function writeFormatInformation($width, &$frame, $mask, $level) { + $blacks = 0; + $format = $this->getFormatInfo($mask, $level); + for ($i=0; $i<8; ++$i) { + if ($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + $frame[8][$width - 1 - $i] = chr($v); + if ($i < 6) { + $frame[$i][8] = chr($v); + } else { + $frame[$i + 1][8] = chr($v); + } + $format = $format >> 1; + } + for ($i=0; $i<7; ++$i) { + if ($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + $frame[$width - 7 + $i][8] = chr($v); + if ($i == 0) { + $frame[8][7] = chr($v); + } else { + $frame[8][6 - $i] = chr($v); + } + $format = $format >> 1; + } + return $blacks; + } + + /** + * mask0 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask0($x, $y) { + return ($x + $y) & 1; + } + + /** + * mask1 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask1($x, $y) { + return ($y & 1); + } + + /** + * mask2 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask2($x, $y) { + return ($x % 3); + } + + /** + * mask3 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask3($x, $y) { + return ($x + $y) % 3; + } + + /** + * mask4 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask4($x, $y) { + return (((int)($y / 2)) + ((int)($x / 3))) & 1; + } + + /** + * mask5 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask5($x, $y) { + return (($x * $y) & 1) + ($x * $y) % 3; + } + + /** + * mask6 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask6($x, $y) { + return ((($x * $y) & 1) + ($x * $y) % 3) & 1; + } + + /** + * mask7 + * @param int $x X position + * @param int $y Y position + * @return int mask + */ + protected function mask7($x, $y) { + return ((($x * $y) % 3) + (($x + $y) & 1)) & 1; + } + + /** + * Return bitmask + * @param int $maskNo mask number + * @param int $width width + * @param array $frame frame + * @return array bitmask + */ + protected function generateMaskNo($maskNo, $width, $frame) { + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + for ($y=0; $y<$width; ++$y) { + for ($x=0; $x<$width; ++$x) { + if (ord($frame[$y][$x]) & 0x80) { + $bitMask[$y][$x] = 0; + } else { + $maskFunc = call_user_func(array($this, 'mask'.$maskNo), $x, $y); + $bitMask[$y][$x] = ($maskFunc == 0)?1:0; + } + } + } + return $bitMask; + } + + /** + * makeMaskNo + * @param int $maskNo + * @param int $width + * @param int $s + * @param int $d + * @param boolean $maskGenOnly + * @return int b + */ + protected function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly=false) { + $b = 0; + $bitMask = array(); + $bitMask = $this->generateMaskNo($maskNo, $width, $s); + if ($maskGenOnly) { + return; + } + $d = $s; + for ($y=0; $y<$width; ++$y) { + for ($x=0; $x<$width; ++$x) { + if ($bitMask[$y][$x] == 1) { + $d[$y][$x] = chr(ord($s[$y][$x]) ^ ((int)($bitMask[$y][$x]))); + } + $b += (int)(ord($d[$y][$x]) & 1); + } + } + return $b; + } + + /** + * makeMask + * @param int $width + * @param array $frame + * @param int $maskNo + * @param int $level + * @return array mask + */ + protected function makeMask($width, $frame, $maskNo, $level) { + $masked = array_fill(0, $width, str_repeat("\0", $width)); + $this->makeMaskNo($maskNo, $width, $frame, $masked); + $this->writeFormatInformation($width, $masked, $maskNo, $level); + return $masked; + } + + /** + * calcN1N3 + * @param int $length + * @return int demerit + */ + protected function calcN1N3($length) { + $demerit = 0; + for ($i=0; $i<$length; ++$i) { + if ($this->runLength[$i] >= 5) { + $demerit += (N1 + ($this->runLength[$i] - 5)); + } + if ($i & 1) { + if (($i >= 3) AND ($i < ($length-2)) AND ($this->runLength[$i] % 3 == 0)) { + $fact = (int)($this->runLength[$i] / 3); + if (($this->runLength[$i-2] == $fact) + AND ($this->runLength[$i-1] == $fact) + AND ($this->runLength[$i+1] == $fact) + AND ($this->runLength[$i+2] == $fact)) { + if (($this->runLength[$i-3] < 0) OR ($this->runLength[$i-3] >= (4 * $fact))) { + $demerit += N3; + } elseif ((($i+3) >= $length) OR ($this->runLength[$i+3] >= (4 * $fact))) { + $demerit += N3; + } + } + } + } + } + return $demerit; + } + + /** + * evaluateSymbol + * @param int $width + * @param array $frame + * @return int demerit + */ + protected function evaluateSymbol($width, $frame) { + $head = 0; + $demerit = 0; + for ($y=0; $y<$width; ++$y) { + $head = 0; + $this->runLength[0] = 1; + $frameY = $frame[$y]; + if ($y > 0) { + $frameYM = $frame[$y-1]; + } + for ($x=0; $x<$width; ++$x) { + if (($x > 0) AND ($y > 0)) { + $b22 = ord($frameY[$x]) & ord($frameY[$x-1]) & ord($frameYM[$x]) & ord($frameYM[$x-1]); + $w22 = ord($frameY[$x]) | ord($frameY[$x-1]) | ord($frameYM[$x]) | ord($frameYM[$x-1]); + if (($b22 | ($w22 ^ 1)) & 1) { + $demerit += N2; + } + } + if (($x == 0) AND (ord($frameY[$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } elseif ($x > 0) { + if ((ord($frameY[$x]) ^ ord($frameY[$x-1])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + $demerit += $this->calcN1N3($head+1); + } + for ($x=0; $x<$width; ++$x) { + $head = 0; + $this->runLength[0] = 1; + for ($y=0; $y<$width; ++$y) { + if (($y == 0) AND (ord($frame[$y][$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } elseif ($y > 0) { + if ((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + $demerit += $this->calcN1N3($head+1); + } + return $demerit; + } + + /** + * mask + * @param int $width + * @param array $frame + * @param int $level + * @return array best mask + */ + protected function mask($width, $frame, $level) { + $minDemerit = PHP_INT_MAX; + $bestMaskNum = 0; + $bestMask = array(); + $checked_masks = array(0, 1, 2, 3, 4, 5, 6, 7); + if (QR_FIND_FROM_RANDOM !== false) { + $howManuOut = 8 - (QR_FIND_FROM_RANDOM % 9); + for ($i = 0; $i < $howManuOut; ++$i) { + $remPos = rand (0, count($checked_masks)-1); + unset($checked_masks[$remPos]); + $checked_masks = array_values($checked_masks); + } + } + $bestMask = $frame; + foreach ($checked_masks as $i) { + $mask = array_fill(0, $width, str_repeat("\0", $width)); + $demerit = 0; + $blacks = 0; + $blacks = $this->makeMaskNo($i, $width, $frame, $mask); + $blacks += $this->writeFormatInformation($width, $mask, $i, $level); + $blacks = (int)(100 * $blacks / ($width * $width)); + $demerit = (int)((int)(abs($blacks - 50) / 5) * N4); + $demerit += $this->evaluateSymbol($width, $mask); + if ($demerit < $minDemerit) { + $minDemerit = $demerit; + $bestMask = $mask; + $bestMaskNum = $i; + } + } + return $bestMask; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRsplit + + /** + * Return true if the character at specified position is a number + * @param string $str string + * @param int $pos characted position + * @return boolean true of false + */ + protected function isdigitat($str, $pos) { + if ($pos >= strlen($str)) { + return false; + } + return ((ord($str[$pos]) >= ord('0'))&&(ord($str[$pos]) <= ord('9'))); + } + + /** + * Return true if the character at specified position is an alphanumeric character + * @param string $str string + * @param int $pos characted position + * @return boolean true of false + */ + protected function isalnumat($str, $pos) { + if ($pos >= strlen($str)) { + return false; + } + return ($this->lookAnTable(ord($str[$pos])) >= 0); + } + + /** + * identifyMode + * @param int $pos + * @return int mode + */ + protected function identifyMode($pos) { + if ($pos >= strlen($this->dataStr)) { + return QR_MODE_NL; + } + $c = $this->dataStr[$pos]; + if ($this->isdigitat($this->dataStr, $pos)) { + return QR_MODE_NM; + } elseif ($this->isalnumat($this->dataStr, $pos)) { + return QR_MODE_AN; + } elseif ($this->hint == QR_MODE_KJ) { + if ($pos+1 < strlen($this->dataStr)) { + $d = $this->dataStr[$pos+1]; + $word = (ord($c) << 8) | ord($d); + if (($word >= 0x8140 && $word <= 0x9ffc) OR ($word >= 0xe040 && $word <= 0xebbf)) { + return QR_MODE_KJ; + } + } + } + return QR_MODE_8B; + } + + /** + * eatNum + * @return int run + */ + protected function eatNum() { + $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); + $p = 0; + while($this->isdigitat($this->dataStr, $p)) { + $p++; + } + $run = $p; + $mode = $this->identifyMode($p); + if ($mode == QR_MODE_8B) { + $dif = $this->estimateBitsModeNum($run) + 4 + $ln + + $this->estimateBitsMode8(1) // + 4 + l8 + - $this->estimateBitsMode8($run + 1); // - 4 - l8 + if ($dif > 0) { + return $this->eat8(); + } + } + if ($mode == QR_MODE_AN) { + $dif = $this->estimateBitsModeNum($run) + 4 + $ln + + $this->estimateBitsModeAn(1) // + 4 + la + - $this->estimateBitsModeAn($run + 1);// - 4 - la + if ($dif > 0) { + return $this->eatAn(); + } + } + $this->items = $this->appendNewInputItem($this->items, QR_MODE_NM, $run, str_split($this->dataStr)); + return $run; + } + + /** + * eatAn + * @return int run + */ + protected function eatAn() { + $la = $this->lengthIndicator(QR_MODE_AN, $this->version); + $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); + $p =1 ; + while($this->isalnumat($this->dataStr, $p)) { + if ($this->isdigitat($this->dataStr, $p)) { + $q = $p; + while($this->isdigitat($this->dataStr, $q)) { + $q++; + } + $dif = $this->estimateBitsModeAn($p) // + 4 + la + + $this->estimateBitsModeNum($q - $p) + 4 + $ln + - $this->estimateBitsModeAn($q); // - 4 - la + if ($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + $run = $p; + if (!$this->isalnumat($this->dataStr, $p)) { + $dif = $this->estimateBitsModeAn($run) + 4 + $la + + $this->estimateBitsMode8(1) // + 4 + l8 + - $this->estimateBitsMode8($run + 1); // - 4 - l8 + if ($dif > 0) { + return $this->eat8(); + } + } + $this->items = $this->appendNewInputItem($this->items, QR_MODE_AN, $run, str_split($this->dataStr)); + return $run; + } + + /** + * eatKanji + * @return int run + */ + protected function eatKanji() { + $p = 0; + while($this->identifyMode($p) == QR_MODE_KJ) { + $p += 2; + } + $this->items = $this->appendNewInputItem($this->items, QR_MODE_KJ, $p, str_split($this->dataStr)); + $run = $p; + return $run; + } + + /** + * eat8 + * @return int run + */ + protected function eat8() { + $la = $this->lengthIndicator(QR_MODE_AN, $this->version); + $ln = $this->lengthIndicator(QR_MODE_NM, $this->version); + $p = 1; + $dataStrLen = strlen($this->dataStr); + while($p < $dataStrLen) { + $mode = $this->identifyMode($p); + if ($mode == QR_MODE_KJ) { + break; + } + if ($mode == QR_MODE_NM) { + $q = $p; + while($this->isdigitat($this->dataStr, $q)) { + $q++; + } + $dif = $this->estimateBitsMode8($p) // + 4 + l8 + + $this->estimateBitsModeNum($q - $p) + 4 + $ln + - $this->estimateBitsMode8($q); // - 4 - l8 + if ($dif < 0) { + break; + } else { + $p = $q; + } + } elseif ($mode == QR_MODE_AN) { + $q = $p; + while($this->isalnumat($this->dataStr, $q)) { + $q++; + } + $dif = $this->estimateBitsMode8($p) // + 4 + l8 + + $this->estimateBitsModeAn($q - $p) + 4 + $la + - $this->estimateBitsMode8($q); // - 4 - l8 + if ($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + $run = $p; + $this->items = $this->appendNewInputItem($this->items, QR_MODE_8B, $run, str_split($this->dataStr)); + return $run; + } + + /** + * splitString + * @return int + */ + protected function splitString() { + while (strlen($this->dataStr) > 0) { + $mode = $this->identifyMode(0); + switch ($mode) { + case QR_MODE_NM: { + $length = $this->eatNum(); + break; + } + case QR_MODE_AN: { + $length = $this->eatAn(); + break; + } + case QR_MODE_KJ: { + if ($this->hint == QR_MODE_KJ) { + $length = $this->eatKanji(); + } else { + $length = $this->eat8(); + } + break; + } + default: { + $length = $this->eat8(); + break; + } + } + if ($length == 0) { + return 0; + } + if ($length < 0) { + return -1; + } + $this->dataStr = substr($this->dataStr, $length); + } + return 0; + } + + /** + * toUpper + */ + protected function toUpper() { + $stringLen = strlen($this->dataStr); + $p = 0; + while ($p < $stringLen) { + $mode = $this->identifyMode(substr($this->dataStr, $p)); + if ($mode == QR_MODE_KJ) { + $p += 2; + } else { + if ((ord($this->dataStr[$p]) >= ord('a')) AND (ord($this->dataStr[$p]) <= ord('z'))) { + $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32); + } + $p++; + } + } + return $this->dataStr; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRinputItem + + /** + * newInputItem + * @param int $mode + * @param int $size + * @param array $data + * @param array $bstream + * @return array input item + */ + protected function newInputItem($mode, $size, $data, $bstream=null) { + $setData = array_slice($data, 0, $size); + if (count($setData) < $size) { + $setData = array_merge($setData, array_fill(0, ($size - count($setData)), 0)); + } + if (!$this->check($mode, $size, $setData)) { + return NULL; + } + $inputitem = array(); + $inputitem['mode'] = $mode; + $inputitem['size'] = $size; + $inputitem['data'] = $setData; + $inputitem['bstream'] = $bstream; + return $inputitem; + } + + /** + * encodeModeNum + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeModeNum($inputitem, $version) { + $words = (int)($inputitem['size'] / 3); + $inputitem['bstream'] = array(); + $val = 0x1; + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_NM, $version), $inputitem['size']); + for ($i=0; $i < $words; ++$i) { + $val = (ord($inputitem['data'][$i*3 ]) - ord('0')) * 100; + $val += (ord($inputitem['data'][$i*3+1]) - ord('0')) * 10; + $val += (ord($inputitem['data'][$i*3+2]) - ord('0')); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 10, $val); + } + if ($inputitem['size'] - $words * 3 == 1) { + $val = ord($inputitem['data'][$words*3]) - ord('0'); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, $val); + } elseif (($inputitem['size'] - ($words * 3)) == 2) { + $val = (ord($inputitem['data'][$words*3 ]) - ord('0')) * 10; + $val += (ord($inputitem['data'][$words*3+1]) - ord('0')); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 7, $val); + } + return $inputitem; + } + + /** + * encodeModeAn + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeModeAn($inputitem, $version) { + $words = (int)($inputitem['size'] / 2); + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x02); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_AN, $version), $inputitem['size']); + for ($i=0; $i < $words; ++$i) { + $val = (int)($this->lookAnTable(ord($inputitem['data'][$i*2])) * 45); + $val += (int)($this->lookAnTable(ord($inputitem['data'][($i*2)+1]))); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 11, $val); + } + if ($inputitem['size'] & 1) { + $val = $this->lookAnTable(ord($inputitem['data'][($words * 2)])); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 6, $val); + } + return $inputitem; + } + + /** + * encodeMode8 + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeMode8($inputitem, $version) { + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x4); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_8B, $version), $inputitem['size']); + for ($i=0; $i < $inputitem['size']; ++$i) { + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][$i])); + } + return $inputitem; + } + + /** + * encodeModeKanji + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeModeKanji($inputitem, $version) { + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x8); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], $this->lengthIndicator(QR_MODE_KJ, $version), (int)($inputitem['size'] / 2)); + for ($i=0; $i<$inputitem['size']; $i+=2) { + $val = (ord($inputitem['data'][$i]) << 8) | ord($inputitem['data'][$i+1]); + if ($val <= 0x9ffc) { + $val -= 0x8140; + } else { + $val -= 0xc140; + } + $h = ($val >> 8) * 0xc0; + $val = ($val & 0xff) + $h; + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 13, $val); + } + return $inputitem; + } + + /** + * encodeModeStructure + * @param array $inputitem + * @return array input item + */ + protected function encodeModeStructure($inputitem) { + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, 0x03); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][1]) - 1); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 4, ord($inputitem['data'][0]) - 1); + $inputitem['bstream'] = $this->appendNum($inputitem['bstream'], 8, ord($inputitem['data'][2])); + return $inputitem; + } + + /** + * encodeBitStream + * @param array $inputitem + * @param int $version + * @return array input item + */ + protected function encodeBitStream($inputitem, $version) { + $inputitem['bstream'] = array(); + $words = $this->maximumWords($inputitem['mode'], $version); + if ($inputitem['size'] > $words) { + $st1 = $this->newInputItem($inputitem['mode'], $words, $inputitem['data']); + $st2 = $this->newInputItem($inputitem['mode'], $inputitem['size'] - $words, array_slice($inputitem['data'], $words)); + $st1 = $this->encodeBitStream($st1, $version); + $st2 = $this->encodeBitStream($st2, $version); + $inputitem['bstream'] = array(); + $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st1['bstream']); + $inputitem['bstream'] = $this->appendBitstream($inputitem['bstream'], $st2['bstream']); + } else { + switch($inputitem['mode']) { + case QR_MODE_NM: { + $inputitem = $this->encodeModeNum($inputitem, $version); + break; + } + case QR_MODE_AN: { + $inputitem = $this->encodeModeAn($inputitem, $version); + break; + } + case QR_MODE_8B: { + $inputitem = $this->encodeMode8($inputitem, $version); + break; + } + case QR_MODE_KJ: { + $inputitem = $this->encodeModeKanji($inputitem, $version); + break; + } + case QR_MODE_ST: { + $inputitem = $this->encodeModeStructure($inputitem); + break; + } + default: { + break; + } + } + } + return $inputitem; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRinput + + /** + * Append data to an input object. + * The data is copied and appended to the input object. + * @param array $items input items + * @param int $mode encoding mode. + * @param int $size size of data (byte). + * @param array $data array of input data. + * @return array items + * + */ + protected function appendNewInputItem($items, $mode, $size, $data) { + $newitem = $this->newInputItem($mode, $size, $data); + if (!empty($newitem)) { + $items[] = $newitem; + } + return $items; + } + + /** + * insertStructuredAppendHeader + * @param array $items + * @param int $size + * @param int $index + * @param int $parity + * @return array items + */ + protected function insertStructuredAppendHeader($items, $size, $index, $parity) { + if ($size > MAX_STRUCTURED_SYMBOLS) { + return -1; + } + if (($index <= 0) OR ($index > MAX_STRUCTURED_SYMBOLS)) { + return -1; + } + $buf = array($size, $index, $parity); + $entry = $this->newInputItem(QR_MODE_ST, 3, $buf); + array_unshift($items, $entry); + return $items; + } + + /** + * calcParity + * @param array $items + * @return int parity + */ + protected function calcParity($items) { + $parity = 0; + foreach ($items as $item) { + if ($item['mode'] != QR_MODE_ST) { + for ($i=$item['size']-1; $i>=0; --$i) { + $parity ^= $item['data'][$i]; + } + } + } + return $parity; + } + + /** + * checkModeNum + * @param int $size + * @param array $data + * @return boolean true or false + */ + protected function checkModeNum($size, $data) { + for ($i=0; $i<$size; ++$i) { + if ((ord($data[$i]) < ord('0')) OR (ord($data[$i]) > ord('9'))){ + return false; + } + } + return true; + } + + /** + * Look up the alphabet-numeric conversion table (see JIS X0510:2004, pp.19). + * @param int $c character value + * @return int value + */ + protected function lookAnTable($c) { + return (($c > 127)?-1:$this->anTable[$c]); + } + + /** + * checkModeAn + * @param int $size + * @param array $data + * @return boolean true or false + */ + protected function checkModeAn($size, $data) { + for ($i=0; $i<$size; ++$i) { + if ($this->lookAnTable(ord($data[$i])) == -1) { + return false; + } + } + return true; + } + + /** + * estimateBitsModeNum + * @param int $size + * @return int number of bits + */ + protected function estimateBitsModeNum($size) { + $w = (int)($size / 3); + $bits = ($w * 10); + switch($size - ($w * 3)) { + case 1: { + $bits += 4; + break; + } + case 2: { + $bits += 7; + break; + } + } + return $bits; + } + + /** + * estimateBitsModeAn + * @param int $size + * @return int number of bits + */ + protected function estimateBitsModeAn($size) { + $bits = (int)($size * 5.5); // (size / 2 ) * 11 + if ($size & 1) { + $bits += 6; + } + return $bits; + } + + /** + * estimateBitsMode8 + * @param int $size + * @return int number of bits + */ + protected function estimateBitsMode8($size) { + return (int)($size * 8); + } + + /** + * estimateBitsModeKanji + * @param int $size + * @return int number of bits + */ + protected function estimateBitsModeKanji($size) { + return (int)($size * 6.5); // (size / 2 ) * 13 + } + + /** + * checkModeKanji + * @param int $size + * @param array $data + * @return boolean true or false + */ + protected function checkModeKanji($size, $data) { + if ($size & 1) { + return false; + } + for ($i=0; $i<$size; $i+=2) { + $val = (ord($data[$i]) << 8) | ord($data[$i+1]); + if (($val < 0x8140) OR (($val > 0x9ffc) AND ($val < 0xe040)) OR ($val > 0xebbf)) { + return false; + } + } + return true; + } + + /** + * Validate the input data. + * @param int $mode encoding mode. + * @param int $size size of data (byte). + * @param array $data data to validate + * @return boolean true in case of valid data, false otherwise + */ + protected function check($mode, $size, $data) { + if ($size <= 0) { + return false; + } + switch($mode) { + case QR_MODE_NM: { + return $this->checkModeNum($size, $data); + } + case QR_MODE_AN: { + return $this->checkModeAn($size, $data); + } + case QR_MODE_KJ: { + return $this->checkModeKanji($size, $data); + } + case QR_MODE_8B: { + return true; + } + case QR_MODE_ST: { + return true; + } + default: { + break; + } + } + return false; + } + + /** + * estimateBitStreamSize + * @param array $items + * @param int $version + * @return int bits + */ + protected function estimateBitStreamSize($items, $version) { + $bits = 0; + if ($version == 0) { + $version = 1; + } + foreach ($items as $item) { + switch($item['mode']) { + case QR_MODE_NM: { + $bits = $this->estimateBitsModeNum($item['size']); + break; + } + case QR_MODE_AN: { + $bits = $this->estimateBitsModeAn($item['size']); + break; + } + case QR_MODE_8B: { + $bits = $this->estimateBitsMode8($item['size']); + break; + } + case QR_MODE_KJ: { + $bits = $this->estimateBitsModeKanji($item['size']); + break; + } + case QR_MODE_ST: { + return STRUCTURE_HEADER_BITS; + } + default: { + return 0; + } + } + $l = $this->lengthIndicator($item['mode'], $version); + $m = 1 << $l; + $num = (int)(($item['size'] + $m - 1) / $m); + $bits += $num * (4 + $l); + } + return $bits; + } + + /** + * estimateVersion + * @param array $items + * @return int version + */ + protected function estimateVersion($items) { + $version = 0; + $prev = 0; + do { + $prev = $version; + $bits = $this->estimateBitStreamSize($items, $prev); + $version = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if ($version < 0) { + return -1; + } + } while ($version > $prev); + return $version; + } + + /** + * lengthOfCode + * @param int $mode + * @param int $version + * @param int $bits + * @return int size + */ + protected function lengthOfCode($mode, $version, $bits) { + $payload = $bits - 4 - $this->lengthIndicator($mode, $version); + switch($mode) { + case QR_MODE_NM: { + $chunks = (int)($payload / 10); + $remain = $payload - $chunks * 10; + $size = $chunks * 3; + if ($remain >= 7) { + $size += 2; + } elseif ($remain >= 4) { + $size += 1; + } + break; + } + case QR_MODE_AN: { + $chunks = (int)($payload / 11); + $remain = $payload - $chunks * 11; + $size = $chunks * 2; + if ($remain >= 6) { + ++$size; + } + break; + } + case QR_MODE_8B: { + $size = (int)($payload / 8); + break; + } + case QR_MODE_KJ: { + $size = (int)(($payload / 13) * 2); + break; + } + case QR_MODE_ST: { + $size = (int)($payload / 8); + break; + } + default: { + $size = 0; + break; + } + } + $maxsize = $this->maximumWords($mode, $version); + if ($size < 0) { + $size = 0; + } + if ($size > $maxsize) { + $size = $maxsize; + } + return $size; + } + + /** + * createBitStream + * @param array $items + * @return array of items and total bits + */ + protected function createBitStream($items) { + $total = 0; + foreach ($items as $key => $item) { + $items[$key] = $this->encodeBitStream($item, $this->version); + $bits = count($items[$key]['bstream']); + $total += $bits; + } + return array($items, $total); + } + + /** + * convertData + * @param array $items + * @return array items + */ + protected function convertData($items) { + $ver = $this->estimateVersion($items); + if ($ver > $this->version) { + $this->version = $ver; + } + while (true) { + $cbs = $this->createBitStream($items); + $items = $cbs[0]; + $bits = $cbs[1]; + if ($bits < 0) { + return -1; + } + $ver = $this->getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if ($ver < 0) { + return -1; + } elseif ($ver > $this->version) { + $this->version = $ver; + } else { + break; + } + } + return $items; + } + + /** + * Append Padding Bit to bitstream + * @param array $bstream + * @return array bitstream + */ + protected function appendPaddingBit($bstream) { + if (is_null($bstream)) { + return null; + } + $bits = count($bstream); + $maxwords = $this->getDataLength($this->version, $this->level); + $maxbits = $maxwords * 8; + if ($maxbits == $bits) { + return $bstream; + } + if ($maxbits - $bits < 5) { + return $this->appendNum($bstream, $maxbits - $bits, 0); + } + $bits += 4; + $words = (int)(($bits + 7) / 8); + $padding = array(); + $padding = $this->appendNum($padding, $words * 8 - $bits + 4, 0); + $padlen = $maxwords - $words; + if ($padlen > 0) { + $padbuf = array(); + for ($i=0; $i<$padlen; ++$i) { + $padbuf[$i] = ($i&1)?0x11:0xec; + } + $padding = $this->appendBytes($padding, $padlen, $padbuf); + } + return $this->appendBitstream($bstream, $padding); + } + + /** + * mergeBitStream + * @param array $items items + * @return array bitstream + */ + protected function mergeBitStream($items) { + $items = $this->convertData($items); + if (!is_array($items)) { + return null; + } + $bstream = array(); + foreach ($items as $item) { + $bstream = $this->appendBitstream($bstream, $item['bstream']); + } + return $bstream; + } + + /** + * Returns a stream of bits. + * @param int $items + * @return array padded merged byte stream + */ + protected function getBitStream($items) { + $bstream = $this->mergeBitStream($items); + return $this->appendPaddingBit($bstream); + } + + /** + * Pack all bit streams padding bits into a byte array. + * @param int $items + * @return array padded merged byte stream + */ + protected function getByteStream($items) { + $bstream = $this->getBitStream($items); + return $this->bitstreamToByte($bstream); + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRbitstream + + /** + * Return an array with zeros + * @param int $setLength array size + * @return array + */ + protected function allocate($setLength) { + return array_fill(0, $setLength, 0); + } + + /** + * Return new bitstream from number + * @param int $bits number of bits + * @param int $num number + * @return array bitstream + */ + protected function newFromNum($bits, $num) { + $bstream = $this->allocate($bits); + $mask = 1 << ($bits - 1); + for ($i=0; $i<$bits; ++$i) { + if ($num & $mask) { + $bstream[$i] = 1; + } else { + $bstream[$i] = 0; + } + $mask = $mask >> 1; + } + return $bstream; + } + + /** + * Return new bitstream from bytes + * @param int $size size + * @param array $data bytes + * @return array bitstream + */ + protected function newFromBytes($size, $data) { + $bstream = $this->allocate($size * 8); + $p=0; + for ($i=0; $i<$size; ++$i) { + $mask = 0x80; + for ($j=0; $j<8; ++$j) { + if ($data[$i] & $mask) { + $bstream[$p] = 1; + } else { + $bstream[$p] = 0; + } + $p++; + $mask = $mask >> 1; + } + } + return $bstream; + } + + /** + * Append one bitstream to another + * @param array $bitstream original bitstream + * @param array $append bitstream to append + * @return array bitstream + */ + protected function appendBitstream($bitstream, $append) { + if ((!is_array($append)) OR (count($append) == 0)) { + return $bitstream; + } + if (count($bitstream) == 0) { + return $append; + } + return array_values(array_merge($bitstream, $append)); + } + + /** + * Append one bitstream created from number to another + * @param array $bitstream original bitstream + * @param int $bits number of bits + * @param int $num number + * @return array bitstream + */ + protected function appendNum($bitstream, $bits, $num) { + if ($bits == 0) { + return 0; + } + $b = $this->newFromNum($bits, $num); + return $this->appendBitstream($bitstream, $b); + } + + /** + * Append one bitstream created from bytes to another + * @param array $bitstream original bitstream + * @param int $size size + * @param array $data bytes + * @return array bitstream + */ + protected function appendBytes($bitstream, $size, $data) { + if ($size == 0) { + return 0; + } + $b = $this->newFromBytes($size, $data); + return $this->appendBitstream($bitstream, $b); + } + + /** + * Convert bitstream to bytes + * @param array $bstream original bitstream + * @return array of bytes + */ + protected function bitstreamToByte($bstream) { + if (is_null($bstream)) { + return null; + } + $size = count($bstream); + if ($size == 0) { + return array(); + } + $data = array_fill(0, (int)(($size + 7) / 8), 0); + $bytes = (int)($size / 8); + $p = 0; + for ($i=0; $i<$bytes; $i++) { + $v = 0; + for ($j=0; $j<8; $j++) { + $v = $v << 1; + $v |= $bstream[$p]; + $p++; + } + $data[$i] = $v; + } + if ($size & 7) { + $v = 0; + for ($j=0; $j<($size & 7); $j++) { + $v = $v << 1; + $v |= $bstream[$p]; + $p++; + } + $data[$bytes] = $v; + } + return $data; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRspec + + /** + * Replace a value on the array at the specified position + * @param array $srctab + * @param int $x X position + * @param int $y Y position + * @param string $repl value to replace + * @param int $replLen length of the repl string + * @return array srctab + */ + protected function qrstrset($srctab, $x, $y, $repl, $replLen=false) { + $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl)); + return $srctab; + } + + /** + * Return maximum data code length (bytes) for the version. + * @param int $version version + * @param int $level error correction level + * @return int maximum size (bytes) + */ + protected function getDataLength($version, $level) { + return $this->capacity[$version][QRCAP_WORDS] - $this->capacity[$version][QRCAP_EC][$level]; + } + + /** + * Return maximum error correction code length (bytes) for the version. + * @param int $version version + * @param int $level error correction level + * @return int ECC size (bytes) + */ + protected function getECCLength($version, $level){ + return $this->capacity[$version][QRCAP_EC][$level]; + } + + /** + * Return the width of the symbol for the version. + * @param int $version version + * @return int width + */ + protected function getWidth($version) { + return $this->capacity[$version][QRCAP_WIDTH]; + } + + /** + * Return the numer of remainder bits. + * @param int $version version + * @return int number of remainder bits + */ + protected function getRemainder($version) { + return $this->capacity[$version][QRCAP_REMINDER]; + } + + /** + * Return a version number that satisfies the input code length. + * @param int $size input code length (bytes) + * @param int $level error correction level + * @return int version number + */ + protected function getMinimumVersion($size, $level) { + for ($i = 1; $i <= QRSPEC_VERSION_MAX; ++$i) { + $words = ($this->capacity[$i][QRCAP_WORDS] - $this->capacity[$i][QRCAP_EC][$level]); + if ($words >= $size) { + return $i; + } + } + // the size of input data is greater than QR capacity, try to lover the error correction mode + return -1; + } + + /** + * Return the size of length indicator for the mode and version. + * @param int $mode encoding mode + * @param int $version version + * @return int the size of the appropriate length indicator (bits). + */ + protected function lengthIndicator($mode, $version) { + if ($mode == QR_MODE_ST) { + return 0; + } + if ($version <= 9) { + $l = 0; + } elseif ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + return $this->lengthTableBits[$mode][$l]; + } + + /** + * Return the maximum length for the mode and version. + * @param int $mode encoding mode + * @param int $version version + * @return int the maximum length (bytes) + */ + protected function maximumWords($mode, $version) { + if ($mode == QR_MODE_ST) { + return 3; + } + if ($version <= 9) { + $l = 0; + } else if ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + $bits = $this->lengthTableBits[$mode][$l]; + $words = (1 << $bits) - 1; + if ($mode == QR_MODE_KJ) { + $words *= 2; // the number of bytes is required + } + return $words; + } + + /** + * Return an array of ECC specification. + * @param int $version version + * @param int $level error correction level + * @param array $spec an array of ECC specification contains as following: {# of type1 blocks, # of data code, # of ecc code, # of type2 blocks, # of data code} + * @return array spec + */ + protected function getEccSpec($version, $level, $spec) { + if (count($spec) < 5) { + $spec = array(0, 0, 0, 0, 0); + } + $b1 = $this->eccTable[$version][$level][0]; + $b2 = $this->eccTable[$version][$level][1]; + $data = $this->getDataLength($version, $level); + $ecc = $this->getECCLength($version, $level); + if ($b2 == 0) { + $spec[0] = $b1; + $spec[1] = (int)($data / $b1); + $spec[2] = (int)($ecc / $b1); + $spec[3] = 0; + $spec[4] = 0; + } else { + $spec[0] = $b1; + $spec[1] = (int)($data / ($b1 + $b2)); + $spec[2] = (int)($ecc / ($b1 + $b2)); + $spec[3] = $b2; + $spec[4] = $spec[1] + 1; + } + return $spec; + } + + /** + * Put an alignment marker. + * @param array $frame frame + * @param int $ox X center coordinate of the pattern + * @param int $oy Y center coordinate of the pattern + * @return array frame + */ + protected function putAlignmentMarker($frame, $ox, $oy) { + $finder = array( + "\xa1\xa1\xa1\xa1\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa0\xa1\xa0\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa1\xa1\xa1\xa1" + ); + $yStart = $oy - 2; + $xStart = $ox - 2; + for ($y=0; $y < 5; $y++) { + $frame = $this->qrstrset($frame, $xStart, $yStart+$y, $finder[$y]); + } + return $frame; + } + + /** + * Put an alignment pattern. + * @param int $version version + * @param array $frame frame + * @param int $width width + * @return array frame + */ + protected function putAlignmentPattern($version, $frame, $width) { + if ($version < 2) { + return $frame; + } + $d = $this->alignmentPattern[$version][1] - $this->alignmentPattern[$version][0]; + if ($d < 0) { + $w = 2; + } else { + $w = (int)(($width - $this->alignmentPattern[$version][0]) / $d + 2); + } + if ($w * $w - 3 == 1) { + $x = $this->alignmentPattern[$version][0]; + $y = $this->alignmentPattern[$version][0]; + $frame = $this->putAlignmentMarker($frame, $x, $y); + return $frame; + } + $cx = $this->alignmentPattern[$version][0]; + $wo = $w - 1; + for ($x=1; $x < $wo; ++$x) { + $frame = $this->putAlignmentMarker($frame, 6, $cx); + $frame = $this->putAlignmentMarker($frame, $cx, 6); + $cx += $d; + } + $cy = $this->alignmentPattern[$version][0]; + for ($y=0; $y < $wo; ++$y) { + $cx = $this->alignmentPattern[$version][0]; + for ($x=0; $x < $wo; ++$x) { + $frame = $this->putAlignmentMarker($frame, $cx, $cy); + $cx += $d; + } + $cy += $d; + } + return $frame; + } + + /** + * Return BCH encoded version information pattern that is used for the symbol of version 7 or greater. Use lower 18 bits. + * @param int $version version + * @return string BCH encoded version information pattern + */ + protected function getVersionPattern($version) { + if (($version < 7) OR ($version > QRSPEC_VERSION_MAX)) { + return 0; + } + return $this->versionPattern[($version - 7)]; + } + + /** + * Return BCH encoded format information pattern. + * @param array $mask + * @param int $level error correction level + * @return string BCH encoded format information pattern + */ + protected function getFormatInfo($mask, $level) { + if (($mask < 0) OR ($mask > 7)) { + return 0; + } + if (($level < 0) OR ($level > 3)) { + return 0; + } + return $this->formatInfo[$level][$mask]; + } + + /** + * Put a finder pattern. + * @param array $frame frame + * @param int $ox X center coordinate of the pattern + * @param int $oy Y center coordinate of the pattern + * @return array frame + */ + protected function putFinderPattern($frame, $ox, $oy) { + $finder = array( + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1" + ); + for ($y=0; $y < 7; $y++) { + $frame = $this->qrstrset($frame, $ox, ($oy + $y), $finder[$y]); + } + return $frame; + } + + /** + * Return a copy of initialized frame. + * @param int $version version + * @return array array of unsigned char. + */ + protected function createFrame($version) { + $width = $this->capacity[$version][QRCAP_WIDTH]; + $frameLine = str_repeat ("\0", $width); + $frame = array_fill(0, $width, $frameLine); + // Finder pattern + $frame = $this->putFinderPattern($frame, 0, 0); + $frame = $this->putFinderPattern($frame, $width - 7, 0); + $frame = $this->putFinderPattern($frame, 0, $width - 7); + // Separator + $yOffset = $width - 7; + for ($y=0; $y < 7; ++$y) { + $frame[$y][7] = "\xc0"; + $frame[$y][$width - 8] = "\xc0"; + $frame[$yOffset][7] = "\xc0"; + ++$yOffset; + } + $setPattern = str_repeat("\xc0", 8); + $frame = $this->qrstrset($frame, 0, 7, $setPattern); + $frame = $this->qrstrset($frame, $width-8, 7, $setPattern); + $frame = $this->qrstrset($frame, 0, $width - 8, $setPattern); + // Format info + $setPattern = str_repeat("\x84", 9); + $frame = $this->qrstrset($frame, 0, 8, $setPattern); + $frame = $this->qrstrset($frame, $width - 8, 8, $setPattern, 8); + $yOffset = $width - 8; + for ($y=0; $y < 8; ++$y,++$yOffset) { + $frame[$y][8] = "\x84"; + $frame[$yOffset][8] = "\x84"; + } + // Timing pattern + $wo = $width - 15; + for ($i=1; $i < $wo; ++$i) { + $frame[6][7+$i] = chr(0x90 | ($i & 1)); + $frame[7+$i][6] = chr(0x90 | ($i & 1)); + } + // Alignment pattern + $frame = $this->putAlignmentPattern($version, $frame, $width); + // Version information + if ($version >= 7) { + $vinf = $this->getVersionPattern($version); + $v = $vinf; + for ($x=0; $x<6; ++$x) { + for ($y=0; $y<3; ++$y) { + $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + $v = $vinf; + for ($y=0; $y<6; ++$y) { + for ($x=0; $x<3; ++$x) { + $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + } + // and a little bit... + $frame[$width - 8][8] = "\x81"; + return $frame; + } + + /** + * Set new frame for the specified version. + * @param int $version version + * @return array array of unsigned char. + */ + protected function newFrame($version) { + if (($version < 1) OR ($version > QRSPEC_VERSION_MAX)) { + return NULL; + } + if (!isset($this->frames[$version])) { + $this->frames[$version] = $this->createFrame($version); + } + if (is_null($this->frames[$version])) { + return NULL; + } + return $this->frames[$version]; + } + + /** + * Return block number 0 + * @param array $spec + * @return int value + */ + protected function rsBlockNum($spec) { + return ($spec[0] + $spec[3]); + } + + /** + * Return block number 1 + * @param array $spec + * @return int value + */ + protected function rsBlockNum1($spec) { + return $spec[0]; + } + + /** + * Return data codes 1 + * @param array $spec + * @return int value + */ + protected function rsDataCodes1($spec) { + return $spec[1]; + } + + /** + * Return ecc codes 1 + * @param array $spec + * @return int value + */ + protected function rsEccCodes1($spec) { + return $spec[2]; + } + + /** + * Return block number 2 + * @param array $spec + * @return int value + */ + protected function rsBlockNum2($spec) { + return $spec[3]; + } + + /** + * Return data codes 2 + * @param array $spec + * @return int value + */ + protected function rsDataCodes2($spec) { + return $spec[4]; + } + + /** + * Return ecc codes 2 + * @param array $spec + * @return int value + */ + protected function rsEccCodes2($spec) { + return $spec[2]; + } + + /** + * Return data length + * @param array $spec + * @return int value + */ + protected function rsDataLength($spec) { + return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]); + } + + /** + * Return ecc length + * @param array $spec + * @return int value + */ + protected function rsEccLength($spec) { + return ($spec[0] + $spec[3]) * $spec[2]; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRrs + + /** + * Initialize a Reed-Solomon codec and add it to existing rsitems + * @param int $symsize symbol size, bits + * @param int $gfpoly Field generator polynomial coefficients + * @param int $fcr first root of RS code generator polynomial, index form + * @param int $prim primitive element to generate polynomial roots + * @param int $nroots RS code generator polynomial degree (number of roots) + * @param int $pad padding bytes at front of shortened block + * @return array Array of RS values:
      • mm = Bits per symbol;
      • nn = Symbols per block;
      • alpha_to = log lookup table array;
      • index_of = Antilog lookup table array;
      • genpoly = Generator polynomial array;
      • nroots = Number of generator;
      • roots = number of parity symbols;
      • fcr = First consecutive root, index form;
      • prim = Primitive element, index form;
      • iprim = prim-th root of 1, index form;
      • pad = Padding bytes in shortened block;
      • gfpoly
      . + */ + protected function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { + foreach ($this->rsitems as $rs) { + if (($rs['pad'] != $pad) OR ($rs['nroots'] != $nroots) OR ($rs['mm'] != $symsize) + OR ($rs['gfpoly'] != $gfpoly) OR ($rs['fcr'] != $fcr) OR ($rs['prim'] != $prim)) { + continue; + } + return $rs; + } + $rs = $this->init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad); + array_unshift($this->rsitems, $rs); + return $rs; + } + + // - - - - - - - - - - - - - - - - - - - - - - - - - + + // QRrsItem + + /** + * modnn + * @param array $rs RS values + * @param int $x X position + * @return int X osition + */ + protected function modnn($rs, $x) { + while ($x >= $rs['nn']) { + $x -= $rs['nn']; + $x = ($x >> $rs['mm']) + ($x & $rs['nn']); + } + return $x; + } + + /** + * Initialize a Reed-Solomon codec and returns an array of values. + * @param int $symsize symbol size, bits + * @param int $gfpoly Field generator polynomial coefficients + * @param int $fcr first root of RS code generator polynomial, index form + * @param int $prim primitive element to generate polynomial roots + * @param int $nroots RS code generator polynomial degree (number of roots) + * @param int $pad padding bytes at front of shortened block + * @return array Array of RS values:
      • mm = Bits per symbol;
      • nn = Symbols per block;
      • alpha_to = log lookup table array;
      • index_of = Antilog lookup table array;
      • genpoly = Generator polynomial array;
      • nroots = Number of generator;
      • roots = number of parity symbols;
      • fcr = First consecutive root, index form;
      • prim = Primitive element, index form;
      • iprim = prim-th root of 1, index form;
      • pad = Padding bytes in shortened block;
      • gfpoly
      . + */ + protected function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) { + // Based on Reed solomon encoder by Phil Karn, KA9Q (GNU-LGPLv2) + $rs = null; + // Check parameter ranges + if (($symsize < 0) OR ($symsize > 8)) { + return $rs; + } + if (($fcr < 0) OR ($fcr >= (1<<$symsize))) { + return $rs; + } + if (($prim <= 0) OR ($prim >= (1<<$symsize))) { + return $rs; + } + if (($nroots < 0) OR ($nroots >= (1<<$symsize))) { + return $rs; + } + if (($pad < 0) OR ($pad >= ((1<<$symsize) -1 - $nroots))) { + return $rs; + } + $rs = array(); + $rs['mm'] = $symsize; + $rs['nn'] = (1 << $symsize) - 1; + $rs['pad'] = $pad; + $rs['alpha_to'] = array_fill(0, ($rs['nn'] + 1), 0); + $rs['index_of'] = array_fill(0, ($rs['nn'] + 1), 0); + // PHP style macro replacement ;) + $NN =& $rs['nn']; + $A0 =& $NN; + // Generate Galois field lookup tables + $rs['index_of'][0] = $A0; // log(zero) = -inf + $rs['alpha_to'][$A0] = 0; // alpha**-inf = 0 + $sr = 1; + for ($i=0; $i<$rs['nn']; ++$i) { + $rs['index_of'][$sr] = $i; + $rs['alpha_to'][$i] = $sr; + $sr <<= 1; + if ($sr & (1 << $symsize)) { + $sr ^= $gfpoly; + } + $sr &= $rs['nn']; + } + if ($sr != 1) { + // field generator polynomial is not primitive! + return NULL; + } + // Form RS code generator polynomial from its roots + $rs['genpoly'] = array_fill(0, ($nroots + 1), 0); + $rs['fcr'] = $fcr; + $rs['prim'] = $prim; + $rs['nroots'] = $nroots; + $rs['gfpoly'] = $gfpoly; + // Find prim-th root of 1, used in decoding + for ($iprim=1; ($iprim % $prim) != 0; $iprim += $rs['nn']) { + ; // intentional empty-body loop! + } + $rs['iprim'] = (int)($iprim / $prim); + $rs['genpoly'][0] = 1; + for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) { + $rs['genpoly'][$i+1] = 1; + // Multiply rs->genpoly[] by @**(root + x) + for ($j = $i; $j > 0; --$j) { + if ($rs['genpoly'][$j] != 0) { + $rs['genpoly'][$j] = $rs['genpoly'][$j-1] ^ $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][$j]] + $root)]; + } else { + $rs['genpoly'][$j] = $rs['genpoly'][$j-1]; + } + } + // rs->genpoly[0] can never be zero + $rs['genpoly'][0] = $rs['alpha_to'][$this->modnn($rs, $rs['index_of'][$rs['genpoly'][0]] + $root)]; + } + // convert rs->genpoly[] to index form for quicker encoding + for ($i = 0; $i <= $nroots; ++$i) { + $rs['genpoly'][$i] = $rs['index_of'][$rs['genpoly'][$i]]; + } + return $rs; + } + + /** + * Encode a Reed-Solomon codec and returns the parity array + * @param array $rs RS values + * @param array $data data + * @param array $parity parity + * @return parity array + */ + protected function encode_rs_char($rs, $data, $parity) { + $MM =& $rs['mm']; // bits per symbol + $NN =& $rs['nn']; // the total number of symbols in a RS block + $ALPHA_TO =& $rs['alpha_to']; // the address of an array of NN elements to convert Galois field elements in index (log) form to polynomial form + $INDEX_OF =& $rs['index_of']; // the address of an array of NN elements to convert Galois field elements in polynomial form to index (log) form + $GENPOLY =& $rs['genpoly']; // an array of NROOTS+1 elements containing the generator polynomial in index form + $NROOTS =& $rs['nroots']; // the number of roots in the RS code generator polynomial, which is the same as the number of parity symbols in a block + $FCR =& $rs['fcr']; // first consecutive root, index form + $PRIM =& $rs['prim']; // primitive element, index form + $IPRIM =& $rs['iprim']; // prim-th root of 1, index form + $PAD =& $rs['pad']; // the number of pad symbols in a block + $A0 =& $NN; + $parity = array_fill(0, $NROOTS, 0); + for ($i=0; $i < ($NN - $NROOTS - $PAD); $i++) { + $feedback = $INDEX_OF[$data[$i] ^ $parity[0]]; + if ($feedback != $A0) { + // feedback term is non-zero + // This line is unnecessary when GENPOLY[NROOTS] is unity, as it must + // always be for the polynomials constructed by init_rs() + $feedback = $this->modnn($rs, $NN - $GENPOLY[$NROOTS] + $feedback); + for ($j=1; $j < $NROOTS; ++$j) { + $parity[$j] ^= $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[($NROOTS - $j)])]; + } + } + // Shift + array_shift($parity); + if ($feedback != $A0) { + array_push($parity, $ALPHA_TO[$this->modnn($rs, $feedback + $GENPOLY[0])]); + } else { + array_push($parity, 0); + } + } + return $parity; + } + +} // end QRcode class + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_colors.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_colors.php new file mode 100755 index 0000000..7f337f3 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_colors.php @@ -0,0 +1,462 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Array of WEB safe colors +// +//============================================================+ + +/** + * @file + * PHP color class for TCPDF + * @author Nicola Asuni + * @package com.tecnick.tcpdf + */ + +/** + * @class TCPDF_COLORS + * PHP color class for TCPDF + * @package com.tecnick.tcpdf + * @version 1.0.004 + * @author Nicola Asuni - info@tecnick.com + */ +class TCPDF_COLORS { + + /** + * Array of WEB safe colors + * @public static + */ + public static $webcolor = array ( + 'aliceblue' => 'f0f8ff', + 'antiquewhite' => 'faebd7', + 'aqua' => '00ffff', + 'aquamarine' => '7fffd4', + 'azure' => 'f0ffff', + 'beige' => 'f5f5dc', + 'bisque' => 'ffe4c4', + 'black' => '000000', + 'blanchedalmond' => 'ffebcd', + 'blue' => '0000ff', + 'blueviolet' => '8a2be2', + 'brown' => 'a52a2a', + 'burlywood' => 'deb887', + 'cadetblue' => '5f9ea0', + 'chartreuse' => '7fff00', + 'chocolate' => 'd2691e', + 'coral' => 'ff7f50', + 'cornflowerblue' => '6495ed', + 'cornsilk' => 'fff8dc', + 'crimson' => 'dc143c', + 'cyan' => '00ffff', + 'darkblue' => '00008b', + 'darkcyan' => '008b8b', + 'darkgoldenrod' => 'b8860b', + 'dkgray' => 'a9a9a9', + 'darkgray' => 'a9a9a9', + 'darkgrey' => 'a9a9a9', + 'darkgreen' => '006400', + 'darkkhaki' => 'bdb76b', + 'darkmagenta' => '8b008b', + 'darkolivegreen' => '556b2f', + 'darkorange' => 'ff8c00', + 'darkorchid' => '9932cc', + 'darkred' => '8b0000', + 'darksalmon' => 'e9967a', + 'darkseagreen' => '8fbc8f', + 'darkslateblue' => '483d8b', + 'darkslategray' => '2f4f4f', + 'darkslategrey' => '2f4f4f', + 'darkturquoise' => '00ced1', + 'darkviolet' => '9400d3', + 'deeppink' => 'ff1493', + 'deepskyblue' => '00bfff', + 'dimgray' => '696969', + 'dimgrey' => '696969', + 'dodgerblue' => '1e90ff', + 'firebrick' => 'b22222', + 'floralwhite' => 'fffaf0', + 'forestgreen' => '228b22', + 'fuchsia' => 'ff00ff', + 'gainsboro' => 'dcdcdc', + 'ghostwhite' => 'f8f8ff', + 'gold' => 'ffd700', + 'goldenrod' => 'daa520', + 'gray' => '808080', + 'grey' => '808080', + 'green' => '008000', + 'greenyellow' => 'adff2f', + 'honeydew' => 'f0fff0', + 'hotpink' => 'ff69b4', + 'indianred' => 'cd5c5c', + 'indigo' => '4b0082', + 'ivory' => 'fffff0', + 'khaki' => 'f0e68c', + 'lavender' => 'e6e6fa', + 'lavenderblush' => 'fff0f5', + 'lawngreen' => '7cfc00', + 'lemonchiffon' => 'fffacd', + 'lightblue' => 'add8e6', + 'lightcoral' => 'f08080', + 'lightcyan' => 'e0ffff', + 'lightgoldenrodyellow' => 'fafad2', + 'ltgray' => 'd3d3d3', + 'lightgray' => 'd3d3d3', + 'lightgrey' => 'd3d3d3', + 'lightgreen' => '90ee90', + 'lightpink' => 'ffb6c1', + 'lightsalmon' => 'ffa07a', + 'lightseagreen' => '20b2aa', + 'lightskyblue' => '87cefa', + 'lightslategray' => '778899', + 'lightslategrey' => '778899', + 'lightsteelblue' => 'b0c4de', + 'lightyellow' => 'ffffe0', + 'lime' => '00ff00', + 'limegreen' => '32cd32', + 'linen' => 'faf0e6', + 'magenta' => 'ff00ff', + 'maroon' => '800000', + 'mediumaquamarine' => '66cdaa', + 'mediumblue' => '0000cd', + 'mediumorchid' => 'ba55d3', + 'mediumpurple' => '9370d8', + 'mediumseagreen' => '3cb371', + 'mediumslateblue' => '7b68ee', + 'mediumspringgreen' => '00fa9a', + 'mediumturquoise' => '48d1cc', + 'mediumvioletred' => 'c71585', + 'midnightblue' => '191970', + 'mintcream' => 'f5fffa', + 'mistyrose' => 'ffe4e1', + 'moccasin' => 'ffe4b5', + 'navajowhite' => 'ffdead', + 'navy' => '000080', + 'oldlace' => 'fdf5e6', + 'olive' => '808000', + 'olivedrab' => '6b8e23', + 'orange' => 'ffa500', + 'orangered' => 'ff4500', + 'orchid' => 'da70d6', + 'palegoldenrod' => 'eee8aa', + 'palegreen' => '98fb98', + 'paleturquoise' => 'afeeee', + 'palevioletred' => 'd87093', + 'papayawhip' => 'ffefd5', + 'peachpuff' => 'ffdab9', + 'peru' => 'cd853f', + 'pink' => 'ffc0cb', + 'plum' => 'dda0dd', + 'powderblue' => 'b0e0e6', + 'purple' => '800080', + 'red' => 'ff0000', + 'rosybrown' => 'bc8f8f', + 'royalblue' => '4169e1', + 'saddlebrown' => '8b4513', + 'salmon' => 'fa8072', + 'sandybrown' => 'f4a460', + 'seagreen' => '2e8b57', + 'seashell' => 'fff5ee', + 'sienna' => 'a0522d', + 'silver' => 'c0c0c0', + 'skyblue' => '87ceeb', + 'slateblue' => '6a5acd', + 'slategray' => '708090', + 'slategrey' => '708090', + 'snow' => 'fffafa', + 'springgreen' => '00ff7f', + 'steelblue' => '4682b4', + 'tan' => 'd2b48c', + 'teal' => '008080', + 'thistle' => 'd8bfd8', + 'tomato' => 'ff6347', + 'turquoise' => '40e0d0', + 'violet' => 'ee82ee', + 'wheat' => 'f5deb3', + 'white' => 'ffffff', + 'whitesmoke' => 'f5f5f5', + 'yellow' => 'ffff00', + 'yellowgreen' => '9acd32' + ); // end of web colors + + /** + * Array of valid JavaScript color names + * @public static + */ + public static $jscolor = array ('transparent', 'black', 'white', 'red', 'green', 'blue', 'cyan', 'magenta', 'yellow', 'dkGray', 'gray', 'ltGray'); + + /** + * Array of Spot colors (C,M,Y,K,name) + * Color keys must be in lowercase and without spaces. + * As long as no open standard for spot colours exists, you have to buy a colour book by one of the colour manufacturers and insert the values and names of spot colours directly. + * Common industry standard spot colors are: ANPA-COLOR, DIC, FOCOLTONE, GCMI, HKS, PANTONE, TOYO, TRUMATCH. + * @public static + */ + public static $spotcolor = array ( + // special registration colors + 'none' => array( 0, 0, 0, 0, 'None'), + 'all' => array(100, 100, 100, 100, 'All'), + // standard CMYK colors + 'cyan' => array(100, 0, 0, 0, 'Cyan'), + 'magenta' => array( 0, 100, 0, 0, 'Magenta'), + 'yellow' => array( 0, 0, 100, 0, 'Yellow'), + 'key' => array( 0, 0, 0, 100, 'Key'), + // alias + 'white' => array( 0, 0, 0, 0, 'White'), + 'black' => array( 0, 0, 0, 100, 'Black'), + // standard RGB colors + 'red' => array( 0, 100, 100, 0, 'Red'), + 'green' => array(100, 0, 100, 0, 'Green'), + 'blue' => array(100, 100, 0, 0, 'Blue'), + // Add here standard spot colors or dynamically define them with AddSpotColor() + // ... + ); // end of spot colors + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + /** + * Return the Spot color array. + * @param string $name Name of the spot color. + * @param array $spotc Reference to an array of spot colors. + * @return array|false Spot color array or false if not defined. + * @since 5.9.125 (2011-10-03) + * @public static + */ + public static function getSpotColor($name, &$spotc) { + if (isset($spotc[$name])) { + return $spotc[$name]; + } + $color = preg_replace('/[\s]*/', '', $name); // remove extra spaces + $color = strtolower($color); + if (isset(self::$spotcolor[$color])) { + if (!isset($spotc[$name])) { + $i = (1 + count($spotc)); + $spotc[$name] = array('C' => self::$spotcolor[$color][0], 'M' => self::$spotcolor[$color][1], 'Y' => self::$spotcolor[$color][2], 'K' => self::$spotcolor[$color][3], 'name' => self::$spotcolor[$color][4], 'i' => $i); + } + return $spotc[self::$spotcolor[$color][4]]; + } + return false; + } + + /** + * Returns an array (RGB or CMYK) from an html color name, or a six-digit (i.e. #3FE5AA), or three-digit (i.e. #7FF) hexadecimal color, or a javascript color array, or javascript color name. + * @param string $hcolor HTML color. + * @param array $spotc Reference to an array of spot colors. + * @param array $defcol Color to return in case of error. + * @return array|false RGB or CMYK color, or false in case of error. + * @public static + */ + public static function convertHTMLColorToDec($hcolor, &$spotc, $defcol=array('R'=>128,'G'=>128,'B'=>128)) { + $color = preg_replace('/[\s]*/', '', $hcolor); // remove extra spaces + $color = strtolower($color); + // check for javascript color array syntax + if (strpos($color, '[') !== false) { + if (preg_match('/[\[][\"\'](t|g|rgb|cmyk)[\"\'][\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\,]?([0-9\.]*)[\]]/', $color, $m) > 0) { + $returncolor = array(); + switch ($m[1]) { + case 'cmyk': { + // RGB + $returncolor['C'] = max(0, min(100, (floatval($m[2]) * 100))); + $returncolor['M'] = max(0, min(100, (floatval($m[3]) * 100))); + $returncolor['Y'] = max(0, min(100, (floatval($m[4]) * 100))); + $returncolor['K'] = max(0, min(100, (floatval($m[5]) * 100))); + break; + } + case 'rgb': { + // RGB + $returncolor['R'] = max(0, min(255, (floatval($m[2]) * 255))); + $returncolor['G'] = max(0, min(255, (floatval($m[3]) * 255))); + $returncolor['B'] = max(0, min(255, (floatval($m[4]) * 255))); + break; + } + case 'g': { + // grayscale + $returncolor['G'] = max(0, min(255, (floatval($m[2]) * 255))); + break; + } + case 't': + default: { + // transparent (empty array) + break; + } + } + return $returncolor; + } + } elseif ((substr($color, 0, 4) != 'cmyk') AND (substr($color, 0, 3) != 'rgb') AND (($dotpos = strpos($color, '.')) !== false)) { + // remove class parent (i.e.: color.red) + $color = substr($color, ($dotpos + 1)); + if ($color == 'transparent') { + // transparent (empty array) + return array(); + } + } + if (strlen($color) == 0) { + return $defcol; + } + // RGB ARRAY + if (substr($color, 0, 3) == 'rgb') { + $codes = substr($color, 4); + $codes = str_replace(')', '', $codes); + $returncolor = explode(',', $codes); + foreach ($returncolor as $key => $val) { + if (strpos($val, '%') > 0) { + // percentage + $returncolor[$key] = (255 * intval($val) / 100); + } else { + $returncolor[$key] = intval($val); + } + // normalize value + $returncolor[$key] = max(0, min(255, $returncolor[$key])); + } + return $returncolor; + } + // CMYK ARRAY + if (substr($color, 0, 4) == 'cmyk') { + $codes = substr($color, 5); + $codes = str_replace(')', '', $codes); + $returncolor = explode(',', $codes); + foreach ($returncolor as $key => $val) { + if (strpos($val, '%') !== false) { + // percentage + $returncolor[$key] = (100 * intval($val) / 100); + } else { + $returncolor[$key] = intval($val); + } + // normalize value + $returncolor[$key] = max(0, min(100, $returncolor[$key])); + } + return $returncolor; + } + if ($color[0] != '#') { + // COLOR NAME + if (isset(self::$webcolor[$color])) { + // web color + $color_code = self::$webcolor[$color]; + } else { + // spot color + $returncolor = self::getSpotColor($hcolor, $spotc); + if ($returncolor === false) { + $returncolor = $defcol; + } + return $returncolor; + } + } else { + $color_code = substr($color, 1); + } + // HEXADECIMAL REPRESENTATION + switch (strlen($color_code)) { + case 3: { + // 3-digit RGB hexadecimal representation + $r = substr($color_code, 0, 1); + $g = substr($color_code, 1, 1); + $b = substr($color_code, 2, 1); + $returncolor = array(); + $returncolor['R'] = max(0, min(255, hexdec($r.$r))); + $returncolor['G'] = max(0, min(255, hexdec($g.$g))); + $returncolor['B'] = max(0, min(255, hexdec($b.$b))); + break; + } + case 6: { + // 6-digit RGB hexadecimal representation + $returncolor = array(); + $returncolor['R'] = max(0, min(255, hexdec(substr($color_code, 0, 2)))); + $returncolor['G'] = max(0, min(255, hexdec(substr($color_code, 2, 2)))); + $returncolor['B'] = max(0, min(255, hexdec(substr($color_code, 4, 2)))); + break; + } + case 8: { + // 8-digit CMYK hexadecimal representation + $returncolor = array(); + $returncolor['C'] = max(0, min(100, round(hexdec(substr($color_code, 0, 2)) / 2.55))); + $returncolor['M'] = max(0, min(100, round(hexdec(substr($color_code, 2, 2)) / 2.55))); + $returncolor['Y'] = max(0, min(100, round(hexdec(substr($color_code, 4, 2)) / 2.55))); + $returncolor['K'] = max(0, min(100, round(hexdec(substr($color_code, 6, 2)) / 2.55))); + break; + } + default: { + $returncolor = $defcol; + break; + } + } + return $returncolor; + } + + /** + * Convert a color array into a string representation. + * @param array $c Array of colors. + * @return string The color array representation. + * @since 5.9.137 (2011-12-01) + * @public static + */ + public static function getColorStringFromArray($c) { + $c = array_values($c); + $color = '['; + switch (count($c)) { + case 4: { + // CMYK + $color .= sprintf('%F %F %F %F', (max(0, min(100, floatval($c[0]))) / 100), (max(0, min(100, floatval($c[1]))) / 100), (max(0, min(100, floatval($c[2]))) / 100), (max(0, min(100, floatval($c[3]))) / 100)); + break; + } + case 3: { + // RGB + $color .= sprintf('%F %F %F', (max(0, min(255, floatval($c[0]))) / 255), (max(0, min(255, floatval($c[1]))) / 255), (max(0, min(255, floatval($c[2]))) / 255)); + break; + } + case 1: { + // grayscale + $color .= sprintf('%F', (max(0, min(255, floatval($c[0]))) / 255)); + break; + } + } + $color .= ']'; + return $color; + } + + /** + * Convert color to javascript color. + * @param string $color color name or "#RRGGBB" + * @protected + * @since 2.1.002 (2008-02-12) + * @public static + */ + public static function _JScolor($color) { + if (substr($color, 0, 1) == '#') { + return sprintf("['RGB',%F,%F,%F]", (hexdec(substr($color, 1, 2)) / 255), (hexdec(substr($color, 3, 2)) / 255), (hexdec(substr($color, 5, 2)) / 255)); + } + if (!in_array($color, self::$jscolor)) { + // default transparent color + $color = self::$jscolor[0]; + } + return 'color.'.$color; + } + + +} // END OF TCPDF_COLORS CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_filters.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_filters.php new file mode 100755 index 0000000..3009cff --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_filters.php @@ -0,0 +1,481 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters). +// +//============================================================+ + +/** + * @file + * This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters).
      + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.001 + */ + +/** + * @class TCPDF_FILTERS + * This is a PHP class for decoding common PDF filters (PDF 32000-2008 - 7.4 Filters).
      + * @package com.tecnick.tcpdf + * @brief This is a PHP class for decoding common PDF filters. + * @version 1.0.001 + * @author Nicola Asuni - info@tecnick.com + */ +class TCPDF_FILTERS { + + /** + * Define a list of available filter decoders. + * @private static + */ + private static $available_filters = array('ASCIIHexDecode', 'ASCII85Decode', 'LZWDecode', 'FlateDecode', 'RunLengthDecode'); + +// ----------------------------------------------------------------------------- + + /** + * Get a list of available decoding filters. + * @return array Array of available filter decoders. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function getAvailableFilters() { + return self::$available_filters; + } + + /** + * Decode data using the specified filter type. + * @param string $filter Filter name. + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilter($filter, $data) { + switch ($filter) { + case 'ASCIIHexDecode': { + return self::decodeFilterASCIIHexDecode($data); + break; + } + case 'ASCII85Decode': { + return self::decodeFilterASCII85Decode($data); + break; + } + case 'LZWDecode': { + return self::decodeFilterLZWDecode($data); + break; + } + case 'FlateDecode': { + return self::decodeFilterFlateDecode($data); + break; + } + case 'RunLengthDecode': { + return self::decodeFilterRunLengthDecode($data); + break; + } + case 'CCITTFaxDecode': { + return self::decodeFilterCCITTFaxDecode($data); + break; + } + case 'JBIG2Decode': { + return self::decodeFilterJBIG2Decode($data); + break; + } + case 'DCTDecode': { + return self::decodeFilterDCTDecode($data); + break; + } + case 'JPXDecode': { + return self::decodeFilterJPXDecode($data); + break; + } + case 'Crypt': { + return self::decodeFilterCrypt($data); + break; + } + default: { + return self::decodeFilterStandard($data); + break; + } + } + } + + // --- FILTERS (PDF 32000-2008 - 7.4 Filters) ------------------------------ + + /** + * Standard + * Default decoding filter (leaves data unchanged). + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterStandard($data) { + return $data; + } + + /** + * ASCIIHexDecode + * Decodes data encoded in an ASCII hexadecimal representation, reproducing the original binary data. + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterASCIIHexDecode($data) { + // initialize string to return + $decoded = ''; + // all white-space characters shall be ignored + $data = preg_replace('/[\s]/', '', $data); + // check for EOD character: GREATER-THAN SIGN (3Eh) + $eod = strpos($data, '>'); + if ($eod !== false) { + // remove EOD and extra data (if any) + $data = substr($data, 0, $eod); + $eod = true; + } + // get data length + $data_length = strlen($data); + if (($data_length % 2) != 0) { + // odd number of hexadecimal digits + if ($eod) { + // EOD shall behave as if a 0 (zero) followed the last digit + $data = substr($data, 0, -1).'0'.substr($data, -1); + } else { + self::Error('decodeFilterASCIIHexDecode: invalid code'); + } + } + // check for invalid characters + if (preg_match('/[^a-fA-F\d]/', $data) > 0) { + self::Error('decodeFilterASCIIHexDecode: invalid code'); + } + // get one byte of binary data for each pair of ASCII hexadecimal digits + $decoded = pack('H*', $data); + return $decoded; + } + + /** + * ASCII85Decode + * Decodes data encoded in an ASCII base-85 representation, reproducing the original binary data. + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterASCII85Decode($data) { + // initialize string to return + $decoded = ''; + // all white-space characters shall be ignored + $data = preg_replace('/[\s]/', '', $data); + // remove start sequence 2-character sequence <~ (3Ch)(7Eh) + if (strpos($data, '<~') !== false) { + // remove EOD and extra data (if any) + $data = substr($data, 2); + } + // check for EOD: 2-character sequence ~> (7Eh)(3Eh) + $eod = strpos($data, '~>'); + if ($eod !== false) { + // remove EOD and extra data (if any) + $data = substr($data, 0, $eod); + } + // data length + $data_length = strlen($data); + // check for invalid characters + if (preg_match('/[^\x21-\x75,\x74]/', $data) > 0) { + self::Error('decodeFilterASCII85Decode: invalid code'); + } + // z sequence + $zseq = chr(0).chr(0).chr(0).chr(0); + // position inside a group of 4 bytes (0-3) + $group_pos = 0; + $tuple = 0; + $pow85 = array((85*85*85*85), (85*85*85), (85*85), 85, 1); + $last_pos = ($data_length - 1); + // for each byte + for ($i = 0; $i < $data_length; ++$i) { + // get char value + $char = ord($data[$i]); + if ($char == 122) { // 'z' + if ($group_pos == 0) { + $decoded .= $zseq; + } else { + self::Error('decodeFilterASCII85Decode: invalid code'); + } + } else { + // the value represented by a group of 5 characters should never be greater than 2^32 - 1 + $tuple += (($char - 33) * $pow85[$group_pos]); + if ($group_pos == 4) { + $decoded .= chr($tuple >> 24).chr($tuple >> 16).chr($tuple >> 8).chr($tuple); + $tuple = 0; + $group_pos = 0; + } else { + ++$group_pos; + } + } + } + if ($group_pos > 1) { + $tuple += $pow85[($group_pos - 1)]; + } + // last tuple (if any) + switch ($group_pos) { + case 4: { + $decoded .= chr($tuple >> 24).chr($tuple >> 16).chr($tuple >> 8); + break; + } + case 3: { + $decoded .= chr($tuple >> 24).chr($tuple >> 16); + break; + } + case 2: { + $decoded .= chr($tuple >> 24); + break; + } + case 1: { + self::Error('decodeFilterASCII85Decode: invalid code'); + break; + } + } + return $decoded; + } + + /** + * LZWDecode + * Decompresses data encoded using the LZW (Lempel-Ziv-Welch) adaptive compression method, reproducing the original text or binary data. + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterLZWDecode($data) { + // initialize string to return + $decoded = ''; + // data length + $data_length = strlen($data); + // convert string to binary string + $bitstring = ''; + for ($i = 0; $i < $data_length; ++$i) { + $bitstring .= sprintf('%08b', ord($data[$i])); + } + // get the number of bits + $data_length = strlen($bitstring); + // initialize code length in bits + $bitlen = 9; + // initialize dictionary index + $dix = 258; + // initialize the dictionary (with the first 256 entries). + $dictionary = array(); + for ($i = 0; $i < 256; ++$i) { + $dictionary[$i] = chr($i); + } + // previous val + $prev_index = 0; + // while we encounter EOD marker (257), read code_length bits + while (($data_length > 0) AND (($index = bindec(substr($bitstring, 0, $bitlen))) != 257)) { + // remove read bits from string + $bitstring = substr($bitstring, $bitlen); + // update number of bits + $data_length -= $bitlen; + if ($index == 256) { // clear-table marker + // reset code length in bits + $bitlen = 9; + // reset dictionary index + $dix = 258; + $prev_index = 256; + // reset the dictionary (with the first 256 entries). + $dictionary = array(); + for ($i = 0; $i < 256; ++$i) { + $dictionary[$i] = chr($i); + } + } elseif ($prev_index == 256) { + // first entry + $decoded .= $dictionary[$index]; + $prev_index = $index; + } else { + // check if index exist in the dictionary + if ($index < $dix) { + // index exist on dictionary + $decoded .= $dictionary[$index]; + $dic_val = $dictionary[$prev_index].$dictionary[$index][0]; + // store current index + $prev_index = $index; + } else { + // index do not exist on dictionary + $dic_val = $dictionary[$prev_index].$dictionary[$prev_index][0]; + $decoded .= $dic_val; + } + // update dictionary + $dictionary[$dix] = $dic_val; + ++$dix; + // change bit length by case + if ($dix == 2047) { + $bitlen = 12; + } elseif ($dix == 1023) { + $bitlen = 11; + } elseif ($dix == 511) { + $bitlen = 10; + } + } + } + return $decoded; + } + + /** + * FlateDecode + * Decompresses data encoded using the zlib/deflate compression method, reproducing the original text or binary data. + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterFlateDecode($data) { + // initialize string to return + $decoded = @gzuncompress($data); + if ($decoded === false) { + self::Error('decodeFilterFlateDecode: invalid code'); + } + return $decoded; + } + + /** + * RunLengthDecode + * Decompresses data encoded using a byte-oriented run-length encoding algorithm. + * @param string $data Data to decode. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterRunLengthDecode($data) { + // initialize string to return + $decoded = ''; + // data length + $data_length = strlen($data); + $i = 0; + while($i < $data_length) { + // get current byte value + $byte = ord($data[$i]); + if ($byte == 128) { + // a length value of 128 denote EOD + break; + } elseif ($byte < 128) { + // if the length byte is in the range 0 to 127 + // the following length + 1 (1 to 128) bytes shall be copied literally during decompression + $decoded .= substr($data, ($i + 1), ($byte + 1)); + // move to next block + $i += ($byte + 2); + } else { + // if length is in the range 129 to 255, + // the following single byte shall be copied 257 - length (2 to 128) times during decompression + $decoded .= str_repeat($data[($i + 1)], (257 - $byte)); + // move to next block + $i += 2; + } + } + return $decoded; + } + + /** + * CCITTFaxDecode (NOT IMPLEMETED - RETURN AN EXCEPTION) + * Decompresses data encoded using the CCITT facsimile standard, reproducing the original data (typically monochrome image data at 1 bit per pixel). + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterCCITTFaxDecode($data) { + self::Error('~decodeFilterCCITTFaxDecode: this method has not been yet implemented'); + //return $data; + } + + /** + * JBIG2Decode (NOT IMPLEMETED - RETURN AN EXCEPTION) + * Decompresses data encoded using the JBIG2 standard, reproducing the original monochrome (1 bit per pixel) image data (or an approximation of that data). + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterJBIG2Decode($data) { + self::Error('~decodeFilterJBIG2Decode: this method has not been yet implemented'); + //return $data; + } + + /** + * DCTDecode (NOT IMPLEMETED - RETURN AN EXCEPTION) + * Decompresses data encoded using a DCT (discrete cosine transform) technique based on the JPEG standard, reproducing image sample data that approximates the original data. + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterDCTDecode($data) { + self::Error('~decodeFilterDCTDecode: this method has not been yet implemented'); + //return $data; + } + + /** + * JPXDecode (NOT IMPLEMETED - RETURN AN EXCEPTION) + * Decompresses data encoded using the wavelet-based JPEG2000 standard, reproducing the original image data. + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterJPXDecode($data) { + self::Error('~decodeFilterJPXDecode: this method has not been yet implemented'); + //return $data; + } + + /** + * Crypt (NOT IMPLEMETED - RETURN AN EXCEPTION) + * Decrypts data encrypted by a security handler, reproducing the data as it was before encryption. + * @param string $data Data to decode. + * @return string Decoded data string. + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function decodeFilterCrypt($data) { + self::Error('~decodeFilterCrypt: this method has not been yet implemented'); + //return $data; + } + + // --- END FILTERS SECTION ------------------------------------------------- + + /** + * Throw an exception. + * @param string $msg The error message + * @since 1.0.000 (2011-05-23) + * @public static + */ + public static function Error($msg) { + throw new Exception('TCPDF_PARSER ERROR: '.$msg); + } + +} // END OF TCPDF_FILTERS CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_font_data.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_font_data.php new file mode 100755 index 0000000..974e72e --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_font_data.php @@ -0,0 +1,18447 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Unicode data and encoding maps for TCPDF. +// +//============================================================+ + +/** + * @file + * Unicode data and encoding maps for TCPDF. + * @author Nicola Asuni + * @package com.tecnick.tcpdf + */ + +/** + * @class TCPDF_FONT_DATA + * Unicode data and encoding maps for TCPDF. + * @package com.tecnick.tcpdf + * @version 1.0.001 + * @author Nicola Asuni - info@tecnick.com + */ +class TCPDF_FONT_DATA { + +/** + * Unicode code for Left-to-Right Mark. + * @public + */ +public static $uni_LRM = 8206; + +/** + * Unicode code for Right-to-Left Mark. + * @public + */ +public static $uni_RLM = 8207; + +/** + * Unicode code for Left-to-Right Embedding. + * @public + */ +public static $uni_LRE = 8234; + +/** + * Unicode code for Right-to-Left Embedding. + * @public + */ +public static $uni_RLE = 8235; + +/** + * Unicode code for Pop Directional Format. + * @public + */ +public static $uni_PDF = 8236; + +/** + * Unicode code for Left-to-Right Override. + * @public + */ +public static $uni_LRO = 8237; + +/** + * Unicode code for Right-to-Left Override. + * @public + */ +public static $uni_RLO = 8238; + +/** + * Pattern to test RTL (Righ-To-Left) strings using regular expressions. + * @public + */ +public static $uni_RE_PATTERN_RTL = "/( + \xD6\xBE # R + | \xD7[\x80\x83\x86\x90-\xAA\xB0-\xB4] # R + | \xDF[\x80-\xAA\xB4\xB5\xBA] # R + | \xE2\x80\x8F # R + | \xEF\xAC[\x9D\x9F\xA0-\xA8\xAA-\xB6\xB8-\xBC\xBE] # R + | \xEF\xAD[\x80\x81\x83\x84\x86-\x8F] # R + | \xF0\x90\xA0[\x80-\x85\x88\x8A-\xB5\xB7\xB8\xBC\xBF] # R + | \xF0\x90\xA4[\x80-\x99] # R + | \xF0\x90\xA8[\x80\x90-\x93\x95-\x97\x99-\xB3] # R + | \xF0\x90\xA9[\x80-\x87\x90-\x98] # R + | \xE2\x80[\xAB\xAE] # RLE & RLO + )/x"; + +/** + * Pattern to test Arabic strings using regular expressions. Source: http://www.w3.org/International/questions/qa-forms-utf-8 + * @public + */ +public static $uni_RE_PATTERN_ARABIC = "/( + \xD8[\x80-\x83\x8B\x8D\x9B\x9E\x9F\xA1-\xBA] # AL + | \xD9[\x80-\x8A\xAD-\xAF\xB1-\xBF] # AL + | \xDA[\x80-\xBF] # AL + | \xDB[\x80-\x95\x9D\xA5\xA6\xAE\xAF\xBA-\xBF] # AL + | \xDC[\x80-\x8D\x90\x92-\xAF] # AL + | \xDD[\x8D-\xAD] # AL + | \xDE[\x80-\xA5\xB1] # AL + | \xEF\xAD[\x90-\xBF] # AL + | \xEF\xAE[\x80-\xB1] # AL + | \xEF\xAF[\x93-\xBF] # AL + | \xEF[\xB0-\xB3][\x80-\xBF] # AL + | \xEF\xB4[\x80-\xBD] # AL + | \xEF\xB5[\x90-\xBF] # AL + | \xEF\xB6[\x80-\x8F\x92-\xBF] # AL + | \xEF\xB7[\x80-\x87\xB0-\xBC] # AL + | \xEF\xB9[\xB0-\xB4\xB6-\xBF] # AL + | \xEF\xBA[\x80-\xBF] # AL + | \xEF\xBB[\x80-\xBC] # AL + | \xD9[\xA0-\xA9\xAB\xAC] # AN + )/x"; + +/** + * Array of Unicode types. + * @public + */ +public static $uni_type = array( +0=>'BN', +1=>'BN', +2=>'BN', +3=>'BN', +4=>'BN', +5=>'BN', +6=>'BN', +7=>'BN', +8=>'BN', +9=>'S', +10=>'B', +11=>'S', +12=>'WS', +13=>'B', +14=>'BN', +15=>'BN', +16=>'BN', +17=>'BN', +18=>'BN', +19=>'BN', +20=>'BN', +21=>'BN', +22=>'BN', +23=>'BN', +24=>'BN', +25=>'BN', +26=>'BN', +27=>'BN', +28=>'B', +29=>'B', +30=>'B', +31=>'S', +32=>'WS', +33=>'ON', +34=>'ON', +35=>'ET', +36=>'ET', +37=>'ET', +38=>'ON', +39=>'ON', +40=>'ON', +41=>'ON', +42=>'ON', +43=>'ES', +44=>'CS', +45=>'ES', +46=>'CS', +47=>'CS', +48=>'EN', +49=>'EN', +50=>'EN', +51=>'EN', +52=>'EN', +53=>'EN', +54=>'EN', +55=>'EN', +56=>'EN', +57=>'EN', +58=>'CS', +59=>'ON', +60=>'ON', +61=>'ON', +62=>'ON', +63=>'ON', +64=>'ON', +65=>'L', +66=>'L', +67=>'L', +68=>'L', +69=>'L', +70=>'L', +71=>'L', +72=>'L', +73=>'L', +74=>'L', +75=>'L', +76=>'L', +77=>'L', +78=>'L', +79=>'L', +80=>'L', +81=>'L', +82=>'L', +83=>'L', +84=>'L', +85=>'L', +86=>'L', +87=>'L', +88=>'L', +89=>'L', +90=>'L', +91=>'ON', +92=>'ON', +93=>'ON', +94=>'ON', +95=>'ON', +96=>'ON', +97=>'L', +98=>'L', +99=>'L', +100=>'L', +101=>'L', +102=>'L', +103=>'L', +104=>'L', +105=>'L', +106=>'L', +107=>'L', +108=>'L', +109=>'L', +110=>'L', +111=>'L', +112=>'L', +113=>'L', +114=>'L', +115=>'L', +116=>'L', +117=>'L', +118=>'L', +119=>'L', +120=>'L', +121=>'L', +122=>'L', +123=>'ON', +124=>'ON', +125=>'ON', +126=>'ON', +127=>'BN', +128=>'BN', +129=>'BN', +130=>'BN', +131=>'BN', +132=>'BN', +133=>'B', +134=>'BN', +135=>'BN', +136=>'BN', +137=>'BN', +138=>'BN', +139=>'BN', +140=>'BN', +141=>'BN', +142=>'BN', +143=>'BN', +144=>'BN', +145=>'BN', +146=>'BN', +147=>'BN', +148=>'BN', +149=>'BN', +150=>'BN', +151=>'BN', +152=>'BN', +153=>'BN', +154=>'BN', +155=>'BN', +156=>'BN', +157=>'BN', +158=>'BN', +159=>'BN', +160=>'CS', +161=>'ON', +162=>'ET', +163=>'ET', +164=>'ET', +165=>'ET', +166=>'ON', +167=>'ON', +168=>'ON', +169=>'ON', +170=>'L', +171=>'ON', +172=>'ON', +173=>'BN', +174=>'ON', +175=>'ON', +176=>'ET', +177=>'ET', +178=>'EN', +179=>'EN', +180=>'ON', +181=>'L', +182=>'ON', +183=>'ON', +184=>'ON', +185=>'EN', +186=>'L', +187=>'ON', +188=>'ON', +189=>'ON', +190=>'ON', +191=>'ON', +192=>'L', +193=>'L', +194=>'L', +195=>'L', +196=>'L', +197=>'L', +198=>'L', +199=>'L', +200=>'L', +201=>'L', +202=>'L', +203=>'L', +204=>'L', +205=>'L', +206=>'L', +207=>'L', +208=>'L', +209=>'L', +210=>'L', +211=>'L', +212=>'L', +213=>'L', +214=>'L', +215=>'ON', +216=>'L', +217=>'L', +218=>'L', +219=>'L', +220=>'L', +221=>'L', +222=>'L', +223=>'L', +224=>'L', +225=>'L', +226=>'L', +227=>'L', +228=>'L', +229=>'L', +230=>'L', +231=>'L', +232=>'L', +233=>'L', +234=>'L', +235=>'L', +236=>'L', +237=>'L', +238=>'L', +239=>'L', +240=>'L', +241=>'L', +242=>'L', +243=>'L', +244=>'L', +245=>'L', +246=>'L', +247=>'ON', +248=>'L', +249=>'L', +250=>'L', +251=>'L', +252=>'L', +253=>'L', +254=>'L', +255=>'L', +256=>'L', +257=>'L', +258=>'L', +259=>'L', +260=>'L', +261=>'L', +262=>'L', +263=>'L', +264=>'L', +265=>'L', +266=>'L', +267=>'L', +268=>'L', +269=>'L', +270=>'L', +271=>'L', +272=>'L', +273=>'L', +274=>'L', +275=>'L', +276=>'L', +277=>'L', +278=>'L', +279=>'L', +280=>'L', +281=>'L', +282=>'L', +283=>'L', +284=>'L', +285=>'L', +286=>'L', +287=>'L', +288=>'L', +289=>'L', +290=>'L', +291=>'L', +292=>'L', +293=>'L', +294=>'L', +295=>'L', +296=>'L', +297=>'L', +298=>'L', +299=>'L', +300=>'L', +301=>'L', +302=>'L', +303=>'L', +304=>'L', +305=>'L', +306=>'L', +307=>'L', +308=>'L', +309=>'L', +310=>'L', +311=>'L', +312=>'L', +313=>'L', +314=>'L', +315=>'L', +316=>'L', +317=>'L', +318=>'L', +319=>'L', +320=>'L', +321=>'L', +322=>'L', +323=>'L', +324=>'L', +325=>'L', +326=>'L', +327=>'L', +328=>'L', +329=>'L', +330=>'L', +331=>'L', +332=>'L', +333=>'L', +334=>'L', +335=>'L', +336=>'L', +337=>'L', +338=>'L', +339=>'L', +340=>'L', +341=>'L', +342=>'L', +343=>'L', +344=>'L', +345=>'L', +346=>'L', +347=>'L', +348=>'L', +349=>'L', +350=>'L', +351=>'L', +352=>'L', +353=>'L', +354=>'L', +355=>'L', +356=>'L', +357=>'L', +358=>'L', +359=>'L', +360=>'L', +361=>'L', +362=>'L', +363=>'L', +364=>'L', +365=>'L', +366=>'L', +367=>'L', +368=>'L', +369=>'L', +370=>'L', +371=>'L', +372=>'L', +373=>'L', +374=>'L', +375=>'L', +376=>'L', +377=>'L', +378=>'L', +379=>'L', +380=>'L', +381=>'L', +382=>'L', +383=>'L', +384=>'L', +385=>'L', +386=>'L', +387=>'L', +388=>'L', +389=>'L', +390=>'L', +391=>'L', +392=>'L', +393=>'L', +394=>'L', +395=>'L', +396=>'L', +397=>'L', +398=>'L', +399=>'L', +400=>'L', +401=>'L', +402=>'L', +403=>'L', +404=>'L', +405=>'L', +406=>'L', +407=>'L', +408=>'L', +409=>'L', +410=>'L', +411=>'L', +412=>'L', +413=>'L', +414=>'L', +415=>'L', +416=>'L', +417=>'L', +418=>'L', +419=>'L', +420=>'L', +421=>'L', +422=>'L', +423=>'L', +424=>'L', +425=>'L', +426=>'L', +427=>'L', +428=>'L', +429=>'L', +430=>'L', +431=>'L', +432=>'L', +433=>'L', +434=>'L', +435=>'L', +436=>'L', +437=>'L', +438=>'L', +439=>'L', +440=>'L', +441=>'L', +442=>'L', +443=>'L', +444=>'L', +445=>'L', +446=>'L', +447=>'L', +448=>'L', +449=>'L', +450=>'L', +451=>'L', +452=>'L', +453=>'L', +454=>'L', +455=>'L', +456=>'L', +457=>'L', +458=>'L', +459=>'L', +460=>'L', +461=>'L', +462=>'L', +463=>'L', +464=>'L', +465=>'L', +466=>'L', +467=>'L', +468=>'L', +469=>'L', +470=>'L', +471=>'L', +472=>'L', +473=>'L', +474=>'L', +475=>'L', +476=>'L', +477=>'L', +478=>'L', +479=>'L', +480=>'L', +481=>'L', +482=>'L', +483=>'L', +484=>'L', +485=>'L', +486=>'L', +487=>'L', +488=>'L', +489=>'L', +490=>'L', +491=>'L', +492=>'L', +493=>'L', +494=>'L', +495=>'L', +496=>'L', +497=>'L', +498=>'L', +499=>'L', +500=>'L', +501=>'L', +502=>'L', +503=>'L', +504=>'L', +505=>'L', +506=>'L', +507=>'L', +508=>'L', +509=>'L', +510=>'L', +511=>'L', +512=>'L', +513=>'L', +514=>'L', +515=>'L', +516=>'L', +517=>'L', +518=>'L', +519=>'L', +520=>'L', +521=>'L', +522=>'L', +523=>'L', +524=>'L', +525=>'L', +526=>'L', +527=>'L', +528=>'L', +529=>'L', +530=>'L', +531=>'L', +532=>'L', +533=>'L', +534=>'L', +535=>'L', +536=>'L', +537=>'L', +538=>'L', +539=>'L', +540=>'L', +541=>'L', +542=>'L', +543=>'L', +544=>'L', +545=>'L', +546=>'L', +547=>'L', +548=>'L', +549=>'L', +550=>'L', +551=>'L', +552=>'L', +553=>'L', +554=>'L', +555=>'L', +556=>'L', +557=>'L', +558=>'L', +559=>'L', +560=>'L', +561=>'L', +562=>'L', +563=>'L', +564=>'L', +565=>'L', +566=>'L', +567=>'L', +568=>'L', +569=>'L', +570=>'L', +571=>'L', +572=>'L', +573=>'L', +574=>'L', +575=>'L', +576=>'L', +577=>'L', +578=>'L', +579=>'L', +580=>'L', +581=>'L', +582=>'L', +583=>'L', +584=>'L', +585=>'L', +586=>'L', +587=>'L', +588=>'L', +589=>'L', +590=>'L', +591=>'L', +592=>'L', +593=>'L', +594=>'L', +595=>'L', +596=>'L', +597=>'L', +598=>'L', +599=>'L', +600=>'L', +601=>'L', +602=>'L', +603=>'L', +604=>'L', +605=>'L', +606=>'L', +607=>'L', +608=>'L', +609=>'L', +610=>'L', +611=>'L', +612=>'L', +613=>'L', +614=>'L', +615=>'L', +616=>'L', +617=>'L', +618=>'L', +619=>'L', +620=>'L', +621=>'L', +622=>'L', +623=>'L', +624=>'L', +625=>'L', +626=>'L', +627=>'L', +628=>'L', +629=>'L', +630=>'L', +631=>'L', +632=>'L', +633=>'L', +634=>'L', +635=>'L', +636=>'L', +637=>'L', +638=>'L', +639=>'L', +640=>'L', +641=>'L', +642=>'L', +643=>'L', +644=>'L', +645=>'L', +646=>'L', +647=>'L', +648=>'L', +649=>'L', +650=>'L', +651=>'L', +652=>'L', +653=>'L', +654=>'L', +655=>'L', +656=>'L', +657=>'L', +658=>'L', +659=>'L', +660=>'L', +661=>'L', +662=>'L', +663=>'L', +664=>'L', +665=>'L', +666=>'L', +667=>'L', +668=>'L', +669=>'L', +670=>'L', +671=>'L', +672=>'L', +673=>'L', +674=>'L', +675=>'L', +676=>'L', +677=>'L', +678=>'L', +679=>'L', +680=>'L', +681=>'L', +682=>'L', +683=>'L', +684=>'L', +685=>'L', +686=>'L', +687=>'L', +688=>'L', +689=>'L', +690=>'L', +691=>'L', +692=>'L', +693=>'L', +694=>'L', +695=>'L', +696=>'L', +697=>'ON', +698=>'ON', +699=>'L', +700=>'L', +701=>'L', +702=>'L', +703=>'L', +704=>'L', +705=>'L', +706=>'ON', +707=>'ON', +708=>'ON', +709=>'ON', +710=>'ON', +711=>'ON', +712=>'ON', +713=>'ON', +714=>'ON', +715=>'ON', +716=>'ON', +717=>'ON', +718=>'ON', +719=>'ON', +720=>'L', +721=>'L', +722=>'ON', +723=>'ON', +724=>'ON', +725=>'ON', +726=>'ON', +727=>'ON', +728=>'ON', +729=>'ON', +730=>'ON', +731=>'ON', +732=>'ON', +733=>'ON', +734=>'ON', +735=>'ON', +736=>'L', +737=>'L', +738=>'L', +739=>'L', +740=>'L', +741=>'ON', +742=>'ON', +743=>'ON', +744=>'ON', +745=>'ON', +746=>'ON', +747=>'ON', +748=>'ON', +749=>'ON', +750=>'L', +751=>'ON', +752=>'ON', +753=>'ON', +754=>'ON', +755=>'ON', +756=>'ON', +757=>'ON', +758=>'ON', +759=>'ON', +760=>'ON', +761=>'ON', +762=>'ON', +763=>'ON', +764=>'ON', +765=>'ON', +766=>'ON', +767=>'ON', +768=>'NSM', +769=>'NSM', +770=>'NSM', +771=>'NSM', +772=>'NSM', +773=>'NSM', +774=>'NSM', +775=>'NSM', +776=>'NSM', +777=>'NSM', +778=>'NSM', +779=>'NSM', +780=>'NSM', +781=>'NSM', +782=>'NSM', +783=>'NSM', +784=>'NSM', +785=>'NSM', +786=>'NSM', +787=>'NSM', +788=>'NSM', +789=>'NSM', +790=>'NSM', +791=>'NSM', +792=>'NSM', +793=>'NSM', +794=>'NSM', +795=>'NSM', +796=>'NSM', +797=>'NSM', +798=>'NSM', +799=>'NSM', +800=>'NSM', +801=>'NSM', +802=>'NSM', +803=>'NSM', +804=>'NSM', +805=>'NSM', +806=>'NSM', +807=>'NSM', +808=>'NSM', +809=>'NSM', +810=>'NSM', +811=>'NSM', +812=>'NSM', +813=>'NSM', +814=>'NSM', +815=>'NSM', +816=>'NSM', +817=>'NSM', +818=>'NSM', +819=>'NSM', +820=>'NSM', +821=>'NSM', +822=>'NSM', +823=>'NSM', +824=>'NSM', +825=>'NSM', +826=>'NSM', +827=>'NSM', +828=>'NSM', +829=>'NSM', +830=>'NSM', +831=>'NSM', +832=>'NSM', +833=>'NSM', +834=>'NSM', +835=>'NSM', +836=>'NSM', +837=>'NSM', +838=>'NSM', +839=>'NSM', +840=>'NSM', +841=>'NSM', +842=>'NSM', +843=>'NSM', +844=>'NSM', +845=>'NSM', +846=>'NSM', +847=>'NSM', +848=>'NSM', +849=>'NSM', +850=>'NSM', +851=>'NSM', +852=>'NSM', +853=>'NSM', +854=>'NSM', +855=>'NSM', +856=>'NSM', +857=>'NSM', +858=>'NSM', +859=>'NSM', +860=>'NSM', +861=>'NSM', +862=>'NSM', +863=>'NSM', +864=>'NSM', +865=>'NSM', +866=>'NSM', +867=>'NSM', +868=>'NSM', +869=>'NSM', +870=>'NSM', +871=>'NSM', +872=>'NSM', +873=>'NSM', +874=>'NSM', +875=>'NSM', +876=>'NSM', +877=>'NSM', +878=>'NSM', +879=>'NSM', +884=>'ON', +885=>'ON', +890=>'L', +891=>'L', +892=>'L', +893=>'L', +894=>'ON', +900=>'ON', +901=>'ON', +902=>'L', +903=>'ON', +904=>'L', +905=>'L', +906=>'L', +908=>'L', +910=>'L', +911=>'L', +912=>'L', +913=>'L', +914=>'L', +915=>'L', +916=>'L', +917=>'L', +918=>'L', +919=>'L', +920=>'L', +921=>'L', +922=>'L', +923=>'L', +924=>'L', +925=>'L', +926=>'L', +927=>'L', +928=>'L', +929=>'L', +931=>'L', +932=>'L', +933=>'L', +934=>'L', +935=>'L', +936=>'L', +937=>'L', +938=>'L', +939=>'L', +940=>'L', +941=>'L', +942=>'L', +943=>'L', +944=>'L', +945=>'L', +946=>'L', +947=>'L', +948=>'L', +949=>'L', +950=>'L', +951=>'L', +952=>'L', +953=>'L', +954=>'L', +955=>'L', +956=>'L', +957=>'L', +958=>'L', +959=>'L', +960=>'L', +961=>'L', +962=>'L', +963=>'L', +964=>'L', +965=>'L', +966=>'L', +967=>'L', +968=>'L', +969=>'L', +970=>'L', +971=>'L', +972=>'L', +973=>'L', +974=>'L', +976=>'L', +977=>'L', +978=>'L', +979=>'L', +980=>'L', +981=>'L', +982=>'L', +983=>'L', +984=>'L', +985=>'L', +986=>'L', +987=>'L', +988=>'L', +989=>'L', +990=>'L', +991=>'L', +992=>'L', +993=>'L', +994=>'L', +995=>'L', +996=>'L', +997=>'L', +998=>'L', +999=>'L', +1000=>'L', +1001=>'L', +1002=>'L', +1003=>'L', +1004=>'L', +1005=>'L', +1006=>'L', +1007=>'L', +1008=>'L', +1009=>'L', +1010=>'L', +1011=>'L', +1012=>'L', +1013=>'L', +1014=>'ON', +1015=>'L', +1016=>'L', +1017=>'L', +1018=>'L', +1019=>'L', +1020=>'L', +1021=>'L', +1022=>'L', +1023=>'L', +1024=>'L', +1025=>'L', +1026=>'L', +1027=>'L', +1028=>'L', +1029=>'L', +1030=>'L', +1031=>'L', +1032=>'L', +1033=>'L', +1034=>'L', +1035=>'L', +1036=>'L', +1037=>'L', +1038=>'L', +1039=>'L', +1040=>'L', +1041=>'L', +1042=>'L', +1043=>'L', +1044=>'L', +1045=>'L', +1046=>'L', +1047=>'L', +1048=>'L', +1049=>'L', +1050=>'L', +1051=>'L', +1052=>'L', +1053=>'L', +1054=>'L', +1055=>'L', +1056=>'L', +1057=>'L', +1058=>'L', +1059=>'L', +1060=>'L', +1061=>'L', +1062=>'L', +1063=>'L', +1064=>'L', +1065=>'L', +1066=>'L', +1067=>'L', +1068=>'L', +1069=>'L', +1070=>'L', +1071=>'L', +1072=>'L', +1073=>'L', +1074=>'L', +1075=>'L', +1076=>'L', +1077=>'L', +1078=>'L', +1079=>'L', +1080=>'L', +1081=>'L', +1082=>'L', +1083=>'L', +1084=>'L', +1085=>'L', +1086=>'L', +1087=>'L', +1088=>'L', +1089=>'L', +1090=>'L', +1091=>'L', +1092=>'L', +1093=>'L', +1094=>'L', +1095=>'L', +1096=>'L', +1097=>'L', +1098=>'L', +1099=>'L', +1100=>'L', +1101=>'L', +1102=>'L', +1103=>'L', +1104=>'L', +1105=>'L', +1106=>'L', +1107=>'L', +1108=>'L', +1109=>'L', +1110=>'L', +1111=>'L', +1112=>'L', +1113=>'L', +1114=>'L', +1115=>'L', +1116=>'L', +1117=>'L', +1118=>'L', +1119=>'L', +1120=>'L', +1121=>'L', +1122=>'L', +1123=>'L', +1124=>'L', +1125=>'L', +1126=>'L', +1127=>'L', +1128=>'L', +1129=>'L', +1130=>'L', +1131=>'L', +1132=>'L', +1133=>'L', +1134=>'L', +1135=>'L', +1136=>'L', +1137=>'L', +1138=>'L', +1139=>'L', +1140=>'L', +1141=>'L', +1142=>'L', +1143=>'L', +1144=>'L', +1145=>'L', +1146=>'L', +1147=>'L', +1148=>'L', +1149=>'L', +1150=>'L', +1151=>'L', +1152=>'L', +1153=>'L', +1154=>'L', +1155=>'NSM', +1156=>'NSM', +1157=>'NSM', +1158=>'NSM', +1160=>'NSM', +1161=>'NSM', +1162=>'L', +1163=>'L', +1164=>'L', +1165=>'L', +1166=>'L', +1167=>'L', +1168=>'L', +1169=>'L', +1170=>'L', +1171=>'L', +1172=>'L', +1173=>'L', +1174=>'L', +1175=>'L', +1176=>'L', +1177=>'L', +1178=>'L', +1179=>'L', +1180=>'L', +1181=>'L', +1182=>'L', +1183=>'L', +1184=>'L', +1185=>'L', +1186=>'L', +1187=>'L', +1188=>'L', +1189=>'L', +1190=>'L', +1191=>'L', +1192=>'L', +1193=>'L', +1194=>'L', +1195=>'L', +1196=>'L', +1197=>'L', +1198=>'L', +1199=>'L', +1200=>'L', +1201=>'L', +1202=>'L', +1203=>'L', +1204=>'L', +1205=>'L', +1206=>'L', +1207=>'L', +1208=>'L', +1209=>'L', +1210=>'L', +1211=>'L', +1212=>'L', +1213=>'L', +1214=>'L', +1215=>'L', +1216=>'L', +1217=>'L', +1218=>'L', +1219=>'L', +1220=>'L', +1221=>'L', +1222=>'L', +1223=>'L', +1224=>'L', +1225=>'L', +1226=>'L', +1227=>'L', +1228=>'L', +1229=>'L', +1230=>'L', +1231=>'L', +1232=>'L', +1233=>'L', +1234=>'L', +1235=>'L', +1236=>'L', +1237=>'L', +1238=>'L', +1239=>'L', +1240=>'L', +1241=>'L', +1242=>'L', +1243=>'L', +1244=>'L', +1245=>'L', +1246=>'L', +1247=>'L', +1248=>'L', +1249=>'L', +1250=>'L', +1251=>'L', +1252=>'L', +1253=>'L', +1254=>'L', +1255=>'L', +1256=>'L', +1257=>'L', +1258=>'L', +1259=>'L', +1260=>'L', +1261=>'L', +1262=>'L', +1263=>'L', +1264=>'L', +1265=>'L', +1266=>'L', +1267=>'L', +1268=>'L', +1269=>'L', +1270=>'L', +1271=>'L', +1272=>'L', +1273=>'L', +1274=>'L', +1275=>'L', +1276=>'L', +1277=>'L', +1278=>'L', +1279=>'L', +1280=>'L', +1281=>'L', +1282=>'L', +1283=>'L', +1284=>'L', +1285=>'L', +1286=>'L', +1287=>'L', +1288=>'L', +1289=>'L', +1290=>'L', +1291=>'L', +1292=>'L', +1293=>'L', +1294=>'L', +1295=>'L', +1296=>'L', +1297=>'L', +1298=>'L', +1299=>'L', +1329=>'L', +1330=>'L', +1331=>'L', +1332=>'L', +1333=>'L', +1334=>'L', +1335=>'L', +1336=>'L', +1337=>'L', +1338=>'L', +1339=>'L', +1340=>'L', +1341=>'L', +1342=>'L', +1343=>'L', +1344=>'L', +1345=>'L', +1346=>'L', +1347=>'L', +1348=>'L', +1349=>'L', +1350=>'L', +1351=>'L', +1352=>'L', +1353=>'L', +1354=>'L', +1355=>'L', +1356=>'L', +1357=>'L', +1358=>'L', +1359=>'L', +1360=>'L', +1361=>'L', +1362=>'L', +1363=>'L', +1364=>'L', +1365=>'L', +1366=>'L', +1369=>'L', +1370=>'L', +1371=>'L', +1372=>'L', +1373=>'L', +1374=>'L', +1375=>'L', +1377=>'L', +1378=>'L', +1379=>'L', +1380=>'L', +1381=>'L', +1382=>'L', +1383=>'L', +1384=>'L', +1385=>'L', +1386=>'L', +1387=>'L', +1388=>'L', +1389=>'L', +1390=>'L', +1391=>'L', +1392=>'L', +1393=>'L', +1394=>'L', +1395=>'L', +1396=>'L', +1397=>'L', +1398=>'L', +1399=>'L', +1400=>'L', +1401=>'L', +1402=>'L', +1403=>'L', +1404=>'L', +1405=>'L', +1406=>'L', +1407=>'L', +1408=>'L', +1409=>'L', +1410=>'L', +1411=>'L', +1412=>'L', +1413=>'L', +1414=>'L', +1415=>'L', +1417=>'L', +1418=>'ON', +1425=>'NSM', +1426=>'NSM', +1427=>'NSM', +1428=>'NSM', +1429=>'NSM', +1430=>'NSM', +1431=>'NSM', +1432=>'NSM', +1433=>'NSM', +1434=>'NSM', +1435=>'NSM', +1436=>'NSM', +1437=>'NSM', +1438=>'NSM', +1439=>'NSM', +1440=>'NSM', +1441=>'NSM', +1442=>'NSM', +1443=>'NSM', +1444=>'NSM', +1445=>'NSM', +1446=>'NSM', +1447=>'NSM', +1448=>'NSM', +1449=>'NSM', +1450=>'NSM', +1451=>'NSM', +1452=>'NSM', +1453=>'NSM', +1454=>'NSM', +1455=>'NSM', +1456=>'NSM', +1457=>'NSM', +1458=>'NSM', +1459=>'NSM', +1460=>'NSM', +1461=>'NSM', +1462=>'NSM', +1463=>'NSM', +1464=>'NSM', +1465=>'NSM', +1466=>'NSM', +1467=>'NSM', +1468=>'NSM', +1469=>'NSM', +1470=>'R', +1471=>'NSM', +1472=>'R', +1473=>'NSM', +1474=>'NSM', +1475=>'R', +1476=>'NSM', +1477=>'NSM', +1478=>'R', +1479=>'NSM', +1488=>'R', +1489=>'R', +1490=>'R', +1491=>'R', +1492=>'R', +1493=>'R', +1494=>'R', +1495=>'R', +1496=>'R', +1497=>'R', +1498=>'R', +1499=>'R', +1500=>'R', +1501=>'R', +1502=>'R', +1503=>'R', +1504=>'R', +1505=>'R', +1506=>'R', +1507=>'R', +1508=>'R', +1509=>'R', +1510=>'R', +1511=>'R', +1512=>'R', +1513=>'R', +1514=>'R', +1520=>'R', +1521=>'R', +1522=>'R', +1523=>'R', +1524=>'R', +1536=>'AL', +1537=>'AL', +1538=>'AL', +1539=>'AL', +1547=>'AL', +1548=>'CS', +1549=>'AL', +1550=>'ON', +1551=>'ON', +1552=>'NSM', +1553=>'NSM', +1554=>'NSM', +1555=>'NSM', +1556=>'NSM', +1557=>'NSM', +1563=>'AL', +1566=>'AL', +1567=>'AL', +1569=>'AL', +1570=>'AL', +1571=>'AL', +1572=>'AL', +1573=>'AL', +1574=>'AL', +1575=>'AL', +1576=>'AL', +1577=>'AL', +1578=>'AL', +1579=>'AL', +1580=>'AL', +1581=>'AL', +1582=>'AL', +1583=>'AL', +1584=>'AL', +1585=>'AL', +1586=>'AL', +1587=>'AL', +1588=>'AL', +1589=>'AL', +1590=>'AL', +1591=>'AL', +1592=>'AL', +1593=>'AL', +1594=>'AL', +1600=>'AL', +1601=>'AL', +1602=>'AL', +1603=>'AL', +1604=>'AL', +1605=>'AL', +1606=>'AL', +1607=>'AL', +1608=>'AL', +1609=>'AL', +1610=>'AL', +1611=>'NSM', +1612=>'NSM', +1613=>'NSM', +1614=>'NSM', +1615=>'NSM', +1616=>'NSM', +1617=>'NSM', +1618=>'NSM', +1619=>'NSM', +1620=>'NSM', +1621=>'NSM', +1622=>'NSM', +1623=>'NSM', +1624=>'NSM', +1625=>'NSM', +1626=>'NSM', +1627=>'NSM', +1628=>'NSM', +1629=>'NSM', +1630=>'NSM', +1632=>'AN', +1633=>'AN', +1634=>'AN', +1635=>'AN', +1636=>'AN', +1637=>'AN', +1638=>'AN', +1639=>'AN', +1640=>'AN', +1641=>'AN', +1642=>'ET', +1643=>'AN', +1644=>'AN', +1645=>'AL', +1646=>'AL', +1647=>'AL', +1648=>'NSM', +1649=>'AL', +1650=>'AL', +1651=>'AL', +1652=>'AL', +1653=>'AL', +1654=>'AL', +1655=>'AL', +1656=>'AL', +1657=>'AL', +1658=>'AL', +1659=>'AL', +1660=>'AL', +1661=>'AL', +1662=>'AL', +1663=>'AL', +1664=>'AL', +1665=>'AL', +1666=>'AL', +1667=>'AL', +1668=>'AL', +1669=>'AL', +1670=>'AL', +1671=>'AL', +1672=>'AL', +1673=>'AL', +1674=>'AL', +1675=>'AL', +1676=>'AL', +1677=>'AL', +1678=>'AL', +1679=>'AL', +1680=>'AL', +1681=>'AL', +1682=>'AL', +1683=>'AL', +1684=>'AL', +1685=>'AL', +1686=>'AL', +1687=>'AL', +1688=>'AL', +1689=>'AL', +1690=>'AL', +1691=>'AL', +1692=>'AL', +1693=>'AL', +1694=>'AL', +1695=>'AL', +1696=>'AL', +1697=>'AL', +1698=>'AL', +1699=>'AL', +1700=>'AL', +1701=>'AL', +1702=>'AL', +1703=>'AL', +1704=>'AL', +1705=>'AL', +1706=>'AL', +1707=>'AL', +1708=>'AL', +1709=>'AL', +1710=>'AL', +1711=>'AL', +1712=>'AL', +1713=>'AL', +1714=>'AL', +1715=>'AL', +1716=>'AL', +1717=>'AL', +1718=>'AL', +1719=>'AL', +1720=>'AL', +1721=>'AL', +1722=>'AL', +1723=>'AL', +1724=>'AL', +1725=>'AL', +1726=>'AL', +1727=>'AL', +1728=>'AL', +1729=>'AL', +1730=>'AL', +1731=>'AL', +1732=>'AL', +1733=>'AL', +1734=>'AL', +1735=>'AL', +1736=>'AL', +1737=>'AL', +1738=>'AL', +1739=>'AL', +1740=>'AL', +1741=>'AL', +1742=>'AL', +1743=>'AL', +1744=>'AL', +1745=>'AL', +1746=>'AL', +1747=>'AL', +1748=>'AL', +1749=>'AL', +1750=>'NSM', +1751=>'NSM', +1752=>'NSM', +1753=>'NSM', +1754=>'NSM', +1755=>'NSM', +1756=>'NSM', +1757=>'AL', +1758=>'NSM', +1759=>'NSM', +1760=>'NSM', +1761=>'NSM', +1762=>'NSM', +1763=>'NSM', +1764=>'NSM', +1765=>'AL', +1766=>'AL', +1767=>'NSM', +1768=>'NSM', +1769=>'ON', +1770=>'NSM', +1771=>'NSM', +1772=>'NSM', +1773=>'NSM', +1774=>'AL', +1775=>'AL', +1776=>'EN', +1777=>'EN', +1778=>'EN', +1779=>'EN', +1780=>'EN', +1781=>'EN', +1782=>'EN', +1783=>'EN', +1784=>'EN', +1785=>'EN', +1786=>'AL', +1787=>'AL', +1788=>'AL', +1789=>'AL', +1790=>'AL', +1791=>'AL', +1792=>'AL', +1793=>'AL', +1794=>'AL', +1795=>'AL', +1796=>'AL', +1797=>'AL', +1798=>'AL', +1799=>'AL', +1800=>'AL', +1801=>'AL', +1802=>'AL', +1803=>'AL', +1804=>'AL', +1805=>'AL', +1807=>'BN', +1808=>'AL', +1809=>'NSM', +1810=>'AL', +1811=>'AL', +1812=>'AL', +1813=>'AL', +1814=>'AL', +1815=>'AL', +1816=>'AL', +1817=>'AL', +1818=>'AL', +1819=>'AL', +1820=>'AL', +1821=>'AL', +1822=>'AL', +1823=>'AL', +1824=>'AL', +1825=>'AL', +1826=>'AL', +1827=>'AL', +1828=>'AL', +1829=>'AL', +1830=>'AL', +1831=>'AL', +1832=>'AL', +1833=>'AL', +1834=>'AL', +1835=>'AL', +1836=>'AL', +1837=>'AL', +1838=>'AL', +1839=>'AL', +1840=>'NSM', +1841=>'NSM', +1842=>'NSM', +1843=>'NSM', +1844=>'NSM', +1845=>'NSM', +1846=>'NSM', +1847=>'NSM', +1848=>'NSM', +1849=>'NSM', +1850=>'NSM', +1851=>'NSM', +1852=>'NSM', +1853=>'NSM', +1854=>'NSM', +1855=>'NSM', +1856=>'NSM', +1857=>'NSM', +1858=>'NSM', +1859=>'NSM', +1860=>'NSM', +1861=>'NSM', +1862=>'NSM', +1863=>'NSM', +1864=>'NSM', +1865=>'NSM', +1866=>'NSM', +1869=>'AL', +1870=>'AL', +1871=>'AL', +1872=>'AL', +1873=>'AL', +1874=>'AL', +1875=>'AL', +1876=>'AL', +1877=>'AL', +1878=>'AL', +1879=>'AL', +1880=>'AL', +1881=>'AL', +1882=>'AL', +1883=>'AL', +1884=>'AL', +1885=>'AL', +1886=>'AL', +1887=>'AL', +1888=>'AL', +1889=>'AL', +1890=>'AL', +1891=>'AL', +1892=>'AL', +1893=>'AL', +1894=>'AL', +1895=>'AL', +1896=>'AL', +1897=>'AL', +1898=>'AL', +1899=>'AL', +1900=>'AL', +1901=>'AL', +1920=>'AL', +1921=>'AL', +1922=>'AL', +1923=>'AL', +1924=>'AL', +1925=>'AL', +1926=>'AL', +1927=>'AL', +1928=>'AL', +1929=>'AL', +1930=>'AL', +1931=>'AL', +1932=>'AL', +1933=>'AL', +1934=>'AL', +1935=>'AL', +1936=>'AL', +1937=>'AL', +1938=>'AL', +1939=>'AL', +1940=>'AL', +1941=>'AL', +1942=>'AL', +1943=>'AL', +1944=>'AL', +1945=>'AL', +1946=>'AL', +1947=>'AL', +1948=>'AL', +1949=>'AL', +1950=>'AL', +1951=>'AL', +1952=>'AL', +1953=>'AL', +1954=>'AL', +1955=>'AL', +1956=>'AL', +1957=>'AL', +1958=>'NSM', +1959=>'NSM', +1960=>'NSM', +1961=>'NSM', +1962=>'NSM', +1963=>'NSM', +1964=>'NSM', +1965=>'NSM', +1966=>'NSM', +1967=>'NSM', +1968=>'NSM', +1969=>'AL', +1984=>'R', +1985=>'R', +1986=>'R', +1987=>'R', +1988=>'R', +1989=>'R', +1990=>'R', +1991=>'R', +1992=>'R', +1993=>'R', +1994=>'R', +1995=>'R', +1996=>'R', +1997=>'R', +1998=>'R', +1999=>'R', +2000=>'R', +2001=>'R', +2002=>'R', +2003=>'R', +2004=>'R', +2005=>'R', +2006=>'R', +2007=>'R', +2008=>'R', +2009=>'R', +2010=>'R', +2011=>'R', +2012=>'R', +2013=>'R', +2014=>'R', +2015=>'R', +2016=>'R', +2017=>'R', +2018=>'R', +2019=>'R', +2020=>'R', +2021=>'R', +2022=>'R', +2023=>'R', +2024=>'R', +2025=>'R', +2026=>'R', +2027=>'NSM', +2028=>'NSM', +2029=>'NSM', +2030=>'NSM', +2031=>'NSM', +2032=>'NSM', +2033=>'NSM', +2034=>'NSM', +2035=>'NSM', +2036=>'R', +2037=>'R', +2038=>'ON', +2039=>'ON', +2040=>'ON', +2041=>'ON', +2042=>'R', +2305=>'NSM', +2306=>'NSM', +2307=>'L', +2308=>'L', +2309=>'L', +2310=>'L', +2311=>'L', +2312=>'L', +2313=>'L', +2314=>'L', +2315=>'L', +2316=>'L', +2317=>'L', +2318=>'L', +2319=>'L', +2320=>'L', +2321=>'L', +2322=>'L', +2323=>'L', +2324=>'L', +2325=>'L', +2326=>'L', +2327=>'L', +2328=>'L', +2329=>'L', +2330=>'L', +2331=>'L', +2332=>'L', +2333=>'L', +2334=>'L', +2335=>'L', +2336=>'L', +2337=>'L', +2338=>'L', +2339=>'L', +2340=>'L', +2341=>'L', +2342=>'L', +2343=>'L', +2344=>'L', +2345=>'L', +2346=>'L', +2347=>'L', +2348=>'L', +2349=>'L', +2350=>'L', +2351=>'L', +2352=>'L', +2353=>'L', +2354=>'L', +2355=>'L', +2356=>'L', +2357=>'L', +2358=>'L', +2359=>'L', +2360=>'L', +2361=>'L', +2364=>'NSM', +2365=>'L', +2366=>'L', +2367=>'L', +2368=>'L', +2369=>'NSM', +2370=>'NSM', +2371=>'NSM', +2372=>'NSM', +2373=>'NSM', +2374=>'NSM', +2375=>'NSM', +2376=>'NSM', +2377=>'L', +2378=>'L', +2379=>'L', +2380=>'L', +2381=>'NSM', +2384=>'L', +2385=>'NSM', +2386=>'NSM', +2387=>'NSM', +2388=>'NSM', +2392=>'L', +2393=>'L', +2394=>'L', +2395=>'L', +2396=>'L', +2397=>'L', +2398=>'L', +2399=>'L', +2400=>'L', +2401=>'L', +2402=>'NSM', +2403=>'NSM', +2404=>'L', +2405=>'L', +2406=>'L', +2407=>'L', +2408=>'L', +2409=>'L', +2410=>'L', +2411=>'L', +2412=>'L', +2413=>'L', +2414=>'L', +2415=>'L', +2416=>'L', +2427=>'L', +2428=>'L', +2429=>'L', +2430=>'L', +2431=>'L', +2433=>'NSM', +2434=>'L', +2435=>'L', +2437=>'L', +2438=>'L', +2439=>'L', +2440=>'L', +2441=>'L', +2442=>'L', +2443=>'L', +2444=>'L', +2447=>'L', +2448=>'L', +2451=>'L', +2452=>'L', +2453=>'L', +2454=>'L', +2455=>'L', +2456=>'L', +2457=>'L', +2458=>'L', +2459=>'L', +2460=>'L', +2461=>'L', +2462=>'L', +2463=>'L', +2464=>'L', +2465=>'L', +2466=>'L', +2467=>'L', +2468=>'L', +2469=>'L', +2470=>'L', +2471=>'L', +2472=>'L', +2474=>'L', +2475=>'L', +2476=>'L', +2477=>'L', +2478=>'L', +2479=>'L', +2480=>'L', +2482=>'L', +2486=>'L', +2487=>'L', +2488=>'L', +2489=>'L', +2492=>'NSM', +2493=>'L', +2494=>'L', +2495=>'L', +2496=>'L', +2497=>'NSM', +2498=>'NSM', +2499=>'NSM', +2500=>'NSM', +2503=>'L', +2504=>'L', +2507=>'L', +2508=>'L', +2509=>'NSM', +2510=>'L', +2519=>'L', +2524=>'L', +2525=>'L', +2527=>'L', +2528=>'L', +2529=>'L', +2530=>'NSM', +2531=>'NSM', +2534=>'L', +2535=>'L', +2536=>'L', +2537=>'L', +2538=>'L', +2539=>'L', +2540=>'L', +2541=>'L', +2542=>'L', +2543=>'L', +2544=>'L', +2545=>'L', +2546=>'ET', +2547=>'ET', +2548=>'L', +2549=>'L', +2550=>'L', +2551=>'L', +2552=>'L', +2553=>'L', +2554=>'L', +2561=>'NSM', +2562=>'NSM', +2563=>'L', +2565=>'L', +2566=>'L', +2567=>'L', +2568=>'L', +2569=>'L', +2570=>'L', +2575=>'L', +2576=>'L', +2579=>'L', +2580=>'L', +2581=>'L', +2582=>'L', +2583=>'L', +2584=>'L', +2585=>'L', +2586=>'L', +2587=>'L', +2588=>'L', +2589=>'L', +2590=>'L', +2591=>'L', +2592=>'L', +2593=>'L', +2594=>'L', +2595=>'L', +2596=>'L', +2597=>'L', +2598=>'L', +2599=>'L', +2600=>'L', +2602=>'L', +2603=>'L', +2604=>'L', +2605=>'L', +2606=>'L', +2607=>'L', +2608=>'L', +2610=>'L', +2611=>'L', +2613=>'L', +2614=>'L', +2616=>'L', +2617=>'L', +2620=>'NSM', +2622=>'L', +2623=>'L', +2624=>'L', +2625=>'NSM', +2626=>'NSM', +2631=>'NSM', +2632=>'NSM', +2635=>'NSM', +2636=>'NSM', +2637=>'NSM', +2649=>'L', +2650=>'L', +2651=>'L', +2652=>'L', +2654=>'L', +2662=>'L', +2663=>'L', +2664=>'L', +2665=>'L', +2666=>'L', +2667=>'L', +2668=>'L', +2669=>'L', +2670=>'L', +2671=>'L', +2672=>'NSM', +2673=>'NSM', +2674=>'L', +2675=>'L', +2676=>'L', +2689=>'NSM', +2690=>'NSM', +2691=>'L', +2693=>'L', +2694=>'L', +2695=>'L', +2696=>'L', +2697=>'L', +2698=>'L', +2699=>'L', +2700=>'L', +2701=>'L', +2703=>'L', +2704=>'L', +2705=>'L', +2707=>'L', +2708=>'L', +2709=>'L', +2710=>'L', +2711=>'L', +2712=>'L', +2713=>'L', +2714=>'L', +2715=>'L', +2716=>'L', +2717=>'L', +2718=>'L', +2719=>'L', +2720=>'L', +2721=>'L', +2722=>'L', +2723=>'L', +2724=>'L', +2725=>'L', +2726=>'L', +2727=>'L', +2728=>'L', +2730=>'L', +2731=>'L', +2732=>'L', +2733=>'L', +2734=>'L', +2735=>'L', +2736=>'L', +2738=>'L', +2739=>'L', +2741=>'L', +2742=>'L', +2743=>'L', +2744=>'L', +2745=>'L', +2748=>'NSM', +2749=>'L', +2750=>'L', +2751=>'L', +2752=>'L', +2753=>'NSM', +2754=>'NSM', +2755=>'NSM', +2756=>'NSM', +2757=>'NSM', +2759=>'NSM', +2760=>'NSM', +2761=>'L', +2763=>'L', +2764=>'L', +2765=>'NSM', +2768=>'L', +2784=>'L', +2785=>'L', +2786=>'NSM', +2787=>'NSM', +2790=>'L', +2791=>'L', +2792=>'L', +2793=>'L', +2794=>'L', +2795=>'L', +2796=>'L', +2797=>'L', +2798=>'L', +2799=>'L', +2801=>'ET', +2817=>'NSM', +2818=>'L', +2819=>'L', +2821=>'L', +2822=>'L', +2823=>'L', +2824=>'L', +2825=>'L', +2826=>'L', +2827=>'L', +2828=>'L', +2831=>'L', +2832=>'L', +2835=>'L', +2836=>'L', +2837=>'L', +2838=>'L', +2839=>'L', +2840=>'L', +2841=>'L', +2842=>'L', +2843=>'L', +2844=>'L', +2845=>'L', +2846=>'L', +2847=>'L', +2848=>'L', +2849=>'L', +2850=>'L', +2851=>'L', +2852=>'L', +2853=>'L', +2854=>'L', +2855=>'L', +2856=>'L', +2858=>'L', +2859=>'L', +2860=>'L', +2861=>'L', +2862=>'L', +2863=>'L', +2864=>'L', +2866=>'L', +2867=>'L', +2869=>'L', +2870=>'L', +2871=>'L', +2872=>'L', +2873=>'L', +2876=>'NSM', +2877=>'L', +2878=>'L', +2879=>'NSM', +2880=>'L', +2881=>'NSM', +2882=>'NSM', +2883=>'NSM', +2887=>'L', +2888=>'L', +2891=>'L', +2892=>'L', +2893=>'NSM', +2902=>'NSM', +2903=>'L', +2908=>'L', +2909=>'L', +2911=>'L', +2912=>'L', +2913=>'L', +2918=>'L', +2919=>'L', +2920=>'L', +2921=>'L', +2922=>'L', +2923=>'L', +2924=>'L', +2925=>'L', +2926=>'L', +2927=>'L', +2928=>'L', +2929=>'L', +2946=>'NSM', +2947=>'L', +2949=>'L', +2950=>'L', +2951=>'L', +2952=>'L', +2953=>'L', +2954=>'L', +2958=>'L', +2959=>'L', +2960=>'L', +2962=>'L', +2963=>'L', +2964=>'L', +2965=>'L', +2969=>'L', +2970=>'L', +2972=>'L', +2974=>'L', +2975=>'L', +2979=>'L', +2980=>'L', +2984=>'L', +2985=>'L', +2986=>'L', +2990=>'L', +2991=>'L', +2992=>'L', +2993=>'L', +2994=>'L', +2995=>'L', +2996=>'L', +2997=>'L', +2998=>'L', +2999=>'L', +3000=>'L', +3001=>'L', +3006=>'L', +3007=>'L', +3008=>'NSM', +3009=>'L', +3010=>'L', +3014=>'L', +3015=>'L', +3016=>'L', +3018=>'L', +3019=>'L', +3020=>'L', +3021=>'NSM', +3031=>'L', +3046=>'L', +3047=>'L', +3048=>'L', +3049=>'L', +3050=>'L', +3051=>'L', +3052=>'L', +3053=>'L', +3054=>'L', +3055=>'L', +3056=>'L', +3057=>'L', +3058=>'L', +3059=>'ON', +3060=>'ON', +3061=>'ON', +3062=>'ON', +3063=>'ON', +3064=>'ON', +3065=>'ET', +3066=>'ON', +3073=>'L', +3074=>'L', +3075=>'L', +3077=>'L', +3078=>'L', +3079=>'L', +3080=>'L', +3081=>'L', +3082=>'L', +3083=>'L', +3084=>'L', +3086=>'L', +3087=>'L', +3088=>'L', +3090=>'L', +3091=>'L', +3092=>'L', +3093=>'L', +3094=>'L', +3095=>'L', +3096=>'L', +3097=>'L', +3098=>'L', +3099=>'L', +3100=>'L', +3101=>'L', +3102=>'L', +3103=>'L', +3104=>'L', +3105=>'L', +3106=>'L', +3107=>'L', +3108=>'L', +3109=>'L', +3110=>'L', +3111=>'L', +3112=>'L', +3114=>'L', +3115=>'L', +3116=>'L', +3117=>'L', +3118=>'L', +3119=>'L', +3120=>'L', +3121=>'L', +3122=>'L', +3123=>'L', +3125=>'L', +3126=>'L', +3127=>'L', +3128=>'L', +3129=>'L', +3134=>'NSM', +3135=>'NSM', +3136=>'NSM', +3137=>'L', +3138=>'L', +3139=>'L', +3140=>'L', +3142=>'NSM', +3143=>'NSM', +3144=>'NSM', +3146=>'NSM', +3147=>'NSM', +3148=>'NSM', +3149=>'NSM', +3157=>'NSM', +3158=>'NSM', +3168=>'L', +3169=>'L', +3174=>'L', +3175=>'L', +3176=>'L', +3177=>'L', +3178=>'L', +3179=>'L', +3180=>'L', +3181=>'L', +3182=>'L', +3183=>'L', +3202=>'L', +3203=>'L', +3205=>'L', +3206=>'L', +3207=>'L', +3208=>'L', +3209=>'L', +3210=>'L', +3211=>'L', +3212=>'L', +3214=>'L', +3215=>'L', +3216=>'L', +3218=>'L', +3219=>'L', +3220=>'L', +3221=>'L', +3222=>'L', +3223=>'L', +3224=>'L', +3225=>'L', +3226=>'L', +3227=>'L', +3228=>'L', +3229=>'L', +3230=>'L', +3231=>'L', +3232=>'L', +3233=>'L', +3234=>'L', +3235=>'L', +3236=>'L', +3237=>'L', +3238=>'L', +3239=>'L', +3240=>'L', +3242=>'L', +3243=>'L', +3244=>'L', +3245=>'L', +3246=>'L', +3247=>'L', +3248=>'L', +3249=>'L', +3250=>'L', +3251=>'L', +3253=>'L', +3254=>'L', +3255=>'L', +3256=>'L', +3257=>'L', +3260=>'NSM', +3261=>'L', +3262=>'L', +3263=>'L', +3264=>'L', +3265=>'L', +3266=>'L', +3267=>'L', +3268=>'L', +3270=>'L', +3271=>'L', +3272=>'L', +3274=>'L', +3275=>'L', +3276=>'NSM', +3277=>'NSM', +3285=>'L', +3286=>'L', +3294=>'L', +3296=>'L', +3297=>'L', +3298=>'NSM', +3299=>'NSM', +3302=>'L', +3303=>'L', +3304=>'L', +3305=>'L', +3306=>'L', +3307=>'L', +3308=>'L', +3309=>'L', +3310=>'L', +3311=>'L', +3313=>'ON', +3314=>'ON', +3330=>'L', +3331=>'L', +3333=>'L', +3334=>'L', +3335=>'L', +3336=>'L', +3337=>'L', +3338=>'L', +3339=>'L', +3340=>'L', +3342=>'L', +3343=>'L', +3344=>'L', +3346=>'L', +3347=>'L', +3348=>'L', +3349=>'L', +3350=>'L', +3351=>'L', +3352=>'L', +3353=>'L', +3354=>'L', +3355=>'L', +3356=>'L', +3357=>'L', +3358=>'L', +3359=>'L', +3360=>'L', +3361=>'L', +3362=>'L', +3363=>'L', +3364=>'L', +3365=>'L', +3366=>'L', +3367=>'L', +3368=>'L', +3370=>'L', +3371=>'L', +3372=>'L', +3373=>'L', +3374=>'L', +3375=>'L', +3376=>'L', +3377=>'L', +3378=>'L', +3379=>'L', +3380=>'L', +3381=>'L', +3382=>'L', +3383=>'L', +3384=>'L', +3385=>'L', +3390=>'L', +3391=>'L', +3392=>'L', +3393=>'NSM', +3394=>'NSM', +3395=>'NSM', +3398=>'L', +3399=>'L', +3400=>'L', +3402=>'L', +3403=>'L', +3404=>'L', +3405=>'NSM', +3415=>'L', +3424=>'L', +3425=>'L', +3430=>'L', +3431=>'L', +3432=>'L', +3433=>'L', +3434=>'L', +3435=>'L', +3436=>'L', +3437=>'L', +3438=>'L', +3439=>'L', +3458=>'L', +3459=>'L', +3461=>'L', +3462=>'L', +3463=>'L', +3464=>'L', +3465=>'L', +3466=>'L', +3467=>'L', +3468=>'L', +3469=>'L', +3470=>'L', +3471=>'L', +3472=>'L', +3473=>'L', +3474=>'L', +3475=>'L', +3476=>'L', +3477=>'L', +3478=>'L', +3482=>'L', +3483=>'L', +3484=>'L', +3485=>'L', +3486=>'L', +3487=>'L', +3488=>'L', +3489=>'L', +3490=>'L', +3491=>'L', +3492=>'L', +3493=>'L', +3494=>'L', +3495=>'L', +3496=>'L', +3497=>'L', +3498=>'L', +3499=>'L', +3500=>'L', +3501=>'L', +3502=>'L', +3503=>'L', +3504=>'L', +3505=>'L', +3507=>'L', +3508=>'L', +3509=>'L', +3510=>'L', +3511=>'L', +3512=>'L', +3513=>'L', +3514=>'L', +3515=>'L', +3517=>'L', +3520=>'L', +3521=>'L', +3522=>'L', +3523=>'L', +3524=>'L', +3525=>'L', +3526=>'L', +3530=>'NSM', +3535=>'L', +3536=>'L', +3537=>'L', +3538=>'NSM', +3539=>'NSM', +3540=>'NSM', +3542=>'NSM', +3544=>'L', +3545=>'L', +3546=>'L', +3547=>'L', +3548=>'L', +3549=>'L', +3550=>'L', +3551=>'L', +3570=>'L', +3571=>'L', +3572=>'L', +3585=>'L', +3586=>'L', +3587=>'L', +3588=>'L', +3589=>'L', +3590=>'L', +3591=>'L', +3592=>'L', +3593=>'L', +3594=>'L', +3595=>'L', +3596=>'L', +3597=>'L', +3598=>'L', +3599=>'L', +3600=>'L', +3601=>'L', +3602=>'L', +3603=>'L', +3604=>'L', +3605=>'L', +3606=>'L', +3607=>'L', +3608=>'L', +3609=>'L', +3610=>'L', +3611=>'L', +3612=>'L', +3613=>'L', +3614=>'L', +3615=>'L', +3616=>'L', +3617=>'L', +3618=>'L', +3619=>'L', +3620=>'L', +3621=>'L', +3622=>'L', +3623=>'L', +3624=>'L', +3625=>'L', +3626=>'L', +3627=>'L', +3628=>'L', +3629=>'L', +3630=>'L', +3631=>'L', +3632=>'L', +3633=>'NSM', +3634=>'L', +3635=>'L', +3636=>'NSM', +3637=>'NSM', +3638=>'NSM', +3639=>'NSM', +3640=>'NSM', +3641=>'NSM', +3642=>'NSM', +3647=>'ET', +3648=>'L', +3649=>'L', +3650=>'L', +3651=>'L', +3652=>'L', +3653=>'L', +3654=>'L', +3655=>'NSM', +3656=>'NSM', +3657=>'NSM', +3658=>'NSM', +3659=>'NSM', +3660=>'NSM', +3661=>'NSM', +3662=>'NSM', +3663=>'L', +3664=>'L', +3665=>'L', +3666=>'L', +3667=>'L', +3668=>'L', +3669=>'L', +3670=>'L', +3671=>'L', +3672=>'L', +3673=>'L', +3674=>'L', +3675=>'L', +3713=>'L', +3714=>'L', +3716=>'L', +3719=>'L', +3720=>'L', +3722=>'L', +3725=>'L', +3732=>'L', +3733=>'L', +3734=>'L', +3735=>'L', +3737=>'L', +3738=>'L', +3739=>'L', +3740=>'L', +3741=>'L', +3742=>'L', +3743=>'L', +3745=>'L', +3746=>'L', +3747=>'L', +3749=>'L', +3751=>'L', +3754=>'L', +3755=>'L', +3757=>'L', +3758=>'L', +3759=>'L', +3760=>'L', +3761=>'NSM', +3762=>'L', +3763=>'L', +3764=>'NSM', +3765=>'NSM', +3766=>'NSM', +3767=>'NSM', +3768=>'NSM', +3769=>'NSM', +3771=>'NSM', +3772=>'NSM', +3773=>'L', +3776=>'L', +3777=>'L', +3778=>'L', +3779=>'L', +3780=>'L', +3782=>'L', +3784=>'NSM', +3785=>'NSM', +3786=>'NSM', +3787=>'NSM', +3788=>'NSM', +3789=>'NSM', +3792=>'L', +3793=>'L', +3794=>'L', +3795=>'L', +3796=>'L', +3797=>'L', +3798=>'L', +3799=>'L', +3800=>'L', +3801=>'L', +3804=>'L', +3805=>'L', +3840=>'L', +3841=>'L', +3842=>'L', +3843=>'L', +3844=>'L', +3845=>'L', +3846=>'L', +3847=>'L', +3848=>'L', +3849=>'L', +3850=>'L', +3851=>'L', +3852=>'L', +3853=>'L', +3854=>'L', +3855=>'L', +3856=>'L', +3857=>'L', +3858=>'L', +3859=>'L', +3860=>'L', +3861=>'L', +3862=>'L', +3863=>'L', +3864=>'NSM', +3865=>'NSM', +3866=>'L', +3867=>'L', +3868=>'L', +3869=>'L', +3870=>'L', +3871=>'L', +3872=>'L', +3873=>'L', +3874=>'L', +3875=>'L', +3876=>'L', +3877=>'L', +3878=>'L', +3879=>'L', +3880=>'L', +3881=>'L', +3882=>'L', +3883=>'L', +3884=>'L', +3885=>'L', +3886=>'L', +3887=>'L', +3888=>'L', +3889=>'L', +3890=>'L', +3891=>'L', +3892=>'L', +3893=>'NSM', +3894=>'L', +3895=>'NSM', +3896=>'L', +3897=>'NSM', +3898=>'ON', +3899=>'ON', +3900=>'ON', +3901=>'ON', +3902=>'L', +3903=>'L', +3904=>'L', +3905=>'L', +3906=>'L', +3907=>'L', +3908=>'L', +3909=>'L', +3910=>'L', +3911=>'L', +3913=>'L', +3914=>'L', +3915=>'L', +3916=>'L', +3917=>'L', +3918=>'L', +3919=>'L', +3920=>'L', +3921=>'L', +3922=>'L', +3923=>'L', +3924=>'L', +3925=>'L', +3926=>'L', +3927=>'L', +3928=>'L', +3929=>'L', +3930=>'L', +3931=>'L', +3932=>'L', +3933=>'L', +3934=>'L', +3935=>'L', +3936=>'L', +3937=>'L', +3938=>'L', +3939=>'L', +3940=>'L', +3941=>'L', +3942=>'L', +3943=>'L', +3944=>'L', +3945=>'L', +3946=>'L', +3953=>'NSM', +3954=>'NSM', +3955=>'NSM', +3956=>'NSM', +3957=>'NSM', +3958=>'NSM', +3959=>'NSM', +3960=>'NSM', +3961=>'NSM', +3962=>'NSM', +3963=>'NSM', +3964=>'NSM', +3965=>'NSM', +3966=>'NSM', +3967=>'L', +3968=>'NSM', +3969=>'NSM', +3970=>'NSM', +3971=>'NSM', +3972=>'NSM', +3973=>'L', +3974=>'NSM', +3975=>'NSM', +3976=>'L', +3977=>'L', +3978=>'L', +3979=>'L', +3984=>'NSM', +3985=>'NSM', +3986=>'NSM', +3987=>'NSM', +3988=>'NSM', +3989=>'NSM', +3990=>'NSM', +3991=>'NSM', +3993=>'NSM', +3994=>'NSM', +3995=>'NSM', +3996=>'NSM', +3997=>'NSM', +3998=>'NSM', +3999=>'NSM', +4000=>'NSM', +4001=>'NSM', +4002=>'NSM', +4003=>'NSM', +4004=>'NSM', +4005=>'NSM', +4006=>'NSM', +4007=>'NSM', +4008=>'NSM', +4009=>'NSM', +4010=>'NSM', +4011=>'NSM', +4012=>'NSM', +4013=>'NSM', +4014=>'NSM', +4015=>'NSM', +4016=>'NSM', +4017=>'NSM', +4018=>'NSM', +4019=>'NSM', +4020=>'NSM', +4021=>'NSM', +4022=>'NSM', +4023=>'NSM', +4024=>'NSM', +4025=>'NSM', +4026=>'NSM', +4027=>'NSM', +4028=>'NSM', +4030=>'L', +4031=>'L', +4032=>'L', +4033=>'L', +4034=>'L', +4035=>'L', +4036=>'L', +4037=>'L', +4038=>'NSM', +4039=>'L', +4040=>'L', +4041=>'L', +4042=>'L', +4043=>'L', +4044=>'L', +4047=>'L', +4048=>'L', +4049=>'L', +4096=>'L', +4097=>'L', +4098=>'L', +4099=>'L', +4100=>'L', +4101=>'L', +4102=>'L', +4103=>'L', +4104=>'L', +4105=>'L', +4106=>'L', +4107=>'L', +4108=>'L', +4109=>'L', +4110=>'L', +4111=>'L', +4112=>'L', +4113=>'L', +4114=>'L', +4115=>'L', +4116=>'L', +4117=>'L', +4118=>'L', +4119=>'L', +4120=>'L', +4121=>'L', +4122=>'L', +4123=>'L', +4124=>'L', +4125=>'L', +4126=>'L', +4127=>'L', +4128=>'L', +4129=>'L', +4131=>'L', +4132=>'L', +4133=>'L', +4134=>'L', +4135=>'L', +4137=>'L', +4138=>'L', +4140=>'L', +4141=>'NSM', +4142=>'NSM', +4143=>'NSM', +4144=>'NSM', +4145=>'L', +4146=>'NSM', +4150=>'NSM', +4151=>'NSM', +4152=>'L', +4153=>'NSM', +4160=>'L', +4161=>'L', +4162=>'L', +4163=>'L', +4164=>'L', +4165=>'L', +4166=>'L', +4167=>'L', +4168=>'L', +4169=>'L', +4170=>'L', +4171=>'L', +4172=>'L', +4173=>'L', +4174=>'L', +4175=>'L', +4176=>'L', +4177=>'L', +4178=>'L', +4179=>'L', +4180=>'L', +4181=>'L', +4182=>'L', +4183=>'L', +4184=>'NSM', +4185=>'NSM', +4256=>'L', +4257=>'L', +4258=>'L', +4259=>'L', +4260=>'L', +4261=>'L', +4262=>'L', +4263=>'L', +4264=>'L', +4265=>'L', +4266=>'L', +4267=>'L', +4268=>'L', +4269=>'L', +4270=>'L', +4271=>'L', +4272=>'L', +4273=>'L', +4274=>'L', +4275=>'L', +4276=>'L', +4277=>'L', +4278=>'L', +4279=>'L', +4280=>'L', +4281=>'L', +4282=>'L', +4283=>'L', +4284=>'L', +4285=>'L', +4286=>'L', +4287=>'L', +4288=>'L', +4289=>'L', +4290=>'L', +4291=>'L', +4292=>'L', +4293=>'L', +4304=>'L', +4305=>'L', +4306=>'L', +4307=>'L', +4308=>'L', +4309=>'L', +4310=>'L', +4311=>'L', +4312=>'L', +4313=>'L', +4314=>'L', +4315=>'L', +4316=>'L', +4317=>'L', +4318=>'L', +4319=>'L', +4320=>'L', +4321=>'L', +4322=>'L', +4323=>'L', +4324=>'L', +4325=>'L', +4326=>'L', +4327=>'L', +4328=>'L', +4329=>'L', +4330=>'L', +4331=>'L', +4332=>'L', +4333=>'L', +4334=>'L', +4335=>'L', +4336=>'L', +4337=>'L', +4338=>'L', +4339=>'L', +4340=>'L', +4341=>'L', +4342=>'L', +4343=>'L', +4344=>'L', +4345=>'L', +4346=>'L', +4347=>'L', +4348=>'L', +4352=>'L', +4353=>'L', +4354=>'L', +4355=>'L', +4356=>'L', +4357=>'L', +4358=>'L', +4359=>'L', +4360=>'L', +4361=>'L', +4362=>'L', +4363=>'L', +4364=>'L', +4365=>'L', +4366=>'L', +4367=>'L', +4368=>'L', +4369=>'L', +4370=>'L', +4371=>'L', +4372=>'L', +4373=>'L', +4374=>'L', +4375=>'L', +4376=>'L', +4377=>'L', +4378=>'L', +4379=>'L', +4380=>'L', +4381=>'L', +4382=>'L', +4383=>'L', +4384=>'L', +4385=>'L', +4386=>'L', +4387=>'L', +4388=>'L', +4389=>'L', +4390=>'L', +4391=>'L', +4392=>'L', +4393=>'L', +4394=>'L', +4395=>'L', +4396=>'L', +4397=>'L', +4398=>'L', +4399=>'L', +4400=>'L', +4401=>'L', +4402=>'L', +4403=>'L', +4404=>'L', +4405=>'L', +4406=>'L', +4407=>'L', +4408=>'L', +4409=>'L', +4410=>'L', +4411=>'L', +4412=>'L', +4413=>'L', +4414=>'L', +4415=>'L', +4416=>'L', +4417=>'L', +4418=>'L', +4419=>'L', +4420=>'L', +4421=>'L', +4422=>'L', +4423=>'L', +4424=>'L', +4425=>'L', +4426=>'L', +4427=>'L', +4428=>'L', +4429=>'L', +4430=>'L', +4431=>'L', +4432=>'L', +4433=>'L', +4434=>'L', +4435=>'L', +4436=>'L', +4437=>'L', +4438=>'L', +4439=>'L', +4440=>'L', +4441=>'L', +4447=>'L', +4448=>'L', +4449=>'L', +4450=>'L', +4451=>'L', +4452=>'L', +4453=>'L', +4454=>'L', +4455=>'L', +4456=>'L', +4457=>'L', +4458=>'L', +4459=>'L', +4460=>'L', +4461=>'L', +4462=>'L', +4463=>'L', +4464=>'L', +4465=>'L', +4466=>'L', +4467=>'L', +4468=>'L', +4469=>'L', +4470=>'L', +4471=>'L', +4472=>'L', +4473=>'L', +4474=>'L', +4475=>'L', +4476=>'L', +4477=>'L', +4478=>'L', +4479=>'L', +4480=>'L', +4481=>'L', +4482=>'L', +4483=>'L', +4484=>'L', +4485=>'L', +4486=>'L', +4487=>'L', +4488=>'L', +4489=>'L', +4490=>'L', +4491=>'L', +4492=>'L', +4493=>'L', +4494=>'L', +4495=>'L', +4496=>'L', +4497=>'L', +4498=>'L', +4499=>'L', +4500=>'L', +4501=>'L', +4502=>'L', +4503=>'L', +4504=>'L', +4505=>'L', +4506=>'L', +4507=>'L', +4508=>'L', +4509=>'L', +4510=>'L', +4511=>'L', +4512=>'L', +4513=>'L', +4514=>'L', +4520=>'L', +4521=>'L', +4522=>'L', +4523=>'L', +4524=>'L', +4525=>'L', +4526=>'L', +4527=>'L', +4528=>'L', +4529=>'L', +4530=>'L', +4531=>'L', +4532=>'L', +4533=>'L', +4534=>'L', +4535=>'L', +4536=>'L', +4537=>'L', +4538=>'L', +4539=>'L', +4540=>'L', +4541=>'L', +4542=>'L', +4543=>'L', +4544=>'L', +4545=>'L', +4546=>'L', +4547=>'L', +4548=>'L', +4549=>'L', +4550=>'L', +4551=>'L', +4552=>'L', +4553=>'L', +4554=>'L', +4555=>'L', +4556=>'L', +4557=>'L', +4558=>'L', +4559=>'L', +4560=>'L', +4561=>'L', +4562=>'L', +4563=>'L', +4564=>'L', +4565=>'L', +4566=>'L', +4567=>'L', +4568=>'L', +4569=>'L', +4570=>'L', +4571=>'L', +4572=>'L', +4573=>'L', +4574=>'L', +4575=>'L', +4576=>'L', +4577=>'L', +4578=>'L', +4579=>'L', +4580=>'L', +4581=>'L', +4582=>'L', +4583=>'L', +4584=>'L', +4585=>'L', +4586=>'L', +4587=>'L', +4588=>'L', +4589=>'L', +4590=>'L', +4591=>'L', +4592=>'L', +4593=>'L', +4594=>'L', +4595=>'L', +4596=>'L', +4597=>'L', +4598=>'L', +4599=>'L', +4600=>'L', +4601=>'L', +4608=>'L', +4609=>'L', +4610=>'L', +4611=>'L', +4612=>'L', +4613=>'L', +4614=>'L', +4615=>'L', +4616=>'L', +4617=>'L', +4618=>'L', +4619=>'L', +4620=>'L', +4621=>'L', +4622=>'L', +4623=>'L', +4624=>'L', +4625=>'L', +4626=>'L', +4627=>'L', +4628=>'L', +4629=>'L', +4630=>'L', +4631=>'L', +4632=>'L', +4633=>'L', +4634=>'L', +4635=>'L', +4636=>'L', +4637=>'L', +4638=>'L', +4639=>'L', +4640=>'L', +4641=>'L', +4642=>'L', +4643=>'L', +4644=>'L', +4645=>'L', +4646=>'L', +4647=>'L', +4648=>'L', +4649=>'L', +4650=>'L', +4651=>'L', +4652=>'L', +4653=>'L', +4654=>'L', +4655=>'L', +4656=>'L', +4657=>'L', +4658=>'L', +4659=>'L', +4660=>'L', +4661=>'L', +4662=>'L', +4663=>'L', +4664=>'L', +4665=>'L', +4666=>'L', +4667=>'L', +4668=>'L', +4669=>'L', +4670=>'L', +4671=>'L', +4672=>'L', +4673=>'L', +4674=>'L', +4675=>'L', +4676=>'L', +4677=>'L', +4678=>'L', +4679=>'L', +4680=>'L', +4682=>'L', +4683=>'L', +4684=>'L', +4685=>'L', +4688=>'L', +4689=>'L', +4690=>'L', +4691=>'L', +4692=>'L', +4693=>'L', +4694=>'L', +4696=>'L', +4698=>'L', +4699=>'L', +4700=>'L', +4701=>'L', +4704=>'L', +4705=>'L', +4706=>'L', +4707=>'L', +4708=>'L', +4709=>'L', +4710=>'L', +4711=>'L', +4712=>'L', +4713=>'L', +4714=>'L', +4715=>'L', +4716=>'L', +4717=>'L', +4718=>'L', +4719=>'L', +4720=>'L', +4721=>'L', +4722=>'L', +4723=>'L', +4724=>'L', +4725=>'L', +4726=>'L', +4727=>'L', +4728=>'L', +4729=>'L', +4730=>'L', +4731=>'L', +4732=>'L', +4733=>'L', +4734=>'L', +4735=>'L', +4736=>'L', +4737=>'L', +4738=>'L', +4739=>'L', +4740=>'L', +4741=>'L', +4742=>'L', +4743=>'L', +4744=>'L', +4746=>'L', +4747=>'L', +4748=>'L', +4749=>'L', +4752=>'L', +4753=>'L', +4754=>'L', +4755=>'L', +4756=>'L', +4757=>'L', +4758=>'L', +4759=>'L', +4760=>'L', +4761=>'L', +4762=>'L', +4763=>'L', +4764=>'L', +4765=>'L', +4766=>'L', +4767=>'L', +4768=>'L', +4769=>'L', +4770=>'L', +4771=>'L', +4772=>'L', +4773=>'L', +4774=>'L', +4775=>'L', +4776=>'L', +4777=>'L', +4778=>'L', +4779=>'L', +4780=>'L', +4781=>'L', +4782=>'L', +4783=>'L', +4784=>'L', +4786=>'L', +4787=>'L', +4788=>'L', +4789=>'L', +4792=>'L', +4793=>'L', +4794=>'L', +4795=>'L', +4796=>'L', +4797=>'L', +4798=>'L', +4800=>'L', +4802=>'L', +4803=>'L', +4804=>'L', +4805=>'L', +4808=>'L', +4809=>'L', +4810=>'L', +4811=>'L', +4812=>'L', +4813=>'L', +4814=>'L', +4815=>'L', +4816=>'L', +4817=>'L', +4818=>'L', +4819=>'L', +4820=>'L', +4821=>'L', +4822=>'L', +4824=>'L', +4825=>'L', +4826=>'L', +4827=>'L', +4828=>'L', +4829=>'L', +4830=>'L', +4831=>'L', +4832=>'L', +4833=>'L', +4834=>'L', +4835=>'L', +4836=>'L', +4837=>'L', +4838=>'L', +4839=>'L', +4840=>'L', +4841=>'L', +4842=>'L', +4843=>'L', +4844=>'L', +4845=>'L', +4846=>'L', +4847=>'L', +4848=>'L', +4849=>'L', +4850=>'L', +4851=>'L', +4852=>'L', +4853=>'L', +4854=>'L', +4855=>'L', +4856=>'L', +4857=>'L', +4858=>'L', +4859=>'L', +4860=>'L', +4861=>'L', +4862=>'L', +4863=>'L', +4864=>'L', +4865=>'L', +4866=>'L', +4867=>'L', +4868=>'L', +4869=>'L', +4870=>'L', +4871=>'L', +4872=>'L', +4873=>'L', +4874=>'L', +4875=>'L', +4876=>'L', +4877=>'L', +4878=>'L', +4879=>'L', +4880=>'L', +4882=>'L', +4883=>'L', +4884=>'L', +4885=>'L', +4888=>'L', +4889=>'L', +4890=>'L', +4891=>'L', +4892=>'L', +4893=>'L', +4894=>'L', +4895=>'L', +4896=>'L', +4897=>'L', +4898=>'L', +4899=>'L', +4900=>'L', +4901=>'L', +4902=>'L', +4903=>'L', +4904=>'L', +4905=>'L', +4906=>'L', +4907=>'L', +4908=>'L', +4909=>'L', +4910=>'L', +4911=>'L', +4912=>'L', +4913=>'L', +4914=>'L', +4915=>'L', +4916=>'L', +4917=>'L', +4918=>'L', +4919=>'L', +4920=>'L', +4921=>'L', +4922=>'L', +4923=>'L', +4924=>'L', +4925=>'L', +4926=>'L', +4927=>'L', +4928=>'L', +4929=>'L', +4930=>'L', +4931=>'L', +4932=>'L', +4933=>'L', +4934=>'L', +4935=>'L', +4936=>'L', +4937=>'L', +4938=>'L', +4939=>'L', +4940=>'L', +4941=>'L', +4942=>'L', +4943=>'L', +4944=>'L', +4945=>'L', +4946=>'L', +4947=>'L', +4948=>'L', +4949=>'L', +4950=>'L', +4951=>'L', +4952=>'L', +4953=>'L', +4954=>'L', +4959=>'NSM', +4960=>'L', +4961=>'L', +4962=>'L', +4963=>'L', +4964=>'L', +4965=>'L', +4966=>'L', +4967=>'L', +4968=>'L', +4969=>'L', +4970=>'L', +4971=>'L', +4972=>'L', +4973=>'L', +4974=>'L', +4975=>'L', +4976=>'L', +4977=>'L', +4978=>'L', +4979=>'L', +4980=>'L', +4981=>'L', +4982=>'L', +4983=>'L', +4984=>'L', +4985=>'L', +4986=>'L', +4987=>'L', +4988=>'L', +4992=>'L', +4993=>'L', +4994=>'L', +4995=>'L', +4996=>'L', +4997=>'L', +4998=>'L', +4999=>'L', +5000=>'L', +5001=>'L', +5002=>'L', +5003=>'L', +5004=>'L', +5005=>'L', +5006=>'L', +5007=>'L', +5008=>'ON', +5009=>'ON', +5010=>'ON', +5011=>'ON', +5012=>'ON', +5013=>'ON', +5014=>'ON', +5015=>'ON', +5016=>'ON', +5017=>'ON', +5024=>'L', +5025=>'L', +5026=>'L', +5027=>'L', +5028=>'L', +5029=>'L', +5030=>'L', +5031=>'L', +5032=>'L', +5033=>'L', +5034=>'L', +5035=>'L', +5036=>'L', +5037=>'L', +5038=>'L', +5039=>'L', +5040=>'L', +5041=>'L', +5042=>'L', +5043=>'L', +5044=>'L', +5045=>'L', +5046=>'L', +5047=>'L', +5048=>'L', +5049=>'L', +5050=>'L', +5051=>'L', +5052=>'L', +5053=>'L', +5054=>'L', +5055=>'L', +5056=>'L', +5057=>'L', +5058=>'L', +5059=>'L', +5060=>'L', +5061=>'L', +5062=>'L', +5063=>'L', +5064=>'L', +5065=>'L', +5066=>'L', +5067=>'L', +5068=>'L', +5069=>'L', +5070=>'L', +5071=>'L', +5072=>'L', +5073=>'L', +5074=>'L', +5075=>'L', +5076=>'L', +5077=>'L', +5078=>'L', +5079=>'L', +5080=>'L', +5081=>'L', +5082=>'L', +5083=>'L', +5084=>'L', +5085=>'L', +5086=>'L', +5087=>'L', +5088=>'L', +5089=>'L', +5090=>'L', +5091=>'L', +5092=>'L', +5093=>'L', +5094=>'L', +5095=>'L', +5096=>'L', +5097=>'L', +5098=>'L', +5099=>'L', +5100=>'L', +5101=>'L', +5102=>'L', +5103=>'L', +5104=>'L', +5105=>'L', +5106=>'L', +5107=>'L', +5108=>'L', +5121=>'L', +5122=>'L', +5123=>'L', +5124=>'L', +5125=>'L', +5126=>'L', +5127=>'L', +5128=>'L', +5129=>'L', +5130=>'L', +5131=>'L', +5132=>'L', +5133=>'L', +5134=>'L', +5135=>'L', +5136=>'L', +5137=>'L', +5138=>'L', +5139=>'L', +5140=>'L', +5141=>'L', +5142=>'L', +5143=>'L', +5144=>'L', +5145=>'L', +5146=>'L', +5147=>'L', +5148=>'L', +5149=>'L', +5150=>'L', +5151=>'L', +5152=>'L', +5153=>'L', +5154=>'L', +5155=>'L', +5156=>'L', +5157=>'L', +5158=>'L', +5159=>'L', +5160=>'L', +5161=>'L', +5162=>'L', +5163=>'L', +5164=>'L', +5165=>'L', +5166=>'L', +5167=>'L', +5168=>'L', +5169=>'L', +5170=>'L', +5171=>'L', +5172=>'L', +5173=>'L', +5174=>'L', +5175=>'L', +5176=>'L', +5177=>'L', +5178=>'L', +5179=>'L', +5180=>'L', +5181=>'L', +5182=>'L', +5183=>'L', +5184=>'L', +5185=>'L', +5186=>'L', +5187=>'L', +5188=>'L', +5189=>'L', +5190=>'L', +5191=>'L', +5192=>'L', +5193=>'L', +5194=>'L', +5195=>'L', +5196=>'L', +5197=>'L', +5198=>'L', +5199=>'L', +5200=>'L', +5201=>'L', +5202=>'L', +5203=>'L', +5204=>'L', +5205=>'L', +5206=>'L', +5207=>'L', +5208=>'L', +5209=>'L', +5210=>'L', +5211=>'L', +5212=>'L', +5213=>'L', +5214=>'L', +5215=>'L', +5216=>'L', +5217=>'L', +5218=>'L', +5219=>'L', +5220=>'L', +5221=>'L', +5222=>'L', +5223=>'L', +5224=>'L', +5225=>'L', +5226=>'L', +5227=>'L', +5228=>'L', +5229=>'L', +5230=>'L', +5231=>'L', +5232=>'L', +5233=>'L', +5234=>'L', +5235=>'L', +5236=>'L', +5237=>'L', +5238=>'L', +5239=>'L', +5240=>'L', +5241=>'L', +5242=>'L', +5243=>'L', +5244=>'L', +5245=>'L', +5246=>'L', +5247=>'L', +5248=>'L', +5249=>'L', +5250=>'L', +5251=>'L', +5252=>'L', +5253=>'L', +5254=>'L', +5255=>'L', +5256=>'L', +5257=>'L', +5258=>'L', +5259=>'L', +5260=>'L', +5261=>'L', +5262=>'L', +5263=>'L', +5264=>'L', +5265=>'L', +5266=>'L', +5267=>'L', +5268=>'L', +5269=>'L', +5270=>'L', +5271=>'L', +5272=>'L', +5273=>'L', +5274=>'L', +5275=>'L', +5276=>'L', +5277=>'L', +5278=>'L', +5279=>'L', +5280=>'L', +5281=>'L', +5282=>'L', +5283=>'L', +5284=>'L', +5285=>'L', +5286=>'L', +5287=>'L', +5288=>'L', +5289=>'L', +5290=>'L', +5291=>'L', +5292=>'L', +5293=>'L', +5294=>'L', +5295=>'L', +5296=>'L', +5297=>'L', +5298=>'L', +5299=>'L', +5300=>'L', +5301=>'L', +5302=>'L', +5303=>'L', +5304=>'L', +5305=>'L', +5306=>'L', +5307=>'L', +5308=>'L', +5309=>'L', +5310=>'L', +5311=>'L', +5312=>'L', +5313=>'L', +5314=>'L', +5315=>'L', +5316=>'L', +5317=>'L', +5318=>'L', +5319=>'L', +5320=>'L', +5321=>'L', +5322=>'L', +5323=>'L', +5324=>'L', +5325=>'L', +5326=>'L', +5327=>'L', +5328=>'L', +5329=>'L', +5330=>'L', +5331=>'L', +5332=>'L', +5333=>'L', +5334=>'L', +5335=>'L', +5336=>'L', +5337=>'L', +5338=>'L', +5339=>'L', +5340=>'L', +5341=>'L', +5342=>'L', +5343=>'L', +5344=>'L', +5345=>'L', +5346=>'L', +5347=>'L', +5348=>'L', +5349=>'L', +5350=>'L', +5351=>'L', +5352=>'L', +5353=>'L', +5354=>'L', +5355=>'L', +5356=>'L', +5357=>'L', +5358=>'L', +5359=>'L', +5360=>'L', +5361=>'L', +5362=>'L', +5363=>'L', +5364=>'L', +5365=>'L', +5366=>'L', +5367=>'L', +5368=>'L', +5369=>'L', +5370=>'L', +5371=>'L', +5372=>'L', +5373=>'L', +5374=>'L', +5375=>'L', +5376=>'L', +5377=>'L', +5378=>'L', +5379=>'L', +5380=>'L', +5381=>'L', +5382=>'L', +5383=>'L', +5384=>'L', +5385=>'L', +5386=>'L', +5387=>'L', +5388=>'L', +5389=>'L', +5390=>'L', +5391=>'L', +5392=>'L', +5393=>'L', +5394=>'L', +5395=>'L', +5396=>'L', +5397=>'L', +5398=>'L', +5399=>'L', +5400=>'L', +5401=>'L', +5402=>'L', +5403=>'L', +5404=>'L', +5405=>'L', +5406=>'L', +5407=>'L', +5408=>'L', +5409=>'L', +5410=>'L', +5411=>'L', +5412=>'L', +5413=>'L', +5414=>'L', +5415=>'L', +5416=>'L', +5417=>'L', +5418=>'L', +5419=>'L', +5420=>'L', +5421=>'L', +5422=>'L', +5423=>'L', +5424=>'L', +5425=>'L', +5426=>'L', +5427=>'L', +5428=>'L', +5429=>'L', +5430=>'L', +5431=>'L', +5432=>'L', +5433=>'L', +5434=>'L', +5435=>'L', +5436=>'L', +5437=>'L', +5438=>'L', +5439=>'L', +5440=>'L', +5441=>'L', +5442=>'L', +5443=>'L', +5444=>'L', +5445=>'L', +5446=>'L', +5447=>'L', +5448=>'L', +5449=>'L', +5450=>'L', +5451=>'L', +5452=>'L', +5453=>'L', +5454=>'L', +5455=>'L', +5456=>'L', +5457=>'L', +5458=>'L', +5459=>'L', +5460=>'L', +5461=>'L', +5462=>'L', +5463=>'L', +5464=>'L', +5465=>'L', +5466=>'L', +5467=>'L', +5468=>'L', +5469=>'L', +5470=>'L', +5471=>'L', +5472=>'L', +5473=>'L', +5474=>'L', +5475=>'L', +5476=>'L', +5477=>'L', +5478=>'L', +5479=>'L', +5480=>'L', +5481=>'L', +5482=>'L', +5483=>'L', +5484=>'L', +5485=>'L', +5486=>'L', +5487=>'L', +5488=>'L', +5489=>'L', +5490=>'L', +5491=>'L', +5492=>'L', +5493=>'L', +5494=>'L', +5495=>'L', +5496=>'L', +5497=>'L', +5498=>'L', +5499=>'L', +5500=>'L', +5501=>'L', +5502=>'L', +5503=>'L', +5504=>'L', +5505=>'L', +5506=>'L', +5507=>'L', +5508=>'L', +5509=>'L', +5510=>'L', +5511=>'L', +5512=>'L', +5513=>'L', +5514=>'L', +5515=>'L', +5516=>'L', +5517=>'L', +5518=>'L', +5519=>'L', +5520=>'L', +5521=>'L', +5522=>'L', +5523=>'L', +5524=>'L', +5525=>'L', +5526=>'L', +5527=>'L', +5528=>'L', +5529=>'L', +5530=>'L', +5531=>'L', +5532=>'L', +5533=>'L', +5534=>'L', +5535=>'L', +5536=>'L', +5537=>'L', +5538=>'L', +5539=>'L', +5540=>'L', +5541=>'L', +5542=>'L', +5543=>'L', +5544=>'L', +5545=>'L', +5546=>'L', +5547=>'L', +5548=>'L', +5549=>'L', +5550=>'L', +5551=>'L', +5552=>'L', +5553=>'L', +5554=>'L', +5555=>'L', +5556=>'L', +5557=>'L', +5558=>'L', +5559=>'L', +5560=>'L', +5561=>'L', +5562=>'L', +5563=>'L', +5564=>'L', +5565=>'L', +5566=>'L', +5567=>'L', +5568=>'L', +5569=>'L', +5570=>'L', +5571=>'L', +5572=>'L', +5573=>'L', +5574=>'L', +5575=>'L', +5576=>'L', +5577=>'L', +5578=>'L', +5579=>'L', +5580=>'L', +5581=>'L', +5582=>'L', +5583=>'L', +5584=>'L', +5585=>'L', +5586=>'L', +5587=>'L', +5588=>'L', +5589=>'L', +5590=>'L', +5591=>'L', +5592=>'L', +5593=>'L', +5594=>'L', +5595=>'L', +5596=>'L', +5597=>'L', +5598=>'L', +5599=>'L', +5600=>'L', +5601=>'L', +5602=>'L', +5603=>'L', +5604=>'L', +5605=>'L', +5606=>'L', +5607=>'L', +5608=>'L', +5609=>'L', +5610=>'L', +5611=>'L', +5612=>'L', +5613=>'L', +5614=>'L', +5615=>'L', +5616=>'L', +5617=>'L', +5618=>'L', +5619=>'L', +5620=>'L', +5621=>'L', +5622=>'L', +5623=>'L', +5624=>'L', +5625=>'L', +5626=>'L', +5627=>'L', +5628=>'L', +5629=>'L', +5630=>'L', +5631=>'L', +5632=>'L', +5633=>'L', +5634=>'L', +5635=>'L', +5636=>'L', +5637=>'L', +5638=>'L', +5639=>'L', +5640=>'L', +5641=>'L', +5642=>'L', +5643=>'L', +5644=>'L', +5645=>'L', +5646=>'L', +5647=>'L', +5648=>'L', +5649=>'L', +5650=>'L', +5651=>'L', +5652=>'L', +5653=>'L', +5654=>'L', +5655=>'L', +5656=>'L', +5657=>'L', +5658=>'L', +5659=>'L', +5660=>'L', +5661=>'L', +5662=>'L', +5663=>'L', +5664=>'L', +5665=>'L', +5666=>'L', +5667=>'L', +5668=>'L', +5669=>'L', +5670=>'L', +5671=>'L', +5672=>'L', +5673=>'L', +5674=>'L', +5675=>'L', +5676=>'L', +5677=>'L', +5678=>'L', +5679=>'L', +5680=>'L', +5681=>'L', +5682=>'L', +5683=>'L', +5684=>'L', +5685=>'L', +5686=>'L', +5687=>'L', +5688=>'L', +5689=>'L', +5690=>'L', +5691=>'L', +5692=>'L', +5693=>'L', +5694=>'L', +5695=>'L', +5696=>'L', +5697=>'L', +5698=>'L', +5699=>'L', +5700=>'L', +5701=>'L', +5702=>'L', +5703=>'L', +5704=>'L', +5705=>'L', +5706=>'L', +5707=>'L', +5708=>'L', +5709=>'L', +5710=>'L', +5711=>'L', +5712=>'L', +5713=>'L', +5714=>'L', +5715=>'L', +5716=>'L', +5717=>'L', +5718=>'L', +5719=>'L', +5720=>'L', +5721=>'L', +5722=>'L', +5723=>'L', +5724=>'L', +5725=>'L', +5726=>'L', +5727=>'L', +5728=>'L', +5729=>'L', +5730=>'L', +5731=>'L', +5732=>'L', +5733=>'L', +5734=>'L', +5735=>'L', +5736=>'L', +5737=>'L', +5738=>'L', +5739=>'L', +5740=>'L', +5741=>'L', +5742=>'L', +5743=>'L', +5744=>'L', +5745=>'L', +5746=>'L', +5747=>'L', +5748=>'L', +5749=>'L', +5750=>'L', +5760=>'WS', +5761=>'L', +5762=>'L', +5763=>'L', +5764=>'L', +5765=>'L', +5766=>'L', +5767=>'L', +5768=>'L', +5769=>'L', +5770=>'L', +5771=>'L', +5772=>'L', +5773=>'L', +5774=>'L', +5775=>'L', +5776=>'L', +5777=>'L', +5778=>'L', +5779=>'L', +5780=>'L', +5781=>'L', +5782=>'L', +5783=>'L', +5784=>'L', +5785=>'L', +5786=>'L', +5787=>'ON', +5788=>'ON', +5792=>'L', +5793=>'L', +5794=>'L', +5795=>'L', +5796=>'L', +5797=>'L', +5798=>'L', +5799=>'L', +5800=>'L', +5801=>'L', +5802=>'L', +5803=>'L', +5804=>'L', +5805=>'L', +5806=>'L', +5807=>'L', +5808=>'L', +5809=>'L', +5810=>'L', +5811=>'L', +5812=>'L', +5813=>'L', +5814=>'L', +5815=>'L', +5816=>'L', +5817=>'L', +5818=>'L', +5819=>'L', +5820=>'L', +5821=>'L', +5822=>'L', +5823=>'L', +5824=>'L', +5825=>'L', +5826=>'L', +5827=>'L', +5828=>'L', +5829=>'L', +5830=>'L', +5831=>'L', +5832=>'L', +5833=>'L', +5834=>'L', +5835=>'L', +5836=>'L', +5837=>'L', +5838=>'L', +5839=>'L', +5840=>'L', +5841=>'L', +5842=>'L', +5843=>'L', +5844=>'L', +5845=>'L', +5846=>'L', +5847=>'L', +5848=>'L', +5849=>'L', +5850=>'L', +5851=>'L', +5852=>'L', +5853=>'L', +5854=>'L', +5855=>'L', +5856=>'L', +5857=>'L', +5858=>'L', +5859=>'L', +5860=>'L', +5861=>'L', +5862=>'L', +5863=>'L', +5864=>'L', +5865=>'L', +5866=>'L', +5867=>'L', +5868=>'L', +5869=>'L', +5870=>'L', +5871=>'L', +5872=>'L', +5888=>'L', +5889=>'L', +5890=>'L', +5891=>'L', +5892=>'L', +5893=>'L', +5894=>'L', +5895=>'L', +5896=>'L', +5897=>'L', +5898=>'L', +5899=>'L', +5900=>'L', +5902=>'L', +5903=>'L', +5904=>'L', +5905=>'L', +5906=>'NSM', +5907=>'NSM', +5908=>'NSM', +5920=>'L', +5921=>'L', +5922=>'L', +5923=>'L', +5924=>'L', +5925=>'L', +5926=>'L', +5927=>'L', +5928=>'L', +5929=>'L', +5930=>'L', +5931=>'L', +5932=>'L', +5933=>'L', +5934=>'L', +5935=>'L', +5936=>'L', +5937=>'L', +5938=>'NSM', +5939=>'NSM', +5940=>'NSM', +5941=>'L', +5942=>'L', +5952=>'L', +5953=>'L', +5954=>'L', +5955=>'L', +5956=>'L', +5957=>'L', +5958=>'L', +5959=>'L', +5960=>'L', +5961=>'L', +5962=>'L', +5963=>'L', +5964=>'L', +5965=>'L', +5966=>'L', +5967=>'L', +5968=>'L', +5969=>'L', +5970=>'NSM', +5971=>'NSM', +5984=>'L', +5985=>'L', +5986=>'L', +5987=>'L', +5988=>'L', +5989=>'L', +5990=>'L', +5991=>'L', +5992=>'L', +5993=>'L', +5994=>'L', +5995=>'L', +5996=>'L', +5998=>'L', +5999=>'L', +6000=>'L', +6002=>'NSM', +6003=>'NSM', +6016=>'L', +6017=>'L', +6018=>'L', +6019=>'L', +6020=>'L', +6021=>'L', +6022=>'L', +6023=>'L', +6024=>'L', +6025=>'L', +6026=>'L', +6027=>'L', +6028=>'L', +6029=>'L', +6030=>'L', +6031=>'L', +6032=>'L', +6033=>'L', +6034=>'L', +6035=>'L', +6036=>'L', +6037=>'L', +6038=>'L', +6039=>'L', +6040=>'L', +6041=>'L', +6042=>'L', +6043=>'L', +6044=>'L', +6045=>'L', +6046=>'L', +6047=>'L', +6048=>'L', +6049=>'L', +6050=>'L', +6051=>'L', +6052=>'L', +6053=>'L', +6054=>'L', +6055=>'L', +6056=>'L', +6057=>'L', +6058=>'L', +6059=>'L', +6060=>'L', +6061=>'L', +6062=>'L', +6063=>'L', +6064=>'L', +6065=>'L', +6066=>'L', +6067=>'L', +6068=>'L', +6069=>'L', +6070=>'L', +6071=>'NSM', +6072=>'NSM', +6073=>'NSM', +6074=>'NSM', +6075=>'NSM', +6076=>'NSM', +6077=>'NSM', +6078=>'L', +6079=>'L', +6080=>'L', +6081=>'L', +6082=>'L', +6083=>'L', +6084=>'L', +6085=>'L', +6086=>'NSM', +6087=>'L', +6088=>'L', +6089=>'NSM', +6090=>'NSM', +6091=>'NSM', +6092=>'NSM', +6093=>'NSM', +6094=>'NSM', +6095=>'NSM', +6096=>'NSM', +6097=>'NSM', +6098=>'NSM', +6099=>'NSM', +6100=>'L', +6101=>'L', +6102=>'L', +6103=>'L', +6104=>'L', +6105=>'L', +6106=>'L', +6107=>'ET', +6108=>'L', +6109=>'NSM', +6112=>'L', +6113=>'L', +6114=>'L', +6115=>'L', +6116=>'L', +6117=>'L', +6118=>'L', +6119=>'L', +6120=>'L', +6121=>'L', +6128=>'ON', +6129=>'ON', +6130=>'ON', +6131=>'ON', +6132=>'ON', +6133=>'ON', +6134=>'ON', +6135=>'ON', +6136=>'ON', +6137=>'ON', +6144=>'ON', +6145=>'ON', +6146=>'ON', +6147=>'ON', +6148=>'ON', +6149=>'ON', +6150=>'ON', +6151=>'ON', +6152=>'ON', +6153=>'ON', +6154=>'ON', +6155=>'NSM', +6156=>'NSM', +6157=>'NSM', +6158=>'WS', +6160=>'L', +6161=>'L', +6162=>'L', +6163=>'L', +6164=>'L', +6165=>'L', +6166=>'L', +6167=>'L', +6168=>'L', +6169=>'L', +6176=>'L', +6177=>'L', +6178=>'L', +6179=>'L', +6180=>'L', +6181=>'L', +6182=>'L', +6183=>'L', +6184=>'L', +6185=>'L', +6186=>'L', +6187=>'L', +6188=>'L', +6189=>'L', +6190=>'L', +6191=>'L', +6192=>'L', +6193=>'L', +6194=>'L', +6195=>'L', +6196=>'L', +6197=>'L', +6198=>'L', +6199=>'L', +6200=>'L', +6201=>'L', +6202=>'L', +6203=>'L', +6204=>'L', +6205=>'L', +6206=>'L', +6207=>'L', +6208=>'L', +6209=>'L', +6210=>'L', +6211=>'L', +6212=>'L', +6213=>'L', +6214=>'L', +6215=>'L', +6216=>'L', +6217=>'L', +6218=>'L', +6219=>'L', +6220=>'L', +6221=>'L', +6222=>'L', +6223=>'L', +6224=>'L', +6225=>'L', +6226=>'L', +6227=>'L', +6228=>'L', +6229=>'L', +6230=>'L', +6231=>'L', +6232=>'L', +6233=>'L', +6234=>'L', +6235=>'L', +6236=>'L', +6237=>'L', +6238=>'L', +6239=>'L', +6240=>'L', +6241=>'L', +6242=>'L', +6243=>'L', +6244=>'L', +6245=>'L', +6246=>'L', +6247=>'L', +6248=>'L', +6249=>'L', +6250=>'L', +6251=>'L', +6252=>'L', +6253=>'L', +6254=>'L', +6255=>'L', +6256=>'L', +6257=>'L', +6258=>'L', +6259=>'L', +6260=>'L', +6261=>'L', +6262=>'L', +6263=>'L', +6272=>'L', +6273=>'L', +6274=>'L', +6275=>'L', +6276=>'L', +6277=>'L', +6278=>'L', +6279=>'L', +6280=>'L', +6281=>'L', +6282=>'L', +6283=>'L', +6284=>'L', +6285=>'L', +6286=>'L', +6287=>'L', +6288=>'L', +6289=>'L', +6290=>'L', +6291=>'L', +6292=>'L', +6293=>'L', +6294=>'L', +6295=>'L', +6296=>'L', +6297=>'L', +6298=>'L', +6299=>'L', +6300=>'L', +6301=>'L', +6302=>'L', +6303=>'L', +6304=>'L', +6305=>'L', +6306=>'L', +6307=>'L', +6308=>'L', +6309=>'L', +6310=>'L', +6311=>'L', +6312=>'L', +6313=>'NSM', +6400=>'L', +6401=>'L', +6402=>'L', +6403=>'L', +6404=>'L', +6405=>'L', +6406=>'L', +6407=>'L', +6408=>'L', +6409=>'L', +6410=>'L', +6411=>'L', +6412=>'L', +6413=>'L', +6414=>'L', +6415=>'L', +6416=>'L', +6417=>'L', +6418=>'L', +6419=>'L', +6420=>'L', +6421=>'L', +6422=>'L', +6423=>'L', +6424=>'L', +6425=>'L', +6426=>'L', +6427=>'L', +6428=>'L', +6432=>'NSM', +6433=>'NSM', +6434=>'NSM', +6435=>'L', +6436=>'L', +6437=>'L', +6438=>'L', +6439=>'NSM', +6440=>'NSM', +6441=>'NSM', +6442=>'NSM', +6443=>'NSM', +6448=>'L', +6449=>'L', +6450=>'NSM', +6451=>'L', +6452=>'L', +6453=>'L', +6454=>'L', +6455=>'L', +6456=>'L', +6457=>'NSM', +6458=>'NSM', +6459=>'NSM', +6464=>'ON', +6468=>'ON', +6469=>'ON', +6470=>'L', +6471=>'L', +6472=>'L', +6473=>'L', +6474=>'L', +6475=>'L', +6476=>'L', +6477=>'L', +6478=>'L', +6479=>'L', +6480=>'L', +6481=>'L', +6482=>'L', +6483=>'L', +6484=>'L', +6485=>'L', +6486=>'L', +6487=>'L', +6488=>'L', +6489=>'L', +6490=>'L', +6491=>'L', +6492=>'L', +6493=>'L', +6494=>'L', +6495=>'L', +6496=>'L', +6497=>'L', +6498=>'L', +6499=>'L', +6500=>'L', +6501=>'L', +6502=>'L', +6503=>'L', +6504=>'L', +6505=>'L', +6506=>'L', +6507=>'L', +6508=>'L', +6509=>'L', +6512=>'L', +6513=>'L', +6514=>'L', +6515=>'L', +6516=>'L', +6528=>'L', +6529=>'L', +6530=>'L', +6531=>'L', +6532=>'L', +6533=>'L', +6534=>'L', +6535=>'L', +6536=>'L', +6537=>'L', +6538=>'L', +6539=>'L', +6540=>'L', +6541=>'L', +6542=>'L', +6543=>'L', +6544=>'L', +6545=>'L', +6546=>'L', +6547=>'L', +6548=>'L', +6549=>'L', +6550=>'L', +6551=>'L', +6552=>'L', +6553=>'L', +6554=>'L', +6555=>'L', +6556=>'L', +6557=>'L', +6558=>'L', +6559=>'L', +6560=>'L', +6561=>'L', +6562=>'L', +6563=>'L', +6564=>'L', +6565=>'L', +6566=>'L', +6567=>'L', +6568=>'L', +6569=>'L', +6576=>'L', +6577=>'L', +6578=>'L', +6579=>'L', +6580=>'L', +6581=>'L', +6582=>'L', +6583=>'L', +6584=>'L', +6585=>'L', +6586=>'L', +6587=>'L', +6588=>'L', +6589=>'L', +6590=>'L', +6591=>'L', +6592=>'L', +6593=>'L', +6594=>'L', +6595=>'L', +6596=>'L', +6597=>'L', +6598=>'L', +6599=>'L', +6600=>'L', +6601=>'L', +6608=>'L', +6609=>'L', +6610=>'L', +6611=>'L', +6612=>'L', +6613=>'L', +6614=>'L', +6615=>'L', +6616=>'L', +6617=>'L', +6622=>'ON', +6623=>'ON', +6624=>'ON', +6625=>'ON', +6626=>'ON', +6627=>'ON', +6628=>'ON', +6629=>'ON', +6630=>'ON', +6631=>'ON', +6632=>'ON', +6633=>'ON', +6634=>'ON', +6635=>'ON', +6636=>'ON', +6637=>'ON', +6638=>'ON', +6639=>'ON', +6640=>'ON', +6641=>'ON', +6642=>'ON', +6643=>'ON', +6644=>'ON', +6645=>'ON', +6646=>'ON', +6647=>'ON', +6648=>'ON', +6649=>'ON', +6650=>'ON', +6651=>'ON', +6652=>'ON', +6653=>'ON', +6654=>'ON', +6655=>'ON', +6656=>'L', +6657=>'L', +6658=>'L', +6659=>'L', +6660=>'L', +6661=>'L', +6662=>'L', +6663=>'L', +6664=>'L', +6665=>'L', +6666=>'L', +6667=>'L', +6668=>'L', +6669=>'L', +6670=>'L', +6671=>'L', +6672=>'L', +6673=>'L', +6674=>'L', +6675=>'L', +6676=>'L', +6677=>'L', +6678=>'L', +6679=>'NSM', +6680=>'NSM', +6681=>'L', +6682=>'L', +6683=>'L', +6686=>'L', +6687=>'L', +6912=>'NSM', +6913=>'NSM', +6914=>'NSM', +6915=>'NSM', +6916=>'L', +6917=>'L', +6918=>'L', +6919=>'L', +6920=>'L', +6921=>'L', +6922=>'L', +6923=>'L', +6924=>'L', +6925=>'L', +6926=>'L', +6927=>'L', +6928=>'L', +6929=>'L', +6930=>'L', +6931=>'L', +6932=>'L', +6933=>'L', +6934=>'L', +6935=>'L', +6936=>'L', +6937=>'L', +6938=>'L', +6939=>'L', +6940=>'L', +6941=>'L', +6942=>'L', +6943=>'L', +6944=>'L', +6945=>'L', +6946=>'L', +6947=>'L', +6948=>'L', +6949=>'L', +6950=>'L', +6951=>'L', +6952=>'L', +6953=>'L', +6954=>'L', +6955=>'L', +6956=>'L', +6957=>'L', +6958=>'L', +6959=>'L', +6960=>'L', +6961=>'L', +6962=>'L', +6963=>'L', +6964=>'NSM', +6965=>'L', +6966=>'NSM', +6967=>'NSM', +6968=>'NSM', +6969=>'NSM', +6970=>'NSM', +6971=>'L', +6972=>'NSM', +6973=>'L', +6974=>'L', +6975=>'L', +6976=>'L', +6977=>'L', +6978=>'NSM', +6979=>'L', +6980=>'L', +6981=>'L', +6982=>'L', +6983=>'L', +6984=>'L', +6985=>'L', +6986=>'L', +6987=>'L', +6992=>'L', +6993=>'L', +6994=>'L', +6995=>'L', +6996=>'L', +6997=>'L', +6998=>'L', +6999=>'L', +7000=>'L', +7001=>'L', +7002=>'L', +7003=>'L', +7004=>'L', +7005=>'L', +7006=>'L', +7007=>'L', +7008=>'L', +7009=>'L', +7010=>'L', +7011=>'L', +7012=>'L', +7013=>'L', +7014=>'L', +7015=>'L', +7016=>'L', +7017=>'L', +7018=>'L', +7019=>'NSM', +7020=>'NSM', +7021=>'NSM', +7022=>'NSM', +7023=>'NSM', +7024=>'NSM', +7025=>'NSM', +7026=>'NSM', +7027=>'NSM', +7028=>'L', +7029=>'L', +7030=>'L', +7031=>'L', +7032=>'L', +7033=>'L', +7034=>'L', +7035=>'L', +7036=>'L', +7424=>'L', +7425=>'L', +7426=>'L', +7427=>'L', +7428=>'L', +7429=>'L', +7430=>'L', +7431=>'L', +7432=>'L', +7433=>'L', +7434=>'L', +7435=>'L', +7436=>'L', +7437=>'L', +7438=>'L', +7439=>'L', +7440=>'L', +7441=>'L', +7442=>'L', +7443=>'L', +7444=>'L', +7445=>'L', +7446=>'L', +7447=>'L', +7448=>'L', +7449=>'L', +7450=>'L', +7451=>'L', +7452=>'L', +7453=>'L', +7454=>'L', +7455=>'L', +7456=>'L', +7457=>'L', +7458=>'L', +7459=>'L', +7460=>'L', +7461=>'L', +7462=>'L', +7463=>'L', +7464=>'L', +7465=>'L', +7466=>'L', +7467=>'L', +7468=>'L', +7469=>'L', +7470=>'L', +7471=>'L', +7472=>'L', +7473=>'L', +7474=>'L', +7475=>'L', +7476=>'L', +7477=>'L', +7478=>'L', +7479=>'L', +7480=>'L', +7481=>'L', +7482=>'L', +7483=>'L', +7484=>'L', +7485=>'L', +7486=>'L', +7487=>'L', +7488=>'L', +7489=>'L', +7490=>'L', +7491=>'L', +7492=>'L', +7493=>'L', +7494=>'L', +7495=>'L', +7496=>'L', +7497=>'L', +7498=>'L', +7499=>'L', +7500=>'L', +7501=>'L', +7502=>'L', +7503=>'L', +7504=>'L', +7505=>'L', +7506=>'L', +7507=>'L', +7508=>'L', +7509=>'L', +7510=>'L', +7511=>'L', +7512=>'L', +7513=>'L', +7514=>'L', +7515=>'L', +7516=>'L', +7517=>'L', +7518=>'L', +7519=>'L', +7520=>'L', +7521=>'L', +7522=>'L', +7523=>'L', +7524=>'L', +7525=>'L', +7526=>'L', +7527=>'L', +7528=>'L', +7529=>'L', +7530=>'L', +7531=>'L', +7532=>'L', +7533=>'L', +7534=>'L', +7535=>'L', +7536=>'L', +7537=>'L', +7538=>'L', +7539=>'L', +7540=>'L', +7541=>'L', +7542=>'L', +7543=>'L', +7544=>'L', +7545=>'L', +7546=>'L', +7547=>'L', +7548=>'L', +7549=>'L', +7550=>'L', +7551=>'L', +7552=>'L', +7553=>'L', +7554=>'L', +7555=>'L', +7556=>'L', +7557=>'L', +7558=>'L', +7559=>'L', +7560=>'L', +7561=>'L', +7562=>'L', +7563=>'L', +7564=>'L', +7565=>'L', +7566=>'L', +7567=>'L', +7568=>'L', +7569=>'L', +7570=>'L', +7571=>'L', +7572=>'L', +7573=>'L', +7574=>'L', +7575=>'L', +7576=>'L', +7577=>'L', +7578=>'L', +7579=>'L', +7580=>'L', +7581=>'L', +7582=>'L', +7583=>'L', +7584=>'L', +7585=>'L', +7586=>'L', +7587=>'L', +7588=>'L', +7589=>'L', +7590=>'L', +7591=>'L', +7592=>'L', +7593=>'L', +7594=>'L', +7595=>'L', +7596=>'L', +7597=>'L', +7598=>'L', +7599=>'L', +7600=>'L', +7601=>'L', +7602=>'L', +7603=>'L', +7604=>'L', +7605=>'L', +7606=>'L', +7607=>'L', +7608=>'L', +7609=>'L', +7610=>'L', +7611=>'L', +7612=>'L', +7613=>'L', +7614=>'L', +7615=>'L', +7616=>'NSM', +7617=>'NSM', +7618=>'NSM', +7619=>'NSM', +7620=>'NSM', +7621=>'NSM', +7622=>'NSM', +7623=>'NSM', +7624=>'NSM', +7625=>'NSM', +7626=>'NSM', +7678=>'NSM', +7679=>'NSM', +7680=>'L', +7681=>'L', +7682=>'L', +7683=>'L', +7684=>'L', +7685=>'L', +7686=>'L', +7687=>'L', +7688=>'L', +7689=>'L', +7690=>'L', +7691=>'L', +7692=>'L', +7693=>'L', +7694=>'L', +7695=>'L', +7696=>'L', +7697=>'L', +7698=>'L', +7699=>'L', +7700=>'L', +7701=>'L', +7702=>'L', +7703=>'L', +7704=>'L', +7705=>'L', +7706=>'L', +7707=>'L', +7708=>'L', +7709=>'L', +7710=>'L', +7711=>'L', +7712=>'L', +7713=>'L', +7714=>'L', +7715=>'L', +7716=>'L', +7717=>'L', +7718=>'L', +7719=>'L', +7720=>'L', +7721=>'L', +7722=>'L', +7723=>'L', +7724=>'L', +7725=>'L', +7726=>'L', +7727=>'L', +7728=>'L', +7729=>'L', +7730=>'L', +7731=>'L', +7732=>'L', +7733=>'L', +7734=>'L', +7735=>'L', +7736=>'L', +7737=>'L', +7738=>'L', +7739=>'L', +7740=>'L', +7741=>'L', +7742=>'L', +7743=>'L', +7744=>'L', +7745=>'L', +7746=>'L', +7747=>'L', +7748=>'L', +7749=>'L', +7750=>'L', +7751=>'L', +7752=>'L', +7753=>'L', +7754=>'L', +7755=>'L', +7756=>'L', +7757=>'L', +7758=>'L', +7759=>'L', +7760=>'L', +7761=>'L', +7762=>'L', +7763=>'L', +7764=>'L', +7765=>'L', +7766=>'L', +7767=>'L', +7768=>'L', +7769=>'L', +7770=>'L', +7771=>'L', +7772=>'L', +7773=>'L', +7774=>'L', +7775=>'L', +7776=>'L', +7777=>'L', +7778=>'L', +7779=>'L', +7780=>'L', +7781=>'L', +7782=>'L', +7783=>'L', +7784=>'L', +7785=>'L', +7786=>'L', +7787=>'L', +7788=>'L', +7789=>'L', +7790=>'L', +7791=>'L', +7792=>'L', +7793=>'L', +7794=>'L', +7795=>'L', +7796=>'L', +7797=>'L', +7798=>'L', +7799=>'L', +7800=>'L', +7801=>'L', +7802=>'L', +7803=>'L', +7804=>'L', +7805=>'L', +7806=>'L', +7807=>'L', +7808=>'L', +7809=>'L', +7810=>'L', +7811=>'L', +7812=>'L', +7813=>'L', +7814=>'L', +7815=>'L', +7816=>'L', +7817=>'L', +7818=>'L', +7819=>'L', +7820=>'L', +7821=>'L', +7822=>'L', +7823=>'L', +7824=>'L', +7825=>'L', +7826=>'L', +7827=>'L', +7828=>'L', +7829=>'L', +7830=>'L', +7831=>'L', +7832=>'L', +7833=>'L', +7834=>'L', +7835=>'L', +7840=>'L', +7841=>'L', +7842=>'L', +7843=>'L', +7844=>'L', +7845=>'L', +7846=>'L', +7847=>'L', +7848=>'L', +7849=>'L', +7850=>'L', +7851=>'L', +7852=>'L', +7853=>'L', +7854=>'L', +7855=>'L', +7856=>'L', +7857=>'L', +7858=>'L', +7859=>'L', +7860=>'L', +7861=>'L', +7862=>'L', +7863=>'L', +7864=>'L', +7865=>'L', +7866=>'L', +7867=>'L', +7868=>'L', +7869=>'L', +7870=>'L', +7871=>'L', +7872=>'L', +7873=>'L', +7874=>'L', +7875=>'L', +7876=>'L', +7877=>'L', +7878=>'L', +7879=>'L', +7880=>'L', +7881=>'L', +7882=>'L', +7883=>'L', +7884=>'L', +7885=>'L', +7886=>'L', +7887=>'L', +7888=>'L', +7889=>'L', +7890=>'L', +7891=>'L', +7892=>'L', +7893=>'L', +7894=>'L', +7895=>'L', +7896=>'L', +7897=>'L', +7898=>'L', +7899=>'L', +7900=>'L', +7901=>'L', +7902=>'L', +7903=>'L', +7904=>'L', +7905=>'L', +7906=>'L', +7907=>'L', +7908=>'L', +7909=>'L', +7910=>'L', +7911=>'L', +7912=>'L', +7913=>'L', +7914=>'L', +7915=>'L', +7916=>'L', +7917=>'L', +7918=>'L', +7919=>'L', +7920=>'L', +7921=>'L', +7922=>'L', +7923=>'L', +7924=>'L', +7925=>'L', +7926=>'L', +7927=>'L', +7928=>'L', +7929=>'L', +7936=>'L', +7937=>'L', +7938=>'L', +7939=>'L', +7940=>'L', +7941=>'L', +7942=>'L', +7943=>'L', +7944=>'L', +7945=>'L', +7946=>'L', +7947=>'L', +7948=>'L', +7949=>'L', +7950=>'L', +7951=>'L', +7952=>'L', +7953=>'L', +7954=>'L', +7955=>'L', +7956=>'L', +7957=>'L', +7960=>'L', +7961=>'L', +7962=>'L', +7963=>'L', +7964=>'L', +7965=>'L', +7968=>'L', +7969=>'L', +7970=>'L', +7971=>'L', +7972=>'L', +7973=>'L', +7974=>'L', +7975=>'L', +7976=>'L', +7977=>'L', +7978=>'L', +7979=>'L', +7980=>'L', +7981=>'L', +7982=>'L', +7983=>'L', +7984=>'L', +7985=>'L', +7986=>'L', +7987=>'L', +7988=>'L', +7989=>'L', +7990=>'L', +7991=>'L', +7992=>'L', +7993=>'L', +7994=>'L', +7995=>'L', +7996=>'L', +7997=>'L', +7998=>'L', +7999=>'L', +8000=>'L', +8001=>'L', +8002=>'L', +8003=>'L', +8004=>'L', +8005=>'L', +8008=>'L', +8009=>'L', +8010=>'L', +8011=>'L', +8012=>'L', +8013=>'L', +8016=>'L', +8017=>'L', +8018=>'L', +8019=>'L', +8020=>'L', +8021=>'L', +8022=>'L', +8023=>'L', +8025=>'L', +8027=>'L', +8029=>'L', +8031=>'L', +8032=>'L', +8033=>'L', +8034=>'L', +8035=>'L', +8036=>'L', +8037=>'L', +8038=>'L', +8039=>'L', +8040=>'L', +8041=>'L', +8042=>'L', +8043=>'L', +8044=>'L', +8045=>'L', +8046=>'L', +8047=>'L', +8048=>'L', +8049=>'L', +8050=>'L', +8051=>'L', +8052=>'L', +8053=>'L', +8054=>'L', +8055=>'L', +8056=>'L', +8057=>'L', +8058=>'L', +8059=>'L', +8060=>'L', +8061=>'L', +8064=>'L', +8065=>'L', +8066=>'L', +8067=>'L', +8068=>'L', +8069=>'L', +8070=>'L', +8071=>'L', +8072=>'L', +8073=>'L', +8074=>'L', +8075=>'L', +8076=>'L', +8077=>'L', +8078=>'L', +8079=>'L', +8080=>'L', +8081=>'L', +8082=>'L', +8083=>'L', +8084=>'L', +8085=>'L', +8086=>'L', +8087=>'L', +8088=>'L', +8089=>'L', +8090=>'L', +8091=>'L', +8092=>'L', +8093=>'L', +8094=>'L', +8095=>'L', +8096=>'L', +8097=>'L', +8098=>'L', +8099=>'L', +8100=>'L', +8101=>'L', +8102=>'L', +8103=>'L', +8104=>'L', +8105=>'L', +8106=>'L', +8107=>'L', +8108=>'L', +8109=>'L', +8110=>'L', +8111=>'L', +8112=>'L', +8113=>'L', +8114=>'L', +8115=>'L', +8116=>'L', +8118=>'L', +8119=>'L', +8120=>'L', +8121=>'L', +8122=>'L', +8123=>'L', +8124=>'L', +8125=>'ON', +8126=>'L', +8127=>'ON', +8128=>'ON', +8129=>'ON', +8130=>'L', +8131=>'L', +8132=>'L', +8134=>'L', +8135=>'L', +8136=>'L', +8137=>'L', +8138=>'L', +8139=>'L', +8140=>'L', +8141=>'ON', +8142=>'ON', +8143=>'ON', +8144=>'L', +8145=>'L', +8146=>'L', +8147=>'L', +8150=>'L', +8151=>'L', +8152=>'L', +8153=>'L', +8154=>'L', +8155=>'L', +8157=>'ON', +8158=>'ON', +8159=>'ON', +8160=>'L', +8161=>'L', +8162=>'L', +8163=>'L', +8164=>'L', +8165=>'L', +8166=>'L', +8167=>'L', +8168=>'L', +8169=>'L', +8170=>'L', +8171=>'L', +8172=>'L', +8173=>'ON', +8174=>'ON', +8175=>'ON', +8178=>'L', +8179=>'L', +8180=>'L', +8182=>'L', +8183=>'L', +8184=>'L', +8185=>'L', +8186=>'L', +8187=>'L', +8188=>'L', +8189=>'ON', +8190=>'ON', +8192=>'WS', +8193=>'WS', +8194=>'WS', +8195=>'WS', +8196=>'WS', +8197=>'WS', +8198=>'WS', +8199=>'WS', +8200=>'WS', +8201=>'WS', +8202=>'WS', +8203=>'BN', +8204=>'BN', +8205=>'BN', +8206=>'L', +8207=>'R', +8208=>'ON', +8209=>'ON', +8210=>'ON', +8211=>'ON', +8212=>'ON', +8213=>'ON', +8214=>'ON', +8215=>'ON', +8216=>'ON', +8217=>'ON', +8218=>'ON', +8219=>'ON', +8220=>'ON', +8221=>'ON', +8222=>'ON', +8223=>'ON', +8224=>'ON', +8225=>'ON', +8226=>'ON', +8227=>'ON', +8228=>'ON', +8229=>'ON', +8230=>'ON', +8231=>'ON', +8232=>'WS', +8233=>'B', +8234=>'LRE', +8235=>'RLE', +8236=>'PDF', +8237=>'LRO', +8238=>'RLO', +8239=>'CS', +8240=>'ET', +8241=>'ET', +8242=>'ET', +8243=>'ET', +8244=>'ET', +8245=>'ON', +8246=>'ON', +8247=>'ON', +8248=>'ON', +8249=>'ON', +8250=>'ON', +8251=>'ON', +8252=>'ON', +8253=>'ON', +8254=>'ON', +8255=>'ON', +8256=>'ON', +8257=>'ON', +8258=>'ON', +8259=>'ON', +8260=>'CS', +8261=>'ON', +8262=>'ON', +8263=>'ON', +8264=>'ON', +8265=>'ON', +8266=>'ON', +8267=>'ON', +8268=>'ON', +8269=>'ON', +8270=>'ON', +8271=>'ON', +8272=>'ON', +8273=>'ON', +8274=>'ON', +8275=>'ON', +8276=>'ON', +8277=>'ON', +8278=>'ON', +8279=>'ON', +8280=>'ON', +8281=>'ON', +8282=>'ON', +8283=>'ON', +8284=>'ON', +8285=>'ON', +8286=>'ON', +8287=>'WS', +8288=>'BN', +8289=>'BN', +8290=>'BN', +8291=>'BN', +8298=>'BN', +8299=>'BN', +8300=>'BN', +8301=>'BN', +8302=>'BN', +8303=>'BN', +8304=>'EN', +8305=>'L', +8308=>'EN', +8309=>'EN', +8310=>'EN', +8311=>'EN', +8312=>'EN', +8313=>'EN', +8314=>'ES', +8315=>'ES', +8316=>'ON', +8317=>'ON', +8318=>'ON', +8319=>'L', +8320=>'EN', +8321=>'EN', +8322=>'EN', +8323=>'EN', +8324=>'EN', +8325=>'EN', +8326=>'EN', +8327=>'EN', +8328=>'EN', +8329=>'EN', +8330=>'ES', +8331=>'ES', +8332=>'ON', +8333=>'ON', +8334=>'ON', +8336=>'L', +8337=>'L', +8338=>'L', +8339=>'L', +8340=>'L', +8352=>'ET', +8353=>'ET', +8354=>'ET', +8355=>'ET', +8356=>'ET', +8357=>'ET', +8358=>'ET', +8359=>'ET', +8360=>'ET', +8361=>'ET', +8362=>'ET', +8363=>'ET', +8364=>'ET', +8365=>'ET', +8366=>'ET', +8367=>'ET', +8368=>'ET', +8369=>'ET', +8370=>'ET', +8371=>'ET', +8372=>'ET', +8373=>'ET', +8400=>'NSM', +8401=>'NSM', +8402=>'NSM', +8403=>'NSM', +8404=>'NSM', +8405=>'NSM', +8406=>'NSM', +8407=>'NSM', +8408=>'NSM', +8409=>'NSM', +8410=>'NSM', +8411=>'NSM', +8412=>'NSM', +8413=>'NSM', +8414=>'NSM', +8415=>'NSM', +8416=>'NSM', +8417=>'NSM', +8418=>'NSM', +8419=>'NSM', +8420=>'NSM', +8421=>'NSM', +8422=>'NSM', +8423=>'NSM', +8424=>'NSM', +8425=>'NSM', +8426=>'NSM', +8427=>'NSM', +8428=>'NSM', +8429=>'NSM', +8430=>'NSM', +8431=>'NSM', +8448=>'ON', +8449=>'ON', +8450=>'L', +8451=>'ON', +8452=>'ON', +8453=>'ON', +8454=>'ON', +8455=>'L', +8456=>'ON', +8457=>'ON', +8458=>'L', +8459=>'L', +8460=>'L', +8461=>'L', +8462=>'L', +8463=>'L', +8464=>'L', +8465=>'L', +8466=>'L', +8467=>'L', +8468=>'ON', +8469=>'L', +8470=>'ON', +8471=>'ON', +8472=>'ON', +8473=>'L', +8474=>'L', +8475=>'L', +8476=>'L', +8477=>'L', +8478=>'ON', +8479=>'ON', +8480=>'ON', +8481=>'ON', +8482=>'ON', +8483=>'ON', +8484=>'L', +8485=>'ON', +8486=>'L', +8487=>'ON', +8488=>'L', +8489=>'ON', +8490=>'L', +8491=>'L', +8492=>'L', +8493=>'L', +8494=>'ET', +8495=>'L', +8496=>'L', +8497=>'L', +8498=>'L', +8499=>'L', +8500=>'L', +8501=>'L', +8502=>'L', +8503=>'L', +8504=>'L', +8505=>'L', +8506=>'ON', +8507=>'ON', +8508=>'L', +8509=>'L', +8510=>'L', +8511=>'L', +8512=>'ON', +8513=>'ON', +8514=>'ON', +8515=>'ON', +8516=>'ON', +8517=>'L', +8518=>'L', +8519=>'L', +8520=>'L', +8521=>'L', +8522=>'ON', +8523=>'ON', +8524=>'ON', +8525=>'ON', +8526=>'L', +8531=>'ON', +8532=>'ON', +8533=>'ON', +8534=>'ON', +8535=>'ON', +8536=>'ON', +8537=>'ON', +8538=>'ON', +8539=>'ON', +8540=>'ON', +8541=>'ON', +8542=>'ON', +8543=>'ON', +8544=>'L', +8545=>'L', +8546=>'L', +8547=>'L', +8548=>'L', +8549=>'L', +8550=>'L', +8551=>'L', +8552=>'L', +8553=>'L', +8554=>'L', +8555=>'L', +8556=>'L', +8557=>'L', +8558=>'L', +8559=>'L', +8560=>'L', +8561=>'L', +8562=>'L', +8563=>'L', +8564=>'L', +8565=>'L', +8566=>'L', +8567=>'L', +8568=>'L', +8569=>'L', +8570=>'L', +8571=>'L', +8572=>'L', +8573=>'L', +8574=>'L', +8575=>'L', +8576=>'L', +8577=>'L', +8578=>'L', +8579=>'L', +8580=>'L', +8592=>'ON', +8593=>'ON', +8594=>'ON', +8595=>'ON', +8596=>'ON', +8597=>'ON', +8598=>'ON', +8599=>'ON', +8600=>'ON', +8601=>'ON', +8602=>'ON', +8603=>'ON', +8604=>'ON', +8605=>'ON', +8606=>'ON', +8607=>'ON', +8608=>'ON', +8609=>'ON', +8610=>'ON', +8611=>'ON', +8612=>'ON', +8613=>'ON', +8614=>'ON', +8615=>'ON', +8616=>'ON', +8617=>'ON', +8618=>'ON', +8619=>'ON', +8620=>'ON', +8621=>'ON', +8622=>'ON', +8623=>'ON', +8624=>'ON', +8625=>'ON', +8626=>'ON', +8627=>'ON', +8628=>'ON', +8629=>'ON', +8630=>'ON', +8631=>'ON', +8632=>'ON', +8633=>'ON', +8634=>'ON', +8635=>'ON', +8636=>'ON', +8637=>'ON', +8638=>'ON', +8639=>'ON', +8640=>'ON', +8641=>'ON', +8642=>'ON', +8643=>'ON', +8644=>'ON', +8645=>'ON', +8646=>'ON', +8647=>'ON', +8648=>'ON', +8649=>'ON', +8650=>'ON', +8651=>'ON', +8652=>'ON', +8653=>'ON', +8654=>'ON', +8655=>'ON', +8656=>'ON', +8657=>'ON', +8658=>'ON', +8659=>'ON', +8660=>'ON', +8661=>'ON', +8662=>'ON', +8663=>'ON', +8664=>'ON', +8665=>'ON', +8666=>'ON', +8667=>'ON', +8668=>'ON', +8669=>'ON', +8670=>'ON', +8671=>'ON', +8672=>'ON', +8673=>'ON', +8674=>'ON', +8675=>'ON', +8676=>'ON', +8677=>'ON', +8678=>'ON', +8679=>'ON', +8680=>'ON', +8681=>'ON', +8682=>'ON', +8683=>'ON', +8684=>'ON', +8685=>'ON', +8686=>'ON', +8687=>'ON', +8688=>'ON', +8689=>'ON', +8690=>'ON', +8691=>'ON', +8692=>'ON', +8693=>'ON', +8694=>'ON', +8695=>'ON', +8696=>'ON', +8697=>'ON', +8698=>'ON', +8699=>'ON', +8700=>'ON', +8701=>'ON', +8702=>'ON', +8703=>'ON', +8704=>'ON', +8705=>'ON', +8706=>'ON', +8707=>'ON', +8708=>'ON', +8709=>'ON', +8710=>'ON', +8711=>'ON', +8712=>'ON', +8713=>'ON', +8714=>'ON', +8715=>'ON', +8716=>'ON', +8717=>'ON', +8718=>'ON', +8719=>'ON', +8720=>'ON', +8721=>'ON', +8722=>'ES', +8723=>'ET', +8724=>'ON', +8725=>'ON', +8726=>'ON', +8727=>'ON', +8728=>'ON', +8729=>'ON', +8730=>'ON', +8731=>'ON', +8732=>'ON', +8733=>'ON', +8734=>'ON', +8735=>'ON', +8736=>'ON', +8737=>'ON', +8738=>'ON', +8739=>'ON', +8740=>'ON', +8741=>'ON', +8742=>'ON', +8743=>'ON', +8744=>'ON', +8745=>'ON', +8746=>'ON', +8747=>'ON', +8748=>'ON', +8749=>'ON', +8750=>'ON', +8751=>'ON', +8752=>'ON', +8753=>'ON', +8754=>'ON', +8755=>'ON', +8756=>'ON', +8757=>'ON', +8758=>'ON', +8759=>'ON', +8760=>'ON', +8761=>'ON', +8762=>'ON', +8763=>'ON', +8764=>'ON', +8765=>'ON', +8766=>'ON', +8767=>'ON', +8768=>'ON', +8769=>'ON', +8770=>'ON', +8771=>'ON', +8772=>'ON', +8773=>'ON', +8774=>'ON', +8775=>'ON', +8776=>'ON', +8777=>'ON', +8778=>'ON', +8779=>'ON', +8780=>'ON', +8781=>'ON', +8782=>'ON', +8783=>'ON', +8784=>'ON', +8785=>'ON', +8786=>'ON', +8787=>'ON', +8788=>'ON', +8789=>'ON', +8790=>'ON', +8791=>'ON', +8792=>'ON', +8793=>'ON', +8794=>'ON', +8795=>'ON', +8796=>'ON', +8797=>'ON', +8798=>'ON', +8799=>'ON', +8800=>'ON', +8801=>'ON', +8802=>'ON', +8803=>'ON', +8804=>'ON', +8805=>'ON', +8806=>'ON', +8807=>'ON', +8808=>'ON', +8809=>'ON', +8810=>'ON', +8811=>'ON', +8812=>'ON', +8813=>'ON', +8814=>'ON', +8815=>'ON', +8816=>'ON', +8817=>'ON', +8818=>'ON', +8819=>'ON', +8820=>'ON', +8821=>'ON', +8822=>'ON', +8823=>'ON', +8824=>'ON', +8825=>'ON', +8826=>'ON', +8827=>'ON', +8828=>'ON', +8829=>'ON', +8830=>'ON', +8831=>'ON', +8832=>'ON', +8833=>'ON', +8834=>'ON', +8835=>'ON', +8836=>'ON', +8837=>'ON', +8838=>'ON', +8839=>'ON', +8840=>'ON', +8841=>'ON', +8842=>'ON', +8843=>'ON', +8844=>'ON', +8845=>'ON', +8846=>'ON', +8847=>'ON', +8848=>'ON', +8849=>'ON', +8850=>'ON', +8851=>'ON', +8852=>'ON', +8853=>'ON', +8854=>'ON', +8855=>'ON', +8856=>'ON', +8857=>'ON', +8858=>'ON', +8859=>'ON', +8860=>'ON', +8861=>'ON', +8862=>'ON', +8863=>'ON', +8864=>'ON', +8865=>'ON', +8866=>'ON', +8867=>'ON', +8868=>'ON', +8869=>'ON', +8870=>'ON', +8871=>'ON', +8872=>'ON', +8873=>'ON', +8874=>'ON', +8875=>'ON', +8876=>'ON', +8877=>'ON', +8878=>'ON', +8879=>'ON', +8880=>'ON', +8881=>'ON', +8882=>'ON', +8883=>'ON', +8884=>'ON', +8885=>'ON', +8886=>'ON', +8887=>'ON', +8888=>'ON', +8889=>'ON', +8890=>'ON', +8891=>'ON', +8892=>'ON', +8893=>'ON', +8894=>'ON', +8895=>'ON', +8896=>'ON', +8897=>'ON', +8898=>'ON', +8899=>'ON', +8900=>'ON', +8901=>'ON', +8902=>'ON', +8903=>'ON', +8904=>'ON', +8905=>'ON', +8906=>'ON', +8907=>'ON', +8908=>'ON', +8909=>'ON', +8910=>'ON', +8911=>'ON', +8912=>'ON', +8913=>'ON', +8914=>'ON', +8915=>'ON', +8916=>'ON', +8917=>'ON', +8918=>'ON', +8919=>'ON', +8920=>'ON', +8921=>'ON', +8922=>'ON', +8923=>'ON', +8924=>'ON', +8925=>'ON', +8926=>'ON', +8927=>'ON', +8928=>'ON', +8929=>'ON', +8930=>'ON', +8931=>'ON', +8932=>'ON', +8933=>'ON', +8934=>'ON', +8935=>'ON', +8936=>'ON', +8937=>'ON', +8938=>'ON', +8939=>'ON', +8940=>'ON', +8941=>'ON', +8942=>'ON', +8943=>'ON', +8944=>'ON', +8945=>'ON', +8946=>'ON', +8947=>'ON', +8948=>'ON', +8949=>'ON', +8950=>'ON', +8951=>'ON', +8952=>'ON', +8953=>'ON', +8954=>'ON', +8955=>'ON', +8956=>'ON', +8957=>'ON', +8958=>'ON', +8959=>'ON', +8960=>'ON', +8961=>'ON', +8962=>'ON', +8963=>'ON', +8964=>'ON', +8965=>'ON', +8966=>'ON', +8967=>'ON', +8968=>'ON', +8969=>'ON', +8970=>'ON', +8971=>'ON', +8972=>'ON', +8973=>'ON', +8974=>'ON', +8975=>'ON', +8976=>'ON', +8977=>'ON', +8978=>'ON', +8979=>'ON', +8980=>'ON', +8981=>'ON', +8982=>'ON', +8983=>'ON', +8984=>'ON', +8985=>'ON', +8986=>'ON', +8987=>'ON', +8988=>'ON', +8989=>'ON', +8990=>'ON', +8991=>'ON', +8992=>'ON', +8993=>'ON', +8994=>'ON', +8995=>'ON', +8996=>'ON', +8997=>'ON', +8998=>'ON', +8999=>'ON', +9000=>'ON', +9001=>'ON', +9002=>'ON', +9003=>'ON', +9004=>'ON', +9005=>'ON', +9006=>'ON', +9007=>'ON', +9008=>'ON', +9009=>'ON', +9010=>'ON', +9011=>'ON', +9012=>'ON', +9013=>'ON', +9014=>'L', +9015=>'L', +9016=>'L', +9017=>'L', +9018=>'L', +9019=>'L', +9020=>'L', +9021=>'L', +9022=>'L', +9023=>'L', +9024=>'L', +9025=>'L', +9026=>'L', +9027=>'L', +9028=>'L', +9029=>'L', +9030=>'L', +9031=>'L', +9032=>'L', +9033=>'L', +9034=>'L', +9035=>'L', +9036=>'L', +9037=>'L', +9038=>'L', +9039=>'L', +9040=>'L', +9041=>'L', +9042=>'L', +9043=>'L', +9044=>'L', +9045=>'L', +9046=>'L', +9047=>'L', +9048=>'L', +9049=>'L', +9050=>'L', +9051=>'L', +9052=>'L', +9053=>'L', +9054=>'L', +9055=>'L', +9056=>'L', +9057=>'L', +9058=>'L', +9059=>'L', +9060=>'L', +9061=>'L', +9062=>'L', +9063=>'L', +9064=>'L', +9065=>'L', +9066=>'L', +9067=>'L', +9068=>'L', +9069=>'L', +9070=>'L', +9071=>'L', +9072=>'L', +9073=>'L', +9074=>'L', +9075=>'L', +9076=>'L', +9077=>'L', +9078=>'L', +9079=>'L', +9080=>'L', +9081=>'L', +9082=>'L', +9083=>'ON', +9084=>'ON', +9085=>'ON', +9086=>'ON', +9087=>'ON', +9088=>'ON', +9089=>'ON', +9090=>'ON', +9091=>'ON', +9092=>'ON', +9093=>'ON', +9094=>'ON', +9095=>'ON', +9096=>'ON', +9097=>'ON', +9098=>'ON', +9099=>'ON', +9100=>'ON', +9101=>'ON', +9102=>'ON', +9103=>'ON', +9104=>'ON', +9105=>'ON', +9106=>'ON', +9107=>'ON', +9108=>'ON', +9109=>'L', +9110=>'ON', +9111=>'ON', +9112=>'ON', +9113=>'ON', +9114=>'ON', +9115=>'ON', +9116=>'ON', +9117=>'ON', +9118=>'ON', +9119=>'ON', +9120=>'ON', +9121=>'ON', +9122=>'ON', +9123=>'ON', +9124=>'ON', +9125=>'ON', +9126=>'ON', +9127=>'ON', +9128=>'ON', +9129=>'ON', +9130=>'ON', +9131=>'ON', +9132=>'ON', +9133=>'ON', +9134=>'ON', +9135=>'ON', +9136=>'ON', +9137=>'ON', +9138=>'ON', +9139=>'ON', +9140=>'ON', +9141=>'ON', +9142=>'ON', +9143=>'ON', +9144=>'ON', +9145=>'ON', +9146=>'ON', +9147=>'ON', +9148=>'ON', +9149=>'ON', +9150=>'ON', +9151=>'ON', +9152=>'ON', +9153=>'ON', +9154=>'ON', +9155=>'ON', +9156=>'ON', +9157=>'ON', +9158=>'ON', +9159=>'ON', +9160=>'ON', +9161=>'ON', +9162=>'ON', +9163=>'ON', +9164=>'ON', +9165=>'ON', +9166=>'ON', +9167=>'ON', +9168=>'ON', +9169=>'ON', +9170=>'ON', +9171=>'ON', +9172=>'ON', +9173=>'ON', +9174=>'ON', +9175=>'ON', +9176=>'ON', +9177=>'ON', +9178=>'ON', +9179=>'ON', +9180=>'ON', +9181=>'ON', +9182=>'ON', +9183=>'ON', +9184=>'ON', +9185=>'ON', +9186=>'ON', +9187=>'ON', +9188=>'ON', +9189=>'ON', +9190=>'ON', +9191=>'ON', +9216=>'ON', +9217=>'ON', +9218=>'ON', +9219=>'ON', +9220=>'ON', +9221=>'ON', +9222=>'ON', +9223=>'ON', +9224=>'ON', +9225=>'ON', +9226=>'ON', +9227=>'ON', +9228=>'ON', +9229=>'ON', +9230=>'ON', +9231=>'ON', +9232=>'ON', +9233=>'ON', +9234=>'ON', +9235=>'ON', +9236=>'ON', +9237=>'ON', +9238=>'ON', +9239=>'ON', +9240=>'ON', +9241=>'ON', +9242=>'ON', +9243=>'ON', +9244=>'ON', +9245=>'ON', +9246=>'ON', +9247=>'ON', +9248=>'ON', +9249=>'ON', +9250=>'ON', +9251=>'ON', +9252=>'ON', +9253=>'ON', +9254=>'ON', +9280=>'ON', +9281=>'ON', +9282=>'ON', +9283=>'ON', +9284=>'ON', +9285=>'ON', +9286=>'ON', +9287=>'ON', +9288=>'ON', +9289=>'ON', +9290=>'ON', +9312=>'ON', +9313=>'ON', +9314=>'ON', +9315=>'ON', +9316=>'ON', +9317=>'ON', +9318=>'ON', +9319=>'ON', +9320=>'ON', +9321=>'ON', +9322=>'ON', +9323=>'ON', +9324=>'ON', +9325=>'ON', +9326=>'ON', +9327=>'ON', +9328=>'ON', +9329=>'ON', +9330=>'ON', +9331=>'ON', +9332=>'ON', +9333=>'ON', +9334=>'ON', +9335=>'ON', +9336=>'ON', +9337=>'ON', +9338=>'ON', +9339=>'ON', +9340=>'ON', +9341=>'ON', +9342=>'ON', +9343=>'ON', +9344=>'ON', +9345=>'ON', +9346=>'ON', +9347=>'ON', +9348=>'ON', +9349=>'ON', +9350=>'ON', +9351=>'ON', +9352=>'EN', +9353=>'EN', +9354=>'EN', +9355=>'EN', +9356=>'EN', +9357=>'EN', +9358=>'EN', +9359=>'EN', +9360=>'EN', +9361=>'EN', +9362=>'EN', +9363=>'EN', +9364=>'EN', +9365=>'EN', +9366=>'EN', +9367=>'EN', +9368=>'EN', +9369=>'EN', +9370=>'EN', +9371=>'EN', +9372=>'L', +9373=>'L', +9374=>'L', +9375=>'L', +9376=>'L', +9377=>'L', +9378=>'L', +9379=>'L', +9380=>'L', +9381=>'L', +9382=>'L', +9383=>'L', +9384=>'L', +9385=>'L', +9386=>'L', +9387=>'L', +9388=>'L', +9389=>'L', +9390=>'L', +9391=>'L', +9392=>'L', +9393=>'L', +9394=>'L', +9395=>'L', +9396=>'L', +9397=>'L', +9398=>'L', +9399=>'L', +9400=>'L', +9401=>'L', +9402=>'L', +9403=>'L', +9404=>'L', +9405=>'L', +9406=>'L', +9407=>'L', +9408=>'L', +9409=>'L', +9410=>'L', +9411=>'L', +9412=>'L', +9413=>'L', +9414=>'L', +9415=>'L', +9416=>'L', +9417=>'L', +9418=>'L', +9419=>'L', +9420=>'L', +9421=>'L', +9422=>'L', +9423=>'L', +9424=>'L', +9425=>'L', +9426=>'L', +9427=>'L', +9428=>'L', +9429=>'L', +9430=>'L', +9431=>'L', +9432=>'L', +9433=>'L', +9434=>'L', +9435=>'L', +9436=>'L', +9437=>'L', +9438=>'L', +9439=>'L', +9440=>'L', +9441=>'L', +9442=>'L', +9443=>'L', +9444=>'L', +9445=>'L', +9446=>'L', +9447=>'L', +9448=>'L', +9449=>'L', +9450=>'ON', +9451=>'ON', +9452=>'ON', +9453=>'ON', +9454=>'ON', +9455=>'ON', +9456=>'ON', +9457=>'ON', +9458=>'ON', +9459=>'ON', +9460=>'ON', +9461=>'ON', +9462=>'ON', +9463=>'ON', +9464=>'ON', +9465=>'ON', +9466=>'ON', +9467=>'ON', +9468=>'ON', +9469=>'ON', +9470=>'ON', +9471=>'ON', +9472=>'ON', +9473=>'ON', +9474=>'ON', +9475=>'ON', +9476=>'ON', +9477=>'ON', +9478=>'ON', +9479=>'ON', +9480=>'ON', +9481=>'ON', +9482=>'ON', +9483=>'ON', +9484=>'ON', +9485=>'ON', +9486=>'ON', +9487=>'ON', +9488=>'ON', +9489=>'ON', +9490=>'ON', +9491=>'ON', +9492=>'ON', +9493=>'ON', +9494=>'ON', +9495=>'ON', +9496=>'ON', +9497=>'ON', +9498=>'ON', +9499=>'ON', +9500=>'ON', +9501=>'ON', +9502=>'ON', +9503=>'ON', +9504=>'ON', +9505=>'ON', +9506=>'ON', +9507=>'ON', +9508=>'ON', +9509=>'ON', +9510=>'ON', +9511=>'ON', +9512=>'ON', +9513=>'ON', +9514=>'ON', +9515=>'ON', +9516=>'ON', +9517=>'ON', +9518=>'ON', +9519=>'ON', +9520=>'ON', +9521=>'ON', +9522=>'ON', +9523=>'ON', +9524=>'ON', +9525=>'ON', +9526=>'ON', +9527=>'ON', +9528=>'ON', +9529=>'ON', +9530=>'ON', +9531=>'ON', +9532=>'ON', +9533=>'ON', +9534=>'ON', +9535=>'ON', +9536=>'ON', +9537=>'ON', +9538=>'ON', +9539=>'ON', +9540=>'ON', +9541=>'ON', +9542=>'ON', +9543=>'ON', +9544=>'ON', +9545=>'ON', +9546=>'ON', +9547=>'ON', +9548=>'ON', +9549=>'ON', +9550=>'ON', +9551=>'ON', +9552=>'ON', +9553=>'ON', +9554=>'ON', +9555=>'ON', +9556=>'ON', +9557=>'ON', +9558=>'ON', +9559=>'ON', +9560=>'ON', +9561=>'ON', +9562=>'ON', +9563=>'ON', +9564=>'ON', +9565=>'ON', +9566=>'ON', +9567=>'ON', +9568=>'ON', +9569=>'ON', +9570=>'ON', +9571=>'ON', +9572=>'ON', +9573=>'ON', +9574=>'ON', +9575=>'ON', +9576=>'ON', +9577=>'ON', +9578=>'ON', +9579=>'ON', +9580=>'ON', +9581=>'ON', +9582=>'ON', +9583=>'ON', +9584=>'ON', +9585=>'ON', +9586=>'ON', +9587=>'ON', +9588=>'ON', +9589=>'ON', +9590=>'ON', +9591=>'ON', +9592=>'ON', +9593=>'ON', +9594=>'ON', +9595=>'ON', +9596=>'ON', +9597=>'ON', +9598=>'ON', +9599=>'ON', +9600=>'ON', +9601=>'ON', +9602=>'ON', +9603=>'ON', +9604=>'ON', +9605=>'ON', +9606=>'ON', +9607=>'ON', +9608=>'ON', +9609=>'ON', +9610=>'ON', +9611=>'ON', +9612=>'ON', +9613=>'ON', +9614=>'ON', +9615=>'ON', +9616=>'ON', +9617=>'ON', +9618=>'ON', +9619=>'ON', +9620=>'ON', +9621=>'ON', +9622=>'ON', +9623=>'ON', +9624=>'ON', +9625=>'ON', +9626=>'ON', +9627=>'ON', +9628=>'ON', +9629=>'ON', +9630=>'ON', +9631=>'ON', +9632=>'ON', +9633=>'ON', +9634=>'ON', +9635=>'ON', +9636=>'ON', +9637=>'ON', +9638=>'ON', +9639=>'ON', +9640=>'ON', +9641=>'ON', +9642=>'ON', +9643=>'ON', +9644=>'ON', +9645=>'ON', +9646=>'ON', +9647=>'ON', +9648=>'ON', +9649=>'ON', +9650=>'ON', +9651=>'ON', +9652=>'ON', +9653=>'ON', +9654=>'ON', +9655=>'ON', +9656=>'ON', +9657=>'ON', +9658=>'ON', +9659=>'ON', +9660=>'ON', +9661=>'ON', +9662=>'ON', +9663=>'ON', +9664=>'ON', +9665=>'ON', +9666=>'ON', +9667=>'ON', +9668=>'ON', +9669=>'ON', +9670=>'ON', +9671=>'ON', +9672=>'ON', +9673=>'ON', +9674=>'ON', +9675=>'ON', +9676=>'ON', +9677=>'ON', +9678=>'ON', +9679=>'ON', +9680=>'ON', +9681=>'ON', +9682=>'ON', +9683=>'ON', +9684=>'ON', +9685=>'ON', +9686=>'ON', +9687=>'ON', +9688=>'ON', +9689=>'ON', +9690=>'ON', +9691=>'ON', +9692=>'ON', +9693=>'ON', +9694=>'ON', +9695=>'ON', +9696=>'ON', +9697=>'ON', +9698=>'ON', +9699=>'ON', +9700=>'ON', +9701=>'ON', +9702=>'ON', +9703=>'ON', +9704=>'ON', +9705=>'ON', +9706=>'ON', +9707=>'ON', +9708=>'ON', +9709=>'ON', +9710=>'ON', +9711=>'ON', +9712=>'ON', +9713=>'ON', +9714=>'ON', +9715=>'ON', +9716=>'ON', +9717=>'ON', +9718=>'ON', +9719=>'ON', +9720=>'ON', +9721=>'ON', +9722=>'ON', +9723=>'ON', +9724=>'ON', +9725=>'ON', +9726=>'ON', +9727=>'ON', +9728=>'ON', +9729=>'ON', +9730=>'ON', +9731=>'ON', +9732=>'ON', +9733=>'ON', +9734=>'ON', +9735=>'ON', +9736=>'ON', +9737=>'ON', +9738=>'ON', +9739=>'ON', +9740=>'ON', +9741=>'ON', +9742=>'ON', +9743=>'ON', +9744=>'ON', +9745=>'ON', +9746=>'ON', +9747=>'ON', +9748=>'ON', +9749=>'ON', +9750=>'ON', +9751=>'ON', +9752=>'ON', +9753=>'ON', +9754=>'ON', +9755=>'ON', +9756=>'ON', +9757=>'ON', +9758=>'ON', +9759=>'ON', +9760=>'ON', +9761=>'ON', +9762=>'ON', +9763=>'ON', +9764=>'ON', +9765=>'ON', +9766=>'ON', +9767=>'ON', +9768=>'ON', +9769=>'ON', +9770=>'ON', +9771=>'ON', +9772=>'ON', +9773=>'ON', +9774=>'ON', +9775=>'ON', +9776=>'ON', +9777=>'ON', +9778=>'ON', +9779=>'ON', +9780=>'ON', +9781=>'ON', +9782=>'ON', +9783=>'ON', +9784=>'ON', +9785=>'ON', +9786=>'ON', +9787=>'ON', +9788=>'ON', +9789=>'ON', +9790=>'ON', +9791=>'ON', +9792=>'ON', +9793=>'ON', +9794=>'ON', +9795=>'ON', +9796=>'ON', +9797=>'ON', +9798=>'ON', +9799=>'ON', +9800=>'ON', +9801=>'ON', +9802=>'ON', +9803=>'ON', +9804=>'ON', +9805=>'ON', +9806=>'ON', +9807=>'ON', +9808=>'ON', +9809=>'ON', +9810=>'ON', +9811=>'ON', +9812=>'ON', +9813=>'ON', +9814=>'ON', +9815=>'ON', +9816=>'ON', +9817=>'ON', +9818=>'ON', +9819=>'ON', +9820=>'ON', +9821=>'ON', +9822=>'ON', +9823=>'ON', +9824=>'ON', +9825=>'ON', +9826=>'ON', +9827=>'ON', +9828=>'ON', +9829=>'ON', +9830=>'ON', +9831=>'ON', +9832=>'ON', +9833=>'ON', +9834=>'ON', +9835=>'ON', +9836=>'ON', +9837=>'ON', +9838=>'ON', +9839=>'ON', +9840=>'ON', +9841=>'ON', +9842=>'ON', +9843=>'ON', +9844=>'ON', +9845=>'ON', +9846=>'ON', +9847=>'ON', +9848=>'ON', +9849=>'ON', +9850=>'ON', +9851=>'ON', +9852=>'ON', +9853=>'ON', +9854=>'ON', +9855=>'ON', +9856=>'ON', +9857=>'ON', +9858=>'ON', +9859=>'ON', +9860=>'ON', +9861=>'ON', +9862=>'ON', +9863=>'ON', +9864=>'ON', +9865=>'ON', +9866=>'ON', +9867=>'ON', +9868=>'ON', +9869=>'ON', +9870=>'ON', +9871=>'ON', +9872=>'ON', +9873=>'ON', +9874=>'ON', +9875=>'ON', +9876=>'ON', +9877=>'ON', +9878=>'ON', +9879=>'ON', +9880=>'ON', +9881=>'ON', +9882=>'ON', +9883=>'ON', +9884=>'ON', +9888=>'ON', +9889=>'ON', +9890=>'ON', +9891=>'ON', +9892=>'ON', +9893=>'ON', +9894=>'ON', +9895=>'ON', +9896=>'ON', +9897=>'ON', +9898=>'ON', +9899=>'ON', +9900=>'L', +9901=>'ON', +9902=>'ON', +9903=>'ON', +9904=>'ON', +9905=>'ON', +9906=>'ON', +9985=>'ON', +9986=>'ON', +9987=>'ON', +9988=>'ON', +9990=>'ON', +9991=>'ON', +9992=>'ON', +9993=>'ON', +9996=>'ON', +9997=>'ON', +9998=>'ON', +9999=>'ON', +10000=>'ON', +10001=>'ON', +10002=>'ON', +10003=>'ON', +10004=>'ON', +10005=>'ON', +10006=>'ON', +10007=>'ON', +10008=>'ON', +10009=>'ON', +10010=>'ON', +10011=>'ON', +10012=>'ON', +10013=>'ON', +10014=>'ON', +10015=>'ON', +10016=>'ON', +10017=>'ON', +10018=>'ON', +10019=>'ON', +10020=>'ON', +10021=>'ON', +10022=>'ON', +10023=>'ON', +10025=>'ON', +10026=>'ON', +10027=>'ON', +10028=>'ON', +10029=>'ON', +10030=>'ON', +10031=>'ON', +10032=>'ON', +10033=>'ON', +10034=>'ON', +10035=>'ON', +10036=>'ON', +10037=>'ON', +10038=>'ON', +10039=>'ON', +10040=>'ON', +10041=>'ON', +10042=>'ON', +10043=>'ON', +10044=>'ON', +10045=>'ON', +10046=>'ON', +10047=>'ON', +10048=>'ON', +10049=>'ON', +10050=>'ON', +10051=>'ON', +10052=>'ON', +10053=>'ON', +10054=>'ON', +10055=>'ON', +10056=>'ON', +10057=>'ON', +10058=>'ON', +10059=>'ON', +10061=>'ON', +10063=>'ON', +10064=>'ON', +10065=>'ON', +10066=>'ON', +10070=>'ON', +10072=>'ON', +10073=>'ON', +10074=>'ON', +10075=>'ON', +10076=>'ON', +10077=>'ON', +10078=>'ON', +10081=>'ON', +10082=>'ON', +10083=>'ON', +10084=>'ON', +10085=>'ON', +10086=>'ON', +10087=>'ON', +10088=>'ON', +10089=>'ON', +10090=>'ON', +10091=>'ON', +10092=>'ON', +10093=>'ON', +10094=>'ON', +10095=>'ON', +10096=>'ON', +10097=>'ON', +10098=>'ON', +10099=>'ON', +10100=>'ON', +10101=>'ON', +10102=>'ON', +10103=>'ON', +10104=>'ON', +10105=>'ON', +10106=>'ON', +10107=>'ON', +10108=>'ON', +10109=>'ON', +10110=>'ON', +10111=>'ON', +10112=>'ON', +10113=>'ON', +10114=>'ON', +10115=>'ON', +10116=>'ON', +10117=>'ON', +10118=>'ON', +10119=>'ON', +10120=>'ON', +10121=>'ON', +10122=>'ON', +10123=>'ON', +10124=>'ON', +10125=>'ON', +10126=>'ON', +10127=>'ON', +10128=>'ON', +10129=>'ON', +10130=>'ON', +10131=>'ON', +10132=>'ON', +10136=>'ON', +10137=>'ON', +10138=>'ON', +10139=>'ON', +10140=>'ON', +10141=>'ON', +10142=>'ON', +10143=>'ON', +10144=>'ON', +10145=>'ON', +10146=>'ON', +10147=>'ON', +10148=>'ON', +10149=>'ON', +10150=>'ON', +10151=>'ON', +10152=>'ON', +10153=>'ON', +10154=>'ON', +10155=>'ON', +10156=>'ON', +10157=>'ON', +10158=>'ON', +10159=>'ON', +10161=>'ON', +10162=>'ON', +10163=>'ON', +10164=>'ON', +10165=>'ON', +10166=>'ON', +10167=>'ON', +10168=>'ON', +10169=>'ON', +10170=>'ON', +10171=>'ON', +10172=>'ON', +10173=>'ON', +10174=>'ON', +10176=>'ON', +10177=>'ON', +10178=>'ON', +10179=>'ON', +10180=>'ON', +10181=>'ON', +10182=>'ON', +10183=>'ON', +10184=>'ON', +10185=>'ON', +10186=>'ON', +10192=>'ON', +10193=>'ON', +10194=>'ON', +10195=>'ON', +10196=>'ON', +10197=>'ON', +10198=>'ON', +10199=>'ON', +10200=>'ON', +10201=>'ON', +10202=>'ON', +10203=>'ON', +10204=>'ON', +10205=>'ON', +10206=>'ON', +10207=>'ON', +10208=>'ON', +10209=>'ON', +10210=>'ON', +10211=>'ON', +10212=>'ON', +10213=>'ON', +10214=>'ON', +10215=>'ON', +10216=>'ON', +10217=>'ON', +10218=>'ON', +10219=>'ON', +10224=>'ON', +10225=>'ON', +10226=>'ON', +10227=>'ON', +10228=>'ON', +10229=>'ON', +10230=>'ON', +10231=>'ON', +10232=>'ON', +10233=>'ON', +10234=>'ON', +10235=>'ON', +10236=>'ON', +10237=>'ON', +10238=>'ON', +10239=>'ON', +10240=>'L', +10241=>'L', +10242=>'L', +10243=>'L', +10244=>'L', +10245=>'L', +10246=>'L', +10247=>'L', +10248=>'L', +10249=>'L', +10250=>'L', +10251=>'L', +10252=>'L', +10253=>'L', +10254=>'L', +10255=>'L', +10256=>'L', +10257=>'L', +10258=>'L', +10259=>'L', +10260=>'L', +10261=>'L', +10262=>'L', +10263=>'L', +10264=>'L', +10265=>'L', +10266=>'L', +10267=>'L', +10268=>'L', +10269=>'L', +10270=>'L', +10271=>'L', +10272=>'L', +10273=>'L', +10274=>'L', +10275=>'L', +10276=>'L', +10277=>'L', +10278=>'L', +10279=>'L', +10280=>'L', +10281=>'L', +10282=>'L', +10283=>'L', +10284=>'L', +10285=>'L', +10286=>'L', +10287=>'L', +10288=>'L', +10289=>'L', +10290=>'L', +10291=>'L', +10292=>'L', +10293=>'L', +10294=>'L', +10295=>'L', +10296=>'L', +10297=>'L', +10298=>'L', +10299=>'L', +10300=>'L', +10301=>'L', +10302=>'L', +10303=>'L', +10304=>'L', +10305=>'L', +10306=>'L', +10307=>'L', +10308=>'L', +10309=>'L', +10310=>'L', +10311=>'L', +10312=>'L', +10313=>'L', +10314=>'L', +10315=>'L', +10316=>'L', +10317=>'L', +10318=>'L', +10319=>'L', +10320=>'L', +10321=>'L', +10322=>'L', +10323=>'L', +10324=>'L', +10325=>'L', +10326=>'L', +10327=>'L', +10328=>'L', +10329=>'L', +10330=>'L', +10331=>'L', +10332=>'L', +10333=>'L', +10334=>'L', +10335=>'L', +10336=>'L', +10337=>'L', +10338=>'L', +10339=>'L', +10340=>'L', +10341=>'L', +10342=>'L', +10343=>'L', +10344=>'L', +10345=>'L', +10346=>'L', +10347=>'L', +10348=>'L', +10349=>'L', +10350=>'L', +10351=>'L', +10352=>'L', +10353=>'L', +10354=>'L', +10355=>'L', +10356=>'L', +10357=>'L', +10358=>'L', +10359=>'L', +10360=>'L', +10361=>'L', +10362=>'L', +10363=>'L', +10364=>'L', +10365=>'L', +10366=>'L', +10367=>'L', +10368=>'L', +10369=>'L', +10370=>'L', +10371=>'L', +10372=>'L', +10373=>'L', +10374=>'L', +10375=>'L', +10376=>'L', +10377=>'L', +10378=>'L', +10379=>'L', +10380=>'L', +10381=>'L', +10382=>'L', +10383=>'L', +10384=>'L', +10385=>'L', +10386=>'L', +10387=>'L', +10388=>'L', +10389=>'L', +10390=>'L', +10391=>'L', +10392=>'L', +10393=>'L', +10394=>'L', +10395=>'L', +10396=>'L', +10397=>'L', +10398=>'L', +10399=>'L', +10400=>'L', +10401=>'L', +10402=>'L', +10403=>'L', +10404=>'L', +10405=>'L', +10406=>'L', +10407=>'L', +10408=>'L', +10409=>'L', +10410=>'L', +10411=>'L', +10412=>'L', +10413=>'L', +10414=>'L', +10415=>'L', +10416=>'L', +10417=>'L', +10418=>'L', +10419=>'L', +10420=>'L', +10421=>'L', +10422=>'L', +10423=>'L', +10424=>'L', +10425=>'L', +10426=>'L', +10427=>'L', +10428=>'L', +10429=>'L', +10430=>'L', +10431=>'L', +10432=>'L', +10433=>'L', +10434=>'L', +10435=>'L', +10436=>'L', +10437=>'L', +10438=>'L', +10439=>'L', +10440=>'L', +10441=>'L', +10442=>'L', +10443=>'L', +10444=>'L', +10445=>'L', +10446=>'L', +10447=>'L', +10448=>'L', +10449=>'L', +10450=>'L', +10451=>'L', +10452=>'L', +10453=>'L', +10454=>'L', +10455=>'L', +10456=>'L', +10457=>'L', +10458=>'L', +10459=>'L', +10460=>'L', +10461=>'L', +10462=>'L', +10463=>'L', +10464=>'L', +10465=>'L', +10466=>'L', +10467=>'L', +10468=>'L', +10469=>'L', +10470=>'L', +10471=>'L', +10472=>'L', +10473=>'L', +10474=>'L', +10475=>'L', +10476=>'L', +10477=>'L', +10478=>'L', +10479=>'L', +10480=>'L', +10481=>'L', +10482=>'L', +10483=>'L', +10484=>'L', +10485=>'L', +10486=>'L', +10487=>'L', +10488=>'L', +10489=>'L', +10490=>'L', +10491=>'L', +10492=>'L', +10493=>'L', +10494=>'L', +10495=>'L', +10496=>'ON', +10497=>'ON', +10498=>'ON', +10499=>'ON', +10500=>'ON', +10501=>'ON', +10502=>'ON', +10503=>'ON', +10504=>'ON', +10505=>'ON', +10506=>'ON', +10507=>'ON', +10508=>'ON', +10509=>'ON', +10510=>'ON', +10511=>'ON', +10512=>'ON', +10513=>'ON', +10514=>'ON', +10515=>'ON', +10516=>'ON', +10517=>'ON', +10518=>'ON', +10519=>'ON', +10520=>'ON', +10521=>'ON', +10522=>'ON', +10523=>'ON', +10524=>'ON', +10525=>'ON', +10526=>'ON', +10527=>'ON', +10528=>'ON', +10529=>'ON', +10530=>'ON', +10531=>'ON', +10532=>'ON', +10533=>'ON', +10534=>'ON', +10535=>'ON', +10536=>'ON', +10537=>'ON', +10538=>'ON', +10539=>'ON', +10540=>'ON', +10541=>'ON', +10542=>'ON', +10543=>'ON', +10544=>'ON', +10545=>'ON', +10546=>'ON', +10547=>'ON', +10548=>'ON', +10549=>'ON', +10550=>'ON', +10551=>'ON', +10552=>'ON', +10553=>'ON', +10554=>'ON', +10555=>'ON', +10556=>'ON', +10557=>'ON', +10558=>'ON', +10559=>'ON', +10560=>'ON', +10561=>'ON', +10562=>'ON', +10563=>'ON', +10564=>'ON', +10565=>'ON', +10566=>'ON', +10567=>'ON', +10568=>'ON', +10569=>'ON', +10570=>'ON', +10571=>'ON', +10572=>'ON', +10573=>'ON', +10574=>'ON', +10575=>'ON', +10576=>'ON', +10577=>'ON', +10578=>'ON', +10579=>'ON', +10580=>'ON', +10581=>'ON', +10582=>'ON', +10583=>'ON', +10584=>'ON', +10585=>'ON', +10586=>'ON', +10587=>'ON', +10588=>'ON', +10589=>'ON', +10590=>'ON', +10591=>'ON', +10592=>'ON', +10593=>'ON', +10594=>'ON', +10595=>'ON', +10596=>'ON', +10597=>'ON', +10598=>'ON', +10599=>'ON', +10600=>'ON', +10601=>'ON', +10602=>'ON', +10603=>'ON', +10604=>'ON', +10605=>'ON', +10606=>'ON', +10607=>'ON', +10608=>'ON', +10609=>'ON', +10610=>'ON', +10611=>'ON', +10612=>'ON', +10613=>'ON', +10614=>'ON', +10615=>'ON', +10616=>'ON', +10617=>'ON', +10618=>'ON', +10619=>'ON', +10620=>'ON', +10621=>'ON', +10622=>'ON', +10623=>'ON', +10624=>'ON', +10625=>'ON', +10626=>'ON', +10627=>'ON', +10628=>'ON', +10629=>'ON', +10630=>'ON', +10631=>'ON', +10632=>'ON', +10633=>'ON', +10634=>'ON', +10635=>'ON', +10636=>'ON', +10637=>'ON', +10638=>'ON', +10639=>'ON', +10640=>'ON', +10641=>'ON', +10642=>'ON', +10643=>'ON', +10644=>'ON', +10645=>'ON', +10646=>'ON', +10647=>'ON', +10648=>'ON', +10649=>'ON', +10650=>'ON', +10651=>'ON', +10652=>'ON', +10653=>'ON', +10654=>'ON', +10655=>'ON', +10656=>'ON', +10657=>'ON', +10658=>'ON', +10659=>'ON', +10660=>'ON', +10661=>'ON', +10662=>'ON', +10663=>'ON', +10664=>'ON', +10665=>'ON', +10666=>'ON', +10667=>'ON', +10668=>'ON', +10669=>'ON', +10670=>'ON', +10671=>'ON', +10672=>'ON', +10673=>'ON', +10674=>'ON', +10675=>'ON', +10676=>'ON', +10677=>'ON', +10678=>'ON', +10679=>'ON', +10680=>'ON', +10681=>'ON', +10682=>'ON', +10683=>'ON', +10684=>'ON', +10685=>'ON', +10686=>'ON', +10687=>'ON', +10688=>'ON', +10689=>'ON', +10690=>'ON', +10691=>'ON', +10692=>'ON', +10693=>'ON', +10694=>'ON', +10695=>'ON', +10696=>'ON', +10697=>'ON', +10698=>'ON', +10699=>'ON', +10700=>'ON', +10701=>'ON', +10702=>'ON', +10703=>'ON', +10704=>'ON', +10705=>'ON', +10706=>'ON', +10707=>'ON', +10708=>'ON', +10709=>'ON', +10710=>'ON', +10711=>'ON', +10712=>'ON', +10713=>'ON', +10714=>'ON', +10715=>'ON', +10716=>'ON', +10717=>'ON', +10718=>'ON', +10719=>'ON', +10720=>'ON', +10721=>'ON', +10722=>'ON', +10723=>'ON', +10724=>'ON', +10725=>'ON', +10726=>'ON', +10727=>'ON', +10728=>'ON', +10729=>'ON', +10730=>'ON', +10731=>'ON', +10732=>'ON', +10733=>'ON', +10734=>'ON', +10735=>'ON', +10736=>'ON', +10737=>'ON', +10738=>'ON', +10739=>'ON', +10740=>'ON', +10741=>'ON', +10742=>'ON', +10743=>'ON', +10744=>'ON', +10745=>'ON', +10746=>'ON', +10747=>'ON', +10748=>'ON', +10749=>'ON', +10750=>'ON', +10751=>'ON', +10752=>'ON', +10753=>'ON', +10754=>'ON', +10755=>'ON', +10756=>'ON', +10757=>'ON', +10758=>'ON', +10759=>'ON', +10760=>'ON', +10761=>'ON', +10762=>'ON', +10763=>'ON', +10764=>'ON', +10765=>'ON', +10766=>'ON', +10767=>'ON', +10768=>'ON', +10769=>'ON', +10770=>'ON', +10771=>'ON', +10772=>'ON', +10773=>'ON', +10774=>'ON', +10775=>'ON', +10776=>'ON', +10777=>'ON', +10778=>'ON', +10779=>'ON', +10780=>'ON', +10781=>'ON', +10782=>'ON', +10783=>'ON', +10784=>'ON', +10785=>'ON', +10786=>'ON', +10787=>'ON', +10788=>'ON', +10789=>'ON', +10790=>'ON', +10791=>'ON', +10792=>'ON', +10793=>'ON', +10794=>'ON', +10795=>'ON', +10796=>'ON', +10797=>'ON', +10798=>'ON', +10799=>'ON', +10800=>'ON', +10801=>'ON', +10802=>'ON', +10803=>'ON', +10804=>'ON', +10805=>'ON', +10806=>'ON', +10807=>'ON', +10808=>'ON', +10809=>'ON', +10810=>'ON', +10811=>'ON', +10812=>'ON', +10813=>'ON', +10814=>'ON', +10815=>'ON', +10816=>'ON', +10817=>'ON', +10818=>'ON', +10819=>'ON', +10820=>'ON', +10821=>'ON', +10822=>'ON', +10823=>'ON', +10824=>'ON', +10825=>'ON', +10826=>'ON', +10827=>'ON', +10828=>'ON', +10829=>'ON', +10830=>'ON', +10831=>'ON', +10832=>'ON', +10833=>'ON', +10834=>'ON', +10835=>'ON', +10836=>'ON', +10837=>'ON', +10838=>'ON', +10839=>'ON', +10840=>'ON', +10841=>'ON', +10842=>'ON', +10843=>'ON', +10844=>'ON', +10845=>'ON', +10846=>'ON', +10847=>'ON', +10848=>'ON', +10849=>'ON', +10850=>'ON', +10851=>'ON', +10852=>'ON', +10853=>'ON', +10854=>'ON', +10855=>'ON', +10856=>'ON', +10857=>'ON', +10858=>'ON', +10859=>'ON', +10860=>'ON', +10861=>'ON', +10862=>'ON', +10863=>'ON', +10864=>'ON', +10865=>'ON', +10866=>'ON', +10867=>'ON', +10868=>'ON', +10869=>'ON', +10870=>'ON', +10871=>'ON', +10872=>'ON', +10873=>'ON', +10874=>'ON', +10875=>'ON', +10876=>'ON', +10877=>'ON', +10878=>'ON', +10879=>'ON', +10880=>'ON', +10881=>'ON', +10882=>'ON', +10883=>'ON', +10884=>'ON', +10885=>'ON', +10886=>'ON', +10887=>'ON', +10888=>'ON', +10889=>'ON', +10890=>'ON', +10891=>'ON', +10892=>'ON', +10893=>'ON', +10894=>'ON', +10895=>'ON', +10896=>'ON', +10897=>'ON', +10898=>'ON', +10899=>'ON', +10900=>'ON', +10901=>'ON', +10902=>'ON', +10903=>'ON', +10904=>'ON', +10905=>'ON', +10906=>'ON', +10907=>'ON', +10908=>'ON', +10909=>'ON', +10910=>'ON', +10911=>'ON', +10912=>'ON', +10913=>'ON', +10914=>'ON', +10915=>'ON', +10916=>'ON', +10917=>'ON', +10918=>'ON', +10919=>'ON', +10920=>'ON', +10921=>'ON', +10922=>'ON', +10923=>'ON', +10924=>'ON', +10925=>'ON', +10926=>'ON', +10927=>'ON', +10928=>'ON', +10929=>'ON', +10930=>'ON', +10931=>'ON', +10932=>'ON', +10933=>'ON', +10934=>'ON', +10935=>'ON', +10936=>'ON', +10937=>'ON', +10938=>'ON', +10939=>'ON', +10940=>'ON', +10941=>'ON', +10942=>'ON', +10943=>'ON', +10944=>'ON', +10945=>'ON', +10946=>'ON', +10947=>'ON', +10948=>'ON', +10949=>'ON', +10950=>'ON', +10951=>'ON', +10952=>'ON', +10953=>'ON', +10954=>'ON', +10955=>'ON', +10956=>'ON', +10957=>'ON', +10958=>'ON', +10959=>'ON', +10960=>'ON', +10961=>'ON', +10962=>'ON', +10963=>'ON', +10964=>'ON', +10965=>'ON', +10966=>'ON', +10967=>'ON', +10968=>'ON', +10969=>'ON', +10970=>'ON', +10971=>'ON', +10972=>'ON', +10973=>'ON', +10974=>'ON', +10975=>'ON', +10976=>'ON', +10977=>'ON', +10978=>'ON', +10979=>'ON', +10980=>'ON', +10981=>'ON', +10982=>'ON', +10983=>'ON', +10984=>'ON', +10985=>'ON', +10986=>'ON', +10987=>'ON', +10988=>'ON', +10989=>'ON', +10990=>'ON', +10991=>'ON', +10992=>'ON', +10993=>'ON', +10994=>'ON', +10995=>'ON', +10996=>'ON', +10997=>'ON', +10998=>'ON', +10999=>'ON', +11000=>'ON', +11001=>'ON', +11002=>'ON', +11003=>'ON', +11004=>'ON', +11005=>'ON', +11006=>'ON', +11007=>'ON', +11008=>'ON', +11009=>'ON', +11010=>'ON', +11011=>'ON', +11012=>'ON', +11013=>'ON', +11014=>'ON', +11015=>'ON', +11016=>'ON', +11017=>'ON', +11018=>'ON', +11019=>'ON', +11020=>'ON', +11021=>'ON', +11022=>'ON', +11023=>'ON', +11024=>'ON', +11025=>'ON', +11026=>'ON', +11027=>'ON', +11028=>'ON', +11029=>'ON', +11030=>'ON', +11031=>'ON', +11032=>'ON', +11033=>'ON', +11034=>'ON', +11040=>'ON', +11041=>'ON', +11042=>'ON', +11043=>'ON', +11264=>'L', +11265=>'L', +11266=>'L', +11267=>'L', +11268=>'L', +11269=>'L', +11270=>'L', +11271=>'L', +11272=>'L', +11273=>'L', +11274=>'L', +11275=>'L', +11276=>'L', +11277=>'L', +11278=>'L', +11279=>'L', +11280=>'L', +11281=>'L', +11282=>'L', +11283=>'L', +11284=>'L', +11285=>'L', +11286=>'L', +11287=>'L', +11288=>'L', +11289=>'L', +11290=>'L', +11291=>'L', +11292=>'L', +11293=>'L', +11294=>'L', +11295=>'L', +11296=>'L', +11297=>'L', +11298=>'L', +11299=>'L', +11300=>'L', +11301=>'L', +11302=>'L', +11303=>'L', +11304=>'L', +11305=>'L', +11306=>'L', +11307=>'L', +11308=>'L', +11309=>'L', +11310=>'L', +11312=>'L', +11313=>'L', +11314=>'L', +11315=>'L', +11316=>'L', +11317=>'L', +11318=>'L', +11319=>'L', +11320=>'L', +11321=>'L', +11322=>'L', +11323=>'L', +11324=>'L', +11325=>'L', +11326=>'L', +11327=>'L', +11328=>'L', +11329=>'L', +11330=>'L', +11331=>'L', +11332=>'L', +11333=>'L', +11334=>'L', +11335=>'L', +11336=>'L', +11337=>'L', +11338=>'L', +11339=>'L', +11340=>'L', +11341=>'L', +11342=>'L', +11343=>'L', +11344=>'L', +11345=>'L', +11346=>'L', +11347=>'L', +11348=>'L', +11349=>'L', +11350=>'L', +11351=>'L', +11352=>'L', +11353=>'L', +11354=>'L', +11355=>'L', +11356=>'L', +11357=>'L', +11358=>'L', +11360=>'L', +11361=>'L', +11362=>'L', +11363=>'L', +11364=>'L', +11365=>'L', +11366=>'L', +11367=>'L', +11368=>'L', +11369=>'L', +11370=>'L', +11371=>'L', +11372=>'L', +11380=>'L', +11381=>'L', +11382=>'L', +11383=>'L', +11392=>'L', +11393=>'L', +11394=>'L', +11395=>'L', +11396=>'L', +11397=>'L', +11398=>'L', +11399=>'L', +11400=>'L', +11401=>'L', +11402=>'L', +11403=>'L', +11404=>'L', +11405=>'L', +11406=>'L', +11407=>'L', +11408=>'L', +11409=>'L', +11410=>'L', +11411=>'L', +11412=>'L', +11413=>'L', +11414=>'L', +11415=>'L', +11416=>'L', +11417=>'L', +11418=>'L', +11419=>'L', +11420=>'L', +11421=>'L', +11422=>'L', +11423=>'L', +11424=>'L', +11425=>'L', +11426=>'L', +11427=>'L', +11428=>'L', +11429=>'L', +11430=>'L', +11431=>'L', +11432=>'L', +11433=>'L', +11434=>'L', +11435=>'L', +11436=>'L', +11437=>'L', +11438=>'L', +11439=>'L', +11440=>'L', +11441=>'L', +11442=>'L', +11443=>'L', +11444=>'L', +11445=>'L', +11446=>'L', +11447=>'L', +11448=>'L', +11449=>'L', +11450=>'L', +11451=>'L', +11452=>'L', +11453=>'L', +11454=>'L', +11455=>'L', +11456=>'L', +11457=>'L', +11458=>'L', +11459=>'L', +11460=>'L', +11461=>'L', +11462=>'L', +11463=>'L', +11464=>'L', +11465=>'L', +11466=>'L', +11467=>'L', +11468=>'L', +11469=>'L', +11470=>'L', +11471=>'L', +11472=>'L', +11473=>'L', +11474=>'L', +11475=>'L', +11476=>'L', +11477=>'L', +11478=>'L', +11479=>'L', +11480=>'L', +11481=>'L', +11482=>'L', +11483=>'L', +11484=>'L', +11485=>'L', +11486=>'L', +11487=>'L', +11488=>'L', +11489=>'L', +11490=>'L', +11491=>'L', +11492=>'L', +11493=>'ON', +11494=>'ON', +11495=>'ON', +11496=>'ON', +11497=>'ON', +11498=>'ON', +11513=>'ON', +11514=>'ON', +11515=>'ON', +11516=>'ON', +11517=>'ON', +11518=>'ON', +11519=>'ON', +11520=>'L', +11521=>'L', +11522=>'L', +11523=>'L', +11524=>'L', +11525=>'L', +11526=>'L', +11527=>'L', +11528=>'L', +11529=>'L', +11530=>'L', +11531=>'L', +11532=>'L', +11533=>'L', +11534=>'L', +11535=>'L', +11536=>'L', +11537=>'L', +11538=>'L', +11539=>'L', +11540=>'L', +11541=>'L', +11542=>'L', +11543=>'L', +11544=>'L', +11545=>'L', +11546=>'L', +11547=>'L', +11548=>'L', +11549=>'L', +11550=>'L', +11551=>'L', +11552=>'L', +11553=>'L', +11554=>'L', +11555=>'L', +11556=>'L', +11557=>'L', +11568=>'L', +11569=>'L', +11570=>'L', +11571=>'L', +11572=>'L', +11573=>'L', +11574=>'L', +11575=>'L', +11576=>'L', +11577=>'L', +11578=>'L', +11579=>'L', +11580=>'L', +11581=>'L', +11582=>'L', +11583=>'L', +11584=>'L', +11585=>'L', +11586=>'L', +11587=>'L', +11588=>'L', +11589=>'L', +11590=>'L', +11591=>'L', +11592=>'L', +11593=>'L', +11594=>'L', +11595=>'L', +11596=>'L', +11597=>'L', +11598=>'L', +11599=>'L', +11600=>'L', +11601=>'L', +11602=>'L', +11603=>'L', +11604=>'L', +11605=>'L', +11606=>'L', +11607=>'L', +11608=>'L', +11609=>'L', +11610=>'L', +11611=>'L', +11612=>'L', +11613=>'L', +11614=>'L', +11615=>'L', +11616=>'L', +11617=>'L', +11618=>'L', +11619=>'L', +11620=>'L', +11621=>'L', +11631=>'L', +11648=>'L', +11649=>'L', +11650=>'L', +11651=>'L', +11652=>'L', +11653=>'L', +11654=>'L', +11655=>'L', +11656=>'L', +11657=>'L', +11658=>'L', +11659=>'L', +11660=>'L', +11661=>'L', +11662=>'L', +11663=>'L', +11664=>'L', +11665=>'L', +11666=>'L', +11667=>'L', +11668=>'L', +11669=>'L', +11670=>'L', +11680=>'L', +11681=>'L', +11682=>'L', +11683=>'L', +11684=>'L', +11685=>'L', +11686=>'L', +11688=>'L', +11689=>'L', +11690=>'L', +11691=>'L', +11692=>'L', +11693=>'L', +11694=>'L', +11696=>'L', +11697=>'L', +11698=>'L', +11699=>'L', +11700=>'L', +11701=>'L', +11702=>'L', +11704=>'L', +11705=>'L', +11706=>'L', +11707=>'L', +11708=>'L', +11709=>'L', +11710=>'L', +11712=>'L', +11713=>'L', +11714=>'L', +11715=>'L', +11716=>'L', +11717=>'L', +11718=>'L', +11720=>'L', +11721=>'L', +11722=>'L', +11723=>'L', +11724=>'L', +11725=>'L', +11726=>'L', +11728=>'L', +11729=>'L', +11730=>'L', +11731=>'L', +11732=>'L', +11733=>'L', +11734=>'L', +11736=>'L', +11737=>'L', +11738=>'L', +11739=>'L', +11740=>'L', +11741=>'L', +11742=>'L', +11776=>'ON', +11777=>'ON', +11778=>'ON', +11779=>'ON', +11780=>'ON', +11781=>'ON', +11782=>'ON', +11783=>'ON', +11784=>'ON', +11785=>'ON', +11786=>'ON', +11787=>'ON', +11788=>'ON', +11789=>'ON', +11790=>'ON', +11791=>'ON', +11792=>'ON', +11793=>'ON', +11794=>'ON', +11795=>'ON', +11796=>'ON', +11797=>'ON', +11798=>'ON', +11799=>'ON', +11804=>'ON', +11805=>'ON', +11904=>'ON', +11905=>'ON', +11906=>'ON', +11907=>'ON', +11908=>'ON', +11909=>'ON', +11910=>'ON', +11911=>'ON', +11912=>'ON', +11913=>'ON', +11914=>'ON', +11915=>'ON', +11916=>'ON', +11917=>'ON', +11918=>'ON', +11919=>'ON', +11920=>'ON', +11921=>'ON', +11922=>'ON', +11923=>'ON', +11924=>'ON', +11925=>'ON', +11926=>'ON', +11927=>'ON', +11928=>'ON', +11929=>'ON', +11931=>'ON', +11932=>'ON', +11933=>'ON', +11934=>'ON', +11935=>'ON', +11936=>'ON', +11937=>'ON', +11938=>'ON', +11939=>'ON', +11940=>'ON', +11941=>'ON', +11942=>'ON', +11943=>'ON', +11944=>'ON', +11945=>'ON', +11946=>'ON', +11947=>'ON', +11948=>'ON', +11949=>'ON', +11950=>'ON', +11951=>'ON', +11952=>'ON', +11953=>'ON', +11954=>'ON', +11955=>'ON', +11956=>'ON', +11957=>'ON', +11958=>'ON', +11959=>'ON', +11960=>'ON', +11961=>'ON', +11962=>'ON', +11963=>'ON', +11964=>'ON', +11965=>'ON', +11966=>'ON', +11967=>'ON', +11968=>'ON', +11969=>'ON', +11970=>'ON', +11971=>'ON', +11972=>'ON', +11973=>'ON', +11974=>'ON', +11975=>'ON', +11976=>'ON', +11977=>'ON', +11978=>'ON', +11979=>'ON', +11980=>'ON', +11981=>'ON', +11982=>'ON', +11983=>'ON', +11984=>'ON', +11985=>'ON', +11986=>'ON', +11987=>'ON', +11988=>'ON', +11989=>'ON', +11990=>'ON', +11991=>'ON', +11992=>'ON', +11993=>'ON', +11994=>'ON', +11995=>'ON', +11996=>'ON', +11997=>'ON', +11998=>'ON', +11999=>'ON', +12000=>'ON', +12001=>'ON', +12002=>'ON', +12003=>'ON', +12004=>'ON', +12005=>'ON', +12006=>'ON', +12007=>'ON', +12008=>'ON', +12009=>'ON', +12010=>'ON', +12011=>'ON', +12012=>'ON', +12013=>'ON', +12014=>'ON', +12015=>'ON', +12016=>'ON', +12017=>'ON', +12018=>'ON', +12019=>'ON', +12032=>'ON', +12033=>'ON', +12034=>'ON', +12035=>'ON', +12036=>'ON', +12037=>'ON', +12038=>'ON', +12039=>'ON', +12040=>'ON', +12041=>'ON', +12042=>'ON', +12043=>'ON', +12044=>'ON', +12045=>'ON', +12046=>'ON', +12047=>'ON', +12048=>'ON', +12049=>'ON', +12050=>'ON', +12051=>'ON', +12052=>'ON', +12053=>'ON', +12054=>'ON', +12055=>'ON', +12056=>'ON', +12057=>'ON', +12058=>'ON', +12059=>'ON', +12060=>'ON', +12061=>'ON', +12062=>'ON', +12063=>'ON', +12064=>'ON', +12065=>'ON', +12066=>'ON', +12067=>'ON', +12068=>'ON', +12069=>'ON', +12070=>'ON', +12071=>'ON', +12072=>'ON', +12073=>'ON', +12074=>'ON', +12075=>'ON', +12076=>'ON', +12077=>'ON', +12078=>'ON', +12079=>'ON', +12080=>'ON', +12081=>'ON', +12082=>'ON', +12083=>'ON', +12084=>'ON', +12085=>'ON', +12086=>'ON', +12087=>'ON', +12088=>'ON', +12089=>'ON', +12090=>'ON', +12091=>'ON', +12092=>'ON', +12093=>'ON', +12094=>'ON', +12095=>'ON', +12096=>'ON', +12097=>'ON', +12098=>'ON', +12099=>'ON', +12100=>'ON', +12101=>'ON', +12102=>'ON', +12103=>'ON', +12104=>'ON', +12105=>'ON', +12106=>'ON', +12107=>'ON', +12108=>'ON', +12109=>'ON', +12110=>'ON', +12111=>'ON', +12112=>'ON', +12113=>'ON', +12114=>'ON', +12115=>'ON', +12116=>'ON', +12117=>'ON', +12118=>'ON', +12119=>'ON', +12120=>'ON', +12121=>'ON', +12122=>'ON', +12123=>'ON', +12124=>'ON', +12125=>'ON', +12126=>'ON', +12127=>'ON', +12128=>'ON', +12129=>'ON', +12130=>'ON', +12131=>'ON', +12132=>'ON', +12133=>'ON', +12134=>'ON', +12135=>'ON', +12136=>'ON', +12137=>'ON', +12138=>'ON', +12139=>'ON', +12140=>'ON', +12141=>'ON', +12142=>'ON', +12143=>'ON', +12144=>'ON', +12145=>'ON', +12146=>'ON', +12147=>'ON', +12148=>'ON', +12149=>'ON', +12150=>'ON', +12151=>'ON', +12152=>'ON', +12153=>'ON', +12154=>'ON', +12155=>'ON', +12156=>'ON', +12157=>'ON', +12158=>'ON', +12159=>'ON', +12160=>'ON', +12161=>'ON', +12162=>'ON', +12163=>'ON', +12164=>'ON', +12165=>'ON', +12166=>'ON', +12167=>'ON', +12168=>'ON', +12169=>'ON', +12170=>'ON', +12171=>'ON', +12172=>'ON', +12173=>'ON', +12174=>'ON', +12175=>'ON', +12176=>'ON', +12177=>'ON', +12178=>'ON', +12179=>'ON', +12180=>'ON', +12181=>'ON', +12182=>'ON', +12183=>'ON', +12184=>'ON', +12185=>'ON', +12186=>'ON', +12187=>'ON', +12188=>'ON', +12189=>'ON', +12190=>'ON', +12191=>'ON', +12192=>'ON', +12193=>'ON', +12194=>'ON', +12195=>'ON', +12196=>'ON', +12197=>'ON', +12198=>'ON', +12199=>'ON', +12200=>'ON', +12201=>'ON', +12202=>'ON', +12203=>'ON', +12204=>'ON', +12205=>'ON', +12206=>'ON', +12207=>'ON', +12208=>'ON', +12209=>'ON', +12210=>'ON', +12211=>'ON', +12212=>'ON', +12213=>'ON', +12214=>'ON', +12215=>'ON', +12216=>'ON', +12217=>'ON', +12218=>'ON', +12219=>'ON', +12220=>'ON', +12221=>'ON', +12222=>'ON', +12223=>'ON', +12224=>'ON', +12225=>'ON', +12226=>'ON', +12227=>'ON', +12228=>'ON', +12229=>'ON', +12230=>'ON', +12231=>'ON', +12232=>'ON', +12233=>'ON', +12234=>'ON', +12235=>'ON', +12236=>'ON', +12237=>'ON', +12238=>'ON', +12239=>'ON', +12240=>'ON', +12241=>'ON', +12242=>'ON', +12243=>'ON', +12244=>'ON', +12245=>'ON', +12272=>'ON', +12273=>'ON', +12274=>'ON', +12275=>'ON', +12276=>'ON', +12277=>'ON', +12278=>'ON', +12279=>'ON', +12280=>'ON', +12281=>'ON', +12282=>'ON', +12283=>'ON', +12288=>'WS', +12289=>'ON', +12290=>'ON', +12291=>'ON', +12292=>'ON', +12293=>'L', +12294=>'L', +12295=>'L', +12296=>'ON', +12297=>'ON', +12298=>'ON', +12299=>'ON', +12300=>'ON', +12301=>'ON', +12302=>'ON', +12303=>'ON', +12304=>'ON', +12305=>'ON', +12306=>'ON', +12307=>'ON', +12308=>'ON', +12309=>'ON', +12310=>'ON', +12311=>'ON', +12312=>'ON', +12313=>'ON', +12314=>'ON', +12315=>'ON', +12316=>'ON', +12317=>'ON', +12318=>'ON', +12319=>'ON', +12320=>'ON', +12321=>'L', +12322=>'L', +12323=>'L', +12324=>'L', +12325=>'L', +12326=>'L', +12327=>'L', +12328=>'L', +12329=>'L', +12330=>'NSM', +12331=>'NSM', +12332=>'NSM', +12333=>'NSM', +12334=>'NSM', +12335=>'NSM', +12336=>'ON', +12337=>'L', +12338=>'L', +12339=>'L', +12340=>'L', +12341=>'L', +12342=>'ON', +12343=>'ON', +12344=>'L', +12345=>'L', +12346=>'L', +12347=>'L', +12348=>'L', +12349=>'ON', +12350=>'ON', +12351=>'ON', +12353=>'L', +12354=>'L', +12355=>'L', +12356=>'L', +12357=>'L', +12358=>'L', +12359=>'L', +12360=>'L', +12361=>'L', +12362=>'L', +12363=>'L', +12364=>'L', +12365=>'L', +12366=>'L', +12367=>'L', +12368=>'L', +12369=>'L', +12370=>'L', +12371=>'L', +12372=>'L', +12373=>'L', +12374=>'L', +12375=>'L', +12376=>'L', +12377=>'L', +12378=>'L', +12379=>'L', +12380=>'L', +12381=>'L', +12382=>'L', +12383=>'L', +12384=>'L', +12385=>'L', +12386=>'L', +12387=>'L', +12388=>'L', +12389=>'L', +12390=>'L', +12391=>'L', +12392=>'L', +12393=>'L', +12394=>'L', +12395=>'L', +12396=>'L', +12397=>'L', +12398=>'L', +12399=>'L', +12400=>'L', +12401=>'L', +12402=>'L', +12403=>'L', +12404=>'L', +12405=>'L', +12406=>'L', +12407=>'L', +12408=>'L', +12409=>'L', +12410=>'L', +12411=>'L', +12412=>'L', +12413=>'L', +12414=>'L', +12415=>'L', +12416=>'L', +12417=>'L', +12418=>'L', +12419=>'L', +12420=>'L', +12421=>'L', +12422=>'L', +12423=>'L', +12424=>'L', +12425=>'L', +12426=>'L', +12427=>'L', +12428=>'L', +12429=>'L', +12430=>'L', +12431=>'L', +12432=>'L', +12433=>'L', +12434=>'L', +12435=>'L', +12436=>'L', +12437=>'L', +12438=>'L', +12441=>'NSM', +12442=>'NSM', +12443=>'ON', +12444=>'ON', +12445=>'L', +12446=>'L', +12447=>'L', +12448=>'ON', +12449=>'L', +12450=>'L', +12451=>'L', +12452=>'L', +12453=>'L', +12454=>'L', +12455=>'L', +12456=>'L', +12457=>'L', +12458=>'L', +12459=>'L', +12460=>'L', +12461=>'L', +12462=>'L', +12463=>'L', +12464=>'L', +12465=>'L', +12466=>'L', +12467=>'L', +12468=>'L', +12469=>'L', +12470=>'L', +12471=>'L', +12472=>'L', +12473=>'L', +12474=>'L', +12475=>'L', +12476=>'L', +12477=>'L', +12478=>'L', +12479=>'L', +12480=>'L', +12481=>'L', +12482=>'L', +12483=>'L', +12484=>'L', +12485=>'L', +12486=>'L', +12487=>'L', +12488=>'L', +12489=>'L', +12490=>'L', +12491=>'L', +12492=>'L', +12493=>'L', +12494=>'L', +12495=>'L', +12496=>'L', +12497=>'L', +12498=>'L', +12499=>'L', +12500=>'L', +12501=>'L', +12502=>'L', +12503=>'L', +12504=>'L', +12505=>'L', +12506=>'L', +12507=>'L', +12508=>'L', +12509=>'L', +12510=>'L', +12511=>'L', +12512=>'L', +12513=>'L', +12514=>'L', +12515=>'L', +12516=>'L', +12517=>'L', +12518=>'L', +12519=>'L', +12520=>'L', +12521=>'L', +12522=>'L', +12523=>'L', +12524=>'L', +12525=>'L', +12526=>'L', +12527=>'L', +12528=>'L', +12529=>'L', +12530=>'L', +12531=>'L', +12532=>'L', +12533=>'L', +12534=>'L', +12535=>'L', +12536=>'L', +12537=>'L', +12538=>'L', +12539=>'ON', +12540=>'L', +12541=>'L', +12542=>'L', +12543=>'L', +12549=>'L', +12550=>'L', +12551=>'L', +12552=>'L', +12553=>'L', +12554=>'L', +12555=>'L', +12556=>'L', +12557=>'L', +12558=>'L', +12559=>'L', +12560=>'L', +12561=>'L', +12562=>'L', +12563=>'L', +12564=>'L', +12565=>'L', +12566=>'L', +12567=>'L', +12568=>'L', +12569=>'L', +12570=>'L', +12571=>'L', +12572=>'L', +12573=>'L', +12574=>'L', +12575=>'L', +12576=>'L', +12577=>'L', +12578=>'L', +12579=>'L', +12580=>'L', +12581=>'L', +12582=>'L', +12583=>'L', +12584=>'L', +12585=>'L', +12586=>'L', +12587=>'L', +12588=>'L', +12593=>'L', +12594=>'L', +12595=>'L', +12596=>'L', +12597=>'L', +12598=>'L', +12599=>'L', +12600=>'L', +12601=>'L', +12602=>'L', +12603=>'L', +12604=>'L', +12605=>'L', +12606=>'L', +12607=>'L', +12608=>'L', +12609=>'L', +12610=>'L', +12611=>'L', +12612=>'L', +12613=>'L', +12614=>'L', +12615=>'L', +12616=>'L', +12617=>'L', +12618=>'L', +12619=>'L', +12620=>'L', +12621=>'L', +12622=>'L', +12623=>'L', +12624=>'L', +12625=>'L', +12626=>'L', +12627=>'L', +12628=>'L', +12629=>'L', +12630=>'L', +12631=>'L', +12632=>'L', +12633=>'L', +12634=>'L', +12635=>'L', +12636=>'L', +12637=>'L', +12638=>'L', +12639=>'L', +12640=>'L', +12641=>'L', +12642=>'L', +12643=>'L', +12644=>'L', +12645=>'L', +12646=>'L', +12647=>'L', +12648=>'L', +12649=>'L', +12650=>'L', +12651=>'L', +12652=>'L', +12653=>'L', +12654=>'L', +12655=>'L', +12656=>'L', +12657=>'L', +12658=>'L', +12659=>'L', +12660=>'L', +12661=>'L', +12662=>'L', +12663=>'L', +12664=>'L', +12665=>'L', +12666=>'L', +12667=>'L', +12668=>'L', +12669=>'L', +12670=>'L', +12671=>'L', +12672=>'L', +12673=>'L', +12674=>'L', +12675=>'L', +12676=>'L', +12677=>'L', +12678=>'L', +12679=>'L', +12680=>'L', +12681=>'L', +12682=>'L', +12683=>'L', +12684=>'L', +12685=>'L', +12686=>'L', +12688=>'L', +12689=>'L', +12690=>'L', +12691=>'L', +12692=>'L', +12693=>'L', +12694=>'L', +12695=>'L', +12696=>'L', +12697=>'L', +12698=>'L', +12699=>'L', +12700=>'L', +12701=>'L', +12702=>'L', +12703=>'L', +12704=>'L', +12705=>'L', +12706=>'L', +12707=>'L', +12708=>'L', +12709=>'L', +12710=>'L', +12711=>'L', +12712=>'L', +12713=>'L', +12714=>'L', +12715=>'L', +12716=>'L', +12717=>'L', +12718=>'L', +12719=>'L', +12720=>'L', +12721=>'L', +12722=>'L', +12723=>'L', +12724=>'L', +12725=>'L', +12726=>'L', +12727=>'L', +12736=>'ON', +12737=>'ON', +12738=>'ON', +12739=>'ON', +12740=>'ON', +12741=>'ON', +12742=>'ON', +12743=>'ON', +12744=>'ON', +12745=>'ON', +12746=>'ON', +12747=>'ON', +12748=>'ON', +12749=>'ON', +12750=>'ON', +12751=>'ON', +12784=>'L', +12785=>'L', +12786=>'L', +12787=>'L', +12788=>'L', +12789=>'L', +12790=>'L', +12791=>'L', +12792=>'L', +12793=>'L', +12794=>'L', +12795=>'L', +12796=>'L', +12797=>'L', +12798=>'L', +12799=>'L', +12800=>'L', +12801=>'L', +12802=>'L', +12803=>'L', +12804=>'L', +12805=>'L', +12806=>'L', +12807=>'L', +12808=>'L', +12809=>'L', +12810=>'L', +12811=>'L', +12812=>'L', +12813=>'L', +12814=>'L', +12815=>'L', +12816=>'L', +12817=>'L', +12818=>'L', +12819=>'L', +12820=>'L', +12821=>'L', +12822=>'L', +12823=>'L', +12824=>'L', +12825=>'L', +12826=>'L', +12827=>'L', +12828=>'L', +12829=>'ON', +12830=>'ON', +12832=>'L', +12833=>'L', +12834=>'L', +12835=>'L', +12836=>'L', +12837=>'L', +12838=>'L', +12839=>'L', +12840=>'L', +12841=>'L', +12842=>'L', +12843=>'L', +12844=>'L', +12845=>'L', +12846=>'L', +12847=>'L', +12848=>'L', +12849=>'L', +12850=>'L', +12851=>'L', +12852=>'L', +12853=>'L', +12854=>'L', +12855=>'L', +12856=>'L', +12857=>'L', +12858=>'L', +12859=>'L', +12860=>'L', +12861=>'L', +12862=>'L', +12863=>'L', +12864=>'L', +12865=>'L', +12866=>'L', +12867=>'L', +12880=>'ON', +12881=>'ON', +12882=>'ON', +12883=>'ON', +12884=>'ON', +12885=>'ON', +12886=>'ON', +12887=>'ON', +12888=>'ON', +12889=>'ON', +12890=>'ON', +12891=>'ON', +12892=>'ON', +12893=>'ON', +12894=>'ON', +12895=>'ON', +12896=>'L', +12897=>'L', +12898=>'L', +12899=>'L', +12900=>'L', +12901=>'L', +12902=>'L', +12903=>'L', +12904=>'L', +12905=>'L', +12906=>'L', +12907=>'L', +12908=>'L', +12909=>'L', +12910=>'L', +12911=>'L', +12912=>'L', +12913=>'L', +12914=>'L', +12915=>'L', +12916=>'L', +12917=>'L', +12918=>'L', +12919=>'L', +12920=>'L', +12921=>'L', +12922=>'L', +12923=>'L', +12924=>'ON', +12925=>'ON', +12926=>'ON', +12927=>'L', +12928=>'L', +12929=>'L', +12930=>'L', +12931=>'L', +12932=>'L', +12933=>'L', +12934=>'L', +12935=>'L', +12936=>'L', +12937=>'L', +12938=>'L', +12939=>'L', +12940=>'L', +12941=>'L', +12942=>'L', +12943=>'L', +12944=>'L', +12945=>'L', +12946=>'L', +12947=>'L', +12948=>'L', +12949=>'L', +12950=>'L', +12951=>'L', +12952=>'L', +12953=>'L', +12954=>'L', +12955=>'L', +12956=>'L', +12957=>'L', +12958=>'L', +12959=>'L', +12960=>'L', +12961=>'L', +12962=>'L', +12963=>'L', +12964=>'L', +12965=>'L', +12966=>'L', +12967=>'L', +12968=>'L', +12969=>'L', +12970=>'L', +12971=>'L', +12972=>'L', +12973=>'L', +12974=>'L', +12975=>'L', +12976=>'L', +12977=>'ON', +12978=>'ON', +12979=>'ON', +12980=>'ON', +12981=>'ON', +12982=>'ON', +12983=>'ON', +12984=>'ON', +12985=>'ON', +12986=>'ON', +12987=>'ON', +12988=>'ON', +12989=>'ON', +12990=>'ON', +12991=>'ON', +12992=>'L', +12993=>'L', +12994=>'L', +12995=>'L', +12996=>'L', +12997=>'L', +12998=>'L', +12999=>'L', +13000=>'L', +13001=>'L', +13002=>'L', +13003=>'L', +13004=>'ON', +13005=>'ON', +13006=>'ON', +13007=>'ON', +13008=>'L', +13009=>'L', +13010=>'L', +13011=>'L', +13012=>'L', +13013=>'L', +13014=>'L', +13015=>'L', +13016=>'L', +13017=>'L', +13018=>'L', +13019=>'L', +13020=>'L', +13021=>'L', +13022=>'L', +13023=>'L', +13024=>'L', +13025=>'L', +13026=>'L', +13027=>'L', +13028=>'L', +13029=>'L', +13030=>'L', +13031=>'L', +13032=>'L', +13033=>'L', +13034=>'L', +13035=>'L', +13036=>'L', +13037=>'L', +13038=>'L', +13039=>'L', +13040=>'L', +13041=>'L', +13042=>'L', +13043=>'L', +13044=>'L', +13045=>'L', +13046=>'L', +13047=>'L', +13048=>'L', +13049=>'L', +13050=>'L', +13051=>'L', +13052=>'L', +13053=>'L', +13054=>'L', +13056=>'L', +13057=>'L', +13058=>'L', +13059=>'L', +13060=>'L', +13061=>'L', +13062=>'L', +13063=>'L', +13064=>'L', +13065=>'L', +13066=>'L', +13067=>'L', +13068=>'L', +13069=>'L', +13070=>'L', +13071=>'L', +13072=>'L', +13073=>'L', +13074=>'L', +13075=>'L', +13076=>'L', +13077=>'L', +13078=>'L', +13079=>'L', +13080=>'L', +13081=>'L', +13082=>'L', +13083=>'L', +13084=>'L', +13085=>'L', +13086=>'L', +13087=>'L', +13088=>'L', +13089=>'L', +13090=>'L', +13091=>'L', +13092=>'L', +13093=>'L', +13094=>'L', +13095=>'L', +13096=>'L', +13097=>'L', +13098=>'L', +13099=>'L', +13100=>'L', +13101=>'L', +13102=>'L', +13103=>'L', +13104=>'L', +13105=>'L', +13106=>'L', +13107=>'L', +13108=>'L', +13109=>'L', +13110=>'L', +13111=>'L', +13112=>'L', +13113=>'L', +13114=>'L', +13115=>'L', +13116=>'L', +13117=>'L', +13118=>'L', +13119=>'L', +13120=>'L', +13121=>'L', +13122=>'L', +13123=>'L', +13124=>'L', +13125=>'L', +13126=>'L', +13127=>'L', +13128=>'L', +13129=>'L', +13130=>'L', +13131=>'L', +13132=>'L', +13133=>'L', +13134=>'L', +13135=>'L', +13136=>'L', +13137=>'L', +13138=>'L', +13139=>'L', +13140=>'L', +13141=>'L', +13142=>'L', +13143=>'L', +13144=>'L', +13145=>'L', +13146=>'L', +13147=>'L', +13148=>'L', +13149=>'L', +13150=>'L', +13151=>'L', +13152=>'L', +13153=>'L', +13154=>'L', +13155=>'L', +13156=>'L', +13157=>'L', +13158=>'L', +13159=>'L', +13160=>'L', +13161=>'L', +13162=>'L', +13163=>'L', +13164=>'L', +13165=>'L', +13166=>'L', +13167=>'L', +13168=>'L', +13169=>'L', +13170=>'L', +13171=>'L', +13172=>'L', +13173=>'L', +13174=>'L', +13175=>'ON', +13176=>'ON', +13177=>'ON', +13178=>'ON', +13179=>'L', +13180=>'L', +13181=>'L', +13182=>'L', +13183=>'L', +13184=>'L', +13185=>'L', +13186=>'L', +13187=>'L', +13188=>'L', +13189=>'L', +13190=>'L', +13191=>'L', +13192=>'L', +13193=>'L', +13194=>'L', +13195=>'L', +13196=>'L', +13197=>'L', +13198=>'L', +13199=>'L', +13200=>'L', +13201=>'L', +13202=>'L', +13203=>'L', +13204=>'L', +13205=>'L', +13206=>'L', +13207=>'L', +13208=>'L', +13209=>'L', +13210=>'L', +13211=>'L', +13212=>'L', +13213=>'L', +13214=>'L', +13215=>'L', +13216=>'L', +13217=>'L', +13218=>'L', +13219=>'L', +13220=>'L', +13221=>'L', +13222=>'L', +13223=>'L', +13224=>'L', +13225=>'L', +13226=>'L', +13227=>'L', +13228=>'L', +13229=>'L', +13230=>'L', +13231=>'L', +13232=>'L', +13233=>'L', +13234=>'L', +13235=>'L', +13236=>'L', +13237=>'L', +13238=>'L', +13239=>'L', +13240=>'L', +13241=>'L', +13242=>'L', +13243=>'L', +13244=>'L', +13245=>'L', +13246=>'L', +13247=>'L', +13248=>'L', +13249=>'L', +13250=>'L', +13251=>'L', +13252=>'L', +13253=>'L', +13254=>'L', +13255=>'L', +13256=>'L', +13257=>'L', +13258=>'L', +13259=>'L', +13260=>'L', +13261=>'L', +13262=>'L', +13263=>'L', +13264=>'L', +13265=>'L', +13266=>'L', +13267=>'L', +13268=>'L', +13269=>'L', +13270=>'L', +13271=>'L', +13272=>'L', +13273=>'L', +13274=>'L', +13275=>'L', +13276=>'L', +13277=>'L', +13278=>'ON', +13279=>'ON', +13280=>'L', +13281=>'L', +13282=>'L', +13283=>'L', +13284=>'L', +13285=>'L', +13286=>'L', +13287=>'L', +13288=>'L', +13289=>'L', +13290=>'L', +13291=>'L', +13292=>'L', +13293=>'L', +13294=>'L', +13295=>'L', +13296=>'L', +13297=>'L', +13298=>'L', +13299=>'L', +13300=>'L', +13301=>'L', +13302=>'L', +13303=>'L', +13304=>'L', +13305=>'L', +13306=>'L', +13307=>'L', +13308=>'L', +13309=>'L', +13310=>'L', +13311=>'ON', +13312=>'L', +19893=>'L', +19904=>'ON', +19905=>'ON', +19906=>'ON', +19907=>'ON', +19908=>'ON', +19909=>'ON', +19910=>'ON', +19911=>'ON', +19912=>'ON', +19913=>'ON', +19914=>'ON', +19915=>'ON', +19916=>'ON', +19917=>'ON', +19918=>'ON', +19919=>'ON', +19920=>'ON', +19921=>'ON', +19922=>'ON', +19923=>'ON', +19924=>'ON', +19925=>'ON', +19926=>'ON', +19927=>'ON', +19928=>'ON', +19929=>'ON', +19930=>'ON', +19931=>'ON', +19932=>'ON', +19933=>'ON', +19934=>'ON', +19935=>'ON', +19936=>'ON', +19937=>'ON', +19938=>'ON', +19939=>'ON', +19940=>'ON', +19941=>'ON', +19942=>'ON', +19943=>'ON', +19944=>'ON', +19945=>'ON', +19946=>'ON', +19947=>'ON', +19948=>'ON', +19949=>'ON', +19950=>'ON', +19951=>'ON', +19952=>'ON', +19953=>'ON', +19954=>'ON', +19955=>'ON', +19956=>'ON', +19957=>'ON', +19958=>'ON', +19959=>'ON', +19960=>'ON', +19961=>'ON', +19962=>'ON', +19963=>'ON', +19964=>'ON', +19965=>'ON', +19966=>'ON', +19967=>'ON', +19968=>'L', +40891=>'L', +40960=>'L', +40961=>'L', +40962=>'L', +40963=>'L', +40964=>'L', +40965=>'L', +40966=>'L', +40967=>'L', +40968=>'L', +40969=>'L', +40970=>'L', +40971=>'L', +40972=>'L', +40973=>'L', +40974=>'L', +40975=>'L', +40976=>'L', +40977=>'L', +40978=>'L', +40979=>'L', +40980=>'L', +40981=>'L', +40982=>'L', +40983=>'L', +40984=>'L', +40985=>'L', +40986=>'L', +40987=>'L', +40988=>'L', +40989=>'L', +40990=>'L', +40991=>'L', +40992=>'L', +40993=>'L', +40994=>'L', +40995=>'L', +40996=>'L', +40997=>'L', +40998=>'L', +40999=>'L', +41000=>'L', +41001=>'L', +41002=>'L', +41003=>'L', +41004=>'L', +41005=>'L', +41006=>'L', +41007=>'L', +41008=>'L', +41009=>'L', +41010=>'L', +41011=>'L', +41012=>'L', +41013=>'L', +41014=>'L', +41015=>'L', +41016=>'L', +41017=>'L', +41018=>'L', +41019=>'L', +41020=>'L', +41021=>'L', +41022=>'L', +41023=>'L', +41024=>'L', +41025=>'L', +41026=>'L', +41027=>'L', +41028=>'L', +41029=>'L', +41030=>'L', +41031=>'L', +41032=>'L', +41033=>'L', +41034=>'L', +41035=>'L', +41036=>'L', +41037=>'L', +41038=>'L', +41039=>'L', +41040=>'L', +41041=>'L', +41042=>'L', +41043=>'L', +41044=>'L', +41045=>'L', +41046=>'L', +41047=>'L', +41048=>'L', +41049=>'L', +41050=>'L', +41051=>'L', +41052=>'L', +41053=>'L', +41054=>'L', +41055=>'L', +41056=>'L', +41057=>'L', +41058=>'L', +41059=>'L', +41060=>'L', +41061=>'L', +41062=>'L', +41063=>'L', +41064=>'L', +41065=>'L', +41066=>'L', +41067=>'L', +41068=>'L', +41069=>'L', +41070=>'L', +41071=>'L', +41072=>'L', +41073=>'L', +41074=>'L', +41075=>'L', +41076=>'L', +41077=>'L', +41078=>'L', +41079=>'L', +41080=>'L', +41081=>'L', +41082=>'L', +41083=>'L', +41084=>'L', +41085=>'L', +41086=>'L', +41087=>'L', +41088=>'L', +41089=>'L', +41090=>'L', +41091=>'L', +41092=>'L', +41093=>'L', +41094=>'L', +41095=>'L', +41096=>'L', +41097=>'L', +41098=>'L', +41099=>'L', +41100=>'L', +41101=>'L', +41102=>'L', +41103=>'L', +41104=>'L', +41105=>'L', +41106=>'L', +41107=>'L', +41108=>'L', +41109=>'L', +41110=>'L', +41111=>'L', +41112=>'L', +41113=>'L', +41114=>'L', +41115=>'L', +41116=>'L', +41117=>'L', +41118=>'L', +41119=>'L', +41120=>'L', +41121=>'L', +41122=>'L', +41123=>'L', +41124=>'L', +41125=>'L', +41126=>'L', +41127=>'L', +41128=>'L', +41129=>'L', +41130=>'L', +41131=>'L', +41132=>'L', +41133=>'L', +41134=>'L', +41135=>'L', +41136=>'L', +41137=>'L', +41138=>'L', +41139=>'L', +41140=>'L', +41141=>'L', +41142=>'L', +41143=>'L', +41144=>'L', +41145=>'L', +41146=>'L', +41147=>'L', +41148=>'L', +41149=>'L', +41150=>'L', +41151=>'L', +41152=>'L', +41153=>'L', +41154=>'L', +41155=>'L', +41156=>'L', +41157=>'L', +41158=>'L', +41159=>'L', +41160=>'L', +41161=>'L', +41162=>'L', +41163=>'L', +41164=>'L', +41165=>'L', +41166=>'L', +41167=>'L', +41168=>'L', +41169=>'L', +41170=>'L', +41171=>'L', +41172=>'L', +41173=>'L', +41174=>'L', +41175=>'L', +41176=>'L', +41177=>'L', +41178=>'L', +41179=>'L', +41180=>'L', +41181=>'L', +41182=>'L', +41183=>'L', +41184=>'L', +41185=>'L', +41186=>'L', +41187=>'L', +41188=>'L', +41189=>'L', +41190=>'L', +41191=>'L', +41192=>'L', +41193=>'L', +41194=>'L', +41195=>'L', +41196=>'L', +41197=>'L', +41198=>'L', +41199=>'L', +41200=>'L', +41201=>'L', +41202=>'L', +41203=>'L', +41204=>'L', +41205=>'L', +41206=>'L', +41207=>'L', +41208=>'L', +41209=>'L', +41210=>'L', +41211=>'L', +41212=>'L', +41213=>'L', +41214=>'L', +41215=>'L', +41216=>'L', +41217=>'L', +41218=>'L', +41219=>'L', +41220=>'L', +41221=>'L', +41222=>'L', +41223=>'L', +41224=>'L', +41225=>'L', +41226=>'L', +41227=>'L', +41228=>'L', +41229=>'L', +41230=>'L', +41231=>'L', +41232=>'L', +41233=>'L', +41234=>'L', +41235=>'L', +41236=>'L', +41237=>'L', +41238=>'L', +41239=>'L', +41240=>'L', +41241=>'L', +41242=>'L', +41243=>'L', +41244=>'L', +41245=>'L', +41246=>'L', +41247=>'L', +41248=>'L', +41249=>'L', +41250=>'L', +41251=>'L', +41252=>'L', +41253=>'L', +41254=>'L', +41255=>'L', +41256=>'L', +41257=>'L', +41258=>'L', +41259=>'L', +41260=>'L', +41261=>'L', +41262=>'L', +41263=>'L', +41264=>'L', +41265=>'L', +41266=>'L', +41267=>'L', +41268=>'L', +41269=>'L', +41270=>'L', +41271=>'L', +41272=>'L', +41273=>'L', +41274=>'L', +41275=>'L', +41276=>'L', +41277=>'L', +41278=>'L', +41279=>'L', +41280=>'L', +41281=>'L', +41282=>'L', +41283=>'L', +41284=>'L', +41285=>'L', +41286=>'L', +41287=>'L', +41288=>'L', +41289=>'L', +41290=>'L', +41291=>'L', +41292=>'L', +41293=>'L', +41294=>'L', +41295=>'L', +41296=>'L', +41297=>'L', +41298=>'L', +41299=>'L', +41300=>'L', +41301=>'L', +41302=>'L', +41303=>'L', +41304=>'L', +41305=>'L', +41306=>'L', +41307=>'L', +41308=>'L', +41309=>'L', +41310=>'L', +41311=>'L', +41312=>'L', +41313=>'L', +41314=>'L', +41315=>'L', +41316=>'L', +41317=>'L', +41318=>'L', +41319=>'L', +41320=>'L', +41321=>'L', +41322=>'L', +41323=>'L', +41324=>'L', +41325=>'L', +41326=>'L', +41327=>'L', +41328=>'L', +41329=>'L', +41330=>'L', +41331=>'L', +41332=>'L', +41333=>'L', +41334=>'L', +41335=>'L', +41336=>'L', +41337=>'L', +41338=>'L', +41339=>'L', +41340=>'L', +41341=>'L', +41342=>'L', +41343=>'L', +41344=>'L', +41345=>'L', +41346=>'L', +41347=>'L', +41348=>'L', +41349=>'L', +41350=>'L', +41351=>'L', +41352=>'L', +41353=>'L', +41354=>'L', +41355=>'L', +41356=>'L', +41357=>'L', +41358=>'L', +41359=>'L', +41360=>'L', +41361=>'L', +41362=>'L', +41363=>'L', +41364=>'L', +41365=>'L', +41366=>'L', +41367=>'L', +41368=>'L', +41369=>'L', +41370=>'L', +41371=>'L', +41372=>'L', +41373=>'L', +41374=>'L', +41375=>'L', +41376=>'L', +41377=>'L', +41378=>'L', +41379=>'L', +41380=>'L', +41381=>'L', +41382=>'L', +41383=>'L', +41384=>'L', +41385=>'L', +41386=>'L', +41387=>'L', +41388=>'L', +41389=>'L', +41390=>'L', +41391=>'L', +41392=>'L', +41393=>'L', +41394=>'L', +41395=>'L', +41396=>'L', +41397=>'L', +41398=>'L', +41399=>'L', +41400=>'L', +41401=>'L', +41402=>'L', +41403=>'L', +41404=>'L', +41405=>'L', +41406=>'L', +41407=>'L', +41408=>'L', +41409=>'L', +41410=>'L', +41411=>'L', +41412=>'L', +41413=>'L', +41414=>'L', +41415=>'L', +41416=>'L', +41417=>'L', +41418=>'L', +41419=>'L', +41420=>'L', +41421=>'L', +41422=>'L', +41423=>'L', +41424=>'L', +41425=>'L', +41426=>'L', +41427=>'L', +41428=>'L', +41429=>'L', +41430=>'L', +41431=>'L', +41432=>'L', +41433=>'L', +41434=>'L', +41435=>'L', +41436=>'L', +41437=>'L', +41438=>'L', +41439=>'L', +41440=>'L', +41441=>'L', +41442=>'L', +41443=>'L', +41444=>'L', +41445=>'L', +41446=>'L', +41447=>'L', +41448=>'L', +41449=>'L', +41450=>'L', +41451=>'L', +41452=>'L', +41453=>'L', +41454=>'L', +41455=>'L', +41456=>'L', +41457=>'L', +41458=>'L', +41459=>'L', +41460=>'L', +41461=>'L', +41462=>'L', +41463=>'L', +41464=>'L', +41465=>'L', +41466=>'L', +41467=>'L', +41468=>'L', +41469=>'L', +41470=>'L', +41471=>'L', +41472=>'L', +41473=>'L', +41474=>'L', +41475=>'L', +41476=>'L', +41477=>'L', +41478=>'L', +41479=>'L', +41480=>'L', +41481=>'L', +41482=>'L', +41483=>'L', +41484=>'L', +41485=>'L', +41486=>'L', +41487=>'L', +41488=>'L', +41489=>'L', +41490=>'L', +41491=>'L', +41492=>'L', +41493=>'L', +41494=>'L', +41495=>'L', +41496=>'L', +41497=>'L', +41498=>'L', +41499=>'L', +41500=>'L', +41501=>'L', +41502=>'L', +41503=>'L', +41504=>'L', +41505=>'L', +41506=>'L', +41507=>'L', +41508=>'L', +41509=>'L', +41510=>'L', +41511=>'L', +41512=>'L', +41513=>'L', +41514=>'L', +41515=>'L', +41516=>'L', +41517=>'L', +41518=>'L', +41519=>'L', +41520=>'L', +41521=>'L', +41522=>'L', +41523=>'L', +41524=>'L', +41525=>'L', +41526=>'L', +41527=>'L', +41528=>'L', +41529=>'L', +41530=>'L', +41531=>'L', +41532=>'L', +41533=>'L', +41534=>'L', +41535=>'L', +41536=>'L', +41537=>'L', +41538=>'L', +41539=>'L', +41540=>'L', +41541=>'L', +41542=>'L', +41543=>'L', +41544=>'L', +41545=>'L', +41546=>'L', +41547=>'L', +41548=>'L', +41549=>'L', +41550=>'L', +41551=>'L', +41552=>'L', +41553=>'L', +41554=>'L', +41555=>'L', +41556=>'L', +41557=>'L', +41558=>'L', +41559=>'L', +41560=>'L', +41561=>'L', +41562=>'L', +41563=>'L', +41564=>'L', +41565=>'L', +41566=>'L', +41567=>'L', +41568=>'L', +41569=>'L', +41570=>'L', +41571=>'L', +41572=>'L', +41573=>'L', +41574=>'L', +41575=>'L', +41576=>'L', +41577=>'L', +41578=>'L', +41579=>'L', +41580=>'L', +41581=>'L', +41582=>'L', +41583=>'L', +41584=>'L', +41585=>'L', +41586=>'L', +41587=>'L', +41588=>'L', +41589=>'L', +41590=>'L', +41591=>'L', +41592=>'L', +41593=>'L', +41594=>'L', +41595=>'L', +41596=>'L', +41597=>'L', +41598=>'L', +41599=>'L', +41600=>'L', +41601=>'L', +41602=>'L', +41603=>'L', +41604=>'L', +41605=>'L', +41606=>'L', +41607=>'L', +41608=>'L', +41609=>'L', +41610=>'L', +41611=>'L', +41612=>'L', +41613=>'L', +41614=>'L', +41615=>'L', +41616=>'L', +41617=>'L', +41618=>'L', +41619=>'L', +41620=>'L', +41621=>'L', +41622=>'L', +41623=>'L', +41624=>'L', +41625=>'L', +41626=>'L', +41627=>'L', +41628=>'L', +41629=>'L', +41630=>'L', +41631=>'L', +41632=>'L', +41633=>'L', +41634=>'L', +41635=>'L', +41636=>'L', +41637=>'L', +41638=>'L', +41639=>'L', +41640=>'L', +41641=>'L', +41642=>'L', +41643=>'L', +41644=>'L', +41645=>'L', +41646=>'L', +41647=>'L', +41648=>'L', +41649=>'L', +41650=>'L', +41651=>'L', +41652=>'L', +41653=>'L', +41654=>'L', +41655=>'L', +41656=>'L', +41657=>'L', +41658=>'L', +41659=>'L', +41660=>'L', +41661=>'L', +41662=>'L', +41663=>'L', +41664=>'L', +41665=>'L', +41666=>'L', +41667=>'L', +41668=>'L', +41669=>'L', +41670=>'L', +41671=>'L', +41672=>'L', +41673=>'L', +41674=>'L', +41675=>'L', +41676=>'L', +41677=>'L', +41678=>'L', +41679=>'L', +41680=>'L', +41681=>'L', +41682=>'L', +41683=>'L', +41684=>'L', +41685=>'L', +41686=>'L', +41687=>'L', +41688=>'L', +41689=>'L', +41690=>'L', +41691=>'L', +41692=>'L', +41693=>'L', +41694=>'L', +41695=>'L', +41696=>'L', +41697=>'L', +41698=>'L', +41699=>'L', +41700=>'L', +41701=>'L', +41702=>'L', +41703=>'L', +41704=>'L', +41705=>'L', +41706=>'L', +41707=>'L', +41708=>'L', +41709=>'L', +41710=>'L', +41711=>'L', +41712=>'L', +41713=>'L', +41714=>'L', +41715=>'L', +41716=>'L', +41717=>'L', +41718=>'L', +41719=>'L', +41720=>'L', +41721=>'L', +41722=>'L', +41723=>'L', +41724=>'L', +41725=>'L', +41726=>'L', +41727=>'L', +41728=>'L', +41729=>'L', +41730=>'L', +41731=>'L', +41732=>'L', +41733=>'L', +41734=>'L', +41735=>'L', +41736=>'L', +41737=>'L', +41738=>'L', +41739=>'L', +41740=>'L', +41741=>'L', +41742=>'L', +41743=>'L', +41744=>'L', +41745=>'L', +41746=>'L', +41747=>'L', +41748=>'L', +41749=>'L', +41750=>'L', +41751=>'L', +41752=>'L', +41753=>'L', +41754=>'L', +41755=>'L', +41756=>'L', +41757=>'L', +41758=>'L', +41759=>'L', +41760=>'L', +41761=>'L', +41762=>'L', +41763=>'L', +41764=>'L', +41765=>'L', +41766=>'L', +41767=>'L', +41768=>'L', +41769=>'L', +41770=>'L', +41771=>'L', +41772=>'L', +41773=>'L', +41774=>'L', +41775=>'L', +41776=>'L', +41777=>'L', +41778=>'L', +41779=>'L', +41780=>'L', +41781=>'L', +41782=>'L', +41783=>'L', +41784=>'L', +41785=>'L', +41786=>'L', +41787=>'L', +41788=>'L', +41789=>'L', +41790=>'L', +41791=>'L', +41792=>'L', +41793=>'L', +41794=>'L', +41795=>'L', +41796=>'L', +41797=>'L', +41798=>'L', +41799=>'L', +41800=>'L', +41801=>'L', +41802=>'L', +41803=>'L', +41804=>'L', +41805=>'L', +41806=>'L', +41807=>'L', +41808=>'L', +41809=>'L', +41810=>'L', +41811=>'L', +41812=>'L', +41813=>'L', +41814=>'L', +41815=>'L', +41816=>'L', +41817=>'L', +41818=>'L', +41819=>'L', +41820=>'L', +41821=>'L', +41822=>'L', +41823=>'L', +41824=>'L', +41825=>'L', +41826=>'L', +41827=>'L', +41828=>'L', +41829=>'L', +41830=>'L', +41831=>'L', +41832=>'L', +41833=>'L', +41834=>'L', +41835=>'L', +41836=>'L', +41837=>'L', +41838=>'L', +41839=>'L', +41840=>'L', +41841=>'L', +41842=>'L', +41843=>'L', +41844=>'L', +41845=>'L', +41846=>'L', +41847=>'L', +41848=>'L', +41849=>'L', +41850=>'L', +41851=>'L', +41852=>'L', +41853=>'L', +41854=>'L', +41855=>'L', +41856=>'L', +41857=>'L', +41858=>'L', +41859=>'L', +41860=>'L', +41861=>'L', +41862=>'L', +41863=>'L', +41864=>'L', +41865=>'L', +41866=>'L', +41867=>'L', +41868=>'L', +41869=>'L', +41870=>'L', +41871=>'L', +41872=>'L', +41873=>'L', +41874=>'L', +41875=>'L', +41876=>'L', +41877=>'L', +41878=>'L', +41879=>'L', +41880=>'L', +41881=>'L', +41882=>'L', +41883=>'L', +41884=>'L', +41885=>'L', +41886=>'L', +41887=>'L', +41888=>'L', +41889=>'L', +41890=>'L', +41891=>'L', +41892=>'L', +41893=>'L', +41894=>'L', +41895=>'L', +41896=>'L', +41897=>'L', +41898=>'L', +41899=>'L', +41900=>'L', +41901=>'L', +41902=>'L', +41903=>'L', +41904=>'L', +41905=>'L', +41906=>'L', +41907=>'L', +41908=>'L', +41909=>'L', +41910=>'L', +41911=>'L', +41912=>'L', +41913=>'L', +41914=>'L', +41915=>'L', +41916=>'L', +41917=>'L', +41918=>'L', +41919=>'L', +41920=>'L', +41921=>'L', +41922=>'L', +41923=>'L', +41924=>'L', +41925=>'L', +41926=>'L', +41927=>'L', +41928=>'L', +41929=>'L', +41930=>'L', +41931=>'L', +41932=>'L', +41933=>'L', +41934=>'L', +41935=>'L', +41936=>'L', +41937=>'L', +41938=>'L', +41939=>'L', +41940=>'L', +41941=>'L', +41942=>'L', +41943=>'L', +41944=>'L', +41945=>'L', +41946=>'L', +41947=>'L', +41948=>'L', +41949=>'L', +41950=>'L', +41951=>'L', +41952=>'L', +41953=>'L', +41954=>'L', +41955=>'L', +41956=>'L', +41957=>'L', +41958=>'L', +41959=>'L', +41960=>'L', +41961=>'L', +41962=>'L', +41963=>'L', +41964=>'L', +41965=>'L', +41966=>'L', +41967=>'L', +41968=>'L', +41969=>'L', +41970=>'L', +41971=>'L', +41972=>'L', +41973=>'L', +41974=>'L', +41975=>'L', +41976=>'L', +41977=>'L', +41978=>'L', +41979=>'L', +41980=>'L', +41981=>'L', +41982=>'L', +41983=>'L', +41984=>'L', +41985=>'L', +41986=>'L', +41987=>'L', +41988=>'L', +41989=>'L', +41990=>'L', +41991=>'L', +41992=>'L', +41993=>'L', +41994=>'L', +41995=>'L', +41996=>'L', +41997=>'L', +41998=>'L', +41999=>'L', +42000=>'L', +42001=>'L', +42002=>'L', +42003=>'L', +42004=>'L', +42005=>'L', +42006=>'L', +42007=>'L', +42008=>'L', +42009=>'L', +42010=>'L', +42011=>'L', +42012=>'L', +42013=>'L', +42014=>'L', +42015=>'L', +42016=>'L', +42017=>'L', +42018=>'L', +42019=>'L', +42020=>'L', +42021=>'L', +42022=>'L', +42023=>'L', +42024=>'L', +42025=>'L', +42026=>'L', +42027=>'L', +42028=>'L', +42029=>'L', +42030=>'L', +42031=>'L', +42032=>'L', +42033=>'L', +42034=>'L', +42035=>'L', +42036=>'L', +42037=>'L', +42038=>'L', +42039=>'L', +42040=>'L', +42041=>'L', +42042=>'L', +42043=>'L', +42044=>'L', +42045=>'L', +42046=>'L', +42047=>'L', +42048=>'L', +42049=>'L', +42050=>'L', +42051=>'L', +42052=>'L', +42053=>'L', +42054=>'L', +42055=>'L', +42056=>'L', +42057=>'L', +42058=>'L', +42059=>'L', +42060=>'L', +42061=>'L', +42062=>'L', +42063=>'L', +42064=>'L', +42065=>'L', +42066=>'L', +42067=>'L', +42068=>'L', +42069=>'L', +42070=>'L', +42071=>'L', +42072=>'L', +42073=>'L', +42074=>'L', +42075=>'L', +42076=>'L', +42077=>'L', +42078=>'L', +42079=>'L', +42080=>'L', +42081=>'L', +42082=>'L', +42083=>'L', +42084=>'L', +42085=>'L', +42086=>'L', +42087=>'L', +42088=>'L', +42089=>'L', +42090=>'L', +42091=>'L', +42092=>'L', +42093=>'L', +42094=>'L', +42095=>'L', +42096=>'L', +42097=>'L', +42098=>'L', +42099=>'L', +42100=>'L', +42101=>'L', +42102=>'L', +42103=>'L', +42104=>'L', +42105=>'L', +42106=>'L', +42107=>'L', +42108=>'L', +42109=>'L', +42110=>'L', +42111=>'L', +42112=>'L', +42113=>'L', +42114=>'L', +42115=>'L', +42116=>'L', +42117=>'L', +42118=>'L', +42119=>'L', +42120=>'L', +42121=>'L', +42122=>'L', +42123=>'L', +42124=>'L', +42128=>'ON', +42129=>'ON', +42130=>'ON', +42131=>'ON', +42132=>'ON', +42133=>'ON', +42134=>'ON', +42135=>'ON', +42136=>'ON', +42137=>'ON', +42138=>'ON', +42139=>'ON', +42140=>'ON', +42141=>'ON', +42142=>'ON', +42143=>'ON', +42144=>'ON', +42145=>'ON', +42146=>'ON', +42147=>'ON', +42148=>'ON', +42149=>'ON', +42150=>'ON', +42151=>'ON', +42152=>'ON', +42153=>'ON', +42154=>'ON', +42155=>'ON', +42156=>'ON', +42157=>'ON', +42158=>'ON', +42159=>'ON', +42160=>'ON', +42161=>'ON', +42162=>'ON', +42163=>'ON', +42164=>'ON', +42165=>'ON', +42166=>'ON', +42167=>'ON', +42168=>'ON', +42169=>'ON', +42170=>'ON', +42171=>'ON', +42172=>'ON', +42173=>'ON', +42174=>'ON', +42175=>'ON', +42176=>'ON', +42177=>'ON', +42178=>'ON', +42179=>'ON', +42180=>'ON', +42181=>'ON', +42182=>'ON', +42752=>'ON', +42753=>'ON', +42754=>'ON', +42755=>'ON', +42756=>'ON', +42757=>'ON', +42758=>'ON', +42759=>'ON', +42760=>'ON', +42761=>'ON', +42762=>'ON', +42763=>'ON', +42764=>'ON', +42765=>'ON', +42766=>'ON', +42767=>'ON', +42768=>'ON', +42769=>'ON', +42770=>'ON', +42771=>'ON', +42772=>'ON', +42773=>'ON', +42774=>'ON', +42775=>'ON', +42776=>'ON', +42777=>'ON', +42778=>'ON', +42784=>'ON', +42785=>'ON', +43008=>'L', +43009=>'L', +43010=>'NSM', +43011=>'L', +43012=>'L', +43013=>'L', +43014=>'NSM', +43015=>'L', +43016=>'L', +43017=>'L', +43018=>'L', +43019=>'NSM', +43020=>'L', +43021=>'L', +43022=>'L', +43023=>'L', +43024=>'L', +43025=>'L', +43026=>'L', +43027=>'L', +43028=>'L', +43029=>'L', +43030=>'L', +43031=>'L', +43032=>'L', +43033=>'L', +43034=>'L', +43035=>'L', +43036=>'L', +43037=>'L', +43038=>'L', +43039=>'L', +43040=>'L', +43041=>'L', +43042=>'L', +43043=>'L', +43044=>'L', +43045=>'NSM', +43046=>'NSM', +43047=>'L', +43048=>'ON', +43049=>'ON', +43050=>'ON', +43051=>'ON', +43072=>'L', +43073=>'L', +43074=>'L', +43075=>'L', +43076=>'L', +43077=>'L', +43078=>'L', +43079=>'L', +43080=>'L', +43081=>'L', +43082=>'L', +43083=>'L', +43084=>'L', +43085=>'L', +43086=>'L', +43087=>'L', +43088=>'L', +43089=>'L', +43090=>'L', +43091=>'L', +43092=>'L', +43093=>'L', +43094=>'L', +43095=>'L', +43096=>'L', +43097=>'L', +43098=>'L', +43099=>'L', +43100=>'L', +43101=>'L', +43102=>'L', +43103=>'L', +43104=>'L', +43105=>'L', +43106=>'L', +43107=>'L', +43108=>'L', +43109=>'L', +43110=>'L', +43111=>'L', +43112=>'L', +43113=>'L', +43114=>'L', +43115=>'L', +43116=>'L', +43117=>'L', +43118=>'L', +43119=>'L', +43120=>'L', +43121=>'L', +43122=>'L', +43123=>'L', +43124=>'ON', +43125=>'ON', +43126=>'ON', +43127=>'ON', +44032=>'L', +55203=>'L', +55296=>'L', +56191=>'L', +56192=>'L', +56319=>'L', +56320=>'L', +57343=>'L', +57344=>'L', +63743=>'L', +63744=>'L', +63745=>'L', +63746=>'L', +63747=>'L', +63748=>'L', +63749=>'L', +63750=>'L', +63751=>'L', +63752=>'L', +63753=>'L', +63754=>'L', +63755=>'L', +63756=>'L', +63757=>'L', +63758=>'L', +63759=>'L', +63760=>'L', +63761=>'L', +63762=>'L', +63763=>'L', +63764=>'L', +63765=>'L', +63766=>'L', +63767=>'L', +63768=>'L', +63769=>'L', +63770=>'L', +63771=>'L', +63772=>'L', +63773=>'L', +63774=>'L', +63775=>'L', +63776=>'L', +63777=>'L', +63778=>'L', +63779=>'L', +63780=>'L', +63781=>'L', +63782=>'L', +63783=>'L', +63784=>'L', +63785=>'L', +63786=>'L', +63787=>'L', +63788=>'L', +63789=>'L', +63790=>'L', +63791=>'L', +63792=>'L', +63793=>'L', +63794=>'L', +63795=>'L', +63796=>'L', +63797=>'L', +63798=>'L', +63799=>'L', +63800=>'L', +63801=>'L', +63802=>'L', +63803=>'L', +63804=>'L', +63805=>'L', +63806=>'L', +63807=>'L', +63808=>'L', +63809=>'L', +63810=>'L', +63811=>'L', +63812=>'L', +63813=>'L', +63814=>'L', +63815=>'L', +63816=>'L', +63817=>'L', +63818=>'L', +63819=>'L', +63820=>'L', +63821=>'L', +63822=>'L', +63823=>'L', +63824=>'L', +63825=>'L', +63826=>'L', +63827=>'L', +63828=>'L', +63829=>'L', +63830=>'L', +63831=>'L', +63832=>'L', +63833=>'L', +63834=>'L', +63835=>'L', +63836=>'L', +63837=>'L', +63838=>'L', +63839=>'L', +63840=>'L', +63841=>'L', +63842=>'L', +63843=>'L', +63844=>'L', +63845=>'L', +63846=>'L', +63847=>'L', +63848=>'L', +63849=>'L', +63850=>'L', +63851=>'L', +63852=>'L', +63853=>'L', +63854=>'L', +63855=>'L', +63856=>'L', +63857=>'L', +63858=>'L', +63859=>'L', +63860=>'L', +63861=>'L', +63862=>'L', +63863=>'L', +63864=>'L', +63865=>'L', +63866=>'L', +63867=>'L', +63868=>'L', +63869=>'L', +63870=>'L', +63871=>'L', +63872=>'L', +63873=>'L', +63874=>'L', +63875=>'L', +63876=>'L', +63877=>'L', +63878=>'L', +63879=>'L', +63880=>'L', +63881=>'L', +63882=>'L', +63883=>'L', +63884=>'L', +63885=>'L', +63886=>'L', +63887=>'L', +63888=>'L', +63889=>'L', +63890=>'L', +63891=>'L', +63892=>'L', +63893=>'L', +63894=>'L', +63895=>'L', +63896=>'L', +63897=>'L', +63898=>'L', +63899=>'L', +63900=>'L', +63901=>'L', +63902=>'L', +63903=>'L', +63904=>'L', +63905=>'L', +63906=>'L', +63907=>'L', +63908=>'L', +63909=>'L', +63910=>'L', +63911=>'L', +63912=>'L', +63913=>'L', +63914=>'L', +63915=>'L', +63916=>'L', +63917=>'L', +63918=>'L', +63919=>'L', +63920=>'L', +63921=>'L', +63922=>'L', +63923=>'L', +63924=>'L', +63925=>'L', +63926=>'L', +63927=>'L', +63928=>'L', +63929=>'L', +63930=>'L', +63931=>'L', +63932=>'L', +63933=>'L', +63934=>'L', +63935=>'L', +63936=>'L', +63937=>'L', +63938=>'L', +63939=>'L', +63940=>'L', +63941=>'L', +63942=>'L', +63943=>'L', +63944=>'L', +63945=>'L', +63946=>'L', +63947=>'L', +63948=>'L', +63949=>'L', +63950=>'L', +63951=>'L', +63952=>'L', +63953=>'L', +63954=>'L', +63955=>'L', +63956=>'L', +63957=>'L', +63958=>'L', +63959=>'L', +63960=>'L', +63961=>'L', +63962=>'L', +63963=>'L', +63964=>'L', +63965=>'L', +63966=>'L', +63967=>'L', +63968=>'L', +63969=>'L', +63970=>'L', +63971=>'L', +63972=>'L', +63973=>'L', +63974=>'L', +63975=>'L', +63976=>'L', +63977=>'L', +63978=>'L', +63979=>'L', +63980=>'L', +63981=>'L', +63982=>'L', +63983=>'L', +63984=>'L', +63985=>'L', +63986=>'L', +63987=>'L', +63988=>'L', +63989=>'L', +63990=>'L', +63991=>'L', +63992=>'L', +63993=>'L', +63994=>'L', +63995=>'L', +63996=>'L', +63997=>'L', +63998=>'L', +63999=>'L', +64000=>'L', +64001=>'L', +64002=>'L', +64003=>'L', +64004=>'L', +64005=>'L', +64006=>'L', +64007=>'L', +64008=>'L', +64009=>'L', +64010=>'L', +64011=>'L', +64012=>'L', +64013=>'L', +64014=>'L', +64015=>'L', +64016=>'L', +64017=>'L', +64018=>'L', +64019=>'L', +64020=>'L', +64021=>'L', +64022=>'L', +64023=>'L', +64024=>'L', +64025=>'L', +64026=>'L', +64027=>'L', +64028=>'L', +64029=>'L', +64030=>'L', +64031=>'L', +64032=>'L', +64033=>'L', +64034=>'L', +64035=>'L', +64036=>'L', +64037=>'L', +64038=>'L', +64039=>'L', +64040=>'L', +64041=>'L', +64042=>'L', +64043=>'L', +64044=>'L', +64045=>'L', +64048=>'L', +64049=>'L', +64050=>'L', +64051=>'L', +64052=>'L', +64053=>'L', +64054=>'L', +64055=>'L', +64056=>'L', +64057=>'L', +64058=>'L', +64059=>'L', +64060=>'L', +64061=>'L', +64062=>'L', +64063=>'L', +64064=>'L', +64065=>'L', +64066=>'L', +64067=>'L', +64068=>'L', +64069=>'L', +64070=>'L', +64071=>'L', +64072=>'L', +64073=>'L', +64074=>'L', +64075=>'L', +64076=>'L', +64077=>'L', +64078=>'L', +64079=>'L', +64080=>'L', +64081=>'L', +64082=>'L', +64083=>'L', +64084=>'L', +64085=>'L', +64086=>'L', +64087=>'L', +64088=>'L', +64089=>'L', +64090=>'L', +64091=>'L', +64092=>'L', +64093=>'L', +64094=>'L', +64095=>'L', +64096=>'L', +64097=>'L', +64098=>'L', +64099=>'L', +64100=>'L', +64101=>'L', +64102=>'L', +64103=>'L', +64104=>'L', +64105=>'L', +64106=>'L', +64112=>'L', +64113=>'L', +64114=>'L', +64115=>'L', +64116=>'L', +64117=>'L', +64118=>'L', +64119=>'L', +64120=>'L', +64121=>'L', +64122=>'L', +64123=>'L', +64124=>'L', +64125=>'L', +64126=>'L', +64127=>'L', +64128=>'L', +64129=>'L', +64130=>'L', +64131=>'L', +64132=>'L', +64133=>'L', +64134=>'L', +64135=>'L', +64136=>'L', +64137=>'L', +64138=>'L', +64139=>'L', +64140=>'L', +64141=>'L', +64142=>'L', +64143=>'L', +64144=>'L', +64145=>'L', +64146=>'L', +64147=>'L', +64148=>'L', +64149=>'L', +64150=>'L', +64151=>'L', +64152=>'L', +64153=>'L', +64154=>'L', +64155=>'L', +64156=>'L', +64157=>'L', +64158=>'L', +64159=>'L', +64160=>'L', +64161=>'L', +64162=>'L', +64163=>'L', +64164=>'L', +64165=>'L', +64166=>'L', +64167=>'L', +64168=>'L', +64169=>'L', +64170=>'L', +64171=>'L', +64172=>'L', +64173=>'L', +64174=>'L', +64175=>'L', +64176=>'L', +64177=>'L', +64178=>'L', +64179=>'L', +64180=>'L', +64181=>'L', +64182=>'L', +64183=>'L', +64184=>'L', +64185=>'L', +64186=>'L', +64187=>'L', +64188=>'L', +64189=>'L', +64190=>'L', +64191=>'L', +64192=>'L', +64193=>'L', +64194=>'L', +64195=>'L', +64196=>'L', +64197=>'L', +64198=>'L', +64199=>'L', +64200=>'L', +64201=>'L', +64202=>'L', +64203=>'L', +64204=>'L', +64205=>'L', +64206=>'L', +64207=>'L', +64208=>'L', +64209=>'L', +64210=>'L', +64211=>'L', +64212=>'L', +64213=>'L', +64214=>'L', +64215=>'L', +64216=>'L', +64217=>'L', +64256=>'L', +64257=>'L', +64258=>'L', +64259=>'L', +64260=>'L', +64261=>'L', +64262=>'L', +64275=>'L', +64276=>'L', +64277=>'L', +64278=>'L', +64279=>'L', +64285=>'R', +64286=>'NSM', +64287=>'R', +64288=>'R', +64289=>'R', +64290=>'R', +64291=>'R', +64292=>'R', +64293=>'R', +64294=>'R', +64295=>'R', +64296=>'R', +64297=>'ES', +64298=>'R', +64299=>'R', +64300=>'R', +64301=>'R', +64302=>'R', +64303=>'R', +64304=>'R', +64305=>'R', +64306=>'R', +64307=>'R', +64308=>'R', +64309=>'R', +64310=>'R', +64312=>'R', +64313=>'R', +64314=>'R', +64315=>'R', +64316=>'R', +64318=>'R', +64320=>'R', +64321=>'R', +64323=>'R', +64324=>'R', +64326=>'R', +64327=>'R', +64328=>'R', +64329=>'R', +64330=>'R', +64331=>'R', +64332=>'R', +64333=>'R', +64334=>'R', +64335=>'R', +64336=>'AL', +64337=>'AL', +64338=>'AL', +64339=>'AL', +64340=>'AL', +64341=>'AL', +64342=>'AL', +64343=>'AL', +64344=>'AL', +64345=>'AL', +64346=>'AL', +64347=>'AL', +64348=>'AL', +64349=>'AL', +64350=>'AL', +64351=>'AL', +64352=>'AL', +64353=>'AL', +64354=>'AL', +64355=>'AL', +64356=>'AL', +64357=>'AL', +64358=>'AL', +64359=>'AL', +64360=>'AL', +64361=>'AL', +64362=>'AL', +64363=>'AL', +64364=>'AL', +64365=>'AL', +64366=>'AL', +64367=>'AL', +64368=>'AL', +64369=>'AL', +64370=>'AL', +64371=>'AL', +64372=>'AL', +64373=>'AL', +64374=>'AL', +64375=>'AL', +64376=>'AL', +64377=>'AL', +64378=>'AL', +64379=>'AL', +64380=>'AL', +64381=>'AL', +64382=>'AL', +64383=>'AL', +64384=>'AL', +64385=>'AL', +64386=>'AL', +64387=>'AL', +64388=>'AL', +64389=>'AL', +64390=>'AL', +64391=>'AL', +64392=>'AL', +64393=>'AL', +64394=>'AL', +64395=>'AL', +64396=>'AL', +64397=>'AL', +64398=>'AL', +64399=>'AL', +64400=>'AL', +64401=>'AL', +64402=>'AL', +64403=>'AL', +64404=>'AL', +64405=>'AL', +64406=>'AL', +64407=>'AL', +64408=>'AL', +64409=>'AL', +64410=>'AL', +64411=>'AL', +64412=>'AL', +64413=>'AL', +64414=>'AL', +64415=>'AL', +64416=>'AL', +64417=>'AL', +64418=>'AL', +64419=>'AL', +64420=>'AL', +64421=>'AL', +64422=>'AL', +64423=>'AL', +64424=>'AL', +64425=>'AL', +64426=>'AL', +64427=>'AL', +64428=>'AL', +64429=>'AL', +64430=>'AL', +64431=>'AL', +64432=>'AL', +64433=>'AL', +64467=>'AL', +64468=>'AL', +64469=>'AL', +64470=>'AL', +64471=>'AL', +64472=>'AL', +64473=>'AL', +64474=>'AL', +64475=>'AL', +64476=>'AL', +64477=>'AL', +64478=>'AL', +64479=>'AL', +64480=>'AL', +64481=>'AL', +64482=>'AL', +64483=>'AL', +64484=>'AL', +64485=>'AL', +64486=>'AL', +64487=>'AL', +64488=>'AL', +64489=>'AL', +64490=>'AL', +64491=>'AL', +64492=>'AL', +64493=>'AL', +64494=>'AL', +64495=>'AL', +64496=>'AL', +64497=>'AL', +64498=>'AL', +64499=>'AL', +64500=>'AL', +64501=>'AL', +64502=>'AL', +64503=>'AL', +64504=>'AL', +64505=>'AL', +64506=>'AL', +64507=>'AL', +64508=>'AL', +64509=>'AL', +64510=>'AL', +64511=>'AL', +64512=>'AL', +64513=>'AL', +64514=>'AL', +64515=>'AL', +64516=>'AL', +64517=>'AL', +64518=>'AL', +64519=>'AL', +64520=>'AL', +64521=>'AL', +64522=>'AL', +64523=>'AL', +64524=>'AL', +64525=>'AL', +64526=>'AL', +64527=>'AL', +64528=>'AL', +64529=>'AL', +64530=>'AL', +64531=>'AL', +64532=>'AL', +64533=>'AL', +64534=>'AL', +64535=>'AL', +64536=>'AL', +64537=>'AL', +64538=>'AL', +64539=>'AL', +64540=>'AL', +64541=>'AL', +64542=>'AL', +64543=>'AL', +64544=>'AL', +64545=>'AL', +64546=>'AL', +64547=>'AL', +64548=>'AL', +64549=>'AL', +64550=>'AL', +64551=>'AL', +64552=>'AL', +64553=>'AL', +64554=>'AL', +64555=>'AL', +64556=>'AL', +64557=>'AL', +64558=>'AL', +64559=>'AL', +64560=>'AL', +64561=>'AL', +64562=>'AL', +64563=>'AL', +64564=>'AL', +64565=>'AL', +64566=>'AL', +64567=>'AL', +64568=>'AL', +64569=>'AL', +64570=>'AL', +64571=>'AL', +64572=>'AL', +64573=>'AL', +64574=>'AL', +64575=>'AL', +64576=>'AL', +64577=>'AL', +64578=>'AL', +64579=>'AL', +64580=>'AL', +64581=>'AL', +64582=>'AL', +64583=>'AL', +64584=>'AL', +64585=>'AL', +64586=>'AL', +64587=>'AL', +64588=>'AL', +64589=>'AL', +64590=>'AL', +64591=>'AL', +64592=>'AL', +64593=>'AL', +64594=>'AL', +64595=>'AL', +64596=>'AL', +64597=>'AL', +64598=>'AL', +64599=>'AL', +64600=>'AL', +64601=>'AL', +64602=>'AL', +64603=>'AL', +64604=>'AL', +64605=>'AL', +64606=>'AL', +64607=>'AL', +64608=>'AL', +64609=>'AL', +64610=>'AL', +64611=>'AL', +64612=>'AL', +64613=>'AL', +64614=>'AL', +64615=>'AL', +64616=>'AL', +64617=>'AL', +64618=>'AL', +64619=>'AL', +64620=>'AL', +64621=>'AL', +64622=>'AL', +64623=>'AL', +64624=>'AL', +64625=>'AL', +64626=>'AL', +64627=>'AL', +64628=>'AL', +64629=>'AL', +64630=>'AL', +64631=>'AL', +64632=>'AL', +64633=>'AL', +64634=>'AL', +64635=>'AL', +64636=>'AL', +64637=>'AL', +64638=>'AL', +64639=>'AL', +64640=>'AL', +64641=>'AL', +64642=>'AL', +64643=>'AL', +64644=>'AL', +64645=>'AL', +64646=>'AL', +64647=>'AL', +64648=>'AL', +64649=>'AL', +64650=>'AL', +64651=>'AL', +64652=>'AL', +64653=>'AL', +64654=>'AL', +64655=>'AL', +64656=>'AL', +64657=>'AL', +64658=>'AL', +64659=>'AL', +64660=>'AL', +64661=>'AL', +64662=>'AL', +64663=>'AL', +64664=>'AL', +64665=>'AL', +64666=>'AL', +64667=>'AL', +64668=>'AL', +64669=>'AL', +64670=>'AL', +64671=>'AL', +64672=>'AL', +64673=>'AL', +64674=>'AL', +64675=>'AL', +64676=>'AL', +64677=>'AL', +64678=>'AL', +64679=>'AL', +64680=>'AL', +64681=>'AL', +64682=>'AL', +64683=>'AL', +64684=>'AL', +64685=>'AL', +64686=>'AL', +64687=>'AL', +64688=>'AL', +64689=>'AL', +64690=>'AL', +64691=>'AL', +64692=>'AL', +64693=>'AL', +64694=>'AL', +64695=>'AL', +64696=>'AL', +64697=>'AL', +64698=>'AL', +64699=>'AL', +64700=>'AL', +64701=>'AL', +64702=>'AL', +64703=>'AL', +64704=>'AL', +64705=>'AL', +64706=>'AL', +64707=>'AL', +64708=>'AL', +64709=>'AL', +64710=>'AL', +64711=>'AL', +64712=>'AL', +64713=>'AL', +64714=>'AL', +64715=>'AL', +64716=>'AL', +64717=>'AL', +64718=>'AL', +64719=>'AL', +64720=>'AL', +64721=>'AL', +64722=>'AL', +64723=>'AL', +64724=>'AL', +64725=>'AL', +64726=>'AL', +64727=>'AL', +64728=>'AL', +64729=>'AL', +64730=>'AL', +64731=>'AL', +64732=>'AL', +64733=>'AL', +64734=>'AL', +64735=>'AL', +64736=>'AL', +64737=>'AL', +64738=>'AL', +64739=>'AL', +64740=>'AL', +64741=>'AL', +64742=>'AL', +64743=>'AL', +64744=>'AL', +64745=>'AL', +64746=>'AL', +64747=>'AL', +64748=>'AL', +64749=>'AL', +64750=>'AL', +64751=>'AL', +64752=>'AL', +64753=>'AL', +64754=>'AL', +64755=>'AL', +64756=>'AL', +64757=>'AL', +64758=>'AL', +64759=>'AL', +64760=>'AL', +64761=>'AL', +64762=>'AL', +64763=>'AL', +64764=>'AL', +64765=>'AL', +64766=>'AL', +64767=>'AL', +64768=>'AL', +64769=>'AL', +64770=>'AL', +64771=>'AL', +64772=>'AL', +64773=>'AL', +64774=>'AL', +64775=>'AL', +64776=>'AL', +64777=>'AL', +64778=>'AL', +64779=>'AL', +64780=>'AL', +64781=>'AL', +64782=>'AL', +64783=>'AL', +64784=>'AL', +64785=>'AL', +64786=>'AL', +64787=>'AL', +64788=>'AL', +64789=>'AL', +64790=>'AL', +64791=>'AL', +64792=>'AL', +64793=>'AL', +64794=>'AL', +64795=>'AL', +64796=>'AL', +64797=>'AL', +64798=>'AL', +64799=>'AL', +64800=>'AL', +64801=>'AL', +64802=>'AL', +64803=>'AL', +64804=>'AL', +64805=>'AL', +64806=>'AL', +64807=>'AL', +64808=>'AL', +64809=>'AL', +64810=>'AL', +64811=>'AL', +64812=>'AL', +64813=>'AL', +64814=>'AL', +64815=>'AL', +64816=>'AL', +64817=>'AL', +64818=>'AL', +64819=>'AL', +64820=>'AL', +64821=>'AL', +64822=>'AL', +64823=>'AL', +64824=>'AL', +64825=>'AL', +64826=>'AL', +64827=>'AL', +64828=>'AL', +64829=>'AL', +64830=>'ON', +64831=>'ON', +64848=>'AL', +64849=>'AL', +64850=>'AL', +64851=>'AL', +64852=>'AL', +64853=>'AL', +64854=>'AL', +64855=>'AL', +64856=>'AL', +64857=>'AL', +64858=>'AL', +64859=>'AL', +64860=>'AL', +64861=>'AL', +64862=>'AL', +64863=>'AL', +64864=>'AL', +64865=>'AL', +64866=>'AL', +64867=>'AL', +64868=>'AL', +64869=>'AL', +64870=>'AL', +64871=>'AL', +64872=>'AL', +64873=>'AL', +64874=>'AL', +64875=>'AL', +64876=>'AL', +64877=>'AL', +64878=>'AL', +64879=>'AL', +64880=>'AL', +64881=>'AL', +64882=>'AL', +64883=>'AL', +64884=>'AL', +64885=>'AL', +64886=>'AL', +64887=>'AL', +64888=>'AL', +64889=>'AL', +64890=>'AL', +64891=>'AL', +64892=>'AL', +64893=>'AL', +64894=>'AL', +64895=>'AL', +64896=>'AL', +64897=>'AL', +64898=>'AL', +64899=>'AL', +64900=>'AL', +64901=>'AL', +64902=>'AL', +64903=>'AL', +64904=>'AL', +64905=>'AL', +64906=>'AL', +64907=>'AL', +64908=>'AL', +64909=>'AL', +64910=>'AL', +64911=>'AL', +64914=>'AL', +64915=>'AL', +64916=>'AL', +64917=>'AL', +64918=>'AL', +64919=>'AL', +64920=>'AL', +64921=>'AL', +64922=>'AL', +64923=>'AL', +64924=>'AL', +64925=>'AL', +64926=>'AL', +64927=>'AL', +64928=>'AL', +64929=>'AL', +64930=>'AL', +64931=>'AL', +64932=>'AL', +64933=>'AL', +64934=>'AL', +64935=>'AL', +64936=>'AL', +64937=>'AL', +64938=>'AL', +64939=>'AL', +64940=>'AL', +64941=>'AL', +64942=>'AL', +64943=>'AL', +64944=>'AL', +64945=>'AL', +64946=>'AL', +64947=>'AL', +64948=>'AL', +64949=>'AL', +64950=>'AL', +64951=>'AL', +64952=>'AL', +64953=>'AL', +64954=>'AL', +64955=>'AL', +64956=>'AL', +64957=>'AL', +64958=>'AL', +64959=>'AL', +64960=>'AL', +64961=>'AL', +64962=>'AL', +64963=>'AL', +64964=>'AL', +64965=>'AL', +64966=>'AL', +64967=>'AL', +65008=>'AL', +65009=>'AL', +65010=>'AL', +65011=>'AL', +65012=>'AL', +65013=>'AL', +65014=>'AL', +65015=>'AL', +65016=>'AL', +65017=>'AL', +65018=>'AL', +65019=>'AL', +65020=>'AL', +65021=>'ON', +65024=>'NSM', +65025=>'NSM', +65026=>'NSM', +65027=>'NSM', +65028=>'NSM', +65029=>'NSM', +65030=>'NSM', +65031=>'NSM', +65032=>'NSM', +65033=>'NSM', +65034=>'NSM', +65035=>'NSM', +65036=>'NSM', +65037=>'NSM', +65038=>'NSM', +65039=>'NSM', +65040=>'ON', +65041=>'ON', +65042=>'ON', +65043=>'ON', +65044=>'ON', +65045=>'ON', +65046=>'ON', +65047=>'ON', +65048=>'ON', +65049=>'ON', +65056=>'NSM', +65057=>'NSM', +65058=>'NSM', +65059=>'NSM', +65072=>'ON', +65073=>'ON', +65074=>'ON', +65075=>'ON', +65076=>'ON', +65077=>'ON', +65078=>'ON', +65079=>'ON', +65080=>'ON', +65081=>'ON', +65082=>'ON', +65083=>'ON', +65084=>'ON', +65085=>'ON', +65086=>'ON', +65087=>'ON', +65088=>'ON', +65089=>'ON', +65090=>'ON', +65091=>'ON', +65092=>'ON', +65093=>'ON', +65094=>'ON', +65095=>'ON', +65096=>'ON', +65097=>'ON', +65098=>'ON', +65099=>'ON', +65100=>'ON', +65101=>'ON', +65102=>'ON', +65103=>'ON', +65104=>'CS', +65105=>'ON', +65106=>'CS', +65108=>'ON', +65109=>'CS', +65110=>'ON', +65111=>'ON', +65112=>'ON', +65113=>'ON', +65114=>'ON', +65115=>'ON', +65116=>'ON', +65117=>'ON', +65118=>'ON', +65119=>'ET', +65120=>'ON', +65121=>'ON', +65122=>'ES', +65123=>'ES', +65124=>'ON', +65125=>'ON', +65126=>'ON', +65128=>'ON', +65129=>'ET', +65130=>'ET', +65131=>'ON', +65136=>'AL', +65137=>'AL', +65138=>'AL', +65139=>'AL', +65140=>'AL', +65142=>'AL', +65143=>'AL', +65144=>'AL', +65145=>'AL', +65146=>'AL', +65147=>'AL', +65148=>'AL', +65149=>'AL', +65150=>'AL', +65151=>'AL', +65152=>'AL', +65153=>'AL', +65154=>'AL', +65155=>'AL', +65156=>'AL', +65157=>'AL', +65158=>'AL', +65159=>'AL', +65160=>'AL', +65161=>'AL', +65162=>'AL', +65163=>'AL', +65164=>'AL', +65165=>'AL', +65166=>'AL', +65167=>'AL', +65168=>'AL', +65169=>'AL', +65170=>'AL', +65171=>'AL', +65172=>'AL', +65173=>'AL', +65174=>'AL', +65175=>'AL', +65176=>'AL', +65177=>'AL', +65178=>'AL', +65179=>'AL', +65180=>'AL', +65181=>'AL', +65182=>'AL', +65183=>'AL', +65184=>'AL', +65185=>'AL', +65186=>'AL', +65187=>'AL', +65188=>'AL', +65189=>'AL', +65190=>'AL', +65191=>'AL', +65192=>'AL', +65193=>'AL', +65194=>'AL', +65195=>'AL', +65196=>'AL', +65197=>'AL', +65198=>'AL', +65199=>'AL', +65200=>'AL', +65201=>'AL', +65202=>'AL', +65203=>'AL', +65204=>'AL', +65205=>'AL', +65206=>'AL', +65207=>'AL', +65208=>'AL', +65209=>'AL', +65210=>'AL', +65211=>'AL', +65212=>'AL', +65213=>'AL', +65214=>'AL', +65215=>'AL', +65216=>'AL', +65217=>'AL', +65218=>'AL', +65219=>'AL', +65220=>'AL', +65221=>'AL', +65222=>'AL', +65223=>'AL', +65224=>'AL', +65225=>'AL', +65226=>'AL', +65227=>'AL', +65228=>'AL', +65229=>'AL', +65230=>'AL', +65231=>'AL', +65232=>'AL', +65233=>'AL', +65234=>'AL', +65235=>'AL', +65236=>'AL', +65237=>'AL', +65238=>'AL', +65239=>'AL', +65240=>'AL', +65241=>'AL', +65242=>'AL', +65243=>'AL', +65244=>'AL', +65245=>'AL', +65246=>'AL', +65247=>'AL', +65248=>'AL', +65249=>'AL', +65250=>'AL', +65251=>'AL', +65252=>'AL', +65253=>'AL', +65254=>'AL', +65255=>'AL', +65256=>'AL', +65257=>'AL', +65258=>'AL', +65259=>'AL', +65260=>'AL', +65261=>'AL', +65262=>'AL', +65263=>'AL', +65264=>'AL', +65265=>'AL', +65266=>'AL', +65267=>'AL', +65268=>'AL', +65269=>'AL', +65270=>'AL', +65271=>'AL', +65272=>'AL', +65273=>'AL', +65274=>'AL', +65275=>'AL', +65276=>'AL', +65279=>'BN', +65281=>'ON', +65282=>'ON', +65283=>'ET', +65284=>'ET', +65285=>'ET', +65286=>'ON', +65287=>'ON', +65288=>'ON', +65289=>'ON', +65290=>'ON', +65291=>'ES', +65292=>'CS', +65293=>'ES', +65294=>'CS', +65295=>'CS', +65296=>'EN', +65297=>'EN', +65298=>'EN', +65299=>'EN', +65300=>'EN', +65301=>'EN', +65302=>'EN', +65303=>'EN', +65304=>'EN', +65305=>'EN', +65306=>'CS', +65307=>'ON', +65308=>'ON', +65309=>'ON', +65310=>'ON', +65311=>'ON', +65312=>'ON', +65313=>'L', +65314=>'L', +65315=>'L', +65316=>'L', +65317=>'L', +65318=>'L', +65319=>'L', +65320=>'L', +65321=>'L', +65322=>'L', +65323=>'L', +65324=>'L', +65325=>'L', +65326=>'L', +65327=>'L', +65328=>'L', +65329=>'L', +65330=>'L', +65331=>'L', +65332=>'L', +65333=>'L', +65334=>'L', +65335=>'L', +65336=>'L', +65337=>'L', +65338=>'L', +65339=>'ON', +65340=>'ON', +65341=>'ON', +65342=>'ON', +65343=>'ON', +65344=>'ON', +65345=>'L', +65346=>'L', +65347=>'L', +65348=>'L', +65349=>'L', +65350=>'L', +65351=>'L', +65352=>'L', +65353=>'L', +65354=>'L', +65355=>'L', +65356=>'L', +65357=>'L', +65358=>'L', +65359=>'L', +65360=>'L', +65361=>'L', +65362=>'L', +65363=>'L', +65364=>'L', +65365=>'L', +65366=>'L', +65367=>'L', +65368=>'L', +65369=>'L', +65370=>'L', +65371=>'ON', +65372=>'ON', +65373=>'ON', +65374=>'ON', +65375=>'ON', +65376=>'ON', +65377=>'ON', +65378=>'ON', +65379=>'ON', +65380=>'ON', +65381=>'ON', +65382=>'L', +65383=>'L', +65384=>'L', +65385=>'L', +65386=>'L', +65387=>'L', +65388=>'L', +65389=>'L', +65390=>'L', +65391=>'L', +65392=>'L', +65393=>'L', +65394=>'L', +65395=>'L', +65396=>'L', +65397=>'L', +65398=>'L', +65399=>'L', +65400=>'L', +65401=>'L', +65402=>'L', +65403=>'L', +65404=>'L', +65405=>'L', +65406=>'L', +65407=>'L', +65408=>'L', +65409=>'L', +65410=>'L', +65411=>'L', +65412=>'L', +65413=>'L', +65414=>'L', +65415=>'L', +65416=>'L', +65417=>'L', +65418=>'L', +65419=>'L', +65420=>'L', +65421=>'L', +65422=>'L', +65423=>'L', +65424=>'L', +65425=>'L', +65426=>'L', +65427=>'L', +65428=>'L', +65429=>'L', +65430=>'L', +65431=>'L', +65432=>'L', +65433=>'L', +65434=>'L', +65435=>'L', +65436=>'L', +65437=>'L', +65438=>'L', +65439=>'L', +65440=>'L', +65441=>'L', +65442=>'L', +65443=>'L', +65444=>'L', +65445=>'L', +65446=>'L', +65447=>'L', +65448=>'L', +65449=>'L', +65450=>'L', +65451=>'L', +65452=>'L', +65453=>'L', +65454=>'L', +65455=>'L', +65456=>'L', +65457=>'L', +65458=>'L', +65459=>'L', +65460=>'L', +65461=>'L', +65462=>'L', +65463=>'L', +65464=>'L', +65465=>'L', +65466=>'L', +65467=>'L', +65468=>'L', +65469=>'L', +65470=>'L', +65474=>'L', +65475=>'L', +65476=>'L', +65477=>'L', +65478=>'L', +65479=>'L', +65482=>'L', +65483=>'L', +65484=>'L', +65485=>'L', +65486=>'L', +65487=>'L', +65490=>'L', +65491=>'L', +65492=>'L', +65493=>'L', +65494=>'L', +65495=>'L', +65498=>'L', +65499=>'L', +65500=>'L', +65504=>'ET', +65505=>'ET', +65506=>'ON', +65507=>'ON', +65508=>'ON', +65509=>'ET', +65510=>'ET', +65512=>'ON', +65513=>'ON', +65514=>'ON', +65515=>'ON', +65516=>'ON', +65517=>'ON', +65518=>'ON', +65529=>'ON', +65530=>'ON', +65531=>'ON', +65532=>'ON', +65533=>'ON', +65536=>'L', +65537=>'L', +65538=>'L', +65539=>'L', +65540=>'L', +65541=>'L', +65542=>'L', +65543=>'L', +65544=>'L', +65545=>'L', +65546=>'L', +65547=>'L', +65549=>'L', +65550=>'L', +65551=>'L', +65552=>'L', +65553=>'L', +65554=>'L', +65555=>'L', +65556=>'L', +65557=>'L', +65558=>'L', +65559=>'L', +65560=>'L', +65561=>'L', +65562=>'L', +65563=>'L', +65564=>'L', +65565=>'L', +65566=>'L', +65567=>'L', +65568=>'L', +65569=>'L', +65570=>'L', +65571=>'L', +65572=>'L', +65573=>'L', +65574=>'L', +65576=>'L', +65577=>'L', +65578=>'L', +65579=>'L', +65580=>'L', +65581=>'L', +65582=>'L', +65583=>'L', +65584=>'L', +65585=>'L', +65586=>'L', +65587=>'L', +65588=>'L', +65589=>'L', +65590=>'L', +65591=>'L', +65592=>'L', +65593=>'L', +65594=>'L', +65596=>'L', +65597=>'L', +65599=>'L', +65600=>'L', +65601=>'L', +65602=>'L', +65603=>'L', +65604=>'L', +65605=>'L', +65606=>'L', +65607=>'L', +65608=>'L', +65609=>'L', +65610=>'L', +65611=>'L', +65612=>'L', +65613=>'L', +65616=>'L', +65617=>'L', +65618=>'L', +65619=>'L', +65620=>'L', +65621=>'L', +65622=>'L', +65623=>'L', +65624=>'L', +65625=>'L', +65626=>'L', +65627=>'L', +65628=>'L', +65629=>'L', +65664=>'L', +65665=>'L', +65666=>'L', +65667=>'L', +65668=>'L', +65669=>'L', +65670=>'L', +65671=>'L', +65672=>'L', +65673=>'L', +65674=>'L', +65675=>'L', +65676=>'L', +65677=>'L', +65678=>'L', +65679=>'L', +65680=>'L', +65681=>'L', +65682=>'L', +65683=>'L', +65684=>'L', +65685=>'L', +65686=>'L', +65687=>'L', +65688=>'L', +65689=>'L', +65690=>'L', +65691=>'L', +65692=>'L', +65693=>'L', +65694=>'L', +65695=>'L', +65696=>'L', +65697=>'L', +65698=>'L', +65699=>'L', +65700=>'L', +65701=>'L', +65702=>'L', +65703=>'L', +65704=>'L', +65705=>'L', +65706=>'L', +65707=>'L', +65708=>'L', +65709=>'L', +65710=>'L', +65711=>'L', +65712=>'L', +65713=>'L', +65714=>'L', +65715=>'L', +65716=>'L', +65717=>'L', +65718=>'L', +65719=>'L', +65720=>'L', +65721=>'L', +65722=>'L', +65723=>'L', +65724=>'L', +65725=>'L', +65726=>'L', +65727=>'L', +65728=>'L', +65729=>'L', +65730=>'L', +65731=>'L', +65732=>'L', +65733=>'L', +65734=>'L', +65735=>'L', +65736=>'L', +65737=>'L', +65738=>'L', +65739=>'L', +65740=>'L', +65741=>'L', +65742=>'L', +65743=>'L', +65744=>'L', +65745=>'L', +65746=>'L', +65747=>'L', +65748=>'L', +65749=>'L', +65750=>'L', +65751=>'L', +65752=>'L', +65753=>'L', +65754=>'L', +65755=>'L', +65756=>'L', +65757=>'L', +65758=>'L', +65759=>'L', +65760=>'L', +65761=>'L', +65762=>'L', +65763=>'L', +65764=>'L', +65765=>'L', +65766=>'L', +65767=>'L', +65768=>'L', +65769=>'L', +65770=>'L', +65771=>'L', +65772=>'L', +65773=>'L', +65774=>'L', +65775=>'L', +65776=>'L', +65777=>'L', +65778=>'L', +65779=>'L', +65780=>'L', +65781=>'L', +65782=>'L', +65783=>'L', +65784=>'L', +65785=>'L', +65786=>'L', +65792=>'L', +65793=>'ON', +65794=>'L', +65799=>'L', +65800=>'L', +65801=>'L', +65802=>'L', +65803=>'L', +65804=>'L', +65805=>'L', +65806=>'L', +65807=>'L', +65808=>'L', +65809=>'L', +65810=>'L', +65811=>'L', +65812=>'L', +65813=>'L', +65814=>'L', +65815=>'L', +65816=>'L', +65817=>'L', +65818=>'L', +65819=>'L', +65820=>'L', +65821=>'L', +65822=>'L', +65823=>'L', +65824=>'L', +65825=>'L', +65826=>'L', +65827=>'L', +65828=>'L', +65829=>'L', +65830=>'L', +65831=>'L', +65832=>'L', +65833=>'L', +65834=>'L', +65835=>'L', +65836=>'L', +65837=>'L', +65838=>'L', +65839=>'L', +65840=>'L', +65841=>'L', +65842=>'L', +65843=>'L', +65847=>'L', +65848=>'L', +65849=>'L', +65850=>'L', +65851=>'L', +65852=>'L', +65853=>'L', +65854=>'L', +65855=>'L', +65856=>'ON', +65857=>'ON', +65858=>'ON', +65859=>'ON', +65860=>'ON', +65861=>'ON', +65862=>'ON', +65863=>'ON', +65864=>'ON', +65865=>'ON', +65866=>'ON', +65867=>'ON', +65868=>'ON', +65869=>'ON', +65870=>'ON', +65871=>'ON', +65872=>'ON', +65873=>'ON', +65874=>'ON', +65875=>'ON', +65876=>'ON', +65877=>'ON', +65878=>'ON', +65879=>'ON', +65880=>'ON', +65881=>'ON', +65882=>'ON', +65883=>'ON', +65884=>'ON', +65885=>'ON', +65886=>'ON', +65887=>'ON', +65888=>'ON', +65889=>'ON', +65890=>'ON', +65891=>'ON', +65892=>'ON', +65893=>'ON', +65894=>'ON', +65895=>'ON', +65896=>'ON', +65897=>'ON', +65898=>'ON', +65899=>'ON', +65900=>'ON', +65901=>'ON', +65902=>'ON', +65903=>'ON', +65904=>'ON', +65905=>'ON', +65906=>'ON', +65907=>'ON', +65908=>'ON', +65909=>'ON', +65910=>'ON', +65911=>'ON', +65912=>'ON', +65913=>'ON', +65914=>'ON', +65915=>'ON', +65916=>'ON', +65917=>'ON', +65918=>'ON', +65919=>'ON', +65920=>'ON', +65921=>'ON', +65922=>'ON', +65923=>'ON', +65924=>'ON', +65925=>'ON', +65926=>'ON', +65927=>'ON', +65928=>'ON', +65929=>'ON', +65930=>'ON', +66304=>'L', +66305=>'L', +66306=>'L', +66307=>'L', +66308=>'L', +66309=>'L', +66310=>'L', +66311=>'L', +66312=>'L', +66313=>'L', +66314=>'L', +66315=>'L', +66316=>'L', +66317=>'L', +66318=>'L', +66319=>'L', +66320=>'L', +66321=>'L', +66322=>'L', +66323=>'L', +66324=>'L', +66325=>'L', +66326=>'L', +66327=>'L', +66328=>'L', +66329=>'L', +66330=>'L', +66331=>'L', +66332=>'L', +66333=>'L', +66334=>'L', +66336=>'L', +66337=>'L', +66338=>'L', +66339=>'L', +66352=>'L', +66353=>'L', +66354=>'L', +66355=>'L', +66356=>'L', +66357=>'L', +66358=>'L', +66359=>'L', +66360=>'L', +66361=>'L', +66362=>'L', +66363=>'L', +66364=>'L', +66365=>'L', +66366=>'L', +66367=>'L', +66368=>'L', +66369=>'L', +66370=>'L', +66371=>'L', +66372=>'L', +66373=>'L', +66374=>'L', +66375=>'L', +66376=>'L', +66377=>'L', +66378=>'L', +66432=>'L', +66433=>'L', +66434=>'L', +66435=>'L', +66436=>'L', +66437=>'L', +66438=>'L', +66439=>'L', +66440=>'L', +66441=>'L', +66442=>'L', +66443=>'L', +66444=>'L', +66445=>'L', +66446=>'L', +66447=>'L', +66448=>'L', +66449=>'L', +66450=>'L', +66451=>'L', +66452=>'L', +66453=>'L', +66454=>'L', +66455=>'L', +66456=>'L', +66457=>'L', +66458=>'L', +66459=>'L', +66460=>'L', +66461=>'L', +66463=>'L', +66464=>'L', +66465=>'L', +66466=>'L', +66467=>'L', +66468=>'L', +66469=>'L', +66470=>'L', +66471=>'L', +66472=>'L', +66473=>'L', +66474=>'L', +66475=>'L', +66476=>'L', +66477=>'L', +66478=>'L', +66479=>'L', +66480=>'L', +66481=>'L', +66482=>'L', +66483=>'L', +66484=>'L', +66485=>'L', +66486=>'L', +66487=>'L', +66488=>'L', +66489=>'L', +66490=>'L', +66491=>'L', +66492=>'L', +66493=>'L', +66494=>'L', +66495=>'L', +66496=>'L', +66497=>'L', +66498=>'L', +66499=>'L', +66504=>'L', +66505=>'L', +66506=>'L', +66507=>'L', +66508=>'L', +66509=>'L', +66510=>'L', +66511=>'L', +66512=>'L', +66513=>'L', +66514=>'L', +66515=>'L', +66516=>'L', +66517=>'L', +66560=>'L', +66561=>'L', +66562=>'L', +66563=>'L', +66564=>'L', +66565=>'L', +66566=>'L', +66567=>'L', +66568=>'L', +66569=>'L', +66570=>'L', +66571=>'L', +66572=>'L', +66573=>'L', +66574=>'L', +66575=>'L', +66576=>'L', +66577=>'L', +66578=>'L', +66579=>'L', +66580=>'L', +66581=>'L', +66582=>'L', +66583=>'L', +66584=>'L', +66585=>'L', +66586=>'L', +66587=>'L', +66588=>'L', +66589=>'L', +66590=>'L', +66591=>'L', +66592=>'L', +66593=>'L', +66594=>'L', +66595=>'L', +66596=>'L', +66597=>'L', +66598=>'L', +66599=>'L', +66600=>'L', +66601=>'L', +66602=>'L', +66603=>'L', +66604=>'L', +66605=>'L', +66606=>'L', +66607=>'L', +66608=>'L', +66609=>'L', +66610=>'L', +66611=>'L', +66612=>'L', +66613=>'L', +66614=>'L', +66615=>'L', +66616=>'L', +66617=>'L', +66618=>'L', +66619=>'L', +66620=>'L', +66621=>'L', +66622=>'L', +66623=>'L', +66624=>'L', +66625=>'L', +66626=>'L', +66627=>'L', +66628=>'L', +66629=>'L', +66630=>'L', +66631=>'L', +66632=>'L', +66633=>'L', +66634=>'L', +66635=>'L', +66636=>'L', +66637=>'L', +66638=>'L', +66639=>'L', +66640=>'L', +66641=>'L', +66642=>'L', +66643=>'L', +66644=>'L', +66645=>'L', +66646=>'L', +66647=>'L', +66648=>'L', +66649=>'L', +66650=>'L', +66651=>'L', +66652=>'L', +66653=>'L', +66654=>'L', +66655=>'L', +66656=>'L', +66657=>'L', +66658=>'L', +66659=>'L', +66660=>'L', +66661=>'L', +66662=>'L', +66663=>'L', +66664=>'L', +66665=>'L', +66666=>'L', +66667=>'L', +66668=>'L', +66669=>'L', +66670=>'L', +66671=>'L', +66672=>'L', +66673=>'L', +66674=>'L', +66675=>'L', +66676=>'L', +66677=>'L', +66678=>'L', +66679=>'L', +66680=>'L', +66681=>'L', +66682=>'L', +66683=>'L', +66684=>'L', +66685=>'L', +66686=>'L', +66687=>'L', +66688=>'L', +66689=>'L', +66690=>'L', +66691=>'L', +66692=>'L', +66693=>'L', +66694=>'L', +66695=>'L', +66696=>'L', +66697=>'L', +66698=>'L', +66699=>'L', +66700=>'L', +66701=>'L', +66702=>'L', +66703=>'L', +66704=>'L', +66705=>'L', +66706=>'L', +66707=>'L', +66708=>'L', +66709=>'L', +66710=>'L', +66711=>'L', +66712=>'L', +66713=>'L', +66714=>'L', +66715=>'L', +66716=>'L', +66717=>'L', +66720=>'L', +66721=>'L', +66722=>'L', +66723=>'L', +66724=>'L', +66725=>'L', +66726=>'L', +66727=>'L', +66728=>'L', +66729=>'L', +67584=>'R', +67585=>'R', +67586=>'R', +67587=>'R', +67588=>'R', +67589=>'R', +67592=>'R', +67594=>'R', +67595=>'R', +67596=>'R', +67597=>'R', +67598=>'R', +67599=>'R', +67600=>'R', +67601=>'R', +67602=>'R', +67603=>'R', +67604=>'R', +67605=>'R', +67606=>'R', +67607=>'R', +67608=>'R', +67609=>'R', +67610=>'R', +67611=>'R', +67612=>'R', +67613=>'R', +67614=>'R', +67615=>'R', +67616=>'R', +67617=>'R', +67618=>'R', +67619=>'R', +67620=>'R', +67621=>'R', +67622=>'R', +67623=>'R', +67624=>'R', +67625=>'R', +67626=>'R', +67627=>'R', +67628=>'R', +67629=>'R', +67630=>'R', +67631=>'R', +67632=>'R', +67633=>'R', +67634=>'R', +67635=>'R', +67636=>'R', +67637=>'R', +67639=>'R', +67640=>'R', +67644=>'R', +67647=>'R', +67840=>'R', +67841=>'R', +67842=>'R', +67843=>'R', +67844=>'R', +67845=>'R', +67846=>'R', +67847=>'R', +67848=>'R', +67849=>'R', +67850=>'R', +67851=>'R', +67852=>'R', +67853=>'R', +67854=>'R', +67855=>'R', +67856=>'R', +67857=>'R', +67858=>'R', +67859=>'R', +67860=>'R', +67861=>'R', +67862=>'R', +67863=>'R', +67864=>'R', +67865=>'R', +67871=>'ON', +68096=>'R', +68097=>'NSM', +68098=>'NSM', +68099=>'NSM', +68101=>'NSM', +68102=>'NSM', +68108=>'NSM', +68109=>'NSM', +68110=>'NSM', +68111=>'NSM', +68112=>'R', +68113=>'R', +68114=>'R', +68115=>'R', +68117=>'R', +68118=>'R', +68119=>'R', +68121=>'R', +68122=>'R', +68123=>'R', +68124=>'R', +68125=>'R', +68126=>'R', +68127=>'R', +68128=>'R', +68129=>'R', +68130=>'R', +68131=>'R', +68132=>'R', +68133=>'R', +68134=>'R', +68135=>'R', +68136=>'R', +68137=>'R', +68138=>'R', +68139=>'R', +68140=>'R', +68141=>'R', +68142=>'R', +68143=>'R', +68144=>'R', +68145=>'R', +68146=>'R', +68147=>'R', +68152=>'NSM', +68153=>'NSM', +68154=>'NSM', +68159=>'NSM', +68160=>'R', +68161=>'R', +68162=>'R', +68163=>'R', +68164=>'R', +68165=>'R', +68166=>'R', +68167=>'R', +68176=>'R', +68177=>'R', +68178=>'R', +68179=>'R', +68180=>'R', +68181=>'R', +68182=>'R', +68183=>'R', +68184=>'R', +73728=>'L', +73729=>'L', +73730=>'L', +73731=>'L', +73732=>'L', +73733=>'L', +73734=>'L', +73735=>'L', +73736=>'L', +73737=>'L', +73738=>'L', +73739=>'L', +73740=>'L', +73741=>'L', +73742=>'L', +73743=>'L', +73744=>'L', +73745=>'L', +73746=>'L', +73747=>'L', +73748=>'L', +73749=>'L', +73750=>'L', +73751=>'L', +73752=>'L', +73753=>'L', +73754=>'L', +73755=>'L', +73756=>'L', +73757=>'L', +73758=>'L', +73759=>'L', +73760=>'L', +73761=>'L', +73762=>'L', +73763=>'L', +73764=>'L', +73765=>'L', +73766=>'L', +73767=>'L', +73768=>'L', +73769=>'L', +73770=>'L', +73771=>'L', +73772=>'L', +73773=>'L', +73774=>'L', +73775=>'L', +73776=>'L', +73777=>'L', +73778=>'L', +73779=>'L', +73780=>'L', +73781=>'L', +73782=>'L', +73783=>'L', +73784=>'L', +73785=>'L', +73786=>'L', +73787=>'L', +73788=>'L', +73789=>'L', +73790=>'L', +73791=>'L', +73792=>'L', +73793=>'L', +73794=>'L', +73795=>'L', +73796=>'L', +73797=>'L', +73798=>'L', +73799=>'L', +73800=>'L', +73801=>'L', +73802=>'L', +73803=>'L', +73804=>'L', +73805=>'L', +73806=>'L', +73807=>'L', +73808=>'L', +73809=>'L', +73810=>'L', +73811=>'L', +73812=>'L', +73813=>'L', +73814=>'L', +73815=>'L', +73816=>'L', +73817=>'L', +73818=>'L', +73819=>'L', +73820=>'L', +73821=>'L', +73822=>'L', +73823=>'L', +73824=>'L', +73825=>'L', +73826=>'L', +73827=>'L', +73828=>'L', +73829=>'L', +73830=>'L', +73831=>'L', +73832=>'L', +73833=>'L', +73834=>'L', +73835=>'L', +73836=>'L', +73837=>'L', +73838=>'L', +73839=>'L', +73840=>'L', +73841=>'L', +73842=>'L', +73843=>'L', +73844=>'L', +73845=>'L', +73846=>'L', +73847=>'L', +73848=>'L', +73849=>'L', +73850=>'L', +73851=>'L', +73852=>'L', +73853=>'L', +73854=>'L', +73855=>'L', +73856=>'L', +73857=>'L', +73858=>'L', +73859=>'L', +73860=>'L', +73861=>'L', +73862=>'L', +73863=>'L', +73864=>'L', +73865=>'L', +73866=>'L', +73867=>'L', +73868=>'L', +73869=>'L', +73870=>'L', +73871=>'L', +73872=>'L', +73873=>'L', +73874=>'L', +73875=>'L', +73876=>'L', +73877=>'L', +73878=>'L', +73879=>'L', +73880=>'L', +73881=>'L', +73882=>'L', +73883=>'L', +73884=>'L', +73885=>'L', +73886=>'L', +73887=>'L', +73888=>'L', +73889=>'L', +73890=>'L', +73891=>'L', +73892=>'L', +73893=>'L', +73894=>'L', +73895=>'L', +73896=>'L', +73897=>'L', +73898=>'L', +73899=>'L', +73900=>'L', +73901=>'L', +73902=>'L', +73903=>'L', +73904=>'L', +73905=>'L', +73906=>'L', +73907=>'L', +73908=>'L', +73909=>'L', +73910=>'L', +73911=>'L', +73912=>'L', +73913=>'L', +73914=>'L', +73915=>'L', +73916=>'L', +73917=>'L', +73918=>'L', +73919=>'L', +73920=>'L', +73921=>'L', +73922=>'L', +73923=>'L', +73924=>'L', +73925=>'L', +73926=>'L', +73927=>'L', +73928=>'L', +73929=>'L', +73930=>'L', +73931=>'L', +73932=>'L', +73933=>'L', +73934=>'L', +73935=>'L', +73936=>'L', +73937=>'L', +73938=>'L', +73939=>'L', +73940=>'L', +73941=>'L', +73942=>'L', +73943=>'L', +73944=>'L', +73945=>'L', +73946=>'L', +73947=>'L', +73948=>'L', +73949=>'L', +73950=>'L', +73951=>'L', +73952=>'L', +73953=>'L', +73954=>'L', +73955=>'L', +73956=>'L', +73957=>'L', +73958=>'L', +73959=>'L', +73960=>'L', +73961=>'L', +73962=>'L', +73963=>'L', +73964=>'L', +73965=>'L', +73966=>'L', +73967=>'L', +73968=>'L', +73969=>'L', +73970=>'L', +73971=>'L', +73972=>'L', +73973=>'L', +73974=>'L', +73975=>'L', +73976=>'L', +73977=>'L', +73978=>'L', +73979=>'L', +73980=>'L', +73981=>'L', +73982=>'L', +73983=>'L', +73984=>'L', +73985=>'L', +73986=>'L', +73987=>'L', +73988=>'L', +73989=>'L', +73990=>'L', +73991=>'L', +73992=>'L', +73993=>'L', +73994=>'L', +73995=>'L', +73996=>'L', +73997=>'L', +73998=>'L', +73999=>'L', +74000=>'L', +74001=>'L', +74002=>'L', +74003=>'L', +74004=>'L', +74005=>'L', +74006=>'L', +74007=>'L', +74008=>'L', +74009=>'L', +74010=>'L', +74011=>'L', +74012=>'L', +74013=>'L', +74014=>'L', +74015=>'L', +74016=>'L', +74017=>'L', +74018=>'L', +74019=>'L', +74020=>'L', +74021=>'L', +74022=>'L', +74023=>'L', +74024=>'L', +74025=>'L', +74026=>'L', +74027=>'L', +74028=>'L', +74029=>'L', +74030=>'L', +74031=>'L', +74032=>'L', +74033=>'L', +74034=>'L', +74035=>'L', +74036=>'L', +74037=>'L', +74038=>'L', +74039=>'L', +74040=>'L', +74041=>'L', +74042=>'L', +74043=>'L', +74044=>'L', +74045=>'L', +74046=>'L', +74047=>'L', +74048=>'L', +74049=>'L', +74050=>'L', +74051=>'L', +74052=>'L', +74053=>'L', +74054=>'L', +74055=>'L', +74056=>'L', +74057=>'L', +74058=>'L', +74059=>'L', +74060=>'L', +74061=>'L', +74062=>'L', +74063=>'L', +74064=>'L', +74065=>'L', +74066=>'L', +74067=>'L', +74068=>'L', +74069=>'L', +74070=>'L', +74071=>'L', +74072=>'L', +74073=>'L', +74074=>'L', +74075=>'L', +74076=>'L', +74077=>'L', +74078=>'L', +74079=>'L', +74080=>'L', +74081=>'L', +74082=>'L', +74083=>'L', +74084=>'L', +74085=>'L', +74086=>'L', +74087=>'L', +74088=>'L', +74089=>'L', +74090=>'L', +74091=>'L', +74092=>'L', +74093=>'L', +74094=>'L', +74095=>'L', +74096=>'L', +74097=>'L', +74098=>'L', +74099=>'L', +74100=>'L', +74101=>'L', +74102=>'L', +74103=>'L', +74104=>'L', +74105=>'L', +74106=>'L', +74107=>'L', +74108=>'L', +74109=>'L', +74110=>'L', +74111=>'L', +74112=>'L', +74113=>'L', +74114=>'L', +74115=>'L', +74116=>'L', +74117=>'L', +74118=>'L', +74119=>'L', +74120=>'L', +74121=>'L', +74122=>'L', +74123=>'L', +74124=>'L', +74125=>'L', +74126=>'L', +74127=>'L', +74128=>'L', +74129=>'L', +74130=>'L', +74131=>'L', +74132=>'L', +74133=>'L', +74134=>'L', +74135=>'L', +74136=>'L', +74137=>'L', +74138=>'L', +74139=>'L', +74140=>'L', +74141=>'L', +74142=>'L', +74143=>'L', +74144=>'L', +74145=>'L', +74146=>'L', +74147=>'L', +74148=>'L', +74149=>'L', +74150=>'L', +74151=>'L', +74152=>'L', +74153=>'L', +74154=>'L', +74155=>'L', +74156=>'L', +74157=>'L', +74158=>'L', +74159=>'L', +74160=>'L', +74161=>'L', +74162=>'L', +74163=>'L', +74164=>'L', +74165=>'L', +74166=>'L', +74167=>'L', +74168=>'L', +74169=>'L', +74170=>'L', +74171=>'L', +74172=>'L', +74173=>'L', +74174=>'L', +74175=>'L', +74176=>'L', +74177=>'L', +74178=>'L', +74179=>'L', +74180=>'L', +74181=>'L', +74182=>'L', +74183=>'L', +74184=>'L', +74185=>'L', +74186=>'L', +74187=>'L', +74188=>'L', +74189=>'L', +74190=>'L', +74191=>'L', +74192=>'L', +74193=>'L', +74194=>'L', +74195=>'L', +74196=>'L', +74197=>'L', +74198=>'L', +74199=>'L', +74200=>'L', +74201=>'L', +74202=>'L', +74203=>'L', +74204=>'L', +74205=>'L', +74206=>'L', +74207=>'L', +74208=>'L', +74209=>'L', +74210=>'L', +74211=>'L', +74212=>'L', +74213=>'L', +74214=>'L', +74215=>'L', +74216=>'L', +74217=>'L', +74218=>'L', +74219=>'L', +74220=>'L', +74221=>'L', +74222=>'L', +74223=>'L', +74224=>'L', +74225=>'L', +74226=>'L', +74227=>'L', +74228=>'L', +74229=>'L', +74230=>'L', +74231=>'L', +74232=>'L', +74233=>'L', +74234=>'L', +74235=>'L', +74236=>'L', +74237=>'L', +74238=>'L', +74239=>'L', +74240=>'L', +74241=>'L', +74242=>'L', +74243=>'L', +74244=>'L', +74245=>'L', +74246=>'L', +74247=>'L', +74248=>'L', +74249=>'L', +74250=>'L', +74251=>'L', +74252=>'L', +74253=>'L', +74254=>'L', +74255=>'L', +74256=>'L', +74257=>'L', +74258=>'L', +74259=>'L', +74260=>'L', +74261=>'L', +74262=>'L', +74263=>'L', +74264=>'L', +74265=>'L', +74266=>'L', +74267=>'L', +74268=>'L', +74269=>'L', +74270=>'L', +74271=>'L', +74272=>'L', +74273=>'L', +74274=>'L', +74275=>'L', +74276=>'L', +74277=>'L', +74278=>'L', +74279=>'L', +74280=>'L', +74281=>'L', +74282=>'L', +74283=>'L', +74284=>'L', +74285=>'L', +74286=>'L', +74287=>'L', +74288=>'L', +74289=>'L', +74290=>'L', +74291=>'L', +74292=>'L', +74293=>'L', +74294=>'L', +74295=>'L', +74296=>'L', +74297=>'L', +74298=>'L', +74299=>'L', +74300=>'L', +74301=>'L', +74302=>'L', +74303=>'L', +74304=>'L', +74305=>'L', +74306=>'L', +74307=>'L', +74308=>'L', +74309=>'L', +74310=>'L', +74311=>'L', +74312=>'L', +74313=>'L', +74314=>'L', +74315=>'L', +74316=>'L', +74317=>'L', +74318=>'L', +74319=>'L', +74320=>'L', +74321=>'L', +74322=>'L', +74323=>'L', +74324=>'L', +74325=>'L', +74326=>'L', +74327=>'L', +74328=>'L', +74329=>'L', +74330=>'L', +74331=>'L', +74332=>'L', +74333=>'L', +74334=>'L', +74335=>'L', +74336=>'L', +74337=>'L', +74338=>'L', +74339=>'L', +74340=>'L', +74341=>'L', +74342=>'L', +74343=>'L', +74344=>'L', +74345=>'L', +74346=>'L', +74347=>'L', +74348=>'L', +74349=>'L', +74350=>'L', +74351=>'L', +74352=>'L', +74353=>'L', +74354=>'L', +74355=>'L', +74356=>'L', +74357=>'L', +74358=>'L', +74359=>'L', +74360=>'L', +74361=>'L', +74362=>'L', +74363=>'L', +74364=>'L', +74365=>'L', +74366=>'L', +74367=>'L', +74368=>'L', +74369=>'L', +74370=>'L', +74371=>'L', +74372=>'L', +74373=>'L', +74374=>'L', +74375=>'L', +74376=>'L', +74377=>'L', +74378=>'L', +74379=>'L', +74380=>'L', +74381=>'L', +74382=>'L', +74383=>'L', +74384=>'L', +74385=>'L', +74386=>'L', +74387=>'L', +74388=>'L', +74389=>'L', +74390=>'L', +74391=>'L', +74392=>'L', +74393=>'L', +74394=>'L', +74395=>'L', +74396=>'L', +74397=>'L', +74398=>'L', +74399=>'L', +74400=>'L', +74401=>'L', +74402=>'L', +74403=>'L', +74404=>'L', +74405=>'L', +74406=>'L', +74407=>'L', +74408=>'L', +74409=>'L', +74410=>'L', +74411=>'L', +74412=>'L', +74413=>'L', +74414=>'L', +74415=>'L', +74416=>'L', +74417=>'L', +74418=>'L', +74419=>'L', +74420=>'L', +74421=>'L', +74422=>'L', +74423=>'L', +74424=>'L', +74425=>'L', +74426=>'L', +74427=>'L', +74428=>'L', +74429=>'L', +74430=>'L', +74431=>'L', +74432=>'L', +74433=>'L', +74434=>'L', +74435=>'L', +74436=>'L', +74437=>'L', +74438=>'L', +74439=>'L', +74440=>'L', +74441=>'L', +74442=>'L', +74443=>'L', +74444=>'L', +74445=>'L', +74446=>'L', +74447=>'L', +74448=>'L', +74449=>'L', +74450=>'L', +74451=>'L', +74452=>'L', +74453=>'L', +74454=>'L', +74455=>'L', +74456=>'L', +74457=>'L', +74458=>'L', +74459=>'L', +74460=>'L', +74461=>'L', +74462=>'L', +74463=>'L', +74464=>'L', +74465=>'L', +74466=>'L', +74467=>'L', +74468=>'L', +74469=>'L', +74470=>'L', +74471=>'L', +74472=>'L', +74473=>'L', +74474=>'L', +74475=>'L', +74476=>'L', +74477=>'L', +74478=>'L', +74479=>'L', +74480=>'L', +74481=>'L', +74482=>'L', +74483=>'L', +74484=>'L', +74485=>'L', +74486=>'L', +74487=>'L', +74488=>'L', +74489=>'L', +74490=>'L', +74491=>'L', +74492=>'L', +74493=>'L', +74494=>'L', +74495=>'L', +74496=>'L', +74497=>'L', +74498=>'L', +74499=>'L', +74500=>'L', +74501=>'L', +74502=>'L', +74503=>'L', +74504=>'L', +74505=>'L', +74506=>'L', +74507=>'L', +74508=>'L', +74509=>'L', +74510=>'L', +74511=>'L', +74512=>'L', +74513=>'L', +74514=>'L', +74515=>'L', +74516=>'L', +74517=>'L', +74518=>'L', +74519=>'L', +74520=>'L', +74521=>'L', +74522=>'L', +74523=>'L', +74524=>'L', +74525=>'L', +74526=>'L', +74527=>'L', +74528=>'L', +74529=>'L', +74530=>'L', +74531=>'L', +74532=>'L', +74533=>'L', +74534=>'L', +74535=>'L', +74536=>'L', +74537=>'L', +74538=>'L', +74539=>'L', +74540=>'L', +74541=>'L', +74542=>'L', +74543=>'L', +74544=>'L', +74545=>'L', +74546=>'L', +74547=>'L', +74548=>'L', +74549=>'L', +74550=>'L', +74551=>'L', +74552=>'L', +74553=>'L', +74554=>'L', +74555=>'L', +74556=>'L', +74557=>'L', +74558=>'L', +74559=>'L', +74560=>'L', +74561=>'L', +74562=>'L', +74563=>'L', +74564=>'L', +74565=>'L', +74566=>'L', +74567=>'L', +74568=>'L', +74569=>'L', +74570=>'L', +74571=>'L', +74572=>'L', +74573=>'L', +74574=>'L', +74575=>'L', +74576=>'L', +74577=>'L', +74578=>'L', +74579=>'L', +74580=>'L', +74581=>'L', +74582=>'L', +74583=>'L', +74584=>'L', +74585=>'L', +74586=>'L', +74587=>'L', +74588=>'L', +74589=>'L', +74590=>'L', +74591=>'L', +74592=>'L', +74593=>'L', +74594=>'L', +74595=>'L', +74596=>'L', +74597=>'L', +74598=>'L', +74599=>'L', +74600=>'L', +74601=>'L', +74602=>'L', +74603=>'L', +74604=>'L', +74605=>'L', +74606=>'L', +74752=>'L', +74753=>'L', +74754=>'L', +74755=>'L', +74756=>'L', +74757=>'L', +74758=>'L', +74759=>'L', +74760=>'L', +74761=>'L', +74762=>'L', +74763=>'L', +74764=>'L', +74765=>'L', +74766=>'L', +74767=>'L', +74768=>'L', +74769=>'L', +74770=>'L', +74771=>'L', +74772=>'L', +74773=>'L', +74774=>'L', +74775=>'L', +74776=>'L', +74777=>'L', +74778=>'L', +74779=>'L', +74780=>'L', +74781=>'L', +74782=>'L', +74783=>'L', +74784=>'L', +74785=>'L', +74786=>'L', +74787=>'L', +74788=>'L', +74789=>'L', +74790=>'L', +74791=>'L', +74792=>'L', +74793=>'L', +74794=>'L', +74795=>'L', +74796=>'L', +74797=>'L', +74798=>'L', +74799=>'L', +74800=>'L', +74801=>'L', +74802=>'L', +74803=>'L', +74804=>'L', +74805=>'L', +74806=>'L', +74807=>'L', +74808=>'L', +74809=>'L', +74810=>'L', +74811=>'L', +74812=>'L', +74813=>'L', +74814=>'L', +74815=>'L', +74816=>'L', +74817=>'L', +74818=>'L', +74819=>'L', +74820=>'L', +74821=>'L', +74822=>'L', +74823=>'L', +74824=>'L', +74825=>'L', +74826=>'L', +74827=>'L', +74828=>'L', +74829=>'L', +74830=>'L', +74831=>'L', +74832=>'L', +74833=>'L', +74834=>'L', +74835=>'L', +74836=>'L', +74837=>'L', +74838=>'L', +74839=>'L', +74840=>'L', +74841=>'L', +74842=>'L', +74843=>'L', +74844=>'L', +74845=>'L', +74846=>'L', +74847=>'L', +74848=>'L', +74849=>'L', +74850=>'L', +74864=>'L', +74865=>'L', +74866=>'L', +74867=>'L', +118784=>'L', +118785=>'L', +118786=>'L', +118787=>'L', +118788=>'L', +118789=>'L', +118790=>'L', +118791=>'L', +118792=>'L', +118793=>'L', +118794=>'L', +118795=>'L', +118796=>'L', +118797=>'L', +118798=>'L', +118799=>'L', +118800=>'L', +118801=>'L', +118802=>'L', +118803=>'L', +118804=>'L', +118805=>'L', +118806=>'L', +118807=>'L', +118808=>'L', +118809=>'L', +118810=>'L', +118811=>'L', +118812=>'L', +118813=>'L', +118814=>'L', +118815=>'L', +118816=>'L', +118817=>'L', +118818=>'L', +118819=>'L', +118820=>'L', +118821=>'L', +118822=>'L', +118823=>'L', +118824=>'L', +118825=>'L', +118826=>'L', +118827=>'L', +118828=>'L', +118829=>'L', +118830=>'L', +118831=>'L', +118832=>'L', +118833=>'L', +118834=>'L', +118835=>'L', +118836=>'L', +118837=>'L', +118838=>'L', +118839=>'L', +118840=>'L', +118841=>'L', +118842=>'L', +118843=>'L', +118844=>'L', +118845=>'L', +118846=>'L', +118847=>'L', +118848=>'L', +118849=>'L', +118850=>'L', +118851=>'L', +118852=>'L', +118853=>'L', +118854=>'L', +118855=>'L', +118856=>'L', +118857=>'L', +118858=>'L', +118859=>'L', +118860=>'L', +118861=>'L', +118862=>'L', +118863=>'L', +118864=>'L', +118865=>'L', +118866=>'L', +118867=>'L', +118868=>'L', +118869=>'L', +118870=>'L', +118871=>'L', +118872=>'L', +118873=>'L', +118874=>'L', +118875=>'L', +118876=>'L', +118877=>'L', +118878=>'L', +118879=>'L', +118880=>'L', +118881=>'L', +118882=>'L', +118883=>'L', +118884=>'L', +118885=>'L', +118886=>'L', +118887=>'L', +118888=>'L', +118889=>'L', +118890=>'L', +118891=>'L', +118892=>'L', +118893=>'L', +118894=>'L', +118895=>'L', +118896=>'L', +118897=>'L', +118898=>'L', +118899=>'L', +118900=>'L', +118901=>'L', +118902=>'L', +118903=>'L', +118904=>'L', +118905=>'L', +118906=>'L', +118907=>'L', +118908=>'L', +118909=>'L', +118910=>'L', +118911=>'L', +118912=>'L', +118913=>'L', +118914=>'L', +118915=>'L', +118916=>'L', +118917=>'L', +118918=>'L', +118919=>'L', +118920=>'L', +118921=>'L', +118922=>'L', +118923=>'L', +118924=>'L', +118925=>'L', +118926=>'L', +118927=>'L', +118928=>'L', +118929=>'L', +118930=>'L', +118931=>'L', +118932=>'L', +118933=>'L', +118934=>'L', +118935=>'L', +118936=>'L', +118937=>'L', +118938=>'L', +118939=>'L', +118940=>'L', +118941=>'L', +118942=>'L', +118943=>'L', +118944=>'L', +118945=>'L', +118946=>'L', +118947=>'L', +118948=>'L', +118949=>'L', +118950=>'L', +118951=>'L', +118952=>'L', +118953=>'L', +118954=>'L', +118955=>'L', +118956=>'L', +118957=>'L', +118958=>'L', +118959=>'L', +118960=>'L', +118961=>'L', +118962=>'L', +118963=>'L', +118964=>'L', +118965=>'L', +118966=>'L', +118967=>'L', +118968=>'L', +118969=>'L', +118970=>'L', +118971=>'L', +118972=>'L', +118973=>'L', +118974=>'L', +118975=>'L', +118976=>'L', +118977=>'L', +118978=>'L', +118979=>'L', +118980=>'L', +118981=>'L', +118982=>'L', +118983=>'L', +118984=>'L', +118985=>'L', +118986=>'L', +118987=>'L', +118988=>'L', +118989=>'L', +118990=>'L', +118991=>'L', +118992=>'L', +118993=>'L', +118994=>'L', +118995=>'L', +118996=>'L', +118997=>'L', +118998=>'L', +118999=>'L', +119000=>'L', +119001=>'L', +119002=>'L', +119003=>'L', +119004=>'L', +119005=>'L', +119006=>'L', +119007=>'L', +119008=>'L', +119009=>'L', +119010=>'L', +119011=>'L', +119012=>'L', +119013=>'L', +119014=>'L', +119015=>'L', +119016=>'L', +119017=>'L', +119018=>'L', +119019=>'L', +119020=>'L', +119021=>'L', +119022=>'L', +119023=>'L', +119024=>'L', +119025=>'L', +119026=>'L', +119027=>'L', +119028=>'L', +119029=>'L', +119040=>'L', +119041=>'L', +119042=>'L', +119043=>'L', +119044=>'L', +119045=>'L', +119046=>'L', +119047=>'L', +119048=>'L', +119049=>'L', +119050=>'L', +119051=>'L', +119052=>'L', +119053=>'L', +119054=>'L', +119055=>'L', +119056=>'L', +119057=>'L', +119058=>'L', +119059=>'L', +119060=>'L', +119061=>'L', +119062=>'L', +119063=>'L', +119064=>'L', +119065=>'L', +119066=>'L', +119067=>'L', +119068=>'L', +119069=>'L', +119070=>'L', +119071=>'L', +119072=>'L', +119073=>'L', +119074=>'L', +119075=>'L', +119076=>'L', +119077=>'L', +119078=>'L', +119082=>'L', +119083=>'L', +119084=>'L', +119085=>'L', +119086=>'L', +119087=>'L', +119088=>'L', +119089=>'L', +119090=>'L', +119091=>'L', +119092=>'L', +119093=>'L', +119094=>'L', +119095=>'L', +119096=>'L', +119097=>'L', +119098=>'L', +119099=>'L', +119100=>'L', +119101=>'L', +119102=>'L', +119103=>'L', +119104=>'L', +119105=>'L', +119106=>'L', +119107=>'L', +119108=>'L', +119109=>'L', +119110=>'L', +119111=>'L', +119112=>'L', +119113=>'L', +119114=>'L', +119115=>'L', +119116=>'L', +119117=>'L', +119118=>'L', +119119=>'L', +119120=>'L', +119121=>'L', +119122=>'L', +119123=>'L', +119124=>'L', +119125=>'L', +119126=>'L', +119127=>'L', +119128=>'L', +119129=>'L', +119130=>'L', +119131=>'L', +119132=>'L', +119133=>'L', +119134=>'L', +119135=>'L', +119136=>'L', +119137=>'L', +119138=>'L', +119139=>'L', +119140=>'L', +119141=>'L', +119142=>'L', +119143=>'NSM', +119144=>'NSM', +119145=>'NSM', +119146=>'L', +119147=>'L', +119148=>'L', +119149=>'L', +119150=>'L', +119151=>'L', +119152=>'L', +119153=>'L', +119154=>'L', +119155=>'BN', +119156=>'BN', +119157=>'BN', +119158=>'BN', +119159=>'BN', +119160=>'BN', +119161=>'BN', +119162=>'BN', +119163=>'NSM', +119164=>'NSM', +119165=>'NSM', +119166=>'NSM', +119167=>'NSM', +119168=>'NSM', +119169=>'NSM', +119170=>'NSM', +119171=>'L', +119172=>'L', +119173=>'NSM', +119174=>'NSM', +119175=>'NSM', +119176=>'NSM', +119177=>'NSM', +119178=>'NSM', +119179=>'NSM', +119180=>'L', +119181=>'L', +119182=>'L', +119183=>'L', +119184=>'L', +119185=>'L', +119186=>'L', +119187=>'L', +119188=>'L', +119189=>'L', +119190=>'L', +119191=>'L', +119192=>'L', +119193=>'L', +119194=>'L', +119195=>'L', +119196=>'L', +119197=>'L', +119198=>'L', +119199=>'L', +119200=>'L', +119201=>'L', +119202=>'L', +119203=>'L', +119204=>'L', +119205=>'L', +119206=>'L', +119207=>'L', +119208=>'L', +119209=>'L', +119210=>'NSM', +119211=>'NSM', +119212=>'NSM', +119213=>'NSM', +119214=>'L', +119215=>'L', +119216=>'L', +119217=>'L', +119218=>'L', +119219=>'L', +119220=>'L', +119221=>'L', +119222=>'L', +119223=>'L', +119224=>'L', +119225=>'L', +119226=>'L', +119227=>'L', +119228=>'L', +119229=>'L', +119230=>'L', +119231=>'L', +119232=>'L', +119233=>'L', +119234=>'L', +119235=>'L', +119236=>'L', +119237=>'L', +119238=>'L', +119239=>'L', +119240=>'L', +119241=>'L', +119242=>'L', +119243=>'L', +119244=>'L', +119245=>'L', +119246=>'L', +119247=>'L', +119248=>'L', +119249=>'L', +119250=>'L', +119251=>'L', +119252=>'L', +119253=>'L', +119254=>'L', +119255=>'L', +119256=>'L', +119257=>'L', +119258=>'L', +119259=>'L', +119260=>'L', +119261=>'L', +119296=>'ON', +119297=>'ON', +119298=>'ON', +119299=>'ON', +119300=>'ON', +119301=>'ON', +119302=>'ON', +119303=>'ON', +119304=>'ON', +119305=>'ON', +119306=>'ON', +119307=>'ON', +119308=>'ON', +119309=>'ON', +119310=>'ON', +119311=>'ON', +119312=>'ON', +119313=>'ON', +119314=>'ON', +119315=>'ON', +119316=>'ON', +119317=>'ON', +119318=>'ON', +119319=>'ON', +119320=>'ON', +119321=>'ON', +119322=>'ON', +119323=>'ON', +119324=>'ON', +119325=>'ON', +119326=>'ON', +119327=>'ON', +119328=>'ON', +119329=>'ON', +119330=>'ON', +119331=>'ON', +119332=>'ON', +119333=>'ON', +119334=>'ON', +119335=>'ON', +119336=>'ON', +119337=>'ON', +119338=>'ON', +119339=>'ON', +119340=>'ON', +119341=>'ON', +119342=>'ON', +119343=>'ON', +119344=>'ON', +119345=>'ON', +119346=>'ON', +119347=>'ON', +119348=>'ON', +119349=>'ON', +119350=>'ON', +119351=>'ON', +119352=>'ON', +119353=>'ON', +119354=>'ON', +119355=>'ON', +119356=>'ON', +119357=>'ON', +119358=>'ON', +119359=>'ON', +119360=>'ON', +119361=>'ON', +119362=>'NSM', +119363=>'NSM', +119364=>'NSM', +119365=>'ON', +119552=>'ON', +119553=>'ON', +119554=>'ON', +119555=>'ON', +119556=>'ON', +119557=>'ON', +119558=>'ON', +119559=>'ON', +119560=>'ON', +119561=>'ON', +119562=>'ON', +119563=>'ON', +119564=>'ON', +119565=>'ON', +119566=>'ON', +119567=>'ON', +119568=>'ON', +119569=>'ON', +119570=>'ON', +119571=>'ON', +119572=>'ON', +119573=>'ON', +119574=>'ON', +119575=>'ON', +119576=>'ON', +119577=>'ON', +119578=>'ON', +119579=>'ON', +119580=>'ON', +119581=>'ON', +119582=>'ON', +119583=>'ON', +119584=>'ON', +119585=>'ON', +119586=>'ON', +119587=>'ON', +119588=>'ON', +119589=>'ON', +119590=>'ON', +119591=>'ON', +119592=>'ON', +119593=>'ON', +119594=>'ON', +119595=>'ON', +119596=>'ON', +119597=>'ON', +119598=>'ON', +119599=>'ON', +119600=>'ON', +119601=>'ON', +119602=>'ON', +119603=>'ON', +119604=>'ON', +119605=>'ON', +119606=>'ON', +119607=>'ON', +119608=>'ON', +119609=>'ON', +119610=>'ON', +119611=>'ON', +119612=>'ON', +119613=>'ON', +119614=>'ON', +119615=>'ON', +119616=>'ON', +119617=>'ON', +119618=>'ON', +119619=>'ON', +119620=>'ON', +119621=>'ON', +119622=>'ON', +119623=>'ON', +119624=>'ON', +119625=>'ON', +119626=>'ON', +119627=>'ON', +119628=>'ON', +119629=>'ON', +119630=>'ON', +119631=>'ON', +119632=>'ON', +119633=>'ON', +119634=>'ON', +119635=>'ON', +119636=>'ON', +119637=>'ON', +119638=>'ON', +119648=>'L', +119649=>'L', +119650=>'L', +119651=>'L', +119652=>'L', +119653=>'L', +119654=>'L', +119655=>'L', +119656=>'L', +119657=>'L', +119658=>'L', +119659=>'L', +119660=>'L', +119661=>'L', +119662=>'L', +119663=>'L', +119664=>'L', +119665=>'L', +119808=>'L', +119809=>'L', +119810=>'L', +119811=>'L', +119812=>'L', +119813=>'L', +119814=>'L', +119815=>'L', +119816=>'L', +119817=>'L', +119818=>'L', +119819=>'L', +119820=>'L', +119821=>'L', +119822=>'L', +119823=>'L', +119824=>'L', +119825=>'L', +119826=>'L', +119827=>'L', +119828=>'L', +119829=>'L', +119830=>'L', +119831=>'L', +119832=>'L', +119833=>'L', +119834=>'L', +119835=>'L', +119836=>'L', +119837=>'L', +119838=>'L', +119839=>'L', +119840=>'L', +119841=>'L', +119842=>'L', +119843=>'L', +119844=>'L', +119845=>'L', +119846=>'L', +119847=>'L', +119848=>'L', +119849=>'L', +119850=>'L', +119851=>'L', +119852=>'L', +119853=>'L', +119854=>'L', +119855=>'L', +119856=>'L', +119857=>'L', +119858=>'L', +119859=>'L', +119860=>'L', +119861=>'L', +119862=>'L', +119863=>'L', +119864=>'L', +119865=>'L', +119866=>'L', +119867=>'L', +119868=>'L', +119869=>'L', +119870=>'L', +119871=>'L', +119872=>'L', +119873=>'L', +119874=>'L', +119875=>'L', +119876=>'L', +119877=>'L', +119878=>'L', +119879=>'L', +119880=>'L', +119881=>'L', +119882=>'L', +119883=>'L', +119884=>'L', +119885=>'L', +119886=>'L', +119887=>'L', +119888=>'L', +119889=>'L', +119890=>'L', +119891=>'L', +119892=>'L', +119894=>'L', +119895=>'L', +119896=>'L', +119897=>'L', +119898=>'L', +119899=>'L', +119900=>'L', +119901=>'L', +119902=>'L', +119903=>'L', +119904=>'L', +119905=>'L', +119906=>'L', +119907=>'L', +119908=>'L', +119909=>'L', +119910=>'L', +119911=>'L', +119912=>'L', +119913=>'L', +119914=>'L', +119915=>'L', +119916=>'L', +119917=>'L', +119918=>'L', +119919=>'L', +119920=>'L', +119921=>'L', +119922=>'L', +119923=>'L', +119924=>'L', +119925=>'L', +119926=>'L', +119927=>'L', +119928=>'L', +119929=>'L', +119930=>'L', +119931=>'L', +119932=>'L', +119933=>'L', +119934=>'L', +119935=>'L', +119936=>'L', +119937=>'L', +119938=>'L', +119939=>'L', +119940=>'L', +119941=>'L', +119942=>'L', +119943=>'L', +119944=>'L', +119945=>'L', +119946=>'L', +119947=>'L', +119948=>'L', +119949=>'L', +119950=>'L', +119951=>'L', +119952=>'L', +119953=>'L', +119954=>'L', +119955=>'L', +119956=>'L', +119957=>'L', +119958=>'L', +119959=>'L', +119960=>'L', +119961=>'L', +119962=>'L', +119963=>'L', +119964=>'L', +119966=>'L', +119967=>'L', +119970=>'L', +119973=>'L', +119974=>'L', +119977=>'L', +119978=>'L', +119979=>'L', +119980=>'L', +119982=>'L', +119983=>'L', +119984=>'L', +119985=>'L', +119986=>'L', +119987=>'L', +119988=>'L', +119989=>'L', +119990=>'L', +119991=>'L', +119992=>'L', +119993=>'L', +119995=>'L', +119997=>'L', +119998=>'L', +119999=>'L', +120000=>'L', +120001=>'L', +120002=>'L', +120003=>'L', +120005=>'L', +120006=>'L', +120007=>'L', +120008=>'L', +120009=>'L', +120010=>'L', +120011=>'L', +120012=>'L', +120013=>'L', +120014=>'L', +120015=>'L', +120016=>'L', +120017=>'L', +120018=>'L', +120019=>'L', +120020=>'L', +120021=>'L', +120022=>'L', +120023=>'L', +120024=>'L', +120025=>'L', +120026=>'L', +120027=>'L', +120028=>'L', +120029=>'L', +120030=>'L', +120031=>'L', +120032=>'L', +120033=>'L', +120034=>'L', +120035=>'L', +120036=>'L', +120037=>'L', +120038=>'L', +120039=>'L', +120040=>'L', +120041=>'L', +120042=>'L', +120043=>'L', +120044=>'L', +120045=>'L', +120046=>'L', +120047=>'L', +120048=>'L', +120049=>'L', +120050=>'L', +120051=>'L', +120052=>'L', +120053=>'L', +120054=>'L', +120055=>'L', +120056=>'L', +120057=>'L', +120058=>'L', +120059=>'L', +120060=>'L', +120061=>'L', +120062=>'L', +120063=>'L', +120064=>'L', +120065=>'L', +120066=>'L', +120067=>'L', +120068=>'L', +120069=>'L', +120071=>'L', +120072=>'L', +120073=>'L', +120074=>'L', +120077=>'L', +120078=>'L', +120079=>'L', +120080=>'L', +120081=>'L', +120082=>'L', +120083=>'L', +120084=>'L', +120086=>'L', +120087=>'L', +120088=>'L', +120089=>'L', +120090=>'L', +120091=>'L', +120092=>'L', +120094=>'L', +120095=>'L', +120096=>'L', +120097=>'L', +120098=>'L', +120099=>'L', +120100=>'L', +120101=>'L', +120102=>'L', +120103=>'L', +120104=>'L', +120105=>'L', +120106=>'L', +120107=>'L', +120108=>'L', +120109=>'L', +120110=>'L', +120111=>'L', +120112=>'L', +120113=>'L', +120114=>'L', +120115=>'L', +120116=>'L', +120117=>'L', +120118=>'L', +120119=>'L', +120120=>'L', +120121=>'L', +120123=>'L', +120124=>'L', +120125=>'L', +120126=>'L', +120128=>'L', +120129=>'L', +120130=>'L', +120131=>'L', +120132=>'L', +120134=>'L', +120138=>'L', +120139=>'L', +120140=>'L', +120141=>'L', +120142=>'L', +120143=>'L', +120144=>'L', +120146=>'L', +120147=>'L', +120148=>'L', +120149=>'L', +120150=>'L', +120151=>'L', +120152=>'L', +120153=>'L', +120154=>'L', +120155=>'L', +120156=>'L', +120157=>'L', +120158=>'L', +120159=>'L', +120160=>'L', +120161=>'L', +120162=>'L', +120163=>'L', +120164=>'L', +120165=>'L', +120166=>'L', +120167=>'L', +120168=>'L', +120169=>'L', +120170=>'L', +120171=>'L', +120172=>'L', +120173=>'L', +120174=>'L', +120175=>'L', +120176=>'L', +120177=>'L', +120178=>'L', +120179=>'L', +120180=>'L', +120181=>'L', +120182=>'L', +120183=>'L', +120184=>'L', +120185=>'L', +120186=>'L', +120187=>'L', +120188=>'L', +120189=>'L', +120190=>'L', +120191=>'L', +120192=>'L', +120193=>'L', +120194=>'L', +120195=>'L', +120196=>'L', +120197=>'L', +120198=>'L', +120199=>'L', +120200=>'L', +120201=>'L', +120202=>'L', +120203=>'L', +120204=>'L', +120205=>'L', +120206=>'L', +120207=>'L', +120208=>'L', +120209=>'L', +120210=>'L', +120211=>'L', +120212=>'L', +120213=>'L', +120214=>'L', +120215=>'L', +120216=>'L', +120217=>'L', +120218=>'L', +120219=>'L', +120220=>'L', +120221=>'L', +120222=>'L', +120223=>'L', +120224=>'L', +120225=>'L', +120226=>'L', +120227=>'L', +120228=>'L', +120229=>'L', +120230=>'L', +120231=>'L', +120232=>'L', +120233=>'L', +120234=>'L', +120235=>'L', +120236=>'L', +120237=>'L', +120238=>'L', +120239=>'L', +120240=>'L', +120241=>'L', +120242=>'L', +120243=>'L', +120244=>'L', +120245=>'L', +120246=>'L', +120247=>'L', +120248=>'L', +120249=>'L', +120250=>'L', +120251=>'L', +120252=>'L', +120253=>'L', +120254=>'L', +120255=>'L', +120256=>'L', +120257=>'L', +120258=>'L', +120259=>'L', +120260=>'L', +120261=>'L', +120262=>'L', +120263=>'L', +120264=>'L', +120265=>'L', +120266=>'L', +120267=>'L', +120268=>'L', +120269=>'L', +120270=>'L', +120271=>'L', +120272=>'L', +120273=>'L', +120274=>'L', +120275=>'L', +120276=>'L', +120277=>'L', +120278=>'L', +120279=>'L', +120280=>'L', +120281=>'L', +120282=>'L', +120283=>'L', +120284=>'L', +120285=>'L', +120286=>'L', +120287=>'L', +120288=>'L', +120289=>'L', +120290=>'L', +120291=>'L', +120292=>'L', +120293=>'L', +120294=>'L', +120295=>'L', +120296=>'L', +120297=>'L', +120298=>'L', +120299=>'L', +120300=>'L', +120301=>'L', +120302=>'L', +120303=>'L', +120304=>'L', +120305=>'L', +120306=>'L', +120307=>'L', +120308=>'L', +120309=>'L', +120310=>'L', +120311=>'L', +120312=>'L', +120313=>'L', +120314=>'L', +120315=>'L', +120316=>'L', +120317=>'L', +120318=>'L', +120319=>'L', +120320=>'L', +120321=>'L', +120322=>'L', +120323=>'L', +120324=>'L', +120325=>'L', +120326=>'L', +120327=>'L', +120328=>'L', +120329=>'L', +120330=>'L', +120331=>'L', +120332=>'L', +120333=>'L', +120334=>'L', +120335=>'L', +120336=>'L', +120337=>'L', +120338=>'L', +120339=>'L', +120340=>'L', +120341=>'L', +120342=>'L', +120343=>'L', +120344=>'L', +120345=>'L', +120346=>'L', +120347=>'L', +120348=>'L', +120349=>'L', +120350=>'L', +120351=>'L', +120352=>'L', +120353=>'L', +120354=>'L', +120355=>'L', +120356=>'L', +120357=>'L', +120358=>'L', +120359=>'L', +120360=>'L', +120361=>'L', +120362=>'L', +120363=>'L', +120364=>'L', +120365=>'L', +120366=>'L', +120367=>'L', +120368=>'L', +120369=>'L', +120370=>'L', +120371=>'L', +120372=>'L', +120373=>'L', +120374=>'L', +120375=>'L', +120376=>'L', +120377=>'L', +120378=>'L', +120379=>'L', +120380=>'L', +120381=>'L', +120382=>'L', +120383=>'L', +120384=>'L', +120385=>'L', +120386=>'L', +120387=>'L', +120388=>'L', +120389=>'L', +120390=>'L', +120391=>'L', +120392=>'L', +120393=>'L', +120394=>'L', +120395=>'L', +120396=>'L', +120397=>'L', +120398=>'L', +120399=>'L', +120400=>'L', +120401=>'L', +120402=>'L', +120403=>'L', +120404=>'L', +120405=>'L', +120406=>'L', +120407=>'L', +120408=>'L', +120409=>'L', +120410=>'L', +120411=>'L', +120412=>'L', +120413=>'L', +120414=>'L', +120415=>'L', +120416=>'L', +120417=>'L', +120418=>'L', +120419=>'L', +120420=>'L', +120421=>'L', +120422=>'L', +120423=>'L', +120424=>'L', +120425=>'L', +120426=>'L', +120427=>'L', +120428=>'L', +120429=>'L', +120430=>'L', +120431=>'L', +120432=>'L', +120433=>'L', +120434=>'L', +120435=>'L', +120436=>'L', +120437=>'L', +120438=>'L', +120439=>'L', +120440=>'L', +120441=>'L', +120442=>'L', +120443=>'L', +120444=>'L', +120445=>'L', +120446=>'L', +120447=>'L', +120448=>'L', +120449=>'L', +120450=>'L', +120451=>'L', +120452=>'L', +120453=>'L', +120454=>'L', +120455=>'L', +120456=>'L', +120457=>'L', +120458=>'L', +120459=>'L', +120460=>'L', +120461=>'L', +120462=>'L', +120463=>'L', +120464=>'L', +120465=>'L', +120466=>'L', +120467=>'L', +120468=>'L', +120469=>'L', +120470=>'L', +120471=>'L', +120472=>'L', +120473=>'L', +120474=>'L', +120475=>'L', +120476=>'L', +120477=>'L', +120478=>'L', +120479=>'L', +120480=>'L', +120481=>'L', +120482=>'L', +120483=>'L', +120484=>'L', +120485=>'L', +120488=>'L', +120489=>'L', +120490=>'L', +120491=>'L', +120492=>'L', +120493=>'L', +120494=>'L', +120495=>'L', +120496=>'L', +120497=>'L', +120498=>'L', +120499=>'L', +120500=>'L', +120501=>'L', +120502=>'L', +120503=>'L', +120504=>'L', +120505=>'L', +120506=>'L', +120507=>'L', +120508=>'L', +120509=>'L', +120510=>'L', +120511=>'L', +120512=>'L', +120513=>'L', +120514=>'L', +120515=>'L', +120516=>'L', +120517=>'L', +120518=>'L', +120519=>'L', +120520=>'L', +120521=>'L', +120522=>'L', +120523=>'L', +120524=>'L', +120525=>'L', +120526=>'L', +120527=>'L', +120528=>'L', +120529=>'L', +120530=>'L', +120531=>'L', +120532=>'L', +120533=>'L', +120534=>'L', +120535=>'L', +120536=>'L', +120537=>'L', +120538=>'L', +120539=>'L', +120540=>'L', +120541=>'L', +120542=>'L', +120543=>'L', +120544=>'L', +120545=>'L', +120546=>'L', +120547=>'L', +120548=>'L', +120549=>'L', +120550=>'L', +120551=>'L', +120552=>'L', +120553=>'L', +120554=>'L', +120555=>'L', +120556=>'L', +120557=>'L', +120558=>'L', +120559=>'L', +120560=>'L', +120561=>'L', +120562=>'L', +120563=>'L', +120564=>'L', +120565=>'L', +120566=>'L', +120567=>'L', +120568=>'L', +120569=>'L', +120570=>'L', +120571=>'L', +120572=>'L', +120573=>'L', +120574=>'L', +120575=>'L', +120576=>'L', +120577=>'L', +120578=>'L', +120579=>'L', +120580=>'L', +120581=>'L', +120582=>'L', +120583=>'L', +120584=>'L', +120585=>'L', +120586=>'L', +120587=>'L', +120588=>'L', +120589=>'L', +120590=>'L', +120591=>'L', +120592=>'L', +120593=>'L', +120594=>'L', +120595=>'L', +120596=>'L', +120597=>'L', +120598=>'L', +120599=>'L', +120600=>'L', +120601=>'L', +120602=>'L', +120603=>'L', +120604=>'L', +120605=>'L', +120606=>'L', +120607=>'L', +120608=>'L', +120609=>'L', +120610=>'L', +120611=>'L', +120612=>'L', +120613=>'L', +120614=>'L', +120615=>'L', +120616=>'L', +120617=>'L', +120618=>'L', +120619=>'L', +120620=>'L', +120621=>'L', +120622=>'L', +120623=>'L', +120624=>'L', +120625=>'L', +120626=>'L', +120627=>'L', +120628=>'L', +120629=>'L', +120630=>'L', +120631=>'L', +120632=>'L', +120633=>'L', +120634=>'L', +120635=>'L', +120636=>'L', +120637=>'L', +120638=>'L', +120639=>'L', +120640=>'L', +120641=>'L', +120642=>'L', +120643=>'L', +120644=>'L', +120645=>'L', +120646=>'L', +120647=>'L', +120648=>'L', +120649=>'L', +120650=>'L', +120651=>'L', +120652=>'L', +120653=>'L', +120654=>'L', +120655=>'L', +120656=>'L', +120657=>'L', +120658=>'L', +120659=>'L', +120660=>'L', +120661=>'L', +120662=>'L', +120663=>'L', +120664=>'L', +120665=>'L', +120666=>'L', +120667=>'L', +120668=>'L', +120669=>'L', +120670=>'L', +120671=>'L', +120672=>'L', +120673=>'L', +120674=>'L', +120675=>'L', +120676=>'L', +120677=>'L', +120678=>'L', +120679=>'L', +120680=>'L', +120681=>'L', +120682=>'L', +120683=>'L', +120684=>'L', +120685=>'L', +120686=>'L', +120687=>'L', +120688=>'L', +120689=>'L', +120690=>'L', +120691=>'L', +120692=>'L', +120693=>'L', +120694=>'L', +120695=>'L', +120696=>'L', +120697=>'L', +120698=>'L', +120699=>'L', +120700=>'L', +120701=>'L', +120702=>'L', +120703=>'L', +120704=>'L', +120705=>'L', +120706=>'L', +120707=>'L', +120708=>'L', +120709=>'L', +120710=>'L', +120711=>'L', +120712=>'L', +120713=>'L', +120714=>'L', +120715=>'L', +120716=>'L', +120717=>'L', +120718=>'L', +120719=>'L', +120720=>'L', +120721=>'L', +120722=>'L', +120723=>'L', +120724=>'L', +120725=>'L', +120726=>'L', +120727=>'L', +120728=>'L', +120729=>'L', +120730=>'L', +120731=>'L', +120732=>'L', +120733=>'L', +120734=>'L', +120735=>'L', +120736=>'L', +120737=>'L', +120738=>'L', +120739=>'L', +120740=>'L', +120741=>'L', +120742=>'L', +120743=>'L', +120744=>'L', +120745=>'L', +120746=>'L', +120747=>'L', +120748=>'L', +120749=>'L', +120750=>'L', +120751=>'L', +120752=>'L', +120753=>'L', +120754=>'L', +120755=>'L', +120756=>'L', +120757=>'L', +120758=>'L', +120759=>'L', +120760=>'L', +120761=>'L', +120762=>'L', +120763=>'L', +120764=>'L', +120765=>'L', +120766=>'L', +120767=>'L', +120768=>'L', +120769=>'L', +120770=>'L', +120771=>'L', +120772=>'L', +120773=>'L', +120774=>'L', +120775=>'L', +120776=>'L', +120777=>'L', +120778=>'L', +120779=>'L', +120782=>'EN', +120783=>'EN', +120784=>'EN', +120785=>'EN', +120786=>'EN', +120787=>'EN', +120788=>'EN', +120789=>'EN', +120790=>'EN', +120791=>'EN', +120792=>'EN', +120793=>'EN', +120794=>'EN', +120795=>'EN', +120796=>'EN', +120797=>'EN', +120798=>'EN', +120799=>'EN', +120800=>'EN', +120801=>'EN', +120802=>'EN', +120803=>'EN', +120804=>'EN', +120805=>'EN', +120806=>'EN', +120807=>'EN', +120808=>'EN', +120809=>'EN', +120810=>'EN', +120811=>'EN', +120812=>'EN', +120813=>'EN', +120814=>'EN', +120815=>'EN', +120816=>'EN', +120817=>'EN', +120818=>'EN', +120819=>'EN', +120820=>'EN', +120821=>'EN', +120822=>'EN', +120823=>'EN', +120824=>'EN', +120825=>'EN', +120826=>'EN', +120827=>'EN', +120828=>'EN', +120829=>'EN', +120830=>'EN', +120831=>'EN', +131072=>'L', +173782=>'L', +194560=>'L', +194561=>'L', +194562=>'L', +194563=>'L', +194564=>'L', +194565=>'L', +194566=>'L', +194567=>'L', +194568=>'L', +194569=>'L', +194570=>'L', +194571=>'L', +194572=>'L', +194573=>'L', +194574=>'L', +194575=>'L', +194576=>'L', +194577=>'L', +194578=>'L', +194579=>'L', +194580=>'L', +194581=>'L', +194582=>'L', +194583=>'L', +194584=>'L', +194585=>'L', +194586=>'L', +194587=>'L', +194588=>'L', +194589=>'L', +194590=>'L', +194591=>'L', +194592=>'L', +194593=>'L', +194594=>'L', +194595=>'L', +194596=>'L', +194597=>'L', +194598=>'L', +194599=>'L', +194600=>'L', +194601=>'L', +194602=>'L', +194603=>'L', +194604=>'L', +194605=>'L', +194606=>'L', +194607=>'L', +194608=>'L', +194609=>'L', +194610=>'L', +194611=>'L', +194612=>'L', +194613=>'L', +194614=>'L', +194615=>'L', +194616=>'L', +194617=>'L', +194618=>'L', +194619=>'L', +194620=>'L', +194621=>'L', +194622=>'L', +194623=>'L', +194624=>'L', +194625=>'L', +194626=>'L', +194627=>'L', +194628=>'L', +194629=>'L', +194630=>'L', +194631=>'L', +194632=>'L', +194633=>'L', +194634=>'L', +194635=>'L', +194636=>'L', +194637=>'L', +194638=>'L', +194639=>'L', +194640=>'L', +194641=>'L', +194642=>'L', +194643=>'L', +194644=>'L', +194645=>'L', +194646=>'L', +194647=>'L', +194648=>'L', +194649=>'L', +194650=>'L', +194651=>'L', +194652=>'L', +194653=>'L', +194654=>'L', +194655=>'L', +194656=>'L', +194657=>'L', +194658=>'L', +194659=>'L', +194660=>'L', +194661=>'L', +194662=>'L', +194663=>'L', +194664=>'L', +194665=>'L', +194666=>'L', +194667=>'L', +194668=>'L', +194669=>'L', +194670=>'L', +194671=>'L', +194672=>'L', +194673=>'L', +194674=>'L', +194675=>'L', +194676=>'L', +194677=>'L', +194678=>'L', +194679=>'L', +194680=>'L', +194681=>'L', +194682=>'L', +194683=>'L', +194684=>'L', +194685=>'L', +194686=>'L', +194687=>'L', +194688=>'L', +194689=>'L', +194690=>'L', +194691=>'L', +194692=>'L', +194693=>'L', +194694=>'L', +194695=>'L', +194696=>'L', +194697=>'L', +194698=>'L', +194699=>'L', +194700=>'L', +194701=>'L', +194702=>'L', +194703=>'L', +194704=>'L', +194705=>'L', +194706=>'L', +194707=>'L', +194708=>'L', +194709=>'L', +194710=>'L', +194711=>'L', +194712=>'L', +194713=>'L', +194714=>'L', +194715=>'L', +194716=>'L', +194717=>'L', +194718=>'L', +194719=>'L', +194720=>'L', +194721=>'L', +194722=>'L', +194723=>'L', +194724=>'L', +194725=>'L', +194726=>'L', +194727=>'L', +194728=>'L', +194729=>'L', +194730=>'L', +194731=>'L', +194732=>'L', +194733=>'L', +194734=>'L', +194735=>'L', +194736=>'L', +194737=>'L', +194738=>'L', +194739=>'L', +194740=>'L', +194741=>'L', +194742=>'L', +194743=>'L', +194744=>'L', +194745=>'L', +194746=>'L', +194747=>'L', +194748=>'L', +194749=>'L', +194750=>'L', +194751=>'L', +194752=>'L', +194753=>'L', +194754=>'L', +194755=>'L', +194756=>'L', +194757=>'L', +194758=>'L', +194759=>'L', +194760=>'L', +194761=>'L', +194762=>'L', +194763=>'L', +194764=>'L', +194765=>'L', +194766=>'L', +194767=>'L', +194768=>'L', +194769=>'L', +194770=>'L', +194771=>'L', +194772=>'L', +194773=>'L', +194774=>'L', +194775=>'L', +194776=>'L', +194777=>'L', +194778=>'L', +194779=>'L', +194780=>'L', +194781=>'L', +194782=>'L', +194783=>'L', +194784=>'L', +194785=>'L', +194786=>'L', +194787=>'L', +194788=>'L', +194789=>'L', +194790=>'L', +194791=>'L', +194792=>'L', +194793=>'L', +194794=>'L', +194795=>'L', +194796=>'L', +194797=>'L', +194798=>'L', +194799=>'L', +194800=>'L', +194801=>'L', +194802=>'L', +194803=>'L', +194804=>'L', +194805=>'L', +194806=>'L', +194807=>'L', +194808=>'L', +194809=>'L', +194810=>'L', +194811=>'L', +194812=>'L', +194813=>'L', +194814=>'L', +194815=>'L', +194816=>'L', +194817=>'L', +194818=>'L', +194819=>'L', +194820=>'L', +194821=>'L', +194822=>'L', +194823=>'L', +194824=>'L', +194825=>'L', +194826=>'L', +194827=>'L', +194828=>'L', +194829=>'L', +194830=>'L', +194831=>'L', +194832=>'L', +194833=>'L', +194834=>'L', +194835=>'L', +194836=>'L', +194837=>'L', +194838=>'L', +194839=>'L', +194840=>'L', +194841=>'L', +194842=>'L', +194843=>'L', +194844=>'L', +194845=>'L', +194846=>'L', +194847=>'L', +194848=>'L', +194849=>'L', +194850=>'L', +194851=>'L', +194852=>'L', +194853=>'L', +194854=>'L', +194855=>'L', +194856=>'L', +194857=>'L', +194858=>'L', +194859=>'L', +194860=>'L', +194861=>'L', +194862=>'L', +194863=>'L', +194864=>'L', +194865=>'L', +194866=>'L', +194867=>'L', +194868=>'L', +194869=>'L', +194870=>'L', +194871=>'L', +194872=>'L', +194873=>'L', +194874=>'L', +194875=>'L', +194876=>'L', +194877=>'L', +194878=>'L', +194879=>'L', +194880=>'L', +194881=>'L', +194882=>'L', +194883=>'L', +194884=>'L', +194885=>'L', +194886=>'L', +194887=>'L', +194888=>'L', +194889=>'L', +194890=>'L', +194891=>'L', +194892=>'L', +194893=>'L', +194894=>'L', +194895=>'L', +194896=>'L', +194897=>'L', +194898=>'L', +194899=>'L', +194900=>'L', +194901=>'L', +194902=>'L', +194903=>'L', +194904=>'L', +194905=>'L', +194906=>'L', +194907=>'L', +194908=>'L', +194909=>'L', +194910=>'L', +194911=>'L', +194912=>'L', +194913=>'L', +194914=>'L', +194915=>'L', +194916=>'L', +194917=>'L', +194918=>'L', +194919=>'L', +194920=>'L', +194921=>'L', +194922=>'L', +194923=>'L', +194924=>'L', +194925=>'L', +194926=>'L', +194927=>'L', +194928=>'L', +194929=>'L', +194930=>'L', +194931=>'L', +194932=>'L', +194933=>'L', +194934=>'L', +194935=>'L', +194936=>'L', +194937=>'L', +194938=>'L', +194939=>'L', +194940=>'L', +194941=>'L', +194942=>'L', +194943=>'L', +194944=>'L', +194945=>'L', +194946=>'L', +194947=>'L', +194948=>'L', +194949=>'L', +194950=>'L', +194951=>'L', +194952=>'L', +194953=>'L', +194954=>'L', +194955=>'L', +194956=>'L', +194957=>'L', +194958=>'L', +194959=>'L', +194960=>'L', +194961=>'L', +194962=>'L', +194963=>'L', +194964=>'L', +194965=>'L', +194966=>'L', +194967=>'L', +194968=>'L', +194969=>'L', +194970=>'L', +194971=>'L', +194972=>'L', +194973=>'L', +194974=>'L', +194975=>'L', +194976=>'L', +194977=>'L', +194978=>'L', +194979=>'L', +194980=>'L', +194981=>'L', +194982=>'L', +194983=>'L', +194984=>'L', +194985=>'L', +194986=>'L', +194987=>'L', +194988=>'L', +194989=>'L', +194990=>'L', +194991=>'L', +194992=>'L', +194993=>'L', +194994=>'L', +194995=>'L', +194996=>'L', +194997=>'L', +194998=>'L', +194999=>'L', +195000=>'L', +195001=>'L', +195002=>'L', +195003=>'L', +195004=>'L', +195005=>'L', +195006=>'L', +195007=>'L', +195008=>'L', +195009=>'L', +195010=>'L', +195011=>'L', +195012=>'L', +195013=>'L', +195014=>'L', +195015=>'L', +195016=>'L', +195017=>'L', +195018=>'L', +195019=>'L', +195020=>'L', +195021=>'L', +195022=>'L', +195023=>'L', +195024=>'L', +195025=>'L', +195026=>'L', +195027=>'L', +195028=>'L', +195029=>'L', +195030=>'L', +195031=>'L', +195032=>'L', +195033=>'L', +195034=>'L', +195035=>'L', +195036=>'L', +195037=>'L', +195038=>'L', +195039=>'L', +195040=>'L', +195041=>'L', +195042=>'L', +195043=>'L', +195044=>'L', +195045=>'L', +195046=>'L', +195047=>'L', +195048=>'L', +195049=>'L', +195050=>'L', +195051=>'L', +195052=>'L', +195053=>'L', +195054=>'L', +195055=>'L', +195056=>'L', +195057=>'L', +195058=>'L', +195059=>'L', +195060=>'L', +195061=>'L', +195062=>'L', +195063=>'L', +195064=>'L', +195065=>'L', +195066=>'L', +195067=>'L', +195068=>'L', +195069=>'L', +195070=>'L', +195071=>'L', +195072=>'L', +195073=>'L', +195074=>'L', +195075=>'L', +195076=>'L', +195077=>'L', +195078=>'L', +195079=>'L', +195080=>'L', +195081=>'L', +195082=>'L', +195083=>'L', +195084=>'L', +195085=>'L', +195086=>'L', +195087=>'L', +195088=>'L', +195089=>'L', +195090=>'L', +195091=>'L', +195092=>'L', +195093=>'L', +195094=>'L', +195095=>'L', +195096=>'L', +195097=>'L', +195098=>'L', +195099=>'L', +195100=>'L', +195101=>'L', +917505=>'BN', +917536=>'BN', +917537=>'BN', +917538=>'BN', +917539=>'BN', +917540=>'BN', +917541=>'BN', +917542=>'BN', +917543=>'BN', +917544=>'BN', +917545=>'BN', +917546=>'BN', +917547=>'BN', +917548=>'BN', +917549=>'BN', +917550=>'BN', +917551=>'BN', +917552=>'BN', +917553=>'BN', +917554=>'BN', +917555=>'BN', +917556=>'BN', +917557=>'BN', +917558=>'BN', +917559=>'BN', +917560=>'BN', +917561=>'BN', +917562=>'BN', +917563=>'BN', +917564=>'BN', +917565=>'BN', +917566=>'BN', +917567=>'BN', +917568=>'BN', +917569=>'BN', +917570=>'BN', +917571=>'BN', +917572=>'BN', +917573=>'BN', +917574=>'BN', +917575=>'BN', +917576=>'BN', +917577=>'BN', +917578=>'BN', +917579=>'BN', +917580=>'BN', +917581=>'BN', +917582=>'BN', +917583=>'BN', +917584=>'BN', +917585=>'BN', +917586=>'BN', +917587=>'BN', +917588=>'BN', +917589=>'BN', +917590=>'BN', +917591=>'BN', +917592=>'BN', +917593=>'BN', +917594=>'BN', +917595=>'BN', +917596=>'BN', +917597=>'BN', +917598=>'BN', +917599=>'BN', +917600=>'BN', +917601=>'BN', +917602=>'BN', +917603=>'BN', +917604=>'BN', +917605=>'BN', +917606=>'BN', +917607=>'BN', +917608=>'BN', +917609=>'BN', +917610=>'BN', +917611=>'BN', +917612=>'BN', +917613=>'BN', +917614=>'BN', +917615=>'BN', +917616=>'BN', +917617=>'BN', +917618=>'BN', +917619=>'BN', +917620=>'BN', +917621=>'BN', +917622=>'BN', +917623=>'BN', +917624=>'BN', +917625=>'BN', +917626=>'BN', +917627=>'BN', +917628=>'BN', +917629=>'BN', +917630=>'BN', +917631=>'BN', +917760=>'NSM', +917761=>'NSM', +917762=>'NSM', +917763=>'NSM', +917764=>'NSM', +917765=>'NSM', +917766=>'NSM', +917767=>'NSM', +917768=>'NSM', +917769=>'NSM', +917770=>'NSM', +917771=>'NSM', +917772=>'NSM', +917773=>'NSM', +917774=>'NSM', +917775=>'NSM', +917776=>'NSM', +917777=>'NSM', +917778=>'NSM', +917779=>'NSM', +917780=>'NSM', +917781=>'NSM', +917782=>'NSM', +917783=>'NSM', +917784=>'NSM', +917785=>'NSM', +917786=>'NSM', +917787=>'NSM', +917788=>'NSM', +917789=>'NSM', +917790=>'NSM', +917791=>'NSM', +917792=>'NSM', +917793=>'NSM', +917794=>'NSM', +917795=>'NSM', +917796=>'NSM', +917797=>'NSM', +917798=>'NSM', +917799=>'NSM', +917800=>'NSM', +917801=>'NSM', +917802=>'NSM', +917803=>'NSM', +917804=>'NSM', +917805=>'NSM', +917806=>'NSM', +917807=>'NSM', +917808=>'NSM', +917809=>'NSM', +917810=>'NSM', +917811=>'NSM', +917812=>'NSM', +917813=>'NSM', +917814=>'NSM', +917815=>'NSM', +917816=>'NSM', +917817=>'NSM', +917818=>'NSM', +917819=>'NSM', +917820=>'NSM', +917821=>'NSM', +917822=>'NSM', +917823=>'NSM', +917824=>'NSM', +917825=>'NSM', +917826=>'NSM', +917827=>'NSM', +917828=>'NSM', +917829=>'NSM', +917830=>'NSM', +917831=>'NSM', +917832=>'NSM', +917833=>'NSM', +917834=>'NSM', +917835=>'NSM', +917836=>'NSM', +917837=>'NSM', +917838=>'NSM', +917839=>'NSM', +917840=>'NSM', +917841=>'NSM', +917842=>'NSM', +917843=>'NSM', +917844=>'NSM', +917845=>'NSM', +917846=>'NSM', +917847=>'NSM', +917848=>'NSM', +917849=>'NSM', +917850=>'NSM', +917851=>'NSM', +917852=>'NSM', +917853=>'NSM', +917854=>'NSM', +917855=>'NSM', +917856=>'NSM', +917857=>'NSM', +917858=>'NSM', +917859=>'NSM', +917860=>'NSM', +917861=>'NSM', +917862=>'NSM', +917863=>'NSM', +917864=>'NSM', +917865=>'NSM', +917866=>'NSM', +917867=>'NSM', +917868=>'NSM', +917869=>'NSM', +917870=>'NSM', +917871=>'NSM', +917872=>'NSM', +917873=>'NSM', +917874=>'NSM', +917875=>'NSM', +917876=>'NSM', +917877=>'NSM', +917878=>'NSM', +917879=>'NSM', +917880=>'NSM', +917881=>'NSM', +917882=>'NSM', +917883=>'NSM', +917884=>'NSM', +917885=>'NSM', +917886=>'NSM', +917887=>'NSM', +917888=>'NSM', +917889=>'NSM', +917890=>'NSM', +917891=>'NSM', +917892=>'NSM', +917893=>'NSM', +917894=>'NSM', +917895=>'NSM', +917896=>'NSM', +917897=>'NSM', +917898=>'NSM', +917899=>'NSM', +917900=>'NSM', +917901=>'NSM', +917902=>'NSM', +917903=>'NSM', +917904=>'NSM', +917905=>'NSM', +917906=>'NSM', +917907=>'NSM', +917908=>'NSM', +917909=>'NSM', +917910=>'NSM', +917911=>'NSM', +917912=>'NSM', +917913=>'NSM', +917914=>'NSM', +917915=>'NSM', +917916=>'NSM', +917917=>'NSM', +917918=>'NSM', +917919=>'NSM', +917920=>'NSM', +917921=>'NSM', +917922=>'NSM', +917923=>'NSM', +917924=>'NSM', +917925=>'NSM', +917926=>'NSM', +917927=>'NSM', +917928=>'NSM', +917929=>'NSM', +917930=>'NSM', +917931=>'NSM', +917932=>'NSM', +917933=>'NSM', +917934=>'NSM', +917935=>'NSM', +917936=>'NSM', +917937=>'NSM', +917938=>'NSM', +917939=>'NSM', +917940=>'NSM', +917941=>'NSM', +917942=>'NSM', +917943=>'NSM', +917944=>'NSM', +917945=>'NSM', +917946=>'NSM', +917947=>'NSM', +917948=>'NSM', +917949=>'NSM', +917950=>'NSM', +917951=>'NSM', +917952=>'NSM', +917953=>'NSM', +917954=>'NSM', +917955=>'NSM', +917956=>'NSM', +917957=>'NSM', +917958=>'NSM', +917959=>'NSM', +917960=>'NSM', +917961=>'NSM', +917962=>'NSM', +917963=>'NSM', +917964=>'NSM', +917965=>'NSM', +917966=>'NSM', +917967=>'NSM', +917968=>'NSM', +917969=>'NSM', +917970=>'NSM', +917971=>'NSM', +917972=>'NSM', +917973=>'NSM', +917974=>'NSM', +917975=>'NSM', +917976=>'NSM', +917977=>'NSM', +917978=>'NSM', +917979=>'NSM', +917980=>'NSM', +917981=>'NSM', +917982=>'NSM', +917983=>'NSM', +917984=>'NSM', +917985=>'NSM', +917986=>'NSM', +917987=>'NSM', +917988=>'NSM', +917989=>'NSM', +917990=>'NSM', +917991=>'NSM', +917992=>'NSM', +917993=>'NSM', +917994=>'NSM', +917995=>'NSM', +917996=>'NSM', +917997=>'NSM', +917998=>'NSM', +917999=>'NSM', +983040=>'L', +1048573=>'L', +1048576=>'L', +1114109=>'L' +); + +/** + * Mirror unicode characters. For information on bidi mirroring, see UAX #9: Bidirectional Algorithm, at http://www.unicode.org/unicode/reports/tr9/ + * @public + */ +public static $uni_mirror = array ( +0x0028=>0x0029, +0x0029=>0x0028, +0x003C=>0x003E, +0x003E=>0x003C, +0x005B=>0x005D, +0x005D=>0x005B, +0x007B=>0x007D, +0x007D=>0x007B, +0x00AB=>0x00BB, +0x00BB=>0x00AB, +0x0F3A=>0x0F3B, +0x0F3B=>0x0F3A, +0x0F3C=>0x0F3D, +0x0F3D=>0x0F3C, +0x169B=>0x169C, +0x169C=>0x169B, +0x2018=>0x2019, +0x2019=>0x2018, +0x201C=>0x201D, +0x201D=>0x201C, +0x2039=>0x203A, +0x203A=>0x2039, +0x2045=>0x2046, +0x2046=>0x2045, +0x207D=>0x207E, +0x207E=>0x207D, +0x208D=>0x208E, +0x208E=>0x208D, +0x2208=>0x220B, +0x2209=>0x220C, +0x220A=>0x220D, +0x220B=>0x2208, +0x220C=>0x2209, +0x220D=>0x220A, +0x2215=>0x29F5, +0x223C=>0x223D, +0x223D=>0x223C, +0x2243=>0x22CD, +0x2252=>0x2253, +0x2253=>0x2252, +0x2254=>0x2255, +0x2255=>0x2254, +0x2264=>0x2265, +0x2265=>0x2264, +0x2266=>0x2267, +0x2267=>0x2266, +0x2268=>0x2269, +0x2269=>0x2268, +0x226A=>0x226B, +0x226B=>0x226A, +0x226E=>0x226F, +0x226F=>0x226E, +0x2270=>0x2271, +0x2271=>0x2270, +0x2272=>0x2273, +0x2273=>0x2272, +0x2274=>0x2275, +0x2275=>0x2274, +0x2276=>0x2277, +0x2277=>0x2276, +0x2278=>0x2279, +0x2279=>0x2278, +0x227A=>0x227B, +0x227B=>0x227A, +0x227C=>0x227D, +0x227D=>0x227C, +0x227E=>0x227F, +0x227F=>0x227E, +0x2280=>0x2281, +0x2281=>0x2280, +0x2282=>0x2283, +0x2283=>0x2282, +0x2284=>0x2285, +0x2285=>0x2284, +0x2286=>0x2287, +0x2287=>0x2286, +0x2288=>0x2289, +0x2289=>0x2288, +0x228A=>0x228B, +0x228B=>0x228A, +0x228F=>0x2290, +0x2290=>0x228F, +0x2291=>0x2292, +0x2292=>0x2291, +0x2298=>0x29B8, +0x22A2=>0x22A3, +0x22A3=>0x22A2, +0x22A6=>0x2ADE, +0x22A8=>0x2AE4, +0x22A9=>0x2AE3, +0x22AB=>0x2AE5, +0x22B0=>0x22B1, +0x22B1=>0x22B0, +0x22B2=>0x22B3, +0x22B3=>0x22B2, +0x22B4=>0x22B5, +0x22B5=>0x22B4, +0x22B6=>0x22B7, +0x22B7=>0x22B6, +0x22C9=>0x22CA, +0x22CA=>0x22C9, +0x22CB=>0x22CC, +0x22CC=>0x22CB, +0x22CD=>0x2243, +0x22D0=>0x22D1, +0x22D1=>0x22D0, +0x22D6=>0x22D7, +0x22D7=>0x22D6, +0x22D8=>0x22D9, +0x22D9=>0x22D8, +0x22DA=>0x22DB, +0x22DB=>0x22DA, +0x22DC=>0x22DD, +0x22DD=>0x22DC, +0x22DE=>0x22DF, +0x22DF=>0x22DE, +0x22E0=>0x22E1, +0x22E1=>0x22E0, +0x22E2=>0x22E3, +0x22E3=>0x22E2, +0x22E4=>0x22E5, +0x22E5=>0x22E4, +0x22E6=>0x22E7, +0x22E7=>0x22E6, +0x22E8=>0x22E9, +0x22E9=>0x22E8, +0x22EA=>0x22EB, +0x22EB=>0x22EA, +0x22EC=>0x22ED, +0x22ED=>0x22EC, +0x22F0=>0x22F1, +0x22F1=>0x22F0, +0x22F2=>0x22FA, +0x22F3=>0x22FB, +0x22F4=>0x22FC, +0x22F6=>0x22FD, +0x22F7=>0x22FE, +0x22FA=>0x22F2, +0x22FB=>0x22F3, +0x22FC=>0x22F4, +0x22FD=>0x22F6, +0x22FE=>0x22F7, +0x2308=>0x2309, +0x2309=>0x2308, +0x230A=>0x230B, +0x230B=>0x230A, +0x2329=>0x232A, +0x232A=>0x2329, +0x2768=>0x2769, +0x2769=>0x2768, +0x276A=>0x276B, +0x276B=>0x276A, +0x276C=>0x276D, +0x276D=>0x276C, +0x276E=>0x276F, +0x276F=>0x276E, +0x2770=>0x2771, +0x2771=>0x2770, +0x2772=>0x2773, +0x2773=>0x2772, +0x2774=>0x2775, +0x2775=>0x2774, +0x27C3=>0x27C4, +0x27C4=>0x27C3, +0x27C5=>0x27C6, +0x27C6=>0x27C5, +0x27D5=>0x27D6, +0x27D6=>0x27D5, +0x27DD=>0x27DE, +0x27DE=>0x27DD, +0x27E2=>0x27E3, +0x27E3=>0x27E2, +0x27E4=>0x27E5, +0x27E5=>0x27E4, +0x27E6=>0x27E7, +0x27E7=>0x27E6, +0x27E8=>0x27E9, +0x27E9=>0x27E8, +0x27EA=>0x27EB, +0x27EB=>0x27EA, +0x2983=>0x2984, +0x2984=>0x2983, +0x2985=>0x2986, +0x2986=>0x2985, +0x2987=>0x2988, +0x2988=>0x2987, +0x2989=>0x298A, +0x298A=>0x2989, +0x298B=>0x298C, +0x298C=>0x298B, +0x298D=>0x2990, +0x298E=>0x298F, +0x298F=>0x298E, +0x2990=>0x298D, +0x2991=>0x2992, +0x2992=>0x2991, +0x2993=>0x2994, +0x2994=>0x2993, +0x2995=>0x2996, +0x2996=>0x2995, +0x2997=>0x2998, +0x2998=>0x2997, +0x29B8=>0x2298, +0x29C0=>0x29C1, +0x29C1=>0x29C0, +0x29C4=>0x29C5, +0x29C5=>0x29C4, +0x29CF=>0x29D0, +0x29D0=>0x29CF, +0x29D1=>0x29D2, +0x29D2=>0x29D1, +0x29D4=>0x29D5, +0x29D5=>0x29D4, +0x29D8=>0x29D9, +0x29D9=>0x29D8, +0x29DA=>0x29DB, +0x29DB=>0x29DA, +0x29F5=>0x2215, +0x29F8=>0x29F9, +0x29F9=>0x29F8, +0x29FC=>0x29FD, +0x29FD=>0x29FC, +0x2A2B=>0x2A2C, +0x2A2C=>0x2A2B, +0x2A2D=>0x2A2E, +0x2A2E=>0x2A2D, +0x2A34=>0x2A35, +0x2A35=>0x2A34, +0x2A3C=>0x2A3D, +0x2A3D=>0x2A3C, +0x2A64=>0x2A65, +0x2A65=>0x2A64, +0x2A79=>0x2A7A, +0x2A7A=>0x2A79, +0x2A7D=>0x2A7E, +0x2A7E=>0x2A7D, +0x2A7F=>0x2A80, +0x2A80=>0x2A7F, +0x2A81=>0x2A82, +0x2A82=>0x2A81, +0x2A83=>0x2A84, +0x2A84=>0x2A83, +0x2A8B=>0x2A8C, +0x2A8C=>0x2A8B, +0x2A91=>0x2A92, +0x2A92=>0x2A91, +0x2A93=>0x2A94, +0x2A94=>0x2A93, +0x2A95=>0x2A96, +0x2A96=>0x2A95, +0x2A97=>0x2A98, +0x2A98=>0x2A97, +0x2A99=>0x2A9A, +0x2A9A=>0x2A99, +0x2A9B=>0x2A9C, +0x2A9C=>0x2A9B, +0x2AA1=>0x2AA2, +0x2AA2=>0x2AA1, +0x2AA6=>0x2AA7, +0x2AA7=>0x2AA6, +0x2AA8=>0x2AA9, +0x2AA9=>0x2AA8, +0x2AAA=>0x2AAB, +0x2AAB=>0x2AAA, +0x2AAC=>0x2AAD, +0x2AAD=>0x2AAC, +0x2AAF=>0x2AB0, +0x2AB0=>0x2AAF, +0x2AB3=>0x2AB4, +0x2AB4=>0x2AB3, +0x2ABB=>0x2ABC, +0x2ABC=>0x2ABB, +0x2ABD=>0x2ABE, +0x2ABE=>0x2ABD, +0x2ABF=>0x2AC0, +0x2AC0=>0x2ABF, +0x2AC1=>0x2AC2, +0x2AC2=>0x2AC1, +0x2AC3=>0x2AC4, +0x2AC4=>0x2AC3, +0x2AC5=>0x2AC6, +0x2AC6=>0x2AC5, +0x2ACD=>0x2ACE, +0x2ACE=>0x2ACD, +0x2ACF=>0x2AD0, +0x2AD0=>0x2ACF, +0x2AD1=>0x2AD2, +0x2AD2=>0x2AD1, +0x2AD3=>0x2AD4, +0x2AD4=>0x2AD3, +0x2AD5=>0x2AD6, +0x2AD6=>0x2AD5, +0x2ADE=>0x22A6, +0x2AE3=>0x22A9, +0x2AE4=>0x22A8, +0x2AE5=>0x22AB, +0x2AEC=>0x2AED, +0x2AED=>0x2AEC, +0x2AF7=>0x2AF8, +0x2AF8=>0x2AF7, +0x2AF9=>0x2AFA, +0x2AFA=>0x2AF9, +0x2E02=>0x2E03, +0x2E03=>0x2E02, +0x2E04=>0x2E05, +0x2E05=>0x2E04, +0x2E09=>0x2E0A, +0x2E0A=>0x2E09, +0x2E0C=>0x2E0D, +0x2E0D=>0x2E0C, +0x2E1C=>0x2E1D, +0x2E1D=>0x2E1C, +0x3008=>0x3009, +0x3009=>0x3008, +0x300A=>0x300B, +0x300B=>0x300A, +0x300C=>0x300D, +0x300D=>0x300C, +0x300E=>0x300F, +0x300F=>0x300E, +0x3010=>0x3011, +0x3011=>0x3010, +0x3014=>0x3015, +0x3015=>0x3014, +0x3016=>0x3017, +0x3017=>0x3016, +0x3018=>0x3019, +0x3019=>0x3018, +0x301A=>0x301B, +0x301B=>0x301A, +0x301D=>0x301E, +0x301E=>0x301D, +0xFE59=>0xFE5A, +0xFE5A=>0xFE59, +0xFE5B=>0xFE5C, +0xFE5C=>0xFE5B, +0xFE5D=>0xFE5E, +0xFE5E=>0xFE5D, +0xFE64=>0xFE65, +0xFE65=>0xFE64, +0xFF08=>0xFF09, +0xFF09=>0xFF08, +0xFF1C=>0xFF1E, +0xFF1E=>0xFF1C, +0xFF3B=>0xFF3D, +0xFF3D=>0xFF3B, +0xFF5B=>0xFF5D, +0xFF5D=>0xFF5B, +0xFF5F=>0xFF60, +0xFF60=>0xFF5F, +0xFF62=>0xFF63, +0xFF63=>0xFF62); + +/** + * Arabic shape substitutions: char code => (isolated, final, initial, medial). + * @public + */ +public static $uni_arabicsubst = array( +1569=>array(65152), +1570=>array(65153, 65154, 65153, 65154), +1571=>array(65155, 65156, 65155, 65156), +1572=>array(65157, 65158), +1573=>array(65159, 65160, 65159, 65160), +1574=>array(65161, 65162, 65163, 65164), +1575=>array(65165, 65166, 65165, 65166), +1576=>array(65167, 65168, 65169, 65170), +1577=>array(65171, 65172), +1578=>array(65173, 65174, 65175, 65176), +1579=>array(65177, 65178, 65179, 65180), +1580=>array(65181, 65182, 65183, 65184), +1581=>array(65185, 65186, 65187, 65188), +1582=>array(65189, 65190, 65191, 65192), +1583=>array(65193, 65194, 65193, 65194), +1584=>array(65195, 65196, 65195, 65196), +1585=>array(65197, 65198, 65197, 65198), +1586=>array(65199, 65200, 65199, 65200), +1587=>array(65201, 65202, 65203, 65204), +1588=>array(65205, 65206, 65207, 65208), +1589=>array(65209, 65210, 65211, 65212), +1590=>array(65213, 65214, 65215, 65216), +1591=>array(65217, 65218, 65219, 65220), +1592=>array(65221, 65222, 65223, 65224), +1593=>array(65225, 65226, 65227, 65228), +1594=>array(65229, 65230, 65231, 65232), +1601=>array(65233, 65234, 65235, 65236), +1602=>array(65237, 65238, 65239, 65240), +1603=>array(65241, 65242, 65243, 65244), +1604=>array(65245, 65246, 65247, 65248), +1605=>array(65249, 65250, 65251, 65252), +1606=>array(65253, 65254, 65255, 65256), +1607=>array(65257, 65258, 65259, 65260), +1608=>array(65261, 65262, 65261, 65262), +1609=>array(65263, 65264, 64488, 64489), +1610=>array(65265, 65266, 65267, 65268), +1649=>array(64336, 64337), +1655=>array(64477), +1657=>array(64358, 64359, 64360, 64361), +1658=>array(64350, 64351, 64352, 64353), +1659=>array(64338, 64339, 64340, 64341), +1662=>array(64342, 64343, 64344, 64345), +1663=>array(64354, 64355, 64356, 64357), +1664=>array(64346, 64347, 64348, 64349), +1667=>array(64374, 64375, 64376, 64377), +1668=>array(64370, 64371, 64372, 64373), +1670=>array(64378, 64379, 64380, 64381), +1671=>array(64382, 64383, 64384, 64385), +1672=>array(64392, 64393), +1676=>array(64388, 64389), +1677=>array(64386, 64387), +1678=>array(64390, 64391), +1681=>array(64396, 64397), +1688=>array(64394, 64395, 64394, 64395), +1700=>array(64362, 64363, 64364, 64365), +1702=>array(64366, 64367, 64368, 64369), +1705=>array(64398, 64399, 64400, 64401), +1709=>array(64467, 64468, 64469, 64470), +1711=>array(64402, 64403, 64404, 64405), +1713=>array(64410, 64411, 64412, 64413), +1715=>array(64406, 64407, 64408, 64409), +1722=>array(64414, 64415), +1723=>array(64416, 64417, 64418, 64419), +1726=>array(64426, 64427, 64428, 64429), +1728=>array(64420, 64421), +1729=>array(64422, 64423, 64424, 64425), +1733=>array(64480, 64481), +1734=>array(64473, 64474), +1735=>array(64471, 64472), +1736=>array(64475, 64476), +1737=>array(64482, 64483), +1739=>array(64478, 64479), +1740=>array(64508, 64509, 64510, 64511), +1744=>array(64484, 64485, 64486, 64487), +1746=>array(64430, 64431), +1747=>array(64432, 64433) +); + +/** + * Arabic laa letter: (char code => isolated, final, initial, medial). + * @public + */ +public static $uni_laa_array = array ( +1570 =>array(65269, 65270, 65269, 65270), +1571 =>array(65271, 65272, 65271, 65272), +1573 =>array(65273, 65274, 65273, 65274), +1575 =>array(65275, 65276, 65275, 65276) +); + +/** + * Array of character substitutions for sequences of two diacritics symbols. + * Putting the combining mark and character in the same glyph allows us to avoid the two marks overlapping each other in an illegible manner. + * second NSM char code => substitution char + * @public + */ +public static $uni_diacritics = array ( +1612=>64606, # Shadda + Dammatan +1613=>64607, # Shadda + Kasratan +1614=>64608, # Shadda + Fatha +1615=>64609, # Shadda + Damma +1616=>64610 # Shadda + Kasra +); + +/** + * Array of character substitutions from UTF-8 Unicode to Latin1. + * @public + */ +public static $uni_utf8tolatin = array ( +8364=>128, # Euro1 +338=>140, # OE +352=>138, # Scaron +376=>159, # Ydieresis +381=>142, # Zcaron2 +8226=>149, # bullet3 +710=>136, # circumflex +8224=>134, # dagger +8225=>135, # daggerdbl +8230=>133, # ellipsis +8212=>151, # emdash +8211=>150, # endash +402=>131, # florin +8249=>139, # guilsinglleft +8250=>155, # guilsinglright +339=>156, # oe +8240=>137, # perthousand +8222=>132, # quotedblbase +8220=>147, # quotedblleft +8221=>148, # quotedblright +8216=>145, # quoteleft +8217=>146, # quoteright +8218=>130, # quotesinglbase +353=>154, # scaron +732=>152, # tilde +8482=>153, # trademark +382=>158 # zcaron2 +); + +/** + * Array of Encoding Maps. + * @public static + */ +public static $encmap = array( + +// encoding map for: cp874 +'cp874' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'ellipsis',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'kokaithai',162=>'khokhaithai',163=>'khokhuatthai',164=>'khokhwaithai',165=>'khokhonthai',166=>'khorakhangthai',167=>'ngonguthai',168=>'chochanthai',169=>'chochingthai',170=>'chochangthai',171=>'sosothai',172=>'chochoethai',173=>'yoyingthai',174=>'dochadathai',175=>'topatakthai',176=>'thothanthai',177=>'thonangmonthothai',178=>'thophuthaothai',179=>'nonenthai',180=>'dodekthai',181=>'totaothai',182=>'thothungthai',183=>'thothahanthai',184=>'thothongthai',185=>'nonuthai',186=>'bobaimaithai',187=>'poplathai',188=>'phophungthai',189=>'fofathai',190=>'phophanthai',191=>'fofanthai',192=>'phosamphaothai',193=>'momathai',194=>'yoyakthai',195=>'roruathai',196=>'ruthai',197=>'lolingthai',198=>'luthai',199=>'wowaenthai',200=>'sosalathai',201=>'sorusithai',202=>'sosuathai',203=>'hohipthai',204=>'lochulathai',205=>'oangthai',206=>'honokhukthai',207=>'paiyannoithai',208=>'saraathai',209=>'maihanakatthai',210=>'saraaathai',211=>'saraamthai',212=>'saraithai',213=>'saraiithai',214=>'sarauethai',215=>'saraueethai',216=>'sarauthai',217=>'sarauuthai',218=>'phinthuthai',219=>'.notdef',220=>'.notdef',221=>'.notdef',222=>'.notdef',223=>'bahtthai',224=>'saraethai',225=>'saraaethai',226=>'saraothai',227=>'saraaimaimuanthai',228=>'saraaimaimalaithai',229=>'lakkhangyaothai',230=>'maiyamokthai',231=>'maitaikhuthai',232=>'maiekthai',233=>'maithothai',234=>'maitrithai',235=>'maichattawathai',236=>'thanthakhatthai',237=>'nikhahitthai',238=>'yamakkanthai',239=>'fongmanthai',240=>'zerothai',241=>'onethai',242=>'twothai',243=>'threethai',244=>'fourthai',245=>'fivethai',246=>'sixthai',247=>'seventhai',248=>'eightthai',249=>'ninethai',250=>'angkhankhuthai',251=>'khomutthai',252=>'.notdef',253=>'.notdef',254=>'.notdef',255=>'.notdef'), + +// encoding map for: cp1250 +'cp1250' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'.notdef',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'.notdef',137=>'perthousand',138=>'Scaron',139=>'guilsinglleft',140=>'Sacute',141=>'Tcaron',142=>'Zcaron',143=>'Zacute',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'scaron',155=>'guilsinglright',156=>'sacute',157=>'tcaron',158=>'zcaron',159=>'zacute',160=>'space',161=>'caron',162=>'breve',163=>'Lslash',164=>'currency',165=>'Aogonek',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'Scedilla',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'Zdotaccent',176=>'degree',177=>'plusminus',178=>'ogonek',179=>'lslash',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'aogonek',186=>'scedilla',187=>'guillemotright',188=>'Lcaron',189=>'hungarumlaut',190=>'lcaron',191=>'zdotaccent',192=>'Racute',193=>'Aacute',194=>'Acircumflex',195=>'Abreve',196=>'Adieresis',197=>'Lacute',198=>'Cacute',199=>'Ccedilla',200=>'Ccaron',201=>'Eacute',202=>'Eogonek',203=>'Edieresis',204=>'Ecaron',205=>'Iacute',206=>'Icircumflex',207=>'Dcaron',208=>'Dcroat',209=>'Nacute',210=>'Ncaron',211=>'Oacute',212=>'Ocircumflex',213=>'Ohungarumlaut',214=>'Odieresis',215=>'multiply',216=>'Rcaron',217=>'Uring',218=>'Uacute',219=>'Uhungarumlaut',220=>'Udieresis',221=>'Yacute',222=>'Tcommaaccent',223=>'germandbls',224=>'racute',225=>'aacute',226=>'acircumflex',227=>'abreve',228=>'adieresis',229=>'lacute',230=>'cacute',231=>'ccedilla',232=>'ccaron',233=>'eacute',234=>'eogonek',235=>'edieresis',236=>'ecaron',237=>'iacute',238=>'icircumflex',239=>'dcaron',240=>'dcroat',241=>'nacute',242=>'ncaron',243=>'oacute',244=>'ocircumflex',245=>'ohungarumlaut',246=>'odieresis',247=>'divide',248=>'rcaron',249=>'uring',250=>'uacute',251=>'uhungarumlaut',252=>'udieresis',253=>'yacute',254=>'tcommaaccent',255=>'dotaccent'), + +// encoding map for: cp1251 +'cp1251' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'afii10051',129=>'afii10052',130=>'quotesinglbase',131=>'afii10100',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'Euro',137=>'perthousand',138=>'afii10058',139=>'guilsinglleft',140=>'afii10059',141=>'afii10061',142=>'afii10060',143=>'afii10145',144=>'afii10099',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'afii10106',155=>'guilsinglright',156=>'afii10107',157=>'afii10109',158=>'afii10108',159=>'afii10193',160=>'space',161=>'afii10062',162=>'afii10110',163=>'afii10057',164=>'currency',165=>'afii10050',166=>'brokenbar',167=>'section',168=>'afii10023',169=>'copyright',170=>'afii10053',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'afii10056',176=>'degree',177=>'plusminus',178=>'afii10055',179=>'afii10103',180=>'afii10098',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'afii10071',185=>'afii61352',186=>'afii10101',187=>'guillemotright',188=>'afii10105',189=>'afii10054',190=>'afii10102',191=>'afii10104',192=>'afii10017',193=>'afii10018',194=>'afii10019',195=>'afii10020',196=>'afii10021',197=>'afii10022',198=>'afii10024',199=>'afii10025',200=>'afii10026',201=>'afii10027',202=>'afii10028',203=>'afii10029',204=>'afii10030',205=>'afii10031',206=>'afii10032',207=>'afii10033',208=>'afii10034',209=>'afii10035',210=>'afii10036',211=>'afii10037',212=>'afii10038',213=>'afii10039',214=>'afii10040',215=>'afii10041',216=>'afii10042',217=>'afii10043',218=>'afii10044',219=>'afii10045',220=>'afii10046',221=>'afii10047',222=>'afii10048',223=>'afii10049',224=>'afii10065',225=>'afii10066',226=>'afii10067',227=>'afii10068',228=>'afii10069',229=>'afii10070',230=>'afii10072',231=>'afii10073',232=>'afii10074',233=>'afii10075',234=>'afii10076',235=>'afii10077',236=>'afii10078',237=>'afii10079',238=>'afii10080',239=>'afii10081',240=>'afii10082',241=>'afii10083',242=>'afii10084',243=>'afii10085',244=>'afii10086',245=>'afii10087',246=>'afii10088',247=>'afii10089',248=>'afii10090',249=>'afii10091',250=>'afii10092',251=>'afii10093',252=>'afii10094',253=>'afii10095',254=>'afii10096',255=>'afii10097'), + +// encoding map for: cp1252 +'cp1252' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'Scaron',139=>'guilsinglleft',140=>'OE',141=>'.notdef',142=>'Zcaron',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'tilde',153=>'trademark',154=>'scaron',155=>'guilsinglright',156=>'oe',157=>'.notdef',158=>'zcaron',159=>'Ydieresis',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Eth',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Yacute',222=>'Thorn',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'eth',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'yacute',254=>'thorn',255=>'ydieresis'), + +// encoding map for: cp1253 +'cp1253' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'.notdef',137=>'perthousand',138=>'.notdef',139=>'guilsinglleft',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'.notdef',155=>'guilsinglright',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'dieresistonos',162=>'Alphatonos',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'.notdef',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'afii00208',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'tonos',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'Epsilontonos',185=>'Etatonos',186=>'Iotatonos',187=>'guillemotright',188=>'Omicrontonos',189=>'onehalf',190=>'Upsilontonos',191=>'Omegatonos',192=>'iotadieresistonos',193=>'Alpha',194=>'Beta',195=>'Gamma',196=>'Delta',197=>'Epsilon',198=>'Zeta',199=>'Eta',200=>'Theta',201=>'Iota',202=>'Kappa',203=>'Lambda',204=>'Mu',205=>'Nu',206=>'Xi',207=>'Omicron',208=>'Pi',209=>'Rho',210=>'.notdef',211=>'Sigma',212=>'Tau',213=>'Upsilon',214=>'Phi',215=>'Chi',216=>'Psi',217=>'Omega',218=>'Iotadieresis',219=>'Upsilondieresis',220=>'alphatonos',221=>'epsilontonos',222=>'etatonos',223=>'iotatonos',224=>'upsilondieresistonos',225=>'alpha',226=>'beta',227=>'gamma',228=>'delta',229=>'epsilon',230=>'zeta',231=>'eta',232=>'theta',233=>'iota',234=>'kappa',235=>'lambda',236=>'mu',237=>'nu',238=>'xi',239=>'omicron',240=>'pi',241=>'rho',242=>'sigma1',243=>'sigma',244=>'tau',245=>'upsilon',246=>'phi',247=>'chi',248=>'psi',249=>'omega',250=>'iotadieresis',251=>'upsilondieresis',252=>'omicrontonos',253=>'upsilontonos',254=>'omegatonos',255=>'.notdef'), + +// encoding map for: cp1254 +'cp1254' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'Scaron',139=>'guilsinglleft',140=>'OE',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'tilde',153=>'trademark',154=>'scaron',155=>'guilsinglright',156=>'oe',157=>'.notdef',158=>'.notdef',159=>'Ydieresis',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Gbreve',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Idotaccent',222=>'Scedilla',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'gbreve',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'dotlessi',254=>'scedilla',255=>'ydieresis'), + +// encoding map for: cp1255 +'cp1255' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'.notdef',139=>'guilsinglleft',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'tilde',153=>'trademark',154=>'.notdef',155=>'guilsinglright',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'afii57636',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'multiply',171=>'guillemotleft',172=>'logicalnot',173=>'sfthyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'middot',184=>'cedilla',185=>'onesuperior',186=>'divide',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'afii57799',193=>'afii57801',194=>'afii57800',195=>'afii57802',196=>'afii57793',197=>'afii57794',198=>'afii57795',199=>'afii57798',200=>'afii57797',201=>'afii57806',202=>'.notdef',203=>'afii57796',204=>'afii57807',205=>'afii57839',206=>'afii57645',207=>'afii57841',208=>'afii57842',209=>'afii57804',210=>'afii57803',211=>'afii57658',212=>'afii57716',213=>'afii57717',214=>'afii57718',215=>'gereshhebrew',216=>'gershayimhebrew',217=>'.notdef',218=>'.notdef',219=>'.notdef',220=>'.notdef',221=>'.notdef',222=>'.notdef',223=>'.notdef',224=>'afii57664',225=>'afii57665',226=>'afii57666',227=>'afii57667',228=>'afii57668',229=>'afii57669',230=>'afii57670',231=>'afii57671',232=>'afii57672',233=>'afii57673',234=>'afii57674',235=>'afii57675',236=>'afii57676',237=>'afii57677',238=>'afii57678',239=>'afii57679',240=>'afii57680',241=>'afii57681',242=>'afii57682',243=>'afii57683',244=>'afii57684',245=>'afii57685',246=>'afii57686',247=>'afii57687',248=>'afii57688',249=>'afii57689',250=>'afii57690',251=>'.notdef',252=>'.notdef',253=>'afii299',254=>'afii300',255=>'.notdef'), + +// encoding map for: cp1256 +'cp1256' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'afii57506',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'afii57511',139=>'guilsinglleft',140=>'OE',141=>'afii57507',142=>'afii57508',143=>'afii57512',144=>'afii57509',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'afii57513',155=>'guilsinglright',156=>'oe',157=>'afii61664',158=>'afii301',159=>'afii57514',160=>'space',161=>'afii57388',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'.notdef',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'afii57403',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'afii57407',192=>'.notdef',193=>'afii57409',194=>'afii57410',195=>'afii57411',196=>'afii57412',197=>'afii57413',198=>'afii57414',199=>'afii57415',200=>'afii57416',201=>'afii57417',202=>'afii57418',203=>'afii57419',204=>'afii57420',205=>'afii57421',206=>'afii57422',207=>'afii57423',208=>'afii57424',209=>'afii57425',210=>'afii57426',211=>'afii57427',212=>'afii57428',213=>'afii57429',214=>'afii57430',215=>'multiply',216=>'afii57431',217=>'afii57432',218=>'afii57433',219=>'afii57434',220=>'afii57440',221=>'afii57441',222=>'afii57442',223=>'afii57443',224=>'agrave',225=>'afii57444',226=>'acircumflex',227=>'afii57445',228=>'afii57446',229=>'afii57470',230=>'afii57448',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'afii57449',237=>'afii57450',238=>'icircumflex',239=>'idieresis',240=>'afii57451',241=>'afii57452',242=>'afii57453',243=>'afii57454',244=>'ocircumflex',245=>'afii57455',246=>'afii57456',247=>'divide',248=>'afii57457',249=>'ugrave',250=>'afii57458',251=>'ucircumflex',252=>'udieresis',253=>'afii299',254=>'afii300',255=>'afii57519'), + +// encoding map for: cp1257 +'cp1257' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'.notdef',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'.notdef',137=>'perthousand',138=>'.notdef',139=>'guilsinglleft',140=>'.notdef',141=>'dieresis',142=>'caron',143=>'cedilla',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'.notdef',153=>'trademark',154=>'.notdef',155=>'guilsinglright',156=>'.notdef',157=>'macron',158=>'ogonek',159=>'.notdef',160=>'space',161=>'.notdef',162=>'cent',163=>'sterling',164=>'currency',165=>'.notdef',166=>'brokenbar',167=>'section',168=>'Oslash',169=>'copyright',170=>'Rcommaaccent',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'AE',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'oslash',185=>'onesuperior',186=>'rcommaaccent',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'ae',192=>'Aogonek',193=>'Iogonek',194=>'Amacron',195=>'Cacute',196=>'Adieresis',197=>'Aring',198=>'Eogonek',199=>'Emacron',200=>'Ccaron',201=>'Eacute',202=>'Zacute',203=>'Edotaccent',204=>'Gcommaaccent',205=>'Kcommaaccent',206=>'Imacron',207=>'Lcommaaccent',208=>'Scaron',209=>'Nacute',210=>'Ncommaaccent',211=>'Oacute',212=>'Omacron',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Uogonek',217=>'Lslash',218=>'Sacute',219=>'Umacron',220=>'Udieresis',221=>'Zdotaccent',222=>'Zcaron',223=>'germandbls',224=>'aogonek',225=>'iogonek',226=>'amacron',227=>'cacute',228=>'adieresis',229=>'aring',230=>'eogonek',231=>'emacron',232=>'ccaron',233=>'eacute',234=>'zacute',235=>'edotaccent',236=>'gcommaaccent',237=>'kcommaaccent',238=>'imacron',239=>'lcommaaccent',240=>'scaron',241=>'nacute',242=>'ncommaaccent',243=>'oacute',244=>'omacron',245=>'otilde',246=>'odieresis',247=>'divide',248=>'uogonek',249=>'lslash',250=>'sacute',251=>'umacron',252=>'udieresis',253=>'zdotaccent',254=>'zcaron',255=>'dotaccent'), + +// encoding map for: cp1258 +'cp1258' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'Euro',129=>'.notdef',130=>'quotesinglbase',131=>'florin',132=>'quotedblbase',133=>'ellipsis',134=>'dagger',135=>'daggerdbl',136=>'circumflex',137=>'perthousand',138=>'.notdef',139=>'guilsinglleft',140=>'OE',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'quoteleft',146=>'quoteright',147=>'quotedblleft',148=>'quotedblright',149=>'bullet',150=>'endash',151=>'emdash',152=>'tilde',153=>'trademark',154=>'.notdef',155=>'guilsinglright',156=>'oe',157=>'.notdef',158=>'.notdef',159=>'Ydieresis',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Abreve',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'gravecomb',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Dcroat',209=>'Ntilde',210=>'hookabovecomb',211=>'Oacute',212=>'Ocircumflex',213=>'Ohorn',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Uhorn',222=>'tildecomb',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'abreve',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'acutecomb',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'dcroat',241=>'ntilde',242=>'dotbelowcomb',243=>'oacute',244=>'ocircumflex',245=>'ohorn',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'uhorn',254=>'dong',255=>'ydieresis'), + +// encoding map for: iso-8859-1 +'iso-8859-1' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Eth',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Yacute',222=>'Thorn',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'eth',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'yacute',254=>'thorn',255=>'ydieresis'), + +// encoding map for: iso-8859-2 +'iso-8859-2' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'Aogonek',162=>'breve',163=>'Lslash',164=>'currency',165=>'Lcaron',166=>'Sacute',167=>'section',168=>'dieresis',169=>'Scaron',170=>'Scedilla',171=>'Tcaron',172=>'Zacute',173=>'hyphen',174=>'Zcaron',175=>'Zdotaccent',176=>'degree',177=>'aogonek',178=>'ogonek',179=>'lslash',180=>'acute',181=>'lcaron',182=>'sacute',183=>'caron',184=>'cedilla',185=>'scaron',186=>'scedilla',187=>'tcaron',188=>'zacute',189=>'hungarumlaut',190=>'zcaron',191=>'zdotaccent',192=>'Racute',193=>'Aacute',194=>'Acircumflex',195=>'Abreve',196=>'Adieresis',197=>'Lacute',198=>'Cacute',199=>'Ccedilla',200=>'Ccaron',201=>'Eacute',202=>'Eogonek',203=>'Edieresis',204=>'Ecaron',205=>'Iacute',206=>'Icircumflex',207=>'Dcaron',208=>'Dcroat',209=>'Nacute',210=>'Ncaron',211=>'Oacute',212=>'Ocircumflex',213=>'Ohungarumlaut',214=>'Odieresis',215=>'multiply',216=>'Rcaron',217=>'Uring',218=>'Uacute',219=>'Uhungarumlaut',220=>'Udieresis',221=>'Yacute',222=>'Tcommaaccent',223=>'germandbls',224=>'racute',225=>'aacute',226=>'acircumflex',227=>'abreve',228=>'adieresis',229=>'lacute',230=>'cacute',231=>'ccedilla',232=>'ccaron',233=>'eacute',234=>'eogonek',235=>'edieresis',236=>'ecaron',237=>'iacute',238=>'icircumflex',239=>'dcaron',240=>'dcroat',241=>'nacute',242=>'ncaron',243=>'oacute',244=>'ocircumflex',245=>'ohungarumlaut',246=>'odieresis',247=>'divide',248=>'rcaron',249=>'uring',250=>'uacute',251=>'uhungarumlaut',252=>'udieresis',253=>'yacute',254=>'tcommaaccent',255=>'dotaccent'), + +// encoding map for: iso-8859-4 +'iso-8859-4' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'Aogonek',162=>'kgreenlandic',163=>'Rcommaaccent',164=>'currency',165=>'Itilde',166=>'Lcommaaccent',167=>'section',168=>'dieresis',169=>'Scaron',170=>'Emacron',171=>'Gcommaaccent',172=>'Tbar',173=>'hyphen',174=>'Zcaron',175=>'macron',176=>'degree',177=>'aogonek',178=>'ogonek',179=>'rcommaaccent',180=>'acute',181=>'itilde',182=>'lcommaaccent',183=>'caron',184=>'cedilla',185=>'scaron',186=>'emacron',187=>'gcommaaccent',188=>'tbar',189=>'Eng',190=>'zcaron',191=>'eng',192=>'Amacron',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Iogonek',200=>'Ccaron',201=>'Eacute',202=>'Eogonek',203=>'Edieresis',204=>'Edotaccent',205=>'Iacute',206=>'Icircumflex',207=>'Imacron',208=>'Dcroat',209=>'Ncommaaccent',210=>'Omacron',211=>'Kcommaaccent',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Uogonek',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Utilde',222=>'Umacron',223=>'germandbls',224=>'amacron',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'iogonek',232=>'ccaron',233=>'eacute',234=>'eogonek',235=>'edieresis',236=>'edotaccent',237=>'iacute',238=>'icircumflex',239=>'imacron',240=>'dcroat',241=>'ncommaaccent',242=>'omacron',243=>'kcommaaccent',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'uogonek',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'utilde',254=>'umacron',255=>'dotaccent'), + +// encoding map for: iso-8859-5 +'iso-8859-5' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'afii10023',162=>'afii10051',163=>'afii10052',164=>'afii10053',165=>'afii10054',166=>'afii10055',167=>'afii10056',168=>'afii10057',169=>'afii10058',170=>'afii10059',171=>'afii10060',172=>'afii10061',173=>'hyphen',174=>'afii10062',175=>'afii10145',176=>'afii10017',177=>'afii10018',178=>'afii10019',179=>'afii10020',180=>'afii10021',181=>'afii10022',182=>'afii10024',183=>'afii10025',184=>'afii10026',185=>'afii10027',186=>'afii10028',187=>'afii10029',188=>'afii10030',189=>'afii10031',190=>'afii10032',191=>'afii10033',192=>'afii10034',193=>'afii10035',194=>'afii10036',195=>'afii10037',196=>'afii10038',197=>'afii10039',198=>'afii10040',199=>'afii10041',200=>'afii10042',201=>'afii10043',202=>'afii10044',203=>'afii10045',204=>'afii10046',205=>'afii10047',206=>'afii10048',207=>'afii10049',208=>'afii10065',209=>'afii10066',210=>'afii10067',211=>'afii10068',212=>'afii10069',213=>'afii10070',214=>'afii10072',215=>'afii10073',216=>'afii10074',217=>'afii10075',218=>'afii10076',219=>'afii10077',220=>'afii10078',221=>'afii10079',222=>'afii10080',223=>'afii10081',224=>'afii10082',225=>'afii10083',226=>'afii10084',227=>'afii10085',228=>'afii10086',229=>'afii10087',230=>'afii10088',231=>'afii10089',232=>'afii10090',233=>'afii10091',234=>'afii10092',235=>'afii10093',236=>'afii10094',237=>'afii10095',238=>'afii10096',239=>'afii10097',240=>'afii61352',241=>'afii10071',242=>'afii10099',243=>'afii10100',244=>'afii10101',245=>'afii10102',246=>'afii10103',247=>'afii10104',248=>'afii10105',249=>'afii10106',250=>'afii10107',251=>'afii10108',252=>'afii10109',253=>'section',254=>'afii10110',255=>'afii10193'), + +// encoding map for: iso-8859-7 +'iso-8859-7' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'quoteleft',162=>'quoteright',163=>'sterling',164=>'.notdef',165=>'.notdef',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'.notdef',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'.notdef',175=>'afii00208',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'tonos',181=>'dieresistonos',182=>'Alphatonos',183=>'periodcentered',184=>'Epsilontonos',185=>'Etatonos',186=>'Iotatonos',187=>'guillemotright',188=>'Omicrontonos',189=>'onehalf',190=>'Upsilontonos',191=>'Omegatonos',192=>'iotadieresistonos',193=>'Alpha',194=>'Beta',195=>'Gamma',196=>'Delta',197=>'Epsilon',198=>'Zeta',199=>'Eta',200=>'Theta',201=>'Iota',202=>'Kappa',203=>'Lambda',204=>'Mu',205=>'Nu',206=>'Xi',207=>'Omicron',208=>'Pi',209=>'Rho',210=>'.notdef',211=>'Sigma',212=>'Tau',213=>'Upsilon',214=>'Phi',215=>'Chi',216=>'Psi',217=>'Omega',218=>'Iotadieresis',219=>'Upsilondieresis',220=>'alphatonos',221=>'epsilontonos',222=>'etatonos',223=>'iotatonos',224=>'upsilondieresistonos',225=>'alpha',226=>'beta',227=>'gamma',228=>'delta',229=>'epsilon',230=>'zeta',231=>'eta',232=>'theta',233=>'iota',234=>'kappa',235=>'lambda',236=>'mu',237=>'nu',238=>'xi',239=>'omicron',240=>'pi',241=>'rho',242=>'sigma1',243=>'sigma',244=>'tau',245=>'upsilon',246=>'phi',247=>'chi',248=>'psi',249=>'omega',250=>'iotadieresis',251=>'upsilondieresis',252=>'omicrontonos',253=>'upsilontonos',254=>'omegatonos',255=>'.notdef'), + +// encoding map for: iso-8859-9 +'iso-8859-9' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'currency',165=>'yen',166=>'brokenbar',167=>'section',168=>'dieresis',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'acute',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'cedilla',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'onequarter',189=>'onehalf',190=>'threequarters',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Gbreve',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Idotaccent',222=>'Scedilla',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'gbreve',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'dotlessi',254=>'scedilla',255=>'ydieresis'), + +// encoding map for: iso-8859-11 +'iso-8859-11' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'kokaithai',162=>'khokhaithai',163=>'khokhuatthai',164=>'khokhwaithai',165=>'khokhonthai',166=>'khorakhangthai',167=>'ngonguthai',168=>'chochanthai',169=>'chochingthai',170=>'chochangthai',171=>'sosothai',172=>'chochoethai',173=>'yoyingthai',174=>'dochadathai',175=>'topatakthai',176=>'thothanthai',177=>'thonangmonthothai',178=>'thophuthaothai',179=>'nonenthai',180=>'dodekthai',181=>'totaothai',182=>'thothungthai',183=>'thothahanthai',184=>'thothongthai',185=>'nonuthai',186=>'bobaimaithai',187=>'poplathai',188=>'phophungthai',189=>'fofathai',190=>'phophanthai',191=>'fofanthai',192=>'phosamphaothai',193=>'momathai',194=>'yoyakthai',195=>'roruathai',196=>'ruthai',197=>'lolingthai',198=>'luthai',199=>'wowaenthai',200=>'sosalathai',201=>'sorusithai',202=>'sosuathai',203=>'hohipthai',204=>'lochulathai',205=>'oangthai',206=>'honokhukthai',207=>'paiyannoithai',208=>'saraathai',209=>'maihanakatthai',210=>'saraaathai',211=>'saraamthai',212=>'saraithai',213=>'saraiithai',214=>'sarauethai',215=>'saraueethai',216=>'sarauthai',217=>'sarauuthai',218=>'phinthuthai',219=>'.notdef',220=>'.notdef',221=>'.notdef',222=>'.notdef',223=>'bahtthai',224=>'saraethai',225=>'saraaethai',226=>'saraothai',227=>'saraaimaimuanthai',228=>'saraaimaimalaithai',229=>'lakkhangyaothai',230=>'maiyamokthai',231=>'maitaikhuthai',232=>'maiekthai',233=>'maithothai',234=>'maitrithai',235=>'maichattawathai',236=>'thanthakhatthai',237=>'nikhahitthai',238=>'yamakkanthai',239=>'fongmanthai',240=>'zerothai',241=>'onethai',242=>'twothai',243=>'threethai',244=>'fourthai',245=>'fivethai',246=>'sixthai',247=>'seventhai',248=>'eightthai',249=>'ninethai',250=>'angkhankhuthai',251=>'khomutthai',252=>'.notdef',253=>'.notdef',254=>'.notdef',255=>'.notdef'), + +// encoding map for: iso-8859-15 +'iso-8859-15' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'exclamdown',162=>'cent',163=>'sterling',164=>'Euro',165=>'yen',166=>'Scaron',167=>'section',168=>'scaron',169=>'copyright',170=>'ordfeminine',171=>'guillemotleft',172=>'logicalnot',173=>'hyphen',174=>'registered',175=>'macron',176=>'degree',177=>'plusminus',178=>'twosuperior',179=>'threesuperior',180=>'Zcaron',181=>'mu',182=>'paragraph',183=>'periodcentered',184=>'zcaron',185=>'onesuperior',186=>'ordmasculine',187=>'guillemotright',188=>'OE',189=>'oe',190=>'Ydieresis',191=>'questiondown',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Atilde',196=>'Adieresis',197=>'Aring',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Eth',209=>'Ntilde',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Otilde',214=>'Odieresis',215=>'multiply',216=>'Oslash',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Yacute',222=>'Thorn',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'atilde',228=>'adieresis',229=>'aring',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'eth',241=>'ntilde',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'otilde',246=>'odieresis',247=>'divide',248=>'oslash',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'yacute',254=>'thorn',255=>'ydieresis'), + +// encoding map for: iso-8859-16 +'iso-8859-16' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'space',161=>'Aogonek',162=>'aogonek',163=>'Lslash',164=>'Euro',165=>'quotedblbase',166=>'Scaron',167=>'section',168=>'scaron',169=>'copyright',170=>'Scommaaccent',171=>'guillemotleft',172=>'Zacute',173=>'hyphen',174=>'zacute',175=>'Zdotaccent',176=>'degree',177=>'plusminus',178=>'Ccaron',179=>'lslash',180=>'Zcaron',181=>'quotedblright',182=>'paragraph',183=>'periodcentered',184=>'zcaron',185=>'ccaron',186=>'scommaaccent',187=>'guillemotright',188=>'OE',189=>'oe',190=>'Ydieresis',191=>'zdotaccent',192=>'Agrave',193=>'Aacute',194=>'Acircumflex',195=>'Abreve',196=>'Adieresis',197=>'Cacute',198=>'AE',199=>'Ccedilla',200=>'Egrave',201=>'Eacute',202=>'Ecircumflex',203=>'Edieresis',204=>'Igrave',205=>'Iacute',206=>'Icircumflex',207=>'Idieresis',208=>'Dcroat',209=>'Nacute',210=>'Ograve',211=>'Oacute',212=>'Ocircumflex',213=>'Ohungarumlaut',214=>'Odieresis',215=>'Sacute',216=>'Uhungarumlaut',217=>'Ugrave',218=>'Uacute',219=>'Ucircumflex',220=>'Udieresis',221=>'Eogonek',222=>'Tcommaaccent',223=>'germandbls',224=>'agrave',225=>'aacute',226=>'acircumflex',227=>'abreve',228=>'adieresis',229=>'cacute',230=>'ae',231=>'ccedilla',232=>'egrave',233=>'eacute',234=>'ecircumflex',235=>'edieresis',236=>'igrave',237=>'iacute',238=>'icircumflex',239=>'idieresis',240=>'dcroat',241=>'nacute',242=>'ograve',243=>'oacute',244=>'ocircumflex',245=>'ohungarumlaut',246=>'odieresis',247=>'sacute',248=>'uhungarumlaut',249=>'ugrave',250=>'uacute',251=>'ucircumflex',252=>'udieresis',253=>'eogonek',254=>'tcommaaccent',255=>'ydieresis'), + +// encoding map for: koi8-r +'koi8-r' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'SF100000',129=>'SF110000',130=>'SF010000',131=>'SF030000',132=>'SF020000',133=>'SF040000',134=>'SF080000',135=>'SF090000',136=>'SF060000',137=>'SF070000',138=>'SF050000',139=>'upblock',140=>'dnblock',141=>'block',142=>'lfblock',143=>'rtblock',144=>'ltshade',145=>'shade',146=>'dkshade',147=>'integraltp',148=>'filledbox',149=>'periodcentered',150=>'radical',151=>'approxequal',152=>'lessequal',153=>'greaterequal',154=>'space',155=>'integralbt',156=>'degree',157=>'twosuperior',158=>'periodcentered',159=>'divide',160=>'SF430000',161=>'SF240000',162=>'SF510000',163=>'afii10071',164=>'SF520000',165=>'SF390000',166=>'SF220000',167=>'SF210000',168=>'SF250000',169=>'SF500000',170=>'SF490000',171=>'SF380000',172=>'SF280000',173=>'SF270000',174=>'SF260000',175=>'SF360000',176=>'SF370000',177=>'SF420000',178=>'SF190000',179=>'afii10023',180=>'SF200000',181=>'SF230000',182=>'SF470000',183=>'SF480000',184=>'SF410000',185=>'SF450000',186=>'SF460000',187=>'SF400000',188=>'SF540000',189=>'SF530000',190=>'SF440000',191=>'copyright',192=>'afii10096',193=>'afii10065',194=>'afii10066',195=>'afii10088',196=>'afii10069',197=>'afii10070',198=>'afii10086',199=>'afii10068',200=>'afii10087',201=>'afii10074',202=>'afii10075',203=>'afii10076',204=>'afii10077',205=>'afii10078',206=>'afii10079',207=>'afii10080',208=>'afii10081',209=>'afii10097',210=>'afii10082',211=>'afii10083',212=>'afii10084',213=>'afii10085',214=>'afii10072',215=>'afii10067',216=>'afii10094',217=>'afii10093',218=>'afii10073',219=>'afii10090',220=>'afii10095',221=>'afii10091',222=>'afii10089',223=>'afii10092',224=>'afii10048',225=>'afii10017',226=>'afii10018',227=>'afii10040',228=>'afii10021',229=>'afii10022',230=>'afii10038',231=>'afii10020',232=>'afii10039',233=>'afii10026',234=>'afii10027',235=>'afii10028',236=>'afii10029',237=>'afii10030',238=>'afii10031',239=>'afii10032',240=>'afii10033',241=>'afii10049',242=>'afii10034',243=>'afii10035',244=>'afii10036',245=>'afii10037',246=>'afii10024',247=>'afii10019',248=>'afii10046',249=>'afii10045',250=>'afii10025',251=>'afii10042',252=>'afii10047',253=>'afii10043',254=>'afii10041',255=>'afii10044'), + +// encoding map for: koi8-u +'koi8-u' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'quotedbl',35=>'numbersign',36=>'dollar',37=>'percent',38=>'ampersand',39=>'quotesingle',40=>'parenleft',41=>'parenright',42=>'asterisk',43=>'plus',44=>'comma',45=>'hyphen',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'at',65=>'A',66=>'B',67=>'C',68=>'D',69=>'E',70=>'F',71=>'G',72=>'H',73=>'I',74=>'J',75=>'K',76=>'L',77=>'M',78=>'N',79=>'O',80=>'P',81=>'Q',82=>'R',83=>'S',84=>'T',85=>'U',86=>'V',87=>'W',88=>'X',89=>'Y',90=>'Z',91=>'bracketleft',92=>'backslash',93=>'bracketright',94=>'asciicircum',95=>'underscore',96=>'grave',97=>'a',98=>'b',99=>'c',100=>'d',101=>'e',102=>'f',103=>'g',104=>'h',105=>'i',106=>'j',107=>'k',108=>'l',109=>'m',110=>'n',111=>'o',112=>'p',113=>'q',114=>'r',115=>'s',116=>'t',117=>'u',118=>'v',119=>'w',120=>'x',121=>'y',122=>'z',123=>'braceleft',124=>'bar',125=>'braceright',126=>'asciitilde',127=>'.notdef',128=>'SF100000',129=>'SF110000',130=>'SF010000',131=>'SF030000',132=>'SF020000',133=>'SF040000',134=>'SF080000',135=>'SF090000',136=>'SF060000',137=>'SF070000',138=>'SF050000',139=>'upblock',140=>'dnblock',141=>'block',142=>'lfblock',143=>'rtblock',144=>'ltshade',145=>'shade',146=>'dkshade',147=>'integraltp',148=>'filledbox',149=>'bullet',150=>'radical',151=>'approxequal',152=>'lessequal',153=>'greaterequal',154=>'space',155=>'integralbt',156=>'degree',157=>'twosuperior',158=>'periodcentered',159=>'divide',160=>'SF430000',161=>'SF240000',162=>'SF510000',163=>'afii10071',164=>'afii10101',165=>'SF390000',166=>'afii10103',167=>'afii10104',168=>'SF250000',169=>'SF500000',170=>'SF490000',171=>'SF380000',172=>'SF280000',173=>'afii10098',174=>'SF260000',175=>'SF360000',176=>'SF370000',177=>'SF420000',178=>'SF190000',179=>'afii10023',180=>'afii10053',181=>'SF230000',182=>'afii10055',183=>'afii10056',184=>'SF410000',185=>'SF450000',186=>'SF460000',187=>'SF400000',188=>'SF540000',189=>'afii10050',190=>'SF440000',191=>'copyright',192=>'afii10096',193=>'afii10065',194=>'afii10066',195=>'afii10088',196=>'afii10069',197=>'afii10070',198=>'afii10086',199=>'afii10068',200=>'afii10087',201=>'afii10074',202=>'afii10075',203=>'afii10076',204=>'afii10077',205=>'afii10078',206=>'afii10079',207=>'afii10080',208=>'afii10081',209=>'afii10097',210=>'afii10082',211=>'afii10083',212=>'afii10084',213=>'afii10085',214=>'afii10072',215=>'afii10067',216=>'afii10094',217=>'afii10093',218=>'afii10073',219=>'afii10090',220=>'afii10095',221=>'afii10091',222=>'afii10089',223=>'afii10092',224=>'afii10048',225=>'afii10017',226=>'afii10018',227=>'afii10040',228=>'afii10021',229=>'afii10022',230=>'afii10038',231=>'afii10020',232=>'afii10039',233=>'afii10026',234=>'afii10027',235=>'afii10028',236=>'afii10029',237=>'afii10030',238=>'afii10031',239=>'afii10032',240=>'afii10033',241=>'afii10049',242=>'afii10034',243=>'afii10035',244=>'afii10036',245=>'afii10037',246=>'afii10024',247=>'afii10019',248=>'afii10046',249=>'afii10045',250=>'afii10025',251=>'afii10042',252=>'afii10047',253=>'afii10043',254=>'afii10041',255=>'afii10044'), + +// encoding map for: symbol +'symbol' => array(0=>'.notdef',1=>'.notdef',2=>'.notdef',3=>'.notdef',4=>'.notdef',5=>'.notdef',6=>'.notdef',7=>'.notdef',8=>'.notdef',9=>'.notdef',10=>'.notdef',11=>'.notdef',12=>'.notdef',13=>'.notdef',14=>'.notdef',15=>'.notdef',16=>'.notdef',17=>'.notdef',18=>'.notdef',19=>'.notdef',20=>'.notdef',21=>'.notdef',22=>'.notdef',23=>'.notdef',24=>'.notdef',25=>'.notdef',26=>'.notdef',27=>'.notdef',28=>'.notdef',29=>'.notdef',30=>'.notdef',31=>'.notdef',32=>'space',33=>'exclam',34=>'universal',35=>'numbersign',36=>'existential',37=>'percent',38=>'ampersand',39=>'suchthat',40=>'parenleft',41=>'parenright',42=>'asteriskmath',43=>'plus',44=>'comma',45=>'minus',46=>'period',47=>'slash',48=>'zero',49=>'one',50=>'two',51=>'three',52=>'four',53=>'five',54=>'six',55=>'seven',56=>'eight',57=>'nine',58=>'colon',59=>'semicolon',60=>'less',61=>'equal',62=>'greater',63=>'question',64=>'congruent',65=>'Alpha',66=>'Beta',67=>'Chi',68=>'Delta',69=>'Epsilon',70=>'Phi',71=>'Gamma',72=>'Eta',73=>'Iota',74=>'theta1',75=>'Kappa',76=>'Lambda',77=>'Mu',78=>'Nu',79=>'Omicron',80=>'Pi',81=>'Theta',82=>'Rho',83=>'Sigma',84=>'Tau',85=>'Upsilon',86=>'sigma1',87=>'Omega',88=>'Xi',89=>'Psi',90=>'Zeta',91=>'bracketleft',92=>'therefore',93=>'bracketright',94=>'perpendicular',95=>'underscore',96=>'radicalex',97=>'alpha',98=>'beta',99=>'chi',100=>'delta',101=>'epsilon',102=>'phi',103=>'gamma',104=>'eta',105=>'iota',106=>'phi1',107=>'kappa',108=>'lambda',109=>'mu',110=>'nu',111=>'omicron',112=>'pi',113=>'theta',114=>'rho',115=>'sigma',116=>'tau',117=>'upsilon',118=>'omega1',119=>'omega',120=>'xi',121=>'psi',122=>'zeta',123=>'braceleft',124=>'bar',125=>'braceright',126=>'similar',127=>'.notdef',128=>'.notdef',129=>'.notdef',130=>'.notdef',131=>'.notdef',132=>'.notdef',133=>'.notdef',134=>'.notdef',135=>'.notdef',136=>'.notdef',137=>'.notdef',138=>'.notdef',139=>'.notdef',140=>'.notdef',141=>'.notdef',142=>'.notdef',143=>'.notdef',144=>'.notdef',145=>'.notdef',146=>'.notdef',147=>'.notdef',148=>'.notdef',149=>'.notdef',150=>'.notdef',151=>'.notdef',152=>'.notdef',153=>'.notdef',154=>'.notdef',155=>'.notdef',156=>'.notdef',157=>'.notdef',158=>'.notdef',159=>'.notdef',160=>'Euro',161=>'Upsilon1',162=>'minute',163=>'lessequal',164=>'fraction',165=>'infinity',166=>'florin',167=>'club',168=>'diamond',169=>'heart',170=>'spade',171=>'arrowboth',172=>'arrowleft',173=>'arrowup',174=>'arrowright',175=>'arrowdown',176=>'degree',177=>'plusminus',178=>'second',179=>'greaterequal',180=>'multiply',181=>'proportional',182=>'partialdiff',183=>'bullet',184=>'divide',185=>'notequal',186=>'equivalence',187=>'approxequal',188=>'ellipsis',189=>'arrowvertex',190=>'arrowhorizex',191=>'carriagereturn',192=>'aleph',193=>'Ifraktur',194=>'Rfraktur',195=>'weierstrass',196=>'circlemultiply',197=>'circleplus',198=>'emptyset',199=>'intersection',200=>'union',201=>'propersuperset',202=>'reflexsuperset',203=>'notsubset',204=>'propersubset',205=>'reflexsubset',206=>'element',207=>'notelement',208=>'angle',209=>'gradient',210=>'registerserif',211=>'copyrightserif',212=>'trademarkserif',213=>'product',214=>'radical',215=>'dotmath',216=>'logicalnot',217=>'logicaland',218=>'logicalor',219=>'arrowdblboth',220=>'arrowdblleft',221=>'arrowdblup',222=>'arrowdblright',223=>'arrowdbldown',224=>'lozenge',225=>'angleleft',226=>'registersans',227=>'copyrightsans',228=>'trademarksans',229=>'summation',230=>'parenlefttp',231=>'parenleftex',232=>'parenleftbt',233=>'bracketlefttp',234=>'bracketleftex',235=>'bracketleftbt',236=>'bracelefttp',237=>'braceleftmid',238=>'braceleftbt',239=>'braceex',240=>'.notdef',241=>'angleright',242=>'integral',243=>'integraltp',244=>'integralex',245=>'integralbt',246=>'parenrighttp',247=>'parenrightex',248=>'parenrightbt',249=>'bracketrighttp',250=>'bracketrightex',251=>'bracketrightbt',252=>'bracerighttp',253=>'bracerightmid',254=>'bracerightbt',255=>'.notdef',1226=>'registered',1227=>'copyright',1228=>'trademark') + +); // end of encoding maps + +/** + * ToUnicode map for Identity-H stream + * @public static + */ +public static $uni_identity_h = "/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo << /Registry (Adobe) /Ordering (UCS) /Supplement 0 >> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n/WMode 0 def\n1 begincodespacerange\n<0000> \nendcodespacerange\n100 beginbfrange\n<0000> <00ff> <0000>\n<0100> <01ff> <0100>\n<0200> <02ff> <0200>\n<0300> <03ff> <0300>\n<0400> <04ff> <0400>\n<0500> <05ff> <0500>\n<0600> <06ff> <0600>\n<0700> <07ff> <0700>\n<0800> <08ff> <0800>\n<0900> <09ff> <0900>\n<0a00> <0aff> <0a00>\n<0b00> <0bff> <0b00>\n<0c00> <0cff> <0c00>\n<0d00> <0dff> <0d00>\n<0e00> <0eff> <0e00>\n<0f00> <0fff> <0f00>\n<1000> <10ff> <1000>\n<1100> <11ff> <1100>\n<1200> <12ff> <1200>\n<1300> <13ff> <1300>\n<1400> <14ff> <1400>\n<1500> <15ff> <1500>\n<1600> <16ff> <1600>\n<1700> <17ff> <1700>\n<1800> <18ff> <1800>\n<1900> <19ff> <1900>\n<1a00> <1aff> <1a00>\n<1b00> <1bff> <1b00>\n<1c00> <1cff> <1c00>\n<1d00> <1dff> <1d00>\n<1e00> <1eff> <1e00>\n<1f00> <1fff> <1f00>\n<2000> <20ff> <2000>\n<2100> <21ff> <2100>\n<2200> <22ff> <2200>\n<2300> <23ff> <2300>\n<2400> <24ff> <2400>\n<2500> <25ff> <2500>\n<2600> <26ff> <2600>\n<2700> <27ff> <2700>\n<2800> <28ff> <2800>\n<2900> <29ff> <2900>\n<2a00> <2aff> <2a00>\n<2b00> <2bff> <2b00>\n<2c00> <2cff> <2c00>\n<2d00> <2dff> <2d00>\n<2e00> <2eff> <2e00>\n<2f00> <2fff> <2f00>\n<3000> <30ff> <3000>\n<3100> <31ff> <3100>\n<3200> <32ff> <3200>\n<3300> <33ff> <3300>\n<3400> <34ff> <3400>\n<3500> <35ff> <3500>\n<3600> <36ff> <3600>\n<3700> <37ff> <3700>\n<3800> <38ff> <3800>\n<3900> <39ff> <3900>\n<3a00> <3aff> <3a00>\n<3b00> <3bff> <3b00>\n<3c00> <3cff> <3c00>\n<3d00> <3dff> <3d00>\n<3e00> <3eff> <3e00>\n<3f00> <3fff> <3f00>\n<4000> <40ff> <4000>\n<4100> <41ff> <4100>\n<4200> <42ff> <4200>\n<4300> <43ff> <4300>\n<4400> <44ff> <4400>\n<4500> <45ff> <4500>\n<4600> <46ff> <4600>\n<4700> <47ff> <4700>\n<4800> <48ff> <4800>\n<4900> <49ff> <4900>\n<4a00> <4aff> <4a00>\n<4b00> <4bff> <4b00>\n<4c00> <4cff> <4c00>\n<4d00> <4dff> <4d00>\n<4e00> <4eff> <4e00>\n<4f00> <4fff> <4f00>\n<5000> <50ff> <5000>\n<5100> <51ff> <5100>\n<5200> <52ff> <5200>\n<5300> <53ff> <5300>\n<5400> <54ff> <5400>\n<5500> <55ff> <5500>\n<5600> <56ff> <5600>\n<5700> <57ff> <5700>\n<5800> <58ff> <5800>\n<5900> <59ff> <5900>\n<5a00> <5aff> <5a00>\n<5b00> <5bff> <5b00>\n<5c00> <5cff> <5c00>\n<5d00> <5dff> <5d00>\n<5e00> <5eff> <5e00>\n<5f00> <5fff> <5f00>\n<6000> <60ff> <6000>\n<6100> <61ff> <6100>\n<6200> <62ff> <6200>\n<6300> <63ff> <6300>\nendbfrange\n100 beginbfrange\n<6400> <64ff> <6400>\n<6500> <65ff> <6500>\n<6600> <66ff> <6600>\n<6700> <67ff> <6700>\n<6800> <68ff> <6800>\n<6900> <69ff> <6900>\n<6a00> <6aff> <6a00>\n<6b00> <6bff> <6b00>\n<6c00> <6cff> <6c00>\n<6d00> <6dff> <6d00>\n<6e00> <6eff> <6e00>\n<6f00> <6fff> <6f00>\n<7000> <70ff> <7000>\n<7100> <71ff> <7100>\n<7200> <72ff> <7200>\n<7300> <73ff> <7300>\n<7400> <74ff> <7400>\n<7500> <75ff> <7500>\n<7600> <76ff> <7600>\n<7700> <77ff> <7700>\n<7800> <78ff> <7800>\n<7900> <79ff> <7900>\n<7a00> <7aff> <7a00>\n<7b00> <7bff> <7b00>\n<7c00> <7cff> <7c00>\n<7d00> <7dff> <7d00>\n<7e00> <7eff> <7e00>\n<7f00> <7fff> <7f00>\n<8000> <80ff> <8000>\n<8100> <81ff> <8100>\n<8200> <82ff> <8200>\n<8300> <83ff> <8300>\n<8400> <84ff> <8400>\n<8500> <85ff> <8500>\n<8600> <86ff> <8600>\n<8700> <87ff> <8700>\n<8800> <88ff> <8800>\n<8900> <89ff> <8900>\n<8a00> <8aff> <8a00>\n<8b00> <8bff> <8b00>\n<8c00> <8cff> <8c00>\n<8d00> <8dff> <8d00>\n<8e00> <8eff> <8e00>\n<8f00> <8fff> <8f00>\n<9000> <90ff> <9000>\n<9100> <91ff> <9100>\n<9200> <92ff> <9200>\n<9300> <93ff> <9300>\n<9400> <94ff> <9400>\n<9500> <95ff> <9500>\n<9600> <96ff> <9600>\n<9700> <97ff> <9700>\n<9800> <98ff> <9800>\n<9900> <99ff> <9900>\n<9a00> <9aff> <9a00>\n<9b00> <9bff> <9b00>\n<9c00> <9cff> <9c00>\n<9d00> <9dff> <9d00>\n<9e00> <9eff> <9e00>\n<9f00> <9fff> <9f00>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nendbfrange\n56 beginbfrange\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nendbfrange\nendcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"; + +} // END OF TCPDF_FONT_DATA CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_fonts.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_fonts.php new file mode 100755 index 0000000..30053d3 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_fonts.php @@ -0,0 +1,2657 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description :Font methods for TCPDF library. +// +//============================================================+ + +/** + * @file + * Unicode data and font methods for TCPDF library. + * @author Nicola Asuni + * @package com.tecnick.tcpdf + */ + +/** + * @class TCPDF_FONTS + * Font methods for TCPDF library. + * @package com.tecnick.tcpdf + * @version 1.1.0 + * @author Nicola Asuni - info@tecnick.com + */ +class TCPDF_FONTS { + + /** + * Static cache used for speed up uniord performances + * @protected + */ + protected static $cache_uniord = array(); + + /** + * Convert and add the selected TrueType or Type1 font to the fonts folder (that must be writeable). + * @param string $fontfile Font file (full path). + * @param string $fonttype Font type. Leave empty for autodetect mode. Valid values are: TrueTypeUnicode, TrueType, Type1, CID0JP = CID-0 Japanese, CID0KR = CID-0 Korean, CID0CS = CID-0 Chinese Simplified, CID0CT = CID-0 Chinese Traditional. + * @param string $enc Name of the encoding table to use. Leave empty for default mode. Omit this parameter for TrueType Unicode and symbolic fonts like Symbol or ZapfDingBats. + * @param int $flags Unsigned 32-bit integer containing flags specifying various characteristics of the font (PDF32000:2008 - 9.8.2 Font Descriptor Flags): +1 for fixed font; +4 for symbol or +32 for non-symbol; +64 for italic. Fixed and Italic mode are generally autodetected so you have to set it to 32 = non-symbolic font (default) or 4 = symbolic font. + * @param string $outpath Output path for generated font files (must be writeable by the web server). Leave empty for default font folder. + * @param int $platid Platform ID for CMAP table to extract (when building a Unicode font for Windows this value should be 3, for Macintosh should be 1). + * @param int $encid Encoding ID for CMAP table to extract (when building a Unicode font for Windows this value should be 1, for Macintosh should be 0). When Platform ID is 3, legal values for Encoding ID are: 0=Symbol, 1=Unicode, 2=ShiftJIS, 3=PRC, 4=Big5, 5=Wansung, 6=Johab, 7=Reserved, 8=Reserved, 9=Reserved, 10=UCS-4. + * @param boolean $addcbbox If true includes the character bounding box information on the php font file. + * @param boolean $link If true link to system font instead of copying the font data (not transportable) - Note: do not work with Type1 fonts. + * @return string|false TCPDF font name or boolean false in case of error. + * @author Nicola Asuni + * @since 5.9.123 (2010-09-30) + * @public static + */ + public static function addTTFfont($fontfile, $fonttype='', $enc='', $flags=32, $outpath='', $platid=3, $encid=1, $addcbbox=false, $link=false) { + if (!TCPDF_STATIC::file_exists($fontfile)) { + // Could not find file + return false; + } + // font metrics + $fmetric = array(); + // build new font name for TCPDF compatibility + $font_path_parts = pathinfo($fontfile); + if (!isset($font_path_parts['filename'])) { + $font_path_parts['filename'] = substr($font_path_parts['basename'], 0, -(strlen($font_path_parts['extension']) + 1)); + } + $font_name = strtolower($font_path_parts['filename']); + $font_name = preg_replace('/[^a-z0-9_]/', '', $font_name); + $search = array('bold', 'oblique', 'italic', 'regular'); + $replace = array('b', 'i', 'i', ''); + $font_name = str_replace($search, $replace, $font_name); + if (empty($font_name)) { + // set generic name + $font_name = 'tcpdffont'; + } + // set output path + if (empty($outpath)) { + $outpath = self::_getfontpath(); + } + // check if this font already exist + if (@TCPDF_STATIC::file_exists($outpath.$font_name.'.php')) { + // this font already exist (delete it from fonts folder to rebuild it) + return $font_name; + } + $fmetric['file'] = $font_name; + $fmetric['ctg'] = $font_name.'.ctg.z'; + // get font data + $font = file_get_contents($fontfile); + $fmetric['originalsize'] = strlen($font); + // autodetect font type + if (empty($fonttype)) { + if (TCPDF_STATIC::_getULONG($font, 0) == 0x10000) { + // True Type (Unicode or not) + $fonttype = 'TrueTypeUnicode'; + } elseif (substr($font, 0, 4) == 'OTTO') { + // Open Type (Unicode or not) + //Unsupported font format: OpenType with CFF data + return false; + } else { + // Type 1 + $fonttype = 'Type1'; + } + } + // set font type + switch ($fonttype) { + case 'CID0CT': + case 'CID0CS': + case 'CID0KR': + case 'CID0JP': { + $fmetric['type'] = 'cidfont0'; + break; + } + case 'Type1': { + $fmetric['type'] = 'Type1'; + if (empty($enc) AND (($flags & 4) == 0)) { + $enc = 'cp1252'; + } + break; + } + case 'TrueType': { + $fmetric['type'] = 'TrueType'; + break; + } + case 'TrueTypeUnicode': + default: { + $fmetric['type'] = 'TrueTypeUnicode'; + break; + } + } + // set encoding maps (if any) + $fmetric['enc'] = preg_replace('/[^A-Za-z0-9_\-]/', '', $enc); + $fmetric['diff'] = ''; + if (($fmetric['type'] == 'TrueType') OR ($fmetric['type'] == 'Type1')) { + if (!empty($enc) AND ($enc != 'cp1252') AND isset(TCPDF_FONT_DATA::$encmap[$enc])) { + // build differences from reference encoding + $enc_ref = TCPDF_FONT_DATA::$encmap['cp1252']; + $enc_target = TCPDF_FONT_DATA::$encmap[$enc]; + $last = 0; + for ($i = 32; $i <= 255; ++$i) { + if ($enc_target[$i] != $enc_ref[$i]) { + if ($i != ($last + 1)) { + $fmetric['diff'] .= $i.' '; + } + $last = $i; + $fmetric['diff'] .= '/'.$enc_target[$i].' '; + } + } + } + } + // parse the font by type + if ($fmetric['type'] == 'Type1') { + // ---------- TYPE 1 ---------- + // read first segment + $a = unpack('Cmarker/Ctype/Vsize', substr($font, 0, 6)); + if ($a['marker'] != 128) { + // Font file is not a valid binary Type1 + return false; + } + $fmetric['size1'] = $a['size']; + $data = substr($font, 6, $fmetric['size1']); + // read second segment + $a = unpack('Cmarker/Ctype/Vsize', substr($font, (6 + $fmetric['size1']), 6)); + if ($a['marker'] != 128) { + // Font file is not a valid binary Type1 + return false; + } + $fmetric['size2'] = $a['size']; + $encrypted = substr($font, (12 + $fmetric['size1']), $fmetric['size2']); + $data .= $encrypted; + // store compressed font + $fmetric['file'] .= '.z'; + $fp = TCPDF_STATIC::fopenLocal($outpath.$fmetric['file'], 'wb'); + fwrite($fp, gzcompress($data)); + fclose($fp); + // get font info + $fmetric['Flags'] = $flags; + preg_match ('#/FullName[\s]*\(([^\)]*)#', $font, $matches); + $fmetric['name'] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $matches[1]); + preg_match('#/FontBBox[\s]*{([^}]*)#', $font, $matches); + $fmetric['bbox'] = trim($matches[1]); + $bv = explode(' ', $fmetric['bbox']); + $fmetric['Ascent'] = intval($bv[3]); + $fmetric['Descent'] = intval($bv[1]); + preg_match('#/ItalicAngle[\s]*([0-9\+\-]*)#', $font, $matches); + $fmetric['italicAngle'] = intval($matches[1]); + if ($fmetric['italicAngle'] != 0) { + $fmetric['Flags'] |= 64; + } + preg_match('#/UnderlinePosition[\s]*([0-9\+\-]*)#', $font, $matches); + $fmetric['underlinePosition'] = intval($matches[1]); + preg_match('#/UnderlineThickness[\s]*([0-9\+\-]*)#', $font, $matches); + $fmetric['underlineThickness'] = intval($matches[1]); + preg_match('#/isFixedPitch[\s]*([^\s]*)#', $font, $matches); + if ($matches[1] == 'true') { + $fmetric['Flags'] |= 1; + } + // get internal map + $imap = array(); + if (preg_match_all('#dup[\s]([0-9]+)[\s]*/([^\s]*)[\s]put#sU', $font, $fmap, PREG_SET_ORDER) > 0) { + foreach ($fmap as $v) { + $imap[$v[2]] = $v[1]; + } + } + // decrypt eexec encrypted part + $r = 55665; // eexec encryption constant + $c1 = 52845; + $c2 = 22719; + $elen = strlen($encrypted); + $eplain = ''; + for ($i = 0; $i < $elen; ++$i) { + $chr = ord($encrypted[$i]); + $eplain .= chr($chr ^ ($r >> 8)); + $r = ((($chr + $r) * $c1 + $c2) % 65536); + } + if (preg_match('#/ForceBold[\s]*([^\s]*)#', $eplain, $matches) > 0) { + if ($matches[1] == 'true') { + $fmetric['Flags'] |= 0x40000; + } + } + if (preg_match('#/StdVW[\s]*\[([^\]]*)#', $eplain, $matches) > 0) { + $fmetric['StemV'] = intval($matches[1]); + } else { + $fmetric['StemV'] = 70; + } + if (preg_match('#/StdHW[\s]*\[([^\]]*)#', $eplain, $matches) > 0) { + $fmetric['StemH'] = intval($matches[1]); + } else { + $fmetric['StemH'] = 30; + } + if (preg_match('#/BlueValues[\s]*\[([^\]]*)#', $eplain, $matches) > 0) { + $bv = explode(' ', $matches[1]); + if (count($bv) >= 6) { + $v1 = intval($bv[2]); + $v2 = intval($bv[4]); + if ($v1 <= $v2) { + $fmetric['XHeight'] = $v1; + $fmetric['CapHeight'] = $v2; + } else { + $fmetric['XHeight'] = $v2; + $fmetric['CapHeight'] = $v1; + } + } else { + $fmetric['XHeight'] = 450; + $fmetric['CapHeight'] = 700; + } + } else { + $fmetric['XHeight'] = 450; + $fmetric['CapHeight'] = 700; + } + // get the number of random bytes at the beginning of charstrings + if (preg_match('#/lenIV[\s]*([0-9]*)#', $eplain, $matches) > 0) { + $lenIV = intval($matches[1]); + } else { + $lenIV = 4; + } + $fmetric['Leading'] = 0; + // get charstring data + $eplain = substr($eplain, (strpos($eplain, '/CharStrings') + 1)); + preg_match_all('#/([A-Za-z0-9\.]*)[\s][0-9]+[\s]RD[\s](.*)[\s]ND#sU', $eplain, $matches, PREG_SET_ORDER); + if (!empty($enc) AND isset(TCPDF_FONT_DATA::$encmap[$enc])) { + $enc_map = TCPDF_FONT_DATA::$encmap[$enc]; + } else { + $enc_map = false; + } + $fmetric['cw'] = ''; + $fmetric['MaxWidth'] = 0; + $cwidths = array(); + foreach ($matches as $k => $v) { + $cid = 0; + if (isset($imap[$v[1]])) { + $cid = $imap[$v[1]]; + } elseif ($enc_map !== false) { + $cid = array_search($v[1], $enc_map); + if ($cid === false) { + $cid = 0; + } elseif ($cid > 1000) { + $cid -= 1000; + } + } + // decrypt charstring encrypted part + $r = 4330; // charstring encryption constant + $c1 = 52845; + $c2 = 22719; + $cd = $v[2]; + $clen = strlen($cd); + $ccom = array(); + for ($i = 0; $i < $clen; ++$i) { + $chr = ord($cd[$i]); + $ccom[] = ($chr ^ ($r >> 8)); + $r = ((($chr + $r) * $c1 + $c2) % 65536); + } + // decode numbers + $cdec = array(); + $ck = 0; + $i = $lenIV; + while ($i < $clen) { + if ($ccom[$i] < 32) { + $cdec[$ck] = $ccom[$i]; + if (($ck > 0) AND ($cdec[$ck] == 13)) { + // hsbw command: update width + $cwidths[$cid] = $cdec[($ck - 1)]; + } + ++$i; + } elseif (($ccom[$i] >= 32) AND ($ccom[$i] <= 246)) { + $cdec[$ck] = ($ccom[$i] - 139); + ++$i; + } elseif (($ccom[$i] >= 247) AND ($ccom[$i] <= 250)) { + $cdec[$ck] = ((($ccom[$i] - 247) * 256) + $ccom[($i + 1)] + 108); + $i += 2; + } elseif (($ccom[$i] >= 251) AND ($ccom[$i] <= 254)) { + $cdec[$ck] = ((-($ccom[$i] - 251) * 256) - $ccom[($i + 1)] - 108); + $i += 2; + } elseif ($ccom[$i] == 255) { + $sval = chr($ccom[($i + 1)]).chr($ccom[($i + 2)]).chr($ccom[($i + 3)]).chr($ccom[($i + 4)]); + $vsval = unpack('li', $sval); + $cdec[$ck] = $vsval['i']; + $i += 5; + } + ++$ck; + } + } // end for each matches + $fmetric['MissingWidth'] = $cwidths[0]; + $fmetric['MaxWidth'] = $fmetric['MissingWidth']; + $fmetric['AvgWidth'] = 0; + // set chars widths + for ($cid = 0; $cid <= 255; ++$cid) { + if (isset($cwidths[$cid])) { + if ($cwidths[$cid] > $fmetric['MaxWidth']) { + $fmetric['MaxWidth'] = $cwidths[$cid]; + } + $fmetric['AvgWidth'] += $cwidths[$cid]; + $fmetric['cw'] .= ','.$cid.'=>'.$cwidths[$cid]; + } else { + $fmetric['cw'] .= ','.$cid.'=>'.$fmetric['MissingWidth']; + } + } + $fmetric['AvgWidth'] = round($fmetric['AvgWidth'] / count($cwidths)); + } else { + // ---------- TRUE TYPE ---------- + $offset = 0; // offset position of the font data + if (TCPDF_STATIC::_getULONG($font, $offset) != 0x10000) { + // sfnt version must be 0x00010000 for TrueType version 1.0. + return false; + } + if ($fmetric['type'] != 'cidfont0') { + if ($link) { + // creates a symbolic link to the existing font + symlink($fontfile, $outpath.$fmetric['file']); + } else { + // store compressed font + $fmetric['file'] .= '.z'; + $fp = TCPDF_STATIC::fopenLocal($outpath.$fmetric['file'], 'wb'); + fwrite($fp, gzcompress($font)); + fclose($fp); + } + } + $offset += 4; + // get number of tables + $numTables = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + // skip searchRange, entrySelector and rangeShift + $offset += 6; + // tables array + $table = array(); + // ---------- get tables ---------- + for ($i = 0; $i < $numTables; ++$i) { + // get table info + $tag = substr($font, $offset, 4); + $offset += 4; + $table[$tag] = array(); + $table[$tag]['checkSum'] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $table[$tag]['offset'] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $table[$tag]['length'] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + } + // check magicNumber + $offset = $table['head']['offset'] + 12; + if (TCPDF_STATIC::_getULONG($font, $offset) != 0x5F0F3CF5) { + // magicNumber must be 0x5F0F3CF5 + return false; + } + $offset += 4; + $offset += 2; // skip flags + // get FUnits + $fmetric['unitsPerEm'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + // units ratio constant + $urk = (1000 / $fmetric['unitsPerEm']); + $offset += 16; // skip created, modified + $xMin = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + $yMin = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + $xMax = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + $yMax = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + $fmetric['bbox'] = ''.$xMin.' '.$yMin.' '.$xMax.' '.$yMax.''; + $macStyle = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + // PDF font flags + $fmetric['Flags'] = $flags; + if (($macStyle & 2) == 2) { + // italic flag + $fmetric['Flags'] |= 64; + } + // get offset mode (indexToLocFormat : 0 = short, 1 = long) + $offset = $table['head']['offset'] + 50; + $short_offset = (TCPDF_STATIC::_getSHORT($font, $offset) == 0); + $offset += 2; + // get the offsets to the locations of the glyphs in the font, relative to the beginning of the glyphData table + $indexToLoc = array(); + $offset = $table['loca']['offset']; + if ($short_offset) { + // short version + $tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1 + for ($i = 0; $i < $tot_num_glyphs; ++$i) { + $indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2; + if (isset($indexToLoc[($i - 1)]) && ($indexToLoc[$i] == $indexToLoc[($i - 1)])) { + // the last glyph didn't have an outline + unset($indexToLoc[($i - 1)]); + } + $offset += 2; + } + } else { + // long version + $tot_num_glyphs = floor($table['loca']['length'] / 4); // numGlyphs + 1 + for ($i = 0; $i < $tot_num_glyphs; ++$i) { + $indexToLoc[$i] = TCPDF_STATIC::_getULONG($font, $offset); + if (isset($indexToLoc[($i - 1)]) && ($indexToLoc[$i] == $indexToLoc[($i - 1)])) { + // the last glyph didn't have an outline + unset($indexToLoc[($i - 1)]); + } + $offset += 4; + } + } + // get glyphs indexes of chars from cmap table + $offset = $table['cmap']['offset'] + 2; + $numEncodingTables = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $encodingTables = array(); + for ($i = 0; $i < $numEncodingTables; ++$i) { + $encodingTables[$i]['platformID'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $encodingTables[$i]['encodingID'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $encodingTables[$i]['offset'] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + } + // ---------- get os/2 metrics ---------- + $offset = $table['OS/2']['offset']; + $offset += 2; // skip version + // xAvgCharWidth + $fmetric['AvgWidth'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + // usWeightClass + $usWeightClass = round(TCPDF_STATIC::_getUFWORD($font, $offset) * $urk); + // estimate StemV and StemH (400 = usWeightClass for Normal - Regular font) + $fmetric['StemV'] = round((70 * $usWeightClass) / 400); + $fmetric['StemH'] = round((30 * $usWeightClass) / 400); + $offset += 2; + $offset += 2; // usWidthClass + $fsType = TCPDF_STATIC::_getSHORT($font, $offset); + $offset += 2; + if ($fsType == 2) { + // This Font cannot be modified, embedded or exchanged in any manner without first obtaining permission of the legal owner. + return false; + } + // ---------- get font name ---------- + $fmetric['name'] = ''; + $offset = $table['name']['offset']; + $offset += 2; // skip Format selector (=0). + // Number of NameRecords that follow n. + $numNameRecords = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + // Offset to start of string storage (from start of table). + $stringStorageOffset = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + for ($i = 0; $i < $numNameRecords; ++$i) { + $offset += 6; // skip Platform ID, Platform-specific encoding ID, Language ID. + // Name ID. + $nameID = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + if ($nameID == 6) { + // String length (in bytes). + $stringLength = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + // String offset from start of storage area (in bytes). + $stringOffset = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $offset = ($table['name']['offset'] + $stringStorageOffset + $stringOffset); + $fmetric['name'] = substr($font, $offset, $stringLength); + $fmetric['name'] = preg_replace('/[^a-zA-Z0-9_\-]/', '', $fmetric['name']); + break; + } else { + $offset += 4; // skip String length, String offset + } + } + if (empty($fmetric['name'])) { + $fmetric['name'] = $font_name; + } + // ---------- get post data ---------- + $offset = $table['post']['offset']; + $offset += 4; // skip Format Type + $fmetric['italicAngle'] = TCPDF_STATIC::_getFIXED($font, $offset); + $offset += 4; + $fmetric['underlinePosition'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + $fmetric['underlineThickness'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + $isFixedPitch = (TCPDF_STATIC::_getULONG($font, $offset) == 0) ? false : true; + $offset += 2; + if ($isFixedPitch) { + $fmetric['Flags'] |= 1; + } + // ---------- get hhea data ---------- + $offset = $table['hhea']['offset']; + $offset += 4; // skip Table version number + // Ascender + $fmetric['Ascent'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + // Descender + $fmetric['Descent'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + // LineGap + $fmetric['Leading'] = round(TCPDF_STATIC::_getFWORD($font, $offset) * $urk); + $offset += 2; + // advanceWidthMax + $fmetric['MaxWidth'] = round(TCPDF_STATIC::_getUFWORD($font, $offset) * $urk); + $offset += 2; + $offset += 22; // skip some values + // get the number of hMetric entries in hmtx table + $numberOfHMetrics = TCPDF_STATIC::_getUSHORT($font, $offset); + // ---------- get maxp data ---------- + $offset = $table['maxp']['offset']; + $offset += 4; // skip Table version number + // get the the number of glyphs in the font. + $numGlyphs = TCPDF_STATIC::_getUSHORT($font, $offset); + // ---------- get CIDToGIDMap ---------- + $ctg = array(); + $c = 0; + foreach ($encodingTables as $enctable) { + // get only specified Platform ID and Encoding ID + if (($enctable['platformID'] == $platid) AND ($enctable['encodingID'] == $encid)) { + $offset = $table['cmap']['offset'] + $enctable['offset']; + $format = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + switch ($format) { + case 0: { // Format 0: Byte encoding table + $offset += 4; // skip length and version/language + for ($c = 0; $c < 256; ++$c) { + $g = TCPDF_STATIC::_getBYTE($font, $offset); + $ctg[$c] = $g; + ++$offset; + } + break; + } + case 2: { // Format 2: High-byte mapping through table + $offset += 4; // skip length and version/language + $numSubHeaders = 0; + for ($i = 0; $i < 256; ++$i) { + // Array that maps high bytes to subHeaders: value is subHeader index * 8. + $subHeaderKeys[$i] = (TCPDF_STATIC::_getUSHORT($font, $offset) / 8); + $offset += 2; + if ($numSubHeaders < $subHeaderKeys[$i]) { + $numSubHeaders = $subHeaderKeys[$i]; + } + } + // the number of subHeaders is equal to the max of subHeaderKeys + 1 + ++$numSubHeaders; + // read subHeader structures + $subHeaders = array(); + $numGlyphIndexArray = 0; + for ($k = 0; $k < $numSubHeaders; ++$k) { + $subHeaders[$k]['firstCode'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $subHeaders[$k]['entryCount'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $subHeaders[$k]['idDelta'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $subHeaders[$k]['idRangeOffset'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $subHeaders[$k]['idRangeOffset'] -= (2 + (($numSubHeaders - $k - 1) * 8)); + $subHeaders[$k]['idRangeOffset'] /= 2; + $numGlyphIndexArray += $subHeaders[$k]['entryCount']; + } + for ($k = 0; $k < $numGlyphIndexArray; ++$k) { + $glyphIndexArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + for ($i = 0; $i < 256; ++$i) { + $k = $subHeaderKeys[$i]; + if ($k == 0) { + // one byte code + $c = $i; + $g = $glyphIndexArray[0]; + $ctg[$c] = $g; + } else { + // two bytes code + $start_byte = $subHeaders[$k]['firstCode']; + $end_byte = $start_byte + $subHeaders[$k]['entryCount']; + for ($j = $start_byte; $j < $end_byte; ++$j) { + // combine high and low bytes + $c = (($i << 8) + $j); + $idRangeOffset = ($subHeaders[$k]['idRangeOffset'] + $j - $subHeaders[$k]['firstCode']); + $g = ($glyphIndexArray[$idRangeOffset] + $subHeaders[$k]['idDelta']) % 65536; + if ($g < 0) { + $g = 0; + } + $ctg[$c] = $g; + } + } + } + break; + } + case 4: { // Format 4: Segment mapping to delta values + $length = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $offset += 2; // skip version/language + $segCount = floor(TCPDF_STATIC::_getUSHORT($font, $offset) / 2); + $offset += 2; + $offset += 6; // skip searchRange, entrySelector, rangeShift + $endCount = array(); // array of end character codes for each segment + for ($k = 0; $k < $segCount; ++$k) { + $endCount[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + $offset += 2; // skip reservedPad + $startCount = array(); // array of start character codes for each segment + for ($k = 0; $k < $segCount; ++$k) { + $startCount[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + $idDelta = array(); // delta for all character codes in segment + for ($k = 0; $k < $segCount; ++$k) { + $idDelta[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + $idRangeOffset = array(); // Offsets into glyphIdArray or 0 + for ($k = 0; $k < $segCount; ++$k) { + $idRangeOffset[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + $gidlen = (floor($length / 2) - 8 - (4 * $segCount)); + $glyphIdArray = array(); // glyph index array + for ($k = 0; $k < $gidlen; ++$k) { + $glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + for ($k = 0; $k < $segCount - 1; ++$k) { + for ($c = $startCount[$k]; $c <= $endCount[$k]; ++$c) { + if ($idRangeOffset[$k] == 0) { + $g = ($idDelta[$k] + $c) % 65536; + } else { + $gid = (floor($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k)); + $g = ($glyphIdArray[$gid] + $idDelta[$k]) % 65536; + } + if ($g < 0) { + $g = 0; + } + $ctg[$c] = $g; + } + } + break; + } + case 6: { // Format 6: Trimmed table mapping + $offset += 4; // skip length and version/language + $firstCode = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $entryCount = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + for ($k = 0; $k < $entryCount; ++$k) { + $c = ($k + $firstCode); + $g = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $ctg[$c] = $g; + } + break; + } + case 8: { // Format 8: Mixed 16-bit and 32-bit coverage + $offset += 10; // skip reserved, length and version/language + for ($k = 0; $k < 8192; ++$k) { + $is32[$k] = TCPDF_STATIC::_getBYTE($font, $offset); + ++$offset; + } + $nGroups = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($i = 0; $i < $nGroups; ++$i) { + $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $endCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $startGlyphID = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($k = $startCharCode; $k <= $endCharCode; ++$k) { + $is32idx = floor($c / 8); + if ((isset($is32[$is32idx])) AND (($is32[$is32idx] & (1 << (7 - ($c % 8)))) == 0)) { + $c = $k; + } else { + // 32 bit format + // convert to decimal (http://www.unicode.org/faq//utf_bom.html#utf16-4) + //LEAD_OFFSET = (0xD800 - (0x10000 >> 10)) = 55232 + //SURROGATE_OFFSET = (0x10000 - (0xD800 << 10) - 0xDC00) = -56613888 + $c = ((55232 + ($k >> 10)) << 10) + (0xDC00 + ($k & 0x3FF)) -56613888; + } + $ctg[$c] = 0; + ++$startGlyphID; + } + } + break; + } + case 10: { // Format 10: Trimmed array + $offset += 10; // skip reserved, length and version/language + $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $numChars = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($k = 0; $k < $numChars; ++$k) { + $c = ($k + $startCharCode); + $g = TCPDF_STATIC::_getUSHORT($font, $offset); + $ctg[$c] = $g; + $offset += 2; + } + break; + } + case 12: { // Format 12: Segmented coverage + $offset += 10; // skip length and version/language + $nGroups = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($k = 0; $k < $nGroups; ++$k) { + $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $endCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $startGlyphCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($c = $startCharCode; $c <= $endCharCode; ++$c) { + $ctg[$c] = $startGlyphCode; + ++$startGlyphCode; + } + } + break; + } + case 13: { // Format 13: Many-to-one range mappings + // to be implemented ... + break; + } + case 14: { // Format 14: Unicode Variation Sequences + // to be implemented ... + break; + } + } + } + } + if (!isset($ctg[0])) { + $ctg[0] = 0; + } + // get xHeight (height of x) + $offset = ($table['glyf']['offset'] + $indexToLoc[$ctg[120]] + 4); + $yMin = TCPDF_STATIC::_getFWORD($font, $offset); + $offset += 4; + $yMax = TCPDF_STATIC::_getFWORD($font, $offset); + $offset += 2; + $fmetric['XHeight'] = round(($yMax - $yMin) * $urk); + // get CapHeight (height of H) + $offset = ($table['glyf']['offset'] + $indexToLoc[$ctg[72]] + 4); + $yMin = TCPDF_STATIC::_getFWORD($font, $offset); + $offset += 4; + $yMax = TCPDF_STATIC::_getFWORD($font, $offset); + $offset += 2; + $fmetric['CapHeight'] = round(($yMax - $yMin) * $urk); + // ceate widths array + $cw = array(); + $offset = $table['hmtx']['offset']; + for ($i = 0 ; $i < $numberOfHMetrics; ++$i) { + $cw[$i] = round(TCPDF_STATIC::_getUFWORD($font, $offset) * $urk); + $offset += 4; // skip lsb + } + if ($numberOfHMetrics < $numGlyphs) { + // fill missing widths with the last value + $cw = array_pad($cw, $numGlyphs, $cw[($numberOfHMetrics - 1)]); + } + $fmetric['MissingWidth'] = $cw[0]; + $fmetric['cw'] = ''; + $fmetric['cbbox'] = ''; + for ($cid = 0; $cid <= 65535; ++$cid) { + if (isset($ctg[$cid])) { + if (isset($cw[$ctg[$cid]])) { + $fmetric['cw'] .= ','.$cid.'=>'.$cw[$ctg[$cid]]; + } + if ($addcbbox AND isset($indexToLoc[$ctg[$cid]])) { + $offset = ($table['glyf']['offset'] + $indexToLoc[$ctg[$cid]]); + $xMin = round(TCPDF_STATIC::_getFWORD($font, $offset + 2) * $urk); + $yMin = round(TCPDF_STATIC::_getFWORD($font, $offset + 4) * $urk); + $xMax = round(TCPDF_STATIC::_getFWORD($font, $offset + 6) * $urk); + $yMax = round(TCPDF_STATIC::_getFWORD($font, $offset + 8) * $urk); + $fmetric['cbbox'] .= ','.$cid.'=>array('.$xMin.','.$yMin.','.$xMax.','.$yMax.')'; + } + } + } + } // end of true type + if (($fmetric['type'] == 'TrueTypeUnicode') AND (count($ctg) == 256)) { + $fmetric['type'] = 'TrueType'; + } + // ---------- create php font file ---------- + $pfile = '<'.'?'.'php'."\n"; + $pfile .= '// TCPDF FONT FILE DESCRIPTION'."\n"; + $pfile .= '$type=\''.$fmetric['type'].'\';'."\n"; + $pfile .= '$name=\''.$fmetric['name'].'\';'."\n"; + $pfile .= '$up='.$fmetric['underlinePosition'].';'."\n"; + $pfile .= '$ut='.$fmetric['underlineThickness'].';'."\n"; + if ($fmetric['MissingWidth'] > 0) { + $pfile .= '$dw='.$fmetric['MissingWidth'].';'."\n"; + } else { + $pfile .= '$dw='.$fmetric['AvgWidth'].';'."\n"; + } + $pfile .= '$diff=\''.$fmetric['diff'].'\';'."\n"; + if ($fmetric['type'] == 'Type1') { + // Type 1 + $pfile .= '$enc=\''.$fmetric['enc'].'\';'."\n"; + $pfile .= '$file=\''.$fmetric['file'].'\';'."\n"; + $pfile .= '$size1='.$fmetric['size1'].';'."\n"; + $pfile .= '$size2='.$fmetric['size2'].';'."\n"; + } else { + $pfile .= '$originalsize='.$fmetric['originalsize'].';'."\n"; + if ($fmetric['type'] == 'cidfont0') { + // CID-0 + switch ($fonttype) { + case 'CID0JP': { + $pfile .= '// Japanese'."\n"; + $pfile .= '$enc=\'UniJIS-UTF16-H\';'."\n"; + $pfile .= '$cidinfo=array(\'Registry\'=>\'Adobe\', \'Ordering\'=>\'Japan1\',\'Supplement\'=>5);'."\n"; + $pfile .= 'include(dirname(__FILE__).\'/uni2cid_aj16.php\');'."\n"; + break; + } + case 'CID0KR': { + $pfile .= '// Korean'."\n"; + $pfile .= '$enc=\'UniKS-UTF16-H\';'."\n"; + $pfile .= '$cidinfo=array(\'Registry\'=>\'Adobe\', \'Ordering\'=>\'Korea1\',\'Supplement\'=>0);'."\n"; + $pfile .= 'include(dirname(__FILE__).\'/uni2cid_ak12.php\');'."\n"; + break; + } + case 'CID0CS': { + $pfile .= '// Chinese Simplified'."\n"; + $pfile .= '$enc=\'UniGB-UTF16-H\';'."\n"; + $pfile .= '$cidinfo=array(\'Registry\'=>\'Adobe\', \'Ordering\'=>\'GB1\',\'Supplement\'=>2);'."\n"; + $pfile .= 'include(dirname(__FILE__).\'/uni2cid_ag15.php\');'."\n"; + break; + } + case 'CID0CT': + default: { + $pfile .= '// Chinese Traditional'."\n"; + $pfile .= '$enc=\'UniCNS-UTF16-H\';'."\n"; + $pfile .= '$cidinfo=array(\'Registry\'=>\'Adobe\', \'Ordering\'=>\'CNS1\',\'Supplement\'=>0);'."\n"; + $pfile .= 'include(dirname(__FILE__).\'/uni2cid_aj16.php\');'."\n"; + break; + } + } + } else { + // TrueType + $pfile .= '$enc=\''.$fmetric['enc'].'\';'."\n"; + $pfile .= '$file=\''.$fmetric['file'].'\';'."\n"; + $pfile .= '$ctg=\''.$fmetric['ctg'].'\';'."\n"; + // create CIDToGIDMap + $cidtogidmap = str_pad('', 131072, "\x00"); // (256 * 256 * 2) = 131072 + foreach ($ctg as $cid => $gid) { + $cidtogidmap = self::updateCIDtoGIDmap($cidtogidmap, $cid, $ctg[$cid]); + } + // store compressed CIDToGIDMap + $fp = TCPDF_STATIC::fopenLocal($outpath.$fmetric['ctg'], 'wb'); + fwrite($fp, gzcompress($cidtogidmap)); + fclose($fp); + } + } + $pfile .= '$desc=array('; + $pfile .= '\'Flags\'=>'.$fmetric['Flags'].','; + $pfile .= '\'FontBBox\'=>\'['.$fmetric['bbox'].']\','; + $pfile .= '\'ItalicAngle\'=>'.$fmetric['italicAngle'].','; + $pfile .= '\'Ascent\'=>'.$fmetric['Ascent'].','; + $pfile .= '\'Descent\'=>'.$fmetric['Descent'].','; + $pfile .= '\'Leading\'=>'.$fmetric['Leading'].','; + $pfile .= '\'CapHeight\'=>'.$fmetric['CapHeight'].','; + $pfile .= '\'XHeight\'=>'.$fmetric['XHeight'].','; + $pfile .= '\'StemV\'=>'.$fmetric['StemV'].','; + $pfile .= '\'StemH\'=>'.$fmetric['StemH'].','; + $pfile .= '\'AvgWidth\'=>'.$fmetric['AvgWidth'].','; + $pfile .= '\'MaxWidth\'=>'.$fmetric['MaxWidth'].','; + $pfile .= '\'MissingWidth\'=>'.$fmetric['MissingWidth'].''; + $pfile .= ');'."\n"; + if (!empty($fmetric['cbbox'])) { + $pfile .= '$cbbox=array('.substr($fmetric['cbbox'], 1).');'."\n"; + } + $pfile .= '$cw=array('.substr($fmetric['cw'], 1).');'."\n"; + $pfile .= '// --- EOF ---'."\n"; + // store file + $fp = TCPDF_STATIC::fopenLocal($outpath.$font_name.'.php', 'w'); + fwrite($fp, $pfile); + fclose($fp); + // return TCPDF font name + return $font_name; + } + + /** + * Returs the checksum of a TTF table. + * @param string $table table to check + * @param int $length length of table in bytes + * @return int checksum + * @author Nicola Asuni + * @since 5.2.000 (2010-06-02) + * @public static + */ + public static function _getTTFtableChecksum($table, $length) { + $sum = 0; + $tlen = ($length / 4); + $offset = 0; + for ($i = 0; $i < $tlen; ++$i) { + $v = unpack('Ni', substr($table, $offset, 4)); + $sum += $v['i']; + $offset += 4; + } + $sum = unpack('Ni', pack('N', $sum)); + return $sum['i']; + } + + /** + * Returns a subset of the TrueType font data without the unused glyphs. + * @param string $font TrueType font data. + * @param array $subsetchars Array of used characters (the glyphs to keep). + * @return string A subset of TrueType font data without the unused glyphs. + * @author Nicola Asuni + * @since 5.2.000 (2010-06-02) + * @public static + */ + public static function _getTrueTypeFontSubset($font, $subsetchars) { + ksort($subsetchars); + $offset = 0; // offset position of the font data + if (TCPDF_STATIC::_getULONG($font, $offset) != 0x10000) { + // sfnt version must be 0x00010000 for TrueType version 1.0. + return $font; + } + $c = 0; + $offset += 4; + // get number of tables + $numTables = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + // skip searchRange, entrySelector and rangeShift + $offset += 6; + // tables array + $table = array(); + // for each table + for ($i = 0; $i < $numTables; ++$i) { + // get table info + $tag = substr($font, $offset, 4); + $offset += 4; + $table[$tag] = array(); + $table[$tag]['checkSum'] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $table[$tag]['offset'] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $table[$tag]['length'] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + } + // check magicNumber + $offset = $table['head']['offset'] + 12; + if (TCPDF_STATIC::_getULONG($font, $offset) != 0x5F0F3CF5) { + // magicNumber must be 0x5F0F3CF5 + return $font; + } + $offset += 4; + // get offset mode (indexToLocFormat : 0 = short, 1 = long) + $offset = $table['head']['offset'] + 50; + $short_offset = (TCPDF_STATIC::_getSHORT($font, $offset) == 0); + $offset += 2; + // get the offsets to the locations of the glyphs in the font, relative to the beginning of the glyphData table + $indexToLoc = array(); + $offset = $table['loca']['offset']; + if ($short_offset) { + // short version + $tot_num_glyphs = floor($table['loca']['length'] / 2); // numGlyphs + 1 + for ($i = 0; $i < $tot_num_glyphs; ++$i) { + $indexToLoc[$i] = TCPDF_STATIC::_getUSHORT($font, $offset) * 2; + $offset += 2; + } + } else { + // long version + $tot_num_glyphs = ($table['loca']['length'] / 4); // numGlyphs + 1 + for ($i = 0; $i < $tot_num_glyphs; ++$i) { + $indexToLoc[$i] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + } + } + // get glyphs indexes of chars from cmap table + $subsetglyphs = array(); // glyph IDs on key + $subsetglyphs[0] = true; // character codes that do not correspond to any glyph in the font should be mapped to glyph index 0 + $offset = $table['cmap']['offset'] + 2; + $numEncodingTables = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $encodingTables = array(); + for ($i = 0; $i < $numEncodingTables; ++$i) { + $encodingTables[$i]['platformID'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $encodingTables[$i]['encodingID'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $encodingTables[$i]['offset'] = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + } + foreach ($encodingTables as $enctable) { + // get all platforms and encodings + $offset = $table['cmap']['offset'] + $enctable['offset']; + $format = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + switch ($format) { + case 0: { // Format 0: Byte encoding table + $offset += 4; // skip length and version/language + for ($c = 0; $c < 256; ++$c) { + if (isset($subsetchars[$c])) { + $g = TCPDF_STATIC::_getBYTE($font, $offset); + $subsetglyphs[$g] = true; + } + ++$offset; + } + break; + } + case 2: { // Format 2: High-byte mapping through table + $offset += 4; // skip length and version/language + $numSubHeaders = 0; + for ($i = 0; $i < 256; ++$i) { + // Array that maps high bytes to subHeaders: value is subHeader index * 8. + $subHeaderKeys[$i] = (TCPDF_STATIC::_getUSHORT($font, $offset) / 8); + $offset += 2; + if ($numSubHeaders < $subHeaderKeys[$i]) { + $numSubHeaders = $subHeaderKeys[$i]; + } + } + // the number of subHeaders is equal to the max of subHeaderKeys + 1 + ++$numSubHeaders; + // read subHeader structures + $subHeaders = array(); + $numGlyphIndexArray = 0; + for ($k = 0; $k < $numSubHeaders; ++$k) { + $subHeaders[$k]['firstCode'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $subHeaders[$k]['entryCount'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $subHeaders[$k]['idDelta'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $subHeaders[$k]['idRangeOffset'] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $subHeaders[$k]['idRangeOffset'] -= (2 + (($numSubHeaders - $k - 1) * 8)); + $subHeaders[$k]['idRangeOffset'] /= 2; + $numGlyphIndexArray += $subHeaders[$k]['entryCount']; + } + for ($k = 0; $k < $numGlyphIndexArray; ++$k) { + $glyphIndexArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + for ($i = 0; $i < 256; ++$i) { + $k = $subHeaderKeys[$i]; + if ($k == 0) { + // one byte code + $c = $i; + if (isset($subsetchars[$c])) { + $g = $glyphIndexArray[0]; + $subsetglyphs[$g] = true; + } + } else { + // two bytes code + $start_byte = $subHeaders[$k]['firstCode']; + $end_byte = $start_byte + $subHeaders[$k]['entryCount']; + for ($j = $start_byte; $j < $end_byte; ++$j) { + // combine high and low bytes + $c = (($i << 8) + $j); + if (isset($subsetchars[$c])) { + $idRangeOffset = ($subHeaders[$k]['idRangeOffset'] + $j - $subHeaders[$k]['firstCode']); + $g = ($glyphIndexArray[$idRangeOffset] + $subHeaders[$k]['idDelta']) % 65536; + if ($g < 0) { + $g = 0; + } + $subsetglyphs[$g] = true; + } + } + } + } + break; + } + case 4: { // Format 4: Segment mapping to delta values + $length = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $offset += 2; // skip version/language + $segCount = floor(TCPDF_STATIC::_getUSHORT($font, $offset) / 2); + $offset += 2; + $offset += 6; // skip searchRange, entrySelector, rangeShift + $endCount = array(); // array of end character codes for each segment + for ($k = 0; $k < $segCount; ++$k) { + $endCount[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + $offset += 2; // skip reservedPad + $startCount = array(); // array of start character codes for each segment + for ($k = 0; $k < $segCount; ++$k) { + $startCount[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + $idDelta = array(); // delta for all character codes in segment + for ($k = 0; $k < $segCount; ++$k) { + $idDelta[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + $idRangeOffset = array(); // Offsets into glyphIdArray or 0 + for ($k = 0; $k < $segCount; ++$k) { + $idRangeOffset[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + $gidlen = (floor($length / 2) - 8 - (4 * $segCount)); + $glyphIdArray = array(); // glyph index array + for ($k = 0; $k < $gidlen; ++$k) { + $glyphIdArray[$k] = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + } + for ($k = 0; $k < $segCount; ++$k) { + for ($c = $startCount[$k]; $c <= $endCount[$k]; ++$c) { + if (isset($subsetchars[$c])) { + if ($idRangeOffset[$k] == 0) { + $g = ($idDelta[$k] + $c) % 65536; + } else { + $gid = (floor($idRangeOffset[$k] / 2) + ($c - $startCount[$k]) - ($segCount - $k)); + $g = ($glyphIdArray[$gid] + $idDelta[$k]) % 65536; + } + if ($g < 0) { + $g = 0; + } + $subsetglyphs[$g] = true; + } + } + } + break; + } + case 6: { // Format 6: Trimmed table mapping + $offset += 4; // skip length and version/language + $firstCode = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $entryCount = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + for ($k = 0; $k < $entryCount; ++$k) { + $c = ($k + $firstCode); + if (isset($subsetchars[$c])) { + $g = TCPDF_STATIC::_getUSHORT($font, $offset); + $subsetglyphs[$g] = true; + } + $offset += 2; + } + break; + } + case 8: { // Format 8: Mixed 16-bit and 32-bit coverage + $offset += 10; // skip reserved, length and version/language + for ($k = 0; $k < 8192; ++$k) { + $is32[$k] = TCPDF_STATIC::_getBYTE($font, $offset); + ++$offset; + } + $nGroups = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($i = 0; $i < $nGroups; ++$i) { + $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $endCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $startGlyphID = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($k = $startCharCode; $k <= $endCharCode; ++$k) { + $is32idx = floor($c / 8); + if ((isset($is32[$is32idx])) AND (($is32[$is32idx] & (1 << (7 - ($c % 8)))) == 0)) { + $c = $k; + } else { + // 32 bit format + // convert to decimal (http://www.unicode.org/faq//utf_bom.html#utf16-4) + //LEAD_OFFSET = (0xD800 - (0x10000 >> 10)) = 55232 + //SURROGATE_OFFSET = (0x10000 - (0xD800 << 10) - 0xDC00) = -56613888 + $c = ((55232 + ($k >> 10)) << 10) + (0xDC00 + ($k & 0x3FF)) -56613888; + } + if (isset($subsetchars[$c])) { + $subsetglyphs[$startGlyphID] = true; + } + ++$startGlyphID; + } + } + break; + } + case 10: { // Format 10: Trimmed array + $offset += 10; // skip reserved, length and version/language + $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $numChars = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($k = 0; $k < $numChars; ++$k) { + $c = ($k + $startCharCode); + if (isset($subsetchars[$c])) { + $g = TCPDF_STATIC::_getUSHORT($font, $offset); + $subsetglyphs[$g] = true; + } + $offset += 2; + } + break; + } + case 12: { // Format 12: Segmented coverage + $offset += 10; // skip length and version/language + $nGroups = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($k = 0; $k < $nGroups; ++$k) { + $startCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $endCharCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + $startGlyphCode = TCPDF_STATIC::_getULONG($font, $offset); + $offset += 4; + for ($c = $startCharCode; $c <= $endCharCode; ++$c) { + if (isset($subsetchars[$c])) { + $subsetglyphs[$startGlyphCode] = true; + } + ++$startGlyphCode; + } + } + break; + } + case 13: { // Format 13: Many-to-one range mappings + // to be implemented ... + break; + } + case 14: { // Format 14: Unicode Variation Sequences + // to be implemented ... + break; + } + } + } + // include all parts of composite glyphs + $new_sga = $subsetglyphs; + while (!empty($new_sga)) { + $sga = $new_sga; + $new_sga = array(); + foreach ($sga as $key => $val) { + if (isset($indexToLoc[$key])) { + $offset = ($table['glyf']['offset'] + $indexToLoc[$key]); + $numberOfContours = TCPDF_STATIC::_getSHORT($font, $offset); + $offset += 2; + if ($numberOfContours < 0) { // composite glyph + $offset += 8; // skip xMin, yMin, xMax, yMax + do { + $flags = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + $glyphIndex = TCPDF_STATIC::_getUSHORT($font, $offset); + $offset += 2; + if (!isset($subsetglyphs[$glyphIndex])) { + // add missing glyphs + $new_sga[$glyphIndex] = true; + } + // skip some bytes by case + if ($flags & 1) { + $offset += 4; + } else { + $offset += 2; + } + if ($flags & 8) { + $offset += 2; + } elseif ($flags & 64) { + $offset += 4; + } elseif ($flags & 128) { + $offset += 8; + } + } while ($flags & 32); + } + } + } + $subsetglyphs += $new_sga; + } + // sort glyphs by key (and remove duplicates) + ksort($subsetglyphs); + // build new glyf and loca tables + $glyf = ''; + $loca = ''; + $offset = 0; + $glyf_offset = $table['glyf']['offset']; + for ($i = 0; $i < $tot_num_glyphs; ++$i) { + if (isset($subsetglyphs[$i])) { + $length = ($indexToLoc[($i + 1)] - $indexToLoc[$i]); + $glyf .= substr($font, ($glyf_offset + $indexToLoc[$i]), $length); + } else { + $length = 0; + } + if ($short_offset) { + $loca .= pack('n', floor($offset / 2)); + } else { + $loca .= pack('N', $offset); + } + $offset += $length; + } + // array of table names to preserve (loca and glyf tables will be added later) + // the cmap table is not needed and shall not be present, since the mapping from character codes to glyph descriptions is provided separately + $table_names = array ('head', 'hhea', 'hmtx', 'maxp', 'cvt ', 'fpgm', 'prep'); // minimum required table names + // get the tables to preserve + $offset = 12; + foreach ($table as $tag => $val) { + if (in_array($tag, $table_names)) { + $table[$tag]['data'] = substr($font, $table[$tag]['offset'], $table[$tag]['length']); + if ($tag == 'head') { + // set the checkSumAdjustment to 0 + $table[$tag]['data'] = substr($table[$tag]['data'], 0, 8)."\x0\x0\x0\x0".substr($table[$tag]['data'], 12); + } + $pad = 4 - ($table[$tag]['length'] % 4); + if ($pad != 4) { + // the length of a table must be a multiple of four bytes + $table[$tag]['length'] += $pad; + $table[$tag]['data'] .= str_repeat("\x0", $pad); + } + $table[$tag]['offset'] = $offset; + $offset += $table[$tag]['length']; + // check sum is not changed (so keep the following line commented) + //$table[$tag]['checkSum'] = self::_getTTFtableChecksum($table[$tag]['data'], $table[$tag]['length']); + } else { + unset($table[$tag]); + } + } + // add loca + $table['loca']['data'] = $loca; + $table['loca']['length'] = strlen($loca); + $pad = 4 - ($table['loca']['length'] % 4); + if ($pad != 4) { + // the length of a table must be a multiple of four bytes + $table['loca']['length'] += $pad; + $table['loca']['data'] .= str_repeat("\x0", $pad); + } + $table['loca']['offset'] = $offset; + $table['loca']['checkSum'] = self::_getTTFtableChecksum($table['loca']['data'], $table['loca']['length']); + $offset += $table['loca']['length']; + // add glyf + $table['glyf']['data'] = $glyf; + $table['glyf']['length'] = strlen($glyf); + $pad = 4 - ($table['glyf']['length'] % 4); + if ($pad != 4) { + // the length of a table must be a multiple of four bytes + $table['glyf']['length'] += $pad; + $table['glyf']['data'] .= str_repeat("\x0", $pad); + } + $table['glyf']['offset'] = $offset; + $table['glyf']['checkSum'] = self::_getTTFtableChecksum($table['glyf']['data'], $table['glyf']['length']); + // rebuild font + $font = ''; + $font .= pack('N', 0x10000); // sfnt version + $numTables = count($table); + $font .= pack('n', $numTables); // numTables + $entrySelector = floor(log($numTables, 2)); + $searchRange = pow(2, $entrySelector) * 16; + $rangeShift = ($numTables * 16) - $searchRange; + $font .= pack('n', $searchRange); // searchRange + $font .= pack('n', $entrySelector); // entrySelector + $font .= pack('n', $rangeShift); // rangeShift + $offset = ($numTables * 16); + foreach ($table as $tag => $data) { + $font .= $tag; // tag + $font .= pack('N', $data['checkSum']); // checkSum + $font .= pack('N', ($data['offset'] + $offset)); // offset + $font .= pack('N', $data['length']); // length + } + foreach ($table as $data) { + $font .= $data['data']; + } + // set checkSumAdjustment on head table + $checkSumAdjustment = 0xB1B0AFBA - self::_getTTFtableChecksum($font, strlen($font)); + $font = substr($font, 0, $table['head']['offset'] + 8).pack('N', $checkSumAdjustment).substr($font, $table['head']['offset'] + 12); + return $font; + } + + /** + * Outputs font widths + * @param array $font font data + * @param int $cidoffset offset for CID values + * @return string PDF command string for font widths + * @author Nicola Asuni + * @since 4.4.000 (2008-12-07) + * @public static + */ + public static function _putfontwidths($font, $cidoffset=0) { + ksort($font['cw']); + $rangeid = 0; + $range = array(); + $prevcid = -2; + $prevwidth = -1; + $interval = false; + // for each character + foreach ($font['cw'] as $cid => $width) { + $cid -= $cidoffset; + if ($font['subset'] AND (!isset($font['subsetchars'][$cid]))) { + // ignore the unused characters (font subsetting) + continue; + } + if ($width != $font['dw']) { + if ($cid == ($prevcid + 1)) { + // consecutive CID + if ($width == $prevwidth) { + if ($width == $range[$rangeid][0]) { + $range[$rangeid][] = $width; + } else { + array_pop($range[$rangeid]); + // new range + $rangeid = $prevcid; + $range[$rangeid] = array(); + $range[$rangeid][] = $prevwidth; + $range[$rangeid][] = $width; + } + $interval = true; + $range[$rangeid]['interval'] = true; + } else { + if ($interval) { + // new range + $rangeid = $cid; + $range[$rangeid] = array(); + $range[$rangeid][] = $width; + } else { + $range[$rangeid][] = $width; + } + $interval = false; + } + } else { + // new range + $rangeid = $cid; + $range[$rangeid] = array(); + $range[$rangeid][] = $width; + $interval = false; + } + $prevcid = $cid; + $prevwidth = $width; + } + } + // optimize ranges + $prevk = -1; + $nextk = -1; + $prevint = false; + foreach ($range as $k => $ws) { + $cws = count($ws); + if (($k == $nextk) AND (!$prevint) AND ((!isset($ws['interval'])) OR ($cws < 4))) { + if (isset($range[$k]['interval'])) { + unset($range[$k]['interval']); + } + $range[$prevk] = array_merge($range[$prevk], $range[$k]); + unset($range[$k]); + } else { + $prevk = $k; + } + $nextk = $k + $cws; + if (isset($ws['interval'])) { + if ($cws > 3) { + $prevint = true; + } else { + $prevint = false; + } + if (isset($range[$k]['interval'])) { + unset($range[$k]['interval']); + } + --$nextk; + } else { + $prevint = false; + } + } + // output data + $w = ''; + foreach ($range as $k => $ws) { + if (count(array_count_values($ws)) == 1) { + // interval mode is more compact + $w .= ' '.$k.' '.($k + count($ws) - 1).' '.$ws[0]; + } else { + // range mode + $w .= ' '.$k.' [ '.implode(' ', $ws).' ]'; + } + } + return '/W ['.$w.' ]'; + } + + + + + /** + * Update the CIDToGIDMap string with a new value. + * @param string $map CIDToGIDMap. + * @param int $cid CID value. + * @param int $gid GID value. + * @return string CIDToGIDMap. + * @author Nicola Asuni + * @since 5.9.123 (2011-09-29) + * @public static + */ + public static function updateCIDtoGIDmap($map, $cid, $gid) { + if (($cid >= 0) AND ($cid <= 0xFFFF) AND ($gid >= 0)) { + if ($gid > 0xFFFF) { + $gid -= 0x10000; + } + $map[($cid * 2)] = chr($gid >> 8); + $map[(($cid * 2) + 1)] = chr($gid & 0xFF); + } + return $map; + } + + /** + * Return fonts path + * @return string + * @public static + */ + public static function _getfontpath() { + if (!defined('K_PATH_FONTS') AND is_dir($fdir = realpath(dirname(__FILE__).'/../fonts'))) { + if (substr($fdir, -1) != '/') { + $fdir .= '/'; + } + define('K_PATH_FONTS', $fdir); + } + return defined('K_PATH_FONTS') ? K_PATH_FONTS : ''; + } + + + + /** + * Return font full path + * @param string $file Font file name. + * @param string $fontdir Font directory (set to false fto search on default directories) + * @return string Font full path or empty string + * @author Nicola Asuni + * @since 6.0.025 + * @public static + */ + public static function getFontFullPath($file, $fontdir=false) { + $fontfile = ''; + // search files on various directories + if (($fontdir !== false) AND @TCPDF_STATIC::file_exists($fontdir.$file)) { + $fontfile = $fontdir.$file; + } elseif (@TCPDF_STATIC::file_exists(self::_getfontpath().$file)) { + $fontfile = self::_getfontpath().$file; + } elseif (@TCPDF_STATIC::file_exists($file)) { + $fontfile = $file; + } + return $fontfile; + } + + + + + /** + * Get a reference font size. + * @param string $size String containing font size value. + * @param float $refsize Reference font size in points. + * @return float value in points + * @public static + */ + public static function getFontRefSize($size, $refsize=12) { + switch ($size) { + case 'xx-small': { + $size = ($refsize - 4); + break; + } + case 'x-small': { + $size = ($refsize - 3); + break; + } + case 'small': { + $size = ($refsize - 2); + break; + } + case 'medium': { + $size = $refsize; + break; + } + case 'large': { + $size = ($refsize + 2); + break; + } + case 'x-large': { + $size = ($refsize + 4); + break; + } + case 'xx-large': { + $size = ($refsize + 6); + break; + } + case 'smaller': { + $size = ($refsize - 3); + break; + } + case 'larger': { + $size = ($refsize + 3); + break; + } + } + return $size; + } + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// ==================================================================================================================== +// REIMPLEMENTED +// ==================================================================================================================== + + + + + + + + + /** + * Returns the unicode caracter specified by the value + * @param int $c UTF-8 value + * @param boolean $unicode True if we are in unicode mode, false otherwise. + * @return string Returns the specified character. + * @since 2.3.000 (2008-03-05) + * @public static + */ + public static function unichr($c, $unicode=true) { + $c = intval($c); + if (!$unicode) { + return chr($c); + } elseif ($c <= 0x7F) { + // one byte + return chr($c); + } elseif ($c <= 0x7FF) { + // two bytes + return chr(0xC0 | $c >> 6).chr(0x80 | $c & 0x3F); + } elseif ($c <= 0xFFFF) { + // three bytes + return chr(0xE0 | $c >> 12).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } elseif ($c <= 0x10FFFF) { + // four bytes + return chr(0xF0 | $c >> 18).chr(0x80 | $c >> 12 & 0x3F).chr(0x80 | $c >> 6 & 0x3F).chr(0x80 | $c & 0x3F); + } else { + return ''; + } + } + + /** + * Returns the unicode caracter specified by UTF-8 value + * @param int $c UTF-8 value + * @return string Returns the specified character. + * @public static + */ + public static function unichrUnicode($c) { + return self::unichr($c, true); + } + + /** + * Returns the unicode caracter specified by ASCII value + * @param int $c UTF-8 value + * @return string Returns the specified character. + * @public static + */ + public static function unichrASCII($c) { + return self::unichr($c, false); + } + + /** + * Converts array of UTF-8 characters to UTF16-BE string.
      + * Based on: http://www.faqs.org/rfcs/rfc2781.html + *
      +	 *   Encoding UTF-16:
      +	 *
      +	 *   Encoding of a single character from an ISO 10646 character value to
      +	 *    UTF-16 proceeds as follows. Let U be the character number, no greater
      +	 *    than 0x10FFFF.
      +	 *
      +	 *    1) If U < 0x10000, encode U as a 16-bit unsigned integer and
      +	 *       terminate.
      +	 *
      +	 *    2) Let U' = U - 0x10000. Because U is less than or equal to 0x10FFFF,
      +	 *       U' must be less than or equal to 0xFFFFF. That is, U' can be
      +	 *       represented in 20 bits.
      +	 *
      +	 *    3) Initialize two 16-bit unsigned integers, W1 and W2, to 0xD800 and
      +	 *       0xDC00, respectively. These integers each have 10 bits free to
      +	 *       encode the character value, for a total of 20 bits.
      +	 *
      +	 *    4) Assign the 10 high-order bits of the 20-bit U' to the 10 low-order
      +	 *       bits of W1 and the 10 low-order bits of U' to the 10 low-order
      +	 *       bits of W2. Terminate.
      +	 *
      +	 *    Graphically, steps 2 through 4 look like:
      +	 *    U' = yyyyyyyyyyxxxxxxxxxx
      +	 *    W1 = 110110yyyyyyyyyy
      +	 *    W2 = 110111xxxxxxxxxx
      +	 * 
      + * @param array $unicode array containing UTF-8 unicode values + * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF) + * @return string + * @protected + * @author Nicola Asuni + * @since 2.1.000 (2008-01-08) + * @public static + */ + public static function arrUTF8ToUTF16BE($unicode, $setbom=false) { + $outstr = ''; // string to be returned + if ($setbom) { + $outstr .= "\xFE\xFF"; // Byte Order Mark (BOM) + } + foreach ($unicode as $char) { + if ($char == 0x200b) { + // skip Unicode Character 'ZERO WIDTH SPACE' (DEC:8203, U+200B) + } elseif ($char == 0xFFFD) { + $outstr .= "\xFF\xFD"; // replacement character + } elseif ($char < 0x10000) { + $outstr .= chr($char >> 0x08); + $outstr .= chr($char & 0xFF); + } else { + $char -= 0x10000; + $w1 = 0xD800 | ($char >> 0x0a); + $w2 = 0xDC00 | ($char & 0x3FF); + $outstr .= chr($w1 >> 0x08); + $outstr .= chr($w1 & 0xFF); + $outstr .= chr($w2 >> 0x08); + $outstr .= chr($w2 & 0xFF); + } + } + return $outstr; + } + + /** + * Convert an array of UTF8 values to array of unicode characters + * @param array $ta The input array of UTF8 values. + * @param boolean $isunicode True for Unicode mode, false otherwise. + * @return array Return array of unicode characters + * @since 4.5.037 (2009-04-07) + * @public static + */ + public static function UTF8ArrayToUniArray($ta, $isunicode=true) { + if ($isunicode) { + return array_map(array('TCPDF_FONTS', 'unichrUnicode'), $ta); + } + return array_map(array('TCPDF_FONTS', 'unichrASCII'), $ta); + } + + /** + * Extract a slice of the $strarr array and return it as string. + * @param string[] $strarr The input array of characters. + * @param int $start the starting element of $strarr. + * @param int $end first element that will not be returned. + * @param boolean $unicode True if we are in unicode mode, false otherwise. + * @return string Return part of a string + * @public static + */ + public static function UTF8ArrSubString($strarr, $start='', $end='', $unicode=true) { + if (strlen($start) == 0) { + $start = 0; + } + if (strlen($end) == 0) { + $end = count($strarr); + } + $string = ''; + for ($i = $start; $i < $end; ++$i) { + $string .= self::unichr($strarr[$i], $unicode); + } + return $string; + } + + /** + * Extract a slice of the $uniarr array and return it as string. + * @param string[] $uniarr The input array of characters. + * @param int $start the starting element of $strarr. + * @param int $end first element that will not be returned. + * @return string Return part of a string + * @since 4.5.037 (2009-04-07) + * @public static + */ + public static function UniArrSubString($uniarr, $start='', $end='') { + if (strlen($start) == 0) { + $start = 0; + } + if (strlen($end) == 0) { + $end = count($uniarr); + } + $string = ''; + for ($i=$start; $i < $end; ++$i) { + $string .= $uniarr[$i]; + } + return $string; + } + + /** + * Converts UTF-8 characters array to array of Latin1 characters array
      + * @param array $unicode array containing UTF-8 unicode values + * @return array + * @author Nicola Asuni + * @since 4.8.023 (2010-01-15) + * @public static + */ + public static function UTF8ArrToLatin1Arr($unicode) { + $outarr = array(); // array to be returned + foreach ($unicode as $char) { + if ($char < 256) { + $outarr[] = $char; + } elseif (array_key_exists($char, TCPDF_FONT_DATA::$uni_utf8tolatin)) { + // map from UTF-8 + $outarr[] = TCPDF_FONT_DATA::$uni_utf8tolatin[$char]; + } elseif ($char == 0xFFFD) { + // skip + } else { + $outarr[] = 63; // '?' character + } + } + return $outarr; + } + + /** + * Converts UTF-8 characters array to Latin1 string
      + * @param array $unicode array containing UTF-8 unicode values + * @return string + * @author Nicola Asuni + * @since 4.8.023 (2010-01-15) + * @public static + */ + public static function UTF8ArrToLatin1($unicode) { + $outstr = ''; // string to be returned + foreach ($unicode as $char) { + if ($char < 256) { + $outstr .= chr($char); + } elseif (array_key_exists($char, TCPDF_FONT_DATA::$uni_utf8tolatin)) { + // map from UTF-8 + $outstr .= chr(TCPDF_FONT_DATA::$uni_utf8tolatin[$char]); + } elseif ($char == 0xFFFD) { + // skip + } else { + $outstr .= '?'; + } + } + return $outstr; + } + + /** + * Converts UTF-8 character to integer value.
      + * Uses the getUniord() method if the value is not cached. + * @param string $uch character string to process. + * @return int Unicode value + * @public static + */ + public static function uniord($uch) { + if (!isset(self::$cache_uniord[$uch])) { + self::$cache_uniord[$uch] = self::getUniord($uch); + } + return self::$cache_uniord[$uch]; + } + + /** + * Converts UTF-8 character to integer value.
      + * Invalid byte sequences will be replaced with 0xFFFD (replacement character)
      + * Based on: http://www.faqs.org/rfcs/rfc3629.html + *
      +	 *    Char. number range  |        UTF-8 octet sequence
      +	 *       (hexadecimal)    |              (binary)
      +	 *    --------------------+-----------------------------------------------
      +	 *    0000 0000-0000 007F | 0xxxxxxx
      +	 *    0000 0080-0000 07FF | 110xxxxx 10xxxxxx
      +	 *    0000 0800-0000 FFFF | 1110xxxx 10xxxxxx 10xxxxxx
      +	 *    0001 0000-0010 FFFF | 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
      +	 *    ---------------------------------------------------------------------
      +	 *
      +	 *   ABFN notation:
      +	 *   ---------------------------------------------------------------------
      +	 *   UTF8-octets = *( UTF8-char )
      +	 *   UTF8-char   = UTF8-1 / UTF8-2 / UTF8-3 / UTF8-4
      +	 *   UTF8-1      = %x00-7F
      +	 *   UTF8-2      = %xC2-DF UTF8-tail
      +	 *
      +	 *   UTF8-3      = %xE0 %xA0-BF UTF8-tail / %xE1-EC 2( UTF8-tail ) /
      +	 *                 %xED %x80-9F UTF8-tail / %xEE-EF 2( UTF8-tail )
      +	 *   UTF8-4      = %xF0 %x90-BF 2( UTF8-tail ) / %xF1-F3 3( UTF8-tail ) /
      +	 *                 %xF4 %x80-8F 2( UTF8-tail )
      +	 *   UTF8-tail   = %x80-BF
      +	 *   ---------------------------------------------------------------------
      +	 * 
      + * @param string $uch character string to process. + * @return int Unicode value + * @author Nicola Asuni + * @public static + */ + public static function getUniord($uch) { + if (function_exists('mb_convert_encoding')) { + list(, $char) = @unpack('N', mb_convert_encoding($uch, 'UCS-4BE', 'UTF-8')); + if ($char >= 0) { + return $char; + } + } + $bytes = array(); // array containing single character byte sequences + $countbytes = 0; + $numbytes = 1; // number of octetc needed to represent the UTF-8 character + $length = strlen($uch); + for ($i = 0; $i < $length; ++$i) { + $char = ord($uch[$i]); // get one string character at time + if ($countbytes == 0) { // get starting octect + if ($char <= 0x7F) { + return $char; // use the character "as is" because is ASCII + } elseif (($char >> 0x05) == 0x06) { // 2 bytes character (0x06 = 110 BIN) + $bytes[] = ($char - 0xC0) << 0x06; + ++$countbytes; + $numbytes = 2; + } elseif (($char >> 0x04) == 0x0E) { // 3 bytes character (0x0E = 1110 BIN) + $bytes[] = ($char - 0xE0) << 0x0C; + ++$countbytes; + $numbytes = 3; + } elseif (($char >> 0x03) == 0x1E) { // 4 bytes character (0x1E = 11110 BIN) + $bytes[] = ($char - 0xF0) << 0x12; + ++$countbytes; + $numbytes = 4; + } else { + // use replacement character for other invalid sequences + return 0xFFFD; + } + } elseif (($char >> 0x06) == 0x02) { // bytes 2, 3 and 4 must start with 0x02 = 10 BIN + $bytes[] = $char - 0x80; + ++$countbytes; + if ($countbytes == $numbytes) { + // compose UTF-8 bytes to a single unicode value + $char = $bytes[0]; + for ($j = 1; $j < $numbytes; ++$j) { + $char += ($bytes[$j] << (($numbytes - $j - 1) * 0x06)); + } + if ((($char >= 0xD800) AND ($char <= 0xDFFF)) OR ($char >= 0x10FFFF)) { + // The definition of UTF-8 prohibits encoding character numbers between + // U+D800 and U+DFFF, which are reserved for use with the UTF-16 + // encoding form (as surrogate pairs) and do not directly represent + // characters. + return 0xFFFD; // use replacement character + } else { + return $char; + } + } + } else { + // use replacement character for other invalid sequences + return 0xFFFD; + } + } + return 0xFFFD; + } + + /** + * Converts UTF-8 strings to codepoints array.
      + * Invalid byte sequences will be replaced with 0xFFFD (replacement character)
      + * @param string $str string to process. + * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. + * @return array containing codepoints (UTF-8 characters values) + * @author Nicola Asuni + * @public static + */ + public static function UTF8StringToArray($str, $isunicode, &$currentfont) { + $str = is_null($str) ? '' : $str; + if ($isunicode) { + // requires PCRE unicode support turned on + $chars = TCPDF_STATIC::pregSplit('//','u', $str, -1, PREG_SPLIT_NO_EMPTY); + $carr = array_map(array('TCPDF_FONTS', 'uniord'), $chars); + } else { + $chars = str_split($str); + $carr = array_map('ord', $chars); + } + if (is_array($currentfont['subsetchars']) && is_array($carr)) { + $currentfont['subsetchars'] += array_fill_keys($carr, true); + } else { + $currentfont['subsetchars'] = array_merge($currentfont['subsetchars'], $carr); + } + return $carr; + } + + /** + * Converts UTF-8 strings to Latin1 when using the standard 14 core fonts.
      + * @param string $str string to process. + * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. + * @return string + * @since 3.2.000 (2008-06-23) + * @public static + */ + public static function UTF8ToLatin1($str, $isunicode, &$currentfont) { + $unicode = self::UTF8StringToArray($str, $isunicode, $currentfont); // array containing UTF-8 unicode values + return self::UTF8ArrToLatin1($unicode); + } + + /** + * Converts UTF-8 strings to UTF16-BE.
      + * @param string $str string to process. + * @param boolean $setbom if true set the Byte Order Mark (BOM = 0xFEFF) + * @param boolean $isunicode True when the documetn is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. + * @return string + * @author Nicola Asuni + * @since 1.53.0.TC005 (2005-01-05) + * @public static + */ + public static function UTF8ToUTF16BE($str, $setbom, $isunicode, &$currentfont) { + if (!$isunicode) { + return $str; // string is not in unicode + } + $unicode = self::UTF8StringToArray($str, $isunicode, $currentfont); // array containing UTF-8 unicode values + return self::arrUTF8ToUTF16BE($unicode, $setbom); + } + + /** + * Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). + * @param string $str string to manipulate. + * @param bool $setbom if true set the Byte Order Mark (BOM = 0xFEFF) + * @param bool $forcertl if true forces RTL text direction + * @param boolean $isunicode True if the document is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. + * @return string + * @author Nicola Asuni + * @since 2.1.000 (2008-01-08) + * @public static + */ + public static function utf8StrRev($str, $setbom, $forcertl, $isunicode, &$currentfont) { + return self::utf8StrArrRev(self::UTF8StringToArray($str, $isunicode, $currentfont), $str, $setbom, $forcertl, $isunicode, $currentfont); + } + + /** + * Reverse the RLT substrings array using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). + * @param array $arr array of unicode values. + * @param string $str string to manipulate (or empty value). + * @param bool $setbom if true set the Byte Order Mark (BOM = 0xFEFF) + * @param bool $forcertl if true forces RTL text direction + * @param boolean $isunicode True if the document is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. + * @return string + * @author Nicola Asuni + * @since 4.9.000 (2010-03-27) + * @public static + */ + public static function utf8StrArrRev($arr, $str, $setbom, $forcertl, $isunicode, &$currentfont) { + return self::arrUTF8ToUTF16BE(self::utf8Bidi($arr, $str, $forcertl, $isunicode, $currentfont), $setbom); + } + + /** + * Reverse the RLT substrings using the Bidirectional Algorithm (http://unicode.org/reports/tr9/). + * @param array $ta array of characters composing the string. + * @param string $str string to process + * @param bool $forcertl if 'R' forces RTL, if 'L' forces LTR + * @param boolean $isunicode True if the document is in Unicode mode, false otherwise. + * @param array $currentfont Reference to current font array. + * @return array of unicode chars + * @author Nicola Asuni + * @since 2.4.000 (2008-03-06) + * @public static + */ + public static function utf8Bidi($ta, $str, $forcertl, $isunicode, &$currentfont) { + // paragraph embedding level + $pel = 0; + // max level + $maxlevel = 0; + if (TCPDF_STATIC::empty_string($str)) { + // create string from array + $str = self::UTF8ArrSubString($ta, '', '', $isunicode); + } + // check if string contains arabic text + if (preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_ARABIC, $str)) { + $arabic = true; + } else { + $arabic = false; + } + // check if string contains RTL text + if (!($forcertl OR $arabic OR preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_RTL, $str))) { + return $ta; + } + + // get number of chars + $numchars = count($ta); + + if ($forcertl == 'R') { + $pel = 1; + } elseif ($forcertl == 'L') { + $pel = 0; + } else { + // P2. In each paragraph, find the first character of type L, AL, or R. + // P3. If a character is found in P2 and it is of type AL or R, then set the paragraph embedding level to one; otherwise, set it to zero. + for ($i=0; $i < $numchars; ++$i) { + $type = TCPDF_FONT_DATA::$uni_type[$ta[$i]]; + if ($type == 'L') { + $pel = 0; + break; + } elseif (($type == 'AL') OR ($type == 'R')) { + $pel = 1; + break; + } + } + } + + // Current Embedding Level + $cel = $pel; + // directional override status + $dos = 'N'; + $remember = array(); + // start-of-level-run + $sor = $pel % 2 ? 'R' : 'L'; + $eor = $sor; + + // Array of characters data + $chardata = Array(); + + // X1. Begin by setting the current embedding level to the paragraph embedding level. Set the directional override status to neutral. Process each character iteratively, applying rules X2 through X9. Only embedding levels from 0 to 61 are valid in this phase. + // In the resolution of levels in rules I1 and I2, the maximum embedding level of 62 can be reached. + for ($i=0; $i < $numchars; ++$i) { + if ($ta[$i] == TCPDF_FONT_DATA::$uni_RLE) { + // X2. With each RLE, compute the least greater odd embedding level. + // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to neutral. + // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. + $next_level = $cel + ($cel % 2) + 1; + if ($next_level < 62) { + $remember[] = array('num' => TCPDF_FONT_DATA::$uni_RLE, 'cel' => $cel, 'dos' => $dos); + $cel = $next_level; + $dos = 'N'; + $sor = $eor; + $eor = $cel % 2 ? 'R' : 'L'; + } + } elseif ($ta[$i] == TCPDF_FONT_DATA::$uni_LRE) { + // X3. With each LRE, compute the least greater even embedding level. + // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to neutral. + // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. + $next_level = $cel + 2 - ($cel % 2); + if ( $next_level < 62 ) { + $remember[] = array('num' => TCPDF_FONT_DATA::$uni_LRE, 'cel' => $cel, 'dos' => $dos); + $cel = $next_level; + $dos = 'N'; + $sor = $eor; + $eor = $cel % 2 ? 'R' : 'L'; + } + } elseif ($ta[$i] == TCPDF_FONT_DATA::$uni_RLO) { + // X4. With each RLO, compute the least greater odd embedding level. + // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to right-to-left. + // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. + $next_level = $cel + ($cel % 2) + 1; + if ($next_level < 62) { + $remember[] = array('num' => TCPDF_FONT_DATA::$uni_RLO, 'cel' => $cel, 'dos' => $dos); + $cel = $next_level; + $dos = 'R'; + $sor = $eor; + $eor = $cel % 2 ? 'R' : 'L'; + } + } elseif ($ta[$i] == TCPDF_FONT_DATA::$uni_LRO) { + // X5. With each LRO, compute the least greater even embedding level. + // a. If this new level would be valid, then this embedding code is valid. Remember (push) the current embedding level and override status. Reset the current level to this new level, and reset the override status to left-to-right. + // b. If the new level would not be valid, then this code is invalid. Do not change the current level or override status. + $next_level = $cel + 2 - ($cel % 2); + if ( $next_level < 62 ) { + $remember[] = array('num' => TCPDF_FONT_DATA::$uni_LRO, 'cel' => $cel, 'dos' => $dos); + $cel = $next_level; + $dos = 'L'; + $sor = $eor; + $eor = $cel % 2 ? 'R' : 'L'; + } + } elseif ($ta[$i] == TCPDF_FONT_DATA::$uni_PDF) { + // X7. With each PDF, determine the matching embedding or override code. If there was a valid matching code, restore (pop) the last remembered (pushed) embedding level and directional override. + if (count($remember)) { + $last = count($remember ) - 1; + if (($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_RLE) OR + ($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_LRE) OR + ($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_RLO) OR + ($remember[$last]['num'] == TCPDF_FONT_DATA::$uni_LRO)) { + $match = array_pop($remember); + $cel = $match['cel']; + $dos = $match['dos']; + $sor = $eor; + $eor = ($cel > $match['cel'] ? $cel : $match['cel']) % 2 ? 'R' : 'L'; + } + } + } elseif (($ta[$i] != TCPDF_FONT_DATA::$uni_RLE) AND + ($ta[$i] != TCPDF_FONT_DATA::$uni_LRE) AND + ($ta[$i] != TCPDF_FONT_DATA::$uni_RLO) AND + ($ta[$i] != TCPDF_FONT_DATA::$uni_LRO) AND + ($ta[$i] != TCPDF_FONT_DATA::$uni_PDF)) { + // X6. For all types besides RLE, LRE, RLO, LRO, and PDF: + // a. Set the level of the current character to the current embedding level. + // b. Whenever the directional override status is not neutral, reset the current character type to the directional override status. + if ($dos != 'N') { + $chardir = $dos; + } else { + if (isset(TCPDF_FONT_DATA::$uni_type[$ta[$i]])) { + $chardir = TCPDF_FONT_DATA::$uni_type[$ta[$i]]; + } else { + $chardir = 'L'; + } + } + // stores string characters and other information + $chardata[] = array('char' => $ta[$i], 'level' => $cel, 'type' => $chardir, 'sor' => $sor, 'eor' => $eor); + } + } // end for each char + + // X8. All explicit directional embeddings and overrides are completely terminated at the end of each paragraph. Paragraph separators are not included in the embedding. + // X9. Remove all RLE, LRE, RLO, LRO, PDF, and BN codes. + // X10. The remaining rules are applied to each run of characters at the same level. For each run, determine the start-of-level-run (sor) and end-of-level-run (eor) type, either L or R. This depends on the higher of the two levels on either side of the boundary (at the start or end of the paragraph, the level of the 'other' run is the base embedding level). If the higher level is odd, the type is R; otherwise, it is L. + + // 3.3.3 Resolving Weak Types + // Weak types are now resolved one level run at a time. At level run boundaries where the type of the character on the other side of the boundary is required, the type assigned to sor or eor is used. + // Nonspacing marks are now resolved based on the previous characters. + $numchars = count($chardata); + + // W1. Examine each nonspacing mark (NSM) in the level run, and change the type of the NSM to the type of the previous character. If the NSM is at the start of the level run, it will get the type of sor. + $prevlevel = -1; // track level changes + $levcount = 0; // counts consecutive chars at the same level + for ($i=0; $i < $numchars; ++$i) { + if ($chardata[$i]['type'] == 'NSM') { + if ($levcount) { + $chardata[$i]['type'] = $chardata[$i]['sor']; + } elseif ($i > 0) { + $chardata[$i]['type'] = $chardata[($i-1)]['type']; + } + } + if ($chardata[$i]['level'] != $prevlevel) { + $levcount = 0; + } else { + ++$levcount; + } + $prevlevel = $chardata[$i]['level']; + } + + // W2. Search backward from each instance of a European number until the first strong type (R, L, AL, or sor) is found. If an AL is found, change the type of the European number to Arabic number. + $prevlevel = -1; + $levcount = 0; + for ($i=0; $i < $numchars; ++$i) { + if ($chardata[$i]['char'] == 'EN') { + for ($j=$levcount; $j >= 0; $j--) { + if ($chardata[$j]['type'] == 'AL') { + $chardata[$i]['type'] = 'AN'; + } elseif (($chardata[$j]['type'] == 'L') OR ($chardata[$j]['type'] == 'R')) { + break; + } + } + } + if ($chardata[$i]['level'] != $prevlevel) { + $levcount = 0; + } else { + ++$levcount; + } + $prevlevel = $chardata[$i]['level']; + } + + // W3. Change all ALs to R. + for ($i=0; $i < $numchars; ++$i) { + if ($chardata[$i]['type'] == 'AL') { + $chardata[$i]['type'] = 'R'; + } + } + + // W4. A single European separator between two European numbers changes to a European number. A single common separator between two numbers of the same type changes to that type. + $prevlevel = -1; + $levcount = 0; + for ($i=0; $i < $numchars; ++$i) { + if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { + if (($chardata[$i]['type'] == 'ES') AND ($chardata[($i-1)]['type'] == 'EN') AND ($chardata[($i+1)]['type'] == 'EN')) { + $chardata[$i]['type'] = 'EN'; + } elseif (($chardata[$i]['type'] == 'CS') AND ($chardata[($i-1)]['type'] == 'EN') AND ($chardata[($i+1)]['type'] == 'EN')) { + $chardata[$i]['type'] = 'EN'; + } elseif (($chardata[$i]['type'] == 'CS') AND ($chardata[($i-1)]['type'] == 'AN') AND ($chardata[($i+1)]['type'] == 'AN')) { + $chardata[$i]['type'] = 'AN'; + } + } + if ($chardata[$i]['level'] != $prevlevel) { + $levcount = 0; + } else { + ++$levcount; + } + $prevlevel = $chardata[$i]['level']; + } + + // W5. A sequence of European terminators adjacent to European numbers changes to all European numbers. + $prevlevel = -1; + $levcount = 0; + for ($i=0; $i < $numchars; ++$i) { + if ($chardata[$i]['type'] == 'ET') { + if (($levcount > 0) AND ($chardata[($i-1)]['type'] == 'EN')) { + $chardata[$i]['type'] = 'EN'; + } else { + $j = $i+1; + while (($j < $numchars) AND ($chardata[$j]['level'] == $prevlevel)) { + if ($chardata[$j]['type'] == 'EN') { + $chardata[$i]['type'] = 'EN'; + break; + } elseif ($chardata[$j]['type'] != 'ET') { + break; + } + ++$j; + } + } + } + if ($chardata[$i]['level'] != $prevlevel) { + $levcount = 0; + } else { + ++$levcount; + } + $prevlevel = $chardata[$i]['level']; + } + + // W6. Otherwise, separators and terminators change to Other Neutral. + $prevlevel = -1; + $levcount = 0; + for ($i=0; $i < $numchars; ++$i) { + if (($chardata[$i]['type'] == 'ET') OR ($chardata[$i]['type'] == 'ES') OR ($chardata[$i]['type'] == 'CS')) { + $chardata[$i]['type'] = 'ON'; + } + if ($chardata[$i]['level'] != $prevlevel) { + $levcount = 0; + } else { + ++$levcount; + } + $prevlevel = $chardata[$i]['level']; + } + + //W7. Search backward from each instance of a European number until the first strong type (R, L, or sor) is found. If an L is found, then change the type of the European number to L. + $prevlevel = -1; + $levcount = 0; + for ($i=0; $i < $numchars; ++$i) { + if ($chardata[$i]['char'] == 'EN') { + for ($j=$levcount; $j >= 0; $j--) { + if ($chardata[$j]['type'] == 'L') { + $chardata[$i]['type'] = 'L'; + } elseif ($chardata[$j]['type'] == 'R') { + break; + } + } + } + if ($chardata[$i]['level'] != $prevlevel) { + $levcount = 0; + } else { + ++$levcount; + } + $prevlevel = $chardata[$i]['level']; + } + + // N1. A sequence of neutrals takes the direction of the surrounding strong text if the text on both sides has the same direction. European and Arabic numbers act as if they were R in terms of their influence on neutrals. Start-of-level-run (sor) and end-of-level-run (eor) are used at level run boundaries. + $prevlevel = -1; + $levcount = 0; + for ($i=0; $i < $numchars; ++$i) { + if (($levcount > 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { + if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) { + $chardata[$i]['type'] = 'L'; + } elseif (($chardata[$i]['type'] == 'N') AND + (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND + (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) { + $chardata[$i]['type'] = 'R'; + } elseif ($chardata[$i]['type'] == 'N') { + // N2. Any remaining neutrals take the embedding direction + $chardata[$i]['type'] = $chardata[$i]['sor']; + } + } elseif (($levcount == 0) AND (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] == $prevlevel)) { + // first char + if (($chardata[$i]['type'] == 'N') AND ($chardata[$i]['sor'] == 'L') AND ($chardata[($i+1)]['type'] == 'L')) { + $chardata[$i]['type'] = 'L'; + } elseif (($chardata[$i]['type'] == 'N') AND + (($chardata[$i]['sor'] == 'R') OR ($chardata[$i]['sor'] == 'EN') OR ($chardata[$i]['sor'] == 'AN')) AND + (($chardata[($i+1)]['type'] == 'R') OR ($chardata[($i+1)]['type'] == 'EN') OR ($chardata[($i+1)]['type'] == 'AN'))) { + $chardata[$i]['type'] = 'R'; + } elseif ($chardata[$i]['type'] == 'N') { + // N2. Any remaining neutrals take the embedding direction + $chardata[$i]['type'] = $chardata[$i]['sor']; + } + } elseif (($levcount > 0) AND ((($i+1) == $numchars) OR (($i+1) < $numchars) AND ($chardata[($i+1)]['level'] != $prevlevel))) { + //last char + if (($chardata[$i]['type'] == 'N') AND ($chardata[($i-1)]['type'] == 'L') AND ($chardata[$i]['eor'] == 'L')) { + $chardata[$i]['type'] = 'L'; + } elseif (($chardata[$i]['type'] == 'N') AND + (($chardata[($i-1)]['type'] == 'R') OR ($chardata[($i-1)]['type'] == 'EN') OR ($chardata[($i-1)]['type'] == 'AN')) AND + (($chardata[$i]['eor'] == 'R') OR ($chardata[$i]['eor'] == 'EN') OR ($chardata[$i]['eor'] == 'AN'))) { + $chardata[$i]['type'] = 'R'; + } elseif ($chardata[$i]['type'] == 'N') { + // N2. Any remaining neutrals take the embedding direction + $chardata[$i]['type'] = $chardata[$i]['sor']; + } + } elseif ($chardata[$i]['type'] == 'N') { + // N2. Any remaining neutrals take the embedding direction + $chardata[$i]['type'] = $chardata[$i]['sor']; + } + if ($chardata[$i]['level'] != $prevlevel) { + $levcount = 0; + } else { + ++$levcount; + } + $prevlevel = $chardata[$i]['level']; + } + + // I1. For all characters with an even (left-to-right) embedding direction, those of type R go up one level and those of type AN or EN go up two levels. + // I2. For all characters with an odd (right-to-left) embedding direction, those of type L, EN or AN go up one level. + for ($i=0; $i < $numchars; ++$i) { + $odd = $chardata[$i]['level'] % 2; + if ($odd) { + if (($chardata[$i]['type'] == 'L') OR ($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')) { + $chardata[$i]['level'] += 1; + } + } else { + if ($chardata[$i]['type'] == 'R') { + $chardata[$i]['level'] += 1; + } elseif (($chardata[$i]['type'] == 'AN') OR ($chardata[$i]['type'] == 'EN')) { + $chardata[$i]['level'] += 2; + } + } + $maxlevel = max($chardata[$i]['level'],$maxlevel); + } + + // L1. On each line, reset the embedding level of the following characters to the paragraph embedding level: + // 1. Segment separators, + // 2. Paragraph separators, + // 3. Any sequence of whitespace characters preceding a segment separator or paragraph separator, and + // 4. Any sequence of white space characters at the end of the line. + for ($i=0; $i < $numchars; ++$i) { + if (($chardata[$i]['type'] == 'B') OR ($chardata[$i]['type'] == 'S')) { + $chardata[$i]['level'] = $pel; + } elseif ($chardata[$i]['type'] == 'WS') { + $j = $i+1; + while ($j < $numchars) { + if ((($chardata[$j]['type'] == 'B') OR ($chardata[$j]['type'] == 'S')) OR + (($j == ($numchars-1)) AND ($chardata[$j]['type'] == 'WS'))) { + $chardata[$i]['level'] = $pel; + break; + } elseif ($chardata[$j]['type'] != 'WS') { + break; + } + ++$j; + } + } + } + + // Arabic Shaping + // Cursively connected scripts, such as Arabic or Syriac, require the selection of positional character shapes that depend on adjacent characters. Shaping is logically applied after the Bidirectional Algorithm is used and is limited to characters within the same directional run. + if ($arabic) { + $endedletter = array(1569,1570,1571,1572,1573,1575,1577,1583,1584,1585,1586,1608,1688); + $alfletter = array(1570,1571,1573,1575); + $chardata2 = $chardata; + $laaletter = false; + $charAL = array(); + $x = 0; + for ($i=0; $i < $numchars; ++$i) { + if ((TCPDF_FONT_DATA::$uni_type[$chardata[$i]['char']] == 'AL') OR ($chardata[$i]['char'] == 32) OR ($chardata[$i]['char'] == 8204)) { + $charAL[$x] = $chardata[$i]; + $charAL[$x]['i'] = $i; + $chardata[$i]['x'] = $x; + ++$x; + } + } + $numAL = $x; + for ($i=0; $i < $numchars; ++$i) { + $thischar = $chardata[$i]; + if ($i > 0) { + $prevchar = $chardata[($i-1)]; + } else { + $prevchar = false; + } + if (($i+1) < $numchars) { + $nextchar = $chardata[($i+1)]; + } else { + $nextchar = false; + } + if (TCPDF_FONT_DATA::$uni_type[$thischar['char']] == 'AL') { + $x = $thischar['x']; + if ($x > 0) { + $prevchar = $charAL[($x-1)]; + } else { + $prevchar = false; + } + if (($x+1) < $numAL) { + $nextchar = $charAL[($x+1)]; + } else { + $nextchar = false; + } + // if laa letter + if (($prevchar !== false) AND ($prevchar['char'] == 1604) AND (in_array($thischar['char'], $alfletter))) { + $arabicarr = TCPDF_FONT_DATA::$uni_laa_array; + $laaletter = true; + if ($x > 1) { + $prevchar = $charAL[($x-2)]; + } else { + $prevchar = false; + } + } else { + $arabicarr = TCPDF_FONT_DATA::$uni_arabicsubst; + $laaletter = false; + } + if (($prevchar !== false) AND ($nextchar !== false) AND + ((TCPDF_FONT_DATA::$uni_type[$prevchar['char']] == 'AL') OR (TCPDF_FONT_DATA::$uni_type[$prevchar['char']] == 'NSM')) AND + ((TCPDF_FONT_DATA::$uni_type[$nextchar['char']] == 'AL') OR (TCPDF_FONT_DATA::$uni_type[$nextchar['char']] == 'NSM')) AND + ($prevchar['type'] == $thischar['type']) AND + ($nextchar['type'] == $thischar['type']) AND + ($nextchar['char'] != 1567)) { + if (in_array($prevchar['char'], $endedletter)) { + if (isset($arabicarr[$thischar['char']][2])) { + // initial + $chardata2[$i]['char'] = $arabicarr[$thischar['char']][2]; + } + } else { + if (isset($arabicarr[$thischar['char']][3])) { + // medial + $chardata2[$i]['char'] = $arabicarr[$thischar['char']][3]; + } + } + } elseif (($nextchar !== false) AND + ((TCPDF_FONT_DATA::$uni_type[$nextchar['char']] == 'AL') OR (TCPDF_FONT_DATA::$uni_type[$nextchar['char']] == 'NSM')) AND + ($nextchar['type'] == $thischar['type']) AND + ($nextchar['char'] != 1567)) { + if (isset($arabicarr[$chardata[$i]['char']][2])) { + // initial + $chardata2[$i]['char'] = $arabicarr[$thischar['char']][2]; + } + } elseif ((($prevchar !== false) AND + ((TCPDF_FONT_DATA::$uni_type[$prevchar['char']] == 'AL') OR (TCPDF_FONT_DATA::$uni_type[$prevchar['char']] == 'NSM')) AND + ($prevchar['type'] == $thischar['type'])) OR + (($nextchar !== false) AND ($nextchar['char'] == 1567))) { + // final + if (($i > 1) AND ($thischar['char'] == 1607) AND + ($chardata[$i-1]['char'] == 1604) AND + ($chardata[$i-2]['char'] == 1604)) { + //Allah Word + // mark characters to delete with false + $chardata2[$i-2]['char'] = false; + $chardata2[$i-1]['char'] = false; + $chardata2[$i]['char'] = 65010; + } else { + if (($prevchar !== false) AND in_array($prevchar['char'], $endedletter)) { + if (isset($arabicarr[$thischar['char']][0])) { + // isolated + $chardata2[$i]['char'] = $arabicarr[$thischar['char']][0]; + } + } else { + if (isset($arabicarr[$thischar['char']][1])) { + // final + $chardata2[$i]['char'] = $arabicarr[$thischar['char']][1]; + } + } + } + } elseif (isset($arabicarr[$thischar['char']][0])) { + // isolated + $chardata2[$i]['char'] = $arabicarr[$thischar['char']][0]; + } + // if laa letter + if ($laaletter) { + // mark characters to delete with false + $chardata2[($charAL[($x-1)]['i'])]['char'] = false; + } + } // end if AL (Arabic Letter) + } // end for each char + /* + * Combining characters that can occur with Arabic Shadda (0651 HEX, 1617 DEC) are replaced. + * Putting the combining mark and shadda in the same glyph allows us to avoid the two marks overlapping each other in an illegible manner. + */ + for ($i = 0; $i < ($numchars-1); ++$i) { + if (($chardata2[$i]['char'] == 1617) AND (isset(TCPDF_FONT_DATA::$uni_diacritics[($chardata2[$i+1]['char'])]))) { + // check if the subtitution font is defined on current font + if (isset($currentfont['cw'][(TCPDF_FONT_DATA::$uni_diacritics[($chardata2[$i+1]['char'])])])) { + $chardata2[$i]['char'] = false; + $chardata2[$i+1]['char'] = TCPDF_FONT_DATA::$uni_diacritics[($chardata2[$i+1]['char'])]; + } + } + } + // remove marked characters + foreach ($chardata2 as $key => $value) { + if ($value['char'] === false) { + unset($chardata2[$key]); + } + } + $chardata = array_values($chardata2); + $numchars = count($chardata); + unset($chardata2); + unset($arabicarr); + unset($laaletter); + unset($charAL); + } + + // L2. From the highest level found in the text to the lowest odd level on each line, including intermediate levels not actually present in the text, reverse any contiguous sequence of characters that are at that level or higher. + for ($j=$maxlevel; $j > 0; $j--) { + $ordarray = Array(); + $revarr = Array(); + $onlevel = false; + for ($i=0; $i < $numchars; ++$i) { + if ($chardata[$i]['level'] >= $j) { + $onlevel = true; + if (isset(TCPDF_FONT_DATA::$uni_mirror[$chardata[$i]['char']])) { + // L4. A character is depicted by a mirrored glyph if and only if (a) the resolved directionality of that character is R, and (b) the Bidi_Mirrored property value of that character is true. + $chardata[$i]['char'] = TCPDF_FONT_DATA::$uni_mirror[$chardata[$i]['char']]; + } + $revarr[] = $chardata[$i]; + } else { + if ($onlevel) { + $revarr = array_reverse($revarr); + $ordarray = array_merge($ordarray, $revarr); + $revarr = Array(); + $onlevel = false; + } + $ordarray[] = $chardata[$i]; + } + } + if ($onlevel) { + $revarr = array_reverse($revarr); + $ordarray = array_merge($ordarray, $revarr); + } + $chardata = $ordarray; + } + $ordarray = array(); + foreach ($chardata as $cd) { + $ordarray[] = $cd['char']; + // store char values for subsetting + $currentfont['subsetchars'][$cd['char']] = true; + } + return $ordarray; + } + +} // END OF TCPDF_FONTS CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_images.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_images.php new file mode 100755 index 0000000..6f2860c --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_images.php @@ -0,0 +1,359 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : +// Static image methods used by the TCPDF class. +// +//============================================================+ + +/** + * @file + * This is a PHP class that contains static image methods for the TCPDF class.
      + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.005 + */ + +/** + * @class TCPDF_IMAGES + * Static image methods used by the TCPDF class. + * @package com.tecnick.tcpdf + * @brief PHP class for generating PDF documents without requiring external extensions. + * @version 1.0.005 + * @author Nicola Asuni - info@tecnick.com + */ +class TCPDF_IMAGES { + + /** + * Array of hinheritable SVG properties. + * @since 5.0.000 (2010-05-02) + * @public static + * + * @var string[] + */ + public static $svginheritprop = array('clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cursor', 'direction', 'display', 'fill', 'fill-opacity', 'fill-rule', 'font', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'image-rendering', 'kerning', 'letter-spacing', 'marker', 'marker-end', 'marker-mid', 'marker-start', 'pointer-events', 'shape-rendering', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-rendering', 'visibility', 'word-spacing', 'writing-mode'); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + /** + * Return the image type given the file name or array returned by getimagesize() function. + * @param string $imgfile image file name + * @param array $iminfo array of image information returned by getimagesize() function. + * @return string image type + * @since 4.8.017 (2009-11-27) + * @public static + */ + public static function getImageFileType($imgfile, $iminfo=array()) { + $type = ''; + if (isset($iminfo['mime']) AND !empty($iminfo['mime'])) { + $mime = explode('/', $iminfo['mime']); + if ((count($mime) > 1) AND ($mime[0] == 'image') AND (!empty($mime[1]))) { + $type = strtolower(trim($mime[1])); + } + } + if (empty($type)) { + $type = strtolower(trim(pathinfo(parse_url($imgfile, PHP_URL_PATH), PATHINFO_EXTENSION))); + } + if ($type == 'jpg') { + $type = 'jpeg'; + } + return $type; + } + + /** + * Set the transparency for the given GD image. + * @param resource $new_image GD image object + * @param resource $image GD image object. + * @return resource GD image object $new_image + * @since 4.9.016 (2010-04-20) + * @public static + */ + public static function setGDImageTransparency($new_image, $image) { + // default transparency color (white) + $tcol = array('red' => 255, 'green' => 255, 'blue' => 255); + // transparency index + $tid = imagecolortransparent($image); + $palletsize = imagecolorstotal($image); + if (($tid >= 0) AND ($tid < $palletsize)) { + // get the colors for the transparency index + $tcol = imagecolorsforindex($image, $tid); + } + $tid = imagecolorallocate($new_image, $tcol['red'], $tcol['green'], $tcol['blue']); + imagefill($new_image, 0, 0, $tid); + imagecolortransparent($new_image, $tid); + return $new_image; + } + + /** + * Convert the loaded image to a PNG and then return a structure for the PDF creator. + * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. + * @param resource $image Image object. + * @param string $tempfile Temporary file name. + * return image PNG image object. + * @since 4.9.016 (2010-04-20) + * @public static + */ + public static function _toPNG($image, $tempfile) { + // turn off interlaced mode + imageinterlace($image, 0); + // create temporary PNG image + imagepng($image, $tempfile); + // remove image from memory + imagedestroy($image); + // get PNG image data + $retvars = self::_parsepng($tempfile); + // tidy up by removing temporary image + unlink($tempfile); + return $retvars; + } + + /** + * Convert the loaded image to a JPEG and then return a structure for the PDF creator. + * This function requires GD library and write access to the directory defined on K_PATH_CACHE constant. + * @param resource $image Image object. + * @param int $quality JPEG quality. + * @param string $tempfile Temporary file name. + * return array|false image JPEG image object. + * @public static + */ + public static function _toJPEG($image, $quality, $tempfile) { + imagejpeg($image, $tempfile, $quality); + imagedestroy($image); + $retvars = self::_parsejpeg($tempfile); + // tidy up by removing temporary image + unlink($tempfile); + return $retvars; + } + + /** + * Extract info from a JPEG file without using the GD library. + * @param string $file image file to parse + * @return array|false structure containing the image data + * @public static + */ + public static function _parsejpeg($file) { + // check if is a local file + if (!@TCPDF_STATIC::file_exists($file)) { + return false; + } + $a = getimagesize($file); + if (empty($a)) { + //Missing or incorrect image file + return false; + } + if ($a[2] != 2) { + // Not a JPEG file + return false; + } + // bits per pixel + $bpc = isset($a['bits']) ? intval($a['bits']) : 8; + // number of image channels + if (!isset($a['channels'])) { + $channels = 3; + } else { + $channels = intval($a['channels']); + } + // default colour space + switch ($channels) { + case 1: { + $colspace = 'DeviceGray'; + break; + } + case 3: { + $colspace = 'DeviceRGB'; + break; + } + case 4: { + $colspace = 'DeviceCMYK'; + break; + } + default: { + $channels = 3; + $colspace = 'DeviceRGB'; + break; + } + } + // get file content + $data = file_get_contents($file); + // check for embedded ICC profile + $icc = array(); + $offset = 0; + while (($pos = strpos($data, "ICC_PROFILE\0", $offset)) !== false) { + // get ICC sequence length + $length = (TCPDF_STATIC::_getUSHORT($data, ($pos - 2)) - 16); + // marker sequence number + $msn = max(1, ord($data[($pos + 12)])); + // number of markers (total of APP2 used) + $nom = max(1, ord($data[($pos + 13)])); + // get sequence segment + $icc[($msn - 1)] = substr($data, ($pos + 14), $length); + // move forward to next sequence + $offset = ($pos + 14 + $length); + } + // order and compact ICC segments + if (count($icc) > 0) { + ksort($icc); + $icc = implode('', $icc); + if ((ord($icc[36]) != 0x61) OR (ord($icc[37]) != 0x63) OR (ord($icc[38]) != 0x73) OR (ord($icc[39]) != 0x70)) { + // invalid ICC profile + $icc = false; + } + } else { + $icc = false; + } + return array('w' => $a[0], 'h' => $a[1], 'ch' => $channels, 'icc' => $icc, 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'DCTDecode', 'data' => $data); + } + + /** + * Extract info from a PNG file without using the GD library. + * @param string $file image file to parse + * @return array|false structure containing the image data + * @public static + */ + public static function _parsepng($file) { + $f = @fopen($file, 'rb'); + if ($f === false) { + // Can't open image file + return false; + } + //Check signature + if (fread($f, 8) != chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) { + // Not a PNG file + return false; + } + //Read header chunk + fread($f, 4); + if (fread($f, 4) != 'IHDR') { + //Incorrect PNG file + return false; + } + $w = TCPDF_STATIC::_freadint($f); + $h = TCPDF_STATIC::_freadint($f); + $bpc = ord(fread($f, 1)); + $ct = ord(fread($f, 1)); + if ($ct == 0) { + $colspace = 'DeviceGray'; + } elseif ($ct == 2) { + $colspace = 'DeviceRGB'; + } elseif ($ct == 3) { + $colspace = 'Indexed'; + } else { + // alpha channel + fclose($f); + return 'pngalpha'; + } + if (ord(fread($f, 1)) != 0) { + // Unknown compression method + fclose($f); + return false; + } + if (ord(fread($f, 1)) != 0) { + // Unknown filter method + fclose($f); + return false; + } + if (ord(fread($f, 1)) != 0) { + // Interlacing not supported + fclose($f); + return false; + } + fread($f, 4); + $channels = ($ct == 2 ? 3 : 1); + $parms = '/DecodeParms << /Predictor 15 /Colors '.$channels.' /BitsPerComponent '.$bpc.' /Columns '.$w.' >>'; + //Scan chunks looking for palette, transparency and image data + $pal = ''; + $trns = ''; + $data = ''; + $icc = false; + $n = TCPDF_STATIC::_freadint($f); + do { + $type = fread($f, 4); + if ($type == 'PLTE') { + // read palette + $pal = TCPDF_STATIC::rfread($f, $n); + fread($f, 4); + } elseif ($type == 'tRNS') { + // read transparency info + $t = TCPDF_STATIC::rfread($f, $n); + if ($ct == 0) { // DeviceGray + $trns = array(ord($t[1])); + } elseif ($ct == 2) { // DeviceRGB + $trns = array(ord($t[1]), ord($t[3]), ord($t[5])); + } else { // Indexed + if ($n > 0) { + $trns = array(); + for ($i = 0; $i < $n; ++ $i) { + $trns[] = ord($t[$i]); + } + } + } + fread($f, 4); + } elseif ($type == 'IDAT') { + // read image data block + $data .= TCPDF_STATIC::rfread($f, $n); + fread($f, 4); + } elseif ($type == 'iCCP') { + // skip profile name + $len = 0; + while ((ord(fread($f, 1)) != 0) AND ($len < 80)) { + ++$len; + } + // get compression method + if (ord(fread($f, 1)) != 0) { + // Unknown filter method + fclose($f); + return false; + } + // read ICC Color Profile + $icc = TCPDF_STATIC::rfread($f, ($n - $len - 2)); + // decompress profile + $icc = gzuncompress($icc); + fread($f, 4); + } elseif ($type == 'IEND') { + break; + } else { + TCPDF_STATIC::rfread($f, $n + 4); + } + $n = TCPDF_STATIC::_freadint($f); + } while ($n); + if (($colspace == 'Indexed') AND (empty($pal))) { + // Missing palette + fclose($f); + return false; + } + fclose($f); + return array('w' => $w, 'h' => $h, 'ch' => $channels, 'icc' => $icc, 'cs' => $colspace, 'bpc' => $bpc, 'f' => 'FlateDecode', 'parms' => $parms, 'pal' => $pal, 'trns' => $trns, 'data' => $data); + } + +} // END OF TCPDF_IMAGES CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_static.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_static.php new file mode 100755 index 0000000..5700655 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/include/tcpdf_static.php @@ -0,0 +1,2639 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : +// Static methods used by the TCPDF class. +// +//============================================================+ + +/** + * @file + * This is a PHP class that contains static methods for the TCPDF class.
      + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.1.2 + */ + +/** + * @class TCPDF_STATIC + * Static methods used by the TCPDF class. + * @package com.tecnick.tcpdf + * @brief PHP class for generating PDF documents without requiring external extensions. + * @version 1.1.1 + * @author Nicola Asuni - info@tecnick.com + */ +class TCPDF_STATIC { + + /** + * Current TCPDF version. + * @private static + */ + private static $tcpdf_version = '6.6.2'; + + /** + * String alias for total number of pages. + * @public static + */ + public static $alias_tot_pages = '{:ptp:}'; + + /** + * String alias for page number. + * @public static + */ + public static $alias_num_page = '{:pnp:}'; + + /** + * String alias for total number of pages in a single group. + * @public static + */ + public static $alias_group_tot_pages = '{:ptg:}'; + + /** + * String alias for group page number. + * @public static + */ + public static $alias_group_num_page = '{:png:}'; + + /** + * String alias for right shift compensation used to correctly align page numbers on the right. + * @public static + */ + public static $alias_right_shift = '{rsc:'; + + /** + * Encryption padding string. + * @public static + */ + public static $enc_padding = "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A"; + + /** + * ByteRange placemark used during digital signature process. + * @since 4.6.028 (2009-08-25) + * @public static + */ + public static $byterange_string = '/ByteRange[0 ********** ********** **********]'; + + /** + * Array page boxes names + * @public static + */ + public static $pageboxes = array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'); + + // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + /** + * Return the current TCPDF version. + * @return string TCPDF version string + * @since 5.9.012 (2010-11-10) + * @public static + */ + public static function getTCPDFVersion() { + return self::$tcpdf_version; + } + + /** + * Return the current TCPDF producer. + * @return string TCPDF producer string + * @since 6.0.000 (2013-03-16) + * @public static + */ + public static function getTCPDFProducer() { + return "\x54\x43\x50\x44\x46\x20".self::getTCPDFVersion()."\x20\x28\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29"; + } + + /** + * Check if the URL exist. + * @param string $url URL to check. + * @return boolean true if the URl exist, false otherwise. + * @since 5.9.204 (2013-01-28) + * @public static + */ + public static function isValidURL($url) { + $headers = @get_headers($url); + if ($headers === false) { + return false; + } + return (strpos($headers[0], '200') !== false); + } + + /** + * Removes SHY characters from text. + * Unicode Data:
        + *
      • Name : SOFT HYPHEN, commonly abbreviated as SHY
      • + *
      • HTML Entity (decimal): "&#173;"
      • + *
      • HTML Entity (hex): "&#xad;"
      • + *
      • HTML Entity (named): "&shy;"
      • + *
      • How to type in Microsoft Windows: [Alt +00AD] or [Alt 0173]
      • + *
      • UTF-8 (hex): 0xC2 0xAD (c2ad)
      • + *
      • UTF-8 character: chr(194).chr(173)
      • + *
      + * @param string $txt input string + * @param boolean $unicode True if we are in unicode mode, false otherwise. + * @return string without SHY characters. + * @since (4.5.019) 2009-02-28 + * @public static + */ + public static function removeSHY($txt='', $unicode=true) { + $txt = preg_replace('/([\\xc2]{1}[\\xad]{1})/', '', $txt); + if (!$unicode) { + $txt = preg_replace('/([\\xad]{1})/', '', $txt); + } + return $txt; + } + + + /** + * Get the border mode accounting for multicell position (opens bottom side of multicell crossing pages) + * @param string|array|int $brd Indicates if borders must be drawn around the cell block. The value can be a number:
      • 0: no border (default)
      • 1: frame
      or a string containing some or all of the following characters (in any order):
      • L: left
      • T: top
      • R: right
      • B: bottom
      or an array of line styles for each border group: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param string $position multicell position: 'start', 'middle', 'end' + * @param boolean $opencell True when the cell is left open at the page bottom, false otherwise. + * @return array border mode array + * @since 4.4.002 (2008-12-09) + * @public static + */ + public static function getBorderMode($brd, $position='start', $opencell=true) { + if ((!$opencell) OR empty($brd)) { + return $brd; + } + if ($brd == 1) { + $brd = 'LTRB'; + } + if (is_string($brd)) { + // convert string to array + $slen = strlen($brd); + $newbrd = array(); + for ($i = 0; $i < $slen; ++$i) { + $newbrd[$brd[$i]] = array('cap' => 'square', 'join' => 'miter'); + } + $brd = $newbrd; + } + foreach ($brd as $border => $style) { + switch ($position) { + case 'start': { + if (strpos($border, 'B') !== false) { + // remove bottom line + $newkey = str_replace('B', '', $border); + if (strlen($newkey) > 0) { + $brd[$newkey] = $style; + } + unset($brd[$border]); + } + break; + } + case 'middle': { + if (strpos($border, 'B') !== false) { + // remove bottom line + $newkey = str_replace('B', '', $border); + if (strlen($newkey) > 0) { + $brd[$newkey] = $style; + } + unset($brd[$border]); + $border = $newkey; + } + if (strpos($border, 'T') !== false) { + // remove bottom line + $newkey = str_replace('T', '', $border); + if (strlen($newkey) > 0) { + $brd[$newkey] = $style; + } + unset($brd[$border]); + } + break; + } + case 'end': { + if (strpos($border, 'T') !== false) { + // remove bottom line + $newkey = str_replace('T', '', $border); + if (strlen($newkey) > 0) { + $brd[$newkey] = $style; + } + unset($brd[$border]); + } + break; + } + } + } + return $brd; + } + + /** + * Determine whether a string is empty. + * @param string $str string to be checked + * @return bool true if string is empty + * @since 4.5.044 (2009-04-16) + * @public static + */ + public static function empty_string($str) { + return (is_null($str) OR (is_string($str) AND (strlen($str) == 0))); + } + + /** + * Returns a temporary filename for caching object on filesystem. + * @param string $type Type of file (name of the subdir on the tcpdf cache folder). + * @param string $file_id TCPDF file_id. + * @return string filename. + * @since 4.5.000 (2008-12-31) + * @public static + */ + public static function getObjFilename($type='tmp', $file_id='') { + return tempnam(K_PATH_CACHE, '__tcpdf_'.$file_id.'_'.$type.'_'.md5(TCPDF_STATIC::getRandomSeed()).'_'); + } + + /** + * Add "\" before "\", "(" and ")" + * @param string $s string to escape. + * @return string escaped string. + * @public static + */ + public static function _escape($s) { + // the chr(13) substitution fixes the Bugs item #1421290. + return strtr($s, array(')' => '\\)', '(' => '\\(', '\\' => '\\\\', chr(13) => '\r')); + } + + /** + * Escape some special characters (< > &) for XML output. + * @param string $str Input string to convert. + * @return string converted string + * @since 5.9.121 (2011-09-28) + * @public static + */ + public static function _escapeXML($str) { + $replaceTable = array("\0" => '', '&' => '&', '<' => '<', '>' => '>'); + $str = strtr($str === null ? '' : $str, $replaceTable); + return $str; + } + + /** + * Creates a copy of a class object + * @param object $object class object to be cloned + * @return object cloned object + * @since 4.5.029 (2009-03-19) + * @public static + */ + public static function objclone($object) { + if (($object instanceof Imagick) AND (version_compare(phpversion('imagick'), '3.0.1') !== 1)) { + // on the versions after 3.0.1 the clone() method was deprecated in favour of clone keyword + return @$object->clone(); + } + return @clone($object); + } + + /** + * Output input data and compress it if possible. + * @param string $data Data to output. + * @param int $length Data length in bytes. + * @since 5.9.086 + * @public static + */ + public static function sendOutputData($data, $length) { + if (!isset($_SERVER['HTTP_ACCEPT_ENCODING']) OR empty($_SERVER['HTTP_ACCEPT_ENCODING'])) { + // the content length may vary if the server is using compression + header('Content-Length: '.$length); + } + echo $data; + } + + /** + * Replace page number aliases with number. + * @param string $page Page content. + * @param array $replace Array of replacements (array keys are replacement strings, values are alias arrays). + * @param int $diff If passed, this will be set to the total char number difference between alias and replacements. + * @return array replaced page content and updated $diff parameter as array. + * @public static + */ + public static function replacePageNumAliases($page, $replace, $diff=0) { + foreach ($replace as $rep) { + foreach ($rep[3] as $a) { + if (strpos($page, $a) !== false) { + $page = str_replace($a, $rep[0], $page); + $diff += ($rep[2] - $rep[1]); + } + } + } + return array($page, $diff); + } + + /** + * Returns timestamp in seconds from formatted date-time. + * @param string $date Formatted date-time. + * @return int seconds. + * @since 5.9.152 (2012-03-23) + * @public static + */ + public static function getTimestamp($date) { + if (($date[0] == 'D') AND ($date[1] == ':')) { + // remove date prefix if present + $date = substr($date, 2); + } + return strtotime($date); + } + + /** + * Returns a formatted date-time. + * @param int $time Time in seconds. + * @return string escaped date string. + * @since 5.9.152 (2012-03-23) + * @public static + */ + public static function getFormattedDate($time) { + return substr_replace(date('YmdHisO', intval($time)), '\'', (0 - 2), 0).'\''; + } + + /** + * Returns a string containing random data to be used as a seed for encryption methods. + * @param string $seed starting seed value + * @return string containing random data + * @author Nicola Asuni + * @since 5.9.006 (2010-10-19) + * @public static + */ + public static function getRandomSeed($seed='') { + $rnd = uniqid(rand().microtime(true), true); + if (function_exists('posix_getpid')) { + $rnd .= posix_getpid(); + } + if (function_exists('openssl_random_pseudo_bytes') AND (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) { + // this is not used on windows systems because it is very slow for a know bug + $rnd .= openssl_random_pseudo_bytes(512); + } else { + for ($i = 0; $i < 23; ++$i) { + $rnd .= uniqid('', true); + } + } + return $rnd.$seed.__FILE__.serialize($_SERVER).microtime(true); + } + + /** + * Encrypts a string using MD5 and returns it's value as a binary string. + * @param string $str input string + * @return string MD5 encrypted binary string + * @since 2.0.000 (2008-01-02) + * @public static + */ + public static function _md5_16($str) { + return pack('H*', md5($str)); + } + + /** + * Returns the input text encrypted using AES algorithm and the specified key. + * This method requires openssl or mcrypt. Text is padded to 16bytes blocks + * @param string $key encryption key + * @param string $text input text to be encrypted + * @return string encrypted text + * @author Nicola Asuni + * @since 5.0.005 (2010-05-11) + * @public static + */ + public static function _AES($key, $text) { + // padding (RFC 2898, PKCS #5: Password-Based Cryptography Specification Version 2.0) + $padding = 16 - (strlen($text) % 16); + $text .= str_repeat(chr($padding), $padding); + if (extension_loaded('openssl')) { + $algo = 'aes-256-cbc'; + if (strlen($key) == 16) { + $algo = 'aes-128-cbc'; + } + $iv = openssl_random_pseudo_bytes(openssl_cipher_iv_length($algo)); + $text = openssl_encrypt($text, $algo, $key, OPENSSL_RAW_DATA, $iv); + return $iv.substr($text, 0, -16); + } + $iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), MCRYPT_RAND); + $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv); + $text = $iv.$text; + return $text; + } + + /** + * Returns the input text encrypted using AES algorithm and the specified key. + * This method requires openssl or mcrypt. Text is not padded + * @param string $key encryption key + * @param string $text input text to be encrypted + * @return string encrypted text + * @author Nicola Asuni + * @since TODO + * @public static + */ + public static function _AESnopad($key, $text) { + if (extension_loaded('openssl')) { + $algo = 'aes-256-cbc'; + if (strlen($key) == 16) { + $algo = 'aes-128-cbc'; + } + $iv = str_repeat("\x00", openssl_cipher_iv_length($algo)); + $text = openssl_encrypt($text, $algo, $key, OPENSSL_RAW_DATA, $iv); + return substr($text, 0, -16); + } + $iv = str_repeat("\x00", mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC)); + $text = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $text, MCRYPT_MODE_CBC, $iv); + return $text; + } + + /** + * Returns the input text encrypted using RC4 algorithm and the specified key. + * RC4 is the standard encryption algorithm used in PDF format + * @param string $key Encryption key. + * @param string $text Input text to be encrypted. + * @param string $last_enc_key Reference to last RC4 key encrypted. + * @param string $last_enc_key_c Reference to last RC4 computed key. + * @return string encrypted text + * @since 2.0.000 (2008-01-02) + * @author Klemen Vodopivec, Nicola Asuni + * @public static + */ + public static function _RC4($key, $text, &$last_enc_key, &$last_enc_key_c) { + if (function_exists('mcrypt_encrypt') AND ($out = @mcrypt_encrypt(MCRYPT_ARCFOUR, $key, $text, MCRYPT_MODE_STREAM, ''))) { + // try to use mcrypt function if exist + return $out; + } + if ($last_enc_key != $key) { + $k = str_repeat($key, (int) ((256 / strlen($key)) + 1)); + $rc4 = range(0, 255); + $j = 0; + for ($i = 0; $i < 256; ++$i) { + $t = $rc4[$i]; + $j = ($j + $t + ord($k[$i])) % 256; + $rc4[$i] = $rc4[$j]; + $rc4[$j] = $t; + } + $last_enc_key = $key; + $last_enc_key_c = $rc4; + } else { + $rc4 = $last_enc_key_c; + } + $len = strlen($text); + $a = 0; + $b = 0; + $out = ''; + for ($i = 0; $i < $len; ++$i) { + $a = ($a + 1) % 256; + $t = $rc4[$a]; + $b = ($b + $t) % 256; + $rc4[$a] = $rc4[$b]; + $rc4[$b] = $t; + $k = $rc4[($rc4[$a] + $rc4[$b]) % 256]; + $out .= chr(ord($text[$i]) ^ $k); + } + return $out; + } + + /** + * Return the permission code used on encryption (P value). + * @param array $permissions the set of permissions (specify the ones you want to block). + * @param int $mode encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. + * @since 5.0.005 (2010-05-12) + * @author Nicola Asuni + * @public static + */ + public static function getUserPermissionCode($permissions, $mode=0) { + $options = array( + 'owner' => 2, // bit 2 -- inverted logic: cleared by default + 'print' => 4, // bit 3 + 'modify' => 8, // bit 4 + 'copy' => 16, // bit 5 + 'annot-forms' => 32, // bit 6 + 'fill-forms' => 256, // bit 9 + 'extract' => 512, // bit 10 + 'assemble' => 1024,// bit 11 + 'print-high' => 2048 // bit 12 + ); + $protection = 2147422012; // 32 bit: (01111111 11111111 00001111 00111100) + foreach ($permissions as $permission) { + if (isset($options[$permission])) { + if (($mode > 0) OR ($options[$permission] <= 32)) { + // set only valid permissions + if ($options[$permission] == 2) { + // the logic for bit 2 is inverted (cleared by default) + $protection += $options[$permission]; + } else { + $protection -= $options[$permission]; + } + } + } + } + return $protection; + } + + /** + * Convert hexadecimal string to string + * @param string $bs byte-string to convert + * @return string + * @since 5.0.005 (2010-05-12) + * @author Nicola Asuni + * @public static + */ + public static function convertHexStringToString($bs) { + $string = ''; // string to be returned + $bslength = strlen($bs); + if (($bslength % 2) != 0) { + // padding + $bs .= '0'; + ++$bslength; + } + for ($i = 0; $i < $bslength; $i += 2) { + $string .= chr(hexdec($bs[$i].$bs[($i + 1)])); + } + return $string; + } + + /** + * Convert string to hexadecimal string (byte string) + * @param string $s string to convert + * @return string byte string + * @since 5.0.010 (2010-05-17) + * @author Nicola Asuni + * @public static + */ + public static function convertStringToHexString($s) { + $bs = ''; + $chars = preg_split('//', $s, -1, PREG_SPLIT_NO_EMPTY); + foreach ($chars as $c) { + $bs .= sprintf('%02s', dechex(ord($c))); + } + return $bs; + } + + /** + * Convert encryption P value to a string of bytes, low-order byte first. + * @param string $protection 32bit encryption permission value (P value) + * @return string + * @since 5.0.005 (2010-05-12) + * @author Nicola Asuni + * @public static + */ + public static function getEncPermissionsString($protection) { + $binprot = sprintf('%032b', $protection); + $str = chr(bindec(substr($binprot, 24, 8))); + $str .= chr(bindec(substr($binprot, 16, 8))); + $str .= chr(bindec(substr($binprot, 8, 8))); + $str .= chr(bindec(substr($binprot, 0, 8))); + return $str; + } + + /** + * Encode a name object. + * @param string $name Name object to encode. + * @return string Encoded name object. + * @author Nicola Asuni + * @since 5.9.097 (2011-06-23) + * @public static + */ + public static function encodeNameObject($name) { + $escname = ''; + $length = strlen($name); + for ($i = 0; $i < $length; ++$i) { + $chr = $name[$i]; + if (preg_match('/[0-9a-zA-Z#_=-]/', $chr) == 1) { + $escname .= $chr; + } else { + $escname .= sprintf('#%02X', ord($chr)); + } + } + return $escname; + } + + /** + * Convert JavaScript form fields properties array to Annotation Properties array. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $spot_colors Reference to spot colors array. + * @param boolean $rtl True if in Right-To-Left text direction mode, false otherwise. + * @return array of annotation properties + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + * @public static + */ + public static function getAnnotOptFromJSProp($prop, &$spot_colors, $rtl=false) { + if (isset($prop['aopt']) AND is_array($prop['aopt'])) { + // the annotation options are already defined + return $prop['aopt']; + } + $opt = array(); // value to be returned + // alignment: Controls how the text is laid out within the text field. + if (isset($prop['alignment'])) { + switch ($prop['alignment']) { + case 'left': { + $opt['q'] = 0; + break; + } + case 'center': { + $opt['q'] = 1; + break; + } + case 'right': { + $opt['q'] = 2; + break; + } + default: { + $opt['q'] = ($rtl)?2:0; + break; + } + } + } + // lineWidth: Specifies the thickness of the border when stroking the perimeter of a field's rectangle. + if (isset($prop['lineWidth'])) { + $linewidth = intval($prop['lineWidth']); + } else { + $linewidth = 1; + } + // borderStyle: The border style for a field. + if (isset($prop['borderStyle'])) { + switch ($prop['borderStyle']) { + case 'border.d': + case 'dashed': { + $opt['border'] = array(0, 0, $linewidth, array(3, 2)); + $opt['bs'] = array('w'=>$linewidth, 's'=>'D', 'd'=>array(3, 2)); + break; + } + case 'border.b': + case 'beveled': { + $opt['border'] = array(0, 0, $linewidth); + $opt['bs'] = array('w'=>$linewidth, 's'=>'B'); + break; + } + case 'border.i': + case 'inset': { + $opt['border'] = array(0, 0, $linewidth); + $opt['bs'] = array('w'=>$linewidth, 's'=>'I'); + break; + } + case 'border.u': + case 'underline': { + $opt['border'] = array(0, 0, $linewidth); + $opt['bs'] = array('w'=>$linewidth, 's'=>'U'); + break; + } + case 'border.s': + case 'solid': { + $opt['border'] = array(0, 0, $linewidth); + $opt['bs'] = array('w'=>$linewidth, 's'=>'S'); + break; + } + default: { + break; + } + } + } + if (isset($prop['border']) AND is_array($prop['border'])) { + $opt['border'] = $prop['border']; + } + if (!isset($opt['mk'])) { + $opt['mk'] = array(); + } + if (!isset($opt['mk']['if'])) { + $opt['mk']['if'] = array(); + } + $opt['mk']['if']['a'] = array(0.5, 0.5); + // buttonAlignX: Controls how space is distributed from the left of the button face with respect to the icon. + if (isset($prop['buttonAlignX'])) { + $opt['mk']['if']['a'][0] = $prop['buttonAlignX']; + } + // buttonAlignY: Controls how unused space is distributed from the bottom of the button face with respect to the icon. + if (isset($prop['buttonAlignY'])) { + $opt['mk']['if']['a'][1] = $prop['buttonAlignY']; + } + // buttonFitBounds: If true, the extent to which the icon may be scaled is set to the bounds of the button field. + if (isset($prop['buttonFitBounds']) AND ($prop['buttonFitBounds'] == 'true')) { + $opt['mk']['if']['fb'] = true; + } + // buttonScaleHow: Controls how the icon is scaled (if necessary) to fit inside the button face. + if (isset($prop['buttonScaleHow'])) { + switch ($prop['buttonScaleHow']) { + case 'scaleHow.proportional': { + $opt['mk']['if']['s'] = 'P'; + break; + } + case 'scaleHow.anamorphic': { + $opt['mk']['if']['s'] = 'A'; + break; + } + } + } + // buttonScaleWhen: Controls when an icon is scaled to fit inside the button face. + if (isset($prop['buttonScaleWhen'])) { + switch ($prop['buttonScaleWhen']) { + case 'scaleWhen.always': { + $opt['mk']['if']['sw'] = 'A'; + break; + } + case 'scaleWhen.never': { + $opt['mk']['if']['sw'] = 'N'; + break; + } + case 'scaleWhen.tooBig': { + $opt['mk']['if']['sw'] = 'B'; + break; + } + case 'scaleWhen.tooSmall': { + $opt['mk']['if']['sw'] = 'S'; + break; + } + } + } + // buttonPosition: Controls how the text and the icon of the button are positioned with respect to each other within the button face. + if (isset($prop['buttonPosition'])) { + switch ($prop['buttonPosition']) { + case 0: + case 'position.textOnly': { + $opt['mk']['tp'] = 0; + break; + } + case 1: + case 'position.iconOnly': { + $opt['mk']['tp'] = 1; + break; + } + case 2: + case 'position.iconTextV': { + $opt['mk']['tp'] = 2; + break; + } + case 3: + case 'position.textIconV': { + $opt['mk']['tp'] = 3; + break; + } + case 4: + case 'position.iconTextH': { + $opt['mk']['tp'] = 4; + break; + } + case 5: + case 'position.textIconH': { + $opt['mk']['tp'] = 5; + break; + } + case 6: + case 'position.overlay': { + $opt['mk']['tp'] = 6; + break; + } + } + } + // fillColor: Specifies the background color for a field. + if (isset($prop['fillColor'])) { + if (is_array($prop['fillColor'])) { + $opt['mk']['bg'] = $prop['fillColor']; + } else { + $opt['mk']['bg'] = TCPDF_COLORS::convertHTMLColorToDec($prop['fillColor'], $spot_colors); + } + } + // strokeColor: Specifies the stroke color for a field that is used to stroke the rectangle of the field with a line as large as the line width. + if (isset($prop['strokeColor'])) { + if (is_array($prop['strokeColor'])) { + $opt['mk']['bc'] = $prop['strokeColor']; + } else { + $opt['mk']['bc'] = TCPDF_COLORS::convertHTMLColorToDec($prop['strokeColor'], $spot_colors); + } + } + // rotation: The rotation of a widget in counterclockwise increments. + if (isset($prop['rotation'])) { + $opt['mk']['r'] = $prop['rotation']; + } + // charLimit: Limits the number of characters that a user can type into a text field. + if (isset($prop['charLimit'])) { + $opt['maxlen'] = intval($prop['charLimit']); + } + $ff = 0; + // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. + if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { + $ff += 1 << 0; + } + // required: Specifies whether a field requires a value. + if (isset($prop['required']) AND ($prop['required'] == 'true')) { + $ff += 1 << 1; + } + // multiline: Controls how text is wrapped within the field. + if (isset($prop['multiline']) AND ($prop['multiline'] == 'true')) { + $ff += 1 << 12; + } + // password: Specifies whether the field should display asterisks when data is entered in the field. + if (isset($prop['password']) AND ($prop['password'] == 'true')) { + $ff += 1 << 13; + } + // NoToggleToOff: If set, exactly one radio button shall be selected at all times; selecting the currently selected button has no effect. + if (isset($prop['NoToggleToOff']) AND ($prop['NoToggleToOff'] == 'true')) { + $ff += 1 << 14; + } + // Radio: If set, the field is a set of radio buttons. + if (isset($prop['Radio']) AND ($prop['Radio'] == 'true')) { + $ff += 1 << 15; + } + // Pushbutton: If set, the field is a pushbutton that does not retain a permanent value. + if (isset($prop['Pushbutton']) AND ($prop['Pushbutton'] == 'true')) { + $ff += 1 << 16; + } + // Combo: If set, the field is a combo box; if clear, the field is a list box. + if (isset($prop['Combo']) AND ($prop['Combo'] == 'true')) { + $ff += 1 << 17; + } + // editable: Controls whether a combo box is editable. + if (isset($prop['editable']) AND ($prop['editable'] == 'true')) { + $ff += 1 << 18; + } + // Sort: If set, the field's option items shall be sorted alphabetically. + if (isset($prop['Sort']) AND ($prop['Sort'] == 'true')) { + $ff += 1 << 19; + } + // fileSelect: If true, sets the file-select flag in the Options tab of the text field (Field is Used for File Selection). + if (isset($prop['fileSelect']) AND ($prop['fileSelect'] == 'true')) { + $ff += 1 << 20; + } + // multipleSelection: If true, indicates that a list box allows a multiple selection of items. + if (isset($prop['multipleSelection']) AND ($prop['multipleSelection'] == 'true')) { + $ff += 1 << 21; + } + // doNotSpellCheck: If true, spell checking is not performed on this editable text field. + if (isset($prop['doNotSpellCheck']) AND ($prop['doNotSpellCheck'] == 'true')) { + $ff += 1 << 22; + } + // doNotScroll: If true, the text field does not scroll and the user, therefore, is limited by the rectangular region designed for the field. + if (isset($prop['doNotScroll']) AND ($prop['doNotScroll'] == 'true')) { + $ff += 1 << 23; + } + // comb: If set to true, the field background is drawn as series of boxes (one for each character in the value of the field) and each character of the content is drawn within those boxes. The number of boxes drawn is determined from the charLimit property. It applies only to text fields. The setter will also raise if any of the following field properties are also set multiline, password, and fileSelect. A side-effect of setting this property is that the doNotScroll property is also set. + if (isset($prop['comb']) AND ($prop['comb'] == 'true')) { + $ff += 1 << 24; + } + // radiosInUnison: If false, even if a group of radio buttons have the same name and export value, they behave in a mutually exclusive fashion, like HTML radio buttons. + if (isset($prop['radiosInUnison']) AND ($prop['radiosInUnison'] == 'true')) { + $ff += 1 << 25; + } + // richText: If true, the field allows rich text formatting. + if (isset($prop['richText']) AND ($prop['richText'] == 'true')) { + $ff += 1 << 25; + } + // commitOnSelChange: Controls whether a field value is committed after a selection change. + if (isset($prop['commitOnSelChange']) AND ($prop['commitOnSelChange'] == 'true')) { + $ff += 1 << 26; + } + $opt['ff'] = $ff; + // defaultValue: The default value of a field - that is, the value that the field is set to when the form is reset. + if (isset($prop['defaultValue'])) { + $opt['dv'] = $prop['defaultValue']; + } + $f = 4; // default value for annotation flags + // readonly: The read-only characteristic of a field. If a field is read-only, the user can see the field but cannot change it. + if (isset($prop['readonly']) AND ($prop['readonly'] == 'true')) { + $f += 1 << 6; + } + // display: Controls whether the field is hidden or visible on screen and in print. + if (isset($prop['display'])) { + if ($prop['display'] == 'display.visible') { + // + } elseif ($prop['display'] == 'display.hidden') { + $f += 1 << 1; + } elseif ($prop['display'] == 'display.noPrint') { + $f -= 1 << 2; + } elseif ($prop['display'] == 'display.noView') { + $f += 1 << 5; + } + } + $opt['f'] = $f; + // currentValueIndices: Reads and writes single or multiple values of a list box or combo box. + if (isset($prop['currentValueIndices']) AND is_array($prop['currentValueIndices'])) { + $opt['i'] = $prop['currentValueIndices']; + } + // value: The value of the field data that the user has entered. + if (isset($prop['value'])) { + if (is_array($prop['value'])) { + $opt['opt'] = array(); + foreach ($prop['value'] AS $key => $optval) { + // exportValues: An array of strings representing the export values for the field. + if (isset($prop['exportValues'][$key])) { + $opt['opt'][$key] = array($prop['exportValues'][$key], $prop['value'][$key]); + } else { + $opt['opt'][$key] = $prop['value'][$key]; + } + } + } else { + $opt['v'] = $prop['value']; + } + } + // richValue: This property specifies the text contents and formatting of a rich text field. + if (isset($prop['richValue'])) { + $opt['rv'] = $prop['richValue']; + } + // submitName: If nonempty, used during form submission instead of name. Only applicable if submitting in HTML format (that is, URL-encoded). + if (isset($prop['submitName'])) { + $opt['tm'] = $prop['submitName']; + } + // name: Fully qualified field name. + if (isset($prop['name'])) { + $opt['t'] = $prop['name']; + } + // userName: The user name (short description string) of the field. + if (isset($prop['userName'])) { + $opt['tu'] = $prop['userName']; + } + // highlight: Defines how a button reacts when a user clicks it. + if (isset($prop['highlight'])) { + switch ($prop['highlight']) { + case 'none': + case 'highlight.n': { + $opt['h'] = 'N'; + break; + } + case 'invert': + case 'highlight.i': { + $opt['h'] = 'i'; + break; + } + case 'push': + case 'highlight.p': { + $opt['h'] = 'P'; + break; + } + case 'outline': + case 'highlight.o': { + $opt['h'] = 'O'; + break; + } + } + } + // Unsupported options: + // - calcOrderIndex: Changes the calculation order of fields in the document. + // - delay: Delays the redrawing of a field's appearance. + // - defaultStyle: This property defines the default style attributes for the form field. + // - style: Allows the user to set the glyph style of a check box or radio button. + // - textColor, textFont, textSize + return $opt; + } + + /** + * Format the page numbers. + * This method can be overridden for custom formats. + * @param int $num page number + * @return string + * @since 4.2.005 (2008-11-06) + * @public static + */ + public static function formatPageNumber($num) { + return number_format((float)$num, 0, '', '.'); + } + + /** + * Format the page numbers on the Table Of Content. + * This method can be overridden for custom formats. + * @param int $num page number + * @return string + * @since 4.5.001 (2009-01-04) + * @see addTOC(), addHTMLTOC() + * @public static + */ + public static function formatTOCPageNumber($num) { + return number_format((float)$num, 0, '', '.'); + } + + /** + * Extracts the CSS properties from a CSS string. + * @param string $cssdata string containing CSS definitions. + * @return array An array where the keys are the CSS selectors and the values are the CSS properties. + * @author Nicola Asuni + * @since 5.1.000 (2010-05-25) + * @public static + */ + public static function extractCSSproperties($cssdata) { + if (empty($cssdata)) { + return array(); + } + // remove comments + $cssdata = preg_replace('/\/\*[^\*]*\*\//', '', $cssdata); + // remove newlines and multiple spaces + $cssdata = preg_replace('/[\s]+/', ' ', $cssdata); + // remove some spaces + $cssdata = preg_replace('/[\s]*([;:\{\}]{1})[\s]*/', '\\1', $cssdata); + // remove empty blocks + $cssdata = preg_replace('/([^\}\{]+)\{\}/', '', $cssdata); + // replace media type parenthesis + $cssdata = preg_replace('/@media[\s]+([^\{]*)\{/i', '@media \\1搂', $cssdata); + $cssdata = preg_replace('/\}\}/si', '}搂', $cssdata); + // trim string + $cssdata = trim($cssdata); + // find media blocks (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv) + $cssblocks = array(); + $matches = array(); + if (preg_match_all('/@media[\s]+([^\搂]*)搂([^搂]*)搂/i', $cssdata, $matches) > 0) { + foreach ($matches[1] as $key => $type) { + $cssblocks[$type] = $matches[2][$key]; + } + // remove media blocks + $cssdata = preg_replace('/@media[\s]+([^\搂]*)搂([^搂]*)搂/i', '', $cssdata); + } + // keep 'all' and 'print' media, other media types are discarded + if (isset($cssblocks['all']) AND !empty($cssblocks['all'])) { + $cssdata .= $cssblocks['all']; + } + if (isset($cssblocks['print']) AND !empty($cssblocks['print'])) { + $cssdata .= $cssblocks['print']; + } + // reset css blocks array + $cssblocks = array(); + $matches = array(); + // explode css data string into array + if (substr($cssdata, -1) == '}') { + // remove last parethesis + $cssdata = substr($cssdata, 0, -1); + } + $matches = explode('}', $cssdata); + foreach ($matches as $key => $block) { + // index 0 contains the CSS selector, index 1 contains CSS properties + $cssblocks[$key] = explode('{', $block); + if (!isset($cssblocks[$key][1])) { + // remove empty definitions + unset($cssblocks[$key]); + } + } + // split groups of selectors (comma-separated list of selectors) + foreach ($cssblocks as $key => $block) { + if (strpos($block[0], ',') > 0) { + $selectors = explode(',', $block[0]); + foreach ($selectors as $sel) { + $cssblocks[] = array(0 => trim($sel), 1 => $block[1]); + } + unset($cssblocks[$key]); + } + } + // covert array to selector => properties + $cssdata = array(); + foreach ($cssblocks as $block) { + $selector = $block[0]; + // calculate selector's specificity + $matches = array(); + $a = 0; // the declaration is not from is a 'style' attribute + $b = intval(preg_match_all('/[\#]/', $selector, $matches)); // number of ID attributes + $c = intval(preg_match_all('/[\[\.]/', $selector, $matches)); // number of other attributes + $c += intval(preg_match_all('/[\:]link|visited|hover|active|focus|target|lang|enabled|disabled|checked|indeterminate|root|nth|first|last|only|empty|contains|not/i', $selector, $matches)); // number of pseudo-classes + $d = intval(preg_match_all('/[\>\+\~\s]{1}[a-zA-Z0-9]+/', ' '.$selector, $matches)); // number of element names + $d += intval(preg_match_all('/[\:][\:]/', $selector, $matches)); // number of pseudo-elements + $specificity = $a.$b.$c.$d; + // add specificity to the beginning of the selector + $cssdata[$specificity.' '.$selector] = $block[1]; + } + // sort selectors alphabetically to account for specificity + ksort($cssdata, SORT_STRING); + // return array + return $cssdata; + } + + /** + * Cleanup HTML code (requires HTML Tidy library). + * @param string $html htmlcode to fix + * @param string $default_css CSS commands to add + * @param array|null $tagvs parameters for setHtmlVSpace method + * @param array|null $tidy_options options for tidy_parse_string function + * @param array $tagvspaces Array of vertical spaces for tags. + * @return string XHTML code cleaned up + * @author Nicola Asuni + * @since 5.9.017 (2010-11-16) + * @see setHtmlVSpace() + * @public static + */ + public static function fixHTMLCode($html, $default_css, $tagvs, $tidy_options, &$tagvspaces) { + // configure parameters for HTML Tidy + if (TCPDF_STATIC::empty_string($tidy_options)) { + $tidy_options = array ( + 'clean' => 1, + 'drop-empty-paras' => 0, + 'drop-proprietary-attributes' => 1, + 'fix-backslash' => 1, + 'hide-comments' => 1, + 'join-styles' => 1, + 'lower-literals' => 1, + 'merge-divs' => 1, + 'merge-spans' => 1, + 'output-xhtml' => 1, + 'word-2000' => 1, + 'wrap' => 0, + 'output-bom' => 0, + //'char-encoding' => 'utf8', + //'input-encoding' => 'utf8', + //'output-encoding' => 'utf8' + ); + } + // clean up the HTML code + $tidy = tidy_parse_string($html, $tidy_options); + // fix the HTML + $tidy->cleanRepair(); + // get the CSS part + $tidy_head = tidy_get_head($tidy); + $css = $tidy_head->value; + $css = preg_replace('/]+)>/ims', ''; + // get the body part + $tidy_body = tidy_get_body($tidy); + $html = $tidy_body->value; + // fix some self-closing tags + $html = str_replace('
      ', '
      ', $html); + // remove some empty tag blocks + $html = preg_replace('/]*)><\/div>/', '', $html); + $html = preg_replace('/]*)><\/p>/', '', $html); + if (!TCPDF_STATIC::empty_string($tagvs)) { + // set vertical space for some XHTML tags + $tagvspaces = $tagvs; + } + // return the cleaned XHTML code + CSS + return $css.$html; + } + + /** + * Returns true if the CSS selector is valid for the selected HTML tag + * @param array $dom array of HTML tags and properties + * @param int $key key of the current HTML tag + * @param string $selector CSS selector string + * @return true if the selector is valid, false otherwise + * @since 5.1.000 (2010-05-25) + * @public static + */ + public static function isValidCSSSelectorForTag($dom, $key, $selector) { + $valid = false; // value to be returned + $tag = $dom[$key]['value']; + $class = array(); + if (isset($dom[$key]['attribute']['class']) AND !empty($dom[$key]['attribute']['class'])) { + $class = explode(' ', strtolower($dom[$key]['attribute']['class'])); + } + $id = ''; + if (isset($dom[$key]['attribute']['id']) AND !empty($dom[$key]['attribute']['id'])) { + $id = strtolower($dom[$key]['attribute']['id']); + } + $selector = preg_replace('/([\>\+\~\s]{1})([\.]{1})([^\>\+\~\s]*)/si', '\\1*.\\3', $selector); + $matches = array(); + if (preg_match_all('/([\>\+\~\s]{1})([a-zA-Z0-9\*]+)([^\>\+\~\s]*)/si', $selector, $matches, PREG_PATTERN_ORDER | PREG_OFFSET_CAPTURE) > 0) { + $parentop = array_pop($matches[1]); + $operator = $parentop[0]; + $offset = $parentop[1]; + $lasttag = array_pop($matches[2]); + $lasttag = strtolower(trim($lasttag[0])); + if (($lasttag == '*') OR ($lasttag == $tag)) { + // the last element on selector is our tag or 'any tag' + $attrib = array_pop($matches[3]); + $attrib = strtolower(trim($attrib[0])); + if (!empty($attrib)) { + // check if matches class, id, attribute, pseudo-class or pseudo-element + switch ($attrib[0]) { + case '.': { // class + if (in_array(substr($attrib, 1), $class)) { + $valid = true; + } + break; + } + case '#': { // ID + if (substr($attrib, 1) == $id) { + $valid = true; + } + break; + } + case '[': { // attribute + $attrmatch = array(); + if (preg_match('/\[([a-zA-Z0-9]*)[\s]*([\~\^\$\*\|\=]*)[\s]*["]?([^"\]]*)["]?\]/i', $attrib, $attrmatch) > 0) { + $att = strtolower($attrmatch[1]); + $val = $attrmatch[3]; + if (isset($dom[$key]['attribute'][$att])) { + switch ($attrmatch[2]) { + case '=': { + if ($dom[$key]['attribute'][$att] == $val) { + $valid = true; + } + break; + } + case '~=': { + if (in_array($val, explode(' ', $dom[$key]['attribute'][$att]))) { + $valid = true; + } + break; + } + case '^=': { + if ($val == substr($dom[$key]['attribute'][$att], 0, strlen($val))) { + $valid = true; + } + break; + } + case '$=': { + if ($val == substr($dom[$key]['attribute'][$att], -strlen($val))) { + $valid = true; + } + break; + } + case '*=': { + if (strpos($dom[$key]['attribute'][$att], $val) !== false) { + $valid = true; + } + break; + } + case '|=': { + if ($dom[$key]['attribute'][$att] == $val) { + $valid = true; + } elseif (preg_match('/'.$val.'[\-]{1}/i', $dom[$key]['attribute'][$att]) > 0) { + $valid = true; + } + break; + } + default: { + $valid = true; + } + } + } + } + break; + } + case ':': { // pseudo-class or pseudo-element + if ($attrib[1] == ':') { // pseudo-element + // pseudo-elements are not supported! + // (::first-line, ::first-letter, ::before, ::after) + } else { // pseudo-class + // pseudo-classes are not supported! + // (:root, :nth-child(n), :nth-last-child(n), :nth-of-type(n), :nth-last-of-type(n), :first-child, :last-child, :first-of-type, :last-of-type, :only-child, :only-of-type, :empty, :link, :visited, :active, :hover, :focus, :target, :lang(fr), :enabled, :disabled, :checked) + } + break; + } + } // end of switch + } else { + $valid = true; + } + if ($valid AND ($offset > 0)) { + $valid = false; + // check remaining selector part + $selector = substr($selector, 0, $offset); + switch ($operator) { + case ' ': { // descendant of an element + while ($dom[$key]['parent'] > 0) { + if (self::isValidCSSSelectorForTag($dom, $dom[$key]['parent'], $selector)) { + $valid = true; + break; + } else { + $key = $dom[$key]['parent']; + } + } + break; + } + case '>': { // child of an element + $valid = self::isValidCSSSelectorForTag($dom, $dom[$key]['parent'], $selector); + break; + } + case '+': { // immediately preceded by an element + for ($i = ($key - 1); $i > $dom[$key]['parent']; --$i) { + if ($dom[$i]['tag'] AND $dom[$i]['opening']) { + $valid = self::isValidCSSSelectorForTag($dom, $i, $selector); + break; + } + } + break; + } + case '~': { // preceded by an element + for ($i = ($key - 1); $i > $dom[$key]['parent']; --$i) { + if ($dom[$i]['tag'] AND $dom[$i]['opening']) { + if (self::isValidCSSSelectorForTag($dom, $i, $selector)) { + break; + } + } + } + break; + } + } + } + } + } + return $valid; + } + + /** + * Returns the styles array that apply for the selected HTML tag. + * @param array $dom array of HTML tags and properties + * @param int $key key of the current HTML tag + * @param array $css array of CSS properties + * @return array containing CSS properties + * @since 5.1.000 (2010-05-25) + * @public static + */ + public static function getCSSdataArray($dom, $key, $css) { + $cssarray = array(); // style to be returned + // get parent CSS selectors + $selectors = array(); + if (isset($dom[($dom[$key]['parent'])]['csssel'])) { + $selectors = $dom[($dom[$key]['parent'])]['csssel']; + } + // get all styles that apply + foreach($css as $selector => $style) { + $pos = strpos($selector, ' '); + // get specificity + $specificity = substr($selector, 0, $pos); + // remove specificity + $selector = substr($selector, $pos); + // check if this selector apply to current tag + if (self::isValidCSSSelectorForTag($dom, $key, $selector)) { + if (!in_array($selector, $selectors)) { + // add style if not already added on parent selector + $cssarray[] = array('k' => $selector, 's' => $specificity, 'c' => $style); + $selectors[] = $selector; + } + } + } + if (isset($dom[$key]['attribute']['style'])) { + // attach inline style (latest properties have high priority) + $cssarray[] = array('k' => '', 's' => '1000', 'c' => $dom[$key]['attribute']['style']); + } + // order the css array to account for specificity + $cssordered = array(); + foreach ($cssarray as $key => $val) { + $skey = sprintf('%04d', $key); + $cssordered[$val['s'].'_'.$skey] = $val; + } + // sort selectors alphabetically to account for specificity + ksort($cssordered, SORT_STRING); + return array($selectors, $cssordered); + } + + /** + * Compact CSS data array into single string. + * @param array $css array of CSS properties + * @return string containing merged CSS properties + * @since 5.9.070 (2011-04-19) + * @public static + */ + public static function getTagStyleFromCSSarray($css) { + $tagstyle = ''; // value to be returned + foreach ($css as $style) { + // split single css commands + $csscmds = explode(';', $style['c']); + foreach ($csscmds as $cmd) { + if (!empty($cmd)) { + $pos = strpos($cmd, ':'); + if ($pos !== false) { + $cmd = substr($cmd, 0, ($pos + 1)); + if (strpos($tagstyle, $cmd) !== false) { + // remove duplicate commands (last commands have high priority) + $tagstyle = preg_replace('/'.$cmd.'[^;]+/i', '', $tagstyle); + } + } + } + } + $tagstyle .= ';'.$style['c']; + } + // remove multiple semicolons + $tagstyle = preg_replace('/[;]+/', ';', $tagstyle); + return $tagstyle; + } + + /** + * Returns the Roman representation of an integer number + * @param int $number number to convert + * @return string roman representation of the specified number + * @since 4.4.004 (2008-12-10) + * @public static + */ + public static function intToRoman($number) { + $roman = ''; + if ($number >= 4000) { + // do not represent numbers above 4000 in Roman numerals + return strval($number); + } + while ($number >= 1000) { + $roman .= 'M'; + $number -= 1000; + } + while ($number >= 900) { + $roman .= 'CM'; + $number -= 900; + } + while ($number >= 500) { + $roman .= 'D'; + $number -= 500; + } + while ($number >= 400) { + $roman .= 'CD'; + $number -= 400; + } + while ($number >= 100) { + $roman .= 'C'; + $number -= 100; + } + while ($number >= 90) { + $roman .= 'XC'; + $number -= 90; + } + while ($number >= 50) { + $roman .= 'L'; + $number -= 50; + } + while ($number >= 40) { + $roman .= 'XL'; + $number -= 40; + } + while ($number >= 10) { + $roman .= 'X'; + $number -= 10; + } + while ($number >= 9) { + $roman .= 'IX'; + $number -= 9; + } + while ($number >= 5) { + $roman .= 'V'; + $number -= 5; + } + while ($number >= 4) { + $roman .= 'IV'; + $number -= 4; + } + while ($number >= 1) { + $roman .= 'I'; + --$number; + } + return $roman; + } + + /** + * Find position of last occurrence of a substring in a string + * @param string $haystack The string to search in. + * @param string $needle substring to search. + * @param int $offset May be specified to begin searching an arbitrary number of characters into the string. + * @return int|false Returns the position where the needle exists. Returns FALSE if the needle was not found. + * @since 4.8.038 (2010-03-13) + * @public static + */ + public static function revstrpos($haystack, $needle, $offset = 0) { + $length = strlen($haystack); + $offset = ($offset > 0)?($length - $offset):abs($offset); + $pos = strpos(strrev($haystack), strrev($needle), $offset); + return ($pos === false)?false:($length - $pos - strlen($needle)); + } + + /** + * Returns an array of hyphenation patterns. + * @param string $file TEX file containing hypenation patterns. TEX patterns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ + * @return array of hyphenation patterns + * @author Nicola Asuni + * @since 4.9.012 (2010-04-12) + * @public static + */ + public static function getHyphenPatternsFromTEX($file) { + // TEX patterns are available at: + // http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ + $data = file_get_contents($file); + $patterns = array(); + // remove comments + $data = preg_replace('/\%[^\n]*/', '', $data); + // extract the patterns part + preg_match('/\\\\patterns\{([^\}]*)\}/i', $data, $matches); + $data = trim(substr($matches[0], 10, -1)); + // extract each pattern + $patterns_array = preg_split('/[\s]+/', $data); + // create new language array of patterns + $patterns = array(); + foreach($patterns_array as $val) { + if (!TCPDF_STATIC::empty_string($val)) { + $val = trim($val); + $val = str_replace('\'', '\\\'', $val); + $key = preg_replace('/[0-9]+/', '', $val); + $patterns[$key] = $val; + } + } + return $patterns; + } + + /** + * Get the Path-Painting Operators. + * @param string $style Style of rendering. Possible values are: + *
        + *
      • S or D: Stroke the path.
      • + *
      • s or d: Close and stroke the path.
      • + *
      • f or F: Fill the path, using the nonzero winding number rule to determine the region to fill.
      • + *
      • f* or F*: Fill the path, using the even-odd rule to determine the region to fill.
      • + *
      • B or FD or DF: Fill and then stroke the path, using the nonzero winding number rule to determine the region to fill.
      • + *
      • B* or F*D or DF*: Fill and then stroke the path, using the even-odd rule to determine the region to fill.
      • + *
      • b or fd or df: Close, fill, and then stroke the path, using the nonzero winding number rule to determine the region to fill.
      • + *
      • b or f*d or df*: Close, fill, and then stroke the path, using the even-odd rule to determine the region to fill.
      • + *
      • CNZ: Clipping mode using the even-odd rule to determine which regions lie inside the clipping path.
      • + *
      • CEO: Clipping mode using the nonzero winding number rule to determine which regions lie inside the clipping path
      • + *
      • n: End the path object without filling or stroking it.
      • + *
      + * @param string $default default style + * @return string + * @author Nicola Asuni + * @since 5.0.000 (2010-04-30) + * @public static + */ + public static function getPathPaintOperator($style, $default='S') { + $op = ''; + switch($style) { + case 'S': + case 'D': { + $op = 'S'; + break; + } + case 's': + case 'd': { + $op = 's'; + break; + } + case 'f': + case 'F': { + $op = 'f'; + break; + } + case 'f*': + case 'F*': { + $op = 'f*'; + break; + } + case 'B': + case 'FD': + case 'DF': { + $op = 'B'; + break; + } + case 'B*': + case 'F*D': + case 'DF*': { + $op = 'B*'; + break; + } + case 'b': + case 'fd': + case 'df': { + $op = 'b'; + break; + } + case 'b*': + case 'f*d': + case 'df*': { + $op = 'b*'; + break; + } + case 'CNZ': { + $op = 'W n'; + break; + } + case 'CEO': { + $op = 'W* n'; + break; + } + case 'n': { + $op = 'n'; + break; + } + default: { + if (!empty($default)) { + $op = self::getPathPaintOperator($default, ''); + } else { + $op = ''; + } + } + } + return $op; + } + + /** + * Get the product of two SVG tranformation matrices + * @param array $ta first SVG tranformation matrix + * @param array $tb second SVG tranformation matrix + * @return array transformation array + * @author Nicola Asuni + * @since 5.0.000 (2010-05-02) + * @public static + */ + public static function getTransformationMatrixProduct($ta, $tb) { + $tm = array(); + $tm[0] = ($ta[0] * $tb[0]) + ($ta[2] * $tb[1]); + $tm[1] = ($ta[1] * $tb[0]) + ($ta[3] * $tb[1]); + $tm[2] = ($ta[0] * $tb[2]) + ($ta[2] * $tb[3]); + $tm[3] = ($ta[1] * $tb[2]) + ($ta[3] * $tb[3]); + $tm[4] = ($ta[0] * $tb[4]) + ($ta[2] * $tb[5]) + $ta[4]; + $tm[5] = ($ta[1] * $tb[4]) + ($ta[3] * $tb[5]) + $ta[5]; + return $tm; + } + + /** + * Get the tranformation matrix from SVG transform attribute + * @param string $attribute transformation + * @return array of transformations + * @author Nicola Asuni + * @since 5.0.000 (2010-05-02) + * @public static + */ + public static function getSVGTransformMatrix($attribute) { + // identity matrix + $tm = array(1, 0, 0, 1, 0, 0); + $transform = array(); + if (preg_match_all('/(matrix|translate|scale|rotate|skewX|skewY)[\s]*\(([^\)]+)\)/si', $attribute, $transform, PREG_SET_ORDER) > 0) { + foreach ($transform as $key => $data) { + if (!empty($data[2])) { + $a = 1; + $b = 0; + $c = 0; + $d = 1; + $e = 0; + $f = 0; + $regs = array(); + switch ($data[1]) { + case 'matrix': { + if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { + $a = $regs[1]; + $b = $regs[2]; + $c = $regs[3]; + $d = $regs[4]; + $e = $regs[5]; + $f = $regs[6]; + } + break; + } + case 'translate': { + if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { + $e = $regs[1]; + $f = $regs[2]; + } elseif (preg_match('/([a-z0-9\-\.]+)/si', $data[2], $regs)) { + $e = $regs[1]; + } + break; + } + case 'scale': { + if (preg_match('/([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { + $a = $regs[1]; + $d = $regs[2]; + } elseif (preg_match('/([a-z0-9\-\.]+)/si', $data[2], $regs)) { + $a = $regs[1]; + $d = $a; + } + break; + } + case 'rotate': { + if (preg_match('/([0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)[\,\s]+([a-z0-9\-\.]+)/si', $data[2], $regs)) { + $ang = deg2rad($regs[1]); + $x = $regs[2]; + $y = $regs[3]; + $a = cos($ang); + $b = sin($ang); + $c = -$b; + $d = $a; + $e = ($x * (1 - $a)) - ($y * $c); + $f = ($y * (1 - $d)) - ($x * $b); + } elseif (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { + $ang = deg2rad($regs[1]); + $a = cos($ang); + $b = sin($ang); + $c = -$b; + $d = $a; + $e = 0; + $f = 0; + } + break; + } + case 'skewX': { + if (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { + $c = tan(deg2rad($regs[1])); + } + break; + } + case 'skewY': { + if (preg_match('/([0-9\-\.]+)/si', $data[2], $regs)) { + $b = tan(deg2rad($regs[1])); + } + break; + } + } + $tm = self::getTransformationMatrixProduct($tm, array($a, $b, $c, $d, $e, $f)); + } + } + } + return $tm; + } + + /** + * Returns the angle in radiants between two vectors + * @param int $x1 X coordinate of first vector point + * @param int $y1 Y coordinate of first vector point + * @param int $x2 X coordinate of second vector point + * @param int $y2 Y coordinate of second vector point + * @author Nicola Asuni + * @since 5.0.000 (2010-05-04) + * @public static + */ + public static function getVectorsAngle($x1, $y1, $x2, $y2) { + $dprod = ($x1 * $x2) + ($y1 * $y2); + $dist1 = sqrt(($x1 * $x1) + ($y1 * $y1)); + $dist2 = sqrt(($x2 * $x2) + ($y2 * $y2)); + $angle = acos($dprod / ($dist1 * $dist2)); + if (is_nan($angle)) { + $angle = M_PI; + } + if ((($x1 * $y2) - ($x2 * $y1)) < 0) { + $angle *= -1; + } + return $angle; + } + + /** + * Split string by a regular expression. + * This is a wrapper for the preg_split function to avoid the bug: https://bugs.php.net/bug.php?id=45850 + * @param string $pattern The regular expression pattern to search for without the modifiers, as a string. + * @param string $modifiers The modifiers part of the pattern, + * @param string $subject The input string. + * @param int $limit If specified, then only substrings up to limit are returned with the rest of the string being placed in the last substring. A limit of -1, 0 or NULL means "no limit" and, as is standard across PHP, you can use NULL to skip to the flags parameter. + * @param int $flags The flags as specified on the preg_split PHP function. + * @return array Returns an array containing substrings of subject split along boundaries matched by pattern.modifier + * @author Nicola Asuni + * @since 6.0.023 + * @public static + */ + public static function pregSplit($pattern, $modifiers, $subject, $limit=NULL, $flags=NULL) { + // PHP 8.1 deprecates nulls for $limit and $flags + $limit = $limit === null ? -1 : $limit; + $flags = $flags === null ? 0 : $flags; + // the bug only happens on PHP 5.2 when using the u modifier + if ((strpos($modifiers, 'u') === FALSE) OR (count(preg_split('//u', "\n\t", -1, PREG_SPLIT_NO_EMPTY)) == 2)) { + $ret = preg_split($pattern.$modifiers, $subject, $limit, $flags); + if ($ret === false) { + return array(); + } + return $ret; + } + // preg_split is bugged - try alternative solution + $ret = array(); + while (($nl = strpos($subject, "\n")) !== FALSE) { + $ret = array_merge($ret, preg_split($pattern.$modifiers, substr($subject, 0, $nl), $limit, $flags)); + $ret[] = "\n"; + $subject = substr($subject, ($nl + 1)); + } + if (strlen($subject) > 0) { + $ret = array_merge($ret, preg_split($pattern.$modifiers, $subject, $limit, $flags)); + } + return $ret; + } + + /** + * Wrapper to use fopen only with local files + * @param string $filename Name of the file to open + * @param string $mode + * @return resource|false Returns a file pointer resource on success, or FALSE on error. + * @public static + */ + public static function fopenLocal($filename, $mode) { + if (strpos($filename, '://') === false) { + $filename = 'file://'.$filename; + } elseif (stream_is_local($filename) !== true) { + return false; + } + return fopen($filename, $mode); + } + + /** + * Check if the URL exist. + * @param string $url URL to check. + * @return bool Returns TRUE if the URL exists; FALSE otherwise. + * @public static + * @since 6.2.25 + */ + public static function url_exists($url) { + $crs = curl_init(); + // encode query params in URL to get right response form the server + $url = self::encodeUrlQuery($url); + curl_setopt($crs, CURLOPT_URL, $url); + curl_setopt($crs, CURLOPT_NOBODY, true); + curl_setopt($crs, CURLOPT_FAILONERROR, true); + if ((ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) { + curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true); + } + curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5); + curl_setopt($crs, CURLOPT_TIMEOUT, 30); + curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file'); + curl_setopt($crs, CURLOPT_MAXREDIRS, 5); + if (defined('CURLOPT_PROTOCOLS')) { + curl_setopt($crs, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP | CURLPROTO_FTP | CURLPROTO_FTPS); + } + curl_exec($crs); + $code = curl_getinfo($crs, CURLINFO_HTTP_CODE); + curl_close($crs); + return ($code == 200); + } + + /** + * Encode query params in URL + * + * @param string $url + * @return string + * @since 6.3.3 (2019-11-01) + * @public static + */ + public static function encodeUrlQuery($url) { + $urlData = parse_url($url); + if (isset($urlData['query']) && $urlData['query']) { + $urlQueryData = array(); + parse_str(urldecode($urlData['query']), $urlQueryData); + $port = isset($urlData['port']) ? ':'.$urlData['port'] : ''; + $updatedUrl = $urlData['scheme'].'://'.$urlData['host'].$port.$urlData['path'].'?'.http_build_query($urlQueryData); + } else { + $updatedUrl = $url; + } + return $updatedUrl; + } + + /** + * Wrapper for file_exists. + * Checks whether a file or directory exists. + * Only allows some protocols and local files. + * @param string $filename Path to the file or directory. + * @return bool Returns TRUE if the file or directory specified by filename exists; FALSE otherwise. + * @public static + */ + public static function file_exists($filename) { + if (preg_match('|^https?://|', $filename) == 1) { + return self::url_exists($filename); + } + if (strpos($filename, '://')) { + return false; // only support http and https wrappers for security reasons + } + return @file_exists($filename); + } + + /** + * Reads entire file into a string. + * The file can be also an URL. + * @param string $file Name of the file or URL to read. + * @return string|false The function returns the read data or FALSE on failure. + * @author Nicola Asuni + * @since 6.0.025 + * @public static + */ + public static function fileGetContents($file) { + $alt = array($file); + // + if ((strlen($file) > 1) + && ($file[0] === '/') + && ($file[1] !== '/') + && !empty($_SERVER['DOCUMENT_ROOT']) + && ($_SERVER['DOCUMENT_ROOT'] !== '/') + ) { + $findroot = strpos($file, $_SERVER['DOCUMENT_ROOT']); + if (($findroot === false) || ($findroot > 1)) { + $alt[] = htmlspecialchars_decode(urldecode($_SERVER['DOCUMENT_ROOT'].$file)); + } + } + // + $protocol = 'http'; + if (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) { + $protocol .= 's'; + } + // + $url = $file; + if (preg_match('%^//%', $url) && !empty($_SERVER['HTTP_HOST'])) { + $url = $protocol.':'.str_replace(' ', '%20', $url); + } + $url = htmlspecialchars_decode($url); + $alt[] = $url; + // + if (preg_match('%^(https?)://%', $url) + && empty($_SERVER['HTTP_HOST']) + && empty($_SERVER['DOCUMENT_ROOT']) + ) { + $urldata = parse_url($url); + if (empty($urldata['query'])) { + $host = $protocol.'://'.$_SERVER['HTTP_HOST']; + if (strpos($url, $host) === 0) { + // convert URL to full server path + $tmp = str_replace($host, $_SERVER['DOCUMENT_ROOT'], $url); + $alt[] = htmlspecialchars_decode(urldecode($tmp)); + } + } + } + // + if (isset($_SERVER['SCRIPT_URI']) + && !preg_match('%^(https?|ftp)://%', $file) + && !preg_match('%^//%', $file) + ) { + $urldata = @parse_url($_SERVER['SCRIPT_URI']); + $alt[] = $urldata['scheme'].'://'.$urldata['host'].(($file[0] == '/') ? '' : '/').$file; + } + // + $alt = array_unique($alt); + foreach ($alt as $path) { + if (!self::file_exists($path)) { + continue; + } + $ret = @file_get_contents($path); + if ( $ret != false ) { + return $ret; + } + // try to use CURL for URLs + if (!ini_get('allow_url_fopen') + && function_exists('curl_init') + && preg_match('%^(https?|ftp)://%', $path) + ) { + // try to get remote file data using cURL + $crs = curl_init(); + curl_setopt($crs, CURLOPT_URL, $path); + curl_setopt($crs, CURLOPT_BINARYTRANSFER, true); + curl_setopt($crs, CURLOPT_FAILONERROR, true); + curl_setopt($crs, CURLOPT_RETURNTRANSFER, true); + if ((ini_get('open_basedir') == '') && (!ini_get('safe_mode'))) { + curl_setopt($crs, CURLOPT_FOLLOWLOCATION, true); + } + curl_setopt($crs, CURLOPT_CONNECTTIMEOUT, 5); + curl_setopt($crs, CURLOPT_TIMEOUT, 30); + curl_setopt($crs, CURLOPT_SSL_VERIFYPEER, false); + curl_setopt($crs, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($crs, CURLOPT_USERAGENT, 'tc-lib-file'); + curl_setopt($crs, CURLOPT_MAXREDIRS, 5); + if (defined('CURLOPT_PROTOCOLS')) { + curl_setopt($crs, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS | CURLPROTO_HTTP | CURLPROTO_FTP | CURLPROTO_FTPS); + } + $ret = curl_exec($crs); + curl_close($crs); + if ($ret !== false) { + return $ret; + } + } + } + return false; + } + + /** + * Get ULONG from string (Big Endian 32-bit unsigned integer). + * @param string $str string from where to extract value + * @param int $offset point from where to read the data + * @return int 32 bit value + * @author Nicola Asuni + * @since 5.2.000 (2010-06-02) + * @public static + */ + public static function _getULONG($str, $offset) { + $v = unpack('Ni', substr($str, $offset, 4)); + return $v['i']; + } + + /** + * Get USHORT from string (Big Endian 16-bit unsigned integer). + * @param string $str string from where to extract value + * @param int $offset point from where to read the data + * @return int 16 bit value + * @author Nicola Asuni + * @since 5.2.000 (2010-06-02) + * @public static + */ + public static function _getUSHORT($str, $offset) { + $v = unpack('ni', substr($str, $offset, 2)); + return $v['i']; + } + + /** + * Get SHORT from string (Big Endian 16-bit signed integer). + * @param string $str String from where to extract value. + * @param int $offset Point from where to read the data. + * @return int 16 bit value + * @author Nicola Asuni + * @since 5.2.000 (2010-06-02) + * @public static + */ + public static function _getSHORT($str, $offset) { + $v = unpack('si', substr($str, $offset, 2)); + return $v['i']; + } + + /** + * Get FWORD from string (Big Endian 16-bit signed integer). + * @param string $str String from where to extract value. + * @param int $offset Point from where to read the data. + * @return int 16 bit value + * @author Nicola Asuni + * @since 5.9.123 (2011-09-30) + * @public static + */ + public static function _getFWORD($str, $offset) { + $v = self::_getUSHORT($str, $offset); + if ($v > 0x7fff) { + $v -= 0x10000; + } + return $v; + } + + /** + * Get UFWORD from string (Big Endian 16-bit unsigned integer). + * @param string $str string from where to extract value + * @param int $offset point from where to read the data + * @return int 16 bit value + * @author Nicola Asuni + * @since 5.9.123 (2011-09-30) + * @public static + */ + public static function _getUFWORD($str, $offset) { + $v = self::_getUSHORT($str, $offset); + return $v; + } + + /** + * Get FIXED from string (32-bit signed fixed-point number (16.16). + * @param string $str string from where to extract value + * @param int $offset point from where to read the data + * @return int 16 bit value + * @author Nicola Asuni + * @since 5.9.123 (2011-09-30) + * @public static + */ + public static function _getFIXED($str, $offset) { + // mantissa + $m = self::_getFWORD($str, $offset); + // fraction + $f = self::_getUSHORT($str, ($offset + 2)); + $v = floatval(''.$m.'.'.$f.''); + return $v; + } + + /** + * Get BYTE from string (8-bit unsigned integer). + * @param string $str String from where to extract value. + * @param int $offset Point from where to read the data. + * @return int 8 bit value + * @author Nicola Asuni + * @since 5.2.000 (2010-06-02) + * @public static + */ + public static function _getBYTE($str, $offset) { + $v = unpack('Ci', substr($str, $offset, 1)); + return $v['i']; + } + /** + * Binary-safe and URL-safe file read. + * Reads up to length bytes from the file pointer referenced by handle. Reading stops as soon as one of the following conditions is met: length bytes have been read; EOF (end of file) is reached. + * @param resource $handle + * @param int $length + * @return string|false Returns the read string or FALSE in case of error. + * @author Nicola Asuni + * @since 4.5.027 (2009-03-16) + * @public static + */ + public static function rfread($handle, $length) { + $data = fread($handle, $length); + if ($data === false) { + return false; + } + $rest = ($length - strlen($data)); + if (($rest > 0) && !feof($handle)) { + $data .= self::rfread($handle, $rest); + } + return $data; + } + + /** + * Read a 4-byte (32 bit) integer from file. + * @param resource $f file resource. + * @return int 4-byte integer + * @public static + */ + public static function _freadint($f) { + $a = unpack('Ni', fread($f, 4)); + return $a['i']; + } + + /** + * Array of page formats + * measures are calculated in this way: (inches * 72) or (millimeters * 72 / 25.4) + * @public static + * + * @var array + */ + public static $page_formats = array( + // ISO 216 A Series + 2 SIS 014711 extensions + 'A0' => array( 2383.937, 3370.394), // = ( 841 x 1189 ) mm = ( 33.11 x 46.81 ) in + 'A1' => array( 1683.780, 2383.937), // = ( 594 x 841 ) mm = ( 23.39 x 33.11 ) in + 'A2' => array( 1190.551, 1683.780), // = ( 420 x 594 ) mm = ( 16.54 x 23.39 ) in + 'A3' => array( 841.890, 1190.551), // = ( 297 x 420 ) mm = ( 11.69 x 16.54 ) in + 'A4' => array( 595.276, 841.890), // = ( 210 x 297 ) mm = ( 8.27 x 11.69 ) in + 'A5' => array( 419.528, 595.276), // = ( 148 x 210 ) mm = ( 5.83 x 8.27 ) in + 'A6' => array( 297.638, 419.528), // = ( 105 x 148 ) mm = ( 4.13 x 5.83 ) in + 'A7' => array( 209.764, 297.638), // = ( 74 x 105 ) mm = ( 2.91 x 4.13 ) in + 'A8' => array( 147.402, 209.764), // = ( 52 x 74 ) mm = ( 2.05 x 2.91 ) in + 'A9' => array( 104.882, 147.402), // = ( 37 x 52 ) mm = ( 1.46 x 2.05 ) in + 'A10' => array( 73.701, 104.882), // = ( 26 x 37 ) mm = ( 1.02 x 1.46 ) in + 'A11' => array( 51.024, 73.701), // = ( 18 x 26 ) mm = ( 0.71 x 1.02 ) in + 'A12' => array( 36.850, 51.024), // = ( 13 x 18 ) mm = ( 0.51 x 0.71 ) in + // ISO 216 B Series + 2 SIS 014711 extensions + 'B0' => array( 2834.646, 4008.189), // = ( 1000 x 1414 ) mm = ( 39.37 x 55.67 ) in + 'B1' => array( 2004.094, 2834.646), // = ( 707 x 1000 ) mm = ( 27.83 x 39.37 ) in + 'B2' => array( 1417.323, 2004.094), // = ( 500 x 707 ) mm = ( 19.69 x 27.83 ) in + 'B3' => array( 1000.630, 1417.323), // = ( 353 x 500 ) mm = ( 13.90 x 19.69 ) in + 'B4' => array( 708.661, 1000.630), // = ( 250 x 353 ) mm = ( 9.84 x 13.90 ) in + 'B5' => array( 498.898, 708.661), // = ( 176 x 250 ) mm = ( 6.93 x 9.84 ) in + 'B6' => array( 354.331, 498.898), // = ( 125 x 176 ) mm = ( 4.92 x 6.93 ) in + 'B7' => array( 249.449, 354.331), // = ( 88 x 125 ) mm = ( 3.46 x 4.92 ) in + 'B8' => array( 175.748, 249.449), // = ( 62 x 88 ) mm = ( 2.44 x 3.46 ) in + 'B9' => array( 124.724, 175.748), // = ( 44 x 62 ) mm = ( 1.73 x 2.44 ) in + 'B10' => array( 87.874, 124.724), // = ( 31 x 44 ) mm = ( 1.22 x 1.73 ) in + 'B11' => array( 62.362, 87.874), // = ( 22 x 31 ) mm = ( 0.87 x 1.22 ) in + 'B12' => array( 42.520, 62.362), // = ( 15 x 22 ) mm = ( 0.59 x 0.87 ) in + // ISO 216 C Series + 2 SIS 014711 extensions + 5 EXTENSION + 'C0' => array( 2599.370, 3676.535), // = ( 917 x 1297 ) mm = ( 36.10 x 51.06 ) in + 'C1' => array( 1836.850, 2599.370), // = ( 648 x 917 ) mm = ( 25.51 x 36.10 ) in + 'C2' => array( 1298.268, 1836.850), // = ( 458 x 648 ) mm = ( 18.03 x 25.51 ) in + 'C3' => array( 918.425, 1298.268), // = ( 324 x 458 ) mm = ( 12.76 x 18.03 ) in + 'C4' => array( 649.134, 918.425), // = ( 229 x 324 ) mm = ( 9.02 x 12.76 ) in + 'C5' => array( 459.213, 649.134), // = ( 162 x 229 ) mm = ( 6.38 x 9.02 ) in + 'C6' => array( 323.150, 459.213), // = ( 114 x 162 ) mm = ( 4.49 x 6.38 ) in + 'C7' => array( 229.606, 323.150), // = ( 81 x 114 ) mm = ( 3.19 x 4.49 ) in + 'C8' => array( 161.575, 229.606), // = ( 57 x 81 ) mm = ( 2.24 x 3.19 ) in + 'C9' => array( 113.386, 161.575), // = ( 40 x 57 ) mm = ( 1.57 x 2.24 ) in + 'C10' => array( 79.370, 113.386), // = ( 28 x 40 ) mm = ( 1.10 x 1.57 ) in + 'C11' => array( 56.693, 79.370), // = ( 20 x 28 ) mm = ( 0.79 x 1.10 ) in + 'C12' => array( 39.685, 56.693), // = ( 14 x 20 ) mm = ( 0.55 x 0.79 ) in + 'C76' => array( 229.606, 459.213), // = ( 81 x 162 ) mm = ( 3.19 x 6.38 ) in + 'DL' => array( 311.811, 623.622), // = ( 110 x 220 ) mm = ( 4.33 x 8.66 ) in + 'DLE' => array( 323.150, 637.795), // = ( 114 x 225 ) mm = ( 4.49 x 8.86 ) in + 'DLX' => array( 340.158, 666.142), // = ( 120 x 235 ) mm = ( 4.72 x 9.25 ) in + 'DLP' => array( 280.630, 595.276), // = ( 99 x 210 ) mm = ( 3.90 x 8.27 ) in (1/3 A4) + // SIS 014711 E Series + 'E0' => array( 2491.654, 3517.795), // = ( 879 x 1241 ) mm = ( 34.61 x 48.86 ) in + 'E1' => array( 1757.480, 2491.654), // = ( 620 x 879 ) mm = ( 24.41 x 34.61 ) in + 'E2' => array( 1247.244, 1757.480), // = ( 440 x 620 ) mm = ( 17.32 x 24.41 ) in + 'E3' => array( 878.740, 1247.244), // = ( 310 x 440 ) mm = ( 12.20 x 17.32 ) in + 'E4' => array( 623.622, 878.740), // = ( 220 x 310 ) mm = ( 8.66 x 12.20 ) in + 'E5' => array( 439.370, 623.622), // = ( 155 x 220 ) mm = ( 6.10 x 8.66 ) in + 'E6' => array( 311.811, 439.370), // = ( 110 x 155 ) mm = ( 4.33 x 6.10 ) in + 'E7' => array( 221.102, 311.811), // = ( 78 x 110 ) mm = ( 3.07 x 4.33 ) in + 'E8' => array( 155.906, 221.102), // = ( 55 x 78 ) mm = ( 2.17 x 3.07 ) in + 'E9' => array( 110.551, 155.906), // = ( 39 x 55 ) mm = ( 1.54 x 2.17 ) in + 'E10' => array( 76.535, 110.551), // = ( 27 x 39 ) mm = ( 1.06 x 1.54 ) in + 'E11' => array( 53.858, 76.535), // = ( 19 x 27 ) mm = ( 0.75 x 1.06 ) in + 'E12' => array( 36.850, 53.858), // = ( 13 x 19 ) mm = ( 0.51 x 0.75 ) in + // SIS 014711 G Series + 'G0' => array( 2715.591, 3838.110), // = ( 958 x 1354 ) mm = ( 37.72 x 53.31 ) in + 'G1' => array( 1919.055, 2715.591), // = ( 677 x 958 ) mm = ( 26.65 x 37.72 ) in + 'G2' => array( 1357.795, 1919.055), // = ( 479 x 677 ) mm = ( 18.86 x 26.65 ) in + 'G3' => array( 958.110, 1357.795), // = ( 338 x 479 ) mm = ( 13.31 x 18.86 ) in + 'G4' => array( 677.480, 958.110), // = ( 239 x 338 ) mm = ( 9.41 x 13.31 ) in + 'G5' => array( 479.055, 677.480), // = ( 169 x 239 ) mm = ( 6.65 x 9.41 ) in + 'G6' => array( 337.323, 479.055), // = ( 119 x 169 ) mm = ( 4.69 x 6.65 ) in + 'G7' => array( 238.110, 337.323), // = ( 84 x 119 ) mm = ( 3.31 x 4.69 ) in + 'G8' => array( 167.244, 238.110), // = ( 59 x 84 ) mm = ( 2.32 x 3.31 ) in + 'G9' => array( 119.055, 167.244), // = ( 42 x 59 ) mm = ( 1.65 x 2.32 ) in + 'G10' => array( 82.205, 119.055), // = ( 29 x 42 ) mm = ( 1.14 x 1.65 ) in + 'G11' => array( 59.528, 82.205), // = ( 21 x 29 ) mm = ( 0.83 x 1.14 ) in + 'G12' => array( 39.685, 59.528), // = ( 14 x 21 ) mm = ( 0.55 x 0.83 ) in + // ISO Press + 'RA0' => array( 2437.795, 3458.268), // = ( 860 x 1220 ) mm = ( 33.86 x 48.03 ) in + 'RA1' => array( 1729.134, 2437.795), // = ( 610 x 860 ) mm = ( 24.02 x 33.86 ) in + 'RA2' => array( 1218.898, 1729.134), // = ( 430 x 610 ) mm = ( 16.93 x 24.02 ) in + 'RA3' => array( 864.567, 1218.898), // = ( 305 x 430 ) mm = ( 12.01 x 16.93 ) in + 'RA4' => array( 609.449, 864.567), // = ( 215 x 305 ) mm = ( 8.46 x 12.01 ) in + 'SRA0' => array( 2551.181, 3628.346), // = ( 900 x 1280 ) mm = ( 35.43 x 50.39 ) in + 'SRA1' => array( 1814.173, 2551.181), // = ( 640 x 900 ) mm = ( 25.20 x 35.43 ) in + 'SRA2' => array( 1275.591, 1814.173), // = ( 450 x 640 ) mm = ( 17.72 x 25.20 ) in + 'SRA3' => array( 907.087, 1275.591), // = ( 320 x 450 ) mm = ( 12.60 x 17.72 ) in + 'SRA4' => array( 637.795, 907.087), // = ( 225 x 320 ) mm = ( 8.86 x 12.60 ) in + // German DIN 476 + '4A0' => array( 4767.874, 6740.787), // = ( 1682 x 2378 ) mm = ( 66.22 x 93.62 ) in + '2A0' => array( 3370.394, 4767.874), // = ( 1189 x 1682 ) mm = ( 46.81 x 66.22 ) in + // Variations on the ISO Standard + 'A2_EXTRA' => array( 1261.417, 1754.646), // = ( 445 x 619 ) mm = ( 17.52 x 24.37 ) in + 'A3+' => array( 932.598, 1369.134), // = ( 329 x 483 ) mm = ( 12.95 x 19.02 ) in + 'A3_EXTRA' => array( 912.756, 1261.417), // = ( 322 x 445 ) mm = ( 12.68 x 17.52 ) in + 'A3_SUPER' => array( 864.567, 1440.000), // = ( 305 x 508 ) mm = ( 12.01 x 20.00 ) in + 'SUPER_A3' => array( 864.567, 1380.472), // = ( 305 x 487 ) mm = ( 12.01 x 19.17 ) in + 'A4_EXTRA' => array( 666.142, 912.756), // = ( 235 x 322 ) mm = ( 9.25 x 12.68 ) in + 'A4_SUPER' => array( 649.134, 912.756), // = ( 229 x 322 ) mm = ( 9.02 x 12.68 ) in + 'SUPER_A4' => array( 643.465, 1009.134), // = ( 227 x 356 ) mm = ( 8.94 x 14.02 ) in + 'A4_LONG' => array( 595.276, 986.457), // = ( 210 x 348 ) mm = ( 8.27 x 13.70 ) in + 'F4' => array( 595.276, 935.433), // = ( 210 x 330 ) mm = ( 8.27 x 12.99 ) in + 'SO_B5_EXTRA' => array( 572.598, 782.362), // = ( 202 x 276 ) mm = ( 7.95 x 10.87 ) in + 'A5_EXTRA' => array( 490.394, 666.142), // = ( 173 x 235 ) mm = ( 6.81 x 9.25 ) in + // ANSI Series + 'ANSI_E' => array( 2448.000, 3168.000), // = ( 864 x 1118 ) mm = ( 34.00 x 44.00 ) in + 'ANSI_D' => array( 1584.000, 2448.000), // = ( 559 x 864 ) mm = ( 22.00 x 34.00 ) in + 'ANSI_C' => array( 1224.000, 1584.000), // = ( 432 x 559 ) mm = ( 17.00 x 22.00 ) in + 'ANSI_B' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in + 'ANSI_A' => array( 612.000, 792.000), // = ( 216 x 279 ) mm = ( 8.50 x 11.00 ) in + // Traditional 'Loose' North American Paper Sizes + 'USLEDGER' => array( 1224.000, 792.000), // = ( 432 x 279 ) mm = ( 17.00 x 11.00 ) in + 'LEDGER' => array( 1224.000, 792.000), // = ( 432 x 279 ) mm = ( 17.00 x 11.00 ) in + 'ORGANIZERK' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in + 'BIBLE' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in + 'USTABLOID' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in + 'TABLOID' => array( 792.000, 1224.000), // = ( 279 x 432 ) mm = ( 11.00 x 17.00 ) in + 'ORGANIZERM' => array( 612.000, 792.000), // = ( 216 x 279 ) mm = ( 8.50 x 11.00 ) in + 'USLETTER' => array( 612.000, 792.000), // = ( 216 x 279 ) mm = ( 8.50 x 11.00 ) in + 'LETTER' => array( 612.000, 792.000), // = ( 216 x 279 ) mm = ( 8.50 x 11.00 ) in + 'USLEGAL' => array( 612.000, 1008.000), // = ( 216 x 356 ) mm = ( 8.50 x 14.00 ) in + 'LEGAL' => array( 612.000, 1008.000), // = ( 216 x 356 ) mm = ( 8.50 x 14.00 ) in + 'GOVERNMENTLETTER' => array( 576.000, 756.000), // = ( 203 x 267 ) mm = ( 8.00 x 10.50 ) in + 'GLETTER' => array( 576.000, 756.000), // = ( 203 x 267 ) mm = ( 8.00 x 10.50 ) in + 'JUNIORLEGAL' => array( 576.000, 360.000), // = ( 203 x 127 ) mm = ( 8.00 x 5.00 ) in + 'JLEGAL' => array( 576.000, 360.000), // = ( 203 x 127 ) mm = ( 8.00 x 5.00 ) in + // Other North American Paper Sizes + 'QUADDEMY' => array( 2520.000, 3240.000), // = ( 889 x 1143 ) mm = ( 35.00 x 45.00 ) in + 'SUPER_B' => array( 936.000, 1368.000), // = ( 330 x 483 ) mm = ( 13.00 x 19.00 ) in + 'QUARTO' => array( 648.000, 792.000), // = ( 229 x 279 ) mm = ( 9.00 x 11.00 ) in + 'GOVERNMENTLEGAL' => array( 612.000, 936.000), // = ( 216 x 330 ) mm = ( 8.50 x 13.00 ) in + 'FOLIO' => array( 612.000, 936.000), // = ( 216 x 330 ) mm = ( 8.50 x 13.00 ) in + 'MONARCH' => array( 522.000, 756.000), // = ( 184 x 267 ) mm = ( 7.25 x 10.50 ) in + 'EXECUTIVE' => array( 522.000, 756.000), // = ( 184 x 267 ) mm = ( 7.25 x 10.50 ) in + 'ORGANIZERL' => array( 396.000, 612.000), // = ( 140 x 216 ) mm = ( 5.50 x 8.50 ) in + 'STATEMENT' => array( 396.000, 612.000), // = ( 140 x 216 ) mm = ( 5.50 x 8.50 ) in + 'MEMO' => array( 396.000, 612.000), // = ( 140 x 216 ) mm = ( 5.50 x 8.50 ) in + 'FOOLSCAP' => array( 595.440, 936.000), // = ( 210 x 330 ) mm = ( 8.27 x 13.00 ) in + 'COMPACT' => array( 306.000, 486.000), // = ( 108 x 171 ) mm = ( 4.25 x 6.75 ) in + 'ORGANIZERJ' => array( 198.000, 360.000), // = ( 70 x 127 ) mm = ( 2.75 x 5.00 ) in + // Canadian standard CAN 2-9.60M + 'P1' => array( 1587.402, 2437.795), // = ( 560 x 860 ) mm = ( 22.05 x 33.86 ) in + 'P2' => array( 1218.898, 1587.402), // = ( 430 x 560 ) mm = ( 16.93 x 22.05 ) in + 'P3' => array( 793.701, 1218.898), // = ( 280 x 430 ) mm = ( 11.02 x 16.93 ) in + 'P4' => array( 609.449, 793.701), // = ( 215 x 280 ) mm = ( 8.46 x 11.02 ) in + 'P5' => array( 396.850, 609.449), // = ( 140 x 215 ) mm = ( 5.51 x 8.46 ) in + 'P6' => array( 303.307, 396.850), // = ( 107 x 140 ) mm = ( 4.21 x 5.51 ) in + // North American Architectural Sizes + 'ARCH_E' => array( 2592.000, 3456.000), // = ( 914 x 1219 ) mm = ( 36.00 x 48.00 ) in + 'ARCH_E1' => array( 2160.000, 3024.000), // = ( 762 x 1067 ) mm = ( 30.00 x 42.00 ) in + 'ARCH_D' => array( 1728.000, 2592.000), // = ( 610 x 914 ) mm = ( 24.00 x 36.00 ) in + 'BROADSHEET' => array( 1296.000, 1728.000), // = ( 457 x 610 ) mm = ( 18.00 x 24.00 ) in + 'ARCH_C' => array( 1296.000, 1728.000), // = ( 457 x 610 ) mm = ( 18.00 x 24.00 ) in + 'ARCH_B' => array( 864.000, 1296.000), // = ( 305 x 457 ) mm = ( 12.00 x 18.00 ) in + 'ARCH_A' => array( 648.000, 864.000), // = ( 229 x 305 ) mm = ( 9.00 x 12.00 ) in + // -- North American Envelope Sizes + // - Announcement Envelopes + 'ANNENV_A2' => array( 314.640, 414.000), // = ( 111 x 146 ) mm = ( 4.37 x 5.75 ) in + 'ANNENV_A6' => array( 342.000, 468.000), // = ( 121 x 165 ) mm = ( 4.75 x 6.50 ) in + 'ANNENV_A7' => array( 378.000, 522.000), // = ( 133 x 184 ) mm = ( 5.25 x 7.25 ) in + 'ANNENV_A8' => array( 396.000, 584.640), // = ( 140 x 206 ) mm = ( 5.50 x 8.12 ) in + 'ANNENV_A10' => array( 450.000, 692.640), // = ( 159 x 244 ) mm = ( 6.25 x 9.62 ) in + 'ANNENV_SLIM' => array( 278.640, 638.640), // = ( 98 x 225 ) mm = ( 3.87 x 8.87 ) in + // - Commercial Envelopes + 'COMMENV_N6_1/4' => array( 252.000, 432.000), // = ( 89 x 152 ) mm = ( 3.50 x 6.00 ) in + 'COMMENV_N6_3/4' => array( 260.640, 468.000), // = ( 92 x 165 ) mm = ( 3.62 x 6.50 ) in + 'COMMENV_N8' => array( 278.640, 540.000), // = ( 98 x 191 ) mm = ( 3.87 x 7.50 ) in + 'COMMENV_N9' => array( 278.640, 638.640), // = ( 98 x 225 ) mm = ( 3.87 x 8.87 ) in + 'COMMENV_N10' => array( 296.640, 684.000), // = ( 105 x 241 ) mm = ( 4.12 x 9.50 ) in + 'COMMENV_N11' => array( 324.000, 746.640), // = ( 114 x 263 ) mm = ( 4.50 x 10.37 ) in + 'COMMENV_N12' => array( 342.000, 792.000), // = ( 121 x 279 ) mm = ( 4.75 x 11.00 ) in + 'COMMENV_N14' => array( 360.000, 828.000), // = ( 127 x 292 ) mm = ( 5.00 x 11.50 ) in + // - Catalogue Envelopes + 'CATENV_N1' => array( 432.000, 648.000), // = ( 152 x 229 ) mm = ( 6.00 x 9.00 ) in + 'CATENV_N1_3/4' => array( 468.000, 684.000), // = ( 165 x 241 ) mm = ( 6.50 x 9.50 ) in + 'CATENV_N2' => array( 468.000, 720.000), // = ( 165 x 254 ) mm = ( 6.50 x 10.00 ) in + 'CATENV_N3' => array( 504.000, 720.000), // = ( 178 x 254 ) mm = ( 7.00 x 10.00 ) in + 'CATENV_N6' => array( 540.000, 756.000), // = ( 191 x 267 ) mm = ( 7.50 x 10.50 ) in + 'CATENV_N7' => array( 576.000, 792.000), // = ( 203 x 279 ) mm = ( 8.00 x 11.00 ) in + 'CATENV_N8' => array( 594.000, 810.000), // = ( 210 x 286 ) mm = ( 8.25 x 11.25 ) in + 'CATENV_N9_1/2' => array( 612.000, 756.000), // = ( 216 x 267 ) mm = ( 8.50 x 10.50 ) in + 'CATENV_N9_3/4' => array( 630.000, 810.000), // = ( 222 x 286 ) mm = ( 8.75 x 11.25 ) in + 'CATENV_N10_1/2' => array( 648.000, 864.000), // = ( 229 x 305 ) mm = ( 9.00 x 12.00 ) in + 'CATENV_N12_1/2' => array( 684.000, 900.000), // = ( 241 x 318 ) mm = ( 9.50 x 12.50 ) in + 'CATENV_N13_1/2' => array( 720.000, 936.000), // = ( 254 x 330 ) mm = ( 10.00 x 13.00 ) in + 'CATENV_N14_1/4' => array( 810.000, 882.000), // = ( 286 x 311 ) mm = ( 11.25 x 12.25 ) in + 'CATENV_N14_1/2' => array( 828.000, 1044.000), // = ( 292 x 368 ) mm = ( 11.50 x 14.50 ) in + // Japanese (JIS P 0138-61) Standard B-Series + 'JIS_B0' => array( 2919.685, 4127.244), // = ( 1030 x 1456 ) mm = ( 40.55 x 57.32 ) in + 'JIS_B1' => array( 2063.622, 2919.685), // = ( 728 x 1030 ) mm = ( 28.66 x 40.55 ) in + 'JIS_B2' => array( 1459.843, 2063.622), // = ( 515 x 728 ) mm = ( 20.28 x 28.66 ) in + 'JIS_B3' => array( 1031.811, 1459.843), // = ( 364 x 515 ) mm = ( 14.33 x 20.28 ) in + 'JIS_B4' => array( 728.504, 1031.811), // = ( 257 x 364 ) mm = ( 10.12 x 14.33 ) in + 'JIS_B5' => array( 515.906, 728.504), // = ( 182 x 257 ) mm = ( 7.17 x 10.12 ) in + 'JIS_B6' => array( 362.835, 515.906), // = ( 128 x 182 ) mm = ( 5.04 x 7.17 ) in + 'JIS_B7' => array( 257.953, 362.835), // = ( 91 x 128 ) mm = ( 3.58 x 5.04 ) in + 'JIS_B8' => array( 181.417, 257.953), // = ( 64 x 91 ) mm = ( 2.52 x 3.58 ) in + 'JIS_B9' => array( 127.559, 181.417), // = ( 45 x 64 ) mm = ( 1.77 x 2.52 ) in + 'JIS_B10' => array( 90.709, 127.559), // = ( 32 x 45 ) mm = ( 1.26 x 1.77 ) in + 'JIS_B11' => array( 62.362, 90.709), // = ( 22 x 32 ) mm = ( 0.87 x 1.26 ) in + 'JIS_B12' => array( 45.354, 62.362), // = ( 16 x 22 ) mm = ( 0.63 x 0.87 ) in + // PA Series + 'PA0' => array( 2381.102, 3174.803), // = ( 840 x 1120 ) mm = ( 33.07 x 44.09 ) in + 'PA1' => array( 1587.402, 2381.102), // = ( 560 x 840 ) mm = ( 22.05 x 33.07 ) in + 'PA2' => array( 1190.551, 1587.402), // = ( 420 x 560 ) mm = ( 16.54 x 22.05 ) in + 'PA3' => array( 793.701, 1190.551), // = ( 280 x 420 ) mm = ( 11.02 x 16.54 ) in + 'PA4' => array( 595.276, 793.701), // = ( 210 x 280 ) mm = ( 8.27 x 11.02 ) in + 'PA5' => array( 396.850, 595.276), // = ( 140 x 210 ) mm = ( 5.51 x 8.27 ) in + 'PA6' => array( 297.638, 396.850), // = ( 105 x 140 ) mm = ( 4.13 x 5.51 ) in + 'PA7' => array( 198.425, 297.638), // = ( 70 x 105 ) mm = ( 2.76 x 4.13 ) in + 'PA8' => array( 147.402, 198.425), // = ( 52 x 70 ) mm = ( 2.05 x 2.76 ) in + 'PA9' => array( 99.213, 147.402), // = ( 35 x 52 ) mm = ( 1.38 x 2.05 ) in + 'PA10' => array( 73.701, 99.213), // = ( 26 x 35 ) mm = ( 1.02 x 1.38 ) in + // Standard Photographic Print Sizes + 'PASSPORT_PHOTO' => array( 99.213, 127.559), // = ( 35 x 45 ) mm = ( 1.38 x 1.77 ) in + 'E' => array( 233.858, 340.157), // = ( 82 x 120 ) mm = ( 3.25 x 4.72 ) in + 'L' => array( 252.283, 360.000), // = ( 89 x 127 ) mm = ( 3.50 x 5.00 ) in + '3R' => array( 252.283, 360.000), // = ( 89 x 127 ) mm = ( 3.50 x 5.00 ) in + 'KG' => array( 289.134, 430.866), // = ( 102 x 152 ) mm = ( 4.02 x 5.98 ) in + '4R' => array( 289.134, 430.866), // = ( 102 x 152 ) mm = ( 4.02 x 5.98 ) in + '4D' => array( 340.157, 430.866), // = ( 120 x 152 ) mm = ( 4.72 x 5.98 ) in + '2L' => array( 360.000, 504.567), // = ( 127 x 178 ) mm = ( 5.00 x 7.01 ) in + '5R' => array( 360.000, 504.567), // = ( 127 x 178 ) mm = ( 5.00 x 7.01 ) in + '8P' => array( 430.866, 575.433), // = ( 152 x 203 ) mm = ( 5.98 x 7.99 ) in + '6R' => array( 430.866, 575.433), // = ( 152 x 203 ) mm = ( 5.98 x 7.99 ) in + '6P' => array( 575.433, 720.000), // = ( 203 x 254 ) mm = ( 7.99 x 10.00 ) in + '8R' => array( 575.433, 720.000), // = ( 203 x 254 ) mm = ( 7.99 x 10.00 ) in + '6PW' => array( 575.433, 864.567), // = ( 203 x 305 ) mm = ( 7.99 x 12.01 ) in + 'S8R' => array( 575.433, 864.567), // = ( 203 x 305 ) mm = ( 7.99 x 12.01 ) in + '4P' => array( 720.000, 864.567), // = ( 254 x 305 ) mm = ( 10.00 x 12.01 ) in + '10R' => array( 720.000, 864.567), // = ( 254 x 305 ) mm = ( 10.00 x 12.01 ) in + '4PW' => array( 720.000, 1080.000), // = ( 254 x 381 ) mm = ( 10.00 x 15.00 ) in + 'S10R' => array( 720.000, 1080.000), // = ( 254 x 381 ) mm = ( 10.00 x 15.00 ) in + '11R' => array( 790.866, 1009.134), // = ( 279 x 356 ) mm = ( 10.98 x 14.02 ) in + 'S11R' => array( 790.866, 1224.567), // = ( 279 x 432 ) mm = ( 10.98 x 17.01 ) in + '12R' => array( 864.567, 1080.000), // = ( 305 x 381 ) mm = ( 12.01 x 15.00 ) in + 'S12R' => array( 864.567, 1292.598), // = ( 305 x 456 ) mm = ( 12.01 x 17.95 ) in + // Common Newspaper Sizes + 'NEWSPAPER_BROADSHEET' => array( 2125.984, 1700.787), // = ( 750 x 600 ) mm = ( 29.53 x 23.62 ) in + 'NEWSPAPER_BERLINER' => array( 1332.283, 892.913), // = ( 470 x 315 ) mm = ( 18.50 x 12.40 ) in + 'NEWSPAPER_TABLOID' => array( 1218.898, 793.701), // = ( 430 x 280 ) mm = ( 16.93 x 11.02 ) in + 'NEWSPAPER_COMPACT' => array( 1218.898, 793.701), // = ( 430 x 280 ) mm = ( 16.93 x 11.02 ) in + // Business Cards + 'CREDIT_CARD' => array( 153.014, 242.646), // = ( 54 x 86 ) mm = ( 2.13 x 3.37 ) in + 'BUSINESS_CARD' => array( 153.014, 242.646), // = ( 54 x 86 ) mm = ( 2.13 x 3.37 ) in + 'BUSINESS_CARD_ISO7810' => array( 153.014, 242.646), // = ( 54 x 86 ) mm = ( 2.13 x 3.37 ) in + 'BUSINESS_CARD_ISO216' => array( 147.402, 209.764), // = ( 52 x 74 ) mm = ( 2.05 x 2.91 ) in + 'BUSINESS_CARD_IT' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in + 'BUSINESS_CARD_UK' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in + 'BUSINESS_CARD_FR' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in + 'BUSINESS_CARD_DE' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in + 'BUSINESS_CARD_ES' => array( 155.906, 240.945), // = ( 55 x 85 ) mm = ( 2.17 x 3.35 ) in + 'BUSINESS_CARD_CA' => array( 144.567, 252.283), // = ( 51 x 89 ) mm = ( 2.01 x 3.50 ) in + 'BUSINESS_CARD_US' => array( 144.567, 252.283), // = ( 51 x 89 ) mm = ( 2.01 x 3.50 ) in + 'BUSINESS_CARD_JP' => array( 155.906, 257.953), // = ( 55 x 91 ) mm = ( 2.17 x 3.58 ) in + 'BUSINESS_CARD_HK' => array( 153.071, 255.118), // = ( 54 x 90 ) mm = ( 2.13 x 3.54 ) in + 'BUSINESS_CARD_AU' => array( 155.906, 255.118), // = ( 55 x 90 ) mm = ( 2.17 x 3.54 ) in + 'BUSINESS_CARD_DK' => array( 155.906, 255.118), // = ( 55 x 90 ) mm = ( 2.17 x 3.54 ) in + 'BUSINESS_CARD_SE' => array( 155.906, 255.118), // = ( 55 x 90 ) mm = ( 2.17 x 3.54 ) in + 'BUSINESS_CARD_RU' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in + 'BUSINESS_CARD_CZ' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in + 'BUSINESS_CARD_FI' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in + 'BUSINESS_CARD_HU' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in + 'BUSINESS_CARD_IL' => array( 141.732, 255.118), // = ( 50 x 90 ) mm = ( 1.97 x 3.54 ) in + // Billboards + '4SHEET' => array( 2880.000, 4320.000), // = ( 1016 x 1524 ) mm = ( 40.00 x 60.00 ) in + '6SHEET' => array( 3401.575, 5102.362), // = ( 1200 x 1800 ) mm = ( 47.24 x 70.87 ) in + '12SHEET' => array( 8640.000, 4320.000), // = ( 3048 x 1524 ) mm = (120.00 x 60.00 ) in + '16SHEET' => array( 5760.000, 8640.000), // = ( 2032 x 3048 ) mm = ( 80.00 x 120.00) in + '32SHEET' => array(11520.000, 8640.000), // = ( 4064 x 3048 ) mm = (160.00 x 120.00) in + '48SHEET' => array(17280.000, 8640.000), // = ( 6096 x 3048 ) mm = (240.00 x 120.00) in + '64SHEET' => array(23040.000, 8640.000), // = ( 8128 x 3048 ) mm = (320.00 x 120.00) in + '96SHEET' => array(34560.000, 8640.000), // = (12192 x 3048 ) mm = (480.00 x 120.00) in + // -- Old European Sizes + // - Old Imperial English Sizes + 'EN_EMPEROR' => array( 3456.000, 5184.000), // = ( 1219 x 1829 ) mm = ( 48.00 x 72.00 ) in + 'EN_ANTIQUARIAN' => array( 2232.000, 3816.000), // = ( 787 x 1346 ) mm = ( 31.00 x 53.00 ) in + 'EN_GRAND_EAGLE' => array( 2070.000, 3024.000), // = ( 730 x 1067 ) mm = ( 28.75 x 42.00 ) in + 'EN_DOUBLE_ELEPHANT' => array( 1926.000, 2880.000), // = ( 679 x 1016 ) mm = ( 26.75 x 40.00 ) in + 'EN_ATLAS' => array( 1872.000, 2448.000), // = ( 660 x 864 ) mm = ( 26.00 x 34.00 ) in + 'EN_COLOMBIER' => array( 1692.000, 2484.000), // = ( 597 x 876 ) mm = ( 23.50 x 34.50 ) in + 'EN_ELEPHANT' => array( 1656.000, 2016.000), // = ( 584 x 711 ) mm = ( 23.00 x 28.00 ) in + 'EN_DOUBLE_DEMY' => array( 1620.000, 2556.000), // = ( 572 x 902 ) mm = ( 22.50 x 35.50 ) in + 'EN_IMPERIAL' => array( 1584.000, 2160.000), // = ( 559 x 762 ) mm = ( 22.00 x 30.00 ) in + 'EN_PRINCESS' => array( 1548.000, 2016.000), // = ( 546 x 711 ) mm = ( 21.50 x 28.00 ) in + 'EN_CARTRIDGE' => array( 1512.000, 1872.000), // = ( 533 x 660 ) mm = ( 21.00 x 26.00 ) in + 'EN_DOUBLE_LARGE_POST' => array( 1512.000, 2376.000), // = ( 533 x 838 ) mm = ( 21.00 x 33.00 ) in + 'EN_ROYAL' => array( 1440.000, 1800.000), // = ( 508 x 635 ) mm = ( 20.00 x 25.00 ) in + 'EN_SHEET' => array( 1404.000, 1692.000), // = ( 495 x 597 ) mm = ( 19.50 x 23.50 ) in + 'EN_HALF_POST' => array( 1404.000, 1692.000), // = ( 495 x 597 ) mm = ( 19.50 x 23.50 ) in + 'EN_SUPER_ROYAL' => array( 1368.000, 1944.000), // = ( 483 x 686 ) mm = ( 19.00 x 27.00 ) in + 'EN_DOUBLE_POST' => array( 1368.000, 2196.000), // = ( 483 x 775 ) mm = ( 19.00 x 30.50 ) in + 'EN_MEDIUM' => array( 1260.000, 1656.000), // = ( 445 x 584 ) mm = ( 17.50 x 23.00 ) in + 'EN_DEMY' => array( 1260.000, 1620.000), // = ( 445 x 572 ) mm = ( 17.50 x 22.50 ) in + 'EN_LARGE_POST' => array( 1188.000, 1512.000), // = ( 419 x 533 ) mm = ( 16.50 x 21.00 ) in + 'EN_COPY_DRAUGHT' => array( 1152.000, 1440.000), // = ( 406 x 508 ) mm = ( 16.00 x 20.00 ) in + 'EN_POST' => array( 1116.000, 1386.000), // = ( 394 x 489 ) mm = ( 15.50 x 19.25 ) in + 'EN_CROWN' => array( 1080.000, 1440.000), // = ( 381 x 508 ) mm = ( 15.00 x 20.00 ) in + 'EN_PINCHED_POST' => array( 1062.000, 1332.000), // = ( 375 x 470 ) mm = ( 14.75 x 18.50 ) in + 'EN_BRIEF' => array( 972.000, 1152.000), // = ( 343 x 406 ) mm = ( 13.50 x 16.00 ) in + 'EN_FOOLSCAP' => array( 972.000, 1224.000), // = ( 343 x 432 ) mm = ( 13.50 x 17.00 ) in + 'EN_SMALL_FOOLSCAP' => array( 954.000, 1188.000), // = ( 337 x 419 ) mm = ( 13.25 x 16.50 ) in + 'EN_POTT' => array( 900.000, 1080.000), // = ( 318 x 381 ) mm = ( 12.50 x 15.00 ) in + // - Old Imperial Belgian Sizes + 'BE_GRAND_AIGLE' => array( 1984.252, 2948.031), // = ( 700 x 1040 ) mm = ( 27.56 x 40.94 ) in + 'BE_COLOMBIER' => array( 1757.480, 2409.449), // = ( 620 x 850 ) mm = ( 24.41 x 33.46 ) in + 'BE_DOUBLE_CARRE' => array( 1757.480, 2607.874), // = ( 620 x 920 ) mm = ( 24.41 x 36.22 ) in + 'BE_ELEPHANT' => array( 1746.142, 2182.677), // = ( 616 x 770 ) mm = ( 24.25 x 30.31 ) in + 'BE_PETIT_AIGLE' => array( 1700.787, 2381.102), // = ( 600 x 840 ) mm = ( 23.62 x 33.07 ) in + 'BE_GRAND_JESUS' => array( 1559.055, 2069.291), // = ( 550 x 730 ) mm = ( 21.65 x 28.74 ) in + 'BE_JESUS' => array( 1530.709, 2069.291), // = ( 540 x 730 ) mm = ( 21.26 x 28.74 ) in + 'BE_RAISIN' => array( 1417.323, 1842.520), // = ( 500 x 650 ) mm = ( 19.69 x 25.59 ) in + 'BE_GRAND_MEDIAN' => array( 1303.937, 1714.961), // = ( 460 x 605 ) mm = ( 18.11 x 23.82 ) in + 'BE_DOUBLE_POSTE' => array( 1233.071, 1601.575), // = ( 435 x 565 ) mm = ( 17.13 x 22.24 ) in + 'BE_COQUILLE' => array( 1218.898, 1587.402), // = ( 430 x 560 ) mm = ( 16.93 x 22.05 ) in + 'BE_PETIT_MEDIAN' => array( 1176.378, 1502.362), // = ( 415 x 530 ) mm = ( 16.34 x 20.87 ) in + 'BE_RUCHE' => array( 1020.472, 1303.937), // = ( 360 x 460 ) mm = ( 14.17 x 18.11 ) in + 'BE_PROPATRIA' => array( 977.953, 1218.898), // = ( 345 x 430 ) mm = ( 13.58 x 16.93 ) in + 'BE_LYS' => array( 898.583, 1125.354), // = ( 317 x 397 ) mm = ( 12.48 x 15.63 ) in + 'BE_POT' => array( 870.236, 1088.504), // = ( 307 x 384 ) mm = ( 12.09 x 15.12 ) in + 'BE_ROSETTE' => array( 765.354, 983.622), // = ( 270 x 347 ) mm = ( 10.63 x 13.66 ) in + // - Old Imperial French Sizes + 'FR_UNIVERS' => array( 2834.646, 3685.039), // = ( 1000 x 1300 ) mm = ( 39.37 x 51.18 ) in + 'FR_DOUBLE_COLOMBIER' => array( 2551.181, 3571.654), // = ( 900 x 1260 ) mm = ( 35.43 x 49.61 ) in + 'FR_GRANDE_MONDE' => array( 2551.181, 3571.654), // = ( 900 x 1260 ) mm = ( 35.43 x 49.61 ) in + 'FR_DOUBLE_SOLEIL' => array( 2267.717, 3401.575), // = ( 800 x 1200 ) mm = ( 31.50 x 47.24 ) in + 'FR_DOUBLE_JESUS' => array( 2154.331, 3174.803), // = ( 760 x 1120 ) mm = ( 29.92 x 44.09 ) in + 'FR_GRAND_AIGLE' => array( 2125.984, 3004.724), // = ( 750 x 1060 ) mm = ( 29.53 x 41.73 ) in + 'FR_PETIT_AIGLE' => array( 1984.252, 2664.567), // = ( 700 x 940 ) mm = ( 27.56 x 37.01 ) in + 'FR_DOUBLE_RAISIN' => array( 1842.520, 2834.646), // = ( 650 x 1000 ) mm = ( 25.59 x 39.37 ) in + 'FR_JOURNAL' => array( 1842.520, 2664.567), // = ( 650 x 940 ) mm = ( 25.59 x 37.01 ) in + 'FR_COLOMBIER_AFFICHE' => array( 1785.827, 2551.181), // = ( 630 x 900 ) mm = ( 24.80 x 35.43 ) in + 'FR_DOUBLE_CAVALIER' => array( 1757.480, 2607.874), // = ( 620 x 920 ) mm = ( 24.41 x 36.22 ) in + 'FR_CLOCHE' => array( 1700.787, 2267.717), // = ( 600 x 800 ) mm = ( 23.62 x 31.50 ) in + 'FR_SOLEIL' => array( 1700.787, 2267.717), // = ( 600 x 800 ) mm = ( 23.62 x 31.50 ) in + 'FR_DOUBLE_CARRE' => array( 1587.402, 2551.181), // = ( 560 x 900 ) mm = ( 22.05 x 35.43 ) in + 'FR_DOUBLE_COQUILLE' => array( 1587.402, 2494.488), // = ( 560 x 880 ) mm = ( 22.05 x 34.65 ) in + 'FR_JESUS' => array( 1587.402, 2154.331), // = ( 560 x 760 ) mm = ( 22.05 x 29.92 ) in + 'FR_RAISIN' => array( 1417.323, 1842.520), // = ( 500 x 650 ) mm = ( 19.69 x 25.59 ) in + 'FR_CAVALIER' => array( 1303.937, 1757.480), // = ( 460 x 620 ) mm = ( 18.11 x 24.41 ) in + 'FR_DOUBLE_COURONNE' => array( 1303.937, 2040.945), // = ( 460 x 720 ) mm = ( 18.11 x 28.35 ) in + 'FR_CARRE' => array( 1275.591, 1587.402), // = ( 450 x 560 ) mm = ( 17.72 x 22.05 ) in + 'FR_COQUILLE' => array( 1247.244, 1587.402), // = ( 440 x 560 ) mm = ( 17.32 x 22.05 ) in + 'FR_DOUBLE_TELLIERE' => array( 1247.244, 1927.559), // = ( 440 x 680 ) mm = ( 17.32 x 26.77 ) in + 'FR_DOUBLE_CLOCHE' => array( 1133.858, 1700.787), // = ( 400 x 600 ) mm = ( 15.75 x 23.62 ) in + 'FR_DOUBLE_POT' => array( 1133.858, 1757.480), // = ( 400 x 620 ) mm = ( 15.75 x 24.41 ) in + 'FR_ECU' => array( 1133.858, 1474.016), // = ( 400 x 520 ) mm = ( 15.75 x 20.47 ) in + 'FR_COURONNE' => array( 1020.472, 1303.937), // = ( 360 x 460 ) mm = ( 14.17 x 18.11 ) in + 'FR_TELLIERE' => array( 963.780, 1247.244), // = ( 340 x 440 ) mm = ( 13.39 x 17.32 ) in + 'FR_POT' => array( 878.740, 1133.858), // = ( 310 x 400 ) mm = ( 12.20 x 15.75 ) in + ); + + + /** + * Get page dimensions from format name. + * @param mixed $format The format name @see self::$page_format
        + * @return array containing page width and height in points + * @since 5.0.010 (2010-05-17) + * @public static + */ + public static function getPageSizeFromFormat($format) { + if (isset(self::$page_formats[$format])) { + return self::$page_formats[$format]; + } + return self::$page_formats['A4']; + } + + /** + * Set page boundaries. + * @param int $page page number + * @param string $type valid values are:
        • 'MediaBox' : the boundaries of the physical medium on which the page shall be displayed or printed;
        • 'CropBox' : the visible region of default user space;
        • 'BleedBox' : the region to which the contents of the page shall be clipped when output in a production environment;
        • 'TrimBox' : the intended dimensions of the finished page after trimming;
        • 'ArtBox' : the page's meaningful content (including potential white space).
        + * @param float $llx lower-left x coordinate in user units. + * @param float $lly lower-left y coordinate in user units. + * @param float $urx upper-right x coordinate in user units. + * @param float $ury upper-right y coordinate in user units. + * @param boolean $points If true uses user units as unit of measure, otherwise uses PDF points. + * @param float $k Scale factor (number of points in user unit). + * @param array $pagedim Array of page dimensions. + * @return array pagedim array of page dimensions. + * @since 5.0.010 (2010-05-17) + * @public static + */ + public static function setPageBoxes($page, $type, $llx, $lly, $urx, $ury, $points, $k, $pagedim=array()) { + if (!isset($pagedim[$page])) { + // initialize array + $pagedim[$page] = array(); + } + if (!in_array($type, self::$pageboxes)) { + return; + } + if ($points) { + $k = 1; + } + $pagedim[$page][$type]['llx'] = ($llx * $k); + $pagedim[$page][$type]['lly'] = ($lly * $k); + $pagedim[$page][$type]['urx'] = ($urx * $k); + $pagedim[$page][$type]['ury'] = ($ury * $k); + return $pagedim; + } + + /** + * Swap X and Y coordinates of page boxes (change page boxes orientation). + * @param int $page page number + * @param array $pagedim Array of page dimensions. + * @return array pagedim array of page dimensions. + * @since 5.0.010 (2010-05-17) + * @public static + */ + public static function swapPageBoxCoordinates($page, $pagedim) { + foreach (self::$pageboxes as $type) { + // swap X and Y coordinates + if (isset($pagedim[$page][$type])) { + $tmp = $pagedim[$page][$type]['llx']; + $pagedim[$page][$type]['llx'] = $pagedim[$page][$type]['lly']; + $pagedim[$page][$type]['lly'] = $tmp; + $tmp = $pagedim[$page][$type]['urx']; + $pagedim[$page][$type]['urx'] = $pagedim[$page][$type]['ury']; + $pagedim[$page][$type]['ury'] = $tmp; + } + } + return $pagedim; + } + + /** + * Get the canonical page layout mode. + * @param string $layout The page layout. Possible values are:
        • SinglePage Display one page at a time
        • OneColumn Display the pages in one column
        • TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
        • TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
        • TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
        • TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
        + * @return string Canonical page layout name. + * @public static + */ + public static function getPageLayoutMode($layout='SinglePage') { + switch ($layout) { + case 'default': + case 'single': + case 'SinglePage': { + $layout_mode = 'SinglePage'; + break; + } + case 'continuous': + case 'OneColumn': { + $layout_mode = 'OneColumn'; + break; + } + case 'two': + case 'TwoColumnLeft': { + $layout_mode = 'TwoColumnLeft'; + break; + } + case 'TwoColumnRight': { + $layout_mode = 'TwoColumnRight'; + break; + } + case 'TwoPageLeft': { + $layout_mode = 'TwoPageLeft'; + break; + } + case 'TwoPageRight': { + $layout_mode = 'TwoPageRight'; + break; + } + default: { + $layout_mode = 'SinglePage'; + } + } + return $layout_mode; + } + + /** + * Get the canonical page layout mode. + * @param string $mode A name object specifying how the document should be displayed when opened:
        • UseNone Neither document outline nor thumbnail images visible
        • UseOutlines Document outline visible
        • UseThumbs Thumbnail images visible
        • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
        • UseOC (PDF 1.5) Optional content group panel visible
        • UseAttachments (PDF 1.6) Attachments panel visible
        + * @return string Canonical page mode name. + * @public static + */ + public static function getPageMode($mode='UseNone') { + switch ($mode) { + case 'UseNone': { + $page_mode = 'UseNone'; + break; + } + case 'UseOutlines': { + $page_mode = 'UseOutlines'; + break; + } + case 'UseThumbs': { + $page_mode = 'UseThumbs'; + break; + } + case 'FullScreen': { + $page_mode = 'FullScreen'; + break; + } + case 'UseOC': { + $page_mode = 'UseOC'; + break; + } + case '': { + $page_mode = 'UseAttachments'; + break; + } + default: { + $page_mode = 'UseNone'; + } + } + return $page_mode; + } + + +} // END OF TCPDF_STATIC CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf.php new file mode 100755 index 0000000..667b004 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf.php @@ -0,0 +1,24748 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : +// This is a PHP class for generating PDF documents without requiring external extensions. +// +// NOTE: +// This class was originally derived in 2002 from the Public +// Domain FPDF class by Olivier Plathey (http://www.fpdf.org), +// but now is almost entirely rewritten and contains thousands of +// new lines of code and hundreds new features. +// +// Main features: +// * no external libraries are required for the basic functions; +// * all standard page formats, custom page formats, custom margins and units of measure; +// * UTF-8 Unicode and Right-To-Left languages; +// * TrueTypeUnicode, TrueType, Type1 and CID-0 fonts; +// * font subsetting; +// * methods to publish some XHTML + CSS code, Javascript and Forms; +// * images, graphic (geometric figures) and transformation methods; +// * supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImageMagick (http://www.imagemagick.org/www/formats.html) +// * 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extension, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417; +// * JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies; +// * automatic page header and footer management; +// * document encryption up to 256 bit and digital signature certifications; +// * transactions to UNDO commands; +// * PDF annotations, including links, text and file attachments; +// * text rendering modes (fill, stroke and clipping); +// * multiple columns mode; +// * no-write page regions; +// * bookmarks, named destinations and table of content; +// * text hyphenation; +// * text stretching and spacing (tracking); +// * automatic page break, line break and text alignments including justification; +// * automatic page numbering and page groups; +// * move and delete pages; +// * page compression (requires php-zlib extension); +// * XOBject Templates; +// * Layers and object visibility. +// * PDF/A-1b support +//============================================================+ + +/** + * @file + * This is a PHP class for generating PDF documents without requiring external extensions.
        + * TCPDF project (http://www.tcpdf.org) was originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
        + *

        TCPDF main features are:

        + *
          + *
        • no external libraries are required for the basic functions;
        • + *
        • all standard page formats, custom page formats, custom margins and units of measure;
        • + *
        • UTF-8 Unicode and Right-To-Left languages;
        • + *
        • TrueTypeUnicode, TrueType, Type1 and CID-0 fonts;
        • + *
        • font subsetting;
        • + *
        • methods to publish some XHTML + CSS code, Javascript and Forms;
        • + *
        • images, graphic (geometric figures) and transformation methods; + *
        • supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImageMagick (http://www.imagemagick.org/www/formats.html)
        • + *
        • 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extension, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417;
        • + *
        • JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;
        • + *
        • automatic page header and footer management;
        • + *
        • document encryption up to 256 bit and digital signature certifications;
        • + *
        • transactions to UNDO commands;
        • + *
        • PDF annotations, including links, text and file attachments;
        • + *
        • text rendering modes (fill, stroke and clipping);
        • + *
        • multiple columns mode;
        • + *
        • no-write page regions;
        • + *
        • bookmarks, named destinations and table of content;
        • + *
        • text hyphenation;
        • + *
        • text stretching and spacing (tracking);
        • + *
        • automatic page break, line break and text alignments including justification;
        • + *
        • automatic page numbering and page groups;
        • + *
        • move and delete pages;
        • + *
        • page compression (requires php-zlib extension);
        • + *
        • XOBject Templates;
        • + *
        • Layers and object visibility;
        • + *
        • PDF/A-1b support.
        • + *
        + * Tools to encode your unicode fonts are on fonts/utils directory.

        + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 6.6.2 + */ + +// TCPDF configuration +require_once(dirname(__FILE__).'/tcpdf_autoconfig.php'); +// TCPDF static font methods and data +require_once(dirname(__FILE__).'/include/tcpdf_font_data.php'); +// TCPDF static font methods and data +require_once(dirname(__FILE__).'/include/tcpdf_fonts.php'); +// TCPDF static color methods and data +require_once(dirname(__FILE__).'/include/tcpdf_colors.php'); +// TCPDF static image methods and data +require_once(dirname(__FILE__).'/include/tcpdf_images.php'); +// TCPDF static methods and data +require_once(dirname(__FILE__).'/include/tcpdf_static.php'); + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + +/** + * @class TCPDF + * PHP class for generating PDF documents without requiring external extensions. + * TCPDF project (http://www.tcpdf.org) has been originally derived in 2002 from the Public Domain FPDF class by Olivier Plathey (http://www.fpdf.org), but now is almost entirely rewritten.
        + * @package com.tecnick.tcpdf + * @brief PHP class for generating PDF documents without requiring external extensions. + * @version 6.6.2 + * @author Nicola Asuni - info@tecnick.com + * @IgnoreAnnotation("protected") + * @IgnoreAnnotation("public") + * @IgnoreAnnotation("pre") + */ +class TCPDF { + + // Protected properties + + /** + * Current page number. + * @protected + */ + protected $page; + + /** + * Current object number. + * @protected + */ + protected $n; + + /** + * Array of object offsets. + * @protected + */ + protected $offsets = array(); + + /** + * Array of object IDs for each page. + * @protected + */ + protected $pageobjects = array(); + + /** + * Buffer holding in-memory PDF. + * @protected + */ + protected $buffer; + + /** + * Array containing pages. + * @protected + */ + protected $pages = array(); + + /** + * Current document state. + * @protected + */ + protected $state; + + /** + * Compression flag. + * @protected + */ + protected $compress; + + /** + * Current page orientation (P = Portrait, L = Landscape). + * @protected + */ + protected $CurOrientation; + + /** + * Page dimensions. + * @protected + */ + protected $pagedim = array(); + + /** + * Scale factor (number of points in user unit). + * @protected + */ + protected $k; + + /** + * Width of page format in points. + * @protected + */ + protected $fwPt; + + /** + * Height of page format in points. + * @protected + */ + protected $fhPt; + + /** + * Current width of page in points. + * @protected + */ + protected $wPt; + + /** + * Current height of page in points. + * @protected + */ + protected $hPt; + + /** + * Current width of page in user unit. + * @protected + */ + protected $w; + + /** + * Current height of page in user unit. + * @protected + */ + protected $h; + + /** + * Left margin. + * @protected + */ + protected $lMargin; + + /** + * Right margin. + * @protected + */ + protected $rMargin; + + /** + * Cell left margin (used by regions). + * @protected + */ + protected $clMargin; + + /** + * Cell right margin (used by regions). + * @protected + */ + protected $crMargin; + + /** + * Top margin. + * @protected + */ + protected $tMargin; + + /** + * Page break margin. + * @protected + */ + protected $bMargin; + + /** + * Array of cell internal paddings ('T' => top, 'R' => right, 'B' => bottom, 'L' => left). + * @since 5.9.000 (2010-10-03) + * @protected + */ + protected $cell_padding = array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0); + + /** + * Array of cell margins ('T' => top, 'R' => right, 'B' => bottom, 'L' => left). + * @since 5.9.000 (2010-10-04) + * @protected + */ + protected $cell_margin = array('T' => 0, 'R' => 0, 'B' => 0, 'L' => 0); + + /** + * Current horizontal position in user unit for cell positioning. + * @protected + */ + protected $x; + + /** + * Current vertical position in user unit for cell positioning. + * @protected + */ + protected $y; + + /** + * Height of last cell printed. + * @protected + */ + protected $lasth; + + /** + * Line width in user unit. + * @protected + */ + protected $LineWidth; + + /** + * Array of standard font names. + * @protected + */ + protected $CoreFonts; + + /** + * Array of used fonts. + * @protected + */ + protected $fonts = array(); + + /** + * Array of font files. + * @protected + */ + protected $FontFiles = array(); + + /** + * Array of encoding differences. + * @protected + */ + protected $diffs = array(); + + /** + * Array of used images. + * @protected + */ + protected $images = array(); + + /** + * Depth of the svg tag, to keep track if the svg tag is a subtag or the root tag. + * @protected + */ + protected $svg_tag_depth = 0; + + /** + * Array of Annotations in pages. + * @protected + */ + protected $PageAnnots = array(); + + /** + * Array of internal links. + * @protected + */ + protected $links = array(); + + /** + * Current font family. + * @protected + */ + protected $FontFamily; + + /** + * Current font style. + * @protected + */ + protected $FontStyle; + + /** + * Current font ascent (distance between font top and baseline). + * @protected + * @since 2.8.000 (2007-03-29) + */ + protected $FontAscent; + + /** + * Current font descent (distance between font bottom and baseline). + * @protected + * @since 2.8.000 (2007-03-29) + */ + protected $FontDescent; + + /** + * Underlining flag. + * @protected + */ + protected $underline; + + /** + * Overlining flag. + * @protected + */ + protected $overline; + + /** + * Current font info. + * @protected + */ + protected $CurrentFont; + + /** + * Current font size in points. + * @protected + */ + protected $FontSizePt; + + /** + * Current font size in user unit. + * @protected + */ + protected $FontSize; + + /** + * Commands for drawing color. + * @protected + */ + protected $DrawColor; + + /** + * Commands for filling color. + * @protected + */ + protected $FillColor; + + /** + * Commands for text color. + * @protected + */ + protected $TextColor; + + /** + * Indicates whether fill and text colors are different. + * @protected + */ + protected $ColorFlag; + + /** + * Automatic page breaking. + * @protected + */ + protected $AutoPageBreak; + + /** + * Threshold used to trigger page breaks. + * @protected + */ + protected $PageBreakTrigger; + + /** + * Flag set when processing page header. + * @protected + */ + protected $InHeader = false; + + /** + * Flag set when processing page footer. + * @protected + */ + protected $InFooter = false; + + /** + * Zoom display mode. + * @protected + */ + protected $ZoomMode; + + /** + * Layout display mode. + * @protected + */ + protected $LayoutMode; + + /** + * If true set the document information dictionary in Unicode. + * @protected + */ + protected $docinfounicode = true; + + /** + * Document title. + * @protected + */ + protected $title = ''; + + /** + * Document subject. + * @protected + */ + protected $subject = ''; + + /** + * Document author. + * @protected + */ + protected $author = ''; + + /** + * Document keywords. + * @protected + */ + protected $keywords = ''; + + /** + * Document creator. + * @protected + */ + protected $creator = ''; + + /** + * Starting page number. + * @protected + */ + protected $starting_page_number = 1; + + /** + * The right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image. + * @since 2002-07-31 + * @author Nicola Asuni + * @protected + */ + protected $img_rb_x; + + /** + * The right-bottom corner Y coordinate of last inserted image. + * @since 2002-07-31 + * @author Nicola Asuni + * @protected + */ + protected $img_rb_y; + + /** + * Adjusting factor to convert pixels to user units. + * @since 2004-06-14 + * @author Nicola Asuni + * @protected + */ + protected $imgscale = 1; + + /** + * Boolean flag set to true when the input text is unicode (require unicode fonts). + * @since 2005-01-02 + * @author Nicola Asuni + * @protected + */ + protected $isunicode = false; + + /** + * PDF version. + * @since 1.5.3 + * @protected + */ + protected $PDFVersion = '1.7'; + + /** + * ID of the stored default header template (-1 = not set). + * @protected + */ + protected $header_xobjid = false; + + /** + * If true reset the Header Xobject template at each page + * @protected + */ + protected $header_xobj_autoreset = false; + + /** + * Minimum distance between header and top page margin. + * @protected + */ + protected $header_margin; + + /** + * Minimum distance between footer and bottom page margin. + * @protected + */ + protected $footer_margin; + + /** + * Original left margin value. + * @protected + * @since 1.53.0.TC013 + */ + protected $original_lMargin; + + /** + * Original right margin value. + * @protected + * @since 1.53.0.TC013 + */ + protected $original_rMargin; + + /** + * Default font used on page header. + * @protected + * @var array + * @phpstan-var array{0: string, 1: string, 2: float|null} + */ + protected $header_font; + + /** + * Default font used on page footer. + * @protected + * @var array + * @phpstan-var array{0: string, 1: string, 2: float|null} + */ + protected $footer_font; + + /** + * Language templates. + * @protected + */ + protected $l; + + /** + * Barcode to print on page footer (only if set). + * @protected + */ + protected $barcode = false; + + /** + * Boolean flag to print/hide page header. + * @protected + */ + protected $print_header = true; + + /** + * Boolean flag to print/hide page footer. + * @protected + */ + protected $print_footer = true; + + /** + * Header image logo. + * @protected + */ + protected $header_logo = ''; + + /** + * Width of header image logo in user units. + * @protected + */ + protected $header_logo_width = 30; + + /** + * Title to be printed on default page header. + * @protected + */ + protected $header_title = ''; + + /** + * String to print on page header after title. + * @protected + */ + protected $header_string = ''; + + /** + * Color for header text (RGB array). + * @since 5.9.174 (2012-07-25) + * @protected + * @var int[] + * @phpstan-var array{0: int, 1: int, 2: int} + */ + protected $header_text_color = array(0,0,0); + + /** + * Color for header line (RGB array). + * @since 5.9.174 (2012-07-25) + * @protected + * @var int[] + * @phpstan-var array{0: int, 1: int, 2: int} + */ + protected $header_line_color = array(0,0,0); + + /** + * Color for footer text (RGB array). + * @since 5.9.174 (2012-07-25) + * @protected + * @var int[] + * @phpstan-var array{0: int, 1: int, 2: int} + */ + protected $footer_text_color = array(0,0,0); + + /** + * Color for footer line (RGB array). + * @since 5.9.174 (2012-07-25) + * @protected + * @var int[] + * @phpstan-var array{0: int, 1: int, 2: int} + */ + protected $footer_line_color = array(0,0,0); + + /** + * Text shadow data array. + * @since 5.9.174 (2012-07-25) + * @protected + */ + protected $txtshadow = array('enabled'=>false, 'depth_w'=>0, 'depth_h'=>0, 'color'=>false, 'opacity'=>1, 'blend_mode'=>'Normal'); + + /** + * Default number of columns for html table. + * @protected + */ + protected $default_table_columns = 4; + + // variables for html parser + + /** + * HTML PARSER: array to store current link and rendering styles. + * @protected + */ + protected $HREF = array(); + + /** + * List of available fonts on filesystem. + * @protected + */ + protected $fontlist = array(); + + /** + * Current foreground color. + * @protected + */ + protected $fgcolor; + + /** + * HTML PARSER: array of boolean values, true in case of ordered list (OL), false otherwise. + * @protected + */ + protected $listordered = array(); + + /** + * HTML PARSER: array count list items on nested lists. + * @protected + */ + protected $listcount = array(); + + /** + * HTML PARSER: current list nesting level. + * @protected + */ + protected $listnum = 0; + + /** + * HTML PARSER: indent amount for lists. + * @protected + */ + protected $listindent = 0; + + /** + * HTML PARSER: current list indententation level. + * @protected + */ + protected $listindentlevel = 0; + + /** + * Current background color. + * @protected + */ + protected $bgcolor; + + /** + * Temporary font size in points. + * @protected + */ + protected $tempfontsize = 10; + + /** + * Spacer string for LI tags. + * @protected + */ + protected $lispacer = ''; + + /** + * Default encoding. + * @protected + * @since 1.53.0.TC010 + */ + protected $encoding = 'UTF-8'; + + /** + * Boolean flag to indicate if the document language is Right-To-Left. + * @protected + * @since 2.0.000 + */ + protected $rtl = false; + + /** + * Boolean flag used to force RTL or LTR string direction. + * @protected + * @since 2.0.000 + */ + protected $tmprtl = false; + + // --- Variables used for document encryption: + + /** + * IBoolean flag indicating whether document is protected. + * @protected + * @since 2.0.000 (2008-01-02) + */ + protected $encrypted; + + /** + * Array containing encryption settings. + * @protected + * @since 5.0.005 (2010-05-11) + */ + protected $encryptdata = array(); + + /** + * Last RC4 key encrypted (cached for optimisation). + * @protected + * @since 2.0.000 (2008-01-02) + */ + protected $last_enc_key; + + /** + * Last RC4 computed key. + * @protected + * @since 2.0.000 (2008-01-02) + */ + protected $last_enc_key_c; + + /** + * File ID (used on document trailer). + * @protected + * @since 5.0.005 (2010-05-12) + */ + protected $file_id; + + // --- bookmark --- + + /** + * Outlines for bookmark. + * @protected + * @since 2.1.002 (2008-02-12) + */ + protected $outlines = array(); + + /** + * Outline root for bookmark. + * @protected + * @since 2.1.002 (2008-02-12) + */ + protected $OutlineRoot; + + // --- javascript and form --- + + /** + * Javascript code. + * @protected + * @since 2.1.002 (2008-02-12) + */ + protected $javascript = ''; + + /** + * Javascript counter. + * @protected + * @since 2.1.002 (2008-02-12) + */ + protected $n_js; + + /** + * line through state + * @protected + * @since 2.8.000 (2008-03-19) + */ + protected $linethrough; + + /** + * Array with additional document-wide usage rights for the document. + * @protected + * @since 5.8.014 (2010-08-23) + */ + protected $ur = array(); + + /** + * DPI (Dot Per Inch) Document Resolution (do not change). + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected $dpi = 72; + + /** + * Array of page numbers were a new page group was started (the page numbers are the keys of the array). + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected $newpagegroup = array(); + + /** + * Array that contains the number of pages in each page group. + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected $pagegroups = array(); + + /** + * Current page group number. + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected $currpagegroup = 0; + + /** + * Array of transparency objects and parameters. + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected $extgstates; + + /** + * Set the default JPEG compression quality (1-100). + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected $jpeg_quality; + + /** + * Default cell height ratio. + * @protected + * @since 3.0.014 (2008-05-23) + * @var float + */ + protected $cell_height_ratio = K_CELL_HEIGHT_RATIO; + + /** + * PDF viewer preferences. + * @protected + * @since 3.1.000 (2008-06-09) + */ + protected $viewer_preferences; + + /** + * A name object specifying how the document should be displayed when opened. + * @protected + * @since 3.1.000 (2008-06-09) + */ + protected $PageMode; + + /** + * Array for storing gradient information. + * @protected + * @since 3.1.000 (2008-06-09) + */ + protected $gradients = array(); + + /** + * Array used to store positions inside the pages buffer (keys are the page numbers). + * @protected + * @since 3.2.000 (2008-06-26) + */ + protected $intmrk = array(); + + /** + * Array used to store positions inside the pages buffer (keys are the page numbers). + * @protected + * @since 5.7.000 (2010-08-03) + */ + protected $bordermrk = array(); + + /** + * Array used to store page positions to track empty pages (keys are the page numbers). + * @protected + * @since 5.8.007 (2010-08-18) + */ + protected $emptypagemrk = array(); + + /** + * Array used to store content positions inside the pages buffer (keys are the page numbers). + * @protected + * @since 4.6.021 (2009-07-20) + */ + protected $cntmrk = array(); + + /** + * Array used to store footer positions of each page. + * @protected + * @since 3.2.000 (2008-07-01) + */ + protected $footerpos = array(); + + /** + * Array used to store footer length of each page. + * @protected + * @since 4.0.014 (2008-07-29) + */ + protected $footerlen = array(); + + /** + * Boolean flag to indicate if a new line is created. + * @protected + * @since 3.2.000 (2008-07-01) + */ + protected $newline = true; + + /** + * End position of the latest inserted line. + * @protected + * @since 3.2.000 (2008-07-01) + */ + protected $endlinex = 0; + + /** + * PDF string for width value of the last line. + * @protected + * @since 4.0.006 (2008-07-16) + */ + protected $linestyleWidth = ''; + + /** + * PDF string for CAP value of the last line. + * @protected + * @since 4.0.006 (2008-07-16) + */ + protected $linestyleCap = '0 J'; + + /** + * PDF string for join value of the last line. + * @protected + * @since 4.0.006 (2008-07-16) + */ + protected $linestyleJoin = '0 j'; + + /** + * PDF string for dash value of the last line. + * @protected + * @since 4.0.006 (2008-07-16) + */ + protected $linestyleDash = '[] 0 d'; + + /** + * Boolean flag to indicate if marked-content sequence is open. + * @protected + * @since 4.0.013 (2008-07-28) + */ + protected $openMarkedContent = false; + + /** + * Count the latest inserted vertical spaces on HTML. + * @protected + * @since 4.0.021 (2008-08-24) + */ + protected $htmlvspace = 0; + + /** + * Array of Spot colors. + * @protected + * @since 4.0.024 (2008-09-12) + */ + protected $spot_colors = array(); + + /** + * Symbol used for HTML unordered list items. + * @protected + * @since 4.0.028 (2008-09-26) + */ + protected $lisymbol = ''; + + /** + * String used to mark the beginning and end of EPS image blocks. + * @protected + * @since 4.1.000 (2008-10-18) + */ + protected $epsmarker = 'x#!#EPS#!#x'; + + /** + * Array of transformation matrix. + * @protected + * @since 4.2.000 (2008-10-29) + */ + protected $transfmatrix = array(); + + /** + * Current key for transformation matrix. + * @protected + * @since 4.8.005 (2009-09-17) + */ + protected $transfmatrix_key = 0; + + /** + * Booklet mode for double-sided pages. + * @protected + * @since 4.2.000 (2008-10-29) + */ + protected $booklet = false; + + /** + * Epsilon value used for float calculations. + * @protected + * @since 4.2.000 (2008-10-29) + */ + protected $feps = 0.005; + + /** + * Array used for custom vertical spaces for HTML tags. + * @protected + * @since 4.2.001 (2008-10-30) + */ + protected $tagvspaces = array(); + + /** + * HTML PARSER: custom indent amount for lists. Negative value means disabled. + * @protected + * @since 4.2.007 (2008-11-12) + */ + protected $customlistindent = -1; + + /** + * Boolean flag to indicate if the border of the cell sides that cross the page should be removed. + * @protected + * @since 4.2.010 (2008-11-14) + */ + protected $opencell = true; + + /** + * Array of files to embedd. + * @protected + * @since 4.4.000 (2008-12-07) + */ + protected $embeddedfiles = array(); + + /** + * Boolean flag to indicate if we are inside a PRE tag. + * @protected + * @since 4.4.001 (2008-12-08) + */ + protected $premode = false; + + /** + * Array used to store positions of graphics transformation blocks inside the page buffer. + * keys are the page numbers + * @protected + * @since 4.4.002 (2008-12-09) + */ + protected $transfmrk = array(); + + /** + * Default color for html links. + * @protected + * @since 4.4.003 (2008-12-09) + */ + protected $htmlLinkColorArray = array(0, 0, 255); + + /** + * Default font style to add to html links. + * @protected + * @since 4.4.003 (2008-12-09) + */ + protected $htmlLinkFontStyle = 'U'; + + /** + * Counts the number of pages. + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected $numpages = 0; + + /** + * Array containing page lengths in bytes. + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected $pagelen = array(); + + /** + * Counts the number of pages. + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected $numimages = 0; + + /** + * Store the image keys. + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected $imagekeys = array(); + + /** + * Length of the buffer in bytes. + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected $bufferlen = 0; + + /** + * Counts the number of fonts. + * @protected + * @since 4.5.000 (2009-01-02) + */ + protected $numfonts = 0; + + /** + * Store the font keys. + * @protected + * @since 4.5.000 (2009-01-02) + */ + protected $fontkeys = array(); + + /** + * Store the font object IDs. + * @protected + * @since 4.8.001 (2009-09-09) + */ + protected $font_obj_ids = array(); + + /** + * Store the fage status (true when opened, false when closed). + * @protected + * @since 4.5.000 (2009-01-02) + */ + protected $pageopen = array(); + + /** + * Default monospace font. + * @protected + * @since 4.5.025 (2009-03-10) + */ + protected $default_monospaced_font = 'courier'; + + /** + * Cloned copy of the current class object. + * @protected + * @since 4.5.029 (2009-03-19) + */ + protected $objcopy; + + /** + * Array used to store the lengths of cache files. + * @protected + * @since 4.5.029 (2009-03-19) + */ + protected $cache_file_length = array(); + + /** + * Table header content to be repeated on each new page. + * @protected + * @since 4.5.030 (2009-03-20) + */ + protected $thead = ''; + + /** + * Margins used for table header. + * @protected + * @since 4.5.030 (2009-03-20) + */ + protected $theadMargins = array(); + + /** + * Boolean flag to enable document digital signature. + * @protected + * @since 4.6.005 (2009-04-24) + */ + protected $sign = false; + + /** + * Digital signature data. + * @protected + * @since 4.6.005 (2009-04-24) + */ + protected $signature_data = array(); + + /** + * Digital signature max length. + * @protected + * @since 4.6.005 (2009-04-24) + */ + protected $signature_max_length = 11742; + + /** + * Data for digital signature appearance. + * @protected + * @since 5.3.011 (2010-06-16) + */ + protected $signature_appearance = array('page' => 1, 'rect' => '0 0 0 0'); + + /** + * Array of empty digital signature appearances. + * @protected + * @since 5.9.101 (2011-07-06) + */ + protected $empty_signature_appearance = array(); + + /** + * Boolean flag to enable document timestamping with TSA. + * @protected + * @since 6.0.085 (2014-06-19) + */ + protected $tsa_timestamp = false; + + /** + * Timestamping data. + * @protected + * @since 6.0.085 (2014-06-19) + */ + protected $tsa_data = array(); + + /** + * Regular expression used to find blank characters (required for word-wrapping). + * @protected + * @since 4.6.006 (2009-04-28) + */ + protected $re_spaces = '/[^\S\xa0]/'; + + /** + * Array of $re_spaces parts. + * @protected + * @since 5.5.011 (2010-07-09) + */ + protected $re_space = array('p' => '[^\S\xa0]', 'm' => ''); + + /** + * Digital signature object ID. + * @protected + * @since 4.6.022 (2009-06-23) + */ + protected $sig_obj_id = 0; + + /** + * ID of page objects. + * @protected + * @since 4.7.000 (2009-08-29) + */ + protected $page_obj_id = array(); + + /** + * List of form annotations IDs. + * @protected + * @since 4.8.000 (2009-09-07) + */ + protected $form_obj_id = array(); + + /** + * Deafult Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. Annotation options can be directly specified using the 'aopt' entry. + * @protected + * @since 4.8.000 (2009-09-07) + */ + protected $default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128)); + + /** + * Javascript objects array. + * @protected + * @since 4.8.000 (2009-09-07) + */ + protected $js_objects = array(); + + /** + * Current form action (used during XHTML rendering). + * @protected + * @since 4.8.000 (2009-09-07) + */ + protected $form_action = ''; + + /** + * Current form encryption type (used during XHTML rendering). + * @protected + * @since 4.8.000 (2009-09-07) + */ + protected $form_enctype = 'application/x-www-form-urlencoded'; + + /** + * Current method to submit forms. + * @protected + * @since 4.8.000 (2009-09-07) + */ + protected $form_mode = 'post'; + + /** + * List of fonts used on form fields (fontname => fontkey). + * @protected + * @since 4.8.001 (2009-09-09) + */ + protected $annotation_fonts = array(); + + /** + * List of radio buttons parent objects. + * @protected + * @since 4.8.001 (2009-09-09) + */ + protected $radiobutton_groups = array(); + + /** + * List of radio group objects IDs. + * @protected + * @since 4.8.001 (2009-09-09) + */ + protected $radio_groups = array(); + + /** + * Text indentation value (used for text-indent CSS attribute). + * @protected + * @since 4.8.006 (2009-09-23) + */ + protected $textindent = 0; + + /** + * Store page number when startTransaction() is called. + * @protected + * @since 4.8.006 (2009-09-23) + */ + protected $start_transaction_page = 0; + + /** + * Store Y position when startTransaction() is called. + * @protected + * @since 4.9.001 (2010-03-28) + */ + protected $start_transaction_y = 0; + + /** + * True when we are printing the thead section on a new page. + * @protected + * @since 4.8.027 (2010-01-25) + */ + protected $inthead = false; + + /** + * Array of column measures (width, space, starting Y position). + * @protected + * @since 4.9.001 (2010-03-28) + */ + protected $columns = array(); + + /** + * Number of colums. + * @protected + * @since 4.9.001 (2010-03-28) + */ + protected $num_columns = 1; + + /** + * Current column number. + * @protected + * @since 4.9.001 (2010-03-28) + */ + protected $current_column = 0; + + /** + * Starting page for columns. + * @protected + * @since 4.9.001 (2010-03-28) + */ + protected $column_start_page = 0; + + /** + * Maximum page and column selected. + * @protected + * @since 5.8.000 (2010-08-11) + */ + protected $maxselcol = array('page' => 0, 'column' => 0); + + /** + * Array of: X difference between table cell x start and starting page margin, cellspacing, cellpadding. + * @protected + * @since 5.8.000 (2010-08-11) + */ + protected $colxshift = array('x' => 0, 's' => array('H' => 0, 'V' => 0), 'p' => array('L' => 0, 'T' => 0, 'R' => 0, 'B' => 0)); + + /** + * Text rendering mode: 0 = Fill text; 1 = Stroke text; 2 = Fill, then stroke text; 3 = Neither fill nor stroke text (invisible); 4 = Fill text and add to path for clipping; 5 = Stroke text and add to path for clipping; 6 = Fill, then stroke text and add to path for clipping; 7 = Add text to path for clipping. + * @protected + * @since 4.9.008 (2010-04-03) + */ + protected $textrendermode = 0; + + /** + * Text stroke width in doc units. + * @protected + * @since 4.9.008 (2010-04-03) + */ + protected $textstrokewidth = 0; + + /** + * Current stroke color. + * @protected + * @since 4.9.008 (2010-04-03) + */ + protected $strokecolor; + + /** + * Default unit of measure for document. + * @protected + * @since 5.0.000 (2010-04-22) + */ + protected $pdfunit = 'mm'; + + /** + * Boolean flag true when we are on TOC (Table Of Content) page. + * @protected + */ + protected $tocpage = false; + + /** + * Boolean flag: if true convert vector images (SVG, EPS) to raster image using GD or ImageMagick library. + * @protected + * @since 5.0.000 (2010-04-26) + */ + protected $rasterize_vector_images = false; + + /** + * Boolean flag: if true enables font subsetting by default. + * @protected + * @since 5.3.002 (2010-06-07) + */ + protected $font_subsetting = true; + + /** + * Array of default graphic settings. + * @protected + * @since 5.5.008 (2010-07-02) + */ + protected $default_graphic_vars = array(); + + /** + * Array of XObjects. + * @protected + * @since 5.8.014 (2010-08-23) + */ + protected $xobjects = array(); + + /** + * Boolean value true when we are inside an XObject. + * @protected + * @since 5.8.017 (2010-08-24) + */ + protected $inxobj = false; + + /** + * Current XObject ID. + * @protected + * @since 5.8.017 (2010-08-24) + */ + protected $xobjid = ''; + + /** + * Percentage of character stretching. + * @protected + * @since 5.9.000 (2010-09-29) + */ + protected $font_stretching = 100; + + /** + * Increases or decreases the space between characters in a text by the specified amount (tracking). + * @protected + * @since 5.9.000 (2010-09-29) + */ + protected $font_spacing = 0; + + /** + * Array of no-write regions. + * ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right) + * @protected + * @since 5.9.003 (2010-10-14) + */ + protected $page_regions = array(); + + /** + * Boolean value true when page region check is active. + * @protected + */ + protected $check_page_regions = true; + + /** + * Array of PDF layers data. + * @protected + * @since 5.9.102 (2011-07-13) + */ + protected $pdflayers = array(); + + /** + * A dictionary of names and corresponding destinations (Dests key on document Catalog). + * @protected + * @since 5.9.097 (2011-06-23) + */ + protected $dests = array(); + + /** + * Object ID for Named Destinations + * @protected + * @since 5.9.097 (2011-06-23) + */ + protected $n_dests; + + /** + * Embedded Files Names + * @protected + * @since 5.9.204 (2013-01-23) + */ + protected $efnames = array(); + + /** + * Directory used for the last SVG image. + * @protected + * @since 5.0.000 (2010-05-05) + */ + protected $svgdir = ''; + + /** + * Deafult unit of measure for SVG. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svgunit = 'px'; + + /** + * Array of SVG gradients. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svggradients = array(); + + /** + * ID of last SVG gradient. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svggradientid = 0; + + /** + * Boolean value true when in SVG defs group. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svgdefsmode = false; + + /** + * Array of SVG defs. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svgdefs = array(); + + /** + * Boolean value true when in SVG clipPath tag. + * @protected + * @since 5.0.000 (2010-04-26) + */ + protected $svgclipmode = false; + + /** + * Array of SVG clipPath commands. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svgclippaths = array(); + + /** + * Array of SVG clipPath tranformation matrix. + * @protected + * @since 5.8.022 (2010-08-31) + */ + protected $svgcliptm = array(); + + /** + * ID of last SVG clipPath. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svgclipid = 0; + + /** + * SVG text. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svgtext = ''; + + /** + * SVG text properties. + * @protected + * @since 5.8.013 (2010-08-23) + */ + protected $svgtextmode = array(); + + /** + * Array of SVG properties. + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected $svgstyles = array(array( + 'alignment-baseline' => 'auto', + 'baseline-shift' => 'baseline', + 'clip' => 'auto', + 'clip-path' => 'none', + 'clip-rule' => 'nonzero', + 'color' => 'black', + 'color-interpolation' => 'sRGB', + 'color-interpolation-filters' => 'linearRGB', + 'color-profile' => 'auto', + 'color-rendering' => 'auto', + 'cursor' => 'auto', + 'direction' => 'ltr', + 'display' => 'inline', + 'dominant-baseline' => 'auto', + 'enable-background' => 'accumulate', + 'fill' => 'black', + 'fill-opacity' => 1, + 'fill-rule' => 'nonzero', + 'filter' => 'none', + 'flood-color' => 'black', + 'flood-opacity' => 1, + 'font' => '', + 'font-family' => 'helvetica', + 'font-size' => 'medium', + 'font-size-adjust' => 'none', + 'font-stretch' => 'normal', + 'font-style' => 'normal', + 'font-variant' => 'normal', + 'font-weight' => 'normal', + 'glyph-orientation-horizontal' => '0deg', + 'glyph-orientation-vertical' => 'auto', + 'image-rendering' => 'auto', + 'kerning' => 'auto', + 'letter-spacing' => 'normal', + 'lighting-color' => 'white', + 'marker' => '', + 'marker-end' => 'none', + 'marker-mid' => 'none', + 'marker-start' => 'none', + 'mask' => 'none', + 'opacity' => 1, + 'overflow' => 'auto', + 'pointer-events' => 'visiblePainted', + 'shape-rendering' => 'auto', + 'stop-color' => 'black', + 'stop-opacity' => 1, + 'stroke' => 'none', + 'stroke-dasharray' => 'none', + 'stroke-dashoffset' => 0, + 'stroke-linecap' => 'butt', + 'stroke-linejoin' => 'miter', + 'stroke-miterlimit' => 4, + 'stroke-opacity' => 1, + 'stroke-width' => 1, + 'text-anchor' => 'start', + 'text-decoration' => 'none', + 'text-rendering' => 'auto', + 'unicode-bidi' => 'normal', + 'visibility' => 'visible', + 'word-spacing' => 'normal', + 'writing-mode' => 'lr-tb', + 'text-color' => 'black', + 'transfmatrix' => array(1, 0, 0, 1, 0, 0) + )); + + /** + * If true force sRGB color profile for all document. + * @protected + * @since 5.9.121 (2011-09-28) + */ + protected $force_srgb = false; + + /** + * If true set the document to PDF/A mode. + * @protected + * @since 5.9.121 (2011-09-27) + */ + protected $pdfa_mode = false; + + /** + * version of PDF/A mode (1 - 3). + * @protected + * @since 6.2.26 (2019-03-12) + */ + protected $pdfa_version = 1; + + /** + * Document creation date-time + * @protected + * @since 5.9.152 (2012-03-22) + */ + protected $doc_creation_timestamp; + + /** + * Document modification date-time + * @protected + * @since 5.9.152 (2012-03-22) + */ + protected $doc_modification_timestamp; + + /** + * Custom XMP data. + * @protected + * @since 5.9.128 (2011-10-06) + */ + protected $custom_xmp = ''; + + /** + * Custom XMP RDF data. + * @protected + * @since 6.3.0 (2019-09-19) + */ + protected $custom_xmp_rdf = ''; + + /** + * Overprint mode array. + * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). + * @protected + * @since 5.9.152 (2012-03-23) + * @var array + */ + protected $overprint = array('OP' => false, 'op' => false, 'OPM' => 0); + + /** + * Alpha mode array. + * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). + * @protected + * @since 5.9.152 (2012-03-23) + */ + protected $alpha = array('CA' => 1, 'ca' => 1, 'BM' => '/Normal', 'AIS' => false); + + /** + * Define the page boundaries boxes to be set on document. + * @protected + * @since 5.9.152 (2012-03-23) + */ + protected $page_boxes = array('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'); + + /** + * If true print TCPDF meta link. + * @protected + * @since 5.9.152 (2012-03-23) + */ + protected $tcpdflink = true; + + /** + * Cache array for computed GD gamma values. + * @protected + * @since 5.9.1632 (2012-06-05) + */ + protected $gdgammacache = array(); + + /** + * Cache array for file content + * @protected + * @var array + * @since 6.3.5 (2020-09-28) + */ + protected $fileContentCache = array(); + + /** + * Whether to allow local file path in image html tags, when prefixed with file:// + * + * @var bool + * @protected + * @since 6.4 (2020-07-23) + */ + protected $allowLocalFiles = false; + + //------------------------------------------------------------ + // METHODS + //------------------------------------------------------------ + + /** + * This is the class constructor. + * It allows to set up the page format, the orientation and the measure unit used in all the methods (except for the font sizes). + * + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or Portrait (default)
        • L or Landscape
        • '' (empty string) for automatic orientation
        + * @param string $unit User measure unit. Possible values are:
        • pt: point
        • mm: millimeter (default)
        • cm: centimeter
        • in: inch

        A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit. + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param boolean $unicode TRUE means that the input text is unicode (default = true) + * @param string $encoding Charset encoding (used only when converting back html entities); default is UTF-8. + * @param boolean $diskcache DEPRECATED FEATURE + * @param false|integer $pdfa If not false, set the document to PDF/A mode and the good version (1 or 3). + * @public + * @see getPageSizeFromFormat(), setPageFormat() + */ + public function __construct($orientation='P', $unit='mm', $format='A4', $unicode=true, $encoding='UTF-8', $diskcache=false, $pdfa=false) { + // set file ID for trailer + $serformat = (is_array($format) ? json_encode($format) : $format); + $this->file_id = md5(TCPDF_STATIC::getRandomSeed('TCPDF'.$orientation.$unit.$serformat.$encoding)); + $this->font_obj_ids = array(); + $this->page_obj_id = array(); + $this->form_obj_id = array(); + + // set pdf/a mode + if ($pdfa != false) { + $this->pdfa_mode = true; + $this->pdfa_version = $pdfa; // 1 or 3 + } else + $this->pdfa_mode = false; + + $this->force_srgb = false; + // set language direction + $this->rtl = false; + $this->tmprtl = false; + // some checks + $this->_dochecks(); + // initialization of properties + $this->isunicode = $unicode; + $this->page = 0; + $this->transfmrk[0] = array(); + $this->pagedim = array(); + $this->n = 2; + $this->buffer = ''; + $this->pages = array(); + $this->state = 0; + $this->fonts = array(); + $this->FontFiles = array(); + $this->diffs = array(); + $this->images = array(); + $this->links = array(); + $this->gradients = array(); + $this->InFooter = false; + $this->lasth = 0; + $this->FontFamily = defined('PDF_FONT_NAME_MAIN')?PDF_FONT_NAME_MAIN:'helvetica'; + $this->FontStyle = ''; + $this->FontSizePt = 12; + $this->underline = false; + $this->overline = false; + $this->linethrough = false; + $this->DrawColor = '0 G'; + $this->FillColor = '0 g'; + $this->TextColor = '0 g'; + $this->ColorFlag = false; + $this->pdflayers = array(); + // encryption values + $this->encrypted = false; + $this->last_enc_key = ''; + // standard Unicode fonts + $this->CoreFonts = array( + 'courier'=>'Courier', + 'courierB'=>'Courier-Bold', + 'courierI'=>'Courier-Oblique', + 'courierBI'=>'Courier-BoldOblique', + 'helvetica'=>'Helvetica', + 'helveticaB'=>'Helvetica-Bold', + 'helveticaI'=>'Helvetica-Oblique', + 'helveticaBI'=>'Helvetica-BoldOblique', + 'times'=>'Times-Roman', + 'timesB'=>'Times-Bold', + 'timesI'=>'Times-Italic', + 'timesBI'=>'Times-BoldItalic', + 'symbol'=>'Symbol', + 'zapfdingbats'=>'ZapfDingbats' + ); + // set scale factor + $this->setPageUnit($unit); + // set page format and orientation + $this->setPageFormat($format, $orientation); + // page margins (1 cm) + $margin = 28.35 / $this->k; + $this->setMargins($margin, $margin); + $this->clMargin = $this->lMargin; + $this->crMargin = $this->rMargin; + // internal cell padding + $cpadding = $margin / 10; + $this->setCellPaddings($cpadding, 0, $cpadding, 0); + // cell margins + $this->setCellMargins(0, 0, 0, 0); + // line width (0.2 mm) + $this->LineWidth = 0.57 / $this->k; + $this->linestyleWidth = sprintf('%F w', ($this->LineWidth * $this->k)); + $this->linestyleCap = '0 J'; + $this->linestyleJoin = '0 j'; + $this->linestyleDash = '[] 0 d'; + // automatic page break + $this->setAutoPageBreak(true, (2 * $margin)); + // full width display mode + $this->setDisplayMode('fullwidth'); + // compression + $this->setCompression(); + // set default PDF version number + $this->setPDFVersion(); + $this->tcpdflink = true; + $this->encoding = $encoding; + $this->HREF = array(); + $this->getFontsList(); + $this->fgcolor = array('R' => 0, 'G' => 0, 'B' => 0); + $this->strokecolor = array('R' => 0, 'G' => 0, 'B' => 0); + $this->bgcolor = array('R' => 255, 'G' => 255, 'B' => 255); + $this->extgstates = array(); + $this->setTextShadow(); + // signature + $this->sign = false; + $this->tsa_timestamp = false; + $this->tsa_data = array(); + $this->signature_appearance = array('page' => 1, 'rect' => '0 0 0 0', 'name' => 'Signature'); + $this->empty_signature_appearance = array(); + // user's rights + $this->ur['enabled'] = false; + $this->ur['document'] = '/FullSave'; + $this->ur['annots'] = '/Create/Delete/Modify/Copy/Import/Export'; + $this->ur['form'] = '/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate'; + $this->ur['signature'] = '/Modify'; + $this->ur['ef'] = '/Create/Delete/Modify/Import'; + $this->ur['formex'] = ''; + // set default JPEG quality + $this->jpeg_quality = 75; + // initialize some settings + TCPDF_FONTS::utf8Bidi(array(), '', false, $this->isunicode, $this->CurrentFont); + // set default font + $this->setFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); + $this->setHeaderFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt)); + $this->setFooterFont(array($this->FontFamily, $this->FontStyle, $this->FontSizePt)); + // check if PCRE Unicode support is enabled + if ($this->isunicode AND (@preg_match('/\pL/u', 'a') == 1)) { + // PCRE unicode support is turned ON + // \s : any whitespace character + // \p{Z} : any separator + // \p{Lo} : Unicode letter or ideograph that does not have lowercase and uppercase variants. Is used to chunk chinese words. + // \xa0 : Unicode Character 'NO-BREAK SPACE' (U+00A0) + //$this->setSpacesRE('/(?!\xa0)[\s\p{Z}\p{Lo}]/u'); + $this->setSpacesRE('/(?!\xa0)[\s\p{Z}]/u'); + } else { + // PCRE unicode support is turned OFF + $this->setSpacesRE('/[^\S\xa0]/'); + } + $this->default_form_prop = array('lineWidth'=>1, 'borderStyle'=>'solid', 'fillColor'=>array(255, 255, 255), 'strokeColor'=>array(128, 128, 128)); + // set document creation and modification timestamp + $this->doc_creation_timestamp = time(); + $this->doc_modification_timestamp = $this->doc_creation_timestamp; + // get default graphic vars + $this->default_graphic_vars = $this->getGraphicVars(); + $this->header_xobj_autoreset = false; + $this->custom_xmp = ''; + $this->custom_xmp_rdf = ''; + } + + /** + * Default destructor. + * @public + * @since 1.53.0.TC016 + */ + public function __destruct() { + // cleanup + $this->_destroy(true); + } + + /** + * Set the units of measure for the document. + * @param string $unit User measure unit. Possible values are:
        • pt: point
        • mm: millimeter (default)
        • cm: centimeter
        • in: inch

        A point equals 1/72 of inch, that is to say about 0.35 mm (an inch being 2.54 cm). This is a very common unit in typography; font sizes are expressed in that unit. + * @public + * @since 3.0.015 (2008-06-06) + */ + public function setPageUnit($unit) { + $unit = strtolower($unit); + //Set scale factor + switch ($unit) { + // points + case 'px': + case 'pt': { + $this->k = 1; + break; + } + // millimeters + case 'mm': { + $this->k = $this->dpi / 25.4; + break; + } + // centimeters + case 'cm': { + $this->k = $this->dpi / 2.54; + break; + } + // inches + case 'in': { + $this->k = $this->dpi; + break; + } + // unsupported unit + default : { + $this->Error('Incorrect unit: '.$unit); + break; + } + } + $this->pdfunit = $unit; + if (isset($this->CurOrientation)) { + $this->setPageOrientation($this->CurOrientation); + } + } + + /** + * Change the format of the current page + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() documentation or an array of two numbers (width, height) or an array containing the following measures and options:
          + *
        • ['format'] = page format name (one of the above);
        • + *
        • ['Rotate'] : The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.
        • + *
        • ['PZ'] : The page's preferred zoom (magnification) factor.
        • + *
        • ['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed:
        • + *
        • ['MediaBox']['llx'] : lower-left x coordinate
        • + *
        • ['MediaBox']['lly'] : lower-left y coordinate
        • + *
        • ['MediaBox']['urx'] : upper-right x coordinate
        • + *
        • ['MediaBox']['ury'] : upper-right y coordinate
        • + *
        • ['CropBox'] : the visible region of default user space:
        • + *
        • ['CropBox']['llx'] : lower-left x coordinate
        • + *
        • ['CropBox']['lly'] : lower-left y coordinate
        • + *
        • ['CropBox']['urx'] : upper-right x coordinate
        • + *
        • ['CropBox']['ury'] : upper-right y coordinate
        • + *
        • ['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment:
        • + *
        • ['BleedBox']['llx'] : lower-left x coordinate
        • + *
        • ['BleedBox']['lly'] : lower-left y coordinate
        • + *
        • ['BleedBox']['urx'] : upper-right x coordinate
        • + *
        • ['BleedBox']['ury'] : upper-right y coordinate
        • + *
        • ['TrimBox'] : the intended dimensions of the finished page after trimming:
        • + *
        • ['TrimBox']['llx'] : lower-left x coordinate
        • + *
        • ['TrimBox']['lly'] : lower-left y coordinate
        • + *
        • ['TrimBox']['urx'] : upper-right x coordinate
        • + *
        • ['TrimBox']['ury'] : upper-right y coordinate
        • + *
        • ['ArtBox'] : the extent of the page's meaningful content:
        • + *
        • ['ArtBox']['llx'] : lower-left x coordinate
        • + *
        • ['ArtBox']['lly'] : lower-left y coordinate
        • + *
        • ['ArtBox']['urx'] : upper-right x coordinate
        • + *
        • ['ArtBox']['ury'] : upper-right y coordinate
        • + *
        • ['BoxColorInfo'] :specify the colours and other visual characteristics that should be used in displaying guidelines on the screen for each of the possible page boundaries other than the MediaBox:
        • + *
        • ['BoxColorInfo'][BOXTYPE]['C'] : an array of three numbers in the range 0-255, representing the components in the DeviceRGB colour space.
        • + *
        • ['BoxColorInfo'][BOXTYPE]['W'] : the guideline width in default user units
        • + *
        • ['BoxColorInfo'][BOXTYPE]['S'] : the guideline style: S = Solid; D = Dashed
        • + *
        • ['BoxColorInfo'][BOXTYPE]['D'] : dash array defining a pattern of dashes and gaps to be used in drawing dashed guidelines
        • + *
        • ['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation
        • + *
        • ['trans']['Dur'] : The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.
        • + *
        • ['trans']['S'] : transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade
        • + *
        • ['trans']['D'] : The duration of the transition effect, in seconds.
        • + *
        • ['trans']['Dm'] : (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.
        • + *
        • ['trans']['M'] : (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.
        • + *
        • ['trans']['Di'] : (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.
        • + *
        • ['trans']['SS'] : (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.
        • + *
        • ['trans']['B'] : (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.
        • + *
        + * @param string $orientation page orientation. Possible values are (case insensitive):
          + *
        • P or Portrait (default)
        • + *
        • L or Landscape
        • + *
        • '' (empty string) for automatic orientation
        • + *
        + * @protected + * @since 3.0.015 (2008-06-06) + * @see getPageSizeFromFormat() + */ + protected function setPageFormat($format, $orientation='P') { + if (!empty($format) AND isset($this->pagedim[$this->page])) { + // remove inherited values + unset($this->pagedim[$this->page]); + } + if (is_string($format)) { + // get page measures from format name + $pf = TCPDF_STATIC::getPageSizeFromFormat($format); + $this->fwPt = $pf[0]; + $this->fhPt = $pf[1]; + } else { + // the boundaries of the physical medium on which the page shall be displayed or printed + if (isset($format['MediaBox'])) { + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'MediaBox', $format['MediaBox']['llx'], $format['MediaBox']['lly'], $format['MediaBox']['urx'], $format['MediaBox']['ury'], false, $this->k, $this->pagedim); + $this->fwPt = (($format['MediaBox']['urx'] - $format['MediaBox']['llx']) * $this->k); + $this->fhPt = (($format['MediaBox']['ury'] - $format['MediaBox']['lly']) * $this->k); + } else { + if (isset($format[0]) AND is_numeric($format[0]) AND isset($format[1]) AND is_numeric($format[1])) { + $pf = array(($format[0] * $this->k), ($format[1] * $this->k)); + } else { + if (!isset($format['format'])) { + // default value + $format['format'] = 'A4'; + } + $pf = TCPDF_STATIC::getPageSizeFromFormat($format['format']); + } + $this->fwPt = $pf[0]; + $this->fhPt = $pf[1]; + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'MediaBox', 0, 0, $this->fwPt, $this->fhPt, true, $this->k, $this->pagedim); + } + // the visible region of default user space + if (isset($format['CropBox'])) { + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'CropBox', $format['CropBox']['llx'], $format['CropBox']['lly'], $format['CropBox']['urx'], $format['CropBox']['ury'], false, $this->k, $this->pagedim); + } + // the region to which the contents of the page shall be clipped when output in a production environment + if (isset($format['BleedBox'])) { + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'BleedBox', $format['BleedBox']['llx'], $format['BleedBox']['lly'], $format['BleedBox']['urx'], $format['BleedBox']['ury'], false, $this->k, $this->pagedim); + } + // the intended dimensions of the finished page after trimming + if (isset($format['TrimBox'])) { + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'TrimBox', $format['TrimBox']['llx'], $format['TrimBox']['lly'], $format['TrimBox']['urx'], $format['TrimBox']['ury'], false, $this->k, $this->pagedim); + } + // the page's meaningful content (including potential white space) + if (isset($format['ArtBox'])) { + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'ArtBox', $format['ArtBox']['llx'], $format['ArtBox']['lly'], $format['ArtBox']['urx'], $format['ArtBox']['ury'], false, $this->k, $this->pagedim); + } + // specify the colours and other visual characteristics that should be used in displaying guidelines on the screen for the various page boundaries + if (isset($format['BoxColorInfo'])) { + $this->pagedim[$this->page]['BoxColorInfo'] = $format['BoxColorInfo']; + } + if (isset($format['Rotate']) AND (($format['Rotate'] % 90) == 0)) { + // The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90. + $this->pagedim[$this->page]['Rotate'] = intval($format['Rotate']); + } + if (isset($format['PZ'])) { + // The page's preferred zoom (magnification) factor + $this->pagedim[$this->page]['PZ'] = floatval($format['PZ']); + } + if (isset($format['trans'])) { + // The style and duration of the visual transition to use when moving from another page to the given page during a presentation + if (isset($format['trans']['Dur'])) { + // The page's display duration + $this->pagedim[$this->page]['trans']['Dur'] = floatval($format['trans']['Dur']); + } + $stansition_styles = array('Split', 'Blinds', 'Box', 'Wipe', 'Dissolve', 'Glitter', 'R', 'Fly', 'Push', 'Cover', 'Uncover', 'Fade'); + if (isset($format['trans']['S']) AND in_array($format['trans']['S'], $stansition_styles)) { + // The transition style that shall be used when moving to this page from another during a presentation + $this->pagedim[$this->page]['trans']['S'] = $format['trans']['S']; + $valid_effect = array('Split', 'Blinds'); + $valid_vals = array('H', 'V'); + if (isset($format['trans']['Dm']) AND in_array($format['trans']['S'], $valid_effect) AND in_array($format['trans']['Dm'], $valid_vals)) { + $this->pagedim[$this->page]['trans']['Dm'] = $format['trans']['Dm']; + } + $valid_effect = array('Split', 'Box', 'Fly'); + $valid_vals = array('I', 'O'); + if (isset($format['trans']['M']) AND in_array($format['trans']['S'], $valid_effect) AND in_array($format['trans']['M'], $valid_vals)) { + $this->pagedim[$this->page]['trans']['M'] = $format['trans']['M']; + } + $valid_effect = array('Wipe', 'Glitter', 'Fly', 'Cover', 'Uncover', 'Push'); + if (isset($format['trans']['Di']) AND in_array($format['trans']['S'], $valid_effect)) { + if (((($format['trans']['Di'] == 90) OR ($format['trans']['Di'] == 180)) AND ($format['trans']['S'] == 'Wipe')) + OR (($format['trans']['Di'] == 315) AND ($format['trans']['S'] == 'Glitter')) + OR (($format['trans']['Di'] == 0) OR ($format['trans']['Di'] == 270))) { + $this->pagedim[$this->page]['trans']['Di'] = intval($format['trans']['Di']); + } + } + if (isset($format['trans']['SS']) AND ($format['trans']['S'] == 'Fly')) { + $this->pagedim[$this->page]['trans']['SS'] = floatval($format['trans']['SS']); + } + if (isset($format['trans']['B']) AND ($format['trans']['B'] === true) AND ($format['trans']['S'] == 'Fly')) { + $this->pagedim[$this->page]['trans']['B'] = 'true'; + } + } else { + $this->pagedim[$this->page]['trans']['S'] = 'R'; + } + if (isset($format['trans']['D'])) { + // The duration of the transition effect, in seconds + $this->pagedim[$this->page]['trans']['D'] = floatval($format['trans']['D']); + } else { + $this->pagedim[$this->page]['trans']['D'] = 1; + } + } + } + $this->setPageOrientation($orientation); + } + + /** + * Set page orientation. + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or Portrait (default)
        • L or Landscape
        • '' (empty string) for automatic orientation
        + * @param boolean|null $autopagebreak Boolean indicating if auto-page-break mode should be on or off. + * @param float|null $bottommargin bottom margin of the page. + * @public + * @since 3.0.015 (2008-06-06) + */ + public function setPageOrientation($orientation, $autopagebreak=null, $bottommargin=null) { + if (!isset($this->pagedim[$this->page]['MediaBox'])) { + // the boundaries of the physical medium on which the page shall be displayed or printed + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'MediaBox', 0, 0, $this->fwPt, $this->fhPt, true, $this->k, $this->pagedim); + } + if (!isset($this->pagedim[$this->page]['CropBox'])) { + // the visible region of default user space + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'CropBox', $this->pagedim[$this->page]['MediaBox']['llx'], $this->pagedim[$this->page]['MediaBox']['lly'], $this->pagedim[$this->page]['MediaBox']['urx'], $this->pagedim[$this->page]['MediaBox']['ury'], true, $this->k, $this->pagedim); + } + if (!isset($this->pagedim[$this->page]['BleedBox'])) { + // the region to which the contents of the page shall be clipped when output in a production environment + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'BleedBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true, $this->k, $this->pagedim); + } + if (!isset($this->pagedim[$this->page]['TrimBox'])) { + // the intended dimensions of the finished page after trimming + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'TrimBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true, $this->k, $this->pagedim); + } + if (!isset($this->pagedim[$this->page]['ArtBox'])) { + // the page's meaningful content (including potential white space) + $this->pagedim = TCPDF_STATIC::setPageBoxes($this->page, 'ArtBox', $this->pagedim[$this->page]['CropBox']['llx'], $this->pagedim[$this->page]['CropBox']['lly'], $this->pagedim[$this->page]['CropBox']['urx'], $this->pagedim[$this->page]['CropBox']['ury'], true, $this->k, $this->pagedim); + } + if (!isset($this->pagedim[$this->page]['Rotate'])) { + // The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90. + $this->pagedim[$this->page]['Rotate'] = 0; + } + if (!isset($this->pagedim[$this->page]['PZ'])) { + // The page's preferred zoom (magnification) factor + $this->pagedim[$this->page]['PZ'] = 1; + } + if ($this->fwPt > $this->fhPt) { + // landscape + $default_orientation = 'L'; + } else { + // portrait + $default_orientation = 'P'; + } + $valid_orientations = array('P', 'L'); + if (empty($orientation)) { + $orientation = $default_orientation; + } else { + $orientation = strtoupper($orientation[0]); + } + if (in_array($orientation, $valid_orientations) AND ($orientation != $default_orientation)) { + $this->CurOrientation = $orientation; + $this->wPt = $this->fhPt; + $this->hPt = $this->fwPt; + } else { + $this->CurOrientation = $default_orientation; + $this->wPt = $this->fwPt; + $this->hPt = $this->fhPt; + } + if ((abs($this->pagedim[$this->page]['MediaBox']['urx'] - $this->hPt) < $this->feps) AND (abs($this->pagedim[$this->page]['MediaBox']['ury'] - $this->wPt) < $this->feps)){ + // swap X and Y coordinates (change page orientation) + $this->pagedim = TCPDF_STATIC::swapPageBoxCoordinates($this->page, $this->pagedim); + } + $this->w = ($this->wPt / $this->k); + $this->h = ($this->hPt / $this->k); + if (TCPDF_STATIC::empty_string($autopagebreak)) { + if (isset($this->AutoPageBreak)) { + $autopagebreak = $this->AutoPageBreak; + } else { + $autopagebreak = true; + } + } + if (TCPDF_STATIC::empty_string($bottommargin)) { + if (isset($this->bMargin)) { + $bottommargin = $this->bMargin; + } else { + // default value = 2 cm + $bottommargin = 2 * 28.35 / $this->k; + } + } + $this->setAutoPageBreak($autopagebreak, $bottommargin); + // store page dimensions + $this->pagedim[$this->page]['w'] = $this->wPt; + $this->pagedim[$this->page]['h'] = $this->hPt; + $this->pagedim[$this->page]['wk'] = $this->w; + $this->pagedim[$this->page]['hk'] = $this->h; + $this->pagedim[$this->page]['tm'] = $this->tMargin; + $this->pagedim[$this->page]['bm'] = $bottommargin; + $this->pagedim[$this->page]['lm'] = $this->lMargin; + $this->pagedim[$this->page]['rm'] = $this->rMargin; + $this->pagedim[$this->page]['pb'] = $autopagebreak; + $this->pagedim[$this->page]['or'] = $this->CurOrientation; + $this->pagedim[$this->page]['olm'] = $this->original_lMargin; + $this->pagedim[$this->page]['orm'] = $this->original_rMargin; + } + + /** + * Set regular expression to detect withespaces or word separators. + * The pattern delimiter must be the forward-slash character "/". + * Some example patterns are: + *
        +	 * Non-Unicode or missing PCRE unicode support: "/[^\S\xa0]/"
        +	 * Unicode and PCRE unicode support: "/(?!\xa0)[\s\p{Z}]/u"
        +	 * Unicode and PCRE unicode support in Chinese mode: "/(?!\xa0)[\s\p{Z}\p{Lo}]/u"
        +	 * if PCRE unicode support is turned ON ("\P" is the negate class of "\p"):
        +	 *      \s     : any whitespace character
        +	 *      \p{Z}  : any separator
        +	 *      \p{Lo} : Unicode letter or ideograph that does not have lowercase and uppercase variants. Is used to chunk chinese words.
        +	 *      \xa0   : Unicode Character 'NO-BREAK SPACE' (U+00A0)
        +	 * 
        + * @param string $re regular expression (leave empty for default). + * @public + * @since 4.6.016 (2009-06-15) + */ + public function setSpacesRE($re='/[^\S\xa0]/') { + $this->re_spaces = $re; + $re_parts = explode('/', $re); + // get pattern parts + $this->re_space = array(); + if (isset($re_parts[1]) AND !empty($re_parts[1])) { + $this->re_space['p'] = $re_parts[1]; + } else { + $this->re_space['p'] = '[\s]'; + } + // set pattern modifiers + if (isset($re_parts[2]) AND !empty($re_parts[2])) { + $this->re_space['m'] = $re_parts[2]; + } else { + $this->re_space['m'] = ''; + } + } + + /** + * Enable or disable Right-To-Left language mode + * @param boolean $enable if true enable Right-To-Left language mode. + * @param boolean $resetx if true reset the X position on direction change. + * @public + * @since 2.0.000 (2008-01-03) + */ + public function setRTL($enable, $resetx=true) { + $enable = $enable ? true : false; + $resetx = ($resetx AND ($enable != $this->rtl)); + $this->rtl = $enable; + $this->tmprtl = false; + if ($resetx) { + $this->Ln(0); + } + } + + /** + * Return the RTL status + * @return bool + * @public + * @since 4.0.012 (2008-07-24) + */ + public function getRTL() { + return $this->rtl; + } + + /** + * Force temporary RTL language direction + * @param false|string $mode can be false, 'L' for LTR or 'R' for RTL + * @public + * @since 2.1.000 (2008-01-09) + */ + public function setTempRTL($mode) { + $newmode = false; + switch (strtoupper($mode)) { + case 'LTR': + case 'L': { + if ($this->rtl) { + $newmode = 'L'; + } + break; + } + case 'RTL': + case 'R': { + if (!$this->rtl) { + $newmode = 'R'; + } + break; + } + case false: + default: { + $newmode = false; + break; + } + } + $this->tmprtl = $newmode; + } + + /** + * Return the current temporary RTL status + * @return bool + * @public + * @since 4.8.014 (2009-11-04) + */ + public function isRTLTextDir() { + return ($this->rtl OR ($this->tmprtl == 'R')); + } + + /** + * Set the last cell height. + * @param float $h cell height. + * @author Nicola Asuni + * @public + * @since 1.53.0.TC034 + */ + public function setLastH($h) { + $this->lasth = $h; + } + + /** + * Return the cell height + * @param int $fontsize Font size in internal units + * @param boolean $padding If true add cell padding + * @public + * @return float + */ + public function getCellHeight($fontsize, $padding=TRUE) { + $height = ($fontsize * $this->cell_height_ratio); + if ($padding) { + $height += ($this->cell_padding['T'] + $this->cell_padding['B']); + } + return round($height, 6); + } + + /** + * Reset the last cell height. + * @public + * @since 5.9.000 (2010-10-03) + */ + public function resetLastH() { + $this->lasth = $this->getCellHeight($this->FontSize); + } + + /** + * Get the last cell height. + * @return float last cell height + * @public + * @since 4.0.017 (2008-08-05) + */ + public function getLastH() { + return $this->lasth; + } + + /** + * Set the adjusting factor to convert pixels to user units. + * @param float $scale adjusting factor to convert pixels to user units. + * @author Nicola Asuni + * @public + * @since 1.5.2 + */ + public function setImageScale($scale) { + $this->imgscale = $scale; + } + + /** + * Returns the adjusting factor to convert pixels to user units. + * @return float adjusting factor to convert pixels to user units. + * @author Nicola Asuni + * @public + * @since 1.5.2 + */ + public function getImageScale() { + return $this->imgscale; + } + + /** + * Returns an array of page dimensions: + *
        • $this->pagedim[$this->page]['w'] = page width in points
        • $this->pagedim[$this->page]['h'] = height in points
        • $this->pagedim[$this->page]['wk'] = page width in user units
        • $this->pagedim[$this->page]['hk'] = page height in user units
        • $this->pagedim[$this->page]['tm'] = top margin
        • $this->pagedim[$this->page]['bm'] = bottom margin
        • $this->pagedim[$this->page]['lm'] = left margin
        • $this->pagedim[$this->page]['rm'] = right margin
        • $this->pagedim[$this->page]['pb'] = auto page break
        • $this->pagedim[$this->page]['or'] = page orientation
        • $this->pagedim[$this->page]['olm'] = original left margin
        • $this->pagedim[$this->page]['orm'] = original right margin
        • $this->pagedim[$this->page]['Rotate'] = The number of degrees by which the page shall be rotated clockwise when displayed or printed. The value shall be a multiple of 90.
        • $this->pagedim[$this->page]['PZ'] = The page's preferred zoom (magnification) factor.
        • $this->pagedim[$this->page]['trans'] : the style and duration of the visual transition to use when moving from another page to the given page during a presentation
          • $this->pagedim[$this->page]['trans']['Dur'] = The page's display duration (also called its advance timing): the maximum length of time, in seconds, that the page shall be displayed during presentations before the viewer application shall automatically advance to the next page.
          • $this->pagedim[$this->page]['trans']['S'] = transition style : Split, Blinds, Box, Wipe, Dissolve, Glitter, R, Fly, Push, Cover, Uncover, Fade
          • $this->pagedim[$this->page]['trans']['D'] = The duration of the transition effect, in seconds.
          • $this->pagedim[$this->page]['trans']['Dm'] = (Split and Blinds transition styles only) The dimension in which the specified transition effect shall occur: H = Horizontal, V = Vertical. Default value: H.
          • $this->pagedim[$this->page]['trans']['M'] = (Split, Box and Fly transition styles only) The direction of motion for the specified transition effect: I = Inward from the edges of the page, O = Outward from the center of the pageDefault value: I.
          • $this->pagedim[$this->page]['trans']['Di'] = (Wipe, Glitter, Fly, Cover, Uncover and Push transition styles only) The direction in which the specified transition effect shall moves, expressed in degrees counterclockwise starting from a left-to-right direction. If the value is a number, it shall be one of: 0 = Left to right, 90 = Bottom to top (Wipe only), 180 = Right to left (Wipe only), 270 = Top to bottom, 315 = Top-left to bottom-right (Glitter only). If the value is a name, it shall be None, which is relevant only for the Fly transition when the value of SS is not 1.0. Default value: 0.
          • $this->pagedim[$this->page]['trans']['SS'] = (Fly transition style only) The starting or ending scale at which the changes shall be drawn. If M specifies an inward transition, the scale of the changes drawn shall progress from SS to 1.0 over the course of the transition. If M specifies an outward transition, the scale of the changes drawn shall progress from 1.0 to SS over the course of the transition. Default: 1.0.
          • $this->pagedim[$this->page]['trans']['B'] = (Fly transition style only) If true, the area that shall be flown in is rectangular and opaque. Default: false.
        • $this->pagedim[$this->page]['MediaBox'] : the boundaries of the physical medium on which the page shall be displayed or printed
          • $this->pagedim[$this->page]['MediaBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['MediaBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['MediaBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['MediaBox']['ury'] = upper-right y coordinate in points
        • $this->pagedim[$this->page]['CropBox'] : the visible region of default user space
          • $this->pagedim[$this->page]['CropBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['CropBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['CropBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['CropBox']['ury'] = upper-right y coordinate in points
        • $this->pagedim[$this->page]['BleedBox'] : the region to which the contents of the page shall be clipped when output in a production environment
          • $this->pagedim[$this->page]['BleedBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['BleedBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['BleedBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['BleedBox']['ury'] = upper-right y coordinate in points
        • $this->pagedim[$this->page]['TrimBox'] : the intended dimensions of the finished page after trimming
          • $this->pagedim[$this->page]['TrimBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['TrimBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['TrimBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['TrimBox']['ury'] = upper-right y coordinate in points
        • $this->pagedim[$this->page]['ArtBox'] : the extent of the page's meaningful content
          • $this->pagedim[$this->page]['ArtBox']['llx'] = lower-left x coordinate in points
          • $this->pagedim[$this->page]['ArtBox']['lly'] = lower-left y coordinate in points
          • $this->pagedim[$this->page]['ArtBox']['urx'] = upper-right x coordinate in points
          • $this->pagedim[$this->page]['ArtBox']['ury'] = upper-right y coordinate in points
        + * @param int|null $pagenum page number (empty = current page) + * @return array of page dimensions. + * @author Nicola Asuni + * @public + * @since 4.5.027 (2009-03-16) + */ + public function getPageDimensions($pagenum=null) { + if (empty($pagenum)) { + $pagenum = $this->page; + } + return $this->pagedim[$pagenum]; + } + + /** + * Returns the page width in units. + * @param int|null $pagenum page number (empty = current page) + * @return int|float page width. + * @author Nicola Asuni + * @public + * @since 1.5.2 + * @see getPageDimensions() + */ + public function getPageWidth($pagenum=null) { + if (empty($pagenum)) { + return $this->w; + } + return $this->pagedim[$pagenum]['w']; + } + + /** + * Returns the page height in units. + * @param int|null $pagenum page number (empty = current page) + * @return int|float page height. + * @author Nicola Asuni + * @public + * @since 1.5.2 + * @see getPageDimensions() + */ + public function getPageHeight($pagenum=null) { + if (empty($pagenum)) { + return $this->h; + } + return $this->pagedim[$pagenum]['h']; + } + + /** + * Returns the page break margin. + * @param int|null $pagenum page number (empty = current page) + * @return int|float page break margin. + * @author Nicola Asuni + * @public + * @since 1.5.2 + * @see getPageDimensions() + */ + public function getBreakMargin($pagenum=null) { + if (empty($pagenum)) { + return $this->bMargin; + } + return $this->pagedim[$pagenum]['bm']; + } + + /** + * Returns the scale factor (number of points in user unit). + * @return int scale factor. + * @author Nicola Asuni + * @public + * @since 1.5.2 + */ + public function getScaleFactor() { + return $this->k; + } + + /** + * Defines the left, top and right margins. + * @param int|float $left Left margin. + * @param int|float $top Top margin. + * @param int|float|null $right Right margin. Default value is the left one. + * @param boolean $keepmargins if true overwrites the default page margins + * @public + * @since 1.0 + * @see SetLeftMargin(), SetTopMargin(), SetRightMargin(), SetAutoPageBreak() + */ + public function setMargins($left, $top, $right=null, $keepmargins=false) { + //Set left, top and right margins + $this->lMargin = $left; + $this->tMargin = $top; + if ($right == -1 OR $right === null) { + $right = $left; + } + $this->rMargin = $right; + if ($keepmargins) { + // overwrite original values + $this->original_lMargin = $this->lMargin; + $this->original_rMargin = $this->rMargin; + } + } + + /** + * Defines the left margin. The method can be called before creating the first page. If the current abscissa gets out of page, it is brought back to the margin. + * @param int|float $margin The margin. + * @public + * @since 1.4 + * @see SetTopMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() + */ + public function setLeftMargin($margin) { + //Set left margin + $this->lMargin = $margin; + if (($this->page > 0) AND ($this->x < $margin)) { + $this->x = $margin; + } + } + + /** + * Defines the top margin. The method can be called before creating the first page. + * @param int|float $margin The margin. + * @public + * @since 1.5 + * @see SetLeftMargin(), SetRightMargin(), SetAutoPageBreak(), SetMargins() + */ + public function setTopMargin($margin) { + //Set top margin + $this->tMargin = $margin; + if (($this->page > 0) AND ($this->y < $margin)) { + $this->y = $margin; + } + } + + /** + * Defines the right margin. The method can be called before creating the first page. + * @param int|float $margin The margin. + * @public + * @since 1.5 + * @see SetLeftMargin(), SetTopMargin(), SetAutoPageBreak(), SetMargins() + */ + public function setRightMargin($margin) { + $this->rMargin = $margin; + if (($this->page > 0) AND ($this->x > ($this->w - $margin))) { + $this->x = $this->w - $margin; + } + } + + /** + * Set the same internal Cell padding for top, right, bottom, left- + * @param int|float $pad internal padding. + * @public + * @since 2.1.000 (2008-01-09) + * @see getCellPaddings(), setCellPaddings() + */ + public function setCellPadding($pad) { + if ($pad >= 0) { + $this->cell_padding['L'] = $pad; + $this->cell_padding['T'] = $pad; + $this->cell_padding['R'] = $pad; + $this->cell_padding['B'] = $pad; + } + } + + /** + * Set the internal Cell paddings. + * @param int|float|null $left left padding + * @param int|float|null $top top padding + * @param int|float|null $right right padding + * @param int|float|null $bottom bottom padding + * @public + * @since 5.9.000 (2010-10-03) + * @see getCellPaddings(), SetCellPadding() + */ + public function setCellPaddings($left=null, $top=null, $right=null, $bottom=null) { + if (!TCPDF_STATIC::empty_string($left) AND ($left >= 0)) { + $this->cell_padding['L'] = $left; + } + if (!TCPDF_STATIC::empty_string($top) AND ($top >= 0)) { + $this->cell_padding['T'] = $top; + } + if (!TCPDF_STATIC::empty_string($right) AND ($right >= 0)) { + $this->cell_padding['R'] = $right; + } + if (!TCPDF_STATIC::empty_string($bottom) AND ($bottom >= 0)) { + $this->cell_padding['B'] = $bottom; + } + } + + /** + * Get the internal Cell padding array. + * @return array of padding values + * @public + * @since 5.9.000 (2010-10-03) + * @see setCellPaddings(), SetCellPadding() + */ + public function getCellPaddings() { + return $this->cell_padding; + } + + /** + * Set the internal Cell margins. + * @param int|float|null $left left margin + * @param int|float|null $top top margin + * @param int|float|null $right right margin + * @param int|float|null $bottom bottom margin + * @public + * @since 5.9.000 (2010-10-03) + * @see getCellMargins() + */ + public function setCellMargins($left=null, $top=null, $right=null, $bottom=null) { + if (!TCPDF_STATIC::empty_string($left) AND ($left >= 0)) { + $this->cell_margin['L'] = $left; + } + if (!TCPDF_STATIC::empty_string($top) AND ($top >= 0)) { + $this->cell_margin['T'] = $top; + } + if (!TCPDF_STATIC::empty_string($right) AND ($right >= 0)) { + $this->cell_margin['R'] = $right; + } + if (!TCPDF_STATIC::empty_string($bottom) AND ($bottom >= 0)) { + $this->cell_margin['B'] = $bottom; + } + } + + /** + * Get the internal Cell margin array. + * @return array of margin values + * @public + * @since 5.9.000 (2010-10-03) + * @see setCellMargins() + */ + public function getCellMargins() { + return $this->cell_margin; + } + + /** + * Adjust the internal Cell padding array to take account of the line width. + * @param string|array|int|bool $brd Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @return void|array array of adjustments + * @public + * @since 5.9.000 (2010-10-03) + */ + protected function adjustCellPadding($brd=0) { + if (empty($brd)) { + return; + } + if (is_string($brd)) { + // convert string to array + $slen = strlen($brd); + $newbrd = array(); + for ($i = 0; $i < $slen; ++$i) { + $newbrd[$brd[$i]] = true; + } + $brd = $newbrd; + } elseif ( + ($brd === 1) + || ($brd === true) + || (is_numeric($brd) && ((int)$brd > 0)) + ) { + $brd = array('LRTB' => true); + } + if (!is_array($brd)) { + return; + } + // store current cell padding + $cp = $this->cell_padding; + // select border mode + if (isset($brd['mode'])) { + $mode = $brd['mode']; + unset($brd['mode']); + } else { + $mode = 'normal'; + } + // process borders + foreach ($brd as $border => $style) { + $line_width = $this->LineWidth; + if (is_array($style) && isset($style['width'])) { + // get border width + $line_width = $style['width']; + } + $adj = 0; // line width inside the cell + switch ($mode) { + case 'ext': { + $adj = 0; + break; + } + case 'int': { + $adj = $line_width; + break; + } + case 'normal': + default: { + $adj = ($line_width / 2); + break; + } + } + // correct internal cell padding if required to avoid overlap between text and lines + if ( + is_numeric($this->cell_padding['T']) + && ($this->cell_padding['T'] < $adj) + && (strpos($border, 'T') !== false) + ) { + $this->cell_padding['T'] = $adj; + } + if ( + is_numeric($this->cell_padding['R']) + && ($this->cell_padding['R'] < $adj) + && (strpos($border, 'R') !== false) + ) { + $this->cell_padding['R'] = $adj; + } + if ( + is_numeric($this->cell_padding['B']) + && ($this->cell_padding['B'] < $adj) + && (strpos($border, 'B') !== false) + ) { + $this->cell_padding['B'] = $adj; + } + if ( + is_numeric($this->cell_padding['L']) + && ($this->cell_padding['L'] < $adj) + && (strpos($border, 'L') !== false) + ) { + $this->cell_padding['L'] = $adj; + } + + } + + return array( + 'T' => ($this->cell_padding['T'] - $cp['T']), + 'R' => ($this->cell_padding['R'] - $cp['R']), + 'B' => ($this->cell_padding['B'] - $cp['B']), + 'L' => ($this->cell_padding['L'] - $cp['L']), + ); + } + + /** + * Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm. + * @param boolean $auto Boolean indicating if mode should be on or off. + * @param float $margin Distance from the bottom of the page. + * @public + * @since 1.0 + * @see Cell(), MultiCell(), AcceptPageBreak() + */ + public function setAutoPageBreak($auto, $margin=0) { + $this->AutoPageBreak = $auto ? true : false; + $this->bMargin = $margin; + $this->PageBreakTrigger = $this->h - $margin; + } + + /** + * Return the auto-page-break mode (true or false). + * @return bool auto-page-break mode + * @public + * @since 5.9.088 + */ + public function getAutoPageBreak() { + return $this->AutoPageBreak; + } + + /** + * Defines the way the document is to be displayed by the viewer. + * @param mixed $zoom The zoom to use. It can be one of the following string values or a number indicating the zooming factor to use.
        • fullpage: displays the entire page on screen
        • fullwidth: uses maximum width of window
        • real: uses real size (equivalent to 100% zoom)
        • default: uses viewer default mode
        + * @param string $layout The page layout. Possible values are:
        • SinglePage Display one page at a time
        • OneColumn Display the pages in one column
        • TwoColumnLeft Display the pages in two columns, with odd-numbered pages on the left
        • TwoColumnRight Display the pages in two columns, with odd-numbered pages on the right
        • TwoPageLeft (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the left
        • TwoPageRight (PDF 1.5) Display the pages two at a time, with odd-numbered pages on the right
        + * @param string $mode A name object specifying how the document should be displayed when opened:
        • UseNone Neither document outline nor thumbnail images visible
        • UseOutlines Document outline visible
        • UseThumbs Thumbnail images visible
        • FullScreen Full-screen mode, with no menu bar, window controls, or any other window visible
        • UseOC (PDF 1.5) Optional content group panel visible
        • UseAttachments (PDF 1.6) Attachments panel visible
        + * @public + * @since 1.2 + */ + public function setDisplayMode($zoom, $layout='SinglePage', $mode='UseNone') { + if (($zoom == 'fullpage') OR ($zoom == 'fullwidth') OR ($zoom == 'real') OR ($zoom == 'default') OR (!is_string($zoom))) { + $this->ZoomMode = $zoom; + } else { + $this->Error('Incorrect zoom display mode: '.$zoom); + } + $this->LayoutMode = TCPDF_STATIC::getPageLayoutMode($layout); + $this->PageMode = TCPDF_STATIC::getPageMode($mode); + } + + /** + * Activates or deactivates page compression. When activated, the internal representation of each page is compressed, which leads to a compression ratio of about 2 for the resulting document. Compression is on by default. + * Note: the Zlib extension is required for this feature. If not present, compression will be turned off. + * @param boolean $compress Boolean indicating if compression must be enabled. + * @public + * @since 1.4 + */ + public function setCompression($compress=true) { + $this->compress = false; + if (function_exists('gzcompress')) { + if ($compress) { + if ( !$this->pdfa_mode) { + $this->compress = true; + } + } + } + } + + /** + * Set flag to force sRGB_IEC61966-2.1 black scaled ICC color profile for the whole document. + * @param boolean $mode If true force sRGB output intent. + * @public + * @since 5.9.121 (2011-09-28) + */ + public function setSRGBmode($mode=false) { + $this->force_srgb = $mode ? true : false; + } + + /** + * Turn on/off Unicode mode for document information dictionary (meta tags). + * This has effect only when unicode mode is set to false. + * @param boolean $unicode if true set the meta information in Unicode + * @since 5.9.027 (2010-12-01) + * @public + */ + public function setDocInfoUnicode($unicode=true) { + $this->docinfounicode = $unicode ? true : false; + } + + /** + * Defines the title of the document. + * @param string $title The title. + * @public + * @since 1.2 + * @see SetAuthor(), SetCreator(), SetKeywords(), SetSubject() + */ + public function setTitle($title) { + $this->title = $title; + } + + /** + * Defines the subject of the document. + * @param string $subject The subject. + * @public + * @since 1.2 + * @see SetAuthor(), SetCreator(), SetKeywords(), SetTitle() + */ + public function setSubject($subject) { + $this->subject = $subject; + } + + /** + * Defines the author of the document. + * @param string $author The name of the author. + * @public + * @since 1.2 + * @see SetCreator(), SetKeywords(), SetSubject(), SetTitle() + */ + public function setAuthor($author) { + $this->author = $author; + } + + /** + * Associates keywords with the document, generally in the form 'keyword1 keyword2 ...'. + * @param string $keywords The list of keywords. + * @public + * @since 1.2 + * @see SetAuthor(), SetCreator(), SetSubject(), SetTitle() + */ + public function setKeywords($keywords) { + $this->keywords = $keywords; + } + + /** + * Defines the creator of the document. This is typically the name of the application that generates the PDF. + * @param string $creator The name of the creator. + * @public + * @since 1.2 + * @see SetAuthor(), SetKeywords(), SetSubject(), SetTitle() + */ + public function setCreator($creator) { + $this->creator = $creator; + } + + /** + * Whether to allow local file path in image html tags, when prefixed with file:// + * + * @param bool $allowLocalFiles true, when local files should be allowed. Otherwise false. + * @public + * @since 6.4 + */ + public function setAllowLocalFiles($allowLocalFiles) { + $this->allowLocalFiles = (bool) $allowLocalFiles; + } + + + /** + * Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true. + * @param string $msg The error message + * @public + * @since 1.0 + */ + public function Error($msg) { + // unset all class variables + $this->_destroy(true); + if (defined('K_TCPDF_THROW_EXCEPTION_ERROR') AND !K_TCPDF_THROW_EXCEPTION_ERROR) { + die('TCPDF ERROR: '.$msg); + } else { + throw new Exception('TCPDF ERROR: '.$msg); + } + } + + /** + * This method begins the generation of the PDF document. + * It is not necessary to call it explicitly because AddPage() does it automatically. + * Note: no page is created by this method + * @public + * @since 1.0 + * @see AddPage(), Close() + */ + public function Open() { + $this->state = 1; + } + + /** + * Terminates the PDF document. + * It is not necessary to call this method explicitly because Output() does it automatically. + * If the document contains no page, AddPage() is called to prevent from getting an invalid document. + * @public + * @since 1.0 + * @see Open(), Output() + */ + public function Close() { + if ($this->state == 3) { + return; + } + if ($this->page == 0) { + $this->AddPage(); + } + $this->endLayer(); + if ($this->tcpdflink) { + // save current graphic settings + $gvars = $this->getGraphicVars(); + $this->setEqualColumns(); + $this->lastpage(true); + $this->setAutoPageBreak(false); + $this->x = 0; + $this->y = $this->h - (1 / $this->k); + $this->lMargin = 0; + $this->_outSaveGraphicsState(); + $font = defined('PDF_FONT_NAME_MAIN')?PDF_FONT_NAME_MAIN:'helvetica'; + $this->setFont($font, '', 1); + $this->setTextRenderingMode(0, false, false); + $msg = "\x50\x6f\x77\x65\x72\x65\x64\x20\x62\x79\x20\x54\x43\x50\x44\x46\x20\x28\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67\x29"; + $lnk = "\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x74\x63\x70\x64\x66\x2e\x6f\x72\x67"; + $this->Cell(0, 0, $msg, 0, 0, 'L', 0, $lnk, 0, false, 'D', 'B'); + $this->_outRestoreGraphicsState(); + // restore graphic settings + $this->setGraphicVars($gvars); + } + // close page + $this->endPage(); + // close document + $this->_enddoc(); + // unset all class variables (except critical ones) + $this->_destroy(false); + } + + /** + * Move pointer at the specified document page and update page dimensions. + * @param int $pnum page number (1 ... numpages) + * @param boolean $resetmargins if true reset left, right, top margins and Y position. + * @public + * @since 2.1.000 (2008-01-07) + * @see getPage(), lastpage(), getNumPages() + */ + public function setPage($pnum, $resetmargins=false) { + if (($pnum == $this->page) AND ($this->state == 2)) { + return; + } + if (($pnum > 0) AND ($pnum <= $this->numpages)) { + $this->state = 2; + // save current graphic settings + //$gvars = $this->getGraphicVars(); + $oldpage = $this->page; + $this->page = $pnum; + $this->wPt = $this->pagedim[$this->page]['w']; + $this->hPt = $this->pagedim[$this->page]['h']; + $this->w = $this->pagedim[$this->page]['wk']; + $this->h = $this->pagedim[$this->page]['hk']; + $this->tMargin = $this->pagedim[$this->page]['tm']; + $this->bMargin = $this->pagedim[$this->page]['bm']; + $this->original_lMargin = $this->pagedim[$this->page]['olm']; + $this->original_rMargin = $this->pagedim[$this->page]['orm']; + $this->AutoPageBreak = $this->pagedim[$this->page]['pb']; + $this->CurOrientation = $this->pagedim[$this->page]['or']; + $this->setAutoPageBreak($this->AutoPageBreak, $this->bMargin); + // restore graphic settings + //$this->setGraphicVars($gvars); + if ($resetmargins) { + $this->lMargin = $this->pagedim[$this->page]['olm']; + $this->rMargin = $this->pagedim[$this->page]['orm']; + $this->setY($this->tMargin); + } else { + // account for booklet mode + if ($this->pagedim[$this->page]['olm'] != $this->pagedim[$oldpage]['olm']) { + $deltam = $this->pagedim[$this->page]['olm'] - $this->pagedim[$this->page]['orm']; + $this->lMargin += $deltam; + $this->rMargin -= $deltam; + } + } + } else { + $this->Error('Wrong page number on setPage() function: '.$pnum); + } + } + + /** + * Reset pointer to the last document page. + * @param boolean $resetmargins if true reset left, right, top margins and Y position. + * @public + * @since 2.0.000 (2008-01-04) + * @see setPage(), getPage(), getNumPages() + */ + public function lastPage($resetmargins=false) { + $this->setPage($this->getNumPages(), $resetmargins); + } + + /** + * Get current document page number. + * @return int page number + * @public + * @since 2.1.000 (2008-01-07) + * @see setPage(), lastpage(), getNumPages() + */ + public function getPage() { + return $this->page; + } + + /** + * Get the total number of insered pages. + * @return int number of pages + * @public + * @since 2.1.000 (2008-01-07) + * @see setPage(), getPage(), lastpage() + */ + public function getNumPages() { + return $this->numpages; + } + + /** + * Adds a new TOC (Table Of Content) page to the document. + * @param string $orientation page orientation. + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param boolean $keepmargins if true overwrites the default page margins with the current margins + * @public + * @since 5.0.001 (2010-05-06) + * @see AddPage(), startPage(), endPage(), endTOCPage() + */ + public function addTOCPage($orientation='', $format='', $keepmargins=false) { + $this->AddPage($orientation, $format, $keepmargins, true); + } + + /** + * Terminate the current TOC (Table Of Content) page + * @public + * @since 5.0.001 (2010-05-06) + * @see AddPage(), startPage(), endPage(), addTOCPage() + */ + public function endTOCPage() { + $this->endPage(true); + } + + /** + * Adds a new page to the document. If a page is already present, the Footer() method is called first to output the footer (if enabled). Then the page is added, the current position set to the top-left corner according to the left and top margins (or top-right if in RTL mode), and Header() is called to display the header (if enabled). + * The origin of the coordinate system is at the top-left corner (or top-right for RTL) and increasing ordinates go downwards. + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param boolean $keepmargins if true overwrites the default page margins with the current margins + * @param boolean $tocpage if true set the tocpage state to true (the added page will be used to display Table Of Content). + * @public + * @since 1.0 + * @see startPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat() + */ + public function AddPage($orientation='', $format='', $keepmargins=false, $tocpage=false) { + if ($this->inxobj) { + // we are inside an XObject template + return; + } + if (!isset($this->original_lMargin) OR $keepmargins) { + $this->original_lMargin = $this->lMargin; + } + if (!isset($this->original_rMargin) OR $keepmargins) { + $this->original_rMargin = $this->rMargin; + } + // terminate previous page + $this->endPage(); + // start new page + $this->startPage($orientation, $format, $tocpage); + } + + /** + * Terminate the current page + * @param boolean $tocpage if true set the tocpage state to false (end the page used to display Table Of Content). + * @public + * @since 4.2.010 (2008-11-14) + * @see AddPage(), startPage(), addTOCPage(), endTOCPage() + */ + public function endPage($tocpage=false) { + // check if page is already closed + if (($this->page == 0) OR ($this->numpages > $this->page) OR (!$this->pageopen[$this->page])) { + return; + } + // print page footer + $this->setFooter(); + // close page + $this->_endpage(); + // mark page as closed + $this->pageopen[$this->page] = false; + if ($tocpage) { + $this->tocpage = false; + } + } + + /** + * Starts a new page to the document. The page must be closed using the endPage() function. + * The origin of the coordinate system is at the top-left corner and increasing ordinates go downwards. + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @param boolean $tocpage if true the page is designated to contain the Table-Of-Content. + * @since 4.2.010 (2008-11-14) + * @see AddPage(), endPage(), addTOCPage(), endTOCPage(), getPageSizeFromFormat(), setPageFormat() + * @public + */ + public function startPage($orientation='', $format='', $tocpage=false) { + if ($tocpage) { + $this->tocpage = true; + } + // move page numbers of documents to be attached + if ($this->tocpage) { + // move reference to unexistent pages (used for page attachments) + // adjust outlines + $tmpoutlines = $this->outlines; + foreach ($tmpoutlines as $key => $outline) { + if (!$outline['f'] AND ($outline['p'] > $this->numpages)) { + $this->outlines[$key]['p'] = ($outline['p'] + 1); + } + } + // adjust dests + $tmpdests = $this->dests; + foreach ($tmpdests as $key => $dest) { + if (!$dest['f'] AND ($dest['p'] > $this->numpages)) { + $this->dests[$key]['p'] = ($dest['p'] + 1); + } + } + // adjust links + $tmplinks = $this->links; + foreach ($tmplinks as $key => $link) { + if (!$link['f'] AND ($link['p'] > $this->numpages)) { + $this->links[$key]['p'] = ($link['p'] + 1); + } + } + } + if ($this->numpages > $this->page) { + // this page has been already added + $this->setPage($this->page + 1); + $this->setY($this->tMargin); + return; + } + // start a new page + if ($this->state == 0) { + $this->Open(); + } + ++$this->numpages; + $this->swapMargins($this->booklet); + // save current graphic settings + $gvars = $this->getGraphicVars(); + // start new page + $this->_beginpage($orientation, $format); + // mark page as open + $this->pageopen[$this->page] = true; + // restore graphic settings + $this->setGraphicVars($gvars); + // mark this point + $this->setPageMark(); + // print page header + $this->setHeader(); + // restore graphic settings + $this->setGraphicVars($gvars); + // mark this point + $this->setPageMark(); + // print table header (if any) + $this->setTableHeader(); + // set mark for empty page check + $this->emptypagemrk[$this->page]= $this->pagelen[$this->page]; + } + + /** + * Set start-writing mark on current page stream used to put borders and fills. + * Borders and fills are always created after content and inserted on the position marked by this method. + * This function must be called after calling Image() function for a background image. + * Background images must be always inserted before calling Multicell() or WriteHTMLCell() or WriteHTML() functions. + * @public + * @since 4.0.016 (2008-07-30) + */ + public function setPageMark() { + $this->intmrk[$this->page] = $this->pagelen[$this->page]; + $this->bordermrk[$this->page] = $this->intmrk[$this->page]; + $this->setContentMark(); + } + + /** + * Set start-writing mark on selected page. + * Borders and fills are always created after content and inserted on the position marked by this method. + * @param int $page page number (default is the current page) + * @protected + * @since 4.6.021 (2009-07-20) + */ + protected function setContentMark($page=0) { + if ($page <= 0) { + $page = $this->page; + } + if (isset($this->footerlen[$page])) { + $this->cntmrk[$page] = $this->pagelen[$page] - $this->footerlen[$page]; + } else { + $this->cntmrk[$page] = $this->pagelen[$page]; + } + } + + /** + * Set header data. + * @param string $ln header image logo + * @param int $lw header image logo width in mm + * @param string $ht string to print as title on document header + * @param string $hs string to print on document header + * @param int[] $tc RGB array color for text. + * @param int[] $lc RGB array color for line. + * @public + */ + public function setHeaderData($ln='', $lw=0, $ht='', $hs='', $tc=array(0,0,0), $lc=array(0,0,0)) { + $this->header_logo = $ln; + $this->header_logo_width = $lw; + $this->header_title = $ht; + $this->header_string = $hs; + $this->header_text_color = $tc; + $this->header_line_color = $lc; + } + + /** + * Set footer data. + * @param int[] $tc RGB array color for text. + * @param int[] $lc RGB array color for line. + * @public + */ + public function setFooterData($tc=array(0,0,0), $lc=array(0,0,0)) { + $this->footer_text_color = $tc; + $this->footer_line_color = $lc; + } + + /** + * Returns header data: + *
        • $ret['logo'] = logo image
        • $ret['logo_width'] = width of the image logo in user units
        • $ret['title'] = header title
        • $ret['string'] = header description string
        + * @return array + * @public + * @since 4.0.012 (2008-07-24) + */ + public function getHeaderData() { + $ret = array(); + $ret['logo'] = $this->header_logo; + $ret['logo_width'] = $this->header_logo_width; + $ret['title'] = $this->header_title; + $ret['string'] = $this->header_string; + $ret['text_color'] = $this->header_text_color; + $ret['line_color'] = $this->header_line_color; + return $ret; + } + + /** + * Set header margin. + * (minimum distance between header and top page margin) + * @param int $hm distance in user units + * @public + */ + public function setHeaderMargin($hm=10) { + $this->header_margin = $hm; + } + + /** + * Returns header margin in user units. + * @return float + * @since 4.0.012 (2008-07-24) + * @public + */ + public function getHeaderMargin() { + return $this->header_margin; + } + + /** + * Set footer margin. + * (minimum distance between footer and bottom page margin) + * @param int $fm distance in user units + * @public + */ + public function setFooterMargin($fm=10) { + $this->footer_margin = $fm; + } + + /** + * Returns footer margin in user units. + * @return float + * @since 4.0.012 (2008-07-24) + * @public + */ + public function getFooterMargin() { + return $this->footer_margin; + } + /** + * Set a flag to print page header. + * @param boolean $val set to true to print the page header (default), false otherwise. + * @public + */ + public function setPrintHeader($val=true) { + $this->print_header = $val ? true : false; + } + + /** + * Set a flag to print page footer. + * @param boolean $val set to true to print the page footer (default), false otherwise. + * @public + */ + public function setPrintFooter($val=true) { + $this->print_footer = $val ? true : false; + } + + /** + * Return the right-bottom (or left-bottom for RTL) corner X coordinate of last inserted image + * @return float + * @public + */ + public function getImageRBX() { + return $this->img_rb_x; + } + + /** + * Return the right-bottom (or left-bottom for RTL) corner Y coordinate of last inserted image + * @return float + * @public + */ + public function getImageRBY() { + return $this->img_rb_y; + } + + /** + * Reset the xobject template used by Header() method. + * @public + */ + public function resetHeaderTemplate() { + $this->header_xobjid = false; + } + + /** + * Set a flag to automatically reset the xobject template used by Header() method at each page. + * @param boolean $val set to true to reset Header xobject template at each page, false otherwise. + * @public + */ + public function setHeaderTemplateAutoreset($val=true) { + $this->header_xobj_autoreset = $val ? true : false; + } + + /** + * This method is used to render the page header. + * It is automatically called by AddPage() and could be overwritten in your own inherited class. + * @public + */ + public function Header() { + if ($this->header_xobjid === false) { + // start a new XObject Template + $this->header_xobjid = $this->startTemplate($this->w, $this->tMargin); + $headerfont = $this->getHeaderFont(); + $headerdata = $this->getHeaderData(); + $this->y = $this->header_margin; + if ($this->rtl) { + $this->x = $this->w - $this->original_rMargin; + } else { + $this->x = $this->original_lMargin; + } + if (($headerdata['logo']) AND ($headerdata['logo'] != K_BLANK_IMAGE)) { + $imgtype = TCPDF_IMAGES::getImageFileType(K_PATH_IMAGES.$headerdata['logo']); + if (($imgtype == 'eps') OR ($imgtype == 'ai')) { + $this->ImageEps(K_PATH_IMAGES.$headerdata['logo'], '', '', $headerdata['logo_width']); + } elseif ($imgtype == 'svg') { + $this->ImageSVG(K_PATH_IMAGES.$headerdata['logo'], '', '', $headerdata['logo_width']); + } else { + $this->Image(K_PATH_IMAGES.$headerdata['logo'], '', '', $headerdata['logo_width']); + } + $imgy = $this->getImageRBY(); + } else { + $imgy = $this->y; + } + $cell_height = $this->getCellHeight($headerfont[2] / $this->k); + // set starting margin for text data cell + if ($this->getRTL()) { + $header_x = $this->original_rMargin + ($headerdata['logo_width'] * 1.1); + } else { + $header_x = $this->original_lMargin + ($headerdata['logo_width'] * 1.1); + } + $cw = $this->w - $this->original_lMargin - $this->original_rMargin - ($headerdata['logo_width'] * 1.1); + $this->setTextColorArray($this->header_text_color); + // header title + $this->setFont($headerfont[0], 'B', $headerfont[2] + 1); + $this->setX($header_x); + $this->Cell($cw, $cell_height, $headerdata['title'], 0, 1, '', 0, '', 0); + // header string + $this->setFont($headerfont[0], $headerfont[1], $headerfont[2]); + $this->setX($header_x); + $this->MultiCell($cw, $cell_height, $headerdata['string'], 0, '', 0, 1, '', '', true, 0, false, true, 0, 'T', false); + // print an ending header line + $this->setLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $headerdata['line_color'])); + $this->setY((2.835 / $this->k) + max($imgy, $this->y)); + if ($this->rtl) { + $this->setX($this->original_rMargin); + } else { + $this->setX($this->original_lMargin); + } + $this->Cell(($this->w - $this->original_lMargin - $this->original_rMargin), 0, '', 'T', 0, 'C'); + $this->endTemplate(); + } + // print header template + $x = 0; + $dx = 0; + if (!$this->header_xobj_autoreset AND $this->booklet AND (($this->page % 2) == 0)) { + // adjust margins for booklet mode + $dx = ($this->original_lMargin - $this->original_rMargin); + } + if ($this->rtl) { + $x = $this->w + $dx; + } else { + $x = 0 + $dx; + } + $this->printTemplate($this->header_xobjid, $x, 0, 0, 0, '', '', false); + if ($this->header_xobj_autoreset) { + // reset header xobject template at each page + $this->header_xobjid = false; + } + } + + /** + * This method is used to render the page footer. + * It is automatically called by AddPage() and could be overwritten in your own inherited class. + * @public + */ + public function Footer() { + $cur_y = $this->y; + $this->setTextColorArray($this->footer_text_color); + //set style for cell border + $line_width = (0.85 / $this->k); + $this->setLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $this->footer_line_color)); + //print document barcode + $barcode = $this->getBarcode(); + if (!empty($barcode)) { + $this->Ln($line_width); + $barcode_width = round(($this->w - $this->original_lMargin - $this->original_rMargin) / 3); + $style = array( + 'position' => $this->rtl?'R':'L', + 'align' => $this->rtl?'R':'L', + 'stretch' => false, + 'fitwidth' => true, + 'cellfitalign' => '', + 'border' => false, + 'padding' => 0, + 'fgcolor' => array(0,0,0), + 'bgcolor' => false, + 'text' => false + ); + $this->write1DBarcode($barcode, 'C128', '', $cur_y + $line_width, '', (($this->footer_margin / 3) - $line_width), 0.3, $style, ''); + } + $w_page = isset($this->l['w_page']) ? $this->l['w_page'].' ' : ''; + if (empty($this->pagegroups)) { + $pagenumtxt = $w_page.$this->getAliasNumPage().' / '.$this->getAliasNbPages(); + } else { + $pagenumtxt = $w_page.$this->getPageNumGroupAlias().' / '.$this->getPageGroupAlias(); + } + $this->setY($cur_y); + //Print page number + if ($this->getRTL()) { + $this->setX($this->original_rMargin); + $this->Cell(0, 0, $pagenumtxt, 'T', 0, 'L'); + } else { + $this->setX($this->original_lMargin); + $this->Cell(0, 0, $this->getAliasRightShift().$pagenumtxt, 'T', 0, 'R'); + } + } + + /** + * This method is used to render the page header. + * @protected + * @since 4.0.012 (2008-07-24) + */ + protected function setHeader() { + if (!$this->print_header OR ($this->state != 2)) { + return; + } + $this->InHeader = true; + $this->setGraphicVars($this->default_graphic_vars); + $temp_thead = $this->thead; + $temp_theadMargins = $this->theadMargins; + $lasth = $this->lasth; + $newline = $this->newline; + $this->_outSaveGraphicsState(); + $this->rMargin = $this->original_rMargin; + $this->lMargin = $this->original_lMargin; + $this->setCellPadding(0); + //set current position + if ($this->rtl) { + $this->setXY($this->original_rMargin, $this->header_margin); + } else { + $this->setXY($this->original_lMargin, $this->header_margin); + } + $this->setFont($this->header_font[0], $this->header_font[1], $this->header_font[2]); + $this->Header(); + //restore position + if ($this->rtl) { + $this->setXY($this->original_rMargin, $this->tMargin); + } else { + $this->setXY($this->original_lMargin, $this->tMargin); + } + $this->_outRestoreGraphicsState(); + $this->lasth = $lasth; + $this->thead = $temp_thead; + $this->theadMargins = $temp_theadMargins; + $this->newline = $newline; + $this->InHeader = false; + } + + /** + * This method is used to render the page footer. + * @protected + * @since 4.0.012 (2008-07-24) + */ + protected function setFooter() { + if ($this->state != 2) { + return; + } + $this->InFooter = true; + // save current graphic settings + $gvars = $this->getGraphicVars(); + // mark this point + $this->footerpos[$this->page] = $this->pagelen[$this->page]; + $this->_out("\n"); + if ($this->print_footer) { + $this->setGraphicVars($this->default_graphic_vars); + $this->current_column = 0; + $this->num_columns = 1; + $temp_thead = $this->thead; + $temp_theadMargins = $this->theadMargins; + $lasth = $this->lasth; + $this->_outSaveGraphicsState(); + $this->rMargin = $this->original_rMargin; + $this->lMargin = $this->original_lMargin; + $this->setCellPadding(0); + //set current position + $footer_y = $this->h - $this->footer_margin; + if ($this->rtl) { + $this->setXY($this->original_rMargin, $footer_y); + } else { + $this->setXY($this->original_lMargin, $footer_y); + } + $this->setFont($this->footer_font[0], $this->footer_font[1], $this->footer_font[2]); + $this->Footer(); + //restore position + if ($this->rtl) { + $this->setXY($this->original_rMargin, $this->tMargin); + } else { + $this->setXY($this->original_lMargin, $this->tMargin); + } + $this->_outRestoreGraphicsState(); + $this->lasth = $lasth; + $this->thead = $temp_thead; + $this->theadMargins = $temp_theadMargins; + } + // restore graphic settings + $this->setGraphicVars($gvars); + $this->current_column = $gvars['current_column']; + $this->num_columns = $gvars['num_columns']; + // calculate footer length + $this->footerlen[$this->page] = $this->pagelen[$this->page] - $this->footerpos[$this->page] + 1; + $this->InFooter = false; + } + + /** + * Check if we are on the page body (excluding page header and footer). + * @return bool true if we are not in page header nor in page footer, false otherwise. + * @protected + * @since 5.9.091 (2011-06-15) + */ + protected function inPageBody() { + return (($this->InHeader === false) AND ($this->InFooter === false)); + } + + /** + * This method is used to render the table header on new page (if any). + * @protected + * @since 4.5.030 (2009-03-25) + */ + protected function setTableHeader() { + if ($this->num_columns > 1) { + // multi column mode + return; + } + if (isset($this->theadMargins['top'])) { + // restore the original top-margin + $this->tMargin = $this->theadMargins['top']; + $this->pagedim[$this->page]['tm'] = $this->tMargin; + $this->y = $this->tMargin; + } + if (!TCPDF_STATIC::empty_string($this->thead) AND (!$this->inthead)) { + // set margins + $prev_lMargin = $this->lMargin; + $prev_rMargin = $this->rMargin; + $prev_cell_padding = $this->cell_padding; + $this->lMargin = $this->theadMargins['lmargin'] + ($this->pagedim[$this->page]['olm'] - $this->pagedim[$this->theadMargins['page']]['olm']); + $this->rMargin = $this->theadMargins['rmargin'] + ($this->pagedim[$this->page]['orm'] - $this->pagedim[$this->theadMargins['page']]['orm']); + $this->cell_padding = $this->theadMargins['cell_padding']; + if ($this->rtl) { + $this->x = $this->w - $this->rMargin; + } else { + $this->x = $this->lMargin; + } + // account for special "cell" mode + if ($this->theadMargins['cell']) { + if ($this->rtl) { + $this->x -= $this->cell_padding['R']; + } else { + $this->x += $this->cell_padding['L']; + } + } + $gvars = $this->getGraphicVars(); + if (!empty($this->theadMargins['gvars'])) { + // set the correct graphic style + $this->setGraphicVars($this->theadMargins['gvars']); + $this->rMargin = $gvars['rMargin']; + $this->lMargin = $gvars['lMargin']; + } + // print table header + $this->writeHTML($this->thead, false, false, false, false, ''); + $this->setGraphicVars($gvars); + // set new top margin to skip the table headers + if (!isset($this->theadMargins['top'])) { + $this->theadMargins['top'] = $this->tMargin; + } + // store end of header position + if (!isset($this->columns[0]['th'])) { + $this->columns[0]['th'] = array(); + } + $this->columns[0]['th']['\''.$this->page.'\''] = $this->y; + $this->tMargin = $this->y; + $this->pagedim[$this->page]['tm'] = $this->tMargin; + $this->lasth = 0; + $this->lMargin = $prev_lMargin; + $this->rMargin = $prev_rMargin; + $this->cell_padding = $prev_cell_padding; + } + } + + /** + * Returns the current page number. + * @return int page number + * @public + * @since 1.0 + * @see getAliasNbPages() + */ + public function PageNo() { + return $this->page; + } + + /** + * Returns the array of spot colors. + * @return array Spot colors array. + * @public + * @since 6.0.038 (2013-09-30) + */ + public function getAllSpotColors() { + return $this->spot_colors; + } + + /** + * Defines a new spot color. + * It can be expressed in RGB components or gray scale. + * The method can be called before the first page is created and the value is retained from page to page. + * @param string $name Full name of the spot color. + * @param float $c Cyan color for CMYK. Value between 0 and 100. + * @param float $m Magenta color for CMYK. Value between 0 and 100. + * @param float $y Yellow color for CMYK. Value between 0 and 100. + * @param float $k Key (Black) color for CMYK. Value between 0 and 100. + * @public + * @since 4.0.024 (2008-09-12) + * @see SetDrawSpotColor(), SetFillSpotColor(), SetTextSpotColor() + */ + public function AddSpotColor($name, $c, $m, $y, $k) { + if (!isset($this->spot_colors[$name])) { + $i = (1 + count($this->spot_colors)); + $this->spot_colors[$name] = array('C' => $c, 'M' => $m, 'Y' => $y, 'K' => $k, 'name' => $name, 'i' => $i); + } + } + + /** + * Set the spot color for the specified type ('draw', 'fill', 'text'). + * @param string $type Type of object affected by this color: ('draw', 'fill', 'text'). + * @param string $name Name of the spot color. + * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @return string PDF color command. + * @public + * @since 5.9.125 (2011-10-03) + */ + public function setSpotColor($type, $name, $tint=100) { + $spotcolor = TCPDF_COLORS::getSpotColor($name, $this->spot_colors); + if ($spotcolor === false) { + $this->Error('Undefined spot color: '.$name.', you must add it using the AddSpotColor() method.'); + } + $tint = (max(0, min(100, $tint)) / 100); + $pdfcolor = sprintf('/CS%d ', $this->spot_colors[$name]['i']); + switch ($type) { + case 'draw': { + $pdfcolor .= sprintf('CS %F SCN', $tint); + $this->DrawColor = $pdfcolor; + $this->strokecolor = $spotcolor; + break; + } + case 'fill': { + $pdfcolor .= sprintf('cs %F scn', $tint); + $this->FillColor = $pdfcolor; + $this->bgcolor = $spotcolor; + break; + } + case 'text': { + $pdfcolor .= sprintf('cs %F scn', $tint); + $this->TextColor = $pdfcolor; + $this->fgcolor = $spotcolor; + break; + } + } + $this->ColorFlag = ($this->FillColor != $this->TextColor); + if ($this->state == 2) { + $this->_out($pdfcolor); + } + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['spot_colors'][$name] = $this->spot_colors[$name]; + } + return $pdfcolor; + } + + /** + * Defines the spot color used for all drawing operations (lines, rectangles and cell borders). + * @param string $name Name of the spot color. + * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @public + * @since 4.0.024 (2008-09-12) + * @see AddSpotColor(), SetFillSpotColor(), SetTextSpotColor() + */ + public function setDrawSpotColor($name, $tint=100) { + $this->setSpotColor('draw', $name, $tint); + } + + /** + * Defines the spot color used for all filling operations (filled rectangles and cell backgrounds). + * @param string $name Name of the spot color. + * @param float $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @public + * @since 4.0.024 (2008-09-12) + * @see AddSpotColor(), SetDrawSpotColor(), SetTextSpotColor() + */ + public function setFillSpotColor($name, $tint=100) { + $this->setSpotColor('fill', $name, $tint); + } + + /** + * Defines the spot color used for text. + * @param string $name Name of the spot color. + * @param int $tint Intensity of the color (from 0 to 100 ; 100 = full intensity by default). + * @public + * @since 4.0.024 (2008-09-12) + * @see AddSpotColor(), SetDrawSpotColor(), SetFillSpotColor() + */ + public function setTextSpotColor($name, $tint=100) { + $this->setSpotColor('text', $name, $tint); + } + + /** + * Set the color array for the specified type ('draw', 'fill', 'text'). + * It can be expressed in RGB, CMYK or GRAY SCALE components. + * The method can be called before the first page is created and the value is retained from page to page. + * @param string $type Type of object affected by this color: ('draw', 'fill', 'text'). + * @param array $color Array of colors (1=gray, 3=RGB, 4=CMYK or 5=spotcolor=CMYK+name values). + * @param boolean $ret If true do not send the PDF command. + * @return string The PDF command or empty string. + * @public + * @since 3.1.000 (2008-06-11) + */ + public function setColorArray($type, $color, $ret=false) { + if (is_array($color)) { + $color = array_values($color); + // component: grey, RGB red or CMYK cyan + $c = isset($color[0]) ? $color[0] : -1; + // component: RGB green or CMYK magenta + $m = isset($color[1]) ? $color[1] : -1; + // component: RGB blue or CMYK yellow + $y = isset($color[2]) ? $color[2] : -1; + // component: CMYK black + $k = isset($color[3]) ? $color[3] : -1; + // color name + $name = isset($color[4]) ? $color[4] : ''; + if ($c >= 0) { + return $this->setColor($type, $c, $m, $y, $k, $ret, $name); + } + } + return ''; + } + + /** + * Defines the color used for all drawing operations (lines, rectangles and cell borders). + * It can be expressed in RGB, CMYK or GRAY SCALE components. + * The method can be called before the first page is created and the value is retained from page to page. + * @param array $color Array of colors (1, 3 or 4 values). + * @param boolean $ret If true do not send the PDF command. + * @return string the PDF command + * @public + * @since 3.1.000 (2008-06-11) + * @see SetDrawColor() + */ + public function setDrawColorArray($color, $ret=false) { + return $this->setColorArray('draw', $color, $ret); + } + + /** + * Defines the color used for all filling operations (filled rectangles and cell backgrounds). + * It can be expressed in RGB, CMYK or GRAY SCALE components. + * The method can be called before the first page is created and the value is retained from page to page. + * @param array $color Array of colors (1, 3 or 4 values). + * @param boolean $ret If true do not send the PDF command. + * @public + * @since 3.1.000 (2008-6-11) + * @see SetFillColor() + */ + public function setFillColorArray($color, $ret=false) { + return $this->setColorArray('fill', $color, $ret); + } + + /** + * Defines the color used for text. It can be expressed in RGB components or gray scale. + * The method can be called before the first page is created and the value is retained from page to page. + * @param array $color Array of colors (1, 3 or 4 values). + * @param boolean $ret If true do not send the PDF command. + * @public + * @since 3.1.000 (2008-6-11) + * @see SetFillColor() + */ + public function setTextColorArray($color, $ret=false) { + return $this->setColorArray('text', $color, $ret); + } + + /** + * Defines the color used by the specified type ('draw', 'fill', 'text'). + * @param string $type Type of object affected by this color: ('draw', 'fill', 'text'). + * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). + * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). + * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). + * @param float $col4 KEY (BLACK) color for CMYK (0-100). + * @param boolean $ret If true do not send the command. + * @param string $name spot color name (if any) + * @return string The PDF command or empty string. + * @public + * @since 5.9.125 (2011-10-03) + */ + public function setColor($type, $col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') { + // set default values + if (!is_numeric($col1)) { + $col1 = 0; + } + if (!is_numeric($col2)) { + $col2 = -1; + } + if (!is_numeric($col3)) { + $col3 = -1; + } + if (!is_numeric($col4)) { + $col4 = -1; + } + // set color by case + $suffix = ''; + if (($col2 == -1) AND ($col3 == -1) AND ($col4 == -1)) { + // Grey scale + $col1 = max(0, min(255, $col1)); + $intcolor = array('G' => $col1); + $pdfcolor = sprintf('%F ', ($col1 / 255)); + $suffix = 'g'; + } elseif ($col4 == -1) { + // RGB + $col1 = max(0, min(255, $col1)); + $col2 = max(0, min(255, $col2)); + $col3 = max(0, min(255, $col3)); + $intcolor = array('R' => $col1, 'G' => $col2, 'B' => $col3); + $pdfcolor = sprintf('%F %F %F ', ($col1 / 255), ($col2 / 255), ($col3 / 255)); + $suffix = 'rg'; + } else { + $col1 = max(0, min(100, $col1)); + $col2 = max(0, min(100, $col2)); + $col3 = max(0, min(100, $col3)); + $col4 = max(0, min(100, $col4)); + if (empty($name)) { + // CMYK + $intcolor = array('C' => $col1, 'M' => $col2, 'Y' => $col3, 'K' => $col4); + $pdfcolor = sprintf('%F %F %F %F ', ($col1 / 100), ($col2 / 100), ($col3 / 100), ($col4 / 100)); + $suffix = 'k'; + } else { + // SPOT COLOR + $intcolor = array('C' => $col1, 'M' => $col2, 'Y' => $col3, 'K' => $col4, 'name' => $name); + $this->AddSpotColor($name, $col1, $col2, $col3, $col4); + $pdfcolor = $this->setSpotColor($type, $name, 100); + } + } + switch ($type) { + case 'draw': { + $pdfcolor .= strtoupper($suffix); + $this->DrawColor = $pdfcolor; + $this->strokecolor = $intcolor; + break; + } + case 'fill': { + $pdfcolor .= $suffix; + $this->FillColor = $pdfcolor; + $this->bgcolor = $intcolor; + break; + } + case 'text': { + $pdfcolor .= $suffix; + $this->TextColor = $pdfcolor; + $this->fgcolor = $intcolor; + break; + } + } + $this->ColorFlag = ($this->FillColor != $this->TextColor); + if (($type != 'text') AND ($this->state == 2) AND $type !== 0) { + if (!$ret) { + $this->_out($pdfcolor); + } + return $pdfcolor; + } + return ''; + } + + /** + * Defines the color used for all drawing operations (lines, rectangles and cell borders). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. + * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). + * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). + * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). + * @param float $col4 KEY (BLACK) color for CMYK (0-100). + * @param boolean $ret If true do not send the command. + * @param string $name spot color name (if any) + * @return string the PDF command + * @public + * @since 1.3 + * @see SetDrawColorArray(), SetFillColor(), SetTextColor(), Line(), Rect(), Cell(), MultiCell() + */ + public function setDrawColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') { + return $this->setColor('draw', $col1, $col2, $col3, $col4, $ret, $name); + } + + /** + * Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. + * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). + * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). + * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). + * @param float $col4 KEY (BLACK) color for CMYK (0-100). + * @param boolean $ret If true do not send the command. + * @param string $name Spot color name (if any). + * @return string The PDF command. + * @public + * @since 1.3 + * @see SetFillColorArray(), SetDrawColor(), SetTextColor(), Rect(), Cell(), MultiCell() + */ + public function setFillColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') { + return $this->setColor('fill', $col1, $col2, $col3, $col4, $ret, $name); + } + + /** + * Defines the color used for text. It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page. + * @param float $col1 GRAY level for single color, or Red color for RGB (0-255), or CYAN color for CMYK (0-100). + * @param float $col2 GREEN color for RGB (0-255), or MAGENTA color for CMYK (0-100). + * @param float $col3 BLUE color for RGB (0-255), or YELLOW color for CMYK (0-100). + * @param float $col4 KEY (BLACK) color for CMYK (0-100). + * @param boolean $ret If true do not send the command. + * @param string $name Spot color name (if any). + * @return string Empty string. + * @public + * @since 1.3 + * @see SetTextColorArray(), SetDrawColor(), SetFillColor(), Text(), Cell(), MultiCell() + */ + public function setTextColor($col1=0, $col2=-1, $col3=-1, $col4=-1, $ret=false, $name='') { + return $this->setColor('text', $col1, $col2, $col3, $col4, $ret, $name); + } + + /** + * Returns the length of a string in user unit. A font must be selected.
        + * @param string $s The string whose length is to be computed + * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. + * @param string $fontstyle Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line-through
        • O: overline
        or any combination. The default value is regular. + * @param float $fontsize Font size in points. The default value is the current size. + * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. + * @return float[]|float total string length or array of characted widths + * @author Nicola Asuni + * @public + * @since 1.2 + */ + public function GetStringWidth($s, $fontname='', $fontstyle='', $fontsize=0, $getarray=false) { + return $this->GetArrStringWidth(TCPDF_FONTS::utf8Bidi(TCPDF_FONTS::UTF8StringToArray($s, $this->isunicode, $this->CurrentFont), $s, $this->tmprtl, $this->isunicode, $this->CurrentFont), $fontname, $fontstyle, $fontsize, $getarray); + } + + /** + * Returns the string length of an array of chars in user unit or an array of characters widths. A font must be selected.
        + * @param array $sa The array of chars whose total length is to be computed + * @param string $fontname Family font. It can be either a name defined by AddFont() or one of the standard families. It is also possible to pass an empty string, in that case, the current family is retained. + * @param string $fontstyle Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line through
        • O: overline
        or any combination. The default value is regular. + * @param float $fontsize Font size in points. The default value is the current size. + * @param boolean $getarray if true returns an array of characters widths, if false returns the total length. + * @return float[]|float total string length or array of characted widths + * @author Nicola Asuni + * @public + * @since 2.4.000 (2008-03-06) + */ + public function GetArrStringWidth($sa, $fontname='', $fontstyle='', $fontsize=0, $getarray=false) { + // store current values + if (!TCPDF_STATIC::empty_string($fontname)) { + $prev_FontFamily = $this->FontFamily; + $prev_FontStyle = $this->FontStyle; + $prev_FontSizePt = $this->FontSizePt; + $this->setFont($fontname, $fontstyle, $fontsize, '', 'default', false); + } + // convert UTF-8 array to Latin1 if required + if ($this->isunicode AND (!$this->isUnicodeFont())) { + $sa = TCPDF_FONTS::UTF8ArrToLatin1Arr($sa); + } + $w = 0; // total width + $wa = array(); // array of characters widths + foreach ($sa as $ck => $char) { + // character width + $cw = $this->GetCharWidth($char, isset($sa[($ck + 1)])); + $wa[] = $cw; + $w += $cw; + } + // restore previous values + if (!TCPDF_STATIC::empty_string($fontname)) { + $this->setFont($prev_FontFamily, $prev_FontStyle, $prev_FontSizePt, '', 'default', false); + } + if ($getarray) { + return $wa; + } + return $w; + } + + /** + * Returns the length of the char in user unit for the current font considering current stretching and spacing (tracking). + * @param int $char The char code whose length is to be returned + * @param boolean $notlast If false ignore the font-spacing. + * @return float char width + * @author Nicola Asuni + * @public + * @since 2.4.000 (2008-03-06) + */ + public function GetCharWidth($char, $notlast=true) { + // get raw width + $chw = $this->getRawCharWidth($char); + if (($this->font_spacing < 0) OR (($this->font_spacing > 0) AND $notlast)) { + // increase/decrease font spacing + $chw += $this->font_spacing; + } + if ($this->font_stretching != 100) { + // fixed stretching mode + $chw *= ($this->font_stretching / 100); + } + return $chw; + } + + /** + * Returns the length of the char in user unit for the current font. + * @param int $char The char code whose length is to be returned + * @return float char width + * @author Nicola Asuni + * @public + * @since 5.9.000 (2010-09-28) + */ + public function getRawCharWidth($char) { + if ($char == 173) { + // SHY character will not be printed + return (0); + } + if (isset($this->CurrentFont['cw'][intval($char)])) { + $w = $this->CurrentFont['cw'][intval($char)]; + } elseif (isset($this->CurrentFont['dw'])) { + // default width + $w = $this->CurrentFont['dw']; + } elseif (isset($this->CurrentFont['cw'][32])) { + // default width + $w = $this->CurrentFont['cw'][32]; + } else { + $w = 600; + } + return $this->getAbsFontMeasure($w); + } + + /** + * Returns the numbero of characters in a string. + * @param string $s The input string. + * @return int number of characters + * @public + * @since 2.0.0001 (2008-01-07) + */ + public function GetNumChars($s) { + if ($this->isUnicodeFont()) { + return count(TCPDF_FONTS::UTF8StringToArray($s, $this->isunicode, $this->CurrentFont)); + } + return strlen($s); + } + + /** + * Fill the list of available fonts ($this->fontlist). + * @protected + * @since 4.0.013 (2008-07-28) + */ + protected function getFontsList() { + if (($fontsdir = opendir(TCPDF_FONTS::_getfontpath())) !== false) { + while (($file = readdir($fontsdir)) !== false) { + if (substr($file, -4) == '.php') { + array_push($this->fontlist, strtolower(basename($file, '.php'))); + } + } + closedir($fontsdir); + } + } + + /** + * Imports a TrueType, Type1, core, or CID0 font and makes it available. + * It is necessary to generate a font definition file first (read /fonts/utils/README.TXT). + * The definition file (and the font file itself when embedding) must be present either in the current directory or in the one indicated by K_PATH_FONTS if the constant is defined. If it could not be found, the error "Could not include font definition file" is generated. + * @param string $family Font family. The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font. + * @param string $style Font style. Possible values are (case insensitive):
        • empty string: regular (default)
        • B: bold
        • I: italic
        • BI or IB: bold italic
        + * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. + * @return array|false array containing the font data, or false in case of error. + * @param mixed $subset if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font. + * @public + * @since 1.5 + * @see SetFont(), setFontSubsetting() + */ + public function AddFont($family, $style='', $fontfile='', $subset='default') { + if ($subset === 'default') { + $subset = $this->font_subsetting; + } + if ($this->pdfa_mode) { + $subset = false; + } + if (TCPDF_STATIC::empty_string($family)) { + if (!TCPDF_STATIC::empty_string($this->FontFamily)) { + $family = $this->FontFamily; + } else { + $this->Error('Empty font family'); + } + } + // move embedded styles on $style + if (substr($family, -1) == 'I') { + $style .= 'I'; + $family = substr($family, 0, -1); + } + if (substr($family, -1) == 'B') { + $style .= 'B'; + $family = substr($family, 0, -1); + } + // normalize family name + $family = strtolower($family); + if ((!$this->isunicode) AND ($family == 'arial')) { + $family = 'helvetica'; + } + if (($family == 'symbol') OR ($family == 'zapfdingbats')) { + $style = ''; + } + if ($this->pdfa_mode AND (isset($this->CoreFonts[$family]))) { + // all fonts must be embedded + $family = 'pdfa'.$family; + } + $tempstyle = strtoupper($style === null ? '' : $style); + $style = ''; + // underline + if (strpos($tempstyle, 'U') !== false) { + $this->underline = true; + } else { + $this->underline = false; + } + // line-through (deleted) + if (strpos($tempstyle, 'D') !== false) { + $this->linethrough = true; + } else { + $this->linethrough = false; + } + // overline + if (strpos($tempstyle, 'O') !== false) { + $this->overline = true; + } else { + $this->overline = false; + } + // bold + if (strpos($tempstyle, 'B') !== false) { + $style .= 'B'; + } + // oblique + if (strpos($tempstyle, 'I') !== false) { + $style .= 'I'; + } + $bistyle = $style; + $fontkey = $family.$style; + $font_style = $style.($this->underline ? 'U' : '').($this->linethrough ? 'D' : '').($this->overline ? 'O' : ''); + $fontdata = array('fontkey' => $fontkey, 'family' => $family, 'style' => $font_style); + // check if the font has been already added + $fb = $this->getFontBuffer($fontkey); + if ($fb !== false) { + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $fb['i']; + } + return $fontdata; + } + // get specified font directory (if any) + $fontdir = false; + if (!TCPDF_STATIC::empty_string($fontfile)) { + $fontdir = dirname($fontfile); + if (TCPDF_STATIC::empty_string($fontdir) OR ($fontdir == '.')) { + $fontdir = ''; + } else { + $fontdir .= '/'; + } + } + // true when the font style variation is missing + $missing_style = false; + // search and include font file + if (TCPDF_STATIC::empty_string($fontfile) OR (!@TCPDF_STATIC::file_exists($fontfile))) { + // build a standard filenames for specified font + $tmp_fontfile = str_replace(' ', '', $family).strtolower($style).'.php'; + $fontfile = TCPDF_FONTS::getFontFullPath($tmp_fontfile, $fontdir); + if (TCPDF_STATIC::empty_string($fontfile)) { + $missing_style = true; + // try to remove the style part + $tmp_fontfile = str_replace(' ', '', $family).'.php'; + $fontfile = TCPDF_FONTS::getFontFullPath($tmp_fontfile, $fontdir); + } + } + // include font file + if (!TCPDF_STATIC::empty_string($fontfile) AND (@TCPDF_STATIC::file_exists($fontfile))) { + $type=null; + $name=null; + $desc=null; + $up=-null; + $ut=null; + $cw=null; + $cbbox=null; + $dw=null; + $enc=null; + $cidinfo=null; + $file=null; + $ctg=null; + $diff=null; + $originalsize=null; + $size1=null; + $size2=null; + include($fontfile); + } else { + $this->Error('Could not include font definition file: '.$family.''); + } + // check font parameters + if ((!isset($type)) OR (!isset($cw))) { + $this->Error('The font definition file has a bad format: '.$fontfile.''); + } + // SET default parameters + if (!isset($file) OR TCPDF_STATIC::empty_string($file)) { + $file = ''; + } + if (!isset($enc) OR TCPDF_STATIC::empty_string($enc)) { + $enc = ''; + } + if (!isset($cidinfo) OR TCPDF_STATIC::empty_string($cidinfo)) { + $cidinfo = array('Registry'=>'Adobe', 'Ordering'=>'Identity', 'Supplement'=>0); + $cidinfo['uni2cid'] = array(); + } + if (!isset($ctg) OR TCPDF_STATIC::empty_string($ctg)) { + $ctg = ''; + } + if (!isset($desc) OR TCPDF_STATIC::empty_string($desc)) { + $desc = array(); + } + if (!isset($up) OR TCPDF_STATIC::empty_string($up)) { + $up = -100; + } + if (!isset($ut) OR TCPDF_STATIC::empty_string($ut)) { + $ut = 50; + } + if (!isset($cw) OR TCPDF_STATIC::empty_string($cw)) { + $cw = array(); + } + if (!isset($dw) OR TCPDF_STATIC::empty_string($dw)) { + // set default width + if (isset($desc['MissingWidth']) AND ($desc['MissingWidth'] > 0)) { + $dw = $desc['MissingWidth']; + } elseif (isset($cw[32])) { + $dw = $cw[32]; + } else { + $dw = 600; + } + } + ++$this->numfonts; + if ($type == 'core') { + $name = $this->CoreFonts[$fontkey]; + $subset = false; + } elseif (($type == 'TrueType') OR ($type == 'Type1')) { + $subset = false; + } elseif ($type == 'TrueTypeUnicode') { + $enc = 'Identity-H'; + } elseif ($type == 'cidfont0') { + if ($this->pdfa_mode) { + $this->Error('All fonts must be embedded in PDF/A mode!'); + } + } else { + $this->Error('Unknow font type: '.$type.''); + } + // set name if unset + if (!isset($name) OR empty($name)) { + $name = $fontkey; + } + // create artificial font style variations if missing (only works with non-embedded fonts) + if (($type != 'core') AND $missing_style) { + // style variations + $styles = array('' => '', 'B' => ',Bold', 'I' => ',Italic', 'BI' => ',BoldItalic'); + $name .= $styles[$bistyle]; + // artificial bold + if (strpos($bistyle, 'B') !== false) { + if (isset($desc['StemV'])) { + // from normal to bold + $desc['StemV'] = round($desc['StemV'] * 1.75); + } else { + // bold + $desc['StemV'] = 123; + } + } + // artificial italic + if (strpos($bistyle, 'I') !== false) { + if (isset($desc['ItalicAngle'])) { + $desc['ItalicAngle'] -= 11; + } else { + $desc['ItalicAngle'] = -11; + } + if (isset($desc['Flags'])) { + $desc['Flags'] |= 64; //bit 7 + } else { + $desc['Flags'] = 64; + } + } + } + // check if the array of characters bounding boxes is defined + if (!isset($cbbox)) { + $cbbox = array(); + } + // initialize subsetchars + $subsetchars = array_fill(0, 255, true); + $this->setFontBuffer($fontkey, array('fontkey' => $fontkey, 'i' => $this->numfonts, 'type' => $type, 'name' => $name, 'desc' => $desc, 'up' => $up, 'ut' => $ut, 'cw' => $cw, 'cbbox' => $cbbox, 'dw' => $dw, 'enc' => $enc, 'cidinfo' => $cidinfo, 'file' => $file, 'ctg' => $ctg, 'subset' => $subset, 'subsetchars' => $subsetchars)); + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['fonts'][$fontkey] = $this->numfonts; + } + if (isset($diff) AND (!empty($diff))) { + //Search existing encodings + $d = 0; + $nb = count($this->diffs); + for ($i=1; $i <= $nb; ++$i) { + if ($this->diffs[$i] == $diff) { + $d = $i; + break; + } + } + if ($d == 0) { + $d = $nb + 1; + $this->diffs[$d] = $diff; + } + $this->setFontSubBuffer($fontkey, 'diff', $d); + } + if (!TCPDF_STATIC::empty_string($file)) { + if (!isset($this->FontFiles[$file])) { + if ((strcasecmp($type,'TrueType') == 0) OR (strcasecmp($type, 'TrueTypeUnicode') == 0)) { + $this->FontFiles[$file] = array('length1' => $originalsize, 'fontdir' => $fontdir, 'subset' => $subset, 'fontkeys' => array($fontkey)); + } elseif ($type != 'core') { + $this->FontFiles[$file] = array('length1' => $size1, 'length2' => $size2, 'fontdir' => $fontdir, 'subset' => $subset, 'fontkeys' => array($fontkey)); + } + } else { + // update fontkeys that are sharing this font file + $this->FontFiles[$file]['subset'] = ($this->FontFiles[$file]['subset'] AND $subset); + if (!in_array($fontkey, $this->FontFiles[$file]['fontkeys'])) { + $this->FontFiles[$file]['fontkeys'][] = $fontkey; + } + } + } + return $fontdata; + } + + /** + * Sets the font used to print character strings. + * The font can be either a standard one or a font added via the AddFont() method. Standard fonts use Windows encoding cp1252 (Western Europe). + * The method can be called before the first page is created and the font is retained from page to page. + * If you just wish to change the current font size, it is simpler to call SetFontSize(). + * Note: for the standard fonts, the font metric files must be accessible. There are three possibilities for this:
        • They are in the current directory (the one where the running script lies)
        • They are in one of the directories defined by the include_path parameter
        • They are in the directory defined by the K_PATH_FONTS constant

        + * @param string $family Family font. It can be either a name defined by AddFont() or one of the standard Type1 families (case insensitive):
        • times (Times-Roman)
        • timesb (Times-Bold)
        • timesi (Times-Italic)
        • timesbi (Times-BoldItalic)
        • helvetica (Helvetica)
        • helveticab (Helvetica-Bold)
        • helveticai (Helvetica-Oblique)
        • helveticabi (Helvetica-BoldOblique)
        • courier (Courier)
        • courierb (Courier-Bold)
        • courieri (Courier-Oblique)
        • courierbi (Courier-BoldOblique)
        • symbol (Symbol)
        • zapfdingbats (ZapfDingbats)
        It is also possible to pass an empty string. In that case, the current family is retained. + * @param string $style Font style. Possible values are (case insensitive):
        • empty string: regular
        • B: bold
        • I: italic
        • U: underline
        • D: line through
        • O: overline
        or any combination. The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats basic fonts or other fonts when not defined. + * @param float|null $size Font size in points. The default value is the current size. If no size has been specified since the beginning of the document, the value taken is 12 + * @param string $fontfile The font definition file. By default, the name is built from the family and style, in lower case with no spaces. + * @param mixed $subset if true embedd only a subset of the font (stores only the information related to the used characters); if false embedd full font; if 'default' uses the default value set using setFontSubsetting(). This option is valid only for TrueTypeUnicode fonts. If you want to enable users to change the document, set this parameter to false. If you subset the font, the person who receives your PDF would need to have your same font in order to make changes to your PDF. The file size of the PDF would also be smaller because you are embedding only part of a font. + * @param boolean $out if true output the font size command, otherwise only set the font properties. + * @author Nicola Asuni + * @public + * @since 1.0 + * @see AddFont(), SetFontSize() + */ + public function setFont($family, $style='', $size=null, $fontfile='', $subset='default', $out=true) { + //Select a font; size given in points + if ($size === null) { + $size = $this->FontSizePt; + } + if ($size < 0) { + $size = 0; + } + // try to add font (if not already added) + $fontdata = $this->AddFont($family, $style, $fontfile, $subset); + $this->FontFamily = $fontdata['family']; + $this->FontStyle = $fontdata['style']; + if (isset($this->CurrentFont['fontkey']) AND isset($this->CurrentFont['subsetchars'])) { + // save subset chars of the previous font + $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']); + } + $this->CurrentFont = $this->getFontBuffer($fontdata['fontkey']); + $this->setFontSize($size, $out); + } + + /** + * Defines the size of the current font. + * @param float $size The font size in points. + * @param boolean $out if true output the font size command, otherwise only set the font properties. + * @public + * @since 1.0 + * @see SetFont() + */ + public function setFontSize($size, $out=true) { + $size = (float)$size; + // font size in points + $this->FontSizePt = $size; + // font size in user units + $this->FontSize = $size / $this->k; + // calculate some font metrics + if (isset($this->CurrentFont['desc']['FontBBox'])) { + $bbox = explode(' ', substr($this->CurrentFont['desc']['FontBBox'], 1, -1)); + $font_height = ((intval($bbox[3]) - intval($bbox[1])) * $size / 1000); + } else { + $font_height = $size * 1.219; + } + if (isset($this->CurrentFont['desc']['Ascent']) AND ($this->CurrentFont['desc']['Ascent'] > 0)) { + $font_ascent = ($this->CurrentFont['desc']['Ascent'] * $size / 1000); + } + if (isset($this->CurrentFont['desc']['Descent']) AND ($this->CurrentFont['desc']['Descent'] <= 0)) { + $font_descent = (- $this->CurrentFont['desc']['Descent'] * $size / 1000); + } + if (!isset($font_ascent) AND !isset($font_descent)) { + // core font + $font_ascent = 0.76 * $font_height; + $font_descent = $font_height - $font_ascent; + } elseif (!isset($font_descent)) { + $font_descent = $font_height - $font_ascent; + } elseif (!isset($font_ascent)) { + $font_ascent = $font_height - $font_descent; + } + $this->FontAscent = ($font_ascent / $this->k); + $this->FontDescent = ($font_descent / $this->k); + if ($out AND ($this->page > 0) AND (isset($this->CurrentFont['i'])) AND ($this->state == 2)) { + $this->_out(sprintf('BT /F%d %F Tf ET', $this->CurrentFont['i'], $this->FontSizePt)); + } + } + + /** + * Returns the bounding box of the current font in user units. + * @return array + * @public + * @since 5.9.152 (2012-03-23) + */ + public function getFontBBox() { + $fbbox = array(); + if (isset($this->CurrentFont['desc']['FontBBox'])) { + $tmpbbox = explode(' ', substr($this->CurrentFont['desc']['FontBBox'], 1, -1)); + $fbbox = array_map(array($this,'getAbsFontMeasure'), $tmpbbox); + } else { + // Find max width + if (isset($this->CurrentFont['desc']['MaxWidth'])) { + $maxw = $this->getAbsFontMeasure(intval($this->CurrentFont['desc']['MaxWidth'])); + } else { + $maxw = 0; + if (isset($this->CurrentFont['desc']['MissingWidth'])) { + $maxw = max($maxw, $this->CurrentFont['desc']['MissingWidth']); + } + if (isset($this->CurrentFont['desc']['AvgWidth'])) { + $maxw = max($maxw, $this->CurrentFont['desc']['AvgWidth']); + } + if (isset($this->CurrentFont['dw'])) { + $maxw = max($maxw, $this->CurrentFont['dw']); + } + foreach ($this->CurrentFont['cw'] as $char => $w) { + $maxw = max($maxw, $w); + } + if ($maxw == 0) { + $maxw = 600; + } + $maxw = $this->getAbsFontMeasure($maxw); + } + $fbbox = array(0, (0 - $this->FontDescent), $maxw, $this->FontAscent); + } + return $fbbox; + } + + /** + * Convert a relative font measure into absolute value. + * @param int $s Font measure. + * @return float Absolute measure. + * @since 5.9.186 (2012-09-13) + */ + public function getAbsFontMeasure($s) { + return ($s * $this->FontSize / 1000); + } + + /** + * Returns the glyph bounding box of the specified character in the current font in user units. + * @param int $char Input character code. + * @return false|array array(xMin, yMin, xMax, yMax) or FALSE if not defined. + * @since 5.9.186 (2012-09-13) + */ + public function getCharBBox($char) { + $c = intval($char); + if (isset($this->CurrentFont['cw'][$c])) { + // glyph is defined ... use zero width & height for glyphs without outlines + $result = array(0,0,0,0); + if (isset($this->CurrentFont['cbbox'][$c])) { + $result = $this->CurrentFont['cbbox'][$c]; + } + return array_map(array($this,'getAbsFontMeasure'), $result); + } + return false; + } + + /** + * Return the font descent value + * @param string $font font name + * @param string $style font style + * @param float $size The size (in points) + * @return int font descent + * @public + * @author Nicola Asuni + * @since 4.9.003 (2010-03-30) + */ + public function getFontDescent($font, $style='', $size=0) { + $fontdata = $this->AddFont($font, $style); + $fontinfo = $this->getFontBuffer($fontdata['fontkey']); + if (isset($fontinfo['desc']['Descent']) AND ($fontinfo['desc']['Descent'] <= 0)) { + $descent = (- $fontinfo['desc']['Descent'] * $size / 1000); + } else { + $descent = (1.219 * 0.24 * $size); + } + return ($descent / $this->k); + } + + /** + * Return the font ascent value. + * @param string $font font name + * @param string $style font style + * @param float $size The size (in points) + * @return int font ascent + * @public + * @author Nicola Asuni + * @since 4.9.003 (2010-03-30) + */ + public function getFontAscent($font, $style='', $size=0) { + $fontdata = $this->AddFont($font, $style); + $fontinfo = $this->getFontBuffer($fontdata['fontkey']); + if (isset($fontinfo['desc']['Ascent']) AND ($fontinfo['desc']['Ascent'] > 0)) { + $ascent = ($fontinfo['desc']['Ascent'] * $size / 1000); + } else { + $ascent = 1.219 * 0.76 * $size; + } + return ($ascent / $this->k); + } + + /** + * Return true in the character is present in the specified font. + * @param mixed $char Character to check (integer value or string) + * @param string $font Font name (family name). + * @param string $style Font style. + * @return bool true if the char is defined, false otherwise. + * @public + * @since 5.9.153 (2012-03-28) + */ + public function isCharDefined($char, $font='', $style='') { + if (is_string($char)) { + // get character code + $char = TCPDF_FONTS::UTF8StringToArray($char, $this->isunicode, $this->CurrentFont); + $char = $char[0]; + } + if (TCPDF_STATIC::empty_string($font)) { + if (TCPDF_STATIC::empty_string($style)) { + return (isset($this->CurrentFont['cw'][intval($char)])); + } + $font = $this->FontFamily; + } + $fontdata = $this->AddFont($font, $style); + $fontinfo = $this->getFontBuffer($fontdata['fontkey']); + return (isset($fontinfo['cw'][intval($char)])); + } + + /** + * Replace missing font characters on selected font with specified substitutions. + * @param string $text Text to process. + * @param string $font Font name (family name). + * @param string $style Font style. + * @param array $subs Array of possible character substitutions. The key is the character to check (integer value) and the value is a single intege value or an array of possible substitutes. + * @return string Processed text. + * @public + * @since 5.9.153 (2012-03-28) + */ + public function replaceMissingChars($text, $font='', $style='', $subs=array()) { + if (empty($subs)) { + return $text; + } + if (TCPDF_STATIC::empty_string($font)) { + $font = $this->FontFamily; + } + $fontdata = $this->AddFont($font, $style); + $fontinfo = $this->getFontBuffer($fontdata['fontkey']); + $uniarr = TCPDF_FONTS::UTF8StringToArray($text, $this->isunicode, $this->CurrentFont); + foreach ($uniarr as $k => $chr) { + if (!isset($fontinfo['cw'][$chr])) { + // this character is missing on the selected font + if (isset($subs[$chr])) { + // we have available substitutions + if (is_array($subs[$chr])) { + foreach($subs[$chr] as $s) { + if (isset($fontinfo['cw'][$s])) { + $uniarr[$k] = $s; + break; + } + } + } elseif (isset($fontinfo['cw'][$subs[$chr]])) { + $uniarr[$k] = $subs[$chr]; + } + } + } + } + return TCPDF_FONTS::UniArrSubString(TCPDF_FONTS::UTF8ArrayToUniArray($uniarr, $this->isunicode)); + } + + /** + * Defines the default monospaced font. + * @param string $font Font name. + * @public + * @since 4.5.025 + */ + public function setDefaultMonospacedFont($font) { + $this->default_monospaced_font = $font; + } + + /** + * Creates a new internal link and returns its identifier. An internal link is a clickable area which directs to another place within the document.
        + * The identifier can then be passed to Cell(), Write(), Image() or Link(). The destination is defined with SetLink(). + * @public + * @since 1.5 + * @see Cell(), Write(), Image(), Link(), SetLink() + */ + public function AddLink() { + // create a new internal link + $n = count($this->links) + 1; + $this->links[$n] = array('p' => 0, 'y' => 0, 'f' => false); + return $n; + } + + /** + * Defines the page and position a link points to. + * @param int $link The link identifier returned by AddLink() + * @param float $y Ordinate of target position; -1 indicates the current position. The default value is 0 (top of page) + * @param int|string $page Number of target page; -1 indicates the current page (default value). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. + * @public + * @since 1.5 + * @see AddLink() + */ + public function setLink($link, $y=0, $page=-1) { + $fixed = false; + if (!empty($page) AND (substr($page, 0, 1) == '*')) { + $page = intval(substr($page, 1)); + // this page number will not be changed when moving/add/deleting pages + $fixed = true; + } + if ($page < 0) { + $page = $this->page; + } + if ($y == -1) { + $y = $this->y; + } + $this->links[$link] = array('p' => $page, 'y' => $y, 'f' => $fixed); + } + + /** + * Puts a link on a rectangular area of the page. + * Text or image links are generally put via Cell(), Write() or Image(), but this method can be useful for instance to define a clickable area inside an image. + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param mixed $link URL or identifier returned by AddLink() + * @param int $spaces number of spaces on the text to link + * @public + * @since 1.5 + * @see AddLink(), Annotation(), Cell(), Write(), Image() + */ + public function Link($x, $y, $w, $h, $link, $spaces=0) { + $this->Annotation($x, $y, $w, $h, $link, array('Subtype'=>'Link'), $spaces); + } + + /** + * Puts a markup annotation on a rectangular area of the page. + * !!!!THE ANNOTATION SUPPORT IS NOT YET FULLY IMPLEMENTED !!!! + * @param float $x Abscissa of the upper-left corner of the rectangle + * @param float $y Ordinate of the upper-left corner of the rectangle + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param string $text annotation text or alternate content + * @param array $opt array of options (see section 8.4 of PDF reference 1.7). + * @param int $spaces number of spaces on the text to link + * @public + * @since 4.0.018 (2008-08-06) + */ + public function Annotation($x, $y, $w, $h, $text, $opt=array('Subtype'=>'Text'), $spaces=0) { + if ($this->inxobj) { + // store parameters for later use on template + $this->xobjects[$this->xobjid]['annotations'][] = array('x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'text' => $text, 'opt' => $opt, 'spaces' => $spaces); + return; + } + if ($x === '') { + $x = $this->x; + } + if ($y === '') { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + // recalculate coordinates to account for graphic transformations + if (isset($this->transfmatrix) AND !empty($this->transfmatrix)) { + for ($i=$this->transfmatrix_key; $i > 0; --$i) { + $maxid = count($this->transfmatrix[$i]) - 1; + for ($j=$maxid; $j >= 0; --$j) { + $ctm = $this->transfmatrix[$i][$j]; + if (isset($ctm['a'])) { + $x = $x * $this->k; + $y = ($this->h - $y) * $this->k; + $w = $w * $this->k; + $h = $h * $this->k; + // top left + $xt = $x; + $yt = $y; + $x1 = ($ctm['a'] * $xt) + ($ctm['c'] * $yt) + $ctm['e']; + $y1 = ($ctm['b'] * $xt) + ($ctm['d'] * $yt) + $ctm['f']; + // top right + $xt = $x + $w; + $yt = $y; + $x2 = ($ctm['a'] * $xt) + ($ctm['c'] * $yt) + $ctm['e']; + $y2 = ($ctm['b'] * $xt) + ($ctm['d'] * $yt) + $ctm['f']; + // bottom left + $xt = $x; + $yt = $y - $h; + $x3 = ($ctm['a'] * $xt) + ($ctm['c'] * $yt) + $ctm['e']; + $y3 = ($ctm['b'] * $xt) + ($ctm['d'] * $yt) + $ctm['f']; + // bottom right + $xt = $x + $w; + $yt = $y - $h; + $x4 = ($ctm['a'] * $xt) + ($ctm['c'] * $yt) + $ctm['e']; + $y4 = ($ctm['b'] * $xt) + ($ctm['d'] * $yt) + $ctm['f']; + // new coordinates (rectangle area) + $x = min($x1, $x2, $x3, $x4); + $y = max($y1, $y2, $y3, $y4); + $w = (max($x1, $x2, $x3, $x4) - $x) / $this->k; + $h = ($y - min($y1, $y2, $y3, $y4)) / $this->k; + $x = $x / $this->k; + $y = $this->h - ($y / $this->k); + } + } + } + } + if ($this->page <= 0) { + $page = 1; + } else { + $page = $this->page; + } + if (!isset($this->PageAnnots[$page])) { + $this->PageAnnots[$page] = array(); + } + $this->PageAnnots[$page][] = array('n' => ++$this->n, 'x' => $x, 'y' => $y, 'w' => $w, 'h' => $h, 'txt' => $text, 'opt' => $opt, 'numspaces' => $spaces); + if (!$this->pdfa_mode || ($this->pdfa_mode && $this->pdfa_version == 3)) { + if ((($opt['Subtype'] == 'FileAttachment') OR ($opt['Subtype'] == 'Sound')) AND (!TCPDF_STATIC::empty_string($opt['FS'])) + AND (@TCPDF_STATIC::file_exists($opt['FS']) OR TCPDF_STATIC::isValidURL($opt['FS'])) + AND (!isset($this->embeddedfiles[basename($opt['FS'])]))) { + $this->embeddedfiles[basename($opt['FS'])] = array('f' => ++$this->n, 'n' => ++$this->n, 'file' => $opt['FS']); + } + } + // Add widgets annotation's icons + if (isset($opt['mk']['i']) AND @TCPDF_STATIC::file_exists($opt['mk']['i'])) { + $this->Image($opt['mk']['i'], '', '', 10, 10, '', '', '', false, 300, '', false, false, 0, false, true); + } + if (isset($opt['mk']['ri']) AND @TCPDF_STATIC::file_exists($opt['mk']['ri'])) { + $this->Image($opt['mk']['ri'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true); + } + if (isset($opt['mk']['ix']) AND @TCPDF_STATIC::file_exists($opt['mk']['ix'])) { + $this->Image($opt['mk']['ix'], '', '', 0, 0, '', '', '', false, 300, '', false, false, 0, false, true); + } + } + + /** + * Embedd the attached files. + * @since 4.4.000 (2008-12-07) + * @protected + * @see Annotation() + */ + protected function _putEmbeddedFiles() { + if ($this->pdfa_mode && $this->pdfa_version != 3) { + // embedded files are not allowed in PDF/A mode version 1 and 2 + return; + } + reset($this->embeddedfiles); + foreach ($this->embeddedfiles as $filename => $filedata) { + $data = $this->getCachedFileContents($filedata['file']); + if ($data !== FALSE) { + $rawsize = strlen($data); + if ($rawsize > 0) { + // update name tree + $this->efnames[$filename] = $filedata['f'].' 0 R'; + // embedded file specification object + $out = $this->_getobj($filedata['f'])."\n"; + $out .= '<_datastring($filename, $filedata['f']); + $out .= ' /UF '.$this->_datastring($filename, $filedata['f']); + $out .= ' /AFRelationship /Source'; + $out .= ' /EF <> >>'; + $out .= "\n".'endobj'; + $this->_out($out); + // embedded file object + $filter = ''; + if ($this->compress) { + $data = gzcompress($data); + $filter = ' /Filter /FlateDecode'; + } + + if ($this->pdfa_version == 3) { + $filter = ' /Subtype /text#2Fxml'; + } + + $stream = $this->_getrawstream($data, $filedata['n']); + $out = $this->_getobj($filedata['n'])."\n"; + $out .= '<< /Type /EmbeddedFile'.$filter.' /Length '.strlen($stream).' /Params <> >>'; + $out .= ' stream'."\n".$stream."\n".'endstream'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + } + } + + /** + * Prints a text cell at the specified position. + * This method allows to place a string precisely on the page. + * @param float $x Abscissa of the cell origin + * @param float $y Ordinate of the cell origin + * @param string $txt String to print + * @param int $fstroke outline size in user units (0 = disable) + * @param boolean $fclip if true activate clipping mode (you must call StartTransform() before this function and StopTransform() to stop the clipping tranformation). + * @param boolean $ffill if true fills the text + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param int $ln Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • A : font top
        • L : font baseline
        • D : font bottom
        • B : cell bottom
        + * @param string $valign text vertical alignment inside the cell. Possible values are:
        • T : top
        • C : center
        • B : bottom
        + * @param boolean $rtloff if true uses the page top-left corner as origin of axis for $x and $y initial position. + * @public + * @since 1.0 + * @see Cell(), Write(), MultiCell(), WriteHTML(), WriteHTMLCell() + */ + public function Text($x, $y, $txt, $fstroke=0, $fclip=false, $ffill=true, $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M', $rtloff=false) { + $textrendermode = $this->textrendermode; + $textstrokewidth = $this->textstrokewidth; + $this->setTextRenderingMode($fstroke, $ffill, $fclip); + $this->setXY($x, $y, $rtloff); + $this->Cell(0, 0, $txt, $border, $ln, $align, $fill, $link, $stretch, $ignore_min_height, $calign, $valign); + // restore previous rendering mode + $this->textrendermode = $textrendermode; + $this->textstrokewidth = $textstrokewidth; + } + + /** + * Whenever a page break condition is met, the method is called, and the break is issued or not depending on the returned value. + * The default implementation returns a value according to the mode selected by SetAutoPageBreak().
        + * This method is called automatically and should not be called directly by the application. + * @return bool + * @public + * @since 1.4 + * @see SetAutoPageBreak() + */ + public function AcceptPageBreak() { + if ($this->num_columns > 1) { + // multi column mode + if ($this->current_column < ($this->num_columns - 1)) { + // go to next column + $this->selectColumn($this->current_column + 1); + } elseif ($this->AutoPageBreak) { + // add a new page + $this->AddPage(); + // set first column + $this->selectColumn(0); + } + // avoid page breaking from checkPageBreak() + return false; + } + return $this->AutoPageBreak; + } + + /** + * Add page if needed. + * @param float $h Cell height. Default value: 0. + * @param float|null $y starting y position, leave empty for current position. + * @param bool $addpage if true add a page, otherwise only return the true/false state + * @return bool true in case of page break, false otherwise. + * @since 3.2.000 (2008-07-01) + * @protected + */ + protected function checkPageBreak($h=0, $y=null, $addpage=true) { + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + $current_page = $this->page; + if ((($y + $h) > $this->PageBreakTrigger) AND ($this->inPageBody()) AND ($this->AcceptPageBreak())) { + if ($addpage) { + //Automatic page break + $x = $this->x; + $this->AddPage($this->CurOrientation); + $this->y = $this->tMargin; + $oldpage = $this->page - 1; + if ($this->rtl) { + if ($this->pagedim[$this->page]['orm'] != $this->pagedim[$oldpage]['orm']) { + $this->x = $x - ($this->pagedim[$this->page]['orm'] - $this->pagedim[$oldpage]['orm']); + } else { + $this->x = $x; + } + } else { + if ($this->pagedim[$this->page]['olm'] != $this->pagedim[$oldpage]['olm']) { + $this->x = $x + ($this->pagedim[$this->page]['olm'] - $this->pagedim[$oldpage]['olm']); + } else { + $this->x = $x; + } + } + } + return true; + } + if ($current_page != $this->page) { + // account for columns mode + return true; + } + return false; + } + + /** + * Prints a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
        + * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. + * @param float $w Cell width. If 0, the cell extends up to the right margin. + * @param float $h Cell height. Default value: 0. + * @param string $txt String to print. Default value: empty string. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param int $ln Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • C : center
        • B : cell bottom
        • A : font top
        • L : font baseline
        • D : font bottom
        + * @param string $valign text vertical alignment inside the cell. Possible values are:
        • T : top
        • C : center
        • B : bottom
        + * @public + * @since 1.0 + * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), AddLink(), Ln(), MultiCell(), Write(), SetAutoPageBreak() + */ + public function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { + $prev_cell_margin = $this->cell_margin; + $prev_cell_padding = $this->cell_padding; + $this->adjustCellPadding($border); + if (!$ignore_min_height) { + $min_cell_height = $this->getCellHeight($this->FontSize); + if ($h < $min_cell_height) { + $h = $min_cell_height; + } + } + $this->checkPageBreak($h + $this->cell_margin['T'] + $this->cell_margin['B']); + // apply text shadow if enabled + if ($this->txtshadow['enabled']) { + // save data + $x = $this->x; + $y = $this->y; + $bc = $this->bgcolor; + $fc = $this->fgcolor; + $sc = $this->strokecolor; + $alpha = $this->alpha; + // print shadow + $this->x += $this->txtshadow['depth_w']; + $this->y += $this->txtshadow['depth_h']; + $this->setFillColorArray($this->txtshadow['color']); + $this->setTextColorArray($this->txtshadow['color']); + $this->setDrawColorArray($this->txtshadow['color']); + if ($this->txtshadow['opacity'] != $alpha['CA']) { + $this->setAlpha($this->txtshadow['opacity'], $this->txtshadow['blend_mode']); + } + if ($this->state == 2) { + $this->_out($this->getCellCode($w, $h, $txt, $border, $ln, $align, $fill, $link, $stretch, true, $calign, $valign)); + } + //restore data + $this->x = $x; + $this->y = $y; + $this->setFillColorArray($bc); + $this->setTextColorArray($fc); + $this->setDrawColorArray($sc); + if ($this->txtshadow['opacity'] != $alpha['CA']) { + $this->setAlpha($alpha['CA'], $alpha['BM'], $alpha['ca'], $alpha['AIS']); + } + } + if ($this->state == 2) { + $this->_out($this->getCellCode($w, $h, $txt, $border, $ln, $align, $fill, $link, $stretch, true, $calign, $valign)); + } + $this->cell_padding = $prev_cell_padding; + $this->cell_margin = $prev_cell_margin; + } + + /** + * Returns the PDF string code to print a cell (rectangular area) with optional borders, background color and character string. The upper-left corner of the cell corresponds to the current position. The text can be aligned or centered. After the call, the current position moves to the right or to the next line. It is possible to put a link on the text.
        + * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. + * @param float $w Cell width. If 0, the cell extends up to the right margin. + * @param float $h Cell height. Default value: 0. + * @param string $txt String to print. Default value: empty string. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param int $ln Indicates where the current position should go after the call. Possible values are:
        • 0: to the right (or left for RTL languages)
        • 1: to the beginning of the next line
        • 2: below
        Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param mixed $link URL or identifier returned by AddLink(). + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $ignore_min_height if true ignore automatic minimum height value. + * @param string $calign cell vertical alignment relative to the specified Y value. Possible values are:
        • T : cell top
        • C : center
        • B : cell bottom
        • A : font top
        • L : font baseline
        • D : font bottom
        + * @param string $valign text vertical alignment inside the cell. Possible values are:
        • T : top
        • M : middle
        • B : bottom
        + * @return string containing cell code + * @protected + * @since 1.0 + * @see Cell() + */ + protected function getCellCode($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='', $stretch=0, $ignore_min_height=false, $calign='T', $valign='M') { + // replace 'NO-BREAK SPACE' (U+00A0) character with a simple space + $txt = is_null($txt) ? '' : $txt; + $txt = str_replace(TCPDF_FONTS::unichr(160, $this->isunicode), ' ', $txt); + $prev_cell_margin = $this->cell_margin; + $prev_cell_padding = $this->cell_padding; + $txt = TCPDF_STATIC::removeSHY($txt, $this->isunicode); + $rs = ''; //string to be returned + $this->adjustCellPadding($border); + if (!$ignore_min_height) { + $min_cell_height = $this->getCellHeight($this->FontSize); + if ($h < $min_cell_height) { + $h = $min_cell_height; + } + } + $k = $this->k; + // check page for no-write regions and adapt page margins if necessary + list($this->x, $this->y) = $this->checkPageRegions($h, $this->x, $this->y); + if ($this->rtl) { + $x = $this->x - $this->cell_margin['R']; + } else { + $x = $this->x + $this->cell_margin['L']; + } + $y = $this->y + $this->cell_margin['T']; + $prev_font_stretching = $this->font_stretching; + $prev_font_spacing = $this->font_spacing; + // cell vertical alignment + switch ($calign) { + case 'A': { + // font top + switch ($valign) { + case 'T': { + // top + $y -= $this->cell_padding['T']; + break; + } + case 'B': { + // bottom + $y -= ($h - $this->cell_padding['B'] - $this->FontAscent - $this->FontDescent); + break; + } + default: + case 'C': + case 'M': { + // center + $y -= (($h - $this->FontAscent - $this->FontDescent) / 2); + break; + } + } + break; + } + case 'L': { + // font baseline + switch ($valign) { + case 'T': { + // top + $y -= ($this->cell_padding['T'] + $this->FontAscent); + break; + } + case 'B': { + // bottom + $y -= ($h - $this->cell_padding['B'] - $this->FontDescent); + break; + } + default: + case 'C': + case 'M': { + // center + $y -= (($h + $this->FontAscent - $this->FontDescent) / 2); + break; + } + } + break; + } + case 'D': { + // font bottom + switch ($valign) { + case 'T': { + // top + $y -= ($this->cell_padding['T'] + $this->FontAscent + $this->FontDescent); + break; + } + case 'B': { + // bottom + $y -= ($h - $this->cell_padding['B']); + break; + } + default: + case 'C': + case 'M': { + // center + $y -= (($h + $this->FontAscent + $this->FontDescent) / 2); + break; + } + } + break; + } + case 'B': { + // cell bottom + $y -= $h; + break; + } + case 'C': + case 'M': { + // cell center + $y -= ($h / 2); + break; + } + default: + case 'T': { + // cell top + break; + } + } + // text vertical alignment + switch ($valign) { + case 'T': { + // top + $yt = $y + $this->cell_padding['T']; + break; + } + case 'B': { + // bottom + $yt = $y + $h - $this->cell_padding['B'] - $this->FontAscent - $this->FontDescent; + break; + } + default: + case 'C': + case 'M': { + // center + $yt = $y + (($h - $this->FontAscent - $this->FontDescent) / 2); + break; + } + } + $basefonty = $yt + $this->FontAscent; + if (TCPDF_STATIC::empty_string($w) OR ($w <= 0)) { + if ($this->rtl) { + $w = $x - $this->lMargin; + } else { + $w = $this->w - $this->rMargin - $x; + } + } + $s = ''; + // fill and borders + if (is_string($border) AND (strlen($border) == 4)) { + // full border + $border = 1; + } + if ($fill OR ($border == 1)) { + if ($fill) { + $op = ($border == 1) ? 'B' : 'f'; + } else { + $op = 'S'; + } + if ($this->rtl) { + $xk = (($x - $w) * $k); + } else { + $xk = ($x * $k); + } + $s .= sprintf('%F %F %F %F re %s ', $xk, (($this->h - $y) * $k), ($w * $k), (-$h * $k), $op); + } + // draw borders + $s .= $this->getCellBorder($x, $y, $w, $h, $border); + if ($txt != '') { + $txt2 = $txt; + if ($this->isunicode) { + if (($this->CurrentFont['type'] == 'core') OR ($this->CurrentFont['type'] == 'TrueType') OR ($this->CurrentFont['type'] == 'Type1')) { + $txt2 = TCPDF_FONTS::UTF8ToLatin1($txt2, $this->isunicode, $this->CurrentFont); + } else { + $unicode = TCPDF_FONTS::UTF8StringToArray($txt, $this->isunicode, $this->CurrentFont); // array of UTF-8 unicode values + $unicode = TCPDF_FONTS::utf8Bidi($unicode, '', $this->tmprtl, $this->isunicode, $this->CurrentFont); + // replace thai chars (if any) + if (defined('K_THAI_TOPCHARS') AND (K_THAI_TOPCHARS == true)) { + // number of chars + $numchars = count($unicode); + // po pla, for far, for fan + $longtail = array(0x0e1b, 0x0e1d, 0x0e1f); + // do chada, to patak + $lowtail = array(0x0e0e, 0x0e0f); + // mai hun arkad, sara i, sara ii, sara ue, sara uee + $upvowel = array(0x0e31, 0x0e34, 0x0e35, 0x0e36, 0x0e37); + // mai ek, mai tho, mai tri, mai chattawa, karan + $tonemark = array(0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c); + // sara u, sara uu, pinthu + $lowvowel = array(0x0e38, 0x0e39, 0x0e3a); + $output = array(); + for ($i = 0; $i < $numchars; $i++) { + if (($unicode[$i] >= 0x0e00) && ($unicode[$i] <= 0x0e5b)) { + $ch0 = $unicode[$i]; + $ch1 = ($i > 0) ? $unicode[($i - 1)] : 0; + $ch2 = ($i > 1) ? $unicode[($i - 2)] : 0; + $chn = ($i < ($numchars - 1)) ? $unicode[($i + 1)] : 0; + if (in_array($ch0, $tonemark)) { + if ($chn == 0x0e33) { + // sara um + if (in_array($ch1, $longtail)) { + // tonemark at upper left + $output[] = $this->replaceChar($ch0, (0xf713 + $ch0 - 0x0e48)); + } else { + // tonemark at upper right (normal position) + $output[] = $ch0; + } + } elseif (in_array($ch1, $longtail) OR (in_array($ch2, $longtail) AND in_array($ch1, $lowvowel))) { + // tonemark at lower left + $output[] = $this->replaceChar($ch0, (0xf705 + $ch0 - 0x0e48)); + } elseif (in_array($ch1, $upvowel)) { + if (in_array($ch2, $longtail)) { + // tonemark at upper left + $output[] = $this->replaceChar($ch0, (0xf713 + $ch0 - 0x0e48)); + } else { + // tonemark at upper right (normal position) + $output[] = $ch0; + } + } else { + // tonemark at lower right + $output[] = $this->replaceChar($ch0, (0xf70a + $ch0 - 0x0e48)); + } + } elseif (($ch0 == 0x0e33) AND (in_array($ch1, $longtail) OR (in_array($ch2, $longtail) AND in_array($ch1, $tonemark)))) { + // add lower left nikhahit and sara aa + if ($this->isCharDefined(0xf711) AND $this->isCharDefined(0x0e32)) { + $output[] = 0xf711; + $this->CurrentFont['subsetchars'][0xf711] = true; + $output[] = 0x0e32; + $this->CurrentFont['subsetchars'][0x0e32] = true; + } else { + $output[] = $ch0; + } + } elseif (in_array($ch1, $longtail)) { + if ($ch0 == 0x0e31) { + // lower left mai hun arkad + $output[] = $this->replaceChar($ch0, 0xf710); + } elseif (in_array($ch0, $upvowel)) { + // lower left + $output[] = $this->replaceChar($ch0, (0xf701 + $ch0 - 0x0e34)); + } elseif ($ch0 == 0x0e47) { + // lower left mai tai koo + $output[] = $this->replaceChar($ch0, 0xf712); + } else { + // normal character + $output[] = $ch0; + } + } elseif (in_array($ch1, $lowtail) AND in_array($ch0, $lowvowel)) { + // lower vowel + $output[] = $this->replaceChar($ch0, (0xf718 + $ch0 - 0x0e38)); + } elseif (($ch0 == 0x0e0d) AND in_array($chn, $lowvowel)) { + // yo ying without lower part + $output[] = $this->replaceChar($ch0, 0xf70f); + } elseif (($ch0 == 0x0e10) AND in_array($chn, $lowvowel)) { + // tho santan without lower part + $output[] = $this->replaceChar($ch0, 0xf700); + } else { + $output[] = $ch0; + } + } else { + // non-thai character + $output[] = $unicode[$i]; + } + } + $unicode = $output; + // update font subsetchars + $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']); + } // end of K_THAI_TOPCHARS + $txt2 = TCPDF_FONTS::arrUTF8ToUTF16BE($unicode, false); + } + } + $txt2 = TCPDF_STATIC::_escape($txt2); + // get current text width (considering general font stretching and spacing) + $txwidth = $this->GetStringWidth($txt); + $width = $txwidth; + // check for stretch mode + if ($stretch > 0) { + // calculate ratio between cell width and text width + if ($width <= 0) { + $ratio = 1; + } else { + $ratio = (($w - $this->cell_padding['L'] - $this->cell_padding['R']) / $width); + } + // check if stretching is required + if (($ratio < 1) OR (($ratio > 1) AND (($stretch % 2) == 0))) { + // the text will be stretched to fit cell width + if ($stretch > 2) { + // set new character spacing + $this->font_spacing += ($w - $this->cell_padding['L'] - $this->cell_padding['R'] - $width) / (max(($this->GetNumChars($txt) - 1), 1) * ($this->font_stretching / 100)); + } else { + // set new horizontal stretching + $this->font_stretching *= $ratio; + } + // recalculate text width (the text fills the entire cell) + $width = $w - $this->cell_padding['L'] - $this->cell_padding['R']; + // reset alignment + $align = ''; + } + } + if ($this->font_stretching != 100) { + // apply font stretching + $rs .= sprintf('BT %F Tz ET ', $this->font_stretching); + } + if ($this->font_spacing != 0) { + // increase/decrease font spacing + $rs .= sprintf('BT %F Tc ET ', ($this->font_spacing * $this->k)); + } + if ($this->ColorFlag AND ($this->textrendermode < 4)) { + $s .= 'q '.$this->TextColor.' '; + } + // rendering mode + $s .= sprintf('BT %d Tr %F w ET ', $this->textrendermode, ($this->textstrokewidth * $this->k)); + // count number of spaces + $ns = substr_count($txt, chr(32)); + // Justification + $spacewidth = 0; + if (($align == 'J') AND ($ns > 0)) { + if ($this->isUnicodeFont()) { + // get string width without spaces + $width = $this->GetStringWidth(str_replace(' ', '', $txt)); + // calculate average space width + $spacewidth = -1000 * ($w - $width - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1) / ($this->FontSize?$this->FontSize:1); + if ($this->font_stretching != 100) { + // word spacing is affected by stretching + $spacewidth /= ($this->font_stretching / 100); + } + // set word position to be used with TJ operator + $txt2 = str_replace(chr(0).chr(32), ') '.sprintf('%F', $spacewidth).' (', $txt2); + $unicode_justification = true; + } else { + // get string width + $width = $txwidth; + // new space width + $spacewidth = (($w - $width - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1)) * $this->k; + if ($this->font_stretching != 100) { + // word spacing (Tw) is affected by stretching + $spacewidth /= ($this->font_stretching / 100); + } + // set word spacing + $rs .= sprintf('BT %F Tw ET ', $spacewidth); + } + $width = $w - $this->cell_padding['L'] - $this->cell_padding['R']; + } + // replace carriage return characters + $txt2 = str_replace("\r", ' ', $txt2); + switch ($align) { + case 'C': { + $dx = ($w - $width) / 2; + break; + } + case 'R': { + if ($this->rtl) { + $dx = $this->cell_padding['R']; + } else { + $dx = $w - $width - $this->cell_padding['R']; + } + break; + } + case 'L': { + if ($this->rtl) { + $dx = $w - $width - $this->cell_padding['L']; + } else { + $dx = $this->cell_padding['L']; + } + break; + } + case 'J': + default: { + if ($this->rtl) { + $dx = $this->cell_padding['R']; + } else { + $dx = $this->cell_padding['L']; + } + break; + } + } + if ($this->rtl) { + $xdx = $x - $dx - $width; + } else { + $xdx = $x + $dx; + } + $xdk = $xdx * $k; + // print text + $s .= sprintf('BT %F %F Td [(%s)] TJ ET', $xdk, (($this->h - $basefonty) * $k), $txt2); + if (isset($uniblock)) { // @phpstan-ignore-line + // print overlapping characters as separate string + $xshift = 0; // horizontal shift + $ty = (($this->h - $basefonty + (0.2 * $this->FontSize)) * $k); + $spw = (($w - $txwidth - $this->cell_padding['L'] - $this->cell_padding['R']) / ($ns?$ns:1)); + foreach ($uniblock as $uk => $uniarr) { // @phpstan-ignore-line + if (($uk % 2) == 0) { + // x space to skip + if ($spacewidth != 0) { + // justification shift + $xshift += (count(array_keys($uniarr, 32)) * $spw); + } + $xshift += $this->GetArrStringWidth($uniarr); // + shift justification + } else { + // character to print + $topchr = TCPDF_FONTS::arrUTF8ToUTF16BE($uniarr, false); + $topchr = TCPDF_STATIC::_escape($topchr); + $s .= sprintf(' BT %F %F Td [(%s)] TJ ET', ($xdk + ($xshift * $k)), $ty, $topchr); + } + } + } + if ($this->underline) { + $s .= ' '.$this->_dounderlinew($xdx, $basefonty, $width); + } + if ($this->linethrough) { + $s .= ' '.$this->_dolinethroughw($xdx, $basefonty, $width); + } + if ($this->overline) { + $s .= ' '.$this->_dooverlinew($xdx, $basefonty, $width); + } + if ($this->ColorFlag AND ($this->textrendermode < 4)) { + $s .= ' Q'; + } + if ($link) { + $this->Link($xdx, $yt, $width, ($this->FontAscent + $this->FontDescent), $link, $ns); + } + } + // output cell + if ($s) { + // output cell + $rs .= $s; + if ($this->font_spacing != 0) { + // reset font spacing mode + $rs .= ' BT 0 Tc ET'; + } + if ($this->font_stretching != 100) { + // reset font stretching mode + $rs .= ' BT 100 Tz ET'; + } + } + // reset word spacing + if (!$this->isUnicodeFont() AND ($align == 'J')) { + $rs .= ' BT 0 Tw ET'; + } + // reset stretching and spacing + $this->font_stretching = $prev_font_stretching; + $this->font_spacing = $prev_font_spacing; + $this->lasth = $h; + if ($ln > 0) { + //Go to the beginning of the next line + $this->y = $y + $h + $this->cell_margin['B']; + if ($ln == 1) { + if ($this->rtl) { + $this->x = $this->w - $this->rMargin; + } else { + $this->x = $this->lMargin; + } + } + } else { + // go left or right by case + if ($this->rtl) { + $this->x = $x - $w - $this->cell_margin['L']; + } else { + $this->x = $x + $w + $this->cell_margin['R']; + } + } + $gstyles = ''.$this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '.$this->FillColor."\n"; + $rs = $gstyles.$rs; + $this->cell_padding = $prev_cell_padding; + $this->cell_margin = $prev_cell_margin; + return $rs; + } + + /** + * Replace a char if is defined on the current font. + * @param int $oldchar Integer code (unicode) of the character to replace. + * @param int $newchar Integer code (unicode) of the new character. + * @return int the replaced char or the old char in case the new char i not defined + * @protected + * @since 5.9.167 (2012-06-22) + */ + protected function replaceChar($oldchar, $newchar) { + if ($this->isCharDefined($newchar)) { + // add the new char on the subset list + $this->CurrentFont['subsetchars'][$newchar] = true; + // return the new character + return $newchar; + } + // return the old char + return $oldchar; + } + + /** + * Returns the code to draw the cell border + * @param float $x X coordinate. + * @param float $y Y coordinate. + * @param float $w Cell width. + * @param float $h Cell height. + * @param string|array|int $brd Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @return string containing cell border code + * @protected + * @see SetLineStyle() + * @since 5.7.000 (2010-08-02) + */ + protected function getCellBorder($x, $y, $w, $h, $brd) { + $s = ''; // string to be returned + if (empty($brd)) { + return $s; + } + if ($brd == 1) { + $brd = array('LRTB' => true); + } + // calculate coordinates for border + $k = $this->k; + if ($this->rtl) { + $xeL = ($x - $w) * $k; + $xeR = $x * $k; + } else { + $xeL = $x * $k; + $xeR = ($x + $w) * $k; + } + $yeL = (($this->h - ($y + $h)) * $k); + $yeT = (($this->h - $y) * $k); + $xeT = $xeL; + $xeB = $xeR; + $yeR = $yeT; + $yeB = $yeL; + if (is_string($brd)) { + // convert string to array + $slen = strlen($brd); + $newbrd = array(); + for ($i = 0; $i < $slen; ++$i) { + $newbrd[$brd[$i]] = array('cap' => 'square', 'join' => 'miter'); + } + $brd = $newbrd; + } + if (isset($brd['mode'])) { + $mode = $brd['mode']; + unset($brd['mode']); + } else { + $mode = 'normal'; + } + foreach ($brd as $border => $style) { + if (is_array($style) AND !empty($style)) { + // apply border style + $prev_style = $this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '; + $s .= $this->setLineStyle($style, true)."\n"; + } + switch ($mode) { + case 'ext': { + $off = (($this->LineWidth / 2) * $k); + $xL = $xeL - $off; + $xR = $xeR + $off; + $yT = $yeT + $off; + $yL = $yeL - $off; + $xT = $xL; + $xB = $xR; + $yR = $yT; + $yB = $yL; + $w += $this->LineWidth; + $h += $this->LineWidth; + break; + } + case 'int': { + $off = ($this->LineWidth / 2) * $k; + $xL = $xeL + $off; + $xR = $xeR - $off; + $yT = $yeT - $off; + $yL = $yeL + $off; + $xT = $xL; + $xB = $xR; + $yR = $yT; + $yB = $yL; + $w -= $this->LineWidth; + $h -= $this->LineWidth; + break; + } + case 'normal': + default: { + $xL = $xeL; + $xT = $xeT; + $xB = $xeB; + $xR = $xeR; + $yL = $yeL; + $yT = $yeT; + $yB = $yeB; + $yR = $yeR; + break; + } + } + // draw borders by case + if (strlen($border) == 4) { + $s .= sprintf('%F %F %F %F re S ', $xT, $yT, ($w * $k), (-$h * $k)); + } elseif (strlen($border) == 3) { + if (strpos($border,'B') === false) { // LTR + $s .= sprintf('%F %F m ', $xL, $yL); + $s .= sprintf('%F %F l ', $xT, $yT); + $s .= sprintf('%F %F l ', $xR, $yR); + $s .= sprintf('%F %F l ', $xB, $yB); + $s .= 'S '; + } elseif (strpos($border,'L') === false) { // TRB + $s .= sprintf('%F %F m ', $xT, $yT); + $s .= sprintf('%F %F l ', $xR, $yR); + $s .= sprintf('%F %F l ', $xB, $yB); + $s .= sprintf('%F %F l ', $xL, $yL); + $s .= 'S '; + } elseif (strpos($border,'T') === false) { // RBL + $s .= sprintf('%F %F m ', $xR, $yR); + $s .= sprintf('%F %F l ', $xB, $yB); + $s .= sprintf('%F %F l ', $xL, $yL); + $s .= sprintf('%F %F l ', $xT, $yT); + $s .= 'S '; + } elseif (strpos($border,'R') === false) { // BLT + $s .= sprintf('%F %F m ', $xB, $yB); + $s .= sprintf('%F %F l ', $xL, $yL); + $s .= sprintf('%F %F l ', $xT, $yT); + $s .= sprintf('%F %F l ', $xR, $yR); + $s .= 'S '; + } + } elseif (strlen($border) == 2) { + if ((strpos($border,'L') !== false) AND (strpos($border,'T') !== false)) { // LT + $s .= sprintf('%F %F m ', $xL, $yL); + $s .= sprintf('%F %F l ', $xT, $yT); + $s .= sprintf('%F %F l ', $xR, $yR); + $s .= 'S '; + } elseif ((strpos($border,'T') !== false) AND (strpos($border,'R') !== false)) { // TR + $s .= sprintf('%F %F m ', $xT, $yT); + $s .= sprintf('%F %F l ', $xR, $yR); + $s .= sprintf('%F %F l ', $xB, $yB); + $s .= 'S '; + } elseif ((strpos($border,'R') !== false) AND (strpos($border,'B') !== false)) { // RB + $s .= sprintf('%F %F m ', $xR, $yR); + $s .= sprintf('%F %F l ', $xB, $yB); + $s .= sprintf('%F %F l ', $xL, $yL); + $s .= 'S '; + } elseif ((strpos($border,'B') !== false) AND (strpos($border,'L') !== false)) { // BL + $s .= sprintf('%F %F m ', $xB, $yB); + $s .= sprintf('%F %F l ', $xL, $yL); + $s .= sprintf('%F %F l ', $xT, $yT); + $s .= 'S '; + } elseif ((strpos($border,'L') !== false) AND (strpos($border,'R') !== false)) { // LR + $s .= sprintf('%F %F m ', $xL, $yL); + $s .= sprintf('%F %F l ', $xT, $yT); + $s .= 'S '; + $s .= sprintf('%F %F m ', $xR, $yR); + $s .= sprintf('%F %F l ', $xB, $yB); + $s .= 'S '; + } elseif ((strpos($border,'T') !== false) AND (strpos($border,'B') !== false)) { // TB + $s .= sprintf('%F %F m ', $xT, $yT); + $s .= sprintf('%F %F l ', $xR, $yR); + $s .= 'S '; + $s .= sprintf('%F %F m ', $xB, $yB); + $s .= sprintf('%F %F l ', $xL, $yL); + $s .= 'S '; + } + } else { // strlen($border) == 1 + if (strpos($border,'L') !== false) { // L + $s .= sprintf('%F %F m ', $xL, $yL); + $s .= sprintf('%F %F l ', $xT, $yT); + $s .= 'S '; + } elseif (strpos($border,'T') !== false) { // T + $s .= sprintf('%F %F m ', $xT, $yT); + $s .= sprintf('%F %F l ', $xR, $yR); + $s .= 'S '; + } elseif (strpos($border,'R') !== false) { // R + $s .= sprintf('%F %F m ', $xR, $yR); + $s .= sprintf('%F %F l ', $xB, $yB); + $s .= 'S '; + } elseif (strpos($border,'B') !== false) { // B + $s .= sprintf('%F %F m ', $xB, $yB); + $s .= sprintf('%F %F l ', $xL, $yL); + $s .= 'S '; + } + } + if (is_array($style) AND !empty($style)) { + // reset border style to previous value + $s .= "\n".$this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor."\n"; + } + } + return $s; + } + + /** + * This method allows printing text with line breaks. + * They can be automatic (as soon as the text reaches the right border of the cell) or explicit (via the \n character). As many cells as necessary are output, one below the other.
        + * Text can be aligned, centered or justified. The cell block can be framed and the background painted. + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param float $h Cell minimum height. The cell extends automatically if needed. + * @param string $txt String to print + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align
        • C: center
        • R: right align
        • J: justification (default value when $ishtml=false)
        + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param int $ln Indicates where the current position should go after the call. Possible values are:
        • 0: to the right
        • 1: to the beginning of the next line [DEFAULT]
        • 2: below
        + * @param float|null $x x position in user units + * @param float|null $y y position in user units + * @param boolean $reseth if true reset the last cell height (default true). + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $ishtml INTERNAL USE ONLY -- set to true if $txt is HTML content (default = false). Never set this parameter to true, use instead writeHTMLCell() or writeHTML() methods. + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. + * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. This feature works only when $ishtml=false. + * @param string $valign Vertical alignment of text (requires $maxh = $h > 0). Possible values are:
        • T: TOP
        • M: middle
        • B: bottom
        . This feature works only when $ishtml=false and the cell must fit in a single page. + * @param boolean $fitcell if true attempt to fit all the text within the cell by reducing the font size (do not work in HTML mode). $maxh must be greater than 0 and equal to $h. + * @return int Return the number of cells or 1 for html mode. + * @public + * @since 1.3 + * @see SetFont(), SetDrawColor(), SetFillColor(), SetTextColor(), SetLineWidth(), Cell(), Write(), SetAutoPageBreak() + */ + public function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false, $ln=1, $x=null, $y=null, $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0, $valign='T', $fitcell=false) { + $prev_cell_margin = $this->cell_margin; + $prev_cell_padding = $this->cell_padding; + // adjust internal padding + $this->adjustCellPadding($border); + $mc_padding = $this->cell_padding; + $mc_margin = $this->cell_margin; + $this->cell_padding['T'] = 0; + $this->cell_padding['B'] = 0; + $this->setCellMargins(0, 0, 0, 0); + if (TCPDF_STATIC::empty_string($this->lasth) OR $reseth) { + // reset row height + $this->resetLastH(); + } + if (!TCPDF_STATIC::empty_string($y)) { + $this->setY($y); // set y in order to convert negative y values to positive ones + } + $y = $this->GetY(); + $resth = 0; + if (($h > 0) AND $this->inPageBody() AND (($y + $h + $mc_margin['T'] + $mc_margin['B']) > $this->PageBreakTrigger)) { + // spit cell in more pages/columns + $newh = ($this->PageBreakTrigger - $y); + $resth = ($h - $newh); // cell to be printed on the next page/column + $h = $newh; + } + // get current page number + $startpage = $this->page; + // get current column + $startcolumn = $this->current_column; + if (!TCPDF_STATIC::empty_string($x)) { + $this->setX($x); + } else { + $x = $this->GetX(); + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions(0, $x, $y); + // apply margins + $oy = $y + $mc_margin['T']; + if ($this->rtl) { + $ox = ($this->w - $x - $mc_margin['R']); + } else { + $ox = ($x + $mc_margin['L']); + } + $this->x = $ox; + $this->y = $oy; + // set width + if (TCPDF_STATIC::empty_string($w) OR ($w <= 0)) { + if ($this->rtl) { + $w = ($this->x - $this->lMargin - $mc_margin['L']); + } else { + $w = ($this->w - $this->x - $this->rMargin - $mc_margin['R']); + } + } + // store original margin values + $lMargin = $this->lMargin; + $rMargin = $this->rMargin; + if ($this->rtl) { + $this->rMargin = ($this->w - $this->x); + $this->lMargin = ($this->x - $w); + } else { + $this->lMargin = ($this->x); + $this->rMargin = ($this->w - $this->x - $w); + } + $this->clMargin = $this->lMargin; + $this->crMargin = $this->rMargin; + if ($autopadding) { + // add top padding + $this->y += $mc_padding['T']; + } + if ($ishtml) { // ******* Write HTML text + $this->writeHTML($txt, true, false, $reseth, true, $align); + $nl = 1; + } else { // ******* Write simple text + $prev_FontSizePt = $this->FontSizePt; + if ($fitcell) { + // ajust height values + $tobottom = ($this->h - $this->y - $this->bMargin - $this->cell_padding['T'] - $this->cell_padding['B']); + $h = $maxh = max(min($h, $tobottom), min($maxh, $tobottom)); + } + // vertical alignment + if ($maxh > 0) { + // get text height + $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); + if ($fitcell AND ($text_height > $maxh) AND ($this->FontSizePt > 1)) { + // try to reduce font size to fit text on cell (use a quick search algorithm) + $fmin = 1; + $fmax = $this->FontSizePt; + $diff_epsilon = (1 / $this->k); // one point (min resolution) + $maxit = (2 * min(100, max(10, intval($fmax)))); // max number of iterations + while ($maxit >= 0) { + $fmid = (($fmax + $fmin) / 2); + $this->setFontSize($fmid, false); + $this->resetLastH(); + $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); + $diff = ($maxh - $text_height); + if ($diff >= 0) { + if ($diff <= $diff_epsilon) { + break; + } + $fmin = $fmid; + } else { + $fmax = $fmid; + } + --$maxit; + } + if ($maxit < 0) { + // premature exit, we get the minimum font value to fit the cell + $this->setFontSize($fmin); + $this->resetLastH(); + $text_height = $this->getStringHeight($w, $txt, $reseth, $autopadding, $mc_padding, $border); + } else { + $this->setFontSize($fmid); + $this->resetLastH(); + } + } + if ($text_height < $maxh) { + if ($valign == 'M') { + // text vertically centered + $this->y += (($maxh - $text_height) / 2); + } elseif ($valign == 'B') { + // text vertically aligned on bottom + $this->y += ($maxh - $text_height); + } + } + } + $nl = $this->Write($this->lasth, $txt, '', 0, $align, true, $stretch, false, true, $maxh, 0, $mc_margin); + if ($fitcell) { + // restore font size + $this->setFontSize($prev_FontSizePt); + } + } + if ($autopadding) { + // add bottom padding + $this->y += $mc_padding['B']; + } + // Get end-of-text Y position + $currentY = $this->y; + // get latest page number + $endpage = $this->page; + if ($resth > 0) { + $skip = ($endpage - $startpage); + $tmpresth = $resth; + while ($tmpresth > 0) { + if ($skip <= 0) { + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $this->checkPageBreak($this->PageBreakTrigger + 1); + } + if ($this->num_columns > 1) { + $tmpresth -= ($this->h - $this->y - $this->bMargin); + } else { + $tmpresth -= ($this->h - $this->tMargin - $this->bMargin); + } + --$skip; + } + $currentY = $this->y; + $endpage = $this->page; + } + // get latest column + $endcolumn = $this->current_column; + if ($this->num_columns == 0) { + $this->num_columns = 1; + } + // disable page regions check + $check_page_regions = $this->check_page_regions; + $this->check_page_regions = false; + // get border modes + $border_start = TCPDF_STATIC::getBorderMode($border, $position='start', $this->opencell); + $border_end = TCPDF_STATIC::getBorderMode($border, $position='end', $this->opencell); + $border_middle = TCPDF_STATIC::getBorderMode($border, $position='middle', $this->opencell); + // design borders around HTML cells. + for ($page = $startpage; $page <= $endpage; ++$page) { // for each page + $ccode = ''; + $this->setPage($page); + if ($this->num_columns < 2) { + // single-column mode + $this->setX($x); + $this->y = $this->tMargin; + } + // account for margin changes + if ($page > $startpage) { + if (($this->rtl) AND ($this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm'])) { + $this->x -= ($this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm']); + } elseif ((!$this->rtl) AND ($this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm'])) { + $this->x += ($this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm']); + } + } + if ($startpage == $endpage) { + // single page + for ($column = $startcolumn; $column <= $endcolumn; ++$column) { // for each column + if ($column != $this->current_column) { + $this->selectColumn($column); + } + if ($this->rtl) { + $this->x -= $mc_margin['R']; + } else { + $this->x += $mc_margin['L']; + } + if ($startcolumn == $endcolumn) { // single column + $cborder = $border; + $h = max($h, ($currentY - $oy)); + $this->y = $oy; + } elseif ($column == $startcolumn) { // first column + $cborder = $border_start; + $this->y = $oy; + $h = $this->h - $this->y - $this->bMargin; + } elseif ($column == $endcolumn) { // end column + $cborder = $border_end; + $h = $currentY - $this->y; + if ($resth > $h) { + $h = $resth; + } + } else { // middle column + $cborder = $border_middle; + $h = $this->h - $this->y - $this->bMargin; + $resth -= $h; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } elseif ($page == $startpage) { // first page + for ($column = $startcolumn; $column < $this->num_columns; ++$column) { // for each column + if ($column != $this->current_column) { + $this->selectColumn($column); + } + if ($this->rtl) { + $this->x -= $mc_margin['R']; + } else { + $this->x += $mc_margin['L']; + } + if ($column == $startcolumn) { // first column + $cborder = $border_start; + $this->y = $oy; + $h = $this->h - $this->y - $this->bMargin; + } else { // middle column + $cborder = $border_middle; + $h = $this->h - $this->y - $this->bMargin; + $resth -= $h; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } elseif ($page == $endpage) { // last page + for ($column = 0; $column <= $endcolumn; ++$column) { // for each column + if ($column != $this->current_column) { + $this->selectColumn($column); + } + if ($this->rtl) { + $this->x -= $mc_margin['R']; + } else { + $this->x += $mc_margin['L']; + } + if ($column == $endcolumn) { + // end column + $cborder = $border_end; + $h = $currentY - $this->y; + if ($resth > $h) { + $h = $resth; + } + } else { + // middle column + $cborder = $border_middle; + $h = $this->h - $this->y - $this->bMargin; + $resth -= $h; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } else { // middle page + for ($column = 0; $column < $this->num_columns; ++$column) { // for each column + $this->selectColumn($column); + if ($this->rtl) { + $this->x -= $mc_margin['R']; + } else { + $this->x += $mc_margin['L']; + } + $cborder = $border_middle; + $h = $this->h - $this->y - $this->bMargin; + $resth -= $h; + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } + if ($cborder OR $fill) { + $offsetlen = strlen($ccode); + // draw border and fill + if ($this->inxobj) { + // we are inside an XObject template + if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { + $pagemarkkey = key($this->xobjects[$this->xobjid]['transfmrk']); + $pagemark = $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey]; + $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey] += $offsetlen; + } else { + $pagemark = $this->xobjects[$this->xobjid]['intmrk']; + $this->xobjects[$this->xobjid]['intmrk'] += $offsetlen; + } + $pagebuff = $this->xobjects[$this->xobjid]['outdata']; + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); + $this->xobjects[$this->xobjid]['outdata'] = $pstart.$ccode.$pend; + } else { + if (end($this->transfmrk[$this->page]) !== false) { + $pagemarkkey = key($this->transfmrk[$this->page]); + $pagemark = $this->transfmrk[$this->page][$pagemarkkey]; + $this->transfmrk[$this->page][$pagemarkkey] += $offsetlen; + } elseif ($this->InFooter) { + $pagemark = $this->footerpos[$this->page]; + $this->footerpos[$this->page] += $offsetlen; + } else { + $pagemark = $this->intmrk[$this->page]; + $this->intmrk[$this->page] += $offsetlen; + } + $pagebuff = $this->getPageBuffer($this->page); + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); + $this->setPageBuffer($this->page, $pstart.$ccode.$pend); + } + } + } // end for each page + // restore page regions check + $this->check_page_regions = $check_page_regions; + // Get end-of-cell Y position + $currentY = $this->GetY(); + // restore previous values + if ($this->num_columns > 1) { + $this->selectColumn(); + } else { + // restore original margins + $this->lMargin = $lMargin; + $this->rMargin = $rMargin; + if ($this->page > $startpage) { + // check for margin variations between pages (i.e. booklet mode) + $dl = ($this->pagedim[$this->page]['olm'] - $this->pagedim[$startpage]['olm']); + $dr = ($this->pagedim[$this->page]['orm'] - $this->pagedim[$startpage]['orm']); + if (($dl != 0) OR ($dr != 0)) { + $this->lMargin += $dl; + $this->rMargin += $dr; + } + } + } + if ($ln > 0) { + //Go to the beginning of the next line + $this->setY($currentY + $mc_margin['B']); + if ($ln == 2) { + $this->setX($x + $w + $mc_margin['L'] + $mc_margin['R']); + } + } else { + // go left or right by case + $this->setPage($startpage); + $this->y = $y; + $this->setX($x + $w + $mc_margin['L'] + $mc_margin['R']); + } + $this->setContentMark(); + $this->cell_padding = $prev_cell_padding; + $this->cell_margin = $prev_cell_margin; + $this->clMargin = $this->lMargin; + $this->crMargin = $this->rMargin; + return $nl; + } + + /** + * This method return the estimated number of lines for print a simple text string using Multicell() method. + * @param string $txt String for calculating his height + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param boolean $reseth if true reset the last cell height (default false). + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true). + * @param array|null $cellpadding Internal cell padding, if empty uses default cell padding. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @return float Return the minimal height needed for multicell method for printing the $txt param. + * @author Alexander Escalona Fern\E1ndez, Nicola Asuni + * @public + * @since 4.5.011 + */ + public function getNumLines($txt, $w=0, $reseth=false, $autopadding=true, $cellpadding=null, $border=0) { + if ($txt === NULL) { + return 0; + } + if ($txt === '') { + // empty string + return 1; + } + // adjust internal padding + $prev_cell_padding = $this->cell_padding; + $prev_lasth = $this->lasth; + if (is_array($cellpadding)) { + $this->cell_padding = $cellpadding; + } + $this->adjustCellPadding($border); + if (TCPDF_STATIC::empty_string($w) OR ($w <= 0)) { + if ($this->rtl) { + $w = $this->x - $this->lMargin; + } else { + $w = $this->w - $this->rMargin - $this->x; + } + } + $wmax = $w - $this->cell_padding['L'] - $this->cell_padding['R']; + if ($reseth) { + // reset row height + $this->resetLastH(); + } + $lines = 1; + $sum = 0; + $chars = TCPDF_FONTS::utf8Bidi(TCPDF_FONTS::UTF8StringToArray($txt, $this->isunicode, $this->CurrentFont), $txt, $this->tmprtl, $this->isunicode, $this->CurrentFont); + $charsWidth = $this->GetArrStringWidth($chars, '', '', 0, true); + $length = count($chars); + $lastSeparator = -1; + for ($i = 0; $i < $length; ++$i) { + $c = $chars[$i]; + $charWidth = $charsWidth[$i]; + if (($c != 160) + AND (($c == 173) + OR preg_match($this->re_spaces, TCPDF_FONTS::unichr($c, $this->isunicode)) + OR (($c == 45) + AND ($i > 0) AND ($i < ($length - 1)) + AND @preg_match('/[\p{L}]/'.$this->re_space['m'], TCPDF_FONTS::unichr($chars[($i - 1)], $this->isunicode)) + AND @preg_match('/[\p{L}]/'.$this->re_space['m'], TCPDF_FONTS::unichr($chars[($i + 1)], $this->isunicode)) + ) + ) + ) { + $lastSeparator = $i; + } + if ((($sum + $charWidth) > $wmax) OR ($c == 10)) { + ++$lines; + if ($c == 10) { + $lastSeparator = -1; + $sum = 0; + } elseif ($lastSeparator != -1) { + $i = $lastSeparator; + $lastSeparator = -1; + $sum = 0; + } else { + $sum = $charWidth; + } + } else { + $sum += $charWidth; + } + } + if ($chars[($length - 1)] == 10) { + --$lines; + } + $this->cell_padding = $prev_cell_padding; + $this->lasth = $prev_lasth; + return $lines; + } + + /** + * This method return the estimated height needed for printing a simple text string using the Multicell() method. + * Generally, if you want to know the exact height for a block of content you can use the following alternative technique: + * @pre + * // store current object + * $pdf->startTransaction(); + * // store starting values + * $start_y = $pdf->GetY(); + * $start_page = $pdf->getPage(); + * // call your printing functions with your parameters + * // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * $pdf->MultiCell($w=0, $h=0, $txt, $border=1, $align='L', $fill=false, $ln=1, $x=null, $y=null, $reseth=true, $stretch=0, $ishtml=false, $autopadding=true, $maxh=0); + * // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + * // get the new Y + * $end_y = $pdf->GetY(); + * $end_page = $pdf->getPage(); + * // calculate height + * $height = 0; + * if ($end_page == $start_page) { + * $height = $end_y - $start_y; + * } else { + * for ($page=$start_page; $page <= $end_page; ++$page) { + * $this->setPage($page); + * if ($page == $start_page) { + * // first page + * $height += $this->h - $start_y - $this->bMargin; + * } elseif ($page == $end_page) { + * // last page + * $height += $end_y - $this->tMargin; + * } else { + * $height += $this->h - $this->tMargin - $this->bMargin; + * } + * } + * } + * // restore previous object + * $pdf = $pdf->rollbackTransaction(); + * + * @param float $w Width of cells. If 0, they extend up to the right margin of the page. + * @param string $txt String for calculating his height + * @param boolean $reseth if true reset the last cell height (default false). + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width (default true). + * @param array|null $cellpadding Internal cell padding, if empty uses default cell padding. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @return float Return the minimal height needed for multicell method for printing the $txt param. + * @author Nicola Asuni, Alexander Escalona Fern\E1ndez + * @public + */ + public function getStringHeight($w, $txt, $reseth=false, $autopadding=true, $cellpadding=null, $border=0) { + // adjust internal padding + $prev_cell_padding = $this->cell_padding; + $prev_lasth = $this->lasth; + if (is_array($cellpadding)) { + $this->cell_padding = $cellpadding; + } + $this->adjustCellPadding($border); + $lines = $this->getNumLines($txt, $w, $reseth, $autopadding, $cellpadding, $border); + $height = $this->getCellHeight(($lines * $this->FontSize), $autopadding); + $this->cell_padding = $prev_cell_padding; + $this->lasth = $prev_lasth; + return $height; + } + + /** + * This method prints text from the current position.
        + * @param float $h Line height + * @param string $txt String to print + * @param mixed $link URL or identifier returned by AddLink() + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param string $align Allows to center or align the text. Possible values are:
        • L or empty string: left align (default value)
        • C: center
        • R: right align
        • J: justify
        + * @param boolean $ln if true set cursor at the bottom of the line, otherwise set cursor at the top of the line. + * @param int $stretch font stretch mode:
        • 0 = disabled
        • 1 = horizontal scaling only if text is larger than cell width
        • 2 = forced horizontal scaling to fit cell width
        • 3 = character spacing only if text is larger than cell width
        • 4 = forced character spacing to fit cell width
        General font stretching and scaling values will be preserved when possible. + * @param boolean $firstline if true prints only the first line and return the remaining string. + * @param boolean $firstblock if true the string is the starting of a line. + * @param float $maxh maximum height. It should be >= $h and less then remaining space to the bottom of the page, or 0 for disable this feature. + * @param float $wadj first line width will be reduced by this amount (used in HTML mode). + * @param array|null $margin margin array of the parent container + * @return mixed Return the number of cells or the remaining string if $firstline = true. + * @public + * @since 1.5 + */ + public function Write($h, $txt, $link='', $fill=false, $align='', $ln=false, $stretch=0, $firstline=false, $firstblock=false, $maxh=0, $wadj=0, $margin=null) { + // check page for no-write regions and adapt page margins if necessary + list($this->x, $this->y) = $this->checkPageRegions($h, $this->x, $this->y); + if (strlen($txt) == 0) { + // fix empty text + $txt = ' '; + } + if (!is_array($margin)) { + // set default margins + $margin = $this->cell_margin; + } + // remove carriage returns + $s = str_replace("\r", '', $txt); + // check if string contains arabic text + if (preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_ARABIC, $s)) { + $arabic = true; + } else { + $arabic = false; + } + // check if string contains RTL text + if ($arabic OR ($this->tmprtl == 'R') OR preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_RTL, $s)) { + $rtlmode = true; + } else { + $rtlmode = false; + } + // get a char width + $chrwidth = $this->GetCharWidth(46); // dot character + // get array of unicode values + $chars = TCPDF_FONTS::UTF8StringToArray($s, $this->isunicode, $this->CurrentFont); + // calculate maximum width for a single character on string + $chrw = $this->GetArrStringWidth($chars, '', '', 0, true); + array_walk($chrw, array($this, 'getRawCharWidth')); + $maxchwidth = max($chrw); + // get array of chars + $uchars = TCPDF_FONTS::UTF8ArrayToUniArray($chars, $this->isunicode); + // get the number of characters + $nb = count($chars); + // replacement for SHY character (minus symbol) + $shy_replacement = 45; + $shy_replacement_char = TCPDF_FONTS::unichr($shy_replacement, $this->isunicode); + // widht for SHY replacement + $shy_replacement_width = $this->GetCharWidth($shy_replacement); + // page width + $pw = $w = $this->w - $this->lMargin - $this->rMargin; + // calculate remaining line width ($w) + if ($this->rtl) { + $w = $this->x - $this->lMargin; + } else { + $w = $this->w - $this->rMargin - $this->x; + } + // max column width + $wmax = ($w - $wadj); + if (!$firstline) { + $wmax -= ($this->cell_padding['L'] + $this->cell_padding['R']); + } + if ((!$firstline) AND (($chrwidth > $wmax) OR ($maxchwidth > $wmax))) { + // the maximum width character do not fit on column + return ''; + } + // minimum row height + $row_height = max($h, $this->getCellHeight($this->FontSize)); + // max Y + $maxy = $this->y + $maxh - max($row_height, $h); + $start_page = $this->page; + $i = 0; // character position + $j = 0; // current starting position + $sep = -1; // position of the last blank space + $prevsep = $sep; // previous separator + $shy = false; // true if the last blank is a soft hypen (SHY) + $prevshy = $shy; // previous shy mode + $l = 0; // current string length + $nl = 0; //number of lines + $linebreak = false; + $pc = 0; // previous character + // for each character + while ($i < $nb) { + if (($maxh > 0) AND ($this->y > $maxy) ) { + break; + } + //Get the current character + $c = $chars[$i]; + if ($c == 10) { // 10 = "\n" = new line + //Explicit line break + if ($align == 'J') { + if ($this->rtl) { + $talign = 'R'; + } else { + $talign = 'L'; + } + } else { + $talign = $align; + } + $tmpstr = TCPDF_FONTS::UniArrSubString($uchars, $j, $i); + if ($firstline) { + $startx = $this->x; + $tmparr = array_slice($chars, $j, ($i - $j)); + if ($rtlmode) { + $tmparr = TCPDF_FONTS::utf8Bidi($tmparr, $tmpstr, $this->tmprtl, $this->isunicode, $this->CurrentFont); + } + $linew = $this->GetArrStringWidth($tmparr); + unset($tmparr); + if ($this->rtl) { + $this->endlinex = $startx - $linew; + } else { + $this->endlinex = $startx + $linew; + } + $w = $linew; + $tmpcellpadding = $this->cell_padding; + if ($maxh == 0) { + $this->setCellPadding(0); + } + } + if ($firstblock AND $this->isRTLTextDir()) { + $tmpstr = $this->stringRightTrim($tmpstr); + } + // Skip newlines at the beginning of a page or column + if (!empty($tmpstr) OR ($this->y < ($this->PageBreakTrigger - $row_height))) { + $this->Cell($w, $h, $tmpstr, 0, 1, $talign, $fill, $link, $stretch); + } + unset($tmpstr); + if ($firstline) { + $this->cell_padding = $tmpcellpadding; + return (TCPDF_FONTS::UniArrSubString($uchars, $i)); + } + ++$nl; + $j = $i + 1; + $l = 0; + $sep = -1; + $prevsep = $sep; + $shy = false; + // account for margin changes + if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) { + if ($this->AcceptPageBreak()) + { + if ($this->rtl) { + $this->x -= $margin['R']; + } else { + $this->x += $margin['L']; + } + $this->lMargin += $margin['L']; + $this->rMargin += $margin['R']; + } + } + $w = $this->getRemainingWidth(); + $wmax = ($w - $this->cell_padding['L'] - $this->cell_padding['R']); + } else { + // 160 is the non-breaking space. + // 173 is SHY (Soft Hypen). + // \p{Z} or \p{Separator}: any kind of Unicode whitespace or invisible separator. + // \p{Lo} or \p{Other_Letter}: a Unicode letter or ideograph that does not have lowercase and uppercase variants. + // \p{Lo} is needed because Chinese characters are packed next to each other without spaces in between. + if (($c != 160) + AND (($c == 173) + OR preg_match($this->re_spaces, TCPDF_FONTS::unichr($c, $this->isunicode)) + OR (($c == 45) + AND ($i < ($nb - 1)) + AND @preg_match('/[\p{L}]/'.$this->re_space['m'], TCPDF_FONTS::unichr($pc, $this->isunicode)) + AND @preg_match('/[\p{L}]/'.$this->re_space['m'], TCPDF_FONTS::unichr($chars[($i + 1)], $this->isunicode)) + ) + ) + ) { + // update last blank space position + $prevsep = $sep; + $sep = $i; + // check if is a SHY + if (($c == 173) OR ($c == 45)) { + $prevshy = $shy; + $shy = true; + if ($pc == 45) { + $tmp_shy_replacement_width = 0; + $tmp_shy_replacement_char = ''; + } else { + $tmp_shy_replacement_width = $shy_replacement_width; + $tmp_shy_replacement_char = $shy_replacement_char; + } + } else { + $shy = false; + } + } + // update string length + if ($this->isUnicodeFont() AND ($arabic)) { + // with bidirectional algorithm some chars may be changed affecting the line length + // *** very slow *** + $l = $this->GetArrStringWidth(TCPDF_FONTS::utf8Bidi(array_slice($chars, $j, ($i - $j)), '', $this->tmprtl, $this->isunicode, $this->CurrentFont)); + } else { + $l += $this->GetCharWidth($c, ($i+1 < $nb)); + } + if (($l > $wmax) OR (($c == 173) AND (($l + $tmp_shy_replacement_width) >= $wmax))) { + if (($c == 173) AND (($l + $tmp_shy_replacement_width) > $wmax)) { + $sep = $prevsep; + $shy = $prevshy; + } + // we have reached the end of column + if ($sep == -1) { + // check if the line was already started + if (($this->rtl AND ($this->x <= ($this->w - $this->rMargin - $this->cell_padding['R'] - $margin['R'] - $chrwidth))) + OR ((!$this->rtl) AND ($this->x >= ($this->lMargin + $this->cell_padding['L'] + $margin['L'] + $chrwidth)))) { + // print a void cell and go to next line + $this->Cell($w, $h, '', 0, 1); + $linebreak = true; + if ($firstline) { + return (TCPDF_FONTS::UniArrSubString($uchars, $j)); + } + } else { + // truncate the word because do not fit on column + $tmpstr = TCPDF_FONTS::UniArrSubString($uchars, $j, $i); + if ($firstline) { + $startx = $this->x; + $tmparr = array_slice($chars, $j, ($i - $j)); + if ($rtlmode) { + $tmparr = TCPDF_FONTS::utf8Bidi($tmparr, $tmpstr, $this->tmprtl, $this->isunicode, $this->CurrentFont); + } + $linew = $this->GetArrStringWidth($tmparr); + unset($tmparr); + if ($this->rtl) { + $this->endlinex = $startx - $linew; + } else { + $this->endlinex = $startx + $linew; + } + $w = $linew; + $tmpcellpadding = $this->cell_padding; + if ($maxh == 0) { + $this->setCellPadding(0); + } + } + if ($firstblock AND $this->isRTLTextDir()) { + $tmpstr = $this->stringRightTrim($tmpstr); + } + $this->Cell($w, $h, $tmpstr, 0, 1, $align, $fill, $link, $stretch); + unset($tmpstr); + if ($firstline) { + $this->cell_padding = $tmpcellpadding; + return (TCPDF_FONTS::UniArrSubString($uchars, $i)); + } + $j = $i; + --$i; + } + } else { + // word wrapping + if ($this->rtl AND (!$firstblock) AND ($sep < $i)) { + $endspace = 1; + } else { + $endspace = 0; + } + // check the length of the next string + $strrest = TCPDF_FONTS::UniArrSubString($uchars, ($sep + $endspace)); + $nextstr = TCPDF_STATIC::pregSplit('/'.$this->re_space['p'].'/', $this->re_space['m'], $this->stringTrim($strrest)); + if (isset($nextstr[0]) AND ($this->GetStringWidth($nextstr[0]) > $pw)) { + // truncate the word because do not fit on a full page width + $tmpstr = TCPDF_FONTS::UniArrSubString($uchars, $j, $i); + if ($firstline) { + $startx = $this->x; + $tmparr = array_slice($chars, $j, ($i - $j)); + if ($rtlmode) { + $tmparr = TCPDF_FONTS::utf8Bidi($tmparr, $tmpstr, $this->tmprtl, $this->isunicode, $this->CurrentFont); + } + $linew = $this->GetArrStringWidth($tmparr); + unset($tmparr); + if ($this->rtl) { + $this->endlinex = ($startx - $linew); + } else { + $this->endlinex = ($startx + $linew); + } + $w = $linew; + $tmpcellpadding = $this->cell_padding; + if ($maxh == 0) { + $this->setCellPadding(0); + } + } + if ($firstblock AND $this->isRTLTextDir()) { + $tmpstr = $this->stringRightTrim($tmpstr); + } + $this->Cell($w, $h, $tmpstr, 0, 1, $align, $fill, $link, $stretch); + unset($tmpstr); + if ($firstline) { + $this->cell_padding = $tmpcellpadding; + return (TCPDF_FONTS::UniArrSubString($uchars, $i)); + } + $j = $i; + --$i; + } else { + // word wrapping + if ($shy) { + // add hypen (minus symbol) at the end of the line + $shy_width = $tmp_shy_replacement_width; + if ($this->rtl) { + $shy_char_left = $tmp_shy_replacement_char; + $shy_char_right = ''; + } else { + $shy_char_left = ''; + $shy_char_right = $tmp_shy_replacement_char; + } + } else { + $shy_width = 0; + $shy_char_left = ''; + $shy_char_right = ''; + } + $tmpstr = TCPDF_FONTS::UniArrSubString($uchars, $j, ($sep + $endspace)); + if ($firstline) { + $startx = $this->x; + $tmparr = array_slice($chars, $j, (($sep + $endspace) - $j)); + if ($rtlmode) { + $tmparr = TCPDF_FONTS::utf8Bidi($tmparr, $tmpstr, $this->tmprtl, $this->isunicode, $this->CurrentFont); + } + $linew = $this->GetArrStringWidth($tmparr); + unset($tmparr); + if ($this->rtl) { + $this->endlinex = $startx - $linew - $shy_width; + } else { + $this->endlinex = $startx + $linew + $shy_width; + } + $w = $linew; + $tmpcellpadding = $this->cell_padding; + if ($maxh == 0) { + $this->setCellPadding(0); + } + } + // print the line + if ($firstblock AND $this->isRTLTextDir()) { + $tmpstr = $this->stringRightTrim($tmpstr); + } + $this->Cell($w, $h, $shy_char_left.$tmpstr.$shy_char_right, 0, 1, $align, $fill, $link, $stretch); + unset($tmpstr); + if ($firstline) { + if ($chars[$sep] == 45) { + $endspace += 1; + } + // return the remaining text + $this->cell_padding = $tmpcellpadding; + return (TCPDF_FONTS::UniArrSubString($uchars, ($sep + $endspace))); + } + $i = $sep; + $sep = -1; + $shy = false; + $j = ($i + 1); + } + } + // account for margin changes + if ((($this->y + $this->lasth) > $this->PageBreakTrigger) AND ($this->inPageBody())) { + if ($this->AcceptPageBreak()) + { + if ($this->rtl) { + $this->x -= $margin['R']; + } else { + $this->x += $margin['L']; + } + $this->lMargin += $margin['L']; + $this->rMargin += $margin['R']; + } + } + $w = $this->getRemainingWidth(); + $wmax = $w - $this->cell_padding['L'] - $this->cell_padding['R']; + if ($linebreak) { + $linebreak = false; + } else { + ++$nl; + $l = 0; + } + } + } + // save last character + $pc = $c; + ++$i; + } // end while i < nb + // print last substring (if any) + if ($l > 0) { + switch ($align) { + case 'J': + case 'C': { + break; + } + case 'L': { + if (!$this->rtl) { + $w = $l; + } + break; + } + case 'R': { + if ($this->rtl) { + $w = $l; + } + break; + } + default: { + $w = $l; + break; + } + } + $tmpstr = TCPDF_FONTS::UniArrSubString($uchars, $j, $nb); + if ($firstline) { + $startx = $this->x; + $tmparr = array_slice($chars, $j, ($nb - $j)); + if ($rtlmode) { + $tmparr = TCPDF_FONTS::utf8Bidi($tmparr, $tmpstr, $this->tmprtl, $this->isunicode, $this->CurrentFont); + } + $linew = $this->GetArrStringWidth($tmparr); + unset($tmparr); + if ($this->rtl) { + $this->endlinex = $startx - $linew; + } else { + $this->endlinex = $startx + $linew; + } + $w = $linew; + $tmpcellpadding = $this->cell_padding; + if ($maxh == 0) { + $this->setCellPadding(0); + } + } + if ($firstblock AND $this->isRTLTextDir()) { + $tmpstr = $this->stringRightTrim($tmpstr); + } + $this->Cell($w, $h, $tmpstr, 0, $ln, $align, $fill, $link, $stretch); + unset($tmpstr); + if ($firstline) { + $this->cell_padding = $tmpcellpadding; + return (TCPDF_FONTS::UniArrSubString($uchars, $nb)); + } + ++$nl; + } + if ($firstline) { + return ''; + } + return $nl; + } + + /** + * Returns the remaining width between the current position and margins. + * @return float Return the remaining width + * @protected + */ + protected function getRemainingWidth() { + list($this->x, $this->y) = $this->checkPageRegions(0, $this->x, $this->y); + if ($this->rtl) { + return ($this->x - $this->lMargin); + } else { + return ($this->w - $this->rMargin - $this->x); + } + } + + /** + * Set the block dimensions accounting for page breaks and page/column fitting + * @param float $w width + * @param float $h height + * @param float $x X coordinate + * @param float $y Y coodiante + * @param boolean $fitonpage if true the block is resized to not exceed page dimensions. + * @return array array($w, $h, $x, $y) + * @protected + * @since 5.5.009 (2010-07-05) + */ + protected function fitBlock($w, $h, $x, $y, $fitonpage=false) { + if ($w <= 0) { + // set maximum width + $w = ($this->w - $this->lMargin - $this->rMargin); + if ($w <= 0) { + $w = 1; + } + } + if ($h <= 0) { + // set maximum height + $h = ($this->PageBreakTrigger - $this->tMargin); + if ($h <= 0) { + $h = 1; + } + } + // resize the block to be vertically contained on a single page or single column + if ($fitonpage OR $this->AutoPageBreak) { + $ratio_wh = ($w / $h); + if ($h > ($this->PageBreakTrigger - $this->tMargin)) { + $h = $this->PageBreakTrigger - $this->tMargin; + $w = ($h * $ratio_wh); + } + // resize the block to be horizontally contained on a single page or single column + if ($fitonpage) { + $maxw = ($this->w - $this->lMargin - $this->rMargin); + if ($w > $maxw) { + $w = $maxw; + $h = ($w / $ratio_wh); + } + } + } + // Check whether we need a new page or new column first as this does not fit + $prev_x = $this->x; + $prev_y = $this->y; + if ($this->checkPageBreak($h, $y) OR ($this->y < $prev_y)) { + $y = $this->y; + if ($this->rtl) { + $x += ($prev_x - $this->x); + } else { + $x += ($this->x - $prev_x); + } + $this->newline = true; + } + // resize the block to be contained on the remaining available page or column space + if ($fitonpage) { + $ratio_wh = ($w / $h); + if (($y + $h) > $this->PageBreakTrigger) { + $h = $this->PageBreakTrigger - $y; + $w = ($h * $ratio_wh); + } + if ((!$this->rtl) AND (($x + $w) > ($this->w - $this->rMargin))) { + $w = $this->w - $this->rMargin - $x; + $h = ($w / $ratio_wh); + } elseif (($this->rtl) AND (($x - $w) < ($this->lMargin))) { + $w = $x - $this->lMargin; + $h = ($w / $ratio_wh); + } + } + return array($w, $h, $x, $y); + } + + /** + * Puts an image in the page. + * The upper-left corner must be given. + * The dimensions can be specified in different ways:
          + *
        • explicit width and height (expressed in user unit)
        • + *
        • one explicit dimension, the other being calculated automatically in order to keep the original proportions
        • + *
        • no explicit dimension, in which case the image is put at 72 dpi
        + * Supported formats are JPEG and PNG images whitout GD library and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM; + * The format can be specified explicitly or inferred from the file extension.
        + * It is possible to put a link on the image.
        + * Remark: if an image is used several times, only one copy will be embedded in the file.
        + * @param string $file Name of the file containing the image or a '@' character followed by the image data string. To link an image without embedding it on the document, set an asterisk character before the URL (i.e.: '*http://www.example.com/image.jpg'). + * @param float|null $x Abscissa of the upper-left corner (LTR) or upper-right corner (RTL). + * @param float|null $y Ordinate of the upper-left corner (LTR) or upper-right corner (RTL). + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. + * @param mixed $link URL or identifier returned by AddLink(). + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        + * @param mixed $resize If true resize (reduce) the image to fit $w and $h (requires GD or ImageMagick library); if false do not resize; if 2 force resize in all cases (upscaling and downscaling). + * @param int $dpi dot-per-inch resolution used on resize + * @param string $palign Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        + * @param boolean $ismask true if this image is a mask, false otherwise + * @param mixed $imgmask image object returned by this function or false + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param mixed $fitbox If not false scale image dimensions proportionally to fit within the ($w, $h) box. $fitbox can be true or a 2 characters string indicating the image alignment inside the box. The first character indicate the horizontal alignment (L = left, C = center, R = right) the second character indicate the vertical algnment (T = top, M = middle, B = bottom). + * @param boolean $hidden If true do not display the image. + * @param boolean $fitonpage If true the image is resized to not exceed page dimensions. + * @param boolean $alt If true the image will be added as alternative and not directly printed (the ID of the image will be returned). + * @param array $altimgs Array of alternate images IDs. Each alternative image must be an array with two values: an integer representing the image ID (the value returned by the Image method) and a boolean value to indicate if the image is the default for printing. + * @return mixed|false image information + * @public + * @since 1.1 + */ + public function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='', $align='', $resize=false, $dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0, $fitbox=false, $hidden=false, $fitonpage=false, $alt=false, $altimgs=array()) { + if ($this->state != 2) { + return false; + } + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + $exurl = ''; // external streams + $imsize = FALSE; + + // Make sure the file variable is not empty or null because accessing $file[0] later + // results in error when running PHP 7.4 + if (empty($file)) { + return false; + } + // check if we are passing an image as file or string + if ($file[0] === '@') { + // image from string + $imgdata = substr($file, 1); + } else { // image file + if ($file[0] === '*') { + // image as external stream + $file = substr($file, 1); + $exurl = $file; + } + // check if file exist and it is valid + if (!@$this->fileExists($file)) { + return false; + } + if (false !== $info = $this->getImageBuffer($file)) { + $imsize = array($info['w'], $info['h']); + } elseif (($imsize = @getimagesize($file)) === FALSE && strpos($file, '__tcpdf_'.$this->file_id.'_img') === FALSE){ + $imgdata = $this->getCachedFileContents($file); + } + } + if (!empty($imgdata)) { + // copy image to cache + $original_file = $file; + $file = TCPDF_STATIC::getObjFilename('img', $this->file_id); + $fp = TCPDF_STATIC::fopenLocal($file, 'w'); + if (!$fp) { + $this->Error('Unable to write file: '.$file); + } + fwrite($fp, $imgdata); + fclose($fp); + unset($imgdata); + $imsize = @getimagesize($file); + if ($imsize === FALSE) { + unlink($file); + $file = $original_file; + } + } + if ($imsize === FALSE) { + if (($w > 0) AND ($h > 0)) { + // get measures from specified data + $pw = $this->getHTMLUnitToUnits($w, 0, $this->pdfunit, true) * $this->imgscale * $this->k; + $ph = $this->getHTMLUnitToUnits($h, 0, $this->pdfunit, true) * $this->imgscale * $this->k; + $imsize = array($pw, $ph); + } else { + $this->Error('[Image] Unable to get the size of the image: '.$file); + } + } + // file hash + $filehash = md5($file); + // get original image width and height in pixels + list($pixw, $pixh) = $imsize; + // calculate image width and height on document + if (($w <= 0) AND ($h <= 0)) { + // convert image size to document unit + $w = $this->pixelsToUnits($pixw); + $h = $this->pixelsToUnits($pixh); + } elseif ($w <= 0) { + $w = $h * $pixw / $pixh; + } elseif ($h <= 0) { + $h = $w * $pixh / $pixw; + } elseif (($fitbox !== false) AND ($w > 0) AND ($h > 0)) { + if (strlen($fitbox) !== 2) { + // set default alignment + $fitbox = '--'; + } + // scale image dimensions proportionally to fit within the ($w, $h) box + if ((($w * $pixh) / ($h * $pixw)) < 1) { + // store current height + $oldh = $h; + // calculate new height + $h = $w * $pixh / $pixw; + // height difference + $hdiff = ($oldh - $h); + // vertical alignment + switch (strtoupper($fitbox[1])) { + case 'T': { + break; + } + case 'M': { + $y += ($hdiff / 2); + break; + } + case 'B': { + $y += $hdiff; + break; + } + } + } else { + // store current width + $oldw = $w; + // calculate new width + $w = $h * $pixw / $pixh; + // width difference + $wdiff = ($oldw - $w); + // horizontal alignment + switch (strtoupper($fitbox[0])) { + case 'L': { + if ($this->rtl) { + $x -= $wdiff; + } + break; + } + case 'C': { + if ($this->rtl) { + $x -= ($wdiff / 2); + } else { + $x += ($wdiff / 2); + } + break; + } + case 'R': { + if (!$this->rtl) { + $x += $wdiff; + } + break; + } + } + } + } + // fit the image on available space + list($w, $h, $x, $y) = $this->fitBlock($w, $h, $x, $y, $fitonpage); + // calculate new minimum dimensions in pixels + $neww = round($w * $this->k * $dpi / $this->dpi); + $newh = round($h * $this->k * $dpi / $this->dpi); + // check if resize is necessary (resize is used only to reduce the image) + $newsize = ($neww * $newh); + $pixsize = ($pixw * $pixh); + if (intval($resize) == 2) { + $resize = true; + } elseif ($newsize >= $pixsize) { + $resize = false; + } + // check if image has been already added on document + $newimage = true; + if (in_array($file, $this->imagekeys)) { + $newimage = false; + // get existing image data + $info = $this->getImageBuffer($file); + if (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE) { + // check if the newer image is larger + $oldsize = ($info['w'] * $info['h']); + if ((($oldsize < $newsize) AND ($resize)) OR (($oldsize < $pixsize) AND (!$resize))) { + $newimage = true; + } + } + } elseif (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE)) { + // create temp image file (without alpha channel) + $tempfile_plain = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_plain_'.$filehash; + // create temp alpha file + $tempfile_alpha = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_alpha_'.$filehash; + // check for cached images + if (in_array($tempfile_plain, $this->imagekeys)) { + // get existing image data + $info = $this->getImageBuffer($tempfile_plain); + // check if the newer image is larger + $oldsize = ($info['w'] * $info['h']); + if ((($oldsize < $newsize) AND ($resize)) OR (($oldsize < $pixsize) AND (!$resize))) { + $newimage = true; + } else { + $newimage = false; + // embed mask image + $imgmask = $this->Image($tempfile_alpha, $x, $y, $w, $h, 'PNG', '', '', $resize, $dpi, '', true, false); + // embed image, masked with previously embedded mask + return $this->Image($tempfile_plain, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, false, $imgmask); + } + } + } + if ($newimage) { + //First use of image, get info + $type = strtolower($type); + if ($type == '') { + $type = TCPDF_IMAGES::getImageFileType($file, $imsize); + } elseif ($type == 'jpg') { + $type = 'jpeg'; + } + // Specific image handlers (defined on TCPDF_IMAGES CLASS) + $mtd = '_parse'.$type; + // GD image handler function + $gdfunction = 'imagecreatefrom'.$type; + $info = false; + if ((method_exists('TCPDF_IMAGES', $mtd)) AND (!($resize AND (function_exists($gdfunction) OR extension_loaded('imagick'))))) { + // TCPDF image functions + $info = TCPDF_IMAGES::$mtd($file); + if (($ismask === false) AND ($imgmask === false) AND (strpos($file, '__tcpdf_'.$this->file_id.'_imgmask_') === FALSE) + AND (($info === 'pngalpha') OR (isset($info['trns']) AND !empty($info['trns'])))) { + return $this->ImagePngAlpha($file, $x, $y, $pixw, $pixh, $w, $h, 'PNG', $link, $align, $resize, $dpi, $palign, $filehash); + } + } + if (($info === false) AND function_exists($gdfunction)) { + try { + // GD library + $img = $gdfunction($file); + if ($img !== false) { + if ($resize) { + $imgr = imagecreatetruecolor($neww, $newh); + if (($type == 'gif') OR ($type == 'png')) { + $imgr = TCPDF_IMAGES::setGDImageTransparency($imgr, $img); + } + imagecopyresampled($imgr, $img, 0, 0, 0, 0, $neww, $newh, $pixw, $pixh); + $img = $imgr; + } + if (($type == 'gif') OR ($type == 'png')) { + $info = TCPDF_IMAGES::_toPNG($img, TCPDF_STATIC::getObjFilename('img', $this->file_id)); + } else { + $info = TCPDF_IMAGES::_toJPEG($img, $this->jpeg_quality, TCPDF_STATIC::getObjFilename('img', $this->file_id)); + } + } + } catch(Exception $e) { + $info = false; + } + } + if (($info === false) AND extension_loaded('imagick')) { + try { + // ImageMagick library + $img = new Imagick(); + if ($type == 'svg') { + if ($file[0] === '@') { + // image from string + $svgimg = substr($file, 1); + } else { + // get SVG file content + $svgimg = $this->getCachedFileContents($file); + } + if ($svgimg !== FALSE) { + // get width and height + $regs = array(); + if (preg_match('/]*)>/si', $svgimg, $regs)) { + $svgtag = $regs[1]; + $tmp = array(); + if (preg_match('/[\s]+width[\s]*=[\s]*"([^"]*)"/si', $svgtag, $tmp)) { + $ow = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false); + $owu = sprintf('%F', ($ow * $dpi / 72)).$this->pdfunit; + $svgtag = preg_replace('/[\s]+width[\s]*=[\s]*"[^"]*"/si', ' width="'.$owu.'"', $svgtag, 1); + } else { + $ow = $w; + } + $tmp = array(); + if (preg_match('/[\s]+height[\s]*=[\s]*"([^"]*)"/si', $svgtag, $tmp)) { + $oh = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false); + $ohu = sprintf('%F', ($oh * $dpi / 72)).$this->pdfunit; + $svgtag = preg_replace('/[\s]+height[\s]*=[\s]*"[^"]*"/si', ' height="'.$ohu.'"', $svgtag, 1); + } else { + $oh = $h; + } + $tmp = array(); + if (!preg_match('/[\s]+viewBox[\s]*=[\s]*"[\s]*([0-9\.]+)[\s]+([0-9\.]+)[\s]+([0-9\.]+)[\s]+([0-9\.]+)[\s]*"/si', $svgtag, $tmp)) { + $vbw = ($ow * $this->imgscale * $this->k); + $vbh = ($oh * $this->imgscale * $this->k); + $vbox = sprintf(' viewBox="0 0 %F %F" ', $vbw, $vbh); + $svgtag = $vbox.$svgtag; + } + $svgimg = preg_replace('/]*)>/si', '', $svgimg, 1); + } + $img->readImageBlob($svgimg); + } + } else { + $img->readImage($file); + } + if ($resize) { + $img->resizeImage($neww, $newh, 10, 1, false); + } + $img->setCompressionQuality($this->jpeg_quality); + $img->setImageFormat('jpeg'); + $tempname = TCPDF_STATIC::getObjFilename('img', $this->file_id); + $img->writeImage($tempname); + $info = TCPDF_IMAGES::_parsejpeg($tempname); + unlink($tempname); + $img->destroy(); + } catch(Exception $e) { + $info = false; + } + } + if ($info === false) { + // unable to process image + return false; + } + if ($ismask) { + // force grayscale + $info['cs'] = 'DeviceGray'; + } + if ($imgmask !== false) { + $info['masked'] = $imgmask; + } + if (!empty($exurl)) { + $info['exurl'] = $exurl; + } + // array of alternative images + $info['altimgs'] = $altimgs; + // add image to document + $info['i'] = $this->setImageBuffer($file, $info); + } + // set alignment + $this->img_rb_x = $x + $w; + $this->img_rb_y = $y + $h; + + // set alignment + if ($palign == 'L') { + $ximg = $this->lMargin; + } elseif ($palign == 'C') { + $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($palign == 'R') { + $ximg = $this->w - $this->rMargin - $w; + } else { + $ximg = $this->rtl ? $x - $w : $x; + } + + if ($ismask OR $hidden) { + // image is not displayed + return $info['i']; + } + $xkimg = $ximg * $this->k; + if (!$alt) { + // only non-alternative immages will be set + $this->_out(sprintf('q %F 0 0 %F %F %F cm /I%u Do Q', ($w * $this->k), ($h * $this->k), $xkimg, (($this->h - ($y + $h)) * $this->k), $info['i'])); + } + if (!empty($border)) { + $bx = $this->x; + $by = $this->y; + $this->x = $ximg; + if ($this->rtl) { + $this->x += $w; + } + $this->y = $y; + $this->Cell($w, $h, '', $border, 0, '', 0, '', 0, true); + $this->x = $bx; + $this->y = $by; + } + if ($link) { + $this->Link($ximg, $y, $w, $h, $link, 0); + } + // set pointer to align the next text/objects + switch($align) { + case 'T': { + $this->y = $y; + $this->x = $this->img_rb_x; + break; + } + case 'M': { + $this->y = $y + round($h/2); + $this->x = $this->img_rb_x; + break; + } + case 'B': { + $this->y = $this->img_rb_y; + $this->x = $this->img_rb_x; + break; + } + case 'N': { + $this->setY($this->img_rb_y); + break; + } + default:{ + break; + } + } + $this->endlinex = $this->img_rb_x; + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['images'][] = $info['i']; + } + return $info['i']; + } + + /** + * Extract info from a PNG image with alpha channel using the Imagick or GD library. + * @param string $file Name of the file containing the image. + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $wpx Original width of the image in pixels. + * @param float $hpx original height of the image in pixels. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param string $type Image format. Possible values are (case insensitive): JPEG and PNG (whitout GD library) and all images supported by GD: GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM;. If not specified, the type is inferred from the file extension. + * @param mixed $link URL or identifier returned by AddLink(). + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        + * @param boolean $resize If true resize (reduce) the image to fit $w and $h (requires GD library). + * @param int $dpi dot-per-inch resolution used on resize + * @param string $palign Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        + * @param string $filehash File hash used to build unique file names. + * @author Nicola Asuni + * @protected + * @since 4.3.007 (2008-12-04) + * @see Image() + */ + protected function ImagePngAlpha($file, $x, $y, $wpx, $hpx, $w, $h, $type, $link, $align, $resize, $dpi, $palign, $filehash='') { + // create temp images + if (empty($filehash)) { + $filehash = md5($file); + } + // create temp image file (without alpha channel) + $tempfile_plain = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_plain_'.$filehash; + // create temp alpha file + $tempfile_alpha = K_PATH_CACHE.'__tcpdf_'.$this->file_id.'_imgmask_alpha_'.$filehash; + $parsed = false; + $parse_error = ''; + // ImageMagick extension + if (($parsed === false) AND extension_loaded('imagick')) { + try { + // ImageMagick library + $img = new Imagick(); + $img->readImage($file); + // clone image object + $imga = TCPDF_STATIC::objclone($img); + // extract alpha channel + if (method_exists($img, 'setImageAlphaChannel') AND defined('Imagick::ALPHACHANNEL_EXTRACT')) { + $img->setImageAlphaChannel(Imagick::ALPHACHANNEL_EXTRACT); + } else { + $img->separateImageChannel(8); // 8 = (imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE); + $img->negateImage(true); + } + $img->setImageFormat('png'); + $img->writeImage($tempfile_alpha); + // remove alpha channel + if (method_exists($imga, 'setImageMatte')) { + $imga->setImageMatte(false); + } else { + $imga->separateImageChannel(39); // 39 = (imagick::CHANNEL_ALL & ~(imagick::CHANNEL_ALPHA | imagick::CHANNEL_OPACITY | imagick::CHANNEL_MATTE)); + } + $imga->setImageFormat('png'); + $imga->writeImage($tempfile_plain); + $parsed = true; + } catch (Exception $e) { + // Imagemagick fails, try with GD + $parse_error = 'Imagick library error: '.$e->getMessage(); + } + } + // GD extension + if (($parsed === false) AND function_exists('imagecreatefrompng')) { + try { + // generate images + $img = imagecreatefrompng($file); + $imgalpha = imagecreate($wpx, $hpx); + // generate gray scale palette (0 -> 255) + for ($c = 0; $c < 256; ++$c) { + ImageColorAllocate($imgalpha, $c, $c, $c); + } + // extract alpha channel + for ($xpx = 0; $xpx < $wpx; ++$xpx) { + for ($ypx = 0; $ypx < $hpx; ++$ypx) { + $color = imagecolorat($img, $xpx, $ypx); + // get and correct gamma color + $alpha = $this->getGDgamma($img, $color); + imagesetpixel($imgalpha, (int) $xpx, (int) $ypx, (int) $alpha); + } + } + imagepng($imgalpha, $tempfile_alpha); + imagedestroy($imgalpha); + // extract image without alpha channel + $imgplain = imagecreatetruecolor($wpx, $hpx); + imagecopy($imgplain, $img, 0, 0, 0, 0, $wpx, $hpx); + imagepng($imgplain, $tempfile_plain); + imagedestroy($imgplain); + $parsed = true; + } catch (Exception $e) { + // GD fails + $parse_error = 'GD library error: '.$e->getMessage(); + } + } + if ($parsed === false) { + if (empty($parse_error)) { + $this->Error('TCPDF requires the Imagick or GD extension to handle PNG images with alpha channel.'); + } else { + $this->Error($parse_error); + } + } + // embed mask image + $imgmask = $this->Image($tempfile_alpha, $x, $y, $w, $h, 'PNG', '', '', $resize, $dpi, '', true, false); + // embed image, masked with previously embedded mask + $this->Image($tempfile_plain, $x, $y, $w, $h, $type, $link, $align, $resize, $dpi, $palign, false, $imgmask); + } + + /** + * Get the GD-corrected PNG gamma value from alpha color + * @param resource $img GD image Resource ID. + * @param int $c alpha color + * @protected + * @since 4.3.007 (2008-12-04) + */ + protected function getGDgamma($img, $c) { + if (!isset($this->gdgammacache['#'.$c])) { + $colors = imagecolorsforindex($img, $c); + // GD alpha is only 7 bit (0 -> 127) + $this->gdgammacache['#'.$c] = (int) (((127 - $colors['alpha']) / 127) * 255); + // correct gamma + $this->gdgammacache['#'.$c] = (int) (pow(($this->gdgammacache['#'.$c] / 255), 2.2) * 255); + // store the latest values on cache to improve performances + if (count($this->gdgammacache) > 8) { + // remove one element from the cache array + array_shift($this->gdgammacache); + } + } + return $this->gdgammacache['#'.$c]; + } + + /** + * Performs a line break. + * The current abscissa goes back to the left margin and the ordinate increases by the amount passed in parameter. + * @param float|null $h The height of the break. By default, the value equals the height of the last printed cell. + * @param boolean $cell if true add the current left (or right o for RTL) padding to the X coordinate + * @public + * @since 1.0 + * @see Cell() + */ + public function Ln($h=null, $cell=false) { + if (($this->num_columns > 1) AND ($this->y == $this->columns[$this->current_column]['y']) AND isset($this->columns[$this->current_column]['x']) AND ($this->x == $this->columns[$this->current_column]['x'])) { + // revove vertical space from the top of the column + return; + } + if ($cell) { + if ($this->rtl) { + $cellpadding = $this->cell_padding['R']; + } else { + $cellpadding = $this->cell_padding['L']; + } + } else { + $cellpadding = 0; + } + if ($this->rtl) { + $this->x = $this->w - $this->rMargin - $cellpadding; + } else { + $this->x = $this->lMargin + $cellpadding; + } + if (TCPDF_STATIC::empty_string($h)) { + $h = $this->lasth; + } + $this->y += $h; + $this->newline = true; + } + + /** + * Returns the relative X value of current position. + * The value is relative to the left border for LTR languages and to the right border for RTL languages. + * @return float + * @public + * @since 1.2 + * @see SetX(), GetY(), SetY() + */ + public function GetX() { + //Get x position + if ($this->rtl) { + return ($this->w - $this->x); + } else { + return $this->x; + } + } + + /** + * Returns the absolute X value of current position. + * @return float + * @public + * @since 1.2 + * @see SetX(), GetY(), SetY() + */ + public function GetAbsX() { + return $this->x; + } + + /** + * Returns the ordinate of the current position. + * @return float + * @public + * @since 1.0 + * @see SetY(), GetX(), SetX() + */ + public function GetY() { + return $this->y; + } + + /** + * Defines the abscissa of the current position. + * If the passed value is negative, it is relative to the right of the page (or left if language is RTL). + * @param float $x The value of the abscissa in user units. + * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. + * @public + * @since 1.2 + * @see GetX(), GetY(), SetY(), SetXY() + */ + public function setX($x, $rtloff=false) { + $x = floatval($x); + if (!$rtloff AND $this->rtl) { + if ($x >= 0) { + $this->x = $this->w - $x; + } else { + $this->x = abs($x); + } + } else { + if ($x >= 0) { + $this->x = $x; + } else { + $this->x = $this->w + $x; + } + } + if ($this->x < 0) { + $this->x = 0; + } + if ($this->x > $this->w) { + $this->x = $this->w; + } + } + + /** + * Moves the current abscissa back to the left margin and sets the ordinate. + * If the passed value is negative, it is relative to the bottom of the page. + * @param float $y The value of the ordinate in user units. + * @param bool $resetx if true (default) reset the X position. + * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. + * @public + * @since 1.0 + * @see GetX(), GetY(), SetY(), SetXY() + */ + public function setY($y, $resetx=true, $rtloff=false) { + $y = floatval($y); + if ($resetx) { + //reset x + if (!$rtloff AND $this->rtl) { + $this->x = $this->w - $this->rMargin; + } else { + $this->x = $this->lMargin; + } + } + if ($y >= 0) { + $this->y = $y; + } else { + $this->y = $this->h + $y; + } + if ($this->y < 0) { + $this->y = 0; + } + if ($this->y > $this->h) { + $this->y = $this->h; + } + } + + /** + * Defines the abscissa and ordinate of the current position. + * If the passed values are negative, they are relative respectively to the right and bottom of the page. + * @param float $x The value of the abscissa. + * @param float $y The value of the ordinate. + * @param boolean $rtloff if true always uses the page top-left corner as origin of axis. + * @public + * @since 1.2 + * @see SetX(), SetY() + */ + public function setXY($x, $y, $rtloff=false) { + $this->setY($y, false, $rtloff); + $this->setX($x, $rtloff); + } + + /** + * Set the absolute X coordinate of the current pointer. + * @param float $x The value of the abscissa in user units. + * @public + * @since 5.9.186 (2012-09-13) + * @see setAbsX(), setAbsY(), SetAbsXY() + */ + public function setAbsX($x) { + $this->x = floatval($x); + } + + /** + * Set the absolute Y coordinate of the current pointer. + * @param float $y (float) The value of the ordinate in user units. + * @public + * @since 5.9.186 (2012-09-13) + * @see setAbsX(), setAbsY(), SetAbsXY() + */ + public function setAbsY($y) { + $this->y = floatval($y); + } + + /** + * Set the absolute X and Y coordinates of the current pointer. + * @param float $x The value of the abscissa in user units. + * @param float $y (float) The value of the ordinate in user units. + * @public + * @since 5.9.186 (2012-09-13) + * @see setAbsX(), setAbsY(), SetAbsXY() + */ + public function setAbsXY($x, $y) { + $this->setAbsX($x); + $this->setAbsY($y); + } + + /** + * Send the document to a given destination: string, local file or browser. + * In the last case, the plug-in may be used (if present) or a download ("Save as" dialog box) may be forced.
        + * The method first calls Close() if necessary to terminate the document. + * @param string $name The name of the file when saved + * @param string $dest Destination where to send the document. It can take one of the following values:
        • I: send the file inline to the browser (default). The plug-in is used if available. The name given by name is used when one selects the "Save as" option on the link generating the PDF.
        • D: send to the browser and force a file download with the name given by name.
        • F: save to a local server file with the name given by name.
        • S: return the document as a string (name is ignored).
        • FI: equivalent to F + I option
        • FD: equivalent to F + D option
        • E: return the document as base64 mime multi-part email attachment (RFC 2045)
        + * @return string + * @public + * @since 1.0 + * @see Close() + */ + public function Output($name='doc.pdf', $dest='I') { + //Output PDF to some destination + //Finish document if necessary + if ($this->state < 3) { + $this->Close(); + } + //Normalize parameters + if (is_bool($dest)) { + $dest = $dest ? 'D' : 'F'; + } + $dest = strtoupper($dest); + + if ($this->sign) { + // *** apply digital signature to the document *** + // get the document content + $pdfdoc = $this->getBuffer(); + // remove last newline + $pdfdoc = substr($pdfdoc, 0, -1); + // remove filler space + $byterange_string_len = strlen(TCPDF_STATIC::$byterange_string); + // define the ByteRange + $byte_range = array(); + $byte_range[0] = 0; + $byte_range[1] = strpos($pdfdoc, TCPDF_STATIC::$byterange_string) + $byterange_string_len + 10; + $byte_range[2] = $byte_range[1] + $this->signature_max_length + 2; + $byte_range[3] = strlen($pdfdoc) - $byte_range[2]; + $pdfdoc = substr($pdfdoc, 0, $byte_range[1]).substr($pdfdoc, $byte_range[2]); + // replace the ByteRange + $byterange = sprintf('/ByteRange[0 %u %u %u]', $byte_range[1], $byte_range[2], $byte_range[3]); + $byterange .= str_repeat(' ', ($byterange_string_len - strlen($byterange))); + $pdfdoc = str_replace(TCPDF_STATIC::$byterange_string, $byterange, $pdfdoc); + // write the document to a temporary folder + $tempdoc = TCPDF_STATIC::getObjFilename('doc', $this->file_id); + $f = TCPDF_STATIC::fopenLocal($tempdoc, 'wb'); + if (!$f) { + $this->Error('Unable to create temporary file: '.$tempdoc); + } + $pdfdoc_length = strlen($pdfdoc); + fwrite($f, $pdfdoc, $pdfdoc_length); + fclose($f); + // get digital signature via openssl library + $tempsign = TCPDF_STATIC::getObjFilename('sig', $this->file_id); + if (empty($this->signature_data['extracerts'])) { + openssl_pkcs7_sign($tempdoc, $tempsign, $this->signature_data['signcert'], array($this->signature_data['privkey'], $this->signature_data['password']), array(), PKCS7_BINARY | PKCS7_DETACHED); + } else { + openssl_pkcs7_sign($tempdoc, $tempsign, $this->signature_data['signcert'], array($this->signature_data['privkey'], $this->signature_data['password']), array(), PKCS7_BINARY | PKCS7_DETACHED, $this->signature_data['extracerts']); + } + // read signature + $signature = file_get_contents($tempsign); + // extract signature + $signature = substr($signature, $pdfdoc_length); + $signature = substr($signature, (strpos($signature, "%%EOF\n\n------") + 13)); + $tmparr = explode("\n\n", $signature); + $signature = $tmparr[1]; + // decode signature + $signature = base64_decode(trim($signature)); + // add TSA timestamp to signature + $signature = $this->applyTSA($signature); + // convert signature to hex + $signature = current(unpack('H*', $signature)); + $signature = str_pad($signature, $this->signature_max_length, '0'); + // Add signature to the document + $this->buffer = substr($pdfdoc, 0, $byte_range[1]).'<'.$signature.'>'.substr($pdfdoc, $byte_range[1]); + $this->bufferlen = strlen($this->buffer); + } + switch($dest) { + case 'I': { + // Send PDF to the standard output + if (ob_get_contents()) { + $this->Error('Some data has already been output, can\'t send PDF file'); + } + if (php_sapi_name() != 'cli') { + // send output to a browser + header('Content-Type: application/pdf'); + if (headers_sent()) { + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + } + header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1'); + //header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + header('Content-Disposition: inline; filename="' . rawurlencode(basename($name)) . '"; ' . + 'filename*=UTF-8\'\'' . rawurlencode(basename($name))); + TCPDF_STATIC::sendOutputData($this->getBuffer(), $this->bufferlen); + } else { + echo $this->getBuffer(); + } + break; + } + case 'D': { + // download PDF as file + if (ob_get_contents()) { + $this->Error('Some data has already been output, can\'t send PDF file'); + } + header('Content-Description: File Transfer'); + if (headers_sent()) { + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + } + header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1'); + //header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + // force download dialog + if (strpos(php_sapi_name(), 'cgi') === false) { + header('Content-Type: application/force-download'); + header('Content-Type: application/octet-stream', false); + header('Content-Type: application/download', false); + header('Content-Type: application/pdf', false); + } else { + header('Content-Type: application/pdf'); + } + // use the Content-Disposition header to supply a recommended filename + header('Content-Disposition: attachment; filename="' . rawurlencode(basename($name)) . '"; ' . + 'filename*=UTF-8\'\'' . rawurlencode(basename($name))); + header('Content-Transfer-Encoding: binary'); + TCPDF_STATIC::sendOutputData($this->getBuffer(), $this->bufferlen); + break; + } + case 'F': + case 'FI': + case 'FD': { + // save PDF to a local file + $f = TCPDF_STATIC::fopenLocal($name, 'wb'); + if (!$f) { + $this->Error('Unable to create output file: '.$name); + } + fwrite($f, $this->getBuffer(), $this->bufferlen); + fclose($f); + if ($dest == 'FI') { + // send headers to browser + header('Content-Type: application/pdf'); + header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1'); + //header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + header('Content-Disposition: inline; filename="'.basename($name).'"'); + TCPDF_STATIC::sendOutputData(file_get_contents($name), filesize($name)); + } elseif ($dest == 'FD') { + // send headers to browser + if (ob_get_contents()) { + $this->Error('Some data has already been output, can\'t send PDF file'); + } + header('Content-Description: File Transfer'); + if (headers_sent()) { + $this->Error('Some data has already been output to browser, can\'t send PDF file'); + } + header('Cache-Control: private, must-revalidate, post-check=0, pre-check=0, max-age=1'); + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + // force download dialog + if (strpos(php_sapi_name(), 'cgi') === false) { + header('Content-Type: application/force-download'); + header('Content-Type: application/octet-stream', false); + header('Content-Type: application/download', false); + header('Content-Type: application/pdf', false); + } else { + header('Content-Type: application/pdf'); + } + // use the Content-Disposition header to supply a recommended filename + header('Content-Disposition: attachment; filename="'.basename($name).'"'); + header('Content-Transfer-Encoding: binary'); + TCPDF_STATIC::sendOutputData(file_get_contents($name), filesize($name)); + } + break; + } + case 'E': { + // return PDF as base64 mime multi-part email attachment (RFC 2045) + $retval = 'Content-Type: application/pdf;'."\r\n"; + $retval .= ' name="'.$name.'"'."\r\n"; + $retval .= 'Content-Transfer-Encoding: base64'."\r\n"; + $retval .= 'Content-Disposition: attachment;'."\r\n"; + $retval .= ' filename="'.$name.'"'."\r\n\r\n"; + $retval .= chunk_split(base64_encode($this->getBuffer()), 76, "\r\n"); + return $retval; + } + case 'S': { + // returns PDF as a string + return $this->getBuffer(); + } + default: { + $this->Error('Incorrect output destination: '.$dest); + } + } + return ''; + } + + protected static $cleaned_ids = array(); + /** + * Unset all class variables except the following critical variables. + * @param boolean $destroyall if true destroys all class variables, otherwise preserves critical variables. + * @param boolean $preserve_objcopy if true preserves the objcopy variable + * @public + * @since 4.5.016 (2009-02-24) + */ + public function _destroy($destroyall=false, $preserve_objcopy=false) { + if (isset(self::$cleaned_ids[$this->file_id])) { + $destroyall = false; + } + if ($destroyall AND !$preserve_objcopy && isset($this->file_id)) { + self::$cleaned_ids[$this->file_id] = true; + // remove all temporary files + if ($handle = @opendir(K_PATH_CACHE)) { + while ( false !== ( $file_name = readdir( $handle ) ) ) { + if (strpos($file_name, '__tcpdf_'.$this->file_id.'_') === 0) { + unlink(K_PATH_CACHE.$file_name); + } + } + closedir($handle); + } + if (isset($this->imagekeys)) { + foreach($this->imagekeys as $file) { + if (strpos($file, K_PATH_CACHE) === 0 && TCPDF_STATIC::file_exists($file)) { + @unlink($file); + } + } + } + } + $preserve = array( + 'file_id', + 'state', + 'bufferlen', + 'buffer', + 'cached_files', + 'imagekeys', + 'sign', + 'signature_data', + 'signature_max_length', + 'byterange_string', + 'tsa_timestamp', + 'tsa_data' + ); + foreach (array_keys(get_object_vars($this)) as $val) { + if ($destroyall OR !in_array($val, $preserve)) { + if ((!$preserve_objcopy OR ($val != 'objcopy')) AND ($val != 'file_id') AND isset($this->$val)) { + unset($this->$val); + } + } + } + } + + /** + * Check for locale-related bug + * @protected + */ + protected function _dochecks() { + //Check for locale-related bug + if (1.1 == 1) { + $this->Error('Don\'t alter the locale before including class file'); + } + //Check for decimal separator + if (sprintf('%.1F', 1.0) != '1.0') { + setlocale(LC_NUMERIC, 'C'); + } + } + + /** + * Return an array containing variations for the basic page number alias. + * @param string $a Base alias. + * @return array of page number aliases + * @protected + */ + protected function getInternalPageNumberAliases($a= '') { + $alias = array(); + // build array of Unicode + ASCII variants (the order is important) + $alias = array('u' => array(), 'a' => array()); + $u = '{'.$a.'}'; + $alias['u'][] = TCPDF_STATIC::_escape($u); + if ($this->isunicode) { + $alias['u'][] = TCPDF_STATIC::_escape(TCPDF_FONTS::UTF8ToLatin1($u, $this->isunicode, $this->CurrentFont)); + $alias['u'][] = TCPDF_STATIC::_escape(TCPDF_FONTS::utf8StrRev($u, false, $this->tmprtl, $this->isunicode, $this->CurrentFont)); + $alias['a'][] = TCPDF_STATIC::_escape(TCPDF_FONTS::UTF8ToLatin1($a, $this->isunicode, $this->CurrentFont)); + $alias['a'][] = TCPDF_STATIC::_escape(TCPDF_FONTS::utf8StrRev($a, false, $this->tmprtl, $this->isunicode, $this->CurrentFont)); + } + $alias['a'][] = TCPDF_STATIC::_escape($a); + return $alias; + } + + /** + * Return an array containing all internal page aliases. + * @return array of page number aliases + * @protected + */ + protected function getAllInternalPageNumberAliases() { + $basic_alias = array(TCPDF_STATIC::$alias_tot_pages, TCPDF_STATIC::$alias_num_page, TCPDF_STATIC::$alias_group_tot_pages, TCPDF_STATIC::$alias_group_num_page, TCPDF_STATIC::$alias_right_shift); + $pnalias = array(); + foreach($basic_alias as $k => $a) { + $pnalias[$k] = $this->getInternalPageNumberAliases($a); + } + return $pnalias; + } + + /** + * Replace right shift page number aliases with spaces to correct right alignment. + * This works perfectly only when using monospaced fonts. + * @param string $page Page content. + * @param array $aliases Array of page aliases. + * @param int $diff initial difference to add. + * @return string replaced page content. + * @protected + */ + protected function replaceRightShiftPageNumAliases($page, $aliases, $diff) { + foreach ($aliases as $type => $alias) { + foreach ($alias as $a) { + // find position of compensation factor + $startnum = (strpos($a, ':') + 1); + $a = substr($a, 0, $startnum); + if (($pos = strpos($page, $a)) !== false) { + // end of alias + $endnum = strpos($page, '}', $pos); + // string to be replaced + $aa = substr($page, $pos, ($endnum - $pos + 1)); + // get compensation factor + $ratio = substr($page, ($pos + $startnum), ($endnum - $pos - $startnum)); + $ratio = preg_replace('/[^0-9\.]/', '', $ratio); + $ratio = floatval($ratio); + if ($type == 'u') { + $chrdiff = floor(($diff + 12) * $ratio); + $shift = str_repeat(' ', $chrdiff); + $shift = TCPDF_FONTS::UTF8ToUTF16BE($shift, false, $this->isunicode, $this->CurrentFont); + } else { + $chrdiff = floor(($diff + 11) * $ratio); + $shift = str_repeat(' ', $chrdiff); + } + $page = str_replace($aa, $shift, $page); + } + } + } + return $page; + } + + /** + * Set page boxes to be included on page descriptions. + * @param array $boxes Array of page boxes to set on document: ('MediaBox', 'CropBox', 'BleedBox', 'TrimBox', 'ArtBox'). + * @protected + */ + protected function setPageBoxTypes($boxes) { + $this->page_boxes = array(); + foreach ($boxes as $box) { + if (in_array($box, TCPDF_STATIC::$pageboxes)) { + $this->page_boxes[] = $box; + } + } + } + + /** + * Output pages (and replace page number aliases). + * @protected + */ + protected function _putpages() { + $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; + // get internal aliases for page numbers + $pnalias = $this->getAllInternalPageNumberAliases(); + $num_pages = $this->numpages; + $ptpa = TCPDF_STATIC::formatPageNumber(($this->starting_page_number + $num_pages - 1)); + $ptpu = TCPDF_FONTS::UTF8ToUTF16BE($ptpa, false, $this->isunicode, $this->CurrentFont); + $ptp_num_chars = $this->GetNumChars($ptpa); + $pagegroupnum = 0; + $groupnum = 0; + $ptgu = 1; + $ptga = 1; + $ptg_num_chars = 1; + for ($n = 1; $n <= $num_pages; ++$n) { + // get current page + $temppage = $this->getPageBuffer($n); + $pagelen = strlen($temppage); + // set replacements for total pages number + $pnpa = TCPDF_STATIC::formatPageNumber(($this->starting_page_number + $n - 1)); + $pnpu = TCPDF_FONTS::UTF8ToUTF16BE($pnpa, false, $this->isunicode, $this->CurrentFont); + $pnp_num_chars = $this->GetNumChars($pnpa); + $pdiff = 0; // difference used for right shift alignment of page numbers + $gdiff = 0; // difference used for right shift alignment of page group numbers + if (!empty($this->pagegroups)) { + if (isset($this->newpagegroup[$n])) { + $pagegroupnum = 0; + ++$groupnum; + $ptga = TCPDF_STATIC::formatPageNumber($this->pagegroups[$groupnum]); + $ptgu = TCPDF_FONTS::UTF8ToUTF16BE($ptga, false, $this->isunicode, $this->CurrentFont); + $ptg_num_chars = $this->GetNumChars($ptga); + } + ++$pagegroupnum; + $pnga = TCPDF_STATIC::formatPageNumber($pagegroupnum); + $pngu = TCPDF_FONTS::UTF8ToUTF16BE($pnga, false, $this->isunicode, $this->CurrentFont); + $png_num_chars = $this->GetNumChars($pnga); + // replace page numbers + $replace = array(); + $replace[] = array($ptgu, $ptg_num_chars, 9, $pnalias[2]['u']); + $replace[] = array($ptga, $ptg_num_chars, 7, $pnalias[2]['a']); + $replace[] = array($pngu, $png_num_chars, 9, $pnalias[3]['u']); + $replace[] = array($pnga, $png_num_chars, 7, $pnalias[3]['a']); + list($temppage, $gdiff) = TCPDF_STATIC::replacePageNumAliases($temppage, $replace, $gdiff); + } + // replace page numbers + $replace = array(); + $replace[] = array($ptpu, $ptp_num_chars, 9, $pnalias[0]['u']); + $replace[] = array($ptpa, $ptp_num_chars, 7, $pnalias[0]['a']); + $replace[] = array($pnpu, $pnp_num_chars, 9, $pnalias[1]['u']); + $replace[] = array($pnpa, $pnp_num_chars, 7, $pnalias[1]['a']); + list($temppage, $pdiff) = TCPDF_STATIC::replacePageNumAliases($temppage, $replace, $pdiff); + // replace right shift alias + $temppage = $this->replaceRightShiftPageNumAliases($temppage, $pnalias[4], max($pdiff, $gdiff)); + // replace EPS marker + $temppage = str_replace($this->epsmarker, '', $temppage); + //Page + $this->page_obj_id[$n] = $this->_newobj(); + $out = '<<'; + $out .= ' /Type /Page'; + $out .= ' /Parent 1 0 R'; + if (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A')) { + $out .= ' /LastModified '.$this->_datestring(0, $this->doc_modification_timestamp); + } + $out .= ' /Resources 2 0 R'; + foreach ($this->page_boxes as $box) { + $out .= ' /'.$box; + $out .= sprintf(' [%F %F %F %F]', $this->pagedim[$n][$box]['llx'], $this->pagedim[$n][$box]['lly'], $this->pagedim[$n][$box]['urx'], $this->pagedim[$n][$box]['ury']); + } + if (isset($this->pagedim[$n]['BoxColorInfo']) AND !empty($this->pagedim[$n]['BoxColorInfo'])) { + $out .= ' /BoxColorInfo <<'; + foreach ($this->page_boxes as $box) { + if (isset($this->pagedim[$n]['BoxColorInfo'][$box])) { + $out .= ' /'.$box.' <<'; + if (isset($this->pagedim[$n]['BoxColorInfo'][$box]['C'])) { + $color = $this->pagedim[$n]['BoxColorInfo'][$box]['C']; + $out .= ' /C ['; + $out .= sprintf(' %F %F %F', ($color[0] / 255), ($color[1] / 255), ($color[2] / 255)); + $out .= ' ]'; + } + if (isset($this->pagedim[$n]['BoxColorInfo'][$box]['W'])) { + $out .= ' /W '.($this->pagedim[$n]['BoxColorInfo'][$box]['W'] * $this->k); + } + if (isset($this->pagedim[$n]['BoxColorInfo'][$box]['S'])) { + $out .= ' /S /'.$this->pagedim[$n]['BoxColorInfo'][$box]['S']; + } + if (isset($this->pagedim[$n]['BoxColorInfo'][$box]['D'])) { + $dashes = $this->pagedim[$n]['BoxColorInfo'][$box]['D']; + $out .= ' /D ['; + foreach ($dashes as $dash) { + $out .= sprintf(' %F', ($dash * $this->k)); + } + $out .= ' ]'; + } + $out .= ' >>'; + } + } + $out .= ' >>'; + } + $out .= ' /Contents '.($this->n + 1).' 0 R'; + $out .= ' /Rotate '.$this->pagedim[$n]['Rotate']; + if (!$this->pdfa_mode || $this->pdfa_version >= 2) { + $out .= ' /Group << /Type /Group /S /Transparency /CS /DeviceRGB >>'; + } + if (isset($this->pagedim[$n]['trans']) AND !empty($this->pagedim[$n]['trans'])) { + // page transitions + if (isset($this->pagedim[$n]['trans']['Dur'])) { + $out .= ' /Dur '.$this->pagedim[$n]['trans']['Dur']; + } + $out .= ' /Trans <<'; + $out .= ' /Type /Trans'; + if (isset($this->pagedim[$n]['trans']['S'])) { + $out .= ' /S /'.$this->pagedim[$n]['trans']['S']; + } + if (isset($this->pagedim[$n]['trans']['D'])) { + $out .= ' /D '.$this->pagedim[$n]['trans']['D']; + } + if (isset($this->pagedim[$n]['trans']['Dm'])) { + $out .= ' /Dm /'.$this->pagedim[$n]['trans']['Dm']; + } + if (isset($this->pagedim[$n]['trans']['M'])) { + $out .= ' /M /'.$this->pagedim[$n]['trans']['M']; + } + if (isset($this->pagedim[$n]['trans']['Di'])) { + $out .= ' /Di '.$this->pagedim[$n]['trans']['Di']; + } + if (isset($this->pagedim[$n]['trans']['SS'])) { + $out .= ' /SS '.$this->pagedim[$n]['trans']['SS']; + } + if (isset($this->pagedim[$n]['trans']['B'])) { + $out .= ' /B '.$this->pagedim[$n]['trans']['B']; + } + $out .= ' >>'; + } + $out .= $this->_getannotsrefs($n); + $out .= ' /PZ '.$this->pagedim[$n]['PZ']; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + //Page content + $p = ($this->compress) ? gzcompress($temppage) : $temppage; + $this->_newobj(); + $p = $this->_getrawstream($p); + $this->_out('<<'.$filter.'/Length '.strlen($p).'>> stream'."\n".$p."\n".'endstream'."\n".'endobj'); + } + //Pages root + $out = $this->_getobj(1)."\n"; + $out .= '<< /Type /Pages /Kids ['; + foreach($this->page_obj_id as $page_obj) { + $out .= ' '.$page_obj.' 0 R'; + } + $out .= ' ] /Count '.$num_pages.' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + + /** + * Get references to page annotations. + * @param int $n page number + * @return string + * @protected + * @author Nicola Asuni + * @since 5.0.010 (2010-05-17) + */ + protected function _getannotsrefs($n) { + if (!(isset($this->PageAnnots[$n]) OR ($this->sign AND isset($this->signature_data['cert_type'])))) { + return ''; + } + $out = ' /Annots ['; + if (isset($this->PageAnnots[$n])) { + foreach ($this->PageAnnots[$n] as $key => $val) { + if (!in_array($val['n'], $this->radio_groups)) { + $out .= ' '.$val['n'].' 0 R'; + } + } + // add radiobutton groups + if (isset($this->radiobutton_groups[$n])) { + foreach ($this->radiobutton_groups[$n] as $key => $data) { + if (isset($data['n'])) { + $out .= ' '.$data['n'].' 0 R'; + } + } + } + } + if ($this->sign AND ($n == $this->signature_appearance['page']) AND isset($this->signature_data['cert_type'])) { + // set reference for signature object + $out .= ' '.$this->sig_obj_id.' 0 R'; + } + if (!empty($this->empty_signature_appearance)) { + foreach ($this->empty_signature_appearance as $esa) { + if ($esa['page'] == $n) { + // set reference for empty signature objects + $out .= ' '.$esa['objid'].' 0 R'; + } + } + } + $out .= ' ]'; + return $out; + } + + /** + * Output annotations objects for all pages. + * !!! THIS METHOD IS NOT YET COMPLETED !!! + * See section 12.5 of PDF 32000_2008 reference. + * @protected + * @author Nicola Asuni + * @since 4.0.018 (2008-08-06) + */ + protected function _putannotsobjs() { + // reset object counter + for ($n=1; $n <= $this->numpages; ++$n) { + if (isset($this->PageAnnots[$n])) { + // set page annotations + foreach ($this->PageAnnots[$n] as $key => $pl) { + $annot_obj_id = $this->PageAnnots[$n][$key]['n']; + // create annotation object for grouping radiobuttons + if (isset($this->radiobutton_groups[$n][$pl['txt']]) AND is_array($this->radiobutton_groups[$n][$pl['txt']])) { + $radio_button_obj_id = $this->radiobutton_groups[$n][$pl['txt']]['n']; + $annots = '<<'; + $annots .= ' /Type /Annot'; + $annots .= ' /Subtype /Widget'; + $annots .= ' /Rect [0 0 0 0]'; + if ($this->radiobutton_groups[$n][$pl['txt']]['#readonly#']) { + // read only + $annots .= ' /F 68'; + $annots .= ' /Ff 49153'; + } else { + $annots .= ' /F 4'; // default print for PDF/A + $annots .= ' /Ff 49152'; + } + $annots .= ' /T '.$this->_datastring($pl['txt'], $radio_button_obj_id); + if (isset($pl['opt']['tu']) AND is_string($pl['opt']['tu'])) { + $annots .= ' /TU '.$this->_datastring($pl['opt']['tu'], $radio_button_obj_id); + } + $annots .= ' /FT /Btn'; + $annots .= ' /Kids ['; + $defval = ''; + foreach ($this->radiobutton_groups[$n][$pl['txt']] as $key => $data) { + if (isset($data['kid'])) { + $annots .= ' '.$data['kid'].' 0 R'; + if ($data['def'] !== 'Off') { + $defval = $data['def']; + } + } + } + $annots .= ' ]'; + if (!empty($defval)) { + $annots .= ' /V /'.$defval; + } + $annots .= ' >>'; + $this->_out($this->_getobj($radio_button_obj_id)."\n".$annots."\n".'endobj'); + $this->form_obj_id[] = $radio_button_obj_id; + // store object id to be used on Parent entry of Kids + $this->radiobutton_groups[$n][$pl['txt']] = $radio_button_obj_id; + } + $formfield = false; + $pl['opt'] = array_change_key_case($pl['opt'], CASE_LOWER); + $a = $pl['x'] * $this->k; + $b = $this->pagedim[$n]['h'] - (($pl['y'] + $pl['h']) * $this->k); + $c = $pl['w'] * $this->k; + $d = $pl['h'] * $this->k; + $rect = sprintf('%F %F %F %F', $a, $b, $a+$c, $b+$d); + // create new annotation object + $annots = '<_textstring($pl['txt'], $annot_obj_id); + } + $annots .= ' /P '.$this->page_obj_id[$n].' 0 R'; + $annots .= ' /NM '.$this->_datastring(sprintf('%04u-%04u', $n, $key), $annot_obj_id); + $annots .= ' /M '.$this->_datestring($annot_obj_id, $this->doc_modification_timestamp); + if (isset($pl['opt']['f'])) { + $fval = 0; + if (is_array($pl['opt']['f'])) { + foreach ($pl['opt']['f'] as $f) { + switch (strtolower($f)) { + case 'invisible': { + $fval += 1 << 0; + break; + } + case 'hidden': { + $fval += 1 << 1; + break; + } + case 'print': { + $fval += 1 << 2; + break; + } + case 'nozoom': { + $fval += 1 << 3; + break; + } + case 'norotate': { + $fval += 1 << 4; + break; + } + case 'noview': { + $fval += 1 << 5; + break; + } + case 'readonly': { + $fval += 1 << 6; + break; + } + case 'locked': { + $fval += 1 << 8; + break; + } + case 'togglenoview': { + $fval += 1 << 9; + break; + } + case 'lockedcontents': { + $fval += 1 << 10; + break; + } + default: { + break; + } + } + } + } else { + $fval = intval($pl['opt']['f']); + } + } else { + $fval = 4; + } + if ($this->pdfa_mode) { + // force print flag for PDF/A mode + $fval |= 4; + } + $annots .= ' /F '.intval($fval); + if (isset($pl['opt']['as']) AND is_string($pl['opt']['as'])) { + $annots .= ' /AS /'.$pl['opt']['as']; + } + if (isset($pl['opt']['ap'])) { + // appearance stream + $annots .= ' /AP <<'; + if (is_array($pl['opt']['ap'])) { + foreach ($pl['opt']['ap'] as $apmode => $apdef) { + // $apmode can be: n = normal; r = rollover; d = down; + $annots .= ' /'.strtoupper($apmode); + if (is_array($apdef)) { + $annots .= ' <<'; + foreach ($apdef as $apstate => $stream) { + // reference to XObject that define the appearance for this mode-state + $apsobjid = $this->_putAPXObject($c, $d, $stream); + $annots .= ' /'.$apstate.' '.$apsobjid.' 0 R'; + } + $annots .= ' >>'; + } else { + // reference to XObject that define the appearance for this mode + $apsobjid = $this->_putAPXObject($c, $d, $apdef); + $annots .= ' '.$apsobjid.' 0 R'; + } + } + } else { + $annots .= $pl['opt']['ap']; + } + $annots .= ' >>'; + } + if (isset($pl['opt']['bs']) AND (is_array($pl['opt']['bs']))) { + $annots .= ' /BS <<'; + $annots .= ' /Type /Border'; + if (isset($pl['opt']['bs']['w'])) { + $annots .= ' /W '.intval($pl['opt']['bs']['w']); + } + $bstyles = array('S', 'D', 'B', 'I', 'U'); + if (isset($pl['opt']['bs']['s']) AND in_array($pl['opt']['bs']['s'], $bstyles)) { + $annots .= ' /S /'.$pl['opt']['bs']['s']; + } + if (isset($pl['opt']['bs']['d']) AND (is_array($pl['opt']['bs']['d']))) { + $annots .= ' /D ['; + foreach ($pl['opt']['bs']['d'] as $cord) { + $annots .= ' '.intval($cord); + } + $annots .= ']'; + } + $annots .= ' >>'; + } else { + $annots .= ' /Border ['; + if (isset($pl['opt']['border']) AND (count($pl['opt']['border']) >= 3)) { + $annots .= intval($pl['opt']['border'][0]).' '; + $annots .= intval($pl['opt']['border'][1]).' '; + $annots .= intval($pl['opt']['border'][2]); + if (isset($pl['opt']['border'][3]) AND is_array($pl['opt']['border'][3])) { + $annots .= ' ['; + foreach ($pl['opt']['border'][3] as $dash) { + $annots .= intval($dash).' '; + } + $annots .= ']'; + } + } else { + $annots .= '0 0 0'; + } + $annots .= ']'; + } + if (isset($pl['opt']['be']) AND (is_array($pl['opt']['be']))) { + $annots .= ' /BE <<'; + $bstyles = array('S', 'C'); + if (isset($pl['opt']['be']['s']) AND in_array($pl['opt']['be']['s'], $bstyles)) { + $annots .= ' /S /'.$pl['opt']['bs']['s']; + } else { + $annots .= ' /S /S'; + } + if (isset($pl['opt']['be']['i']) AND ($pl['opt']['be']['i'] >= 0) AND ($pl['opt']['be']['i'] <= 2)) { + $annots .= ' /I '.sprintf(' %F', $pl['opt']['be']['i']); + } + $annots .= '>>'; + } + if (isset($pl['opt']['c']) AND (is_array($pl['opt']['c'])) AND !empty($pl['opt']['c'])) { + $annots .= ' /C '.TCPDF_COLORS::getColorStringFromArray($pl['opt']['c']); + } + //$annots .= ' /StructParent '; + //$annots .= ' /OC '; + $markups = array('text', 'freetext', 'line', 'square', 'circle', 'polygon', 'polyline', 'highlight', 'underline', 'squiggly', 'strikeout', 'stamp', 'caret', 'ink', 'fileattachment', 'sound'); + if (in_array(strtolower($pl['opt']['subtype']), $markups)) { + // this is a markup type + if (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) { + $annots .= ' /T '.$this->_textstring($pl['opt']['t'], $annot_obj_id); + } + //$annots .= ' /Popup '; + if (isset($pl['opt']['ca'])) { + $annots .= ' /CA '.sprintf('%F', floatval($pl['opt']['ca'])); + } + if (isset($pl['opt']['rc'])) { + $annots .= ' /RC '.$this->_textstring($pl['opt']['rc'], $annot_obj_id); + } + $annots .= ' /CreationDate '.$this->_datestring($annot_obj_id, $this->doc_creation_timestamp); + //$annots .= ' /IRT '; + if (isset($pl['opt']['subj'])) { + $annots .= ' /Subj '.$this->_textstring($pl['opt']['subj'], $annot_obj_id); + } + //$annots .= ' /RT '; + //$annots .= ' /IT '; + //$annots .= ' /ExData '; + } + $lineendings = array('Square', 'Circle', 'Diamond', 'OpenArrow', 'ClosedArrow', 'None', 'Butt', 'ROpenArrow', 'RClosedArrow', 'Slash'); + // Annotation types + switch (strtolower($pl['opt']['subtype'])) { + case 'text': { + if (isset($pl['opt']['open'])) { + $annots .= ' /Open '. (strtolower($pl['opt']['open']) == 'true' ? 'true' : 'false'); + } + $iconsapp = array('Comment', 'Help', 'Insert', 'Key', 'NewParagraph', 'Note', 'Paragraph'); + if (isset($pl['opt']['name']) AND in_array($pl['opt']['name'], $iconsapp)) { + $annots .= ' /Name /'.$pl['opt']['name']; + } else { + $annots .= ' /Name /Note'; + } + $hasStateModel = isset($pl['opt']['statemodel']); + $hasState = isset($pl['opt']['state']); + $statemodels = array('Marked', 'Review'); + if (!$hasStateModel && !$hasState) { + break; + } + if ($hasStateModel AND in_array($pl['opt']['statemodel'], $statemodels)) { + $annots .= ' /StateModel /'.$pl['opt']['statemodel']; + } else { + $pl['opt']['statemodel'] = 'Marked'; + $annots .= ' /StateModel /'.$pl['opt']['statemodel']; + } + if ($pl['opt']['statemodel'] == 'Marked') { + $states = array('Accepted', 'Unmarked'); + } else { + $states = array('Accepted', 'Rejected', 'Cancelled', 'Completed', 'None'); + } + if ($hasState AND in_array($pl['opt']['state'], $states)) { + $annots .= ' /State /'.$pl['opt']['state']; + } else { + if ($pl['opt']['statemodel'] == 'Marked') { + $annots .= ' /State /Unmarked'; + } else { + $annots .= ' /State /None'; + } + } + break; + } + case 'link': { + if (is_string($pl['txt']) && !empty($pl['txt'])) { + if ($pl['txt'][0] == '#') { + // internal destination + $annots .= ' /A <>'; + } elseif ($pl['txt'][0] == '%') { + // embedded PDF file + $filename = basename(substr($pl['txt'], 1)); + $annots .= ' /A << /S /GoToE /D [0 /Fit] /NewWindow true /T << /R /C /P '.($n - 1).' /A '.$this->embeddedfiles[$filename]['a'].' >> >>'; + } elseif ($pl['txt'][0] == '*') { + // embedded generic file + $filename = basename(substr($pl['txt'], 1)); + $jsa = 'var D=event.target.doc;var MyData=D.dataObjects;for (var i in MyData) if (MyData[i].path=="'.$filename.'") D.exportDataObject( { cName : MyData[i].name, nLaunch : 2});'; + $annots .= ' /A << /S /JavaScript /JS '.$this->_textstring($jsa, $annot_obj_id).'>>'; + } else { + $parsedUrl = parse_url($pl['txt']); + if (empty($parsedUrl['scheme']) AND (!empty($parsedUrl['path']) && strtolower(substr($parsedUrl['path'], -4)) == '.pdf')) { + // relative link to a PDF file + $dest = '[0 /Fit]'; // default page 0 + if (!empty($parsedUrl['fragment'])) { + // check for named destination + $tmp = explode('=', $parsedUrl['fragment']); + $dest = '('.((count($tmp) == 2) ? $tmp[1] : $tmp[0]).')'; + } + $annots .= ' /A <_datastring($this->unhtmlentities($parsedUrl['path']), $annot_obj_id).' /NewWindow true>>'; + } else { + // external URI link + $annots .= ' /A <_datastring($this->unhtmlentities($pl['txt']), $annot_obj_id).'>>'; + } + } + } elseif (isset($this->links[$pl['txt']])) { + // internal link ID + $l = $this->links[$pl['txt']]; + if (isset($this->page_obj_id[($l['p'])])) { + $annots .= sprintf(' /Dest [%u 0 R /XYZ 0 %F null]', $this->page_obj_id[($l['p'])], ($this->pagedim[$l['p']]['h'] - ($l['y'] * $this->k))); + } + } + $hmodes = array('N', 'I', 'O', 'P'); + if (isset($pl['opt']['h']) AND in_array($pl['opt']['h'], $hmodes)) { + $annots .= ' /H /'.$pl['opt']['h']; + } else { + $annots .= ' /H /I'; + } + //$annots .= ' /PA '; + //$annots .= ' /Quadpoints '; + break; + } + case 'freetext': { + if (isset($pl['opt']['da']) AND !empty($pl['opt']['da'])) { + $annots .= ' /DA ('.$pl['opt']['da'].')'; + } + if (isset($pl['opt']['q']) AND ($pl['opt']['q'] >= 0) AND ($pl['opt']['q'] <= 2)) { + $annots .= ' /Q '.intval($pl['opt']['q']); + } + if (isset($pl['opt']['rc'])) { + $annots .= ' /RC '.$this->_textstring($pl['opt']['rc'], $annot_obj_id); + } + if (isset($pl['opt']['ds'])) { + $annots .= ' /DS '.$this->_textstring($pl['opt']['ds'], $annot_obj_id); + } + if (isset($pl['opt']['cl']) AND is_array($pl['opt']['cl'])) { + $annots .= ' /CL ['; + foreach ($pl['opt']['cl'] as $cl) { + $annots .= sprintf('%F ', $cl * $this->k); + } + $annots .= ']'; + } + $tfit = array('FreeText', 'FreeTextCallout', 'FreeTextTypeWriter'); + if (isset($pl['opt']['it']) AND in_array($pl['opt']['it'], $tfit)) { + $annots .= ' /IT /'.$pl['opt']['it']; + } + if (isset($pl['opt']['rd']) AND is_array($pl['opt']['rd'])) { + $l = $pl['opt']['rd'][0] * $this->k; + $r = $pl['opt']['rd'][1] * $this->k; + $t = $pl['opt']['rd'][2] * $this->k; + $b = $pl['opt']['rd'][3] * $this->k; + $annots .= ' /RD ['.sprintf('%F %F %F %F', $l, $r, $t, $b).']'; + } + if (isset($pl['opt']['le']) AND in_array($pl['opt']['le'], $lineendings)) { + $annots .= ' /LE /'.$pl['opt']['le']; + } + break; + } + case 'line': { + break; + } + case 'square': { + break; + } + case 'circle': { + break; + } + case 'polygon': { + break; + } + case 'polyline': { + break; + } + case 'highlight': { + break; + } + case 'underline': { + break; + } + case 'squiggly': { + break; + } + case 'strikeout': { + break; + } + case 'stamp': { + break; + } + case 'caret': { + break; + } + case 'ink': { + break; + } + case 'popup': { + break; + } + case 'fileattachment': { + if ($this->pdfa_mode && $this->pdfa_version != 3) { + // embedded files are not allowed in PDF/A mode version 1 and 2 + break; + } + if (!isset($pl['opt']['fs'])) { + break; + } + $filename = basename($pl['opt']['fs']); + if (isset($this->embeddedfiles[$filename]['f'])) { + $annots .= ' /FS '.$this->embeddedfiles[$filename]['f'].' 0 R'; + $iconsapp = array('Graph', 'Paperclip', 'PushPin', 'Tag'); + if (isset($pl['opt']['name']) AND in_array($pl['opt']['name'], $iconsapp)) { + $annots .= ' /Name /'.$pl['opt']['name']; + } else { + $annots .= ' /Name /PushPin'; + } + // index (zero-based) of the annotation in the Annots array of this page + $this->embeddedfiles[$filename]['a'] = $key; + } + break; + } + case 'sound': { + if (!isset($pl['opt']['fs'])) { + break; + } + $filename = basename($pl['opt']['fs']); + if (isset($this->embeddedfiles[$filename]['f'])) { + // ... TO BE COMPLETED ... + // /R /C /B /E /CO /CP + $annots .= ' /Sound '.$this->embeddedfiles[$filename]['f'].' 0 R'; + $iconsapp = array('Speaker', 'Mic'); + if (isset($pl['opt']['name']) AND in_array($pl['opt']['name'], $iconsapp)) { + $annots .= ' /Name /'.$pl['opt']['name']; + } else { + $annots .= ' /Name /Speaker'; + } + } + break; + } + case 'movie': { + break; + } + case 'widget': { + $hmode = array('N', 'I', 'O', 'P', 'T'); + if (isset($pl['opt']['h']) AND in_array($pl['opt']['h'], $hmode)) { + $annots .= ' /H /'.$pl['opt']['h']; + } + if (isset($pl['opt']['mk']) AND (is_array($pl['opt']['mk'])) AND !empty($pl['opt']['mk'])) { + $annots .= ' /MK <<'; + if (isset($pl['opt']['mk']['r'])) { + $annots .= ' /R '.$pl['opt']['mk']['r']; + } + if (isset($pl['opt']['mk']['bc']) AND (is_array($pl['opt']['mk']['bc']))) { + $annots .= ' /BC '.TCPDF_COLORS::getColorStringFromArray($pl['opt']['mk']['bc']); + } + if (isset($pl['opt']['mk']['bg']) AND (is_array($pl['opt']['mk']['bg']))) { + $annots .= ' /BG '.TCPDF_COLORS::getColorStringFromArray($pl['opt']['mk']['bg']); + } + if (isset($pl['opt']['mk']['ca'])) { + $annots .= ' /CA '.$pl['opt']['mk']['ca']; + } + if (isset($pl['opt']['mk']['rc'])) { + $annots .= ' /RC '.$pl['opt']['mk']['rc']; + } + if (isset($pl['opt']['mk']['ac'])) { + $annots .= ' /AC '.$pl['opt']['mk']['ac']; + } + if (isset($pl['opt']['mk']['i'])) { + $info = $this->getImageBuffer($pl['opt']['mk']['i']); + if ($info !== false) { + $annots .= ' /I '.$info['n'].' 0 R'; + } + } + if (isset($pl['opt']['mk']['ri'])) { + $info = $this->getImageBuffer($pl['opt']['mk']['ri']); + if ($info !== false) { + $annots .= ' /RI '.$info['n'].' 0 R'; + } + } + if (isset($pl['opt']['mk']['ix'])) { + $info = $this->getImageBuffer($pl['opt']['mk']['ix']); + if ($info !== false) { + $annots .= ' /IX '.$info['n'].' 0 R'; + } + } + if (isset($pl['opt']['mk']['if']) AND (is_array($pl['opt']['mk']['if'])) AND !empty($pl['opt']['mk']['if'])) { + $annots .= ' /IF <<'; + $if_sw = array('A', 'B', 'S', 'N'); + if (isset($pl['opt']['mk']['if']['sw']) AND in_array($pl['opt']['mk']['if']['sw'], $if_sw)) { + $annots .= ' /SW /'.$pl['opt']['mk']['if']['sw']; + } + $if_s = array('A', 'P'); + if (isset($pl['opt']['mk']['if']['s']) AND in_array($pl['opt']['mk']['if']['s'], $if_s)) { + $annots .= ' /S /'.$pl['opt']['mk']['if']['s']; + } + if (isset($pl['opt']['mk']['if']['a']) AND (is_array($pl['opt']['mk']['if']['a'])) AND !empty($pl['opt']['mk']['if']['a'])) { + $annots .= sprintf(' /A [%F %F]', $pl['opt']['mk']['if']['a'][0], $pl['opt']['mk']['if']['a'][1]); + } + if (isset($pl['opt']['mk']['if']['fb']) AND ($pl['opt']['mk']['if']['fb'])) { + $annots .= ' /FB true'; + } + $annots .= '>>'; + } + if (isset($pl['opt']['mk']['tp']) AND ($pl['opt']['mk']['tp'] >= 0) AND ($pl['opt']['mk']['tp'] <= 6)) { + $annots .= ' /TP '.intval($pl['opt']['mk']['tp']); + } + $annots .= '>>'; + } // end MK + // --- Entries for field dictionaries --- + if (isset($this->radiobutton_groups[$n][$pl['txt']])) { + // set parent + $annots .= ' /Parent '.$this->radiobutton_groups[$n][$pl['txt']].' 0 R'; + } + if (isset($pl['opt']['t']) AND is_string($pl['opt']['t'])) { + $annots .= ' /T '.$this->_datastring($pl['opt']['t'], $annot_obj_id); + } + if (isset($pl['opt']['tu']) AND is_string($pl['opt']['tu'])) { + $annots .= ' /TU '.$this->_datastring($pl['opt']['tu'], $annot_obj_id); + } + if (isset($pl['opt']['tm']) AND is_string($pl['opt']['tm'])) { + $annots .= ' /TM '.$this->_datastring($pl['opt']['tm'], $annot_obj_id); + } + if (isset($pl['opt']['ff'])) { + if (is_array($pl['opt']['ff'])) { + // array of bit settings + $flag = 0; + foreach($pl['opt']['ff'] as $val) { + $flag += 1 << ($val - 1); + } + } else { + $flag = intval($pl['opt']['ff']); + } + $annots .= ' /Ff '.$flag; + } + if (isset($pl['opt']['maxlen'])) { + $annots .= ' /MaxLen '.intval($pl['opt']['maxlen']); + } + if (isset($pl['opt']['v'])) { + $annots .= ' /V'; + if (is_array($pl['opt']['v'])) { + foreach ($pl['opt']['v'] AS $optval) { + if (is_float($optval)) { + $optval = sprintf('%F', $optval); + } + $annots .= ' '.$optval; + } + } else { + $annots .= ' '.$this->_textstring($pl['opt']['v'], $annot_obj_id); + } + } + if (isset($pl['opt']['dv'])) { + $annots .= ' /DV'; + if (is_array($pl['opt']['dv'])) { + foreach ($pl['opt']['dv'] AS $optval) { + if (is_float($optval)) { + $optval = sprintf('%F', $optval); + } + $annots .= ' '.$optval; + } + } else { + $annots .= ' '.$this->_textstring($pl['opt']['dv'], $annot_obj_id); + } + } + if (isset($pl['opt']['rv'])) { + $annots .= ' /RV'; + if (is_array($pl['opt']['rv'])) { + foreach ($pl['opt']['rv'] AS $optval) { + if (is_float($optval)) { + $optval = sprintf('%F', $optval); + } + $annots .= ' '.$optval; + } + } else { + $annots .= ' '.$this->_textstring($pl['opt']['rv'], $annot_obj_id); + } + } + if (isset($pl['opt']['a']) AND !empty($pl['opt']['a'])) { + $annots .= ' /A << '.$pl['opt']['a'].' >>'; + } + if (isset($pl['opt']['aa']) AND !empty($pl['opt']['aa'])) { + $annots .= ' /AA << '.$pl['opt']['aa'].' >>'; + } + if (isset($pl['opt']['da']) AND !empty($pl['opt']['da'])) { + $annots .= ' /DA ('.$pl['opt']['da'].')'; + } + if (isset($pl['opt']['q']) AND ($pl['opt']['q'] >= 0) AND ($pl['opt']['q'] <= 2)) { + $annots .= ' /Q '.intval($pl['opt']['q']); + } + if (isset($pl['opt']['opt']) AND (is_array($pl['opt']['opt'])) AND !empty($pl['opt']['opt'])) { + $annots .= ' /Opt ['; + foreach($pl['opt']['opt'] AS $copt) { + if (is_array($copt)) { + $annots .= ' ['.$this->_textstring($copt[0], $annot_obj_id).' '.$this->_textstring($copt[1], $annot_obj_id).']'; + } else { + $annots .= ' '.$this->_textstring($copt, $annot_obj_id); + } + } + $annots .= ']'; + } + if (isset($pl['opt']['ti'])) { + $annots .= ' /TI '.intval($pl['opt']['ti']); + } + if (isset($pl['opt']['i']) AND (is_array($pl['opt']['i'])) AND !empty($pl['opt']['i'])) { + $annots .= ' /I ['; + foreach($pl['opt']['i'] AS $copt) { + $annots .= intval($copt).' '; + } + $annots .= ']'; + } + break; + } + case 'screen': { + break; + } + case 'printermark': { + break; + } + case 'trapnet': { + break; + } + case 'watermark': { + break; + } + case '3d': { + break; + } + default: { + break; + } + } + $annots .= '>>'; + // create new annotation object + $this->_out($this->_getobj($annot_obj_id)."\n".$annots."\n".'endobj'); + if ($formfield AND !isset($this->radiobutton_groups[$n][$pl['txt']])) { + // store reference of form object + $this->form_obj_id[] = $annot_obj_id; + } + } + } + } // end for each page + } + + /** + * Put appearance streams XObject used to define annotation's appearance states. + * @param int $w annotation width + * @param int $h annotation height + * @param string $stream appearance stream + * @return int object ID + * @protected + * @since 4.8.001 (2009-09-09) + */ + protected function _putAPXObject($w=0, $h=0, $stream='') { + $stream = trim($stream); + $out = $this->_getobj()."\n"; + $this->xobjects['AX'.$this->n] = array('n' => $this->n); + $out .= '<<'; + $out .= ' /Type /XObject'; + $out .= ' /Subtype /Form'; + $out .= ' /FormType 1'; + if ($this->compress) { + $stream = gzcompress($stream); + $out .= ' /Filter /FlateDecode'; + } + $rect = sprintf('%F %F', $w, $h); + $out .= ' /BBox [0 0 '.$rect.']'; + $out .= ' /Matrix [1 0 0 1 0 0]'; + $out .= ' /Resources 2 0 R'; + $stream = $this->_getrawstream($stream); + $out .= ' /Length '.strlen($stream); + $out .= ' >>'; + $out .= ' stream'."\n".$stream."\n".'endstream'; + $out .= "\n".'endobj'; + $this->_out($out); + return $this->n; + } + + /** + * Output fonts. + * @author Nicola Asuni + * @protected + */ + protected function _putfonts() { + $nf = $this->n; + foreach ($this->diffs as $diff) { + //Encodings + $this->_newobj(); + $this->_out('<< /Type /Encoding /BaseEncoding /WinAnsiEncoding /Differences ['.$diff.'] >>'."\n".'endobj'); + } + foreach ($this->FontFiles as $file => $info) { + // search and get font file to embedd + $fontfile = TCPDF_FONTS::getFontFullPath($file, $info['fontdir']); + if (!TCPDF_STATIC::empty_string($fontfile)) { + $font = file_get_contents($fontfile); + $compressed = (substr($file, -2) == '.z'); + if ((!$compressed) AND (isset($info['length2']))) { + $header = (ord($font[0]) == 128); + if ($header) { + // strip first binary header + $font = substr($font, 6); + } + if ($header AND (ord($font[$info['length1']]) == 128)) { + // strip second binary header + $font = substr($font, 0, $info['length1']).substr($font, ($info['length1'] + 6)); + } + } elseif ($info['subset'] AND ((!$compressed) OR ($compressed AND function_exists('gzcompress')))) { + if ($compressed) { + // uncompress font + $font = gzuncompress($font); + } + // merge subset characters + $subsetchars = array(); // used chars + foreach ($info['fontkeys'] as $fontkey) { + $fontinfo = $this->getFontBuffer($fontkey); + $subsetchars += $fontinfo['subsetchars']; + } + // rebuild a font subset + $font = TCPDF_FONTS::_getTrueTypeFontSubset($font, $subsetchars); + // calculate new font length + $info['length1'] = strlen($font); + if ($compressed) { + // recompress font + $font = gzcompress($font); + } + } + $this->_newobj(); + $this->FontFiles[$file]['n'] = $this->n; + $stream = $this->_getrawstream($font); + $out = '<< /Length '.strlen($stream); + if ($compressed) { + $out .= ' /Filter /FlateDecode'; + } + $out .= ' /Length1 '.$info['length1']; + if (isset($info['length2'])) { + $out .= ' /Length2 '.$info['length2'].' /Length3 0'; + } + $out .= ' >>'; + $out .= ' stream'."\n".$stream."\n".'endstream'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + foreach ($this->fontkeys as $k) { + //Font objects + $font = $this->getFontBuffer($k); + $type = $font['type']; + $name = $font['name']; + if ($type == 'core') { + // standard core font + $out = $this->_getobj($this->font_obj_ids[$k])."\n"; + $out .= '<annotation_fonts[$k] = $font['i']; + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } elseif (($type == 'Type1') OR ($type == 'TrueType')) { + // additional Type1 or TrueType font + $out = $this->_getobj($this->font_obj_ids[$k])."\n"; + $out .= '<n + 1).' 0 R'; + $out .= ' /FontDescriptor '.($this->n + 2).' 0 R'; + if ($font['enc']) { + if (isset($font['diff'])) { + $out .= ' /Encoding '.($nf + $font['diff']).' 0 R'; + } else { + $out .= ' /Encoding /WinAnsiEncoding'; + } + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + // Widths + $this->_newobj(); + $s = '['; + for ($i = 32; $i < 256; ++$i) { + if (isset($font['cw'][$i])) { + $s .= $font['cw'][$i].' '; + } else { + $s .= $font['dw'].' '; + } + } + $s .= ']'; + $s .= "\n".'endobj'; + $this->_out($s); + //Descriptor + $this->_newobj(); + $s = '< $fdv) { + if (is_float($fdv)) { + $fdv = sprintf('%F', $fdv); + } + $s .= ' /'.$fdk.' '.$fdv.''; + } + if (!TCPDF_STATIC::empty_string($font['file'])) { + $s .= ' /FontFile'.($type == 'Type1' ? '' : '2').' '.$this->FontFiles[$font['file']]['n'].' 0 R'; + } + $s .= '>>'; + $s .= "\n".'endobj'; + $this->_out($s); + } else { + // additional types + $mtd = '_put'.strtolower($type); + if (!method_exists($this, $mtd)) { + $this->Error('Unsupported font type: '.$type); + } + $this->$mtd($font); + } + } + } + + /** + * Adds unicode fonts.
        + * Based on PDF Reference 1.3 (section 5) + * @param array $font font data + * @protected + * @author Nicola Asuni + * @since 1.52.0.TC005 (2005-01-05) + */ + protected function _puttruetypeunicode($font) { + $fontname = ''; + if ($font['subset']) { + // change name for font subsetting + $subtag = sprintf('%06u', $font['i']); + $subtag = strtr($subtag, '0123456789', 'ABCDEFGHIJ'); + $fontname .= $subtag.'+'; + } + $fontname .= $font['name']; + // Type0 Font + // A composite font composed of other fonts, organized hierarchically + $out = $this->_getobj($this->font_obj_ids[$font['fontkey']])."\n"; + $out .= '<< /Type /Font'; + $out .= ' /Subtype /Type0'; + $out .= ' /BaseFont /'.$fontname; + $out .= ' /Name /F'.$font['i']; + $out .= ' /Encoding /'.$font['enc']; + $out .= ' /ToUnicode '.($this->n + 1).' 0 R'; + $out .= ' /DescendantFonts ['.($this->n + 2).' 0 R]'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + // ToUnicode map for Identity-H + $stream = TCPDF_FONT_DATA::$uni_identity_h; + // ToUnicode Object + $this->_newobj(); + $stream = ($this->compress) ? gzcompress($stream) : $stream; + $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; + $stream = $this->_getrawstream($stream); + $this->_out('<<'.$filter.'/Length '.strlen($stream).'>> stream'."\n".$stream."\n".'endstream'."\n".'endobj'); + // CIDFontType2 + // A CIDFont whose glyph descriptions are based on TrueType font technology + $oid = $this->_newobj(); + $out = '<< /Type /Font'; + $out .= ' /Subtype /CIDFontType2'; + $out .= ' /BaseFont /'.$fontname; + // A dictionary containing entries that define the character collection of the CIDFont. + $cidinfo = '/Registry '.$this->_datastring($font['cidinfo']['Registry'], $oid); + $cidinfo .= ' /Ordering '.$this->_datastring($font['cidinfo']['Ordering'], $oid); + $cidinfo .= ' /Supplement '.$font['cidinfo']['Supplement']; + $out .= ' /CIDSystemInfo << '.$cidinfo.' >>'; + $out .= ' /FontDescriptor '.($this->n + 1).' 0 R'; + $out .= ' /DW '.$font['dw']; // default width + $out .= "\n".TCPDF_FONTS::_putfontwidths($font, 0); + if (isset($font['ctg']) AND (!TCPDF_STATIC::empty_string($font['ctg']))) { + $out .= "\n".'/CIDToGIDMap '.($this->n + 2).' 0 R'; + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + // Font descriptor + // A font descriptor describing the CIDFont default metrics other than its glyph widths + $this->_newobj(); + $out = '<< /Type /FontDescriptor'; + $out .= ' /FontName /'.$fontname; + foreach ($font['desc'] as $key => $value) { + if (is_float($value)) { + $value = sprintf('%F', $value); + } + $out .= ' /'.$key.' '.$value; + } + $fontdir = false; + if (!TCPDF_STATIC::empty_string($font['file'])) { + // A stream containing a TrueType font + $out .= ' /FontFile2 '.$this->FontFiles[$font['file']]['n'].' 0 R'; + $fontdir = $this->FontFiles[$font['file']]['fontdir']; + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + if (isset($font['ctg']) AND (!TCPDF_STATIC::empty_string($font['ctg']))) { + $this->_newobj(); + // Embed CIDToGIDMap + // A specification of the mapping from CIDs to glyph indices + // search and get CTG font file to embedd + $ctgfile = strtolower($font['ctg']); + // search and get ctg font file to embedd + $fontfile = TCPDF_FONTS::getFontFullPath($ctgfile, $fontdir); + if (TCPDF_STATIC::empty_string($fontfile)) { + $this->Error('Font file not found: '.$ctgfile); + } + $stream = $this->_getrawstream(file_get_contents($fontfile)); + $out = '<< /Length '.strlen($stream).''; + if (substr($fontfile, -2) == '.z') { // check file extension + // Decompresses data encoded using the public-domain + // zlib/deflate compression method, reproducing the + // original text or binary data + $out .= ' /Filter /FlateDecode'; + } + $out .= ' >>'; + $out .= ' stream'."\n".$stream."\n".'endstream'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + + /** + * Output CID-0 fonts. + * A Type 0 CIDFont contains glyph descriptions based on the Adobe Type 1 font format + * @param array $font font data + * @protected + * @author Andrew Whitehead, Nicola Asuni, Yukihiro Nakadaira + * @since 3.2.000 (2008-06-23) + */ + protected function _putcidfont0($font) { + $cidoffset = 0; + if (!isset($font['cw'][1])) { + $cidoffset = 31; + } + if (isset($font['cidinfo']['uni2cid'])) { + // convert unicode to cid. + $uni2cid = $font['cidinfo']['uni2cid']; + $cw = array(); + foreach ($font['cw'] as $uni => $width) { + if (isset($uni2cid[$uni])) { + $cw[($uni2cid[$uni] + $cidoffset)] = $width; + } elseif ($uni < 256) { + $cw[$uni] = $width; + } // else unknown character + } + $font = array_merge($font, array('cw' => $cw)); + } + $name = $font['name']; + $enc = $font['enc']; + if ($enc) { + $longname = $name.'-'.$enc; + } else { + $longname = $name; + } + $out = $this->_getobj($this->font_obj_ids[$font['fontkey']])."\n"; + $out .= '<n + 1).' 0 R]'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + $oid = $this->_newobj(); + $out = '<_datastring($font['cidinfo']['Registry'], $oid); + $cidinfo .= ' /Ordering '.$this->_datastring($font['cidinfo']['Ordering'], $oid); + $cidinfo .= ' /Supplement '.$font['cidinfo']['Supplement']; + $out .= ' /CIDSystemInfo <<'.$cidinfo.'>>'; + $out .= ' /FontDescriptor '.($this->n + 1).' 0 R'; + $out .= ' /DW '.$font['dw']; + $out .= "\n".TCPDF_FONTS::_putfontwidths($font, $cidoffset); + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + $this->_newobj(); + $s = '< $v) { + if ($k != 'Style') { + if (is_float($v)) { + $v = sprintf('%F', $v); + } + $s .= ' /'.$k.' '.$v.''; + } + } + $s .= '>>'; + $s .= "\n".'endobj'; + $this->_out($s); + } + + /** + * Output images. + * @protected + */ + protected function _putimages() { + $filter = ($this->compress) ? '/Filter /FlateDecode ' : ''; + foreach ($this->imagekeys as $file) { + $info = $this->getImageBuffer($file); + // set object for alternate images array + $altoid = null; + if ((!$this->pdfa_mode) AND isset($info['altimgs']) AND !empty($info['altimgs'])) { + $altoid = $this->_newobj(); + $out = '['; + foreach ($info['altimgs'] as $altimage) { + if (isset($this->xobjects['I'.$altimage[0]]['n'])) { + $out .= ' << /Image '.$this->xobjects['I'.$altimage[0]]['n'].' 0 R'; + $out .= ' /DefaultForPrinting'; + if ($altimage[1] === true) { + $out .= ' true'; + } else { + $out .= ' false'; + } + $out .= ' >>'; + } + } + $out .= ' ]'; + $out .= "\n".'endobj'; + $this->_out($out); + } + // set image object + $oid = $this->_newobj(); + $this->xobjects['I'.$info['i']] = array('n' => $oid); + $this->setImageSubBuffer($file, 'n', $this->n); + $out = '<n - 1).' 0 R'; + } + // set color space + $icc = false; + if (isset($info['icc']) AND ($info['icc'] !== false)) { + // ICC Colour Space + $icc = true; + $out .= ' /ColorSpace [/ICCBased '.($this->n + 1).' 0 R]'; + } elseif ($info['cs'] == 'Indexed') { + // Indexed Colour Space + $out .= ' /ColorSpace [/Indexed /DeviceRGB '.((strlen($info['pal']) / 3) - 1).' '.($this->n + 1).' 0 R]'; + } else { + // Device Colour Space + $out .= ' /ColorSpace /'.$info['cs']; + } + if ($info['cs'] == 'DeviceCMYK') { + $out .= ' /Decode [1 0 1 0 1 0 1 0]'; + } + $out .= ' /BitsPerComponent '.$info['bpc']; + if ($altoid > 0) { + // reference to alternate images dictionary + $out .= ' /Alternates '.$altoid.' 0 R'; + } + if (isset($info['exurl']) AND !empty($info['exurl'])) { + // external stream + $out .= ' /Length 0'; + $out .= ' /F << /FS /URL /F '.$this->_datastring($info['exurl'], $oid).' >>'; + if (isset($info['f'])) { + $out .= ' /FFilter /'.$info['f']; + } + $out .= ' >>'; + $out .= ' stream'."\n".'endstream'; + } else { + if (isset($info['f'])) { + $out .= ' /Filter /'.$info['f']; + } + if (isset($info['parms'])) { + $out .= ' '.$info['parms']; + } + if (isset($info['trns']) AND is_array($info['trns'])) { + $trns = ''; + $count_info = count($info['trns']); + if ($info['cs'] == 'Indexed') { + $maxval =(pow(2, $info['bpc']) - 1); + for ($i = 0; $i < $count_info; ++$i) { + if (($info['trns'][$i] != 0) AND ($info['trns'][$i] != $maxval)) { + // this is not a binary type mask @TODO: create a SMask + $trns = ''; + break; + } elseif (empty($trns) AND ($info['trns'][$i] == 0)) { + // store the first fully transparent value + $trns .= $i.' '.$i.' '; + } + } + } else { + // grayscale or RGB + for ($i = 0; $i < $count_info; ++$i) { + if ($info['trns'][$i] == 0) { + $trns .= $info['trns'][$i].' '.$info['trns'][$i].' '; + } + } + } + // Colour Key Masking + if (!empty($trns)) { + $out .= ' /Mask ['.$trns.']'; + } + } + $stream = $this->_getrawstream($info['data']); + $out .= ' /Length '.strlen($stream).' >>'; + $out .= ' stream'."\n".$stream."\n".'endstream'; + } + $out .= "\n".'endobj'; + $this->_out($out); + if ($icc) { + // ICC colour profile + $this->_newobj(); + $icc = ($this->compress) ? gzcompress($info['icc']) : $info['icc']; + $icc = $this->_getrawstream($icc); + $this->_out('<> stream'."\n".$icc."\n".'endstream'."\n".'endobj'); + } elseif ($info['cs'] == 'Indexed') { + // colour palette + $this->_newobj(); + $pal = ($this->compress) ? gzcompress($info['pal']) : $info['pal']; + $pal = $this->_getrawstream($pal); + $this->_out('<<'.$filter.'/Length '.strlen($pal).'>> stream'."\n".$pal."\n".'endstream'."\n".'endobj'); + } + } + } + + /** + * Output Form XObjects Templates. + * @author Nicola Asuni + * @since 5.8.017 (2010-08-24) + * @protected + * @see startTemplate(), endTemplate(), printTemplate() + */ + protected function _putxobjects() { + foreach ($this->xobjects as $key => $data) { + if (isset($data['outdata'])) { + $stream = str_replace($this->epsmarker, '', trim($data['outdata'])); + $out = $this->_getobj($data['n'])."\n"; + $out .= '<<'; + $out .= ' /Type /XObject'; + $out .= ' /Subtype /Form'; + $out .= ' /FormType 1'; + if ($this->compress) { + $stream = gzcompress($stream); + $out .= ' /Filter /FlateDecode'; + } + $out .= sprintf(' /BBox [%F %F %F %F]', ($data['x'] * $this->k), (-$data['y'] * $this->k), (($data['w'] + $data['x']) * $this->k), (($data['h'] - $data['y']) * $this->k)); + $out .= ' /Matrix [1 0 0 1 0 0]'; + $out .= ' /Resources <<'; + $out .= ' /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'; + if (!$this->pdfa_mode || $this->pdfa_version >= 2) { + // transparency + if (isset($data['extgstates']) AND !empty($data['extgstates'])) { + $out .= ' /ExtGState <<'; + foreach ($data['extgstates'] as $k => $extgstate) { + if (isset($this->extgstates[$k]['name'])) { + $out .= ' /'.$this->extgstates[$k]['name']; + } else { + $out .= ' /GS'.$k; + } + $out .= ' '.$this->extgstates[$k]['n'].' 0 R'; + } + $out .= ' >>'; + } + if (isset($data['gradients']) AND !empty($data['gradients'])) { + $gp = ''; + $gs = ''; + foreach ($data['gradients'] as $id => $grad) { + // gradient patterns + $gp .= ' /p'.$id.' '.$this->gradients[$id]['pattern'].' 0 R'; + // gradient shadings + $gs .= ' /Sh'.$id.' '.$this->gradients[$id]['id'].' 0 R'; + } + $out .= ' /Pattern <<'.$gp.' >>'; + $out .= ' /Shading <<'.$gs.' >>'; + } + } + // spot colors + if (isset($data['spot_colors']) AND !empty($data['spot_colors'])) { + $out .= ' /ColorSpace <<'; + foreach ($data['spot_colors'] as $name => $color) { + $out .= ' /CS'.$color['i'].' '.$this->spot_colors[$name]['n'].' 0 R'; + } + $out .= ' >>'; + } + // fonts + if (!empty($data['fonts'])) { + $out .= ' /Font <<'; + foreach ($data['fonts'] as $fontkey => $fontid) { + $out .= ' /F'.$fontid.' '.$this->font_obj_ids[$fontkey].' 0 R'; + } + $out .= ' >>'; + } + // images or nested xobjects + if (!empty($data['images']) OR !empty($data['xobjects'])) { + $out .= ' /XObject <<'; + foreach ($data['images'] as $imgid) { + $out .= ' /I'.$imgid.' '.$this->xobjects['I'.$imgid]['n'].' 0 R'; + } + foreach ($data['xobjects'] as $sub_id => $sub_objid) { + $out .= ' /'.$sub_id.' '.$sub_objid['n'].' 0 R'; + } + $out .= ' >>'; + } + $out .= ' >>'; //end resources + if (isset($data['group']) AND ($data['group'] !== false)) { + // set transparency group + $out .= ' /Group << /Type /Group /S /Transparency'; + if (is_array($data['group'])) { + if (isset($data['group']['CS']) AND !empty($data['group']['CS'])) { + $out .= ' /CS /'.$data['group']['CS']; + } + if (isset($data['group']['I'])) { + $out .= ' /I /'.($data['group']['I']===true?'true':'false'); + } + if (isset($data['group']['K'])) { + $out .= ' /K /'.($data['group']['K']===true?'true':'false'); + } + } + $out .= ' >>'; + } + $stream = $this->_getrawstream($stream, $data['n']); + $out .= ' /Length '.strlen($stream); + $out .= ' >>'; + $out .= ' stream'."\n".$stream."\n".'endstream'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + } + + /** + * Output Spot Colors Resources. + * @protected + * @since 4.0.024 (2008-09-12) + */ + protected function _putspotcolors() { + foreach ($this->spot_colors as $name => $color) { + $this->_newobj(); + $this->spot_colors[$name]['n'] = $this->n; + $out = '[/Separation /'.str_replace(' ', '#20', $name); + $out .= ' /DeviceCMYK <<'; + $out .= ' /Range [0 1 0 1 0 1 0 1] /C0 [0 0 0 0]'; + $out .= ' '.sprintf('/C1 [%F %F %F %F] ', ($color['C'] / 100), ($color['M'] / 100), ($color['Y'] / 100), ($color['K'] / 100)); + $out .= ' /FunctionType 2 /Domain [0 1] /N 1>>]'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + + /** + * Return XObjects Dictionary. + * @return string XObjects dictionary + * @protected + * @since 5.8.014 (2010-08-23) + */ + protected function _getxobjectdict() { + $out = ''; + foreach ($this->xobjects as $id => $objid) { + $out .= ' /'.$id.' '.$objid['n'].' 0 R'; + } + return $out; + } + + /** + * Output Resources Dictionary. + * @protected + */ + protected function _putresourcedict() { + $out = $this->_getobj(2)."\n"; + $out .= '<< /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'; + $out .= ' /Font <<'; + foreach ($this->fontkeys as $fontkey) { + $font = $this->getFontBuffer($fontkey); + $out .= ' /F'.$font['i'].' '.$font['n'].' 0 R'; + } + $out .= ' >>'; + $out .= ' /XObject <<'; + $out .= $this->_getxobjectdict(); + $out .= ' >>'; + // layers + if (!empty($this->pdflayers)) { + $out .= ' /Properties <<'; + foreach ($this->pdflayers as $layer) { + $out .= ' /'.$layer['layer'].' '.$layer['objid'].' 0 R'; + } + $out .= ' >>'; + } + if (!$this->pdfa_mode || $this->pdfa_version >= 2) { + // transparency + if (isset($this->extgstates) AND !empty($this->extgstates)) { + $out .= ' /ExtGState <<'; + foreach ($this->extgstates as $k => $extgstate) { + if (isset($extgstate['name'])) { + $out .= ' /'.$extgstate['name']; + } else { + $out .= ' /GS'.$k; + } + $out .= ' '.$extgstate['n'].' 0 R'; + } + $out .= ' >>'; + } + if (isset($this->gradients) AND !empty($this->gradients)) { + $gp = ''; + $gs = ''; + foreach ($this->gradients as $id => $grad) { + // gradient patterns + $gp .= ' /p'.$id.' '.$grad['pattern'].' 0 R'; + // gradient shadings + $gs .= ' /Sh'.$id.' '.$grad['id'].' 0 R'; + } + $out .= ' /Pattern <<'.$gp.' >>'; + $out .= ' /Shading <<'.$gs.' >>'; + } + } + // spot colors + if (isset($this->spot_colors) AND !empty($this->spot_colors)) { + $out .= ' /ColorSpace <<'; + foreach ($this->spot_colors as $color) { + $out .= ' /CS'.$color['i'].' '.$color['n'].' 0 R'; + } + $out .= ' >>'; + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + + /** + * Output Resources. + * @protected + */ + protected function _putresources() { + $this->_putextgstates(); + $this->_putocg(); + $this->_putfonts(); + $this->_putimages(); + $this->_putspotcolors(); + $this->_putshaders(); + $this->_putxobjects(); + $this->_putresourcedict(); + $this->_putdests(); + $this->_putEmbeddedFiles(); + $this->_putannotsobjs(); + $this->_putjavascript(); + $this->_putbookmarks(); + $this->_putencryption(); + } + + /** + * Adds some Metadata information (Document Information Dictionary) + * (see Chapter 14.3.3 Document Information Dictionary of PDF32000_2008.pdf Reference) + * @return int object id + * @protected + */ + protected function _putinfo() { + $oid = $this->_newobj(); + $out = '<<'; + // store current isunicode value + $prev_isunicode = $this->isunicode; + if ($this->docinfounicode) { + $this->isunicode = true; + } + if (!TCPDF_STATIC::empty_string($this->title)) { + // The document's title. + $out .= ' /Title '.$this->_textstring($this->title, $oid); + } + if (!TCPDF_STATIC::empty_string($this->author)) { + // The name of the person who created the document. + $out .= ' /Author '.$this->_textstring($this->author, $oid); + } + if (!TCPDF_STATIC::empty_string($this->subject)) { + // The subject of the document. + $out .= ' /Subject '.$this->_textstring($this->subject, $oid); + } + if (!TCPDF_STATIC::empty_string($this->keywords)) { + // Keywords associated with the document. + $out .= ' /Keywords '.$this->_textstring($this->keywords, $oid); + } + if (!TCPDF_STATIC::empty_string($this->creator)) { + // If the document was converted to PDF from another format, the name of the conforming product that created the original document from which it was converted. + $out .= ' /Creator '.$this->_textstring($this->creator, $oid); + } + // restore previous isunicode value + $this->isunicode = $prev_isunicode; + // default producer + $out .= ' /Producer '.$this->_textstring(TCPDF_STATIC::getTCPDFProducer(), $oid); + // The date and time the document was created, in human-readable form + $out .= ' /CreationDate '.$this->_datestring(0, $this->doc_creation_timestamp); + // The date and time the document was most recently modified, in human-readable form + $out .= ' /ModDate '.$this->_datestring(0, $this->doc_modification_timestamp); + // A name object indicating whether the document has been modified to include trapping information + $out .= ' /Trapped /False'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + return $oid; + } + + /** + * Set additional XMP data to be added on the default XMP data just before the end of "x:xmpmeta" tag. + * IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method! + * @param string $xmp Custom XMP data. + * @since 5.9.128 (2011-10-06) + * @public + */ + public function setExtraXMP($xmp) { + $this->custom_xmp = $xmp; + } + + /** + * Set additional XMP data to be added on the default XMP data just before the end of "rdf:RDF" tag. + * IMPORTANT: This data is added as-is without controls, so you have to validate your data before using this method! + * @param string $xmp Custom XMP RDF data. + * @since 6.3.0 (2019-09-19) + * @public + */ + public function setExtraXMPRDF($xmp) { + $this->custom_xmp_rdf = $xmp; + } + + /** + * Put XMP data object and return ID. + * @return int The object ID. + * @since 5.9.121 (2011-09-28) + * @protected + */ + protected function _putXMP() { + $oid = $this->_newobj(); + // store current isunicode value + $prev_isunicode = $this->isunicode; + $this->isunicode = true; + $prev_encrypted = $this->encrypted; + $this->encrypted = false; + // set XMP data + $xmp = 'isunicode).'" id="W5M0MpCehiHzreSzNTczkc9d"?>'."\n"; + $xmp .= ''."\n"; + $xmp .= "\t".''."\n"; + $xmp .= "\t\t".''."\n"; + $xmp .= "\t\t\t".'application/pdf'."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''.TCPDF_STATIC::_escapeXML($this->title).''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''.TCPDF_STATIC::_escapeXML($this->author).''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''.TCPDF_STATIC::_escapeXML($this->subject).''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''.TCPDF_STATIC::_escapeXML($this->keywords).''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t".''."\n"; + // convert doc creation date format + $dcdate = TCPDF_STATIC::getFormattedDate($this->doc_creation_timestamp); + $doccreationdate = substr($dcdate, 0, 4).'-'.substr($dcdate, 4, 2).'-'.substr($dcdate, 6, 2); + $doccreationdate .= 'T'.substr($dcdate, 8, 2).':'.substr($dcdate, 10, 2).':'.substr($dcdate, 12, 2); + $doccreationdate .= substr($dcdate, 14, 3).':'.substr($dcdate, 18, 2); + $doccreationdate = TCPDF_STATIC::_escapeXML($doccreationdate); + // convert doc modification date format + $dmdate = TCPDF_STATIC::getFormattedDate($this->doc_modification_timestamp); + $docmoddate = substr($dmdate, 0, 4).'-'.substr($dmdate, 4, 2).'-'.substr($dmdate, 6, 2); + $docmoddate .= 'T'.substr($dmdate, 8, 2).':'.substr($dmdate, 10, 2).':'.substr($dmdate, 12, 2); + $docmoddate .= substr($dmdate, 14, 3).':'.substr($dmdate, 18, 2); + $docmoddate = TCPDF_STATIC::_escapeXML($docmoddate); + $xmp .= "\t\t".''."\n"; + $xmp .= "\t\t\t".''.$doccreationdate.''."\n"; + $xmp .= "\t\t\t".''.$this->creator.''."\n"; + $xmp .= "\t\t\t".''.$docmoddate.''."\n"; + $xmp .= "\t\t\t".''.$doccreationdate.''."\n"; + $xmp .= "\t\t".''."\n"; + $xmp .= "\t\t".''."\n"; + $xmp .= "\t\t\t".''.TCPDF_STATIC::_escapeXML($this->keywords).''."\n"; + $xmp .= "\t\t\t".''.TCPDF_STATIC::_escapeXML(TCPDF_STATIC::getTCPDFProducer()).''."\n"; + $xmp .= "\t\t".''."\n"; + $xmp .= "\t\t".''."\n"; + $uuid = 'uuid:'.substr($this->file_id, 0, 8).'-'.substr($this->file_id, 8, 4).'-'.substr($this->file_id, 12, 4).'-'.substr($this->file_id, 16, 4).'-'.substr($this->file_id, 20, 12); + $xmp .= "\t\t\t".''.$uuid.''."\n"; + $xmp .= "\t\t\t".''.$uuid.''."\n"; + $xmp .= "\t\t".''."\n"; + if ($this->pdfa_mode) { + $xmp .= "\t\t".''."\n"; + $xmp .= "\t\t\t".''.$this->pdfa_version.''."\n"; + $xmp .= "\t\t\t".'B'."\n"; + $xmp .= "\t\t".''."\n"; + } + // XMP extension schemas + $xmp .= "\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t".'http://ns.adobe.com/pdf/1.3/'."\n"; + $xmp .= "\t\t\t\t\t\t".'pdf'."\n"; + $xmp .= "\t\t\t\t\t\t".'Adobe PDF Schema'."\n"; + $xmp .= "\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'internal'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'Adobe PDF Schema'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'InstanceID'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'URI'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t".'http://ns.adobe.com/xap/1.0/mm/'."\n"; + $xmp .= "\t\t\t\t\t\t".'xmpMM'."\n"; + $xmp .= "\t\t\t\t\t\t".'XMP Media Management Schema'."\n"; + $xmp .= "\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'internal'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'UUID based identifier for specific incarnation of a document'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'InstanceID'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'URI'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t".'http://www.aiim.org/pdfa/ns/id/'."\n"; + $xmp .= "\t\t\t\t\t\t".'pdfaid'."\n"; + $xmp .= "\t\t\t\t\t\t".'PDF/A ID Schema'."\n"; + $xmp .= "\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'internal'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'Part of PDF/A standard'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'part'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'Integer'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'internal'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'Amendment of PDF/A standard'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'amd'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'Text'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'internal'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'Conformance level of PDF/A standard'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'conformance'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t\t".'Text'."\n"; + $xmp .= "\t\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t\t".''."\n"; + $xmp .= "\t\t\t\t".''."\n"; + $xmp .= "\t\t\t".''."\n"; + $xmp .= "\t\t".''."\n"; + $xmp .= $this->custom_xmp_rdf; + $xmp .= "\t".''."\n"; + $xmp .= $this->custom_xmp; + $xmp .= ''."\n"; + $xmp .= ''; + $out = '<< /Type /Metadata /Subtype /XML /Length '.strlen($xmp).' >> stream'."\n".$xmp."\n".'endstream'."\n".'endobj'; + // restore previous isunicode value + $this->isunicode = $prev_isunicode; + $this->encrypted = $prev_encrypted; + $this->_out($out); + return $oid; + } + + /** + * Output Catalog. + * @return int object id + * @protected + */ + protected function _putcatalog() { + // put XMP + $xmpobj = $this->_putXMP(); + // if required, add standard sRGB ICC colour profile + if ($this->pdfa_mode OR $this->force_srgb) { + $iccobj = $this->_newobj(); + $icc = file_get_contents(dirname(__FILE__).'/include/sRGB.icc'); + $filter = ''; + if ($this->compress) { + $filter = ' /Filter /FlateDecode'; + $icc = gzcompress($icc); + } + $icc = $this->_getrawstream($icc); + $this->_out('<> stream'."\n".$icc."\n".'endstream'."\n".'endobj'); + } + // start catalog + $oid = $this->_newobj(); + $out = '<< /Type /Catalog'; + $out .= ' /Version /'.$this->PDFVersion; + //$out .= ' /Extensions <<>>'; + $out .= ' /Pages 1 0 R'; + //$out .= ' /PageLabels ' //...; + $out .= ' /Names <<'; + if ((!$this->pdfa_mode) AND !empty($this->n_js)) { + $out .= ' /JavaScript '.$this->n_js; + } + if (!empty($this->efnames)) { + $out .= ' /EmbeddedFiles <efnames AS $fn => $fref) { + $out .= ' '.$this->_datastring($fn).' '.$fref; + } + $out .= ' ]>>'; + } + $out .= ' >>'; + if (!empty($this->dests)) { + $out .= ' /Dests '.($this->n_dests).' 0 R'; + } + $out .= $this->_putviewerpreferences(); + if (isset($this->LayoutMode) AND (!TCPDF_STATIC::empty_string($this->LayoutMode))) { + $out .= ' /PageLayout /'.$this->LayoutMode; + } + if (isset($this->PageMode) AND (!TCPDF_STATIC::empty_string($this->PageMode))) { + $out .= ' /PageMode /'.$this->PageMode; + } + if (count($this->outlines) > 0) { + $out .= ' /Outlines '.$this->OutlineRoot.' 0 R'; + $out .= ' /PageMode /UseOutlines'; + } + //$out .= ' /Threads []'; + if ($this->ZoomMode == 'fullpage') { + $out .= ' /OpenAction ['.$this->page_obj_id[1].' 0 R /Fit]'; + } elseif ($this->ZoomMode == 'fullwidth') { + $out .= ' /OpenAction ['.$this->page_obj_id[1].' 0 R /FitH null]'; + } elseif ($this->ZoomMode == 'real') { + $out .= ' /OpenAction ['.$this->page_obj_id[1].' 0 R /XYZ null null 1]'; + } elseif (!is_string($this->ZoomMode)) { + $out .= sprintf(' /OpenAction ['.$this->page_obj_id[1].' 0 R /XYZ null null %F]', ($this->ZoomMode / 100)); + } + //$out .= ' /AA <<>>'; + //$out .= ' /URI <<>>'; + $out .= ' /Metadata '.$xmpobj.' 0 R'; + //$out .= ' /StructTreeRoot <<>>'; + //$out .= ' /MarkInfo <<>>'; + if (isset($this->l['a_meta_language'])) { + $out .= ' /Lang '.$this->_textstring($this->l['a_meta_language'], $oid); + } + //$out .= ' /SpiderInfo <<>>'; + // set OutputIntent to sRGB IEC61966-2.1 if required + if ($this->pdfa_mode OR $this->force_srgb) { + $out .= ' /OutputIntents [<<'; + $out .= ' /Type /OutputIntent'; + $out .= ' /S /GTS_PDFA1'; + $out .= ' /OutputCondition '.$this->_textstring('sRGB IEC61966-2.1', $oid); + $out .= ' /OutputConditionIdentifier '.$this->_textstring('sRGB IEC61966-2.1', $oid); + $out .= ' /RegistryName '.$this->_textstring('http://www.color.org', $oid); + $out .= ' /Info '.$this->_textstring('sRGB IEC61966-2.1', $oid); + $out .= ' /DestOutputProfile '.$iccobj.' 0 R'; + $out .= ' >>]'; + } + //$out .= ' /PieceInfo <<>>'; + if (!empty($this->pdflayers)) { + $lyrobjs = ''; + $lyrobjs_off = ''; + $lyrobjs_lock = ''; + foreach ($this->pdflayers as $layer) { + $layer_obj_ref = ' '.$layer['objid'].' 0 R'; + $lyrobjs .= $layer_obj_ref; + if ($layer['view'] === false) { + $lyrobjs_off .= $layer_obj_ref; + } + if ($layer['lock']) { + $lyrobjs_lock .= $layer_obj_ref; + } + } + $out .= ' /OCProperties << /OCGs ['.$lyrobjs.']'; + $out .= ' /D <<'; + $out .= ' /Name '.$this->_textstring('Layers', $oid); + $out .= ' /Creator '.$this->_textstring('TCPDF', $oid); + $out .= ' /BaseState /ON'; + $out .= ' /OFF ['.$lyrobjs_off.']'; + $out .= ' /Locked ['.$lyrobjs_lock.']'; + $out .= ' /Intent /View'; + $out .= ' /AS ['; + $out .= ' << /Event /Print /OCGs ['.$lyrobjs.'] /Category [/Print] >>'; + $out .= ' << /Event /View /OCGs ['.$lyrobjs.'] /Category [/View] >>'; + $out .= ' ]'; + $out .= ' /Order ['.$lyrobjs.']'; + $out .= ' /ListMode /AllPages'; + //$out .= ' /RBGroups ['..']'; + //$out .= ' /Locked ['..']'; + $out .= ' >>'; + $out .= ' >>'; + } + // AcroForm + if (!empty($this->form_obj_id) + OR ($this->sign AND isset($this->signature_data['cert_type'])) + OR !empty($this->empty_signature_appearance)) { + $out .= ' /AcroForm <<'; + $objrefs = ''; + if ($this->sign AND isset($this->signature_data['cert_type'])) { + // set reference for signature object + $objrefs .= $this->sig_obj_id.' 0 R'; + } + if (!empty($this->empty_signature_appearance)) { + foreach ($this->empty_signature_appearance as $esa) { + // set reference for empty signature objects + $objrefs .= ' '.$esa['objid'].' 0 R'; + } + } + if (!empty($this->form_obj_id)) { + foreach($this->form_obj_id as $objid) { + $objrefs .= ' '.$objid.' 0 R'; + } + } + $out .= ' /Fields ['.$objrefs.']'; + // It's better to turn off this value and set the appearance stream for each annotation (/AP) to avoid conflicts with signature fields. + if (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A')) { + $out .= ' /NeedAppearances false'; + } + if ($this->sign AND isset($this->signature_data['cert_type'])) { + if ($this->signature_data['cert_type'] > 0) { + $out .= ' /SigFlags 3'; + } else { + $out .= ' /SigFlags 1'; + } + } + //$out .= ' /CO '; + if (isset($this->annotation_fonts) AND !empty($this->annotation_fonts)) { + $out .= ' /DR <<'; + $out .= ' /Font <<'; + foreach ($this->annotation_fonts as $fontkey => $fontid) { + $out .= ' /F'.$fontid.' '.$this->font_obj_ids[$fontkey].' 0 R'; + } + $out .= ' >> >>'; + } + $font = $this->getFontBuffer('helvetica'); + $out .= ' /DA (/F'.$font['i'].' 0 Tf 0 g)'; + $out .= ' /Q '.(($this->rtl)?'2':'0'); + //$out .= ' /XFA '; + $out .= ' >>'; + // signatures + if ($this->sign AND isset($this->signature_data['cert_type']) + AND (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A'))) { + if ($this->signature_data['cert_type'] > 0) { + $out .= ' /Perms << /DocMDP '.($this->sig_obj_id + 1).' 0 R >>'; + } else { + $out .= ' /Perms << /UR3 '.($this->sig_obj_id + 1).' 0 R >>'; + } + } + } + //$out .= ' /Legal <<>>'; + //$out .= ' /Requirements []'; + //$out .= ' /Collection <<>>'; + //$out .= ' /NeedsRendering true'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + return $oid; + } + + /** + * Output viewer preferences. + * @return string for viewer preferences + * @author Nicola asuni + * @since 3.1.000 (2008-06-09) + * @protected + */ + protected function _putviewerpreferences() { + $vp = $this->viewer_preferences; + $out = ' /ViewerPreferences <<'; + if ($this->rtl) { + $out .= ' /Direction /R2L'; + } else { + $out .= ' /Direction /L2R'; + } + if (isset($vp['HideToolbar']) AND ($vp['HideToolbar'])) { + $out .= ' /HideToolbar true'; + } + if (isset($vp['HideMenubar']) AND ($vp['HideMenubar'])) { + $out .= ' /HideMenubar true'; + } + if (isset($vp['HideWindowUI']) AND ($vp['HideWindowUI'])) { + $out .= ' /HideWindowUI true'; + } + if (isset($vp['FitWindow']) AND ($vp['FitWindow'])) { + $out .= ' /FitWindow true'; + } + if (isset($vp['CenterWindow']) AND ($vp['CenterWindow'])) { + $out .= ' /CenterWindow true'; + } + if (isset($vp['DisplayDocTitle']) AND ($vp['DisplayDocTitle'])) { + $out .= ' /DisplayDocTitle true'; + } + if (isset($vp['NonFullScreenPageMode'])) { + $out .= ' /NonFullScreenPageMode /'.$vp['NonFullScreenPageMode']; + } + if (isset($vp['ViewArea'])) { + $out .= ' /ViewArea /'.$vp['ViewArea']; + } + if (isset($vp['ViewClip'])) { + $out .= ' /ViewClip /'.$vp['ViewClip']; + } + if (isset($vp['PrintArea'])) { + $out .= ' /PrintArea /'.$vp['PrintArea']; + } + if (isset($vp['PrintClip'])) { + $out .= ' /PrintClip /'.$vp['PrintClip']; + } + if (isset($vp['PrintScaling'])) { + $out .= ' /PrintScaling /'.$vp['PrintScaling']; + } + if (isset($vp['Duplex']) AND (!TCPDF_STATIC::empty_string($vp['Duplex']))) { + $out .= ' /Duplex /'.$vp['Duplex']; + } + if (isset($vp['PickTrayByPDFSize'])) { + if ($vp['PickTrayByPDFSize']) { + $out .= ' /PickTrayByPDFSize true'; + } else { + $out .= ' /PickTrayByPDFSize false'; + } + } + if (isset($vp['PrintPageRange'])) { + $PrintPageRangeNum = ''; + foreach ($vp['PrintPageRange'] as $k => $v) { + $PrintPageRangeNum .= ' '.($v - 1).''; + } + $out .= ' /PrintPageRange ['.substr($PrintPageRangeNum,1).']'; + } + if (isset($vp['NumCopies'])) { + $out .= ' /NumCopies '.intval($vp['NumCopies']); + } + $out .= ' >>'; + return $out; + } + + /** + * Output PDF File Header (7.5.2). + * @protected + */ + protected function _putheader() { + $this->_out('%PDF-'.$this->PDFVersion); + $this->_out('%'.chr(0xe2).chr(0xe3).chr(0xcf).chr(0xd3)); + } + + /** + * Output end of document (EOF). + * @protected + */ + protected function _enddoc() { + if (isset($this->CurrentFont['fontkey']) AND isset($this->CurrentFont['subsetchars'])) { + // save subset chars of the previous font + $this->setFontSubBuffer($this->CurrentFont['fontkey'], 'subsetchars', $this->CurrentFont['subsetchars']); + } + $this->state = 1; + $this->_putheader(); + $this->_putpages(); + $this->_putresources(); + // empty signature fields + if (!empty($this->empty_signature_appearance)) { + foreach ($this->empty_signature_appearance as $key => $esa) { + // widget annotation for empty signature + $out = $this->_getobj($esa['objid'])."\n"; + $out .= '<< /Type /Annot'; + $out .= ' /Subtype /Widget'; + $out .= ' /Rect ['.$esa['rect'].']'; + $out .= ' /P '.$this->page_obj_id[($esa['page'])].' 0 R'; // link to signature appearance page + $out .= ' /F 4'; + $out .= ' /FT /Sig'; + $signame = $esa['name'].sprintf(' [%03d]', ($key + 1)); + $out .= ' /T '.$this->_textstring($signame, $esa['objid']); + $out .= ' /Ff 0'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + // Signature + if ($this->sign AND isset($this->signature_data['cert_type'])) { + // widget annotation for signature + $out = $this->_getobj($this->sig_obj_id)."\n"; + $out .= '<< /Type /Annot'; + $out .= ' /Subtype /Widget'; + $out .= ' /Rect ['.$this->signature_appearance['rect'].']'; + $out .= ' /P '.$this->page_obj_id[($this->signature_appearance['page'])].' 0 R'; // link to signature appearance page + $out .= ' /F 4'; + $out .= ' /FT /Sig'; + $out .= ' /T '.$this->_textstring($this->signature_appearance['name'], $this->sig_obj_id); + $out .= ' /Ff 0'; + $out .= ' /V '.($this->sig_obj_id + 1).' 0 R'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + // signature + $this->_putsignature(); + } + // Info + $objid_info = $this->_putinfo(); + // Catalog + $objid_catalog = $this->_putcatalog(); + // Cross-ref + $o = $this->bufferlen; + // XREF section + $this->_out('xref'); + $this->_out('0 '.($this->n + 1)); + $this->_out('0000000000 65535 f '); + $freegen = ($this->n + 2); + for ($i=1; $i <= $this->n; ++$i) { + if (!isset($this->offsets[$i]) AND ($i > 1)) { + $this->_out(sprintf('0000000000 %05d f ', $freegen)); + ++$freegen; + } else { + $this->_out(sprintf('%010d 00000 n ', $this->offsets[$i])); + } + } + // TRAILER + $out = 'trailer'."\n"; + $out .= '<<'; + $out .= ' /Size '.($this->n + 1); + $out .= ' /Root '.$objid_catalog.' 0 R'; + $out .= ' /Info '.$objid_info.' 0 R'; + if ($this->encrypted) { + $out .= ' /Encrypt '.$this->encryptdata['objid'].' 0 R'; + } + $out .= ' /ID [ <'.$this->file_id.'> <'.$this->file_id.'> ]'; + $out .= ' >>'; + $this->_out($out); + $this->_out('startxref'); + $this->_out($o); + $this->_out('%%EOF'); + $this->state = 3; // end-of-doc + } + + /** + * Initialize a new page. + * @param string $orientation page orientation. Possible values are (case insensitive):
        • P or PORTRAIT (default)
        • L or LANDSCAPE
        + * @param mixed $format The format used for pages. It can be either: one of the string values specified at getPageSizeFromFormat() or an array of parameters specified at setPageFormat(). + * @protected + * @see getPageSizeFromFormat(), setPageFormat() + */ + protected function _beginpage($orientation='', $format='') { + ++$this->page; + $this->pageobjects[$this->page] = array(); + $this->setPageBuffer($this->page, ''); + // initialize array for graphics tranformation positions inside a page buffer + $this->transfmrk[$this->page] = array(); + $this->state = 2; + if (TCPDF_STATIC::empty_string($orientation)) { + if (isset($this->CurOrientation)) { + $orientation = $this->CurOrientation; + } elseif ($this->fwPt > $this->fhPt) { + // landscape + $orientation = 'L'; + } else { + // portrait + $orientation = 'P'; + } + } + if (TCPDF_STATIC::empty_string($format)) { + $this->pagedim[$this->page] = $this->pagedim[($this->page - 1)]; + $this->setPageOrientation($orientation); + } else { + $this->setPageFormat($format, $orientation); + } + if ($this->rtl) { + $this->x = $this->w - $this->rMargin; + } else { + $this->x = $this->lMargin; + } + $this->y = $this->tMargin; + if (isset($this->newpagegroup[$this->page])) { + // start a new group + $this->currpagegroup = $this->newpagegroup[$this->page]; + $this->pagegroups[$this->currpagegroup] = 1; + } elseif (isset($this->currpagegroup) AND ($this->currpagegroup > 0)) { + ++$this->pagegroups[$this->currpagegroup]; + } + } + + /** + * Mark end of page. + * @protected + */ + protected function _endpage() { + $this->setVisibility('all'); + $this->state = 1; + } + + /** + * Begin a new object and return the object number. + * @return int object number + * @protected + */ + protected function _newobj() { + $this->_out($this->_getobj()); + return $this->n; + } + + /** + * Return the starting object string for the selected object ID. + * @param int|null $objid Object ID (leave empty to get a new ID). + * @return string the starting object string + * @protected + * @since 5.8.009 (2010-08-20) + */ + protected function _getobj($objid=null) { + if (TCPDF_STATIC::empty_string($objid)) { + ++$this->n; + $objid = $this->n; + } + $this->offsets[$objid] = $this->bufferlen; + $this->pageobjects[$this->page][] = $objid; + return $objid.' 0 obj'; + } + + /** + * Underline text. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to underline + * @protected + */ + protected function _dounderline($x, $y, $txt) { + $w = $this->GetStringWidth($txt); + return $this->_dounderlinew($x, $y, $w); + } + + /** + * Underline for rectangular text area. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param int $w width to underline + * @protected + * @since 4.8.008 (2009-09-29) + */ + protected function _dounderlinew($x, $y, $w) { + $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; + return sprintf('%F %F %F %F re f', $x * $this->k, ((($this->h - $y) * $this->k) + $linew), $w * $this->k, $linew); + } + + /** + * Line through text. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to linethrough + * @protected + */ + protected function _dolinethrough($x, $y, $txt) { + $w = $this->GetStringWidth($txt); + return $this->_dolinethroughw($x, $y, $w); + } + + /** + * Line through for rectangular text area. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param int $w line length (width) + * @protected + * @since 4.9.008 (2009-09-29) + */ + protected function _dolinethroughw($x, $y, $w) { + $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; + return sprintf('%F %F %F %F re f', $x * $this->k, ((($this->h - $y) * $this->k) + $linew + ($this->FontSizePt / 3)), $w * $this->k, $linew); + } + + /** + * Overline text. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param string $txt text to overline + * @protected + * @since 4.9.015 (2010-04-19) + */ + protected function _dooverline($x, $y, $txt) { + $w = $this->GetStringWidth($txt); + return $this->_dooverlinew($x, $y, $w); + } + + /** + * Overline for rectangular text area. + * @param int $x X coordinate + * @param int $y Y coordinate + * @param int $w width to overline + * @protected + * @since 4.9.015 (2010-04-19) + */ + protected function _dooverlinew($x, $y, $w) { + $linew = - $this->CurrentFont['ut'] / 1000 * $this->FontSizePt; + return sprintf('%F %F %F %F re f', $x * $this->k, (($this->h - $y + $this->FontAscent) * $this->k) - $linew, $w * $this->k, $linew); + + } + + /** + * Format a data string for meta information + * @param string $s data string to escape. + * @param int $n object ID + * @return string escaped string. + * @protected + */ + protected function _datastring($s, $n=0) { + if ($n == 0) { + $n = $this->n; + } + $s = $this->_encrypt_data($n, $s); + return '('. TCPDF_STATIC::_escape($s).')'; + } + + /** + * Set the document creation timestamp + * @param mixed $time Document creation timestamp in seconds or date-time string. + * @public + * @since 5.9.152 (2012-03-23) + */ + public function setDocCreationTimestamp($time) { + if (is_string($time)) { + $time = TCPDF_STATIC::getTimestamp($time); + } + $this->doc_creation_timestamp = intval($time); + } + + /** + * Set the document modification timestamp + * @param mixed $time Document modification timestamp in seconds or date-time string. + * @public + * @since 5.9.152 (2012-03-23) + */ + public function setDocModificationTimestamp($time) { + if (is_string($time)) { + $time = TCPDF_STATIC::getTimestamp($time); + } + $this->doc_modification_timestamp = intval($time); + } + + /** + * Returns document creation timestamp in seconds. + * @return int Creation timestamp in seconds. + * @public + * @since 5.9.152 (2012-03-23) + */ + public function getDocCreationTimestamp() { + return $this->doc_creation_timestamp; + } + + /** + * Returns document modification timestamp in seconds. + * @return int Modfication timestamp in seconds. + * @public + * @since 5.9.152 (2012-03-23) + */ + public function getDocModificationTimestamp() { + return $this->doc_modification_timestamp; + } + + /** + * Returns a formatted date for meta information + * @param int $n Object ID. + * @param int $timestamp Timestamp to convert. + * @return string escaped date string. + * @protected + * @since 4.6.028 (2009-08-25) + */ + protected function _datestring($n=0, $timestamp=0) { + if ((empty($timestamp)) OR ($timestamp < 0)) { + $timestamp = $this->doc_creation_timestamp; + } + return $this->_datastring('D:'.TCPDF_STATIC::getFormattedDate($timestamp), $n); + } + + /** + * Format a text string for meta information + * @param string $s string to escape. + * @param int $n object ID + * @return string escaped string. + * @protected + */ + protected function _textstring($s, $n=0) { + if ($this->isunicode) { + //Convert string to UTF-16BE + $s = TCPDF_FONTS::UTF8ToUTF16BE($s, true, $this->isunicode, $this->CurrentFont); + } + return $this->_datastring($s, $n); + } + + /** + * get raw output stream. + * @param string $s string to output. + * @param int $n object reference for encryption mode + * @protected + * @author Nicola Asuni + * @since 5.5.000 (2010-06-22) + */ + protected function _getrawstream($s, $n=0) { + if ($n <= 0) { + // default to current object + $n = $this->n; + } + return $this->_encrypt_data($n, $s); + } + + /** + * Output a string to the document. + * @param string $s string to output. + * @protected + */ + protected function _out($s) { + if ($this->state == 2) { + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['outdata'] .= $s."\n"; + } elseif ((!$this->InFooter) AND isset($this->footerlen[$this->page]) AND ($this->footerlen[$this->page] > 0)) { + // puts data before page footer + $pagebuff = $this->getPageBuffer($this->page); + $page = substr($pagebuff, 0, -$this->footerlen[$this->page]); + $footer = substr($pagebuff, -$this->footerlen[$this->page]); + $this->setPageBuffer($this->page, $page.$s."\n".$footer); + // update footer position + $this->footerpos[$this->page] += strlen($s."\n"); + } else { + // set page data + $this->setPageBuffer($this->page, $s."\n", true); + } + } elseif ($this->state > 0) { + // set general data + $this->setBuffer($s."\n"); + } + } + + /** + * Set header font. + * @param array $font Array describing the basic font parameters: (family, style, size). + * @phpstan-param array{0: string, 1: string, 2: float|null} $font + * @public + * @since 1.1 + */ + public function setHeaderFont($font) { + $this->header_font = $font; + } + + /** + * Get header font. + * @return array Array describing the basic font parameters: (family, style, size). + * @phpstan-return array{0: string, 1: string, 2: float|null} + * @public + * @since 4.0.012 (2008-07-24) + */ + public function getHeaderFont() { + return $this->header_font; + } + + /** + * Set footer font. + * @param array $font Array describing the basic font parameters: (family, style, size). + * @phpstan-param array{0: string, 1: string, 2: float|null} $font + * @public + * @since 1.1 + */ + public function setFooterFont($font) { + $this->footer_font = $font; + } + + /** + * Get Footer font. + * @return array Array describing the basic font parameters: (family, style, size). + * @phpstan-return array{0: string, 1: string, 2: float|null} $font + * @public + * @since 4.0.012 (2008-07-24) + */ + public function getFooterFont() { + return $this->footer_font; + } + + /** + * Set language array. + * @param array $language + * @public + * @since 1.1 + */ + public function setLanguageArray($language) { + $this->l = $language; + if (isset($this->l['a_meta_dir'])) { + $this->rtl = $this->l['a_meta_dir']=='rtl' ? true : false; + } else { + $this->rtl = false; + } + } + + /** + * Returns the PDF data. + * @public + */ + public function getPDFData() { + if ($this->state < 3) { + $this->Close(); + } + return $this->buffer; + } + + /** + * Output anchor link. + * @param string $url link URL or internal link (i.e.: <a href="#23,4.5">link to page 23 at 4.5 Y position</a>) + * @param string $name link name + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param boolean $firstline if true prints only the first line and return the remaining string. + * @param array|null $color array of RGB text color + * @param string $style font style (U, D, B, I) + * @param boolean $firstblock if true the string is the starting of a line. + * @return int the number of cells used or the remaining text if $firstline = true; + * @public + */ + public function addHtmlLink($url, $name, $fill=false, $firstline=false, $color=null, $style=-1, $firstblock=false) { + if (isset($url[1]) AND ($url[0] == '#') AND is_numeric($url[1])) { + // convert url to internal link + $lnkdata = explode(',', $url); + if (isset($lnkdata[0]) ) { + $page = substr($lnkdata[0], 1); + if (isset($lnkdata[1]) AND (strlen($lnkdata[1]) > 0)) { + $lnky = floatval($lnkdata[1]); + } else { + $lnky = 0; + } + $url = $this->AddLink(); + $this->setLink($url, $lnky, $page); + } + } + // store current settings + $prevcolor = $this->fgcolor; + $prevstyle = $this->FontStyle; + if (empty($color)) { + $this->setTextColorArray($this->htmlLinkColorArray); + } else { + $this->setTextColorArray($color); + } + if ($style == -1) { + $this->setFont('', $this->FontStyle.$this->htmlLinkFontStyle); + } else { + $this->setFont('', $this->FontStyle.$style); + } + $ret = $this->Write($this->lasth, $name, $url, $fill, '', false, 0, $firstline, $firstblock, 0); + // restore settings + $this->setFont('', $prevstyle); + $this->setTextColorArray($prevcolor); + return $ret; + } + + /** + * Converts pixels to User's Units. + * @param int $px pixels + * @return float value in user's unit + * @public + * @see setImageScale(), getImageScale() + */ + public function pixelsToUnits($px) { + return ($px / ($this->imgscale * $this->k)); + } + + /** + * Reverse function for htmlentities. + * Convert entities in UTF-8. + * @param string $text_to_convert Text to convert. + * @return string converted text string + * @public + */ + public function unhtmlentities($text_to_convert) { + return @html_entity_decode($text_to_convert, ENT_QUOTES, $this->encoding); + } + + // ENCRYPTION METHODS ---------------------------------- + + /** + * Compute encryption key depending on object number where the encrypted data is stored. + * This is used for all strings and streams without crypt filter specifier. + * @param int $n object number + * @return int object key + * @protected + * @author Nicola Asuni + * @since 2.0.000 (2008-01-02) + */ + protected function _objectkey($n) { + $objkey = $this->encryptdata['key'].pack('VXxx', $n); + if ($this->encryptdata['mode'] == 2) { // AES-128 + // AES padding + $objkey .= "\x73\x41\x6C\x54"; // sAlT + } + $objkey = substr(TCPDF_STATIC::_md5_16($objkey), 0, (($this->encryptdata['Length'] / 8) + 5)); + $objkey = substr($objkey, 0, 16); + return $objkey; + } + + /** + * Encrypt the input string. + * @param int $n object number + * @param string $s data string to encrypt + * @return string encrypted string + * @protected + * @author Nicola Asuni + * @since 5.0.005 (2010-05-11) + */ + protected function _encrypt_data($n, $s) { + if (!$this->encrypted) { + return $s; + } + switch ($this->encryptdata['mode']) { + case 0: // RC4-40 + case 1: { // RC4-128 + $s = TCPDF_STATIC::_RC4($this->_objectkey($n), $s, $this->last_enc_key, $this->last_enc_key_c); + break; + } + case 2: { // AES-128 + $s = TCPDF_STATIC::_AES($this->_objectkey($n), $s); + break; + } + case 3: { // AES-256 + $s = TCPDF_STATIC::_AES($this->encryptdata['key'], $s); + break; + } + } + return $s; + } + + /** + * Put encryption on PDF document. + * @protected + * @author Nicola Asuni + * @since 2.0.000 (2008-01-02) + */ + protected function _putencryption() { + if (!$this->encrypted) { + return; + } + $this->encryptdata['objid'] = $this->_newobj(); + $out = '<<'; + if (!isset($this->encryptdata['Filter']) OR empty($this->encryptdata['Filter'])) { + $this->encryptdata['Filter'] = 'Standard'; + } + $out .= ' /Filter /'.$this->encryptdata['Filter']; + if (isset($this->encryptdata['SubFilter']) AND !empty($this->encryptdata['SubFilter'])) { + $out .= ' /SubFilter /'.$this->encryptdata['SubFilter']; + } + if (!isset($this->encryptdata['V']) OR empty($this->encryptdata['V'])) { + $this->encryptdata['V'] = 1; + } + // V is a code specifying the algorithm to be used in encrypting and decrypting the document + $out .= ' /V '.$this->encryptdata['V']; + if (isset($this->encryptdata['Length']) AND !empty($this->encryptdata['Length'])) { + // The length of the encryption key, in bits. The value shall be a multiple of 8, in the range 40 to 256 + $out .= ' /Length '.$this->encryptdata['Length']; + } else { + $out .= ' /Length 40'; + } + if ($this->encryptdata['V'] >= 4) { + if (!isset($this->encryptdata['StmF']) OR empty($this->encryptdata['StmF'])) { + $this->encryptdata['StmF'] = 'Identity'; + } + if (!isset($this->encryptdata['StrF']) OR empty($this->encryptdata['StrF'])) { + // The name of the crypt filter that shall be used when decrypting all strings in the document. + $this->encryptdata['StrF'] = 'Identity'; + } + // A dictionary whose keys shall be crypt filter names and whose values shall be the corresponding crypt filter dictionaries. + if (isset($this->encryptdata['CF']) AND !empty($this->encryptdata['CF'])) { + $out .= ' /CF <<'; + $out .= ' /'.$this->encryptdata['StmF'].' <<'; + $out .= ' /Type /CryptFilter'; + if (isset($this->encryptdata['CF']['CFM']) AND !empty($this->encryptdata['CF']['CFM'])) { + // The method used + $out .= ' /CFM /'.$this->encryptdata['CF']['CFM']; + if ($this->encryptdata['pubkey']) { + $out .= ' /Recipients ['; + foreach ($this->encryptdata['Recipients'] as $rec) { + $out .= ' <'.$rec.'>'; + } + $out .= ' ]'; + if (isset($this->encryptdata['CF']['EncryptMetadata']) AND (!$this->encryptdata['CF']['EncryptMetadata'])) { + $out .= ' /EncryptMetadata false'; + } else { + $out .= ' /EncryptMetadata true'; + } + } + } else { + $out .= ' /CFM /None'; + } + if (isset($this->encryptdata['CF']['AuthEvent']) AND !empty($this->encryptdata['CF']['AuthEvent'])) { + // The event to be used to trigger the authorization that is required to access encryption keys used by this filter. + $out .= ' /AuthEvent /'.$this->encryptdata['CF']['AuthEvent']; + } else { + $out .= ' /AuthEvent /DocOpen'; + } + if (isset($this->encryptdata['CF']['Length']) AND !empty($this->encryptdata['CF']['Length'])) { + // The bit length of the encryption key. + $out .= ' /Length '.$this->encryptdata['CF']['Length']; + } + $out .= ' >> >>'; + } + // The name of the crypt filter that shall be used by default when decrypting streams. + $out .= ' /StmF /'.$this->encryptdata['StmF']; + // The name of the crypt filter that shall be used when decrypting all strings in the document. + $out .= ' /StrF /'.$this->encryptdata['StrF']; + if (isset($this->encryptdata['EFF']) AND !empty($this->encryptdata['EFF'])) { + // The name of the crypt filter that shall be used when encrypting embedded file streams that do not have their own crypt filter specifier. + $out .= ' /EFF /'.$this->encryptdata['']; + } + } + // Additional encryption dictionary entries for the standard security handler + if ($this->encryptdata['pubkey']) { + if (($this->encryptdata['V'] < 4) AND isset($this->encryptdata['Recipients']) AND !empty($this->encryptdata['Recipients'])) { + $out .= ' /Recipients ['; + foreach ($this->encryptdata['Recipients'] as $rec) { + $out .= ' <'.$rec.'>'; + } + $out .= ' ]'; + } + } else { + $out .= ' /R'; + if ($this->encryptdata['V'] == 5) { // AES-256 + $out .= ' 5'; + $out .= ' /OE ('.TCPDF_STATIC::_escape($this->encryptdata['OE']).')'; + $out .= ' /UE ('.TCPDF_STATIC::_escape($this->encryptdata['UE']).')'; + $out .= ' /Perms ('.TCPDF_STATIC::_escape($this->encryptdata['perms']).')'; + } elseif ($this->encryptdata['V'] == 4) { // AES-128 + $out .= ' 4'; + } elseif ($this->encryptdata['V'] < 2) { // RC-40 + $out .= ' 2'; + } else { // RC-128 + $out .= ' 3'; + } + $out .= ' /O ('.TCPDF_STATIC::_escape($this->encryptdata['O']).')'; + $out .= ' /U ('.TCPDF_STATIC::_escape($this->encryptdata['U']).')'; + $out .= ' /P '.$this->encryptdata['P']; + if (isset($this->encryptdata['EncryptMetadata']) AND (!$this->encryptdata['EncryptMetadata'])) { + $out .= ' /EncryptMetadata false'; + } else { + $out .= ' /EncryptMetadata true'; + } + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + + /** + * Compute U value (used for encryption) + * @return string U value + * @protected + * @since 2.0.000 (2008-01-02) + * @author Nicola Asuni + */ + protected function _Uvalue() { + if ($this->encryptdata['mode'] == 0) { // RC4-40 + return TCPDF_STATIC::_RC4($this->encryptdata['key'], TCPDF_STATIC::$enc_padding, $this->last_enc_key, $this->last_enc_key_c); + } elseif ($this->encryptdata['mode'] < 3) { // RC4-128, AES-128 + $tmp = TCPDF_STATIC::_md5_16(TCPDF_STATIC::$enc_padding.$this->encryptdata['fileid']); + $enc = TCPDF_STATIC::_RC4($this->encryptdata['key'], $tmp, $this->last_enc_key, $this->last_enc_key_c); + $len = strlen($tmp); + for ($i = 1; $i <= 19; ++$i) { + $ek = ''; + for ($j = 0; $j < $len; ++$j) { + $ek .= chr(ord($this->encryptdata['key'][$j]) ^ $i); + } + $enc = TCPDF_STATIC::_RC4($ek, $enc, $this->last_enc_key, $this->last_enc_key_c); + } + $enc .= str_repeat("\x00", 16); + return substr($enc, 0, 32); + } elseif ($this->encryptdata['mode'] == 3) { // AES-256 + $seed = TCPDF_STATIC::_md5_16(TCPDF_STATIC::getRandomSeed()); + // User Validation Salt + $this->encryptdata['UVS'] = substr($seed, 0, 8); + // User Key Salt + $this->encryptdata['UKS'] = substr($seed, 8, 16); + return hash('sha256', $this->encryptdata['user_password'].$this->encryptdata['UVS'], true).$this->encryptdata['UVS'].$this->encryptdata['UKS']; + } + } + + /** + * Compute UE value (used for encryption) + * @return string UE value + * @protected + * @since 5.9.006 (2010-10-19) + * @author Nicola Asuni + */ + protected function _UEvalue() { + $hashkey = hash('sha256', $this->encryptdata['user_password'].$this->encryptdata['UKS'], true); + return TCPDF_STATIC::_AESnopad($hashkey, $this->encryptdata['key']); + } + + /** + * Compute O value (used for encryption) + * @return string O value + * @protected + * @since 2.0.000 (2008-01-02) + * @author Nicola Asuni + */ + protected function _Ovalue() { + if ($this->encryptdata['mode'] < 3) { // RC4-40, RC4-128, AES-128 + $tmp = TCPDF_STATIC::_md5_16($this->encryptdata['owner_password']); + if ($this->encryptdata['mode'] > 0) { + for ($i = 0; $i < 50; ++$i) { + $tmp = TCPDF_STATIC::_md5_16($tmp); + } + } + $owner_key = substr($tmp, 0, ($this->encryptdata['Length'] / 8)); + $enc = TCPDF_STATIC::_RC4($owner_key, $this->encryptdata['user_password'], $this->last_enc_key, $this->last_enc_key_c); + if ($this->encryptdata['mode'] > 0) { + $len = strlen($owner_key); + for ($i = 1; $i <= 19; ++$i) { + $ek = ''; + for ($j = 0; $j < $len; ++$j) { + $ek .= chr(ord($owner_key[$j]) ^ $i); + } + $enc = TCPDF_STATIC::_RC4($ek, $enc, $this->last_enc_key, $this->last_enc_key_c); + } + } + return $enc; + } elseif ($this->encryptdata['mode'] == 3) { // AES-256 + $seed = TCPDF_STATIC::_md5_16(TCPDF_STATIC::getRandomSeed()); + // Owner Validation Salt + $this->encryptdata['OVS'] = substr($seed, 0, 8); + // Owner Key Salt + $this->encryptdata['OKS'] = substr($seed, 8, 16); + return hash('sha256', $this->encryptdata['owner_password'].$this->encryptdata['OVS'].$this->encryptdata['U'], true).$this->encryptdata['OVS'].$this->encryptdata['OKS']; + } + } + + /** + * Compute OE value (used for encryption) + * @return string OE value + * @protected + * @since 5.9.006 (2010-10-19) + * @author Nicola Asuni + */ + protected function _OEvalue() { + $hashkey = hash('sha256', $this->encryptdata['owner_password'].$this->encryptdata['OKS'].$this->encryptdata['U'], true); + return TCPDF_STATIC::_AESnopad($hashkey, $this->encryptdata['key']); + } + + /** + * Convert password for AES-256 encryption mode + * @param string $password password + * @return string password + * @protected + * @since 5.9.006 (2010-10-19) + * @author Nicola Asuni + */ + protected function _fixAES256Password($password) { + $psw = ''; // password to be returned + $psw_array = TCPDF_FONTS::utf8Bidi(TCPDF_FONTS::UTF8StringToArray($password, $this->isunicode, $this->CurrentFont), $password, $this->rtl, $this->isunicode, $this->CurrentFont); + foreach ($psw_array as $c) { + $psw .= TCPDF_FONTS::unichr($c, $this->isunicode); + } + return substr($psw, 0, 127); + } + + /** + * Compute encryption key + * @protected + * @since 2.0.000 (2008-01-02) + * @author Nicola Asuni + */ + protected function _generateencryptionkey() { + $keybytelen = ($this->encryptdata['Length'] / 8); + if (!$this->encryptdata['pubkey']) { // standard mode + if ($this->encryptdata['mode'] == 3) { // AES-256 + // generate 256 bit random key + $this->encryptdata['key'] = substr(hash('sha256', TCPDF_STATIC::getRandomSeed(), true), 0, $keybytelen); + // truncate passwords + $this->encryptdata['user_password'] = $this->_fixAES256Password($this->encryptdata['user_password']); + $this->encryptdata['owner_password'] = $this->_fixAES256Password($this->encryptdata['owner_password']); + // Compute U value + $this->encryptdata['U'] = $this->_Uvalue(); + // Compute UE value + $this->encryptdata['UE'] = $this->_UEvalue(); + // Compute O value + $this->encryptdata['O'] = $this->_Ovalue(); + // Compute OE value + $this->encryptdata['OE'] = $this->_OEvalue(); + // Compute P value + $this->encryptdata['P'] = $this->encryptdata['protection']; + // Computing the encryption dictionary's Perms (permissions) value + $perms = TCPDF_STATIC::getEncPermissionsString($this->encryptdata['protection']); // bytes 0-3 + $perms .= chr(255).chr(255).chr(255).chr(255); // bytes 4-7 + if (isset($this->encryptdata['CF']['EncryptMetadata']) AND (!$this->encryptdata['CF']['EncryptMetadata'])) { // byte 8 + $perms .= 'F'; + } else { + $perms .= 'T'; + } + $perms .= 'adb'; // bytes 9-11 + $perms .= 'nick'; // bytes 12-15 + $this->encryptdata['perms'] = TCPDF_STATIC::_AESnopad($this->encryptdata['key'], $perms); + } else { // RC4-40, RC4-128, AES-128 + // Pad passwords + $this->encryptdata['user_password'] = substr($this->encryptdata['user_password'].TCPDF_STATIC::$enc_padding, 0, 32); + $this->encryptdata['owner_password'] = substr($this->encryptdata['owner_password'].TCPDF_STATIC::$enc_padding, 0, 32); + // Compute O value + $this->encryptdata['O'] = $this->_Ovalue(); + // get default permissions (reverse byte order) + $permissions = TCPDF_STATIC::getEncPermissionsString($this->encryptdata['protection']); + // Compute encryption key + $tmp = TCPDF_STATIC::_md5_16($this->encryptdata['user_password'].$this->encryptdata['O'].$permissions.$this->encryptdata['fileid']); + if ($this->encryptdata['mode'] > 0) { + for ($i = 0; $i < 50; ++$i) { + $tmp = TCPDF_STATIC::_md5_16(substr($tmp, 0, $keybytelen)); + } + } + $this->encryptdata['key'] = substr($tmp, 0, $keybytelen); + // Compute U value + $this->encryptdata['U'] = $this->_Uvalue(); + // Compute P value + $this->encryptdata['P'] = $this->encryptdata['protection']; + } + } else { // Public-Key mode + // random 20-byte seed + $seed = sha1(TCPDF_STATIC::getRandomSeed(), true); + $recipient_bytes = ''; + foreach ($this->encryptdata['pubkeys'] as $pubkey) { + // for each public certificate + if (isset($pubkey['p'])) { + $pkprotection = TCPDF_STATIC::getUserPermissionCode($pubkey['p'], $this->encryptdata['mode']); + } else { + $pkprotection = $this->encryptdata['protection']; + } + // get default permissions (reverse byte order) + $pkpermissions = TCPDF_STATIC::getEncPermissionsString($pkprotection); + // envelope data + $envelope = $seed.$pkpermissions; + // write the envelope data to a temporary file + $tempkeyfile = TCPDF_STATIC::getObjFilename('key', $this->file_id); + $f = TCPDF_STATIC::fopenLocal($tempkeyfile, 'wb'); + if (!$f) { + $this->Error('Unable to create temporary key file: '.$tempkeyfile); + } + $envelope_length = strlen($envelope); + fwrite($f, $envelope, $envelope_length); + fclose($f); + $tempencfile = TCPDF_STATIC::getObjFilename('enc', $this->file_id); + if (!openssl_pkcs7_encrypt($tempkeyfile, $tempencfile, $pubkey['c'], array(), PKCS7_BINARY | PKCS7_DETACHED)) { + $this->Error('Unable to encrypt the file: '.$tempkeyfile); + } + // read encryption signature + $signature = file_get_contents($tempencfile, false, null, $envelope_length); + // extract signature + $signature = substr($signature, strpos($signature, 'Content-Disposition')); + $tmparr = explode("\n\n", $signature); + $signature = trim($tmparr[1]); + unset($tmparr); + // decode signature + $signature = base64_decode($signature); + // convert signature to hex + $hexsignature = current(unpack('H*', $signature)); + // store signature on recipients array + $this->encryptdata['Recipients'][] = $hexsignature; + // The bytes of each item in the Recipients array of PKCS#7 objects in the order in which they appear in the array + $recipient_bytes .= $signature; + } + // calculate encryption key + if ($this->encryptdata['mode'] == 3) { // AES-256 + $this->encryptdata['key'] = substr(hash('sha256', $seed.$recipient_bytes, true), 0, $keybytelen); + } else { // RC4-40, RC4-128, AES-128 + $this->encryptdata['key'] = substr(sha1($seed.$recipient_bytes, true), 0, $keybytelen); + } + } + } + + /** + * Set document protection + * Remark: the protection against modification is for people who have the full Acrobat product. + * If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if different from the user one, can be used to get full access. + * Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts. + * @param array $permissions the set of permissions (specify the ones you want to block):
        • print : Print the document;
        • modify : Modify the contents of the document by operations other than those controlled by 'fill-forms', 'extract' and 'assemble';
        • copy : Copy or otherwise extract text and graphics from the document;
        • annot-forms : Add or modify text annotations, fill in interactive form fields, and, if 'modify' is also set, create or modify interactive form fields (including signature fields);
        • fill-forms : Fill in existing interactive form fields (including signature fields), even if 'annot-forms' is not specified;
        • extract : Extract text and graphics (in support of accessibility to users with disabilities or for other purposes);
        • assemble : Assemble the document (insert, rotate, or delete pages and create bookmarks or thumbnail images), even if 'modify' is not set;
        • print-high : Print the document to a representation from which a faithful digital copy of the PDF content could be generated. When this is not set, printing is limited to a low-level representation of the appearance, possibly of degraded quality.
        • owner : (inverted logic - only for public-key) when set permits change of encryption and enables all other permissions.
        + * @param string $user_pass user password. Empty by default. + * @param string|null $owner_pass owner password. If not specified, a random value is used. + * @param int $mode encryption strength: 0 = RC4 40 bit; 1 = RC4 128 bit; 2 = AES 128 bit; 3 = AES 256 bit. + * @param array|null $pubkeys array of recipients containing public-key certificates ('c') and permissions ('p'). For example: array(array('c' => 'file://../examples/data/cert/tcpdf.crt', 'p' => array('print'))) + * @public + * @since 2.0.000 (2008-01-02) + * @author Nicola Asuni + */ + public function setProtection($permissions=array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'), $user_pass='', $owner_pass=null, $mode=0, $pubkeys=null) { + if ($this->pdfa_mode) { + // encryption is not allowed in PDF/A mode + return; + } + $this->encryptdata['protection'] = TCPDF_STATIC::getUserPermissionCode($permissions, $mode); + if (($pubkeys !== null) AND (is_array($pubkeys))) { + // public-key mode + $this->encryptdata['pubkeys'] = $pubkeys; + if ($mode == 0) { + // public-Key Security requires at least 128 bit + $mode = 1; + } + if (!function_exists('openssl_pkcs7_encrypt')) { + $this->Error('Public-Key Security requires openssl library.'); + } + // Set Public-Key filter (available are: Entrust.PPKEF, Adobe.PPKLite, Adobe.PubSec) + $this->encryptdata['pubkey'] = true; + $this->encryptdata['Filter'] = 'Adobe.PubSec'; + $this->encryptdata['StmF'] = 'DefaultCryptFilter'; + $this->encryptdata['StrF'] = 'DefaultCryptFilter'; + } else { + // standard mode (password mode) + $this->encryptdata['pubkey'] = false; + $this->encryptdata['Filter'] = 'Standard'; + $this->encryptdata['StmF'] = 'StdCF'; + $this->encryptdata['StrF'] = 'StdCF'; + } + if ($mode > 1) { // AES + if (!extension_loaded('openssl') && !extension_loaded('mcrypt')) { + $this->Error('AES encryption requires openssl or mcrypt extension (http://www.php.net/manual/en/mcrypt.requirements.php).'); + } + if (extension_loaded('openssl') && !in_array('aes-256-cbc', openssl_get_cipher_methods())) { + $this->Error('AES encryption requires openssl/aes-256-cbc cypher.'); + } + if (extension_loaded('mcrypt') && mcrypt_get_cipher_name(MCRYPT_RIJNDAEL_128) === false) { + $this->Error('AES encryption requires MCRYPT_RIJNDAEL_128 cypher.'); + } + if (($mode == 3) AND !function_exists('hash')) { + // the Hash extension requires no external libraries and is enabled by default as of PHP 5.1.2. + $this->Error('AES 256 encryption requires HASH Message Digest Framework (http://www.php.net/manual/en/book.hash.php).'); + } + } + if ($owner_pass === null) { + $owner_pass = md5(TCPDF_STATIC::getRandomSeed()); + } + $this->encryptdata['user_password'] = $user_pass; + $this->encryptdata['owner_password'] = $owner_pass; + $this->encryptdata['mode'] = $mode; + switch ($mode) { + case 0: { // RC4 40 bit + $this->encryptdata['V'] = 1; + $this->encryptdata['Length'] = 40; + $this->encryptdata['CF']['CFM'] = 'V2'; + break; + } + case 1: { // RC4 128 bit + $this->encryptdata['V'] = 2; + $this->encryptdata['Length'] = 128; + $this->encryptdata['CF']['CFM'] = 'V2'; + if ($this->encryptdata['pubkey']) { + $this->encryptdata['SubFilter'] = 'adbe.pkcs7.s4'; + $this->encryptdata['Recipients'] = array(); + } + break; + } + case 2: { // AES 128 bit + $this->encryptdata['V'] = 4; + $this->encryptdata['Length'] = 128; + $this->encryptdata['CF']['CFM'] = 'AESV2'; + $this->encryptdata['CF']['Length'] = 128; + if ($this->encryptdata['pubkey']) { + $this->encryptdata['SubFilter'] = 'adbe.pkcs7.s5'; + $this->encryptdata['Recipients'] = array(); + } + break; + } + case 3: { // AES 256 bit + $this->encryptdata['V'] = 5; + $this->encryptdata['Length'] = 256; + $this->encryptdata['CF']['CFM'] = 'AESV3'; + $this->encryptdata['CF']['Length'] = 256; + if ($this->encryptdata['pubkey']) { + $this->encryptdata['SubFilter'] = 'adbe.pkcs7.s5'; + $this->encryptdata['Recipients'] = array(); + } + break; + } + } + $this->encrypted = true; + $this->encryptdata['fileid'] = TCPDF_STATIC::convertHexStringToString($this->file_id); + $this->_generateencryptionkey(); + } + + // END OF ENCRYPTION FUNCTIONS ------------------------- + + // START TRANSFORMATIONS SECTION ----------------------- + + /** + * Starts a 2D tranformation saving current graphic state. + * This function must be called before scaling, mirroring, translation, rotation and skewing. + * Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior. + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function StartTransform() { + if ($this->state != 2) { + return; + } + $this->_outSaveGraphicsState(); + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['transfmrk'][] = strlen($this->xobjects[$this->xobjid]['outdata']); + } else { + $this->transfmrk[$this->page][] = $this->pagelen[$this->page]; + } + ++$this->transfmatrix_key; + $this->transfmatrix[$this->transfmatrix_key] = array(); + } + + /** + * Stops a 2D tranformation restoring previous graphic state. + * This function must be called after scaling, mirroring, translation, rotation and skewing. + * Use StartTransform() before, and StopTransform() after the transformations to restore the normal behavior. + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function StopTransform() { + if ($this->state != 2) { + return; + } + $this->_outRestoreGraphicsState(); + if (isset($this->transfmatrix[$this->transfmatrix_key])) { + array_pop($this->transfmatrix[$this->transfmatrix_key]); + --$this->transfmatrix_key; + } + if ($this->inxobj) { + // we are inside an XObject template + array_pop($this->xobjects[$this->xobjid]['transfmrk']); + } else { + array_pop($this->transfmrk[$this->page]); + } + } + /** + * Horizontal Scaling. + * @param float $s_x scaling factor for width as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function ScaleX($s_x, $x='', $y='') { + $this->Scale($s_x, 100, $x, $y); + } + + /** + * Vertical Scaling. + * @param float $s_y scaling factor for height as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function ScaleY($s_y, $x='', $y='') { + $this->Scale(100, $s_y, $x, $y); + } + + /** + * Vertical and horizontal proportional Scaling. + * @param float $s scaling factor for width and height as percent. 0 is not allowed. + * @param int $x abscissa of the scaling center. Default is current x position + * @param int $y ordinate of the scaling center. Default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function ScaleXY($s, $x='', $y='') { + $this->Scale($s, $s, $x, $y); + } + + /** + * Vertical and horizontal non-proportional Scaling. + * @param float $s_x scaling factor for width as percent. 0 is not allowed. + * @param float $s_y scaling factor for height as percent. 0 is not allowed. + * @param float|null $x abscissa of the scaling center. Default is current x position + * @param float|null $y ordinate of the scaling center. Default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function Scale($s_x, $s_y, $x=null, $y=null) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + if (($s_x == 0) OR ($s_y == 0)) { + $this->Error('Please do not use values equal to zero for scaling'); + } + $y = ($this->h - $y) * $this->k; + $x *= $this->k; + //calculate elements of transformation matrix + $s_x /= 100; + $s_y /= 100; + $tm = array(); + $tm[0] = $s_x; + $tm[1] = 0; + $tm[2] = 0; + $tm[3] = $s_y; + $tm[4] = $x * (1 - $s_x); + $tm[5] = $y * (1 - $s_y); + //scale the coordinate system + $this->Transform($tm); + } + + /** + * Horizontal Mirroring. + * @param float|null $x abscissa of the point. Default is current x position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function MirrorH($x=null) { + $this->Scale(-100, 100, $x); + } + + /** + * Verical Mirroring. + * @param float|null $y ordinate of the point. Default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function MirrorV($y=null) { + $this->Scale(100, -100, null, $y); + } + + /** + * Point reflection mirroring. + * @param float|null $x abscissa of the point. Default is current x position + * @param float|null $y ordinate of the point. Default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function MirrorP($x=null,$y=null) { + $this->Scale(-100, -100, $x, $y); + } + + /** + * Reflection against a straight line through point (x, y) with the gradient angle (angle). + * @param float $angle gradient angle of the straight line. Default is 0 (horizontal line). + * @param float|null $x abscissa of the point. Default is current x position + * @param float|null $y ordinate of the point. Default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function MirrorL($angle=0, $x=null,$y=null) { + $this->Scale(-100, 100, $x, $y); + $this->Rotate(-2*($angle-90), $x, $y); + } + + /** + * Translate graphic object horizontally. + * @param int $t_x movement to the right (or left for RTL) + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function TranslateX($t_x) { + $this->Translate($t_x, 0); + } + + /** + * Translate graphic object vertically. + * @param int $t_y movement to the bottom + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function TranslateY($t_y) { + $this->Translate(0, $t_y); + } + + /** + * Translate graphic object horizontally and vertically. + * @param int $t_x movement to the right + * @param int $t_y movement to the bottom + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function Translate($t_x, $t_y) { + //calculate elements of transformation matrix + $tm = array(); + $tm[0] = 1; + $tm[1] = 0; + $tm[2] = 0; + $tm[3] = 1; + $tm[4] = $t_x * $this->k; + $tm[5] = -$t_y * $this->k; + //translate the coordinate system + $this->Transform($tm); + } + + /** + * Rotate object. + * @param float $angle angle in degrees for counter-clockwise rotation + * @param float|null $x abscissa of the rotation center. Default is current x position + * @param float|null $y ordinate of the rotation center. Default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function Rotate($angle, $x=null, $y=null) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + $y = ($this->h - $y) * $this->k; + $x *= $this->k; + //calculate elements of transformation matrix + $tm = array(); + $tm[0] = cos(deg2rad($angle)); + $tm[1] = sin(deg2rad($angle)); + $tm[2] = -$tm[1]; + $tm[3] = $tm[0]; + $tm[4] = $x + ($tm[1] * $y) - ($tm[0] * $x); + $tm[5] = $y - ($tm[0] * $y) - ($tm[1] * $x); + //rotate the coordinate system around ($x,$y) + $this->Transform($tm); + } + + /** + * Skew horizontally. + * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) + * @param float|null $x abscissa of the skewing center. default is current x position + * @param float|null $y ordinate of the skewing center. default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function SkewX($angle_x, $x=null, $y=null) { + $this->Skew($angle_x, 0, $x, $y); + } + + /** + * Skew vertically. + * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) + * @param float|null $x abscissa of the skewing center. default is current x position + * @param float|null $y ordinate of the skewing center. default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function SkewY($angle_y, $x=null, $y=null) { + $this->Skew(0, $angle_y, $x, $y); + } + + /** + * Skew. + * @param float $angle_x angle in degrees between -90 (skew to the left) and 90 (skew to the right) + * @param float $angle_y angle in degrees between -90 (skew to the bottom) and 90 (skew to the top) + * @param float|null $x abscissa of the skewing center. default is current x position + * @param float|null $y ordinate of the skewing center. default is current y position + * @public + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + public function Skew($angle_x, $angle_y, $x=null, $y=null) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + if (($angle_x <= -90) OR ($angle_x >= 90) OR ($angle_y <= -90) OR ($angle_y >= 90)) { + $this->Error('Please use values between -90 and +90 degrees for Skewing.'); + } + $x *= $this->k; + $y = ($this->h - $y) * $this->k; + //calculate elements of transformation matrix + $tm = array(); + $tm[0] = 1; + $tm[1] = tan(deg2rad($angle_y)); + $tm[2] = tan(deg2rad($angle_x)); + $tm[3] = 1; + $tm[4] = -$tm[2] * $y; + $tm[5] = -$tm[1] * $x; + //skew the coordinate system + $this->Transform($tm); + } + + /** + * Apply graphic transformations. + * @param array $tm transformation matrix + * @protected + * @since 2.1.000 (2008-01-07) + * @see StartTransform(), StopTransform() + */ + protected function Transform($tm) { + if ($this->state != 2) { + return; + } + $this->_out(sprintf('%F %F %F %F %F %F cm', $tm[0], $tm[1], $tm[2], $tm[3], $tm[4], $tm[5])); + // add tranformation matrix + $this->transfmatrix[$this->transfmatrix_key][] = array('a' => $tm[0], 'b' => $tm[1], 'c' => $tm[2], 'd' => $tm[3], 'e' => $tm[4], 'f' => $tm[5]); + // update transformation mark + if ($this->inxobj) { + // we are inside an XObject template + if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { + $key = key($this->xobjects[$this->xobjid]['transfmrk']); + $this->xobjects[$this->xobjid]['transfmrk'][$key] = strlen($this->xobjects[$this->xobjid]['outdata']); + } + } elseif (end($this->transfmrk[$this->page]) !== false) { + $key = key($this->transfmrk[$this->page]); + $this->transfmrk[$this->page][$key] = $this->pagelen[$this->page]; + } + } + + // END TRANSFORMATIONS SECTION ------------------------- + + // START GRAPHIC FUNCTIONS SECTION --------------------- + // The following section is based on the code provided by David Hernandez Sanz + + /** + * Defines the line width. By default, the value equals 0.2 mm. The method can be called before the first page is created and the value is retained from page to page. + * @param float $width The width. + * @public + * @since 1.0 + * @see Line(), Rect(), Cell(), MultiCell() + */ + public function setLineWidth($width) { + //Set line width + $this->LineWidth = $width; + $this->linestyleWidth = sprintf('%F w', ($width * $this->k)); + if ($this->state == 2) { + $this->_out($this->linestyleWidth); + } + } + + /** + * Returns the current the line width. + * @return int Line width + * @public + * @since 2.1.000 (2008-01-07) + * @see Line(), SetLineWidth() + */ + public function GetLineWidth() { + return $this->LineWidth; + } + + /** + * Set line style. + * @param array $style Line style. Array with keys among the following: + *
          + *
        • width (float): Width of the line in user units.
        • + *
        • cap (string): Type of cap to put on the line. Possible values are: + * butt, round, square. The difference between "square" and "butt" is that + * "square" projects a flat end past the end of the line.
        • + *
        • join (string): Type of join. Possible values are: miter, round, + * bevel.
        • + *
        • dash (mixed): Dash pattern. Is 0 (without dash) or string with + * series of length values, which are the lengths of the on and off dashes. + * For example: "2" represents 2 on, 2 off, 2 on, 2 off, ...; "2,1" is 2 on, + * 1 off, 2 on, 1 off, ...
        • + *
        • phase (integer): Modifier on the dash pattern which is used to shift + * the point at which the pattern starts.
        • + *
        • color (array): Draw color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName).
        • + *
        + * @param boolean $ret if true do not send the command. + * @return string the PDF command + * @public + * @since 2.1.000 (2008-01-08) + */ + public function setLineStyle($style, $ret=false) { + $s = ''; // string to be returned + if (!is_array($style)) { + return $s; + } + if (isset($style['width'])) { + $this->LineWidth = $style['width']; + $this->linestyleWidth = sprintf('%F w', ($style['width'] * $this->k)); + $s .= $this->linestyleWidth.' '; + } + if (isset($style['cap'])) { + $ca = array('butt' => 0, 'round'=> 1, 'square' => 2); + if (isset($ca[$style['cap']])) { + $this->linestyleCap = $ca[$style['cap']].' J'; + $s .= $this->linestyleCap.' '; + } + } + if (isset($style['join'])) { + $ja = array('miter' => 0, 'round' => 1, 'bevel' => 2); + if (isset($ja[$style['join']])) { + $this->linestyleJoin = $ja[$style['join']].' j'; + $s .= $this->linestyleJoin.' '; + } + } + if (isset($style['dash'])) { + $dash_string = ''; + if ($style['dash']) { + if (preg_match('/^.+,/', $style['dash']) > 0) { + $tab = explode(',', $style['dash']); + } else { + $tab = array($style['dash']); + } + $dash_string = ''; + foreach ($tab as $i => $v) { + if ($i) { + $dash_string .= ' '; + } + $dash_string .= sprintf('%F', $v); + } + } + if (!isset($style['phase']) OR !$style['dash']) { + $style['phase'] = 0; + } + $this->linestyleDash = sprintf('[%s] %F d', $dash_string, $style['phase']); + $s .= $this->linestyleDash.' '; + } + if (isset($style['color'])) { + $s .= $this->setDrawColorArray($style['color'], true).' '; + } + if (!$ret AND ($this->state == 2)) { + $this->_out($s); + } + return $s; + } + + /** + * Begin a new subpath by moving the current point to coordinates (x, y), omitting any connecting line segment. + * @param float $x Abscissa of point. + * @param float $y Ordinate of point. + * @protected + * @since 2.1.000 (2008-01-08) + */ + protected function _outPoint($x, $y) { + if ($this->state == 2) { + $this->_out(sprintf('%F %F m', ($x * $this->k), (($this->h - $y) * $this->k))); + } + } + + /** + * Append a straight line segment from the current point to the point (x, y). + * The new current point shall be (x, y). + * @param float $x Abscissa of end point. + * @param float $y Ordinate of end point. + * @protected + * @since 2.1.000 (2008-01-08) + */ + protected function _outLine($x, $y) { + if ($this->state == 2) { + $this->_out(sprintf('%F %F l', ($x * $this->k), (($this->h - $y) * $this->k))); + } + } + + /** + * Append a rectangle to the current path as a complete subpath, with lower-left corner (x, y) and dimensions widthand height in user space. + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param string $op options + * @protected + * @since 2.1.000 (2008-01-08) + */ + protected function _outRect($x, $y, $w, $h, $op) { + if ($this->state == 2) { + $this->_out(sprintf('%F %F %F %F re %s', ($x * $this->k), (($this->h - $y) * $this->k), ($w * $this->k), (-$h * $this->k), $op)); + } + } + + /** + * Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x2, y2) as the Bezier control points. + * The new current point shall be (x3, y3). + * @param float $x1 Abscissa of control point 1. + * @param float $y1 Ordinate of control point 1. + * @param float $x2 Abscissa of control point 2. + * @param float $y2 Ordinate of control point 2. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. + * @protected + * @since 2.1.000 (2008-01-08) + */ + protected function _outCurve($x1, $y1, $x2, $y2, $x3, $y3) { + if ($this->state == 2) { + $this->_out(sprintf('%F %F %F %F %F %F c', ($x1 * $this->k), (($this->h - $y1) * $this->k), ($x2 * $this->k), (($this->h - $y2) * $this->k), ($x3 * $this->k), (($this->h - $y3) * $this->k))); + } + } + + /** + * Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using the current point and (x2, y2) as the Bezier control points. + * The new current point shall be (x3, y3). + * @param float $x2 Abscissa of control point 2. + * @param float $y2 Ordinate of control point 2. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. + * @protected + * @since 4.9.019 (2010-04-26) + */ + protected function _outCurveV($x2, $y2, $x3, $y3) { + if ($this->state == 2) { + $this->_out(sprintf('%F %F %F %F v', ($x2 * $this->k), (($this->h - $y2) * $this->k), ($x3 * $this->k), (($this->h - $y3) * $this->k))); + } + } + + /** + * Append a cubic Bezier curve to the current path. The curve shall extend from the current point to the point (x3, y3), using (x1, y1) and (x3, y3) as the Bezier control points. + * The new current point shall be (x3, y3). + * @param float $x1 Abscissa of control point 1. + * @param float $y1 Ordinate of control point 1. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. + * @protected + * @since 2.1.000 (2008-01-08) + */ + protected function _outCurveY($x1, $y1, $x3, $y3) { + if ($this->state == 2) { + $this->_out(sprintf('%F %F %F %F y', ($x1 * $this->k), (($this->h - $y1) * $this->k), ($x3 * $this->k), (($this->h - $y3) * $this->k))); + } + } + + /** + * Draws a line between two points. + * @param float $x1 Abscissa of first point. + * @param float $y1 Ordinate of first point. + * @param float $x2 Abscissa of second point. + * @param float $y2 Ordinate of second point. + * @param array $style Line style. Array like for SetLineStyle(). Default value: default line style (empty array). + * @public + * @since 1.0 + * @see SetLineWidth(), SetDrawColor(), SetLineStyle() + */ + public function Line($x1, $y1, $x2, $y2, $style=array()) { + if ($this->state != 2) { + return; + } + if (is_array($style)) { + $this->setLineStyle($style); + } + $this->_outPoint($x1, $y1); + $this->_outLine($x2, $y2); + $this->_out('S'); + } + + /** + * Draws a rectangle. + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $border_style Border style of rectangle. Array with keys among the following: + *
          + *
        • all: Line style of all borders. Array like for SetLineStyle().
        • + *
        • L, T, R, B or combinations: Line style of left, top, right or bottom border. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, the correspondent border is not drawn. Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @public + * @since 1.0 + * @see SetLineStyle() + */ + public function Rect($x, $y, $w, $h, $style='', $border_style=array(), $fill_color=array()) { + if ($this->state != 2) { + return; + } + if (empty($style)) { + $style = 'S'; + } + if (!(strpos($style, 'F') === false) AND !empty($fill_color)) { + // set background color + $this->setFillColorArray($fill_color); + } + if (!empty($border_style)) { + if (isset($border_style['all']) AND !empty($border_style['all'])) { + //set global style for border + $this->setLineStyle($border_style['all']); + $border_style = array(); + } else { + // remove stroke operator from style + $opnostroke = array('S' => '', 'D' => '', 's' => '', 'd' => '', 'B' => 'F', 'FD' => 'F', 'DF' => 'F', 'B*' => 'F*', 'F*D' => 'F*', 'DF*' => 'F*', 'b' => 'f', 'fd' => 'f', 'df' => 'f', 'b*' => 'f*', 'f*d' => 'f*', 'df*' => 'f*' ); + if (isset($opnostroke[$style])) { + $style = $opnostroke[$style]; + } + } + } + if (!empty($style)) { + $op = TCPDF_STATIC::getPathPaintOperator($style); + $this->_outRect($x, $y, $w, $h, $op); + } + if (!empty($border_style)) { + $border_style2 = array(); + foreach ($border_style as $line => $value) { + $length = strlen($line); + for ($i = 0; $i < $length; ++$i) { + $border_style2[$line[$i]] = $value; + } + } + $border_style = $border_style2; + if (isset($border_style['L']) AND $border_style['L']) { + $this->Line($x, $y, $x, $y + $h, $border_style['L']); + } + if (isset($border_style['T']) AND $border_style['T']) { + $this->Line($x, $y, $x + $w, $y, $border_style['T']); + } + if (isset($border_style['R']) AND $border_style['R']) { + $this->Line($x + $w, $y, $x + $w, $y + $h, $border_style['R']); + } + if (isset($border_style['B']) AND $border_style['B']) { + $this->Line($x, $y + $h, $x + $w, $y + $h, $border_style['B']); + } + } + } + + /** + * Draws a Bezier curve. + * The Bezier curve is a tangent to the line between the control points at + * either end of the curve. + * @param float $x0 Abscissa of start point. + * @param float $y0 Ordinate of start point. + * @param float $x1 Abscissa of control point 1. + * @param float $y1 Ordinate of control point 1. + * @param float $x2 Abscissa of control point 2. + * @param float $y2 Ordinate of control point 2. + * @param float $x3 Abscissa of end point. + * @param float $y3 Ordinate of end point. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @public + * @see SetLineStyle() + * @since 2.1.000 (2008-01-08) + */ + public function Curve($x0, $y0, $x1, $y1, $x2, $y2, $x3, $y3, $style='', $line_style=array(), $fill_color=array()) { + if ($this->state != 2) { + return; + } + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); + } + $op = TCPDF_STATIC::getPathPaintOperator($style); + if ($line_style) { + $this->setLineStyle($line_style); + } + $this->_outPoint($x0, $y0); + $this->_outCurve($x1, $y1, $x2, $y2, $x3, $y3); + $this->_out($op); + } + + /** + * Draws a poly-Bezier curve. + * Each Bezier curve segment is a tangent to the line between the control points at + * either end of the curve. + * @param float $x0 Abscissa of start point. + * @param float $y0 Ordinate of start point. + * @param float[] $segments An array of bezier descriptions. Format: array(x1, y1, x2, y2, x3, y3). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of curve. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @public + * @see SetLineStyle() + * @since 3.0008 (2008-05-12) + */ + public function Polycurve($x0, $y0, $segments, $style='', $line_style=array(), $fill_color=array()) { + if ($this->state != 2) { + return; + } + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); + } + $op = TCPDF_STATIC::getPathPaintOperator($style); + if ($op == 'f') { + $line_style = array(); + } + if ($line_style) { + $this->setLineStyle($line_style); + } + $this->_outPoint($x0, $y0); + foreach ($segments as $segment) { + list($x1, $y1, $x2, $y2, $x3, $y3) = $segment; + $this->_outCurve($x1, $y1, $x2, $y2, $x3, $y3); + } + $this->_out($op); + } + + /** + * Draws an ellipse. + * An ellipse is formed from n Bezier curves. + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $rx Horizontal radius. + * @param float $ry Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0. + * @param float $angle Angle oriented (anti-clockwise). Default value: 0. + * @param float $astart Angle start of draw line. Default value: 0. + * @param float $afinish Angle finish of draw line. Default value: 360. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of ellipse. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param integer $nc Number of curves used to draw a 90 degrees portion of ellipse. + * @author Nicola Asuni + * @public + * @since 2.1.000 (2008-01-08) + */ + public function Ellipse($x0, $y0, $rx, $ry=0, $angle=0, $astart=0, $afinish=360, $style='', $line_style=array(), $fill_color=array(), $nc=2) { + if ($this->state != 2) { + return; + } + if (TCPDF_STATIC::empty_string($ry) OR ($ry == 0)) { + $ry = $rx; + } + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); + } + $op = TCPDF_STATIC::getPathPaintOperator($style); + if ($op == 'f') { + $line_style = array(); + } + if ($line_style) { + $this->setLineStyle($line_style); + } + $this->_outellipticalarc($x0, $y0, $rx, $ry, $angle, $astart, $afinish, false, $nc, true, true, false); + $this->_out($op); + } + + /** + * Append an elliptical arc to the current path. + * An ellipse is formed from n Bezier curves. + * @param float $xc Abscissa of center point. + * @param float $yc Ordinate of center point. + * @param float $rx Horizontal radius. + * @param float $ry Vertical radius (if ry = 0 then is a circle, see Circle()). Default value: 0. + * @param float $xang Angle between the X-axis and the major axis of the ellipse. Default value: 0. + * @param float $angs Angle start of draw line. Default value: 0. + * @param float $angf Angle finish of draw line. Default value: 360. + * @param boolean $pie if true do not mark the border point (used to draw pie sectors). + * @param integer $nc Number of curves used to draw a 90 degrees portion of ellipse. + * @param boolean $startpoint if true output a starting point. + * @param boolean $ccw if true draws in counter-clockwise. + * @param boolean $svg if true the angles are in svg mode (already calculated). + * @return array bounding box coordinates (x min, y min, x max, y max) + * @author Nicola Asuni + * @protected + * @since 4.9.019 (2010-04-26) + */ + protected function _outellipticalarc($xc, $yc, $rx, $ry, $xang=0, $angs=0, $angf=360, $pie=false, $nc=2, $startpoint=true, $ccw=true, $svg=false) { + if (($rx <= 0) OR ($ry < 0)) { + return; + } + $k = $this->k; + if ($nc < 2) { + $nc = 2; + } + $xmin = 2147483647; + $ymin = 2147483647; + $xmax = 0; + $ymax = 0; + if ($pie) { + // center of the arc + $this->_outPoint($xc, $yc); + } + $xang = deg2rad((float) $xang); + $angs = deg2rad((float) $angs); + $angf = deg2rad((float) $angf); + if ($svg) { + $as = $angs; + $af = $angf; + } else { + $as = atan2((sin($angs) / $ry), (cos($angs) / $rx)); + $af = atan2((sin($angf) / $ry), (cos($angf) / $rx)); + } + if ($as < 0) { + $as += (2 * M_PI); + } + if ($af < 0) { + $af += (2 * M_PI); + } + if ($ccw AND ($as > $af)) { + // reverse rotation + $as -= (2 * M_PI); + } elseif (!$ccw AND ($as < $af)) { + // reverse rotation + $af -= (2 * M_PI); + } + $total_angle = ($af - $as); + if ($nc < 2) { + $nc = 2; + } + // total arcs to draw + $nc *= (2 * abs($total_angle) / M_PI); + $nc = round($nc) + 1; + // angle of each arc + $arcang = ($total_angle / $nc); + // center point in PDF coordinates + $x0 = $xc; + $y0 = ($this->h - $yc); + // starting angle + $ang = $as; + $alpha = sin($arcang) * ((sqrt(4 + (3 * pow(tan(($arcang) / 2), 2))) - 1) / 3); + $cos_xang = cos($xang); + $sin_xang = sin($xang); + $cos_ang = cos($ang); + $sin_ang = sin($ang); + // first arc point + $px1 = $x0 + ($rx * $cos_xang * $cos_ang) - ($ry * $sin_xang * $sin_ang); + $py1 = $y0 + ($rx * $sin_xang * $cos_ang) + ($ry * $cos_xang * $sin_ang); + // first Bezier control point + $qx1 = ($alpha * ((-$rx * $cos_xang * $sin_ang) - ($ry * $sin_xang * $cos_ang))); + $qy1 = ($alpha * ((-$rx * $sin_xang * $sin_ang) + ($ry * $cos_xang * $cos_ang))); + if ($pie) { + // line from center to arc starting point + $this->_outLine($px1, $this->h - $py1); + } elseif ($startpoint) { + // arc starting point + $this->_outPoint($px1, $this->h - $py1); + } + // draw arcs + for ($i = 1; $i <= $nc; ++$i) { + // starting angle + $ang = $as + ($i * $arcang); + if ($i == $nc) { + $ang = $af; + } + $cos_ang = cos($ang); + $sin_ang = sin($ang); + // second arc point + $px2 = $x0 + ($rx * $cos_xang * $cos_ang) - ($ry * $sin_xang * $sin_ang); + $py2 = $y0 + ($rx * $sin_xang * $cos_ang) + ($ry * $cos_xang * $sin_ang); + // second Bezier control point + $qx2 = ($alpha * ((-$rx * $cos_xang * $sin_ang) - ($ry * $sin_xang * $cos_ang))); + $qy2 = ($alpha * ((-$rx * $sin_xang * $sin_ang) + ($ry * $cos_xang * $cos_ang))); + // draw arc + $cx1 = ($px1 + $qx1); + $cy1 = ($this->h - ($py1 + $qy1)); + $cx2 = ($px2 - $qx2); + $cy2 = ($this->h - ($py2 - $qy2)); + $cx3 = $px2; + $cy3 = ($this->h - $py2); + $this->_outCurve($cx1, $cy1, $cx2, $cy2, $cx3, $cy3); + // get bounding box coordinates + $xmin = min($xmin, $cx1, $cx2, $cx3); + $ymin = min($ymin, $cy1, $cy2, $cy3); + $xmax = max($xmax, $cx1, $cx2, $cx3); + $ymax = max($ymax, $cy1, $cy2, $cy3); + // move to next point + $px1 = $px2; + $py1 = $py2; + $qx1 = $qx2; + $qy1 = $qy2; + } + if ($pie) { + $this->_outLine($xc, $yc); + // get bounding box coordinates + $xmin = min($xmin, $xc); + $ymin = min($ymin, $yc); + $xmax = max($xmax, $xc); + $ymax = max($ymax, $yc); + } + return array($xmin, $ymin, $xmax, $ymax); + } + + /** + * Draws a circle. + * A circle is formed from n Bezier curves. + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r Radius. + * @param float $angstr Angle start of draw line. Default value: 0. + * @param float $angend Angle finish of draw line. Default value: 360. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of circle. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param integer $nc Number of curves used to draw a 90 degrees portion of circle. + * @public + * @since 2.1.000 (2008-01-08) + */ + public function Circle($x0, $y0, $r, $angstr=0, $angend=360, $style='', $line_style=array(), $fill_color=array(), $nc=2) { + $this->Ellipse($x0, $y0, $r, $r, 0, $angstr, $angend, $style, $line_style, $fill_color, $nc); + } + + /** + * Draws a polygonal line + * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of polygon. Array with keys among the following: + *
          + *
        • all: Line style of all lines. Array like for SetLineStyle().
        • + *
        • 0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, not draws the line. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @since 4.8.003 (2009-09-15) + * @public + */ + public function PolyLine($p, $style='', $line_style=array(), $fill_color=array()) { + $this->Polygon($p, $style, $line_style, $fill_color, false); + } + + /** + * Draws a polygon. + * @param array $p Points 0 to ($np - 1). Array with values (x0, y0, x1, y1,..., x(np-1), y(np - 1)) + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of polygon. Array with keys among the following: + *
          + *
        • all: Line style of all lines. Array like for SetLineStyle().
        • + *
        • 0 to ($np - 1): Line style of each line. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, not draws the line. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @param boolean $closed if true the polygon is closes, otherwise will remain open + * @public + * @since 2.1.000 (2008-01-08) + */ + public function Polygon($p, $style='', $line_style=array(), $fill_color=array(), $closed=true) { + if ($this->state != 2) { + return; + } + $nc = count($p); // number of coordinates + $np = $nc / 2; // number of points + if ($closed) { + // close polygon by adding the first 2 points at the end (one line) + for ($i = 0; $i < 4; ++$i) { + $p[$nc + $i] = $p[$i]; + } + // copy style for the last added line + if (isset($line_style[0])) { + $line_style[$np] = $line_style[0]; + } + $nc += 4; + } + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); + } + $op = TCPDF_STATIC::getPathPaintOperator($style); + if ($op == 'f') { + $line_style = array(); + } + $draw = true; + if ($line_style) { + if (isset($line_style['all'])) { + $this->setLineStyle($line_style['all']); + } else { + $draw = false; + if ($op == 'B') { + // draw fill + $op = 'f'; + $this->_outPoint($p[0], $p[1]); + for ($i = 2; $i < $nc; $i = $i + 2) { + $this->_outLine($p[$i], $p[$i + 1]); + } + $this->_out($op); + } + // draw outline + $this->_outPoint($p[0], $p[1]); + for ($i = 2; $i < $nc; $i = $i + 2) { + $line_num = ($i / 2) - 1; + if (isset($line_style[$line_num])) { + if ($line_style[$line_num] != 0) { + if (is_array($line_style[$line_num])) { + $this->_out('S'); + $this->setLineStyle($line_style[$line_num]); + $this->_outPoint($p[$i - 2], $p[$i - 1]); + $this->_outLine($p[$i], $p[$i + 1]); + $this->_out('S'); + $this->_outPoint($p[$i], $p[$i + 1]); + } else { + $this->_outLine($p[$i], $p[$i + 1]); + } + } + } else { + $this->_outLine($p[$i], $p[$i + 1]); + } + } + $this->_out($op); + } + } + if ($draw) { + $this->_outPoint($p[0], $p[1]); + for ($i = 2; $i < $nc; $i = $i + 2) { + $this->_outLine($p[$i], $p[$i + 1]); + } + $this->_out($op); + } + } + + /** + * Draws a regular polygon. + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r Radius of inscribed circle. + * @param integer $ns Number of sides. + * @param float $angle Angle oriented (anti-clockwise). Default value: 0. + * @param boolean $draw_circle Draw inscribed circle or not. Default value: false. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of polygon sides. Array with keys among the following: + *
          + *
        • all: Line style of all sides. Array like for SetLineStyle().
        • + *
        • 0 to ($ns - 1): Line style of each side. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, not draws the side. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: + *
          + *
        • D or empty string: Draw (default).
        • + *
        • F: Fill.
        • + *
        • DF or FD: Draw and fill.
        • + *
        • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
        • + *
        • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
        • + *
        + * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). + * @public + * @since 2.1.000 (2008-01-08) + */ + public function RegularPolygon($x0, $y0, $r, $ns, $angle=0, $draw_circle=false, $style='', $line_style=array(), $fill_color=array(), $circle_style='', $circle_outLine_style=array(), $circle_fill_color=array()) { + if (3 > $ns) { + $ns = 3; + } + if ($draw_circle) { + $this->Circle($x0, $y0, $r, 0, 360, $circle_style, $circle_outLine_style, $circle_fill_color); + } + $p = array(); + for ($i = 0; $i < $ns; ++$i) { + $a = $angle + ($i * 360 / $ns); + $a_rad = deg2rad((float) $a); + $p[] = $x0 + ($r * sin($a_rad)); + $p[] = $y0 + ($r * cos($a_rad)); + } + $this->Polygon($p, $style, $line_style, $fill_color); + } + + /** + * Draws a star polygon + * @param float $x0 Abscissa of center point. + * @param float $y0 Ordinate of center point. + * @param float $r Radius of inscribed circle. + * @param integer $nv Number of vertices. + * @param integer $ng Number of gap (if ($ng % $nv = 1) then is a regular polygon). + * @param float $angle Angle oriented (anti-clockwise). Default value: 0. + * @param boolean $draw_circle Draw inscribed circle or not. Default value is false. + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $line_style Line style of polygon sides. Array with keys among the following: + *
          + *
        • all: Line style of all sides. Array like for + * SetLineStyle().
        • + *
        • 0 to (n - 1): Line style of each side. Array like for SetLineStyle().
        • + *
        + * If a key is not present or is null, not draws the side. Default value is default line style (empty array). + * @param array $fill_color Fill color. Format: array(red, green, blue). Default value: default color (empty array). + * @param string $circle_style Style of rendering of inscribed circle (if draws). Possible values are: + *
          + *
        • D or empty string: Draw (default).
        • + *
        • F: Fill.
        • + *
        • DF or FD: Draw and fill.
        • + *
        • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
        • + *
        • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
        • + *
        + * @param array $circle_outLine_style Line style of inscribed circle (if draws). Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $circle_fill_color Fill color of inscribed circle (if draws). Format: array(red, green, blue). Default value: default color (empty array). + * @public + * @since 2.1.000 (2008-01-08) + */ + public function StarPolygon($x0, $y0, $r, $nv, $ng, $angle=0, $draw_circle=false, $style='', $line_style=array(), $fill_color=array(), $circle_style='', $circle_outLine_style=array(), $circle_fill_color=array()) { + if ($nv < 2) { + $nv = 2; + } + if ($draw_circle) { + $this->Circle($x0, $y0, $r, 0, 360, $circle_style, $circle_outLine_style, $circle_fill_color); + } + $p2 = array(); + $visited = array(); + for ($i = 0; $i < $nv; ++$i) { + $a = $angle + ($i * 360 / $nv); + $a_rad = deg2rad((float) $a); + $p2[] = $x0 + ($r * sin($a_rad)); + $p2[] = $y0 + ($r * cos($a_rad)); + $visited[] = false; + } + $p = array(); + $i = 0; + do { + $p[] = $p2[$i * 2]; + $p[] = $p2[($i * 2) + 1]; + $visited[$i] = true; + $i += $ng; + $i %= $nv; + } while (!$visited[$i]); + $this->Polygon($p, $style, $line_style, $fill_color); + } + + /** + * Draws a rounded rectangle. + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param float $r the radius of the circle used to round off the corners of the rectangle. + * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111"). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $border_style Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @public + * @since 2.1.000 (2008-01-08) + */ + public function RoundedRect($x, $y, $w, $h, $r, $round_corner='1111', $style='', $border_style=array(), $fill_color=array()) { + $this->RoundedRectXY($x, $y, $w, $h, $r, $r, $round_corner, $style, $border_style, $fill_color); + } + + /** + * Draws a rounded rectangle. + * @param float $x Abscissa of upper-left corner. + * @param float $y Ordinate of upper-left corner. + * @param float $w Width. + * @param float $h Height. + * @param float $rx the x-axis radius of the ellipse used to round off the corners of the rectangle. + * @param float $ry the y-axis radius of the ellipse used to round off the corners of the rectangle. + * @param string $round_corner Draws rounded corner or not. String with a 0 (not rounded i-corner) or 1 (rounded i-corner) in i-position. Positions are, in order and begin to 0: top right, bottom right, bottom left and top left. Default value: all rounded corner ("1111"). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param array $border_style Border style of rectangle. Array like for SetLineStyle(). Default value: default line style (empty array). + * @param array $fill_color Fill color. Format: array(GREY) or array(R,G,B) or array(C,M,Y,K) or array(C,M,Y,K,SpotColorName). Default value: default color (empty array). + * @public + * @since 4.9.019 (2010-04-22) + */ + public function RoundedRectXY($x, $y, $w, $h, $rx, $ry, $round_corner='1111', $style='', $border_style=array(), $fill_color=array()) { + if ($this->state != 2) { + return; + } + if (($round_corner == '0000') OR (($rx == $ry) AND ($rx == 0))) { + // Not rounded + $this->Rect($x, $y, $w, $h, $style, $border_style, $fill_color); + return; + } + // Rounded + if (!(false === strpos($style, 'F')) AND is_array($fill_color)) { + $this->setFillColorArray($fill_color); + } + $op = TCPDF_STATIC::getPathPaintOperator($style); + if ($op == 'f') { + $border_style = array(); + } + if ($border_style) { + $this->setLineStyle($border_style); + } + $MyArc = 4 / 3 * (sqrt(2) - 1); + $this->_outPoint($x + $rx, $y); + $xc = $x + $w - $rx; + $yc = $y + $ry; + $this->_outLine($xc, $y); + if ($round_corner[0]) { + $this->_outCurve($xc + ($rx * $MyArc), $yc - $ry, $xc + $rx, $yc - ($ry * $MyArc), $xc + $rx, $yc); + } else { + $this->_outLine($x + $w, $y); + } + $xc = $x + $w - $rx; + $yc = $y + $h - $ry; + $this->_outLine($x + $w, $yc); + if ($round_corner[1]) { + $this->_outCurve($xc + $rx, $yc + ($ry * $MyArc), $xc + ($rx * $MyArc), $yc + $ry, $xc, $yc + $ry); + } else { + $this->_outLine($x + $w, $y + $h); + } + $xc = $x + $rx; + $yc = $y + $h - $ry; + $this->_outLine($xc, $y + $h); + if ($round_corner[2]) { + $this->_outCurve($xc - ($rx * $MyArc), $yc + $ry, $xc - $rx, $yc + ($ry * $MyArc), $xc - $rx, $yc); + } else { + $this->_outLine($x, $y + $h); + } + $xc = $x + $rx; + $yc = $y + $ry; + $this->_outLine($x, $yc); + if ($round_corner[3]) { + $this->_outCurve($xc - $rx, $yc - ($ry * $MyArc), $xc - ($rx * $MyArc), $yc - $ry, $xc, $yc - $ry); + } else { + $this->_outLine($x, $y); + $this->_outLine($x + $rx, $y); + } + $this->_out($op); + } + + /** + * Draws a grahic arrow. + * @param float $x0 Abscissa of first point. + * @param float $y0 Ordinate of first point. + * @param float $x1 Abscissa of second point. + * @param float $y1 Ordinate of second point. + * @param int $head_style (0 = draw only arrowhead arms, 1 = draw closed arrowhead, but no fill, 2 = closed and filled arrowhead, 3 = filled arrowhead) + * @param float $arm_size length of arrowhead arms + * @param int $arm_angle angle between an arm and the shaft + * @author Piotr Galecki, Nicola Asuni, Andy Meier + * @since 4.6.018 (2009-07-10) + */ + public function Arrow($x0, $y0, $x1, $y1, $head_style=0, $arm_size=5, $arm_angle=15) { + // getting arrow direction angle + // 0 deg angle is when both arms go along X axis. angle grows clockwise. + $dir_angle = atan2(($y0 - $y1), ($x0 - $x1)); + if ($dir_angle < 0) { + $dir_angle += (2 * M_PI); + } + $arm_angle = deg2rad($arm_angle); + $sx1 = $x1; + $sy1 = $y1; + if ($head_style > 0) { + // calculate the stopping point for the arrow shaft + $sx1 = $x1 + (($arm_size - $this->LineWidth) * cos($dir_angle)); + $sy1 = $y1 + (($arm_size - $this->LineWidth) * sin($dir_angle)); + } + // main arrow line / shaft + $this->Line($x0, $y0, $sx1, $sy1); + // left arrowhead arm tip + $x2L = $x1 + ($arm_size * cos($dir_angle + $arm_angle)); + $y2L = $y1 + ($arm_size * sin($dir_angle + $arm_angle)); + // right arrowhead arm tip + $x2R = $x1 + ($arm_size * cos($dir_angle - $arm_angle)); + $y2R = $y1 + ($arm_size * sin($dir_angle - $arm_angle)); + $mode = 'D'; + $style = array(); + switch ($head_style) { + case 0: { + // draw only arrowhead arms + $mode = 'D'; + $style = array(1, 1, 0); + break; + } + case 1: { + // draw closed arrowhead, but no fill + $mode = 'D'; + break; + } + case 2: { + // closed and filled arrowhead + $mode = 'DF'; + break; + } + case 3: { + // filled arrowhead + $mode = 'F'; + break; + } + } + $this->Polygon(array($x2L, $y2L, $x1, $y1, $x2R, $y2R), $mode, $style, array()); + } + + // END GRAPHIC FUNCTIONS SECTION ----------------------- + + /** + * Add a Named Destination. + * NOTE: destination names are unique, so only last entry will be saved. + * @param string $name Destination name. + * @param float $y Y position in user units of the destiantion on the selected page (default = -1 = current position; 0 = page start;). + * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. + * @param float $x X position in user units of the destiantion on the selected page (default = -1 = current position;). + * @return string|false Stripped named destination identifier or false in case of error. + * @public + * @author Christian Deligant, Nicola Asuni + * @since 5.9.097 (2011-06-23) + */ + public function setDestination($name, $y=-1, $page='', $x=-1) { + // remove unsupported characters + $name = TCPDF_STATIC::encodeNameObject($name); + if (TCPDF_STATIC::empty_string($name)) { + return false; + } + if ($y == -1) { + $y = $this->GetY(); + } elseif ($y < 0) { + $y = 0; + } elseif ($y > $this->h) { + $y = $this->h; + } + if ($x == -1) { + $x = $this->GetX(); + } elseif ($x < 0) { + $x = 0; + } elseif ($x > $this->w) { + $x = $this->w; + } + $fixed = false; + if (!empty($page) AND (substr($page, 0, 1) == '*')) { + $page = intval(substr($page, 1)); + // this page number will not be changed when moving/add/deleting pages + $fixed = true; + } + if (empty($page)) { + $page = $this->PageNo(); + if (empty($page)) { + return; + } + } + $this->dests[$name] = array('x' => $x, 'y' => $y, 'p' => $page, 'f' => $fixed); + return $name; + } + + /** + * Return the Named Destination array. + * @return array Named Destination array. + * @public + * @author Nicola Asuni + * @since 5.9.097 (2011-06-23) + */ + public function getDestination() { + return $this->dests; + } + + /** + * Insert Named Destinations. + * @protected + * @author Johannes G\FCntert, Nicola Asuni + * @since 5.9.098 (2011-06-23) + */ + protected function _putdests() { + if (empty($this->dests)) { + return; + } + $this->n_dests = $this->_newobj(); + $out = ' <<'; + foreach($this->dests as $name => $o) { + $out .= ' /'.$name.' '.sprintf('[%u 0 R /XYZ %F %F null]', $this->page_obj_id[($o['p'])], ($o['x'] * $this->k), ($this->pagedim[$o['p']]['h'] - ($o['y'] * $this->k))); + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + + /** + * Adds a bookmark - alias for Bookmark(). + * @param string $txt Bookmark description. + * @param int $level Bookmark level (minimum value is 0). + * @param float $y Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;). + * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. + * @param string $style Font style: B = Bold, I = Italic, BI = Bold + Italic. + * @param array $color RGB color array (values from 0 to 255). + * @param float $x X position in user units of the bookmark on the selected page (default = -1 = current position;). + * @param mixed $link URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name). + * @public + */ + public function setBookmark($txt, $level=0, $y=-1, $page='', $style='', $color=array(0,0,0), $x=-1, $link='') { + $this->Bookmark($txt, $level, $y, $page, $style, $color, $x, $link); + } + + /** + * Adds a bookmark. + * @param string $txt Bookmark description. + * @param int $level Bookmark level (minimum value is 0). + * @param float $y Y position in user units of the bookmark on the selected page (default = -1 = current position; 0 = page start;). + * @param int|string $page Target page number (leave empty for current page). If you prefix a page number with the * character, then this page will not be changed when adding/deleting/moving pages. + * @param string $style Font style: B = Bold, I = Italic, BI = Bold + Italic. + * @param array $color RGB color array (values from 0 to 255). + * @param float $x X position in user units of the bookmark on the selected page (default = -1 = current position;). + * @param mixed $link URL, or numerical link ID, or named destination (# character followed by the destination name), or embedded file (* character followed by the file name). + * @public + * @since 2.1.002 (2008-02-12) + */ + public function Bookmark($txt, $level=0, $y=-1, $page='', $style='', $color=array(0,0,0), $x=-1, $link='') { + if ($level < 0) { + $level = 0; + } + if (isset($this->outlines[0])) { + $lastoutline = end($this->outlines); + $maxlevel = $lastoutline['l'] + 1; + } else { + $maxlevel = 0; + } + if ($level > $maxlevel) { + $level = $maxlevel; + } + if ($y == -1) { + $y = $this->GetY(); + } elseif ($y < 0) { + $y = 0; + } elseif ($y > $this->h) { + $y = $this->h; + } + if ($x == -1) { + $x = $this->GetX(); + } elseif ($x < 0) { + $x = 0; + } elseif ($x > $this->w) { + $x = $this->w; + } + $fixed = false; + $pageAsString = (string) $page; + if ($pageAsString && $pageAsString[0] == '*') { + $page = intval(substr($page, 1)); + // this page number will not be changed when moving/add/deleting pages + $fixed = true; + } + if (empty($page)) { + $page = $this->PageNo(); + if (empty($page)) { + return; + } + } + $this->outlines[] = array('t' => $txt, 'l' => $level, 'x' => $x, 'y' => $y, 'p' => $page, 'f' => $fixed, 's' => strtoupper($style), 'c' => $color, 'u' => $link); + } + + /** + * Sort bookmarks for page and key. + * @protected + * @since 5.9.119 (2011-09-19) + */ + protected function sortBookmarks() { + // get sorting columns + $outline_p = array(); + $outline_y = array(); + foreach ($this->outlines as $key => $row) { + $outline_p[$key] = $row['p']; + $outline_k[$key] = $key; + } + // sort outlines by page and original position + array_multisort($outline_p, SORT_NUMERIC, SORT_ASC, $outline_k, SORT_NUMERIC, SORT_ASC, $this->outlines); + } + + /** + * Create a bookmark PDF string. + * @protected + * @author Olivier Plathey, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ + protected function _putbookmarks() { + $nb = count($this->outlines); + if ($nb == 0) { + return; + } + // sort bookmarks + $this->sortBookmarks(); + $lru = array(); + $level = 0; + foreach ($this->outlines as $i => $o) { + if ($o['l'] > 0) { + $parent = $lru[($o['l'] - 1)]; + //Set parent and last pointers + $this->outlines[$i]['parent'] = $parent; + $this->outlines[$parent]['last'] = $i; + if ($o['l'] > $level) { + //Level increasing: set first pointer + $this->outlines[$parent]['first'] = $i; + } + } else { + $this->outlines[$i]['parent'] = $nb; + } + if (($o['l'] <= $level) AND ($i > 0)) { + //Set prev and next pointers + $prev = $lru[$o['l']]; + $this->outlines[$prev]['next'] = $i; + $this->outlines[$i]['prev'] = $prev; + } + $lru[$o['l']] = $i; + $level = $o['l']; + } + //Outline items + $n = $this->n + 1; + $nltags = '/|<\/(blockquote|dd|dl|div|dt|h1|h2|h3|h4|h5|h6|hr|li|ol|p|pre|ul|tcpdf|table|tr|td)>/si'; + foreach ($this->outlines as $i => $o) { + $oid = $this->_newobj(); + // covert HTML title to string + $title = preg_replace($nltags, "\n", $o['t']); + $title = preg_replace("/[\r]+/si", '', $title); + $title = preg_replace("/[\n]+/si", "\n", $title); + $title = strip_tags($title); + $title = $this->stringTrim($title); + $out = '<_textstring($title, $oid); + $out .= ' /Parent '.($n + $o['parent']).' 0 R'; + if (isset($o['prev'])) { + $out .= ' /Prev '.($n + $o['prev']).' 0 R'; + } + if (isset($o['next'])) { + $out .= ' /Next '.($n + $o['next']).' 0 R'; + } + if (isset($o['first'])) { + $out .= ' /First '.($n + $o['first']).' 0 R'; + } + if (isset($o['last'])) { + $out .= ' /Last '.($n + $o['last']).' 0 R'; + } + if (isset($o['u']) AND !empty($o['u'])) { + // link + if (is_string($o['u'])) { + if ($o['u'][0] == '#') { + // internal destination + $out .= ' /Dest /'.TCPDF_STATIC::encodeNameObject(substr($o['u'], 1)); + } elseif ($o['u'][0] == '%') { + // embedded PDF file + $filename = basename(substr($o['u'], 1)); + $out .= ' /A <embeddedfiles[$filename]['a'].' >> >>'; + } elseif ($o['u'][0] == '*') { + // embedded generic file + $filename = basename(substr($o['u'], 1)); + $jsa = 'var D=event.target.doc;var MyData=D.dataObjects;for (var i in MyData) if (MyData[i].path=="'.$filename.'") D.exportDataObject( { cName : MyData[i].name, nLaunch : 2});'; + $out .= ' /A <_textstring($jsa, $oid).'>>'; + } else { + // external URI link + $out .= ' /A <_datastring($this->unhtmlentities($o['u']), $oid).'>>'; + } + } elseif (isset($this->links[$o['u']])) { + // internal link ID + $l = $this->links[$o['u']]; + if (isset($this->page_obj_id[($l['p'])])) { + $out .= sprintf(' /Dest [%u 0 R /XYZ 0 %F null]', $this->page_obj_id[($l['p'])], ($this->pagedim[$l['p']]['h'] - ($l['y'] * $this->k))); + } + } + } elseif (isset($this->page_obj_id[($o['p'])])) { + // link to a page + $out .= ' '.sprintf('/Dest [%u 0 R /XYZ %F %F null]', $this->page_obj_id[($o['p'])], ($o['x'] * $this->k), ($this->pagedim[$o['p']]['h'] - ($o['y'] * $this->k))); + } + // set font style + $style = 0; + if (!empty($o['s'])) { + // bold + if (strpos($o['s'], 'B') !== false) { + $style |= 2; + } + // oblique + if (strpos($o['s'], 'I') !== false) { + $style |= 1; + } + } + $out .= sprintf(' /F %d', $style); + // set bookmark color + if (isset($o['c']) AND is_array($o['c']) AND (count($o['c']) == 3)) { + $color = array_values($o['c']); + $out .= sprintf(' /C [%F %F %F]', ($color[0] / 255), ($color[1] / 255), ($color[2] / 255)); + } else { + // black + $out .= ' /C [0.0 0.0 0.0]'; + } + $out .= ' /Count 0'; // normally closed item + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + //Outline root + $this->OutlineRoot = $this->_newobj(); + $this->_out('<< /Type /Outlines /First '.$n.' 0 R /Last '.($n + $lru[0]).' 0 R >>'."\n".'endobj'); + } + + // --- JAVASCRIPT ------------------------------------------------------ + + /** + * Adds a javascript + * @param string $script Javascript code + * @public + * @author Johannes G\FCntert, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ + public function IncludeJS($script) { + $this->javascript .= $script; + } + + /** + * Adds a javascript object and return object ID + * @param string $script Javascript code + * @param boolean $onload if true executes this object when opening the document + * @return int internal object ID + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ + public function addJavascriptObject($script, $onload=false) { + if ($this->pdfa_mode) { + // javascript is not allowed in PDF/A mode + return false; + } + ++$this->n; + $this->js_objects[$this->n] = array('n' => $this->n, 'js' => $script, 'onload' => $onload); + return $this->n; + } + + /** + * Create a javascript PDF string. + * @protected + * @author Johannes G\FCntert, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ + protected function _putjavascript() { + if ($this->pdfa_mode OR (empty($this->javascript) AND empty($this->js_objects))) { + return; + } + if (strpos($this->javascript, 'this.addField') > 0) { + if (!$this->ur['enabled']) { + //$this->setUserRights(); + } + // the following two lines are used to avoid form fields duplication after saving + // The addField method only works when releasing user rights (UR3) + $jsa = sprintf("ftcpdfdocsaved=this.addField('%s','%s',%d,[%F,%F,%F,%F]);", 'tcpdfdocsaved', 'text', 0, 0, 1, 0, 1); + $jsb = "getField('tcpdfdocsaved').value='saved';"; + $this->javascript = $jsa."\n".$this->javascript."\n".$jsb; + } + // name tree for javascript + $this->n_js = '<< /Names ['; + if (!empty($this->javascript)) { + $this->n_js .= ' (EmbeddedJS) '.($this->n + 1).' 0 R'; + } + if (!empty($this->js_objects)) { + foreach ($this->js_objects as $key => $val) { + if ($val['onload']) { + $this->n_js .= ' (JS'.$key.') '.$key.' 0 R'; + } + } + } + $this->n_js .= ' ] >>'; + // default Javascript object + if (!empty($this->javascript)) { + $obj_id = $this->_newobj(); + $out = '<< /S /JavaScript'; + $out .= ' /JS '.$this->_textstring($this->javascript, $obj_id); + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + // additional Javascript objects + if (!empty($this->js_objects)) { + foreach ($this->js_objects as $key => $val) { + $out = $this->_getobj($key)."\n".' << /S /JavaScript /JS '.$this->_textstring($val['js'], $key).' >>'."\n".'endobj'; + $this->_out($out); + } + } + } + + /** + * Adds a javascript form field. + * @param string $type field type + * @param string $name field name + * @param int $x horizontal position + * @param int $y vertical position + * @param int $w width + * @param int $h height + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @protected + * @author Denis Van Nuffelen, Nicola Asuni + * @since 2.1.002 (2008-02-12) + */ + protected function _addfield($type, $name, $x, $y, $w, $h, $prop) { + if ($this->rtl) { + $x = $x - $w; + } + // the followind avoid fields duplication after saving the document + $this->javascript .= "if (getField('tcpdfdocsaved').value != 'saved') {"; + $k = $this->k; + $this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%u,[%F,%F,%F,%F]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n"; + $this->javascript .= 'f'.$name.'.textSize='.$this->FontSizePt.";\n"; + foreach($prop as $key => $val) { + if (strcmp(substr($key, -5), 'Color') == 0) { + $val = TCPDF_COLORS::_JScolor($val); + } else { + $val = "'".$val."'"; + } + $this->javascript .= 'f'.$name.'.'.$key.'='.$val.";\n"; + } + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; + } + $this->javascript .= '}'; + } + + // --- FORM FIELDS ----------------------------------------------------- + + + + /** + * Set default properties for form fields. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + */ + public function setFormDefaultProp($prop=array()) { + $this->default_form_prop = $prop; + } + + /** + * Return the default properties for form fields. + * @return array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-06) + */ + public function getFormDefaultProp() { + return $this->default_form_prop; + } + + /** + * Creates a text field + * @param string $name field name + * @param float $w Width of the rectangle + * @param float $h Height of the rectangle + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ + public function TextField($name, $w, $h, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + if ($js) { + $this->_addfield('text', $name, $x, $y, $w, $h, $prop); + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + // get annotation data + $popt = TCPDF_STATIC::getAnnotOptFromJSProp($prop, $this->spot_colors, $this->rtl); + // set default appearance stream + $this->annotation_fonts[$this->CurrentFont['fontkey']] = $this->CurrentFont['i']; + $fontstyle = sprintf('/F%d %F Tf %s', $this->CurrentFont['i'], $this->FontSizePt, $this->TextColor); + $popt['da'] = $fontstyle; + // build appearance stream + $popt['ap'] = array(); + $popt['ap']['n'] = '/Tx BMC q '.$fontstyle.' '; + $text = ''; + if (isset($prop['value']) AND !empty($prop['value'])) { + $text = $prop['value']; + } elseif (isset($opt['v']) AND !empty($opt['v'])) { + $text = $opt['v']; + } + $tmpid = $this->startTemplate($w, $h, false); + $align = ''; + if (isset($popt['q'])) { + switch ($popt['q']) { + case 0: { + $align = 'L'; + break; + } + case 1: { + $align = 'C'; + break; + } + case 2: { + $align = 'R'; + break; + } + default: { + $align = ''; + break; + } + } + } + $this->MultiCell($w, $h, $text, 0, $align, false, 0, 0, 0, true, 0, false, true, 0, 'T', false); + $this->endTemplate(); + --$this->n; + $popt['ap']['n'] .= $this->xobjects[$tmpid]['outdata']; + unset($this->xobjects[$tmpid]); + $popt['ap']['n'] .= 'Q EMC'; + // merge options + $opt = array_merge($popt, $opt); + // remove some conflicting options + unset($opt['bs']); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Tx'; + $opt['t'] = $name; + // Additional annotation's parameters (check _putannotsobj() method): + //$opt['f'] + //$opt['as'] + //$opt['bs'] + //$opt['be'] + //$opt['c'] + //$opt['border'] + //$opt['h'] + //$opt['mk']; + //$opt['mk']['r'] + //$opt['mk']['bc']; + //$opt['mk']['bg']; + unset($opt['mk']['ca']); + unset($opt['mk']['rc']); + unset($opt['mk']['ac']); + unset($opt['mk']['i']); + unset($opt['mk']['ri']); + unset($opt['mk']['ix']); + unset($opt['mk']['if']); + //$opt['mk']['if']['sw']; + //$opt['mk']['if']['s']; + //$opt['mk']['if']['a']; + //$opt['mk']['if']['fb']; + unset($opt['mk']['tp']); + //$opt['tu'] + //$opt['tm'] + //$opt['ff'] + //$opt['v'] + //$opt['dv'] + //$opt['a'] + //$opt['aa'] + //$opt['q'] + $this->Annotation($x, $y, $w, $h, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; + } + } + + /** + * Creates a RadioButton field. + * @param string $name Field name. + * @param int $w Width of the radio button. + * @param array $prop Javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt Annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param string $onvalue Value to be returned if selected. + * @param boolean $checked Define the initial state. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js If true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ + public function RadioButton($name, $w, $prop=array(), $opt=array(), $onvalue='On', $checked=false, $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($w, $x, $y); + if ($js) { + $this->_addfield('radiobutton', $name, $x, $y, $w, $w, $prop); + return; + } + if (TCPDF_STATIC::empty_string($onvalue)) { + $onvalue = 'On'; + } + if ($checked) { + $defval = $onvalue; + } else { + $defval = 'Off'; + } + // set font + $font = 'zapfdingbats'; + if ($this->pdfa_mode) { + // all fonts must be embedded + $font = 'pdfa'.$font; + } + $this->AddFont($font); + $tmpfont = $this->getFontBuffer($font); + // set data for parent group + if (!isset($this->radiobutton_groups[$this->page])) { + $this->radiobutton_groups[$this->page] = array(); + } + if (!isset($this->radiobutton_groups[$this->page][$name])) { + $this->radiobutton_groups[$this->page][$name] = array(); + ++$this->n; + $this->radiobutton_groups[$this->page][$name]['n'] = $this->n; + $this->radio_groups[] = $this->n; + } + $kid = ($this->n + 1); + // save object ID to be added on Kids entry on parent object + $this->radiobutton_groups[$this->page][$name][] = array('kid' => $kid, 'def' => $defval); + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + $prop['NoToggleToOff'] = 'true'; + $prop['Radio'] = 'true'; + $prop['borderStyle'] = 'inset'; + // get annotation data + $popt = TCPDF_STATIC::getAnnotOptFromJSProp($prop, $this->spot_colors, $this->rtl); + // set additional default options + $this->annotation_fonts[$tmpfont['fontkey']] = $tmpfont['i']; + $fontstyle = sprintf('/F%d %F Tf %s', $tmpfont['i'], $this->FontSizePt, $this->TextColor); + $popt['da'] = $fontstyle; + // build appearance stream + $popt['ap'] = array(); + $popt['ap']['n'] = array(); + $fx = ((($w - $this->getAbsFontMeasure($tmpfont['cw'][108])) / 2) * $this->k); + $fy = (($w - ((($tmpfont['desc']['Ascent'] - $tmpfont['desc']['Descent']) * $this->FontSizePt / 1000) / $this->k)) * $this->k); + $popt['ap']['n'][$onvalue] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(108).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, $fx, $fy); + $popt['ap']['n']['Off'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(109).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, $fx, $fy); + if (!isset($popt['mk'])) { + $popt['mk'] = array(); + } + $popt['mk']['ca'] = '(l)'; + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Btn'; + if ($checked) { + $opt['v'] = array('/'.$onvalue); + $opt['as'] = $onvalue; + } else { + $opt['as'] = 'Off'; + } + // store readonly flag + if (!isset($this->radiobutton_groups[$this->page][$name]['#readonly#'])) { + $this->radiobutton_groups[$this->page][$name]['#readonly#'] = false; + } + $this->radiobutton_groups[$this->page][$name]['#readonly#'] |= ($opt['f'] & 64); + $this->Annotation($x, $y, $w, $w, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; + } + } + + /** + * Creates a List-box field + * @param string $name field name + * @param int $w width + * @param int $h height + * @param array $values array containing the list of values. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ + public function ListBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + if ($js) { + $this->_addfield('listbox', $name, $x, $y, $w, $h, $prop); + $s = ''; + foreach ($values as $value) { + if (is_array($value)) { + $s .= ',[\''.addslashes($value[1]).'\',\''.addslashes($value[0]).'\']'; + } else { + $s .= ',[\''.addslashes($value).'\',\''.addslashes($value).'\']'; + } + } + $this->javascript .= 'f'.$name.'.setItems('.substr($s, 1).');'."\n"; + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + // get annotation data + $popt = TCPDF_STATIC::getAnnotOptFromJSProp($prop, $this->spot_colors, $this->rtl); + // set additional default values + $this->annotation_fonts[$this->CurrentFont['fontkey']] = $this->CurrentFont['i']; + $fontstyle = sprintf('/F%d %F Tf %s', $this->CurrentFont['i'], $this->FontSizePt, $this->TextColor); + $popt['da'] = $fontstyle; + // build appearance stream + $popt['ap'] = array(); + $popt['ap']['n'] = '/Tx BMC q '.$fontstyle.' '; + $text = ''; + foreach($values as $item) { + if (is_array($item)) { + $text .= $item[1]."\n"; + } else { + $text .= $item."\n"; + } + } + $tmpid = $this->startTemplate($w, $h, false); + $this->MultiCell($w, $h, $text, 0, '', false, 0, 0, 0, true, 0, false, true, 0, 'T', false); + $this->endTemplate(); + --$this->n; + $popt['ap']['n'] .= $this->xobjects[$tmpid]['outdata']; + unset($this->xobjects[$tmpid]); + $popt['ap']['n'] .= 'Q EMC'; + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Ch'; + $opt['t'] = $name; + $opt['opt'] = $values; + unset($opt['mk']['ca']); + unset($opt['mk']['rc']); + unset($opt['mk']['ac']); + unset($opt['mk']['i']); + unset($opt['mk']['ri']); + unset($opt['mk']['ix']); + unset($opt['mk']['if']); + unset($opt['mk']['tp']); + $this->Annotation($x, $y, $w, $h, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; + } + } + + /** + * Creates a Combo-box field + * @param string $name field name + * @param int $w width + * @param int $h height + * @param array $values array containing the list of values. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ + public function ComboBox($name, $w, $h, $values, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + if ($js) { + $this->_addfield('combobox', $name, $x, $y, $w, $h, $prop); + $s = ''; + foreach ($values as $value) { + if (is_array($value)) { + $s .= ',[\''.addslashes($value[1]).'\',\''.addslashes($value[0]).'\']'; + } else { + $s .= ',[\''.addslashes($value).'\',\''.addslashes($value).'\']'; + } + } + $this->javascript .= 'f'.$name.'.setItems('.substr($s, 1).');'."\n"; + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + $prop['Combo'] = true; + // get annotation data + $popt = TCPDF_STATIC::getAnnotOptFromJSProp($prop, $this->spot_colors, $this->rtl); + // set additional default options + $this->annotation_fonts[$this->CurrentFont['fontkey']] = $this->CurrentFont['i']; + $fontstyle = sprintf('/F%d %F Tf %s', $this->CurrentFont['i'], $this->FontSizePt, $this->TextColor); + $popt['da'] = $fontstyle; + // build appearance stream + $popt['ap'] = array(); + $popt['ap']['n'] = '/Tx BMC q '.$fontstyle.' '; + $text = ''; + foreach($values as $item) { + if (is_array($item)) { + $text .= $item[1]."\n"; + } else { + $text .= $item."\n"; + } + } + $tmpid = $this->startTemplate($w, $h, false); + $this->MultiCell($w, $h, $text, 0, '', false, 0, 0, 0, true, 0, false, true, 0, 'T', false); + $this->endTemplate(); + --$this->n; + $popt['ap']['n'] .= $this->xobjects[$tmpid]['outdata']; + unset($this->xobjects[$tmpid]); + $popt['ap']['n'] .= 'Q EMC'; + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Ch'; + $opt['t'] = $name; + $opt['opt'] = $values; + unset($opt['mk']['ca']); + unset($opt['mk']['rc']); + unset($opt['mk']['ac']); + unset($opt['mk']['i']); + unset($opt['mk']['ri']); + unset($opt['mk']['ix']); + unset($opt['mk']['if']); + unset($opt['mk']['tp']); + $this->Annotation($x, $y, $w, $h, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; + } + } + + /** + * Creates a CheckBox field + * @param string $name field name + * @param int $w width + * @param boolean $checked define the initial state. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param string $onvalue value to be returned if selected. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ + public function CheckBox($name, $w, $checked=false, $prop=array(), $opt=array(), $onvalue='Yes', $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($w, $x, $y); + if ($js) { + $this->_addfield('checkbox', $name, $x, $y, $w, $w, $prop); + return; + } + if (!isset($prop['value'])) { + $prop['value'] = array('Yes'); + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + $prop['borderStyle'] = 'inset'; + // get annotation data + $popt = TCPDF_STATIC::getAnnotOptFromJSProp($prop, $this->spot_colors, $this->rtl); + // set additional default options + $font = 'zapfdingbats'; + if ($this->pdfa_mode) { + // all fonts must be embedded + $font = 'pdfa'.$font; + } + $this->AddFont($font); + $tmpfont = $this->getFontBuffer($font); + $this->annotation_fonts[$tmpfont['fontkey']] = $tmpfont['i']; + $fontstyle = sprintf('/F%d %F Tf %s', $tmpfont['i'], $this->FontSizePt, $this->TextColor); + $popt['da'] = $fontstyle; + // build appearance stream + $popt['ap'] = array(); + $popt['ap']['n'] = array(); + $fx = ((($w - $this->getAbsFontMeasure($tmpfont['cw'][110])) / 2) * $this->k); + $fy = (($w - ((($tmpfont['desc']['Ascent'] - $tmpfont['desc']['Descent']) * $this->FontSizePt / 1000) / $this->k)) * $this->k); + $popt['ap']['n']['Yes'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(110).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, $fx, $fy); + $popt['ap']['n']['Off'] = sprintf('q %s BT /F%d %F Tf %F %F Td ('.chr(111).') Tj ET Q', $this->TextColor, $tmpfont['i'], $this->FontSizePt, $fx, $fy); + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Btn'; + $opt['t'] = $name; + if (TCPDF_STATIC::empty_string($onvalue)) { + $onvalue = 'Yes'; + } + $opt['opt'] = array($onvalue); + if ($checked) { + $opt['v'] = array('/Yes'); + $opt['as'] = 'Yes'; + } else { + $opt['v'] = array('/Off'); + $opt['as'] = 'Off'; + } + $this->Annotation($x, $y, $w, $w, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; + } + } + + /** + * Creates a button field + * @param string $name field name + * @param int $w width + * @param int $h height + * @param string $caption caption. + * @param mixed $action action triggered by pressing the button. Use a string to specify a javascript action. Use an array to specify a form action options as on section 12.7.5 of PDF32000_2008. + * @param array $prop javascript field properties. Possible values are described on official Javascript for Acrobat API reference. + * @param array $opt annotation parameters. Possible values are described on official PDF32000_2008 reference. + * @param float|null $x Abscissa of the upper-left corner of the rectangle + * @param float|null $y Ordinate of the upper-left corner of the rectangle + * @param boolean $js if true put the field using JavaScript (requires Acrobat Writer to be rendered). + * @public + * @author Nicola Asuni + * @since 4.8.000 (2009-09-07) + */ + public function Button($name, $w, $h, $caption, $action, $prop=array(), $opt=array(), $x=null, $y=null, $js=false) { + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + if ($js) { + $this->_addfield('button', $name, $this->x, $this->y, $w, $h, $prop); + $this->javascript .= 'f'.$name.".buttonSetCaption('".addslashes($caption)."');\n"; + $this->javascript .= 'f'.$name.".setAction('MouseUp','".addslashes($action)."');\n"; + $this->javascript .= 'f'.$name.".highlight='push';\n"; + $this->javascript .= 'f'.$name.".print=false;\n"; + return; + } + // get default style + $prop = array_merge($this->getFormDefaultProp(), $prop); + $prop['Pushbutton'] = 'true'; + $prop['highlight'] = 'push'; + $prop['display'] = 'display.noPrint'; + // get annotation data + $popt = TCPDF_STATIC::getAnnotOptFromJSProp($prop, $this->spot_colors, $this->rtl); + $this->annotation_fonts[$this->CurrentFont['fontkey']] = $this->CurrentFont['i']; + $fontstyle = sprintf('/F%d %F Tf %s', $this->CurrentFont['i'], $this->FontSizePt, $this->TextColor); + $popt['da'] = $fontstyle; + // build appearance stream + $popt['ap'] = array(); + $popt['ap']['n'] = '/Tx BMC q '.$fontstyle.' '; + $tmpid = $this->startTemplate($w, $h, false); + $bw = (2 / $this->k); // border width + $border = array( + 'L' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(231)), + 'R' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(51)), + 'T' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(231)), + 'B' => array('width' => $bw, 'cap' => 'square', 'join' => 'miter', 'dash' => 0, 'color' => array(51))); + $this->setFillColor(204); + $this->Cell($w, $h, $caption, $border, 0, 'C', true, '', 1, false, 'T', 'M'); + $this->endTemplate(); + --$this->n; + $popt['ap']['n'] .= $this->xobjects[$tmpid]['outdata']; + unset($this->xobjects[$tmpid]); + $popt['ap']['n'] .= 'Q EMC'; + // set additional default options + if (!isset($popt['mk'])) { + $popt['mk'] = array(); + } + $ann_obj_id = ($this->n + 1); + if (!empty($action) AND !is_array($action)) { + $ann_obj_id = ($this->n + 2); + } + $popt['mk']['ca'] = $this->_textstring($caption, $ann_obj_id); + $popt['mk']['rc'] = $this->_textstring($caption, $ann_obj_id); + $popt['mk']['ac'] = $this->_textstring($caption, $ann_obj_id); + // merge options + $opt = array_merge($popt, $opt); + // set remaining annotation data + $opt['Subtype'] = 'Widget'; + $opt['ft'] = 'Btn'; + $opt['t'] = $caption; + $opt['v'] = $name; + if (!empty($action)) { + if (is_array($action)) { + // form action options as on section 12.7.5 of PDF32000_2008. + $opt['aa'] = '/D <<'; + $bmode = array('SubmitForm', 'ResetForm', 'ImportData'); + foreach ($action AS $key => $val) { + if (($key == 'S') AND in_array($val, $bmode)) { + $opt['aa'] .= ' /S /'.$val; + } elseif (($key == 'F') AND (!empty($val))) { + $opt['aa'] .= ' /F '.$this->_datastring($val, $ann_obj_id); + } elseif (($key == 'Fields') AND is_array($val) AND !empty($val)) { + $opt['aa'] .= ' /Fields ['; + foreach ($val AS $field) { + $opt['aa'] .= ' '.$this->_textstring($field, $ann_obj_id); + } + $opt['aa'] .= ']'; + } elseif (($key == 'Flags')) { + $ff = 0; + if (is_array($val)) { + foreach ($val AS $flag) { + switch ($flag) { + case 'Include/Exclude': { + $ff += 1 << 0; + break; + } + case 'IncludeNoValueFields': { + $ff += 1 << 1; + break; + } + case 'ExportFormat': { + $ff += 1 << 2; + break; + } + case 'GetMethod': { + $ff += 1 << 3; + break; + } + case 'SubmitCoordinates': { + $ff += 1 << 4; + break; + } + case 'XFDF': { + $ff += 1 << 5; + break; + } + case 'IncludeAppendSaves': { + $ff += 1 << 6; + break; + } + case 'IncludeAnnotations': { + $ff += 1 << 7; + break; + } + case 'SubmitPDF': { + $ff += 1 << 8; + break; + } + case 'CanonicalFormat': { + $ff += 1 << 9; + break; + } + case 'ExclNonUserAnnots': { + $ff += 1 << 10; + break; + } + case 'ExclFKey': { + $ff += 1 << 11; + break; + } + case 'EmbedForm': { + $ff += 1 << 13; + break; + } + } + } + } else { + $ff = intval($val); + } + $opt['aa'] .= ' /Flags '.$ff; + } + } + $opt['aa'] .= ' >>'; + } else { + // Javascript action or raw action command + $js_obj_id = $this->addJavascriptObject($action); + $opt['aa'] = '/D '.$js_obj_id.' 0 R'; + } + } + $this->Annotation($x, $y, $w, $h, $name, $opt, 0); + if ($this->rtl) { + $this->x -= $w; + } else { + $this->x += $w; + } + } + + // --- END FORMS FIELDS ------------------------------------------------ + + /** + * Add certification signature (DocMDP or UR3) + * You can set only one signature type + * @protected + * @author Nicola Asuni + * @since 4.6.008 (2009-05-07) + */ + protected function _putsignature() { + if ((!$this->sign) OR (!isset($this->signature_data['cert_type']))) { + return; + } + $sigobjid = ($this->sig_obj_id + 1); + $out = $this->_getobj($sigobjid)."\n"; + $out .= '<< /Type /Sig'; + $out .= ' /Filter /Adobe.PPKLite'; + $out .= ' /SubFilter /adbe.pkcs7.detached'; + $out .= ' '.TCPDF_STATIC::$byterange_string; + $out .= ' /Contents<'.str_repeat('0', $this->signature_max_length).'>'; + if (empty($this->signature_data['approval']) OR ($this->signature_data['approval'] != 'A')) { + $out .= ' /Reference ['; // array of signature reference dictionaries + $out .= ' << /Type /SigRef'; + if ($this->signature_data['cert_type'] > 0) { + $out .= ' /TransformMethod /DocMDP'; + $out .= ' /TransformParams <<'; + $out .= ' /Type /TransformParams'; + $out .= ' /P '.$this->signature_data['cert_type']; + $out .= ' /V /1.2'; + } else { + $out .= ' /TransformMethod /UR3'; + $out .= ' /TransformParams <<'; + $out .= ' /Type /TransformParams'; + $out .= ' /V /2.2'; + if (!TCPDF_STATIC::empty_string($this->ur['document'])) { + $out .= ' /Document['.$this->ur['document'].']'; + } + if (!TCPDF_STATIC::empty_string($this->ur['form'])) { + $out .= ' /Form['.$this->ur['form'].']'; + } + if (!TCPDF_STATIC::empty_string($this->ur['signature'])) { + $out .= ' /Signature['.$this->ur['signature'].']'; + } + if (!TCPDF_STATIC::empty_string($this->ur['annots'])) { + $out .= ' /Annots['.$this->ur['annots'].']'; + } + if (!TCPDF_STATIC::empty_string($this->ur['ef'])) { + $out .= ' /EF['.$this->ur['ef'].']'; + } + if (!TCPDF_STATIC::empty_string($this->ur['formex'])) { + $out .= ' /FormEX['.$this->ur['formex'].']'; + } + } + $out .= ' >>'; // close TransformParams + // optional digest data (values must be calculated and replaced later) + //$out .= ' /Data ********** 0 R'; + //$out .= ' /DigestMethod/MD5'; + //$out .= ' /DigestLocation[********** 34]'; + //$out .= ' /DigestValue<********************************>'; + $out .= ' >>'; + $out .= ' ]'; // end of reference + } + if (isset($this->signature_data['info']['Name']) AND !TCPDF_STATIC::empty_string($this->signature_data['info']['Name'])) { + $out .= ' /Name '.$this->_textstring($this->signature_data['info']['Name'], $sigobjid); + } + if (isset($this->signature_data['info']['Location']) AND !TCPDF_STATIC::empty_string($this->signature_data['info']['Location'])) { + $out .= ' /Location '.$this->_textstring($this->signature_data['info']['Location'], $sigobjid); + } + if (isset($this->signature_data['info']['Reason']) AND !TCPDF_STATIC::empty_string($this->signature_data['info']['Reason'])) { + $out .= ' /Reason '.$this->_textstring($this->signature_data['info']['Reason'], $sigobjid); + } + if (isset($this->signature_data['info']['ContactInfo']) AND !TCPDF_STATIC::empty_string($this->signature_data['info']['ContactInfo'])) { + $out .= ' /ContactInfo '.$this->_textstring($this->signature_data['info']['ContactInfo'], $sigobjid); + } + $out .= ' /M '.$this->_datestring($sigobjid, $this->doc_modification_timestamp); + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + + /** + * Set User's Rights for PDF Reader + * WARNING: This is experimental and currently do not work. + * Check the PDF Reference 8.7.1 Transform Methods, + * Table 8.105 Entries in the UR transform parameters dictionary + * @param boolean $enable if true enable user's rights on PDF reader + * @param string $document Names specifying additional document-wide usage rights for the document. The only defined value is "/FullSave", which permits a user to save the document along with modified form and/or annotation data. + * @param string $annots Names specifying additional annotation-related usage rights for the document. Valid names in PDF 1.5 and later are /Create/Delete/Modify/Copy/Import/Export, which permit the user to perform the named operation on annotations. + * @param string $form Names specifying additional form-field-related usage rights for the document. Valid names are: /Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate + * @param string $signature Names specifying additional signature-related usage rights for the document. The only defined value is /Modify, which permits a user to apply a digital signature to an existing signature form field or clear a signed signature form field. + * @param string $ef Names specifying additional usage rights for named embedded files in the document. Valid names are /Create/Delete/Modify/Import, which permit the user to perform the named operation on named embedded files + Names specifying additional embedded-files-related usage rights for the document. + * @param string $formex Names specifying additional form-field-related usage rights. The only valid name is BarcodePlaintext, which permits text form field data to be encoded as a plaintext two-dimensional barcode. + * @public + * @author Nicola Asuni + * @since 2.9.000 (2008-03-26) + */ + public function setUserRights( + $enable=true, + $document='/FullSave', + $annots='/Create/Delete/Modify/Copy/Import/Export', + $form='/Add/Delete/FillIn/Import/Export/SubmitStandalone/SpawnTemplate', + $signature='/Modify', + $ef='/Create/Delete/Modify/Import', + $formex='') { + $this->ur['enabled'] = $enable; + $this->ur['document'] = $document; + $this->ur['annots'] = $annots; + $this->ur['form'] = $form; + $this->ur['signature'] = $signature; + $this->ur['ef'] = $ef; + $this->ur['formex'] = $formex; + if (!$this->sign) { + $this->setSignature('', '', '', '', 0, array()); + } + } + + /** + * Enable document signature (requires the OpenSSL Library). + * The digital signature improve document authenticity and integrity and allows o enable extra features on Acrobat Reader. + * To create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt + * To export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 + * To convert pfx certificate to pem: openssl pkcs12 -in tcpdf.pfx -out tcpdf.crt -nodes + * @param mixed $signing_cert signing certificate (string or filename prefixed with 'file://') + * @param mixed $private_key private key (string or filename prefixed with 'file://') + * @param string $private_key_password password + * @param string $extracerts specifies the name of a file containing a bunch of extra certificates to include in the signature which can for example be used to help the recipient to verify the certificate that you used. + * @param int $cert_type The access permissions granted for this document. Valid values shall be: 1 = No changes to the document shall be permitted; any change to the document shall invalidate the signature; 2 = Permitted changes shall be filling in forms, instantiating page templates, and signing; other changes shall invalidate the signature; 3 = Permitted changes shall be the same as for 2, as well as annotation creation, deletion, and modification; other changes shall invalidate the signature. + * @param array $info array of option information: Name, Location, Reason, ContactInfo. + * @param string $approval Enable approval signature eg. for PDF incremental update + * @public + * @author Nicola Asuni + * @since 4.6.005 (2009-04-24) + */ + public function setSignature($signing_cert='', $private_key='', $private_key_password='', $extracerts='', $cert_type=2, $info=array(), $approval='') { + // to create self-signed signature: openssl req -x509 -nodes -days 365000 -newkey rsa:1024 -keyout tcpdf.crt -out tcpdf.crt + // to export crt to p12: openssl pkcs12 -export -in tcpdf.crt -out tcpdf.p12 + // to convert pfx certificate to pem: openssl + // OpenSSL> pkcs12 -in -out -nodes + $this->sign = true; + ++$this->n; + $this->sig_obj_id = $this->n; // signature widget + ++$this->n; // signature object ($this->sig_obj_id + 1) + $this->signature_data = array(); + if (strlen($signing_cert) == 0) { + $this->Error('Please provide a certificate file and password!'); + } + if (strlen($private_key) == 0) { + $private_key = $signing_cert; + } + $this->signature_data['signcert'] = $signing_cert; + $this->signature_data['privkey'] = $private_key; + $this->signature_data['password'] = $private_key_password; + $this->signature_data['extracerts'] = $extracerts; + $this->signature_data['cert_type'] = $cert_type; + $this->signature_data['info'] = $info; + $this->signature_data['approval'] = $approval; + } + + /** + * Set the digital signature appearance (a cliccable rectangle area to get signature properties) + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the signature area. + * @param float $h Height of the signature area. + * @param int $page option page number (if < 0 the current page is used). + * @param string $name Name of the signature. + * @public + * @author Nicola Asuni + * @since 5.3.011 (2010-06-17) + */ + public function setSignatureAppearance($x=0, $y=0, $w=0, $h=0, $page=-1, $name='') { + $this->signature_appearance = $this->getSignatureAppearanceArray($x, $y, $w, $h, $page, $name); + } + + /** + * Add an empty digital signature appearance (a cliccable rectangle area to get signature properties) + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the signature area. + * @param float $h Height of the signature area. + * @param int $page option page number (if < 0 the current page is used). + * @param string $name Name of the signature. + * @public + * @author Nicola Asuni + * @since 5.9.101 (2011-07-06) + */ + public function addEmptySignatureAppearance($x=0, $y=0, $w=0, $h=0, $page=-1, $name='') { + ++$this->n; + $this->empty_signature_appearance[] = array('objid' => $this->n) + $this->getSignatureAppearanceArray($x, $y, $w, $h, $page, $name); + } + + /** + * Get the array that defines the signature appearance (page and rectangle coordinates). + * @param float $x Abscissa of the upper-left corner. + * @param float $y Ordinate of the upper-left corner. + * @param float $w Width of the signature area. + * @param float $h Height of the signature area. + * @param int $page option page number (if < 0 the current page is used). + * @param string $name Name of the signature. + * @return array Array defining page and rectangle coordinates of signature appearance. + * @protected + * @author Nicola Asuni + * @since 5.9.101 (2011-07-06) + */ + protected function getSignatureAppearanceArray($x=0, $y=0, $w=0, $h=0, $page=-1, $name='') { + $sigapp = array(); + if (($page < 1) OR ($page > $this->numpages)) { + $sigapp['page'] = $this->page; + } else { + $sigapp['page'] = intval($page); + } + if (empty($name)) { + $sigapp['name'] = 'Signature'; + } else { + $sigapp['name'] = $name; + } + $a = $x * $this->k; + $b = $this->pagedim[($sigapp['page'])]['h'] - (($y + $h) * $this->k); + $c = $w * $this->k; + $d = $h * $this->k; + $sigapp['rect'] = sprintf('%F %F %F %F', $a, $b, ($a + $c), ($b + $d)); + return $sigapp; + } + + /** + * Enable document timestamping (requires the OpenSSL Library). + * The trusted timestamping improve document security that means that no one should be able to change the document once it has been recorded. + * Use with digital signature only! + * @param string $tsa_host Time Stamping Authority (TSA) server (prefixed with 'https://') + * @param string $tsa_username Specifies the username for TSA authorization (optional) OR specifies the TSA authorization PEM file (see: example_66.php, optional) + * @param string $tsa_password Specifies the password for TSA authorization (optional) + * @param string $tsa_cert Specifies the location of TSA certificate for authorization (optional for cURL) + * @public + * @author Richard Stockinger + * @since 6.0.090 (2014-06-16) + */ + public function setTimeStamp($tsa_host='', $tsa_username='', $tsa_password='', $tsa_cert='') { + $this->tsa_data = array(); + if (!function_exists('curl_init')) { + $this->Error('Please enable cURL PHP extension!'); + } + if (strlen($tsa_host) == 0) { + $this->Error('Please specify the host of Time Stamping Authority (TSA)!'); + } + $this->tsa_data['tsa_host'] = $tsa_host; + if (is_file($tsa_username)) { + $this->tsa_data['tsa_auth'] = $tsa_username; + } else { + $this->tsa_data['tsa_username'] = $tsa_username; + } + $this->tsa_data['tsa_password'] = $tsa_password; + $this->tsa_data['tsa_cert'] = $tsa_cert; + $this->tsa_timestamp = true; + } + + /** + * NOT YET IMPLEMENTED + * Request TSA for a timestamp + * @param string $signature Digital signature as binary string + * @return string Timestamped digital signature + * @protected + * @author Richard Stockinger + * @since 6.0.090 (2014-06-16) + */ + protected function applyTSA($signature) { + if (!$this->tsa_timestamp) { + return $signature; + } + //@TODO: implement this feature + return $signature; + } + + /** + * Create a new page group. + * NOTE: call this function before calling AddPage() + * @param int|null $page starting group page (leave empty for next page). + * @public + * @since 3.0.000 (2008-03-27) + */ + public function startPageGroup($page=null) { + if (empty($page)) { + $page = $this->page + 1; + } + $this->newpagegroup[$page] = sizeof($this->newpagegroup) + 1; + } + + /** + * Set the starting page number. + * @param int $num Starting page number. + * @since 5.9.093 (2011-06-16) + * @public + */ + public function setStartingPageNumber($num=1) { + $this->starting_page_number = max(0, intval($num)); + } + + /** + * Returns the string alias used right align page numbers. + * If the current font is unicode type, the returned string wil contain an additional open curly brace. + * @return string + * @since 5.9.099 (2011-06-27) + * @public + */ + public function getAliasRightShift() { + // calculate aproximatively the ratio between widths of aliases and replacements. + $ref = '{'.TCPDF_STATIC::$alias_right_shift.'}{'.TCPDF_STATIC::$alias_tot_pages.'}{'.TCPDF_STATIC::$alias_num_page.'}'; + $rep = str_repeat(' ', $this->GetNumChars($ref)); + $wrep = $this->GetStringWidth($rep); + if ($wrep > 0) { + $wdiff = max(1, ($this->GetStringWidth($ref) / $wrep)); + } else { + $wdiff = 1; + } + $sdiff = sprintf('%F', $wdiff); + $alias = TCPDF_STATIC::$alias_right_shift.$sdiff.'}'; + if ($this->isUnicodeFont()) { + $alias = '{'.$alias; + } + return $alias; + } + + /** + * Returns the string alias used for the total number of pages. + * If the current font is unicode type, the returned string is surrounded by additional curly braces. + * This alias will be replaced by the total number of pages in the document. + * @return string + * @since 4.0.018 (2008-08-08) + * @public + */ + public function getAliasNbPages() { + if ($this->isUnicodeFont()) { + return '{'.TCPDF_STATIC::$alias_tot_pages.'}'; + } + return TCPDF_STATIC::$alias_tot_pages; + } + + /** + * Returns the string alias used for the page number. + * If the current font is unicode type, the returned string is surrounded by additional curly braces. + * This alias will be replaced by the page number. + * @return string + * @since 4.5.000 (2009-01-02) + * @public + */ + public function getAliasNumPage() { + if ($this->isUnicodeFont()) { + return '{'.TCPDF_STATIC::$alias_num_page.'}'; + } + return TCPDF_STATIC::$alias_num_page; + } + + /** + * Return the alias for the total number of pages in the current page group. + * If the current font is unicode type, the returned string is surrounded by additional curly braces. + * This alias will be replaced by the total number of pages in this group. + * @return string alias of the current page group + * @public + * @since 3.0.000 (2008-03-27) + */ + public function getPageGroupAlias() { + if ($this->isUnicodeFont()) { + return '{'.TCPDF_STATIC::$alias_group_tot_pages.'}'; + } + return TCPDF_STATIC::$alias_group_tot_pages; + } + + /** + * Return the alias for the page number on the current page group. + * If the current font is unicode type, the returned string is surrounded by additional curly braces. + * This alias will be replaced by the page number (relative to the belonging group). + * @return string alias of the current page group + * @public + * @since 4.5.000 (2009-01-02) + */ + public function getPageNumGroupAlias() { + if ($this->isUnicodeFont()) { + return '{'.TCPDF_STATIC::$alias_group_num_page.'}'; + } + return TCPDF_STATIC::$alias_group_num_page; + } + + /** + * Return the current page in the group. + * @return int current page in the group + * @public + * @since 3.0.000 (2008-03-27) + */ + public function getGroupPageNo() { + return $this->pagegroups[$this->currpagegroup]; + } + + /** + * Returns the current group page number formatted as a string. + * @public + * @since 4.3.003 (2008-11-18) + * @see PaneNo(), formatPageNumber() + */ + public function getGroupPageNoFormatted() { + return TCPDF_STATIC::formatPageNumber($this->getGroupPageNo()); + } + + /** + * Returns the current page number formatted as a string. + * @public + * @since 4.2.005 (2008-11-06) + * @see PaneNo(), formatPageNumber() + */ + public function PageNoFormatted() { + return TCPDF_STATIC::formatPageNumber($this->PageNo()); + } + + /** + * Put pdf layers. + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected function _putocg() { + if (empty($this->pdflayers)) { + return; + } + foreach ($this->pdflayers as $key => $layer) { + $this->pdflayers[$key]['objid'] = $this->_newobj(); + $out = '<< /Type /OCG'; + $out .= ' /Name '.$this->_textstring($layer['name'], $this->pdflayers[$key]['objid']); + $out .= ' /Usage <<'; + if (isset($layer['print']) AND ($layer['print'] !== NULL)) { + $out .= ' /Print <>'; + } + $out .= ' /View <>'; + $out .= ' >> >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + + /** + * Start a new pdf layer. + * @param string $name Layer name (only a-z letters and numbers). Leave empty for automatic name. + * @param boolean|null $print Set to TRUE to print this layer, FALSE to not print and NULL to not set this option + * @param boolean $view Set to true to view this layer. + * @param boolean $lock If true lock the layer + * @public + * @since 5.9.102 (2011-07-13) + */ + public function startLayer($name='', $print=true, $view=true, $lock=true) { + if ($this->state != 2) { + return; + } + $layer = sprintf('LYR%03d', (count($this->pdflayers) + 1)); + if (empty($name)) { + $name = $layer; + } else { + $name = preg_replace('/[^a-zA-Z0-9_\-]/', '', $name); + } + $this->pdflayers[] = array('layer' => $layer, 'name' => $name, 'print' => $print, 'view' => $view, 'lock' => $lock); + $this->openMarkedContent = true; + $this->_out('/OC /'.$layer.' BDC'); + } + + /** + * End the current PDF layer. + * @public + * @since 5.9.102 (2011-07-13) + */ + public function endLayer() { + if ($this->state != 2) { + return; + } + if ($this->openMarkedContent) { + // close existing open marked-content layer + $this->_out('EMC'); + $this->openMarkedContent = false; + } + } + + /** + * Set the visibility of the successive elements. + * This can be useful, for instance, to put a background + * image or color that will show on screen but won't print. + * @param string $v visibility mode. Legal values are: all, print, screen or view. + * @public + * @since 3.0.000 (2008-03-27) + */ + public function setVisibility($v) { + if ($this->state != 2) { + return; + } + $this->endLayer(); + switch($v) { + case 'print': { + $this->startLayer('Print', true, false); + break; + } + case 'view': + case 'screen': { + $this->startLayer('View', false, true); + break; + } + case 'all': { + $this->_out(''); + break; + } + default: { + $this->Error('Incorrect visibility: '.$v); + break; + } + } + } + + /** + * Add transparency parameters to the current extgstate + * @param array $parms parameters + * @return int|void the number of extgstates + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected function addExtGState($parms) { + if ($this->pdfa_mode || $this->pdfa_version >= 2) { + // transparencies are not allowed in PDF/A mode + return; + } + // check if this ExtGState already exist + foreach ($this->extgstates as $i => $ext) { + if ($ext['parms'] == $parms) { + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['extgstates'][$i] = $ext; + } + // return reference to existing ExtGState + return $i; + } + } + $n = (count($this->extgstates) + 1); + $this->extgstates[$n] = array('parms' => $parms); + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['extgstates'][$n] = $this->extgstates[$n]; + } + return $n; + } + + /** + * Add an extgstate + * @param int $gs extgstate + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected function setExtGState($gs) { + if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) { + // transparency is not allowed in PDF/A-1 mode + return; + } + $this->_out(sprintf('/GS%d gs', $gs)); + } + + /** + * Put extgstates for object transparency + * @protected + * @since 3.0.000 (2008-03-27) + */ + protected function _putextgstates() { + foreach ($this->extgstates as $i => $ext) { + $this->extgstates[$i]['n'] = $this->_newobj(); + $out = '<< /Type /ExtGState'; + foreach ($ext['parms'] as $k => $v) { + if (is_float($v)) { + $v = sprintf('%F', $v); + } elseif ($v === true) { + $v = 'true'; + } elseif ($v === false) { + $v = 'false'; + } + $out .= ' /'.$k.' '.$v; + } + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + + /** + * Set overprint mode for stroking (OP) and non-stroking (op) painting operations. + * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). + * @param boolean $stroking If true apply overprint for stroking operations. + * @param boolean|null $nonstroking If true apply overprint for painting operations other than stroking. + * @param integer $mode Overprint mode: (0 = each source colour component value replaces the value previously painted for the corresponding device colorant; 1 = a tint value of 0.0 for a source colour component shall leave the corresponding component of the previously painted colour unchanged). + * @public + * @since 5.9.152 (2012-03-23) + */ + public function setOverprint($stroking=true, $nonstroking=null, $mode=0) { + if ($this->state != 2) { + return; + } + $stroking = $stroking ? true : false; + if (TCPDF_STATIC::empty_string($nonstroking)) { + // default value if not set + $nonstroking = $stroking; + } else { + $nonstroking = $nonstroking ? true : false; + } + if (($mode != 0) AND ($mode != 1)) { + $mode = 0; + } + $this->overprint = array('OP' => $stroking, 'op' => $nonstroking, 'OPM' => $mode); + $gs = $this->addExtGState($this->overprint); + $this->setExtGState($gs); + } + + /** + * Get the overprint mode array (OP, op, OPM). + * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). + * @return array + * @public + * @since 5.9.152 (2012-03-23) + */ + public function getOverprint() { + return $this->overprint; + } + + /** + * Set alpha for stroking (CA) and non-stroking (ca) operations. + * @param float $stroking Alpha value for stroking operations: real value from 0 (transparent) to 1 (opaque). + * @param string $bm blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity + * @param float|null $nonstroking Alpha value for non-stroking operations: real value from 0 (transparent) to 1 (opaque). + * @param boolean $ais + * @public + * @since 3.0.000 (2008-03-27) + */ + public function setAlpha($stroking=1, $bm='Normal', $nonstroking=null, $ais=false) { + if ($this->pdfa_mode && $this->pdfa_version < 2) { + // transparency is not allowed in PDF/A-1 mode + return; + } + $stroking = floatval($stroking); + if (TCPDF_STATIC::empty_string($nonstroking)) { + // default value if not set + $nonstroking = $stroking; + } else { + $nonstroking = floatval($nonstroking); + } + if ($bm[0] == '/') { + // remove trailing slash + $bm = substr($bm, 1); + } + if (!in_array($bm, array('Normal', 'Multiply', 'Screen', 'Overlay', 'Darken', 'Lighten', 'ColorDodge', 'ColorBurn', 'HardLight', 'SoftLight', 'Difference', 'Exclusion', 'Hue', 'Saturation', 'Color', 'Luminosity'))) { + $bm = 'Normal'; + } + $ais = $ais ? true : false; + $this->alpha = array('CA' => $stroking, 'ca' => $nonstroking, 'BM' => '/'.$bm, 'AIS' => $ais); + $gs = $this->addExtGState($this->alpha); + $this->setExtGState($gs); + } + + /** + * Get the alpha mode array (CA, ca, BM, AIS). + * (Check the "Entries in a Graphics State Parameter Dictionary" on PDF 32000-1:2008). + * @return array + * @public + * @since 5.9.152 (2012-03-23) + */ + public function getAlpha() { + return $this->alpha; + } + + /** + * Set the default JPEG compression quality (1-100) + * @param int $quality JPEG quality, integer between 1 and 100 + * @public + * @since 3.0.000 (2008-03-27) + */ + public function setJPEGQuality($quality) { + if (($quality < 1) OR ($quality > 100)) { + $quality = 75; + } + $this->jpeg_quality = intval($quality); + } + + /** + * Set the default number of columns in a row for HTML tables. + * @param int $cols number of columns + * @public + * @since 3.0.014 (2008-06-04) + */ + public function setDefaultTableColumns($cols=4) { + $this->default_table_columns = intval($cols); + } + + /** + * Set the height of the cell (line height) respect the font height. + * @param float $h cell proportion respect font height (typical value = 1.25). + * @public + * @since 3.0.014 (2008-06-04) + */ + public function setCellHeightRatio($h) { + $this->cell_height_ratio = $h; + } + + /** + * return the height of cell repect font height. + * @public + * @return float + * @since 4.0.012 (2008-07-24) + */ + public function getCellHeightRatio() { + return $this->cell_height_ratio; + } + + /** + * Set the PDF version (check PDF reference for valid values). + * @param string $version PDF document version. + * @public + * @since 3.1.000 (2008-06-09) + */ + public function setPDFVersion($version='1.7') { + if ($this->pdfa_mode && $this->pdfa_version == 1 ) { + // PDF/A-1 mode + $this->PDFVersion = '1.4'; + } elseif ($this->pdfa_mode && $this->pdfa_version >= 2 ) { + // PDF/A-2 mode + $this->PDFVersion = '1.7'; + } else { + $this->PDFVersion = $version; + } + } + + /** + * Set the viewer preferences dictionary controlling the way the document is to be presented on the screen or in print. + * (see Section 8.1 of PDF reference, "Viewer Preferences"). + *
        • HideToolbar boolean (Optional) A flag specifying whether to hide the viewer application's tool bars when the document is active. Default value: false.
        • HideMenubar boolean (Optional) A flag specifying whether to hide the viewer application's menu bar when the document is active. Default value: false.
        • HideWindowUI boolean (Optional) A flag specifying whether to hide user interface elements in the document's window (such as scroll bars and navigation controls), leaving only the document's contents displayed. Default value: false.
        • FitWindow boolean (Optional) A flag specifying whether to resize the document's window to fit the size of the first displayed page. Default value: false.
        • CenterWindow boolean (Optional) A flag specifying whether to position the document's window in the center of the screen. Default value: false.
        • DisplayDocTitle boolean (Optional; PDF 1.4) A flag specifying whether the window's title bar should display the document title taken from the Title entry of the document information dictionary (see Section 10.2.1, "Document Information Dictionary"). If false, the title bar should instead display the name of the PDF file containing the document. Default value: false.
        • NonFullScreenPageMode name (Optional) The document's page mode, specifying how to display the document on exiting full-screen mode:
          • UseNone Neither document outline nor thumbnail images visible
          • UseOutlines Document outline visible
          • UseThumbs Thumbnail images visible
          • UseOC Optional content group panel visible
          This entry is meaningful only if the value of the PageMode entry in the catalog dictionary (see Section 3.6.1, "Document Catalog") is FullScreen; it is ignored otherwise. Default value: UseNone.
        • ViewArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be displayed when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:
          • MediaBox
          • CropBox (default)
          • BleedBox
          • TrimBox
          • ArtBox
        • ViewClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when viewing the document on the screen. Valid values are (see Section 10.10.1, "Page Boundaries").:
          • MediaBox
          • CropBox (default)
          • BleedBox
          • TrimBox
          • ArtBox
        • PrintArea name (Optional; PDF 1.4) The name of the page boundary representing the area of a page to be rendered when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:
          • MediaBox
          • CropBox (default)
          • BleedBox
          • TrimBox
          • ArtBox
        • PrintClip name (Optional; PDF 1.4) The name of the page boundary to which the contents of a page are to be clipped when printing the document. Valid values are (see Section 10.10.1, "Page Boundaries").:
          • MediaBox
          • CropBox (default)
          • BleedBox
          • TrimBox
          • ArtBox
        • PrintScaling name (Optional; PDF 1.6) The page scaling option to be selected when a print dialog is displayed for this document. Valid values are:
          • None, which indicates that the print dialog should reflect no page scaling
          • AppDefault (default), which indicates that applications should use the current print scaling
        • Duplex name (Optional; PDF 1.7) The paper handling option to use when printing the file from the print dialog. The following values are valid:
          • Simplex - Print single-sided
          • DuplexFlipShortEdge - Duplex and flip on the short edge of the sheet
          • DuplexFlipLongEdge - Duplex and flip on the long edge of the sheet
          Default value: none
        • PickTrayByPDFSize boolean (Optional; PDF 1.7) A flag specifying whether the PDF page size is used to select the input paper tray. This setting influences only the preset values used to populate the print dialog presented by a PDF viewer application. If PickTrayByPDFSize is true, the check box in the print dialog associated with input paper tray is checked. Note: This setting has no effect on Mac OS systems, which do not provide the ability to pick the input tray by size.
        • PrintPageRange array (Optional; PDF 1.7) The page numbers used to initialize the print dialog box when the file is printed. The first page of the PDF file is denoted by 1. Each pair consists of the first and last pages in the sub-range. An odd number of integers causes this entry to be ignored. Negative numbers cause the entire array to be ignored. Default value: as defined by PDF viewer application
        • NumCopies integer (Optional; PDF 1.7) The number of copies to be printed when the print dialog is opened for this file. Supported values are the integers 2 through 5. Values outside this range are ignored. Default value: as defined by PDF viewer application, but typically 1
        + * @param array $preferences array of options. + * @author Nicola Asuni + * @public + * @since 3.1.000 (2008-06-09) + */ + public function setViewerPreferences($preferences) { + $this->viewer_preferences = $preferences; + } + + /** + * Paints color transition registration bars + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param boolean $transition if true prints tcolor transitions to white. + * @param boolean $vertical if true prints bar vertically. + * @param string $colors colors to print separated by comma. Valid values are: A,W,R,G,B,C,M,Y,K,RGB,CMYK,ALL,ALLSPOT,. Where: A = grayscale black, W = grayscale white, R = RGB red, G RGB green, B RGB blue, C = CMYK cyan, M = CMYK magenta, Y = CMYK yellow, K = CMYK key/black, RGB = RGB registration color, CMYK = CMYK registration color, ALL = Spot registration color, ALLSPOT = print all defined spot colors, = name of the spot color to print. + * @author Nicola Asuni + * @since 4.9.000 (2010-03-26) + * @public + */ + public function colorRegistrationBar($x, $y, $w, $h, $transition=true, $vertical=false, $colors='A,R,G,B,C,M,Y,K') { + if (strpos($colors, 'ALLSPOT') !== false) { + // expand spot colors + $spot_colors = ''; + foreach ($this->spot_colors as $spot_color_name => $v) { + $spot_colors .= ','.$spot_color_name; + } + if (!empty($spot_colors)) { + $spot_colors = substr($spot_colors, 1); + $colors = str_replace('ALLSPOT', $spot_colors, $colors); + } else { + $colors = str_replace('ALLSPOT', 'NONE', $colors); + } + } + $bars = explode(',', $colors); + $numbars = count($bars); // number of bars to print + if ($numbars <= 0) { + return; + } + // set bar measures + if ($vertical) { + $coords = array(0, 0, 0, 1); + $wb = $w / $numbars; // bar width + $hb = $h; // bar height + $xd = $wb; // delta x + $yd = 0; // delta y + } else { + $coords = array(1, 0, 0, 0); + $wb = $w; // bar width + $hb = $h / $numbars; // bar height + $xd = 0; // delta x + $yd = $hb; // delta y + } + $xb = $x; + $yb = $y; + foreach ($bars as $col) { + switch ($col) { + // set transition colors + case 'A': { // BLACK (GRAYSCALE) + $col_a = array(255); + $col_b = array(0); + break; + } + case 'W': { // WHITE (GRAYSCALE) + $col_a = array(0); + $col_b = array(255); + break; + } + case 'R': { // RED (RGB) + $col_a = array(255,255,255); + $col_b = array(255,0,0); + break; + } + case 'G': { // GREEN (RGB) + $col_a = array(255,255,255); + $col_b = array(0,255,0); + break; + } + case 'B': { // BLUE (RGB) + $col_a = array(255,255,255); + $col_b = array(0,0,255); + break; + } + case 'C': { // CYAN (CMYK) + $col_a = array(0,0,0,0); + $col_b = array(100,0,0,0); + break; + } + case 'M': { // MAGENTA (CMYK) + $col_a = array(0,0,0,0); + $col_b = array(0,100,0,0); + break; + } + case 'Y': { // YELLOW (CMYK) + $col_a = array(0,0,0,0); + $col_b = array(0,0,100,0); + break; + } + case 'K': { // KEY - BLACK (CMYK) + $col_a = array(0,0,0,0); + $col_b = array(0,0,0,100); + break; + } + case 'RGB': { // BLACK REGISTRATION (RGB) + $col_a = array(255,255,255); + $col_b = array(0,0,0); + break; + } + case 'CMYK': { // BLACK REGISTRATION (CMYK) + $col_a = array(0,0,0,0); + $col_b = array(100,100,100,100); + break; + } + case 'ALL': { // SPOT COLOR REGISTRATION + $col_a = array(0,0,0,0,'None'); + $col_b = array(100,100,100,100,'All'); + break; + } + case 'NONE': { // SKIP THIS COLOR + $col_a = array(0,0,0,0,'None'); + $col_b = array(0,0,0,0,'None'); + break; + } + default: { // SPECIFIC SPOT COLOR NAME + $col_a = array(0,0,0,0,'None'); + $col_b = TCPDF_COLORS::getSpotColor($col, $this->spot_colors); + if ($col_b === false) { + // in case of error defaults to the registration color + $col_b = array(100,100,100,100,'All'); + } + break; + } + } + if ($col != 'NONE') { + if ($transition) { + // color gradient + $this->LinearGradient($xb, $yb, $wb, $hb, $col_a, $col_b, $coords); + } else { + $this->setFillColorArray($col_b); + // colored rectangle + $this->Rect($xb, $yb, $wb, $hb, 'F', array()); + } + $xb += $xd; + $yb += $yd; + } + } + } + + /** + * Paints crop marks. + * @param float $x abscissa of the crop mark center. + * @param float $y ordinate of the crop mark center. + * @param float $w width of the crop mark. + * @param float $h height of the crop mark. + * @param string $type type of crop mark, one symbol per type separated by comma: T = TOP, F = BOTTOM, L = LEFT, R = RIGHT, TL = A = TOP-LEFT, TR = B = TOP-RIGHT, BL = C = BOTTOM-LEFT, BR = D = BOTTOM-RIGHT. + * @param array $color crop mark color (default spot registration color). + * @author Nicola Asuni + * @since 4.9.000 (2010-03-26) + * @public + */ + public function cropMark($x, $y, $w, $h, $type='T,R,B,L', $color=array(100,100,100,100,'All')) { + $this->setLineStyle(array('width' => (0.5 / $this->k), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $color)); + $type = strtoupper($type); + $type = preg_replace('/[^A-Z\-\,]*/', '', $type); + // split type in single components + $type = str_replace('-', ',', $type); + $type = str_replace('TL', 'T,L', $type); + $type = str_replace('TR', 'T,R', $type); + $type = str_replace('BL', 'F,L', $type); + $type = str_replace('BR', 'F,R', $type); + $type = str_replace('A', 'T,L', $type); + $type = str_replace('B', 'T,R', $type); + $type = str_replace('T,RO', 'BO', $type); + $type = str_replace('C', 'F,L', $type); + $type = str_replace('D', 'F,R', $type); + $crops = explode(',', strtoupper($type)); + // remove duplicates + $crops = array_unique($crops); + $dw = ($w / 4); // horizontal space to leave before the intersection point + $dh = ($h / 4); // vertical space to leave before the intersection point + foreach ($crops as $crop) { + switch ($crop) { + case 'T': + case 'TOP': { + $x1 = $x; + $y1 = ($y - $h); + $x2 = $x; + $y2 = ($y - $dh); + break; + } + case 'F': + case 'BOTTOM': { + $x1 = $x; + $y1 = ($y + $dh); + $x2 = $x; + $y2 = ($y + $h); + break; + } + case 'L': + case 'LEFT': { + $x1 = ($x - $w); + $y1 = $y; + $x2 = ($x - $dw); + $y2 = $y; + break; + } + case 'R': + case 'RIGHT': { + $x1 = ($x + $dw); + $y1 = $y; + $x2 = ($x + $w); + $y2 = $y; + break; + } + } + $this->Line($x1, $y1, $x2, $y2); + } + } + + /** + * Paints a registration mark + * @param float $x abscissa of the registration mark center. + * @param float $y ordinate of the registration mark center. + * @param float $r radius of the crop mark. + * @param boolean $double if true print two concentric crop marks. + * @param array $cola crop mark color (default spot registration color 'All'). + * @param array $colb second crop mark color (default spot registration color 'None'). + * @author Nicola Asuni + * @since 4.9.000 (2010-03-26) + * @public + */ + public function registrationMark($x, $y, $r, $double=false, $cola=array(100,100,100,100,'All'), $colb=array(0,0,0,0,'None')) { + $line_style = array('width' => max((0.5 / $this->k),($r / 30)), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $cola); + $this->setFillColorArray($cola); + $this->PieSector($x, $y, $r, 90, 180, 'F'); + $this->PieSector($x, $y, $r, 270, 360, 'F'); + $this->Circle($x, $y, $r, 0, 360, 'C', $line_style, array(), 8); + if ($double) { + $ri = $r * 0.5; + $this->setFillColorArray($colb); + $this->PieSector($x, $y, $ri, 90, 180, 'F'); + $this->PieSector($x, $y, $ri, 270, 360, 'F'); + $this->setFillColorArray($cola); + $this->PieSector($x, $y, $ri, 0, 90, 'F'); + $this->PieSector($x, $y, $ri, 180, 270, 'F'); + $this->Circle($x, $y, $ri, 0, 360, 'C', $line_style, array(), 8); + } + } + + /** + * Paints a CMYK registration mark + * @param float $x abscissa of the registration mark center. + * @param float $y ordinate of the registration mark center. + * @param float $r radius of the crop mark. + * @author Nicola Asuni + * @since 6.0.038 (2013-09-30) + * @public + */ + public function registrationMarkCMYK($x, $y, $r) { + // line width + $lw = max((0.5 / $this->k),($r / 8)); + // internal radius + $ri = ($r * 0.6); + // external radius + $re = ($r * 1.3); + // Cyan + $this->setFillColorArray(array(100,0,0,0)); + $this->PieSector($x, $y, $ri, 270, 360, 'F'); + // Magenta + $this->setFillColorArray(array(0,100,0,0)); + $this->PieSector($x, $y, $ri, 0, 90, 'F'); + // Yellow + $this->setFillColorArray(array(0,0,100,0)); + $this->PieSector($x, $y, $ri, 90, 180, 'F'); + // Key - black + $this->setFillColorArray(array(0,0,0,100)); + $this->PieSector($x, $y, $ri, 180, 270, 'F'); + // registration color + $line_style = array('width' => $lw, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(100,100,100,100,'All')); + $this->setFillColorArray(array(100,100,100,100,'All')); + // external circle + $this->Circle($x, $y, $r, 0, 360, 'C', $line_style, array(), 8); + // cross lines + $this->Line($x, ($y - $re), $x, ($y - $ri)); + $this->Line($x, ($y + $ri), $x, ($y + $re)); + $this->Line(($x - $re), $y, ($x - $ri), $y); + $this->Line(($x + $ri), $y, ($x + $re), $y); + } + + /** + * Paints a linear colour gradient. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (Grayscale, RGB or CMYK components). + * @param array $col2 second color (Grayscale, RGB or CMYK components). + * @param array $coords array of the form (x1, y1, x2, y2) which defines the gradient vector (see linear_gradient_coords.jpg). The default value is from left to right (x1=0, y1=0, x2=1, y2=0). + * @author Andreas W\FCrmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @public + */ + public function LinearGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $coords=array(0,0,1,0)) { + $this->Clip($x, $y, $w, $h); + $this->Gradient(2, $coords, array(array('color' => $col1, 'offset' => 0, 'exponent' => 1), array('color' => $col2, 'offset' => 1, 'exponent' => 1)), array(), false); + } + + /** + * Paints a radial colour gradient. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (Grayscale, RGB or CMYK components). + * @param array $col2 second color (Grayscale, RGB or CMYK components). + * @param array $coords array of the form (fx, fy, cx, cy, r) where (fx, fy) is the starting point of the gradient with color1, (cx, cy) is the center of the circle with color2, and r is the radius of the circle (see radial_gradient_coords.jpg). (fx, fy) should be inside the circle, otherwise some areas will not be defined. + * @author Andreas W\FCrmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @public + */ + public function RadialGradient($x, $y, $w, $h, $col1=array(), $col2=array(), $coords=array(0.5,0.5,0.5,0.5,1)) { + $this->Clip($x, $y, $w, $h); + $this->Gradient(3, $coords, array(array('color' => $col1, 'offset' => 0, 'exponent' => 1), array('color' => $col2, 'offset' => 1, 'exponent' => 1)), array(), false); + } + + /** + * Paints a coons patch mesh. + * @param float $x abscissa of the top left corner of the rectangle. + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @param array $col1 first color (lower left corner) (RGB components). + * @param array $col2 second color (lower right corner) (RGB components). + * @param array $col3 third color (upper right corner) (RGB components). + * @param array $col4 fourth color (upper left corner) (RGB components). + * @param array $coords
        • for one patch mesh: array(float x1, float y1, .... float x12, float y12): 12 pairs of coordinates (normally from 0 to 1) which specify the Bezier control points that define the patch. First pair is the lower left edge point, next is its right control point (control point 2). Then the other points are defined in the order: control point 1, edge point, control point 2 going counter-clockwise around the patch. Last (x12, y12) is the first edge point's left control point (control point 1).
        • for two or more patch meshes: array[number of patches]: arrays with the following keys for each patch: f: where to put that patch (0 = first patch, 1, 2, 3 = right, top and left of precedent patch - I didn't figure this out completely - just try and error ;-) points: 12 pairs of coordinates of the Bezier control points as above for the first patch, 8 pairs of coordinates for the following patches, ignoring the coordinates already defined by the precedent patch (I also didn't figure out the order of these - also: try and see what's happening) colors: must be 4 colors for the first patch, 2 colors for the following patches
        + * @param array $coords_min minimum value used by the coordinates. If a coordinate's value is smaller than this it will be cut to coords_min. default: 0 + * @param array $coords_max maximum value used by the coordinates. If a coordinate's value is greater than this it will be cut to coords_max. default: 1 + * @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts. + * @author Andreas W\FCrmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @public + */ + public function CoonsPatchMesh($x, $y, $w, $h, $col1=array(), $col2=array(), $col3=array(), $col4=array(), $coords=array(0.00,0.0,0.33,0.00,0.67,0.00,1.00,0.00,1.00,0.33,1.00,0.67,1.00,1.00,0.67,1.00,0.33,1.00,0.00,1.00,0.00,0.67,0.00,0.33), $coords_min=0, $coords_max=1, $antialias=false) { + if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) { + return; + } + $this->Clip($x, $y, $w, $h); + $n = count($this->gradients) + 1; + $this->gradients[$n] = array(); + $this->gradients[$n]['type'] = 6; //coons patch mesh + $this->gradients[$n]['coords'] = array(); + $this->gradients[$n]['antialias'] = $antialias; + $this->gradients[$n]['colors'] = array(); + $this->gradients[$n]['transparency'] = false; + //check the coords array if it is the simple array or the multi patch array + if (!isset($coords[0]['f'])) { + //simple array -> convert to multi patch array + if (!isset($col1[1])) { + $col1[1] = $col1[2] = $col1[0]; + } + if (!isset($col2[1])) { + $col2[1] = $col2[2] = $col2[0]; + } + if (!isset($col3[1])) { + $col3[1] = $col3[2] = $col3[0]; + } + if (!isset($col4[1])) { + $col4[1] = $col4[2] = $col4[0]; + } + $patch_array[0]['f'] = 0; + $patch_array[0]['points'] = $coords; + $patch_array[0]['colors'][0]['r'] = $col1[0]; + $patch_array[0]['colors'][0]['g'] = $col1[1]; + $patch_array[0]['colors'][0]['b'] = $col1[2]; + $patch_array[0]['colors'][1]['r'] = $col2[0]; + $patch_array[0]['colors'][1]['g'] = $col2[1]; + $patch_array[0]['colors'][1]['b'] = $col2[2]; + $patch_array[0]['colors'][2]['r'] = $col3[0]; + $patch_array[0]['colors'][2]['g'] = $col3[1]; + $patch_array[0]['colors'][2]['b'] = $col3[2]; + $patch_array[0]['colors'][3]['r'] = $col4[0]; + $patch_array[0]['colors'][3]['g'] = $col4[1]; + $patch_array[0]['colors'][3]['b'] = $col4[2]; + } else { + //multi patch array + $patch_array = $coords; + } + $bpcd = 65535; //16 bits per coordinate + //build the data stream + $this->gradients[$n]['stream'] = ''; + $count_patch = count($patch_array); + for ($i=0; $i < $count_patch; ++$i) { + $this->gradients[$n]['stream'] .= chr($patch_array[$i]['f']); //start with the edge flag as 8 bit + $count_points = count($patch_array[$i]['points']); + for ($j=0; $j < $count_points; ++$j) { + //each point as 16 bit + $patch_array[$i]['points'][$j] = (($patch_array[$i]['points'][$j] - $coords_min) / ($coords_max - $coords_min)) * $bpcd; + if ($patch_array[$i]['points'][$j] < 0) { + $patch_array[$i]['points'][$j] = 0; + } + if ($patch_array[$i]['points'][$j] > $bpcd) { + $patch_array[$i]['points'][$j] = $bpcd; + } + $this->gradients[$n]['stream'] .= chr((int) floor($patch_array[$i]['points'][$j] / 256)); + $this->gradients[$n]['stream'] .= chr((int) floor(intval($patch_array[$i]['points'][$j]) % 256)); + } + $count_cols = count($patch_array[$i]['colors']); + for ($j=0; $j < $count_cols; ++$j) { + //each color component as 8 bit + $this->gradients[$n]['stream'] .= chr($patch_array[$i]['colors'][$j]['r']); + $this->gradients[$n]['stream'] .= chr($patch_array[$i]['colors'][$j]['g']); + $this->gradients[$n]['stream'] .= chr($patch_array[$i]['colors'][$j]['b']); + } + } + //paint the gradient + $this->_out('/Sh'.$n.' sh'); + //restore previous Graphic State + $this->_outRestoreGraphicsState(); + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['gradients'][$n] = $this->gradients[$n]; + } + } + + /** + * Set a rectangular clipping area. + * @param float $x abscissa of the top left corner of the rectangle (or top right corner for RTL mode). + * @param float $y ordinate of the top left corner of the rectangle. + * @param float $w width of the rectangle. + * @param float $h height of the rectangle. + * @author Andreas W\FCrmser, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @protected + */ + protected function Clip($x, $y, $w, $h) { + if ($this->state != 2) { + return; + } + if ($this->rtl) { + $x = $this->w - $x - $w; + } + //save current Graphic State + $s = 'q'; + //set clipping area + $s .= sprintf(' %F %F %F %F re W n', $x*$this->k, ($this->h-$y)*$this->k, $w*$this->k, -$h*$this->k); + //set up transformation matrix for gradient + $s .= sprintf(' %F 0 0 %F %F %F cm', $w*$this->k, $h*$this->k, $x*$this->k, ($this->h-($y+$h))*$this->k); + $this->_out($s); + } + + /** + * Output gradient. + * @param int $type type of gradient (1 Function-based shading; 2 Axial shading; 3 Radial shading; 4 Free-form Gouraud-shaded triangle mesh; 5 Lattice-form Gouraud-shaded triangle mesh; 6 Coons patch mesh; 7 Tensor-product patch mesh). (Not all types are currently supported) + * @param array $coords array of coordinates. + * @param array $stops array gradient color components: color = array of GRAY, RGB or CMYK color components; offset = (0 to 1) represents a location along the gradient vector; exponent = exponent of the exponential interpolation function (default = 1). + * @param array $background An array of colour components appropriate to the colour space, specifying a single background colour value. + * @param boolean $antialias A flag indicating whether to filter the shading function to prevent aliasing artifacts. + * @author Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @public + */ + public function Gradient($type, $coords, $stops, $background=array(), $antialias=false) { + if (($this->pdfa_mode && $this->pdfa_version < 2) OR ($this->state != 2)) { + return; + } + $n = count($this->gradients) + 1; + $this->gradients[$n] = array(); + $this->gradients[$n]['type'] = $type; + $this->gradients[$n]['coords'] = $coords; + $this->gradients[$n]['antialias'] = $antialias; + $this->gradients[$n]['colors'] = array(); + $this->gradients[$n]['transparency'] = false; + // color space + $numcolspace = count($stops[0]['color']); + $bcolor = array_values($background); + switch($numcolspace) { + case 5: // SPOT + case 4: { // CMYK + $this->gradients[$n]['colspace'] = 'DeviceCMYK'; + if (!empty($background)) { + $this->gradients[$n]['background'] = sprintf('%F %F %F %F', $bcolor[0]/100, $bcolor[1]/100, $bcolor[2]/100, $bcolor[3]/100); + } + break; + } + case 3: { // RGB + $this->gradients[$n]['colspace'] = 'DeviceRGB'; + if (!empty($background)) { + $this->gradients[$n]['background'] = sprintf('%F %F %F', $bcolor[0]/255, $bcolor[1]/255, $bcolor[2]/255); + } + break; + } + case 1: { // GRAY SCALE + $this->gradients[$n]['colspace'] = 'DeviceGray'; + if (!empty($background)) { + $this->gradients[$n]['background'] = sprintf('%F', $bcolor[0]/255); + } + break; + } + } + $num_stops = count($stops); + $last_stop_id = $num_stops - 1; + foreach ($stops as $key => $stop) { + $this->gradients[$n]['colors'][$key] = array(); + // offset represents a location along the gradient vector + if (isset($stop['offset'])) { + $this->gradients[$n]['colors'][$key]['offset'] = $stop['offset']; + } else { + if ($key == 0) { + $this->gradients[$n]['colors'][$key]['offset'] = 0; + } elseif ($key == $last_stop_id) { + $this->gradients[$n]['colors'][$key]['offset'] = 1; + } else { + $offsetstep = (1 - $this->gradients[$n]['colors'][($key - 1)]['offset']) / ($num_stops - $key); + $this->gradients[$n]['colors'][$key]['offset'] = $this->gradients[$n]['colors'][($key - 1)]['offset'] + $offsetstep; + } + } + if (isset($stop['opacity'])) { + $this->gradients[$n]['colors'][$key]['opacity'] = $stop['opacity']; + if ((!($this->pdfa_mode && $this->pdfa_version < 2)) AND ($stop['opacity'] < 1)) { + $this->gradients[$n]['transparency'] = true; + } + } else { + $this->gradients[$n]['colors'][$key]['opacity'] = 1; + } + // exponent for the exponential interpolation function + if (isset($stop['exponent'])) { + $this->gradients[$n]['colors'][$key]['exponent'] = $stop['exponent']; + } else { + $this->gradients[$n]['colors'][$key]['exponent'] = 1; + } + // set colors + $color = array_values($stop['color']); + switch($numcolspace) { + case 5: // SPOT + case 4: { // CMYK + $this->gradients[$n]['colors'][$key]['color'] = sprintf('%F %F %F %F', $color[0]/100, $color[1]/100, $color[2]/100, $color[3]/100); + break; + } + case 3: { // RGB + $this->gradients[$n]['colors'][$key]['color'] = sprintf('%F %F %F', $color[0]/255, $color[1]/255, $color[2]/255); + break; + } + case 1: { // GRAY SCALE + $this->gradients[$n]['colors'][$key]['color'] = sprintf('%F', $color[0]/255); + break; + } + } + } + if ($this->gradients[$n]['transparency']) { + // paint luminosity gradient + $this->_out('/TGS'.$n.' gs'); + } + //paint the gradient + $this->_out('/Sh'.$n.' sh'); + //restore previous Graphic State + $this->_outRestoreGraphicsState(); + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['gradients'][$n] = $this->gradients[$n]; + } + } + + /** + * Output gradient shaders. + * @author Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @protected + */ + function _putshaders() { + if ($this->pdfa_mode && $this->pdfa_version < 2) { + return; + } + $idt = count($this->gradients); //index for transparency gradients + foreach ($this->gradients as $id => $grad) { + if (($grad['type'] == 2) OR ($grad['type'] == 3)) { + $fc = $this->_newobj(); + $out = '<<'; + $out .= ' /FunctionType 3'; + $out .= ' /Domain [0 1]'; + $functions = ''; + $bounds = ''; + $encode = ''; + $i = 1; + $num_cols = count($grad['colors']); + $lastcols = $num_cols - 1; + for ($i = 1; $i < $num_cols; ++$i) { + $functions .= ($fc + $i).' 0 R '; + if ($i < $lastcols) { + $bounds .= sprintf('%F ', $grad['colors'][$i]['offset']); + } + $encode .= '0 1 '; + } + $out .= ' /Functions ['.trim($functions).']'; + $out .= ' /Bounds ['.trim($bounds).']'; + $out .= ' /Encode ['.trim($encode).']'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + for ($i = 1; $i < $num_cols; ++$i) { + $this->_newobj(); + $out = '<<'; + $out .= ' /FunctionType 2'; + $out .= ' /Domain [0 1]'; + $out .= ' /C0 ['.$grad['colors'][($i - 1)]['color'].']'; + $out .= ' /C1 ['.$grad['colors'][$i]['color'].']'; + $out .= ' /N '.$grad['colors'][$i]['exponent']; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + // set transparency functions + if ($grad['transparency']) { + $ft = $this->_newobj(); + $out = '<<'; + $out .= ' /FunctionType 3'; + $out .= ' /Domain [0 1]'; + $functions = ''; + $i = 1; + $num_cols = count($grad['colors']); + for ($i = 1; $i < $num_cols; ++$i) { + $functions .= ($ft + $i).' 0 R '; + } + $out .= ' /Functions ['.trim($functions).']'; + $out .= ' /Bounds ['.trim($bounds).']'; + $out .= ' /Encode ['.trim($encode).']'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + for ($i = 1; $i < $num_cols; ++$i) { + $this->_newobj(); + $out = '<<'; + $out .= ' /FunctionType 2'; + $out .= ' /Domain [0 1]'; + $out .= ' /C0 ['.$grad['colors'][($i - 1)]['opacity'].']'; + $out .= ' /C1 ['.$grad['colors'][$i]['opacity'].']'; + $out .= ' /N '.$grad['colors'][$i]['exponent']; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + } + } + } + // set shading object + $this->_newobj(); + $out = '<< /ShadingType '.$grad['type']; + if (isset($grad['colspace'])) { + $out .= ' /ColorSpace /'.$grad['colspace']; + } else { + $out .= ' /ColorSpace /DeviceRGB'; + } + if (isset($grad['background']) AND !empty($grad['background'])) { + $out .= ' /Background ['.$grad['background'].']'; + } + if (isset($grad['antialias']) AND ($grad['antialias'] === true)) { + $out .= ' /AntiAlias true'; + } + if ($grad['type'] == 2) { + $out .= ' '.sprintf('/Coords [%F %F %F %F]', $grad['coords'][0], $grad['coords'][1], $grad['coords'][2], $grad['coords'][3]); + $out .= ' /Domain [0 1]'; + $out .= ' /Function '.$fc.' 0 R'; + $out .= ' /Extend [true true]'; + $out .= ' >>'; + } elseif ($grad['type'] == 3) { + //x0, y0, r0, x1, y1, r1 + //at this this time radius of inner circle is 0 + $out .= ' '.sprintf('/Coords [%F %F 0 %F %F %F]', $grad['coords'][0], $grad['coords'][1], $grad['coords'][2], $grad['coords'][3], $grad['coords'][4]); + $out .= ' /Domain [0 1]'; + $out .= ' /Function '.$fc.' 0 R'; + $out .= ' /Extend [true true]'; + $out .= ' >>'; + } elseif ($grad['type'] == 6) { + $out .= ' /BitsPerCoordinate 16'; + $out .= ' /BitsPerComponent 8'; + $out .= ' /Decode[0 1 0 1 0 1 0 1 0 1]'; + $out .= ' /BitsPerFlag 8'; + $stream = $this->_getrawstream($grad['stream']); + $out .= ' /Length '.strlen($stream); + $out .= ' >>'; + $out .= ' stream'."\n".$stream."\n".'endstream'; + } + $out .= "\n".'endobj'; + $this->_out($out); + if ($grad['transparency']) { + $shading_transparency = preg_replace('/\/ColorSpace \/[^\s]+/si', '/ColorSpace /DeviceGray', $out); + $shading_transparency = preg_replace('/\/Function [0-9]+ /si', '/Function '.$ft.' ', $shading_transparency); + } + $this->gradients[$id]['id'] = $this->n; + // set pattern object + $this->_newobj(); + $out = '<< /Type /Pattern /PatternType 2'; + $out .= ' /Shading '.$this->gradients[$id]['id'].' 0 R'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + $this->gradients[$id]['pattern'] = $this->n; + // set shading and pattern for transparency mask + if ($grad['transparency']) { + // luminosity pattern + $idgs = $id + $idt; + $this->_newobj(); + $this->_out($shading_transparency); + $this->gradients[$idgs]['id'] = $this->n; + $this->_newobj(); + $out = '<< /Type /Pattern /PatternType 2'; + $out .= ' /Shading '.$this->gradients[$idgs]['id'].' 0 R'; + $out .= ' >>'; + $out .= "\n".'endobj'; + $this->_out($out); + $this->gradients[$idgs]['pattern'] = $this->n; + // luminosity XObject + $oid = $this->_newobj(); + $this->xobjects['LX'.$oid] = array('n' => $oid); + $filter = ''; + $stream = 'q /a0 gs /Pattern cs /p'.$idgs.' scn 0 0 '.$this->wPt.' '.$this->hPt.' re f Q'; + if ($this->compress) { + $filter = ' /Filter /FlateDecode'; + $stream = gzcompress($stream); + } + $stream = $this->_getrawstream($stream); + $out = '<< /Type /XObject /Subtype /Form /FormType 1'.$filter; + $out .= ' /Length '.strlen($stream); + $rect = sprintf('%F %F', $this->wPt, $this->hPt); + $out .= ' /BBox [0 0 '.$rect.']'; + $out .= ' /Group << /Type /Group /S /Transparency /CS /DeviceGray >>'; + $out .= ' /Resources <<'; + $out .= ' /ExtGState << /a0 << /ca 1 /CA 1 >> >>'; + $out .= ' /Pattern << /p'.$idgs.' '.$this->gradients[$idgs]['pattern'].' 0 R >>'; + $out .= ' >>'; + $out .= ' >> '; + $out .= ' stream'."\n".$stream."\n".'endstream'; + $out .= "\n".'endobj'; + $this->_out($out); + // SMask + $this->_newobj(); + $out = '<< /Type /Mask /S /Luminosity /G '.($this->n - 1).' 0 R >>'."\n".'endobj'; + $this->_out($out); + // ExtGState + $this->_newobj(); + $out = '<< /Type /ExtGState /SMask '.($this->n - 1).' 0 R /AIS false >>'."\n".'endobj'; + $this->_out($out); + $this->extgstates[] = array('n' => $this->n, 'name' => 'TGS'.$id); + } + } + } + + /** + * Draw the sector of a circle. + * It can be used for instance to render pie charts. + * @param float $xc abscissa of the center. + * @param float $yc ordinate of the center. + * @param float $r radius. + * @param float $a start angle (in degrees). + * @param float $b end angle (in degrees). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param float $cw indicates whether to go clockwise (default: true). + * @param float $o origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). Default: 90. + * @author Maxime Delorme, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @public + */ + public function PieSector($xc, $yc, $r, $a, $b, $style='FD', $cw=true, $o=90) { + $this->PieSectorXY($xc, $yc, $r, $r, $a, $b, $style, $cw, $o); + } + + /** + * Draw the sector of an ellipse. + * It can be used for instance to render pie charts. + * @param float $xc abscissa of the center. + * @param float $yc ordinate of the center. + * @param float $rx the x-axis radius. + * @param float $ry the y-axis radius. + * @param float $a start angle (in degrees). + * @param float $b end angle (in degrees). + * @param string $style Style of rendering. See the getPathPaintOperator() function for more information. + * @param float $cw indicates whether to go clockwise. + * @param float $o origin of angles (0 for 3 o'clock, 90 for noon, 180 for 9 o'clock, 270 for 6 o'clock). + * @param integer $nc Number of curves used to draw a 90 degrees portion of arc. + * @author Maxime Delorme, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @public + */ + public function PieSectorXY($xc, $yc, $rx, $ry, $a, $b, $style='FD', $cw=false, $o=0, $nc=2) { + if ($this->state != 2) { + return; + } + if ($this->rtl) { + $xc = ($this->w - $xc); + } + $op = TCPDF_STATIC::getPathPaintOperator($style); + if ($op == 'f') { + $line_style = array(); + } + if ($cw) { + $d = $b; + $b = (360 - $a + $o); + $a = (360 - $d + $o); + } else { + $b += $o; + $a += $o; + } + $this->_outellipticalarc($xc, $yc, $rx, $ry, 0, $a, $b, true, $nc); + $this->_out($op); + } + + /** + * Embed vector-based Adobe Illustrator (AI) or AI-compatible EPS files. + * NOTE: EPS is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library. + * Only vector drawing is supported, not text or bitmap. + * Although the script was successfully tested with various AI format versions, best results are probably achieved with files that were exported in the AI3 format (tested with Illustrator CS2, Freehand MX and Photoshop CS2). + * @param string $file Name of the file containing the image or a '@' character followed by the EPS/AI data string. + * @param float|null $x Abscissa of the upper-left corner. + * @param float|null $y Ordinate of the upper-left corner. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param mixed $link URL or identifier returned by AddLink(). + * @param boolean $useBoundingBox specifies whether to position the bounding box (true) or the complete canvas (false) at location (x,y). Default value is true. + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        + * @param string $palign Allows to center or align the image on the current line. Possible values are:
        • L : left align
        • C : center
        • R : right align
        • '' : empty string : left for LTR or right for RTL
        + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
        • 0: no border (default)
        • 1: frame
        or a string containing some or all of the following characters (in any order):
        • L: left
        • T: top
        • R: right
        • B: bottom
        or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param boolean $fitonpage if true the image is resized to not exceed page dimensions. + * @param boolean $fixoutvals if true remove values outside the bounding box. + * @author Valentin Schmidt, Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @public + */ + public function ImageEps($file, $x=null, $y=null, $w=0, $h=0, $link='', $useBoundingBox=true, $align='', $palign='', $border=0, $fitonpage=false, $fixoutvals=false) { + if ($this->state != 2) { + return; + } + if ($this->rasterize_vector_images AND ($w > 0) AND ($h > 0)) { + // convert EPS to raster image using GD or ImageMagick libraries + return $this->Image($file, $x, $y, $w, $h, 'EPS', $link, $align, true, 300, $palign, false, false, $border, false, false, $fitonpage); + } + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + $k = $this->k; + if ($file[0] === '@') { // image from string + $data = substr($file, 1); + } else { // EPS/AI file + $data = $this->getCachedFileContents($file); + } + if ($data === FALSE) { + $this->Error('EPS file not found: '.$file); + } + $regs = array(); + // EPS/AI compatibility check (only checks files created by Adobe Illustrator!) + preg_match("/%%Creator:([^\r\n]+)/", $data, $regs); # find Creator + if (count($regs) > 1) { + $version_str = trim($regs[1]); # e.g. "Adobe Illustrator(R) 8.0" + if (strpos($version_str, 'Adobe Illustrator') !== false) { + $versexp = explode(' ', $version_str); + $version = (float)array_pop($versexp); + if ($version >= 9) { + $this->Error('This version of Adobe Illustrator file is not supported: '.$file); + } + } + } + // strip binary bytes in front of PS-header + $start = strpos($data, '%!PS-Adobe'); + if ($start > 0) { + $data = substr($data, $start); + } + // find BoundingBox params + preg_match("/%%BoundingBox:([^\r\n]+)/", $data, $regs); + if (count($regs) > 1) { + list($x1, $y1, $x2, $y2) = explode(' ', trim($regs[1])); + } else { + $this->Error('No BoundingBox found in EPS/AI file: '.$file); + } + $start = strpos($data, '%%EndSetup'); + if ($start === false) { + $start = strpos($data, '%%EndProlog'); + } + if ($start === false) { + $start = strpos($data, '%%BoundingBox'); + } + $data = substr($data, $start); + $end = strpos($data, '%%PageTrailer'); + if ($end===false) { + $end = strpos($data, 'showpage'); + } + if ($end) { + $data = substr($data, 0, $end); + } + // calculate image width and height on document + if (($w <= 0) AND ($h <= 0)) { + $w = ($x2 - $x1) / $k; + $h = ($y2 - $y1) / $k; + } elseif ($w <= 0) { + $w = ($x2-$x1) / $k * ($h / (($y2 - $y1) / $k)); + } elseif ($h <= 0) { + $h = ($y2 - $y1) / $k * ($w / (($x2 - $x1) / $k)); + } + // fit the image on available space + list($w, $h, $x, $y) = $this->fitBlock($w, $h, $x, $y, $fitonpage); + if ($this->rasterize_vector_images) { + // convert EPS to raster image using GD or ImageMagick libraries + return $this->Image($file, $x, $y, $w, $h, 'EPS', $link, $align, true, 300, $palign, false, false, $border, false, false, $fitonpage); + } + // set scaling factors + $scale_x = $w / (($x2 - $x1) / $k); + $scale_y = $h / (($y2 - $y1) / $k); + // set alignment + $this->img_rb_y = $y + $h; + // set alignment + if ($this->rtl) { + if ($palign == 'L') { + $ximg = $this->lMargin; + } elseif ($palign == 'C') { + $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($palign == 'R') { + $ximg = $this->w - $this->rMargin - $w; + } else { + $ximg = $x - $w; + } + $this->img_rb_x = $ximg; + } else { + if ($palign == 'L') { + $ximg = $this->lMargin; + } elseif ($palign == 'C') { + $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($palign == 'R') { + $ximg = $this->w - $this->rMargin - $w; + } else { + $ximg = $x; + } + $this->img_rb_x = $ximg + $w; + } + if ($useBoundingBox) { + $dx = $ximg * $k - $x1; + $dy = $y * $k - $y1; + } else { + $dx = $ximg * $k; + $dy = $y * $k; + } + // save the current graphic state + $this->_out('q'.$this->epsmarker); + // translate + $this->_out(sprintf('%F %F %F %F %F %F cm', 1, 0, 0, 1, $dx, $dy + ($this->hPt - (2 * $y * $k) - ($y2 - $y1)))); + // scale + $this->_out(sprintf('%F %F %F %F %F %F cm', $scale_x, 0, 0, $scale_y, $x1 * (1 - $scale_x), $y2 * (1 - $scale_y))); + // handle pc/unix/mac line endings + $lines = preg_split('/[\r\n]+/si', $data, -1, PREG_SPLIT_NO_EMPTY); + $u=0; + $cnt = count($lines); + for ($i=0; $i < $cnt; ++$i) { + $line = $lines[$i]; + if (($line == '') OR ($line[0] == '%')) { + continue; + } + $len = strlen($line); + // check for spot color names + $color_name = ''; + if (strcasecmp('x', substr(trim($line), -1)) == 0) { + if (preg_match('/\([^\)]*\)/', $line, $matches) > 0) { + // extract spot color name + $color_name = $matches[0]; + // remove color name from string + $line = str_replace(' '.$color_name, '', $line); + // remove pharentesis from color name + $color_name = substr($color_name, 1, -1); + } + } + $chunks = explode(' ', $line); + $cmd = trim(array_pop($chunks)); + // RGB + if (($cmd == 'Xa') OR ($cmd == 'XA')) { + $b = array_pop($chunks); + $g = array_pop($chunks); + $r = array_pop($chunks); + $this->_out(''.$r.' '.$g.' '.$b.' '.($cmd=='Xa'?'rg':'RG')); //substr($line, 0, -2).'rg' -> in EPS (AI8): c m y k r g b rg! + continue; + } + $skip = false; + if ($fixoutvals) { + // check for values outside the bounding box + switch ($cmd) { + case 'm': + case 'l': + case 'L': { + // skip values outside bounding box + foreach ($chunks as $key => $val) { + if ((($key % 2) == 0) AND (($val < $x1) OR ($val > $x2))) { + $skip = true; + } elseif ((($key % 2) != 0) AND (($val < $y1) OR ($val > $y2))) { + $skip = true; + } + } + } + } + } + switch ($cmd) { + case 'm': + case 'l': + case 'v': + case 'y': + case 'c': + case 'k': + case 'K': + case 'g': + case 'G': + case 's': + case 'S': + case 'J': + case 'j': + case 'w': + case 'M': + case 'd': + case 'n': { + if ($skip) { + break; + } + $this->_out($line); + break; + } + case 'x': {// custom fill color + if (empty($color_name)) { + // CMYK color + list($col_c, $col_m, $col_y, $col_k) = $chunks; + $this->_out(''.$col_c.' '.$col_m.' '.$col_y.' '.$col_k.' k'); + } else { + // Spot Color (CMYK + tint) + list($col_c, $col_m, $col_y, $col_k, $col_t) = $chunks; + $this->AddSpotColor($color_name, ($col_c * 100), ($col_m * 100), ($col_y * 100), ($col_k * 100)); + $color_cmd = sprintf('/CS%d cs %F scn', $this->spot_colors[$color_name]['i'], (1 - $col_t)); + $this->_out($color_cmd); + } + break; + } + case 'X': { // custom stroke color + if (empty($color_name)) { + // CMYK color + list($col_c, $col_m, $col_y, $col_k) = $chunks; + $this->_out(''.$col_c.' '.$col_m.' '.$col_y.' '.$col_k.' K'); + } else { + // Spot Color (CMYK + tint) + list($col_c, $col_m, $col_y, $col_k, $col_t) = $chunks; + $this->AddSpotColor($color_name, ($col_c * 100), ($col_m * 100), ($col_y * 100), ($col_k * 100)); + $color_cmd = sprintf('/CS%d CS %F SCN', $this->spot_colors[$color_name]['i'], (1 - $col_t)); + $this->_out($color_cmd); + } + break; + } + case 'Y': + case 'N': + case 'V': + case 'L': + case 'C': { + if ($skip) { + break; + } + $line[($len - 1)] = strtolower($cmd); + $this->_out($line); + break; + } + case 'b': + case 'B': { + $this->_out($cmd . '*'); + break; + } + case 'f': + case 'F': { + if ($u > 0) { + $isU = false; + $max = min(($i + 5), $cnt); + for ($j = ($i + 1); $j < $max; ++$j) { + $isU = ($isU OR (($lines[$j] == 'U') OR ($lines[$j] == '*U'))); + } + if ($isU) { + $this->_out('f*'); + } + } else { + $this->_out('f*'); + } + break; + } + case '*u': { + ++$u; + break; + } + case '*U': { + --$u; + break; + } + } + } + // restore previous graphic state + $this->_out($this->epsmarker.'Q'); + if (!empty($border)) { + $bx = $this->x; + $by = $this->y; + $this->x = $ximg; + if ($this->rtl) { + $this->x += $w; + } + $this->y = $y; + $this->Cell($w, $h, '', $border, 0, '', 0, '', 0, true); + $this->x = $bx; + $this->y = $by; + } + if ($link) { + $this->Link($ximg, $y, $w, $h, $link, 0); + } + // set pointer to align the next text/objects + switch($align) { + case 'T':{ + $this->y = $y; + $this->x = $this->img_rb_x; + break; + } + case 'M':{ + $this->y = $y + round($h/2); + $this->x = $this->img_rb_x; + break; + } + case 'B':{ + $this->y = $this->img_rb_y; + $this->x = $this->img_rb_x; + break; + } + case 'N':{ + $this->setY($this->img_rb_y); + break; + } + default:{ + break; + } + } + $this->endlinex = $this->img_rb_x; + } + + /** + * Set document barcode. + * @param string $bc barcode + * @public + */ + public function setBarcode($bc='') { + $this->barcode = $bc; + } + + /** + * Get current barcode. + * @return string + * @public + * @since 4.0.012 (2008-07-24) + */ + public function getBarcode() { + return $this->barcode; + } + + /** + * Print a Linear Barcode. + * @param string $code code to print + * @param string $type type of barcode (see tcpdf_barcodes_1d.php for supported formats). + * @param float|null $x x position in user units (null = current x position) + * @param float|null $y y position in user units (null = current y position) + * @param float|null $w width in user units (null = remaining page width) + * @param float|null $h height in user units (null = remaining page height) + * @param float|null $xres width of the smallest bar in user units (null = default value = 0.4mm) + * @param array $style array of options:
          + *
        • boolean $style['border'] if true prints a border
        • + *
        • int $style['padding'] padding to leave around the barcode in user units (set to 'auto' for automatic padding)
        • + *
        • int $style['hpadding'] horizontal padding in user units (set to 'auto' for automatic padding)
        • + *
        • int $style['vpadding'] vertical padding in user units (set to 'auto' for automatic padding)
        • + *
        • array $style['fgcolor'] color array for bars and text
        • + *
        • mixed $style['bgcolor'] color array for background (set to false for transparent)
        • + *
        • boolean $style['text'] if true prints text below the barcode
        • + *
        • string $style['label'] override default label
        • + *
        • string $style['font'] font name for text
        • int $style['fontsize'] font size for text
        • + *
        • int $style['stretchtext']: 0 = disabled; 1 = horizontal scaling only if necessary; 2 = forced horizontal scaling; 3 = character spacing only if necessary; 4 = forced character spacing.
        • + *
        • string $style['position'] horizontal position of the containing barcode cell on the page: L = left margin; C = center; R = right margin.
        • + *
        • string $style['align'] horizontal position of the barcode on the containing rectangle: L = left; C = center; R = right.
        • + *
        • string $style['stretch'] if true stretch the barcode to best fit the available width, otherwise uses $xres resolution for a single bar.
        • + *
        • string $style['fitwidth'] if true reduce the width to fit the barcode width + padding. When this option is enabled the 'stretch' option is automatically disabled.
        • + *
        • string $style['cellfitalign'] this option works only when 'fitwidth' is true and 'position' is unset or empty. Set the horizontal position of the containing barcode cell inside the specified rectangle: L = left; C = center; R = right.
        + * @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
        • T: top-right for LTR or top-left for RTL
        • M: middle-right for LTR or middle-left for RTL
        • B: bottom-right for LTR or bottom-left for RTL
        • N: next line
        + * @author Nicola Asuni + * @since 3.1.000 (2008-06-09) + * @public + */ + public function write1DBarcode($code, $type, $x=null, $y=null, $w=null, $h=null, $xres=null, $style=array(), $align='') { + if (TCPDF_STATIC::empty_string(trim($code))) { + return; + } + require_once(dirname(__FILE__).'/tcpdf_barcodes_1d.php'); + // save current graphic settings + $gvars = $this->getGraphicVars(); + // create new barcode object + $barcodeobj = new TCPDFBarcode($code, $type); + $arrcode = $barcodeobj->getBarcodeArray(); + if (empty($arrcode) OR ($arrcode['maxw'] <= 0)) { + $this->Error('Error in 1D barcode string'); + } + if ($arrcode['maxh'] <= 0) { + $arrcode['maxh'] = 1; + } + // set default values + if (!isset($style['position'])) { + $style['position'] = ''; + } elseif ($style['position'] == 'S') { + // keep this for backward compatibility + $style['position'] = ''; + $style['stretch'] = true; + } + if (!isset($style['fitwidth'])) { + if (!isset($style['stretch'])) { + $style['fitwidth'] = true; + } else { + $style['fitwidth'] = false; + } + } + if ($style['fitwidth']) { + // disable stretch + $style['stretch'] = false; + } + if (!isset($style['stretch'])) { + if (($w === '') OR ($w <= 0)) { + $style['stretch'] = false; + } else { + $style['stretch'] = true; + } + } + if (!isset($style['fgcolor'])) { + $style['fgcolor'] = array(0,0,0); // default black + } + if (!isset($style['bgcolor'])) { + $style['bgcolor'] = false; // default transparent + } + if (!isset($style['border'])) { + $style['border'] = false; + } + $fontsize = 0; + if (!isset($style['text'])) { + $style['text'] = false; + } + if ($style['text'] AND isset($style['font'])) { + if (isset($style['fontsize'])) { + $fontsize = $style['fontsize']; + } + $this->setFont($style['font'], '', $fontsize); + } + if (!isset($style['stretchtext'])) { + $style['stretchtext'] = 4; + } + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + if (TCPDF_STATIC::empty_string($w) OR ($w <= 0)) { + if ($this->rtl) { + $w = $x - $this->lMargin; + } else { + $w = $this->w - $this->rMargin - $x; + } + } + // padding + if (!isset($style['padding'])) { + $padding = 0; + } elseif ($style['padding'] === 'auto') { + $padding = 10 * ($w / ($arrcode['maxw'] + 20)); + } else { + $padding = floatval($style['padding']); + } + // horizontal padding + if (!isset($style['hpadding'])) { + $hpadding = $padding; + } elseif ($style['hpadding'] === 'auto') { + $hpadding = 10 * ($w / ($arrcode['maxw'] + 20)); + } else { + $hpadding = floatval($style['hpadding']); + } + // vertical padding + if (!isset($style['vpadding'])) { + $vpadding = $padding; + } elseif ($style['vpadding'] === 'auto') { + $vpadding = ($hpadding / 2); + } else { + $vpadding = floatval($style['vpadding']); + } + // calculate xres (single bar width) + $max_xres = ($w - (2 * $hpadding)) / $arrcode['maxw']; + if ($style['stretch']) { + $xres = $max_xres; + } else { + if (TCPDF_STATIC::empty_string($xres)) { + $xres = (0.141 * $this->k); // default bar width = 0.4 mm + } + if ($xres > $max_xres) { + // correct xres to fit on $w + $xres = $max_xres; + } + if ((isset($style['padding']) AND ($style['padding'] === 'auto')) + OR (isset($style['hpadding']) AND ($style['hpadding'] === 'auto'))) { + $hpadding = 10 * $xres; + if (isset($style['vpadding']) AND ($style['vpadding'] === 'auto')) { + $vpadding = ($hpadding / 2); + } + } + } + if ($style['fitwidth']) { + $wold = $w; + $w = (($arrcode['maxw'] * $xres) + (2 * $hpadding)); + if (isset($style['cellfitalign'])) { + switch ($style['cellfitalign']) { + case 'L': { + if ($this->rtl) { + $x -= ($wold - $w); + } + break; + } + case 'R': { + if (!$this->rtl) { + $x += ($wold - $w); + } + break; + } + case 'C': { + if ($this->rtl) { + $x -= (($wold - $w) / 2); + } else { + $x += (($wold - $w) / 2); + } + break; + } + default : { + break; + } + } + } + } + $text_height = $this->getCellHeight($fontsize / $this->k); + // height + if (TCPDF_STATIC::empty_string($h) OR ($h <= 0)) { + // set default height + $h = (($arrcode['maxw'] * $xres) / 3) + (2 * $vpadding) + $text_height; + } + $barh = $h - $text_height - (2 * $vpadding); + if ($barh <=0) { + // try to reduce font or padding to fit barcode on available height + if ($text_height > $h) { + $fontsize = (($h * $this->k) / (4 * $this->cell_height_ratio)); + $text_height = $this->getCellHeight($fontsize / $this->k); + $this->setFont($style['font'], '', $fontsize); + } + if ($vpadding > 0) { + $vpadding = (($h - $text_height) / 4); + } + $barh = $h - $text_height - (2 * $vpadding); + } + // fit the barcode on available space + list($w, $h, $x, $y) = $this->fitBlock($w, $h, $x, $y, false); + // set alignment + $this->img_rb_y = $y + $h; + // set alignment + if ($this->rtl) { + if ($style['position'] == 'L') { + $xpos = $this->lMargin; + } elseif ($style['position'] == 'C') { + $xpos = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($style['position'] == 'R') { + $xpos = $this->w - $this->rMargin - $w; + } else { + $xpos = $x - $w; + } + $this->img_rb_x = $xpos; + } else { + if ($style['position'] == 'L') { + $xpos = $this->lMargin; + } elseif ($style['position'] == 'C') { + $xpos = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($style['position'] == 'R') { + $xpos = $this->w - $this->rMargin - $w; + } else { + $xpos = $x; + } + $this->img_rb_x = $xpos + $w; + } + $xpos_rect = $xpos; + if (!isset($style['align'])) { + $style['align'] = 'C'; + } + switch ($style['align']) { + case 'L': { + $xpos = $xpos_rect + $hpadding; + break; + } + case 'R': { + $xpos = $xpos_rect + ($w - ($arrcode['maxw'] * $xres)) - $hpadding; + break; + } + case 'C': + default : { + $xpos = $xpos_rect + (($w - ($arrcode['maxw'] * $xres)) / 2); + break; + } + } + $xpos_text = $xpos; + // barcode is always printed in LTR direction + $tempRTL = $this->rtl; + $this->rtl = false; + // print background color + if ($style['bgcolor']) { + $this->Rect($xpos_rect, $y, $w, $h, $style['border'] ? 'DF' : 'F', '', $style['bgcolor']); + } elseif ($style['border']) { + $this->Rect($xpos_rect, $y, $w, $h, 'D'); + } + // set foreground color + $this->setDrawColorArray($style['fgcolor']); + $this->setTextColorArray($style['fgcolor']); + // print bars + foreach ($arrcode['bcode'] as $k => $v) { + $bw = ($v['w'] * $xres); + if ($v['t']) { + // draw a vertical bar + $ypos = $y + $vpadding + ($v['p'] * $barh / $arrcode['maxh']); + $this->Rect($xpos, $ypos, $bw, ($v['h'] * $barh / $arrcode['maxh']), 'F', array(), $style['fgcolor']); + } + $xpos += $bw; + } + // print text + if ($style['text']) { + if (isset($style['label']) AND !TCPDF_STATIC::empty_string($style['label'])) { + $label = $style['label']; + } else { + $label = $code; + } + $txtwidth = ($arrcode['maxw'] * $xres); + if ($this->GetStringWidth($label) > $txtwidth) { + $style['stretchtext'] = 2; + } + // print text + $this->x = $xpos_text; + $this->y = $y + $vpadding + $barh; + $cellpadding = $this->cell_padding; + $this->setCellPadding(0); + $this->Cell($txtwidth, 0, $label, 0, 0, 'C', false, '', $style['stretchtext'], false, 'T', 'T'); + $this->cell_padding = $cellpadding; + } + // restore original direction + $this->rtl = $tempRTL; + // restore previous settings + $this->setGraphicVars($gvars); + // set pointer to align the next text/objects + switch($align) { + case 'T':{ + $this->y = $y; + $this->x = $this->img_rb_x; + break; + } + case 'M':{ + $this->y = $y + round($h / 2); + $this->x = $this->img_rb_x; + break; + } + case 'B':{ + $this->y = $this->img_rb_y; + $this->x = $this->img_rb_x; + break; + } + case 'N':{ + $this->setY($this->img_rb_y); + break; + } + default:{ + break; + } + } + $this->endlinex = $this->img_rb_x; + } + + /** + * Print 2D Barcode. + * @param string $code code to print + * @param string $type type of barcode (see tcpdf_barcodes_2d.php for supported formats). + * @param float|null $x x position in user units + * @param float|null $y y position in user units + * @param float|null $w width in user units + * @param float|null $h height in user units + * @param array $style array of options:
          + *
        • boolean $style['border'] if true prints a border around the barcode
        • + *
        • int $style['padding'] padding to leave around the barcode in barcode units (set to 'auto' for automatic padding)
        • + *
        • int $style['hpadding'] horizontal padding in barcode units (set to 'auto' for automatic padding)
        • + *
        • int $style['vpadding'] vertical padding in barcode units (set to 'auto' for automatic padding)
        • + *
        • int $style['module_width'] width of a single module in points
        • + *
        • int $style['module_height'] height of a single module in points
        • + *
        • array $style['fgcolor'] color array for bars and text
        • + *
        • mixed $style['bgcolor'] color array for background or false for transparent
        • + *
        • string $style['position'] barcode position on the page: L = left margin; C = center; R = right margin; S = stretch
        • + * @param string $align Indicates the alignment of the pointer next to barcode insertion relative to barcode height. The value can be:
          • T: top-right for LTR or top-left for RTL
          • M: middle-right for LTR or middle-left for RTL
          • B: bottom-right for LTR or bottom-left for RTL
          • N: next line
          + * @param boolean $distort if true distort the barcode to fit width and height, otherwise preserve aspect ratio + * @author Nicola Asuni + * @since 4.5.037 (2009-04-07) + * @public + */ + public function write2DBarcode($code, $type, $x=null, $y=null, $w=null, $h=null, $style=array(), $align='', $distort=false) { + if (TCPDF_STATIC::empty_string(trim($code))) { + return; + } + require_once(dirname(__FILE__).'/tcpdf_barcodes_2d.php'); + // save current graphic settings + $gvars = $this->getGraphicVars(); + // create new barcode object + $barcodeobj = new TCPDF2DBarcode($code, $type); + $arrcode = $barcodeobj->getBarcodeArray(); + if (empty($arrcode) OR !isset($arrcode['num_rows']) OR ($arrcode['num_rows'] == 0) OR !isset($arrcode['num_cols']) OR ($arrcode['num_cols'] == 0)) { + $this->Error('Error in 2D barcode string'); + } + // set default values + if (!isset($style['position'])) { + $style['position'] = ''; + } + if (!isset($style['fgcolor'])) { + $style['fgcolor'] = array(0,0,0); // default black + } + if (!isset($style['bgcolor'])) { + $style['bgcolor'] = false; // default transparent + } + if (!isset($style['border'])) { + $style['border'] = false; + } + // padding + if (!isset($style['padding'])) { + $style['padding'] = 0; + } elseif ($style['padding'] === 'auto') { + $style['padding'] = 4; + } + if (!isset($style['hpadding'])) { + $style['hpadding'] = $style['padding']; + } elseif ($style['hpadding'] === 'auto') { + $style['hpadding'] = 4; + } + if (!isset($style['vpadding'])) { + $style['vpadding'] = $style['padding']; + } elseif ($style['vpadding'] === 'auto') { + $style['vpadding'] = 4; + } + $hpad = (2 * $style['hpadding']); + $vpad = (2 * $style['vpadding']); + // cell (module) dimension + if (!isset($style['module_width'])) { + $style['module_width'] = 1; // width of a single module in points + } + if (!isset($style['module_height'])) { + $style['module_height'] = 1; // height of a single module in points + } + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + // number of barcode columns and rows + $rows = $arrcode['num_rows']; + $cols = $arrcode['num_cols']; + if (($rows <= 0) || ($cols <= 0)){ + $this->Error('Error in 2D barcode string'); + } + // module width and height + $mw = $style['module_width']; + $mh = $style['module_height']; + if (($mw <= 0) OR ($mh <= 0)) { + $this->Error('Error in 2D barcode string'); + } + // get max dimensions + if ($this->rtl) { + $maxw = $x - $this->lMargin; + } else { + $maxw = $this->w - $this->rMargin - $x; + } + $maxh = ($this->h - $this->tMargin - $this->bMargin); + $ratioHW = ((($rows * $mh) + $hpad) / (($cols * $mw) + $vpad)); + $ratioWH = ((($cols * $mw) + $vpad) / (($rows * $mh) + $hpad)); + if (!$distort) { + if (($maxw * $ratioHW) > $maxh) { + $maxw = $maxh * $ratioWH; + } + if (($maxh * $ratioWH) > $maxw) { + $maxh = $maxw * $ratioHW; + } + } + // set maximum dimensions + if ($w > $maxw) { + $w = $maxw; + } + if ($h > $maxh) { + $h = $maxh; + } + // set dimensions + if ((TCPDF_STATIC::empty_string($w) OR ($w <= 0)) AND (TCPDF_STATIC::empty_string($h) OR ($h <= 0))) { + $w = ($cols + $hpad) * ($mw / $this->k); + $h = ($rows + $vpad) * ($mh / $this->k); + } elseif (($w === '') OR ($w <= 0)) { + $w = $h * $ratioWH; + } elseif (($h === '') OR ($h <= 0)) { + $h = $w * $ratioHW; + } + // barcode size (excluding padding) + $bw = ($w * $cols) / ($cols + $hpad); + $bh = ($h * $rows) / ($rows + $vpad); + // dimension of single barcode cell unit + $cw = $bw / $cols; + $ch = $bh / $rows; + if (!$distort) { + if (($cw / $ch) > ($mw / $mh)) { + // correct horizontal distortion + $cw = $ch * $mw / $mh; + $bw = $cw * $cols; + $style['hpadding'] = ($w - $bw) / (2 * $cw); + } else { + // correct vertical distortion + $ch = $cw * $mh / $mw; + $bh = $ch * $rows; + $style['vpadding'] = ($h - $bh) / (2 * $ch); + } + } + // fit the barcode on available space + list($w, $h, $x, $y) = $this->fitBlock($w, $h, $x, $y, false); + // set alignment + $this->img_rb_y = $y + $h; + // set alignment + if ($this->rtl) { + if ($style['position'] == 'L') { + $xpos = $this->lMargin; + } elseif ($style['position'] == 'C') { + $xpos = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($style['position'] == 'R') { + $xpos = $this->w - $this->rMargin - $w; + } else { + $xpos = $x - $w; + } + $this->img_rb_x = $xpos; + } else { + if ($style['position'] == 'L') { + $xpos = $this->lMargin; + } elseif ($style['position'] == 'C') { + $xpos = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($style['position'] == 'R') { + $xpos = $this->w - $this->rMargin - $w; + } else { + $xpos = $x; + } + $this->img_rb_x = $xpos + $w; + } + $xstart = $xpos + ($style['hpadding'] * $cw); + $ystart = $y + ($style['vpadding'] * $ch); + // barcode is always printed in LTR direction + $tempRTL = $this->rtl; + $this->rtl = false; + // print background color + if ($style['bgcolor']) { + $this->Rect($xpos, $y, $w, $h, $style['border'] ? 'DF' : 'F', '', $style['bgcolor']); + } elseif ($style['border']) { + $this->Rect($xpos, $y, $w, $h, 'D'); + } + // set foreground color + $this->setDrawColorArray($style['fgcolor']); + // print barcode cells + // for each row + for ($r = 0; $r < $rows; ++$r) { + $xr = $xstart; + // for each column + for ($c = 0; $c < $cols; ++$c) { + if ($arrcode['bcode'][$r][$c] == 1) { + // draw a single barcode cell + $this->Rect($xr, $ystart, $cw, $ch, 'F', array(), $style['fgcolor']); + } + $xr += $cw; + } + $ystart += $ch; + } + // restore original direction + $this->rtl = $tempRTL; + // restore previous settings + $this->setGraphicVars($gvars); + // set pointer to align the next text/objects + switch($align) { + case 'T':{ + $this->y = $y; + $this->x = $this->img_rb_x; + break; + } + case 'M':{ + $this->y = $y + round($h/2); + $this->x = $this->img_rb_x; + break; + } + case 'B':{ + $this->y = $this->img_rb_y; + $this->x = $this->img_rb_x; + break; + } + case 'N':{ + $this->setY($this->img_rb_y); + break; + } + default:{ + break; + } + } + $this->endlinex = $this->img_rb_x; + } + + /** + * Returns an array containing current margins: + *
            +
          • $ret['left'] = left margin
          • +
          • $ret['right'] = right margin
          • +
          • $ret['top'] = top margin
          • +
          • $ret['bottom'] = bottom margin
          • +
          • $ret['header'] = header margin
          • +
          • $ret['footer'] = footer margin
          • +
          • $ret['cell'] = cell padding array
          • +
          • $ret['padding_left'] = cell left padding
          • +
          • $ret['padding_top'] = cell top padding
          • +
          • $ret['padding_right'] = cell right padding
          • +
          • $ret['padding_bottom'] = cell bottom padding
          • + *
          + * @return array containing all margins measures + * @public + * @since 3.2.000 (2008-06-23) + */ + public function getMargins() { + $ret = array( + 'left' => $this->lMargin, + 'right' => $this->rMargin, + 'top' => $this->tMargin, + 'bottom' => $this->bMargin, + 'header' => $this->header_margin, + 'footer' => $this->footer_margin, + 'cell' => $this->cell_padding, + 'padding_left' => $this->cell_padding['L'], + 'padding_top' => $this->cell_padding['T'], + 'padding_right' => $this->cell_padding['R'], + 'padding_bottom' => $this->cell_padding['B'] + ); + return $ret; + } + + /** + * Returns an array containing original margins: + *
            +
          • $ret['left'] = left margin
          • +
          • $ret['right'] = right margin
          • + *
          + * @return array containing all margins measures + * @public + * @since 4.0.012 (2008-07-24) + */ + public function getOriginalMargins() { + $ret = array( + 'left' => $this->original_lMargin, + 'right' => $this->original_rMargin + ); + return $ret; + } + + /** + * Returns the current font size. + * @return float current font size + * @public + * @since 3.2.000 (2008-06-23) + */ + public function getFontSize() { + return $this->FontSize; + } + + /** + * Returns the current font size in points unit. + * @return int current font size in points unit + * @public + * @since 3.2.000 (2008-06-23) + */ + public function getFontSizePt() { + return $this->FontSizePt; + } + + /** + * Returns the current font family name. + * @return string current font family name + * @public + * @since 4.3.008 (2008-12-05) + */ + public function getFontFamily() { + return $this->FontFamily; + } + + /** + * Returns the current font style. + * @return string current font style + * @public + * @since 4.3.008 (2008-12-05) + */ + public function getFontStyle() { + return $this->FontStyle; + } + + /** + * Cleanup HTML code (requires HTML Tidy library). + * @param string $html htmlcode to fix + * @param string $default_css CSS commands to add + * @param array|null $tagvs parameters for setHtmlVSpace method + * @param array|null $tidy_options options for tidy_parse_string function + * @return string XHTML code cleaned up + * @author Nicola Asuni + * @public + * @since 5.9.017 (2010-11-16) + * @see setHtmlVSpace() + */ + public function fixHTMLCode($html, $default_css='', $tagvs=null, $tidy_options=null) { + return TCPDF_STATIC::fixHTMLCode($html, $default_css, $tagvs, $tidy_options, $this->tagvspaces); + } + + /** + * Returns the border width from CSS property + * @param string $width border width + * @return int with in user units + * @protected + * @since 5.7.000 (2010-08-02) + */ + protected function getCSSBorderWidth($width) { + if ($width == 'thin') { + $width = (2 / $this->k); + } elseif ($width == 'medium') { + $width = (4 / $this->k); + } elseif ($width == 'thick') { + $width = (6 / $this->k); + } else { + $width = $this->getHTMLUnitToUnits($width, 1, 'px', false); + } + return $width; + } + + /** + * Returns the border dash style from CSS property + * @param string $style border style to convert + * @return int sash style (return -1 in case of none or hidden border) + * @protected + * @since 5.7.000 (2010-08-02) + */ + protected function getCSSBorderDashStyle($style) { + switch (strtolower($style)) { + case 'none': + case 'hidden': { + $dash = -1; + break; + } + case 'dotted': { + $dash = 1; + break; + } + case 'dashed': { + $dash = 3; + break; + } + case 'double': + case 'groove': + case 'ridge': + case 'inset': + case 'outset': + case 'solid': + default: { + $dash = 0; + break; + } + } + return $dash; + } + + /** + * Returns the border style array from CSS border properties + * @param string $cssborder border properties + * @return array containing border properties + * @protected + * @since 5.7.000 (2010-08-02) + */ + protected function getCSSBorderStyle($cssborder) { + $bprop = preg_split('/[\s]+/', trim($cssborder)); + $count = count($bprop); + if ($count > 0 && $bprop[$count - 1] === '!important') { + unset($bprop[$count - 1]); + --$count; + } + + $border = array(); // value to be returned + switch ($count) { + case 2: { + $width = 'medium'; + $style = $bprop[0]; + $color = $bprop[1]; + break; + } + case 1: { + $width = 'medium'; + $style = $bprop[0]; + $color = 'black'; + break; + } + case 0: { + $width = 'medium'; + $style = 'solid'; + $color = 'black'; + break; + } + default: { + $width = $bprop[0]; + $style = $bprop[1]; + $color = $bprop[2]; + break; + } + } + if ($style == 'none') { + return array(); + } + $border['cap'] = 'square'; + $border['join'] = 'miter'; + $border['dash'] = $this->getCSSBorderDashStyle($style); + if ($border['dash'] < 0) { + return array(); + } + $border['width'] = $this->getCSSBorderWidth($width); + $border['color'] = TCPDF_COLORS::convertHTMLColorToDec($color, $this->spot_colors); + return $border; + } + + /** + * Get the internal Cell padding from CSS attribute. + * @param string $csspadding padding properties + * @param float $width width of the containing element + * @return array of cell paddings + * @public + * @since 5.9.000 (2010-10-04) + */ + public function getCSSPadding($csspadding, $width=0) { + $padding = preg_split('/[\s]+/', trim($csspadding)); + $cell_padding = array(); // value to be returned + switch (count($padding)) { + case 4: { + $cell_padding['T'] = $padding[0]; + $cell_padding['R'] = $padding[1]; + $cell_padding['B'] = $padding[2]; + $cell_padding['L'] = $padding[3]; + break; + } + case 3: { + $cell_padding['T'] = $padding[0]; + $cell_padding['R'] = $padding[1]; + $cell_padding['B'] = $padding[2]; + $cell_padding['L'] = $padding[1]; + break; + } + case 2: { + $cell_padding['T'] = $padding[0]; + $cell_padding['R'] = $padding[1]; + $cell_padding['B'] = $padding[0]; + $cell_padding['L'] = $padding[1]; + break; + } + case 1: { + $cell_padding['T'] = $padding[0]; + $cell_padding['R'] = $padding[0]; + $cell_padding['B'] = $padding[0]; + $cell_padding['L'] = $padding[0]; + break; + } + default: { + return $this->cell_padding; + } + } + if ($width == 0) { + $width = $this->w - $this->lMargin - $this->rMargin; + } + $cell_padding['T'] = $this->getHTMLUnitToUnits($cell_padding['T'], $width, 'px', false); + $cell_padding['R'] = $this->getHTMLUnitToUnits($cell_padding['R'], $width, 'px', false); + $cell_padding['B'] = $this->getHTMLUnitToUnits($cell_padding['B'], $width, 'px', false); + $cell_padding['L'] = $this->getHTMLUnitToUnits($cell_padding['L'], $width, 'px', false); + return $cell_padding; + } + + /** + * Get the internal Cell margin from CSS attribute. + * @param string $cssmargin margin properties + * @param float $width width of the containing element + * @return array of cell margins + * @public + * @since 5.9.000 (2010-10-04) + */ + public function getCSSMargin($cssmargin, $width=0) { + $margin = preg_split('/[\s]+/', trim($cssmargin)); + $cell_margin = array(); // value to be returned + switch (count($margin)) { + case 4: { + $cell_margin['T'] = $margin[0]; + $cell_margin['R'] = $margin[1]; + $cell_margin['B'] = $margin[2]; + $cell_margin['L'] = $margin[3]; + break; + } + case 3: { + $cell_margin['T'] = $margin[0]; + $cell_margin['R'] = $margin[1]; + $cell_margin['B'] = $margin[2]; + $cell_margin['L'] = $margin[1]; + break; + } + case 2: { + $cell_margin['T'] = $margin[0]; + $cell_margin['R'] = $margin[1]; + $cell_margin['B'] = $margin[0]; + $cell_margin['L'] = $margin[1]; + break; + } + case 1: { + $cell_margin['T'] = $margin[0]; + $cell_margin['R'] = $margin[0]; + $cell_margin['B'] = $margin[0]; + $cell_margin['L'] = $margin[0]; + break; + } + default: { + return $this->cell_margin; + } + } + if ($width == 0) { + $width = $this->w - $this->lMargin - $this->rMargin; + } + $cell_margin['T'] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $cell_margin['T']), $width, 'px', false); + $cell_margin['R'] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $cell_margin['R']), $width, 'px', false); + $cell_margin['B'] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $cell_margin['B']), $width, 'px', false); + $cell_margin['L'] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $cell_margin['L']), $width, 'px', false); + return $cell_margin; + } + + /** + * Get the border-spacing from CSS attribute. + * @param string $cssbspace border-spacing CSS properties + * @param float $width width of the containing element + * @return array of border spacings + * @public + * @since 5.9.010 (2010-10-27) + */ + public function getCSSBorderMargin($cssbspace, $width=0) { + $space = preg_split('/[\s]+/', trim($cssbspace)); + $border_spacing = array(); // value to be returned + switch (count($space)) { + case 2: { + $border_spacing['H'] = $space[0]; + $border_spacing['V'] = $space[1]; + break; + } + case 1: { + $border_spacing['H'] = $space[0]; + $border_spacing['V'] = $space[0]; + break; + } + default: { + return array('H' => 0, 'V' => 0); + } + } + if ($width == 0) { + $width = $this->w - $this->lMargin - $this->rMargin; + } + $border_spacing['H'] = $this->getHTMLUnitToUnits($border_spacing['H'], $width, 'px', false); + $border_spacing['V'] = $this->getHTMLUnitToUnits($border_spacing['V'], $width, 'px', false); + return $border_spacing; + } + + /** + * Returns the letter-spacing value from CSS value + * @param string $spacing letter-spacing value + * @param float $parent font spacing (tracking) value of the parent element + * @return float quantity to increases or decreases the space between characters in a text. + * @protected + * @since 5.9.000 (2010-10-02) + */ + protected function getCSSFontSpacing($spacing, $parent=0) { + $val = 0; // value to be returned + $spacing = trim($spacing); + switch ($spacing) { + case 'normal': { + $val = 0; + break; + } + case 'inherit': { + if ($parent == 'normal') { + $val = 0; + } else { + $val = $parent; + } + break; + } + default: { + $val = $this->getHTMLUnitToUnits($spacing, 0, 'px', false); + } + } + return $val; + } + + /** + * Returns the percentage of font stretching from CSS value + * @param string $stretch stretch mode + * @param float $parent stretch value of the parent element + * @return float font stretching percentage + * @protected + * @since 5.9.000 (2010-10-02) + */ + protected function getCSSFontStretching($stretch, $parent=100) { + $val = 100; // value to be returned + $stretch = trim($stretch); + switch ($stretch) { + case 'ultra-condensed': { + $val = 40; + break; + } + case 'extra-condensed': { + $val = 55; + break; + } + case 'condensed': { + $val = 70; + break; + } + case 'semi-condensed': { + $val = 85; + break; + } + case 'normal': { + $val = 100; + break; + } + case 'semi-expanded': { + $val = 115; + break; + } + case 'expanded': { + $val = 130; + break; + } + case 'extra-expanded': { + $val = 145; + break; + } + case 'ultra-expanded': { + $val = 160; + break; + } + case 'wider': { + $val = ($parent + 10); + break; + } + case 'narrower': { + $val = ($parent - 10); + break; + } + case 'inherit': { + if ($parent == 'normal') { + $val = 100; + } else { + $val = $parent; + } + break; + } + default: { + $val = $this->getHTMLUnitToUnits($stretch, 100, '%', false); + } + } + return $val; + } + + /** + * Convert HTML string containing font size value to points + * @param string $val String containing font size value and unit. + * @param float $refsize Reference font size in points. + * @param float $parent_size Parent font size in points. + * @param string $defaultunit Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). + * @return float value in points + * @public + */ + public function getHTMLFontUnits($val, $refsize=12, $parent_size=12, $defaultunit='pt') { + $refsize = TCPDF_FONTS::getFontRefSize($refsize); + $parent_size = TCPDF_FONTS::getFontRefSize($parent_size, $refsize); + switch ($val) { + case 'xx-small': { + $size = ($refsize - 4); + break; + } + case 'x-small': { + $size = ($refsize - 3); + break; + } + case 'small': { + $size = ($refsize - 2); + break; + } + case 'medium': { + $size = $refsize; + break; + } + case 'large': { + $size = ($refsize + 2); + break; + } + case 'x-large': { + $size = ($refsize + 4); + break; + } + case 'xx-large': { + $size = ($refsize + 6); + break; + } + case 'smaller': { + $size = ($parent_size - 3); + break; + } + case 'larger': { + $size = ($parent_size + 3); + break; + } + default: { + $parentSize = $this->getHTMLUnitToUnits($parent_size, $refsize, $defaultunit, true); + $size = $this->getHTMLUnitToUnits($val, $parent_size, $defaultunit, true); + } + } + return $size; + } + + /** + * Returns the HTML DOM array. + * @param string $html html code + * @return array + * @protected + * @since 3.2.000 (2008-06-20) + */ + protected function getHtmlDomArray($html) { + // array of CSS styles ( selector => properties). + $css = array(); + // get CSS array defined at previous call + $matches = array(); + if (preg_match_all('/([^\<]*?)<\/cssarray>/is', $html, $matches) > 0) { + if (isset($matches[1][0])) { + $css = array_merge($css, json_decode($this->unhtmlentities($matches[1][0]), true)); + } + $html = preg_replace('/(.*?)<\/cssarray>/is', '', $html); + } + // extract external CSS files + $matches = array(); + if (preg_match_all('/]*?)>/is', $html, $matches) > 0) { + foreach ($matches[1] as $key => $link) { + $type = array(); + if (preg_match('/type[\s]*=[\s]*"text\/css"/', $link, $type)) { + $type = array(); + preg_match('/media[\s]*=[\s]*"([^"]*)"/', $link, $type); + // get 'all' and 'print' media, other media types are discarded + // (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv) + if (empty($type) OR (isset($type[1]) AND (($type[1] == 'all') OR ($type[1] == 'print')))) { + $type = array(); + if (preg_match('/href[\s]*=[\s]*"([^"]*)"/', $link, $type) > 0) { + // read CSS data file + $cssdata = $this->getCachedFileContents(trim($type[1])); + if (($cssdata !== FALSE) AND (strlen($cssdata) > 0)) { + $css = array_merge($css, TCPDF_STATIC::extractCSSproperties($cssdata)); + } + } + } + } + } + } + // extract style tags + $matches = array(); + if (preg_match_all('/]*?)>([^\<]*?)<\/style>/is', $html, $matches) > 0) { + foreach ($matches[1] as $key => $media) { + $type = array(); + preg_match('/media[\s]*=[\s]*"([^"]*)"/', $media, $type); + // get 'all' and 'print' media, other media types are discarded + // (all, braille, embossed, handheld, print, projection, screen, speech, tty, tv) + if (empty($type) OR (isset($type[1]) AND (($type[1] == 'all') OR ($type[1] == 'print')))) { + $cssdata = $matches[2][$key]; + $css = array_merge($css, TCPDF_STATIC::extractCSSproperties($cssdata)); + } + } + } + // create a special tag to contain the CSS array (used for table content) + $csstagarray = ''.htmlentities(json_encode($css)).''; + // remove head and style blocks + $html = preg_replace('/]*?)>(.*?)<\/head>/is', '', $html); + $html = preg_replace('/]*?)>([^\<]*?)<\/style>/is', '', $html); + // define block tags + $blocktags = array('blockquote','br','dd','dl','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','pre','ul','tcpdf','table','tr','td'); + // define self-closing tags + $selfclosingtags = array('area','base','basefont','br','hr','input','img','link','meta'); + // remove all unsupported tags (the line below lists all supported tags) + $html = strip_tags($html, '




    • ', $offset)) !== false) { + $html_a = substr($html, 0, $offset); + $html_b = substr($html, $offset, ($pos - $offset + 11)); + while (preg_match("']*)>(.*?)\n(.*?)'si", $html_b)) { + // preserve newlines on 'si", "\\2\\3", $html_b); + $html_b = preg_replace("']*)>(.*?)[\"](.*?)'si", "\\2''\\3", $html_b); + } + $html = $html_a.$html_b.substr($html, $pos + 11); + $offset = strlen($html_a.$html_b); + } + $html = preg_replace('/([\s]*)', $html); + $offset = 0; + while (($offset < strlen($html)) AND ($pos = strpos($html, '', $offset)) !== false) { + $html_a = substr($html, 0, $offset); + $html_b = substr($html, $offset, ($pos - $offset + 9)); + while (preg_match("']*)>(.*?)'si", $html_b)) { + $html_b = preg_replace("']*)>(.*?)'si", "\\2#!TaB!#\\4#!NwL!#", $html_b); + $html_b = preg_replace("']*)>(.*?)'si", "\\2#!NwL!#", $html_b); + } + $html = $html_a.$html_b.substr($html, $pos + 9); + $offset = strlen($html_a.$html_b); + } + if (preg_match("']*)>'si", "'si", "\" />", $html); + } + $html = str_replace("\n", ' ', $html); + // restore textarea newlines + $html = str_replace('', "\n", $html); + // remove extra spaces from code + $html = preg_replace('/[\s]+<\/(table|tr|ul|ol|dl)>/', '', $html); + $html = preg_replace('/'.$this->re_space['p'].'+<\/(td|th|li|dt|dd)>/'.$this->re_space['m'], '', $html); + $html = preg_replace('/[\s]+<(tr|td|th|li|dt|dd)/', '<\\1', $html); + $html = preg_replace('/'.$this->re_space['p'].'+<(ul|ol|dl|br)/'.$this->re_space['m'], '<\\1', $html); + $html = preg_replace('/<\/(table|tr|td|th|blockquote|dd|dt|dl|div|dt|h1|h2|h3|h4|h5|h6|hr|li|ol|ul|p)>[\s]+<', $html); + $html = preg_replace('/<\/(td|th)>/', '', $html); + $html = preg_replace('/<\/table>([\s]*)/', '
      ', $html); + $html = preg_replace('/'.$this->re_space['p'].'+re_space['m'], chr(32).']*)>[\s]+([^\<])/xi', ' \\2', $html); + $html = preg_replace('/]*)>/xi', '', $html); + $html = preg_replace('/]*)>([^\<]*)<\/textarea>/xi', '', $html); + $html = preg_replace('/]*)><\/li>/', ' 
    • ', $html); + $html = preg_replace('/]*)>'.$this->re_space['p'].'*re_space['m'], ' \/]*)>[\s]/', '<\\1> ', $html); // preserve some spaces + $html = preg_replace('/[\s]<\/([^\>]*)>/', ' ', $html); // preserve some spaces + $html = preg_replace('//', '', $html); // fix sub/sup alignment + $html = preg_replace('/'.$this->re_space['p'].'+/'.$this->re_space['m'], chr(32), $html); // replace multiple spaces with a single space + // trim string + $html = $this->stringTrim($html); + // fix br tag after li + $html = preg_replace('/
    • ]*)>/', '
    • {{ user.username|e }}
    • + * {% endfor %} + * + * + * @final + */ +class ForTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $targets = $this->parser->getExpressionParser()->parseAssignmentExpression(); + $stream->expect(Token::OPERATOR_TYPE, 'in'); + $seq = $this->parser->getExpressionParser()->parseExpression(); + + $ifexpr = null; + if ($stream->nextIf(Token::NAME_TYPE, 'if')) { + $ifexpr = $this->parser->getExpressionParser()->parseExpression(); + } + + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideForFork']); + if ('else' == $stream->next()->getValue()) { + $stream->expect(Token::BLOCK_END_TYPE); + $else = $this->parser->subparse([$this, 'decideForEnd'], true); + } else { + $else = null; + } + $stream->expect(Token::BLOCK_END_TYPE); + + if (\count($targets) > 1) { + $keyTarget = $targets->getNode(0); + $keyTarget = new AssignNameExpression($keyTarget->getAttribute('name'), $keyTarget->getTemplateLine()); + $valueTarget = $targets->getNode(1); + $valueTarget = new AssignNameExpression($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); + } else { + $keyTarget = new AssignNameExpression('_key', $lineno); + $valueTarget = $targets->getNode(0); + $valueTarget = new AssignNameExpression($valueTarget->getAttribute('name'), $valueTarget->getTemplateLine()); + } + + if ($ifexpr) { + $this->checkLoopUsageCondition($stream, $ifexpr); + $this->checkLoopUsageBody($stream, $body); + } + + return new ForNode($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag()); + } + + public function decideForFork(Token $token) + { + return $token->test(['else', 'endfor']); + } + + public function decideForEnd(Token $token) + { + return $token->test('endfor'); + } + + // the loop variable cannot be used in the condition + protected function checkLoopUsageCondition(TokenStream $stream, \Twig_NodeInterface $node) + { + if ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression && 'loop' == $node->getNode('node')->getAttribute('name')) { + throw new SyntaxError('The "loop" variable cannot be used in a looping condition.', $node->getTemplateLine(), $stream->getSourceContext()); + } + + foreach ($node as $n) { + if (!$n) { + continue; + } + + $this->checkLoopUsageCondition($stream, $n); + } + } + + // check usage of non-defined loop-items + // it does not catch all problems (for instance when a for is included into another or when the variable is used in an include) + protected function checkLoopUsageBody(TokenStream $stream, \Twig_NodeInterface $node) + { + if ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression && 'loop' == $node->getNode('node')->getAttribute('name')) { + $attribute = $node->getNode('attribute'); + if ($attribute instanceof ConstantExpression && \in_array($attribute->getAttribute('value'), ['length', 'revindex0', 'revindex', 'last'])) { + throw new SyntaxError(sprintf('The "loop.%s" variable is not defined when looping with a condition.', $attribute->getAttribute('value')), $node->getTemplateLine(), $stream->getSourceContext()); + } + } + + // should check for parent.loop.XXX usage + if ($node instanceof ForNode) { + return; + } + + foreach ($node as $n) { + if (!$n) { + continue; + } + + $this->checkLoopUsageBody($stream, $n); + } + } + + public function getTag() + { + return 'for'; + } +} + +class_alias('Twig\TokenParser\ForTokenParser', 'Twig_TokenParser_For'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/FromTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/FromTokenParser.php new file mode 100755 index 0000000..4cce650 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/FromTokenParser.php @@ -0,0 +1,72 @@ +parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + $stream->expect(Token::NAME_TYPE, 'import'); + + $targets = []; + do { + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + + $alias = $name; + if ($stream->nextIf('as')) { + $alias = $stream->expect(Token::NAME_TYPE)->getValue(); + } + + $targets[$name] = $alias; + + if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } while (true); + + $stream->expect(Token::BLOCK_END_TYPE); + + $var = new AssignNameExpression($this->parser->getVarName(), $token->getLine()); + $node = new ImportNode($macro, $var, $token->getLine(), $this->getTag()); + + foreach ($targets as $name => $alias) { + if ($this->parser->isReservedMacroName($name)) { + throw new SyntaxError(sprintf('"%s" cannot be an imported macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext()); + } + + $this->parser->addImportedSymbol('function', $alias, 'get'.$name, $var); + } + + return $node; + } + + public function getTag() + { + return 'from'; + } +} + +class_alias('Twig\TokenParser\FromTokenParser', 'Twig_TokenParser_From'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/IfTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/IfTokenParser.php new file mode 100755 index 0000000..2631a20 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/IfTokenParser.php @@ -0,0 +1,91 @@ + + * {% for user in users %} + *
    • {{ user.username|e }}
    • + * {% endfor %} + * + * {% endif %} + * + * @final + */ +class IfTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) + { + $lineno = $token->getLine(); + $expr = $this->parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideIfFork']); + $tests = [$expr, $body]; + $else = null; + + $end = false; + while (!$end) { + switch ($stream->next()->getValue()) { + case 'else': + $stream->expect(Token::BLOCK_END_TYPE); + $else = $this->parser->subparse([$this, 'decideIfEnd']); + break; + + case 'elseif': + $expr = $this->parser->getExpressionParser()->parseExpression(); + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideIfFork']); + $tests[] = $expr; + $tests[] = $body; + break; + + case 'endif': + $end = true; + break; + + default: + throw new SyntaxError(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d).', $lineno), $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + } + + $stream->expect(Token::BLOCK_END_TYPE); + + return new IfNode(new Node($tests), $else, $lineno, $this->getTag()); + } + + public function decideIfFork(Token $token) + { + return $token->test(['elseif', 'else', 'endif']); + } + + public function decideIfEnd(Token $token) + { + return $token->test(['endif']); + } + + public function getTag() + { + return 'if'; + } +} + +class_alias('Twig\TokenParser\IfTokenParser', 'Twig_TokenParser_If'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/ImportTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/ImportTokenParser.php new file mode 100755 index 0000000..88395b9 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/ImportTokenParser.php @@ -0,0 +1,45 @@ +parser->getExpressionParser()->parseExpression(); + $this->parser->getStream()->expect(Token::NAME_TYPE, 'as'); + $var = new AssignNameExpression($this->parser->getStream()->expect(Token::NAME_TYPE)->getValue(), $token->getLine()); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + $this->parser->addImportedSymbol('template', $var->getAttribute('name')); + + return new ImportNode($macro, $var, $token->getLine(), $this->getTag()); + } + + public function getTag() + { + return 'import'; + } +} + +class_alias('Twig\TokenParser\ImportTokenParser', 'Twig_TokenParser_Import'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php new file mode 100755 index 0000000..57aa4cf --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/IncludeTokenParser.php @@ -0,0 +1,68 @@ +parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + return new IncludeNode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + protected function parseArguments() + { + $stream = $this->parser->getStream(); + + $ignoreMissing = false; + if ($stream->nextIf(Token::NAME_TYPE, 'ignore')) { + $stream->expect(Token::NAME_TYPE, 'missing'); + + $ignoreMissing = true; + } + + $variables = null; + if ($stream->nextIf(Token::NAME_TYPE, 'with')) { + $variables = $this->parser->getExpressionParser()->parseExpression(); + } + + $only = false; + if ($stream->nextIf(Token::NAME_TYPE, 'only')) { + $only = true; + } + + $stream->expect(Token::BLOCK_END_TYPE); + + return [$variables, $only, $ignoreMissing]; + } + + public function getTag() + { + return 'include'; + } +} + +class_alias('Twig\TokenParser\IncludeTokenParser', 'Twig_TokenParser_Include'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/MacroTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/MacroTokenParser.php new file mode 100755 index 0000000..a0d66e7 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/MacroTokenParser.php @@ -0,0 +1,68 @@ + + * {% endmacro %} + * + * @final + */ +class MacroTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + + $arguments = $this->parser->getExpressionParser()->parseArguments(true, true); + + $stream->expect(Token::BLOCK_END_TYPE); + $this->parser->pushLocalScope(); + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + if ($token = $stream->nextIf(Token::NAME_TYPE)) { + $value = $token->getValue(); + + if ($value != $name) { + throw new SyntaxError(sprintf('Expected endmacro for macro "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + } + $this->parser->popLocalScope(); + $stream->expect(Token::BLOCK_END_TYPE); + + $this->parser->setMacro($name, new MacroNode($name, new BodyNode([$body]), $arguments, $lineno, $this->getTag())); + + return new Node(); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endmacro'); + } + + public function getTag() + { + return 'macro'; + } +} + +class_alias('Twig\TokenParser\MacroTokenParser', 'Twig_TokenParser_Macro'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php new file mode 100755 index 0000000..0f3ad9e --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/SandboxTokenParser.php @@ -0,0 +1,67 @@ +parser->getStream(); + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + $stream->expect(Token::BLOCK_END_TYPE); + + // in a sandbox tag, only include tags are allowed + if (!$body instanceof IncludeNode) { + foreach ($body as $node) { + if ($node instanceof TextNode && ctype_space($node->getAttribute('data'))) { + continue; + } + + if (!$node instanceof IncludeNode) { + throw new SyntaxError('Only "include" tags are allowed within a "sandbox" section.', $node->getTemplateLine(), $stream->getSourceContext()); + } + } + } + + return new SandboxNode($body, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endsandbox'); + } + + public function getTag() + { + return 'sandbox'; + } +} + +class_alias('Twig\TokenParser\SandboxTokenParser', 'Twig_TokenParser_Sandbox'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/SetTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/SetTokenParser.php new file mode 100755 index 0000000..eebebc6 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/SetTokenParser.php @@ -0,0 +1,74 @@ +getLine(); + $stream = $this->parser->getStream(); + $names = $this->parser->getExpressionParser()->parseAssignmentExpression(); + + $capture = false; + if ($stream->nextIf(Token::OPERATOR_TYPE, '=')) { + $values = $this->parser->getExpressionParser()->parseMultitargetExpression(); + + $stream->expect(Token::BLOCK_END_TYPE); + + if (\count($names) !== \count($values)) { + throw new SyntaxError('When using set, you must have the same number of variables and assignments.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + } else { + $capture = true; + + if (\count($names) > 1) { + throw new SyntaxError('When using set with a block, you cannot have a multi-target.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + + $stream->expect(Token::BLOCK_END_TYPE); + + $values = $this->parser->subparse([$this, 'decideBlockEnd'], true); + $stream->expect(Token::BLOCK_END_TYPE); + } + + return new SetNode($capture, $names, $values, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endset'); + } + + public function getTag() + { + return 'set'; + } +} + +class_alias('Twig\TokenParser\SetTokenParser', 'Twig_TokenParser_Set'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php new file mode 100755 index 0000000..5b5656b --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/SpacelessTokenParser.php @@ -0,0 +1,53 @@ + + * foo + *
    • ', $html); + // fix first image tag alignment + $html = preg_replace('/^
      FontFamily; + $dom[$key]['fontstyle'] = $this->FontStyle; + $dom[$key]['fontsize'] = $this->FontSizePt; + $dom[$key]['font-stretch'] = $this->font_stretching; + $dom[$key]['letter-spacing'] = $this->font_spacing; + $dom[$key]['stroke'] = $this->textstrokewidth; + $dom[$key]['fill'] = (($this->textrendermode % 2) == 0); + $dom[$key]['clip'] = ($this->textrendermode > 3); + $dom[$key]['line-height'] = $this->cell_height_ratio; + $dom[$key]['bgcolor'] = false; + $dom[$key]['fgcolor'] = $this->fgcolor; // color + $dom[$key]['strokecolor'] = $this->strokecolor; + $dom[$key]['align'] = ''; + $dom[$key]['listtype'] = ''; + $dom[$key]['text-indent'] = 0; + $dom[$key]['text-transform'] = ''; + $dom[$key]['border'] = array(); + $dom[$key]['dir'] = $this->rtl?'rtl':'ltr'; + $thead = false; // true when we are inside the THEAD tag + ++$key; + $level = array(); + array_push($level, 0); // root + while ($elkey < $maxel) { + $dom[$key] = array(); + $element = $a[$elkey]; + $dom[$key]['elkey'] = $elkey; + if (preg_match($tagpattern, $element)) { + // html tag + $element = substr($element, 1, -1); + // get tag name + preg_match('/[\/]?([a-zA-Z0-9]*)/', $element, $tag); + $tagname = strtolower($tag[1]); + // check if we are inside a table header + if ($tagname == 'thead') { + if ($element[0] == '/') { + $thead = false; + } else { + $thead = true; + } + ++$elkey; + continue; + } + $dom[$key]['tag'] = true; + $dom[$key]['value'] = $tagname; + if (in_array($dom[$key]['value'], $blocktags)) { + $dom[$key]['block'] = true; + } else { + $dom[$key]['block'] = false; + } + if ($element[0] == '/') { + // *** closing html tag + $dom[$key]['opening'] = false; + $dom[$key]['parent'] = end($level); + array_pop($level); + $dom[$key]['hide'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['hide']; + $dom[$key]['fontname'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontname']; + $dom[$key]['fontstyle'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontstyle']; + $dom[$key]['fontsize'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fontsize']; + $dom[$key]['font-stretch'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['font-stretch']; + $dom[$key]['letter-spacing'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['letter-spacing']; + $dom[$key]['stroke'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['stroke']; + $dom[$key]['fill'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fill']; + $dom[$key]['clip'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['clip']; + $dom[$key]['line-height'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['line-height']; + $dom[$key]['bgcolor'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['bgcolor']; + $dom[$key]['fgcolor'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['fgcolor']; + $dom[$key]['strokecolor'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['strokecolor']; + $dom[$key]['align'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['align']; + $dom[$key]['text-transform'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['text-transform']; + $dom[$key]['dir'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['dir']; + if (isset($dom[($dom[($dom[$key]['parent'])]['parent'])]['listtype'])) { + $dom[$key]['listtype'] = $dom[($dom[($dom[$key]['parent'])]['parent'])]['listtype']; + } + // set the number of columns in table tag + if (($dom[$key]['value'] == 'tr') AND (!isset($dom[($dom[($dom[$key]['parent'])]['parent'])]['cols']))) { + $dom[($dom[($dom[$key]['parent'])]['parent'])]['cols'] = $dom[($dom[$key]['parent'])]['cols']; + } + if (($dom[$key]['value'] == 'td') OR ($dom[$key]['value'] == 'th')) { + $dom[($dom[$key]['parent'])]['content'] = $csstagarray; + for ($i = ($dom[$key]['parent'] + 1); $i < $key; ++$i) { + $dom[($dom[$key]['parent'])]['content'] .= stripslashes($a[$dom[$i]['elkey']]); + } + $key = $i; + // mark nested tables + $dom[($dom[$key]['parent'])]['content'] = str_replace('', '', $dom[($dom[$key]['parent'])]['content']); + $dom[($dom[$key]['parent'])]['content'] = str_replace('', '', $dom[($dom[$key]['parent'])]['content']); + } + // store header rows on a new table + if ( + ($dom[$key]['value'] === 'tr') + && !empty($dom[($dom[$key]['parent'])]['thead']) + && ($dom[($dom[$key]['parent'])]['thead'] === true) + ) { + if (TCPDF_STATIC::empty_string($dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'])) { + $dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'] = $csstagarray.$a[$dom[($dom[($dom[$key]['parent'])]['parent'])]['elkey']]; + } + for ($i = $dom[$key]['parent']; $i <= $key; ++$i) { + $dom[($dom[($dom[$key]['parent'])]['parent'])]['thead'] .= $a[$dom[$i]['elkey']]; + } + if (!isset($dom[($dom[$key]['parent'])]['attribute'])) { + $dom[($dom[$key]['parent'])]['attribute'] = array(); + } + // header elements must be always contained in a single page + $dom[($dom[$key]['parent'])]['attribute']['nobr'] = 'true'; + } + if (($dom[$key]['value'] == 'table') AND (!TCPDF_STATIC::empty_string($dom[($dom[$key]['parent'])]['thead']))) { + // remove the nobr attributes from the table header + $dom[($dom[$key]['parent'])]['thead'] = str_replace(' nobr="true"', '', $dom[($dom[$key]['parent'])]['thead']); + $dom[($dom[$key]['parent'])]['thead'] .= ''; + } + } else { + // *** opening or self-closing html tag + $dom[$key]['opening'] = true; + $dom[$key]['parent'] = end($level); + if ((substr($element, -1, 1) == '/') OR (in_array($dom[$key]['value'], $selfclosingtags))) { + // self-closing tag + $dom[$key]['self'] = true; + } else { + // opening tag + array_push($level, $key); + $dom[$key]['self'] = false; + } + // copy some values from parent + $parentkey = 0; + if ($key > 0) { + $parentkey = $dom[$key]['parent']; + $dom[$key]['hide'] = $dom[$parentkey]['hide']; + $dom[$key]['fontname'] = $dom[$parentkey]['fontname']; + $dom[$key]['fontstyle'] = $dom[$parentkey]['fontstyle']; + $dom[$key]['fontsize'] = $dom[$parentkey]['fontsize']; + $dom[$key]['font-stretch'] = $dom[$parentkey]['font-stretch']; + $dom[$key]['letter-spacing'] = $dom[$parentkey]['letter-spacing']; + $dom[$key]['stroke'] = $dom[$parentkey]['stroke']; + $dom[$key]['fill'] = $dom[$parentkey]['fill']; + $dom[$key]['clip'] = $dom[$parentkey]['clip']; + $dom[$key]['line-height'] = $dom[$parentkey]['line-height']; + $dom[$key]['bgcolor'] = $dom[$parentkey]['bgcolor']; + $dom[$key]['fgcolor'] = $dom[$parentkey]['fgcolor']; + $dom[$key]['strokecolor'] = $dom[$parentkey]['strokecolor']; + $dom[$key]['align'] = $dom[$parentkey]['align']; + $dom[$key]['listtype'] = $dom[$parentkey]['listtype']; + $dom[$key]['text-indent'] = $dom[$parentkey]['text-indent']; + $dom[$key]['text-transform'] = $dom[$parentkey]['text-transform']; + $dom[$key]['border'] = array(); + $dom[$key]['dir'] = $dom[$parentkey]['dir']; + } + // get attributes + preg_match_all('/([^=\s]*)[\s]*=[\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER); + $dom[$key]['attribute'] = array(); // reset attribute array + foreach($attr_array[1] as $id => $name) { + $dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id]; + } + if (!empty($css)) { + // merge CSS style to current style + list($dom[$key]['csssel'], $dom[$key]['cssdata']) = TCPDF_STATIC::getCSSdataArray($dom, $key, $css); + $dom[$key]['attribute']['style'] = TCPDF_STATIC::getTagStyleFromCSSarray($dom[$key]['cssdata']); + } + // split style attributes + if (isset($dom[$key]['attribute']['style']) AND !empty($dom[$key]['attribute']['style'])) { + // get style attributes + preg_match_all('/([^;:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER); + $dom[$key]['style'] = array(); // reset style attribute array + foreach($style_array[1] as $id => $name) { + // in case of duplicate attribute the last replace the previous + $dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]); + } + // --- get some style attributes --- + // text direction + if (isset($dom[$key]['style']['direction'])) { + $dom[$key]['dir'] = $dom[$key]['style']['direction']; + } + // display + if (isset($dom[$key]['style']['display'])) { + $dom[$key]['hide'] = (trim(strtolower($dom[$key]['style']['display'])) == 'none'); + } + // font family + if (isset($dom[$key]['style']['font-family'])) { + $dom[$key]['fontname'] = $this->getFontFamilyName($dom[$key]['style']['font-family']); + } + // list-style-type + if (isset($dom[$key]['style']['list-style-type'])) { + $dom[$key]['listtype'] = trim(strtolower($dom[$key]['style']['list-style-type'])); + if ($dom[$key]['listtype'] == 'inherit') { + $dom[$key]['listtype'] = $dom[$parentkey]['listtype']; + } + } + // text-indent + if (isset($dom[$key]['style']['text-indent'])) { + $dom[$key]['text-indent'] = $this->getHTMLUnitToUnits($dom[$key]['style']['text-indent']); + if ($dom[$key]['text-indent'] == 'inherit') { + $dom[$key]['text-indent'] = $dom[$parentkey]['text-indent']; + } + } + // text-transform + if (isset($dom[$key]['style']['text-transform'])) { + $dom[$key]['text-transform'] = $dom[$key]['style']['text-transform']; + } + // font size + if (isset($dom[$key]['style']['font-size'])) { + $fsize = trim($dom[$key]['style']['font-size']); + $dom[$key]['fontsize'] = $this->getHTMLFontUnits($fsize, $dom[0]['fontsize'], $dom[$parentkey]['fontsize'], 'pt'); + } + // font-stretch + if (isset($dom[$key]['style']['font-stretch'])) { + $dom[$key]['font-stretch'] = $this->getCSSFontStretching($dom[$key]['style']['font-stretch'], $dom[$parentkey]['font-stretch']); + } + // letter-spacing + if (isset($dom[$key]['style']['letter-spacing'])) { + $dom[$key]['letter-spacing'] = $this->getCSSFontSpacing($dom[$key]['style']['letter-spacing'], $dom[$parentkey]['letter-spacing']); + } + // line-height (internally is the cell height ratio) + if (isset($dom[$key]['style']['line-height'])) { + $lineheight = trim($dom[$key]['style']['line-height']); + switch ($lineheight) { + // A normal line height. This is default + case 'normal': { + $dom[$key]['line-height'] = $dom[0]['line-height']; + break; + } + case 'inherit': { + $dom[$key]['line-height'] = $dom[$parentkey]['line-height']; + } + default: { + if (is_numeric($lineheight)) { + // convert to percentage of font height + $lineheight = ($lineheight * 100).'%'; + } + $dom[$key]['line-height'] = $this->getHTMLUnitToUnits($lineheight, 1, '%', true); + if (substr($lineheight, -1) !== '%') { + if ($dom[$key]['fontsize'] <= 0) { + $dom[$key]['line-height'] = 1; + } else { + $dom[$key]['line-height'] = (($dom[$key]['line-height'] - $this->cell_padding['T'] - $this->cell_padding['B']) / $dom[$key]['fontsize']); + } + } + } + } + } + // font style + if (isset($dom[$key]['style']['font-weight'])) { + if (strtolower($dom[$key]['style']['font-weight'][0]) == 'n') { + if (strpos($dom[$key]['fontstyle'], 'B') !== false) { + $dom[$key]['fontstyle'] = str_replace('B', '', $dom[$key]['fontstyle']); + } + } elseif (strtolower($dom[$key]['style']['font-weight'][0]) == 'b') { + $dom[$key]['fontstyle'] .= 'B'; + } + } + if (isset($dom[$key]['style']['font-style']) AND (strtolower($dom[$key]['style']['font-style'][0]) == 'i')) { + $dom[$key]['fontstyle'] .= 'I'; + } + // font color + if (isset($dom[$key]['style']['color']) AND (!TCPDF_STATIC::empty_string($dom[$key]['style']['color']))) { + $dom[$key]['fgcolor'] = TCPDF_COLORS::convertHTMLColorToDec($dom[$key]['style']['color'], $this->spot_colors); + } elseif ($dom[$key]['value'] == 'a') { + $dom[$key]['fgcolor'] = $this->htmlLinkColorArray; + } + // background color + if (isset($dom[$key]['style']['background-color']) AND (!TCPDF_STATIC::empty_string($dom[$key]['style']['background-color']))) { + $dom[$key]['bgcolor'] = TCPDF_COLORS::convertHTMLColorToDec($dom[$key]['style']['background-color'], $this->spot_colors); + } + // text-decoration + if (isset($dom[$key]['style']['text-decoration'])) { + $decors = explode(' ', strtolower($dom[$key]['style']['text-decoration'])); + foreach ($decors as $dec) { + $dec = trim($dec); + if (!TCPDF_STATIC::empty_string($dec)) { + if ($dec[0] == 'u') { + // underline + $dom[$key]['fontstyle'] .= 'U'; + } elseif ($dec[0] == 'l') { + // line-through + $dom[$key]['fontstyle'] .= 'D'; + } elseif ($dec[0] == 'o') { + // overline + $dom[$key]['fontstyle'] .= 'O'; + } + } + } + } elseif ($dom[$key]['value'] == 'a') { + $dom[$key]['fontstyle'] = $this->htmlLinkFontStyle; + } + // check for width attribute + if (isset($dom[$key]['style']['width'])) { + $dom[$key]['width'] = $dom[$key]['style']['width']; + } + // check for height attribute + if (isset($dom[$key]['style']['height'])) { + $dom[$key]['height'] = $dom[$key]['style']['height']; + } + // check for text alignment + if (isset($dom[$key]['style']['text-align'])) { + $dom[$key]['align'] = strtoupper($dom[$key]['style']['text-align'][0]); + } + // check for CSS border properties + if (isset($dom[$key]['style']['border'])) { + $borderstyle = $this->getCSSBorderStyle($dom[$key]['style']['border']); + if (!empty($borderstyle)) { + $dom[$key]['border']['LTRB'] = $borderstyle; + } + } + if (isset($dom[$key]['style']['border-color'])) { + $brd_colors = preg_split('/[\s]+/', trim($dom[$key]['style']['border-color'])); + if (isset($brd_colors[3])) { + $dom[$key]['border']['L']['color'] = TCPDF_COLORS::convertHTMLColorToDec($brd_colors[3], $this->spot_colors); + } + if (isset($brd_colors[1])) { + $dom[$key]['border']['R']['color'] = TCPDF_COLORS::convertHTMLColorToDec($brd_colors[1], $this->spot_colors); + } + if (isset($brd_colors[0])) { + $dom[$key]['border']['T']['color'] = TCPDF_COLORS::convertHTMLColorToDec($brd_colors[0], $this->spot_colors); + } + if (isset($brd_colors[2])) { + $dom[$key]['border']['B']['color'] = TCPDF_COLORS::convertHTMLColorToDec($brd_colors[2], $this->spot_colors); + } + } + if (isset($dom[$key]['style']['border-width'])) { + $brd_widths = preg_split('/[\s]+/', trim($dom[$key]['style']['border-width'])); + if (isset($brd_widths[3])) { + $dom[$key]['border']['L']['width'] = $this->getCSSBorderWidth($brd_widths[3]); + } + if (isset($brd_widths[1])) { + $dom[$key]['border']['R']['width'] = $this->getCSSBorderWidth($brd_widths[1]); + } + if (isset($brd_widths[0])) { + $dom[$key]['border']['T']['width'] = $this->getCSSBorderWidth($brd_widths[0]); + } + if (isset($brd_widths[2])) { + $dom[$key]['border']['B']['width'] = $this->getCSSBorderWidth($brd_widths[2]); + } + } + if (isset($dom[$key]['style']['border-style'])) { + $brd_styles = preg_split('/[\s]+/', trim($dom[$key]['style']['border-style'])); + if (isset($brd_styles[3]) AND ($brd_styles[3]!='none')) { + $dom[$key]['border']['L']['cap'] = 'square'; + $dom[$key]['border']['L']['join'] = 'miter'; + $dom[$key]['border']['L']['dash'] = $this->getCSSBorderDashStyle($brd_styles[3]); + if ($dom[$key]['border']['L']['dash'] < 0) { + $dom[$key]['border']['L'] = array(); + } + } + if (isset($brd_styles[1])) { + $dom[$key]['border']['R']['cap'] = 'square'; + $dom[$key]['border']['R']['join'] = 'miter'; + $dom[$key]['border']['R']['dash'] = $this->getCSSBorderDashStyle($brd_styles[1]); + if ($dom[$key]['border']['R']['dash'] < 0) { + $dom[$key]['border']['R'] = array(); + } + } + if (isset($brd_styles[0])) { + $dom[$key]['border']['T']['cap'] = 'square'; + $dom[$key]['border']['T']['join'] = 'miter'; + $dom[$key]['border']['T']['dash'] = $this->getCSSBorderDashStyle($brd_styles[0]); + if ($dom[$key]['border']['T']['dash'] < 0) { + $dom[$key]['border']['T'] = array(); + } + } + if (isset($brd_styles[2])) { + $dom[$key]['border']['B']['cap'] = 'square'; + $dom[$key]['border']['B']['join'] = 'miter'; + $dom[$key]['border']['B']['dash'] = $this->getCSSBorderDashStyle($brd_styles[2]); + if ($dom[$key]['border']['B']['dash'] < 0) { + $dom[$key]['border']['B'] = array(); + } + } + } + $cellside = array('L' => 'left', 'R' => 'right', 'T' => 'top', 'B' => 'bottom'); + foreach ($cellside as $bsk => $bsv) { + if (isset($dom[$key]['style']['border-'.$bsv])) { + $borderstyle = $this->getCSSBorderStyle($dom[$key]['style']['border-'.$bsv]); + if (!empty($borderstyle)) { + $dom[$key]['border'][$bsk] = $borderstyle; + } + } + if (isset($dom[$key]['style']['border-'.$bsv.'-color'])) { + $dom[$key]['border'][$bsk]['color'] = TCPDF_COLORS::convertHTMLColorToDec($dom[$key]['style']['border-'.$bsv.'-color'], $this->spot_colors); + } + if (isset($dom[$key]['style']['border-'.$bsv.'-width'])) { + $dom[$key]['border'][$bsk]['width'] = $this->getCSSBorderWidth($dom[$key]['style']['border-'.$bsv.'-width']); + } + if (isset($dom[$key]['style']['border-'.$bsv.'-style'])) { + $dom[$key]['border'][$bsk]['dash'] = $this->getCSSBorderDashStyle($dom[$key]['style']['border-'.$bsv.'-style']); + if ($dom[$key]['border'][$bsk]['dash'] < 0) { + $dom[$key]['border'][$bsk] = array(); + } + } + } + // check for CSS padding properties + if (isset($dom[$key]['style']['padding'])) { + $dom[$key]['padding'] = $this->getCSSPadding($dom[$key]['style']['padding']); + } else { + $dom[$key]['padding'] = $this->cell_padding; + } + foreach ($cellside as $psk => $psv) { + if (isset($dom[$key]['style']['padding-'.$psv])) { + $dom[$key]['padding'][$psk] = $this->getHTMLUnitToUnits($dom[$key]['style']['padding-'.$psv], 0, 'px', false); + } + } + // check for CSS margin properties + if (isset($dom[$key]['style']['margin'])) { + $dom[$key]['margin'] = $this->getCSSMargin($dom[$key]['style']['margin']); + } else { + $dom[$key]['margin'] = $this->cell_margin; + } + foreach ($cellside as $psk => $psv) { + if (isset($dom[$key]['style']['margin-'.$psv])) { + $dom[$key]['margin'][$psk] = $this->getHTMLUnitToUnits(str_replace('auto', '0', $dom[$key]['style']['margin-'.$psv]), 0, 'px', false); + } + } + // check for CSS border-spacing properties + if (isset($dom[$key]['style']['border-spacing'])) { + $dom[$key]['border-spacing'] = $this->getCSSBorderMargin($dom[$key]['style']['border-spacing']); + } + // page-break-inside + if (isset($dom[$key]['style']['page-break-inside']) AND ($dom[$key]['style']['page-break-inside'] == 'avoid')) { + $dom[$key]['attribute']['nobr'] = 'true'; + } + // page-break-before + if (isset($dom[$key]['style']['page-break-before'])) { + if ($dom[$key]['style']['page-break-before'] == 'always') { + $dom[$key]['attribute']['pagebreak'] = 'true'; + } elseif ($dom[$key]['style']['page-break-before'] == 'left') { + $dom[$key]['attribute']['pagebreak'] = 'left'; + } elseif ($dom[$key]['style']['page-break-before'] == 'right') { + $dom[$key]['attribute']['pagebreak'] = 'right'; + } + } + // page-break-after + if (isset($dom[$key]['style']['page-break-after'])) { + if ($dom[$key]['style']['page-break-after'] == 'always') { + $dom[$key]['attribute']['pagebreakafter'] = 'true'; + } elseif ($dom[$key]['style']['page-break-after'] == 'left') { + $dom[$key]['attribute']['pagebreakafter'] = 'left'; + } elseif ($dom[$key]['style']['page-break-after'] == 'right') { + $dom[$key]['attribute']['pagebreakafter'] = 'right'; + } + } + } + if (isset($dom[$key]['attribute']['display'])) { + $dom[$key]['hide'] = (trim(strtolower($dom[$key]['attribute']['display'])) == 'none'); + } + if (isset($dom[$key]['attribute']['border']) AND ($dom[$key]['attribute']['border'] != 0)) { + $borderstyle = $this->getCSSBorderStyle($dom[$key]['attribute']['border'].' solid black'); + if (!empty($borderstyle)) { + $dom[$key]['border']['LTRB'] = $borderstyle; + } + } + // check for font tag + if ($dom[$key]['value'] == 'font') { + // font family + if (isset($dom[$key]['attribute']['face'])) { + $dom[$key]['fontname'] = $this->getFontFamilyName($dom[$key]['attribute']['face']); + } + // font size + if (isset($dom[$key]['attribute']['size'])) { + if ($key > 0) { + if ($dom[$key]['attribute']['size'][0] == '+') { + $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] + intval(substr($dom[$key]['attribute']['size'], 1)); + } elseif ($dom[$key]['attribute']['size'][0] == '-') { + $dom[$key]['fontsize'] = $dom[($dom[$key]['parent'])]['fontsize'] - intval(substr($dom[$key]['attribute']['size'], 1)); + } else { + $dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']); + } + } else { + $dom[$key]['fontsize'] = intval($dom[$key]['attribute']['size']); + } + } + } + // force natural alignment for lists + if ((($dom[$key]['value'] == 'ul') OR ($dom[$key]['value'] == 'ol') OR ($dom[$key]['value'] == 'dl')) + AND (!isset($dom[$key]['align']) OR TCPDF_STATIC::empty_string($dom[$key]['align']) OR ($dom[$key]['align'] != 'J'))) { + if ($this->rtl) { + $dom[$key]['align'] = 'R'; + } else { + $dom[$key]['align'] = 'L'; + } + } + if (($dom[$key]['value'] == 'small') OR ($dom[$key]['value'] == 'sup') OR ($dom[$key]['value'] == 'sub')) { + if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) { + $dom[$key]['fontsize'] = $dom[$key]['fontsize'] * K_SMALL_RATIO; + } + } + if (($dom[$key]['value'] == 'strong') OR ($dom[$key]['value'] == 'b')) { + $dom[$key]['fontstyle'] .= 'B'; + } + if (($dom[$key]['value'] == 'em') OR ($dom[$key]['value'] == 'i')) { + $dom[$key]['fontstyle'] .= 'I'; + } + if ($dom[$key]['value'] == 'u') { + $dom[$key]['fontstyle'] .= 'U'; + } + if (($dom[$key]['value'] == 'del') OR ($dom[$key]['value'] == 's') OR ($dom[$key]['value'] == 'strike')) { + $dom[$key]['fontstyle'] .= 'D'; + } + if (!isset($dom[$key]['style']['text-decoration']) AND ($dom[$key]['value'] == 'a')) { + $dom[$key]['fontstyle'] = $this->htmlLinkFontStyle; + } + if (($dom[$key]['value'] == 'pre') OR ($dom[$key]['value'] == 'tt')) { + $dom[$key]['fontname'] = $this->default_monospaced_font; + } + if (!empty($dom[$key]['value']) AND ($dom[$key]['value'][0] == 'h') AND (intval($dom[$key]['value'][1]) > 0) AND (intval($dom[$key]['value'][1]) < 7)) { + // headings h1, h2, h3, h4, h5, h6 + if (!isset($dom[$key]['attribute']['size']) AND !isset($dom[$key]['style']['font-size'])) { + $headsize = (4 - intval($dom[$key]['value'][1])) * 2; + $dom[$key]['fontsize'] = $dom[0]['fontsize'] + $headsize; + } + if (!isset($dom[$key]['style']['font-weight'])) { + $dom[$key]['fontstyle'] .= 'B'; + } + } + if (($dom[$key]['value'] == 'table')) { + $dom[$key]['rows'] = 0; // number of rows + $dom[$key]['trids'] = array(); // IDs of TR elements + $dom[$key]['thead'] = ''; // table header rows + } + if (($dom[$key]['value'] == 'tr')) { + $dom[$key]['cols'] = 0; + if ($thead) { + $dom[$key]['thead'] = true; + // rows on thead block are printed as a separate table + } else { + $dom[$key]['thead'] = false; + $parent = $dom[$key]['parent']; + + if (!isset($dom[$parent]['rows'])) { + $dom[$parent]['rows'] = 0; + } + // store the number of rows on table element + ++$dom[$parent]['rows']; + + if (!isset($dom[$parent]['trids'])) { + $dom[$parent]['trids'] = array(); + } + + // store the TR elements IDs on table element + array_push($dom[$parent]['trids'], $key); + } + } + if (($dom[$key]['value'] == 'th') OR ($dom[$key]['value'] == 'td')) { + if (isset($dom[$key]['attribute']['colspan'])) { + $colspan = intval($dom[$key]['attribute']['colspan']); + } else { + $colspan = 1; + } + $dom[$key]['attribute']['colspan'] = $colspan; + $dom[($dom[$key]['parent'])]['cols'] += $colspan; + } + // text direction + if (isset($dom[$key]['attribute']['dir'])) { + $dom[$key]['dir'] = $dom[$key]['attribute']['dir']; + } + // set foreground color attribute + if (isset($dom[$key]['attribute']['color']) AND (!TCPDF_STATIC::empty_string($dom[$key]['attribute']['color']))) { + $dom[$key]['fgcolor'] = TCPDF_COLORS::convertHTMLColorToDec($dom[$key]['attribute']['color'], $this->spot_colors); + } elseif (!isset($dom[$key]['style']['color']) AND ($dom[$key]['value'] == 'a')) { + $dom[$key]['fgcolor'] = $this->htmlLinkColorArray; + } + // set background color attribute + if (isset($dom[$key]['attribute']['bgcolor']) AND (!TCPDF_STATIC::empty_string($dom[$key]['attribute']['bgcolor']))) { + $dom[$key]['bgcolor'] = TCPDF_COLORS::convertHTMLColorToDec($dom[$key]['attribute']['bgcolor'], $this->spot_colors); + } + // set stroke color attribute + if (isset($dom[$key]['attribute']['strokecolor']) AND (!TCPDF_STATIC::empty_string($dom[$key]['attribute']['strokecolor']))) { + $dom[$key]['strokecolor'] = TCPDF_COLORS::convertHTMLColorToDec($dom[$key]['attribute']['strokecolor'], $this->spot_colors); + } + // check for width attribute + if (isset($dom[$key]['attribute']['width'])) { + $dom[$key]['width'] = $dom[$key]['attribute']['width']; + } + // check for height attribute + if (isset($dom[$key]['attribute']['height'])) { + $dom[$key]['height'] = $dom[$key]['attribute']['height']; + } + // check for text alignment + if (isset($dom[$key]['attribute']['align']) AND (!TCPDF_STATIC::empty_string($dom[$key]['attribute']['align'])) AND ($dom[$key]['value'] !== 'img')) { + $dom[$key]['align'] = strtoupper($dom[$key]['attribute']['align'][0]); + } + // check for text rendering mode (the following attributes do not exist in HTML) + if (isset($dom[$key]['attribute']['stroke'])) { + // font stroke width + $dom[$key]['stroke'] = $this->getHTMLUnitToUnits($dom[$key]['attribute']['stroke'], $dom[$key]['fontsize'], 'pt', true); + } + if (isset($dom[$key]['attribute']['fill'])) { + // font fill + if ($dom[$key]['attribute']['fill'] == 'true') { + $dom[$key]['fill'] = true; + } else { + $dom[$key]['fill'] = false; + } + } + if (isset($dom[$key]['attribute']['clip'])) { + // clipping mode + if ($dom[$key]['attribute']['clip'] == 'true') { + $dom[$key]['clip'] = true; + } else { + $dom[$key]['clip'] = false; + } + } + } // end opening tag + } else { + // text + $dom[$key]['tag'] = false; + $dom[$key]['block'] = false; + $dom[$key]['parent'] = end($level); + $dom[$key]['dir'] = $dom[$dom[$key]['parent']]['dir']; + if (!empty($dom[$dom[$key]['parent']]['text-transform'])) { + // text-transform for unicode requires mb_convert_case (Multibyte String Functions) + if (function_exists('mb_convert_case')) { + $ttm = array('capitalize' => MB_CASE_TITLE, 'uppercase' => MB_CASE_UPPER, 'lowercase' => MB_CASE_LOWER); + if (isset($ttm[$dom[$dom[$key]['parent']]['text-transform']])) { + $element = mb_convert_case($element, $ttm[$dom[$dom[$key]['parent']]['text-transform']], $this->encoding); + } + } elseif (!$this->isunicode) { + switch ($dom[$dom[$key]['parent']]['text-transform']) { + case 'capitalize': { + $element = ucwords(strtolower($element)); + break; + } + case 'uppercase': { + $element = strtoupper($element); + break; + } + case 'lowercase': { + $element = strtolower($element); + break; + } + } + } + $element = preg_replace("/&NBSP;/i", " ", $element); + } + $dom[$key]['value'] = stripslashes($this->unhtmlentities($element)); + } + ++$elkey; + ++$key; + } + return $dom; + } + + /** + * Returns the string used to find spaces + * @return string + * @protected + * @author Nicola Asuni + * @since 4.8.024 (2010-01-15) + */ + protected function getSpaceString() { + $spacestr = chr(32); + if ($this->isUnicodeFont()) { + $spacestr = chr(0).chr(32); + } + return $spacestr; + } + + /** + * Return an hash code used to ensure that the serialized data has been generated by this TCPDF instance. + * @param string $data serialized data + * @return string + * @public static + */ + protected function getHashForTCPDFtagParams($data) { + return md5(strlen($data).$this->file_id.$data); + } + + /** + * Serialize an array of parameters to be used with TCPDF tag in HTML code. + * @param array $data parameters array + * @return string containing serialized data + * @public static + */ + public function serializeTCPDFtagParameters($data) { + $encoded = urlencode(json_encode($data)); + return $this->getHashForTCPDFtagParams($encoded).$encoded; + } + + /** + * Unserialize parameters to be used with TCPDF tag in HTML code. + * @param string $data serialized data + * @return array containing unserialized data + * @protected static + */ + protected function unserializeTCPDFtagParameters($data) { + $hash = substr($data, 0, 32); + $encoded = substr($data, 32); + if ($hash != $this->getHashForTCPDFtagParams($encoded)) { + $this->Error('Invalid parameters'); + } + return json_decode(urldecode($encoded), true); + } + + /** + * Prints a cell (rectangular area) with optional borders, background color and html text string. + * The upper-left corner of the cell corresponds to the current position. After the call, the current position moves to the right or to the next line.
      + * If automatic page breaking is enabled and the cell goes beyond the limit, a page break is done before outputting. + * IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. + * Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul + * NOTE: all the HTML attributes must be enclosed in double-quote. + * @param float $w Cell width. If 0, the cell extends up to the right margin. + * @param float $h Cell minimum height. The cell extends automatically if needed. + * @param float|null $x upper-left corner X coordinate + * @param float|null $y upper-left corner Y coordinate + * @param string $html html text to print. Default value: empty string. + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
      • 0: no border (default)
      • 1: frame
      or a string containing some or all of the following characters (in any order):
      • L: left
      • T: top
      • R: right
      • B: bottom
      or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param int $ln Indicates where the current position should go after the call. Possible values are:
      • 0: to the right (or left for RTL language)
      • 1: to the beginning of the next line
      • 2: below
      +Putting 1 is equivalent to putting 0 and calling Ln() just after. Default value: 0. + * @param boolean $fill Indicates if the cell background must be painted (true) or transparent (false). + * @param boolean $reseth if true reset the last cell height (default true). + * @param string $align Allows to center or align the text. Possible values are:
      • L : left align
      • C : center
      • R : right align
      • '' : empty string : left for LTR or right for RTL
      + * @param boolean $autopadding if true, uses internal padding and automatically adjust it to account for line width. + * @see Multicell(), writeHTML() + * @public + */ + public function writeHTMLCell($w, $h, $x, $y, $html='', $border=0, $ln=0, $fill=false, $reseth=true, $align='', $autopadding=true) { + return $this->MultiCell($w, $h, $html, $border, $align, $fill, $ln, $x, $y, $reseth, 0, true, $autopadding, 0, 'T', false); + } + + /** + * Allows to preserve some HTML formatting (limited support).
      + * IMPORTANT: The HTML must be well formatted - try to clean-up it using an application like HTML-Tidy before submitting. + * Supported tags are: a, b, blockquote, br, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, img, li, ol, p, pre, small, span, strong, sub, sup, table, tcpdf, td, th, thead, tr, tt, u, ul + * NOTE: all the HTML attributes must be enclosed in double-quote. + * @param string $html text to display + * @param boolean $ln if true add a new line after text (default = true) + * @param boolean $fill Indicates if the background must be painted (true) or transparent (false). + * @param boolean $reseth if true reset the last cell height (default false). + * @param boolean $cell if true add the current left (or right for RTL) padding to each Write (default false). + * @param string $align Allows to center or align the text. Possible values are:
      • L : left align
      • C : center
      • R : right align
      • '' : empty string : left for LTR or right for RTL
      + * @public + */ + public function writeHTML($html, $ln=true, $fill=false, $reseth=false, $cell=false, $align='') { + $gvars = $this->getGraphicVars(); + // store current values + $prev_cell_margin = $this->cell_margin; + $prev_cell_padding = $this->cell_padding; + $prevPage = $this->page; + $prevlMargin = $this->lMargin; + $prevrMargin = $this->rMargin; + $curfontname = $this->FontFamily; + $curfontstyle = $this->FontStyle; + $curfontsize = $this->FontSizePt; + $curfontascent = $this->getFontAscent($curfontname, $curfontstyle, $curfontsize); + $curfontdescent = $this->getFontDescent($curfontname, $curfontstyle, $curfontsize); + $curfontstretcing = $this->font_stretching; + $curfonttracking = $this->font_spacing; + $this->newline = true; + $newline = true; + $startlinepage = $this->page; + $minstartliney = $this->y; + $maxbottomliney = 0; + $startlinex = $this->x; + $startliney = $this->y; + $yshift = 0; + $loop = 0; + $curpos = 0; + $this_method_vars = array(); + $undo = false; + $fontaligned = false; + $reverse_dir = false; // true when the text direction is reversed + $this->premode = false; + if ($this->inxobj) { + // we are inside an XObject template + $pask = count($this->xobjects[$this->xobjid]['annotations']); + } elseif (isset($this->PageAnnots[$this->page])) { + $pask = count($this->PageAnnots[$this->page]); + } else { + $pask = 0; + } + if ($this->inxobj) { + // we are inside an XObject template + $startlinepos = strlen($this->xobjects[$this->xobjid]['outdata']); + } elseif (!$this->InFooter) { + if (isset($this->footerlen[$this->page])) { + $this->footerpos[$this->page] = $this->pagelen[$this->page] - $this->footerlen[$this->page]; + } else { + $this->footerpos[$this->page] = $this->pagelen[$this->page]; + } + $startlinepos = $this->footerpos[$this->page]; + } else { + // we are inside the footer + $startlinepos = $this->pagelen[$this->page]; + } + $lalign = $align; + $plalign = $align; + if ($this->rtl) { + $w = $this->x - $this->lMargin; + } else { + $w = $this->w - $this->rMargin - $this->x; + } + $w -= ($this->cell_padding['L'] + $this->cell_padding['R']); + if ($cell) { + if ($this->rtl) { + $this->x -= $this->cell_padding['R']; + $this->lMargin += $this->cell_padding['L']; + } else { + $this->x += $this->cell_padding['L']; + $this->rMargin += $this->cell_padding['R']; + } + } + if ($this->customlistindent >= 0) { + $this->listindent = $this->customlistindent; + } else { + $this->listindent = $this->GetStringWidth('000000'); + } + $this->listindentlevel = 0; + // save previous states + $prev_cell_height_ratio = $this->cell_height_ratio; + $prev_listnum = $this->listnum; + $prev_listordered = $this->listordered; + $prev_listcount = $this->listcount; + $prev_lispacer = $this->lispacer; + $this->listnum = 0; + $this->listordered = array(); + $this->listcount = array(); + $this->lispacer = ''; + if ((TCPDF_STATIC::empty_string($this->lasth)) OR ($reseth)) { + // reset row height + $this->resetLastH(); + } + $dom = $this->getHtmlDomArray($html); + $maxel = count($dom); + $key = 0; + while ($key < $maxel) { + if ($dom[$key]['tag'] AND $dom[$key]['opening'] AND $dom[$key]['hide']) { + // store the node key + $hidden_node_key = $key; + if ($dom[$key]['self']) { + // skip just this self-closing tag + ++$key; + } else { + // skip this and all children tags + while (($key < $maxel) AND (!$dom[$key]['tag'] OR $dom[$key]['opening'] OR ($dom[$key]['parent'] != $hidden_node_key))) { + // skip hidden objects + ++$key; + } + ++$key; + } + } + if ($key == $maxel) break; + if ($dom[$key]['tag'] AND isset($dom[$key]['attribute']['pagebreak'])) { + // check for pagebreak + if (($dom[$key]['attribute']['pagebreak'] == 'true') OR ($dom[$key]['attribute']['pagebreak'] == 'left') OR ($dom[$key]['attribute']['pagebreak'] == 'right')) { + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $this->checkPageBreak($this->PageBreakTrigger + 1); + $this->htmlvspace = ($this->PageBreakTrigger + 1); + } + if ((($dom[$key]['attribute']['pagebreak'] == 'left') AND (((!$this->rtl) AND (($this->page % 2) == 0)) OR (($this->rtl) AND (($this->page % 2) != 0)))) + OR (($dom[$key]['attribute']['pagebreak'] == 'right') AND (((!$this->rtl) AND (($this->page % 2) != 0)) OR (($this->rtl) AND (($this->page % 2) == 0))))) { + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $this->checkPageBreak($this->PageBreakTrigger + 1); + $this->htmlvspace = ($this->PageBreakTrigger + 1); + } + } + if ($dom[$key]['tag'] AND $dom[$key]['opening'] AND isset($dom[$key]['attribute']['nobr']) AND ($dom[$key]['attribute']['nobr'] == 'true')) { + if (isset($dom[($dom[$key]['parent'])]['attribute']['nobr']) AND ($dom[($dom[$key]['parent'])]['attribute']['nobr'] == 'true')) { + $dom[$key]['attribute']['nobr'] = false; + } else { + // store current object + $this->startTransaction(); + // save this method vars + $this_method_vars['html'] = $html; + $this_method_vars['ln'] = $ln; + $this_method_vars['fill'] = $fill; + $this_method_vars['reseth'] = $reseth; + $this_method_vars['cell'] = $cell; + $this_method_vars['align'] = $align; + $this_method_vars['gvars'] = $gvars; + $this_method_vars['prevPage'] = $prevPage; + $this_method_vars['prev_cell_margin'] = $prev_cell_margin; + $this_method_vars['prev_cell_padding'] = $prev_cell_padding; + $this_method_vars['prevlMargin'] = $prevlMargin; + $this_method_vars['prevrMargin'] = $prevrMargin; + $this_method_vars['curfontname'] = $curfontname; + $this_method_vars['curfontstyle'] = $curfontstyle; + $this_method_vars['curfontsize'] = $curfontsize; + $this_method_vars['curfontascent'] = $curfontascent; + $this_method_vars['curfontdescent'] = $curfontdescent; + $this_method_vars['curfontstretcing'] = $curfontstretcing; + $this_method_vars['curfonttracking'] = $curfonttracking; + $this_method_vars['minstartliney'] = $minstartliney; + $this_method_vars['maxbottomliney'] = $maxbottomliney; + $this_method_vars['yshift'] = $yshift; + $this_method_vars['startlinepage'] = $startlinepage; + $this_method_vars['startlinepos'] = $startlinepos; + $this_method_vars['startlinex'] = $startlinex; + $this_method_vars['startliney'] = $startliney; + $this_method_vars['newline'] = $newline; + $this_method_vars['loop'] = $loop; + $this_method_vars['curpos'] = $curpos; + $this_method_vars['pask'] = $pask; + $this_method_vars['lalign'] = $lalign; + $this_method_vars['plalign'] = $plalign; + $this_method_vars['w'] = $w; + $this_method_vars['prev_cell_height_ratio'] = $prev_cell_height_ratio; + $this_method_vars['prev_listnum'] = $prev_listnum; + $this_method_vars['prev_listordered'] = $prev_listordered; + $this_method_vars['prev_listcount'] = $prev_listcount; + $this_method_vars['prev_lispacer'] = $prev_lispacer; + $this_method_vars['fontaligned'] = $fontaligned; + $this_method_vars['key'] = $key; + $this_method_vars['dom'] = $dom; + } + } + // print THEAD block + if (($dom[$key]['value'] == 'tr') AND isset($dom[$key]['thead']) AND $dom[$key]['thead']) { + if (isset($dom[$key]['parent']) AND isset($dom[$dom[$key]['parent']]['thead']) AND !TCPDF_STATIC::empty_string($dom[$dom[$key]['parent']]['thead'])) { + $this->inthead = true; + // print table header (thead) + $this->writeHTML($this->thead, false, false, false, false, ''); + // check if we are on a new page or on a new column + if (($this->y < $this->start_transaction_y) OR ($this->checkPageBreak($this->lasth, '', false))) { + // we are on a new page or on a new column and the total object height is less than the available vertical space. + // restore previous object + $this->rollbackTransaction(true); + // restore previous values + foreach ($this_method_vars as $vkey => $vval) { + $$vkey = $vval; + } + // disable table header + $tmp_thead = $this->thead; + $this->thead = ''; + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $pre_y = $this->y; + if ((!$this->checkPageBreak($this->PageBreakTrigger + 1)) AND ($this->y < $pre_y)) { + // fix for multicolumn mode + $startliney = $this->y; + } + $this->start_transaction_page = $this->page; + $this->start_transaction_y = $this->y; + // restore table header + $this->thead = $tmp_thead; + // fix table border properties + if (isset($dom[$dom[$key]['parent']]['attribute']['cellspacing'])) { + $tmp_cellspacing = $this->getHTMLUnitToUnits($dom[$dom[$key]['parent']]['attribute']['cellspacing'], 1, 'px'); + } elseif (isset($dom[$dom[$key]['parent']]['border-spacing'])) { + $tmp_cellspacing = $dom[$dom[$key]['parent']]['border-spacing']['V']; + } else { + $tmp_cellspacing = 0; + } + $dom[$dom[$key]['parent']]['borderposition']['page'] = $this->page; + $dom[$dom[$key]['parent']]['borderposition']['column'] = $this->current_column; + $dom[$dom[$key]['parent']]['borderposition']['y'] = $this->y + $tmp_cellspacing; + $xoffset = ($this->x - $dom[$dom[$key]['parent']]['borderposition']['x']); + $dom[$dom[$key]['parent']]['borderposition']['x'] += $xoffset; + $dom[$dom[$key]['parent']]['borderposition']['xmax'] += $xoffset; + // print table header (thead) + $this->writeHTML($this->thead, false, false, false, false, ''); + } + } + // move $key index forward to skip THEAD block + while ( ($key < $maxel) AND (!( + ($dom[$key]['tag'] AND $dom[$key]['opening'] AND ($dom[$key]['value'] == 'tr') AND (!isset($dom[$key]['thead']) OR !$dom[$key]['thead'])) + OR ($dom[$key]['tag'] AND (!$dom[$key]['opening']) AND ($dom[$key]['value'] == 'table'))) )) { + ++$key; + } + } + if ($dom[$key]['tag'] OR ($key == 0)) { + if ((($dom[$key]['value'] == 'table') OR ($dom[$key]['value'] == 'tr')) AND (isset($dom[$key]['align']))) { + $dom[$key]['align'] = ($this->rtl) ? 'R' : 'L'; + } + // vertically align image in line + if ((!$this->newline) AND ($dom[$key]['value'] == 'img') AND (isset($dom[$key]['height'])) AND ($dom[$key]['height'] > 0)) { + // get image height + $imgh = $this->getHTMLUnitToUnits($dom[$key]['height'], ($dom[$key]['fontsize'] / $this->k), 'px'); + $autolinebreak = false; + if (!empty($dom[$key]['width'])) { + $imgw = $this->getHTMLUnitToUnits($dom[$key]['width'], ($dom[$key]['fontsize'] / $this->k), 'px', false); + if (($imgw <= ($this->w - $this->lMargin - $this->rMargin - $this->cell_padding['L'] - $this->cell_padding['R'])) + AND ((($this->rtl) AND (($this->x - $imgw) < ($this->lMargin + $this->cell_padding['L']))) + OR ((!$this->rtl) AND (($this->x + $imgw) > ($this->w - $this->rMargin - $this->cell_padding['R']))))) { + // add automatic line break + $autolinebreak = true; + $this->Ln('', $cell); + if ((!$dom[($key-1)]['tag']) AND ($dom[($key-1)]['value'] == ' ')) { + // go back to evaluate this line break + --$key; + } + } + } + if (!$autolinebreak) { + if ($this->inPageBody()) { + $pre_y = $this->y; + // check for page break + if ((!$this->checkPageBreak($imgh)) AND ($this->y < $pre_y)) { + // fix for multicolumn mode + $startliney = $this->y; + } + } + if ($this->page > $startlinepage) { + // fix line splitted over two pages + if (isset($this->footerlen[$startlinepage])) { + $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; + } + // line to be moved one page forward + $pagebuff = $this->getPageBuffer($startlinepage); + $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos)); + $tstart = substr($pagebuff, 0, $startlinepos); + $tend = substr($this->getPageBuffer($startlinepage), $curpos); + // remove line from previous page + $this->setPageBuffer($startlinepage, $tstart.''.$tend); + $pagebuff = $this->getPageBuffer($this->page); + $tstart = substr($pagebuff, 0, $this->cntmrk[$this->page]); + $tend = substr($pagebuff, $this->cntmrk[$this->page]); + // add line start to current page + $yshift = ($minstartliney - $this->y); + if ($fontaligned) { + $yshift += ($curfontsize / $this->k); + } + $try = sprintf('1 0 0 1 0 %F cm', ($yshift * $this->k)); + $this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend); + // shift the annotations and links + if (isset($this->PageAnnots[$this->page])) { + $next_pask = count($this->PageAnnots[$this->page]); + } else { + $next_pask = 0; + } + if (isset($this->PageAnnots[$startlinepage])) { + foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) { + if ($pak >= $pask) { + $this->PageAnnots[$this->page][] = $pac; + unset($this->PageAnnots[$startlinepage][$pak]); + $npak = count($this->PageAnnots[$this->page]) - 1; + $this->PageAnnots[$this->page][$npak]['y'] -= $yshift; + } + } + } + $pask = $next_pask; + $startlinepos = $this->cntmrk[$this->page]; + $startlinepage = $this->page; + $startliney = $this->y; + $this->newline = false; + } + $this->y += ($this->getCellHeight($curfontsize / $this->k) - ($curfontdescent * $this->cell_height_ratio) - $imgh); + $minstartliney = min($this->y, $minstartliney); + $maxbottomliney = ($startliney + $this->getCellHeight($curfontsize / $this->k)); + } + } elseif (isset($dom[$key]['fontname']) OR isset($dom[$key]['fontstyle']) OR isset($dom[$key]['fontsize']) OR isset($dom[$key]['line-height'])) { + // account for different font size + $pfontname = $curfontname; + $pfontstyle = $curfontstyle; + $pfontsize = $curfontsize; + $fontname = (isset($dom[$key]['fontname']) ? $dom[$key]['fontname'] : $curfontname); + $fontstyle = (isset($dom[$key]['fontstyle']) ? $dom[$key]['fontstyle'] : $curfontstyle); + $fontsize = (isset($dom[$key]['fontsize']) ? $dom[$key]['fontsize'] : $curfontsize); + $fontascent = $this->getFontAscent($fontname, $fontstyle, $fontsize); + $fontdescent = $this->getFontDescent($fontname, $fontstyle, $fontsize); + if (($fontname != $curfontname) OR ($fontstyle != $curfontstyle) OR ($fontsize != $curfontsize) + OR ($this->cell_height_ratio != $dom[$key]['line-height']) + OR ($dom[$key]['tag'] AND $dom[$key]['opening'] AND ($dom[$key]['value'] == 'li')) ) { + if (($key < ($maxel - 1)) AND ( + ($dom[$key]['tag'] AND $dom[$key]['opening'] AND ($dom[$key]['value'] == 'li')) + OR ($this->cell_height_ratio != $dom[$key]['line-height']) + OR (!$this->newline AND is_numeric($fontsize) AND is_numeric($curfontsize) + AND ($fontsize >= 0) AND ($curfontsize >= 0) + AND (($fontsize != $curfontsize) OR ($fontstyle != $curfontstyle) OR ($fontname != $curfontname))) + )) { + if ($this->page > $startlinepage) { + // fix lines splitted over two pages + if (isset($this->footerlen[$startlinepage])) { + $curpos = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; + } + // line to be moved one page forward + $pagebuff = $this->getPageBuffer($startlinepage); + $linebeg = substr($pagebuff, $startlinepos, ($curpos - $startlinepos)); + $tstart = substr($pagebuff, 0, $startlinepos); + $tend = substr($this->getPageBuffer($startlinepage), $curpos); + // remove line start from previous page + $this->setPageBuffer($startlinepage, $tstart.''.$tend); + $pagebuff = $this->getPageBuffer($this->page); + $tstart = substr($pagebuff, 0, $this->cntmrk[$this->page]); + $tend = substr($pagebuff, $this->cntmrk[$this->page]); + // add line start to current page + $yshift = ($minstartliney - $this->y); + $try = sprintf('1 0 0 1 0 %F cm', ($yshift * $this->k)); + $this->setPageBuffer($this->page, $tstart."\nq\n".$try."\n".$linebeg."\nQ\n".$tend); + // shift the annotations and links + if (isset($this->PageAnnots[$this->page])) { + $next_pask = count($this->PageAnnots[$this->page]); + } else { + $next_pask = 0; + } + if (isset($this->PageAnnots[$startlinepage])) { + foreach ($this->PageAnnots[$startlinepage] as $pak => $pac) { + if ($pak >= $pask) { + $this->PageAnnots[$this->page][] = $pac; + unset($this->PageAnnots[$startlinepage][$pak]); + $npak = count($this->PageAnnots[$this->page]) - 1; + $this->PageAnnots[$this->page][$npak]['y'] -= $yshift; + } + } + } + $pask = $next_pask; + $startlinepos = $this->cntmrk[$this->page]; + $startlinepage = $this->page; + $startliney = $this->y; + } + if (!isset($dom[$key]['line-height'])) { + $dom[$key]['line-height'] = $this->cell_height_ratio; + } + if (!$dom[$key]['block']) { + if (!(isset($dom[($key + 1)]) AND $dom[($key + 1)]['tag'] AND (!$dom[($key + 1)]['opening']) AND ($dom[($key + 1)]['value'] != 'li') AND $dom[$key]['tag'] AND (!$dom[$key]['opening']))) { + $this->y += (((($curfontsize * $this->cell_height_ratio) - ($fontsize * $dom[$key]['line-height'])) / $this->k) + $curfontascent - $fontascent - $curfontdescent + $fontdescent) / 2; + } + if (($dom[$key]['value'] != 'sup') AND ($dom[$key]['value'] != 'sub')) { + $current_line_align_data = array($key, $minstartliney, $maxbottomliney); + if (isset($line_align_data) AND (($line_align_data[0] == ($key - 1)) OR (($line_align_data[0] == ($key - 2)) AND (isset($dom[($key - 1)])) AND (preg_match('/^([\s]+)$/', $dom[($key - 1)]['value']) > 0)))) { + $minstartliney = min($this->y, $line_align_data[1]); + $maxbottomliney = max(($this->y + $this->getCellHeight($fontsize / $this->k)), $line_align_data[2]); + } else { + $minstartliney = min($this->y, $minstartliney); + $maxbottomliney = max(($this->y + $this->getCellHeight($fontsize / $this->k)), $maxbottomliney); + } + $line_align_data = $current_line_align_data; + } + } + $this->cell_height_ratio = $dom[$key]['line-height']; + $fontaligned = true; + } + $this->setFont($fontname, $fontstyle, $fontsize); + // reset row height + $this->resetLastH(); + $curfontname = $fontname; + $curfontstyle = $fontstyle; + $curfontsize = $fontsize; + $curfontascent = $fontascent; + $curfontdescent = $fontdescent; + } + } + // set text rendering mode + $textstroke = isset($dom[$key]['stroke']) ? $dom[$key]['stroke'] : $this->textstrokewidth; + $textfill = isset($dom[$key]['fill']) ? $dom[$key]['fill'] : (($this->textrendermode % 2) == 0); + $textclip = isset($dom[$key]['clip']) ? $dom[$key]['clip'] : ($this->textrendermode > 3); + $this->setTextRenderingMode($textstroke, $textfill, $textclip); + if (isset($dom[$key]['font-stretch']) AND ($dom[$key]['font-stretch'] !== false)) { + $this->setFontStretching($dom[$key]['font-stretch']); + } + if (isset($dom[$key]['letter-spacing']) AND ($dom[$key]['letter-spacing'] !== false)) { + $this->setFontSpacing($dom[$key]['letter-spacing']); + } + if (($plalign == 'J') AND $dom[$key]['block']) { + $plalign = ''; + } + // get current position on page buffer + $curpos = $this->pagelen[$startlinepage]; + if (isset($dom[$key]['bgcolor']) AND ($dom[$key]['bgcolor'] !== false)) { + $this->setFillColorArray($dom[$key]['bgcolor']); + $wfill = true; + } else { + $wfill = $fill | false; + } + if (isset($dom[$key]['fgcolor']) AND ($dom[$key]['fgcolor'] !== false)) { + $this->setTextColorArray($dom[$key]['fgcolor']); + } + if (isset($dom[$key]['strokecolor']) AND ($dom[$key]['strokecolor'] !== false)) { + $this->setDrawColorArray($dom[$key]['strokecolor']); + } + if (isset($dom[$key]['align'])) { + $lalign = $dom[$key]['align']; + } + if (TCPDF_STATIC::empty_string($lalign)) { + $lalign = $align; + } + } + // align lines + if ($this->newline AND (strlen($dom[$key]['value']) > 0) AND ($dom[$key]['value'] != 'td') AND ($dom[$key]['value'] != 'th')) { + $newline = true; + $fontaligned = false; + // we are at the beginning of a new line + if (isset($startlinex)) { + $yshift = ($minstartliney - $startliney); + if (($yshift > 0) OR ($this->page > $startlinepage)) { + $yshift = 0; + } + $t_x = 0; + // the last line must be shifted to be aligned as requested + $linew = abs($this->endlinex - $startlinex); + if ($this->inxobj) { + // we are inside an XObject template + $pstart = substr($this->xobjects[$this->xobjid]['outdata'], 0, $startlinepos); + if (isset($opentagpos)) { + $midpos = $opentagpos; + } else { + $midpos = 0; + } + if ($midpos > 0) { + $pmid = substr($this->xobjects[$this->xobjid]['outdata'], $startlinepos, ($midpos - $startlinepos)); + $pend = substr($this->xobjects[$this->xobjid]['outdata'], $midpos); + } else { + $pmid = substr($this->xobjects[$this->xobjid]['outdata'], $startlinepos); + $pend = ''; + } + } else { + $pstart = substr($this->getPageBuffer($startlinepage), 0, $startlinepos); + if (isset($opentagpos) AND isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { + $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; + $midpos = min($opentagpos, $this->footerpos[$startlinepage]); + } elseif (isset($opentagpos)) { + $midpos = $opentagpos; + } elseif (isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { + $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; + $midpos = $this->footerpos[$startlinepage]; + } else { + $midpos = 0; + } + if ($midpos > 0) { + $pmid = substr($this->getPageBuffer($startlinepage), $startlinepos, ($midpos - $startlinepos)); + $pend = substr($this->getPageBuffer($startlinepage), $midpos); + } else { + $pmid = substr($this->getPageBuffer($startlinepage), $startlinepos); + $pend = ''; + } + } + if ((((($plalign == 'C') OR ($plalign == 'J') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { + // calculate shifting amount + $tw = $w; + if (($plalign == 'J') AND $this->isRTLTextDir() AND ($this->num_columns > 1)) { + $tw += $this->cell_padding['R']; + } + if ($this->lMargin != $prevlMargin) { + $tw += ($prevlMargin - $this->lMargin); + } + if ($this->rMargin != $prevrMargin) { + $tw += ($prevrMargin - $this->rMargin); + } + $one_space_width = $this->GetStringWidth(chr(32)); + $no = 0; // number of spaces on a line contained on a single block + if ($this->isRTLTextDir()) { // RTL + // remove left space if exist + $pos1 = TCPDF_STATIC::revstrpos($pmid, '[('); + if ($pos1 > 0) { + $pos1 = intval($pos1); + if ($this->isUnicodeFont()) { + $pos2 = intval(TCPDF_STATIC::revstrpos($pmid, '[('.chr(0).chr(32))); + $spacelen = 2; + } else { + $pos2 = intval(TCPDF_STATIC::revstrpos($pmid, '[('.chr(32))); + $spacelen = 1; + } + if ($pos1 == $pos2) { + $pmid = substr($pmid, 0, ($pos1 + 2)).substr($pmid, ($pos1 + 2 + $spacelen)); + if (substr($pmid, $pos1, 4) == '[()]') { + $linew -= $one_space_width; + } elseif ($pos1 == strpos($pmid, '[(')) { + $no = 1; + } + } + } + } else { // LTR + // remove right space if exist + $pos1 = TCPDF_STATIC::revstrpos($pmid, ')]'); + if ($pos1 > 0) { + $pos1 = intval($pos1); + if ($this->isUnicodeFont()) { + $pos2 = intval(TCPDF_STATIC::revstrpos($pmid, chr(0).chr(32).')]')) + 2; + $spacelen = 2; + } else { + $pos2 = intval(TCPDF_STATIC::revstrpos($pmid, chr(32).')]')) + 1; + $spacelen = 1; + } + if ($pos1 == $pos2) { + $pmid = substr($pmid, 0, ($pos1 - $spacelen)).substr($pmid, $pos1); + $linew -= $one_space_width; + } + } + } + $mdiff = ($tw - $linew); + if ($plalign == 'C') { + if ($this->rtl) { + $t_x = -($mdiff / 2); + } else { + $t_x = ($mdiff / 2); + } + } elseif ($plalign == 'R') { + // right alignment on LTR document + $t_x = $mdiff; + } elseif ($plalign == 'L') { + // left alignment on RTL document + $t_x = -$mdiff; + } elseif (($plalign == 'J') AND ($plalign == $lalign)) { + // Justification + if ($this->isRTLTextDir()) { + // align text on the left + $t_x = -$mdiff; + } + $ns = 0; // number of spaces + $pmidtemp = $pmid; + // escape special characters + $pmidtemp = preg_replace('/[\\\][\(]/x', '\\#!#OP#!#', $pmidtemp); + $pmidtemp = preg_replace('/[\\\][\)]/x', '\\#!#CP#!#', $pmidtemp); + // search spaces + if (preg_match_all('/\[\(([^\)]*)\)\]/x', $pmidtemp, $lnstring, PREG_PATTERN_ORDER)) { + $spacestr = $this->getSpaceString(); + $maxkk = count($lnstring[1]) - 1; + for ($kk=0; $kk <= $maxkk; ++$kk) { + // restore special characters + $lnstring[1][$kk] = str_replace('#!#OP#!#', '(', $lnstring[1][$kk]); + $lnstring[1][$kk] = str_replace('#!#CP#!#', ')', $lnstring[1][$kk]); + // store number of spaces on the strings + $lnstring[2][$kk] = substr_count($lnstring[1][$kk], $spacestr); + // count total spaces on line + $ns += $lnstring[2][$kk]; + $lnstring[3][$kk] = $ns; + } + if ($ns == 0) { + $ns = 1; + } + // calculate additional space to add to each existing space + $spacewidth = ($mdiff / ($ns - $no)) * $this->k; + if ($this->FontSize <= 0) { + $this->FontSize = 1; + } + $spacewidthu = -1000 * ($mdiff + (($ns + $no) * $one_space_width)) / $ns / $this->FontSize; + if ($this->font_spacing != 0) { + // fixed spacing mode + $osw = -1000 * $this->font_spacing / $this->FontSize; + $spacewidthu += $osw; + } + $nsmax = $ns; + $ns = 0; + reset($lnstring); + $offset = 0; + $strcount = 0; + $prev_epsposbeg = 0; + $textpos = 0; + if ($this->isRTLTextDir()) { + $textpos = $this->wPt; + } + while (preg_match('/([0-9\.\+\-]*)[\s](Td|cm|m|l|c|re)[\s]/x', $pmid, $strpiece, PREG_OFFSET_CAPTURE, $offset) == 1) { + // check if we are inside a string section '[( ... )]' + $stroffset = strpos($pmid, '[(', $offset); + if (($stroffset !== false) AND ($stroffset <= $strpiece[2][1])) { + // set offset to the end of string section + $offset = strpos($pmid, ')]', $stroffset); + while (($offset !== false) AND ($pmid[($offset - 1)] == '\\')) { + $offset = strpos($pmid, ')]', ($offset + 1)); + } + if ($offset === false) { + $this->Error('HTML Justification: malformed PDF code.'); + } + continue; + } + if ($this->isRTLTextDir()) { + $spacew = ($spacewidth * ($nsmax - $ns)); + } else { + $spacew = ($spacewidth * $ns); + } + $offset = $strpiece[2][1] + strlen($strpiece[2][0]); + $epsposend = strpos($pmid, $this->epsmarker.'Q', $offset); + if ($epsposend !== null) { + $epsposend += strlen($this->epsmarker.'Q'); + $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, $offset); + if ($epsposbeg === null) { + $epsposbeg = strpos($pmid, 'q'.$this->epsmarker, ($prev_epsposbeg - 6)); + $prev_epsposbeg = $epsposbeg; + } + if (($epsposbeg > 0) AND ($epsposend > 0) AND ($offset > $epsposbeg) AND ($offset < $epsposend)) { + // shift EPS images + $trx = sprintf('1 0 0 1 %F 0 cm', $spacew); + $pmid_b = substr($pmid, 0, $epsposbeg); + $pmid_m = substr($pmid, $epsposbeg, ($epsposend - $epsposbeg)); + $pmid_e = substr($pmid, $epsposend); + $pmid = $pmid_b."\nq\n".$trx."\n".$pmid_m."\nQ\n".$pmid_e; + $offset = $epsposend; + continue; + } + } + $currentxpos = 0; + // shift blocks of code + switch ($strpiece[2][0]) { + case 'Td': + case 'cm': + case 'm': + case 'l': { + // get current X position + preg_match('/([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', $pmid, $xmatches); + if (!isset($xmatches[1])) { + break; + } + $currentxpos = $xmatches[1]; + $textpos = $currentxpos; + if (($strcount <= $maxkk) AND ($strpiece[2][0] == 'Td')) { + $ns = $lnstring[3][$strcount]; + if ($this->isRTLTextDir()) { + $spacew = ($spacewidth * ($nsmax - $ns)); + } + ++$strcount; + } + // justify block + if (preg_match('/([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s]('.$strpiece[2][0].')([\s]*)/x', $pmid, $pmatch) == 1) { + $newpmid = sprintf('%F',(floatval($pmatch[1]) + $spacew)).' '.$pmatch[2].' x*#!#*x'.$pmatch[3].$pmatch[4]; + $pmid = str_replace($pmatch[0], $newpmid, $pmid); + unset($pmatch, $newpmid); + } + break; + } + case 're': { + // justify block + if (!TCPDF_STATIC::empty_string($this->lispacer)) { + $this->lispacer = ''; + break; + } + preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $xmatches); + if (!isset($xmatches[1])) { + break; + } + $currentxpos = $xmatches[1]; + $x_diff = 0; + $w_diff = 0; + if ($this->isRTLTextDir()) { // RTL + if ($currentxpos < $textpos) { + $x_diff = ($spacewidth * ($nsmax - $lnstring[3][$strcount])); + $w_diff = ($spacewidth * $lnstring[2][$strcount]); + } else { + if ($strcount > 0) { + $x_diff = ($spacewidth * ($nsmax - $lnstring[3][($strcount - 1)])); + $w_diff = ($spacewidth * $lnstring[2][($strcount - 1)]); + } + } + } else { // LTR + if ($currentxpos > $textpos) { + if ($strcount > 0) { + $x_diff = ($spacewidth * $lnstring[3][($strcount - 1)]); + } + $w_diff = ($spacewidth * $lnstring[2][$strcount]); + } else { + if ($strcount > 1) { + $x_diff = ($spacewidth * $lnstring[3][($strcount - 2)]); + } + if ($strcount > 0) { + $w_diff = ($spacewidth * $lnstring[2][($strcount - 1)]); + } + } + } + if (preg_match('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$strpiece[1][0].')[\s](re)([\s]*)/x', $pmid, $pmatch) == 1) { + $newx = sprintf('%F',(floatval($pmatch[1]) + $x_diff)); + $neww = sprintf('%F',(floatval($pmatch[3]) + $w_diff)); + $newpmid = $newx.' '.$pmatch[2].' '.$neww.' '.$pmatch[4].' x*#!#*x'.$pmatch[5].$pmatch[6]; + $pmid = str_replace($pmatch[0], $newpmid, $pmid); + unset($pmatch, $newpmid, $newx, $neww); + } + break; + } + case 'c': { + // get current X position + preg_match('/([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]([0-9\.\+\-]*)[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x', $pmid, $xmatches); + if (!isset($xmatches[1])) { + break; + } + $currentxpos = $xmatches[1]; + // justify block + if (preg_match('/('.$xmatches[1].')[\s]('.$xmatches[2].')[\s]('.$xmatches[3].')[\s]('.$xmatches[4].')[\s]('.$xmatches[5].')[\s]('.$strpiece[1][0].')[\s](c)([\s]*)/x', $pmid, $pmatch) == 1) { + $newx1 = sprintf('%F',(floatval($pmatch[1]) + $spacew)); + $newx2 = sprintf('%F',(floatval($pmatch[3]) + $spacew)); + $newx3 = sprintf('%F',(floatval($pmatch[5]) + $spacew)); + $newpmid = $newx1.' '.$pmatch[2].' '.$newx2.' '.$pmatch[4].' '.$newx3.' '.$pmatch[6].' x*#!#*x'.$pmatch[7].$pmatch[8]; + $pmid = str_replace($pmatch[0], $newpmid, $pmid); + unset($pmatch, $newpmid, $newx1, $newx2, $newx3); + } + break; + } + } + // shift the annotations and links + $cxpos = ($currentxpos / $this->k); + $lmpos = ($this->lMargin + $this->cell_padding['L'] + $this->feps); + if ($this->inxobj) { + // we are inside an XObject template + foreach ($this->xobjects[$this->xobjid]['annotations'] as $pak => $pac) { + if (($pac['y'] >= $minstartliney) AND (($pac['x'] * $this->k) >= ($currentxpos - $this->feps)) AND (($pac['x'] * $this->k) <= ($currentxpos + $this->feps))) { + if ($cxpos > $lmpos) { + $this->xobjects[$this->xobjid]['annotations'][$pak]['x'] += ($spacew / $this->k); + $this->xobjects[$this->xobjid]['annotations'][$pak]['w'] += (($spacewidth * $pac['numspaces']) / $this->k); + } else { + $this->xobjects[$this->xobjid]['annotations'][$pak]['w'] += (($spacewidth * $pac['numspaces']) / $this->k); + } + break; + } + } + } elseif (isset($this->PageAnnots[$this->page])) { + foreach ($this->PageAnnots[$this->page] as $pak => $pac) { + if (($pac['y'] >= $minstartliney) AND (($pac['x'] * $this->k) >= ($currentxpos - $this->feps)) AND (($pac['x'] * $this->k) <= ($currentxpos + $this->feps))) { + if ($cxpos > $lmpos) { + $this->PageAnnots[$this->page][$pak]['x'] += ($spacew / $this->k); + $this->PageAnnots[$this->page][$pak]['w'] += (($spacewidth * $pac['numspaces']) / $this->k); + } else { + $this->PageAnnots[$this->page][$pak]['w'] += (($spacewidth * $pac['numspaces']) / $this->k); + } + break; + } + } + } + } // end of while + // remove markers + $pmid = str_replace('x*#!#*x', '', $pmid); + if ($this->isUnicodeFont()) { + // multibyte characters + $spacew = $spacewidthu; + if ($this->font_stretching != 100) { + // word spacing is affected by stretching + $spacew /= ($this->font_stretching / 100); + } + // escape special characters + $pos = 0; + $pmid = preg_replace('/[\\\][\(]/x', '\\#!#OP#!#', $pmid); + $pmid = preg_replace('/[\\\][\)]/x', '\\#!#CP#!#', $pmid); + if (preg_match_all('/\[\(([^\)]*)\)\]/x', $pmid, $pamatch) > 0) { + foreach($pamatch[0] as $pk => $pmatch) { + $replace = $pamatch[1][$pk]; + $replace = str_replace('#!#OP#!#', '(', $replace); + $replace = str_replace('#!#CP#!#', ')', $replace); + $newpmid = '[('.str_replace(chr(0).chr(32), ') '.sprintf('%F', $spacew).' (', $replace).')]'; + $pos = strpos($pmid, $pmatch, $pos); + if ($pos !== FALSE) { + $pmid = substr_replace($pmid, $newpmid, $pos, strlen($pmatch)); + } + ++$pos; + } + unset($pamatch); + } + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['outdata'] = $pstart."\n".$pmid."\n".$pend; + } else { + $this->setPageBuffer($startlinepage, $pstart."\n".$pmid."\n".$pend); + } + $endlinepos = strlen($pstart."\n".$pmid."\n"); + } else { + // non-unicode (single-byte characters) + if ($this->font_stretching != 100) { + // word spacing (Tw) is affected by stretching + $spacewidth /= ($this->font_stretching / 100); + } + $rs = sprintf('%F Tw', $spacewidth); + $pmid = preg_replace("/\[\(/x", $rs.' [(', $pmid); + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['outdata'] = $pstart."\n".$pmid."\nBT 0 Tw ET\n".$pend; + } else { + $this->setPageBuffer($startlinepage, $pstart."\n".$pmid."\nBT 0 Tw ET\n".$pend); + } + $endlinepos = strlen($pstart."\n".$pmid."\nBT 0 Tw ET\n"); + } + } + } // end of J + } // end if $startlinex + if (($t_x != 0) OR ($yshift < 0)) { + // shift the line + $trx = sprintf('1 0 0 1 %F %F cm', ($t_x * $this->k), ($yshift * $this->k)); + $pstart .= "\nq\n".$trx."\n".$pmid."\nQ\n"; + $endlinepos = strlen($pstart); + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['outdata'] = $pstart.$pend; + foreach ($this->xobjects[$this->xobjid]['annotations'] as $pak => $pac) { + if ($pak >= $pask) { + $this->xobjects[$this->xobjid]['annotations'][$pak]['x'] += $t_x; + $this->xobjects[$this->xobjid]['annotations'][$pak]['y'] -= $yshift; + } + } + } else { + $this->setPageBuffer($startlinepage, $pstart.$pend); + // shift the annotations and links + if (isset($this->PageAnnots[$this->page])) { + foreach ($this->PageAnnots[$this->page] as $pak => $pac) { + if ($pak >= $pask) { + $this->PageAnnots[$this->page][$pak]['x'] += $t_x; + $this->PageAnnots[$this->page][$pak]['y'] -= $yshift; + } + } + } + } + $this->y -= $yshift; + } + } + $pbrk = $this->checkPageBreak($this->lasth); + $this->newline = false; + $startlinex = $this->x; + $startliney = $this->y; + if ($dom[$dom[$key]['parent']]['value'] == 'sup') { + $startliney -= ((0.3 * $this->FontSizePt) / $this->k); + } elseif ($dom[$dom[$key]['parent']]['value'] == 'sub') { + $startliney -= (($this->FontSizePt / 0.7) / $this->k); + } else { + $minstartliney = $startliney; + $maxbottomliney = ($this->y + $this->getCellHeight($fontsize / $this->k)); + } + $startlinepage = $this->page; + if (isset($endlinepos) AND (!$pbrk)) { + $startlinepos = $endlinepos; + } else { + if ($this->inxobj) { + // we are inside an XObject template + $startlinepos = strlen($this->xobjects[$this->xobjid]['outdata']); + } elseif (!$this->InFooter) { + if (isset($this->footerlen[$this->page])) { + $this->footerpos[$this->page] = $this->pagelen[$this->page] - $this->footerlen[$this->page]; + } else { + $this->footerpos[$this->page] = $this->pagelen[$this->page]; + } + $startlinepos = $this->footerpos[$this->page]; + } else { + $startlinepos = $this->pagelen[$this->page]; + } + } + unset($endlinepos); + $plalign = $lalign; + if (isset($this->PageAnnots[$this->page])) { + $pask = count($this->PageAnnots[$this->page]); + } else { + $pask = 0; + } + if (!($dom[$key]['tag'] AND !$dom[$key]['opening'] AND ($dom[$key]['value'] == 'table') + AND (isset($this->emptypagemrk[$this->page])) + AND ($this->emptypagemrk[$this->page] == $this->pagelen[$this->page]))) { + $this->setFont($fontname, $fontstyle, $fontsize); + if ($wfill) { + $this->setFillColorArray($this->bgcolor); + } + } + } // end newline + if (isset($opentagpos)) { + unset($opentagpos); + } + if ($dom[$key]['tag']) { + if ($dom[$key]['opening']) { + // get text indentation (if any) + if (isset($dom[$key]['text-indent']) AND $dom[$key]['block']) { + $this->textindent = $dom[$key]['text-indent']; + $this->newline = true; + } + // table + if (($dom[$key]['value'] == 'table') AND isset($dom[$key]['cols']) AND ($dom[$key]['cols'] > 0)) { + // available page width + if ($this->rtl) { + $wtmp = $this->x - $this->lMargin; + } else { + $wtmp = $this->w - $this->rMargin - $this->x; + } + // get cell spacing + if (isset($dom[$key]['attribute']['cellspacing'])) { + $clsp = $this->getHTMLUnitToUnits($dom[$key]['attribute']['cellspacing'], 1, 'px'); + $cellspacing = array('H' => $clsp, 'V' => $clsp); + } elseif (isset($dom[$key]['border-spacing'])) { + $cellspacing = $dom[$key]['border-spacing']; + } else { + $cellspacing = array('H' => 0, 'V' => 0); + } + // table width + if (isset($dom[$key]['width'])) { + $table_width = $this->getHTMLUnitToUnits($dom[$key]['width'], $wtmp, 'px'); + } else { + $table_width = $wtmp; + } + $table_width -= (2 * $cellspacing['H']); + if (!$this->inthead) { + $this->y += $cellspacing['V']; + } + if ($this->rtl) { + $cellspacingx = -$cellspacing['H']; + } else { + $cellspacingx = $cellspacing['H']; + } + // total table width without cellspaces + $table_columns_width = ($table_width - ($cellspacing['H'] * ($dom[$key]['cols'] - 1))); + // minimum column width + $table_min_column_width = ($table_columns_width / $dom[$key]['cols']); + // array of custom column widths + $table_colwidths = array_fill(0, $dom[$key]['cols'], $table_min_column_width); + } + // table row + if ($dom[$key]['value'] == 'tr') { + // reset column counter + $colid = 0; + } + // table cell + if (($dom[$key]['value'] == 'td') OR ($dom[$key]['value'] == 'th')) { + $trid = $dom[$key]['parent']; + $table_el = $dom[$trid]['parent']; + if (!isset($dom[$table_el]['cols'])) { + $dom[$table_el]['cols'] = $dom[$trid]['cols']; + } + // store border info + $tdborder = 0; + if (isset($dom[$key]['border']) AND !empty($dom[$key]['border'])) { + $tdborder = $dom[$key]['border']; + } + $colspan = intval($dom[$key]['attribute']['colspan']); + if ($colspan <= 0) { + $colspan = 1; + } + $old_cell_padding = $this->cell_padding; + if (isset($dom[($dom[$trid]['parent'])]['attribute']['cellpadding'])) { + $crclpd = $this->getHTMLUnitToUnits($dom[($dom[$trid]['parent'])]['attribute']['cellpadding'], 1, 'px'); + $current_cell_padding = array('L' => $crclpd, 'T' => $crclpd, 'R' => $crclpd, 'B' => $crclpd); + } elseif (isset($dom[($dom[$trid]['parent'])]['padding'])) { + $current_cell_padding = $dom[($dom[$trid]['parent'])]['padding']; + } else { + $current_cell_padding = array('L' => 0, 'T' => 0, 'R' => 0, 'B' => 0); + } + $this->cell_padding = $current_cell_padding; + if (isset($dom[$key]['height'])) { + // minimum cell height + $cellh = $this->getHTMLUnitToUnits($dom[$key]['height'], 0, 'px'); + } else { + $cellh = 0; + } + if (isset($dom[$key]['content'])) { + $cell_content = $dom[$key]['content']; + } else { + $cell_content = ' '; + } + $tagtype = $dom[$key]['value']; + $parentid = $key; + while (($key < $maxel) AND (!(($dom[$key]['tag']) AND (!$dom[$key]['opening']) AND ($dom[$key]['value'] == $tagtype) AND ($dom[$key]['parent'] == $parentid)))) { + // move $key index forward + ++$key; + } + if (!isset($dom[$trid]['startpage'])) { + $dom[$trid]['startpage'] = $this->page; + } else { + $this->setPage($dom[$trid]['startpage']); + } + if (!isset($dom[$trid]['startcolumn'])) { + $dom[$trid]['startcolumn'] = $this->current_column; + } elseif ($this->current_column != $dom[$trid]['startcolumn']) { + $tmpx = $this->x; + $this->selectColumn($dom[$trid]['startcolumn']); + $this->x = $tmpx; + } + if (!isset($dom[$trid]['starty'])) { + $dom[$trid]['starty'] = $this->y; + } else { + $this->y = $dom[$trid]['starty']; + } + if (!isset($dom[$trid]['startx'])) { + $dom[$trid]['startx'] = $this->x; + $this->x += $cellspacingx; + } else { + $this->x += ($cellspacingx / 2); + } + if (isset($dom[$parentid]['attribute']['rowspan'])) { + $rowspan = intval($dom[$parentid]['attribute']['rowspan']); + } else { + $rowspan = 1; + } + // skip row-spanned cells started on the previous rows + if (isset($dom[$table_el]['rowspans'])) { + $rsk = 0; + $rskmax = count($dom[$table_el]['rowspans']); + while ($rsk < $rskmax) { + $trwsp = $dom[$table_el]['rowspans'][$rsk]; + $rsstartx = $trwsp['startx']; + $rsendx = $trwsp['endx']; + // account for margin changes + if ($trwsp['startpage'] < $this->page) { + if (($this->rtl) AND ($this->pagedim[$this->page]['orm'] != $this->pagedim[$trwsp['startpage']]['orm'])) { + $dl = ($this->pagedim[$this->page]['orm'] - $this->pagedim[$trwsp['startpage']]['orm']); + $rsstartx -= $dl; + $rsendx -= $dl; + } elseif ((!$this->rtl) AND ($this->pagedim[$this->page]['olm'] != $this->pagedim[$trwsp['startpage']]['olm'])) { + $dl = ($this->pagedim[$this->page]['olm'] - $this->pagedim[$trwsp['startpage']]['olm']); + $rsstartx += $dl; + $rsendx += $dl; + } + } + if (($trwsp['rowspan'] > 0) + AND ($rsstartx > ($this->x - $cellspacing['H'] - $current_cell_padding['L'] - $this->feps)) + AND ($rsstartx < ($this->x + $cellspacing['H'] + $current_cell_padding['R'] + $this->feps)) + AND (($trwsp['starty'] < ($this->y - $this->feps)) OR ($trwsp['startpage'] < $this->page) OR ($trwsp['startcolumn'] < $this->current_column))) { + // set the starting X position of the current cell + $this->x = $rsendx + $cellspacingx; + // increment column indicator + $colid += $trwsp['colspan']; + if (($trwsp['rowspan'] == 1) + AND (isset($dom[$trid]['endy'])) + AND (isset($dom[$trid]['endpage'])) + AND (isset($dom[$trid]['endcolumn'])) + AND ($trwsp['endpage'] == $dom[$trid]['endpage']) + AND ($trwsp['endcolumn'] == $dom[$trid]['endcolumn'])) { + // set ending Y position for row + $dom[$table_el]['rowspans'][$rsk]['endy'] = max($dom[$trid]['endy'], $trwsp['endy']); + $dom[$trid]['endy'] = $dom[$table_el]['rowspans'][$rsk]['endy']; + } + $rsk = 0; + } else { + ++$rsk; + } + } + } + if (isset($dom[$parentid]['width'])) { + // user specified width + $cellw = $this->getHTMLUnitToUnits($dom[$parentid]['width'], $table_columns_width, 'px'); + $tmpcw = ($cellw / $colspan); + for ($i = 0; $i < $colspan; ++$i) { + $table_colwidths[($colid + $i)] = $tmpcw; + } + } else { + // inherit column width + $cellw = 0; + for ($i = 0; $i < $colspan; ++$i) { + $cellw += (isset($table_colwidths[($colid + $i)]) ? $table_colwidths[($colid + $i)] : 0); + } + } + $cellw += (($colspan - 1) * $cellspacing['H']); + // increment column indicator + $colid += $colspan; + // add rowspan information to table element + if ($rowspan > 1) { + $trsid = array_push($dom[$table_el]['rowspans'], array('trid' => $trid, 'rowspan' => $rowspan, 'mrowspan' => $rowspan, 'colspan' => $colspan, 'startpage' => $this->page, 'startcolumn' => $this->current_column, 'startx' => $this->x, 'starty' => $this->y)); + } + $cellid = array_push($dom[$trid]['cellpos'], array('startx' => $this->x)); + if ($rowspan > 1) { + $dom[$trid]['cellpos'][($cellid - 1)]['rowspanid'] = ($trsid - 1); + } + // push background colors + if (isset($dom[$parentid]['bgcolor']) AND ($dom[$parentid]['bgcolor'] !== false)) { + $dom[$trid]['cellpos'][($cellid - 1)]['bgcolor'] = $dom[$parentid]['bgcolor']; + } + // store border info + if (!empty($tdborder)) { + $dom[$trid]['cellpos'][($cellid - 1)]['border'] = $tdborder; + } + $prevLastH = $this->lasth; + // store some info for multicolumn mode + if ($this->rtl) { + $this->colxshift['x'] = $this->w - $this->x - $this->rMargin; + } else { + $this->colxshift['x'] = $this->x - $this->lMargin; + } + $this->colxshift['s'] = $cellspacing; + $this->colxshift['p'] = $current_cell_padding; + // ****** write the cell content ****** + $this->MultiCell($cellw, $cellh, $cell_content, false, $lalign, false, 2, '', '', true, 0, true, true, 0, 'T', false); + // restore some values + $this->colxshift = array('x' => 0, 's' => array('H' => 0, 'V' => 0), 'p' => array('L' => 0, 'T' => 0, 'R' => 0, 'B' => 0)); + $this->lasth = $prevLastH; + $this->cell_padding = $old_cell_padding; + $dom[$trid]['cellpos'][($cellid - 1)]['endx'] = $this->x; + // update the end of row position + if ($rowspan <= 1) { + if (isset($dom[$trid]['endy'])) { + if (($this->page == $dom[$trid]['endpage']) AND ($this->current_column == $dom[$trid]['endcolumn'])) { + $dom[$trid]['endy'] = max($this->y, $dom[$trid]['endy']); + } elseif (($this->page > $dom[$trid]['endpage']) OR ($this->current_column > $dom[$trid]['endcolumn'])) { + $dom[$trid]['endy'] = $this->y; + } + } else { + $dom[$trid]['endy'] = $this->y; + } + if (isset($dom[$trid]['endpage'])) { + $dom[$trid]['endpage'] = max($this->page, $dom[$trid]['endpage']); + } else { + $dom[$trid]['endpage'] = $this->page; + } + if (isset($dom[$trid]['endcolumn'])) { + $dom[$trid]['endcolumn'] = max($this->current_column, $dom[$trid]['endcolumn']); + } else { + $dom[$trid]['endcolumn'] = $this->current_column; + } + } else { + // account for row-spanned cells + $dom[$table_el]['rowspans'][($trsid - 1)]['endx'] = $this->x; + $dom[$table_el]['rowspans'][($trsid - 1)]['endy'] = $this->y; + $dom[$table_el]['rowspans'][($trsid - 1)]['endpage'] = $this->page; + $dom[$table_el]['rowspans'][($trsid - 1)]['endcolumn'] = $this->current_column; + } + if (isset($dom[$table_el]['rowspans'])) { + // update endy and endpage on rowspanned cells + foreach ($dom[$table_el]['rowspans'] as $k => $trwsp) { + if ($trwsp['rowspan'] > 0) { + if (isset($dom[$trid]['endpage'])) { + if (($trwsp['endpage'] == $dom[$trid]['endpage']) AND ($trwsp['endcolumn'] == $dom[$trid]['endcolumn'])) { + $dom[$table_el]['rowspans'][$k]['endy'] = max($dom[$trid]['endy'], $trwsp['endy']); + } elseif (($trwsp['endpage'] < $dom[$trid]['endpage']) OR ($trwsp['endcolumn'] < $dom[$trid]['endcolumn'])) { + $dom[$table_el]['rowspans'][$k]['endy'] = $dom[$trid]['endy']; + $dom[$table_el]['rowspans'][$k]['endpage'] = $dom[$trid]['endpage']; + $dom[$table_el]['rowspans'][$k]['endcolumn'] = $dom[$trid]['endcolumn']; + } else { + $dom[$trid]['endy'] = $this->pagedim[$dom[$trid]['endpage']]['hk'] - $this->pagedim[$dom[$trid]['endpage']]['bm']; + } + } + } + } + } + $this->x += ($cellspacingx / 2); + } else { + // opening tag (or self-closing tag) + if (!isset($opentagpos)) { + if ($this->inxobj) { + // we are inside an XObject template + $opentagpos = strlen($this->xobjects[$this->xobjid]['outdata']); + } elseif (!$this->InFooter) { + if (isset($this->footerlen[$this->page])) { + $this->footerpos[$this->page] = $this->pagelen[$this->page] - $this->footerlen[$this->page]; + } else { + $this->footerpos[$this->page] = $this->pagelen[$this->page]; + } + $opentagpos = $this->footerpos[$this->page]; + } + } + $dom = $this->openHTMLTagHandler($dom, $key, $cell); + } + } else { // closing tag + $prev_numpages = $this->numpages; + $old_bordermrk = $this->bordermrk[$this->page]; + $dom = $this->closeHTMLTagHandler($dom, $key, $cell, $maxbottomliney); + if ($this->bordermrk[$this->page] > $old_bordermrk) { + $startlinepos += ($this->bordermrk[$this->page] - $old_bordermrk); + } + if ($prev_numpages > $this->numpages) { + $startlinepage = $this->page; + } + } + } elseif (strlen($dom[$key]['value']) > 0) { + // print list-item + if (!TCPDF_STATIC::empty_string($this->lispacer) AND ($this->lispacer != '^')) { + $this->setFont($pfontname, $pfontstyle, $pfontsize); + $this->resetLastH(); + $minstartliney = $this->y; + $maxbottomliney = ($startliney + $this->getCellHeight($this->FontSize)); + if (is_numeric($pfontsize) AND ($pfontsize > 0)) { + $this->putHtmlListBullet($this->listnum, $this->lispacer, $pfontsize); + } + $this->setFont($curfontname, $curfontstyle, $curfontsize); + $this->resetLastH(); + if (is_numeric($pfontsize) AND ($pfontsize > 0) AND is_numeric($curfontsize) AND ($curfontsize > 0) AND ($pfontsize != $curfontsize)) { + $pfontascent = $this->getFontAscent($pfontname, $pfontstyle, $pfontsize); + $pfontdescent = $this->getFontDescent($pfontname, $pfontstyle, $pfontsize); + $this->y += ($this->getCellHeight(($pfontsize - $curfontsize) / $this->k) + $pfontascent - $curfontascent - $pfontdescent + $curfontdescent) / 2; + $minstartliney = min($this->y, $minstartliney); + $maxbottomliney = max(($this->y + $this->getCellHeight($pfontsize / $this->k)), $maxbottomliney); + } + } + // text + $this->htmlvspace = 0; + $isRTLString = preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_RTL, $dom[$key]['value']) || preg_match(TCPDF_FONT_DATA::$uni_RE_PATTERN_ARABIC, $dom[$key]['value']); + if ((!$this->premode) AND $this->isRTLTextDir() AND !$isRTLString) { + // reverse spaces order + $lsp = ''; // left spaces + $rsp = ''; // right spaces + if (preg_match('/^('.$this->re_space['p'].'+)/'.$this->re_space['m'], $dom[$key]['value'], $matches)) { + $lsp = $matches[1]; + } + if (preg_match('/('.$this->re_space['p'].'+)$/'.$this->re_space['m'], $dom[$key]['value'], $matches)) { + $rsp = $matches[1]; + } + $dom[$key]['value'] = $rsp.$this->stringTrim($dom[$key]['value']).$lsp; + } + if ($newline) { + if (!$this->premode) { + $prelen = strlen($dom[$key]['value']); + if ($this->isRTLTextDir() AND !$isRTLString) { + // right trim except non-breaking space + $dom[$key]['value'] = $this->stringRightTrim($dom[$key]['value']); + } else { + // left trim except non-breaking space + $dom[$key]['value'] = $this->stringLeftTrim($dom[$key]['value']); + } + $postlen = strlen($dom[$key]['value']); + if (($postlen == 0) AND ($prelen > 0)) { + $dom[$key]['trimmed_space'] = true; + } + } + $newline = false; + $firstblock = true; + } else { + $firstblock = false; + // replace empty multiple spaces string with a single space + $dom[$key]['value'] = preg_replace('/^'.$this->re_space['p'].'+$/'.$this->re_space['m'], chr(32), $dom[$key]['value']); + } + $strrest = ''; + if ($this->rtl) { + $this->x -= $this->textindent; + } else { + $this->x += $this->textindent; + } + if (!isset($dom[$key]['trimmed_space']) OR !$dom[$key]['trimmed_space']) { + $strlinelen = $this->GetStringWidth($dom[$key]['value']); + if (!empty($this->HREF) AND (isset($this->HREF['url']))) { + // HTML
      Link + $hrefcolor = ''; + if (isset($dom[($dom[$key]['parent'])]['fgcolor']) AND ($dom[($dom[$key]['parent'])]['fgcolor'] !== false)) { + $hrefcolor = $dom[($dom[$key]['parent'])]['fgcolor']; + } + $hrefstyle = -1; + if (isset($dom[($dom[$key]['parent'])]['fontstyle']) AND ($dom[($dom[$key]['parent'])]['fontstyle'] !== false)) { + $hrefstyle = $dom[($dom[$key]['parent'])]['fontstyle']; + } + $strrest = $this->addHtmlLink($this->HREF['url'], $dom[$key]['value'], $wfill, true, $hrefcolor, $hrefstyle, true); + } else { + $wadj = 0; // space to leave for block continuity + if ($this->rtl) { + $cwa = ($this->x - $this->lMargin); + } else { + $cwa = ($this->w - $this->rMargin - $this->x); + } + if (($strlinelen < $cwa) AND (isset($dom[($key + 1)])) AND ($dom[($key + 1)]['tag']) AND (!$dom[($key + 1)]['block'])) { + // check the next text blocks for continuity + $nkey = ($key + 1); + $write_block = true; + $same_textdir = true; + $tmp_fontname = $this->FontFamily; + $tmp_fontstyle = $this->FontStyle; + $tmp_fontsize = $this->FontSizePt; + while ($write_block AND isset($dom[$nkey])) { + if ($dom[$nkey]['tag']) { + if ($dom[$nkey]['block']) { + // end of block + $write_block = false; + } + $tmp_fontname = isset($dom[$nkey]['fontname']) ? $dom[$nkey]['fontname'] : $this->FontFamily; + $tmp_fontstyle = isset($dom[$nkey]['fontstyle']) ? $dom[$nkey]['fontstyle'] : $this->FontStyle; + $tmp_fontsize = isset($dom[$nkey]['fontsize']) ? $dom[$nkey]['fontsize'] : $this->FontSizePt; + $same_textdir = ($dom[$nkey]['dir'] == $dom[$key]['dir']); + } else { + $nextstr = TCPDF_STATIC::pregSplit('/'.$this->re_space['p'].'+/', $this->re_space['m'], $dom[$nkey]['value']); + if (isset($nextstr[0]) AND $same_textdir) { + $wadj += $this->GetStringWidth($nextstr[0], $tmp_fontname, $tmp_fontstyle, $tmp_fontsize); + if (isset($nextstr[1])) { + $write_block = false; + } + } + } + ++$nkey; + } + } + if (($wadj > 0) AND (($strlinelen + $wadj) >= $cwa)) { + $wadj = 0; + $nextstr = TCPDF_STATIC::pregSplit('/'.$this->re_space['p'].'/', $this->re_space['m'], $dom[$key]['value']); + $numblks = count($nextstr); + if ($numblks > 1) { + // try to split on blank spaces + $wadj = ($cwa - $strlinelen + $this->GetStringWidth($nextstr[($numblks - 1)])); + } else { + // set the entire block on new line + $wadj = $this->GetStringWidth($nextstr[0]); + } + } + // check for reversed text direction + if (($wadj > 0) AND (($this->rtl AND ($this->tmprtl === 'L')) OR (!$this->rtl AND ($this->tmprtl === 'R')))) { + // LTR text on RTL direction or RTL text on LTR direction + $reverse_dir = true; + $this->rtl = !$this->rtl; + $revshift = ($strlinelen + $wadj + 0.000001); // add little quantity for rounding problems + if ($this->rtl) { + $this->x += $revshift; + } else { + $this->x -= $revshift; + } + $xws = $this->x; + } + // ****** write only until the end of the line and get the rest ****** + $strrest = $this->Write($this->lasth, $dom[$key]['value'], '', $wfill, '', false, 0, true, $firstblock, 0, $wadj); + // restore default direction + if ($reverse_dir AND ($wadj == 0)) { + $this->x = $xws; // @phpstan-ignore-line + $this->rtl = !$this->rtl; + $reverse_dir = false; + } + } + } + $this->textindent = 0; + if (strlen($strrest) > 0) { + // store the remaining string on the previous $key position + $this->newline = true; + if ($strrest == $dom[$key]['value']) { + // used to avoid infinite loop + ++$loop; + } else { + $loop = 0; + } + $dom[$key]['value'] = $strrest; + if ($cell) { + if ($this->rtl) { + $this->x -= $this->cell_padding['R']; + } else { + $this->x += $this->cell_padding['L']; + } + } + if ($loop < 3) { + --$key; + } + } else { + $loop = 0; + // add the positive font spacing of the last character (if any) + if ($this->font_spacing > 0) { + if ($this->rtl) { + $this->x -= $this->font_spacing; + } else { + $this->x += $this->font_spacing; + } + } + } + } + ++$key; + if (isset($dom[$key]['tag']) AND $dom[$key]['tag'] AND (!isset($dom[$key]['opening']) OR !$dom[$key]['opening']) AND isset($dom[($dom[$key]['parent'])]['attribute']['nobr']) AND ($dom[($dom[$key]['parent'])]['attribute']['nobr'] == 'true')) { + // check if we are on a new page or on a new column + if ((!$undo) AND (($this->y < $this->start_transaction_y) OR (($dom[$key]['value'] == 'tr') AND ($dom[($dom[$key]['parent'])]['endy'] < $this->start_transaction_y)))) { + // we are on a new page or on a new column and the total object height is less than the available vertical space. + // restore previous object + $this->rollbackTransaction(true); + // restore previous values + foreach ($this_method_vars as $vkey => $vval) { + $$vkey = $vval; + } + if (!empty($dom[$key]['thead'])) { + $this->inthead = true; + } + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $pre_y = $this->y; + if ((!$this->checkPageBreak($this->PageBreakTrigger + 1)) AND ($this->y < $pre_y)) { + $startliney = $this->y; + } + $undo = true; // avoid infinite loop + } else { + $undo = false; + } + } + } // end for each $key + // align the last line + if (isset($startlinex)) { + $yshift = ($minstartliney - $startliney); + if (($yshift > 0) OR ($this->page > $startlinepage)) { + $yshift = 0; + } + $t_x = 0; + // the last line must be shifted to be aligned as requested + $linew = abs($this->endlinex - $startlinex); + if ($this->inxobj) { + // we are inside an XObject template + $pstart = substr($this->xobjects[$this->xobjid]['outdata'], 0, $startlinepos); + if (isset($opentagpos)) { + $midpos = $opentagpos; + } else { + $midpos = 0; + } + if ($midpos > 0) { + $pmid = substr($this->xobjects[$this->xobjid]['outdata'], $startlinepos, ($midpos - $startlinepos)); + $pend = substr($this->xobjects[$this->xobjid]['outdata'], $midpos); + } else { + $pmid = substr($this->xobjects[$this->xobjid]['outdata'], $startlinepos); + $pend = ''; + } + } else { + $pstart = substr($this->getPageBuffer($startlinepage), 0, $startlinepos); + if (isset($opentagpos) AND isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { + $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; + $midpos = min($opentagpos, $this->footerpos[$startlinepage]); + } elseif (isset($opentagpos)) { + $midpos = $opentagpos; + } elseif (isset($this->footerlen[$startlinepage]) AND (!$this->InFooter)) { + $this->footerpos[$startlinepage] = $this->pagelen[$startlinepage] - $this->footerlen[$startlinepage]; + $midpos = $this->footerpos[$startlinepage]; + } else { + $midpos = 0; + } + if ($midpos > 0) { + $pmid = substr($this->getPageBuffer($startlinepage), $startlinepos, ($midpos - $startlinepos)); + $pend = substr($this->getPageBuffer($startlinepage), $midpos); + } else { + $pmid = substr($this->getPageBuffer($startlinepage), $startlinepos); + $pend = ''; + } + } + if ((((($plalign == 'C') OR (($plalign == 'R') AND (!$this->rtl)) OR (($plalign == 'L') AND ($this->rtl)))))) { + // calculate shifting amount + $tw = $w; + if ($this->lMargin != $prevlMargin) { + $tw += ($prevlMargin - $this->lMargin); + } + if ($this->rMargin != $prevrMargin) { + $tw += ($prevrMargin - $this->rMargin); + } + $one_space_width = $this->GetStringWidth(chr(32)); + $no = 0; // number of spaces on a line contained on a single block + if ($this->isRTLTextDir()) { // RTL + // remove left space if exist + $pos1 = TCPDF_STATIC::revstrpos($pmid, '[('); + if ($pos1 > 0) { + $pos1 = intval($pos1); + if ($this->isUnicodeFont()) { + $pos2 = intval(TCPDF_STATIC::revstrpos($pmid, '[('.chr(0).chr(32))); + $spacelen = 2; + } else { + $pos2 = intval(TCPDF_STATIC::revstrpos($pmid, '[('.chr(32))); + $spacelen = 1; + } + if ($pos1 == $pos2) { + $pmid = substr($pmid, 0, ($pos1 + 2)).substr($pmid, ($pos1 + 2 + $spacelen)); + if (substr($pmid, $pos1, 4) == '[()]') { + $linew -= $one_space_width; + } elseif ($pos1 == strpos($pmid, '[(')) { + $no = 1; + } + } + } + } else { // LTR + // remove right space if exist + $pos1 = TCPDF_STATIC::revstrpos($pmid, ')]'); + if ($pos1 > 0) { + $pos1 = intval($pos1); + if ($this->isUnicodeFont()) { + $pos2 = intval(TCPDF_STATIC::revstrpos($pmid, chr(0).chr(32).')]')) + 2; + $spacelen = 2; + } else { + $pos2 = intval(TCPDF_STATIC::revstrpos($pmid, chr(32).')]')) + 1; + $spacelen = 1; + } + if ($pos1 == $pos2) { + $pmid = substr($pmid, 0, ($pos1 - $spacelen)).substr($pmid, $pos1); + $linew -= $one_space_width; + } + } + } + $mdiff = ($tw - $linew); + if ($plalign == 'C') { + if ($this->rtl) { + $t_x = -($mdiff / 2); + } else { + $t_x = ($mdiff / 2); + } + } elseif ($plalign == 'R') { + // right alignment on LTR document + $t_x = $mdiff; + } elseif ($plalign == 'L') { + // left alignment on RTL document + $t_x = -$mdiff; + } + } // end if startlinex + if (($t_x != 0) OR ($yshift < 0)) { + // shift the line + $trx = sprintf('1 0 0 1 %F %F cm', ($t_x * $this->k), ($yshift * $this->k)); + $pstart .= "\nq\n".$trx."\n".$pmid."\nQ\n"; + $endlinepos = strlen($pstart); + if ($this->inxobj) { + // we are inside an XObject template + $this->xobjects[$this->xobjid]['outdata'] = $pstart.$pend; + foreach ($this->xobjects[$this->xobjid]['annotations'] as $pak => $pac) { + if ($pak >= $pask) { + $this->xobjects[$this->xobjid]['annotations'][$pak]['x'] += $t_x; + $this->xobjects[$this->xobjid]['annotations'][$pak]['y'] -= $yshift; + } + } + } else { + $this->setPageBuffer($startlinepage, $pstart.$pend); + // shift the annotations and links + if (isset($this->PageAnnots[$this->page])) { + foreach ($this->PageAnnots[$this->page] as $pak => $pac) { + if ($pak >= $pask) { + $this->PageAnnots[$this->page][$pak]['x'] += $t_x; + $this->PageAnnots[$this->page][$pak]['y'] -= $yshift; + } + } + } + } + $this->y -= $yshift; + $yshift = 0; + } + } + // restore previous values + $this->setGraphicVars($gvars); + if ($this->num_columns > 1) { + $this->selectColumn(); + } elseif ($this->page > $prevPage) { + $this->lMargin = $this->pagedim[$this->page]['olm']; + $this->rMargin = $this->pagedim[$this->page]['orm']; + } + // restore previous list state + $this->cell_height_ratio = $prev_cell_height_ratio; + $this->listnum = $prev_listnum; + $this->listordered = $prev_listordered; + $this->listcount = $prev_listcount; + $this->lispacer = $prev_lispacer; + if ($ln AND (!($cell AND ($dom[$key-1]['value'] == 'table')))) { + $this->Ln($this->lasth); + if (($this->y < $maxbottomliney) AND ($startlinepage == $this->page)) { + $this->y = $maxbottomliney; + } + } + unset($dom); + } + + /** + * Process opening tags. + * @param array $dom html dom array + * @param int $key current element id + * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). + * @return array $dom + * @protected + */ + protected function openHTMLTagHandler($dom, $key, $cell) { + $tag = $dom[$key]; + $parent = $dom[($dom[$key]['parent'])]; + $firsttag = ($key == 1); + // check for text direction attribute + if (isset($tag['dir'])) { + $this->setTempRTL($tag['dir']); + } else { + $this->tmprtl = false; + } + if ($tag['block']) { + $hbz = 0; // distance from y to line bottom + $hb = 0; // vertical space between block tags + // calculate vertical space for block tags + if (isset($this->tagvspaces[$tag['value']][0]['h']) && !empty($this->tagvspaces[$tag['value']][0]['h']) && ($this->tagvspaces[$tag['value']][0]['h'] >= 0)) { + $cur_h = $this->tagvspaces[$tag['value']][0]['h']; + } elseif (isset($tag['fontsize'])) { + $cur_h = $this->getCellHeight($tag['fontsize'] / $this->k); + } else { + $cur_h = $this->getCellHeight($this->FontSize); + } + if (isset($this->tagvspaces[$tag['value']][0]['n'])) { + $on = $this->tagvspaces[$tag['value']][0]['n']; + } elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) { + $on = 0.6; + } else { + $on = 1; + } + if ((!isset($this->tagvspaces[$tag['value']])) AND (in_array($tag['value'], array('div', 'dt', 'dd', 'li', 'br', 'hr')))) { + $hb = 0; + } else { + $hb = ($on * $cur_h); + } + if (($this->htmlvspace <= 0) AND ($on > 0)) { + if (isset($parent['fontsize'])) { + $hbz = (($parent['fontsize'] / $this->k) * $this->cell_height_ratio); + } else { + $hbz = $this->getCellHeight($this->FontSize); + } + } + if (isset($dom[($key - 1)]) AND ($dom[($key - 1)]['value'] == 'table')) { + // fix vertical space after table + $hbz = 0; + } + // closing vertical space + $hbc = 0; + if (isset($this->tagvspaces[$tag['value']][1]['h']) && !empty($this->tagvspaces[$tag['value']][1]['h']) && ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) { + $pre_h = $this->tagvspaces[$tag['value']][1]['h']; + } elseif (isset($parent['fontsize'])) { + $pre_h = $this->getCellHeight($parent['fontsize'] / $this->k); + } else { + $pre_h = $this->getCellHeight($this->FontSize); + } + if (isset($this->tagvspaces[$tag['value']][1]['n'])) { + $cn = $this->tagvspaces[$tag['value']][1]['n']; + } elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) { + $cn = 0.6; + } else { + $cn = 1; + } + if (isset($this->tagvspaces[$tag['value']][1])) { + $hbc = ($cn * $pre_h); + } + } + // Opening tag + switch($tag['value']) { + case 'table': { + $cp = 0; + $cs = 0; + $dom[$key]['rowspans'] = array(); + if (!isset($dom[$key]['attribute']['nested']) OR ($dom[$key]['attribute']['nested'] != 'true')) { + $this->htmlvspace = 0; + // set table header + if (!TCPDF_STATIC::empty_string($dom[$key]['thead'])) { + // set table header + $this->thead = $dom[$key]['thead']; + if (!isset($this->theadMargins) OR (empty($this->theadMargins))) { + $this->theadMargins = array(); + $this->theadMargins['cell_padding'] = $this->cell_padding; + $this->theadMargins['lmargin'] = $this->lMargin; + $this->theadMargins['rmargin'] = $this->rMargin; + $this->theadMargins['page'] = $this->page; + $this->theadMargins['cell'] = $cell; + $this->theadMargins['gvars'] = $this->getGraphicVars(); + } + } + } + // store current margins and page + $dom[$key]['old_cell_padding'] = $this->cell_padding; + if (isset($tag['attribute']['cellpadding'])) { + $pad = $this->getHTMLUnitToUnits($tag['attribute']['cellpadding'], 1, 'px'); + $this->setCellPadding($pad); + } elseif (isset($tag['padding'])) { + $this->cell_padding = $tag['padding']; + } + if (isset($tag['attribute']['cellspacing'])) { + $cs = $this->getHTMLUnitToUnits($tag['attribute']['cellspacing'], 1, 'px'); + } elseif (isset($tag['border-spacing'])) { + $cs = $tag['border-spacing']['V']; + } + $prev_y = $this->y; + if ($this->checkPageBreak(((2 * $cp) + (2 * $cs) + $this->lasth), '', false) OR ($this->y < $prev_y)) { + $this->inthead = true; + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $this->checkPageBreak($this->PageBreakTrigger + 1); + } + break; + } + case 'tr': { + // array of columns positions + $dom[$key]['cellpos'] = array(); + break; + } + case 'hr': { + if ((isset($tag['height'])) AND ($tag['height'] != '')) { + $hrHeight = $this->getHTMLUnitToUnits($tag['height'], 1, 'px'); + } else { + $hrHeight = $this->GetLineWidth(); + } + $this->addHTMLVertSpace($hbz, max($hb, ($hrHeight / 2)), $cell, $firsttag); + $x = $this->GetX(); + $y = $this->GetY(); + $wtmp = $this->w - $this->lMargin - $this->rMargin; + if ($cell) { + $wtmp -= ($this->cell_padding['L'] + $this->cell_padding['R']); + } + if ((isset($tag['width'])) AND ($tag['width'] != '')) { + $hrWidth = $this->getHTMLUnitToUnits($tag['width'], $wtmp, 'px'); + } else { + $hrWidth = $wtmp; + } + $prevlinewidth = $this->GetLineWidth(); + $this->setLineWidth($hrHeight); + + $lineStyle = array(); + if (isset($tag['fgcolor'])) { + $lineStyle['color'] = $tag['fgcolor']; + } + + if (isset($tag['fgcolor'])) { + $lineStyle['color'] = $tag['fgcolor']; + } + + if (isset($tag['style']['cap'])) { + $lineStyle['cap'] = $tag['style']['cap']; + } + + if (isset($tag['style']['join'])) { + $lineStyle['join'] = $tag['style']['join']; + } + + if (isset($tag['style']['dash'])) { + $lineStyle['dash'] = $tag['style']['dash']; + } + + if (isset($tag['style']['phase'])) { + $lineStyle['phase'] = $tag['style']['phase']; + } + + $lineStyle = array_filter($lineStyle); + + $this->Line($x, $y, $x + $hrWidth, $y, $lineStyle); + $this->setLineWidth($prevlinewidth); + $this->addHTMLVertSpace(max($hbc, ($hrHeight / 2)), 0, $cell, !isset($dom[($key + 1)])); + break; + } + case 'a': { + if (array_key_exists('href', $tag['attribute'])) { + $this->HREF['url'] = $tag['attribute']['href']; + } + break; + } + case 'img': { + if (empty($tag['attribute']['src'])) { + break; + } + $imgsrc = $tag['attribute']['src']; + if ($imgsrc[0] === '@') { + // data stream + $imgsrc = '@'.base64_decode(substr($imgsrc, 1)); + $type = ''; + } else if (preg_match('@^data:image/([^;]*);base64,(.*)@', $imgsrc, $reg)) { + $imgsrc = '@'.base64_decode($reg[2]); + $type = $reg[1]; + } elseif ( $this->allowLocalFiles && substr($imgsrc, 0, 7) === 'file://') { + // get image type from a local file path + $imgsrc = substr($imgsrc, 7); + $type = TCPDF_IMAGES::getImageFileType($imgsrc); + } else { + if (($imgsrc[0] === '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { + // fix image path + $findroot = strpos($imgsrc, $_SERVER['DOCUMENT_ROOT']); + if (($findroot === false) OR ($findroot > 1)) { + if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') { + $imgsrc = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$imgsrc; + } else { + $imgsrc = $_SERVER['DOCUMENT_ROOT'].$imgsrc; + } + } + $imgsrc = urldecode($imgsrc); + $testscrtype = @parse_url($imgsrc); + if (empty($testscrtype['query'])) { + // convert URL to server path + $imgsrc = str_replace(K_PATH_URL, K_PATH_MAIN, $imgsrc); + } elseif (preg_match('|^https?://|', $imgsrc) !== 1) { + // convert URL to server path + $imgsrc = str_replace(K_PATH_MAIN, K_PATH_URL, $imgsrc); + } + } + // get image type + $type = TCPDF_IMAGES::getImageFileType($imgsrc); + } + if (!isset($tag['width'])) { + $tag['width'] = 0; + } + if (!isset($tag['height'])) { + $tag['height'] = 0; + } + //if (!isset($tag['attribute']['align'])) { + // the only alignment supported is "bottom" + // further development is required for other modes. + $tag['attribute']['align'] = 'bottom'; + //} + switch($tag['attribute']['align']) { + case 'top': { + $align = 'T'; + break; + } + case 'middle': { + $align = 'M'; + break; + } + case 'bottom': { + $align = 'B'; + break; + } + default: { + $align = 'B'; + break; + } + } + $prevy = $this->y; + $xpos = $this->x; + $imglink = ''; + if (isset($this->HREF['url']) AND !TCPDF_STATIC::empty_string($this->HREF['url'])) { + $imglink = $this->HREF['url']; + if ($imglink[0] == '#') { + // convert url to internal link + $lnkdata = explode(',', $imglink); + if (isset($lnkdata[0])) { + $page = intval(substr($lnkdata[0], 1)); + if (empty($page) OR ($page <= 0)) { + $page = $this->page; + } + if (isset($lnkdata[1]) AND (strlen($lnkdata[1]) > 0)) { + $lnky = floatval($lnkdata[1]); + } else { + $lnky = 0; + } + $imglink = $this->AddLink(); + $this->setLink($imglink, $lnky, $page); + } + } + } + $border = 0; + if (isset($tag['border']) AND !empty($tag['border'])) { + // currently only support 1 (frame) or a combination of 'LTRB' + $border = $tag['border']; + } + $iw = ''; + if (isset($tag['width'])) { + $iw = $this->getHTMLUnitToUnits($tag['width'], ($tag['fontsize'] / $this->k), 'px', false); + } + $ih = ''; + if (isset($tag['height'])) { + $ih = $this->getHTMLUnitToUnits($tag['height'], ($tag['fontsize'] / $this->k), 'px', false); + } + if (($type == 'eps') OR ($type == 'ai')) { + $this->ImageEps($imgsrc, $xpos, $this->y, $iw, $ih, $imglink, true, $align, '', $border, true); + } elseif ($type == 'svg') { + $this->ImageSVG($imgsrc, $xpos, $this->y, $iw, $ih, $imglink, $align, '', $border, true); + } else { + $this->Image($imgsrc, $xpos, $this->y, $iw, $ih, '', $imglink, $align, false, 300, '', false, false, $border, false, false, true); + } + switch($align) { + case 'T': { + $this->y = $prevy; + break; + } + case 'M': { + $this->y = (($this->img_rb_y + $prevy - ($this->getCellHeight($tag['fontsize'] / $this->k))) / 2); + break; + } + case 'B': { + $this->y = $this->img_rb_y - ($this->getCellHeight($tag['fontsize'] / $this->k) - ($this->getFontDescent($tag['fontname'], $tag['fontstyle'], $tag['fontsize']) * $this->cell_height_ratio)); + break; + } + } + break; + } + case 'dl': { + ++$this->listnum; + if ($this->listnum == 1) { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + } else { + $this->addHTMLVertSpace(0, 0, $cell, $firsttag); + } + break; + } + case 'dt': { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + break; + } + case 'dd': { + if ($this->rtl) { + $this->rMargin += $this->listindent; + } else { + $this->lMargin += $this->listindent; + } + ++$this->listindentlevel; + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + break; + } + case 'ul': + case 'ol': { + ++$this->listnum; + if ($tag['value'] == 'ol') { + $this->listordered[$this->listnum] = true; + } else { + $this->listordered[$this->listnum] = false; + } + if (isset($tag['attribute']['start'])) { + $this->listcount[$this->listnum] = intval($tag['attribute']['start']) - 1; + } else { + $this->listcount[$this->listnum] = 0; + } + if ($this->rtl) { + $this->rMargin += $this->listindent; + $this->x -= $this->listindent; + } else { + $this->lMargin += $this->listindent; + $this->x += $this->listindent; + } + ++$this->listindentlevel; + if ($this->listnum == 1) { + if ($key > 1) { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + } + } else { + $this->addHTMLVertSpace(0, 0, $cell, $firsttag); + } + break; + } + case 'li': { + if ($key > 2) { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + } + if ($this->listordered[$this->listnum]) { + // ordered item + if (isset($parent['attribute']['type']) AND !TCPDF_STATIC::empty_string($parent['attribute']['type'])) { + $this->lispacer = $parent['attribute']['type']; + } elseif (isset($parent['listtype']) AND !TCPDF_STATIC::empty_string($parent['listtype'])) { + $this->lispacer = $parent['listtype']; + } elseif (isset($this->lisymbol) AND !TCPDF_STATIC::empty_string($this->lisymbol)) { + $this->lispacer = $this->lisymbol; + } else { + $this->lispacer = '#'; + } + ++$this->listcount[$this->listnum]; + if (isset($tag['attribute']['value'])) { + $this->listcount[$this->listnum] = intval($tag['attribute']['value']); + } + } else { + // unordered item + if (isset($parent['attribute']['type']) AND !TCPDF_STATIC::empty_string($parent['attribute']['type'])) { + $this->lispacer = $parent['attribute']['type']; + } elseif (isset($parent['listtype']) AND !TCPDF_STATIC::empty_string($parent['listtype'])) { + $this->lispacer = $parent['listtype']; + } elseif (isset($this->lisymbol) AND !TCPDF_STATIC::empty_string($this->lisymbol)) { + $this->lispacer = $this->lisymbol; + } else { + $this->lispacer = '!'; + } + } + break; + } + case 'blockquote': { + if ($this->rtl) { + $this->rMargin += $this->listindent; + } else { + $this->lMargin += $this->listindent; + } + ++$this->listindentlevel; + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + break; + } + case 'br': { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + break; + } + case 'div': { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + break; + } + case 'p': { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + break; + } + case 'pre': { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + $this->premode = true; + break; + } + case 'sup': { + $this->setXY($this->GetX(), $this->GetY() - ((0.7 * $this->FontSizePt) / $this->k)); + break; + } + case 'sub': { + $this->setXY($this->GetX(), $this->GetY() + ((0.3 * $this->FontSizePt) / $this->k)); + break; + } + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': { + $this->addHTMLVertSpace($hbz, $hb, $cell, $firsttag); + break; + } + // Form fields (since 4.8.000 - 2009-09-07) + case 'form': { + if (isset($tag['attribute']['action'])) { + $this->form_action = $tag['attribute']['action']; + } else { + $this->Error('Please explicitly set action attribute path!'); + } + if (isset($tag['attribute']['enctype'])) { + $this->form_enctype = $tag['attribute']['enctype']; + } else { + $this->form_enctype = 'application/x-www-form-urlencoded'; + } + if (isset($tag['attribute']['method'])) { + $this->form_mode = $tag['attribute']['method']; + } else { + $this->form_mode = 'post'; + } + break; + } + case 'input': { + if (isset($tag['attribute']['name']) AND !TCPDF_STATIC::empty_string($tag['attribute']['name'])) { + $name = $tag['attribute']['name']; + } else { + break; + } + $prop = array(); + $opt = array(); + if (isset($tag['attribute']['readonly']) AND !TCPDF_STATIC::empty_string($tag['attribute']['readonly'])) { + $prop['readonly'] = true; + } + if (isset($tag['attribute']['value']) AND !TCPDF_STATIC::empty_string($tag['attribute']['value'])) { + $value = $tag['attribute']['value']; + } + if (isset($tag['attribute']['maxlength']) AND !TCPDF_STATIC::empty_string($tag['attribute']['maxlength'])) { + $opt['maxlen'] = intval($tag['attribute']['maxlength']); + } + $h = $this->getCellHeight($this->FontSize); + if (isset($tag['attribute']['size']) AND !TCPDF_STATIC::empty_string($tag['attribute']['size'])) { + $w = intval($tag['attribute']['size']) * $this->GetStringWidth(chr(32)) * 2; + } else { + $w = $h; + } + if (isset($tag['attribute']['checked']) AND (($tag['attribute']['checked'] == 'checked') OR ($tag['attribute']['checked'] == 'true'))) { + $checked = true; + } else { + $checked = false; + } + if (isset($tag['align'])) { + switch ($tag['align']) { + case 'C': { + $opt['q'] = 1; + break; + } + case 'R': { + $opt['q'] = 2; + break; + } + case 'L': + default: { + break; + } + } + } + switch ($tag['attribute']['type']) { + case 'text': { + if (isset($value)) { + $opt['v'] = $value; + } + $this->TextField($name, $w, $h, $prop, $opt, '', '', false); + break; + } + case 'password': { + if (isset($value)) { + $opt['v'] = $value; + } + $prop['password'] = 'true'; + $this->TextField($name, $w, $h, $prop, $opt, '', '', false); + break; + } + case 'checkbox': { + if (!isset($value)) { + break; + } + $this->CheckBox($name, $w, $checked, $prop, $opt, $value, '', '', false); + break; + } + case 'radio': { + if (!isset($value)) { + break; + } + $this->RadioButton($name, $w, $prop, $opt, $value, $checked, '', '', false); + break; + } + case 'submit': { + if (!isset($value)) { + $value = 'submit'; + } + $w = $this->GetStringWidth($value) * 1.5; + $h *= 1.6; + $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); + $action = array(); + $action['S'] = 'SubmitForm'; + $action['F'] = $this->form_action; + if ($this->form_enctype != 'FDF') { + $action['Flags'] = array('ExportFormat'); + } + if ($this->form_mode == 'get') { + $action['Flags'] = array('GetMethod'); + } + $this->Button($name, $w, $h, $value, $action, $prop, $opt, '', '', false); + break; + } + case 'reset': { + if (!isset($value)) { + $value = 'reset'; + } + $w = $this->GetStringWidth($value) * 1.5; + $h *= 1.6; + $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); + $this->Button($name, $w, $h, $value, array('S'=>'ResetForm'), $prop, $opt, '', '', false); + break; + } + case 'file': { + $prop['fileSelect'] = 'true'; + $this->TextField($name, $w, $h, $prop, $opt, '', '', false); + if (!isset($value)) { + $value = '*'; + } + $w = $this->GetStringWidth($value) * 2; + $h *= 1.2; + $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); + $jsaction = 'var f=this.getField(\''.$name.'\'); f.browseForFileToSubmit();'; + $this->Button('FB_'.$name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); + break; + } + case 'hidden': { + if (isset($value)) { + $opt['v'] = $value; + } + $opt['f'] = array('invisible', 'hidden'); + $this->TextField($name, 0, 0, $prop, $opt, '', '', false); + break; + } + case 'image': { + // THIS TYPE MUST BE FIXED + if (isset($tag['attribute']['src']) AND !TCPDF_STATIC::empty_string($tag['attribute']['src'])) { + $img = $tag['attribute']['src']; + } else { + break; + } + $value = 'img'; + //$opt['mk'] = array('i'=>$img, 'tp'=>1, 'if'=>array('sw'=>'A', 's'=>'A', 'fb'=>false)); + if (isset($tag['attribute']['onclick']) AND !empty($tag['attribute']['onclick'])) { + $jsaction = $tag['attribute']['onclick']; + } else { + $jsaction = ''; + } + $this->Button($name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); + break; + } + case 'button': { + if (!isset($value)) { + $value = ' '; + } + $w = $this->GetStringWidth($value) * 1.5; + $h *= 1.6; + $prop = array('lineWidth'=>1, 'borderStyle'=>'beveled', 'fillColor'=>array(196, 196, 196), 'strokeColor'=>array(255, 255, 255)); + if (isset($tag['attribute']['onclick']) AND !empty($tag['attribute']['onclick'])) { + $jsaction = $tag['attribute']['onclick']; + } else { + $jsaction = ''; + } + $this->Button($name, $w, $h, $value, $jsaction, $prop, $opt, '', '', false); + break; + } + } + break; + } + case 'textarea': { + $prop = array(); + $opt = array(); + if (isset($tag['attribute']['readonly']) AND !TCPDF_STATIC::empty_string($tag['attribute']['readonly'])) { + $prop['readonly'] = true; + } + if (isset($tag['attribute']['name']) AND !TCPDF_STATIC::empty_string($tag['attribute']['name'])) { + $name = $tag['attribute']['name']; + } else { + break; + } + if (isset($tag['attribute']['value']) AND !TCPDF_STATIC::empty_string($tag['attribute']['value'])) { + $opt['v'] = $tag['attribute']['value']; + } + if (isset($tag['attribute']['cols']) AND !TCPDF_STATIC::empty_string($tag['attribute']['cols'])) { + $w = intval($tag['attribute']['cols']) * $this->GetStringWidth(chr(32)) * 2; + } else { + $w = 40; + } + if (isset($tag['attribute']['rows']) AND !TCPDF_STATIC::empty_string($tag['attribute']['rows'])) { + $h = intval($tag['attribute']['rows']) * $this->getCellHeight($this->FontSize); + } else { + $h = 10; + } + $prop['multiline'] = 'true'; + $this->TextField($name, $w, $h, $prop, $opt, '', '', false); + break; + } + case 'select': { + $h = $this->getCellHeight($this->FontSize); + if (isset($tag['attribute']['size']) AND !TCPDF_STATIC::empty_string($tag['attribute']['size'])) { + $h *= ($tag['attribute']['size'] + 1); + } + $prop = array(); + $opt = array(); + if (isset($tag['attribute']['name']) AND !TCPDF_STATIC::empty_string($tag['attribute']['name'])) { + $name = $tag['attribute']['name']; + } else { + break; + } + $w = 0; + if (isset($tag['attribute']['opt']) AND !TCPDF_STATIC::empty_string($tag['attribute']['opt'])) { + $options = explode('#!NwL!#', $tag['attribute']['opt']); + $values = array(); + foreach ($options as $val) { + if (strpos($val, '#!TaB!#') !== false) { + $opts = explode('#!TaB!#', $val); + $values[] = $opts; + $w = max($w, $this->GetStringWidth($opts[1])); + } else { + $values[] = $val; + $w = max($w, $this->GetStringWidth($val)); + } + } + } else { + break; + } + $w *= 2; + if (isset($tag['attribute']['multiple']) AND ($tag['attribute']['multiple']='multiple')) { + $prop['multipleSelection'] = 'true'; + $this->ListBox($name, $w, $h, $values, $prop, $opt, '', '', false); + } else { + $this->ComboBox($name, $w, $h, $values, $prop, $opt, '', '', false); + } + break; + } + case 'tcpdf': { + if (defined('K_TCPDF_CALLS_IN_HTML') AND (K_TCPDF_CALLS_IN_HTML === true)) { + // Special tag used to call TCPDF methods + if (isset($tag['attribute']['method'])) { + $tcpdf_method = $tag['attribute']['method']; + if (method_exists($this, $tcpdf_method)) { + if (isset($tag['attribute']['params']) AND (!empty($tag['attribute']['params']))) { + $params = $this->unserializeTCPDFtagParameters($tag['attribute']['params']); + call_user_func_array(array($this, $tcpdf_method), $params); + } else { + $this->$tcpdf_method(); + } + $this->newline = true; + } + } + } + break; + } + default: { + break; + } + } + // define tags that support borders and background colors + $bordertags = array('blockquote','br','dd','dl','div','dt','h1','h2','h3','h4','h5','h6','hr','li','ol','p','pre','ul','tcpdf','table'); + if (in_array($tag['value'], $bordertags)) { + // set border + $dom[$key]['borderposition'] = $this->getBorderStartPosition(); + } + if ($dom[$key]['self'] AND isset($dom[$key]['attribute']['pagebreakafter'])) { + $pba = $dom[$key]['attribute']['pagebreakafter']; + // check for pagebreak + if (($pba == 'true') OR ($pba == 'left') OR ($pba == 'right')) { + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $this->checkPageBreak($this->PageBreakTrigger + 1); + } + if ((($pba == 'left') AND (((!$this->rtl) AND (($this->page % 2) == 0)) OR (($this->rtl) AND (($this->page % 2) != 0)))) + OR (($pba == 'right') AND (((!$this->rtl) AND (($this->page % 2) != 0)) OR (($this->rtl) AND (($this->page % 2) == 0))))) { + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $this->checkPageBreak($this->PageBreakTrigger + 1); + } + } + return $dom; + } + + /** + * Process closing tags. + * @param array $dom html dom array + * @param int $key current element id + * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). + * @param int $maxbottomliney maximum y value of current line + * @return array $dom + * @protected + */ + protected function closeHTMLTagHandler($dom, $key, $cell, $maxbottomliney=0) { + $tag = $dom[$key]; + $parent = $dom[($dom[$key]['parent'])]; + $lasttag = ((!isset($dom[($key + 1)])) OR ((!isset($dom[($key + 2)])) AND ($dom[($key + 1)]['value'] == 'marker'))); + $in_table_head = false; + // maximum x position (used to draw borders) + if ($this->rtl) { + $xmax = $this->w; + } else { + $xmax = 0; + } + if ($tag['block']) { + $hbz = 0; // distance from y to line bottom + $hb = 0; // vertical space between block tags + // calculate vertical space for block tags + if (isset($this->tagvspaces[$tag['value']][1]['h']) && !empty($this->tagvspaces[$tag['value']][1]['h']) && ($this->tagvspaces[$tag['value']][1]['h'] >= 0)) { + $pre_h = $this->tagvspaces[$tag['value']][1]['h']; + } elseif (isset($parent['fontsize'])) { + $pre_h = $this->getCellHeight($parent['fontsize'] / $this->k); + } else { + $pre_h = $this->getCellHeight($this->FontSize); + } + if (isset($this->tagvspaces[$tag['value']][1]['n'])) { + $cn = $this->tagvspaces[$tag['value']][1]['n']; + } elseif (preg_match('/[h][0-9]/', $tag['value']) > 0) { + $cn = 0.6; + } else { + $cn = 1; + } + if ((!isset($this->tagvspaces[$tag['value']])) AND ($tag['value'] == 'div')) { + $hb = 0; + } else { + $hb = ($cn * $pre_h); + } + if ($maxbottomliney > $this->PageBreakTrigger) { + $hbz = $this->getCellHeight($this->FontSize); + } elseif ($this->y < $maxbottomliney) { + $hbz = ($maxbottomliney - $this->y); + } + } + // Closing tag + switch($tag['value']) { + case 'tr': { + $table_el = $dom[($dom[$key]['parent'])]['parent']; + if (!isset($parent['endy'])) { + $dom[($dom[$key]['parent'])]['endy'] = $this->y; + $parent['endy'] = $this->y; + } + if (!isset($parent['endpage'])) { + $dom[($dom[$key]['parent'])]['endpage'] = $this->page; + $parent['endpage'] = $this->page; + } + if (!isset($parent['endcolumn'])) { + $dom[($dom[$key]['parent'])]['endcolumn'] = $this->current_column; + $parent['endcolumn'] = $this->current_column; + } + // update row-spanned cells + if (isset($dom[$table_el]['rowspans'])) { + foreach ($dom[$table_el]['rowspans'] as $k => $trwsp) { + $dom[$table_el]['rowspans'][$k]['rowspan'] -= 1; + if ($dom[$table_el]['rowspans'][$k]['rowspan'] == 0) { + if (($dom[$table_el]['rowspans'][$k]['endpage'] == $parent['endpage']) AND ($dom[$table_el]['rowspans'][$k]['endcolumn'] == $parent['endcolumn'])) { + $dom[($dom[$key]['parent'])]['endy'] = max($dom[$table_el]['rowspans'][$k]['endy'], $parent['endy']); + } elseif (($dom[$table_el]['rowspans'][$k]['endpage'] > $parent['endpage']) OR ($dom[$table_el]['rowspans'][$k]['endcolumn'] > $parent['endcolumn'])) { + $dom[($dom[$key]['parent'])]['endy'] = $dom[$table_el]['rowspans'][$k]['endy']; + $dom[($dom[$key]['parent'])]['endpage'] = $dom[$table_el]['rowspans'][$k]['endpage']; + $dom[($dom[$key]['parent'])]['endcolumn'] = $dom[$table_el]['rowspans'][$k]['endcolumn']; + } + } + } + // report new endy and endpage to the rowspanned cells + foreach ($dom[$table_el]['rowspans'] as $k => $trwsp) { + if ($dom[$table_el]['rowspans'][$k]['rowspan'] == 0) { + $dom[$table_el]['rowspans'][$k]['endpage'] = max($dom[$table_el]['rowspans'][$k]['endpage'], $dom[($dom[$key]['parent'])]['endpage']); + $dom[($dom[$key]['parent'])]['endpage'] = $dom[$table_el]['rowspans'][$k]['endpage']; + $dom[$table_el]['rowspans'][$k]['endcolumn'] = max($dom[$table_el]['rowspans'][$k]['endcolumn'], $dom[($dom[$key]['parent'])]['endcolumn']); + $dom[($dom[$key]['parent'])]['endcolumn'] = $dom[$table_el]['rowspans'][$k]['endcolumn']; + $dom[$table_el]['rowspans'][$k]['endy'] = max($dom[$table_el]['rowspans'][$k]['endy'], $dom[($dom[$key]['parent'])]['endy']); + $dom[($dom[$key]['parent'])]['endy'] = $dom[$table_el]['rowspans'][$k]['endy']; + } + } + // update remaining rowspanned cells + foreach ($dom[$table_el]['rowspans'] as $k => $trwsp) { + if ($dom[$table_el]['rowspans'][$k]['rowspan'] == 0) { + $dom[$table_el]['rowspans'][$k]['endpage'] = $dom[($dom[$key]['parent'])]['endpage']; + $dom[$table_el]['rowspans'][$k]['endcolumn'] = $dom[($dom[$key]['parent'])]['endcolumn']; + $dom[$table_el]['rowspans'][$k]['endy'] = $dom[($dom[$key]['parent'])]['endy']; + } + } + } + $prev_page = $this->page; + $this->setPage($dom[($dom[$key]['parent'])]['endpage']); + if ($this->num_columns > 1) { + if (($prev_page < $this->page) + AND ((($this->current_column == 0) AND ($dom[($dom[$key]['parent'])]['endcolumn'] == ($this->num_columns - 1))) + OR ($this->current_column == $dom[($dom[$key]['parent'])]['endcolumn']))) { + // page jump + $this->selectColumn(0); + $dom[($dom[$key]['parent'])]['endcolumn'] = 0; + $dom[($dom[$key]['parent'])]['endy'] = $this->y; + } else { + $this->selectColumn($dom[($dom[$key]['parent'])]['endcolumn']); + $this->y = $dom[($dom[$key]['parent'])]['endy']; + } + } else { + $this->y = $dom[($dom[$key]['parent'])]['endy']; + } + if (isset($dom[$table_el]['attribute']['cellspacing'])) { + $this->y += $this->getHTMLUnitToUnits($dom[$table_el]['attribute']['cellspacing'], 1, 'px'); + } elseif (isset($dom[$table_el]['border-spacing'])) { + $this->y += $dom[$table_el]['border-spacing']['V']; + } + $this->Ln(0, $cell); + if ($this->current_column == $parent['startcolumn']) { + $this->x = $parent['startx']; + } + // account for booklet mode + if ($this->page > $parent['startpage']) { + if (($this->rtl) AND ($this->pagedim[$this->page]['orm'] != $this->pagedim[$parent['startpage']]['orm'])) { + $this->x -= ($this->pagedim[$this->page]['orm'] - $this->pagedim[$parent['startpage']]['orm']); + } elseif ((!$this->rtl) AND ($this->pagedim[$this->page]['olm'] != $this->pagedim[$parent['startpage']]['olm'])) { + $this->x += ($this->pagedim[$this->page]['olm'] - $this->pagedim[$parent['startpage']]['olm']); + } + } + break; + } + case 'tablehead': + // closing tag used for the thead part + $in_table_head = true; + $this->inthead = false; + case 'table': { + $table_el = $parent; + // set default border + if (isset($table_el['attribute']['border']) AND ($table_el['attribute']['border'] > 0)) { + // set default border + $border = array('LTRB' => array('width' => $this->getCSSBorderWidth($table_el['attribute']['border']), 'cap'=>'square', 'join'=>'miter', 'dash'=> 0, 'color'=>array(0,0,0))); + } else { + $border = 0; + } + $default_border = $border; + // fix bottom line alignment of last line before page break + foreach ($dom[($dom[$key]['parent'])]['trids'] as $j => $trkey) { + // update row-spanned cells + if (isset($dom[($dom[$key]['parent'])]['rowspans'])) { + foreach ($dom[($dom[$key]['parent'])]['rowspans'] as $k => $trwsp) { + if (isset($prevtrkey) AND ($trwsp['trid'] == $prevtrkey) AND ($trwsp['mrowspan'] > 0)) { + $dom[($dom[$key]['parent'])]['rowspans'][$k]['trid'] = $trkey; + } + if ($dom[($dom[$key]['parent'])]['rowspans'][$k]['trid'] == $trkey) { + $dom[($dom[$key]['parent'])]['rowspans'][$k]['mrowspan'] -= 1; + } + } + } + if (isset($prevtrkey) AND ($dom[$trkey]['startpage'] > $dom[$prevtrkey]['endpage'])) { + $pgendy = $this->pagedim[$dom[$prevtrkey]['endpage']]['hk'] - $this->pagedim[$dom[$prevtrkey]['endpage']]['bm']; + $dom[$prevtrkey]['endy'] = $pgendy; + // update row-spanned cells + if (isset($dom[($dom[$key]['parent'])]['rowspans'])) { + foreach ($dom[($dom[$key]['parent'])]['rowspans'] as $k => $trwsp) { + if (($trwsp['trid'] == $prevtrkey) AND ($trwsp['mrowspan'] >= 0) AND ($trwsp['endpage'] == $dom[$prevtrkey]['endpage'])) { + $dom[($dom[$key]['parent'])]['rowspans'][$k]['endy'] = $pgendy; + $dom[($dom[$key]['parent'])]['rowspans'][$k]['mrowspan'] = -1; + } + } + } + } + $prevtrkey = $trkey; + $table_el = $dom[($dom[$key]['parent'])]; + } + // for each row + if (!empty($table_el['trids'])) { + unset($xmax); + } + foreach ($table_el['trids'] as $j => $trkey) { + $parent = $dom[$trkey]; + if (!isset($xmax)) { + $xmax = $parent['cellpos'][(count($parent['cellpos']) - 1)]['endx']; + } + // for each cell on the row + foreach ($parent['cellpos'] as $k => $cellpos) { + if (isset($cellpos['rowspanid']) AND ($cellpos['rowspanid'] >= 0)) { + $cellpos['startx'] = $table_el['rowspans'][($cellpos['rowspanid'])]['startx']; + $cellpos['endx'] = $table_el['rowspans'][($cellpos['rowspanid'])]['endx']; + $endy = $table_el['rowspans'][($cellpos['rowspanid'])]['endy']; + $startpage = $table_el['rowspans'][($cellpos['rowspanid'])]['startpage']; + $endpage = $table_el['rowspans'][($cellpos['rowspanid'])]['endpage']; + $startcolumn = $table_el['rowspans'][($cellpos['rowspanid'])]['startcolumn']; + $endcolumn = $table_el['rowspans'][($cellpos['rowspanid'])]['endcolumn']; + } else { + $endy = $parent['endy']; + $startpage = $parent['startpage']; + $endpage = $parent['endpage']; + $startcolumn = $parent['startcolumn']; + $endcolumn = $parent['endcolumn']; + } + if ($this->num_columns == 0) { + $this->num_columns = 1; + } + if (isset($cellpos['border'])) { + $border = $cellpos['border']; + } + if (isset($cellpos['bgcolor']) AND ($cellpos['bgcolor']) !== false) { + $this->setFillColorArray($cellpos['bgcolor']); + $fill = true; + } else { + $fill = false; + } + $x = $cellpos['startx']; + $y = $parent['starty']; + $starty = $y; + $w = abs($cellpos['endx'] - $cellpos['startx']); + // get border modes + $border_start = TCPDF_STATIC::getBorderMode($border, $position='start', $this->opencell); + $border_end = TCPDF_STATIC::getBorderMode($border, $position='end', $this->opencell); + $border_middle = TCPDF_STATIC::getBorderMode($border, $position='middle', $this->opencell); + // design borders around HTML cells. + for ($page = $startpage; $page <= $endpage; ++$page) { // for each page + $ccode = ''; + $this->setPage($page); + if ($this->num_columns < 2) { + // single-column mode + $this->x = $x; + $this->y = $this->tMargin; + } + // account for margin changes + if ($page > $startpage) { + if (($this->rtl) AND ($this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm'])) { + $this->x -= ($this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm']); + } elseif ((!$this->rtl) AND ($this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm'])) { + $this->x += ($this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm']); + } + } + if ($startpage == $endpage) { // single page + $deltacol = 0; + $deltath = 0; + for ($column = $startcolumn; $column <= $endcolumn; ++$column) { // for each column + $this->selectColumn($column); + if ($startcolumn == $endcolumn) { // single column + $cborder = $border; + $h = $endy - $parent['starty']; + $this->y = $y; + $this->x = $x; + } elseif ($column == $startcolumn) { // first column + $cborder = $border_start; + $this->y = $starty; + $this->x = $x; + $h = $this->h - $this->y - $this->bMargin; + if ($this->rtl) { + $deltacol = $this->x + $this->rMargin - $this->w; + } else { + $deltacol = $this->x - $this->lMargin; + } + } elseif ($column == $endcolumn) { // end column + $cborder = $border_end; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $endy - $this->y; + } else { // middle column + $cborder = $border_middle; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $this->h - $this->y - $this->bMargin; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } elseif ($page == $startpage) { // first page + $deltacol = 0; + $deltath = 0; + for ($column = $startcolumn; $column < $this->num_columns; ++$column) { // for each column + $this->selectColumn($column); + if ($column == $startcolumn) { // first column + $cborder = $border_start; + $this->y = $starty; + $this->x = $x; + $h = $this->h - $this->y - $this->bMargin; + if ($this->rtl) { + $deltacol = $this->x + $this->rMargin - $this->w; + } else { + $deltacol = $this->x - $this->lMargin; + } + } else { // middle column + $cborder = $border_middle; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $this->h - $this->y - $this->bMargin; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } elseif ($page == $endpage) { // last page + $deltacol = 0; + $deltath = 0; + for ($column = 0; $column <= $endcolumn; ++$column) { // for each column + $this->selectColumn($column); + if ($column == $endcolumn) { // end column + $cborder = $border_end; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $endy - $this->y; + } else { // middle column + $cborder = $border_middle; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $this->h - $this->y - $this->bMargin; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } else { // middle page + $deltacol = 0; + $deltath = 0; + for ($column = 0; $column < $this->num_columns; ++$column) { // for each column + $this->selectColumn($column); + $cborder = $border_middle; + if (isset($this->columns[$column]['th']['\''.$page.'\''])) { + $this->y = $this->columns[$column]['th']['\''.$page.'\'']; + } + $this->x += $deltacol; + $h = $this->h - $this->y - $this->bMargin; + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } + if (!empty($cborder) OR !empty($fill)) { + $offsetlen = strlen($ccode); + // draw border and fill + if ($this->inxobj) { + // we are inside an XObject template + if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { + $pagemarkkey = key($this->xobjects[$this->xobjid]['transfmrk']); + $pagemark = $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey]; + $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey] += $offsetlen; + } else { + $pagemark = $this->xobjects[$this->xobjid]['intmrk']; + $this->xobjects[$this->xobjid]['intmrk'] += $offsetlen; + } + $pagebuff = $this->xobjects[$this->xobjid]['outdata']; + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); + $this->xobjects[$this->xobjid]['outdata'] = $pstart.$ccode.$pend; + } else { + // draw border and fill + if (end($this->transfmrk[$this->page]) !== false) { + $pagemarkkey = key($this->transfmrk[$this->page]); + $pagemark = $this->transfmrk[$this->page][$pagemarkkey]; + } elseif ($this->InFooter) { + $pagemark = $this->footerpos[$this->page]; + } else { + $pagemark = $this->intmrk[$this->page]; + } + $pagebuff = $this->getPageBuffer($this->page); + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); + $this->setPageBuffer($this->page, $pstart.$ccode.$pend); + } + } + } // end for each page + // restore default border + $border = $default_border; + } // end for each cell on the row + if (isset($table_el['attribute']['cellspacing'])) { + $this->y += $this->getHTMLUnitToUnits($table_el['attribute']['cellspacing'], 1, 'px'); + } elseif (isset($table_el['border-spacing'])) { + $this->y += $table_el['border-spacing']['V']; + } + $this->Ln(0, $cell); + $this->x = $parent['startx']; + if ($endpage > $startpage) { + if (($this->rtl) AND ($this->pagedim[$endpage]['orm'] != $this->pagedim[$startpage]['orm'])) { + $this->x += ($this->pagedim[$endpage]['orm'] - $this->pagedim[$startpage]['orm']); + } elseif ((!$this->rtl) AND ($this->pagedim[$endpage]['olm'] != $this->pagedim[$startpage]['olm'])) { + $this->x += ($this->pagedim[$endpage]['olm'] - $this->pagedim[$startpage]['olm']); + } + } + } + if (!$in_table_head) { // we are not inside a thead section + $this->cell_padding = isset($table_el['old_cell_padding']) ? $table_el['old_cell_padding'] : null; + // reset row height + $this->resetLastH(); + if (($this->page == ($this->numpages - 1)) AND ($this->pageopen[$this->numpages])) { + $plendiff = ($this->pagelen[$this->numpages] - $this->emptypagemrk[$this->numpages]); + if (($plendiff > 0) AND ($plendiff < 60)) { + $pagediff = substr($this->getPageBuffer($this->numpages), $this->emptypagemrk[$this->numpages], $plendiff); + if (substr($pagediff, 0, 5) == 'BT /F') { + // the difference is only a font setting + $plendiff = 0; + } + } + if ($plendiff == 0) { + // remove last blank page + $this->deletePage($this->numpages); + } + } + if (isset($this->theadMargins['top'])) { + // restore top margin + $this->tMargin = $this->theadMargins['top']; + } + if (!isset($table_el['attribute']['nested']) OR ($table_el['attribute']['nested'] != 'true')) { + // reset main table header + $this->thead = ''; + $this->theadMargins = array(); + $this->pagedim[$this->page]['tm'] = $this->tMargin; + } + } + $parent = $table_el; + break; + } + case 'a': { + $this->HREF = array(); + break; + } + case 'sup': { + $this->setXY($this->GetX(), $this->GetY() + ((0.7 * $parent['fontsize']) / $this->k)); + break; + } + case 'sub': { + $this->setXY($this->GetX(), $this->GetY() - ((0.3 * $parent['fontsize']) / $this->k)); + break; + } + case 'div': { + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + break; + } + case 'blockquote': { + if ($this->rtl) { + $this->rMargin -= $this->listindent; + } else { + $this->lMargin -= $this->listindent; + } + --$this->listindentlevel; + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + break; + } + case 'p': { + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + break; + } + case 'pre': { + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + $this->premode = false; + break; + } + case 'dl': { + --$this->listnum; + if ($this->listnum <= 0) { + $this->listnum = 0; + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + } else { + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + } + $this->resetLastH(); + break; + } + case 'dt': { + $this->lispacer = ''; + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + break; + } + case 'dd': { + $this->lispacer = ''; + if ($this->rtl) { + $this->rMargin -= $this->listindent; + } else { + $this->lMargin -= $this->listindent; + } + --$this->listindentlevel; + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + break; + } + case 'ul': + case 'ol': { + --$this->listnum; + $this->lispacer = ''; + if ($this->rtl) { + $this->rMargin -= $this->listindent; + } else { + $this->lMargin -= $this->listindent; + } + --$this->listindentlevel; + if ($this->listnum <= 0) { + $this->listnum = 0; + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + } else { + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + } + $this->resetLastH(); + break; + } + case 'li': { + $this->lispacer = ''; + $this->addHTMLVertSpace(0, 0, $cell, false, $lasttag); + break; + } + case 'h1': + case 'h2': + case 'h3': + case 'h4': + case 'h5': + case 'h6': { + $this->addHTMLVertSpace($hbz, $hb, $cell, false, $lasttag); + break; + } + // Form fields (since 4.8.000 - 2009-09-07) + case 'form': { + $this->form_action = ''; + $this->form_enctype = 'application/x-www-form-urlencoded'; + break; + } + default : { + break; + } + } + // draw border and background (if any) + $this->drawHTMLTagBorder($parent, $xmax); + if (isset($dom[($dom[$key]['parent'])]['attribute']['pagebreakafter'])) { + $pba = $dom[($dom[$key]['parent'])]['attribute']['pagebreakafter']; + // check for pagebreak + if (($pba == 'true') OR ($pba == 'left') OR ($pba == 'right')) { + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $this->checkPageBreak($this->PageBreakTrigger + 1); + } + if ((($pba == 'left') AND (((!$this->rtl) AND (($this->page % 2) == 0)) OR (($this->rtl) AND (($this->page % 2) != 0)))) + OR (($pba == 'right') AND (((!$this->rtl) AND (($this->page % 2) != 0)) OR (($this->rtl) AND (($this->page % 2) == 0))))) { + // add a page (or trig AcceptPageBreak() for multicolumn mode) + $this->checkPageBreak($this->PageBreakTrigger + 1); + } + } + $this->tmprtl = false; + return $dom; + } + + /** + * Add vertical spaces if needed. + * @param string $hbz Distance between current y and line bottom. + * @param string $hb The height of the break. + * @param boolean $cell if true add the default left (or right if RTL) padding to each new line (default false). + * @param boolean $firsttag set to true when the tag is the first. + * @param boolean $lasttag set to true when the tag is the last. + * @protected + */ + protected function addHTMLVertSpace($hbz=0, $hb=0, $cell=false, $firsttag=false, $lasttag=false) { + if ($firsttag) { + $this->Ln(0, $cell); + $this->htmlvspace = 0; + return; + } + if ($lasttag) { + $this->Ln($hbz, $cell); + $this->htmlvspace = 0; + return; + } + if ($hb < $this->htmlvspace) { + $hd = 0; + } else { + $hd = $hb - $this->htmlvspace; + $this->htmlvspace = $hb; + } + $this->Ln(($hbz + $hd), $cell); + } + + /** + * Return the starting coordinates to draw an html border + * @return array containing top-left border coordinates + * @protected + * @since 5.7.000 (2010-08-03) + */ + protected function getBorderStartPosition() { + if ($this->rtl) { + $xmax = $this->lMargin; + } else { + $xmax = $this->w - $this->rMargin; + } + return array('page' => $this->page, 'column' => $this->current_column, 'x' => $this->x, 'y' => $this->y, 'xmax' => $xmax); + } + + /** + * Draw an HTML block border and fill + * @param array $tag array of tag properties. + * @param int $xmax end X coordinate for border. + * @protected + * @since 5.7.000 (2010-08-03) + */ + protected function drawHTMLTagBorder($tag, $xmax) { + if (!isset($tag['borderposition'])) { + // nothing to draw + return; + } + $prev_x = $this->x; + $prev_y = $this->y; + $prev_lasth = $this->lasth; + $border = 0; + $fill = false; + $this->lasth = 0; + if (isset($tag['border']) AND !empty($tag['border'])) { + // get border style + $border = $tag['border']; + if (!TCPDF_STATIC::empty_string($this->thead) AND (!$this->inthead)) { + // border for table header + $border = TCPDF_STATIC::getBorderMode($border, $position='middle', $this->opencell); + } + } + if (isset($tag['bgcolor']) AND ($tag['bgcolor'] !== false)) { + // get background color + $old_bgcolor = $this->bgcolor; + $this->setFillColorArray($tag['bgcolor']); + $fill = true; + } + if (!$border AND !$fill) { + // nothing to draw + return; + } + if (isset($tag['attribute']['cellspacing'])) { + $clsp = $this->getHTMLUnitToUnits($tag['attribute']['cellspacing'], 1, 'px'); + $cellspacing = array('H' => $clsp, 'V' => $clsp); + } elseif (isset($tag['border-spacing'])) { + $cellspacing = $tag['border-spacing']; + } else { + $cellspacing = array('H' => 0, 'V' => 0); + } + if (($tag['value'] != 'table') AND (is_array($border)) AND (!empty($border))) { + // draw the border externally respect the sqare edge. + $border['mode'] = 'ext'; + } + if ($this->rtl) { + if ($xmax >= $tag['borderposition']['x']) { + $xmax = $tag['borderposition']['xmax']; + } + $w = ($tag['borderposition']['x'] - $xmax); + } else { + if ($xmax <= $tag['borderposition']['x']) { + $xmax = $tag['borderposition']['xmax']; + } + $w = ($xmax - $tag['borderposition']['x']); + } + if ($w <= 0) { + return; + } + $w += $cellspacing['H']; + $startpage = $tag['borderposition']['page']; + $startcolumn = $tag['borderposition']['column']; + $x = $tag['borderposition']['x']; + $y = $tag['borderposition']['y']; + $endpage = $this->page; + $starty = $tag['borderposition']['y'] - $cellspacing['V']; + $currentY = $this->y; + $this->x = $x; + // get latest column + $endcolumn = $this->current_column; + if ($this->num_columns == 0) { + $this->num_columns = 1; + } + // get border modes + $border_start = TCPDF_STATIC::getBorderMode($border, $position='start', $this->opencell); + $border_end = TCPDF_STATIC::getBorderMode($border, $position='end', $this->opencell); + $border_middle = TCPDF_STATIC::getBorderMode($border, $position='middle', $this->opencell); + // temporary disable page regions + $temp_page_regions = $this->page_regions; + $this->page_regions = array(); + // design borders around HTML cells. + for ($page = $startpage; $page <= $endpage; ++$page) { // for each page + $ccode = ''; + $this->setPage($page); + if ($this->num_columns < 2) { + // single-column mode + $this->x = $x; + $this->y = $this->tMargin; + } + // account for margin changes + if ($page > $startpage) { + if (($this->rtl) AND ($this->pagedim[$page]['orm'] != $this->pagedim[$startpage]['orm'])) { + $this->x -= ($this->pagedim[$page]['orm'] - $this->pagedim[$startpage]['orm']); + } elseif ((!$this->rtl) AND ($this->pagedim[$page]['olm'] != $this->pagedim[$startpage]['olm'])) { + $this->x += ($this->pagedim[$page]['olm'] - $this->pagedim[$startpage]['olm']); + } + } + if ($startpage == $endpage) { + // single page + for ($column = $startcolumn; $column <= $endcolumn; ++$column) { // for each column + $this->selectColumn($column); + if ($startcolumn == $endcolumn) { // single column + $cborder = $border; + $h = ($currentY - $y) + $cellspacing['V']; + $this->y = $starty; + } elseif ($column == $startcolumn) { // first column + $cborder = $border_start; + $this->y = $starty; + $h = $this->h - $this->y - $this->bMargin; + } elseif ($column == $endcolumn) { // end column + $cborder = $border_end; + $h = $currentY - $this->y; + } else { // middle column + $cborder = $border_middle; + $h = $this->h - $this->y - $this->bMargin; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } elseif ($page == $startpage) { // first page + for ($column = $startcolumn; $column < $this->num_columns; ++$column) { // for each column + $this->selectColumn($column); + if ($column == $startcolumn) { // first column + $cborder = $border_start; + $this->y = $starty; + $h = $this->h - $this->y - $this->bMargin; + } else { // middle column + $cborder = $border_middle; + $h = $this->h - $this->y - $this->bMargin; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } elseif ($page == $endpage) { // last page + for ($column = 0; $column <= $endcolumn; ++$column) { // for each column + $this->selectColumn($column); + if ($column == $endcolumn) { + // end column + $cborder = $border_end; + $h = $currentY - $this->y; + } else { + // middle column + $cborder = $border_middle; + $h = $this->h - $this->y - $this->bMargin; + } + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } else { // middle page + for ($column = 0; $column < $this->num_columns; ++$column) { // for each column + $this->selectColumn($column); + $cborder = $border_middle; + $h = $this->h - $this->y - $this->bMargin; + $ccode .= $this->getCellCode($w, $h, '', $cborder, 1, '', $fill, '', 0, true)."\n"; + } // end for each column + } + if ($cborder OR $fill) { + $offsetlen = strlen($ccode); + // draw border and fill + if ($this->inxobj) { + // we are inside an XObject template + if (end($this->xobjects[$this->xobjid]['transfmrk']) !== false) { + $pagemarkkey = key($this->xobjects[$this->xobjid]['transfmrk']); + $pagemark = $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey]; + $this->xobjects[$this->xobjid]['transfmrk'][$pagemarkkey] += $offsetlen; + } else { + $pagemark = $this->xobjects[$this->xobjid]['intmrk']; + $this->xobjects[$this->xobjid]['intmrk'] += $offsetlen; + } + $pagebuff = $this->xobjects[$this->xobjid]['outdata']; + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); + $this->xobjects[$this->xobjid]['outdata'] = $pstart.$ccode.$pend; + } else { + if (end($this->transfmrk[$this->page]) !== false) { + $pagemarkkey = key($this->transfmrk[$this->page]); + $pagemark = $this->transfmrk[$this->page][$pagemarkkey]; + } elseif ($this->InFooter) { + $pagemark = $this->footerpos[$this->page]; + } else { + $pagemark = $this->intmrk[$this->page]; + } + $pagebuff = $this->getPageBuffer($this->page); + $pstart = substr($pagebuff, 0, $pagemark); + $pend = substr($pagebuff, $pagemark); + $this->setPageBuffer($this->page, $pstart.$ccode.$pend); + $this->bordermrk[$this->page] += $offsetlen; + $this->cntmrk[$this->page] += $offsetlen; + } + } + } // end for each page + // restore page regions + $this->page_regions = $temp_page_regions; + if (isset($old_bgcolor)) { + // restore background color + $this->setFillColorArray($old_bgcolor); + } + // restore pointer position + $this->x = $prev_x; + $this->y = $prev_y; + $this->lasth = $prev_lasth; + } + + /** + * Set the default bullet to be used as LI bullet symbol + * @param string $symbol character or string to be used (legal values are: '' = automatic, '!' = auto bullet, '#' = auto numbering, 'disc', 'disc', 'circle', 'square', '1', 'decimal', 'decimal-leading-zero', 'i', 'lower-roman', 'I', 'upper-roman', 'a', 'lower-alpha', 'lower-latin', 'A', 'upper-alpha', 'upper-latin', 'lower-greek', 'img|type|width|height|image.ext') + * @public + * @since 4.0.028 (2008-09-26) + */ + public function setLIsymbol($symbol='!') { + // check for custom image symbol + if (substr($symbol, 0, 4) == 'img|') { + $this->lisymbol = $symbol; + return; + } + $symbol = strtolower($symbol); + $valid_symbols = array('!', '#', 'disc', 'circle', 'square', '1', 'decimal', 'decimal-leading-zero', 'i', 'lower-roman', 'I', 'upper-roman', 'a', 'lower-alpha', 'lower-latin', 'A', 'upper-alpha', 'upper-latin', 'lower-greek'); + if (in_array($symbol, $valid_symbols)) { + $this->lisymbol = $symbol; + } else { + $this->lisymbol = ''; + } + } + + /** + * Set the booklet mode for double-sided pages. + * @param boolean $booklet true set the booklet mode on, false otherwise. + * @param float $inner Inner page margin. + * @param float $outer Outer page margin. + * @public + * @since 4.2.000 (2008-10-29) + */ + public function setBooklet($booklet=true, $inner=-1, $outer=-1) { + $this->booklet = $booklet; + if ($inner >= 0) { + $this->lMargin = $inner; + } + if ($outer >= 0) { + $this->rMargin = $outer; + } + } + + /** + * Swap the left and right margins. + * @param boolean $reverse if true swap left and right margins. + * @protected + * @since 4.2.000 (2008-10-29) + */ + protected function swapMargins($reverse=true) { + if ($reverse) { + // swap left and right margins + $mtemp = $this->original_lMargin; + $this->original_lMargin = $this->original_rMargin; + $this->original_rMargin = $mtemp; + $deltam = $this->original_lMargin - $this->original_rMargin; + $this->lMargin += $deltam; + $this->rMargin -= $deltam; + } + } + + /** + * Set the vertical spaces for HTML tags. + * The array must have the following structure (example): + * $tagvs = array('h1' => array(0 => array('h' => '', 'n' => 2), 1 => array('h' => 1.3, 'n' => 1))); + * The first array level contains the tag names, + * the second level contains 0 for opening tags or 1 for closing tags, + * the third level contains the vertical space unit (h) and the number spaces to add (n). + * If the h parameter is not specified, default values are used. + * @param array $tagvs array of tags and relative vertical spaces. + * @public + * @since 4.2.001 (2008-10-30) + */ + public function setHtmlVSpace($tagvs) { + $this->tagvspaces = $tagvs; + } + + /** + * Set custom width for list indentation. + * @param float $width width of the indentation. Use negative value to disable it. + * @public + * @since 4.2.007 (2008-11-12) + */ + public function setListIndentWidth($width) { + return $this->customlistindent = floatval($width); + } + + /** + * Set the top/bottom cell sides to be open or closed when the cell cross the page. + * @param boolean $isopen if true keeps the top/bottom border open for the cell sides that cross the page. + * @public + * @since 4.2.010 (2008-11-14) + */ + public function setOpenCell($isopen) { + $this->opencell = $isopen; + } + + /** + * Set the color and font style for HTML links. + * @param array $color RGB array of colors + * @param string $fontstyle additional font styles to add + * @public + * @since 4.4.003 (2008-12-09) + */ + public function setHtmlLinksStyle($color=array(0,0,255), $fontstyle='U') { + $this->htmlLinkColorArray = $color; + $this->htmlLinkFontStyle = $fontstyle; + } + + /** + * Convert HTML string containing value and unit of measure to user's units or points. + * @param string $htmlval String containing values and unit. + * @param string $refsize Reference value in points. + * @param string $defaultunit Default unit (can be one of the following: %, em, ex, px, in, mm, pc, pt). + * @param boolean $points If true returns points, otherwise returns value in user's units. + * @return float value in user's unit or point if $points=true + * @public + * @since 4.4.004 (2008-12-10) + */ + public function getHTMLUnitToUnits($htmlval, $refsize=1, $defaultunit='px', $points=false) { + $supportedunits = array('%', 'em', 'ex', 'px', 'in', 'cm', 'mm', 'pc', 'pt'); + $retval = 0; + $value = 0; + $unit = 'px'; + if ($points) { + $k = 1; + } else { + $k = $this->k; + } + if (in_array($defaultunit, $supportedunits)) { + $unit = $defaultunit; + } + if (is_numeric($htmlval)) { + $value = floatval($htmlval); + } elseif (preg_match('/([0-9\.\-\+]+)/', $htmlval, $mnum)) { + $value = floatval($mnum[1]); + if (preg_match('/([a-z%]+)/', $htmlval, $munit)) { + if (in_array($munit[1], $supportedunits)) { + $unit = $munit[1]; + } + } + } + switch ($unit) { + // percentage + case '%': { + $retval = (($value * $refsize) / 100); + break; + } + // relative-size + case 'em': { + $retval = ($value * $refsize); + break; + } + // height of lower case 'x' (about half the font-size) + case 'ex': { + $retval = ($value * ($refsize / 2)); + break; + } + // absolute-size + case 'in': { + $retval = (($value * $this->dpi) / $k); + break; + } + // centimeters + case 'cm': { + $retval = (($value / 2.54 * $this->dpi) / $k); + break; + } + // millimeters + case 'mm': { + $retval = (($value / 25.4 * $this->dpi) / $k); + break; + } + // one pica is 12 points + case 'pc': { + $retval = (($value * 12) / $k); + break; + } + // points + case 'pt': { + $retval = ($value / $k); + break; + } + // pixels + case 'px': { + $retval = $this->pixelsToUnits($value); + if ($points) { + $retval *= $this->k; + } + break; + } + } + return $retval; + } + + /** + * Output an HTML list bullet or ordered item symbol + * @param int $listdepth list nesting level + * @param string $listtype type of list + * @param float $size current font size + * @protected + * @since 4.4.004 (2008-12-10) + */ + protected function putHtmlListBullet($listdepth, $listtype='', $size=10) { + if ($this->state != 2) { + return; + } + $size /= $this->k; + $fill = ''; + $bgcolor = $this->bgcolor; + $color = $this->fgcolor; + $strokecolor = $this->strokecolor; + $width = 0; + $textitem = ''; + $tmpx = $this->x; + $lspace = $this->GetStringWidth(' '); + if ($listtype == '^') { + // special symbol used for avoid justification of rect bullet + $this->lispacer = ''; + return; + } elseif ($listtype == '!') { + // set default list type for unordered list + $deftypes = array('disc', 'circle', 'square'); + $listtype = $deftypes[($listdepth - 1) % 3]; + } elseif ($listtype == '#') { + // set default list type for ordered list + $listtype = 'decimal'; + } elseif (substr($listtype, 0, 4) == 'img|') { + // custom image type ('img|type|width|height|image.ext') + $img = explode('|', $listtype); + $listtype = 'img'; + } + switch ($listtype) { + // unordered types + case 'none': { + break; + } + case 'disc': { + $r = $size / 6; + $lspace += (2 * $r); + if ($this->rtl) { + $this->x += $lspace; + } else { + $this->x -= $lspace; + } + $this->Circle(($this->x + $r), ($this->y + ($this->lasth / 2)), $r, 0, 360, 'F', array(), $color, 8); + break; + } + case 'circle': { + $r = $size / 6; + $lspace += (2 * $r); + if ($this->rtl) { + $this->x += $lspace; + } else { + $this->x -= $lspace; + } + $prev_line_style = $this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor; + $new_line_style = array('width' => ($r / 3), 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'phase' => 0, 'color'=>$color); + $this->Circle(($this->x + $r), ($this->y + ($this->lasth / 2)), ($r * (1 - (1/6))), 0, 360, 'D', $new_line_style, array(), 8); + $this->_out($prev_line_style); // restore line settings + break; + } + case 'square': { + $l = $size / 3; + $lspace += $l; + if ($this->rtl) {; + $this->x += $lspace; + } else { + $this->x -= $lspace; + } + $this->Rect($this->x, ($this->y + (($this->lasth - $l) / 2)), $l, $l, 'F', array(), $color); + break; + } + case 'img': { + // 1=>type, 2=>width, 3=>height, 4=>image.ext + $lspace += $img[2]; + if ($this->rtl) {; + $this->x += $lspace; + } else { + $this->x -= $lspace; + } + $imgtype = strtolower($img[1]); + $prev_y = $this->y; + switch ($imgtype) { + case 'svg': { + $this->ImageSVG($img[4], $this->x, ($this->y + (($this->lasth - $img[3]) / 2)), $img[2], $img[3], '', 'T', '', 0, false); + break; + } + case 'ai': + case 'eps': { + $this->ImageEps($img[4], $this->x, ($this->y + (($this->lasth - $img[3]) / 2)), $img[2], $img[3], '', true, 'T', '', 0, false); + break; + } + default: { + $this->Image($img[4], $this->x, ($this->y + (($this->lasth - $img[3]) / 2)), $img[2], $img[3], $img[1], '', 'T', false, 300, '', false, false, 0, false, false, false); + break; + } + } + $this->y = $prev_y; + break; + } + // ordered types + // $this->listcount[$this->listnum]; + // $textitem + case '1': + case 'decimal': { + $textitem = $this->listcount[$this->listnum]; + break; + } + case 'decimal-leading-zero': { + $textitem = sprintf('%02d', $this->listcount[$this->listnum]); + break; + } + case 'i': + case 'lower-roman': { + $textitem = strtolower(TCPDF_STATIC::intToRoman($this->listcount[$this->listnum])); + break; + } + case 'I': + case 'upper-roman': { + $textitem = TCPDF_STATIC::intToRoman($this->listcount[$this->listnum]); + break; + } + case 'a': + case 'lower-alpha': + case 'lower-latin': { + $textitem = chr(97 + $this->listcount[$this->listnum] - 1); + break; + } + case 'A': + case 'upper-alpha': + case 'upper-latin': { + $textitem = chr(65 + $this->listcount[$this->listnum] - 1); + break; + } + case 'lower-greek': { + $textitem = TCPDF_FONTS::unichr((945 + $this->listcount[$this->listnum] - 1), $this->isunicode); + break; + } + /* + // Types to be implemented (special handling) + case 'hebrew': { + break; + } + case 'armenian': { + break; + } + case 'georgian': { + break; + } + case 'cjk-ideographic': { + break; + } + case 'hiragana': { + break; + } + case 'katakana': { + break; + } + case 'hiragana-iroha': { + break; + } + case 'katakana-iroha': { + break; + } + */ + default: { + $textitem = $this->listcount[$this->listnum]; + } + } + if (!TCPDF_STATIC::empty_string($textitem)) { + // Check whether we need a new page or new column + $prev_y = $this->y; + $h = $this->getCellHeight($this->FontSize); + if ($this->checkPageBreak($h) OR ($this->y < $prev_y)) { + $tmpx = $this->x; + } + // print ordered item + if ($this->rtl) { + $textitem = '.'.$textitem; + } else { + $textitem = $textitem.'.'; + } + $lspace += $this->GetStringWidth($textitem); + if ($this->rtl) { + $this->x += $lspace; + } else { + $this->x -= $lspace; + } + $this->Write($this->lasth, $textitem, '', false, '', false, 0, false); + } + $this->x = $tmpx; + $this->lispacer = '^'; + // restore colors + $this->setFillColorArray($bgcolor); + $this->setDrawColorArray($strokecolor); + $this->settextColorArray($color); + } + + /** + * Returns current graphic variables as array. + * @return array of graphic variables + * @protected + * @since 4.2.010 (2008-11-14) + */ + protected function getGraphicVars() { + $grapvars = array( + 'FontFamily' => $this->FontFamily, + 'FontStyle' => $this->FontStyle, + 'FontSizePt' => $this->FontSizePt, + 'rMargin' => $this->rMargin, + 'lMargin' => $this->lMargin, + 'cell_padding' => $this->cell_padding, + 'cell_margin' => $this->cell_margin, + 'LineWidth' => $this->LineWidth, + 'linestyleWidth' => $this->linestyleWidth, + 'linestyleCap' => $this->linestyleCap, + 'linestyleJoin' => $this->linestyleJoin, + 'linestyleDash' => $this->linestyleDash, + 'textrendermode' => $this->textrendermode, + 'textstrokewidth' => $this->textstrokewidth, + 'DrawColor' => $this->DrawColor, + 'FillColor' => $this->FillColor, + 'TextColor' => $this->TextColor, + 'ColorFlag' => $this->ColorFlag, + 'bgcolor' => $this->bgcolor, + 'fgcolor' => $this->fgcolor, + 'htmlvspace' => $this->htmlvspace, + 'listindent' => $this->listindent, + 'listindentlevel' => $this->listindentlevel, + 'listnum' => $this->listnum, + 'listordered' => $this->listordered, + 'listcount' => $this->listcount, + 'lispacer' => $this->lispacer, + 'cell_height_ratio' => $this->cell_height_ratio, + 'font_stretching' => $this->font_stretching, + 'font_spacing' => $this->font_spacing, + 'alpha' => $this->alpha, + // extended + 'lasth' => $this->lasth, + 'tMargin' => $this->tMargin, + 'bMargin' => $this->bMargin, + 'AutoPageBreak' => $this->AutoPageBreak, + 'PageBreakTrigger' => $this->PageBreakTrigger, + 'x' => $this->x, + 'y' => $this->y, + 'w' => $this->w, + 'h' => $this->h, + 'wPt' => $this->wPt, + 'hPt' => $this->hPt, + 'fwPt' => $this->fwPt, + 'fhPt' => $this->fhPt, + 'page' => $this->page, + 'current_column' => $this->current_column, + 'num_columns' => $this->num_columns + ); + return $grapvars; + } + + /** + * Set graphic variables. + * @param array $gvars array of graphic variablesto restore + * @param boolean $extended if true restore extended graphic variables + * @protected + * @since 4.2.010 (2008-11-14) + */ + protected function setGraphicVars($gvars, $extended=false) { + if ($this->state != 2) { + return; + } + $this->FontFamily = $gvars['FontFamily']; + $this->FontStyle = $gvars['FontStyle']; + $this->FontSizePt = $gvars['FontSizePt']; + $this->rMargin = $gvars['rMargin']; + $this->lMargin = $gvars['lMargin']; + $this->cell_padding = $gvars['cell_padding']; + $this->cell_margin = $gvars['cell_margin']; + $this->LineWidth = $gvars['LineWidth']; + $this->linestyleWidth = $gvars['linestyleWidth']; + $this->linestyleCap = $gvars['linestyleCap']; + $this->linestyleJoin = $gvars['linestyleJoin']; + $this->linestyleDash = $gvars['linestyleDash']; + $this->textrendermode = $gvars['textrendermode']; + $this->textstrokewidth = $gvars['textstrokewidth']; + $this->DrawColor = $gvars['DrawColor']; + $this->FillColor = $gvars['FillColor']; + $this->TextColor = $gvars['TextColor']; + $this->ColorFlag = $gvars['ColorFlag']; + $this->bgcolor = $gvars['bgcolor']; + $this->fgcolor = $gvars['fgcolor']; + $this->htmlvspace = $gvars['htmlvspace']; + $this->listindent = $gvars['listindent']; + $this->listindentlevel = $gvars['listindentlevel']; + $this->listnum = $gvars['listnum']; + $this->listordered = $gvars['listordered']; + $this->listcount = $gvars['listcount']; + $this->lispacer = $gvars['lispacer']; + $this->cell_height_ratio = $gvars['cell_height_ratio']; + $this->font_stretching = $gvars['font_stretching']; + $this->font_spacing = $gvars['font_spacing']; + $this->alpha = $gvars['alpha']; + if ($extended) { + // restore extended values + $this->lasth = $gvars['lasth']; + $this->tMargin = $gvars['tMargin']; + $this->bMargin = $gvars['bMargin']; + $this->AutoPageBreak = $gvars['AutoPageBreak']; + $this->PageBreakTrigger = $gvars['PageBreakTrigger']; + $this->x = $gvars['x']; + $this->y = $gvars['y']; + $this->w = $gvars['w']; + $this->h = $gvars['h']; + $this->wPt = $gvars['wPt']; + $this->hPt = $gvars['hPt']; + $this->fwPt = $gvars['fwPt']; + $this->fhPt = $gvars['fhPt']; + $this->page = $gvars['page']; + $this->current_column = $gvars['current_column']; + $this->num_columns = $gvars['num_columns']; + } + $this->_out(''.$this->linestyleWidth.' '.$this->linestyleCap.' '.$this->linestyleJoin.' '.$this->linestyleDash.' '.$this->DrawColor.' '.$this->FillColor.''); + if (!TCPDF_STATIC::empty_string($this->FontFamily)) { + $this->setFont($this->FontFamily, $this->FontStyle, $this->FontSizePt); + } + } + + /** + * Outputs the "save graphics state" operator 'q' + * @protected + */ + protected function _outSaveGraphicsState() { + $this->_out('q'); + } + + /** + * Outputs the "restore graphics state" operator 'Q' + * @protected + */ + protected function _outRestoreGraphicsState() { + $this->_out('Q'); + } + + /** + * Set buffer content (always append data). + * @param string $data data + * @protected + * @since 4.5.000 (2009-01-02) + */ + protected function setBuffer($data) { + $this->bufferlen += strlen($data); + $this->buffer .= $data; + } + + /** + * Replace the buffer content + * @param string $data data + * @protected + * @since 5.5.000 (2010-06-22) + */ + protected function replaceBuffer($data) { + $this->bufferlen = strlen($data); + $this->buffer = $data; + } + + /** + * Get buffer content. + * @return string buffer content + * @protected + * @since 4.5.000 (2009-01-02) + */ + protected function getBuffer() { + return $this->buffer; + } + + /** + * Set page buffer content. + * @param int $page page number + * @param string $data page data + * @param boolean $append if true append data, false replace. + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected function setPageBuffer($page, $data, $append=false) { + if ($append) { + $this->pages[$page] .= $data; + } else { + $this->pages[$page] = $data; + } + if ($append AND isset($this->pagelen[$page])) { + $this->pagelen[$page] += strlen($data); + } else { + $this->pagelen[$page] = strlen($data); + } + } + + /** + * Get page buffer content. + * @param int $page page number + * @return string page buffer content or false in case of error + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected function getPageBuffer($page) { + if (isset($this->pages[$page])) { + return $this->pages[$page]; + } + return false; + } + + /** + * Set image buffer content. + * @param string $image image key + * @param array $data image data + * @return int image index number + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected function setImageBuffer($image, $data) { + if (($data['i'] = array_search($image, $this->imagekeys)) === FALSE) { + $this->imagekeys[$this->numimages] = $image; + $data['i'] = $this->numimages; + ++$this->numimages; + } + $this->images[$image] = $data; + return $data['i']; + } + + /** + * Set image buffer content for a specified sub-key. + * @param string $image image key + * @param string $key image sub-key + * @param array $data image data + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected function setImageSubBuffer($image, $key, $data) { + if (!isset($this->images[$image])) { + $this->setImageBuffer($image, array()); + } + $this->images[$image][$key] = $data; + } + + /** + * Get image buffer content. + * @param string $image image key + * @return string|false image buffer content or false in case of error + * @protected + * @since 4.5.000 (2008-12-31) + */ + protected function getImageBuffer($image) { + if (isset($this->images[$image])) { + return $this->images[$image]; + } + return false; + } + + /** + * Set font buffer content. + * @param string $font font key + * @param array $data font data + * @protected + * @since 4.5.000 (2009-01-02) + */ + protected function setFontBuffer($font, $data) { + $this->fonts[$font] = $data; + if (!in_array($font, $this->fontkeys)) { + $this->fontkeys[] = $font; + // store object ID for current font + ++$this->n; + $this->font_obj_ids[$font] = $this->n; + $this->setFontSubBuffer($font, 'n', $this->n); + } + } + + /** + * Set font buffer content. + * @param string $font font key + * @param string $key font sub-key + * @param mixed $data font data + * @protected + * @since 4.5.000 (2009-01-02) + */ + protected function setFontSubBuffer($font, $key, $data) { + if (!isset($this->fonts[$font])) { + $this->setFontBuffer($font, array()); + } + $this->fonts[$font][$key] = $data; + } + + /** + * Get font buffer content. + * @param string $font font key + * @return string|false font buffer content or false in case of error + * @protected + * @since 4.5.000 (2009-01-02) + */ + protected function getFontBuffer($font) { + if (isset($this->fonts[$font])) { + return $this->fonts[$font]; + } + return false; + } + + /** + * Move a page to a previous position. + * @param int $frompage number of the source page + * @param int $topage number of the destination page (must be less than $frompage) + * @return bool true in case of success, false in case of error. + * @public + * @since 4.5.000 (2009-01-02) + */ + public function movePage($frompage, $topage) { + if (($frompage > $this->numpages) OR ($frompage <= $topage)) { + return false; + } + if ($frompage == $this->page) { + // close the page before moving it + $this->endPage(); + } + // move all page-related states + $tmppage = $this->getPageBuffer($frompage); + $tmppagedim = $this->pagedim[$frompage]; + $tmppagelen = $this->pagelen[$frompage]; + $tmpintmrk = $this->intmrk[$frompage]; + $tmpbordermrk = $this->bordermrk[$frompage]; + $tmpcntmrk = $this->cntmrk[$frompage]; + $tmppageobjects = $this->pageobjects[$frompage]; + if (isset($this->footerpos[$frompage])) { + $tmpfooterpos = $this->footerpos[$frompage]; + } + if (isset($this->footerlen[$frompage])) { + $tmpfooterlen = $this->footerlen[$frompage]; + } + if (isset($this->transfmrk[$frompage])) { + $tmptransfmrk = $this->transfmrk[$frompage]; + } + if (isset($this->PageAnnots[$frompage])) { + $tmpannots = $this->PageAnnots[$frompage]; + } + if (isset($this->newpagegroup) AND !empty($this->newpagegroup)) { + for ($i = $frompage; $i > $topage; --$i) { + if (isset($this->newpagegroup[$i]) AND (($i + $this->pagegroups[$this->newpagegroup[$i]]) > $frompage)) { + --$this->pagegroups[$this->newpagegroup[$i]]; + break; + } + } + for ($i = $topage; $i > 0; --$i) { + if (isset($this->newpagegroup[$i]) AND (($i + $this->pagegroups[$this->newpagegroup[$i]]) > $topage)) { + ++$this->pagegroups[$this->newpagegroup[$i]]; + break; + } + } + } + for ($i = $frompage; $i > $topage; --$i) { + $j = $i - 1; + // shift pages down + $this->setPageBuffer($i, $this->getPageBuffer($j)); + $this->pagedim[$i] = $this->pagedim[$j]; + $this->pagelen[$i] = $this->pagelen[$j]; + $this->intmrk[$i] = $this->intmrk[$j]; + $this->bordermrk[$i] = $this->bordermrk[$j]; + $this->cntmrk[$i] = $this->cntmrk[$j]; + $this->pageobjects[$i] = $this->pageobjects[$j]; + if (isset($this->footerpos[$j])) { + $this->footerpos[$i] = $this->footerpos[$j]; + } elseif (isset($this->footerpos[$i])) { + unset($this->footerpos[$i]); + } + if (isset($this->footerlen[$j])) { + $this->footerlen[$i] = $this->footerlen[$j]; + } elseif (isset($this->footerlen[$i])) { + unset($this->footerlen[$i]); + } + if (isset($this->transfmrk[$j])) { + $this->transfmrk[$i] = $this->transfmrk[$j]; + } elseif (isset($this->transfmrk[$i])) { + unset($this->transfmrk[$i]); + } + if (isset($this->PageAnnots[$j])) { + $this->PageAnnots[$i] = $this->PageAnnots[$j]; + } elseif (isset($this->PageAnnots[$i])) { + unset($this->PageAnnots[$i]); + } + if (isset($this->newpagegroup[$j])) { + $this->newpagegroup[$i] = $this->newpagegroup[$j]; + unset($this->newpagegroup[$j]); + } + if ($this->currpagegroup == $j) { + $this->currpagegroup = $i; + } + } + $this->setPageBuffer($topage, $tmppage); + $this->pagedim[$topage] = $tmppagedim; + $this->pagelen[$topage] = $tmppagelen; + $this->intmrk[$topage] = $tmpintmrk; + $this->bordermrk[$topage] = $tmpbordermrk; + $this->cntmrk[$topage] = $tmpcntmrk; + $this->pageobjects[$topage] = $tmppageobjects; + if (isset($tmpfooterpos)) { + $this->footerpos[$topage] = $tmpfooterpos; + } elseif (isset($this->footerpos[$topage])) { + unset($this->footerpos[$topage]); + } + if (isset($tmpfooterlen)) { + $this->footerlen[$topage] = $tmpfooterlen; + } elseif (isset($this->footerlen[$topage])) { + unset($this->footerlen[$topage]); + } + if (isset($tmptransfmrk)) { + $this->transfmrk[$topage] = $tmptransfmrk; + } elseif (isset($this->transfmrk[$topage])) { + unset($this->transfmrk[$topage]); + } + if (isset($tmpannots)) { + $this->PageAnnots[$topage] = $tmpannots; + } elseif (isset($this->PageAnnots[$topage])) { + unset($this->PageAnnots[$topage]); + } + // adjust outlines + $tmpoutlines = $this->outlines; + foreach ($tmpoutlines as $key => $outline) { + if (!$outline['f']) { + if (($outline['p'] >= $topage) AND ($outline['p'] < $frompage)) { + $this->outlines[$key]['p'] = ($outline['p'] + 1); + } elseif ($outline['p'] == $frompage) { + $this->outlines[$key]['p'] = $topage; + } + } + } + // adjust dests + $tmpdests = $this->dests; + foreach ($tmpdests as $key => $dest) { + if (!$dest['f']) { + if (($dest['p'] >= $topage) AND ($dest['p'] < $frompage)) { + $this->dests[$key]['p'] = ($dest['p'] + 1); + } elseif ($dest['p'] == $frompage) { + $this->dests[$key]['p'] = $topage; + } + } + } + // adjust links + $tmplinks = $this->links; + foreach ($tmplinks as $key => $link) { + if (!$link['f']) { + if (($link['p'] >= $topage) AND ($link['p'] < $frompage)) { + $this->links[$key]['p'] = ($link['p'] + 1); + } elseif ($link['p'] == $frompage) { + $this->links[$key]['p'] = $topage; + } + } + } + // adjust javascript + $jfrompage = $frompage; + $jtopage = $topage; + if (preg_match_all('/this\.addField\(\'([^\']*)\',\'([^\']*)\',([0-9]+)/', $this->javascript, $pamatch) > 0) { + foreach($pamatch[0] as $pk => $pmatch) { + $pagenum = intval($pamatch[3][$pk]) + 1; + if (($pagenum >= $jtopage) AND ($pagenum < $jfrompage)) { + $newpage = ($pagenum + 1); + } elseif ($pagenum == $jfrompage) { + $newpage = $jtopage; + } else { + $newpage = $pagenum; + } + --$newpage; + $newjs = "this.addField(\'".$pamatch[1][$pk]."\',\'".$pamatch[2][$pk]."\',".$newpage; + $this->javascript = str_replace($pmatch, $newjs, $this->javascript); + } + unset($pamatch); + } + // return to last page + $this->lastPage(true); + return true; + } + + /** + * Remove the specified page. + * @param int $page page to remove + * @return bool true in case of success, false in case of error. + * @public + * @since 4.6.004 (2009-04-23) + */ + public function deletePage($page) { + if (($page < 1) OR ($page > $this->numpages)) { + return false; + } + // delete current page + unset($this->pages[$page]); + unset($this->pagedim[$page]); + unset($this->pagelen[$page]); + unset($this->intmrk[$page]); + unset($this->bordermrk[$page]); + unset($this->cntmrk[$page]); + foreach ($this->pageobjects[$page] as $oid) { + if (isset($this->offsets[$oid])){ + unset($this->offsets[$oid]); + } + } + unset($this->pageobjects[$page]); + if (isset($this->footerpos[$page])) { + unset($this->footerpos[$page]); + } + if (isset($this->footerlen[$page])) { + unset($this->footerlen[$page]); + } + if (isset($this->transfmrk[$page])) { + unset($this->transfmrk[$page]); + } + if (isset($this->PageAnnots[$page])) { + unset($this->PageAnnots[$page]); + } + if (isset($this->newpagegroup) AND !empty($this->newpagegroup)) { + for ($i = $page; $i > 0; --$i) { + if (isset($this->newpagegroup[$i]) AND (($i + $this->pagegroups[$this->newpagegroup[$i]]) > $page)) { + --$this->pagegroups[$this->newpagegroup[$i]]; + break; + } + } + } + if (isset($this->pageopen[$page])) { + unset($this->pageopen[$page]); + } + if ($page < $this->numpages) { + // update remaining pages + for ($i = $page; $i < $this->numpages; ++$i) { + $j = $i + 1; + // shift pages + $this->setPageBuffer($i, $this->getPageBuffer($j)); + $this->pagedim[$i] = $this->pagedim[$j]; + $this->pagelen[$i] = $this->pagelen[$j]; + $this->intmrk[$i] = $this->intmrk[$j]; + $this->bordermrk[$i] = $this->bordermrk[$j]; + $this->cntmrk[$i] = $this->cntmrk[$j]; + $this->pageobjects[$i] = $this->pageobjects[$j]; + if (isset($this->footerpos[$j])) { + $this->footerpos[$i] = $this->footerpos[$j]; + } elseif (isset($this->footerpos[$i])) { + unset($this->footerpos[$i]); + } + if (isset($this->footerlen[$j])) { + $this->footerlen[$i] = $this->footerlen[$j]; + } elseif (isset($this->footerlen[$i])) { + unset($this->footerlen[$i]); + } + if (isset($this->transfmrk[$j])) { + $this->transfmrk[$i] = $this->transfmrk[$j]; + } elseif (isset($this->transfmrk[$i])) { + unset($this->transfmrk[$i]); + } + if (isset($this->PageAnnots[$j])) { + $this->PageAnnots[$i] = $this->PageAnnots[$j]; + } elseif (isset($this->PageAnnots[$i])) { + unset($this->PageAnnots[$i]); + } + if (isset($this->newpagegroup[$j])) { + $this->newpagegroup[$i] = $this->newpagegroup[$j]; + unset($this->newpagegroup[$j]); + } + if ($this->currpagegroup == $j) { + $this->currpagegroup = $i; + } + if (isset($this->pageopen[$j])) { + $this->pageopen[$i] = $this->pageopen[$j]; + } elseif (isset($this->pageopen[$i])) { + unset($this->pageopen[$i]); + } + } + // remove last page + unset($this->pages[$this->numpages]); + unset($this->pagedim[$this->numpages]); + unset($this->pagelen[$this->numpages]); + unset($this->intmrk[$this->numpages]); + unset($this->bordermrk[$this->numpages]); + unset($this->cntmrk[$this->numpages]); + foreach ($this->pageobjects[$this->numpages] as $oid) { + if (isset($this->offsets[$oid])){ + unset($this->offsets[$oid]); + } + } + unset($this->pageobjects[$this->numpages]); + if (isset($this->footerpos[$this->numpages])) { + unset($this->footerpos[$this->numpages]); + } + if (isset($this->footerlen[$this->numpages])) { + unset($this->footerlen[$this->numpages]); + } + if (isset($this->transfmrk[$this->numpages])) { + unset($this->transfmrk[$this->numpages]); + } + if (isset($this->PageAnnots[$this->numpages])) { + unset($this->PageAnnots[$this->numpages]); + } + if (isset($this->newpagegroup[$this->numpages])) { + unset($this->newpagegroup[$this->numpages]); + } + if ($this->currpagegroup == $this->numpages) { + $this->currpagegroup = ($this->numpages - 1); + } + if (isset($this->pagegroups[$this->numpages])) { + unset($this->pagegroups[$this->numpages]); + } + if (isset($this->pageopen[$this->numpages])) { + unset($this->pageopen[$this->numpages]); + } + } + --$this->numpages; + $this->page = $this->numpages; + // adjust outlines + $tmpoutlines = $this->outlines; + foreach ($tmpoutlines as $key => $outline) { + if (!$outline['f']) { + if ($outline['p'] > $page) { + $this->outlines[$key]['p'] = $outline['p'] - 1; + } elseif ($outline['p'] == $page) { + unset($this->outlines[$key]); + } + } + } + // adjust dests + $tmpdests = $this->dests; + foreach ($tmpdests as $key => $dest) { + if (!$dest['f']) { + if ($dest['p'] > $page) { + $this->dests[$key]['p'] = $dest['p'] - 1; + } elseif ($dest['p'] == $page) { + unset($this->dests[$key]); + } + } + } + // adjust links + $tmplinks = $this->links; + foreach ($tmplinks as $key => $link) { + if (!$link['f']) { + if ($link['p'] > $page) { + $this->links[$key]['p'] = $link['p'] - 1; + } elseif ($link['p'] == $page) { + unset($this->links[$key]); + } + } + } + // adjust javascript + $jpage = $page; + if (preg_match_all('/this\.addField\(\'([^\']*)\',\'([^\']*)\',([0-9]+)/', $this->javascript, $pamatch) > 0) { + foreach($pamatch[0] as $pk => $pmatch) { + $pagenum = intval($pamatch[3][$pk]) + 1; + if ($pagenum >= $jpage) { + $newpage = ($pagenum - 1); + } elseif ($pagenum == $jpage) { + $newpage = 1; + } else { + $newpage = $pagenum; + } + --$newpage; + $newjs = "this.addField(\'".$pamatch[1][$pk]."\',\'".$pamatch[2][$pk]."\',".$newpage; + $this->javascript = str_replace($pmatch, $newjs, $this->javascript); + } + unset($pamatch); + } + // return to last page + if ($this->numpages > 0) { + $this->lastPage(true); + } + return true; + } + + /** + * Clone the specified page to a new page. + * @param int $page number of page to copy (0 = current page) + * @return bool true in case of success, false in case of error. + * @public + * @since 4.9.015 (2010-04-20) + */ + public function copyPage($page=0) { + if ($page == 0) { + // default value + $page = $this->page; + } + if (($page < 1) OR ($page > $this->numpages)) { + return false; + } + // close the last page + $this->endPage(); + // copy all page-related states + ++$this->numpages; + $this->page = $this->numpages; + $this->setPageBuffer($this->page, $this->getPageBuffer($page)); + $this->pagedim[$this->page] = $this->pagedim[$page]; + $this->pagelen[$this->page] = $this->pagelen[$page]; + $this->intmrk[$this->page] = $this->intmrk[$page]; + $this->bordermrk[$this->page] = $this->bordermrk[$page]; + $this->cntmrk[$this->page] = $this->cntmrk[$page]; + $this->pageobjects[$this->page] = $this->pageobjects[$page]; + $this->pageopen[$this->page] = false; + if (isset($this->footerpos[$page])) { + $this->footerpos[$this->page] = $this->footerpos[$page]; + } + if (isset($this->footerlen[$page])) { + $this->footerlen[$this->page] = $this->footerlen[$page]; + } + if (isset($this->transfmrk[$page])) { + $this->transfmrk[$this->page] = $this->transfmrk[$page]; + } + if (isset($this->PageAnnots[$page])) { + $this->PageAnnots[$this->page] = $this->PageAnnots[$page]; + } + if (isset($this->newpagegroup[$page])) { + // start a new group + $this->newpagegroup[$this->page] = sizeof($this->newpagegroup) + 1; + $this->currpagegroup = $this->newpagegroup[$this->page]; + $this->pagegroups[$this->currpagegroup] = 1; + } elseif (isset($this->currpagegroup) AND ($this->currpagegroup > 0)) { + ++$this->pagegroups[$this->currpagegroup]; + } + // copy outlines + $tmpoutlines = $this->outlines; + foreach ($tmpoutlines as $key => $outline) { + if ($outline['p'] == $page) { + $this->outlines[] = array('t' => $outline['t'], 'l' => $outline['l'], 'x' => $outline['x'], 'y' => $outline['y'], 'p' => $this->page, 'f' => $outline['f'], 's' => $outline['s'], 'c' => $outline['c']); + } + } + // copy links + $tmplinks = $this->links; + foreach ($tmplinks as $key => $link) { + if ($link['p'] == $page) { + $this->links[] = array('p' => $this->page, 'y' => $link['y'], 'f' => $link['f']); + } + } + // return to last page + $this->lastPage(true); + return true; + } + + /** + * Output a Table of Content Index (TOC). + * This method must be called after all Bookmarks were set. + * Before calling this method you have to open the page using the addTOCPage() method. + * After calling this method you have to call endTOCPage() to close the TOC page. + * You can override this method to achieve different styles. + * @param int|null $page page number where this TOC should be inserted (leave empty for current page). + * @param string $numbersfont set the font for page numbers (please use monospaced font for better alignment). + * @param string $filler string used to fill the space between text and page number. + * @param string $toc_name name to use for TOC bookmark. + * @param string $style Font style for title: B = Bold, I = Italic, BI = Bold + Italic. + * @param array $color RGB color array for bookmark title (values from 0 to 255). + * @public + * @author Nicola Asuni + * @since 4.5.000 (2009-01-02) + * @see addTOCPage(), endTOCPage(), addHTMLTOC() + */ + public function addTOC($page=null, $numbersfont='', $filler='.', $toc_name='TOC', $style='', $color=array(0,0,0)) { + $fontsize = $this->FontSizePt; + $fontfamily = $this->FontFamily; + $fontstyle = $this->FontStyle; + $w = $this->w - $this->lMargin - $this->rMargin; + $spacer = $this->GetStringWidth(chr(32)) * 4; + $lmargin = $this->lMargin; + $rmargin = $this->rMargin; + $x_start = $this->GetX(); + $page_first = $this->page; + $current_page = $this->page; + $page_fill_start = false; + $page_fill_end = false; + $current_column = $this->current_column; + if (TCPDF_STATIC::empty_string($numbersfont)) { + $numbersfont = $this->default_monospaced_font; + } + if (TCPDF_STATIC::empty_string($filler)) { + $filler = ' '; + } + if (TCPDF_STATIC::empty_string($page)) { + $gap = ' '; + } else { + $gap = ''; + if ($page < 1) { + $page = 1; + } + } + $this->setFont($numbersfont, $fontstyle, $fontsize); + $numwidth = $this->GetStringWidth('00000'); + $maxpage = 0; //used for pages on attached documents + foreach ($this->outlines as $key => $outline) { + // check for extra pages (used for attachments) + if (($this->page > $page_first) AND ($outline['p'] >= $this->numpages)) { + $outline['p'] += ($this->page - $page_first); + } + if ($this->rtl) { + $aligntext = 'R'; + $alignnum = 'L'; + } else { + $aligntext = 'L'; + $alignnum = 'R'; + } + if ($outline['l'] == 0) { + $this->setFont($fontfamily, $outline['s'].'B', $fontsize); + } else { + $this->setFont($fontfamily, $outline['s'], $fontsize - $outline['l']); + } + $this->setTextColorArray($outline['c']); + // check for page break + $this->checkPageBreak(2 * $this->getCellHeight($this->FontSize)); + // set margins and X position + if (($this->page == $current_page) AND ($this->current_column == $current_column)) { + $this->lMargin = $lmargin; + $this->rMargin = $rmargin; + } else { + if ($this->current_column != $current_column) { + if ($this->rtl) { + $x_start = $this->w - $this->columns[$this->current_column]['x']; + } else { + $x_start = $this->columns[$this->current_column]['x']; + } + } + $lmargin = $this->lMargin; + $rmargin = $this->rMargin; + $current_page = $this->page; + $current_column = $this->current_column; + } + $this->setX($x_start); + $indent = ($spacer * $outline['l']); + if ($this->rtl) { + $this->x -= $indent; + $this->rMargin = $this->w - $this->x; + } else { + $this->x += $indent; + $this->lMargin = $this->x; + } + $link = $this->AddLink(); + $this->setLink($link, $outline['y'], $outline['p']); + // write the text + if ($this->rtl) { + $txt = ' '.$outline['t']; + } else { + $txt = $outline['t'].' '; + } + $this->Write(0, $txt, $link, false, $aligntext, false, 0, false, false, 0, $numwidth, ''); + if ($this->rtl) { + $tw = $this->x - $this->lMargin; + } else { + $tw = $this->w - $this->rMargin - $this->x; + } + $this->setFont($numbersfont, $fontstyle, $fontsize); + if (TCPDF_STATIC::empty_string($page)) { + $pagenum = $outline['p']; + } else { + // placemark to be replaced with the correct number + $pagenum = '{#'.($outline['p']).'}'; + if ($this->isUnicodeFont()) { + $pagenum = '{'.$pagenum.'}'; + } + $maxpage = max($maxpage, $outline['p']); + } + $fw = ($tw - $this->GetStringWidth($pagenum.$filler)); + $wfiller = $this->GetStringWidth($filler); + if ($wfiller > 0) { + $numfills = floor($fw / $wfiller); + } else { + $numfills = 0; + } + if ($numfills > 0) { + $rowfill = str_repeat($filler, $numfills); + } else { + $rowfill = ''; + } + if ($this->rtl) { + $pagenum = $pagenum.$gap.$rowfill; + } else { + $pagenum = $rowfill.$gap.$pagenum; + } + // write the number + $this->Cell($tw, 0, $pagenum, 0, 1, $alignnum, 0, $link, 0); + } + $page_last = $this->getPage(); + $numpages = ($page_last - $page_first + 1); + // account for booklet mode + if ($this->booklet) { + // check if a blank page is required before TOC + $page_fill_start = ((($page_first % 2) == 0) XOR (($page % 2) == 0)); + $page_fill_end = (!((($numpages % 2) == 0) XOR ($page_fill_start))); + if ($page_fill_start) { + // add a page at the end (to be moved before TOC) + $this->addPage(); + ++$page_last; + ++$numpages; + } + if ($page_fill_end) { + // add a page at the end + $this->addPage(); + ++$page_last; + ++$numpages; + } + } + $maxpage = max($maxpage, $page_last); + if (!TCPDF_STATIC::empty_string($page)) { + for ($p = $page_first; $p <= $page_last; ++$p) { + // get page data + $temppage = $this->getPageBuffer($p); + for ($n = 1; $n <= $maxpage; ++$n) { + // update page numbers + $a = '{#'.$n.'}'; + // get page number aliases + $pnalias = $this->getInternalPageNumberAliases($a); + // calculate replacement number + if (($n >= $page) AND ($n <= $this->numpages)) { + $np = $n + $numpages; + } else { + $np = $n; + } + $na = TCPDF_STATIC::formatTOCPageNumber(($this->starting_page_number + $np - 1)); + $nu = TCPDF_FONTS::UTF8ToUTF16BE($na, false, $this->isunicode, $this->CurrentFont); + // replace aliases with numbers + foreach ($pnalias['u'] as $u) { + $sfill = str_repeat($filler, max(0, (strlen($u) - strlen($nu.' ')))); + if ($this->rtl) { + $nr = $nu.TCPDF_FONTS::UTF8ToUTF16BE(' '.$sfill, false, $this->isunicode, $this->CurrentFont); + } else { + $nr = TCPDF_FONTS::UTF8ToUTF16BE($sfill.' ', false, $this->isunicode, $this->CurrentFont).$nu; + } + $temppage = str_replace($u, $nr, $temppage); + } + foreach ($pnalias['a'] as $a) { + $sfill = str_repeat($filler, max(0, (strlen($a) - strlen($na.' ')))); + if ($this->rtl) { + $nr = $na.' '.$sfill; + } else { + $nr = $sfill.' '.$na; + } + $temppage = str_replace($a, $nr, $temppage); + } + } + // save changes + $this->setPageBuffer($p, $temppage); + } + // move pages + $this->Bookmark($toc_name, 0, 0, $page_first, $style, $color); + if ($page_fill_start) { + $this->movePage($page_last, $page_first); + } + for ($i = 0; $i < $numpages; ++$i) { + $this->movePage($page_last, $page); + } + } + } + + /** + * Output a Table Of Content Index (TOC) using HTML templates. + * This method must be called after all Bookmarks were set. + * Before calling this method you have to open the page using the addTOCPage() method. + * After calling this method you have to call endTOCPage() to close the TOC page. + * @param int|null $page page number where this TOC should be inserted (leave empty for current page). + * @param string $toc_name name to use for TOC bookmark. + * @param array $templates array of html templates. Use: "#TOC_DESCRIPTION#" for bookmark title, "#TOC_PAGE_NUMBER#" for page number. + * @param boolean $correct_align if true correct the number alignment (numbers must be in monospaced font like courier and right aligned on LTR, or left aligned on RTL) + * @param string $style Font style for title: B = Bold, I = Italic, BI = Bold + Italic. + * @param array $color RGB color array for title (values from 0 to 255). + * @public + * @author Nicola Asuni + * @since 5.0.001 (2010-05-06) + * @see addTOCPage(), endTOCPage(), addTOC() + */ + public function addHTMLTOC($page=null, $toc_name='TOC', $templates=array(), $correct_align=true, $style='', $color=array(0,0,0)) { + $filler = ' '; + $prev_htmlLinkColorArray = $this->htmlLinkColorArray; + $prev_htmlLinkFontStyle = $this->htmlLinkFontStyle; + // set new style for link + $this->htmlLinkColorArray = array(); + $this->htmlLinkFontStyle = ''; + $page_first = $this->getPage(); + $page_fill_start = false; + $page_fill_end = false; + // get the font type used for numbers in each template + $current_font = $this->FontFamily; + foreach ($templates as $level => $html) { + $dom = $this->getHtmlDomArray($html); + foreach ($dom as $key => $value) { + if ($value['value'] == '#TOC_PAGE_NUMBER#') { + $this->setFont($dom[($key - 1)]['fontname']); + $templates['F'.$level] = $this->isUnicodeFont(); + } + } + } + $this->setFont($current_font); + $maxpage = 0; //used for pages on attached documents + foreach ($this->outlines as $key => $outline) { + // get HTML template + $row = $templates[$outline['l']]; + if (TCPDF_STATIC::empty_string($page)) { + $pagenum = $outline['p']; + } else { + // placemark to be replaced with the correct number + $pagenum = '{#'.($outline['p']).'}'; + if (isset($templates['F'.$outline['l']]) && $templates['F'.$outline['l']]) { + $pagenum = '{'.$pagenum.'}'; + } + $maxpage = max($maxpage, $outline['p']); + } + // replace templates with current values + $row = str_replace('#TOC_DESCRIPTION#', $outline['t'], $row); + $row = str_replace('#TOC_PAGE_NUMBER#', $pagenum, $row); + // add link to page + $row = ''.$row.''; + // write bookmark entry + $this->writeHTML($row, false, false, true, false, ''); + } + // restore link styles + $this->htmlLinkColorArray = $prev_htmlLinkColorArray; + $this->htmlLinkFontStyle = $prev_htmlLinkFontStyle; + // move TOC page and replace numbers + $page_last = $this->getPage(); + $numpages = ($page_last - $page_first + 1); + // account for booklet mode + if ($this->booklet) { + // check if a blank page is required before TOC + $page_fill_start = ((($page_first % 2) == 0) XOR (($page % 2) == 0)); + $page_fill_end = (!((($numpages % 2) == 0) XOR ($page_fill_start))); + if ($page_fill_start) { + // add a page at the end (to be moved before TOC) + $this->addPage(); + ++$page_last; + ++$numpages; + } + if ($page_fill_end) { + // add a page at the end + $this->addPage(); + ++$page_last; + ++$numpages; + } + } + $maxpage = max($maxpage, $page_last); + if (!TCPDF_STATIC::empty_string($page)) { + for ($p = $page_first; $p <= $page_last; ++$p) { + // get page data + $temppage = $this->getPageBuffer($p); + for ($n = 1; $n <= $maxpage; ++$n) { + // update page numbers + $a = '{#'.$n.'}'; + // get page number aliases + $pnalias = $this->getInternalPageNumberAliases($a); + // calculate replacement number + if ($n >= $page) { + $np = $n + $numpages; + } else { + $np = $n; + } + $na = TCPDF_STATIC::formatTOCPageNumber(($this->starting_page_number + $np - 1)); + $nu = TCPDF_FONTS::UTF8ToUTF16BE($na, false, $this->isunicode, $this->CurrentFont); + // replace aliases with numbers + foreach ($pnalias['u'] as $u) { + if ($correct_align) { + $sfill = str_repeat($filler, (strlen($u) - strlen($nu.' '))); + if ($this->rtl) { + $nr = $nu.TCPDF_FONTS::UTF8ToUTF16BE(' '.$sfill, false, $this->isunicode, $this->CurrentFont); + } else { + $nr = TCPDF_FONTS::UTF8ToUTF16BE($sfill.' ', false, $this->isunicode, $this->CurrentFont).$nu; + } + } else { + $nr = $nu; + } + $temppage = str_replace($u, $nr, $temppage); + } + foreach ($pnalias['a'] as $a) { + if ($correct_align) { + $sfill = str_repeat($filler, (strlen($a) - strlen($na.' '))); + if ($this->rtl) { + $nr = $na.' '.$sfill; + } else { + $nr = $sfill.' '.$na; + } + } else { + $nr = $na; + } + $temppage = str_replace($a, $nr, $temppage); + } + } + // save changes + $this->setPageBuffer($p, $temppage); + } + // move pages + $this->Bookmark($toc_name, 0, 0, $page_first, $style, $color); + if ($page_fill_start) { + $this->movePage($page_last, $page_first); + } + for ($i = 0; $i < $numpages; ++$i) { + $this->movePage($page_last, $page); + } + } + } + + /** + * Stores a copy of the current TCPDF object used for undo operation. + * @public + * @since 4.5.029 (2009-03-19) + */ + public function startTransaction() { + if (isset($this->objcopy)) { + // remove previous copy + $this->commitTransaction(); + } + // record current page number and Y position + $this->start_transaction_page = $this->page; + $this->start_transaction_y = $this->y; + // clone current object + $this->objcopy = TCPDF_STATIC::objclone($this); + } + + /** + * Delete the copy of the current TCPDF object used for undo operation. + * @public + * @since 4.5.029 (2009-03-19) + */ + public function commitTransaction() { + if (isset($this->objcopy)) { + $this->objcopy->_destroy(true, true); + /* The unique file_id should not be used during cleanup again */ + $this->objcopy->file_id = NULL; + unset($this->objcopy); + } + } + + /** + * This method allows to undo the latest transaction by returning the latest saved TCPDF object with startTransaction(). + * @param boolean $self if true restores current class object to previous state without the need of reassignment via the returned value. + * @return TCPDF object. + * @public + * @since 4.5.029 (2009-03-19) + */ + public function rollbackTransaction($self=false) { + if (isset($this->objcopy)) { + $objcopy = $this->objcopy; + $this->_destroy(true, true); + if ($self) { + $objvars = get_object_vars($objcopy); + foreach ($objvars as $key => $value) { + $this->$key = $value; + } + $objcopy->_destroy(true, true); + /* The unique file_id should not be used during cleanup again */ + $objcopy->file_id = NULL; + unset($objcopy); + return $this; + } + /* The unique file_id should not be used during cleanup again */ + $this->file_id = NULL; + return $objcopy; + } + return $this; + } + + // --- MULTI COLUMNS METHODS ----------------------- + + /** + * Set multiple columns of the same size + * @param int $numcols number of columns (set to zero to disable columns mode) + * @param int $width column width + * @param int|null $y column starting Y position (leave empty for current Y position) + * @public + * @since 4.9.001 (2010-03-28) + */ + public function setEqualColumns($numcols=0, $width=0, $y=null) { + $this->columns = array(); + if ($numcols < 2) { + $numcols = 0; + $this->columns = array(); + } else { + // maximum column width + $maxwidth = ($this->w - $this->original_lMargin - $this->original_rMargin) / $numcols; + if (($width == 0) OR ($width > $maxwidth)) { + $width = $maxwidth; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // space between columns + $space = (($this->w - $this->original_lMargin - $this->original_rMargin - ($numcols * $width)) / ($numcols - 1)); + // fill the columns array (with, space, starting Y position) + for ($i = 0; $i < $numcols; ++$i) { + $this->columns[$i] = array('w' => $width, 's' => $space, 'y' => $y); + } + } + $this->num_columns = $numcols; + $this->current_column = 0; + $this->column_start_page = $this->page; + $this->selectColumn(0); + } + + /** + * Remove columns and reset page margins. + * @public + * @since 5.9.072 (2011-04-26) + */ + public function resetColumns() { + $this->lMargin = $this->original_lMargin; + $this->rMargin = $this->original_rMargin; + $this->setEqualColumns(); + } + + /** + * Set columns array. + * Each column is represented by an array of arrays with the following keys: (w = width, s = space between columns, y = column top position). + * @param array $columns + * @public + * @since 4.9.001 (2010-03-28) + */ + public function setColumnsArray($columns) { + $this->columns = $columns; + $this->num_columns = count($columns); + $this->current_column = 0; + $this->column_start_page = $this->page; + $this->selectColumn(0); + } + + /** + * Set position at a given column + * @param int|null $col column number (from 0 to getNumberOfColumns()-1); empty string = current column. + * @public + * @since 4.9.001 (2010-03-28) + */ + public function selectColumn($col=null) { + if (TCPDF_STATIC::empty_string($col)) { + $col = $this->current_column; + } elseif ($col >= $this->num_columns) { + $col = 0; + } + $xshift = array('x' => 0, 's' => array('H' => 0, 'V' => 0), 'p' => array('L' => 0, 'T' => 0, 'R' => 0, 'B' => 0)); + $enable_thead = false; + if ($this->num_columns > 1) { + if ($col != $this->current_column) { + // move Y pointer at the top of the column + if ($this->column_start_page == $this->page) { + $this->y = $this->columns[$col]['y']; + } else { + $this->y = $this->tMargin; + } + // Avoid to write table headers more than once + if (($this->page > $this->maxselcol['page']) OR (($this->page == $this->maxselcol['page']) AND ($col > $this->maxselcol['column']))) { + $enable_thead = true; + $this->maxselcol['page'] = $this->page; + $this->maxselcol['column'] = $col; + } + } + $xshift = $this->colxshift; + // set X position of the current column by case + $listindent = ($this->listindentlevel * $this->listindent); + // calculate column X position + $colpos = 0; + for ($i = 0; $i < $col; ++$i) { + $colpos += ($this->columns[$i]['w'] + $this->columns[$i]['s']); + } + if ($this->rtl) { + $x = $this->w - $this->original_rMargin - $colpos; + $this->rMargin = ($this->w - $x + $listindent); + $this->lMargin = ($x - $this->columns[$col]['w']); + $this->x = $x - $listindent; + } else { + $x = $this->original_lMargin + $colpos; + $this->lMargin = ($x + $listindent); + $this->rMargin = ($this->w - $x - $this->columns[$col]['w']); + $this->x = $x + $listindent; + } + $this->columns[$col]['x'] = $x; + } + $this->current_column = $col; + // fix for HTML mode + $this->newline = true; + // print HTML table header (if any) + if ((!TCPDF_STATIC::empty_string($this->thead)) AND (!$this->inthead)) { + if ($enable_thead) { + // print table header + $this->writeHTML($this->thead, false, false, false, false, ''); + $this->y += $xshift['s']['V']; + // store end of header position + if (!isset($this->columns[$col]['th'])) { + $this->columns[$col]['th'] = array(); + } + $this->columns[$col]['th']['\''.$this->page.'\''] = $this->y; + $this->lasth = 0; + } elseif (isset($this->columns[$col]['th']['\''.$this->page.'\''])) { + $this->y = $this->columns[$col]['th']['\''.$this->page.'\'']; + } + } + // account for an html table cell over multiple columns + if ($this->rtl) { + $this->rMargin += $xshift['x']; + $this->x -= ($xshift['x'] + $xshift['p']['R']); + } else { + $this->lMargin += $xshift['x']; + $this->x += $xshift['x'] + $xshift['p']['L']; + } + } + + /** + * Return the current column number + * @return int current column number + * @public + * @since 5.5.011 (2010-07-08) + */ + public function getColumn() { + return $this->current_column; + } + + /** + * Return the current number of columns. + * @return int number of columns + * @public + * @since 5.8.018 (2010-08-25) + */ + public function getNumberOfColumns() { + return $this->num_columns; + } + + /** + * Set Text rendering mode. + * @param int $stroke outline size in user units (0 = disable). + * @param boolean $fill if true fills the text (default). + * @param boolean $clip if true activate clipping mode + * @public + * @since 4.9.008 (2009-04-02) + */ + public function setTextRenderingMode($stroke=0, $fill=true, $clip=false) { + // Ref.: PDF 32000-1:2008 - 9.3.6 Text Rendering Mode + // convert text rendering parameters + if ($stroke < 0) { + $stroke = 0; + } + if ($fill === true) { + if ($stroke > 0) { + if ($clip === true) { + // Fill, then stroke text and add to path for clipping + $textrendermode = 6; + } else { + // Fill, then stroke text + $textrendermode = 2; + } + $textstrokewidth = $stroke; + } else { + if ($clip === true) { + // Fill text and add to path for clipping + $textrendermode = 4; + } else { + // Fill text + $textrendermode = 0; + } + } + } else { + if ($stroke > 0) { + if ($clip === true) { + // Stroke text and add to path for clipping + $textrendermode = 5; + } else { + // Stroke text + $textrendermode = 1; + } + $textstrokewidth = $stroke; + } else { + if ($clip === true) { + // Add text to path for clipping + $textrendermode = 7; + } else { + // Neither fill nor stroke text (invisible) + $textrendermode = 3; + } + } + } + $this->textrendermode = $textrendermode; + $this->textstrokewidth = $stroke; + } + + /** + * Set parameters for drop shadow effect for text. + * @param array $params Array of parameters: enabled (boolean) set to true to enable shadow; depth_w (float) shadow width in user units; depth_h (float) shadow height in user units; color (array) shadow color or false to use the stroke color; opacity (float) Alpha value: real value from 0 (transparent) to 1 (opaque); blend_mode (string) blend mode, one of the following: Normal, Multiply, Screen, Overlay, Darken, Lighten, ColorDodge, ColorBurn, HardLight, SoftLight, Difference, Exclusion, Hue, Saturation, Color, Luminosity. + * @since 5.9.174 (2012-07-25) + * @public + */ + public function setTextShadow($params=array('enabled'=>false, 'depth_w'=>0, 'depth_h'=>0, 'color'=>false, 'opacity'=>1, 'blend_mode'=>'Normal')) { + if (isset($params['enabled'])) { + $this->txtshadow['enabled'] = $params['enabled']?true:false; + } else { + $this->txtshadow['enabled'] = false; + } + if (isset($params['depth_w'])) { + $this->txtshadow['depth_w'] = floatval($params['depth_w']); + } else { + $this->txtshadow['depth_w'] = 0; + } + if (isset($params['depth_h'])) { + $this->txtshadow['depth_h'] = floatval($params['depth_h']); + } else { + $this->txtshadow['depth_h'] = 0; + } + if (isset($params['color']) AND ($params['color'] !== false) AND is_array($params['color'])) { + $this->txtshadow['color'] = $params['color']; + } else { + $this->txtshadow['color'] = $this->strokecolor; + } + if (isset($params['opacity'])) { + $this->txtshadow['opacity'] = min(1, max(0, floatval($params['opacity']))); + } else { + $this->txtshadow['opacity'] = 1; + } + if (isset($params['blend_mode']) AND in_array($params['blend_mode'], array('Normal', 'Multiply', 'Screen', 'Overlay', 'Darken', 'Lighten', 'ColorDodge', 'ColorBurn', 'HardLight', 'SoftLight', 'Difference', 'Exclusion', 'Hue', 'Saturation', 'Color', 'Luminosity'))) { + $this->txtshadow['blend_mode'] = $params['blend_mode']; + } else { + $this->txtshadow['blend_mode'] = 'Normal'; + } + if ((($this->txtshadow['depth_w'] == 0) AND ($this->txtshadow['depth_h'] == 0)) OR ($this->txtshadow['opacity'] == 0)) { + $this->txtshadow['enabled'] = false; + } + } + + /** + * Return the text shadow parameters array. + * @return array array of parameters. + * @since 5.9.174 (2012-07-25) + * @public + */ + public function getTextShadow() { + return $this->txtshadow; + } + + /** + * Returns an array of chars containing soft hyphens. + * @param array $word array of chars + * @param array $patterns Array of hypenation patterns. + * @param array $dictionary Array of words to be returned without applying the hyphenation algorithm. + * @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens. + * @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens. + * @param int $charmin Minimum word length to apply the hyphenation algorithm. + * @param int $charmax Maximum length of broken piece of word. + * @return array text with soft hyphens + * @author Nicola Asuni + * @since 4.9.012 (2010-04-12) + * @protected + */ + protected function hyphenateWord($word, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) { + $hyphenword = array(); // hyphens positions + $numchars = count($word); + if ($numchars <= $charmin) { + return $word; + } + $word_string = TCPDF_FONTS::UTF8ArrSubString($word, '', '', $this->isunicode); + // some words will be returned as-is + $pattern = '/^([a-zA-Z0-9_\.\-]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/'; + if (preg_match($pattern, $word_string) > 0) { + // email + return $word; + } + $pattern = '/(([a-zA-Z0-9\-]+\.)?)((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$/'; + if (preg_match($pattern, $word_string) > 0) { + // URL + return $word; + } + if (isset($dictionary[$word_string])) { + return TCPDF_FONTS::UTF8StringToArray($dictionary[$word_string], $this->isunicode, $this->CurrentFont); + } + // surround word with '_' characters + $tmpword = array_merge(array(46), $word, array(46)); + $tmpnumchars = $numchars + 2; + $maxpos = $tmpnumchars - 1; + for ($pos = 0; $pos < $maxpos; ++$pos) { + $imax = min(($tmpnumchars - $pos), $charmax); + for ($i = 1; $i <= $imax; ++$i) { + $subword = strtolower(TCPDF_FONTS::UTF8ArrSubString($tmpword, $pos, ($pos + $i), $this->isunicode)); + if (isset($patterns[$subword])) { + $pattern = TCPDF_FONTS::UTF8StringToArray($patterns[$subword], $this->isunicode, $this->CurrentFont); + $pattern_length = count($pattern); + $digits = 1; + for ($j = 0; $j < $pattern_length; ++$j) { + // check if $pattern[$j] is a number = hyphenation level (only numbers from 1 to 5 are valid) + if (($pattern[$j] >= 48) AND ($pattern[$j] <= 57)) { + if ($j == 0) { + $zero = $pos - 1; + } else { + $zero = $pos + $j - $digits; + } + // get hyphenation level + $level = ($pattern[$j] - 48); + // if two levels from two different patterns match at the same point, the higher one is selected. + if (!isset($hyphenword[$zero]) OR ($hyphenword[$zero] < $level)) { + $hyphenword[$zero] = $level; + } + ++$digits; + } + } + } + } + } + $inserted = 0; + $maxpos = $numchars - $rightmin; + for ($i = $leftmin; $i <= $maxpos; ++$i) { + // only odd levels indicate allowed hyphenation points + if (isset($hyphenword[$i]) AND (($hyphenword[$i] % 2) != 0)) { + // 173 = soft hyphen character + array_splice($word, $i + $inserted, 0, 173); + ++$inserted; + } + } + return $word; + } + + /** + * Returns text with soft hyphens. + * @param string $text text to process + * @param mixed $patterns Array of hypenation patterns or a TEX file containing hypenation patterns. TEX patterns can be downloaded from http://www.ctan.org/tex-archive/language/hyph-utf8/tex/generic/hyph-utf8/patterns/ + * @param array $dictionary Array of words to be returned without applying the hyphenation algorithm. + * @param int $leftmin Minimum number of character to leave on the left of the word without applying the hyphens. + * @param int $rightmin Minimum number of character to leave on the right of the word without applying the hyphens. + * @param int $charmin Minimum word length to apply the hyphenation algorithm. + * @param int $charmax Maximum length of broken piece of word. + * @return string text with soft hyphens + * @author Nicola Asuni + * @since 4.9.012 (2010-04-12) + * @public + */ + public function hyphenateText($text, $patterns, $dictionary=array(), $leftmin=1, $rightmin=2, $charmin=1, $charmax=8) { + $text = $this->unhtmlentities($text); + $word = array(); // last word + $txtarr = array(); // text to be returned + $intag = false; // true if we are inside an HTML tag + $skip = false; // true to skip hyphenation + if (!is_array($patterns)) { + $patterns = TCPDF_STATIC::getHyphenPatternsFromTEX($patterns); + } + // get array of characters + $unichars = TCPDF_FONTS::UTF8StringToArray($text, $this->isunicode, $this->CurrentFont); + // for each char + foreach ($unichars as $char) { + if ((!$intag) AND (!$skip) AND TCPDF_FONT_DATA::$uni_type[$char] == 'L') { + // letter character + $word[] = $char; + } else { + // other type of character + if (!TCPDF_STATIC::empty_string($word)) { + // hypenate the word + $txtarr = array_merge($txtarr, $this->hyphenateWord($word, $patterns, $dictionary, $leftmin, $rightmin, $charmin, $charmax)); + $word = array(); + } + $txtarr[] = $char; + if (chr($char) == '<') { + // we are inside an HTML tag + $intag = true; + } elseif ($intag AND (chr($char) == '>')) { + // end of HTML tag + $intag = false; + // check for style tag + $expected = array(115, 116, 121, 108, 101); // = 'style' + $current = array_slice($txtarr, -6, 5); // last 5 chars + $compare = array_diff($expected, $current); + if (empty($compare)) { + // check if it is a closing tag + $expected = array(47); // = '/' + $current = array_slice($txtarr, -7, 1); + $compare = array_diff($expected, $current); + if (empty($compare)) { + // closing style tag + $skip = false; + } else { + // opening style tag + $skip = true; + } + } + } + } + } + if (!TCPDF_STATIC::empty_string($word)) { + // hypenate the word + $txtarr = array_merge($txtarr, $this->hyphenateWord($word, $patterns, $dictionary, $leftmin, $rightmin, $charmin, $charmax)); + } + // convert char array to string and return + return TCPDF_FONTS::UTF8ArrSubString($txtarr, '', '', $this->isunicode); + } + + /** + * Enable/disable rasterization of vector images using ImageMagick library. + * @param boolean $mode if true enable rasterization, false otherwise. + * @public + * @since 5.0.000 (2010-04-27) + */ + public function setRasterizeVectorImages($mode) { + $this->rasterize_vector_images = $mode; + } + + /** + * Enable or disable default option for font subsetting. + * @param boolean $enable if true enable font subsetting by default. + * @author Nicola Asuni + * @public + * @since 5.3.002 (2010-06-07) + */ + public function setFontSubsetting($enable=true) { + if ($this->pdfa_mode) { + $this->font_subsetting = false; + } else { + $this->font_subsetting = $enable ? true : false; + } + } + + /** + * Return the default option for font subsetting. + * @return bool default font subsetting state. + * @author Nicola Asuni + * @public + * @since 5.3.002 (2010-06-07) + */ + public function getFontSubsetting() { + return $this->font_subsetting; + } + + /** + * Left trim the input string + * @param string $str string to trim + * @param string $replace string that replace spaces. + * @return string left trimmed string + * @author Nicola Asuni + * @public + * @since 5.8.000 (2010-08-11) + */ + public function stringLeftTrim($str, $replace='') { + return preg_replace('/^'.$this->re_space['p'].'+/'.$this->re_space['m'], $replace, $str); + } + + /** + * Right trim the input string + * @param string $str string to trim + * @param string $replace string that replace spaces. + * @return string right trimmed string + * @author Nicola Asuni + * @public + * @since 5.8.000 (2010-08-11) + */ + public function stringRightTrim($str, $replace='') { + return preg_replace('/'.$this->re_space['p'].'+$/'.$this->re_space['m'], $replace, $str); + } + + /** + * Trim the input string + * @param string $str string to trim + * @param string $replace string that replace spaces. + * @return string trimmed string + * @author Nicola Asuni + * @public + * @since 5.8.000 (2010-08-11) + */ + public function stringTrim($str, $replace='') { + $str = $this->stringLeftTrim($str, $replace); + $str = $this->stringRightTrim($str, $replace); + return $str; + } + + /** + * Return true if the current font is unicode type. + * @return bool true for unicode font, false otherwise. + * @author Nicola Asuni + * @public + * @since 5.8.002 (2010-08-14) + */ + public function isUnicodeFont() { + return (($this->CurrentFont['type'] == 'TrueTypeUnicode') OR ($this->CurrentFont['type'] == 'cidfont0')); + } + + /** + * Return normalized font name + * @param string $fontfamily property string containing font family names + * @return string normalized font name + * @author Nicola Asuni + * @public + * @since 5.8.004 (2010-08-17) + */ + public function getFontFamilyName($fontfamily) { + // remove spaces and symbols + $fontfamily = preg_replace('/[^a-z0-9_\,]/', '', strtolower($fontfamily)); + // extract all font names + $fontslist = preg_split('/[,]/', $fontfamily); + // find first valid font name + foreach ($fontslist as $font) { + // replace font variations + $font = preg_replace('/regular$/', '', $font); + $font = preg_replace('/italic$/', 'I', $font); + $font = preg_replace('/oblique$/', 'I', $font); + $font = preg_replace('/bold([I]?)$/', 'B\\1', $font); + // replace common family names and core fonts + $pattern = array(); + $replacement = array(); + $pattern[] = '/^serif|^cursive|^fantasy|^timesnewroman/'; + $replacement[] = 'times'; + $pattern[] = '/^sansserif/'; + $replacement[] = 'helvetica'; + $pattern[] = '/^monospace/'; + $replacement[] = 'courier'; + $font = preg_replace($pattern, $replacement, $font); + if (in_array(strtolower($font), $this->fontlist) OR in_array($font, $this->fontkeys)) { + return $font; + } + } + // return current font as default + return $this->CurrentFont['fontkey']; + } + + /** + * Start a new XObject Template. + * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). + * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. + * Note: X,Y coordinates will be reset to 0,0. + * @param int $w Template width in user units (empty string or zero = page width less margins). + * @param int $h Template height in user units (empty string or zero = page height less margins). + * @param mixed $group Set transparency group. Can be a boolean value or an array specifying optional parameters: 'CS' (solour space name), 'I' (boolean flag to indicate isolated group) and 'K' (boolean flag to indicate knockout group). + * @return string|false the XObject Template ID in case of success or false in case of error. + * @author Nicola Asuni + * @public + * @since 5.8.017 (2010-08-24) + * @see endTemplate(), printTemplate() + */ + public function startTemplate($w=0, $h=0, $group=false) { + if ($this->inxobj) { + // we are already inside an XObject template + return false; + } + $this->inxobj = true; + ++$this->n; + // XObject ID + $this->xobjid = 'XT'.$this->n; + // object ID + $this->xobjects[$this->xobjid] = array('n' => $this->n); + // store current graphic state + $this->xobjects[$this->xobjid]['gvars'] = $this->getGraphicVars(); + // initialize data + $this->xobjects[$this->xobjid]['intmrk'] = 0; + $this->xobjects[$this->xobjid]['transfmrk'] = array(); + $this->xobjects[$this->xobjid]['outdata'] = ''; + $this->xobjects[$this->xobjid]['xobjects'] = array(); + $this->xobjects[$this->xobjid]['images'] = array(); + $this->xobjects[$this->xobjid]['fonts'] = array(); + $this->xobjects[$this->xobjid]['annotations'] = array(); + $this->xobjects[$this->xobjid]['extgstates'] = array(); + $this->xobjects[$this->xobjid]['gradients'] = array(); + $this->xobjects[$this->xobjid]['spot_colors'] = array(); + // set new environment + $this->num_columns = 1; + $this->current_column = 0; + $this->setAutoPageBreak(false); + if (($w === '') OR ($w <= 0)) { + $w = $this->w - $this->lMargin - $this->rMargin; + } + if (($h === '') OR ($h <= 0)) { + $h = $this->h - $this->tMargin - $this->bMargin; + } + $this->xobjects[$this->xobjid]['x'] = 0; + $this->xobjects[$this->xobjid]['y'] = 0; + $this->xobjects[$this->xobjid]['w'] = $w; + $this->xobjects[$this->xobjid]['h'] = $h; + $this->w = $w; + $this->h = $h; + $this->wPt = $this->w * $this->k; + $this->hPt = $this->h * $this->k; + $this->fwPt = $this->wPt; + $this->fhPt = $this->hPt; + $this->x = 0; + $this->y = 0; + $this->lMargin = 0; + $this->rMargin = 0; + $this->tMargin = 0; + $this->bMargin = 0; + // set group mode + $this->xobjects[$this->xobjid]['group'] = $group; + return $this->xobjid; + } + + /** + * End the current XObject Template started with startTemplate() and restore the previous graphic state. + * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). + * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. + * @return string|false the XObject Template ID in case of success or false in case of error. + * @author Nicola Asuni + * @public + * @since 5.8.017 (2010-08-24) + * @see startTemplate(), printTemplate() + */ + public function endTemplate() { + if (!$this->inxobj) { + // we are not inside a template + return false; + } + $this->inxobj = false; + // restore previous graphic state + $this->setGraphicVars($this->xobjects[$this->xobjid]['gvars'], true); + return $this->xobjid; + } + + /** + * Print an XObject Template. + * You can print an XObject Template inside the currently opened Template. + * An XObject Template is a PDF block that is a self-contained description of any sequence of graphics objects (including path objects, text objects, and sampled images). + * An XObject Template may be painted multiple times, either on several pages or at several locations on the same page and produces the same results each time, subject only to the graphics state at the time it is invoked. + * @param string $id The ID of XObject Template to print. + * @param float|null $x X position in user units (empty string = current x position) + * @param float|null $y Y position in user units (empty string = current y position) + * @param float $w Width in user units (zero = remaining page width) + * @param float $h Height in user units (zero = remaining page height) + * @param string $align Indicates the alignment of the pointer next to template insertion relative to template height. The value can be:
      • T: top-right for LTR or top-left for RTL
      • M: middle-right for LTR or middle-left for RTL
      • B: bottom-right for LTR or bottom-left for RTL
      • N: next line
      + * @param string $palign Allows to center or align the template on the current line. Possible values are:
      • L : left align
      • C : center
      • R : right align
      • '' : empty string : left for LTR or right for RTL
      + * @param boolean $fitonpage If true the template is resized to not exceed page dimensions. + * @author Nicola Asuni + * @public + * @since 5.8.017 (2010-08-24) + * @see startTemplate(), endTemplate() + */ + public function printTemplate($id, $x=null, $y=null, $w=0, $h=0, $align='', $palign='', $fitonpage=false) { + if ($this->state != 2) { + return; + } + if (!isset($this->xobjects[$id])) { + $this->Error('The XObject Template \''.$id.'\' doesn\'t exist!'); + } + if ($this->inxobj) { + if ($id == $this->xobjid) { + // close current template + $this->endTemplate(); + } else { + // use the template as resource for the template currently opened + $this->xobjects[$this->xobjid]['xobjects'][$id] = $this->xobjects[$id]; + } + } + // set default values + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + $ow = $this->xobjects[$id]['w']; + if ($ow <= 0) { + $ow = 1; + } + $oh = $this->xobjects[$id]['h']; + if ($oh <= 0) { + $oh = 1; + } + // calculate template width and height on document + if (($w <= 0) AND ($h <= 0)) { + $w = $ow; + $h = $oh; + } elseif ($w <= 0) { + $w = $h * $ow / $oh; + } elseif ($h <= 0) { + $h = $w * $oh / $ow; + } + // fit the template on available space + list($w, $h, $x, $y) = $this->fitBlock($w, $h, $x, $y, $fitonpage); + // set page alignment + $rb_y = $y + $h; + // set alignment + if ($this->rtl) { + if ($palign == 'L') { + $xt = $this->lMargin; + } elseif ($palign == 'C') { + $xt = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($palign == 'R') { + $xt = $this->w - $this->rMargin - $w; + } else { + $xt = $x - $w; + } + $rb_x = $xt; + } else { + if ($palign == 'L') { + $xt = $this->lMargin; + } elseif ($palign == 'C') { + $xt = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($palign == 'R') { + $xt = $this->w - $this->rMargin - $w; + } else { + $xt = $x; + } + $rb_x = $xt + $w; + } + // print XObject Template + Transformation matrix + $this->StartTransform(); + // translate and scale + $sx = ($w / $ow); + $sy = ($h / $oh); + $tm = array(); + $tm[0] = $sx; + $tm[1] = 0; + $tm[2] = 0; + $tm[3] = $sy; + $tm[4] = $xt * $this->k; + $tm[5] = ($this->h - $h - $y) * $this->k; + $this->Transform($tm); + // set object + $this->_out('/'.$id.' Do'); + $this->StopTransform(); + // add annotations + if (!empty($this->xobjects[$id]['annotations'])) { + foreach ($this->xobjects[$id]['annotations'] as $annot) { + // transform original coordinates + $coordlt = TCPDF_STATIC::getTransformationMatrixProduct($tm, array(1, 0, 0, 1, ($annot['x'] * $this->k), (-$annot['y'] * $this->k))); + $ax = ($coordlt[4] / $this->k); + $ay = ($this->h - $h - ($coordlt[5] / $this->k)); + $coordrb = TCPDF_STATIC::getTransformationMatrixProduct($tm, array(1, 0, 0, 1, (($annot['x'] + $annot['w']) * $this->k), ((-$annot['y'] - $annot['h']) * $this->k))); + $aw = ($coordrb[4] / $this->k) - $ax; + $ah = ($this->h - $h - ($coordrb[5] / $this->k)) - $ay; + $this->Annotation($ax, $ay, $aw, $ah, $annot['text'], $annot['opt'], $annot['spaces']); + } + } + // set pointer to align the next text/objects + switch($align) { + case 'T': { + $this->y = $y; + $this->x = $rb_x; + break; + } + case 'M': { + $this->y = $y + round($h/2); + $this->x = $rb_x; + break; + } + case 'B': { + $this->y = $rb_y; + $this->x = $rb_x; + break; + } + case 'N': { + $this->setY($rb_y); + break; + } + default:{ + break; + } + } + } + + /** + * Set the percentage of character stretching. + * @param int $perc percentage of stretching (100 = no stretching) + * @author Nicola Asuni + * @public + * @since 5.9.000 (2010-09-29) + */ + public function setFontStretching($perc=100) { + $this->font_stretching = $perc; + } + + /** + * Get the percentage of character stretching. + * @return float stretching value + * @author Nicola Asuni + * @public + * @since 5.9.000 (2010-09-29) + */ + public function getFontStretching() { + return $this->font_stretching; + } + + /** + * Set the amount to increase or decrease the space between characters in a text. + * @param float $spacing amount to increase or decrease the space between characters in a text (0 = default spacing) + * @author Nicola Asuni + * @public + * @since 5.9.000 (2010-09-29) + */ + public function setFontSpacing($spacing=0) { + $this->font_spacing = $spacing; + } + + /** + * Get the amount to increase or decrease the space between characters in a text. + * @return int font spacing (tracking) value + * @author Nicola Asuni + * @public + * @since 5.9.000 (2010-09-29) + */ + public function getFontSpacing() { + return $this->font_spacing; + } + + /** + * Return an array of no-write page regions + * @return array of no-write page regions + * @author Nicola Asuni + * @public + * @since 5.9.003 (2010-10-13) + * @see setPageRegions(), addPageRegion() + */ + public function getPageRegions() { + return $this->page_regions; + } + + /** + * Set no-write regions on page. + * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. + * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. + * You can set multiple regions for the same page. + * @param array $regions array of no-write regions. For each region you can define an array as follow: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). Omit this parameter to remove all regions. + * @author Nicola Asuni + * @public + * @since 5.9.003 (2010-10-13) + * @see addPageRegion(), getPageRegions() + */ + public function setPageRegions($regions=array()) { + // empty current regions array + $this->page_regions = array(); + // add regions + foreach ($regions as $data) { + $this->addPageRegion($data); + } + } + + /** + * Add a single no-write region on selected page. + * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. + * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. + * You can set multiple regions for the same page. + * @param array $region array of a single no-write region array: ('page' => page number or empy for current page, 'xt' => X top, 'yt' => Y top, 'xb' => X bottom, 'yb' => Y bottom, 'side' => page side 'L' = left or 'R' = right). + * @author Nicola Asuni + * @public + * @since 5.9.003 (2010-10-13) + * @see setPageRegions(), getPageRegions() + */ + public function addPageRegion($region) { + if (!isset($region['page']) OR empty($region['page'])) { + $region['page'] = $this->page; + } + if (isset($region['xt']) AND isset($region['xb']) AND ($region['xt'] > 0) AND ($region['xb'] > 0) + AND isset($region['yt']) AND isset($region['yb']) AND ($region['yt'] >= 0) AND ($region['yt'] < $region['yb']) + AND isset($region['side']) AND (($region['side'] == 'L') OR ($region['side'] == 'R'))) { + $this->page_regions[] = $region; + } + } + + /** + * Remove a single no-write region. + * @param int $key region key + * @author Nicola Asuni + * @public + * @since 5.9.003 (2010-10-13) + * @see setPageRegions(), getPageRegions() + */ + public function removePageRegion($key) { + if (isset($this->page_regions[$key])) { + unset($this->page_regions[$key]); + } + } + + /** + * Check page for no-write regions and adapt current coordinates and page margins if necessary. + * A no-write region is a portion of the page with a rectangular or trapezium shape that will not be covered when writing text or html code. + * A region is always aligned on the left or right side of the page ad is defined using a vertical segment. + * @param float $h height of the text/image/object to print in user units + * @param float $x current X coordinate in user units + * @param float $y current Y coordinate in user units + * @return float[] array($x, $y) + * @author Nicola Asuni + * @protected + * @since 5.9.003 (2010-10-13) + */ + protected function checkPageRegions($h, $x, $y) { + // set default values + if ($x === '') { + $x = $this->x; + } + if ($y === '') { + $y = $this->y; + } + if (!$this->check_page_regions OR empty($this->page_regions)) { + // no page regions defined + return array($x, $y); + } + if (empty($h)) { + $h = $this->getCellHeight($this->FontSize); + } + // check for page break + if ($this->checkPageBreak($h, $y)) { + // the content will be printed on a new page + $x = $this->x; + $y = $this->y; + } + if ($this->num_columns > 1) { + if ($this->rtl) { + $this->lMargin = ($this->columns[$this->current_column]['x'] - $this->columns[$this->current_column]['w']); + } else { + $this->rMargin = ($this->w - $this->columns[$this->current_column]['x'] - $this->columns[$this->current_column]['w']); + } + } else { + if ($this->rtl) { + $this->lMargin = max($this->clMargin, $this->original_lMargin); + } else { + $this->rMargin = max($this->crMargin, $this->original_rMargin); + } + } + // adjust coordinates and page margins + foreach ($this->page_regions as $regid => $regdata) { + if ($regdata['page'] == $this->page) { + // check region boundaries + if (($y > ($regdata['yt'] - $h)) AND ($y <= $regdata['yb'])) { + // Y is inside the region + $minv = ($regdata['xb'] - $regdata['xt']) / ($regdata['yb'] - $regdata['yt']); // inverse of angular coefficient + $yt = max($y, $regdata['yt']); + $yb = min(($yt + $h), $regdata['yb']); + $xt = (($yt - $regdata['yt']) * $minv) + $regdata['xt']; + $xb = (($yb - $regdata['yt']) * $minv) + $regdata['xt']; + if ($regdata['side'] == 'L') { // left side + $new_margin = max($xt, $xb); + if ($this->lMargin < $new_margin) { + if ($this->rtl) { + // adjust left page margin + $this->lMargin = max(0, $new_margin); + } + if ($x < $new_margin) { + // adjust x position + $x = $new_margin; + if ($new_margin > ($this->w - $this->rMargin)) { + // adjust y position + $y = $regdata['yb'] - $h; + } + } + } + } elseif ($regdata['side'] == 'R') { // right side + $new_margin = min($xt, $xb); + if (($this->w - $this->rMargin) > $new_margin) { + if (!$this->rtl) { + // adjust right page margin + $this->rMargin = max(0, ($this->w - $new_margin)); + } + if ($x > $new_margin) { + // adjust x position + $x = $new_margin; + if ($new_margin > $this->lMargin) { + // adjust y position + $y = $regdata['yb'] - $h; + } + } + } + } + } + } + } + return array($x, $y); + } + + // --- SVG METHODS --------------------------------------------------------- + + /** + * Embedd a Scalable Vector Graphics (SVG) image. + * NOTE: SVG standard is not yet fully implemented, use the setRasterizeVectorImages() method to enable/disable rasterization of vector images using ImageMagick library. + * @param string $file Name of the SVG file or a '@' character followed by the SVG data string. + * @param float|null $x Abscissa of the upper-left corner. + * @param float|null $y Ordinate of the upper-left corner. + * @param float $w Width of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param float $h Height of the image in the page. If not specified or equal to zero, it is automatically calculated. + * @param mixed $link URL or identifier returned by AddLink(). + * @param string $align Indicates the alignment of the pointer next to image insertion relative to image height. The value can be:
      • T: top-right for LTR or top-left for RTL
      • M: middle-right for LTR or middle-left for RTL
      • B: bottom-right for LTR or bottom-left for RTL
      • N: next line
      If the alignment is an empty string, then the pointer will be restored on the starting SVG position. + * @param string $palign Allows to center or align the image on the current line. Possible values are:
      • L : left align
      • C : center
      • R : right align
      • '' : empty string : left for LTR or right for RTL
      + * @param mixed $border Indicates if borders must be drawn around the cell. The value can be a number:
      • 0: no border (default)
      • 1: frame
      or a string containing some or all of the following characters (in any order):
      • L: left
      • T: top
      • R: right
      • B: bottom
      or an array of line styles for each border group - for example: array('LTRB' => array('width' => 2, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0))) + * @param boolean $fitonpage if true the image is resized to not exceed page dimensions. + * @author Nicola Asuni + * @since 5.0.000 (2010-05-02) + * @public + */ + public function ImageSVG($file, $x=null, $y=null, $w=0, $h=0, $link='', $align='', $palign='', $border=0, $fitonpage=false) { + if ($this->state != 2) { + return; + } + // reset SVG vars + $this->svggradients = array(); + $this->svggradientid = 0; + $this->svgdefsmode = false; + $this->svgdefs = array(); + $this->svgclipmode = false; + $this->svgclippaths = array(); + $this->svgcliptm = array(); + $this->svgclipid = 0; + $this->svgtext = ''; + $this->svgtextmode = array(); + if ($this->rasterize_vector_images AND ($w > 0) AND ($h > 0)) { + // convert SVG to raster image using GD or ImageMagick libraries + return $this->Image($file, $x, $y, $w, $h, 'SVG', $link, $align, true, 300, $palign, false, false, $border, false, false, false); + } + if ($file[0] === '@') { // image from string + $this->svgdir = ''; + $svgdata = substr($file, 1); + } else { // SVG file + $this->svgdir = dirname($file); + $svgdata = $this->getCachedFileContents($file); + } + if ($svgdata === FALSE) { + $this->Error('SVG file not found: '.$file); + } + if (TCPDF_STATIC::empty_string($x)) { + $x = $this->x; + } + if (TCPDF_STATIC::empty_string($y)) { + $y = $this->y; + } + // check page for no-write regions and adapt page margins if necessary + list($x, $y) = $this->checkPageRegions($h, $x, $y); + $k = $this->k; + $ox = 0; + $oy = 0; + $ow = $w; + $oh = $h; + $aspect_ratio_align = 'xMidYMid'; + $aspect_ratio_ms = 'meet'; + $regs = array(); + // get original image width and height + preg_match('/]*)>/si', $svgdata, $regs); + if (isset($regs[1]) AND !empty($regs[1])) { + $tmp = array(); + if (preg_match('/[\s]+x[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { + $ox = $this->getHTMLUnitToUnits($tmp[1], 0, $this->svgunit, false); + } + $tmp = array(); + if (preg_match('/[\s]+y[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { + $oy = $this->getHTMLUnitToUnits($tmp[1], 0, $this->svgunit, false); + } + $tmp = array(); + if (preg_match('/[\s]+width[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { + $ow = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false); + } + $tmp = array(); + if (preg_match('/[\s]+height[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { + $oh = $this->getHTMLUnitToUnits($tmp[1], 1, $this->svgunit, false); + } + $tmp = array(); + $view_box = array(); + if (preg_match('/[\s]+viewBox[\s]*=[\s]*"[\s]*([0-9\.\-]+)[\s]+([0-9\.\-]+)[\s]+([0-9\.]+)[\s]+([0-9\.]+)[\s]*"/si', $regs[1], $tmp)) { + if (count($tmp) == 5) { + array_shift($tmp); + foreach ($tmp as $key => $val) { + $view_box[$key] = $this->getHTMLUnitToUnits($val, 0, $this->svgunit, false); + } + $ox = $view_box[0]; + $oy = $view_box[1]; + } + // get aspect ratio + $tmp = array(); + if (preg_match('/[\s]+preserveAspectRatio[\s]*=[\s]*"([^"]*)"/si', $regs[1], $tmp)) { + $aspect_ratio = preg_split('/[\s]+/si', $tmp[1]); + switch (count($aspect_ratio)) { + case 3: { + $aspect_ratio_align = $aspect_ratio[1]; + $aspect_ratio_ms = $aspect_ratio[2]; + break; + } + case 2: { + $aspect_ratio_align = $aspect_ratio[0]; + $aspect_ratio_ms = $aspect_ratio[1]; + break; + } + case 1: { + $aspect_ratio_align = $aspect_ratio[0]; + $aspect_ratio_ms = 'meet'; + break; + } + } + } + } + } + if ($ow <= 0) { + $ow = 1; + } + if ($oh <= 0) { + $oh = 1; + } + // calculate image width and height on document + if (($w <= 0) AND ($h <= 0)) { + // convert image size to document unit + $w = $ow; + $h = $oh; + } elseif ($w <= 0) { + $w = $h * $ow / $oh; + } elseif ($h <= 0) { + $h = $w * $oh / $ow; + } + // fit the image on available space + list($w, $h, $x, $y) = $this->fitBlock($w, $h, $x, $y, $fitonpage); + if ($this->rasterize_vector_images) { + // convert SVG to raster image using GD or ImageMagick libraries + return $this->Image($file, $x, $y, $w, $h, 'SVG', $link, $align, true, 300, $palign, false, false, $border, false, false, false); + } + // set alignment + $this->img_rb_y = $y + $h; + // set alignment + if ($this->rtl) { + if ($palign == 'L') { + $ximg = $this->lMargin; + } elseif ($palign == 'C') { + $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($palign == 'R') { + $ximg = $this->w - $this->rMargin - $w; + } else { + $ximg = $x - $w; + } + $this->img_rb_x = $ximg; + } else { + if ($palign == 'L') { + $ximg = $this->lMargin; + } elseif ($palign == 'C') { + $ximg = ($this->w + $this->lMargin - $this->rMargin - $w) / 2; + } elseif ($palign == 'R') { + $ximg = $this->w - $this->rMargin - $w; + } else { + $ximg = $x; + } + $this->img_rb_x = $ximg + $w; + } + // store current graphic vars + $gvars = $this->getGraphicVars(); + // store SVG position and scale factors + $svgoffset_x = ($ximg - $ox) * $this->k; + $svgoffset_y = -($y - $oy) * $this->k; + if (isset($view_box[2]) AND ($view_box[2] > 0) AND ($view_box[3] > 0)) { + $ow = $view_box[2]; + $oh = $view_box[3]; + } else { + if ($ow <= 0) { + $ow = $w; + } + if ($oh <= 0) { + $oh = $h; + } + } + $svgscale_x = $w / $ow; + $svgscale_y = $h / $oh; + // scaling and alignment + if ($aspect_ratio_align != 'none') { + // store current scaling values + $svgscale_old_x = $svgscale_x; + $svgscale_old_y = $svgscale_y; + // force uniform scaling + if ($aspect_ratio_ms == 'slice') { + // the entire viewport is covered by the viewBox + if ($svgscale_x > $svgscale_y) { + $svgscale_y = $svgscale_x; + } elseif ($svgscale_x < $svgscale_y) { + $svgscale_x = $svgscale_y; + } + } else { // meet + // the entire viewBox is visible within the viewport + if ($svgscale_x < $svgscale_y) { + $svgscale_y = $svgscale_x; + } elseif ($svgscale_x > $svgscale_y) { + $svgscale_x = $svgscale_y; + } + } + // correct X alignment + switch (substr($aspect_ratio_align, 1, 3)) { + case 'Min': { + // do nothing + break; + } + case 'Max': { + $svgoffset_x += (($w * $this->k) - ($ow * $this->k * $svgscale_x)); + break; + } + default: + case 'Mid': { + $svgoffset_x += ((($w * $this->k) - ($ow * $this->k * $svgscale_x)) / 2); + break; + } + } + // correct Y alignment + switch (substr($aspect_ratio_align, 5)) { + case 'Min': { + // do nothing + break; + } + case 'Max': { + $svgoffset_y -= (($h * $this->k) - ($oh * $this->k * $svgscale_y)); + break; + } + default: + case 'Mid': { + $svgoffset_y -= ((($h * $this->k) - ($oh * $this->k * $svgscale_y)) / 2); + break; + } + } + } + // store current page break mode + $page_break_mode = $this->AutoPageBreak; + $page_break_margin = $this->getBreakMargin(); + $cell_padding = $this->cell_padding; + $this->setCellPadding(0); + $this->setAutoPageBreak(false); + // save the current graphic state + $this->_out('q'.$this->epsmarker); + // set initial clipping mask + $this->Rect($ximg, $y, $w, $h, 'CNZ', array(), array()); + // scale and translate + $e = $ox * $this->k * (1 - $svgscale_x); + $f = ($this->h - $oy) * $this->k * (1 - $svgscale_y); + $this->_out(sprintf('%F %F %F %F %F %F cm', $svgscale_x, 0, 0, $svgscale_y, ($e + $svgoffset_x), ($f + $svgoffset_y))); + // creates a new XML parser to be used by the other XML functions + $parser = xml_parser_create('UTF-8'); + // the following function allows to use parser inside object + xml_set_object($parser, $this); + // disable case-folding for this XML parser + xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0); + // sets the element handler functions for the XML parser + xml_set_element_handler($parser, 'startSVGElementHandler', 'endSVGElementHandler'); + // sets the character data handler function for the XML parser + xml_set_character_data_handler($parser, 'segSVGContentHandler'); + // start parsing an XML document + if (!xml_parse($parser, $svgdata)) { + $error_message = sprintf('SVG Error: %s at line %d', xml_error_string(xml_get_error_code($parser)), xml_get_current_line_number($parser)); + $this->Error($error_message); + } + // free this XML parser + xml_parser_free($parser); + + // >= PHP 7.0.0 "explicitly unset the reference to parser to avoid memory leaks" + unset($parser); + + // restore previous graphic state + $this->_out($this->epsmarker.'Q'); + // restore graphic vars + $this->setGraphicVars($gvars); + $this->lasth = $gvars['lasth']; + if (!empty($border)) { + $bx = $this->x; + $by = $this->y; + $this->x = $ximg; + if ($this->rtl) { + $this->x += $w; + } + $this->y = $y; + $this->Cell($w, $h, '', $border, 0, '', 0, '', 0, true); + $this->x = $bx; + $this->y = $by; + } + if ($link) { + $this->Link($ximg, $y, $w, $h, $link, 0); + } + // set pointer to align the next text/objects + switch($align) { + case 'T':{ + $this->y = $y; + $this->x = $this->img_rb_x; + break; + } + case 'M':{ + $this->y = $y + round($h/2); + $this->x = $this->img_rb_x; + break; + } + case 'B':{ + $this->y = $this->img_rb_y; + $this->x = $this->img_rb_x; + break; + } + case 'N':{ + $this->setY($this->img_rb_y); + break; + } + default:{ + // restore pointer to starting position + $this->x = $gvars['x']; + $this->y = $gvars['y']; + $this->page = $gvars['page']; + $this->current_column = $gvars['current_column']; + $this->tMargin = $gvars['tMargin']; + $this->bMargin = $gvars['bMargin']; + $this->w = $gvars['w']; + $this->h = $gvars['h']; + $this->wPt = $gvars['wPt']; + $this->hPt = $gvars['hPt']; + $this->fwPt = $gvars['fwPt']; + $this->fhPt = $gvars['fhPt']; + break; + } + } + $this->endlinex = $this->img_rb_x; + // restore page break + $this->setAutoPageBreak($page_break_mode, $page_break_margin); + $this->cell_padding = $cell_padding; + } + + /** + * Convert SVG transformation matrix to PDF. + * @param array $tm original SVG transformation matrix + * @return array transformation matrix + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected function convertSVGtMatrix($tm) { + $a = $tm[0]; + $b = -$tm[1]; + $c = -$tm[2]; + $d = $tm[3]; + $e = $this->getHTMLUnitToUnits($tm[4], 1, $this->svgunit, false) * $this->k; + $f = -$this->getHTMLUnitToUnits($tm[5], 1, $this->svgunit, false) * $this->k; + $x = 0; + $y = $this->h * $this->k; + $e = ($x * (1 - $a)) - ($y * $c) + $e; + $f = ($y * (1 - $d)) - ($x * $b) + $f; + return array($a, $b, $c, $d, $e, $f); + } + + /** + * Apply SVG graphic transformation matrix. + * @param array $tm original SVG transformation matrix + * @protected + * @since 5.0.000 (2010-05-02) + */ + protected function SVGTransform($tm) { + $this->Transform($this->convertSVGtMatrix($tm)); + } + + /** + * Apply the requested SVG styles (*** TO BE COMPLETED ***) + * @param array $svgstyle array of SVG styles to apply + * @param array $prevsvgstyle array of previous SVG style + * @param int $x X origin of the bounding box + * @param int $y Y origin of the bounding box + * @param int $w width of the bounding box + * @param int $h height of the bounding box + * @param string $clip_function clip function + * @param array $clip_params array of parameters for clipping function + * @return string style + * @author Nicola Asuni + * @since 5.0.000 (2010-05-02) + * @protected + */ + protected function setSVGStyles($svgstyle, $prevsvgstyle, $x=0, $y=0, $w=1, $h=1, $clip_function='', $clip_params=array()) { + if ($this->state != 2) { + return; + } + $objstyle = ''; + $minlen = (0.01 / $this->k); // minimum acceptable length + if (!isset($svgstyle['opacity'])) { + return $objstyle; + } + // clip-path + $regs = array(); + if (preg_match('/url\([\s]*\#([^\)]*)\)/si', $svgstyle['clip-path'], $regs)) { + $clip_path = $this->svgclippaths[$regs[1]]; + foreach ($clip_path as $cp) { + $this->startSVGElementHandler('clip-path', $cp['name'], $cp['attribs'], $cp['tm']); + } + } + // opacity + if ($svgstyle['opacity'] != 1) { + $this->setAlpha($svgstyle['opacity'], 'Normal', $svgstyle['opacity'], false); + } + // color + $fill_color = TCPDF_COLORS::convertHTMLColorToDec($svgstyle['color'], $this->spot_colors); + $this->setFillColorArray($fill_color); + // text color + $text_color = TCPDF_COLORS::convertHTMLColorToDec($svgstyle['text-color'], $this->spot_colors); + $this->setTextColorArray($text_color); + // clip + if (preg_match('/rect\(([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)[\s]*([a-z0-9\-\.]*)\)/si', $svgstyle['clip'], $regs)) { + $top = (isset($regs[1])?$this->getHTMLUnitToUnits($regs[1], 0, $this->svgunit, false):0); + $right = (isset($regs[2])?$this->getHTMLUnitToUnits($regs[2], 0, $this->svgunit, false):0); + $bottom = (isset($regs[3])?$this->getHTMLUnitToUnits($regs[3], 0, $this->svgunit, false):0); + $left = (isset($regs[4])?$this->getHTMLUnitToUnits($regs[4], 0, $this->svgunit, false):0); + $cx = $x + $left; + $cy = $y + $top; + $cw = $w - $left - $right; + $ch = $h - $top - $bottom; + if ($svgstyle['clip-rule'] == 'evenodd') { + $clip_rule = 'CNZ'; + } else { + $clip_rule = 'CEO'; + } + $this->Rect($cx, $cy, $cw, $ch, $clip_rule, array(), array()); + } + // fill + $regs = array(); + if (preg_match('/url\([\s]*\#([^\)]*)\)/si', $svgstyle['fill'], $regs)) { + // gradient + $gradient = $this->svggradients[$regs[1]]; + if (isset($gradient['xref'])) { + // reference to another gradient definition + $newgradient = $this->svggradients[$gradient['xref']]; + $newgradient['coords'] = $gradient['coords']; + $newgradient['mode'] = $gradient['mode']; + $newgradient['type'] = $gradient['type']; + $newgradient['gradientUnits'] = $gradient['gradientUnits']; + if (isset($gradient['gradientTransform'])) { + $newgradient['gradientTransform'] = $gradient['gradientTransform']; + } + $gradient = $newgradient; + } + //save current Graphic State + $this->_outSaveGraphicsState(); + //set clipping area + if (!empty($clip_function) AND method_exists($this, $clip_function)) { + $bbox = call_user_func_array(array($this, $clip_function), $clip_params); + if ((!isset($gradient['type']) OR ($gradient['type'] != 3)) AND is_array($bbox) AND (count($bbox) == 4)) { + list($x, $y, $w, $h) = $bbox; + } + } + if ($gradient['mode'] == 'measure') { + if (!isset($gradient['coords'][4])) { + $gradient['coords'][4] = 0.5; + } + if (isset($gradient['gradientTransform']) AND !empty($gradient['gradientTransform'])) { + $gtm = $gradient['gradientTransform']; + // apply transformation matrix + $xa = ($gtm[0] * $gradient['coords'][0]) + ($gtm[2] * $gradient['coords'][1]) + $gtm[4]; + $ya = ($gtm[1] * $gradient['coords'][0]) + ($gtm[3] * $gradient['coords'][1]) + $gtm[5]; + $xb = ($gtm[0] * $gradient['coords'][2]) + ($gtm[2] * $gradient['coords'][3]) + $gtm[4]; + $yb = ($gtm[1] * $gradient['coords'][2]) + ($gtm[3] * $gradient['coords'][3]) + $gtm[5]; + $r = sqrt(pow(($gtm[0] * $gradient['coords'][4]), 2) + pow(($gtm[1] * $gradient['coords'][4]), 2)); + $gradient['coords'][0] = $xa; + $gradient['coords'][1] = $ya; + $gradient['coords'][2] = $xb; + $gradient['coords'][3] = $yb; + $gradient['coords'][4] = $r; + } + // convert SVG coordinates to user units + $gradient['coords'][0] = $this->getHTMLUnitToUnits($gradient['coords'][0], 0, $this->svgunit, false); + $gradient['coords'][1] = $this->getHTMLUnitToUnits($gradient['coords'][1], 0, $this->svgunit, false); + $gradient['coords'][2] = $this->getHTMLUnitToUnits($gradient['coords'][2], 0, $this->svgunit, false); + $gradient['coords'][3] = $this->getHTMLUnitToUnits($gradient['coords'][3], 0, $this->svgunit, false); + $gradient['coords'][4] = $this->getHTMLUnitToUnits($gradient['coords'][4], 0, $this->svgunit, false); + if ($w <= $minlen) { + $w = $minlen; + } + if ($h <= $minlen) { + $h = $minlen; + } + // shift units + if ($gradient['gradientUnits'] == 'objectBoundingBox') { + // convert to SVG coordinate system + $gradient['coords'][0] += $x; + $gradient['coords'][1] += $y; + $gradient['coords'][2] += $x; + $gradient['coords'][3] += $y; + } + // calculate percentages + $gradient['coords'][0] = (($gradient['coords'][0] - $x) / $w); + $gradient['coords'][1] = (($gradient['coords'][1] - $y) / $h); + $gradient['coords'][2] = (($gradient['coords'][2] - $x) / $w); + $gradient['coords'][3] = (($gradient['coords'][3] - $y) / $h); + $gradient['coords'][4] /= $w; + } elseif ($gradient['mode'] == 'percentage') { + foreach($gradient['coords'] as $key => $val) { + $gradient['coords'][$key] = (intval($val) / 100); + if ($val < 0) { + $gradient['coords'][$key] = 0; + } elseif ($val > 1) { + $gradient['coords'][$key] = 1; + } + } + } + if (($gradient['type'] == 2) AND ($gradient['coords'][0] == $gradient['coords'][2]) AND ($gradient['coords'][1] == $gradient['coords'][3])) { + // single color (no shading) + $gradient['coords'][0] = 1; + $gradient['coords'][1] = 0; + $gradient['coords'][2] = 0.999; + $gradient['coords'][3] = 0; + } + // swap Y coordinates + $tmp = $gradient['coords'][1]; + $gradient['coords'][1] = $gradient['coords'][3]; + $gradient['coords'][3] = $tmp; + // set transformation map for gradient + $cy = ($this->h - $y); + if ($gradient['type'] == 3) { + // circular gradient + $cy -= ($gradient['coords'][1] * ($w + $h)); + $h = $w = max($w, $h); + } else { + $cy -= $h; + } + $this->_out(sprintf('%F 0 0 %F %F %F cm', ($w * $this->k), ($h * $this->k), ($x * $this->k), ($cy * $this->k))); + if (count($gradient['stops']) > 1) { + $this->Gradient($gradient['type'], $gradient['coords'], $gradient['stops'], array(), false); + } + } elseif ($svgstyle['fill'] != 'none') { + $fill_color = TCPDF_COLORS::convertHTMLColorToDec($svgstyle['fill'], $this->spot_colors); + if ($svgstyle['fill-opacity'] != 1) { + $this->setAlpha($this->alpha['CA'], 'Normal', $svgstyle['fill-opacity'], false); + } + $this->setFillColorArray($fill_color); + if ($svgstyle['fill-rule'] == 'evenodd') { + $objstyle .= 'F*'; + } else { + $objstyle .= 'F'; + } + } + // stroke + if ($svgstyle['stroke'] != 'none') { + if ($svgstyle['stroke-opacity'] != 1) { + $this->setAlpha($svgstyle['stroke-opacity'], 'Normal', $this->alpha['ca'], false); + } elseif (preg_match('/rgba\(\d+%?,\s*\d+%?,\s*\d+%?,\s*(\d+(?:\.\d+)?)\)/i', $svgstyle['stroke'], $rgba_matches)) { + $this->setAlpha($rgba_matches[1], 'Normal', $this->alpha['ca'], false); + } + $stroke_style = array( + 'color' => TCPDF_COLORS::convertHTMLColorToDec($svgstyle['stroke'], $this->spot_colors), + 'width' => $this->getHTMLUnitToUnits($svgstyle['stroke-width'], 0, $this->svgunit, false), + 'cap' => $svgstyle['stroke-linecap'], + 'join' => $svgstyle['stroke-linejoin'] + ); + if (isset($svgstyle['stroke-dasharray']) AND !empty($svgstyle['stroke-dasharray']) AND ($svgstyle['stroke-dasharray'] != 'none')) { + $stroke_style['dash'] = $svgstyle['stroke-dasharray']; + } + $this->setLineStyle($stroke_style); + $objstyle .= 'D'; + } + // font + $regs = array(); + if (!empty($svgstyle['font'])) { + if (preg_match('/font-family[\s]*:[\s]*([^\;\"]*)/si', $svgstyle['font'], $regs)) { + $font_family = $this->getFontFamilyName($regs[1]); + } else { + $font_family = $svgstyle['font-family']; + } + if (preg_match('/font-size[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { + $font_size = trim($regs[1]); + } else { + $font_size = $svgstyle['font-size']; + } + if (preg_match('/font-style[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { + $font_style = trim($regs[1]); + } else { + $font_style = $svgstyle['font-style']; + } + if (preg_match('/font-weight[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { + $font_weight = trim($regs[1]); + } else { + $font_weight = $svgstyle['font-weight']; + } + if (preg_match('/font-stretch[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { + $font_stretch = trim($regs[1]); + } else { + $font_stretch = $svgstyle['font-stretch']; + } + if (preg_match('/letter-spacing[\s]*:[\s]*([^\s\;\"]*)/si', $svgstyle['font'], $regs)) { + $font_spacing = trim($regs[1]); + } else { + $font_spacing = $svgstyle['letter-spacing']; + } + } else { + $font_family = $this->getFontFamilyName($svgstyle['font-family']); + $font_size = $svgstyle['font-size']; + $font_style = $svgstyle['font-style']; + $font_weight = $svgstyle['font-weight']; + $font_stretch = $svgstyle['font-stretch']; + $font_spacing = $svgstyle['letter-spacing']; + } + $font_size = $this->getHTMLFontUnits($font_size, $this->svgstyles[0]['font-size'], $prevsvgstyle['font-size'], $this->svgunit); + $font_stretch = $this->getCSSFontStretching($font_stretch, $svgstyle['font-stretch']); + $font_spacing = $this->getCSSFontSpacing($font_spacing, $svgstyle['letter-spacing']); + switch ($font_style) { + case 'italic': { + $font_style = 'I'; + break; + } + case 'oblique': { + $font_style = 'I'; + break; + } + default: + case 'normal': { + $font_style = ''; + break; + } + } + switch ($font_weight) { + case 'bold': + case 'bolder': { + $font_style .= 'B'; + break; + } + case 'normal': { + if ((substr($font_family, -1) == 'I') AND (substr($font_family, -2, 1) == 'B')) { + $font_family = substr($font_family, 0, -2).'I'; + } elseif (substr($font_family, -1) == 'B') { + $font_family = substr($font_family, 0, -1); + } + break; + } + } + switch ($svgstyle['text-decoration']) { + case 'underline': { + $font_style .= 'U'; + break; + } + case 'overline': { + $font_style .= 'O'; + break; + } + case 'line-through': { + $font_style .= 'D'; + break; + } + default: + case 'none': { + break; + } + } + $this->setFont($font_family, $font_style, $font_size); + $this->setFontStretching($font_stretch); + $this->setFontSpacing($font_spacing); + return $objstyle; + } + + /** + * Draws an SVG path + * @param string $d attribute d of the path SVG element + * @param string $style Style of rendering. Possible values are: + *
        + *
      • D or empty string: Draw (default).
      • + *
      • F: Fill.
      • + *
      • F*: Fill using the even-odd rule to determine which regions lie inside the clipping path.
      • + *
      • DF or FD: Draw and fill.
      • + *
      • DF* or FD*: Draw and fill using the even-odd rule to determine which regions lie inside the clipping path.
      • + *
      • CNZ: Clipping mode (using the even-odd rule to determine which regions lie inside the clipping path).
      • + *
      • CEO: Clipping mode (using the nonzero winding number rule to determine which regions lie inside the clipping path).
      • + *
      + * @return array of container box measures (x, y, w, h) + * @author Nicola Asuni + * @since 5.0.000 (2010-05-02) + * @protected + */ + protected function SVGPath($d, $style='') { + if ($this->state != 2) { + return; + } + // set fill/stroke style + $op = TCPDF_STATIC::getPathPaintOperator($style, ''); + if (empty($op)) { + return; + } + $paths = array(); + $d = preg_replace('/([0-9ACHLMQSTVZ])([\-\+])/si', '\\1 \\2', $d); + $d = preg_replace('/(\.[0-9]+)(\.)/s', '\\1 \\2', $d); + preg_match_all('/([ACHLMQSTVZ])[\s]*([^ACHLMQSTVZ\"]*)/si', $d, $paths, PREG_SET_ORDER); + $x = 0; + $y = 0; + $x1 = 0; + $y1 = 0; + $x2 = 0; + $y2 = 0; + $xmin = 2147483647; + $xmax = 0; + $ymin = 2147483647; + $ymax = 0; + $xinitial = 0; + $yinitial = 0; + $relcoord = false; + $minlen = (0.01 / $this->k); // minimum acceptable length (3 point) + $firstcmd = true; // used to print first point + // draw curve pieces + foreach ($paths as $key => $val) { + // get curve type + $cmd = trim($val[1]); + if (strtolower($cmd) == $cmd) { + // use relative coordinated instead of absolute + $relcoord = true; + $xoffset = $x; + $yoffset = $y; + } else { + $relcoord = false; + $xoffset = 0; + $yoffset = 0; + } + $params = array(); + if (isset($val[2])) { + // get curve parameters + $rawparams = preg_split('/([\,\s]+)/si', trim($val[2])); + $params = array(); + foreach ($rawparams as $ck => $cp) { + $params[$ck] = $this->getHTMLUnitToUnits($cp, 0, $this->svgunit, false); + if (abs($params[$ck]) < $minlen) { + // approximate little values to zero + $params[$ck] = 0; + } + } + } + // store current origin point + $x0 = $x; + $y0 = $y; + switch (strtoupper($cmd)) { + case 'M': { // moveto + foreach ($params as $ck => $cp) { + if (($ck % 2) == 0) { + $x = $cp + $xoffset; + } else { + $y = $cp + $yoffset; + if ($firstcmd OR (abs($x0 - $x) >= $minlen) OR (abs($y0 - $y) >= $minlen)) { + if ($ck == 1) { + $this->_outPoint($x, $y); + $firstcmd = false; + $xinitial = $x; + $yinitial = $y; + } else { + $this->_outLine($x, $y); + } + $x0 = $x; + $y0 = $y; + } + $xmin = min($xmin, $x); + $ymin = min($ymin, $y); + $xmax = max($xmax, $x); + $ymax = max($ymax, $y); + if ($relcoord) { + $xoffset = $x; + $yoffset = $y; + } + } + } + break; + } + case 'L': { // lineto + foreach ($params as $ck => $cp) { + if (($ck % 2) == 0) { + $x = $cp + $xoffset; + } else { + $y = $cp + $yoffset; + if ((abs($x0 - $x) >= $minlen) OR (abs($y0 - $y) >= $minlen)) { + $this->_outLine($x, $y); + $x0 = $x; + $y0 = $y; + } + $xmin = min($xmin, $x); + $ymin = min($ymin, $y); + $xmax = max($xmax, $x); + $ymax = max($ymax, $y); + if ($relcoord) { + $xoffset = $x; + $yoffset = $y; + } + } + } + break; + } + case 'H': { // horizontal lineto + foreach ($params as $ck => $cp) { + $x = $cp + $xoffset; + if ((abs($x0 - $x) >= $minlen) OR (abs($y0 - $y) >= $minlen)) { + $this->_outLine($x, $y); + $x0 = $x; + $y0 = $y; + } + $xmin = min($xmin, $x); + $xmax = max($xmax, $x); + if ($relcoord) { + $xoffset = $x; + } + } + break; + } + case 'V': { // vertical lineto + foreach ($params as $ck => $cp) { + $y = $cp + $yoffset; + if ((abs($x0 - $x) >= $minlen) OR (abs($y0 - $y) >= $minlen)) { + $this->_outLine($x, $y); + $x0 = $x; + $y0 = $y; + } + $ymin = min($ymin, $y); + $ymax = max($ymax, $y); + if ($relcoord) { + $yoffset = $y; + } + } + break; + } + case 'C': { // curveto + foreach ($params as $ck => $cp) { + $params[$ck] = $cp; + if ((($ck + 1) % 6) == 0) { + $x1 = $params[($ck - 5)] + $xoffset; + $y1 = $params[($ck - 4)] + $yoffset; + $x2 = $params[($ck - 3)] + $xoffset; + $y2 = $params[($ck - 2)] + $yoffset; + $x = $params[($ck - 1)] + $xoffset; + $y = $params[($ck)] + $yoffset; + $this->_outCurve($x1, $y1, $x2, $y2, $x, $y); + $xmin = min($xmin, $x, $x1, $x2); + $ymin = min($ymin, $y, $y1, $y2); + $xmax = max($xmax, $x, $x1, $x2); + $ymax = max($ymax, $y, $y1, $y2); + if ($relcoord) { + $xoffset = $x; + $yoffset = $y; + } + } + } + break; + } + case 'S': { // shorthand/smooth curveto + foreach ($params as $ck => $cp) { + $params[$ck] = $cp; + if ((($ck + 1) % 4) == 0) { + if (($key > 0) AND ((strtoupper($paths[($key - 1)][1]) == 'C') OR (strtoupper($paths[($key - 1)][1]) == 'S'))) { + $x1 = (2 * $x) - $x2; + $y1 = (2 * $y) - $y2; + } else { + $x1 = $x; + $y1 = $y; + } + $x2 = $params[($ck - 3)] + $xoffset; + $y2 = $params[($ck - 2)] + $yoffset; + $x = $params[($ck - 1)] + $xoffset; + $y = $params[($ck)] + $yoffset; + $this->_outCurve($x1, $y1, $x2, $y2, $x, $y); + $xmin = min($xmin, $x, $x1, $x2); + $ymin = min($ymin, $y, $y1, $y2); + $xmax = max($xmax, $x, $x1, $x2); + $ymax = max($ymax, $y, $y1, $y2); + if ($relcoord) { + $xoffset = $x; + $yoffset = $y; + } + } + } + break; + } + case 'Q': { // quadratic Bezier curveto + foreach ($params as $ck => $cp) { + $params[$ck] = $cp; + if ((($ck + 1) % 4) == 0) { + // convert quadratic points to cubic points + $x1 = $params[($ck - 3)] + $xoffset; + $y1 = $params[($ck - 2)] + $yoffset; + $xa = ($x + (2 * $x1)) / 3; + $ya = ($y + (2 * $y1)) / 3; + $x = $params[($ck - 1)] + $xoffset; + $y = $params[($ck)] + $yoffset; + $xb = ($x + (2 * $x1)) / 3; + $yb = ($y + (2 * $y1)) / 3; + $this->_outCurve($xa, $ya, $xb, $yb, $x, $y); + $xmin = min($xmin, $x, $xa, $xb); + $ymin = min($ymin, $y, $ya, $yb); + $xmax = max($xmax, $x, $xa, $xb); + $ymax = max($ymax, $y, $ya, $yb); + if ($relcoord) { + $xoffset = $x; + $yoffset = $y; + } + } + } + break; + } + case 'T': { // shorthand/smooth quadratic Bezier curveto + foreach ($params as $ck => $cp) { + $params[$ck] = $cp; + if (($ck % 2) != 0) { + if (($key > 0) AND ((strtoupper($paths[($key - 1)][1]) == 'Q') OR (strtoupper($paths[($key - 1)][1]) == 'T'))) { + $x1 = (2 * $x) - $x1; + $y1 = (2 * $y) - $y1; + } else { + $x1 = $x; + $y1 = $y; + } + // convert quadratic points to cubic points + $xa = ($x + (2 * $x1)) / 3; + $ya = ($y + (2 * $y1)) / 3; + $x = $params[($ck - 1)] + $xoffset; + $y = $params[($ck)] + $yoffset; + $xb = ($x + (2 * $x1)) / 3; + $yb = ($y + (2 * $y1)) / 3; + $this->_outCurve($xa, $ya, $xb, $yb, $x, $y); + $xmin = min($xmin, $x, $xa, $xb); + $ymin = min($ymin, $y, $ya, $yb); + $xmax = max($xmax, $x, $xa, $xb); + $ymax = max($ymax, $y, $ya, $yb); + if ($relcoord) { + $xoffset = $x; + $yoffset = $y; + } + } + } + break; + } + case 'A': { // elliptical arc + foreach ($params as $ck => $cp) { + $params[$ck] = $cp; + if ((($ck + 1) % 7) == 0) { + $x0 = $x; + $y0 = $y; + $rx = max(abs($params[($ck - 6)]), .000000001); + $ry = max(abs($params[($ck - 5)]), .000000001); + $ang = -$rawparams[($ck - 4)]; + $angle = deg2rad($ang); + $fa = $rawparams[($ck - 3)]; // large-arc-flag + $fs = $rawparams[($ck - 2)]; // sweep-flag + $x = $params[($ck - 1)] + $xoffset; + $y = $params[$ck] + $yoffset; + if ((abs($x0 - $x) < $minlen) AND (abs($y0 - $y) < $minlen)) { + // endpoints are almost identical + $xmin = min($xmin, $x); + $ymin = min($ymin, $y); + $xmax = max($xmax, $x); + $ymax = max($ymax, $y); + } else { + $cos_ang = cos($angle); + $sin_ang = sin($angle); + $a = (($x0 - $x) / 2); + $b = (($y0 - $y) / 2); + $xa = ($a * $cos_ang) - ($b * $sin_ang); + $ya = ($a * $sin_ang) + ($b * $cos_ang); + $rx2 = $rx * $rx; + $ry2 = $ry * $ry; + $xa2 = $xa * $xa; + $ya2 = $ya * $ya; + $delta = ($xa2 / $rx2) + ($ya2 / $ry2); + if ($delta > 1) { + $rx *= sqrt($delta); + $ry *= sqrt($delta); + $rx2 = $rx * $rx; + $ry2 = $ry * $ry; + } + $numerator = (($rx2 * $ry2) - ($rx2 * $ya2) - ($ry2 * $xa2)); + if ($numerator < 0) { + $root = 0; + } else { + $root = sqrt($numerator / (($rx2 * $ya2) + ($ry2 * $xa2))); + } + if ($fa == $fs){ + $root *= -1; + } + $cax = $root * (($rx * $ya) / $ry); + $cay = -$root * (($ry * $xa) / $rx); + // coordinates of ellipse center + $cx = ($cax * $cos_ang) - ($cay * $sin_ang) + (($x0 + $x) / 2); + $cy = ($cax * $sin_ang) + ($cay * $cos_ang) + (($y0 + $y) / 2); + // get angles + $angs = TCPDF_STATIC::getVectorsAngle(1, 0, (($xa - $cax) / $rx), (($cay - $ya) / $ry)); + $dang = TCPDF_STATIC::getVectorsAngle((($xa - $cax) / $rx), (($ya - $cay) / $ry), ((-$xa - $cax) / $rx), ((-$ya - $cay) / $ry)); + if (($fs == 0) AND ($dang > 0)) { + $dang -= (2 * M_PI); + } elseif (($fs == 1) AND ($dang < 0)) { + $dang += (2 * M_PI); + } + $angf = $angs - $dang; + if ((($fs == 0) AND ($angs > $angf)) OR (($fs == 1) AND ($angs < $angf))) { + // reverse angles + $tmp = $angs; + $angs = $angf; + $angf = $tmp; + } + $angs = round(rad2deg($angs), 6); + $angf = round(rad2deg($angf), 6); + // covent angles to positive values + if (($angs < 0) AND ($angf < 0)) { + $angs += 360; + $angf += 360; + } + $pie = false; + if (($key == 0) AND (isset($paths[($key + 1)][1])) AND (trim($paths[($key + 1)][1]) == 'z')) { + $pie = true; + } + list($axmin, $aymin, $axmax, $aymax) = $this->_outellipticalarc($cx, $cy, $rx, $ry, $ang, $angs, $angf, $pie, 2, false, ($fs == 0), true); + $xmin = min($xmin, $x, $axmin); + $ymin = min($ymin, $y, $aymin); + $xmax = max($xmax, $x, $axmax); + $ymax = max($ymax, $y, $aymax); + } + if ($relcoord) { + $xoffset = $x; + $yoffset = $y; + } + } + } + break; + } + case 'Z': { + $this->_out('h'); + $x = $x0 = $xinitial; + $y = $y0 = $yinitial; + break; + } + } + $firstcmd = false; + } // end foreach + $this->_out($op); + return array($xmin, $ymin, ($xmax - $xmin), ($ymax - $ymin)); + } + + /** + * Return the tag name without the namespace + * @param string $name Tag name + * @protected + */ + protected function removeTagNamespace($name) { + if(strpos($name, ':') !== false) { + $parts = explode(':', $name); + return $parts[(sizeof($parts) - 1)]; + } + return $name; + } + + /** + * Sets the opening SVG element handler function for the XML parser. (*** TO BE COMPLETED ***) + * @param resource|string $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. + * @param array $attribs The third parameter, attribs, contains an associative array with the element's attributes (if any). The keys of this array are the attribute names, the values are the attribute values. Attribute names are case-folded on the same criteria as element names. Attribute values are not case-folded. The original order of the attributes can be retrieved by walking through attribs the normal way, using each(). The first key in the array was the first attribute, and so on. + * @param array $ctm tranformation matrix for clipping mode (starting transformation matrix). + * @author Nicola Asuni + * @since 5.0.000 (2010-05-02) + * @protected + */ + protected function startSVGElementHandler($parser, $name, $attribs, $ctm=array()) { + $name = $this->removeTagNamespace($name); + // check if we are in clip mode + if ($this->svgclipmode) { + $this->svgclippaths[$this->svgclipid][] = array('name' => $name, 'attribs' => $attribs, 'tm' => $this->svgcliptm[$this->svgclipid]); + return; + } + if ($this->svgdefsmode AND !in_array($name, array('clipPath', 'linearGradient', 'radialGradient', 'stop'))) { + if (isset($attribs['id'])) { + $attribs['child_elements'] = array(); + $this->svgdefs[$attribs['id']] = array('name' => $name, 'attribs' => $attribs); + return; + } + if (end($this->svgdefs) !== FALSE) { + $last_svgdefs_id = key($this->svgdefs); + if (isset($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'])) { + $attribs['id'] = 'DF_'.(count($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements']) + 1); + $this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'][$attribs['id']] = array('name' => $name, 'attribs' => $attribs); + return; + } + } + return; + } + $clipping = false; + if ($parser == 'clip-path') { + // set clipping mode + $clipping = true; + } + // get styling properties + $prev_svgstyle = $this->svgstyles[max(0,(count($this->svgstyles) - 1))]; // previous style + $svgstyle = $this->svgstyles[0]; // set default style + if ($clipping AND !isset($attribs['fill']) AND (!isset($attribs['style']) OR (!preg_match('/[;\"\s]{1}fill[\s]*:[\s]*([^;\"]*)/si', $attribs['style'], $attrval)))) { + // default fill attribute for clipping + $attribs['fill'] = 'none'; + } + if (isset($attribs['style']) AND !TCPDF_STATIC::empty_string($attribs['style']) AND ($attribs['style'][0] != ';')) { + // fix style for regular expression + $attribs['style'] = ';'.$attribs['style']; + } + foreach ($prev_svgstyle as $key => $val) { + if (in_array($key, TCPDF_IMAGES::$svginheritprop)) { + // inherit previous value + $svgstyle[$key] = $val; + } + if (isset($attribs[$key]) AND !TCPDF_STATIC::empty_string($attribs[$key])) { + // specific attribute settings + if ($attribs[$key] == 'inherit') { + $svgstyle[$key] = $val; + } else { + $svgstyle[$key] = $attribs[$key]; + } + } elseif (isset($attribs['style']) AND !TCPDF_STATIC::empty_string($attribs['style'])) { + // CSS style syntax + $attrval = array(); + if (preg_match('/[;\"\s]{1}'.$key.'[\s]*:[\s]*([^;\"]*)/si', $attribs['style'], $attrval) AND isset($attrval[1])) { + if ($attrval[1] == 'inherit') { + $svgstyle[$key] = $val; + } else { + $svgstyle[$key] = $attrval[1]; + } + } + } + } + // transformation matrix + if (!empty($ctm)) { + $tm = $ctm; + } else { + $tm = array(1,0,0,1,0,0); + } + if (isset($attribs['transform']) AND !empty($attribs['transform'])) { + $tm = TCPDF_STATIC::getTransformationMatrixProduct($tm, TCPDF_STATIC::getSVGTransformMatrix($attribs['transform'])); + } + $svgstyle['transfmatrix'] = $tm; + $invisible = false; + if (($svgstyle['visibility'] == 'hidden') OR ($svgstyle['visibility'] == 'collapse') OR ($svgstyle['display'] == 'none')) { + // the current graphics element is invisible (nothing is painted) + $invisible = true; + } + // process tag + switch($name) { + case 'defs': { + $this->svgdefsmode = true; + break; + } + // clipPath + case 'clipPath': { + if ($invisible) { + break; + } + $this->svgclipmode = true; + if (!isset($attribs['id'])) { + $attribs['id'] = 'CP_'.(count($this->svgcliptm) + 1); + } + $this->svgclipid = $attribs['id']; + $this->svgclippaths[$this->svgclipid] = array(); + $this->svgcliptm[$this->svgclipid] = $tm; + break; + } + case 'svg': { + // start of SVG object + if(++$this->svg_tag_depth <= 1) { + break; + } + // inner SVG + array_push($this->svgstyles, $svgstyle); + $this->StartTransform(); + $svgX = (isset($attribs['x'])?$attribs['x']:0); + $svgY = (isset($attribs['y'])?$attribs['y']:0); + $svgW = (isset($attribs['width'])?$attribs['width']:0); + $svgH = (isset($attribs['height'])?$attribs['height']:0); + // set x, y position using transform matrix + $tm = TCPDF_STATIC::getTransformationMatrixProduct($tm, array( 1, 0, 0, 1, $svgX, $svgY)); + $this->SVGTransform($tm); + // set clipping for width and height + $x = 0; + $y = 0; + $w = (isset($attribs['width'])?$this->getHTMLUnitToUnits($attribs['width'], 0, $this->svgunit, false):$this->w); + $h = (isset($attribs['height'])?$this->getHTMLUnitToUnits($attribs['height'], 0, $this->svgunit, false):$this->h); + // draw clipping rect + $this->Rect($x, $y, $w, $h, 'CNZ', array(), array()); + // parse viewbox, calculate extra transformation matrix + if (isset($attribs['viewBox'])) { + $tmp = array(); + preg_match_all("/[0-9]+/", $attribs['viewBox'], $tmp); + $tmp = $tmp[0]; + if (sizeof($tmp) == 4) { + $vx = $tmp[0]; + $vy = $tmp[1]; + $vw = $tmp[2]; + $vh = $tmp[3]; + // get aspect ratio + $tmp = array(); + $aspectX = 'xMid'; + $aspectY = 'YMid'; + $fit = 'meet'; + if (isset($attribs['preserveAspectRatio'])) { + if($attribs['preserveAspectRatio'] == 'none') { + $fit = 'none'; + } else { + preg_match_all('/[a-zA-Z]+/', $attribs['preserveAspectRatio'], $tmp); + $tmp = $tmp[0]; + if ((sizeof($tmp) == 2) AND (strlen($tmp[0]) == 8) AND (in_array($tmp[1], array('meet', 'slice', 'none')))) { + $aspectX = substr($tmp[0], 0, 4); + $aspectY = substr($tmp[0], 4, 4); + $fit = $tmp[1]; + } + } + } + $wr = ($svgW / $vw); + $hr = ($svgH / $vh); + $ax = $ay = 0; + if ((($fit == 'meet') AND ($hr < $wr)) OR (($fit == 'slice') AND ($hr > $wr))) { + if ($aspectX == 'xMax') { + $ax = (($vw * ($wr / $hr)) - $vw); + } + if ($aspectX == 'xMid') { + $ax = ((($vw * ($wr / $hr)) - $vw) / 2); + } + $wr = $hr; + } elseif ((($fit == 'meet') AND ($hr > $wr)) OR (($fit == 'slice') AND ($hr < $wr))) { + if ($aspectY == 'YMax') { + $ay = (($vh * ($hr / $wr)) - $vh); + } + if ($aspectY == 'YMid') { + $ay = ((($vh * ($hr / $wr)) - $vh) / 2); + } + $hr = $wr; + } + $newtm = array($wr, 0, 0, $hr, (($wr * ($ax - $vx)) - $svgX), (($hr * ($ay - $vy)) - $svgY)); + $tm = TCPDF_STATIC::getTransformationMatrixProduct($tm, $newtm); + $this->SVGTransform($tm); + } + } + $this->setSVGStyles($svgstyle, $prev_svgstyle); + break; + } + case 'g': { + // group together related graphics elements + array_push($this->svgstyles, $svgstyle); + $this->StartTransform(); + $x = (isset($attribs['x'])?$attribs['x']:0); + $y = (isset($attribs['y'])?$attribs['y']:0); + $w = 1;//(isset($attribs['width'])?$attribs['width']:1); + $h = 1;//(isset($attribs['height'])?$attribs['height']:1); + $tm = TCPDF_STATIC::getTransformationMatrixProduct($tm, array($w, 0, 0, $h, $x, $y)); + $this->SVGTransform($tm); + $this->setSVGStyles($svgstyle, $prev_svgstyle); + break; + } + case 'linearGradient': { + if ($this->pdfa_mode && $this->pdfa_version < 2) { + break; + } + if (!isset($attribs['id'])) { + $attribs['id'] = 'GR_'.(count($this->svggradients) + 1); + } + $this->svggradientid = $attribs['id']; + $this->svggradients[$this->svggradientid] = array(); + $this->svggradients[$this->svggradientid]['type'] = 2; + $this->svggradients[$this->svggradientid]['stops'] = array(); + if (isset($attribs['gradientUnits'])) { + $this->svggradients[$this->svggradientid]['gradientUnits'] = $attribs['gradientUnits']; + } else { + $this->svggradients[$this->svggradientid]['gradientUnits'] = 'objectBoundingBox'; + } + //$attribs['spreadMethod'] + if (((!isset($attribs['x1'])) AND (!isset($attribs['y1'])) AND (!isset($attribs['x2'])) AND (!isset($attribs['y2']))) + OR ((isset($attribs['x1']) AND (substr($attribs['x1'], -1) == '%')) + OR (isset($attribs['y1']) AND (substr($attribs['y1'], -1) == '%')) + OR (isset($attribs['x2']) AND (substr($attribs['x2'], -1) == '%')) + OR (isset($attribs['y2']) AND (substr($attribs['y2'], -1) == '%')))) { + $this->svggradients[$this->svggradientid]['mode'] = 'percentage'; + } else { + $this->svggradients[$this->svggradientid]['mode'] = 'measure'; + } + $x1 = (isset($attribs['x1'])?$attribs['x1']:'0'); + $y1 = (isset($attribs['y1'])?$attribs['y1']:'0'); + $x2 = (isset($attribs['x2'])?$attribs['x2']:'100'); + $y2 = (isset($attribs['y2'])?$attribs['y2']:'0'); + if (isset($attribs['gradientTransform'])) { + $this->svggradients[$this->svggradientid]['gradientTransform'] = TCPDF_STATIC::getSVGTransformMatrix($attribs['gradientTransform']); + } + $this->svggradients[$this->svggradientid]['coords'] = array($x1, $y1, $x2, $y2); + if (isset($attribs['xlink:href']) AND !empty($attribs['xlink:href'])) { + // gradient is defined on another place + $this->svggradients[$this->svggradientid]['xref'] = substr($attribs['xlink:href'], 1); + } + break; + } + case 'radialGradient': { + if ($this->pdfa_mode && $this->pdfa_version < 2) { + break; + } + if (!isset($attribs['id'])) { + $attribs['id'] = 'GR_'.(count($this->svggradients) + 1); + } + $this->svggradientid = $attribs['id']; + $this->svggradients[$this->svggradientid] = array(); + $this->svggradients[$this->svggradientid]['type'] = 3; + $this->svggradients[$this->svggradientid]['stops'] = array(); + if (isset($attribs['gradientUnits'])) { + $this->svggradients[$this->svggradientid]['gradientUnits'] = $attribs['gradientUnits']; + } else { + $this->svggradients[$this->svggradientid]['gradientUnits'] = 'objectBoundingBox'; + } + //$attribs['spreadMethod'] + if (((!isset($attribs['cx'])) AND (!isset($attribs['cy']))) + OR ((isset($attribs['cx']) AND (substr($attribs['cx'], -1) == '%')) + OR (isset($attribs['cy']) AND (substr($attribs['cy'], -1) == '%')))) { + $this->svggradients[$this->svggradientid]['mode'] = 'percentage'; + } elseif (isset($attribs['r']) AND is_numeric($attribs['r']) AND ($attribs['r']) <= 1) { + $this->svggradients[$this->svggradientid]['mode'] = 'ratio'; + } else { + $this->svggradients[$this->svggradientid]['mode'] = 'measure'; + } + $cx = (isset($attribs['cx']) ? $attribs['cx'] : 0.5); + $cy = (isset($attribs['cy']) ? $attribs['cy'] : 0.5); + $fx = (isset($attribs['fx']) ? $attribs['fx'] : $cx); + $fy = (isset($attribs['fy']) ? $attribs['fy'] : $cy); + $r = (isset($attribs['r']) ? $attribs['r'] : 0.5); + if (isset($attribs['gradientTransform'])) { + $this->svggradients[$this->svggradientid]['gradientTransform'] = TCPDF_STATIC::getSVGTransformMatrix($attribs['gradientTransform']); + } + $this->svggradients[$this->svggradientid]['coords'] = array($cx, $cy, $fx, $fy, $r); + if (isset($attribs['xlink:href']) AND !empty($attribs['xlink:href'])) { + // gradient is defined on another place + $this->svggradients[$this->svggradientid]['xref'] = substr($attribs['xlink:href'], 1); + } + break; + } + case 'stop': { + // gradient stops + if (substr($attribs['offset'], -1) == '%') { + $offset = floatval(substr($attribs['offset'], 0, -1)) / 100; + } else { + $offset = floatval($attribs['offset']); + if ($offset > 1) { + $offset /= 100; + } + } + $stop_color = isset($svgstyle['stop-color'])?TCPDF_COLORS::convertHTMLColorToDec($svgstyle['stop-color'], $this->spot_colors):'black'; + $opacity = isset($svgstyle['stop-opacity'])?$svgstyle['stop-opacity']:1; + $this->svggradients[$this->svggradientid]['stops'][] = array('offset' => $offset, 'color' => $stop_color, 'opacity' => $opacity); + break; + } + // paths + case 'path': { + if ($invisible) { + break; + } + if (isset($attribs['d'])) { + $d = trim($attribs['d']); + if (!empty($d)) { + $x = (isset($attribs['x'])?$attribs['x']:0); + $y = (isset($attribs['y'])?$attribs['y']:0); + $w = (isset($attribs['width'])?$attribs['width']:1); + $h = (isset($attribs['height'])?$attribs['height']:1); + $tm = TCPDF_STATIC::getTransformationMatrixProduct($tm, array($w, 0, 0, $h, $x, $y)); + if ($clipping) { + $this->SVGTransform($tm); + $this->SVGPath($d, 'CNZ'); + } else { + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'SVGPath', array($d, 'CNZ')); + if (!empty($obstyle)) { + $this->SVGPath($d, $obstyle); + } + $this->StopTransform(); + } + } + } + break; + } + // shapes + case 'rect': { + if ($invisible) { + break; + } + $x = (isset($attribs['x'])?$this->getHTMLUnitToUnits($attribs['x'], 0, $this->svgunit, false):0); + $y = (isset($attribs['y'])?$this->getHTMLUnitToUnits($attribs['y'], 0, $this->svgunit, false):0); + $w = (isset($attribs['width'])?$this->getHTMLUnitToUnits($attribs['width'], 0, $this->svgunit, false):0); + $h = (isset($attribs['height'])?$this->getHTMLUnitToUnits($attribs['height'], 0, $this->svgunit, false):0); + $rx = (isset($attribs['rx'])?$this->getHTMLUnitToUnits($attribs['rx'], 0, $this->svgunit, false):0); + $ry = (isset($attribs['ry'])?$this->getHTMLUnitToUnits($attribs['ry'], 0, $this->svgunit, false):$rx); + if ($clipping) { + $this->SVGTransform($tm); + $this->RoundedRectXY($x, $y, $w, $h, $rx, $ry, '1111', 'CNZ', array(), array()); + } else { + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'RoundedRectXY', array($x, $y, $w, $h, $rx, $ry, '1111', 'CNZ')); + if (!empty($obstyle)) { + $this->RoundedRectXY($x, $y, $w, $h, $rx, $ry, '1111', $obstyle, array(), array()); + } + $this->StopTransform(); + } + break; + } + case 'circle': { + if ($invisible) { + break; + } + $r = (isset($attribs['r']) ? $this->getHTMLUnitToUnits($attribs['r'], 0, $this->svgunit, false) : 0); + $cx = (isset($attribs['cx']) ? $this->getHTMLUnitToUnits($attribs['cx'], 0, $this->svgunit, false) : (isset($attribs['x']) ? $this->getHTMLUnitToUnits($attribs['x'], 0, $this->svgunit, false) : 0)); + $cy = (isset($attribs['cy']) ? $this->getHTMLUnitToUnits($attribs['cy'], 0, $this->svgunit, false) : (isset($attribs['y']) ? $this->getHTMLUnitToUnits($attribs['y'], 0, $this->svgunit, false) : 0)); + $x = ($cx - $r); + $y = ($cy - $r); + $w = (2 * $r); + $h = $w; + if ($clipping) { + $this->SVGTransform($tm); + $this->Circle($cx, $cy, $r, 0, 360, 'CNZ', array(), array(), 8); + } else { + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'Circle', array($cx, $cy, $r, 0, 360, 'CNZ')); + if (!empty($obstyle)) { + $this->Circle($cx, $cy, $r, 0, 360, $obstyle, array(), array(), 8); + } + $this->StopTransform(); + } + break; + } + case 'ellipse': { + if ($invisible) { + break; + } + $rx = (isset($attribs['rx']) ? $this->getHTMLUnitToUnits($attribs['rx'], 0, $this->svgunit, false) : 0); + $ry = (isset($attribs['ry']) ? $this->getHTMLUnitToUnits($attribs['ry'], 0, $this->svgunit, false) : 0); + $cx = (isset($attribs['cx']) ? $this->getHTMLUnitToUnits($attribs['cx'], 0, $this->svgunit, false) : (isset($attribs['x']) ? $this->getHTMLUnitToUnits($attribs['x'], 0, $this->svgunit, false) : 0)); + $cy = (isset($attribs['cy']) ? $this->getHTMLUnitToUnits($attribs['cy'], 0, $this->svgunit, false) : (isset($attribs['y']) ? $this->getHTMLUnitToUnits($attribs['y'], 0, $this->svgunit, false) : 0)); + $x = ($cx - $rx); + $y = ($cy - $ry); + $w = (2 * $rx); + $h = (2 * $ry); + if ($clipping) { + $this->SVGTransform($tm); + $this->Ellipse($cx, $cy, $rx, $ry, 0, 0, 360, 'CNZ', array(), array(), 8); + } else { + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'Ellipse', array($cx, $cy, $rx, $ry, 0, 0, 360, 'CNZ')); + if (!empty($obstyle)) { + $this->Ellipse($cx, $cy, $rx, $ry, 0, 0, 360, $obstyle, array(), array(), 8); + } + $this->StopTransform(); + } + break; + } + case 'line': { + if ($invisible) { + break; + } + $x1 = (isset($attribs['x1'])?$this->getHTMLUnitToUnits($attribs['x1'], 0, $this->svgunit, false):0); + $y1 = (isset($attribs['y1'])?$this->getHTMLUnitToUnits($attribs['y1'], 0, $this->svgunit, false):0); + $x2 = (isset($attribs['x2'])?$this->getHTMLUnitToUnits($attribs['x2'], 0, $this->svgunit, false):0); + $y2 = (isset($attribs['y2'])?$this->getHTMLUnitToUnits($attribs['y2'], 0, $this->svgunit, false):0); + $x = $x1; + $y = $y1; + $w = abs($x2 - $x1); + $h = abs($y2 - $y1); + if (!$clipping) { + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'Line', array($x1, $y1, $x2, $y2)); + $this->Line($x1, $y1, $x2, $y2); + $this->StopTransform(); + } + break; + } + case 'polyline': + case 'polygon': { + if ($invisible) { + break; + } + $points = (isset($attribs['points'])?$attribs['points']:'0 0'); + $points = trim($points); + // note that point may use a complex syntax not covered here + $points = preg_split('/[\,\s]+/si', $points); + if (count($points) < 4) { + break; + } + $p = array(); + $xmin = 2147483647; + $xmax = 0; + $ymin = 2147483647; + $ymax = 0; + foreach ($points as $key => $val) { + $p[$key] = $this->getHTMLUnitToUnits($val, 0, $this->svgunit, false); + if (($key % 2) == 0) { + // X coordinate + $xmin = min($xmin, $p[$key]); + $xmax = max($xmax, $p[$key]); + } else { + // Y coordinate + $ymin = min($ymin, $p[$key]); + $ymax = max($ymax, $p[$key]); + } + } + $x = $xmin; + $y = $ymin; + $w = ($xmax - $xmin); + $h = ($ymax - $ymin); + if ($name == 'polyline') { + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'PolyLine', array($p, 'CNZ')); + if (!empty($obstyle)) { + $this->PolyLine($p, $obstyle, array(), array()); + } + $this->StopTransform(); + } else { // polygon + if ($clipping) { + $this->SVGTransform($tm); + $this->Polygon($p, 'CNZ', array(), array(), true); + } else { + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h, 'Polygon', array($p, 'CNZ')); + if (!empty($obstyle)) { + $this->Polygon($p, $obstyle, array(), array(), true); + } + $this->StopTransform(); + } + } + break; + } + // image + case 'image': { + if ($invisible) { + break; + } + if (!isset($attribs['xlink:href']) OR empty($attribs['xlink:href'])) { + break; + } + $x = (isset($attribs['x'])?$this->getHTMLUnitToUnits($attribs['x'], 0, $this->svgunit, false):0); + $y = (isset($attribs['y'])?$this->getHTMLUnitToUnits($attribs['y'], 0, $this->svgunit, false):0); + $w = (isset($attribs['width'])?$this->getHTMLUnitToUnits($attribs['width'], 0, $this->svgunit, false):0); + $h = (isset($attribs['height'])?$this->getHTMLUnitToUnits($attribs['height'], 0, $this->svgunit, false):0); + $img = $attribs['xlink:href']; + if (!$clipping) { + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, $w, $h); + if (preg_match('/^data:image\/[^;]+;base64,/', $img, $m) > 0) { + // embedded image encoded as base64 + $img = '@'.base64_decode(substr($img, strlen($m[0]))); + } else { + // fix image path + if (!TCPDF_STATIC::empty_string($this->svgdir) AND (($img[0] == '.') OR (basename($img) == $img))) { + // replace relative path with full server path + $img = $this->svgdir.'/'.$img; + } + if (($img[0] == '/') AND !empty($_SERVER['DOCUMENT_ROOT']) AND ($_SERVER['DOCUMENT_ROOT'] != '/')) { + $findroot = strpos($img, $_SERVER['DOCUMENT_ROOT']); + if (($findroot === false) OR ($findroot > 1)) { + if (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/') { + $img = substr($_SERVER['DOCUMENT_ROOT'], 0, -1).$img; + } else { + $img = $_SERVER['DOCUMENT_ROOT'].$img; + } + } + } + $img = urldecode($img); + $testscrtype = @parse_url($img); + if (empty($testscrtype['query'])) { + // convert URL to server path + $img = str_replace(K_PATH_URL, K_PATH_MAIN, $img); + } elseif (preg_match('|^https?://|', $img) !== 1) { + // convert server path to URL + $img = str_replace(K_PATH_MAIN, K_PATH_URL, $img); + } + } + // get image type + $imgtype = TCPDF_IMAGES::getImageFileType($img); + if (($imgtype == 'eps') OR ($imgtype == 'ai')) { + $this->ImageEps($img, $x, $y, $w, $h); + } elseif ($imgtype == 'svg') { + // store SVG vars + $svggradients = $this->svggradients; + $svggradientid = $this->svggradientid; + $svgdefsmode = $this->svgdefsmode; + $svgdefs = $this->svgdefs; + $svgclipmode = $this->svgclipmode; + $svgclippaths = $this->svgclippaths; + $svgcliptm = $this->svgcliptm; + $svgclipid = $this->svgclipid; + $svgtext = $this->svgtext; + $svgtextmode = $this->svgtextmode; + $this->ImageSVG($img, $x, $y, $w, $h); + // restore SVG vars + $this->svggradients = $svggradients; + $this->svggradientid = $svggradientid; + $this->svgdefsmode = $svgdefsmode; + $this->svgdefs = $svgdefs; + $this->svgclipmode = $svgclipmode; + $this->svgclippaths = $svgclippaths; + $this->svgcliptm = $svgcliptm; + $this->svgclipid = $svgclipid; + $this->svgtext = $svgtext; + $this->svgtextmode = $svgtextmode; + } else { + $this->Image($img, $x, $y, $w, $h); + } + $this->StopTransform(); + } + break; + } + // text + case 'text': + case 'tspan': { + if (isset($this->svgtextmode['text-anchor']) AND !empty($this->svgtext)) { + // @TODO: unsupported feature + } + // only basic support - advanced features must be implemented + $this->svgtextmode['invisible'] = $invisible; + if ($invisible) { + break; + } + array_push($this->svgstyles, $svgstyle); + if (isset($attribs['x'])) { + $x = $this->getHTMLUnitToUnits($attribs['x'], 0, $this->svgunit, false); + } elseif ($name == 'tspan') { + $x = $this->x; + } else { + $x = 0; + } + if (isset($attribs['dx'])) { + $x += $this->getHTMLUnitToUnits($attribs['dx'], 0, $this->svgunit, false); + } + if (isset($attribs['y'])) { + $y = $this->getHTMLUnitToUnits($attribs['y'], 0, $this->svgunit, false); + } elseif ($name == 'tspan') { + $y = $this->y; + } else { + $y = 0; + } + if (isset($attribs['dy'])) { + $y += $this->getHTMLUnitToUnits($attribs['dy'], 0, $this->svgunit, false); + } + $svgstyle['text-color'] = $svgstyle['fill']; + $this->svgtext = ''; + if (isset($svgstyle['text-anchor'])) { + $this->svgtextmode['text-anchor'] = $svgstyle['text-anchor']; + } else { + $this->svgtextmode['text-anchor'] = 'start'; + } + if (isset($svgstyle['direction'])) { + if ($svgstyle['direction'] == 'rtl') { + $this->svgtextmode['rtl'] = true; + } else { + $this->svgtextmode['rtl'] = false; + } + } else { + $this->svgtextmode['rtl'] = false; + } + if (isset($svgstyle['stroke']) AND ($svgstyle['stroke'] != 'none') AND isset($svgstyle['stroke-width']) AND ($svgstyle['stroke-width'] > 0)) { + $this->svgtextmode['stroke'] = $this->getHTMLUnitToUnits($svgstyle['stroke-width'], 0, $this->svgunit, false); + } else { + $this->svgtextmode['stroke'] = false; + } + $this->StartTransform(); + $this->SVGTransform($tm); + $obstyle = $this->setSVGStyles($svgstyle, $prev_svgstyle, $x, $y, 1, 1); + $this->x = $x; + $this->y = $y; + break; + } + // use + case 'use': { + if (isset($attribs['xlink:href']) AND !empty($attribs['xlink:href'])) { + $svgdefid = substr($attribs['xlink:href'], 1); + if (isset($this->svgdefs[$svgdefid])) { + $use = $this->svgdefs[$svgdefid]; + if (isset($attribs['xlink:href'])) { + unset($attribs['xlink:href']); + } + if (isset($attribs['id'])) { + unset($attribs['id']); + } + if (isset($use['attribs']['x']) AND isset($attribs['x'])) { + $attribs['x'] += $use['attribs']['x']; + } + if (isset($use['attribs']['y']) AND isset($attribs['y'])) { + $attribs['y'] += $use['attribs']['y']; + } + if (empty($attribs['style'])) { + $attribs['style'] = ''; + } + if (!empty($use['attribs']['style'])) { + // merge styles + $attribs['style'] = str_replace(';;',';',';'.$use['attribs']['style'].$attribs['style']); + } + $attribs = array_merge($use['attribs'], $attribs); + $this->startSVGElementHandler($parser, $use['name'], $attribs); + return; + } + } + break; + } + default: { + break; + } + } // end of switch + // process child elements + if (!empty($attribs['child_elements'])) { + $child_elements = $attribs['child_elements']; + unset($attribs['child_elements']); + foreach($child_elements as $child_element) { + if (empty($child_element['attribs']['closing_tag'])) { + $this->startSVGElementHandler('child-tag', $child_element['name'], $child_element['attribs']); + } else { + if (isset($child_element['attribs']['content'])) { + $this->svgtext = $child_element['attribs']['content']; + } + $this->endSVGElementHandler('child-tag', $child_element['name']); + } + } + } + } + + /** + * Sets the closing SVG element handler function for the XML parser. + * @param resource|string $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $name The second parameter, name, contains the name of the element for which this handler is called. If case-folding is in effect for this parser, the element name will be in uppercase letters. + * @author Nicola Asuni + * @since 5.0.000 (2010-05-02) + * @protected + */ + protected function endSVGElementHandler($parser, $name) { + $name = $this->removeTagNamespace($name); + if ($this->svgdefsmode AND !in_array($name, array('defs', 'clipPath', 'linearGradient', 'radialGradient', 'stop'))) {; + if (end($this->svgdefs) !== FALSE) { + $last_svgdefs_id = key($this->svgdefs); + if (isset($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'])) { + foreach($this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'] as $child_element) { + if (isset($child_element['attribs']['id']) AND ($child_element['name'] == $name)) { + $this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'][$child_element['attribs']['id'].'_CLOSE'] = array('name' => $name, 'attribs' => array('closing_tag' => TRUE, 'content' => $this->svgtext)); + return; + } + } + if ($this->svgdefs[$last_svgdefs_id]['name'] == $name) { + $this->svgdefs[$last_svgdefs_id]['attribs']['child_elements'][$last_svgdefs_id.'_CLOSE'] = array('name' => $name, 'attribs' => array('closing_tag' => TRUE, 'content' => $this->svgtext)); + return; + } + } + } + return; + } + switch($name) { + case 'defs': { + $this->svgdefsmode = false; + break; + } + // clipPath + case 'clipPath': { + $this->svgclipmode = false; + break; + } + case 'svg': { + if (--$this->svg_tag_depth <= 0) { + break; + } + } + case 'g': { + // ungroup: remove last style from array + array_pop($this->svgstyles); + $this->StopTransform(); + break; + } + case 'text': + case 'tspan': { + if ($this->svgtextmode['invisible']) { + // This implementation must be fixed to following the rule: + // If the 'visibility' property is set to hidden on a 'tspan', 'tref' or 'altGlyph' element, then the text is invisible but still takes up space in text layout calculations. + break; + } + // print text + $text = $this->svgtext; + //$text = $this->stringTrim($text); + $textlen = $this->GetStringWidth($text); + if ($this->svgtextmode['text-anchor'] != 'start') { + // check if string is RTL text + if ($this->svgtextmode['text-anchor'] == 'end') { + if ($this->svgtextmode['rtl']) { + $this->x += $textlen; + } else { + $this->x -= $textlen; + } + } elseif ($this->svgtextmode['text-anchor'] == 'middle') { + if ($this->svgtextmode['rtl']) { + $this->x += ($textlen / 2); + } else { + $this->x -= ($textlen / 2); + } + } + } + $textrendermode = $this->textrendermode; + $textstrokewidth = $this->textstrokewidth; + $this->setTextRenderingMode($this->svgtextmode['stroke'], true, false); + if ($name == 'text') { + // store current coordinates + $tmpx = $this->x; + $tmpy = $this->y; + } + // print the text + $this->Cell($textlen, 0, $text, 0, 0, '', false, '', 0, false, 'L', 'T'); + if ($name == 'text') { + // restore coordinates + $this->x = $tmpx; + $this->y = $tmpy; + } + // restore previous rendering mode + $this->textrendermode = $textrendermode; + $this->textstrokewidth = $textstrokewidth; + $this->svgtext = ''; + $this->StopTransform(); + if (!$this->svgdefsmode) { + array_pop($this->svgstyles); + } + break; + } + default: { + break; + } + } + } + + /** + * Sets the character data handler function for the XML parser. + * @param resource $parser The first parameter, parser, is a reference to the XML parser calling the handler. + * @param string $data The second parameter, data, contains the character data as a string. + * @author Nicola Asuni + * @since 5.0.000 (2010-05-02) + * @protected + */ + protected function segSVGContentHandler($parser, $data) { + $this->svgtext .= $data; + } + + // --- END SVG METHODS ----------------------------------------------------- + + /** + * Keeps files in memory, so it doesn't need to downloaded everytime in a loop + * @param string $file + * @return string + */ + protected function getCachedFileContents($file) + { + if (!isset($this->fileContentCache[$file])) { + $this->fileContentCache[$file] = TCPDF_STATIC::fileGetContents($file); + } + return $this->fileContentCache[$file]; + } + + /** + * Avoid multiple calls to an external server to see if a file exists + * @param string $file + * @return bool + */ + protected function fileExists($file) + { + if (isset($this->fileContentCache[$file]) || false !== $this->getImageBuffer($file)) { + return true; + } + + return TCPDF_STATIC::file_exists($file); + } + +} // END OF TCPDF CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_autoconfig.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_autoconfig.php new file mode 100755 index 0000000..6ec9ce8 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_autoconfig.php @@ -0,0 +1,241 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : Try to automatically configure some TCPDF +// constants if not defined. +// +//============================================================+ + +/** + * @file + * Try to automatically configure some TCPDF constants if not defined. + * @package com.tecnick.tcpdf + * @version 1.1.1 + */ + +// DOCUMENT_ROOT fix for IIS Webserver +if ((!isset($_SERVER['DOCUMENT_ROOT'])) OR (empty($_SERVER['DOCUMENT_ROOT']))) { + if(isset($_SERVER['SCRIPT_FILENAME'])) { + $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr($_SERVER['SCRIPT_FILENAME'], 0, 0-strlen($_SERVER['PHP_SELF']))); + } elseif(isset($_SERVER['PATH_TRANSLATED'])) { + $_SERVER['DOCUMENT_ROOT'] = str_replace( '\\', '/', substr(str_replace('\\\\', '\\', $_SERVER['PATH_TRANSLATED']), 0, 0-strlen($_SERVER['PHP_SELF']))); + } else { + // define here your DOCUMENT_ROOT path if the previous fails (e.g. '/var/www') + $_SERVER['DOCUMENT_ROOT'] = '/'; + } +} +$_SERVER['DOCUMENT_ROOT'] = str_replace('//', '/', $_SERVER['DOCUMENT_ROOT']); +if (substr($_SERVER['DOCUMENT_ROOT'], -1) != '/') { + $_SERVER['DOCUMENT_ROOT'] .= '/'; +} + +// Load main configuration file only if the K_TCPDF_EXTERNAL_CONFIG constant is set to false. +if (!defined('K_TCPDF_EXTERNAL_CONFIG') OR !K_TCPDF_EXTERNAL_CONFIG) { + // define a list of default config files in order of priority + $tcpdf_config_files = array(dirname(__FILE__).'/config/tcpdf_config.php', '/etc/php-tcpdf/tcpdf_config.php', '/etc/tcpdf/tcpdf_config.php', '/etc/tcpdf_config.php'); + foreach ($tcpdf_config_files as $tcpdf_config) { + if (@file_exists($tcpdf_config) AND is_readable($tcpdf_config)) { + require_once($tcpdf_config); + break; + } + } +} + +if (!defined('K_PATH_MAIN')) { + define ('K_PATH_MAIN', dirname(__FILE__).'/'); +} + +if (!defined('K_PATH_FONTS')) { + define ('K_PATH_FONTS', K_PATH_MAIN.'fonts/'); +} + +if (!defined('K_PATH_URL')) { + $k_path_url = K_PATH_MAIN; // default value for console mode + if (isset($_SERVER['HTTP_HOST']) AND (!empty($_SERVER['HTTP_HOST']))) { + if(isset($_SERVER['HTTPS']) AND (!empty($_SERVER['HTTPS'])) AND (strtolower($_SERVER['HTTPS']) != 'off')) { + $k_path_url = 'https://'; + } else { + $k_path_url = 'http://'; + } + $k_path_url .= $_SERVER['HTTP_HOST']; + $k_path_url .= str_replace( '\\', '/', substr(K_PATH_MAIN, (strlen($_SERVER['DOCUMENT_ROOT']) - 1))); + } + define ('K_PATH_URL', $k_path_url); +} + +if (!defined('K_PATH_IMAGES')) { + $tcpdf_images_dirs = array(K_PATH_MAIN.'examples/images/', K_PATH_MAIN.'images/', '/usr/share/doc/php-tcpdf/examples/images/', '/usr/share/doc/tcpdf/examples/images/', '/usr/share/doc/php/tcpdf/examples/images/', '/var/www/tcpdf/images/', '/var/www/html/tcpdf/images/', '/usr/local/apache2/htdocs/tcpdf/images/', K_PATH_MAIN); + foreach ($tcpdf_images_dirs as $tcpdf_images_path) { + if (@file_exists($tcpdf_images_path)) { + define ('K_PATH_IMAGES', $tcpdf_images_path); + break; + } + } +} + +if (!defined('PDF_HEADER_LOGO')) { + $tcpdf_header_logo = ''; + if (@file_exists(K_PATH_IMAGES.'tcpdf_logo.jpg')) { + $tcpdf_header_logo = 'tcpdf_logo.jpg'; + } + define ('PDF_HEADER_LOGO', $tcpdf_header_logo); +} + +if (!defined('PDF_HEADER_LOGO_WIDTH')) { + if (!empty($tcpdf_header_logo)) { + define ('PDF_HEADER_LOGO_WIDTH', 30); + } else { + define ('PDF_HEADER_LOGO_WIDTH', 0); + } +} + +if (!defined('K_PATH_CACHE')) { + $K_PATH_CACHE = ini_get('upload_tmp_dir') ? ini_get('upload_tmp_dir') : sys_get_temp_dir(); + if (substr($K_PATH_CACHE, -1) != '/') { + $K_PATH_CACHE .= '/'; + } + define ('K_PATH_CACHE', $K_PATH_CACHE); +} + +if (!defined('K_BLANK_IMAGE')) { + define ('K_BLANK_IMAGE', '_blank.png'); +} + +if (!defined('PDF_PAGE_FORMAT')) { + define ('PDF_PAGE_FORMAT', 'A4'); +} + +if (!defined('PDF_PAGE_ORIENTATION')) { + define ('PDF_PAGE_ORIENTATION', 'P'); +} + +if (!defined('PDF_CREATOR')) { + define ('PDF_CREATOR', 'TCPDF'); +} + +if (!defined('PDF_AUTHOR')) { + define ('PDF_AUTHOR', 'TCPDF'); +} + +if (!defined('PDF_HEADER_TITLE')) { + define ('PDF_HEADER_TITLE', 'TCPDF Example'); +} + +if (!defined('PDF_HEADER_STRING')) { + define ('PDF_HEADER_STRING', "by Nicola Asuni - Tecnick.com\nwww.tcpdf.org"); +} + +if (!defined('PDF_UNIT')) { + define ('PDF_UNIT', 'mm'); +} + +if (!defined('PDF_MARGIN_HEADER')) { + define ('PDF_MARGIN_HEADER', 5); +} + +if (!defined('PDF_MARGIN_FOOTER')) { + define ('PDF_MARGIN_FOOTER', 10); +} + +if (!defined('PDF_MARGIN_TOP')) { + define ('PDF_MARGIN_TOP', 27); +} + +if (!defined('PDF_MARGIN_BOTTOM')) { + define ('PDF_MARGIN_BOTTOM', 25); +} + +if (!defined('PDF_MARGIN_LEFT')) { + define ('PDF_MARGIN_LEFT', 15); +} + +if (!defined('PDF_MARGIN_RIGHT')) { + define ('PDF_MARGIN_RIGHT', 15); +} + +if (!defined('PDF_FONT_NAME_MAIN')) { + define ('PDF_FONT_NAME_MAIN', 'helvetica'); +} + +if (!defined('PDF_FONT_SIZE_MAIN')) { + define ('PDF_FONT_SIZE_MAIN', 10); +} + +if (!defined('PDF_FONT_NAME_DATA')) { + define ('PDF_FONT_NAME_DATA', 'helvetica'); +} + +if (!defined('PDF_FONT_SIZE_DATA')) { + define ('PDF_FONT_SIZE_DATA', 8); +} + +if (!defined('PDF_FONT_MONOSPACED')) { + define ('PDF_FONT_MONOSPACED', 'courier'); +} + +if (!defined('PDF_IMAGE_SCALE_RATIO')) { + define ('PDF_IMAGE_SCALE_RATIO', 1.25); +} + +if (!defined('HEAD_MAGNIFICATION')) { + define('HEAD_MAGNIFICATION', 1.1); +} + +if (!defined('K_CELL_HEIGHT_RATIO')) { + define('K_CELL_HEIGHT_RATIO', 1.25); +} + +if (!defined('K_TITLE_MAGNIFICATION')) { + define('K_TITLE_MAGNIFICATION', 1.3); +} + +if (!defined('K_SMALL_RATIO')) { + define('K_SMALL_RATIO', 2/3); +} + +if (!defined('K_THAI_TOPCHARS')) { + define('K_THAI_TOPCHARS', true); +} + +if (!defined('K_TCPDF_CALLS_IN_HTML')) { + define('K_TCPDF_CALLS_IN_HTML', false); +} + +if (!defined('K_TCPDF_THROW_EXCEPTION_ERROR')) { + define('K_TCPDF_THROW_EXCEPTION_ERROR', false); +} + +if (!defined('K_TIMEZONE')) { + define('K_TIMEZONE', @date_default_timezone_get()); +} + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_barcodes_1d.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_barcodes_1d.php new file mode 100755 index 0000000..10a79a7 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_barcodes_1d.php @@ -0,0 +1,2356 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : PHP class to creates array representations for +// common 1D barcodes to be used with TCPDF. +// +//============================================================+ + +/** + * @file + * PHP class to creates array representations for common 1D barcodes to be used with TCPDF. + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.027 + */ + +/** + * @class TCPDFBarcode + * PHP class to creates array representations for common 1D barcodes to be used with TCPDF (http://www.tcpdf.org).
      + * @package com.tecnick.tcpdf + * @version 1.0.027 + * @author Nicola Asuni + */ +class TCPDFBarcode { + + /** + * Array representation of barcode. + * @protected + */ + protected $barcode_array = array(); + + /** + * This is the class constructor. + * Return an array representations for common 1D barcodes:
        + *
      • $arrcode['code'] code to be printed on text label
      • + *
      • $arrcode['maxh'] max barcode height
      • + *
      • $arrcode['maxw'] max barcode width
      • + *
      • $arrcode['bcode'][$k] single bar or space in $k position
      • + *
      • $arrcode['bcode'][$k]['t'] bar type: true = bar, false = space.
      • + *
      • $arrcode['bcode'][$k]['w'] bar width in units.
      • + *
      • $arrcode['bcode'][$k]['h'] bar height in units.
      • + *
      • $arrcode['bcode'][$k]['p'] bar top position (0 = top, 1 = middle)
      + * @param string $code code to print + * @param string $type type of barcode:
      • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
      • C39+ : CODE 39 with checksum
      • C39E : CODE 39 EXTENDED
      • C39E+ : CODE 39 EXTENDED + CHECKSUM
      • C93 : CODE 93 - USS-93
      • S25 : Standard 2 of 5
      • S25+ : Standard 2 of 5 + CHECKSUM
      • I25 : Interleaved 2 of 5
      • I25+ : Interleaved 2 of 5 + CHECKSUM
      • C128 : CODE 128
      • C128A : CODE 128 A
      • C128B : CODE 128 B
      • C128C : CODE 128 C
      • EAN2 : 2-Digits UPC-Based Extension
      • EAN5 : 5-Digits UPC-Based Extension
      • EAN8 : EAN 8
      • EAN13 : EAN 13
      • UPCA : UPC-A
      • UPCE : UPC-E
      • MSI : MSI (Variation of Plessey code)
      • MSI+ : MSI + CHECKSUM (modulo 11)
      • POSTNET : POSTNET
      • PLANET : PLANET
      • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
      • KIX : KIX (Klant index - Customer index)
      • IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200
      • CODABAR : CODABAR
      • CODE11 : CODE 11
      • PHARMA : PHARMACODE
      • PHARMA2T : PHARMACODE TWO-TRACKS
      + * @public + */ + public function __construct($code, $type) { + $this->setBarcode($code, $type); + } + + /** + * Return an array representations of barcode. + * @return array + * @public + */ + public function getBarcodeArray() { + return $this->barcode_array; + } + + /** + * Send barcode as SVG image object to the standard output. + * @param int $w Minimum width of a single bar in user units. + * @param int $h Height of barcode in user units. + * @param string $color Foreground color (in SVG format) for bar elements (background is transparent). + * @public + */ + public function getBarcodeSVG($w=2, $h=30, $color='black') { + // send headers + $code = $this->getBarcodeSVGcode($w, $h, $color); + header('Content-Type: application/svg+xml'); + header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); + //header('Content-Length: '.strlen($code)); + echo $code; + } + + /** + * Return a SVG string representation of barcode. + * @param int $w Minimum width of a single bar in user units. + * @param int $h Height of barcode in user units. + * @param string $color Foreground color (in SVG format) for bar elements (background is transparent). + * @return string SVG code. + * @public + */ + public function getBarcodeSVGcode($w=2, $h=30, $color='black') { + // replace table for special characters + $repstr = array("\0" => '', '&' => '&', '<' => '<', '>' => '>'); + $svg = '<'.'?'.'xml version="1.0" standalone="no"'.'?'.'>'."\n"; + $svg .= ''."\n"; + $svg .= ''."\n"; + $svg .= "\t".''.strtr($this->barcode_array['code'], $repstr).''."\n"; + $svg .= "\t".''."\n"; + // print bars + $x = 0; + foreach ($this->barcode_array['bcode'] as $k => $v) { + $bw = round(($v['w'] * $w), 3); + $bh = round(($v['h'] * $h / $this->barcode_array['maxh']), 3); + if ($v['t']) { + $y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3); + // draw a vertical bar + $svg .= "\t\t".''."\n"; + } + $x += $bw; + } + $svg .= "\t".''."\n"; + $svg .= ''."\n"; + return $svg; + } + + /** + * Return an HTML representation of barcode. + * @param int $w Width of a single bar element in pixels. + * @param int $h Height of a single bar element in pixels. + * @param string $color Foreground color for bar elements (background is transparent). + * @return string HTML code. + * @public + */ + public function getBarcodeHTML($w=2, $h=30, $color='black') { + $html = '
      '."\n"; + // print bars + $x = 0; + foreach ($this->barcode_array['bcode'] as $k => $v) { + $bw = round(($v['w'] * $w), 3); + $bh = round(($v['h'] * $h / $this->barcode_array['maxh']), 3); + if ($v['t']) { + $y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3); + // draw a vertical bar + $html .= '
       
      '."\n"; + } + $x += $bw; + } + $html .= '
      '."\n"; + return $html; + } + + /** + * Send a PNG image representation of barcode (requires GD or Imagick library). + * @param int $w Width of a single bar element in pixels. + * @param int $h Height of a single bar element in pixels. + * @param array $color RGB (0-255) foreground color for bar elements (background is transparent). + * @public + */ + public function getBarcodePNG($w=2, $h=30, $color=array(0,0,0)) { + $data = $this->getBarcodePngData($w, $h, $color); + // send headers + header('Content-Type: image/png'); + header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + //header('Content-Length: '.strlen($data)); + echo $data; + } + + /** + * Return a PNG image representation of barcode (requires GD or Imagick library). + * @param int $w Width of a single bar element in pixels. + * @param int $h Height of a single bar element in pixels. + * @param array $color RGB (0-255) foreground color for bar elements (background is transparent). + * @return string|Imagick|false image or false in case of error. + * @public + */ + public function getBarcodePngData($w=2, $h=30, $color=array(0,0,0)) { + // calculate image size + $width = ($this->barcode_array['maxw'] * $w); + $height = $h; + if (function_exists('imagecreate')) { + // GD library + $imagick = false; + $png = imagecreate($width, $height); + $bgcol = imagecolorallocate($png, 255, 255, 255); + imagecolortransparent($png, $bgcol); + $fgcol = imagecolorallocate($png, $color[0], $color[1], $color[2]); + } elseif (extension_loaded('imagick')) { + $imagick = true; + $bgcol = new imagickpixel('rgb(255,255,255'); + $fgcol = new imagickpixel('rgb('.$color[0].','.$color[1].','.$color[2].')'); + $png = new Imagick(); + $png->newImage($width, $height, 'none', 'png'); + $bar = new imagickdraw(); + $bar->setfillcolor($fgcol); + } else { + return false; + } + // print bars + $x = 0; + foreach ($this->barcode_array['bcode'] as $k => $v) { + $bw = round(($v['w'] * $w), 3); + $bh = round(($v['h'] * $h / $this->barcode_array['maxh']), 3); + if ($v['t']) { + $y = round(($v['p'] * $h / $this->barcode_array['maxh']), 3); + // draw a vertical bar + if ($imagick) { + $bar->rectangle($x, $y, ($x + $bw - 1), ($y + $bh - 1)); + } else { + imagefilledrectangle($png, $x, $y, ($x + $bw - 1), ($y + $bh - 1), $fgcol); + } + } + $x += $bw; + } + if ($imagick) { + $png->drawimage($bar); + return $png; + } else { + ob_start(); + imagepng($png); + $imagedata = ob_get_clean(); + imagedestroy($png); + return $imagedata; + } + } + + /** + * Set the barcode. + * @param string $code code to print + * @param string $type type of barcode:
      • C39 : CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9.
      • C39+ : CODE 39 with checksum
      • C39E : CODE 39 EXTENDED
      • C39E+ : CODE 39 EXTENDED + CHECKSUM
      • C93 : CODE 93 - USS-93
      • S25 : Standard 2 of 5
      • S25+ : Standard 2 of 5 + CHECKSUM
      • I25 : Interleaved 2 of 5
      • I25+ : Interleaved 2 of 5 + CHECKSUM
      • C128 : CODE 128
      • C128A : CODE 128 A
      • C128B : CODE 128 B
      • C128C : CODE 128 C
      • EAN2 : 2-Digits UPC-Based Extension
      • EAN5 : 5-Digits UPC-Based Extension
      • EAN8 : EAN 8
      • EAN13 : EAN 13
      • UPCA : UPC-A
      • UPCE : UPC-E
      • MSI : MSI (Variation of Plessey code)
      • MSI+ : MSI + CHECKSUM (modulo 11)
      • POSTNET : POSTNET
      • PLANET : PLANET
      • RMS4CC : RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code)
      • KIX : KIX (Klant index - Customer index)
      • IMB: Intelligent Mail Barcode - Onecode - USPS-B-3200
      • IMBPRE: Pre-processed Intelligent Mail Barcode - Onecode - USPS-B-3200, using only F,A,D,T letters
      • CODABAR : CODABAR
      • CODE11 : CODE 11
      • PHARMA : PHARMACODE
      • PHARMA2T : PHARMACODE TWO-TRACKS
      + * @return void + * @public + */ + public function setBarcode($code, $type) { + switch (strtoupper($type)) { + case 'C39': { // CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9. + $arrcode = $this->barcode_code39($code, false, false); + break; + } + case 'C39+': { // CODE 39 with checksum + $arrcode = $this->barcode_code39($code, false, true); + break; + } + case 'C39E': { // CODE 39 EXTENDED + $arrcode = $this->barcode_code39($code, true, false); + break; + } + case 'C39E+': { // CODE 39 EXTENDED + CHECKSUM + $arrcode = $this->barcode_code39($code, true, true); + break; + } + case 'C93': { // CODE 93 - USS-93 + $arrcode = $this->barcode_code93($code); + break; + } + case 'S25': { // Standard 2 of 5 + $arrcode = $this->barcode_s25($code, false); + break; + } + case 'S25+': { // Standard 2 of 5 + CHECKSUM + $arrcode = $this->barcode_s25($code, true); + break; + } + case 'I25': { // Interleaved 2 of 5 + $arrcode = $this->barcode_i25($code, false); + break; + } + case 'I25+': { // Interleaved 2 of 5 + CHECKSUM + $arrcode = $this->barcode_i25($code, true); + break; + } + case 'C128': { // CODE 128 + $arrcode = $this->barcode_c128($code, ''); + break; + } + case 'C128A': { // CODE 128 A + $arrcode = $this->barcode_c128($code, 'A'); + break; + } + case 'C128B': { // CODE 128 B + $arrcode = $this->barcode_c128($code, 'B'); + break; + } + case 'C128C': { // CODE 128 C + $arrcode = $this->barcode_c128($code, 'C'); + break; + } + case 'EAN2': { // 2-Digits UPC-Based Extension + $arrcode = $this->barcode_eanext($code, 2); + break; + } + case 'EAN5': { // 5-Digits UPC-Based Extension + $arrcode = $this->barcode_eanext($code, 5); + break; + } + case 'EAN8': { // EAN 8 + $arrcode = $this->barcode_eanupc($code, 8); + break; + } + case 'EAN13': { // EAN 13 + $arrcode = $this->barcode_eanupc($code, 13); + break; + } + case 'UPCA': { // UPC-A + $arrcode = $this->barcode_eanupc($code, 12); + break; + } + case 'UPCE': { // UPC-E + $arrcode = $this->barcode_eanupc($code, 6); + break; + } + case 'MSI': { // MSI (Variation of Plessey code) + $arrcode = $this->barcode_msi($code, false); + break; + } + case 'MSI+': { // MSI + CHECKSUM (modulo 11) + $arrcode = $this->barcode_msi($code, true); + break; + } + case 'POSTNET': { // POSTNET + $arrcode = $this->barcode_postnet($code, false); + break; + } + case 'PLANET': { // PLANET + $arrcode = $this->barcode_postnet($code, true); + break; + } + case 'RMS4CC': { // RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) + $arrcode = $this->barcode_rms4cc($code, false); + break; + } + case 'KIX': { // KIX (Klant index - Customer index) + $arrcode = $this->barcode_rms4cc($code, true); + break; + } + case 'IMB': { // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 + $arrcode = $this->barcode_imb($code); + break; + } + case 'IMBPRE': { // IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200- pre-processed + $arrcode = $this->barcode_imb_pre($code); + break; + } + case 'CODABAR': { // CODABAR + $arrcode = $this->barcode_codabar($code); + break; + } + case 'CODE11': { // CODE 11 + $arrcode = $this->barcode_code11($code); + break; + } + case 'PHARMA': { // PHARMACODE + $arrcode = $this->barcode_pharmacode($code); + break; + } + case 'PHARMA2T': { // PHARMACODE TWO-TRACKS + $arrcode = $this->barcode_pharmacode2t($code); + break; + } + default: { + $this->barcode_array = array(); + $arrcode = false; + break; + } + } + $this->barcode_array = $arrcode; + } + + /** + * CODE 39 - ANSI MH10.8M-1983 - USD-3 - 3 of 9. + * General-purpose code in very wide use world-wide + * @param string $code code to represent. + * @param boolean $extended if true uses the extended mode. + * @param boolean $checksum if true add a checksum to the code. + * @return array barcode representation. + * @protected + */ + protected function barcode_code39($code, $extended=false, $checksum=false) { + $chr['0'] = '111331311'; + $chr['1'] = '311311113'; + $chr['2'] = '113311113'; + $chr['3'] = '313311111'; + $chr['4'] = '111331113'; + $chr['5'] = '311331111'; + $chr['6'] = '113331111'; + $chr['7'] = '111311313'; + $chr['8'] = '311311311'; + $chr['9'] = '113311311'; + $chr['A'] = '311113113'; + $chr['B'] = '113113113'; + $chr['C'] = '313113111'; + $chr['D'] = '111133113'; + $chr['E'] = '311133111'; + $chr['F'] = '113133111'; + $chr['G'] = '111113313'; + $chr['H'] = '311113311'; + $chr['I'] = '113113311'; + $chr['J'] = '111133311'; + $chr['K'] = '311111133'; + $chr['L'] = '113111133'; + $chr['M'] = '313111131'; + $chr['N'] = '111131133'; + $chr['O'] = '311131131'; + $chr['P'] = '113131131'; + $chr['Q'] = '111111333'; + $chr['R'] = '311111331'; + $chr['S'] = '113111331'; + $chr['T'] = '111131331'; + $chr['U'] = '331111113'; + $chr['V'] = '133111113'; + $chr['W'] = '333111111'; + $chr['X'] = '131131113'; + $chr['Y'] = '331131111'; + $chr['Z'] = '133131111'; + $chr['-'] = '131111313'; + $chr['.'] = '331111311'; + $chr[' '] = '133111311'; + $chr['$'] = '131313111'; + $chr['/'] = '131311131'; + $chr['+'] = '131113131'; + $chr['%'] = '111313131'; + $chr['*'] = '131131311'; + $code = strtoupper($code); + if ($extended) { + // extended mode + $code = $this->encode_code39_ext($code); + } + if ($code === false) { + return false; + } + if ($checksum) { + // checksum + $code .= $this->checksum_code39($code); + } + // add start and stop codes + $code = '*'.$code.'*'; + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + $k = 0; + $clen = strlen($code); + for ($i = 0; $i < $clen; ++$i) { + $char = $code[$i]; + if(!isset($chr[$char])) { + // invalid character + return false; + } + for ($j = 0; $j < 9; ++$j) { + if (($j % 2) == 0) { + $t = true; // bar + } else { + $t = false; // space + } + $w = $chr[$char][$j]; + $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); + $bararray['maxw'] += $w; + ++$k; + } + // intercharacter gap + $bararray['bcode'][$k] = array('t' => false, 'w' => 1, 'h' => 1, 'p' => 0); + $bararray['maxw'] += 1; + ++$k; + } + return $bararray; + } + + /** + * Encode a string to be used for CODE 39 Extended mode. + * @param string $code code to represent. + * @return string encoded string. + * @protected + */ + protected function encode_code39_ext($code) { + $encode = array( + chr(0) => '%U', chr(1) => '$A', chr(2) => '$B', chr(3) => '$C', + chr(4) => '$D', chr(5) => '$E', chr(6) => '$F', chr(7) => '$G', + chr(8) => '$H', chr(9) => '$I', chr(10) => '$J', chr(11) => '拢K', + chr(12) => '$L', chr(13) => '$M', chr(14) => '$N', chr(15) => '$O', + chr(16) => '$P', chr(17) => '$Q', chr(18) => '$R', chr(19) => '$S', + chr(20) => '$T', chr(21) => '$U', chr(22) => '$V', chr(23) => '$W', + chr(24) => '$X', chr(25) => '$Y', chr(26) => '$Z', chr(27) => '%A', + chr(28) => '%B', chr(29) => '%C', chr(30) => '%D', chr(31) => '%E', + chr(32) => ' ', chr(33) => '/A', chr(34) => '/B', chr(35) => '/C', + chr(36) => '/D', chr(37) => '/E', chr(38) => '/F', chr(39) => '/G', + chr(40) => '/H', chr(41) => '/I', chr(42) => '/J', chr(43) => '/K', + chr(44) => '/L', chr(45) => '-', chr(46) => '.', chr(47) => '/O', + chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', + chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', + chr(56) => '8', chr(57) => '9', chr(58) => '/Z', chr(59) => '%F', + chr(60) => '%G', chr(61) => '%H', chr(62) => '%I', chr(63) => '%J', + chr(64) => '%V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', + chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', + chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', + chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', + chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', + chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', + chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => '%K', + chr(92) => '%L', chr(93) => '%M', chr(94) => '%N', chr(95) => '%O', + chr(96) => '%W', chr(97) => '+A', chr(98) => '+B', chr(99) => '+C', + chr(100) => '+D', chr(101) => '+E', chr(102) => '+F', chr(103) => '+G', + chr(104) => '+H', chr(105) => '+I', chr(106) => '+J', chr(107) => '+K', + chr(108) => '+L', chr(109) => '+M', chr(110) => '+N', chr(111) => '+O', + chr(112) => '+P', chr(113) => '+Q', chr(114) => '+R', chr(115) => '+S', + chr(116) => '+T', chr(117) => '+U', chr(118) => '+V', chr(119) => '+W', + chr(120) => '+X', chr(121) => '+Y', chr(122) => '+Z', chr(123) => '%P', + chr(124) => '%Q', chr(125) => '%R', chr(126) => '%S', chr(127) => '%T'); + $code_ext = ''; + $clen = strlen($code); + for ($i = 0 ; $i < $clen; ++$i) { + if (ord($code[$i]) > 127) { + return false; + } + $code_ext .= $encode[$code[$i]]; + } + return $code_ext; + } + + /** + * Calculate CODE 39 checksum (modulo 43). + * @param string $code code to represent. + * @return string char checksum. + * @protected + */ + protected function checksum_code39($code) { + $chars = array( + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', + 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', + 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%'); + $sum = 0; + $clen = strlen($code); + for ($i = 0 ; $i < $clen; ++$i) { + $k = array_keys($chars, $code[$i]); + $sum += $k[0]; + } + $j = ($sum % 43); + return $chars[$j]; + } + + /** + * CODE 93 - USS-93 + * Compact code similar to Code 39 + * @param string $code code to represent. + * @return array barcode representation. + * @protected + */ + protected function barcode_code93($code) { + $chr[48] = '131112'; // 0 + $chr[49] = '111213'; // 1 + $chr[50] = '111312'; // 2 + $chr[51] = '111411'; // 3 + $chr[52] = '121113'; // 4 + $chr[53] = '121212'; // 5 + $chr[54] = '121311'; // 6 + $chr[55] = '111114'; // 7 + $chr[56] = '131211'; // 8 + $chr[57] = '141111'; // 9 + $chr[65] = '211113'; // A + $chr[66] = '211212'; // B + $chr[67] = '211311'; // C + $chr[68] = '221112'; // D + $chr[69] = '221211'; // E + $chr[70] = '231111'; // F + $chr[71] = '112113'; // G + $chr[72] = '112212'; // H + $chr[73] = '112311'; // I + $chr[74] = '122112'; // J + $chr[75] = '132111'; // K + $chr[76] = '111123'; // L + $chr[77] = '111222'; // M + $chr[78] = '111321'; // N + $chr[79] = '121122'; // O + $chr[80] = '131121'; // P + $chr[81] = '212112'; // Q + $chr[82] = '212211'; // R + $chr[83] = '211122'; // S + $chr[84] = '211221'; // T + $chr[85] = '221121'; // U + $chr[86] = '222111'; // V + $chr[87] = '112122'; // W + $chr[88] = '112221'; // X + $chr[89] = '122121'; // Y + $chr[90] = '123111'; // Z + $chr[45] = '121131'; // - + $chr[46] = '311112'; // . + $chr[32] = '311211'; // + $chr[36] = '321111'; // $ + $chr[47] = '112131'; // / + $chr[43] = '113121'; // + + $chr[37] = '211131'; // % + $chr[128] = '121221'; // ($) + $chr[129] = '311121'; // (/) + $chr[130] = '122211'; // (+) + $chr[131] = '312111'; // (%) + $chr[42] = '111141'; // start-stop + $code = strtoupper($code); + $encode = array( + chr(0) => chr(131).'U', chr(1) => chr(128).'A', chr(2) => chr(128).'B', chr(3) => chr(128).'C', + chr(4) => chr(128).'D', chr(5) => chr(128).'E', chr(6) => chr(128).'F', chr(7) => chr(128).'G', + chr(8) => chr(128).'H', chr(9) => chr(128).'I', chr(10) => chr(128).'J', chr(11) => '拢K', + chr(12) => chr(128).'L', chr(13) => chr(128).'M', chr(14) => chr(128).'N', chr(15) => chr(128).'O', + chr(16) => chr(128).'P', chr(17) => chr(128).'Q', chr(18) => chr(128).'R', chr(19) => chr(128).'S', + chr(20) => chr(128).'T', chr(21) => chr(128).'U', chr(22) => chr(128).'V', chr(23) => chr(128).'W', + chr(24) => chr(128).'X', chr(25) => chr(128).'Y', chr(26) => chr(128).'Z', chr(27) => chr(131).'A', + chr(28) => chr(131).'B', chr(29) => chr(131).'C', chr(30) => chr(131).'D', chr(31) => chr(131).'E', + chr(32) => ' ', chr(33) => chr(129).'A', chr(34) => chr(129).'B', chr(35) => chr(129).'C', + chr(36) => chr(129).'D', chr(37) => chr(129).'E', chr(38) => chr(129).'F', chr(39) => chr(129).'G', + chr(40) => chr(129).'H', chr(41) => chr(129).'I', chr(42) => chr(129).'J', chr(43) => chr(129).'K', + chr(44) => chr(129).'L', chr(45) => '-', chr(46) => '.', chr(47) => chr(129).'O', + chr(48) => '0', chr(49) => '1', chr(50) => '2', chr(51) => '3', + chr(52) => '4', chr(53) => '5', chr(54) => '6', chr(55) => '7', + chr(56) => '8', chr(57) => '9', chr(58) => chr(129).'Z', chr(59) => chr(131).'F', + chr(60) => chr(131).'G', chr(61) => chr(131).'H', chr(62) => chr(131).'I', chr(63) => chr(131).'J', + chr(64) => chr(131).'V', chr(65) => 'A', chr(66) => 'B', chr(67) => 'C', + chr(68) => 'D', chr(69) => 'E', chr(70) => 'F', chr(71) => 'G', + chr(72) => 'H', chr(73) => 'I', chr(74) => 'J', chr(75) => 'K', + chr(76) => 'L', chr(77) => 'M', chr(78) => 'N', chr(79) => 'O', + chr(80) => 'P', chr(81) => 'Q', chr(82) => 'R', chr(83) => 'S', + chr(84) => 'T', chr(85) => 'U', chr(86) => 'V', chr(87) => 'W', + chr(88) => 'X', chr(89) => 'Y', chr(90) => 'Z', chr(91) => chr(131).'K', + chr(92) => chr(131).'L', chr(93) => chr(131).'M', chr(94) => chr(131).'N', chr(95) => chr(131).'O', + chr(96) => chr(131).'W', chr(97) => chr(130).'A', chr(98) => chr(130).'B', chr(99) => chr(130).'C', + chr(100) => chr(130).'D', chr(101) => chr(130).'E', chr(102) => chr(130).'F', chr(103) => chr(130).'G', + chr(104) => chr(130).'H', chr(105) => chr(130).'I', chr(106) => chr(130).'J', chr(107) => chr(130).'K', + chr(108) => chr(130).'L', chr(109) => chr(130).'M', chr(110) => chr(130).'N', chr(111) => chr(130).'O', + chr(112) => chr(130).'P', chr(113) => chr(130).'Q', chr(114) => chr(130).'R', chr(115) => chr(130).'S', + chr(116) => chr(130).'T', chr(117) => chr(130).'U', chr(118) => chr(130).'V', chr(119) => chr(130).'W', + chr(120) => chr(130).'X', chr(121) => chr(130).'Y', chr(122) => chr(130).'Z', chr(123) => chr(131).'P', + chr(124) => chr(131).'Q', chr(125) => chr(131).'R', chr(126) => chr(131).'S', chr(127) => chr(131).'T'); + $code_ext = ''; + $clen = strlen($code); + for ($i = 0 ; $i < $clen; ++$i) { + if (ord($code[$i]) > 127) { + return false; + } + $code_ext .= $encode[$code[$i]]; + } + // checksum + $code_ext .= $this->checksum_code93($code_ext); + // add start and stop codes + $code = '*'.$code_ext.'*'; + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + $k = 0; + $clen = strlen($code); + for ($i = 0; $i < $clen; ++$i) { + $char = ord($code[$i]); + if(!isset($chr[$char])) { + // invalid character + return false; + } + for ($j = 0; $j < 6; ++$j) { + if (($j % 2) == 0) { + $t = true; // bar + } else { + $t = false; // space + } + $w = $chr[$char][$j]; + $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); + $bararray['maxw'] += $w; + ++$k; + } + } + $bararray['bcode'][$k] = array('t' => true, 'w' => 1, 'h' => 1, 'p' => 0); + $bararray['maxw'] += 1; + ++$k; + return $bararray; + } + + /** + * Calculate CODE 93 checksum (modulo 47). + * @param string $code code to represent. + * @return string checksum code. + * @protected + */ + protected function checksum_code93($code) { + $chars = array( + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', + 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', + 'W', 'X', 'Y', 'Z', '-', '.', ' ', '$', '/', '+', '%', + '<', '=', '>', '?'); + // translate special characters + $code = strtr($code, chr(128).chr(131).chr(129).chr(130), '<=>?'); + $len = strlen($code); + // calculate check digit C + $p = 1; + $check = 0; + for ($i = ($len - 1); $i >= 0; --$i) { + $k = array_keys($chars, $code[$i]); + $check += ($k[0] * $p); + ++$p; + if ($p > 20) { + $p = 1; + } + } + $check %= 47; + $c = $chars[$check]; + $code .= $c; + // calculate check digit K + $p = 1; + $check = 0; + for ($i = $len; $i >= 0; --$i) { + $k = array_keys($chars, $code[$i]); + $check += ($k[0] * $p); + ++$p; + if ($p > 15) { + $p = 1; + } + } + $check %= 47; + $k = $chars[$check]; + $checksum = $c.$k; + // resto respecial characters + $checksum = strtr($checksum, '<=>?', chr(128).chr(131).chr(129).chr(130)); + return $checksum; + } + + /** + * Checksum for standard 2 of 5 barcodes. + * @param string $code code to process. + * @return int checksum. + * @protected + */ + protected function checksum_s25($code) { + $len = strlen($code); + $sum = 0; + for ($i = 0; $i < $len; $i+=2) { + $sum += $code[$i]; + } + $sum *= 3; + for ($i = 1; $i < $len; $i+=2) { + $sum += ($code[$i]); + } + $r = $sum % 10; + if($r > 0) { + $r = (10 - $r); + } + return $r; + } + + /** + * MSI. + * Variation of Plessey code, with similar applications + * Contains digits (0 to 9) and encodes the data only in the width of bars. + * @param string $code code to represent. + * @param boolean $checksum if true add a checksum to the code (modulo 11) + * @return array barcode representation. + * @protected + */ + protected function barcode_msi($code, $checksum=false) { + $chr['0'] = '100100100100'; + $chr['1'] = '100100100110'; + $chr['2'] = '100100110100'; + $chr['3'] = '100100110110'; + $chr['4'] = '100110100100'; + $chr['5'] = '100110100110'; + $chr['6'] = '100110110100'; + $chr['7'] = '100110110110'; + $chr['8'] = '110100100100'; + $chr['9'] = '110100100110'; + $chr['A'] = '110100110100'; + $chr['B'] = '110100110110'; + $chr['C'] = '110110100100'; + $chr['D'] = '110110100110'; + $chr['E'] = '110110110100'; + $chr['F'] = '110110110110'; + if ($checksum) { + // add checksum + $clen = strlen($code); + $p = 2; + $check = 0; + for ($i = ($clen - 1); $i >= 0; --$i) { + $check += (hexdec($code[$i]) * $p); + ++$p; + if ($p > 7) { + $p = 2; + } + } + $check %= 11; + if ($check > 0) { + $check = 11 - $check; + } + $code .= $check; + } + $seq = '110'; // left guard + $clen = strlen($code); + for ($i = 0; $i < $clen; ++$i) { + $digit = $code[$i]; + if (!isset($chr[$digit])) { + // invalid character + return false; + } + $seq .= $chr[$digit]; + } + $seq .= '1001'; // right guard + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + return $this->binseq_to_array($seq, $bararray); + } + + /** + * Standard 2 of 5 barcodes. + * Used in airline ticket marking, photofinishing + * Contains digits (0 to 9) and encodes the data only in the width of bars. + * @param string $code code to represent. + * @param boolean $checksum if true add a checksum to the code + * @return array barcode representation. + * @protected + */ + protected function barcode_s25($code, $checksum=false) { + $chr['0'] = '10101110111010'; + $chr['1'] = '11101010101110'; + $chr['2'] = '10111010101110'; + $chr['3'] = '11101110101010'; + $chr['4'] = '10101110101110'; + $chr['5'] = '11101011101010'; + $chr['6'] = '10111011101010'; + $chr['7'] = '10101011101110'; + $chr['8'] = '10101110111010'; + $chr['9'] = '10111010111010'; + if ($checksum) { + // add checksum + $code .= $this->checksum_s25($code); + } + if((strlen($code) % 2) != 0) { + // add leading zero if code-length is odd + $code = '0'.$code; + } + $seq = '11011010'; + $clen = strlen($code); + for ($i = 0; $i < $clen; ++$i) { + $digit = $code[$i]; + if (!isset($chr[$digit])) { + // invalid character + return false; + } + $seq .= $chr[$digit]; + } + $seq .= '1101011'; + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + return $this->binseq_to_array($seq, $bararray); + } + + /** + * Convert binary barcode sequence to WarnockPDF barcode array. + * @param string $seq barcode as binary sequence. + * @param array $bararray barcode array to fill up + * @return array barcode representation. + * @protected + */ + protected function binseq_to_array($seq, $bararray) { + $len = strlen($seq); + $w = 0; + $k = 0; + for ($i = 0; $i < $len; ++$i) { + $w += 1; + if (($i == ($len - 1)) OR (($i < ($len - 1)) AND ($seq[$i] != $seq[($i+1)]))) { + if ($seq[$i] == '1') { + $t = true; // bar + } else { + $t = false; // space + } + $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); + $bararray['maxw'] += $w; + ++$k; + $w = 0; + } + } + return $bararray; + } + + /** + * Interleaved 2 of 5 barcodes. + * Compact numeric code, widely used in industry, air cargo + * Contains digits (0 to 9) and encodes the data in the width of both bars and spaces. + * @param string $code code to represent. + * @param boolean $checksum if true add a checksum to the code + * @return array barcode representation. + * @protected + */ + protected function barcode_i25($code, $checksum=false) { + $chr['0'] = '11221'; + $chr['1'] = '21112'; + $chr['2'] = '12112'; + $chr['3'] = '22111'; + $chr['4'] = '11212'; + $chr['5'] = '21211'; + $chr['6'] = '12211'; + $chr['7'] = '11122'; + $chr['8'] = '21121'; + $chr['9'] = '12121'; + $chr['A'] = '11'; + $chr['Z'] = '21'; + if ($checksum) { + // add checksum + $code .= $this->checksum_s25($code); + } + if((strlen($code) % 2) != 0) { + // add leading zero if code-length is odd + $code = '0'.$code; + } + // add start and stop codes + $code = 'AA'.strtolower($code).'ZA'; + + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + $k = 0; + $clen = strlen($code); + for ($i = 0; $i < $clen; $i = ($i + 2)) { + $char_bar = $code[$i]; + $char_space = $code[$i+1]; + if((!isset($chr[$char_bar])) OR (!isset($chr[$char_space]))) { + // invalid character + return false; + } + // create a bar-space sequence + $seq = ''; + $chrlen = strlen($chr[$char_bar]); + for ($s = 0; $s < $chrlen; $s++){ + $seq .= $chr[$char_bar][$s] . $chr[$char_space][$s]; + } + $seqlen = strlen($seq); + for ($j = 0; $j < $seqlen; ++$j) { + if (($j % 2) == 0) { + $t = true; // bar + } else { + $t = false; // space + } + $w = (float)$seq[$j]; + $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); + $bararray['maxw'] += $w; + ++$k; + } + } + return $bararray; + } + + /** + * C128 barcodes. + * Very capable code, excellent density, high reliability; in very wide use world-wide + * @param string $code code to represent. + * @param string $type barcode type: A, B, C or empty for automatic switch (AUTO mode) + * @return array barcode representation. + * @protected + */ + protected function barcode_c128($code, $type='') { + $chr = array( + '212222', /* 00 */ + '222122', /* 01 */ + '222221', /* 02 */ + '121223', /* 03 */ + '121322', /* 04 */ + '131222', /* 05 */ + '122213', /* 06 */ + '122312', /* 07 */ + '132212', /* 08 */ + '221213', /* 09 */ + '221312', /* 10 */ + '231212', /* 11 */ + '112232', /* 12 */ + '122132', /* 13 */ + '122231', /* 14 */ + '113222', /* 15 */ + '123122', /* 16 */ + '123221', /* 17 */ + '223211', /* 18 */ + '221132', /* 19 */ + '221231', /* 20 */ + '213212', /* 21 */ + '223112', /* 22 */ + '312131', /* 23 */ + '311222', /* 24 */ + '321122', /* 25 */ + '321221', /* 26 */ + '312212', /* 27 */ + '322112', /* 28 */ + '322211', /* 29 */ + '212123', /* 30 */ + '212321', /* 31 */ + '232121', /* 32 */ + '111323', /* 33 */ + '131123', /* 34 */ + '131321', /* 35 */ + '112313', /* 36 */ + '132113', /* 37 */ + '132311', /* 38 */ + '211313', /* 39 */ + '231113', /* 40 */ + '231311', /* 41 */ + '112133', /* 42 */ + '112331', /* 43 */ + '132131', /* 44 */ + '113123', /* 45 */ + '113321', /* 46 */ + '133121', /* 47 */ + '313121', /* 48 */ + '211331', /* 49 */ + '231131', /* 50 */ + '213113', /* 51 */ + '213311', /* 52 */ + '213131', /* 53 */ + '311123', /* 54 */ + '311321', /* 55 */ + '331121', /* 56 */ + '312113', /* 57 */ + '312311', /* 58 */ + '332111', /* 59 */ + '314111', /* 60 */ + '221411', /* 61 */ + '431111', /* 62 */ + '111224', /* 63 */ + '111422', /* 64 */ + '121124', /* 65 */ + '121421', /* 66 */ + '141122', /* 67 */ + '141221', /* 68 */ + '112214', /* 69 */ + '112412', /* 70 */ + '122114', /* 71 */ + '122411', /* 72 */ + '142112', /* 73 */ + '142211', /* 74 */ + '241211', /* 75 */ + '221114', /* 76 */ + '413111', /* 77 */ + '241112', /* 78 */ + '134111', /* 79 */ + '111242', /* 80 */ + '121142', /* 81 */ + '121241', /* 82 */ + '114212', /* 83 */ + '124112', /* 84 */ + '124211', /* 85 */ + '411212', /* 86 */ + '421112', /* 87 */ + '421211', /* 88 */ + '212141', /* 89 */ + '214121', /* 90 */ + '412121', /* 91 */ + '111143', /* 92 */ + '111341', /* 93 */ + '131141', /* 94 */ + '114113', /* 95 */ + '114311', /* 96 */ + '411113', /* 97 */ + '411311', /* 98 */ + '113141', /* 99 */ + '114131', /* 100 */ + '311141', /* 101 */ + '411131', /* 102 */ + '211412', /* 103 START A */ + '211214', /* 104 START B */ + '211232', /* 105 START C */ + '233111', /* STOP */ + '200000' /* END */ + ); + // ASCII characters for code A (ASCII 00 - 95) + $keys_a = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_'; + $keys_a .= chr(0).chr(1).chr(2).chr(3).chr(4).chr(5).chr(6).chr(7).chr(8).chr(9); + $keys_a .= chr(10).chr(11).chr(12).chr(13).chr(14).chr(15).chr(16).chr(17).chr(18).chr(19); + $keys_a .= chr(20).chr(21).chr(22).chr(23).chr(24).chr(25).chr(26).chr(27).chr(28).chr(29); + $keys_a .= chr(30).chr(31); + // ASCII characters for code B (ASCII 32 - 127) + $keys_b = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'.chr(127); + // special codes + $fnc_a = array(241 => 102, 242 => 97, 243 => 96, 244 => 101); + $fnc_b = array(241 => 102, 242 => 97, 243 => 96, 244 => 100); + // array of symbols + $code_data = array(); + // length of the code + $len = strlen($code); + switch(strtoupper($type)) { + case 'A': { // MODE A + $startid = 103; + for ($i = 0; $i < $len; ++$i) { + $char = $code[$i]; + $char_id = ord($char); + if (($char_id >= 241) AND ($char_id <= 244)) { + $code_data[] = $fnc_a[$char_id]; + } elseif (($char_id >= 0) AND ($char_id <= 95)) { + $code_data[] = strpos($keys_a, $char); + } else { + return false; + } + } + break; + } + case 'B': { // MODE B + $startid = 104; + for ($i = 0; $i < $len; ++$i) { + $char = $code[$i]; + $char_id = ord($char); + if (($char_id >= 241) AND ($char_id <= 244)) { + $code_data[] = $fnc_b[$char_id]; + } elseif (($char_id >= 32) AND ($char_id <= 127)) { + $code_data[] = strpos($keys_b, $char); + } else { + return false; + } + } + break; + } + case 'C': { // MODE C + $startid = 105; + if (ord($code[0]) == 241) { + $code_data[] = 102; + $code = substr($code, 1); + --$len; + } + if (($len % 2) != 0) { + // the length must be even + return false; + } + for ($i = 0; $i < $len; $i+=2) { + $chrnum = $code[$i].$code[$i+1]; + if (preg_match('/([0-9]{2})/', $chrnum) > 0) { + $code_data[] = intval($chrnum); + } else { + return false; + } + } + break; + } + default: { // MODE AUTO + // split code into sequences + $sequence = array(); + // get numeric sequences (if any) + $numseq = array(); + preg_match_all('/([0-9]{4,})/', $code, $numseq, PREG_OFFSET_CAPTURE); + if (isset($numseq[1]) AND !empty($numseq[1])) { + $end_offset = 0; + foreach ($numseq[1] as $val) { + $offset = $val[1]; + if ($offset > $end_offset) { + // non numeric sequence + $sequence = array_merge($sequence, $this->get128ABsequence(substr($code, $end_offset, ($offset - $end_offset)))); + } + // numeric sequence + $slen = strlen($val[0]); + if (($slen % 2) != 0) { + // the length must be even + --$slen; + } + $sequence[] = array('C', substr($code, $offset, $slen), $slen); + $end_offset = $offset + $slen; + } + if ($end_offset < $len) { + $sequence = array_merge($sequence, $this->get128ABsequence(substr($code, $end_offset))); + } + } else { + // text code (non C mode) + $sequence = array_merge($sequence, $this->get128ABsequence($code)); + } + // process the sequence + foreach ($sequence as $key => $seq) { + switch($seq[0]) { + case 'A': { + if ($key == 0) { + $startid = 103; + } elseif ($sequence[($key - 1)][0] != 'A') { + if (($seq[2] == 1) AND ($key > 0) AND ($sequence[($key - 1)][0] == 'B') AND (!isset($sequence[($key - 1)][3]))) { + // single character shift + $code_data[] = 98; + // mark shift + $sequence[$key][3] = true; + } elseif (!isset($sequence[($key - 1)][3])) { + $code_data[] = 101; + } + } + for ($i = 0; $i < $seq[2]; ++$i) { + $char = $seq[1][$i]; + $char_id = ord($char); + if (($char_id >= 241) AND ($char_id <= 244)) { + $code_data[] = $fnc_a[$char_id]; + } else { + $code_data[] = strpos($keys_a, $char); + } + } + break; + } + case 'B': { + if ($key == 0) { + $tmpchr = ord($seq[1][0]); + if (($seq[2] == 1) AND ($tmpchr >= 241) AND ($tmpchr <= 244) AND isset($sequence[($key + 1)]) AND ($sequence[($key + 1)][0] != 'B')) { + switch ($sequence[($key + 1)][0]) { + case 'A': { + $startid = 103; + $sequence[$key][0] = 'A'; + $code_data[] = $fnc_a[$tmpchr]; + break; + } + case 'C': { + $startid = 105; + $sequence[$key][0] = 'C'; + $code_data[] = $fnc_a[$tmpchr]; + break; + } + } + break; + } else { + $startid = 104; + } + } elseif ($sequence[($key - 1)][0] != 'B') { + if (($seq[2] == 1) AND ($key > 0) AND ($sequence[($key - 1)][0] == 'A') AND (!isset($sequence[($key - 1)][3]))) { + // single character shift + $code_data[] = 98; + // mark shift + $sequence[$key][3] = true; + } elseif (!isset($sequence[($key - 1)][3])) { + $code_data[] = 100; + } + } + for ($i = 0; $i < $seq[2]; ++$i) { + $char = $seq[1][$i]; + $char_id = ord($char); + if (($char_id >= 241) AND ($char_id <= 244)) { + $code_data[] = $fnc_b[$char_id]; + } else { + $code_data[] = strpos($keys_b, $char); + } + } + break; + } + case 'C': { + if ($key == 0) { + $startid = 105; + } elseif ($sequence[($key - 1)][0] != 'C') { + $code_data[] = 99; + } + for ($i = 0; $i < $seq[2]; $i+=2) { + $chrnum = $seq[1][$i].$seq[1][$i+1]; + $code_data[] = intval($chrnum); + } + break; + } + } + } + } + } + // calculate check character + $sum = $startid; + foreach ($code_data as $key => $val) { + $sum += ($val * ($key + 1)); + } + // add check character + $code_data[] = ($sum % 103); + // add stop sequence + $code_data[] = 106; + $code_data[] = 107; + // add start code at the beginning + array_unshift($code_data, $startid); + // build barcode array + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + foreach ($code_data as $val) { + $seq = $chr[$val]; + for ($j = 0; $j < 6; ++$j) { + if (($j % 2) == 0) { + $t = true; // bar + } else { + $t = false; // space + } + $w = (float)$seq[$j]; + $bararray['bcode'][] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); + $bararray['maxw'] += $w; + } + } + return $bararray; + } + + /** + * Split text code in A/B sequence for 128 code + * @param string $code code to split. + * @return array sequence + * @protected + */ + protected function get128ABsequence($code) { + $len = strlen($code); + $sequence = array(); + // get A sequences (if any) + $numseq = array(); + preg_match_all('/([\0-\31])/', $code, $numseq, PREG_OFFSET_CAPTURE); + if (isset($numseq[1]) AND !empty($numseq[1])) { + $end_offset = 0; + foreach ($numseq[1] as $val) { + $offset = $val[1]; + if ($offset > $end_offset) { + // B sequence + $sequence[] = array('B', substr($code, $end_offset, ($offset - $end_offset)), ($offset - $end_offset)); + } + // A sequence + $slen = strlen($val[0]); + $sequence[] = array('A', substr($code, $offset, $slen), $slen); + $end_offset = $offset + $slen; + } + if ($end_offset < $len) { + $sequence[] = array('B', substr($code, $end_offset), ($len - $end_offset)); + } + } else { + // only B sequence + $sequence[] = array('B', $code, $len); + } + return $sequence; + } + + /** + * EAN13 and UPC-A barcodes. + * EAN13: European Article Numbering international retail product code + * UPC-A: Universal product code seen on almost all retail products in the USA and Canada + * UPC-E: Short version of UPC symbol + * @param string $code code to represent. + * @param string $len barcode type: 6 = UPC-E, 8 = EAN8, 13 = EAN13, 12 = UPC-A + * @return array barcode representation. + * @protected + */ + protected function barcode_eanupc($code, $len=13) { + $upce = false; + if ($len == 6) { + $len = 12; // UPC-A + $upce = true; // UPC-E mode + } + $data_len = $len - 1; + //Padding + $code = str_pad($code, $data_len, '0', STR_PAD_LEFT); + $code_len = strlen($code); + // calculate check digit + $sum_a = 0; + for ($i = 1; $i < $data_len; $i+=2) { + $sum_a += $code[$i]; + } + if ($len > 12) { + $sum_a *= 3; + } + $sum_b = 0; + for ($i = 0; $i < $data_len; $i+=2) { + $sum_b += ($code[$i]); + } + if ($len < 13) { + $sum_b *= 3; + } + $r = ($sum_a + $sum_b) % 10; + if($r > 0) { + $r = (10 - $r); + } + if ($code_len == $data_len) { + // add check digit + $code .= $r; + } elseif ($r !== intval($code[$data_len])) { + // wrong checkdigit + return false; + } + if ($len == 12) { + // UPC-A + $code = '0'.$code; + ++$len; + } + if ($upce) { + // convert UPC-A to UPC-E + $tmp = substr($code, 4, 3); + if (($tmp == '000') OR ($tmp == '100') OR ($tmp == '200')) { + // manufacturer code ends in 000, 100, or 200 + $upce_code = substr($code, 2, 2).substr($code, 9, 3).substr($code, 4, 1); + } else { + $tmp = substr($code, 5, 2); + if ($tmp == '00') { + // manufacturer code ends in 00 + $upce_code = substr($code, 2, 3).substr($code, 10, 2).'3'; + } else { + $tmp = substr($code, 6, 1); + if ($tmp == '0') { + // manufacturer code ends in 0 + $upce_code = substr($code, 2, 4).substr($code, 11, 1).'4'; + } else { + // manufacturer code does not end in zero + $upce_code = substr($code, 2, 5).substr($code, 11, 1); + } + } + } + } + //Convert digits to bars + $codes = array( + 'A'=>array( // left odd parity + '0'=>'0001101', + '1'=>'0011001', + '2'=>'0010011', + '3'=>'0111101', + '4'=>'0100011', + '5'=>'0110001', + '6'=>'0101111', + '7'=>'0111011', + '8'=>'0110111', + '9'=>'0001011'), + 'B'=>array( // left even parity + '0'=>'0100111', + '1'=>'0110011', + '2'=>'0011011', + '3'=>'0100001', + '4'=>'0011101', + '5'=>'0111001', + '6'=>'0000101', + '7'=>'0010001', + '8'=>'0001001', + '9'=>'0010111'), + 'C'=>array( // right + '0'=>'1110010', + '1'=>'1100110', + '2'=>'1101100', + '3'=>'1000010', + '4'=>'1011100', + '5'=>'1001110', + '6'=>'1010000', + '7'=>'1000100', + '8'=>'1001000', + '9'=>'1110100') + ); + $parities = array( + '0'=>array('A','A','A','A','A','A'), + '1'=>array('A','A','B','A','B','B'), + '2'=>array('A','A','B','B','A','B'), + '3'=>array('A','A','B','B','B','A'), + '4'=>array('A','B','A','A','B','B'), + '5'=>array('A','B','B','A','A','B'), + '6'=>array('A','B','B','B','A','A'), + '7'=>array('A','B','A','B','A','B'), + '8'=>array('A','B','A','B','B','A'), + '9'=>array('A','B','B','A','B','A') + ); + $upce_parities = array(); + $upce_parities[0] = array( + '0'=>array('B','B','B','A','A','A'), + '1'=>array('B','B','A','B','A','A'), + '2'=>array('B','B','A','A','B','A'), + '3'=>array('B','B','A','A','A','B'), + '4'=>array('B','A','B','B','A','A'), + '5'=>array('B','A','A','B','B','A'), + '6'=>array('B','A','A','A','B','B'), + '7'=>array('B','A','B','A','B','A'), + '8'=>array('B','A','B','A','A','B'), + '9'=>array('B','A','A','B','A','B') + ); + $upce_parities[1] = array( + '0'=>array('A','A','A','B','B','B'), + '1'=>array('A','A','B','A','B','B'), + '2'=>array('A','A','B','B','A','B'), + '3'=>array('A','A','B','B','B','A'), + '4'=>array('A','B','A','A','B','B'), + '5'=>array('A','B','B','A','A','B'), + '6'=>array('A','B','B','B','A','A'), + '7'=>array('A','B','A','B','A','B'), + '8'=>array('A','B','A','B','B','A'), + '9'=>array('A','B','B','A','B','A') + ); + $k = 0; + $seq = '101'; // left guard bar + if ($upce) { + $bararray = array('code' => $upce_code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + $p = $upce_parities[$code[1]][$r]; + for ($i = 0; $i < 6; ++$i) { + $seq .= $codes[$p[$i]][$upce_code[$i]]; + } + $seq .= '010101'; // right guard bar + } else { + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + $half_len = intval(ceil($len / 2)); + if ($len == 8) { + for ($i = 0; $i < $half_len; ++$i) { + $seq .= $codes['A'][$code[$i]]; + } + } else { + $p = $parities[$code[0]]; + for ($i = 1; $i < $half_len; ++$i) { + $seq .= $codes[$p[$i-1]][$code[$i]]; + } + } + $seq .= '01010'; // center guard bar + for ($i = $half_len; $i < $len; ++$i) { + $seq .= $codes['C'][$code[$i]]; + } + $seq .= '101'; // right guard bar + } + $clen = strlen($seq); + $w = 0; + for ($i = 0; $i < $clen; ++$i) { + $w += 1; + if (($i == ($clen - 1)) OR (($i < ($clen - 1)) AND ($seq[$i] != $seq[$i+1]))) { + if ($seq[$i] == '1') { + $t = true; // bar + } else { + $t = false; // space + } + $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); + $bararray['maxw'] += $w; + ++$k; + $w = 0; + } + } + return $bararray; + } + + /** + * UPC-Based Extensions + * 2-Digit Ext.: Used to indicate magazines and newspaper issue numbers + * 5-Digit Ext.: Used to mark suggested retail price of books + * @param string $code code to represent. + * @param string $len barcode type: 2 = 2-Digit, 5 = 5-Digit + * @return array barcode representation. + * @protected + */ + protected function barcode_eanext($code, $len=5) { + //Padding + $code = str_pad($code, $len, '0', STR_PAD_LEFT); + // calculate check digit + if ($len == 2) { + $r = $code % 4; + } elseif ($len == 5) { + $r = (3 * ($code[0] + $code[2] + $code[4])) + (9 * ($code[1] + $code[3])); + $r %= 10; + } else { + return false; + } + //Convert digits to bars + $codes = array( + 'A'=>array( // left odd parity + '0'=>'0001101', + '1'=>'0011001', + '2'=>'0010011', + '3'=>'0111101', + '4'=>'0100011', + '5'=>'0110001', + '6'=>'0101111', + '7'=>'0111011', + '8'=>'0110111', + '9'=>'0001011'), + 'B'=>array( // left even parity + '0'=>'0100111', + '1'=>'0110011', + '2'=>'0011011', + '3'=>'0100001', + '4'=>'0011101', + '5'=>'0111001', + '6'=>'0000101', + '7'=>'0010001', + '8'=>'0001001', + '9'=>'0010111') + ); + $parities = array(); + $parities[2] = array( + '0'=>array('A','A'), + '1'=>array('A','B'), + '2'=>array('B','A'), + '3'=>array('B','B') + ); + $parities[5] = array( + '0'=>array('B','B','A','A','A'), + '1'=>array('B','A','B','A','A'), + '2'=>array('B','A','A','B','A'), + '3'=>array('B','A','A','A','B'), + '4'=>array('A','B','B','A','A'), + '5'=>array('A','A','B','B','A'), + '6'=>array('A','A','A','B','B'), + '7'=>array('A','B','A','B','A'), + '8'=>array('A','B','A','A','B'), + '9'=>array('A','A','B','A','B') + ); + $p = $parities[$len][$r]; + $seq = '1011'; // left guard bar + $seq .= $codes[$p[0]][$code[0]]; + for ($i = 1; $i < $len; ++$i) { + $seq .= '01'; // separator + $seq .= $codes[$p[$i]][$code[$i]]; + } + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + return $this->binseq_to_array($seq, $bararray); + } + + /** + * POSTNET and PLANET barcodes. + * Used by U.S. Postal Service for automated mail sorting + * @param string $code zip code to represent. Must be a string containing a zip code of the form DDDDD or DDDDD-DDDD. + * @param boolean $planet if true print the PLANET barcode, otherwise print POSTNET + * @return array barcode representation. + * @protected + */ + protected function barcode_postnet($code, $planet=false) { + // bar length + if ($planet) { + $barlen = Array( + 0 => Array(1,1,2,2,2), + 1 => Array(2,2,2,1,1), + 2 => Array(2,2,1,2,1), + 3 => Array(2,2,1,1,2), + 4 => Array(2,1,2,2,1), + 5 => Array(2,1,2,1,2), + 6 => Array(2,1,1,2,2), + 7 => Array(1,2,2,2,1), + 8 => Array(1,2,2,1,2), + 9 => Array(1,2,1,2,2) + ); + } else { + $barlen = Array( + 0 => Array(2,2,1,1,1), + 1 => Array(1,1,1,2,2), + 2 => Array(1,1,2,1,2), + 3 => Array(1,1,2,2,1), + 4 => Array(1,2,1,1,2), + 5 => Array(1,2,1,2,1), + 6 => Array(1,2,2,1,1), + 7 => Array(2,1,1,1,2), + 8 => Array(2,1,1,2,1), + 9 => Array(2,1,2,1,1) + ); + } + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 2, 'bcode' => array()); + $k = 0; + $code = str_replace('-', '', $code); + $code = str_replace(' ', '', $code); + $len = strlen($code); + // calculate checksum + $sum = 0; + for ($i = 0; $i < $len; ++$i) { + $sum += intval($code[$i]); + } + $chkd = ($sum % 10); + if($chkd > 0) { + $chkd = (10 - $chkd); + } + $code .= $chkd; + $len = strlen($code); + // start bar + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['maxw'] += 2; + for ($i = 0; $i < $len; ++$i) { + for ($j = 0; $j < 5; ++$j) { + $h = $barlen[$code[$i]][$j]; + $p = floor(1 / $h); + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); + $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['maxw'] += 2; + } + } + // end bar + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['maxw'] += 1; + return $bararray; + } + + /** + * RMS4CC - CBC - KIX + * RMS4CC (Royal Mail 4-state Customer Code) - CBC (Customer Bar Code) - KIX (Klant index - Customer index) + * RM4SCC is the name of the barcode symbology used by the Royal Mail for its Cleanmail service. + * @param string $code code to print + * @param boolean $kix if true prints the KIX variation (doesn't use the start and end symbols, and the checksum) - in this case the house number must be sufficed with an X and placed at the end of the code. + * @return array barcode representation. + * @protected + */ + protected function barcode_rms4cc($code, $kix=false) { + $notkix = !$kix; + // bar mode + // 1 = pos 1, length 2 + // 2 = pos 1, length 3 + // 3 = pos 2, length 1 + // 4 = pos 2, length 2 + $barmode = array( + '0' => array(3,3,2,2), + '1' => array(3,4,1,2), + '2' => array(3,4,2,1), + '3' => array(4,3,1,2), + '4' => array(4,3,2,1), + '5' => array(4,4,1,1), + '6' => array(3,1,4,2), + '7' => array(3,2,3,2), + '8' => array(3,2,4,1), + '9' => array(4,1,3,2), + 'A' => array(4,1,4,1), + 'B' => array(4,2,3,1), + 'C' => array(3,1,2,4), + 'D' => array(3,2,1,4), + 'E' => array(3,2,2,3), + 'F' => array(4,1,1,4), + 'G' => array(4,1,2,3), + 'H' => array(4,2,1,3), + 'I' => array(1,3,4,2), + 'J' => array(1,4,3,2), + 'K' => array(1,4,4,1), + 'L' => array(2,3,3,2), + 'M' => array(2,3,4,1), + 'N' => array(2,4,3,1), + 'O' => array(1,3,2,4), + 'P' => array(1,4,1,4), + 'Q' => array(1,4,2,3), + 'R' => array(2,3,1,4), + 'S' => array(2,3,2,3), + 'T' => array(2,4,1,3), + 'U' => array(1,1,4,4), + 'V' => array(1,2,3,4), + 'W' => array(1,2,4,3), + 'X' => array(2,1,3,4), + 'Y' => array(2,1,4,3), + 'Z' => array(2,2,3,3) + ); + $code = strtoupper($code); + $len = strlen($code); + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 3, 'bcode' => array()); + if ($notkix) { + // table for checksum calculation (row,col) + $checktable = array( + '0' => array(1,1), + '1' => array(1,2), + '2' => array(1,3), + '3' => array(1,4), + '4' => array(1,5), + '5' => array(1,0), + '6' => array(2,1), + '7' => array(2,2), + '8' => array(2,3), + '9' => array(2,4), + 'A' => array(2,5), + 'B' => array(2,0), + 'C' => array(3,1), + 'D' => array(3,2), + 'E' => array(3,3), + 'F' => array(3,4), + 'G' => array(3,5), + 'H' => array(3,0), + 'I' => array(4,1), + 'J' => array(4,2), + 'K' => array(4,3), + 'L' => array(4,4), + 'M' => array(4,5), + 'N' => array(4,0), + 'O' => array(5,1), + 'P' => array(5,2), + 'Q' => array(5,3), + 'R' => array(5,4), + 'S' => array(5,5), + 'T' => array(5,0), + 'U' => array(0,1), + 'V' => array(0,2), + 'W' => array(0,3), + 'X' => array(0,4), + 'Y' => array(0,5), + 'Z' => array(0,0) + ); + $row = 0; + $col = 0; + for ($i = 0; $i < $len; ++$i) { + $row += $checktable[$code[$i]][0]; + $col += $checktable[$code[$i]][1]; + } + $row %= 6; + $col %= 6; + $chk = array_keys($checktable, array($row,$col)); + $code .= $chk[0]; + ++$len; + } + $k = 0; + if ($notkix) { + // start bar + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['maxw'] += 2; + } + for ($i = 0; $i < $len; ++$i) { + for ($j = 0; $j < 4; ++$j) { + switch ($barmode[$code[$i]][$j]) { + case 1: { + $p = 0; + $h = 2; + break; + } + case 2: { + $p = 0; + $h = 3; + break; + } + case 3: { + $p = 1; + $h = 1; + break; + } + case 4: { + $p = 1; + $h = 2; + break; + } + } + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); + $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['maxw'] += 2; + } + } + if ($notkix) { + // stop bar + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => 3, 'p' => 0); + $bararray['maxw'] += 1; + } + return $bararray; + } + + /** + * CODABAR barcodes. + * Older code often used in library systems, sometimes in blood banks + * @param string $code code to represent. + * @return array barcode representation. + * @protected + */ + protected function barcode_codabar($code) { + $chr = array( + '0' => '11111221', + '1' => '11112211', + '2' => '11121121', + '3' => '22111111', + '4' => '11211211', + '5' => '21111211', + '6' => '12111121', + '7' => '12112111', + '8' => '12211111', + '9' => '21121111', + '-' => '11122111', + '$' => '11221111', + ':' => '21112121', + '/' => '21211121', + '.' => '21212111', + '+' => '11222221', + 'A' => '11221211', + 'B' => '12121121', + 'C' => '11121221', + 'D' => '11122211' + ); + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + $k = 0; + $w = 0; + $seq = ''; + $code = 'A'.strtoupper($code).'A'; + $len = strlen($code); + for ($i = 0; $i < $len; ++$i) { + if (!isset($chr[$code[$i]])) { + return false; + } + $seq = $chr[$code[$i]]; + for ($j = 0; $j < 8; ++$j) { + if (($j % 2) == 0) { + $t = true; // bar + } else { + $t = false; // space + } + $w = (float)$seq[$j]; + $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); + $bararray['maxw'] += $w; + ++$k; + } + } + return $bararray; + } + + /** + * CODE11 barcodes. + * Used primarily for labeling telecommunications equipment + * @param string $code code to represent. + * @return array barcode representation. + * @protected + */ + protected function barcode_code11($code) { + $chr = array( + '0' => '111121', + '1' => '211121', + '2' => '121121', + '3' => '221111', + '4' => '112121', + '5' => '212111', + '6' => '122111', + '7' => '111221', + '8' => '211211', + '9' => '211111', + '-' => '112111', + 'S' => '112211' + ); + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + $k = 0; + $w = 0; + $seq = ''; + $len = strlen($code); + // calculate check digit C + $p = 1; + $check = 0; + for ($i = ($len - 1); $i >= 0; --$i) { + $digit = $code[$i]; + if ($digit == '-') { + $dval = 10; + } else { + $dval = intval($digit); + } + $check += ($dval * $p); + ++$p; + if ($p > 10) { + $p = 1; + } + } + $check %= 11; + if ($check == 10) { + $check = '-'; + } + $code .= $check; + if ($len > 10) { + // calculate check digit K + $p = 1; + $check = 0; + for ($i = $len; $i >= 0; --$i) { + $digit = $code[$i]; + if ($digit == '-') { + $dval = 10; + } else { + $dval = intval($digit); + } + $check += ($dval * $p); + ++$p; + if ($p > 9) { + $p = 1; + } + } + $check %= 11; + $code .= $check; + ++$len; + } + $code = 'S'.$code.'S'; + $len += 3; + for ($i = 0; $i < $len; ++$i) { + if (!isset($chr[$code[$i]])) { + return false; + } + $seq = $chr[$code[$i]]; + for ($j = 0; $j < 6; ++$j) { + if (($j % 2) == 0) { + $t = true; // bar + } else { + $t = false; // space + } + $w = (float)$seq[$j]; + $bararray['bcode'][$k] = array('t' => $t, 'w' => $w, 'h' => 1, 'p' => 0); + $bararray['maxw'] += $w; + ++$k; + } + } + return $bararray; + } + + /** + * Pharmacode + * Contains digits (0 to 9) + * @param string $code code to represent. + * @return array barcode representation. + * @protected + */ + protected function barcode_pharmacode($code) { + $seq = ''; + $code = intval($code); + while ($code > 0) { + if (($code % 2) == 0) { + $seq .= '11100'; + $code -= 2; + } else { + $seq .= '100'; + $code -= 1; + } + $code /= 2; + } + $seq = substr($seq, 0, -2); + $seq = strrev($seq); + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 1, 'bcode' => array()); + return $this->binseq_to_array($seq, $bararray); + } + + /** + * Pharmacode two-track + * Contains digits (0 to 9) + * @param string $code code to represent. + * @return array barcode representation. + * @protected + */ + protected function barcode_pharmacode2t($code) { + $seq = ''; + $code = intval($code); + do { + switch ($code % 3) { + case 0: { + $seq .= '3'; + $code = ($code - 3) / 3; + break; + } + case 1: { + $seq .= '1'; + $code = ($code - 1) / 3; + break; + } + case 2: { + $seq .= '2'; + $code = ($code - 2) / 3; + break; + } + } + } while($code != 0); + $seq = strrev($seq); + $k = 0; + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 2, 'bcode' => array()); + $len = strlen($seq); + for ($i = 0; $i < $len; ++$i) { + switch ($seq[$i]) { + case '1': { + $p = 1; + $h = 1; + break; + } + case '2': { + $p = 0; + $h = 1; + break; + } + case '3': { + $p = 0; + $h = 2; + break; + } + } + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); + $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['maxw'] += 2; + } + unset($bararray['bcode'][($k - 1)]); + --$bararray['maxw']; + return $bararray; + } + + /** + * IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 + * (requires PHP bcmath extension) + * Intelligent Mail barcode is a 65-bar code for use on mail in the United States. + * The fields are described as follows:
      • The Barcode Identifier shall be assigned by USPS to encode the presort identification that is currently printed in human readable form on the optional endorsement line (OEL) as well as for future USPS use. This shall be two digits, with the second digit in the range of 0鈥�4. The allowable encoding ranges shall be 00鈥�04, 10鈥�14, 20鈥�24, 30鈥�34, 40鈥�44, 50鈥�54, 60鈥�64, 70鈥�74, 80鈥�84, and 90鈥�94.
      • The Service Type Identifier shall be assigned by USPS for any combination of services requested on the mailpiece. The allowable encoding range shall be 000http://it2.php.net/manual/en/function.dechex.php鈥�999. Each 3-digit value shall correspond to a particular mail class with a particular combination of service(s). Each service program, such as OneCode Confirm and OneCode ACS, shall provide the list of Service Type Identifier values.
      • The Mailer or Customer Identifier shall be assigned by USPS as a unique, 6 or 9 digit number that identifies a business entity. The allowable encoding range for the 6 digit Mailer ID shall be 000000- 899999, while the allowable encoding range for the 9 digit Mailer ID shall be 900000000-999999999.
      • The Serial or Sequence Number shall be assigned by the mailer for uniquely identifying and tracking mailpieces. The allowable encoding range shall be 000000000鈥�999999999 when used with a 6 digit Mailer ID and 000000-999999 when used with a 9 digit Mailer ID. e. The Delivery Point ZIP Code shall be assigned by the mailer for routing the mailpiece. This shall replace POSTNET for routing the mailpiece to its final delivery point. The length may be 0, 5, 9, or 11 digits. The allowable encoding ranges shall be no ZIP Code, 00000鈥�99999, 000000000鈥�999999999, and 00000000000鈥�99999999999.
      + * @param string $code code to print, separate the ZIP (routing code) from the rest using a minus char '-' (BarcodeID_ServiceTypeID_MailerID_SerialNumber-RoutingCode) + * @return array barcode representation. + * @protected + */ + protected function barcode_imb($code) { + $asc_chr = array(4,0,2,6,3,5,1,9,8,7,1,2,0,6,4,8,2,9,5,3,0,1,3,7,4,6,8,9,2,0,5,1,9,4,3,8,6,7,1,2,4,3,9,5,7,8,3,0,2,1,4,0,9,1,7,0,2,4,6,3,7,1,9,5,8); + $dsc_chr = array(7,1,9,5,8,0,2,4,6,3,5,8,9,7,3,0,6,1,7,4,6,8,9,2,5,1,7,5,4,3,8,7,6,0,2,5,4,9,3,0,1,6,8,2,0,4,5,9,6,7,5,2,6,3,8,5,1,9,8,7,4,0,2,6,3); + $asc_pos = array(3,0,8,11,1,12,8,11,10,6,4,12,2,7,9,6,7,9,2,8,4,0,12,7,10,9,0,7,10,5,7,9,6,8,2,12,1,4,2,0,1,5,4,6,12,1,0,9,4,7,5,10,2,6,9,11,2,12,6,7,5,11,0,3,2); + $dsc_pos = array(2,10,12,5,9,1,5,4,3,9,11,5,10,1,6,3,4,1,10,0,2,11,8,6,1,12,3,8,6,4,4,11,0,6,1,9,11,5,3,7,3,10,7,11,8,2,10,3,5,8,0,3,12,11,8,4,5,1,3,0,7,12,9,8,10); + $code_arr = explode('-', $code); + $tracking_number = $code_arr[0]; + if (isset($code_arr[1])) { + $routing_code = $code_arr[1]; + } else { + $routing_code = ''; + } + // Conversion of Routing Code + switch (strlen($routing_code)) { + case 0: { + $binary_code = 0; + break; + } + case 5: { + $binary_code = bcadd($routing_code, '1'); + break; + } + case 9: { + $binary_code = bcadd($routing_code, '100001'); + break; + } + case 11: { + $binary_code = bcadd($routing_code, '1000100001'); + break; + } + default: { + return false; + break; + } + } + $binary_code = bcmul($binary_code, 10); + $binary_code = bcadd($binary_code, $tracking_number[0]); + $binary_code = bcmul($binary_code, 5); + $binary_code = bcadd($binary_code, $tracking_number[1]); + $binary_code .= substr($tracking_number, 2, 18); + // convert to hexadecimal + $binary_code = $this->dec_to_hex($binary_code); + // pad to get 13 bytes + $binary_code = str_pad($binary_code, 26, '0', STR_PAD_LEFT); + // convert string to array of bytes + $binary_code_arr = chunk_split($binary_code, 2, "\r"); + $binary_code_arr = substr($binary_code_arr, 0, -1); + $binary_code_arr = explode("\r", $binary_code_arr); + // calculate frame check sequence + $fcs = $this->imb_crc11fcs($binary_code_arr); + // exclude first 2 bits from first byte + $first_byte = sprintf('%2s', dechex((hexdec($binary_code_arr[0]) << 2) >> 2)); + $binary_code_102bit = $first_byte.substr($binary_code, 2); + // convert binary data to codewords + $codewords = array(); + $data = $this->hex_to_dec($binary_code_102bit); + $codewords[0] = bcmod($data, 636) * 2; + $data = bcdiv($data, 636); + for ($i = 1; $i < 9; ++$i) { + $codewords[$i] = bcmod($data, 1365); + $data = bcdiv($data, 1365); + } + $codewords[9] = $data; + if (($fcs >> 10) == 1) { + $codewords[9] += 659; + } + // generate lookup tables + $table2of13 = $this->imb_tables(2, 78); + $table5of13 = $this->imb_tables(5, 1287); + // convert codewords to characters + $characters = array(); + $bitmask = 512; + foreach($codewords as $k => $val) { + if ($val <= 1286) { + $chrcode = $table5of13[$val]; + } else { + $chrcode = $table2of13[($val - 1287)]; + } + if (($fcs & $bitmask) > 0) { + // bitwise invert + $chrcode = ((~$chrcode) & 8191); + } + $characters[] = $chrcode; + $bitmask /= 2; + } + $characters = array_reverse($characters); + // build bars + $k = 0; + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 3, 'bcode' => array()); + for ($i = 0; $i < 65; ++$i) { + $asc = (($characters[$asc_chr[$i]] & pow(2, $asc_pos[$i])) > 0); + $dsc = (($characters[$dsc_chr[$i]] & pow(2, $dsc_pos[$i])) > 0); + if ($asc AND $dsc) { + // full bar (F) + $p = 0; + $h = 3; + } elseif ($asc) { + // ascender (A) + $p = 0; + $h = 2; + } elseif ($dsc) { + // descender (D) + $p = 1; + $h = 2; + } else { + // tracker (T) + $p = 1; + $h = 1; + } + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); + $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['maxw'] += 2; + } + unset($bararray['bcode'][($k - 1)]); + --$bararray['maxw']; + return $bararray; + } + + /** + * IMB - Intelligent Mail Barcode - Onecode - USPS-B-3200 + * + * @param string $code pre-formatted IMB barcode (65 chars "FADT") + * @return array barcode representation. + * @protected + */ + protected function barcode_imb_pre($code) { + if (!preg_match('/^[fadtFADT]{65}$/', $code) == 1) { + return false; + } + $characters = str_split(strtolower($code), 1); + // build bars + $k = 0; + $bararray = array('code' => $code, 'maxw' => 0, 'maxh' => 3, 'bcode' => array()); + for ($i = 0; $i < 65; ++$i) { + switch($characters[$i]) { + case 'f': { + // full bar + $p = 0; + $h = 3; + break; + } + case 'a': { + // ascender + $p = 0; + $h = 2; + break; + } + case 'd': { + // descender + $p = 1; + $h = 2; + break; + } + case 't': { + // tracker (short) + $p = 1; + $h = 1; + break; + } + } + $bararray['bcode'][$k++] = array('t' => 1, 'w' => 1, 'h' => $h, 'p' => $p); + $bararray['bcode'][$k++] = array('t' => 0, 'w' => 1, 'h' => 2, 'p' => 0); + $bararray['maxw'] += 2; + } + unset($bararray['bcode'][($k - 1)]); + --$bararray['maxw']; + return $bararray; + } + + /** + * Convert large integer number to hexadecimal representation. + * (requires PHP bcmath extension) + * @param string $number number to convert specified as a string + * @return string hexadecimal representation + */ + public function dec_to_hex($number) { + $i = 0; + $hex = array(); + if($number == 0) { + return '00'; + } + while($number > 0) { + if($number == 0) { + array_push($hex, '0'); + } else { + array_push($hex, strtoupper(dechex(bcmod($number, '16')))); + $number = bcdiv($number, '16', 0); + } + } + $hex = array_reverse($hex); + return implode($hex); + } + + /** + * Convert large hexadecimal number to decimal representation (string). + * (requires PHP bcmath extension) + * @param string $hex hexadecimal number to convert specified as a string + * @return string hexadecimal representation + */ + public function hex_to_dec($hex) { + $dec = 0; + $bitval = 1; + $len = strlen($hex); + for($pos = ($len - 1); $pos >= 0; --$pos) { + $dec = bcadd($dec, bcmul(hexdec($hex[$pos]), $bitval)); + $bitval = bcmul($bitval, 16); + } + return $dec; + } + + /** + * Intelligent Mail Barcode calculation of Frame Check Sequence + * @param string $code_arr array of hexadecimal values (13 bytes holding 102 bits right justified). + * @return int 11 bit Frame Check Sequence as integer (decimal base) + * @protected + */ + protected function imb_crc11fcs($code_arr) { + $genpoly = 0x0F35; // generator polynomial + $fcs = 0x07FF; // Frame Check Sequence + // do most significant byte skipping the 2 most significant bits + $data = hexdec($code_arr[0]) << 5; + for ($bit = 2; $bit < 8; ++$bit) { + if (($fcs ^ $data) & 0x400) { + $fcs = ($fcs << 1) ^ $genpoly; + } else { + $fcs = ($fcs << 1); + } + $fcs &= 0x7FF; + $data <<= 1; + } + // do rest of bytes + for ($byte = 1; $byte < 13; ++$byte) { + $data = hexdec($code_arr[$byte]) << 3; + for ($bit = 0; $bit < 8; ++$bit) { + if (($fcs ^ $data) & 0x400) { + $fcs = ($fcs << 1) ^ $genpoly; + } else { + $fcs = ($fcs << 1); + } + $fcs &= 0x7FF; + $data <<= 1; + } + } + return $fcs; + } + + /** + * Reverse unsigned short value + * @param int $num value to reversr + * @return int reversed value + * @protected + */ + protected function imb_reverse_us($num) { + $rev = 0; + for ($i = 0; $i < 16; ++$i) { + $rev <<= 1; + $rev |= ($num & 1); + $num >>= 1; + } + return $rev; + } + + /** + * generate Nof13 tables used for Intelligent Mail Barcode + * @param int $n is the type of table: 2 for 2of13 table, 5 for 5of13table + * @param int $size size of table (78 for n=2 and 1287 for n=5) + * @return array requested table + * @protected + */ + protected function imb_tables($n, $size) { + $table = array(); + $lli = 0; // LUT lower index + $lui = $size - 1; // LUT upper index + for ($count = 0; $count < 8192; ++$count) { + $bit_count = 0; + for ($bit_index = 0; $bit_index < 13; ++$bit_index) { + $bit_count += intval(($count & (1 << $bit_index)) != 0); + } + // if we don't have the right number of bits on, go on to the next value + if ($bit_count == $n) { + $reverse = ($this->imb_reverse_us($count) >> 3); + // if the reverse is less than count, we have already visited this pair before + if ($reverse >= $count) { + // If count is symmetric, place it at the first free slot from the end of the list. + // Otherwise, place it at the first free slot from the beginning of the list AND place $reverse ath the next free slot from the beginning of the list + if ($reverse == $count) { + $table[$lui] = $count; + --$lui; + } else { + $table[$lli] = $count; + ++$lli; + $table[$lli] = $reverse; + ++$lli; + } + } + } + } + return $table; + } + +} // end of class +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_barcodes_2d.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_barcodes_2d.php new file mode 100755 index 0000000..730361b --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_barcodes_2d.php @@ -0,0 +1,349 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : PHP class to creates array representations for +// 2D barcodes to be used with TCPDF. +// +//============================================================+ + +/** + * @file + * PHP class to creates array representations for 2D barcodes to be used with TCPDF. + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.015 + */ + +/** + * @class TCPDF2DBarcode + * PHP class to creates array representations for 2D barcodes to be used with TCPDF (http://www.tcpdf.org). + * @package com.tecnick.tcpdf + * @version 1.0.015 + * @author Nicola Asuni + */ +class TCPDF2DBarcode { + + /** + * Array representation of barcode. + * @protected + */ + protected $barcode_array = array(); + + /** + * This is the class constructor. + * Return an array representations for 2D barcodes:
        + *
      • $arrcode['code'] code to be printed on text label
      • + *
      • $arrcode['num_rows'] required number of rows
      • + *
      • $arrcode['num_cols'] required number of columns
      • + *
      • $arrcode['bcode'][$r][$c] value of the cell is $r row and $c column (0 = transparent, 1 = black)
      + * @param string $code code to print + * @param string $type type of barcode:
      • DATAMATRIX : Datamatrix (ISO/IEC 16022)
      • PDF417 : PDF417 (ISO/IEC 15438:2006)
      • PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parameters are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".
      • QRCODE : QRcode Low error correction
      • QRCODE,L : QRcode Low error correction
      • QRCODE,M : QRcode Medium error correction
      • QRCODE,Q : QRcode Better error correction
      • QRCODE,H : QR-CODE Best error correction
      • RAW: raw mode - comma-separad list of array rows
      • RAW2: raw mode - array rows are surrounded by square parenthesis.
      • TEST : Test matrix
      + */ + public function __construct($code, $type) { + $this->setBarcode($code, $type); + } + + /** + * Return an array representations of barcode. + * @return array + */ + public function getBarcodeArray() { + return $this->barcode_array; + } + + /** + * Send barcode as SVG image object to the standard output. + * @param int $w Width of a single rectangle element in user units. + * @param int $h Height of a single rectangle element in user units. + * @param string $color Foreground color (in SVG format) for bar elements (background is transparent). + * @public + */ + public function getBarcodeSVG($w=3, $h=3, $color='black') { + // send headers + $code = $this->getBarcodeSVGcode($w, $h, $color); + header('Content-Type: application/svg+xml'); + header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + header('Content-Disposition: inline; filename="'.md5($code).'.svg";'); + //header('Content-Length: '.strlen($code)); + echo $code; + } + + /** + * Return a SVG string representation of barcode. + * @param int $w Width of a single rectangle element in user units. + * @param int $h Height of a single rectangle element in user units. + * @param string $color Foreground color (in SVG format) for bar elements (background is transparent). + * @return string SVG code. + * @public + */ + public function getBarcodeSVGcode($w=3, $h=3, $color='black') { + // replace table for special characters + $repstr = array("\0" => '', '&' => '&', '<' => '<', '>' => '>'); + $svg = '<'.'?'.'xml version="1.0" standalone="no"'.'?'.'>'."\n"; + $svg .= ''."\n"; + $svg .= ''."\n"; + $svg .= "\t".''.strtr($this->barcode_array['code'], $repstr).''."\n"; + $svg .= "\t".''."\n"; + // print barcode elements + $y = 0; + // for each row + for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) { + $x = 0; + // for each column + for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) { + if ($this->barcode_array['bcode'][$r][$c] == 1) { + // draw a single barcode cell + $svg .= "\t\t".''."\n"; + } + $x += $w; + } + $y += $h; + } + $svg .= "\t".''."\n"; + $svg .= ''."\n"; + return $svg; + } + + /** + * Return an HTML representation of barcode. + * @param int $w Width of a single rectangle element in pixels. + * @param int $h Height of a single rectangle element in pixels. + * @param string $color Foreground color for bar elements (background is transparent). + * @return string HTML code. + * @public + */ + public function getBarcodeHTML($w=10, $h=10, $color='black') { + $html = '
      '."\n"; + // print barcode elements + $y = 0; + // for each row + for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) { + $x = 0; + // for each column + for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) { + if ($this->barcode_array['bcode'][$r][$c] == 1) { + // draw a single barcode cell + $html .= '
       
      '."\n"; + } + $x += $w; + } + $y += $h; + } + $html .= '
      '."\n"; + return $html; + } + + /** + * Send a PNG image representation of barcode (requires GD or Imagick library). + * @param int $w Width of a single rectangle element in pixels. + * @param int $h Height of a single rectangle element in pixels. + * @param array $color RGB (0-255) foreground color for bar elements (background is transparent). + * @public + */ + public function getBarcodePNG($w=3, $h=3, $color=array(0,0,0)) { + $data = $this->getBarcodePngData($w, $h, $color); + // send headers + header('Content-Type: image/png'); + header('Cache-Control: public, must-revalidate, max-age=0'); // HTTP/1.1 + header('Pragma: public'); + header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past + header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + //header('Content-Length: '.strlen($data)); + echo $data; + + } + + /** + * Return a PNG image representation of barcode (requires GD or Imagick library). + * @param int $w Width of a single rectangle element in pixels. + * @param int $h Height of a single rectangle element in pixels. + * @param array $color RGB (0-255) foreground color for bar elements (background is transparent). + * @return string|Imagick|false image or false in case of error. + * @public + */ + public function getBarcodePngData($w=3, $h=3, $color=array(0,0,0)) { + // calculate image size + $width = ($this->barcode_array['num_cols'] * $w); + $height = ($this->barcode_array['num_rows'] * $h); + if (function_exists('imagecreate')) { + // GD library + $imagick = false; + $png = imagecreate($width, $height); + $bgcol = imagecolorallocate($png, 255, 255, 255); + imagecolortransparent($png, $bgcol); + $fgcol = imagecolorallocate($png, $color[0], $color[1], $color[2]); + } elseif (extension_loaded('imagick')) { + $imagick = true; + $bgcol = new imagickpixel('rgb(255,255,255'); + $fgcol = new imagickpixel('rgb('.$color[0].','.$color[1].','.$color[2].')'); + $png = new Imagick(); + $png->newImage($width, $height, 'none', 'png'); + $bar = new imagickdraw(); + $bar->setfillcolor($fgcol); + } else { + return false; + } + // print barcode elements + $y = 0; + // for each row + for ($r = 0; $r < $this->barcode_array['num_rows']; ++$r) { + $x = 0; + // for each column + for ($c = 0; $c < $this->barcode_array['num_cols']; ++$c) { + if ($this->barcode_array['bcode'][$r][$c] == 1) { + // draw a single barcode cell + if ($imagick) { + $bar->rectangle($x, $y, ($x + $w - 1), ($y + $h - 1)); + } else { + imagefilledrectangle($png, $x, $y, ($x + $w - 1), ($y + $h - 1), $fgcol); + } + } + $x += $w; + } + $y += $h; + } + if ($imagick) { + $png->drawimage($bar); + return $png; + } else { + ob_start(); + imagepng($png); + $imagedata = ob_get_clean(); + imagedestroy($png); + return $imagedata; + } + } + + /** + * Set the barcode. + * @param string $code code to print + * @param string $type type of barcode:
      • DATAMATRIX : Datamatrix (ISO/IEC 16022)
      • PDF417 : PDF417 (ISO/IEC 15438:2006)
      • PDF417,a,e,t,s,f,o0,o1,o2,o3,o4,o5,o6 : PDF417 with parameters: a = aspect ratio (width/height); e = error correction level (0-8); t = total number of macro segments; s = macro segment index (0-99998); f = file ID; o0 = File Name (text); o1 = Segment Count (numeric); o2 = Time Stamp (numeric); o3 = Sender (text); o4 = Addressee (text); o5 = File Size (numeric); o6 = Checksum (numeric). NOTES: Parameters t, s and f are required for a Macro Control Block, all other parameters are optional. To use a comma character ',' on text options, replace it with the character 255: "\xff".
      • QRCODE : QRcode Low error correction
      • QRCODE,L : QRcode Low error correction
      • QRCODE,M : QRcode Medium error correction
      • QRCODE,Q : QRcode Better error correction
      • QRCODE,H : QR-CODE Best error correction
      • RAW: raw mode - comma-separad list of array rows
      • RAW2: raw mode - array rows are surrounded by square parenthesis.
      • TEST : Test matrix
      + * @return void + */ + public function setBarcode($code, $type) { + $mode = explode(',', $type); + $qrtype = strtoupper($mode[0]); + switch ($qrtype) { + case 'DATAMATRIX': { // DATAMATRIX (ISO/IEC 16022) + require_once(dirname(__FILE__).'/include/barcodes/datamatrix.php'); + $qrcode = new Datamatrix($code); + $this->barcode_array = $qrcode->getBarcodeArray(); + $this->barcode_array['code'] = $code; + break; + } + case 'PDF417': { // PDF417 (ISO/IEC 15438:2006) + require_once(dirname(__FILE__).'/include/barcodes/pdf417.php'); + if (!isset($mode[1]) OR ($mode[1] === '')) { + $aspectratio = 2; // default aspect ratio (width / height) + } else { + $aspectratio = floatval($mode[1]); + } + if (!isset($mode[2]) OR ($mode[2] === '')) { + $ecl = -1; // default error correction level (auto) + } else { + $ecl = intval($mode[2]); + } + // set macro block + $macro = array(); + if (isset($mode[3]) AND ($mode[3] !== '') AND isset($mode[4]) AND ($mode[4] !== '') AND isset($mode[5]) AND ($mode[5] !== '')) { + $macro['segment_total'] = intval($mode[3]); + $macro['segment_index'] = intval($mode[4]); + $macro['file_id'] = strtr($mode[5], "\xff", ','); + for ($i = 0; $i < 7; ++$i) { + $o = $i + 6; + if (isset($mode[$o]) AND ($mode[$o] !== '')) { + // add option + $macro['option_'.$i] = strtr($mode[$o], "\xff", ','); + } + } + } + $qrcode = new PDF417($code, $ecl, $aspectratio, $macro); + $this->barcode_array = $qrcode->getBarcodeArray(); + $this->barcode_array['code'] = $code; + break; + } + case 'QRCODE': { // QR-CODE + require_once(dirname(__FILE__).'/include/barcodes/qrcode.php'); + if (!isset($mode[1]) OR (!in_array($mode[1],array('L','M','Q','H')))) { + $mode[1] = 'L'; // Ddefault: Low error correction + } + $qrcode = new QRcode($code, strtoupper($mode[1])); + $this->barcode_array = $qrcode->getBarcodeArray(); + $this->barcode_array['code'] = $code; + break; + } + case 'RAW': + case 'RAW2': { // RAW MODE + // remove spaces + $code = preg_replace('/[\s]*/si', '', $code); + if (strlen($code) < 3) { + break; + } + if ($qrtype == 'RAW') { + // comma-separated rows + $rows = explode(',', $code); + } else { // RAW2 + // rows enclosed in square parentheses + $code = substr($code, 1, -1); + $rows = explode('][', $code); + } + $this->barcode_array['num_rows'] = count($rows); + $this->barcode_array['num_cols'] = strlen($rows[0]); + $this->barcode_array['bcode'] = array(); + foreach ($rows as $r) { + $this->barcode_array['bcode'][] = str_split($r, 1); + } + $this->barcode_array['code'] = $code; + break; + } + case 'TEST': { // TEST MODE + $this->barcode_array['num_rows'] = 5; + $this->barcode_array['num_cols'] = 15; + $this->barcode_array['bcode'] = array( + array(1,1,1,0,1,1,1,0,1,1,1,0,1,1,1), + array(0,1,0,0,1,0,0,0,1,0,0,0,0,1,0), + array(0,1,0,0,1,1,0,0,1,1,1,0,0,1,0), + array(0,1,0,0,1,0,0,0,0,0,1,0,0,1,0), + array(0,1,0,0,1,1,1,0,1,1,1,0,0,1,0)); + $this->barcode_array['code'] = $code; + break; + } + default: { + $this->barcode_array = array(); + } + } + } +} // end of class + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_import.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_import.php new file mode 100755 index 0000000..57f9f4f --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_import.php @@ -0,0 +1,104 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : This is a PHP class extension of the TCPDF library to +// import existing PDF documents. +// +//============================================================+ + +/** + * @file + * !!! THIS CLASS IS UNDER DEVELOPMENT !!! + * This is a PHP class extension of the TCPDF (http://www.tcpdf.org) library to import existing PDF documents.
      + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.001 + */ + +// include the TCPDF class +require_once(dirname(__FILE__).'/tcpdf.php'); +// include PDF parser class +require_once(dirname(__FILE__).'/tcpdf_parser.php'); + +/** + * @class TCPDF_IMPORT + * !!! THIS CLASS IS UNDER DEVELOPMENT !!! + * PHP class extension of the TCPDF (http://www.tcpdf.org) library to import existing PDF documents.
      + * @package com.tecnick.tcpdf + * @brief PHP class extension of the TCPDF library to import existing PDF documents. + * @version 1.0.001 + * @author Nicola Asuni - info@tecnick.com + */ +class TCPDF_IMPORT extends TCPDF { + + /** + * Import an existing PDF document + * @param string $filename Filename of the PDF document to import. + * @return void + * @public + * @since 1.0.000 (2011-05-24) + */ + public function importPDF($filename) { + // load document + $rawdata = file_get_contents($filename); + if ($rawdata === false) { + $this->Error('Unable to get the content of the file: '.$filename); + } + // configuration parameters for parser + $cfg = array( + 'die_for_errors' => false, + 'ignore_filter_decoding_errors' => true, + 'ignore_missing_filter_decoders' => true, + ); + try { + // parse PDF data + $pdf = new TCPDF_PARSER($rawdata, $cfg); + } catch (Exception $e) { + die($e->getMessage()); + } + // get the parsed data + $data = $pdf->getParsedData(); + // release some memory + unset($rawdata); + + // ... + + + print_r($data); // DEBUG + + + unset($pdf); + } + +} // END OF CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_parser.php b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_parser.php new file mode 100755 index 0000000..4156230 --- /dev/null +++ b/phpMyAdmin/vendor/tecnickcom/tcpdf/tcpdf_parser.php @@ -0,0 +1,815 @@ +. +// +// See LICENSE.TXT file for more information. +// ------------------------------------------------------------------- +// +// Description : This is a PHP class for parsing PDF documents. +// +//============================================================+ + +/** + * @file + * This is a PHP class for parsing PDF documents.
      + * @package com.tecnick.tcpdf + * @author Nicola Asuni + * @version 1.0.15 + */ + +// include class for decoding filters +require_once(dirname(__FILE__).'/include/tcpdf_filters.php'); + +/** + * @class TCPDF_PARSER + * This is a PHP class for parsing PDF documents.
      + * @package com.tecnick.tcpdf + * @brief This is a PHP class for parsing PDF documents.. + * @version 1.0.15 + * @author Nicola Asuni - info@tecnick.com + */ +class TCPDF_PARSER { + + /** + * Raw content of the PDF document. + * @private + */ + private $pdfdata = ''; + + /** + * XREF data. + * @protected + */ + protected $xref = array(); + + /** + * Array of PDF objects. + * @protected + */ + protected $objects = array(); + + /** + * Class object for decoding filters. + * @private + */ + private $FilterDecoders; + + /** + * Array of configuration parameters. + * @private + */ + private $cfg = array( + 'die_for_errors' => false, + 'ignore_filter_decoding_errors' => true, + 'ignore_missing_filter_decoders' => true, + ); + +// ----------------------------------------------------------------------------- + + /** + * Parse a PDF document an return an array of objects. + * @param string $data PDF data to parse. + * @param array $cfg Array of configuration parameters: + * 'die_for_errors' : if true termitate the program execution in case of error, otherwise thows an exception; + * 'ignore_filter_decoding_errors' : if true ignore filter decoding errors; + * 'ignore_missing_filter_decoders' : if true ignore missing filter decoding errors. + * @public + * @since 1.0.000 (2011-05-24) + */ + public function __construct($data, $cfg=array()) { + if (empty($data)) { + $this->Error('Empty PDF data.'); + } + // find the pdf header starting position + if (($trimpos = strpos($data, '%PDF-')) === FALSE) { + $this->Error('Invalid PDF data: missing %PDF header.'); + } + // get PDF content string + $this->pdfdata = substr($data, $trimpos); + // get length + $pdflen = strlen($this->pdfdata); + // set configuration parameters + $this->setConfig($cfg); + // get xref and trailer data + $this->xref = $this->getXrefData(); + // parse all document objects + $this->objects = array(); + foreach ($this->xref['xref'] as $obj => $offset) { + if (!isset($this->objects[$obj]) AND ($offset > 0)) { + // decode objects with positive offset + $this->objects[$obj] = $this->getIndirectObject($obj, $offset, true); + } + } + // release some memory + unset($this->pdfdata); + $this->pdfdata = ''; + } + + /** + * Set the configuration parameters. + * @param array $cfg Array of configuration parameters: + * 'die_for_errors' : if true termitate the program execution in case of error, otherwise thows an exception; + * 'ignore_filter_decoding_errors' : if true ignore filter decoding errors; + * 'ignore_missing_filter_decoders' : if true ignore missing filter decoding errors. + * @public + */ + protected function setConfig($cfg) { + if (isset($cfg['die_for_errors'])) { + $this->cfg['die_for_errors'] = !!$cfg['die_for_errors']; + } + if (isset($cfg['ignore_filter_decoding_errors'])) { + $this->cfg['ignore_filter_decoding_errors'] = !!$cfg['ignore_filter_decoding_errors']; + } + if (isset($cfg['ignore_missing_filter_decoders'])) { + $this->cfg['ignore_missing_filter_decoders'] = !!$cfg['ignore_missing_filter_decoders']; + } + } + + /** + * Return an array of parsed PDF document objects. + * @return array Array of parsed PDF document objects. + * @public + * @since 1.0.000 (2011-06-26) + */ + public function getParsedData() { + return array($this->xref, $this->objects); + } + + /** + * Get Cross-Reference (xref) table and trailer data from PDF document data. + * @param int $offset xref offset (if know). + * @param array $xref previous xref array (if any). + * @return array containing xref and trailer data. + * @protected + * @since 1.0.000 (2011-05-24) + */ + protected function getXrefData($offset=0, $xref=array()) { + if ($offset == 0) { + // find last startxref + if (preg_match_all('/[\r\n]startxref[\s]*[\r\n]+([0-9]+)[\s]*[\r\n]+%%EOF/i', $this->pdfdata, $matches, PREG_SET_ORDER, $offset) == 0) { + $this->Error('Unable to find startxref'); + } + $matches = array_pop($matches); + $startxref = $matches[1]; + } elseif (strpos($this->pdfdata, 'xref', $offset) == $offset) { + // Already pointing at the xref table + $startxref = $offset; + } elseif (preg_match('/([0-9]+[\s][0-9]+[\s]obj)/i', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset)) { + // Cross-Reference Stream object + $startxref = $offset; + } elseif (preg_match('/[\r\n]startxref[\s]*[\r\n]+([0-9]+)[\s]*[\r\n]+%%EOF/i', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset)) { + // startxref found + $startxref = $matches[1][0]; + } else { + $this->Error('Unable to find startxref'); + } + // check xref position + if (strpos($this->pdfdata, 'xref', $startxref) == $startxref) { + // Cross-Reference + $xref = $this->decodeXref($startxref, $xref); + } else { + // Cross-Reference Stream + $xref = $this->decodeXrefStream($startxref, $xref); + } + if (empty($xref)) { + $this->Error('Unable to find xref'); + } + return $xref; + } + + /** + * Decode the Cross-Reference section + * @param int $startxref Offset at which the xref section starts (position of the 'xref' keyword). + * @param array $xref Previous xref array (if any). + * @return array containing xref and trailer data. + * @protected + * @since 1.0.000 (2011-06-20) + */ + protected function decodeXref($startxref, $xref=array()) { + $startxref += 4; // 4 is the length of the word 'xref' + // skip initial white space chars: \x00 null (NUL), \x09 horizontal tab (HT), \x0A line feed (LF), \x0C form feed (FF), \x0D carriage return (CR), \x20 space (SP) + $offset = $startxref + strspn($this->pdfdata, "\x00\x09\x0a\x0c\x0d\x20", $startxref); + // initialize object number + $obj_num = 0; + // search for cross-reference entries or subsection + while (preg_match('/([0-9]+)[\x20]([0-9]+)[\x20]?([nf]?)(\r\n|[\x20]?[\r\n])/', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) { + if ($matches[0][1] != $offset) { + // we are on another section + break; + } + $offset += strlen($matches[0][0]); + if ($matches[3][0] == 'n') { + // create unique object index: [object number]_[generation number] + $index = $obj_num.'_'.intval($matches[2][0]); + // check if object already exist + if (!isset($xref['xref'][$index])) { + // store object offset position + $xref['xref'][$index] = intval($matches[1][0]); + } + ++$obj_num; + } elseif ($matches[3][0] == 'f') { + ++$obj_num; + } else { + // object number (index) + $obj_num = intval($matches[1][0]); + } + } + // get trailer data + if (preg_match('/trailer[\s]*<<(.*)>>/isU', $this->pdfdata, $matches, PREG_OFFSET_CAPTURE, $offset) > 0) { + $trailer_data = $matches[1][0]; + if (!isset($xref['trailer']) OR empty($xref['trailer'])) { + // get only the last updated version + $xref['trailer'] = array(); + // parse trailer_data + if (preg_match('/Size[\s]+([0-9]+)/i', $trailer_data, $matches) > 0) { + $xref['trailer']['size'] = intval($matches[1]); + } + if (preg_match('/Root[\s]+([0-9]+)[\s]+([0-9]+)[\s]+R/i', $trailer_data, $matches) > 0) { + $xref['trailer']['root'] = intval($matches[1]).'_'.intval($matches[2]); + } + if (preg_match('/Encrypt[\s]+([0-9]+)[\s]+([0-9]+)[\s]+R/i', $trailer_data, $matches) > 0) { + $xref['trailer']['encrypt'] = intval($matches[1]).'_'.intval($matches[2]); + } + if (preg_match('/Info[\s]+([0-9]+)[\s]+([0-9]+)[\s]+R/i', $trailer_data, $matches) > 0) { + $xref['trailer']['info'] = intval($matches[1]).'_'.intval($matches[2]); + } + if (preg_match('/ID[\s]*[\[][\s]*[<]([^>]*)[>][\s]*[<]([^>]*)[>]/i', $trailer_data, $matches) > 0) { + $xref['trailer']['id'] = array(); + $xref['trailer']['id'][0] = $matches[1]; + $xref['trailer']['id'][1] = $matches[2]; + } + } + if (preg_match('/Prev[\s]+([0-9]+)/i', $trailer_data, $matches) > 0) { + // get previous xref + $xref = $this->getXrefData(intval($matches[1]), $xref); + } + } else { + $this->Error('Unable to find trailer'); + } + return $xref; + } + + /** + * Decode the Cross-Reference Stream section + * @param int $startxref Offset at which the xref section starts. + * @param array $xref Previous xref array (if any). + * @return array containing xref and trailer data. + * @protected + * @since 1.0.003 (2013-03-16) + */ + protected function decodeXrefStream($startxref, $xref=array()) { + // try to read Cross-Reference Stream + $xrefobj = $this->getRawObject($startxref); + $xrefcrs = $this->getIndirectObject($xrefobj[1], $startxref, true); + if (!isset($xref['trailer']) OR empty($xref['trailer'])) { + // get only the last updated version + $xref['trailer'] = array(); + $filltrailer = true; + } else { + $filltrailer = false; + } + if (!isset($xref['xref'])) { + $xref['xref'] = array(); + } + $valid_crs = false; + $columns = 0; + $sarr = $xrefcrs[0][1]; + if (!is_array($sarr)) { + $sarr = array(); + } + foreach ($sarr as $k => $v) { + if (($v[0] == '/') AND ($v[1] == 'Type') AND (isset($sarr[($k +1)]) AND ($sarr[($k +1)][0] == '/') AND ($sarr[($k +1)][1] == 'XRef'))) { + $valid_crs = true; + } elseif (($v[0] == '/') AND ($v[1] == 'Index') AND (isset($sarr[($k +1)]))) { + // first object number in the subsection + $index_first = intval($sarr[($k +1)][1][0][1]); + // number of entries in the subsection + $index_entries = intval($sarr[($k +1)][1][1][1]); + } elseif (($v[0] == '/') AND ($v[1] == 'Prev') AND (isset($sarr[($k +1)]) AND ($sarr[($k +1)][0] == 'numeric'))) { + // get previous xref offset + $prevxref = intval($sarr[($k +1)][1]); + } elseif (($v[0] == '/') AND ($v[1] == 'W') AND (isset($sarr[($k +1)]))) { + // number of bytes (in the decoded stream) of the corresponding field + $wb = array(); + $wb[0] = intval($sarr[($k +1)][1][0][1]); + $wb[1] = intval($sarr[($k +1)][1][1][1]); + $wb[2] = intval($sarr[($k +1)][1][2][1]); + } elseif (($v[0] == '/') AND ($v[1] == 'DecodeParms') AND (isset($sarr[($k +1)][1]))) { + $decpar = $sarr[($k +1)][1]; + foreach ($decpar as $kdc => $vdc) { + if (($vdc[0] == '/') AND ($vdc[1] == 'Columns') AND (isset($decpar[($kdc +1)]) AND ($decpar[($kdc +1)][0] == 'numeric'))) { + $columns = intval($decpar[($kdc +1)][1]); + } elseif (($vdc[0] == '/') AND ($vdc[1] == 'Predictor') AND (isset($decpar[($kdc +1)]) AND ($decpar[($kdc +1)][0] == 'numeric'))) { + $predictor = intval($decpar[($kdc +1)][1]); + } + } + } elseif ($filltrailer) { + if (($v[0] == '/') AND ($v[1] == 'Size') AND (isset($sarr[($k +1)]) AND ($sarr[($k +1)][0] == 'numeric'))) { + $xref['trailer']['size'] = $sarr[($k +1)][1]; + } elseif (($v[0] == '/') AND ($v[1] == 'Root') AND (isset($sarr[($k +1)]) AND ($sarr[($k +1)][0] == 'objref'))) { + $xref['trailer']['root'] = $sarr[($k +1)][1]; + } elseif (($v[0] == '/') AND ($v[1] == 'Info') AND (isset($sarr[($k +1)]) AND ($sarr[($k +1)][0] == 'objref'))) { + $xref['trailer']['info'] = $sarr[($k +1)][1]; + } elseif (($v[0] == '/') AND ($v[1] == 'Encrypt') AND (isset($sarr[($k +1)]) AND ($sarr[($k +1)][0] == 'objref'))) { + $xref['trailer']['encrypt'] = $sarr[($k +1)][1]; + } elseif (($v[0] == '/') AND ($v[1] == 'ID') AND (isset($sarr[($k +1)]))) { + $xref['trailer']['id'] = array(); + $xref['trailer']['id'][0] = $sarr[($k +1)][1][0][1]; + $xref['trailer']['id'][1] = $sarr[($k +1)][1][1][1]; + } + } + } + // decode data + if ($valid_crs AND isset($xrefcrs[1][3][0])) { + // number of bytes in a row + $rowlen = ($columns + 1); + // convert the stream into an array of integers + $sdata = unpack('C*', $xrefcrs[1][3][0]); + // split the rows + $sdata = array_chunk($sdata, $rowlen); + // initialize decoded array + $ddata = array(); + // initialize first row with zeros + $prev_row = array_fill (0, $rowlen, 0); + // for each row apply PNG unpredictor + foreach ($sdata as $k => $row) { + // initialize new row + $ddata[$k] = array(); + // get PNG predictor value + $predictor = (10 + $row[0]); + // for each byte on the row + for ($i=1; $i<=$columns; ++$i) { + // new index + $j = ($i - 1); + $row_up = $prev_row[$j]; + if ($i == 1) { + $row_left = 0; + $row_upleft = 0; + } else { + $row_left = $row[($i - 1)]; + $row_upleft = $prev_row[($j - 1)]; + } + switch ($predictor) { + case 10: { // PNG prediction (on encoding, PNG None on all rows) + $ddata[$k][$j] = $row[$i]; + break; + } + case 11: { // PNG prediction (on encoding, PNG Sub on all rows) + $ddata[$k][$j] = (($row[$i] + $row_left) & 0xff); + break; + } + case 12: { // PNG prediction (on encoding, PNG Up on all rows) + $ddata[$k][$j] = (($row[$i] + $row_up) & 0xff); + break; + } + case 13: { // PNG prediction (on encoding, PNG Average on all rows) + $ddata[$k][$j] = (($row[$i] + (($row_left + $row_up) / 2)) & 0xff); + break; + } + case 14: { // PNG prediction (on encoding, PNG Paeth on all rows) + // initial estimate + $p = ($row_left + $row_up - $row_upleft); + // distances + $pa = abs($p - $row_left); + $pb = abs($p - $row_up); + $pc = abs($p - $row_upleft); + $pmin = min($pa, $pb, $pc); + // return minimum distance + switch ($pmin) { + case $pa: { + $ddata[$k][$j] = (($row[$i] + $row_left) & 0xff); + break; + } + case $pb: { + $ddata[$k][$j] = (($row[$i] + $row_up) & 0xff); + break; + } + case $pc: { + $ddata[$k][$j] = (($row[$i] + $row_upleft) & 0xff); + break; + } + } + break; + } + default: { // PNG prediction (on encoding, PNG optimum) + $this->Error('Unknown PNG predictor'); + break; + } + } + } + $prev_row = $ddata[$k]; + } // end for each row + // complete decoding + $sdata = array(); + // for every row + foreach ($ddata as $k => $row) { + // initialize new row + $sdata[$k] = array(0, 0, 0); + if ($wb[0] == 0) { + // default type field + $sdata[$k][0] = 1; + } + $i = 0; // count bytes in the row + // for every column + for ($c = 0; $c < 3; ++$c) { + // for every byte on the column + for ($b = 0; $b < $wb[$c]; ++$b) { + if (isset($row[$i])) { + $sdata[$k][$c] += ($row[$i] << (($wb[$c] - 1 - $b) * 8)); + } + ++$i; + } + } + } + $ddata = array(); + // fill xref + if (isset($index_first)) { + $obj_num = $index_first; + } else { + $obj_num = 0; + } + foreach ($sdata as $k => $row) { + switch ($row[0]) { + case 0: { // (f) linked list of free objects + break; + } + case 1: { // (n) objects that are in use but are not compressed + // create unique object index: [object number]_[generation number] + $index = $obj_num.'_'.$row[2]; + // check if object already exist + if (!isset($xref['xref'][$index])) { + // store object offset position + $xref['xref'][$index] = $row[1]; + } + break; + } + case 2: { // compressed objects + // $row[1] = object number of the object stream in which this object is stored + // $row[2] = index of this object within the object stream + $index = $row[1].'_0_'.$row[2]; + $xref['xref'][$index] = -1; + break; + } + default: { // null objects + break; + } + } + ++$obj_num; + } + } // end decoding data + if (isset($prevxref)) { + // get previous xref + $xref = $this->getXrefData($prevxref, $xref); + } + return $xref; + } + + /** + * Get object type, raw value and offset to next object + * @param int $offset Object offset. + * @return array containing object type, raw value and offset to next object + * @protected + * @since 1.0.000 (2011-06-20) + */ + protected function getRawObject($offset=0) { + $objtype = ''; // object type to be returned + $objval = ''; // object value to be returned + // skip initial white space chars: \x00 null (NUL), \x09 horizontal tab (HT), \x0A line feed (LF), \x0C form feed (FF), \x0D carriage return (CR), \x20 space (SP) + $offset += strspn($this->pdfdata, "\x00\x09\x0a\x0c\x0d\x20", $offset); + // get first char + $char = $this->pdfdata[$offset]; + // get object type + switch ($char) { + case '%': { // \x25 PERCENT SIGN + // skip comment and search for next token + $next = strcspn($this->pdfdata, "\r\n", $offset); + if ($next > 0) { + $offset += $next; + return $this->getRawObject($offset); + } + break; + } + case '/': { // \x2F SOLIDUS + // name object + $objtype = $char; + ++$offset; + if (preg_match('/^([^\x00\x09\x0a\x0c\x0d\x20\s\x28\x29\x3c\x3e\x5b\x5d\x7b\x7d\x2f\x25]+)/', substr($this->pdfdata, $offset, 256), $matches) == 1) { + $objval = $matches[1]; // unescaped value + $offset += strlen($objval); + } + break; + } + case '(': // \x28 LEFT PARENTHESIS + case ')': { // \x29 RIGHT PARENTHESIS + // literal string object + $objtype = $char; + ++$offset; + $strpos = $offset; + if ($char == '(') { + $open_bracket = 1; + while ($open_bracket > 0) { + if (!isset($this->pdfdata[$strpos])) { + break; + } + $ch = $this->pdfdata[$strpos]; + switch ($ch) { + case '\\': { // REVERSE SOLIDUS (5Ch) (Backslash) + // skip next character + ++$strpos; + break; + } + case '(': { // LEFT PARENHESIS (28h) + ++$open_bracket; + break; + } + case ')': { // RIGHT PARENTHESIS (29h) + --$open_bracket; + break; + } + } + ++$strpos; + } + $objval = substr($this->pdfdata, $offset, ($strpos - $offset - 1)); + $offset = $strpos; + } + break; + } + case '[': // \x5B LEFT SQUARE BRACKET + case ']': { // \x5D RIGHT SQUARE BRACKET + // array object + $objtype = $char; + ++$offset; + if ($char == '[') { + // get array content + $objval = array(); + do { + // get element + $element = $this->getRawObject($offset); + $offset = $element[2]; + $objval[] = $element; + } while ($element[0] != ']'); + // remove closing delimiter + array_pop($objval); + } + break; + } + case '<': // \x3C LESS-THAN SIGN + case '>': { // \x3E GREATER-THAN SIGN + if (isset($this->pdfdata[($offset + 1)]) AND ($this->pdfdata[($offset + 1)] == $char)) { + // dictionary object + $objtype = $char.$char; + $offset += 2; + if ($char == '<') { + // get array content + $objval = array(); + do { + // get element + $element = $this->getRawObject($offset); + $offset = $element[2]; + $objval[] = $element; + } while ($element[0] != '>>'); + // remove closing delimiter + array_pop($objval); + } + } else { + // hexadecimal string object + $objtype = $char; + ++$offset; + if (($char == '<') AND (preg_match('/^([0-9A-Fa-f\x09\x0a\x0c\x0d\x20]+)>/iU', substr($this->pdfdata, $offset), $matches) == 1)) { + // remove white space characters + $objval = strtr($matches[1], "\x09\x0a\x0c\x0d\x20", ''); + $offset += strlen($matches[0]); + } elseif (($endpos = strpos($this->pdfdata, '>', $offset)) !== FALSE) { + $offset = $endpos + 1; + } + } + break; + } + default: { + if (substr($this->pdfdata, $offset, 6) == 'endobj') { + // indirect object + $objtype = 'endobj'; + $offset += 6; + } elseif (substr($this->pdfdata, $offset, 4) == 'null') { + // null object + $objtype = 'null'; + $offset += 4; + $objval = 'null'; + } elseif (substr($this->pdfdata, $offset, 4) == 'true') { + // boolean true object + $objtype = 'boolean'; + $offset += 4; + $objval = 'true'; + } elseif (substr($this->pdfdata, $offset, 5) == 'false') { + // boolean false object + $objtype = 'boolean'; + $offset += 5; + $objval = 'false'; + } elseif (substr($this->pdfdata, $offset, 6) == 'stream') { + // start stream object + $objtype = 'stream'; + $offset += 6; + if (preg_match('/^([\r]?[\n])/isU', substr($this->pdfdata, $offset), $matches) == 1) { + $offset += strlen($matches[0]); + if (preg_match('/(endstream)[\x09\x0a\x0c\x0d\x20]/isU', substr($this->pdfdata, $offset), $matches, PREG_OFFSET_CAPTURE) == 1) { + $objval = substr($this->pdfdata, $offset, $matches[0][1]); + $offset += $matches[1][1]; + } + } + } elseif (substr($this->pdfdata, $offset, 9) == 'endstream') { + // end stream object + $objtype = 'endstream'; + $offset += 9; + } elseif (preg_match('/^([0-9]+)[\s]+([0-9]+)[\s]+R/iU', substr($this->pdfdata, $offset, 33), $matches) == 1) { + // indirect object reference + $objtype = 'objref'; + $offset += strlen($matches[0]); + $objval = intval($matches[1]).'_'.intval($matches[2]); + } elseif (preg_match('/^([0-9]+)[\s]+([0-9]+)[\s]+obj/iU', substr($this->pdfdata, $offset, 33), $matches) == 1) { + // object start + $objtype = 'obj'; + $objval = intval($matches[1]).'_'.intval($matches[2]); + $offset += strlen ($matches[0]); + } elseif (($numlen = strspn($this->pdfdata, '+-.0123456789', $offset)) > 0) { + // numeric object + $objtype = 'numeric'; + $objval = substr($this->pdfdata, $offset, $numlen); + $offset += $numlen; + } + break; + } + } + return array($objtype, $objval, $offset); + } + + /** + * Get content of indirect object. + * @param string $obj_ref Object number and generation number separated by underscore character. + * @param int $offset Object offset. + * @param boolean $decoding If true decode streams. + * @return array containing object data. + * @protected + * @since 1.0.000 (2011-05-24) + */ + protected function getIndirectObject($obj_ref, $offset=0, $decoding=true) { + $obj = explode('_', $obj_ref); + if (($obj === false) OR (count($obj) != 2)) { + $this->Error('Invalid object reference: '.$obj); + return; + } + $objref = $obj[0].' '.$obj[1].' obj'; + // ignore leading zeros + $offset += strspn($this->pdfdata, '0', $offset); + if (strpos($this->pdfdata, $objref, $offset) != $offset) { + // an indirect reference to an undefined object shall be considered a reference to the null object + return array('null', 'null', $offset); + } + // starting position of object content + $offset += strlen($objref); + // get array of object content + $objdata = array(); + $i = 0; // object main index + do { + $oldoffset = $offset; + // get element + $element = $this->getRawObject($offset); + $offset = $element[2]; + // decode stream using stream's dictionary information + if ($decoding AND ($element[0] == 'stream') AND (isset($objdata[($i - 1)][0])) AND ($objdata[($i - 1)][0] == '<<')) { + $element[3] = $this->decodeStream($objdata[($i - 1)][1], $element[1]); + } + $objdata[$i] = $element; + ++$i; + } while (($element[0] != 'endobj') AND ($offset != $oldoffset)); + // remove closing delimiter + array_pop($objdata); + // return raw object content + return $objdata; + } + + /** + * Get the content of object, resolving indect object reference if necessary. + * @param string $obj Object value. + * @return array containing object data. + * @protected + * @since 1.0.000 (2011-06-26) + */ + protected function getObjectVal($obj) { + if ($obj[0] == 'objref') { + // reference to indirect object + if (isset($this->objects[$obj[1]])) { + // this object has been already parsed + return $this->objects[$obj[1]]; + } elseif (isset($this->xref[$obj[1]])) { + // parse new object + $this->objects[$obj[1]] = $this->getIndirectObject($obj[1], $this->xref[$obj[1]], false); + return $this->objects[$obj[1]]; + } + } + return $obj; + } + + /** + * Decode the specified stream. + * @param array $sdic Stream's dictionary array. + * @param string $stream Stream to decode. + * @return array containing decoded stream data and remaining filters. + * @protected + * @since 1.0.000 (2011-06-22) + */ + protected function decodeStream($sdic, $stream) { + // get stream length and filters + $slength = strlen($stream); + if ($slength <= 0) { + return array('', array()); + } + $filters = array(); + foreach ($sdic as $k => $v) { + if ($v[0] == '/') { + if (($v[1] == 'Length') AND (isset($sdic[($k + 1)])) AND ($sdic[($k + 1)][0] == 'numeric')) { + // get declared stream length + $declength = intval($sdic[($k + 1)][1]); + if ($declength < $slength) { + $stream = substr($stream, 0, $declength); + $slength = $declength; + } + } elseif (($v[1] == 'Filter') AND (isset($sdic[($k + 1)]))) { + // resolve indirect object + $objval = $this->getObjectVal($sdic[($k + 1)]); + if ($objval[0] == '/') { + // single filter + $filters[] = $objval[1]; + } elseif ($objval[0] == '[') { + // array of filters + foreach ($objval[1] as $flt) { + if ($flt[0] == '/') { + $filters[] = $flt[1]; + } + } + } + } + } + } + // decode the stream + $remaining_filters = array(); + foreach ($filters as $filter) { + if (in_array($filter, TCPDF_FILTERS::getAvailableFilters())) { + try { + $stream = TCPDF_FILTERS::decodeFilter($filter, $stream); + } catch (Exception $e) { + $emsg = $e->getMessage(); + if ((($emsg[0] == '~') AND !$this->cfg['ignore_missing_filter_decoders']) + OR (($emsg[0] != '~') AND !$this->cfg['ignore_filter_decoding_errors'])) { + $this->Error($e->getMessage()); + } + } + } else { + // add missing filter to array + $remaining_filters[] = $filter; + } + } + return array($stream, $remaining_filters); + } + + /** + * Throw an exception or print an error message and die if the K_TCPDF_PARSER_THROW_EXCEPTION_ERROR constant is set to true. + * @param string $msg The error message + * @public + * @since 1.0.000 (2011-05-23) + */ + public function Error($msg) { + if ($this->cfg['die_for_errors']) { + die('TCPDF_PARSER ERROR: '.$msg); + } else { + throw new Exception('TCPDF_PARSER ERROR: '.$msg); + } + } + +} // END OF TCPDF_PARSER CLASS + +//============================================================+ +// END OF FILE +//============================================================+ diff --git a/phpMyAdmin/vendor/twig/extensions/.travis.yml b/phpMyAdmin/vendor/twig/extensions/.travis.yml new file mode 100755 index 0000000..88c7404 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/.travis.yml @@ -0,0 +1,34 @@ +language: php + +sudo: false + +cache: + directories: + - vendor + - $HOME/.composer/cache/files + +env: + - DEPS=no + +before_install: + - phpenv config-rm xdebug.ini + +before_script: + - if [ "$DEPS" == "low" ]; then composer --prefer-lowest --prefer-stable update; fi; + - if [ "$DEPS" == "no" ]; then composer install; fi; + +script: | + ./vendor/bin/simple-phpunit + +matrix: + include: + - php: 5.3 + dist: precise + - php: 5.4 + - php: 5.5 + - php: 5.6 + env: DEPS=low + - php: 7.0 + - php: 7.1 + - php: 7.2 + fast_finish: true diff --git a/phpMyAdmin/vendor/twig/extensions/LICENSE b/phpMyAdmin/vendor/twig/extensions/LICENSE new file mode 100755 index 0000000..b420d71 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2010-2017 Fabien Potencier + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is furnished +to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/phpMyAdmin/vendor/twig/extensions/README.rst b/phpMyAdmin/vendor/twig/extensions/README.rst new file mode 100755 index 0000000..2b4ea92 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/README.rst @@ -0,0 +1,14 @@ +Twig Extensions Repository +========================== + +This repository hosts Twig Extensions that do not belong to the core but can +be nonetheless interesting to share with other developers. + +Fork this repository, add your extension, and request a pull. + +More Information +---------------- + +Read the `documentation`_ for more information. + +.. _documentation: http://twig-extensions.readthedocs.io/ diff --git a/phpMyAdmin/vendor/twig/extensions/composer.json b/phpMyAdmin/vendor/twig/extensions/composer.json new file mode 100755 index 0000000..3644d8e --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/composer.json @@ -0,0 +1,32 @@ +{ + "name": "twig/extensions", + "description": "Common additional features for Twig that do not directly belong in core", + "keywords": ["i18n","text"], + "type": "library", + "license": "MIT", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + } + ], + "require": { + "twig/twig": "^1.27|^2.0" + }, + "require-dev": { + "symfony/phpunit-bridge": "^3.4", + "symfony/translation": "^2.7|^3.4" + }, + "suggest": { + "symfony/translation": "Allow the time_diff output to be translated" + }, + "autoload": { + "psr-0": { "Twig_Extensions_": "lib/" }, + "psr-4": { "Twig\\Extensions\\": "src/" } + }, + "extra": { + "branch-alias": { + "dev-master": "1.5-dev" + } + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Autoloader.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Autoloader.php new file mode 100755 index 0000000..9ad5a46 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Autoloader.php @@ -0,0 +1,48 @@ + + * + * @deprecated since version 1.5, use Composer instead. + */ +class Twig_Extensions_Autoloader +{ + /** + * Registers Twig_Extensions_Autoloader as an SPL autoloader. + */ + public static function register() + { + spl_autoload_register(array(new self(), 'autoload')); + } + + /** + * Handles autoloading of classes. + * + * @param string $class a class name + * + * @return bool Returns true if the class has been loaded + */ + public static function autoload($class) + { + if (0 !== strpos($class, 'Twig_Extensions')) { + return; + } + + if (file_exists($file = __DIR__.'/../../'.str_replace('_', '/', $class).'.php')) { + require $file; + } + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Array.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Array.php new file mode 100755 index 0000000..a5eaf6d --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Array.php @@ -0,0 +1,56 @@ + + */ +class Twig_Extensions_Extension_Array extends Twig_Extension +{ + /** + * {@inheritdoc} + */ + public function getFilters() + { + $filters = array( + new Twig_SimpleFilter('shuffle', 'twig_shuffle_filter'), + ); + + return $filters; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'array'; + } +} + +/** + * Shuffles an array. + * + * @param array|Traversable $array An array + * + * @return array + */ +function twig_shuffle_filter($array) +{ + if ($array instanceof Traversable) { + $array = iterator_to_array($array, false); + } + + shuffle($array); + + return $array; +} + +class_alias('Twig_Extensions_Extension_Array', 'Twig\Extensions\ArrayExtension', false); diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php new file mode 100755 index 0000000..1cdd455 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Date.php @@ -0,0 +1,107 @@ + + */ +class Twig_Extensions_Extension_Date extends Twig_Extension +{ + public static $units = array( + 'y' => 'year', + 'm' => 'month', + 'd' => 'day', + 'h' => 'hour', + 'i' => 'minute', + 's' => 'second', + ); + + /** + * @var TranslatorInterface + */ + private $translator; + + public function __construct(TranslatorInterface $translator = null) + { + // Ignore the IdentityTranslator, otherwise the parameters won't be replaced properly + if ($translator instanceof IdentityTranslator) { + $translator = null; + } + + $this->translator = $translator; + } + + /** + * {@inheritdoc} + */ + public function getFilters() + { + return array( + new Twig_SimpleFilter('time_diff', array($this, 'diff'), array('needs_environment' => true)), + ); + } + + /** + * Filter for converting dates to a time ago string like Facebook and Twitter has. + * + * @param Twig_Environment $env a Twig_Environment instance + * @param string|DateTime $date a string or DateTime object to convert + * @param string|DateTime $now A string or DateTime object to compare with. If none given, the current time will be used. + * + * @return string the converted time + */ + public function diff(Twig_Environment $env, $date, $now = null) + { + // Convert both dates to DateTime instances. + $date = twig_date_converter($env, $date); + $now = twig_date_converter($env, $now); + + // Get the difference between the two DateTime objects. + $diff = $date->diff($now); + + // Check for each interval if it appears in the $diff object. + foreach (self::$units as $attribute => $unit) { + $count = $diff->$attribute; + + if (0 !== $count) { + return $this->getPluralizedInterval($count, $diff->invert, $unit); + } + } + + return ''; + } + + protected function getPluralizedInterval($count, $invert, $unit) + { + if ($this->translator) { + $id = sprintf('diff.%s.%s', $invert ? 'in' : 'ago', $unit); + + return $this->translator->transChoice($id, $count, array('%count%' => $count), 'date'); + } + + if (1 !== $count) { + $unit .= 's'; + } + + return $invert ? "in $count $unit" : "$count $unit ago"; + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'date'; + } +} + +class_alias('Twig_Extensions_Extension_Date', 'Twig\Extensions\DateExtension', false); diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/I18n.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/I18n.php new file mode 100755 index 0000000..41cb9ce --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/I18n.php @@ -0,0 +1,41 @@ + true)), + new Twig_SimpleFilter('localizednumber', 'twig_localized_number_filter'), + new Twig_SimpleFilter('localizedcurrency', 'twig_localized_currency_filter'), + ); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'intl'; + } +} + +function twig_localized_date_filter(Twig_Environment $env, $date, $dateFormat = 'medium', $timeFormat = 'medium', $locale = null, $timezone = null, $format = null, $calendar = 'gregorian') +{ + $date = twig_date_converter($env, $date, $timezone); + + $formatValues = array( + 'none' => IntlDateFormatter::NONE, + 'short' => IntlDateFormatter::SHORT, + 'medium' => IntlDateFormatter::MEDIUM, + 'long' => IntlDateFormatter::LONG, + 'full' => IntlDateFormatter::FULL, + ); + + if (PHP_VERSION_ID < 50500 || !class_exists('IntlTimeZone')) { + $formatter = IntlDateFormatter::create( + $locale, + $formatValues[$dateFormat], + $formatValues[$timeFormat], + $date->getTimezone()->getName(), + 'gregorian' === $calendar ? IntlDateFormatter::GREGORIAN : IntlDateFormatter::TRADITIONAL, + $format + ); + + return $formatter->format($date->getTimestamp()); + } + + $formatter = IntlDateFormatter::create( + $locale, + $formatValues[$dateFormat], + $formatValues[$timeFormat], + IntlTimeZone::createTimeZone($date->getTimezone()->getName()), + 'gregorian' === $calendar ? IntlDateFormatter::GREGORIAN : IntlDateFormatter::TRADITIONAL, + $format + ); + + return $formatter->format($date->getTimestamp()); +} + +function twig_localized_number_filter($number, $style = 'decimal', $type = 'default', $locale = null) +{ + static $typeValues = array( + 'default' => NumberFormatter::TYPE_DEFAULT, + 'int32' => NumberFormatter::TYPE_INT32, + 'int64' => NumberFormatter::TYPE_INT64, + 'double' => NumberFormatter::TYPE_DOUBLE, + 'currency' => NumberFormatter::TYPE_CURRENCY, + ); + + $formatter = twig_get_number_formatter($locale, $style); + + if (!isset($typeValues[$type])) { + throw new Twig_Error_Syntax(sprintf('The type "%s" does not exist. Known types are: "%s"', $type, implode('", "', array_keys($typeValues)))); + } + + return $formatter->format($number, $typeValues[$type]); +} + +function twig_localized_currency_filter($number, $currency = null, $locale = null) +{ + $formatter = twig_get_number_formatter($locale, 'currency'); + + return $formatter->formatCurrency($number, $currency); +} + +/** + * Gets a number formatter instance according to given locale and formatter. + * + * @param string $locale Locale in which the number would be formatted + * @param int $style Style of the formatting + * + * @return NumberFormatter A NumberFormatter instance + */ +function twig_get_number_formatter($locale, $style) +{ + static $formatter, $currentStyle; + + $locale = null !== $locale ? $locale : Locale::getDefault(); + + if ($formatter && $formatter->getLocale() === $locale && $currentStyle === $style) { + // Return same instance of NumberFormatter if parameters are the same + // to those in previous call + return $formatter; + } + + static $styleValues = array( + 'decimal' => NumberFormatter::DECIMAL, + 'currency' => NumberFormatter::CURRENCY, + 'percent' => NumberFormatter::PERCENT, + 'scientific' => NumberFormatter::SCIENTIFIC, + 'spellout' => NumberFormatter::SPELLOUT, + 'ordinal' => NumberFormatter::ORDINAL, + 'duration' => NumberFormatter::DURATION, + ); + + if (!isset($styleValues[$style])) { + throw new Twig_Error_Syntax(sprintf('The style "%s" does not exist. Known styles are: "%s"', $style, implode('", "', array_keys($styleValues)))); + } + + $currentStyle = $style; + + $formatter = NumberFormatter::create($locale, $styleValues[$style]); + + return $formatter; +} + +class_alias('Twig_Extensions_Extension_Intl', 'Twig\Extensions\IntlExtension', false); diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php new file mode 100755 index 0000000..52d3591 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Extension/Text.php @@ -0,0 +1,99 @@ + + */ +class Twig_Extensions_Extension_Text extends Twig_Extension +{ + /** + * {@inheritdoc} + */ + public function getFilters() + { + return array( + new Twig_SimpleFilter('truncate', 'twig_truncate_filter', array('needs_environment' => true)), + new Twig_SimpleFilter('wordwrap', 'twig_wordwrap_filter', array('needs_environment' => true)), + ); + } + + /** + * {@inheritdoc} + */ + public function getName() + { + return 'Text'; + } +} + +if (function_exists('mb_get_info')) { + function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $preserve = false, $separator = '...') + { + if (mb_strlen($value, $env->getCharset()) > $length) { + if ($preserve) { + // If breakpoint is on the last word, return the value without separator. + if (false === ($breakpoint = mb_strpos($value, ' ', $length, $env->getCharset()))) { + return $value; + } + + $length = $breakpoint; + } + + return rtrim(mb_substr($value, 0, $length, $env->getCharset())).$separator; + } + + return $value; + } + + function twig_wordwrap_filter(Twig_Environment $env, $value, $length = 80, $separator = "\n", $preserve = false) + { + $sentences = array(); + + $previous = mb_regex_encoding(); + mb_regex_encoding($env->getCharset()); + + $pieces = mb_split($separator, $value); + mb_regex_encoding($previous); + + foreach ($pieces as $piece) { + while (!$preserve && mb_strlen($piece, $env->getCharset()) > $length) { + $sentences[] = mb_substr($piece, 0, $length, $env->getCharset()); + $piece = mb_substr($piece, $length, 2048, $env->getCharset()); + } + + $sentences[] = $piece; + } + + return implode($separator, $sentences); + } +} else { + function twig_truncate_filter(Twig_Environment $env, $value, $length = 30, $preserve = false, $separator = '...') + { + if (strlen($value) > $length) { + if ($preserve) { + if (false !== ($breakpoint = strpos($value, ' ', $length))) { + $length = $breakpoint; + } + } + + return rtrim(substr($value, 0, $length)).$separator; + } + + return $value; + } + + function twig_wordwrap_filter(Twig_Environment $env, $value, $length = 80, $separator = "\n", $preserve = false) + { + return wordwrap($value, $length, $separator, !$preserve); + } +} + +class_alias('Twig_Extensions_Extension_Text', 'Twig\Extensions\TextExtension', false); diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar.php new file mode 100755 index 0000000..b6cc0a7 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar.php @@ -0,0 +1,43 @@ +name = $name; + } + + /** + * @param Twig_Parser $parser + */ + public function setParser(Twig_Parser $parser) + { + $this->parser = $parser; + } + + /** + * @return string + */ + public function getName() + { + return $this->name; + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Arguments.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Arguments.php new file mode 100755 index 0000000..abb9e0e --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Arguments.php @@ -0,0 +1,26 @@ +', $this->name); + } + + public function parse(Twig_Token $token) + { + return $this->parser->getExpressionParser()->parseArguments(); + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Array.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Array.php new file mode 100755 index 0000000..94d7b8c --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Array.php @@ -0,0 +1,26 @@ +', $this->name); + } + + public function parse(Twig_Token $token) + { + return $this->parser->getExpressionParser()->parseArrayExpression(); + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Body.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Body.php new file mode 100755 index 0000000..b2ac43e --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Body.php @@ -0,0 +1,43 @@ +end = null === $end ? 'end'.$name : $end; + } + + public function __toString() + { + return sprintf('<%s:body>', $this->name); + } + + public function parse(Twig_Token $token) + { + $stream = $this->parser->getStream(); + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + return $this->parser->subparse(array($this, 'decideBlockEnd'), true); + } + + public function decideBlockEnd(Twig_Token $token) + { + return $token->test($this->end); + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Boolean.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Boolean.php new file mode 100755 index 0000000..578567e --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Boolean.php @@ -0,0 +1,28 @@ +', $this->name); + } + + public function parse(Twig_Token $token) + { + $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, array('true', 'false')); + + return new Twig_Node_Expression_Constant('true' === $token->getValue() ? true : false, $token->getLine()); + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Constant.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Constant.php new file mode 100755 index 0000000..8d82b82 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Constant.php @@ -0,0 +1,41 @@ +name = $name; + $this->type = null === $type ? Twig_Token::NAME_TYPE : $type; + } + + public function __toString() + { + return $this->name; + } + + public function parse(Twig_Token $token) + { + $this->parser->getStream()->expect($this->type, $this->name); + + return $this->name; + } + + public function getType() + { + return $this->type; + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Expression.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Expression.php new file mode 100755 index 0000000..b73156e --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Expression.php @@ -0,0 +1,26 @@ +', $this->name); + } + + public function parse(Twig_Token $token) + { + return $this->parser->getExpressionParser()->parseExpression(); + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Hash.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Hash.php new file mode 100755 index 0000000..5ea3e69 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Hash.php @@ -0,0 +1,26 @@ +', $this->name); + } + + public function parse(Twig_Token $token) + { + return $this->parser->getExpressionParser()->parseHashExpression(); + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Number.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Number.php new file mode 100755 index 0000000..68bbb62 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Number.php @@ -0,0 +1,28 @@ +', $this->name); + } + + public function parse(Twig_Token $token) + { + $this->parser->getStream()->expect(Twig_Token::NUMBER_TYPE); + + return new Twig_Node_Expression_Constant($token->getValue(), $token->getLine()); + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Optional.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Optional.php new file mode 100755 index 0000000..0cde9bc --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Optional.php @@ -0,0 +1,73 @@ +grammar = array(); + foreach (func_get_args() as $grammar) { + $this->addGrammar($grammar); + } + } + + public function __toString() + { + $repr = array(); + foreach ($this->grammar as $grammar) { + $repr[] = (string) $grammar; + } + + return sprintf('[%s]', implode(' ', $repr)); + } + + public function addGrammar(Twig_Extensions_GrammarInterface $grammar) + { + $this->grammar[] = $grammar; + } + + public function parse(Twig_Token $token) + { + // test if we have the optional element before consuming it + if ($this->grammar[0] instanceof Twig_Extensions_Grammar_Constant) { + if (!$this->parser->getStream()->test($this->grammar[0]->getType(), $this->grammar[0]->getName())) { + return array(); + } + } elseif ($this->grammar[0] instanceof Twig_Extensions_Grammar_Name) { + if (!$this->parser->getStream()->test(Twig_Token::NAME_TYPE)) { + return array(); + } + } elseif ($this->parser->getStream()->test(Twig_Token::BLOCK_END_TYPE)) { + // if this is not a Constant or a Name, it must be the last element of the tag + + return array(); + } + + $elements = array(); + foreach ($this->grammar as $grammar) { + $grammar->setParser($this->parser); + + $element = $grammar->parse($token); + if (is_array($element)) { + $elements = array_merge($elements, $element); + } else { + $elements[$grammar->getName()] = $element; + } + } + + return $elements; + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Switch.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Switch.php new file mode 100755 index 0000000..407cc20 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Switch.php @@ -0,0 +1,28 @@ +', $this->name); + } + + public function parse(Twig_Token $token) + { + $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, $this->name); + + return new Twig_Node_Expression_Constant(true, $token->getLine()); + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Tag.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Tag.php new file mode 100755 index 0000000..2506efa --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/Grammar/Tag.php @@ -0,0 +1,60 @@ +grammar = array(); + foreach (func_get_args() as $grammar) { + $this->addGrammar($grammar); + } + } + + public function __toString() + { + $repr = array(); + foreach ($this->grammar as $grammar) { + $repr[] = (string) $grammar; + } + + return implode(' ', $repr); + } + + public function addGrammar(Twig_Extensions_GrammarInterface $grammar) + { + $this->grammar[] = $grammar; + } + + public function parse(Twig_Token $token) + { + $elements = array(); + foreach ($this->grammar as $grammar) { + $grammar->setParser($this->parser); + + $element = $grammar->parse($token); + if (is_array($element)) { + $elements = array_merge($elements, $element); + } else { + $elements[$grammar->getName()] = $element; + } + } + + $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE); + + return $elements; + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/GrammarInterface.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/GrammarInterface.php new file mode 100755 index 0000000..b4854da --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/GrammarInterface.php @@ -0,0 +1,22 @@ + + */ +class Twig_Extensions_Node_Trans extends Twig_Node +{ + public function __construct(Twig_Node $body, Twig_Node $plural = null, Twig_Node_Expression $count = null, Twig_Node $notes = null, $lineno, $tag = null) + { + $nodes = array('body' => $body); + if (null !== $count) { + $nodes['count'] = $count; + } + if (null !== $plural) { + $nodes['plural'] = $plural; + } + if (null !== $notes) { + $nodes['notes'] = $notes; + } + + parent::__construct($nodes, array(), $lineno, $tag); + } + + /** + * {@inheritdoc} + */ + public function compile(Twig_Compiler $compiler) + { + $compiler->addDebugInfo($this); + + list($msg, $vars) = $this->compileString($this->getNode('body')); + + if ($this->hasNode('plural')) { + list($msg1, $vars1) = $this->compileString($this->getNode('plural')); + + $vars = array_merge($vars, $vars1); + } + + $function = $this->getTransFunction($this->hasNode('plural')); + + if ($this->hasNode('notes')) { + $message = trim($this->getNode('notes')->getAttribute('data')); + + // line breaks are not allowed cause we want a single line comment + $message = str_replace(array("\n", "\r"), ' ', $message); + $compiler->write("// notes: {$message}\n"); + } + + if ($vars) { + $compiler + ->write('echo strtr('.$function.'(') + ->subcompile($msg) + ; + + if ($this->hasNode('plural')) { + $compiler + ->raw(', ') + ->subcompile($msg1) + ->raw(', abs(') + ->subcompile($this->hasNode('count') ? $this->getNode('count') : null) + ->raw(')') + ; + } + + $compiler->raw('), array('); + + foreach ($vars as $var) { + if ('count' === $var->getAttribute('name')) { + $compiler + ->string('%count%') + ->raw(' => abs(') + ->subcompile($this->hasNode('count') ? $this->getNode('count') : null) + ->raw('), ') + ; + } else { + $compiler + ->string('%'.$var->getAttribute('name').'%') + ->raw(' => ') + ->subcompile($var) + ->raw(', ') + ; + } + } + + $compiler->raw("));\n"); + } else { + $compiler + ->write('echo '.$function.'(') + ->subcompile($msg) + ; + + if ($this->hasNode('plural')) { + $compiler + ->raw(', ') + ->subcompile($msg1) + ->raw(', abs(') + ->subcompile($this->hasNode('count') ? $this->getNode('count') : null) + ->raw(')') + ; + } + + $compiler->raw(");\n"); + } + } + + /** + * @param Twig_Node $body A Twig_Node instance + * + * @return array + */ + protected function compileString(Twig_Node $body) + { + if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant || $body instanceof Twig_Node_Expression_TempName) { + return array($body, array()); + } + + $vars = array(); + if (count($body)) { + $msg = ''; + + foreach ($body as $node) { + if (get_class($node) === 'Twig_Node' && $node->getNode(0) instanceof Twig_Node_SetTemp) { + $node = $node->getNode(1); + } + + if ($node instanceof Twig_Node_Print) { + $n = $node->getNode('expr'); + while ($n instanceof Twig_Node_Expression_Filter) { + $n = $n->getNode('node'); + } + $msg .= sprintf('%%%s%%', $n->getAttribute('name')); + $vars[] = new Twig_Node_Expression_Name($n->getAttribute('name'), $n->getTemplateLine()); + } else { + $msg .= $node->getAttribute('data'); + } + } + } else { + $msg = $body->getAttribute('data'); + } + + return array(new Twig_Node(array(new Twig_Node_Expression_Constant(trim($msg), $body->getTemplateLine()))), $vars); + } + + /** + * @param bool $plural Return plural or singular function to use + * + * @return string + */ + protected function getTransFunction($plural) + { + return $plural ? 'ngettext' : 'gettext'; + } +} + +class_alias('Twig_Extensions_Node_Trans', 'Twig\Extensions\Node\TransNode', false); diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/SimpleTokenParser.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/SimpleTokenParser.php new file mode 100755 index 0000000..76fa9d3 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/SimpleTokenParser.php @@ -0,0 +1,138 @@ +getGrammar(); + if (!is_object($grammar)) { + $grammar = self::parseGrammar($grammar); + } + + $grammar->setParser($this->parser); + $values = $grammar->parse($token); + + return $this->getNode($values, $token->getLine()); + } + + /** + * Gets the grammar as an object or as a string. + * + * @return string|Twig_Extensions_Grammar A Twig_Extensions_Grammar instance or a string + */ + abstract protected function getGrammar(); + + /** + * Gets the nodes based on the parsed values. + * + * @param array $values An array of values + * @param int $line The parser line + */ + abstract protected function getNode(array $values, $line); + + protected function getAttribute($node, $attribute, $arguments = array(), $type = Twig_Node_Expression_GetAttr::TYPE_ANY, $line = -1) + { + return new Twig_Node_Expression_GetAttr( + $node instanceof Twig_Node ? $node : new Twig_Node_Expression_Name($node, $line), + $attribute instanceof Twig_Node ? $attribute : new Twig_Node_Expression_Constant($attribute, $line), + $arguments instanceof Twig_Node ? $arguments : new Twig_Node($arguments), + $type, + $line + ); + } + + protected function call($node, $attribute, $arguments = array(), $line = -1) + { + return $this->getAttribute($node, $attribute, $arguments, Twig_Node_Expression_GetAttr::TYPE_METHOD, $line); + } + + protected function markAsSafe(Twig_Node $node, $line = -1) + { + return new Twig_Node_Expression_Filter( + $node, + new Twig_Node_Expression_Constant('raw', $line), + new Twig_Node(), + $line + ); + } + + protected function output(Twig_Node $node, $line = -1) + { + return new Twig_Node_Print($node, $line); + } + + protected function getNodeValues(array $values) + { + $nodes = array(); + foreach ($values as $value) { + if ($value instanceof Twig_Node) { + $nodes[] = $value; + } + } + + return $nodes; + } + + public static function parseGrammar($str, $main = true) + { + static $cursor; + + if (true === $main) { + $cursor = 0; + $grammar = new Twig_Extensions_Grammar_Tag(); + } else { + $grammar = new Twig_Extensions_Grammar_Optional(); + } + + while ($cursor < strlen($str)) { + if (preg_match('/\s+/A', $str, $match, null, $cursor)) { + $cursor += strlen($match[0]); + } elseif (preg_match('/<(\w+)(?:\:(\w+))?>/A', $str, $match, null, $cursor)) { + $class = sprintf('Twig_Extensions_Grammar_%s', ucfirst(isset($match[2]) ? $match[2] : 'Expression')); + if (!class_exists($class)) { + throw new Twig_Error_Runtime(sprintf('Unable to understand "%s" in grammar (%s class does not exist)', $match[0], $class)); + } + $grammar->addGrammar(new $class($match[1])); + $cursor += strlen($match[0]); + } elseif (preg_match('/\w+/A', $str, $match, null, $cursor)) { + $grammar->addGrammar(new Twig_Extensions_Grammar_Constant($match[0])); + $cursor += strlen($match[0]); + } elseif (preg_match('/,/A', $str, $match, null, $cursor)) { + $grammar->addGrammar(new Twig_Extensions_Grammar_Constant($match[0], Twig_Token::PUNCTUATION_TYPE)); + $cursor += strlen($match[0]); + } elseif (preg_match('/\[/A', $str, $match, null, $cursor)) { + $cursor += strlen($match[0]); + $grammar->addGrammar(self::parseGrammar($str, false)); + } elseif (true !== $main && preg_match('/\]/A', $str, $match, null, $cursor)) { + $cursor += strlen($match[0]); + + return $grammar; + } else { + throw new Twig_Error_Runtime(sprintf('Unable to parse grammar "%s" near "...%s..."', $str, substr($str, $cursor, 10))); + } + } + + return $grammar; + } +} diff --git a/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/TokenParser/Trans.php b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/TokenParser/Trans.php new file mode 100755 index 0000000..4d4f600 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/lib/Twig/Extensions/TokenParser/Trans.php @@ -0,0 +1,88 @@ +getLine(); + $stream = $this->parser->getStream(); + $count = null; + $plural = null; + $notes = null; + + if (!$stream->test(Twig_Token::BLOCK_END_TYPE)) { + $body = $this->parser->getExpressionParser()->parseExpression(); + } else { + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $body = $this->parser->subparse(array($this, 'decideForFork')); + $next = $stream->next()->getValue(); + + if ('plural' === $next) { + $count = $this->parser->getExpressionParser()->parseExpression(); + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $plural = $this->parser->subparse(array($this, 'decideForFork')); + + if ('notes' === $stream->next()->getValue()) { + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $notes = $this->parser->subparse(array($this, 'decideForEnd'), true); + } + } elseif ('notes' === $next) { + $stream->expect(Twig_Token::BLOCK_END_TYPE); + $notes = $this->parser->subparse(array($this, 'decideForEnd'), true); + } + } + + $stream->expect(Twig_Token::BLOCK_END_TYPE); + + $this->checkTransString($body, $lineno); + + return new Twig_Extensions_Node_Trans($body, $plural, $count, $notes, $lineno, $this->getTag()); + } + + public function decideForFork(Twig_Token $token) + { + return $token->test(array('plural', 'notes', 'endtrans')); + } + + public function decideForEnd(Twig_Token $token) + { + return $token->test('endtrans'); + } + + /** + * {@inheritdoc} + */ + public function getTag() + { + return 'trans'; + } + + protected function checkTransString(Twig_Node $body, $lineno) + { + foreach ($body as $i => $node) { + if ( + $node instanceof Twig_Node_Text + || + ($node instanceof Twig_Node_Print && $node->getNode('expr') instanceof Twig_Node_Expression_Name) + ) { + continue; + } + + throw new Twig_Error_Syntax(sprintf('The text to be translated with "trans" can only contain references to simple variables'), $lineno); + } + } +} + +class_alias('Twig_Extensions_TokenParser_Trans', 'Twig\Extensions\TokenParser\TransTokenParser', false); diff --git a/phpMyAdmin/vendor/twig/extensions/phpunit.xml.dist b/phpMyAdmin/vendor/twig/extensions/phpunit.xml.dist new file mode 100755 index 0000000..4d49fa6 --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/phpunit.xml.dist @@ -0,0 +1,25 @@ + + + + + + ./test/Twig/ + + + + + + ./lib/Twig/ + + + diff --git a/phpMyAdmin/vendor/twig/extensions/src/ArrayExtension.php b/phpMyAdmin/vendor/twig/extensions/src/ArrayExtension.php new file mode 100755 index 0000000..22ee3ed --- /dev/null +++ b/phpMyAdmin/vendor/twig/extensions/src/ArrayExtension.php @@ -0,0 +1,11 @@ +setRules([ + '@Symfony' => true, + '@Symfony:risky' => true, + '@PHPUnit75Migration:risky' => true, + 'php_unit_dedicate_assert' => ['target' => '5.6'], + 'array_syntax' => ['syntax' => 'short'], + 'php_unit_fqcn_annotation' => true, + 'no_unreachable_default_argument_value' => false, + 'braces' => ['allow_single_line_closure' => true], + 'heredoc_to_nowdoc' => false, + 'ordered_imports' => true, + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'native_function_invocation' => ['include' => ['@compiler_optimized'], 'scope' => 'all'], + ]) + ->setRiskyAllowed(true) + ->setFinder(PhpCsFixer\Finder::create()->in(__DIR__)) +; diff --git a/phpMyAdmin/vendor/twig/twig/.travis.yml b/phpMyAdmin/vendor/twig/twig/.travis.yml new file mode 100755 index 0000000..ff6132b --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/.travis.yml @@ -0,0 +1,46 @@ +language: php + +dist: trusty + +sudo: false + +cache: + directories: + - vendor + - $HOME/.composer/cache/files + + +env: + global: + - TWIG_EXT=no + - SYMFONY_PHPUNIT_REMOVE_RETURN_TYPEHINT=1 + +before_install: + - phpenv config-rm xdebug.ini || return 0 + +install: + - travis_retry composer install + +before_script: + - if [ "$TWIG_EXT" == "yes" ]; then sh -c "cd ext/twig && phpize && ./configure --enable-twig && make && make install"; fi + - if [ "$TWIG_EXT" == "yes" ]; then echo "extension=twig.so" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"`; fi + +script: ./vendor/bin/simple-phpunit + +jobs: + fast_finish: true + include: + - php: 5.5 + - php: 5.5 + env: TWIG_EXT=yes + - php: 5.6 + - php: 5.6 + env: TWIG_EXT=yes + - php: 7.0 + - php: 7.1 + - php: 7.2 + - php: 7.3 + - php: 7.4snapshot + - stage: integration tests + php: 7.3 + script: ./drupal_test.sh diff --git a/phpMyAdmin/vendor/twig/twig/CHANGELOG b/phpMyAdmin/vendor/twig/twig/CHANGELOG new file mode 100755 index 0000000..e549c93 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/CHANGELOG @@ -0,0 +1,1138 @@ +* 1.42.5 (2020-02-11) + + * Fix implementation of case-insensitivity for method names + +* 1.42.4 (2019-11-11) + + * optimized "block('foo') ?? 'bar" + * added supported for exponential numbers + +* 1.42.3 (2019-08-24) + + * fixed the "split" filter when the delimiter is "0" + * fixed the "empty" test on Traversable instances + * fixed cache when opcache is installed but disabled + * fixed PHP 7.4 compatibility + * bumped the minimal PHP version to 5.5 + +* 1.42.2 (2019-06-18) + + * Display partial output (PHP buffer) when an error occurs in debug mode + +* 1.42.1 (2019-06-04) + + * added support for "Twig\Markup" instances in the "in" test (again) + * allowed string operators as variables names in assignments + +* 1.42.0 (2019-05-31) + + * fixed the "filter" filter when the argument is \Traversable but does not implement \Iterator (\SimpleXmlElement for instance) + * fixed a PHP fatal error when calling a macro imported in a block in a nested block + * fixed a PHP fatal error when calling a macro imported in the template in another macro + * fixed wrong error message on "import" and "from" + +* 1.41.0 (2019-05-14) + + * fixed support for PHP 7.4 + * added "filter", "map", and "reduce" filters (and support for arrow functions) + * fixed partial output leak when a PHP fatal error occurs + * optimized context access on PHP 7.4 + +* 1.40.1 (2019-04-29) + +* fixed regression in NodeTraverser + +* 1.40.0 (2019-04-28) + + * allowed Twig\NodeVisitor\NodeVisitorInterface::leaveNode() to return "null" instead of "false" (same meaning) + * added the "apply" tag as a replacement for the "filter" tag + * allowed Twig\Loader\FilesystemLoader::findTemplate() to return "null" instead of "false" (same meaning) + * added support for "Twig\Markup" instances in the "in" test + * fixed Lexer when using custom options containing the # char + * fixed "import" when macros are stored in a template string + +* 1.39.1 (2019-04-16) + + * fixed EscaperNodeVisitor + +* 1.39.0 (2019-04-16) + + * added Traversable support for the length filter + * fixed some wrong location in error messages + * made exception creation faster + * made escaping on ternary expressions (?: and ??) more fine-grained + * added the possibility to give a nice name to string templates (template_from_string function) + * fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags) + * fixed "include" with "ignore missing" when an error loading occurs in the included template + * added support for a new whitespace trimming option ({%~ ~%}, {{~ ~}}, {#~ ~#}) + +* 1.38.4 (2019-03-23) + + * fixed CheckToStringNode implementation (broken when a function/filter is variadic) + +* 1.38.3 (2019-03-21) + + * fixed the spaceless filter so that it behaves like the spaceless tag + * fixed BC break on Environment::resolveTemplate() + * fixed the bundled Autoloader to also load namespaced classes + * allowed Traversable objects to be used in the "with" tag + * allowed Traversable objects to be used in the "with" argument of the "include" and "embed" tags + +* 1.38.2 (2019-03-12) + + * added TemplateWrapper::getTemplateName() + +* 1.38.1 (2019-03-12) + + * fixed class aliases + +* 1.38.0 (2019-03-12) + + * fixed sandbox security issue (under some circumstances, calling the + __toString() method on an object was possible even if not allowed by the + security policy) + * fixed batch filter clobbers array keys when fill parameter is used + * added preserveKeys support for the batch filter + * fixed "embed" support when used from "template_from_string" + * added the possibility to pass a TemplateWrapper to Twig\Environment::load() + * improved the performance of the sandbox + * added a spaceless filter + * added max value to the "random" function + * made namespace classes the default classes (PSR-0 ones are aliases now) + * removed duplicated directory separator in FilesystemLoader + * added Twig\Loader\ChainLoader::getLoaders() + * changed internal code to use the namespaced classes as much as possible + +* 1.37.1 (2019-01-14) + + * fixed regression (key exists check for non ArrayObject objects) + * fixed logic in TemplateWrapper + +* 1.37.0 (2019-01-14) + + * fixed ArrayObject access with a null value + * fixed embedded templates starting with a BOM + * fixed using a Twig_TemplateWrapper instance as an argument to extends + * switched generated code to use the PHP short array notation + * dropped PHP 5.3 support + * fixed float representation in compiled templates + * added a second argument to the join filter (last separator configuration) + +* 1.36.0 (2018-12-16) + + * made sure twig_include returns a string + * fixed multi-byte UFT-8 in escape('html_attr') + * added the "deprecated" tag + * added support for dynamically named tests + * fixed GlobalsInterface extended class + * fixed filesystem loader throwing an exception instead of returning false + +* 1.35.4 (2018-07-13) + + * ensured that syntax errors are triggered with the right line + * added the Symfony ctype polyfill as a dependency + * "js" filter now produces valid JSON + +* 1.35.3 (2018-03-20) + + * fixed block names unicity + * fixed counting children of SimpleXMLElement objects + * added missing else clause to avoid infinite loops + * fixed .. (range operator) in sandbox policy + +* 1.35.2 (2018-03-03) + + * fixed a regression in the way the profiler is registered in templates + +* 1.35.1 (2018-03-02) + + * added an exception when using "===" instead of "same as" + * fixed possible array to string conversion concealing actual error + * made variable names deterministic in compiled templates + * fixed length filter when passing an instance of IteratorAggregate + * fixed Environment::resolveTemplate to accept instances of TemplateWrapper + +* 1.35.0 (2017-09-27) + + * added Twig_Profiler_Profile::reset() + * fixed use TokenParser to return an empty Node + * added RuntimeExtensionInterface + * added circular reference detection when loading templates + +* 1.34.4 (2017-07-04) + + * added support for runtime loaders in IntegrationTestCase + * fixed deprecation when using Twig_Profiler_Dumper_Html + +* 1.34.3 (2017-06-07) + + * fixed namespaces introduction + +* 1.34.2 (2017-06-05) + + * fixed namespaces introduction + +* 1.34.1 (2017-06-05) + + * fixed namespaces introduction + +* 1.34.0 (2017-06-05) + + * added support for PHPUnit 6 when testing extensions + * fixed PHP 7.2 compatibility + * fixed template name generation in Twig_Environment::createTemplate() + * removed final tag on Twig_TokenParser_Include + * added namespaced aliases for all (non-deprecated) classes and interfaces + * dropped HHVM support + * dropped PHP 5.2 support + +* 1.33.2 (2017-04-20) + + * fixed edge case in the method cache for Twig attributes + +* 1.33.1 (2017-04-18) + + * fixed the empty() test + +* 1.33.0 (2017-03-22) + + * fixed a race condition handling when writing cache files + * "length" filter now returns string length when applied to an object that does + not implement \Countable but provides __toString() + * "empty" test will now consider the return value of the __toString() method for + objects implement __toString() but not \Countable + * fixed JS escaping for unicode characters with higher code points + +* 1.32.0 (2017-02-26) + + * fixed deprecation notice in Twig_Util_DeprecationCollector + * added a PSR-11 compatible runtime loader + * added `side` argument to `trim` to allow left or right trimming only. + +* 1.31.0 (2017-01-11) + + * added Twig_NodeCaptureInterface for nodes that capture all output + * fixed marking the environment as initialized too early + * fixed C89 compat for the C extension + * turned fatal error into exception when a previously generated cache is corrupted + * fixed offline cache warm-ups for embedded templates + +* 1.30.0 (2016-12-23) + + * added Twig_FactoryRuntimeLoader + * deprecated function/test/filter/tag overriding + * deprecated the "disable_c_ext" attribute on Twig_Node_Expression_GetAttr + +* 1.29.0 (2016-12-13) + + * fixed sandbox being left enabled if an exception is thrown while rendering + * marked some classes as being final (via @final) + * made Twig_Error report real source path when possible + * added support for {{ _self }} to provide an upgrade path from 1.x to 2.0 (replaces {{ _self.templateName }}) + * deprecated silent display of undefined blocks + * deprecated support for mbstring.func_overload != 0 + +* 1.28.2 (2016-11-23) + + * fixed precedence between getFoo() and isFoo() in Twig_Template::getAttribute() + * improved a deprecation message + +* 1.28.1 (2016-11-18) + + * fixed block() function when used with a template argument + +* 1.28.0 (2016-11-17) + + * added support for the PHP 7 null coalescing operator for the ?? Twig implementation + * exposed a way to access template data and methods in a portable way + * changed context access to use the PHP 7 null coalescing operator when available + * added the "with" tag + * added support for a custom template on the block() function + * added "is defined" support for block() and constant() + * optimized the way attributes are fetched + +* 1.27.0 (2016-10-25) + + * deprecated Twig_Parser::getEnvironment() + * deprecated Twig_Parser::addHandler() and Twig_Parser::addNodeVisitor() + * deprecated Twig_Compiler::addIndentation() + * fixed regression when registering two extensions having the same class name + * deprecated Twig_LoaderInterface::getSource() (implement Twig_SourceContextLoaderInterface instead) + * fixed the filesystem loader with relative paths + * deprecated Twig_Node::getLine() in favor of Twig_Node::getTemplateLine() + * deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext() + * deprecated Twig_Node::getFilename() in favor of Twig_Node::getTemplateName() + * deprecated the "filename" escaping strategy (use "name" instead) + * added Twig_Source to hold information about the original template + * deprecated Twig_Error::getTemplateFile() and Twig_Error::setTemplateFile() in favor of Twig_Error::getTemplateName() and Twig_Error::setTemplateName() + * deprecated Parser::getFilename() + * fixed template paths when a template name contains a protocol like vfs:// + * improved debugging with Twig_Sandbox_SecurityError exceptions for disallowed methods and properties + +* 1.26.1 (2016-10-05) + + * removed template source code from generated template classes when debug is disabled + * fixed default implementation of Twig_Template::getDebugInfo() for better BC + * fixed regression on static calls for functions/filters/tests + +* 1.26.0 (2016-10-02) + + * added template cache invalidation based on more environment options + * added a missing deprecation notice + * fixed template paths when a template is stored in a PHAR file + * allowed filters/functions/tests implementation to use a different class than the extension they belong to + * deprecated Twig_ExtensionInterface::getName() + +* 1.25.0 (2016-09-21) + + * changed the way we store template source in template classes + * removed usage of realpath in cache keys + * fixed Twig cache sharing when used with different versions of PHP + * removed embed parent workaround for simple use cases + * deprecated the ability to store non Node instances in Node::$nodes + * deprecated Twig_Environment::getLexer(), Twig_Environment::getParser(), Twig_Environment::getCompiler() + * deprecated Twig_Compiler::getFilename() + +* 1.24.2 (2016-09-01) + + * fixed static callables + * fixed a potential PHP warning when loading the cache + * fixed a case where the autoescaping does not work as expected + +* 1.24.1 (2016-05-30) + + * fixed reserved keywords (forbids true, false, null and none keywords for variables names) + * fixed support for PHP7 (Throwable support) + * marked the following methods as being internals on Twig_Environment: + getFunctions(), getFilters(), getTests(), getFunction(), getFilter(), getTest(), + getTokenParsers(), getTags(), getNodeVisitors(), getUnaryOperators(), getBinaryOperators(), + getFunctions(), getFilters(), getGlobals(), initGlobals(), initExtensions(), and initExtension() + +* 1.24.0 (2016-01-25) + + * adding support for the ?? operator + * fixed the defined test when used on a constant, a map, or a sequence + * undeprecated _self (should only be used to get the template name, not the template instance) + * fixed parsing on PHP7 + +* 1.23.3 (2016-01-11) + + * fixed typo + +* 1.23.2 (2015-01-11) + + * added versions in deprecated messages + * made file cache tolerant for trailing (back)slashes on directory configuration + * deprecated unused Twig_Node_Expression_ExtensionReference class + +* 1.23.1 (2015-11-05) + + * fixed some exception messages which triggered PHP warnings + * fixed BC on Twig_Test_NodeTestCase + +* 1.23.0 (2015-10-29) + + * deprecated the possibility to override an extension by registering another one with the same name + * deprecated Twig_ExtensionInterface::getGlobals() (added Twig_Extension_GlobalsInterface for BC) + * deprecated Twig_ExtensionInterface::initRuntime() (added Twig_Extension_InitRuntimeInterface for BC) + * deprecated Twig_Environment::computeAlternatives() + +* 1.22.3 (2015-10-13) + + * fixed regression when using null as a cache strategy + * improved performance when checking template freshness + * fixed warnings when loaded templates do not exist + * fixed template class name generation to prevent possible collisions + * fixed logic for custom escapers to call them even on integers and null values + * changed template cache names to take into account the Twig C extension + +* 1.22.2 (2015-09-22) + + * fixed a race condition in template loading + +* 1.22.1 (2015-09-15) + + * fixed regression in template_from_string + +* 1.22.0 (2015-09-13) + + * made Twig_Test_IntegrationTestCase more flexible + * added an option to force PHP bytecode invalidation when writing a compiled template into the cache + * fixed the profiler duration for the root node + * changed template cache names to take into account enabled extensions + * deprecated Twig_Environment::clearCacheFiles(), Twig_Environment::getCacheFilename(), + Twig_Environment::writeCacheFile(), and Twig_Environment::getTemplateClassPrefix() + * added a way to override the filesystem template cache system + * added a way to get the original template source from Twig_Template + +* 1.21.2 (2015-09-09) + + * fixed variable names for the deprecation triggering code + * fixed escaping strategy detection based on filename + * added Traversable support for replace, merge, and sort + * deprecated support for character by character replacement for the "replace" filter + +* 1.21.1 (2015-08-26) + + * fixed regression when using the deprecated Twig_Test_* classes + +* 1.21.0 (2015-08-24) + + * added deprecation notices for deprecated features + * added a deprecation "framework" for filters/functions/tests and test fixtures + +* 1.20.0 (2015-08-12) + + * forbid access to the Twig environment from templates and internal parts of Twig_Template + * fixed limited RCEs when in sandbox mode + * deprecated Twig_Template::getEnvironment() + * deprecated the _self variable for usage outside of the from and import tags + * added Twig_BaseNodeVisitor to ease the compatibility of node visitors + between 1.x and 2.x + +* 1.19.0 (2015-07-31) + + * fixed wrong error message when including an undefined template in a child template + * added support for variadic filters, functions, and tests + * added support for extra positional arguments in macros + * added ignore_missing flag to the source function + * fixed batch filter with zero items + * deprecated Twig_Environment::clearTemplateCache() + * fixed sandbox disabling when using the include function + +* 1.18.2 (2015-06-06) + + * fixed template/line guessing in exceptions for nested templates + * optimized the number of inodes and the size of realpath cache when using the cache + +* 1.18.1 (2015-04-19) + + * fixed memory leaks in the C extension + * deprecated Twig_Loader_String + * fixed the slice filter when used with a SimpleXMLElement object + * fixed filesystem loader when trying to load non-files (like directories) + +* 1.18.0 (2015-01-25) + + * fixed some error messages where the line was wrong (unknown variables or argument names) + * added a new way to customize the main Module node (via empty nodes) + * added Twig_Environment::createTemplate() to create a template from a string + * added a profiler + * fixed filesystem loader cache when different file paths are used for the same template + +* 1.17.0 (2015-01-14) + + * added a 'filename' autoescaping strategy, which dynamically chooses the + autoescaping strategy for a template based on template file extension. + +* 1.16.3 (2014-12-25) + + * fixed regression for dynamic parent templates + * fixed cache management with statcache + * fixed a regression in the slice filter + +* 1.16.2 (2014-10-17) + + * fixed timezone on dates as strings + * fixed 2-words test names when a custom node class is not used + * fixed macros when using an argument named like a PHP super global (like GET or POST) + * fixed date_modify when working with DateTimeImmutable + * optimized for loops + * fixed multi-byte characters handling in the split filter + * fixed a regression in the in operator + * fixed a regression in the slice filter + +* 1.16.1 (2014-10-10) + + * improved error reporting in a sandboxed template + * fixed missing error file/line information under certain circumstances + * fixed wrong error line number in some error messages + * fixed the in operator to use strict comparisons + * sped up the slice filter + * fixed for mb function overload mb_substr acting different + * fixed the attribute() function when passing a variable for the arguments + +* 1.16.0 (2014-07-05) + + * changed url_encode to always encode according to RFC 3986 + * fixed inheritance in a 'use'-hierarchy + * removed the __toString policy check when the sandbox is disabled + * fixed recursively calling blocks in templates with inheritance + +* 1.15.1 (2014-02-13) + + * fixed the conversion of the special '0000-00-00 00:00' date + * added an error message when trying to import an undefined block from a trait + * fixed a C extension crash when accessing defined but uninitialized property. + +* 1.15.0 (2013-12-06) + + * made ignoreStrictCheck in Template::getAttribute() works with __call() methods throwing BadMethodCallException + * added min and max functions + * added the round filter + * fixed a bug that prevented the optimizers to be enabled/disabled selectively + * fixed first and last filters for UTF-8 strings + * added a source function to include the content of a template without rendering it + * fixed the C extension sandbox behavior when get or set is prepend to method name + +* 1.14.2 (2013-10-30) + + * fixed error filename/line when an error occurs in an included file + * allowed operators that contain whitespaces to have more than one whitespace + * allowed tests to be made of 1 or 2 words (like "same as" or "divisible by") + +* 1.14.1 (2013-10-15) + + * made it possible to use named operators as variables + * fixed the possibility to have a variable named 'matches' + * added support for PHP 5.5 DateTimeInterface + +* 1.14.0 (2013-10-03) + + * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy + * added new operators: ends with, starts with, and matches + * fixed some compatibility issues with HHVM + * added a way to add custom escaping strategies + * fixed the C extension compilation on Windows + * fixed the batch filter when using a fill argument with an exact match of elements to batch + * fixed the filesystem loader cache when a template name exists in several namespaces + * fixed template_from_string when the template includes or extends other ones + * fixed a crash of the C extension on an edge case + +* 1.13.2 (2013-08-03) + + * fixed the error line number for an error occurs in and embedded template + * fixed crashes of the C extension on some edge cases + +* 1.13.1 (2013-06-06) + + * added the possibility to ignore the filesystem constructor argument in Twig_Loader_Filesystem + * fixed Twig_Loader_Chain::exists() for a loader which implements Twig_ExistsLoaderInterface + * adjusted backtrace call to reduce memory usage when an error occurs + * added support for object instances as the second argument of the constant test + * fixed the include function when used in an assignment + +* 1.13.0 (2013-05-10) + + * fixed getting a numeric-like item on a variable ('09' for instance) + * fixed getting a boolean or float key on an array, so it is consistent with PHP's array access: + `{{ array[false] }}` behaves the same as `echo $array[false];` (equals `$array[0]`) + * made the escape filter 20% faster for happy path (escaping string for html with UTF-8) + * changed 鈽� to 搂 in tests + * enforced usage of named arguments after positional ones + +* 1.12.3 (2013-04-08) + + * fixed a security issue in the filesystem loader where it was possible to include a template one + level above the configured path + * fixed fatal error that should be an exception when adding a filter/function/test too late + * added a batch filter + * added support for encoding an array as query string in the url_encode filter + +* 1.12.2 (2013-02-09) + + * fixed the timezone used by the date filter and function when the given date contains a timezone (like 2010-01-28T15:00:00+02:00) + * fixed globals when getGlobals is called early on + * added the first and last filter + +* 1.12.1 (2013-01-15) + + * added support for object instances as the second argument of the constant function + * relaxed globals management to avoid a BC break + * added support for {{ some_string[:2] }} + +* 1.12.0 (2013-01-08) + + * added verbatim as an alias for the raw tag to avoid confusion with the raw filter + * fixed registration of tests and functions as anonymous functions + * fixed globals management + +* 1.12.0-RC1 (2012-12-29) + + * added an include function (does the same as the include tag but in a more flexible way) + * added the ability to use any PHP callable to define filters, functions, and tests + * added a syntax error when using a loop variable that is not defined + * added the ability to set default values for macro arguments + * added support for named arguments for filters, tests, and functions + * moved filters/functions/tests syntax errors to the parser + * added support for extended ternary operator syntaxes + +* 1.11.1 (2012-11-11) + + * fixed debug info line numbering (was off by 2) + * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1) + * optimized variable access on PHP 5.4 + * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX) + +* 1.11.0 (2012-11-07) + + * fixed macro compilation when a variable name is a PHP reserved keyword + * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone + * fixed bitwise operator precedences + * added the template_from_string function + * fixed default timezone usage for the date function + * optimized the way Twig exceptions are managed (to make them faster) + * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster) + +* 1.10.3 (2012-10-19) + + * fixed wrong template location in some error messages + * reverted a BC break introduced in 1.10.2 + * added a split filter + +* 1.10.2 (2012-10-15) + + * fixed macro calls on PHP 5.4 + +* 1.10.1 (2012-10-15) + + * made a speed optimization to macro calls when imported via the "import" tag + * fixed C extension compilation on Windows + * fixed a segfault in the C extension when using DateTime objects + +* 1.10.0 (2012-09-28) + + * extracted functional tests framework to make it reusable for third-party extensions + * added namespaced templates support in Twig_Loader_Filesystem + * added Twig_Loader_Filesystem::prependPath() + * fixed an error when a token parser pass a closure as a test to the subparse() method + +* 1.9.2 (2012-08-25) + + * fixed the in operator for objects that contain circular references + * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface + +* 1.9.1 (2012-07-22) + + * optimized macro calls when auto-escaping is on + * fixed wrong parent class for Twig_Function_Node + * made Twig_Loader_Chain more explicit about problems + +* 1.9.0 (2012-07-13) + + * made the parsing independent of the template loaders + * fixed exception trace when an error occurs when rendering a child template + * added escaping strategies for CSS, URL, and HTML attributes + * fixed nested embed tag calls + * added the date_modify filter + +* 1.8.3 (2012-06-17) + + * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash + * fixed escaping when a project defines a function named html or js + * fixed chmod mode to apply the umask correctly + +* 1.8.2 (2012-05-30) + + * added the abs filter + * fixed a regression when using a number in template attributes + * fixed compiler when mbstring.func_overload is set to 2 + * fixed DateTimeZone support in date filter + +* 1.8.1 (2012-05-17) + + * fixed a regression when dealing with SimpleXMLElement instances in templates + * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini + * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ) + +* 1.8.0 (2012-05-08) + + * enforced interface when adding tests, filters, functions, and node visitors from extensions + * fixed a side-effect of the date filter where the timezone might be changed + * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer) + * added a way to dynamically change the auto-escaping strategy according to the template "filename" + * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html) + * added an embed tag + +* 1.7.0 (2012-04-24) + + * fixed a PHP warning when using CIFS + * fixed template line number in some exceptions + * added an iterable test + * added an error when defining two blocks with the same name in a template + * added the preserves_safety option for filters + * fixed a PHP notice when trying to access a key on a non-object/array variable + * enhanced error reporting when the template file is an instance of SplFileInfo + * added Twig_Environment::mergeGlobals() + * added compilation checks to avoid misuses of the sandbox tag + * fixed filesystem loader freshness logic for high traffic websites + * fixed random function when charset is null + +* 1.6.5 (2012-04-11) + + * fixed a regression when a template only extends another one without defining any blocks + +* 1.6.4 (2012-04-02) + + * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3 + * fixed performance when compiling large files + * optimized parent template creation when the template does not use dynamic inheritance + +* 1.6.3 (2012-03-22) + + * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension + * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot + * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate + +* 1.6.2 (2012-03-18) + + * fixed sandbox mode when used with inheritance + * added preserveKeys support for the slice filter + * fixed the date filter when a DateTime instance is passed with a specific timezone + * added a trim filter + +* 1.6.1 (2012-02-29) + + * fixed Twig C extension + * removed the creation of Twig_Markup instances when not needed + * added a way to set the default global timezone for dates + * fixed the slice filter on strings when the length is not specified + * fixed the creation of the cache directory in case of a race condition + +* 1.6.0 (2012-02-04) + + * fixed raw blocks when used with the whitespace trim option + * made a speed optimization to macro calls when imported via the "from" tag + * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added + * fixed the attribute function when passing arguments + * added slice notation support for the [] operator (syntactic sugar for the slice operator) + * added a slice filter + * added string support for the reverse filter + * fixed the empty test and the length filter for Twig_Markup instances + * added a date function to ease date comparison + * fixed unary operators precedence + * added recursive parsing support in the parser + * added string and integer handling for the random function + +* 1.5.1 (2012-01-05) + + * fixed a regression when parsing strings + +* 1.5.0 (2012-01-04) + + * added Traversable objects support for the join filter + +* 1.5.0-RC2 (2011-12-30) + + * added a way to set the default global date interval format + * fixed the date filter for DateInterval instances (setTimezone() does not exist for them) + * refactored Twig_Template::display() to ease its extension + * added a number_format filter + +* 1.5.0-RC1 (2011-12-26) + + * removed the need to quote hash keys + * allowed hash keys to be any expression + * added a do tag + * added a flush tag + * added support for dynamically named filters and functions + * added a dump function to help debugging templates + * added a nl2br filter + * added a random function + * added a way to change the default format for the date filter + * fixed the lexer when an operator ending with a letter ends a line + * added string interpolation support + * enhanced exceptions for unknown filters, functions, tests, and tags + +* 1.4.0 (2011-12-07) + + * fixed lexer when using big numbers (> PHP_INT_MAX) + * added missing preserveKeys argument to the reverse filter + * fixed macros containing filter tag calls + +* 1.4.0-RC2 (2011-11-27) + + * removed usage of Reflection in Twig_Template::getAttribute() + * added a C extension that can optionally replace Twig_Template::getAttribute() + * added negative timestamp support to the date filter + +* 1.4.0-RC1 (2011-11-20) + + * optimized variable access when using PHP 5.4 + * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby + * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders + * added Twig_Function_Node to allow more complex functions to have their own Node class + * added Twig_Filter_Node to allow more complex filters to have their own Node class + * added Twig_Test_Node to allow more complex tests to have their own Node class + * added a better error message when a template is empty but contain a BOM + * fixed "in" operator for empty strings + * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option) + * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order) + * added Twig_Environment::display() + * made the escape filter smarter when the encoding is not supported by PHP + * added a convert_encoding filter + * moved all node manipulations outside the compile() Node method + * made several speed optimizations + +* 1.3.0 (2011-10-08) + +no changes + +* 1.3.0-RC1 (2011-10-04) + + * added an optimization for the parent() function + * added cache reloading when auto_reload is true and an extension has been modified + * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup) + * allowed empty templates to be used as traits + * added traits support for the "parent" function + +* 1.2.0 (2011-09-13) + +no changes + +* 1.2.0-RC1 (2011-09-10) + + * enhanced the exception when a tag remains unclosed + * added support for empty Countable objects for the "empty" test + * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions) + * added better support for encoding problems when escaping a string (available as of PHP 5.4) + * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %}) + * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %}) + * added support for bitwise operators in expressions + * added the "attribute" function to allow getting dynamic attributes on variables + * added Twig_Loader_Chain + * added Twig_Loader_Array::setTemplate() + * added an optimization for the set tag when used to capture a large chunk of static text + * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros) + * removed the possibility to use the "extends" tag from a block + * added "if" modifier support to "for" loops + +* 1.1.2 (2011-07-30) + + * fixed json_encode filter on PHP 5.2 + * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }}) + * fixed inheritance when using conditional parents + * fixed compilation of templates when the body of a child template is not empty + * fixed output when a macro throws an exception + * fixed a parsing problem when a large chunk of text is enclosed in a comment tag + * added PHPDoc for all Token parsers and Core extension functions + +* 1.1.1 (2011-07-17) + + * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls) + * made some performance improvement for some edge cases + +* 1.1.0 (2011-06-28) + + * fixed json_encode filter + +* 1.1.0-RC3 (2011-06-24) + + * fixed method case-sensitivity when using the sandbox mode + * added timezone support for the date filter + * fixed possible security problems with NUL bytes + +* 1.1.0-RC2 (2011-06-16) + + * added an exception when the template passed to "use" is not a string + * made 'a.b is defined' not throw an exception if a is not defined (in strict mode) + * added {% line \d+ %} directive + +* 1.1.0-RC1 (2011-05-28) + +Flush your cache after upgrading. + + * fixed date filter when using a timestamp + * fixed the defined test for some cases + * fixed a parsing problem when a large chunk of text is enclosed in a raw tag + * added support for horizontal reuse of template blocks (see docs for more information) + * added whitespace control modifier to all tags (see docs for more information) + * added null as an alias for none (the null test is also an alias for the none test now) + * made TRUE, FALSE, NONE equivalent to their lowercase counterparts + * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line + * moved display() method to Twig_Template (generated templates should now use doDisplay() instead) + +* 1.0.0 (2011-03-27) + + * fixed output when using mbstring + * fixed duplicate call of methods when using the sandbox + * made the charset configurable for the escape filter + +* 1.0.0-RC2 (2011-02-21) + + * changed the way {% set %} works when capturing (the content is now marked as safe) + * added support for macro name in the endmacro tag + * make Twig_Error compatible with PHP 5.3.0 > + * fixed an infinite loop on some Windows configurations + * fixed the "length" filter for numbers + * fixed Template::getAttribute() as properties in PHP are case sensitive + * removed coupling between Twig_Node and Twig_Template + * fixed the ternary operator precedence rule + +* 1.0.0-RC1 (2011-01-09) + +Backward incompatibilities: + + * the "items" filter, which has been deprecated for quite a long time now, has been removed + * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10) + * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }} + * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }} + * the "for" tag does not support "joined by" anymore + * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off") + * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %}) + * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %}) + * removed the grammar and simple token parser (moved to the Twig Extensions repository) + +Changes: + + * added "needs_context" option for filters and functions (the context is then passed as a first argument) + * added global variables support + * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode) + * added the "from" tag to import macros as functions + * added support for functions (a function is just syntactic sugar for a getAttribute() call) + * made macros callable when sandbox mode is enabled + * added an exception when a macro uses a reserved name + * the "default" filter now uses the "empty" test instead of just checking for null + * added the "empty" test + +* 0.9.10 (2010-12-16) + +Backward incompatibilities: + + * The Escaper extension is enabled by default, which means that all displayed + variables are now automatically escaped. You can revert to the previous + behavior by removing the extension via $env->removeExtension('escaper') + or just set the 'autoescape' option to 'false'. + * removed the "without loop" attribute for the "for" tag (not needed anymore + as the Optimizer take care of that for most cases) + * arrays and hashes have now a different syntax + * arrays keep the same syntax with square brackets: [1, 2] + * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"}) + * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1}) + * the i18n extension is now part of the Twig Extensions repository + +Changes: + + * added the merge filter + * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead + * fixed usage of operators as method names (like is, in, and not) + * changed the order of execution for node visitors + * fixed default() filter behavior when used with strict_variables set to on + * fixed filesystem loader compatibility with PHAR files + * enhanced error messages when an unexpected token is parsed in an expression + * fixed filename not being added to syntax error messages + * added the autoescape option to enable/disable autoescaping + * removed the newline after a comment (mimics PHP behavior) + * added a syntax error exception when parent block is used on a template that does not extend another one + * made the Escaper extension enabled by default + * fixed sandbox extension when used with auto output escaping + * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved) + * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters) + * added priority to node visitors + +* 0.9.9 (2010-11-28) + +Backward incompatibilities: + * the self special variable has been renamed to _self + * the odd and even filters are now tests: + {{ foo|odd }} must now be written {{ foo is odd }} + * the "safe" filter has been renamed to "raw" + * in Node classes, + sub-nodes are now accessed via getNode() (instead of property access) + attributes via getAttribute() (instead of array access) + * the urlencode filter had been renamed to url_encode + * the include tag now merges the passed variables with the current context by default + (the old behavior is still possible by adding the "only" keyword) + * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime) + * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead) + * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }}) + +Changes: + * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template + * changed trans tag to accept any variable for the plural count + * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements) + * added the ** (power) operator + * changed the algorithm used for parsing expressions + * added the spaceless tag + * removed trim_blocks option + * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar()) + * changed all exceptions to extend Twig_Error + * fixed unary expressions ({{ not(1 or 0) }}) + * fixed child templates (with an extend tag) that uses one or more imports + * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }}) + * escaping has been rewritten + * the implementation of template inheritance has been rewritten + (blocks can now be called individually and still work with inheritance) + * fixed error handling for if tag when a syntax error occurs within a subparse process + * added a way to implement custom logic for resolving token parsers given a tag name + * fixed js escaper to be stricter (now uses a whilelist-based js escaper) + * added the following filers: "constant", "trans", "replace", "json_encode" + * added a "constant" test + * fixed objects with __toString() not being autoescaped + * fixed subscript expressions when calling __call() (methods now keep the case) + * added "test" feature (accessible via the "is" operator) + * removed the debug tag (should be done in an extension) + * fixed trans tag when no vars are used in plural form + * fixed race condition when writing template cache + * added the special _charset variable to reference the current charset + * added the special _context variable to reference the current context + * renamed self to _self (to avoid conflict) + * fixed Twig_Template::getAttribute() for protected properties + +* 0.9.8 (2010-06-28) + +Backward incompatibilities: + * the trans tag plural count is now attached to the plural tag: + old: `{% trans count %}...{% plural %}...{% endtrans %}` + new: `{% trans %}...{% plural count %}...{% endtrans %}` + + * added a way to translate strings coming from a variable ({% trans var %}) + * fixed trans tag when used with the Escaper extension + * fixed default cache umask + * removed Twig_Template instances from the debug tag output + * fixed objects with __isset() defined + * fixed set tag when used with a capture + * fixed type hinting for Twig_Environment::addFilter() method + +* 0.9.7 (2010-06-12) + +Backward incompatibilities: + * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %}) + * removed the sandboxed attribute of the include tag (use the new sandbox tag instead) + * refactored the Node system (if you have custom nodes, you will have to update them to use the new API) + + * added self as a special variable that refers to the current template (useful for importing macros from the current template) + * added Twig_Template instance support to the include tag + * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %}) + * added a grammar sub-framework to ease the creation of custom tags + * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface) + * removed the Twig_Resource::resolveMissingFilter() method + * fixed the filter tag which did not apply filtering to included files + * added a bunch of unit tests + * added a bunch of phpdoc + * added a sandbox tag in the sandbox extension + * changed the date filter to support any date format supported by DateTime + * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default) + * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor + * changed the cache option to only accepts an explicit path to a cache directory or false + * added a way to add token parsers, filters, and visitors without creating an extension + * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface + * changed the generated code to match the new coding standards + * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }}) + * added an exception when a child template has a non-empty body (as it is always ignored when rendering) + +* 0.9.6 (2010-05-12) + + * fixed variables defined outside a loop and for which the value changes in a for loop + * fixed the test suite for PHP 5.2 and older versions of PHPUnit + * added support for __call() in expression resolution + * fixed node visiting for macros (macros are now visited by visitors as any other node) + * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now) + * added the cycle filter + * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII + * added a long-syntax for the set tag ({% set foo %}...{% endset %}) + * unit tests are now powered by PHPUnit + * added support for gettext via the `i18n` extension + * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values + * added a more useful exception if an if tag is not closed properly + * added support for escaping strategy in the autoescape tag + * fixed lexer when a template has a big chunk of text between/in a block + +* 0.9.5 (2010-01-20) + +As for any new release, don't forget to remove all cached templates after +upgrading. + +If you have defined custom filters, you MUST upgrade them for this release. To +upgrade, replace "array" with "new Twig_Filter_Function", and replace the +environment constant by the "needs_environment" option: + + // before + 'even' => array('twig_is_even_filter', false), + 'escape' => array('twig_escape_filter', true), + + // after + 'even' => new Twig_Filter_Function('twig_is_even_filter'), + 'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)), + +If you have created NodeTransformer classes, you will need to upgrade them to +the new interface (please note that the interface is not yet considered +stable). + + * fixed list nodes that did not extend the Twig_NodeListInterface + * added the "without loop" option to the for tag (it disables the generation of the loop variable) + * refactored node transformers to node visitors + * fixed automatic-escaping for blocks + * added a way to specify variables to pass to an included template + * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules) + * improved the filter system to allow object methods to be used as filters + * changed the Array and String loaders to actually make use of the cache mechanism + * included the default filter function definitions in the extension class files directly (Core, Escaper) + * added the // operator (like the floor() PHP function) + * added the .. operator (as a syntactic sugar for the range filter when the step is 1) + * added the in operator (as a syntactic sugar for the in filter) + * added the following filters in the Core extension: in, range + * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes) + * enhanced some error messages to provide better feedback in case of parsing errors + +* 0.9.4 (2009-12-02) + +If you have custom loaders, you MUST upgrade them for this release: The +Twig_Loader base class has been removed, and the Twig_LoaderInterface has also +been changed (see the source code for more information or the documentation). + + * added support for DateTime instances for the date filter + * fixed loop.last when the array only has one item + * made it possible to insert newlines in tag and variable blocks + * fixed a bug when a literal '\n' were present in a template text + * fixed bug when the filename of a template contains */ + * refactored loaders + +* 0.9.3 (2009-11-11) + +This release is NOT backward compatible with the previous releases. + + The loaders do not take the cache and autoReload arguments anymore. Instead, + the Twig_Environment class has two new options: cache and auto_reload. + Upgrading your code means changing this kind of code: + + $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true); + $twig = new Twig_Environment($loader); + + to something like this: + + $loader = new Twig_Loader_Filesystem('/path/to/templates'); + $twig = new Twig_Environment($loader, array( + 'cache' => '/path/to/compilation_cache', + 'auto_reload' => true, + )); + + * deprecated the "items" filter as it is not needed anymore + * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader + * optimized template loading speed + * removed output when an error occurs in a template and render() is used + * made major speed improvements for loops (up to 300% on even the smallest loops) + * added properties as part of the sandbox mode + * added public properties support (obj.item can now be the item property on the obj object) + * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} ) + * fixed bug when \ was used in HTML + +* 0.9.2 (2009-10-29) + + * made some speed optimizations + * changed the cache extension to .php + * added a js escaping strategy + * added support for short block tag + * changed the filter tag to allow chained filters + * made lexer more flexible as you can now change the default delimiters + * added set tag + * changed default directory permission when cache dir does not exist (more secure) + * added macro support + * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance + * made Twig_Autoloader::autoload() a static method + * avoid writing template file if an error occurs + * added $ escaping when outputting raw strings + * enhanced some error messages to ease debugging + * fixed empty cache files when the template contains an error + +* 0.9.1 (2009-10-14) + + * fixed a bug in PHP 5.2.6 + * fixed numbers with one than one decimal + * added support for method calls with arguments ({{ foo.bar('a', 43) }}) + * made small speed optimizations + * made minor tweaks to allow better extensibility and flexibility + +* 0.9.0 (2009-10-12) + + * Initial release diff --git a/phpMyAdmin/vendor/twig/twig/LICENSE b/phpMyAdmin/vendor/twig/twig/LICENSE new file mode 100755 index 0000000..5e8a0b8 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/LICENSE @@ -0,0 +1,29 @@ +Copyright (c) 2009-2020 by the Twig Team. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The names of the contributors may not be used to endorse or + promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/phpMyAdmin/vendor/twig/twig/README.rst b/phpMyAdmin/vendor/twig/twig/README.rst new file mode 100755 index 0000000..d896ff5 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/README.rst @@ -0,0 +1,24 @@ +Twig, the flexible, fast, and secure template language for PHP +============================================================== + +Twig is a template language for PHP, released under the new BSD license (code +and documentation). + +Twig uses a syntax similar to the Django and Jinja template languages which +inspired the Twig runtime environment. + +Sponsors +-------- + +.. raw:: html + + + Blackfire.io + + +More Information +---------------- + +Read the `documentation`_ for more information. + +.. _documentation: https://twig.symfony.com/documentation diff --git a/phpMyAdmin/vendor/twig/twig/composer.json b/phpMyAdmin/vendor/twig/twig/composer.json new file mode 100755 index 0000000..c306353 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/composer.json @@ -0,0 +1,51 @@ +{ + "name": "twig/twig", + "type": "library", + "description": "Twig, the flexible, fast, and secure template language for PHP", + "keywords": ["templating"], + "homepage": "https://twig.symfony.com", + "license": "BSD-3-Clause", + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" + }, + { + "name": "Twig Team", + "role": "Contributors" + }, + { + "name": "Armin Ronacher", + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + } + ], + "require": { + "php": ">=5.5.0", + "symfony/polyfill-ctype": "^1.8" + }, + "require-dev": { + "symfony/phpunit-bridge": "^4.4|^5.0", + "psr/container": "^1.0" + }, + "autoload": { + "psr-0" : { + "Twig_" : "lib/" + }, + "psr-4" : { + "Twig\\" : "src/" + } + }, + "autoload-dev": { + "psr-4" : { + "Twig\\Tests\\" : "tests" + } + }, + "extra": { + "branch-alias": { + "dev-master": "1.42-dev" + } + } +} diff --git a/phpMyAdmin/vendor/twig/twig/drupal_test.sh b/phpMyAdmin/vendor/twig/twig/drupal_test.sh new file mode 100755 index 0000000..d71aad8 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/drupal_test.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +set -x +set -e + +REPO=`pwd` +cd /tmp +rm -rf drupal-twig-test +composer create-project --no-interaction drupal-composer/drupal-project:8.x-dev drupal-twig-test +cd drupal-twig-test +(cd vendor/twig && rm -rf twig && ln -sf $REPO twig) +echo '$config["system.logging"]["error_level"] = "verbose";' >> web/sites/default/settings.php +php ./web/core/scripts/drupal install --no-interaction demo_umami > output +perl -p -i -e 's/^([A-Za-z]+)\: (.+)$/export DRUPAL_\1=\2/' output +source output + +wget https://get.symfony.com/cli/installer -O - | bash +export PATH="$HOME/.symfony/bin:$PATH" +symfony server:start -d --no-tls + +curl -OLsS https://get.blackfire.io/blackfire-player.phar +chmod +x blackfire-player.phar +cat > drupal-tests.bkf < | + +----------------------------------------------------------------------+ + */ + +#ifndef PHP_TWIG_H +#define PHP_TWIG_H + +#define PHP_TWIG_VERSION "1.42.5-DEV" + +#include "php.h" + +extern zend_module_entry twig_module_entry; +#define phpext_twig_ptr &twig_module_entry +#ifndef PHP_WIN32 +zend_module_entry *get_module(void); +#endif + +#ifdef ZTS +#include "TSRM.h" +#endif + +PHP_FUNCTION(twig_template_get_attributes); +PHP_RSHUTDOWN_FUNCTION(twig); + +#endif diff --git a/phpMyAdmin/vendor/twig/twig/ext/twig/twig.c b/phpMyAdmin/vendor/twig/twig/ext/twig/twig.c new file mode 100755 index 0000000..171ed10 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/ext/twig/twig.c @@ -0,0 +1,1217 @@ +/* + +----------------------------------------------------------------------+ + | Twig Extension | + +----------------------------------------------------------------------+ + | Copyright (c) 2011 Derick Rethans | + +----------------------------------------------------------------------+ + | Redistribution and use in source and binary forms, with or without | + | modification, are permitted provided that the conditions mentioned | + | in the accompanying LICENSE file are met (BSD-3-Clause). | + +----------------------------------------------------------------------+ + | Author: Derick Rethans | + +----------------------------------------------------------------------+ + */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#include "php.h" +#include "php_twig.h" +#include "ext/standard/php_var.h" +#include "ext/standard/php_string.h" +#include "ext/standard/php_smart_str.h" +#include "ext/spl/spl_exceptions.h" + +#include "Zend/zend_object_handlers.h" +#include "Zend/zend_interfaces.h" +#include "Zend/zend_exceptions.h" + +#ifndef Z_ADDREF_P +#define Z_ADDREF_P(pz) (pz)->refcount++ +#endif + +#ifndef E_USER_DEPRECATED +#define E_USER_DEPRECATED (1<<14L) +#endif + +#define FREE_DTOR(z) \ + zval_dtor(z); \ + efree(z); + +#if PHP_VERSION_ID >= 50300 + #define APPLY_TSRMLS_DC TSRMLS_DC + #define APPLY_TSRMLS_CC TSRMLS_CC + #define APPLY_TSRMLS_FETCH() +#else + #define APPLY_TSRMLS_DC + #define APPLY_TSRMLS_CC + #define APPLY_TSRMLS_FETCH() TSRMLS_FETCH() +#endif + +ZEND_BEGIN_ARG_INFO_EX(twig_template_get_attribute_args, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 6) + ZEND_ARG_INFO(0, template) + ZEND_ARG_INFO(0, object) + ZEND_ARG_INFO(0, item) + ZEND_ARG_INFO(0, arguments) + ZEND_ARG_INFO(0, type) + ZEND_ARG_INFO(0, isDefinedTest) +ZEND_END_ARG_INFO() + +#ifndef PHP_FE_END +#define PHP_FE_END { NULL, NULL, NULL} +#endif + +static const zend_function_entry twig_functions[] = { + PHP_FE(twig_template_get_attributes, twig_template_get_attribute_args) + PHP_FE_END +}; + +PHP_RSHUTDOWN_FUNCTION(twig) +{ +#if ZEND_DEBUG + CG(unclean_shutdown) = 0; /* get rid of PHPUnit's exit() and report memleaks */ +#endif + return SUCCESS; +} + +zend_module_entry twig_module_entry = { + STANDARD_MODULE_HEADER, + "twig", + twig_functions, + NULL, + NULL, + NULL, + PHP_RSHUTDOWN(twig), + NULL, + PHP_TWIG_VERSION, + STANDARD_MODULE_PROPERTIES +}; + + +#ifdef COMPILE_DL_TWIG +ZEND_GET_MODULE(twig) +#endif + +static int TWIG_ARRAY_KEY_EXISTS(zval *array, zval *key) +{ + if (Z_TYPE_P(array) != IS_ARRAY) { + return 0; + } + + switch (Z_TYPE_P(key)) { + case IS_NULL: + return zend_hash_exists(Z_ARRVAL_P(array), "", 1); + + case IS_BOOL: + case IS_DOUBLE: + convert_to_long(key); + case IS_LONG: + return zend_hash_index_exists(Z_ARRVAL_P(array), Z_LVAL_P(key)); + + default: + convert_to_string(key); + return zend_symtable_exists(Z_ARRVAL_P(array), Z_STRVAL_P(key), Z_STRLEN_P(key) + 1); + } +} + +static int TWIG_INSTANCE_OF(zval *object, zend_class_entry *interface TSRMLS_DC) +{ + if (Z_TYPE_P(object) != IS_OBJECT) { + return 0; + } + return instanceof_function(Z_OBJCE_P(object), interface TSRMLS_CC); +} + +static int TWIG_INSTANCE_OF_USERLAND(zval *object, char *interface TSRMLS_DC) +{ + zend_class_entry **pce; + if (Z_TYPE_P(object) != IS_OBJECT) { + return 0; + } + if (zend_lookup_class(interface, strlen(interface), &pce TSRMLS_CC) == FAILURE) { + return 0; + } + return instanceof_function(Z_OBJCE_P(object), *pce TSRMLS_CC); +} + +static zval *TWIG_GET_ARRAYOBJECT_ELEMENT(zval *object, zval *offset TSRMLS_DC) +{ + zend_class_entry *ce = Z_OBJCE_P(object); + zval *retval; + + if (Z_TYPE_P(object) == IS_OBJECT) { + SEPARATE_ARG_IF_REF(offset); + zend_call_method_with_1_params(&object, ce, NULL, "offsetget", &retval, offset); + + zval_ptr_dtor(&offset); + + if (!retval) { + if (!EG(exception)) { + zend_error(E_ERROR, "Undefined offset for object of type %s used as array.", ce->name); + } + return NULL; + } + + return retval; + } + return NULL; +} + +static int TWIG_ISSET_ARRAYOBJECT_ELEMENT(zval *object, zval *offset TSRMLS_DC) +{ + zend_class_entry *ce = Z_OBJCE_P(object); + zval *retval; + + if (Z_TYPE_P(object) == IS_OBJECT) { + SEPARATE_ARG_IF_REF(offset); + zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset); + + zval_ptr_dtor(&offset); + + if (!retval) { + if (!EG(exception)) { + zend_error(E_ERROR, "Undefined offset for object of type %s used as array.", ce->name); + } + return 0; + } + + return (retval && Z_TYPE_P(retval) == IS_BOOL && Z_LVAL_P(retval)); + } + return 0; +} + +static char *TWIG_STRTOLOWER(const char *str, int str_len) +{ + char *item_dup; + + item_dup = estrndup(str, str_len); + php_strtolower(item_dup, str_len); + return item_dup; +} + +static zval *TWIG_CALL_USER_FUNC_ARRAY(zval *object, char *function, zval *arguments TSRMLS_DC) +{ + zend_fcall_info fci; + zval ***args = NULL; + int arg_count = 0; + HashTable *table; + HashPosition pos; + int i = 0; + zval *retval_ptr; + zval *zfunction; + + if (arguments) { + table = HASH_OF(arguments); + args = safe_emalloc(sizeof(zval **), table->nNumOfElements, 0); + + zend_hash_internal_pointer_reset_ex(table, &pos); + + while (zend_hash_get_current_data_ex(table, (void **)&args[i], &pos) == SUCCESS) { + i++; + zend_hash_move_forward_ex(table, &pos); + } + arg_count = table->nNumOfElements; + } + + MAKE_STD_ZVAL(zfunction); + ZVAL_STRING(zfunction, function, 1); + fci.size = sizeof(fci); + fci.function_table = EG(function_table); + fci.function_name = zfunction; + fci.symbol_table = NULL; +#if PHP_VERSION_ID >= 50300 + fci.object_ptr = object; +#else + fci.object_pp = &object; +#endif + fci.retval_ptr_ptr = &retval_ptr; + fci.param_count = arg_count; + fci.params = args; + fci.no_separation = 0; + + if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { + ALLOC_INIT_ZVAL(retval_ptr); + ZVAL_BOOL(retval_ptr, 0); + } + + if (args) { + efree(fci.params); + } + FREE_DTOR(zfunction); + return retval_ptr; +} + +static int TWIG_CALL_BOOLEAN(zval *object, char *functionName TSRMLS_DC) +{ + zval *ret; + int res; + + ret = TWIG_CALL_USER_FUNC_ARRAY(object, functionName, NULL TSRMLS_CC); + res = Z_LVAL_P(ret); + zval_ptr_dtor(&ret); + return res; +} + +static zval *TWIG_GET_STATIC_PROPERTY(zval *class, char *prop_name TSRMLS_DC) +{ + zval **tmp_zval; + zend_class_entry *ce; + + if (class == NULL || Z_TYPE_P(class) != IS_OBJECT) { + return NULL; + } + + ce = zend_get_class_entry(class TSRMLS_CC); +#if PHP_VERSION_ID >= 50400 + tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0, NULL TSRMLS_CC); +#else + tmp_zval = zend_std_get_static_property(ce, prop_name, strlen(prop_name), 0 TSRMLS_CC); +#endif + return *tmp_zval; +} + +static zval *TWIG_GET_ARRAY_ELEMENT_ZVAL(zval *class, zval *prop_name TSRMLS_DC) +{ + zval **tmp_zval; + + if (class == NULL || Z_TYPE_P(class) != IS_ARRAY) { + if (class != NULL && Z_TYPE_P(class) == IS_OBJECT && TWIG_INSTANCE_OF(class, zend_ce_arrayaccess TSRMLS_CC)) { + // array access object + return TWIG_GET_ARRAYOBJECT_ELEMENT(class, prop_name TSRMLS_CC); + } + return NULL; + } + + switch(Z_TYPE_P(prop_name)) { + case IS_NULL: + zend_hash_find(HASH_OF(class), "", 1, (void**) &tmp_zval); + return *tmp_zval; + + case IS_BOOL: + case IS_DOUBLE: + convert_to_long(prop_name); + case IS_LONG: + zend_hash_index_find(HASH_OF(class), Z_LVAL_P(prop_name), (void **) &tmp_zval); + return *tmp_zval; + + case IS_STRING: + zend_symtable_find(HASH_OF(class), Z_STRVAL_P(prop_name), Z_STRLEN_P(prop_name) + 1, (void**) &tmp_zval); + return *tmp_zval; + } + + return NULL; +} + +static zval *TWIG_GET_ARRAY_ELEMENT(zval *class, char *prop_name, int prop_name_length TSRMLS_DC) +{ + zval **tmp_zval; + + if (class == NULL/* || Z_TYPE_P(class) != IS_ARRAY*/) { + return NULL; + } + + if (class != NULL && Z_TYPE_P(class) == IS_OBJECT && TWIG_INSTANCE_OF(class, zend_ce_arrayaccess TSRMLS_CC)) { + // array access object + zval *tmp_name_zval; + zval *tmp_ret_zval; + + ALLOC_INIT_ZVAL(tmp_name_zval); + ZVAL_STRING(tmp_name_zval, prop_name, 1); + tmp_ret_zval = TWIG_GET_ARRAYOBJECT_ELEMENT(class, tmp_name_zval TSRMLS_CC); + FREE_DTOR(tmp_name_zval); + return tmp_ret_zval; + } + + if (zend_symtable_find(HASH_OF(class), prop_name, prop_name_length+1, (void**)&tmp_zval) == SUCCESS) { + return *tmp_zval; + } + return NULL; +} + +static zval *TWIG_PROPERTY(zval *object, zval *propname TSRMLS_DC) +{ + zval *tmp = NULL; + + if (Z_OBJ_HT_P(object)->read_property) { +#if PHP_VERSION_ID >= 50400 + tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS, NULL TSRMLS_CC); +#else + tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS TSRMLS_CC); +#endif + if (tmp == EG(uninitialized_zval_ptr)) { + ZVAL_NULL(tmp); + } + } + return tmp; +} + +static int TWIG_HAS_PROPERTY(zval *object, zval *propname TSRMLS_DC) +{ + if (Z_OBJ_HT_P(object)->has_property) { +#if PHP_VERSION_ID >= 50400 + return Z_OBJ_HT_P(object)->has_property(object, propname, 0, NULL TSRMLS_CC); +#else + return Z_OBJ_HT_P(object)->has_property(object, propname, 0 TSRMLS_CC); +#endif + } + return 0; +} + +static int TWIG_HAS_DYNAMIC_PROPERTY(zval *object, char *prop, int prop_len TSRMLS_DC) +{ + if (Z_OBJ_HT_P(object)->get_properties) { + return zend_hash_quick_exists( + Z_OBJ_HT_P(object)->get_properties(object TSRMLS_CC), // the properties hash + prop, // property name + prop_len + 1, // property length + zend_get_hash_value(prop, prop_len + 1) // hash value + ); + } + return 0; +} + +static zval *TWIG_PROPERTY_CHAR(zval *object, char *propname TSRMLS_DC) +{ + zval *tmp_name_zval, *tmp; + + ALLOC_INIT_ZVAL(tmp_name_zval); + ZVAL_STRING(tmp_name_zval, propname, 1); + tmp = TWIG_PROPERTY(object, tmp_name_zval TSRMLS_CC); + FREE_DTOR(tmp_name_zval); + return tmp; +} + +static zval *TWIG_CALL_S(zval *object, char *method, char *arg0 TSRMLS_DC) +{ + zend_fcall_info fci; + zval **args[1]; + zval *argument; + zval *zfunction; + zval *retval_ptr; + + MAKE_STD_ZVAL(argument); + ZVAL_STRING(argument, arg0, 1); + args[0] = &argument; + + MAKE_STD_ZVAL(zfunction); + ZVAL_STRING(zfunction, method, 1); + fci.size = sizeof(fci); + fci.function_table = EG(function_table); + fci.function_name = zfunction; + fci.symbol_table = NULL; +#if PHP_VERSION_ID >= 50300 + fci.object_ptr = object; +#else + fci.object_pp = &object; +#endif + fci.retval_ptr_ptr = &retval_ptr; + fci.param_count = 1; + fci.params = args; + fci.no_separation = 0; + + if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { + FREE_DTOR(zfunction); + zval_ptr_dtor(&argument); + return 0; + } + FREE_DTOR(zfunction); + zval_ptr_dtor(&argument); + return retval_ptr; +} + +static int TWIG_CALL_SB(zval *object, char *method, char *arg0 TSRMLS_DC) +{ + zval *retval_ptr; + int success; + + retval_ptr = TWIG_CALL_S(object, method, arg0 TSRMLS_CC); + success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr)); + + if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); + } + + return success; +} + +static int TWIG_CALL_ZZ(zval *object, char *method, zval *arg1, zval *arg2 TSRMLS_DC) +{ + zend_fcall_info fci; + zval **args[2]; + zval *zfunction; + zval *retval_ptr; + int success; + + args[0] = &arg1; + args[1] = &arg2; + + MAKE_STD_ZVAL(zfunction); + ZVAL_STRING(zfunction, method, 1); + fci.size = sizeof(fci); + fci.function_table = EG(function_table); + fci.function_name = zfunction; + fci.symbol_table = NULL; +#if PHP_VERSION_ID >= 50300 + fci.object_ptr = object; +#else + fci.object_pp = &object; +#endif + fci.retval_ptr_ptr = &retval_ptr; + fci.param_count = 2; + fci.params = args; + fci.no_separation = 0; + + if (zend_call_function(&fci, NULL TSRMLS_CC) == FAILURE) { + FREE_DTOR(zfunction); + return 0; + } + + FREE_DTOR(zfunction); + + success = (retval_ptr && (Z_TYPE_P(retval_ptr) == IS_BOOL) && Z_LVAL_P(retval_ptr)); + if (retval_ptr) { + zval_ptr_dtor(&retval_ptr); + } + + return success; +} + +#ifndef Z_SET_REFCOUNT_P +# define Z_SET_REFCOUNT_P(pz, rc) pz->refcount = rc +# define Z_UNSET_ISREF_P(pz) pz->is_ref = 0 +#endif + +static void TWIG_NEW(zval *object, char *class, zval *arg0, zval *arg1 TSRMLS_DC) +{ + zend_class_entry **pce; + + if (zend_lookup_class(class, strlen(class), &pce TSRMLS_CC) == FAILURE) { + return; + } + + Z_TYPE_P(object) = IS_OBJECT; + object_init_ex(object, *pce); + Z_SET_REFCOUNT_P(object, 1); + Z_UNSET_ISREF_P(object); + + TWIG_CALL_ZZ(object, "__construct", arg0, arg1 TSRMLS_CC); +} + +static int twig_add_array_key_to_string(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +{ + smart_str *buf; + char *joiner; + APPLY_TSRMLS_FETCH(); + + buf = va_arg(args, smart_str*); + joiner = va_arg(args, char*); + + if (buf->len != 0) { + smart_str_appends(buf, joiner); + } + + if (hash_key->nKeyLength == 0) { + smart_str_append_long(buf, (long) hash_key->h); + } else { + char *key, *tmp_str; + int key_len, tmp_len; + key = php_addcslashes(hash_key->arKey, hash_key->nKeyLength - 1, &key_len, 0, "'\\", 2 TSRMLS_CC); + tmp_str = php_str_to_str_ex(key, key_len, "\0", 1, "' . \"\\0\" . '", 12, &tmp_len, 0, NULL); + + smart_str_appendl(buf, tmp_str, tmp_len); + efree(key); + efree(tmp_str); + } + + return 0; +} + +static char *TWIG_IMPLODE_ARRAY_KEYS(char *joiner, zval *array TSRMLS_DC) +{ + smart_str collector = { 0, 0, 0 }; + + smart_str_appendl(&collector, "", 0); + zend_hash_apply_with_arguments(HASH_OF(array) APPLY_TSRMLS_CC, twig_add_array_key_to_string, 2, &collector, joiner); + smart_str_0(&collector); + + return collector.c; +} + +static void TWIG_RUNTIME_ERROR(zval *template TSRMLS_DC, char *message, ...) +{ + char *buffer; + va_list args; + zend_class_entry **pce; + zval *ex; + zval *constructor; + zval *zmessage; + zval *lineno; + zval *filename_func; + zval *filename; + zval *constructor_args[3]; + zval *constructor_retval; + + if (zend_lookup_class("Twig_Error_Runtime", strlen("Twig_Error_Runtime"), &pce TSRMLS_CC) == FAILURE) { + return; + } + + va_start(args, message); + vspprintf(&buffer, 0, message, args); + va_end(args); + + MAKE_STD_ZVAL(ex); + object_init_ex(ex, *pce); + + // Call Twig_Error constructor + MAKE_STD_ZVAL(constructor); + MAKE_STD_ZVAL(zmessage); + MAKE_STD_ZVAL(lineno); + MAKE_STD_ZVAL(filename); + MAKE_STD_ZVAL(filename_func); + MAKE_STD_ZVAL(constructor_retval); + + ZVAL_STRINGL(constructor, "__construct", sizeof("__construct")-1, 1); + ZVAL_STRING(zmessage, buffer, 1); + ZVAL_LONG(lineno, -1); + + // Get template filename + ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1); + call_user_function(EG(function_table), &template, filename_func, filename, 0, 0 TSRMLS_CC); + + constructor_args[0] = zmessage; + constructor_args[1] = lineno; + constructor_args[2] = filename; + call_user_function(EG(function_table), &ex, constructor, constructor_retval, 3, constructor_args TSRMLS_CC); + + zval_ptr_dtor(&constructor_retval); + zval_ptr_dtor(&zmessage); + zval_ptr_dtor(&lineno); + zval_ptr_dtor(&filename); + FREE_DTOR(constructor); + FREE_DTOR(filename_func); + efree(buffer); + + zend_throw_exception_object(ex TSRMLS_CC); +} + +static char *TWIG_GET_CLASS_NAME(zval *object TSRMLS_DC) +{ + char *class_name; + zend_uint class_name_len; + + if (Z_TYPE_P(object) != IS_OBJECT) { + return ""; + } +#if PHP_API_VERSION >= 20100412 + zend_get_object_classname(object, (const char **) &class_name, &class_name_len TSRMLS_CC); +#else + zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC); +#endif + return class_name; +} + +static int twig_add_method_to_class(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +{ + zend_class_entry *ce; + zval *retval; + char *item; + size_t item_len; + zend_function *mptr = (zend_function *) pDest; + APPLY_TSRMLS_FETCH(); + + if (!(mptr->common.fn_flags & ZEND_ACC_PUBLIC)) { + return 0; + } + + ce = *va_arg(args, zend_class_entry**); + retval = va_arg(args, zval*); + + item_len = strlen(mptr->common.function_name); + item = estrndup(mptr->common.function_name, item_len); + php_strtolower(item, item_len); + + if (strcmp("getenvironment", item) == 0) { + zend_class_entry **twig_template_ce; + if (zend_lookup_class("Twig_Template", strlen("Twig_Template"), &twig_template_ce TSRMLS_CC) == FAILURE) { + return 0; + } + if (instanceof_function(ce, *twig_template_ce TSRMLS_CC)) { + return 0; + } + } + + add_assoc_stringl_ex(retval, item, item_len+1, item, item_len, 0); + + return 0; +} + +static int twig_add_property_to_class(void *pDest APPLY_TSRMLS_DC, int num_args, va_list args, zend_hash_key *hash_key) +{ + zend_class_entry *ce; + zval *retval; + char *class_name, *prop_name; + zend_property_info *pptr = (zend_property_info *) pDest; + APPLY_TSRMLS_FETCH(); + + if (!(pptr->flags & ZEND_ACC_PUBLIC) || (pptr->flags & ZEND_ACC_STATIC)) { + return 0; + } + + ce = *va_arg(args, zend_class_entry**); + retval = va_arg(args, zval*); + +#if PHP_API_VERSION >= 20100412 + zend_unmangle_property_name(pptr->name, pptr->name_length, (const char **) &class_name, (const char **) &prop_name); +#else + zend_unmangle_property_name(pptr->name, pptr->name_length, &class_name, &prop_name); +#endif + + add_assoc_string(retval, prop_name, prop_name, 1); + + return 0; +} + +static void twig_add_class_to_cache(zval *cache, zval *object, char *class_name TSRMLS_DC) +{ + zval *class_info, *class_methods, *class_properties; + zend_class_entry *class_ce; + + class_ce = zend_get_class_entry(object TSRMLS_CC); + + ALLOC_INIT_ZVAL(class_info); + ALLOC_INIT_ZVAL(class_methods); + ALLOC_INIT_ZVAL(class_properties); + array_init(class_info); + array_init(class_methods); + array_init(class_properties); + // add all methods to self::cache[$class]['methods'] + zend_hash_apply_with_arguments(&class_ce->function_table APPLY_TSRMLS_CC, twig_add_method_to_class, 2, &class_ce, class_methods); + zend_hash_apply_with_arguments(&class_ce->properties_info APPLY_TSRMLS_CC, twig_add_property_to_class, 2, &class_ce, class_properties); + + add_assoc_zval(class_info, "methods", class_methods); + add_assoc_zval(class_info, "properties", class_properties); + add_assoc_zval(cache, class_name, class_info); +} + +/* {{{ proto mixed twig_template_get_attributes(TwigTemplate template, mixed object, mixed item, array arguments, string type, boolean isDefinedTest, boolean ignoreStrictCheck) + A C implementation of TwigTemplate::getAttribute() */ +PHP_FUNCTION(twig_template_get_attributes) +{ + zval *template; + zval *object; + char *item; + int item_len; + zval *zitem, ztmpitem; + zval *arguments = NULL; + zval *ret = NULL; + char *type = NULL; + int type_len = 0; + zend_bool isDefinedTest = 0; + zend_bool ignoreStrictCheck = 0; + int free_ret = 0; + zval *tmp_self_cache; + char *class_name = NULL; + zval *tmp_class; + char *type_name; + + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ozz|asbb", &template, &object, &zitem, &arguments, &type, &type_len, &isDefinedTest, &ignoreStrictCheck) == FAILURE) { + return; + } + + // convert the item to a string + ztmpitem = *zitem; + zval_copy_ctor(&ztmpitem); + convert_to_string(&ztmpitem); + item_len = Z_STRLEN(ztmpitem); + item = estrndup(Z_STRVAL(ztmpitem), item_len); + zval_dtor(&ztmpitem); + + if (!type) { + type = "any"; + } + +/* + // array + if (\Twig\Template::METHOD_CALL !== $type) { + $arrayItem = is_bool($item) || is_float($item) ? (int) $item : $item; + + if ((is_array($object) && array_key_exists($arrayItem, $object)) + || ($object instanceof ArrayAccess && isset($object[$arrayItem])) + ) { + if ($isDefinedTest) { + return true; + } + + return $object[$arrayItem]; + } +*/ + + + if (strcmp("method", type) != 0) { + if ((TWIG_ARRAY_KEY_EXISTS(object, zitem)) + || (TWIG_INSTANCE_OF(object, zend_ce_arrayaccess TSRMLS_CC) && TWIG_ISSET_ARRAYOBJECT_ELEMENT(object, zitem TSRMLS_CC)) + ) { + + if (isDefinedTest) { + efree(item); + RETURN_TRUE; + } + + ret = TWIG_GET_ARRAY_ELEMENT_ZVAL(object, zitem TSRMLS_CC); + + if (!ret) { + ret = &EG(uninitialized_zval); + } + RETVAL_ZVAL(ret, 1, 0); + if (free_ret) { + zval_ptr_dtor(&ret); + } + efree(item); + return; + } +/* + if (\Twig\Template::ARRAY_CALL === $type) { + if ($isDefinedTest) { + return false; + } + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } +*/ + if (strcmp("array", type) == 0 || Z_TYPE_P(object) != IS_OBJECT) { + if (isDefinedTest) { + efree(item); + RETURN_FALSE; + } + if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { + efree(item); + return; + } +/* + if ($object instanceof ArrayAccess) { + $message = sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist', $arrayItem, get_class($object)); + } elseif (is_object($object)) { + $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface', $item, get_class($object)); + } elseif (is_array($object)) { + if (empty($object)) { + $message = sprintf('Key "%s" does not exist as the array is empty', $arrayItem); + } else { + $message = sprintf('Key "%s" for array with keys "%s" does not exist', $arrayItem, implode(', ', array_keys($object))); + } + } elseif (\Twig\Template::ARRAY_CALL === $type) { + if (null === $object) { + $message = sprintf('Impossible to access a key ("%s") on a null variable', $item); + } else { + $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s")', $item, gettype($object), $object); + } + } elseif (null === $object) { + $message = sprintf('Impossible to access an attribute ("%s") on a null variable', $item); + } else { + $message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s")', $item, gettype($object), $object); + } + throw new \Twig\Error\RuntimeError($message, -1, $this->getTemplateName()); + } + } +*/ + if (TWIG_INSTANCE_OF(object, zend_ce_arrayaccess TSRMLS_CC)) { + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" in object with ArrayAccess of class \"%s\" does not exist.", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); + } else if (Z_TYPE_P(object) == IS_OBJECT) { + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to access a key \"%s\" on an object of class \"%s\" that does not implement ArrayAccess interface.", item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); + } else if (Z_TYPE_P(object) == IS_ARRAY) { + if (0 == zend_hash_num_elements(Z_ARRVAL_P(object))) { + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" does not exist as the array is empty.", item); + } else { + char *array_keys = TWIG_IMPLODE_ARRAY_KEYS(", ", object TSRMLS_CC); + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Key \"%s\" for array with keys \"%s\" does not exist.", item, array_keys); + efree(array_keys); + } + } else { + char *type_name = zend_zval_type_name(object); + Z_ADDREF_P(object); + if (Z_TYPE_P(object) == IS_NULL) { + convert_to_string(object); + TWIG_RUNTIME_ERROR(template TSRMLS_CC, + (strcmp("array", type) == 0) + ? "Impossible to access a key (\"%s\") on a %s variable." + : "Impossible to access an attribute (\"%s\") on a %s variable.", + item, type_name); + } else { + convert_to_string(object); + TWIG_RUNTIME_ERROR(template TSRMLS_CC, + (strcmp("array", type) == 0) + ? "Impossible to access a key (\"%s\") on a %s variable (\"%s\")." + : "Impossible to access an attribute (\"%s\") on a %s variable (\"%s\").", + item, type_name, Z_STRVAL_P(object)); + } + zval_ptr_dtor(&object); + } + efree(item); + return; + } + } + +/* + if (!is_object($object)) { + if ($isDefinedTest) { + return false; + } +*/ + + if (Z_TYPE_P(object) != IS_OBJECT) { + if (isDefinedTest) { + efree(item); + RETURN_FALSE; + } +/* + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } + + if (null === $object) { + $message = sprintf('Impossible to invoke a method ("%s") on a null variable', $item); + } elseif (is_array($object)) { + $message = sprintf('Impossible to invoke a method ("%s") on an array.', $item); + } else { + $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object); + } + + throw new \Twig\Error\RuntimeError($message, -1, $this->getTemplateName()); + } +*/ + if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { + efree(item); + return; + } + + type_name = zend_zval_type_name(object); + Z_ADDREF_P(object); + if (Z_TYPE_P(object) == IS_NULL) { + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a null variable.", item); + } else if (Z_TYPE_P(object) == IS_ARRAY) { + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on an array.", item); + } else { + convert_to_string_ex(&object); + + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a %s variable (\"%s\").", item, type_name, Z_STRVAL_P(object)); + } + + zval_ptr_dtor(&object); + efree(item); + return; + } +/* + $class = get_class($object); +*/ + + class_name = TWIG_GET_CLASS_NAME(object TSRMLS_CC); + tmp_self_cache = TWIG_GET_STATIC_PROPERTY(template, "cache" TSRMLS_CC); + tmp_class = TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC); + + if (!tmp_class) { + twig_add_class_to_cache(tmp_self_cache, object, class_name TSRMLS_CC); + tmp_class = TWIG_GET_ARRAY_ELEMENT(tmp_self_cache, class_name, strlen(class_name) TSRMLS_CC); + } + efree(class_name); + +/* + // object property + if (\Twig\Template::METHOD_CALL !== $type && !$object instanceof \Twig\Template) { + if (isset($object->$item) || array_key_exists((string) $item, $object)) { + if ($isDefinedTest) { + return true; + } + + if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) { + $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkPropertyAllowed($object, $item); + } + + return $object->$item; + } + } +*/ + if (strcmp("method", type) != 0 && !TWIG_INSTANCE_OF_USERLAND(object, "Twig_Template" TSRMLS_CC)) { + zval *tmp_properties, *tmp_item; + + tmp_properties = TWIG_GET_ARRAY_ELEMENT(tmp_class, "properties", strlen("properties") TSRMLS_CC); + tmp_item = TWIG_GET_ARRAY_ELEMENT(tmp_properties, item, item_len TSRMLS_CC); + + if (tmp_item || TWIG_HAS_PROPERTY(object, zitem TSRMLS_CC) || TWIG_HAS_DYNAMIC_PROPERTY(object, item, item_len TSRMLS_CC)) { + if (isDefinedTest) { + efree(item); + RETURN_TRUE; + } + if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "hasExtension", "Twig_Extension_Sandbox" TSRMLS_CC)) { + TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "Twig_Extension_Sandbox" TSRMLS_CC), "checkPropertyAllowed", object, zitem TSRMLS_CC); + } + if (EG(exception)) { + efree(item); + return; + } + + ret = TWIG_PROPERTY(object, zitem TSRMLS_CC); + efree(item); + RETURN_ZVAL(ret, 1, 0); + } + } +/* + // object method + if (!isset(self::$cache[$class]['methods'])) { + if ($object instanceof self) { + $ref = new \ReflectionClass($class); + $methods = []; + + foreach ($ref->getMethods(ReflectionMethod::IS_PUBLIC) as $refMethod) { + $methodName = strtolower($refMethod->name); + + // Accessing the environment from templates is forbidden to prevent untrusted changes to the environment + if ('getenvironment' !== $methodName) { + $methods[$methodName] = true; + } + } + + self::$cache[$class]['methods'] = $methods; + } else { + self::$cache[$class]['methods'] = array_change_key_case(array_flip(get_class_methods($object))); + } + } + + $call = false; + $lcItem = strtolower($item); + if (isset(self::$cache[$class]['methods'][$lcItem])) { + $method = (string) $item; + } elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) { + $method = 'get'.$item; + } elseif (isset(self::$cache[$class]['methods']['is'.$lcItem])) { + $method = 'is'.$item; + } elseif (isset(self::$cache[$class]['methods']['__call'])) { + $method = (string) $item; + $call = true; +*/ + { + int call = 0; + char *lcItem = TWIG_STRTOLOWER(item, item_len); + int lcItem_length; + char *method = NULL; + char *methodForDeprecation = NULL; + char *tmp_method_name_get; + char *tmp_method_name_is; + zval *zmethod; + zval *tmp_methods; + + lcItem_length = strlen(lcItem); + tmp_method_name_get = emalloc(4 + lcItem_length); + tmp_method_name_is = emalloc(3 + lcItem_length); + + sprintf(tmp_method_name_get, "get%s", lcItem); + sprintf(tmp_method_name_is, "is%s", lcItem); + + tmp_methods = TWIG_GET_ARRAY_ELEMENT(tmp_class, "methods", strlen("methods") TSRMLS_CC); + methodForDeprecation = emalloc(item_len + 1); + sprintf(methodForDeprecation, "%s", item); + + if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, lcItem, lcItem_length TSRMLS_CC)) { + method = item; + } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, tmp_method_name_get, lcItem_length + 3 TSRMLS_CC)) { + method = tmp_method_name_get; + } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, tmp_method_name_is, lcItem_length + 2 TSRMLS_CC)) { + method = tmp_method_name_is; + } else if (TWIG_GET_ARRAY_ELEMENT(tmp_methods, "__call", 6 TSRMLS_CC)) { + method = item; + call = 1; +/* + } else { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return null; + } + + throw new \Twig\Error\RuntimeError(sprintf('Method "%s" for object "%s" does not exist.', $item, get_class($object)), -1, $this->getTemplateName()); + } + + if ($isDefinedTest) { + return true; + } +*/ + } else { + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem); + + if (isDefinedTest) { + efree(item); + RETURN_FALSE; + } + if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { + efree(item); + return; + } + TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Neither the property \"%s\" nor one of the methods \"%s()\", \"get%s()\"/\"is%s()\" or \"__call()\" exist and have public access in class \"%s\".", item, item, item, item, TWIG_GET_CLASS_NAME(object TSRMLS_CC)); + efree(item); + return; + } + + if (isDefinedTest) { + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem);efree(item); + RETURN_TRUE; + } +/* + if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) { + $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method); + } +*/ + MAKE_STD_ZVAL(zmethod); + ZVAL_STRING(zmethod, method, 1); + if (TWIG_CALL_SB(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "hasExtension", "Twig_Extension_Sandbox" TSRMLS_CC)) { + TWIG_CALL_ZZ(TWIG_CALL_S(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getExtension", "Twig_Extension_Sandbox" TSRMLS_CC), "checkMethodAllowed", object, zmethod TSRMLS_CC); + } + zval_ptr_dtor(&zmethod); + if (EG(exception)) { + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem);efree(item); + return; + } +/* + // Some objects throw exceptions when they have __call, and the method we try + // to call is not supported. If ignoreStrictCheck is true, we should return null. + try { + $ret = call_user_func_array([$object, $method], $arguments); + } catch (\BadMethodCallException $e) { + if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) { + return null; + } + throw $e; + } +*/ + ret = TWIG_CALL_USER_FUNC_ARRAY(object, method, arguments TSRMLS_CC); + if (EG(exception) && TWIG_INSTANCE_OF(EG(exception), spl_ce_BadMethodCallException TSRMLS_CC)) { + if (ignoreStrictCheck || !TWIG_CALL_BOOLEAN(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "isStrictVariables" TSRMLS_CC)) { + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem);efree(item); + zend_clear_exception(TSRMLS_C); + return; + } + } + free_ret = 1; + efree(tmp_method_name_get); + efree(tmp_method_name_is); + efree(lcItem); +/* + // @deprecated in 1.28 + if ($object instanceof Twig_TemplateInterface) { + $self = $object->getTemplateName() === $this->getTemplateName(); + $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName()); + if ('renderBlock' === $method || 'displayBlock' === $method) { + $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template'); + } elseif ('hasBlock' === $method) { + $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template'); + } elseif ('render' === $method || 'display' === $method) { + $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName()); + } + @trigger_error($message, E_USER_DEPRECATED); + + return $ret === '' ? '' : new \Twig\Markup($ret, $this->env->getCharset()); + } + + return $ret; +*/ + efree(item); + // ret can be null, if e.g. the called method throws an exception + if (ret) { + if (TWIG_INSTANCE_OF_USERLAND(object, "Twig_TemplateInterface" TSRMLS_CC)) { + int self; + int old_error_reporting; + zval *object_filename; + zval *this_filename; + zval *filename_func; + char *deprecation_message_complement = NULL; + char *deprecation_message = NULL; + + MAKE_STD_ZVAL(object_filename); + MAKE_STD_ZVAL(this_filename); + MAKE_STD_ZVAL(filename_func); + + // Get templates names + ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1); + call_user_function(EG(function_table), &object, filename_func, object_filename, 0, 0 TSRMLS_CC); + ZVAL_STRINGL(filename_func, "getTemplateName", sizeof("getTemplateName")-1, 1); + call_user_function(EG(function_table), &template, filename_func, this_filename, 0, 0 TSRMLS_CC); + + self = (strcmp(Z_STRVAL_P(object_filename), Z_STRVAL_P(this_filename)) == 0); + + if (strcmp(methodForDeprecation, "renderBlock") == 0 || strcmp(methodForDeprecation, "displayBlock") == 0) { + zval **arg0; + zend_hash_index_find(HASH_OF(arguments), 0, (void **) &arg0); + asprintf( + &deprecation_message_complement, + " Use block(\"%s\"%s) instead).", + Z_STRVAL_PP(arg0), + self ? "" : ", template" + ); + } else if (strcmp(methodForDeprecation, "hasBlock") == 0) { + zval **arg0; + zend_hash_index_find(HASH_OF(arguments), 0, (void **) &arg0); + asprintf( + &deprecation_message_complement, + " Use \"block(\"%s\"%s) is defined\" instead).", + Z_STRVAL_PP(arg0), + self ? "" : ", template" + ); + } else if (strcmp(methodForDeprecation, "render") == 0 || strcmp(methodForDeprecation, "display") == 0) { + asprintf( + &deprecation_message_complement, + " Use include(\"%s\") instead).", + Z_STRVAL_P(object_filename) + ); + } else { + deprecation_message_complement = (char*)calloc(0, sizeof(char)); + } + + asprintf( + &deprecation_message, + "Calling \"%s\" on template \"%s\" from template \"%s\" is deprecated since version 1.28 and won't be supported anymore in 2.0.%s", + methodForDeprecation, + Z_STRVAL_P(object_filename), + Z_STRVAL_P(this_filename), + deprecation_message_complement + ); + + old_error_reporting = EG(error_reporting); + EG(error_reporting) = 0; + zend_error(E_USER_DEPRECATED, "%s", deprecation_message); + EG(error_reporting) = old_error_reporting; + + FREE_DTOR(filename_func) + FREE_DTOR(object_filename) + FREE_DTOR(this_filename) + free(deprecation_message); + free(deprecation_message_complement); + + if (Z_STRLEN_P(ret) != 0) { + zval *charset = TWIG_CALL_USER_FUNC_ARRAY(TWIG_PROPERTY_CHAR(template, "env" TSRMLS_CC), "getCharset", NULL TSRMLS_CC); + TWIG_NEW(return_value, "Twig_Markup", ret, charset TSRMLS_CC); + zval_ptr_dtor(&charset); + if (ret) { + zval_ptr_dtor(&ret); + } + efree(methodForDeprecation); + return; + } + } + + RETVAL_ZVAL(ret, 1, 0); + if (free_ret) { + zval_ptr_dtor(&ret); + } + } + + efree(methodForDeprecation); + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Autoloader.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Autoloader.php new file mode 100755 index 0000000..e34e214 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Autoloader.php @@ -0,0 +1,52 @@ + + * + * @deprecated since 1.21 and will be removed in 2.0. Use Composer instead. 2.0. + */ +class Twig_Autoloader +{ + /** + * Registers Twig_Autoloader as an SPL autoloader. + * + * @param bool $prepend whether to prepend the autoloader or not + */ + public static function register($prepend = false) + { + @trigger_error('Using Twig_Autoloader is deprecated since version 1.21. Use Composer instead.', E_USER_DEPRECATED); + + spl_autoload_register([__CLASS__, 'autoload'], true, $prepend); + } + + /** + * Handles autoloading of classes. + * + * @param string $class a class name + */ + public static function autoload($class) + { + if (0 !== strpos($class, 'Twig')) { + return; + } + + if (is_file($file = __DIR__.'/../'.str_replace(['_', "\0"], ['/', ''], $class).'.php')) { + require $file; + } elseif (is_file($file = __DIR__.'/../../src/'.str_replace(['Twig\\', '\\', "\0"], ['', '/', ''], $class).'.php')) { + require $file; + } + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php new file mode 100755 index 0000000..fe99b25 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/BaseNodeVisitor.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 3.0) + */ +interface Twig_CompilerInterface +{ + /** + * Compiles a node. + * + * @return $this + */ + public function compile(Twig_NodeInterface $node); + + /** + * Gets the current PHP code after compilation. + * + * @return string The PHP code + */ + public function getSource(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php new file mode 100755 index 0000000..b1f32f6 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/ContainerRuntimeLoader.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +abstract class Twig_Filter implements Twig_FilterInterface, Twig_FilterCallableInterface +{ + protected $options; + protected $arguments = []; + + public function __construct(array $options = []) + { + $this->options = array_merge([ + 'needs_environment' => false, + 'needs_context' => false, + 'pre_escape' => null, + 'preserves_safety' => null, + 'callable' => null, + ], $options); + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Node $filterArgs) + { + if (isset($this->options['is_safe'])) { + return $this->options['is_safe']; + } + + if (isset($this->options['is_safe_callback'])) { + return \call_user_func($this->options['is_safe_callback'], $filterArgs); + } + } + + public function getPreservesSafety() + { + return $this->options['preserves_safety']; + } + + public function getPreEscape() + { + return $this->options['pre_escape']; + } + + public function getCallable() + { + return $this->options['callable']; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Function.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Function.php new file mode 100755 index 0000000..011d4cc --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Function.php @@ -0,0 +1,40 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Filter_Function extends Twig_Filter +{ + protected $function; + + public function __construct($function, array $options = []) + { + $options['callable'] = $function; + + parent::__construct($options); + + $this->function = $function; + } + + public function compile() + { + return $this->function; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Method.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Method.php new file mode 100755 index 0000000..5cd0628 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Method.php @@ -0,0 +1,44 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Filter_Method extends Twig_Filter +{ + protected $extension; + protected $method; + + public function __construct(ExtensionInterface $extension, $method, array $options = []) + { + $options['callable'] = [$extension, $method]; + + parent::__construct($options); + + $this->extension = $extension; + $this->method = $method; + } + + public function compile() + { + return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method); + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Node.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Node.php new file mode 100755 index 0000000..8bb2899 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Filter/Node.php @@ -0,0 +1,42 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Filter_Node extends Twig_Filter +{ + protected $class; + + public function __construct($class, array $options = []) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/FilterCallableInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/FilterCallableInterface.php new file mode 100755 index 0000000..091ca97 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/FilterCallableInterface.php @@ -0,0 +1,24 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FilterCallableInterface +{ + public function getCallable(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/FilterInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/FilterInterface.php new file mode 100755 index 0000000..9b85f97 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/FilterInterface.php @@ -0,0 +1,45 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FilterInterface +{ + /** + * Compiles a filter. + * + * @return string The PHP code for the filter + */ + public function compile(); + + public function needsEnvironment(); + + public function needsContext(); + + public function getSafe(Node $filterArgs); + + public function getPreservesSafety(); + + public function getPreEscape(); + + public function setArguments($arguments); + + public function getArguments(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Function.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Function.php new file mode 100755 index 0000000..6646e74 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Function.php @@ -0,0 +1,76 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +abstract class Twig_Function implements Twig_FunctionInterface, Twig_FunctionCallableInterface +{ + protected $options; + protected $arguments = []; + + public function __construct(array $options = []) + { + $this->options = array_merge([ + 'needs_environment' => false, + 'needs_context' => false, + 'callable' => null, + ], $options); + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Node $functionArgs) + { + if (isset($this->options['is_safe'])) { + return $this->options['is_safe']; + } + + if (isset($this->options['is_safe_callback'])) { + return \call_user_func($this->options['is_safe_callback'], $functionArgs); + } + + return []; + } + + public function getCallable() + { + return $this->options['callable']; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Function.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Function.php new file mode 100755 index 0000000..605d8d3 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Function.php @@ -0,0 +1,41 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Function extends Twig_Function +{ + protected $function; + + public function __construct($function, array $options = []) + { + $options['callable'] = $function; + + parent::__construct($options); + + $this->function = $function; + } + + public function compile() + { + return $this->function; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Method.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Method.php new file mode 100755 index 0000000..9e472c5 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Method.php @@ -0,0 +1,45 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Method extends Twig_Function +{ + protected $extension; + protected $method; + + public function __construct(ExtensionInterface $extension, $method, array $options = []) + { + $options['callable'] = [$extension, $method]; + + parent::__construct($options); + + $this->extension = $extension; + $this->method = $method; + } + + public function compile() + { + return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method); + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Node.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Node.php new file mode 100755 index 0000000..8148ec3 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Function/Node.php @@ -0,0 +1,42 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Function_Node extends Twig_Function +{ + protected $class; + + public function __construct($class, array $options = []) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php new file mode 100755 index 0000000..abc83ea --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/FunctionCallableInterface.php @@ -0,0 +1,24 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FunctionCallableInterface +{ + public function getCallable(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/FunctionInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/FunctionInterface.php new file mode 100755 index 0000000..915d6cc --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/FunctionInterface.php @@ -0,0 +1,42 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_FunctionInterface +{ + /** + * Compiles a function. + * + * @return string The PHP code for the function + */ + public function compile(); + + public function needsEnvironment(); + + public function needsContext(); + + public function getSafe(Node $filterArgs); + + public function setArguments($arguments); + + public function getArguments(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Lexer.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Lexer.php new file mode 100755 index 0000000..00d74cc --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Lexer.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 3.0) + */ +interface Twig_LexerInterface +{ + /** + * Tokenizes a source code. + * + * @param string|Source $code The source code + * @param string $name A unique identifier for the source code + * + * @return TokenStream + * + * @throws SyntaxError When the code is syntactically wrong + */ + public function tokenize($code, $name = null); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Loader/Array.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Loader/Array.php new file mode 100755 index 0000000..13f915c --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Loader/Array.php @@ -0,0 +1,11 @@ + + */ +class Twig_Loader_String implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +{ + public function getSource($name) + { + @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED); + + return $name; + } + + public function getSourceContext($name) + { + return new Source($name, $name); + } + + public function exists($name) + { + return true; + } + + public function getCacheKey($name) + { + return $name; + } + + public function isFresh($name, $time) + { + return true; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/LoaderInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/LoaderInterface.php new file mode 100755 index 0000000..db515bb --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/LoaderInterface.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.23 and will be removed in 2.0. + */ +class Twig_Node_Expression_ExtensionReference extends AbstractExpression +{ + public function __construct($name, $lineno, $tag = null) + { + parent::__construct([], ['name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name'))); + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php new file mode 100755 index 0000000..8570571 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Node/Expression/Filter.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 3.0) + */ +interface Twig_NodeInterface extends \Countable, \IteratorAggregate +{ + /** + * Compiles the node to PHP. + */ + public function compile(Compiler $compiler); + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getLine(); + + public function getNodeTag(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/NodeOutputInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/NodeOutputInterface.php new file mode 100755 index 0000000..54009c0 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/NodeOutputInterface.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 3.0) + */ +interface Twig_ParserInterface +{ + /** + * Converts a token stream to a node tree. + * + * @return ModuleNode + * + * @throws SyntaxError When the token stream is syntactically or semantically wrong + */ + public function parse(TokenStream $stream); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php new file mode 100755 index 0000000..5bcb1ba --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Profiler/Dumper/Base.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 3.0) + */ +interface Twig_TemplateInterface +{ + const ANY_CALL = 'any'; + const ARRAY_CALL = 'array'; + const METHOD_CALL = 'method'; + + /** + * Renders the template with the given context and returns it as string. + * + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered template + */ + public function render(array $context); + + /** + * Displays the template with the given context. + * + * @param array $context An array of parameters to pass to the template + * @param array $blocks An array of blocks to pass to the template + */ + public function display(array $context, array $blocks = []); + + /** + * Returns the bound environment for this template. + * + * @return Environment + */ + public function getEnvironment(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/TemplateWrapper.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/TemplateWrapper.php new file mode 100755 index 0000000..6cb4ce4 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/TemplateWrapper.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +abstract class Twig_Test implements Twig_TestInterface, Twig_TestCallableInterface +{ + protected $options; + protected $arguments = []; + + public function __construct(array $options = []) + { + $this->options = array_merge([ + 'callable' => null, + ], $options); + } + + public function getCallable() + { + return $this->options['callable']; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/Function.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/Function.php new file mode 100755 index 0000000..a789c40 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/Function.php @@ -0,0 +1,38 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Test_Function extends Twig_Test +{ + protected $function; + + public function __construct($function, array $options = []) + { + $options['callable'] = $function; + + parent::__construct($options); + + $this->function = $function; + } + + public function compile() + { + return $this->function; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php new file mode 100755 index 0000000..e302bdb --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/IntegrationTestCase.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Test_Method extends Twig_Test +{ + protected $extension; + protected $method; + + public function __construct(ExtensionInterface $extension, $method, array $options = []) + { + $options['callable'] = [$extension, $method]; + + parent::__construct($options); + + $this->extension = $extension; + $this->method = $method; + } + + public function compile() + { + return sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($this->extension), $this->method); + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/Node.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/Node.php new file mode 100755 index 0000000..6b5de15 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/Node.php @@ -0,0 +1,40 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_Test_Node extends Twig_Test +{ + protected $class; + + public function __construct($class, array $options = []) + { + parent::__construct($options); + + $this->class = $class; + } + + public function getClass() + { + return $this->class; + } + + public function compile() + { + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php new file mode 100755 index 0000000..62aaaaf --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Test/NodeTestCase.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_TestCallableInterface +{ + public function getCallable(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/TestInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/TestInterface.php new file mode 100755 index 0000000..9166407 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/TestInterface.php @@ -0,0 +1,27 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_TestInterface +{ + /** + * Compiles a test. + * + * @return string The PHP code for the test + */ + public function compile(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/Token.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/Token.php new file mode 100755 index 0000000..e4d1806 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/Token.php @@ -0,0 +1,11 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface +{ + protected $parser; + protected $parsers = []; + protected $brokers = []; + + /** + * @param array|\Traversable $parsers A \Traversable of Twig_TokenParserInterface instances + * @param array|\Traversable $brokers A \Traversable of Twig_TokenParserBrokerInterface instances + * @param bool $triggerDeprecationError + */ + public function __construct($parsers = [], $brokers = [], $triggerDeprecationError = true) + { + if ($triggerDeprecationError) { + @trigger_error('The '.__CLASS__.' class is deprecated since version 1.12 and will be removed in 2.0.', E_USER_DEPRECATED); + } + + foreach ($parsers as $parser) { + if (!$parser instanceof TokenParserInterface) { + throw new \LogicException('$parsers must a an array of Twig_TokenParserInterface.'); + } + $this->parsers[$parser->getTag()] = $parser; + } + foreach ($brokers as $broker) { + if (!$broker instanceof Twig_TokenParserBrokerInterface) { + throw new \LogicException('$brokers must a an array of Twig_TokenParserBrokerInterface.'); + } + $this->brokers[] = $broker; + } + } + + public function addTokenParser(TokenParserInterface $parser) + { + $this->parsers[$parser->getTag()] = $parser; + } + + public function removeTokenParser(TokenParserInterface $parser) + { + $name = $parser->getTag(); + if (isset($this->parsers[$name]) && $parser === $this->parsers[$name]) { + unset($this->parsers[$name]); + } + } + + public function addTokenParserBroker(self $broker) + { + $this->brokers[] = $broker; + } + + public function removeTokenParserBroker(self $broker) + { + if (false !== $pos = array_search($broker, $this->brokers)) { + unset($this->brokers[$pos]); + } + } + + /** + * Gets a suitable TokenParser for a tag. + * + * First looks in parsers, then in brokers. + * + * @param string $tag A tag name + * + * @return TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found + */ + public function getTokenParser($tag) + { + if (isset($this->parsers[$tag])) { + return $this->parsers[$tag]; + } + $broker = end($this->brokers); + while (false !== $broker) { + $parser = $broker->getTokenParser($tag); + if (null !== $parser) { + return $parser; + } + $broker = prev($this->brokers); + } + } + + public function getParsers() + { + return $this->parsers; + } + + public function getParser() + { + return $this->parser; + } + + public function setParser(Twig_ParserInterface $parser) + { + $this->parser = $parser; + foreach ($this->parsers as $tokenParser) { + $tokenParser->setParser($parser); + } + foreach ($this->brokers as $broker) { + $broker->setParser($parser); + } + } +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php new file mode 100755 index 0000000..f369264 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/TokenParserBrokerInterface.php @@ -0,0 +1,46 @@ + + * + * @deprecated since 1.12 (to be removed in 2.0) + */ +interface Twig_TokenParserBrokerInterface +{ + /** + * Gets a TokenParser suitable for a tag. + * + * @param string $tag A tag name + * + * @return TokenParserInterface|null A Twig_TokenParserInterface or null if no suitable TokenParser was found + */ + public function getTokenParser($tag); + + /** + * Calls Twig\TokenParser\TokenParserInterface::setParser on all parsers the implementation knows of. + */ + public function setParser(Twig_ParserInterface $parser); + + /** + * Gets the Twig_ParserInterface. + * + * @return Twig_ParserInterface|null A Twig_ParserInterface instance or null + */ + public function getParser(); +} diff --git a/phpMyAdmin/vendor/twig/twig/lib/Twig/TokenParserInterface.php b/phpMyAdmin/vendor/twig/twig/lib/Twig/TokenParserInterface.php new file mode 100755 index 0000000..800c971 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/lib/Twig/TokenParserInterface.php @@ -0,0 +1,11 @@ + + */ +interface CacheInterface +{ + /** + * Generates a cache key for the given template class name. + * + * @param string $name The template name + * @param string $className The template class name + * + * @return string + */ + public function generateKey($name, $className); + + /** + * Writes the compiled template to cache. + * + * @param string $key The cache key + * @param string $content The template representation as a PHP class + */ + public function write($key, $content); + + /** + * Loads a template from the cache. + * + * @param string $key The cache key + */ + public function load($key); + + /** + * Returns the modification timestamp of a key. + * + * @param string $key The cache key + * + * @return int + */ + public function getTimestamp($key); +} + +class_alias('Twig\Cache\CacheInterface', 'Twig_CacheInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Cache/FilesystemCache.php b/phpMyAdmin/vendor/twig/twig/src/Cache/FilesystemCache.php new file mode 100755 index 0000000..b7c1e43 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Cache/FilesystemCache.php @@ -0,0 +1,93 @@ + + */ +class FilesystemCache implements CacheInterface +{ + const FORCE_BYTECODE_INVALIDATION = 1; + + private $directory; + private $options; + + /** + * @param string $directory The root cache directory + * @param int $options A set of options + */ + public function __construct($directory, $options = 0) + { + $this->directory = rtrim($directory, '\/').'/'; + $this->options = $options; + } + + public function generateKey($name, $className) + { + $hash = hash('sha256', $className); + + return $this->directory.$hash[0].$hash[1].'/'.$hash.'.php'; + } + + public function load($key) + { + if (file_exists($key)) { + @include_once $key; + } + } + + public function write($key, $content) + { + $dir = \dirname($key); + if (!is_dir($dir)) { + if (false === @mkdir($dir, 0777, true)) { + clearstatcache(true, $dir); + if (!is_dir($dir)) { + throw new \RuntimeException(sprintf('Unable to create the cache directory (%s).', $dir)); + } + } + } elseif (!is_writable($dir)) { + throw new \RuntimeException(sprintf('Unable to write in the cache directory (%s).', $dir)); + } + + $tmpFile = tempnam($dir, basename($key)); + if (false !== @file_put_contents($tmpFile, $content) && @rename($tmpFile, $key)) { + @chmod($key, 0666 & ~umask()); + + if (self::FORCE_BYTECODE_INVALIDATION == ($this->options & self::FORCE_BYTECODE_INVALIDATION)) { + // Compile cached file into bytecode cache + if (\function_exists('opcache_invalidate') && filter_var(ini_get('opcache.enable'), FILTER_VALIDATE_BOOLEAN)) { + @opcache_invalidate($key, true); + } elseif (\function_exists('apc_compile_file')) { + apc_compile_file($key); + } + } + + return; + } + + throw new \RuntimeException(sprintf('Failed to write cache file "%s".', $key)); + } + + public function getTimestamp($key) + { + if (!file_exists($key)) { + return 0; + } + + return (int) @filemtime($key); + } +} + +class_alias('Twig\Cache\FilesystemCache', 'Twig_Cache_Filesystem'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Cache/NullCache.php b/phpMyAdmin/vendor/twig/twig/src/Cache/NullCache.php new file mode 100755 index 0000000..c1b37c1 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Cache/NullCache.php @@ -0,0 +1,42 @@ + + */ +class NullCache implements CacheInterface +{ + public function generateKey($name, $className) + { + return ''; + } + + public function write($key, $content) + { + } + + public function load($key) + { + } + + public function getTimestamp($key) + { + return 0; + } +} + +class_alias('Twig\Cache\NullCache', 'Twig_Cache_Null'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Compiler.php b/phpMyAdmin/vendor/twig/twig/src/Compiler.php new file mode 100755 index 0000000..e47003a --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Compiler.php @@ -0,0 +1,288 @@ + + */ +class Compiler implements \Twig_CompilerInterface +{ + protected $lastLine; + protected $source; + protected $indentation; + protected $env; + protected $debugInfo = []; + protected $sourceOffset; + protected $sourceLine; + protected $filename; + private $varNameSalt = 0; + + public function __construct(Environment $env) + { + $this->env = $env; + } + + /** + * @deprecated since 1.25 (to be removed in 2.0) + */ + public function getFilename() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED); + + return $this->filename; + } + + /** + * Returns the environment instance related to this compiler. + * + * @return Environment + */ + public function getEnvironment() + { + return $this->env; + } + + /** + * Gets the current PHP code after compilation. + * + * @return string The PHP code + */ + public function getSource() + { + return $this->source; + } + + /** + * Compiles a node. + * + * @param int $indentation The current indentation + * + * @return $this + */ + public function compile(\Twig_NodeInterface $node, $indentation = 0) + { + $this->lastLine = null; + $this->source = ''; + $this->debugInfo = []; + $this->sourceOffset = 0; + // source code starts at 1 (as we then increment it when we encounter new lines) + $this->sourceLine = 1; + $this->indentation = $indentation; + $this->varNameSalt = 0; + + if ($node instanceof ModuleNode) { + // to be removed in 2.0 + $this->filename = $node->getTemplateName(); + } + + $node->compile($this); + + return $this; + } + + public function subcompile(\Twig_NodeInterface $node, $raw = true) + { + if (false === $raw) { + $this->source .= str_repeat(' ', $this->indentation * 4); + } + + $node->compile($this); + + return $this; + } + + /** + * Adds a raw string to the compiled code. + * + * @param string $string The string + * + * @return $this + */ + public function raw($string) + { + $this->source .= $string; + + return $this; + } + + /** + * Writes a string to the compiled code by adding indentation. + * + * @return $this + */ + public function write() + { + $strings = \func_get_args(); + foreach ($strings as $string) { + $this->source .= str_repeat(' ', $this->indentation * 4).$string; + } + + return $this; + } + + /** + * Appends an indentation to the current PHP code after compilation. + * + * @return $this + * + * @deprecated since 1.27 (to be removed in 2.0). + */ + public function addIndentation() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use write(\'\') instead.', E_USER_DEPRECATED); + + $this->source .= str_repeat(' ', $this->indentation * 4); + + return $this; + } + + /** + * Adds a quoted string to the compiled code. + * + * @param string $value The string + * + * @return $this + */ + public function string($value) + { + $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\")); + + return $this; + } + + /** + * Returns a PHP representation of a given value. + * + * @param mixed $value The value to convert + * + * @return $this + */ + public function repr($value) + { + if (\is_int($value) || \is_float($value)) { + if (false !== $locale = setlocale(LC_NUMERIC, '0')) { + setlocale(LC_NUMERIC, 'C'); + } + + $this->raw(var_export($value, true)); + + if (false !== $locale) { + setlocale(LC_NUMERIC, $locale); + } + } elseif (null === $value) { + $this->raw('null'); + } elseif (\is_bool($value)) { + $this->raw($value ? 'true' : 'false'); + } elseif (\is_array($value)) { + $this->raw('['); + $first = true; + foreach ($value as $key => $v) { + if (!$first) { + $this->raw(', '); + } + $first = false; + $this->repr($key); + $this->raw(' => '); + $this->repr($v); + } + $this->raw(']'); + } else { + $this->string($value); + } + + return $this; + } + + /** + * Adds debugging information. + * + * @return $this + */ + public function addDebugInfo(\Twig_NodeInterface $node) + { + if ($node->getTemplateLine() != $this->lastLine) { + $this->write(sprintf("// line %d\n", $node->getTemplateLine())); + + // when mbstring.func_overload is set to 2 + // mb_substr_count() replaces substr_count() + // but they have different signatures! + if (((int) ini_get('mbstring.func_overload')) & 2) { + @trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED); + + // this is much slower than the "right" version + $this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n"); + } else { + $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset); + } + $this->sourceOffset = \strlen($this->source); + $this->debugInfo[$this->sourceLine] = $node->getTemplateLine(); + + $this->lastLine = $node->getTemplateLine(); + } + + return $this; + } + + public function getDebugInfo() + { + ksort($this->debugInfo); + + return $this->debugInfo; + } + + /** + * Indents the generated code. + * + * @param int $step The number of indentation to add + * + * @return $this + */ + public function indent($step = 1) + { + $this->indentation += $step; + + return $this; + } + + /** + * Outdents the generated code. + * + * @param int $step The number of indentation to remove + * + * @return $this + * + * @throws \LogicException When trying to outdent too much so the indentation would become negative + */ + public function outdent($step = 1) + { + // can't outdent by more steps than the current indentation level + if ($this->indentation < $step) { + throw new \LogicException('Unable to call outdent() as the indentation would become negative.'); + } + + $this->indentation -= $step; + + return $this; + } + + public function getVarName() + { + return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->varNameSalt++)); + } +} + +class_alias('Twig\Compiler', 'Twig_Compiler'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Environment.php b/phpMyAdmin/vendor/twig/twig/src/Environment.php new file mode 100755 index 0000000..97fa4c4 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Environment.php @@ -0,0 +1,1638 @@ + + */ +class Environment +{ + const VERSION = '1.42.5'; + const VERSION_ID = 14205; + const MAJOR_VERSION = 1; + const MINOR_VERSION = 42; + const RELEASE_VERSION = 5; + const EXTRA_VERSION = ''; + + protected $charset; + protected $loader; + protected $debug; + protected $autoReload; + protected $cache; + protected $lexer; + protected $parser; + protected $compiler; + protected $baseTemplateClass; + protected $extensions; + protected $parsers; + protected $visitors; + protected $filters; + protected $tests; + protected $functions; + protected $globals; + protected $runtimeInitialized = false; + protected $extensionInitialized = false; + protected $loadedTemplates; + protected $strictVariables; + protected $unaryOperators; + protected $binaryOperators; + protected $templateClassPrefix = '__TwigTemplate_'; + protected $functionCallbacks = []; + protected $filterCallbacks = []; + protected $staging; + + private $originalCache; + private $bcWriteCacheFile = false; + private $bcGetCacheFilename = false; + private $lastModifiedExtension = 0; + private $extensionsByClass = []; + private $runtimeLoaders = []; + private $runtimes = []; + private $optionsHash; + + /** + * Constructor. + * + * Available options: + * + * * debug: When set to true, it automatically set "auto_reload" to true as + * well (default to false). + * + * * charset: The charset used by the templates (default to UTF-8). + * + * * base_template_class: The base template class to use for generated + * templates (default to \Twig\Template). + * + * * cache: An absolute path where to store the compiled templates, + * a \Twig\Cache\CacheInterface implementation, + * or false to disable compilation cache (default). + * + * * auto_reload: Whether to reload the template if the original source changed. + * If you don't provide the auto_reload option, it will be + * determined automatically based on the debug value. + * + * * strict_variables: Whether to ignore invalid variables in templates + * (default to false). + * + * * autoescape: Whether to enable auto-escaping (default to html): + * * false: disable auto-escaping + * * true: equivalent to html + * * html, js: set the autoescaping to one of the supported strategies + * * name: set the autoescaping strategy based on the template name extension + * * PHP callback: a PHP callback that returns an escaping strategy based on the template "name" + * + * * optimizations: A flag that indicates which optimizations to apply + * (default to -1 which means that all optimizations are enabled; + * set it to 0 to disable). + */ + public function __construct(LoaderInterface $loader = null, $options = []) + { + if (null !== $loader) { + $this->setLoader($loader); + } else { + @trigger_error('Not passing a "Twig\Lodaer\LoaderInterface" as the first constructor argument of "Twig\Environment" is deprecated since version 1.21.', E_USER_DEPRECATED); + } + + $options = array_merge([ + 'debug' => false, + 'charset' => 'UTF-8', + 'base_template_class' => '\Twig\Template', + 'strict_variables' => false, + 'autoescape' => 'html', + 'cache' => false, + 'auto_reload' => null, + 'optimizations' => -1, + ], $options); + + $this->debug = (bool) $options['debug']; + $this->charset = strtoupper($options['charset']); + $this->baseTemplateClass = $options['base_template_class']; + $this->autoReload = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload']; + $this->strictVariables = (bool) $options['strict_variables']; + $this->setCache($options['cache']); + + $this->addExtension(new CoreExtension()); + $this->addExtension(new EscaperExtension($options['autoescape'])); + $this->addExtension(new OptimizerExtension($options['optimizations'])); + $this->staging = new StagingExtension(); + + // For BC + if (\is_string($this->originalCache)) { + $r = new \ReflectionMethod($this, 'writeCacheFile'); + if (__CLASS__ !== $r->getDeclaringClass()->getName()) { + @trigger_error('The Twig\Environment::writeCacheFile method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED); + + $this->bcWriteCacheFile = true; + } + + $r = new \ReflectionMethod($this, 'getCacheFilename'); + if (__CLASS__ !== $r->getDeclaringClass()->getName()) { + @trigger_error('The Twig\Environment::getCacheFilename method is deprecated since version 1.22 and will be removed in Twig 2.0.', E_USER_DEPRECATED); + + $this->bcGetCacheFilename = true; + } + } + } + + /** + * Gets the base template class for compiled templates. + * + * @return string The base template class name + */ + public function getBaseTemplateClass() + { + return $this->baseTemplateClass; + } + + /** + * Sets the base template class for compiled templates. + * + * @param string $class The base template class name + */ + public function setBaseTemplateClass($class) + { + $this->baseTemplateClass = $class; + $this->updateOptionsHash(); + } + + /** + * Enables debugging mode. + */ + public function enableDebug() + { + $this->debug = true; + $this->updateOptionsHash(); + } + + /** + * Disables debugging mode. + */ + public function disableDebug() + { + $this->debug = false; + $this->updateOptionsHash(); + } + + /** + * Checks if debug mode is enabled. + * + * @return bool true if debug mode is enabled, false otherwise + */ + public function isDebug() + { + return $this->debug; + } + + /** + * Enables the auto_reload option. + */ + public function enableAutoReload() + { + $this->autoReload = true; + } + + /** + * Disables the auto_reload option. + */ + public function disableAutoReload() + { + $this->autoReload = false; + } + + /** + * Checks if the auto_reload option is enabled. + * + * @return bool true if auto_reload is enabled, false otherwise + */ + public function isAutoReload() + { + return $this->autoReload; + } + + /** + * Enables the strict_variables option. + */ + public function enableStrictVariables() + { + $this->strictVariables = true; + $this->updateOptionsHash(); + } + + /** + * Disables the strict_variables option. + */ + public function disableStrictVariables() + { + $this->strictVariables = false; + $this->updateOptionsHash(); + } + + /** + * Checks if the strict_variables option is enabled. + * + * @return bool true if strict_variables is enabled, false otherwise + */ + public function isStrictVariables() + { + return $this->strictVariables; + } + + /** + * Gets the current cache implementation. + * + * @param bool $original Whether to return the original cache option or the real cache instance + * + * @return CacheInterface|string|false A Twig\Cache\CacheInterface implementation, + * an absolute path to the compiled templates, + * or false to disable cache + */ + public function getCache($original = true) + { + return $original ? $this->originalCache : $this->cache; + } + + /** + * Sets the current cache implementation. + * + * @param CacheInterface|string|false $cache A Twig\Cache\CacheInterface implementation, + * an absolute path to the compiled templates, + * or false to disable cache + */ + public function setCache($cache) + { + if (\is_string($cache)) { + $this->originalCache = $cache; + $this->cache = new FilesystemCache($cache); + } elseif (false === $cache) { + $this->originalCache = $cache; + $this->cache = new NullCache(); + } elseif (null === $cache) { + @trigger_error('Using "null" as the cache strategy is deprecated since version 1.23 and will be removed in Twig 2.0.', E_USER_DEPRECATED); + $this->originalCache = false; + $this->cache = new NullCache(); + } elseif ($cache instanceof CacheInterface) { + $this->originalCache = $this->cache = $cache; + } else { + throw new \LogicException(sprintf('Cache can only be a string, false, or a \Twig\Cache\CacheInterface implementation.')); + } + } + + /** + * Gets the cache filename for a given template. + * + * @param string $name The template name + * + * @return string|false The cache file name or false when caching is disabled + * + * @deprecated since 1.22 (to be removed in 2.0) + */ + public function getCacheFilename($name) + { + @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + $key = $this->cache->generateKey($name, $this->getTemplateClass($name)); + + return !$key ? false : $key; + } + + /** + * Gets the template class associated with the given string. + * + * The generated template class is based on the following parameters: + * + * * The cache key for the given template; + * * The currently enabled extensions; + * * Whether the Twig C extension is available or not; + * * PHP version; + * * Twig version; + * * Options with what environment was created. + * + * @param string $name The name for which to calculate the template class name + * @param int|null $index The index if it is an embedded template + * + * @return string The template class name + */ + public function getTemplateClass($name, $index = null) + { + $key = $this->getLoader()->getCacheKey($name).$this->optionsHash; + + return $this->templateClassPrefix.hash('sha256', $key).(null === $index ? '' : '___'.$index); + } + + /** + * Gets the template class prefix. + * + * @return string The template class prefix + * + * @deprecated since 1.22 (to be removed in 2.0) + */ + public function getTemplateClassPrefix() + { + @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + return $this->templateClassPrefix; + } + + /** + * Renders a template. + * + * @param string|TemplateWrapper $name The template name + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered template + * + * @throws LoaderError When the template cannot be found + * @throws SyntaxError When an error occurred during compilation + * @throws RuntimeError When an error occurred during rendering + */ + public function render($name, array $context = []) + { + return $this->load($name)->render($context); + } + + /** + * Displays a template. + * + * @param string|TemplateWrapper $name The template name + * @param array $context An array of parameters to pass to the template + * + * @throws LoaderError When the template cannot be found + * @throws SyntaxError When an error occurred during compilation + * @throws RuntimeError When an error occurred during rendering + */ + public function display($name, array $context = []) + { + $this->load($name)->display($context); + } + + /** + * Loads a template. + * + * @param string|TemplateWrapper|\Twig\Template $name The template name + * + * @throws LoaderError When the template cannot be found + * @throws RuntimeError When a previously generated cache is corrupted + * @throws SyntaxError When an error occurred during compilation + * + * @return TemplateWrapper + */ + public function load($name) + { + if ($name instanceof TemplateWrapper) { + return $name; + } + + if ($name instanceof Template) { + return new TemplateWrapper($this, $name); + } + + return new TemplateWrapper($this, $this->loadTemplate($name)); + } + + /** + * Loads a template internal representation. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The template name + * @param int $index The index if it is an embedded template + * + * @return \Twig_TemplateInterface A template instance representing the given template name + * + * @throws LoaderError When the template cannot be found + * @throws RuntimeError When a previously generated cache is corrupted + * @throws SyntaxError When an error occurred during compilation + * + * @internal + */ + public function loadTemplate($name, $index = null) + { + return $this->loadClass($this->getTemplateClass($name), $name, $index); + } + + /** + * @internal + */ + public function loadClass($cls, $name, $index = null) + { + $mainCls = $cls; + if (null !== $index) { + $cls .= '___'.$index; + } + + if (isset($this->loadedTemplates[$cls])) { + return $this->loadedTemplates[$cls]; + } + + if (!class_exists($cls, false)) { + if ($this->bcGetCacheFilename) { + $key = $this->getCacheFilename($name); + } else { + $key = $this->cache->generateKey($name, $mainCls); + } + + if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) { + $this->cache->load($key); + } + + $source = null; + if (!class_exists($cls, false)) { + $loader = $this->getLoader(); + if (!$loader instanceof SourceContextLoaderInterface) { + $source = new Source($loader->getSource($name), $name); + } else { + $source = $loader->getSourceContext($name); + } + + $content = $this->compileSource($source); + + if ($this->bcWriteCacheFile) { + $this->writeCacheFile($key, $content); + } else { + $this->cache->write($key, $content); + $this->cache->load($key); + } + + if (!class_exists($mainCls, false)) { + /* Last line of defense if either $this->bcWriteCacheFile was used, + * $this->cache is implemented as a no-op or we have a race condition + * where the cache was cleared between the above calls to write to and load from + * the cache. + */ + eval('?>'.$content); + } + } + + if (!class_exists($cls, false)) { + throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source); + } + } + + if (!$this->runtimeInitialized) { + $this->initRuntime(); + } + + return $this->loadedTemplates[$cls] = new $cls($this); + } + + /** + * Creates a template from source. + * + * This method should not be used as a generic way to load templates. + * + * @param string $template The template source + * @param string $name An optional name of the template to be used in error messages + * + * @return TemplateWrapper A template instance representing the given template name + * + * @throws LoaderError When the template cannot be found + * @throws SyntaxError When an error occurred during compilation + */ + public function createTemplate($template, $name = null) + { + $hash = hash('sha256', $template, false); + if (null !== $name) { + $name = sprintf('%s (string template %s)', $name, $hash); + } else { + $name = sprintf('__string_template__%s', $hash); + } + + $loader = new ChainLoader([ + new ArrayLoader([$name => $template]), + $current = $this->getLoader(), + ]); + + $this->setLoader($loader); + try { + $template = new TemplateWrapper($this, $this->loadTemplate($name)); + } catch (\Exception $e) { + $this->setLoader($current); + + throw $e; + } catch (\Throwable $e) { + $this->setLoader($current); + + throw $e; + } + $this->setLoader($current); + + return $template; + } + + /** + * Returns true if the template is still fresh. + * + * Besides checking the loader for freshness information, + * this method also checks if the enabled extensions have + * not changed. + * + * @param string $name The template name + * @param int $time The last modification time of the cached template + * + * @return bool true if the template is fresh, false otherwise + */ + public function isTemplateFresh($name, $time) + { + if (0 === $this->lastModifiedExtension) { + foreach ($this->extensions as $extension) { + $r = new \ReflectionObject($extension); + if (file_exists($r->getFileName()) && ($extensionTime = filemtime($r->getFileName())) > $this->lastModifiedExtension) { + $this->lastModifiedExtension = $extensionTime; + } + } + } + + return $this->lastModifiedExtension <= $time && $this->getLoader()->isFresh($name, $time); + } + + /** + * Tries to load a template consecutively from an array. + * + * Similar to load() but it also accepts instances of \Twig\Template and + * \Twig\TemplateWrapper, and an array of templates where each is tried to be loaded. + * + * @param string|Template|\Twig\TemplateWrapper|array $names A template or an array of templates to try consecutively + * + * @return TemplateWrapper|Template + * + * @throws LoaderError When none of the templates can be found + * @throws SyntaxError When an error occurred during compilation + */ + public function resolveTemplate($names) + { + if (!\is_array($names)) { + $names = [$names]; + } + + foreach ($names as $name) { + if ($name instanceof Template) { + return $name; + } + if ($name instanceof TemplateWrapper) { + return $name; + } + + try { + return $this->loadTemplate($name); + } catch (LoaderError $e) { + if (1 === \count($names)) { + throw $e; + } + } + } + + throw new LoaderError(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names))); + } + + /** + * Clears the internal template cache. + * + * @deprecated since 1.18.3 (to be removed in 2.0) + */ + public function clearTemplateCache() + { + @trigger_error(sprintf('The %s method is deprecated since version 1.18.3 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + $this->loadedTemplates = []; + } + + /** + * Clears the template cache files on the filesystem. + * + * @deprecated since 1.22 (to be removed in 2.0) + */ + public function clearCacheFiles() + { + @trigger_error(sprintf('The %s method is deprecated since version 1.22 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + if (\is_string($this->originalCache)) { + foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->originalCache), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if ($file->isFile()) { + @unlink($file->getPathname()); + } + } + } + } + + /** + * Gets the Lexer instance. + * + * @return \Twig_LexerInterface + * + * @deprecated since 1.25 (to be removed in 2.0) + */ + public function getLexer() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED); + + if (null === $this->lexer) { + $this->lexer = new Lexer($this); + } + + return $this->lexer; + } + + public function setLexer(\Twig_LexerInterface $lexer) + { + $this->lexer = $lexer; + } + + /** + * Tokenizes a source code. + * + * @param string|Source $source The template source code + * @param string $name The template name (deprecated) + * + * @return TokenStream + * + * @throws SyntaxError When the code is syntactically wrong + */ + public function tokenize($source, $name = null) + { + if (!$source instanceof Source) { + @trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + $source = new Source($source, $name); + } + + if (null === $this->lexer) { + $this->lexer = new Lexer($this); + } + + return $this->lexer->tokenize($source); + } + + /** + * Gets the Parser instance. + * + * @return \Twig_ParserInterface + * + * @deprecated since 1.25 (to be removed in 2.0) + */ + public function getParser() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED); + + if (null === $this->parser) { + $this->parser = new Parser($this); + } + + return $this->parser; + } + + public function setParser(\Twig_ParserInterface $parser) + { + $this->parser = $parser; + } + + /** + * Converts a token stream to a node tree. + * + * @return ModuleNode + * + * @throws SyntaxError When the token stream is syntactically or semantically wrong + */ + public function parse(TokenStream $stream) + { + if (null === $this->parser) { + $this->parser = new Parser($this); + } + + return $this->parser->parse($stream); + } + + /** + * Gets the Compiler instance. + * + * @return \Twig_CompilerInterface + * + * @deprecated since 1.25 (to be removed in 2.0) + */ + public function getCompiler() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.25 and will be removed in 2.0.', __FUNCTION__), E_USER_DEPRECATED); + + if (null === $this->compiler) { + $this->compiler = new Compiler($this); + } + + return $this->compiler; + } + + public function setCompiler(\Twig_CompilerInterface $compiler) + { + $this->compiler = $compiler; + } + + /** + * Compiles a node and returns the PHP code. + * + * @return string The compiled PHP source code + */ + public function compile(\Twig_NodeInterface $node) + { + if (null === $this->compiler) { + $this->compiler = new Compiler($this); + } + + return $this->compiler->compile($node)->getSource(); + } + + /** + * Compiles a template source code. + * + * @param string|Source $source The template source code + * @param string $name The template name (deprecated) + * + * @return string The compiled PHP source code + * + * @throws SyntaxError When there was an error during tokenizing, parsing or compiling + */ + public function compileSource($source, $name = null) + { + if (!$source instanceof Source) { + @trigger_error(sprintf('Passing a string as the $source argument of %s() is deprecated since version 1.27. Pass a Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + $source = new Source($source, $name); + } + + try { + return $this->compile($this->parse($this->tokenize($source))); + } catch (Error $e) { + $e->setSourceContext($source); + throw $e; + } catch (\Exception $e) { + throw new SyntaxError(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $source, $e); + } + } + + public function setLoader(LoaderInterface $loader) + { + if (!$loader instanceof SourceContextLoaderInterface && 0 !== strpos(\get_class($loader), 'Mock_')) { + @trigger_error(sprintf('Twig loader "%s" should implement Twig\Loader\SourceContextLoaderInterface since version 1.27.', \get_class($loader)), E_USER_DEPRECATED); + } + + $this->loader = $loader; + } + + /** + * Gets the Loader instance. + * + * @return LoaderInterface + */ + public function getLoader() + { + if (null === $this->loader) { + throw new \LogicException('You must set a loader first.'); + } + + return $this->loader; + } + + /** + * Sets the default template charset. + * + * @param string $charset The default charset + */ + public function setCharset($charset) + { + $this->charset = strtoupper($charset); + } + + /** + * Gets the default template charset. + * + * @return string The default charset + */ + public function getCharset() + { + return $this->charset; + } + + /** + * Initializes the runtime environment. + * + * @deprecated since 1.23 (to be removed in 2.0) + */ + public function initRuntime() + { + $this->runtimeInitialized = true; + + foreach ($this->getExtensions() as $name => $extension) { + if (!$extension instanceof InitRuntimeInterface) { + $m = new \ReflectionMethod($extension, 'initRuntime'); + + $parentClass = $m->getDeclaringClass()->getName(); + if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) { + @trigger_error(sprintf('Defining the initRuntime() method in the "%s" extension is deprecated since version 1.23. Use the `needs_environment` option to get the \Twig_Environment instance in filters, functions, or tests; or explicitly implement Twig\Extension\InitRuntimeInterface if needed (not recommended).', $name), E_USER_DEPRECATED); + } + } + + $extension->initRuntime($this); + } + } + + /** + * Returns true if the given extension is registered. + * + * @param string $class The extension class name + * + * @return bool Whether the extension is registered or not + */ + public function hasExtension($class) + { + $class = ltrim($class, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new \ReflectionClass($class); + $class = $class->name; + } + + if (isset($this->extensions[$class])) { + if ($class !== \get_class($this->extensions[$class])) { + @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED); + } + + return true; + } + + return isset($this->extensionsByClass[$class]); + } + + /** + * Adds a runtime loader. + */ + public function addRuntimeLoader(RuntimeLoaderInterface $loader) + { + $this->runtimeLoaders[] = $loader; + } + + /** + * Gets an extension by class name. + * + * @param string $class The extension class name + * + * @return ExtensionInterface + */ + public function getExtension($class) + { + $class = ltrim($class, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new \ReflectionClass($class); + $class = $class->name; + } + + if (isset($this->extensions[$class])) { + if ($class !== \get_class($this->extensions[$class])) { + @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED); + } + + return $this->extensions[$class]; + } + + if (!isset($this->extensionsByClass[$class])) { + throw new RuntimeError(sprintf('The "%s" extension is not enabled.', $class)); + } + + return $this->extensionsByClass[$class]; + } + + /** + * Returns the runtime implementation of a Twig element (filter/function/test). + * + * @param string $class A runtime class name + * + * @return object The runtime implementation + * + * @throws RuntimeError When the template cannot be found + */ + public function getRuntime($class) + { + if (isset($this->runtimes[$class])) { + return $this->runtimes[$class]; + } + + foreach ($this->runtimeLoaders as $loader) { + if (null !== $runtime = $loader->load($class)) { + return $this->runtimes[$class] = $runtime; + } + } + + throw new RuntimeError(sprintf('Unable to load the "%s" runtime.', $class)); + } + + public function addExtension(ExtensionInterface $extension) + { + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to register extension "%s" as extensions have already been initialized.', $extension->getName())); + } + + $class = \get_class($extension); + if ($class !== $extension->getName()) { + if (isset($this->extensions[$extension->getName()])) { + unset($this->extensions[$extension->getName()], $this->extensionsByClass[$class]); + @trigger_error(sprintf('The possibility to register the same extension twice ("%s") is deprecated since version 1.23 and will be removed in Twig 2.0. Use proper PHP inheritance instead.', $extension->getName()), E_USER_DEPRECATED); + } + } + + $this->lastModifiedExtension = 0; + $this->extensionsByClass[$class] = $extension; + $this->extensions[$extension->getName()] = $extension; + $this->updateOptionsHash(); + } + + /** + * Removes an extension by name. + * + * This method is deprecated and you should not use it. + * + * @param string $name The extension name + * + * @deprecated since 1.12 (to be removed in 2.0) + */ + public function removeExtension($name) + { + @trigger_error(sprintf('The %s method is deprecated since version 1.12 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to remove extension "%s" as extensions have already been initialized.', $name)); + } + + $class = ltrim($name, '\\'); + if (!isset($this->extensionsByClass[$class]) && class_exists($class, false)) { + // For BC/FC with namespaced aliases + $class = new \ReflectionClass($class); + $class = $class->name; + } + + if (isset($this->extensions[$class])) { + if ($class !== \get_class($this->extensions[$class])) { + @trigger_error(sprintf('Referencing the "%s" extension by its name (defined by getName()) is deprecated since 1.26 and will be removed in Twig 2.0. Use the Fully Qualified Extension Class Name instead.', $class), E_USER_DEPRECATED); + } + + unset($this->extensions[$class]); + } + + unset($this->extensions[$class]); + $this->updateOptionsHash(); + } + + /** + * Registers an array of extensions. + * + * @param array $extensions An array of extensions + */ + public function setExtensions(array $extensions) + { + foreach ($extensions as $extension) { + $this->addExtension($extension); + } + } + + /** + * Returns all registered extensions. + * + * @return ExtensionInterface[] An array of extensions (keys are for internal usage only and should not be relied on) + */ + public function getExtensions() + { + return $this->extensions; + } + + public function addTokenParser(TokenParserInterface $parser) + { + if ($this->extensionInitialized) { + throw new \LogicException('Unable to add a token parser as extensions have already been initialized.'); + } + + $this->staging->addTokenParser($parser); + } + + /** + * Gets the registered Token Parsers. + * + * @return \Twig_TokenParserBrokerInterface + * + * @internal + */ + public function getTokenParsers() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->parsers; + } + + /** + * Gets registered tags. + * + * Be warned that this method cannot return tags defined by \Twig_TokenParserBrokerInterface classes. + * + * @return TokenParserInterface[] + * + * @internal + */ + public function getTags() + { + $tags = []; + foreach ($this->getTokenParsers()->getParsers() as $parser) { + if ($parser instanceof TokenParserInterface) { + $tags[$parser->getTag()] = $parser; + } + } + + return $tags; + } + + public function addNodeVisitor(NodeVisitorInterface $visitor) + { + if ($this->extensionInitialized) { + throw new \LogicException('Unable to add a node visitor as extensions have already been initialized.'); + } + + $this->staging->addNodeVisitor($visitor); + } + + /** + * Gets the registered Node Visitors. + * + * @return NodeVisitorInterface[] + * + * @internal + */ + public function getNodeVisitors() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->visitors; + } + + /** + * Registers a Filter. + * + * @param string|TwigFilter $name The filter name or a \Twig_SimpleFilter instance + * @param \Twig_FilterInterface|TwigFilter $filter + */ + public function addFilter($name, $filter = null) + { + if (!$name instanceof TwigFilter && !($filter instanceof TwigFilter || $filter instanceof \Twig_FilterInterface)) { + throw new \LogicException('A filter must be an instance of \Twig_FilterInterface or \Twig_SimpleFilter.'); + } + + if ($name instanceof TwigFilter) { + $filter = $name; + $name = $filter->getName(); + } else { + @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFilter" instead when defining filter "%s".', __METHOD__, $name), E_USER_DEPRECATED); + } + + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to add filter "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addFilter($name, $filter); + } + + /** + * Get a filter by name. + * + * Subclasses may override this method and load filters differently; + * so no list of filters is available. + * + * @param string $name The filter name + * + * @return \Twig_Filter|false + * + * @internal + */ + public function getFilter($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->filters[$name])) { + return $this->filters[$name]; + } + + foreach ($this->filters as $pattern => $filter) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $filter->setArguments($matches); + + return $filter; + } + } + } + + foreach ($this->filterCallbacks as $callback) { + if (false !== $filter = \call_user_func($callback, $name)) { + return $filter; + } + } + + return false; + } + + public function registerUndefinedFilterCallback($callable) + { + $this->filterCallbacks[] = $callable; + } + + /** + * Gets the registered Filters. + * + * Be warned that this method cannot return filters defined with registerUndefinedFilterCallback. + * + * @return \Twig_FilterInterface[] + * + * @see registerUndefinedFilterCallback + * + * @internal + */ + public function getFilters() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->filters; + } + + /** + * Registers a Test. + * + * @param string|TwigTest $name The test name or a \Twig_SimpleTest instance + * @param \Twig_TestInterface|TwigTest $test A \Twig_TestInterface instance or a \Twig_SimpleTest instance + */ + public function addTest($name, $test = null) + { + if (!$name instanceof TwigTest && !($test instanceof TwigTest || $test instanceof \Twig_TestInterface)) { + throw new \LogicException('A test must be an instance of \Twig_TestInterface or \Twig_SimpleTest.'); + } + + if ($name instanceof TwigTest) { + $test = $name; + $name = $test->getName(); + } else { + @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleTest" instead when defining test "%s".', __METHOD__, $name), E_USER_DEPRECATED); + } + + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to add test "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addTest($name, $test); + } + + /** + * Gets the registered Tests. + * + * @return \Twig_TestInterface[] + * + * @internal + */ + public function getTests() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->tests; + } + + /** + * Gets a test by name. + * + * @param string $name The test name + * + * @return \Twig_Test|false + * + * @internal + */ + public function getTest($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->tests[$name])) { + return $this->tests[$name]; + } + + foreach ($this->tests as $pattern => $test) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $test->setArguments($matches); + + return $test; + } + } + } + + return false; + } + + /** + * Registers a Function. + * + * @param string|TwigFunction $name The function name or a \Twig_SimpleFunction instance + * @param \Twig_FunctionInterface|TwigFunction $function + */ + public function addFunction($name, $function = null) + { + if (!$name instanceof TwigFunction && !($function instanceof TwigFunction || $function instanceof \Twig_FunctionInterface)) { + throw new \LogicException('A function must be an instance of \Twig_FunctionInterface or \Twig_SimpleFunction.'); + } + + if ($name instanceof TwigFunction) { + $function = $name; + $name = $function->getName(); + } else { + @trigger_error(sprintf('Passing a name as a first argument to the %s method is deprecated since version 1.21. Pass an instance of "Twig_SimpleFunction" instead when defining function "%s".', __METHOD__, $name), E_USER_DEPRECATED); + } + + if ($this->extensionInitialized) { + throw new \LogicException(sprintf('Unable to add function "%s" as extensions have already been initialized.', $name)); + } + + $this->staging->addFunction($name, $function); + } + + /** + * Get a function by name. + * + * Subclasses may override this method and load functions differently; + * so no list of functions is available. + * + * @param string $name function name + * + * @return \Twig_Function|false + * + * @internal + */ + public function getFunction($name) + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + if (isset($this->functions[$name])) { + return $this->functions[$name]; + } + + foreach ($this->functions as $pattern => $function) { + $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count); + + if ($count) { + if (preg_match('#^'.$pattern.'$#', $name, $matches)) { + array_shift($matches); + $function->setArguments($matches); + + return $function; + } + } + } + + foreach ($this->functionCallbacks as $callback) { + if (false !== $function = \call_user_func($callback, $name)) { + return $function; + } + } + + return false; + } + + public function registerUndefinedFunctionCallback($callable) + { + $this->functionCallbacks[] = $callable; + } + + /** + * Gets registered functions. + * + * Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback. + * + * @return \Twig_FunctionInterface[] + * + * @see registerUndefinedFunctionCallback + * + * @internal + */ + public function getFunctions() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->functions; + } + + /** + * Registers a Global. + * + * New globals can be added before compiling or rendering a template; + * but after, you can only update existing globals. + * + * @param string $name The global name + * @param mixed $value The global value + */ + public function addGlobal($name, $value) + { + if ($this->extensionInitialized || $this->runtimeInitialized) { + if (null === $this->globals) { + $this->globals = $this->initGlobals(); + } + + if (!\array_key_exists($name, $this->globals)) { + // The deprecation notice must be turned into the following exception in Twig 2.0 + @trigger_error(sprintf('Registering global variable "%s" at runtime or when the extensions have already been initialized is deprecated since version 1.21.', $name), E_USER_DEPRECATED); + //throw new \LogicException(sprintf('Unable to add global "%s" as the runtime or the extensions have already been initialized.', $name)); + } + } + + if ($this->extensionInitialized || $this->runtimeInitialized) { + // update the value + $this->globals[$name] = $value; + } else { + $this->staging->addGlobal($name, $value); + } + } + + /** + * Gets the registered Globals. + * + * @return array An array of globals + * + * @internal + */ + public function getGlobals() + { + if (!$this->runtimeInitialized && !$this->extensionInitialized) { + return $this->initGlobals(); + } + + if (null === $this->globals) { + $this->globals = $this->initGlobals(); + } + + return $this->globals; + } + + /** + * Merges a context with the defined globals. + * + * @param array $context An array representing the context + * + * @return array The context merged with the globals + */ + public function mergeGlobals(array $context) + { + // we don't use array_merge as the context being generally + // bigger than globals, this code is faster. + foreach ($this->getGlobals() as $key => $value) { + if (!\array_key_exists($key, $context)) { + $context[$key] = $value; + } + } + + return $context; + } + + /** + * Gets the registered unary Operators. + * + * @return array An array of unary operators + * + * @internal + */ + public function getUnaryOperators() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->unaryOperators; + } + + /** + * Gets the registered binary Operators. + * + * @return array An array of binary operators + * + * @internal + */ + public function getBinaryOperators() + { + if (!$this->extensionInitialized) { + $this->initExtensions(); + } + + return $this->binaryOperators; + } + + /** + * @deprecated since 1.23 (to be removed in 2.0) + */ + public function computeAlternatives($name, $items) + { + @trigger_error(sprintf('The %s method is deprecated since version 1.23 and will be removed in Twig 2.0.', __METHOD__), E_USER_DEPRECATED); + + return SyntaxError::computeAlternatives($name, $items); + } + + /** + * @internal + */ + protected function initGlobals() + { + $globals = []; + foreach ($this->extensions as $name => $extension) { + if (!$extension instanceof GlobalsInterface) { + $m = new \ReflectionMethod($extension, 'getGlobals'); + + $parentClass = $m->getDeclaringClass()->getName(); + if ('Twig_Extension' !== $parentClass && 'Twig\Extension\AbstractExtension' !== $parentClass) { + @trigger_error(sprintf('Defining the getGlobals() method in the "%s" extension without explicitly implementing Twig\Extension\GlobalsInterface is deprecated since version 1.23.', $name), E_USER_DEPRECATED); + } + } + + $extGlob = $extension->getGlobals(); + if (!\is_array($extGlob)) { + throw new \UnexpectedValueException(sprintf('"%s::getGlobals()" must return an array of globals.', \get_class($extension))); + } + + $globals[] = $extGlob; + } + + $globals[] = $this->staging->getGlobals(); + + return \call_user_func_array('array_merge', $globals); + } + + /** + * @internal + */ + protected function initExtensions() + { + if ($this->extensionInitialized) { + return; + } + + $this->parsers = new \Twig_TokenParserBroker([], [], false); + $this->filters = []; + $this->functions = []; + $this->tests = []; + $this->visitors = []; + $this->unaryOperators = []; + $this->binaryOperators = []; + + foreach ($this->extensions as $extension) { + $this->initExtension($extension); + } + $this->initExtension($this->staging); + // Done at the end only, so that an exception during initialization does not mark the environment as initialized when catching the exception + $this->extensionInitialized = true; + } + + /** + * @internal + */ + protected function initExtension(ExtensionInterface $extension) + { + // filters + foreach ($extension->getFilters() as $name => $filter) { + if ($filter instanceof TwigFilter) { + $name = $filter->getName(); + } else { + @trigger_error(sprintf('Using an instance of "%s" for filter "%s" is deprecated since version 1.21. Use \Twig_SimpleFilter instead.', \get_class($filter), $name), E_USER_DEPRECATED); + } + + $this->filters[$name] = $filter; + } + + // functions + foreach ($extension->getFunctions() as $name => $function) { + if ($function instanceof TwigFunction) { + $name = $function->getName(); + } else { + @trigger_error(sprintf('Using an instance of "%s" for function "%s" is deprecated since version 1.21. Use \Twig_SimpleFunction instead.', \get_class($function), $name), E_USER_DEPRECATED); + } + + $this->functions[$name] = $function; + } + + // tests + foreach ($extension->getTests() as $name => $test) { + if ($test instanceof TwigTest) { + $name = $test->getName(); + } else { + @trigger_error(sprintf('Using an instance of "%s" for test "%s" is deprecated since version 1.21. Use \Twig_SimpleTest instead.', \get_class($test), $name), E_USER_DEPRECATED); + } + + $this->tests[$name] = $test; + } + + // token parsers + foreach ($extension->getTokenParsers() as $parser) { + if ($parser instanceof TokenParserInterface) { + $this->parsers->addTokenParser($parser); + } elseif ($parser instanceof \Twig_TokenParserBrokerInterface) { + @trigger_error('Registering a \Twig_TokenParserBrokerInterface instance is deprecated since version 1.21.', E_USER_DEPRECATED); + + $this->parsers->addTokenParserBroker($parser); + } else { + throw new \LogicException('getTokenParsers() must return an array of \Twig_TokenParserInterface or \Twig_TokenParserBrokerInterface instances.'); + } + } + + // node visitors + foreach ($extension->getNodeVisitors() as $visitor) { + $this->visitors[] = $visitor; + } + + // operators + if ($operators = $extension->getOperators()) { + if (!\is_array($operators)) { + throw new \InvalidArgumentException(sprintf('"%s::getOperators()" must return an array with operators, got "%s".', \get_class($extension), \is_object($operators) ? \get_class($operators) : \gettype($operators).(\is_resource($operators) ? '' : '#'.$operators))); + } + + if (2 !== \count($operators)) { + throw new \InvalidArgumentException(sprintf('"%s::getOperators()" must return an array of 2 elements, got %d.', \get_class($extension), \count($operators))); + } + + $this->unaryOperators = array_merge($this->unaryOperators, $operators[0]); + $this->binaryOperators = array_merge($this->binaryOperators, $operators[1]); + } + } + + /** + * @deprecated since 1.22 (to be removed in 2.0) + */ + protected function writeCacheFile($file, $content) + { + $this->cache->write($file, $content); + } + + private function updateOptionsHash() + { + $hashParts = array_merge( + array_keys($this->extensions), + [ + (int) \function_exists('twig_template_get_attributes'), + PHP_MAJOR_VERSION, + PHP_MINOR_VERSION, + self::VERSION, + (int) $this->debug, + $this->baseTemplateClass, + (int) $this->strictVariables, + ] + ); + $this->optionsHash = implode(':', $hashParts); + } +} + +class_alias('Twig\Environment', 'Twig_Environment'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Error/Error.php b/phpMyAdmin/vendor/twig/twig/src/Error/Error.php new file mode 100755 index 0000000..2aa70f1 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Error/Error.php @@ -0,0 +1,325 @@ + + */ +class Error extends \Exception +{ + protected $lineno; + // to be renamed to name in 2.0 + protected $filename; + protected $rawMessage; + + private $sourcePath; + private $sourceCode; + + /** + * Constructor. + * + * Set the line number to -1 to enable its automatic guessing. + * Set the name to null to enable its automatic guessing. + * + * @param string $message The error message + * @param int $lineno The template line where the error occurred + * @param Source|string|null $source The source context where the error occurred + * @param \Exception $previous The previous exception + */ + public function __construct($message, $lineno = -1, $source = null, \Exception $previous = null) + { + if (null === $source) { + $name = null; + } elseif (!$source instanceof Source) { + // for compat with the Twig C ext., passing the template name as string is accepted + $name = $source; + } else { + $name = $source->getName(); + $this->sourceCode = $source->getCode(); + $this->sourcePath = $source->getPath(); + } + parent::__construct('', 0, $previous); + + $this->lineno = $lineno; + $this->filename = $name; + $this->rawMessage = $message; + $this->updateRepr(); + } + + /** + * Gets the raw message. + * + * @return string The raw message + */ + public function getRawMessage() + { + return $this->rawMessage; + } + + /** + * Gets the logical name where the error occurred. + * + * @return string The name + * + * @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead. + */ + public function getTemplateFile() + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->filename; + } + + /** + * Sets the logical name where the error occurred. + * + * @param string $name The name + * + * @deprecated since 1.27 (to be removed in 2.0). Use setSourceContext() instead. + */ + public function setTemplateFile($name) + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + $this->filename = $name; + + $this->updateRepr(); + } + + /** + * Gets the logical name where the error occurred. + * + * @return string The name + * + * @deprecated since 1.29 (to be removed in 2.0). Use getSourceContext() instead. + */ + public function getTemplateName() + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->filename; + } + + /** + * Sets the logical name where the error occurred. + * + * @param string $name The name + * + * @deprecated since 1.29 (to be removed in 2.0). Use setSourceContext() instead. + */ + public function setTemplateName($name) + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.29 and will be removed in 2.0. Use setSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + $this->filename = $name; + $this->sourceCode = $this->sourcePath = null; + + $this->updateRepr(); + } + + /** + * Gets the template line where the error occurred. + * + * @return int The template line + */ + public function getTemplateLine() + { + return $this->lineno; + } + + /** + * Sets the template line where the error occurred. + * + * @param int $lineno The template line + */ + public function setTemplateLine($lineno) + { + $this->lineno = $lineno; + + $this->updateRepr(); + } + + /** + * Gets the source context of the Twig template where the error occurred. + * + * @return Source|null + */ + public function getSourceContext() + { + return $this->filename ? new Source($this->sourceCode, $this->filename, $this->sourcePath) : null; + } + + /** + * Sets the source context of the Twig template where the error occurred. + */ + public function setSourceContext(Source $source = null) + { + if (null === $source) { + $this->sourceCode = $this->filename = $this->sourcePath = null; + } else { + $this->sourceCode = $source->getCode(); + $this->filename = $source->getName(); + $this->sourcePath = $source->getPath(); + } + + $this->updateRepr(); + } + + public function guess() + { + $this->guessTemplateInfo(); + $this->updateRepr(); + } + + public function appendMessage($rawMessage) + { + $this->rawMessage .= $rawMessage; + $this->updateRepr(); + } + + /** + * @internal + */ + protected function updateRepr() + { + $this->message = $this->rawMessage; + + if ($this->sourcePath && $this->lineno > 0) { + $this->file = $this->sourcePath; + $this->line = $this->lineno; + + return; + } + + $dot = false; + if ('.' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $dot = true; + } + + $questionMark = false; + if ('?' === substr($this->message, -1)) { + $this->message = substr($this->message, 0, -1); + $questionMark = true; + } + + if ($this->filename) { + if (\is_string($this->filename) || (\is_object($this->filename) && method_exists($this->filename, '__toString'))) { + $name = sprintf('"%s"', $this->filename); + } else { + $name = json_encode($this->filename); + } + $this->message .= sprintf(' in %s', $name); + } + + if ($this->lineno && $this->lineno >= 0) { + $this->message .= sprintf(' at line %d', $this->lineno); + } + + if ($dot) { + $this->message .= '.'; + } + + if ($questionMark) { + $this->message .= '?'; + } + } + + /** + * @internal + */ + protected function guessTemplateInfo() + { + $template = null; + $templateClass = null; + + $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT); + foreach ($backtrace as $trace) { + if (isset($trace['object']) && $trace['object'] instanceof Template && 'Twig_Template' !== \get_class($trace['object'])) { + $currentClass = \get_class($trace['object']); + $isEmbedContainer = 0 === strpos($templateClass, $currentClass); + if (null === $this->filename || ($this->filename == $trace['object']->getTemplateName() && !$isEmbedContainer)) { + $template = $trace['object']; + $templateClass = \get_class($trace['object']); + } + } + } + + // update template name + if (null !== $template && null === $this->filename) { + $this->filename = $template->getTemplateName(); + } + + // update template path if any + if (null !== $template && null === $this->sourcePath) { + $src = $template->getSourceContext(); + $this->sourceCode = $src->getCode(); + $this->sourcePath = $src->getPath(); + } + + if (null === $template || $this->lineno > -1) { + return; + } + + $r = new \ReflectionObject($template); + $file = $r->getFileName(); + + $exceptions = [$e = $this]; + while ($e instanceof self && $e = $e->getPrevious()) { + $exceptions[] = $e; + } + + while ($e = array_pop($exceptions)) { + $traces = $e->getTrace(); + array_unshift($traces, ['file' => $e->getFile(), 'line' => $e->getLine()]); + + while ($trace = array_shift($traces)) { + if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) { + continue; + } + + foreach ($template->getDebugInfo() as $codeLine => $templateLine) { + if ($codeLine <= $trace['line']) { + // update template line + $this->lineno = $templateLine; + + return; + } + } + } + } + } +} + +class_alias('Twig\Error\Error', 'Twig_Error'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Error/LoaderError.php b/phpMyAdmin/vendor/twig/twig/src/Error/LoaderError.php new file mode 100755 index 0000000..dc5a9f1 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Error/LoaderError.php @@ -0,0 +1,23 @@ + + */ +class LoaderError extends Error +{ +} + +class_alias('Twig\Error\LoaderError', 'Twig_Error_Loader'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Error/RuntimeError.php b/phpMyAdmin/vendor/twig/twig/src/Error/RuntimeError.php new file mode 100755 index 0000000..9b3f36e --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Error/RuntimeError.php @@ -0,0 +1,24 @@ + + */ +class RuntimeError extends Error +{ +} + +class_alias('Twig\Error\RuntimeError', 'Twig_Error_Runtime'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Error/SyntaxError.php b/phpMyAdmin/vendor/twig/twig/src/Error/SyntaxError.php new file mode 100755 index 0000000..480e660 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Error/SyntaxError.php @@ -0,0 +1,57 @@ + + */ +class SyntaxError extends Error +{ + /** + * Tweaks the error message to include suggestions. + * + * @param string $name The original name of the item that does not exist + * @param array $items An array of possible items + */ + public function addSuggestions($name, array $items) + { + if (!$alternatives = self::computeAlternatives($name, $items)) { + return; + } + + $this->appendMessage(sprintf(' Did you mean "%s"?', implode('", "', $alternatives))); + } + + /** + * @internal + * + * To be merged with the addSuggestions() method in 2.0. + */ + public static function computeAlternatives($name, $items) + { + $alternatives = []; + foreach ($items as $item) { + $lev = levenshtein($name, $item); + if ($lev <= \strlen($name) / 3 || false !== strpos($item, $name)) { + $alternatives[$item] = $lev; + } + } + asort($alternatives); + + return array_keys($alternatives); + } +} + +class_alias('Twig\Error\SyntaxError', 'Twig_Error_Syntax'); diff --git a/phpMyAdmin/vendor/twig/twig/src/ExpressionParser.php b/phpMyAdmin/vendor/twig/twig/src/ExpressionParser.php new file mode 100755 index 0000000..a3ff725 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/ExpressionParser.php @@ -0,0 +1,834 @@ + + * + * @internal + */ +class ExpressionParser +{ + const OPERATOR_LEFT = 1; + const OPERATOR_RIGHT = 2; + + protected $parser; + protected $unaryOperators; + protected $binaryOperators; + + private $env; + + public function __construct(Parser $parser, $env = null) + { + $this->parser = $parser; + + if ($env instanceof Environment) { + $this->env = $env; + $this->unaryOperators = $env->getUnaryOperators(); + $this->binaryOperators = $env->getBinaryOperators(); + } else { + @trigger_error('Passing the operators as constructor arguments to '.__METHOD__.' is deprecated since version 1.27. Pass the environment instead.', E_USER_DEPRECATED); + + $this->env = $parser->getEnvironment(); + $this->unaryOperators = func_get_arg(1); + $this->binaryOperators = func_get_arg(2); + } + } + + public function parseExpression($precedence = 0, $allowArrow = false) + { + if ($allowArrow && $arrow = $this->parseArrow()) { + return $arrow; + } + + $expr = $this->getPrimary(); + $token = $this->parser->getCurrentToken(); + while ($this->isBinary($token) && $this->binaryOperators[$token->getValue()]['precedence'] >= $precedence) { + $op = $this->binaryOperators[$token->getValue()]; + $this->parser->getStream()->next(); + + if ('is not' === $token->getValue()) { + $expr = $this->parseNotTestExpression($expr); + } elseif ('is' === $token->getValue()) { + $expr = $this->parseTestExpression($expr); + } elseif (isset($op['callable'])) { + $expr = \call_user_func($op['callable'], $this->parser, $expr); + } else { + $expr1 = $this->parseExpression(self::OPERATOR_LEFT === $op['associativity'] ? $op['precedence'] + 1 : $op['precedence']); + $class = $op['class']; + $expr = new $class($expr, $expr1, $token->getLine()); + } + + $token = $this->parser->getCurrentToken(); + } + + if (0 === $precedence) { + return $this->parseConditionalExpression($expr); + } + + return $expr; + } + + /** + * @return ArrowFunctionExpression|null + */ + private function parseArrow() + { + $stream = $this->parser->getStream(); + + // short array syntax (one argument, no parentheses)? + if ($stream->look(1)->test(Token::ARROW_TYPE)) { + $line = $stream->getCurrent()->getLine(); + $token = $stream->expect(Token::NAME_TYPE); + $names = [new AssignNameExpression($token->getValue(), $token->getLine())]; + $stream->expect(Token::ARROW_TYPE); + + return new ArrowFunctionExpression($this->parseExpression(0), new Node($names), $line); + } + + // first, determine if we are parsing an arrow function by finding => (long form) + $i = 0; + if (!$stream->look($i)->test(Token::PUNCTUATION_TYPE, '(')) { + return null; + } + ++$i; + while (true) { + // variable name + ++$i; + if (!$stream->look($i)->test(Token::PUNCTUATION_TYPE, ',')) { + break; + } + ++$i; + } + if (!$stream->look($i)->test(Token::PUNCTUATION_TYPE, ')')) { + return null; + } + ++$i; + if (!$stream->look($i)->test(Token::ARROW_TYPE)) { + return null; + } + + // yes, let's parse it properly + $token = $stream->expect(Token::PUNCTUATION_TYPE, '('); + $line = $token->getLine(); + + $names = []; + while (true) { + $token = $stream->expect(Token::NAME_TYPE); + $names[] = new AssignNameExpression($token->getValue(), $token->getLine()); + + if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } + $stream->expect(Token::PUNCTUATION_TYPE, ')'); + $stream->expect(Token::ARROW_TYPE); + + return new ArrowFunctionExpression($this->parseExpression(0), new Node($names), $line); + } + + protected function getPrimary() + { + $token = $this->parser->getCurrentToken(); + + if ($this->isUnary($token)) { + $operator = $this->unaryOperators[$token->getValue()]; + $this->parser->getStream()->next(); + $expr = $this->parseExpression($operator['precedence']); + $class = $operator['class']; + + return $this->parsePostfixExpression(new $class($expr, $token->getLine())); + } elseif ($token->test(Token::PUNCTUATION_TYPE, '(')) { + $this->parser->getStream()->next(); + $expr = $this->parseExpression(); + $this->parser->getStream()->expect(Token::PUNCTUATION_TYPE, ')', 'An opened parenthesis is not properly closed'); + + return $this->parsePostfixExpression($expr); + } + + return $this->parsePrimaryExpression(); + } + + protected function parseConditionalExpression($expr) + { + while ($this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, '?')) { + if (!$this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ':')) { + $expr2 = $this->parseExpression(); + if ($this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ':')) { + $expr3 = $this->parseExpression(); + } else { + $expr3 = new ConstantExpression('', $this->parser->getCurrentToken()->getLine()); + } + } else { + $expr2 = $expr; + $expr3 = $this->parseExpression(); + } + + $expr = new ConditionalExpression($expr, $expr2, $expr3, $this->parser->getCurrentToken()->getLine()); + } + + return $expr; + } + + protected function isUnary(Token $token) + { + return $token->test(Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->getValue()]); + } + + protected function isBinary(Token $token) + { + return $token->test(Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->getValue()]); + } + + public function parsePrimaryExpression() + { + $token = $this->parser->getCurrentToken(); + switch ($token->getType()) { + case Token::NAME_TYPE: + $this->parser->getStream()->next(); + switch ($token->getValue()) { + case 'true': + case 'TRUE': + $node = new ConstantExpression(true, $token->getLine()); + break; + + case 'false': + case 'FALSE': + $node = new ConstantExpression(false, $token->getLine()); + break; + + case 'none': + case 'NONE': + case 'null': + case 'NULL': + $node = new ConstantExpression(null, $token->getLine()); + break; + + default: + if ('(' === $this->parser->getCurrentToken()->getValue()) { + $node = $this->getFunctionNode($token->getValue(), $token->getLine()); + } else { + $node = new NameExpression($token->getValue(), $token->getLine()); + } + } + break; + + case Token::NUMBER_TYPE: + $this->parser->getStream()->next(); + $node = new ConstantExpression($token->getValue(), $token->getLine()); + break; + + case Token::STRING_TYPE: + case Token::INTERPOLATION_START_TYPE: + $node = $this->parseStringExpression(); + break; + + case Token::OPERATOR_TYPE: + if (preg_match(Lexer::REGEX_NAME, $token->getValue(), $matches) && $matches[0] == $token->getValue()) { + // in this context, string operators are variable names + $this->parser->getStream()->next(); + $node = new NameExpression($token->getValue(), $token->getLine()); + break; + } elseif (isset($this->unaryOperators[$token->getValue()])) { + $class = $this->unaryOperators[$token->getValue()]['class']; + + $ref = new \ReflectionClass($class); + $negClass = 'Twig\Node\Expression\Unary\NegUnary'; + $posClass = 'Twig\Node\Expression\Unary\PosUnary'; + if (!(\in_array($ref->getName(), [$negClass, $posClass, 'Twig_Node_Expression_Unary_Neg', 'Twig_Node_Expression_Unary_Pos']) + || $ref->isSubclassOf($negClass) || $ref->isSubclassOf($posClass) + || $ref->isSubclassOf('Twig_Node_Expression_Unary_Neg') || $ref->isSubclassOf('Twig_Node_Expression_Unary_Pos')) + ) { + throw new SyntaxError(sprintf('Unexpected unary operator "%s".', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); + } + + $this->parser->getStream()->next(); + $expr = $this->parsePrimaryExpression(); + + $node = new $class($expr, $token->getLine()); + break; + } + + // no break + default: + if ($token->test(Token::PUNCTUATION_TYPE, '[')) { + $node = $this->parseArrayExpression(); + } elseif ($token->test(Token::PUNCTUATION_TYPE, '{')) { + $node = $this->parseHashExpression(); + } elseif ($token->test(Token::OPERATOR_TYPE, '=') && ('==' === $this->parser->getStream()->look(-1)->getValue() || '!=' === $this->parser->getStream()->look(-1)->getValue())) { + throw new SyntaxError(sprintf('Unexpected operator of value "%s". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead.', $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); + } else { + throw new SyntaxError(sprintf('Unexpected token "%s" of value "%s".', Token::typeToEnglish($token->getType()), $token->getValue()), $token->getLine(), $this->parser->getStream()->getSourceContext()); + } + } + + return $this->parsePostfixExpression($node); + } + + public function parseStringExpression() + { + $stream = $this->parser->getStream(); + + $nodes = []; + // a string cannot be followed by another string in a single expression + $nextCanBeString = true; + while (true) { + if ($nextCanBeString && $token = $stream->nextIf(Token::STRING_TYPE)) { + $nodes[] = new ConstantExpression($token->getValue(), $token->getLine()); + $nextCanBeString = false; + } elseif ($stream->nextIf(Token::INTERPOLATION_START_TYPE)) { + $nodes[] = $this->parseExpression(); + $stream->expect(Token::INTERPOLATION_END_TYPE); + $nextCanBeString = true; + } else { + break; + } + } + + $expr = array_shift($nodes); + foreach ($nodes as $node) { + $expr = new ConcatBinary($expr, $node, $node->getTemplateLine()); + } + + return $expr; + } + + public function parseArrayExpression() + { + $stream = $this->parser->getStream(); + $stream->expect(Token::PUNCTUATION_TYPE, '[', 'An array element was expected'); + + $node = new ArrayExpression([], $stream->getCurrent()->getLine()); + $first = true; + while (!$stream->test(Token::PUNCTUATION_TYPE, ']')) { + if (!$first) { + $stream->expect(Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma'); + + // trailing ,? + if ($stream->test(Token::PUNCTUATION_TYPE, ']')) { + break; + } + } + $first = false; + + $node->addElement($this->parseExpression()); + } + $stream->expect(Token::PUNCTUATION_TYPE, ']', 'An opened array is not properly closed'); + + return $node; + } + + public function parseHashExpression() + { + $stream = $this->parser->getStream(); + $stream->expect(Token::PUNCTUATION_TYPE, '{', 'A hash element was expected'); + + $node = new ArrayExpression([], $stream->getCurrent()->getLine()); + $first = true; + while (!$stream->test(Token::PUNCTUATION_TYPE, '}')) { + if (!$first) { + $stream->expect(Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma'); + + // trailing ,? + if ($stream->test(Token::PUNCTUATION_TYPE, '}')) { + break; + } + } + $first = false; + + // a hash key can be: + // + // * a number -- 12 + // * a string -- 'a' + // * a name, which is equivalent to a string -- a + // * an expression, which must be enclosed in parentheses -- (1 + 2) + if (($token = $stream->nextIf(Token::STRING_TYPE)) || ($token = $stream->nextIf(Token::NAME_TYPE)) || $token = $stream->nextIf(Token::NUMBER_TYPE)) { + $key = new ConstantExpression($token->getValue(), $token->getLine()); + } elseif ($stream->test(Token::PUNCTUATION_TYPE, '(')) { + $key = $this->parseExpression(); + } else { + $current = $stream->getCurrent(); + + throw new SyntaxError(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s".', Token::typeToEnglish($current->getType()), $current->getValue()), $current->getLine(), $stream->getSourceContext()); + } + + $stream->expect(Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)'); + $value = $this->parseExpression(); + + $node->addElement($value, $key); + } + $stream->expect(Token::PUNCTUATION_TYPE, '}', 'An opened hash is not properly closed'); + + return $node; + } + + public function parsePostfixExpression($node) + { + while (true) { + $token = $this->parser->getCurrentToken(); + if (Token::PUNCTUATION_TYPE == $token->getType()) { + if ('.' == $token->getValue() || '[' == $token->getValue()) { + $node = $this->parseSubscriptExpression($node); + } elseif ('|' == $token->getValue()) { + $node = $this->parseFilterExpression($node); + } else { + break; + } + } else { + break; + } + } + + return $node; + } + + public function getFunctionNode($name, $line) + { + switch ($name) { + case 'parent': + $this->parseArguments(); + if (!\count($this->parser->getBlockStack())) { + throw new SyntaxError('Calling "parent" outside a block is forbidden.', $line, $this->parser->getStream()->getSourceContext()); + } + + if (!$this->parser->getParent() && !$this->parser->hasTraits()) { + throw new SyntaxError('Calling "parent" on a template that does not extend nor "use" another template is forbidden.', $line, $this->parser->getStream()->getSourceContext()); + } + + return new ParentExpression($this->parser->peekBlockStack(), $line); + case 'block': + $args = $this->parseArguments(); + if (\count($args) < 1) { + throw new SyntaxError('The "block" function takes one argument (the block name).', $line, $this->parser->getStream()->getSourceContext()); + } + + return new BlockReferenceExpression($args->getNode(0), \count($args) > 1 ? $args->getNode(1) : null, $line); + case 'attribute': + $args = $this->parseArguments(); + if (\count($args) < 2) { + throw new SyntaxError('The "attribute" function takes at least two arguments (the variable and the attributes).', $line, $this->parser->getStream()->getSourceContext()); + } + + return new GetAttrExpression($args->getNode(0), $args->getNode(1), \count($args) > 2 ? $args->getNode(2) : null, Template::ANY_CALL, $line); + default: + if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) { + $arguments = new ArrayExpression([], $line); + foreach ($this->parseArguments() as $n) { + $arguments->addElement($n); + } + + $node = new MethodCallExpression($alias['node'], $alias['name'], $arguments, $line); + $node->setAttribute('safe', true); + + return $node; + } + + $args = $this->parseArguments(true); + $class = $this->getFunctionNodeClass($name, $line); + + return new $class($name, $args, $line); + } + } + + public function parseSubscriptExpression($node) + { + $stream = $this->parser->getStream(); + $token = $stream->next(); + $lineno = $token->getLine(); + $arguments = new ArrayExpression([], $lineno); + $type = Template::ANY_CALL; + if ('.' == $token->getValue()) { + $token = $stream->next(); + if ( + Token::NAME_TYPE == $token->getType() + || + Token::NUMBER_TYPE == $token->getType() + || + (Token::OPERATOR_TYPE == $token->getType() && preg_match(Lexer::REGEX_NAME, $token->getValue())) + ) { + $arg = new ConstantExpression($token->getValue(), $lineno); + + if ($stream->test(Token::PUNCTUATION_TYPE, '(')) { + $type = Template::METHOD_CALL; + foreach ($this->parseArguments() as $n) { + $arguments->addElement($n); + } + } + } else { + throw new SyntaxError('Expected name or number.', $lineno, $stream->getSourceContext()); + } + + if ($node instanceof NameExpression && null !== $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) { + if (!$arg instanceof ConstantExpression) { + throw new SyntaxError(sprintf('Dynamic macro names are not supported (called on "%s").', $node->getAttribute('name')), $token->getLine(), $stream->getSourceContext()); + } + + $name = $arg->getAttribute('value'); + + if ($this->parser->isReservedMacroName($name)) { + throw new SyntaxError(sprintf('"%s" cannot be called as macro as it is a reserved keyword.', $name), $token->getLine(), $stream->getSourceContext()); + } + + $node = new MethodCallExpression($node, 'get'.$name, $arguments, $lineno); + $node->setAttribute('safe', true); + + return $node; + } + } else { + $type = Template::ARRAY_CALL; + + // slice? + $slice = false; + if ($stream->test(Token::PUNCTUATION_TYPE, ':')) { + $slice = true; + $arg = new ConstantExpression(0, $token->getLine()); + } else { + $arg = $this->parseExpression(); + } + + if ($stream->nextIf(Token::PUNCTUATION_TYPE, ':')) { + $slice = true; + } + + if ($slice) { + if ($stream->test(Token::PUNCTUATION_TYPE, ']')) { + $length = new ConstantExpression(null, $token->getLine()); + } else { + $length = $this->parseExpression(); + } + + $class = $this->getFilterNodeClass('slice', $token->getLine()); + $arguments = new Node([$arg, $length]); + $filter = new $class($node, new ConstantExpression('slice', $token->getLine()), $arguments, $token->getLine()); + + $stream->expect(Token::PUNCTUATION_TYPE, ']'); + + return $filter; + } + + $stream->expect(Token::PUNCTUATION_TYPE, ']'); + } + + return new GetAttrExpression($node, $arg, $arguments, $type, $lineno); + } + + public function parseFilterExpression($node) + { + $this->parser->getStream()->next(); + + return $this->parseFilterExpressionRaw($node); + } + + public function parseFilterExpressionRaw($node, $tag = null) + { + while (true) { + $token = $this->parser->getStream()->expect(Token::NAME_TYPE); + + $name = new ConstantExpression($token->getValue(), $token->getLine()); + if (!$this->parser->getStream()->test(Token::PUNCTUATION_TYPE, '(')) { + $arguments = new Node(); + } else { + $arguments = $this->parseArguments(true, false, true); + } + + $class = $this->getFilterNodeClass($name->getAttribute('value'), $token->getLine()); + + $node = new $class($node, $name, $arguments, $token->getLine(), $tag); + + if (!$this->parser->getStream()->test(Token::PUNCTUATION_TYPE, '|')) { + break; + } + + $this->parser->getStream()->next(); + } + + return $node; + } + + /** + * Parses arguments. + * + * @param bool $namedArguments Whether to allow named arguments or not + * @param bool $definition Whether we are parsing arguments for a function definition + * + * @return Node + * + * @throws SyntaxError + */ + public function parseArguments($namedArguments = false, $definition = false, $allowArrow = false) + { + $args = []; + $stream = $this->parser->getStream(); + + $stream->expect(Token::PUNCTUATION_TYPE, '(', 'A list of arguments must begin with an opening parenthesis'); + while (!$stream->test(Token::PUNCTUATION_TYPE, ')')) { + if (!empty($args)) { + $stream->expect(Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma'); + } + + if ($definition) { + $token = $stream->expect(Token::NAME_TYPE, null, 'An argument must be a name'); + $value = new NameExpression($token->getValue(), $this->parser->getCurrentToken()->getLine()); + } else { + $value = $this->parseExpression(0, $allowArrow); + } + + $name = null; + if ($namedArguments && $token = $stream->nextIf(Token::OPERATOR_TYPE, '=')) { + if (!$value instanceof NameExpression) { + throw new SyntaxError(sprintf('A parameter name must be a string, "%s" given.', \get_class($value)), $token->getLine(), $stream->getSourceContext()); + } + $name = $value->getAttribute('name'); + + if ($definition) { + $value = $this->parsePrimaryExpression(); + + if (!$this->checkConstantExpression($value)) { + throw new SyntaxError(sprintf('A default value for an argument must be a constant (a boolean, a string, a number, or an array).'), $token->getLine(), $stream->getSourceContext()); + } + } else { + $value = $this->parseExpression(0, $allowArrow); + } + } + + if ($definition) { + if (null === $name) { + $name = $value->getAttribute('name'); + $value = new ConstantExpression(null, $this->parser->getCurrentToken()->getLine()); + } + $args[$name] = $value; + } else { + if (null === $name) { + $args[] = $value; + } else { + $args[$name] = $value; + } + } + } + $stream->expect(Token::PUNCTUATION_TYPE, ')', 'A list of arguments must be closed by a parenthesis'); + + return new Node($args); + } + + public function parseAssignmentExpression() + { + $stream = $this->parser->getStream(); + $targets = []; + while (true) { + $token = $this->parser->getCurrentToken(); + if ($stream->test(Token::OPERATOR_TYPE) && preg_match(Lexer::REGEX_NAME, $token->getValue())) { + // in this context, string operators are variable names + $this->parser->getStream()->next(); + } else { + $stream->expect(Token::NAME_TYPE, null, 'Only variables can be assigned to'); + } + $value = $token->getValue(); + if (\in_array(strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), ['true', 'false', 'none', 'null'])) { + throw new SyntaxError(sprintf('You cannot assign a value to "%s".', $value), $token->getLine(), $stream->getSourceContext()); + } + $targets[] = new AssignNameExpression($value, $token->getLine()); + + if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } + + return new Node($targets); + } + + public function parseMultitargetExpression() + { + $targets = []; + while (true) { + $targets[] = $this->parseExpression(); + if (!$this->parser->getStream()->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } + + return new Node($targets); + } + + private function parseNotTestExpression(\Twig_NodeInterface $node) + { + return new NotUnary($this->parseTestExpression($node), $this->parser->getCurrentToken()->getLine()); + } + + private function parseTestExpression(\Twig_NodeInterface $node) + { + $stream = $this->parser->getStream(); + list($name, $test) = $this->getTest($node->getTemplateLine()); + + $class = $this->getTestNodeClass($test); + $arguments = null; + if ($stream->test(Token::PUNCTUATION_TYPE, '(')) { + $arguments = $this->parseArguments(true); + } + + return new $class($node, $name, $arguments, $this->parser->getCurrentToken()->getLine()); + } + + private function getTest($line) + { + $stream = $this->parser->getStream(); + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + + if ($test = $this->env->getTest($name)) { + return [$name, $test]; + } + + if ($stream->test(Token::NAME_TYPE)) { + // try 2-words tests + $name = $name.' '.$this->parser->getCurrentToken()->getValue(); + + if ($test = $this->env->getTest($name)) { + $stream->next(); + + return [$name, $test]; + } + } + + $e = new SyntaxError(sprintf('Unknown "%s" test.', $name), $line, $stream->getSourceContext()); + $e->addSuggestions($name, array_keys($this->env->getTests())); + + throw $e; + } + + private function getTestNodeClass($test) + { + if ($test instanceof TwigTest && $test->isDeprecated()) { + $stream = $this->parser->getStream(); + $message = sprintf('Twig Test "%s" is deprecated', $test->getName()); + if (!\is_bool($test->getDeprecatedVersion())) { + $message .= sprintf(' since version %s', $test->getDeprecatedVersion()); + } + if ($test->getAlternative()) { + $message .= sprintf('. Use "%s" instead', $test->getAlternative()); + } + $src = $stream->getSourceContext(); + $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $stream->getCurrent()->getLine()); + + @trigger_error($message, E_USER_DEPRECATED); + } + + if ($test instanceof TwigTest) { + return $test->getNodeClass(); + } + + return $test instanceof \Twig_Test_Node ? $test->getClass() : 'Twig\Node\Expression\TestExpression'; + } + + protected function getFunctionNodeClass($name, $line) + { + if (false === $function = $this->env->getFunction($name)) { + $e = new SyntaxError(sprintf('Unknown "%s" function.', $name), $line, $this->parser->getStream()->getSourceContext()); + $e->addSuggestions($name, array_keys($this->env->getFunctions())); + + throw $e; + } + + if ($function instanceof TwigFunction && $function->isDeprecated()) { + $message = sprintf('Twig Function "%s" is deprecated', $function->getName()); + if (!\is_bool($function->getDeprecatedVersion())) { + $message .= sprintf(' since version %s', $function->getDeprecatedVersion()); + } + if ($function->getAlternative()) { + $message .= sprintf('. Use "%s" instead', $function->getAlternative()); + } + $src = $this->parser->getStream()->getSourceContext(); + $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line); + + @trigger_error($message, E_USER_DEPRECATED); + } + + if ($function instanceof TwigFunction) { + return $function->getNodeClass(); + } + + return $function instanceof \Twig_Function_Node ? $function->getClass() : 'Twig\Node\Expression\FunctionExpression'; + } + + protected function getFilterNodeClass($name, $line) + { + if (false === $filter = $this->env->getFilter($name)) { + $e = new SyntaxError(sprintf('Unknown "%s" filter.', $name), $line, $this->parser->getStream()->getSourceContext()); + $e->addSuggestions($name, array_keys($this->env->getFilters())); + + throw $e; + } + + if ($filter instanceof TwigFilter && $filter->isDeprecated()) { + $message = sprintf('Twig Filter "%s" is deprecated', $filter->getName()); + if (!\is_bool($filter->getDeprecatedVersion())) { + $message .= sprintf(' since version %s', $filter->getDeprecatedVersion()); + } + if ($filter->getAlternative()) { + $message .= sprintf('. Use "%s" instead', $filter->getAlternative()); + } + $src = $this->parser->getStream()->getSourceContext(); + $message .= sprintf(' in %s at line %d.', $src->getPath() ? $src->getPath() : $src->getName(), $line); + + @trigger_error($message, E_USER_DEPRECATED); + } + + if ($filter instanceof TwigFilter) { + return $filter->getNodeClass(); + } + + return $filter instanceof \Twig_Filter_Node ? $filter->getClass() : 'Twig\Node\Expression\FilterExpression'; + } + + // checks that the node only contains "constant" elements + protected function checkConstantExpression(\Twig_NodeInterface $node) + { + if (!($node instanceof ConstantExpression || $node instanceof ArrayExpression + || $node instanceof NegUnary || $node instanceof PosUnary + )) { + return false; + } + + foreach ($node as $n) { + if (!$this->checkConstantExpression($n)) { + return false; + } + } + + return true; + } +} + +class_alias('Twig\ExpressionParser', 'Twig_ExpressionParser'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/AbstractExtension.php b/phpMyAdmin/vendor/twig/twig/src/Extension/AbstractExtension.php new file mode 100755 index 0000000..fa3245b --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/AbstractExtension.php @@ -0,0 +1,72 @@ +escapers[$strategy] = $callable; + } + + /** + * Gets all defined escapers. + * + * @return array An array of escapers + */ + public function getEscapers() + { + return $this->escapers; + } + + /** + * Sets the default format to be used by the date filter. + * + * @param string $format The default date format string + * @param string $dateIntervalFormat The default date interval format string + */ + public function setDateFormat($format = null, $dateIntervalFormat = null) + { + if (null !== $format) { + $this->dateFormats[0] = $format; + } + + if (null !== $dateIntervalFormat) { + $this->dateFormats[1] = $dateIntervalFormat; + } + } + + /** + * Gets the default format to be used by the date filter. + * + * @return array The default date format string and the default date interval format string + */ + public function getDateFormat() + { + return $this->dateFormats; + } + + /** + * Sets the default timezone to be used by the date filter. + * + * @param \DateTimeZone|string $timezone The default timezone string or a \DateTimeZone object + */ + public function setTimezone($timezone) + { + $this->timezone = $timezone instanceof \DateTimeZone ? $timezone : new \DateTimeZone($timezone); + } + + /** + * Gets the default timezone to be used by the date filter. + * + * @return \DateTimeZone The default timezone currently in use + */ + public function getTimezone() + { + if (null === $this->timezone) { + $this->timezone = new \DateTimeZone(date_default_timezone_get()); + } + + return $this->timezone; + } + + /** + * Sets the default format to be used by the number_format filter. + * + * @param int $decimal the number of decimal places to use + * @param string $decimalPoint the character(s) to use for the decimal point + * @param string $thousandSep the character(s) to use for the thousands separator + */ + public function setNumberFormat($decimal, $decimalPoint, $thousandSep) + { + $this->numberFormat = [$decimal, $decimalPoint, $thousandSep]; + } + + /** + * Get the default format used by the number_format filter. + * + * @return array The arguments for number_format() + */ + public function getNumberFormat() + { + return $this->numberFormat; + } + + public function getTokenParsers() + { + return [ + new ApplyTokenParser(), + new ForTokenParser(), + new IfTokenParser(), + new ExtendsTokenParser(), + new IncludeTokenParser(), + new BlockTokenParser(), + new UseTokenParser(), + new FilterTokenParser(), + new MacroTokenParser(), + new ImportTokenParser(), + new FromTokenParser(), + new SetTokenParser(), + new SpacelessTokenParser(), + new FlushTokenParser(), + new DoTokenParser(), + new EmbedTokenParser(), + new WithTokenParser(), + new DeprecatedTokenParser(), + ]; + } + + public function getFilters() + { + $filters = [ + // formatting filters + new TwigFilter('date', 'twig_date_format_filter', ['needs_environment' => true]), + new TwigFilter('date_modify', 'twig_date_modify_filter', ['needs_environment' => true]), + new TwigFilter('format', 'sprintf'), + new TwigFilter('replace', 'twig_replace_filter'), + new TwigFilter('number_format', 'twig_number_format_filter', ['needs_environment' => true]), + new TwigFilter('abs', 'abs'), + new TwigFilter('round', 'twig_round'), + + // encoding + new TwigFilter('url_encode', 'twig_urlencode_filter'), + new TwigFilter('json_encode', 'twig_jsonencode_filter'), + new TwigFilter('convert_encoding', 'twig_convert_encoding'), + + // string filters + new TwigFilter('title', 'twig_title_string_filter', ['needs_environment' => true]), + new TwigFilter('capitalize', 'twig_capitalize_string_filter', ['needs_environment' => true]), + new TwigFilter('upper', 'strtoupper'), + new TwigFilter('lower', 'strtolower'), + new TwigFilter('striptags', 'strip_tags'), + new TwigFilter('trim', 'twig_trim_filter'), + new TwigFilter('nl2br', 'nl2br', ['pre_escape' => 'html', 'is_safe' => ['html']]), + new TwigFilter('spaceless', 'twig_spaceless', ['is_safe' => ['html']]), + + // array helpers + new TwigFilter('join', 'twig_join_filter'), + new TwigFilter('split', 'twig_split_filter', ['needs_environment' => true]), + new TwigFilter('sort', 'twig_sort_filter'), + new TwigFilter('merge', 'twig_array_merge'), + new TwigFilter('batch', 'twig_array_batch'), + new TwigFilter('filter', 'twig_array_filter'), + new TwigFilter('map', 'twig_array_map'), + new TwigFilter('reduce', 'twig_array_reduce'), + + // string/array filters + new TwigFilter('reverse', 'twig_reverse_filter', ['needs_environment' => true]), + new TwigFilter('length', 'twig_length_filter', ['needs_environment' => true]), + new TwigFilter('slice', 'twig_slice', ['needs_environment' => true]), + new TwigFilter('first', 'twig_first', ['needs_environment' => true]), + new TwigFilter('last', 'twig_last', ['needs_environment' => true]), + + // iteration and runtime + new TwigFilter('default', '_twig_default_filter', ['node_class' => '\Twig\Node\Expression\Filter\DefaultFilter']), + new TwigFilter('keys', 'twig_get_array_keys_filter'), + + // escaping + new TwigFilter('escape', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']), + new TwigFilter('e', 'twig_escape_filter', ['needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe']), + ]; + + if (\function_exists('mb_get_info')) { + $filters[] = new TwigFilter('upper', 'twig_upper_filter', ['needs_environment' => true]); + $filters[] = new TwigFilter('lower', 'twig_lower_filter', ['needs_environment' => true]); + } + + return $filters; + } + + public function getFunctions() + { + return [ + new TwigFunction('max', 'max'), + new TwigFunction('min', 'min'), + new TwigFunction('range', 'range'), + new TwigFunction('constant', 'twig_constant'), + new TwigFunction('cycle', 'twig_cycle'), + new TwigFunction('random', 'twig_random', ['needs_environment' => true]), + new TwigFunction('date', 'twig_date_converter', ['needs_environment' => true]), + new TwigFunction('include', 'twig_include', ['needs_environment' => true, 'needs_context' => true, 'is_safe' => ['all']]), + new TwigFunction('source', 'twig_source', ['needs_environment' => true, 'is_safe' => ['all']]), + ]; + } + + public function getTests() + { + return [ + new TwigTest('even', null, ['node_class' => '\Twig\Node\Expression\Test\EvenTest']), + new TwigTest('odd', null, ['node_class' => '\Twig\Node\Expression\Test\OddTest']), + new TwigTest('defined', null, ['node_class' => '\Twig\Node\Expression\Test\DefinedTest']), + new TwigTest('sameas', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest', 'deprecated' => '1.21', 'alternative' => 'same as']), + new TwigTest('same as', null, ['node_class' => '\Twig\Node\Expression\Test\SameasTest']), + new TwigTest('none', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']), + new TwigTest('null', null, ['node_class' => '\Twig\Node\Expression\Test\NullTest']), + new TwigTest('divisibleby', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest', 'deprecated' => '1.21', 'alternative' => 'divisible by']), + new TwigTest('divisible by', null, ['node_class' => '\Twig\Node\Expression\Test\DivisiblebyTest']), + new TwigTest('constant', null, ['node_class' => '\Twig\Node\Expression\Test\ConstantTest']), + new TwigTest('empty', 'twig_test_empty'), + new TwigTest('iterable', 'twig_test_iterable'), + ]; + } + + public function getOperators() + { + return [ + [ + 'not' => ['precedence' => 50, 'class' => '\Twig\Node\Expression\Unary\NotUnary'], + '-' => ['precedence' => 500, 'class' => '\Twig\Node\Expression\Unary\NegUnary'], + '+' => ['precedence' => 500, 'class' => '\Twig\Node\Expression\Unary\PosUnary'], + ], + [ + 'or' => ['precedence' => 10, 'class' => '\Twig\Node\Expression\Binary\OrBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'and' => ['precedence' => 15, 'class' => '\Twig\Node\Expression\Binary\AndBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'b-or' => ['precedence' => 16, 'class' => '\Twig\Node\Expression\Binary\BitwiseOrBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'b-xor' => ['precedence' => 17, 'class' => '\Twig\Node\Expression\Binary\BitwiseXorBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'b-and' => ['precedence' => 18, 'class' => '\Twig\Node\Expression\Binary\BitwiseAndBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '==' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\EqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '!=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '<' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '>' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '>=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\GreaterEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '<=' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\LessEqualBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'not in' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\NotInBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'in' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\InBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'matches' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\MatchesBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'starts with' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\StartsWithBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'ends with' => ['precedence' => 20, 'class' => '\Twig\Node\Expression\Binary\EndsWithBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '..' => ['precedence' => 25, 'class' => '\Twig\Node\Expression\Binary\RangeBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '+' => ['precedence' => 30, 'class' => '\Twig\Node\Expression\Binary\AddBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '-' => ['precedence' => 30, 'class' => '\Twig\Node\Expression\Binary\SubBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '~' => ['precedence' => 40, 'class' => '\Twig\Node\Expression\Binary\ConcatBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '*' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\MulBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '/' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\DivBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '//' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\FloorDivBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + '%' => ['precedence' => 60, 'class' => '\Twig\Node\Expression\Binary\ModBinary', 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'is' => ['precedence' => 100, 'associativity' => ExpressionParser::OPERATOR_LEFT], + 'is not' => ['precedence' => 100, 'associativity' => ExpressionParser::OPERATOR_LEFT], + '**' => ['precedence' => 200, 'class' => '\Twig\Node\Expression\Binary\PowerBinary', 'associativity' => ExpressionParser::OPERATOR_RIGHT], + '??' => ['precedence' => 300, 'class' => '\Twig\Node\Expression\NullCoalesceExpression', 'associativity' => ExpressionParser::OPERATOR_RIGHT], + ], + ]; + } + + public function getName() + { + return 'core'; + } +} + +class_alias('Twig\Extension\CoreExtension', 'Twig_Extension_Core'); +} + +namespace { +use Twig\Environment; +use Twig\Error\LoaderError; +use Twig\Error\RuntimeError; +use Twig\Loader\SourceContextLoaderInterface; +use Twig\Markup; +use Twig\Node\Expression\ConstantExpression; +use Twig\Node\Node; + +/** + * Cycles over a value. + * + * @param \ArrayAccess|array $values + * @param int $position The cycle position + * + * @return string The next value in the cycle + */ +function twig_cycle($values, $position) +{ + if (!\is_array($values) && !$values instanceof \ArrayAccess) { + return $values; + } + + return $values[$position % \count($values)]; +} + +/** + * Returns a random value depending on the supplied parameter type: + * - a random item from a \Traversable or array + * - a random character from a string + * - a random integer between 0 and the integer parameter. + * + * @param \Traversable|array|int|float|string $values The values to pick a random item from + * @param int|null $max Maximum value used when $values is an int + * + * @throws RuntimeError when $values is an empty array (does not apply to an empty string which is returned as is) + * + * @return mixed A random value from the given sequence + */ +function twig_random(Environment $env, $values = null, $max = null) +{ + if (null === $values) { + return null === $max ? mt_rand() : mt_rand(0, $max); + } + + if (\is_int($values) || \is_float($values)) { + if (null === $max) { + if ($values < 0) { + $max = 0; + $min = $values; + } else { + $max = $values; + $min = 0; + } + } else { + $min = $values; + $max = $max; + } + + return mt_rand($min, $max); + } + + if (\is_string($values)) { + if ('' === $values) { + return ''; + } + if (null !== $charset = $env->getCharset()) { + if ('UTF-8' !== $charset) { + $values = twig_convert_encoding($values, 'UTF-8', $charset); + } + + // unicode version of str_split() + // split at all positions, but not after the start and not before the end + $values = preg_split('/(? $value) { + $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8'); + } + } + } else { + return $values[mt_rand(0, \strlen($values) - 1)]; + } + } + + if (!twig_test_iterable($values)) { + return $values; + } + + $values = twig_to_array($values); + + if (0 === \count($values)) { + throw new RuntimeError('The random function cannot pick from an empty array.'); + } + + return $values[array_rand($values, 1)]; +} + +/** + * Converts a date to the given format. + * + * {{ post.published_at|date("m/d/Y") }} + * + * @param \DateTime|\DateTimeInterface|\DateInterval|string $date A date + * @param string|null $format The target format, null to use the default + * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged + * + * @return string The formatted date + */ +function twig_date_format_filter(Environment $env, $date, $format = null, $timezone = null) +{ + if (null === $format) { + $formats = $env->getExtension('\Twig\Extension\CoreExtension')->getDateFormat(); + $format = $date instanceof \DateInterval ? $formats[1] : $formats[0]; + } + + if ($date instanceof \DateInterval) { + return $date->format($format); + } + + return twig_date_converter($env, $date, $timezone)->format($format); +} + +/** + * Returns a new date object modified. + * + * {{ post.published_at|date_modify("-1day")|date("m/d/Y") }} + * + * @param \DateTime|string $date A date + * @param string $modifier A modifier string + * + * @return \DateTime + */ +function twig_date_modify_filter(Environment $env, $date, $modifier) +{ + $date = twig_date_converter($env, $date, false); + $resultDate = $date->modify($modifier); + + // This is a hack to ensure PHP 5.2 support and support for \DateTimeImmutable + // \DateTime::modify does not return the modified \DateTime object < 5.3.0 + // and \DateTimeImmutable does not modify $date. + return null === $resultDate ? $date : $resultDate; +} + +/** + * Converts an input to a \DateTime instance. + * + * {% if date(user.created_at) < date('+2days') %} + * {# do something #} + * {% endif %} + * + * @param \DateTime|\DateTimeInterface|string|null $date A date + * @param \DateTimeZone|string|false|null $timezone The target timezone, null to use the default, false to leave unchanged + * + * @return \DateTimeInterface + */ +function twig_date_converter(Environment $env, $date = null, $timezone = null) +{ + // determine the timezone + if (false !== $timezone) { + if (null === $timezone) { + $timezone = $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone(); + } elseif (!$timezone instanceof \DateTimeZone) { + $timezone = new \DateTimeZone($timezone); + } + } + + // immutable dates + if ($date instanceof \DateTimeImmutable) { + return false !== $timezone ? $date->setTimezone($timezone) : $date; + } + + if ($date instanceof \DateTime || $date instanceof \DateTimeInterface) { + $date = clone $date; + if (false !== $timezone) { + $date->setTimezone($timezone); + } + + return $date; + } + + if (null === $date || 'now' === $date) { + return new \DateTime($date, false !== $timezone ? $timezone : $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone()); + } + + $asString = (string) $date; + if (ctype_digit($asString) || (!empty($asString) && '-' === $asString[0] && ctype_digit(substr($asString, 1)))) { + $date = new \DateTime('@'.$date); + } else { + $date = new \DateTime($date, $env->getExtension('\Twig\Extension\CoreExtension')->getTimezone()); + } + + if (false !== $timezone) { + $date->setTimezone($timezone); + } + + return $date; +} + +/** + * Replaces strings within a string. + * + * @param string $str String to replace in + * @param array|\Traversable $from Replace values + * @param string|null $to Replace to, deprecated (@see https://secure.php.net/manual/en/function.strtr.php) + * + * @return string + */ +function twig_replace_filter($str, $from, $to = null) +{ + if (\is_string($from) && \is_string($to)) { + @trigger_error('Using "replace" with character by character replacement is deprecated since version 1.22 and will be removed in Twig 2.0', E_USER_DEPRECATED); + + return strtr($str, $from, $to); + } + + if (!twig_test_iterable($from)) { + throw new RuntimeError(sprintf('The "replace" filter expects an array or "Traversable" as replace values, got "%s".', \is_object($from) ? \get_class($from) : \gettype($from))); + } + + return strtr($str, twig_to_array($from)); +} + +/** + * Rounds a number. + * + * @param int|float $value The value to round + * @param int|float $precision The rounding precision + * @param string $method The method to use for rounding + * + * @return int|float The rounded number + */ +function twig_round($value, $precision = 0, $method = 'common') +{ + if ('common' == $method) { + return round($value, $precision); + } + + if ('ceil' != $method && 'floor' != $method) { + throw new RuntimeError('The round filter only supports the "common", "ceil", and "floor" methods.'); + } + + return $method($value * pow(10, $precision)) / pow(10, $precision); +} + +/** + * Number format filter. + * + * All of the formatting options can be left null, in that case the defaults will + * be used. Supplying any of the parameters will override the defaults set in the + * environment object. + * + * @param mixed $number A float/int/string of the number to format + * @param int $decimal the number of decimal points to display + * @param string $decimalPoint the character(s) to use for the decimal point + * @param string $thousandSep the character(s) to use for the thousands separator + * + * @return string The formatted number + */ +function twig_number_format_filter(Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null) +{ + $defaults = $env->getExtension('\Twig\Extension\CoreExtension')->getNumberFormat(); + if (null === $decimal) { + $decimal = $defaults[0]; + } + + if (null === $decimalPoint) { + $decimalPoint = $defaults[1]; + } + + if (null === $thousandSep) { + $thousandSep = $defaults[2]; + } + + return number_format((float) $number, $decimal, $decimalPoint, $thousandSep); +} + +/** + * URL encodes (RFC 3986) a string as a path segment or an array as a query string. + * + * @param string|array $url A URL or an array of query parameters + * + * @return string The URL encoded value + */ +function twig_urlencode_filter($url) +{ + if (\is_array($url)) { + if (\defined('PHP_QUERY_RFC3986')) { + return http_build_query($url, '', '&', PHP_QUERY_RFC3986); + } + + return http_build_query($url, '', '&'); + } + + return rawurlencode($url); +} + +/** + * JSON encodes a variable. + * + * @param mixed $value the value to encode + * @param int $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT + * + * @return mixed The JSON encoded value + */ +function twig_jsonencode_filter($value, $options = 0) +{ + if ($value instanceof Markup) { + $value = (string) $value; + } elseif (\is_array($value)) { + array_walk_recursive($value, '_twig_markup2string'); + } + + return json_encode($value, $options); +} + +function _twig_markup2string(&$value) +{ + if ($value instanceof Markup) { + $value = (string) $value; + } +} + +/** + * Merges an array with another one. + * + * {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %} + * + * {% set items = items|merge({ 'peugeot': 'car' }) %} + * + * {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #} + * + * @param array|\Traversable $arr1 An array + * @param array|\Traversable $arr2 An array + * + * @return array The merged array + */ +function twig_array_merge($arr1, $arr2) +{ + if (!twig_test_iterable($arr1)) { + throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as first argument.', \gettype($arr1))); + } + + if (!twig_test_iterable($arr2)) { + throw new RuntimeError(sprintf('The merge filter only works with arrays or "Traversable", got "%s" as second argument.', \gettype($arr2))); + } + + return array_merge(twig_to_array($arr1), twig_to_array($arr2)); +} + +/** + * Slices a variable. + * + * @param mixed $item A variable + * @param int $start Start of the slice + * @param int $length Size of the slice + * @param bool $preserveKeys Whether to preserve key or not (when the input is an array) + * + * @return mixed The sliced variable + */ +function twig_slice(Environment $env, $item, $start, $length = null, $preserveKeys = false) +{ + if ($item instanceof \Traversable) { + while ($item instanceof \IteratorAggregate) { + $item = $item->getIterator(); + } + + if ($start >= 0 && $length >= 0 && $item instanceof \Iterator) { + try { + return iterator_to_array(new \LimitIterator($item, $start, null === $length ? -1 : $length), $preserveKeys); + } catch (\OutOfBoundsException $e) { + return []; + } + } + + $item = iterator_to_array($item, $preserveKeys); + } + + if (\is_array($item)) { + return \array_slice($item, $start, $length, $preserveKeys); + } + + $item = (string) $item; + + if (\function_exists('mb_get_info') && null !== $charset = $env->getCharset()) { + return (string) mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset); + } + + return (string) (null === $length ? substr($item, $start) : substr($item, $start, $length)); +} + +/** + * Returns the first element of the item. + * + * @param mixed $item A variable + * + * @return mixed The first element of the item + */ +function twig_first(Environment $env, $item) +{ + $elements = twig_slice($env, $item, 0, 1, false); + + return \is_string($elements) ? $elements : current($elements); +} + +/** + * Returns the last element of the item. + * + * @param mixed $item A variable + * + * @return mixed The last element of the item + */ +function twig_last(Environment $env, $item) +{ + $elements = twig_slice($env, $item, -1, 1, false); + + return \is_string($elements) ? $elements : current($elements); +} + +/** + * Joins the values to a string. + * + * The separators between elements are empty strings per default, you can define them with the optional parameters. + * + * {{ [1, 2, 3]|join(', ', ' and ') }} + * {# returns 1, 2 and 3 #} + * + * {{ [1, 2, 3]|join('|') }} + * {# returns 1|2|3 #} + * + * {{ [1, 2, 3]|join }} + * {# returns 123 #} + * + * @param array $value An array + * @param string $glue The separator + * @param string|null $and The separator for the last pair + * + * @return string The concatenated string + */ +function twig_join_filter($value, $glue = '', $and = null) +{ + if (!twig_test_iterable($value)) { + $value = (array) $value; + } + + $value = twig_to_array($value, false); + + if (0 === \count($value)) { + return ''; + } + + if (null === $and || $and === $glue) { + return implode($glue, $value); + } + + if (1 === \count($value)) { + return $value[0]; + } + + return implode($glue, \array_slice($value, 0, -1)).$and.$value[\count($value) - 1]; +} + +/** + * Splits the string into an array. + * + * {{ "one,two,three"|split(',') }} + * {# returns [one, two, three] #} + * + * {{ "one,two,three,four,five"|split(',', 3) }} + * {# returns [one, two, "three,four,five"] #} + * + * {{ "123"|split('') }} + * {# returns [1, 2, 3] #} + * + * {{ "aabbcc"|split('', 2) }} + * {# returns [aa, bb, cc] #} + * + * @param string $value A string + * @param string $delimiter The delimiter + * @param int $limit The limit + * + * @return array The split string as an array + */ +function twig_split_filter(Environment $env, $value, $delimiter, $limit = null) +{ + if (\strlen($delimiter) > 0) { + return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit); + } + + if (!\function_exists('mb_get_info') || null === $charset = $env->getCharset()) { + return str_split($value, null === $limit ? 1 : $limit); + } + + if ($limit <= 1) { + return preg_split('/(?getIterator(); + } + + if ($array instanceof \Iterator) { + $keys = []; + $array->rewind(); + while ($array->valid()) { + $keys[] = $array->key(); + $array->next(); + } + + return $keys; + } + + $keys = []; + foreach ($array as $key => $item) { + $keys[] = $key; + } + + return $keys; + } + + if (!\is_array($array)) { + return []; + } + + return array_keys($array); +} + +/** + * Reverses a variable. + * + * @param array|\Traversable|string $item An array, a \Traversable instance, or a string + * @param bool $preserveKeys Whether to preserve key or not + * + * @return mixed The reversed input + */ +function twig_reverse_filter(Environment $env, $item, $preserveKeys = false) +{ + if ($item instanceof \Traversable) { + return array_reverse(iterator_to_array($item), $preserveKeys); + } + + if (\is_array($item)) { + return array_reverse($item, $preserveKeys); + } + + if (null !== $charset = $env->getCharset()) { + $string = (string) $item; + + if ('UTF-8' !== $charset) { + $item = twig_convert_encoding($string, 'UTF-8', $charset); + } + + preg_match_all('/./us', $item, $matches); + + $string = implode('', array_reverse($matches[0])); + + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + } + + return strrev((string) $item); +} + +/** + * Sorts an array. + * + * @param array|\Traversable $array + * + * @return array + */ +function twig_sort_filter($array) +{ + if ($array instanceof \Traversable) { + $array = iterator_to_array($array); + } elseif (!\is_array($array)) { + throw new RuntimeError(sprintf('The sort filter only works with arrays or "Traversable", got "%s".', \gettype($array))); + } + + asort($array); + + return $array; +} + +/** + * @internal + */ +function twig_in_filter($value, $compare) +{ + if ($value instanceof Markup) { + $value = (string) $value; + } + if ($compare instanceof Markup) { + $compare = (string) $compare; + } + + if (\is_array($compare)) { + return \in_array($value, $compare, \is_object($value) || \is_resource($value)); + } elseif (\is_string($compare) && (\is_string($value) || \is_int($value) || \is_float($value))) { + return '' === $value || false !== strpos($compare, (string) $value); + } elseif ($compare instanceof \Traversable) { + if (\is_object($value) || \is_resource($value)) { + foreach ($compare as $item) { + if ($item === $value) { + return true; + } + } + } else { + foreach ($compare as $item) { + if ($item == $value) { + return true; + } + } + } + + return false; + } + + return false; +} + +/** + * Returns a trimmed string. + * + * @return string + * + * @throws RuntimeError When an invalid trimming side is used (not a string or not 'left', 'right', or 'both') + */ +function twig_trim_filter($string, $characterMask = null, $side = 'both') +{ + if (null === $characterMask) { + $characterMask = " \t\n\r\0\x0B"; + } + + switch ($side) { + case 'both': + return trim($string, $characterMask); + case 'left': + return ltrim($string, $characterMask); + case 'right': + return rtrim($string, $characterMask); + default: + throw new RuntimeError('Trimming side must be "left", "right" or "both".'); + } +} + +/** + * Removes whitespaces between HTML tags. + * + * @return string + */ +function twig_spaceless($content) +{ + return trim(preg_replace('/>\s+<', $content)); +} + +/** + * Escapes a string. + * + * @param mixed $string The value to be escaped + * @param string $strategy The escaping strategy + * @param string $charset The charset + * @param bool $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false) + * + * @return string + */ +function twig_escape_filter(Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false) +{ + if ($autoescape && $string instanceof Markup) { + return $string; + } + + if (!\is_string($string)) { + if (\is_object($string) && method_exists($string, '__toString')) { + $string = (string) $string; + } elseif (\in_array($strategy, ['html', 'js', 'css', 'html_attr', 'url'])) { + return $string; + } + } + + if ('' === $string) { + return ''; + } + + if (null === $charset) { + $charset = $env->getCharset(); + } + + switch ($strategy) { + case 'html': + // see https://secure.php.net/htmlspecialchars + + // Using a static variable to avoid initializing the array + // each time the function is called. Moving the declaration on the + // top of the function slow downs other escaping strategies. + static $htmlspecialcharsCharsets = [ + 'ISO-8859-1' => true, 'ISO8859-1' => true, + 'ISO-8859-15' => true, 'ISO8859-15' => true, + 'utf-8' => true, 'UTF-8' => true, + 'CP866' => true, 'IBM866' => true, '866' => true, + 'CP1251' => true, 'WINDOWS-1251' => true, 'WIN-1251' => true, + '1251' => true, + 'CP1252' => true, 'WINDOWS-1252' => true, '1252' => true, + 'KOI8-R' => true, 'KOI8-RU' => true, 'KOI8R' => true, + 'BIG5' => true, '950' => true, + 'GB2312' => true, '936' => true, + 'BIG5-HKSCS' => true, + 'SHIFT_JIS' => true, 'SJIS' => true, '932' => true, + 'EUC-JP' => true, 'EUCJP' => true, + 'ISO8859-5' => true, 'ISO-8859-5' => true, 'MACROMAN' => true, + ]; + + if (isset($htmlspecialcharsCharsets[$charset])) { + return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + } + + if (isset($htmlspecialcharsCharsets[strtoupper($charset)])) { + // cache the lowercase variant for future iterations + $htmlspecialcharsCharsets[$charset] = true; + + return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset); + } + + $string = twig_convert_encoding($string, 'UTF-8', $charset); + $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8'); + + return twig_convert_encoding($string, $charset, 'UTF-8'); + + case 'js': + // escape all non-alphanumeric characters + // into their \x or \uHHHH representations + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (!preg_match('//u', $string)) { + throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9,\._]#Su', '_twig_escape_js_callback', $string); + + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'css': + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (!preg_match('//u', $string)) { + throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9]#Su', '_twig_escape_css_callback', $string); + + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'html_attr': + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, 'UTF-8', $charset); + } + + if (!preg_match('//u', $string)) { + throw new RuntimeError('The string to escape is not a valid UTF-8 string.'); + } + + $string = preg_replace_callback('#[^a-zA-Z0-9,\.\-_]#Su', '_twig_escape_html_attr_callback', $string); + + if ('UTF-8' !== $charset) { + $string = twig_convert_encoding($string, $charset, 'UTF-8'); + } + + return $string; + + case 'url': + return rawurlencode($string); + + default: + static $escapers; + + if (null === $escapers) { + $escapers = $env->getExtension('\Twig\Extension\CoreExtension')->getEscapers(); + } + + if (isset($escapers[$strategy])) { + return \call_user_func($escapers[$strategy], $env, $string, $charset); + } + + $validStrategies = implode(', ', array_merge(['html', 'js', 'url', 'css', 'html_attr'], array_keys($escapers))); + + throw new RuntimeError(sprintf('Invalid escaping strategy "%s" (valid ones: %s).', $strategy, $validStrategies)); + } +} + +/** + * @internal + */ +function twig_escape_filter_is_safe(Node $filterArgs) +{ + foreach ($filterArgs as $arg) { + if ($arg instanceof ConstantExpression) { + return [$arg->getAttribute('value')]; + } + + return []; + } + + return ['html']; +} + +if (\function_exists('mb_convert_encoding')) { + function twig_convert_encoding($string, $to, $from) + { + return mb_convert_encoding($string, $to, $from); + } +} elseif (\function_exists('iconv')) { + function twig_convert_encoding($string, $to, $from) + { + return iconv($from, $to, $string); + } +} else { + function twig_convert_encoding($string, $to, $from) + { + throw new RuntimeError('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).'); + } +} + +if (\function_exists('mb_ord')) { + function twig_ord($string) + { + return mb_ord($string, 'UTF-8'); + } +} else { + function twig_ord($string) + { + $code = ($string = unpack('C*', substr($string, 0, 4))) ? $string[1] : 0; + if (0xF0 <= $code) { + return (($code - 0xF0) << 18) + (($string[2] - 0x80) << 12) + (($string[3] - 0x80) << 6) + $string[4] - 0x80; + } + if (0xE0 <= $code) { + return (($code - 0xE0) << 12) + (($string[2] - 0x80) << 6) + $string[3] - 0x80; + } + if (0xC0 <= $code) { + return (($code - 0xC0) << 6) + $string[2] - 0x80; + } + + return $code; + } +} + +function _twig_escape_js_callback($matches) +{ + $char = $matches[0]; + + /* + * A few characters have short escape sequences in JSON and JavaScript. + * Escape sequences supported only by JavaScript, not JSON, are ommitted. + * \" is also supported but omitted, because the resulting string is not HTML safe. + */ + static $shortMap = [ + '\\' => '\\\\', + '/' => '\\/', + "\x08" => '\b', + "\x0C" => '\f', + "\x0A" => '\n', + "\x0D" => '\r', + "\x09" => '\t', + ]; + + if (isset($shortMap[$char])) { + return $shortMap[$char]; + } + + // \uHHHH + $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8'); + $char = strtoupper(bin2hex($char)); + + if (4 >= \strlen($char)) { + return sprintf('\u%04s', $char); + } + + return sprintf('\u%04s\u%04s', substr($char, 0, -4), substr($char, -4)); +} + +function _twig_escape_css_callback($matches) +{ + $char = $matches[0]; + + return sprintf('\\%X ', 1 === \strlen($char) ? \ord($char) : twig_ord($char)); +} + +/** + * This function is adapted from code coming from Zend Framework. + * + * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (https://www.zend.com) + * @license https://framework.zend.com/license/new-bsd New BSD License + */ +function _twig_escape_html_attr_callback($matches) +{ + $chr = $matches[0]; + $ord = \ord($chr); + + /* + * The following replaces characters undefined in HTML with the + * hex entity for the Unicode replacement character. + */ + if (($ord <= 0x1f && "\t" != $chr && "\n" != $chr && "\r" != $chr) || ($ord >= 0x7f && $ord <= 0x9f)) { + return '�'; + } + + /* + * Check if the current character to escape has a name entity we should + * replace it with while grabbing the hex value of the character. + */ + if (1 == \strlen($chr)) { + /* + * While HTML supports far more named entities, the lowest common denominator + * has become HTML5's XML Serialisation which is restricted to the those named + * entities that XML supports. Using HTML entities would result in this error: + * XML Parsing Error: undefined entity + */ + static $entityMap = [ + 34 => '"', /* quotation mark */ + 38 => '&', /* ampersand */ + 60 => '<', /* less-than sign */ + 62 => '>', /* greater-than sign */ + ]; + + if (isset($entityMap[$ord])) { + return $entityMap[$ord]; + } + + return sprintf('&#x%02X;', $ord); + } + + /* + * Per OWASP recommendations, we'll use hex entities for any other + * characters where a named entity does not exist. + */ + return sprintf('&#x%04X;', twig_ord($chr)); +} + +// add multibyte extensions if possible +if (\function_exists('mb_get_info')) { + /** + * Returns the length of a variable. + * + * @param mixed $thing A variable + * + * @return int The length of the value + */ + function twig_length_filter(Environment $env, $thing) + { + if (null === $thing) { + return 0; + } + + if (is_scalar($thing)) { + return mb_strlen($thing, $env->getCharset()); + } + + if ($thing instanceof \Countable || \is_array($thing) || $thing instanceof \SimpleXMLElement) { + return \count($thing); + } + + if ($thing instanceof \Traversable) { + return iterator_count($thing); + } + + if (\is_object($thing) && method_exists($thing, '__toString')) { + return mb_strlen((string) $thing, $env->getCharset()); + } + + return 1; + } + + /** + * Converts a string to uppercase. + * + * @param string $string A string + * + * @return string The uppercased string + */ + function twig_upper_filter(Environment $env, $string) + { + if (null !== $charset = $env->getCharset()) { + return mb_strtoupper($string, $charset); + } + + return strtoupper($string); + } + + /** + * Converts a string to lowercase. + * + * @param string $string A string + * + * @return string The lowercased string + */ + function twig_lower_filter(Environment $env, $string) + { + if (null !== $charset = $env->getCharset()) { + return mb_strtolower($string, $charset); + } + + return strtolower($string); + } + + /** + * Returns a titlecased string. + * + * @param string $string A string + * + * @return string The titlecased string + */ + function twig_title_string_filter(Environment $env, $string) + { + if (null !== $charset = $env->getCharset()) { + return mb_convert_case($string, MB_CASE_TITLE, $charset); + } + + return ucwords(strtolower($string)); + } + + /** + * Returns a capitalized string. + * + * @param string $string A string + * + * @return string The capitalized string + */ + function twig_capitalize_string_filter(Environment $env, $string) + { + if (null !== $charset = $env->getCharset()) { + return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset).mb_strtolower(mb_substr($string, 1, mb_strlen($string, $charset), $charset), $charset); + } + + return ucfirst(strtolower($string)); + } +} +// and byte fallback +else { + /** + * Returns the length of a variable. + * + * @param mixed $thing A variable + * + * @return int The length of the value + */ + function twig_length_filter(Environment $env, $thing) + { + if (null === $thing) { + return 0; + } + + if (is_scalar($thing)) { + return \strlen($thing); + } + + if ($thing instanceof \SimpleXMLElement) { + return \count($thing); + } + + if (\is_object($thing) && method_exists($thing, '__toString') && !$thing instanceof \Countable) { + return \strlen((string) $thing); + } + + if ($thing instanceof \Countable || \is_array($thing)) { + return \count($thing); + } + + if ($thing instanceof \IteratorAggregate) { + return iterator_count($thing); + } + + return 1; + } + + /** + * Returns a titlecased string. + * + * @param string $string A string + * + * @return string The titlecased string + */ + function twig_title_string_filter(Environment $env, $string) + { + return ucwords(strtolower($string)); + } + + /** + * Returns a capitalized string. + * + * @param string $string A string + * + * @return string The capitalized string + */ + function twig_capitalize_string_filter(Environment $env, $string) + { + return ucfirst(strtolower($string)); + } +} + +/** + * @internal + */ +function twig_ensure_traversable($seq) +{ + if ($seq instanceof \Traversable || \is_array($seq)) { + return $seq; + } + + return []; +} + +/** + * @internal + */ +function twig_to_array($seq, $preserveKeys = true) +{ + if ($seq instanceof \Traversable) { + return iterator_to_array($seq, $preserveKeys); + } + + if (!\is_array($seq)) { + return $seq; + } + + return $preserveKeys ? $seq : array_values($seq); +} + +/** + * Checks if a variable is empty. + * + * {# evaluates to true if the foo variable is null, false, or the empty string #} + * {% if foo is empty %} + * {# ... #} + * {% endif %} + * + * @param mixed $value A variable + * + * @return bool true if the value is empty, false otherwise + */ +function twig_test_empty($value) +{ + if ($value instanceof \Countable) { + return 0 == \count($value); + } + + if ($value instanceof \Traversable) { + return !iterator_count($value); + } + + if (\is_object($value) && method_exists($value, '__toString')) { + return '' === (string) $value; + } + + return '' === $value || false === $value || null === $value || [] === $value; +} + +/** + * Checks if a variable is traversable. + * + * {# evaluates to true if the foo variable is an array or a traversable object #} + * {% if foo is iterable %} + * {# ... #} + * {% endif %} + * + * @param mixed $value A variable + * + * @return bool true if the value is traversable + */ +function twig_test_iterable($value) +{ + return $value instanceof \Traversable || \is_array($value); +} + +/** + * Renders a template. + * + * @param array $context + * @param string|array $template The template to render or an array of templates to try consecutively + * @param array $variables The variables to pass to the template + * @param bool $withContext + * @param bool $ignoreMissing Whether to ignore missing templates or not + * @param bool $sandboxed Whether to sandbox the template or not + * + * @return string The rendered template + */ +function twig_include(Environment $env, $context, $template, $variables = [], $withContext = true, $ignoreMissing = false, $sandboxed = false) +{ + $alreadySandboxed = false; + $sandbox = null; + if ($withContext) { + $variables = array_merge($context, $variables); + } + + if ($isSandboxed = $sandboxed && $env->hasExtension('\Twig\Extension\SandboxExtension')) { + $sandbox = $env->getExtension('\Twig\Extension\SandboxExtension'); + if (!$alreadySandboxed = $sandbox->isSandboxed()) { + $sandbox->enableSandbox(); + } + } + + $loaded = null; + try { + $loaded = $env->resolveTemplate($template); + } catch (LoaderError $e) { + if (!$ignoreMissing) { + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + throw $e; + } + } catch (\Throwable $e) { + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + throw $e; + } catch (\Exception $e) { + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + throw $e; + } + + try { + $ret = $loaded ? $loaded->render($variables) : ''; + } catch (\Exception $e) { + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + throw $e; + } + + if ($isSandboxed && !$alreadySandboxed) { + $sandbox->disableSandbox(); + } + + return $ret; +} + +/** + * Returns a template content without rendering it. + * + * @param string $name The template name + * @param bool $ignoreMissing Whether to ignore missing templates or not + * + * @return string The template source + */ +function twig_source(Environment $env, $name, $ignoreMissing = false) +{ + $loader = $env->getLoader(); + try { + if (!$loader instanceof SourceContextLoaderInterface) { + return $loader->getSource($name); + } else { + return $loader->getSourceContext($name)->getCode(); + } + } catch (LoaderError $e) { + if (!$ignoreMissing) { + throw $e; + } + } +} + +/** + * Provides the ability to get constants from instances as well as class/global constants. + * + * @param string $constant The name of the constant + * @param object|null $object The object to get the constant from + * + * @return string + */ +function twig_constant($constant, $object = null) +{ + if (null !== $object) { + $constant = \get_class($object).'::'.$constant; + } + + return \constant($constant); +} + +/** + * Checks if a constant exists. + * + * @param string $constant The name of the constant + * @param object|null $object The object to get the constant from + * + * @return bool + */ +function twig_constant_is_defined($constant, $object = null) +{ + if (null !== $object) { + $constant = \get_class($object).'::'.$constant; + } + + return \defined($constant); +} + +/** + * Batches item. + * + * @param array $items An array of items + * @param int $size The size of the batch + * @param mixed $fill A value used to fill missing items + * + * @return array + */ +function twig_array_batch($items, $size, $fill = null, $preserveKeys = true) +{ + if (!twig_test_iterable($items)) { + throw new RuntimeError(sprintf('The "batch" filter expects an array or "Traversable", got "%s".', \is_object($items) ? \get_class($items) : \gettype($items))); + } + + $size = ceil($size); + + $result = array_chunk(twig_to_array($items, $preserveKeys), $size, $preserveKeys); + + if (null !== $fill && $result) { + $last = \count($result) - 1; + if ($fillCount = $size - \count($result[$last])) { + for ($i = 0; $i < $fillCount; ++$i) { + $result[$last][] = $fill; + } + } + } + + return $result; +} + +function twig_array_filter($array, $arrow) +{ + if (\is_array($array)) { + if (\PHP_VERSION_ID >= 50600) { + return array_filter($array, $arrow, \ARRAY_FILTER_USE_BOTH); + } + + return array_filter($array, $arrow); + } + + // the IteratorIterator wrapping is needed as some internal PHP classes are \Traversable but do not implement \Iterator + return new \CallbackFilterIterator(new \IteratorIterator($array), $arrow); +} + +function twig_array_map($array, $arrow) +{ + $r = []; + foreach ($array as $k => $v) { + $r[$k] = $arrow($v, $k); + } + + return $r; +} + +function twig_array_reduce($array, $arrow, $initial = null) +{ + if (!\is_array($array)) { + $array = iterator_to_array($array); + } + + return array_reduce($array, $arrow, $initial); +} +} diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/DebugExtension.php b/phpMyAdmin/vendor/twig/twig/src/Extension/DebugExtension.php new file mode 100755 index 0000000..09b0223 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/DebugExtension.php @@ -0,0 +1,76 @@ + $isDumpOutputHtmlSafe ? ['html'] : [], 'needs_context' => true, 'needs_environment' => true, 'is_variadic' => true]), + ]; + } + + public function getName() + { + return 'debug'; + } +} + +class_alias('Twig\Extension\DebugExtension', 'Twig_Extension_Debug'); +} + +namespace { +use Twig\Environment; +use Twig\Template; +use Twig\TemplateWrapper; + +function twig_var_dump(Environment $env, $context, array $vars = []) +{ + if (!$env->isDebug()) { + return; + } + + ob_start(); + + if (!$vars) { + $vars = []; + foreach ($context as $key => $value) { + if (!$value instanceof Template && !$value instanceof TemplateWrapper) { + $vars[$key] = $value; + } + } + + var_dump($vars); + } else { + foreach ($vars as $var) { + var_dump($var); + } + } + + return ob_get_clean(); +} +} diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/EscaperExtension.php b/phpMyAdmin/vendor/twig/twig/src/Extension/EscaperExtension.php new file mode 100755 index 0000000..fc7f6df --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/EscaperExtension.php @@ -0,0 +1,120 @@ +setDefaultStrategy($defaultStrategy); + } + + public function getTokenParsers() + { + return [new AutoEscapeTokenParser()]; + } + + public function getNodeVisitors() + { + return [new EscaperNodeVisitor()]; + } + + public function getFilters() + { + return [ + new TwigFilter('raw', 'twig_raw_filter', ['is_safe' => ['all']]), + ]; + } + + /** + * Sets the default strategy to use when not defined by the user. + * + * The strategy can be a valid PHP callback that takes the template + * name as an argument and returns the strategy to use. + * + * @param string|false|callable $defaultStrategy An escaping strategy + */ + public function setDefaultStrategy($defaultStrategy) + { + // for BC + if (true === $defaultStrategy) { + @trigger_error('Using "true" as the default strategy is deprecated since version 1.21. Use "html" instead.', E_USER_DEPRECATED); + + $defaultStrategy = 'html'; + } + + if ('filename' === $defaultStrategy) { + @trigger_error('Using "filename" as the default strategy is deprecated since version 1.27. Use "name" instead.', E_USER_DEPRECATED); + + $defaultStrategy = 'name'; + } + + if ('name' === $defaultStrategy) { + $defaultStrategy = ['\Twig\FileExtensionEscapingStrategy', 'guess']; + } + + $this->defaultStrategy = $defaultStrategy; + } + + /** + * Gets the default strategy to use when not defined by the user. + * + * @param string $name The template name + * + * @return string|false The default strategy to use for the template + */ + public function getDefaultStrategy($name) + { + // disable string callables to avoid calling a function named html or js, + // or any other upcoming escaping strategy + if (!\is_string($this->defaultStrategy) && false !== $this->defaultStrategy) { + return \call_user_func($this->defaultStrategy, $name); + } + + return $this->defaultStrategy; + } + + public function getName() + { + return 'escaper'; + } +} + +class_alias('Twig\Extension\EscaperExtension', 'Twig_Extension_Escaper'); +} + +namespace { +/** + * Marks a variable as being safe. + * + * @param string $string A PHP variable + * + * @return string + */ +function twig_raw_filter($string) +{ + return $string; +} +} diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/ExtensionInterface.php b/phpMyAdmin/vendor/twig/twig/src/Extension/ExtensionInterface.php new file mode 100755 index 0000000..72b31e9 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/ExtensionInterface.php @@ -0,0 +1,101 @@ + + */ +interface ExtensionInterface +{ + /** + * Initializes the runtime environment. + * + * This is where you can load some file that contains filter functions for instance. + * + * @deprecated since 1.23 (to be removed in 2.0), implement \Twig_Extension_InitRuntimeInterface instead + */ + public function initRuntime(Environment $environment); + + /** + * Returns the token parser instances to add to the existing list. + * + * @return TokenParserInterface[] + */ + public function getTokenParsers(); + + /** + * Returns the node visitor instances to add to the existing list. + * + * @return NodeVisitorInterface[] + */ + public function getNodeVisitors(); + + /** + * Returns a list of filters to add to the existing list. + * + * @return TwigFilter[] + */ + public function getFilters(); + + /** + * Returns a list of tests to add to the existing list. + * + * @return TwigTest[] + */ + public function getTests(); + + /** + * Returns a list of functions to add to the existing list. + * + * @return TwigFunction[] + */ + public function getFunctions(); + + /** + * Returns a list of operators to add to the existing list. + * + * @return array First array of unary operators, second array of binary operators + */ + public function getOperators(); + + /** + * Returns a list of global variables to add to the existing list. + * + * @return array An array of global variables + * + * @deprecated since 1.23 (to be removed in 2.0), implement \Twig_Extension_GlobalsInterface instead + */ + public function getGlobals(); + + /** + * Returns the name of the extension. + * + * @return string The extension name + * + * @deprecated since 1.26 (to be removed in 2.0), not used anymore internally + */ + public function getName(); +} + +class_alias('Twig\Extension\ExtensionInterface', 'Twig_ExtensionInterface'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Environment'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/GlobalsInterface.php b/phpMyAdmin/vendor/twig/twig/src/Extension/GlobalsInterface.php new file mode 100755 index 0000000..1f54e25 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/GlobalsInterface.php @@ -0,0 +1,26 @@ + + */ +interface GlobalsInterface +{ +} + +class_alias('Twig\Extension\GlobalsInterface', 'Twig_Extension_GlobalsInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/InitRuntimeInterface.php b/phpMyAdmin/vendor/twig/twig/src/Extension/InitRuntimeInterface.php new file mode 100755 index 0000000..f71d9cb --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/InitRuntimeInterface.php @@ -0,0 +1,26 @@ + + */ +interface InitRuntimeInterface +{ +} + +class_alias('Twig\Extension\InitRuntimeInterface', 'Twig_Extension_InitRuntimeInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/OptimizerExtension.php b/phpMyAdmin/vendor/twig/twig/src/Extension/OptimizerExtension.php new file mode 100755 index 0000000..3e13740 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/OptimizerExtension.php @@ -0,0 +1,39 @@ +optimizers = $optimizers; + } + + public function getNodeVisitors() + { + return [new OptimizerNodeVisitor($this->optimizers)]; + } + + public function getName() + { + return 'optimizer'; + } +} + +class_alias('Twig\Extension\OptimizerExtension', 'Twig_Extension_Optimizer'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/ProfilerExtension.php b/phpMyAdmin/vendor/twig/twig/src/Extension/ProfilerExtension.php new file mode 100755 index 0000000..7b21b9f --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/ProfilerExtension.php @@ -0,0 +1,53 @@ +actives[] = $profile; + } + + public function enter(Profile $profile) + { + $this->actives[0]->addProfile($profile); + array_unshift($this->actives, $profile); + } + + public function leave(Profile $profile) + { + $profile->leave(); + array_shift($this->actives); + + if (1 === \count($this->actives)) { + $this->actives[0]->leave(); + } + } + + public function getNodeVisitors() + { + return [new ProfilerNodeVisitor(\get_class($this))]; + } + + public function getName() + { + return 'profiler'; + } +} + +class_alias('Twig\Extension\ProfilerExtension', 'Twig_Extension_Profiler'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php b/phpMyAdmin/vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php new file mode 100755 index 0000000..63bc3b1 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/RuntimeExtensionInterface.php @@ -0,0 +1,19 @@ + + */ +interface RuntimeExtensionInterface +{ +} diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/SandboxExtension.php b/phpMyAdmin/vendor/twig/twig/src/Extension/SandboxExtension.php new file mode 100755 index 0000000..818c8c9 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/SandboxExtension.php @@ -0,0 +1,109 @@ +policy = $policy; + $this->sandboxedGlobally = $sandboxed; + } + + public function getTokenParsers() + { + return [new SandboxTokenParser()]; + } + + public function getNodeVisitors() + { + return [new SandboxNodeVisitor()]; + } + + public function enableSandbox() + { + $this->sandboxed = true; + } + + public function disableSandbox() + { + $this->sandboxed = false; + } + + public function isSandboxed() + { + return $this->sandboxedGlobally || $this->sandboxed; + } + + public function isSandboxedGlobally() + { + return $this->sandboxedGlobally; + } + + public function setSecurityPolicy(SecurityPolicyInterface $policy) + { + $this->policy = $policy; + } + + public function getSecurityPolicy() + { + return $this->policy; + } + + public function checkSecurity($tags, $filters, $functions) + { + if ($this->isSandboxed()) { + $this->policy->checkSecurity($tags, $filters, $functions); + } + } + + public function checkMethodAllowed($obj, $method) + { + if ($this->isSandboxed()) { + $this->policy->checkMethodAllowed($obj, $method); + } + } + + public function checkPropertyAllowed($obj, $method) + { + if ($this->isSandboxed()) { + $this->policy->checkPropertyAllowed($obj, $method); + } + } + + public function ensureToStringAllowed($obj) + { + if ($this->isSandboxed() && \is_object($obj) && method_exists($obj, '__toString')) { + $this->policy->checkMethodAllowed($obj, '__toString'); + } + + return $obj; + } + + public function getName() + { + return 'sandbox'; + } +} + +class_alias('Twig\Extension\SandboxExtension', 'Twig_Extension_Sandbox'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/StagingExtension.php b/phpMyAdmin/vendor/twig/twig/src/Extension/StagingExtension.php new file mode 100755 index 0000000..049c5c7 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/StagingExtension.php @@ -0,0 +1,117 @@ + + * + * @internal + */ +class StagingExtension extends AbstractExtension +{ + protected $functions = []; + protected $filters = []; + protected $visitors = []; + protected $tokenParsers = []; + protected $globals = []; + protected $tests = []; + + public function addFunction($name, $function) + { + if (isset($this->functions[$name])) { + @trigger_error(sprintf('Overriding function "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); + } + + $this->functions[$name] = $function; + } + + public function getFunctions() + { + return $this->functions; + } + + public function addFilter($name, $filter) + { + if (isset($this->filters[$name])) { + @trigger_error(sprintf('Overriding filter "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); + } + + $this->filters[$name] = $filter; + } + + public function getFilters() + { + return $this->filters; + } + + public function addNodeVisitor(NodeVisitorInterface $visitor) + { + $this->visitors[] = $visitor; + } + + public function getNodeVisitors() + { + return $this->visitors; + } + + public function addTokenParser(TokenParserInterface $parser) + { + if (isset($this->tokenParsers[$parser->getTag()])) { + @trigger_error(sprintf('Overriding tag "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $parser->getTag()), E_USER_DEPRECATED); + } + + $this->tokenParsers[$parser->getTag()] = $parser; + } + + public function getTokenParsers() + { + return $this->tokenParsers; + } + + public function addGlobal($name, $value) + { + $this->globals[$name] = $value; + } + + public function getGlobals() + { + return $this->globals; + } + + public function addTest($name, $test) + { + if (isset($this->tests[$name])) { + @trigger_error(sprintf('Overriding test "%s" that is already registered is deprecated since version 1.30 and won\'t be possible anymore in 2.0.', $name), E_USER_DEPRECATED); + } + + $this->tests[$name] = $test; + } + + public function getTests() + { + return $this->tests; + } + + public function getName() + { + return 'staging'; + } +} + +class_alias('Twig\Extension\StagingExtension', 'Twig_Extension_Staging'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Extension/StringLoaderExtension.php b/phpMyAdmin/vendor/twig/twig/src/Extension/StringLoaderExtension.php new file mode 100755 index 0000000..93ac834 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Extension/StringLoaderExtension.php @@ -0,0 +1,54 @@ + true]), + ]; + } + + public function getName() + { + return 'string_loader'; + } +} + +class_alias('Twig\Extension\StringLoaderExtension', 'Twig_Extension_StringLoader'); +} + +namespace { +use Twig\Environment; +use Twig\TemplateWrapper; + +/** + * Loads a template from a string. + * + * {{ include(template_from_string("Hello {{ name }}")) }} + * + * @param string $template A template as a string or object implementing __toString() + * @param string $name An optional name of the template to be used in error messages + * + * @return TemplateWrapper + */ +function twig_template_from_string(Environment $env, $template, $name = null) +{ + return $env->createTemplate((string) $template, $name); +} +} diff --git a/phpMyAdmin/vendor/twig/twig/src/FileExtensionEscapingStrategy.php b/phpMyAdmin/vendor/twig/twig/src/FileExtensionEscapingStrategy.php new file mode 100755 index 0000000..bc95f33 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/FileExtensionEscapingStrategy.php @@ -0,0 +1,62 @@ + + */ +class FileExtensionEscapingStrategy +{ + /** + * Guesses the best autoescaping strategy based on the file name. + * + * @param string $name The template name + * + * @return string|false The escaping strategy name to use or false to disable + */ + public static function guess($name) + { + if (\in_array(substr($name, -1), ['/', '\\'])) { + return 'html'; // return html for directories + } + + if ('.twig' === substr($name, -5)) { + $name = substr($name, 0, -5); + } + + $extension = pathinfo($name, PATHINFO_EXTENSION); + + switch ($extension) { + case 'js': + return 'js'; + + case 'css': + return 'css'; + + case 'txt': + return false; + + default: + return 'html'; + } + } +} + +class_alias('Twig\FileExtensionEscapingStrategy', 'Twig_FileExtensionEscapingStrategy'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Lexer.php b/phpMyAdmin/vendor/twig/twig/src/Lexer.php new file mode 100755 index 0000000..697a6cf --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Lexer.php @@ -0,0 +1,534 @@ + + */ +class Lexer implements \Twig_LexerInterface +{ + protected $tokens; + protected $code; + protected $cursor; + protected $lineno; + protected $end; + protected $state; + protected $states; + protected $brackets; + protected $env; + // to be renamed to $name in 2.0 (where it is private) + protected $filename; + protected $options; + protected $regexes; + protected $position; + protected $positions; + protected $currentVarBlockLine; + + private $source; + + const STATE_DATA = 0; + const STATE_BLOCK = 1; + const STATE_VAR = 2; + const STATE_STRING = 3; + const STATE_INTERPOLATION = 4; + + const REGEX_NAME = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A'; + const REGEX_NUMBER = '/[0-9]+(?:\.[0-9]+)?([Ee][\+\-][0-9]+)?/A'; + const REGEX_STRING = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As'; + const REGEX_DQ_STRING_DELIM = '/"/A'; + const REGEX_DQ_STRING_PART = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As'; + const PUNCTUATION = '()[]{}?:.,|'; + + public function __construct(Environment $env, array $options = []) + { + $this->env = $env; + + $this->options = array_merge([ + 'tag_comment' => ['{#', '#}'], + 'tag_block' => ['{%', '%}'], + 'tag_variable' => ['{{', '}}'], + 'whitespace_trim' => '-', + 'whitespace_line_trim' => '~', + 'whitespace_line_chars' => ' \t\0\x0B', + 'interpolation' => ['#{', '}'], + ], $options); + + // when PHP 7.3 is the min version, we will be able to remove the '#' part in preg_quote as it's part of the default + $this->regexes = [ + // }} + 'lex_var' => '{ + \s* + (?:'. + preg_quote($this->options['whitespace_trim'].$this->options['tag_variable'][1], '#').'\s*'. // -}}\s* + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_variable'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~}}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_variable'][1], '#'). // }} + ') + }Ax', + + // %} + 'lex_block' => '{ + \s* + (?:'. + preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*\n?'. // -%}\s*\n? + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_block'][1], '#').'\n?'. // %}\n? + ') + }Ax', + + // {% endverbatim %} + 'lex_raw_data' => '{'. + preg_quote($this->options['tag_block'][0], '#'). // {% + '('. + $this->options['whitespace_trim']. // - + '|'. + $this->options['whitespace_line_trim']. // ~ + ')?\s*'. + '(?:end%s)'. // endraw or endverbatim + '\s*'. + '(?:'. + preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*'. // -%} + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_block'][1], '#'). // %} + ') + }sx', + + 'operator' => $this->getOperatorRegex(), + + // #} + 'lex_comment' => '{ + (?:'. + preg_quote($this->options['whitespace_trim']).preg_quote($this->options['tag_comment'][1], '#').'\s*\n?'. // -#}\s*\n? + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_comment'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~#}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_comment'][1], '#').'\n?'. // #}\n? + ') + }sx', + + // verbatim %} + 'lex_block_raw' => '{ + \s* + (raw|verbatim) + \s* + (?:'. + preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '#').'\s*'. // -%}\s* + '|'. + preg_quote($this->options['whitespace_line_trim'].$this->options['tag_block'][1], '#').'['.$this->options['whitespace_line_chars'].']*'. // ~%}[ \t\0\x0B]* + '|'. + preg_quote($this->options['tag_block'][1], '#'). // %} + ') + }Asx', + + 'lex_block_line' => '{\s*line\s+(\d+)\s*'.preg_quote($this->options['tag_block'][1], '#').'}As', + + // {{ or {% or {# + 'lex_tokens_start' => '{ + ('. + preg_quote($this->options['tag_variable'][0], '#'). // {{ + '|'. + preg_quote($this->options['tag_block'][0], '#'). // {% + '|'. + preg_quote($this->options['tag_comment'][0], '#'). // {# + ')('. + preg_quote($this->options['whitespace_trim'], '#'). // - + '|'. + preg_quote($this->options['whitespace_line_trim'], '#'). // ~ + ')? + }sx', + 'interpolation_start' => '{'.preg_quote($this->options['interpolation'][0], '#').'\s*}A', + 'interpolation_end' => '{\s*'.preg_quote($this->options['interpolation'][1], '#').'}A', + ]; + } + + public function tokenize($code, $name = null) + { + if (!$code instanceof Source) { + @trigger_error(sprintf('Passing a string as the $code argument of %s() is deprecated since version 1.27 and will be removed in 2.0. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + $this->source = new Source($code, $name); + } else { + $this->source = $code; + } + + if (((int) ini_get('mbstring.func_overload')) & 2) { + @trigger_error('Support for having "mbstring.func_overload" different from 0 is deprecated version 1.29 and will be removed in 2.0.', E_USER_DEPRECATED); + } + + if (\function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { + $mbEncoding = mb_internal_encoding(); + mb_internal_encoding('ASCII'); + } else { + $mbEncoding = null; + } + + $this->code = str_replace(["\r\n", "\r"], "\n", $this->source->getCode()); + $this->filename = $this->source->getName(); + $this->cursor = 0; + $this->lineno = 1; + $this->end = \strlen($this->code); + $this->tokens = []; + $this->state = self::STATE_DATA; + $this->states = []; + $this->brackets = []; + $this->position = -1; + + // find all token starts in one go + preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE); + $this->positions = $matches; + + while ($this->cursor < $this->end) { + // dispatch to the lexing functions depending + // on the current state + switch ($this->state) { + case self::STATE_DATA: + $this->lexData(); + break; + + case self::STATE_BLOCK: + $this->lexBlock(); + break; + + case self::STATE_VAR: + $this->lexVar(); + break; + + case self::STATE_STRING: + $this->lexString(); + break; + + case self::STATE_INTERPOLATION: + $this->lexInterpolation(); + break; + } + } + + $this->pushToken(Token::EOF_TYPE); + + if (!empty($this->brackets)) { + list($expect, $lineno) = array_pop($this->brackets); + throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); + } + + if ($mbEncoding) { + mb_internal_encoding($mbEncoding); + } + + return new TokenStream($this->tokens, $this->source); + } + + protected function lexData() + { + // if no matches are left we return the rest of the template as simple text token + if ($this->position == \count($this->positions[0]) - 1) { + $this->pushToken(Token::TEXT_TYPE, substr($this->code, $this->cursor)); + $this->cursor = $this->end; + + return; + } + + // Find the first token after the current cursor + $position = $this->positions[0][++$this->position]; + while ($position[1] < $this->cursor) { + if ($this->position == \count($this->positions[0]) - 1) { + return; + } + $position = $this->positions[0][++$this->position]; + } + + // push the template text first + $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor); + + // trim? + if (isset($this->positions[2][$this->position][0])) { + if ($this->options['whitespace_trim'] === $this->positions[2][$this->position][0]) { + // whitespace_trim detected ({%-, {{- or {#-) + $text = rtrim($text); + } elseif ($this->options['whitespace_line_trim'] === $this->positions[2][$this->position][0]) { + // whitespace_line_trim detected ({%~, {{~ or {#~) + // don't trim \r and \n + $text = rtrim($text, " \t\0\x0B"); + } + } + $this->pushToken(Token::TEXT_TYPE, $text); + $this->moveCursor($textContent.$position[0]); + + switch ($this->positions[1][$this->position][0]) { + case $this->options['tag_comment'][0]: + $this->lexComment(); + break; + + case $this->options['tag_block'][0]: + // raw data? + if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, 0, $this->cursor)) { + $this->moveCursor($match[0]); + $this->lexRawData($match[1]); + // {% line \d+ %} + } elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, 0, $this->cursor)) { + $this->moveCursor($match[0]); + $this->lineno = (int) $match[1]; + } else { + $this->pushToken(Token::BLOCK_START_TYPE); + $this->pushState(self::STATE_BLOCK); + $this->currentVarBlockLine = $this->lineno; + } + break; + + case $this->options['tag_variable'][0]: + $this->pushToken(Token::VAR_START_TYPE); + $this->pushState(self::STATE_VAR); + $this->currentVarBlockLine = $this->lineno; + break; + } + } + + protected function lexBlock() + { + if (empty($this->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::BLOCK_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function lexVar() + { + if (empty($this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::VAR_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function lexExpression() + { + // whitespace + if (preg_match('/\s+/A', $this->code, $match, 0, $this->cursor)) { + $this->moveCursor($match[0]); + + if ($this->cursor >= $this->end) { + throw new SyntaxError(sprintf('Unclosed "%s".', self::STATE_BLOCK === $this->state ? 'block' : 'variable'), $this->currentVarBlockLine, $this->source); + } + } + + // arrow function + if ('=' === $this->code[$this->cursor] && '>' === $this->code[$this->cursor + 1]) { + $this->pushToken(Token::ARROW_TYPE, '=>'); + $this->moveCursor('=>'); + } + // operators + elseif (preg_match($this->regexes['operator'], $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::OPERATOR_TYPE, preg_replace('/\s+/', ' ', $match[0])); + $this->moveCursor($match[0]); + } + // names + elseif (preg_match(self::REGEX_NAME, $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::NAME_TYPE, $match[0]); + $this->moveCursor($match[0]); + } + // numbers + elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, 0, $this->cursor)) { + $number = (float) $match[0]; // floats + if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) { + $number = (int) $match[0]; // integers lower than the maximum + } + $this->pushToken(Token::NUMBER_TYPE, $number); + $this->moveCursor($match[0]); + } + // punctuation + elseif (false !== strpos(self::PUNCTUATION, $this->code[$this->cursor])) { + // opening bracket + if (false !== strpos('([{', $this->code[$this->cursor])) { + $this->brackets[] = [$this->code[$this->cursor], $this->lineno]; + } + // closing bracket + elseif (false !== strpos(')]}', $this->code[$this->cursor])) { + if (empty($this->brackets)) { + throw new SyntaxError(sprintf('Unexpected "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); + } + + list($expect, $lineno) = array_pop($this->brackets); + if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) { + throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); + } + } + + $this->pushToken(Token::PUNCTUATION_TYPE, $this->code[$this->cursor]); + ++$this->cursor; + } + // strings + elseif (preg_match(self::REGEX_STRING, $this->code, $match, 0, $this->cursor)) { + $this->pushToken(Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1))); + $this->moveCursor($match[0]); + } + // opening double quoted string + elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) { + $this->brackets[] = ['"', $this->lineno]; + $this->pushState(self::STATE_STRING); + $this->moveCursor($match[0]); + } + // unlexable + else { + throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); + } + } + + protected function lexRawData($tag) + { + if ('raw' === $tag) { + @trigger_error(sprintf('Twig Tag "raw" is deprecated since version 1.21. Use "verbatim" instead in %s at line %d.', $this->filename, $this->lineno), E_USER_DEPRECATED); + } + + if (!preg_match(str_replace('%s', $tag, $this->regexes['lex_raw_data']), $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + throw new SyntaxError(sprintf('Unexpected end of file: Unclosed "%s" block.', $tag), $this->lineno, $this->source); + } + + $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor); + $this->moveCursor($text.$match[0][0]); + + // trim? + if (isset($match[1][0])) { + if ($this->options['whitespace_trim'] === $match[1][0]) { + // whitespace_trim detected ({%-, {{- or {#-) + $text = rtrim($text); + } else { + // whitespace_line_trim detected ({%~, {{~ or {#~) + // don't trim \r and \n + $text = rtrim($text, " \t\0\x0B"); + } + } + + $this->pushToken(Token::TEXT_TYPE, $text); + } + + protected function lexComment() + { + if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) { + throw new SyntaxError('Unclosed comment.', $this->lineno, $this->source); + } + + $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]); + } + + protected function lexString() + { + if (preg_match($this->regexes['interpolation_start'], $this->code, $match, 0, $this->cursor)) { + $this->brackets[] = [$this->options['interpolation'][0], $this->lineno]; + $this->pushToken(Token::INTERPOLATION_START_TYPE); + $this->moveCursor($match[0]); + $this->pushState(self::STATE_INTERPOLATION); + } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, 0, $this->cursor) && \strlen($match[0]) > 0) { + $this->pushToken(Token::STRING_TYPE, stripcslashes($match[0])); + $this->moveCursor($match[0]); + } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, 0, $this->cursor)) { + list($expect, $lineno) = array_pop($this->brackets); + if ('"' != $this->code[$this->cursor]) { + throw new SyntaxError(sprintf('Unclosed "%s".', $expect), $lineno, $this->source); + } + + $this->popState(); + ++$this->cursor; + } else { + // unlexable + throw new SyntaxError(sprintf('Unexpected character "%s".', $this->code[$this->cursor]), $this->lineno, $this->source); + } + } + + protected function lexInterpolation() + { + $bracket = end($this->brackets); + if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, 0, $this->cursor)) { + array_pop($this->brackets); + $this->pushToken(Token::INTERPOLATION_END_TYPE); + $this->moveCursor($match[0]); + $this->popState(); + } else { + $this->lexExpression(); + } + } + + protected function pushToken($type, $value = '') + { + // do not push empty text tokens + if (Token::TEXT_TYPE === $type && '' === $value) { + return; + } + + $this->tokens[] = new Token($type, $value, $this->lineno); + } + + protected function moveCursor($text) + { + $this->cursor += \strlen($text); + $this->lineno += substr_count($text, "\n"); + } + + protected function getOperatorRegex() + { + $operators = array_merge( + ['='], + array_keys($this->env->getUnaryOperators()), + array_keys($this->env->getBinaryOperators()) + ); + + $operators = array_combine($operators, array_map('strlen', $operators)); + arsort($operators); + + $regex = []; + foreach ($operators as $operator => $length) { + // an operator that ends with a character must be followed by + // a whitespace or a parenthesis + if (ctype_alpha($operator[$length - 1])) { + $r = preg_quote($operator, '/').'(?=[\s()])'; + } else { + $r = preg_quote($operator, '/'); + } + + // an operator with a space can be any amount of whitespaces + $r = preg_replace('/\s+/', '\s+', $r); + + $regex[] = $r; + } + + return '/'.implode('|', $regex).'/A'; + } + + protected function pushState($state) + { + $this->states[] = $this->state; + $this->state = $state; + } + + protected function popState() + { + if (0 === \count($this->states)) { + throw new \LogicException('Cannot pop state without a previous state.'); + } + + $this->state = array_pop($this->states); + } +} + +class_alias('Twig\Lexer', 'Twig_Lexer'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Loader/ArrayLoader.php b/phpMyAdmin/vendor/twig/twig/src/Loader/ArrayLoader.php new file mode 100755 index 0000000..6bc430f --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Loader/ArrayLoader.php @@ -0,0 +1,102 @@ + + */ +class ArrayLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +{ + protected $templates = []; + + /** + * @param array $templates An array of templates (keys are the names, and values are the source code) + */ + public function __construct(array $templates = []) + { + $this->templates = $templates; + } + + /** + * Adds or overrides a template. + * + * @param string $name The template name + * @param string $template The template source + */ + public function setTemplate($name, $template) + { + $this->templates[(string) $name] = $template; + } + + public function getSource($name) + { + @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED); + + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); + } + + return $this->templates[$name]; + } + + public function getSourceContext($name) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); + } + + return new Source($this->templates[$name], $name); + } + + public function exists($name) + { + return isset($this->templates[(string) $name]); + } + + public function getCacheKey($name) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); + } + + return $name.':'.$this->templates[$name]; + } + + public function isFresh($name, $time) + { + $name = (string) $name; + if (!isset($this->templates[$name])) { + throw new LoaderError(sprintf('Template "%s" is not defined.', $name)); + } + + return true; + } +} + +class_alias('Twig\Loader\ArrayLoader', 'Twig_Loader_Array'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Loader/ChainLoader.php b/phpMyAdmin/vendor/twig/twig/src/Loader/ChainLoader.php new file mode 100755 index 0000000..25ac55a --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Loader/ChainLoader.php @@ -0,0 +1,164 @@ + + */ +class ChainLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +{ + private $hasSourceCache = []; + protected $loaders = []; + + /** + * @param LoaderInterface[] $loaders + */ + public function __construct(array $loaders = []) + { + foreach ($loaders as $loader) { + $this->addLoader($loader); + } + } + + public function addLoader(LoaderInterface $loader) + { + $this->loaders[] = $loader; + $this->hasSourceCache = []; + } + + /** + * @return LoaderInterface[] + */ + public function getLoaders() + { + return $this->loaders; + } + + public function getSource($name) + { + @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED); + + $exceptions = []; + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->getSource($name); + } catch (LoaderError $e) { + $exceptions[] = $e->getMessage(); + } + } + + throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); + } + + public function getSourceContext($name) + { + $exceptions = []; + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + if ($loader instanceof SourceContextLoaderInterface) { + return $loader->getSourceContext($name); + } + + return new Source($loader->getSource($name), $name); + } catch (LoaderError $e) { + $exceptions[] = $e->getMessage(); + } + } + + throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); + } + + public function exists($name) + { + $name = (string) $name; + + if (isset($this->hasSourceCache[$name])) { + return $this->hasSourceCache[$name]; + } + + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface) { + if ($loader->exists($name)) { + return $this->hasSourceCache[$name] = true; + } + + continue; + } + + try { + if ($loader instanceof SourceContextLoaderInterface) { + $loader->getSourceContext($name); + } else { + $loader->getSource($name); + } + + return $this->hasSourceCache[$name] = true; + } catch (LoaderError $e) { + } + } + + return $this->hasSourceCache[$name] = false; + } + + public function getCacheKey($name) + { + $exceptions = []; + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->getCacheKey($name); + } catch (LoaderError $e) { + $exceptions[] = \get_class($loader).': '.$e->getMessage(); + } + } + + throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); + } + + public function isFresh($name, $time) + { + $exceptions = []; + foreach ($this->loaders as $loader) { + if ($loader instanceof ExistsLoaderInterface && !$loader->exists($name)) { + continue; + } + + try { + return $loader->isFresh($name, $time); + } catch (LoaderError $e) { + $exceptions[] = \get_class($loader).': '.$e->getMessage(); + } + } + + throw new LoaderError(sprintf('Template "%s" is not defined%s.', $name, $exceptions ? ' ('.implode(', ', $exceptions).')' : '')); + } +} + +class_alias('Twig\Loader\ChainLoader', 'Twig_Loader_Chain'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php b/phpMyAdmin/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php new file mode 100755 index 0000000..940d876 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Loader/ExistsLoaderInterface.php @@ -0,0 +1,33 @@ + + * + * @deprecated since 1.12 (to be removed in 3.0) + */ +interface ExistsLoaderInterface +{ + /** + * Check if we have the source code of a template, given its name. + * + * @param string $name The name of the template to check if we can load + * + * @return bool If the template source code is handled by this loader or not + */ + public function exists($name); +} + +class_alias('Twig\Loader\ExistsLoaderInterface', 'Twig_ExistsLoaderInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Loader/FilesystemLoader.php b/phpMyAdmin/vendor/twig/twig/src/Loader/FilesystemLoader.php new file mode 100755 index 0000000..19b43a2 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Loader/FilesystemLoader.php @@ -0,0 +1,323 @@ + + */ +class FilesystemLoader implements LoaderInterface, ExistsLoaderInterface, SourceContextLoaderInterface +{ + /** Identifier of the main namespace. */ + const MAIN_NAMESPACE = '__main__'; + + protected $paths = []; + protected $cache = []; + protected $errorCache = []; + + private $rootPath; + + /** + * @param string|array $paths A path or an array of paths where to look for templates + * @param string|null $rootPath The root path common to all relative paths (null for getcwd()) + */ + public function __construct($paths = [], $rootPath = null) + { + $this->rootPath = (null === $rootPath ? getcwd() : $rootPath).\DIRECTORY_SEPARATOR; + if (false !== $realPath = realpath($rootPath)) { + $this->rootPath = $realPath.\DIRECTORY_SEPARATOR; + } + + if ($paths) { + $this->setPaths($paths); + } + } + + /** + * Returns the paths to the templates. + * + * @param string $namespace A path namespace + * + * @return array The array of paths where to look for templates + */ + public function getPaths($namespace = self::MAIN_NAMESPACE) + { + return isset($this->paths[$namespace]) ? $this->paths[$namespace] : []; + } + + /** + * Returns the path namespaces. + * + * The main namespace is always defined. + * + * @return array The array of defined namespaces + */ + public function getNamespaces() + { + return array_keys($this->paths); + } + + /** + * Sets the paths where templates are stored. + * + * @param string|array $paths A path or an array of paths where to look for templates + * @param string $namespace A path namespace + */ + public function setPaths($paths, $namespace = self::MAIN_NAMESPACE) + { + if (!\is_array($paths)) { + $paths = [$paths]; + } + + $this->paths[$namespace] = []; + foreach ($paths as $path) { + $this->addPath($path, $namespace); + } + } + + /** + * Adds a path where templates are stored. + * + * @param string $path A path where to look for templates + * @param string $namespace A path namespace + * + * @throws LoaderError + */ + public function addPath($path, $namespace = self::MAIN_NAMESPACE) + { + // invalidate the cache + $this->cache = $this->errorCache = []; + + $checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path; + if (!is_dir($checkPath)) { + throw new LoaderError(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath)); + } + + $this->paths[$namespace][] = rtrim($path, '/\\'); + } + + /** + * Prepends a path where templates are stored. + * + * @param string $path A path where to look for templates + * @param string $namespace A path namespace + * + * @throws LoaderError + */ + public function prependPath($path, $namespace = self::MAIN_NAMESPACE) + { + // invalidate the cache + $this->cache = $this->errorCache = []; + + $checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path; + if (!is_dir($checkPath)) { + throw new LoaderError(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath)); + } + + $path = rtrim($path, '/\\'); + + if (!isset($this->paths[$namespace])) { + $this->paths[$namespace][] = $path; + } else { + array_unshift($this->paths[$namespace], $path); + } + } + + public function getSource($name) + { + @trigger_error(sprintf('Calling "getSource" on "%s" is deprecated since 1.27. Use getSourceContext() instead.', \get_class($this)), E_USER_DEPRECATED); + + if (null === ($path = $this->findTemplate($name)) || false === $path) { + return ''; + } + + return file_get_contents($path); + } + + public function getSourceContext($name) + { + if (null === ($path = $this->findTemplate($name)) || false === $path) { + return new Source('', $name, ''); + } + + return new Source(file_get_contents($path), $name, $path); + } + + public function getCacheKey($name) + { + if (null === ($path = $this->findTemplate($name)) || false === $path) { + return ''; + } + $len = \strlen($this->rootPath); + if (0 === strncmp($this->rootPath, $path, $len)) { + return substr($path, $len); + } + + return $path; + } + + public function exists($name) + { + $name = $this->normalizeName($name); + + if (isset($this->cache[$name])) { + return true; + } + + try { + return null !== ($path = $this->findTemplate($name, false)) && false !== $path; + } catch (LoaderError $e) { + @trigger_error(sprintf('In %s::findTemplate(), you must accept a second argument that when set to "false" returns "false" instead of throwing an exception. Not supporting this argument is deprecated since version 1.27.', \get_class($this)), E_USER_DEPRECATED); + + return false; + } + } + + public function isFresh($name, $time) + { + // false support to be removed in 3.0 + if (null === ($path = $this->findTemplate($name)) || false === $path) { + return false; + } + + return filemtime($path) < $time; + } + + /** + * Checks if the template can be found. + * + * @param string $name The template name + * + * @return string|false|null The template name or false/null + */ + protected function findTemplate($name) + { + $throw = \func_num_args() > 1 ? func_get_arg(1) : true; + $name = $this->normalizeName($name); + + if (isset($this->cache[$name])) { + return $this->cache[$name]; + } + + if (isset($this->errorCache[$name])) { + if (!$throw) { + return false; + } + + throw new LoaderError($this->errorCache[$name]); + } + + try { + $this->validateName($name); + + list($namespace, $shortname) = $this->parseName($name); + } catch (LoaderError $e) { + if (!$throw) { + return false; + } + + throw $e; + } + + if (!isset($this->paths[$namespace])) { + $this->errorCache[$name] = sprintf('There are no registered paths for namespace "%s".', $namespace); + + if (!$throw) { + return false; + } + + throw new LoaderError($this->errorCache[$name]); + } + + foreach ($this->paths[$namespace] as $path) { + if (!$this->isAbsolutePath($path)) { + $path = $this->rootPath.$path; + } + + if (is_file($path.'/'.$shortname)) { + if (false !== $realpath = realpath($path.'/'.$shortname)) { + return $this->cache[$name] = $realpath; + } + + return $this->cache[$name] = $path.'/'.$shortname; + } + } + + $this->errorCache[$name] = sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace])); + + if (!$throw) { + return false; + } + + throw new LoaderError($this->errorCache[$name]); + } + + protected function parseName($name, $default = self::MAIN_NAMESPACE) + { + if (isset($name[0]) && '@' == $name[0]) { + if (false === $pos = strpos($name, '/')) { + throw new LoaderError(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name)); + } + + $namespace = substr($name, 1, $pos - 1); + $shortname = substr($name, $pos + 1); + + return [$namespace, $shortname]; + } + + return [$default, $name]; + } + + protected function normalizeName($name) + { + return preg_replace('#/{2,}#', '/', str_replace('\\', '/', (string) $name)); + } + + protected function validateName($name) + { + if (false !== strpos($name, "\0")) { + throw new LoaderError('A template name cannot contain NUL bytes.'); + } + + $name = ltrim($name, '/'); + $parts = explode('/', $name); + $level = 0; + foreach ($parts as $part) { + if ('..' === $part) { + --$level; + } elseif ('.' !== $part) { + ++$level; + } + + if ($level < 0) { + throw new LoaderError(sprintf('Looks like you try to load a template outside configured directories (%s).', $name)); + } + } + } + + private function isAbsolutePath($file) + { + return strspn($file, '/\\', 0, 1) + || (\strlen($file) > 3 && ctype_alpha($file[0]) + && ':' === substr($file, 1, 1) + && strspn($file, '/\\', 2, 1) + ) + || null !== parse_url($file, PHP_URL_SCHEME) + ; + } +} + +class_alias('Twig\Loader\FilesystemLoader', 'Twig_Loader_Filesystem'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Loader/LoaderInterface.php b/phpMyAdmin/vendor/twig/twig/src/Loader/LoaderInterface.php new file mode 100755 index 0000000..15be7a8 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Loader/LoaderInterface.php @@ -0,0 +1,61 @@ + + */ +interface LoaderInterface +{ + /** + * Gets the source code of a template, given its name. + * + * @param string $name The name of the template to load + * + * @return string The template source code + * + * @throws LoaderError When $name is not found + * + * @deprecated since 1.27 (to be removed in 2.0), implement Twig\Loader\SourceContextLoaderInterface + */ + public function getSource($name); + + /** + * Gets the cache key to use for the cache for a given template name. + * + * @param string $name The name of the template to load + * + * @return string The cache key + * + * @throws LoaderError When $name is not found + */ + public function getCacheKey($name); + + /** + * Returns true if the template is still fresh. + * + * @param string $name The template name + * @param int $time Timestamp of the last modification time of the + * cached template + * + * @return bool true if the template is fresh, false otherwise + * + * @throws LoaderError When $name is not found + */ + public function isFresh($name, $time); +} + +class_alias('Twig\Loader\LoaderInterface', 'Twig_LoaderInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php b/phpMyAdmin/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php new file mode 100755 index 0000000..78b1fcd --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Loader/SourceContextLoaderInterface.php @@ -0,0 +1,38 @@ + + * + * @deprecated since 1.27 (to be removed in 3.0) + */ +interface SourceContextLoaderInterface +{ + /** + * Returns the source context for a given template logical name. + * + * @param string $name The template logical name + * + * @return Source + * + * @throws LoaderError When $name is not found + */ + public function getSourceContext($name); +} + +class_alias('Twig\Loader\SourceContextLoaderInterface', 'Twig_SourceContextLoaderInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Markup.php b/phpMyAdmin/vendor/twig/twig/src/Markup.php new file mode 100755 index 0000000..107941c --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Markup.php @@ -0,0 +1,41 @@ + + */ +class Markup implements \Countable +{ + protected $content; + protected $charset; + + public function __construct($content, $charset) + { + $this->content = (string) $content; + $this->charset = $charset; + } + + public function __toString() + { + return $this->content; + } + + public function count() + { + return \function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : \strlen($this->content); + } +} + +class_alias('Twig\Markup', 'Twig_Markup'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/AutoEscapeNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/AutoEscapeNode.php new file mode 100755 index 0000000..a940306 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/AutoEscapeNode.php @@ -0,0 +1,40 @@ + + */ +class AutoEscapeNode extends Node +{ + public function __construct($value, \Twig_NodeInterface $body, $lineno, $tag = 'autoescape') + { + parent::__construct(['body' => $body], ['value' => $value], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->subcompile($this->getNode('body')); + } +} + +class_alias('Twig\Node\AutoEscapeNode', 'Twig_Node_AutoEscape'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/BlockNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/BlockNode.php new file mode 100755 index 0000000..1ffc8ca --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/BlockNode.php @@ -0,0 +1,45 @@ + + */ +class BlockNode extends Node +{ + public function __construct($name, \Twig_NodeInterface $body, $lineno, $tag = null) + { + parent::__construct(['body' => $body], ['name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf("public function block_%s(\$context, array \$blocks = [])\n", $this->getAttribute('name')), "{\n") + ->indent() + ; + + $compiler + ->subcompile($this->getNode('body')) + ->outdent() + ->write("}\n\n") + ; + } +} + +class_alias('Twig\Node\BlockNode', 'Twig_Node_Block'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/BlockReferenceNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/BlockReferenceNode.php new file mode 100755 index 0000000..de06909 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/BlockReferenceNode.php @@ -0,0 +1,38 @@ + + */ +class BlockReferenceNode extends Node implements NodeOutputInterface +{ + public function __construct($name, $lineno, $tag = null) + { + parent::__construct([], ['name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name'))) + ; + } +} + +class_alias('Twig\Node\BlockReferenceNode', 'Twig_Node_BlockReference'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/BodyNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/BodyNode.php new file mode 100755 index 0000000..5290be5 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/BodyNode.php @@ -0,0 +1,23 @@ + + */ +class BodyNode extends Node +{ +} + +class_alias('Twig\Node\BodyNode', 'Twig_Node_Body'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/CheckSecurityNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/CheckSecurityNode.php new file mode 100755 index 0000000..cf0a7a1 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/CheckSecurityNode.php @@ -0,0 +1,85 @@ + + */ +class CheckSecurityNode extends Node +{ + protected $usedFilters; + protected $usedTags; + protected $usedFunctions; + + public function __construct(array $usedFilters, array $usedTags, array $usedFunctions) + { + $this->usedFilters = $usedFilters; + $this->usedTags = $usedTags; + $this->usedFunctions = $usedFunctions; + + parent::__construct(); + } + + public function compile(Compiler $compiler) + { + $tags = $filters = $functions = []; + foreach (['tags', 'filters', 'functions'] as $type) { + foreach ($this->{'used'.ucfirst($type)} as $name => $node) { + if ($node instanceof Node) { + ${$type}[$name] = $node->getTemplateLine(); + } else { + ${$type}[$node] = null; + } + } + } + + $compiler + ->write("\$this->sandbox = \$this->env->getExtension('\Twig\Extension\SandboxExtension');\n") + ->write('$tags = ')->repr(array_filter($tags))->raw(";\n") + ->write('$filters = ')->repr(array_filter($filters))->raw(";\n") + ->write('$functions = ')->repr(array_filter($functions))->raw(";\n\n") + ->write("try {\n") + ->indent() + ->write("\$this->sandbox->checkSecurity(\n") + ->indent() + ->write(!$tags ? "[],\n" : "['".implode("', '", array_keys($tags))."'],\n") + ->write(!$filters ? "[],\n" : "['".implode("', '", array_keys($filters))."'],\n") + ->write(!$functions ? "[]\n" : "['".implode("', '", array_keys($functions))."']\n") + ->outdent() + ->write(");\n") + ->outdent() + ->write("} catch (SecurityError \$e) {\n") + ->indent() + ->write("\$e->setSourceContext(\$this->getSourceContext());\n\n") + ->write("if (\$e instanceof SecurityNotAllowedTagError && isset(\$tags[\$e->getTagName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$tags[\$e->getTagName()]);\n") + ->outdent() + ->write("} elseif (\$e instanceof SecurityNotAllowedFilterError && isset(\$filters[\$e->getFilterName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$filters[\$e->getFilterName()]);\n") + ->outdent() + ->write("} elseif (\$e instanceof SecurityNotAllowedFunctionError && isset(\$functions[\$e->getFunctionName()])) {\n") + ->indent() + ->write("\$e->setTemplateLine(\$functions[\$e->getFunctionName()]);\n") + ->outdent() + ->write("}\n\n") + ->write("throw \$e;\n") + ->outdent() + ->write("}\n\n") + ; + } +} + +class_alias('Twig\Node\CheckSecurityNode', 'Twig_Node_CheckSecurity'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/CheckToStringNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/CheckToStringNode.php new file mode 100755 index 0000000..5d67467 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/CheckToStringNode.php @@ -0,0 +1,42 @@ + + */ +class CheckToStringNode extends AbstractExpression +{ + public function __construct(AbstractExpression $expr) + { + parent::__construct(['expr' => $expr], [], $expr->getTemplateLine(), $expr->getNodeTag()); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('$this->sandbox->ensureToStringAllowed(') + ->subcompile($this->getNode('expr')) + ->raw(')') + ; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/DeprecatedNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/DeprecatedNode.php new file mode 100755 index 0000000..62c0dd4 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/DeprecatedNode.php @@ -0,0 +1,55 @@ + + */ +class DeprecatedNode extends Node +{ + public function __construct(AbstractExpression $expr, $lineno, $tag = null) + { + parent::__construct(['expr' => $expr], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + $expr = $this->getNode('expr'); + + if ($expr instanceof ConstantExpression) { + $compiler->write('@trigger_error(') + ->subcompile($expr); + } else { + $varName = $compiler->getVarName(); + $compiler->write(sprintf('$%s = ', $varName)) + ->subcompile($expr) + ->raw(";\n") + ->write(sprintf('@trigger_error($%s', $varName)); + } + + $compiler + ->raw('.') + ->string(sprintf(' ("%s" at line %d).', $this->getTemplateName(), $this->getTemplateLine())) + ->raw(", E_USER_DEPRECATED);\n") + ; + } +} + +class_alias('Twig\Node\DeprecatedNode', 'Twig_Node_Deprecated'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/DoNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/DoNode.php new file mode 100755 index 0000000..80c4cea --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/DoNode.php @@ -0,0 +1,40 @@ + + */ +class DoNode extends Node +{ + public function __construct(AbstractExpression $expr, $lineno, $tag = null) + { + parent::__construct(['expr' => $expr], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('') + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ; + } +} + +class_alias('Twig\Node\DoNode', 'Twig_Node_Do'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/EmbedNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/EmbedNode.php new file mode 100755 index 0000000..05051ec --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/EmbedNode.php @@ -0,0 +1,52 @@ + + */ +class EmbedNode extends IncludeNode +{ + // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module) + public function __construct($name, $index, AbstractExpression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) + { + parent::__construct(new ConstantExpression('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag); + + $this->setAttribute('name', $name); + // to be removed in 2.0, used name instead + $this->setAttribute('filename', $name); + $this->setAttribute('index', $index); + } + + protected function addGetTemplate(Compiler $compiler) + { + $compiler + ->write('$this->loadTemplate(') + ->string($this->getAttribute('name')) + ->raw(', ') + ->repr($this->getTemplateName()) + ->raw(', ') + ->repr($this->getTemplateLine()) + ->raw(', ') + ->string($this->getAttribute('index')) + ->raw(')') + ; + } +} + +class_alias('Twig\Node\EmbedNode', 'Twig_Node_Embed'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/AbstractExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/AbstractExpression.php new file mode 100755 index 0000000..a352892 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/AbstractExpression.php @@ -0,0 +1,26 @@ + + */ +abstract class AbstractExpression extends Node +{ +} + +class_alias('Twig\Node\Expression\AbstractExpression', 'Twig_Node_Expression'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ArrayExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ArrayExpression.php new file mode 100755 index 0000000..cd63f93 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ArrayExpression.php @@ -0,0 +1,88 @@ +index = -1; + foreach ($this->getKeyValuePairs() as $pair) { + if ($pair['key'] instanceof ConstantExpression && ctype_digit((string) $pair['key']->getAttribute('value')) && $pair['key']->getAttribute('value') > $this->index) { + $this->index = $pair['key']->getAttribute('value'); + } + } + } + + public function getKeyValuePairs() + { + $pairs = []; + + foreach (array_chunk($this->nodes, 2) as $pair) { + $pairs[] = [ + 'key' => $pair[0], + 'value' => $pair[1], + ]; + } + + return $pairs; + } + + public function hasElement(AbstractExpression $key) + { + foreach ($this->getKeyValuePairs() as $pair) { + // we compare the string representation of the keys + // to avoid comparing the line numbers which are not relevant here. + if ((string) $key === (string) $pair['key']) { + return true; + } + } + + return false; + } + + public function addElement(AbstractExpression $value, AbstractExpression $key = null) + { + if (null === $key) { + $key = new ConstantExpression(++$this->index, $value->getTemplateLine()); + } + + array_push($this->nodes, $key, $value); + } + + public function compile(Compiler $compiler) + { + $compiler->raw('['); + $first = true; + foreach ($this->getKeyValuePairs() as $pair) { + if (!$first) { + $compiler->raw(', '); + } + $first = false; + + $compiler + ->subcompile($pair['key']) + ->raw(' => ') + ->subcompile($pair['value']) + ; + } + $compiler->raw(']'); + } +} + +class_alias('Twig\Node\Expression\ArrayExpression', 'Twig_Node_Expression_Array'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php new file mode 100755 index 0000000..36b77da --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ArrowFunctionExpression.php @@ -0,0 +1,64 @@ + + */ +class ArrowFunctionExpression extends AbstractExpression +{ + public function __construct(AbstractExpression $expr, Node $names, $lineno, $tag = null) + { + parent::__construct(['expr' => $expr, 'names' => $names], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->raw('function (') + ; + foreach ($this->getNode('names') as $i => $name) { + if ($i) { + $compiler->raw(', '); + } + + $compiler + ->raw('$__') + ->raw($name->getAttribute('name')) + ->raw('__') + ; + } + $compiler + ->raw(') use ($context) { ') + ; + foreach ($this->getNode('names') as $name) { + $compiler + ->raw('$context["') + ->raw($name->getAttribute('name')) + ->raw('"] = $__') + ->raw($name->getAttribute('name')) + ->raw('__; ') + ; + } + $compiler + ->raw('return ') + ->subcompile($this->getNode('expr')) + ->raw('; }') + ; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php new file mode 100755 index 0000000..62c4ac0 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/AssignNameExpression.php @@ -0,0 +1,29 @@ +raw('$context[') + ->string($this->getAttribute('name')) + ->raw(']') + ; + } +} + +class_alias('Twig\Node\Expression\AssignNameExpression', 'Twig_Node_Expression_AssignName'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php new file mode 100755 index 0000000..0600aee --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AbstractBinary.php @@ -0,0 +1,43 @@ + $left, 'right' => $right], [], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('left')) + ->raw(' ') + ; + $this->operator($compiler); + $compiler + ->raw(' ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + abstract public function operator(Compiler $compiler); +} + +class_alias('Twig\Node\Expression\Binary\AbstractBinary', 'Twig_Node_Expression_Binary'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php new file mode 100755 index 0000000..f7719a1 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AddBinary.php @@ -0,0 +1,25 @@ +raw('+'); + } +} + +class_alias('Twig\Node\Expression\Binary\AddBinary', 'Twig_Node_Expression_Binary_Add'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php new file mode 100755 index 0000000..484597d --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/AndBinary.php @@ -0,0 +1,25 @@ +raw('&&'); + } +} + +class_alias('Twig\Node\Expression\Binary\AndBinary', 'Twig_Node_Expression_Binary_And'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php new file mode 100755 index 0000000..cf28691 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseAndBinary.php @@ -0,0 +1,25 @@ +raw('&'); + } +} + +class_alias('Twig\Node\Expression\Binary\BitwiseAndBinary', 'Twig_Node_Expression_Binary_BitwiseAnd'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php new file mode 100755 index 0000000..7d5d260 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseOrBinary.php @@ -0,0 +1,25 @@ +raw('|'); + } +} + +class_alias('Twig\Node\Expression\Binary\BitwiseOrBinary', 'Twig_Node_Expression_Binary_BitwiseOr'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php new file mode 100755 index 0000000..7291987 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/BitwiseXorBinary.php @@ -0,0 +1,25 @@ +raw('^'); + } +} + +class_alias('Twig\Node\Expression\Binary\BitwiseXorBinary', 'Twig_Node_Expression_Binary_BitwiseXor'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php new file mode 100755 index 0000000..f6e5938 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/ConcatBinary.php @@ -0,0 +1,25 @@ +raw('.'); + } +} + +class_alias('Twig\Node\Expression\Binary\ConcatBinary', 'Twig_Node_Expression_Binary_Concat'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php new file mode 100755 index 0000000..ebfcc75 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/DivBinary.php @@ -0,0 +1,25 @@ +raw('/'); + } +} + +class_alias('Twig\Node\Expression\Binary\DivBinary', 'Twig_Node_Expression_Binary_Div'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php new file mode 100755 index 0000000..41a0065 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/EndsWithBinary.php @@ -0,0 +1,37 @@ +getVarName(); + $right = $compiler->getVarName(); + $compiler + ->raw(sprintf('(is_string($%s = ', $left)) + ->subcompile($this->getNode('left')) + ->raw(sprintf(') && is_string($%s = ', $right)) + ->subcompile($this->getNode('right')) + ->raw(sprintf(') && (\'\' === $%2$s || $%2$s === substr($%1$s, -strlen($%2$s))))', $left, $right)) + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw(''); + } +} + +class_alias('Twig\Node\Expression\Binary\EndsWithBinary', 'Twig_Node_Expression_Binary_EndsWith'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php new file mode 100755 index 0000000..84904c3 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/EqualBinary.php @@ -0,0 +1,24 @@ +raw('=='); + } +} + +class_alias('Twig\Node\Expression\Binary\EqualBinary', 'Twig_Node_Expression_Binary_Equal'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php new file mode 100755 index 0000000..4dd5e3d --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/FloorDivBinary.php @@ -0,0 +1,31 @@ +raw('(int) floor('); + parent::compile($compiler); + $compiler->raw(')'); + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('/'); + } +} + +class_alias('Twig\Node\Expression\Binary\FloorDivBinary', 'Twig_Node_Expression_Binary_FloorDiv'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php new file mode 100755 index 0000000..be73001 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/GreaterBinary.php @@ -0,0 +1,24 @@ +raw('>'); + } +} + +class_alias('Twig\Node\Expression\Binary\GreaterBinary', 'Twig_Node_Expression_Binary_Greater'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php new file mode 100755 index 0000000..5c2ae72 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/GreaterEqualBinary.php @@ -0,0 +1,24 @@ +raw('>='); + } +} + +class_alias('Twig\Node\Expression\Binary\GreaterEqualBinary', 'Twig_Node_Expression_Binary_GreaterEqual'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php new file mode 100755 index 0000000..f00b230 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/InBinary.php @@ -0,0 +1,35 @@ +raw('twig_in_filter(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('in'); + } +} + +class_alias('Twig\Node\Expression\Binary\InBinary', 'Twig_Node_Expression_Binary_In'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php new file mode 100755 index 0000000..2b202da --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/LessBinary.php @@ -0,0 +1,24 @@ +raw('<'); + } +} + +class_alias('Twig\Node\Expression\Binary\LessBinary', 'Twig_Node_Expression_Binary_Less'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php new file mode 100755 index 0000000..4fffafe --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/LessEqualBinary.php @@ -0,0 +1,24 @@ +raw('<='); + } +} + +class_alias('Twig\Node\Expression\Binary\LessEqualBinary', 'Twig_Node_Expression_Binary_LessEqual'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php new file mode 100755 index 0000000..ae810b2 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/MatchesBinary.php @@ -0,0 +1,35 @@ +raw('preg_match(') + ->subcompile($this->getNode('right')) + ->raw(', ') + ->subcompile($this->getNode('left')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw(''); + } +} + +class_alias('Twig\Node\Expression\Binary\MatchesBinary', 'Twig_Node_Expression_Binary_Matches'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php new file mode 100755 index 0000000..e6a2b36 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/ModBinary.php @@ -0,0 +1,25 @@ +raw('%'); + } +} + +class_alias('Twig\Node\Expression\Binary\ModBinary', 'Twig_Node_Expression_Binary_Mod'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php new file mode 100755 index 0000000..cd65f5d --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/MulBinary.php @@ -0,0 +1,25 @@ +raw('*'); + } +} + +class_alias('Twig\Node\Expression\Binary\MulBinary', 'Twig_Node_Expression_Binary_Mul'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php new file mode 100755 index 0000000..df5c6a2 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/NotEqualBinary.php @@ -0,0 +1,24 @@ +raw('!='); + } +} + +class_alias('Twig\Node\Expression\Binary\NotEqualBinary', 'Twig_Node_Expression_Binary_NotEqual'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php new file mode 100755 index 0000000..ed2034e --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/NotInBinary.php @@ -0,0 +1,35 @@ +raw('!twig_in_filter(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('not in'); + } +} + +class_alias('Twig\Node\Expression\Binary\NotInBinary', 'Twig_Node_Expression_Binary_NotIn'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php new file mode 100755 index 0000000..8f9da43 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/OrBinary.php @@ -0,0 +1,25 @@ +raw('||'); + } +} + +class_alias('Twig\Node\Expression\Binary\OrBinary', 'Twig_Node_Expression_Binary_Or'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php new file mode 100755 index 0000000..10a8d94 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/PowerBinary.php @@ -0,0 +1,39 @@ += 50600) { + return parent::compile($compiler); + } + + $compiler + ->raw('pow(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('**'); + } +} + +class_alias('Twig\Node\Expression\Binary\PowerBinary', 'Twig_Node_Expression_Binary_Power'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php new file mode 100755 index 0000000..e9c0cdf --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/RangeBinary.php @@ -0,0 +1,35 @@ +raw('range(') + ->subcompile($this->getNode('left')) + ->raw(', ') + ->subcompile($this->getNode('right')) + ->raw(')') + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw('..'); + } +} + +class_alias('Twig\Node\Expression\Binary\RangeBinary', 'Twig_Node_Expression_Binary_Range'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php new file mode 100755 index 0000000..1fe59fb --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/StartsWithBinary.php @@ -0,0 +1,37 @@ +getVarName(); + $right = $compiler->getVarName(); + $compiler + ->raw(sprintf('(is_string($%s = ', $left)) + ->subcompile($this->getNode('left')) + ->raw(sprintf(') && is_string($%s = ', $right)) + ->subcompile($this->getNode('right')) + ->raw(sprintf(') && (\'\' === $%2$s || 0 === strpos($%1$s, $%2$s)))', $left, $right)) + ; + } + + public function operator(Compiler $compiler) + { + return $compiler->raw(''); + } +} + +class_alias('Twig\Node\Expression\Binary\StartsWithBinary', 'Twig_Node_Expression_Binary_StartsWith'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php new file mode 100755 index 0000000..2546975 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Binary/SubBinary.php @@ -0,0 +1,25 @@ +raw('-'); + } +} + +class_alias('Twig\Node\Expression\Binary\SubBinary', 'Twig_Node_Expression_Binary_Sub'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php new file mode 100755 index 0000000..0a56849 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/BlockReferenceExpression.php @@ -0,0 +1,98 @@ + + */ +class BlockReferenceExpression extends AbstractExpression +{ + /** + * @param Node|null $template + */ + public function __construct(\Twig_NodeInterface $name, $template = null, $lineno, $tag = null) + { + if (\is_bool($template)) { + @trigger_error(sprintf('The %s method "$asString" argument is deprecated since version 1.28 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); + + $template = null; + } + + $nodes = ['name' => $name]; + if (null !== $template) { + $nodes['template'] = $template; + } + + parent::__construct($nodes, ['is_defined_test' => false, 'output' => false], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + if ($this->getAttribute('is_defined_test')) { + $this->compileTemplateCall($compiler, 'hasBlock'); + } else { + if ($this->getAttribute('output')) { + $compiler->addDebugInfo($this); + + $this + ->compileTemplateCall($compiler, 'displayBlock') + ->raw(";\n"); + } else { + $this->compileTemplateCall($compiler, 'renderBlock'); + } + } + } + + private function compileTemplateCall(Compiler $compiler, $method) + { + if (!$this->hasNode('template')) { + $compiler->write('$this'); + } else { + $compiler + ->write('$this->loadTemplate(') + ->subcompile($this->getNode('template')) + ->raw(', ') + ->repr($this->getTemplateName()) + ->raw(', ') + ->repr($this->getTemplateLine()) + ->raw(')') + ; + } + + $compiler->raw(sprintf('->%s', $method)); + $this->compileBlockArguments($compiler); + + return $compiler; + } + + private function compileBlockArguments(Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('name')) + ->raw(', $context'); + + if (!$this->hasNode('template')) { + $compiler->raw(', $blocks'); + } + + return $compiler->raw(')'); + } +} + +class_alias('Twig\Node\Expression\BlockReferenceExpression', 'Twig_Node_Expression_BlockReference'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/CallExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/CallExpression.php new file mode 100755 index 0000000..d202a73 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/CallExpression.php @@ -0,0 +1,305 @@ +hasAttribute('callable') && $callable = $this->getAttribute('callable')) { + if (\is_string($callable) && false === strpos($callable, '::')) { + $compiler->raw($callable); + } else { + list($r, $callable) = $this->reflectCallable($callable); + if ($r instanceof \ReflectionMethod && \is_string($callable[0])) { + if ($r->isStatic()) { + $compiler->raw(sprintf('%s::%s', $callable[0], $callable[1])); + } else { + $compiler->raw(sprintf('$this->env->getRuntime(\'%s\')->%s', $callable[0], $callable[1])); + } + } elseif ($r instanceof \ReflectionMethod && $callable[0] instanceof ExtensionInterface) { + $compiler->raw(sprintf('$this->env->getExtension(\'%s\')->%s', \get_class($callable[0]), $callable[1])); + } else { + $type = ucfirst($this->getAttribute('type')); + $compiler->raw(sprintf('call_user_func_array($this->env->get%s(\'%s\')->getCallable(), ', $type, $this->getAttribute('name'))); + $closingParenthesis = true; + $isArray = true; + } + } + } else { + $compiler->raw($this->getAttribute('thing')->compile()); + } + + $this->compileArguments($compiler, $isArray); + + if ($closingParenthesis) { + $compiler->raw(')'); + } + } + + protected function compileArguments(Compiler $compiler, $isArray = false) + { + $compiler->raw($isArray ? '[' : '('); + + $first = true; + + if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { + $compiler->raw('$this->env'); + $first = false; + } + + if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->raw('$context'); + $first = false; + } + + if ($this->hasAttribute('arguments')) { + foreach ($this->getAttribute('arguments') as $argument) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->string($argument); + $first = false; + } + } + + if ($this->hasNode('node')) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->subcompile($this->getNode('node')); + $first = false; + } + + if ($this->hasNode('arguments')) { + $callable = $this->hasAttribute('callable') ? $this->getAttribute('callable') : null; + + $arguments = $this->getArguments($callable, $this->getNode('arguments')); + + foreach ($arguments as $node) { + if (!$first) { + $compiler->raw(', '); + } + $compiler->subcompile($node); + $first = false; + } + } + + $compiler->raw($isArray ? ']' : ')'); + } + + protected function getArguments($callable, $arguments) + { + $callType = $this->getAttribute('type'); + $callName = $this->getAttribute('name'); + + $parameters = []; + $named = false; + foreach ($arguments as $name => $node) { + if (!\is_int($name)) { + $named = true; + $name = $this->normalizeName($name); + } elseif ($named) { + throw new SyntaxError(sprintf('Positional arguments cannot be used after named arguments for %s "%s".', $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); + } + + $parameters[$name] = $node; + } + + $isVariadic = $this->hasAttribute('is_variadic') && $this->getAttribute('is_variadic'); + if (!$named && !$isVariadic) { + return $parameters; + } + + if (!$callable) { + if ($named) { + $message = sprintf('Named arguments are not supported for %s "%s".', $callType, $callName); + } else { + $message = sprintf('Arbitrary positional arguments are not supported for %s "%s".', $callType, $callName); + } + + throw new \LogicException($message); + } + + $callableParameters = $this->getCallableParameters($callable, $isVariadic); + $arguments = []; + $names = []; + $missingArguments = []; + $optionalArguments = []; + $pos = 0; + foreach ($callableParameters as $callableParameter) { + $names[] = $name = $this->normalizeName($callableParameter->name); + + if (\array_key_exists($name, $parameters)) { + if (\array_key_exists($pos, $parameters)) { + throw new SyntaxError(sprintf('Argument "%s" is defined twice for %s "%s".', $name, $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); + } + + if (\count($missingArguments)) { + throw new SyntaxError(sprintf( + 'Argument "%s" could not be assigned for %s "%s(%s)" because it is mapped to an internal PHP function which cannot determine default value for optional argument%s "%s".', + $name, $callType, $callName, implode(', ', $names), \count($missingArguments) > 1 ? 's' : '', implode('", "', $missingArguments) + ), $this->getTemplateLine(), $this->getSourceContext()); + } + + $arguments = array_merge($arguments, $optionalArguments); + $arguments[] = $parameters[$name]; + unset($parameters[$name]); + $optionalArguments = []; + } elseif (\array_key_exists($pos, $parameters)) { + $arguments = array_merge($arguments, $optionalArguments); + $arguments[] = $parameters[$pos]; + unset($parameters[$pos]); + $optionalArguments = []; + ++$pos; + } elseif ($callableParameter->isDefaultValueAvailable()) { + $optionalArguments[] = new ConstantExpression($callableParameter->getDefaultValue(), -1); + } elseif ($callableParameter->isOptional()) { + if (empty($parameters)) { + break; + } else { + $missingArguments[] = $name; + } + } else { + throw new SyntaxError(sprintf('Value for argument "%s" is required for %s "%s".', $name, $callType, $callName), $this->getTemplateLine(), $this->getSourceContext()); + } + } + + if ($isVariadic) { + $arbitraryArguments = new ArrayExpression([], -1); + foreach ($parameters as $key => $value) { + if (\is_int($key)) { + $arbitraryArguments->addElement($value); + } else { + $arbitraryArguments->addElement($value, new ConstantExpression($key, -1)); + } + unset($parameters[$key]); + } + + if ($arbitraryArguments->count()) { + $arguments = array_merge($arguments, $optionalArguments); + $arguments[] = $arbitraryArguments; + } + } + + if (!empty($parameters)) { + $unknownParameter = null; + foreach ($parameters as $parameter) { + if ($parameter instanceof Node) { + $unknownParameter = $parameter; + break; + } + } + + throw new SyntaxError( + sprintf( + 'Unknown argument%s "%s" for %s "%s(%s)".', + \count($parameters) > 1 ? 's' : '', implode('", "', array_keys($parameters)), $callType, $callName, implode(', ', $names) + ), + $unknownParameter ? $unknownParameter->getTemplateLine() : $this->getTemplateLine(), + $unknownParameter ? $unknownParameter->getSourceContext() : $this->getSourceContext() + ); + } + + return $arguments; + } + + protected function normalizeName($name) + { + return strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], ['\\1_\\2', '\\1_\\2'], $name)); + } + + private function getCallableParameters($callable, $isVariadic) + { + list($r) = $this->reflectCallable($callable); + if (null === $r) { + return []; + } + + $parameters = $r->getParameters(); + if ($this->hasNode('node')) { + array_shift($parameters); + } + if ($this->hasAttribute('needs_environment') && $this->getAttribute('needs_environment')) { + array_shift($parameters); + } + if ($this->hasAttribute('needs_context') && $this->getAttribute('needs_context')) { + array_shift($parameters); + } + if ($this->hasAttribute('arguments') && null !== $this->getAttribute('arguments')) { + foreach ($this->getAttribute('arguments') as $argument) { + array_shift($parameters); + } + } + if ($isVariadic) { + $argument = end($parameters); + if ($argument && $argument->isArray() && $argument->isDefaultValueAvailable() && [] === $argument->getDefaultValue()) { + array_pop($parameters); + } else { + $callableName = $r->name; + if ($r instanceof \ReflectionMethod) { + $callableName = $r->getDeclaringClass()->name.'::'.$callableName; + } + + throw new \LogicException(sprintf('The last parameter of "%s" for %s "%s" must be an array with default value, eg. "array $arg = []".', $callableName, $this->getAttribute('type'), $this->getAttribute('name'))); + } + } + + return $parameters; + } + + private function reflectCallable($callable) + { + if (null !== $this->reflector) { + return $this->reflector; + } + + if (\is_array($callable)) { + if (!method_exists($callable[0], $callable[1])) { + // __call() + return [null, []]; + } + $r = new \ReflectionMethod($callable[0], $callable[1]); + } elseif (\is_object($callable) && !$callable instanceof \Closure) { + $r = new \ReflectionObject($callable); + $r = $r->getMethod('__invoke'); + $callable = [$callable, '__invoke']; + } elseif (\is_string($callable) && false !== $pos = strpos($callable, '::')) { + $class = substr($callable, 0, $pos); + $method = substr($callable, $pos + 2); + if (!method_exists($class, $method)) { + // __staticCall() + return [null, []]; + } + $r = new \ReflectionMethod($callable); + $callable = [$class, $method]; + } else { + $r = new \ReflectionFunction($callable); + } + + return $this->reflector = [$r, $callable]; + } +} + +class_alias('Twig\Node\Expression\CallExpression', 'Twig_Node_Expression_Call'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php new file mode 100755 index 0000000..b611218 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ConditionalExpression.php @@ -0,0 +1,38 @@ + $expr1, 'expr2' => $expr2, 'expr3' => $expr3], [], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('((') + ->subcompile($this->getNode('expr1')) + ->raw(') ? (') + ->subcompile($this->getNode('expr2')) + ->raw(') : (') + ->subcompile($this->getNode('expr3')) + ->raw('))') + ; + } +} + +class_alias('Twig\Node\Expression\ConditionalExpression', 'Twig_Node_Expression_Conditional'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ConstantExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ConstantExpression.php new file mode 100755 index 0000000..fd58264 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ConstantExpression.php @@ -0,0 +1,30 @@ + $value], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler->repr($this->getAttribute('value')); + } +} + +class_alias('Twig\Node\Expression\ConstantExpression', 'Twig_Node_Expression_Constant'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php new file mode 100755 index 0000000..7c5e2d2 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Filter/DefaultFilter.php @@ -0,0 +1,54 @@ + + */ +class DefaultFilter extends FilterExpression +{ + public function __construct(\Twig_NodeInterface $node, ConstantExpression $filterName, \Twig_NodeInterface $arguments, $lineno, $tag = null) + { + $default = new FilterExpression($node, new ConstantExpression('default', $node->getTemplateLine()), $arguments, $node->getTemplateLine()); + + if ('default' === $filterName->getAttribute('value') && ($node instanceof NameExpression || $node instanceof GetAttrExpression)) { + $test = new DefinedTest(clone $node, 'defined', new Node(), $node->getTemplateLine()); + $false = \count($arguments) ? $arguments->getNode(0) : new ConstantExpression('', $node->getTemplateLine()); + + $node = new ConditionalExpression($test, $default, $false, $node->getTemplateLine()); + } else { + $node = $default; + } + + parent::__construct($node, $filterName, $arguments, $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->subcompile($this->getNode('node')); + } +} + +class_alias('Twig\Node\Expression\Filter\DefaultFilter', 'Twig_Node_Expression_Filter_Default'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/FilterExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/FilterExpression.php new file mode 100755 index 0000000..6131c2f --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/FilterExpression.php @@ -0,0 +1,47 @@ + $node, 'filter' => $filterName, 'arguments' => $arguments], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $name = $this->getNode('filter')->getAttribute('value'); + $filter = $compiler->getEnvironment()->getFilter($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'filter'); + $this->setAttribute('thing', $filter); + $this->setAttribute('needs_environment', $filter->needsEnvironment()); + $this->setAttribute('needs_context', $filter->needsContext()); + $this->setAttribute('arguments', $filter->getArguments()); + if ($filter instanceof \Twig_FilterCallableInterface || $filter instanceof TwigFilter) { + $this->setAttribute('callable', $filter->getCallable()); + } + if ($filter instanceof TwigFilter) { + $this->setAttribute('is_variadic', $filter->isVariadic()); + } + + $this->compileCallable($compiler); + } +} + +class_alias('Twig\Node\Expression\FilterExpression', 'Twig_Node_Expression_Filter'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/FunctionExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/FunctionExpression.php new file mode 100755 index 0000000..cf2c72b --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/FunctionExpression.php @@ -0,0 +1,51 @@ + $arguments], ['name' => $name, 'is_defined_test' => false], $lineno); + } + + public function compile(Compiler $compiler) + { + $name = $this->getAttribute('name'); + $function = $compiler->getEnvironment()->getFunction($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'function'); + $this->setAttribute('thing', $function); + $this->setAttribute('needs_environment', $function->needsEnvironment()); + $this->setAttribute('needs_context', $function->needsContext()); + $this->setAttribute('arguments', $function->getArguments()); + if ($function instanceof \Twig_FunctionCallableInterface || $function instanceof TwigFunction) { + $callable = $function->getCallable(); + if ('constant' === $name && $this->getAttribute('is_defined_test')) { + $callable = 'twig_constant_is_defined'; + } + + $this->setAttribute('callable', $callable); + } + if ($function instanceof TwigFunction) { + $this->setAttribute('is_variadic', $function->isVariadic()); + } + + $this->compileCallable($compiler); + } +} + +class_alias('Twig\Node\Expression\FunctionExpression', 'Twig_Node_Expression_Function'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php new file mode 100755 index 0000000..b790bf7 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/GetAttrExpression.php @@ -0,0 +1,80 @@ + $node, 'attribute' => $attribute]; + if (null !== $arguments) { + $nodes['arguments'] = $arguments; + } + + parent::__construct($nodes, ['type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false], $lineno); + } + + public function compile(Compiler $compiler) + { + if ($this->getAttribute('disable_c_ext')) { + @trigger_error(sprintf('Using the "disable_c_ext" attribute on %s is deprecated since version 1.30 and will be removed in 2.0.', __CLASS__), E_USER_DEPRECATED); + } + + if (\function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) { + $compiler->raw('twig_template_get_attributes($this, '); + } else { + $compiler->raw('$this->getAttribute('); + } + + if ($this->getAttribute('ignore_strict_check')) { + $this->getNode('node')->setAttribute('ignore_strict_check', true); + } + + $compiler->subcompile($this->getNode('node')); + + $compiler->raw(', ')->subcompile($this->getNode('attribute')); + + // only generate optional arguments when needed (to make generated code more readable) + $needFourth = $this->getAttribute('ignore_strict_check'); + $needThird = $needFourth || $this->getAttribute('is_defined_test'); + $needSecond = $needThird || Template::ANY_CALL !== $this->getAttribute('type'); + $needFirst = $needSecond || $this->hasNode('arguments'); + + if ($needFirst) { + if ($this->hasNode('arguments')) { + $compiler->raw(', ')->subcompile($this->getNode('arguments')); + } else { + $compiler->raw(', []'); + } + } + + if ($needSecond) { + $compiler->raw(', ')->repr($this->getAttribute('type')); + } + + if ($needThird) { + $compiler->raw(', ')->repr($this->getAttribute('is_defined_test')); + } + + if ($needFourth) { + $compiler->raw(', ')->repr($this->getAttribute('ignore_strict_check')); + } + + $compiler->raw(')'); + } +} + +class_alias('Twig\Node\Expression\GetAttrExpression', 'Twig_Node_Expression_GetAttr'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/InlinePrint.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/InlinePrint.php new file mode 100755 index 0000000..469e736 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/InlinePrint.php @@ -0,0 +1,35 @@ + $node], [], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('print (') + ->subcompile($this->getNode('node')) + ->raw(')') + ; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php new file mode 100755 index 0000000..f631124 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/MethodCallExpression.php @@ -0,0 +1,48 @@ + $node, 'arguments' => $arguments], ['method' => $method, 'safe' => false], $lineno); + + if ($node instanceof NameExpression) { + $node->setAttribute('always_defined', true); + } + } + + public function compile(Compiler $compiler) + { + $compiler + ->subcompile($this->getNode('node')) + ->raw('->') + ->raw($this->getAttribute('method')) + ->raw('(') + ; + $first = true; + foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) { + if (!$first) { + $compiler->raw(', '); + } + $first = false; + + $compiler->subcompile($pair['value']); + } + $compiler->raw(')'); + } +} + +class_alias('Twig\Node\Expression\MethodCallExpression', 'Twig_Node_Expression_MethodCall'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/NameExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/NameExpression.php new file mode 100755 index 0000000..d3f7d10 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/NameExpression.php @@ -0,0 +1,119 @@ + '$this', + '_context' => '$context', + '_charset' => '$this->env->getCharset()', + ]; + + public function __construct($name, $lineno) + { + parent::__construct([], ['name' => $name, 'is_defined_test' => false, 'ignore_strict_check' => false, 'always_defined' => false], $lineno); + } + + public function compile(Compiler $compiler) + { + $name = $this->getAttribute('name'); + + $compiler->addDebugInfo($this); + + if ($this->getAttribute('is_defined_test')) { + if ($this->isSpecial()) { + $compiler->repr(true); + } elseif (\PHP_VERSION_ID >= 700400) { + $compiler + ->raw('array_key_exists(') + ->string($name) + ->raw(', $context)') + ; + } else { + $compiler + ->raw('(isset($context[') + ->string($name) + ->raw(']) || array_key_exists(') + ->string($name) + ->raw(', $context))') + ; + } + } elseif ($this->isSpecial()) { + $compiler->raw($this->specialVars[$name]); + } elseif ($this->getAttribute('always_defined')) { + $compiler + ->raw('$context[') + ->string($name) + ->raw(']') + ; + } else { + if (\PHP_VERSION_ID >= 70000) { + // use PHP 7 null coalescing operator + $compiler + ->raw('($context[') + ->string($name) + ->raw('] ?? ') + ; + + if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { + $compiler->raw('null)'); + } else { + $compiler->raw('$this->getContext($context, ')->string($name)->raw('))'); + } + } elseif (\PHP_VERSION_ID >= 50400) { + // PHP 5.4 ternary operator performance was optimized + $compiler + ->raw('(isset($context[') + ->string($name) + ->raw(']) ? $context[') + ->string($name) + ->raw('] : ') + ; + + if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) { + $compiler->raw('null)'); + } else { + $compiler->raw('$this->getContext($context, ')->string($name)->raw('))'); + } + } else { + $compiler + ->raw('$this->getContext($context, ') + ->string($name) + ; + + if ($this->getAttribute('ignore_strict_check')) { + $compiler->raw(', true'); + } + + $compiler + ->raw(')') + ; + } + } + } + + public function isSpecial() + { + return isset($this->specialVars[$this->getAttribute('name')]); + } + + public function isSimple() + { + return !$this->isSpecial() && !$this->getAttribute('is_defined_test'); + } +} + +class_alias('Twig\Node\Expression\NameExpression', 'Twig_Node_Expression_Name'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php new file mode 100755 index 0000000..917d31a --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/NullCoalesceExpression.php @@ -0,0 +1,62 @@ +getTemplateLine()); + // for "block()", we don't need the null test as the return value is always a string + if (!$left instanceof BlockReferenceExpression) { + $test = new AndBinary( + $test, + new NotUnary(new NullTest($left, 'null', new Node(), $left->getTemplateLine()), $left->getTemplateLine()), + $left->getTemplateLine() + ); + } + + parent::__construct($test, $left, $right, $lineno); + } + + public function compile(Compiler $compiler) + { + /* + * This optimizes only one case. PHP 7 also supports more complex expressions + * that can return null. So, for instance, if log is defined, log("foo") ?? "..." works, + * but log($a["foo"]) ?? "..." does not if $a["foo"] is not defined. More advanced + * cases might be implemented as an optimizer node visitor, but has not been done + * as benefits are probably not worth the added complexity. + */ + if (\PHP_VERSION_ID >= 70000 && $this->getNode('expr2') instanceof NameExpression) { + $this->getNode('expr2')->setAttribute('always_defined', true); + $compiler + ->raw('((') + ->subcompile($this->getNode('expr2')) + ->raw(') ?? (') + ->subcompile($this->getNode('expr3')) + ->raw('))') + ; + } else { + parent::compile($compiler); + } + } +} + +class_alias('Twig\Node\Expression\NullCoalesceExpression', 'Twig_Node_Expression_NullCoalesce'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ParentExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ParentExpression.php new file mode 100755 index 0000000..1247283 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/ParentExpression.php @@ -0,0 +1,48 @@ + + */ +class ParentExpression extends AbstractExpression +{ + public function __construct($name, $lineno, $tag = null) + { + parent::__construct([], ['output' => false, 'name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + if ($this->getAttribute('output')) { + $compiler + ->addDebugInfo($this) + ->write('$this->displayParentBlock(') + ->string($this->getAttribute('name')) + ->raw(", \$context, \$blocks);\n") + ; + } else { + $compiler + ->raw('$this->renderParentBlock(') + ->string($this->getAttribute('name')) + ->raw(', $context, $blocks)') + ; + } + } +} + +class_alias('Twig\Node\Expression\ParentExpression', 'Twig_Node_Expression_Parent'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/TempNameExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/TempNameExpression.php new file mode 100755 index 0000000..ce0a158 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/TempNameExpression.php @@ -0,0 +1,33 @@ + $name], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->raw('$_') + ->raw($this->getAttribute('name')) + ->raw('_') + ; + } +} + +class_alias('Twig\Node\Expression\TempNameExpression', 'Twig_Node_Expression_TempName'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php new file mode 100755 index 0000000..78353a8 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/ConstantTest.php @@ -0,0 +1,51 @@ + + */ +class ConstantTest extends TestExpression +{ + public function compile(Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' === constant(') + ; + + if ($this->getNode('arguments')->hasNode(1)) { + $compiler + ->raw('get_class(') + ->subcompile($this->getNode('arguments')->getNode(1)) + ->raw(')."::".') + ; + } + + $compiler + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw('))') + ; + } +} + +class_alias('Twig\Node\Expression\Test\ConstantTest', 'Twig_Node_Expression_Test_Constant'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php new file mode 100755 index 0000000..2222e11 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/DefinedTest.php @@ -0,0 +1,71 @@ + + */ +class DefinedTest extends TestExpression +{ + public function __construct(\Twig_NodeInterface $node, $name, \Twig_NodeInterface $arguments = null, $lineno) + { + if ($node instanceof NameExpression) { + $node->setAttribute('is_defined_test', true); + } elseif ($node instanceof GetAttrExpression) { + $node->setAttribute('is_defined_test', true); + $this->changeIgnoreStrictCheck($node); + } elseif ($node instanceof BlockReferenceExpression) { + $node->setAttribute('is_defined_test', true); + } elseif ($node instanceof FunctionExpression && 'constant' === $node->getAttribute('name')) { + $node->setAttribute('is_defined_test', true); + } elseif ($node instanceof ConstantExpression || $node instanceof ArrayExpression) { + $node = new ConstantExpression(true, $node->getTemplateLine()); + } else { + throw new SyntaxError('The "defined" test only works with simple variables.', $lineno); + } + + parent::__construct($node, $name, $arguments, $lineno); + } + + protected function changeIgnoreStrictCheck(GetAttrExpression $node) + { + $node->setAttribute('ignore_strict_check', true); + + if ($node->getNode('node') instanceof GetAttrExpression) { + $this->changeIgnoreStrictCheck($node->getNode('node')); + } + } + + public function compile(Compiler $compiler) + { + $compiler->subcompile($this->getNode('node')); + } +} + +class_alias('Twig\Node\Expression\Test\DefinedTest', 'Twig_Node_Expression_Test_Defined'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php new file mode 100755 index 0000000..05c8ad8 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/DivisiblebyTest.php @@ -0,0 +1,38 @@ + + */ +class DivisiblebyTest extends TestExpression +{ + public function compile(Compiler $compiler) + { + $compiler + ->raw('(0 == ') + ->subcompile($this->getNode('node')) + ->raw(' % ') + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw(')') + ; + } +} + +class_alias('Twig\Node\Expression\Test\DivisiblebyTest', 'Twig_Node_Expression_Test_Divisibleby'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php new file mode 100755 index 0000000..3b955d2 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/EvenTest.php @@ -0,0 +1,37 @@ + + */ +class EvenTest extends TestExpression +{ + public function compile(Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' % 2 == 0') + ->raw(')') + ; + } +} + +class_alias('Twig\Node\Expression\Test\EvenTest', 'Twig_Node_Expression_Test_Even'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/NullTest.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/NullTest.php new file mode 100755 index 0000000..24d3997 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/NullTest.php @@ -0,0 +1,36 @@ + + */ +class NullTest extends TestExpression +{ + public function compile(Compiler $compiler) + { + $compiler + ->raw('(null === ') + ->subcompile($this->getNode('node')) + ->raw(')') + ; + } +} + +class_alias('Twig\Node\Expression\Test\NullTest', 'Twig_Node_Expression_Test_Null'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/OddTest.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/OddTest.php new file mode 100755 index 0000000..2dc693a --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/OddTest.php @@ -0,0 +1,37 @@ + + */ +class OddTest extends TestExpression +{ + public function compile(Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' % 2 == 1') + ->raw(')') + ; + } +} + +class_alias('Twig\Node\Expression\Test\OddTest', 'Twig_Node_Expression_Test_Odd'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php new file mode 100755 index 0000000..75f2b82 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Test/SameasTest.php @@ -0,0 +1,36 @@ + + */ +class SameasTest extends TestExpression +{ + public function compile(Compiler $compiler) + { + $compiler + ->raw('(') + ->subcompile($this->getNode('node')) + ->raw(' === ') + ->subcompile($this->getNode('arguments')->getNode(0)) + ->raw(')') + ; + } +} + +class_alias('Twig\Node\Expression\Test\SameasTest', 'Twig_Node_Expression_Test_Sameas'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/TestExpression.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/TestExpression.php new file mode 100755 index 0000000..8fc31d3 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/TestExpression.php @@ -0,0 +1,51 @@ + $node]; + if (null !== $arguments) { + $nodes['arguments'] = $arguments; + } + + parent::__construct($nodes, ['name' => $name], $lineno); + } + + public function compile(Compiler $compiler) + { + $name = $this->getAttribute('name'); + $test = $compiler->getEnvironment()->getTest($name); + + $this->setAttribute('name', $name); + $this->setAttribute('type', 'test'); + $this->setAttribute('thing', $test); + if ($test instanceof TwigTest) { + $this->setAttribute('arguments', $test->getArguments()); + } + if ($test instanceof \Twig_TestCallableInterface || $test instanceof TwigTest) { + $this->setAttribute('callable', $test->getCallable()); + } + if ($test instanceof TwigTest) { + $this->setAttribute('is_variadic', $test->isVariadic()); + } + + $this->compileCallable($compiler); + } +} + +class_alias('Twig\Node\Expression\TestExpression', 'Twig_Node_Expression_Test'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php new file mode 100755 index 0000000..415c3d4 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/AbstractUnary.php @@ -0,0 +1,35 @@ + $node], [], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler->raw(' '); + $this->operator($compiler); + $compiler->subcompile($this->getNode('node')); + } + + abstract public function operator(Compiler $compiler); +} + +class_alias('Twig\Node\Expression\Unary\AbstractUnary', 'Twig_Node_Expression_Unary'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php new file mode 100755 index 0000000..dfb6f54 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/NegUnary.php @@ -0,0 +1,25 @@ +raw('-'); + } +} + +class_alias('Twig\Node\Expression\Unary\NegUnary', 'Twig_Node_Expression_Unary_Neg'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php new file mode 100755 index 0000000..7bdde96 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/NotUnary.php @@ -0,0 +1,25 @@ +raw('!'); + } +} + +class_alias('Twig\Node\Expression\Unary\NotUnary', 'Twig_Node_Expression_Unary_Not'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php new file mode 100755 index 0000000..52d5d0c --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Expression/Unary/PosUnary.php @@ -0,0 +1,25 @@ +raw('+'); + } +} + +class_alias('Twig\Node\Expression\Unary\PosUnary', 'Twig_Node_Expression_Unary_Pos'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/FlushNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/FlushNode.php new file mode 100755 index 0000000..6cbc489 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/FlushNode.php @@ -0,0 +1,37 @@ + + */ +class FlushNode extends Node +{ + public function __construct($lineno, $tag) + { + parent::__construct([], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("flush();\n") + ; + } +} + +class_alias('Twig\Node\FlushNode', 'Twig_Node_Flush'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/ForLoopNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/ForLoopNode.php new file mode 100755 index 0000000..3902093 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/ForLoopNode.php @@ -0,0 +1,56 @@ + + */ +class ForLoopNode extends Node +{ + public function __construct($lineno, $tag = null) + { + parent::__construct([], ['with_loop' => false, 'ifexpr' => false, 'else' => false], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + if ($this->getAttribute('else')) { + $compiler->write("\$context['_iterated'] = true;\n"); + } + + if ($this->getAttribute('with_loop')) { + $compiler + ->write("++\$context['loop']['index0'];\n") + ->write("++\$context['loop']['index'];\n") + ->write("\$context['loop']['first'] = false;\n") + ; + + if (!$this->getAttribute('ifexpr')) { + $compiler + ->write("if (isset(\$context['loop']['length'])) {\n") + ->indent() + ->write("--\$context['loop']['revindex0'];\n") + ->write("--\$context['loop']['revindex'];\n") + ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n") + ->outdent() + ->write("}\n") + ; + } + } + } +} + +class_alias('Twig\Node\ForLoopNode', 'Twig_Node_ForLoop'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/ForNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/ForNode.php new file mode 100755 index 0000000..49409a3 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/ForNode.php @@ -0,0 +1,119 @@ + + */ +class ForNode extends Node +{ + protected $loop; + + public function __construct(AssignNameExpression $keyTarget, AssignNameExpression $valueTarget, AbstractExpression $seq, AbstractExpression $ifexpr = null, \Twig_NodeInterface $body, \Twig_NodeInterface $else = null, $lineno, $tag = null) + { + $body = new Node([$body, $this->loop = new ForLoopNode($lineno, $tag)]); + + if (null !== $ifexpr) { + $body = new IfNode(new Node([$ifexpr, $body]), null, $lineno, $tag); + } + + $nodes = ['key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body]; + if (null !== $else) { + $nodes['else'] = $else; + } + + parent::__construct($nodes, ['with_loop' => true, 'ifexpr' => null !== $ifexpr], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("\$context['_parent'] = \$context;\n") + ->write("\$context['_seq'] = twig_ensure_traversable(") + ->subcompile($this->getNode('seq')) + ->raw(");\n") + ; + + if ($this->hasNode('else')) { + $compiler->write("\$context['_iterated'] = false;\n"); + } + + if ($this->getAttribute('with_loop')) { + $compiler + ->write("\$context['loop'] = [\n") + ->write(" 'parent' => \$context['_parent'],\n") + ->write(" 'index0' => 0,\n") + ->write(" 'index' => 1,\n") + ->write(" 'first' => true,\n") + ->write("];\n") + ; + + if (!$this->getAttribute('ifexpr')) { + $compiler + ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof \Countable)) {\n") + ->indent() + ->write("\$length = count(\$context['_seq']);\n") + ->write("\$context['loop']['revindex0'] = \$length - 1;\n") + ->write("\$context['loop']['revindex'] = \$length;\n") + ->write("\$context['loop']['length'] = \$length;\n") + ->write("\$context['loop']['last'] = 1 === \$length;\n") + ->outdent() + ->write("}\n") + ; + } + } + + $this->loop->setAttribute('else', $this->hasNode('else')); + $this->loop->setAttribute('with_loop', $this->getAttribute('with_loop')); + $this->loop->setAttribute('ifexpr', $this->getAttribute('ifexpr')); + + $compiler + ->write("foreach (\$context['_seq'] as ") + ->subcompile($this->getNode('key_target')) + ->raw(' => ') + ->subcompile($this->getNode('value_target')) + ->raw(") {\n") + ->indent() + ->subcompile($this->getNode('body')) + ->outdent() + ->write("}\n") + ; + + if ($this->hasNode('else')) { + $compiler + ->write("if (!\$context['_iterated']) {\n") + ->indent() + ->subcompile($this->getNode('else')) + ->outdent() + ->write("}\n") + ; + } + + $compiler->write("\$_parent = \$context['_parent'];\n"); + + // remove some "private" loop variables (needed for nested loops) + $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n"); + + // keep the values set in the inner context for variables defined in the outer context + $compiler->write("\$context = array_intersect_key(\$context, \$_parent) + \$_parent;\n"); + } +} + +class_alias('Twig\Node\ForNode', 'Twig_Node_For'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/IfNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/IfNode.php new file mode 100755 index 0000000..4836d91 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/IfNode.php @@ -0,0 +1,72 @@ + + */ +class IfNode extends Node +{ + public function __construct(\Twig_NodeInterface $tests, \Twig_NodeInterface $else = null, $lineno, $tag = null) + { + $nodes = ['tests' => $tests]; + if (null !== $else) { + $nodes['else'] = $else; + } + + parent::__construct($nodes, [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + for ($i = 0, $count = \count($this->getNode('tests')); $i < $count; $i += 2) { + if ($i > 0) { + $compiler + ->outdent() + ->write('} elseif (') + ; + } else { + $compiler + ->write('if (') + ; + } + + $compiler + ->subcompile($this->getNode('tests')->getNode($i)) + ->raw(") {\n") + ->indent() + ->subcompile($this->getNode('tests')->getNode($i + 1)) + ; + } + + if ($this->hasNode('else')) { + $compiler + ->outdent() + ->write("} else {\n") + ->indent() + ->subcompile($this->getNode('else')) + ; + } + + $compiler + ->outdent() + ->write("}\n"); + } +} + +class_alias('Twig\Node\IfNode', 'Twig_Node_If'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/ImportNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/ImportNode.php new file mode 100755 index 0000000..236db89 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/ImportNode.php @@ -0,0 +1,57 @@ + + */ +class ImportNode extends Node +{ + public function __construct(AbstractExpression $expr, AbstractExpression $var, $lineno, $tag = null) + { + parent::__construct(['expr' => $expr, 'var' => $var], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('') + ->subcompile($this->getNode('var')) + ->raw(' = ') + ; + + if ($this->getNode('expr') instanceof NameExpression && '_self' === $this->getNode('expr')->getAttribute('name')) { + $compiler->raw('$this'); + } else { + $compiler + ->raw('$this->loadTemplate(') + ->subcompile($this->getNode('expr')) + ->raw(', ') + ->repr($this->getTemplateName()) + ->raw(', ') + ->repr($this->getTemplateLine()) + ->raw(')->unwrap()') + ; + } + + $compiler->raw(";\n"); + } +} + +class_alias('Twig\Node\ImportNode', 'Twig_Node_Import'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/IncludeNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/IncludeNode.php new file mode 100755 index 0000000..544db81 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/IncludeNode.php @@ -0,0 +1,108 @@ + + */ +class IncludeNode extends Node implements NodeOutputInterface +{ + public function __construct(AbstractExpression $expr, AbstractExpression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null) + { + $nodes = ['expr' => $expr]; + if (null !== $variables) { + $nodes['variables'] = $variables; + } + + parent::__construct($nodes, ['only' => (bool) $only, 'ignore_missing' => (bool) $ignoreMissing], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if ($this->getAttribute('ignore_missing')) { + $template = $compiler->getVarName(); + + $compiler + ->write(sprintf("$%s = null;\n", $template)) + ->write("try {\n") + ->indent() + ->write(sprintf('$%s = ', $template)) + ; + + $this->addGetTemplate($compiler); + + $compiler + ->raw(";\n") + ->outdent() + ->write("} catch (LoaderError \$e) {\n") + ->indent() + ->write("// ignore missing template\n") + ->outdent() + ->write("}\n") + ->write(sprintf("if ($%s) {\n", $template)) + ->indent() + ->write(sprintf('$%s->display(', $template)) + ; + $this->addTemplateArguments($compiler); + $compiler + ->raw(");\n") + ->outdent() + ->write("}\n") + ; + } else { + $this->addGetTemplate($compiler); + $compiler->raw('->display('); + $this->addTemplateArguments($compiler); + $compiler->raw(");\n"); + } + } + + protected function addGetTemplate(Compiler $compiler) + { + $compiler + ->write('$this->loadTemplate(') + ->subcompile($this->getNode('expr')) + ->raw(', ') + ->repr($this->getTemplateName()) + ->raw(', ') + ->repr($this->getTemplateLine()) + ->raw(')') + ; + } + + protected function addTemplateArguments(Compiler $compiler) + { + if (!$this->hasNode('variables')) { + $compiler->raw(false === $this->getAttribute('only') ? '$context' : '[]'); + } elseif (false === $this->getAttribute('only')) { + $compiler + ->raw('twig_array_merge($context, ') + ->subcompile($this->getNode('variables')) + ->raw(')') + ; + } else { + $compiler->raw('twig_to_array('); + $compiler->subcompile($this->getNode('variables')); + $compiler->raw(')'); + } + } +} + +class_alias('Twig\Node\IncludeNode', 'Twig_Node_Include'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/MacroNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/MacroNode.php new file mode 100755 index 0000000..6eb6795 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/MacroNode.php @@ -0,0 +1,136 @@ + + */ +class MacroNode extends Node +{ + const VARARGS_NAME = 'varargs'; + + public function __construct($name, \Twig_NodeInterface $body, \Twig_NodeInterface $arguments, $lineno, $tag = null) + { + foreach ($arguments as $argumentName => $argument) { + if (self::VARARGS_NAME === $argumentName) { + throw new SyntaxError(sprintf('The argument "%s" in macro "%s" cannot be defined because the variable "%s" is reserved for arbitrary arguments.', self::VARARGS_NAME, $name, self::VARARGS_NAME), $argument->getTemplateLine(), $argument->getSourceContext()); + } + } + + parent::__construct(['body' => $body, 'arguments' => $arguments], ['name' => $name], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write(sprintf('public function get%s(', $this->getAttribute('name'))) + ; + + $count = \count($this->getNode('arguments')); + $pos = 0; + foreach ($this->getNode('arguments') as $name => $default) { + $compiler + ->raw('$__'.$name.'__ = ') + ->subcompile($default) + ; + + if (++$pos < $count) { + $compiler->raw(', '); + } + } + + if (\PHP_VERSION_ID >= 50600) { + if ($count) { + $compiler->raw(', '); + } + + $compiler->raw('...$__varargs__'); + } + + $compiler + ->raw(")\n") + ->write("{\n") + ->indent() + ; + + $compiler + ->write("\$context = \$this->env->mergeGlobals([\n") + ->indent() + ; + + foreach ($this->getNode('arguments') as $name => $default) { + $compiler + ->write('') + ->string($name) + ->raw(' => $__'.$name.'__') + ->raw(",\n") + ; + } + + $compiler + ->write('') + ->string(self::VARARGS_NAME) + ->raw(' => ') + ; + + if (\PHP_VERSION_ID >= 50600) { + $compiler->raw("\$__varargs__,\n"); + } else { + $compiler + ->raw('func_num_args() > ') + ->repr($count) + ->raw(' ? array_slice(func_get_args(), ') + ->repr($count) + ->raw(") : [],\n") + ; + } + + $compiler + ->outdent() + ->write("]);\n\n") + ->write("\$blocks = [];\n\n") + ; + if ($compiler->getEnvironment()->isDebug()) { + $compiler->write("ob_start();\n"); + } else { + $compiler->write("ob_start(function () { return ''; });\n"); + } + $compiler + ->write("try {\n") + ->indent() + ->subcompile($this->getNode('body')) + ->outdent() + ->write("} catch (\Exception \$e) {\n") + ->indent() + ->write("ob_end_clean();\n\n") + ->write("throw \$e;\n") + ->outdent() + ->write("} catch (\Throwable \$e) {\n") + ->indent() + ->write("ob_end_clean();\n\n") + ->write("throw \$e;\n") + ->outdent() + ->write("}\n\n") + ->write("return ('' === \$tmp = ob_get_clean()) ? '' : new Markup(\$tmp, \$this->env->getCharset());\n") + ->outdent() + ->write("}\n\n") + ; + } +} + +class_alias('Twig\Node\MacroNode', 'Twig_Node_Macro'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/ModuleNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/ModuleNode.php new file mode 100755 index 0000000..aab2aa3 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/ModuleNode.php @@ -0,0 +1,492 @@ + + */ +class ModuleNode extends Node +{ + public function __construct(\Twig_NodeInterface $body, AbstractExpression $parent = null, \Twig_NodeInterface $blocks, \Twig_NodeInterface $macros, \Twig_NodeInterface $traits, $embeddedTemplates, $name, $source = '') + { + if (!$name instanceof Source) { + @trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + $source = new Source($source, $name); + } else { + $source = $name; + } + + $nodes = [ + 'body' => $body, + 'blocks' => $blocks, + 'macros' => $macros, + 'traits' => $traits, + 'display_start' => new Node(), + 'display_end' => new Node(), + 'constructor_start' => new Node(), + 'constructor_end' => new Node(), + 'class_end' => new Node(), + ]; + if (null !== $parent) { + $nodes['parent'] = $parent; + } + + // embedded templates are set as attributes so that they are only visited once by the visitors + parent::__construct($nodes, [ + // source to be remove in 2.0 + 'source' => $source->getCode(), + // filename to be remove in 2.0 (use getTemplateName() instead) + 'filename' => $source->getName(), + 'index' => null, + 'embedded_templates' => $embeddedTemplates, + ], 1); + + // populate the template name of all node children + $this->setTemplateName($source->getName()); + $this->setSourceContext($source); + } + + public function setIndex($index) + { + $this->setAttribute('index', $index); + } + + public function compile(Compiler $compiler) + { + $this->compileTemplate($compiler); + + foreach ($this->getAttribute('embedded_templates') as $template) { + $compiler->subcompile($template); + } + } + + protected function compileTemplate(Compiler $compiler) + { + if (!$this->getAttribute('index')) { + $compiler->write('compileClassHeader($compiler); + + if ( + \count($this->getNode('blocks')) + || \count($this->getNode('traits')) + || !$this->hasNode('parent') + || $this->getNode('parent') instanceof ConstantExpression + || \count($this->getNode('constructor_start')) + || \count($this->getNode('constructor_end')) + ) { + $this->compileConstructor($compiler); + } + + $this->compileGetParent($compiler); + + $this->compileDisplay($compiler); + + $compiler->subcompile($this->getNode('blocks')); + + $this->compileMacros($compiler); + + $this->compileGetTemplateName($compiler); + + $this->compileIsTraitable($compiler); + + $this->compileDebugInfo($compiler); + + $this->compileGetSource($compiler); + + $this->compileGetSourceContext($compiler); + + $this->compileClassFooter($compiler); + } + + protected function compileGetParent(Compiler $compiler) + { + if (!$this->hasNode('parent')) { + return; + } + $parent = $this->getNode('parent'); + + $compiler + ->write("protected function doGetParent(array \$context)\n", "{\n") + ->indent() + ->addDebugInfo($parent) + ->write('return ') + ; + + if ($parent instanceof ConstantExpression) { + $compiler->subcompile($parent); + } else { + $compiler + ->raw('$this->loadTemplate(') + ->subcompile($parent) + ->raw(', ') + ->repr($this->getSourceContext()->getName()) + ->raw(', ') + ->repr($parent->getTemplateLine()) + ->raw(')') + ; + } + + $compiler + ->raw(";\n") + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileClassHeader(Compiler $compiler) + { + $compiler + ->write("\n\n") + ; + if (!$this->getAttribute('index')) { + $compiler + ->write("use Twig\Environment;\n") + ->write("use Twig\Error\LoaderError;\n") + ->write("use Twig\Error\RuntimeError;\n") + ->write("use Twig\Markup;\n") + ->write("use Twig\Sandbox\SecurityError;\n") + ->write("use Twig\Sandbox\SecurityNotAllowedTagError;\n") + ->write("use Twig\Sandbox\SecurityNotAllowedFilterError;\n") + ->write("use Twig\Sandbox\SecurityNotAllowedFunctionError;\n") + ->write("use Twig\Source;\n") + ->write("use Twig\Template;\n\n") + ; + } + $compiler + // if the template name contains */, add a blank to avoid a PHP parse error + ->write('/* '.str_replace('*/', '* /', $this->getSourceContext()->getName())." */\n") + ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getSourceContext()->getName(), $this->getAttribute('index'))) + ->raw(sprintf(" extends %s\n", $compiler->getEnvironment()->getBaseTemplateClass())) + ->write("{\n") + ->indent() + ; + } + + protected function compileConstructor(Compiler $compiler) + { + $compiler + ->write("public function __construct(Environment \$env)\n", "{\n") + ->indent() + ->subcompile($this->getNode('constructor_start')) + ->write("parent::__construct(\$env);\n\n") + ; + + // parent + if (!$this->hasNode('parent')) { + $compiler->write("\$this->parent = false;\n\n"); + } + + $countTraits = \count($this->getNode('traits')); + if ($countTraits) { + // traits + foreach ($this->getNode('traits') as $i => $trait) { + $this->compileLoadTemplate($compiler, $trait->getNode('template'), sprintf('$_trait_%s', $i)); + + $node = $trait->getNode('template'); + $compiler + ->addDebugInfo($node) + ->write(sprintf("if (!\$_trait_%s->isTraitable()) {\n", $i)) + ->indent() + ->write("throw new RuntimeError('Template \"'.") + ->subcompile($trait->getNode('template')) + ->raw(".'\" cannot be used as a trait.', ") + ->repr($node->getTemplateLine()) + ->raw(", \$this->getSourceContext());\n") + ->outdent() + ->write("}\n") + ->write(sprintf("\$_trait_%s_blocks = \$_trait_%s->getBlocks();\n\n", $i, $i)) + ; + + foreach ($trait->getNode('targets') as $key => $value) { + $compiler + ->write(sprintf('if (!isset($_trait_%s_blocks[', $i)) + ->string($key) + ->raw("])) {\n") + ->indent() + ->write("throw new RuntimeError(sprintf('Block ") + ->string($key) + ->raw(' is not defined in trait ') + ->subcompile($trait->getNode('template')) + ->raw(".'), ") + ->repr($node->getTemplateLine()) + ->raw(", \$this->getSourceContext());\n") + ->outdent() + ->write("}\n\n") + + ->write(sprintf('$_trait_%s_blocks[', $i)) + ->subcompile($value) + ->raw(sprintf('] = $_trait_%s_blocks[', $i)) + ->string($key) + ->raw(sprintf(']; unset($_trait_%s_blocks[', $i)) + ->string($key) + ->raw("]);\n\n") + ; + } + } + + if ($countTraits > 1) { + $compiler + ->write("\$this->traits = array_merge(\n") + ->indent() + ; + + for ($i = 0; $i < $countTraits; ++$i) { + $compiler + ->write(sprintf('$_trait_%s_blocks'.($i == $countTraits - 1 ? '' : ',')."\n", $i)) + ; + } + + $compiler + ->outdent() + ->write(");\n\n") + ; + } else { + $compiler + ->write("\$this->traits = \$_trait_0_blocks;\n\n") + ; + } + + $compiler + ->write("\$this->blocks = array_merge(\n") + ->indent() + ->write("\$this->traits,\n") + ->write("[\n") + ; + } else { + $compiler + ->write("\$this->blocks = [\n") + ; + } + + // blocks + $compiler + ->indent() + ; + + foreach ($this->getNode('blocks') as $name => $node) { + $compiler + ->write(sprintf("'%s' => [\$this, 'block_%s'],\n", $name, $name)) + ; + } + + if ($countTraits) { + $compiler + ->outdent() + ->write("]\n") + ->outdent() + ->write(");\n") + ; + } else { + $compiler + ->outdent() + ->write("];\n") + ; + } + + $compiler + ->subcompile($this->getNode('constructor_end')) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileDisplay(Compiler $compiler) + { + $compiler + ->write("protected function doDisplay(array \$context, array \$blocks = [])\n", "{\n") + ->indent() + ->subcompile($this->getNode('display_start')) + ->subcompile($this->getNode('body')) + ; + + if ($this->hasNode('parent')) { + $parent = $this->getNode('parent'); + + $compiler->addDebugInfo($parent); + if ($parent instanceof ConstantExpression) { + $compiler + ->write('$this->parent = $this->loadTemplate(') + ->subcompile($parent) + ->raw(', ') + ->repr($this->getSourceContext()->getName()) + ->raw(', ') + ->repr($parent->getTemplateLine()) + ->raw(");\n") + ; + $compiler->write('$this->parent'); + } else { + $compiler->write('$this->getParent($context)'); + } + $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n"); + } + + $compiler + ->subcompile($this->getNode('display_end')) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileClassFooter(Compiler $compiler) + { + $compiler + ->subcompile($this->getNode('class_end')) + ->outdent() + ->write("}\n") + ; + } + + protected function compileMacros(Compiler $compiler) + { + $compiler->subcompile($this->getNode('macros')); + } + + protected function compileGetTemplateName(Compiler $compiler) + { + $compiler + ->write("public function getTemplateName()\n", "{\n") + ->indent() + ->write('return ') + ->repr($this->getSourceContext()->getName()) + ->raw(";\n") + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileIsTraitable(Compiler $compiler) + { + // A template can be used as a trait if: + // * it has no parent + // * it has no macros + // * it has no body + // + // Put another way, a template can be used as a trait if it + // only contains blocks and use statements. + $traitable = !$this->hasNode('parent') && 0 === \count($this->getNode('macros')); + if ($traitable) { + if ($this->getNode('body') instanceof BodyNode) { + $nodes = $this->getNode('body')->getNode(0); + } else { + $nodes = $this->getNode('body'); + } + + if (!\count($nodes)) { + $nodes = new Node([$nodes]); + } + + foreach ($nodes as $node) { + if (!\count($node)) { + continue; + } + + if ($node instanceof TextNode && ctype_space($node->getAttribute('data'))) { + continue; + } + + if ($node instanceof BlockReferenceNode) { + continue; + } + + $traitable = false; + break; + } + } + + if ($traitable) { + return; + } + + $compiler + ->write("public function isTraitable()\n", "{\n") + ->indent() + ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false')) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileDebugInfo(Compiler $compiler) + { + $compiler + ->write("public function getDebugInfo()\n", "{\n") + ->indent() + ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true)))) + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileGetSource(Compiler $compiler) + { + $compiler + ->write("/** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */\n") + ->write("public function getSource()\n", "{\n") + ->indent() + ->write("@trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);\n\n") + ->write('return $this->getSourceContext()->getCode();') + ->raw("\n") + ->outdent() + ->write("}\n\n") + ; + } + + protected function compileGetSourceContext(Compiler $compiler) + { + $compiler + ->write("public function getSourceContext()\n", "{\n") + ->indent() + ->write('return new Source(') + ->string($compiler->getEnvironment()->isDebug() ? $this->getSourceContext()->getCode() : '') + ->raw(', ') + ->string($this->getSourceContext()->getName()) + ->raw(', ') + ->string($this->getSourceContext()->getPath()) + ->raw(");\n") + ->outdent() + ->write("}\n") + ; + } + + protected function compileLoadTemplate(Compiler $compiler, $node, $var) + { + if ($node instanceof ConstantExpression) { + $compiler + ->write(sprintf('%s = $this->loadTemplate(', $var)) + ->subcompile($node) + ->raw(', ') + ->repr($node->getTemplateName()) + ->raw(', ') + ->repr($node->getTemplateLine()) + ->raw(");\n") + ; + } else { + throw new \LogicException('Trait templates can only be constant nodes.'); + } + } +} + +class_alias('Twig\Node\ModuleNode', 'Twig_Node_Module'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/Node.php b/phpMyAdmin/vendor/twig/twig/src/Node/Node.php new file mode 100755 index 0000000..c890feb --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/Node.php @@ -0,0 +1,274 @@ + + */ +class Node implements \Twig_NodeInterface +{ + protected $nodes; + protected $attributes; + protected $lineno; + protected $tag; + + private $name; + private $sourceContext; + + /** + * @param array $nodes An array of named nodes + * @param array $attributes An array of attributes (should not be nodes) + * @param int $lineno The line number + * @param string $tag The tag name associated with the Node + */ + public function __construct(array $nodes = [], array $attributes = [], $lineno = 0, $tag = null) + { + foreach ($nodes as $name => $node) { + if (!$node instanceof \Twig_NodeInterface) { + @trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, \get_class($this)), E_USER_DEPRECATED); + } + } + $this->nodes = $nodes; + $this->attributes = $attributes; + $this->lineno = $lineno; + $this->tag = $tag; + } + + public function __toString() + { + $attributes = []; + foreach ($this->attributes as $name => $value) { + $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true))); + } + + $repr = [\get_class($this).'('.implode(', ', $attributes)]; + + if (\count($this->nodes)) { + foreach ($this->nodes as $name => $node) { + $len = \strlen($name) + 4; + $noderepr = []; + foreach (explode("\n", (string) $node) as $line) { + $noderepr[] = str_repeat(' ', $len).$line; + } + + $repr[] = sprintf(' %s: %s', $name, ltrim(implode("\n", $noderepr))); + } + + $repr[] = ')'; + } else { + $repr[0] .= ')'; + } + + return implode("\n", $repr); + } + + /** + * @deprecated since 1.16.1 (to be removed in 2.0) + */ + public function toXml($asDom = false) + { + @trigger_error(sprintf('%s is deprecated since version 1.16.1 and will be removed in 2.0.', __METHOD__), E_USER_DEPRECATED); + + $dom = new \DOMDocument('1.0', 'UTF-8'); + $dom->formatOutput = true; + $dom->appendChild($xml = $dom->createElement('twig')); + + $xml->appendChild($node = $dom->createElement('node')); + $node->setAttribute('class', \get_class($this)); + + foreach ($this->attributes as $name => $value) { + $node->appendChild($attribute = $dom->createElement('attribute')); + $attribute->setAttribute('name', $name); + $attribute->appendChild($dom->createTextNode($value)); + } + + foreach ($this->nodes as $name => $n) { + if (null === $n) { + continue; + } + + $child = $n->toXml(true)->getElementsByTagName('node')->item(0); + $child = $dom->importNode($child, true); + $child->setAttribute('name', $name); + + $node->appendChild($child); + } + + return $asDom ? $dom : $dom->saveXML(); + } + + public function compile(Compiler $compiler) + { + foreach ($this->nodes as $node) { + $node->compile($compiler); + } + } + + public function getTemplateLine() + { + return $this->lineno; + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getLine() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateLine() instead.', E_USER_DEPRECATED); + + return $this->lineno; + } + + public function getNodeTag() + { + return $this->tag; + } + + /** + * @return bool + */ + public function hasAttribute($name) + { + return \array_key_exists($name, $this->attributes); + } + + /** + * @return mixed + */ + public function getAttribute($name) + { + if (!\array_key_exists($name, $this->attributes)) { + throw new \LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, \get_class($this))); + } + + return $this->attributes[$name]; + } + + /** + * @param string $name + * @param mixed $value + */ + public function setAttribute($name, $value) + { + $this->attributes[$name] = $value; + } + + public function removeAttribute($name) + { + unset($this->attributes[$name]); + } + + /** + * @return bool + */ + public function hasNode($name) + { + return \array_key_exists($name, $this->nodes); + } + + /** + * @return Node + */ + public function getNode($name) + { + if (!\array_key_exists($name, $this->nodes)) { + throw new \LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, \get_class($this))); + } + + return $this->nodes[$name]; + } + + public function setNode($name, $node = null) + { + if (!$node instanceof \Twig_NodeInterface) { + @trigger_error(sprintf('Using "%s" for the value of node "%s" of "%s" is deprecated since version 1.25 and will be removed in 2.0.', \is_object($node) ? \get_class($node) : (null === $node ? 'null' : \gettype($node)), $name, \get_class($this)), E_USER_DEPRECATED); + } + + $this->nodes[$name] = $node; + } + + public function removeNode($name) + { + unset($this->nodes[$name]); + } + + public function count() + { + return \count($this->nodes); + } + + public function getIterator() + { + return new \ArrayIterator($this->nodes); + } + + public function setTemplateName($name) + { + $this->name = $name; + foreach ($this->nodes as $node) { + if (null !== $node) { + $node->setTemplateName($name); + } + } + } + + public function getTemplateName() + { + return $this->name; + } + + public function setSourceContext(Source $source) + { + $this->sourceContext = $source; + foreach ($this->nodes as $node) { + if ($node instanceof Node) { + $node->setSourceContext($source); + } + } + } + + public function getSourceContext() + { + return $this->sourceContext; + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function setFilename($name) + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use setTemplateName() instead.', E_USER_DEPRECATED); + + $this->setTemplateName($name); + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getFilename() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getTemplateName() instead.', E_USER_DEPRECATED); + + return $this->name; + } +} + +class_alias('Twig\Node\Node', 'Twig_Node'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Compiler'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/NodeCaptureInterface.php b/phpMyAdmin/vendor/twig/twig/src/Node/NodeCaptureInterface.php new file mode 100755 index 0000000..474003f --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/NodeCaptureInterface.php @@ -0,0 +1,23 @@ + + */ +interface NodeCaptureInterface +{ +} + +class_alias('Twig\Node\NodeCaptureInterface', 'Twig_NodeCaptureInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/NodeOutputInterface.php b/phpMyAdmin/vendor/twig/twig/src/Node/NodeOutputInterface.php new file mode 100755 index 0000000..8b046ee --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/NodeOutputInterface.php @@ -0,0 +1,23 @@ + + */ +interface NodeOutputInterface +{ +} + +class_alias('Twig\Node\NodeOutputInterface', 'Twig_NodeOutputInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/PrintNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/PrintNode.php new file mode 100755 index 0000000..27f1ca4 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/PrintNode.php @@ -0,0 +1,41 @@ + + */ +class PrintNode extends Node implements NodeOutputInterface +{ + public function __construct(AbstractExpression $expr, $lineno, $tag = null) + { + parent::__construct(['expr' => $expr], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('echo ') + ->subcompile($this->getNode('expr')) + ->raw(";\n") + ; + } +} + +class_alias('Twig\Node\PrintNode', 'Twig_Node_Print'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/SandboxNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/SandboxNode.php new file mode 100755 index 0000000..2d644c3 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/SandboxNode.php @@ -0,0 +1,47 @@ + + */ +class SandboxNode extends Node +{ + public function __construct(\Twig_NodeInterface $body, $lineno, $tag = null) + { + parent::__construct(['body' => $body], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write("if (!\$alreadySandboxed = \$this->sandbox->isSandboxed()) {\n") + ->indent() + ->write("\$this->sandbox->enableSandbox();\n") + ->outdent() + ->write("}\n") + ->subcompile($this->getNode('body')) + ->write("if (!\$alreadySandboxed) {\n") + ->indent() + ->write("\$this->sandbox->disableSandbox();\n") + ->outdent() + ->write("}\n") + ; + } +} + +class_alias('Twig\Node\SandboxNode', 'Twig_Node_Sandbox'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/SandboxedPrintNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/SandboxedPrintNode.php new file mode 100755 index 0000000..2359af9 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/SandboxedPrintNode.php @@ -0,0 +1,69 @@ + + */ +class SandboxedPrintNode extends PrintNode +{ + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('echo ') + ; + $expr = $this->getNode('expr'); + if ($expr instanceof ConstantExpression) { + $compiler + ->subcompile($expr) + ->raw(";\n") + ; + } else { + $compiler + ->write('$this->env->getExtension(\'\Twig\Extension\SandboxExtension\')->ensureToStringAllowed(') + ->subcompile($expr) + ->raw(");\n") + ; + } + } + + /** + * Removes node filters. + * + * This is mostly needed when another visitor adds filters (like the escaper one). + * + * @return Node + */ + protected function removeNodeFilter(Node $node) + { + if ($node instanceof FilterExpression) { + return $this->removeNodeFilter($node->getNode('node')); + } + + return $node; + } +} + +class_alias('Twig\Node\SandboxedPrintNode', 'Twig_Node_SandboxedPrint'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/SetNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/SetNode.php new file mode 100755 index 0000000..656103b --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/SetNode.php @@ -0,0 +1,107 @@ + + */ +class SetNode extends Node implements NodeCaptureInterface +{ + public function __construct($capture, \Twig_NodeInterface $names, \Twig_NodeInterface $values, $lineno, $tag = null) + { + parent::__construct(['names' => $names, 'values' => $values], ['capture' => $capture, 'safe' => false], $lineno, $tag); + + /* + * Optimizes the node when capture is used for a large block of text. + * + * {% set foo %}foo{% endset %} is compiled to $context['foo'] = new Twig\Markup("foo"); + */ + if ($this->getAttribute('capture')) { + $this->setAttribute('safe', true); + + $values = $this->getNode('values'); + if ($values instanceof TextNode) { + $this->setNode('values', new ConstantExpression($values->getAttribute('data'), $values->getTemplateLine())); + $this->setAttribute('capture', false); + } + } + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if (\count($this->getNode('names')) > 1) { + $compiler->write('list('); + foreach ($this->getNode('names') as $idx => $node) { + if ($idx) { + $compiler->raw(', '); + } + + $compiler->subcompile($node); + } + $compiler->raw(')'); + } else { + if ($this->getAttribute('capture')) { + if ($compiler->getEnvironment()->isDebug()) { + $compiler->write("ob_start();\n"); + } else { + $compiler->write("ob_start(function () { return ''; });\n"); + } + $compiler + ->subcompile($this->getNode('values')) + ; + } + + $compiler->subcompile($this->getNode('names'), false); + + if ($this->getAttribute('capture')) { + $compiler->raw(" = ('' === \$tmp = ob_get_clean()) ? '' : new Markup(\$tmp, \$this->env->getCharset())"); + } + } + + if (!$this->getAttribute('capture')) { + $compiler->raw(' = '); + + if (\count($this->getNode('names')) > 1) { + $compiler->write('['); + foreach ($this->getNode('values') as $idx => $value) { + if ($idx) { + $compiler->raw(', '); + } + + $compiler->subcompile($value); + } + $compiler->raw(']'); + } else { + if ($this->getAttribute('safe')) { + $compiler + ->raw("('' === \$tmp = ") + ->subcompile($this->getNode('values')) + ->raw(") ? '' : new Markup(\$tmp, \$this->env->getCharset())") + ; + } else { + $compiler->subcompile($this->getNode('values')); + } + } + } + + $compiler->raw(";\n"); + } +} + +class_alias('Twig\Node\SetNode', 'Twig_Node_Set'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/SetTempNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/SetTempNode.php new file mode 100755 index 0000000..918fb99 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/SetTempNode.php @@ -0,0 +1,44 @@ + $name], $lineno); + } + + public function compile(Compiler $compiler) + { + $name = $this->getAttribute('name'); + $compiler + ->addDebugInfo($this) + ->write('if (isset($context[') + ->string($name) + ->raw('])) { $_') + ->raw($name) + ->raw('_ = $context[') + ->repr($name) + ->raw(']; } else { $_') + ->raw($name) + ->raw("_ = null; }\n") + ; + } +} + +class_alias('Twig\Node\SetTempNode', 'Twig_Node_SetTemp'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/SpacelessNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/SpacelessNode.php new file mode 100755 index 0000000..c8d32da --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/SpacelessNode.php @@ -0,0 +1,47 @@ + + */ +class SpacelessNode extends Node +{ + public function __construct(\Twig_NodeInterface $body, $lineno, $tag = 'spaceless') + { + parent::__construct(['body' => $body], [], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ; + if ($compiler->getEnvironment()->isDebug()) { + $compiler->write("ob_start();\n"); + } else { + $compiler->write("ob_start(function () { return ''; });\n"); + } + $compiler + ->subcompile($this->getNode('body')) + ->write("echo trim(preg_replace('/>\s+<', ob_get_clean()));\n") + ; + } +} + +class_alias('Twig\Node\SpacelessNode', 'Twig_Node_Spaceless'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/TextNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/TextNode.php new file mode 100755 index 0000000..9ac435e --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/TextNode.php @@ -0,0 +1,40 @@ + + */ +class TextNode extends Node implements NodeOutputInterface +{ + public function __construct($data, $lineno) + { + parent::__construct([], ['data' => $data], $lineno); + } + + public function compile(Compiler $compiler) + { + $compiler + ->addDebugInfo($this) + ->write('echo ') + ->string($this->getAttribute('data')) + ->raw(";\n") + ; + } +} + +class_alias('Twig\Node\TextNode', 'Twig_Node_Text'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Node/WithNode.php b/phpMyAdmin/vendor/twig/twig/src/Node/WithNode.php new file mode 100755 index 0000000..f5ae924 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Node/WithNode.php @@ -0,0 +1,72 @@ + + */ +class WithNode extends Node +{ + public function __construct(Node $body, Node $variables = null, $only = false, $lineno, $tag = null) + { + $nodes = ['body' => $body]; + if (null !== $variables) { + $nodes['variables'] = $variables; + } + + parent::__construct($nodes, ['only' => (bool) $only], $lineno, $tag); + } + + public function compile(Compiler $compiler) + { + $compiler->addDebugInfo($this); + + if ($this->hasNode('variables')) { + $node = $this->getNode('variables'); + $varsName = $compiler->getVarName(); + $compiler + ->write(sprintf('$%s = ', $varsName)) + ->subcompile($node) + ->raw(";\n") + ->write(sprintf("if (!twig_test_iterable(\$%s)) {\n", $varsName)) + ->indent() + ->write("throw new RuntimeError('Variables passed to the \"with\" tag must be a hash.', ") + ->repr($node->getTemplateLine()) + ->raw(", \$this->getSourceContext());\n") + ->outdent() + ->write("}\n") + ->write(sprintf("\$%s = twig_to_array(\$%s);\n", $varsName, $varsName)) + ; + + if ($this->getAttribute('only')) { + $compiler->write("\$context = ['_parent' => \$context];\n"); + } else { + $compiler->write("\$context['_parent'] = \$context;\n"); + } + + $compiler->write(sprintf("\$context = \$this->env->mergeGlobals(array_merge(\$context, \$%s));\n", $varsName)); + } else { + $compiler->write("\$context['_parent'] = \$context;\n"); + } + + $compiler + ->subcompile($this->getNode('body')) + ->write("\$context = \$context['_parent'];\n") + ; + } +} + +class_alias('Twig\Node\WithNode', 'Twig_Node_With'); diff --git a/phpMyAdmin/vendor/twig/twig/src/NodeTraverser.php b/phpMyAdmin/vendor/twig/twig/src/NodeTraverser.php new file mode 100755 index 0000000..bd25d3c --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/NodeTraverser.php @@ -0,0 +1,89 @@ + + */ +class NodeTraverser +{ + protected $env; + protected $visitors = []; + + /** + * @param NodeVisitorInterface[] $visitors + */ + public function __construct(Environment $env, array $visitors = []) + { + $this->env = $env; + foreach ($visitors as $visitor) { + $this->addVisitor($visitor); + } + } + + public function addVisitor(NodeVisitorInterface $visitor) + { + $this->visitors[$visitor->getPriority()][] = $visitor; + } + + /** + * Traverses a node and calls the registered visitors. + * + * @return \Twig_NodeInterface + */ + public function traverse(\Twig_NodeInterface $node) + { + ksort($this->visitors); + foreach ($this->visitors as $visitors) { + foreach ($visitors as $visitor) { + $node = $this->traverseForVisitor($visitor, $node); + } + } + + return $node; + } + + protected function traverseForVisitor(NodeVisitorInterface $visitor, \Twig_NodeInterface $node = null) + { + if (null === $node) { + return; + } + + $node = $visitor->enterNode($node, $this->env); + + foreach ($node as $k => $n) { + if (null === $n) { + continue; + } + + if (false !== ($m = $this->traverseForVisitor($visitor, $n)) && null !== $m) { + if ($m !== $n) { + $node->setNode($k, $m); + } + } else { + $node->removeNode($k); + } + } + + return $visitor->leaveNode($node, $this->env); + } +} + +class_alias('Twig\NodeTraverser', 'Twig_NodeTraverser'); diff --git a/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php new file mode 100755 index 0000000..b66c3c6 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/AbstractNodeVisitor.php @@ -0,0 +1,59 @@ + + */ +abstract class AbstractNodeVisitor implements NodeVisitorInterface +{ + final public function enterNode(\Twig_NodeInterface $node, Environment $env) + { + if (!$node instanceof Node) { + throw new \LogicException(sprintf('%s only supports \Twig\Node\Node instances.', __CLASS__)); + } + + return $this->doEnterNode($node, $env); + } + + final public function leaveNode(\Twig_NodeInterface $node, Environment $env) + { + if (!$node instanceof Node) { + throw new \LogicException(sprintf('%s only supports \Twig\Node\Node instances.', __CLASS__)); + } + + return $this->doLeaveNode($node, $env); + } + + /** + * Called before child nodes are visited. + * + * @return Node The modified node + */ + abstract protected function doEnterNode(Node $node, Environment $env); + + /** + * Called after child nodes are visited. + * + * @return Node|false|null The modified node or null if the node must be removed + */ + abstract protected function doLeaveNode(Node $node, Environment $env); +} + +class_alias('Twig\NodeVisitor\AbstractNodeVisitor', 'Twig_BaseNodeVisitor'); diff --git a/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php new file mode 100755 index 0000000..f6e16fa --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/EscaperNodeVisitor.php @@ -0,0 +1,209 @@ + + */ +class EscaperNodeVisitor extends AbstractNodeVisitor +{ + protected $statusStack = []; + protected $blocks = []; + protected $safeAnalysis; + protected $traverser; + protected $defaultStrategy = false; + protected $safeVars = []; + + public function __construct() + { + $this->safeAnalysis = new SafeAnalysisNodeVisitor(); + } + + protected function doEnterNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + if ($env->hasExtension('\Twig\Extension\EscaperExtension') && $defaultStrategy = $env->getExtension('\Twig\Extension\EscaperExtension')->getDefaultStrategy($node->getTemplateName())) { + $this->defaultStrategy = $defaultStrategy; + } + $this->safeVars = []; + $this->blocks = []; + } elseif ($node instanceof AutoEscapeNode) { + $this->statusStack[] = $node->getAttribute('value'); + } elseif ($node instanceof BlockNode) { + $this->statusStack[] = isset($this->blocks[$node->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env); + } elseif ($node instanceof ImportNode) { + $this->safeVars[] = $node->getNode('var')->getAttribute('name'); + } + + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + $this->defaultStrategy = false; + $this->safeVars = []; + $this->blocks = []; + } elseif ($node instanceof FilterExpression) { + return $this->preEscapeFilterNode($node, $env); + } elseif ($node instanceof PrintNode && false !== $type = $this->needEscaping($env)) { + $expression = $node->getNode('expr'); + if ($expression instanceof ConditionalExpression && $this->shouldUnwrapConditional($expression, $env, $type)) { + return new DoNode($this->unwrapConditional($expression, $env, $type), $expression->getTemplateLine()); + } + + return $this->escapePrintNode($node, $env, $type); + } + + if ($node instanceof AutoEscapeNode || $node instanceof BlockNode) { + array_pop($this->statusStack); + } elseif ($node instanceof BlockReferenceNode) { + $this->blocks[$node->getAttribute('name')] = $this->needEscaping($env); + } + + return $node; + } + + private function shouldUnwrapConditional(ConditionalExpression $expression, Environment $env, $type) + { + $expr2Safe = $this->isSafeFor($type, $expression->getNode('expr2'), $env); + $expr3Safe = $this->isSafeFor($type, $expression->getNode('expr3'), $env); + + return $expr2Safe !== $expr3Safe; + } + + private function unwrapConditional(ConditionalExpression $expression, Environment $env, $type) + { + // convert "echo a ? b : c" to "a ? echo b : echo c" recursively + $expr2 = $expression->getNode('expr2'); + if ($expr2 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr2, $env, $type)) { + $expr2 = $this->unwrapConditional($expr2, $env, $type); + } else { + $expr2 = $this->escapeInlinePrintNode(new InlinePrint($expr2, $expr2->getTemplateLine()), $env, $type); + } + $expr3 = $expression->getNode('expr3'); + if ($expr3 instanceof ConditionalExpression && $this->shouldUnwrapConditional($expr3, $env, $type)) { + $expr3 = $this->unwrapConditional($expr3, $env, $type); + } else { + $expr3 = $this->escapeInlinePrintNode(new InlinePrint($expr3, $expr3->getTemplateLine()), $env, $type); + } + + return new ConditionalExpression($expression->getNode('expr1'), $expr2, $expr3, $expression->getTemplateLine()); + } + + private function escapeInlinePrintNode(InlinePrint $node, Environment $env, $type) + { + $expression = $node->getNode('node'); + + if ($this->isSafeFor($type, $expression, $env)) { + return $node; + } + + return new InlinePrint($this->getEscaperFilter($type, $expression), $node->getTemplateLine()); + } + + protected function escapePrintNode(PrintNode $node, Environment $env, $type) + { + if (false === $type) { + return $node; + } + + $expression = $node->getNode('expr'); + + if ($this->isSafeFor($type, $expression, $env)) { + return $node; + } + + $class = \get_class($node); + + return new $class($this->getEscaperFilter($type, $expression), $node->getTemplateLine()); + } + + protected function preEscapeFilterNode(FilterExpression $filter, Environment $env) + { + $name = $filter->getNode('filter')->getAttribute('value'); + + $type = $env->getFilter($name)->getPreEscape(); + if (null === $type) { + return $filter; + } + + $node = $filter->getNode('node'); + if ($this->isSafeFor($type, $node, $env)) { + return $filter; + } + + $filter->setNode('node', $this->getEscaperFilter($type, $node)); + + return $filter; + } + + protected function isSafeFor($type, \Twig_NodeInterface $expression, $env) + { + $safe = $this->safeAnalysis->getSafe($expression); + + if (null === $safe) { + if (null === $this->traverser) { + $this->traverser = new NodeTraverser($env, [$this->safeAnalysis]); + } + + $this->safeAnalysis->setSafeVars($this->safeVars); + + $this->traverser->traverse($expression); + $safe = $this->safeAnalysis->getSafe($expression); + } + + return \in_array($type, $safe) || \in_array('all', $safe); + } + + protected function needEscaping(Environment $env) + { + if (\count($this->statusStack)) { + return $this->statusStack[\count($this->statusStack) - 1]; + } + + return $this->defaultStrategy ? $this->defaultStrategy : false; + } + + protected function getEscaperFilter($type, \Twig_NodeInterface $node) + { + $line = $node->getTemplateLine(); + $name = new ConstantExpression('escape', $line); + $args = new Node([new ConstantExpression((string) $type, $line), new ConstantExpression(null, $line), new ConstantExpression(true, $line)]); + + return new FilterExpression($node, $name, $args, $line); + } + + public function getPriority() + { + return 0; + } +} + +class_alias('Twig\NodeVisitor\EscaperNodeVisitor', 'Twig_NodeVisitor_Escaper'); diff --git a/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php new file mode 100755 index 0000000..9b8730b --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/NodeVisitorInterface.php @@ -0,0 +1,50 @@ + + */ +interface NodeVisitorInterface +{ + /** + * Called before child nodes are visited. + * + * @return \Twig_NodeInterface The modified node + */ + public function enterNode(\Twig_NodeInterface $node, Environment $env); + + /** + * Called after child nodes are visited. + * + * @return \Twig_NodeInterface|false|null The modified node or null if the node must be removed + */ + public function leaveNode(\Twig_NodeInterface $node, Environment $env); + + /** + * Returns the priority for this visitor. + * + * Priority should be between -10 and 10 (0 is the default). + * + * @return int The priority level + */ + public function getPriority(); +} + +class_alias('Twig\NodeVisitor\NodeVisitorInterface', 'Twig_NodeVisitorInterface'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Environment'); diff --git a/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php new file mode 100755 index 0000000..e5ea9b7 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/OptimizerNodeVisitor.php @@ -0,0 +1,273 @@ + + */ +class OptimizerNodeVisitor extends AbstractNodeVisitor +{ + const OPTIMIZE_ALL = -1; + const OPTIMIZE_NONE = 0; + const OPTIMIZE_FOR = 2; + const OPTIMIZE_RAW_FILTER = 4; + const OPTIMIZE_VAR_ACCESS = 8; + + protected $loops = []; + protected $loopsTargets = []; + protected $optimizers; + protected $prependedNodes = []; + protected $inABody = false; + + /** + * @param int $optimizers The optimizer mode + */ + public function __construct($optimizers = -1) + { + if (!\is_int($optimizers) || $optimizers > (self::OPTIMIZE_FOR | self::OPTIMIZE_RAW_FILTER | self::OPTIMIZE_VAR_ACCESS)) { + throw new \InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers)); + } + + $this->optimizers = $optimizers; + } + + protected function doEnterNode(Node $node, Environment $env) + { + if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { + $this->enterOptimizeFor($node, $env); + } + + if (\PHP_VERSION_ID < 50400 && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('\Twig\Extension\SandboxExtension')) { + if ($this->inABody) { + if (!$node instanceof AbstractExpression) { + if ('Twig_Node' !== \get_class($node)) { + array_unshift($this->prependedNodes, []); + } + } else { + $node = $this->optimizeVariables($node, $env); + } + } elseif ($node instanceof BodyNode) { + $this->inABody = true; + } + } + + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + $expression = $node instanceof AbstractExpression; + + if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) { + $this->leaveOptimizeFor($node, $env); + } + + if (self::OPTIMIZE_RAW_FILTER === (self::OPTIMIZE_RAW_FILTER & $this->optimizers)) { + $node = $this->optimizeRawFilter($node, $env); + } + + $node = $this->optimizePrintNode($node, $env); + + if (self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('\Twig\Extension\SandboxExtension')) { + if ($node instanceof BodyNode) { + $this->inABody = false; + } elseif ($this->inABody) { + if (!$expression && 'Twig_Node' !== \get_class($node) && $prependedNodes = array_shift($this->prependedNodes)) { + $nodes = []; + foreach (array_unique($prependedNodes) as $name) { + $nodes[] = new SetTempNode($name, $node->getTemplateLine()); + } + + $nodes[] = $node; + $node = new Node($nodes); + } + } + } + + return $node; + } + + protected function optimizeVariables(\Twig_NodeInterface $node, Environment $env) + { + if ('Twig_Node_Expression_Name' === \get_class($node) && $node->isSimple()) { + $this->prependedNodes[0][] = $node->getAttribute('name'); + + return new TempNameExpression($node->getAttribute('name'), $node->getTemplateLine()); + } + + return $node; + } + + /** + * Optimizes print nodes. + * + * It replaces: + * + * * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()" + * + * @return \Twig_NodeInterface + */ + protected function optimizePrintNode(\Twig_NodeInterface $node, Environment $env) + { + if (!$node instanceof PrintNode) { + return $node; + } + + $exprNode = $node->getNode('expr'); + if ( + $exprNode instanceof BlockReferenceExpression || + $exprNode instanceof ParentExpression + ) { + $exprNode->setAttribute('output', true); + + return $exprNode; + } + + return $node; + } + + /** + * Removes "raw" filters. + * + * @return \Twig_NodeInterface + */ + protected function optimizeRawFilter(\Twig_NodeInterface $node, Environment $env) + { + if ($node instanceof FilterExpression && 'raw' == $node->getNode('filter')->getAttribute('value')) { + return $node->getNode('node'); + } + + return $node; + } + + /** + * Optimizes "for" tag by removing the "loop" variable creation whenever possible. + */ + protected function enterOptimizeFor(\Twig_NodeInterface $node, Environment $env) + { + if ($node instanceof ForNode) { + // disable the loop variable by default + $node->setAttribute('with_loop', false); + array_unshift($this->loops, $node); + array_unshift($this->loopsTargets, $node->getNode('value_target')->getAttribute('name')); + array_unshift($this->loopsTargets, $node->getNode('key_target')->getAttribute('name')); + } elseif (!$this->loops) { + // we are outside a loop + return; + } + + // when do we need to add the loop variable back? + + // the loop variable is referenced for the current loop + elseif ($node instanceof NameExpression && 'loop' === $node->getAttribute('name')) { + $node->setAttribute('always_defined', true); + $this->addLoopToCurrent(); + } + + // optimize access to loop targets + elseif ($node instanceof NameExpression && \in_array($node->getAttribute('name'), $this->loopsTargets)) { + $node->setAttribute('always_defined', true); + } + + // block reference + elseif ($node instanceof BlockReferenceNode || $node instanceof BlockReferenceExpression) { + $this->addLoopToCurrent(); + } + + // include without the only attribute + elseif ($node instanceof IncludeNode && !$node->getAttribute('only')) { + $this->addLoopToAll(); + } + + // include function without the with_context=false parameter + elseif ($node instanceof FunctionExpression + && 'include' === $node->getAttribute('name') + && (!$node->getNode('arguments')->hasNode('with_context') + || false !== $node->getNode('arguments')->getNode('with_context')->getAttribute('value') + ) + ) { + $this->addLoopToAll(); + } + + // the loop variable is referenced via an attribute + elseif ($node instanceof GetAttrExpression + && (!$node->getNode('attribute') instanceof ConstantExpression + || 'parent' === $node->getNode('attribute')->getAttribute('value') + ) + && (true === $this->loops[0]->getAttribute('with_loop') + || ($node->getNode('node') instanceof NameExpression + && 'loop' === $node->getNode('node')->getAttribute('name') + ) + ) + ) { + $this->addLoopToAll(); + } + } + + /** + * Optimizes "for" tag by removing the "loop" variable creation whenever possible. + */ + protected function leaveOptimizeFor(\Twig_NodeInterface $node, Environment $env) + { + if ($node instanceof ForNode) { + array_shift($this->loops); + array_shift($this->loopsTargets); + array_shift($this->loopsTargets); + } + } + + protected function addLoopToCurrent() + { + $this->loops[0]->setAttribute('with_loop', true); + } + + protected function addLoopToAll() + { + foreach ($this->loops as $loop) { + $loop->setAttribute('with_loop', true); + } + } + + public function getPriority() + { + return 255; + } +} + +class_alias('Twig\NodeVisitor\OptimizerNodeVisitor', 'Twig_NodeVisitor_Optimizer'); diff --git a/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php new file mode 100755 index 0000000..97a7a3e --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/SafeAnalysisNodeVisitor.php @@ -0,0 +1,164 @@ +safeVars = $safeVars; + } + + public function getSafe(\Twig_NodeInterface $node) + { + $hash = spl_object_hash($node); + if (!isset($this->data[$hash])) { + return; + } + + foreach ($this->data[$hash] as $bucket) { + if ($bucket['key'] !== $node) { + continue; + } + + if (\in_array('html_attr', $bucket['value'])) { + $bucket['value'][] = 'html'; + } + + return $bucket['value']; + } + } + + protected function setSafe(\Twig_NodeInterface $node, array $safe) + { + $hash = spl_object_hash($node); + if (isset($this->data[$hash])) { + foreach ($this->data[$hash] as &$bucket) { + if ($bucket['key'] === $node) { + $bucket['value'] = $safe; + + return; + } + } + } + $this->data[$hash][] = [ + 'key' => $node, + 'value' => $safe, + ]; + } + + protected function doEnterNode(Node $node, Environment $env) + { + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + if ($node instanceof ConstantExpression) { + // constants are marked safe for all + $this->setSafe($node, ['all']); + } elseif ($node instanceof BlockReferenceExpression) { + // blocks are safe by definition + $this->setSafe($node, ['all']); + } elseif ($node instanceof ParentExpression) { + // parent block is safe by definition + $this->setSafe($node, ['all']); + } elseif ($node instanceof ConditionalExpression) { + // intersect safeness of both operands + $safe = $this->intersectSafe($this->getSafe($node->getNode('expr2')), $this->getSafe($node->getNode('expr3'))); + $this->setSafe($node, $safe); + } elseif ($node instanceof FilterExpression) { + // filter expression is safe when the filter is safe + $name = $node->getNode('filter')->getAttribute('value'); + $args = $node->getNode('arguments'); + if (false !== $filter = $env->getFilter($name)) { + $safe = $filter->getSafe($args); + if (null === $safe) { + $safe = $this->intersectSafe($this->getSafe($node->getNode('node')), $filter->getPreservesSafety()); + } + $this->setSafe($node, $safe); + } else { + $this->setSafe($node, []); + } + } elseif ($node instanceof FunctionExpression) { + // function expression is safe when the function is safe + $name = $node->getAttribute('name'); + $args = $node->getNode('arguments'); + $function = $env->getFunction($name); + if (false !== $function) { + $this->setSafe($node, $function->getSafe($args)); + } else { + $this->setSafe($node, []); + } + } elseif ($node instanceof MethodCallExpression) { + if ($node->getAttribute('safe')) { + $this->setSafe($node, ['all']); + } else { + $this->setSafe($node, []); + } + } elseif ($node instanceof GetAttrExpression && $node->getNode('node') instanceof NameExpression) { + $name = $node->getNode('node')->getAttribute('name'); + // attributes on template instances are safe + if ('_self' == $name || \in_array($name, $this->safeVars)) { + $this->setSafe($node, ['all']); + } else { + $this->setSafe($node, []); + } + } else { + $this->setSafe($node, []); + } + + return $node; + } + + protected function intersectSafe(array $a = null, array $b = null) + { + if (null === $a || null === $b) { + return []; + } + + if (\in_array('all', $a)) { + return $b; + } + + if (\in_array('all', $b)) { + return $a; + } + + return array_intersect($a, $b); + } + + public function getPriority() + { + return 0; + } +} + +class_alias('Twig\NodeVisitor\SafeAnalysisNodeVisitor', 'Twig_NodeVisitor_SafeAnalysis'); diff --git a/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php new file mode 100755 index 0000000..c940339 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/NodeVisitor/SandboxNodeVisitor.php @@ -0,0 +1,137 @@ + + */ +class SandboxNodeVisitor extends AbstractNodeVisitor +{ + protected $inAModule = false; + protected $tags; + protected $filters; + protected $functions; + + private $needsToStringWrap = false; + + protected function doEnterNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + $this->inAModule = true; + $this->tags = []; + $this->filters = []; + $this->functions = []; + + return $node; + } elseif ($this->inAModule) { + // look for tags + if ($node->getNodeTag() && !isset($this->tags[$node->getNodeTag()])) { + $this->tags[$node->getNodeTag()] = $node; + } + + // look for filters + if ($node instanceof FilterExpression && !isset($this->filters[$node->getNode('filter')->getAttribute('value')])) { + $this->filters[$node->getNode('filter')->getAttribute('value')] = $node; + } + + // look for functions + if ($node instanceof FunctionExpression && !isset($this->functions[$node->getAttribute('name')])) { + $this->functions[$node->getAttribute('name')] = $node; + } + + // the .. operator is equivalent to the range() function + if ($node instanceof RangeBinary && !isset($this->functions['range'])) { + $this->functions['range'] = $node; + } + + if ($node instanceof PrintNode) { + $this->needsToStringWrap = true; + $this->wrapNode($node, 'expr'); + } + + if ($node instanceof SetNode && !$node->getAttribute('capture')) { + $this->needsToStringWrap = true; + } + + // wrap outer nodes that can implicitly call __toString() + if ($this->needsToStringWrap) { + if ($node instanceof ConcatBinary) { + $this->wrapNode($node, 'left'); + $this->wrapNode($node, 'right'); + } + if ($node instanceof FilterExpression) { + $this->wrapNode($node, 'node'); + $this->wrapArrayNode($node, 'arguments'); + } + if ($node instanceof FunctionExpression) { + $this->wrapArrayNode($node, 'arguments'); + } + } + } + + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + $this->inAModule = false; + + $node->getNode('constructor_end')->setNode('_security_check', new Node([new CheckSecurityNode($this->filters, $this->tags, $this->functions), $node->getNode('display_start')])); + } elseif ($this->inAModule) { + if ($node instanceof PrintNode || $node instanceof SetNode) { + $this->needsToStringWrap = false; + } + } + + return $node; + } + + private function wrapNode(Node $node, $name) + { + $expr = $node->getNode($name); + if ($expr instanceof NameExpression || $expr instanceof GetAttrExpression) { + $node->setNode($name, new CheckToStringNode($expr)); + } + } + + private function wrapArrayNode(Node $node, $name) + { + $args = $node->getNode($name); + foreach ($args as $name => $_) { + $this->wrapNode($args, $name); + } + } + + public function getPriority() + { + return 0; + } +} + +class_alias('Twig\NodeVisitor\SandboxNodeVisitor', 'Twig_NodeVisitor_Sandbox'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Parser.php b/phpMyAdmin/vendor/twig/twig/src/Parser.php new file mode 100755 index 0000000..9fb6a83 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Parser.php @@ -0,0 +1,439 @@ + + */ +class Parser implements \Twig_ParserInterface +{ + protected $stack = []; + protected $stream; + protected $parent; + protected $handlers; + protected $visitors; + protected $expressionParser; + protected $blocks; + protected $blockStack; + protected $macros; + protected $env; + protected $reservedMacroNames; + protected $importedSymbols; + protected $traits; + protected $embeddedTemplates = []; + private $varNameSalt = 0; + + public function __construct(Environment $env) + { + $this->env = $env; + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getEnvironment() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); + + return $this->env; + } + + public function getVarName() + { + return sprintf('__internal_%s', hash('sha256', __METHOD__.$this->stream->getSourceContext()->getCode().$this->varNameSalt++)); + } + + /** + * @deprecated since 1.27 (to be removed in 2.0). Use $parser->getStream()->getSourceContext()->getPath() instead. + */ + public function getFilename() + { + @trigger_error(sprintf('The "%s" method is deprecated since version 1.27 and will be removed in 2.0. Use $parser->getStream()->getSourceContext()->getPath() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->stream->getSourceContext()->getName(); + } + + public function parse(TokenStream $stream, $test = null, $dropNeedle = false) + { + // push all variables into the stack to keep the current state of the parser + // using get_object_vars() instead of foreach would lead to https://bugs.php.net/71336 + // This hack can be removed when min version if PHP 7.0 + $vars = []; + foreach ($this as $k => $v) { + $vars[$k] = $v; + } + + unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser'], $vars['reservedMacroNames']); + $this->stack[] = $vars; + + // tag handlers + if (null === $this->handlers) { + $this->handlers = $this->env->getTokenParsers(); + $this->handlers->setParser($this); + } + + // node visitors + if (null === $this->visitors) { + $this->visitors = $this->env->getNodeVisitors(); + } + + if (null === $this->expressionParser) { + $this->expressionParser = new ExpressionParser($this, $this->env); + } + + $this->stream = $stream; + $this->parent = null; + $this->blocks = []; + $this->macros = []; + $this->traits = []; + $this->blockStack = []; + $this->importedSymbols = [[]]; + $this->embeddedTemplates = []; + $this->varNameSalt = 0; + + try { + $body = $this->subparse($test, $dropNeedle); + + if (null !== $this->parent && null === $body = $this->filterBodyNodes($body)) { + $body = new Node(); + } + } catch (SyntaxError $e) { + if (!$e->getSourceContext()) { + $e->setSourceContext($this->stream->getSourceContext()); + } + + if (!$e->getTemplateLine()) { + $e->setTemplateLine($this->stream->getCurrent()->getLine()); + } + + throw $e; + } + + $node = new ModuleNode(new BodyNode([$body]), $this->parent, new Node($this->blocks), new Node($this->macros), new Node($this->traits), $this->embeddedTemplates, $stream->getSourceContext()); + + $traverser = new NodeTraverser($this->env, $this->visitors); + + $node = $traverser->traverse($node); + + // restore previous stack so previous parse() call can resume working + foreach (array_pop($this->stack) as $key => $val) { + $this->$key = $val; + } + + return $node; + } + + public function subparse($test, $dropNeedle = false) + { + $lineno = $this->getCurrentToken()->getLine(); + $rv = []; + while (!$this->stream->isEOF()) { + switch ($this->getCurrentToken()->getType()) { + case Token::TEXT_TYPE: + $token = $this->stream->next(); + $rv[] = new TextNode($token->getValue(), $token->getLine()); + break; + + case Token::VAR_START_TYPE: + $token = $this->stream->next(); + $expr = $this->expressionParser->parseExpression(); + $this->stream->expect(Token::VAR_END_TYPE); + $rv[] = new PrintNode($expr, $token->getLine()); + break; + + case Token::BLOCK_START_TYPE: + $this->stream->next(); + $token = $this->getCurrentToken(); + + if (Token::NAME_TYPE !== $token->getType()) { + throw new SyntaxError('A block must start with a tag name.', $token->getLine(), $this->stream->getSourceContext()); + } + + if (null !== $test && \call_user_func($test, $token)) { + if ($dropNeedle) { + $this->stream->next(); + } + + if (1 === \count($rv)) { + return $rv[0]; + } + + return new Node($rv, [], $lineno); + } + + $subparser = $this->handlers->getTokenParser($token->getValue()); + if (null === $subparser) { + if (null !== $test) { + $e = new SyntaxError(sprintf('Unexpected "%s" tag', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); + + if (\is_array($test) && isset($test[0]) && $test[0] instanceof TokenParserInterface) { + $e->appendMessage(sprintf(' (expecting closing tag for the "%s" tag defined near line %s).', $test[0]->getTag(), $lineno)); + } + } else { + $e = new SyntaxError(sprintf('Unknown "%s" tag.', $token->getValue()), $token->getLine(), $this->stream->getSourceContext()); + $e->addSuggestions($token->getValue(), array_keys($this->env->getTags())); + } + + throw $e; + } + + $this->stream->next(); + + $node = $subparser->parse($token); + if (null !== $node) { + $rv[] = $node; + } + break; + + default: + throw new SyntaxError('Lexer or parser ended up in unsupported state.', $this->getCurrentToken()->getLine(), $this->stream->getSourceContext()); + } + } + + if (1 === \count($rv)) { + return $rv[0]; + } + + return new Node($rv, [], $lineno); + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function addHandler($name, $class) + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); + + $this->handlers[$name] = $class; + } + + /** + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function addNodeVisitor(NodeVisitorInterface $visitor) + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0.', E_USER_DEPRECATED); + + $this->visitors[] = $visitor; + } + + public function getBlockStack() + { + return $this->blockStack; + } + + public function peekBlockStack() + { + return isset($this->blockStack[\count($this->blockStack) - 1]) ? $this->blockStack[\count($this->blockStack) - 1] : null; + } + + public function popBlockStack() + { + array_pop($this->blockStack); + } + + public function pushBlockStack($name) + { + $this->blockStack[] = $name; + } + + public function hasBlock($name) + { + return isset($this->blocks[$name]); + } + + public function getBlock($name) + { + return $this->blocks[$name]; + } + + public function setBlock($name, BlockNode $value) + { + $this->blocks[$name] = new BodyNode([$value], [], $value->getTemplateLine()); + } + + public function hasMacro($name) + { + return isset($this->macros[$name]); + } + + public function setMacro($name, MacroNode $node) + { + if ($this->isReservedMacroName($name)) { + throw new SyntaxError(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword.', $name), $node->getTemplateLine(), $this->stream->getSourceContext()); + } + + $this->macros[$name] = $node; + } + + public function isReservedMacroName($name) + { + if (null === $this->reservedMacroNames) { + $this->reservedMacroNames = []; + $r = new \ReflectionClass($this->env->getBaseTemplateClass()); + foreach ($r->getMethods() as $method) { + $methodName = strtr($method->getName(), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + + if ('get' === substr($methodName, 0, 3) && isset($methodName[3])) { + $this->reservedMacroNames[] = substr($methodName, 3); + } + } + } + + return \in_array(strtr($name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'), $this->reservedMacroNames); + } + + public function addTrait($trait) + { + $this->traits[] = $trait; + } + + public function hasTraits() + { + return \count($this->traits) > 0; + } + + public function embedTemplate(ModuleNode $template) + { + $template->setIndex(mt_rand()); + + $this->embeddedTemplates[] = $template; + } + + public function addImportedSymbol($type, $alias, $name = null, AbstractExpression $node = null) + { + $this->importedSymbols[0][$type][$alias] = ['name' => $name, 'node' => $node]; + } + + public function getImportedSymbol($type, $alias) + { + if (null !== $this->peekBlockStack()) { + foreach ($this->importedSymbols as $functions) { + if (isset($functions[$type][$alias])) { + if (\count($this->blockStack) > 1) { + return null; + } + + return $functions[$type][$alias]; + } + } + } else { + return isset($this->importedSymbols[0][$type][$alias]) ? $this->importedSymbols[0][$type][$alias] : null; + } + } + + public function isMainScope() + { + return 1 === \count($this->importedSymbols); + } + + public function pushLocalScope() + { + array_unshift($this->importedSymbols, []); + } + + public function popLocalScope() + { + array_shift($this->importedSymbols); + } + + /** + * @return ExpressionParser + */ + public function getExpressionParser() + { + return $this->expressionParser; + } + + public function getParent() + { + return $this->parent; + } + + public function setParent($parent) + { + $this->parent = $parent; + } + + /** + * @return TokenStream + */ + public function getStream() + { + return $this->stream; + } + + /** + * @return Token + */ + public function getCurrentToken() + { + return $this->stream->getCurrent(); + } + + protected function filterBodyNodes(\Twig_NodeInterface $node) + { + // check that the body does not contain non-empty output nodes + if ( + ($node instanceof TextNode && !ctype_space($node->getAttribute('data'))) + || + (!$node instanceof TextNode && !$node instanceof BlockReferenceNode && $node instanceof NodeOutputInterface) + ) { + if (false !== strpos((string) $node, \chr(0xEF).\chr(0xBB).\chr(0xBF))) { + $t = substr($node->getAttribute('data'), 3); + if ('' === $t || ctype_space($t)) { + // bypass empty nodes starting with a BOM + return; + } + } + + throw new SyntaxError('A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag?', $node->getTemplateLine(), $this->stream->getSourceContext()); + } + + // bypass nodes that will "capture" the output + if ($node instanceof NodeCaptureInterface) { + return $node; + } + + if ($node instanceof NodeOutputInterface) { + return; + } + + foreach ($node as $k => $n) { + if (null !== $n && null === $this->filterBodyNodes($n)) { + $node->removeNode($k); + } + } + + return $node; + } +} + +class_alias('Twig\Parser', 'Twig_Parser'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php b/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php new file mode 100755 index 0000000..d965dc7 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/BaseDumper.php @@ -0,0 +1,65 @@ + + */ +abstract class BaseDumper +{ + private $root; + + public function dump(Profile $profile) + { + return $this->dumpProfile($profile); + } + + abstract protected function formatTemplate(Profile $profile, $prefix); + + abstract protected function formatNonTemplate(Profile $profile, $prefix); + + abstract protected function formatTime(Profile $profile, $percent); + + private function dumpProfile(Profile $profile, $prefix = '', $sibling = false) + { + if ($profile->isRoot()) { + $this->root = $profile->getDuration(); + $start = $profile->getName(); + } else { + if ($profile->isTemplate()) { + $start = $this->formatTemplate($profile, $prefix); + } else { + $start = $this->formatNonTemplate($profile, $prefix); + } + $prefix .= $sibling ? '鈹� ' : ' '; + } + + $percent = $this->root ? $profile->getDuration() / $this->root * 100 : 0; + + if ($profile->getDuration() * 1000 < 1) { + $str = $start."\n"; + } else { + $str = sprintf("%s %s\n", $start, $this->formatTime($profile, $percent)); + } + + $nCount = \count($profile->getProfiles()); + foreach ($profile as $i => $p) { + $str .= $this->dumpProfile($p, $prefix, $i + 1 !== $nCount); + } + + return $str; + } +} + +class_alias('Twig\Profiler\Dumper\BaseDumper', 'Twig_Profiler_Dumper_Base'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php b/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php new file mode 100755 index 0000000..a1c3c7b --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/BlackfireDumper.php @@ -0,0 +1,76 @@ + + * + * @final + */ +class BlackfireDumper +{ + public function dump(Profile $profile) + { + $data = []; + $this->dumpProfile('main()', $profile, $data); + $this->dumpChildren('main()', $profile, $data); + + $start = sprintf('%f', microtime(true)); + $str = << $values) { + $str .= "{$name}//{$values['ct']} {$values['wt']} {$values['mu']} {$values['pmu']}\n"; + } + + return $str; + } + + private function dumpChildren($parent, Profile $profile, &$data) + { + foreach ($profile as $p) { + if ($p->isTemplate()) { + $name = $p->getTemplate(); + } else { + $name = sprintf('%s::%s(%s)', $p->getTemplate(), $p->getType(), $p->getName()); + } + $this->dumpProfile(sprintf('%s==>%s', $parent, $name), $p, $data); + $this->dumpChildren($name, $p, $data); + } + } + + private function dumpProfile($edge, Profile $profile, &$data) + { + if (isset($data[$edge])) { + ++$data[$edge]['ct']; + $data[$edge]['wt'] += floor($profile->getDuration() * 1000000); + $data[$edge]['mu'] += $profile->getMemoryUsage(); + $data[$edge]['pmu'] += $profile->getPeakMemoryUsage(); + } else { + $data[$edge] = [ + 'ct' => 1, + 'wt' => floor($profile->getDuration() * 1000000), + 'mu' => $profile->getMemoryUsage(), + 'pmu' => $profile->getPeakMemoryUsage(), + ]; + } + } +} + +class_alias('Twig\Profiler\Dumper\BlackfireDumper', 'Twig_Profiler_Dumper_Blackfire'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php b/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php new file mode 100755 index 0000000..c70b405 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/HtmlDumper.php @@ -0,0 +1,51 @@ + + * + * @final + */ +class HtmlDumper extends BaseDumper +{ + private static $colors = [ + 'block' => '#dfd', + 'macro' => '#ddf', + 'template' => '#ffd', + 'big' => '#d44', + ]; + + public function dump(Profile $profile) + { + return '
      '.parent::dump($profile).'
      '; + } + + protected function formatTemplate(Profile $profile, $prefix) + { + return sprintf('%s鈹� %s', $prefix, self::$colors['template'], $profile->getTemplate()); + } + + protected function formatNonTemplate(Profile $profile, $prefix) + { + return sprintf('%s鈹� %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), isset(self::$colors[$profile->getType()]) ? self::$colors[$profile->getType()] : 'auto', $profile->getName()); + } + + protected function formatTime(Profile $profile, $percent) + { + return sprintf('%.2fms/%.0f%%', $percent > 20 ? self::$colors['big'] : 'auto', $profile->getDuration() * 1000, $percent); + } +} + +class_alias('Twig\Profiler\Dumper\HtmlDumper', 'Twig_Profiler_Dumper_Html'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php b/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php new file mode 100755 index 0000000..c6b5158 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Profiler/Dumper/TextDumper.php @@ -0,0 +1,39 @@ + + * + * @final + */ +class TextDumper extends BaseDumper +{ + protected function formatTemplate(Profile $profile, $prefix) + { + return sprintf('%s鈹� %s', $prefix, $profile->getTemplate()); + } + + protected function formatNonTemplate(Profile $profile, $prefix) + { + return sprintf('%s鈹� %s::%s(%s)', $prefix, $profile->getTemplate(), $profile->getType(), $profile->getName()); + } + + protected function formatTime(Profile $profile, $percent) + { + return sprintf('%.2fms/%.0f%%', $profile->getDuration() * 1000, $percent); + } +} + +class_alias('Twig\Profiler\Dumper\TextDumper', 'Twig_Profiler_Dumper_Text'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php b/phpMyAdmin/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php new file mode 100755 index 0000000..8ffd3dc --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Profiler/Node/EnterProfileNode.php @@ -0,0 +1,44 @@ + + */ +class EnterProfileNode extends Node +{ + public function __construct($extensionName, $type, $name, $varName) + { + parent::__construct([], ['extension_name' => $extensionName, 'name' => $name, 'type' => $type, 'var_name' => $varName]); + } + + public function compile(Compiler $compiler) + { + $compiler + ->write(sprintf('$%s = $this->env->getExtension(', $this->getAttribute('var_name'))) + ->repr($this->getAttribute('extension_name')) + ->raw(");\n") + ->write(sprintf('$%s->enter($%s = new \Twig\Profiler\Profile($this->getTemplateName(), ', $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof')) + ->repr($this->getAttribute('type')) + ->raw(', ') + ->repr($this->getAttribute('name')) + ->raw("));\n\n") + ; + } +} + +class_alias('Twig\Profiler\Node\EnterProfileNode', 'Twig_Profiler_Node_EnterProfile'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php b/phpMyAdmin/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php new file mode 100755 index 0000000..3b7a74d --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Profiler/Node/LeaveProfileNode.php @@ -0,0 +1,38 @@ + + */ +class LeaveProfileNode extends Node +{ + public function __construct($varName) + { + parent::__construct([], ['var_name' => $varName]); + } + + public function compile(Compiler $compiler) + { + $compiler + ->write("\n") + ->write(sprintf("\$%s->leave(\$%s);\n\n", $this->getAttribute('var_name'), $this->getAttribute('var_name').'_prof')) + ; + } +} + +class_alias('Twig\Profiler\Node\LeaveProfileNode', 'Twig_Profiler_Node_LeaveProfile'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php b/phpMyAdmin/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php new file mode 100755 index 0000000..41ca9e1 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Profiler/NodeVisitor/ProfilerNodeVisitor.php @@ -0,0 +1,80 @@ + + * + * @final + */ +class ProfilerNodeVisitor extends AbstractNodeVisitor +{ + private $extensionName; + + public function __construct($extensionName) + { + $this->extensionName = $extensionName; + } + + protected function doEnterNode(Node $node, Environment $env) + { + return $node; + } + + protected function doLeaveNode(Node $node, Environment $env) + { + if ($node instanceof ModuleNode) { + $varName = $this->getVarName(); + $node->setNode('display_start', new Node([new EnterProfileNode($this->extensionName, Profile::TEMPLATE, $node->getTemplateName(), $varName), $node->getNode('display_start')])); + $node->setNode('display_end', new Node([new LeaveProfileNode($varName), $node->getNode('display_end')])); + } elseif ($node instanceof BlockNode) { + $varName = $this->getVarName(); + $node->setNode('body', new BodyNode([ + new EnterProfileNode($this->extensionName, Profile::BLOCK, $node->getAttribute('name'), $varName), + $node->getNode('body'), + new LeaveProfileNode($varName), + ])); + } elseif ($node instanceof MacroNode) { + $varName = $this->getVarName(); + $node->setNode('body', new BodyNode([ + new EnterProfileNode($this->extensionName, Profile::MACRO, $node->getAttribute('name'), $varName), + $node->getNode('body'), + new LeaveProfileNode($varName), + ])); + } + + return $node; + } + + private function getVarName() + { + return sprintf('__internal_%s', hash('sha256', $this->extensionName)); + } + + public function getPriority() + { + return 0; + } +} + +class_alias('Twig\Profiler\NodeVisitor\ProfilerNodeVisitor', 'Twig_Profiler_NodeVisitor_Profiler'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Profiler/Profile.php b/phpMyAdmin/vendor/twig/twig/src/Profiler/Profile.php new file mode 100755 index 0000000..d83da40 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Profiler/Profile.php @@ -0,0 +1,188 @@ + + * + * @final + */ +class Profile implements \IteratorAggregate, \Serializable +{ + const ROOT = 'ROOT'; + const BLOCK = 'block'; + const TEMPLATE = 'template'; + const MACRO = 'macro'; + + private $template; + private $name; + private $type; + private $starts = []; + private $ends = []; + private $profiles = []; + + public function __construct($template = 'main', $type = self::ROOT, $name = 'main') + { + $this->template = $template; + $this->type = $type; + $this->name = 0 === strpos($name, '__internal_') ? 'INTERNAL' : $name; + $this->enter(); + } + + public function getTemplate() + { + return $this->template; + } + + public function getType() + { + return $this->type; + } + + public function getName() + { + return $this->name; + } + + public function isRoot() + { + return self::ROOT === $this->type; + } + + public function isTemplate() + { + return self::TEMPLATE === $this->type; + } + + public function isBlock() + { + return self::BLOCK === $this->type; + } + + public function isMacro() + { + return self::MACRO === $this->type; + } + + public function getProfiles() + { + return $this->profiles; + } + + public function addProfile(self $profile) + { + $this->profiles[] = $profile; + } + + /** + * Returns the duration in microseconds. + * + * @return float + */ + public function getDuration() + { + if ($this->isRoot() && $this->profiles) { + // for the root node with children, duration is the sum of all child durations + $duration = 0; + foreach ($this->profiles as $profile) { + $duration += $profile->getDuration(); + } + + return $duration; + } + + return isset($this->ends['wt']) && isset($this->starts['wt']) ? $this->ends['wt'] - $this->starts['wt'] : 0; + } + + /** + * Returns the memory usage in bytes. + * + * @return int + */ + public function getMemoryUsage() + { + return isset($this->ends['mu']) && isset($this->starts['mu']) ? $this->ends['mu'] - $this->starts['mu'] : 0; + } + + /** + * Returns the peak memory usage in bytes. + * + * @return int + */ + public function getPeakMemoryUsage() + { + return isset($this->ends['pmu']) && isset($this->starts['pmu']) ? $this->ends['pmu'] - $this->starts['pmu'] : 0; + } + + /** + * Starts the profiling. + */ + public function enter() + { + $this->starts = [ + 'wt' => microtime(true), + 'mu' => memory_get_usage(), + 'pmu' => memory_get_peak_usage(), + ]; + } + + /** + * Stops the profiling. + */ + public function leave() + { + $this->ends = [ + 'wt' => microtime(true), + 'mu' => memory_get_usage(), + 'pmu' => memory_get_peak_usage(), + ]; + } + + public function reset() + { + $this->starts = $this->ends = $this->profiles = []; + $this->enter(); + } + + public function getIterator() + { + return new \ArrayIterator($this->profiles); + } + + public function serialize() + { + return serialize($this->__serialize()); + } + + public function unserialize($data) + { + $this->__unserialize(unserialize($data)); + } + + /** + * @internal + */ + public function __serialize() + { + return [$this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles]; + } + + /** + * @internal + */ + public function __unserialize(array $data) + { + list($this->template, $this->name, $this->type, $this->starts, $this->ends, $this->profiles) = $data; + } +} + +class_alias('Twig\Profiler\Profile', 'Twig_Profiler_Profile'); diff --git a/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php b/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php new file mode 100755 index 0000000..04a6602 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/ContainerRuntimeLoader.php @@ -0,0 +1,41 @@ + + * @author Robin Chalas + */ +class ContainerRuntimeLoader implements RuntimeLoaderInterface +{ + private $container; + + public function __construct(ContainerInterface $container) + { + $this->container = $container; + } + + public function load($class) + { + if ($this->container->has($class)) { + return $this->container->get($class); + } + } +} + +class_alias('Twig\RuntimeLoader\ContainerRuntimeLoader', 'Twig_ContainerRuntimeLoader'); diff --git a/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php b/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php new file mode 100755 index 0000000..43b5f24 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/FactoryRuntimeLoader.php @@ -0,0 +1,41 @@ + + */ +class FactoryRuntimeLoader implements RuntimeLoaderInterface +{ + private $map; + + /** + * @param array $map An array where keys are class names and values factory callables + */ + public function __construct($map = []) + { + $this->map = $map; + } + + public function load($class) + { + if (isset($this->map[$class])) { + $runtimeFactory = $this->map[$class]; + + return $runtimeFactory(); + } + } +} + +class_alias('Twig\RuntimeLoader\FactoryRuntimeLoader', 'Twig_FactoryRuntimeLoader'); diff --git a/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php b/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php new file mode 100755 index 0000000..4eb5ad8 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/RuntimeLoader/RuntimeLoaderInterface.php @@ -0,0 +1,31 @@ + + */ +interface RuntimeLoaderInterface +{ + /** + * Creates the runtime implementation of a Twig element (filter/function/test). + * + * @param string $class A runtime class + * + * @return object|null The runtime instance or null if the loader does not know how to create the runtime for this class + */ + public function load($class); +} + +class_alias('Twig\RuntimeLoader\RuntimeLoaderInterface', 'Twig_RuntimeLoaderInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityError.php b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityError.php new file mode 100755 index 0000000..5f96d46 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityError.php @@ -0,0 +1,25 @@ + + */ +class SecurityError extends Error +{ +} + +class_alias('Twig\Sandbox\SecurityError', 'Twig_Sandbox_SecurityError'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php new file mode 100755 index 0000000..fa0fdee --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFilterError.php @@ -0,0 +1,35 @@ + + */ +class SecurityNotAllowedFilterError extends SecurityError +{ + private $filterName; + + public function __construct($message, $functionName, $lineno = -1, $filename = null, \Exception $previous = null) + { + parent::__construct($message, $lineno, $filename, $previous); + $this->filterName = $functionName; + } + + public function getFilterName() + { + return $this->filterName; + } +} + +class_alias('Twig\Sandbox\SecurityNotAllowedFilterError', 'Twig_Sandbox_SecurityNotAllowedFilterError'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php new file mode 100755 index 0000000..8f23f93 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedFunctionError.php @@ -0,0 +1,35 @@ + + */ +class SecurityNotAllowedFunctionError extends SecurityError +{ + private $functionName; + + public function __construct($message, $functionName, $lineno = -1, $filename = null, \Exception $previous = null) + { + parent::__construct($message, $lineno, $filename, $previous); + $this->functionName = $functionName; + } + + public function getFunctionName() + { + return $this->functionName; + } +} + +class_alias('Twig\Sandbox\SecurityNotAllowedFunctionError', 'Twig_Sandbox_SecurityNotAllowedFunctionError'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php new file mode 100755 index 0000000..62e13f4 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedMethodError.php @@ -0,0 +1,42 @@ + + */ +class SecurityNotAllowedMethodError extends SecurityError +{ + private $className; + private $methodName; + + public function __construct($message, $className, $methodName, $lineno = -1, $filename = null, \Exception $previous = null) + { + parent::__construct($message, $lineno, $filename, $previous); + $this->className = $className; + $this->methodName = $methodName; + } + + public function getClassName() + { + return $this->className; + } + + public function getMethodName() + { + return $this->methodName; + } +} + +class_alias('Twig\Sandbox\SecurityNotAllowedMethodError', 'Twig_Sandbox_SecurityNotAllowedMethodError'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php new file mode 100755 index 0000000..3bf5305 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedPropertyError.php @@ -0,0 +1,42 @@ + + */ +class SecurityNotAllowedPropertyError extends SecurityError +{ + private $className; + private $propertyName; + + public function __construct($message, $className, $propertyName, $lineno = -1, $filename = null, \Exception $previous = null) + { + parent::__construct($message, $lineno, $filename, $previous); + $this->className = $className; + $this->propertyName = $propertyName; + } + + public function getClassName() + { + return $this->className; + } + + public function getPropertyName() + { + return $this->propertyName; + } +} + +class_alias('Twig\Sandbox\SecurityNotAllowedPropertyError', 'Twig_Sandbox_SecurityNotAllowedPropertyError'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php new file mode 100755 index 0000000..de283b4 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityNotAllowedTagError.php @@ -0,0 +1,35 @@ + + */ +class SecurityNotAllowedTagError extends SecurityError +{ + private $tagName; + + public function __construct($message, $tagName, $lineno = -1, $filename = null, \Exception $previous = null) + { + parent::__construct($message, $lineno, $filename, $previous); + $this->tagName = $tagName; + } + + public function getTagName() + { + return $this->tagName; + } +} + +class_alias('Twig\Sandbox\SecurityNotAllowedTagError', 'Twig_Sandbox_SecurityNotAllowedTagError'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityPolicy.php b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityPolicy.php new file mode 100755 index 0000000..6038435 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityPolicy.php @@ -0,0 +1,129 @@ + + */ +class SecurityPolicy implements SecurityPolicyInterface +{ + protected $allowedTags; + protected $allowedFilters; + protected $allowedMethods; + protected $allowedProperties; + protected $allowedFunctions; + + public function __construct(array $allowedTags = [], array $allowedFilters = [], array $allowedMethods = [], array $allowedProperties = [], array $allowedFunctions = []) + { + $this->allowedTags = $allowedTags; + $this->allowedFilters = $allowedFilters; + $this->setAllowedMethods($allowedMethods); + $this->allowedProperties = $allowedProperties; + $this->allowedFunctions = $allowedFunctions; + } + + public function setAllowedTags(array $tags) + { + $this->allowedTags = $tags; + } + + public function setAllowedFilters(array $filters) + { + $this->allowedFilters = $filters; + } + + public function setAllowedMethods(array $methods) + { + $this->allowedMethods = []; + foreach ($methods as $class => $m) { + $this->allowedMethods[$class] = array_map(function ($value) { return strtr($value, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); }, \is_array($m) ? $m : [$m]); + } + } + + public function setAllowedProperties(array $properties) + { + $this->allowedProperties = $properties; + } + + public function setAllowedFunctions(array $functions) + { + $this->allowedFunctions = $functions; + } + + public function checkSecurity($tags, $filters, $functions) + { + foreach ($tags as $tag) { + if (!\in_array($tag, $this->allowedTags)) { + throw new SecurityNotAllowedTagError(sprintf('Tag "%s" is not allowed.', $tag), $tag); + } + } + + foreach ($filters as $filter) { + if (!\in_array($filter, $this->allowedFilters)) { + throw new SecurityNotAllowedFilterError(sprintf('Filter "%s" is not allowed.', $filter), $filter); + } + } + + foreach ($functions as $function) { + if (!\in_array($function, $this->allowedFunctions)) { + throw new SecurityNotAllowedFunctionError(sprintf('Function "%s" is not allowed.', $function), $function); + } + } + } + + public function checkMethodAllowed($obj, $method) + { + if ($obj instanceof \Twig_TemplateInterface || $obj instanceof Markup) { + return; + } + + $allowed = false; + $method = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'); + foreach ($this->allowedMethods as $class => $methods) { + if ($obj instanceof $class) { + $allowed = \in_array($method, $methods); + + break; + } + } + + if (!$allowed) { + $class = \get_class($obj); + throw new SecurityNotAllowedMethodError(sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, $class), $class, $method); + } + } + + public function checkPropertyAllowed($obj, $property) + { + $allowed = false; + foreach ($this->allowedProperties as $class => $properties) { + if ($obj instanceof $class) { + $allowed = \in_array($property, \is_array($properties) ? $properties : [$properties]); + + break; + } + } + + if (!$allowed) { + $class = \get_class($obj); + throw new SecurityNotAllowedPropertyError(sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, $class), $class, $property); + } + } +} + +class_alias('Twig\Sandbox\SecurityPolicy', 'Twig_Sandbox_SecurityPolicy'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php new file mode 100755 index 0000000..a31863f --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Sandbox/SecurityPolicyInterface.php @@ -0,0 +1,28 @@ + + */ +interface SecurityPolicyInterface +{ + public function checkSecurity($tags, $filters, $functions); + + public function checkMethodAllowed($obj, $method); + + public function checkPropertyAllowed($obj, $method); +} + +class_alias('Twig\Sandbox\SecurityPolicyInterface', 'Twig_Sandbox_SecurityPolicyInterface'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Source.php b/phpMyAdmin/vendor/twig/twig/src/Source.php new file mode 100755 index 0000000..32a8216 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Source.php @@ -0,0 +1,55 @@ + + */ +class Source +{ + private $code; + private $name; + private $path; + + /** + * @param string $code The template source code + * @param string $name The template logical name + * @param string $path The filesystem path of the template if any + */ + public function __construct($code, $name, $path = '') + { + $this->code = $code; + $this->name = $name; + $this->path = $path; + } + + public function getCode() + { + return $this->code; + } + + public function getName() + { + return $this->name; + } + + public function getPath() + { + return $this->path; + } +} + +class_alias('Twig\Source', 'Twig_Source'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Template.php b/phpMyAdmin/vendor/twig/twig/src/Template.php new file mode 100755 index 0000000..704125e --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Template.php @@ -0,0 +1,733 @@ +load() + * instead, which returns an instance of \Twig\TemplateWrapper. + * + * @author Fabien Potencier + * + * @internal + */ +abstract class Template implements \Twig_TemplateInterface +{ + /** + * @internal + */ + protected static $cache = []; + + protected $parent; + protected $parents = []; + protected $env; + protected $blocks = []; + protected $traits = []; + protected $sandbox; + + public function __construct(Environment $env) + { + $this->env = $env; + } + + /** + * @internal this method will be removed in 2.0 and is only used internally to provide an upgrade path from 1.x to 2.0 + */ + public function __toString() + { + return $this->getTemplateName(); + } + + /** + * Returns the template name. + * + * @return string The template name + */ + abstract public function getTemplateName(); + + /** + * Returns debug information about the template. + * + * @return array Debug information + */ + public function getDebugInfo() + { + return []; + } + + /** + * Returns the template source code. + * + * @return string The template source code + * + * @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead + */ + public function getSource() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); + + return ''; + } + + /** + * Returns information about the original template source code. + * + * @return Source + */ + public function getSourceContext() + { + return new Source('', $this->getTemplateName()); + } + + /** + * @deprecated since 1.20 (to be removed in 2.0) + */ + public function getEnvironment() + { + @trigger_error('The '.__METHOD__.' method is deprecated since version 1.20 and will be removed in 2.0.', E_USER_DEPRECATED); + + return $this->env; + } + + /** + * Returns the parent template. + * + * This method is for internal use only and should never be called + * directly. + * + * @param array $context + * + * @return \Twig_TemplateInterface|TemplateWrapper|false The parent template or false if there is no parent + * + * @internal + */ + public function getParent(array $context) + { + if (null !== $this->parent) { + return $this->parent; + } + + try { + $parent = $this->doGetParent($context); + + if (false === $parent) { + return false; + } + + if ($parent instanceof self || $parent instanceof TemplateWrapper) { + return $this->parents[$parent->getSourceContext()->getName()] = $parent; + } + + if (!isset($this->parents[$parent])) { + $this->parents[$parent] = $this->loadTemplate($parent); + } + } catch (LoaderError $e) { + $e->setSourceContext(null); + $e->guess(); + + throw $e; + } + + return $this->parents[$parent]; + } + + protected function doGetParent(array $context) + { + return false; + } + + public function isTraitable() + { + return true; + } + + /** + * Displays a parent block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to display from the parent + * @param array $context The context + * @param array $blocks The current set of blocks + */ + public function displayParentBlock($name, array $context, array $blocks = []) + { + $name = (string) $name; + + if (isset($this->traits[$name])) { + $this->traits[$name][0]->displayBlock($name, $context, $blocks, false); + } elseif (false !== $parent = $this->getParent($context)) { + $parent->displayBlock($name, $context, $blocks, false); + } else { + throw new RuntimeError(sprintf('The template has no parent and no traits defining the "%s" block.', $name), -1, $this->getSourceContext()); + } + } + + /** + * Displays a block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to display + * @param array $context The context + * @param array $blocks The current set of blocks + * @param bool $useBlocks Whether to use the current set of blocks + */ + public function displayBlock($name, array $context, array $blocks = [], $useBlocks = true) + { + $name = (string) $name; + + if ($useBlocks && isset($blocks[$name])) { + $template = $blocks[$name][0]; + $block = $blocks[$name][1]; + } elseif (isset($this->blocks[$name])) { + $template = $this->blocks[$name][0]; + $block = $this->blocks[$name][1]; + } else { + $template = null; + $block = null; + } + + // avoid RCEs when sandbox is enabled + if (null !== $template && !$template instanceof self) { + throw new \LogicException('A block must be a method on a \Twig\Template instance.'); + } + + if (null !== $template) { + try { + $template->$block($context, $blocks); + } catch (Error $e) { + if (!$e->getSourceContext()) { + $e->setSourceContext($template->getSourceContext()); + } + + // this is mostly useful for \Twig\Error\LoaderError exceptions + // see \Twig\Error\LoaderError + if (-1 === $e->getTemplateLine()) { + $e->guess(); + } + + throw $e; + } catch (\Exception $e) { + $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e); + $e->guess(); + + throw $e; + } + } elseif (false !== $parent = $this->getParent($context)) { + $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false); + } else { + @trigger_error(sprintf('Silent display of undefined block "%s" in template "%s" is deprecated since version 1.29 and will throw an exception in 2.0. Use the "block(\'%s\') is defined" expression to test for block existence.', $name, $this->getTemplateName(), $name), E_USER_DEPRECATED); + } + } + + /** + * Renders a parent block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to render from the parent + * @param array $context The context + * @param array $blocks The current set of blocks + * + * @return string The rendered block + */ + public function renderParentBlock($name, array $context, array $blocks = []) + { + if ($this->env->isDebug()) { + ob_start(); + } else { + ob_start(function () { return ''; }); + } + $this->displayParentBlock($name, $context, $blocks); + + return ob_get_clean(); + } + + /** + * Renders a block. + * + * This method is for internal use only and should never be called + * directly. + * + * @param string $name The block name to render + * @param array $context The context + * @param array $blocks The current set of blocks + * @param bool $useBlocks Whether to use the current set of blocks + * + * @return string The rendered block + */ + public function renderBlock($name, array $context, array $blocks = [], $useBlocks = true) + { + if ($this->env->isDebug()) { + ob_start(); + } else { + ob_start(function () { return ''; }); + } + $this->displayBlock($name, $context, $blocks, $useBlocks); + + return ob_get_clean(); + } + + /** + * Returns whether a block exists or not in the current context of the template. + * + * This method checks blocks defined in the current template + * or defined in "used" traits or defined in parent templates. + * + * @param string $name The block name + * @param array $context The context + * @param array $blocks The current set of blocks + * + * @return bool true if the block exists, false otherwise + */ + public function hasBlock($name, array $context = null, array $blocks = []) + { + if (null === $context) { + @trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED); + + return isset($this->blocks[(string) $name]); + } + + if (isset($blocks[$name])) { + return $blocks[$name][0] instanceof self; + } + + if (isset($this->blocks[$name])) { + return true; + } + + if (false !== $parent = $this->getParent($context)) { + return $parent->hasBlock($name, $context); + } + + return false; + } + + /** + * Returns all block names in the current context of the template. + * + * This method checks blocks defined in the current template + * or defined in "used" traits or defined in parent templates. + * + * @param array $context The context + * @param array $blocks The current set of blocks + * + * @return array An array of block names + */ + public function getBlockNames(array $context = null, array $blocks = []) + { + if (null === $context) { + @trigger_error('The '.__METHOD__.' method is internal and should never be called; calling it directly is deprecated since version 1.28 and won\'t be possible anymore in 2.0.', E_USER_DEPRECATED); + + return array_keys($this->blocks); + } + + $names = array_merge(array_keys($blocks), array_keys($this->blocks)); + + if (false !== $parent = $this->getParent($context)) { + $names = array_merge($names, $parent->getBlockNames($context)); + } + + return array_unique($names); + } + + /** + * @return Template|TemplateWrapper + */ + protected function loadTemplate($template, $templateName = null, $line = null, $index = null) + { + try { + if (\is_array($template)) { + return $this->env->resolveTemplate($template); + } + + if ($template instanceof self || $template instanceof TemplateWrapper) { + return $template; + } + + if ($template === $this->getTemplateName()) { + $class = \get_class($this); + if (false !== $pos = strrpos($class, '___', -1)) { + $class = substr($class, 0, $pos); + } + + return $this->env->loadClass($class, $template, $index); + } + + return $this->env->loadTemplate($template, $index); + } catch (Error $e) { + if (!$e->getSourceContext()) { + $e->setSourceContext($templateName ? new Source('', $templateName) : $this->getSourceContext()); + } + + if ($e->getTemplateLine() > 0) { + throw $e; + } + + if (!$line) { + $e->guess(); + } else { + $e->setTemplateLine($line); + } + + throw $e; + } + } + + /** + * @internal + * + * @return Template + */ + protected function unwrap() + { + return $this; + } + + /** + * Returns all blocks. + * + * This method is for internal use only and should never be called + * directly. + * + * @return array An array of blocks + */ + public function getBlocks() + { + return $this->blocks; + } + + public function display(array $context, array $blocks = []) + { + $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks)); + } + + public function render(array $context) + { + $level = ob_get_level(); + if ($this->env->isDebug()) { + ob_start(); + } else { + ob_start(function () { return ''; }); + } + try { + $this->display($context); + } catch (\Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } catch (\Throwable $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } + + return ob_get_clean(); + } + + protected function displayWithErrorHandling(array $context, array $blocks = []) + { + try { + $this->doDisplay($context, $blocks); + } catch (Error $e) { + if (!$e->getSourceContext()) { + $e->setSourceContext($this->getSourceContext()); + } + + // this is mostly useful for \Twig\Error\LoaderError exceptions + // see \Twig\Error\LoaderError + if (-1 === $e->getTemplateLine()) { + $e->guess(); + } + + throw $e; + } catch (\Exception $e) { + $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e); + $e->guess(); + + throw $e; + } + } + + /** + * Auto-generated method to display the template with the given context. + * + * @param array $context An array of parameters to pass to the template + * @param array $blocks An array of blocks to pass to the template + */ + abstract protected function doDisplay(array $context, array $blocks = []); + + /** + * Returns a variable from the context. + * + * This method is for internal use only and should never be called + * directly. + * + * This method should not be overridden in a sub-class as this is an + * implementation detail that has been introduced to optimize variable + * access for versions of PHP before 5.4. This is not a way to override + * the way to get a variable value. + * + * @param array $context The context + * @param string $item The variable to return from the context + * @param bool $ignoreStrictCheck Whether to ignore the strict variable check or not + * + * @return mixed The content of the context variable + * + * @throws RuntimeError if the variable does not exist and Twig is running in strict mode + * + * @internal + */ + final protected function getContext($context, $item, $ignoreStrictCheck = false) + { + if (!\array_key_exists($item, $context)) { + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return; + } + + throw new RuntimeError(sprintf('Variable "%s" does not exist.', $item), -1, $this->getSourceContext()); + } + + return $context[$item]; + } + + /** + * Returns the attribute value for a given array/object. + * + * @param mixed $object The object or array from where to get the item + * @param mixed $item The item to get from the array or object + * @param array $arguments An array of arguments to pass if the item is an object method + * @param string $type The type of attribute (@see \Twig\Template constants) + * @param bool $isDefinedTest Whether this is only a defined check + * @param bool $ignoreStrictCheck Whether to ignore the strict attribute check or not + * + * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true + * + * @throws RuntimeError if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false + * + * @internal + */ + protected function getAttribute($object, $item, array $arguments = [], $type = self::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false) + { + // array + if (self::METHOD_CALL !== $type) { + $arrayItem = \is_bool($item) || \is_float($item) ? (int) $item : $item; + + if (((\is_array($object) || $object instanceof \ArrayObject) && (isset($object[$arrayItem]) || \array_key_exists($arrayItem, (array) $object))) + || ($object instanceof \ArrayAccess && isset($object[$arrayItem])) + ) { + if ($isDefinedTest) { + return true; + } + + return $object[$arrayItem]; + } + + if (self::ARRAY_CALL === $type || !\is_object($object)) { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return; + } + + if ($object instanceof \ArrayAccess) { + $message = sprintf('Key "%s" in object with ArrayAccess of class "%s" does not exist.', $arrayItem, \get_class($object)); + } elseif (\is_object($object)) { + $message = sprintf('Impossible to access a key "%s" on an object of class "%s" that does not implement ArrayAccess interface.', $item, \get_class($object)); + } elseif (\is_array($object)) { + if (empty($object)) { + $message = sprintf('Key "%s" does not exist as the array is empty.', $arrayItem); + } else { + $message = sprintf('Key "%s" for array with keys "%s" does not exist.', $arrayItem, implode(', ', array_keys($object))); + } + } elseif (self::ARRAY_CALL === $type) { + if (null === $object) { + $message = sprintf('Impossible to access a key ("%s") on a null variable.', $item); + } else { + $message = sprintf('Impossible to access a key ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); + } + } elseif (null === $object) { + $message = sprintf('Impossible to access an attribute ("%s") on a null variable.', $item); + } else { + $message = sprintf('Impossible to access an attribute ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); + } + + throw new RuntimeError($message, -1, $this->getSourceContext()); + } + } + + if (!\is_object($object)) { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return; + } + + if (null === $object) { + $message = sprintf('Impossible to invoke a method ("%s") on a null variable.', $item); + } elseif (\is_array($object)) { + $message = sprintf('Impossible to invoke a method ("%s") on an array.', $item); + } else { + $message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, \gettype($object), $object); + } + + throw new RuntimeError($message, -1, $this->getSourceContext()); + } + + // object property + if (self::METHOD_CALL !== $type && !$object instanceof self) { // \Twig\Template does not have public properties, and we don't want to allow access to internal ones + if (isset($object->$item) || \array_key_exists((string) $item, (array) $object)) { + if ($isDefinedTest) { + return true; + } + + if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) { + $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkPropertyAllowed($object, $item); + } + + return $object->$item; + } + } + + $class = \get_class($object); + + // object method + if (!isset(self::$cache[$class])) { + // get_class_methods returns all methods accessible in the scope, but we only want public ones to be accessible in templates + if ($object instanceof self) { + $ref = new \ReflectionClass($class); + $methods = []; + + foreach ($ref->getMethods(\ReflectionMethod::IS_PUBLIC) as $refMethod) { + // Accessing the environment from templates is forbidden to prevent untrusted changes to the environment + if ('getenvironment' !== strtr($refMethod->name, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')) { + $methods[] = $refMethod->name; + } + } + } else { + $methods = get_class_methods($object); + } + // sort values to have consistent behavior, so that "get" methods win precedence over "is" methods + sort($methods); + + $cache = []; + + foreach ($methods as $method) { + $cache[$method] = $method; + $cache[$lcName = strtr($method, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')] = $method; + + if ('g' === $lcName[0] && 0 === strpos($lcName, 'get')) { + $name = substr($method, 3); + $lcName = substr($lcName, 3); + } elseif ('i' === $lcName[0] && 0 === strpos($lcName, 'is')) { + $name = substr($method, 2); + $lcName = substr($lcName, 2); + } else { + continue; + } + + // skip get() and is() methods (in which case, $name is empty) + if ($name) { + if (!isset($cache[$name])) { + $cache[$name] = $method; + } + if (!isset($cache[$lcName])) { + $cache[$lcName] = $method; + } + } + } + self::$cache[$class] = $cache; + } + + $call = false; + if (isset(self::$cache[$class][$item])) { + $method = self::$cache[$class][$item]; + } elseif (isset(self::$cache[$class][$lcItem = strtr($item, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')])) { + $method = self::$cache[$class][$lcItem]; + } elseif (isset(self::$cache[$class]['__call'])) { + $method = $item; + $call = true; + } else { + if ($isDefinedTest) { + return false; + } + + if ($ignoreStrictCheck || !$this->env->isStrictVariables()) { + return; + } + + throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext()); + } + + if ($isDefinedTest) { + return true; + } + + if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) { + $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method); + } + + // Some objects throw exceptions when they have __call, and the method we try + // to call is not supported. If ignoreStrictCheck is true, we should return null. + try { + if (!$arguments) { + $ret = $object->$method(); + } else { + $ret = \call_user_func_array([$object, $method], $arguments); + } + } catch (\BadMethodCallException $e) { + if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) { + return; + } + throw $e; + } + + // @deprecated in 1.28 + if ($object instanceof \Twig_TemplateInterface) { + $self = $object->getTemplateName() === $this->getTemplateName(); + $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName()); + if ('renderBlock' === $method || 'displayBlock' === $method) { + $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template'); + } elseif ('hasBlock' === $method) { + $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template'); + } elseif ('render' === $method || 'display' === $method) { + $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName()); + } + @trigger_error($message, E_USER_DEPRECATED); + + return '' === $ret ? '' : new Markup($ret, $this->env->getCharset()); + } + + return $ret; + } +} + +class_alias('Twig\Template', 'Twig_Template'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TemplateWrapper.php b/phpMyAdmin/vendor/twig/twig/src/TemplateWrapper.php new file mode 100755 index 0000000..e265409 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TemplateWrapper.php @@ -0,0 +1,161 @@ + + */ +final class TemplateWrapper +{ + private $env; + private $template; + + /** + * This method is for internal use only and should never be called + * directly (use Twig\Environment::load() instead). + * + * @internal + */ + public function __construct(Environment $env, Template $template) + { + $this->env = $env; + $this->template = $template; + } + + /** + * Renders the template. + * + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered template + */ + public function render($context = []) + { + // using func_get_args() allows to not expose the blocks argument + // as it should only be used by internal code + return $this->template->render($context, \func_num_args() > 1 ? func_get_arg(1) : []); + } + + /** + * Displays the template. + * + * @param array $context An array of parameters to pass to the template + */ + public function display($context = []) + { + // using func_get_args() allows to not expose the blocks argument + // as it should only be used by internal code + $this->template->display($context, \func_num_args() > 1 ? func_get_arg(1) : []); + } + + /** + * Checks if a block is defined. + * + * @param string $name The block name + * @param array $context An array of parameters to pass to the template + * + * @return bool + */ + public function hasBlock($name, $context = []) + { + return $this->template->hasBlock($name, $context); + } + + /** + * Returns defined block names in the template. + * + * @param array $context An array of parameters to pass to the template + * + * @return string[] An array of defined template block names + */ + public function getBlockNames($context = []) + { + return $this->template->getBlockNames($context); + } + + /** + * Renders a template block. + * + * @param string $name The block name to render + * @param array $context An array of parameters to pass to the template + * + * @return string The rendered block + */ + public function renderBlock($name, $context = []) + { + $context = $this->env->mergeGlobals($context); + $level = ob_get_level(); + if ($this->env->isDebug()) { + ob_start(); + } else { + ob_start(function () { return ''; }); + } + try { + $this->template->displayBlock($name, $context); + } catch (\Exception $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } catch (\Throwable $e) { + while (ob_get_level() > $level) { + ob_end_clean(); + } + + throw $e; + } + + return ob_get_clean(); + } + + /** + * Displays a template block. + * + * @param string $name The block name to render + * @param array $context An array of parameters to pass to the template + */ + public function displayBlock($name, $context = []) + { + $this->template->displayBlock($name, $this->env->mergeGlobals($context)); + } + + /** + * @return Source + */ + public function getSourceContext() + { + return $this->template->getSourceContext(); + } + + /** + * @return string + */ + public function getTemplateName() + { + return $this->template->getTemplateName(); + } + + /** + * @internal + * + * @return Template + */ + public function unwrap() + { + return $this->template; + } +} + +class_alias('Twig\TemplateWrapper', 'Twig_TemplateWrapper'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Test/IntegrationTestCase.php b/phpMyAdmin/vendor/twig/twig/src/Test/IntegrationTestCase.php new file mode 100755 index 0000000..36b3607 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Test/IntegrationTestCase.php @@ -0,0 +1,257 @@ + + * @author Karma Dordrak + */ +abstract class IntegrationTestCase extends TestCase +{ + /** + * @return string + */ + abstract protected function getFixturesDir(); + + /** + * @return RuntimeLoaderInterface[] + */ + protected function getRuntimeLoaders() + { + return []; + } + + /** + * @return ExtensionInterface[] + */ + protected function getExtensions() + { + return []; + } + + /** + * @return TwigFilter[] + */ + protected function getTwigFilters() + { + return []; + } + + /** + * @return TwigFunction[] + */ + protected function getTwigFunctions() + { + return []; + } + + /** + * @return TwigTest[] + */ + protected function getTwigTests() + { + return []; + } + + /** + * @dataProvider getTests + */ + public function testIntegration($file, $message, $condition, $templates, $exception, $outputs) + { + $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs); + } + + /** + * @dataProvider getLegacyTests + * @group legacy + */ + public function testLegacyIntegration($file, $message, $condition, $templates, $exception, $outputs) + { + $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs); + } + + public function getTests($name, $legacyTests = false) + { + $fixturesDir = realpath($this->getFixturesDir()); + $tests = []; + + foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($fixturesDir), \RecursiveIteratorIterator::LEAVES_ONLY) as $file) { + if (!preg_match('/\.test$/', $file)) { + continue; + } + + if ($legacyTests xor false !== strpos($file->getRealpath(), '.legacy.test')) { + continue; + } + + $test = file_get_contents($file->getRealpath()); + + if (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = self::parseTemplates($match[3]); + $exception = $match[5]; + $outputs = [[null, $match[4], null, '']]; + } elseif (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) { + $message = $match[1]; + $condition = $match[2]; + $templates = self::parseTemplates($match[3]); + $exception = false; + preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER); + } else { + throw new \InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file))); + } + + $tests[] = [str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs]; + } + + if ($legacyTests && empty($tests)) { + // add a dummy test to avoid a PHPUnit message + return [['not', '-', '', [], '', []]]; + } + + return $tests; + } + + public function getLegacyTests() + { + return $this->getTests('testLegacyIntegration', true); + } + + protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs) + { + if (!$outputs) { + $this->markTestSkipped('no tests to run'); + } + + if ($condition) { + eval('$ret = '.$condition.';'); + if (!$ret) { + $this->markTestSkipped($condition); + } + } + + $loader = new ArrayLoader($templates); + + foreach ($outputs as $i => $match) { + $config = array_merge([ + 'cache' => false, + 'strict_variables' => true, + ], $match[2] ? eval($match[2].';') : []); + $twig = new Environment($loader, $config); + $twig->addGlobal('global', 'global'); + foreach ($this->getRuntimeLoaders() as $runtimeLoader) { + $twig->addRuntimeLoader($runtimeLoader); + } + + foreach ($this->getExtensions() as $extension) { + $twig->addExtension($extension); + } + + foreach ($this->getTwigFilters() as $filter) { + $twig->addFilter($filter); + } + + foreach ($this->getTwigTests() as $test) { + $twig->addTest($test); + } + + foreach ($this->getTwigFunctions() as $function) { + $twig->addFunction($function); + } + + $p = new \ReflectionProperty($twig, 'templateClassPrefix'); + $p->setAccessible(true); + $p->setValue($twig, '__TwigTemplate_'.hash('sha256', uniqid(mt_rand(), true), false).'_'); + + try { + $template = $twig->load('index.twig'); + } catch (\Exception $e) { + if (false !== $exception) { + $message = $e->getMessage(); + $this->assertSame(trim($exception), trim(sprintf('%s: %s', \get_class($e), $message))); + $last = substr($message, \strlen($message) - 1); + $this->assertTrue('.' === $last || '?' === $last, 'Exception message must end with a dot or a question mark.'); + + return; + } + + throw new Error(sprintf('%s: %s', \get_class($e), $e->getMessage()), -1, null, $e); + } + + try { + $output = trim($template->render(eval($match[1].';')), "\n "); + } catch (\Exception $e) { + if (false !== $exception) { + $this->assertSame(trim($exception), trim(sprintf('%s: %s', \get_class($e), $e->getMessage()))); + + return; + } + + $e = new Error(sprintf('%s: %s', \get_class($e), $e->getMessage()), -1, null, $e); + + $output = trim(sprintf('%s: %s', \get_class($e), $e->getMessage())); + } + + if (false !== $exception) { + list($class) = explode(':', $exception); + $constraintClass = class_exists('PHPUnit\Framework\Constraint\Exception') ? 'PHPUnit\Framework\Constraint\Exception' : 'PHPUnit_Framework_Constraint_Exception'; + $this->assertThat(null, new $constraintClass($class)); + } + + $expected = trim($match[3], "\n "); + + if ($expected !== $output) { + printf("Compiled templates that failed on case %d:\n", $i + 1); + + foreach (array_keys($templates) as $name) { + echo "Template: $name\n"; + $loader = $twig->getLoader(); + if (!$loader instanceof SourceContextLoaderInterface) { + $source = new Source($loader->getSource($name), $name); + } else { + $source = $loader->getSourceContext($name); + } + echo $twig->compile($twig->parse($twig->tokenize($source))); + } + } + $this->assertEquals($expected, $output, $message.' (in '.$file.')'); + } + } + + protected static function parseTemplates($test) + { + $templates = []; + preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $templates[($match[1] ? $match[1] : 'index.twig')] = $match[2]; + } + + return $templates; + } +} + +class_alias('Twig\Test\IntegrationTestCase', 'Twig_Test_IntegrationTestCase'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Test/NodeTestCase.php b/phpMyAdmin/vendor/twig/twig/src/Test/NodeTestCase.php new file mode 100755 index 0000000..f3358cb --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Test/NodeTestCase.php @@ -0,0 +1,79 @@ +assertNodeCompilation($source, $node, $environment, $isPattern); + } + + public function assertNodeCompilation($source, Node $node, Environment $environment = null, $isPattern = false) + { + $compiler = $this->getCompiler($environment); + $compiler->compile($node); + + if ($isPattern) { + $this->assertStringMatchesFormat($source, trim($compiler->getSource())); + } else { + $this->assertEquals($source, trim($compiler->getSource())); + } + } + + protected function getCompiler(Environment $environment = null) + { + return new Compiler(null === $environment ? $this->getEnvironment() : $environment); + } + + protected function getEnvironment() + { + return new Environment(new ArrayLoader([])); + } + + protected function getVariableGetter($name, $line = false) + { + $line = $line > 0 ? "// line {$line}\n" : ''; + + if (\PHP_VERSION_ID >= 70000) { + return sprintf('%s($context["%s"] ?? null)', $line, $name); + } + + if (\PHP_VERSION_ID >= 50400) { + return sprintf('%s(isset($context["%s"]) ? $context["%s"] : null)', $line, $name, $name); + } + + return sprintf('%s$this->getContext($context, "%s")', $line, $name); + } + + protected function getAttributeGetter() + { + if (\function_exists('twig_template_get_attributes')) { + return 'twig_template_get_attributes($this, '; + } + + return '$this->getAttribute('; + } +} + +class_alias('Twig\Test\NodeTestCase', 'Twig_Test_NodeTestCase'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Token.php b/phpMyAdmin/vendor/twig/twig/src/Token.php new file mode 100755 index 0000000..a0bb11a --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Token.php @@ -0,0 +1,215 @@ + + * + * @final + */ +class Token +{ + protected $value; + protected $type; + protected $lineno; + + const EOF_TYPE = -1; + const TEXT_TYPE = 0; + const BLOCK_START_TYPE = 1; + const VAR_START_TYPE = 2; + const BLOCK_END_TYPE = 3; + const VAR_END_TYPE = 4; + const NAME_TYPE = 5; + const NUMBER_TYPE = 6; + const STRING_TYPE = 7; + const OPERATOR_TYPE = 8; + const PUNCTUATION_TYPE = 9; + const INTERPOLATION_START_TYPE = 10; + const INTERPOLATION_END_TYPE = 11; + const ARROW_TYPE = 12; + + /** + * @param int $type The type of the token + * @param string $value The token value + * @param int $lineno The line position in the source + */ + public function __construct($type, $value, $lineno) + { + $this->type = $type; + $this->value = $value; + $this->lineno = $lineno; + } + + public function __toString() + { + return sprintf('%s(%s)', self::typeToString($this->type, true), $this->value); + } + + /** + * Tests the current token for a type and/or a value. + * + * Parameters may be: + * * just type + * * type and value (or array of possible values) + * * just value (or array of possible values) (NAME_TYPE is used as type) + * + * @param array|string|int $type The type to test + * @param array|string|null $values The token value + * + * @return bool + */ + public function test($type, $values = null) + { + if (null === $values && !\is_int($type)) { + $values = $type; + $type = self::NAME_TYPE; + } + + return ($this->type === $type) && ( + null === $values || + (\is_array($values) && \in_array($this->value, $values)) || + $this->value == $values + ); + } + + /** + * @return int + */ + public function getLine() + { + return $this->lineno; + } + + /** + * @return int + */ + public function getType() + { + return $this->type; + } + + /** + * @return string + */ + public function getValue() + { + return $this->value; + } + + /** + * Returns the constant representation (internal) of a given type. + * + * @param int $type The type as an integer + * @param bool $short Whether to return a short representation or not + * + * @return string The string representation + */ + public static function typeToString($type, $short = false) + { + switch ($type) { + case self::EOF_TYPE: + $name = 'EOF_TYPE'; + break; + case self::TEXT_TYPE: + $name = 'TEXT_TYPE'; + break; + case self::BLOCK_START_TYPE: + $name = 'BLOCK_START_TYPE'; + break; + case self::VAR_START_TYPE: + $name = 'VAR_START_TYPE'; + break; + case self::BLOCK_END_TYPE: + $name = 'BLOCK_END_TYPE'; + break; + case self::VAR_END_TYPE: + $name = 'VAR_END_TYPE'; + break; + case self::NAME_TYPE: + $name = 'NAME_TYPE'; + break; + case self::NUMBER_TYPE: + $name = 'NUMBER_TYPE'; + break; + case self::STRING_TYPE: + $name = 'STRING_TYPE'; + break; + case self::OPERATOR_TYPE: + $name = 'OPERATOR_TYPE'; + break; + case self::PUNCTUATION_TYPE: + $name = 'PUNCTUATION_TYPE'; + break; + case self::INTERPOLATION_START_TYPE: + $name = 'INTERPOLATION_START_TYPE'; + break; + case self::INTERPOLATION_END_TYPE: + $name = 'INTERPOLATION_END_TYPE'; + break; + case self::ARROW_TYPE: + $name = 'ARROW_TYPE'; + break; + default: + throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); + } + + return $short ? $name : 'Twig\Token::'.$name; + } + + /** + * Returns the English representation of a given type. + * + * @param int $type The type as an integer + * + * @return string The string representation + */ + public static function typeToEnglish($type) + { + switch ($type) { + case self::EOF_TYPE: + return 'end of template'; + case self::TEXT_TYPE: + return 'text'; + case self::BLOCK_START_TYPE: + return 'begin of statement block'; + case self::VAR_START_TYPE: + return 'begin of print statement'; + case self::BLOCK_END_TYPE: + return 'end of statement block'; + case self::VAR_END_TYPE: + return 'end of print statement'; + case self::NAME_TYPE: + return 'name'; + case self::NUMBER_TYPE: + return 'number'; + case self::STRING_TYPE: + return 'string'; + case self::OPERATOR_TYPE: + return 'operator'; + case self::PUNCTUATION_TYPE: + return 'punctuation'; + case self::INTERPOLATION_START_TYPE: + return 'begin of string interpolation'; + case self::INTERPOLATION_END_TYPE: + return 'end of string interpolation'; + case self::ARROW_TYPE: + return 'arrow function'; + default: + throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type)); + } + } +} + +class_alias('Twig\Token', 'Twig_Token'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php new file mode 100755 index 0000000..2c2f90b --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/AbstractTokenParser.php @@ -0,0 +1,34 @@ + + */ +abstract class AbstractTokenParser implements TokenParserInterface +{ + /** + * @var Parser + */ + protected $parser; + + public function setParser(Parser $parser) + { + $this->parser = $parser; + } +} + +class_alias('Twig\TokenParser\AbstractTokenParser', 'Twig_TokenParser'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php new file mode 100755 index 0000000..879879a --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/ApplyTokenParser.php @@ -0,0 +1,58 @@ +getLine(); + $name = $this->parser->getVarName(); + + $ref = new TempNameExpression($name, $lineno); + $ref->setAttribute('always_defined', true); + + $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); + + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideApplyEnd'], true); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new Node([ + new SetNode(true, $ref, $body, $lineno, $this->getTag()), + new PrintNode($filter, $lineno, $this->getTag()), + ]); + } + + public function decideApplyEnd(Token $token) + { + return $token->test('endapply'); + } + + public function getTag() + { + return 'apply'; + } +} diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php new file mode 100755 index 0000000..2cd0cc6 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/AutoEscapeTokenParser.php @@ -0,0 +1,88 @@ +getLine(); + $stream = $this->parser->getStream(); + + if ($stream->test(Token::BLOCK_END_TYPE)) { + $value = 'html'; + } else { + $expr = $this->parser->getExpressionParser()->parseExpression(); + if (!$expr instanceof ConstantExpression) { + throw new SyntaxError('An escaping strategy must be a string or a bool.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + $value = $expr->getAttribute('value'); + + $compat = true === $value || false === $value; + + if (true === $value) { + $value = 'html'; + } + + if ($compat && $stream->test(Token::NAME_TYPE)) { + @trigger_error('Using the autoescape tag with "true" or "false" before the strategy name is deprecated since version 1.21.', E_USER_DEPRECATED); + + if (false === $value) { + throw new SyntaxError('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + + $value = $stream->next()->getValue(); + } + } + + $stream->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + $stream->expect(Token::BLOCK_END_TYPE); + + return new AutoEscapeNode($value, $body, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endautoescape'); + } + + public function getTag() + { + return 'autoescape'; + } +} + +class_alias('Twig\TokenParser\AutoEscapeTokenParser', 'Twig_TokenParser_AutoEscape'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/BlockTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/BlockTokenParser.php new file mode 100755 index 0000000..caf11f0 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/BlockTokenParser.php @@ -0,0 +1,80 @@ + + * {% block title %}{% endblock %} - My Webpage + * {% endblock %} + * + * @final + */ +class BlockTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) + { + $lineno = $token->getLine(); + $stream = $this->parser->getStream(); + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + if ($this->parser->hasBlock($name)) { + throw new SyntaxError(sprintf("The block '%s' has already been defined line %d.", $name, $this->parser->getBlock($name)->getTemplateLine()), $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + $this->parser->setBlock($name, $block = new BlockNode($name, new Node([]), $lineno)); + $this->parser->pushLocalScope(); + $this->parser->pushBlockStack($name); + + if ($stream->nextIf(Token::BLOCK_END_TYPE)) { + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + if ($token = $stream->nextIf(Token::NAME_TYPE)) { + $value = $token->getValue(); + + if ($value != $name) { + throw new SyntaxError(sprintf('Expected endblock for block "%s" (but "%s" given).', $name, $value), $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + } + } else { + $body = new Node([ + new PrintNode($this->parser->getExpressionParser()->parseExpression(), $lineno), + ]); + } + $stream->expect(Token::BLOCK_END_TYPE); + + $block->setNode('body', $body); + $this->parser->popBlockStack(); + $this->parser->popLocalScope(); + + return new BlockReferenceNode($name, $lineno, $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endblock'); + } + + public function getTag() + { + return 'block'; + } +} + +class_alias('Twig\TokenParser\BlockTokenParser', 'Twig_TokenParser_Block'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php new file mode 100755 index 0000000..6575cff --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/DeprecatedTokenParser.php @@ -0,0 +1,44 @@ + + * + * @final + */ +class DeprecatedTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) + { + $expr = $this->parser->getExpressionParser()->parseExpression(); + + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new DeprecatedNode($expr, $token->getLine(), $this->getTag()); + } + + public function getTag() + { + return 'deprecated'; + } +} + +class_alias('Twig\TokenParser\DeprecatedTokenParser', 'Twig_TokenParser_Deprecated'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/DoTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/DoTokenParser.php new file mode 100755 index 0000000..e1eae10 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/DoTokenParser.php @@ -0,0 +1,39 @@ +parser->getExpressionParser()->parseExpression(); + + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new DoNode($expr, $token->getLine(), $this->getTag()); + } + + public function getTag() + { + return 'do'; + } +} + +class_alias('Twig\TokenParser\DoTokenParser', 'Twig_TokenParser_Do'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php new file mode 100755 index 0000000..973ff2e --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/EmbedTokenParser.php @@ -0,0 +1,74 @@ +parser->getStream(); + + $parent = $this->parser->getExpressionParser()->parseExpression(); + + list($variables, $only, $ignoreMissing) = $this->parseArguments(); + + $parentToken = $fakeParentToken = new Token(Token::STRING_TYPE, '__parent__', $token->getLine()); + if ($parent instanceof ConstantExpression) { + $parentToken = new Token(Token::STRING_TYPE, $parent->getAttribute('value'), $token->getLine()); + } elseif ($parent instanceof NameExpression) { + $parentToken = new Token(Token::NAME_TYPE, $parent->getAttribute('name'), $token->getLine()); + } + + // inject a fake parent to make the parent() function work + $stream->injectTokens([ + new Token(Token::BLOCK_START_TYPE, '', $token->getLine()), + new Token(Token::NAME_TYPE, 'extends', $token->getLine()), + $parentToken, + new Token(Token::BLOCK_END_TYPE, '', $token->getLine()), + ]); + + $module = $this->parser->parse($stream, [$this, 'decideBlockEnd'], true); + + // override the parent with the correct one + if ($fakeParentToken === $parentToken) { + $module->setNode('parent', $parent); + } + + $this->parser->embedTemplate($module); + + $stream->expect(Token::BLOCK_END_TYPE); + + return new EmbedNode($module->getTemplateName(), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endembed'); + } + + public function getTag() + { + return 'embed'; + } +} + +class_alias('Twig\TokenParser\EmbedTokenParser', 'Twig_TokenParser_Embed'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php new file mode 100755 index 0000000..e66789a --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/ExtendsTokenParser.php @@ -0,0 +1,54 @@ +parser->getStream(); + + if ($this->parser->peekBlockStack()) { + throw new SyntaxError('Cannot use "extend" in a block.', $token->getLine(), $stream->getSourceContext()); + } elseif (!$this->parser->isMainScope()) { + throw new SyntaxError('Cannot use "extend" in a macro.', $token->getLine(), $stream->getSourceContext()); + } + + if (null !== $this->parser->getParent()) { + throw new SyntaxError('Multiple extends tags are forbidden.', $token->getLine(), $stream->getSourceContext()); + } + $this->parser->setParent($this->parser->getExpressionParser()->parseExpression()); + + $stream->expect(Token::BLOCK_END_TYPE); + + return new Node(); + } + + public function getTag() + { + return 'extends'; + } +} + +class_alias('Twig\TokenParser\ExtendsTokenParser', 'Twig_TokenParser_Extends'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/FilterTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/FilterTokenParser.php new file mode 100755 index 0000000..dc07dcf --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/FilterTokenParser.php @@ -0,0 +1,59 @@ +parser->getVarName(); + $ref = new BlockReferenceExpression(new ConstantExpression($name, $token->getLine()), null, $token->getLine(), $this->getTag()); + + $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag()); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + $body = $this->parser->subparse([$this, 'decideBlockEnd'], true); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + $block = new BlockNode($name, $body, $token->getLine()); + $this->parser->setBlock($name, $block); + + return new PrintNode($filter, $token->getLine(), $this->getTag()); + } + + public function decideBlockEnd(Token $token) + { + return $token->test('endfilter'); + } + + public function getTag() + { + return 'filter'; + } +} + +class_alias('Twig\TokenParser\FilterTokenParser', 'Twig_TokenParser_Filter'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/FlushTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/FlushTokenParser.php new file mode 100755 index 0000000..b25524f --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/FlushTokenParser.php @@ -0,0 +1,39 @@ +parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new FlushNode($token->getLine(), $this->getTag()); + } + + public function getTag() + { + return 'flush'; + } +} + +class_alias('Twig\TokenParser\FlushTokenParser', 'Twig_TokenParser_Flush'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/ForTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/ForTokenParser.php new file mode 100755 index 0000000..69278d9 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/ForTokenParser.php @@ -0,0 +1,136 @@ + + * {% for user in users %} + *
    • + * {% endspaceless %} + * {# output will be
      foo
      #} + * + * @final + */ +class SpacelessTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) + { + $lineno = $token->getLine(); + + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + $body = $this->parser->subparse([$this, 'decideSpacelessEnd'], true); + $this->parser->getStream()->expect(Token::BLOCK_END_TYPE); + + return new SpacelessNode($body, $lineno, $this->getTag()); + } + + public function decideSpacelessEnd(Token $token) + { + return $token->test('endspaceless'); + } + + public function getTag() + { + return 'spaceless'; + } +} + +class_alias('Twig\TokenParser\SpacelessTokenParser', 'Twig_TokenParser_Spaceless'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/TokenParserInterface.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/TokenParserInterface.php new file mode 100755 index 0000000..4b603b2 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/TokenParserInterface.php @@ -0,0 +1,51 @@ + + */ +interface TokenParserInterface +{ + /** + * Sets the parser associated with this token parser. + */ + public function setParser(Parser $parser); + + /** + * Parses a token and returns a node. + * + * @return \Twig_NodeInterface + * + * @throws SyntaxError + */ + public function parse(Token $token); + + /** + * Gets the tag name associated with this token parser. + * + * @return string The tag name + */ + public function getTag(); +} + +class_alias('Twig\TokenParser\TokenParserInterface', 'Twig_TokenParserInterface'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Token'); +class_exists('Twig\Parser'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/UseTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/UseTokenParser.php new file mode 100755 index 0000000..d2e39aa --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/UseTokenParser.php @@ -0,0 +1,75 @@ +parser->getExpressionParser()->parseExpression(); + $stream = $this->parser->getStream(); + + if (!$template instanceof ConstantExpression) { + throw new SyntaxError('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getSourceContext()); + } + + $targets = []; + if ($stream->nextIf('with')) { + do { + $name = $stream->expect(Token::NAME_TYPE)->getValue(); + + $alias = $name; + if ($stream->nextIf('as')) { + $alias = $stream->expect(Token::NAME_TYPE)->getValue(); + } + + $targets[$name] = new ConstantExpression($alias, -1); + + if (!$stream->nextIf(Token::PUNCTUATION_TYPE, ',')) { + break; + } + } while (true); + } + + $stream->expect(Token::BLOCK_END_TYPE); + + $this->parser->addTrait(new Node(['template' => $template, 'targets' => new Node($targets)])); + + return new Node(); + } + + public function getTag() + { + return 'use'; + } +} + +class_alias('Twig\TokenParser\UseTokenParser', 'Twig_TokenParser_Use'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenParser/WithTokenParser.php b/phpMyAdmin/vendor/twig/twig/src/TokenParser/WithTokenParser.php new file mode 100755 index 0000000..411e2b4 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenParser/WithTokenParser.php @@ -0,0 +1,57 @@ + + * + * @final + */ +class WithTokenParser extends AbstractTokenParser +{ + public function parse(Token $token) + { + $stream = $this->parser->getStream(); + + $variables = null; + $only = false; + if (!$stream->test(Token::BLOCK_END_TYPE)) { + $variables = $this->parser->getExpressionParser()->parseExpression(); + $only = $stream->nextIf(Token::NAME_TYPE, 'only'); + } + + $stream->expect(Token::BLOCK_END_TYPE); + + $body = $this->parser->subparse([$this, 'decideWithEnd'], true); + + $stream->expect(Token::BLOCK_END_TYPE); + + return new WithNode($body, $variables, $only, $token->getLine(), $this->getTag()); + } + + public function decideWithEnd(Token $token) + { + return $token->test('endwith'); + } + + public function getTag() + { + return 'with'; + } +} + +class_alias('Twig\TokenParser\WithTokenParser', 'Twig_TokenParser_With'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TokenStream.php b/phpMyAdmin/vendor/twig/twig/src/TokenStream.php new file mode 100755 index 0000000..4597816 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TokenStream.php @@ -0,0 +1,201 @@ + + */ +class TokenStream +{ + protected $tokens; + protected $current = 0; + protected $filename; + + private $source; + + /** + * @param array $tokens An array of tokens + * @param string|null $name The name of the template which tokens are associated with + * @param string|null $source The source code associated with the tokens + */ + public function __construct(array $tokens, $name = null, $source = null) + { + if (!$name instanceof Source) { + if (null !== $name || null !== $source) { + @trigger_error(sprintf('Passing a string as the $name argument of %s() is deprecated since version 1.27. Pass a \Twig\Source instance instead.', __METHOD__), E_USER_DEPRECATED); + } + $this->source = new Source($source, $name); + } else { + $this->source = $name; + } + + $this->tokens = $tokens; + + // deprecated, not used anymore, to be removed in 2.0 + $this->filename = $this->source->getName(); + } + + public function __toString() + { + return implode("\n", $this->tokens); + } + + public function injectTokens(array $tokens) + { + $this->tokens = array_merge(\array_slice($this->tokens, 0, $this->current), $tokens, \array_slice($this->tokens, $this->current)); + } + + /** + * Sets the pointer to the next token and returns the old one. + * + * @return Token + */ + public function next() + { + if (!isset($this->tokens[++$this->current])) { + throw new SyntaxError('Unexpected end of template.', $this->tokens[$this->current - 1]->getLine(), $this->source); + } + + return $this->tokens[$this->current - 1]; + } + + /** + * Tests a token, sets the pointer to the next one and returns it or throws a syntax error. + * + * @return Token|null The next token if the condition is true, null otherwise + */ + public function nextIf($primary, $secondary = null) + { + if ($this->tokens[$this->current]->test($primary, $secondary)) { + return $this->next(); + } + } + + /** + * Tests a token and returns it or throws a syntax error. + * + * @return Token + */ + public function expect($type, $value = null, $message = null) + { + $token = $this->tokens[$this->current]; + if (!$token->test($type, $value)) { + $line = $token->getLine(); + throw new SyntaxError(sprintf('%sUnexpected token "%s"%s ("%s" expected%s).', + $message ? $message.'. ' : '', + Token::typeToEnglish($token->getType()), + $token->getValue() ? sprintf(' of value "%s"', $token->getValue()) : '', + Token::typeToEnglish($type), $value ? sprintf(' with value "%s"', $value) : ''), + $line, + $this->source + ); + } + $this->next(); + + return $token; + } + + /** + * Looks at the next token. + * + * @param int $number + * + * @return Token + */ + public function look($number = 1) + { + if (!isset($this->tokens[$this->current + $number])) { + throw new SyntaxError('Unexpected end of template.', $this->tokens[$this->current + $number - 1]->getLine(), $this->source); + } + + return $this->tokens[$this->current + $number]; + } + + /** + * Tests the current token. + * + * @return bool + */ + public function test($primary, $secondary = null) + { + return $this->tokens[$this->current]->test($primary, $secondary); + } + + /** + * Checks if end of stream was reached. + * + * @return bool + */ + public function isEOF() + { + return Token::EOF_TYPE === $this->tokens[$this->current]->getType(); + } + + /** + * @return Token + */ + public function getCurrent() + { + return $this->tokens[$this->current]; + } + + /** + * Gets the name associated with this stream (null if not defined). + * + * @return string|null + * + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getFilename() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->source->getName(); + } + + /** + * Gets the source code associated with this stream. + * + * @return string + * + * @internal Don't use this as it might be empty depending on the environment configuration + * + * @deprecated since 1.27 (to be removed in 2.0) + */ + public function getSource() + { + @trigger_error(sprintf('The %s() method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', __METHOD__), E_USER_DEPRECATED); + + return $this->source->getCode(); + } + + /** + * Gets the source associated with this stream. + * + * @return Source + * + * @internal + */ + public function getSourceContext() + { + return $this->source; + } +} + +class_alias('Twig\TokenStream', 'Twig_TokenStream'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TwigFilter.php b/phpMyAdmin/vendor/twig/twig/src/TwigFilter.php new file mode 100755 index 0000000..089a6d1 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TwigFilter.php @@ -0,0 +1,128 @@ + + */ +class TwigFilter +{ + protected $name; + protected $callable; + protected $options; + protected $arguments = []; + + public function __construct($name, $callable, array $options = []) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge([ + 'needs_environment' => false, + 'needs_context' => false, + 'is_variadic' => false, + 'is_safe' => null, + 'is_safe_callback' => null, + 'pre_escape' => null, + 'preserves_safety' => null, + 'node_class' => '\Twig\Node\Expression\FilterExpression', + 'deprecated' => false, + 'alternative' => null, + ], $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Node $filterArgs) + { + if (null !== $this->options['is_safe']) { + return $this->options['is_safe']; + } + + if (null !== $this->options['is_safe_callback']) { + return \call_user_func($this->options['is_safe_callback'], $filterArgs); + } + } + + public function getPreservesSafety() + { + return $this->options['preserves_safety']; + } + + public function getPreEscape() + { + return $this->options['pre_escape']; + } + + public function isVariadic() + { + return $this->options['is_variadic']; + } + + public function isDeprecated() + { + return (bool) $this->options['deprecated']; + } + + public function getDeprecatedVersion() + { + return $this->options['deprecated']; + } + + public function getAlternative() + { + return $this->options['alternative']; + } +} + +class_alias('Twig\TwigFilter', 'Twig_SimpleFilter'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Node\Node'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TwigFunction.php b/phpMyAdmin/vendor/twig/twig/src/TwigFunction.php new file mode 100755 index 0000000..374f070 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TwigFunction.php @@ -0,0 +1,118 @@ + + */ +class TwigFunction +{ + protected $name; + protected $callable; + protected $options; + protected $arguments = []; + + public function __construct($name, $callable, array $options = []) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge([ + 'needs_environment' => false, + 'needs_context' => false, + 'is_variadic' => false, + 'is_safe' => null, + 'is_safe_callback' => null, + 'node_class' => '\Twig\Node\Expression\FunctionExpression', + 'deprecated' => false, + 'alternative' => null, + ], $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } + + public function needsEnvironment() + { + return $this->options['needs_environment']; + } + + public function needsContext() + { + return $this->options['needs_context']; + } + + public function getSafe(Node $functionArgs) + { + if (null !== $this->options['is_safe']) { + return $this->options['is_safe']; + } + + if (null !== $this->options['is_safe_callback']) { + return \call_user_func($this->options['is_safe_callback'], $functionArgs); + } + + return []; + } + + public function isVariadic() + { + return $this->options['is_variadic']; + } + + public function isDeprecated() + { + return (bool) $this->options['deprecated']; + } + + public function getDeprecatedVersion() + { + return $this->options['deprecated']; + } + + public function getAlternative() + { + return $this->options['alternative']; + } +} + +class_alias('Twig\TwigFunction', 'Twig_SimpleFunction'); + +// Ensure that the aliased name is loaded to keep BC for classes implementing the typehint with the old aliased name. +class_exists('Twig\Node\Node'); diff --git a/phpMyAdmin/vendor/twig/twig/src/TwigTest.php b/phpMyAdmin/vendor/twig/twig/src/TwigTest.php new file mode 100755 index 0000000..5054965 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/TwigTest.php @@ -0,0 +1,87 @@ + + */ +class TwigTest +{ + protected $name; + protected $callable; + protected $options; + + private $arguments = []; + + public function __construct($name, $callable, array $options = []) + { + $this->name = $name; + $this->callable = $callable; + $this->options = array_merge([ + 'is_variadic' => false, + 'node_class' => '\Twig\Node\Expression\TestExpression', + 'deprecated' => false, + 'alternative' => null, + ], $options); + } + + public function getName() + { + return $this->name; + } + + public function getCallable() + { + return $this->callable; + } + + public function getNodeClass() + { + return $this->options['node_class']; + } + + public function isVariadic() + { + return $this->options['is_variadic']; + } + + public function isDeprecated() + { + return (bool) $this->options['deprecated']; + } + + public function getDeprecatedVersion() + { + return $this->options['deprecated']; + } + + public function getAlternative() + { + return $this->options['alternative']; + } + + public function setArguments($arguments) + { + $this->arguments = $arguments; + } + + public function getArguments() + { + return $this->arguments; + } +} + +class_alias('Twig\TwigTest', 'Twig_SimpleTest'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Util/DeprecationCollector.php b/phpMyAdmin/vendor/twig/twig/src/Util/DeprecationCollector.php new file mode 100755 index 0000000..09917e9 --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Util/DeprecationCollector.php @@ -0,0 +1,92 @@ + + * + * @final + */ +class DeprecationCollector +{ + private $twig; + private $deprecations; + + public function __construct(Environment $twig) + { + $this->twig = $twig; + } + + /** + * Returns deprecations for templates contained in a directory. + * + * @param string $dir A directory where templates are stored + * @param string $ext Limit the loaded templates by extension + * + * @return array An array of deprecations + */ + public function collectDir($dir, $ext = '.twig') + { + $iterator = new \RegexIterator( + new \RecursiveIteratorIterator( + new \RecursiveDirectoryIterator($dir), \RecursiveIteratorIterator::LEAVES_ONLY + ), '{'.preg_quote($ext).'$}' + ); + + return $this->collect(new TemplateDirIterator($iterator)); + } + + /** + * Returns deprecations for passed templates. + * + * @param \Traversable $iterator An iterator of templates (where keys are template names and values the contents of the template) + * + * @return array An array of deprecations + */ + public function collect(\Traversable $iterator) + { + $this->deprecations = []; + + set_error_handler([$this, 'errorHandler']); + + foreach ($iterator as $name => $contents) { + try { + $this->twig->parse($this->twig->tokenize(new Source($contents, $name))); + } catch (SyntaxError $e) { + // ignore templates containing syntax errors + } + } + + restore_error_handler(); + + $deprecations = $this->deprecations; + $this->deprecations = []; + + return $deprecations; + } + + /** + * @internal + */ + public function errorHandler($type, $msg) + { + if (E_USER_DEPRECATED === $type) { + $this->deprecations[] = $msg; + } + } +} + +class_alias('Twig\Util\DeprecationCollector', 'Twig_Util_DeprecationCollector'); diff --git a/phpMyAdmin/vendor/twig/twig/src/Util/TemplateDirIterator.php b/phpMyAdmin/vendor/twig/twig/src/Util/TemplateDirIterator.php new file mode 100755 index 0000000..1ab0dac --- /dev/null +++ b/phpMyAdmin/vendor/twig/twig/src/Util/TemplateDirIterator.php @@ -0,0 +1,30 @@ + + */ +class TemplateDirIterator extends \IteratorIterator +{ + public function current() + { + return file_get_contents(parent::current()); + } + + public function key() + { + return (string) parent::key(); + } +} + +class_alias('Twig\Util\TemplateDirIterator', 'Twig_Util_TemplateDirIterator'); diff --git a/phpMyAdmin/version_check.php b/phpMyAdmin/version_check.php new file mode 100755 index 0000000..4805e57 --- /dev/null +++ b/phpMyAdmin/version_check.php @@ -0,0 +1,44 @@ +disable(); + +// Always send the correct headers +Core::headerJSON(); + +$versionInformation = new VersionInformation(); +$versionDetails = $versionInformation->getLatestVersion(); + +if (empty($versionDetails)) { + echo json_encode(array()); +} else { + $latestCompatible = $versionInformation->getLatestCompatibleVersion( + $versionDetails->releases + ); + $version = ''; + $date = ''; + if ($latestCompatible != null) { + $version = $latestCompatible['version']; + $date = $latestCompatible['date']; + } + echo json_encode( + array( + 'version' => (! empty($version) ? $version : ''), + 'date' => (! empty($date) ? $date : ''), + ) + ); +} diff --git a/phpMyAdmin/view_create.php b/phpMyAdmin/view_create.php new file mode 100755 index 0000000..d9dfbc2 --- /dev/null +++ b/phpMyAdmin/view_create.php @@ -0,0 +1,234 @@ +addJSON( + 'message', + $message + ); + $response->setRequestStatus(false); + exit; +} + +if (isset($_POST['createview']) || isset($_POST['alterview'])) { + /** + * Creates the view + */ + $sep = "\r\n"; + + if (isset($_POST['createview'])) { + $sql_query = 'CREATE'; + if (isset($_POST['view']['or_replace'])) { + $sql_query .= ' OR REPLACE'; + } + } else { + $sql_query = 'ALTER'; + } + + if (Core::isValid($_POST['view']['algorithm'], $view_algorithm_options)) { + $sql_query .= $sep . ' ALGORITHM = ' . $_POST['view']['algorithm']; + } + + if (! empty($_POST['view']['definer'])) { + if (strpos($_POST['view']['definer'], '@') === false) { + $sql_query .= $sep . 'DEFINER=' + . PhpMyAdmin\Util::backquote($_POST['view']['definer']); + } else { + $arr = explode('@', $_POST['view']['definer']); + $sql_query .= $sep . 'DEFINER=' . PhpMyAdmin\Util::backquote($arr[0]); + $sql_query .= '@' . PhpMyAdmin\Util::backquote($arr[1]) . ' '; + } + } + + if (isset($_POST['view']['sql_security'])) { + if (in_array($_POST['view']['sql_security'], $view_security_options)) { + $sql_query .= $sep . ' SQL SECURITY ' + . $_POST['view']['sql_security']; + } + } + + $sql_query .= $sep . ' VIEW ' + . PhpMyAdmin\Util::backquote($_POST['view']['name']); + + if (! empty($_POST['view']['column_names'])) { + $sql_query .= $sep . ' (' . $_POST['view']['column_names'] . ')'; + } + + $sql_query .= $sep . ' AS ' . $_POST['view']['as']; + + if (isset($_POST['view']['with'])) { + if (in_array($_POST['view']['with'], $view_with_options)) { + $sql_query .= $sep . ' WITH ' . $_POST['view']['with'] + . ' CHECK OPTION'; + } + } + + if (!$GLOBALS['dbi']->tryQuery($sql_query)) { + if (! isset($_POST['ajax_dialog'])) { + $message = PhpMyAdmin\Message::rawError($GLOBALS['dbi']->getError()); + return; + } + + $response->addJSON( + 'message', + PhpMyAdmin\Message::error( + "" . htmlspecialchars($sql_query) . "

      " + . $GLOBALS['dbi']->getError() + ) + ); + $response->setRequestStatus(false); + exit; + } + + // If different column names defined for VIEW + $view_columns = array(); + if (isset($_POST['view']['column_names'])) { + $view_columns = explode(',', $_POST['view']['column_names']); + } + + $column_map = $GLOBALS['dbi']->getColumnMapFromSql( + $_POST['view']['as'], $view_columns + ); + + $systemDb = $GLOBALS['dbi']->getSystemDatabase(); + $pma_transformation_data = $systemDb->getExistingTransformationData( + $GLOBALS['db'] + ); + + if ($pma_transformation_data !== false) { + + // SQL for store new transformation details of VIEW + $new_transformations_sql = $systemDb->getNewTransformationDataSql( + $pma_transformation_data, $column_map, + $_POST['view']['name'], $GLOBALS['db'] + ); + + // Store new transformations + if ($new_transformations_sql != '') { + $GLOBALS['dbi']->tryQuery($new_transformations_sql); + } + + } + unset($pma_transformation_data); + + if (! isset($_POST['ajax_dialog'])) { + $message = PhpMyAdmin\Message::success(); + include 'tbl_structure.php'; + } else { + $response->addJSON( + 'message', + PhpMyAdmin\Util::getMessage( + PhpMyAdmin\Message::success(), + $sql_query + ) + ); + $response->setRequestStatus(true); + } + + exit; +} + +$sql_query = ! empty($_POST['sql_query']) ? $_POST['sql_query'] : ''; + +// prefill values if not already filled from former submission +$view = array( + 'operation' => 'create', + 'or_replace' => '', + 'algorithm' => '', + 'definer' => '', + 'sql_security' => '', + 'name' => '', + 'column_names' => '', + 'as' => $sql_query, + 'with' => '', + 'algorithm' => '', +); + +// Used to prefill the fields when editing a view +if (isset($_GET['db']) && isset($_GET['table'])) { + $item = $GLOBALS['dbi']->fetchSingleRow( + sprintf( + "SELECT `VIEW_DEFINITION`, `CHECK_OPTION`, `DEFINER`, + `SECURITY_TYPE` + FROM `INFORMATION_SCHEMA`.`VIEWS` + WHERE TABLE_SCHEMA='%s' + AND TABLE_NAME='%s';", + $GLOBALS['dbi']->escapeString($_GET['db']), + $GLOBALS['dbi']->escapeString($_GET['table']) + ) + ); + $createView = $GLOBALS['dbi']->getTable($_GET['db'], $_GET['table']) + ->showCreate(); + + // CREATE ALGORITHM= DE... + $parts = explode(" ", substr($createView, 17)); + $item['ALGORITHM'] = $parts[0]; + + $view['operation'] = 'alter'; + $view['definer'] = $item['DEFINER']; + $view['sql_security'] = $item['SECURITY_TYPE']; + $view['name'] = $_GET['table']; + $view['as'] = $item['VIEW_DEFINITION']; + $view['with'] = $item['CHECK_OPTION']; + $view['algorithm'] = $item['ALGORITHM']; + +} + +if (Core::isValid($_POST['view'], 'array')) { + $view = array_merge($view, $_POST['view']); +} + +$url_params['db'] = $GLOBALS['db']; +$url_params['reload'] = 1; + +echo Template::get('view_create')->render([ + 'ajax_dialog' => isset($_POST['ajax_dialog']), + 'text_dir' => $text_dir, + 'url_params' => $url_params, + 'view' => $view, + 'view_algorithm_options' => $view_algorithm_options, + 'view_with_options' => $view_with_options, + 'view_security_options' => $view_security_options, +]); diff --git a/phpMyAdmin/view_operations.php b/phpMyAdmin/view_operations.php new file mode 100755 index 0000000..5fd9ab8 --- /dev/null +++ b/phpMyAdmin/view_operations.php @@ -0,0 +1,149 @@ +getHeader(); +$scripts = $header->getScripts(); +$scripts->addFile('tbl_operations.js'); + +/** + * Runs common work + */ +require './libraries/tbl_common.inc.php'; +$url_query .= '&goto=view_operations.php&back=view_operations.php'; +$url_params['goto'] = $url_params['back'] = 'view_operations.php'; + +$operations = new Operations(); + +/** + * Updates if required + */ +$_message = new Message; +$_type = 'success'; +if (isset($_POST['submitoptions'])) { + + if (isset($_POST['new_name'])) { + if ($pma_table->rename($_POST['new_name'])) { + $_message->addText($pma_table->getLastMessage()); + $result = true; + $GLOBALS['table'] = $pma_table->getName(); + /* Force reread after rename */ + $pma_table->getStatusInfo(null, true); + $reload = true; + } else { + $_message->addText($pma_table->getLastError()); + $result = false; + } + } + + $warning_messages = $operations->getWarningMessagesArray(); +} + +if (isset($result)) { + // set to success by default, because result set could be empty + // (for example, a table rename) + if (empty($_message->getString())) { + if ($result) { + $_message->addText( + __('Your SQL query has been executed successfully.') + ); + } else { + $_message->addText(__('Error')); + } + // $result should exist, regardless of $_message + $_type = $result ? 'success' : 'error'; + } + if (! empty($warning_messages)) { + $_message->addMessagesString($warning_messages); + $_message->isError(true); + unset($warning_messages); + } + echo Util::getMessage( + $_message, $sql_query, $_type + ); +} +unset($_message, $_type); + +$url_params['goto'] = 'view_operations.php'; +$url_params['back'] = 'view_operations.php'; + +/** + * Displays the page + */ +?> + +
      + + + +
      + + + + + + + +
      +
      +
      +
      + + +
      + +
      + 'DROP VIEW ' . Util::backquote( + $GLOBALS['table'] + ), + 'goto' => 'tbl_structure.php', + 'reload' => '1', + 'purge' => '1', + 'message_to_show' => sprintf( + __('View %s has been dropped.'), + htmlspecialchars($GLOBALS['table']) + ), + 'table' => $GLOBALS['table'] + ) +); +echo '
      '; +echo '
      '; +echo '' , __('Delete data or table') , ''; + +echo '
        '; +echo $operations->getDeleteDataOrTablelink( + $drop_view_url_params, + 'DROP VIEW', + __('Delete the view (DROP)'), + 'drop_view_anchor' +); +echo '
      '; +echo '
      '; +echo '
      '; diff --git a/phpMyAdmin/yarn.lock b/phpMyAdmin/yarn.lock new file mode 100755 index 0000000..5890527 --- /dev/null +++ b/phpMyAdmin/yarn.lock @@ -0,0 +1,856 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/code-frame@^7.0.0": + version "7.5.5" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.5.5.tgz#bc0782f6d69f7b7d49531219699b988f669a8f9d" + integrity sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw== + dependencies: + "@babel/highlight" "^7.0.0" + +"@babel/highlight@^7.0.0": + version "7.5.0" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.5.0.tgz#56d11312bd9248fa619591d02472be6e8cb32540" + integrity sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ== + dependencies: + chalk "^2.0.0" + esutils "^2.0.2" + js-tokens "^4.0.0" + +acorn-jsx@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.0.2.tgz#84b68ea44b373c4f8686023a551f61a21b7c4a4f" + integrity sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw== + +acorn@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.0.0.tgz#26b8d1cd9a9b700350b71c0905546f64d1284e7a" + integrity sha512-PaF/MduxijYYt7unVGRuds1vBC9bFxbNf+VWqhOClfdgy7RlVkQqt610ig1/yxTgsDIfW1cWDel5EBbOy3jdtQ== + +ajv@^6.10.0, ajv@^6.10.2: + version "6.10.2" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.10.2.tgz#d3cea04d6b017b2894ad69040fec8b623eb4bd52" + integrity sha512-TXtUUEYHuaTEbLZWIKUr5pmBuhDLy+8KYtPYdcV8qC+pOZL+NKqYwvWSRrVXHn+ZmRRAu8vJTAznH7Oag6RVRw== + dependencies: + fast-deep-equal "^2.0.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^3.2.0, ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +astral-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" + integrity sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +chalk@^2.0.0, chalk@^2.1.0, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU= + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639" + integrity sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk= + +codemirror@5.48.4: + version "5.48.4" + resolved "https://registry.yarnpkg.com/codemirror/-/codemirror-5.48.4.tgz#4210fbe92be79a88f0eea348fab3ae78da85ce47" + integrity sha512-pUhZXDQ6qXSpWdwlgAwHEkd4imA0kf83hINmUEzJpmG80T/XLtDDEzZo8f6PQLuRCcUQhmzqqIo3ZPTRaWByRA== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +debug@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791" + integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw== + dependencies: + ms "^2.1.1" + +deep-is@~0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34" + integrity sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ= + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +eslint-scope@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9" + integrity sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw== + dependencies: + esrecurse "^4.1.0" + estraverse "^4.1.1" + +eslint-utils@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" + integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== + dependencies: + eslint-visitor-keys "^1.0.0" + +eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" + integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== + +eslint@^6.2.2: + version "6.2.2" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.2.2.tgz#03298280e7750d81fcd31431f3d333e43d93f24f" + integrity sha512-mf0elOkxHbdyGX1IJEUsNBzCDdyoUgljF3rRlgfyYh0pwGnreLc0jjD6ZuleOibjmnUWZLY2eXwSooeOgGJ2jw== + dependencies: + "@babel/code-frame" "^7.0.0" + ajv "^6.10.0" + chalk "^2.1.0" + cross-spawn "^6.0.5" + debug "^4.0.1" + doctrine "^3.0.0" + eslint-scope "^5.0.0" + eslint-utils "^1.4.2" + eslint-visitor-keys "^1.1.0" + espree "^6.1.1" + esquery "^1.0.1" + esutils "^2.0.2" + file-entry-cache "^5.0.1" + functional-red-black-tree "^1.0.1" + glob-parent "^5.0.0" + globals "^11.7.0" + ignore "^4.0.6" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + inquirer "^6.4.1" + is-glob "^4.0.0" + js-yaml "^3.13.1" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.3.0" + lodash "^4.17.14" + minimatch "^3.0.4" + mkdirp "^0.5.1" + natural-compare "^1.4.0" + optionator "^0.8.2" + progress "^2.0.0" + regexpp "^2.0.1" + semver "^6.1.2" + strip-ansi "^5.2.0" + strip-json-comments "^3.0.1" + table "^5.2.3" + text-table "^0.2.0" + v8-compile-cache "^2.0.3" + +espree@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de" + integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ== + dependencies: + acorn "^7.0.0" + acorn-jsx "^5.0.2" + eslint-visitor-keys "^1.1.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.0.1.tgz#406c51658b1f5991a5f9b62b1dc25b00e3e5c708" + integrity sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA== + dependencies: + estraverse "^4.0.0" + +esrecurse@^4.1.0: + version "4.2.1" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" + integrity sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ== + dependencies: + estraverse "^4.1.0" + +estraverse@^4.0.0, estraverse@^4.1.0, estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +fast-deep-equal@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz#7b05218ddf9667bf7f370bf7fdb2cb15fdd0aa49" + integrity sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk= + +fast-json-stable-stringify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" + integrity sha1-1RQsDK7msRifh9OnYREGT4bIu/I= + +fast-levenshtein@~2.0.4: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI= + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c" + integrity sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g== + dependencies: + flat-cache "^2.0.1" + +flat-cache@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0" + integrity sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA== + dependencies: + flatted "^2.0.0" + rimraf "2.6.3" + write "1.0.3" + +flatted@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08" + integrity sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +functional-red-black-tree@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" + integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= + +glob-parent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" + integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== + dependencies: + is-glob "^4.0.1" + +glob@^7.1.3: + version "7.1.4" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.7.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= + +iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" + integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== + +import-fresh@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.1.0.tgz#6d33fa1dcef6df930fae003446f33415af905118" + integrity sha512-PpuksHKGt8rXfWEr9m9EHIpgyyaltBy8+eF6GJM0QCAxMgxCfucMF3mjecK2QsJr0amJW7gTqh5/wht0z2UhEQ== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inquirer@^6.4.1: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.12" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^4.0.0, is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-promise@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" + integrity sha1-eaKp7OfwlugPNtKy87wWwf9L8/o= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +jquery-migrate@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/jquery-migrate/-/jquery-migrate-3.1.0.tgz#8158de74cca39fb7fc2635db570151ae7ce3ddea" + integrity sha512-u/MtE1ST2pCr3rCyouJG2xMiw/k3OzLNeRKprjKTeHUezCGr0DyEgeXFdqFLmQfxfR5EsVu+mGo/sCcYdiYcIQ== + +jquery-mousewheel@3.1.13: + version "3.1.13" + resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.1.13.tgz#06f0335f16e353a695e7206bf50503cb523a6ee5" + integrity sha1-BvAzXxbjU6aV5yBr9QUDy1I6buU= + +jquery-ui-timepicker-addon@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/jquery-ui-timepicker-addon/-/jquery-ui-timepicker-addon-1.6.3.tgz#8037c39b0b630282dd0b37dd8ad7fc5e1163377f" + integrity sha1-gDfDmwtjAoLdCzfditf8XhFjN38= + +jquery-ui@1.12.1: + version "1.12.1" + resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.12.1.tgz#bcb4045c8dd0539c134bc1488cdd3e768a7a9e51" + integrity sha1-vLQEXI3QU5wTS8FIjN0+dop6nlE= + +jquery-validation@1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.19.1.tgz#a85043467dc2b70d9fff05778646d150e747742f" + integrity sha512-QNnrZBqSltWUEJx+shOY5WtfrIb0gWmDjFfQP8rZKqMMSfpRSwEkSqhfHPvDfkObD8Hnv5KHSYI8yg73sVFdqA== + +jquery.event.drag@2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/jquery.event.drag/-/jquery.event.drag-2.2.2.tgz#11bbbf83f4c6ef5f3b5065564663913c9f964be1" + integrity sha1-Ebu/g/TG7187UGVWRmORPJ+WS+E= + +jquery@3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2" + integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw== + +js-cookie@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/js-cookie/-/js-cookie-2.2.1.tgz#69e106dc5d5806894562902aa5baec3744e9b2b8" + integrity sha512-HvdH2LzI/EAZcUwA8+0nKNtWHqS+ZmijLA30RwZA0bo7ToCckjK5MkGhjED9KoRcXO6BaGI3I9UIzSA1FKFPOQ== + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.13.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" + integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE= + +levn@^0.3.0, levn@~0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee" + integrity sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4= + dependencies: + prelude-ls "~1.1.2" + type-check "~0.3.2" + +lodash@^4.17.12, lodash@^4.17.14: + version "4.17.15" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" + integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + integrity sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA== + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" + integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0= + +mkdirp@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" + integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM= + dependencies: + minimist "0.0.8" + +ms@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ= + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.8.2: + version "0.8.2" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.2.tgz#364c5e409d3f4d6301d6c0b4c05bba50180aeb64" + integrity sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q= + dependencies: + deep-is "~0.1.3" + fast-levenshtein "~2.0.4" + levn "~0.3.0" + prelude-ls "~1.1.2" + type-check "~0.3.2" + wordwrap "~1.0.0" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= + +prelude-ls@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" + integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= + +progress@^2.0.0: + version "2.0.3" + resolved "https://registry.yarnpkg.com/progress/-/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8" + integrity sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA== + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +regexpp@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f" + integrity sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha1-n37ih/gv0ybU/RYpI9YhKe7g368= + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +rimraf@2.6.3: + version "2.6.3" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" + integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== + dependencies: + glob "^7.1.3" + +run-async@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.3.0.tgz#0371ab4ae0bdd720d4166d7dfda64ff7a445a6c0" + integrity sha1-A3GrSuC91yDUFm19/aZP96RFpsA= + dependencies: + is-promise "^2.1.0" + +rxjs@^6.4.0: + version "6.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" + integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== + dependencies: + tslib "^1.9.0" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" + integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== + +semver@^6.1.2: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha1-RKrGW2lbAzmJaMOfNj/uXer98eo= + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= + +signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= + +slice-ansi@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636" + integrity sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ== + dependencies: + ansi-styles "^3.2.0" + astral-regex "^1.0.0" + is-fullwidth-code-point "^2.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +string-width@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-json-comments@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7" + integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +table@^5.2.3: + version "5.4.6" + resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e" + integrity sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug== + dependencies: + ajv "^6.10.2" + lodash "^4.17.14" + slice-ansi "^2.1.0" + string-width "^3.0.0" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tracekit@0.4.5: + version "0.4.5" + resolved "https://registry.yarnpkg.com/tracekit/-/tracekit-0.4.5.tgz#55d40ea76ddf2bde137d9aaeb94933b5e94c5991" + integrity sha512-LAb1udnpvhpgcx6/gmv7s6RO5lBwQGgAT/1VW0egSNSMvH/3xU3xKLoJ3pc+nkJ5AMv9qgTBnCkrUzbrHmCLpg== + +tslib@^1.9.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a" + integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ== + +type-check@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72" + integrity sha1-WITKtRLPHTVeP7eE8wgEsrUg23I= + dependencies: + prelude-ls "~1.1.2" + +updated-jqplot@1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/updated-jqplot/-/updated-jqplot-1.0.9.tgz#3daeda1a74ea991256749364dc9225af038280b7" + integrity sha1-Pa7aGnTqmRJWdJNk3JIlrwOCgLc= + +uri-js@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" + integrity sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ== + dependencies: + punycode "^2.1.0" + +v8-compile-cache@^2.0.3: + version "2.1.0" + resolved "https://registry.yarnpkg.com/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e" + integrity sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g== + +which@^1.2.9: + version "1.3.1" + resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" + integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== + dependencies: + isexe "^2.0.0" + +wordwrap@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +write@1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/write/-/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3" + integrity sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig== + dependencies: + mkdirp "^0.5.1" + +zxcvbn@4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/zxcvbn/-/zxcvbn-4.4.2.tgz#28ec17cf09743edcab056ddd8b1b06262cc73c30" + integrity sha1-KOwXzwl0PtyrBW3dixsGJizHPDA= diff --git a/wxc2_omc/account/cdrList/.cdrDown.php.swn b/wxc2_omc/account/cdrList/.cdrDown.php.swn new file mode 100755 index 0000000..0db9ad5 Binary files /dev/null and b/wxc2_omc/account/cdrList/.cdrDown.php.swn differ diff --git a/wxc2_omc/account/cdrList/.cdrDown.php.swo b/wxc2_omc/account/cdrList/.cdrDown.php.swo new file mode 100755 index 0000000..d2af31b Binary files /dev/null and b/wxc2_omc/account/cdrList/.cdrDown.php.swo differ diff --git a/wxc2_omc/account/cdrList/.cdrDown.php.swp b/wxc2_omc/account/cdrList/.cdrDown.php.swp new file mode 100755 index 0000000..ce641ce Binary files /dev/null and b/wxc2_omc/account/cdrList/.cdrDown.php.swp differ diff --git a/wxc2_omc/account/cdrList/cdrDown.php b/wxc2_omc/account/cdrList/cdrDown.php new file mode 100755 index 0000000..9754018 --- /dev/null +++ b/wxc2_omc/account/cdrList/cdrDown.php @@ -0,0 +1,2197 @@ + $len) + { + $name1=substr($name,0,$len); + echo "$name1"; + $name2=substr($name,$len,$length); + if($name2) + echo "
      $name2"; + } + else + echo "$name"; +} + +require("../../inc/header.inc"); +?> + + +
      + +"; +/***************** Get the parameter of SMLOG_CONTENT_SHOW_FLAG **************/ +$sysId = $_REQUEST['sysId']; +$cdrType= $_REQUEST['cdrType']; +$serverName = $_REQUEST['serverName']; +$queryField = $_REQUEST['queryField']; +$keyWord= $_REQUEST['keyWord']; + +$mscType= $_REQUEST['mscType']; +$nextTbNum= $_REQUEST['nextTbNum']; +$nextDispNum= $_REQUEST['nextDispNum']; +$preDispNum= $_REQUEST['preDispNum']; +$preTbNum= $_REQUEST['preTbNum']; +$pageNext= $_REQUEST['pageNext']; +$pagePrevious= $_REQUEST['pagePrevious']; + + + + + +if($DEBUG) echo "sysId=$sysId,cdrType=$cdrType, serverName=$serverName, queryField=$queryField
      "; + +if(isset($sysId)){ + $sysIdArr=explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; +}else{ + echo "Cannot find sysId"; + exit(0); +} +global $pubConn; +$database="OMC_PUB"; +$selSql = "select pubVarName,pubVarValue from omcPubVarConf where pubVarName='SMLOG_CONTENT_SHOW_FLAG'"; +//echo "selSql=$selSql"; +$selRes = @mysqli_query($pubConn,$selSql); + +$selRow = @mysqli_fetch_array($selRes); +$SMLOG_CONTENT_SHOW_FLAG=$selRow['pubVarValue']; +//echo "SMLOG_CONTENT_SHOW_FLAG=$SMLOG_CONTENT_SHOW_FLAG


      "; +echo mysqli_error($pubConn); +/********************************************************************************/ + +$queryField = isset($queryField)?$queryField:"callingNumber"; + +$cntTbNum=$_REQUEST['cntTbNum']; +$cntTbNum_1=$_REQUEST['cntTbNum_1']; +$cntDispNum=$_REQUEST['cntDispNum']; + +require("./cdrHeader.php"); + +$DEBUG = 0; + + +$causeForTermArr = array( + array('num' => '0', 'cause' => 'Using'), + array('num' => '1', 'cause' => 'Booking'), + array('num' => '2', 'cause' => 'Delete'), + array('num' => '3', 'cause' => 'System fail'), + array('num' => '4', 'cause' => 'HLR fail'), + array('num' => '5', 'cause' => 'PPS fail') +); + +/******************* Define SS code (MSC use) ************************/ +$arraySsCode[16]="allLinIdentificationSS"; +$arraySsCode[17]="clip"; +$arraySsCode[18]="clir"; +$arraySsCode[19]="colp"; +$arraySsCode[20]="colr"; +$arraySsCode[21]="mci"; +$arraySsCode[24]="allNameIdentificationSS"; +$arraySsCode[25]="cnap"; +$arraySsCode[32]="allForwardingSS"; +$arraySsCode[33]="cfu"; +$arraySsCode[40]="allCondForwardingSS"; +$arraySsCode[41]="cfb"; +$arraySsCode[42]="cfnry"; +$arraySsCode[43]="cfnrc"; +$arraySsCode[44]="cd"; +$arraySsCode[64]="allCallCompletionSS"; +$arraySsCode[65]="cw"; +$arraySsCode[66]="hold"; +$arraySsCode[67]="ccbs-A"; +$arraySsCode[68]="ccbs-B"; +$arraySsCode[80]="allMultiPartySS"; +$arraySsCode[81]="multiPTY"; +$arraySsCode[144]="ALLBAR"; +$arraySsCode[145]="ALLBAROC"; +$arraySsCode[146]="BAOC"; +$arraySsCode[147]="BOIC"; +$arraySsCode[148]="BOICexHC"; +$arraySsCode[153]="BARALLIC"; +$arraySsCode[154]="BAIC"; +$arraySsCode[155]="BICRoam"; +$arraySsCode[49]="ECT"; + +/***************** Define display name list *******************************/ +switch($sysTypeNo){ +case '270': //CNF + $showNameList = "Type,$strCallISDN,$strCalledISDN,basicService, + $strSeizureTime,callDuration(S)"; + break; +case '320': //MSC + $showNameList = "$strCallType,IMSI,IMEI,$strCallISDN,$strCalledISDN,RAN type, + $strSeizureTime,$strAnswerTime, + $strConverseTime,$strIncomingTrunkGroup,$strOutgoingTrunkGroup, + SS code,$strResult"; + break; +case '380': //EIR + $showNameList = "Call Type,Status,IMEI,IMSI,Location,Event Time"; + break; +case '386': //EIR + $showNameList = "Call Type,Node Name,SSN,Identity,Description,Event Time"; + break; +case '325': //VLR + $showNameList = "$strCallType,IMSI,MSISDN,Old LAC,New LAC,Result, + $strUpdateTimeStamp"; + break; +case '330': //HLR + $showNameList = "$strCallType,IMSI,MSISDN,$strRoutingNumber, + $strNumberOfForwarding,$strOldLocation,$strNewLocation, + Result,$strUpdateTimeStamp"; + break; +case '350': //SMSC + $showNameList = "$strCallType,IMSI,MSISDN,Result, + $strUpdateTimeStamp"; + break; +case '351': //SMLOG + require("./showSmscContent.php"); + if($cdrType==18||$cdrType==21){ + $showNameList = "$strCaller,$strCalled,$strReceive,$strSent,DCS,$strPriority,$strSMContent"; + }elseif($cdrType==19){ + $showNameList = "$strCaller,$strCalled,$strReceive,$strDiscarded,$strTimeToLive,DCS,$strPriority,$strSMContent"; + }else{ + $showNameList = "$strCaller,$strCalled,$strReceive,$strLastAttempt,$strTimeToLive,DCS,$strPriority,$strSMContent"; + } + break; +case '360': //PPS + $moneyPara = getMoneyPara(); + $showNameList ="$strCallType,MSISDN,$strType,$strCallISDN, + $strCalledISDN,GPRS SGSN IP, + $strAnswerTime,$strConverseTime,GPRS volume,Peer Address, + $strCharge,$strBalance"; + break; +case '375': + $showNameList="Operation Type,IMEI,MSISDN,IMSI,User Type,Seizure,Result"; + + break; +default: + break; +} + +if($DEBUG) echo "showNameList=$showNameList
      "; +$showNameArr=explode(',',$showNameList); +/***************** Define display name list END ****************************/ + + +?> + + + + + {$showNameArr[$i]}"; + } + else + { + echo ""; + } + + } + ?> + + +"; +while(($dispNum<$dispNumOfPerPage)&&($cntTbNum_1<24)){ + + $showTb = $tbName[$cntTbNum_1]; + if($language == 'gb'){ + $typeFld = " $typeTb.description "; + $srcFld = " $srcTb.description "; + }else{ + $typeFld = " $typeTb.description_2 "; + $srcFld = " $srcTb.description_2 "; + } + + $order = " ORDER BY $sortFld "; + if($keyWord){ + if($queryField=="callingNumber") + $rrType=6; + else + $rrType=7; + $aWhere = " AND ($queryField like '%$keyWord%' or(recordType=$rrType and serviceCentre like '%$keyWord%'))"; + if($sysId==375) + $aWhere = " AND $queryField like '%$keyWord%' "; + else if($sysId==386) + { + $aWhere = " AND $queryField like '%$keyWord%' "; + } + else if($sysId==380) + { + if($eirType == "imei") + $aWhere = " AND servedIMEI like '%$keyWord%' "; + else + $aWhere = " AND servedIMSI like '%$keyWord%' "; + } + } + + $bWhere = " WHERE $showTb.recordType = cdrTypeConf.key_type "; + + $where = $bWhere.$aWhere; + $limit = " LIMIT $limitMin, $limitMax"; + + $select = " SELECT *,$typeFld as showType FROM $showTb,$typeTb "; + + if($cdrType==18||$cdrType==19||$cdrType==20||$cdrType==21){ + if($keyWord){ + $selSql="SELECT * FROM $showTb WHERE recordType=$cdrType AND $queryField like '%$keyWord%' ".$order.$limit; + }else{ + $selSql="SELECT * FROM $showTb WHERE recordType=$cdrType".$order.$limit; + } + }else{ + if($sysId == 320) + { + $mscType=trim($mscType); + if($mscType == "call") + { + $where.=" AND (recordType>=0 and recordType<=5) "; + } + else if($mscType == "sm") + { + $where.=" AND (recordType>=6 and recordType<=7) "; + } + else + { + + } + } + if($sysId==375 || $sysId==386) + $order=" ORDER BY releaseTime DESC "; + $selSql = $select.$where.$order.$limit; + } + if(0) + echo "
      down selSql=$selSql
      "; + + $selRes = @mysqli_query($cdrDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes,MYSQLI_ASSOC); + $tRecord = @mysqli_num_rows($selRes); + + if($tRecord=="") + $tRecord = 0; + $dispNum = $dispNum + $tRecord; +// echo mysqli_error($pubConn); + if(($cntDispNum+$dispNumOfPerPage) > $selRow[0]){ + $cntTbNum_1++; + $limitMin = 0; + if($cntTbNum_1<$nextTbNum){ + $limitMax = $dispNumOfPerPage; + }else{ + $limitMax = $nextDispNum; + } + } + if($DEBUG) echo "
      tRecord=$tRecord, dispNum=$dispNum
      "; +/************** Select field from CDR tables end *************************/ + +/**************** Display CDR details **********************************/ + switch($sysTypeNo){ + case '270': //CNF CDR START + if($tRecord){ + do{ + $recordType = $selRow['recordType']; + $key_sys_id = $selRow['key_sys_id']; + + if(5 == $recordType){ + $callingNumber = $selRow['callingNumber']; + $calledNumber = $selRow['calledNumber']; + $basicService = $selRow['basicService']; + $releaseTime = $selRow['releaseTime']; + $callDuration = $selRow['callDuration']; + $causeForTerm = $selRow['causeForTerm']; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //CNF CDR END + case '320': //MSC CDR START + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + if($recordType == 16) + continue; + + //if($recordType == 7) echo "recordType=$recordType
      "; + if($recordType < 6 || $recordType==15){ + $servedIMSI = $selRow[servedIMSI]; + $servedIMEI = $selRow[servedIMEI]; + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $recordingEntity = $selRow[recordingEntity]; + $mscIncomingTKGP = $selRow[mscIncomingTKGP]; + $mscOutgoingTKGP = $selRow[mscOutgoingTKGP]; + $supplServicesUsed = $selRow[supplServicesUsed]; + $seizureTime = $selRow[seizureTime]; + $answerTime = $selRow[answerTime]; + $releaseTime = $selRow[releaseTime]; + $callDuration = $selRow[callDuration]; + $dataVolume = $selRow[dataVolume]; + $causeForTerm = $selRow[causeForTerm]; + $diagnostics = $selRow[diagnostics]; + $sequenceNumber = $selRow[sequenceNumber]; + $callReference = $selRow[callReference]; + $recordExtensions = $selRow[recordExtensions]; + $releaseType = $selRow[releaseType]; + $air_type = $selRow[SystemType]; + //debug_log("/tmp/debug.txt",air_type); + //debug_log("/tmp/debug.txt",$air_type); + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + } + elseif($recordType < 8){ + $serviceCentre = $selRow[serviceCentre]; + $servedIMSI = $selRow[servedIMSI]; + $servedIMEI = $selRow[servedIMEI]; + $servedMSISDN = $selRow[servedMSISDN]; + $recordingEntity = $selRow[recordingEntity]; + $location_mscNumber = $selRow[location_mscNumber]; + $releaseTime = $selRow[releaseTime]; + $diagnostics = $selRow[diagnostics]; + $calledNumber = $selRow[calledNumber]; + $air_type =$selRow[SystemType]; + echo ""; + echo ""; + + echo ""; + + echo ""; + + if($recordType < 7){ + echo ""; + + /*echo "";*/ + echo ""; + + echo ""; + }else{ + echo ""; + + echo ""; + + echo ""; + } + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + } + else{ + $servedIMSI = $selRow[servedIMSI]; + $servedIMEI = $selRow[servedIMEI]; + $serviceCentre = $selRow[serviceCentre]; + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $recordingEntity = $selRow[recordingEntity]; + $mscIncomingTKGP = $selRow[mscIncomingTKGP]; + $mscOutgoingTKGP = $selRow[mscOutgoingTKGP]; + $supplServicesUsed = $selRow[supplServicesUsed]; + $seizureTime = $selRow[seizureTime]; + $answerTime = $selRow[answerTime]; + $releaseTime = $selRow[releaseTime]; + $callDuration = $selRow[callDuration]; + $dataVolume = $selRow[dataVolume]; + $causeForTerm = $selRow[causeForTerm]; + $diagnostics = $selRow[diagnostics]; + $sequenceNumber = $selRow[sequenceNumber]; + $callReference = $selRow[callReference]; + $recordExtensions = $selRow[recordExtensions]; + $releaseType = $selRow[releaseType]; + $air_type =$selRow[SystemType]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //MSC CDR details END + case '325': //VLR + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + + if($recordType == 13){ + $servedIMSI = $selRow[servedIMSI]; + $servedMSISDN = $selRow[servedMSISDN]; + $oldLoc_area = $selRow[oldLoc_area]; + $newLoc_area = $selRow[newLoc_area]; + $msClassmark = $selRow[msClassmark]; + $recordingEntity = $selRow[recordingEntity]; + $releaseTime = $selRow[releaseTime]; + $diagnostics = $selRow[diagnostics]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //VLR CDR END + case '330': //HLR CDR START + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + + if($recordType == 11){ + $recordType = $selRow[recordType]; + $servedIMSI = $selRow[servedIMSI]; + $servedMSISDN = $selRow[servedMSISDN]; + $recordingEntity = $selRow[recordingEntity]; + $routingNumber = $selRow[routingNumber]; + $releaseTime = $selRow[releaseTime]; + $numberOfForwarding = $selRow[numberOfForwarding]; + $diagnostics = $selRow[diagnostics]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + }elseif($recordType == 12){ + $servedIMSI = $selRow[servedIMSI]; + $oldLoc_mscNumber = $selRow[oldLoc_mscNumber]; + $newLoc_mscNumber = $selRow[newLoc_mscNumber]; + $recordingEntity = $selRow[recordingEntity]; + $releaseTime = $selRow[releaseTime]; + $diagnostics = $selRow[diagnostics]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //HLR CDR END + case '350': // SMSC + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + + if($DEBUG) echo "
      recordType=$recordType"; + if($recordType == 8 || $recordType == 9){ + $servedIMSI = $selRow[servedIMSI]; + $servedMSISDN = $selRow[servedMSISDN]; + $recordingEntity = $selRow[recordingEntity]; + $releaseTime = $selRow[releaseTime]; + $diagnostics = $selRow[diagnostics]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + case '351': // SMLOG + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + + if($recordType == 18&&$cdrType==18) + { + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $releaseTime = $selRow[releaseTime]; + $smdcs = $selRow[smdcs]; + $smcontent = $selRow[smcontent]; + $priority = $selRow[priority]; + $receiveTime = $selRow[receiveTime]; + $instance = $selRow[instance]; + $seqNum = $selRow[seqNum]; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + if($SMLOG_CONTENT_SHOW_FLAG=="Yes") + { + echo ""; + } + + + + echo ""; + + + /*$seqNum=$seqNum-1; + for($i=0;$i<24;$i++){ + + $m=($i<10?"0":"").$i; + $tmpTb="cdrFromSMLOG_$m"; + $tmpSql="SELECT * FROM $tmpTb WHERE recordType=17 AND seqNum=$seqNum"; + if($DEBUG) echo "
      tmpSql=$tmpSql
      "; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + if($tmpRow) break; + } + if($tmpRow){ + $callingNumber = $tmpRow[callingNumber]; + $calledNumber = $tmpRow[calledNumber]; + $releaseTime = $tmpRow[releaseTime]; + $smdcs = $tmpRow[smdcs]; + $smcontent = $tmpRow[smcontent]; + $priority = $tmpRow[priority]; + $receiveTime = $tmpRow[receiveTime]; + $instance = $tmpRow[instance]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + }*/ + + } + if($recordType == 19&&$cdrType==19) + { + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $releaseTime = $selRow[releaseTime]; + $smdcs = $selRow[smdcs]; + $smcontent = $selRow[smcontent]; + $priority = $selRow[priority]; + $receiveTime = $selRow[receiveTime]; + $instance = $selRow[instance]; + $delayTime = $selRow[delayTime]; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + if($SMLOG_CONTENT_SHOW_FLAG=="Yes") + { + echo ""; + } + + echo ""; + } + if($recordType == 20&&$cdrType==20){ + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $releaseTime = $selRow[releaseTime]; + $smdcs = $selRow[smdcs]; + $smcontent = $selRow[smcontent]; + $priority = $selRow[priority]; + $receiveTime = $selRow[receiveTime]; + $delayTime = $selRow[delayTime]; + $instance = $selRow[instance]; + $seqNum = $selRow[seqNum]; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + + echo ""; + + echo ""; + + if($SMLOG_CONTENT_SHOW_FLAG=="Yes") + { + echo ""; + } + + echo ""; + + /*$seqNum=$seqNum-1; + for($i=0;$i<24;$i++){ + + $m=($i<10?"0":"").$i; + $tmpTb="cdrFromSMLOG_$m"; + $tmpSql="SELECT * FROM $tmpTb WHERE recordType=17 AND seqNum=$seqNum"; + if($DEBUG) echo "
      tmpSql=$tmpSql
      "; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + if($tmpRow) break; + } + if($tmpRow){ + $callingNumber = $tmpRow[callingNumber]; + $calledNumber = $tmpRow[calledNumber]; + $releaseTime = $tmpRow[releaseTime]; + $smdcs = $tmpRow[smdcs]; + $smcontent = $tmpRow[smcontent]; + $priority = $tmpRow[priority]; + $receiveTime = $tmpRow[receiveTime]; + $delayTime = $tmpRow[delayTime]; + $instance = $tmpRow[instance]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + }*/ + } + + if($recordType == 21&&$cdrType==21){ + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $releaseTime = $selRow[releaseTime]; + $smdcs = $selRow[smdcs]; + $smcontent = $selRow[smcontent]; + $priority = $selRow[priority]; + $receiveTime = $selRow[receiveTime]; + $instance = $selRow[instance]; + $seqNum = $selRow[seqNum]; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + if($SMLOG_CONTENT_SHOW_FLAG=="Yes") + { + echo ""; + } + + + + echo ""; + + + /*$seqNum=$seqNum-1; + for($i=0;$i<24;$i++){ + + $m=($i<10?"0":"").$i; + $tmpTb="cdrFromSMLOG_$m"; + $tmpSql="SELECT * FROM $tmpTb WHERE recordType=17 AND seqNum=$seqNum"; + if($DEBUG) echo "
      tmpSql=$tmpSql
      "; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + if($tmpRow) break; + } + if($tmpRow){ + $callingNumber = $tmpRow[callingNumber]; + $calledNumber = $tmpRow[calledNumber]; + $releaseTime = $tmpRow[releaseTime]; + $smdcs = $tmpRow[smdcs]; + $smcontent = $tmpRow[smcontent]; + $priority = $tmpRow[priority]; + $receiveTime = $tmpRow[receiveTime]; + $instance = $tmpRow[instance]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + }*/ + + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //SMSC/SMLOG CDR END + case '375': + + $operationType_label=array(0=>"Manual-Registration", + 1=>"Auto-Registration", + 2=>"Account Deletion", + 3=>"Account Enquiry", + 4=>"Switch to Roaming", + 5=>"Switch to OPR", + 6=>"HLR Account Creation", + 7=>"HLR Account Deletion", + 8=>"PPS Account Creation", + 9=>"VLR Location Update"); + + $oprFlag_label=array(0=>"Not in Use",1=>"In Use",2=>"In Roaming"); + $termType_label=array( + 0=>"Normal Release", + 1=>"No Such MSISDN", + 2=>"HLR Account Creation Failed", + 3=>"HLR Account Deletion Failed", + 4=>"PPS Account Creation Failed", + 5=>"Can't Assign Process", + 6=>"Can縯 Assign MSISDN", + 7=>"IMEI Exists", + 8=>"License Exceecd", + 9=>"No Such IMEI", + 10=>"SIM Card Changed", + 11=>"Get OPR Status Failed", + 12=>"VLR Location Update Failed"); + if($tRecord){ + do{ + $recordType=$selRow[recordType]; + $key_sys_id=$selRow[key_sys_id]; + $operationType=$selRow[operationType]+0; + $imei=$selRow[imei]; + $msisdn=$selRow[msisdn]; + $imsi=$selRow[imsi]; + $oprFlag=$selRow[oprFlag]+0; + $termType=$selRow[termType]+0; + $seizureTime=$selRow[releaseTime]; + echo ""; + + + // + /* + if($recordType == 21) + echo ""; + else if($recordType == 22) + echo ""; + else + echo ""; + */ + // + if($operationType==NULL) + echo ""; + else + echo ""; + + // + if($imei) + echo ""; + else + echo ""; + // + if($msisdn) + echo ""; + else + echo ""; + // + if($imsi) + echo ""; + else + echo ""; + + if($oprFlag<3 && $oprFlag>=0) + echo ""; + // + if($seizureTime) + { + $pieces = explode(" ",$seizureTime); + echo ""; + } + else + echo ""; + if($termType>0) + echo ""; + else + echo ""; + + echo ""; + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + case '380': + + $status_label=array(0=>"White List",1=>"Black List",2=>"Grey List",3=>"Unknown"); + + if($tRecord){ + do{ + $recordType=$selRow[recordType]; + $key_sys_id=$selRow[key_sys_id]; + $eir_imei=$selRow[servedIMEI]; + $eir_imsi=$selRow[servedIMSI]; + $eir_status=$selRow[status]; + $eir_location=$selRow[location]; + $eir_event_time=$selRow[releaseTime]; + echo ""; + + if($recordType == 23) + echo ""; + else + echo ""; + + if($eir_status>=0 && $eir_status<=3) + echo ""; + else + echo ""; + + if($eir_imei) + echo ""; + else + echo ""; + // + if($eir_imsi) + echo ""; + else + echo ""; + + if($eir_location) + echo ""; + else + echo ""; + // + if($eir_event_time) + { + $pieces = explode(" ",$eir_event_time); + echo ""; + } + else + echo ""; + + + echo ""; + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + case '386': + + + if($tRecord){ + do{ + $recordType=$selRow[recordType]; + $key_sys_id=$selRow[key_sys_id]; + $mhc_nodeName=$selRow[nodeName]; + $mhc_ssn=$selRow[ssn]+0; + $mhc_identity=$selRow[identity]; + $mhc_desc=$selRow[6]; + $mhc_time=$selRow[releaseTime]; + echo ""; + + + + if($recordType == 24) + echo ""; + else + echo ""; + + + if(trim($mhc_nodeName)=="") + echo ""; + else + echo ""; + + // + if(trim($mhc_ssn)=="") + echo ""; + else + echo ""; + // + if(trim($mhc_identity)=="") + echo ""; + else + echo ""; + // + if(trim($mhc_desc)=="") + echo ""; + else + echo ""; + + + // + if($mhc_time) + { + $pieces = explode(" ",$mhc_time); + echo ""; + } + else + echo ""; + + + echo ""; + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + case '360': //PPS CDR START + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + + if($recordType == 0 || $recordType == 1 || $recordType == 2){ + $key_sys_id = $selRow[key_sys_id]; + $servedIMSI = $selRow[servedIMSI]; + $servedMSISDN = $selRow[servedMSISDN]; + $callType = $selRow[callType]; + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $recordingEntity = $selRow[recordingEntity]; + $seizureTime = $selRow[seizureTime]; + $answerTime = $selRow[answerTime]; + $releaseTime = $selRow[releaseTime]; + $callDuration = $selRow[callDuration]; + $causeForTerm = $selRow[causeForTerm]; + $callReference = $selRow[callReference]; + $releaseType = $selRow[releaseType]; + $charge = $selRow[charge]; + $balance = $selRow[balance]; + $gprs_sgsn_ip=$selRow[gprs_sgsn_ip]; + $gprs_volume=$selRow[gprs_volume]+0; + $peer_address=$selRow[peerAddress]; + + if($moneyPara){ + $charge = $charge;//$moneyPara; //靠靠靠靠 + $balance = $balance;//$moneyPara; //靠靠靠靠 + }else{ + $charge = 0; + $balance = 0; + } + + "$strCallType,MSISDN,$strType,$strCallISDN, + $strCalledISDN,GPRS SGSN IP, + $strAnswerTime,$strConverseTime,GPRS volume,Peer Address, + $strCharge,$strBalance"; + + echo ""; + echo ""; + + /* + echo ""; + */ + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + /* + echo ""; + */ + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + /* + if($moneyPara < 10){ + printf("", $charge); + printf("", $balance); + }elseif($moneyPara < 100){ + printf("", $charge); + printf("", $balance); + }else{ + printf("", $charge); + printf("", $balance); + }*/ + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //PPS CDR END + default: + break; + }//END switch*/ +}//END while +?> +
      "; + echo "$showNameArr[$i]"; + echo "
      "; + if($causeForTerm<6){ + echo "{$causeForTermArr[$causeForTerm][cause]}"; + }else{ + echo "-- "; + } + echo ""; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($basicService){ + echo "$basicService"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($callDuration){ + echo "$callDuration"; + }else{ + echo "-- "; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedIMEI){ + echo "$servedIMEI"; + }else{ + echo "--"; + } + echo ""; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($recordType == 0 || $recordType== 1){ + if($air_type == 0){ + echo "Unknown"; + }elseif($air_type == 1){ + echo "UMTS"; + }elseif($air_type == 2) + { + echo "GSM"; + } + } + else{ + echo "--"; + } + echo ""; + if($seizureTime){ + $pieces = explode(" ",$seizureTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($answerTime){ + $pieces = explode(" ",$answerTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "$callDuration$mscIncomingTKGP $mscOutgoingTKGP "; + if($arraySsCode[$supplServicesUsed]){ + echo "$arraySsCode[$supplServicesUsed] "; + }else{ + echo "-- "; + } + echo ""; + if($causeForTerm){ + echo "N"; + }else{ + echo "Y"; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedIMEI){ + echo "$servedIMEI"; + }else{ + echo "--"; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + if($serviceCentre){ + echo "$serviceCentre"; + }else{ + echo "-- "; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "-- "; + } + echo ""; + if($recordType == 6){ + if($air_type == 0){ + echo "Unknown"; + }elseif($air_type == 1){ + echo "UMTS"; + }elseif($air_type == 2) + { + echo "GSM"; + } + } + else{ + echo "--"; + } + echo ""; + if($serviceCentre){ + echo "$serviceCentre"; + }else{ + echo "-- "; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + if($recordType == 7){ + if($air_type == 0){ + echo "Unknown"; + }elseif($air_type == 1){ + echo "UMTS"; + }elseif($air_type == 2) + { + echo "GSM"; + } + } + else{ + echo "--"; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "----------"; + if($diagnostics){ + echo "N"; + }else{ + echo "Y "; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedIMEI){ + echo "$servedIMEI"; + }else{ + echo "--"; + } + echo ""; + if($serviceCentre){ + echo "$serviceCentre"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($recordType == 14){ + if($air_type == 0){ + echo "Unknown"; + }elseif($air_type == 1){ + echo "UMTS"; + }elseif($air_type == 2) + { + echo "GSM"; + } + } + else{ + echo "--"; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($answerTime){ + $pieces = explode(" ",$answerTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "------"; + if($arraySsCode[$supplServicesUsed]){ + echo "$arraySsCode[$supplServicesUsed] "; + }else{ + echo "-- "; + } + echo ""; + if($diagnostics){ + echo "N"; + }else{ + echo "Y"; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + if($oldLoc_area){ + echo "hexdec($oldLoc_area)"; + }else{ + echo "--"; + } + echo ""; + if($newLoc_area){ + echo "hexdec($newLoc_area)"; + }else{ + echo "--"; + } + echo ""; + if($diagnostics){ + echo "N"; + }else{ + echo "Y "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + if($routingNumber){ + echo "$routingNumber"; + }else{ + echo "-- "; + } + echo ""; + if($numberOfForwarding){ + echo "$numberOfForwarding"; + }else{ + echo "-- "; + } + echo "----"; + if($diagnostics){ + echo "N"; + }else{ + echo "Y "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo "------"; + if($oldLoc_mscNumber){ + echo "$oldLoc_mscNumber"; + }else{ + echo "--"; + } + echo ""; + if($newLoc_mscNumber){ + echo "$newLoc_mscNumber"; + }else{ + echo "--"; + } + echo ""; + if($diagnostics){ + echo "N"; + }else{ + echo "Y "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "
      "; + echo "$showType "; + echo ""; + if($servedIMSI) + echo "$servedIMSI"; + else + echo "--"; + echo ""; + if($servedMSISDN) + echo "$servedMSISDN"; + else + echo "--"; + echo ""; + if($diagnostics) + echo "N"; + else + echo "Y "; + echo ""; + if($releaseTime) { + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else + echo "-- "; + echo "
      "; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $encodeType=substr(decbin($smdcs),-4,-2); + //echo "smdcs=$smdcs--encodeType=$encodeType----content=$smcontent---"; + switch($encodeType) + { + case '00': + case '0': + case '': + echo "$smcontent"; + break; + case '01': + case '10': + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + break; + } + }else{ + echo "-- "; + } + echo "
      MO"; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + }else{ + echo "-- "; + } + echo "
      "; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($delayTime){ + $delayHour = $delayTime/3600; + $delayHour =intval($delayHour); + $delayHour=($delayHour<10?"0":"").$delayHour; + $delayMinute= $delayTime%3600/60; + $delayMinute =intval($delayMinute); + $delayMinute=($delayMinute<10?"0":"").$delayMinute; + $delaySecond= $delayTime%3600%60; + $delaySecond=($delaySecond<10?"0":"").$delaySecond; + echo "$delayHour:$delayMinute:$delaySecond"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $encodeType=substr(decbin($smdcs),-4,-2); + //echo "smdcs=$smdcs--encodeType=$encodeType----content=$smcontent---"; + switch($encodeType) + { + case '00': + case '0': + case '': + echo "$smcontent"; + break; + case '01': + case '10': + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + break; + } + }else{ + echo "-- "; + } + echo "
      "; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($delayTime){ + $delayHour = $delayTime/3600; + $delayHour =intval($delayHour); + $delayHour=($delayHour<10?"0":"").$delayHour; + $delayMinute= $delayTime%3600/60; + $delayMinute =intval($delayMinute); + $delayMinute=($delayMinute<10?"0":"").$delayMinute; + $delaySecond= $delayTime%3600%60; + $delaySecond=($delaySecond<10?"0":"").$delaySecond; + echo "$delayHour:$delayMinute:$delaySecond"; + }else{ + echo "-- "; + } + echo ""; + + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + + + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $encodeType=substr(decbin($smdcs),-4,-2); + //echo "smdcs=$smdcs--encodeType=$encodeType----content=$smcontent---"; + switch($encodeType) + { + case '00': + case '0': + case '': + echo "$smcontent"; + break; + case '01': + case '10': + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + break; + } + }else{ + echo "-- "; + } + echo "
      Wait to send"; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($delayTime){ + $delayHour = $delayTime/3600; + $delayHour =intval($delayHour); + $delayHour=($delayHour<10?"0":"").$delayHour; + $delayMinute= $delayTime%3600/60; + $delayMinute =intval($delayMinute); + $delayMinute=($delayMinute<10?"0":"").$delayMinute; + $delaySecond= $delayTime%3600%60; + $delaySecond=($delaySecond<10?"0":"").$delaySecond; + echo "$delayHour:$delayMinute:$delaySecond"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + }else{ + echo "-- "; + } + echo "
      "; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $encodeType=substr(decbin($smdcs),-4,-2); + //echo "smdcs=$smdcs--encodeType=$encodeType----content=$smcontent---"; + switch($encodeType) + { + case '00': + case '0': + case '': + echo "$smcontent"; + break; + case '01': + case '10': + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + break; + } + }else{ + echo "-- "; + } + echo "
      MO"; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + }else{ + echo "-- "; + } + echo "
      OPRIMDM----{$operationType_label[$operationType]}$imei--$msisdn--$imsi--{$oprFlag_label[$oprFlag]}"; + else + echo "--$pieces[1]--NY
      IMEI Ticket--{$status_label[$eir_status]}--$eir_imei--$eir_imsi--$eir_location--$pieces[1]--
      MHC----$mhc_nodeName--$mhc_ssn--$mhc_identity--$mhc_desc$pieces[1]--
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + switch($callType){ + case '100': echo "$strLocalCallOut"; + break; + case '101': echo "$strTrunkCallOut"; + break; + case '102': echo "$strNDDCallOut"; + break; + case '103': echo "$strHMTCallOut"; + break; + case '104': echo "$strIDDCallOut"; + break; + case '105': echo "$strLocalCallIn"; + break; + case '106': echo "$strTrunkCallIn"; + break; + case '107': echo "$strPeriodicCharge"; + break; + case '108': echo "$strIncrementValue"; + break; + case '109': echo "$strDecreaseValue"; + break; + case '110': echo "$strRechargeSuccess"; + break; + case '111': echo "$strRechargeFailure"; + break; + case '112': echo "MO short message"; + break; + case '113': echo "MT short message"; + break; + case '114': echo "Conference call"; + break; + case '115': echo "Third party charge"; + break; + case '138': echo "Debit"; + break; + case '139': echo "Refund"; + break; + case '140': echo "Transfer out"; + break; + case '141': echo "Transfer in"; + break; + case '142': echo "GPRS"; + break; + case '143': echo "VAS SMS Send"; + break; + case '144': echo "VAS MMS Send"; + break; + case '145': echo "VAS MMS Retrieve"; + break; + case '146': echo "VAS MMS Email"; + break; + case '147': echo "Bundle Plan Charge"; + break; + case '148': echo "Data Refund"; + break; + case '150': echo "Rent ID 1"; + break; + case '151': echo "Rent ID 2"; + break; + case '152': echo "Rent ID 3"; + break; + case '153': echo "Rent ID 4"; + break; + case '154': echo "Rent ID 5"; + break; + case '155': echo "Rent ID 6"; + break; + case '156': echo "Rent ID 7"; + break; + case '157': echo "Rent ID 8"; + break; + case '158': echo "FF Activation"; + break; + case '159': echo "FF number edit"; + break; + + default: echo "--"; + break; + } + echo ""; + if($callingNumber){ + toBreakEchoByLen($callingNumber,12); + /* + $len=strlen($callingNumber); + if($len > 8) + { + $callingNumber1=substr($callingNumber,0,8); + echo "$callingNumber1"; + $callingNumber2=substr($callingNumber,8,$len); + echo "
      $callingNumber2"; + //$callingNumber=$callingNumber1." ".$callingNumber2; + } + else + echo "$callingNumber";*/ + }else{ + echo "--"; + } + echo "
      "; + if($calledNumber){ + toBreakEchoByLen($calledNumber,12); + /*$len=strlen($calledNumber); + if($len > 8) + { + $calledNumber1=substr($calledNumber,0,8); + echo "$calledNumber1"; + $calledNumber2=substr($calledNumber,8,$len); + echo "
      $calledNumber2"; + //$calledNumber=$calledNumber1." ".$calledNumber2; + } + else + echo "$calledNumber";*/ + }else{ + echo "--"; + } + echo "
      "; + if($gprs_sgsn_ip){ + echo "$gprs_sgsn_ip"; + }else{ + echo "--"; + } + echo ""; + if($seizureTime){ + $pieces = explode(" ",$seizureTime); + echo "$pieces[1]"; + }else{ + echo "--"; + } + echo ""; + if($answerTime){ + $pieces = explode(" ",$answerTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($callDuration){ + echo "$callDuration"; + }else{ + echo "-- "; + } + echo ""; + echo "$gprs_volume"; + echo ""; + if($peer_address){ + toBreakEchoByLen($peer_address,15); + /*$len=strlen($peer_address); + if($len > 15) + { + $peer_address1=substr($peer_address,0,15); + echo "$peer_address1"; + $peer_address2=substr($peer_address,15,$len); + if($peer_address2) + echo "
      $peer_address2"; + } + else + echo "$peer_address";*/ + }else{ + echo "-- "; + } + echo "
      $charge$balance%5.0f%5.0f%5.1f%5.1f%5.2f%5.2f
      + +
      +
      + + + diff --git a/wxc2_omc/account/cdrList/cdrDown.php~ b/wxc2_omc/account/cdrList/cdrDown.php~ new file mode 100755 index 0000000..3bb0c38 --- /dev/null +++ b/wxc2_omc/account/cdrList/cdrDown.php~ @@ -0,0 +1,2167 @@ + $len) + { + $name1=substr($name,0,$len); + echo "$name1"; + $name2=substr($name,$len,$length); + if($name2) + echo "
      $name2"; + } + else + echo "$name"; +} + +require("../../inc/header.inc"); +?> + + +
      + +"; +/***************** Get the parameter of SMLOG_CONTENT_SHOW_FLAG **************/ +$sysId = $_REQUEST['sysId']; +$cdrType= $_REQUEST['cdrType']; +$serverName = $_REQUEST['serverName']; +$queryField = $_REQUEST['queryField']; +$keyWord= $_REQUEST['keyWord']; + +$mscType= $_REQUEST['mscType']; +$nextTbNum= $_REQUEST['nextTbNum']; +$nextDispNum= $_REQUEST['nextDispNum']; +$preDispNum= $_REQUEST['preDispNum']; +$preTbNum= $_REQUEST['preTbNum']; +$pageNext= $_REQUEST['pageNext']; +$pagePrevious= $_REQUEST['pagePrevious']; + + + + + +if($DEBUG) echo "sysId=$sysId,cdrType=$cdrType, serverName=$serverName, queryField=$queryField
      "; + +if(isset($sysId)){ + $sysIdArr=explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; +}else{ + echo "Cannot find sysId"; + exit(0); +} +global $pubConn; +$database="OMC_PUB"; +$selSql = "select pubVarName,pubVarValue from omcPubVarConf where pubVarName='SMLOG_CONTENT_SHOW_FLAG'"; +//echo "selSql=$selSql"; +$selRes = @mysqli_query($pubConn,$selSql); + +$selRow = @mysqli_fetch_array($selRes); +$SMLOG_CONTENT_SHOW_FLAG=$selRow['pubVarValue']; +//echo "SMLOG_CONTENT_SHOW_FLAG=$SMLOG_CONTENT_SHOW_FLAG


      "; +echo mysqli_error($pubConn); +/********************************************************************************/ + +$queryField = isset($queryField)?$queryField:"callingNumber"; + +$cntTbNum=$_REQUEST['cntTbNum']; +$cntTbNum_1=$_REQUEST['cntTbNum_1']; +$cntDispNum=$_REQUEST['cntDispNum']; + +require("./cdrHeader.php"); + +$DEBUG = 0; + + +$causeForTermArr = array( + array('num' => '0', 'cause' => 'Using'), + array('num' => '1', 'cause' => 'Booking'), + array('num' => '2', 'cause' => 'Delete'), + array('num' => '3', 'cause' => 'System fail'), + array('num' => '4', 'cause' => 'HLR fail'), + array('num' => '5', 'cause' => 'PPS fail') +); + +/******************* Define SS code (MSC use) ************************/ +$arraySsCode[16]="allLinIdentificationSS"; +$arraySsCode[17]="clip"; +$arraySsCode[18]="clir"; +$arraySsCode[19]="colp"; +$arraySsCode[20]="colr"; +$arraySsCode[21]="mci"; +$arraySsCode[24]="allNameIdentificationSS"; +$arraySsCode[25]="cnap"; +$arraySsCode[32]="allForwardingSS"; +$arraySsCode[33]="cfu"; +$arraySsCode[40]="allCondForwardingSS"; +$arraySsCode[41]="cfb"; +$arraySsCode[42]="cfnry"; +$arraySsCode[43]="cfnrc"; +$arraySsCode[44]="cd"; +$arraySsCode[64]="allCallCompletionSS"; +$arraySsCode[65]="cw"; +$arraySsCode[66]="hold"; +$arraySsCode[67]="ccbs-A"; +$arraySsCode[68]="ccbs-B"; +$arraySsCode[80]="allMultiPartySS"; +$arraySsCode[81]="multiPTY"; +$arraySsCode[144]="ALLBAR"; +$arraySsCode[145]="ALLBAROC"; +$arraySsCode[146]="BAOC"; +$arraySsCode[147]="BOIC"; +$arraySsCode[148]="BOICexHC"; +$arraySsCode[153]="BARALLIC"; +$arraySsCode[154]="BAIC"; +$arraySsCode[155]="BICRoam"; +$arraySsCode[49]="ECT"; + +/***************** Define display name list *******************************/ +switch($sysTypeNo){ +case '270': //CNF + $showNameList = "Type,$strCallISDN,$strCalledISDN,basicService, + $strSeizureTime,callDuration(S)"; + break; +case '320': //MSC + $showNameList = "$strCallType,IMSI,$strCallISDN,$strCalledISDN,RAN type, + $strSeizureTime,$strAnswerTime, + $strConverseTime,$strIncomingTrunkGroup,$strOutgoingTrunkGroup, + SS code,$strResult"; + break; +case '380': //EIR + $showNameList = "Call Type,Status,IMEI,IMSI,Location,Event Time"; + break; +case '386': //EIR + $showNameList = "Call Type,Node Name,SSN,Identity,Description,Event Time"; + break; +case '325': //VLR + $showNameList = "$strCallType,IMSI,MSISDN,Old LAC,New LAC,Result, + $strUpdateTimeStamp"; + break; +case '330': //HLR + $showNameList = "$strCallType,IMSI,MSISDN,$strRoutingNumber, + $strNumberOfForwarding,$strOldLocation,$strNewLocation, + Result,$strUpdateTimeStamp"; + break; +case '350': //SMSC + $showNameList = "$strCallType,IMSI,MSISDN,Result, + $strUpdateTimeStamp"; + break; +case '351': //SMLOG + require("./showSmscContent.php"); + if($cdrType==18||$cdrType==21){ + $showNameList = "$strCaller,$strCalled,$strReceive,$strSent,DCS,$strPriority,$strSMContent"; + }elseif($cdrType==19){ + $showNameList = "$strCaller,$strCalled,$strReceive,$strDiscarded,$strTimeToLive,DCS,$strPriority,$strSMContent"; + }else{ + $showNameList = "$strCaller,$strCalled,$strReceive,$strLastAttempt,$strTimeToLive,DCS,$strPriority,$strSMContent"; + } + break; +case '360': //PPS + $moneyPara = getMoneyPara(); + $showNameList ="$strCallType,MSISDN,$strType,$strCallISDN, + $strCalledISDN,GPRS SGSN IP, + $strAnswerTime,$strConverseTime,GPRS volume,Peer Address, + $strCharge,$strBalance"; + break; +case '375': + $showNameList="Operation Type,IMEI,MSISDN,IMSI,User Type,Seizure,Result"; + + break; +default: + break; +} + +if($DEBUG) echo "showNameList=$showNameList
      "; +$showNameArr=explode(',',$showNameList); +/***************** Define display name list END ****************************/ + + +?> + + + + + {$showNameArr[$i]}"; + } + else + { + echo ""; + } + + } + ?> + + +"; +while(($dispNum<$dispNumOfPerPage)&&($cntTbNum_1<24)){ + + $showTb = $tbName[$cntTbNum_1]; + if($language == 'gb'){ + $typeFld = " $typeTb.description "; + $srcFld = " $srcTb.description "; + }else{ + $typeFld = " $typeTb.description_2 "; + $srcFld = " $srcTb.description_2 "; + } + + $order = " ORDER BY $sortFld "; + if($keyWord){ + if($queryField=="callingNumber") + $rrType=6; + else + $rrType=7; + $aWhere = " AND ($queryField like '%$keyWord%' or(recordType=$rrType and serviceCentre like '%$keyWord%'))"; + if($sysId==375) + $aWhere = " AND $queryField like '%$keyWord%' "; + else if($sysId==386) + { + $aWhere = " AND $queryField like '%$keyWord%' "; + } + else if($sysId==380) + { + if($eirType == "imei") + $aWhere = " AND servedIMEI like '%$keyWord%' "; + else + $aWhere = " AND servedIMSI like '%$keyWord%' "; + } + } + + $bWhere = " WHERE $showTb.recordType = cdrTypeConf.key_type "; + + $where = $bWhere.$aWhere; + $limit = " LIMIT $limitMin, $limitMax"; + + $select = " SELECT *,$typeFld as showType FROM $showTb,$typeTb "; + + if($cdrType==18||$cdrType==19||$cdrType==20||$cdrType==21){ + if($keyWord){ + $selSql="SELECT * FROM $showTb WHERE recordType=$cdrType AND $queryField like '%$keyWord%' ".$order.$limit; + }else{ + $selSql="SELECT * FROM $showTb WHERE recordType=$cdrType".$order.$limit; + } + }else{ + if($sysId == 320) + { + $mscType=trim($mscType); + if($mscType == "call") + { + $where.=" AND (recordType>=0 and recordType<=5) "; + } + else if($mscType == "sm") + { + $where.=" AND (recordType>=6 and recordType<=7) "; + } + else + { + + } + } + if($sysId==375 || $sysId==386) + $order=" ORDER BY releaseTime DESC "; + $selSql = $select.$where.$order.$limit; + } + if($DEBUG) + echo "
      down selSql=$selSql
      "; + + $selRes = @mysqli_query($cdrDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + $tRecord = @mysqli_num_rows($selRes); + if($tRecord=="") + $tRecord = 0; + $dispNum = $dispNum + $tRecord; +// echo mysqli_error($pubConn); + if(($cntDispNum+$dispNumOfPerPage) > $selRow[0]){ + $cntTbNum_1++; + $limitMin = 0; + if($cntTbNum_1<$nextTbNum){ + $limitMax = $dispNumOfPerPage; + }else{ + $limitMax = $nextDispNum; + } + } + if($DEBUG) echo "
      tRecord=$tRecord, dispNum=$dispNum
      "; +/************** Select field from CDR tables end *************************/ + +/**************** Display CDR details **********************************/ + switch($sysTypeNo){ + case '270': //CNF CDR START + if($tRecord){ + do{ + $recordType = $selRow['recordType']; + $key_sys_id = $selRow['key_sys_id']; + + if(5 == $recordType){ + $callingNumber = $selRow['callingNumber']; + $calledNumber = $selRow['calledNumber']; + $basicService = $selRow['basicService']; + $releaseTime = $selRow['releaseTime']; + $callDuration = $selRow['callDuration']; + $causeForTerm = $selRow['causeForTerm']; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //CNF CDR END + case '320': //MSC CDR START + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + if($recordType == 16) + continue; + + //if($recordType == 7) echo "recordType=$recordType
      "; + if($recordType < 6 || $recordType==15){ + $servedIMSI = $selRow[servedIMSI]; + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $recordingEntity = $selRow[recordingEntity]; + $mscIncomingTKGP = $selRow[mscIncomingTKGP]; + $mscOutgoingTKGP = $selRow[mscOutgoingTKGP]; + $supplServicesUsed = $selRow[supplServicesUsed]; + $seizureTime = $selRow[seizureTime]; + $answerTime = $selRow[answerTime]; + $releaseTime = $selRow[releaseTime]; + $callDuration = $selRow[callDuration]; + $dataVolume = $selRow[dataVolume]; + $causeForTerm = $selRow[causeForTerm]; + $diagnostics = $selRow[diagnostics]; + $sequenceNumber = $selRow[sequenceNumber]; + $callReference = $selRow[callReference]; + $recordExtensions = $selRow[recordExtensions]; + $releaseType = $selRow[releaseType]; + $air_type = $selRow[SystemType]; + //debug_log("/tmp/debug.txt",air_type); + //debug_log("/tmp/debug.txt",$air_type); + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + }elseif($recordType < 8){ + $serviceCentre = $selRow[serviceCentre]; + $servedIMSI = $selRow[servedIMSI]; + $servedIMEI = $selRow[servedIMEI]; + $servedMSISDN = $selRow[servedMSISDN]; + $recordingEntity = $selRow[recordingEntity]; + $location_mscNumber = $selRow[location_mscNumber]; + $releaseTime = $selRow[releaseTime]; + $diagnostics = $selRow[diagnostics]; + $calledNumber = $selRow[calledNumber]; + $air_type =$selRow[SystemType]; + echo ""; + echo ""; + + echo ""; + + if($recordType < 7){ + echo ""; + + /*echo "";*/ + echo ""; + + echo ""; + }else{ + echo ""; + + echo ""; + + echo ""; + } + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + }else{ + $servedIMSI = $selRow[servedIMSI]; + $serviceCentre = $selRow[serviceCentre]; + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $recordingEntity = $selRow[recordingEntity]; + $mscIncomingTKGP = $selRow[mscIncomingTKGP]; + $mscOutgoingTKGP = $selRow[mscOutgoingTKGP]; + $supplServicesUsed = $selRow[supplServicesUsed]; + $seizureTime = $selRow[seizureTime]; + $answerTime = $selRow[answerTime]; + $releaseTime = $selRow[releaseTime]; + $callDuration = $selRow[callDuration]; + $dataVolume = $selRow[dataVolume]; + $causeForTerm = $selRow[causeForTerm]; + $diagnostics = $selRow[diagnostics]; + $sequenceNumber = $selRow[sequenceNumber]; + $callReference = $selRow[callReference]; + $recordExtensions = $selRow[recordExtensions]; + $releaseType = $selRow[releaseType]; + $air_type =$selRow[SystemType]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //MSC CDR details END + case '325': //VLR + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + + if($recordType == 13){ + $servedIMSI = $selRow[servedIMSI]; + $servedMSISDN = $selRow[servedMSISDN]; + $oldLoc_area = $selRow[oldLoc_area]; + $newLoc_area = $selRow[newLoc_area]; + $msClassmark = $selRow[msClassmark]; + $recordingEntity = $selRow[recordingEntity]; + $releaseTime = $selRow[releaseTime]; + $diagnostics = $selRow[diagnostics]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //VLR CDR END + case '330': //HLR CDR START + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + + if($recordType == 11){ + $recordType = $selRow[recordType]; + $servedIMSI = $selRow[servedIMSI]; + $servedMSISDN = $selRow[servedMSISDN]; + $recordingEntity = $selRow[recordingEntity]; + $routingNumber = $selRow[routingNumber]; + $releaseTime = $selRow[releaseTime]; + $numberOfForwarding = $selRow[numberOfForwarding]; + $diagnostics = $selRow[diagnostics]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + }elseif($recordType == 12){ + $servedIMSI = $selRow[servedIMSI]; + $oldLoc_mscNumber = $selRow[oldLoc_mscNumber]; + $newLoc_mscNumber = $selRow[newLoc_mscNumber]; + $recordingEntity = $selRow[recordingEntity]; + $releaseTime = $selRow[releaseTime]; + $diagnostics = $selRow[diagnostics]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //HLR CDR END + case '350': // SMSC + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + + if($DEBUG) echo "
      recordType=$recordType"; + if($recordType == 8 || $recordType == 9){ + $servedIMSI = $selRow[servedIMSI]; + $servedMSISDN = $selRow[servedMSISDN]; + $recordingEntity = $selRow[recordingEntity]; + $releaseTime = $selRow[releaseTime]; + $diagnostics = $selRow[diagnostics]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + case '351': // SMLOG + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + + if($recordType == 18&&$cdrType==18) + { + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $releaseTime = $selRow[releaseTime]; + $smdcs = $selRow[smdcs]; + $smcontent = $selRow[smcontent]; + $priority = $selRow[priority]; + $receiveTime = $selRow[receiveTime]; + $instance = $selRow[instance]; + $seqNum = $selRow[seqNum]; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + if($SMLOG_CONTENT_SHOW_FLAG=="Yes") + { + echo ""; + } + + + + echo ""; + + + /*$seqNum=$seqNum-1; + for($i=0;$i<24;$i++){ + + $m=($i<10?"0":"").$i; + $tmpTb="cdrFromSMLOG_$m"; + $tmpSql="SELECT * FROM $tmpTb WHERE recordType=17 AND seqNum=$seqNum"; + if($DEBUG) echo "
      tmpSql=$tmpSql
      "; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + if($tmpRow) break; + } + if($tmpRow){ + $callingNumber = $tmpRow[callingNumber]; + $calledNumber = $tmpRow[calledNumber]; + $releaseTime = $tmpRow[releaseTime]; + $smdcs = $tmpRow[smdcs]; + $smcontent = $tmpRow[smcontent]; + $priority = $tmpRow[priority]; + $receiveTime = $tmpRow[receiveTime]; + $instance = $tmpRow[instance]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + }*/ + + } + if($recordType == 19&&$cdrType==19) + { + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $releaseTime = $selRow[releaseTime]; + $smdcs = $selRow[smdcs]; + $smcontent = $selRow[smcontent]; + $priority = $selRow[priority]; + $receiveTime = $selRow[receiveTime]; + $instance = $selRow[instance]; + $delayTime = $selRow[delayTime]; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + if($SMLOG_CONTENT_SHOW_FLAG=="Yes") + { + echo ""; + } + + echo ""; + } + if($recordType == 20&&$cdrType==20){ + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $releaseTime = $selRow[releaseTime]; + $smdcs = $selRow[smdcs]; + $smcontent = $selRow[smcontent]; + $priority = $selRow[priority]; + $receiveTime = $selRow[receiveTime]; + $delayTime = $selRow[delayTime]; + $instance = $selRow[instance]; + $seqNum = $selRow[seqNum]; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + + echo ""; + + echo ""; + + if($SMLOG_CONTENT_SHOW_FLAG=="Yes") + { + echo ""; + } + + echo ""; + + /*$seqNum=$seqNum-1; + for($i=0;$i<24;$i++){ + + $m=($i<10?"0":"").$i; + $tmpTb="cdrFromSMLOG_$m"; + $tmpSql="SELECT * FROM $tmpTb WHERE recordType=17 AND seqNum=$seqNum"; + if($DEBUG) echo "
      tmpSql=$tmpSql
      "; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + if($tmpRow) break; + } + if($tmpRow){ + $callingNumber = $tmpRow[callingNumber]; + $calledNumber = $tmpRow[calledNumber]; + $releaseTime = $tmpRow[releaseTime]; + $smdcs = $tmpRow[smdcs]; + $smcontent = $tmpRow[smcontent]; + $priority = $tmpRow[priority]; + $receiveTime = $tmpRow[receiveTime]; + $delayTime = $tmpRow[delayTime]; + $instance = $tmpRow[instance]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + }*/ + } + + if($recordType == 21&&$cdrType==21){ + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $releaseTime = $selRow[releaseTime]; + $smdcs = $selRow[smdcs]; + $smcontent = $selRow[smcontent]; + $priority = $selRow[priority]; + $receiveTime = $selRow[receiveTime]; + $instance = $selRow[instance]; + $seqNum = $selRow[seqNum]; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + if($SMLOG_CONTENT_SHOW_FLAG=="Yes") + { + echo ""; + } + + + + echo ""; + + + /*$seqNum=$seqNum-1; + for($i=0;$i<24;$i++){ + + $m=($i<10?"0":"").$i; + $tmpTb="cdrFromSMLOG_$m"; + $tmpSql="SELECT * FROM $tmpTb WHERE recordType=17 AND seqNum=$seqNum"; + if($DEBUG) echo "
      tmpSql=$tmpSql
      "; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + if($tmpRow) break; + } + if($tmpRow){ + $callingNumber = $tmpRow[callingNumber]; + $calledNumber = $tmpRow[calledNumber]; + $releaseTime = $tmpRow[releaseTime]; + $smdcs = $tmpRow[smdcs]; + $smcontent = $tmpRow[smcontent]; + $priority = $tmpRow[priority]; + $receiveTime = $tmpRow[receiveTime]; + $instance = $tmpRow[instance]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + }*/ + + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //SMSC/SMLOG CDR END + case '375': + + $operationType_label=array(0=>"Manual-Registration", + 1=>"Auto-Registration", + 2=>"Account Deletion", + 3=>"Account Enquiry", + 4=>"Switch to Roaming", + 5=>"Switch to OPR", + 6=>"HLR Account Creation", + 7=>"HLR Account Deletion", + 8=>"PPS Account Creation", + 9=>"VLR Location Update"); + + $oprFlag_label=array(0=>"Not in Use",1=>"In Use",2=>"In Roaming"); + $termType_label=array( + 0=>"Normal Release", + 1=>"No Such MSISDN", + 2=>"HLR Account Creation Failed", + 3=>"HLR Account Deletion Failed", + 4=>"PPS Account Creation Failed", + 5=>"Can't Assign Process", + 6=>"Can’t Assign MSISDN", + 7=>"IMEI Exists", + 8=>"License Exceecd", + 9=>"No Such IMEI", + 10=>"SIM Card Changed", + 11=>"Get OPR Status Failed", + 12=>"VLR Location Update Failed"); + if($tRecord){ + do{ + $recordType=$selRow[recordType]; + $key_sys_id=$selRow[key_sys_id]; + $operationType=$selRow[operationType]+0; + $imei=$selRow[imei]; + $msisdn=$selRow[msisdn]; + $imsi=$selRow[imsi]; + $oprFlag=$selRow[oprFlag]+0; + $termType=$selRow[termType]+0; + $seizureTime=$selRow[releaseTime]; + echo ""; + + + // + /* + if($recordType == 21) + echo ""; + else if($recordType == 22) + echo ""; + else + echo ""; + */ + // + if($operationType==NULL) + echo ""; + else + echo ""; + + // + if($imei) + echo ""; + else + echo ""; + // + if($msisdn) + echo ""; + else + echo ""; + // + if($imsi) + echo ""; + else + echo ""; + + if($oprFlag<3 && $oprFlag>=0) + echo ""; + // + if($seizureTime) + { + $pieces = explode(" ",$seizureTime); + echo ""; + } + else + echo ""; + if($termType>0) + echo ""; + else + echo ""; + + echo ""; + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + case '380': + + $status_label=array(0=>"White List",1=>"Black List",2=>"Grey List",3=>"Unknown"); + + if($tRecord){ + do{ + $recordType=$selRow[recordType]; + $key_sys_id=$selRow[key_sys_id]; + $eir_imei=$selRow[servedIMEI]; + $eir_imsi=$selRow[servedIMSI]; + $eir_status=$selRow[status]; + $eir_location=$selRow[location]; + $eir_event_time=$selRow[releaseTime]; + echo ""; + + if($recordType == 23) + echo ""; + else + echo ""; + + if($eir_status>=0 && $eir_status<=3) + echo ""; + else + echo ""; + + if($eir_imei) + echo ""; + else + echo ""; + // + if($eir_imsi) + echo ""; + else + echo ""; + + if($eir_location) + echo ""; + else + echo ""; + // + if($eir_event_time) + { + $pieces = explode(" ",$eir_event_time); + echo ""; + } + else + echo ""; + + + echo ""; + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + case '386': + + + if($tRecord){ + do{ + $recordType=$selRow[recordType]; + $key_sys_id=$selRow[key_sys_id]; + $mhc_nodeName=$selRow[nodeName]; + $mhc_ssn=$selRow[ssn]+0; + $mhc_identity=$selRow[identity]; + $mhc_desc=$selRow[6]; + $mhc_time=$selRow[releaseTime]; + echo ""; + + + + if($recordType == 24) + echo ""; + else + echo ""; + + + if(trim($mhc_nodeName)=="") + echo ""; + else + echo ""; + + // + if(trim($mhc_ssn)=="") + echo ""; + else + echo ""; + // + if(trim($mhc_identity)=="") + echo ""; + else + echo ""; + // + if(trim($mhc_desc)=="") + echo ""; + else + echo ""; + + + // + if($mhc_time) + { + $pieces = explode(" ",$mhc_time); + echo ""; + } + else + echo ""; + + + echo ""; + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + case '360': //PPS CDR START + if($tRecord){ + do{ + $recordType = $selRow[recordType]; + $key_sys_id = $selRow[key_sys_id]; + $showType = $selRow[showType]; + + if($recordType == 0 || $recordType == 1 || $recordType == 2){ + $key_sys_id = $selRow[key_sys_id]; + $servedIMSI = $selRow[servedIMSI]; + $servedMSISDN = $selRow[servedMSISDN]; + $callType = $selRow[callType]; + $callingNumber = $selRow[callingNumber]; + $calledNumber = $selRow[calledNumber]; + $recordingEntity = $selRow[recordingEntity]; + $seizureTime = $selRow[seizureTime]; + $answerTime = $selRow[answerTime]; + $releaseTime = $selRow[releaseTime]; + $callDuration = $selRow[callDuration]; + $causeForTerm = $selRow[causeForTerm]; + $callReference = $selRow[callReference]; + $releaseType = $selRow[releaseType]; + $charge = $selRow[charge]; + $balance = $selRow[balance]; + $gprs_sgsn_ip=$selRow[gprs_sgsn_ip]; + $gprs_volume=$selRow[gprs_volume]+0; + $peer_address=$selRow[peerAddress]; + + if($moneyPara){ + $charge = $charge;//$moneyPara; //规范显示两位小数 + $balance = $balance;//$moneyPara; //规范显示两位小数 + }else{ + $charge = 0; + $balance = 0; + } + + "$strCallType,MSISDN,$strType,$strCallISDN, + $strCalledISDN,GPRS SGSN IP, + $strAnswerTime,$strConverseTime,GPRS volume,Peer Address, + $strCharge,$strBalance"; + + echo ""; + echo ""; + + /* + echo ""; + */ + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + /* + echo ""; + */ + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + /* + if($moneyPara < 10){ + printf("", $charge); + printf("", $balance); + }elseif($moneyPara < 100){ + printf("", $charge); + printf("", $balance); + }else{ + printf("", $charge); + printf("", $balance); + }*/ + } + }while(@$selRow = @mysqli_fetch_array($selRes)); + } + break; + //PPS CDR END + default: + break; + }//END switch*/ +}//END while +?> +
      "; + echo "$showNameArr[$i]"; + echo "
      "; + if($causeForTerm<6){ + echo "{$causeForTermArr[$causeForTerm][cause]}"; + }else{ + echo "-- "; + } + echo ""; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($basicService){ + echo "$basicService"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($callDuration){ + echo "$callDuration"; + }else{ + echo "-- "; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($recordType == 0 || $recordType== 1){ + if($air_type == 0){ + echo "Unknown"; + }elseif($air_type == 1){ + echo "UMTS"; + }elseif($air_type == 2) + { + echo "GSM"; + } + } + else{ + echo "--"; + } + echo ""; + if($seizureTime){ + $pieces = explode(" ",$seizureTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($answerTime){ + $pieces = explode(" ",$answerTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "$callDuration$mscIncomingTKGP $mscOutgoingTKGP "; + if($arraySsCode[$supplServicesUsed]){ + echo "$arraySsCode[$supplServicesUsed] "; + }else{ + echo "-- "; + } + echo ""; + if($causeForTerm){ + echo "N"; + }else{ + echo "Y"; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + if($serviceCentre){ + echo "$serviceCentre"; + }else{ + echo "-- "; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "-- "; + } + echo ""; + if($recordType == 6){ + if($air_type == 0){ + echo "Unknown"; + }elseif($air_type == 1){ + echo "UMTS"; + }elseif($air_type == 2) + { + echo "GSM"; + } + } + else{ + echo "--"; + } + echo ""; + if($serviceCentre){ + echo "$serviceCentre"; + }else{ + echo "-- "; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + if($recordType == 7){ + if($air_type == 0){ + echo "Unknown"; + }elseif($air_type == 1){ + echo "UMTS"; + }elseif($air_type == 2) + { + echo "GSM"; + } + } + else{ + echo "--"; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "----------"; + if($diagnostics){ + echo "N"; + }else{ + echo "Y "; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($serviceCentre){ + echo "$serviceCentre"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($recordType == 14){ + if($air_type == 0){ + echo "Unknown"; + }elseif($air_type == 1){ + echo "UMTS"; + }elseif($air_type == 2) + { + echo "GSM"; + } + } + else{ + echo "--"; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($answerTime){ + $pieces = explode(" ",$answerTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "------"; + if($arraySsCode[$supplServicesUsed]){ + echo "$arraySsCode[$supplServicesUsed] "; + }else{ + echo "-- "; + } + echo ""; + if($diagnostics){ + echo "N"; + }else{ + echo "Y"; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + if($oldLoc_area){ + echo "hexdec($oldLoc_area)"; + }else{ + echo "--"; + } + echo ""; + if($newLoc_area){ + echo "hexdec($newLoc_area)"; + }else{ + echo "--"; + } + echo ""; + if($diagnostics){ + echo "N"; + }else{ + echo "Y "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + if($routingNumber){ + echo "$routingNumber"; + }else{ + echo "-- "; + } + echo ""; + if($numberOfForwarding){ + echo "$numberOfForwarding"; + }else{ + echo "-- "; + } + echo "----"; + if($diagnostics){ + echo "N"; + }else{ + echo "Y "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo "------"; + if($oldLoc_mscNumber){ + echo "$oldLoc_mscNumber"; + }else{ + echo "--"; + } + echo ""; + if($newLoc_mscNumber){ + echo "$newLoc_mscNumber"; + }else{ + echo "--"; + } + echo ""; + if($diagnostics){ + echo "N"; + }else{ + echo "Y "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo "
      "; + echo "$showType "; + echo ""; + if($servedIMSI) + echo "$servedIMSI"; + else + echo "--"; + echo ""; + if($servedMSISDN) + echo "$servedMSISDN"; + else + echo "--"; + echo ""; + if($diagnostics) + echo "N"; + else + echo "Y "; + echo ""; + if($releaseTime) { + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else + echo "-- "; + echo "
      "; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $encodeType=substr(decbin($smdcs),-4,-2); + //echo "smdcs=$smdcs--encodeType=$encodeType----content=$smcontent---"; + switch($encodeType) + { + case '00': + case '0': + case '': + echo "$smcontent"; + break; + case '01': + case '10': + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + break; + } + }else{ + echo "-- "; + } + echo "
      MO"; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + }else{ + echo "-- "; + } + echo "
      "; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($delayTime){ + $delayHour = $delayTime/3600; + $delayHour =intval($delayHour); + $delayHour=($delayHour<10?"0":"").$delayHour; + $delayMinute= $delayTime%3600/60; + $delayMinute =intval($delayMinute); + $delayMinute=($delayMinute<10?"0":"").$delayMinute; + $delaySecond= $delayTime%3600%60; + $delaySecond=($delaySecond<10?"0":"").$delaySecond; + echo "$delayHour:$delayMinute:$delaySecond"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $encodeType=substr(decbin($smdcs),-4,-2); + //echo "smdcs=$smdcs--encodeType=$encodeType----content=$smcontent---"; + switch($encodeType) + { + case '00': + case '0': + case '': + echo "$smcontent"; + break; + case '01': + case '10': + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + break; + } + }else{ + echo "-- "; + } + echo "
      "; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($delayTime){ + $delayHour = $delayTime/3600; + $delayHour =intval($delayHour); + $delayHour=($delayHour<10?"0":"").$delayHour; + $delayMinute= $delayTime%3600/60; + $delayMinute =intval($delayMinute); + $delayMinute=($delayMinute<10?"0":"").$delayMinute; + $delaySecond= $delayTime%3600%60; + $delaySecond=($delaySecond<10?"0":"").$delaySecond; + echo "$delayHour:$delayMinute:$delaySecond"; + }else{ + echo "-- "; + } + echo ""; + + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + + + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $encodeType=substr(decbin($smdcs),-4,-2); + //echo "smdcs=$smdcs--encodeType=$encodeType----content=$smcontent---"; + switch($encodeType) + { + case '00': + case '0': + case '': + echo "$smcontent"; + break; + case '01': + case '10': + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + break; + } + }else{ + echo "-- "; + } + echo "
      Wait to send"; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($delayTime){ + $delayHour = $delayTime/3600; + $delayHour =intval($delayHour); + $delayHour=($delayHour<10?"0":"").$delayHour; + $delayMinute= $delayTime%3600/60; + $delayMinute =intval($delayMinute); + $delayMinute=($delayMinute<10?"0":"").$delayMinute; + $delaySecond= $delayTime%3600%60; + $delaySecond=($delaySecond<10?"0":"").$delaySecond; + echo "$delayHour:$delayMinute:$delaySecond"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + }else{ + echo "-- "; + } + echo "
      "; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $encodeType=substr(decbin($smdcs),-4,-2); + //echo "smdcs=$smdcs--encodeType=$encodeType----content=$smcontent---"; + switch($encodeType) + { + case '00': + case '0': + case '': + echo "$smcontent"; + break; + case '01': + case '10': + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + break; + } + }else{ + echo "-- "; + } + echo "
      MO"; + if($callingNumber){ + echo "$callingNumber"; + }else{ + echo "--"; + } + echo ""; + if($calledNumber){ + echo "$calledNumber"; + }else{ + echo "--"; + } + echo ""; + if($receiveTime){ + $pieces = explode(" ",$receiveTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($releaseTime){ + $pieces = explode(" ",$releaseTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($smdcs)){ + echo "$smdcs"; + }else{ + echo "-- "; + } + echo ""; + if(strlen($priority)){ + echo "$priority"; + }else{ + echo "-- "; + } + echo ""; + if($smcontent){//Changed by hewd + $utfContent=encodeUTF8($smcontent,$smdcs); + echo "$utfContent"; + }else{ + echo "-- "; + } + echo "
      OPRIMDM----{$operationType_label[$operationType]}$imei--$msisdn--$imsi--{$oprFlag_label[$oprFlag]}"; + else + echo "--$pieces[1]--NY
      IMEI Ticket--{$status_label[$eir_status]}--$eir_imei--$eir_imsi--$eir_location--$pieces[1]--
      MHC----$mhc_nodeName--$mhc_ssn--$mhc_identity--$mhc_desc$pieces[1]--
      $showType"; + if($servedIMSI){ + echo "$servedIMSI"; + }else{ + echo "--"; + } + echo ""; + if($servedMSISDN){ + echo "$servedMSISDN"; + }else{ + echo "--"; + } + echo ""; + switch($callType){ + case '100': echo "$strLocalCallOut"; + break; + case '101': echo "$strTrunkCallOut"; + break; + case '102': echo "$strNDDCallOut"; + break; + case '103': echo "$strHMTCallOut"; + break; + case '104': echo "$strIDDCallOut"; + break; + case '105': echo "$strLocalCallIn"; + break; + case '106': echo "$strTrunkCallIn"; + break; + case '107': echo "$strPeriodicCharge"; + break; + case '108': echo "$strIncrementValue"; + break; + case '109': echo "$strDecreaseValue"; + break; + case '110': echo "$strRechargeSuccess"; + break; + case '111': echo "$strRechargeFailure"; + break; + case '112': echo "MO short message"; + break; + case '113': echo "MT short message"; + break; + case '114': echo "Conference call"; + break; + case '115': echo "Third party charge"; + break; + case '138': echo "Debit"; + break; + case '139': echo "Refund"; + break; + case '140': echo "Transfer out"; + break; + case '141': echo "Transfer in"; + break; + case '142': echo "GPRS"; + break; + case '143': echo "VAS SMS Send"; + break; + case '144': echo "VAS MMS Send"; + break; + case '145': echo "VAS MMS Retrieve"; + break; + case '146': echo "VAS MMS Email"; + break; + case '147': echo "Bundle Plan Charge"; + break; + case '148': echo "Data Refund"; + break; + case '150': echo "Rent ID 1"; + break; + case '151': echo "Rent ID 2"; + break; + case '152': echo "Rent ID 3"; + break; + case '153': echo "Rent ID 4"; + break; + case '154': echo "Rent ID 5"; + break; + case '155': echo "Rent ID 6"; + break; + case '156': echo "Rent ID 7"; + break; + case '157': echo "Rent ID 8"; + break; + case '158': echo "FF Activation"; + break; + case '159': echo "FF number edit"; + break; + + default: echo "--"; + break; + } + echo ""; + if($callingNumber){ + toBreakEchoByLen($callingNumber,12); + /* + $len=strlen($callingNumber); + if($len > 8) + { + $callingNumber1=substr($callingNumber,0,8); + echo "$callingNumber1"; + $callingNumber2=substr($callingNumber,8,$len); + echo "
      $callingNumber2"; + //$callingNumber=$callingNumber1." ".$callingNumber2; + } + else + echo "$callingNumber";*/ + }else{ + echo "--"; + } + echo "
      "; + if($calledNumber){ + toBreakEchoByLen($calledNumber,12); + /*$len=strlen($calledNumber); + if($len > 8) + { + $calledNumber1=substr($calledNumber,0,8); + echo "$calledNumber1"; + $calledNumber2=substr($calledNumber,8,$len); + echo "
      $calledNumber2"; + //$calledNumber=$calledNumber1." ".$calledNumber2; + } + else + echo "$calledNumber";*/ + }else{ + echo "--"; + } + echo "
      "; + if($gprs_sgsn_ip){ + echo "$gprs_sgsn_ip"; + }else{ + echo "--"; + } + echo ""; + if($seizureTime){ + $pieces = explode(" ",$seizureTime); + echo "$pieces[1]"; + }else{ + echo "--"; + } + echo ""; + if($answerTime){ + $pieces = explode(" ",$answerTime); + echo "$pieces[1]"; + }else{ + echo "-- "; + } + echo ""; + if($callDuration){ + echo "$callDuration"; + }else{ + echo "-- "; + } + echo ""; + echo "$gprs_volume"; + echo ""; + if($peer_address){ + toBreakEchoByLen($peer_address,15); + /*$len=strlen($peer_address); + if($len > 15) + { + $peer_address1=substr($peer_address,0,15); + echo "$peer_address1"; + $peer_address2=substr($peer_address,15,$len); + if($peer_address2) + echo "
      $peer_address2"; + } + else + echo "$peer_address";*/ + }else{ + echo "-- "; + } + echo "
      $charge$balance%5.0f%5.0f%5.1f%5.1f%5.2f%5.2f
      + +
      +
      + + diff --git a/wxc2_omc/account/cdrList/cdrHeader.php b/wxc2_omc/account/cdrList/cdrHeader.php new file mode 100755 index 0000000..e1107a1 --- /dev/null +++ b/wxc2_omc/account/cdrList/cdrHeader.php @@ -0,0 +1,506 @@ +***********************************************************
      "; + echo "serverName=$serverName, sysId=$sysId,cdrType=$cdrType
      "; + echo "queryField=$queryField
      "; + echo "keyWord=$keyWord
      "; + echo "preTbNum=$preTbNum, preDispNum=$preDispNum
      "; + echo "cntTbNum=$cntTbNum, cntDispNum=$cntDispNum
      "; + echo "nextTbNum=$nextTbNum, nextDispNum=$nextDispNum
      "; + echo "***************************************************************
      "; +} + +global $OMC_server; +$dbName = "CDR_DB"; +$cdrDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $dbName); + +$dispNumOfPerPage = 30; +$sortFld = isset($sortFld)?$sortFld:"releaseTime DESC "; +if(!isset($cntTbNum)) $cntTbNum = 0; +if(!isset($cntDispNum)) $cntDispNum = 0; + +if(isset($pageNext)){ + if($DEBUG) echo "NEXT
      "; + if(isset($nextTbNum)){ + $cntTbNum = intval($nextTbNum); + $cntTbNum_1 = intval($nextTbNum); + }else{ + $nextTbNum = 0; + } + if(isset($nextDispNum)) + $cntDispNum = intval($nextDispNum); + else + $nextDispNum = 0; +} +if(isset($pagePrevious)){ + if($DEBUG) echo "PREVIOUS
      "; + if(isset($preTbNum)){ + $cntTbNum = intval($preTbNum); + $cntTbNum_1 = intval($preTbNum); + }else + $preTbNum = $cntTbNum; + if(isset($preDispNum)) + $cntDispNum = intval($preDispNum); + else + $preDispNum = $cntDispNum; +} +if($DEBUG){ + echo "cntTbNum=$cntTbNum
      "; + echo "cntDispNum=$cntDispNum
      "; +} + +$rlsTb="cdrReleaseConf"; +$srcTb="cdrServiceConf"; +$typeTb="cdrTypeConf"; + +if($DEBUG){ + $currentReleaseTime = date("Y-m-d H:i:s"); + echo "cntDate=$cntDate, currentReleaseTime=$currentReleaseTime
      "; +} +for($i=0;$i<24;$i++){ + $beginTime[$i] = date("y-m-d H:i:s",mktime(date("H")-$i,0,0,date("m"),date("d"),date("Y"))); + $endTime[$i] = date("y-m-d H:i:s",mktime(date("H")-$i,59,59,date("m"),date("d"),date("Y"))); + $selHour[$i] = date("H",mktime(date("H")-$i,0,0,date("m"),date("d"),date("Y"))); + $tbName[$i] = "cdrFrom".$serverName."_".$selHour[$i]; + if($DEBUG) echo "beginTime[$i]=$beginTime[$i], endTime[$i]=$endTime[$i], tbName[$i]=$tbName[$i]
      "; +} + +/************* Get the CDR count of passed hours ***************************/ + +if(!isset($keyWord)){ + + for($i=0;$i<24;$i++){ + $recordCount[$i] = 0; + } + for($i=0;$i<=date("G");$i++){ + $hour = date("H",mktime($i,0,0,date("m"),date("d"),date("Y"))); + $tmpTbName = "cdrFrom".$serverName."_".$hour; +/****************changed for SMLog by Cui Ticun start*************************/ + if($cdrType==18||$cdrType==19||$cdrType==20||$cdrType==21){ + $selSql = "SELECT count(*) FROM $tmpTbName WHERE recordType=$cdrType"; + }else{ + /* + if($sysId == 320) + { + echo "mscType=**$mscType**
      "; + $mscType=trim($mscType); + if($mscType == "call") + { + $selSql.="SELECT count(*) FROM $tmpTbName WHERE (recordType>=0 AND recordType<=5) "; + } + else if($mscType == "sm") + { + $selSql.= "SELECT count(*) FROM $tmpTbName WHERE (recordType>=6 AND recordType<=7) "; + } + else + { */ + $selSql = "SELECT count(*) FROM $tmpTbName"; + //} + //} + + } +/****************changed for SMLog by Cui Ticun end*************************/ + if($DEBUG) + echo "
      $selSql
      "; + $selRes = @mysqli_query($cdrDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + //echo mysqli_error($pubConn); + if($selRow[0]=="") + $recordCount[$i] = 0; + else + $recordCount[$i] = $selRow[0]; + if($DEBUG) echo "recordCount[$i] = $recordCount[$i]
      "; + } +} +/*********** Get the CDR count of passed hours end. *****************/ + +/******** Get the next table number and next display number start **********/ + +if($DEBUG){ + echo "
      ************ Next ***************
      "; + echo "tbName[$cntTbNum]=$tbName[$cntTbNum]
      "; + echo "cntTbNum=$cntTbNum,cntDispNum=$cntDispNum
      "; +} +$displayNum = 0; +$nextTbNum = $cntTbNum; + + +while((($displayNum-$cntDispNum)<$dispNumOfPerPage)&&($nextTbNum<24)){ +/****************changed for SMLog by Cui Ticun start*************************/ + + if($cdrType==18||$cdrType==19||$cdrType==20||$cdrType==21){ + if(isset($keyWord)){ + $WHERE = " $queryField like '%$keyWord%'"; + $WHERE = "WHERE ".$WHERE." AND recordType=$cdrType"; + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum] $WHERE"; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum] WHERE recordType=$cdrType"; + } + }else{ + if(isset($keyWord)){ + if($queryField=="callingNumber") + $rrType=6; + else + $rrType=7; + + $WHERE = " $queryField like '%$keyWord%' or (recordType=$rrType and servedMSISDN like '%$keyWord%') "; + $WHERE = "WHERE ".$WHERE; + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum] $WHERE "; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum]"; + } + //echo "sysId=$sysId,mscType=**$mscType**
      "; + if($sysId == 320) + { + + if($mscType == "call") + { + //$selSql.=" AND (recordType>=0 AND recordType<=5) "; + if(isset($keyWord)){ + if($queryField=="callingNumber") + $rrType=6; + else + $rrType=7; + $WHERE = " ($queryField like '%$keyWord%' or (recordType=$rrType and servedMSISDN like '%$keyWord%')) AND (recordType>=0 AND recordType<=5) "; + $WHERE = "WHERE ".$WHERE; + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum] $WHERE "; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum] WHERE recordType>=0 AND recordType<=5 "; + } + } + else if($mscType == "sm") + { + //$selSql.=" AND (recordType>=6 AND recordType<=7) "; + if(isset($keyWord)){ + if($queryField=="callingNumber") + $rrType=6; + else + $rrType=7; + $WHERE = " ($queryField like '%$keyWord%' or (recordType=$rrType and servedMSISDN like '%$keyWord%')) AND (recordType>=6 AND recordType<=7) "; + $WHERE = "WHERE ".$WHERE; + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum] $WHERE "; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum] WHERE recordType>=6 AND recordType<=7 "; + } + } + else + { + if(isset($keyWord)){ + if($queryField=="callingNumber") + $rrType=6; + else + $rrType=7; + $WHERE = " $queryField like '%$keyWord%' or (recordType=$rrType and serviceCentre like '%$keyWord%') "; + $WHERE = "WHERE ".$WHERE; + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum] $WHERE "; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$nextTbNum]"; + } + } + } + } +/****************changed for SMLog by Cui Ticun end**************************/ +if($sysId==375) + $selSql=" SELECT count(*) FROM $tbName[$nextTbNum] WHERE msisdn like '%$keyWord%' "; +if($sysId==386) + $selSql=" SELECT count(*) FROM $tbName[$nextTbNum] WHERE nodeName like '%$keyWord%' "; +if($sysId==380) +{ + if($eirType == "imei") + $selSql=" SELECT count(*) FROM $tbName[$nextTbNum] WHERE servedIMEI like '%$keyWord%' "; + else + $selSql=" SELECT count(*) FROM $tbName[$nextTbNum] WHERE servedIMSI like '%$keyWord%' "; +} + +if($DEBUG) + echo "selSql=$selSql
      "; + $selRes = @mysqli_query($cdrDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($cdrDbConn); + if($selRow[0]=="") + $recordNum[$nextTbNum] = 0; + else + $recordNum[$nextTbNum] = $selRow[0]; + if($DEBUG) echo "recordNum[$nextTbNum]=$recordNum[$nextTbNum]
      "; + $displayNum += $selRow[0]; + if(($cntDispNum+$dispNumOfPerPage)>$displayNum){ + $nextTbNum++; + } + if($DEBUG) echo "displayNum = $displayNum, nextTbNum=$nextTbNum
      "; +} + +if(($nextTbNum==24||$displayNum<$dispNumOfPerPage)) + unset($nextFlag); +else + $nextFlag = 1; + +/********************changed for SMLog by Cui Ticun start**********************/ +/********************deal with when $displayNum==$dispNumOfPerPage*************/ + +if($displayNum==$dispNumOfPerPage&&$nextTbNum!=24){ + + $tmpTbNum=$nextTbNum+1; + do{ + if($cdrType==18||$cdrType==19||$cdrType==20||$cdrType==21){ + if(isset($keyWord)){ + $WHERE = " $queryField like '%$keyWord%'"; + $WHERE = "WHERE ".$WHERE." AND recordType=$cdrType"; + $selSql = "SELECT count(*) FROM $tbName[$tmpTbNum] $WHERE"; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$tmpTbNum] WHERE recordType=$cdrType"; + } + }else{ + if(isset($keyWord)){ + $WHERE = " $queryField like '%$keyWord%'"; + $WHERE = "WHERE ".$WHERE; + $selSql = "SELECT count(*) FROM $tbName[$tmpTbNum] $WHERE "; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$tmpTbNum]"; + } + } + if($DEBUG)echo "selSql=$selSql, "; + $selRes = @mysqli_query($cdrDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); +// echo mysqli_error($pubConn); + if($selRow[0]=="") + $selRow[0] = 0; + $tmpTbNum++; + }while(!$selRow[0]&&$tmpTbNum<24); +} +if($tmpTbNum==24) + unset($nextFlag); +/********************changed for SMLog by Cui Ticun end**********************/ + +if($DEBUG){ + echo "==========================
      "; + echo "recordNum[$nextTbNum]=$recordNum[$nextTbNum]
      "; + echo "cntDispNum=$cntDispNum
      "; + echo "displayNum=$displayNum
      "; + echo "==========================
      "; +} + +if($nextTbNum == $cntTbNum){ + //echo "IF
      "; + $nextDispNum = $cntDispNum+$dispNumOfPerPage; +}else{ + //echo "ELSE
      "; + $nextDispNum = $cntDispNum+$dispNumOfPerPage+$recordNum[$nextTbNum]-$displayNum; +} +//if(($recordNum[$nextTbNum]-$cntDispNum)>$dispNumOfPerPage){ +if($DEBUG){ + echo "nextTbNum=$nextTbNum, nextDispNum=$nextDispNum
      "; + echo "********************************
      "; +} + +if($displayNum==0){ + echo "No record.
      "; + exit(); +} +/*********** Get the next table number and display number end. **********/ + +/******** Get the previous table number and display number start ********/ +if($DEBUG){ + echo "
      ************ Previous ***************
      "; + echo "tbName[$cntTbNum]=$tbName[$cntTbNum]
      "; + echo "cntTbNum=$cntTbNum, cntDispNum=$cntDispNum
      "; +} +if(($cntTbNum!=0)||($cntDispNum!=0)){ + $previousFlag=1; +} +if(isset($previousFlag)){ + $preTbNum = $cntTbNum; + if($cntDispNum >= $dispNumOfPerPage){ + $preDispNum = $cntDispNum - $dispNumOfPerPage; + }else{ + $leftDisplay = $dispNumOfPerPage - $cntDispNum; + if($preTbNum==0) $leftDisplay = 0; + while(($leftDisplay>0)&&($preTbNum>0)){ + $preTbNum = $preTbNum-1; +/****************changed for SMLog by Cui Ticun start**************************/ + if($cdrType==18||$cdrType==19||$cdrType==20||$cdrType==21){ + if(isset($keyWord)){ + $WHERE = " $queryField like '%$keyWord%'"; + $WHERE = "WHERE ".$WHERE." AND recordType=$cdrType"; + $selSql = "SELECT count(*) FROM $tbName[$preTbNum] $WHERE"; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$preTbNum] WHERE recordType=$cdrType"; + } + }else{ + if(isset($keyWord)){ + $WHERE = " $queryField like '%$keyWord%'"; + $WHERE = "WHERE ".$WHERE; + $selSql = "SELECT count(*) FROM $tbName[$preTbNum] $WHERE"; + }else{ + $selSql = "SELECT count(*) FROM $tbName[$preTbNum]"; + } + } +/****************changed for SMLog by Cui Ticun end**************************/ + if($DEBUG) echo "selSql=$selSql
      "; + $selRes = @mysqli_query($cdrDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + if($selRow[0]=="") + $selRow[0] = 0; + $leftDisplay = $leftDisplay - $selRow[0]; + //echo mysqli_error($pubConn); + } + if( $leftDisplay!=$dispNumOfPerPage ){ + $preDispNum = abs($leftDisplay); + }else{ + $preDispNum = 0; + } + } +} +if($DEBUG){ + echo "preTbNum=$preTbNum,preDispNum=$preDispNum
      "; + echo "********************************
      "; +} +/******** Get the previous table number and display number end. *********/ +?> + + +"; + if($cdrType!=20){ + echo ""; + echo ""; + echo ""; + $field = "queryField=$queryField"; + $sys = "serverName=$serverName&&sysId=$sysId&&cdrType=$cdrType"; + for($i=0;$i<12;$i++){ + if($recordCount[$i] > 0){ + $tmpTbNum = date("G")-$i; + $cnt = "cntTbNum=$tmpTbNum&&cntTbNum_1=$tmpTbNum&&cntDispNum=0"; + $cntPageLink = $field."&&".$sys."&&".$cnt; + if($DEBUG) echo "cntPageLink=$cntPageLink
      "; + echo ""; + }else{ + echo ""; + } + } + echo ""; + + echo ""; + echo ""; + for($i=0;$i<12;$i++){ + echo ""; + } + echo ""; + + + echo ""; + echo ""; + for($i=12;$i<24;$i++){ + if($recordCount[$i] > 0){ + $tmpTbNum = date("G")-$i; + $cnt = "cntTbNum=$tmpTbNum&&cntTbNum_1=$tmpTbNum&&cntDispNum=0"; + $cntPageLink = $field."&&".$sys."&&".$cnt; + if($DEBUG) echo "cntPageLink=$cntPageLink
      "; + echo ""; + }else{ + echo ""; + } + } + echo ""; + + echo ""; + echo ""; + for($i=12;$i<24;$i++){ + echo ""; + } + echo ""; + + + + echo "
      Period$i$i
      Total$recordCount[$i]
      Period$i$i
      Total$recordCount[$i]
      "; + } +} +?> + + + + + + + +
      + Period: + + + "; + echo "$strPrevious"; + } + /* + else{ + echo "$strPrevious"; + } + */ + + // NEW: Display a link for the next set of records. + $flag = " pageNext=1 "; + if(isset($keyWord)) + $nextPageLink = $previous." && ".$next." && ".$flag." && ".$field." && ".$sys." && ".$msc_type." && ".$key; + else + $nextPageLink = $previous." && ".$next." && ".$flag." && ".$field." && ".$sys." && ".$msc_type; + if($DEBUG) echo "【NEXT】$nextPageLink"; + if (isset($nextFlag)){ + echo ""; + //echo " >> $strNext"; + echo "$strNext"; + } + /* + else{ + //echo " >> $strNext"; + echo "$strNext"; + } + */ + if ( (!isset($previousFlag)) && (!isset($nextFlag)) ){ + echo "
      "; + } + + ?> +
      +
      + diff --git a/wxc2_omc/account/cdrList/cdrIndex.php b/wxc2_omc/account/cdrList/cdrIndex.php new file mode 100755 index 0000000..e6b6eb4 --- /dev/null +++ b/wxc2_omc/account/cdrList/cdrIndex.php @@ -0,0 +1,62 @@ +"; +global $pubConn; +/******************** Get the server name ********************************/ +$tbName = "sysConf"; +$dbName = "OMC_PUB"; +$where = " WHERE $sysId=sysTypeNo "; +$selSql = "SELECT sysTypeName FROM $tbName $where"; +//if ($DEBUG) +//echo "
      selSql=$selSql
      "; +//echo "
      dbName=$dbName"; +//echo "
      selSql=$selSql"; +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); +//echo "
      XXXXXXXXXXXXXXXX"; +$serverName = $selRow[0]; +//EIR CDRs are get from MSC device +if($sysId == 320 && $define == "eirCdrDefine") +{ + $sysId=380; + $serverName="EIR"; +} +//deal with special CNF +if ("CNF-Center" == $serverName){ + $serverName = "CNF"; +} +if($DEBUG) echo "serverName=$serverName
      "; +if($serverName == "IMDM") + $serverName="OPR"; +/********************* Get the server name end ****************************/ +?> + + + &&serverName=&&sysId=&&cdrType=" + style="border-bottom: 0 solid #000000" marginwidth="0" marginheight="0"> + &&sysId=&&cdrType=" scrolling="auto"> + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/account/cdrList/cdrUp.php b/wxc2_omc/account/cdrList/cdrUp.php new file mode 100755 index 0000000..b734630 --- /dev/null +++ b/wxc2_omc/account/cdrList/cdrUp.php @@ -0,0 +1,149 @@ +"; + +?> + +"; + +if(isset($sysId)){ + $sysIdArr=explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; +}else{ + echo "Cannot find sysId"; + exit(0); +} +//echo "helpId=$helpId, serverName=$serverName,sysId=$sysId
      "; +?> + + +
      &&sysId=&&cdrType=" name="selectform" onsubmit=""> + +"; +echo ""; +echo ""; + +/********************changed for SMLog by Cui Ticun start**************************/ + if(18==$cdrType) echo "$strLog > $serverName > $strSent "; + elseif(19==$cdrType) echo "$strLog > $serverName > $strDiscarded "; + elseif(20==$cdrType) echo "$strLog > $serverName > $strPending "; + elseif($serverName=="OPR") echo "$strLog > IMDM"; + else echo "$strLog > $serverName "; +/********************changed for SMLog by Cui Ticun end**************************/ + +echo ""; +echo ""; + + if($sysId != 330 && $sysId != 325 && $sysId != 351) + showHelp($helpId); + +echo ""; +echo ""; +echo ""; +echo ""; +switch($sysTypeNo){ + case '386': + echo "Node Name"; + echo " "; + break; + case '375': + echo "MSISDN"; + echo " "; + break; + case '380': + echo "  "; + //echo "IMSI"; + echo " "; + break; + case '270': //CNF + case '351': //SMLOG + case '360': //PPS + echo ""; + break; + case '320': //MSC + echo "  "; + + echo ""; + break; + case '325': //VLR + case '330': // HLR + echo "IMSI"; + echo " "; + break; + case '350': // SMSC + echo "MSISDN"; + echo " "; + break; + default: + break; +} +?> +    + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + +
      + diff --git a/wxc2_omc/account/cdrList/showSmscContent.php b/wxc2_omc/account/cdrList/showSmscContent.php new file mode 100755 index 0000000..88279ce --- /dev/null +++ b/wxc2_omc/account/cdrList/showSmscContent.php @@ -0,0 +1,176 @@ +>6); + $str .= $c; + } + else + */ + if ($c < 0x800) { + $str.=(0xC0 | $c>>6); + $str.=(0x80 | $c & 0x3F); + } + else if ($c < 0x10000) { + $str.=(0xE0 | $c>>12); + $str.=(0x80 | $c>>6 & 0x3F); + $str.=(0x80 | $c & 0x3F); + } + else if ($c < 0x200000) { + $str.=(0xF0 | $c>>18); + $str.=(0x80 | $c>>12 & 0x3F); + $str.=(0x80 | $c>>6 & 0x3F); + $str.=(0x80 | $c & 0x3F); + } + return $str; +} + +function chkDiffChr($inChr) +{ + switch($inChr) + { + case 2: + $outChr = 36;//'$' + break; + case 0: + $outChr = 64;//'@' + break; + case 17: + $outChr = 95;//'_' + break; +// case 47: +// $outChr = 92;//'/' +// break; + default: + return($inChr); + } + return($outChr); +} + +function decode7bitTo8bit($in_buffer) +{ + $DEBUG=0; + $out_buffer=""; + $len_of_data=strlen($in_buffer); + $in_buffer_len = ($len_of_data+1)*8/7; + if($DEBUG) echo "
      in_buffer_len=$in_buffer_len"; + for ($i=0; $i<$in_buffer_len; $i+=14) + { + $len_of_data=strlen($in_buffer); + $tmp7byte=substr($in_buffer,0,($len_of_data >= 14 ? 14 : $len_of_data)); + if($DEBUG) echo "
      tmp7byte=$tmp7byte"; + $out_buffer .= decode7byteTo8byte($tmp7byte); + if($DEBUG) echo "
      out_buffer=$out_buffer"; + $in_buffer=substr($in_buffer,14); + if($DEBUG) echo "
      in_buffer=$in_buffer,i=$i"; + } + return($out_buffer); +} + +function decode7byteTo8byte($Str) +{ + $DEBUG=0; + $len_of_data=strlen($Str); + $len_of_byte=0; + for ($i=0;$i<$len_of_data;$i+=2) + { + $in_buffer[$len_of_byte]=hexdec(substr($Str,$i,2)); + if($DEBUG) echo "
      in_buffer[$len_of_byte]={$in_buffer[$len_of_byte]}"; + $len_of_byte++; + } + $out_buffer=''; + for ($i=0;$i<$len_of_byte;$i++) + { + switch ($i) + { + case 0: + $out_buffer .= chr(chkDiffChr(($in_buffer[0]) & 0x7f)); + if($DEBUG) echo "
      outChar=$outChar out_buffer=$out_buffer"; + break; + case 1: + $out_buffer .= chr(chkDiffChr((($in_buffer[1] & 0x3f) << 1 ) | (($in_buffer[0] >> 7) & 0x01))); + if($DEBUG) echo "
      out_buffer=$out_buffer"; + break; + case 2: + $out_buffer .= chr(chkDiffChr((($in_buffer[2] & 0x1f) << 2 ) | (($in_buffer[1] >> 6) & 0x03))); + if($DEBUG) echo "
      out_buffer=$out_buffer"; + break; + case 3: + $out_buffer .= chr(chkDiffChr((($in_buffer[3] & 0x0f) << 3 ) | (($in_buffer[2] >> 5) & 0x07))); + if($DEBUG) echo "
      out_buffer=$out_buffer"; + break; + case 4: + $out_buffer .= chr(chkDiffChr((($in_buffer[4] & 0x07) << 4 ) | (($in_buffer[3] >> 4) & 0x0f))); + if($DEBUG) echo "
      out_buffer=$out_buffer"; + break; + case 5: + $out_buffer .= chr(chkDiffChr((($in_buffer[5] & 0x03) << 5 ) | (($in_buffer[4] >> 3) & 0x1f))); + if($DEBUG) echo "
      out_buffer=$out_buffer"; + break; + case 6: + $out_buffer .= chr(chkDiffChr((($in_buffer[6] & 0x01) << 6 ) | (($in_buffer[5] >> 2) & 0x3f))); + if($DEBUG) echo "
      out_buffer=$out_buffer"; + if ( $in_buffer[6] >> 1 ) + { + $out_buffer .= chr(chkDiffChr(($in_buffer[6] >> 1) & 0x7f)); + if($DEBUG) echo "
      out_buffer=$out_buffer"; + } + break; + default: + break; + } + } + return($out_buffer); +} + +function encodeUTF8($smsContent,$smsDCS) +{ + if(!trim($smsContent)) + return $smsContent; + //echo "smsDCS=$smsDCS"; + $encodeType=substr(decbin($smsDCS),-4,-2); + //echo "encodeType=$encodeType"; + switch($encodeType){ + case '00':$encodeStr=decode7bitTo8bit($smsContent); + case '0':$encodeStr=decode7bitTo8bit($smsContent); + case '':$encodeStr=decode7bitTo8bit($smsContent); + return($encodeStr); + case '01': + case '10': + $encodeStr=$smsContent; + break; + default: return(''); + } + + $utf8=""; + $rrr=""; + + while($encodeStr){ + $now=substr($encodeStr,0,4); + //echo "
      this=$this"; + $trr="&#x".$now.";"; + $rrr.=$trr; + $utf8.=u2utf8(hexdec($now)); + + $encodeStr=substr($encodeStr,4,strlen($encodeStr)); + + //echo "
      utf8-1=$utf8,encodeStr=$encodeStr"; + } + return $rrr; + /* + //echo "
      utf8=$utf8"; + $ret=""; + for($i=0;$i"; +//$UTF8Str=encodeUTF8($smsContent,$smsDCS); +//echo "$UTF8Str"; +?> \ No newline at end of file diff --git a/wxc2_omc/account/pps/cos.php b/wxc2_omc/account/pps/cos.php new file mode 100755 index 0000000..db2b5dc --- /dev/null +++ b/wxc2_omc/account/pps/cos.php @@ -0,0 +1,890 @@ + + + + + + + +



      "; + if(isset($setSys)){ + //send set command + $commIdStr = sysCommSend($sysId,$nSetComm,$currentCosObjIdstr); + $showType="Set"; + }elseif(isset($getSys)){ + $commIdStr = sysCommSend($sysId,$nGetComm,$currentCosObjIdstr); + $showType="Get"; + }elseif(isset($saveSys)){ + $updSql = " UPDATE $table_name SET initValue = '01' + WHERE level_1 = '2' AND level_2 = '1' AND level_3 = '6' AND level_4 = '2' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'2.1.6.2'); + $showType="Save parameter to system"; + }/*elseif(isset($resetSys)){ + $updSql = " UPDATE $table_name SET initValue = '01' + WHERE level_1 = '2' AND level_2 = '1' AND level_3 = '6' AND level_4 = '2' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'2.1.6.2'); + }*/ + + if($DEBUG) echo "
      commIdStr =$commIdStr"; + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "360_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + if(isset($getSys)){ + $moveSql = "UPDATE $table_name SET initValue = readValue + WHERE $objIdWhere + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + } +} + +if($setSys || $getSys || $saveSys ||$resetSys){ + echo "
      "; + echo "

      $strBack"; + exit(); +} +?> + +remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} +?> + + +

      "> +"; +echo ""; +echo ""; +echo "$strThisPage"; +echo ""; +echo ""; +$helpId="2.2.4"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +echo "System:  "; +echo ""; +echo ""; +echo "      Command:  "; +echo ""; + +echo ""; +echo ""; + +echo "COS ID"; +echo "    "; +$maxCosSql = " SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName = 'maxCOSNumber' "; +$maxCosRes = @mysqli_query($pubConn,$maxCosSql); +$maxCosRow = @mysqli_fetch_array($maxCosRes); +$maxCosNum = $maxCosRow[pubVarValue]; +echo ""; + +echo ""; +echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +//echo ""; +//echo ""; +?> + + + +"; +$tableHeaderNoBorder=""; + + +?> + + +"; +echo "\n $tableHeader"; + +echo "\n "; +echo ""; +echo ""; +echo ""; +echo "
      Title"; +$titleId=$objIdStr.'.'.$cos_id.'.10'; +showParameter($sysId,$titleId,1,3); +//echo "($sysId,$titleId,1,1)"; +echo "
      "; +?> + + +"; +echo "\n $tableHeader"; + +echo "\n "; +echo "Tariff"; +echo ""; + +echo ""; +echo ""; +echo "MO Tariff ID"; +echo ""; +echo ""; +$moTariffId=$objIdStr.'.'.$cos_id.'.2.1'; +showParameter($sysId,$moTariffId,1,1); +//echo "($sysId,$moTariffId,1,1)"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "MT Tariff ID"; +echo ""; +echo ""; +$moTariffId=$objIdStr.'.'.$cos_id.'.2.2'; +showParameter($sysId,$moTariffId,1,1); +//echo "($sysId,$moTariffId,1,1)"; +echo ""; +echo ""; +echo ""; +?> + + +
      "; +echo "\n $tableHeader"; + +echo "\n "; +echo "Tariff Subscription"; +echo ""; + +echo ""; +echo ""; +echo "Charge By"; +echo ""; +echo ""; +$tariffSubId=$objIdStr.'.'.$cos_id.'.2.3'; +showParameter($sysId,$tariffSubId,1,1); +//echo "($sysId,$tariffSubId,1,1)"; +echo ""; +echo ""; +echo ""; +?> + +
      "; +echo "\n $tableHeader"; + +echo "\n "; +echo "Service Control"; +//MO Call +echo ""; +echo "MO Call"; +echo ""; + echo "$tableHeaderNoBorder"; + echo ""; + echo "Set Threshold for MO Call"; + echo ""; + $minbalanceId=$objIdStr.'.'.$cos_id.'.3.1'; + showParameter($sysId,$minbalanceId,1,1); + //echo "($sysId,$minbalanceId,1,1)"; + echo ""; + echo ""; + + echo ""; + echo "Minimum Balance for MO"; + echo ""; + $minbalanceId=$objIdStr.'.'.$cos_id.'.3.1'; + showParameter($sysId,$minbalanceId,2,1); + //echo "($sysId,$minbalanceId,2,1)"; + echo "  (currency unit)"; + echo ""; + echo ""; + echo ""; +echo ""; +echo ""; + +//MT Call +echo ""; +echo "MT Call"; +echo ""; + echo "$tableHeaderNoBorder"; + echo ""; + echo "Charged Flag"; + echo ""; + $mtChargeId=$objIdStr.'.'.$cos_id.'.4.1'; + showParameter($sysId,$mtChargeId,1,1); + //echo "($sysId,$mtChargeId,1,1)"; + echo ""; + echo ""; + + echo ""; + echo "Balance Control"; + echo ""; + $mtZeroId=$objIdStr.'.'.$cos_id.'.4.2'; + showParameter($sysId,$mtZeroId,1,1); + //echo "($sysId,$mtZeroId,1,1)"; + echo ""; + echo ""; + + echo ""; + echo "Balance Threshold"; + echo ""; + $mtZeroId=$objIdStr.'.'.$cos_id.'.4.3'; + showParameter($sysId,$mtZeroId,1,1); + //echo "($sysId,$mtZeroId,1,1)"; + echo ""; + echo ""; + echo ""; +echo ""; + +//F&&F Number +echo ""; +echo "Friends & Family Number"; +echo ""; + echo "$tableHeaderNoBorder"; + + echo ""; + echo "Flag"; + echo ""; + $ffNumberId=$objIdStr.'.'.$cos_id.'.5.5'; + showParameter($sysId,$ffNumberId,2,1); + //echo "($sysId,$ffNumberId,2,1)"; + echo ""; + echo ""; + + echo ""; + echo "Charge Flag"; + echo ""; + showParameter($sysId,$ffNumberId,3,1); + //echo "($sysId,$ffNumberId,3,1)"; + echo ""; + echo ""; + + echo ""; + echo "Free Changes"; + echo ""; + showParameter($sysId,$ffNumberId,5,1); + //echo "($sysId,$ffNumberId,5,1)"; + echo "  (times)"; + echo ""; + echo ""; + echo ""; +echo ""; + +echo ""; +echo "Others"; +echo ""; + echo "$tableHeaderNoBorder"; + + echo ""; + echo "Close User Group Service"; + echo ""; + showParameter($sysId,$ffNumberId,1,1); + //echo "($sysId,$ffNumberId,1,1)"; + echo ""; + echo ""; + + echo ""; + echo "Recharge via Credit Card"; + echo ""; + $rechargeViaCardId=$objIdStr.'.'.$cos_id.'.5.6'; + showParameter($sysId,$rechargeViaCardId,1,1); + //echo "($sysId,$rechargeViaCardId,1,1)"; + echo ""; + echo ""; + + echo ""; + echo "Credit Vault"; + echo ""; + $creditVaultServiceId=$objIdStr.'.'.$cos_id.'.5.7'; + showParameter($sysId,$creditVaultServiceId,1,1); + //echo "($sysId,$creditVaultServiceId,1,1)"; + echo ""; + echo ""; + + echo ""; + echo "Credit Vault Amount"; + echo ""; + showParameter($sysId,$creditVaultServiceId,2,1); + //echo "($sysId,$creditVaultServiceId,2,1)"; + echo ""; + echo ""; + echo ""; +echo ""; +echo ""; +echo ""; + ?> + +
      "; +echo "\n $tableHeader"; + +echo "\n "; +echo "Account Validity"; +echo ""; +echo "Account Expiration"; +echo ""; + echo "$tableHeaderNoBorder"; + echo "Maximum account validity is"; + echo ""; + $maxvalidityId=$objIdStr.'.'.$cos_id.'.3.2'; + showParameter($sysId,$maxvalidityId,1,1); + //echo "($sysId,$maxvalidityId,1,1)"; + echo "  (days)."; + echo ""; + echo "When account expires"; + echo ""; + $clearBalanceId=$objIdStr.'.'.$cos_id.'.5.1'; + showParameter($sysId,$clearBalanceId,1,1); + //echo "($sysId,$clearBalanceId,1,1)"; + echo ""; + + //-- + echo "Expired when"; + echo ""; + showParameter($sysId,$clearBalanceId,3,1); + //echo "($sysId,$clearBalanceId,1,1)"; + echo ""; + //-- + + echo ""; + + echo ""; + echo "Keep an expired account for"; + echo ""; + $keepExpireDayId=$objIdStr.'.'.$cos_id.'.3.3'; + showParameter($sysId,$keepExpireDayId,1,1); + //echo "($sysId,$keepExpireDayId,1,1)"; + echo "  (days)."; + echo ""; + echo "After that"; + echo ""; + showParameter($sysId,$clearBalanceId,2,1); + //echo "($sysId,$clearBalanceId,2,1)"; + echo ""; + + //-- + echo ""; + echo "SMS Notification"; + echo ""; + showParameter($sysId,$clearBalanceId,4,1); + echo ""; + //-- + + echo ""; + echo ""; +echo ""; +echo ""; + +echo ""; +echo "Validity Adjustment"; +echo "" ; + echo "$tableHeaderNoBorder"; + echo ""; + echo "After recharge, account validity"; + echo ""; + $balanceAfRechargeId=$objIdStr.'.'.$cos_id.'.5.2'; + showParameter($sysId,$balanceAfRechargeId,1,1); + //echo "($sysId,$balanceAfRechargeId,1,1)"; + echo ""; + echo ""; + + echo ""; + echo "When balance is depleted, change account validity"; + echo ""; + $validityBalanceId=$objIdStr.'.'.$cos_id.'.5.3'; + showParameter($sysId,$validityBalanceId,1,1); + //echo "($sysId,$validityBalanceId,1,1)"; + echo ""; + echo "Change validity to"; + echo ""; + showParameter($sysId,$validityBalanceId,2,1); + //echo "($sysId,$validityBalanceId,2,1)"; + echo "  (days)"; + echo ""; + echo ""; + + echo ""; + echo "Activation by inquiring is"; + echo ""; + $activatedAccountValidityId=$objIdStr.'.'.$cos_id.'.5.4'; + showParameter($sysId,$activatedAccountValidityId,1,1); + //echo "($sysId,$activatedAccountValidityId,1,1)"; + echo ""; + echo "Validity of activated account with zero balance "; + echo ""; + showParameter($sysId,$activatedAccountValidityId,2,1); + //echo "($sysId,$activatedAccountValidityId,2,1)"; + echo ""; + echo ""; + echo ""; +echo ""; +echo ""; +echo ""; +?> + + +
      "; + +echo "\n $tableHeader"; +echo "\n "; +echo "Short Message Notification & Inquiry"; +echo ""; +echo "Short Message Notification"; +echo ""; + echo "$tableHeaderNoBorder"; + echo ""; + echo "Successful Recharge"; + echo ""; + $feedbackSMId=$objIdStr.'.'.$cos_id.'.6.1'; + showParameter($sysId,$feedbackSMId,1,1); + //echo "($sysId,$feedbackSMId,1,1)"; + echo ""; + + echo "CAP Plan about to change"; + echo ""; + showParameter($sysId,$feedbackSMId,3,1); + //echo "($sysId,$feedbackSMId,1,1)"; + echo ""; + + echo ""; + + echo ""; + echo "Account Inquiry"; + echo ""; + showParameter($sysId,$feedbackSMId,2,1); + //echo "($sysId,$feedbackSMId,2,1)"; + echo ""; + echo ""; + + echo ""; + echo "Expiration"; + echo ""; + $SMExpiryId=$objIdStr.'.'.$cos_id.'.6.3'; + showParameter($sysId,$SMExpiryId,1,1); + //echo "($sysId,$SMExpiryId,1,1)"; + echo ""; + showParameter($sysId,$SMExpiryId,2,1); + //echo "($sysId,$SMExpiryId,2,1)"; + echo "  (days) before expiration"; + echo ""; + echo ""; + + echo ""; + echo "Insufficient Balance"; + echo ""; + $SMLowBalanceId=$objIdStr.'.'.$cos_id.'.6.4'; + showParameter($sysId,$SMLowBalanceId,1,1); + //echo "($sysId,$SMLowBalanceId,1,1)"; + echo ""; + echo "When balance reaches    "; + echo ""; + echo ""; + showParameter($sysId,$SMLowBalanceId,2,1); + //echo "($sysId,$SMLowBalanceId,2,1)"; + echo "  (currency unit)"; + echo ""; + echo ""; + echo ""; +echo ""; +echo ""; + +echo ""; +echo "Inquiry by Short Message"; +echo ""; +echo "$tableHeaderNoBorder"; + echo ""; + echo "Charge"; + echo ""; + $InquirySMId=$objIdStr.'.'.$cos_id.'.6.2'; + showParameter($sysId,$InquirySMId,1,1); + //echo "($sysId,$InquirySMId,1,1)"; + echo ""; + echo ""; + echo ""; + + echo "Free Inquiry per Day"; + echo ""; + showParameter($sysId,$InquirySMId,2,1); + //echo "($sysId,$InquirySMId,2,1)"; + echo "  (times)"; + echo ""; + echo ""; + echo ""; +echo ""; +echo ""; +echo ""; +?> + +
      "; + +echo "\n $tableHeader"; +echo "\n "; +echo "Recharge Card Validity"; +$rechargeCardValidityId=$objIdStr.'.'.$cos_id.'.2.4'; +for($instanceNo=0;$instanceNo<4;$instanceNo++){ + echo ""; + echo "Recharge Card Type $instanceNo"; + echo ""; + echo "$tableHeaderNoBorder"; + echo ""; + echo "Card Credit"; + echo ""; + showParameter($sysId,$rechargeCardValidityId,1,1,$instanceNo); + //echo "($sysId,$rechargeCardValidityId,1,1,$instanceNo)"; + echo ""; + echo "MO Validity"; + echo ""; + showParameter($sysId,$rechargeCardValidityId,2,1,$instanceNo); + //echo "($sysId,$rechargeCardValidityId,2,1,$instanceNo)"; + echo ""; + echo "MT Validity"; + echo ""; + showParameter($sysId,$rechargeCardValidityId,3,1,$instanceNo); + //echo "($sysId,$rechargeCardValidityId,3,1,$instanceNo)"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +echo ""; +?> + +
      "; +echo "\n $tableHeader"; + +echo "\n "; +echo "Recharge Promotion"; +echo ""; +echo ""; +echo "$tableHeaderNoBorder"; + echo ""; + $startDateId=$objIdStr.'.'.$cos_id.'.1.1'; + echo "Start Date:20"; + showParameter($sysId, $startDateId,1,1); + //echo "($sysId, $startDateId,1,1)"; + echo "/"; + showParameter($sysId, $startDateId,2,1); + //echo "($sysId, $startDateId,2,1)"; + echo "/"; + showParameter($sysId, $startDateId,3,1); + //echo "($sysId, $startDateId,3,1)"; + echo ""; + + $endDateId=$objIdStr.'.'.$cos_id.'.1.2'; + echo "End Date:20"; + showParameter($sysId, $endDateId,1,1); + //echo "($sysId, $endDateId,1,1)"; + echo "/"; + showParameter($sysId, $endDateId,2,1); + //echo "($sysId, $endDateId,2,1)"; + echo "/"; + showParameter($sysId, $endDateId,3,1); + //echo "($sysId, $endDateId,3,1)"; + echo ""; + echo ""; + echo "" ; +echo ""; +echo ""; + +$promotionBonusId= $objIdStr.'.'.$cos_id.'.1.3'; +for($instanceNo=0;$instanceNo<4;$instanceNo++){ + echo ""; + echo "Promotion $instanceNo"; + echo ""; + echo "$tableHeaderNoBorder"; + echo ""; + echo "Recharge Card Credit"; + echo ""; + showParameter($sysId,$promotionBonusId,1,1,$instanceNo); + //echo "($sysId,$promotionBonusId,1,1,$instanceNo)"; + echo ""; + echo "Promotion Bonus"; + echo ""; + showParameter($sysId,$promotionBonusId,2,1,$instanceNo); + //echo "($sysId,$promotionBonusId,2,1,$instanceNo)"; + echo "Bonus Validity"; + echo ""; + showParameter($sysId,$promotionBonusId,3,1,$instanceNo); + //echo "($sysId,$promotionBonusId,3,1,$instanceNo)"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +echo ""; +?> + +
      "; +echo "\n $tableHeader"; + +echo "\n "; +echo "CAP Plan"; +echo ""; +echo ""; +echo "Reset Date:"; +$resetDayId=$promotionBonusId= $objIdStr.'.'.$cos_id.'.7.1'; +showParameter($sysId,$resetDayId,1,1); +//echo "($sysId,$resetDayId,1,1)"; +echo ""; +echo ""; + +for($i=0;$i<4;$i++){ + $capPlanId= $objIdStr.'.'.$cos_id.'.7.'.($i+2); + echo ""; + if($i % 2 == 0) + echo "CAP Plan $i (Home Network)"; + else + echo "CAP Plan $i (Other Network)"; + echo ""; + echo "$tableHeaderNoBorder"; + echo ""; + echo "Flag"; + echo ""; + showParameter($sysId,$capPlanId,1,1); + //echo "($sysId,$capPlanId,1,1)"; + echo ""; + + echo "Type"; + echo ""; + showParameter($sysId,$capPlanId,2,1); + //echo "($sysId,$capPlanId,2,1)"; + echo ""; + echo ""; + /* + echo ""; + echo "Type"; + echo ""; + showParameter($sysId,$capPlanId,2,1); + echo ""; + echo ""; + */ + echo ""; + echo "Threshold 0 "; + echo ""; + showParameter($sysId,$capPlanId,3,1); + //echo "($sysId,$capPlanId,3,1)"; + echo ""; + echo "Threshold 1 "; + echo ""; + showParameter($sysId,$capPlanId,4,1); + //echo "($sysId,$capPlanId,4,1)"; + echo ""; + echo "Threshold 2 "; + echo ""; + showParameter($sysId,$capPlanId,5,1); + //echo "($sysId,$capPlanId,5,1)"; + echo ""; + + echo ""; + + + echo ""; + echo "Tariff ID 0 "; + echo ""; + showParameter($sysId,$capPlanId,6,1); + //echo "($sysId,$capPlanId,6,1)"; + echo ""; + echo "Tariff ID 1 "; + echo ""; + showParameter($sysId,$capPlanId,7,1); + //echo "($sysId,$capPlanId,7,1)"; + echo ""; + echo "Tariff ID 2 "; + echo ""; + showParameter($sysId,$capPlanId,8,1); + //echo "($sysId,$capPlanId,8,1)"; + echo "Tariff ID 3 "; + echo ""; + showParameter($sysId,$capPlanId,9,1); + //echo "($sysId,$capPlanId,9,1)"; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; +} + +?> + + + + diff --git a/wxc2_omc/account/ppsRecover/recoverIndex.php b/wxc2_omc/account/ppsRecover/recoverIndex.php new file mode 100755 index 0000000..b42863b --- /dev/null +++ b/wxc2_omc/account/ppsRecover/recoverIndex.php @@ -0,0 +1,208 @@ + + +

      "; + +/* +//没有纪录时,显示无记录提示 + if(!$rows){ + echo "$strNotFindRecord"; + exit(); + } + */ +?> +
      + +"; + echo ""; + echo ""; + echo ""; + echo ""; + + $arr_editfieldAmount = array("Start time","End time","First 6 digits of 12-digit recharge card","First 8 digits of 16-digit recharge card","Country code","Natinal destination code","IP address","Progress"); + $arr_remark = array("2003-06-30","2003-06-30 10:25:30","229000","22900001","86","755","172.18.98.1"); + $startTime = $rows[start_time]; + $endTime = $rows[end_time]; + $digital_6 = $rows[digital_6]; + $digital_8 = $rows[digital_8]; + $cc = $rows[cc]; + $ndc = $rows[ndc]; + $ip_address = $rows[ip_address]; + { + echo ""; + echo ""; + echo ""; + echo ""; + } + + { + echo ""; + echo ""; + echo ""; + echo ""; + } + + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + $progress++; + echo ""; + echo ""; + echo ""; + echo ""; + } +/* + +*/ +?> +
      ItemValueExample
      $arr_editfieldAmount[0]"; + echo ""; + echo "$arr_remark[0]
      $arr_editfieldAmount[1]"; + echo ""; + echo "$arr_remark[1]
      $arr_editfieldAmount[2]"; + echo ""; + echo "$arr_remark[2]
      $arr_editfieldAmount[3]"; + echo ""; + echo "$arr_remark[3]
      $arr_editfieldAmount[4]"; + echo ""; + echo "$arr_remark[4]
      $arr_editfieldAmount[5]"; + echo ""; + echo "$arr_remark[5]
      $arr_editfieldAmount[6]"; + echo ""; + echo "$arr_remark[6]
      $arr_editfieldAmount[7]"; + echo "$remark "; + echo "

      +   +
      + +Remarks:

      +This facility is used to recover PPS account balance of abnormal shutdown time. The PPS saves memory data to harddisk at 4:00 am every day. When abnormal shutdown occurs, the PPS account balance data of the current day will be lost without being saved in harddisk. This facility helps recover the account balance by debiting all PPS account according to the CDR of the current day.
      +Start time: The date when abnormal shutdown occurs.
      +End time: The time at which abnormal shutdown occurs.
      +IP address: IP address of either PPS 0 (172.18.98.1) or PPS 1 (172.18.99.1).
      +To recover PPS account balance, fill in the above forms, click on Recover button and run a script cdrRestore under the path /usr/local/omc/tools/ in the OMC. + diff --git a/wxc2_omc/account/ppsRecover/recoverIndex.php.bak b/wxc2_omc/account/ppsRecover/recoverIndex.php.bak new file mode 100755 index 0000000..b42863b --- /dev/null +++ b/wxc2_omc/account/ppsRecover/recoverIndex.php.bak @@ -0,0 +1,208 @@ + + +

      "; + +/* +//没有纪录时,显示无记录提示 + if(!$rows){ + echo "$strNotFindRecord"; + exit(); + } + */ +?> +
      + +"; + echo ""; + echo ""; + echo ""; + echo ""; + + $arr_editfieldAmount = array("Start time","End time","First 6 digits of 12-digit recharge card","First 8 digits of 16-digit recharge card","Country code","Natinal destination code","IP address","Progress"); + $arr_remark = array("2003-06-30","2003-06-30 10:25:30","229000","22900001","86","755","172.18.98.1"); + $startTime = $rows[start_time]; + $endTime = $rows[end_time]; + $digital_6 = $rows[digital_6]; + $digital_8 = $rows[digital_8]; + $cc = $rows[cc]; + $ndc = $rows[ndc]; + $ip_address = $rows[ip_address]; + { + echo ""; + echo ""; + echo ""; + echo ""; + } + + { + echo ""; + echo ""; + echo ""; + echo ""; + } + + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + echo ""; + echo ""; + echo ""; + echo ""; + } + { + $progress++; + echo ""; + echo ""; + echo ""; + echo ""; + } +/* + +*/ +?> +
      ItemValueExample
      $arr_editfieldAmount[0]"; + echo ""; + echo "$arr_remark[0]
      $arr_editfieldAmount[1]"; + echo ""; + echo "$arr_remark[1]
      $arr_editfieldAmount[2]"; + echo ""; + echo "$arr_remark[2]
      $arr_editfieldAmount[3]"; + echo ""; + echo "$arr_remark[3]
      $arr_editfieldAmount[4]"; + echo ""; + echo "$arr_remark[4]
      $arr_editfieldAmount[5]"; + echo ""; + echo "$arr_remark[5]
      $arr_editfieldAmount[6]"; + echo ""; + echo "$arr_remark[6]
      $arr_editfieldAmount[7]"; + echo "$remark "; + echo "

      +   +
      + +Remarks:

      +This facility is used to recover PPS account balance of abnormal shutdown time. The PPS saves memory data to harddisk at 4:00 am every day. When abnormal shutdown occurs, the PPS account balance data of the current day will be lost without being saved in harddisk. This facility helps recover the account balance by debiting all PPS account according to the CDR of the current day.
      +Start time: The date when abnormal shutdown occurs.
      +End time: The time at which abnormal shutdown occurs.
      +IP address: IP address of either PPS 0 (172.18.98.1) or PPS 1 (172.18.99.1).
      +To recover PPS account balance, fill in the above forms, click on Recover button and run a script cdrRestore under the path /usr/local/omc/tools/ in the OMC. + diff --git a/wxc2_omc/account/prepaidCardMng/paramEdit.php b/wxc2_omc/account/prepaidCardMng/paramEdit.php new file mode 100755 index 0000000..7845189 --- /dev/null +++ b/wxc2_omc/account/prepaidCardMng/paramEdit.php @@ -0,0 +1,168 @@ + + +insertSql=$insertSql"; + $insertRes=mysqli_query($pubConn,$insertSql); + if($insertRes){ + echo "
      Edit success"; + $log_name = "Edit Succss".$user_info["account"]; + insertLog("$log_name"); + } + else{ + echo "
      Edit Failure"; + $log_name = "Edit Failure".$user_info["account"]; + insertLog("$log_name"); + } +} + + $sql = " SELECT * + FROM $table_name + "; + //echo "
      sql=$sql"; + $res = mysqli_query($pubConn,$sql); + $row = mysqli_fetch_array($res); + +?> + + +
      method="POST"> + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + +
      + + + " maxlength="5" size="5"> +
      + + + " maxlength="5" size="5"> +
      + + + " maxlength="5" size="5"> +
      + + + " maxlength="5" size="5"> +
      + + + +
      + " tabindex="1">   +    +
      + + diff --git a/wxc2_omc/account/prepaidCardMng/paramList.php b/wxc2_omc/account/prepaidCardMng/paramList.php new file mode 100755 index 0000000..692e38c --- /dev/null +++ b/wxc2_omc/account/prepaidCardMng/paramList.php @@ -0,0 +1,100 @@ +sql=$sql"; + $res = @mysqli_query($pubConn,$sql); + + if(mysqli_num_rows($res) > 0){ + $row = @mysqli_fetch_array($res); + //$varInfoArr=array(name,value,remark); + $varInfoArr[name]=$pubVarName; + $varInfoArr[value]=$row[pubVarValue]; + $varInfoArr[remark]=$row[remark]; + return($varInfoArr); + }else{ + return(-1); + } +} + +//===================================== +//输入变量 +//===================================== +//保存修改的参数 +if(strlen($actMode) > 1){ + for($i=0;$i====================="; + if($DEBUG) echo "
      name=$name"; + if($DEBUG) echo "
      value=$value"; + if($DEBUG) echo "
      remark=$remark"; + $sql = " UPDATE $tableName SET + pubVarValue='$value', + remark='$remark' + WHERE pubVarName='$name' + "; + if($DEBUG) echo "
      sql=$sql"; + $res = @mysqli_query($pubConn,$sql); + } +} + +?> + +
      "> + +"; + +for($i=0;$i"; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
      "; +echo "Public Var Define"; +echo "
       {$varInfoArr[name]} "; + echo ""; + echo " "; + echo "
      +
           + +     + +
      + + \ No newline at end of file diff --git a/wxc2_omc/account/prepaidCardMng/usedCardListDown.php b/wxc2_omc/account/prepaidCardMng/usedCardListDown.php new file mode 100755 index 0000000..340098d --- /dev/null +++ b/wxc2_omc/account/prepaidCardMng/usedCardListDown.php @@ -0,0 +1,226 @@ + + + +"; + +$DEBUG=0; +$helpId="6.4.2"; +if($sysTypeNo == 360) +{ + $db='PPS_DB'; + $table_name="used_card_info"; //查询的表名 +} +else +{ + $db='RCM_RC_DB'; + $table_name="used_card_info"; //查询的表名 +} + +//$card_num_len 电话号码长度 +$cardStatDef=array( + array(value =>'0',remark =>'Not Used'), + array(value =>'1',remark =>'Used') +); +if($DEBUG) echo "sort_field=$sort_field
      "; +if(!$sort_field ){ + $sort_field='card_no'; //排序所依赖的字段名 +} +if(!$sort_direction){ + $sort_direction= 'ASC '; //排序顺序 +} +$number_records_to_display = 100; //每页纪录数 +$moneyPara = getMoneyPara(); //显示的货币单位是最小货币单位的倍数 +if ($DEBUG)echo "selKeyFieldName=$selKeyFieldName
      "; +if ($DEBUG)echo "initial_record=$initial_record,number_records_to_display=$number_records_to_display"; +if ($selKeyValue <> '') + $where=" where card_status=1 AND $selKeyFieldName like '%$selKeyValue%'"; +else + $where=" where card_status=1"; +?> + + + +$strNotFindRecord!"; + echo "No record.
      "; + exit(); + } +} + +if($number_of_records >= 1) { + //下面是控制分页显示,传递变量 + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records){ + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0) { + $prev_index = 0; + } +} +$show_initial_record=$initial_record+1; +$sql = "SELECT * FROM $table_name $where ORDER BY $sort_field + LIMIT $initial_record,$number_records_to_display"; +if($DEBUG)echo "
      sql=$sql
      "; +$result = mysqli_query($pubConn,$sql); +echo mysqli_error($pubConn); +?> + + +
      + + + + + + +
       $show_initial_record - $next_index, ($strTotal:$number_of_records)";?>  + "; + echo "\"$strPreviousPage\" "; + } + + // NEW: Display a link for the next set of records. + if ($next_index != $number_of_records && $number_of_records >0) { + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&sort_field=$sort_field"; + $t2 = "bgn_num=$bgn_num&end_num=$end_num"; + echo ""; + echo "\" "; + } + if($DEBUG) echo "number_of_records=$number_of_records"; + if($number_of_records > 0){ + $this_page = $initial_record / $number_records_to_display + 1; + $all_page = ceil($number_of_records / $number_records_to_display ); + + /* $all_page = round($number_of_records / $number_records_to_display ); + if($number_of_records % $number_records_to_display > 0){ + $all_page = $all_page + 1; + } +*/ + } + if($DEBUG) echo "
      all_page=$all_page"; + ?> +
      + +
      + + + + + + + + + + + + "; + echo ""; + echo ""; + + $rows[face_value]=$rows[face_value];//$moneyPara; + echo ""; + + //$year =substr($rows[expiry_date],0,4); + //$mon =substr($rows[expiry_date],4,2); + //$day =substr($rows[expiry_date],6,2); + //$expiry_date=$year."-".$mon."-".$day; + echo ""; + + //$year =substr($rows[updated_date],0,4); + //$mon =substr($rows[updated_date],4,2); + //$day =substr($rows[updated_date],6,2); + //$updated_date=$year."-".$mon."-".$day; + echo ""; + + if(!$rows[msisdn_used]){ + $msisden_used = '----'; + }else{ + $msisden_used = $rows[msisdn_used]; + } + echo ""; + } + echo ""; + echo ""; + echo ""; + ?> +
      Card no."; ?>Status"; ?>Face value"; ?> Expriation date"; ?>Updated time"; ?>Recharged number"; ?>
      $rows[card_no]"; + for($i=0;$i < sizeof($cardStatDef);$i++){ + if($rows[card_status] == $cardStatDef[$i][value]){ + echo "{$cardStatDef[$i][remark]}"; + break; + } + } + echo "$rows[face_value]$rows[expiry_date]$rows[updated_date]$msisden_used
      + +
      + \ No newline at end of file diff --git a/wxc2_omc/account/prepaidCardMng/usedCardListIndex.php b/wxc2_omc/account/prepaidCardMng/usedCardListIndex.php new file mode 100755 index 0000000..828805d --- /dev/null +++ b/wxc2_omc/account/prepaidCardMng/usedCardListIndex.php @@ -0,0 +1,19 @@ + + + + "; + echo ""; + ?> + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/account/prepaidCardMng/usedCardListUp.php b/wxc2_omc/account/prepaidCardMng/usedCardListUp.php new file mode 100755 index 0000000..1b0781f --- /dev/null +++ b/wxc2_omc/account/prepaidCardMng/usedCardListUp.php @@ -0,0 +1,86 @@ + + + + + +
      + +"; + echo ""; + echo ""; + echo "Log > Used recharge card"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; +?> +   + + +   + + + + + +"; + echo " "; + + echo ""; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +?> + + + + +
      + + diff --git a/wxc2_omc/account/priSubsMng/aucSubsConf.php b/wxc2_omc/account/priSubsMng/aucSubsConf.php new file mode 100755 index 0000000..ca2105a --- /dev/null +++ b/wxc2_omc/account/priSubsMng/aucSubsConf.php @@ -0,0 +1,466 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$canwrite_flag=checkWritePrivilege(); +$pubDb = 'OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + + +//select sum(balance) from user_info +//========================================================== +//输入变量 +//========================================================== +$canSetNum=$_REQUEST['canSetNum']; +$keyValue=$_REQUEST['keyValue']; +$subSysNo=$_REQUEST['subSysNo']; +$dataTypeNo=$_REQUEST['dataTypeNo']; +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +if ($_REQUEST['sysId']) +{ + $sysId = $_REQUEST['sysId']; + if($DEBUG) echo "
      sysId=$sysId"; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + // echo "sysTypeNo=$sysTypeNo,sysNo=$sysNo"; +} +$canSetNum = isset($canSetNum)?$canSetNum:'all'; + +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +$isLoadIndex=$_REQUEST['isLoadIndex']; +$isTryCreate=$_REQUEST['isTryCreate']; +$isBatchCreate=$_REQUEST['isBatchCreate']; +$isCreate=$_REQUEST['isCreate']; +$isDelete=$_REQUEST['isDelete']; +$isChange=$_REQUEST['isChange']; +$isRead=$_REQUEST['isRead']; +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +//保存用户数据修改的数据 +$bgnNo=$_POST['bgnNo']; +$endNo=$_POST['endNo']; +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'key_imsi', 'inputName'=>'key_imsi'), + array('fieldName'=>'a3a8_version', 'inputName'=>'a3a8Version'), + array('fieldName'=>'status', 'inputName'=>'status') +); + +//For operation log use +{ + for($i=0;$i<256;$i++) + { + $key=strtoupper(dechex($i)); + if($i < 16) + $key="0".$key; + $a3a8_version_def[$key]="$i"; + } + + $status_def=array( + "00"=>"Inactive","0"=>"Active", + "01"=>"Inactive","1"=>"Active" + ); +} + + + +$logFieldDef=array( + 'a3a8_version', + 'status', +); + + + + +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //system("echo '-------------------------------------'>>/tmp/test.txt"); + $preValueInfo="Change $pre_keyvalue "; + $isChangeFlag=0; + for($i=0;$i> /tmp/test.txt"); + if(isset($$ddName)) + { + $tmpv=$$ppName; + $val1=${$$ddName}[$tmpv]; + $val2=${$$ddName}[$inputValue]; + if(strlen($$ppName) == 0) + $val1="NoValue"; + //system("echo 'val1=$val1,val2=$val2,tmpv=$tmpv' >>/tmp/test.txt"); + if(strcasecmp($val1,$val2) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$val1}->{$val2}]"; + //system("echo 'c[{$$nnName},{$val1}->{$val2}]' >>/tmp/test.txt"); + } + } + else if(isset($$cdName)) + { + $newValue=""; + for($iii=0;$iii({$newValue})]' >>/tmp/test.txt"); + } + } + else + { + if(strlen($$ppName) == 0) + $$ppName="NoValue"; + if(strcasecmp($$ppName,$inputValue) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$$ppName}->$inputValue]"; + //system("echo 'b[{$$nnName},{$$ppName}->$inputValue]'>>/tmp/test.txt"); + } + } + }else{ + //echo "
      Can not find $inputName's value"; + } + } + if($isChangeFlag==1) + { + $preValueInfo.=" in {$log_sysTypeName}_{$log_sysNo}_{$log_subSysNo}"; + insertLog($preValueInfo); + } +} + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + } +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "key_imsi,a3a8_version,status"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +?> + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + +
      " > + + + + + + 0){ + ?> + + + + + + + + + + + +
      + + + + + +       + + " name="create" title="" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + +     + + + + + + + "; + else + echo ""; + ?> + + + + + "; + else + echo ""; + ?> + +  
      +
      + + + + + + + + + 0){ + //key_imsi + $key_imsi=$tmpRow[key_imsi]; + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; + + +//a3a8_version +$a3a8_version =$tmpRow[a3a8_version];//hex有大小写的区别,故转成dec +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//status +$status=$tmpRow[status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> +
      No.NameValueDescription
      $seqNo IMSI"; + echo ""; + echo "IMSI=MCC+MNC+MSIN
      $seqNo A3A8 version"; +echo ""; +echo "Version of A3/A8 algorithm being used: COMP128-V1, V2 and V3
      1=version 1, 2=version 2, 3=version 3, 255=pseudo authentication, else (0, 4-254) reserved
      $seqNo Service status"; +if($status > 0){ + echo " Inactive     "; + echo " Active"; +}else{ + echo "Inactive     "; + echo "Active"; +} +echo "Inactive=Waiting for authentication. Active=Authentication is successful
      +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/aucSubsConfig b/wxc2_omc/account/priSubsMng/aucSubsConfig new file mode 100755 index 0000000..2c06630 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/aucSubsConfig @@ -0,0 +1,275 @@ +[para]0[Name]IMSI +[sqlName]key_imsi[t]input[unit]IMSI[u]00.0-07.7[u] +[v]keepAsc-low-E +[remark] +IMSI=MCC+MNC+MSIN +MCC=mobile country code, MNC=mobile network code, MSIN=mobile subscriber identity number. + +[para]1[Name]A3A8 version +[sqlName]a3a8_version[t]select[unit]A3A8 version[u]00.0-00.7[u] +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[v]64[opt]64 +[v]65[opt]65 +[v]66[opt]66 +[v]67[opt]67 +[v]68[opt]68 +[v]69[opt]69 +[v]70[opt]70 +[v]71[opt]71 +[v]72[opt]72 +[v]73[opt]73 +[v]74[opt]74 +[v]75[opt]75 +[v]76[opt]76 +[v]77[opt]77 +[v]78[opt]78 +[v]79[opt]79 +[v]80[opt]80 +[v]81[opt]81 +[v]82[opt]82 +[v]83[opt]83 +[v]84[opt]84 +[v]85[opt]85 +[v]86[opt]86 +[v]87[opt]87 +[v]88[opt]88 +[v]89[opt]89 +[v]90[opt]90 +[v]91[opt]91 +[v]92[opt]92 +[v]93[opt]93 +[v]94[opt]94 +[v]95[opt]95 +[v]96[opt]96 +[v]97[opt]97 +[v]98[opt]98 +[v]99[opt]99 +[v]100[opt]100 +[v]101[opt]101 +[v]102[opt]102 +[v]103[opt]103 +[v]104[opt]104 +[v]105[opt]105 +[v]106[opt]106 +[v]107[opt]107 +[v]108[opt]108 +[v]109[opt]109 +[v]110[opt]110 +[v]111[opt]111 +[v]112[opt]112 +[v]113[opt]113 +[v]114[opt]114 +[v]115[opt]115 +[v]116[opt]116 +[v]117[opt]117 +[v]118[opt]118 +[v]119[opt]119 +[v]120[opt]120 +[v]121[opt]121 +[v]122[opt]122 +[v]123[opt]123 +[v]124[opt]124 +[v]125[opt]125 +[v]126[opt]126 +[v]127[opt]127 +[v]128[opt]128 +[v]129[opt]129 +[v]130[opt]130 +[v]131[opt]131 +[v]132[opt]132 +[v]133[opt]133 +[v]134[opt]134 +[v]135[opt]135 +[v]136[opt]136 +[v]137[opt]137 +[v]138[opt]138 +[v]139[opt]139 +[v]140[opt]140 +[v]141[opt]141 +[v]142[opt]142 +[v]143[opt]143 +[v]144[opt]144 +[v]145[opt]145 +[v]146[opt]146 +[v]147[opt]147 +[v]148[opt]148 +[v]149[opt]149 +[v]150[opt]150 +[v]151[opt]151 +[v]152[opt]152 +[v]153[opt]153 +[v]154[opt]154 +[v]155[opt]155 +[v]156[opt]156 +[v]157[opt]157 +[v]158[opt]158 +[v]159[opt]159 +[v]160[opt]160 +[v]161[opt]161 +[v]162[opt]162 +[v]163[opt]163 +[v]164[opt]164 +[v]165[opt]165 +[v]166[opt]166 +[v]167[opt]167 +[v]168[opt]168 +[v]169[opt]169 +[v]170[opt]170 +[v]171[opt]171 +[v]172[opt]172 +[v]173[opt]173 +[v]174[opt]174 +[v]175[opt]175 +[v]176[opt]176 +[v]177[opt]177 +[v]178[opt]178 +[v]179[opt]179 +[v]180[opt]180 +[v]181[opt]181 +[v]182[opt]182 +[v]183[opt]183 +[v]184[opt]184 +[v]185[opt]185 +[v]186[opt]186 +[v]187[opt]187 +[v]188[opt]188 +[v]189[opt]189 +[v]190[opt]190 +[v]191[opt]191 +[v]192[opt]192 +[v]193[opt]193 +[v]194[opt]194 +[v]195[opt]195 +[v]196[opt]196 +[v]197[opt]197 +[v]198[opt]198 +[v]199[opt]199 +[v]200[opt]200 +[v]201[opt]201 +[v]202[opt]202 +[v]203[opt]203 +[v]204[opt]204 +[v]205[opt]205 +[v]206[opt]206 +[v]207[opt]207 +[v]208[opt]208 +[v]209[opt]209 +[v]210[opt]210 +[v]211[opt]211 +[v]212[opt]212 +[v]213[opt]213 +[v]214[opt]214 +[v]215[opt]215 +[v]216[opt]216 +[v]217[opt]217 +[v]218[opt]218 +[v]219[opt]219 +[v]220[opt]220 +[v]221[opt]221 +[v]222[opt]222 +[v]223[opt]223 +[v]224[opt]224 +[v]225[opt]225 +[v]226[opt]226 +[v]227[opt]227 +[v]228[opt]228 +[v]229[opt]229 +[v]230[opt]230 +[v]231[opt]231 +[v]232[opt]232 +[v]233[opt]233 +[v]234[opt]234 +[v]235[opt]235 +[v]236[opt]236 +[v]237[opt]237 +[v]238[opt]238 +[v]239[opt]239 +[v]240[opt]240 +[v]241[opt]241 +[v]242[opt]242 +[v]243[opt]243 +[v]244[opt]244 +[v]245[opt]245 +[v]246[opt]246 +[v]247[opt]247 +[v]248[opt]248 +[v]249[opt]249 +[v]250[opt]250 +[v]251[opt]251 +[v]252[opt]252 +[v]253[opt]253 +[v]254[opt]254 +[v]255[opt]255 +[remark] +Version of A3/A8 algorithm being used: COMP128-V1, V2 and V3 +1=version 1, 2=version 2, 3=version 3, 255=pseudo authentication, else (0, 4-254) reserved + +[para]2[Name]Service status +[sqlName]status[t]radio[unit]Service status[u]00.0-00.7[u] +[v]0[opt]Inactive +[v]1[opt]Active +[remark] +Inactive=Waiting for authentication. Active=Authentication is successful \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/commDown.php b/wxc2_omc/account/priSubsMng/commDown.php new file mode 100755 index 0000000..0d726d5 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/commDown.php @@ -0,0 +1,426 @@ +"; +if($DEBUG) echo "
      正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$dbName = 'OMC_PUB'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; +$numberPerPage = 100; //每页纪录数 + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +//确定告警内容显示语言种类 +if($selectedLanguage=='chn'){ + $alarmDesc = alarmDesc_1; +}elseif($selectedLanguage=='eng'){ + $alarmDesc = alarmDesc_2; +} + +//========================================================== +//输入变量 +//========================================================== +//列表所需基本变量 +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; + +//删除用户 +if($DEBUG) echo "
      commType =$commType"; + +//根据sysTypeNo,dataTypeNo获取数据表名,索引字段名 +if($sysTypeNo==390){ + if(!isset($sysNo)){ + if(!isset($sysId)) + $sysId='390_0_0'; + $sysIdArr=explode('_',$sysId); + $sysNo=$sysIdArr[1]; + } + $getConfSql="SELECT indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' + AND dataTypeNo='$dataTypeNo' + AND sysNo='$sysNo' + "; +}else{ + $getConfSql="SELECT indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' + AND dataTypeNo='$dataTypeNo' + "; +} + +if($DEBUG) echo "
      getConfSql=$getConfSql"; +$getConfResult=mysqli_query($pubConn,$getConfSql); +echo mysqli_error($pubConn); +$getConfRows=mysqli_fetch_array($getConfResult); +$tableName =$getConfRows[subsDataTable]; +$keyFieldName =$getConfRows[indexFieldName]; + +if($DEBUG) echo "
      tableName=$tableName"; +if($DEBUG) echo "
      keyFieldName=$keyFieldName"; + +//排序所依赖的字段名 +if(!isset($orderByField)){ + $orderByField = $keyFieldName; +} +if($DEBUG) echo "
      orderByField=$orderByField"; + +//排序字符串 +$orderByStr = " $orderByField"; +if($DEBUG) echo "
      orderByStr=$orderByStr"; + +//========================================================== +//数据处理 +//========================================================== +//删除命令,且该命令被执行 +if($commType == $nDeleteComm ){ + $delSql="Delete FROM $tableName WHERE $keyFieldName='$keyValue'"; + if($DEBUG) echo "
      delSql=$delSql"; + $result=mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + if($result){ + echo "
      Delete $keyValue OK!"; + } +} +switch($sysTypeNo){ + case '330': + if(!isset($sysId)){ + $sysId='330_0_0'; + } + $sysTypeName='HLR'; + $canSetNum='all'; + $selectFieldList = "imsi,inter_msisdn,used_flag,nam,camel_flag"; + $showNameList="IMSI,MSISDN,usedFlag,NetworkAccessMode,CamelFlag"; + break; + case '325': + if(!isset($sysId)){ + $sysId='325_0_0'; + } + $sysTypeName='VLR'; + $canSetNum='all'; + $selectFieldList = "IMSI,MSISDN,TMSI,LMSI"; + $showNameList = "IMSI,MSISDN,TMSI,LMSI"; + break; + case '360': + if($dataTypeNo == 0){ + $sysTypeName='PPS'; + $canSetNum='all'; + $selectFieldList = "msisdn,status,balance,mo_expiration_date,mt_expiration_date,cug_id,access_date"; + $showNameList= "MSISDN,Status,Balance,Expiration(MO),Expiration(MT),CUG,Active since"; +// $selectFieldList = "msisdn,overdraft,status,balance,expiration_date,first_used_date,user_type"; +// $showNameList= "MSISDN,Overdraft,Status,Balance,Expiration Date,First used Date,User Type"; + }else{ + $sysTypeName='Prepaid Card'; + $canSetNum='all'; + $selectFieldList ="card_no,card_hrn,face_value,card_status,expiry_date,valid_time,updated_date"; + $showNameList="Card No,Card_hrn,Face Value,Status,Expiry Date,Valid Time,Updated Date"; + } + if(!isset($sysId)){ + $sysId='360_0_0'; + } + break; + case '395': + if($dataTypeNo == 0){ + $sysTypeName='RCM'; + $canSetNum='all'; + $selectFieldList = "msisdn,status,balance,mo_expiration_date,mt_expiration_date,cug_id,access_date"; + $showNameList= "MSISDN,Status,Balance,Expiration(MO),Expiration(MT),CUG,Active since"; +// $selectFieldList = "msisdn,overdraft,status,balance,expiration_date,first_used_date,user_type"; +// $showNameList= "MSISDN,Overdraft,Status,Balance,Expiration Date,First used Date,User Type"; + }else{ + $sysTypeName='Prepaid Card'; + $canSetNum='all'; + $selectFieldList ="card_no,card_hrn,face_value,card_status,expiry_date,valid_time,updated_date"; + $showNameList="Card No,Card_hrn,Face Value,Status,Expiry Date,Valid Time,Updated Date"; + } + if(!isset($sysId)){ + $sysId='395_0_0'; + } + break; + case '340': + if(!isset($sysId)){ + $sysId='340_0_0'; + } + $sysTypeName='AUC'; + $canSetNum='all'; + $selectFieldList = "key_imsi,a3a8_version,status"; + $showNameList = "IMSI,A3A8 version,status"; + break; + case '370': + if(!isset($sysId)){ + $sysId='370_0_0'; + } + $sysTypeName='MNP'; + $canSetNum='all'; + $selectFieldList = "msisdn,routing_number,status,donor,recipient,date"; + $showNameList = "MSISDN,RN,status,Donor,Recipient,Date"; + break; + break; + case '375': + if(!isset($sysId)){ + + $sysId='375_0_0'; + } + $sysTypeName='OPPS'; + $canSetNum='all'; + $selectFieldList = "msisdn,imsi,imei,oprFlag,class,userType"; + $showNameList = "MSISDN,IMSI,IMEI,User Status,Class,User Type"; + break; + break; + case '378': + if(!isset($sysId)){ + $sysId='378_0_0'; + } + $sysTypeName='iPALIM'; + $canSetNum='all'; + $selectFieldList = "imsi,msisdn,msisdn_extern,tmsi,lai,type"; + $showNameList = "IMSI,MSISDN Public,MSISDN Private,TMSI,MCC-MNC-LAC-CI,Type"; + break; + case '380': + if(!isset($sysId)){ + $sysId='380_0_0'; + } + $sysTypeName='EIR'; + $canSetNum='all'; + $selectFieldList = "imei,status"; + $showNameList= "IMEI,Status"; + break; + case '390': + if(!isset($sysId)){ + $sysId='390_0_0'; + } + $sysTypeName='VMS'; + $canSetNum='all'; + $selectFieldList = "msisdn,mailboxID,promo_Language,greeting"; + $showNameList= "MSISDN,Enable,Mailbox No,Language,GreetingFlag"; + break; + case '253': + if(!isset($sysId)){ + $sysId='253_0_0'; + } + $sysTypeName='SN-HLR'; + $canSetNum='all'; + $selectFieldList = "imsi,msisdn,used_flag,lac"; + $showNameList= "imsi,msisdn,used_flag,lac"; + break; + default: + echo "Uaaaknown sysTypeNo"; + exit(1); +} +$showFieldArr=explode(',',$selectFieldList); +$showNameArr=explode(',',$showNameList); + +//根据上部页面传来的变量,生成查询条件 +if(strlen($selKeyFieldName) > 0 && strlen($selKeyValue) > 0){ + $whereStr = "WHERE $selKeyFieldName like '%$selKeyValue%'"; +} + +//查询基本条件 +if(strlen($whereStr) > 10){ + $bascWhereStr =""; +}else{ + $bascWhereStr =""; +} + +//首次查询,查出符合条件的纪录条数,并在以后的页面跳转中传递。 +if(!$numberOfRecords){ + $bgnNo=0; + $countSql="SELECT count(*) as totalNum + FROM $tableName + $whereStr + $bascWhereStr + "; + if($DEBUG) echo "
      countSql=$countSql"; + $result=mysqli_query($pubConn,$countSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + $numberOfRecords = $record[0]; + if($DEBUG) echo "
      numberOfRecords=$numberOfRecords"; + + if($numberOfRecords > 0){ + //插入日志 + insertLog("search $sysTypeName subscriber: $selKeyValue "); + }else{ + //插入日志 + insertLog("search $sysTypeName subscriber: $selKeyValue not found"); + echo "
      No Found"; + return; + //exit(); + } +} + +//找到需要显示的纪录 +if($numberOfRecords > 0){ + $showSql=" SELECT $selectFieldList + FROM $tableName + $whereStr + $bascWhereStr + ORDER BY $orderByStr + LIMIT $bgnNo, $numberPerPage + "; + if($DEBUG) echo "
      showSql=$showSql"; + $result=@mysqli_query($pubConn,$showSql); + echo mysqli_error($pubConn); + $rows=@mysqli_fetch_array($result); + + //下面是控制分页显示需要传递的变量传递变量 + if ($numberOfRecords >= 1) { + $nextBgnNo = $bgnNo + $numberPerPage; //本页的结束数目 + if ($nextBgnNo > $numberOfRecords){ + $nextBgnNo = $numberOfRecords; + } + $t1 = $bgnNo + 1; + $prevBgnNo = $bgnNo - $numberPerPage; + if ($prevBgnNo < 0) { + $prevBgnNo = 0; + } + $basePageLink ="sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&numberOfRecords=$numberOfRecords"; + $basePageLink .="&selKeyFieldName=$selKeyFieldName&selKeyValue=$selKeyValue"; + $prePageLink ="bgnNo=$prevBgnNo"; + $nextPageLink ="bgnNo=$nextBgnNo"; + } + $showBgnNo=$bgnNo+1; +} + +//========================================================== +//输出并显示数据 +//========================================================== +?> + + + +
      + + + + + +
      + $showBgnNo - $nextBgnNo, "; + echo "($strTotal:$numberOfRecords)"; +?> + +  +"; + echo "$strPreviousPage   "; + }else{ + echo "      "; + } + + // NEW: Display a link for the next set of records. + if ($nextBgnNo != $numberOfRecords && $numberOfRecords >0) { + echo ""; + echo "$strNextPage "; + }else{ + echo "    "; + } + + //根据纪录条数,算出页码数,本页页码 + if($numberOfRecords > 0){ + $totalPageNum = ceil($numberOfRecords / $numberPerPage ); + $pageNo = $bgnNo / $numberPerPage + 1; + }*/ +?> + +"; + echo "$strPrevious $strPreviousPage "; + }else{ + echo "$strPrevious $strPreviousPage "; + } + + //根据纪录条数,算出页码数,本页页码 + if($numberOfRecords > 0){ + $totalPageNum = ceil($numberOfRecords / $numberPerPage ); + $pageNo = $bgnNo / $numberPerPage + 1; + } + + echo ""; + + // NEW: Display a link for the next set of records. + if ($nextBgnNo != $numberOfRecords && $numberOfRecords >0) { + echo ""; + echo "$strNextPage $strNext"; + }else{ + echo "$strNextPage $strNext"; + } +?> +
      + + + "; + echo ""; + echo "$showNameArr[$i]"; + echo ""; + } + ?> + + +"; + for($i=0;$i"; + if ($i == "0"){ + echo " $rows[$i]"; + }else{ + echo " $rows[$i]"; + } + echo ""; + } + /* echo "";*/ + echo ""; + }while($rows=mysqli_fetch_array($result)); + +?> +
      "; + echo "edit"; + echo "
      +
      +  diff --git a/wxc2_omc/account/priSubsMng/commScan.php b/wxc2_omc/account/priSubsMng/commScan.php new file mode 100755 index 0000000..67f9610 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/commScan.php @@ -0,0 +1,325 @@ + + +"; +$DEBUG = 0; +global $pubConn; +$commIdStr=$_REQUEST['commIdStr']; +$okURL=$_REQUEST['okURL']; +$failURL=$_REQUEST['failURL']; +//commType 's value +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; +$nReplaceIndexComm=6; +//commState's value +$nProcFail = 0; +$nWaitProc = 1; +$nInProc = 2; +$nOutProc = 3; + +$failURL = rawurldecode($failURL); +$okURL = rawurldecode($okURL); +$pubDb = 'OMC_PUB'; +$commTable = 'subscriberComm'; +$sysConfTable ='sysConf'; +$commNum=$_REQUEST['commNum']; +$commType=$_REQUEST['commType']; +$lastTimeFinishNumStr=$_REQUEST['lastTimeFinishNumStr']; +if($commNum <= 0){ + $commArr = explode('-',$commIdStr); + $commNum = sizeof($commArr); +} +$maxOverTime = $commNum * 5 + 10; //根据子系统个数和对每个子系统操作的最大延时(5秒)来决定 +$maxWaitTime = $commNum * 2; +$maxStopTime = $commNum * 5 + 10; +$maxOfCommId = 50000; //设定命令表的最大值 + +$isFinish = $_REQUEST['isFinish']; +$waitTime = $_REQUEST['waitTime']; +$stopTime = $_REQUEST['stopTime']; +$usedTime = $_REQUEST['usedTime']; +if($DEBUG) echo "
      if(isFinish != 0 || (waitTime >= maxWaitTime) ||(stopTime > maxStopTime))
      "; +if($DEBUG) echo "
      if($isFinish != 0 || ($waitTime >= $maxWaitTime) ||($stopTime > $maxStopTime))
      "; + +//显示命令执行状态 +//----------------------------- +$showTime = $usedTime*2; +echo "Time:$showTime s
      "; +$okNum = 0; +$failNum = 0; +$commNum = 0; +$commArr = explode('-',$commIdStr); +$thisTImeFinishNumstr=''; +$lastTimeFinishNumArr = explode('-',$lastTimeFinishNumStr); +for($i=0;$iget command = $commSql"; + $commResult = mysqli_query($pubConn,$commSql); + if(mysqli_num_rows($commResult) <= 0){ + echo "
      Can not find this command's info in datebase"; + exit(); + } + $commRows = @mysqli_fetch_array($commResult); + $sysTypeNo = $commRows['sysTypeNo']; + $sysNo = $commRows['sysNo']; + $subSysNo = $commRows['subSysNo']; + $dataTypeNo = $commRows['dataTypeNo']; + $commType = $commRows['commType']; + $paramType = $commRows['paramType']; + $objId = $commRows['objId']; + $commState = $commRows['commState']; + $indexValueList = $commRows['indexValueList']; + $fieldNameList = $commRows['fieldNameList']; + $remark = $commRows['remark']; + + //获取该系统类型的snmp头和类型名称 + if(!isset($sysTypeName)){ + $sysConfSql = "SELECT snmpHead,sysTypeName FROM $sysConfTable WHERE sysTypeNo='$sysTypeNo'"; + if($DEBUG) echo "
      get conf = $sysConfSql"; + $sysConfResult = mysqli_query($pubConn,$sysConfSql); + echo mysqli_error($pubConn); + $sysConfRows = @mysqli_fetch_array($sysConfResult); + $sysTypeName = $sysConfRows['sysTypeName']; + $snmpHead = $sysConfRows['snmpHead']; + } + $sysName = $sysTypeName.'_'.$sysNo.'_'.$subSysNo; + //echo "
      $sysName 's
      "; + $objIdStr=$snmpHead.'.'.$objId; + //echo "
      $objIdStr
      "; + if($dataTypeNo > 0){ + $dataTypeName='Card'; + }else{ + $dataTypeName='subscriber'; + } + + switch($commType){ + case $nReadComm: + $showInfo="Read $dataTypeName $indexValueList from $sysName"; + break; + case $nChangeComm: + $showInfo="Change $indexValueList's field[$fieldNameList] in $sysName"; + break; + case $nCreateComm: + $showInfo="Create $dataTypeName $indexValueList to $sysName"; + break; + case $nDeleteComm: + $showInfo="Delete $sysName's $dataTypeName $indexValueList"; + break; + case $nLoadIndexComm: + $showInfo="Load $sysName's $dataTypeName Data "; + break; + case $nReplaceIndexComm: + $showInfo="Replace $dataTypeName Index $indexValueList -> $remark in $sysName"; + break; + default: + echo " Unknown Command Type"; + exit(); + } + + + if($DEBUG) echo "commState = $commState
      "; + switch($commState){ + case 0: //process failed + $failNum++; + echo "
      $commRows[remark] "; + insertLog("$showInfo Failed:$remark"); + sleep(1); + break; + case 1: //wait process + $waitTime++; + break; + case 2: //in process + $waitTime = 0; + //只要有一个命令的完成数在增长,就认为该组命令在运行,否则认为命令处理超时 + if($DEBUG) echo "====> {$commRows[finishNum]} > {$lastTimeFinishNumArr[$i]}"; + if($commRows[finishNum] > $lastTimeFinishNumArr[$i]){ + $stopTime = 0; + }else{ + $stopTime++; + } + if($DEBUG){ + echo "commRows[totalNum]=$commRows[totalNum],commRows[finishNum]=$commRows[finishNum]
      "; + } + omcProgressBar($commRows[totalNum],$commRows[finishNum]); + $thisTimeFinishNumStr .=$commRows[finishNum].'-'; + break; + case 3: //process finished + $okNum++; + omcProgressBar(100,100); + insertLog("$showInfo OK"); + break; + default: + echo "Unknown Command State"; + exit(); + } + echo "

      "; +}//end of for($i=0;$i$commNum =?= $finishNum"; +if($commNum == $okNum){ + $isFinish = 1; +}elseif($failNum > 0 && $okNum > 0&&($failNum+$okNum==$commNum)){ + $isFinish = -1; +}elseif($commNum == $failNum){ + $isFinish = -2; +}else{ + $isFinish = 0; +} + +//当删除用户时,只要不是"回应超时",都删除OMC数据库的用户 +if($commType == $nDeleteComm && $commState != $nWaitProc && $commState != $nInProc){ + if($DEBUG) echo"
      commType == DeleteComm ($commType == $nDeleteComm)"; + if($DEBUG) echo"
      remark={$commRows[remark]}"; + if($DEBUG) sleep(5); + if( $commRows[remark] != "response timeout"){ + if(!strstr($commRows[remark],"Can not delete an in used subscriber, please disable first")) + $isFinish = 1; + } +} +if($DEBUG) echo"
      lastTimeFinishNumStr=$lastTimeFinishNumStr"; +if($DEBUG) echo"
      thisTimeFinishNumStr=$thisTimeFinishNumStr"; +$lastTimeFinishNumStr = $thisTimeFinishNumStr; +//刷新返回 + +//命令处理完毕 +//---------------- +if(($isFinish != 0) || ($waitTime >= $maxWaitTime) || ($stopTime > $maxStopTime)){ + if($commId >= $maxOfCommId){ //初始化命令表 + //先删除表 + $dropSql = "DROP TABLE $commTable "; + mysqli_query($pubConn,$dropSql); + //再建一个结构相同的新表 + $createSql="CREATE TABLE subscriberComm ( + commId smallint(5) unsigned NOT NULL auto_increment, + commType tinyint(1) DEFAULT '0' NOT NULL, + dataTypeNo tinyint(4) DEFAULT '0' NOT NULL, + sysTypeNo smallint(5) unsigned DEFAULT '0' NOT NULL, + sysNo smallint(5) unsigned DEFAULT '0' NOT NULL, + subSysNo smallint(5) unsigned DEFAULT '0' NOT NULL, + indexValueList varchar(255) NOT NULL, + fieldNameList text NOT NULL, + paramType tinyint(4) DEFAULT '0' NOT NULL, + commState tinyint(3) unsigned DEFAULT '0' NOT NULL, + totalNum smallint(5) unsigned DEFAULT '0' NOT NULL, + finishNum smallint(5) unsigned DEFAULT '0' NOT NULL, + sendTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + bgnTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + endTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + remark varchar(200) binary NOT NULL, + PRIMARY KEY (commId), + KEY sysTypeNo (sysTypeNo), + KEY sysNo (sysNo), + KEY subSysNo (subSysNo), + KEY bufferKey (indexValueList) + ) + "; + mysqli_query($pubConn,$createSql); + }else{ + //删除命令表的相关命令 + $commArr = explode('-',$commIdStr); + for($i=0;$ideleteSql = $deleteSql"; + mysqli_query($pubConn,$deleteSql); + echo mysqli_error($pubConn); + } + } + + if($isBatchCreate==1){ + // 重定向返回指定页 + if($isFinish != 0){ + if($isFinish > 0){ + echo "Finished!!"; + }elseif($isFinish == -1){ + echo "Some of them failed!!"; + }else{ + echo "Failed!!"; + } + }elseif($usedTime >= $maxOverTime && $stopTime == 1){ + echo "Stoped!!"; + }else{ //$usedTime >= $maxOverTime + echo "Timeout!!"; + } + echo "
      "; + echo "

      $strBack"; + exit(); + }else{ + // 重定向返回指定页 + if($isFinish != 0){ + if($isFinish > 0){ + echo "Finished!!"; + if($commType == $nLoadIndexComm){ + sleep(8);//等8秒,这样数据库插入才能完全完成 + } + if($DEBUG) echo "
      okURL=$okURL"; + if($DEBUG) exit(); + echo " "; + }elseif($isFinish == -1){ + echo "Failed in some system!!"; + if($DEBUG) exit(); + echo " "; + }else{ + echo "Failed!!"; + if($DEBUG) echo "
      failURL=$failURL"; + if($DEBUG) exit(); + echo " "; + } + }elseif($usedTime >= $maxOverTime && $stopTime == 1){ + echo "Stoped!!"; + if($DEBUG) exit(); + echo " "; + }else{ //$usedTime >= $maxOverTime + echo "Timeout!!"; + if($DEBUG) exit(); + echo " "; + } + } + exit(); +}//end of if($isFinish....) + +//-------------- +$usedTime++; //总时间 +$failURL= rawurlencode($failURL); +$okURL = rawurlencode($okURL); + +//保留变量值,传到下次刷新 +$keepStr= "usedTime=$usedTime&waitTime=$waitTime&isFinish=$isFinish&stopTime=$stopTime"; +$keepStr.="&failURL=$failURL&okURL=$okURL&commIdStr=$commIdStr&commNum=$commNum&isBatchCreate=$isBatchCreate"; +$keepStr.="&lastTimeFinishNumStr=$lastTimeFinishNumStr&commType=$commType"; +$keepStr.="&isLoadIndex=$isLoadIndex"; +if($DEBUG) echo "
      keepStr=$keepStr"; + +if ( 1==$isLoadIndex ) { + require("commDown.php"); +} +adjust_content_tail("down"); +sleep(5); +?> + diff --git a/wxc2_omc/account/priSubsMng/eirSubsConf.php b/wxc2_omc/account/priSubsMng/eirSubsConf.php new file mode 100755 index 0000000..45a2e0c --- /dev/null +++ b/wxc2_omc/account/priSubsMng/eirSubsConf.php @@ -0,0 +1,413 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$canwrite_flag=checkWritePrivilege(); +$pubDb = 'OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +//------------选择语言版本---------- +if($language == 'eng'){ + +}else{ + +} + +//select sum(balance) from user_info +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +//保存用户数据修改的数据 +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- +$showAttrDef=array( + array('fieldName'=>'imei', 'inputName'=>'imei'), + array('fieldName'=>'status', 'inputName'=>'status') +); + +//For operation log use +{ + $status_def=array( + "01"=>"BlackListed","1"=>"BlackListed", + "02"=>"GreyListed","2"=>"GreyListed" + ); +} + +$logFieldDef=array( + 'status', +); + +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //system("echo '-------------------------------------'>>/tmp/test.txt"); + $preValueInfo="Change $pre_keyvalue "; + $isChangeFlag=0; + for($i=0;$i$inputName = $inputValue"; + if(isset($$ddName)) + { + $tmpv=$$ppName; + $val1=${$$ddName}[$tmpv]; + $val2=${$$ddName}[$inputValue]; + if(strlen($$ppName) == 0) + $val1="NoValue"; + + if(strcasecmp($val1,$val2) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$val1}->{$val2}]"; + //system("echo '[{$$nnName},{$val1}->{$val2}]' >>/tmp/test.txt"); + } + } + else if(isset($$cdName)) + { + $newValue=""; + for($iii=0;$iii({$newValue})]' >>/tmp/test.txt"); + } + } + else + { + if(strlen($$ppName) == 0) + $$ppName="NoValue"; + if(strcasecmp($$ppName,$inputValue) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$$ppName}->$inputValue]"; + //system("echo '[{$$nnName},{$$ppName}->$inputValue]'>>/tmp/test.txt"); + } + } + }else{ + //echo "
      Can not find $inputName's value"; + } + } + if($isChangeFlag==1) + { + $preValueInfo.=" in {$log_sysTypeName}_{$log_sysNo}_{$log_subSysNo}"; + insertLog($preValueInfo); + } +} + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //$status=$status; + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + } +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "imei,status"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +?> + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + +

      " > + + + + + + 0){ + ?> + + =4){ + ?> + + + + + + + + + + + +
      + + + + + +       + + " name="create" title="" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + +     + + + + + + + "; + else + echo ""; + ?> + + + + "; + else + echo ""; + ?> + +  
      +
      + + + + + + + + + 0){ + $imei=$tmpRow[imei]; + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; + + +//status +$status=$tmpRow[status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> +
      No.NameValueDescription
      $seqNo IMEI"; + echo ""; + echo "International mobile station equipment identity and software version Number (IMEISV), as defined in TS GSM 03.03, is a 16-digit decimal number composed of four distinct elements:
      - 6-digit Type Approval Code (TAC)
      - 2-digit Final Assembly Code (FAC)
      - 6-digit Serial Number (SNR)
      - 2-digit Software Version Number (SVN)
      $seqNo Service status"; +if($status > 1){ + echo " BlackListed     "; + echo " GreyListed"; +}else{ + echo "BlackListed     "; + echo "GreyListed"; + +} +echo "The ME has the following three states:
      White list: It is composed of all number series of equipment identities that are permitted for use
      Black list: It contains all equipment identities that belong to equipment that need to be barred
      Grey list: Equipments on the grey list are not barred (unless on the black list or not on the white list), but are tracked by the network for evaluation or other purposes
      The EIR only store the MEs that has the Blacklisted or Greylisted state, the Whitelisted MEs are defined by the system parameter. 1=BlackListed, 2=GreyListed.
      +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/eirSubsConfig b/wxc2_omc/account/priSubsMng/eirSubsConfig new file mode 100755 index 0000000..cac4db2 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/eirSubsConfig @@ -0,0 +1,20 @@ +[para]0[Name]IMEI +[sqlName]imei[t]input[unit]IMEI[u]00.0-07.7[u] +[v]keepHex-high-0 +[remark] +International mobile station equipment identity and software version Number (IMEISV), as defined in TS GSM 03.03, is a 16-digit decimal number composed of four distinct elements: +- 6-digit Type Approval Code (TAC) +- 2-digit Final Assembly Code (FAC) +- 6-digit Serial Number (SNR) +- 2-digit Software Version Number (SVN) + +[para]1[Name]Service status +[sqlName]status[t]radio[unit]Service status[u]00.0-00.7[u] +[v]1[opt]BlackListed +[v]2[opt]GreyListed +[remark] +The ME has the following three states: +White list: It is composed of all number series of equipment identities that are permitted for use +Black list: It contains all equipment identities that belong to equipment that need to be barred +Grey list: Equipments on the grey list are not barred (unless on the black list or not on the white list), but are tracked by the network for evaluation or other purposes +The EIR only store the MEs that has the Blacklisted or Greylisted state, the Whitelisted MEs are defined by the system parameter. 1=BlackListed, 2=GreyListed. \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/hlrSubsConf.php b/wxc2_omc/account/priSubsMng/hlrSubsConf.php new file mode 100755 index 0000000..a1f436e --- /dev/null +++ b/wxc2_omc/account/priSubsMng/hlrSubsConf.php @@ -0,0 +1,5971 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$canwrite_flag=checkWritePrivilege(); +$pubDb = 'OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; +$nReplaceIndexComm = 6; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +$odbGeneralDef=array( + //array('inputName', 'offset' ,'remark'), + array('BAOC', '00.0' ,'BAOC'), + array('BOIC', '00.1' ,'BOIC'), + array('BOIC_HPLMN', '00.2' ,'BOIC-HPLMN'), + array('BPRIC', '00.3', 'BPRIC'), + array('BPREC', '00.4', 'BPREC'), + array('BASS', '00.5' ,'BASS'), +// array('OSB1', '00.6', 'OSB1'), +// array('OSB2', '00.7', 'OSB2'), + array('BAIC', '02.0' ,'BAIC'), + array('BAIC_ROAM', '02.1' ,'BAIC-ROAM'), + array('Roaming', '02.3' ,'Roaming'), + array('Roaming_CT', '02.4' ,'Roaming CT') +); + +$odbSpecificDef=array( + array('OSB1', '00.0', 'OSB1'), + array('OSB2', '00.1', 'OSB2') +); +$CamelFlagDef=array( + array('supportFlag', '00.7' ,'CAMEL'), + array('OCSI', '01.0' ,'O-CSI'), + array('TCSI', '01.1' ,'T-CSI'), + array('SS_CSI', '01.2' ,'SS-CSI'), + array('SMS_CSI', '01.3' ,'SMS-CSI'), + array('GPRS_CSI', '01.4' ,'GPRS-CSI') +); + +$cfuStateDef=array( + array('cfuABit', '00.0' ,'Active'), + array('cfuRBit', '00.1' ,'Register'), + array('cfuPBit', '00.2' ,'Provision'), + array('cfuQBit', '00.3' ,'Quiescent') +); +$cfbStateDef=array( + array('cfbABit', '00.0' ,'Active'), + array('cfbRBit', '00.1' ,'Register'), + array('cfbPBit', '00.2' ,'Provision'), + array('cfbQBit', '00.3' ,'Quiescent') +); +$cfnryStateDef=array( + array('cfnryABit', '00.0' ,'Active'), + array('cfnryRBit', '00.1' ,'Register'), + array('cfnryPBit', '00.2' ,'Provision'), + array('cfnryQBit', '00.3' ,'Quiescent') +); +$cfnrcStateDef=array( + array('cfnrcABit', '00.0' ,'Active'), + array('cfnrcRBit', '00.1' ,'Register'), + array('cfnrcPBit', '00.2' ,'Provision'), + array('cfnrcQBit', '00.3' ,'Quiescent') +); +$baocStateDef=array( + array('baocABit', '00.0' ,'Active'), + array('baocPBit', '00.2' ,'Provision'), + array('baocQBit', '00.3' ,'Quiescent') +); +$boicStateDef=array( + array('boicABit', '00.0' ,'Active'), + array('boicPBit', '00.2' ,'Provision'), + array('boicQBit', '00.3' ,'Quiescent') +); +$boicExStateDef=array( + array('boicExABit', '00.0' ,'Active'), + array('boicExPBit', '00.2' ,'Provision'), + array('boicExcQBit', '00.3' ,'Quiescent') +); +$baicStateDef=array( + array('baicABit', '00.0' ,'Active'), + array('baicPBit', '00.2' ,'Provision'), + array('baicQBit', '00.3' ,'Quiescent') +); +$bicroamStateDef=array( + array('baicRoABit', '00.0' ,'Active'), + array('baicRoPBit', '00.2' ,'Provision'), + array('baicRoQBit', '00.3' ,'Quiescent') +); +$qpStateDef=array( + array('PBit', '00.2' ,'Provision'), + array('QBit', '00.3' ,'Quiescent') +); + +$callWaitingStateDef=array( + array('callWaitingABit', '00.0' ,'Active'), + array('callWaitingPBit', '00.2' ,'Provision'), + array('callWaitingQBit', '00.3' ,'Quiescent') +); +$callHoldStateDef=array( + array('callHoldPBit', '00.2' ,'Provision'), + array('callHoldQBit', '00.3' ,'Quiescent') +); +$ectStateDef=array( + array('ectPBit', '00.2' ,'Provision'), + array('ectQBit', '00.3' ,'Quiescent') +); +$mtpyStateDef=array( + array('mtpyPBit', '00.2' ,'Provision'), + array('mtpyQBit', '00.3' ,'Quiescent') +); + +$emlppStateDef=array( + //array('emlppABit', '00.0' ,'Active'), + array('emlppPBit', '00.2' ,'Provision'), + array('emlppQBit', '00.3' ,'Quiescent') +); + +$clipStateDef=array( + array('clipPBit', '00.2' ,'Provision'), + array('clipQBit', '00.3' ,'Quiescent') +); +$clirStateDef=array( + array('clirPBit', '00.2' ,'Provision'), + array('clirQBit', '00.3' ,'Quiescent') +); +$colpStateDef=array( + array('colpPBit', '00.2' ,'Provision'), + array('colpQBit', '00.3' ,'Quiescent') +); +$colrStateDef=array( + array('colrPBit', '00.2' ,'Provision'), + array('colrQBit', '00.3' ,'Quiescent') +); +$teleDataDef=array( + array('telephony', '00.0' ,'Telephony'), + array('emergencyCall', '00.1' ,'Emergency call'), + array('smsMtPP', '00.2' ,'Short-message MT-PP'), + array('smsMoPP', '00.3' ,'Short-message MO-PP') +); + +$pdpContextDef=array( + array('pdpFlag','00.0-00.7','PDP flag'), + array('pdpType','01.0-02.7','PDP type'), + array('pdpAddress','04.0-19.7','PDP address'),//the byte3 is the length of the address + array('reliabilityClass','20.0-20.2','Reliability class'), + array('delayClass','20.3-20.7','Delay class'), + array('precedenceClass','21.0-21.3','Precedence class'), + array('peakThroughput','21.4-21.7','Peak throughput'), + array('meanThroughput','22.0-22.7','Mean throughput'), + array('vplmnAddressAllowedFlag','23.0-23.7','VPLMN Address Allowed Flag'), + array('apn','24.0-55.7','APN'), + array('ExtFlag','56.0-56.7','Ext Flag'), + array('allocation_retentionPriority','57.0-57.7','Allocation/Retention Priority'), + array('delivery_errSdus','58.0-58.2','Delivery err SDUs'), + array('deliveryOrder','58.3-58.4','Delivery order'), + array('trafficClass','58.5-58.7','Traffic class'), + array('maximumSduSize','59.0-59.7','Maximum SDU size'), + array('maximumRateuplinkRan','60.0-60.5','Maximum bit rate for uplink range(X)'), + array('maximumRateuplinkBas','60.6-60.7','Maximum bit rate for uplink base'), + array('maximumRatedownlinkRan','61.0-61.5','Maximum bit rate for downlink range(X)'), + array('maximumRatedownlinkBas','61.6-61.7','Maximum bit rate for downlink base'), + array('sduErrRatio','62.0-62.3','SDU error ratio'), + array('residualErrRate','62.4-62.7','Residual Bit Error Rate'), + array('trafficHandingPrior','63.0-63.1','Traffic handing priority'), + array('transferDelay','63.2-63.7','Transfer delay'), + array('guaranteedRateUplinkRan','64.0-64.5','Guaranteed bit rate uplink range(X)'), + array('guaranteedRateUplinkBas','64.6-64.7','Guaranteed bit rate uplink base'), + array('guaranteedRateDownlinkRan','65.0-65.5','Guaranteed bit rate downlink range(X)'), + array('guaranteedRateDownlinkBas','65.6-65.7','Guaranteed bit rate downlink base'), + array('sourceStatisticsDescriptor','66.0-66.3','Source statistics descriptor'), + array('signallingIndication','66.4-66.4','Signalling Indication'), + array('reserved','66.5-66.7','Reserved'), + array('maximumRateDownlink','67.0-67.7','Maximum bit rate downlink(ext)'), + array('guaranteedRateDownlink','68.0-68.7','Guaranteed bit rate downlinkr(ext)'), + array('maximumRateUplink','69.0-69.7','Maximum bit rate uplink(ext)'), + array('guaranteedRateUplink','70.0-70.7','Guaranteed bit rate uplink(ext)'), + array('adress_len','03.0-03.7','adress_len') +); + +$pdpPdpTypeDef=array( + array('289','IPv4'), + array('343','IPv6'), + array('0','X.25') +); + +$pdpPrecedenceClassDef=array( + array('1','High'), + array('2','Normal'), + array('3','Low') +); + +$pdpPeakThroughtputDef=array( + array('1','8Kbps'), + array('2','16Kbps'), + array('3','32Kbps'), + array('4','64Kbps'), + array('5','128Kbps'), + array('6','256Kbps'), + array('7','512Kbps'), + array('8','1024Kbps'), + array('9','2048Kbps') +); + +$pdpMeanThroughtputDef=array( + array('1','100Bph'), + array('2','200Bph'), + array('3','500Bph'), + array('4','1kBph'), + array('5','2kBph'), + array('6','5kBph'), + array('7','10kBph'), + array('8','20kBph'), + array('9','50kBph'), + array('10','100kBph'), + array('11','200kBph'), + array('12','500kBph'), + array('13','1mBph'), + array('14','2mBph'), + array('15','5mBph'), + array('16','10mBph'), + array('17','20mBph'), + array('18','50mBph'), + array('31','Best Effort') +); + +$pdpExtFlagDef=array( + array('0','Non-included Ext'), + array('1','Included Ext'), + array('3','Included Ext and Ext2 only 1 octet'), + array('7','Included Ext, Ext2'), + array('15','Included Ext, Ext2, EXt3') +); + +$DeliveryErrSDUsDef=array( + array('1','No detect'), + array('2','Err SDUs delilvered'), + array('3','Err SDUs not delivered'), + array('7','Reserved') +); + +$deliveryOrderDef=array( + array('1','delivery order'), + array('2','no delivery order'), + array('3','Reserved') +); + +$trafficClassDef=array( + array('1','Conversation class'), + array('2','Streaming class'), + array('3','Interactive class'), + array('4','Background class'), + array('7','Reserved') +); + +$pdpMaximumSDUsizeDef=array( + array('1','10 octexs'), + array('20','200 octexs'), + array('80','800 octexs'), + array('100','1000 octexs'), + array('148','1480 octexs'), + array('150','1500 octexs'), + array('151','1502 octexs'), + array('152','1510 octexs'), + array('153','1520 octexs'), + array('255','Reserved') +); + + +$pdpMaximumDownlinkExtDef=array( + array('0','<=8600kbps'), + array('1','8700kbps'), + array('74','16000kbps'), + array('75','17Mbps'), + array('186','128Mbps'), + array('187','130Mbps'), + array('250','256Mbps') +); + +$pdpMaximumUplinkExtDef=array( + array('0','<=8600kbps'), + array('1','8700kbps'), + array('74','16000kbps'), + array('75','17Mbps'), + array('186','128Mbps'), + array('187','130Mbps'), + array('250','256Mbps') +); + +$pdpSduErrorRatioDef=array( + array('1','1E-2'), + array('2','7E-3'), + array('3','1E-3'), + array('4','1E-4'), + array('5','1E-5'), + array('6','1E-6'), + array('7','1E-1'), + array('15','Reserved') +); + + +$pdpResidualErrRateDef=array( + array('1','5E-2'), + array('2','1E-2'), + array('3','5E-3'), + array('4','4E-3'), + array('5','1E-3'), + array('6','1E-4'), + array('7','1E-5'), + array('8','1E-6'), + array('9','6E-8'), + array('15','Reserved') +); + +$pdpTrafficHandingPriorityDef=array( + array('1','level 1'), + array('2','level 2'), + array('3','level 3'), + array('0','Reserved') +); + +$pdpTransferDelayDef=array( + array('0','X*10ms'), + array('1','200ms+X*50ms'), + array('2','1000ms+X*100ms'), + array('3','2600ms+X*100ms'), + array('63','Reserved') +); + +$pdpRateDownUplinkBasDef=array( + array('0','X*1Kbps'), + array('1','64Kbps+(X*8Kbps)'), + array('2','576Kbps+(X*64Kbps)'), + array('3','4672Kbps+(X*64Kbps)') +); + +$pdpRateDownUplinkRanDef=array( + array('0','0'), + array('1','1'), + array('2','2'), + array('3','3'), + array('4','4'), + array('5','5'), + array('6','6'), + array('7','7'), + array('8','8'), + array('9','9'), + array('10','10'), + array('11','11'), + array('12','12'), + array('13','13'), + array('14','14'), + array('15','15'), + array('16','16'), + array('17','17'), + array('18','18'), + array('19','19'), + array('20','20'), + array('21','21'), + array('22','22'), + array('23','23'), + array('24','24'), + array('25','25'), + array('26','26'), + array('27','27'), + array('28','28'), + array('29','29'), + array('30','30'), + array('31','31'), + array('32','32'), + array('33','33'), + array('34','34'), + array('35','35'), + array('36','36'), + array('37','37'), + array('38','38'), + array('39','39'), + array('40','40'), + array('41','41'), + array('42','42'), + array('43','43'), + array('44','44'), + array('45','45'), + array('46','46'), + array('47','47'), + array('48','48'), + array('49','49'), + array('50','50'), + array('51','51'), + array('52','52'), + array('53','53'), + array('54','54'), + array('55','55'), + array('56','56'), + array('57','57'), + array('58','58'), + array('59','59'), + array('60','60'), + array('61','61'), + array('62','62'), + array('63','63') +); + +$pdpGuaranteedUplinkExtDef=array( + array('0','<=8600kbps'), + array('1','8700kbps'), + array('74','16000kbps'), + array('75','17Mbps'), + array('186','128Mbps'), + array('187','130Mbps'), + array('250','256Mbps') +); + +$pdpGuaranteedDownlinkExtDef=array( + array('0','<=8600kbps'), + array('1','8700kbps'), + array('74','16000kbps'), + array('75','17Mbps'), + array('186','128Mbps'), + array('187','130Mbps'), + array('250','256Mbps') +); + +$pdpSignallingIndicationDef=array( + array('0','Not optimised'), + array('1','Optimised') +); + +$pdpSourceStatisticsDescriptorDef=array( + array('0','Spare'), + array('1','Speech') +); + + + +//========================================================== +//输入变量 +//========================================================== +$canSetNum=$_REQUEST['canSetNum']; +$keyValue=$_REQUEST['keyValue']; +$subSysNo=$_REQUEST['subSysNo']; +$dataTypeNo=$_REQUEST['dataTypeNo']; + +if ($_REQUEST['sysId']) +{ + $sysId = $_REQUEST['sysId']; + if($DEBUG) echo "
      sysId=$sysId"; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + // echo "sysTypeNo=$sysTypeNo,sysNo=$sysNo"; +} + +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +$isLoadIndex=$_REQUEST['isLoadIndex']; +$isTryCreate=$_REQUEST['isTryCreate']; +$isBatchCreate=$_REQUEST['isBatchCreate']; +$isCreate=$_REQUEST['isCreate']; +$isDelete=$_REQUEST['isDelete']; +$isChange=$_REQUEST['isChange']; +$isRead=$_REQUEST['isRead']; +$batchNum=$_REQUEST['batchNum']; +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +//保存用户数据修改的数据 +$bgnNo=$_POST['bgnNo']; +$endNo=$_POST['endNo']; +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- +$showAttrDef=array( + array('fieldName'=>'imsi', 'inputName'=>'imsi'), + array('fieldName'=>'used_flag', 'inputName'=>'used_flag'), + array('fieldName'=>'nam', 'inputName'=>'nam'), + array('fieldName'=>'inter_msisdn', 'inputName'=>'interMsisdn'), + array('fieldName'=>'fax_num', 'inputName'=>'faxNum'), //add by arwean + array('fieldName'=>'data_num', 'inputName'=>'dataNum'), //add by arwean + array('fieldName'=>'category', 'inputName'=>'category'), + array('fieldName'=>'sub_status', 'inputName'=>'sub_status'), + array('fieldName'=>'odb_general', 'inputName'=>'odb_general'), + array('fieldName'=>'odb_specific','inputName'=>'odb_specific'), + array('fieldName'=>'camel_flag', 'inputName'=>'camel_flag'), + array('fieldName'=>'rszi', 'inputName'=>'rszi'), + array('fieldName'=>'csr_type', 'inputName'=>'csr_type'), + array('fieldName'=>'clip_state', 'inputName'=>'clip_state'), + array('fieldName'=>'bc_type', 'inputName'=>'bc_type'), //add by arwean + array('fieldName'=>'clir_state', 'inputName'=>'clir_state'), + array('fieldName'=>'colp_state', 'inputName'=>'colp_state'), + array('fieldName'=>'colr_state', 'inputName'=>'colr_state'), + array('fieldName'=>'passwd', 'inputName'=>'passwd'), + array('fieldName'=>'baoc_state', 'inputName'=>'baoc_state'), + array('fieldName'=>'boic_state', 'inputName'=>'boic_state'), + array('fieldName'=>'boichc_state', 'inputName'=>'boichc_state'), + array('fieldName'=>'baic_state', 'inputName'=>'baic_state'), + array('fieldName'=>'bicroam_state', 'inputName'=>'bicroam_state'), + array('fieldName'=>'cfu_state', 'inputName'=>'cfu_state'), + array('fieldName'=>'cfu_num', 'inputName'=>'cfuNumber'), + array('fieldName'=>'cfb_state', 'inputName'=>'cfb_state'), + array('fieldName'=>'cfb_num', 'inputName'=>'cfbNumber'), + array('fieldName'=>'cfnry_state', 'inputName'=>'cfnry_state'), + array('fieldName'=>'cfnry_num', 'inputName'=>'cfnryNumber'), + array('fieldName'=>'cfnry_time', 'inputName'=>'cfnry_time'), + array('fieldName'=>'cfnrc_state', 'inputName'=>'cfnrc_state'), + array('fieldName'=>'cfnrc_num', 'inputName'=>'cfnrcNumber'), + array('fieldName'=>'callwait_state','inputName'=>'callwait_state'), + array('fieldName'=>'callhold_state','inputName'=>'callhold_state'), + array('fieldName'=>'ect_state', 'inputName'=>'ect_state'), + array('fieldName'=>'mtpy_state', 'inputName'=>'mtpy_state'), + array('fieldName'=>'emlpp_state', 'inputName'=>'emlpp_state'), + array('fieldName'=>'emlpp_max_priority', 'inputName'=>'emlpp_max_priority'), + array('fieldName'=>'emlpp_def_priority', 'inputName'=>'emlpp_def_priority'), + array('fieldName'=>'gprs_flag', 'inputName'=>'gprs_flag'), + array('fieldName'=>'pdp1', 'inputName'=>'pdp_1'), + array('fieldName'=>'pdp2', 'inputName'=>'pdp_2'), + array('fieldName'=>'pdp3', 'inputName'=>'pdp_3'), + array('fieldName'=>'user_name', 'inputName'=>'user_name'), + array('fieldName'=>'subs_option', 'inputName'=>'subs_option'), + array('fieldName'=>'tele_data', 'inputName'=>'tele_data'), + array('fieldName'=>'user_certifiacate','inputName'=>'user_certifiacate') +); +//如果fieldName和inputName相等,则不用做附加处理 +//否则,需要根据这个变量的值来做一些附加处理,例如电话号码的前补91后补E,或是一些复选框的合并 + +//检查各个需要编辑的输入单元 +//For operation log use +{ + $used_flag_def=array( + "00"=>"Disable","0"=>"Disable", + "01"=>"Enable","1"=>"Enable" + ); + $nam_def=array( + "00"=>"Both","0"=>"Both", + "01"=>"Non-GPRS only","1"=>"Non-GPRS only", + "02"=>"GPRS only","2"=>"GPRS only" + ); + $category_def=array( + "00"=>"Unknown","0"=>"Unknown", + "01"=>"French language","1"=>"French language", + "02"=>"English language","2"=>"English language", + "03"=>"German language","3"=>"German language", + "04"=>"Russian language","4"=>"Russian language", + "05"=>"Spanish language","5"=>"Spanish language", + "0A"=>"Ordinary", + "0B"=>"Subscriber with priority" + ); + + $sub_status_def=array( + "00"=>"Service granted","0"=>"Service granted", + "01"=>"Operator determined","1"=>"Operator determined" + ); + + $csr_type_def=array( + "00"=>"00","0"=>"00", + "01"=>"01","1"=>"01", + "02"=>"02","2"=>"02", + "03"=>"03","3"=>"03", + "04"=>"04","4"=>"04", + "05"=>"05","5"=>"05", + "06"=>"06","6"=>"06", + "07"=>"07","7"=>"07", + "255"=>"No restriction","FF"=>"No restriction" + ); + + $faxIdVar_def=array( + "1"=>"01","2"=>"02", + "3"=>"03","4"=>"04", + "5"=>"05","6"=>"06", + "7"=>"07","8"=>"08", + "9"=>"09","10"=>"10", + "11"=>"11","12"=>"12", + "13"=>"13","14"=>"14", + "15"=>"15","15"=>"15" + ); + + $subs_option_def=array( + "00"=>"Service provider","0"=>"Service provider", + "01"=>"Subscriber using password","1"=>"Subscriber using password", + "02"=>"Subscriber not using password","2"=>"Subscriber not using password" + ); + + $emlpp_priority_def=array( + "06"=>"Level A","6"=>"Level A", + "05"=>"Level B","5"=>"Level B", + "00"=>"Level 0","0"=>"Level 0", + "01"=>"Level 1","1"=>"Level 1", + "02"=>"Level 2","2"=>"Level 2", + "03"=>"Level 3","3"=>"Level 3", + "04"=>"Level 4","4"=>"Level 4" + ); + + $gprs_flag_def=array( + "00"=>"Disable","0"=>"Disable", + "01"=>"Enable","1"=>"Enable" + ); + + $pdp_type_def=array( + "289"=>"IPv4", + "343"=>"IPv6", + "0"=>"X.25" + ); + + $reliabilityClass_def=array( + "01"=>"1","1"=>"1", + "02"=>"2","2"=>"2", + "03"=>"3","3"=>"3", + "04"=>"4","4"=>"4", + "05"=>"5","5"=>"5" + ); + + $delayClass_def=array( + "01"=>"1","1"=>"1", + "02"=>"2","2"=>"2", + "03"=>"3","3"=>"3", + "04"=>"4","4"=>"4" + ); + + $allocationRetentionPriority_def=array( + "01"=>"1","1"=>"1", + "02"=>"2","2"=>"2", + "03"=>"3","3"=>"3", + "04"=>"4","4"=>"4" + ); + + $precedenceClass_def=array( + "01"=>"High","1"=>"High", + "02"=>"Normal","2"=>"Normal", + "03"=>"Low","3"=>"Low" + ); + + $peakThroughput_def=array( + "01"=>"8Kbps","1"=>"8Kbps", + "02"=>"16Kbps","2"=>"16Kbps", + "03"=>"32Kbps","3"=>"32Kbps", + "04"=>"64Kbps","4"=>"64Kbps", + "05"=>"128Kbps","5"=>"128Kbps", + "06"=>"256Kbps","6"=>"256Kbps", + "07"=>"512Kbps","7"=>"512Kbps", + "08"=>"1024Kbps","8"=>"1024Kbps", + "09"=>"2048Kbps","9"=>"2048Kbps" + ); + + $meanThroughput_def=array( + "1"=>"100Bph", + "2"=>"200Bph", + "3"=>"500Bph", + "4"=>"1kBph", + "5"=>"2kBph", + "6"=>"5kBph", + "7"=>"10kBph", + "8"=>"20kBph", + "9"=>"50kBph", + "10"=>"100kBph", + "11"=>"200kBph", + "12"=>"500kBph", + "13"=>"1mBph", + "14"=>"2mBph", + "15"=>"5mBph", + "16"=>"10mBph", + "17"=>"20mBph", + "18"=>"50mBph", + "31"=>"Best Effort" + ); + + $vplmnAddressAllowedFlag_def=array( + "00"=>"Not allowed","0"=>"Not allowed", + "01"=>"Allowed","1"=>"Allowed" + ); +} + +$logFieldDef=array( + 'used_flag', + 'nam', + 'interMsisdn', + 'faxNum', + 'dataNum', + 'category', + 'sub_status', + 'odb_general', + 'odb_specific', + 'tele_data', + 'rszi_0', + 'rszi_1', + 'rszi_2', + 'rszi_3', + 'rszi_4', + 'rszi_5', + 'rszi_6', + 'rszi_7', + 'rszi_8', + 'rszi_9', + 'csr_type', + 'clip_state', + 'faxIdVar', + 'dataIdVar', + 'clir_state', + 'colp_state', + 'colr_state', + 'subs_option', + 'passwd', + 'baoc_state', + 'boic_state', + 'boichc_state', + 'baic_state', + 'bicroam_state', + 'cfu_state', + 'cfuNumber', + 'cfb_state', + 'cfbNumber', + 'cfnry_state', + 'cfnryNumber', + 'cfnry_time', + 'cfnrc_state', + 'cfnrcNumber', + 'callwait_state', + 'callhold_state', + 'ect_state', + 'mtpy_state', + 'emlpp_state', + 'emlpp_max_priority', + 'emlpp_def_priority', + 'camel_flag', + 'gprs_flag', + 'pdpFlag_1', + 'pdpType_1', + 'pdpAddress_1', + 'reliabilityClass_1', + 'delayClass_1', + 'precedenceClass_1', + 'peakThroughput_1', + 'meanThroughput_1', + 'vplmnAddressAllowedFlag_1', + 'apn_1', + 'ext_flag_1', + 'allocation_retentionPriority_1', + 'delivery_err_sdus_1', + 'delivery_order_1', + 'traffic_class_1', + 'maximumSDUsize_1', + 'maximumRateUplinkRan_1', + 'maximumRateUplinkBas_1', + 'maximumRateDownlinkRan_1', + 'maximumRateDownlinkBas_1', + 'sduErrorRatio_1', + 'residualErrRate_1', + 'trafficHandingPriority_1', + 'transferDelay_1', + 'guaranteedRateUplinkRan_1', + 'guaranteedRateUplinkBas_1', + 'guaranteedRateDownlinkRan_1', + 'guaranteedRateDownlinkBas_1', + 'sourceStatisticsDescriptor_1', + 'signallingIndication_1', + 'reserved_1', + 'maximumDownlinkExt_1', + 'guaranteedRateDownlinkExt_1', + 'maximumUplink_1', + 'guaranteedUplinkExt_1', + 'pdpFlag_2', + 'pdpType_2', + 'pdpAddress_2', + 'reliabilityClass_2', + 'delayClass_2', + 'precedenceClass_2', + 'peakThroughput_2', + 'meanThroughput_2', + 'vplmnAddressAllowedFlag_2', + 'apn_2', + 'ext_flag_2', + 'allocation_retentionPriority_2', + 'delivery_err_sdus_2', + 'delivery_order_2', + 'traffic_class_2', + 'maximumSDUsize_2', + 'maximumRateUplinkRan_2', + 'maximumRateUplinkBas_2', + 'maximumRateDownlinkRan_2', + 'maximumRateDownlinkBas_2', + 'sduErrorRatio_2', + 'residualErrRate_2', + 'trafficHandingPriority_2', + 'transferDelay_2', + 'guaranteedRateUplinkRan_2', + 'guaranteedRateUplinkBas_2', + 'guaranteedRateDownlinkRan_2', + 'guaranteedRateDownlinkBas_2', + 'sourceStatisticsDescriptor_2', + 'signallingIndication_2', + 'reserved_2', + 'maximumDownlinkExt_2', + 'guaranteedRateDownlinkExt_2', + 'maximumUplink_2', + 'guaranteedUplinkExt_2', + 'pdpFlag_3', + 'pdpType_3', + 'pdpAddress_3', + 'reliabilityClass_3', + 'delayClass_3', + 'precedenceClass_3', + 'peakThroughput_3', + 'meanThroughput_3', + 'vplmnAddressAllowedFlag_3', + 'apn_3', + 'ext_flag_3', + 'allocation_retentionPriority_3', + 'delivery_err_sdus_3', + 'delivery_order_3', + 'traffic_class_3', + 'maximumSDUsize_3', + 'maximumRateUplinkRan_3', + 'maximumRateUplinkBas_3', + 'maximumRateDownlinkRan_3', + 'maximumRateDownlinkBas_3', + 'sduErrorRatio_3', + 'residualErrRate_3', + 'trafficHandingPriority_3', + 'transferDelay_3', + 'guaranteedRateUplinkRan_3', + 'guaranteedRateUplinkBas_3', + 'guaranteedRateDownlinkRan_3', + 'guaranteedRateDownlinkBas_3', + 'sourceStatisticsDescriptor_3', + 'signallingIndication_3', + 'reserved_3', + 'maximumDownlinkExt_3', + 'guaranteedRateDownlinkExt_3', + 'maximumUplink_3', + 'guaranteedUplinkExt_3', + 'user_certifiacate', + 'user_name' +); +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //system("echo '-------------------------------------'>>/tmp/test.txt"); + $pre_keyvalue = $_POST['pre_keyvalue']; + $log_sysTypeName = $_POST['log_sysTypeName']; + $log_sysNo = $_POST['log_sysNo']; + $log_subSysNo = $_POST['log_subSysNo']; + $preValueInfo="Change $pre_keyvalue "; + $isChangeFlag=0; + for($i=0;$i$inputName = $inputValue"; + if(isset($$ddName)) + { + $tmpv=$$ppName; + $val1=${$$ddName}[$tmpv]; + $val2=${$$ddName}[$inputValue]; + if(strlen($$ppName) == 0) + $val1="NoValue"; + + if(strcasecmp($val1,$val2) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$val1}->{$val2}]"; + //system("echo '[{$$nnName},{$val1}->{$val2}]' >>/tmp/test.txt"); + } + } + else if(isset($$cdName)) + { + $newValue=""; + for($iii=0;$iii({$newValue})]' >>/tmp/test.txt"); + } + } + else + { + if(strlen($$ppName) == 0) + $$ppName="NoValue"; + if(strcasecmp($$ppName,$inputValue) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$$ppName}->$inputValue]"; + //system("echo '[{$$nnName},{$$ppName}->$inputValue]'>>/tmp/test.txt"); + } + } + }else{ + //echo "
      Can not find $inputName's value"; + } + } + if($isChangeFlag==1) + { + $preValueInfo.=" in {$log_sysTypeName}_{$log_sysNo}_{$log_subSysNo}"; + insertLog($preValueInfo); + } +} + + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + if($isCreate){ + //$imsi + $imsi=$_POST['imsi']; + for($i=strlen($imsi);$i<16;$i++){ + $imsi='0'.$imsi; + } + } + $used_flag = $_POST['used_flag']; + $nam = $_POST['nam']; + //inter_msisdn + $interMsisdn = $_POST['interMsisdn']; +// echo "interMsisdn=$interMsisdn "; + $inter_msisdn = encodeTelNumber($interMsisdn); + //fax_num + $faxNum = $_POST['faxNum']; + $fax_num = encodeTelNumber($faxNum); + //data_num + //$data_num = $_POST['dataNum']; + //$dataNum = encodeTelNumber($data_num); + $dataNum = $_POST['dataNum']; + $data_num = encodeTelNumber($dataNum); + //categor + $category = $_POST['category']; + //odb_status + $sub_status = $_POST['sub_status']; + //odb_general + $odb_general = $_POST['odb_general']; + $orgValue=$odb_general; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $inputOffset=$odbGeneralDef[$i][1]; + if($DEBUG) echo "
      setBitValue($orgValue,$inputOffset,$inputValue)"; + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $odb_general=$orgValue; + + //odb_specific + $odb_specific = $_POST['odb_specific']; + $orgValue=$odb_specific; + + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $inputOffset=$odbSpecificDef[$i][1]; + if($DEBUG) echo "
      setBitValue($orgValue,$inputOffset,$inputValue)"; + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $odb_specific=$orgValue; + + // camel_flag + $camel_flag=$_POST['camel_flag']; + //cfu_state + $cfu_state = $_POST['cfu_state']; + $orgValue=$cfu_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $cfu_state=$orgValue; + + //cfb_state + $cfb_state = $_POST['cfb_state']; + $orgValue=$cfb_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $cfb_state=$orgValue; + + //cfnry_state + $cfnry_state = $_POST['cfnry_state']; + $orgValue=$cfnry_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $cfnry_state=$orgValue; + //cfnry_time + $cfnry_time = $_POST['cfnry_time']; + //cfb_state + $cfnrc_state = $_POST['cfnrc_state']; + $orgValue=$cfnrc_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $cfnrc_state=$orgValue; + + //baoc_state + $baoc_state = $_POST['baoc_state']; + $orgValue=$baoc_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $baoc_state=$orgValue; + + //boic_state + $boic_state = $_POST['boic_state']; + $orgValue=$boic_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $boic_state=$orgValue; + + //boicEx_state + $boichc_state = $_POST['boichc_state']; + $orgValue=$boichc_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $boichc_state=$orgValue; + + //baic_state + $baic_state = $_POST['baic_state']; + $orgValue=$baic_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $baic_state=$orgValue; + + //bic-roam + $bicroam_state = $_POST['bicroam_state']; + $orgValue=$bicroam_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $bicroam_state=$orgValue; + + //Call waiting state + $callwait_state = $_POST['callwait_state']; + $orgValue=$callwait_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $callwait_state=$orgValue; + + //Call hold state + $callhold_state = $_POST['callhold_state']; + $orgValue=$callhold_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $callhold_state=$orgValue; + + //ECT state + $ect_state = $_POST['ect_state']; + $orgValue=$ect_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $ect_state=$orgValue; + + //MTPY state + $mtpy_state = $_POST['mtpy_state']; + $orgValue=$mtpy_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $mtpy_state=$orgValue; + + //emlpp state + $emlpp_state = $_POST['emlpp_state']; + $orgValue=$emlpp_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $emlpp_state=$orgValue; + + //emlpp_max_priority + $emlpp_max_priority= $_POST['emlpp_max_priority']; + //emlpp_def_priority + $emlpp_def_priority = $_POST['emlpp_def_priority']; + //Tele service + $tele_data = $_POST['tele_data']; + $orgValue=$tele_data; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $tele_data=$orgValue; + //csr_type + $csr_type = $_POST['csr_type']; + //CLIP + $clip_state = $_POST['clip_state']; + $orgValue=$clip_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $clip_state=$orgValue; + + //Bearer capability type (Add by Arwean) + $dataIdVar = $_POST['dataIdVar']; + $faxIdVar = $_POST['faxIdVar']; + $bc_type = dechex($dataIdVar) . dechex($faxIdVar); + + //CLIR + $clir_state = $_POST['clir_state']; + $orgValue=$clir_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $clir_state=$orgValue; + + //COLP + $colp_state = $_POST['colp_state']; + $orgValue=$colp_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $colp_state=$orgValue; + + //COLR + $colr_state = $_POST['colr_state']; + $orgValue=$colr_state; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $colr_state=$orgValue; + + //call barring passwd option + $subs_option = $_POST['subs_option']; + //passwd + $passwd= $_POST['passwd']; + //camel_flag + $camel_flag = $_POST['camel_flag']; + $orgValue=$camel_flag; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $camel_flag=$orgValue; + + $gprs_flag = $_POST['gprs_flag']; + //RSZI + $rszi = ""; + for($i=0;$i<10;$i++){ + // $tmp = ${"rszi_".$i}; + $tmp = $_POST["rszi_".$i]; + // echo "rszi[$i] = $tmp "; + if($tmp < 16){ + $tmp = "0".dechex($tmp); + }else{ + $tmp = dechex($tmp); + } + $rszi = $rszi.$tmp; + } + + $cfuNumber = $_POST['cfuNumber']; + $cfbNumber = $_POST['cfbNumber']; + $cfnryNumber = $_POST['cfnryNumber']; + $cfnrcNumber = $_POST['cfnrcNumber']; + $cfu_num = encodeTelNumber($cfuNumber); + $cfb_num = encodeTelNumber($cfbNumber); + $cfnry_num = encodeTelNumber($cfnryNumber); + $cfnrc_num = encodeTelNumber($cfnrcNumber); + + //pdp context(group 1) + $k=0; + do + { + ${$pdpContextDef[$k][0].'_1'}=$_POST[$pdpContextDef[$k][0]."_1"]; + ${$pdpContextDef[$k][0].'_2'}=$_POST[$pdpContextDef[$k][0]."_2"]; + ${$pdpContextDef[$k][0].'_3'}=$_POST[$pdpContextDef[$k][0]."_3"]; +// echo "$k:${$pdpContextDef[$k][0].'_1'} "; + $k++; + }while ($k<36); + + $orgValue=""; + $i=0; + $orgValue=$orgValue.omc_keep_length(${$pdpContextDef[$i][0].'_1'},"0","2","0"); + $i++; + + //echo "
      xxx=$orgValue"; + $user_name = $_POST['user_name']; + $user_certifiacate = $_POST['user_certifiacate']; + + $tmpValue="0000"; + $tmpValue=setBitValue($tmpValue,"0.0-1.7",DECHEX(${$pdpContextDef[$i][0].'_1'})); + + $tmpValue=omc_keep_length($tmpValue,"0","4","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + //debug_log("/tmp/debug.txt","orgValue=$orgValue"); + + if(${$pdpContextDef[$i-1][0].'_1'}==289){ + $tmpValue="04"; + $tmpValueArr=explode(".",${$pdpContextDef[$i][0].'_1'}); + $iplen=sizeof($tmpValueArr); + for($j=0;$jxxx=$orgValue"; +/* + $orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_1'}; + $i++; + //echo "
      xxx=$orgValue"; + + $orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_1'}; + $i++; + //echo "
      xxx=$orgValue"; +*/ + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',3); + //echo "
      tmpBinValue=$tmpBinValue"; + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',3); + $i++; + //echo "
      tmpBinValue=$tmpBinValue"; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + $orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_1'}; + $i++; + //echo "
      xxx=$orgValue"; + + $orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_1'}; + $i++; + //echo "
      xxx=$orgValue"; + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + + $tmpValue=""; + $tmpValue_1=${$pdpContextDef[$i][0].'_1'}; + for($j=0;$jtmpBinValue=$tmpBinValue"; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_1'}),'0',3); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_1'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_1'}),'0',3); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Maximum SDU size + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + + //Maximum bit rate for uplink + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',6); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Maximum bit rate for downlink + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',6); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Residual Bit Error Rate ,SDU error ratio + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',4); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',4); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + // Transfer delay ,Traffic handing priority + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',6); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',2); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Guaranteed bit rate uplink + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',6); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Guaranteed bit rate downlink + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',6); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Reserved,Signalling Indication,Source Statistics Descriptor + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_1'}),'0',3); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_1'}),'0',1); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_1'}),'0',4); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Maximum bit rate downlink (ext) + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + + //Guaranteed bit rate downlink (ext) + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + + //Maximum bit rate uplink (ext) + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + + //Guaranteed bit rate uplink (ext) + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $pdp1=$orgValue; + //echo "
      xxx=$orgValue"; + //exit(); + + //pdp context(group 2) + $orgValue=""; + $i=0; + $orgValue=$orgValue.omc_keep_length(${$pdpContextDef[$i][0].'_2'},"0","2","0"); + $i++; + + //echo "
      xxx=$orgValue"; + + $tmpValue="0000"; + $tmpValue=setBitValue($tmpValue,"0.0-1.7",DECHEX(${$pdpContextDef[$i][0].'_2'})); + + $tmpValue=omc_keep_length($tmpValue,"0","4","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + + + if(${$pdpContextDef[$i-1][0].'_2'}==289){ + $tmpValue="04"; + $tmpValueArr=explode(".",${$pdpContextDef[$i][0].'_2'}); + $iplen=sizeof($tmpValueArr); + for($j=0;$jxxx=$orgValue"; +/* + $orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_2'}; + $i++; + //echo "
      xxx=$orgValue"; + + $orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_2'}; + $i++; + //echo "
      xxx=$orgValue"; +*/ + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_2'}),'0',3); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_2'}),'0',3); + $i++; + //echo "tmpBinValue=$tmpBinValue"; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + $orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_2'}; + $i++; + //echo "
      xxx=$orgValue"; + + $orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_2'}; + $i++; + //echo "
      xxx=$orgValue"; + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + + $tmpValue=""; + $tmpValue_1=${$pdpContextDef[$i][0].'_2'}; + for($j=0;$jxxx=$orgValue"; + + //exit(); + + + //pdp context(group 3) + $orgValue=""; + $i=0; + $orgValue=$orgValue.omc_keep_length(${$pdpContextDef[$i][0].'_3'},"0","2","0"); + + $i++; + + //echo "
      xxx=$orgValue"; + + $tmpValue="0000"; + $tmpValue=setBitValue($tmpValue,"0.0-1.7",DECHEX(${$pdpContextDef[$i][0].'_3'})); + $tmpValue=omc_keep_length($tmpValue,"0","4","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + + + $tmpValue=""; + if(${$pdpContextDef[$i-1][0].'_3'}==289){ + $tmpValue="04"; + $tmpValueArr=explode(".",${$pdpContextDef[$i][0].'_3'}); + $iplen=sizeof($tmpValueArr); + for($j=0;$jxxx=$orgValue"; +/* + $orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_3'}; + $i++; + //echo "
      xxx=$orgValue"; + + $orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_3'}; + $i++; + //echo "
      xxx=$orgValue"; +*/ + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',3); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',3); + $i++; + //echo "tmpBinValue=$tmpBinValue"; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + //echo "
      xxx=$orgValue"; + //exit(); + + $orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_3'}; + $i++; + //echo "
      xxx=$orgValue"; + + $orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_3'}; + $i++; + //echo "
      xxx=$orgValue"; + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + //echo "
      xxx=$orgValue"; + + $tmpValue=""; + $tmpValue_1=${$pdpContextDef[$i][0].'_3'}; + for($j=0;$jtmpBinValue=$tmpBinValue"; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_3'}),'0',3); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_3'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_3'}),'0',3); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Maximum SDU size + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + + //Maximum bit rate for uplink + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',6); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Maximum bit rate for downlink + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',6); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Residual Bit Error Rate ,SDU error ratio + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',4); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',4); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + // Transfer delay ,Traffic handing priority + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',6); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',2); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Guaranteed bit rate uplink + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',6); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Guaranteed bit rate downlink + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',2); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',6); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Reserved,Signalling Indication,Source Statistics Descriptor + $tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_3'}),'0',3); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_3'}),'0',1); + $i++; + $tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_3'}),'0',4); + $i++; + $tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2); + $orgValue=$orgValue.$tmpHexValue; + + //Maximum bit rate downlink (ext) + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + + //Guaranteed bit rate downlink (ext) + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + + //Maximum bit rate uplink (ext) + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + $i++; + + //Guaranteed bit rate uplink (ext) + $tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1"); + $orgValue=$orgValue.$tmpValue; + + $pdp3=$orgValue; + //echo "
      xxx=$orgValue"; + + //exit(); + +/* + //找出原有的各个字段的值,来比较,确定各个字段是否改变 + $oldDateSql="SELECT * FROM HLR_DB.subscriberData WHERE imsi='$imsi'"; + $result=@mysql_db_query('HLR_DB',$oldDateSql); + echo mysql_error(); + $rows=@mysql_fetch_array($result); +*/ + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$itmpFieldName not change!"; + continue; + } +*/ + $tmp_dataNum = $_POST['tmp_dataNum']; + $tmp_faxNum = $_POST['tmp_faxNum']; + $tmp_interMsisdn = $_POST['tmp_interMsisdn']; + //echo "$tmp_dataNum, $tmp_faxNum, $tmp_interMsisdn
      "; + //echo "$dataNum,$faxNum,$interMsisdn
      "; + if($tmp_interMsisdn==$interMsisdn && $i==3) + continue; + if($tmp_faxNum==$faxNum && $i==4) + continue; + if($tmp_dataNum==$dataNum && $i==5) + continue; + + ${'checkBox_'.$endNo} =1; + ${'fieldName_'.$endNo}=$tmpFieldName; + ${'editValue_'.$endNo}=${$tmpFieldName}; + if($DEBUG) echo "
      checkBox_$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + if($canSetNum != 'all' && $endNo > $canSetNum){ + break; + } + } + //if($DEBUG) exit(); +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $_REQUEST['isLoadIndex']) { + $fieldNameList = "imsi,inter_msisdn,fax_num,data_num,used_flag,nam,camel_flag"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +$DEBUG=0; +?> + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + +
      " > + + + + + + 0){ + if($isBatchCreate> 0){ + ?> + + + + =4){ + ?> + + + + + + + + + + + + + + +
      + + + + + + + +     + Batch amount(<=100): + + "; + else + echo ""; + ?> + + + " name="isBatchCreate"> + + + + + + + + + "; + else + echo ""; + ?> + + + + "; + else + echo ""; + ?> + + + "; + else + echo ""; + ?> + +  
      +
      + + + + + + + + + 0){ + //imsi + $imsi=$tmpRow[imsi]; + echo "\n "; + echo ""; + $seqNo++; + if($isBatchCreate > 0) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + //修改用户数据时不能将这个数据给hlr + //echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; + +//imsi flag +$used_flag=$tmpRow[used_flag]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//network access mode +$nam = $tmpRow[nam]; +$namDef=array( + array('00','Both'), + array('01','Non-GPRS only'), + array('02','GPRS only'), + ); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Inter MSISDN +$interMsisdn=$tmpRow[inter_msisdn]; +$interMsisdn=decodeTelNumber($interMsisdn); +$tmp_interMsisdn=$interMsisdn; +echo ""; +echo "\n "; +echo ""; +$seqNo++; +if($isBatchCreate > 0) + echo ""; +else + echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Fax number (add by Arwean) +$faxNum=$tmpRow[fax_num]; +$faxNum=decodeTelNumber($faxNum); +$tmp_faxNum = $faxNum; +if($isTryCreate>0) + $faxNum=''; +echo ""; +echo "\n"; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo ""; + +//Data number +$dataNum=$tmpRow[data_num]; +$dataNum=decodeTelNumber($dataNum); +$tmp_dataNum = $dataNum; +if($isTryCreate>0) + $dataNum=''; + +echo ""; +echo "\n"; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo ""; + +//(end add by Arwean) + + +//Category +$category=$tmpRow[category]; +$categoryDef=array( + array('00','Unknown'), + array('01','French language'), + array('02','English language'), + array('03','German language'), + array('04','Russian language'), + array('05','Spanish language'), + array('0A','Ordinary'), + array('0B','Subscriber with priority'), + ); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//ODB status +$sub_status=$tmpRow[sub_status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//ODB general data +$odbGeneral=$tmpRow[odb_general]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//ODB specific data +$odbSpecific=$tmpRow[odb_specific]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Tele service +$tele_data=$tmpRow[tele_data]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//RSZI LIST +$rszi=$tmpRow[rszi]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//CSRR TYPE +$csr_type=$tmpRow[csr_type]; +$cstTypeDef=array( + array('00','00'), + array('01','01'), + array('02','02'), + array('03','03'), + array('04','04'), + array('05','05'), + array('06','06'), + array('07','07'), + array('255','No restriction') +); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CLIP +$clip_state=$tmpRow[clip_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Bearer capability type (add by Arwean) +//echo "bc_type:" . $tmpRow[bc_type]; +$bc_type = $tmpRow[bc_type]; +$dataIdVar = substr($bc_type,0,1); +$faxIdVar = substr($bc_type,1,1); +$faxIdDf=array( + array('0','00'), + array('1','01'), + array('2','02'), + array('3','03'), + array('4','04'), + array('5','05'), + array('6','06'), + array('7','07'), + array('8','08'), + array('9','09'), + array('10','10'), + array('11','11'), + array('12','12'), + array('13','13'), + array('14','14'), + array('15','15') + ); + +$dataIdDf=array( + array('0','00'), + array('1','01'), + array('2','02'), + array('3','03'), + array('4','04'), + array('5','05'), + array('6','06'), + array('7','07'), + array('8','08'), + array('9','09'), + array('10','10'), + array('11','11'), + array('12','12'), + array('13','13'), + array('14','14'), + array('15','15') + ); +echo "\n"; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; +echo ""; + +//(end add by Arwean) + + +//CLIR +$clir_state=$tmpRow[clir_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//COLP +$colp_state=$tmpRow[colp_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//COLR +$colr_state=$tmpRow[colr_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Call barring subscription +$subs_option=$tmpRow[subs_option]; +$subsOptionDef=array( + array('00','Service provider'), + array('01','Subscriber using password'), + array('02','Subscriber not using password') + ); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +$tmpValue=hexdec($subs_option); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//SS call barring password +$passwd=$tmpRow[passwd]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//BAOC +$baoc_state=$tmpRow[baoc_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//BOIC +$boic_state=$tmpRow[boic_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//BOIC-exHPLMN +$boichc_state=$tmpRow[boichc_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//BAIC +$baic_state=$tmpRow[baic_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//BIC-ROAM +$bicroam_state=$tmpRow[bicroam_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFU state +$cfu_state =$tmpRow[cfu_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFU number +$cfuNumber=$tmpRow[cfu_num]; +$cfuNumber=decodeTelNumber($cfuNumber); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFB state +$cfb_state =$tmpRow[cfb_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFB number +$cfbNumber=$tmpRow[cfb_num]; +$cfbNumber=decodeTelNumber($cfbNumber); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFNRy state +$cfnry_state =$tmpRow[cfnry_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFNRy number +$cfnryNumber=$tmpRow[cfnry_num]; +$cfnryNumber=decodeTelNumber($cfnryNumber); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFNRy timer +$cfnry_time=$tmpRow[cfnry_time]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFNRc state +$cfnrc_state =$tmpRow[cfnrc_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CFNRc number +$cfnrcNumber=$tmpRow[cfnrc_num]; +$cfnrcNumber=decodeTelNumber($cfnrcNumber); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Call waiting state +$callwait_state=$tmpRow[callwait_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Call hold state +$callhold_state=$tmpRow[callhold_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Explicit call transfer +$ect_state=$tmpRow[ect_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Multi-party state +$mtpy_state=$tmpRow[mtpy_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//emlpp state +$emlpp_state=$tmpRow[emlpp_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//emlpp_max_priority +$emlpp_max_priority=$tmpRow[emlpp_max_priority]; +$emlpp_max_priority_FlagDef=array( + array('06','Level A'), + array('05','Level B'), + array('00','Level 0'), + array('01','Level 1'), + array('02','Level 2'), + array('03','Level 3'), + array('04','Level 4') + ); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//emlpp_def_priority +$emlpp_def_priority=$tmpRow[emlpp_def_priority]; +$emlpp_def_priority_FlagDef=array( + array('06','Level A'), + array('05','Level B'), + array('00','Level 0'), + array('01','Level 1'), + array('02','Level 2'), + array('03','Level 3'), + array('04','Level 4') + ); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//camel_flag +$camel_flag=$tmpRow[camel_flag]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//MS purge flag +$purgeMsFlag=$tmpRow[purgems_flag]; +$purgeMsFlagDef=array( +// array('GSM Network', '00.0'), + array('GSM ', '00.0'), + array('GPRS', '00.1') +); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//GPRS FLAG +$gprs_flag=$tmpRow[gprs_flag]; +$gprsFlagDef=array( + array('00','Disable'), + array('01','Enable') + ); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//pdp context (group 1) +$pdp_1=$tmpRow[pdp1]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; + + +echo ""; +echo ""; + +//pdp context (group 2) +$pdp_2=$tmpRow[pdp2]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; + +echo ""; +echo ""; + + +//pdp context (group 3) +$pdp_3=$tmpRow[pdp3]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; + +echo ""; +echo ""; + + + +//User name +$user_name=$tmpRow[user_name]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//User certificate +$user_certifiacate=$tmpRow[user_certifiacate]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//VLR number +$vlrNumber=$tmpRow[vlr_num]; +$vlrNumber=decodeTelNumber($vlrNumber); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//MSC number +$mscNumber=$tmpRow[msc_num]; +$mscNumber=decodeTelNumber($mscNumber); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +?> +
      No.NameValueDescription
      $seqNo Start IMSIIMSI"; + echo ""; + echo "IMSI=MCC+MNC+MSIN
      "; + echo "MCC=mobile country code, MNC=mobile network code, MSIN=mobile subscriber identity number.
      "; + echo "
      $seqNo IMSI flag"; +if('01' == $used_flag){ + echo "Enable"; + echo "      "; + echo "Disable"; +}else{ + echo "Enable"; + echo "      "; + echo "Disable"; +} +echo "Enable or disable IMSI. "; +echo "Disable means all services turned off"; +echo "
      $seqNo Network access mode"; +echo "Define what kind of network supported
      $seqNo Start MSISDNMSISDN"; +echo ""; +echo "Mobile station international ISDN number, MSISDN=CC+NDC+SN
      "; +echo "CC=country code, NDC=national domestic code, SN=subscriber phone number"; +echo "
      $seqNo Fax number "; + echo ""; + echo ""; + echo "ISDN number plan + ISDN number
      ISDN=CC+NDC+SN=subscriber phone number
      CC=country code, NDC=national domestic code"; + echo "
      $seqNo Data number "; + echo ""; + echo ""; + echo "ISDN number plan + ISDN number
      ISDN=CC+NDC+SN=subscriber phone number
      CC=country code, NDC=national domestic code"; + echo "
      $seqNo Category"; +echo ""; +echo "Calling party defined in ISUP. Default is Ordinary
      $seqNo ODB status"; +echo ""; +echo "A flag indicating whether a subscriber is subject to operator determined barring. "; +echo "Default is service granted"; +echo "
      $seqNo ODB general data"; +$preValue=""; +echo ""; +for($i=0;$i{$odbGeneralDef[$i][2]}
      "; + $preValue.="{$odbGeneralDef[$i][2]},"; + }else{ + echo "{$odbGeneralDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      BAOC (Barring of all outgoing calls)"; +echo "
      BOIC (Barring of all outgoing international calls)"; +echo "
      BOIC-HPLMN (ODB BOIC except those directed to home PLMN)"; +echo "
      BPRIC (Bar of premium rate (information) call)"; +echo "
      BPREC (Bar of premium rate (entertainment) call)"; +echo "
      BASS (Bar of supplementary service access)"; +echo "
      BAIC (Barring of all incoming calls)"; +echo "
      BAIC-ROAM (ODB BAIC when roaming outside home PLMN)"; +echo "
      Roaming (Barring of roaming outside home PLMN)"; +echo "
      Roaming CT (Barring of roaming outside home PLMN country)"; +echo "
      $seqNo ODB specific data"; +$preValue=""; +echo ""; +for($i=0;$i{$odbSpecificDef[$i][2]}
      "; + $preValue.="{$odbSpecificDef[$i][2]},"; + }else{ + echo "{$odbSpecificDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Operator Specific Barring (OSB)
      "; +echo "
      $seqNo Tele service"; +$preValue=""; +echo ""; +for($i=0;$i{$teleDataDef[$i][2]}
      "; + $preValue.="{$teleDataDef[$i][2]},"; + }else{ + echo "{$teleDataDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Default=all services turn on.
      $seqNo RSZI list"; +for($i=0;$i<10;$i++){ + $value = substr($rszi,$i*2,2); + $value = hexdec($value); + if($i<10) + echo "RSZI0$i"; + else + echo "RSZI$i"; + echo ""; + echo ""; + echo ""; + if ($i%2==1){ + echo "
      "; + }else{ + echo "    "; + } +} + +//echo ""; +echo "
      Regional subscriptiong zone identity list. A PLMN specific regional subscription defines unambiguously for the entire PLMN the region in which roaming is allowed.
      $seqNo CSRR type"; +echo "Define 8 CSRR (county specific roaming restrictions) types' attribute to confine the international roaming range of a subscriber.Each CSRR defines roaming restrictions for 256 VPLMNs.There are 8 CSRR combination types.
      $seqNo CLIP state"; +$preValue=""; +echo ""; +for($i=0;$i{$clipStateDef[$i][2]}
      "; + $preValue.="{$clipStateDef[$i][2]},"; + }else{ + echo "{$clipStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Calling line identification presentation state, set on called party
      Provisioned=Called party displays caller number (given caller party set CLIR as Not provisioned)
      Not provisioned=Called party does not display caller number
      $seqNo BC type "; + echo "GsmBC id for fax : "; + echo ""; + echo "
      "; + $tmpValue=hexdec($faxIdVar); + echo ""; + echo ""; + echo ""; + + echo "GsmBC id for data: "; + echo ""; + $tmpValue=hexdec($dataIdVar); + echo ""; + echo ""; + echo ""; + + echo "
      "; + echo "Define 16 BC(Bearer Capability) type's attribution respectively for fax's and data's GsmBC id "; + echo "
      $seqNo CLIR state"; +$preValue=""; +echo ""; +for($i=0;$i{$clirStateDef[$i][2]}
      "; + $preValue.="{$clirStateDef[$i][2]},"; + }else{ + echo "{$clirStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Calling line identification restriction state, set on caller party
      Provisioned=called party does not display caller number
      Not provisioned=caller party displays caller number (given called party set CLIP as Provisioned)
      $seqNo COLP state"; +$preValue=""; +echo ""; +for($i=0;$i{$colpStateDef[$i][2]}
      "; + $preValue.="{$colpStateDef[$i][2]},"; + }else{ + echo "{$colpStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Connected line identification presentation state, set on caller party
      Provisioned=caller party displays called number including forwarded number (given called party set COLR as Not provsioned)
      Not provisioned=caller party does not display called number
      $seqNo COLR state"; +$preValue=""; +echo ""; +for($i=0;$i{$colrStateDef[$i][2]}
      "; + $preValue.="{$colrStateDef[$i][2]},"; + }else{ + echo "{$colrStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Connected line identification restriction state, set on called party
      Provisioned=caller party does not display called number
      Not provisioned=caller party displays called number (given caller party set COLP as provisioned)
      $seqNo Call barring subscription"; +echo "Define call barring service subscription mode for all call barring
      $seqNoSS call barring password "; +echo ""; +echo "For barring service conntrolled by subscriber, "; +echo "used for all call barring. Only use digit '0'-'9'
      $seqNo BAOC state"; +$preValue=""; +echo ""; +for($i=0;$i{$baocStateDef[$i][2]}
      "; + $preValue.="{$baocStateDef[$i][2]},"; + }else{ + echo "{$baocStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Barring of all outgoing calls
      $seqNo BOIC state"; +$preValue=""; +echo ""; +for($i=0;$i{$boicStateDef[$i][2]}
      "; + $preValue.="{$boicStateDef[$i][2]},"; + }else{ + echo "{$boicStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Barring of all outgoing international calls
      $seqNo BOIC HPLMN state"; +$preValue=""; +echo ""; +for($i=0;$i{$boicExStateDef[$i][2]}
      "; + $preValue.="{$boicExStateDef[$i][2]},"; + }else{ + echo "{$boicExStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      BOIC except directed to home HPLMN
      $seqNo BAIC state"; +$preValue=""; +echo ""; +for($i=0;$i{$baicStateDef[$i][2]}
      "; + $preValue.="{$baicStateDef[$i][2]},"; + }else{ + echo "{$baicStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Barring of all incoming calls
      $seqNo BIC ROAM state"; +$preValue=""; +echo ""; +for($i=0;$i{$bicroamStateDef[$i][2]}
      "; + $preValue.="{$bicroamStateDef[$i][2]},"; + }else{ + echo "{$bicroamStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      BIC when roaming outside home PLMN
      $seqNo CFU"; +$preValue=""; +echo ""; +for($i=0;$i{$cfuStateDef[$i][2]}
      "; + $preValue.="{$cfuStateDef[$i][2]},"; + }else{ + echo "{$cfuStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      State of call forwarding unconditional
      $seqNo CFU number"; +echo ""; +echo " 
      $seqNo CFB"; +$preValue=""; +echo ""; +for($i=0;$i{$cfbStateDef[$i][2]}
      "; + $preValue.="{$cfbStateDef[$i][2]},"; + }else{ + echo "{$cfbStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      State of call forwarding on mobile subscriber busy
      $seqNo CFB number"; +echo ""; +echo " 
      $seqNo CFNRy"; +$preValue=""; +echo ""; +for($i=0;$i{$cfnryStateDef[$i][2]}
      "; + $preValue.="{$cfnryStateDef[$i][2]},"; + }else{ + echo "{$cfnryStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      State of call forwarding on no reply
      $seqNo CFNRy number"; +echo ""; +echo " 
      $seqNo CFNRy timer"; +echo ""; +echo "Indicates \"no reply condition timer\", ranges from 5 to 30 seconds on a steps of 5-second +
      $seqNo CFNRc"; +$preValue=""; +echo ""; +for($i=0;$i{$cfnrcStateDef[$i][2]}
      "; + $preValue.="{$cfnrcStateDef[$i][2]},"; + }else{ + echo "{$cfnrcStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      State of call forwarding on mobile subscriber not reachable
      $seqNo CFNRc number"; +echo ""; +echo " 
      $seqNo Call waiting state"; +$preValue=""; +echo ""; +for($i=0;$i{$callWaitingStateDef[$i][2]}
      "; + $preValue.="{$callWaitingStateDef[$i][2]},"; + }else{ + echo "{$callWaitingStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Call waiting state
      $seqNo Call hold state"; +$preValue=""; +echo ""; +for($i=0;$i{$callHoldStateDef[$i][2]}
      "; + $preValue.="{$callHoldStateDef[$i][2]},"; + }else{ + echo "{$callHoldStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Call hold state
      $seqNo ECT state"; +$preValue=""; +echo ""; +for($i=0;$i{$ectStateDef[$i][2]}
      "; + $preValue.="{$ectStateDef[$i][2]},"; + }else{ + echo "{$ectStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Explicit call transfer state
      $seqNo Multi-party state"; +$preValue=""; +echo ""; +for($i=0;$i{$mtpyStateDef[$i][2]}
      "; + $preValue.="{$mtpyStateDef[$i][2]},"; + }else{ + echo "{$mtpyStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      Multi-party call state
      $seqNo eMLPP state"; +$preValue=""; +echo ""; +for($i=0;$i{$emlppStateDef[$i][2]}
      "; + $preValue.="{$emlppStateDef[$i][2]},"; + }else{ + echo "{$emlppStateDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      eMLPP state
      $seqNo eMLPP Max Priority"; +echo "eMLPP Max Priority
      $seqNo eMLPP Default Priority"; +echo "eMLPP Default Priority
      $seqNo Camel flag"; +$preValue=""; +echo ""; +for($i=0;$i{$CamelFlagDef[$i][2]}
      "; + $preValue.="{$CamelFlagDef[$i][2]},"; + }else{ + echo "{$CamelFlagDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      CAMEL service enable or disable"; +echo "
      Support CAMEL is a total flag of CAMEL provisioning. To enable any CAMEL service, select this option"; +echo "
      O-CSI: Originating CAMEL subscription information"; +echo "
      T-CSI: Terminating CAMEL subscription information"; +echo "
      SS-CSI: Supplementary service notification CAMEL subscription information"; +echo "
      SMS-CSI: Short message service notification CAMEL subscrition information"; +echo "
      GPRS-CSI: GPRS notification CAMEL subscription information"; +echo "
      $seqNo Purge MS flag"; +for($i=0;$ionline
      "; + }else{ + echo "{$purgeMsFlagDef[$i][0]}: offline
      "; + } +} +echo "
      Status of MS purge. Online=MS not purged. Offline=MS purged
      $seqNo GPRS flag"; +echo "GPRS service flag
      $seqNo PDP context (group 1)"; +echo ""; +$i=0; +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +if('01' == $pdpValue){ + echo "Enable"; + echo " "; + echo "Disable"; +}else{ + echo "Enable"; + echo " "; + echo "Disable"; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +echo ""; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + + + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$addressLen=hexdec(getBitValue($pdp_1,$pdpContextDef[35][1])); +//echo "addressLen=$addressLen"; +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +//$xxxxxxxxx=getBitValue($pdp_1,$pdpContextDef[$i-1][1]); +//echo "xxxxxxxxxx=$xxxxxxxxx"; +if('289' == HEXDEC(getBitValue($pdp_1,$pdpContextDef[$i-1][1]))){ + $tmpPdpValue=HEXDEC(substr($pdpValue,0,2)).'.'.HEXDEC(substr($pdpValue,2,2)).'.'.HEXDEC(substr($pdpValue,4,2)).'.'.HEXDEC(substr($pdpValue,6,2)); + if($addressLen == 0) + $tmpPdpValue=""; + echo ""; +}else if('343' == HEXDEC(getBitValue($pdp_1,$pdpContextDef[$i-1][1]))){ + $tmpPdpValue=substr($pdpValue,0,4).':'.substr($pdpValue,4,4).':'.substr($pdpValue,8,4).':'.substr($pdpValue,12,4).':'.substr($pdpValue,16,4).':'.substr($pdpValue,20,4).':'.substr($pdpValue,24,4).':'.substr($pdpValue,28,4); + echo ""; +}else{ + $tmpArr=explode("E",$pdpValue); + $tmpPdpValue=$tmpArr[0]; + echo ""; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "   "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo " "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +if('01' == $pdpValue){ + echo "Allowed"; + echo "  "; + echo "Not allowed"; +}else{ + echo "Allowed"; + echo "  "; + echo "Not allowed"; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +$j=0; +$tmpPdpValue=""; +if($pdpValue!=""){ + for($j=0;$j<64;$j+=2){ + if($pdpValue[$j]=='0'&&$pdpValue[$j+1]=='0') + break; + $tmp=sprintf("%c",HEXDEC(substr($pdpValue,$j,2))); + $tmpPdpValue=$tmpPdpValue.$tmp; + } +} + +echo "{$pdpContextDef[$i][2]}:"; +echo "                   "; +echo ""; +echo ""; +echo ""; +$i++; +echo ""; +echo "
      "; + +//Ext Flag +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "              "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Allocation/Retention Priority +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "Ext Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + + +//Delivery err SDUs +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "          "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Delivery order +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "               "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Traffic class +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                   "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum SDU size +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for uplink range +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "     "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for uplink base +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "           "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for downlink range +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo " "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for downlink base +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//SDU error ratio +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Residual Bit Error Rate +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Traffic handing priority +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "             "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Transfer delay +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                         "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink range +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink base +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "              "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink range +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "    "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink base +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "          "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Source statistics descriptor +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "Ext2 Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "             "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Signalling Indication +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Reserved +/*$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                                "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +//echo ""; +*/$i++; + +//Maximum bit rate downlink(ext) +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "      "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink(ext) +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "  "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate uplink(ext) +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "Ext3 Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "          "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink(ext) +$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +//debug_log("/tmp/debug.txt","pdpValue=$pdpValue"); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; + +echo "
      PDP context identifier: 1-3."; +echo "
      PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25"; +echo "
      PDP Address:"; +echo "
      IPv4 Len = 4, "; +echo "
      IPv6 Len = 16, "; +echo "
      X.25 Len = 3 to 9, "; +echo "
      Empty Address· Field of any type has Len =0"; +echo "
      QoS"; +echo "
      Reliability Class:"; +echo "
      1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic"; +echo "
      2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic"; +echo "
      3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic"; +echo "
      4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss"; +echo "
      Delay Class: 1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort)"; +echo "
      Precedence Class: 1 = High, 2 = Normal, 3 = Low"; +echo "
      Peak Throughput 1 through 9 (8 Kbps to 2.048 Kbps)"; +echo "
      Mean Throughput 1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort)"; +echo "
      VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed"; +echo "
      APN:Specific APN name APN is made of one or more labels. Each label is made of a length byte and that many number of octets coded in ASCII of A-Z, a-z, 0-9, and “-“(dash). APN cannot exceed 63 octets. It should not start with strings “rac”,”lac” or “sgsn” and it should not end with “.gprs”. APN stored at HLR is not terminated by a length byte of zero.Wild card “*” Len = 1 and single octet coded with ASCII of asterisks."; +echo "
      Ext Flag:0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos."; +echo "
      Ext Qos"; +echo "
      Allocation/Retention Priority:There are four priority : Priority 1,Priority 2,Priority 3,Priority 4."; +echo "
      Delivery err SDUs:1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved"; +echo "
      Delivery order:1 =with delivery order,2 = without delivery order,3 = Reserved"; +echo "
      Traffic class:1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved"; +echo "
      Maximum SDU size:Giving a range of values from 10 octets to 1520 octets"; +echo "
      1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved"; +echo "
      Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Maximum bit rate for uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Maximum bit rate for downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      SDU error ratio:The range is from 5E-2 to 6E-8,1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved"; +echo "
      Residual Bit Error Rate:The range is from 1E-1 to 1E-6,1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3,6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved"; +echo "
      Traffic handing priority:1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved"; +echo "
      Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms"; +echo "
      Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Guaranteed bit rate uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Guaranteed bit rate downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Ext2 Qos"; +echo "
      Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW)"; +echo "
      Signalling Indication:0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic."; +echo "
      Reserved:66.5-66.7"; +echo "
      Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; +echo "
      Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps)250(256Mbps)"; +echo "
      Ext3 Qos"; +echo "
      Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; +echo "
      Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; +echo "
      $seqNo PDP context (group 2)"; +echo ""; +$i=0; +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +if('01' == $pdpValue){ + echo "Enable"; + echo " "; + echo "Disable"; +}else{ + echo "Enable"; + echo " "; + echo "Disable"; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +echo ""; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$tmpPdpValue=""; +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$addressLen=hexdec(getBitValue($pdp_2,$pdpContextDef[35][1])); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +if('289' == HEXDEC(getBitValue($pdp_2,$pdpContextDef[$i-1][1]))){ + $tmpPdpValue=HEXDEC(substr($pdpValue,0,2)).'.'.HEXDEC(substr($pdpValue,2,2)).'.'.HEXDEC(substr($pdpValue,4,2)).'.'.HEXDEC(substr($pdpValue,6,2)); + if($addressLen == 0) + $tmpPdpValue=""; + echo ""; +}else if('343' == HEXDEC(getBitValue($pdp_2,$pdpContextDef[$i-1][1]))){ + $tmpPdpValue=substr($pdpValue,0,4).':'.substr($pdpValue,4,4).':'.substr($pdpValue,8,4).':'.substr($pdpValue,12,4).':'.substr($pdpValue,16,4).':'.substr($pdpValue,20,4).':'.substr($pdpValue,24,4).':'.substr($pdpValue,28,4); + echo ""; +}else{ + $tmpArr=explode("E",$pdpValue); + $tmpPdpValue=$tmpArr[0]; + echo ""; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "   "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo " "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +if('01' == $pdpValue){ + echo "Allowed"; + echo "  "; + echo "Not allowed"; +}else{ + echo "Allowed"; + echo "  "; + echo "Not allowed"; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +$j=0; +$tmpPdpValue=""; +if($pdpValue!=""){ + for($j=0;$j<64;$j+=2){ + if($pdpValue[$j]=='0'&&$pdpValue[$j+1]=='0') + break; + $tmp=sprintf("%c",HEXDEC(substr($pdpValue,$j,2))); + $tmpPdpValue=$tmpPdpValue.$tmp; + } +} +echo "{$pdpContextDef[$i][2]}:"; +echo "                   "; +echo ""; +echo ""; +echo ""; +$i++; +echo ""; +echo "
      "; + +//Ext Flag +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "              "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Allocation/Retention Priority +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "Ext Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Delivery err SDUs +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "          "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Delivery order +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "               "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Traffic class +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                   "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum SDU size +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for uplink range +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "     "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for uplink base +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "           "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for downlink range +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo " "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for downlink base +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//SDU error ratio +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Residual Bit Error Rate +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Traffic handing priority +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "             "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Transfer delay +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                         "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink range +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink base +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "              "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink range +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "    "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink base +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "          "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Source statistics descriptor +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "Ext2 Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "             "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Signalling Indication +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Reserved +/*$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                                "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +//echo ""; +*/ +$i++; + +//Maximum bit rate downlink(ext) +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "      "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink(ext) +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "  "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate uplink(ext) +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "Ext3 Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "          "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink(ext) +$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_2'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; + + +echo ""; +echo "
      "; +echo "
      PDP context identifier: 1-3."; +echo "
      PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25"; +echo "
      PDP Address:"; +echo "
      IPv4 Len = 4, "; +echo "
      IPv6 Len = 16, "; +echo "
      X.25 Len = 3 to 9, "; +echo "
      Empty Address· Field of any type has Len =0"; +echo "
      QoS"; +echo "
      Reliability Class:"; +echo "
      1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic"; +echo "
      2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic"; +echo "
      3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic"; +echo "
      4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss"; +echo "
      Delay Class: 1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort)"; +echo "
      Precedence Class: 1 = High, 2 = Normal, 3 = Low"; +echo "
      Peak Throughput 1 through 9 (8 Kbps to 2.048 Kbps)"; +echo "
      Mean Throughput 1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort)"; +echo "
      VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed"; +echo "
      APN:Specific APN name APN is made of one or more labels. Each label is made of a length byte and that many number of octets coded in ASCII of A-Z, a-z, 0-9, and “-“(dash). APN cannot exceed 63 octets. It should not start with strings “rac”,”lac” or “sgsn” and it should not end with “.gprs”. APN stored at HLR is not terminated by a length byte of zero.Wild card “*” Len = 1 and single octet coded with ASCII of asterisks."; +echo "
      Ext Flag:0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos."; +echo "
      Ext Qos"; +echo "
      Allocation/Retention Priority:There are four priority : Priority 1,Priority 2,Priority 3,Priority 4."; +echo "
      Delivery err SDUs:1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved"; +echo "
      Delivery order:1 =with delivery order,2 = without delivery order,3 = Reserved"; +echo "
      Traffic class:1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved"; +echo "
      Maximum SDU size:Giving a range of values from 10 octets to 1520 octets"; +echo "
      1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved"; +echo "
      Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Maximum bit rate for uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Maximum bit rate for downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      SDU error ratio:The range is from 5E-2 to 6E-8,1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved"; +echo "
      Residual Bit Error Rate:The range is from 1E-1 to 1E-6,1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3,6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved"; +echo "
      Traffic handing priority:1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved"; +echo "
      Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms"; +echo "
      Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Guaranteed bit rate uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Guaranteed bit rate downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Ext2 Qos"; +echo "
      Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW)"; +echo "
      Signalling Indication:0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic."; +echo "
      Reserved:66.5-66.7"; +echo "
      Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; +echo "
      Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps)250(256Mbps)"; +echo "
      Ext3 Qos"; +echo "
      Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; +echo "
      Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; + +echo "
      $seqNo PDP context (group 3)"; +echo ""; +$i=0; +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +if('01' == $pdpValue){ + echo "Enable"; + echo " "; + echo "Disable"; +}else{ + echo "Enable"; + echo " "; + echo "Disable"; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +echo ""; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$addressLen=hexdec(getBitValue($pdp_3,$pdpContextDef[35][1])); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +if('289' == HEXDEC(getBitValue($pdp_3,$pdpContextDef[$i-1][1]))){ + $tmpPdpValue=HEXDEC(substr($pdpValue,0,2)).'.'.HEXDEC(substr($pdpValue,2,2)).'.'.HEXDEC(substr($pdpValue,4,2)).'.'.HEXDEC(substr($pdpValue,6,2)); + if($addressLen == 0) + $tmpPdpValue=""; + echo ""; +}else if('343' == HEXDEC(getBitValue($pdp_3,$pdpContextDef[$i-1][1]))){ + $tmpPdpValue=substr($pdpValue,0,4).':'.substr($pdpValue,4,4).':'.substr($pdpValue,8,4).':'.substr($pdpValue,12,4).':'.substr($pdpValue,16,4).':'.substr($pdpValue,20,4).':'.substr($pdpValue,24,4).':'.substr($pdpValue,28,4); + echo ""; +}else{ + $tmpArr=explode("E",$pdpValue); + $tmpPdpValue=$tmpArr[0]; + echo ""; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "   "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo " "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +if('01' == $pdpValue){ + echo "Allowed"; + echo "  "; + echo "Not allowed"; +}else{ + echo "Allowed"; + echo "  "; + echo "Not allowed"; +} +echo ""; +echo "
      "; +echo ""; +echo ""; +echo ""; +$i++; + +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +$j=0; +$tmpPdpValue=""; +if($pdpValue!=""){ + for($j=0;$j<64;$j+=2){ + if($pdpValue[$j]=='0'&&$pdpValue[$j+1]=='0') + break; + $tmp=sprintf("%c",HEXDEC(substr($pdpValue,$j,2))); + $tmpPdpValue=$tmpPdpValue.$tmp; + } +} +echo "{$pdpContextDef[$i][2]}:"; +echo "                   "; +echo ""; +echo ""; +echo ""; +$i++; +echo ""; +echo "
      "; + +//Ext Flag +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "              "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Allocation/Retention Priority +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "Ext Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Delivery err SDUs +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "          "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Delivery order +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "               "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Traffic class +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                   "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum SDU size +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for uplink range +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "     "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for uplink base +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "           "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for downlink range +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo " "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate for downlink base +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//SDU error ratio +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Residual Bit Error Rate +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "            "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Traffic handing priority +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "             "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Transfer delay +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                         "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink range +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "        "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink base +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "              "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink range +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "    "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink base +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "          "; +//echo ""; +for($j=0;$j{$pdpRateDownUplinkBasDef[$j][1]}"; + }else{ + echo ""; + } +}echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Source statistics descriptor +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "Ext2 Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "             "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Signalling Indication +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Reserved +/*$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_1'; +echo "{$pdpContextDef[$i][2]}:"; +echo "                                "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=BINDEC($pdpValue); +echo ""; +echo ""; +//echo ""; +*/$i++; + +//Maximum bit rate downlink(ext) +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "      "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate downlink(ext) +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "  "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Maximum bit rate uplink(ext) +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "Ext3 Qos"; +echo "
      {$pdpContextDef[$i][2]}:"; +echo "          "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; +$i++; + +//Guaranteed bit rate uplink(ext) +$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]); +$pdpName=$pdpContextDef[$i][0].'_3'; +echo "{$pdpContextDef[$i][2]}:"; +echo "       "; +echo ""; +echo ""; +echo "
      "; +$tmpValue=HEXDEC($pdpValue); +echo ""; +echo ""; +echo ""; + +echo ""; +echo "
      "; +echo "
      PDP context identifier: 1-3."; +echo "
      PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25"; +echo "
      PDP Address:"; +echo "
      IPv4 Len = 4, "; +echo "
      IPv6 Len = 16, "; +echo "
      X.25 Len = 3 to 9, "; +echo "
      Empty Address· Field of any type has Len =0"; +echo "
      QoS"; +echo "
      Reliability Class:"; +echo "
      1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic"; +echo "
      2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic"; +echo "
      3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic"; +echo "
      4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss"; +echo "
      Delay Class: 1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort)"; +echo "
      Precedence Class: 1 = High, 2 = Normal, 3 = Low"; +echo "
      Peak Throughput 1 through 9 (8 Kbps to 2.048 Kbps)"; +echo "
      Mean Throughput 1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort)"; +echo "
      VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed"; +echo "
      APN:Specific APN name APN is made of one or more labels. Each label is made of a length byte and that many number of octets coded in ASCII of A-Z, a-z, 0-9, and “-“(dash). APN cannot exceed 63 octets. It should not start with strings “rac”,”lac” or “sgsn” and it should not end with “.gprs”. APN stored at HLR is not terminated by a length byte of zero.Wild card “*” Len = 1 and single octet coded with ASCII of asterisks."; + +echo "
      Ext Flag:0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos."; +echo "
      Ext Qos"; +echo "
      Allocation/Retention Priority:There are four priority : Priority 1,Priority 2,Priority 3,Priority 4."; +echo "
      Delivery err SDUs:1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved"; +echo "
      Delivery order:1 =with delivery order,2 = without delivery order,3 = Reserved"; +echo "
      Traffic class:1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved"; +echo "
      Maximum SDU size:Giving a range of values from 10 octets to 1520 octets"; +echo "
      1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved"; +echo "
      Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Maximum bit rate for uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Maximum bit rate for downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      SDU error ratio:The range is from 5E-2 to 6E-8,1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved"; +echo "
      Residual Bit Error Rate:The range is from 1E-1 to 1E-6,1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3,6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved"; +echo "
      Traffic handing priority:1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved"; +echo "
      Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms"; +echo "
      Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Guaranteed bit rate uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps)"; +echo "
      Guaranteed bit rate downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)"; +echo "
      Ext2 Qos"; +echo "
      Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW)"; +echo "
      Signalling Indication:0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic."; +echo "
      Reserved:66.5-66.7"; +echo "
      Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; +echo "
      Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps)250(256Mbps)"; +echo "
      Ext3 Qos"; +echo "
      Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; +echo "
      Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)"; +echo "
      $seqNo User name"; +echo ""; +echo "User real name. For post-pay subscriber registration
      $seqNo User certificate"; +echo ""; +echo "User ID
      $seqNo VLR number"; +echo " $vlrNumber"; +echo "VLR E.164 number
      $seqNo MSC number"; +echo " $mscNumber"; +echo "MSC E.164 number
      +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + diff --git a/wxc2_omc/account/priSubsMng/hlrSubsConfig b/wxc2_omc/account/priSubsMng/hlrSubsConfig new file mode 100755 index 0000000..b5f281d --- /dev/null +++ b/wxc2_omc/account/priSubsMng/hlrSubsConfig @@ -0,0 +1,2103 @@ +[para]0[Name]IMSI +[sqlName]imsi[t]input[unit]IMSI[u]00.0-07.7[u] +[v]keepAsc-low-E +[remark] +IMSI=MCC+MNC+MSIN +MCC=mobile country code, MNC=mobile network code, MSIN=mobile subscriber identity number. + +[para]1[Name]IMSI flag +[sqlName]used_flag[t]radio[unit]IMSI flag[u]00.0-00.7[u] +[v]0[opt]Disable +[v]1[opt]Enable +[remark] +Enable or disable IMSI.Disable means all services turned off. + +[para]2[Name]Network access mode +[sqlName]nam[t]select[unit]Network access mode[u]00.0-00.7[u] +[v]0[opt]Both +[v]1[opt]Non-GPRS only +[v]2[opt]GPRS Only +[remark] +Define what kind of network supported. + +[para]3[Name]MSISDN +[sqlName]inter_msisdn[t]input[unit]MSISDN[u]00.0-08.7[u]code +[v]keepHex-low-E +[remark] +Mobile station international ISDN number, MSISDN=CC+NDC+SN.CC=country code, NDC=national domestic code, SN=subscriber phone number. + +[para]4[Name]Fax number +[sqlName]fax_num[t]input[unit]Fax number[u]00.0-08.7[u]code +[v]keepHex-low-E +[remark] +ISDN number plan + ISDN number.ISDN=CC+NDC+SN=subscriber phone number.CC=country code, NDC=national domestic code. + +[para]5[Name]Data number +[sqlName]data_num[t]input[unit]Data number[u]00.0-08.7[u]code +[v]keepHex-low-E +[remark] +ISDN number plan + ISDN number.ISDN=CC+NDC+SN=subscriber phone number.CC=country code, NDC=national domestic code. + +[para]6[Name]Calling Category attributes +[sqlName]category[t]select[unit]Category[u]00.0-00.7[u] +[v]0[opt]Unknown +[v]1[opt]French language +[v]2[opt]English language +[v]3[opt]German language +[v]4[opt]Russian language +[v]5[opt]Spanish language +[v]10[opt]Ordinary +[v]11[opt]subscriber with priory +[remark] +Calling party defined in ISUP. Default is Ordinary. + +[para]7[Name]ODB status +[sqlName]sub_status[t]select[unit]ODB status[u]00.0-00.7[u] +[v]0[opt]Service granted +[v]1[opt]Operator determined barring +[remark]A flag indicating whether a subscriber is subject to operator determined barring.Default is service granted. + +[para]8[Name]ODB general data +[sqlName]odb_general[t]checkbox[unit]BAOC[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BOIC[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BOIC-HPLMN[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BPRIC[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BPREC[u]00.4-00.4[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BASS[u]00.5-00.5[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BAIC[u]02.0-02.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BAIC-ROAM[u]02.1-02.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Roaming[u]02.3-02.3[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Roaming CT[u]02.4-02.4[u] +[v]0[opt]not support +[v]1[opt]support +[remark] +BAOC (Barring of all outgoing calls). +BOIC (Barring of all outgoing international calls). +BOIC-HPLMN (ODB BOIC except those directed to home PLMN). +BPRIC (Bar of premium rate (information) call). +BPREC (Bar of premium rate (entertainment) call). +BASS (Bar of supplementary service access). +BAIC (Barring of all incoming calls). +BAIC-ROAM (ODB BAIC when roaming outside home PLMN). +Roaming (Barring of roaming outside home PLMN). +Roaming CT (Barring of roaming outside home PLMN country). + +[para]9[Name]ODB specific data +[sqlName]odb_specific[t]checkbox[unit]OSB1[u]00.0-00.0[u] +[v]0[opt]Disable +[v]1[opt]Enable +[t]checkbox[unit]OSB2[u]00.1-00.1[u] +[v]0[opt]Disable +[v]1[opt]Enable +[remark] +Operator Specific Barring (OSB) + +[para]10[Name]Tele service +[sqlName]tele_data[t]checkbox[unit]Telephony[u]00.0-00.0[u] +[v]0[opt]Not provide +[v]1[opt]Provide +[t]checkbox[unit]Emergency call[u]00.1-00.1[u] +[v]0[opt]Not provide +[v]1[opt]Provide +[t]checkbox[unit]Short message MT-PP[u]00.2-00.2[u] +[v]0[opt]Not provide +[v]1[opt]Provide +[t]checkbox[unit]Short message MO-PP[u]00.3-00.3[u] +[v]0[opt]Not provide +[v]1[opt]Provide +[remark] +Default=all services turn on. + +[para]11[Name]RSZI List +[sqlName]rszi[t]input[unit]RSZI0[u]00.0-00.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI1[u]01.0-01.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI2[u]02.0-02.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI3[u]03.0-03.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI4[u]04.0-04.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI5[u]05.0-05.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI6[u]06.0-06.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI7[u]07.0-07.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI8[u]08.0-08.7[u]size +[v]toDec-high-0 +[t]input[unit]RSZI9[u]09.0-09.7[u]size +[v]toDec-high-0 +[remark] +Regional subscriptiong zone identity list. A PLMN specific regional subscription defines unambiguously for the entire PLMN the region in which roaming is allowed. + +[para]12[Name]CSRR type +[sqlName]csr_type[t]select[unit]CSRR Type[u]00.0-00.7[u] +[v]0[opt]00 +[v]1[opt]01 +[v]2[opt]02 +[v]3[opt]03 +[v]4[opt]04 +[v]5[opt]05 +[v]6[opt]06 +[v]7[opt]07 +[v]255[opt]No Restriction +[remark] +Define 8 CSRR (county specific roaming restrictions) types' attribute to confine the international roaming range of a subscriber.Each CSRR defines roaming restrictions for 256 VPLMNs.There are 8 CSRR combination types. + +[para]13[Name]CLIP state +[sqlName]clip_state[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Calling line identification presentation state, set on called party.Provisioned=Called party displays caller number (given caller party set CLIR as Not provisioned).Not provisioned=Called party does not display caller number. + +[para]14[Name]BC type +[sqlName]bc_type[t]select[unit]GsmBC id for fax[u]00.0-00.3[u] +[v]0[opt]00 +[v]1[opt]01 +[v]2[opt]02 +[v]3[opt]03 +[v]4[opt]04 +[v]5[opt]05 +[v]6[opt]06 +[v]7[opt]07 +[v]8[opt]08 +[v]9[opt]09 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[t]select[unit]GsmBC id for data[u]00.4-00.7[u] +[v]0[opt]00 +[v]1[opt]01 +[v]2[opt]02 +[v]3[opt]03 +[v]4[opt]04 +[v]5[opt]05 +[v]6[opt]06 +[v]7[opt]07 +[v]8[opt]08 +[v]9[opt]09 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[remark] +Define 16 BC(Bearer Capability) type's attribution respectively for fax's and data's GsmBC id. + +[para]15[Name]CLIR state +[sqlName]clir_state[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Calling line identification restriction state, set on caller party.Provisioned=called party does not display caller number.Not provisioned=caller party displays caller number (given called party set CLIP as Provisioned). + +[para]16[Name]COLP state +[sqlName]colp_state[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Connected line identification presentation state, set on caller party.Provisioned=caller party displays called number including forwarded number (given called party set COLR as Not provsioned).Not provisioned=caller party does not display called number. + +[para]17[Name]COLR state +[sqlName]colr_state[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent state[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Connected line identification restriction state, set on called party.Provisioned=caller party does not display called number.Not provisioned=caller party displays called number (given caller party set COLP as provisioned). + +[para]18[Name]Call barring subscription +[sqlName]subs_option[t]select[unit]CB subscription option[u]00.0-00.7[u] +[v]0[opt]Service provider +[v]1[opt]Subscriber using password +[v]2[opt]Subscriber not using password +[remark] +Define call barring service subscription mode for all call barring. + +[para]19[Name]Call Barring password +[sqlName]passwd[t]input[unit]SS call barring password[u]00.0-03.7[u] +[v]keepAsc-low-0 +[remark] +used for all call barring. Only use digit '0'-'9'. + +[para]20[Name]BAOC state +[sqlName]baoc_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Barring of all outgoing calls. + +[para]21[Name]BOIC state +[sqlName]boic_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Barring of all outgoing international calls. + +[para]22[Name]BOIC-HPLMN state +[sqlName]boichc_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +BOIC except directed to home HPLMN. + +[para]23[Name]BAIC state +[sqlName]baic_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Barring of all incoming calls. + +[para]24[Name]BIC ROAM state +[sqlName]bicroam_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +BIC when roaming outside home PLMN. + +[para]25[Name]CFU +[sqlName]cfu_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Register[u]00.1-00.1[u] +[v]0[opt]Not register +[v]1[opt]Register +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +State of call forwarding unconditional. + +[para]26[Name]CFU number +[sqlName]cfu_num[t]input[unit]ISDN number plan[u]00.0-00.7[u]code +[v]keepHex-high-0 +[unit]ISDN number[u]01.0-08.7[u]code +[v]keepHex-low-E +[remark] + +[para]27[Name]CFB +[sqlName]cfb_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Register[u]00.1-00.1[u] +[v]0[opt]Not register +[v]1[opt]Register +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +State of call forwarding on mobile subscriber busy. + +[para]28[Name]CFB number +[sqlName]cfb_num[t]input[unit]ISDN number plan[u]00.0-00.7[u]code +[v]keepHex-high-0 +[unit]ISDN number[u]01.0-08.7[u]code +[v]keepHex-low-E +[remark] + +[para]29[Name]CFNRy +[sqlName]cfnry_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Register[u]00.1-00.1[u] +[v]0[opt]Not register +[v]1[opt]Register +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +State of call forwarding on no reply. + +[para]30[Name]CFNRy number +[sqlName]cfnry_num[t]input[unit]ISDN number plan[u]00.0-00.7[u]code +[v]keepHex-high-0 +[unit]ISDN number[u]01.0-08.7[u]code +[v]keepHex-low-E +[remark] + +[para]31[Name]CFNRy timer +[sqlName]cfnry_time[t]input[unit]CFNRy timer[u]00.0-00.7[u] +[v]keepHex-high-0 +[remark] +Indicates "no reply condition timer", ranges from 5 to 30 seconds on a steps of 5-second. + +[para]32[Name]CFNRc +[sqlName]cfnrc_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Register[u]00.1-00.1[u] +[v]0[opt]Not register +[v]1[opt]Register +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +State of call forwarding on mobile subscriber not reachable. + +[para]33[Name]CFNRc number +[sqlName]cfnrc_num[t]input[unit]ISDN number plan[u]00.0-00.7[u]code +[v]keepHex-high-0 +[unit]ISDN number[u]01.0-08.7[u]code +[v]keepHex-low-E +[remark] + +[para]34[Name]Call waiting state +[sqlName]callwait_state[t]checkbox[unit]Active[u]00.0-00.0[u] +[v]0[opt]Not active +[v]1[opt]Active +[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Call waiting stat. + +[para]35[Name]Call hold state +[sqlName]callhold_state[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Call hold state. + +[para]36[Name]ECT state +[sqlName]ect_state[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Explicit call transfer state. + +[para]37[Name]Multi-party state +[sqlName]mtpy_state[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +Multi-party call state. + +[para]38[Name]eMLPP State +[sqlName]emlpp_state[t]checkbox[unit]Provision[u]00.2-00.2[u] +[v]0[opt]Not provision +[v]1[opt]Provision +[t]checkbox[unit]Quiescent[u]00.3-00.3[u] +[v]0[opt]Not quiescent +[v]1[opt]Quiescent +[remark] +eMLPP State. + +[para]39[Name]eMLPP Max Priority +[sqlName]emlpp_max_priority[t]select[unit]Max Priority[u]00.0-00.7[u] +[v]6[opt]Level A +[v]5[opt]Level B +[v]0[opt]Level 0 +[v]1[opt]Level 1 +[v]2[opt]Level 2 +[v]3[opt]Level 3 +[v]4[opt]Level 4 +[remark] +eMLPP Max Priority + +[para]40[Name]Default Priority +[sqlName]emlpp_def_priority[t]select[unit]Default Priority[u]00.0-00.7[u] +[v]6[opt]Level A +[v]5[opt]Level B +[v]0[opt]Level 0 +[v]1[opt]Level 1 +[v]2[opt]Level 2 +[v]3[opt]Level 3 +[v]4[opt]Level 4 +[remark] +eMLPP Default Priority. + +[para]41[Name]Camel Flag +[sqlName]camel_flag[t]checkbox[unit]CAMEL[u]00.7-00.7[u] +[v]1[opt]Supported +[v]0[opt]Not Supported +[t]checkbox[unit]O-CSI[u]01.0-01.0[u] +[v]1[opt]Provided +[v]0[opt]Not Provided +[t]checkbox[unit]T-CSI[u]01.1-01.1[u] +[v]1[opt]Provided +[v]0[opt]Not Provided +[t]checkbox[unit]SS-CSI[u]01.2-01.2[u] +[v]1[opt]Provided +[v]0[opt]Not Provided +[t]checkbox[unit]SMS-CSI[u]01.3-01.3[u] +[v]1[opt]Provided +[v]0[opt]Not Provided +[t]checkbox[unit]GPRS-CSI[u]01.4-01.4[u] +[v]1[opt]Provided +[v]0[opt]Not Provided +[remark]CAMEL service enable or disable. +Support CAMEL is a total flag of CAMEL provisioning. To enable any CAMEL service, select this option. +O-CSI: Originating CAMEL subscription information. +T-CSI: Terminating CAMEL subscription information. +SS-CSI: Supplementary service notification CAMEL subscription information. +SMS-CSI: Short message service notification CAMEL subscrition information. +GPRS-CSI: GPRS notification CAMEL subscription information. + +[para]42[Name]Purge MS flag +[sqlName]purgems_flag[t]show[unit]GSM [u]00.0-00.0[u] +[v]0[opt]Online +[v]1[opt]Offline +[t]show[unit]GPRS[u]00.1-00.1[u] +[v]0[opt]Online +[v]1[opt]Offline +[remark] +Status of MS purge. Online=MS not purged. Offline=MS purged. + +[para]43[Name]GPRS flag +[sqlName]gprs_flag[t]select[unit]GPRS flag[u]00.0-00.7[u] +[v]0[opt]Disable +[v]1[opt]Enable +[remark] +GPRS service flag + +[para]44[Name]PDP context (group 1) +[sqlName]pdp1[t]radio[unit]PDP flag[u]00.0-00.7[u] +[v]0[opt]Disable +[v]1[opt]Enable +[t]select[unit]PDP type[u]01.0-02.7[u] +[v]289[opt]IPv4 +[v]343[opt]IPv6 +[v]0[opt]X.25 +[t]specialInputHlr[unit]PDP address[u]04.0-19.7[u] +[v]keepHex-low-E +[t]select[unit]Reliability Class[u]20.0-20.2[u] +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[t]select[unit]Delay Class[u]20.3-20.7[u] +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[t]select[unit]Precedence Class[u]21.0-21.3[u] +[v]1[opt]High +[v]2[opt]Normal +[v]3[opt]low +[t]select[unit]Peak Throughput[u]21.4-21.7[u] +[v]1[opt]8Kbps +[v]2[opt]16Kbps +[v]3[opt]32Kbps +[v]4[opt]64Kbps +[v]5[opt]128Kbps +[v]6[opt]256Kbps +[v]7[opt]512Kbps +[v]8[opt]1024Kbps +[v]9[opt]2048Kbps +[t]select[unit]Mean Throughput[u]22.0-22.7[u] +[v]1[opt]100Bph +[v]2[opt]200Bph +[v]3[opt]500Bph +[v]4[opt]1kBph +[v]5[opt]2kBph +[v]6[opt]5kBph +[v]7[opt]10kBph +[v]8[opt]20kBph +[v]9[opt]50kBph +[v]10[opt]100kBph +[v]11[opt]200kBph +[v]12[opt]500kBph +[v]13[opt]1mBph +[v]14[opt]2mBph +[v]15[opt]5mBph +[v]16[opt]10mBph +[v]17[opt]20mBph +[v]18[opt]50mBph +[v]31[opt]Best Effort +[t]radio[unit]VPLMN Address Allowed flag[u]23.0-23.7[u] +[v]0[opt]Not allowed +[v]1[opt]Allowed +[t]input[unit]APN[u]24.0-55.7[u] +[v]toAsc-low-0 +[t][unit]Ext Qos +[t]select[unit]Ext Flag[u]56.0-56.7[u] +[v]0[opt]Non-included Ext +[v]1[opt]Included Ext +[v]3[opt]Included Ext and Ext2 only 1 octet +[v]7[opt]Included Ext, Ext2 +[v]15[opt]Included Ext, Ext2, EXt3 +[t]select[unit]Allocation/Retention Priority[u]57.0-57.7[u] +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[t]select[unit]Delivery err SDUs[u]58.0-58.2[u] +[v]1[opt]No detect +[v]2[opt]Err SDUs delilvered +[v]3[opt]Err SDUs not delivered +[v]7[opt]Reserved +[t]select[unit]Delivery order[u]58.3-58.4[u] +[v]1[opt]delivery order +[v]2[opt]no delivery order +[v]3[opt]Reserved +[t]select[unit]Traffic class[u]58.5-58.7[u] +[v]1[opt]Conversation class +[v]2[opt]Streaming class +[v]3[opt]Interactive class +[v]4[opt]Background class +[v]7[opt]Reserved +[t]select[unit]Maximum SDU size[u]59.0-59.7[u] +[v]1[opt]10 octets +[v]20[opt]200 octets +[v]80[opt]800 octets +[v]100[opt]1000 octets +[v]148[opt]1480 octets +[v]150[opt]1500 octets +[v]151[opt]1502 octets +[v]152[opt]1510 octets +[v]153[opt]1520 octets +[v]255[opt]Reserved +[t]selectlimit[unit]Maximum bit rate for uplink range(X)[u]60.0-60.5[u]range1_1 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Maximum bit rate for uplink base[u]60.6-60.7[u]base1_1 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]selectlimit[unit]Maximum bit rate for downlink range(X)[u]61.0-61.5[u]range2_1 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Maximum bit rate for downlink base[u]61.6-61.7[u]base2_1 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]select[unit]SDU error ratio[u]62.0-62.3[u] +[v]1[opt]1E-2 +[v]2[opt]7E-3 +[v]3[opt]1E-3 +[v]4[opt]1E-4 +[v]5[opt]1E-5 +[v]6[opt]1E-6 +[v]7[opt]1E-1 +[v]15[opt]Reserved +[t]select[unit]Residual Bit Error Rate[u]62.4-62.7[u] +[v]1[opt]5E-2 +[v]2[opt]1E-2 +[v]3[opt]5E-3 +[v]4[opt]4E-3 +[v]5[opt]1E-3 +[v]6[opt]1E-4 +[v]7[opt]1E-5 +[v]8[opt]1E-6 +[v]9[opt]6E-8 +[v]15[opt]Reserved +[t]select[unit]Traffic handing priority[u]63.0-63.1[u] +[v]1[opt]level 1 +[v]2[opt]level 2 +[v]3[opt]level 3 +[v]0[opt]Reserved +[t]select[unit]Transfer delay[u]63.2-63.7[u] +[v]0[opt]X*10ms +[v]1[opt]200ms+X*50ms +[v]2[opt]1000ms+X*100ms +[v]3[opt]2600ms+X*100ms +[v]63[opt]Reserved +[t]selectlimit[unit]Guaranteed bit rate uplink range(X)[u]64.0-64.5[u]range3_1 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Guaranteed bit rate uplink base[u]64.6-64.7[u]base3_1 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]selectlimit[unit]Guaranteed bit rate downlink range(X)[u]65.0-65.5[u]range4_1 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Guaranteed bit rate downlink base[u]65.6-65.7[u]base4_1 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t][unit]Ext2 Qos +[t]select[unit]Source statistics Descriptor[u]66.0-66.3[u] +[v]0[opt]Spare +[v]1[opt]Speech +[t]select[unit]Signalling Indication[u]66.4-66.4[u] +[v]0[opt]Not optimised +[v]1[opt]Optimised +[t]select[unit]Maximum bit rate downlink (ext)[u]67.0-67.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16mbps +[v]75[opt]17mbps +[v]186[opt]128mbps +[v]187[opt]130mbps +[v]250[opt]256mbps +[t]select[unit]Guaranteed bit rate downlink (ext)[u]68.0-68.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[t][unit]Ext3 Qos +[t]select[unit]Maximum bit rate uplink (ext)[u]69.0-69.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[t]select[unit]Guaranteed bit rate uplink (ext)[u]70.0-70.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[remark] +PDP context identifier: 1-3. +PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25 +PDP Address: +IPv4 Len = 4, +IPv6 Len = 16, +X.25 Len = 3 to 9, +Empty Address· Field of any type has Len =0 +Reliability Class: +1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic +2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic +3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic +4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss +Delay Class: 1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort) +Precedence Class: 1 = High, 2 = Normal, 3 = Low +Peak Throughput 1 through 9 (8 Kbps to 2.048 Kbps) +Mean Throughput 1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort) +VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed +APN:The APN field in the HLR contains either only an APN Network Identifier (i.e. an APN without APN Operator Identifier) or the wild card value (defined in GSM 03.03).Currently we only use the wild card APN "*". +Ext Flag: +0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos +Ext Qos +Allocation/Retention Priority: +There are four priority : Priority 1,Priority 2,Priority 3,Priority 4. +Delivery err SDUs: +1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved +Delivery order: +1 =with delivery order,2 = without delivery order,3 = Reserved +Traffic class: +1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved +Maximum SDU size: +Giving a range of values from 10 octets to 1520 octets,1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved +Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps) +Maximum bit rate for uplink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps) +Maximum bit rate for downlink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +SDU error ratio: +The range is from 5E-2 to 6E-8.1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved +Residual Bit Error Rate: +The range is from 1E-1 to 1E-6.1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3 6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved +Traffic handing priority: +1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved +Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms +Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps) +Guaranteed bit rate uplink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps) +Guaranteed bit rate downlink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Ext2 Qos +Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW) +Signalling Indication: +0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic. +Reserved:66.5-66.7 +Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Ext3 Qos +Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) + +[para]45[Name]PDP context (group 2) +[sqlName]pdp2[t]radio[unit]PDP flag[u]00.0-00.7[u] +[v]0[opt]Disable +[v]1[opt]Enable +[t]select[unit]PDP type[u]01.0-02.7[u] +[v]289[opt]IPv4 +[v]343[opt]IPv6 +[v]0[opt]X.25 +[t]specialInputHlr[unit]PDP address[u]04.0-19.7[u] +[v]keepHex-low-E +[t]select[unit]Reliability Class[u]20.0-20.2[u] +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[t]select[unit]Delay Class[u]20.3-20.7[u] +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[t]select[unit]Precedence Class[u]21.0-21.3[u] +[v]1[opt]High +[v]2[opt]Normal +[v]3[opt]low +[t]select[unit]Peak Throughput[u]21.4-21.7[u] +[v]1[opt]8Kbps +[v]2[opt]16Kbps +[v]3[opt]32Kbps +[v]4[opt]64Kbps +[v]5[opt]128Kbps +[v]6[opt]256Kbps +[v]7[opt]512Kbps +[v]8[opt]1024Kbps +[v]9[opt]2048Kbps +[t]select[unit]Mean Throughput[u]22.0-22.7[u] +[v]1[opt]100Bph +[v]2[opt]200Bph +[v]3[opt]500Bph +[v]4[opt]1kBph +[v]5[opt]2kBph +[v]6[opt]5kBph +[v]7[opt]10kBph +[v]8[opt]20kBph +[v]9[opt]50kBph +[v]10[opt]100kBph +[v]11[opt]200kBph +[v]12[opt]500kBph +[v]13[opt]1mBph +[v]14[opt]2mBph +[v]15[opt]5mBph +[v]16[opt]10mBph +[v]17[opt]20mBph +[v]18[opt]50mBph +[v]31[opt]Best Effort +[t]radio[unit]VPLMN Address Allowed flag[u]23.0-23.7[u] +[v]0[opt]Not allowed +[v]1[opt]Allowed +[t]input[unit]APN[u]24.0-55.7[u] +[v]toAsc-low-0 +[t][unit]Ext Qos +[t]select[unit]Ext Flag[u]56.0-56.7[u] +[v]0[opt]Non-included Ext +[v]1[opt]Included Ext +[v]3[opt]Included Ext and Ext2 only 1 octet +[v]7[opt]Included Ext, Ext2 +[v]15[opt]Included Ext, Ext2, EXt3 +[t]select[unit]Allocation/Retention Priority[u]57.0-57.7[u] +[v]0[opt]Reserved +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[t]select[unit]Delivery err SDUs[u]58.0-58.2[u] +[v]1[opt]No detect +[v]2[opt]Err SDUs delilvered +[v]3[opt]Err SDUs not delivered +[v]7[opt]Reserved +[t]select[unit]Delivery order[u]58.3-58.4[u] +[v]1[opt]delivery order +[v]2[opt]no delivery order +[v]3[opt]Reserved +[t]select[unit]Traffic class[u]58.5-58.7[u] +[v]1[opt]Conversation class +[v]2[opt]Streaming class +[v]3[opt]Interactive class +[v]4[opt]Background class +[v]7[opt]Reserved +[t]select[unit]Maximum SDU size[u]59.0-59.7[u] +[v]1[opt]10 octets +[v]20[opt]200 octets +[v]80[opt]800 octets +[v]100[opt]1000 octets +[v]148[opt]1480 octets +[v]150[opt]1500 octets +[v]151[opt]1502 octets +[v]152[opt]1510 octets +[v]153[opt]1520 octets +[v]255[opt]Reserved +[t]selectlimit[unit]Maximum bit rate for uplink range(X)[u]60.0-60.5[u]range1_2 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Maximum bit rate for uplink base[u]60.6-60.7[u]base1_2 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]selectlimit[unit]Maximum bit rate for downlink range(X)[u]61.0-61.5[u]range2_2 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Maximum bit rate for downlink base[u]61.6-61.7[u]base2_2 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]select[unit]SDU error ratio[u]62.0-62.3[u] +[v]1[opt]1E-2 +[v]2[opt]7E-3 +[v]3[opt]1E-3 +[v]4[opt]1E-4 +[v]5[opt]1E-5 +[v]6[opt]1E-6 +[v]7[opt]1E-1 +[v]15[opt]Reserved +[t]select[unit]Residual Bit Error Rate[u]62.4-62.7[u] +[v]1[opt]5E-2 +[v]2[opt]1E-2 +[v]3[opt]5E-3 +[v]4[opt]4E-3 +[v]5[opt]1E-3 +[v]6[opt]1E-4 +[v]7[opt]1E-5 +[v]8[opt]1E-6 +[v]9[opt]6E-8 +[v]15[opt]Reserved +[t]select[unit]Traffic handing priority[u]63.0-63.1[u] +[v]1[opt]level 1 +[v]2[opt]level 2 +[v]3[opt]level 3 +[v]0[opt]Reserved +[t]select[unit]Transfer delay[u]63.2-63.7[u] +[v]0[opt]X*10ms +[v]1[opt]200ms+X*50ms +[v]2[opt]1000ms+X*100ms +[v]3[opt]2600ms+X*100ms +[v]63[opt]Reserved +[t]selectlimit[unit]Guaranteed bit rate uplink range(X)[u]64.0-64.5[u]range3_2 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Guaranteed bit rate uplink base[u]64.6-64.7[u]base3_2 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]selectlimit[unit]Guaranteed bit rate downlink range(X)[u]65.0-65.5[u]range4_2 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Guaranteed bit rate downlink base[u]65.6-65.7[u]base4_2 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t][unit]Ext2 Qos +[t]select[unit]Source statistics Descriptor[u]66.0-66.3[u] +[v]0[opt]Spare +[v]1[opt]Speech +[t]select[unit]Signalling Indication[u]66.4-66.4[u] +[v]0[opt]Not optimised +[v]1[opt]Optimised +[t]select[unit]Maximum bit rate downlink (ext)[u]67.0-67.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16mbps +[v]75[opt]17mbps +[v]186[opt]128mbps +[v]187[opt]130mbps +[v]250[opt]256mbps +[t]select[unit]Guaranteed bit rate downlink (ext)[u]68.0-68.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[t][unit]Ext3 Qos +[t]select[unit]Maximum bit rate uplink (ext)[u]69.0-69.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[t]select[unit]Guaranteed bit rate uplink (ext)[u]70.0-70.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[remark] +PDP context identifier: 1-3. +PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25 +PDP Address: +IPv4 Len = 4, +IPv6 Len = 16, +X.25 Len = 3 to 9, +Empty Address· Field of any type has Len =0 +Reliability Class: +1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic +2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic +3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic +4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss +Delay Class: 1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort) +Precedence Class: 1 = High, 2 = Normal, 3 = Low +Peak Throughput 1 through 9 (8 Kbps to 2.048 Kbps) +Mean Throughput 1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort) +VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed +APN:The APN field in the HLR contains either only an APN Network Identifier (i.e. an APN without APN Operator Identifier) or the wild card value (defined in GSM 03.03).Currently we only use the wild card APN "*". +Ext Flag: +0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos +Ext Qos +Allocation/Retention Priority: +There are four priority : Priority 1,Priority 2,Priority 3,Priority 4. +Delivery err SDUs: +1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved +Delivery order: +1 =with delivery order,2 = without delivery order,3 = Reserved +Traffic class: +1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved +Maximum SDU size: +Giving a range of values from 10 octets to 1520 octets,1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved +Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps) +Maximum bit rate for uplink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps) +Maximum bit rate for downlink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +SDU error ratio: +The range is from 5E-2 to 6E-8.1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved +Residual Bit Error Rate: +The range is from 1E-1 to 1E-6.1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3 6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved +Traffic handing priority: +1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved +Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms +Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps) +Guaranteed bit rate uplink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps) +Guaranteed bit rate downlink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Ext2 Qos +Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW) +Signalling Indication: +0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic. +Reserved:66.5-66.7 +Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Ext3 Qos +Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) + +[para]46[Name]PDP context (group 3) +[sqlName]pdp3[t]radio[unit]PDP flag[u]00.0-00.7[u] +[v]0[opt]Disable +[v]1[opt]Enable +[t]select[unit]PDP type[u]01.0-02.7[u] +[v]289[opt]IPv4 +[v]343[opt]IPv6 +[v]0[opt]X.25 +[t]specialInputHlr[unit]PDP address[u]04.0-19.7[u] +[v]keepHex-low-E +[t]select[unit]Reliability Class[u]20.0-20.2[u] +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[t]select[unit]Delay Class[u]20.3-20.7[u] +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[t]select[unit]Precedence Class[u]21.0-21.3[u] +[v]1[opt]High +[v]2[opt]Normal +[v]3[opt]low +[t]select[unit]Peak Throughput[u]21.4-21.7[u] +[v]1[opt]8Kbps +[v]2[opt]16Kbps +[v]3[opt]32Kbps +[v]4[opt]64Kbps +[v]5[opt]128Kbps +[v]6[opt]256Kbps +[v]7[opt]512Kbps +[v]8[opt]1024Kbps +[v]9[opt]2048Kbps +[t]select[unit]Mean Throughput[u]22.0-22.7[u] +[v]1[opt]100Bph +[v]2[opt]200Bph +[v]3[opt]500Bph +[v]4[opt]1kBph +[v]5[opt]2kBph +[v]6[opt]5kBph +[v]7[opt]10kBph +[v]8[opt]20kBph +[v]9[opt]50kBph +[v]10[opt]100kBph +[v]11[opt]200kBph +[v]12[opt]500kBph +[v]13[opt]1mBph +[v]14[opt]2mBph +[v]15[opt]5mBph +[v]16[opt]10mBph +[v]17[opt]20mBph +[v]18[opt]50mBph +[v]31[opt]Best Effort +[t]radio[unit]VPLMN Address Allowed flag[u]23.0-23.7[u] +[v]0[opt]Not allowed +[v]1[opt]Allowed +[t]input[unit]APN[u]24.0-55.7[u] +[v]toAsc-low-0 +[t][unit]Ext Qos +[t]select[unit]Ext Flag[u]56.0-56.7[u] +[v]0[opt]Non-included Ext +[v]1[opt]Included Ext +[v]3[opt]Included Ext and Ext2 only 1 octet +[v]7[opt]Included Ext, Ext2 +[v]15[opt]Included Ext, Ext2, EXt3 +[t]select[unit]Allocation/Retention Priority[u]57.0-57.7[u] +[v]0[opt]Reserved +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[t]select[unit]Delivery err SDUs[u]58.0-58.2[u] +[v]1[opt]No detect +[v]2[opt]Err SDUs delilvered +[v]3[opt]Err SDUs not delivered +[v]7[opt]Reserved +[t]select[unit]Delivery order[u]58.3-58.4[u] +[v]1[opt]delivery order +[v]2[opt]no delivery order +[v]3[opt]Reserved +[t]select[unit]Traffic class[u]58.5-58.7[u] +[v]1[opt]Conversation class +[v]2[opt]Streaming class +[v]3[opt]Interactive class +[v]4[opt]Background class +[v]7[opt]Reserved +[t]select[unit]Maximum SDU size[u]59.0-59.7[u] +[v]1[opt]10 octets +[v]20[opt]200 octets +[v]80[opt]800 octets +[v]100[opt]1000 octets +[v]148[opt]1480 octets +[v]150[opt]1500 octets +[v]151[opt]1502 octets +[v]152[opt]1510 octets +[v]153[opt]1520 octets +[v]255[opt]Reserved +[t]selectlimit[unit]Maximum bit rate for uplink range(X)[u]60.0-60.5[u]range1_3 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Maximum bit rate for uplink base[u]60.6-60.7[u]base1_3 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]selectlimit[unit]Maximum bit rate for downlink range(X)[u]61.0-61.5[u]range2_3 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Maximum bit rate for downlink base[u]61.6-61.7[u]base2_3 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]select[unit]SDU error ratio[u]62.0-62.3[u] +[v]1[opt]1E-2 +[v]2[opt]7E-3 +[v]3[opt]1E-3 +[v]4[opt]1E-4 +[v]5[opt]1E-5 +[v]6[opt]1E-6 +[v]7[opt]1E-1 +[v]15[opt]Reserved +[t]select[unit]Residual Bit Error Rate[u]62.4-62.7[u] +[v]1[opt]5E-2 +[v]2[opt]1E-2 +[v]3[opt]5E-3 +[v]4[opt]4E-3 +[v]5[opt]1E-3 +[v]6[opt]1E-4 +[v]7[opt]1E-5 +[v]8[opt]1E-6 +[v]9[opt]6E-8 +[v]15[opt]Reserved +[t]select[unit]Traffic handing priority[u]63.0-63.1[u] +[v]1[opt]level 1 +[v]2[opt]level 2 +[v]3[opt]level 3 +[v]0[opt]Reserved +[t]select[unit]Transfer delay[u]63.2-63.7[u] +[v]0[opt]X*10ms +[v]1[opt]200ms+X*50ms +[v]2[opt]1000ms+X*100ms +[v]3[opt]2600ms+X*100ms +[v]63[opt]Reserved +[t]selectlimit[unit]Guaranteed bit rate uplink range(X)[u]64.0-64.5[u]range3_3 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Guaranteed bit rate uplink base[u]64.6-64.7[u]base3_3 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t]selectlimit[unit]Guaranteed bit rate downlink range(X)[u]65.0-65.5[u]range4_3 +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[v]4[opt]4 +[v]5[opt]5 +[v]6[opt]6 +[v]7[opt]7 +[v]8[opt]8 +[v]9[opt]9 +[v]10[opt]10 +[v]11[opt]11 +[v]12[opt]12 +[v]13[opt]13 +[v]14[opt]14 +[v]15[opt]15 +[v]16[opt]16 +[v]17[opt]17 +[v]18[opt]18 +[v]19[opt]19 +[v]20[opt]20 +[v]21[opt]21 +[v]22[opt]22 +[v]23[opt]23 +[v]24[opt]24 +[v]25[opt]25 +[v]26[opt]26 +[v]27[opt]27 +[v]28[opt]28 +[v]29[opt]29 +[v]30[opt]30 +[v]31[opt]31 +[v]32[opt]32 +[v]33[opt]33 +[v]34[opt]34 +[v]35[opt]35 +[v]36[opt]36 +[v]37[opt]37 +[v]38[opt]38 +[v]39[opt]39 +[v]40[opt]40 +[v]41[opt]41 +[v]42[opt]42 +[v]43[opt]43 +[v]44[opt]44 +[v]45[opt]45 +[v]46[opt]46 +[v]47[opt]47 +[v]48[opt]48 +[v]49[opt]49 +[v]50[opt]50 +[v]51[opt]51 +[v]52[opt]52 +[v]53[opt]53 +[v]54[opt]54 +[v]55[opt]55 +[v]56[opt]56 +[v]57[opt]57 +[v]58[opt]58 +[v]59[opt]59 +[v]60[opt]60 +[v]61[opt]61 +[v]62[opt]62 +[v]63[opt]63 +[t]selectlimit[unit]Guaranteed bit rate downlink base[u]65.6-65.7[u]base4_3 +[v]0[opt]X*1kbps +[v]1[opt]64kbps+(X*8kbps) +[v]2[opt]576kbps+(X*64kbps) +[v]3[opt]4672kbps+(X*64kbps) +[t][unit]Ext2 Qos +[t]select[unit]Source statistics Descriptor[u]66.0-66.3[u] +[v]0[opt]Spare +[v]1[opt]Speech +[t]select[unit]Signalling Indication[u]66.4-66.4[u] +[v]0[opt]Not optimised +[v]1[opt]Optimised +[t]select[unit]Maximum bit rate downlink (ext)[u]67.0-67.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16mbps +[v]75[opt]17mbps +[v]186[opt]128mbps +[v]187[opt]130mbps +[v]250[opt]256mbps +[t]select[unit]Guaranteed bit rate downlink (ext)[u]68.0-68.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[t][unit]Ext Qos +[t]select[unit]Maximum bit rate uplink (ext)[u]69.0-69.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[t]select[unit]Guaranteed bit rate uplink (ext)[u]70.0-70.7[u] +[v]0[opt]<=8600kbps +[v]1[opt]8700kbps +[v]74[opt]16000kbps +[v]75[opt]17Mbps +[v]186[opt]128Mbps +[v]187[opt]130Mbps +[v]250[opt]256Mbps +[remark] +PDP context identifier: 1-3. +PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25 +PDP Address: +IPv4 Len = 4, +IPv6 Len = 16, +X.25 Len = 3 to 9, +Empty Address· Field of any type has Len =0 +Reliability Class: +1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic +2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic +3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic +4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss +Delay Class: 1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort) +Precedence Class: 1 = High, 2 = Normal, 3 = Low +Peak Throughput 1 through 9 (8 Kbps to 2.048 Kbps) +Mean Throughput 1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort) +VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed +APN:The APN field in the HLR contains either only an APN Network Identifier (i.e. an APN without APN Operator Identifier) or the wild card value (defined in GSM 03.03).Currently we only use the wild card APN "*". +Ext Flag: +0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos +Ext Qos +Allocation/Retention Priority: +There are four priority : Priority 1,Priority 2,Priority 3,Priority 4. +Delivery err SDUs: +1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved +Delivery order: +1 =with delivery order,2 = without delivery order,3 = Reserved +Traffic class: +1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved +Maximum SDU size: +Giving a range of values from 10 octets to 1520 octets,1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved +Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps) +Maximum bit rate for uplink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps) +Maximum bit rate for downlink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +SDU error ratio: +The range is from 5E-2 to 6E-8.1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved +Residual Bit Error Rate: +The range is from 1E-1 to 1E-6.1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3 6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved +Traffic handing priority: +1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved +Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms +Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps) +Guaranteed bit rate uplink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps) +Guaranteed bit rate downlink base: +0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps) +Ext2 Qos +Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW) +Signalling Indication: +0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic. +Reserved:66.5-66.7 +Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Ext3 Qos +Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) +Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps) + +[para]47[Name]User name +[sqlName]user_name[t]input[unit]User name[u]00.0-23.7[u] +[v]keepAsc-low-0 +[remark]User real name. For post-pay subscriber registration. + +[para]48[Name]User certificate +[sqlName]user_certifiacate[t]input[unit]User cetificate[u]00.0-15.7[u] +[v]keepAsc-low-0 +[remark] +User ID + +[para]49[Name]VLR Number +[sqlName]vlr_num[t]readOnly[unit]ISDN number plan[u]00.0-00.7[u]code +[v]keepHex-high-0 +[unit]ISDN number[u]01.0-08.7[u] +[v]keepHex-low-E +[remark] +VLR E.164 number + +[para]50[Name]MSC Number +[sqlName]msc_num[t]readOnly[unit]MSC Number[u]00.0-00.7[u]code +[v]keepHex-high-0 +[unit]ISDN number[u]01.0-08.7[u] +[v]keepHex-low-E +[remark] +MSC E.164 number diff --git a/wxc2_omc/account/priSubsMng/ipalimSubsConf.php b/wxc2_omc/account/priSubsMng/ipalimSubsConf.php new file mode 100755 index 0000000..ca58bed --- /dev/null +++ b/wxc2_omc/account/priSubsMng/ipalimSubsConf.php @@ -0,0 +1,445 @@ + + +sysId=$sysId"; + echo "
      canSetNum=$canSetNum"; + echo "
      keyValue=$keyValue"; + echo "
      sysTypeNo=$sysTypeNo"; + echo "
      sysNo=$sysNo"; + echo "
      subSysNo=$subSysNo"; + echo "
      dataTypeNo=$dataTypeNo"; +} +//?????? +if($DEBUG) +{ + echo "
      isRead=$isRead"; + echo "
      isChange=$isChange"; + echo "
      isCreate=$isCreate"; + echo "
      isDelete=$isDelete"; + echo "
      isLoadIndex=$isLoadIndex"; + + //??????????? + echo "
      bgnNo=$bgnNo"; + echo "
      endNo=$endNo"; +} + + + +//---------???????????------- +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'imsi', 'inputName'=>'iImsi'), + array('fieldName'=>'msisdn', 'inputName'=>'iMsisdn'), + array('fieldName'=>'msisdn_extern', 'inputName'=>'iMsisdn_extern'), + array('fieldName'=>'tmsi', 'inputName'=>'iTmsi'), + array('fieldName'=>'lai', 'inputName'=>'iLai'), + array('fieldName'=>'type', 'inputName'=>'iType') + ); +//????????????? +if($DEBUG && $_SERVER['REQUEST_METHOD'] == "POST") +{ + for($i=0;$i$inputName,$inputValue"; + if(strlen($inputValue)) + { + echo "
      $inputName = $inputValue"; + } + else + { + echo "
      Can not find $inputName's value"; + } + } + exit(); +} +//??????????,???????????? +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $imsi = $iImsi; + $msisdn = $iMsisdn; + $type = $iType; + $msisdn_extern = $iMsisdn_extern; + $tmsi = $iTmsi; + $lai = $iLai; + + //????????????,?????????? + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + } + $endNo++; + } +} +//========================================================== +//???? +//========================================================== +if (1 == $isLoadIndex) +{ + $fieldNameList = "imsi,msisdn,msisdn_extern,tmsi,lai,type"; +} +else +{ + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; + +?> + + + + +"; +//**********************************???????javascript***************************************** +?> + +
      " > + + + + + + + 0) + { + ?> + + =4) + { + ?> + + + + + + + + + + + +
      Server ID: + + + +       + + " name="create" title="Add a new subscriber" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + +     + + + + + + "; + else + echo ""; + ?> + + + + "; + else + echo ""; + ?> + +  
      + +
      + + + + + + + + + + 0){ +// echo "$tmpRow[msisdn],$tmpRow[msisdn],$tmpRow[msisdn]
      "; + $imsi=$tmpRow[imsi]; + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; +} + +$ipalimType =$tmpRow[type]+0; +//echo "ipalimType=$ipalimType
      "; + +//msisdn +$iMsisdn=$tmpRow[msisdn]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//msisdn extern +$iMsisdn_extern=$tmpRow[msisdn_extern]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//tmsi +$iTmsi=$tmpRow[tmsi]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//lai +$iLai=$tmpRow[lai]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//type +$ipalimTypeDef=array( + array('0','Private'), + array('1','Public'), + array('2','Hybrid') + ); +$ipalimType =$tmpRow[type]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +?> +
      No.NameValueDescription
      $seqNo IMSI"; + echo ""; + echo ""; + echo "15-digit IMSI"; + echo "
      $seqNo MSISDN Public"; +//private do not have the MSISDN Public +if($ipalimType == 0) + echo ""; +else + echo ""; +echo "MSISDN=CC+NDC+SN
      $seqNo MSISDN Private"; +if($ipalimType == 1) + echo ""; +else + echo ""; +echo " 
      $seqNo TMSI"; +echo "$iTmsi "; +//echo ""; +echo " 
      $seqNo MCC-MNC-LAC-CI"; +$lai_mcc=substr($iLai,0,3); +$lai_mnc=substr($iLai,3,3); +$lai_lai=substr($iLai,6,4); +$lai_ci=substr($iLai,10,4); +echo "$lai_mcc-$lai_mnc-$lai_lai-$lai_ci "; +//echo ""; +echo " 
      $seqNo Type"; +echo ""; +echo " 
      + +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + + diff --git a/wxc2_omc/account/priSubsMng/mnpSubsConf.php b/wxc2_omc/account/priSubsMng/mnpSubsConf.php new file mode 100755 index 0000000..825fc88 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/mnpSubsConf.php @@ -0,0 +1,477 @@ +正在调试中,给您的工作带来不便,请原谅!!^_^"; + +//========================================================== +//变量定义 +//========================================================== +$canwrite_flag=checkWritePrivilege(); +$pubDb = 'OMC_PUB'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + + +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum) ? $canSetNum : 'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) +{ + echo "
      sysId=$sysId"; + echo "
      canSetNum=$canSetNum"; + echo "
      keyValue=$keyValue"; + echo "
      sysTypeNo=$sysTypeNo"; + echo "
      sysNo=$sysNo"; + echo "
      subSysNo=$subSysNo"; + echo "
      dataTypeNo=$dataTypeNo"; +} +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +if($DEBUG) +{ + echo "
      isRead=$isRead"; + echo "
      isChange=$isChange"; + echo "
      isCreate=$isCreate"; + echo "
      isDelete=$isDelete"; + echo "
      isLoadIndex=$isLoadIndex"; + + //保存用户数据修改的数据 + echo "
      bgnNo=$bgnNo"; + echo "
      endNo=$endNo"; +} + +//---------定义需要编辑保存的字段------- +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'msisdn', 'inputName'=>'iMsisdn'), + array('fieldName'=>'status', 'inputName'=>'iStatus'), + array('fieldName'=>'routing_number', 'inputName'=>'iRoutingNumber'), + array('fieldName'=>'donor', 'inputName'=>'iDonor'), + array('fieldName'=>'recipient', 'inputName'=>'iRecipient'), + array('fieldName'=>'date', 'inputName'=>'iDate') + ); +//检查各个需要编辑的输入单元 +if($DEBUG && $_SERVER['REQUEST_METHOD'] == "POST") +{ + for($i=0;$i$inputName,$inputValue"; + if(strlen($inputValue)) + { + echo "
      $inputName = $inputValue"; + } + else + { + echo "
      Can not find $inputName's value"; + } + } + exit(); +} + +//处理每个输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $msisdn = $iMsisdn; + $status = $iStatus; + $routing_number = $iRoutingNumber; + $donor = $iDonor; + $recipient = $iRecipient; + $date = $iDate; + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + } + $endNo++; + } +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) +{ + $fieldNameList = "msisdn,status,routing_number,donor,recipient,date"; +} +else +{ + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; + +?> + + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + + +
      " > + + + + + + + + + 0) + { + ?> + + =4) + { + ?> + + + + + + + + + + + +
      Server ID: + + + +       + + " name="create" title="Add a new subscriber" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + +     + + + + + + "; + else + echo ""; + ?> + + + + "; + else + echo ""; + ?> + +  
      + + +
      + + + + + + + + + + 0){ +// echo "$tmpRow[msisdn],$tmpRow[msisdn],$tmpRow[msisdn]
      "; + $msisdn=$tmpRow[msisdn]; + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; +} + +//Subscriber status +$statusDef=array( + array('02','own ported out'), + array('03','foreign ported in'), + array('04','foreign ported to third party') + ); +$status =$tmpRow[status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; + +//echo ""; +echo ""; +echo ""; + +//Routing number +$iRoutingNumber=substr($tmpRow[routing_number],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Donor +$iDonor=substr($tmpRow[donor],0,16); +echo "\n"; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Recipient +$iRecipient=substr($tmpRow[recipient],0,16); +echo "\n"; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Date +if($isTryCreate>0) +{ + $iDate = date("YmdHis"); +} +else +{ + $iDate = $tmpRow[date]; +} +$iDate = substr($iDate,0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; + +echo ""; + +echo ""; +?> +
      No.NameValueDescription
      $seqNo MSISDN"; + echo ""; + echo "MSISDN = phone number of the subscriber. Includes the country code and area code,len should be 9-16
      $seqNo Status"; +echo ""; +echo "2 = Own ported out
      3 = Foreign ported in
      4 = Foreign ported to third party
       
      $seqNo Routing number"; +echo ""; +echo ""; +echo "Routing number, the length should be 1-8"; +echo "
      $seqNo Donor "; +echo ""; +echo ""; +echo "Donor network of the ported subscriber,
      the length should be 1-16."; +echo "
      $seqNo Recipient "; +echo ""; +echo ""; +echo "Recipient network of the ported subscriber,
      the length should be 1-16."; +echo "
      $seqNo Date"; +echo ""; +//echo "$date"; +echo "Port date, the format is Year Month Day.
      Such as 20050102 indicates 2005-01-02.
      + +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + + \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/oprSubsConf.php b/wxc2_omc/account/priSubsMng/oprSubsConf.php new file mode 100755 index 0000000..8958808 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/oprSubsConf.php @@ -0,0 +1,472 @@ +sysId=$sysId"; + echo "
      canSetNum=$canSetNum"; + echo "
      keyValue=$keyValue"; + echo "
      sysTypeNo=$sysTypeNo"; + echo "
      sysNo=$sysNo"; + echo "
      subSysNo=$subSysNo"; + echo "
      dataTypeNo=$dataTypeNo"; +} +//操作类型变量 +if($DEBUG) +{ + echo "
      isRead=$isRead"; + echo "
      isChange=$isChange"; + echo "
      isCreate=$isCreate"; + echo "
      isDelete=$isDelete"; + echo "
      isLoadIndex=$isLoadIndex"; + + //保存用户数据修改的数据 + echo "
      bgnNo=$bgnNo"; + echo "
      endNo=$endNo"; +} + + + +//---------定义需要编辑保存的字段------- +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'msisdn', 'inputName'=>'iMsisdn'), + array('fieldName'=>'imsi', 'inputName'=>'iImsi'), + array('fieldName'=>'imei', 'inputName'=>'iImei'), + array('fieldName'=>'oprFlag', 'inputName'=>'iOprFlag'), + array('fieldName'=>'class','inputName'=>'iClass') + //array('fieldName'=>'type', 'inputName'=>'iType'), + //array('fieldName'=>'status', 'inputName'=>'iStatus') + ); +//检查各个需要编辑的输入单元 +if($DEBUG && $_SERVER['REQUEST_METHOD'] == "POST") +{ + for($i=0;$i$inputName,$inputValue"; + if(strlen($inputValue)) + { + echo "
      $inputName = $inputValue"; + } + else + { + echo "
      Can not find $inputName's value"; + } + } + exit(); +} +//处理每个输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $msisdn = $iMsisdn; + $imei = $iImei; + $imsi = $iImsi; + $oprFlag = $iOprFlag; + $type = $iType; + $status = $iStatus; + $oprClass = $iClass; + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + } + $endNo++; + } +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) +{ + $fieldNameList = "msisdn,imei,imsi,oprFlag,class"; +} +else +{ + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +?> + + + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + +
      " > + + + + + + + 0) + { + ?> + + =4) + { + ?> + + + + + + + + + + + +
      Server ID: + + + +       + + " name="create" title="Add a new subscriber" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + +     + + + + + + "; + else + echo ""; + ?> + + + + "; + else + echo ""; + ?> + +  
      + +
      + + + + + + + + + + 0){ +// echo "$tmpRow[msisdn],$tmpRow[msisdn],$tmpRow[msisdn]
      "; + $msisdn=$tmpRow[msisdn]; + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; +} + + + + + +//imsi +$iImsi=$tmpRow[imsi]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//imei +$iImei=$tmpRow[imei]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//opr Flag +$oprFlagDef=array( + array('00','OPR-0'),//array('00','Not Registered'), + array('01','OPR-1'),//array('01','OprStateWithoutRoamingAgreement'), + array('02','OPR-2a'),//array('02','OprStateWithRoamingAgreement'), + array('03','OPR-2b'),//array('03','RoamingState'), + array('04','IMDX-P1'), + array('05','IMDX-P2'), + array('06','IMDX-H') + ); +$oprFlag =$tmpRow[oprFlag]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//class +$oprClass_label=array(0=>"Ordinary",1=>"Premium",2=>"VIP"); +$oprClass =$tmpRow['class']; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +//type +/* +$typeDef=array( + array('00','Trial'), + array('01','Normal') + ); +$type =$tmpRow[type]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +*/ +/* +//status +$statusDef=array( + array('00','Idle'), + array('01','Msisdn Allocated'), + array('02','Msisdn Registered') + ); +$status =$tmpRow[status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +*/ +?> +
      No.NameValueDescription
      $seqNo MSISDN"; + echo ""; + echo "MSISDN=CC+NDC+SN
      $seqNo IMSI"; +echo ""; +echo ""; +echo "15-digit IMSI"; +echo "
      $seqNo IMEI"; +echo ""; +echo ""; +echo "15-digit IMEI (For OPR use only)"; +echo "
      $seqNo User Status"; +echo ""; +echo ""; + echo "OPR-0 = Not in use (Fresh)
      ";//"Initial status of a new created or imported OPR account. The associated MSISDN will be allocated to an auto-registered subscriber.
      "; + echo "OPR-1 = In use: without roaming agreement
      ";//"OPR subscriber is from PLMN without roaming agreement.
      "; + echo "OPR-2a = In use: with roaming agreement (OPR)
      ";//"OPR subscriber is from PLMN with roaming agreement.
      "; + echo "OPR-2b = In use: with roaming agreement (Roaming)
      ";//"OPR subscriber is from PLMN with roaming agreement. But its current application status is switched to roaming mode."; + echo "IMDX-P1 = IMDX Private Ordinary
      "; + echo "IMDX-P2 = IMDX Private Premium
      "; + echo "IMDX-H = IMDX Hybrid
      "; +echo "
      $seqNo Class"; +echo "{$oprClass_label[$oprClass]}"; +echo ""; +echo "Class"; +echo "
      $seqNo Type"; +echo ""; +echo " 
      $seqNo MSISDN Status"; +echo ""; +echo " 
      + +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + + + diff --git a/wxc2_omc/account/priSubsMng/oprSubsConfig b/wxc2_omc/account/priSubsMng/oprSubsConfig new file mode 100755 index 0000000..e4b4685 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/oprSubsConfig @@ -0,0 +1,43 @@ +[para]0[Name]MSISDN +[sqlName]msisdn[t]input[unit]MSISDN[u]00.0-15.7[u] +[v]keepAsc-low-E +[remark] +MSISDN=CC+NDC+SN + +[para]1[Name]IMSI +[sqlName]imsi[t]input[unit]IMSI[u]00.0-14.7[u] +[v]keepAsc-low-E +[remark] +15-digit IMSI + +[para]2[Name]IMEI +[sqlName]imei[t]input[unit]IMEI[u]00.0-14.7[u] +[v]keepAsc-low-E +[remark] +15-digit IMEI (For OPR use only) + +[para]3[Name]User Status +[sqlName]oprFlag[t]select[unit]User Status[u]00.0-00.7[u]keepAsc +[v]0[opt]OPR-0 +[v]1[opt]OPR-1 +[v]2[opt]OPR-2a +[v]3[opt]OPR-2b +[v]4[opt]IMDX-P1 +[v]5[opt]IMDX-P2 +[v]6[opt]IMDX-H +[remark] +OPR-0 = Not in use (Fresh) +OPR-1 = In use: without roaming agreement +OPR-2a = In use: with roaming agreement (OPR) +OPR-2b = In use: with roaming agreement (Roaming) +IMDX-P1 = IMDX Private Ordinary +IMDX-P2 = IMDX Private Premium +IMDX-H = IMDX Hybrid + +[para]4[Name]Class +[sqlName]class[t]show[unit]Class[u]00.0-00.7[u] +[v]0[opt]Ordinary +[v]1[opt]Premium +[v]2[opt]VIP +[remark] +Class diff --git a/wxc2_omc/account/priSubsMng/ppsCardConf.php b/wxc2_omc/account/priSubsMng/ppsCardConf.php new file mode 100755 index 0000000..ba1d000 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/ppsCardConf.php @@ -0,0 +1,396 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +//------------选择语言版本---------- +if($language == 'eng'){ + +}else{ + +} + +$userTypeDef=array( + //array('Name', 'offset','remark'), + array('rent01', '00.0' ,'rent01'), + array('rent02', '00.1' ,'rent02'), + array('rent03', '00.2' ,'rent03'), + array('rent04', '00.3' ,'rent04'), + array('rent05', '00.4' ,'rent05'), + array('rent06', '00.5' ,'rent06'), + array('rent07', '00.6' ,'rent07'), + array('rent08', '00.7' ,'rent08') +); + +//select sum(balance) from user_info +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +//保存用户数据修改的数据 +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- + + +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'card_no', 'inputName'=>'cardNo'), + array('fieldName'=>'card_hrn', 'inputName'=>'password'), + array('fieldName'=>'face_value', 'inputName'=>'faceValue'), + array('fieldName'=>'card_status', 'inputName'=>'cardStatus'), + array('fieldName'=>'expiry_date', 'inputName'=>'expiryDate'), + array('fieldName'=>'valid_time', 'inputName'=>'validTime'), + array('fieldName'=>'msisdn_used', 'inputName'=>'msisdnUsed'), + array('fieldName'=>'update_date', 'inputName'=>'updateDate') +); + +//检查各个需要编辑的输入单元 +if($DEBUG && $_SERVER['REQUEST_METHOD'] == "POST"){ + for($i=0;$i$inputName = $inputValue"; + }else{ + echo "
      Can not find $inputName's value"; + } + } +} + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + $card_no =$cardNo; + $card_hrn =$password; + $face_value =$faceValue; + $card_status =$cardStatus; + $expiry_date =$expiryDate; + $valid_time =$validTime; + $msisdn_used =$msisdnUsed; + $update_date =$updateDate; + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + } +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "card_no,face_value,card_status,expiry_date,valid_time,updated_date,msisdn_used"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +?> + + +tmpRow[{$showAttrDef[$i][fieldName]}]={$showAttrDef[$i][defaultValue]}"; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$seqNo=0; +?> + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + +
      " > + + + + + + + + +
      + + + + + +       + + + + +  
      +
      + + + + + + + + +"; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//password +$password=$tmpRow[card_hrn]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//faceValue +$faceValue=$tmpRow[face_value]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//card_status +$cardStatus=$tmpRow[card_status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//expiry_date +$expiryDate=$tmpRow[expiry_date]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//valid_time +$validTime=$tmpRow[valid_time]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//msisdn_used +$msisdn_used=$tmpRow[msisdn_used]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//update_date +$updateDate=$tmpRow[update_date]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +?> +
      No.NameValueDescription
      $seqNo Card no."; +echo " $cardNo"; +echo " 
      $seqNo Password"; +echo " $password"; +echo " 
      $seqNo Face value"; +echo " $faceValue"; +echo " 
      $seqNo Card status"; +if($cardStatus == 0){ + echo " fresh"; +}else if($cardStatus == 1){ + echo " used"; +}else if($cardStatus == 2){ + echo " suspended"; +} +//echo " $cardStatus"; +echo " 
      $seqNo Expiry date"; +echo " $expiryDate"; +echo " 
      $seqNo Valid days"; +echo " $validTime"; +echo " 
      $seqNo MSISDN charged"; +echo " $msisdn_used"; +echo " 
      $seqNo Update date"; +echo " $updateDate"; +echo " 
      +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/ppsSubsConf.php b/wxc2_omc/account/priSubsMng/ppsSubsConf.php new file mode 100755 index 0000000..8e020fc --- /dev/null +++ b/wxc2_omc/account/priSubsMng/ppsSubsConf.php @@ -0,0 +1,1477 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$canwrite_flag=checkWritePrivilege(); +$pubDb = 'OMC_PUB'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +$rentTypeDef=array( + //array('Name', 'offset','remark'), + array('rent01', '00.0' ,'VMS rent'), + array('rent02', '00.1' ,'Rent01'), + array('rent03', '00.2' ,'Rent02'), + array('rent04', '00.3' ,'Rent03'), + array('rent05', '00.4' ,'Rent04'), + array('rent06', '00.5' ,'Rent05'), + array('rent07', '00.6' ,'Rent06'), + array('rent08', '00.7' ,'Rent07'), +); + +//select sum(balance) from user_info +//========================================================== +//输入变量 +//========================================================== +$canSetNum=$_REQUEST['canSetNum']; +$keyValue=$_REQUEST['keyValue']; +$subSysNo=$_REQUEST['subSysNo']; +$dataTypeNo=$_REQUEST['dataTypeNo']; + +if ($_REQUEST['sysId']) +{ + $sysId = $_REQUEST['sysId']; + if($DEBUG) echo "
      sysId=$sysId"; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + // echo "sysTypeNo=$sysTypeNo,sysNo=$sysNo"; +} +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +$isLoadIndex=$_REQUEST['isLoadIndex']; +$isTryCreate=$_REQUEST['isTryCreate']; +$isBatchCreate=$_REQUEST['isBatchCreate']; +$isCreate=$_REQUEST['isCreate']; +$isDelete=$_REQUEST['isDelete']; +$isChange=$_REQUEST['isChange']; +$isRead=$_REQUEST['isRead']; +$batchNum=$_REQUEST['batchNum']; +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +$bgnNo=$_POST['bgnNo']; +$endNo=$_POST['endNo']; +//保存用户数据修改的数据 +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'msisdn', 'inputName'=>'iMsisdn'), + array('fieldName'=>'PIN', 'inputName'=>'iPIN'), + array('fieldName'=>'status', 'inputName'=>'iStatus'), + array('fieldName'=>'rent_type', 'inputName'=>'iUserType'), + array('fieldName'=>'home_location0', 'inputName'=>'iHomeLocation0'), + array('fieldName'=>'home_location1', 'inputName'=>'iHomeLocation1'), + array('fieldName'=>'home_location2', 'inputName'=>'iHomeLocation2'), + array('fieldName'=>'home_location3', 'inputName'=>'iHomeLocation3'), + array('fieldName'=>'cug_id', 'inputName'=>'iCugID'), + array('fieldName'=>'language_type', 'inputName'=>'iLanguageSet'), + array('fieldName'=>'fav_change_counter', 'inputName'=>'iFavChangeCounter'), + array('fieldName'=>'favorite_number0', 'inputName'=>'iFavoriteNumber0'), + array('fieldName'=>'favorite_number1', 'inputName'=>'iFavoriteNumber1'), + array('fieldName'=>'favorite_number2', 'inputName'=>'iFavoriteNumber2'), + array('fieldName'=>'favorite_number3', 'inputName'=>'iFavoriteNumber3'), + array('fieldName'=>'favorite_number4', 'inputName'=>'iFavoriteNumber4'), + //array('fieldName'=>'free_sms_remaining_days', 'inputName'=>'ifree_sms_remaining_days'), + array('fieldName'=>'pool_account_type', 'inputName'=>'ipool_account_type'), + array('fieldName'=>'child_account_number', 'inputName'=>'ichild_account_number'), + //array('fieldName'=>'child_number_edit_count', 'inputName'=>'ichild_number_edit_count'), + array('fieldName'=>'child_number1', 'inputName'=>'ichild_number1'), + array('fieldName'=>'child_number2', 'inputName'=>'ichild_number2'), + array('fieldName'=>'child_number3', 'inputName'=>'ichild_number3'), + array('fieldName'=>'child_number4', 'inputName'=>'ichild_number4'), + array('fieldName'=>'child_number5', 'inputName'=>'ichild_number5'), + array('fieldName'=>'parent_number', 'inputName'=>'iparent_number'), + //array('fieldName'=>'intraday_calls', 'inputName'=>'iintraday_calls'), + //array('fieldName'=>'intraday_sms', 'inputName'=>'iintraday_sms'), + //array('fieldName'=>'intraday_charged_balance', 'inputName'=>'iintraday_charged_balance'), + //array('fieldName'=>'cap_gprs_volume', 'inputName'=>'icap_gprs_volume'), + //array('fieldName'=>'cap_gprs_balance', 'inputName'=>'icap_gprs_balance'), + //array('fieldName'=>'gprs_volume_this_month', 'inputName'=>'igprs_volume_this_month'), + //array('fieldName'=>'gprs_notification_times_today', 'inputName'=>'igprs_notification_times_today') + array('fieldName'=>'callme_back_request_times', 'inputName'=>'icallme_back_request_times'), + array('fieldName'=>'favorite_plan_id', 'inputName'=>'ifavorite_plan_id'), + array('fieldName'=>'favorite_free_call_duration', 'inputName'=>'ifavorite_free_call_duration'), + array('fieldName'=>'favorite_free_sms', 'inputName'=>'ifavorite_free_sms'), + array('fieldName'=>'favorite_plan_state', 'inputName'=>'ifavorite_plan_state') +); + +//For operation log use +{ + $iStatus_def=array( + "00"=>"Fresh","0"=>"Fresh", + "01"=>"Used","1"=>"Used", + "02"=>"Suspended","2"=>"Suspended", + "03"=>"Blacklist","3"=>"Blacklist", + "04"=>"Released","4"=>"Released", + "05"=>"OPR Trial","5"=>"OPR Trial" + ); + + $pool_account_type_def=array( + 0=>"Normal", + 1=>"Parent", + 2=>"Child" + ); +} + +$logFieldDef=array( + 'iPIN', + 'iStatus', + 'iUserType', + 'iHomeLocation0', + 'iHomeLocation1', + 'iHomeLocation2', + 'iHomeLocation3', + 'iCugID', + 'iLanguageSet', + 'iFavoriteNumber0', + 'iFavoriteNumber1', + 'iFavoriteNumber2', + 'iFavoriteNumber3', + 'iFavoriteNumber4', + //'ifree_sms_remaining_days', + 'ipool_account_type', + //'ichild_account_number', + //'ichild_number_edit_count', + 'ichild_number1', + 'ichild_number2', + 'ichild_number3', + 'ichild_number4', + 'ichild_number5', + 'iparent_number', + //'iintraday_calls', + //'iintraday_sms', + //'iintraday_charged_balance', + //'icap_gprs_volume', + //'icap_gprs_balance', + //'igprs_volume_this_month', + //'igprs_notification_times_today' + 'icallme_back_request_times', + 'ifavorite_plan_id', + 'ifavorite_free_call_duration', + 'ifavorite_free_sms', + 'ifavorite_plan_state', +); + + +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //system("echo '-------------------------------------'>>/tmp/test.txt"); + $pre_keyvalue = $_POST['pre_keyvalue']; + $log_sysTypeName = $_POST['log_sysTypeName']; + $log_sysNo = $_POST['log_sysNo']; + $log_subSysNo = $_POST['log_subSysNo']; + $preValueInfo="Change $pre_keyvalue "; + $isChangeFlag=0; + for($i=0;$i$inputName = $inputValue"; + if(isset($$ddName)) + { + $tmpv=$$ppName; + $val1=${$$ddName}[$tmpv]; + $val2=${$$ddName}[$inputValue]; + if(strlen($$ppName) == 0) + $val1="NoValue"; + + if(strcasecmp($val1,$val2) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$val1}->{$val2}]"; + //system("echo '[{$$nnName},{$val1}->{$val2}]' >>/tmp/test.txt"); + } + } + else if(isset($$cdName)) + { + $newValue=""; + for($iii=0;$iii({$newValue})]' >>/tmp/test.txt"); + } + } + else + { + if(strlen($$ppName) == 0) + $$ppName="NoValue"; + if(strcasecmp($$ppName,$inputValue) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$$ppName}->$inputValue]"; + //system("echo '[{$$nnName},{$$ppName}->$inputValue]'>>/tmp/test.txt"); + } + } + }else{ + //echo "
      Can not find $inputName's value"; + } + } + if($isChangeFlag==1) + { + $preValueInfo.=" in {$log_sysTypeName}_{$log_sysNo}_{$log_subSysNo}"; + insertLog($preValueInfo); + } +} + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + $msisdn=$_POST['iMsisdn']; + //iUserType + $orgValue=$iUserType; + $orgValue = sprintf("%02x",$orgValue); //需要理解 + //echo "<1>orgValue=$orgValue
      "; + for($i=0;$iorgValue=$orgValue
      "; + //$user_type=hexdec($orgValue); + $rent_type=$orgValue; + //echo "user_type=$user_type
      "; + $PIN =$_POST['iPIN']; + $status =$_POST['iStatus']; + $home_location0 =DecHex($_POST['iHomeLocation0']); + $home_location1 =DecHex($_POST['iHomeLocation1']); + $home_location2 =DecHex($_POST['iHomeLocation2']); + $home_location3 =DecHex($_POST['iHomeLocation3']); + $language_type = $_POST['iLanguageSet']; + $cug_id = $_POST['iCugID']; + $fav_change_counter = $_POST['iFavChangeCounter']; + $favorite_number0 = $_POST['iFavoriteNumber0']; + $favorite_number1 = $_POST['iFavoriteNumber1']; + $favorite_number2 = $_POST['iFavoriteNumber2']; + $favorite_number3 = $_POST['iFavoriteNumber3']; + $favorite_number4 = $_POST['iFavoriteNumber4']; + $free_sms_remaining_days=$_POST['ifree_sms_remaining_days']; + $pool_account_type = $_POST['ipool_account_type']; + $child_account_number = $_POST['ichild_account_number']; + $child_number_edit_count =$_POST['ichild_number_edit_count']; + $child_number1 = $_POST['ichild_number1']; + $child_number2 = $_POST['ichild_number2']; + $child_number3 = $_POST['ichild_number3']; + $child_number4 = $_POST['ichild_number4']; + $child_number5 = $_POST['ichild_number5']; + $parent_number = $_POST['iparent_number']; + $intraday_calls =$_POST['iintraday_calls']; + $intraday_sms = $_POST['iintraday_sms']; + $intraday_charged_balance = $_POST['iintraday_charged_balance']; + $cap_gprs_volume = $_POST['icap_gprs_volume']; + $cap_gprs_balance = $_POST['icap_gprs_balance']; + $gprs_volume_this_month = $_POST['igprs_volume_this_month']; + $gprs_notification_times_today=$_POST['igprs_notification_times_today']; + $callme_back_request_times=$_POST['icallme_back_request_times']; + $favorite_plan_id=$_POST['ifavorite_plan_id']; + $favorite_free_call_duration=$_POST['ifavorite_free_call_duration']; + $favorite_free_sms=$_POST['ifavorite_free_sms']; + $favorite_plan_state=$_POST['ifavorite_plan_state']; + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + // echo "
      ";
      +	// print_r($showAttrDef);
      +	// echo "
      "; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + } +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "msisdn,status,balance,mo_expiration_date,mt_expiration_date,cug_id,access_date"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; + +?> + + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + + +
      " > + + + + + + + + + 0){ + if($isBatchCreate> 0){ + ?> + + + + + =4){ + ?> + + + + + + + + + + + + +
      Server ID: + + + +       + +     + Batch amount(<=100): + + " name="create" title="" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + " name="isBatchCreate"> + +     + + + "; + ?> + + + "; + else + echo ""; + ?> + + + + "; + else + echo ""; + ?> + +  
      + + +
      + + + + + + + + + + 0){ + // echo "
      ";
      +	// print_r($tmpRow);
      +	// echo "
      "; + +// echo "$tmpRow[msisdn],$tmpRow[msisdn],$tmpRow[msisdn]
      "; + $msisdn=$tmpRow[msisdn]; + echo "\n "; + echo ""; + $seqNo++; + if($isBatchCreate > 0) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; + +//PIN +$iPIN=substr($tmpRow[PIN],0,6); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Subscriber status +$statusDef=array( + array('00','Fresh'), + array('01','Used'), + array('02','Suspended'), + array('03','Blacklist'), + array('04','Released'), + array('05','OPR Trial') + ); +$status =$tmpRow[status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Balance +$pssCardMinCount = getPubVar('pssCardMinCount') - 0; +$dotLen = strLen($pssCardMinCount) - 1; +$fmtBit = "%01.".$dotLen."f"; +$balance=$tmpRow[balance] ;// $pssCardMinCount; +//$balance=sprintf ("$fmtBit", $balance); +$balance=showComma($balance); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Promotion Balance +$pssCardMinCount = getPubVar('pssCardMinCount') - 0; +$dotLen = strLen($pssCardMinCount) - 1; +$fmtBit = "%01.".$dotLen."f"; +$promotionBalance=$tmpRow[promo_balance];// $pssCardMinCount; +//$promotionBalance=sprintf ("$fmtBit", $promotionBalance); +$promotionBalance=showComma($promotionBalance); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//Overdraft +$pssCardMinCount = getPubVar('pssCardMinCount') - 0; +$dotLen = strLen($pssCardMinCount) - 1; +$fmtBit = "%01.".$dotLen."f"; +$iOverdraft=$tmpRow[overdraft] ;// $pssCardMinCount; +//$iOverdraft=sprintf ("$fmtBit", $iOverdraft); +$iOverdraft=showComma($iOverdraft); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Access day +$iFirstUsedDate =substr($tmpRow[access_date],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//MO Expiration +$iMoExpirationDate=substr($tmpRow[mo_expiration_date],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//MT Expiration +$iMtExpirationDate=substr($tmpRow[mt_expiration_date],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Promotion date +$iPromotionDate=substr($tmpRow[promo_exp_date],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//COS ID +$iCosId=HexDec($tmpRow[cos_id]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Charge type +//$iUserType =dechex($tmpRow[rent_type]); +$iUserType =$tmpRow[rent_type]; +//$iUserType = sprintf("%02x",hexdec($iUserType)); +//echo "$tmpRow[user_type],$tmpRow[user_type],$tmpRow[user_type],$iUserType
      "; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Home location +$iHomeLocation0=HexDec($tmpRow[home_location0]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Home location +$iHomeLocation1=HexDec($tmpRow[home_location1]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Home location +$iHomeLocation2=HexDec($tmpRow[home_location2]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Home location +$iHomeLocation3=HexDec($tmpRow[home_location3]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CloseUserGroup ID +$iCugID=$tmpRow[cug_id]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Language set +$iLanguageSet=$tmpRow[language_type]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Recharge failed times +$iRechargeFail =HexDec($tmpRow[recharge_fail_counter]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Free SM counter +$iFreeSmCounter=HexDec($tmpRow[sm_inquiry_counter]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +/* +//Familiy number flag +$iFavFlag=$tmpRow[fav_numbers]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +*/ +//Familiy number counter +$iFavChangeCounter=HexDec($tmpRow[fav_change_counter]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 0 +$iFavoriteNumber0=$tmpRow[favorite_number0]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 1 +$iFavoriteNumber1=$tmpRow[favorite_number1]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 2 +$iFavoriteNumber2=$tmpRow[favorite_number2]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 3 +$iFavoriteNumber3=$tmpRow[favorite_number3]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 4 +$iFavoriteNumber4=$tmpRow[favorite_number4]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Last call type +$lastCallDef=array( + array('0','mo call'), + array('1','mt call'), + array('2','mf call'), + array('3','mo sms') + ); +$lastCall =$tmpRow[last_call_type]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//Last Call time +$iLastCallDate=substr($tmpRow[last_call_time],0,12); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Last Call msisdn +$iLastCallMsisdn=$tmpRow[last_call_number]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//ifree_sms_remaining_days +$free_sms_remaining_days=$tmpRow[free_sms_remaining_days]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//pool_account_type +$poolAccountTypeDef=array( + array('0','Normal'), + array('1','Parent'), + array('2','Child') +); +$pool_account_type =$tmpRow[pool_account_type]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//child_account_number +$child_account_number=$tmpRow[child_account_number]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + +//child_number_edit_count +$child_number_edit_count=$tmpRow[child_number_edit_count]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//child_number1 +$child_number1=$tmpRow[child_number1]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//child_number2 +$child_number2=$tmpRow[child_number2]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//child_number3 +$child_number3=$tmpRow[child_number3]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//child_number4 +$child_number4=$tmpRow[child_number4]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//child_number5 +$child_number5=$tmpRow[child_number5]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//parent_number +$parent_number=$tmpRow[parent_number]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//intraday_calls +$intraday_calls=$tmpRow[intraday_calls]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + +//intraday_sms +$intraday_sms=$tmpRow[intraday_sms]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + +//intraday_charged_balance +$intraday_charged_balance=$tmpRow[intraday_charged_balance]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//cap_gprs_volume +$cap_gprs_volume=$tmpRow[cap_gprs_volume]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//cap_gprs_balance +$cap_gprs_balance=$tmpRow[cap_gprs_balance]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//gprs_volume_this_month +$gprs_volume_this_month=$tmpRow[gprs_volume_this_month]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + +//gprs_notification_times_today +$gprs_notification_times_today=$tmpRow[gprs_notification_times_today]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//callme_back_request_times +$callme_back_request_times=$tmpRow[callme_back_request_times]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//favorite_plan_id +$favorite_plan_id=$tmpRow[favorite_plan_id]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//favorite_free_call_duration +$favorite_free_call_duration=$tmpRow[favorite_free_call_duration]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//favorite_free_sms +$favorite_free_sms=$tmpRow[favorite_free_sms]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//Friends and Family Plan State +$ffPlanStateDef=array( + array('0','Normal'), + array('1','Suspend') +); +$favorite_plan_state =$tmpRow[favorite_plan_state]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + + + +?> +
      No.NameValueDescription
      $seqNo Start MSISDNMSISDN"; + echo ""; + echo "MSISDN = phone number of the subscriber. Includes the country code and area code,len should be 9-16
      $seqNo Password"; +echo ""; +echo "Pin of the account,only support digits of 0-9
      $seqNo Status"; +echo ""; +echo "Fresh=not activated, Used=activated, Suspended=suspended from prepaid service, Blacklist=blacklisted, Released=released from service suspension
      $seqNo Balance"; +echo "$balance"; +echo "Balance amount of PPS account in the smallest currency unit.
      $seqNo Promotion bonus"; +echo "$promotionBalance"; +echo "Promotion balance after recharge specific recharge card in specific period, this value can not be used as periodic charge.
      $seqNo Overdraft"; +echo "$iOverdraft"; +echo "Set credit amount of an account, can be positive or negative.
      If this value is set to positive then subscriber can use the PPS service until his account balance turn to the negative overdraft value.
      If this value is set to negative then subscriber can use PPS service until his account balance turn to the absolute overdraft value. Default=0
      $seqNo Access date"; +//echo ""; +echo "$iFirstUsedDate"; +echo "For fresh account, this is the creation date of the blank account; For activated accounts, then this is the date of the first recharge
      $seqNo MO Expiry date"; +echo ""; +echo "$iMoExpirationDate"; +echo "Format: yyyymmdd
      Expiry date of an account to make MO call. The expiration date will be extended by every successful recharge
      $seqNo MT Expiry date"; +echo ""; +echo "$iMtExpirationDate"; +echo "Format: yyyymmdd
      Expiry date of an account to make MT call. The expiration date will be extended by every successful recharge
      $seqNo Promotion bonus validity"; +//echo ""; +echo "$iPromotionDate"; +echo "Promotion balance expiry day, if no promotion day set then this value should be the same as MT Expiration date
      $seqNo COS ID"; +//echo ""; +echo "$iCosId"; +echo "Class of Service (COS) defines prepaid service packages, includes service parameter, tariff plan
      $seqNo Rent type"; +$preValue=""; +echo ""; +for($i=0;$i{$rentTypeDef[$i][2]}
      "; + $preValue.="{$rentTypeDef[$i][2]},"; + }else{ + echo "{$rentTypeDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      There are 8 rental types can be set in the Rent tariff
      Please refer to the Rent tariff to set this rent type
      Default=no rent
      $seqNo Home location0"; +echo ""; +echo "Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet.
      $seqNo Home location1"; +echo ""; +echo "Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet.
      $seqNo Home location2"; +echo ""; +echo "Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet.
      $seqNo Home location3"; +echo ""; +echo "Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet.
      $seqNo CUG ID"; +echo ""; +echo "Define the close user group to which this subscriber belongs
      Any call within a single user group will be charged by the user group billing rate. PPS supports maximum 10,000 user groups
      0=the subscriber is not a CUG user. Default=0 +
      $seqNo Language type"; +echo ""; +echo ""; +echo "Code of default voice type, and announcement will be played by the code defined lanague for the account, this code is defined in SRF paramete"; +echo "
      $seqNo Recharge failure"; +//echo ""; +echo "$iRechargeFail"; +echo "Legal recharge failure, subscriber who breaks the threshold will be marked in blacklist and suspended from service provisioning
      $seqNo SM inquiry counter"; +//echo ""; +echo "$iFreeSmCounter"; +echo ""; +echo "Quantity of balance inquiry by short message in a day. System provides certain quantity of free inquiry for one day"; +echo "
      $seqNo Friends and family number counter"; +echo ""; +echo "$iFavFlag"; +echo ""; +echo "Enable or disable favorite number service"; +echo "
      $seqNo Friends and family number edit counter"; +//echo ""; +echo "$iFavChangeCounter"; +echo ""; +echo "Total quantity of favorite number set. System provides certain quantity of free favorite number change"; +echo "
      $seqNo Friends and family number 0"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Friends and family number 1"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Friends and family number 2"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Friends and family number 3"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Friends and family number 4"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Last call type"; +for($i=0;$i"; +echo "-
      $seqNo Last call time"; +echo ""; +if(strlen($iLastCallDate)>0) + echo "$iLastCallDate"; +else + echo "-"; +echo "Last call taken place time
      $seqNo Last call number"; +if(strlen($iLastCallMsisdn)>0) + echo "$iLastCallMsisdn"; +else + echo "-"; +echo "Last call msisdn
      $seqNo Free SMS Remaining Days"; +if(trim($free_sms_remaining_days) == "") + echo "-"; +else + echo "$free_sms_remaining_days"; + +//echo ""; +echo "--
      $seqNo Pool Account Type"; +echo ""; +echo "--
      $seqNo Child Account Number"; +if(trim($child_account_number) == "") + echo "-"; +else + echo "$child_account_number"; +//echo ""; +echo "--
      $seqNo Child Number Edit Count"; +if(trim($child_number_edit_count) == "") + echo "-"; +else + echo "$child_number_edit_count"; +//echo ""; +echo "--
      $seqNo Child Number 1"; +echo ""; +echo "--
      $seqNo Child Number 2"; +echo ""; +echo "--
      $seqNo Child Number 3"; +echo ""; +echo "--
      $seqNo Child Number 4"; +echo ""; +echo "--
      $seqNo Child Number 5"; +echo ""; +echo "--
      $seqNo Parent Number"; +echo ""; +echo "--
      $seqNo Intraday Calls"; +if(trim($intraday_calls) == "") + echo "-"; +else + echo "$intraday_calls"; +//echo ""; +echo "--
      $seqNo Intraday SMS"; +//echo ""; +if(trim($intraday_sms) == "") + echo "-"; +else + echo "$intraday_sms"; +echo "--
      $seqNo Intraday Charged Balance"; +//echo ""; +if(trim($intraday_charged_balance) == "") + echo "-"; +else + echo "$intraday_charged_balance"; +echo "--
      $seqNo Cap GPRS Volume"; +//echo ""; +if(trim($cap_gprs_volume) == "") + echo "-"; +else + echo "$cap_gprs_volume"; +echo "Unit: KB
      $seqNo Cap GPRS Balance"; +//echo ""; +if(trim($cap_gprs_balance) == "") + echo "-"; +else + echo "$cap_gprs_balance"; +echo "--
      $seqNo GPRS Volume of This Month"; +//echo ""; +if(trim($gprs_volume_this_month) == "") + echo "-"; +else + echo "$gprs_volume_this_month"; +echo "Unit: KB
      $seqNo GPRS Notification Times Today"; +//echo ""; +if(trim($gprs_notification_times_today) == "") + echo "-"; +else + echo "$gprs_notification_times_today"; +echo "--
      $seqNo Call me back request times"; +echo ""; +echo "--
      $seqNo Friends and Family Plan ID"; +echo ""; +echo "--
      $seqNo Friends and Family Free Call Duration"; +echo ""; +echo "--
      $seqNo Friends and Family Free SMS"; +echo ""; +echo "--
      $seqNo Friends and Family Plan State"; +echo ""; +echo "
      +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + diff --git a/wxc2_omc/account/priSubsMng/ppsSubsConfig b/wxc2_omc/account/priSubsMng/ppsSubsConfig new file mode 100755 index 0000000..de9ab09 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/ppsSubsConfig @@ -0,0 +1,346 @@ +[para]0[Name]MSISDN +[sqlName]msisdn[t]input[unit]MSISDN[u]00.0-15.7[u] +[v]keepAsc-low-E +[remark] +MSISDN = phone number of the subscriber. Includes the country code and area code,len should be 9-16 + +[para]1[Name]Password +[sqlName]PIN[t]input[unit]Password[u]00.0-05.7[u] +[v]keepAsc-low-0 +[remark] +Pin of the account,only support digits of 0-9 + +[para]2[Name]Status +[sqlName]status[t]select[unit]Status[u]00.0-00.7[u] +[v]0[opt]Fresh +[v]1[opt]Used +[v]2[opt]Suspend +[v]3[opt]BlackList +[v]4[opt]Released +[v]5[opt]OPR Trial +[remark] +Fresh=not activated, Used=activated, Suspended=suspended from prepaid service, Blacklist=blacklisted, Released=released from service suspension + +[para]3[Name]Balance +[sqlName]balance[t]readOnly[unit]Balance[u]00.0-03.7[u]showComma +[v]keepHex-high-0 +[remark] +Balance amount of PPS account in the smallest currency unit. + +[para]4[Name]Promotion bonus +[sqlName]promo_balance[t]readOnly[unit]Promotion bonus[u]00.0-03.7[u]showComma +[v]keepHex-high-0 +[remark] +Promotion balance after recharge specific recharge card in specific period, this value can not be used as periodic charge. + +[para]5[Name]Overdraft +[sqlName]overdraft[t]readOnly[unit]Overdraft[u]00.0-02.7[u]showComma +[v]keepHex-high-0 +[remark] +Set credit amount of an account, can be positive or negative. +If this value is set to positive then subscriber can use the PPS service until his account balance turn to the negative overdraft value. +If this value is set to negative then subscriber can use PPS service until his account balance turn to the absolute overdraft value. Default=0 + +[para]6[Name]Access date +[sqlName]access_date[t]readOnly[unit]Access date[u]00.0-06.7[u]read 8 +[v]keepHex-high-0 +[remark] +For fresh account, this is the creation date of the blank account; For activated accounts, then this is the date of the first recharge + +[para]7[Name]MO Expiry date +[sqlName]mo_expiration_date[t]readOnly[unit]MO Expiry date[u]00.0-06.7[u]read 8 +[v]keepHex-high-0 +[remark] +Format: yyyymmdd +Expiry date of an account to make MO call. The expiration date will be extended by every successful recharge + +[para]8[Name]MT Expiry date +[sqlName]mt_expiration_date[t]readOnly[unit]MT Expiry date[u]00.0-06.7[u]read 8 +[v]keepHex-high-0 +[remark] +Format: yyyymmdd +Expiry date of an account to make MT call. The expiration date will be extended by every successful recharge + +[para]9[Name]Promotion bonus validity +[sqlName]promo_exp_date[t]readOnly[unit]Promotion bonus validity[u]00.0-06.7[u]read 8 +[v]keepHex-high-0 +[remark] +Promotion balance expiry day, if no promotion day set then this value should be the same as MT Expiration date + +[para]10[Name]COS ID +[sqlName]cos_id[t]readOnly[unit]COS ID[u]00.0-00.7[u] +[v]toDec-high-0 +[remark] +Class of Service (COS) defines prepaid service packages, includes service parameter, tariff plan + +[para]11[Name]Rent type +[sqlName]rent_type[t]checkbox[unit]VMS rent[u]00.0-00.0[u] +[v]0[opt]disable +[v]1[opt]enable +[t]checkbox[unit]Rent01[u]00.1-00.1[u] +[v]0[opt]disable +[v]1[opt]enable +[t]checkbox[unit]Rent02[u]00.2-00.2[u] +[v]0[opt]disable +[v]1[opt]enable +[t]checkbox[unit]Rent03[u]00.3-00.3[u] +[v]0[opt]disable +[v]1[opt]enable +[t]checkbox[unit]Rent04[u]00.4-00.4[u] +[v]0[opt]disable +[v]1[opt]enable +[t]checkbox[unit]Rent05[u]00.5-00.5[u] +[v]0[opt]disable +[v]1[opt]enable +[t]checkbox[unit]Rent06[u]00.6-00.6[u] +[v]0[opt]disable +[v]1[opt]enable +[t]checkbox[unit]Rent07[u]00.7-00.7[u] +[v]0[opt]disable +[v]1[opt]enable +[remark] +There are 8 rental types can be set in the Rent tariff +Please refer to the Rent tariff to set this rent type +Default=no rent + +[para]12[Name]Home location0 +[sqlName]home_location0[t]input[unit]Home location0[u]00.0-00.7[u] +[v]toDec-high-0 +[remark] +Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet. + +[para]13[Name]Home location1 +[sqlName]home_location1[t]input[unit]Home location1[u]00.0-00.7[u] +[v]toDec-high-0 +[remark] +Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet. + +[para]14[Name]Home location2 +[sqlName]home_location2[t]input[unit]Home location2[u]00.0-00.7[u] +[v]toDec-high-0 +[remark] +Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet. + +[para]15[Name]Home location3 +[sqlName]home_location3[t]input[unit]Home location3[u]00.0-00.7[u] +[v]toDec-high-0 +[remark] +Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet. + +[para]16[Name]CUG ID +[sqlName]cug_id[t]input[unit]CUG ID[u]00.0-04.7[u] +[v]keepHex-high-0 +[remark] +Define the close user group to which this subscriber belongs +Any call within a single user group will be charged by the user group billing rate. PPS supports maximum 10,000 user groups +0=the subscriber is not a CUG user. Default=0 + +[para]17[Name]Language type +[sqlName]language_type[t]input[unit]Language type[u]00.0-00.7[u] +[v]keepHex-high-0 +[remark] +Code of default voice type, and announcement will be played by the code defined lanague for the account, this code is defined in SRF paramete + +[para]18[Name]Recharge failure +[sqlName]recharge_fail_counter[t]readOnly[unit]Recharge failure[u]00.0-00.7[u] +[v]toDec-high-0 +[remark] +Legal recharge failure, subscriber who breaks the threshold will be marked in blacklist and suspended from service provisioning + +[para]19[Name]SM inquiry counter +[sqlName]sm_inquiry_counter[t]readOnly[unit]SM inquiry counter[u]00.0-00.7[u] +[v]toDec-high-0 +[remark] +Quantity of balance inquiry by short message in a day. System provides certain quantity of free inquiry for one day + +[para]20[Name]Friends and family number edit counter +[sqlName]fav_change_counter[t]readOnly[unit]Friends and family number edit counter[u]00.0-00.7[u] +[v]toDec-high-0 +[remark] +Total quantity of favorite number set. System provides certain quantity of free favorite number change + +[para]21[Name]Friends and family number 0 +[sqlName]favorite_number0[t]input[unit]Friends and family number 0[u]00.0-15.7[u] +[v]keepAsc-low-F +[remark] +System provides five favorite numbers. Call to these number is charged according to favorite call tariff + +[para]22[Name]Friends and family number 1 +[sqlName]favorite_number1[t]input[unit]Friends and family number 1[u]00.0-15.7[u] +[v]keepAsc-low-F +[remark] +System provides five favorite numbers. Call to these number is charged according to favorite call tariff + +[para]23[Name]Friends and family number 2 +[sqlName]favorite_number2[t]input[unit]Friends and family number 2[u]00.0-15.7[u] +[v]keepAsc-low-F +[remark] +System provides five favorite numbers. Call to these number is charged according to favorite call tariff + +[para]24[Name]Friends and family number 3 +[sqlName]favorite_number3[t]input[unit]Friends and family number 3[u]00.0-15.7[u] +[v]keepAsc-low-F +[remark] +System provides five favorite numbers. Call to these number is charged according to favorite call tariff + +[para]25[Name]Friends and family number 4 +[sqlName]favorite_number4[t]input[unit]Friends and family number 4[u]00.0-15.7[u] +[v]keepAsc-low-F +[remark] +System provides five favorite numbers. Call to these number is charged according to favorite call tariff + +[para]26[Name]Last call type +[sqlName]last_call_type[t]show[unit]Last call type[u]00.0-00.7[u] +[v]0[opt]mo call +[v]1[opt]mt call +[v]2[opt]mf call +[v]3[opt]mo sms +[remark] +- + +[para]27[Name]Last call time +[sqlName]last_call_time[t]readOnly[unit]Last call time[u]00.0-04.7[u]read 12 - +[v]keepHex-high-0 +[remark] +Last call taken place time + +[para]28[Name]Last call number +[sqlName]last_call_number[t]readOnly[unit]Last call number[u]00.0-15.7[u]- +[v]keepAsc-high-0 +[remark] +Last call msisdn + +[para]29[Name]Free SMS Remaining Days +[sqlName]free_sms_remaining_days[t]readOnly[unit]Free SMS Remaining Days[u]00.0-00.7[u] +[v]keepHex-high-0 +[remark] +-- + +[para]30[Name]Pool Account Type +[sqlName]pool_account_type[t]select[unit]Pool Account Type[u]00.0-00.7[u] +[v]0[opt]Normal +[v]1[opt]Parent +[v]2[opt]Child +[remark] +-- + +[para]31[Name]Child Account Number +[sqlName]child_account_number[t]readOnly[unit]Child Account Number[u]00.0-00.7[u]- +[v]keepHex-high-0 +[remark] +-- + +[para]32[Name]Child Number Edit Count +[sqlName]child_number_edit_count[t]readOnly[unit]Child Number Edit Count[u]00.0-00.7[u]- +[v]keepHex-high-0 +[remark] +-- + +[para]33[Name]Child Number 1 +[sqlName]child_number1[t]input[unit]Child Number 1[u]00.0-17.7[u] +[v]keepAsc-low-F +[remark] +-- + +[para]34[Name]Child Number 2 +[sqlName]child_number2[t]input[unit]Child Number 2[u]00.0-17.7[u] +[v]keepAsc-low-F +[remark] +-- + +[para]35[Name]Child Number 3 +[sqlName]child_number3[t]input[unit]Child Number 3[u]00.0-17.7[u] +[v]keepAsc-low-F +[remark] +-- + +[para]36[Name]Child Number 4 +[sqlName]child_number4[t]input[unit]Child Number 4[u]00.0-17.7[u] +[v]keepAsc-low-F +[remark] +-- + +[para]37[Name]Child Number 5 +[sqlName]child_number5[t]input[unit]Child Number 5[u]00.0-17.7[u] +[v]keepAsc-low-F +[remark] +-- + +[para]38[Name]Parent Number +[sqlName]parent_number[t]input[unit]Parent Number[u]00.0-17.7[u] +[v]keepAsc-low-F +[remark] +-- + +[para]39[Name]Intraday Calls +[sqlName]intraday_calls[t]readOnly[unit]Intraday Calls[u]00.0-04.7[u]- +[v]keepHex-high-0 +[remark] +-- + +[para]40[Name]Intraday SMS +[sqlName]intraday_sms[t]readOnly[unit]Intraday SMS[u]00.0-04.7[u]- +[v]keepHex-high-0 +[remark] +-- + +[para]41[Name]Intraday Charged Balance +[sqlName]intraday_charged_balance[t]readOnly[unit]Intraday Charged Balance[u]00.0-04.7[u]- +[v]keepHex-high-0 +[remark] +-- + +[para]42[Name]Cap GPRS Volume +[sqlName]cap_gprs_volume[t]readOnly[unit]Cap GPRS Volume[u]00.0-04.7[u]- +[v]keepHex-high-0 +[remark] +Unit: KB + +[para]43[Name]Cap GPRS Balance +[sqlName]cap_gprs_balance[t]readOnly[unit]Cap GPRS Balance[u]00.0-04.7[u]- +[v]keepHex-high-0 +[remark] +-- + +[para]44[Name]GPRS Volume of This Month +[sqlName]gprs_volume_this_month[t]readOnly[unit]GPRS Volume of This Month[u]00.0-04.7[u]- +[v]keepHex-high-0 +[remark] +Unit: KB + +[para]45[Name]GPRS Notification Times Today +[sqlName]gprs_notification_times_today[t]readOnly[unit]GPRS Notification Times Today[u]00.0-01.7[u]- +[v]keepHex-high-0 +[remark] +-- + +[para]46[Name]Call me back request times +[sqlName]callme_back_request_times[t]input[unit]Call me back request times[u]00.0-00.7[u] +[v]keepHex-high-0 +[remark] +-- + +[para]47[Name]Friends and Family Plan ID +[sqlName]favorite_plan_id[t]input[unit]Friends and Family Plan ID[u]00.0-00.7[u] +[v]keepHex-high-0 +[remark] +-- + +[para]48[Name]Friends and Family Free Call Duration +[sqlName]favorite_free_call_duration[t]input[unit]Friends and Family Free Call Duration[u]00.0-04.7[u] +[v]keepHex-high-0 +[remark] +-- + +[para]49[Name]Friends and Family Free SMS +[sqlName]favorite_free_sms[t]input[unit]Friends and Family Free SMS[u]00.0-04.7[u] +[v]keepHex-high-0 +[remark] +-- + +[para]50[Name]Friends and Family Plan State +[sqlName]favorite_plan_state[t]select[unit]Friends and Family Plan State[u]00.0-00.7[u] +[v]0[opt]Normal +[v]1[opt]Suspend +[remark] +-- diff --git a/wxc2_omc/account/priSubsMng/rcmCardConf.php b/wxc2_omc/account/priSubsMng/rcmCardConf.php new file mode 100755 index 0000000..ba1d000 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/rcmCardConf.php @@ -0,0 +1,396 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +//------------选择语言版本---------- +if($language == 'eng'){ + +}else{ + +} + +$userTypeDef=array( + //array('Name', 'offset','remark'), + array('rent01', '00.0' ,'rent01'), + array('rent02', '00.1' ,'rent02'), + array('rent03', '00.2' ,'rent03'), + array('rent04', '00.3' ,'rent04'), + array('rent05', '00.4' ,'rent05'), + array('rent06', '00.5' ,'rent06'), + array('rent07', '00.6' ,'rent07'), + array('rent08', '00.7' ,'rent08') +); + +//select sum(balance) from user_info +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +//保存用户数据修改的数据 +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- + + +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'card_no', 'inputName'=>'cardNo'), + array('fieldName'=>'card_hrn', 'inputName'=>'password'), + array('fieldName'=>'face_value', 'inputName'=>'faceValue'), + array('fieldName'=>'card_status', 'inputName'=>'cardStatus'), + array('fieldName'=>'expiry_date', 'inputName'=>'expiryDate'), + array('fieldName'=>'valid_time', 'inputName'=>'validTime'), + array('fieldName'=>'msisdn_used', 'inputName'=>'msisdnUsed'), + array('fieldName'=>'update_date', 'inputName'=>'updateDate') +); + +//检查各个需要编辑的输入单元 +if($DEBUG && $_SERVER['REQUEST_METHOD'] == "POST"){ + for($i=0;$i$inputName = $inputValue"; + }else{ + echo "
      Can not find $inputName's value"; + } + } +} + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + $card_no =$cardNo; + $card_hrn =$password; + $face_value =$faceValue; + $card_status =$cardStatus; + $expiry_date =$expiryDate; + $valid_time =$validTime; + $msisdn_used =$msisdnUsed; + $update_date =$updateDate; + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + } +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "card_no,face_value,card_status,expiry_date,valid_time,updated_date,msisdn_used"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +?> + + +tmpRow[{$showAttrDef[$i][fieldName]}]={$showAttrDef[$i][defaultValue]}"; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$seqNo=0; +?> + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + +
      " > + + + + + + + + +
      + + + + + +       + + + + +  
      +
      + + + + + + + + +"; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//password +$password=$tmpRow[card_hrn]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//faceValue +$faceValue=$tmpRow[face_value]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//card_status +$cardStatus=$tmpRow[card_status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//expiry_date +$expiryDate=$tmpRow[expiry_date]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//valid_time +$validTime=$tmpRow[valid_time]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//msisdn_used +$msisdn_used=$tmpRow[msisdn_used]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//update_date +$updateDate=$tmpRow[update_date]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +?> +
      No.NameValueDescription
      $seqNo Card no."; +echo " $cardNo"; +echo " 
      $seqNo Password"; +echo " $password"; +echo " 
      $seqNo Face value"; +echo " $faceValue"; +echo " 
      $seqNo Card status"; +if($cardStatus == 0){ + echo " fresh"; +}else if($cardStatus == 1){ + echo " used"; +}else if($cardStatus == 2){ + echo " suspended"; +} +//echo " $cardStatus"; +echo " 
      $seqNo Expiry date"; +echo " $expiryDate"; +echo " 
      $seqNo Valid days"; +echo " $validTime"; +echo " 
      $seqNo MSISDN charged"; +echo " $msisdn_used"; +echo " 
      $seqNo Update date"; +echo " $updateDate"; +echo " 
      +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/rcmSubsConf.php b/wxc2_omc/account/priSubsMng/rcmSubsConf.php new file mode 100755 index 0000000..baadce7 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/rcmSubsConf.php @@ -0,0 +1,1336 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +$rentTypeDef=array( + //array('Name', 'offset','remark'), + array('rent01', '00.0' ,'VMS rent'), + array('rent02', '00.1' ,'Rent01'), + array('rent03', '00.2' ,'Rent02'), + array('rent04', '00.3' ,'Rent03'), + array('rent05', '00.4' ,'Rent04'), + array('rent06', '00.5' ,'Rent05'), + array('rent07', '00.6' ,'Rent06'), + array('rent08', '00.7' ,'Rent07'), +); + +//select sum(balance) from user_info +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +//保存用户数据修改的数据 +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'msisdn', 'inputName'=>'iMsisdn'), + array('fieldName'=>'PIN', 'inputName'=>'iPIN'), + array('fieldName'=>'status', 'inputName'=>'iStatus'), + array('fieldName'=>'rent_type', 'inputName'=>'iUserType'), + array('fieldName'=>'home_location0', 'inputName'=>'iHomeLocation0'), + array('fieldName'=>'home_location1', 'inputName'=>'iHomeLocation1'), + array('fieldName'=>'home_location2', 'inputName'=>'iHomeLocation2'), + array('fieldName'=>'home_location3', 'inputName'=>'iHomeLocation3'), + array('fieldName'=>'cug_id', 'inputName'=>'iCugID'), + array('fieldName'=>'language_type', 'inputName'=>'iLanguageSet'), + array('fieldName'=>'fav_change_counter', 'inputName'=>'iFavChangeCounter'), + array('fieldName'=>'favorite_number0', 'inputName'=>'iFavoriteNumber0'), + array('fieldName'=>'favorite_number1', 'inputName'=>'iFavoriteNumber1'), + array('fieldName'=>'favorite_number2', 'inputName'=>'iFavoriteNumber2'), + array('fieldName'=>'favorite_number3', 'inputName'=>'iFavoriteNumber3'), + array('fieldName'=>'favorite_number4', 'inputName'=>'iFavoriteNumber4'), + //array('fieldName'=>'free_sms_remaining_days', 'inputName'=>'ifree_sms_remaining_days'), + array('fieldName'=>'pool_account_type', 'inputName'=>'ipool_account_type'), + array('fieldName'=>'child_account_number', 'inputName'=>'ichild_account_number'), + //array('fieldName'=>'child_number_edit_count', 'inputName'=>'ichild_number_edit_count'), + array('fieldName'=>'child_number1', 'inputName'=>'ichild_number1'), + array('fieldName'=>'child_number2', 'inputName'=>'ichild_number2'), + array('fieldName'=>'child_number3', 'inputName'=>'ichild_number3'), + array('fieldName'=>'child_number4', 'inputName'=>'ichild_number4'), + array('fieldName'=>'child_number5', 'inputName'=>'ichild_number5'), + array('fieldName'=>'parent_number', 'inputName'=>'iparent_number'), + //array('fieldName'=>'intraday_calls', 'inputName'=>'iintraday_calls'), + //array('fieldName'=>'intraday_sms', 'inputName'=>'iintraday_sms'), + //array('fieldName'=>'intraday_charged_balance', 'inputName'=>'iintraday_charged_balance'), + //array('fieldName'=>'cap_gprs_volume', 'inputName'=>'icap_gprs_volume'), + //array('fieldName'=>'cap_gprs_balance', 'inputName'=>'icap_gprs_balance'), + //array('fieldName'=>'gprs_volume_this_month', 'inputName'=>'igprs_volume_this_month'), + //array('fieldName'=>'gprs_notification_times_today', 'inputName'=>'igprs_notification_times_today') + array('fieldName'=>'callme_back_request_times', 'inputName'=>'icallme_back_request_times') +); + +//For operation log use +{ + $iStatus_def=array( + "00"=>"Fresh","0"=>"Fresh", + "01"=>"Used","1"=>"Used", + "02"=>"Suspended","2"=>"Suspended", + "03"=>"Blacklist","3"=>"Blacklist", + "04"=>"Released","4"=>"Released", + "05"=>"OPR Trial","5"=>"OPR Trial" + ); + + $pool_account_type_def=array( + 0=>"Normal", + 1=>"Parent", + 2=>"Child" + ); +} + +$logFieldDef=array( + 'iPIN', + 'iStatus', + 'iUserType', + 'iHomeLocation0', + 'iHomeLocation1', + 'iHomeLocation2', + 'iHomeLocation3', + 'iCugID', + 'iLanguageSet', + 'iFavoriteNumber0', + 'iFavoriteNumber1', + 'iFavoriteNumber2', + 'iFavoriteNumber3', + 'iFavoriteNumber4', + //'ifree_sms_remaining_days', + 'ipool_account_type', + //'ichild_account_number', + //'ichild_number_edit_count', + 'ichild_number1', + 'ichild_number2', + 'ichild_number3', + 'ichild_number4', + 'ichild_number5', + 'iparent_number', + //'iintraday_calls', + //'iintraday_sms', + //'iintraday_charged_balance', + //'icap_gprs_volume', + //'icap_gprs_balance', + //'igprs_volume_this_month', + //'igprs_notification_times_today' + 'icallme_back_request_times', +); + + +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //system("echo '-------------------------------------'>>/tmp/test.txt"); + $preValueInfo="Change $pre_keyvalue "; + $isChangeFlag=0; + for($i=0;$i$inputName = $inputValue"; + if(isset($$ddName)) + { + $tmpv=$$ppName; + $val1=${$$ddName}[$tmpv]; + $val2=${$$ddName}[$inputValue]; + if(strlen($$ppName) == 0) + $val1="NoValue"; + + if(strcasecmp($val1,$val2) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$val1}->{$val2}]"; + //system("echo '[{$$nnName},{$val1}->{$val2}]' >>/tmp/test.txt"); + } + } + else if(isset($$cdName)) + { + $newValue=""; + for($iii=0;$iii({$newValue})]' >>/tmp/test.txt"); + } + } + else + { + if(strlen($$ppName) == 0) + $$ppName="NoValue"; + if(strcasecmp($$ppName,$inputValue) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$$ppName}->$inputValue]"; + //system("echo '[{$$nnName},{$$ppName}->$inputValue]'>>/tmp/test.txt"); + } + } + }else{ + //echo "
      Can not find $inputName's value"; + } + } + if($isChangeFlag==1) + { + $preValueInfo.=" in {$log_sysTypeName}_{$log_sysNo}_{$log_subSysNo}"; + insertLog($preValueInfo); + } +} + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + $msisdn=$iMsisdn; + //iUserType + $orgValue=$iUserType; + $orgValue = sprintf("%02x",$orgValue); //需要理解 + //echo "<1>orgValue=$orgValue
      "; + for($i=0;$iorgValue=$orgValue
      "; + //$user_type=hexdec($orgValue); + $rent_type=$orgValue; + //echo "user_type=$user_type
      "; + $PIN =$iPIN; + $status = $iStatus; + $home_location0 =DecHex($iHomeLocation0); + $home_location1 =DecHex($iHomeLocation1); + $home_location2 =DecHex($iHomeLocation2); + $home_location3 =DecHex($iHomeLocation3); + $language_type = $iLanguageSet; + $cug_id = $iCugID; + $fav_change_counter = $iFavChangeCounter; + $favorite_number0 = $iFavoriteNumber0; + $favorite_number1 = $iFavoriteNumber1; + $favorite_number2 = $iFavoriteNumber2; + $favorite_number3 = $iFavoriteNumber3; + $favorite_number4 = $iFavoriteNumber4; + $free_sms_remaining_days=$ifree_sms_remaining_days; + $pool_account_type = $ipool_account_type; + $child_account_number = $ichild_account_number; + $child_number_edit_count = $ichild_number_edit_count; + $child_number1 = $ichild_number1; + $child_number2 = $ichild_number2; + $child_number3 = $ichild_number3; + $child_number4 = $ichild_number4; + $child_number5 = $ichild_number5; + $parent_number = $iparent_number; + $intraday_calls = $iintraday_calls; + $intraday_sms = $iintraday_sms; + $intraday_charged_balance = $iintraday_charged_balance; + $cap_gprs_volume = $icap_gprs_volume; + $cap_gprs_balance = $icap_gprs_balance; + $gprs_volume_this_month = $igprs_volume_this_month; + $gprs_notification_times_today=$igprs_notification_times_today; + $callme_back_request_times=$icallme_back_request_times; + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + } +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "msisdn,status,balance,mo_expiration_date,mt_expiration_date,cug_id,access_date"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; + +?> + + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + + +
      " > + + + + + + + + + 0){ + if($isBatchCreate> 0){ + ?> + + + + + =4){ + ?> + + + + + + + + + + + + +
      Server ID: + + + +       + +     + Batch amount(<=100): + + " name="create" title="" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + " name="isBatchCreate"> + +     + + + + + + + + + + )"> + +  
      + + +
      + + + + + + + + + + 0){ +// echo "$tmpRow[msisdn],$tmpRow[msisdn],$tmpRow[msisdn]
      "; + $msisdn=$tmpRow[msisdn]; + echo "\n "; + echo ""; + $seqNo++; + if($isBatchCreate > 0) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; + +//PIN +$iPIN=substr($tmpRow[PIN],0,6); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Subscriber status +$statusDef=array( + array('00','Fresh'), + array('01','Used'), + array('02','Suspended'), + array('03','Blacklist'), + array('04','Released'), + array('05','OPR Trial') + ); +$status =$tmpRow[status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Balance +$pssCardMinCount = getPubVar('pssCardMinCount') - 0; +$dotLen = strLen($pssCardMinCount) - 1; +$fmtBit = "%01.".$dotLen."f"; +$balance=$tmpRow[balance] ;// $pssCardMinCount; +//$balance=sprintf ("$fmtBit", $balance); +$balance=showComma($balance); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Promotion Balance +$pssCardMinCount = getPubVar('pssCardMinCount') - 0; +$dotLen = strLen($pssCardMinCount) - 1; +$fmtBit = "%01.".$dotLen."f"; +$promotionBalance=$tmpRow[promo_balance];// $pssCardMinCount; +//$promotionBalance=sprintf ("$fmtBit", $promotionBalance); +$promotionBalance=showComma($promotionBalance); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//Overdraft +$pssCardMinCount = getPubVar('pssCardMinCount') - 0; +$dotLen = strLen($pssCardMinCount) - 1; +$fmtBit = "%01.".$dotLen."f"; +$iOverdraft=$tmpRow[overdraft] ;// $pssCardMinCount; +//$iOverdraft=sprintf ("$fmtBit", $iOverdraft); +$iOverdraft=showComma($iOverdraft); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Access day +$iFirstUsedDate =substr($tmpRow[access_date],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//MO Expiration +$iMoExpirationDate=substr($tmpRow[mo_expiration_date],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//MT Expiration +$iMtExpirationDate=substr($tmpRow[mt_expiration_date],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Promotion date +$iPromotionDate=substr($tmpRow[promo_exp_date],0,8); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//COS ID +$iCosId=HexDec($tmpRow[cos_id]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Charge type +//$iUserType =dechex($tmpRow[rent_type]); +$iUserType =$tmpRow[rent_type]; +//$iUserType = sprintf("%02x",hexdec($iUserType)); +//echo "$tmpRow[user_type],$tmpRow[user_type],$tmpRow[user_type],$iUserType
      "; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Home location +$iHomeLocation0=HexDec($tmpRow[home_location0]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Home location +$iHomeLocation1=HexDec($tmpRow[home_location1]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Home location +$iHomeLocation2=HexDec($tmpRow[home_location2]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Home location +$iHomeLocation3=HexDec($tmpRow[home_location3]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CloseUserGroup ID +$iCugID=$tmpRow[cug_id]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Language set +$iLanguageSet=$tmpRow[language_type]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Recharge failed times +$iRechargeFail =HexDec($tmpRow[recharge_fail_counter]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Free SM counter +$iFreeSmCounter=HexDec($tmpRow[sm_inquiry_counter]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +/* +//Familiy number flag +$iFavFlag=$tmpRow[fav_numbers]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +*/ +//Familiy number counter +$iFavChangeCounter=HexDec($tmpRow[fav_change_counter]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 0 +$iFavoriteNumber0=$tmpRow[favorite_number0]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 1 +$iFavoriteNumber1=$tmpRow[favorite_number1]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 2 +$iFavoriteNumber2=$tmpRow[favorite_number2]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 3 +$iFavoriteNumber3=$tmpRow[favorite_number3]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Familiy number 4 +$iFavoriteNumber4=$tmpRow[favorite_number4]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Last call type +$lastCallDef=array( + array('0','mo call'), + array('1','mt call'), + array('2','mf call'), + array('3','mo sms') + ); +$lastCall =$tmpRow[last_call_type]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//Last Call time +$iLastCallDate=substr($tmpRow[last_call_time],0,12); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//Last Call msisdn +$iLastCallMsisdn=$tmpRow[last_call_number]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//ifree_sms_remaining_days +$free_sms_remaining_days=$tmpRow[free_sms_remaining_days]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//pool_account_type +$poolAccountTypeDef=array( + array('0','Normal'), + array('1','Parent'), + array('2','Child') +); +$pool_account_type =$tmpRow[pool_account_type]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//child_account_number +$child_account_number=$tmpRow[child_account_number]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + +//child_number_edit_count +$child_number_edit_count=$tmpRow[child_number_edit_count]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//child_number1 +$child_number1=$tmpRow[child_number1]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//child_number2 +$child_number2=$tmpRow[child_number2]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//child_number3 +$child_number3=$tmpRow[child_number3]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//child_number4 +$child_number4=$tmpRow[child_number4]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//child_number5 +$child_number5=$tmpRow[child_number5]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//parent_number +$parent_number=$tmpRow[parent_number]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//intraday_calls +$intraday_calls=$tmpRow[intraday_calls]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + +//intraday_sms +$intraday_sms=$tmpRow[intraday_sms]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + +//intraday_charged_balance +$intraday_charged_balance=$tmpRow[intraday_charged_balance]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//cap_gprs_volume +$cap_gprs_volume=$tmpRow[cap_gprs_volume]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//cap_gprs_balance +$cap_gprs_balance=$tmpRow[cap_gprs_balance]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//gprs_volume_this_month +$gprs_volume_this_month=$tmpRow[gprs_volume_this_month]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + +//gprs_notification_times_today +$gprs_notification_times_today=$tmpRow[gprs_notification_times_today]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +//echo ""; +//echo ""; +echo ""; +echo ""; + + +//callme_back_request_times +$callme_back_request_times=$tmpRow[callme_back_request_times]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +?> +
      No.NameValueDescription
      $seqNo Start MSISDNMSISDN"; + echo ""; + echo "MSISDN = phone number of the subscriber. Includes the country code and area code,len should be 9-16
      $seqNo Password"; +echo ""; +echo "Pin of the account,only support digits of 0-9
      $seqNo Status"; +echo ""; +echo "Fresh=not activated, Used=activated, Suspended=suspended from prepaid service, Blacklist=blacklisted, Released=released from service suspension
      $seqNo Balance"; +echo "$balance"; +echo "Balance amount of PPS account in the smallest currency unit.
      $seqNo Promotion bonus"; +echo "$promotionBalance"; +echo "Promotion balance after recharge specific recharge card in specific period, this value can not be used as periodic charge.
      $seqNo Overdraft"; +echo "$iOverdraft"; +echo "Set credit amount of an account, can be positive or negative.
      If this value is set to positive then subscriber can use the PPS service until his account balance turn to the negative overdraft value.
      If this value is set to negative then subscriber can use PPS service until his account balance turn to the absolute overdraft value. Default=0
      $seqNo Access date"; +//echo ""; +echo "$iFirstUsedDate"; +echo "For fresh account, this is the creation date of the blank account; For activated accounts, then this is the date of the first recharge
      $seqNo MO Expiry date"; +echo ""; +echo "$iMoExpirationDate"; +echo "Format: yyyymmdd
      Expiry date of an account to make MO call. The expiration date will be extended by every successful recharge
      $seqNo MT Expiry date"; +echo ""; +echo "$iMtExpirationDate"; +echo "Format: yyyymmdd
      Expiry date of an account to make MT call. The expiration date will be extended by every successful recharge
      $seqNo Promotion bonus validity"; +//echo ""; +echo "$iPromotionDate"; +echo "Promotion balance expiry day, if no promotion day set then this value should be the same as MT Expiration date
      $seqNo COS ID"; +//echo ""; +echo "$iCosId"; +echo "Class of Service (COS) defines prepaid service packages, includes service parameter, tariff plan
      $seqNo Rent type"; +$preValue=""; +echo ""; +for($i=0;$i{$rentTypeDef[$i][2]}
      "; + $preValue.="{$rentTypeDef[$i][2]},"; + }else{ + echo "{$rentTypeDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      There are 8 rental types can be set in the Rent tariff
      Please refer to the Rent tariff to set this rent type
      Default=no rent
      $seqNo Home location0"; +echo ""; +echo "Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet.
      $seqNo Home location1"; +echo ""; +echo "Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet.
      $seqNo Home location2"; +echo ""; +echo "Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet.
      $seqNo Home location3"; +echo ""; +echo "Home area of the account, besides these areas, the account is treated as roaming user.255 means not set yet.
      $seqNo CUG ID"; +echo ""; +echo "Define the close user group to which this subscriber belongs
      Any call within a single user group will be charged by the user group billing rate. PPS supports maximum 10,000 user groups
      0=the subscriber is not a CUG user. Default=0 +
      $seqNo Language type"; +echo ""; +echo ""; +echo "Code of default voice type, and announcement will be played by the code defined lanague for the account, this code is defined in SRF paramete"; +echo "
      $seqNo Recharge failure"; +//echo ""; +echo "$iRechargeFail"; +echo "Legal recharge failure, subscriber who breaks the threshold will be marked in blacklist and suspended from service provisioning
      $seqNo SM inquiry counter"; +//echo ""; +echo "$iFreeSmCounter"; +echo ""; +echo "Quantity of balance inquiry by short message in a day. System provides certain quantity of free inquiry for one day"; +echo "
      $seqNo Friends and family number counter"; +echo ""; +echo "$iFavFlag"; +echo ""; +echo "Enable or disable favorite number service"; +echo "
      $seqNo Friends and family number edit counter"; +//echo ""; +echo "$iFavChangeCounter"; +echo ""; +echo "Total quantity of favorite number set. System provides certain quantity of free favorite number change"; +echo "
      $seqNo Friends and family number 0"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Friends and family number 1"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Friends and family number 2"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Friends and family number 3"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Friends and family number 4"; +echo ""; +echo ""; +echo "System provides five favorite numbers. Call to these number is charged according to favorite call tariff"; +echo "
      $seqNo Last call type"; +for($i=0;$i"; +echo "-
      $seqNo Last call time"; +echo ""; +if(strlen($iLastCallDate)>0) + echo "$iLastCallDate"; +else + echo "-"; +echo "Last call taken place time
      $seqNo Last call number"; +if(strlen($iLastCallMsisdn)>0) + echo "$iLastCallMsisdn"; +else + echo "-"; +echo "Last call msisdn
      $seqNo Free SMS Remaining Days"; +if(trim($free_sms_remaining_days) == "") + echo "-"; +else + echo "$free_sms_remaining_days"; + +//echo ""; +echo "--
      $seqNo Pool Account Type"; +echo ""; +echo "--
      $seqNo Child Account Number"; +if(trim($child_account_number) == "") + echo "-"; +else + echo "$child_account_number"; +//echo ""; +echo "--
      $seqNo Child Number Edit Count"; +if(trim($child_number_edit_count) == "") + echo "-"; +else + echo "$child_number_edit_count"; +//echo ""; +echo "--
      $seqNo Child Number 1"; +echo ""; +echo "--
      $seqNo Child Number 2"; +echo ""; +echo "--
      $seqNo Child Number 3"; +echo ""; +echo "--
      $seqNo Child Number 4"; +echo ""; +echo "--
      $seqNo Child Number 5"; +echo ""; +echo "--
      $seqNo Parent Number"; +echo ""; +echo "--
      $seqNo Intraday Calls"; +if(trim($intraday_calls) == "") + echo "-"; +else + echo "$intraday_calls"; +//echo ""; +echo "--
      $seqNo Intraday SMS"; +//echo ""; +if(trim($intraday_sms) == "") + echo "-"; +else + echo "$intraday_sms"; +echo "--
      $seqNo Intraday Charged Balance"; +//echo ""; +if(trim($intraday_charged_balance) == "") + echo "-"; +else + echo "$intraday_charged_balance"; +echo "--
      $seqNo Cap GPRS Volume"; +//echo ""; +if(trim($cap_gprs_volume) == "") + echo "-"; +else + echo "$cap_gprs_volume"; +echo "Unit: KB
      $seqNo Cap GPRS Balance"; +//echo ""; +if(trim($cap_gprs_balance) == "") + echo "-"; +else + echo "$cap_gprs_balance"; +echo "--
      $seqNo GPRS Volume of This Month"; +//echo ""; +if(trim($gprs_volume_this_month) == "") + echo "-"; +else + echo "$gprs_volume_this_month"; +echo "Unit: KB
      $seqNo GPRS Notification Times Today"; +//echo ""; +if(trim($gprs_notification_times_today) == "") + echo "-"; +else + echo "$gprs_notification_times_today"; +echo "--
      $seqNo Call me back request times"; +echo ""; +echo "--
      +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + diff --git a/wxc2_omc/account/priSubsMng/sn-hlrSubsConf.php b/wxc2_omc/account/priSubsMng/sn-hlrSubsConf.php new file mode 100755 index 0000000..3368d59 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/sn-hlrSubsConf.php @@ -0,0 +1,904 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +//------------选择语言版本---------- +if($language == 'eng'){ + +}else{ + +} + +$odbCodeDef=array( + //array('inputName', 'offset' ,'remark'), + array('OUT_LOCAL', '00.0' ,'本地呼出'), + array('OUT_TRK', '00.1' ,'出局呼叫'), + array('OUT_NATION', '00.2' ,'国内长途'), + array('OUT_INTERNATION', '00.3' ,'国际长途'), + array('All_IN_CALL', '01.1' ,'所有来电') +); + +$restrictDef=array( + //array('inputName', 'offset' ,'remark'), + array('restrictGrp_1', '00.0' ,'组1'), + array('restrictGrp_2', '00.1' ,'组2'), + array('restrictGrp_3', '00.2' ,'组3'), + array('restrictGrp_4', '00.3' ,'组4') +); + +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +//保存用户数据修改的数据 +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- +$showAttrDef=array( + array('fieldName'=>'used_flag', 'inputName'=>'used_flag'), + array('fieldName'=>'imsi', 'inputName'=>'imsi'), + array('fieldName'=>'msisdn', 'inputName'=>'msisdn'), + //array('fieldName'=>'acc_mode', 'inputName'=>'acc_mode'), + //array('fieldName'=>'lac', 'inputName'=>'lac'), + array('fieldName'=>'ODB_Code', 'inputName'=>'ODB_Code'), + array('fieldName'=>'clip_state', 'inputName'=>'clip_state'), + array('fieldName'=>'callwait_state', 'inputName'=>'callwait_state'), + array('fieldName'=>'callhold_state', 'inputName'=>'callhold_state'), + //array('fieldName'=>'seccall_state', 'inputName'=>'seccall_state'), + array('fieldName'=>'group_number', 'inputName'=>'group_number'), + array('fieldName'=>'alarm_time', 'inputName'=>'alarm_time'), + array('fieldName'=>'call_bar_opt', 'inputName'=>'call_bar_opt'), + array('fieldName'=>'call_bar_pwd', 'inputName'=>'call_bar_pwd'), + //array('fieldName'=>'bar_pw_attemp', 'inputName'=>'bar_pw_attemp'), + array('fieldName'=>'boic_state', 'inputName'=>'boic_state'), + array('fieldName'=>'boic_hplmn', 'inputName'=>'boic_hplmn'), + array('fieldName'=>'baic_state', 'inputName'=>'baic_state'), + array('fieldName'=>'boc_state', 'inputName'=>'boc_state'), + array('fieldName'=>'baoc_state', 'inputName'=>'baoc_state'), + array('fieldName'=>'cfu_state', 'inputName'=>'cfu_state'), + array('fieldName'=>'cfu_number', 'inputName'=>'cfu_number'), + array('fieldName'=>'cfb_state', 'inputName'=>'cfb_state'), + array('fieldName'=>'cfb_num', 'inputName'=>'cfb_num'), + array('fieldName'=>'cfnry_st', 'inputName'=>'cfnry_st'), + array('fieldName'=>'cfnry_num', 'inputName'=>'cfnry_num'), + array('fieldName'=>'cfnry_time', 'inputName'=>'cfnry_time'), + array('fieldName'=>'cfnrc_st', 'inputName'=>'cfnrc_st'), + array('fieldName'=>'cfnrc_num', 'inputName'=>'cfnrc_num'), + array('fieldName'=>'Restrict_num', 'inputName'=>'Restrict_num'), + array('fieldName'=>'CCBS', 'inputName'=>'CCBS'), + array('fieldName'=>'mutiPty_call', 'inputName'=>'mutiPty_call'), + array('fieldName'=>'malicious_call', 'inputName'=>'malicious_call') +); + +//如果fieldName和inputName相等,则不用做附加处理 +//否则,需要根据这个变量的值来做一些附加处理,例如电话号码的前补91后补E,或是一些复选框的合并 + +//检查各个需要编辑的输入单元 +if($DEBUG && $_SERVER['REQUEST_METHOD'] == "POST"){ + for($i=0;$i$inputName = $inputValue"; + }else{ + echo "
      Can not find $inputName's value"; + } + } +} + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //显示时需要处理拆分的字段,提交后也需要处理合成 + //$lac =dechex($lac); + + $cfnry_time=dechex($cfnry_time); + + //ODB_Code + $orgValue=$ODB_Code; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $inputOffset=$odbCodeDef[$i][1]; + if($DEBUG) echo "
      setBitValue($orgValue,$inputOffset,$inputValue)"; + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $ODB_Code=$orgValue; + + //Restrict_num + $orgValue=$Restrict_num; + for($i=0;$i$inputName = $inputValue"; + if(strlen($inputValue) == 0){ + $inputValue=0; + } + $inputOffset=$restrictDef[$i][1]; + if($DEBUG) echo "
      setBitValue($orgValue,$inputOffset,$inputValue)"; + $orgValue=setBitValue($orgValue,$inputOffset,$inputValue); + } + $Restrict_num=$orgValue; + + //格式化每个需要保存的字段,以便数据处理模块处理 + $bgnNo=0; + $endNo=0; + for($i=$bgnNo;$icheckBox_$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + if($canSetNum != 'all' && $endNo > $canSetNum){ + break; + } + } + //if($DEBUG) exit(); +} +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "imsi,msisdn,used_flag,lac"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +?> + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + +
      " > + + + + + + 0){ + ?> + + + + + + + + + + + +
      + + + + + +       + + " name="create" title="" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + +     + + + + + + + + + + + + )"> + +  
      +
      + + + + + + + + +"; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + + +//imsi +$imsi=$tmpRow[imsi]; +if($isTryCreate > 0){ + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + $acc_mode=$tmpRow[acc_mode]; + if($acc_mode == '01'){ + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo "\n "; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; + } +} + + +//msisdn +$msisdn =$tmpRow[msisdn]; +$msisdn =str_replace('E','',$msisdn); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//acc_mode +$acc_mode=$tmpRow[acc_mode]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//lac +$lac =str_replace('F','',$tmpRow[lac]); +$lac =hexdec($lac); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//ODB_Code +//$odbCodeDef在前面定义,因为提交后合成值也需要 +$ODB_Code=$tmpRow[ODB_Code]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +for($i=0;$i"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + +//增值业务==================================== +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + + +//clip_state +$clip_state=$tmpRow[clip_state]; +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//callwait_state +$tmpDef=array( + //array('value','Name'), + array('05','激活'), + array('04','未激活'), + array('00','未提供') + ); +$tmpName='callwait_state'; +$callwait_state=$tmpRow[callwait_state]; +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//callhold_state +$callhold_state=$tmpRow[callhold_state]; +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +/* +//seccall_state +$seccall_state=$tmpRow[seccall_state]; +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +*/ + +//group_number +$group_number=$tmpRow[group_number]; +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//alarm_time +$tmpDef=array( + //array('value','Name'), + array('05','激活'), + array('04','未激活'), + array('00','未提供') + ); +$tmpName='alarm_time'; +$alarm_time=$tmpRow[alarm_time]; +$alarmFlag=substr($alarm_time,2,1); +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$alarmHour=substr($alarm_time,0,1); +$alarmMinute=substr($alarmMinute,1,1); +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//呼叫限制========================================== +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//call_bar_opt +$tmpDef=array( + //array('value','Name'), + array('00','操作员控制'), + array('01','用户控制(使用密码)'), + array('02','用户控制(不使用密码)') + ); +$call_bar_opt=$tmpRow[call_bar_opt]; +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//call_bar_pwd +$call_bar_pwd=$tmpRow[call_bar_pwd]; +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +/* +//bar_pw_attemp +$bar_pw_attemp=$tmpRow[bar_pw_attemp]; +echo "\n "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +*/ + +$tmpDef=array( + //array('value','Name'), + array('05','激活'), + array('04','未激活'), + array('00','未提供') + ); +$callBarDef=array( + //array('fieldName','Remark'), + array('boic_state','国际长途限制'), + array('boic_hplmn','国内长途限制'), + array('baic_state','呼入限制(免打扰)'), + array('boc_state','出局呼叫限制'), + array('baoc_state','本地呼出限制') + ); +for($j=0;$j"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + +//呼叫转移=================================== +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//call_bar_opt +$tmpDef=array( + //array('value','Name'), + array('05','激活'), + array('04','未激活'), + array('00','未提供') + ); + +$cfDef=array( + //array('fieldName_1','Remark_1','fieldName_2','Remark_2'), + array('cfu_state', '无条件转移(CFU)', 'cfu_number', '无条件转移号码'), + array('cfb_state', '遇忙转移(CFB)', 'cfb_num', '遇忙转移号码'), + array('cfnry_st', '无应答转移(CFNRy)', 'cfnry_num', '无应答转移号码', 'cfnry_time', '无应答转移时间设置'), + array('cfnrc_st', '不在服务区转移(CFNRc)','cfnrc_num', '不在服务区转移号码') + ); +for($j=0;$j"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "\n "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if(strlen($cfDef[$j][4]) > 0){ + $tmpName_3 =$cfDef[$j][4]; + $tmpValue_3 =hexdec($tmpRow[$tmpName_3]); + $tmpRemark_3 =$cfDef[$j][5]; + echo "\n "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +} + +//Restrict_num +$Restrict_num=$tmpRow[Restrict_num]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +$tmpCallDef=array( + //array('fieldName','Remark'), + array('CCBS','遇忙回叫'), + array('mutiPty_call','三方通话'), + array('malicious_call','通话中转移') + ); +$tmpDef=array( + //array('value','Name'), + array('01','提供'), + array('00','未提供') + ); +for($j=0;$j"; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
      No.项目取值说明
      $seqNo 使用标志"; +if($used_flag > '00'){ + echo "使用中"; + echo "      "; + echo "未使用"; +}else{ + echo "使用中"; + echo "      "; + echo "未使用"; +} +echo " 
      $seqNo IMSI"; + echo ""; + echo " 
      $seqNo EAN编号"; + echo " 
      $seqNo 端口号"; + echo " 
      $seqNo IMSI$imsi"; + echo ""; + echo " 
      $seqNo 电话号码"; +echo ""; +echo " 
      $seqNo 用户类别"; +if($isTryCreate > 0){ + if($acc_mode == '01'){ + echo "固定用户  "; + echo "移动用户"; + }else{ + echo "固定用户  "; + echo "移动用户"; + } +}else{ + if($acc_mode == '01'){ + echo "固定用户"; + }else{ + echo "移动用户"; + } +} +echo ""; +echo " 
      $seqNo LAC编号"; +echo "$lac"; +echo " 
      $seqNo 用户权限(ODB)"; +echo "  "; +echo " 
        {$odbCodeDef[$i][2]}"; + $value=getBitValue($ODB_Code,$odbCodeDef[$i][1]); + if($value == '0'){ + echo "无限制  "; + echo "禁用"; + }else{ + echo "无限制  "; + echo "禁用"; + } + echo " 
      $seqNo 增值业务  
       来电显示"; +if($clip_state == '01'){ + echo "提供  "; + echo "未提供"; +}else{ + echo "提供  "; + echo "未提供"; +} +echo " 
       呼叫等待"; +for($i=0;$i  "; +} +echo " 
       呼叫保持"; +if($callhold_state == '01'){ + echo "提供  "; + echo "未提供"; +}else{ + echo "提供  "; + echo "未提供"; +} +echo " 
       恶意电话追踪"; +if($seccall_state == '01'){ + echo "提供  "; + echo "未提供"; +}else{ + echo "提供  "; + echo "未提供"; +} +echo " 
       集团用户"; +echo ""; +echo "集团用户,0号代表不属于任何集团
       闹钟服务"; +for($i=0;$i  "; +} +echo " 
       闹钟时间设置"; +echo "小时"; +echo "  分钟"; +echo " 
      $seqNo 呼叫限制 "; +echo " 
       控制方式"; +echo ""; +echo " 
       权限密码"; +echo ""; +echo " 
       允许密码输措次数"; +echo ""; +echo " 
        $tmpRemark"; + for($i=0;$i  "; + } + echo " 
      $seqNo 呼叫转移 "; +echo " 
        $tmpRemark_1"; + for($i=0;$i  "; + } + echo " 
        $tmpRemark_2"; + echo ""; + echo " 
        $tmpRemark_3"; + echo "(s)"; + echo " 
      $seqNo 呼叫组限制"; +echo ""; +echo ""; +for($i=0;$i  "; + }else{ + echo "{$restrictDef[$i][2]}  "; + } +} +echo ""; +echo " 
      $seqNo $tmpRemark"; + for($i=0;$i  "; + } + echo " 
      +"; +echo "\n"; +echo "\n"; +?> + +
      +  + + + + \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/subsOverview.php b/wxc2_omc/account/priSubsMng/subsOverview.php new file mode 100755 index 0000000..510c9b4 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/subsOverview.php @@ -0,0 +1,247 @@ +sysId=$sysId"; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + // echo "sysTypeNo=$sysTypeNo,sysNo=$sysNo"; +} + + +//overview statistic webpage +if(isset($overview)){ + if($DEBUG) echo "****************** Overview **********************
      "; + switch($sysTypeNo){ + case '330': //HLR + //select HLR subscriber count + $selSql = "SELECT count(*) FROM $tableName"; + if($DEBUG) echo "
      selSql=$selSql"; + $result=@mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + $nHlrSubscriber = $record[0]; + if($DEBUG) echo "
      nHlrSubscriber=$nHlrSubscriber"; + + //select postpaid subscriber total + //camel_flag: + //highest bit=1 => Enable Prepaid; highest bit=0 => Disable Postpaid + $nPrepaidTotal = 0; + $nPostTotal = 0; + $nGprs = 0; + $nNoGprs = 0; + $nBoth = 0; + $selSql = "SELECT camel_flag,nam FROM $tableName"; + if($DEBUG) echo "
      selSql=$selSql"; + $result=@mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + do{ + $flag = substr($record[camel_flag],0,1); + //prepaid subscriber + if('8'==$flag){ + $nPrepaidTotal++; + } + //postpaid subscriber + elseif('0'==$flag){ + $nPostTotal++; + } + + $nam = $record[nam] - 0; + if (1 == $nam){ + $nNoGprs++; + }elseif (2 == $nam){ + $nGprs++; + }elseif (0 == $nam){ + $nBoth++; + } + }while($record=@mysqli_fetch_array($result)); + if($DEBUG) echo "
      nPrepaidTotal=$nPrepaidTotal,nPostTotal=$nPostTotal"; + if($DEBUG) echo "
      nNoGprs=$nNoGprs,nGprs=$nGprs,nBoth=$nBoth"; + echo "

      HLR subscriber statistics

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      HLR subscriber$nHlrSubscriber
      Postpay subscriberPrepay subscriberOnly non-GPRS subscriberOnly GPRS subscriberBoth GPRS and non-GPRS subscriber
      $nPostTotal$nPrepaidTotal$nNoGprs$nGprs$nBoth
      "; + break; + case '360': //PPS + case '395': + //total pps subscriber + $selSql = "SELECT count(*) FROM $tableName"; + if($DEBUG) echo "
      selSql=$selSql"; + $result=@mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + $nPpsAmount = $record[0]; + if($DEBUG) echo "
      nPpsAmount=$nPpsAmount"; + + //statistics by all kinds of types + $nFresh=0; + $nUsed=0; + $nSuspend=0; + $nBlacklist=0; + $nRelease=0; + $nLowbalance=0; + if(0==$dataTypeNo){ + $selSql = "SELECT status FROM $tableName"; + if($DEBUG) echo "
      selSql=$selSql"; + $result=@mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + do{ + switch($record[0]){ + case "00": + $nFresh++; + break; + case "01": + $nUsed++; + break; + case "02": + $nSuspend++; + break; + case "03": + $nBlacklist++; + break; + case "04": + $nRelease++; + break; + case "05": + $nLowbalance++; + break; + default: + break; + } + }while( $record=@mysqli_fetch_array($result) ); + if($DEBUG) echo "
      nFresh=$nFresh,nSuspend=$nSuspend,nBlacklist=$nBlacklist,nRelease=$nRelease,nLowbalance"; + + //display + echo "

      PPS subscriber statistics

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Prepaid subscriber$nPpsAmount
      Fresh$nFresh
      Normal$nUsed
      Suspend$nSuspend
      Blacklist$nBlacklist
      Release$nRelease
      Low balance$nLowbalance
      "; + } + else{ + $selSql = "SELECT card_status FROM $tableName"; + if($DEBUG) echo "
      selSql=$selSql"; + $result=@mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + do{ + if(0==$record[0]){ + $nFresh++; + } + else{ + $nUsed++; + } + }while( $record=@mysqli_fetch_array($result) ); + if($DEBUG) echo "
      nFresh=$nFresh,nUsed=$nUsed"; + + //display + echo "

      PPS Recharge card statistics

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Recharge card$nPpsAmount
      Fresh$nFresh
      Used$nUsed
      "; + } + break; + default: + break; + } + + exit(0); +} + +if ( isset($searchInServer) ) { + if ($DEBUG) { + echo "****************** Search in server **********************
      "; + echo "$targetPage?sysId=$sysId&dataTypeNo=$dataTypeNo&keyValue=$selKeyValue&canSetNum=$canSetNum&isRead=1
      "; + } +?> + + diff --git a/wxc2_omc/account/priSubsMng/subscriberConfig.php b/wxc2_omc/account/priSubsMng/subscriberConfig.php new file mode 100755 index 0000000..76863c5 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/subscriberConfig.php @@ -0,0 +1,1473 @@ + 0)?$TEST:0; + +//========================================================== +//变量定义 +//========================================================== +$canwrite_flag=checkWritePrivilege(); + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; +$nReplaceIndexComm = 6; + +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$sysConfTable = 'OMC_PUB.sysConf'; +$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:0); +$objDb = omcGetObjDb($sysTypeNo); +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf,$dataTypeNo); + +$pubDb ='OMC_PUB'; +$maxLevelNum = 10; +//value Type +$nInteger = 2; +$nAscStr = 3; +$nOctStr = 4; +$seqNo=0; + +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType,$dataTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.subsParamConf_'.$dataTypeNo; + return($tableName); +} +if($sysTypeNo =="") +{ + $sysType=explode('_',$sysId); + $sysTypeNo=$sysType[0]; + } +if($sysTypeNo==325) + $file='vlrSubsConfig'; +elseif($sysTypeNo==330) + $file='hlrSubsConfig'; +elseif($sysTypeNo==360) + $file='ppsSubsConfig'; +elseif($sysTypeNo==340) + $file='aucSubsConfig'; +elseif($sysTypeNo==380) + $file='eirSubsConfig'; +elseif($sysTypeNo==390) + $file='vmsSubsConfig'; +elseif($sysTypeNo==370) + $file='mnpSubsConfig'; +elseif($sysTypeNo==375) + $file='oprSubsConfig'; +elseif($sysTypeNo==378) + $file='ipalimrSubsConfig'; + +//read config file +function readConfigFile($file){ + $fp=fopen($file,"r"); + if (!$fp) + { + echo "
      $file file do not exist!"; + exit(); + } + $buffer=file_get_contents($file); + $paraArr = explode('[para]',$buffer); + fclose($fp); + return($paraArr); +} +$paraArr=readConfigFile($file); +$paraNum=sizeof($paraArr); +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- +$canSetNum = isset($canSetNum)?$canSetNum:'all'; + + +//write log message +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //system("echo '-------------------------------------'>>/tmp/test.txt"); + $preValueInfo="Change $pre_keyvalue "; + $isChangeFlag=0; + //debug_log("/tmp/debug.txt",write_log_message); + for($i=$beginNo;$i<$paraNumber;$i++){ + + $remarkArr = explode('[remark]',$paraArr[$i]); + $sqlArr = explode('[sqlName]',$remarkArr[0]); + $nameArr = explode('[Name]',$sqlArr[0]); + $paraName = $nameArr[1]; + $paraName=chop($paraName); + //explode by '[t]' + $tArr = explode('[t]',$sqlArr[1]); + $sqlName=$tArr[0]; + + $checknewValue=""; + $checkoldValue=""; + for($ii=1;$ii2 && $typename!='checkbox') + $nnName=$paraName." ".$namedetail[0]; + else + $nnName=$paraName; + if(isset($$ddName)) + { + $newValue=""; + for($j=1;$j=44) + //echo "
      [$a]:orgValue=$orgValue,$sqlName"; + + for($i=1;$i <= ${'unitNum_'.$a};$i++) + { + + $tmpDef = ${'unitDef_'.$a.'_'.$i}; + $tmpValue = ${'unit_'.$a.'_'.$i}; + //if($a>=44) + //echo "
      tmpDef=$tmpDef,tmpValue = $tmpValue"; + //debug_log("/tmp/debug.txt",$tmpDef); + //debug_log("/tmp/debug.txt",$tmpValue); + $defArr = $tmpDef; + $tmpDefArr=explode('-',$tmpDef); + $x=sizeof($tmpDefArr); + $specialDo=$tmpDefArr[$x-1]; + + $sqlname=$tmpDefArr[0]; + $unitValue = $tmpValue; + + $sqlnameNum=explode($sqlname.'-',$tmpDef); + $num=sizeof($sqlnameNum); + if($specialDo == 'code') + { + $xx=$num-1; + $unitDefArr = explode('-',$sqlnameNum[$xx]); + $bgnOffset1 = $unitDefArr[0]; + $unitDefArr = explode('-',$sqlnameNum[1]); + $endOffset1 = $unitDefArr[1]; + $inputOffset = $bgnOffset1.'-'.$endOffset1; + //debug_log("/tmp/debug.txt",inputOffset); + //debug_log("/tmp/debug.txt",$inputOffset); + $unitValue=encodeTelNumber($unitValue); + $orgValue=setBitValue($orgValue,$inputOffset,$unitValue); + } + else + { + for($j=$num-1;$j>0;$j--) + { + $bit=0; + $unitDefArr = explode('-',$sqlnameNum[$j]); + + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $inputOffset = $bgnOffset.'-'.$endOffset; + //if($a>=44) + //echo "
      inputOffset=$inputOffset"; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + $fillChar = chop($fillChar); + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; + $valueType=chop($valueType); + + if($num>2) + { + $beginBye=$bgnByte*8+$bgnBit; + if($valueType == 'keepHex') + { + if($bgnBit == 0) + { + $bgnHex=$bgnByte*2; + $hexLen=$byteLen*2; + $unitValue = substr($tmpValue,$bgnHex,$hexLen); + } + elseif($bgnBit == 4) + { + $bgnHex=$bgnByte*2+1; + $hexLen=$byteLen*2-1; + $unitValue = substr($tmpValue,$bgnHex,$hexLen); + } + } + else + { + $unitValue = substr($tmpValue,$beginBye,$bitLen); + } + } + //if($a>=44) + //echo "
      unitValue=$unitValue"; + //if($a>=44) + // echo "[$valueType]"; + if($operType=='specialInputHlr') + { + if(${'unit_'.$a.'_'.($i-1)}==289){ + $tmpValue1="04"; + $tmpValueArr=explode(".",${'unit_'.$a.'_'.$i}); + $iplen=sizeof($tmpValueArr); + for($xx=0;$xx=44) + //echo "
      [2]byteValue = $byteValue"; + } + else + { + $bitValue = DecBin($unitValue); + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + $bit=1; + //if($a>=44) + //echo "
      [2]bitValue = $bitValue"; + } + break; + case 'keepDec': + //if($a>=44) + //echo "
      unitValue = $unitValue"; + $byteValue = $unitValue - 0; + if($bgnBit == 0 && $endBit == 7){ + $byteValue = DecHex($byteValue); + $byteValue = omcStrFill($byteValue,$byteLen*2,$fillWay,$fillChar); + //if($a>=44) + // echo "
      [2]byteValue = $byteValue"; + } + else + { + $bitValue = DecBin($byteValue); + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + $bit=1; + //if($a>=44) + //echo "
      [2]bitValue = $bitValue"; + } + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAsc"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($n=0;$n<$tmpLen;$n++){ + $unitChar = substr($unitValue,$n,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'keepAsc': + $byteValue = $unitValue; + break; + default: + echo "Error:Unknown valueType"; + break; + } + } + if($DEBUG) echo "
      byteValue = $byteValue "; + if(strlen($orgValue) != 0 && $bit==0) + { + //if($a==19) echo "
      byteValue=$byteValue"; + $orgValue=setBitValue($orgValue,$inputOffset,$byteValue); + //if($a==19) echo "
      orgValue=$orgValue"; + } + else + { + //if($a>=44) echo "
      bit=$bit"; + $orgValue=setBitValue($orgValue,$inputOffset,$bitValue); + //if($a>=44) echo "
      orgValue=$orgValue"; + } + }//end for($j) + } + $lastValue = $orgValue; + + }//end for($i) + if($isCreate!=0 && $a==1){ + //$imsi + for($ii=strlen($lastValue);$ii<16;$ii++){ + $lastValue='0'.$lastValue; + } + } + if($typeName !='readOnly' && $typeName !='show') + { + $tmpFieldName = $sqlName; + if($sqlName=='inter_msisdn' || $sqlName=='fax_num' || $sqlName=='data_num') + { + //debug_log("/tmp/debug.txt",${'tmp_value_'.$a}); + if(${'tmp_value_'.$a}==$lastValue) + continue; + } + + ${'checkBox_'.$endNo} =1; + ${'fieldName_'.$endNo}=$tmpFieldName; + ${'editValue_'.$endNo}=$lastValue; + + $endNo++; + if($canSetNum != 'all' && $endNo > $canSetNum){ + break; + } + } + }//end for($a) + //debug_log("/tmp/debug.txt",$endNo); +}//end of if($set == 1) + +//数据处理 +?> + + + + +"; + +//=======================Show GUI ======================== +?> + + +
      " > + + + + + + 0){ + if($isBatchCreate> 0){ + ?> + + + + =4){ + ?> + + + + + + + + + + + + + + +
      + + + + + "; + } + elseif($sysTypeNo==380) + { + $showkeyValue= $keyValue; + $keyValueName='IMEI'; + $keyValuename='IMEI'; + echo "  $keyValueName:$showkeyValue"; + } + ?> + + +     + Batch amount(<=100): + + "; + else + echo ""; + ?> + + + " name="isBatchCreate"> + + + + + + + + + "; + else + echo ""; + } + ?> + + + + "; + else + echo ""; + } + ?> + + + "; + else + echo ""; + } + ?> + +  
      +
      + + + +$strID"; + echo ""; + echo ""; + echo ""; +} +else +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +//setValue = $setValue ,inputName = $inputName"; + +/************************************** +*objName +*[unit]name[u]xx.xx-yy.yy[u]input[v]toDec-fillHigh-fillChar +*[unit]name[u]xx.xx-yy.yy[u]select[v]value1[opt]desc1[v]value2[opt]desc2 +*[remark] +***************************************/ +if($isTryCreate > 0){ +$beginNo=1;} +else +{ + $beginNo=2; + +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +for($m=$beginNo;$m < sizeof($paraArr);$m++) +{ + echo ""; + echo ""; + $seqNo++; + + //explode by '[remark]' + $remarkArr = explode('[remark]',$paraArr[$m]); + $remark = $remarkArr[1]; + + $sqlArr = explode('[sqlName]',$remarkArr[0]); + $nameArr = explode('[Name]',$sqlArr[0]); + $paraName = $nameArr[1]; + $paraName=chop($paraName); + //explode by '[t]' + $tArr = explode('[t]',$sqlArr[1]); + $sqlName=$tArr[0]; + if($sysTypeNo == 330 && $isBatchCreate > 0 && $m ==1) + echo ""; + elseif($sysTypeNo == 360 && $isBatchCreate > 0 && $m ==1) + echo ""; + else + echo ""; + $number=$tmpRow[$sqlName]; + $tmp_value='tmp_value_'.$m; + echo ""; + + $DateSqlGetType="SELECT * FROM $paramConfTable WHERE fieldName='$sqlName'"; + $resultGet=@mysqli_query($pubConn,$DateSqlGetType); + echo mysqli_error($pubConn); + $rowsGet=@mysqli_fetch_array($resultGet); + $valueType = $rowsGet[valueType]; + echo ""; + if($sysTypeNo != 325) + { + if(trim($remark)=="") + $remark=nl2br($remark); + else + $remark=chop($remark); + echo ""; + } +}//end of for(m..) + +$paraNumber=sizeof($paraArr)-1; +echo ""; +echo "
      $strField$strValue
      No.NameValueDescription
      $seqNo Start IMSIStart MSISDN$paraName"; + echo ""; + for($i=1;$i < sizeof($tArr);$i++){ + + //unit input name + $unitName = "unit_".$m.'_'.$i; + $unitArr=explode('[unit]',$tArr[$i]); + $operType = chop($unitArr[0]); + + $tempDef = ''; + $inputValue = ''; + $readValue = ''; + $checkboxValue = ''; + $radioValue = ''; + $tmpselectValue=''; + $size = 0; + for($n=1;$n < sizeof($unitArr);$n++){ + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$n]); + if(sizeof($tlvArr) <= 1 ){ + echo ""; + continue; + } + + $firstValue= ''; + //echo "$tlvArr[1]"; + $setValue=$number; + //echo "
      $setValue"; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + $specialDo=explode('[v]',$tlvArr[2]); + + $specialDo[0]=chop($specialDo[0]); + + //echo "byteValue=$byteValue"; + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + $charValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $valueArr[1] = chop($valueArr[1]); + //echo "
      valueArr[1]=$valueArr[1]"; + if($DEBUG) echo "
      operType = $operType"; + + switch($operType){ + case 'input':// + echo ""; + //show Unit Name + if(sizeof($tArr)>2) + echo ""; + //explode by '-' + $firstValue=$inputValue; + $firstmp = $tempDef; + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      toAsc Error:bgnBit > 0 ||endBit < 7"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount < $tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + } + break; + case 'keepAsc': + $inputValue = $byteValue; + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + switch($defArr[2]){ + case '0': + $inputValue = str_replace('00','',$inputValue); + break; + case 'E': + $inputValue = str_replace('E','',$inputValue); + break; + default: break; + } + break; + default: break; + } + $inputValue=$firstValue.$inputValue; + $tempDef =$sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.$valueArr[1].'-'.$firstmp; + echo ""; + echo ""; + $tmpInputValue=$inputValue; + //echo "inputLen=$inputLen,byteLen=$byteLen"; + break; + case 'select': + //show Unit Name + echo ""; + if(sizeof($tArr)>2) + { + echo ""; + echo ""; + } + else + echo ""; + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + //echo "
      selectValue = $selectValue"; + $defArr = explode('[opt]',$valueArr[1]); + //echo "
      defArr = $defArr[1]"; + echo ""; + echo ""; + $tmpInputValue=$selectValue; + //echo "
      selectValue=$selectValue"; + break; + + case 'selectlimit': + //show Unit Name + echo ""; + if(sizeof($tArr)>2) + { + echo ""; + } + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + //echo "
      selectValue = $selectValue"; + $defArr = explode('[opt]',$valueArr[1]); + //echo "
      defArr = $defArr[1]"; + echo ""; + echo ""; + $tmpselectValue=$selectValue; + //echo "
      selectValue=$selectValue"; + break; + + case 'checkbox': + if($bitValue != ''){ + $checkboxValue = BinDec($bitValue); + }else{ + $checkboxValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      checkboxValue = $checkboxValue"; + //echo "
      checkboxValue=$checkboxValue"; + if($checkboxValue == '1'){ + echo "$tlvArr[0]
      "; + }else{ + echo "$tlvArr[0]
      "; + } + if($checkboxValue != '1') + $checkboxValue = '0'; + echo ""; + $tmpInputValue=$checkboxValue; + break; + case 'radio': + //show Unit Name + echo ""; + if(sizeof($tArr) > 2) + { + echo ""; + } + if($bitValue != ''){ + $radioValue = BinDec($bitValue); + }else{ + $radioValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      radioValue = $radioValue"; + //var_dump($valueArr); + $defArr_0 = explode('[opt]',$valueArr[1]); + $defArr_1 = explode('[opt]',$valueArr[2]); + //var_dump($defArr_0);echo '
      '; + //var_dump($defArr_1);echo '
      '; + if($defArr_0[0] == $radioValue){ + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + $tmpInputValue=$radioValue; + break; + case 'show': //显示 + //show Unit Name + if(sizeof($tArr) > 2) + echo "
      $tlvArr[0]:"; + if($bitValue != ''){ + $showValue = BinDec($bitValue); + }else{ + $showValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      radioValue = $radioValue"; + for($j=1;$j < sizeof($valueArr);$j++){ + $defArr = explode('[opt]',$valueArr[$j]); + if($defArr[0] == $showValue) + { + echo "$defArr[1]"; + echo ""; + } + } + break; + case 'readOnly': + //show Unit Name + if(sizeof($tArr)>2) + echo "
      $tlvArr[0]:"; + //explode by '-' + $firstValue = $readValue; + $firstmp = $tempDef; + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $readValue = BinDec($bitValue); + }else{ + $readValue = HexDec($byteValue); + } + break; + case 'keepDec': + $readValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $readValue = $byteValue; + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      toAsc Error:bgnBit > 0 ||endBit < 7"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount < $tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $readValue = $charValue; + } + break; + case 'keepAsc': + $readValue = $byteValue; + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      readValue = $readValue"; + //debug_log("/tmp/debug.txt",$readValue); + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + //$readValue = $readValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + switch($defArr[2]){ + case '0': + $readValue = str_replace('00','',$readValue); + break; + case 'E': + $readValue = str_replace('E','',$readValue); + break; + case 'F': + $readValue = str_replace('F','',$readValue); + break; + default: break; + } + break; + default: break; + } + $tempDef =$sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.$valueArr[1].'-'.$firstmp; + if($specialDo[0] == 'code') + $readValue=decodeTelNumber($readValue); + $readValue=$firstValue.$readValue; + if( $n == sizeof($unitArr)-1 ) + { + $readNumber=''; + if($specialDo[0] == 'showComma') + { + $readValue=showComma($readValue); + } + elseif($specialDo[0] != "") + { + $readNumber=explode(' ',$specialDo[0]); + if($readNumber[1] != "") + $readValue=substr($readValue,0,$readNumber[1]); + } + //debug_log("/tmp/debug.txt",readValue); + //debug_log("/tmp/debug.txt",$readValue); + if(trim($readValue)=="" && $specialDo[0] == '--') + echo "--"; + elseif(trim($readValue)=="" && ($specialDo[0]=='-' || $readNumber[2]=='-')) + echo "-"; + else + echo "$readValue"; + } + break; + + case 'specialInputHlr': + echo ""; + if(sizeof($tArr) > 2) + echo ""; + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = $byteValue; + } + $tmpoffset='03.0-03.7'; + $addressLen=hexdec(getBitValue($setValue,$tmpoffset)); + echo ""; + echo ""; + echo ""; + //echo "inputValue=$inputValue,tmpValue=$tmpValue"; + $tempDef = $sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + break; + case 'vlrSpecialRead': + $MCC=substr($setValue,0,2); + $MCC=strrev($MCC); + $MCC=$MCC.strrev(substr($setValue,2,2)); + $MCC=str_replace("F","",$MCC); + $MNC=substr($setValue,4,2); + $MNC=strrev($MNC); + $MNC=str_replace("F","",$MNC); + $LAC=substr($setValue,-4); + echo "$MCC-$MNC-$LAC"; + break; + case 'password': + echo "******"; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + }//end for(n..) + if($operType == 'select' || $operType == 'selectlimit' || $operType == 'show' || $operType == 'radio' || $operType == 'checkbox') + { //select + //echo "valueType=$valueType,nOctStr=$nOctStr"; + if($valueType == $nOctStr){ + $tempDef = $sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.'keepDec-high-0'; + } + if($operType != 'selectlimit' && $specialDo[0] != '') + { + $tempDef = $sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.$specialDo[0].'-high-0'; + } + } + + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + if($specialDo[0] == 'code') + $tempDef=$tempDef.'-code'; + $unitDefName='unitDef_'.$m.'_'.$i; + echo ""; + + //echo "
      tempDef=$tempDef"; + }//end of for(i..) + $unitNum=$i-1; + $unitNumName='unitNum_'.$m; + echo ""; + echo "
      {$unitArr[1]}
      $tlvArr[0]:"; + if($valueType == $nOctStr && $n==sizeof($unitArr)-1){ + if($DEBUG) echo "
      $valueType =$nOctStr= OctStr"; + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + $inputLen = $byteLen *2; + }else{ + $inputLen = $byteLen *3; + } + $size = $size + $inputLen; + echo ""; + + if($specialDo[0] == 'code') + $inputValue=decodeTelNumber($inputValue); + if($specialDo[0]=='size') + echo ""; + else + echo ""; + }elseif($valueType == $nAscStr && $n==sizeof($unitArr)-1){ + if($specialDo[0] == 'code') + $inputValue=decodeTelNumber($inputValue); + if($DEBUG) echo "
      $valueType == AscStr"; + $inputLen = $byteLen; + if($sqlName=='imsi'||$sqlName=='IMSI') + { + $inputLen=15; + echo ""; + } + if($sqlName=='msisdn'||$sqlName=='MSISDN'||$sqlName=='imei') + { + $inputLen=16; + echo ""; + } + if($specialDo[0]=='size') + echo ""; + else + echo ""; + }elseif($n==sizeof($unitArr)-1){ + if($specialDo[0] == 'code') + $inputValue=decodeTelNumber($inputValue); + if($DEBUG) echo "
      $valueType == Integer"; + if($specialDo[0]=='size') + echo ""; + else + echo ""; + echo ""; + echo ""; + } + echo ""; + + echo "
      $tlvArr[0]:"; + echo ""; + echo ""; + echo "
      $tlvArr[0]:"; + echo ""; + echo ""; + echo "
      $tlvArr[0]:"; + echo "$defArr_0[1]"; + echo "      "; + echo "$defArr_1[1]"; + echo "
      "; + echo "$defArr_0[1]"; + echo "      "; + echo "$defArr_1[1]"; + echo "
      $tlvArr[0]:"; + if('289' == $tmpInputValue){ + $tmpValue=HEXDEC(substr($inputValue,0,2)).'.'.HEXDEC(substr($inputValue,2,2)).'.'.HEXDEC(substr($inputValue,4,2)).'.'.HEXDEC(substr($inputValue,6,2)); + if($addressLen == 0) + $tmpValue=""; + echo ""; + }else if('343' == $tmpInputValue){ + $tmpValue=substr($inputValue,0,4).':'.substr($inputValue,4,4).':'.substr($inputValue,8,4).':'.substr($inputValue,12,4).':'.substr($inputValue,16,4).':'.substr($inputValue,20,4).':'.substr($inputValue,24,4).':'.substr($inputValue,28,4); + echo ""; + }else{ + $tmpArr=explode("E",$inputValue); + $tmpValue=$tmpArr[0]; + echo ""; + } + echo "
      "; + echo "
      $remark
      "; + +//*****************************************隐藏输入框,用于传递值**************************************** +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "
      "; + +echo ""; +?> + + +  + + + + \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/subscriberConfig_bak.php b/wxc2_omc/account/priSubsMng/subscriberConfig_bak.php new file mode 100755 index 0000000..7b893d9 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/subscriberConfig_bak.php @@ -0,0 +1,1410 @@ + 0)?$TEST:0; + +//========================================================== +//变量定义 +//========================================================== +$canwrite_flag=checkWritePrivilege(); + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; +$nReplaceIndexComm = 6; + +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$sysConfTable = 'OMC_PUB.sysConf'; +$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:0); +$objDb = omcGetObjDb($sysTypeNo); +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf,$dataTypeNo); + +$pubDb ='OMC_PUB'; +$maxLevelNum = 10; +//value Type +$nInteger = 2; +$nAscStr = 3; +$nOctStr = 4; +$seqNo=0; + +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType,$dataTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.subsParamConf_'.$dataTypeNo; + return($tableName); +} +if($sysTypeNo =="") +{ + $sysType=explode('_',$sysId); + $sysTypeNo=$sysType[0]; + } +if($sysTypeNo==325) + $file='vlrSubsConfig'; +elseif($sysTypeNo==330) + $file='hlrSubsConfig'; +elseif($sysTypeNo==360) + $file='ppsSubsConfig'; +elseif($sysTypeNo==340) + $file='aucSubsConfig'; +elseif($sysTypeNo==380) + $file='eirSubsConfig'; +elseif($sysTypeNo==390) + $file='vmsSubsConfig'; +elseif($sysTypeNo==370) + $file='mnpSubsConfig'; +elseif($sysTypeNo==375) + $file='oprSubsConfig'; +elseif($sysTypeNo==378) + $file='ipalimrSubsConfig'; + +//read config file +function readConfigFile($file){ + $fp=fopen($file,"r"); + if (!$fp) + { + echo "
      $file file do not exist!"; + exit(); + } + $buffer=file_get_contents($file); + $paraArr = explode('[para]',$buffer); + fclose($fp); + return($paraArr); +} +$paraArr=readConfigFile($file); +$paraNum=sizeof($paraArr); +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- +$canSetNum = isset($canSetNum)?$canSetNum:'all'; + + +//write log message +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //system("echo '-------------------------------------'>>/tmp/test.txt"); + $preValueInfo="Change $pre_keyvalue "; + $isChangeFlag=0; + debug_log("/tmp/debug.txt",write_log_message); + debug_log("/tmp/debug.txt",$paraNumber); + debug_log("/tmp/debug.txt",$beginNo); + for($i=$beginNo;$i<$paraNumber;$i++){ + + $remarkArr = explode('[remark]',$paraArr[$i]); + $sqlArr = explode('[sqlName]',$remarkArr[0]); + $nameArr = explode('[Name]',$sqlArr[0]); + $paraName = $nameArr[1]; + $paraName=chop($paraName); + //explode by '[t]' + $tArr = explode('[t]',$sqlArr[1]); + $sqlName=$tArr[0]; + for($ii=0;$iiCan not find $inputName's value"; + } + } + } + if($isChangeFlag==1) + { + $preValueInfo.=" in {$log_sysTypeName}_{$log_sysNo}_{$log_subSysNo}"; + debug_log("/tmp/debug.txt",preValueInfo); + debug_log("/tmp/debug.txt",$preValueInfo); + insertLog($preValueInfo); + } + +} + +//=======================set value From submit=================== + +if($_SERVER['REQUEST_METHOD'] == "POST"){ + if($isCreate){ + //$imsi + for($i=strlen($imsi);$i<16;$i++){ + $imsi='0'.$imsi; + } + //debug_log("/tmp/debug.txt",$imsi); + } + + $bgnNo=0; + $endNo=0; + //sort by offset + for($a=$beginNo;$a <= $paraNumber;$a++) + { + $lastValue = ''; + $k = 0; + //explode by '[remark]' + $remarkArr = explode('[remark]',$paraArr[$a]); + $sqlArr = explode('[sqlName]',$remarkArr[0]); + //explode by '[t]' + $tArr = explode('[t]',$sqlArr[1]); + $sqlName=$tArr[0]; + $type=explode('[unit]',$tArr[1]); + $typeName=$type[0]; + $oldDateSql="SELECT * FROM $paramConfTable WHERE fieldName='$sqlName'"; + $result=@mysqli_query($pubConn,$oldDateSql); + echo mysqli_error($pubConn); + $rows=@mysqli_fetch_array($result); + $orgValue=$rows[minValue]; + $valuetype=$rows[valueType]; + $length=$rows[length]; + + if($orgValue == '') + { + if($valuetype==$nInteger || $valuetype==$nAscStr) + { + for($i=1;$i<=$length;$i++) + $orgValue ='0'.$orgValue; + } + elseif($valuetype==$nOctStr) + { + for($i=1;$i<=$length;$i++) + $orgValue ='00'.$orgValue; + } + } + //if($a>=44) + //echo "
      [$a]:orgValue=$orgValue,$sqlName"; + + for($i=1;$i <= ${'unitNum_'.$a};$i++) + { + + $tmpDef = ${'unitDef_'.$a.'_'.$i}; + $tmpValue = ${'unit_'.$a.'_'.$i}; + //if($a>=44) + //echo "
      tmpDef=$tmpDef,tmpValue = $tmpValue"; + //debug_log("/tmp/debug.txt",$tmpDef); + //debug_log("/tmp/debug.txt",$tmpValue); + $defArr = $tmpDef; + $tmpDefArr=explode('-',$tmpDef); + $x=sizeof($tmpDefArr); + $specialDo=$tmpDefArr[$x-1]; + + $sqlname=$tmpDefArr[0]; + $unitValue = $tmpValue; + + $sqlnameNum=explode($sqlname.'-',$tmpDef); + $num=sizeof($sqlnameNum); + if($specialDo == 'code') + { + $xx=$num-1; + $unitDefArr = explode('-',$sqlnameNum[$xx]); + $bgnOffset1 = $unitDefArr[0]; + $unitDefArr = explode('-',$sqlnameNum[1]); + $endOffset1 = $unitDefArr[1]; + $inputOffset = $bgnOffset1.'-'.$endOffset1; + //debug_log("/tmp/debug.txt",inputOffset); + //debug_log("/tmp/debug.txt",$inputOffset); + $unitValue=encodeTelNumber($unitValue); + $orgValue=setBitValue($orgValue,$inputOffset,$unitValue); + } + else + { + for($j=$num-1;$j>0;$j--) + { + $bit=0; + $unitDefArr = explode('-',$sqlnameNum[$j]); + + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $inputOffset = $bgnOffset.'-'.$endOffset; + //if($a>=44) + //echo "
      inputOffset=$inputOffset"; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + $fillChar = chop($fillChar); + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; + $valueType=chop($valueType); + + if($num>2) + { + $beginBye=$bgnByte*8+$bgnBit; + if($valueType == 'keepHex') + { + if($bgnBit == 0) + { + $bgnHex=$bgnByte*2; + $hexLen=$byteLen*2; + $unitValue = substr($tmpValue,$bgnHex,$hexLen); + } + elseif($bgnBit == 4) + { + $bgnHex=$bgnByte*2+1; + $hexLen=$byteLen*2-1; + $unitValue = substr($tmpValue,$bgnHex,$hexLen); + } + } + else + { + $unitValue = substr($tmpValue,$beginBye,$bitLen); + } + } + //if($specialDo == 'code') + // $unitValue=encodeTelNumber($unitValue); + //if($a>=44) + //echo "
      unitValue=$unitValue"; + //if($a>=44) + // echo "[$valueType]"; + if($operType=='specialInputHlr') + { + if(${'unit_'.$a.'_'.($i-1)}==289){ + $tmpValue1="04"; + $tmpValueArr=explode(".",${'unit_'.$a.'_'.$i}); + $iplen=sizeof($tmpValueArr); + for($xx=0;$xx=44) + //echo "
      [2]byteValue = $byteValue"; + } + else + { + $bitValue = DecBin($unitValue); + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + $bit=1; + //if($a>=44) + //echo "
      [2]bitValue = $bitValue"; + } + break; + case 'keepDec': + //if($a>=44) + //echo "
      unitValue = $unitValue"; + $byteValue = $unitValue - 0; + //echo "
      [1]byteValue = $byteValue"; + if($bgnBit == 0 && $endBit == 7){ + $byteValue = DecHex($byteValue); + $byteValue = omcStrFill($byteValue,$byteLen*2,$fillWay,$fillChar); + //if($a>=44) + // echo "
      [2]byteValue = $byteValue"; + } + else + { + $bitValue = DecBin($byteValue); + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + $bit=1; + //if($a>=44) + //echo "
      [2]bitValue = $bitValue"; + } + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAsc"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($n=0;$n<$tmpLen;$n++){ + $unitChar = substr($unitValue,$n,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'keepAsc': + $byteValue = $unitValue; + break; + default: + echo "Error:Unknown valueType"; + break; + } + } + if($DEBUG) echo "
      byteValue = $byteValue "; + if(strlen($orgValue) != 0 && $bit==0) + { + //if($a==19) echo "
      byteValue=$byteValue"; + $orgValue=setBitValue($orgValue,$inputOffset,$byteValue); + //if($a==19) echo "
      orgValue=$orgValue"; + } + else + { + //if($a>=44) echo "
      bit=$bit"; + $orgValue=setBitValue($orgValue,$inputOffset,$bitValue); + //if($a>=44) echo "
      orgValue=$orgValue"; + } + }//end for($j) + } + $lastValue = $orgValue; + }//end for($i) + + if($typeName !='readOnly' && $typeName !='show') + { + $tmpFieldName = $sqlName; + if($sqlName=='inter_msisdn' || $sqlName=='fax_num' || $sqlName=='data_num') + { + //debug_log("/tmp/debug.txt",${'tmp_value_'.$a}); + if(${'tmp_value_'.$a}==$lastValue) + continue; + } + + ${'checkBox_'.$endNo} =1; + ${'fieldName_'.$endNo}=$tmpFieldName; + ${'editValue_'.$endNo}=$lastValue; + //debug_log("/tmp/debug.txt",${'checkBox_'.$endNo}); + //debug_log("/tmp/debug.txt",${'fieldName_'.$endNo}); + //debug_log("/tmp/debug.txt",${'editValue_'.$endNo}); + $endNo++; + if($canSetNum != 'all' && $endNo > $canSetNum){ + break; + } + // debug_log("/tmp/debug.txt",$updateDateSql); + } + }//end for($a) + //debug_log("/tmp/debug.txt",$endNo); +}//end of if($set == 1) + +//数据处理 +?> + + + + +"; + +//=======================Show GUI ======================== +?> + + +
      " > + + + + + + 0){ + if($isBatchCreate> 0){ + ?> + + + + =4){ + ?> + + + + + + + + + + + + + + +
      + + + + + "; + } + ?> + + +     + Batch amount(<=100): + + "; + else + echo ""; + ?> + + + " name="isBatchCreate"> + + + + + + + + + "; + else + echo ""; + } + ?> + + + + "; + else + echo ""; + } + ?> + + + "; + else + echo ""; + } + ?> + +  
      +
      + + + +$strID"; + echo ""; + echo ""; + echo ""; +} +else +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +//setValue = $setValue ,inputName = $inputName"; + +/************************************** +*objName +*[unit]name[u]xx.xx-yy.yy[u]input[v]toDec-fillHigh-fillChar +*[unit]name[u]xx.xx-yy.yy[u]select[v]value1[opt]desc1[v]value2[opt]desc2 +*[remark] +***************************************/ +if($isTryCreate > 0){ +$beginNo=1;} +else +{ + $beginNo=2; + +} +echo ""; + + + +echo ""; +echo ""; +echo ""; +echo ""; +//get imsi +//$imsi=$showkeyValue; +//for($i=strlen($imsi);$i<16;$i++){ + //$imsi='0'.$imsi; +//} +//echo "\n"; + +for($m=$beginNo;$m < sizeof($paraArr);$m++) +{ + echo ""; + echo ""; + $seqNo++; + + //explode by '[remark]' + $remarkArr = explode('[remark]',$paraArr[$m]); + $remark = $remarkArr[1]; + + $sqlArr = explode('[sqlName]',$remarkArr[0]); + $nameArr = explode('[Name]',$sqlArr[0]); + $paraName = $nameArr[1]; + $paraName=chop($paraName); + //explode by '[t]' + $tArr = explode('[t]',$sqlArr[1]); + $sqlName=$tArr[0]; + echo ""; + $number=$tmpRow[$sqlName]; + $tmp_value='tmp_value_'.$m; + echo ""; + + $DateSqlGetType="SELECT * FROM $paramConfTable WHERE fieldName='$sqlName'"; + $resultGet=@mysqli_query($pubConn,$DateSqlGetType); + echo mysqli_error($pubConn); + $rowsGet=@mysqli_fetch_array($resultGet); + $valueType = $rowsGet[valueType]; + echo ""; + if($sysTypeNo != 325) + { + $remark=nl2br($remark); + echo ""; + } +}//end of for(m..) + +$paraNumber=sizeof($paraArr)-1; +echo ""; +echo "
      $strField$strValue
      No.NameValueDescription
      $seqNo $paraName"; + echo ""; + for($i=1;$i < sizeof($tArr);$i++){ + + //unit input name + $unitName = "unit_".$m.'_'.$i; + $unitArr=explode('[unit]',$tArr[$i]); + $operType = chop($unitArr[0]); + + $tempDef = ''; + $inputValue = ''; + $readValue = ''; + $checkboxValue = ''; + $radioValue = ''; + $size = 0; + for($n=1;$n < sizeof($unitArr);$n++){ + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$n]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + $firstValue= ''; + //echo "$tlvArr[1]"; + $setValue=$number; + //echo "
      $setValue"; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + $specialDo=explode('[v]',$tlvArr[2]); + + $specialDo[0]=chop($specialDo[0]); + + //echo "byteValue=$byteValue"; + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + $charValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $valueArr[1] = chop($valueArr[1]); + //echo "
      valueArr[1]=$valueArr[1]"; + if($DEBUG) echo "
      operType = $operType"; + + switch($operType){ + case 'input':// + echo ""; + //show Unit Name + if(sizeof($tArr)>2) + echo ""; + //explode by '-' + $firstValue=$inputValue; + $firstmp = $tempDef; + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      toAsc Error:bgnBit > 0 ||endBit < 7"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount < $tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + } + break; + case 'keepAsc': + $inputValue = $byteValue; + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + switch($defArr[2]){ + case '0': + $inputValue = str_replace('00','',$inputValue); + break; + case 'E': + $inputValue = str_replace('E','',$inputValue); + break; + default: break; + } + break; + default: break; + } + $inputValue=$firstValue.$inputValue; + $tempDef =$sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.$valueArr[1].'-'.$firstmp; + echo ""; + echo ""; + $tmpInputValue=$inputValue; + //echo "inputLen=$inputLen,byteLen=$byteLen"; + break; + case 'select': + //show Unit Name + echo ""; + if(sizeof($tArr)>2) + { + echo ""; + echo ""; + } + else + echo ""; + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + //echo "
      selectValue = $selectValue"; + $defArr = explode('[opt]',$valueArr[1]); + //echo "
      defArr = $defArr[1]"; + echo ""; + echo ""; + $tmpInputValue=$selectValue; + //echo "
      selectValue=$selectValue"; + break; + case 'checkbox': + if($bitValue != ''){ + $checkboxValue = BinDec($bitValue); + }else{ + $checkboxValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      checkboxValue = $checkboxValue"; + + //echo "
      checkboxValue=$checkboxValue"; + if($checkboxValue == '1'){ + echo "$tlvArr[0]
      "; + }else{ + echo "$tlvArr[0]
      "; + } + echo ""; + echo ""; + echo ""; + $tmpInputValue=$checkboxValue; + break; + case 'radio': + //show Unit Name + echo ""; + if(sizeof($tArr) > 2) + { + echo ""; + echo ""; + } + else + echo ""; + if($bitValue != ''){ + $radioValue = BinDec($bitValue); + }else{ + $radioValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      radioValue = $radioValue"; + //var_dump($valueArr); + $defArr_0 = explode('[opt]',$valueArr[1]); + $defArr_1 = explode('[opt]',$valueArr[2]); + //var_dump($defArr_0);echo '
      '; + //var_dump($defArr_1);echo '
      '; + //echo 'xxxxx='.$defArr[0]; + //echo 'xxxxx='.$radioValue; + if($defArr_0[0] == $radioValue){ + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + $tmpInputValue=$radioValue; + //echo "$radioValue"; + break; + case 'show': //显示 + //show Unit Name + if(sizeof($tArr) > 2) + echo "
      $tlvArr[0]:"; + if($bitValue != ''){ + $showValue = BinDec($bitValue); + }else{ + $showValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      radioValue = $radioValue"; + for($j=1;$j < sizeof($valueArr);$j++){ + $defArr = explode('[opt]',$valueArr[$j]); + if($defArr[0] == $showValue) + { + echo "$defArr[1]"; + echo ""; + } + } + break; + case 'readOnly': + //show Unit Name + if(sizeof($tArr)>2) + echo "
      $tlvArr[0]:"; + //explode by '-' + $firstValue = $readValue; + $firstmp = $tempDef; + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $readValue = BinDec($bitValue); + }else{ + $readValue = HexDec($byteValue); + } + break; + case 'keepDec': + $readValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $readValue = $byteValue; + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      toAsc Error:bgnBit > 0 ||endBit < 7"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount < $tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $readValue = $charValue; + } + break; + case 'keepAsc': + $readValue = $byteValue; + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      readValue = $readValue"; + debug_log("/tmp/debug.txt",readValue1); + debug_log("/tmp/debug.txt",$readValue); + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + //$readValue = $readValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + switch($defArr[2]){ + case '0': + $readValue = str_replace('00','',$readValue); + break; + case 'E': + $readValue = str_replace('E','',$readValue); + break; + case 'F': + $readValue = str_replace('F','',$readValue); + break; + default: break; + } + break; + default: break; + } + + $tempDef =$sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.$valueArr[1].'-'.$firstmp; + if($specialDo[0] == 'code') + $readValue=decodeTelNumber($readValue); + $readValue=$firstValue.$readValue; + + if( $n == sizeof($unitArr)-1 ) + { + + $readNumber=''; + if($specialDo[0] == 'showComma') + { + $readValue=showComma($readValue); + } + elseif($specialDo[0] != "") + { + $readNumber=explode(' ',$specialDo[0]); + debug_log("/tmp/debug.txt",readValue4); + debug_log("/tmp/debug.txt",$readValue); + if($readNumber[1] != "") + $readValue=substr($readValue,0,$readNumber[1]); + debug_log("/tmp/debug.txt",readValue5); + debug_log("/tmp/debug.txt",$readValue); + } + debug_log("/tmp/debug.txt",readValue); + debug_log("/tmp/debug.txt",$readValue); + if(trim($readValue)=="" && $specialDo[0] == '--') + echo "--"; + elseif(trim($readValue)=="" && ($specialDo[0]=='-' || $readNumber[2]=='-')) + echo "-"; + else + echo "$readValue"; + } + break; + + case 'specialInputHlr': + //echo "byteValue=$byteValue,bitValue=$bitValue,tmpInputValue=$tmpInputValue"; + echo ""; + if(sizeof($tArr) > 2) + echo ""; + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = $byteValue; + } + $tmpoffset='03.0-03.7'; + $addressLen=hexdec(getBitValue($setValue,$tmpoffset)); + echo ""; + echo ""; + echo ""; + //echo "inputValue=$inputValue,tmpValue=$tmpValue"; + $tempDef = $sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + break; + case 'vlrSpecialRead': + $MCC=substr($setValue,0,2); + $MCC=strrev($MCC); + $MCC=$MCC.strrev(substr($setValue,2,2)); + $MCC=str_replace("F","",$MCC); + $MNC=substr($setValue,4,2); + $MNC=strrev($MNC); + $MNC=str_replace("F","",$MNC); + $LAC=substr($setValue,-4); + echo "$MCC-$MNC-$LAC"; + break; + case 'password': + echo "******"; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + }//end for(n..) + if($operType == 'select' || $operType == 'show' || $operType == 'radio' || $operType == 'checkbox') + { //select + //echo "valueType=$valueType,nOctStr=$nOctStr"; + if($valueType == $nOctStr){ + $tempDef = $sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.'keepDec-high-0'; + } + if($specialDo[0] != '') + { + $tempDef = $sqlName.'-'.$tlvArr[1].'-'.$operType.'-'.$specialDo[0].'-high-0'; + } + } + + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + if($specialDo[0] == 'code') + $tempDef=$tempDef.'-code'; + $unitDefName='unitDef_'.$m.'_'.$i; + //echo "$unitDefName"; + echo ""; + + //echo "
      tempDef=$tempDef"; + }//end of for(i..) + $unitNum=$i-1; + $unitNumName='unitNum_'.$m; + echo ""; + echo "
      $tlvArr[0]:"; + if($valueType == $nOctStr && $n==sizeof($unitArr)-1){ + if($DEBUG) echo "
      $valueType =$nOctStr= OctStr"; + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + $inputLen = $byteLen *2; + }else{ + $inputLen = $byteLen *3; + } + if($inputLen > 40) + { + $size = $size + $byteLen; + echo ""; + + } + else + { + $size = $size + $inputLen; + echo ""; + + } + //echo "specialDo[0]=$specialDo[0]"; + if($specialDo[0] == 'code') + $inputValue=decodeTelNumber($inputValue); + if($specialDo[0]=='size') + echo ""; + else + echo ""; + }elseif($valueType == $nAscStr && $n==sizeof($unitArr)-1){ + if($specialDo[0] == 'code') + $inputValue=decodeTelNumber($inputValue); + if($DEBUG) echo "
      $valueType == AscStr"; + $inputLen = $byteLen; + if($sqlName=='imsi') + { + $inputLen=16; + echo ""; + } + if($sqlName=='msisdn') + { + $inputLen=16; + echo ""; + } + if($specialDo[0]=='size') + echo ""; + else + echo ""; + }elseif($n==sizeof($unitArr)-1){ + if($specialDo[0] == 'code') + $inputValue=decodeTelNumber($inputValue); + if($DEBUG) echo "
      $valueType == Integer"; + if($specialDo[0]=='size') + echo ""; + else + echo ""; + echo ""; + echo ""; + } + echo ""; + + echo "
      $tlvArr[0]:"; + echo ""; + // echo ""; + break; + }elseif($defArr[0] == $selectValue){ + echo ""; + //echo ""; + //echo ""; + $isSelected = 1; + }else{ + echo ""; + } + } + if($isSelected ==0 && $j == sizeof($valueArr)){ + echo ""; + //echo ""; + } + echo ""; + echo ""; + echo "
      $tlvArr[0]:"; + echo "$defArr_0[1]"; + //echo ""; + echo "      "; + echo "$defArr_1[1]"; + echo "
      "; + echo "$defArr_0[1]"; + echo "      "; + echo "$defArr_1[1]"; + echo "
      $tlvArr[0]:"; + if('289' == $tmpInputValue){ + $tmpValue=HEXDEC(substr($inputValue,0,2)).'.'.HEXDEC(substr($inputValue,2,2)).'.'.HEXDEC(substr($inputValue,4,2)).'.'.HEXDEC(substr($inputValue,6,2)); + if($addressLen == 0) + $tmpValue=""; + echo ""; + }else if('343' == $tmpInputValue){ + $tmpValue=substr($inputValue,0,4).':'.substr($inputValue,4,4).':'.substr($inputValue,8,4).':'.substr($inputValue,12,4).':'.substr($inputValue,16,4).':'.substr($inputValue,20,4).':'.substr($inputValue,24,4).':'.substr($inputValue,28,4); + echo ""; + }else{ + $tmpArr=explode("E",$inputValue); + $tmpValue=$tmpArr[0]; + echo ""; + } + echo "
      "; + echo "
      $remark
      "; + +//*****************************************隐藏输入框,用于传递值**************************************** +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "
      "; + +echo ""; +?> + + +  + + + + \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/subscriberListDown.php b/wxc2_omc/account/priSubsMng/subscriberListDown.php new file mode 100755 index 0000000..80e4a24 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/subscriberListDown.php @@ -0,0 +1,1162 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; +$numberPerPage = 100; //每页纪录数 + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +//确定告警内容显示语言种类 +if($language=='eng'){ + $alarmDesc = alarmDesc_1; +}else{ + $alarmDesc = alarmDesc_2; +} + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +$dataTypeNo = $_REQUEST['dataTypeNo']; +$sysTypeNo = $_REQUEST['sysTypeNo']; + +$bgnNo = $_REQUEST['bgnNo']; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +$commType = $_REQUEST['commType']; +$keyValue = $_REQUEST['keyValue']; +//if(1) echo "
      sysTypeNo=$sysTypeNo"; +if ($_REQUEST['sysId']) +{ + $sysId = $_REQUEST['sysId']; + if($DEBUG) echo "
      sysId=$sysId"; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + // echo "sysTypeNo=$sysTypeNo,sysNo=$sysNo"; +} + + +if(!isset($sysNo)) + $sysNo=0; +//echo "
      sysId=$sysId"; +//根据sysTypeNo,dataTypeNo获取数据表名,索引字段名 +if($sysTypeNo==390){ + if(!isset($sysId)) + $sysId='390_0_0'; + $sysIdArr=explode('_',$sysId); + $sysNo=$sysIdArr[1]; + $getConfSql="SELECT indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' + AND dataTypeNo='$dataTypeNo' + AND sysNo='$sysNo' + "; +}else{ + $getConfSql="SELECT indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' + AND dataTypeNo='$dataTypeNo' + "; +} +if($DEBUG) echo "
      getConfSql=$getConfSql"; +$getConfResult=mysqli_query($pubConn,$getConfSql); +echo mysqli_error($pubConn); +$getConfRows=mysqli_fetch_array($getConfResult); +$tableName =$getConfRows[subsDataTable]; +$keyFieldName =$getConfRows[indexFieldName]; + + +if($DEBUG) echo "
      tableName=$tableName"; +if($DEBUG) echo "
      keyFieldName=$keyFieldName"; +//排序所依赖的字段名 +if(!isset($orderByField)){ + $orderByField = $keyFieldName; +} +if($DEBUG) echo "
      orderByField=$orderByField"; + +//排序字符串 +$orderByStr = " $orderByField"; +if($DEBUG) echo "
      orderByStr=$orderByStr"; + + +//========================================================== +//数据处理 +//========================================================== +//处理删除命令返回 +if($commType == $nDeleteComm){ + $delSql = "DELETE FROM $tableName WHERE $keyFieldName = '$keyValue'"; + if($DEBG) echo "
      delSql=$delSql"; + mysqli_query($srcDataConn,$delSql); + echo mysqli_error($srcDataConn); +} +//echo "a=$sysTypeNo"; +//定义各个系统的变量 +switch($sysTypeNo){ + case '330': + $sysTypeName='HLR'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "imsi,inter_msisdn,used_flag,nam,camel_flag"; + $showNameList="IMSI,MSISDN,Used flag,Network Access mode,Camel flag"; + $targetPage="./hlrSubsConf.php"; + //$targetPage="./subscriberConfig.php"; + break; + case '325': + $sysTypeName='VLR'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "IMSI,MSISDN,IMSIDetachFlag,LAI,O_CSI"; + $showNameList = "IMSI,MSISDN,Attach,LAI (MCC-MNC-LAC),O_CSI Flag"; + $targetPage="./vlrSubsConf.php"; + //$targetPage="./subscriberConfig.php"; + break; + case '360': + $pssCardMinCount = getPubVar('pssCardMinCount') - 0; + $dotLen = strLen($pssCardMinCount) - 1; + $fmtBit = "%01.".$dotLen."f"; + + if($dataTypeNo == 0){ + $sysTypeName='PPS'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "msisdn,status,balance,mo_expiration_date,mt_expiration_date,cug_id,access_date"; + $showNameList= "MSISDN,Status,Balance,Expiration(MO),Expiration(MT),CUG,Active since"; + $targetPage="./ppsSubsConf.php"; + //$targetPage="./subscriberConfig.php"; + }else{ + $sysTypeName='Prepaid Card'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList ="card_no,face_value,card_status,expiry_date,valid_time,updated_date,msisdn_used"; + $showNameList="Card no.,Face value,Status,Expiry date,Valid days,Updated date,MSISDN"; + $targetPage="./ppsCardConf.php"; + } + break; + case '395': + $pssCardMinCount = getPubVar('pssCardMinCount') - 0; + $dotLen = strLen($pssCardMinCount) - 1; + $fmtBit = "%01.".$dotLen."f"; + + if($dataTypeNo == 0){ + $sysTypeName='RCM'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "msisdn,status,balance,mo_expiration_date,mt_expiration_date,cug_id,access_date"; + $showNameList= "MSISDN,Status,Balance,Expiration(MO),Expiration(MT),CUG,Active since"; + $targetPage="./rcmSubsConf.php"; + }else{ + $sysTypeName='Prepaid Card'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList ="card_no,face_value,card_status,expiry_date,valid_time,updated_date,msisdn_used"; + $showNameList="Card no.,Face value,Status,Expiry date,Valid days,Updated date,MSISDN"; + $targetPage="./rcmCardConf.php"; + } + break; + case '370': + $sysTypeName='MNP'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "msisdn,status,routing_number,donor,recipient,date"; + $showNameList = "MSISDN,Status,Routing number,Donor,Recipient,Date"; + $targetPage="./mnpSubsConf.php"; + break; + case '375': + $sysTypeName='OPPS'; + $canSetNum='all'; + $tableWidth='100%'; + //$selectFieldList = "msisdn,imei,imsi,oprFlag,type,status"; + $selectFieldList = "msisdn,imsi,imei,oprFlag,class"; + //$showNameList="MSISDN,Imei,Imsi,Opr Flag,type,Status"; + $showNameList="MSISDN,IMSI,IMEI,User Status,Class"; + $targetPage="./oprSubsConf.php"; + //$targetPage="./subscriberConfig.php"; + break; + case '378': + $sysTypeName='iPALIM'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "imsi,msisdn,msisdn_extern,tmsi,lai,type"; + $showNameList = "IMSI,MSISDN Public,MSISDN Private,TMSI,MCC-MNC-LAC-CI,Type"; + $targetPage="./ipalimSubsConf.php"; + break; + case '340': + $sysTypeName='AUC'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "key_imsi,a3a8_version,status"; + $showNameList = "IMSI,A3A8 version,Service Status"; + $targetPage="./aucSubsConf.php"; + //$targetPage="./subscriberConfig.php"; + break; + case '380': + $sysTypeName='EIR'; + $canSetNum='all'; + $tableWidth='50%'; + $selectFieldList = "imei,status"; + $showNameList= "IMEI,Status"; + $targetPage="./eirSubsConf.php"; + //$targetPage="./subscriberConfig.php"; + break; + case '390': + $sysTypeName='VMS'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "msisdn,mailboxID,promo_language,greeting,pwdValue"; + $showNameList= "MSISDN,Mailbox No.,Language,Greeting type,Password"; + $targetPage="./vmsSubsConf.php"; + //$targetPage="./subscriberConfig.php"; + break; + case '253': + $sysTypeName='SN-HLR'; + $canSetNum='all'; + $tableWidth='100%'; + $selectFieldList = "imsi,msisdn,used_flag,lac"; + $showNameList= "imsi,msisdn,used_flag,lac"; + $targetPage="./snHlrSubsConf.php"; + break; + default: + echo "Unknown sysTypeNo"; + exit(1); +} +global $OMC_server; +$srcDataConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $sysTypeName."_DB"); + +//获取活动的系统id +if($sysTypeNo==390) + $getSysIdSql = "SELECT sysNo,subSysNo FROM OMC_PUB.sysInfo + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + ORDER BY baseStat DESC,updateTime DESC"; +else + $getSysIdSql = "SELECT sysNo,subSysNo FROM OMC_PUB.sysInfo + WHERE sysTypeNo='$sysTypeNo' + ORDER BY baseStat DESC,updateTime DESC"; +//if($DEBUG) +// debug_log("/tmp/debug.txt",$getSysIdSql); +$getSysIdResult=mysqli_query($pubConn,$getSysIdSql); +// debug_log("/tmp/debug.txt",$getSysIdResult); +echo mysqli_error($pubConn); +//debug_log("/tmp/debug.txt",mysqli_num_rows($getSysIdResult)); +if(mysqli_num_rows($getSysIdResult) > 0){ + + $getSysIdRows=mysqli_fetch_array($getSysIdResult); + $sysNo = $getSysIdRows[sysNo]; + $subSysNo = $getSysIdRows[subSysNo]; + $sysId = $sysTypeNo.'_'.$sysNo.'_'.$subSysNo; +}else{ + ?> + + +Can not find this system's IP in system List,"; + echo "Please add it!"; +adjust_content_tail("down"); + exit(0); +} + +$showFieldArr=explode(',',$selectFieldList); +$showNameArr=explode(',',$showNameList); + +//根据上部页面传来的变量,生成查询条件 +//debug_log("/tmp/debug.txt",$selKeyFieldName); +//debug_log("/tmp/debug.txt",$selKeyValue); +$selKeyFieldName = $_REQUEST['selKeyFieldName']; +$selKeyValue = $_REQUEST['selKeyValue']; +if(strlen($selKeyFieldName) > 0 && strlen($selKeyValue) > 0){ + $whereStr = "WHERE $selKeyFieldName like '%$selKeyValue%'"; +} +if($DEBUG)echo "sysTypeNo=$sysTypeNo,opps_type_sel=$opps_type_sel
      "; +if($sysTypeNo == 375) +{ + if(!isset($opps_type_sel)) + $opps_type_sel=0; + if($opps_type_sel == 1) + { + $whereStr="WHERE oprFlag>=0 and oprFlag<=3 "; + } + else if($opps_type_sel == 2) + { + $whereStr="WHERE oprFlag>=4 and oprFlag<=5 "; + } + if(strlen($selKeyFieldName) > 0 && strlen($selKeyValue) > 0) + { + $whereStr.="and $selKeyFieldName like '%$selKeyValue%'"; + } + //0-3,4-5 +} +//查询基本条件 +if(strlen($whereStr) > 10){ + $bascWhereStr =""; +}else{ + $bascWhereStr =""; +} + +//首次查询,查出符合条件的纪录条数,并在以后的页面跳转中传递。 +$numberOfRecords = $_REQUEST['numberOfRecords']; + +if(!$numberOfRecords){ + $bgnNo=0; + $countSql="SELECT count(*) as totalNum + FROM $tableName + $whereStr + $bascWhereStr + "; + if($DEBUG) echo "
      countSql=$countSql"; + //debug_log("/tmp/debug.txt",$countSql); + $result=mysqli_query($srcDataConn,$countSql); + //debug_log("/tmp/debug.txt",$result); + echo mysqli_error($srcDataConn); + $record = @mysqli_fetch_array($result); + //debug_log("/tmp/debug.txt",$record); + $numberOfRecords = $record[0]; + if($DEBUG) echo "
      numberOfRecords=$numberOfRecords"; + //debug_log("/tmp/debug.txt",$numberOfRecords); + if($numberOfRecords > 0){ + //debug_log("/tmp/debug.txt","test2"); + //插入日志 + //insertLog("search $sysTypeName subscriber: $selKeyValue "); + }else{ + //debug_log("/tmp/debug.txt","test3"); + //插入日志 + //insertLog("search $sysTypeName subscriber: $selKeyValue not found"); + ?> + + + "; + echo "
      $strNotFindRecord"; +adjust_content_tail("down"); + exit(); + } +} +//debug_log("/tmp/debug.txt","test"); +//找到需要显示的纪录 +if($numberOfRecords > 0){ + $showSql=" SELECT $selectFieldList + FROM $tableName + $whereStr + $bascWhereStr + ORDER BY $orderByStr + LIMIT $bgnNo, $numberPerPage + "; + if($DEBUG) echo "
      showSql=$showSql"; + $result=@mysqli_query($srcDataConn,$showSql); + echo mysqli_error($srcDataConn); + $rows=@mysqli_fetch_array($result); + + //下面是控制分页显示需要传递的变量传递变量 + if ($numberOfRecords >= 1) { + $nextBgnNo = $bgnNo + $numberPerPage; //本页的结束数目 + if ($nextBgnNo > $numberOfRecords){ + $nextBgnNo = $numberOfRecords; + } + $t1 = $bgnNo + 1; + $prevBgnNo = $bgnNo - $numberPerPage; + if ($prevBgnNo < 0) { + $prevBgnNo = 0; + } + if($sysTypeNo==390) + $basePageLink ="sysTypeNo=$sysTypeNo&sysId=$sysId&dataTypeNo=$dataTypeNo&numberOfRecords=$numberOfRecords&orderByField=$orderByField"; + else + $basePageLink ="sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&numberOfRecords=$numberOfRecords&orderByField=$orderByField"; + + $basePageLink .="&selKeyFieldName=$selKeyFieldName&selKeyValue=$selKeyValue"; + $prePageLink ="bgnNo=$prevBgnNo"; + $nextPageLink ="bgnNo=$nextBgnNo"; + } + $showBgnNo=$bgnNo+1; +} + +//========================================================== +//输出并显示数据 +//========================================================== +?> + + + + + +
      + + + + +"; + +echo " +"; +echo ""; +echo " + +
      "; +echo "$strDisplayRecords $showBgnNo - $nextBgnNo, "; +echo "($strTotal:$numberOfRecords)"; +echo ""; + // NEW: Display a link for the previous set of records. + if ($bgnNo != 0) { + echo ""; + echo "Previous $strPreviousPage "; + }else{ + echo "Previous $strPreviousPage "; + } + + //根据纪录条数,算出页码数,本页页码 + if($numberOfRecords > 0){ + $totalPageNum = ceil($numberOfRecords / $numberPerPage ); + $pageNo = $bgnNo / $numberPerPage + 1; + } + + echo ""; + + // NEW: Display a link for the next set of records. + if ($nextBgnNo != $numberOfRecords && $numberOfRecords >0) { + echo ""; + echo "$strNextPage Next"; + }else{ + echo "$strNextPage Next"; + } +?> +
      + +"; +echo ""; +for($i=0;$i"; + echo ""; + echo "$showNameArr[$i]"; + echo ""; +} +?> + + +"; + $nPos=0; + $msisdn=$rows[$nPos++]; + if(trim($msisdn)=="") + continue; + echo ""; + echo " $msisdn"; + echo ""; + + //imsi + $imsi=$rows[$nPos++]; + echo ""; + echo " $imsi"; + echo ""; + + //IMEI + $imei=$rows[$nPos++]; + echo ""; + echo " $imei"; + echo ""; + + //oprFlag + $oprFlag_label=array( + 0=>"OPR-0",//0=>"Not Registered", + 1=>"OPR-1",//1=>"OprStateWithoutRoamingAgreement", + 2=>"OPR-2a",//2=>"OprStateWithRoamingAgreement", + 3=>"OPR-2b",//3=>"RoamingState", + 4=>"IMDX-P1", + 5=>"IMDX-P2", + 6=>"IMDX-H"); + $oprFlag=$rows[$nPos++]+0; + echo ""; + echo " {$oprFlag_label[$oprFlag]}"; + echo ""; + + $oprClass_label=array( + 0=>"Ordinary", + 1=>"Premium", + 2=>"VIP" + ); + $oprClass=$rows[$nPos++]+0; + echo ""; + echo " {$oprClass_label[$oprClass]}"; + echo ""; + + //type + /* + $type_label=array(0=>"Trial",1=>"Normal"); + $type=$rows[$nPos++]+0; + echo ""; + echo " {$type_label[$type]}"; + echo ""; + */ + /* + //status + $status_label=array(0=>"Idle",1=>"Msisdn Allocated",2=>"Msisdn Registered"); + $status=$rows[$nPos++]+0; + echo ""; + echo " {$status_label[$status]}"; + echo ""; + echo ""; + */ + }while($rows=mysqli_fetch_array($result)); + break; + case '378': + do{ + echo ""; + $nPos=0; + $imsi=$rows[$nPos++]; + if(trim($imsi)=="") + continue; + echo ""; + echo " $imsi"; + echo ""; + $ipalim_type=$rows[5]+0; + $msisdn=$rows[$nPos++]; + if($ipalim_type == 0) + $msisdn="N/A"; + echo ""; + echo " $msisdn"; + echo ""; + + $msisdn_extern=$rows[$nPos++]; + if($ipalim_type == 1) + $msisdn_extern="N/A"; + echo ""; + echo " $msisdn_extern"; + echo ""; + + $tmsi=$rows[$nPos++]; + echo ""; + echo " $tmsi"; + echo ""; + + $lai=$rows[$nPos++]; + $lai_mcc=substr($lai,0,3); + $lai_mnc=substr($lai,3,3); + $lai_lai=substr($lai,6,4); + $lai_ci=substr($lai,10,4); + echo ""; + echo " $lai_mcc-$lai_mnc-$lai_lai-$lai_ci"; + echo ""; + + + $ipalim_type_label=array(0=>"Private",1=>"Public",2=>"Hybrid"); + $ipalim_type=$rows[$nPos++]+0; + echo ""; + echo " {$ipalim_type_label[$ipalim_type]}"; + echo ""; + }while($rows=mysqli_fetch_array($result)); + break; + case '330': + //$selectFieldList = "imsi,inter_msisdn,used_flag,nam,CamelFlag"; + do{ + echo ""; + $imsi=substr($rows[imsi],1); + echo ""; + echo " $imsi"; + //echo "keyValue={$rows[$keyFieldName]}&canSetNum=$canSetNum&isRead=1\"> $targetPage?sysId=$sysId&dataTypeNo=$dataTypeNo&keyValue={$rows[$keyFieldName]}&canSetNum=$canSetNum&isRead=1"; + echo ""; + //inter_msisdn + $inter_msisdn=decodeTelNumber($rows[inter_msisdn]); + echo ""; + echo " $inter_msisdn"; + echo ""; + //used_flag + $used_flag=$rows[used_flag]; + echo ""; + if($used_flag > '00'){ + echo "Enable"; + }else{ + echo "Disable"; + } + echo ""; + //nam + $netAcsModeDef=array('Both','Non-GPRS only','GPRS only'); + $nam=$rows[nam] - 0; + echo "{$netAcsModeDef[$nam]}"; + + //CamelFlag + $CamelFlag=HexDec(substr($rows[camel_flag],0,1))&0x8; + echo ""; + if($CamelFlag > 0){ + echo "Enable"; + }else{ + echo "Disable"; + } + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + break; + case '325': + //$selectFieldList = "IMSI,MSISDN,TMSI,LMSI"; + do{ + echo ""; + $IMSI=$rows[IMSI]; + echo ""; + echo " $IMSI"; + echo ""; + //MSISDN + $MSISDN=str_replace('F','',$rows[MSISDN]); + echo ""; + echo " $MSISDN"; + echo ""; + + //IMSIDetachFlag + $IMSIDetachFlag=$rows[IMSIDetachFlag]; + echo ""; + if($IMSIDetachFlag > 0){ + echo "N"; + }else{ + echo "Y"; + } + echo ""; + + //LAI(MCC+MNC+LAC) + $LAI=$rows[LAI]; + echo ""; + + $MCC=substr($LAI,0,2); + $MCC=strrev($MCC); + $MCC=$MCC.strrev(substr($LAI,2,2)); + $MCC=str_replace("F","",$MCC); + $MNC=substr($LAI,4,2); + $MNC=strrev($MNC); + $MNC=str_replace("F","",$MNC); + $LAC=substr($LAI,-4); + //$LAC=str_replace("F","",$LAC); + echo "$MCC-$MNC-$LAC"; + echo ""; + + //O_CSI Flag + $O_CSI=$rows[O_CSI]; + echo ""; + if(strlen($O_CSI) > 0){ + echo "Y"; + }else{ + echo "N"; + } + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + break; + case '360': //PPS + if($dataTypeNo == 0){ + //$selectFieldList = "msisdn,status,balance,expiration_date(MO),expiration_date(MT),first_used_date"; + do{ + echo ""; + //msisdn + $msisdn=$rows[msisdn]; + echo ""; + echo " $msisdn"; + echo ""; + +/* + //overdraft + $overdraft=$rows[overdraft] / $pssCardMinCount; + $overdraft = sprintf ("$fmtBit", $overdraft); + $overdraft=showComma($overdraft); + echo ""; + echo " $overdraft"; + echo ""; +*/ + + //status + $statusDef=array(array('00','fresh'),array('01','used'),array('02','suspended'), + array('03','black list'),array('04','released'),array('05','OPR trial') + ); + $status=$rows[status]; + echo ""; + for($i=0;$i"; + + //balance + $balance=$rows[balance] ;// $pssCardMinCount; + $balance=sprintf ("$fmtBit", $balance); + $balance=showComma($balance); + echo ""; + echo " $balance"; + echo ""; + + //mo_expiration_date + $expiration_date=substr($rows[mo_expiration_date],0,8); + echo ""; + echo " $expiration_date"; + echo ""; + + //mt_expiration_date + $expiration_date=substr($rows[mt_expiration_date],0,8); + echo ""; + echo " $expiration_date"; + echo ""; + + //Close user group + $sCugId=substr($rows[cug_id],0,8); + echo ""; + echo " $sCugId"; + echo ""; + + //first_used_date + $first_used_date=substr($rows[access_date],0,8); + echo ""; + echo " $first_used_date"; + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + }else{ + //$selectFieldList ="card_no,card_hrn,face_value,card_status,expiry_date,valid_time,updated_date"; + do{ + echo ""; + //card_no + $card_no=$rows[card_no]; + echo ""; + echo " $card_no"; + echo ""; + + //face_value + $face_value=$rows[face_value]; // $pssCardMinCount; + $face_value=sprintf ("$fmtBit", $face_value); + echo ""; + echo " $face_value"; + echo ""; + + //card_status + $card_status=$rows[card_status]; + echo ""; + if($card_status == 0){ + echo "fresh"; + }else if($card_status == 1){ + echo "used"; + }else if($card_status == 2){ + echo "suspended"; + } + echo ""; + + //expiry_date + $expiry_date=substr($rows[expiry_date],0,8); + echo ""; + echo " $expiry_date"; + echo ""; + + //valid_time + $valid_time=$rows[valid_time]; + echo ""; + echo " $valid_time"; + echo ""; + + //updated_date + $updated_date=substr($rows[updated_date],0,8); + echo ""; + echo " $updated_date"; + echo ""; + + //MSISDN_used + $msisdn=$rows[msisdn_used]?$rows[msisdn_used]:'--'; + echo ""; + echo " $msisdn"; + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + } + break; + case '395': + if($dataTypeNo == 0){ + //$selectFieldList = "msisdn,status,balance,expiration_date(MO),expiration_date(MT),first_used_date"; + do{ + echo ""; + //msisdn + $msisdn=$rows[msisdn]; + echo ""; + echo " $msisdn"; + echo ""; + +/* + //overdraft + $overdraft=$rows[overdraft] / $pssCardMinCount; + $overdraft = sprintf ("$fmtBit", $overdraft); + $overdraft=showComma($overdraft); + echo ""; + echo " $overdraft"; + echo ""; +*/ + + //status + $statusDef=array(array('00','fresh'),array('01','used'),array('02','suspended'), + array('03','black list'),array('04','released'),array('05','OPR trial') + ); + $status=$rows[status]; + echo ""; + for($i=0;$i"; + + //balance + $balance=$rows[balance] ;// $pssCardMinCount; + $balance=sprintf ("$fmtBit", $balance); + $balance=showComma($balance); + echo ""; + echo " $balance"; + echo ""; + + //mo_expiration_date + $expiration_date=substr($rows[mo_expiration_date],0,8); + echo ""; + echo " $expiration_date"; + echo ""; + + //mt_expiration_date + $expiration_date=substr($rows[mt_expiration_date],0,8); + echo ""; + echo " $expiration_date"; + echo ""; + + //Close user group + $sCugId=substr($rows[cug_id],0,8); + echo ""; + echo " $sCugId"; + echo ""; + + //first_used_date + $first_used_date=substr($rows[access_date],0,8); + echo ""; + echo " $first_used_date"; + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + }else{ + //$selectFieldList ="card_no,card_hrn,face_value,card_status,expiry_date,valid_time,updated_date"; + do{ + echo ""; + //card_no + $card_no=$rows[card_no]; + echo ""; + echo " $card_no"; + echo ""; + + //face_value + $face_value=$rows[face_value]; // $pssCardMinCount; + $face_value=sprintf ("$fmtBit", $face_value); + echo ""; + echo " $face_value"; + echo ""; + + //card_status + $card_status=$rows[card_status]; + echo ""; + if($card_status == 0){ + echo "fresh"; + }else if($card_status == 1){ + echo "used"; + }else if($card_status == 2){ + echo "suspended"; + } + echo ""; + + //expiry_date + $expiry_date=substr($rows[expiry_date],0,8); + echo ""; + echo " $expiry_date"; + echo ""; + + //valid_time + $valid_time=$rows[valid_time]; + echo ""; + echo " $valid_time"; + echo ""; + + //updated_date + $updated_date=substr($rows[updated_date],0,8); + echo ""; + echo " $updated_date"; + echo ""; + + //MSISDN_used + $msisdn=$rows[msisdn_used]?$rows[msisdn_used]:'--'; + echo ""; + echo " $msisdn"; + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + } + break; + case '370': + do{ + echo ""; + $msisdn=$rows[msisdn]; + echo ""; + echo " $msisdn"; + //echo "keyValue={$rows[$keyFieldName]}&canSetNum=$canSetNum&isRead=1\"> $targetPage?sysId=$sysId&dataTypeNo=$dataTypeNo&keyValue={$rows[$keyFieldName]}&canSetNum=$canSetNum&isRead=1"; + echo ""; + //status + $status=$rows[status]; + echo ""; + if($status == '02'){ + echo "own ported out"; + }else if($status == '03'){ + echo "foreign ported in"; + }else{ + echo "foreign ported to third party"; + } + echo ""; + + $routing_number=$rows[routing_number]; + echo "$routing_number"; + + $donor=$rows[donor]; + echo "$donor"; + + $recipient=$rows[recipient]; + echo "$recipient"; + + $date=$rows[date]; + $year=substr($date,0,4); + $month=substr($date,4,2); + $day=substr($date,6,2); + + echo "$year-$month-$day"; + + + echo ""; + }while($rows=mysqli_fetch_array($result)); + break; + case '340': + //$selectFieldList = "key_imsi,a3a8_version,status"; + do{ + echo ""; + $key_imsi=substr($rows[key_imsi],1); + echo ""; + echo " $key_imsi"; + echo ""; + //a3a8_version + $a3a8_version=hexdec($rows[a3a8_version]); + echo ""; + echo " $a3a8_version"; + echo ""; + //status + $status=$rows[status]; + echo ""; + if($status == 0){ + echo "Inactive"; + }else{ + echo "Active"; + } + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + break; + case '380': + //$selectFieldList = "imei,status"; + do{ + echo ""; + //imei + $imei=$rows[imei]; + echo ""; + echo " $imei"; + echo ""; + //status + $status=$rows[status]; + echo ""; + if($status == 1){ + echo "Black-Listed"; + }else{//==2 + echo "Grey-Listed"; + } + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + break; + case '390': + //$selectFieldList = "enableFlag,msisdn,mailboxNo,promptLanguage,greetingFlag,newMessageNum,oldMessageNum"; + do{ + echo ""; + + //msisdn + $msisdn=$rows[msisdn]; + echo ""; + echo " $msisdn"; + echo ""; + + //mailboxNo + $mailboxID=hexdec($rows[mailboxID]); + echo ""; + echo "$mailboxID"; + echo ""; + //promptLanguage + $promo_language=$rows[promo_language]; + echo ""; + echo "$promo_language"; + echo ""; + + //greetingFlag + $greetingDefArr=array( + array('00','System'), + array('01','Host name'), + array('02','Personal'), + array('80','Temporary') + ); + $greeting=$rows[greeting]; + echo ""; + for($i=0;$i"; +/* + //pwdEnable + $pwdFlag=$rows[pwdFlag]; + echo ""; + if($pwdFlag == 1){ + echo "Y"; + }else{ + echo "N"; + } + echo ""; +*/ + //pwdValue + $pwdValue=$rows[pwdValue]; + echo ""; + echo "$pwdValue"; + echo ""; + echo ""; + }while($rows=mysqli_fetch_array($result)); + break; + case '253': + //$selectFieldList = "imsi,msisdn,used_flag,lac"; + do{ + echo ""; + $imsi=$rows[imsi]; + echo ""; + echo " $imsi"; + echo ""; + //msisdn + $msisdn=str_replace('E','',$rows[msisdn]); + echo ""; + echo " $msisdn"; + echo ""; + //used_flag + $used_flag=$rows[used_flag]; + echo ""; + if($used_flag > '00'){ + echo "Enable"; + }else{ + echo "Disable"; + } + echo ""; + //lac + $lac=hexdec($rows[lac]); + echo ""; + echo " $lac"; + echo ""; + echo ""; + }while($rows=mysqli_fetch_array($result)); + break; + default: + echo "Unknown sysTypeNo"; + exit(1); +} +?> + + +  + + + diff --git a/wxc2_omc/account/priSubsMng/subscriberListIndex.php b/wxc2_omc/account/priSubsMng/subscriberListIndex.php new file mode 100755 index 0000000..812a15e --- /dev/null +++ b/wxc2_omc/account/priSubsMng/subscriberListIndex.php @@ -0,0 +1,51 @@ +"; + echo "$showTitle:"; + echo ""; + echo ""; + echo "   "; + echo ""; + exit(); + }else{ + if($sysTypeNo == '340'){ + $varName='AucManagePwd'; + }else{ + $varName='EirManagePwd'; + } + $managePwd = getPubVar($varName); + if($managePwd != $inputPwd){ + echo "Password error!"; + exit(); + } + } +} +*/ +?> + + + "; + echo ""; + ?> + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/account/priSubsMng/subscriberListUp.php b/wxc2_omc/account/priSubsMng/subscriberListUp.php new file mode 100755 index 0000000..5fe684b --- /dev/null +++ b/wxc2_omc/account/priSubsMng/subscriberListUp.php @@ -0,0 +1,484 @@ + + + + + + + + + +
      + Subscriber > HLR"; + $helpId = "2.2.1.2"; + break; + case '325': + $titleName="$strTitleAccount > Subscriber > VLR"; + $helpId = "2.2.1.1"; + break; + case '360': + if($dataTypeNo == 0){ + $titleName="$strTitleAccount > Subscriber > PPS"; + $helpId = "2.2.1.3"; + }else{ + $titleName="$strTitleAccount > Recharge card"; + $helpId = "2.2.2"; + } + break; + case '395': + $titleName="$strTitleAccount > Recharge card"; + $helpId = "2.2.2"; + break; + case '370': + $titleName="$strTitleAccount > Subscriber > MNP"; + $helpId = "2.2.1.7"; + break; + case '375': + $titleName="$strTitleAccount > Subscriber > OPPS"; + $helpId = "2.2.1.8"; + break; + case '378': + $titleName="$strTitleAccount > Subscriber > iPALIM"; + $helpId = "2.2.1.9"; + break; + case '340': + $titleName="$strTitleAccount > Subscriber > AUC"; + $helpId = "2.2.1.4"; + break; + case '380': + $titleName="$strTitleAccount > Subscriber > EIR"; + $helpId = "2.2.1.5"; + break; + case '390': + $titleName="$strTitleAccount > Subscriber > $strVMSOrVSS"; + $helpId = "2.2.1.6"; + break; + default: + $titleName="Unknown sysTypeNo"; + exit(1); + } + +adjust_head_frame("up"); +adjust_title_head_frame("up"); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$titleName"; +echo ""; +showHelp($helpId); +echo "
      "; + + +switch($sysTypeNo){ +case '330': + echo "$tabelHead"; + echo ""; + break; +case '325': + echo "$tabelHead"; + echo ""; + break; +case '360': + if($dataTypeNo == 0){ + echo "$tabelHead"; + echo "MSISDN"; + echo ""; + }else{ + echo "$tabelHead"; + echo "Card no."; + echo ""; + } + break; +case '395': + echo "$tabelHead"; + echo "Card no."; + echo ""; + break; +case '370': + echo "$tabelHead"; + echo "MSISDN"; + echo ""; + break; +case '375': + echo "$tabelHead"; + if(!isset($opps_type_sel)) + $opps_type_sel=0; + $oppsType=array(0=>"All",1=>"OPR",2=>"IMDX"); + echo "User Type "; + echo " "; + //echo "MSISDN"; + //echo ""; + + echo "   "; + + break; +case '378': + echo "$tabelHead"; + echo "IMSI"; + echo ""; + break; +case '340': + echo "$tabelHead"; + echo "IMSI"; + echo ""; + break; +case '380': + echo "$tabelHead"; + echo "IMEI"; + echo ""; + break; +case '390': + echo "$tabelHead"; + echo "MSISDN"; + echo ""; + break; +case '253': + echo "$tabelHead"; + echo " "; + break; +default: + echo "Unknown sysTypeNo"; + exit(1); +} + +?> +   + + + + + "; + echo " "; + //echo " $strSearch "; + if( ('330'==$sysTypeNo) || ('360'==$sysTypeNo) || ('395'==$sysTypeNo)){ + echo ""; + } + switch ($sysTypeNo) { + case '325': + echo ""; + //echo ""; + break; + /* + case '330': + echo ""; + break; + case '360': + echo ""; + break; + */ + default: + break; + } + if($sysTypeNo==390){ + echo "Select System:"; + echo ""; + } + ?> + + + +"; +echo ""; + + +if($sysTypeNo==390) + $strGetAll='Get'; +?> + + +     + + + + +"; + else + echo ""; + echo "Add single"; + echo "  "; + } + + if (($sysTypeNo == 330 || $sysTypeNo == 360 || $sysTypeNo == 390) &&$dataTypeNo == 0){ + if($canwrite_flag) + echo ""; + else + echo ""; + echo "Add batch"; + echo "  "; + } + + + if ($sysTypeNo != 325 && $sysTypeNo != 340 && $sysTypeNo != 390){ + if($canwrite_flag) + echo ""; + else + echo ""; + echo "$strImport"; + echo ""; + } + +echo "
      "; + + +//$tabelHead=""; + echo ""; + echo ""; + echo ""; + echo "
      "; + + +echo ""; +echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + + diff --git a/wxc2_omc/account/priSubsMng/vlrSubsConf.php b/wxc2_omc/account/priSubsMng/vlrSubsConf.php new file mode 100755 index 0000000..84af68f --- /dev/null +++ b/wxc2_omc/account/priSubsMng/vlrSubsConf.php @@ -0,0 +1,684 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$pubDb ='OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable ='OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +//------------选择语言版本---------- +if($language == 'eng'){ + +}else{ + +} + +$odbGeneralDef=array( + //array('Name', 'offset' ,'remark'), + array('BAOC', '00.0' ,'BAOC'), + array('BOIC', '00.1' ,'BOIC'), + array('BOIC_HPLMN', '00.2' ,'BOIC-HPLMN'), + array('BAIC_HPLMN_CT', '02.1' ,'BAIC-HPLMN CT'), + array('Roaming', '02.3' ,'Roaming'), + array('Roaming_CT', '02.4' ,'Roaming CT') +); + +$CamelFlagDef=array( + array('camelFlag', '00.0' ,'Support Camel'), + array('OCSI', '00.1' ,'OCSI'), + array('TCSI', '00.2' ,'TCSI'), + array('SMS_CSI', '01.0' ,'SMS-CSI'), + +); +//========================================================== +//输入变量 +//========================================================== +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +//显示用户数据编辑页面,需要的变量 + +$sysId=$_REQUEST['sysId']; +$keyValue=$_REQUEST['keyValue']; +$sysTypeNo=$_REQUEST['sysTypeNo']; +$sysNo=$_REQUEST['sysNo']; +$subSysNo=$_REQUEST['subSysNo']; +$dataTypeNo=$_REQUEST['dataTypeNo']; +$isRead=$_REQUEST['isRead']; +$isChange=$_REQUEST['isChange']; +$isCreate=$_REQUEST['isCreate']; +$isDelete=$_REQUEST['isDelete']; +$isLoadIndex=$_REQUEST['isLoadIndex']; + + +if($DEBUG)echo "
      sysId=$sysId"; +if($DEBUG)echo "
      canSetNum=$canSetNum"; +if($DEBUG)echo "
      keyValue=$keyValue"; +if($DEBUG)echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG)echo "
      sysNo=$sysNo"; +if($DEBUG)echo "
      subSysNo=$subSysNo"; +if($DEBUG)echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +if($DEBUG)echo "
      isRead=$isRead"; +if($DEBUG)echo "
      isChange=$isChange"; +if($DEBUG)echo "
      isCreate=$isCreate"; +if($DEBUG)echo "
      isDelete=$isDelete"; +if($DEBUG)echo "
      isLoadIndex=$isLoadIndex"; + + +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "IMSI,MSISDN,IMSIDetachFlag,LAI,O_CSI"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +?> + + + + + +"; +?> +
      " > + + + + + + + + +
      + + + + + +       + + + +  
      +
      + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; + +//IMSI +$IMSI=$tmpRow[IMSI]; +echo ""; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; + +//MSISDN +$MSISDN=str_replace('F','',$tmpRow[MSISDN]); +echo ""; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; + +//MS Category +$categoryDef=array( + array('00','Unknown'), + array('01','French language'), + array('02','English language'), + array('03','German language'), + array('04','Russian language'), + array('05','Spanish language'), + array('0A','Ordinary'), + array('0B','Subscriber with priority'), + ); +$category=$tmpRow[MS_Category]; +echo ""; +echo ""; +$seqNo++; +echo ""; + +for($i=0;$i$showValue"; +}else{ + echo ""; +} +echo ""; + +//Subscriber status +//0=service granted, 1=operator determined barring +$Sub_status=$tmpRow[Sub_status]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($Sub_status > 0){ + echo ""; +}else{ + echo ""; +} + +echo ""; + +//ODB general +$odbGeneral=$tmpRow[ODB_General]; +$odbGeneralDef=array( + //array('Name', 'offset' ,'remark'), + array('BAOC', '00.0' ,'provisioned'), + array('BOIC', '00.1' ,'provisioned'), + array('BOIC_exHC', '00.2' ,'provisioned'), + array('BPRIC', '00.3' ,'provisioned'), + array('BPREC', '00.4' ,'provisioned'), + array('SS_Access', '00.5' ,'provisioned'), + array('BAIC', '02.0' ,'provisioned'), + array('BAICRoam', '02.1' ,'provisioned') +// array('BR_outH', '02.3' ,'provisioned'), +// array('BR_outHC', '02.4' ,'provisioned') +); +echo ""; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; + +//Provision_ts +$provisionTs=$tmpRow[Provision_ts]; +$provisionTsDef=array( + //array('Name', 'offset'), + array('Telephony provision', '00.0' ), + array('Emergency call provision', '00.1' ), + array('Short message MT provision', '00.2' ), + array('Short message MO provision', '00.3' ), +); +echo ""; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; + +//TMSI +$TMSI=$tmpRow[TMSI]; +echo ""; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; + +//LAI +$LAI=$tmpRow[LAI]; +$MCC=substr($LAI,0,2); +$MCC=strrev($MCC); +$MCC=$MCC.strrev(substr($LAI,2,2)); +$MCC=str_replace("F","",$MCC); +$MNC=substr($LAI,4,2); +$MNC=strrev($MNC); +$MNC=str_replace("F","",$MNC); +$LAC=substr($LAI,-4); +//$LAC=str_replace("F","",$LAC); + +echo ""; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; + +//Cell_ID +$cellId=$tmpRow[Cell_ID]; +echo ""; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; + +//Location confirm +$locationConfirm=$tmpRow[LocationConfirm]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($locationConfirm > 0){ + echo ""; +}else{ + echo ""; +} +echo ""; + +//Data confirm +$dataConfirmFlag=$tmpRow[DataConfirmFlag]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($dataConfirmFlag > 0){ + echo ""; +}else{ + echo ""; +} +echo ""; + +//RadioConfirmFlag +$radioConfirmFlag=$tmpRow[RadioConfirmFlag]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($radioConfirmFlag > 0){ + echo ""; +}else{ + echo ""; +} +echo ""; + +//IMSI detach +$IMSIDetachFlag=$tmpRow[IMSIDetachFlag]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($IMSIDetachFlag > 0){ + echo ""; +}else{ + echo ""; +} +echo ""; + +//MNRF +$MNRF=$tmpRow[MNRF]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($MNRF > 0){ + echo ""; +}else{ + echo ""; +} +echo ""; + +//LA_Not_allowed +$LANotAllowedFlag =$tmpRow[LANotAllowedFlag]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($LANotAllowedFlag > 0){ + echo ""; +}else{ + echo ""; +} +echo ""; + +//Roaming Restricted +$RoamRestricFlag =$tmpRow[RoamRestricFlag]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($RoamRestricFlag > 0){ + echo ""; +}else{ + echo ""; +} +echo ""; + +$tmpFieldArr=array( + //array('showName_1','fielname_1','showName_2','fielname_2'), + array('CFU status', 'CFU_ST', 'CFU: Forward to number', 'CFU_Num'), + array('CFB status', 'CFB_ST', 'CFB: Forward to number', 'CFB_Num'), + array('CFNRy status', 'CFNRy_ST', 'CFNRy: Forward to number', 'CFNRy_Num'), + array('CFNRc status', 'CFNRc_ST', 'CFNRc: Forward to number', 'CFNRc_Num') +); +$tmpDefArr=array( + //array('Name', 'offset'), + array('A bit (indicate active state)', '00.0' ), + array('R bit (indicate registration state)','00.1' ), + array('P bit (indicate provision state)', '00.2' ), + array('Q bit (indicate quiescent state)', '00.3' ), + array('Notification to calling party', '00.5' ), + array('Notification to forwarding party', '00.7' ) +); +for($i=0;$i"; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; + + $showName_2 =$tmpFieldArr[$i][2]; + $showValue_2 =$tmpRow[$tmpFieldArr[$i][3]]; + echo ""; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; +} + +//Barring all calls +$allBarFlag =$tmpRow[ALLBAR]; +echo ""; +echo ""; +$seqNo++; +echo ""; +if($allBarFlag > 0){ + echo ""; +}else{ + echo ""; +} +echo ""; + +$tmpFieldArr=array( +// array('showName','fieldName'), + array('BAOC','BAOC'), + array('BOIC','BOIC'), + array('BOIC-ExHC','BOICexHC'), + array('BAIC','BAIC'), + array('BICRoam','BICRoam') +); + +$tmpDef=array( + //array('Name', 'offset'), + array('A bit (indicate active state)', '00.0' ), + array('R bit (indicate registration state)','00.1' ), + array('P bit (indicate provision state)', '00.2' ), + array('Q bit (indicate quiescent state)', '00.3' ) +); +for($i=0;$i"; + echo ""; + $seqNo++; + echo ""; + echo ""; + echo ""; +} + +$tmpDefArr=array( +// array('showName','fieldName'), + array('CLIP','CLIP'), + array('CLIR','CLIR'), + array('COLP','COLP'), + array('COLR','COLR'), + array('AOCI','AOCI'), + array('AOCC','AOCC'), + array('Call hold','CallHold'), + array('Call wait','CallWait'), + array('ECT','ECT'), + array('MPTY','MPTY') +); +$tmpDef=array( + //array('Name', 'offset'), + array('A bit (indicate active state)', '00.0' ), + array('R bit (indicate registration state)','00.1' ), + array('P bit (indicate provision state)', '00.2' ), + array('Q bit (indicate quiescent state)', '00.3' ) +); +for($i=0;$i"; + echo ""; + $seqNo++; + echo ""; + }else{ + echo ""; + } + */ + for($j=0;$j{$tmpDef[$j][0]}
      "; + }else{ + echo "{$tmpDef[$j][0]}
      "; + } + } + echo "
      "; +} + +//O_CSI +$O_CSI =$tmpRow[O_CSI]; +$oCsiFlag=substr($O_CSI,0,1); +$oCsiScpNum=substr($O_CSI,4,12); +$oCsiScpNum=str_replace('F','',$oCsiScpNum); +echo ""; +echo ""; +$seqNo++; +echo ""; +if(strlen($O_CSI) == 0){ + echo ""; +}else{ + echo ""; + echo ""; +} + +//SMS_CSI +$SMS_CSI =$tmpRow[SMS_CSI]; +$smsCsiFlag=substr($SMS_CSI,0,1); +$smsCsiNum=substr($SMS_CSI,4,12); +$smsCsiNum=str_replace('F','',$smsCsiNum); +echo ""; +echo ""; +$seqNo++; +echo ""; +if(strlen($SMS_CSI) == 0){ + echo ""; +}else{ + echo ""; + echo ""; +} + +//MSISDN opt +$msisdn_opt=$tmpRow[MSISDN_opt]; +$msisdn_opt=str_replace('F','',$msisdn_opt); +echo ""; +echo ""; +$seqNo++; +echo ""; +if(trim($msisdn_opt)=="") + echo ""; +else + echo ""; + +//opps flag +$opps_flag=$tmpRow[OppsFlag]+0; +$opps_flag_label=array(0=>"OPR Not Registerd", + 1=>"OPR WithOut Roam Agreement OPRState", + 2=>"OPR With Roam Agreeement OPRState", + 3=>"OPR With Roam Agreeement RoamingState", + 4=>"IMDXPrivate", + 5=>"IMDXHbrid", + 6=>"IMDXPublic"); +echo ""; +echo ""; +$seqNo++; +echo ""; +if($opps_flag<0 || $opps_flag>6) + echo ""; +else + echo ""; +?> +
      $strID$strField$strValue
      $seqNo IMSI$IMSI  
      $seqNo MSISDN$MSISDN  
      $seqNo MS categoryunknown($category)
      $seqNo ODB statusOperator determined barringService granted
      $seqNo ODB general"; +for($i=0;$i{$odbGeneralDef[$i][0]}
      "; + }else{ + echo "{$odbGeneralDef[$i][0]}
      "; + } +} +echo "
      $seqNo Provisioned tele service"; +for($i=0;$i{$provisionTsDef[$i][0]}
      "; + }else{ + echo "{$provisionTsDef[$i][0]}
      "; + } +} +echo "
      $seqNo TMSI$TMSI  
      $seqNo LAI(MCC-MNC-LAC)$MCC-$MNC-$LAC
      $seqNo Cell ID$cellId  
      $seqNo Location confirmConfirmedNot Confirmed
      $seqNo Data confirmConfirmedNot Confirmed
      $seqNo Radio confirmConfirmedNot Confirmed
      $seqNo IMSI detachDetachedAttached
      $seqNo MNRFNot ReachableReachable
      $seqNo LA_Not_allowedAllowedNot allowed
      $seqNo Roaming restrictedRestrictedNot restricted
      $seqNo $showName_1"; + //$valuetest=getBitValue(04,00.7); + //echo "valuetest=$valuetest"; + for($j=0;$j{$tmpDefArr[$j][0]}
      "; + }else{ + echo "{$tmpDefArr[$j][0]}
      "; + } + } + echo "
      $seqNo $showName_2$showValue_2  
      $seqNo Barring all callsYesNo
      $seqNo $showName"; + for($j=0;$j{$tmpDef[$j][0]}
      "; + }else{ + echo "{$tmpDef[$j][0]}
      "; + } + } + echo "
      $seqNo $showName"; + /* + if($showValue > 0){ + echo "ActivedNot Actived
      $seqNo O-CSINot Provisioned"; + echo "Provisioned"; + echo "
      SCF Number:$oCsiScpNum"; + echo "
      $seqNo SMS-CSINot Provisioned"; + echo "Provisioned"; + echo "
      SCF Number:$smsCsiNum"; + echo "
      $seqNo MSISDN(Opt)--$msisdn_opt
      $seqNo OPPS Flag--{$opps_flag_label[$opps_flag]}
      + +"; +echo "\n"; +echo "\n"; +?> +

       

      + + + diff --git a/wxc2_omc/account/priSubsMng/vlrSubsConfig b/wxc2_omc/account/priSubsMng/vlrSubsConfig new file mode 100755 index 0000000..c25f518 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/vlrSubsConfig @@ -0,0 +1,496 @@ +[para]0[Name]MSISDN +[sqlName]MSISDN[t]input[unit]MSISDN[u]00.0-08.7[u] +[v]keepHex-low-F +[remark] + +[para]1[Name]IMSI +[sqlName]IMSI[t]readOnly[unit]IMSI[u]00.0-15.7[u] +[v]keepAsc-low-F +[remark] + +[para]2[Name]MSISDN +[sqlName]MSISDN[t]readOnly[unit]MSISDN[u]00.0-08.7[u] +[v]keepHex-low-F +[remark] + +[para]3[Name]MS category +[sqlName]MS_Category[t]show[unit]MS category[u]00.0-00.7[u] +[v]00[opt]Unknown +[v]01[opt]French language +[v]02[opt]English language +[v]03[opt]German language +[v]04[opt]Russian language +[v]05[opt]Spanish language +[v]10[opt]Ordinary +[v]11[opt]Subscriber with priority +[remark] + +[para]4[Name]ODB status +[sqlName]Sub_status[t]show[unit]ODB status[u]00.0-00.7[u] +[v]00[opt]Service granted +[v]01[opt]Operator determined barring +[remark] + +[para]5[Name]ODB general +[sqlName]ODB_General[t]checkbox[unit]BAOC[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BOIC[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BOIC_exHC[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BPRIC[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BPREC[u]00.4-00.4[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]SS_Access[u]00.5-00.5[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BAIC[u]00.6-00.6[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]BAICRoam[u]00.7-00.7[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]6[Name]Provisioned tele service +[sqlName]Provision_ts[t]checkbox[unit]Telephony provision[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Emergency call provision[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Short message MT provision[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Short message MO provision[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]7[Name]TMSI +[sqlName]TMSI[t]readOnly[unit]TMSI[u]00.0-03.7[u] +[v]keepHex-high-0 +[remark] + +[para]8[Name]LAI(MCC-MNC-LAC) +[sqlName]LAI[t]vlrSpecialRead[unit]CC[u]00.0-04.7[u] +[v]keepHex-low-F +[remark] + +[para]9[Name]Cell ID +[sqlName]Cell_ID[t]readOnly[unit]Cell ID[u]00.0-01.7[u] +[v]keepHex-high-0 +[remark] + +[para]10[Name]Location confirm +[sqlName]LocationConfirm[t]show[unit]Location confirm[u]00.0-00.7[u] +[v]0[opt]Not Confirmed +[v]1[opt]Confirmed +[remark] + +[para]11[Name]Data confirm +[sqlName]DataConfirmFlag[t]show[unit]Data confirm[u]00.0-00.7[u] +[v]0[opt]Not Confirmed +[v]1[opt]Confirmed +[remark] + +[para]12[Name]Radio confirm +[sqlName]RadioConfirmFlag[t]show[unit]Radio confirm[u]00.0-00.7[u] +[v]0[opt]Not Confirmed +[v]1[opt]Confirmed +[remark] + +[para]13[Name]IMSI detach +[sqlName]IMSIDetachFlag[t]show[unit]IMSI detach[u]00.0-00.7[u] +[v]0[opt]Attached +[v]1[opt]Detached +[remark] + +[para]14[Name]MNRF +[sqlName]MNRF[t]show[unit]MNRF[u]00.0-00.7[u] +[v]0[opt]Reachable +[v]1[opt]Not Reachable +[remark] + +[para]15[Name]LA_Not_allowed +[sqlName]LANotAllowedFlag[t]show[unit]LA_Not_allowed[u]00.0-00.7[u] +[v]0[opt]Not allowed +[v]1[opt]Allowed +[remark] + +[para]16[Name]Roaming restricted +[sqlName]RoamRestricFlag[t]show[unit]Roaming restricted[u]00.0-00.7[u] +[v]0[opt]Not restricted +[v]1[opt]Restricted +[remark] + +[para]17[Name]CFU status +[sqlName]CFU_ST[t]checkbox[unit]A bit (indicate active state[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Notification to calling party[u]00.5-00.5[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Notification to forwarding party[u]00.7-00.7[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]18[Name]CFU: Forward to number +[sqlName]CFU_Num[t]readOnly[unit]CFU: Forward to number[u]00.0-08.7[u] +[v]keepHex-low-F +[remark] + +[para]19[Name]CFB status +[sqlName]CFB_ST[t]checkbox[unit]A bit (indicate active state[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Notification to calling party[u]00.5-00.5[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Notification to forwarding party[u]00.7-00.7[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]20[Name]CFB: Forward to number +[sqlName]CFB_Num[t]readOnly[unit]CFB: Forward to number[u]00.0-08.7[u] +[v]keepHex-low-F +[remark] + +[para]21[Name]CFNRy status +[sqlName]CFNRy_ST[t]checkbox[unit]A bit (indicate active state[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Notification to calling party[u]00.5-00.5[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Notification to forwarding party[u]00.7-00.7[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]22[Name]CFNRy: Forward to number +[sqlName]CFNRy_Num[t]readOnly[unit]CFNRy: Forward to number[u]00.0-08.7[u] +[v]keepHex-low-F +[remark] + +[para]23[Name]CFNRc status +[sqlName]CFNRc_ST[t]checkbox[unit]A bit (indicate active state[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Notification to calling party[u]00.5-00.5[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Notification to forwarding party[u]00.7-00.7[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]24[Name]CFNRc: Forward to number +[sqlName]CFNRc_Num[t]readOnly[unit]CFNRc: Forward to number[u]00.0-08.7[u] +[v]keepHex-low-F +[remark] + +[para]25[Name]Barring all calls +[sqlName]ALLBAR[t]show[unit]Roaming restricted[u]00.0-03.7[u] +[v]00[opt]No +[v]01[opt]Yes +[remark] + +[para]26[Name]BAOC +[sqlName]BAOC[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]27[Name]BOIC +[sqlName]BOIC[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]28[Name]BOIC-ExHC +[sqlName]BOICexHC[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]29[Name]BAIC +[sqlName]BAIC[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]30[Name]BICRoam +[sqlName]BICRoam[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]31[Name]CLIP +[sqlName]CLIP[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]32[Name]CLIR +[sqlName]CLIR[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]33[Name]COLP +[sqlName]COLP[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]34[Name]COLR +[sqlName]COLR[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]35[Name]AOCI +[sqlName]AOCI[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]36[Name]AOCC +[sqlName]AOCC[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]37[Name]Call hold +[sqlName]CallHold[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]38[Name]Call wait +[sqlName]CallWait[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]38[Name]ECT +[sqlName]ECT[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]39[Name]MPTY +[sqlName]MPTY[t]checkbox[unit]A bit (indicate active state)[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]R bit (indicate registration state)[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]P bit (indicate provision state)[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Q bit (indicate quiescent state)[u]00.3-00.3[u] +[v]0[opt]not support +[v]1[opt]support +[remark] + +[para]40[Name]O-CSI +[sqlName]O_CSI[t]show[unit]O-CSI[u]00.0-03.7[u] +[v]00[opt]Not Provisioned +[v]01[opt]Provisioned +SCF Number:$oCsiScpNum +[remark] + +[para]41[Name]SMS-CSI +[sqlName]SMS_CSI[t]show[unit]SMS-CSI[u]00.0-03.7[u] +[v]00[opt]Not Provisioned +[v]01[opt]Provisioned +SCF Number:$oCsiScpNum +[remark] + +[para]42[Name]MSISDN(Opt) +[sqlName]MSISDN_opt[t]readOnly[unit]MSISDN(Opt)[u]00.0-15.7[u]-- +[v]keepAsc-low-E +[remark] + +[para]43[Name]OPPS Flag +[sqlName]MSISDN_opt[t]show[unit]]OPPS Flag[u]00.0-03.7[u] +[v]0[opt]OPR Not Registerd +[v]1[opt]OPR WithOut Roam Agreement OPRState +[v]2[opt]OPR With Roam Agreeement OPRState +[v]3[opt]OPR With Roam Agreeement RoamingState +[v]4[opt]IMDXPrivate +[v]5[opt]IMDXHbrid +[v]6[opt]IMDXPublic +[remark] \ No newline at end of file diff --git a/wxc2_omc/account/priSubsMng/vmsSubsConf.php b/wxc2_omc/account/priSubsMng/vmsSubsConf.php new file mode 100755 index 0000000..143a677 --- /dev/null +++ b/wxc2_omc/account/priSubsMng/vmsSubsConf.php @@ -0,0 +1,649 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$canwrite_flag=checkWritePrivilege(); +$pubDb = 'OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; + +$statusDef=array( + //array('Name', 'offset','remark'), + array('use_flag', '00.2' ,'Register flag'), + array('enable_flag','00.1' ,'Active flag'), + array('locked_flag','00.0' ,'Locked flag') +); + +//------------选择语言版本---------- +if($language == 'eng'){ + +}else{ + +} + +//select sum(balance) from user_info +//========================================================== +//输入变量 +//========================================================== +$canSetNum=$_REQUEST['canSetNum']; +$keyValue=$_REQUEST['keyValue']; +$subSysNo=$_REQUEST['subSysNo']; +$dataTypeNo=$_REQUEST['dataTypeNo']; +$canSetNum = isset($canSetNum)?$canSetNum:'all'; +if ($_REQUEST['sysId']) +{ + $sysId = $_REQUEST['sysId']; + if($DEBUG) echo "
      sysId=$sysId"; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + // echo "sysTypeNo=$sysTypeNo,sysNo=$sysNo"; +} +$canSetNum = isset($canSetNum)?$canSetNum:'all'; + +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +//操作类型变量 +$isLoadIndex=$_REQUEST['isLoadIndex']; +$isTryCreate=$_REQUEST['isTryCreate']; +$isBatchCreate=$_REQUEST['isBatchCreate']; +$isCreate=$_REQUEST['isCreate']; +$isDelete=$_REQUEST['isDelete']; +$isChange=$_REQUEST['isChange']; +$isRead=$_REQUEST['isRead']; +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + +//保存用户数据修改的数据 +$bgnNo=$_POST['bgnNo']; +$endNo=$_POST['endNo']; +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; + +//---------定义需要编辑保存的字段------- +//$showAttrDef=array(array('fieldName'=>'','inputName'=>''); +$showAttrDef=array( + array('fieldName'=>'msisdn', 'inputName'=>'msisdn'), + array('fieldName'=>'status', 'inputName'=>'status'), + array('fieldName'=>'promo_language', 'inputName'=>'promo_language'), + array('fieldName'=>'greeting', 'inputName'=>'greeting'), + //array('fieldName'=>'pwdFlag', 'inputName'=>'pwdFlag'), + array('fieldName'=>'pwdValue', 'inputName'=>'pwdValue') +); + +//For operation log use +{ + $used_flag_def=array( + "00"=>"Disable","0"=>"Disable", + "01"=>"Enable","1"=>"Enable" + ); + + $promo_language_def=array( + "00"=>"Language 0","0"=>"Language 0", + "01"=>"Language 1","1"=>"Language 1", + "02"=>"Language 2","2"=>"Language 2", + "03"=>"Language 3","3"=>"Language 3", + "04"=>"Language 4","4"=>"Language 4" + ); + + $greeting_def=array( + "00"=>"System", + "01"=>"Host name", + "02"=>"Personal", + "80"=>"Temporary" + ); + + + +} + +$logFieldDef=array( + 'status', + 'promo_language', + 'greeting', + 'pwdValue', +); + + +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //system("echo '-------------------------------------'>>/tmp/test.txt"); + $preValueInfo="Change $pre_keyvalue "; + $isChangeFlag=0; + for($i=0;$i$inputName = $inputValue"; + if(isset($$ddName)) + { + $tmpv=$$ppName; + $val1=${$$ddName}[$tmpv]; + $val2=${$$ddName}[$inputValue]; + if(strlen($$ppName) == 0) + $val1="NoValue"; + + if(strcasecmp($val1,$val2) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$val1}->{$val2}]"; + //system("echo '[{$$nnName},{$val1}->{$val2}]' >>/tmp/test.txt"); + } + } + else if(isset($$cdName)) + { + $newValue=""; + for($iii=0;$iii({$newValue})]' >>/tmp/test.txt"); + } + } + else + { + if(strlen($$ppName) == 0) + $$ppName="NoValue"; + if(strcasecmp($$ppName,$inputValue) != 0) + { + $isChangeFlag=1; + $preValueInfo.="[{$$nnName},{$$ppName}->$inputValue]"; + //system("echo '[{$$nnName},{$$ppName}->$inputValue]'>>/tmp/test.txt"); + } + } + }else{ + //echo "
      Can not find $inputName's value"; + } + } + if($isChangeFlag==1) + { + $preValueInfo.=" in {$log_sysTypeName}_{$log_sysNo}_{$log_subSysNo}"; + insertLog($preValueInfo); + } +} + +//处理各个的输入单元的值,组成各个需要编辑的字段值 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //$enableFlag=$enableFlag; + //$promptLanguage=$promptLanguage; + //$greetingFlag=$greetingFlag; + + $orgValue=$status; + $orgValue = sprintf("%02x",$orgValue); //需要理解 + //echo "<1>orgValue=$orgValue
      "; + for($i=0;$icheckBox1$endNo = ${'checkBox_'.$endNo}"; + if($DEBUG) echo "
      fieldName_$endNo = ${'fieldName_'.$endNo}"; + if($DEBUG) echo "
      editValue_$endNo = ${'editValue_'.$endNo}"; + $endNo++; + } +} + +//========================================================== +//数据处理 +//========================================================== +if (1 == $isLoadIndex) { + $fieldNameList = "msisdn,mailboxID,proo_language,greeting,pwdFlag"; +} else { + $fieldNameList = "ALL"; +} +if ($DEBUG) echo "fieldNameList=$fieldNameList
      "; +?> + + + + + +"; +//**********************************编辑参数时所用javascript***************************************** +?> + +" > + + + + + + 0){ + if($isBatchCreate> 0){ + ?> + + + + =4){ + ?> + + + + + + + + + + + +
      + + + + + + +     + Batch amount(<=100): + + " name="create" title="" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + " name="isBatchCreate"> + + + + + + + + "; + else + echo ""; + ?> + + + + "; + else + echo ""; + ?> + +  
      +
      + + + + + + + + + + 0){ + $msisdn=$tmpRow[msisdn]; + echo "\n "; + echo ""; + $seqNo++; + if($isBatchCreate > 0) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; + + +//status +$status =$tmpRow[status]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//mailboxNo +$mailboxID =hexdec($tmpRow[mailboxID]); +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; + +//promptLanguage +$languageDefArr=array('Language 0','Language 1','Language 2','Language 3', + 'Language 4'); +$promo_language =$tmpRow[promo_language]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//greetingFlag +$greetingDefArr=array( + array('00','System'), + array('01','Host name'), + array('02','Personal'), + array('80','Temporary') + ); +$greeting =$tmpRow[greeting]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +/* +//pwdEnable +$pwdFlag=$tmpRow[pwdFlag]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +*/ +//pwdValue +$pwdValue=$tmpRow[pwdValue]; +echo "\n "; +echo ""; +$seqNo++; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +/* +echo ""; +echo "
      No.NameValueDescription
      $seqNo Start MSISDNMSISDN"; + echo ""; + echo " 
      $seqNo Status"; +$preValue=""; +echo ""; +for($i=0;$i{$statusDef[$i][2]}
      "; + $preValue.="{$statusDef[$i][2]},"; + }else{ + echo "{$statusDef[$i][2]}
      "; + } +} +$preValue=substr($preValue,0,strlen($preValue)-1); +echo "
      -
      $seqNo Mailbox no.  $mailboxIDMailbox number (0-9999)
      $seqNo Language "; +echo ""; +echo "Select a language from five active language for greetings
      $seqNo Greeting type"; +echo ""; +echo "Select a kind of greeting to play for dial-in call, selective greetings include system, host name and personal greetings
      $seqNo Password Enable"; +if($pwdFlag > 0){ + echo " Enable     "; + echo " Disable"; +}else{ + echo " Enable     "; + echo " Disable"; +} +echo "VMS service password flag
      $seqNo Password"; +echo ""; +echo "4-digit password
      "; +if($isTryCreate < 1){ + //message info list + $newMessageNum =$tmpRow[newMessageNum]; + $oldMessageNum =$tmpRow[oldMessageNum]; + echo "
      New Message Number:$newMessageNum     Old Message Number:$oldMessageNum "; + echo " "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=1;$i<=10;$i++){ + $msgInfo=$tmpRow['messageInfo_'.$i]; + $msgFlag =subStr($msgInfo,0,2); + if($msgFlag == 'FF') continue; + if($msgFlag == '01'){ + $isNew='No'; + }elseif($msgFlag == '02'){ + $isNew='Yes'; + }else{ + continue; + } + $msgNo =$i; + $timeStr =subStr($msgInfo,2,8); + $timeStr =hexdec($timeStr); + $timeStr =date("Y-m-d H:i:s",$timeStr); + $callerNumber =subStr($msgInfo,10); + $callerNumber =str_replace('F','',$callerNumber); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      Message no.Caller numberNewTime
       $msgNo $callerNumber $isNew $timeStr
      "; +}*/ +?> + +"; +echo "\n"; +echo "\n"; +?> + + +  + + + + diff --git a/wxc2_omc/account/priSubsMng/vmsSubsConfig b/wxc2_omc/account/priSubsMng/vmsSubsConfig new file mode 100755 index 0000000..351c77f --- /dev/null +++ b/wxc2_omc/account/priSubsMng/vmsSubsConfig @@ -0,0 +1,49 @@ +[para]0[Name]MSISDN +[sqlName]msisdn[t]input[unit]MSISDN[u]00.0-15.7[u] +[v]keepAsc-low-E +[remark] + +[para]1[Name]Status +[sqlName]status[t]checkbox[unit]Register flag[u]00.2-00.2[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Active flag[u]00.1-00.1[u] +[v]0[opt]not support +[v]1[opt]support +[t]checkbox[unit]Locked flag[u]00.0-00.0[u] +[v]0[opt]not support +[v]1[opt]support +[remark] +- + +[para]2[Name]Mailbox no. +[sqlName]mailboxID[t]readOnly[unit]Mailbox no.[u]00.0-03.7[u] +[v]toDec-high-0 +[remark] +Mailbox number (0-9999) + +[para]3[Name]Language +[sqlName]promo_language[t]select[unit]Language[u]00.0-00.7[u] +[v]0[opt]Language 0 +[v]1[opt]Language 1 +[v]2[opt]Language 2 +[v]3[opt]Language 3 +[v]4[opt]Language 4 +[remark] +Select a language from five active language for greetings + +[para]4[Name]Greeting type +[sqlName]greeting[t]select[unit]Greeting type[u]00.0-00.7[u] +[v]00[opt]System +[v]01[opt]Host name +[v]02[opt]Personal +[v]128[opt]Temporary +[remark] +Select a kind of greeting to play for dial-in call, selective greetings include system, host name and personal greetings + +[para]5[Name]Password +[sqlName]pwdValue[t]input[unit]Password[u]00.0-3.7[u] +[v]keepAsc-low-F +[remark] +4-digit password + \ No newline at end of file diff --git a/wxc2_omc/account/pubSubsImport/get_log_file.php b/wxc2_omc/account/pubSubsImport/get_log_file.php new file mode 100755 index 0000000..80b2b65 --- /dev/null +++ b/wxc2_omc/account/pubSubsImport/get_log_file.php @@ -0,0 +1,42 @@ + +Connect [$dstSeverIp] Failed!"; + exit(); + } + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + if(!$key) + { + echo "
      Login Failed!"; + exit(); + } + //echo "sftp_get($key,$localFileName,$remoteFileName)
      "; + if(!sftp_get($connection,$localFileName,$remoteFileName,SFTP_ASCII)) + { + echo "
      Get log file Failed"; + exit(); + } + + header("Content-type: application/txt"); + header("Content-Disposition: attachment; filename=$logFileName"); + + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + + readfile("../../../ftpFile/$logFileName"); +?> + diff --git a/wxc2_omc/account/pubSubsImport/get_log_file.php.org b/wxc2_omc/account/pubSubsImport/get_log_file.php.org new file mode 100755 index 0000000..7809d9c --- /dev/null +++ b/wxc2_omc/account/pubSubsImport/get_log_file.php.org @@ -0,0 +1,42 @@ + +Connect [$dstSeverIp] Failed!"; + exit(); + } + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + if(!$key) + { + echo "
      Login Failed!"; + exit(); + } + //echo "sftp_get($key,$localFileName,$remoteFileName)
      "; + if(!sftp_get($key,$localFileName,$remoteFileName,SFTP_ASCII)) + { + echo "
      Get log file Failed"; + exit(); + } + + header("Content-type: application/txt"); + header("Content-Disposition: attachment; filename=$logFileName"); + + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + + readfile("../../../ftpFile/$logFileName"); +?> + diff --git a/wxc2_omc/account/pubSubsImport/subscriberImportDown.php b/wxc2_omc/account/pubSubsImport/subscriberImportDown.php new file mode 100755 index 0000000..864d5b5 --- /dev/null +++ b/wxc2_omc/account/pubSubsImport/subscriberImportDown.php @@ -0,0 +1,312 @@ +valueName=$valueName
      "; + $getParamValueSql="SELECT $valueName FROM $paramTable + WHERE $objWhereStr and instanceNo <> '' + "; + if($DEBUG) echo"
      aaa=$getParamValueSql
      "; + $getResult=mysqli_query($objDbConn,$getParamValueSql); + echo mysqli_error($objDbConn); + if(mysqli_num_rows($getResult) > 0){ + $paramRows = mysqli_fetch_array($getResult); + //print_r($paramRows); + $paramValue = $paramRows[0]; + return($paramValue); + }else{ + return(-1); + } +}//end of function +$DEBUG =0; +//command state +$nProcFail =0; +$nWaitProc =1; +$nInProc =2; +$nOutProc =3; +$sysId = $_REQUEST['sysId']; +$dataTypeNo = $_REQUEST['dataTypeNo']; + + +//impCommState +//01=通知导入用户;02=正在导入用户;03=导入用户成功;04=导入用户失败 +/* +$impNote ='01'; +$impBgn ='02'; +$impOut ='03'; +$impFail ='04'; +*/ +?> + + +"; + +if($DEBUG)echo "paramValue=$paramValue"; +$showFlag = $_REQUEST['showFlag']; +$dstSeverIp= $_REQUEST['dstSeverIp']; +$impRecordNum = $_REQUEST['impRecordNum']; +$commStr = $_REQUEST['commStr']; +$impFile = $_REQUEST['impFile']; +if ($DEBUG) echo "showFlag=$showFlag
      "; +if ($DEBUG) echo "remote ip = $dstSeverIp
      "; +if ($DEBUG) echo "impRecordNum=$impRecordNum
      "; +if ($DEBUG) echo "commStr=$commStr
      "; +if ($DEBUG) echo "impFile=$impFile
      "; +if(!$showFlag){ + exit(); +} + + +if($DEBUG)echo "
      sysId=$sysId"; +$runSeconds = $_REQUEST['runSeconds']; +$oldDoneNum = $_REQUEST['oldDoneNum']; + +$pubDb = 'OMC_PUB'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; +$sysInfoTable = 'OMC_PUB.sysInfo'; +$perTime = 0.05; +if(isset($sysId)){ + $sysIdArr =explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; + /*if($systypeNo==360){ + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysNo=$getSysIdRow[sysNo]; + $subSysNo=$getSysIdRow[subSysNo]; + }*/ +}else{ + exit(0); +} + +$dataTypeNo = isset($dataTypeNo)?$dataTypeNo:0; +$getConfSql="SELECT impObjId,ftpDir,ftpLoginName,ftpLoginPwd,logFileName + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' AND dataTypeNo='$dataTypeNo' + "; +if($DEBUG) echo "
      getConfSql=$getConfSql"; +$getConfResult=mysqli_query($pubConn,$getConfSql); +echo mysqli_error($pubConn); +$getConfRows=mysqli_fetch_array($getConfResult); + +$impObjId = $getConfRows[impObjId]; +$logFileName = $getConfRows[logFileName]; +$ftpDir = $getConfRows[ftpDir]; +$ftpLoginName = $getConfRows[ftpLoginName]; +$ftpLoginPwd = $getConfRows[ftpLoginPwd]; + +if($DEBUG)echo "
      impObjId =$impObjId"; +if($DEBUG)echo "
      logFileName =$logFileName"; +if($DEBUG)echo "
      ftpDir =$ftpDir"; +if($DEBUG)echo "
      ftpLoginName =$ftpLoginName"; +if($DEBUG)echo "
      ftpLoginPwd =$ftpLoginPwd"; +if($DEBUG)echo "
      sysId =$sysId"; + +//if($sysTypeNo==360) +// $paramValue = getSysParamValue($sysId,$impObjId,0,'readValue'); +//else + $paramValue = getImpParamValue($sysId,$impObjId,0,'readValue'); +if($DEBUG)echo "
      paramValue=$paramValue"; + +$impCommState = substr($paramValue,0,2); +if($DEBUG)echo "
      impCommState=$impCommState"; + +if($sysTypeNo==340){ + $allNum=$impRecordNum; + $doneNum = substr($paramValue,2,6); + $doneNum = HexDec($doneNum); +}else{ + $allNum = substr($paramValue,2,6); + $allNum = HexDec($allNum); + $doneNum = substr($paramValue,8,6); + $doneNum = HexDec($doneNum); +} +if($DEBUG)echo "
      allNum=$allNum"; +if($DEBUG)echo "
      doneNum=$doneNum"; + +//show process +omcProgressBar($allNum,$doneNum); + +$maxSeconds = 20; +$runSeconds = $runSeconds + 2; +if($DEBUG)echo "
      maxSeconds=$maxSeconds"; +if($DEBUG)echo "
      runSeconds=$runSeconds"; +if($DEBUG)echo "
      if($runSeconds > $maxSeconds || $doneNum >= $allNum || $impCommState == '03' || $impCommState == '04') "; +if($doneNum > $oldDoneNum){ + $runSeconds = 0; +} +if($runSeconds > $maxSeconds || $doneNum >= $allNum || $impCommState == '03' || $impCommState == '04') +{ + if($impCommState == '04'){ + echo "
      upload $impFile Failed,please check log!!"; + }elseif($runSeconds > $maxSeconds){ + echo "
      Response Time Out!!"; + }else{ + echo "
      upload $impFile Finished!"; + echo "

      After Import subscriber data finish,Plase upload it and get the lastest data."; + } + + if($DEBUG)echo "
      dstSeverIp=$dstSeverIp"; + /* close ftp + $ftpCon=ftp_connect($dstSeverIp); + if($ftpCon < 0){ + echo "
      Connect Failed!"; + exit(); + } + */ + + //$connection=sftp_connect($dstSeverIp); + //if($connection < 0){ + // echo "
      Connect Failed!"; + // exit(); + //} + + /* close ftp + if(!ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + echo "
      Login Failed!"; + exit(); + } + */ + + //$key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + //if(!$key) + //{ + // echo "
      Login Failed!"; + // exit(); + //} + + $remoteFileName =$ftpDir.$logFileName; + $timestamp = time(); + $nameArray = explode(".",$logFileName); + $logFileName = $nameArray[0].$timestamp.".log"; + $localFileName ="/usr/local/apache/htdocs/ftpFile/$logFileName"; + + //delete *.log + $handle=opendir('/usr/local/apache/htdocs/ftpFile/'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + $delFileName = "/usr/local/apache/htdocs/ftpFile/".$file; + if($retval=='log') unlink($delFileName); + } + + /* close ftp + if(!ftp_get($ftpCon,$localFileName,$remoteFileName,FTP_ASCII)){ + echo "
      Get log file Failed"; + exit(); + } + */ + + //if(!sftp_get($key,$localFileName,$remoteFileName,SFTP_ASCII)) + //{ + // echo "
      Get log file Failed"; + // exit(); + //} + + /* close ftp + ftp_quit($ftpCon); + */ + + + //$logFileUrl="../../../ftpFile/$logFileName"; + $logFileUrl="./get_log_file.php?dstSeverIp={$dstSeverIp}&ftpLoginName={$ftpLoginName}&ftpLoginPwd={$ftpLoginPwd}&localFileName={$localFileName}&remoteFileName={$remoteFileName}&logFileName={$logFileName}"; + echo "

      Click here to download log."; + echo ""; + echo ""; + exit(); +} +$commIdArr = explode('-',$commStr); +$commId = $commIdArr[0]; +if($DEBUG)echo "
      commId=$commId"; +//echo "sysNo=$sysNo"; +/*if($sysTypeNo==360) + $commSql = " SELECT commState FROM parameterComm WHERE commId = '$commId' AND sysNo= '$sysNo'"; +else*/ + $commSql = " SELECT commState FROM parameterComm WHERE commId = '$commId' "; +if($DEBUG) echo "
      commSql=$commSql"; +$commRes = mysqli_query($pubConn,$commSql); +$commRow = @mysqli_fetch_array($commRes); +$commStat = $commRow[commState]; +if($DEBUG)echo "
      commStat=$commStat"; +//echo "
      sysId=$sysId,impObjId=$impObjId"; + + +if($commStat == $nOutProc || !isset($commStat)){ + //send get command + $commStr = sysCommSend($sysId,0,$impObjId); +} +echo ""; +echo ""; +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/account/pubSubsImport/subscriberImportIndex.php b/wxc2_omc/account/pubSubsImport/subscriberImportIndex.php new file mode 100755 index 0000000..340d806 --- /dev/null +++ b/wxc2_omc/account/pubSubsImport/subscriberImportIndex.php @@ -0,0 +1,19 @@ + + + + " marginwidth="6" marginheight="0"> + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/account/pubSubsImport/subscriberImportUp.php b/wxc2_omc/account/pubSubsImport/subscriberImportUp.php new file mode 100755 index 0000000..0f2430f --- /dev/null +++ b/wxc2_omc/account/pubSubsImport/subscriberImportUp.php @@ -0,0 +1,492 @@ +sysId=$sysId"; + $tmpSysIdArr = explode('_',$sysId); + $sysTypeNo = $tmpSysIdArr[0]; + $sysNo = $tmpSysIdArr[1]; + $subSysNo = $tmpSysIdArr[2]; + + $paramDb = 'OBJ_'.$sysTypeNo; + + $objConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $paramDb); + + if($DEBUG) echo"
      paramDb=$paramDb"; + //获取参数定义表的表名,根据oid取出参数定义 + $tmpObjArr = explode('.',$objIdStr); + $objWhereStr=''; + for($i=0;$i $setParamValueSql
      "; + $setResult=mysqli_query($objConn,$setParamValueSql); + echo mysqli_error($objConn); + if($setResult){ + return(1); + }else{ + return(-1); + } +}//end of function +$DEBUG = 0; + +//echo "
      impFile=$impFile"; +//echo "
      impFileSize=$impFileSize"; +//echo "
      sysId=$sysId"; + +$sysId = $_REQUEST['sysId']; +$dataTypeNo = $_REQUEST['dataTypeNo']; +$nGetComm = 0; +$nSetComm = 3; +$nSubSysParam = 0; +$nGlobalSubSysParam = 1; +$nGlobalSysParam = 2; + +$pubDb = 'OMC_PUB'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; +$sysInfoTable = 'OMC_PUB.sysInfo'; +if($DEBUG) echo "(1) sysId=$sysId, dataTypeNo = $dataTypeNo
      "; +if(isset($sysId) && isset($dataTypeNo)){ + $sysIdArr=explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; +}else{ + echo "Cannot find sysId and dataTypeNo"; + exit(0); +} +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +if($sysTypeNo==390) + $getConfSql="SELECT subsDataTable,impObjId,impFileName,ftpDir,ftpLoginName,ftpLoginPwd, + logFileName,maxSegmentNum,maxIndexNumPerSeg + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' AND dataTypeNo='$dataTypeNo' AND sysNo='$sysNo' + "; + else + $getConfSql="SELECT subsDataTable,impObjId,impFileName,ftpDir,ftpLoginName,ftpLoginPwd, + logFileName,maxSegmentNum,maxIndexNumPerSeg + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' AND dataTypeNo='$dataTypeNo' + "; + if($DEBUG) echo "
      getConfSql=$getConfSql"; + + $getConfResult=mysqli_query($pubConn,$getConfSql); + echo mysqli_error($pubConn); + $getConfRows=mysqli_fetch_array($getConfResult); + + $subsDataTable = $getConfRows[subsDataTable]; + $impObjId = $getConfRows[impObjId]; + $impFileName = $getConfRows[impFileName]; + $logFileName = $getConfRows[logFileName]; + $ftpDir = $getConfRows[ftpDir]; + $ftpLoginName = $getConfRows[ftpLoginName]; + $ftpLoginPwd = $getConfRows[ftpLoginPwd]; + $maxSegmentNum = $getConfRows[maxSegmentNum]; + $maxIndexNumPerSeg = $getConfRows[maxIndexNumPerSeg]; +if($sysTypeNo==360||$sysTypeNo==395||$sysTypeNo==370||$sysTypeNo==375||$sysTypeNo==330||$sysTypeNo==325||$sysTypeNo==340||$sysTypeNo==380||$sysTypeNo==378) + $paramType = $nGlobalSysParam; +else if($sysTypeNo==390) + $paramType = $nGlobalSubSysParam; + else + $paramType = $nSubSysParam; + $maxTotalNum = $maxSegmentNum * $maxIndexNumPerSeg; +if($sysTypeNo == 395) +{ + $maxImpFileSize = 5*1024*1024*4; + $maxImpFileSizeM=ceil($maxImpFileSize/1024/1024); + $maxImpRecordNum = 20000; +} +else +{ + $maxImpFileSize = 10*1024*1024; + $maxImpFileSizeM=ceil($maxImpFileSize/1024/1024); + $maxImpRecordNum = 5000; +} + +if($DEBUG)echo "
      subsDataTable=$subsDataTable"; +if($DEBUG)echo "
      impObjId= $impObjId"; +if($DEBUG)echo "
      impFileName=$impFileName "; +if($DEBUG)echo "
      ftpDir=$ftpDir "; +if($DEBUG)echo "
      ftpLoginName=$ftpLoginName "; +if($DEBUG)echo "
      ftpLoginPwd=$ftpLoginPwd"; +if($DEBUG)echo "
      maxSegmentNum=$maxSegmentNum "; +if($DEBUG)echo "
      maxIndexNumPerSeg=$maxIndexNumPerSeg "; +if($DEBUG)echo "
      paramType=$paramType "; +if($DEBUG)echo "
      maxTotalNum=$maxTotalNum "; + +//Get the system name; +$selSql = "SELECT sysTypeName FROM sysConf WHERE sysTypeNo='$sysTypeNo'"; +if ($DEBUG) echo "selSql = $selSql
      "; +$selRes = @mysqli_query($pubConn, $selSql); +echo mysqli_error($pubConn); +$selRow = @mysqli_fetch_array($selRes); +$sysName = $selRow[sysTypeName]; +if ($DEBUG) echo "sysName = $sysName
      "; + +$upfile=$_FILES['impFile']['name']; +$impFile=$_FILES['impFile']['tmp_name']; + +//判断是否有文件上载 +if(isset($impFile) && $impFile != "none"){ + if($sysTypeNo==390) + { + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; + } + else if($sysTypeNo == 378) + { + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' + ORDER BY sysNo,subSysNo + "; + } + else + { + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; + } + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $runningServerNum = mysqli_num_rows($getSysIdResult); + //ipalim状态需要查看sysStat里的status值 + if($sysTypeNo == 378) + { + $runningServerNum=0; + $checkstatesql="select detailStat,updateTime from OMC_PUB.sysStat where sysTypeNo=378 "; + $checkstateres=mysqli_query($pubConn,$checkstatesql); + while($checkstaterow=mysqli_fetch_array($checkstateres)) + { + $update_time=$checkstaterow[updateTime]; + $bin_data=$checkstaterow[detailStat]; + $state=substr($bin_data,26*2,2)+0; + $due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-48,date("m"),date("d"),date("Y"))); + $ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+48,date("m"),date("d"),date("Y"))); + if($update_time < $due_date || $update_time > $ove_date) + continue; + if($state == 0) + $runningServerNum++; + } + } + + if($runningServerNum <= 0){ + echo "Error: No system running normally"; + //by hewd 2003-08-19 + //PPS 没有用户数据的时候,它自己会告警,使状态变为非normal,造成不能导入数据 + exit(); + + } + if($DEBUG) echo "running server number = $runningServerNum
      "; + //找出已有的记录个数 + $getTotalSql = "SELECT count(*) FROM $subsDataTable"; + if($DEBUG) echo "
      getTotalSql=$getTotalSql"; + + + $getTotalRes = mysqli_query($pubConn,$getTotalSql); + $getTotalRow = @mysqli_fetch_array($getTotalRes); + $existNum = $getTotalRow[0]; + + if($DEBUG) echo "
      existNum=$existNum"; + + //检查导入的文件大小,记录条数 + $impFileSize = filesize($impFile); + if($DEBUG) { + echo "
      impFile=$impFile"; + echo "
      impFileSize=$impFileSize
      "; + } + if($impFileSize > $maxImpFileSize){ + $impFileSizeM=ceil($impFileSize/1024/1024); + echo "
      Import File Size is $impFileSizeM M"; + echo "
      File size is too large!(Must <= {$maxImpFileSizeM}M)
      "; + @unlink ($impFile); + exit(); + } + + if($impFileSize <=0){ + echo "
      No import File"; + @unlink ($impFile); + exit(); + } + + $impRecordNum = count(file($impFile)); + if($DEBUG) echo "
      impRecordNum=$impRecordNum"; + + if($impRecordNum > $maxImpRecordNum){ + echo "
      Import file record number is $impRecordNum"; + echo "
      Records are too much!(Must <= $maxImpRecordNum)
      "; + @unlink ($impFile); + exit(); + } + + if($impRecordNum > $maxTotalNum-$existNum){ + echo "
      Exist record number($existNum) + Import record number($impRecordNum) > Max record number ($maxTotalNum)"; + echo "
      User number is too much!
      "; + @unlink ($impFile); + exit(); + } + $submitStat = 'DISABLED'; + for ($k=0; $k<$runningServerNum; $k++) { + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysId=$sysTypeNo.'_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $dstSeverIp = $getSysIdRow[ip]; + if($sysTypeNo==360||$sysTypeNo==395||$sysTypeNo==370||$sysTypeNo==375||$sysTypeNo==330||$sysTypeNo==325||$sysTypeNo==340||$sysTypeNo==380||$sysTypeNo==378) + $sysIdCyc[$k] = $sysTypeNo.'_99_99'; + else if($sysTypeNo==390) + $sysIdCyc[$k]='390_'.$getSysIdRow[sysNo].'_99'; + else + $sysIdCyc[$k] = $sysId; + if($DEBUG) echo "
      sysId = $sysId"; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + //debug_log("/tmp/deugImport.txt","sysIdCyc=$sysIdCyc[$k]"); + + /* close ftp + $ftpCon=ftp_connect($dstSeverIp); + if($ftpCon < 0){ + echo "
      Connect Failed!"; + @unlink ($impFile); + exit(); + } + */ + + $connection=sftp_connect($dstSeverIp); + if(!$connection){ + echo "
      Connect Failed!"; + @unlink ($impFile); + exit(); + } + + /* close ftp + if(!ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + echo "
      Login Failed!"; + @unlink ($impFile); + exit(); + } + */ + + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + if(!$key) + { + echo "
      Login Failed!"; + @unlink ($impFile); + exit(); + } + + $remoteFileName=$ftpDir.$impFileName; + /* close ftp + if(!ftp_put($ftpCon,$remoteFileName,$impFile,FTP_ASCII)){ + echo "
      Put file Failed"; + @unlink ($impFile); + exit(); + } + */ + + if(!sftp_put($key,$remoteFileName,$impFile,SFTP_ASCII)) + { + echo "
      Put file Failed"; + @unlink ($impFile); + exit(); + } + /* close ftp + ftp_quit($ftpCon); + */ + $logFile="/usr/local/apache/htdocs/ftpFile/$logFileName"; + @unlink ($logFile); + } + @unlink ($impFile); + + //修改设备参数 + if($sysTypeNo==340){ + $instanceNo = 0; + $commState = $k4_flag.'1'; + $totalNum = DecHex($impRecordNum); + $totalNum = omc_keep_length($totalNum,'0',6); + if($k4_flag!=8) + $k4 = '0000000000000000'; + else{ + if(strlen($k4)<16){ + echo "
      K4 is incorrect!"; + exit(); + } + } + $newValue = $commState.$totalNum.$k4; + }else{ + $instanceNo = 0; + $commState = '01'; + $totalNum = DecHex($impRecordNum); + $totalNum = omc_keep_length($totalNum,'0',6); + $finishNum = '000000'; + $newValue = $commState.$totalNum.$finishNum; + } + if($DEBUG)echo "
      newValue=$newValue"; + //exit(); + switch($paramType){ + case '1': + $sysId=$sysTypeNo.'_'.$getSysIdRow[sysNo].'_99'; + break; + case '2': + $sysId=$sysTypeNo.'_99_99'; + break; + default: + break; + } + if($DEBUG) echo "
      (2) sysId=$sysId"; + //send set command + + if($sysTypeNo==360||$sysTypeNo==395||$sysTypeNo==370||$sysTypeNo==375||$sysTypeNo==330||$sysTypeNo==325||$sysTypeNo==340||$sysTypeNo==380||$sysTypeNo==390||$sysTypeNo==378){ + //if($sysTypeNo==360) + // $chgResult = setSysParamValue($sysIdCyc[0],$impObjId,$instanceNo,$newValue); + //else + $chgResult = setImpParamValue($sysIdCyc[0],$impObjId,$instanceNo,$newValue); + $commStr = sysCommSend($sysIdCyc[0],$nSetComm,$impObjId); + }else{ + for ($k=0; $k<$runningServerNum; $k++) { + //if($DEBUG) + //echo "
      {$sysIdCyc[$k]},$nSetComm,$impObjId
      "; + $chgResult = setSysParamValue($sysIdCyc[$k],$impObjId,$instanceNo,$newValue); + $commStr = sysCommSend($sysIdCyc[$k],$nSetComm,$impObjId); + if($DEBUG){ + echo "setSysParamValue($sysId,$impObjId,$instanceNo,$newValue)
      "; + echo "sysCommSend($sysId,$nSetComm,$impObjId)"; + } + } + } + + //让下面的命令扫描页面开始启动 + echo ""; + sleep(2); +}elseif(isset($impFile)){ + echo "
      Upload file failed, File isn't exist or file is empty!"; +} +?> + +"; +?> +
      " name="subsData" enctype="multipart/form-data"> + + + + if ( (395 == $sysTypeNo || 360 == $sysTypeNo) && (1 == $dataTypeNo) ) { + $title = "$sysName recharge card data import"; + } else { + $title = "$sysName subscriber data import"; + } + echo ""; + echo ""; + echo ""; +?> + + + + + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +?> + + + +
      "; + echo "$title"; + echo "
      +Note:Import File's size <= M, records <= +
      Select File: + + +
      K4 Flag"; + echo ""; + echo "
      K4
      +submitStat=$submitStat"; + +if($submitStat == 'DISABLED'){ + echo ""; +}else{ + echo ""; +} + +echo ""; +echo ""; +?> +
      +
      + + + diff --git a/wxc2_omc/account/pubSubsMng/commIndex.php b/wxc2_omc/account/pubSubsMng/commIndex.php new file mode 100755 index 0000000..6e8ccda --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/commIndex.php @@ -0,0 +1,11 @@ + + + "; + echo ""; + ?> + + + diff --git a/wxc2_omc/account/pubSubsMng/commScan.php b/wxc2_omc/account/pubSubsMng/commScan.php new file mode 100755 index 0000000..310379f --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/commScan.php @@ -0,0 +1,291 @@ +if(isFinish != 0 || (waitTime >= maxWaitTime) ||(stopTime > maxStopTime))
      "; +if($DEBUG) echo "
      if($isFinish != 0 || ($waitTime >= $maxWaitTime) ||($stopTime > $maxStopTime))
      "; + +//命令处理完毕 +//---------------- +if(($isFinish != 0) || ($waitTime >= $maxWaitTime) || ($stopTime > $maxStopTime)){ + if($commId >= $maxOfCommId){ //初始化命令表 + //先删除表 + $dropSql = "DROP TABLE $commTable "; + mysqli_query($pubConn,$dropSql); + //再建一个结构相同的新表 + $createSql="CREATE TABLE subscriberComm ( + commId smallint(5) unsigned NOT NULL auto_increment, + commType tinyint(1) DEFAULT '0' NOT NULL, + dataTypeNo tinyint(4) DEFAULT '0' NOT NULL, + sysTypeNo smallint(5) unsigned DEFAULT '0' NOT NULL, + sysNo smallint(5) unsigned DEFAULT '0' NOT NULL, + subSysNo smallint(5) unsigned DEFAULT '0' NOT NULL, + indexValueList varchar(255) NOT NULL, + fieldNameList tinytext NOT NULL, + paramType tinyint(4) DEFAULT '0' NOT NULL, + commState tinyint(3) unsigned DEFAULT '0' NOT NULL, + totalNum smallint(5) unsigned DEFAULT '0' NOT NULL, + finishNum smallint(5) unsigned DEFAULT '0' NOT NULL, + sendTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + bgnTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + endTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + remark varchar(200) binary NOT NULL, + PRIMARY KEY (commId), + KEY sysTypeNo (sysTypeNo), + KEY sysNo (sysNo), + KEY subSysNo (subSysNo), + KEY bufferKey (indexValueList) + ) + "; + mysqli_query($pubConn,$createSql); + }else{ + //删除命令表的相关命令 + $commArr = explode('-',$commIdStr); + for($i=0;$ideleteSql = $deleteSql"; + mysqli_query($pubConn,$deleteSql); + echo mysqli_error($pubConn); + } + } + + // 重定向返回指定页 + if($isFinish != 0){ + if($isFinish > 0){ + echo "Finished!!"; + if($commType == $nLoadIndexComm){ + sleep(8);//等8秒,这样数据库插入才能完全完成 + } + if($DEBUG) echo "
      okURL=$okURL"; + if($DEBUG) exit(); + echo " "; + }elseif($isFinish == -1){ + echo "Failed in some system!!"; + if($DEBUG) exit(); + echo " "; + }else{ + echo "Failed!!"; + if($DEBUG) exit(); + echo " "; + } + }elseif($usedTime >= $maxOverTime && $stopTime == 1){ + echo "Stoped!!"; + if($DEBUG) exit(); + echo " "; + }else{ //$usedTime >= $maxOverTime + echo "Timeout!!"; + if($DEBUG) exit(); + echo " "; + } + exit(); +}//end of if($isFinish....) + +//显示命令执行状态 +//----------------------------- +$showTime = $usedTime*2; +echo "Time:$showTime s"; +$okNum = 0; +$failNum = 0; +$commNum = 0; +$commArr = explode('-',$commIdStr); +$thisTImeFinishNumstr=''; +$lastTimeFinishNumArr = explode('-',$lastTimeFinishNumStr); +for($i=0;$iget command = $commSql"; + $commResult = mysqli_query($pubConn,$commSql); + if(mysqli_num_rows($commResult) <= 0){ + echo "
      Can not find this command's info in datebase"; + exit(); + } + $commRows = @mysqli_fetch_array($commResult); + $sysTypeNo = $commRows[sysTypeNo]; + $sysNo = $commRows[sysNo]; + $subSysNo = $commRows[subSysNo]; + $commType = $commRows[commType]; + $paramType = $commRows[paramType]; + $objId = $commRows[objId]; + $commState = $commRows[commState]; + $indexValueList = $commRows[indexValueList]; + $fieldNameList = $commRows[fieldNameList]; + $remark = $commRows[remark]; + if ($DEBUG)echo "commState=$commState, commRemakr=$remark
      "; + + //获取该系统类型的snmp头和类型名称 + if(!isset($sysTypeName)){ + $sysConfSql = "SELECT snmpHead,sysTypeName FROM $sysConfTable WHERE sysTypeNo='$sysTypeNo'"; + if($DEBUG) echo "
      get conf = $sysConfSql"; + $sysConfResult = mysqli_query($pubConn,$sysConfSql); + echo mysqli_error($pubConn); + $sysConfRows = @mysqli_fetch_array($sysConfResult); + $sysTypeName = $sysConfRows[sysTypeName]; + $snmpHead = $sysConfRows[snmpHead]; + } + $sysName = $sysTypeName.'_'.$sysNo.'_'.$subSysNo; + //echo "
      $sysName 's"; + $objIdStr=$snmpHead.'.'.$objId; + //echo "$objIdStr"; + + switch($commType){ + case $nReadComm: + $showInfo="Read $indexValueList from $sysName"; + break; + case $nChangeComm: + $showInfo="Change $indexValueList's field[$fieldNameList] in $sysName"; + break; + case $nCreateComm: + $showInfo="Create $indexValueList to $sysName"; + break; + case $nDeleteComm: + $showInfo="Delete $sysName's $indexValueList"; + break; + case $nLoadIndexComm: + $showInfo="Load $sysName's subscriber Data "; + break; + case $nReplaceIndexComm: + $showInfo="Replace Index $indexValueList -> $remark in $sysName"; + break; + default: + echo " Unknown Command Type"; + exit(); + } + + echo " $showInfo"; + + switch($commState){ + case 0: //process failed + $failNum++; + echo "
      $commRows[remark] "; + insertLog("$showInfo Failed:$remark"); + sleep(1); + break; + case 1: //wait process + $waitTime++; + break; + case 2: //in process + $waitTime = 0; + //只要有一个命令的完成数在增长,就认为该组命令在运行,否则认为命令处理超时 + if($DEBUG) echo "====> {$commRows[finishNum]} > {$lastTimeFinishNumArr[$i]}"; + if($commRows[finishNum] > $lastTimeFinishNumArr[$i]){ + $stopTime = 0; + }else{ + $stopTime++; + } + omcProgressBar($commRows[totalNum],$commRows[finishNum]); + $thisTimeFinishNumStr .=$commRows[finishNum].'-'; + break; + case 3: //process finished + $okNum++; + omcProgressBar(100,100); + insertLog("$showInfo OK"); + break; + default: + echo "Unknown Command State"; + exit(); + } + echo "

      "; +}//end of for($i=0;$i$commNum =?= $finishNum"; +if($commNum == $okNum){ + $isFinish = 1; +}elseif($failNum > 0 && $okNum > 0){ + $isFinish = -1; +}elseif($commNum == $failNum){ + $isFinish = -2; +}else{ + $isFinish = 0; +} + +//当删除用户时,只要不是"回应超时",都删除OMC数据库的用户 +if($commType == $nDeleteComm && $commState != $nWaitProc && $commState != $nInProc){ + if($DEBUG) echo"
      commType == DeleteComm ($commType == $nDeleteComm)"; + if($DEBUG) echo"
      remark={$commRows[remark]}"; + if($DEBUG) sleep(5); + if( $commRows[remark] != "response timeout"){ + if(!strstr($commRows[remark],"Can not delete an in used subscriber, please disable first")) + $isFinish = 1; + } +} +if($DEBUG) echo"
      lastTimeFinishNumStr=$lastTimeFinishNumStr"; +if($DEBUG) echo"
      thisTimeFinishNumStr=$thisTimeFinishNumStr"; +$lastTimeFinishNumStr = $thisTimeFinishNumStr; +//刷新返回 +//-------------- +$usedTime++; //总时间 +$failURL= rawurlencode($failURL); +$okURL = rawurlencode($okURL); +//保留变量值,传到下次刷新 +$keepStr= "usedTime=$usedTime&waitTime=$waitTime&isFinish=$isFinish&stopTime=$stopTime&failURL=$failURL&okURL=$okURL&commIdStr=$commIdStr&commNum=$commNum&lastTimeFinishNumStr=$lastTimeFinishNumStr&commType=$commType"; +if($DEBUG) echo "
      keepStr=$keepStr"; +/* +if ( 1!=$searchInServer ) { + require("commDown.php"); +} +*/ +sleep(5); +$PHP_SELF = $_SERVER['PHP_SELF']; + +?> + diff --git a/wxc2_omc/account/pubSubsMng/dataProc.inc b/wxc2_omc/account/pubSubsMng/dataProc.inc new file mode 100755 index 0000000..8ada4ad --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/dataProc.inc @@ -0,0 +1,499 @@ + +getSysIdSql=$getSysIdSql"; + //debug_log("/tmp/debug.txt",$getSysIdSql); + $getSysIdResult=mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + if(mysql_errno()) + debug_log("/tmp/debug.txt","remark-1"); + if(mysqli_num_rows($getSysIdResult) > 0){ + $getSysIdRows=mysqli_fetch_array($getSysIdResult); + $sysNo = $getSysIdRows[sysNo]; + $subSysNo = $getSysIdRows[subSysNo]; + $sysId = $sysTypeNo.'_'.$sysNo.'_'.$subSysNo; + }else{ + echo "
      Can not find this system's IP in system List,"; + echo "Please add it!"; + exit(0); + } +}else{ + echo "Can not find sysTYpeNo!!"; + exit(0); +} + +if(($isBatchCreate>0&&$isCreate>0)&&(!isset($batchNum)||$batchNum>100||$batchNum<=0)){ + echo ""; + echo " "; + exit(); +} +$objDb='OBJ_'.$sysTypeNo; +$objConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $objDb); + +$dataTypeNo = (strlen($dataTypeNo) > 0)?$dataTypeNo:0; +$confTable = 'subsParamConf_'.$dataTypeNo; +if($sysTypeNo==390 || $sysTypeNo == 365 || $sysTypeNo == 366){ + $getConfSql="SELECT sysTypeName,dataTypeNo,indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable,$systemConfTable + WHERE $sysSubsConfTable.sysTypeNo='$sysTypeNo' + AND $systemConfTable.sysTypeNo='$sysTypeNo' + AND $sysSubsConfTable.dataTypeNo='$dataTypeNo' + AND $sysSubsConfTable.sysNo='$sysNo' + "; +}else{ + $getConfSql="SELECT sysTypeName,dataTypeNo,indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable,$systemConfTable + WHERE $sysSubsConfTable.sysTypeNo='$sysTypeNo' + AND $systemConfTable.sysTypeNo='$sysTypeNo' + AND $sysSubsConfTable.dataTypeNo='$dataTypeNo' + "; +} +//if($DEBUG) +//echo "
      getConfSql=$getConfSql"; +//exit(); +$getConfResult=mysqli_query($pubConn,$getConfSql); +echo mysqli_error($pubConn); + +if(mysql_errno()) + debug_log("/tmp/debug.txt","remark-2"); +$getConfRows=mysqli_fetch_array($getConfResult); +$sysTypeName =$getConfRows['sysTypeName']; +$indexFieldName =$getConfRows['indexFieldName']; +$srcDataTable =$getConfRows['subsDataTable']; +$tmpDataTable =$getConfRows['tmpDataTable']; +global $userName; + +if($sysTypeName=="VSS") $sysTypeName="VMS"; +$srcDataConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $sysTypeName."_DB"); + +if($DEBUG)echo "
      srcDataTable:$srcDataTable
      tmpDataTable:$tmpDataTable"; +//锟斤拷锟斤拷锟矫伙拷锟角凤拷锟斤拷锟斤拷锟剿诧拷锟斤拷 +$editFlag = false; +if($editFlag < 0){ + $chkFlagSql = "SELECT editFlag FROM $tmpDataTable WHERE $indexFieldName = '$keyValue'"; + if($DEBUG) echo "
      chkFlagSql=$chkFlagSql"; + $result=mysqli_query($objConn,$chkFlagSql); + echo mysqli_error($objConn); + if(mysql_errno()) + debug_log("/tmp/debug.txt","remark-3"); + $flagRow=mysqli_fetch_array($result); + $editFlag = $flagRow[0]; + if($editFlag > 0){ + echo "This subscriber is be other one editing!!,please wait and try again"; + }else{ + $setFlagSql = "UPDATE $tmpDataTable SET editFlag = '1' WHERE $indexFieldName = '$keyValue'"; + mysqli_query($objConn,$setFlagSql); + } +} + +$needSaveEditValue = 0; +$needSendComm = 0; +$indexValueList = $keyValue; + +//*********锟斤拷取一锟斤拷锟矫伙拷*************************** +if($isRead > 0){//$getFromSys + $commType = $nReadComm; + $needSendComm = 1; +} +//*********锟睫革拷一锟斤拷锟矫伙拷************************* +if($isChange > 0){ + $needSaveEditValue = 1; + $commType = $nChangeComm; + $needSendComm = 1; +} +//*********锟斤拷锟斤拷一锟斤拷锟矫伙拷*************************** +if($isCreate > 0){ + if($isCreate == 2){//create in omc + $needSaveEditValue = 1; + }else{//$isCreate == 2,create in server + $commType = $nCreateComm; + $needSendComm = 1; + $needSaveEditValue = 1; + } +} + +//*********删锟斤拷一锟斤拷锟矫伙拷*************************** +if($isDelete > 0){ + $commType = $nDeleteComm; + $needSendComm = 1; +} + +//*********锟斤拷锟斤拷锟斤拷锟斤拷锟矫伙拷*************************** +if($isLoadIndex > 0){ + $commType = $nLoadIndexComm; + $needSendComm = 1; +} + +//*********锟芥换锟矫伙拷index锟斤拷锟斤拷*************************** +if($isReplaceIndex > 0){ + $chkIndexPass = 0; + if($isConfirmed > 0){ + $chkIndexPass=1; + if($DEBUG) echo "
      newIndexValue=$newIndexValue"; + //锟斤拷锟絥ewIndexValue锟斤拷锟斤拷效锟斤拷 + switch($sysTypeNo){ + case '330': + //锟斤拷锟姐长锟斤拷 + for($i=strlen($newIndexValue);$i<16;$i++){ + $imsi='0'.$newIndexValue; + } + $oldMccMnc=substr($keyValue,0,6); + $newMccMnc=substr($newIndexValue,0,6); + /* + if($oldMccMnc != $newMccMnc){ + echo "Please Check new IMSI's MCC AND MNC!"; + $chkIndexPass=0; + }*/ + if($newIndexValue == $keyValue){ + echo "New IMSI Number same as old's!"; + $chkIndexPass=0; + } + break; + default: + echo "Unknown sysTypeNo($sysTypeNo)!"; + exit(); + } + if($chkIndexPass > 0){ + $commType = $nReplaceIndexComm; + $needSendComm = 1; + } + } + if($chkIndexPass == 0){ + if($DEBUG) echo "
      "; + echo "\n
      "; + echo "\n "; + $showIndexName=strtoupper($indexFieldName); + echo "\n "; + echo "\n "; + echo "\n
      Replace $showIndexName
      Old $showIndexName:$keyValue
      New $showIndexName:"; + echo "\n "; + echo "\n
      "; + echo "
           "; + echo "\n "; + echo "\n "; + echo "\n "; + echo "\n "; + echo "\n "; + echo "\n "; + echo "
      "; + exit(); + } +} + +//---------锟斤拷锟斤拷锟斤拷锟�------------------------------ +if($needSaveEditValue == 1){ + if($isBatchCreate>0&&$isCreate>0){ + $stopFlag=0; + for($tmpNum=0;$tmpNum<$batchNum;$tmpNum++){ + $counter=0; + for($i=$bgnNo;$i<$endNo;$i++){ + if(${'checkBox_'.$i} > 0){ + $editValue=${'editValue_'.$i}; + $tmpFieldName = ${'fieldName_'.$i}; + if($tmpFieldName == $indexFieldName){ + if($tmpNum==0) + $indexValueList = $editValue; + $tmpLen=strlen($editValue); + $tmpEditValue=$editValue[$tmpLen-4].$editValue[$tmpLen-3].$editValue[$tmpLen-2].$editValue[$tmpLen-1]; + $tmpEditValue = $tmpEditValue+$tmpNum; + if($tmpEditValue%10000==0 && $tmpNum!=0){ + $batchNum=$tmpNum; + $stopFlag=1; + } + $tmpEditValue=''.$tmpEditValue;//确锟斤拷tmpEditValue为锟街凤拷锟斤拷 + $tmpEditValue=omc_keep_length($tmpEditValue,'0',4); + $editValue[$tmpLen-4]= $tmpEditValue[0]; + $editValue[$tmpLen-3]= $tmpEditValue[1]; + $editValue[$tmpLen-2]= $tmpEditValue[2]; + $editValue[$tmpLen-1]= $tmpEditValue[3]; + + //echo "
      editValue=$editValue"; + + } + + if($sysTypeNo==330&&$tmpFieldName == 'inter_msisdn'){ + $tmpEditValueArr=explode("E",$editValue); + $editValue=$tmpEditValueArr[0]; + $tmpLen=strlen($editValue); + $tmpEditValue=$editValue[$tmpLen-4].$editValue[$tmpLen-3].$editValue[$tmpLen-2].$editValue[$tmpLen-1]; + $tmpEditValue = $tmpEditValue+$tmpNum; + if($tmpEditValue%10000==0 && $tmpNum!=0){ + $batchNum=$tmpNum; + $stopFlag=1; + } + $tmpEditValue=''.$tmpEditValue;//确锟斤拷tmpEditValue为锟街凤拷锟斤拷 + $tmpEditValue=omc_keep_length($tmpEditValue,'0',4); + $editValue[$tmpLen-4]=$tmpEditValue[0]; + $editValue[$tmpLen-3]=$tmpEditValue[1]; + $editValue[$tmpLen-2]=$tmpEditValue[2]; + $editValue[$tmpLen-1]=$tmpEditValue[3]; + $editValue=omc_keep_length($editValue,'E',18,0); + //echo "
      editValue=$editValue"; + } + + if($counter == 0){ + $setValueStr = "$tmpFieldName = '$editValue'"; + $fieldNameList = "$tmpFieldName"; + }else{ + $setValueStr .= ", $tmpFieldName = '$editValue'"; + $fieldNameList .= ",$tmpFieldName"; + } + $counter++; + } + } + if($stopFlag==1) + break; + if($isCreate == 2){//锟斤拷omc锟较达拷锟斤拷 + $saveSql = "REPLACE $srcDataTable SET $setValueStr"; + $saveResult = mysqli_query($srcDataConn,$saveSql); + + }else{ + $saveSql = "REPLACE $tmpDataTable SET $setValueStr"; + $saveResult = mysqli_query($objConn,$saveSql); + echo mysqli_error($objConn); + + } + + if($DEBUG) + echo "
      saveSql = $saveSql
      objDb=$objDb"; + echo mysqli_error($pubConn); + if(mysql_errno()) + debug_log("/tmp/debug.txt","remark-4"); + } + $keyValue=$indexValueList; + + if($isCreate == 2){//锟斤拷omc锟较达拷锟斤拷 + echo ""; + exit(); + } + }else{ + $counter=0; + //echo "bgnNo=$endNo
      "; + for($i=$bgnNo;$i<$endNo;$i++){ + //echo "checkBox_$i=".${'checkBox_'.$i}."
      "; + + if(${'checkBox_'.$i} > 0){ + $editValue=${'editValue_'.$i}; + $tmpFieldName = ${'fieldName_'.$i}; + if($isCreate > 0){ + if($tmpFieldName == $indexFieldName){ + $indexValueList = $editValue; + } + }else{ + if($tmpFieldName == $indexFieldName){ + continue; + } + } + if($counter == 0){ + $setValueStr = "$tmpFieldName = '$editValue'"; + $fieldNameList = "$tmpFieldName"; + }else{ + $setValueStr .= ", $tmpFieldName = '$editValue'"; + $fieldNameList .= ",$tmpFieldName"; + } + $counter++; + } + } + + if($isCreate){ + $keyValue=$indexValueList; + if($isCreate == 2){//锟斤拷omc锟较达拷锟斤拷 + $saveSql = "REPLACE $srcDataTable SET $setValueStr"; + $saveResult = mysqli_query($srcDataConn,$saveSql); + + }else{ + $saveSql = "REPLACE $tmpDataTable SET $setValueStr"; + $saveResult = mysqli_query($objConn,$saveSql); + echo mysqli_error($objConn); + + } + }else{ + $saveSql = "UPDATE $tmpDataTable SET $setValueStr + WHERE $indexFieldName = '$keyValue' + "; + $saveResult = mysqli_query($objConn,$saveSql); + echo mysqli_error($objConn); + + } + + if($DEBUG) echo "
      saveSql = $saveSql
      objDb=$objDb"; + //if(mysql_errno()) + //debug_log("/tmp/debug.txt","remark-5:$saveSql,tmpFieldName=$tmpFieldName,editValue'=$editValue'"); + echo mysqli_error($pubConn); + } +} + +//if($DEBUG && $_SERVER['REQUEST_METHOD'] == "POST") exit(); +//echo "$sysId"; +//exit(); +//---------锟斤拷锟斤拷锟斤拷锟筋,锟斤拷转页锟斤拷---------------------------- + +global $objConn, $srcDataConn; +if($needSendComm == 1 && isset($commType)){ + if($commType == $nLoadIndexComm || $commType == $nDeleteComm){ + if($commType == $nLoadIndexComm){ + $okURL ="./subscriberListDown.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&sysNo=$sysNo&sysId=$sysId"; + $failURL ="./subscriberListDown.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&sysNo=$sysNo&sysId=$sysId"; + }else{ + $okURL ="./subscriberListDown.php?sysTypeNo=$sysTypeNo&dataTypeNo=$dataTypeNo&sysNo=$sysNo&sysId=$sysId&commType=$nDeleteComm&keyValue=$keyValue"; + $failURL = "$PHP_SELF?sysId=$sysId&bgnNo=$bgnNo&keyValue=$keyValue&canSetNum=$canSetNum&bufferNo=$bufferNo&dataTypeNo=$dataTypeNo"; + } + }else{ + if($commType == $nReplaceIndexComm){ + $okURL = "$PHP_SELF?sysId=$sysId&bgnNo=$bgnNo&keyValue=$newIndexValue&canSetNum=$canSetNum&bufferNo=$bufferNo&dataTypeNo=$dataTypeNo&isRead=1"; + }elseif($commType == $nCreateComm){ + if($isBatchCreate==1) + $okURL = "$PHP_SELF?sysId=$sysId&bgnNo=$bgnNo&keyValue=$keyValue&canSetNum=$canSetNum&bufferNo=$bufferNo&dataTypeNo=$dataTypeNo&isBatchCreate=$isBatchCreate"; + else + $okURL = "$PHP_SELF?sysId=$sysId&bgnNo=$bgnNo&keyValue=$keyValue&canSetNum=$canSetNum&bufferNo=$bufferNo&dataTypeNo=$dataTypeNo&isRead=1"; + + }else{ + $okURL = "$PHP_SELF?sysId=$sysId&bgnNo=$bgnNo&keyValue=$keyValue&canSetNum=$canSetNum&bufferNo=$bufferNo&dataTypeNo=$dataTypeNo"; + } + $failURL = "$PHP_SELF?sysId=$sysId&bgnNo=$bgnNo&keyValue=$keyValue&canSetNum=$canSetNum&bufferNo=$bufferNo&dataTypeNo=$dataTypeNo&isBatchCreate=$isBatchCreate"; + } + if($DEBUG) echo "
      okURL =$okURL "; + sleep(1); + + if($commType == $nReplaceIndexComm){ + if($DEBUG) echo "
      subsCommSend(sysId,dataTypeNo,indexValueList,fieldNameList,commType,newIndexValue)"; + if($DEBUG) echo "
      subsCommSend($sysId,$dataTypeNo,$indexValueList,$fieldNameList,$commType,$newIndexValue)"; + $commIdStr = subsCommSend($sysId,$dataTypeNo,"$indexValueList","$fieldNameList",$commType,$newIndexValue); + }else{ + if($DEBUG) echo "
      subsCommSend(sysId,dataTypeNo,indexValueList,fieldNameList,commType)"; + if($DEBUG) echo "
      subsCommSend($sysId,$dataTypeNo,$indexValueList,$fieldNameList,$commType)"; + if($isBatchCreate==1){ + for($tmpNum=0;$tmpNum<$batchNum;$tmpNum++){ + $tmpCommIdStr = subsCommSend($sysId,$dataTypeNo,"$indexValueList","$fieldNameList",$commType); + $tmpLen=strlen($indexValueList); + $tmpIndexValueList=$indexValueList[$tmpLen-4].$indexValueList[$tmpLen-3].$indexValueList[$tmpLen-2].$indexValueList[$tmpLen-1]; + $tmpIndexValueList = $tmpIndexValueList+1; + $tmpIndexValueList=''.$tmpIndexValueList;//确锟斤拷tmpIndexValueList为锟街凤拷锟斤拷 + $tmpIndexValueList=omc_keep_length($tmpIndexValueList,'0',4); + $indexValueList[$tmpLen-4]=$tmpIndexValueList[0]; + $indexValueList[$tmpLen-3]=$tmpIndexValueList[1]; + $indexValueList[$tmpLen-2]=$tmpIndexValueList[2]; + $indexValueList[$tmpLen-1]=$tmpIndexValueList[3]; + //echo "
      commIdStr=subsCommSend($sysId,$dataTypeNo,\"$indexValueList\",\"$fieldNameList\",$commType)"; + $commIdStr=$commIdStr.$tmpCommIdStr; + } + }else + $commIdStr = subsCommSend($sysId,$dataTypeNo,"$indexValueList","$fieldNameList",$commType); + //exit(); + } + if($DEBUG) { + echo "
      commIdStr=subsCommSend($sysId,$dataTypeNo,\"$indexValueList\",\"$fieldNameList\",$commType)"; + } + if(isset($commIdStr) && $commIdStr != -1){ + if($commType == $nLoadIndexComm){ + $srcDataTableArr=explode('.',$srcDataTable); + $srcDataDb=$srcDataTableArr[0]; + $clearDataSql="DELETE FROM $srcDataTable"; + mysqli_query($srcDataConn,$clearDataSql); + if($DEBUG) + echo "mysqli_query($srcDataConn,$clearDataSql);
      "; + $clearDataSql="DELETE FROM $tmpDataTable"; + if($DEBUG) + echo "mysqli_query($srcDataConn,$clearDataSql);
      "; + mysqli_query($objConn,$clearDataSql); + + mysqli_error($srcDataConn); + mysqli_error($objConn); + + } + $failURL = urlencode($failURL); + $okURL = urlencode($okURL); + $scanURL = "commIdStr=$commIdStr&okURL=$okURL&failURL=$failURL"; + if($DEBUG) echo "
      scanURL = $scanURL"; +if($DEBUG) exit(); + echo " "; + exit(); + }else{ + echo "
      SEND COMMAND ERROR!
      "; + } +} + + +//锟斤拷要锟洁辑锟斤拷锟斤拷锟捷碉拷锟斤拷锟斤拷时锟斤拷 +$getDataSql="SELECT * FROM $srcDataTable WHERE $indexFieldName='$keyValue'"; +if($DEBUG) + echo "
      getDataSql=$getDataSql"; + +$result=mysqli_query($srcDataConn,$getDataSql); +$fieldNum=mysqli_num_fields($result); +if(mysql_errno()) + debug_log("/tmp/debug.txt","remark-6"); +echo mysqli_error($srcDataConn); +if($DEBUG) + echo "
      fieldNum=$fieldNum"; +$tmpRow=mysqli_fetch_array($result); +if($DEBUG) echo "
      tmpRow[mo_expiration_date]=$tmpRow[mo_expiration_date]"; + +#if($DEBUG) echo "
      valuestr=$valueStr,bufferNo=$bufferNo"; +for($i=0;$i<$fieldNum;$i++){ + $valueStr = "$valueStr ,'$tmpRow[$i]'"; +# if($DEBUG) echo "
      i:$i,tmpRow:$tmpRow[$i],valuestr=$valueStr"; +} +$updateSql = "REPLACE $tmpDataTable VALUES('0' $valueStr)"; +mysqli_query($objConn,$updateSql); +#if($DEBUG) echo "
      bufferNo=$bufferNo"; + +if($DEBUG) echo "
      updateSql=$updateSql"; +//exit(); +if(mysql_errno()) + debug_log("/tmp/debug.txt","remark-7"); +echo mysqli_error($objConn); + +// echo"
      objDb =$isTryCreate
      ParamSql = $paramSql
      "; + +//锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷没锟斤拷锟斤拷锟斤拷锟饺笔≈� +if($isTryCreate > 0){ + //锟节诧拷锟斤拷锟斤拷锟斤拷锟饺★拷锟剿碉拷锟斤拷锟斤拷锟斤拷锟绞憋拷锟斤拷锟斤拷锟饺★拷锟斤拷锟截碉拷值 + $paramSql = " SELECT * FROM $confTable + WHERE $confTable.operType > '0' + ORDER BY level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 + "; + if($DEBUG) + echo"
      objDb =$objDb
      ParamSql = $paramSql
      "; + $paramResult = mysqli_query($objConn,$paramSql); + if(mysql_errno()) + debug_log("/tmp/debug.txt","remark-8"); + echo mysqli_error($objConn); + $i=0; + while($paramRows = @mysqli_fetch_array($paramResult)){ + $tmpRow[$paramRows[fieldName]]=$paramRows[initValue]; + } + if($DEBUG) echo "
      tmpRow[mo_expiration_date]=$tmpRow[mo_expiration_date]"; +} + +?> diff --git a/wxc2_omc/account/pubSubsMng/paramEdit.php b/wxc2_omc/account/pubSubsMng/paramEdit.php new file mode 100755 index 0000000..f11214f --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/paramEdit.php @@ -0,0 +1,585 @@ + 0)?$TEST:0; + +$objConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OBJ_".$sysTypeNo); + +//value Type +$nInteger = 2; +$nAscStr = 3; +$nOctStr = 4; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType,$dataTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.subsParamConf_'.$dataTypeNo; + return($tableName); +} +/* +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + echo "
      Error in omcStrFill:the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} +*/ +$sysConfTable = 'OMC_PUB.sysConf'; +$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:0); + +$pubDb ='OMC_PUB'; +$objDb = omcGetObjDb($sysTypeNo); +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf,$dataTypeNo); +$maxLevelNum = 10; + +if($DEBUG) echo "
      A=$paramConfTable
      "; + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + + + +//=======================Get value From submit=================== +if($set == 'Set'){ + + //sort by offset + $unitNum=$_POST['unitNum']; + $inputName = $_POST['inputName']; + + for($i=1;$i<=$_POST['unitNum'];$i++){ + // $tmpDef = ${'unitDef_'.$i}; + // $tmpValue = ${'unit_'.$i}; + $tmpDef = 'unitDef_'.$i; + $tmpValue = 'unit_'.$i; + $tmpDef = $_POST[$tmpDef]; + $tmpValue = $_POST[$tmpValue]; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$i] = $tmpDef; + $tmpDefArr=explode('-',$tmpDef); + $sortArr[$i] = $tmpDefArr[0]; + $valueArr[$i] = $tmpValue; + } + $lastValue = ''; + $k = 0; + asort($sortArr); + for(reset($sortArr); $key = key($sortArr); next($sortArr)){ + if($DEBUG) echo "
      sortArr[$key] = {$sortArr[$key]}"; + if($DEBUG) echo "
      unitValue = {$valueArr[$key]}"; + $unitValue = $valueArr[$key]; + if($DEBUG) echo "
      defArr[$key] = {$defArr[$key]}"; + $unitDefArr = explode('-',$defArr[$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1){ + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + }else{//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + }else{ + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAsc"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'keepAsc': + $byteValue = $unitValue; + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + } + if($DEBUG) echo "
      lastValue = $lastValue "; + $setValue = $lastValue; + if($TEST != 1){ + //set back to input field + echo ""; + }else{ + if($valueType != 'keepAsc' && $valueType != 'toAsc'){ + $setValue = strtoupper($setValue); + } + } +}//end of if($set == 1) + + +//=======================Show GUI ======================== +?> + + + +
      " > +setValue = $setValue ,inputName = $inputName"; + +if($keyId > 0){ + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,`maxValue` FROM $paramConfTable WHERE keyId = '$keyId'"; + $objResult = mysqli_query($objConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; +}else{ + echo "ERROR!!:keyId == NULL"; + exit(); +} +/************************************** +*objName +*[unit]name[u]xx.xx-yy.yy[u]input[v]toDec-fillHigh-fillChar +*[unit]name[u]xx.xx-yy.yy[u]select[v]value1[opt]desc1[v]value2[opt]desc2 +*[remark] +***************************************/ + +//explode by '[remark]' +$remarkArr = explode('[remark]',$setTemplate); +$remark = $remarkArr[1]; + +//explode by '[unit]' +$unitArr = explode('[unit]',$remarkArr[0]); + +//show instance's name +echo "{$unitArr[0]}
      "; +if($DEBUG) echo "
      $unitArr[1]"; +//show every one unit +//--><-//$setValue = strrev($setValue); +if($DEBUG){ + echo ""; +}else{ + echo "
      "; +} +for($i=1;$i"; +}//end of for(..) +echo "
      "; + //unit input name + $unitName = "unit_".$i; + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$i]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + //show Unit Name + echo "$tlvArr[0] "; + echo ""; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      toAsc Error:bgnBit > 0 ||endBit < 7"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + } + break; + case 'keepAsc': + $inputValue = $byteValue; + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + switch($defArr[2]){ + case '0': + //$inputValue = str_replace('00','',$inputValue); + break; + case 'E': + //$inputValue = str_replace('E','',$inputValue); + break; + default: break; + } + break; + default: break; + } + + if($valueType == $nOctStr){ + if($DEBUG) echo "
      $valueType =$nOctStr= OctStr"; + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + $inputLen = $byteLen *2; + }else{ + $inputLen = $byteLen *3; + } + echo ""; + }elseif($valueType == $nAscStr){ + if($DEBUG) echo "
      $valueType == AscStr"; + //if($defArr[0] == 'keepAsc'){ + $inputLen = $byteLen; + //} + echo ""; + }else{ + if($DEBUG) echo "
      $valueType == Integer"; + echo ""; + echo ""; + echo ""; + echo ""; + } + break; + case 'select': + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + echo ""; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + if($valueType == $nOctStr){ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'keepDec-high-0'; + } + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + echo "\n "; + echo "
      "; +$remark=nl2br($remark); +echo "
      Remarks:
      $remark
      "; +$unitNum = $i-1; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "
      "; + +//=======================Test input field======================== +if($TEST){ + echo "
      "; + echo "
      "; + //--><--// $setValue = strrev($setValue); + echo "Test Area
      "; + echo "Test Value:   "; + echo ""; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "
      "; +} +?> + + diff --git a/wxc2_omc/account/pubSubsMng/paramEdit_bak.php b/wxc2_omc/account/pubSubsMng/paramEdit_bak.php new file mode 100755 index 0000000..e70f348 --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/paramEdit_bak.php @@ -0,0 +1,567 @@ + 0)?$TEST:0; + +//value Type +$nInteger = 2; +$nAscStr = 3; +$nOctStr = 4; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType,$dataTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.subsParamConf_'.$dataTypeNo; + return($tableName); +} +/* +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + echo "
      Error in omcStrFill:the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} +*/ +$sysConfTable = 'OMC_PUB.sysConf'; +$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:0); + +$pubDb ='OMC_PUB'; +$objDb = omcGetObjDb($sysTypeNo); +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf,$dataTypeNo); +$maxLevelNum = 10; + +if($DEBUG) echo "
      $paramConfTable
      "; + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + + + +//=======================Get value From submit=================== +if($set == 'Set'){ + + //sort by offset + for($i=1;$i<=$unitNum;$i++){ + $tmpDef = ${'unitDef_'.$i}; + $tmpValue = ${'unit_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef,unitNum=$unitNum"; + $defArr[$i] = $tmpDef; + $tmpDefArr=explode('-',$tmpDef); + $sortArr[$i] = $tmpDefArr[0]; + $valueArr[$i] = $tmpValue; + } + $lastValue = ''; + $k = 0; + asort($sortArr); + for(reset($sortArr); $key = key($sortArr); next($sortArr)){ + if($DEBUG) echo "
      sortArr[$key] = {$sortArr[$key]}"; + if($DEBUG) echo "
      unitValue = {$valueArr[$key]}"; + $unitValue = $valueArr[$key]; + if($DEBUG) echo "
      defArr[$key] = {$defArr[$key]}"; + $unitDefArr = explode('-',$defArr[$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1){ + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + }else{//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + }else{ + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAsc"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'keepAsc': + $byteValue = $unitValue; + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + } + if($DEBUG) echo "
      lastValue = $lastValue "; + $setValue = $lastValue; + if($TEST != 1){ + //set back to input field + echo ""; + }else{ + if($valueType != 'keepAsc' && $valueType != 'toAsc'){ + $setValue = strtoupper($setValue); + } + } +}//end of if($set == 1) + + +//=======================Show GUI ======================== +?> + + + +
      " > +setValue = $setValue ,inputName = $inputName"; + +if($keyId > 0){ + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE keyId = '$keyId'"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; +}else{ + echo "ERROR!!:keyId == NULL"; + exit(); +} +/************************************** +*objName +*[unit]name[u]xx.xx-yy.yy[u]input[v]toDec-fillHigh-fillChar +*[unit]name[u]xx.xx-yy.yy[u]select[v]value1[opt]desc1[v]value2[opt]desc2 +*[remark] +***************************************/ + +//explode by '[remark]' +$remarkArr = explode('[remark]',$setTemplate); +$remark = $remarkArr[1]; + +//explode by '[unit]' +$unitArr = explode('[unit]',$remarkArr[0]); + +//show instance's name +echo "{$unitArr[0]}
      "; +if($DEBUG) echo "
      $unitArr[1]"; +//show every one unit +//--><-//$setValue = strrev($setValue); +if($DEBUG){ + echo ""; +}else{ + echo "
      "; +} +for($i=1;$i"; +}//end of for(..) +echo "
      "; + //unit input name + $unitName = "unit_".$i; + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$i]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + //show Unit Name + echo "$tlvArr[0] "; + echo ""; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAsc': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      toAsc Error:bgnBit > 0 ||endBit < 7"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + } + break; + case 'keepAsc': + $inputValue = $byteValue; + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + switch($defArr[2]){ + case '0': + $inputValue = str_replace('00','',$inputValue); + break; + case 'E': + $inputValue = str_replace('E','',$inputValue); + break; + default: break; + } + break; + default: break; + } + + if($valueType == $nOctStr){ + if($DEBUG) echo "
      $valueType =$nOctStr= OctStr"; + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + $inputLen = $byteLen *2; + }else{ + $inputLen = $byteLen *3; + } + echo ""; + }elseif($valueType == $nAscStr){ + if($DEBUG) echo "
      $valueType == AscStr"; + //if($defArr[0] == 'keepAsc'){ + $inputLen = $byteLen; + //} + echo ""; + }else{ + if($DEBUG) echo "
      $valueType == Integer"; + echo ""; + echo ""; + echo ""; + echo ""; + } + break; + case 'select': + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + echo ""; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + if($valueType == $nOctStr){ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'keepDec-high-0'; + } + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + echo "\n "; + echo "
      "; +$remark=nl2br($remark); +echo "
      Remarks:
      $remark
      "; +$unitNum = $i-1; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "\n"; +echo "\n"; +echo "
      "; + +//=======================Test input field======================== +if($TEST){ + echo "
      "; + echo "
      "; + //--><--// $setValue = strrev($setValue); + echo "Test Area
      "; + echo "Test Value:   "; + echo ""; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "
      "; +} +?> + + diff --git a/wxc2_omc/account/pubSubsMng/sendComm.inc b/wxc2_omc/account/pubSubsMng/sendComm.inc new file mode 100755 index 0000000..4cccb3b --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/sendComm.inc @@ -0,0 +1,101 @@ +delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $overTime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-30,date("s"),date("m"),date("d"),date("Y"))); + $delSql = "DELETE FROM $commTable WHERE sendTime < '$overTime'"; + if($DEBUG) echo"
      delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + /* + //step 2: check the system's ip + $chkIpSql = "SELECT ip FROM $ipTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + if($DEBUG) echo"
      chkIpSql = $chkIpSql"; + $chkIpResult = mysqli_query($pubConn,$chkIpSql); + echo mysqli_error($pubConn); + $rowsNum = @mysqli_num_rows($chkIpResult); + if($rowsNum > 0){ + echo ""; + return(-1); + } + */ + + //step 3: check the command(锟斤拷锟斤拷同时锟斤拷锟斤拷系统锟斤拷锟酵o拷锟斤拷锟斤拷锟斤拷锟酵憋拷牛锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷同锟侥诧拷锟斤拷) + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND indexValueList='$indexValueList' + "; + if($DEBUG) echo"
      check command sql = $chkSql"; + $chkResult = mysqli_query($pubConn,$chkSql); + echo mysqli_error($pubConn); + $rowsNum = @mysqli_num_rows($chkResult); + if($rowsNum <= 0){ + + //step 4:insert commands into command table + if($commType == $nReplaceIndexComm){ + $sendSql="INSERT INTO $commTable + (commType,dataTypeNo,sysTypeNo,sysNo,subSysNo,indexValueList, fieldNameList,paramType,commState,sendTime,remark) + VALUES + ('$commType','$dataTypeNo','$sysTypeNo','$sysNo','$subSysNo','$indexValueList', + '$fieldNameList','0','1',CURRENT_TIMESTAMP,'$newIndexValue') + "; + }else{ + $sendSql="INSERT INTO $commTable + (commType,dataTypeNo,sysTypeNo,sysNo,subSysNo,indexValueList,fieldNameList,paramType,commState,sendTime) + VALUES + ('$commType','$dataTypeNo','$sysTypeNo','$sysNo','$subSysNo','$indexValueList', + '$fieldNameList','0','1',CURRENT_TIMESTAMP) + "; + + } + if($DEBUG)echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + + //step 5:Return commIdStr + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + AND indexValueList='$indexValueList' + "; + if($DEBUG) + echo"
      get command id sql = $selSql"; + $selResult=mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $commIdStr=''; + while($selRows = mysqli_fetch_array($selResult)){ + $commIdStr .= $selRows[commId].'-'; + } + if($DEBUG)echo "
      commIdStr = $commIdStr"; + if($DEBUG) exit(); + return($commIdStr); +}//end of function sendComm() +?> diff --git a/wxc2_omc/account/pubSubsMng/subscriberConf.php b/wxc2_omc/account/pubSubsMng/subscriberConf.php new file mode 100755 index 0000000..48b5e82 --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/subscriberConf.php @@ -0,0 +1,609 @@ + + + + +"; +$DEBUG = 0; +global $pubConn; + +if($DEBUG) echo "
      正在调试中,给您的工作带来不便,请原谅!!:)"; + +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; +$nReplaceIndexComm = 6; + +$maxLevelNum = 10; + +$nInteger = 2; +$nAscStr = 3; +$nHexStr = 4; +$dataTypeNo = $_REQUEST['dataTypeNo']; + +//------------选择语言版本---------- +if($language == 'eng'){ + $objNameField = 'name_2'; + $objDescField = 'desc_2'; + $objNoteField = 'note_2'; +}else{ + $objNameField = 'name_1'; + $objDescField = 'desc_1'; + $objNoteField = 'note_1'; +} + +//========================================================== +//输入变量 +//========================================================== +$canSetNum = $_REQUEST['canSetNum']; +$keyValue=$_REQUEST['keyValue']; +$canSetNum = isset($canSetNum)?$canSetNum:'all'; + +$sysId=$_REQUEST['sysId']; +$dataTypeNo = $_REQUEST['dataTypeNo']; +$isLoadIndex=$_REQUEST['isLoadIndex']; +$isTryCreate=$_REQUEST['isTryCreate']; +$isBatchCreate = $_REQUEST['isBatchCreate']; +$isBatchDelete = $_REQUEST['isBatchDelete']; +$Delstartkey = $_REQUEST['Delstartkey']; +$batchDelNum = $_REQUEST['batchDelNum']; +$batchDelete = $_REQUEST['batchDelete']; +$batchNum=$_REQUEST['batchNum']; +$isCreate=$_REQUEST['isCreate']; +$isDelete=$_REQUEST['isDelete']; +$isChange=$_REQUEST['isChange']; +$isRead=$_REQUEST['isRead']; +$sysIdArr=explode('_',$sysId); +$sysTypeNo=$sysIdArr[0]; +$sysNo=$sysIdArr[1]; + +$objConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], 'OBJ_'.$sysTypeNo); + + +//显示用户数据编辑页面,需要的变量 +if($DEBUG) echo "
      sysId=$sysId"; +if($DEBUG) echo "
      canSetNum=$canSetNum"; +if($DEBUG) echo "
      keyValue=$keyValue"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +//例如: +//$canSetNum =1; // 或= 'all' +//$sysId='330_0_0'; +//$keyValue= '0460022157127016'; + +$isRead=$_REQUEST['isRead']; +$isChange=$_REQUEST['isChange']; +$isCreate=$_REQUEST['isCreate']; +$isDelete=$_REQUEST['isDelete']; +$isTryCreate=$_REQUEST['isTryCreate']; +$isLoadIndex=$_REQUEST['isLoadIndex']; + +//操作类型变量 +if($DEBUG) echo "
      isRead=$isRead"; +if($DEBUG) echo "
      isChange=$isChange"; +if($DEBUG) echo "
      isCreate=$isCreate"; +if($DEBUG) echo "
      isDelete=$isDelete"; +if($DEBUG) echo "
      isLoadIndex=$isLoadIndex"; + + +$bgnNo=$_REQUEST['bgnNo']; +$endNo=$_REQUEST['endNo']; +if (!isset($keyValue)) $keyValue=$_POST['keyValue']; + +//保存用户数据修改的数据 +if($DEBUG) echo "
      bgnNo=$bgnNo"; +if($DEBUG) echo "
      endNo=$endNo"; +//显示每个需要保存的字段 +for($i=$bgnNo;$i<$endNo;$i++){ + ${'checkBox_'.$i} = $_POST['checkBox_'.$i]; + ${'fieldName_'.$i} = $_POST['fieldName_'.$i]; + ${'editValue_'.$i} = $_POST['editValue_'.$i]; + if($DEBUG) echo "
      checkBox_$i = ${'checkBox_'.$i}"; + if($DEBUG) echo "
      fieldName_$i = ${'fieldName_'.$i}"; + if($DEBUG) echo "
      editValue_$i = ${'editValue_'.$i}"; + if($isCreate > 0){ + if($tmpFieldName == $indexFieldName){ + $indexValueList = $editValue; + if($DEBUG) echo "
      indexValueList($indexValueList) be change to $editValue"; + } + } +} +//if($DEBUG && $endNo > 1) exit(); + +//========================================================== +//数据处理 +//========================================================== +$fieldNameList = "ALL"; +require("./sendComm.inc"); +require("./dataProc.inc"); +//========================================================== +//输出并显示数据 +//========================================================== +?> + + + +
      " onSubmit="return checkSubmit() "> + + + + + + 0){ + ?> + + + + + + + + + + + + + + + +
      + + + + + 15){ + $showkeyValue= substr($keyValue,1,15); + }else{ + $showkeyValue= $keyValue; + } + echo "  $keyValueName:$showkeyValue"; + ?> +       + + " name="create" title="" class="button" onClick="javascript:document.update.isCreate.value=1;"> + + + +     + + + + + + + + + + )"> + + + )"> + +  
      +
      + + + + + + + + + + + '0' + ORDER BY level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 + "; + +if($DEBUG) echo"
      objDb =$objDb
      ParamSql = $paramSql
      "; +$paramResult = mysqli_query($objConn,$paramSql); +echo mysqli_error($objConn); +$i=0; +while($paramRows = @mysqli_fetch_array($paramResult)){ + $editName='editValue_'.$i; + $checkBoxName='checkBox_'.$i; + $fieldNameName = 'fieldName_'.$i; + $valueTypeName='valueType_'.$i; + $maxLen=$paramRows[length]*2; + $maxLenName='maxLen_'.$i; + if($paramRows[length] > 4){ + $inputSize = $paramRows[length] * 2; + }else{ + $inputSize = 8; + } + $fieldName =$paramRows[fieldName]; + echo "\n "; + echo " "; + echo ""; + echo " "; + echo ""; + echo ""; + $i++; +} +$bgnNo = 0; +$endNo = $i; +?> +
      No. + "; + }else{ + echo " "; + } + ?> + Value
      $i$paramRows[$objNameField]"; + echo ""; + echo ""; + if($inputSize > 32){ + $rows=ceil($inputSize / 32) + 1; + $cols=32; + echo ""; + }else{ + + echo ""; + } + + echo "set.."; + + echo ""; + echo ""; + echo ""; + echo "
      +"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +?> +
      +  + + + + diff --git a/wxc2_omc/account/pubSubsMng/subscriberListDown.php b/wxc2_omc/account/pubSubsMng/subscriberListDown.php new file mode 100755 index 0000000..81bdb83 --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/subscriberListDown.php @@ -0,0 +1,505 @@ + + + +"; +//if($DEBUG) echo "
      正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$dbName = 'OMC_PUB'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; +$numberPerPage = 100; //每页纪录数 + +$nReadComm = 1; +$nChangeComm = 2; +$nCreateComm = 3; +$nDeleteComm = 4; +$nLoadIndexComm = 5; + +//确定告警内容显示语言种类 +if($selectedLanguage=='chn'){ + $alarmDesc = alarmDesc_1; +}elseif($selectedLanguage=='eng'){ + $alarmDesc = alarmDesc_2; +} +//========================================================== +//输入变量 +//========================================================== +//列表所需基本变量 +//fj +$DEBUG=0; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; + +$dataTypeNo = $_REQUEST['dataTypeNo']; + +if (strstr($userName, "student")) +{ + $commType = $_REQUEST['commType']; + $keyValue = $_REQUEST['keyValue']; +} +if ($_REQUEST['sysTypeNo']) +{ + $sysTypeNo = $_REQUEST['sysTypeNo']; +} +if ($_REQUEST['sysId']) +{ + $sysId = $_REQUEST['sysId']; + if($DEBUG) echo "
      sysId=$sysId"; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; +// echo "sysTypeNo=$sysTypeNo,sysNo=$sysNo"; +} +$bgnNo = $_REQUEST['bgnNo']; + +//删除用户 +if($DEBUG) echo "
      commType =$commType"; + +//根据sysTypeNo,dataTypeNo获取数据表名,索引字段名 +if($sysTypeNo==390 || $sysTypeNo==365 || $sysTypeNo==366){ + if(!isset($sysNo)){ + if(!isset($sysId)) + $sysId='390_0_0'; + $sysIdArr=explode('_',$sysId); + $sysNo=$sysIdArr[1]; + } + $getConfSql="SELECT indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' + AND dataTypeNo='$dataTypeNo' + AND sysNo='$sysNo' + "; +}else{ + $getConfSql="SELECT indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' + AND dataTypeNo='$dataTypeNo' + "; +} +if($DEBUG) echo "
      getConfSql=$getConfSql"; +$getConfResult=mysqli_query($pubConn,$getConfSql); +echo mysqli_error($pubConn); +$getConfRows=mysqli_fetch_array($getConfResult); +$tableName =$getConfRows[subsDataTable]; +$keyFieldName =$getConfRows[indexFieldName]; + +if($DEBUG) echo "
      tableName=$tableName"; +if($DEBUG) echo "
      keyFieldName=$keyFieldName"; + +//排序所依赖的字段名 +if(!isset($orderByField)){ + $orderByField = $keyFieldName; +} +if($DEBUG) echo "
      orderByField=$orderByField"; + +//排序字符串 +$orderByStr = " $orderByField"; +if($DEBUG) echo "
      orderByStr=$orderByStr"; + +//========================================================== +//数据处理 +//========================================================== +//删除命令,且该命令被执行 +if($commType == $nDeleteComm ){ + $delSql="Delete FROM $tableName WHERE $keyFieldName='$keyValue'"; + if($DEBUG) echo "
      delSql=$delSql"; + $result=mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + if($result){ + echo "
      Delete $keyValue OK!"; + } +} +switch($sysTypeNo){ + case '375': + if(!isset($sysId)){ + $sysId='375_0_0'; + } + $sysTypeName='OPPS'; + $canSetNum='all'; + $selectFieldList = "msisdn,imsi,imei,oprFlag,class,userType"; + $showNameList="MSISDN,IMSI,IMEI,User Status,Class,User Type"; + break; + case '378': + if(!isset($sysId)){ + $sysId='378_0_0'; + } + $sysTypeName='iPALIM'; + $canSetNum='all'; + $selectFieldList = 'imsi,msisdn,msisdn_extern,tmsi,lai,type'; + $showNameList='IMSI,MSISDN Public,MSISDN Private,TMSI,MCC-MNC-LAC-CI,Type'; + break; + case '330': + if(!isset($sysId)){ + $sysId='330_0_0'; + } + $sysTypeName='HLR'; + $canSetNum='all'; + $selectFieldList = "imsi,inter_msisdn,used_flag,nam,camel_flag"; + $showNameList="IMSI,MSISDN,usedFlag,NetworkAccessMode,CamelFlag"; + break; + case '361': + if(!isset($sysId)){ + $sysId='361_0_0'; + } + $sysTypeName='MME'; + $canSetNum='all'; + $selectFieldList = "imsi,msisdn,mm_state,ecm_state,tai"; + $showNameList="IMSI,MSISDN,MMState,ECMState,TAI"; + break; + case '362': + if(!isset($sysId)){ + $sysId='362_0_0'; + } + $sysTypeName='SPGW'; + $canSetNum='all'; + $selectFieldList = "imsi,s11_local_teid,s11_remote_teid,ue_ps_state,ue_ims_state,ps_ip,ims_ip,granted_bytes,used_bytes,ccr_update_threshold"; + $showNameList="IMSI,s11LocalTEID,s11RemoteTEID,uePSState,ueIMSState,psIP,imsIP,grantedBytes,used_bytes,ccrUpdateThreshold"; + break; + case '363': + if(!isset($sysId)){ + $sysId='363_0_0'; + } + $sysTypeName='IMS'; + $canSetNum='all'; + $selectFieldList="msisdn,impu,barring,reg_state"; + $showNameList="MSISDN,IMPU,Barring,regState"; + break; + case '364': + if(!isset($sysId)){ + $sysId='364_0_0'; + } + $sysTypeName='RCS'; + $canSetNum='all'; + $selectFieldList = "imsi,tmsi,ptmsi,context_id,hnb_index,active_time"; + $showNameList="IMSI,TMSI,P-TMSI,CONTEXT-ID,HNB-Index,ACTIVE-Time"; + break; + case '365': + if(!isset($sysId)){ + $sysId='365_0_0'; + } + $sysTypeName='UDM'; + $canSetNum='all'; + //$selectFieldList = "supi,gpsis,internal_group_ids,subscribed_ue_ambr_temp,subscribed_snssais_temp,ue_usage_type"; + //$showNameList="SUPI,GPSIS,INTERNAL-GROUP-IDS,SUBSCRIBED-UE-AMBR-TEMP,SUBSCRIBED-SNSSAIS-TEMP,UE-USAGE-TYPE"; + $selectFieldList = "supi,gpsis,internal_group_ids,subscribed_ue_ambr_temp,subscribed_snssais_temp,ue_usage_type,rat_restriction,forbidden_areas_templ,service_area_restriction_templ,core_network_type_restriction,rfsp_index,periodic_registration_timer,mps_priority,mcs_priority,odb_packet_services,mico_mode,active_time,download_packet_count,subscribed_slice_selection_data_temp,subscribed_smf_selection_data_temp,subscribed_data,purge_flag,pei,ims_vops,guami,pdu_session_ids,single_nssais_str,dnns"; + $showNameList="SUPI,GPSIS,INTERNAL-GROUP-IDS,SUBSCRIBED-UE-AMBR-TEMP,SUBSCRIBED-SNSSAIS-TEMP,UE-USAGE-TYPE,RAT-RESTRICTION,FORBIDDEN-AREAS-TEMPL,SERVICE-AREA-ERSTRICTION-TEMPL,CORE-NETWORK-TYPE-RESTRICTION,RFSP-INDEX,PERIODIC-REGISTRATION-TIMER,MPS-PRIORITY,MCS-PRIORITY,ODB-PACKET-SERVICES,MICO-MODE,ACTIVE-TIME,DOWNLOADED-PACKET-COUNT,SUBSCRIBED-SLIC-SELECTION-DATA-TEMP,SUBCRIBED-SMF-SELECTION-DATA-TEMP,SUBCRIBED-DATA,PURGE-FLAG,PEI,IMS-VOPS,GUAMI,PDU-SESSION-IDS,SINGLE-NSAIS-STR,DNNS"; + break; + case '325': + if(!isset($sysId)){ + $sysId='325_0_0'; + } + $sysTypeName='VLR'; + $canSetNum='all'; + $selectFieldList = "IMSI,MSISDN,TMSI,LMSI"; + $showNameList = "IMSI,MSISDN,TMSI,LMSI"; + break; + case '360': + if($dataTypeNo == 0){ + $sysTypeName='PPS'; + $canSetNum='all'; + $selectFieldList = "msisdn,status,balance,mo_expiration_date,mt_expiration_date,cug_id,access_date"; + $showNameList= "MSISDN,Status,Balance,Expiration(MO),Expiration(MT),CUG,Active since"; +// $selectFieldList = "msisdn,overdraft,status,balance,expiration_date,first_used_date,user_type"; +// $showNameList= "MSISDN,Overdraft,Status,Balance,Expiration Date,First used Date,User Type"; + }else{ + $sysTypeName='Prepaid Card'; + $canSetNum='all'; + $selectFieldList ="card_no,card_hrn,face_value,card_status,expiry_date,valid_time,updated_date"; + $showNameList="Card No,Card_hrn,Face Value,Status,Expiry Date,Valid Time,Updated Date"; + } + if(!isset($sysId)){ + $sysId='360_0_0'; + } + break; + case '395': + $sysTypeName='Recharge Card'; + $canSetNum='all'; + $selectFieldList ="card_no,card_hrn,face_value,card_status,expiry_date,valid_time,updated_date"; + $showNameList="Card No,Card_hrn,Face Value,Status,Expiry Date,Valid Time,Updated Date"; + + if(!isset($sysId)){ + $sysId='395_0_0'; + } + break; + case '340': + if(!isset($sysId)){ + $sysId='340_0_0'; + } + $sysTypeName='AUC'; + $canSetNum='all'; + $selectFieldList = "key_imsi,a3a8_version,status"; + $showNameList = "IMSI,A3A8 version,status"; + break; + case '380': + if(!isset($sysId)){ + $sysId='380_0_0'; + } + $sysTypeName='EIR'; + $canSetNum='all'; + $selectFieldList = "imei,status"; + $showNameList= "IMEI,Status"; + break; + case '390': + if(!isset($sysId)){ + $sysId='390_0_0'; + } + $sysTypeName='VMS'; + $canSetNum='all'; + $selectFieldList = "msisdn,mailboxID,status,promo_language,greeting,optionFlag,pwdValue,acbTimeOut"; + $showNameList= "MSISDN,Mailbox No(Hex),Status,Language,Greeting,Option flag,Password,Acb timeout"; + break; + case '253': + if(!isset($sysId)){ + $sysId='253_0_0'; + } + $sysTypeName='SN-HLR'; + $canSetNum='all'; + $selectFieldList = "imsi,msisdn,used_flag,lac"; + $showNameList= "imsi,msisdn,used_flag,lac"; + break; + case '370': + if(!isset($sysId)){ + $sysId='370_0_0'; + } + $sysTypeName='MNP'; + $canSetNum='all'; + $selectFieldList = "msisdn,routing_number,status,donor,recipient,Date"; + $showNameList = "MSISDN,RN,status,Donor,Recipient,Date"; + break; + break; + default: + echo "Uknown sysTypeNo: $sysTypeNo"; + exit(1); +} +$showFieldArr=explode(',',$selectFieldList); +$showNameArr=explode(',',$showNameList); + +//根据上部页面传来的变量,生成查询条件 +$selKeyFieldName = $_REQUEST['selKeyFieldName']; +$selKeyValue = $_REQUEST['selKeyValue']; +if(strlen($selKeyFieldName) > 0 && strlen($selKeyValue) > 0){ + $whereStr = "WHERE $selKeyFieldName like '%$selKeyValue%'"; +} + +//查询基本条件 +if(strlen($whereStr) > 10){ + $bascWhereStr =""; +}else{ + $bascWhereStr =""; +} +$numberOfRecords = $_REQUEST['numberOfRecords']; +//首次查询,查出符合条件的纪录条数,并在以后的页面跳转中传递。 +if(!$numberOfRecords){ + $bgnNo=0; + $countSql="SELECT count(*) as totalNum + FROM $tableName + $whereStr + $bascWhereStr + "; + if($DEBUG) echo "
      countSql=$countSql"; + $result=mysqli_query($pubConn,$countSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + $numberOfRecords = $record[0]; + if($DEBUG) echo "
      numberOfRecords=$numberOfRecords"; + + if($numberOfRecords > 0){ + //插入日志 + insertLog("search $sysTypeName subscriber: $selKeyValue "); + }else{ + //插入日志 + insertLog("search $sysTypeName subscriber: $selKeyValue not found"); + echo "
      No Found"; + exit(); + } +} + +//找到需要显示的纪录 +if($numberOfRecords > 0){ + $showSql=" SELECT $selectFieldList + FROM $tableName + $whereStr + $bascWhereStr + ORDER BY $orderByStr + LIMIT $bgnNo, $numberPerPage + "; + if($DEBUG) echo "
      showSql=$showSql"; + $result=@mysqli_query($pubConn,$showSql); + echo mysqli_error($pubConn); + $rows=@mysqli_fetch_array($result); + + //下面是控制分页显示需要传递的变量传递变量 + if ($numberOfRecords >= 1) { + $nextBgnNo = $bgnNo + $numberPerPage; //本页的结束数目 + if ($nextBgnNo > $numberOfRecords){ + $nextBgnNo = $numberOfRecords; + } + $t1 = $bgnNo + 1; + $prevBgnNo = $bgnNo - $numberPerPage; + if ($prevBgnNo < 0) { + $prevBgnNo = 0; + } + $basePageLink ="sysTypeNo=$sysTypeNo&sysId=$sysId&dataTypeNo=$dataTypeNo&numberOfRecords=$numberOfRecords"; + $basePageLink .="&selKeyFieldName=$selKeyFieldName&selKeyValue=$selKeyValue"; + $prePageLink ="bgnNo=$prevBgnNo"; + $nextPageLink ="bgnNo=$nextBgnNo"; + } + $showBgnNo=$bgnNo+1; +} + +//========================================================== +//输出并显示数据 +//========================================================== +?> + + + + +
      + + + + + +
      + $showBgnNo - $nextBgnNo, "; + echo "($strTotal:$numberOfRecords)"; +?> + +  +"; + echo "$strPreviousPage   "; + }else{ + echo "      "; + } + + // NEW: Display a link for the next set of records. + if ($nextBgnNo != $numberOfRecords && $numberOfRecords >0) { + echo ""; + echo "$strNextPage "; + }else{ + echo "    "; + } + + //根据纪录条数,算出页码数,本页页码 + if($numberOfRecords > 0){ + $totalPageNum = ceil($numberOfRecords / $numberPerPage ); + $pageNo = $bgnNo / $numberPerPage + 1; + }*/ +?> + +"; + echo "$strPrevious $strPreviousPage "; + }else{ + echo "$strPrevious $strPreviousPage "; + } + + //根据纪录条数,算出页码数,本页页码 + if($numberOfRecords > 0){ + $totalPageNum = ceil($numberOfRecords / $numberPerPage ); + $pageNo = $bgnNo / $numberPerPage + 1; + } + + echo ""; + + // NEW: Display a link for the next set of records. + if ($nextBgnNo != $numberOfRecords && $numberOfRecords >0) { + echo ""; + echo "$strNextPage $strNext"; + }else{ + echo "$strNextPage $strNext"; + } +?> +
      + + + "; + echo ""; + echo "$showNameArr[$i]"; + echo ""; + } + ?> + + +"; + for($i=0;$i"; + if ($i == "0"){ + echo " $rows[$i]"; + }else{ + echo " $rows[$i]"; + } + echo ""; + } + /* echo "";*/ + echo ""; + }while($rows=mysqli_fetch_array($result)); + +?> +
      "; + echo "edit"; + echo "
      +
      +  + + + diff --git a/wxc2_omc/account/pubSubsMng/subscriberListIndex.php b/wxc2_omc/account/pubSubsMng/subscriberListIndex.php new file mode 100755 index 0000000..01cf3a9 --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/subscriberListIndex.php @@ -0,0 +1,23 @@ + + + + "; + echo ""; + ?> + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/account/pubSubsMng/subscriberListUp.php b/wxc2_omc/account/pubSubsMng/subscriberListUp.php new file mode 100755 index 0000000..deaa043 --- /dev/null +++ b/wxc2_omc/account/pubSubsMng/subscriberListUp.php @@ -0,0 +1,405 @@ + + + + + + +
      +"; + echo "
      "; + $pagetitle="Advanced > Subscriber "; + switch($sysTypeNo){ + case '375': + $pagetitle.="> OPPS"; + $helpId = "2.2.1.8"; + break; + + case '330': + $pagetitle.="> HLR"; + $helpId = "2.2.1.2"; + break; + case '361': + $pagetitle.="> MME"; + $helpId = "2.2.1.2"; // ?? + break; + case '362': + $pagetitle.="> SPGW"; + $helpId = "2.2.1.2"; + break; + case '363': + $pagetitle.="> IMS"; + $helpId = "2.2.1.2"; + break; + case '364': + $pagetitle.="> RCS"; + $helpId = "2.2.1.2"; + break; + case '365': + $pagetitle.="> UDM"; + $helpId = "2.2.1.2"; + break; + case '366': + $pagetitle.="> AUSF"; + $helpId = "2.2.1.2"; + break; + case '325': + $pagetitle.="> VLR"; + $helpId = "2.2.1.1"; + break; + case '360': + if($dataTypeNo == 0){ + $pagetitle.="> PPS"; + $helpId = "2.2.1.3"; + }else{ + $pagetitle="Advanced > Recharge Card > Fresh Card"; + $helpId = "2.2.2"; + } + break; + case '395': + $pagetitle="Advanced > Recharge Card > Fresh Card"; + $helpId = "2.2.2"; + break; + case '340': + $pagetitle.="> AUC"; + $helpId = "2.2.1.4"; + break; + case '380': + $pagetitle.="> EIR"; + $helpId = "2.2.1.5"; + break; + case '390': + $pagetitle.="> VSS"; + $helpId = "2.2.1.6"; + break; + case '253': + $helpId = "2.2.1.7"; + break; + case '370': + $pagetitle.="> MNP"; + $helpId = "2.2.1.7"; + break; + case '378': + $pagetitle.="> iPALIM"; + $helpId = "2.2.1.9"; + break; + default: + echo "Unknown sysTypeNo:$sysTypeNo"; + exit(1); + } + + echo "$pagetitle"; + echo ""; + showHelp($helpId); + echo "
      "; +?> + + + + + + + + + "; + echo "
      "; + echo "$strAdd"; + echo "  
      "; + } + echo ""; + } + ?> + + +
      + + "; + + echo ""; + + break; + case '330': + $sysTypeName='HLR'; + echo ""; + break; + case '361': + $sysTypeName='MME'; + echo ""; + break; + case '362': + $sysTypeName='SPGW'; + echo ""; + break; + case '363': + $sysTypeName='IMS'; + echo ""; + break; + case '364': + $sysTypeName='RCS'; + echo ""; + break; + case '365': + $sysTypeName='UDM'; + echo ""; + break; + case '366': + $sysTypeName='AUSF'; + echo ""; + break; + case '378': + $sysTypeName='iPALIM'; + echo "IMSI"; + echo ""; + break; + case '325': + $sysTypeName='VLR'; + echo ""; + break; + case '360': + $sysTypeName='PPS'; + if($dataTypeNo == 0){ + echo "MSISDN"; + echo ""; + }else{ + echo "Card no."; + echo ""; + } + break; + case '395': + $sysTypeName='RCM'; + echo "Card no."; + echo ""; + break; + case '340': + $sysTypeName='AUC'; + echo "IMSI"; + echo ""; + break; + case '380': + $sysTypeName='EIR'; + echo "IMEI"; + echo ""; + break; + case '390': + $sysTypeName=$strVMSOrVSS; + echo "MSISDN"; + echo ""; + break; + case '253': + $sysTypeName='SN'; + echo " "; + break; + case '370': + $sysTypeName='MNP'; + echo "MSISDN"; + echo ""; + break; + default: + echo "Uknown sysTypeNo:$sysTypeNo"; + exit(1); + } + ?> +    + + + +
      +   +
      +
      +
      +   + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + else if($sysTypeNo == 365 || $sysTypeNo == 366) + { + echo "Select System:"; + echo ""; + } + else + { + echo "Select System:"; + echo ""; + } +?> + + + +   + +
      + + + +
      +
      "; + echo "
      "; + echo "$strImport"; + echo "
      +"; +echo ""; +?> + + + + diff --git a/wxc2_omc/account/replaceMSISDN/replace_down.php b/wxc2_omc/account/replaceMSISDN/replace_down.php new file mode 100755 index 0000000..0254989 --- /dev/null +++ b/wxc2_omc/account/replaceMSISDN/replace_down.php @@ -0,0 +1,577 @@ + + + + + +"; + echo "replacingMSISDN=$replacingMSISDN
      "; + echo "page_num=$page_num,order_field=$order_field
      "; + } + + //check the status + $check_server_systype=array(330,360,375); + $check_server_name=array("HLR","PPS","OPPS"); + + for($i=0;$i{$check_server_name[$i]} is not online
      "); + else + { + $rows=@mysqli_fetch_array($res); + $sysNo=$rows[sysNo]+0; + $server_sysId[$i]="{$check_server_systype[$i]}_{$sysNo}_0"; + //echo "server_sysId[$i]={$server_sysId[$i]}
      "; + } + } + + //get HLR IMSI by replaced msisdn + $replacedMSISDN91=omc_keep_length("91".$replacedMSISDN,'E',18,0); + $replacingMSISDN91=omc_keep_length("91".$replacingMSISDN,'E',18,0); + $sql="select imsi from HLR_DB.subscriberData where inter_msisdn = '{$replacedMSISDN91}' "; + //echo "$sql
      "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + { + echo "Can not find HLR subscriber by MSISDN={$replacedMSISDN}
      "; + exit(); + } + $rows=@mysqli_fetch_array($res); + $HLR_IMSI=$rows[imsi]; + $HLR_replaced_IMSI=substr($HLR_IMSI,1); + + + //read HLR subscriber by IMSI + printInfo("Read HLR subscriber IMSI=$HLR_IMSI, MSISDN=$replacedMSISDN","blue"); + clearCommTable(); + $commId=subsCommSend($server_sysId[0],0,$HLR_IMSI,"ALL",1,0); + checkComm($commId); + + //read PPS subscriber by MSISDN + printInfo("Read PPS subscriber MSISDN=$replacedMSISDN","blue"); + clearCommTable(); + $commId=subsCommSend($server_sysId[1],0,$replacedMSISDN,"ALL",1,0); + checkComm($commId); + + //save the PPS subscriber data + $sql="desc PPS_DB.user_info "; + $res=@mysqli_query($pubConn,$sql); + $pps_field_num=mysqli_num_rows($res); + if($pps_field_num <= 0) + printInfo("PPS_DB.user_info table is null
      "); + $i=0; + while($rows=@mysqli_fetch_array($res)) + { + $pps_field_name[$i]=$rows[Field]; + if(stristr($rows[Type],"int")) + $pps_field_type[$i]="int"; + else + $pps_field_type[$i]="char"; + $i++; + } + + $sql="select * from PPS_DB.user_info where msisdn='{$replacedMSISDN}' "; + $res=@mysqli_query($pubConn,$sql); + + $rows=@mysqli_fetch_array($res); + $i=0; + while($i<$pps_field_num) + { + if(trim($rows[$i]) == "") + $pps_field_value[$i]=""; + else + $pps_field_value[$i]=$rows[$i]; + $i++; + } + + //read OPPS subscriber by MSISDN + printInfo("Read OPPS subscriber MSISDN=$replacedMSISDN","blue"); + clearCommTable(); + $commId=subsCommSend($server_sysId[2],0,$replacedMSISDN,"ALL",1,0); + checkComm($commId); + + + + //Modify the HLR MSISDN + printInfo("Modify HLR subscriber MSISDN from $replacedMSISDN to $replacingMSISDN","blue"); + $sql="update OBJ_330.tmpSubsData_0 set inter_msisdn='{$replacingMSISDN91}' where imsi='{$HLR_IMSI}' "; + $res=@mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); + //echo "$sql
      "; + + clearCommTable(); + $commId=subsCommSend($server_sysId[0],0,$HLR_IMSI,"inter_msisdn",2,0); + checkComm($commId); + + //read the new HLR subscriber + printInfo("Read HLR subscriber IMSI=$HLR_IMSI, MSISDN=$replacingMSISDN","blue"); + clearCommTable(); + $commId=subsCommSend($server_sysId[0],0,$HLR_IMSI,"ALL",1,0); + checkComm($commId); + + //get the replaced OPPS subscriber data + $sql="select * from OBJ_375.tmpSubsData_0 where msisdn='{$replacedMSISDN}' "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num < 1) + { + printInfo("Can not find OPPS subscriber msisdn=$replacedMSISDN","red"); + exit(); + } + $rows=@mysqli_fetch_array($res); + $replaced_opps_userType=$rows[userType]+0; + + //modify the replaced OPPS subscriber + printInfo("Modify OPPS subscriber MSISDN=$replacedMSISDN 's User Type from OPR-1 to OPR-0","blue"); + //,imsi='$HLR_replacing_IMSI' + $sql="update OBJ_375.tmpSubsData_0 set oprFlag='0',imsi=' ' where msisdn='{$replacedMSISDN}' "; + $res=@mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); + //echo "$sql
      "; + + clearCommTable(); + $commId=subsCommSend($server_sysId[2],0,$replacedMSISDN,"oprFlag,imsi",2,0); + checkComm($commId); + + //read the replaced OPPS subscriber + printInfo("Read OPPS subscriber MSISDN=$replacedMSISDN","blue"); + clearCommTable(); + $commId=subsCommSend($server_sysId[2],0,$replacedMSISDN,"ALL",1,0); + checkComm($commId); + + + //modify the replacing OPPS subscriber + printInfo("Modify OPPS subscriber MSISDN=$replacingMSISDN 's User Type from OPR-0 to OPR-1","blue"); + // + $sql="update OBJ_375.tmpSubsData_0 set oprFlag='1',imsi='$HLR_replaced_IMSI',userType='$replaced_opps_userType' where msisdn='{$replacingMSISDN}' "; + $res=@mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); + //echo "$sql
      "; + + clearCommTable(); + $commId=subsCommSend($server_sysId[2],0,$replacingMSISDN,"oprFlag,imsi,userType",2,0); + checkComm($commId); + + //read the replacing OPPS subscriber + printInfo("Read OPPS subscriber MSISDN=$replacingMSISDN","blue"); + clearCommTable(); + $commId=subsCommSend($server_sysId[2],0,$replacingMSISDN,"ALL",1,0); + checkComm($commId); + + //delete old PPS subscriber + printInfo("Delete PPS subscriber MSISDN=$replacedMSISDN","blue"); + clearCommTable(); + $commId=subsCommSend($server_sysId[1],0,$replacedMSISDN,"ALL",4,0); + checkComm($commId); + $sql="delete from OBJ_360.tmpSubsData_0 where msisdn='{$replacedMSISDN}' "; + $res=@mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); + $sql="delete from PPS_DB.user_info where msisdn='{$replacedMSISDN}' "; + $res=@mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); + + + //create new PPS subsriber + printInfo("Create PPS subsriber MSISDN=$replacingMSISDN","blue"); + //INSERT INTO omcPubVarConf (instance, pubVarName, pubVarValue, remark) VALUES ('24', '1', '1', '1') + $sql="insert into OBJ_360.tmpSubsData_0 ("; + $field_sql=" values("; + $pps_field_list=""; + + for($i=0;$i<$pps_field_num;$i++) + { + $sql.=$pps_field_name[$i]; + + if($pps_field_type[$i] == "int") + $field_sql.=$pps_field_value[$i]; + else + { + if($pps_field_name[$i] == "msisdn") + $field_sql.="'".$replacingMSISDN."'"; + else + $field_sql.="'".$pps_field_value[$i]."'"; + } + + if($i == $pps_field_num-1) + { + $field_sql.=")"; + $sql.=")"; + $pps_field_list.=$pps_field_name[$i]; + + } + else + { + $field_sql.=", "; + $sql.=", "; + $pps_field_list.=$pps_field_name[$i].","; + + } + } + $sql.=$field_sql; + $update_sql.=" where msisdn='{$replacingMSISDN}' "; + $res=@mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); + //echo "

      $sql

      "; + $sql=str_replace("OBJ_360.tmpSubsData_0","PPS_DB.user_info",$sql); + $res=@mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); + + //echo "

      $sql
      "; + //echo "

      $pps_field_list
      "; + + + + clearCommTable(); + $commId=subsCommSend($server_sysId[1],0,$replacingMSISDN,$pps_field_list,3,0); + checkComm($commId); + + clearCommTable(); + $commId=subsCommSend($server_sysId[0],0,$HLR_IMSI,"ALL",1,0); + checkComm($commId); + + + echo "\n\n"; +} + +$maxRecordPerPage=20; + +if(!isset($classValue)) + $classValue=0; +$classValue=$classValue-1; +//All +if($classValue == -1) + $classWhere=" "; +//Ordinary +else + $classWhere=" and class=$classValue "; + +$sql="select * from OPR_DB.subscriberData where msisdn is not null $classWhere "; +$res=@mysqli_query($pubConn,$sql); +$record_total_num=mysqli_num_rows($res); +$page_num_total=ceil($record_total_num/$maxRecordPerPage); +//echo "record_total_num=$record_total_num
      "; + +$select_fields=array("msisdn","oprFlag","class"); +$show_fields=array("MSISDN","User Type","Class"); + +$oprClassLabel=array(0=>"Ordinary",1=>"Premier",2=>"VIP"); + +$select_fields_flip=array_flip($select_fields); +$oprFlagFiledPos=$select_fields_flip['oprFlag']; + +$limit_from=$page_num*$maxRecordPerPage; + + +$sql="select * from OPR_DB.subscriberData where msisdn is not null $classWhere order by $order_field LIMIT $limit_from,$maxRecordPerPage "; +$res=@mysqli_query($pubConn,$sql); +$record_num=0; +$field_num=sizeof($select_fields); +while($rows=@mysqli_fetch_array($res)) +{ + for($i=0;$i<$field_num;$i++) + { + $records[$record_num][$i]=$rows[$select_fields[$i]]; + } + $record_num++; +} +echo mysqli_error($pubConn); + +if($record_num == 0) + exit("No record found!
      "); + +echo "

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +if((($page_num+1)*$maxRecordPerPage) > $record_total_num) + $tmp=$record_total_num; +else + $tmp=($page_num+1)*$maxRecordPerPage; +echo "Record ".($page_num*$maxRecordPerPage+1)." - ".($tmp)."(Total:$record_total_num)"; +echo ""; + if($page_num > 0) + echo ""; + echo "PreviousPrevious"; + if($page_num > 0) + echo ""; + echo ""; + if($page_num < ($page_num_total-1)) + echo ""; + echo "NextNext"; + if($page_num < ($page_num_total-1)) + echo ""; +echo "
      "; + + + +echo ""; +echo ""; +for($i=0;$i<$field_num;$i++) + echo ""; +echo ""; + + + +for($i=0;$i<$record_num;$i++) +{ + echo ""; + for($j=0;$j<$field_num;$j++) + { + if($select_fields[$j] == "msisdn") + { + echo ""; + } + else if($select_fields[$j] == "oprFlag") + { + echo ""; + } + else if($select_fields[$j] == "class") + { + + echo ""; + } + else + { + echo ""; + } + } + echo ""; +} + +echo "
      {$show_fields[$i]}
      "; + if($records[$i][$oprFlagFiledPos] == 0) + echo "{$records[$i][$j]}"; + else + echo "{$records[$i][$j]}"; + echo ""; + if($records[$i][$j] == 0) + echo "Idle"; + else + echo "In Use"; + echo ""; + $showValue=$oprClassLabel[$records[$i][$j]]; + echo "$showValue"; + echo "{$records[$i][$j]}
      "; + + +echo ""; +echo "
      "; + +function checkComm($commId) +{ + $sep=explode("-",$commId); + for($i=0;$i"; + //echo "commId={$sep[$i]},remark=$remark
      "; + if(stristr($remark,"process finished")) + printInfo("...successful
      ","blue"); + else + { + printInfo("...fail
      ","red"); + exit(); + } + } +} + +function clearCommTable() +{ + $sql="delete from OMC_PUB.subscriberComm "; + $res=@mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); +} + +function printInfo($info,$color) +{ + echo "$info"; +} + +function subsCommSend($sysId,$dataTypeNo,$indexValueList,$fieldNameList,$commType,$newIndexValue=0){ + //global $pubDb,$commTable; + $DEBUG = 0; + $pubDb = 'OMC_PUB'; + $commTable = 'subscriberComm'; + $ipTable = 'sysInfo'; + + $nReadComm = 1; + $nChangeComm = 2; + $nCreateComm = 3; + $nDeleteComm = 4; + $nLoadIndexComm = 5; + $nReplaceIndexComm=6; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $comm="echo 'subsCommSend(<$sysId>,<$dataTypeNo>,<$indexValueList>,<$fieldNameList>,<$commType>,<0>)' >> /tmp/subCommand.txt"; + system($comm); + + //step 1: delete overtime and imcompetent command + $overTime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-1,date("s"),date("m"),date("d"),date("Y"))); + $delSql = "DELETE FROM $commTable WHERE (commState ='0' OR commState ='3') AND sendTime < '$overTime'"; + if($DEBUG) echo"
      delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $overTime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-30,date("s"),date("m"),date("d"),date("Y"))); + $delSql = "DELETE FROM $commTable WHERE sendTime < '$overTime'"; + if($DEBUG) echo"
      delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + /* + //step 2: check the system's ip + $chkIpSql = "SELECT ip FROM $ipTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + if($DEBUG) echo"
      chkIpSql = $chkIpSql"; + $chkIpResult = mysqli_query($pubConn,$chkIpSql); + echo mysqli_error($pubConn); + $rowsNum = @mysqli_num_rows($chkIpResult); + if($rowsNum > 0){ + echo ""; + return(-1); + } + */ + + //step 3: check the command(............................) + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND indexValueList='$indexValueList' + "; + if($DEBUG) echo"
      check command sql = $chkSql"; + $chkResult = mysqli_query($pubConn,$chkSql); + echo mysqli_error($pubConn); + $rowsNum = @mysqli_num_rows($chkResult); + if($rowsNum <= 0){ + + //step 4:insert commands into command table + if($commType == $nReplaceIndexComm){ + $sendSql="INSERT INTO $commTable + (commType,dataTypeNo,sysTypeNo,sysNo,subSysNo,indexValueList, fieldNameList,paramType,commState,sendTime,remark) + VALUES + ('$commType','$dataTypeNo','$sysTypeNo','$sysNo','$subSysNo','$indexValueList', + '$fieldNameList','0','1',CURRENT_TIMESTAMP,'$newIndexValue') + "; + }else{ + $sendSql="INSERT INTO $commTable + (commType,dataTypeNo,sysTypeNo,sysNo,subSysNo,indexValueList,fieldNameList,paramType,commState,sendTime) + VALUES + ('$commType','$dataTypeNo','$sysTypeNo','$sysNo','$subSysNo','$indexValueList', + '$fieldNameList','0','1',CURRENT_TIMESTAMP) + "; + + } + if($DEBUG)echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + //echo mysqli_error($pubConn); + } + + //step 5:Return commIdStr + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + AND indexValueList='$indexValueList' + "; + if($DEBUG) + echo"
      get command id sql = $selSql"; + $selResult=mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $commIdStr=''; + while($selRows = mysqli_fetch_array($selResult)){ + $commIdStr .= $selRows[commId].'-'; + } + if($DEBUG)echo "
      commIdStr = $commIdStr"; + if($DEBUG) exit(); + return($commIdStr); +}//end of function sendComm() +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/account/replaceMSISDN/replace_index.php b/wxc2_omc/account/replaceMSISDN/replace_index.php new file mode 100755 index 0000000..88d93bc --- /dev/null +++ b/wxc2_omc/account/replaceMSISDN/replace_index.php @@ -0,0 +1,6 @@ +"; + echo ""; + echo ""; + echo ""; +?> diff --git a/wxc2_omc/account/replaceMSISDN/replace_up.php b/wxc2_omc/account/replaceMSISDN/replace_up.php new file mode 100755 index 0000000..9dca92c --- /dev/null +++ b/wxc2_omc/account/replaceMSISDN/replace_up.php @@ -0,0 +1,98 @@ + + + + +"; + +adjust_head_frame("up"); +adjust_title_head_frame("up"); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Configuration > Database > Subscriber > Replace MSISDN"; + echo ""; + $helpId = "2.2.1.10"; + showHelp($helpId); + echo "
      "; + + echo "Replace MSISDN "; + + + echo ""; + echo " with "; + echo ""; + echo "        "; + if($canwrite_flag) + echo ""; + else + echo ""; + echo "        "; + $classLabel=array(0=>"All",1=>"Ordinary",2=>"Premium",3=>"VIP"); + echo "Class "; + + + echo "
      "; + + + + +echo "
      "; + + + +echo ""; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> diff --git a/wxc2_omc/account/sub_inc/getParameter.php b/wxc2_omc/account/sub_inc/getParameter.php new file mode 100755 index 0000000..b82a41e --- /dev/null +++ b/wxc2_omc/account/sub_inc/getParameter.php @@ -0,0 +1,928 @@ +levelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + $errorInfo = "Error in omcStrFill:the defLen < lengh of string!!\\ndefLen=$defLen and string=$string!!"; + echo ""; + exit(); + + echo "
      Error in omcStrFill : the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +function getInnerValue($sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$showStr,$inputValueType) +{ + global $language,$Debug,$inputID; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $sysConfTable = 'OMC_PUB.sysConf'; + $pubDb ='OMC_PUB'; + $paramConfTable = $objDb.".paramConf"; + + $maxLevelNum = 10; + $nInteger = 2; + $nOctStr = 4; + + + + + if(strlen($showStr)>0){ + echo ""; + return ""; + } + + if($Debug) echo "
      $paramConfTable
      "; + //---------------------- + //选择语言版本 + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + if($Debug) echo "
      getValue = $getValue"; + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + + $paramSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $getValue = $v_Row[0]; + + + //explode by '[remark]' + $remarkArr = explode('[remark]',$setTemplate); + $remark = $remarkArr[1]; + //explode by '[unit]' + $unitArr = explode('[unit]',$remarkArr[0]); + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$order]); + + //Unit Name + if($Debug) echo "$tlvArr[0] : $tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($getValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + + if($Debug) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + if($Debug) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($Debug) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($Debug) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $newBitValue=''; + for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){ + $tmpBitValue=substr($bitValue,($byteNum-$bgnByte)*8,8); + if($DEBUG) echo "
      $tmpBitValue=substr($bitValue,($byteNum-$bgnByte)*8,8)"; + $tmpBitValue = strrev($tmpBitValue); + if($DEBUG) echo "
      $tmpBitValue = strrev($tmpBitValue)"; + if($DEBUG) echo "
      bitValue = $bitValue"; + $newBitValue=$newBitValue.$tmpBitValue; + } + + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($Debug) echo "
      bitValue = substr($newBitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($newBitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($Debug) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + //$operType = chop($valueArr[0]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + if($Debug) echo "
      operType = $operType"; + switch($operType){ + case 'input': + { + //explode by '-' + $defArr = explode('-',$valueArr[1]); + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($Debug) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $charValue = trim($charValue); + $inputValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($Debug) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) { + switch($defArr[2]){ + case '0': + $inputValue = str_replace('00','',$inputValue); + break; + case 'E': + $inputValue = str_replace('E','',$inputValue); + break; + case 'F': //modify zane 20051004 + $inputValue = str_replace('F','',$inputValue); + break; + default: break; + } + } + break; + default: break; + } + if($Debug) echo "
      $valueType == $nOctStr"; + if($def_flag){ + $inputValue = $defaultVaule; + } + //echo "valueType:$valueType
      "; + //if($valueType == $nOctStr) + //echo "getInner----inputValueType:$inputValueType
      "; + //$inputValueType=$inputValueType+0; + if($valueType==2) + { + $chechFnc = "checkInput(this,16)"; + + if($defArr[0] == 'toAscii') + { + $inputLen = $byteLen; + $chechFnc = ""; + } + elseif($defArr[0] == 'toHex' || $defArr[0] == 'keepHex') + { + $inputLen = $byteLen *2; + } + else + { + $inputLen = $byteLen *3; + } + $inputSize = $inputLen + 2; + } + else + { + $chechFnc = "checkInput(this,10)"; + } + + //=============input type===================== + $inputValueType=$inputValueType+0; + //echo "getInner----inputValueType:$inputValueType
      "; + //===only can input the dec num==== + if($inputValueType==1) + { + if($valueType == 4) + { + $maxValue=hexdec($maxValue); + $minValue=hexdec($minValue); + } + else + { + $maxValue=$maxValue+0; + $minValue=$minValue+0; + } + if($order>1) + $chechFnc = "checkInput(this,10)"; + else + $chechFnc = "checkInput(this,10,$maxValue,$minValue)"; + } + //===only can input the hex num==== + else if($inputValueType==2) + { + $chechFnc = "checkInput(this,16)"; + } + //====can input all character + else if($inputValueType==3) + { + $chechFnc = ""; + } + //=====can put only dec num but include blank + else if($inputValueType==4) + { + $chechFnc = "checkInput_patch(this)"; + } + + + + echo ""; + return $inputValue; + break; + } + case 'select': + { + if($valueType == $nOctStr){ + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + }else{ + $selectValue=$byteValue; + } + if($def_flag){ + $selectValue = $defaultVaule; + } + + if($Debug) echo "
      bitValue = $bitValue"; + if($Debug) echo "
      selectValue = $selectValue"; + if($Debug) echo "
      $valueType =?= $nOctStr(nOctStr)"; + echo ""; + if($readonly){ + echo "$selectshwo"; + } + return $selectshwo; + break; + } + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) +}//end getInnerValue + +function getParamValue(&$titleStr,&$IniEquRead,$sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$inputValueType) +{ + global $language; + //$Debug=1; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $sysConfTable = 'OMC_PUB.sysConf'; + $pubDb ='OMC_PUB'; + $paramConfTable = $objDb.".paramConf"; + + $maxLevelNum = 10; + $nInteger = 2; + $nOctStr = 4; + + + + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + //explode by '[remark]' + $remarkArr = explode('[remark]',$setTemplate); + $remark = $remarkArr[1]; + //explode by '[unit]' + $unitArr = explode('[unit]',$remarkArr[0]); + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$order]); + + //Unit Name + if($Debug) echo "$tlvArr[0] : $tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + + $paramSql = " SELECT initValue,readValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $initGetValue = $v_Row[0]; + $readGetValue = $v_Row[1]; + + $initByteValue = substr($initGetValue,$bgnByte*2,$byteLen*2); + $readByteValue = substr($readGetValue,$bgnByte*2,$byteLen*2); + if($Debug) echo "
      init:$initByteValue
      read:$readByteValue"; + $readBitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8;//1 byte = 8 bit + $readBitValue = DecBin(HexDec($readByteValue)); + $readBitValue = omcStrFill($readBitValue,$bitLen,'high','0'); + + $newBitValue=''; + for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){ + $tmpBitValue=substr($readBitValue,($byteNum-$bgnByte)*8,8); + if($DEBUG) echo "
      $tmpBitValue=substr($readBitValue,($byteNum-$bgnByte)*8,8)"; + $tmpBitValue = strrev($tmpBitValue); + if($DEBUG) echo "
      $tmpBitValue = strrev($tmpBitValue)"; + if($DEBUG) echo "
      bitValue = $bitValue"; + $newBitValue=$newBitValue.$tmpBitValue; + } + + + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($Debug) echo "
      readBitValue = substr($newBitValue,$bgnBit,$catBitLen)"; + $readBitValue = substr($newBitValue,$bgnBit,$catBitLen); + $readBitValue = strrev($readBitValue); + if($Debug) echo "
      readBitValue = $readBitValue"; + } + $initBitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8;//1 byte = 8 bit + $initBitValue = DecBin(HexDec($initByteValue)); + $initBitValue = omcStrFill($initBitValue,$bitLen,'high','0'); + + $newBitValue=''; + for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){ + $tmpBitValue=substr($initBitValue,($byteNum-$bgnByte)*8,8); + if($DEBUG) echo "
      $tmpBitValue=substr($initBitValue,($byteNum-$bgnByte)*8,8)"; + $tmpBitValue = strrev($tmpBitValue); + if($DEBUG) echo "
      $tmpBitValue = strrev($tmpBitValue)"; + if($DEBUG) echo "
      bitValue = $bitValue"; + $newBitValue=$newBitValue.$tmpBitValue; + } + + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($Debug) echo "
      initBitValue = substr($initBitValue,$bgnBit,$catBitLen)"; + $initBitValue = substr($newBitValue,$bgnBit,$catBitLen); + $initBitValue = strrev($initBitValue); + if($Debug) echo "
      initBitValue = $initBitValue"; + } + $IniEquRead = false; + if(strlen($initBitValue)>0) + { + if($initBitValue==$readBitValue) + $IniEquRead = true; + } + else + { + if($initByteValue == $readByteValue) + $IniEquRead = true; + } + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($Debug) echo "
      operType = $operType"; + switch($operType) + { + case 'input': + { + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($Debug) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]) + { + case 'toDec': + if(strlen($initBitValue) > 0){ + $initParsedValue = BinDec($initBitValue); + }else{ + $initParsedValue = HexDec($initByteValue); + } + break; + case 'keepDec': + $initParsedValue = $initByteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $initParsedValue = $initByteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7) + { + echo "
      Error:toAscii"; + exit(1); + } + else + { + $tmpLen=strlen($initByteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++) + { + $unitByte = substr($initByteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($Debug) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $charValue = trim($charValue); + $initParsedValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($Debug) echo "
      initParsedValue = $initParsedValue"; + switch($defArr[1]) + { + case 'high': + switch($defArr[2]) + { + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$initParsedValue = str_replace('0','',$initParsedValue); + }else{ + $initParsedValue = $initParsedValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) + { + switch($defArr[2]){ + case '0': + $initParsedValue = str_replace('00','',$initParsedValue); + break; + case 'E': + $initParsedValue = str_replace('E','',$initParsedValue); + break; + case 'F': //modify zane 20051004 + $initParsedValue = str_replace('F','',$initParsedValue); + break; + default: break; + } + } + break; + default: break; + } + $returnValue = $initParsedValue; + break; + } + case 'select': + { + if($valueType == $nOctStr){ + if($initBitValue != ''){ + $selectValue = BinDec($initBitValue); + }else{ + $selectValue = HexDec($initByteValue); + } + }else{ + $selectValue=$initByteValue; + } + $isSelected = 0; + for($j=1;$j$defArr[1]"; + } + } + + if($isSelected ==0 && $j == sizeof($valueArr)){ + $selectShow = "Undefined Value"; + } + $returnValue = $selectShow; + break; + } + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + if(strlen($returnValue)==0) $returnValue='--'; + return $returnValue; +}//end getParamValue + +function setParamValue($unitValue,$sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$inputValueType) +{ + global $language; + $Debug=0; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $sysConfTable = 'OMC_PUB.sysConf'; + $pubDb ='OMC_PUB'; + $paramConfTable = $objDb.".paramConf"; + + $maxLevelNum = 10; + $nInteger = 2; + $nOctStr = 4; + + + + if($Debug) echo "===================
      unitValue:$unitValue
      "; + //---------------------- + //选择语言版本 + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + + $paramSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $getValue = $v_Row[0]; + if($Debug) echo "
      getValue = $getValue"; + + + //explode by '[remark]' + $remarkArr = explode('[remark]',$setTemplate); + $remark = $remarkArr[1]; + //explode by '[unit]' + $unitArr = explode('[unit]',$remarkArr[0]); + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$order]); + + //Unit Name + if($Debug) echo "
      $tlvArr[0] : $tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + //$operType = chop($valueArr[0]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($Debug) echo "
      operType = $operType"; + if($operType == 'select') + { //select + if($valueType == $nOctStr) + $changeTypeStr = 'toDec-high-0'; + else + $changeTypeStr = 'keepDec-high-0'; + } + else + { + $changeTypeStr = $valueArr[1]; + } + $changeTypeArr = explode('-',$changeTypeStr); + $changeType = $changeTypeArr[0]; + $fillWay = $changeTypeArr[1]; + $fillChar = $changeTypeArr[2]; + + $setUnitValue = ''; + if($Debug)echo "
      changeType:$changeType"; + switch($changeType) + { + case 'toDec': + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($Debug)echo "
      bitValue = $bitValue "; + if($Debug)echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + + if($bgnByte!=$endByte){ + if($DEBUG) echo "
      substr($bitValue,0,1+$endBit)"; + $tmpBitValue=substr($bitValue,0,1+$endBit); + $tmpOffset=$endByte.'.0-'.$endByte.'.'.$endBit; + + if($endBit==7){ + $tmpByteValue=omcStrFill(dechex(bindec($tmpBitValue)),2,$fillWay,$fillChar); + $getValue = setBitValue($getValue,$tmpOffset,$tmpByteValue); + }else + $getValue = setBitValue($getValue,$tmpOffset,$tmpBitValue); + + if($DEBUG)echo "
      $getValue = setBitValue($getValue,$tmpOffset,$tmpBitValue);"; + $newBitValue=$tmpBitValue; + if($DEBUG) echo "
      newBitValue=$newBitValue"; + + for($byteNum=$endByte-1;$byteNum >= $bgnByte;$byteNum--){ + if($DEBUG) echo "
      substr($bitValue,($byteNum-($endByte-1))*8+1+$endBit,8)"; + $tmpBitValue=substr($bitValue,($byteNum-($endByte-1))*8+1+$endBit,8); + + + if($byteNum == $bgnByte){ + $tmpOffset=$bgnByte.'.'.$bgnBit.'-'.$bgnByte.'.7'; + if($DEBUG) + echo "
      $getValue = setBitValue($getValue,$tmpOffset,$tmpBitValue);"; + if($bgnBit==0){ + $tmpByteValue=omcStrFill(dechex(bindec($tmpBitValue)),2,$fillWay,$fillChar); + $getValue = setBitValue($getValue,$tmpOffset,$tmpByteValue); + }else + $getValue = setBitValue($getValue,$tmpOffset,$tmpBitValue); + }else{ + $tmpOffset=$byteNum.'.0-'.$bgnByte.'.7'; + $getValue = setBitValue($getValue,$tmpOffset,dechex(bindec($tmpBitValue))); + } + + if($DEBUG) echo "
      $newBitValue.$tmpBitValue"; + $newBitValue=$newBitValue.$tmpBitValue; + if($DEBUG) echo "
      newBitValue=$newBitValue"; + } + $bitValue=$newBitValue; + } + + $setUnitValue = $bitValue; + } + else + { + $setUnitValue = DecHex($unitValue); + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + if($Debug) echo "
      omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar)"; + } + if($Debug) echo "
      setUnitValue = $setUnitValue"; + break; + case 'keepHex': + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $endBit - $bgnBit +1; + $bitValue = ($unitValue); + if($Debug) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($Debug) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $setUnitValue = $bitValue; + } + else + { + $setUnitValue = ($unitValue); + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + if($Debug) echo "
      omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar)"; + } + if($Debug) echo "
      setUnitValue = $setUnitValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $setUnitValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $setUnitValue .= DecHex($decValue); + if(strlen($setUnitValue) < 2){ + $setUnitValue = '0'.$setUnitValue; + } + } + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + } + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($Debug) echo "
      setUnitValue = $setUnitValue "; + //--><-//$lastValue = $setUnitValue.$lastValue; + + if($changeType=='toDec'&&($bgnBit > 0 ||$endBit < 7)&&$bgnByte!=$endByte) + $setValue=$getValue; + else + $setValue = setBitValue($getValue,$tlvArr[1],$setUnitValue); + + $setValue = strtoupper($setValue); + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo'"; + if($DEBUG) + echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); +}//end setParamValue + +//0: flag +echo $flag; +echo "###"; + +if($flag=='getVar')//用户点击的是参数 +{ + //1: idName + echo $newId; + echo "###"; + + //2: innerStr + $oldValue=getInnerValue($sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$showStr,$inputValueType); + if(strlen($doingOtherUlr)>0) + { + $doingOtherUlr .= "&oldValue=$oldValue"; + $doingOtherUlr=urlencode($doingOtherUlr); + } + echo "   SAVE "; +} + +if($flag=='saveVar')//用户点击的是右边的‘Save’ +{ + + //1: idName + echo $id; + echo "###"; + + //2: innerStr + setParamValue($setValue,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$inputValueType); + $newValue = getParamValue($titleStr,$IniEquRead,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$inputValueType); + if(strlen($showStr)) + echo $showStr; + else + echo $newValue; + echo "###"; + + //3: isEqual + if($IniEquRead||strlen($showStr)) //initValue == readValue + echo "1"; + else + echo "0"; + echo "###"; + + //4: doingOtherUlr + if(strlen($doingOtherUlr)>0) + { + $doingOtherUlr .= "&newValue=$newValue"; + } + echo $doingOtherUlr; +} +?> + + diff --git a/wxc2_omc/account/sub_inc/operwebfunc.inc b/wxc2_omc/account/sub_inc/operwebfunc.inc new file mode 100755 index 0000000..af827d2 --- /dev/null +++ b/wxc2_omc/account/sub_inc/operwebfunc.inc @@ -0,0 +1,466 @@ +init:$initByteValue
      read:$readByteValue"; + $readBitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8;//1 byte = 8 bit + $readBitValue = DecBin(HexDec($readByteValue)); + $readBitValue = omcStrFill($readBitValue,$bitLen,'high','0'); + + $newBitValue=''; + for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){ + $tmpBitValue=substr($readBitValue,($byteNum-$bgnByte)*8,8); + if($DEBUG) echo "
      $tmpBitValue=substr($readBitValue,($byteNum-$bgnByte)*8,8)"; + $tmpBitValue = strrev($tmpBitValue); + if($DEBUG) echo "
      $tmpBitValue = strrev($tmpBitValue)"; + if($DEBUG) echo "
      bitValue = $bitValue"; + $newBitValue=$newBitValue.$tmpBitValue; + } + + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      readBitValue = substr($newBitValue,$bgnBit,$catBitLen)"; + $readBitValue = substr($newBitValue,$bgnBit,$catBitLen); + $readBitValue = strrev($readBitValue); + if($DEBUG) echo "
      readBitValue = $readBitValue"; + } + $initBitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8;//1 byte = 8 bit + $initBitValue = DecBin(HexDec($initByteValue)); + $initBitValue = omcStrFill($initBitValue,$bitLen,'high','0'); + + $newBitValue=''; + for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){ + $tmpBitValue=substr($initBitValue,($byteNum-$bgnByte)*8,8); + if($DEBUG) echo "
      $tmpBitValue=substr($initBitValue,($byteNum-$bgnByte)*8,8)"; + $tmpBitValue = strrev($tmpBitValue); + if($DEBUG) echo "
      $tmpBitValue = strrev($tmpBitValue)"; + if($DEBUG) echo "
      bitValue = $bitValue"; + $newBitValue=$newBitValue.$tmpBitValue; + } + + + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      initBitValue = substr($newBitValue,$bgnBit,$catBitLen)"; + $initBitValue = substr($newBitValue,$bgnBit,$catBitLen); + $initBitValue = strrev($initBitValue); + if($DEBUG) echo "
      initBitValue = $initBitValue"; + } + $IniEquRead = false; + if(strlen($initBitValue)>0) + { + if($initBitValue==$readBitValue) + $IniEquRead = true; + } + else + { + if($initByteValue == $readByteValue) + $IniEquRead = true; + } + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + switch($operType) + { + case 'input': + { + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]) + { + case 'toDec': + if(strlen($initBitValue) > 0){ + $initParsedValue = BinDec($initBitValue); + }else{ + $initParsedValue = HexDec($initByteValue); + } + break; + case 'keepDec': + $initParsedValue = $initByteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $initParsedValue = $initByteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7) + { + echo "
      Error:toAscii"; + exit(1); + } + else + { + $tmpLen=strlen($initByteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++) + { + $unitByte = substr($initByteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $charValue = trim($charValue); + $initParsedValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      initParsedValue = $initParsedValue"; + switch($defArr[1]) + { + case 'high': + switch($defArr[2]) + { + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$initParsedValue = str_replace('0','',$initParsedValue); + }else{ + $initParsedValue = $initParsedValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) + { + switch($defArr[2]){ + case '0': + $initParsedValue = str_replace('00','',$initParsedValue); + break; + case 'E': + $initParsedValue = str_replace('E','',$initParsedValue); + break; + case 'F': //modify zane 20051004 + $initParsedValue = str_replace('F','',$initParsedValue); + break; + default: break; + } + } + break; + default: break; + } + $returnValue = $initParsedValue; + break; + } + case 'select': + { + if($valueType == $nOctStr){ + if($initBitValue != ''){ + $selectValue = BinDec($initBitValue); + }else{ + $selectValue = HexDec($initByteValue); + } + }else{ + $selectValue=$initByteValue; + } + $isSelected = 0; + for($j=1;$j$defArr[1]"; + } + } + + if($isSelected ==0 && $j == sizeof($valueArr)){ + $selectShow = "Undefined Value"; + } + $returnValue = $selectShow; + break; + } + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + if(strlen($returnValue)==0) $returnValue='--'; + return $returnValue; +}//end getParamValue + +function showParameter($sysId,$oidStr,$order,$inputValueType,$instanceNo=0,$doingOtherUlr='',$otherWhereStr='',$showStr='') +{ + global $language,$notSettedColor,$settedColor; + $tmp1 = str_replace('.','_',$oidStr); + $id = 'ID_' . $sysId . '_' . $tmp1 . '_' . $order . '_ist' . $instanceNo; + $newId = "New".$id; + $showValue = getParamValue($titleStr,$IniEquRead,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr); + if($IniEquRead)$color = $settedColor; + else $color = $notSettedColor; + $doingOtherUlr=urlencode($doingOtherUlr); + if(strlen($showStr)) + { + $color = $settedColor; + $showValue = $showStr; + } + //$otherWhereStr=urlencode($otherWhereStr); + echo "$showValue"; + echo ""; +} + +?> + + diff --git a/wxc2_omc/account/sub_inc/sub_chinese_gb.inc b/wxc2_omc/account/sub_inc/sub_chinese_gb.inc new file mode 100755 index 0000000..8643253 --- /dev/null +++ b/wxc2_omc/account/sub_inc/sub_chinese_gb.inc @@ -0,0 +1,81 @@ + \ No newline at end of file diff --git a/wxc2_omc/account/sub_inc/sub_config.inc b/wxc2_omc/account/sub_inc/sub_config.inc new file mode 100755 index 0000000..bc4b1f0 --- /dev/null +++ b/wxc2_omc/account/sub_inc/sub_config.inc @@ -0,0 +1,133 @@ +srcNumber 1=$srcNumber"; + $valueLen=strlen($srcNumber); + if($valueLen == $len){ + return($srcNumber); + }elseif($valueLen > 0){ + $srcNumber = $planCode.$srcNumber; + $valueLen=strlen($srcNumber); + for($i=$len; $i>$valueLen; $i--){ + $srcNumber .=$keepLenCode; + if($DEBUG) echo "
      srcNumber 2=$srcNumber"; + } + }else{ + for($i=0; $i<$len; $i++){ + $srcNumber .=$keepLenCode; + } + } + if($DEBUG) echo "
      srcNumber 3=$srcNumber"; + return($srcNumber); +} + +function getLevelWhere($objIdStr) +{ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + $errorInfo = "Error in omcStrFill:the defLen < lengh of string!!\\ndefLen=$defLen and string=$string!!"; + echo ""; + exit(); + + echo "
      Error in omcStrFill : the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +?> diff --git a/wxc2_omc/account/sub_inc/sub_english.inc b/wxc2_omc/account/sub_inc/sub_english.inc new file mode 100755 index 0000000..c251374 --- /dev/null +++ b/wxc2_omc/account/sub_inc/sub_english.inc @@ -0,0 +1,89 @@ + diff --git a/wxc2_omc/account/tariffList/baseTariffList.php b/wxc2_omc/account/tariffList/baseTariffList.php new file mode 100755 index 0000000..5078701 --- /dev/null +++ b/wxc2_omc/account/tariffList/baseTariffList.php @@ -0,0 +1,692 @@ +"Disable",1=>"Home PLMN Call",2=>"Other Network Call"); +$sm_cap_flag_label=array(0=>"Disable",1=>"Home PLMN SM",2=>"Other Network SM"); +//echo "
      moneyPara = $moneyPara"; + +if($add_area){ + echo " "; + exit(); +} + +//编辑后保持对应tariff_id的页面 +if ($keep_id != 1){ + $tariff_id=isset($tariff_id)?$tariff_id:'00'; +} +else {$tariff_id=$return_tariff_id;} +if($DEBUG) {echo "
      keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} +// + + +$where=" WHERE tariff_id=$tariff_id "; +//echo "
      where=$where"; +$str_sql ="SELECT count(*) FROM $table_name ".$where; +//echo "
      str_sql=$str_sql"; + +$result=mysqli_query($objDbConn,$str_sql); +$record = mysqli_fetch_array($result); +$number_of_records = $record[0]; + +$order = " ORDER BY $sort_field $sort_direction "; +$sel_sql ="SELECT * FROM $table_name ".$where.$order; +//echo "
      sel_sql=$sel_sql"; +$result = @mysqli_query($objDbConn,$sel_sql); +$rows = @mysqli_fetch_array($result); +echo mysqli_error($objDbConn); + +?> + + +
      "> + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + echo "MO basic tariff Total records:$number_of_records"; + echo ""; + echo ""; + + echo "$strResideZone: "; + $maxCosSql = " SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName = 'maxCOSNumber' "; + $maxCosRes = @mysqli_query($pubConn,$maxCosSql); + $maxCosRow = @mysqli_fetch_array($maxCosRes); + $maxCosNum = $maxCosRow[pubVarValue]; + echo ""; + + echo ""; + echo ""; + echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + + + +"; + echo ""; + echo "$strChargingPrefix"; + echo "Country
      /District
      "; + echo "Call
      type"; + echo "Discount
      id"; + echo "$strUnitChargingTimeSecond"; + echo "$strFreeChargeUnit"; + echo "$strMinimumChargingUnit"; + //echo "$strBasicFee"; + //echo "$strBasicLongDistance"; + echo "$strBasicInitial"; + echo "$strTariffRentCapFlag"; + echo "Tier Level"; + echo "Tier0 Unit"; + echo "$strBasicFee"; + echo "$strBasicLongDistance"; + echo "Tier1 Unit"; + echo "$strBasicFee"; + echo "$strBasicLongDistance"; + echo "Tier2 Unit"; + echo "$strBasicFee"; + echo "$strBasicLongDistance"; + echo ""; + do{ + echo ""; + echo "$rows[bill_id]"; + echo "$rows[area] "; + if($rows[call_type]==0) + echo "Local call out"; + elseif($rows[call_type]==1) + echo "NDD"; + elseif($rows[call_type]==2) + echo "IDD"; + else + echo "---"; + echo "$rows[discount_id]"; + echo "$rows[unit_time]"; + echo "$rows[free_time]"; + echo "$rows[mini_time]"; + //echo "$rows[base_fee]"; + //echo "$rows[long_distance_fee]"; + echo "$rows[adjustment]"; + echo "{$call_cap_flag_label[$rows[cap_flag]]}"; + echo "$rows[tier_level]"; + echo "$rows[tier_unit_0]"; + echo "$rows[base_fee_0]"; + echo "$rows[long_distance_fee_0]"; + echo "$rows[tier_unit_1]"; + echo "$rows[base_fee_1]"; + echo "$rows[long_distance_fee_1]"; + echo "$rows[tier_unit_2]"; + echo "$rows[base_fee_2]"; + echo "$rows[long_distance_fee_2]"; + /* $base_fee=$rows[base_fee]/$moneyPara; + if($moneyPara < 10){ + printf("%5.0f",$base_fee); + } + elseif($moneyPara < 100){ + printf("%5.1f",$base_fee); + } + else{ + printf("%5.2f",$base_fee); + } + + $long_distance_fee=$rows[long_distance_fee]/$moneyPara; + if($moneyPara < 10){ + printf("%5.0f", $long_distance_fee); + } + elseif($moneyPara < 100){ + printf("%5.1f", $long_distance_fee); + } + else{ + printf("%5.2f", $long_distance_fee); + } + + $adjustment_fee=$rows[adjustment]/$moneyPara; + if($moneyPara < 10){ + printf("%5.0f", $adjustment_fee); + } + elseif($moneyPara < 100){ + printf("%5.1f", $adjustment_fee); + } + else{ + printf("%5.2f", $adjustment_fee); + }*/ + echo ""; + }while($rows = mysqli_fetch_array($result)); +} +?> + +
      + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      "; + +$sql="SELECT id,description,rent_type,charge_date,rent_amount + FROM $table_name + WHERE tariff_id=$tariff_id + ORDER by id"; +//echo $sql,$bill_db; +$result=@mysqli_query($objDbConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($objDbConn); + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Rent"; +echo "
      "; +echo "

      "; +?> + + + + $strTariffRentID"; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + /* + $rows[rent_amount] = $rows[rent_amount]/$moneyPara; + if($moneyPara < 10){ + printf("", $rows[rent_amount]); + } + elseif($moneyPara < 100){ + printf("", $rows[rent_amount]); + } + else{ + printf("", $rows[rent_amount]); + }*/ + echo ""; + } + }while($rows=mysqli_fetch_array($result)); + } + ?> +
      $strDescription$strTariffRentChargeType$strTariffRentChargeDate$strTariffRentChargeAmount
      $showi--------
      $showi$rows[description]"; + if($rows[rent_type]=='00'){ + echo "$strTariffRentAccordingToDate"; + }else{ + echo "$strTariffRentAccordingToPeriod"; + } + echo ""; + if($rows[rent_type]=='01'){ + echo "$rows[charge_date]"; + }else{ + echo "--"; + } + echo "$rows[rent_amount]%5.0f%5.1f%5.2f
      + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} + +$sql="SELECT id,prefix,call_type,area,discount_id,charge_amount,cap_flag + FROM $table_name + WHERE tariff_id=$tariff_id + ORDER by id"; +//echo $sql,$bill_db; +$result=@mysqli_query($objDbConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($objDbConn); +?> +

      +"; + echo ""; + echo ""; + echo "SMS"; + echo ""; + echo ""; echo ""; + echo "

      "; + +?> + + + + $strTariffRentID"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "; + echo ""; + if("" == $rows[prefix]){ + $rows[prefix]="--"; + } + echo ""; + + if($rows[call_type]==0) + echo ""; + elseif($rows[call_type]==1) + echo ""; + elseif($rows[call_type]==2) + echo ""; + else + echo ""; + if ($rows[area] == ''){ + $rows[area]='--'; + } + echo ""; + echo ""; + echo ""; + echo ""; + $cap_flag_value=$sm_cap_flag_label[$rows[cap_flag]+0]; + echo ""; + /* + $rows[charge_amount ] = $rows[charge_amount ]/$moneyPara; + if($moneyPara < 10){ + printf("", $rows[charge_amount]); + } + elseif($moneyPara < 100){ + printf("", $rows[charge_amount]); + } + else{ + printf("", $rows[charge_amount]); + }*/ + echo ""; + }while($rows=mysqli_fetch_array($result)); + } + ?> +
      $strChargingPrefixCall type$strCountryDistrict$strDiscountID$strTariffRentChargeAmount$strTariffRentCapFlag
      $i $rows[prefix]Local call outNDDIDD--- $rows[area]$rows[discount_id]$rows[charge_amount]$cap_flag_value%5.0f%5.1f%5.2f
      + + + + + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} + +$sql="SELECT record_id,dest_ip,charge_unit,basic_fee,min_charge_unit,initial_adjustment,cap_flag,discount_id + FROM $table_name + WHERE tariff_id=$tariff_id + ORDER by record_id"; +//echo $sql,$bill_db; +$result=@mysqli_query($objDbConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($objDbConn); +?> +

      +"; + echo ""; + echo ""; + echo "GPRS"; + echo ""; + echo ""; echo ""; + echo "

      "; + +?> + + + + ID"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "Disable",1=>"Enable"); + + if($rows && $result){ + do{ + $i++; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $cap_flag_value=$gprs_cap_flag_label[$rows[cap_flag]+0]; + echo ""; + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + } + ?> +
      Dest IPCharge unit(KB)Basic feeMinimum charge unitInitial adjustmentCap flagDiscount ID
      {$rows[record_id]} $rows[dest_ip] $rows[charge_unit] $rows[basic_fee] $rows[min_charge_unit] $rows[initial_adjustment] $cap_flag_value $rows[discount_id]
      + + + + + + + + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} + +$sql="SELECT mms_send_id,mms_type,prefix,call_type,dest_name,discount_id,charge_fee,cap_flag + FROM $table_name + WHERE tariff_id=$tariff_id + ORDER by mms_send_id"; +//echo $sql,$bill_db; +$result=@mysqli_query($objDbConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($objDbConn); +?> +

      +"; + echo ""; + echo ""; + echo "MMS Send"; + echo ""; + echo ""; echo ""; + echo "

      "; + +?> + + + + ID"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "Disable",1=>"Enable"); + $mms_type_label=array(1=>"To mobile",2=>"To email"); + $call_type_label=array(0=>"Local call out",1=>"NDD",2=>"IDD"); + if($rows && $result){ + do{ + $i++; + echo ""; + echo ""; + + echo ""; + if(trim($rows[prefix])=="") + echo ""; + else + echo ""; + echo ""; + + if(trim($rows[dest_name])=="") + echo ""; + else + echo ""; + echo ""; + echo ""; + $cap_flag_value=$gprs_cap_flag_label[$rows[cap_flag]+0]; + echo ""; + + + echo ""; + }while($rows=mysqli_fetch_array($result)); + } + echo "
      MMS typePrefixCall typeDest nameDiscount IDCharge feeCap flag
      {$rows[mms_send_id]} {$mms_type_label[$rows[mms_type]]}-- $rows[prefix] {$call_type_label[$rows[call_type]]}-- $rows[dest_name] $rows[discount_id] $rows[charge_fee] $cap_flag_value
      "; + + ?> + + + + + + + + + + + + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} +// + + +$where=" WHERE tariff_id=$tariff_id "; +$sql="SELECT * FROM $tableName".$where; +//echo $sql,$bill_db; +$result=@mysqli_query($objDbConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($objDbConn); +?> + +setSql=$setSql"; + mysqli_query($objDbConn,$setSql); +} +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "
      Supplementary tariff
      "; +echo "
      "; +echo "

      "; +?> + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + + /* + $arr_editfieldAmount = array("cf_charge_amount","roaming_charge_amount","cc_charge_amount","cug_charge_amount","fav_charge_amount","fav_change_charge","cf_cug_charge_amount","cf_fav_charge_amount","cug_fav_charge_amount","cf_cug_fav_charge_amount"); + $arr_editfieldUnit = array("cf_charge_unit","roaming_charge_unit","cc_charge_unit","cug_charge_unit","fav_charge_unit","","cf_cug_charge_unit","cf_fav_charge_unit","cug_fav_charge_unit","cf_cug_fav_charge_unit"); + $arr_description = array($strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup,$strFav_call,$strFav_listedtion,$strCf_Cug_call,$strCf_Fav_call,$strCug_Fav_call,$strCf_Cug_Fav_call); + $arr_amount = array($rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount],$rows[fav_charge_amount],$rows[fav_change_charge],$rows[cf_cug_charge_amount],$rows[cf_fav_charge_amount],$rows[cug_fav_charge_amount],$rows[cf_cug_fav_charge_amount]); + $arr_unit = array($rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit],$rows[fav_charge_unit],"----",$rows[cf_cug_charge_unit],$rows[cf_fav_charge_unit],$rows[cug_fav_charge_unit],$rows[cf_cug_fav_charge_unit]); + */ + + $arr_editfieldAmount = array("cf_charge_amount","roaming_charge_amount","cc_charge_amount","cug_charge_amount","fav_charge_amount","fav_change_charge","cf_cug_charge_amount","cf_fav_charge_amount","cug_fav_charge_amount","cf_cug_fav_charge_amount","pool_account_change_charge","pool_call_amount","act_free_sms_charge","deact_free_sms_charge"); + $arr_editfieldUnit = array("cf_charge_unit","roaming_charge_unit","cc_charge_unit","cug_charge_unit","fav_charge_unit","","cf_cug_charge_unit","cf_fav_charge_unit","cug_fav_charge_unit","cf_cug_fav_charge_unit","","pool_call_unit","",""); + $arr_description = array($strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup,$strFav_call,"Friends and family number change fee",$strCf_Cug_call,$strCf_Fav_call,$strCug_Fav_call,$strCf_Cug_Fav_call,"Pool account change fee","Pool call","Active free SMS charge","Deactive free SMS charge"); + $arr_amount = array($rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount],$rows[fav_charge_amount],$rows[fav_change_charge],$rows[cf_cug_charge_amount],$rows[cf_fav_charge_amount],$rows[cug_fav_charge_amount],$rows[cf_cug_fav_charge_amount],$rows[pool_account_change_charge],$rows[pool_call_amount],$rows[act_free_sms_charge],$rows[deact_free_sms_charge]); + $arr_unit = array($rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit],$rows[fav_charge_unit],"----",$rows[cf_cug_charge_unit],$rows[cf_fav_charge_unit],$rows[cug_fav_charge_unit],$rows[cf_cug_fav_charge_unit],"----",$rows[pool_call_unit],"----","----"); + + + for ($i=0;$i<14;$i++){ + echo ""; + echo ""; + echo ""; + /*if($moneyPara < 10){ + printf("", $arr_amount[$i]/$moneyPara); + } + elseif($moneyPara < 100){ + printf("", $arr_amount[$i]/$moneyPara); + } + else{ + printf("", $arr_amount[$i]/$moneyPara); + }*/ + echo ""; + echo ""; + echo $tariffID; + } +?> +
      $strDescription$strTariffRentChargeAmount$strUnitChargingTimeSecond
      $arr_description[$i]$arr_amount[$i]%5.0f%5.1f%5.2f $arr_unit[$i]
      + + + diff --git a/wxc2_omc/account/tariffList/discountList.php b/wxc2_omc/account/tariffList/discountList.php new file mode 100755 index 0000000..a21160c --- /dev/null +++ b/wxc2_omc/account/tariffList/discountList.php @@ -0,0 +1,160 @@ + + + +"; +echo ""; +echo ""; +echo "$strThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "

      "; + +//没有纪录时,显示无记录提示 + if(!$rows){ + echo "$strNotFindRecord"; + exit(); + } +?> + + + + + + + + + + + + + + +"; + $hours=$rows[hours]; + if(strlen($hours) < 2) $hours='0'.$hours; + if(strlen($hours+1) < 2) + { + $next_hours='0'.($hours+1); + } + else + { + $next_hours=$hours+1; + } + $mon=change2point($rows[mon]/100); + $tue=change2point($rows[tue]/100); + $wed=change2point($rows[wed]/100); + $thu=change2point($rows[thu]/100); + $fri=change2point($rows[fri]/100); + $sat=change2point($rows[sat]/100); + $sun=change2point($rows[sun]/100); + $holiday=change2point($rows[holiday]/100); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $record_length++; + } + while($rows = @mysqli_fetch_array($result)); + +//初始化折扣表,管理员没有设置折扣时,系统自动将各时段的折扣设为100% + for($i=$record_length;$i<24;$i++){ + $hours=$i; + $defaultDiscount=100; + + $setSql="INSERT INTO $tableName + (hours,mon,tue,wed,thu,fri,sat,sun,holiday) + VALUES ('$i','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount')"; + if($DEBUG) echo "
      setSql=$setSql"; + $result= @mysqli_query($pubConn,$setSql); + //echo mysqli_error($pubConn); + //echo "
      sql=$sql"; + + if(strlen($hours) < 2) $hours='0'.$hours; + if(strlen($hours+1) < 2) + { + $next_hours='0'.($hours+1); + } + else + { + $next_hours=$hours+1; + } + $mon=change2point($rows[mon]/100); + $tue=change2point($rows[tue]/100); + $wed=change2point($rows[wed]/100); + $thu=change2point($rows[thu]/100); + $fri=change2point($rows[fri]/100); + $sat=change2point($rows[sat]/100); + $sun=change2point($rows[sun]/100); + $holiday=change2point($rows[holiday]/100); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +// + +?> + +
      $hours:00:00 - $next_hours:00:00$mon$tue$wed$thu$fri$sat$sun$holiday
      $hours:00:00 - $next_hours:00:00$mon$tue$wed$thu$fri$sat$sun$holiday
      + + diff --git a/wxc2_omc/account/tariffList/discountTariffList.php b/wxc2_omc/account/tariffList/discountTariffList.php new file mode 100755 index 0000000..bec8cf7 --- /dev/null +++ b/wxc2_omc/account/tariffList/discountTariffList.php @@ -0,0 +1,154 @@ +"; +if( FALSE == isset($discount_id) ){ + $discount_id = 00; +} +/* +//insert discount to table while the time segment is NULL +$countSql = "SELECT count(*) as total FROM $tbName WHERE discount_id=$discount_id"; +if($DEBUG) echo "countSql=$countSql
      "; +$countRes = mysqli_query($pubConn,$countSql); +$countRows = mysqli_fetch_array($countRes); +echo "countRows[total]=$countRows[total]
      "; +if($countRows[total]<24){ +} +exit(); +*/ +//select current discount id details from TABLE "pre_bill_discount" +$selSql = "SELECT * FROM $tbName WHERE discount_id=$discount_id ORDER BY $order"; +if($DEBUG) echo "selSql=$selSql
      "; +$selRes = mysqli_query($objDbConn,$selSql); +$selRows = mysqli_fetch_array($selRes); + +?> + + +
      +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; + echo ""; + + echo "Discount ID: "; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + + + +
      + + + + + + + + + + + + + + +"; + $hours=$selRows[hours]; + if(strlen($hours) < 2) $hours='0'.$hours; + if(strlen($hours+1) < 2){ + $next_hours='0'.($hours+1); + }else{ + $next_hours=$hours+1; + } + $mon=change2point($selRows[mon]/100); + $tue=change2point($selRows[tue]/100); + $wed=change2point($selRows[wed]/100); + $thu=change2point($selRows[thu]/100); + $fri=change2point($selRows[fri]/100); + $sat=change2point($selRows[sat]/100); + $sun=change2point($selRows[sun]/100); + $holiday=change2point($selRows[holiday]/100); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }while($selRows = @mysqli_fetch_array($selRes)); +?> +
      $hours:00:00 - $next_hours:00:00$mon$tue$wed$thu$fri$sat$sun$holiday
      + + + diff --git a/wxc2_omc/account/tariffList/holidayTariffList.php b/wxc2_omc/account/tariffList/holidayTariffList.php new file mode 100755 index 0000000..93027a7 --- /dev/null +++ b/wxc2_omc/account/tariffList/holidayTariffList.php @@ -0,0 +1,84 @@ + + + + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + /* +//没有纪录时,显示无记录提示 + if(!$rows){ + echo "$strNotFindRecord"; + exit(); + } + */ +?> + + + + + + + "; + $id=$rows[id]; + $month=omc_keep_length($rows[month],0,2); + $day=omc_keep_length($rows[day],0,2); + $showDate=$month."-".$day; + $rows[name]=$rows[name]?$rows[name]:'--'; + echo ""; + echo ""; + echo ""; + $i++; + }while($rows=mysqli_fetch_array($result)); + ?> +
      (mm-dd)
      $showDate$rows[name]
      + + + diff --git a/wxc2_omc/account/tariffList/mtTariffList.php b/wxc2_omc/account/tariffList/mtTariffList.php new file mode 100755 index 0000000..cb6fea3 --- /dev/null +++ b/wxc2_omc/account/tariffList/mtTariffList.php @@ -0,0 +1,390 @@ +moneyPara = $moneyPara"; + +if($add_area){ + echo " "; + exit(); +} + +//编辑后保持对应tariff_id的页面 +if ($keep_id != 1){ + $tariff_id=isset($tariff_id)?$tariff_id:'00'; +} +else {$tariff_id=$return_tariff_id;} +if($DEBUG) {echo "
      keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} + +$where=" WHERE tariff_id=$tariff_id "; +//echo "
      where=$where"; +$str_sql ="SELECT count(*) FROM $table_name ".$where; +// echo "
      str_sql=$str_sql"; +$result=mysqli_query($objDbConn,$str_sql); +$record = mysqli_fetch_array($result); +$number_of_records = $record[0]; + +$order = " ORDER BY $sort_field $sort_direction "; +$sel_sql ="SELECT * FROM $table_name ".$where.$order; +//echo "
      sel_sql=$sel_sql"; +$result = @mysqli_query($objDbConn,$sel_sql); +$rows = @mysqli_fetch_array($result); +echo mysqli_error($objDbConn); + +?> + + +
      "> + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + echo "$strTotal $strDisplayRecords: $number_of_records"; + echo ""; + echo ""; + + echo "$strResideZone: "; + $maxCosSql = " SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName = 'maxCOSNumber' "; + $maxCosRes = @mysqli_query($pubConn,$maxCosSql); + $maxCosRow = @mysqli_fetch_array($maxCosRes); + $maxCosNum = $maxCosRow[pubVarValue]; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + + + + + "; + echo "$strTariffNoRecords $tariff_id"."!"; + exit(); + } +?> + + + $strResideZone"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + +"; + // echo ""; + echo ""; + echo ""; + if($rows[call_type]==4) + echo ""; + elseif($rows[call_type]==5) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + //echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + /* $base_fee=$rows[base_fee]/$moneyPara; + if($moneyPara < 10){ + printf("",$base_fee); + } + elseif($moneyPara < 100){ + printf("",$base_fee); + } + else{ + printf("",$base_fee); + } + + $long_distance_fee=$rows[long_distance_fee]/$moneyPara; + if($moneyPara < 10){ + printf("", $long_distance_fee); + } + elseif($moneyPara < 100){ + printf("", $long_distance_fee); + } + else{ + printf("", $long_distance_fee); + } + + $adjustment_fee=$rows[adjustment]/$moneyPara; + if($moneyPara < 10){ + printf("", $adjustment_fee); + } + elseif($moneyPara < 100){ + printf("", $adjustment_fee); + } + else{ + printf("", $adjustment_fee); + }*/ + echo ""; +}while($rows = mysqli_fetch_array($result)); +?> +
      $strChargingPrefixCountry
      /District
      Call
      type
      Discount
      ID
      $strUnitChargingTimeSecond$strFreeChargeUnit$strMinimumChargingUnit$strBasicInitialTier LevelTier0 Unit$strBasicFee$strBasicLongDistanceTier1 Unit$strBasicFee$strBasicLongDistanceTier2 Unit$strBasicFee$strBasicLongDistance
      $rows[tariff_id]$rows[bill_id] $rows[area] Local call inTrunk call in---$rows[discount_id]$rows[unit_time]$rows[free_time]$rows[mini_time]$rows[base_fee]$rows[long_distance_fee]$rows[adjustment]$rows[tier_level]$rows[tier_unit_0]$rows[base_fee_0]$rows[long_distance_fee_0]$rows[tier_unit_1]$rows[base_fee_1]$rows[long_distance_fee_1]$rows[tier_unit_2]$rows[base_fee_2]$rows[long_distance_fee_2]%5.0f%5.1f%5.2f%5.0f%5.1f%5.2f%5.0f%5.1f%5.2f
      + + + +MMS Retrieve

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +$tableName="PPS_DB.vas_mms_retrieve_tariff"; +$sql="select * from $tableName where tariff_id=$tariff_id order by mms_retrieve_id asc "; +$res=@mysqli_query($objDbConn,$sql); +$num=@mysqli_num_rows($res); +$mms_retrieve_cap_flag_label=array(0=>"Disable",1=>"Enable"); +$mms_retrieve_call_type_label=array(4=>"Local call in",5=>"Trunk call in"); + +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + echo ""; + //ID + $mms_retrieve_id=$row[mms_retrieve_id]; + echo ""; + + //Prefix + echo ""; + + //Call type + echo ""; + + //Dest name + echo ""; + + //Discount ID + echo ""; + + //Charge fee + echo ""; + + //Cap flag + echo ""; + + echo ""; +} +//echo "tariff_id=$tariff_id
      "; +echo "
      IDPrefixCall typeDest nameDiscount IDCharge feeCap flag
      "; + echo "$mms_retrieve_id"; + echo ""; + if(trim($row[prefix]) == "") + echo "--"; + else + echo "{$row[prefix]}"; + echo ""; + echo "{$mms_retrieve_call_type_label[$row[call_type]]} "; + echo ""; + if(trim($row[dest_name]) == "") + echo "--"; + else + echo "{$row[dest_name]}"; + echo ""; + echo "{$row[discount_id]} "; + echo ""; + echo "{$row[charge_fee]} "; + echo ""; + echo "{$mms_retrieve_cap_flag_label[$row[cap_flag]]} "; + echo "
      "; + +?> + + + +MMS Email

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +$tableName="PPS_DB.vas_mms_email_tariff"; +$sql="select * from $tableName where tariff_id=$tariff_id order by email_id asc "; +$res=@mysqli_query($objDbConn,$sql); +$num=@mysqli_num_rows($res); +$email_cap_flag_label=array(0=>"Disable",1=>"Enable"); +$email_call_type_label=array(4=>"Local call in",5=>"Trunk call in"); + +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + echo ""; + //ID + $email_id=$row[email_id]; + echo ""; + + //Prefix + echo ""; + + //Call type + echo ""; + + //Dest name + echo ""; + + //Discount ID + echo ""; + + //Charge fee + echo ""; + + //Cap flag + echo ""; + + echo ""; +} +//echo "tariff_id=$tariff_id
      "; +echo "
      IDPrefixCall typeDest nameDiscount IDCharge feeCap flag
      "; + echo "$email_id"; + echo ""; + if(trim($row[prefix]) == "") + echo "--"; + else + echo "{$row[prefix]}"; + echo ""; + echo "{$email_call_type_label[$row[call_type]]} "; + echo ""; + if(trim($row[dest_name]) == "") + echo "--"; + else + echo "{$row[dest_name]}"; + echo ""; + echo "{$row[discount_id]} "; + echo ""; + echo "{$row[charge_fee]} "; + echo ""; + echo "{$email_cap_flag_label[$row[cap_flag]]} "; + echo "
      "; + +?> + + + +

      + + + \ No newline at end of file diff --git a/wxc2_omc/account/tariffList/reloadTariff.php b/wxc2_omc/account/tariffList/reloadTariff.php new file mode 100755 index 0000000..1549a9b --- /dev/null +++ b/wxc2_omc/account/tariffList/reloadTariff.php @@ -0,0 +1,274 @@ + + + +downloadCurrent = ".$_REQUEST['downloadCurrent']; +if($DEBUG) echo "
      downloadPlan = ".$_REQUEST['downloadPlan']; + + + +//========================================================== +//数据处理 +//========================================================== +$ftpInfo=getMSSFtpAccount(); +if($DEBUG) print_r($ftpInfo); + +if($downloadCurrent||$downloadPlan){ + echo "




      "; + adjust_title_tail(); + adjust_content_head(); + //找到适合的子系统 + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM sysInfo + WHERE sysTypeNo='$sysTypeNo' AND baseStat > '0' + ORDER BY sysNo ASC,subSysNo ASC + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + if(mysqli_num_rows($getSysIdResult) <= 0) { + echo "
      Sorry, All the PPS's status are abnormal!"; + exit(); + } + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysId=$sysTypeNo.'_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $sysName='PPS_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + if($DEBUG) echo "
      sysId = $sysId"; + $dstSeverIp = $getSysIdRow[ip]; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + + //下载数据 + /* close ftp + $con=@ftp_connect($dstSeverIp); + */ + + $connection=sftp_connect($dstSeverIp); + + if($DEBUG)echo "
      con=$con"; + + //login pps server + $loginName = $ftpInfo[UserName]; + $password = $ftpInfo[Password]; + + /* close ftp + $log=@ftp_login($con,$loginName,$password); + if($DEBUG)echo "
      log=$log"; + if(!$log){ + echo "
      Fail to connect $dstSeverIp."; + echo "

      $strBack"; + exit(); + } + */ + + $key=sftp_login($connection,$loginName,$password); + if(!$key) + { + echo "
      Fail to connect $dstSeverIp."; + echo "

      $strBack"; + exit(); + } + + $mode=FTP_ASCII; + $remoteFile[0] ='/usr/local/subsManage/rent.csv'; + $remoteFile[1] ='/usr/local/subsManage/bill_sms.csv'; + $remoteFile[2] ='/usr/local/subsManage/bill_discount.csv'; + $remoteFile[3] ='/usr/local/subsManage/bill_holiday.csv'; + $remoteFile[4] ='/usr/local/subsManage/comm_tariff.csv'; + $remoteFile[5] ='/usr/local/subsManage/mo_tariff.csv'; + $remoteFile[6] ='/usr/local/subsManage/mt_tariff.csv'; + $remoteFile[7] ='/usr/local/subsManage/gprs_tariff.csv'; + $remoteFile[8] ='/usr/local/subsManage/vas_mms_email_tariff.csv'; + $remoteFile[9] ='/usr/local/subsManage/vas_mms_retrieve_tariff.csv'; + $remoteFile[10] ='/usr/local/subsManage/vas_mms_send_tariff.csv'; + + $localFile[0] ='/usr/local/apache/htdocs/ftpFile/rent.csv'; + $localFile[1] ='/usr/local/apache/htdocs/ftpFile/bill_sms.csv'; + $localFile[2] ='/usr/local/apache/htdocs/ftpFile/bill_discount.csv'; + $localFile[3] ='/usr/local/apache/htdocs/ftpFile/bill_holiday.csv'; + $localFile[4] ='/usr/local/apache/htdocs/ftpFile/comm_tariff.csv'; + $localFile[5] ='/usr/local/apache/htdocs/ftpFile/mo_tariff.csv'; + $localFile[6] ='/usr/local/apache/htdocs/ftpFile/mt_tariff.csv'; + $localFile[7] ='/usr/local/apache/htdocs/ftpFile/gprs_tariff.csv'; + $localFile[8] ='/usr/local/apache/htdocs/ftpFile/vas_mms_email_tariff.csv'; + $localFile[9] ='/usr/local/apache/htdocs/ftpFile/vas_mms_retrieve_tariff.csv'; + $localFile[10] ='/usr/local/apache/htdocs/ftpFile/vas_mms_send_tariff.csv'; + + if($downloadCurrent){ + $dstTable[0]="rent"; + $dstTable[1]="bill_sms"; + $dstTable[2]="bill_discount"; + $dstTable[3]="bill_holiday"; + $dstTable[4]="comm_tariff"; + $dstTable[5]="mo_tariff"; + $dstTable[6]="mt_tariff"; + $dstTable[7]="gprs_tariff"; + $dstTable[8]="vas_mms_email_tariff"; + $dstTable[9]="vas_mms_retrieve_tariff"; + $dstTable[10]="vas_mms_send_tariff"; + }else{ + $dstTable[0]="pre_rent"; + $dstTable[1]="pre_bill_sms"; + $dstTable[2]="pre_bill_discount"; + $dstTable[3]="pre_bill_holiday"; + $dstTable[4]="pre_comm_tariff"; + $dstTable[5]="pre_mo_tariff"; + $dstTable[6]="pre_mt_tariff"; + $dstTable[7]="pre_gprs_tariff"; + $dstTable[8]="pre_vas_mms_email_tariff"; + $dstTable[9]="pre_vas_mms_retrieve_tariff"; + $dstTable[10]="pre_vas_mms_send_tariff"; + } + + $fileNum = count($remoteFile); + for($i=0;$i<$fileNum;$i++){ + /* close ftp + $getRes[$i]=ftp_get($con,$localFile[$i],$remoteFile[$i],$mode); + */ + //$getRes[$i]=sftp_get($key,$localFile[$i],$remoteFile[$i],SFTP_ASCII); + $getRes[$i]=sftp_get($connection,$localFile[$i],$remoteFile[$i],SFTP_ASCII); + if($DEBUG)echo "
      getRes[$i]=$getRes[$i]"; + + if($getRes[$i]){ + echo "
      Download $remoteFile[$i] from $sysName($dstSeverIp) ..... ok"; + $delSql = " DELETE FROM $dstTable[$i] "; + $delRes = mysqli_query($dbConn,$delSql); + + $loadSql = "LOAD DATA INFILE '$localFile[$i]' REPLACE + INTO TABLE $dstTable[$i] + FIELDS + TERMINATED BY ',' + LINES + TERMINATED BY '\n' + "; + //echo "
      loadSql=$loadSql"; + $loadRes = mysqli_query($dbConn,$loadSql); + if($loadRes){ + echo "
      Load $localFile[$i] into OMC $dstTable[$i]..... ok"; + }else{ + $noSuccess=1; + echo "
      Load $localFile[$i] into OMC $dstTable[$i]..... Failed"; + } + }else{ + $noSuccess=1; + echo "
      Download $remoteFile[$i] from $sysName($dstSeverIp) ..... Failed"; + } + echo "
      "; + } + + if($noSuccess){ + if($downloadCurrent) + insertLog("Download CURRENT TARIFF FAILURE"); + else + insertLog("Download TARIFF PLAN FAILURE"); + }else{ + if($downloadCurrent) + insertLog("Download CURRENT TARIFF SUCCESS"); + else + insertLog("Download TARIFF PLAN SUCCESS"); + } + + echo "



        << Return "; + adjust_content_tail(); + exit(); +} + +//========================================================== +//输出并显示数据 +//========================================================== +?> + +"; +echo ""; +echo ""; +echo "$pagePath"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> +
      " name="updateTariff"> +"; +echo ""; +echo ""; +if ($selectedLanguage == 'eng') + echo "Please download current tariff from PPS."; +elseif ($selectedLanguage == 'chn') + echo "请从PPS下载当前费率."; +echo ""; +echo ""; +?> + + +" class="button"> + + + + + +Please download tariff plan from PPS."; +elseif ($selectedLanguage == 'chn') + echo "请从PPS下载费率计划."; +?> + + + + + +" class="button"> + + +
      + + + diff --git a/wxc2_omc/account/tariffList/services.php b/wxc2_omc/account/tariffList/services.php new file mode 100755 index 0000000..afc5c60 --- /dev/null +++ b/wxc2_omc/account/tariffList/services.php @@ -0,0 +1,79 @@ + + + +"; +echo ""; +echo ""; +echo "$strPageTitle"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "

      "; + +//没有纪录时,显示无记录提示 + if(!$rows){ + echo "$strNotFindRecord"; + exit(); + } +?> + +"; + echo ""; + echo ""; + echo ""; + echo ""; + + $arr_description = array($strSMS,$strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup); + $arr_amount = array($rows[sm_charge_amount],$rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount]); + $arr_unit = array("--",$rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit]); + for ($i=0;$i<5;$i++){ + echo ""; + echo ""; + if($moneyPara < 10){ + printf("", $arr_amount[$i]/$moneyPara); + } + elseif($moneyPara < 100){ + printf("", $arr_amount[$i]/$moneyPara); + } + else{ + printf("", $arr_amount[$i]/$moneyPara); + } + //echo ""; + echo ""; + echo ""; + } +?> +
      $strDescription$strTariffRentChargeAmount$strUnitChargingTimeSecond
      $arr_description[$i]%5.0f%5.1f%5.2f$arr_amount[$i]$arr_unit[$i]
      + + diff --git a/wxc2_omc/account/tariffList/specialDayList.php b/wxc2_omc/account/tariffList/specialDayList.php new file mode 100755 index 0000000..15516bc --- /dev/null +++ b/wxc2_omc/account/tariffList/specialDayList.php @@ -0,0 +1,69 @@ + + + +"; +echo ""; +echo ""; +echo "$strThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "

      "; +//没有纪录时,显示无记录提示 + if(!$rows){ + echo "$strNotFindRecord"; + exit(); + } +?> + + + + + + "; + $month=omc_keep_length($rows[month],0,2); + $day=omc_keep_length($rows[day],0,2); + $showDate=$month."-".$day; + $rows[name]=$rows[name]?$rows[name]:'--'; + echo ""; + echo ""; + echo ""; + }while($rows=mysqli_fetch_array($result)); + ?> +
      (mm-dd)
      $showDate$rows[name]
      + + diff --git a/wxc2_omc/account/tariffList/tariffOverview.php b/wxc2_omc/account/tariffList/tariffOverview.php new file mode 100755 index 0000000..ddd489f --- /dev/null +++ b/wxc2_omc/account/tariffList/tariffOverview.php @@ -0,0 +1,87 @@ +selSql=$selSql"; + $result=@mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + $nMoAmount[$i] = $record[0]; + if($DEBUG) echo "
      $nMoAmount=$nMoAmount"; +} + +$tableName='mt_tariff'; +for($i=0;$i<8;$i++){ + $selSql = "SELECT count(*) + FROM $tableName + WHERE tariff_id='$i'"; + if($DEBUG) echo "
      selSql=$selSql"; + $result=@mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + $nMtAmount[$i] = $record[0]; + if($DEBUG) echo "
      $nMtAmount=$nMtAmount"; +} + +//display +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strThisPage"; +echo "
      "; +echo "

      Basic tariff statistics

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +for($i=0;$i<8;$i++){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +for($i=8;$i<16;$i++){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
      MO tariff IDTotal recordMt tariff IDTotal record
      $i$nMoAmount[$i]$i$nMtAmount[$i]
      $i$nMoAmount[$i]----
      + + + +
      +   +
      diff --git a/wxc2_omc/account/tariffList/tariffParam.php b/wxc2_omc/account/tariffList/tariffParam.php new file mode 100755 index 0000000..f9f7b53 --- /dev/null +++ b/wxc2_omc/account/tariffList/tariffParam.php @@ -0,0 +1,386 @@ + + + + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; +?> + + + +
      "> + + + + + +
      + Rent"; + ?> + + "; + for($i=0;$i<16;$i++){ + $m=($i<10?"0":"").$i; + if($m != $tariff_id){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + ?> +
      +
      + + + + + $strTariffRentID"; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $rows[rent_amount] = $rows[rent_amount]/$moneyPara; + if($moneyPara < 10){ + printf("", $rows[rent_amount]); + } + elseif($moneyPara < 100){ + printf("", $rows[rent_amount]); + } + else{ + printf("", $rows[rent_amount]); + } + } + }while($rows=mysqli_fetch_array($result)); + } + ?> +
      $strDescription$strTariffRentChargeType$strTariffRentChargeDate$strTariffRentChargeAmount
      $i--------
      $i$rows[description]"; + if($rows[rent_type]=='00'){ + echo "$strTariffRentAccordingToDate"; + }else{ + echo "$strTariffRentAccordingToPeriod"; + } + echo ""; + if($rows[rent_type]=='01'){ + echo "$rows[charge_date]"; + }else{ + echo "--"; + } + echo "%5.0f%5.1f%5.2f
      + + + + + + +
      "> + + + + + +
      + Service tariff"; + ?> + + "; + for($i=0;$i<16;$i++){ + $m=($i<10?"0":"").$i; + if($m != $tariff_id2){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + ?> +
      +
      + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + + $arr_editfieldAmount = array("cf_charge_amount","roaming_charge_amount","cc_charge_amount","cug_charge_amount","fav_charge_amount","fav_change_charge"); + $arr_editfieldUnit = array("cf_charge_unit","roaming_charge_unit","cc_charge_unit","cug_charge_unit","fav_charge_unit",""); + $arr_description = array($strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup,$strFav_call,$strFav_listedtion); + $arr_amount = array($rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount],$rows[fav_charge_amount],$rows[fav_change_charge]); + $arr_unit = array($rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit],$rows[fav_charge_unit],"----"); + for ($i=0;$i<6;$i++){ + echo ""; + echo ""; + if($moneyPara < 10){ + printf("", $arr_amount[$i]/$moneyPara); + } + elseif($moneyPara < 100){ + printf("", $arr_amount[$i]/$moneyPara); + } + else{ + printf("", $arr_amount[$i]/$moneyPara); + } + echo ""; + echo ""; + echo $tariffID; + } +?> +
      $strDescription$strTariffRentChargeAmount$strUnitChargingTimeSecond
      $arr_description[$i]%5.0f%5.1f%5.2f $arr_unit[$i]
      + + + + + +"; +if( FALSE == isset($discount_id) ){ + $discount_id = 00; +} +//select current discount id details from TABLE "pre_bill_discount" +$selSql = "SELECT * FROM $tableName WHERE discount_id=$discount_id ORDER BY $order"; +if($DEBUG) echo "selSql=$selSql
      "; +$selRes = mysqli_query($pubConn,$selSql); +$selRows = mysqli_fetch_array($selRes); +?> + + + + + +
      + + + + + +
      + Discount"; + ?> + + "; + for($i=0;$i<16;$i++){ + $m=($i<10?"0":"").$i; + if($m != $discount_id){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + ?> +
      +
      + + + + + + + + + + + + + + +"; + $hours=$selRows[hours]; + if(strlen($hours) < 2) $hours='0'.$hours; + if(strlen($hours+1) < 2){ + $next_hours='0'.($hours+1); + }else{ + $next_hours=$hours+1; + } + $mon=change2point($selRows[mon]/100); + $tue=change2point($selRows[tue]/100); + $wed=change2point($selRows[wed]/100); + $thu=change2point($selRows[thu]/100); + $fri=change2point($selRows[fri]/100); + $sat=change2point($selRows[sat]/100); + $sun=change2point($selRows[sun]/100); + $holiday=change2point($selRows[holiday]/100); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }while($selRows = @mysqli_fetch_array($selRes)); +?> +
      $hours:00:00 - $next_hours:00:00$mon$tue$wed$thu$fri$sat$sun$holiday
      + + + + + + +"; + echo ""; + echo ""; + echo "
      "; + echo "Holiday"; + echo "
      "; + echo ""; + echo ""; + echo ""; +?> + + + + + + + "; + $id=$rows[id]; + $month=omc_keep_length($rows[month],0,2); + $day=omc_keep_length($rows[day],0,2); + $showDate=$month."-".$day; + $rows[name]=$rows[name]?$rows[name]:'--'; + echo ""; + echo ""; + echo ""; + $i++; + }while($rows=mysqli_fetch_array($result)); + } + ?> +
      (mm-dd)
      $showDate$rows[name]
      + diff --git a/wxc2_omc/account/tariffPlan/def_bill_discount b/wxc2_omc/account/tariffPlan/def_bill_discount new file mode 100755 index 0000000..e00210c --- /dev/null +++ b/wxc2_omc/account/tariffPlan/def_bill_discount @@ -0,0 +1,768 @@ +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '00', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '01', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '02', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '03', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '04', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '05', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '06', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '07', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '08', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '09', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '10', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '11', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '12', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '13', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '14', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '15', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '16', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '17', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '18', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '19', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '20', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '21', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '22', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '23', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '24', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '25', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '26', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '27', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '28', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '29', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '30', '23', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '0', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '1', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '2', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '3', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '4', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '5', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '6', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '7', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '8', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '9', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '10', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '11', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '12', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '13', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '14', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '15', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '16', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '17', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '18', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '19', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '20', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '21', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '22', '100', '100', '100', '100', '100', '100', '100', '100'); +INSERT INTO PPS_DB.pre_bill_discount VALUES ( '31', '23', '100', '100', '100', '100', '100', '100', '100', '100'); diff --git a/wxc2_omc/account/tariffPlan/def_bill_sms b/wxc2_omc/account/tariffPlan/def_bill_sms new file mode 100755 index 0000000..d23f7cb --- /dev/null +++ b/wxc2_omc/account/tariffPlan/def_bill_sms @@ -0,0 +1,3200 @@ +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '0', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '0', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '0', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '0', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '1', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '1', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '1', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '1', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '2', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '2', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '2', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '2', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '3', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '3', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '3', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '3', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '4', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '4', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '4', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '4', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '5', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '5', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '5', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '5', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '6', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '6', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '6', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '6', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '7', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '7', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '7', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '7', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '8', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '8', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '8', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '8', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '9', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '9', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '9', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '9', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '10', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '10', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '10', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '10', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '11', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '11', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '11', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '11', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '12', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '12', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '12', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '12', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '13', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '13', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '13', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '13', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '14', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '14', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '14', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '14', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '15', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '15', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '15', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '15', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '16', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '16', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '16', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '16', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '17', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '17', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '17', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '17', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '18', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '18', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '18', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '18', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '19', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '19', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '19', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '19', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '20', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '20', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '20', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '20', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '21', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '21', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '21', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '21', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '22', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '22', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '22', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '22', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '23', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '23', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '23', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '23', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '24', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '24', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '24', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '24', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '25', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '25', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '25', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '25', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '26', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '26', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '26', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '26', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '27', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '27', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '27', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '27', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '28', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '28', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '28', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '28', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '29', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '29', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '29', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '29', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '30', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '30', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '30', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '30', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '31', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '31', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '31', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '31', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '32', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '32', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '32', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '32', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '33', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '33', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '33', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '33', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '34', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '34', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '34', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '34', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '35', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '35', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '35', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '35', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '36', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '36', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '36', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '36', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '37', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '37', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '37', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '37', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '38', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '38', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '38', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '38', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '39', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '39', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '39', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '39', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '40', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '40', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '40', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '40', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '41', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '41', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '41', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '41', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '42', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '42', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '42', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '42', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '43', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '43', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '43', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '43', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '44', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '44', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '44', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '44', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '45', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '45', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '45', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '45', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '46', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '46', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '46', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '46', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '47', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '47', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '47', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '47', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '48', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '48', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '48', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '48', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '49', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '49', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '49', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '49', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '50', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '50', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '50', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '50', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '51', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '51', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '51', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '51', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '52', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '52', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '52', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '52', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '53', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '53', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '53', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '53', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '54', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '54', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '54', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '54', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '55', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '55', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '55', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '55', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '56', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '56', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '56', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '56', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '57', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '57', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '57', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '57', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '58', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '58', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '58', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '58', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '59', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '59', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '59', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '59', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '60', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '60', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '60', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '60', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '61', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '61', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '61', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '61', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '62', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '62', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '62', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '62', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '1', '', '0', 'Default', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '2', '696', '0', 'local', '63', '00', '300', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '3', '690', '0', 'outside plmn', '63', '00', '200', '2'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '4', '696', '0', 'Local SMS Simulator', '63', '00', '20', '1'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '5', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '6', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '7', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '8', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '9', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '10', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '11', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '12', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '13', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '14', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '15', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '16', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '17', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '18', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '19', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '20', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '21', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '22', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '23', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '24', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '25', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '26', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '27', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '28', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '29', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '30', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '31', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '32', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '33', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '34', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '35', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '36', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '37', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '38', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '39', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '40', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '41', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '42', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '43', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '44', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '45', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '46', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '47', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '48', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '49', '0', '0', '', '63', '00', '0', '0'); +INSERT INTO PPS_DB.pre_bill_sms VALUES ( '50', '0', '0', '', '63', '00', '0', '0'); diff --git a/wxc2_omc/account/tariffPlan/def_comm_tariff b/wxc2_omc/account/tariffPlan/def_comm_tariff new file mode 100755 index 0000000..1e6380b --- /dev/null +++ b/wxc2_omc/account/tariffPlan/def_comm_tariff @@ -0,0 +1,64 @@ +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '2', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '3', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '4', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '5', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '6', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '7', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '8', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '9', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '10', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '11', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '12', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '13', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '14', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '15', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '16', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '17', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '18', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '19', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '20', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '21', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '22', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '23', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '24', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '25', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '26', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '27', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '28', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '29', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '30', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '31', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '32', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '33', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '34', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '35', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '36', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '37', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '38', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '39', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '40', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '41', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '42', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '43', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '44', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '45', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '46', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '47', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '48', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '49', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '50', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '51', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '52', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '53', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '54', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '55', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '56', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '57', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '58', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '59', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '60', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '61', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '62', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_comm_tariff VALUES ( '63', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); diff --git a/wxc2_omc/account/tariffPlan/def_gprs_tariff b/wxc2_omc/account/tariffPlan/def_gprs_tariff new file mode 100755 index 0000000..a235531 --- /dev/null +++ b/wxc2_omc/account/tariffPlan/def_gprs_tariff @@ -0,0 +1,64 @@ +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '0', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '1', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '2', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '3', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '4', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '5', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '6', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '7', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '8', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '9', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '10', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '11', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '12', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '13', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '14', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '15', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '16', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '17', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '18', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '19', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '20', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '21', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '22', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '23', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '24', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '25', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '26', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '27', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '28', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '29', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '30', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '31', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '32', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '33', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '34', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '35', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '36', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '37', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '38', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '39', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '40', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '41', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '42', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '43', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '44', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '45', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '46', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '47', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '48', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '49', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '50', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '51', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '52', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '53', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '54', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '55', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '56', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '57', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '58', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '59', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '60', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '61', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '62', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_gprs_tariff VALUES ( '63', '1', '0.0.0.0', '0', '0', '0', '0', '0', '0'); diff --git a/wxc2_omc/account/tariffPlan/def_mt_tariff b/wxc2_omc/account/tariffPlan/def_mt_tariff new file mode 100755 index 0000000..724181d --- /dev/null +++ b/wxc2_omc/account/tariffPlan/def_mt_tariff @@ -0,0 +1,64 @@ +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '00', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '01', '4', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '02', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '03', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '04', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '05', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '06', '4', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '07', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '08', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '09', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '10', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '11', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '12', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '13', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '14', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '15', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '16', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '17', '4', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '18', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '19', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '20', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '21', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '22', '4', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '23', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '24', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '25', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '26', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '27', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '28', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '29', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '30', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '31', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '32', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '33', '4', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '34', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '35', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '36', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '37', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '38', '4', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '39', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '40', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '41', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '42', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '43', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '44', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '45', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '46', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '47', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '48', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '49', '4', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '50', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '51', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '52', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '53', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '54', '4', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '55', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '56', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '57', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '58', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '59', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '60', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '61', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '62', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); +INSERT INTO PPS_DB.pre_mt_tariff VALUES ( '', 'Default', '63', '0', '00', '0', '60', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0'); diff --git a/wxc2_omc/account/tariffPlan/def_rent b/wxc2_omc/account/tariffPlan/def_rent new file mode 100755 index 0000000..d2aaf04 --- /dev/null +++ b/wxc2_omc/account/tariffPlan/def_rent @@ -0,0 +1,512 @@ +INSERT INTO PPS_DB.pre_rent VALUES ( '0', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '0', '02', 'aaa', '00', '00', '1'); +INSERT INTO PPS_DB.pre_rent VALUES ( '0', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '0', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '0', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '0', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '0', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '0', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '1', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '1', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '1', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '1', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '1', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '1', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '1', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '1', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '2', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '2', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '2', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '2', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '2', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '2', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '2', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '2', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '3', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '3', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '3', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '3', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '3', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '3', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '3', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '3', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '4', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '4', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '4', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '4', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '4', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '4', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '4', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '4', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '5', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '5', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '5', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '5', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '5', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '5', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '5', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '5', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '6', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '6', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '6', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '6', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '6', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '6', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '6', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '6', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '7', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '7', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '7', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '7', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '7', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '7', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '7', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '7', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '8', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '8', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '8', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '8', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '8', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '8', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '8', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '8', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '9', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '9', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '9', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '9', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '9', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '9', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '9', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '9', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '10', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '10', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '10', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '10', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '10', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '10', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '10', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '10', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '11', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '11', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '11', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '11', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '11', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '11', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '11', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '11', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '12', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '12', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '12', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '12', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '12', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '12', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '12', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '12', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '13', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '13', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '13', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '13', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '13', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '13', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '13', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '13', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '14', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '14', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '14', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '14', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '14', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '14', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '14', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '14', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '15', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '15', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '15', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '15', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '15', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '15', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '15', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '15', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '16', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '16', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '16', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '16', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '16', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '16', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '16', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '16', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '17', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '17', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '17', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '17', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '17', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '17', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '17', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '17', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '18', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '18', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '18', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '18', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '18', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '18', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '18', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '18', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '19', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '19', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '19', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '19', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '19', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '19', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '19', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '19', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '20', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '20', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '20', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '20', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '20', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '20', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '20', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '20', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '21', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '21', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '21', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '21', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '21', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '21', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '21', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '21', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '22', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '22', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '22', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '22', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '22', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '22', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '22', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '22', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '23', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '23', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '23', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '23', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '23', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '23', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '23', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '23', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '24', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '24', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '24', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '24', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '24', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '24', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '24', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '24', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '25', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '25', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '25', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '25', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '25', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '25', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '25', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '25', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '26', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '26', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '26', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '26', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '26', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '26', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '26', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '26', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '27', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '27', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '27', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '27', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '27', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '27', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '27', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '27', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '28', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '28', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '28', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '28', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '28', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '28', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '28', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '28', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '29', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '29', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '29', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '29', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '29', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '29', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '29', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '29', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '30', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '30', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '30', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '30', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '30', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '30', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '30', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '30', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '31', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '31', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '31', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '31', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '31', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '31', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '31', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '31', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '32', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '32', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '32', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '32', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '32', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '32', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '32', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '32', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '33', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '33', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '33', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '33', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '33', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '33', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '33', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '33', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '34', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '34', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '34', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '34', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '34', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '34', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '34', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '34', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '35', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '35', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '35', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '35', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '35', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '35', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '35', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '35', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '36', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '36', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '36', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '36', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '36', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '36', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '36', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '36', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '37', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '37', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '37', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '37', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '37', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '37', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '37', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '37', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '38', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '38', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '38', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '38', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '38', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '38', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '38', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '38', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '39', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '39', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '39', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '39', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '39', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '39', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '39', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '39', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '40', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '40', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '40', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '40', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '40', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '40', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '40', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '40', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '41', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '41', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '41', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '41', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '41', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '41', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '41', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '41', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '42', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '42', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '42', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '42', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '42', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '42', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '42', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '42', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '43', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '43', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '43', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '43', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '43', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '43', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '43', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '43', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '44', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '44', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '44', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '44', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '44', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '44', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '44', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '44', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '45', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '45', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '45', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '45', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '45', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '45', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '45', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '45', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '46', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '46', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '46', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '46', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '46', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '46', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '46', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '46', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '47', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '47', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '47', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '47', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '47', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '47', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '47', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '47', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '48', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '48', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '48', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '48', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '48', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '48', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '48', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '48', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '49', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '49', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '49', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '49', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '49', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '49', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '49', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '49', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '50', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '50', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '50', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '50', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '50', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '50', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '50', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '50', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '51', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '51', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '51', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '51', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '51', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '51', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '51', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '51', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '52', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '52', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '52', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '52', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '52', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '52', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '52', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '52', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '53', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '53', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '53', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '53', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '53', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '53', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '53', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '53', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '54', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '54', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '54', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '54', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '54', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '54', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '54', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '54', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '55', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '55', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '55', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '55', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '55', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '55', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '55', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '55', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '56', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '56', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '56', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '56', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '56', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '56', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '56', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '56', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '57', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '57', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '57', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '57', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '57', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '57', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '57', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '57', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '58', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '58', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '58', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '58', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '58', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '58', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '58', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '58', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '59', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '59', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '59', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '59', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '59', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '59', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '59', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '59', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '60', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '60', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '60', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '60', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '60', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '60', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '60', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '60', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '61', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '61', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '61', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '61', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '61', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '61', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '61', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '61', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '62', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '62', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '62', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '62', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '62', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '62', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '62', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '62', '08', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '63', '01', 'VMS', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '63', '02', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '63', '03', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '63', '04', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '63', '05', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '63', '06', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '63', '07', '', '00', '00', '0'); +INSERT INTO PPS_DB.pre_rent VALUES ( '63', '08', '', '00', '00', '0'); diff --git a/wxc2_omc/account/tariffPlan/gprsEdit.php b/wxc2_omc/account/tariffPlan/gprsEdit.php new file mode 100755 index 0000000..beaa3bc --- /dev/null +++ b/wxc2_omc/account/tariffPlan/gprsEdit.php @@ -0,0 +1,221 @@ + + + +
      + +record_id=$record_id"; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 + +if(strlen($_POST['set']) > 0){ + if ($mode == "edit"){ + $setSql="UPDATE $tableName + SET dest_ip= '$dest_ip', + charge_unit= '$charge_unit', + basic_fee= '$basic_fee', + min_charge_unit= '$min_charge_unit', + initial_adjustment = '$initial_adjustment', + cap_flag = '$cap_flag', + discount_id = '$discount_id' + WHERE record_id='$record_id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $setSql"; + $result= @mysqli_query($srcDataConn,$setSql); + echo mysqli_error($srcDataConn); + if($DEBUG) exit(); + echo " "; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$getEditSql="SELECT record_id,dest_ip,charge_unit,basic_fee,min_charge_unit,initial_adjustment,cap_flag,discount_id,tariff_id + FROM $tableName + WHERE record_id='$record_id' AND tariff_id='$tariffID'"; +//if($DEBUG) echo "
      $getEditSql"; +$resultEdit= @mysqli_query($srcDataConn,$getEditSql); +$rows= @mysqli_fetch_array($resultEdit); +echo mysqli_error($srcDataConn); + +/* +$getAddSql="SELECT id FROM $tableName"; +//if($DEBUG) echo "
      $getEditSql"; +$resultAdd= @mysqli_query($pubConn,$getAddSql); +$rowsAdd= @mysqli_fetch_array($resultAdd); +echo mysqli_error($pubConn); +*/ +?> + + + + +"; + echo ""; + echo ""; + echo "$strPageTitle"; + echo ""; + echo " "; + + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +?> + + + + + + "; + echo ""; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + $cap_flag_value=$rows[cap_flag]+0; + $cap_flag_label=array(0=>"Disable",1=>"Enable"); + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + ?> +
      + +
      ID$record_id
      Dest IP
      Charge unit(KB)
      Basic fee
      Minimum charge unit
      Initial adjustment
      Cap flag"; + echo ""; + echo "
      Discount ID
      + + + + +
      + +   +   +   +
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/account/tariffPlan/mmsEmailEdit.php b/wxc2_omc/account/tariffPlan/mmsEmailEdit.php new file mode 100755 index 0000000..aeebbac --- /dev/null +++ b/wxc2_omc/account/tariffPlan/mmsEmailEdit.php @@ -0,0 +1,188 @@ + + + +
      " method="POST"> + +record_id=$record_id"; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 +if(strlen($set) > 0){ + if ($mode == "edit"){ + $setSql="UPDATE $tableName + SET prefix= '$prefix', + call_type= '$call_type', + dest_name= '$dest_name', + discount_id = '$discount_id', + charge_fee = '$charge_fee' + WHERE email_id='$record_id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $setSql"; + $result= @mysqli_query($pubConn,$setSql); + echo mysqli_error($pubConn); + if($DEBUG) exit(); + echo " "; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$getEditSql="SELECT tariff_id,email_id,prefix,call_type,dest_name,discount_id,charge_fee,cap_flag + FROM $tableName + WHERE email_id='$record_id' AND tariff_id='$tariffID'"; +if($DEBUG) +echo "
      $getEditSql"; +$resultEdit= @mysqli_query($pubConn,$getEditSql); +$rows= @mysqli_fetch_array($resultEdit); +echo mysqli_error($pubConn); +?> + + +"; + echo ""; + echo ""; + echo "$strPageTitle"; + echo ""; + echo " "; + + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +//echo "
      ";
      +//print_r($rows);
      +//echo "
      "; + +?> + + + + + + "; + echo ""; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + echo ""; + + //prefix + echo ""; + echo ""; + echo ""; + echo ""; + + //call type + $call_type_value=$rows[call_type]+0; + $mms_email_call_type_label=array(4=>"Local call in",5=>"Trunk call in"); + echo ""; + echo ""; + echo ""; + echo ""; + + //dest name + echo ""; + echo ""; + echo ""; + echo ""; + + //discount_id + echo ""; + echo ""; + echo ""; + echo ""; + + //charge_fee + echo ""; + echo ""; + echo ""; + echo ""; + + //cap flag + $cap_flag_value=$rows[cap_flag]+0; + $cap_flag_label=array(0=>"Disable",1=>"Enable"); + echo ""; + echo ""; + echo ""; + echo ""; + + } + ?> +
      + +
      ID$record_id
      Prefix
      Call type"; + echo ""; + echo "
      Dest name
      Discount ID
      Charge fee
      Cap flag{$cap_flag_label[$cap_flag_value]} 
      + + + + +
      + +   +   +   +
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/account/tariffPlan/mmsRetrieveEdit.php b/wxc2_omc/account/tariffPlan/mmsRetrieveEdit.php new file mode 100755 index 0000000..dd9419e --- /dev/null +++ b/wxc2_omc/account/tariffPlan/mmsRetrieveEdit.php @@ -0,0 +1,188 @@ + + + +
      " method="POST"> + +record_id=$record_id"; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 +if(strlen($set) > 0){ + if ($mode == "edit"){ + $setSql="UPDATE $tableName + SET prefix= '$prefix', + call_type= '$call_type', + dest_name= '$dest_name', + discount_id = '$discount_id', + charge_fee = '$charge_fee' + WHERE mms_retrieve_id='$record_id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $setSql"; + $result= @mysqli_query($pubConn,$setSql); + echo mysqli_error($pubConn); + if($DEBUG) exit(); + echo " "; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$getEditSql="SELECT tariff_id,mms_retrieve_id,prefix,call_type,dest_name,discount_id,charge_fee,cap_flag + FROM $tableName + WHERE mms_retrieve_id='$record_id' AND tariff_id='$tariffID'"; +if($DEBUG) +echo "
      $getEditSql"; +$resultEdit= @mysqli_query($pubConn,$getEditSql); +$rows= @mysqli_fetch_array($resultEdit); +echo mysqli_error($pubConn); +?> + + +"; + echo ""; + echo ""; + echo "$strPageTitle"; + echo ""; + echo " "; + + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +//echo "
      ";
      +//print_r($rows);
      +//echo "
      "; + +?> + + + + + + "; + echo ""; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + echo ""; + + //prefix + echo ""; + echo ""; + echo ""; + echo ""; + + //call type + $call_type_value=$rows[call_type]+0; + $mms_retrieve_call_type_label=array(4=>"Local call in",5=>"Trunk call in"); + echo ""; + echo ""; + echo ""; + echo ""; + + //dest name + echo ""; + echo ""; + echo ""; + echo ""; + + //discount_id + echo ""; + echo ""; + echo ""; + echo ""; + + //charge_fee + echo ""; + echo ""; + echo ""; + echo ""; + + //cap flag + $cap_flag_value=$rows[cap_flag]+0; + $cap_flag_label=array(0=>"Disable",1=>"Enable"); + echo ""; + echo ""; + echo ""; + echo ""; + + } + ?> +
      + +
      ID$record_id
      Prefix
      Call type"; + echo ""; + echo "
      Dest name
      Discount ID
      Charge fee
      Cap flag{$cap_flag_label[$cap_flag_value]} 
      + + + + +
      + +   +   +   +
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/account/tariffPlan/mmsSendEdit.php b/wxc2_omc/account/tariffPlan/mmsSendEdit.php new file mode 100755 index 0000000..e1b89d1 --- /dev/null +++ b/wxc2_omc/account/tariffPlan/mmsSendEdit.php @@ -0,0 +1,252 @@ + + + +
      + + +record_id=$record_id"; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 +if(strlen($_POST['set']) > 0){ + if ($mode == "edit"){ + /*if($record_id == 1 || $record_id == 2) + { + $prefix="--"; + $dest_name="default"; + $mms_type=$record_id; + }*/ + $setSql="UPDATE $tableName + SET mms_type= '$mms_type', + prefix= '$prefix', + call_type= '$call_type', + dest_name= '$dest_name', + discount_id = '$discount_id', + charge_fee = '$charge_fee' + WHERE mms_send_id='$record_id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $setSql"; + $result= @mysqli_query($srcDataConn,$setSql); + echo mysqli_error($srcDataConn); + if($DEBUG) exit(); + echo " "; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$getEditSql="SELECT tariff_id,mms_send_id,mms_type,prefix,call_type,dest_name,discount_id,charge_fee,cap_flag + FROM $tableName + WHERE mms_send_id='$record_id' AND tariff_id='$tariffID'"; +if($DEBUG) +echo "
      $getEditSql"; +$resultEdit= @mysqli_query($srcDataConn,$getEditSql); +$rows= @mysqli_fetch_array($resultEdit); +echo mysqli_error($srcDataConn); +?> + + +"; + echo ""; + echo ""; + echo "$strPageTitle"; + echo ""; + echo " "; + + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +//echo "
      ";
      +//print_r($rows);
      +//echo "
      "; + +?> + + + + + + "; + echo ""; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + echo ""; + + //mms type + + $mms_type_value=$rows[mms_type]+0; + $mms_type_label=array(1=>"To mobile",2=>"To email"); + echo ""; + echo ""; + echo ""; + echo ""; + + //prefix + echo ""; + echo ""; + /*if($record_id == 1 || $record_id == 2) + echo ""; + else*/ + echo ""; + echo ""; + + //call type + $call_type_value=$rows[call_type]+0; + $call_type_label=array(0=>"Local call out",1=>"NDD",2=>"IDD"); + echo ""; + echo ""; + echo ""; + echo ""; + + //dest name + echo ""; + echo ""; + /*if($record_id == 1 || $record_id == 2) + echo ""; + else*/ + echo ""; + echo ""; + + //discount_id + echo ""; + echo ""; + echo ""; + echo ""; + + //charge_fee + echo ""; + echo ""; + echo ""; + echo ""; + + //cap flag + $cap_flag_value=$rows[cap_flag]+0; + $cap_flag_label=array(0=>"Disable",1=>"Enable"); + echo ""; + echo ""; + echo ""; + echo ""; + + } + ?> +
      + +
      ID$record_id
      MMS type"; + + /*if($record_id == 1 || $record_id == 2) + echo ""; + for($i=1;$i<=sizeof($mms_type_label);$i++) + { + if($mms_type_value==$i) + echo ""; + else + echo ""; + } + echo ""; + + echo "
      Prefix
      Call type"; + echo ""; + echo "
      Dest name
      Discount ID
      Charge fee
      Cap flag{$cap_flag_label[$cap_flag_value]} 
      + + + + +
      + +   +   +   +
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/account/tariffPlan/mttariff.php b/wxc2_omc/account/tariffPlan/mttariff.php new file mode 100755 index 0000000..48653be --- /dev/null +++ b/wxc2_omc/account/tariffPlan/mttariff.php @@ -0,0 +1,406 @@ + + + +
      "> +moneyPara = $moneyPara"; + +if($add_area){ + echo " "; + exit(); +} + +//编辑后保持对应tariff_id的页面 +if ($keep_id != 1){ + $tariff_id=isset($tariff_id)?$tariff_id:'00'; +} +else {$tariff_id=$return_tariff_id;} +if($DEBUG) {echo "
      keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} + +$where=" WHERE tariff_id=$tariff_id "; +//echo "
      where=$where"; +$str_sql ="SELECT count(*) FROM $table_name ".$where; +// echo "
      str_sql=$str_sql"; +$result=mysqli_query($srcDataConn,$str_sql); +$record = mysqli_fetch_array($result); +$number_of_records = $record[0]; + +$order = " ORDER BY $sort_field $sort_direction "; +$sel_sql ="SELECT * FROM $table_name ".$where.$order; +//echo "
      sel_sql=$sel_sql"; +$result = @mysqli_query($srcDataConn,$sel_sql); +$rows = @mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); + +?> + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; + echo ""; + + echo "$strResideZone: "; + $maxCosSql = " SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName = 'maxCOSNumber' "; + $maxCosRes = @mysqli_query($pubConn,$maxCosSql); + $maxCosRow = @mysqli_fetch_array($maxCosRes); + $maxCosNum = $maxCosRow[pubVarValue]; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + + + + + + + + + + + +
      + + + + "; + ?> + +   +
      + +"; +//没有纪录时,显示无记录提示 + if(!$rows) + { + echo "
       "; + echo "$strTariffNoRecords $tariff_id"."!"; + exit(); + } +?> + + + $strResideZone"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + //echo ""; + echo ""; + echo ""; + ?> + +"; + // echo ""; + if(''==$rows[bill_id]) + echo ""; + else + echo ""; + echo ""; + if($rows[call_type]==4) + echo ""; + elseif($rows[call_type]==5) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + //echo ""; + echo ""; + echo ""; + /* $base_fee=$rows[base_fee]/$moneyPara; + if($moneyPara < 10){ + printf("",$base_fee); + } + elseif($moneyPara < 100){ + printf("",$base_fee); + } + else{ + printf("",$base_fee); + } + + $long_distance_fee=$rows[long_distance_fee]/$moneyPara; + if($moneyPara < 10){ + printf("", $long_distance_fee); + } + elseif($moneyPara < 100){ + printf("", $long_distance_fee); + } + else{ + printf("", $long_distance_fee); + } + + $adjustment_fee=$rows[adjustment]/$moneyPara; + if($moneyPara < 10){ + printf("", $adjustment_fee); + } + elseif($moneyPara < 100){ + printf("", $adjustment_fee); + } + else{ + printf("", $adjustment_fee); + }*/ + echo ""; +}while($rows = mysqli_fetch_array($result)); +?> +
      $strChargingPrefix$strCountryDistrict$strCallType$strDiscountID$strUnitChargingTimeSecond$strFreeChargeUnit$strMinimumChargingUnit$strBasicFee($moneyPara)$strBasicLongDistance($moneyPara)$strBasicInitial($moneyPara)Tier Level
      $rows[tariff_id]--$rows[bill_id]$rows[area] Local call inTrunk call in---$rows[discount_id] $rows[unit_time]$rows[free_time]$rows[mini_time]$rows[base_fee]$rows[long_distance_fee]$rows[adjustment]$rows[tier_level]%5.0f%5.1f%5.2f%5.0f%5.1f%5.2f%5.0f%5.1f%5.2f
      + + + + +MMS Retrieve

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +$tableName="PPS_DB.pre_vas_mms_retrieve_tariff"; +$sql="select * from $tableName where tariff_id=$tariff_id order by mms_retrieve_id asc "; +$res=@mysqli_query($srcDataConn,$sql); +$num=@mysqli_num_rows($res); +$mms_retrieve_cap_flag_label=array(0=>"Disable",1=>"Enable"); +$mms_retrieve_call_type_label=array(4=>"Local call in",5=>"Trunk call in"); + +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + echo ""; + //ID + $mms_retrieve_id=$row[mms_retrieve_id]; + echo ""; + + //Prefix + echo ""; + + //Call type + echo ""; + + //Dest name + echo ""; + + //Discount ID + echo ""; + + //Charge fee + echo ""; + + //Cap flag + echo ""; + + echo ""; +} +//echo "tariff_id=$tariff_id
      "; +echo "
      IDPrefixCall typeDest nameDiscount IDCharge feeCap flag
      "; + echo "$mms_retrieve_id"; + echo ""; + if(trim($row[prefix]) == "") + echo "--"; + else + echo "{$row[prefix]}"; + echo ""; + echo "{$mms_retrieve_call_type_label[$row[call_type]]} "; + echo ""; + if(trim($row[dest_name]) == "") + echo "--"; + else + echo "{$row[dest_name]}"; + echo ""; + echo "{$row[discount_id]} "; + echo ""; + echo "{$row[charge_fee]} "; + echo ""; + echo "{$mms_retrieve_cap_flag_label[$row[cap_flag]]} "; + echo "
      "; + +?> + + + +MMS Email

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +$tableName="PPS_DB.pre_vas_mms_email_tariff"; +$sql="select * from $tableName where tariff_id=$tariff_id order by email_id asc "; +$res=@mysqli_query($srcDataConn,$sql); +$num=@mysqli_num_rows($res); +$email_cap_flag_label=array(0=>"Disable",1=>"Enable"); +$email_call_type_label=array(4=>"Local call in",5=>"Trunk call in"); + +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + echo ""; + //ID + $email_id=$row[email_id]; + echo ""; + + //Prefix + echo ""; + + //Call type + echo ""; + + //Dest name + echo ""; + + //Discount ID + echo ""; + + //Charge fee + echo ""; + + //Cap flag + echo ""; + + echo ""; +} +//echo "tariff_id=$tariff_id
      "; +echo "
      IDPrefixCall typeDest nameDiscount IDCharge feeCap flag
      "; + echo "$email_id"; + echo ""; + if(trim($row[prefix]) == "") + echo "--"; + else + echo "{$row[prefix]}"; + echo ""; + echo "{$email_call_type_label[$row[call_type]]} "; + echo ""; + if(trim($row[dest_name]) == "") + echo "--"; + else + echo "{$row[dest_name]}"; + echo ""; + echo "{$row[discount_id]} "; + echo ""; + echo "{$row[charge_fee]} "; + echo ""; + echo "{$email_cap_flag_label[$row[cap_flag]]} "; + echo "
      "; + +?> + + + +

      + + + diff --git a/wxc2_omc/account/tariffPlan/mttariffEdit.php b/wxc2_omc/account/tariffPlan/mttariffEdit.php new file mode 100755 index 0000000..deee36a --- /dev/null +++ b/wxc2_omc/account/tariffPlan/mttariffEdit.php @@ -0,0 +1,496 @@ + + + +
      "> +=300){ + echo ""; + echo " "; + exit(); + } +} + +if($mode == "add"){ + $tableTitle = "Add MT tariff"; +} +elseif($mode == "edit"){ + $tableTitle = "Edit MT tariff"; +} + +if(!$sort_field){ + $sort_field = 'bill_id'; //排序所依赖的字段名 +} +$sort_direction = 'ASC '; //排序顺序 +$moneyPara = getMoneyPara(); //显示的货币单位是最小货币单位的倍数 +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      "; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 +if(strlen($set) > 0){ + if($mode=="edit"){ + $setSql="UPDATE $tableName + SET area = '$District', + call_type='$call_type', + discount_id = '$discount_id', + unit_time = '$Unit_time', + free_time = '$Free_time', + mini_time = '$Min_unit', + adjustment = '$adjustment', + tier_level = '$tier_level', + tier_unit_0 = '{$tier_unit_0}', + base_fee_0 = '{$base_fee_0}', + long_distance_fee_0 = '{$long_distance_fee_0}', + tier_unit_1 = '{$tier_unit_1}', + base_fee_1 = '{$base_fee_1}', + long_distance_fee_1 = '{$long_distance_fee_1}', + tier_unit_2 = '{$tier_unit_2}', + base_fee_2 = '{$base_fee_2}', + long_distance_fee_2 = '{$long_distance_fee_2}' + WHERE bill_id='$id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $setSql"; + $result= @mysqli_query($pubConn,$setSql); + echo mysqli_error($pubConn); + if($DEBUG) echo"
      $listPageURL"; + if(0 == $DEBUG) echo " "; + } + if($mode=="add"){ + //检查区号和地区名是否输入 + if (strlen($DistrictID) < 1){ + echo ""; + echo " "; + exit(); + } + if (!$District){ + echo ""; + echo " "; + exit(); + } + + for($count=0;$count'9'){ if($DistrictID[$count]!='B'&&$DistrictID[$count]!='b'&&$DistrictID[$count]!='C'&&$DistrictID[$count]!='c'){ + echo ""; + echo " "; + exit(); + } + } + + } + + $setSql="INSERT INTO $tableName + (bill_id,tariff_id,area,call_type,discount_id,unit_time,free_time,mini_time,adjustment,tier_level,tier_unit_0,base_fee_0,long_distance_fee_0,tier_unit_1,base_fee_1,long_distance_fee_1,tier_unit_2,base_fee_2,long_distance_fee_2) + VALUES + ('$DistrictID','$tariff_id','$District','$call_type','$discount_id','$Unit_time','$Free_time','$Min_unit','$adjustment','$tier_level','$tier_unit_0','$base_fee_0','$long_distance_fee_0','$tier_unit_1','$base_fee_1','$long_distance_fee_1','$tier_unit_2','$base_fee_2','$long_distance_fee_2')"; + if($DEBUG) echo "
      setSql=$setSql"; + $result= @mysqli_query($pubConn,$setSql); + echo mysqli_error($pubConn); + echo " "; + } +} + +if(strlen($delete) > 0){ + $deleteSql="DELETE FROM $tableName + WHERE bill_id='$id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $deleteSql"; + $result= @mysqli_query($pubConn,$deleteSql); + echo mysqli_error($pubConn); + echo " "; +} + +//========================================================== +//输出并显示数据 +//========================================================== +$sel_sql ="SELECT * + FROM $tableName + WHERE bill_id='$id' AND tariff_id='$tariffID'"; +//echo "
      sel_sql=$sel_sql"; +$result = @mysqli_query($pubConn,$sel_sql); +$rows = @mysqli_fetch_array($result); + +echo mysqli_error($pubConn); +?> + + + + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo " "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; +?> +List +"; + echo " "; + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + + +"> + + + + + + "; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + echo ""; + + if('Default' == $rows[area]){ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo ""; + echo ""; + $arr_CallType = array("Local call in","Trunk call in"); + $length = sizeof($arr_CallType); + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + elseif ($mode == "add"){ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $arr_CallType = array("Local call in","Trunk call in"); + $length = sizeof($arr_CallType); + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + else { + exit(); + } +?> +
      + +
      $strResideZone$rows[tariff_id]
      $strChargingPrefix 
      $strCountryDistrict
      $strChargingPrefix$rows[bill_id]
      $strCountryDistrict
      $strCallType"; + echo ""; + echo "
      $strDiscountID
      $strUnitChargingTimeSecond
      $strFreeChargeUnit
      $strMinimumChargingUnit
      $strBasicInitial  $moneyPara
      Tier Level(0-2)
      Tier0 Unit
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      Tier1 Unit
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      Tier2 Unit
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      $strResideZone$tariff_id"; + /* + echo ""; + */ + $return_tariff_id = $tariff_id; //定义返回时的页面 + echo "
      $strChargingPrefix
      $strCountryDistrict
      $strCallType"; + echo ""; + $call_type = $call_type; + echo "
      $strDiscountID
      $strUnitChargingTimeSecond
      $strFreeChargeUnit
      $strMinimumChargingUnit
      $strBasicInitial  $moneyPara
      Tier Level  (0-2)
      Tier0 Unit
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      Tier1 Unit
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      Tier2 Unit
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      + + + + +
      +   +   +  "; + ?> + "; + echo ""; + } + else + { + echo ""; + } + }else + echo ""; + + ?> +
      + + + + \ No newline at end of file diff --git a/wxc2_omc/account/tariffPlan/planManage.php b/wxc2_omc/account/tariffPlan/planManage.php new file mode 100755 index 0000000..6af66eb --- /dev/null +++ b/wxc2_omc/account/tariffPlan/planManage.php @@ -0,0 +1,641 @@ + + + + '' + "; + if($DEBUG) echo"
      $getParamValueSql
      "; + $getResult=mysqli_query($objConn,$getParamValueSql); + echo mysqli_error($objConn); + if(mysqli_num_rows($getResult) > 0){ + $paramRows = mysqli_fetch_array($getResult); + + $paramValue = $paramRows[0]; + return($paramValue); + }else{ + return(-1); + } +} + +function setImpParamValue($sysId,$objIdStr,$instanceNo,$newValue) +{ + global $paramConf_table,$objConn; + $DEBUG=0; + + if($DEBUG) echo"
      sysId=$sysId"; + $tmpSysIdArr = explode('_',$sysId); + $sysTypeNo = $tmpSysIdArr[0]; + $sysNo = $tmpSysIdArr[1]; + $subSysNo = $tmpSysIdArr[2]; + + $paramDb = 'OBJ_'.$sysTypeNo; + if($DEBUG) echo"
      paramDb=$paramDb"; + //获取参数定义表的表名,根据oid取出参数定义 + $tmpObjArr = explode('.',$objIdStr); + $objWhereStr=''; + for($i=0;$i $setParamValueSql
      "; + $setResult=mysqli_query($objConn,$setParamValueSql); + echo mysqli_error($objConn); + if($setResult){ + return(1); + }else{ + return(-1); + } +}//end of function + +function putImpFile($ftpCon) +{ + global $dataDefArr; + for($j=0;$jPut file Failed"; + return(-1); + }else{ + echo "
      Put {$dataDefArr[$j][remoteFile]} OK"; + } + } + return(1); +} + +function delImpFile() +{ + global $dataDefArr; + for($j=0;$jplandate= $plan_year-$plan_month-$plan_day $plan_hour:$plan_minute:$plan_second"; +if ($DEBUG) echo "
      plan_remark=$plan_remark"; +$commDefArr[0][value] = $plan_year.$plan_month.$plan_day.$plan_hour.$plan_minute.$plan_second; +if ($DEBUG) echo "
      commDefArr[1][value]={$commDefArr[1][value]}"; + +//========================================================== +//数据处理 +//========================================================== + +if($_SERVER['REQUEST_METHOD'] == "POST"){ + echo "




      "; + $planStatTime= mktime($plan_hour, $plan_minute, $plan_second, $plan_month, $plan_day, $plan_year); + if ($DEBUG) echo "
      planStatTime=$planStatTime"; + $nowTime = time(); + if ($DEBUG) echo "
      nowTime=$nowTime"; + if($planStatTime >= ($nowTime + 10)){ + //导出各项计划费率文件 + for($i=0;$iselSql=$selSql"; + $selRes=mysqli_query($dbConn,$selSql); + echo mysqli_error($dbConn); + } + }else{ + echo "
      Plan start time must later 10 second than now!
      "; + echo "


      Back"; + exit(); + } + + //查找正在运行的,状态为正常的PPS系统,来导入费率参数 + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' + ORDER BY sysNo,subSysNo + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $ppsNum=mysqli_num_rows($getSysIdResult); + if($ppsNum <= 0){ + echo "Error:Can not find any PPS's IP in system list,Please ADD it!"; + delImpFile(); + exit(); + } + //顺次上载文件 + $impOkFlag=0; + for($i=0;$i<$ppsNum;$i++){ + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysName='PPS_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $dstSeverIp = $getSysIdRow[ip]; + if($DEBUG) echo "
      sysId = $sysId"; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + + echo "
      Try to ftp tariff files to $sysName($dstSeverIp) ......"; + flush(); + + /* close ftp + $ftpCon=@ftp_connect($dstSeverIp); + if($ftpCon < 1){ + echo "
      Connect Failed!"; + continue; + } + */ + + $connection=sftp_connect($dstSeverIp); + if($connection < 0){ + echo "
      Connect Failed!"; + continue; + } + + /* close ftp + if(!@ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + echo "
      Login Failed!"; + @ftp_quit($ftpCon); + continue; + } + */ + + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + if(!$key) + { + echo "
      Login Failed!"; + continue; + } + + /* close ftp + if(putImpFile($ftpCon)){ + $impOkFlag = 1; + } + @ftp_quit($ftpCon); + */ + + if(putImpFile($key)){ + $impOkFlag = 1; + } + + flush(); + } + //delImpFile(); + if($impOkFlag == 0){ + exit(); + } + + //设置参数 + echo "
      Try to send command to $sysTypeName ......"; + flush(); + + + //修改设备参数 + for($i=0;$isetImpParamValue($sysId,$objId,$instanceNo,$newValue)"; + //$chgResult = setSysParamValue($sysId,$objId,$instanceNo,$newValue); + $chgResult = setImpParamValue($sysId,$objId,$instanceNo,$newValue); + + if($chgResult != -1){ + //send set command + if($DEBUG) echo "
      sysCommSend($sysId,$nSetComm,$objId)"; + $commStr = sysCommSend($sysId,$nSetComm,$objId); + sleep(2); + } + //根据读回的参数,判断费率是否导入成功 + if($i == 1){ + $waitTime = 0; + $maxWaitTime= 5; + do{ + //获取导入费率命令执行状态 + $commStr = sysCommSend($sysId,$nGetComm,$objId); + $commResult = getImpParamValue($sysId,$objId,$instanceNo,'readValue'); + //echo "
      get value=$commResult in $waitTime"; + flush(); + switch($commResult){ + case '1': //wait process + echo "
      Import ok, wait process"; + break; + case '2': //in process + echo "
      In process"; + break; + case '3': //process OK + $waitTime = $maxWaitTime; + echo "
      Process OK"; + break; + case '4': //process Failed + $waitTime = $maxWaitTime; + echo "
      Process Failed"; + break; + default: + break; + } + if($commResult == 3 || $commResult == 5) + break; + $waitTime++; + sleep(2); + }while($waitTime < $maxWaitTime); + }//end of if($i == 1) + + echo "OK!"; + flush(); + }//end of for($i=0;$isysCommSend($sysId,$nSetComm,'2.5.4')"; + $commStr = sysCommSend($sysId,$nSetComm,'2.5.4'); + sleep(2); + if($DEBUG) echo "
      sysCommSend($sysId,$nSetComm,'2.5.3')"; + $commStr = sysCommSend($sysId,$nSetComm,'2.5.3'); + sleep(2); + } + + //插入到命令纪录表 + $sql=" REPLACE $tableName + SET + comm_status = '1', + take_affect_time = '$planStatTime', + operator = '$userInfo[ID]', + host_ip = '$userInfo[IP]', + request_time = CURRENT_TIMESTAMP, + finish_time = DEFAULT, + remark = '$plan_remark', + key_comm_id = '01' + "; + if ($DEBUG) echo "
      sql=$sql"; + $res=@mysqli_query($dbConn,$sql); + echo mysqli_error($dbConn); + + echo "
        << Return"; + exit(); +} + +$this_year=date("Y", mktime()); +$this_month=date("m", mktime()+24*60*60); +$this_day=date("d", mktime()); + +$next_year=$this_year+1; +$next_month=$this_month+1; +$next_day=date("d", mktime()+24*60*60); + +//========================================================== +//数据显示 +//========================================================== +?> + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> +

      " name="tariff_plan"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +   +YearMonthDate HourMinuteSecond
      + +- + +- + +  + +: + +: + +
          
      +
      + +"; +echo ""; +echo "$strStartTime"; +echo "$strSender"; +echo "$strSourceIP"; +echo "$strAppealTime"; +echo "$strRemark"; +echo ""; +echo ""; +do{ + $take_affect_time = date("Y-m-d H:i:s",$result_rows[take_affect_time]); + echo "$take_affect_time"; + echo "$result_rows[operator]"; + echo "$result_rows[host_ip]"; + echo "$result_rows[request_time]"; + echo "$result_rows[remark]  "; + echo ""; +}while($result_rows=mysqli_fetch_array($result)); +echo ""; +adjust_content_tail(); +?> + + + diff --git a/wxc2_omc/account/tariffPlan/planStop.php b/wxc2_omc/account/tariffPlan/planStop.php new file mode 100755 index 0000000..17a526d --- /dev/null +++ b/wxc2_omc/account/tariffPlan/planStop.php @@ -0,0 +1,82 @@ +$strOperateDatabaseSuccess please set parameter!"; + //---插入日志------ + $log_name = "Can Tarriff plan".$user_info["account"]; + insertLog("$log_name"); + //---------------- + echo "

      "; + echo "
      "; +}elseif($no_del){ + echo " "; +}else{ + echo "

      "; + // WHERE key_comm_id='$plan_id' + $sel_sql="SELECT * FROM $table_name"; + $result=mysqli_query($pubConn,$sel_sql); + $result_rows=mysqli_fetch_array($result); + $rows_num=mysqli_num_rows($result); + if($rows_num > 0){ +?> + + + $strNewTariffPlanStartTime"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo " "; + echo " "; + $take_affect_time = date("Y-m-d H:i:s",$result_rows[take_affect_time]); + echo ""; + //0/1=已处理/待处理 + $show_status=$result_rows[comm_status]?'waiting':'finish'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo " "; + echo " "; + echo ""; + echo ""; + echo " "; + echo "
      $strProcessStatus$strExecutionTime$strSender$strSourceIP$strAppealTime
      $take_affect_time$show_status$result_rows[finish_time]$result_rows[operator]$result_rows[host_ip]$result_rows[request_time]
      remark$result_rows[remark]  
      "; + echo "
      "; + echo "$strCancelThisPlan?"; + echo "    "; + echo "    "; + echo " "; + }//end if($rows_num > 0) +} +?> + + + diff --git a/wxc2_omc/account/tariffPlan/pre_vas_mms_email_tariff b/wxc2_omc/account/tariffPlan/pre_vas_mms_email_tariff new file mode 100755 index 0000000..a5654ce --- /dev/null +++ b/wxc2_omc/account/tariffPlan/pre_vas_mms_email_tariff @@ -0,0 +1,64 @@ +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '00', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '01', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '02', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '03', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '04', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '05', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '06', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '07', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '08', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '09', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '10', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '11', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '12', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '13', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '14', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '15', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '16', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '17', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '18', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '19', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '20', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '21', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '22', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '23', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '24', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '25', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '26', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '27', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '28', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '29', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '30', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '31', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '32', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '33', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '34', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '35', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '36', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '37', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '38', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '39', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '40', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '41', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '42', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '43', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '44', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '45', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '46', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '47', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '48', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '49', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '50', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '51', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '52', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '53', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '54', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '55', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '56', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '57', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '58', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '59', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '60', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '61', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '62', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_email_tariff VALUES ( '63', '1', '', '4', '', '00', '0', '0'); diff --git a/wxc2_omc/account/tariffPlan/pre_vas_mms_retrieve_tariff b/wxc2_omc/account/tariffPlan/pre_vas_mms_retrieve_tariff new file mode 100755 index 0000000..9ece683 --- /dev/null +++ b/wxc2_omc/account/tariffPlan/pre_vas_mms_retrieve_tariff @@ -0,0 +1,64 @@ +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '00', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '01', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '02', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '03', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '04', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '05', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '06', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '07', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '08', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '09', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '10', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '11', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '12', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '13', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '14', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '15', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '16', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '17', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '18', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '19', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '20', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '21', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '22', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '23', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '24', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '25', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '26', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '27', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '28', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '29', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '30', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '31', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '32', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '33', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '34', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '35', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '36', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '37', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '38', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '39', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '40', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '41', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '42', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '43', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '44', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '45', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '46', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '47', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '48', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '49', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '50', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '51', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '52', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '53', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '54', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '55', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '56', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '57', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '58', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '59', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '60', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '61', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '62', '1', '', '4', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_retrieve_tariff VALUES ( '63', '1', '', '4', '', '00', '0', '0'); diff --git a/wxc2_omc/account/tariffPlan/pre_vas_mms_send_tariff b/wxc2_omc/account/tariffPlan/pre_vas_mms_send_tariff new file mode 100755 index 0000000..11a1d80 --- /dev/null +++ b/wxc2_omc/account/tariffPlan/pre_vas_mms_send_tariff @@ -0,0 +1,4096 @@ +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '00', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '01', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '02', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '03', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '04', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '05', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '06', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '07', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '08', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '09', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '10', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '11', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '12', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '13', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '14', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '15', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '16', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '17', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '18', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '19', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '20', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '21', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '22', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '23', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '24', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '25', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '26', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '27', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '28', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '29', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '30', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '31', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '32', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '33', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '34', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '35', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '36', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '37', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '38', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '39', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '40', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '41', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '42', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '43', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '44', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '45', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '46', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '47', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '48', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '49', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '50', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '51', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '52', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '53', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '54', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '55', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '56', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '57', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '58', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '59', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '60', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '61', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '62', '64', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '1', '1', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '2', '2', '--', '0', 'default', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '3', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '4', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '5', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '6', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '7', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '8', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '9', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '10', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '11', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '12', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '13', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '14', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '15', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '16', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '17', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '18', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '19', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '20', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '21', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '22', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '23', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '24', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '25', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '26', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '27', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '28', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '29', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '30', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '31', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '32', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '33', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '34', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '35', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '36', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '37', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '38', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '39', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '40', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '41', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '42', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '43', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '44', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '45', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '46', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '47', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '48', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '49', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '50', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '51', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '52', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '53', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '54', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '55', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '56', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '57', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '58', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '59', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '60', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '61', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '62', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '63', '1', '', '0', '', '00', '0', '0'); +INSERT INTO PPS_DB.pre_vas_mms_send_tariff VALUES ( '63', '64', '1', '', '0', '', '00', '0', '0'); diff --git a/wxc2_omc/account/tariffPlan/tariffBasic.php b/wxc2_omc/account/tariffPlan/tariffBasic.php new file mode 100755 index 0000000..46cca45 --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffBasic.php @@ -0,0 +1,731 @@ + + + +"> +"Disable",1=>"Home PLMN Call",2=>"Other Network Call"); +$sm_cap_flag_label=array(0=>"Disable",1=>"Home PLMN SM",2=>"Other Network SM"); +//echo "
      moneyPara = $moneyPara"; + +if($add_area){ + echo " "; + exit(); +} + +//编辑后保持对应tariff_id的页面 +if ($keep_id != 1){ + $tariff_id=isset($tariff_id)?$tariff_id:'00'; +} +else {$tariff_id=$return_tariff_id;} +if($DEBUG) {echo "
      keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} +// + + +$where=" WHERE tariff_id=$tariff_id "; +//echo "
      where=$where"; +$str_sql ="SELECT count(*) FROM $table_name ".$where; +//echo "
      str_sql=$str_sql"; + +$result=mysqli_query($srcDataConn,$str_sql); +$record = mysqli_fetch_array($result); +$number_of_records = $record[0]; + +$order = " ORDER BY $sort_field $sort_direction "; +$sel_sql ="SELECT * FROM $table_name ".$where.$order; +//echo "
      sel_sql=$sel_sql"; +$result = @mysqli_query($srcDataConn,$sel_sql); +$rows = @mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); + +?> + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strThisPage"; + echo ""; + showHelp($helpId); + echo "
       "; + + echo ""; + + echo "$strResideZone: "; + $maxCosSql = " SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName = 'maxCOSNumber' "; + $maxCosRes = @mysqli_query($pubConn,$maxCosSql); + $maxCosRow = @mysqli_fetch_array($maxCosRes); + $maxCosNum = $maxCosRow[pubVarValue]; + echo ""; + + echo "
      "; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + + +MO basic tariff
      "; +?> + + + + + + + +
      + + + + "; + ?> +
      +

      + + +"; + echo ""; + echo "$strChargingPrefix"; + echo "$strCountryDistrict"; + echo "$strCallType"; + echo "$strDiscountID"; + echo "$strUnitChargingTimeSecond"; + echo "$strFreeChargeUnit"; + echo "$strMinimumChargingUnit"; + //echo "$strBasicFee($moneyPara)"; + //echo "$strBasicLongDistance($moneyPara)"; + echo "$strBasicInitial($moneyPara)"; + echo "$strTariffRentCapFlag"; + echo "Tier Level"; + + echo "Tier0 Unit"; + echo "$strBasicFee"; + echo "$strBasicLongDistance"; + echo "Tier1 Unit"; + echo "$strBasicFee"; + echo "$strBasicLongDistance"; + echo "Tier2 Unit"; + echo "$strBasicFee"; + echo "$strBasicLongDistance"; + + + echo ""; + + do{ + echo ""; + echo "$rows[bill_id]"; + echo "$rows[area] "; + if($rows[call_type]==0) + echo "Local call out"; + elseif($rows[call_type]==1) + echo "NDD"; + elseif($rows[call_type]==2) + echo "IDD"; + else + echo "---"; + + echo "$rows[discount_id]"; + echo "$rows[unit_time]"; + echo "$rows[free_time]"; + echo "$rows[mini_time]"; + //echo "$rows[base_fee]"; + //echo "$rows[long_distance_fee]"; + echo "$rows[adjustment]"; + echo "{$call_cap_flag_label[$rows[cap_flag]]}"; + echo "$rows[tier_level]"; + + echo "$rows[tier_unit_0]"; + echo "$rows[base_fee_0]"; + echo "$rows[long_distance_fee_0]"; + echo "$rows[tier_unit_1]"; + echo "$rows[base_fee_1]"; + echo "$rows[long_distance_fee_1]"; + echo "$rows[tier_unit_2]"; + echo "$rows[base_fee_2]"; + echo "$rows[long_distance_fee_2]"; + + /* $base_fee=$rows[base_fee]/$moneyPara; + if($moneyPara < 10){ + printf("%5.0f",$base_fee); + } + elseif($moneyPara < 100){ + printf("%5.1f",$base_fee); + } + else{ + printf("%5.2f",$base_fee); + } + + $long_distance_fee=$rows[long_distance_fee]/$moneyPara; + if($moneyPara < 10){ + printf("%5.0f", $long_distance_fee); + } + elseif($moneyPara < 100){ + printf("%5.1f", $long_distance_fee); + } + else{ + printf("%5.2f", $long_distance_fee); + } + + $adjustment_fee=$rows[adjustment]/$moneyPara; + if($moneyPara < 10){ + printf("%5.0f", $adjustment_fee); + } + elseif($moneyPara < 100){ + printf("%5.1f", $adjustment_fee); + } + else{ + printf("%5.2f", $adjustment_fee); + }*/ + echo ""; + }while($rows = mysqli_fetch_array($result)); +} +?> + + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      "; + +$sql="SELECT id,description,rent_type,charge_date,rent_amount + FROM $table_name + WHERE tariff_id=$tariff_id + ORDER by id"; +//echo $sql,$bill_db; +$result=@mysqli_query($srcDataConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Rent"; +echo "
      "; +echo "

      "; +?> + + + + $strTariffRentID"; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + /*$rows[rent_amount] = $rows[rent_amount]/$moneyPara; + if($moneyPara < 10){ + printf("", $rows[rent_amount]); + } + elseif($moneyPara < 100){ + printf("", $rows[rent_amount]); + } + else{ + printf("", $rows[rent_amount]); + }*/ + echo ""; + } + }while($rows=mysqli_fetch_array($result)); + } + ?> +
      $strDescription$strTariffRentChargeType$strTariffRentChargeDate$strTariffRentChargeAmount($moneyPara)
      $showi--------
      $showi$rows[description]"; + if($rows[rent_type]=='00'){ + echo "$strTariffRentAccordingToDate"; + }else{ + echo "$strTariffRentAccordingToPeriod"; + } + echo ""; + if($rows[rent_type]=='01'){ + echo "$rows[charge_date]"; + }else{ + echo "--"; + } + echo "$rows[rent_amount]"; + echo "%5.0f%5.1f%5.2f
      + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} + +$sql="SELECT id,prefix,call_type,area,discount_id,charge_amount,cap_flag + FROM $table_name + WHERE tariff_id=$tariff_id + ORDER by id"; +//echo $sql,$bill_db; +$result=@mysqli_query($srcDataConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); +?> +

      +"; + echo ""; + echo ""; + echo "SMS"; + echo ""; + echo ""; echo ""; + echo "

      "; + +?> + + + + $strTariffRentID"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "; + echo ""; + if("" == $rows[prefix]){ + $rows[prefix]="--"; + } + echo ""; + + if($rows[call_type]==0) + echo ""; + elseif($rows[call_type]==1) + echo ""; + elseif($rows[call_type]==2) + echo ""; + else + echo ""; + + if ($rows[area] == ''){ + $rows[area]='--'; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + /*$rows[charge_amount ] = $rows[charge_amount ]/$moneyPara; + if($moneyPara < 10){ + printf("", $rows[charge_amount]); + } + elseif($moneyPara < 100){ + printf("", $rows[charge_amount]); + } + else{ + printf("", $rows[charge_amount]); + }*/ + echo ""; + }while($rows=mysqli_fetch_array($result)); + } + ?> +
      $strChargingPrefixCall type$strCountryDistrict$strDiscountID$strTariffRentChargeAmount($moneyPara)$strTariffRentCapFlag
      $i $rows[prefix]Local call outNDDIDD--- $rows[area]$rows[discount_id]$rows[charge_amount]{$sm_cap_flag_label[$rows[cap_flag]]}%5.0f%5.1f%5.2f
      + + + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} + +$sql="SELECT record_id,dest_ip,charge_unit,basic_fee,min_charge_unit,initial_adjustment,cap_flag,discount_id + FROM $table_name + WHERE tariff_id=$tariff_id + ORDER by record_id"; +//echo $sql,$bill_db; +$result=@mysqli_query($srcDataConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); +?> +

      +"; + echo ""; + echo ""; + echo "GPRS"; + echo ""; + echo ""; echo ""; + echo "

      "; + +?> + + + + ID"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "Disable",1=>"Enable"); + if($rows && $result){ + do{ + $i++; + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }while($rows=mysqli_fetch_array($result)); + } + ?> +
      Dest IPCharge unit(KB)Basic feeMinimun charge unitInitial adjustmentCap FlagDiscount ID
      {$rows[record_id]}{$rows[dest_ip]} {$rows[charge_unit]} {$rows[basic_fee]} {$rows[min_charge_unit]} {$rows[initial_adjustment]} {$gprs_cap_flag_label[$rows[cap_flag]]} {$rows[discount_id]} 
      + + + + + + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} + +$sql="SELECT mms_send_id,mms_type,prefix,call_type,dest_name,discount_id,charge_fee,cap_flag + FROM $table_name + WHERE tariff_id=$tariff_id + ORDER by mms_send_id"; +//echo $sql,$bill_db; +$result=@mysqli_query($srcDataConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); +?> +

      +"; + echo ""; + echo ""; + echo "MMS Send"; + echo ""; + echo ""; echo ""; + echo "

      "; + +?> + + + + ID"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + "Disable",1=>"Enable"); +$mms_type_label=array(1=>"To mobile",2=>"To email"); + if($rows && $result){ + do{ + $i++; + echo ""; + echo ""; + + echo ""; + if(trim($rows[prefix])=="") + echo ""; + else + echo ""; + + if($rows[call_type]==0) + echo ""; + elseif($rows[call_type]==1) + echo ""; + elseif($rows[call_type]==2) + echo ""; + else + echo ""; + + if(trim($rows[dest_name])=="") + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + }while($rows=mysqli_fetch_array($result)); + } + echo "
      MMS typePrefixCall typeDest nameDiscount IDCharge feeCap flag
      {$rows[mms_send_id]}{$mms_type_label[$rows[mms_type]]} --{$rows[prefix]} Local call outNDDIDD-----{$rows[dest_name]} {$rows[discount_id]} {$rows[charge_fee]} {$mms_send_cap_flag_label[$rows[cap_flag]]} 
      "; + + ?> + + + + + + + + + + + + + +keep_id=$keep_id
      tariff_id=$return_tariff_id
      ";} +// + + +$where=" WHERE tariff_id=$tariff_id "; +$sql="SELECT * FROM $tableName".$where; +//echo $sql,$bill_db; +$result=@mysqli_query($srcDataConn,$sql); +$rows=@mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); +?> + +setSql=$setSql"; + mysqli_query($srcDataConn,$setSql); +} +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "
      Supplementary tariff
      "; +echo "
      "; +echo "

      "; +?> + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + + /* + $arr_editfieldAmount = array("cf_charge_amount","roaming_charge_amount","cc_charge_amount","cug_charge_amount","fav_charge_amount","fav_change_charge","cf_cug_charge_amount","cf_fav_charge_amount","cug_fav_charge_amount","cf_cug_fav_charge_amount"); + $arr_editfieldUnit = array("cf_charge_unit","roaming_charge_unit","cc_charge_unit","cug_charge_unit","fav_charge_unit","","cf_cug_charge_unit","cf_fav_charge_unit","cug_fav_charge_unit","cf_cug_fav_charge_unit"); + $arr_description = array($strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup,$strFav_call,$strFav_listedtion,$strCf_Cug_call,$strCf_Fav_call,$strCug_Fav_call,$strCf_Cug_Fav_call); + $arr_amount = array($rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount],$rows[fav_charge_amount],$rows[fav_change_charge],$rows[cf_cug_charge_amount],$rows[cf_fav_charge_amount],$rows[cug_fav_charge_amount],$rows[cf_cug_fav_charge_amount]); + $arr_unit = array($rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit],$rows[fav_charge_unit],"----",$rows[cf_cug_charge_unit],$rows[cf_fav_charge_unit],$rows[cug_fav_charge_unit],$rows[cf_cug_fav_charge_unit]); + */ + + $arr_editfieldAmount = array("cf_charge_amount","roaming_charge_amount","cc_charge_amount","cug_charge_amount","fav_charge_amount","fav_change_charge","cf_cug_charge_amount","cf_fav_charge_amount","cug_fav_charge_amount","cf_cug_fav_charge_amount","pool_account_change_charge","pool_call_amount","act_free_sms_charge","deact_free_sms_charge"); + $arr_editfieldUnit = array("cf_charge_unit","roaming_charge_unit","cc_charge_unit","cug_charge_unit","fav_charge_unit","","cf_cug_charge_unit","cf_fav_charge_unit","cug_fav_charge_unit","cf_cug_fav_charge_unit","","pool_call_unit","",""); + $arr_description = array($strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup,$strFav_call,"Friends and family number change fee",$strCf_Cug_call,$strCf_Fav_call,$strCug_Fav_call,$strCf_Cug_Fav_call,"Pool account change fee","Pool call","Active free SMS charge","Deactive free SMS charge"); + $arr_amount = array($rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount],$rows[fav_charge_amount],$rows[fav_change_charge],$rows[cf_cug_charge_amount],$rows[cf_fav_charge_amount],$rows[cug_fav_charge_amount],$rows[cf_cug_fav_charge_amount],$rows[pool_account_change_charge],$rows[pool_call_amount],$rows[act_free_sms_charge],$rows[deact_free_sms_charge]); + $arr_unit = array($rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit],$rows[fav_charge_unit],"----",$rows[cf_cug_charge_unit],$rows[cf_fav_charge_unit],$rows[cug_fav_charge_unit],$rows[cf_cug_fav_charge_unit],"----",$rows[pool_call_unit],"----","----"); + + + for ($i=0;$i<14;$i++){ + echo ""; + echo ""; + echo ""; + /*if($moneyPara < 10){ + printf("", $arr_amount[$i]/$moneyPara); + } + elseif($moneyPara < 100){ + printf("", $arr_amount[$i]/$moneyPara); + } + else{ + printf("", $arr_amount[$i]/$moneyPara); + }*/ + echo ""; + echo ""; + echo $tariffID; + } +?> +
      $strDescription$strTariffRentChargeAmount($moneyPara)$strUnitChargingTimeSecond
      $arr_description[$i]$arr_amount[$i]%5.0f%5.1f%5.2f $arr_unit[$i]
      + + + diff --git a/wxc2_omc/account/tariffPlan/tariffBasicEdit.php b/wxc2_omc/account/tariffPlan/tariffBasicEdit.php new file mode 100755 index 0000000..17c285a --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffBasicEdit.php @@ -0,0 +1,576 @@ + + + + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo " "; + + echo ""; + echo ""; + echo ""; + echo "
      "; +?> + List +"; + echo " "; + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$arr_mode=array("edit","add"); + +$maxMoPrefixNumCosSql = " SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName = 'maxMoPrefixNumPerCOS' "; +$maxMoPrefixNumCosRes = @mysqli_query($pubConn,$maxMoPrefixNumCosSql); +$maxMoPrefixNumCosRow = @mysqli_fetch_array($maxMoPrefixNumCosRes); +$maxMoPrefixNumCosNum = $maxMoPrefixNumCosRow[pubVarValue]; +//echo "maxMoPrefixNumCosNum=$maxMoPrefixNumCosNum
      "; + +if($mode == "add"){ + if($number_of_records>=$maxMoPrefixNumCosNum){ + echo ""; + echo " "; + exit(); + } +} + +if($mode == "add"){ + $tableTitle = "Add MO tariff"; +} +elseif($mode == "edit"){ + $tableTitle = "Edit MO tariff"; +} + +if(!$sort_field){ + $sort_field = 'bill_id'; //排序所依赖的字段名 +} +$sort_direction = 'ASC '; //排序顺序 +$moneyPara = getMoneyPara(); //显示的货币单位是最小货币单位的倍数 +$call_cap_flag_label=array(0=>"Disable",1=>"Home PLMN Call",2=>"Other Network Call"); +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      "; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 + +if(strlen($_REQUEST['set']) > 0){ + if($mode=="edit"){ + $setSql="UPDATE $tableName + SET area = '$District', + call_type='$call_type', + discount_id = $discount_id, + unit_time = $Unit_time, + free_time = $Free_time, + mini_time = $Min_unit, + adjustment = $adjustment, + cap_flag = $cap_flag, + tier_level = $tier_level, + tier_unit_0 = $tier_unit_0, + base_fee_0 = $base_fee_0, + long_distance_fee_0 = $long_distance_fee_0, + tier_unit_1 = $tier_unit_1, + base_fee_1 = $base_fee_1, + long_distance_fee_1 = $long_distance_fee_1, + tier_unit_2 = $tier_unit_2, + base_fee_2 = $base_fee_2, + long_distance_fee_2 = $long_distance_fee_2 + WHERE bill_id='$id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $setSql"; + $result= @mysqli_query($srcDataConn,$setSql); + echo mysqli_error($srcDataConn); + if($DEBUG) echo "
      $listPageURL"; + echo " "; + } + if($mode=="add"){ + //检查区号和地区名是否输入 + if (strlen($DistrictID) < 1){ + echo ""; + echo " "; + exit(); + } + if (!$District){ + echo ""; + echo " "; + exit(); + } + + for($count=0;$count'9'){ + if($DistrictID[$count]!='A'&&$DistrictID[$count]!='a'&&$DistrictID[$count]!='B'&&$DistrictID[$count]!='b'&&$DistrictID[$count]!='C'&&$DistrictID[$count]!='c'){ + echo ""; + echo " "; + exit(); + } + } + + } + + $setSql="INSERT INTO $tableName + (bill_id,tariff_id,area,call_type,discount_id,unit_time,free_time,mini_time,adjustment,cap_flag,tier_level,tier_unit_0,base_fee_0,long_distance_fee_0,tier_unit_1,base_fee_1,long_distance_fee_1,tier_unit_2,base_fee_2,long_distance_fee_2) + VALUES + ('$DistrictID','$tariff_id','$District','$call_type',$discount_id,$Unit_time,$Free_time,$Min_unit,$adjustment,$cap_flag,$tier_level,$tier_unit_0,$base_fee_0,$long_distance_fee_0,$tier_unit_1,$base_fee_1,$long_distance_fee_1,$tier_unit_2,$base_fee_2,$long_distance_fee_2)"; + if($DEBUG) echo "
      setSql=$setSql"; + + $result= @mysqli_query($srcDataConn,$setSql); + + echo mysqli_error($srcDataConn); + echo " "; + } +} + +if(strlen($_REQUEST['delete']) > 0){ + $deleteSql="DELETE FROM $tableName + WHERE bill_id='$id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $deleteSql"; + $result= @mysqli_query($srcDataConn,$deleteSql); + echo mysqli_error($srcDataConn); + echo " "; +} + +//========================================================== +//输出并显示数据 +//========================================================== +$sel_sql ="SELECT * + FROM $tableName + WHERE bill_id='$id' AND tariff_id='$tariffID'"; +//echo "
      sel_sql=$sel_sql"; +$result = @mysqli_query($srcDataConn,$sel_sql); +$rows = @mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); + +// echo "
      ";
      +// echo print_r($rows);
      +// echo "
      "; + +echo mysqli_error($srcDataConn); +?> + + + + + +
      " method="POST"> + + +"> + + + + + +"; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $arr_CallType = array("Local call out","NDD","IDD"); + $length = sizeof($arr_CallType); + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} +elseif ($mode == "add"){ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $arr_CallType = array("Local call out","NDD","IDD"); + $length = sizeof($arr_CallType); + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} +else { + exit(); +} +?> +
      + +
      $strResideZone$rows[tariff_id]
      $strChargingPrefix$rows[bill_id]
      $strCountryDistrict
      $strCallType"; + echo ""; + echo "
      $strDiscountID
      $strUnitChargingTimeSecond
      $strFreeChargeUnit
      $strMinimumChargingUnit
      $strBasicInitial  $moneyPara
      $strTariffRentCapFlag"; + echo ""; + echo "
      Tier Level  (0-2)
      Tier0 Units
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      Tier1 Units
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      Tier2 Units
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      $strResideZone$tariff_id"; + /* + echo ""; + */ + $return_tariff_id = $tariff_id; //定义返回时的页面 + echo "
      $strChargingPrefix
      $strCountryDistrict
      $strCallType"; + echo ""; + $call_type = $call_type; + echo "
      $strDiscountID
      $strUnitChargingTimeSecond
      $strFreeChargeUnit
      $strMinimumChargingUnit
      $strBasicInitial  $moneyPara
      $strTariffRentCapFlag"; + echo ""; + echo "
      Tier Level  (0-2)
      Tier0 Units
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      Tier1 Units
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      Tier2 Units
      $strBasicFee  $moneyPara
      $strBasicLongDistance  $moneyPara
      + + + + +
      +   +   +  "; + ?> + "; + echo ""; + } + else + { + echo ""; + } + ?> +
      +
      + + + diff --git a/wxc2_omc/account/tariffPlan/tariffDiscount.php b/wxc2_omc/account/tariffPlan/tariffDiscount.php new file mode 100755 index 0000000..6c5fc96 --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffDiscount.php @@ -0,0 +1,156 @@ + + + +
      +"; +if( FALSE == isset($discount_id) ){ + $discount_id = 00; +} +/* +//insert discount to table while the time segment is NULL +$countSql = "SELECT count(*) as total FROM $tbName WHERE discount_id=$discount_id"; +if($DEBUG) echo "countSql=$countSql
      "; +$countRes = mysqli_query($pubConn,$countSql); +$countRows = mysqli_fetch_array($countRes); +echo "countRows[total]=$countRows[total]
      "; +if($countRows[total]<24){ +} +exit(); +*/ +//select current discount id details from TABLE "pre_bill_discount" +$selSql = "SELECT * FROM $tbName WHERE discount_id=$discount_id ORDER BY $order"; +if($DEBUG) echo "selSql=$selSql
      "; +$selRes = mysqli_query($pubConn,$selSql); +$selRows = mysqli_fetch_array($selRes); + +?> + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; + echo ""; + + echo "Discount ID: "; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + + + + +
      + + + + + + + + + + + + + + +"; + $hours=$selRows[hours]; + if(strlen($hours) < 2) $hours='0'.$hours; + if(strlen($hours+1) < 2){ + $next_hours='0'.($hours+1); + }else{ + $next_hours=$hours+1; + } + $mon=change2point($selRows[mon]/100); + $tue=change2point($selRows[tue]/100); + $wed=change2point($selRows[wed]/100); + $thu=change2point($selRows[thu]/100); + $fri=change2point($selRows[fri]/100); + $sat=change2point($selRows[sat]/100); + $sun=change2point($selRows[sun]/100); + $holiday=change2point($selRows[holiday]/100); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }while($selRows = @mysqli_fetch_array($selRes)); +?> +
      $hours:00:00 - $next_hours:00:00$mon$tue$wed$thu$fri$sat$sun$holiday
      + + + diff --git a/wxc2_omc/account/tariffPlan/tariffDiscountEdit.php b/wxc2_omc/account/tariffPlan/tariffDiscountEdit.php new file mode 100755 index 0000000..3664ff5 --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffDiscountEdit.php @@ -0,0 +1,148 @@ + + + +0){ + $setSql="UPDATE $tableName + SET mon = '$mon', + tue = '$tue', + wed = '$wed', + thu = '$thu', + fri = '$fri', + sat = '$sat', + sun = '$sun', + holiday = '$holiday' + WHERE hours = '$hours' AND discount_id='$discount_id'"; + if($DEBUG) echo "
      $setSql"; + $result= @mysqli_query($pubConn,$setSql); + echo mysqli_error($pubConn); + echo " "; +} + +//========================================================== +//输出并显示数据 +//========================================================== +$getSql = "SELECT * + FROM $tableName + WHERE hours='$hours' AND discount_id='$discount_id'"; +if($DEBUG) echo "getSql=$getSql
      "; +$result=mysqli_query($pubConn,$getSql); +$rows = mysqli_fetch_array($result); +?> + + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo " "; + + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + +
      " method="POST"> + + + + + + + + + + + + + + + + + +"; +// $discount_id=$rows[discount_id]; + $hours=$rows[hours]; + if(strlen($hours) < 2) $hours='0'.$hours; + if(strlen($hours+1) < 2) + { + $next_hours='0'.($hours+1); + } + else + { + $next_hours=$hours+1; + } + $holiday=change2point($rows[holiday]/100); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + while($rows = @mysqli_fetch_array($result)); +?> + +
      + +
      $hours:00:00 - $next_hours:00:00 /100  /100  /100  /100  /100  /100  /100  /100 
      + + + + +
      +   +   + " class="button">  +
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/account/tariffPlan/tariffHoliday.php b/wxc2_omc/account/tariffPlan/tariffHoliday.php new file mode 100755 index 0000000..44fe2ff --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffHoliday.php @@ -0,0 +1,103 @@ + + + + + + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + /* +//没有纪录时,显示无记录提示 + if(!$rows){ + echo "$strNotFindRecord"; + exit(); + } + */ +?> + + + + + + + +
          + + "; + ?> +     + +   +
      + + + + + + + "; + $id=$rows[id]; + $month=omc_keep_length($rows[month],0,2); + $day=omc_keep_length($rows[day],0,2); + $showDate=$month."-".$day; + $rows[name]=$rows[name]?$rows[name]:'--'; + echo ""; + echo ""; + echo ""; + $i++; + }while($rows=mysqli_fetch_array($result)); + ?> +
      (mm-dd)
      $showDate$rows[name]
      + + + diff --git a/wxc2_omc/account/tariffPlan/tariffHolidayEdit.php b/wxc2_omc/account/tariffPlan/tariffHolidayEdit.php new file mode 100755 index 0000000..08e176d --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffHolidayEdit.php @@ -0,0 +1,200 @@ + + +
      " method="POST"> + 0){ +//修改原有记录 + if($mode=="edit"){ + $editSql="UPDATE $tableName + SET name = '$name' + WHERE month = '$month' + AND day = '$day'"; + if($DEBUG) echo "
      $editSql"; + $result= @mysqli_query($pubConn,$editSql); + echo mysqli_error($pubConn); + } +//添加新的记录 + if($mode=="add"){ + //检查是否有日期重复的项目 + $getSql="SELECT * FROM $tableName"; + $result=mysqli_query($pubConn,$getSql); + $rows=mysqli_fetch_array($result); + do{ + if ($DEBUG) echo "
      recordedMonth=$rows[month]
      recordedDay=$rows[day]"; + if ($rows[month]==$month && $rows[day]==$day){ + echo ""; + echo " "; + exit(); + } + }while($rows=mysqli_fetch_array($result)); + + $insertSql="INSERT INTO $tableName + (month,day,name) + VALUES + ('$month','$day','$name')"; + if($DEBUG) echo "
      $insertSql"; + if($DEBUG) echo "
      month=$month
      day=$day"; + $result= @mysqli_query($pubConn,$insertSql); + echo mysqli_error($pubConn); + } +echo " "; +} +//删除数据 +if(strlen($delete) > 0){ + $deleteSql="DELETE FROM $tableName + WHERE month = '$month' + AND day = '$day'"; + if($DEBUG) echo "
      $deleteSql"; + $result= @mysqli_query($pubConn,$deleteSql); + echo mysqli_error($pubConn); + echo " "; +} + +$sql="SELECT * + FROM $tableName + WHERE month='$month' + AND day='$day'"; +$result=mysqli_query($pubConn,$sql); +$rows=mysqli_fetch_array($result); +?> + + +"; + echo ""; + echo ""; + echo "$strThisPage"; + echo ""; + echo " "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; +?> +List    +"; +?> +Add    +"; + echo " "; + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + + +?> + + + + + + + + + + + + + + +
      + "; + echo ""; + } + + elseif($mode == "add"){ + echo ""; + echo " - "; + echo ""; + } + echo " (mm-dd)"; + ?> +
      + "; + ?> +
      + + + + +
      +   +   +   + "; + } + ?> +
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/account/tariffPlan/tariffRentEdit.php b/wxc2_omc/account/tariffPlan/tariffRentEdit.php new file mode 100755 index 0000000..08500ef --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffRentEdit.php @@ -0,0 +1,291 @@ + + +
      + +"; + echo ""; + echo ""; + echo "$strPageTitle"; + echo ""; + echo " "; + + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      id=$id"; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 +if(strlen($_REQUEST['set']) > 0){ + if ($mode == "edit"){ + $setSql="UPDATE $tableName + SET description = '$description', + rent_type = '$rent_type', + charge_date = '$rent_day', + rent_amount = '$Charge_amount' + WHERE id = '$id' AND tariff_id='$tariffID'"; + if(1) echo "
      $setSql"; + $result= @mysqli_query($srcDataConn,$setSql); + echo mysqli_error($srcDataConn); + if($DEBUG) exit(); + echo " "; + } + if ($mode == "add"){ + $setSql="INSERT INTO $tableName + (id,description,rent_type,charge_date,rent_amount) + VALUES + ('$rent_id','$description','$rent_type','$rent_day','$charge_amount')"; + if($DEBUG) echo "
      setSql=$setSql"; + $result= @mysqli_query($srcDataConn,$setSql); + echo mysqli_error($srcDataConn); + if($DEBUG) exit(); + echo " "; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$getEditSql="SELECT id,description, rent_type, charge_date,rent_amount + FROM $tableName + WHERE id = '$id' AND tariff_id='$tariffID'"; +if($DEBUG) echo "
      $getEditSql"; +$resultEdit= @mysqli_query($srcDataConn,$getEditSql); +$rows= @mysqli_fetch_array($resultEdit); +echo mysqli_error($srcDataConn); + +$getAddSql="SELECT id + FROM $tableName"; +//if($DEBUG) echo "
      $getEditSql"; +$resultAdd= @mysqli_query($srcDataConn,$getAddSql); +$rowsAdd= @mysqli_fetch_array($resultAdd); +echo mysqli_error($srcDataConn); +?> + + + + + + + + + "; + echo ""; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + + echo ""; + + echo ""; + echo ""; + if(1==$id){ + echo ""; + echo ""; + } + else + echo ""; + echo ""; + + echo ""; + echo ""; + $arr_RentType = array("Every day","Every month"); + $length = sizeof($arr_RentType); + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + elseif ($mode == "add"){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $arr_RentType = array("Every day","Every month"); + $length = sizeof($arr_RentType); + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + ?> +
      + +
      $strTariffRentID$id
      $strDescription$rows[description]
      $strTariffRentChargeType"; + echo ""; + echo "
      $strTariffRentChargeDate"; + if ($rent_type =='1') + { + echo ""; + } + elseif ($rent_type == '0'){ + echo "--"; + } + echo "
      $strTariffRentChargeAmount $moneyPara 
      $strTariffRentID$id
      $strTariffRentChargeType"; + echo ""; + echo "
      $strTariffRentChargeDate"; + if ($rent_type=='1'){ + echo ""; + } + elseif ($rent_type=='0'){ + echo "--"; + } + else {echo "--";} + echo "
      $strDescription
      $strTariffRentChargeAmount $moneyPara 
      + + + + +
      + +   +   +   + +
      +
      + + + diff --git a/wxc2_omc/account/tariffPlan/tariffServicesEdit.php b/wxc2_omc/account/tariffPlan/tariffServicesEdit.php new file mode 100755 index 0000000..ea9614e --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffServicesEdit.php @@ -0,0 +1,159 @@ + + + +"; + +$strPageTitle=$strTitleAdvanced.$strTitleSpace."PPS".$strTitleSpace.$strCurrentTariff.$strTitleSpace."Multiple services"; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 +if(strlen($_POST['set']) > 0){ + if (strlen($arr_editfieldUnit)>0){ + $strSqlUpdate = $arr_editfieldAmount."='$amount',".$arr_editfieldUnit."='$unit'"; + } + else{ + $strSqlUpdate = $arr_editfieldAmount."='$amount'"; + } + if ($DEBUG) echo "
      strSqlUpdate:$strSqlUpdate"; + if ($DEBUG) echo "
      arr_editfieldUnit:$arr_editfieldUnit"; + $where =" WHERE tariff_id=$tariffID"; + $selSql ="Select count(*) FROM $tableName".$where; + if($DEBUG) echo "
      $selSql"; + $result = @mysqli_query($srcDataConn,$selSql); + $rows =mysqli_fetch_array($result); + $rowsNum=$rows[0]; + if($DEBUG) echo "
      rowsNum=$rows[0]"; + if($rowsNum){ + $setSql="UPDATE $tableName + SET $strSqlUpdate $where"; + }else{ + $setSql="REPLACE $tableName + SET $strSqlUpdate $where"; + } + if($DEBUG) echo "
      setSql=$setSql
      "; + $result= @mysqli_query($srcDataConn,$setSql); + echo mysqli_error($srcDataConn); + if(!$DEBUG){ + echo " "; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$getSql="SELECT * FROM $tableName WHERE tariff_id='$tariffID'"; +//echo $getSql; +$result=mysqli_query($srcDataConn,$getSql); +$rows=mysqli_fetch_array($result); +echo mysqli_error($srcDataConn); +?> + + +"; + echo ""; + echo ""; + echo "$strPageTitle"; + echo ""; + echo " "; + + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +?> + +
      +" method="POST"> + +"; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + if (strlen($arr_editfieldUnit)>0){ + echo ""; + } + else{ + echo ""; + } + echo ""; +?> +
      Edit services
      $strDescription$description
      $strTariffRentChargeAmount  $moneyPara
      $strUnitChargingTimeSecond--
      + + + + +
      + +   +   + +
      + + +
      + \ No newline at end of file diff --git a/wxc2_omc/account/tariffPlan/tariffSmsEdit.php b/wxc2_omc/account/tariffPlan/tariffSmsEdit.php new file mode 100755 index 0000000..21bb54f --- /dev/null +++ b/wxc2_omc/account/tariffPlan/tariffSmsEdit.php @@ -0,0 +1,255 @@ + + + +
      + +id=$id"; + +//========================================================== +//数据处理 +//========================================================== +//保存修改的变量 +if(strlen($_POST['set']) > 0){ + echo "$mode"; + if ($mode == "edit"){ + $setSql="UPDATE $tableName + SET prefix= '$prefix', + call_type= '$call_type', + area= '$area', + discount_id= '$discount_id', + charge_amount = '$charge_amount', + cap_flag = '$cap_flag' + WHERE id='$id' AND tariff_id='$tariffID'"; + if($DEBUG) echo "
      $setSql"; + $result= @mysqli_query($srcDataConn,$setSql); + echo mysqli_error($srcDataConn); + if($DEBUG) exit(); + echo " "; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +$getEditSql="SELECT id,prefix,call_type,area,discount_id,charge_amount,cap_flag + FROM $tableName + WHERE id='$id' AND tariff_id='$tariffID'"; +//if($DEBUG) echo "
      $getEditSql"; +$resultEdit= @mysqli_query($srcDataConn,$getEditSql); +$rows= @mysqli_fetch_array($resultEdit); +echo mysqli_error($srcDataConn); + +$getAddSql="SELECT id + FROM $tableName"; +//if($DEBUG) echo "
      $getEditSql"; +$resultAdd= @mysqli_query($srcDataConn,$getAddSql); +$rowsAdd= @mysqli_fetch_array($resultAdd); +echo mysqli_error($srcDataConn); +?> + + + + +"; + echo ""; + echo ""; + echo "$strPageTitle"; + echo ""; + echo " "; + + echo ""; + echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +?> + + + + + + "; + echo ""; + echo ""; + echo ""; + $return_tariff_id = $rows[tariff_id]; //定义返回时的页面 + echo ""; + + if(1 == $id){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $arr_CallType = array("Local call out","NDD","IDD"); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $call_type=$rows[call_type]-0; + $arr_CallType = array("Local call out","NDD","IDD"); + $length = sizeof($arr_CallType); + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + $cap_flag_value=$rows[cap_flag]+0; + $cap_flag_label=array(0=>"Disable",1=>"Home PLMN SM",2=>"Other Network SM"); + echo ""; + echo ""; + echo ""; + echo ""; + + } + ?> +
      + +
      $strTariffRentID$id
      $strChargingPrefix
      Call type
      $strCountryDistrict
      $strChargingPrefix
      Call type"; + echo ""; + echo "
      $strCountryDistrict
      $strDiscountID
      $strTariffRentChargeAmount $moneyPara 
      $strTariffRentCapFlag"; + echo ""; + echo "
      + + + + +
      + +   +   +   +
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/configuration/bssomc/] b/wxc2_omc/configuration/bssomc/] new file mode 100755 index 0000000..9ab3cff --- /dev/null +++ b/wxc2_omc/configuration/bssomc/] @@ -0,0 +1,316 @@ +0 AND Object_Name='$name[1]'"; + if ($debug) echo "$sqlstring
      "; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $row = mysqli_fetch_row($res) ) + { + list($parameters[],$attribute_type[]) = $row; + } + mysql_free_result($res); + + $sqlstring = "SELECT " . join(",",$parameters) . " FROM $tablename WHERE bssid=$bssid AND ObjectId='$objectid'"; +} + +/* + * Create NMI Set Command for paramter upload + */ +function create_nmi_command($db,$sqlstring,$parameters,$attribute_type, &$nmicommand) +{ + if ($debug) echo "$sqlstring
      "; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + $value = mysqli_fetch_row($res); + mysql_free_result($res); + $nmicommand = "set"; + for ($i=0;$i"; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid BssFunc",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + if ($debug) echo "==) set DownLoadInProgress=1" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"set DownLoadInProgress=1",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + + $objectlist = Array( + "Card.0.10", + "Bsc.0", + "AIf.0", + "ALinkSet.0.0", + "ALink.0.0.0" + ); + $tablenamelist = Array( + "OMCR_ClockMod", + "OMCR_Bsc", + "OMCR_AIf", + "OMCR_ALinkSet", + "OMCR_ALink" + ); + + $sqlstring = "SELECT ObjectId FROM OMCR_BSSTREE WHERE bssid=$bssid AND Presence=1 AND ObjectId='ALink.0.0.1'"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + if (list($row) = mysqli_fetch_row($res)) + { + if ($debug) echo "==) oid ALinkSet.0.0" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid ALinkSet.0.0",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + if ($debug) echo "==) create ALink 1" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"create ALink 1",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + $objectlist = array_merge($objectlist, Array ( "ALink.0.0.1")); + $tablenamelist = array_merge($tablenamelist, Array("OMCR_ALink")); + + } + + $sqlstring = "SELECT ObjectId FROM OMCR_BSSTREE WHERE bssid=$bssid AND Presence=1 AND ObjectId REGEXP 'Card.0.[1-8]$'"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $e1trmod_id_list = null; + while ( list($row) = mysqli_fetch_row($res) ) + { + $id = explode(".",$row); + $e1trmod_id_list[] = $id[2]; + } + //echo "==) oid Shelf.0" . "
      "; + //$retval = send_nmicommand($db,$bssid,"oid Shelf.0",$resultcode, $responsecode,$response,$debug); + //if (($retval != 0) || ($resultcode[0] != 0)) + // return (set_download_in_progress_zero($db,$bssid,-1)); + //flush(); + + for ($i=0; $i"; + //$retval = send_nmicommand($db,$bssid,"create E1trmod $e1trmod_id_list[$i]",$resultcode, $responsecode,$response,$debug); + //if (($retval != 0) || ($resultcode[0] != 0)) + // return (set_download_in_progress_zero($db,$bssid,-1)); + //flush(); + } + + for ($i=0; $i"; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid $objectid",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + create_sql_string_from_meta_table($db,$bssid,$objectid,$tablename,$sqlstring,$parameters,$attribute_type); + create_nmi_command($db,$sqlstring,$parameters,$attribute_type,$nmicommand); + if ($debug) echo "==) $nmicommand" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"$nmicommand",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + } + + /********************************************* + * For each BtsMgr, download parameters + *********************************************/ + $sqlstring = "SELECT ObjectId FROM OMCR_BSSTREE WHERE bssid=$bssid AND Presence=1 AND ObjectId Like 'BtsMgr.%'"; + if ($debug) echo "$sqlstring
      \n"; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + $btsmgr_list=null; + while ( list($objectid) = mysqli_fetch_row($res) ) + { + $id = explode(".",$objectid); + $btsmgr_list[] = $id[1]; + } + mysql_free_result($res); + + for ($i=0; $i"; + if ($debug) echo "==) oid BssFunc" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid BssFunc",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + if ($debug) echo "==) create BtsMgr $btsid" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"create BtsMgr $btsid",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + //echo "==) oid BtsMgr_Shelf.$btsid.0" . "
      "; + //$retval = send_nmicommand($db,$bssid,"oid BtsMgr_Shelf.$btsid.0",$resultcode, $responsecode,$response,$debug); + //if (($retval != 0) || ($resultcode[0] != 0)) + // return (set_download_in_progress_zero($db,$bssid,-1)); + //flush(); + + + /************************* + * Create E1TrMod + *************************/ + $sqlstring = "SELECT ObjectId FROM OMCR_BSSTREE WHERE bssid=$bssid AND Presence=1 AND ObjectId REGEXP 'BtsMgr_Shelf_Card.$btsid.0.[1-8]$'"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $card_id_list = null; + while ( $row = mysqli_fetch_row($res) ) + { + list($card_list) = $row; + $id = explode(".",$card_list); + $card_id_list[] = $id[3]; + } + mysql_free_result($res); + + for ($i=0; $i"; else echo "
      ."; + $retval = send_nmicommand($db,$bssid,"oid BtsMgr_Shelf.$btsid.0",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + if ($card_id_list[$i] == 1) + { + $objectlist = array_merge($objectlist, + Array ( "BtsMgr_Shelf_Card_Port.$btsid.0.$card_id_list[$i].0", + "BtsMgr_Shelf_Card_Port.$btsid.0.$card_id_list[$i].1") + ); + $tablenamelist = array_merge($tablenamelist, Array("OMCR_E1port", "OMCR_E1port")); + + if ($debug) echo "==) create E1trmod $card_id_list[$i]" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"create E1trmod $card_id_list[$i]",$resultcode, $responsecode,$response,$debug); + } + else + { + $objectlist = array_merge($objectlist, + Array ( "Trx.$btsid.0.$card_id_list[$i]", + "RCarrier.$btsid.0.$card_id_list[$i]", + "TrxCh.$btsid.0.$card_id_list[$i].0", + "TrxCh.$btsid.0.$card_id_list[$i].1", + "TrxCh.$btsid.0.$card_id_list[$i].2", + "TrxCh.$btsid.0.$card_id_list[$i].3", + "TrxCh.$btsid.0.$card_id_list[$i].4", + "TrxCh.$btsid.0.$card_id_list[$i].5", + "TrxCh.$btsid.0.$card_id_list[$i].6", + "TrxCh.$btsid.0.$card_id_list[$i].7") + ); + $tablenamelist = array_merge($tablenamelist, + Array ( "OMCR_Trx", "OMCR_RCarrier", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh") + ); + + if ($debug) echo "==) create TrxMod $card_id_list[$i]" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"create TrxMod $card_id_list[$i]",$resultcode, $responsecode,$response,$debug); + } + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + } + + for ($i=0; $i"; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid $objectid",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + create_sql_string_from_meta_table( + $db,$bssid,$objectid,$tablename,$sqlstring,$parameters,$attribute_type); + create_nmi_command($db,$sqlstring,$parameters,$attribute_type,$nmicommand); + if ($debug) echo "==) $nmicommand" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"$nmicommand",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,-1)); + flush(); + } + } + if ($debug) echo "==) oid BssFunc" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid BssFunc",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); + if ($debug) echo "==) set DownLoadInProgress=0" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"set DownLoadInProgress=0",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); + + return 0; +} + +?> diff --git a/wxc2_omc/configuration/bssomc/adjhand.inc b/wxc2_omc/configuration/bssomc/adjhand.inc new file mode 100755 index 0000000..386d5eb --- /dev/null +++ b/wxc2_omc/configuration/bssomc/adjhand.inc @@ -0,0 +1,44 @@ + "行数", + cellname => "小区名称", + mcc => "移动国家代码", + mnc => "移动网络代码", + cellid => "小区识别码", + lac => "位置区域代码", + bcch => "BCCH", + bsic => "基站识别代码", + neighbortype=> "相邻小区类别", + celltype => "小区类别", + control => "控制", + noneighbor => "没有相邻小区", + delete => "删除", + modify => "编辑", + activeonly => "DEDICATED MODE ONLY", + activeidle => "DEDICATED & IDLE MODE", + idleonly => "IDLE MODE ONLY", + addneighbor => "添加相邻小区", + selneighbor => "选择相邻小区" + ); +$engnamearray = Array( + rowno => "NO.", + cellname => "NAME", + mcc => "MCC", + mnc => "MNC", + cellid => "CELL ID", + lac => "LAC", + bcch => "BCCH", + bsic => "BSIC", + neighbortype=> "NEIGHBOUR TYPE", + celltype => "Cell Type", + control => "CONTROL", + noneighbor => "No Neighbour found", + delete => "DELETE", + modify => "MODIFY", + activeonly => "DEDICATED MODE ONLY", + activeidle => "DEDICATED & IDLE MODE", + idleonly => "IDLE MODE ONLY", + addneighbor => "Add Neighbor Cell", + selneighbor => "Select Neighbor Cell" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/adjhand.php b/wxc2_omc/configuration/bssomc/adjhand.php new file mode 100755 index 0000000..3553a27 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/adjhand.php @@ -0,0 +1,190 @@ + + + + + + + + +\n"; + echo "\n"; + exit(); +} + +/************************************************ + * Retrieve the Bts Manager ID from object ID + * AdjHand.11.0.12 --substr--> 11.0.12 --> 11 + ************************************************/ +$btsmgrid = substr($objectid,8); +if ($btsmgrid[1] == '.') +{ + $btsmgrid=substr($btsmgrid,0,1); +} +else if ($btsmgrid[2] == '.') +{ + $btsmgrid=substr($btsmgrid,0,2); +} +else +{ + echo strlen($objectid) . ":Error Object ID:" . $objectid . "\n"; + return 0; +} + + include("adjhand.inc"); + include("login_parm.inc"); + $db = mysql_connect($hostname, $username, $password); + mysql_select_db($dbname,$db); + echo "=)AdjHand.$btsmgrid.0.*"; + echo "
      \n"; + +if (!isset($modified_data)) +{ + /************************************************ + * Step 1: Display the present neighbor list + ************************************************/ + + /************************************************ + * Generate the Neighbor cell list from SQL DB + ************************************************/ + $sqlstring = "select Label,CellGlobalIdentityLaiMcc,CellGlobalIdentityLaiMnc," . + "LocationAreaCodes,CellGlobalIdentityCi,BcchFrequency,BsIdentityCode," . + "NeighbourType,ObjectId from OMCR_AdjHand " . + "where bssid=$bssid and BcchFrequency<>-1 and CellGlobalIdentityLaiMcc<>0 " . + "and CellGlobalIdentityLaiMnc<>0 and CellGlobalIdentityCi<>0 " . + "and LocationAreaCodes<>0 and ObjectId LIKE 'AdjHand.$btsmgrid.0.%' " . + "ORDER BY (0+SUBSTRING_INDEX(ObjectId,'.',-1))"; + //echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $no_of_fields=mysql_num_fields($result); + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $num=0; + while ( $row = mysqli_fetch_row($result) ) + { + $num++; + echo "\n"; + //echo "\n"; + echo "\n"; + //echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + switch($row[7]) + { + case 0: + echo "\n"; + break; + case 1: + echo "\n"; + break; + case 2: + echo "\n"; + break; + } + echo "\n"; + echo "\n"; + } + if (mysqli_num_rows($result) == 0) + { + $no_of_fields += 1; + echo ""; + } + echo "
      {${$parameter}[cellname]}{${$parameter}[mcc]}{${$parameter}[mnc]}{${$parameter}[lac]}{${$parameter}[cellid]}{${$parameter}[bcch]}{${$parameter}[bsic]}{${$parameter}[neighbortype]}{${$parameter}[control]}
      $num" . ($row[0]==''?"-":rawurldecode($row[0])) . "$row[0]$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]{${$parameter}[activeonly]}{${$parameter}[activeidle]}{${$parameter}[idleonly]}{${$parameter}[delete]}|" . + "{${$parameter}[modify]}
      " . + ${$parameter}[noneighbor] . "
      "; + + /************************************************ + * Find out the next available Adjhand object ID + ************************************************/ + if (mysqli_num_rows($result)<32) + { + $sqlstring = "select MIN(0+SUBSTRING_INDEX(ObjectId,'.',-1)) from OMCR_AdjHand where bssid=$bssid and (BcchFrequency=-1 or CellGlobalIdentityLaiMcc=0 or CellGlobalIdentityLaiMnc=0 or CellGlobalIdentityCi=0 or LocationAreaCodes=0) and ObjectId LIKE 'AdjHand.$btsmgrid.0.%'"; + //echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + echo "
      \n"; + echo "
      "; + echo "\n"; + + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
      "; + } +} +?> + + diff --git a/wxc2_omc/configuration/bssomc/adjhandlist.inc b/wxc2_omc/configuration/bssomc/adjhandlist.inc new file mode 100755 index 0000000..1f1d6cb --- /dev/null +++ b/wxc2_omc/configuration/bssomc/adjhandlist.inc @@ -0,0 +1,46 @@ + "行数", + cellname => "小区名称", + mcc => "移动国家代码", + mnc => "移动网络代码", + cellid => "小区识别码", + lac => "位置区域代码", + bcch => "BCCH", + bsic => "基站识别代码", + neighbortype=> "相邻小区类别", + celltype => "小区类别", + control => "控制", + noneighbor => "没有相邻小区", + delete => "删除", + modify => "编辑", + activeonly => "active only", + activeidle => "active+idle", + idleonly => "idle only", + title => "OMC相邻小区表", + back => "返回", + addneighbor => "添加相邻小区" + ); +$engnamearray = Array( + rowno => "NO.", + cellname => "NAME", + mcc => "MCC", + mnc => "MNC", + cellid => "CELL ID", + lac => "LAC", + bcch => "BCCH", + bsic => "BSIC", + neighbortype=> "NEIGHBOUR TYPE", + celltype => "Cell Type", + control => "CONTROL", + noneighbor => "No Neighbour found", + delete => "DELETE", + modify => "MODIFY", + activeonly => "DEDICATED MODE ONLY", + activeidle => "DEDICATED & IDLE MODE", + idleonly => "IDLE MODE ONLY", + title => "Defined Neighbor List In OMC", + back => "Back", + addneighbor => "Add Neighbor" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/adjhandlist.php b/wxc2_omc/configuration/bssomc/adjhandlist.php new file mode 100755 index 0000000..2844415 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/adjhandlist.php @@ -0,0 +1,202 @@ + + + + + + + + + +\n"; + echo "\n"; + exit(); +} + +/************************************************ + * Retrieve the Bts Manager ID from object ID + * AdjHand.11.0.12 --substr--> 11.0.12 --> 11 + ************************************************/ +$btsmgrid = substr($objectid,8); +if ($btsmgrid[1] == '.') +{ + $btsmgrid=substr($btsmgrid,0,1); +} +else if ($btsmgrid[2] == '.') +{ + $btsmgrid=substr($btsmgrid,0,2); +} +else +{ + echo strlen($objectid) . "Error Object ID:" . $objectid . "\n"; + return 0; +} + + include("adjhandlist.inc"); + include("meta_table_type.inc"); + include("login_parm.inc"); + $db = mysql_connect($hostname, $username, $password); + mysql_select_db($dbname,$db); + //echo "=)AdjHand.$btsmgrid.0.*"; + echo "{${$parameter}[title]}"; + echo "

      \n"; + + + /******************************************************** + * Step 1: Find out the next available Adjhand object ID + ********************************************************/ + $sqlstring = "select MIN(0+SUBSTRING_INDEX(ObjectId,'.',-1)) from OMCR_AdjHand where bssid=$bssid" . + " and (BcchFrequency=-1 or CellGlobalIdentityLaiMcc=0" . + " or CellGlobalIdentityLaiMnc=0 or CellGlobalIdentityCi=0 or LocationAreaCodes=0)" . + " and ObjectId LIKE 'AdjHand.$btsmgrid.0.%'"; + //echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + if ($row[0] == null) + { + echo "\nThere are no space for new neighbour cell."; + return; + } + $new_neighbor_id = "AdjHand.$btsmgrid.0.$row[0]"; + mysql_free_result($result); + + /************************************************ + * Step 2: Display the present neighbor list + ************************************************/ + + /************************************************ + * Generate the Neighbor cell list from SQL DB + ************************************************/ + $sqlstring = "CREATE TEMPORARY TABLE tmp SELECT t1.Label AS NAME," . + "t1.MobileCountryCode AS MCC,t1.MobileNetworkCode AS MNC,t1.LocationAreaCode AS LAC," . + "t1.CellIdentity AS CI,t1.CellAllocation_0 AS BCCH,t1.BsIdentityCode AS BSIC " . + "FROM OMCR_Bts AS t1, OMCR_BSSTREE AS t2 WHERE " . + "t2.Presence=1 AND t1.ObjectId=t2.ObjectId AND t1.ObjectId<>'Bts.$btsmgrid.0' AND " . + "t1.MobileCountryCode>0 AND t1.MobileNetworkCode>0 AND t1.LocationAreaCode>0 AND " . + "t1.CellIdentity>0 AND t1.CellAllocation_0>0 AND t1.BsIdentityCode>=0"; + //echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $sqlstring = "INSERT INTO tmp SELECT t1.Label AS NAME," . + "t1.CellGlobalIdentityLaiMcc AS MCC,t1.CellGlobalIdentityLaiMnc AS MNC,t1.LocationAreaCodes AS LAC," . + "t1.CellGlobalIdentityCi AS CI,t1.BcchFrequency AS BCCH,t1.BsIdentityCode AS BSIC " . + "FROM OMCR_AdjHand AS t1, OMCR_BSSTREE AS t2 " . + "WHERE t2.Presence=1 AND t1.ObjectId=t2.ObjectId AND " . + "t1.ObjectId NOT LIKE 'AdjHand.$btsmgrid.0.%' AND t1.CellGlobalIdentityLaiMcc>0 AND " . + "t1.CellGlobalIdentityLaiMnc>0 AND t1.LocationAreaCodes>0 AND " . + "t1.CellGlobalIdentityCi>0 AND t1.BcchFrequency>0 AND t1.BsIdentityCode>=0"; + //echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $sqlstring = "SELECT DISTINCT * FROM tmp"; + //echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + +/* + $sqlstring = "select DISTINCT Label,CellGlobalIdentityLaiMcc,CellGlobalIdentityLaiMnc," . + "LocationAreaCodes,CellGlobalIdentityCi,BcchFrequency,BsIdentityCode from OMCR_AdjHand " . + "where BcchFrequency<>-1 and CellGlobalIdentityLaiMcc<>0 and CellGlobalIdentityLaiMnc<>0 " . + "and CellGlobalIdentityCi<>0 and LocationAreaCodes<>0 and (bssid<>$bssid OR " . + "(bssid=$bssid AND ObjectId NOT LIKE 'AdjHand.$btsmgrid.0.%')) ORDER BY CellGlobalIdentityCi"; +*/ + //echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $no_of_fields=mysql_num_fields($result); + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + $num=0; + while ( $row = mysqli_fetch_row($result) ) + { + $num++; + echo "\n"; + echo "\n"; + //echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + } + if (mysqli_num_rows($result) == 0) + { + $no_of_fields += 1; + echo ""; + } + echo "
      {${$parameter}[cellname]}{${$parameter}[mcc]}{${$parameter}[mnc]}{${$parameter}[lac]}{${$parameter}[cellid]}{${$parameter}[bcch]}{${$parameter}[bsic]}{${$parameter}[control]}
      $num" . ($row[0]==''?"-":rawurldecode($row[0])) . "$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]
      " . + ${$parameter}[noneighbor] . "
      "; + echo "


      \n"; + echo "\n"; + $sqlstring = "DROP TABLE tmp"; + //echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + +?> + + diff --git a/wxc2_omc/configuration/bssomc/alarmevent.inc b/wxc2_omc/configuration/bssomc/alarmevent.inc new file mode 100755 index 0000000..e700f71 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/alarmevent.inc @@ -0,0 +1,42 @@ + "去", + bssid => "BSS编号", + objectid => "对象编号", + description => "告警内容", + severity => "告警等级", + eventtime => "告警时间", + cleartime => "告警清除时间", + pages => "页", + record => "条", + total => "合共", + back => "返回", + remove => "消除", + clear => "告警消除", + critical => "一级告警", + major => "二级告警", + minor => "三级告警", + note => "注:只显示一小时之内及未消除之告警,欲查看其他告警,请选择适合的过滤条件。", + norecord => "-- 找不到相关纪录 --" + ); +$engnamearray = Array( + go => "GO", + bssid => "BSS ID", + objectid => "OBJECT ID", + description => "DESCRIPTION", + severity => "SEVERITY", + eventtime => "EVENT TIME", + cleartime => "CLEAR TIME", + pages => "PAGES", + record => "RECORDS", + total => "TOTAL", + back => "Back", + remove => "REMOVE", + clear => "CLEARED", + critical => "CRITICAL", + major => "MAJOR", + minor => "MINOR", + note => "Note: Only show alarm that is not clear or within 1 hour. Use alarm filter for more events.", + norecord => "-- No Record Found --" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/alarmevent.php b/wxc2_omc/configuration/bssomc/alarmevent.php new file mode 100755 index 0000000..923d3c0 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/alarmevent.php @@ -0,0 +1,376 @@ + +
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + $sqlstring = "SELECT min(Severity) FROM OMCR_ALARMEVENT" . + " WHERE bssid=$rmBssid" . + " AND ObjectId='$rmObjectid'" . + " AND Severity>0 AND Severity<=3"; + echo $sqlstring . "

      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + + if ( $row[0] == null ) // All alarm cleared + $row[0] = 0; + + $sqlstring = "UPDATE OMCR_BSSTREE SET MaxSeverity=" . $row[0] . + " WHERE bssid=$rmBssid" . + " AND ObjectId='$rmObjectid'"; + echo $sqlstring . "
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + header("Location: " . + "alarmevent.php?" . + "language=$language" . + (isset($bssid)? "&bssid=$bssid":"") . + (isset($perBssid)? "&perBssid=$perBssid":"") . + (isset($perSeverity)? "&perSeverity=$perSeverity":"") . + (isset($perObjectid)? "&perObjectid=$perObjectid":"") . + (isset($perStartPeriod)? "&perStartPeriod=$perStartPeriod":"") . + (isset($perEndPeriod)? "&perEndPeriod=$perEndPeriod":"") . + (isset($perSignal_Element)? "&perSignal_Element=$perSignal_Element":"") . + "&offset=$offset" + //"&offset=" . ($offset-$stepsize) + ); +} +?> + + + + + + ALARM EVENT + + +
      +0" . + (isset($perBssid)?" AND t1.bssid=$perBssid":"") . + (isset($perObjectid)?" AND t1.ObjectId REGEXP '$perObjectid'":"") . + (isset($perSeverity)?" AND t1.Severity$perSeverity":"") . + (isset($perStartPeriod)?" AND t1.EventTime>='$perStartPeriod'":"") . + (isset($perEndPeriod)? " AND t1.EventTime<='$perEndPeriod'":"") . + ( + ( isset($perBssid) || isset($perObjectid) || + isset($perSeverity) || + isset($perStartPeriod) || isset($perEndPeriod) + )? "":" AND (t1.Severity>0 OR t1.ClearTime >= NOW()-INTERVAL 60 MINUTE)" + ) . + (isset($XXX)? " AND ($XXX)":"") . + " AND t1.Severity <= $alarm_to_show AND t1.Cause = t2.Cause "; + + +//echo $sqlstring . "
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + +$no_of_records=mysqli_num_rows($result); + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
      \n"; +echo ${$parameter}[total] . ": " .$no_of_records . " " . ${$parameter}[record]; +echo "\n"; +echo "$stepsize " . ${$parameter}[record] . "/" . ${$parameter}[pages]; +echo "\n"; +if ($no_of_records) + echo (floor($offset/$stepsize) + 1) . "/" . + (ceil($no_of_records/$stepsize)) . " " . ${$parameter}[pages]; +else + echo "0/0 " . ${$parameter}[pages]; +echo " "; +echo ""; +echo " "; +echo "{${$parameter}[pages]}   "; + +if ($offset > $stepsize-1) +{ + echo ""; + echo ""; + echo "\n"; +} +else +{ + echo ""; + echo ""; + echo "\n"; +} +if ($no_of_records > $offset + $stepsize) +{ + echo ""; + echo ""; + echo "\n"; +} +else +{ + echo ""; + echo ""; + echo "\n"; +} +echo "
      \n"; + +// +// Only show alarm with Severity <= $alarm_to_show +if ($offset >= 0) +{ + $sqlstring .= "ORDER BY EventTime DESC,GlobalEventNumber DESC LIMIT $offset,$stepsize"; +} +else +{ + $sqlstring .= "ORDER BY EventTime DESC,GlobalEventNumber DESC LIMIT 0," . + ($stepsize+$offset); +} + +//echo $sqlstring . "
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + +$no_of_fields = mysql_num_fields($result); + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +while ( $row = mysqli_fetch_row($result) ) +{ + list($mybssid,$myobjectid,$myeventinfo,$myseverity, + $myeventtime,$mycleartime, $cause)=$row; + echo ""; + for ($i=0;$i<$no_of_fields;$i++) + { + if (!strcmp(mysql_field_name($result, $i),"Severity")) + { + $severity_field_no = $i; + echo "\n"; + break; + case 1: echo "" . + ${$parameter}[critical] . "\n"; + break; + case 2: echo "" . + ${$parameter}[major] . "\n"; + break; + case 3: echo ${$parameter}[minor] . "\n"; + break; + case 4: echo ${$parameter}[minor] . "\n"; + break; + default: echo $row[$i] . "\n"; + break; + } + } + else if (!strcmp(mysql_field_name($result, $i),"Cause")) + { + // Not need to display + } + else // Is not Severity or Cause + { + printf("\n",(isset($row[$i])? $row[$i]:"-")); + } + } // end_of_for () + + // Manual clear button for non-clear alarm + if ($row[$severity_field_no] > 0) + echo ""; + else + echo ""; + echo "\n"; +} +echo "
      {${$parameter}[bssid]}{${$parameter}[objectid]}{${$parameter}[description]}{${$parameter}[severity]}{${$parameter}[eventtime]}{${$parameter}[cleartime]}- -
      "; + switch ($row[$i]) + { + case 0: echo ${$parameter}[clear] . "%s-
      \n"; +if (mysqli_num_rows($result) == 0) + echo "
      {${$parameter}[norecord]}

      "; +echo "
      \n"; +echo "{${$parameter}[note]}\n"; +mysql_free_result($result); +?> + + diff --git a/wxc2_omc/configuration/bssomc/alarmfilter.inc b/wxc2_omc/configuration/bssomc/alarmfilter.inc new file mode 100755 index 0000000..1aefc10 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/alarmfilter.inc @@ -0,0 +1,32 @@ + "BSS 编号", + objectid => "对象编号", + severity => "告警等级", + startperiod=> "开始时间", + endperiod => "结束时间", + find => "查看", + back => "返回", + clear => "已消除", + unclear => "未消除", + all => "未消除", + critical => "一级告警", + major => "二级告警", + minor => "三级告警" + ); +$engnamearray = Array( + bssid => "BSS ID", + objectid => "OBJECT ID", + severity => "SEVERITY", + startperiod=> "START TIME", + endperiod => "END TIME", + find => "FIND", + back => "BACK", + clear => "CLEARED", + unclear => "UNCLEAR", + all => "ALL", + critical => "CRITICAL", + major => "MAJOR", + minor => "MINOR" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/alarmfilter.php b/wxc2_omc/configuration/bssomc/alarmfilter.php new file mode 100755 index 0000000..8f56e73 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/alarmfilter.php @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + +

      + +
      (e.g Bts.*.0)
      + +

      + +

      + + +

      + +

      +"; +if (isset($bssid)) + echo ""; +else + echo ""; +?> +
      + diff --git a/wxc2_omc/configuration/bssomc/alarmframe.php b/wxc2_omc/configuration/bssomc/alarmframe.php new file mode 100755 index 0000000..2ce3f68 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/alarmframe.php @@ -0,0 +1,49 @@ + + + + + + + ; +"; +?> + + <body> + <p>This page uses frames, but your browser doesn't support them.</p> + </body> + + + + diff --git a/wxc2_omc/configuration/bssomc/alarmimage.inc b/wxc2_omc/configuration/bssomc/alarmimage.inc new file mode 100755 index 0000000..d65c33d --- /dev/null +++ b/wxc2_omc/configuration/bssomc/alarmimage.inc @@ -0,0 +1,294 @@ + +"; +$img000_down=""; +$img000_warn=""; +$img010_up =""; +$img010_down=""; +$img010_warn=""; +$img020_up =""; +$img020_down=""; +$img020_warn=""; +$img030_up =""; +$img030_down=""; +$img030_warn=""; +$img040_up =""; +$img040_down=""; +$img040_warn=""; +$img050_up =""; +$img050_down=""; +$img050_warn=""; +$img060_up =""; +$img060_down=""; +$img060_warn=""; +$img070_up =""; +$img070_down=""; +$img070_warn=""; +$img080_up =""; +$img080_down=""; +$img080_warn=""; + +$img011_up =""; +$img011_down=""; +$img011_warn=""; +$img012_up =""; +$img012_down=""; +$img012_warn=""; + +//$img021_up =""; +//$img021_down=""; +//$img021_warn=""; +//$img022_up =""; +//$img022_down=""; +//$img022_warn=""; + +//$img030_up =""; +//$img030_down=""; +//$img030_warn=""; +//$img040_up =""; +//$img040_down=""; +//$img040_warn=""; + +$img100_up =""; +$img100_down=""; +$img100_warn=""; +$img110_up =""; +$img110_down=""; +$img110_warn=""; +$img111_up =""; +$img111_down=""; +$img111_warn=""; +$img120_up =""; +$img120_down=""; +$img120_warn=""; +$img130_up =""; +$img130_down=""; +$img130_warn=""; +$img140_up =""; +$img140_down=""; +$img140_warn=""; + +$img200_up =""; +$img200_down=""; +$img200_warn=""; +$img210_up =""; +$img210_down=""; +$img210_warn=""; +$img211_up =""; +$img211_down=""; +$img211_warn=""; +$img220_up =""; +$img220_down=""; +$img220_warn=""; +$img230_up =""; +$img230_down=""; +$img230_warn=""; +$img240_up =""; +$img240_down=""; +$img240_warn=""; + +$img300_up =""; +$img300_down=""; +$img300_warn=""; +$img310_up =""; +$img310_down=""; +$img310_warn=""; +$img311_up =""; +$img311_down=""; +$img311_warn=""; +$img320_up =""; +$img320_down=""; +$img320_warn=""; +$img330_up =""; +$img330_down=""; +$img330_warn=""; +$img340_up =""; +$img340_down=""; +$img340_warn=""; + +$img400_up =""; +$img400_down=""; +$img400_warn=""; +$img410_up =""; +$img410_down=""; +$img410_warn=""; +$img411_up =""; +$img411_down=""; +$img411_warn=""; +$img420_up =""; +$img420_down=""; +$img420_warn=""; +$img430_up =""; +$img430_down=""; +$img430_warn=""; +$img440_up =""; +$img440_down=""; +$img440_warn=""; + +$img500_up =""; +$img500_down=""; +$img500_warn=""; +$img510_up =""; +$img510_down=""; +$img510_warn=""; +$img511_up =""; +$img511_down=""; +$img511_warn=""; +$img520_up =""; +$img520_down=""; +$img520_warn=""; +$img530_up =""; +$img530_down=""; +$img530_warn=""; +$img540_up =""; +$img540_down=""; +$img540_warn=""; + +$img600_up =""; +$img600_down=""; +$img600_warn=""; +$img610_up =""; +$img610_down=""; +$img610_warn=""; +$img611_up =""; +$img611_down=""; +$img611_warn=""; +$img620_up =""; +$img620_down=""; +$img620_warn=""; +$img630_up =""; +$img630_down=""; +$img630_warn=""; +$img640_up =""; +$img640_down=""; +$img640_warn=""; + +$img700_up =""; +$img700_down=""; +$img700_warn=""; +$img710_up =""; +$img710_down=""; +$img710_warn=""; +$img711_up =""; +$img711_down=""; +$img711_warn=""; +$img720_up =""; +$img720_down=""; +$img720_warn=""; +$img730_up =""; +$img730_down=""; +$img730_warn=""; +$img740_up =""; +$img740_down=""; +$img740_warn=""; + +$img800_up =""; +$img800_down=""; +$img800_warn=""; +$img810_up =""; +$img810_down=""; +$img810_warn=""; +$img811_up =""; +$img811_down=""; +$img811_warn=""; +$img820_up =""; +$img820_down=""; +$img820_warn=""; +$img830_up =""; +$img830_down=""; +$img830_warn=""; +$img840_up =""; +$img840_down=""; +$img840_warn=""; + +$img900_up =""; +$img900_down=""; +$img900_warn=""; +$img910_up =""; +$img910_down=""; +$img910_warn=""; +$img911_up =""; +$img911_down=""; +$img911_warn=""; +$img920_up =""; +$img920_down=""; +$img920_warn=""; +$img930_up =""; +$img930_down=""; +$img930_warn=""; +$img940_up =""; +$img940_down=""; +$img940_warn=""; + +$img1000_up =""; +$img1000_down=""; +$img1000_warn=""; +$img1010_up =""; +$img1010_down=""; +$img1010_warn=""; +$img1011_up =""; +$img1011_down=""; +$img1011_warn=""; +$img1020_up =""; +$img1020_down=""; +$img1020_warn=""; +$img1030_up =""; +$img1030_down=""; +$img1030_warn=""; +$img1040_up =""; +$img1040_down=""; +$img1040_warn=""; + +$img1100_up =""; +$img1100_down=""; +$img1100_warn=""; +$img1110_up =""; +$img1110_down=""; +$img1110_warn=""; +$img1111_up =""; +$img1111_down=""; +$img1111_warn=""; +$img1120_up =""; +$img1120_down=""; +$img1120_warn=""; +$img1130_up =""; +$img1130_down=""; +$img1130_warn=""; +$img1140_up =""; +$img1140_down=""; +$img1140_warn=""; + +$img1200_up =""; +$img1200_down=""; +$img1200_warn=""; +$img1210_up =""; +$img1210_down=""; +$img1210_warn=""; +$img1211_up =""; +$img1211_down=""; +$img1211_warn=""; +$img1220_up =""; +$img1220_down=""; +$img1220_warn=""; +$img1230_up =""; +$img1230_down=""; +$img1230_warn=""; +$img1240_up =""; +$img1240_down=""; +$img1240_warn=""; + +$whiteslot=""; +$white=""; +$slot =""; +?> diff --git a/wxc2_omc/configuration/bssomc/bssConf.php b/wxc2_omc/configuration/bssomc/bssConf.php new file mode 100755 index 0000000..a5a6103 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssConf.php @@ -0,0 +1,286 @@ + + + +"; + +$DEBUG = 0; + +if($DEBUG) echo "
      mode=$mode"; +$sysConfTable = 'OMC_PUB.sysConf'; +$sysInfoTable = 'OMC_PUB.sysInfo'; +$pubDb ='OMC_PUB'; +$netIdDefArr=array( + array('0', "International"), + array('1', "international Spare"), + array('2', "National"), + array('3', "National Spare") + ); + +function alertMsg($msg) +{ + echo ""; + exit(); +} + +function sendBssCommand($bssid,$ip,$sysAlias,$add=1) +{ + $DEBUG = 0; + $db = "BssOmcDb"; + $remark = $sysAlias; + if($add==1) + $nmicmd="newbss $bssid $ip"; + else + $nmicmd = "dropbss $bssid $ip"; + + /* Old MySql */ + $sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; + //echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while (list($row_no[]) = mysqli_fetch_row($res)); + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) + { + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + $errorInfo = "Command table is full: Wait and send the command again"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + alertMsg($errorInfo); + + } + if($add==1) + { + // + // Save "Name and remark" in OMCR_BSSTABLE + // A non-null IP field in OMCR_BSSTABLE means the entry is valid + // + $sqlstring = "UPDATE OMCR_BSSTABLE SET name='$remark', ip='$ip'," . + "remark='$remark' WHERE bssid=$bssid"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + + $sqlstring = "UPDATE OMCR_BssFunc SET Label='$remark' " . + "WHERE bssid=$bssid"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + // + // Insert 1 commands in OMCR_COMMAND out of 10 possible available rows + // + $i=0; + do + { + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + $row_no[$i] . ",-1,'$nmicmd',null,255,-1,null,null,null)"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; + } while ($i<10 && mysql_affected_rows() != 2); //replace=delete+insert (2 task) + + $cmd1_row_no = $row_no[$i-1]; + + // + // Wait for response: timeout after 500ms x 20 = 10 secs + // + $i=0; + while ($i<20) + { + usleep(500000); + $sqlstring = "SELECT resultcode,result,responsecode,response from OMCR_COMMAND WHERE status=0 AND " . + "row_no=$cmd1_row_no ORDER BY seqNum ASC"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + list($resultcode,$result,$responsecode,$response) = $mydata; + //list($a[],$b[],$c[],$d[],$e[],$f[],$result[],$response[]) = $mydata; + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + + if ($no_of_rows == 1) + { + if($add==1)//add + { + if ($result != 'ok') + { + // Create/Delete failed !!! + $errorInfo = "$result: $response"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + //$errorInfo=rawurlencode($errorInfo); + alertMsg($errorInfo); + return 0; + } + } + else//delete + { + if ($resultcode != 0) + { + $errorInfo = "dropbss command failed: ".$response; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + //$errorInfo=rawurlencode($errorInfo); + alertMsg($errorInfo); + return 0; + } + } + } + echo ""; + flush(); + $i++; + } + return 1; +}//end sendBssCommand + + +?> + + ; +addSql = $addSql"; + $result = mysqli_query($pubConn,$addSql); + echo mysqli_error($pubConn); + + echo "
      Add ok"; + echo " "; + } +}else if($mode == 'delete'){ + $tmpSysType = 500; + $tmpSubSysNo = 0; + $delSql = "DELETE FROM $sysInfoTable WHERE sysTypeNo='$tmpSysType' AND sysNo = '$sysNo' + AND subSysNo = '$tmpSubSysNo'"; + if($DEBUG) echo "
      delSql = $delSql"; + mysqli_query($pubConn,$delSql); + + $bssTable = "BssOmcDb.OMCR_BSSTABLE"; + $selSql = "select ip from $bssTable where bssid='$sysNo'"; + $result = mysqli_query($pubConn,$selSql); + if($row = mysqli_fetch_array($result)) + { + $bssIP = $row[ip]; + $bssid=$sysNo; + if(strlen($bssIP)>0) + sendBssCommand($bssid,$bssIP,'',0); + } + echo "
      Deleted Successful"; + exit(); +} +?> + +
      " > + + + + + +"; +echo ""; +echo ""; +echo ""; + +//===ip== +echo ""; +echo ""; +echo ""; +/* +echo ""; +echo ""; +echo ""; +echo ""; +*/ +echo "
      + +
      System No."; + +$sysNoSql ="SELECT maxSysNum FROM $sysConfTable WHERE sysTypeNo='500'"; +if($DEBUG) echo "
      $sysNoSql"; +$sysNoResult = mysqli_query($pubConn,$sysNoSql); +$sysNoRows = @mysqli_fetch_array($sysNoResult); +$maxSysNum = $sysNoRows[maxSysNum]; + +//Get the valid BSS object +unset($bssIDList); +$bssTable = "BssOmcDb.OMCR_BSSTABLE"; +$selSql = "select * from $bssTable order by bssid"; +$result = mysqli_query($pubConn,$selSql); +while($row = mysqli_fetch_array($result)) +{ + $bssid_tmp=$row[bssid]+0; + if(strlen(trim($row[ip])) > 0) + $bssIDList[$bssid_tmp]=1; + else + $bssIDList[$bssid_tmp]=0; +} + +echo ""; +echo "
      IP:
      Alias:
      "; +echo "  "; +echo "  "; +echo ""; +echo ""; +adjust_content_tail("down"); +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/bssomc/bssListDown.php b/wxc2_omc/configuration/bssomc/bssListDown.php new file mode 100755 index 0000000..8cff00b --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssListDown.php @@ -0,0 +1,105 @@ + + + +"; + +$DEBUG = 0; +$sysInfoTable = 'OMC_PUB.sysInfo'; +$sysInfoDefTable = 'OMC_PUB.sysInfoDef'; +$pubDb ='OMC_PUB'; +$listSql = "SELECT a.bssid,a.ip,b.Label as name,a.connected FROM BssOmcDb.OMCR_BSSTABLE as a, BssOmcDb.OMCR_BssFunc as b" . + " WHERE a.ip!='' AND a.bssid=b.bssid ORDER BY bssid"; +if($DEBUG) echo "
      listSql = $listSql
      "; +$listResult = mysqli_query($pubConn,$listSql); +echo mysqli_error($pubConn); +?> + + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +}elseif($selectedLanguage == 'chn'){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +while($listRows=@mysqli_fetch_array($listResult)){ + $bssid=$listRows[bssid]; + $sysName="BSS".$listRows[bssid]; + echo ""; + echo ""; + if(strlen($listRows[name]) > 0 ){ + echo ""; + }else{ + echo ""; + } + + echo ""; + + if($listRows[connected]==255){ + echo ""; + }else if($listRows[connected]==0){ + echo ""; + }else{ + echo ""; + } + + echo ""; + + echo ""; +} +echo "
      NameAliasIPConnect StatusDelete
      名称别名IP连接状态删除
      $sysName$listRows[name] -- $listRows[ip] ConnectedBrokenBSC is booting up or cannot be connected
      "; +echo "    "; +echo "
      "; + +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/bssomc/bssListIndex.php b/wxc2_omc/configuration/bssomc/bssListIndex.php new file mode 100755 index 0000000..3a65b17 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssListIndex.php @@ -0,0 +1,16 @@ + + + + + + + <body> + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + </body> + + + + + diff --git a/wxc2_omc/configuration/bssomc/bssListUp.php b/wxc2_omc/configuration/bssomc/bssListUp.php new file mode 100755 index 0000000..01d132e --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssListUp.php @@ -0,0 +1,61 @@ + + + + +
      +"; +echo ""; +echo ""; +echo $strTitleConfiguration." > BSS"; +echo ""; +echo " "; +$helpId="2.1.1"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; +?> + + + +"; +echo " "; +$helpId="6"; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + +
      + + + diff --git a/wxc2_omc/configuration/bssomc/bssfunc.inc b/wxc2_omc/configuration/bssomc/bssfunc.inc new file mode 100755 index 0000000..aa09f2a --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssfunc.inc @@ -0,0 +1,8 @@ + "任务完成" + ); +$engnamearray = Array( + actioniscompleted => "Action is completed" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/bssfunc.php b/wxc2_omc/configuration/bssomc/bssfunc.php new file mode 100755 index 0000000..36b3c64 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssfunc.php @@ -0,0 +1,96 @@ + + + + +BSS Status + + + + + ; + + + <body> + <p>This page uses frames, but your browser doesn't support them.</p> + </body> + + + + diff --git a/wxc2_omc/configuration/bssomc/bssfuncinfo.inc b/wxc2_omc/configuration/bssomc/bssfuncinfo.inc new file mode 100755 index 0000000..ab5aff1 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssfuncinfo.inc @@ -0,0 +1,40 @@ + "决定要", + confirmquestionend => "吗?", + name => "名称", + ipaddress => "IP 地址", + swversion => "软件版本", + remarks => "备注", + delbts => "删除 BTS", + addbts => "增加 BTS", + upload => "上载参数", + download => "下载参数", + cfgupload => "数据库备份", + cfgdownload => "数据库下载", + swdownload => "软件下载", + deletebss => "删 除 BSS ", + backupdb => "BSC数据库备份", + //statistics => "话务统计", + showalarm => "查看告警" + ); +$engnamearray = Array( + confirmquestionbegin => "Are you sure you want to ", + confirmquestionend => "?", + name => "Name", + ipaddress => "IP Address", + swversion => "Software Version", + remarks => "Remarks", + delbts => "DEL BTS", + addbts => "ADD BTS", + upload => "Get All", + download => "Data Dnload", + cfgupload => "Back Up", + cfgdownload => "Restore", + swdownload => "SW Upload", + deletebss => "Delete BSS", + backupdb => "Backup DB", + //statistics => "Statistics", + showalarm => "Show Alarm" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/bssfuncinfo.php b/wxc2_omc/configuration/bssomc/bssfuncinfo.php new file mode 100755 index 0000000..7591ef3 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssfuncinfo.php @@ -0,0 +1,197 @@ + BTS creation/deletion +// -> Show Alarms +// +// bssfunc.php ___ bssstatus.php (upper) +// \__ bssfuncinfo.php (bottom) +// +?> + + + +"; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while ( $row = mysqli_fetch_row($result) ) + { + list($ip,$name,$connected) = $row; + } + if (mysqli_num_rows($result) != 1) + { + echo "Problem in OMCR database\n"; + return; + } + + $sqlstring = "SELECT ObjectId,Presence from OMCR_BSSTREE " . + "WHERE bssid=$bssid and ObjectId REGEXP 'BtsMgr.[1-9]'";//read BtsMgr.1~12 from BssTree + //echo "$sqlstring
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while ( $row = mysqli_fetch_row($result) ) + { + list($btsid[],$presence[]) = $row; + } + + $sqlstring = "SELECT CurrentBuildDir from OMCR_Software WHERE bssid=$bssid"; + //echo "$sqlstring
      "; + $result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + list($build) = mysqli_fetch_row($result); + if ($build == "''") + { + echo ""; + } + //else + // echo "ABCD${build}EFG"; +?> + +BS Plus + + + + + + + + "; +for ($i=0; $i<$no_of_bts; $i++) +{ + echo ""; + //if ($i && $i%2) + if (! (($i+1)%3)) + echo "\n"; +} +echo "
      + +\n"; +echo "
      "; + $id=substr($btsid[$i],7); + if ($presence[$i]) + echo ""; + //" onClick='javascript:parent.location.href=\"modify.php?" . + //"url=bssfunc.php&language=$language" . + //"&bssid=$bssid&objectid=BssFunc&nmicommand=delete BtsMgr $id&timeout=30\";'>"; + else + echo ""; + //" onClick='javascript:parent.location.href=\"modify.php?" . + //"url=bssfunc.php&language=$language" . + //"&bssid=$bssid&objectid=BssFunc&nmicommand=create BtsMgr $id&timeout=30\";'>"; + echo "
      \n"; +echo ""; + +?> + + + + + + + + + + + + + + + + + + +"; +?> + + + + +
      + ";'> + ";'> + + + + + + + + diff --git a/wxc2_omc/configuration/bssomc/bssstatus.inc b/wxc2_omc/configuration/bssomc/bssstatus.inc new file mode 100755 index 0000000..bf7f3ec --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssstatus.inc @@ -0,0 +1,14 @@ + "BSS 状态", + critical => "一级告警", + major => "二级告警", + normal => "正常" + ); +$engnamearray = Array( + bssstatus => "BSS STATUS", + critical => "-CRITICAL-", + major => "-MAJOR-", + normal => "-NORMAL-" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/bssstatus.php b/wxc2_omc/configuration/bssomc/bssstatus.php new file mode 100755 index 0000000..74573fd --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssstatus.php @@ -0,0 +1,331 @@ + + + + + +BSS Status + + + +
      +"; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while ( $row = mysqli_fetch_row($result) ) +{ + list($objectid[],$signal_element[],$maxseverity[]) = $row; +} +$no_of_objects = mysqli_num_rows($result); + +// Get the max severity for each display entity +for ($i=0;$i<$no_of_objects;$i++) +{ + // + // if not exist, simple set it + // or update alarm level if there is no alarm now + // or update the alarm level if more severity alarm is found + // + if (!isset($alarmslot[$signal_element[$i]])) + $alarmslot[$signal_element[$i]] = $maxseverity[$i]; + else if ($alarmslot[$signal_element[$i]] == 0) + $alarmslot[$signal_element[$i]] = $maxseverity[$i]; + else if (($alarmslot[$signal_element[$i]] > $maxseverity[$i]) && ($maxseverity[$i] <>0)) + $alarmslot[$signal_element[$i]] = $maxseverity[$i]; +} +if (!isset($alarmslot)) + return; + +//while (list($key,$val) = each($alarmslot)) +// echo "$key => $val
      "; + +$no_of_daisychain=4; +$no_of_iwbox=3; // BSC+BTS1+BTS2+BTS3 +$no_of_slots=5; // IWP+E1+E1+TRX4+TRX6 = 5 slots +$no_of_bsc_slots=9; +echo "\n"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "\n"; + +$i=0; +for ($j=0;$j<$no_of_bsc_slots;$j++) +{ + echo "\n"; + for ($k=0;$k<=1;$k++) + { + $persignal_element[$k]=""; // reset to empty in each round + $perseverity[$k]=""; // reset to empty in each round + $index="${i}${j}${k}"; + //echo "index=$index;"; + if ( !isset($alarmslot[$index]) ) // Not presence + $image[$k] = ""; + //$image[$k] = $white; + else if (( $alarmslot[$index] == 0) || // No alarm/warning/minor + ($alarmslot[$index] > 2)) + { + $imagename = "img${index}_up"; + $image[$k] = ${$imagename}; + } + else if ( $alarmslot[$index] == 1) // Alarmed if Critical + { + $imagename = "img${index}_down"; + //echo "imagename=$imagename"; + $image[$k] = ${$imagename}; + $persignal_element[$k]="&perSignal_Element=$index"; + //$perseverity[$k]="&perSeverity=1"; + $perseverity[$k]=htmlspecialchars("&perSeverity==1"); + } + else if ( $alarmslot[$index] == 2) // warned if Major + { + $imagename = "img${index}_warn"; + $image[$k] = ${$imagename}; + $persignal_element[$k]="&perSignal_Element=$index"; + //$perseverity[$k]="&perSeverity=2"; + $perseverity[$k]=htmlspecialchars("&perSeverity==2"); + } + } + + // if the machine exist, print empty slot for not existing object + if (( $image[0] == "") && isset($alarmslot["${i}00"])) + { + echo "\n"; + //echo "\n"; + } + else + { + if ($persignal_element[0] == "") + echo "\n"; + else + echo "\n"; + } + if ($persignal_element[1] == "") + echo "\n"; + else + echo "\n"; + + echo "\n"; + echo "\n"; + + $k = 2; + $index="${i}${j}${k}"; + if ( !isset($alarmslot[$index]) ) // Not presence + $image[$k] = ""; + //$image[$k] = $white; + else if (( $alarmslot[$index] == 0) || // No alarm + ( $alarmslot[$index] >= 3)) + { + $imagename = "img${index}_up"; + $image[$k] = ${$imagename}; + } + else if ( $alarmslot[$index] < 3) // Alarmed + { + $imagename = "img${index}_down"; + $image[$k] = ${$imagename}; + } + else if ( $alarmslot[$index] > 0) // warning + { + $imagename = "img${index}_warn"; + $image[$k] = ${$imagename}; + } + echo "\n"; + echo "\n"; +} + +echo "
      $slot${i}00$image[0]$image[0]$image[1]$image[1]
      $image[2]
      \n"; +echo "
      "; +echo "\n"; +for ($l=0;$l<$no_of_daisychain;$l++) +{ + for ($j=0;$j<$no_of_slots;$j++) + { + echo "\n"; + for ($i=1;$i<=$no_of_iwbox;$i++) + { + for ($k=0;$k<=1;$k++) + { + $persignal_element[$k]=""; // reset to empty in each round + $btsno=$i+$l*$no_of_iwbox; + $index="${btsno}${j}${k}"; + if ( !isset($alarmslot[$index]) ) // Not presence + $image[$k] = ""; + //$image[$k] = $white; + else if (( $alarmslot[$index] == 0) || // No alarm/warning/minor + ($alarmslot[$index] > 2)) + { + $imagename = "img${index}_up"; + $image[$k] = ${$imagename}; + } + else if ( $alarmslot[$index] == 1) // Alarmed if Critical + { + $imagename = "img${index}_down"; + $image[$k] = ${$imagename}; + $persignal_element[$k]="&perSignal_Element=$index"; + //$perseverity[$k]="&perSeverity=1"; + $perseverity[$k]=htmlspecialchars("&perSeverity==1"); + } + else if ( $alarmslot[$index] == 2) // warned if Major + { + $imagename = "img${index}_warn"; + $image[$k] = ${$imagename}; + $persignal_element[$k]="&perSignal_Element=$index"; + //$perseverity[$k]="&perSeverity=2"; + $perseverity[$k]=htmlspecialchars("&perSeverity==2"); + } + } + + // if the machine exist, print empty slot for not existing object + if ( $image[0] == "") + { + if (isset($alarmslot["${btsno}00"])) + { + echo "\n"; + //echo "\n"; + } + else + { + if ($j == 0) + echo "\n"; + else + echo "\n"; + } + } + else + { + if ($persignal_element[0] == "") + echo "\n"; + else + echo "\n"; + } + + if ( $image[1] == "") + { + if ($j == 0) + echo "\n"; + else + echo "\n"; + } + else + { + if ($persignal_element[1] == "") + echo "\n"; + else + echo "\n"; + } + } + /* end_of_for ($i=1;$i<=$no_of_iwbox;$i++) */ + + echo "\n"; + echo "\n"; + for ($i=1;$i<=$no_of_iwbox;$i++) + { + $k = 2; + $index="${i}${j}${k}"; + if ( !isset($alarmslot[$index]) ) // Not presence + { + $image[$k] = ""; + //$image[$k] = $white; + } + else if (( $alarmslot[$index] == 0) || ( $alarmslot[$index] >= 3)) // No alarm + { + $imagename = "img${index}_up"; + $image[$k] = ${$imagename}; + } + else if ( $alarmslot[$index] < 3) // Alarmed + { + $imagename = "img${index}_down"; + $image[$k] = ${$imagename}; + } + else if ( $alarmslot[$index] > 0) // warning + { + $imagename = "img${index}_warn"; + $image[$k] = ${$imagename}; + } + echo "\n"; + } + /* end_of_for ($i=1;$i<=$no_of_iwbox;$i++) */ + echo "\n"; + } + /* end_of_for ($j=0;$j<$no_of_slots;$j++) */ + + echo "\n"; + //if (isset($alarmslot["100"])) + // echo "\n"; + //else + // echo "\n"; + + for ($i=1;$i<=$no_of_iwbox;$i++) + { + $btsno=$i+$l*$no_of_iwbox; + if (isset($alarmslot["${btsno}00"])) + echo "\n"; + else + echo "\n"; + } + echo ""; +} +echo "
      $slot${i}00$whiteslot$image[0]$image[0]$white$image[1]$image[1]
      $image[2]
      BSCBTS " . $btsno . "
      "; +echo "
      "; +echo "
      "; +//echo "______________________
      "; +echo "|{${$parameter}[critical]}|{${$parameter}[major]}|{${$parameter}[normal]}|"; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/bssomc/bsstable.php b/wxc2_omc/configuration/bssomc/bsstable.php new file mode 100755 index 0000000..2ab640d --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bsstable.php @@ -0,0 +1,201 @@ + +// bsstable.php --> device_list.php --> modifyBssParam.php +// +// Return: +// device_list.php?save=1 +// &local_sys_id=0 +// &remote_sys_id=x <-- This is bssid +// &start_ip=x <-- This is BSS IP +// &remark=x +// &local_E1=x +// OR +// device_list.php?save=-1 +// &local_sys_id=0 +// &remote_sys_id=x <-- This is bssid +// &start_ip=x <-- This is BSS IP +// &remark=x +// &local_E1=x +// &err_info=Wrong IP|Wrong BSSID +// +?> +"; + echo "mode=$mode
      "; + echo "sysId=$sysId
      "; + echo "ip=$ip
      "; + echo "bssid = $bssid
      "; +} + +$baseUrl="../configuration/systemList/systemConf.php?bssId=$bssid&mode=add&sysId=$sysId&ip=$ip&sysAlias=$remark"; + +//check in url +if(strlen($sysId) < 5 || $bssIdArr[1] == '' || $mode !='add'){ + $errorInfo = "This url's value error!"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + $errorInfo=rawurlencode($errorInfo); + $returnUrl=$baseUrl.'&errorInfo='.$errorInfo; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); +} + +include("login_parm.inc"); +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +//check ip and bssid if have be created +$sqlstring = "SELECT bssid,ip FROM OMCR_BSSTABLE WHERE ip!='' AND bssid ='$bssid'"; +if($DEBUG) echo "$sqlstring
      "; +$resultSet = @mysql_query($sqlstring,$db); +$resultRowNum = @mysqli_num_rows($resultSet); +if($resultRowNum > 0){ + $resultRows=mysqli_fetch_array($resultSet); + $bssId=$resultRows[bssid]; + $ip=$resultRows[ip]; + $sysId='500_'. $bssid.'_0'; + $returnUrl=$baseUrl; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); +} + +// +// Find the available row in OMCR_COMMAND to insert nmi commands +// Get 10 available and insert 1 nmi commands +// 1. newbss +// + +$parm_name = split(",",$modified_data); +$nmicmd="newbss $bssid $ip"; + +/* Old MySql */ +$sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +while (list($row_no[]) = mysqli_fetch_row($res)); +$no_of_rows = mysqli_num_rows($res); +mysql_free_result($res); + +if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) +{ + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + $errorInfo = "Command table is full: Wait and send the command again"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + $errorInfo=rawurlencode($errorInfo); + $returnUrl=$baseUrl.'&errorInfo='.$errorInfo; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); +} + +// +// Save "Name and remark" in OMCR_BSSTABLE +// A non-null IP field in OMCR_BSSTABLE means the entry is valid +// +$sqlstring = "UPDATE OMCR_BSSTABLE SET name='BSS$bssid', ip='$ip'," . + "remark='$remark' WHERE bssid=$bssid"; +if($DEBUG) echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + +// +// Insert 1 commands in OMCR_COMMAND out of 10 possible available rows +// +$i=0; +do +{ + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + $row_no[$i] . ",-1,'$nmicmd',null,255,-1,null,null,null)"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while ($i<10 && mysql_affected_rows() != 2); //replace=delete+insert (2 task) + +$cmd1_row_no = $row_no[$i-1]; + +// +// Wait for response: timeout after 500ms x 20 = 10 secs +// +$i=0; +while ($i<20) +{ + usleep(500000); + $sqlstring = "SELECT result,response from OMCR_COMMAND WHERE status=0 AND " . + "row_no=$cmd1_row_no ORDER BY seqNum ASC"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + list($result[],$response[]) = $mydata; + //list($a[],$b[],$c[],$d[],$e[],$f[],$result[],$response[]) = $mydata; + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + + if ($no_of_rows == 1) + { + if ($result[0] != 'ok') + { + // Create/Delete failed !!! + $errorInfo = "$result[0]: $response[0]"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + $errorInfo=rawurlencode($errorInfo); + $returnUrl=$baseUrl.'&errorInfo='.$errorInfo; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); + }else{ + // Success !!! + $returnUrl=$baseUrl; + echo " "; + exit(); + } + return; + } + $i++; +} + +// +// Server has no response +// OMCR_COMMAND.status did not change to zero before timeout +// +$errorInfo = "No response"; +if($DEBUG) echo "
      errorInfo=$errorInfo"; +$errorInfo=rawurlencode($errorInfo); +$returnUrl=$baseUrl.'&errorInfo='.$errorInfo; +if($DEBUG) echo "
      returnUrl=$returnUrl"; +if(!$DEBUG) echo " "; +exit(); +?> diff --git a/wxc2_omc/configuration/bssomc/bsstable_old.php b/wxc2_omc/configuration/bssomc/bsstable_old.php new file mode 100755 index 0000000..2401cdd --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bsstable_old.php @@ -0,0 +1,158 @@ + bsstable.php --> modifyBssParam.php +// +?> + +// +include("login_parm.inc"); +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +//$parm_name = split(",",$modified_data); +$parm_name = explode(",",$modified_data); +$nmicmd="newbss $bssid $ip"; + +$sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +while (list($row_no[]) = mysqli_fetch_row($res)); +$no_of_rows = mysqli_num_rows($res); +mysql_free_result($res); + +if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) +{ + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + header("Location: " . + "newbss.php?language=$language&bssid=$bssid" . + "&objectid=$objectid&tablename=$tablename" . + "&status='Command table is full: Wait and send the command again'" + ); + return; +} + +// +// Save "Name and remark" in OMCR_BSSTABLE +// A non-null IP field in OMCR_BSSTABLE means the entry is valid +// +$sqlstring = "UPDATE OMCR_BSSTABLE SET name='$name',remark='$remark' " . + "WHERE bssid=$bssid"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + +// +// Insert 1 commands in OMCR_COMMAND out of 10 possible available rows +// +$i=0; +do +{ + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + $row_no[$i] . ",-1,'$nmicmd',null,255,-1,null,null,null)"; + //echo "$sqlstring
      "; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while ($i<10 && mysql_affected_rows() != 2); + +$cmd1_row_no = $row_no[$i-1]; + +// +// Wait for response: timeout after 500ms x 10 = 5 secs +// +$i=0; +while ($i<20) +{ + usleep(500000); + $sqlstring = "SELECT result,response from OMCR_COMMAND WHERE status=0 AND " . + "row_no=$cmd1_row_no ORDER BY seqNum ASC"; + //echo "$sqlstring
      "; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + list($result[],$response[]) = $mydata; + //list($a[],$b[],$c[],$d[],$e[],$result[],$response[]) = $mydata; + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + + if ($no_of_rows == 1) + { + if ($result[0] != 'ok') + { + // Create/Delete failed !!! + header("Location: " . + "newbss.php?language=$language&bssid=$bssid" . + "&objectid=$objectid" . + "&tablename=$tablename" . + "&status=$result[0]: $response[0]" + ); + } + else + { + // Success !!! + header("Location: " . + "modifyBssParam.php?language=$language&bssid=$bssid" . + "&objectid=$objectid" . + "&tablename=$tablename" . + "&mode=newbss" . + "&status=Creation command is sent" + ); + } + return; + } + $i++; +} + +// +// Server has no response +// OMCR_COMMAND.status did not change to zero before timeout +// +header("Location: " . + "newbss.php?language=$language&bssid=$bssid" . + "&objectid=$objectid&tablename=$tablename" . + "&status=No response" +); +?> diff --git a/wxc2_omc/configuration/bssomc/bsstree.inc b/wxc2_omc/configuration/bssomc/bsstree.inc new file mode 100755 index 0000000..1fff148 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bsstree.inc @@ -0,0 +1,22 @@ + "没有对象", + noobjcreated=> "没有对象产生", + broken => "失去连接", + contacted => "连接中", + connected => "连接上", + bssid => "基站子系统编号", + statistics => "话务统计", + showalarm => "查看告警" + ); +$engnamearray = Array( + noobj => "No Object", + noobjcreated=> "No Object created", + broken => "NOT CONNECTED", + contacted => "CONTACTED", + connected => "CONNECTED", + bssid => "BSS ID", + statistics => "STATISTICS", + showalarm => "SHOW ALARM" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/bsstree.php b/wxc2_omc/configuration/bssomc/bsstree.php new file mode 100755 index 0000000..9195d69 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bsstree.php @@ -0,0 +1,432 @@ + +", + "", + "", + "", + "", + "", + "", + "" + ); + +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +if (!isset($language)) + $language = "eng"; +$parameter = "${language}namearray"; + +$sqlstring = "SELECT connected from OMCR_BSSTABLE where bssid=$bssid"; +//echo $sqlstring; +$result = mysql_query($sqlstring,$db) or die("Invalid query:" . mysqli_error($pubConn)); +if (mysqli_num_rows($result) == 1) +{ + list($connected) = mysqli_fetch_row($result); +} + +/*if(isset($sleep_seconds)) +{ + echo "sleep_seconds=$sleep_seconds
      "; + sleep($sleep_seconds); +}*/ + +//READ FROM BSSTREE +$sqlstring = "select ObjectId, ${language}DisplayName,MaxSeverity,Url,Layer from OMCR_BSSTREE " . + "where Url<>'Notshown' and bssid=$bssid and Presence=1"; + +//echo "sqlstring=$sqlstring"; +$result = mysql_query($sqlstring,$db) or die("Invalid query" . mysqli_error($pubConn)); +$no_of_objects=mysqli_num_rows($result); +if ($no_of_objects < 1) +{ + if (!isset($mode) || !($mode=="newbss")) + { + include("header.inc"); + printf("
      {${$parameter}[noobj]}

      \n"); + echo ""; + return; + } +} + +if ($connected == 1) + echo ""; +else if ($connected == 0) + echo ""; // 1 min +else if ($connected == 254) + echo ""; // 10 mins + +include("header.inc"); +echo <<< _EOT_ + + + + + +
      +{${$parameter}[bssid]} $bssid
      + +
      +
      +_EOT_; +echo "
      \n"; +if ( $connected == 0 ) + echo "{${$parameter}[broken]}"; +else if ($connected == 1) + echo "{${$parameter}[contacted]}"; +else + echo "{${$parameter}[connected]}"; +echo "
      \n"; +echo "
      \n"; + + +$max_layer=0; +while (list($objectid[], $displayname[], $maxseverity[], $url[], $this_layer) + = mysqli_fetch_row($result)) +{ + $layer[] = $this_layer; + if ( $this_layer > $max_layer ) { $max_layer=$this_layer; } +} + +// +// Initialize rowarray and make it contains $max_layer elements +// +for ($x=0;$x<=$max_layer;$x++) +{ + $rowarray[]=NO_IMAGE; +} + +for ($y=0;$y<$no_of_objects;$y++) +{ + if ($y != 0) + { + if ($layer[$y] >= $layer[$y-1]) + $this_value[$y] = $last_value + pow(BASE,MAX_LAYER-$layer[$y]-1); + else if ($layer[$y] < $layer[$y-1]) + $this_value[$y] = (floor($last_value/pow(BASE,MAX_LAYER-$layer[$y]-1))+1) * pow(BASE,MAX_LAYER-$layer[$y]-1); + } + else + { + $this_value[$y]=pow(BASE,MAX_LAYER-1); + } + $last_value=$this_value[$y]; +} + +for ($y=0;$y<$no_of_objects;$y++) +{ + if($layer[$y]==0) + continue; + if($layer[$y]==1) + $parent_objectid[$y]='BssFunc'; + else{ + for($yy=$y-1;$yy>=0;$yy--){ + if($layer[$y]-1==$layer[$yy]){ + $parent_objectid[$y]=$objectid[$yy]; + break; + } + } + } +} + +for ($y=$no_of_objects-1;$y>=0;$y--) +{ + $tablearray[$y] = "
      "; + + //$tablearray[$y] = "
      "; + for ($x=0;$x<=$max_layer;$x++) + { + if ( $x > $layer[$y] ) + { + $rowarray[$x] = NO_IMAGE; + } + else if ( $x == $layer[$y] - 1 ) + { + if (($rowarray[$x] == NO_IMAGE ) || ($rowarray[$x] == N_IMAGE )) + { + if (($rowarray[$x+1] == N_IMAGE) || ($rowarray[$x+1] == NO_IMAGE)) // is description + $rowarray[$x] = L_IMAGE; + else + $rowarray[$x] = LPLUS_IMAGE; + } + else + { + if (($rowarray[$x+1] == N_IMAGE) || ($rowarray[$x+1] == NO_IMAGE)) // is description + $rowarray[$x] = T_IMAGE; + else + $rowarray[$x] = TPLUS_IMAGE; + } + } + else + { + if (($rowarray[$x] == NO_IMAGE ) || ($rowarray[$x] == N_IMAGE )) + $rowarray[$x] = N_IMAGE; + else + $rowarray[$x] = I_IMAGE; + } + + if ( $x == $layer[$y] ) + { + //$tablearray[$y] .= ""; + $rowarray[$x] = N_IMAGE; + if ( !strcmp($url[$y],"Nolink") ) + { + $tablearray[$y] .= "$displayname[$y]"; + } + elseif ( !strcmp($url[$y],"null") ) + { + $tablename=strtok($objectid[$y],"."); + $tablearray[$y] .= + "" . + $displayname[$y] . ""; + } + elseif ( !strncmp($url[$y],"OMCR_",5) ) + { + $tablearray[$y] .= + "" . + $displayname[$y] . ""; + } + else // URL is specified + { + $tablearray[$y] .= + "" . + $displayname[$y] . ""; + } + //$tablearray[$y] .= ""; + } + else + { + if ($rowarray[$x] == LPLUS_IMAGE) + $tablearray[$y] .= "" . "" . ""; + else if ($rowarray[$x] == TPLUS_IMAGE) + $tablearray[$y] .= "" . "" . ""; + else + $tablearray[$y] .= $image[$rowarray[$x]]; + } + } + $tablearray[$y] .= "
      \n"; +} + +// +// Draw the table now after determining the hierachy +// +for ($i=0;$i<$no_of_objects;$i++) +{ + echo $tablearray[$i]; +} +?> + + + diff --git a/wxc2_omc/configuration/bssomc/bssversion.inc b/wxc2_omc/configuration/bssomc/bssversion.inc new file mode 100755 index 0000000..845e450 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/bssversion.inc @@ -0,0 +1,3 @@ + diff --git a/wxc2_omc/configuration/bssomc/btsmeasfilter.inc b/wxc2_omc/configuration/bssomc/btsmeasfilter.inc new file mode 100755 index 0000000..adfe77a --- /dev/null +++ b/wxc2_omc/configuration/bssomc/btsmeasfilter.inc @@ -0,0 +1,18 @@ + "BSS 编号", + cellid => "小区编号", + startperiod=> "开始时间", + endperiod => "结束时间", + find => "查看", + back => "返回" +); +$engnamearray = Array( + bssid => "BSS ID", + cellid => "CELL ID", + startperiod=> "START TIME", + endperiod => "END TIME", + find => "FIND", + back => "BACK" +); +?> diff --git a/wxc2_omc/configuration/bssomc/btsmeasfilter.php b/wxc2_omc/configuration/bssomc/btsmeasfilter.php new file mode 100755 index 0000000..dfbc0dd --- /dev/null +++ b/wxc2_omc/configuration/bssomc/btsmeasfilter.php @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + +

      + +

      + +

      + +

      + +

      +"; +if (isset($bssid)) + echo ""; +else + echo ""; +?> +
      + diff --git a/wxc2_omc/configuration/bssomc/btsmeasframe.php b/wxc2_omc/configuration/bssomc/btsmeasframe.php new file mode 100755 index 0000000..0d35904 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/btsmeasframe.php @@ -0,0 +1,31 @@ + + + + + + + ; + + + <body> + <p>This page uses frames, but your browser doesn't support them.</p> + </body> + + + + diff --git a/wxc2_omc/configuration/bssomc/btsmeasurements.inc b/wxc2_omc/configuration/bssomc/btsmeasurements.inc new file mode 100755 index 0000000..401f409 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/btsmeasurements.inc @@ -0,0 +1,24 @@ + "去", + bssid => "BSS编号", + pages => "页", + record => "条", + total => "合共", + back => "返回", + cellidentity=> "小区识别码", + time => "话务统计时间", + norecord => "-- 找不到相关纪录 --" + ); +$engnamearray = Array( + go => "GO", + bssid => "BSS ID", + pages => "PAGES", + record => "RECORDS", + total => "TOTAL", + back => "BACK", + cellidentity=> "CELLID", + time => "STATISTICS TIME", + norecord => "-- No Record Found --" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/btsmeasurements.php b/wxc2_omc/configuration/bssomc/btsmeasurements.php new file mode 100755 index 0000000..fd21d7a --- /dev/null +++ b/wxc2_omc/configuration/bssomc/btsmeasurements.php @@ -0,0 +1,228 @@ + + + + + + + + ALARM EVENT + + +
      +0 and Time>0" . + (isset($perBssid)? " AND Bssid=$perBssid":"") . + (isset($perCellid)? " AND Cellid=$perCellid":"") . + (isset($perStartPeriod)? " AND Time>='$perStartPeriod'":"") . + (isset($perEndPeriod)? " AND Time<='$perEndPeriod'":""); +echo $sqlstring . "
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +list($no_of_records) = mysqli_fetch_row($result); +mysql_free_result($result); + +if (!isset($offset)) +{ + $offset = 0; +} + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +//echo "
      \n"; +echo ${$parameter}[total] . ": " .$no_of_records . " " . ${$parameter}[pages]; +echo "\n"; +echo "$stepsize " . ${$parameter}[record] . "/" . ${$parameter}[pages]; +echo "\n"; +if ($no_of_records) + echo (floor($offset/$stepsize) + 1) . "/" . + (ceil($no_of_records/$stepsize)) . " " . ${$parameter}[pages]; +else + echo "0/0 " . ${$parameter}[pages]; +echo "\n"; +echo ""; +echo " "; +echo "{${$parameter}[pages]}   "; + +//echo $offset . "-" . $stepsize; + if ($offset > $stepsize-1) + { + //if ($offset < $stepsize) $offset=0; + echo ""; + } + else + { + echo ""; + } +//echo $offset . "-" . $stepsize; + if ($no_of_records > $offset + $stepsize) + { + echo ""; + } + else + { + echo ""; + } +echo "
      \n"; +echo "\n"; +echo "\n"; + +$sqlstring = "select ${language}DisplayName,FieldName,${language}Remarks " . + "from OMCR_Meta_Statistics"; +//echo "$sqlstring
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +echo "\n"; +echo ""; +echo ""; +echo ""; +while ( $row = mysqli_fetch_row($result) ) +{ + $fieldname[] = $row[1]; + echo "\n"; +} +echo "\n"; +mysql_free_result($result); + +$sqlstring = "select Bssid,Cellid,Time," . join(",",$fieldname) . + " from OMCR_GeneralReport where Cellid>0 and Time>0" . + (isset($perBssid)? " AND Bssid=$perBssid":"") . + (isset($perCellid)? " AND Cellid=$perCellid":"") . + (isset($perStartPeriod)? " AND Time>='$perStartPeriod'":"") . + (isset($perEndPeriod)? " AND Time<='$perEndPeriod'":""); +if ($offset >= 0) +{ + $sqlstring .= " ORDER BY Time DESC LIMIT $offset,$stepsize"; +} +else +{ + $sqlstring .= " ORDER BY Time DESC LIMIT 0," . ($stepsize+$offset); +} + +//echo $sqlstring . "
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +$no_of_fields = mysql_num_fields($result); + +while ( $row = mysqli_fetch_row($result) ) +{ + echo ""; + for ($i=0;$i<$no_of_fields;$i++) + { + printf("\n",(isset($row[$i])? $row[$i]:"-")); + } + echo "\n"; +} +echo "
      {${$parameter}[bssid]}{${$parameter}[cellidentity]}{${$parameter}[time]}"; + echo "$row[0]"; + echo "
      %s
      \n"; +if (mysqli_num_rows($result) == 0) + echo "
      {${$parameter}[norecord]}

      "; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
      \n"; + +mysql_free_result($result); +?> + + diff --git a/wxc2_omc/configuration/bssomc/c.php b/wxc2_omc/configuration/bssomc/c.php new file mode 100755 index 0000000..e4e25de --- /dev/null +++ b/wxc2_omc/configuration/bssomc/c.php @@ -0,0 +1,4 @@ +"; +?> + diff --git a/wxc2_omc/configuration/bssomc/cfg_download.inc b/wxc2_omc/configuration/bssomc/cfg_download.inc new file mode 100755 index 0000000..543e08b --- /dev/null +++ b/wxc2_omc/configuration/bssomc/cfg_download.inc @@ -0,0 +1,55 @@ + "伺服器有以下备份", + no_backup => "找不到BSC备份档", + selectfile => "请选择BSC备份档", + err_msg => "参数错误", + heading => "数据库下载之后,必须重启BSC", + remind => "档案下载时间随档案大小而改变", + cleanup => "释放资源", + checkexist => "查看", + rename => "更改档名", + copy => "复制", + ok => "成功", + not_ok => "不成功", + done => "数据库下载完成,请重启BSC", + rebootbsc => "重启BSC", + failed => "失败", + create_dir => "创建目录", + rmdir => "删除目录", + chdir => "变更目录", + untar => "解压", + submit => "确定", + back => "返回", + ping => "连接", + mounting => "导入", + umounting => "导出" + ); + +$engnamearray = Array( + availfile => "Available BSC database backup", + no_backup => "No database backup file is found", + selectfile => "Please select BSC database backup here", + err_msg => "Please make sure you have input the correct parameters", + heading => "After downloading BSS software, you have to reboot BSC", + remind => "The software download time may vary with the file size", + cleanup => "Cleaning up allocated resources", + checkexist => "Checking the existent of", + rename => "Renaming", + copy => "Copying", + ok => "OK", + not_ok => "Not OK", + done => "Database download is complete. Reboot BSC is required", + rebootbsc => "Reboot BSC", + failed => "Failed", + create_dir => "Creating directory", + rmdir => "Removing directory", + chdir => "Changing directory", + untar => "Decompressing", + submit => "CONFIRM", + back => "BACK", + ping => "Pinging", + mounting => "Mounting", + umounting => "Unmounting" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/cfg_download.php b/wxc2_omc/configuration/bssomc/cfg_download.php new file mode 100755 index 0000000..e0fd00d --- /dev/null +++ b/wxc2_omc/configuration/bssomc/cfg_download.php @@ -0,0 +1,326 @@ + +{${$parameter}["err_msg"]}
      "; + return; +} +if ($version=='') +{ + include("bssversion.inc"); +} + +/***************************************** +* Locate tar file if it is not given +* +*****************************************/ +if (!isset($tarfile)) +{ + echo "\n"; +?> + + + +{${$parameter}["availfile"]}:
      "; + echo "
      \n"; + echo "
      \n";
      +	if (is_dir("/usr/local/apache/htdocs/bss_db"))
      +	{
      +		//$backuplist = Array();
      +		exec("ls -1t /usr/local/apache/htdocs/bss_db",$backuplist,$retval);
      +		$backupcount = count($backuplist);
      +		if ($backupcount <= 0)
      +			echo "{${$parameter}["no_backup"]}\n";
      +		else
      +			system("ls -1lht /usr/local/apache/htdocs/bss_db");
      +			
      +	}
      +	else
      +	{
      +		echo "{${$parameter}["no_backup"]}\n";
      +	}
      +	echo "
      \n"; + + + + echo "
      \n"; + echo "
      \n"; + echo "{${$parameter}["selectfile"]}: "; + echo "\n"; + echo "
      \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + if (isset($bssid)) + echo ""; + echo "
      \n"; + echo "\n"; + return; +} + + +/****************************************** +* Mount the BSC /hd0 to /tmp/$$ directory +*******************************************/ +$tmpdir = sprintf("%.3f",time()/1000); +$iwbox = "bss${bssid}"; +$ip = name2ip($iwbox); +$path_prefix = "tmp"; + +//---------------FTP BSS Config,EMS -> BSS----------------------- +$bscLoginName="www"; +$bscLoginPassword="123456"; +$remote_dir="/hd0/{$version}/compile/cfg"; + +flush(); +echo "Please wait, the operation will take some time
      "; +ob_flush(); +flush(); + +system("rm -rf /$path_prefix/$iwbox"); +mkdir("/$path_prefix/$iwbox",0755); +system("cp $tarfile /$path_prefix/$iwbox"); +chdir("/$path_prefix/$iwbox"); +system("tar zxf *.tar.gz"); +system("rm -rf *.tar.gz"); + + +$conn_id=ftp_connect($ip); +if($conn_id == FALSE) +{ + echo "FTP:connect to $ip failed.
      "; + back(); +} +if(FALSE == ftp_login($conn_id,$bscLoginName,$bscLoginPassword)) +{ + echo "FTP:login to $ip failed.
      "; + back(); +} + + +clearstatcache(); +ftp_put_whole_dir("/$path_prefix/$iwbox",$remote_dir,$conn_id); + +ftp_close($conn_id); + +system("rm -rf /$path_prefix/$iwbox"); + +function ftp_put_whole_dir($local_dir,$remote_dir,$conn_id) +{ + if($handle = opendir($local_dir)) + { + while(false !== ($file = readdir($handle))) + { + if($file != "." && $file != "..") + { + if(strlen(trim($file))<=0) + continue; + + if(is_dir($file)) + { + ftp_put_whole_dir($local_dir."/$file",$remote_dir."/$file",$conn_id); + } + else + { +flush(); +echo ""; +ob_flush(); +flush(); + + ftp_put($conn_id,$remote_dir."/$file",$local_dir."/$file",FTP_BINARY); + //echo "$local_dir $remote_dir $file
      "; + } + } + } + closedir($handle); + } +} + +echo "
      Download completely
      "; +echo "\n"; +echo ""; + + +exit(); +//------------------------------------------------------- + +/*************************************************************************************** +* PHP state machine +* +* Rename original build and create directory +* Format: it is a 2D array +* Array( +* Array('function','description','next state if success','next state if fail' +* ) +****************************************************************************************/ +$cmdlist = Array( + 's00' => Array ('system("/bin/ping -q -c 1 $ip >> /dev/null", $retval);return($retval);', + "{${$parameter}["ping"]} $iwbox ($ip) ...", + "kickout","s01"), + + 's01' => Array ('return(is_dir("$path_prefix/$iwbox"));', + "{${$parameter}["checkexist"]} $path_prefix/$iwbox", + "s03","s02"), + + 's02' => Array ('return(mkdir("$path_prefix/$iwbox",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox", + "s03","halt"), + + 's03' => Array ('system("umount $path_prefix/$iwbox", $retval);return($retval);', + "", + //"{${$parameter}["umounting"]} $path_prefix/$iwbox", + "s04","s03"), + + 's04' => Array ('system("mount $path_prefix/$iwbox", $retval);return($retval);', + "{${$parameter}["mounting"]} $path_prefix/$iwbox", + "halt","s40"), + + 's40' => Array ('return(is_dir(sprintf("$path_prefix/$iwbox/%s/compile/cfg",strtoupper($version))));', + "{${$parameter}["checkexist"]} $path_prefix/$iwbox/$version/compile/cfg", + "s41","halt"), + + 's41' => Array ('return(chdir (sprintf("$path_prefix/$iwbox/%s/compile/cfg",strtoupper($version))));', + "{${$parameter}["chdir"]} $path_prefix/$iwbox/$version/compile/cfg", + "s60","halt"), + + 's60' => Array ('return(is_file("$tarfile"));', + "{${$parameter}["checkexist"]} $tarfile", + "s61","halt"), + + 's61' => Array ('system("tar zxf $tarfile", $retval);return($retval);', + "{${$parameter}["untar"]} $tarfile ...", + "halt","cleanup"), + + "cleanup" => Array('return(is_dir("$path_prefix/$iwbox"));', + "{${$parameter}["checkexist"]} $path_prefix/$iwbox", + "chroot","getout"), + + 'chroot' => Array ('return(chdir("/"));', + "{${$parameter}["chdir"]} $path_prefix/$iwbox/$version/compile/cfg", + "umount","getout"), + + "umount" => Array('system("umount $path_prefix/$iwbox", $retval);return($retval);', + "{${$parameter}["umounting"]} $path_prefix/$iwbox", + "umount","rmdir"), + + "rmdir" => Array('return(rmdir("$path_prefix/$iwbox"));', + "{${$parameter}["rmdir"]} $path_prefix/$iwbox", + "getout","getout") +); + + +if (isset($debug)) +{ + foreach ($cmdlist as $key => $value) + { + echo "$key,$value[0],$value[1],$value[2],$value[3]
      "; + } +} + + +/********************************************* + * Execute the state machine here + *********************************************/ +echo "{${$parameter}["heading"]}
      "; +echo "
      ";
      +for ($state="s00" ; ; )
      +{
      +	if (isset($debug))
      +		echo "{$cmdlist[$state][0]}\n$state: ";
      +
      +	echo "{${cmdlist}[$state][1]}";
      +	flush();
      +	if (@eval(${cmdlist}["$state"][0]))
      +		$state = $cmdlist[$state][2];
      +	else
      +		$state = $cmdlist[$state][3];
      +
      +
      +	if ($state == "getout")
      +	{
      +		echo " ... {${$parameter}["ok"]}\n";
      +		break;
      +	}
      +	else if ($state == "kickout")
      +	{
      +		echo " ... {${$parameter}["not_ok"]}\n";
      +		echo "
      ... {${$parameter}["failed"]}
      "; + echo "
      ";
      +		break;
      +	}
      +	else if ($state == "halt")
      +	{
      +		echo " ... {${$parameter}["not_ok"]}\n";
      +		echo "
      ... {${$parameter}["failed"]}
      "; + echo "
      ";
      +		$state = "cleanup";
      +	}
      +	else
      +	{
      +		if (${cmdlist}[$state][1] != "")
      +			echo " ... {${$parameter}["ok"]}\n";
      +	}
      +}
      +
      +echo "
      \n"; +echo "... {${$parameter}["done"]}
      "; +echo ""; + + +?> diff --git a/wxc2_omc/configuration/bssomc/cfg_upload.inc b/wxc2_omc/configuration/bssomc/cfg_upload.inc new file mode 100755 index 0000000..47021e0 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/cfg_upload.inc @@ -0,0 +1,53 @@ + "伺服器有以下备份", + no_backup => "找不到BSC备份档", + selectfile => "请输入BSC备份档", + err_msg => "参数错误", + heading => "数据库备份", + remind => "档案备份时间随档案大小而改变", + cleanup => "释放资源", + checkexist => "查看", + rename => "更改档名", + copy => "复制", + ok => "成功", + not_ok => "不成功", + done => "数据库备份完成", + failed => "失败", + create_dir => "创建目录", + rmdir => "删除目录", + chdir => "变更目录", + tar => "加压", + submit => "确定", + back => "返回", + ping => "连接", + mounting => "导入", + umounting => "导出" + ); + +$engnamearray = Array( + availfile => "Previous BSC database backup", + no_backup => "No database backup file is found", + selectfile => "Please input a backup filename", + err_msg => "Please make sure you have input the correct parameters", + heading => "BSS database backup", + remind => "The database backup time may vary with the file size", + cleanup => "Cleaning up allocated resources", + checkexist => "Checking the existent of", + rename => "Renaming", + copy => "Copying", + ok => "OK", + not_ok => "Not OK", + done => "Database backup is complete.", + failed => "Failed", + create_dir => "Creating directory", + rmdir => "Removing directory", + chdir => "Changing directory", + tar => "Compressing", + submit => "CONFIRM", + back => "BACK", + ping => "Pinging", + mounting => "Mounting", + umounting => "Unmounting" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/cfg_upload.php b/wxc2_omc/configuration/bssomc/cfg_upload.php new file mode 100755 index 0000000..63f5f71 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/cfg_upload.php @@ -0,0 +1,326 @@ + + + + +{${$parameter}["err_msg"]}
      "; + return; +} +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; + +/***************************************** +* Locate tar file if it is not given +* +*****************************************/ +if (!isset($tarfile)) +{ + echo "\n"; +?> + + + +{${$parameter}["availfile"]}:
      "; + echo "
      \n"; + + echo "
      \n";
      +	if (is_dir("/usr/local/apache/htdocs/bss_db"))
      +	{
      +		//$backuplist = Array();
      +		exec("ls -1t /usr/local/apache/htdocs/bss_db",$backuplist,$retval);
      +		$backupcount = count($backuplist);
      +		if ($backupcount <= 0)
      +			echo "{${$parameter}["no_backup"]}\n";
      +		else
      +			system("ls -1lht /usr/local/apache/htdocs/bss_db");
      +			
      +	}
      +	else
      +	{
      +		echo "{${$parameter}["no_backup"]}\n";
      +	}
      +	echo "
      \n"; + + + + echo "
      \n"; + echo "
      \n"; + echo "{${$parameter}["selectfile"]}: "; + echo "\n"; + echo ".tar.gz"; + + echo "
      \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + echo "\n"; + if (isset($bssid)) + echo ""; + echo "
      \n"; + echo "\n"; + + return; +} + +/****************************************** +* Mount the BSC /hd0 to /tmp/$$ directory +*******************************************/ +$tmpdir = sprintf("%.3f",time()/1000); +$iwbox = "bss${bssid}"; +$ip = name2ip($iwbox); +$path_prefix = "/tmp"; + +//-----------------FTP BSC Config,BSS -> EMS --------------------- +$bscLoginName="www"; +$bscLoginPassword="123456"; +$file_list_name="/tmp/file_list.txt"; + +flush(); +echo "Please wait, the operation will take some time
      "; +ob_flush(); +flush(); + +system("rm -rf $path_prefix/$iwbox"); + +mkdir("$path_prefix/$iwbox", 0755); + +system("./ftpGetList $ip $bscLoginName $bscLoginPassword /hd0/{$version}/compile/cfg $path_prefix/$iwbox 1>/dev/null 2>&1"); + +$conn_id=ftp_connect($ip); +if($conn_id == FALSE) +{ + echo "FTP:connect to $ip failed.
      "; + back(); +} +if(FALSE == ftp_login($conn_id,$bscLoginName,$bscLoginPassword)) +{ + echo "FTP:login to $ip failed.
      "; + back(); +} + +$handle = @fopen($file_list_name, "r"); + +if ($handle) { + while (!feof($handle)) { + $buffer = fgets($handle, 4096); + if(strlen(trim($buffer)) < 8) + continue; + $sp=explode(",",$buffer); + $remote_dir=trim($sp[0]); + $local_dir=trim($sp[1]); + $ftpfile=trim($sp[2]); + + +flush(); +echo ""; +ob_flush(); +flush(); + + + //ftp_chdir($conn_id,$remote_dir); + $tmp1=$local_dir."/".$ftpfile; + $tmp2=$remote_dir."/".$ftpfile; + //echo "Get {$tmp2} from $iwbox "; + ftp_get($conn_id,$tmp1,$tmp2,FTP_BINARY); + } + fclose($handle); +} +ftp_close($conn_id); + +unlink($file_list_name); + +flush(); +echo "
      Compress $tarfile
      "; +ob_flush(); +flush(); + +chdir("$path_prefix/$iwbox"); +system("tar zcf $tarfile ."); +system("rm -rf $path_prefix/$iwbox"); + +echo "Backup $tarfile completely
      "; +back(); +exit(); +//-----------------FTP BSC Config END--------------------------- + +/*************************************************************************************** +* PHP state machine +* +* Rename original build and create directory +* Format: it is a 2D array +* Array( +* Array('function','description','next state if success','next state if fail' +* ) +****************************************************************************************/ +$cmdlist = Array( + 's00' => Array ('system("/bin/ping -q -c 1 $ip >> /dev/null", $retval);return($retval);', + "{${$parameter}["ping"]} $iwbox ($ip) ...", + "kickout","s01"), + + 's01' => Array ('return(is_dir("$path_prefix/$iwbox"));', + "{${$parameter}["checkexist"]} $path_prefix/$iwbox", + "s03","s02"), + + 's02' => Array ('return(mkdir("$path_prefix/$iwbox",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox", + "s03","halt"), + + 's03' => Array ('system("/bin/umount $path_prefix/$iwbox", $retval);return($retval);', + "", + //"{${$parameter}["umounting"]} $path_prefix/$iwbox", + "s04","s03"), + + 's04' => Array ('system("/bin/mount -t nfs $ip:/hd0 $path_prefix/$iwbox", $retval);return($retval);', + "{${$parameter}["mounting"]} -t nfs $ip:/hd0 $path_prefix/$iwbox", + "s40","halt"), + + 's40' => Array ('return(is_dir(sprintf("$path_prefix/$iwbox/%s/compile/cfg",strtoupper($version))));', + "{${$parameter}["checkexist"]} $path_prefix/$iwbox/$version/compile/cfg", + "s41","halt"), + + 's41' => Array ('return(chdir (sprintf("$path_prefix/$iwbox/%s/compile/cfg",strtoupper($version))));', + "{${$parameter}["chdir"]} $path_prefix/$iwbox/$version/compile/cfg", + "s60","halt"), + + 's60' => Array ('return(is_file("$tarfile"));', + "{${$parameter}["checkexist"]} $tarfile", + "halt","s61"), + + 's61' => Array ('system("tar zcf $tarfile .", $retval);return($retval);', + "{${$parameter}["tar"]} $tarfile ...", + "halt","cleanup"), + + "cleanup" => Array('return(is_dir("$path_prefix/$iwbox"));', + "{${$parameter}["checkexist"]} $path_prefix/$iwbox", + "chroot","getout"), + + 'chroot' => Array ('return(chdir("/"));', + "{${$parameter}["chdir"]} $path_prefix/$iwbox/$version/compile/cfg", + "umount","getout"), + + "umount" => Array('system("/bin/umount -v $path_prefix/$iwbox", $retval);return($retval);', + "{${$parameter}["umounting"]} $path_prefix/$iwbox", + "rmdir","umount"), + + "rmdir" => Array('return(rmdir("$path_prefix/$iwbox"));', + "{${$parameter}["rmdir"]} $path_prefix/$iwbox", + "getout","getout") +); + + +if (isset($debug)) +{ + foreach ($cmdlist as $key => $value) + { + echo "$key,$value[0],$value[1],$value[2],$value[3]
      "; + } +} + + +/********************************************* + * Execute the state machine here + *********************************************/ +echo "{${$parameter}["heading"]}
      "; +echo "
      ";
      +for ($state="s00" ; ; )
      +{
      +	if (isset($debug))
      +		echo "{$cmdlist[$state][0]}\n$state: ";
      +
      +	echo "{${cmdlist}[$state][1]}";
      +	flush();
      +	if (@eval(${cmdlist}["$state"][0]))
      +		$state = $cmdlist[$state][2];
      +	else
      +		$state = $cmdlist[$state][3];
      +
      +
      +	if ($state == "getout")
      +	{
      +		echo " ... {${$parameter}["ok"]}\n";
      +		break;
      +	}
      +	else if ($state == "kickout")
      +	{
      +		echo " ... {${$parameter}["not_ok"]}\n";
      +		echo "
      ... {${$parameter}["failed"]}
      "; + echo "
      ";
      +		break;
      +	}
      +	else if ($state == "halt")
      +	{
      +		echo " ... {${$parameter}["not_ok"]}\n";
      +		echo "
      ... {${$parameter}["failed"]}
      "; + echo "
      ";
      +		$state = "cleanup";
      +	}
      +	else
      +	{
      +		if (${cmdlist}[$state][1] != "")
      +			echo " ... {${$parameter}["ok"]}\n";
      +	}
      +}
      +
      +echo "
      ... {${$parameter}["done"]}
      "; + +function back() +{ + global $bssid,$language; + + if (isset($bssid)) + echo ""; +} +?> diff --git a/wxc2_omc/configuration/bssomc/create_objects.php b/wxc2_omc/configuration/bssomc/create_objects.php new file mode 100755 index 0000000..63b2804 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/create_objects.php @@ -0,0 +1,460 @@ + +// Attributes has type as the t +// +// MySQL table: OMCR_Meta_Table and table specified by $tablename +// +// modifyBssParam.php ___ bsstree.php (contents) +// \__ objects.php (main1) +// \create_objects.php +// +?> + + + + + + + + + +BSS OMC -> <?=$objectid;?> + + + +saved=$saved"; +echo "$alarm"; +echo "
      "; +$status=""; + +if (!isset($bssid) || !isset($objectid) || !isset($tablename)) +{ + echo "The required information for this page is invalid.
      \n"; + echo "\n"; + exit(); +} + +include("meta_table_type.inc"); +include("login_parm.inc"); + +// +// Translate the value to string +// e.g. AdminState=2 --> AdminState=Unlocked +// +function translate($input,$data) +{ + $found=-1; + if ($data) + { + $items=split("[;=]",$data); + $no_of_items=count($items); + + for ($i=0;$i<$no_of_items;$i+=2) { + if ( $input == $items[$i+1] ) { + $found=$i; + break; + } + } + if ($found != -1) + return($items[$found]); + } + return($input); +} + +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +// LOOK UP OMCR_META_TABLE for display parameters and buttons +// +// Display different xxxDisplay_Name base on the language selected +// +// + + +$sqlstring = "select Object_Name,Attribute_Name,Attribute_Id,Attribute_Type,Display_Type,Default_Value," . + "${language}Display_Name,${language}Lookup,${language}Help_Text" . + " from OMCR_Meta_Table " . + "where Display_Type<> 0 AND Object_Name='" . substr($tablename,5) . "'"; + +//echo $sqlstring . "
      "; +$objExistFlagSet=CheckObjExist($objectid,substr($tablename,5),$bssid); +ksort($objExistFlagSet); +$haveElementFlag=0; +if(0) +{ + echo "
      ";
      +	print_r($objExistFlagSet);
      +	echo "
      "; +} +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while ( $row = mysqli_fetch_row($result) ) +{ + if (($row[4] == PUSH_BUTTON) || ($row[4] == CONFIRM_PUSH_BUTTON)) //For action item in NMI + list($act_object_name[], $act_attribute_name[], $act_attribute_id[], $act_attribute_type[], + $act_display_type[], $act_default_value[],$act_display_name[], $act_lookup[], + $act_help_text[]) = $row; + else + list($object_name[],$attribute_name[],$attribute_id[],$attribute_type[],$display_type[],$default_value[], + $display_name[],$lookup[],$help_text[]) = $row; +} +$no_of_parms = count($attribute_name); + +echo "=) " . strtoupper($objectid) . "
      \n"; +echo "
      "; + +if ($no_of_parms == 0) +{ + echo "
      "; +} +else +{ + echo "\n"; + echo "\n"; + for ($i=0; $i<$no_of_parms; $i++) + { + //printf("%s%s %s\n",$display_type[$i],$attribute_name[$i],$lookup[$i]); + switch($display_type[$i]) + { + case DO_NOT_DISPLAY: //do not display + $widget=""; + continue; + case PULLDOWN_MENU: //pulldown menu + $widget=""; + ?> + + "; + break; + case LABEL: //label + if (!strcasecmp($attribute_name[$i], "adminstate")) + $adminstate = $default_value[$i]; + $widget=translate($default_value[$i],$lookup[$i]); + $widget.="\n"; + break; + case RADIO_BUTTON: //radio button + $widget="" . + $default_value[$i] . "\n"; + break; + case CHECKBOX: //check box + $widget=""; + break; + case TEXTAREA: //text area + $widget=""; + break; + } + + if (strstr($saved,$attribute_name[$i]) != false) + $color="#00F0FF"; + else + $color="#FFFFFF"; + + $widget_type = ""; + + printf(" \n", + $color, $help_text[$i], $display_name[$i], $widget_type, $widget); + } + echo "
      %s%s%s
      \n"; +} + +// +// Display the action buttons & confirmed action buttons +// +// +$no_of_actions = count($act_attribute_name); +for ($i=0;$i<$no_of_actions;$i++) +{ + if (!strncasecmp($act_lookup[$i],"javascript:",11)) // Direct to another webpage + { + echo "\n"; + } + else if ($act_lookup[$i] != '') // NMI Actions + { + if ($act_display_type[$i] == CONFIRM_PUSH_BUTTON) + $need_confirm = "true"; + else + $need_confirm = "false"; + + echo "\n"; + } + else if ($act_attribute_name[$i] == "Revert") // Reset Webpage input the original value + { + echo "\n"; + } + else // Simply Save the altered values + { + echo "\n"; + } +} + + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
      \n"; +?> + +
      + + diff --git a/wxc2_omc/configuration/bssomc/data_download.inc b/wxc2_omc/configuration/bssomc/data_download.inc new file mode 100755 index 0000000..999f6d9 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/data_download.inc @@ -0,0 +1,26 @@ + "OMC参数下载", + confirm_qu => "决定下载OMC参数到BSC?", + step1 => "步骤一: 下载参数到BSC", + step2 => "步骤二: 同步版面参数", + step3 => "步骤三: 下载完成请手动启动系统对象。", + confirm => "确定", + back => "返回", + dnloadfail => "下载失败", + done => "完成。" + + ); + +$engnamearray = Array( + header => "Download Parameters to BSC", + confirm_qu => "Are you sure you want to download paremeters from OMC to BSC?", + step1 => "Step 1: Download parameters to BSC", + step2 => "Step 2: Update Gui parameters", + step3 => "Step 3: Finished. You need to unlock system objects manually.", + confirm => "CONFIRM", + back => "BACK", + dnloadfail => "Download is Failed.", + done => "Done." + ); +?> diff --git a/wxc2_omc/configuration/bssomc/data_download.php b/wxc2_omc/configuration/bssomc/data_download.php new file mode 100755 index 0000000..84d30ed --- /dev/null +++ b/wxc2_omc/configuration/bssomc/data_download.php @@ -0,0 +1,145 @@ + + + + + + + + + + ${$parameter}[step1], + 2 => ${$parameter}[step2], + 3 => ${$parameter}[step3] +); + + +echo "\n"; +echo "{${$parameter}[header]}
      \n"; + +if ($curr_step == 0) +{ + echo "{${$parameter}[confirm_qu]}
      \n"; + echo "
      \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
      \n"; +} +else +{ + /***************************************** + * Display pre-defined text + *****************************************/ + for ($i=1; $i<$curr_step; $i++) + { + echo "{$steps[$i]} ... {${$parameter}[done]}
      \n"; + flush(); + } + + echo "{$steps[$curr_step]}
      \n"; + flush(); + $retval=-1; + switch ($curr_step) + { + case 1: $retval = download_parameters($db,$bssid,$language,$debug); + flush(); + sleep(2); + break; + case 2: $retval = upload_parameters($db,$bssid,$debug); + flush(); + sleep(2); + break; + default: + break; + } +} + + +/***************************************** + * Stop refreshing when all tasks finished + *****************************************/ +if ($curr_step >= sizeof($steps)) +{ + echo "
      \n"; + echo "
      \n"; + echo "\n"; + echo "
      \n"; +} +else if ($curr_step > 0) +{ + if ($retval == 0) + { + echo "
      \n"; + if ($debug) + echo "\n"; + else + echo "\n"; + echo "
      \n"; + } + else /* Failed */ + { + echo " ... {${$parameter}[dnloadfail]}
      \n"; + echo "
      \n"; + echo "
      \n"; + echo "\n"; + echo "
      \n"; + } +} +?> + + + diff --git a/wxc2_omc/configuration/bssomc/data_upload.inc b/wxc2_omc/configuration/bssomc/data_upload.inc new file mode 100755 index 0000000..4cb37db --- /dev/null +++ b/wxc2_omc/configuration/bssomc/data_upload.inc @@ -0,0 +1,26 @@ + "BSC参数上载", + confirm_qu => "决定上载BSC参数到OMC?", + step1 => "步骤一: 上载参数到OMC", + step2 => "步骤二: 同步版面参数", + step3 => "步骤三: 上载完成", + confirm => "确定", + back => "返回", + uploadfail => "上载失败", + done => "完成。请手动启动系统对象。" + + ); + +$engnamearray = Array( + header => "Upload Parameters to OMC", + confirm_qu => "Are you sure you want to upload paremeters from BSC to OMC?", + step1 => "Step 1: Upload parameters to OMC", + step2 => "Step 2: Update Gui parameters", + step3 => "Step 3: Finished.", + confirm => "CONFIRM", + back => "BACK", + uploadfail => "Upload is Failed.", + done => "Done. You need to unlock system objects manually." + ); +?> diff --git a/wxc2_omc/configuration/bssomc/data_upload.php b/wxc2_omc/configuration/bssomc/data_upload.php new file mode 100755 index 0000000..c9f7f54 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/data_upload.php @@ -0,0 +1,135 @@ + + + + + + + + + + ${$parameter}[step1], + 2 => ${$parameter}[step2], + 3 => ${$parameter}[step3] +); + + +echo "\n"; +echo "{${$parameter}[header]}
      \n"; + +if ($curr_step == 0) +{ + echo "{${$parameter}[confirm_qu]}
      \n"; + echo "
      \n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
      \n"; +} +else +{ + /***************************************** + * Display pre-defined text + *****************************************/ + for ($i=1; $i<$curr_step; $i++) + { + echo $steps[$i] . " ... {${$parameter}[done]}
      \n"; + flush(); + } + + echo $steps[$curr_step] . "
      \n"; + flush(); + $retval=-1; + switch ($curr_step) + { + case 1: $retval = upload_parameters($db,$bssid,$debug); + flush(); + sleep(2); + break; + default: + break; + } +} + + +/***************************************** + * Stop refreshing when all tasks finished + *****************************************/ +if ($curr_step >= sizeof($steps)) +{ + echo "
      \n"; + echo "
      \n"; + echo "\n"; + echo "
      \n"; +} +else if ($curr_step > 0) +{ + if ($retval == 0) + { + echo "
      \n"; + echo "\n"; + echo "
      \n"; + } + else /* Failed */ + { + echo " ... {${$parameter}[uploadfail]}
      \n"; + echo "
      \n"; + echo "
      \n"; + echo "\n"; + echo "
      \n"; + } +} +?> + + + diff --git a/wxc2_omc/configuration/bssomc/display_type.inc b/wxc2_omc/configuration/bssomc/display_type.inc new file mode 100755 index 0000000..210a9de --- /dev/null +++ b/wxc2_omc/configuration/bssomc/display_type.inc @@ -0,0 +1,10 @@ + diff --git a/wxc2_omc/configuration/bssomc/download.inc b/wxc2_omc/configuration/bssomc/download.inc new file mode 100755 index 0000000..d50cc27 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/download.inc @@ -0,0 +1,395 @@ +0 AND Attribute_Id<>'' AND Object_Name='$name[1]'"; + if ($debug) echo "$sqlstring
      "; else echo "."; + echo "sql>$sqlstring
      "; + $res = mysql_query($sqlstring, $db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $row = mysqli_fetch_row($res) ) + { + list($parameters[],$attribute_id[],$attribute_type[],$default_value[]) = $row; + + } + mysql_free_result($res); + + $sqlstring = "SELECT " . join(",",$parameters) . " FROM $tablename WHERE bssid=$bssid AND ObjectId='$objectid'"; + echo "$sqlstring
      "; +} + +/* + * Create NMI Set Command for paramter download + */ +function create_nmi_command($db,$sqlstring,$parameters,$attribute_id,$attribute_type,$default_value,&$nmicommand,$debug) +{ + if ($debug) echo "$sqlstring
      "; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + $value = mysqli_fetch_row($res); + mysql_free_result($res); + $nmicommand = "set"; + for ($i=0;$i"; +} + +/* + * Set BssFunc->DownLoadInProgress parameters to zero and return the given return value + */ +function set_download_in_progress_zero($db,$bssid,$language,$return_value,$debug) +{ + if ($debug) echo "==) oid BssFunc" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"oid BssFunc",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); + if ($debug) echo "==) set DownLoadInProgress=0" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"set DownLoadInProgress=0", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); + + return ($return_value); +} + +/* + * Return 0 if success, otherwise -1 + */ +function download_parameters($db,$bssid,$language,$debug) +{ + $resultcode = $responsecode = $response = null; + $retval = 0; + if ($debug) echo "==) oid BssFunc" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"oid BssFunc",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + if ($debug) echo "==) set DownLoadInProgress=1" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"set DownLoadInProgress=1", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + + $objectlist = Array( + "Card.0.10", + "Bsc.0", + "AIf.0", + "ALinkSet.0.0", + "ALink.0.0.0" + ); + $tablenamelist = Array( + "OMCR_ClockMod", + "OMCR_Bsc", + "OMCR_AIf", + "OMCR_ALinkSet", + "OMCR_ALink" + ); + + /********************************************************* + * For each ALink object, download ALink object parameters + *********************************************************/ + $sqlstring = "SELECT SUBSTRING_INDEX(ObjectId,'.',-1) FROM OMCR_BSSTREE WHERE bssid=$bssid" . + " AND Presence=1 AND ObjectId='ALink.0.0.%'" . + " AND ObjectId<>'ALink.0.0.0'"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while ((list($row) = mysqli_fetch_row($res)) != null) + { + if ($debug) echo "==) oid ALinkSet.0.0" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"oid ALinkSet.0.0", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + if ($debug) echo "==) create ALink $row" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"create ALink $row", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + $objectlist = array_merge($objectlist, Array ( "ALink.0.0.$row")); + $tablenamelist = array_merge($tablenamelist, Array("OMCR_ALink")); + } + + /********************************************************* + * For each E1 Card, download E1port object parameters + *********************************************************/ + $sqlstring = "SELECT SUBSTRING_INDEX(ObjectId,'.',-1) FROM OMCR_BSSTREE WHERE bssid=$bssid" . + " AND Presence=1 AND ObjectId REGEXP 'Card.0.[1-8]$'"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $e1trmod_id_list = null; + while ( $row = mysqli_fetch_row($res) ) + { + list($e1trmod_id_list[]) = $row; + } + for ($i=0; $i"; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"oid $objectid", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + if ($debug) echo "==) $nmicommand" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"$nmicommand", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + } + } + + /********************************************* + * For each BtsMgr, download parameters + *********************************************/ + $sqlstring = "SELECT SUBSTRING_INDEX(ObjectId,'.',-1) FROM OMCR_BSSTREE" . + " WHERE bssid=$bssid AND Presence=1 AND ObjectId Like 'BtsMgr.%'"; + if ($debug) echo "$sqlstring
      \n"; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + $btsmgr_list=null; + while ( $row = mysqli_fetch_row($res) ) + { + list($btsmgr_list[]) = $row; + } + mysql_free_result($res); + + //for ($i=0; $i"; + if ($debug) echo "==) oid BssFunc" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"oid BssFunc", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + if ($debug) echo "==) create BtsMgr $btsid" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"create BtsMgr $btsid", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + //echo "==) oid BtsMgr_Shelf.$btsid.0" . "
      "; + //$retval = send_nmicommand($db,$bssid,$language,"oid BtsMgr_Shelf.$btsid.0", + // $resultcode, $responsecode,$response,$debug); + //if (($retval != 0) || ($resultcode[0] != 0)) + // return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + //flush(); + + + /************************* + * Create E1TrMod + *************************/ + $sqlstring = "SELECT SUBSTRING_INDEX(ObjectId,'.',-1) FROM OMCR_BSSTREE WHERE bssid=$bssid" . + " AND Presence=1 AND ObjectId REGEXP 'BtsMgr_Shelf_Card.$btsid.0.[1-8]$'"; + if ($debug) echo "$sqlstring
      \n"; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $card_id_list = null; + while ( $row = mysqli_fetch_row($res) ) + { + list($card_id_list[]) = $row; + } + mysql_free_result($res); + + for ($j=0; $j"; else echo "
      ."; + $retval = send_nmicommand($db,$bssid,$language,"oid BtsMgr_Shelf.$btsid.0", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + if ($card_id_list[$j] == 1) + { + $objectlist = array_merge($objectlist, + Array ( "BtsMgr_Shelf_Card_Port.$btsid.0.$card_id_list[$j].0", + "BtsMgr_Shelf_Card_Port.$btsid.0.$card_id_list[$j].1") + ); + $tablenamelist = array_merge($tablenamelist, Array("OMCR_E1port", "OMCR_E1port")); + + if ($debug) echo "==) create E1trmod $card_id_list[$j]" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"create E1trmod $card_id_list[$j]", + $resultcode, $responsecode,$response,$debug); + } + else + { + $objectlist = array_merge($objectlist, + Array ( "Trx.$btsid.0.$card_id_list[$j]", + "RCarrier.$btsid.0.$card_id_list[$j]", + "TrxCh.$btsid.0.$card_id_list[$j].0", + "TrxCh.$btsid.0.$card_id_list[$j].1", + "TrxCh.$btsid.0.$card_id_list[$j].2", + "TrxCh.$btsid.0.$card_id_list[$j].3", + "TrxCh.$btsid.0.$card_id_list[$j].4", + "TrxCh.$btsid.0.$card_id_list[$j].5", + "TrxCh.$btsid.0.$card_id_list[$j].6", + "TrxCh.$btsid.0.$card_id_list[$j].7") + ); + $tablenamelist = array_merge($tablenamelist, + Array ( "OMCR_Trx", "OMCR_RCarrier", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh") + ); + + if ($debug) echo "==) create TrxMod $card_id_list[$j]" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"create TrxMod $card_id_list[$j]", + $resultcode, $responsecode,$response,$debug); + } + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + } + + for ($j=0; $j"; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"oid $objectid", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + if ($debug) echo "==) $nmicommand" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"$nmicommand", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (set_download_in_progress_zero($db,$bssid,$language,-1,$debug)); + flush(); + } + } + } + if ($debug) echo "==) oid BssFunc" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"oid BssFunc", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); + if ($debug) echo "==) set DownLoadInProgress=0" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"set DownLoadInProgress=0", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); + + return 0; +} + +/* + * upload parameters from BSC to OMC + * Return 0 if success, otherwise -1 + */ +function upload_parameters($db,$bssid,$debug) +{ + if ($debug) echo "==) Upload parameters" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,$language,"upload $bssid", + $resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); +} + +?> diff --git a/wxc2_omc/configuration/bssomc/dropbss.php b/wxc2_omc/configuration/bssomc/dropbss.php new file mode 100755 index 0000000..b5e3a9e --- /dev/null +++ b/wxc2_omc/configuration/bssomc/dropbss.php @@ -0,0 +1,172 @@ + +"; + echo "mode=$mode
      "; + echo "sysId=$sysId
      "; + echo "ip=$ip
      "; + echo "bssid = $bssid
      "; +} + +$baseUrl="../configuration/systemList/systemConf.php?bssId=$bssid&&mode=delete&sysId=$sysId&ip=$ip"; +//check in url +if(strlen($sysId) < 5 || $bssIdArr[1] == '' || $mode !='delete'){ + $errorInfo = "This url's value error!"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + $errorInfo=rawurlencode($errorInfo); + $returnUrl=$baseUrl.'&errorInfo='.$errorInfo; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); +} + + +// connect database +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +$sqlstring = "SELECT bssid,ip,connected FROM OMCR_BSSTABLE WHERE ip='$ip' OR bssid ='$bssid'"; +if($DEBUG) echo "$sqlstring
      "; +$resultSet = @mysql_query($sqlstring,$db); +$resultRowNum = @mysqli_num_rows($resultSet); +if($resultRowNum > 0){ + $resultRows=mysqli_fetch_array($resultSet); + if($resultRows[connected] != '255'){ //exsit and connected + $updateSql = "UPDATE OMCR_BSSTABLE + SET ip='', name='', remark='', connected='0', alarmed='0', uploaded='0' + WHERE bssid ='$bssid' + "; + if($DEBUG) echo "
      updateSql=$updateSql"; + mysql_query($updateSql,$db); + echo mysqli_error($pubConn); + }else{ + $ip = $resultRows[ip]; + $bssid = $resultRows[bssid]; + } +}else{ + $returnUrl=$baseUrl; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); +} + + + +//insert to command table +$sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +while (list($row_no[]) = mysqli_fetch_row($res)); +$no_of_rows = mysqli_num_rows($res); +mysql_free_result($res); + +if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) +{ + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + $errorInfo = "Command table is full: Wait and send the command again"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + $errorInfo=rawurlencode($errorInfo); + $returnUrl=$baseUrl.'&errorInfo='.$errorInfo; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); +} + +// +// Insert the delete bss commands in OMCR_COMMAND out of 10 available rows +// +$i=0; +do +{ + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + "{$row_no[$i]},-1,'dropbss $bssid $ip',null,255,-1,null,null,null)"; + //echo "dropbss=$sqlstring
      "; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while ($i<10 && mysql_affected_rows() != 2); +$cmd_row_no = $row_no[$i-1]; +if ($i>=10) +{ + $errorInfo = "Fail to insert command into Command table"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + $errorInfo=rawurlencode($errorInfo); + $returnUrl=$baseUrl.'&errorInfo='.$errorInfo; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); +} + +// +// +// Wait for response: timeout after 500ms x 10 = 5 secs +// +// +$i=0; +while ($i<20) +{ + $result=$response=null; + usleep(500000); // 0.5 sec + $sqlstring = "SELECT resultcode,result,responsecode,response from OMCR_COMMAND " . + "WHERE status=0 AND row_no=$cmd_row_no "; + echo "$sqlstring
      "; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + { + list($resultcode,$result,$responsecode,$response) = $mydata; + } + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + + if ($no_of_rows = 1){ + if ($resultcode != 0){ + $errorInfo = "dropbss command failed"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + $errorInfo=rawurlencode($errorInfo); + $returnUrl=$baseUrl.'&errorInfo='.$errorInfo; + if($DEBUG) echo "
      returnUrl=$returnUrl"; + if(!$DEBUG) echo " "; + exit(); + }else{ + // Success !!! + $returnUrl=$baseUrl; + echo " "; + exit(); + } + } +} +?> + diff --git a/wxc2_omc/configuration/bssomc/ftpGetFile b/wxc2_omc/configuration/bssomc/ftpGetFile new file mode 100755 index 0000000..f1793ca --- /dev/null +++ b/wxc2_omc/configuration/bssomc/ftpGetFile @@ -0,0 +1,20 @@ +#!/bin/bash + +remote_ip=$1 +logName=$2 +logPassword=$3 +remote_dir=$4 +local_dir=$5 +file=$6 + +echo "$remote_dir $local_dir $file" >> /tmp/test.txt + +ftp -i -n $remote_ip <'|grep '[0-9][0-9]:[0-9][0-9]:[0-9][0-9]'|awk '{print $4}'` + dir_list=`echo "$response" |grep -i ''|grep -v '\.'|awk '{print $4}'` + + echo -------FILE---------- + for file in $file_list; do +#ftp -i -n $remote_ip <> $file_list_filename + done + + echo -------DIR---------- + for dir in $dir_list; do + mkdir $cur_local_dir/$dir 2>/dev/null + chmod 755 $cur_local_dir/$dir + echo mkdir $cur_local_dir/$dir + + get_whole_dir $cur_local_dir/$dir $cur_remote_dir/$dir + done + + +} + + +get_whole_dir $local_dir $remote_dir + diff --git a/wxc2_omc/configuration/bssomc/header.inc b/wxc2_omc/configuration/bssomc/header.inc new file mode 100755 index 0000000..33d8fff --- /dev/null +++ b/wxc2_omc/configuration/bssomc/header.inc @@ -0,0 +1,46 @@ + + + + + +EOT; + + +?> diff --git a/wxc2_omc/configuration/bssomc/images/I.gif b/wxc2_omc/configuration/bssomc/images/I.gif new file mode 100755 index 0000000..3275f6e Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/I.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/L.gif b/wxc2_omc/configuration/bssomc/images/L.gif new file mode 100755 index 0000000..3847cd2 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/L.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/T.gif b/wxc2_omc/configuration/bssomc/images/T.gif new file mode 100755 index 0000000..f9b882a Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/T.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/abis0_down.gif b/wxc2_omc/configuration/bssomc/images/abis0_down.gif new file mode 100755 index 0000000..832544f Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/abis0_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/abis0_up.gif b/wxc2_omc/configuration/bssomc/images/abis0_up.gif new file mode 100755 index 0000000..8f157f0 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/abis0_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/abis0_warn.gif b/wxc2_omc/configuration/bssomc/images/abis0_warn.gif new file mode 100755 index 0000000..18b79b4 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/abis0_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/abis1_down.gif b/wxc2_omc/configuration/bssomc/images/abis1_down.gif new file mode 100755 index 0000000..77e2bd0 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/abis1_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/abis1_up.gif b/wxc2_omc/configuration/bssomc/images/abis1_up.gif new file mode 100755 index 0000000..2db0510 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/abis1_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/abis1_warn.gif b/wxc2_omc/configuration/bssomc/images/abis1_warn.gif new file mode 100755 index 0000000..342eb19 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/abis1_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/aif0_down.gif b/wxc2_omc/configuration/bssomc/images/aif0_down.gif new file mode 100755 index 0000000..96e383b Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/aif0_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/aif0_up.gif b/wxc2_omc/configuration/bssomc/images/aif0_up.gif new file mode 100755 index 0000000..5ec8b28 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/aif0_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/aif0_warn.gif b/wxc2_omc/configuration/bssomc/images/aif0_warn.gif new file mode 100755 index 0000000..695c54b Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/aif0_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/aif1_down.gif b/wxc2_omc/configuration/bssomc/images/aif1_down.gif new file mode 100755 index 0000000..65c2723 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/aif1_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/aif1_up.gif b/wxc2_omc/configuration/bssomc/images/aif1_up.gif new file mode 100755 index 0000000..e1ab0e0 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/aif1_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/aif1_warn.gif b/wxc2_omc/configuration/bssomc/images/aif1_warn.gif new file mode 100755 index 0000000..51f2673 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/aif1_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/bsciwp_down.gif b/wxc2_omc/configuration/bssomc/images/bsciwp_down.gif new file mode 100755 index 0000000..6ba076e Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/bsciwp_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/bsciwp_up.gif b/wxc2_omc/configuration/bssomc/images/bsciwp_up.gif new file mode 100755 index 0000000..3552184 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/bsciwp_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/bsciwp_warn.gif b/wxc2_omc/configuration/bssomc/images/bsciwp_warn.gif new file mode 100755 index 0000000..77c3c55 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/bsciwp_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/bspiwp_down.gif b/wxc2_omc/configuration/bssomc/images/bspiwp_down.gif new file mode 100755 index 0000000..0d12744 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/bspiwp_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/bspiwp_up.gif b/wxc2_omc/configuration/bssomc/images/bspiwp_up.gif new file mode 100755 index 0000000..81dcdc7 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/bspiwp_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/bspiwp_warn.gif b/wxc2_omc/configuration/bssomc/images/bspiwp_warn.gif new file mode 100755 index 0000000..fefee71 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/bspiwp_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/btsiwp_down.gif b/wxc2_omc/configuration/bssomc/images/btsiwp_down.gif new file mode 100755 index 0000000..9a6c5df Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/btsiwp_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/btsiwp_up.gif b/wxc2_omc/configuration/bssomc/images/btsiwp_up.gif new file mode 100755 index 0000000..8b4af6b Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/btsiwp_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/btsiwp_warn.gif b/wxc2_omc/configuration/bssomc/images/btsiwp_warn.gif new file mode 100755 index 0000000..96d5293 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/btsiwp_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card1_down.gif b/wxc2_omc/configuration/bssomc/images/card1_down.gif new file mode 100755 index 0000000..ace498e Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card1_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card1_up.gif b/wxc2_omc/configuration/bssomc/images/card1_up.gif new file mode 100755 index 0000000..03bed42 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card1_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card1_warn.gif b/wxc2_omc/configuration/bssomc/images/card1_warn.gif new file mode 100755 index 0000000..f4de24e Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card1_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card2_down.gif b/wxc2_omc/configuration/bssomc/images/card2_down.gif new file mode 100755 index 0000000..07aefda Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card2_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card2_up.gif b/wxc2_omc/configuration/bssomc/images/card2_up.gif new file mode 100755 index 0000000..59ad376 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card2_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card2_warn.gif b/wxc2_omc/configuration/bssomc/images/card2_warn.gif new file mode 100755 index 0000000..bf95ee4 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card2_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card3_down.gif b/wxc2_omc/configuration/bssomc/images/card3_down.gif new file mode 100755 index 0000000..69b5b62 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card3_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card3_up.gif b/wxc2_omc/configuration/bssomc/images/card3_up.gif new file mode 100755 index 0000000..93b84bb Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card3_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card3_warn.gif b/wxc2_omc/configuration/bssomc/images/card3_warn.gif new file mode 100755 index 0000000..be35c7d Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card3_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card4_down.gif b/wxc2_omc/configuration/bssomc/images/card4_down.gif new file mode 100755 index 0000000..faf844e Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card4_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card4_up.gif b/wxc2_omc/configuration/bssomc/images/card4_up.gif new file mode 100755 index 0000000..b0bdde2 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card4_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card4_warn.gif b/wxc2_omc/configuration/bssomc/images/card4_warn.gif new file mode 100755 index 0000000..c2b0d5f Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card4_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card5_down.gif b/wxc2_omc/configuration/bssomc/images/card5_down.gif new file mode 100755 index 0000000..6b80107 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card5_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card5_up.gif b/wxc2_omc/configuration/bssomc/images/card5_up.gif new file mode 100755 index 0000000..8934112 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card5_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card5_warn.gif b/wxc2_omc/configuration/bssomc/images/card5_warn.gif new file mode 100755 index 0000000..48ee7e4 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card5_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card6_down.gif b/wxc2_omc/configuration/bssomc/images/card6_down.gif new file mode 100755 index 0000000..abe76d4 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card6_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card6_up.gif b/wxc2_omc/configuration/bssomc/images/card6_up.gif new file mode 100755 index 0000000..c043b9f Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card6_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card6_warn.gif b/wxc2_omc/configuration/bssomc/images/card6_warn.gif new file mode 100755 index 0000000..2a78b18 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card6_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card7_down.gif b/wxc2_omc/configuration/bssomc/images/card7_down.gif new file mode 100755 index 0000000..5d1d581 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card7_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card7_up.gif b/wxc2_omc/configuration/bssomc/images/card7_up.gif new file mode 100755 index 0000000..b2af6ff Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card7_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card7_warn.gif b/wxc2_omc/configuration/bssomc/images/card7_warn.gif new file mode 100755 index 0000000..e4d8ffa Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card7_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card8_down.gif b/wxc2_omc/configuration/bssomc/images/card8_down.gif new file mode 100755 index 0000000..73b9ddd Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card8_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card8_up.gif b/wxc2_omc/configuration/bssomc/images/card8_up.gif new file mode 100755 index 0000000..c7e0a5e Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card8_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/card8_warn.gif b/wxc2_omc/configuration/bssomc/images/card8_warn.gif new file mode 100755 index 0000000..735e3c0 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/card8_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/gt_minus.gif b/wxc2_omc/configuration/bssomc/images/gt_minus.gif new file mode 100755 index 0000000..bc9cecd Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/gt_minus.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/iwp_down.gif b/wxc2_omc/configuration/bssomc/images/iwp_down.gif new file mode 100755 index 0000000..b2fbb84 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/iwp_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/iwp_up.gif b/wxc2_omc/configuration/bssomc/images/iwp_up.gif new file mode 100755 index 0000000..a333ece Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/iwp_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/lastblk.gif b/wxc2_omc/configuration/bssomc/images/lastblk.gif new file mode 100755 index 0000000..c533260 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/lastblk.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/lastminus.gif b/wxc2_omc/configuration/bssomc/images/lastminus.gif new file mode 100755 index 0000000..9546945 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/lastminus.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/lastplus.gif b/wxc2_omc/configuration/bssomc/images/lastplus.gif new file mode 100755 index 0000000..57afafb Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/lastplus.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/line.gif b/wxc2_omc/configuration/bssomc/images/line.gif new file mode 100755 index 0000000..85ada3d Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/line.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/midblk.gif b/wxc2_omc/configuration/bssomc/images/midblk.gif new file mode 100755 index 0000000..2716bb3 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/midblk.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/midminus.gif b/wxc2_omc/configuration/bssomc/images/midminus.gif new file mode 100755 index 0000000..9546945 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/midminus.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/midplus.gif b/wxc2_omc/configuration/bssomc/images/midplus.gif new file mode 100755 index 0000000..57afafb Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/midplus.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/minus_gt.gif b/wxc2_omc/configuration/bssomc/images/minus_gt.gif new file mode 100755 index 0000000..f6b9b7e Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/minus_gt.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/minus_st.gif b/wxc2_omc/configuration/bssomc/images/minus_st.gif new file mode 100755 index 0000000..8d5b71d Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/minus_st.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/none.gif b/wxc2_omc/configuration/bssomc/images/none.gif new file mode 100755 index 0000000..9d6e427 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/none.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/slot.gif b/wxc2_omc/configuration/bssomc/images/slot.gif new file mode 100755 index 0000000..d804e69 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/slot.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/st_minus.gif b/wxc2_omc/configuration/bssomc/images/st_minus.gif new file mode 100755 index 0000000..6418ec4 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/st_minus.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx2_down.gif b/wxc2_omc/configuration/bssomc/images/trx2_down.gif new file mode 100755 index 0000000..a6cb91a Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx2_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx2_up.gif b/wxc2_omc/configuration/bssomc/images/trx2_up.gif new file mode 100755 index 0000000..2cd22ac Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx2_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx2_warn.gif b/wxc2_omc/configuration/bssomc/images/trx2_warn.gif new file mode 100755 index 0000000..6431cd0 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx2_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx4_down.gif b/wxc2_omc/configuration/bssomc/images/trx4_down.gif new file mode 100755 index 0000000..51db583 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx4_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx4_up.gif b/wxc2_omc/configuration/bssomc/images/trx4_up.gif new file mode 100755 index 0000000..45732d2 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx4_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx4_warn.gif b/wxc2_omc/configuration/bssomc/images/trx4_warn.gif new file mode 100755 index 0000000..018e3a0 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx4_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx6_down.gif b/wxc2_omc/configuration/bssomc/images/trx6_down.gif new file mode 100755 index 0000000..ac8a763 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx6_down.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx6_up.gif b/wxc2_omc/configuration/bssomc/images/trx6_up.gif new file mode 100755 index 0000000..fcd9b6b Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx6_up.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/trx6_warn.gif b/wxc2_omc/configuration/bssomc/images/trx6_warn.gif new file mode 100755 index 0000000..af7337b Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/trx6_warn.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/white.gif b/wxc2_omc/configuration/bssomc/images/white.gif new file mode 100755 index 0000000..07b1a85 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/white.gif differ diff --git a/wxc2_omc/configuration/bssomc/images/whiteslot.gif b/wxc2_omc/configuration/bssomc/images/whiteslot.gif new file mode 100755 index 0000000..5c58ba2 Binary files /dev/null and b/wxc2_omc/configuration/bssomc/images/whiteslot.gif differ diff --git a/wxc2_omc/configuration/bssomc/ip2name.inc b/wxc2_omc/configuration/bssomc/ip2name.inc new file mode 100755 index 0000000..4cadb76 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/ip2name.inc @@ -0,0 +1,88 @@ + "bss0", + "172.18.128.101" => "bss1", + "172.18.128.102" => "bss2", + "172.18.128.103" => "bss3", + "172.18.128.104" => "bss4", + "172.18.128.105" => "bss5", + "172.18.128.106" => "bss6", + "172.18.128.107" => "bss7", + "172.18.128.108" => "bss8", + "172.18.128.109" => "bss9", + "172.18.128.110" => "bss10", + "172.18.128.111" => "bss11" + ); + +$name2ip = Array( + "bss0" => "172.18.128.100", + "bss1" => "172.18.128.101", + "bss2" => "172.18.128.102", + "bss3" => "172.18.128.103", + "bss4" => "172.18.128.104", + "bss5" => "172.18.128.105", + "bss6" => "172.18.128.106", + "bss7" => "172.18.128.107", + "bss8" => "172.18.128.108", + "bss9" => "172.18.128.109", + "bss10" => "172.18.128.110", + "bss11" => "172.18.128.111" + ); + +$bssid2ip = Array( + "0" => "172.18.128.100", + "1" => "172.18.128.101", + "2" => "172.18.128.102", + "3" => "172.18.128.103", + "4" => "172.18.128.104", + "5" => "172.18.128.105", + "6" => "172.18.128.106", + "7" => "172.18.128.107", + "8" => "172.18.128.108", + "9" => "172.18.128.109", + "10" => "172.18.128.110", + "11" => "172.18.128.111" + ); +*/ +function ip2name($ip){ + $db ='BssOmcDb'; + $sql = "SELECT bssid FROM BssOmcDb.OMCR_BSSTABLE " . + " WHERE ip=$ip"; + if($DEBUG) echo "
      sql = $sql
      "; + $result = mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + return 'bss'.$rows[bssid]; +} + +function name2ip($name){ + $db ='BssOmcDb'; + $sql = "SELECT ip FROM BssOmcDb.OMCR_BSSTABLE " . + " WHERE bssid=".substr($name,3); + if($DEBUG) echo "
      sql = $sql
      "; + $result = mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + return $rows[ip]; +} + +function bssid2ip($bssid){ + $db ='BssOmcDb'; + $sql = "SELECT ip FROM BssOmcDb.OMCR_BSSTABLE " . + " WHERE bssid=$bssid"; + if($DEBUG) echo "
      sql = $sql
      "; + $result = mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + return $rows[ip]; +} +?> diff --git a/wxc2_omc/configuration/bssomc/login_parm.inc b/wxc2_omc/configuration/bssomc/login_parm.inc new file mode 100755 index 0000000..ac38d0f --- /dev/null +++ b/wxc2_omc/configuration/bssomc/login_parm.inc @@ -0,0 +1,17 @@ + + diff --git a/wxc2_omc/configuration/bssomc/meta_table_type.inc b/wxc2_omc/configuration/bssomc/meta_table_type.inc new file mode 100755 index 0000000..9bc5d80 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/meta_table_type.inc @@ -0,0 +1,19 @@ + diff --git a/wxc2_omc/configuration/bssomc/modify.inc b/wxc2_omc/configuration/bssomc/modify.inc new file mode 100755 index 0000000..1e23076 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/modify.inc @@ -0,0 +1,16 @@ + "保存完成", + actioniscompleted => "任务完成", + nobsscommresponse => "BssComm 没有回应", + nobscresponse => "BSC 没有回应", + cmdtablefull => "命令表没有空间,一会儿后再试" + ); +$engnamearray = Array( + saveiscompleted => "Save is Completed: (modified items are highlighted)", + actioniscompleted => "Action is completed", + nobsscommresponse => "No response from BssComm", + nobscresponse => "No response from BSC", + cmdtablefull => "Command table is full: wait and send the command later" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/modify.php b/wxc2_omc/configuration/bssomc/modify.php new file mode 100755 index 0000000..8fa5afa --- /dev/null +++ b/wxc2_omc/configuration/bssomc/modify.php @@ -0,0 +1,549 @@ + modify.php --> $url +// +// +?> + + +\n"; + $jump_url="{$url}?". + "language={$language}&". + "bssid={$bssid}&". + "objectid={$objectid}&". + "tablename={$tablename}&". + "progress_value={$progress_value}&". + "status='Nothing is requested'"; + + if(isset($x)) + $jump_url.="&x=$x"; + if(isset($y)) + $jump_url.="&y=$y"; + echo "jump2url('{$jump_url}');\n"; + echo "\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&status='Nothing is requested'" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + return; +} + +// +// Find the available row in OMCR_COMMAND to insert nmi commands +// Get 10 available and insert 2 nmi commands +// 1. oid $objectid +// 2. set $para1=$val1 [$para2=$val2] ... +// +include("meta_table_type.inc"); +include("login_parm.inc"); +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +if ($nmicommand != '') +{ + $nmicmd = $nmicommand; +} + +if ($modified_data != '') +{ + + //echo $modified_data . "
      "; + $parm_name = explode(",",$modified_data); + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd="set"; + + foreach ($parm_name as $attribute) + { + + switch(${"t$attribute"}) + { + + case NUMBERS: + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + + if (isset(${$attribute})) + { + //$nmicmd.=" $attribute=${$attribute}"; + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd.=" $tmpStr=${$attribute}"; + else + $nmicmd.=" ${$attribute}"; + } + else // for checkbox: ${$attribute}=true or false + { + //$nmicmd.=" $attribute=0 + $nmicmd.=" $tmpStr=0"; + } + break; + case STRINGS: + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + if(strlen($tmpStr)>0){ + //$nmicmd.=" $tmpStr=\"" . rawurlencode(${$attribute}) . "\""; + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd.=" $tmpStr=\"" . rawurlencode(${$attribute}) . "\""; + else + $nmicmd.=" \"" . rawurlencode(${$attribute}) . "\""; + }else{ + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd.=" $attribute=\"" . rawurlencode(${$attribute}) . "\""; + else + $nmicmd.=" \"" . rawurlencode(${$attribute}) . "\""; + } + break; + case INTEGER_ARRAY: + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + $stringarray = explode("_",$tmpStr); + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd.= " $stringarray[0]=[$stringarray[1]=${$attribute}]"; + else + $nmicmd.= " [$stringarray[1]=${$attribute}]"; + break; + default: + break; + } + //echo $nmicmd . "
      "; + } +} + +$sqlstring = "LOCK TABLES OMCR_COMMAND WRITE"; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +$sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +while (list($row_no[]) = mysqli_fetch_row($res)); +$no_of_rows = mysqli_num_rows($res); +mysql_free_result($res); + +if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) +{ + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + + //***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&status='{${$parameter}[cmdtablefull]}'" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + return; +} + +// +// Insert 2 commands in OMCR_COMMAND out of 10 possible available rows +// +$i=0; +do +{ + if ($row_no[$i] != '') + { + if(!strncmp($nmicmd,"delete",6)&& strncmp($nmicmd,"delete BtsMgr",13)) + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . $row_no[$i] . + ",$bssid,'oid $parent_objectid',null,255,-1,null,null,null)"; + else + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . $row_no[$i] . + ",$bssid,'oid $objectid',null,255,-1,null,null,null)"; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while ($i<10 && mysql_affected_rows() != 2); +$cmd1_row_no = $row_no[$i-1]; + +do +{ + if ($row_no[$i] != '') + { + if(!strncmp($nmicmd,"delete",6)&& strncmp($nmicmd,"delete BtsMgr",13)){ + $objectid_arr=explode('.',$objectid); + $nmicmd=$nmicmd.' '.$objectid_arr[sizeof($objectid_arr)-1]; + } + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + $row_no[$i] . ",$bssid,'$nmicmd',null,255,-1,null,null,null)"; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while (mysql_affected_rows() != 2 && $i<10); +$cmd2_row_no = $row_no[$i-1]; + +$sqlstring = "UNLOCK TABLES"; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + +// +// +// Wait for response: timeout value = $timeout +// +// +//output dump data to br +//for($ppp=0;$ppp<256;$ppp++) +// print(" "); + +$timewait=0; +$interval=800000; // in micro-seconds +echo str_pad(" ", 256); +while ($timewait < $timeout) +{ + //for progress + $progress_value++; + + echo ""; + ob_flush(); + flush(); + usleep(1000000); + + $timewait ++; + + $resultcode=$responsecode=$result=$response=null; + //sleep(1); + + + $sqlstring = "SELECT t1.resultcode,t1.responsecode," . + "t2.${language}StatInfo,t3.${language}StatInfo " . + "FROM OMCR_COMMAND AS t1,OMCR_STATCODE AS t2,OMCR_VARSTATCODE AS t3 " . + "WHERE t2.statcode=t1.resultcode AND t3.statcode=t1.responsecode " . + "AND t1.status=0 " . + "AND (t1.row_no=$cmd1_row_no OR t1.row_no=$cmd2_row_no) " . + "ORDER BY seqNum ASC"; + + + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + { + list($resultcode[],$responsecode[],$result[],$response[]) = $mydata; + //list($a[],$b[],$c[],$d[],$e[],$result[],$response[]) = $mydata; + } + $no_of_rows = mysqli_num_rows($res); + //mysql_free_result($res); + if ($no_of_rows == 2) + { + if ($resultcode[0] != 0) // 0='ok' + { + // Oid failed !!! + //***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&objectid=$objectid&tablename=$tablename" . + "&alarm=$result[0]" . + (($responsecode[0]!=0)? " --- $response[0]":"") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + } + elseif ($resultcode[1] != 0) + { + // Nmi command failed !!! + //***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&objectid=$objectid&tablename=$tablename" . + "&alarm=$result[1]" . + (($responsecode[1]!=0)? " --- $response[1]":"") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + } + else + { + // Success !!! + if(strncmp($nmicmd,"create",6)==0){ + $tablename=str_replace("New_", "", $tablename); + $parent_objectid=$objectid; + $objectid_arr=explode('.',$objectid); + $objectid=str_replace("OMCR_", "", $tablename).'.'; + for($i=1;$i"; + flush(); + } + }//***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&parent_objectid=$parent_objectid" . + "&objectid=$objectid" . + "&tablename=$tablename" . + ( (strncmp(strtolower($nmicommand), "create",6) + && strncmp(strtolower($nmicommand), "delete",6) + && (strncmp(strtolower($objectid),"abismgr",7) || strncmp(strtolower($nmicommand),"set adminstate=2",16)) + )? + "&status={${$parameter}[saveiscompleted]}": + "&status={${$parameter}[actioniscompleted]}" + ) . +// (($nmicommand != '') ? "&status={${$parameter}[actioniscompleted]}": +// "&status={${$parameter}[saveiscompleted]}") . + (($modified_data == '') ? "":"&saved=$modified_data") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + } + return; + } + + +} + +// +// Server or BSC has no response +// OMCR_COMMAND.status did not change to zero before timeout +// +$sqlstring = "SELECT * FROM OMCR_COMMAND " . + "WHERE status=254 AND (row_no=$cmd1_row_no OR row_no=$cmd2_row_no) "; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +if (mysqli_fetch_row($res)) +{ + //***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&alarm={${$parameter}[nobscresponse]}" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ +} +else +{ +//***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&alarm={${$parameter}[nobsscommresponse]}" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ +} + +// +// Change status to 0 +// +$sqlstring = "UPDATE OMCR_COMMAND SET status=0 WHERE row_no=$cmd1_row_no OR row_no=$cmd2_row_no"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +?> diff --git a/wxc2_omc/configuration/bssomc/modifyBssParam.php b/wxc2_omc/configuration/bssomc/modifyBssParam.php new file mode 100755 index 0000000..aeeb129 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/modifyBssParam.php @@ -0,0 +1,59 @@ + + + + + +BSS OMC + + +"; + echo ""; + } + else + { + echo ""; + echo ""; + } +?> + + <body> + <p>This page uses frames, but your browser doesn't support them.</p> + </body> + + + diff --git a/wxc2_omc/configuration/bssomc/modify_bk.php b/wxc2_omc/configuration/bssomc/modify_bk.php new file mode 100755 index 0000000..a944ce7 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/modify_bk.php @@ -0,0 +1,543 @@ + modify.php --> $url +// +// +?> + + +\n"; + $jump_url="{$url}?". + "language={$language}&". + "bssid={$bssid}&". + "objectid={$objectid}&". + "tablename={$tablename}&". + "progress_value={$progress_value}&". + "status='Nothing is requested'"; + + if(isset($x)) + $jump_url.="&x=$x"; + if(isset($y)) + $jump_url.="&y=$y"; + echo "jump2url('{$jump_url}');\n"; + echo "\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&status='Nothing is requested'" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + return; +} + +// +// Find the available row in OMCR_COMMAND to insert nmi commands +// Get 10 available and insert 2 nmi commands +// 1. oid $objectid +// 2. set $para1=$val1 [$para2=$val2] ... +// +include("meta_table_type.inc"); +include("login_parm.inc"); +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +if ($nmicommand != '') +{ + $nmicmd = $nmicommand; +} + +if ($modified_data != '') +{ + + //echo $modified_data . "
      "; + $parm_name = explode(",",$modified_data); + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd="set"; + + foreach ($parm_name as $attribute) + { + + switch(${"t$attribute"}) + { + + case NUMBERS: + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + + if (isset(${$attribute})) + { + //$nmicmd.=" $attribute=${$attribute}"; + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd.=" $tmpStr=${$attribute}"; + else + $nmicmd.=" ${$attribute}"; + } + else // for checkbox: ${$attribute}=true or false + { + //$nmicmd.=" $attribute=0 + $nmicmd.=" $tmpStr=0"; + } + break; + case STRINGS: + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + if(strlen($tmpStr)>0){ + //$nmicmd.=" $tmpStr=\"" . rawurlencode(${$attribute}) . "\""; + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd.=" $tmpStr=\"" . rawurlencode(${$attribute}) . "\""; + else + $nmicmd.=" \"" . rawurlencode(${$attribute}) . "\""; + }else{ + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd.=" $attribute=\"" . rawurlencode(${$attribute}) . "\""; + else + $nmicmd.=" \"" . rawurlencode(${$attribute}) . "\""; + } + break; + case INTEGER_ARRAY: + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + $stringarray = explode("_",$tmpStr); + if(strncmp($nmicmd,"create",6)&& strncmp($nmicmd,"delete",6)) + $nmicmd.= " $stringarray[0]=[$stringarray[1]=${$attribute}]"; + else + $nmicmd.= " [$stringarray[1]=${$attribute}]"; + break; + default: + break; + } + //echo $nmicmd . "
      "; + } +} + +$sqlstring = "LOCK TABLES OMCR_COMMAND WRITE"; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +$sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +while (list($row_no[]) = mysqli_fetch_row($res)); +$no_of_rows = mysqli_num_rows($res); +mysql_free_result($res); + +if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) +{ + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + + //***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&status='{${$parameter}[cmdtablefull]}'" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + return; +} + +// +// Insert 2 commands in OMCR_COMMAND out of 10 possible available rows +// +$i=0; +do +{ + if ($row_no[$i] != '') + { + if(!strncmp($nmicmd,"delete",6)&& strncmp($nmicmd,"delete BtsMgr",13)) + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . $row_no[$i] . + ",$bssid,'oid $parent_objectid',null,255,-1,null,null,null)"; + else + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . $row_no[$i] . + ",$bssid,'oid $objectid',null,255,-1,null,null,null)"; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while ($i<10 && mysql_affected_rows() != 2); +$cmd1_row_no = $row_no[$i-1]; + +do +{ + if ($row_no[$i] != '') + { + if(!strncmp($nmicmd,"delete",6)&& strncmp($nmicmd,"delete BtsMgr",13)){ + $objectid_arr=explode('.',$objectid); + $nmicmd=$nmicmd.' '.$objectid_arr[sizeof($objectid_arr)-1]; + } + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + $row_no[$i] . ",$bssid,'$nmicmd',null,255,-1,null,null,null)"; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while (mysql_affected_rows() != 2 && $i<10); +$cmd2_row_no = $row_no[$i-1]; + +$sqlstring = "UNLOCK TABLES"; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + +// +// +// Wait for response: timeout value = $timeout +// +// +//output dump data to br +//for($ppp=0;$ppp<256;$ppp++) +// print(" "); + +$timewait=0; +$interval=800000; // in micro-seconds +echo str_pad(" ", 256); +while ($timewait < $timeout) +{ + //for progress + $progress_value++; + + echo ""; + ob_flush(); + flush(); + usleep(1000000); + + $timewait ++; + + $resultcode=$responsecode=$result=$response=null; + //sleep(1); + + + $sqlstring = "SELECT t1.resultcode,t1.responsecode," . + "t2.${language}StatInfo,t3.${language}StatInfo " . + "FROM OMCR_COMMAND AS t1,OMCR_STATCODE AS t2,OMCR_VARSTATCODE AS t3 " . + "WHERE t2.statcode=t1.resultcode AND t3.statcode=t1.responsecode " . + "AND t1.status=0 " . + "AND (t1.row_no=$cmd1_row_no OR t1.row_no=$cmd2_row_no) " . + "ORDER BY seqNum ASC"; + + + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + { + list($resultcode[],$responsecode[],$result[],$response[]) = $mydata; + //list($a[],$b[],$c[],$d[],$e[],$result[],$response[]) = $mydata; + } + $no_of_rows = mysqli_num_rows($res); + //mysql_free_result($res); + if ($no_of_rows == 2) + { + if ($resultcode[0] != 0) // 0='ok' + { + // Oid failed !!! + //***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&objectid=$objectid&tablename=$tablename" . + "&alarm=$result[0]" . + (($responsecode[0]!=0)? " --- $response[0]":"") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + } + elseif ($resultcode[1] != 0) + { + // Nmi command failed !!! + //***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&objectid=$objectid&tablename=$tablename" . + "&alarm=$result[1]" . + (($responsecode[1]!=0)? " --- $response[1]":"") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + } + else + { + // Success !!! + if(strncmp($nmicmd,"create",6)==0){ + $tablename=str_replace("New_", "", $tablename); + $parent_objectid=$objectid; + $objectid_arr=explode('.',$objectid); + $objectid=str_replace("OMCR_", "", $tablename).'.'; + for($i=1;$i"; + flush(); + } + }//***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&parent_objectid=$parent_objectid" . + "&objectid=$objectid" . + "&tablename=$tablename" . + ( (strncmp(strtolower($nmicommand), "create",6) + && strncmp(strtolower($nmicommand), "delete",6) + && (strncmp(strtolower($objectid),"abismgr",7) || strncmp(strtolower($nmicommand),"set adminstate=2",16)) + )? + "&status={${$parameter}[saveiscompleted]}": + "&status={${$parameter}[actioniscompleted]}" + ) . +// (($nmicommand != '') ? "&status={${$parameter}[actioniscompleted]}": +// "&status={${$parameter}[saveiscompleted]}") . + (($modified_data == '') ? "":"&saved=$modified_data") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ + } + return; + } + + +} + +// +// Server or BSC has no response +// OMCR_COMMAND.status did not change to zero before timeout +// +$sqlstring = "SELECT * FROM OMCR_COMMAND " . + "WHERE status=254 AND (row_no=$cmd1_row_no OR row_no=$cmd2_row_no) "; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +if (mysqli_fetch_row($res)) +{ + //***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&alarm={${$parameter}[nobscresponse]}" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ +} +else +{ +//***************** zhengjianhui start ********************* + echo "\n\n"; + //***************** zhengjianhui end ********************* + /* + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&alarm={${$parameter}[nobsscommresponse]}" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + */ +} + +// +// Change status to 0 +// +$sqlstring = "UPDATE OMCR_COMMAND SET status=0 WHERE row_no=$cmd1_row_no OR row_no=$cmd2_row_no"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +?> diff --git a/wxc2_omc/configuration/bssomc/mydropbss.php b/wxc2_omc/configuration/bssomc/mydropbss.php new file mode 100755 index 0000000..1663542 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/mydropbss.php @@ -0,0 +1,71 @@ + +"; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +while (list($row_no[]) = mysqli_fetch_row($res)); +$no_of_rows = mysqli_num_rows($res); +mysql_free_result($res); + +$sqlstring = "SELECT ip FROM OMCR_BSSTABLE WHERE bssid=$bssid"; +//echo "$sqlstring
      "; +$res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +list($ip) = mysqli_fetch_row($res); +mysql_free_result($res); + +if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) +{ + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + header("Location: " . + "objects.php?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&status='Command table is full: Wait and send the command again'" + ); + return; +} + +// +// Insert the delete bss commands in OMCR_COMMAND out of 10 available rows +// +$i=0; +do +{ + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + "{$row_no[$i]},-1,'dropbss $bssid $ip',null,255,-1,null,null,null)"; + $res = mysql_query($sqlstring ,$db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while ($i<10 && mysql_affected_rows() != 2); +if ($i<10) + echo "BSS deletion is successful"; +else + echo "BSS deletion is failed"; +?> + diff --git a/wxc2_omc/configuration/bssomc/newbss.php b/wxc2_omc/configuration/bssomc/newbss.php new file mode 100755 index 0000000..a366f96 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/newbss.php @@ -0,0 +1,259 @@ + + + + + + New BSS + + +
      + +\n"; + echo "\n"; + exit(); +} +/* +if (!$objectid) + $objectid = "_NewBss"; +*/ +if (!$tablename) + $tablename = "OMCR_BSSTABLE"; + + +include("display_type.inc"); +include("login_parm.inc"); + +// +// Translate the value to string +// e.g. AdminState=2 --> AdminState=Unlocked +// +function translate($input,$data) +{ + $found=0; + if ($data) + { + $items=split("[,=]",$data); + $no_of_items=count($items); + for ($i=1;$i<$no_of_items;$i+=2) { + if ( $data == $items[$i] ) { + $found=$i; + break; + } + } + return($items[$found]); + } + else + return($input); +} +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +if (!isset($language)) + $language = "eng"; +$sqlstring = "select Object_Name,Attribute_Name,Attribute_Type,Display_Type," . + "${language}Display_Name, ${language}Lookup, ${language}Help_Text" . + " from OMCR_Meta_Table " . + "where Display_Type<>0 AND Object_Name='" . substr($tablename,5) . "'"; + +//echo $sqlstring . "
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while ( $row = mysqli_fetch_row($result) ) +{ + if ($row[3] == PUSH_BUTTON) //For action item in NMI + list($act_object_name[], $act_attribute_name[], $act_attribute_type[], + $act_display_type[], $act_display_name[], $act_lookup[], + $act_help_text[]) = $row; + else + list($object_name[],$attribute_name[],$attribute_type[],$display_type[], + $display_name[],$lookup[],$help_text[]) = $row; +} +$no_of_parms = count($attribute_name); + +if ($no_of_parms == 0) + return; + +$sqlstring = "select " . join(",",$attribute_name) . + " from $tablename where bssid=$bssid"; + +//echo $sqlstring . "
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +$no_of_instance = mysqli_num_rows($result); + +while ( $row = mysqli_fetch_row($result) ) +{ + echo "
      "; + echo "\n"; + $no_of_fields = count($row); + for($i=0;$i<$no_of_fields;$i++) + { + if(!strcasecmp(mysql_field_name($result,$i),"objectid")) + { + printf("=) %s\n", + $row[$i]); + break; + } + } + + for ($i=0; $i<$no_of_parms; $i++) + { + //printf("%s%s %s\n",$display_type[$i],$attribute_name[$i],$lookup[$i]); + switch($display_type[$i]) + { + case DO_NOT_DISPLAY: //do not display + $widget=""; + continue; + case PULLDOWN_MENU: //pulldown menu + $widget=""; + break; + case TEXTBOX: //text box + $widget=""; + break; + case LABEL: //label + $widget=translate($row[$i],$lookup[$i]); + break; + case RADIO_BUTTON: //radio button + $widget="" . + $row[$i] . "\n"; + break; + case CHECKBOX: //check box + $widget=""; + break; + case TEXTAREA: //text area + $widget=""; + break; + } + + printf(" \n", + $help_text[$i], $display_name[$i], $widget); + } + echo "
      %s%s
      \n
      \n"; + echo "\n"; + echo "\n"; + $no_of_actions = count($act_attribute_name); + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
      \n"; + echo "
      \n"; +} +?> + + + + diff --git a/wxc2_omc/configuration/bssomc/newbts.php b/wxc2_omc/configuration/bssomc/newbts.php new file mode 100755 index 0000000..19ce540 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/newbts.php @@ -0,0 +1,193 @@ + + + + + + + New BTS + + +
      + +\n"; + echo "\n"; + exit(); +} +if ($objectid) +$instance= split("BtsMgr.",$objectid); +echo $instance[1]; +return; +if (!$tablename) + $tablename = "OMCR_BSSTABLE"; + + +include("display_type.inc"); +include("login_parm.inc"); + +// +// Translate the value to string +// e.g. AdminState=2 --> AdminState=Unlocked +// +function translate($input,$data) +{ + $found=0; + if ($data) + { + $items=split("[,=]",$data); + $no_of_items=count($items); + for ($i=1;$i<$no_of_items;$i+=2) { + if ( $data == $items[$i] ) { + $found=$i; + break; + } + } + return($items[$found]); + } + else + return($input); +} + +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); +$sqlstring = "select * from OMCR_Meta_Table " . + "where Object_Name='" . substr($tablename,5) . "'"; + //"where Object_Name='" . strtok($objectid,".") . "'"; +//echo $sqlstring . "
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while ( $row = mysqli_fetch_row($result) ) +{ + + if ($row[4] == PUSH_BUTTON) //For action item in NMI + list($act_object_name[], $act_attribute_name[], $act_attribute_id, $act_attribute_type[], + $act_display_type[], $act_display_name[], $act_lookup[], + $act_help_text[]) = $row; + else + list($object_name[],$attribute_name[],$attribute_id[], $attribute_type[],$display_type[], + $display_name[],$lookup[],$help_text[]) = $row; +} +$no_of_parms = count($attribute_name); + +//foreach ($attribute_name as $a) { echo "o:" . $a . "
      "; } + +$sqlstring = "select " . join(",",$attribute_name) . + " from $tablename where bssid=$bssid"; + +//echo $sqlstring . "
      "; +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +$no_of_instance = mysqli_num_rows($result); + +while ( $row = mysqli_fetch_row($result) ) +{ + echo "
      "; + echo "\n"; + $no_of_fields = count($row); + for($i=0;$i<$no_of_fields;$i++) { + if(!strcasecmp(mysql_field_name($result,$i),"objectid")) { + printf("=) %s\n", + $row[$i]); + break; + } } + + for ($i=0; $i<$no_of_parms; $i++) + { + //printf("%s%s %s\n",$display_type[$i],$attribute_name[$i],$lookup[$i]); + switch($display_type[$i]) + { + case DO_NOT_DISPLAY: //do not display + $widget=""; + continue; + case PULLDOWN_MENU: //pulldown menu + $widget=""; + break; + case TEXTBOX: //text box + $widget=""; + break; + case LABEL: //label + $widget=translate($row[$i],$lookup[$i]); + break; + case RADIO_BUTTON: //radio button + $widget="" . + $row[$i] . "\n"; + break; + case CHECKBOX: //check box + $widget=""; + break; + } + + printf(" \n", + $help_text[$i], $display_name[$i], $widget); + } + echo "
      %s%s
      \n"; + //echo "
      \n"; + echo "\n"; + echo "\n"; + $no_of_actions = count($act_attribute_name); + + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
      \n"; +} +?> + + + diff --git a/wxc2_omc/configuration/bssomc/nmicommand.inc b/wxc2_omc/configuration/bssomc/nmicommand.inc new file mode 100755 index 0000000..3bd9763 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/nmicommand.inc @@ -0,0 +1,111 @@ + +\n"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + list($max_seq_num) = mysqli_fetch_row($res); + $max_seq_num++; + mysql_free_result($res); + + /* Send Command to OMCR_COMMAND */ + $sqlstring = "UPDATE OMCR_COMMAND " . + "SET bssid=$bssid, nmicommand='$nmicommand',seqNum=$max_seq_num,status=255,resultcode=-1 " . + "WHERE status=0 AND seqNum<$max_seq_num LIMIT 1"; + //echo "$sqlstring
      \n"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + if (mysql_affected_rows() == 1) + $ok=1; + $sqlstring = "UNLOCK TABLES"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + if ($ok == 0) + usleep(200000); // 200 msec + } + + if ($ok == 0) + return -1; + + $timewait=0; + $interval=500000; // in micro-seconds (0.5 sec) + + $timeout = 8; + while ($timewait < 1000000 * $timeout) + { + $resultcode=$responsecode=$response=$cmd=null; + usleep($interval); + $timewait += $interval; + $sqlstring = "SELECT resultcode, responsecode,response,nmicommand FROM OMCR_COMMAND " . + "WHERE status=0 AND seqNum=$max_seq_num"; + //echo "$sqlstring
      \n"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + { + list($resultcode[],$responsecode[],$response[],$cmd[]) = $mydata; + } + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + + if ($no_of_rows >= 1) + { + /* multiple entry due to duplicate seqNum is found + * Even deplicate seqNum, we can still wait for the result + */ + for ($i=0; $i<$no_of_rows; $i++) + { + if ($cmd[$i] == $nmicommand) + { + if ($i != 0) + { + $resultcode[0] = $resultcode[$i]; + $responsecode[0] = $responsecode[$i]; + $response[0] = $response[$i]; + } + if ($resultcode[0] != 0) + { + if ($debug) echo "resultcode=$resultcode[0]
      "; + $sqlstring = "SELECT ${language}StatInfo FROM OMCR_STATCODE" . + " WHERE statcode=$resultcode[0]"; + //echo "$sqlstring
      \n"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + if ( $row = mysqli_fetch_row($res) ) + echo "" . $row[0] . "
      \n";; + mysql_free_result($res); + } + return 0; /* Result found */ + } + } + } + } + + echo "Timeout without getting result from BSS OMC
      "; + return -1; /* No result found */ +} + +?> diff --git a/wxc2_omc/configuration/bssomc/nocache.inc b/wxc2_omc/configuration/bssomc/nocache.inc new file mode 100755 index 0000000..cc692fe --- /dev/null +++ b/wxc2_omc/configuration/bssomc/nocache.inc @@ -0,0 +1,12 @@ + + diff --git a/wxc2_omc/configuration/bssomc/objects.inc b/wxc2_omc/configuration/bssomc/objects.inc new file mode 100755 index 0000000..218c202 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/objects.inc @@ -0,0 +1,16 @@ + "决定要", + confirmquestionend => "吗?", + entervalidvalue => "请输入有效数值", + actioniscompleted => "任务完成", + savenotneed => "没有变动" + ); +$engnamearray = Array( + confirmquestionbegin => "Are you sure you want to ", + confirmquestionend => "?", + entervalidvalue => "You must enter valid value", + actioniscompleted => "Action is completed", + savenotneed => "Save Not needed" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/objects.php b/wxc2_omc/configuration/bssomc/objects.php new file mode 100755 index 0000000..c636805 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/objects.php @@ -0,0 +1,409 @@ + +// Attributes has type as the t +// +// MySQL table: OMCR_Meta_Table and table specified by $tablename +// +// modifyBssParam.php ___ bsstree.php (contents) +// \__ objects.php (main1) +// +?> + + + + + + + + + +BSS OMC -> <?=$objectid;?> + + + +saved=$saved"; +echo "$alarm"; +echo "
      "; + +$status=""; + +if (!isset($bssid) || !isset($objectid) || !isset($tablename)) +{ + echo "The required information for this page is invalid.
      \n"; + echo "\n"; + exit(); +} + +include("meta_table_type.inc"); +include("login_parm.inc"); + +// +// Translate the value to string +// e.g. AdminState=2 --> AdminState=Unlocked +// +function translate($input,$data) +{ + $found=-1; + if ($data) + { + $items=split("[;=]",$data); + $no_of_items=count($items); + + for ($i=0;$i<$no_of_items;$i+=2) { + if ( $input == $items[$i+1] ) { + $found=$i; + break; + } + } + if ($found != -1) + return($items[$found]); + } + return($input); +} + +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +// LOOK UP OMCR_META_TABLE for display parameters and buttons +// +// Display different xxxDisplay_Name base on the language selected +// +// +$sqlstring = "select Object_Name,Attribute_Name,Attribute_Id,Attribute_Type,Display_Type," . + "${language}Display_Name,${language}Lookup,${language}Help_Text" . + " from OMCR_Meta_Table " . + "where Display_Type<> 0 AND Object_Name='" . substr($tablename,5) . "'"; + +//echo $sqlstring . "
      ";exit(); +$result = mysql_query($sqlstring,$db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while ( $row = mysqli_fetch_row($result) ) +{ + if (($row[4] == PUSH_BUTTON) || ($row[4] == CONFIRM_PUSH_BUTTON)) //For action item in NMI + list($act_object_name[], $act_attribute_name[], $act_attribute_id[], $act_attribute_type[], + $act_display_type[], $act_display_name[], $act_lookup[], + $act_help_text[]) = $row; + else + list($object_name[],$attribute_name[],$attribute_id[],$attribute_type[],$display_type[], + $display_name[],$lookup[],$help_text[]) = $row; +} +$no_of_parms = count($attribute_name); + +echo "=) " . strtoupper($objectid) . "
      \n"; +echo "
      "; + +if ($no_of_parms == 0) +{ + echo "
      "; +} +else +{ + // + // LOOK UP OMCR_ getting real parameter + // + $sqlstring = "select " . join(",",$attribute_name) . + ",ObjectId from $tablename " . + "where bssid=$bssid and ObjectId like '$objectid'"; + + //echo $sqlstring . "
      "; + //$result = mysql_query($sqlstring,$db) or + // die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $result = mysql_query($sqlstring,$db); + if(mysqli_error($pubConn)!='') + exit(); + $no_of_instance = mysqli_num_rows($result); + + while ( $row = mysqli_fetch_row($result) ) + { + echo "\n"; + for ($i=0; $i<$no_of_parms; $i++) + { + //printf("%s%s %s\n",$display_type[$i],$attribute_name[$i],$lookup[$i]); + switch($display_type[$i]) + { + case DO_NOT_DISPLAY: //do not display + $widget=""; + continue; + case PULLDOWN_MENU: //pulldown menu + $widget=""; + if (!$existed) + $widget="* Unknown value ($row[$i]) *"; + break; + case TEXTBOX: //text box + $widget=""; + break; + case LABEL: //label + if (!strcasecmp($attribute_name[$i], "adminstate")) + $adminstate = $row[$i]; + $widget=translate($row[$i],$lookup[$i]); + $widget.="\n"; + break; + case RADIO_BUTTON: //radio button + $widget="" . + $row[$i] . "\n"; + break; + case CHECKBOX: //check box + $widget=""; + break; + case TEXTAREA: //text area + $widget=""; + break; + } + + if (strstr($saved,$attribute_name[$i]) != false) + $color="#00F0FF"; + else + $color="#FFFFFF"; + + $widget_type = ""; + + printf(" \n", + $color, $help_text[$i], $display_name[$i], $widget_type, $widget); + } + echo "
      %s%s%s
      \n"; + } /* End of while() */ +} + +// +// Display the action buttons & confirmed action buttons +// +// +$no_of_actions = count($act_attribute_name); +for ($i=0;$i<$no_of_actions;$i++) +{ + if (!strncasecmp($act_lookup[$i],"javascript:",11)) // Direct to another webpage + { + echo "\n"; + } + else if ($act_lookup[$i] != '') // NMI Actions + { + if ($act_display_type[$i] == CONFIRM_PUSH_BUTTON) + $need_confirm = "true"; + else + $need_confirm = "false"; + + echo "\n"; + } + else if ($act_attribute_name[$i] == "Revert") // Reset Webpage input the original value + { + echo "\n"; + } + else // Simply Save the altered values + { + echo "\n"; + } +} + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
      \n"; +?> + + + + diff --git a/wxc2_omc/configuration/bssomc/pm.cmd b/wxc2_omc/configuration/bssomc/pm.cmd new file mode 100755 index 0000000..56c004e --- /dev/null +++ b/wxc2_omc/configuration/bssomc/pm.cmd @@ -0,0 +1,44 @@ +# +# Copyright (c) 1994, 1995 +# interWAVE Communications Inc, Redwood City, CA USA. All rights reserved. +# +# $Header: /sw2/cvs/iw/compile/pm.cmd,v 1.1.2.2 1999/08/17 22:34:23 cwlin Exp $ +# +# DESCRIPTION: +# +# cwlin - This file is a Post Mortem Advanced command file which is used for +# collecting more information besides tt(), ti(), memShow and i() +# before sysmon reboots the unit. +# Here are some limitation for the syntax: +# +# 1. For all the comments, there has to be a "#" at the VERY beginning +# of every line, which means no blank in front. +# # This is a comment +# +# 2. Only a FUNCTION can be considered as a command. +# Flags (such as SS7Down) will get a printout as "This is not a command!" +# and will not take effect. +# +# 3. There are at most 100 commands can be put in. +# +# 4. Can only support up to TWO arguments in each command, either numeric or textual ones: +# wxlog "all","error" +# cpShowCCB 25 +# +# 5. Can't support arguments with space within the double quote. +# System will ignore everything afterward. +# wxlog "all", " error " ---- BAD argument +# +# 6. Some commands will not response if log_none has not been read in advance. +# So better put "log_none" at first to be safe. +# +# 7. There can be only one command in each line. +# Only the FIRST one will be taken if it's written like "ShowLct; xsWhat" +# +# +# +# + + +# Example command +log_none diff --git a/wxc2_omc/configuration/bssomc/pm_bts.cmd b/wxc2_omc/configuration/bssomc/pm_bts.cmd new file mode 100755 index 0000000..e16b489 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/pm_bts.cmd @@ -0,0 +1,44 @@ +# +# Copyright (c) 1994, 1995 +# interWAVE Communications Inc, Redwood City, CA USA. All rights reserved. +# +# $Header: /sw2/cvs/iw/compile/pm_bts.cmd,v 1.1.2.2 1999/08/17 22:37:31 cwlin Exp $ +# +# DESCRIPTION: +# +# cwlin - This file is a Post Mortem Advanced command file which is used for +# collecting more information besides tt(), ti(), memShow and i() +# before sysmon reboots the unit. +# Here are some limitation for the syntax: +# +# 1. For all the comments, there has to be a "#" at the VERY beginning +# of every line, which means no blank in front. +# # This is a comment +# +# 2. Only a FUNCTION can be considered as a command. +# Flags (such as SS7Down) will get a printout as "This is not a command!" +# and will not take effect. +# +# 3. There are at most 100 commands can be put in. +# +# 4. Can only support up to TWO arguments in each command, either numeric or textual ones: +# wxlog "all","error" +# cpShowCCB 25 +# +# 5. Can't support arguments with space within the double quote. +# System will ignore everything afterward. +# wxlog "all", " error " ---- BAD argument +# +# 6. Some commands will not response if log_none has not been read in advance. +# So better put "log_none" at first to be safe. +# +# 7. There can be only one command in each line. +# Only the FIRST one will be taken if it's written like "ShowLct; xsWhat" +# +# +# +# + + +# Example command +log_none diff --git a/wxc2_omc/configuration/bssomc/read_bssdist.inc b/wxc2_omc/configuration/bssomc/read_bssdist.inc new file mode 100755 index 0000000..60dad4c --- /dev/null +++ b/wxc2_omc/configuration/bssomc/read_bssdist.inc @@ -0,0 +1,182 @@ + + "68k"); + $trans_ppc = Array("ALL_CPU_TYPES" => "ppc"); + + $filename = "$build_path/$version/compile/pkg"; + $fileptr = fopen($filename,"r"); + if ($fileptr == false) + { + echo "Failed to open file: $filename
      \n"; + echo "Please check the BSS software is properly installed
      \n"; + return; + } + $pkg = fgets($fileptr,3); + fclose($fileptr); + + $filename = "$build_path/$version/compile/bssdist.fls"; + $fileptr = fopen($filename,"r"); + if ($fileptr == false) + { + echo "Failed to open file: $filename
      \n"; + echo "Please check the BSS software is properly installed
      \n"; + return; + } + + while ( !feof($fileptr) ) + { + /*********************************************************** + * Read the input file line by line for ":bschd" or ":bsxhd" + ***********************************************************/ + $buffer = ltrim(fgets($fileptr, 1024)); + $exist = ereg(":" . $iwbox_type ,$buffer); + if ( $exist == false) + continue; + + /*********************** + * Extract the comment + ***********************/ + $commentstart = strpos($buffer,"#"); + if ($commentstart === false) + { + $theline = rtrim($buffer); + } + else + { + $theline = rtrim(substr($buffer,0,$commentstart)); + } + if ($theline == "") + continue; + + /********************************************************** + * Split the line into 2 columns delimited by space or tab + * Process each column seperately + **********************************************************/ + $column = split("[ \t]+",$theline); + $left = $column[0]; + + + /***************************************** + * Process the left column + * + * Remarks: + * bschd= or bsxhd= + * root mean /hd0/ + * path is meaningless for hdxfer + * + *****************************************/ + $left_field_by_colon = explode(":",$left); + if ($left_field_by_colon[0] == $left) + { + echo "
      Error decoding bssdist.fls
      \n"; + return; + } + + $src_path = "$src_prefix/$version"; + $src_file = $left_field_by_colon[0]; + $dest_path = "$version"; + $dest_file = $left_field_by_colon[0]; + + // For each field seperated by ":" + // e.g. vxWorks:bschd=vxWorks=root:bsxhd=vxWorks=root + for ($i=1;isset($left_field_by_colon[$i]); $i++) + { + if (ereg($iwbox_type,$left_field_by_colon[$i]) == false) + continue; + + $left_sub_field = explode($iwbox_type . "=",$left_field_by_colon[$i]); + if ($left_sub_field[0] != $left_field_by_colon[$i]) + { + // "bschd=XXXX" or bschd=XXXX=root , "bsxhd=XXXX" or bsxhd=XXXX=root + $left_sub_sub_field = explode("=",$left_sub_field[1]); + $dest_file = "$left_sub_sub_field[0]"; + // "bschd=XXXX=root", "bsxhd=XXXX=root" + $store_in_hd0 = ereg("=root", $left_sub_field[1]); + if ($store_in_hd0 != false) + { + $output[$index++] + = Array("$src_path/$src_file", "$dest_file"); + //echo "$src_path/$src_file --> $dest_file
      "; + } + } + break; // break because we just do ":bschd" or ":bsxhd" + } + + + for ($i=1;isset($column[$i]);$i++) + { + // ne:file + $right_field = explode(":",$column[$i]); + if (!strcmp($right_field[0],$pkg)) + { + if (ereg(":r$",$column[$i]) == false) + { + $src_file = $right_field[1]; + $dest_file = $right_field[1]; + } + break; + } + } + + + // + // processing the right column NOW (seperated by TAB) + // e.g. ne:trxxil/irprxicn.bit a52:trxxil/irprxic2.bit:r + // + if (ereg("ALL_CPU_TYPES",$src_file) || ereg("ALL_CPU_TYPES",$dest_file)) + { + $output[$index++] + = Array(strtr("$src_path/$src_file",$trans_68k), strtr("$dest_path/$dest_file",$trans_68k)); + $output[$index++] + = Array(strtr("$src_path/$src_file",$trans_ppc), strtr("$dest_path/$dest_file",$trans_ppc)); + //echo strtr("$src_path/$src_file --> $dest_path/$dest_file
      ",$trans_68k); + //echo strtr("$src_path/$src_file --> $dest_path/$dest_file
      ",$trans_ppc); + } + else + { + $output[$index++] = Array("$src_path/$src_file", "$dest_path/$dest_file"); + //echo "$src_path/$src_file --> $dest_path/$dest_file
      "; + } + } + fclose($fileptr); + + return ($output); +} + +?> diff --git a/wxc2_omc/configuration/bssomc/sw_download.inc b/wxc2_omc/configuration/bssomc/sw_download.inc new file mode 100755 index 0000000..849c654 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/sw_download.inc @@ -0,0 +1,57 @@ + "要下载BSS软件吗?", + select_ip => "系统IP地址", + processor => "CPU板类型", + system_type => "系统类型", + back => "返回", + swversion => "软件版本", + err_msg => "参数错误", + heading => "BSS软件下载之后,必须重启BSC", + remind => "档案下载时间随档案大小而改变", + cleanup => "释放资源", + checkexist => "查看", + check_version => "查看板本", + check_cpu_board => "查看CPU板类型", + rename => "更改档名", + copy => "复制", + submit => "确定", + ok => "成功", + not_ok => "不成功", + done => "BSS软件下载完成,请重启BSC", + failed => "失败", + create_dir => "创建目录", + rmdir => "删除目录", + ping => "连接", + mounting => "导入", + umounting => "导出" + ); + +$engnamearray = Array( + confirm_sw_dnload => "Do you want to download BSS software to BSC?", + select_ip => "System IP address", + processor => "CPU Board Type", + system_type => "System Type", + back => "BACK", + swversion => "Software Version", + err_msg => "Please make sure you have input the correct parameters", + heading => "After downloading BSS software, you have to reboot BSC", + remind => "The software download time may vary with the file size", + cleanup => "Cleaning up allocated resources", + checkexist => "Checking the existent of", + check_version => "Checking BSS software version", + check_cpu_board => "Checking CPU board type", + rename => "Renaming", + copy => "Copying", + submit => "CONFIRM", + ok => "OK", + not_ok => "Not OK", + done => "Software download is complete. Please reboot BSC", + failed => "Failed", + create_dir => "Creating directory", + rmdir => "Removing directory", + ping => "Pinging", + mounting => "Mounting", + umounting => "Unmounting" + ); +?> diff --git a/wxc2_omc/configuration/bssomc/sw_download.php b/wxc2_omc/configuration/bssomc/sw_download.php new file mode 100755 index 0000000..d792e2d --- /dev/null +++ b/wxc2_omc/configuration/bssomc/sw_download.php @@ -0,0 +1,393 @@ + + "bsp040", "PROC" => "68k"); + else + $trans = Array("KERNEL" => "bspppc", "PROC" => "ppc"); +} + +/****************************************** +* Get the IP address if it is not known +* +*******************************************/ +if (!isset($ip)) +{ + echo "\n"; +?> + + +\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + + + echo "\n"; + echo "\n"; + echo "\n"; + + echo "
      \n"; + echo "{${$parameter}["select_ip"]} "; + echo "\n"; + echo "\n"; + echo "
      \n"; + echo "{${$parameter}["system_type"]} "; + echo "\n"; + echo "\n"; + echo "
      \n"; + echo "
      "; + echo "{${$parameter}["swversion"]}: $version"; + echo "
      \n"; + echo "\n"; + echo "\n"; + if (isset($bssid)) + echo ""; + echo "\n"; + echo "\n"; + return; +} + + + +/****************************************** +* Mount the BSC /hd0 to /tmp/$$ directory +*******************************************/ +$tmpdir = sprintf("%.3f",time()/1000); +$iwbox = ip2name($ip); +$path_prefix = "/tmp"; +$cpu_type="iwp"; + +$url_temp=$_SERVER["REQUEST_URI"]; +echo "This page URL:$url_temp
      "; + +echo "$path_prefix/$iwbox
      "; +echo "version=$version
      "; +exit(); + +/*************************************************************************************** +* PHP state machine +* +* Rename original build and create directory +* Format: it is a 2D array +* Array( +* Array('function','description','next state if != 0','next state if == 0' +* ) +****************************************************************************************/ +$cmdlist = Array( + 's00' => Array ('system("/bin/ping -q -c 1 $ip >> /dev/null", $retval);return($retval);', + "{${$parameter}["ping"]} $iwbox ($ip) ...", + "kickout","s01"), + + 's01' => Array ('return(is_dir("$path_prefix/$iwbox"));', + "{${$parameter}["checkexist"]} $path_prefix/$iwbox", + "s03","s02"), + + 's02' => Array ('return(mkdir("$path_prefix/$iwbox",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox", + "s03","halt"), + + 's03' => Array ('system("/bin/umount $path_prefix/$iwbox", $retval);return($retval);', + "", + //"{${$parameter}["umounting"]} $path_prefix/$iwbox", + "s04","s03"), + + 's04' => Array ('system("/bin/mount $path_prefix/$iwbox", $retval);return($retval);', + "{${$parameter}["mounting"]} $path_prefix/$iwbox", + "halt","s10"), + + 's10' => Array ('return(is_dir(sprintf("$path_prefix/$iwbox/%s",strtoupper($version))));', + sprintf("{${$parameter}["checkexist"]} $path_prefix/$iwbox/%s",strtoupper($version)), + "s11","s20"), + + 's11' => Array ('return(rename(sprintf("$path_prefix/$iwbox/%s",strtoupper($version)),"$path_prefix/$iwbox/$tmpdir"));', + sprintf("{${$parameter}["rename"]} $path_prefix/$iwbox/%s --> $path_prefix/$iwbox/$tmpdir",strtoupper($version)), + "s20","halt"), + + 's20' => Array ('return(is_file("$path_prefix/$iwbox/BSCSTART"));', + sprintf("{${$parameter}["checkexist"]} $path_prefix/$iwbox/BSCSTART"), + "s21","s30"), + + 's21' => Array ('return(rename("$path_prefix/$iwbox/BSCSTART","$path_prefix/$iwbox/BSCSTART.OLD"));', + "{${$parameter}["rename"]} $path_prefix/$iwbox/BSCSTART --> $path_prefix/$iwbox/BSCSTART.OLD", + "s30","halt"), + + 's30' => Array ('return(is_file("$path_prefix/$iwbox/VXWORKS"));', + sprintf("{${$parameter}["checkexist"]} $path_prefix/$iwbox/VXWORKS"), + "s31","s40"), + + 's31' => Array ('return(rename("$path_prefix/$iwbox/VXWORKS","$path_prefix/$iwbox/VXWORKS"));', + "{${$parameter}["rename"]} $path_prefix/$iwbox/VXWORKS --> $path_prefix/$iwbox/VXWORKS", + "s40","halt"), + + 's40' => Array ('return(mkdir("$path_prefix/$iwbox/$version",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version", + "s41","halt"), + + 's41' => Array ('return(mkdir("$path_prefix/$iwbox/$version/compile",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/compile", + "s50","halt"), + + 's50' => Array ('return(mkdir("$path_prefix/$iwbox/$version/compile/68k",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/compile/68k", + "s60","halt"), + + 's60' => Array ('return(mkdir("$path_prefix/$iwbox/$version/compile/cfg",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/compile/cfg", + "s70","halt"), + + 's70' => Array ('return(mkdir("$path_prefix/$iwbox/$version/btskern",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/btskern", + "s80","halt"), + + 's80' => Array ('return(mkdir("$path_prefix/$iwbox/$version/trxxil",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/trxxil", + "s90","halt"), + + 's90' => Array ('return(mkdir("$path_prefix/$iwbox/$version/trxdsp",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/trxdsp", + "s100","halt"), + + 's100' => Array ('return(mkdir("$path_prefix/$iwbox/$version/mtdspb",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/mtdspb", + "s101","halt"), + + 's101' => Array ('return($version[3]>5);', + "{${$parameter}["check_version"]}", + "s110","s180"), + + 's110' => Array ('system("/bin/bin/strings /tmp/$iwbox/VXWORKS|grep -i \"interWAVE IWP\"", $retval);return($retval);', + "{${$parameter}["check_cpu_board"]}", + "s111","s112"), + + // CPU board is ICP rather than IWP + 's111' => Array ('assign_cpu_type("iwp");return(0);', + "{${$parameter}["processor"]}: IWP", + "halt","s120"), + + 's112' => Array ('assign_cpu_type("icp");return(0);', + "{${$parameter}["processor"]}: ICP", + "halt","s120"), + + 's120' => Array ('return(mkdir("$path_prefix/$iwbox/$version/isr",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/isr", + "s130","halt"), + + 's130' => Array ('return(mkdir("$path_prefix/$iwbox/$version/iwlib",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/iwlib", + "s140","halt"), + + 's140' => Array ('return(mkdir("$path_prefix/$iwbox/$version/iwlib/platform",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/iwlib/platform", + "s150","halt"), + + 's150' => Array ('return(mkdir("$path_prefix/$iwbox/$version/iwlib/platform/bspppc",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/iwlib/platform/bspppc", + "s160","halt"), + + 's160' => Array ('return(mkdir("$path_prefix/$iwbox/$version/iwlib/platform/bsp040",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/iwlib/platform/bsp040", + "s170","halt"), + + 's170' => Array ('return(mkdir("$path_prefix/$iwbox/$version/compile/ppc",0700));', + "{${$parameter}["create_dir"]} $path_prefix/$iwbox/$version/compile/ppc", + "s180","halt"), + + 's180' => Array ('return(1);', + "*** {${$parameter}["remind"]} ***", + "s200","halt") +); + + +/********************************************* + * Get the array of BSS software filenames + *********************************************/ +$index = 200; +$output = get_sw_filenames($version,"/home/build", $iwbox_type); +if ($debug) +{ + echo "
      "; + foreach ($output as $files) echo "{${$parameter}["copy"]} $files[0] --> ./$files[1]
      "; + echo "
      "; + return; +} +foreach ($output as $files) +{ + $tmp_array = Array( + "return(copy(\"" . strtr($files[0],$trans) . "\",\"/tmp/$iwbox/" . strtr($files[1],$trans) . "\"));", + "{${$parameter}["copy"]} $files[0] --> ./$files[1]", + sprintf("s%d",$index + 1),"halt" + ); + $cmdlist = array_merge($cmdlist,Array("s$index" => $tmp_array)); + $index++; +} + +$cmdlist = array_merge($cmdlist, Array( + "s$index" => Array ('return(1);', + "*** {${$parameter}["cleanup"]} ***", + "cleanup","halt"), + + "cleanup" => Array('return(is_dir("$path_prefix/$iwbox"));', + "{${$parameter}["checkexist"]} $path_prefix/$iwbox", + "umount","getout"), + + "umount" => Array('system("/bin/umount $path_prefix/$iwbox", $retval);return($retval);', + "{${$parameter}["umounting"]} $path_prefix/$iwbox", + "rmdir","rmdir"), + + "rmdir" => Array('return(rmdir("$path_prefix/$iwbox"));', + "{${$parameter}["rmdir"]} $path_prefix/$iwbox", + "getout","getout") + ) +); + + +if (isset($debug)) +{ + foreach ($cmdlist as $key => $value) + { + echo "$key,$value[0],$value[1],$value[2],$value[3]
      "; + } +} + + +/********************************************* + * Execute the state machine here + *********************************************/ +echo "{${$parameter}["heading"]}
      "; +echo "
      ";
      +for ($state="s00" ; ; )
      +{
      +	if (isset($debug))
      +		echo strtr("{$cmdlist[$state][0]}\n$state: ",$trans);
      +
      +	echo strtr(${cmdlist}[$state][1],$trans);
      +	flush();
      +	$command = strtr(${cmdlist}[$state][0],$trans);
      +	if (@eval($command))
      +		$state = $cmdlist[$state][2];
      +	else
      +		$state = $cmdlist[$state][3];
      +
      +
      +	if ($state == "getout")
      +	{
      +		echo " ... {${$parameter}["ok"]}\n";
      +		break;
      +	}
      +	else if ($state == "kickout")
      +	{
      +		echo " ... {${$parameter}["not_ok"]}\n";
      +		echo "
      ... {${$parameter}["failed"]}
      "; + echo "
      ";
      +		break;
      +	}
      +	else if ($state == "halt")
      +	{
      +		echo " ... {${$parameter}["not_ok"]}\n";
      +		echo "
      ... {${$parameter}["failed"]}
      "; + echo "
      ";
      +		$state = "cleanup";
      +	}
      +	else
      +	{
      +		if (${cmdlist}[$state][1] != "")
      +			echo " ... {${$parameter}["ok"]}\n";
      +	}
      +}
      +
      +echo "
      ... {${$parameter}["done"]}
      "; + +?> diff --git a/wxc2_omc/configuration/bssomc/test.html b/wxc2_omc/configuration/bssomc/test.html new file mode 100755 index 0000000..a171f6e --- /dev/null +++ b/wxc2_omc/configuration/bssomc/test.html @@ -0,0 +1,594 @@ + + + + + + + + +
      +BSS ID 0
      + +
      +
      +CONNECTED
      +
      + + + + + + +
      Card 1
      +
      Card 2
      + + +
      DSP Card 0
      + + + + +
      DSP Card 1
      + + + + +
      DSP Card 2
      + + + + +
      DSP Card 3
      + + + + +
      Card 3
      + + +
      DSP Card 0
      + + + + +
      DSP Card 1
      + + + + +
      DSP Card 2
      + + + + +
      DSP Card 3
      + + + + +
      Card 4
      + + +
      DSP Card 0
      + + + + +
      DSP Card 1
      + + + + +
      DSP Card 2
      + + + + +
      DSP Card 3
      + + + + +
      Card 5
      + + +
      DSP Card 0
      + + + + +
      DSP Card 1
      + + + + +
      DSP Card 2
      + + + + +
      DSP Card 3
      + + + + +
      Card 6
      + + +
      DSP Card 0
      + + + + +
      DSP Card 1
      + + + + +
      DSP Card 2
      + + + + +
      DSP Card 3
      + + + + +
      Card 7
      + + +
      DSP Card 0
      + + + + +
      DSP Card 1
      + + + + +
      DSP Card 2
      + + + + +
      DSP Card 3
      + + + + +
      Card 8
      + + +
      DSP Card 0
      + + + + +
      DSP Card 1
      + + + + +
      DSP Card 2
      + + + + +
      DSP Card 3
      + + + + +
      Card 9
      + + +
      Card 10
      + + +
      Card 11
      + + +
      Card 12
      + + +
      Card 13
      + + +
      Card 14
      + + +
      Card 15
      + + + + + + + + + + + +
      Card 1
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Card 1
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      BSS Gb
      + + + + + + +
      FR Manager
      + + + + + diff --git a/wxc2_omc/configuration/bssomc/upload.inc b/wxc2_omc/configuration/bssomc/upload.inc new file mode 100755 index 0000000..ec957d2 --- /dev/null +++ b/wxc2_omc/configuration/bssomc/upload.inc @@ -0,0 +1,314 @@ +0 AND Object_Name='$name[1]'"; + if ($debug) echo "$sqlstring
      "; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $row = mysqli_fetch_row($res) ) + { + list($parameters[],$attribute_type[]) = $row; + } + mysql_free_result($res); + + $sqlstring = "SELECT " . join(",",$parameters) . " FROM $tablename WHERE bssid=$bssid AND ObjectId='$objectid'"; +} + +/* + * Create NMI Set Command for paramter download + */ +function create_nmi_command($db,$sqlstring,$parameters,$attribute_type, &$nmicommand,$debug) +{ + if ($debug) echo "$sqlstring
      "; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + $value = mysqli_fetch_row($res); + mysql_free_result($res); + $nmicommand = "set"; + for ($i=0;$i"; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid BssFunc",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + if ($debug) echo "==) set DownLoadInProgress=1" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"set DownLoadInProgress=1",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + + $objectlist = Array( + "Card.0.10", + "Bsc.0", + "AIf.0", + "ALinkSet.0.0", + "ALink.0.0.0" + ); + $tablenamelist = Array( + "OMCR_ClockMod", + "OMCR_Bsc", + "OMCR_AIf", + "OMCR_ALinkSet", + "OMCR_ALink" + ); + + $sqlstring = "SELECT SUBSTRING_INDEX(ObjectId,'.',-1) FROM OMCR_BSSTREE WHERE bssid=$bssid" . + " AND Presence=1 AND ObjectId='ALink.0.0.%'" . + " AND ObjectId<>'ALink.0.0.0'"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while ((list($row) = mysqli_fetch_row($res)) != null) + { + if ($debug) echo "==) oid ALinkSet.0.0" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid ALinkSet.0.0",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + if ($debug) echo "==) create ALink $row" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"create ALink $row",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + $objectlist = array_merge($objectlist, Array ( "ALink.0.0.$row")); + $tablenamelist = array_merge($tablenamelist, Array("OMCR_ALink")); + } + + $sqlstring = "SELECT SUBSTRING_INDEX(ObjectId,'.',-1) FROM OMCR_BSSTREE WHERE bssid=$bssid" . + " AND Presence=1 AND ObjectId REGEXP 'Card.0.[1-8]$'"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $e1trmod_id_list = null; + while ( $row = mysqli_fetch_row($res) ) + { + list($e1trmod_id_list[]) = $row; + } + //echo "==) oid Shelf.0" . "
      "; + //$retval = send_nmicommand($db,$bssid,"oid Shelf.0",$resultcode, $responsecode,$response,$debug); + //if (($retval != 0) || ($resultcode[0] != 0)) + // return (-1); + //flush(); + + for ($i=0; $i"; + //$retval = send_nmicommand($db,$bssid,"create E1trmod $e1trmod_id_list[$i]",$resultcode, $responsecode,$response,$debug); + //if (($retval != 0) || ($resultcode[0] != 0)) + // return (-1); + //flush(); + } + + for ($i=0; $i"; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid $objectid",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + create_sql_string_from_meta_table( + $db,$bssid,$objectid,$tablename,$sqlstring,$parameters,$attribute_type,$debug); + create_nmi_command($db,$sqlstring,$parameters,$attribute_type,$nmicommand,$debug); + if ($debug) echo "==) $nmicommand" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"$nmicommand",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + } + + /********************************************* + * For each BtsMgr, download parameters + *********************************************/ + $sqlstring = "SELECT SUBSTRING_INDEX(ObjectId,'.',-1) FROM OMCR_BSSTREE WHERE bssid=$bssid AND Presence=1 AND ObjectId Like 'BtsMgr.%'"; + if ($debug) echo "$sqlstring
      \n"; else echo "."; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + $btsmgr_list=null; + while ( $row = mysqli_fetch_row($res) ) + { + list($btsmgr_list[]) = $row; + } + mysql_free_result($res); + + //for ($i=0; $i"; + if ($debug) echo "==) oid BssFunc" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid BssFunc",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + if ($debug) echo "==) create BtsMgr $btsid" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"create BtsMgr $btsid",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + //echo "==) oid BtsMgr_Shelf.$btsid.0" . "
      "; + //$retval = send_nmicommand($db,$bssid,"oid BtsMgr_Shelf.$btsid.0",$resultcode, $responsecode,$response,$debug); + //if (($retval != 0) || ($resultcode[0] != 0)) + // return (-1); + //flush(); + + + /************************* + * Create E1TrMod + *************************/ + $sqlstring = "SELECT SUBSTRING_INDEX(ObjectId,'.',-1) FROM OMCR_BSSTREE WHERE bssid=$bssid" . + " AND Presence=1 AND ObjectId REGEXP 'BtsMgr_Shelf_Card.$btsid.0.[1-8]$'"; + $res = mysql_query($sqlstring, $db) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $card_id_list = null; + while ( $row = mysqli_fetch_row($res) ) + { + list($card_id_list) = $row; + } + mysql_free_result($res); + + for ($j=0; $j"; else echo "
      ."; + $retval = send_nmicommand($db,$bssid,"oid BtsMgr_Shelf.$btsid.0",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + if ($card_id_list[$j] == 1) + { + $objectlist = array_merge($objectlist, + Array ( "BtsMgr_Shelf_Card_Port.$btsid.0.$card_id_list[$j].0", + "BtsMgr_Shelf_Card_Port.$btsid.0.$card_id_list[$j].1") + ); + $tablenamelist = array_merge($tablenamelist, Array("OMCR_E1port", "OMCR_E1port")); + + if ($debug) echo "==) create E1trmod $card_id_list[$j]" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"create E1trmod $card_id_list[$j]",$resultcode, $responsecode,$response,$debug); + } + else + { + $objectlist = array_merge($objectlist, + Array ( "Trx.$btsid.0.$card_id_list[$j]", + "RCarrier.$btsid.0.$card_id_list[$j]", + "TrxCh.$btsid.0.$card_id_list[$j].0", + "TrxCh.$btsid.0.$card_id_list[$j].1", + "TrxCh.$btsid.0.$card_id_list[$j].2", + "TrxCh.$btsid.0.$card_id_list[$j].3", + "TrxCh.$btsid.0.$card_id_list[$j].4", + "TrxCh.$btsid.0.$card_id_list[$j].5", + "TrxCh.$btsid.0.$card_id_list[$j].6", + "TrxCh.$btsid.0.$card_id_list[$j].7") + ); + $tablenamelist = array_merge($tablenamelist, + Array ( "OMCR_Trx", "OMCR_RCarrier", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh", + "OMCR_TrxCh","OMCR_TrxCh") + ); + + if ($debug) echo "==) create TrxMod $card_id_list[$j]" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"create TrxMod $card_id_list[$j]",$resultcode, $responsecode,$response,$debug); + } + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + } + + for ($j=0; $j"; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid $objectid",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + create_sql_string_from_meta_table( + $db,$bssid,$objectid,$tablename,$sqlstring,$parameters,$attribute_type,$debug); + create_nmi_command($db,$sqlstring,$parameters,$attribute_type,$nmicommand,$debug); + if ($debug) echo "==) $nmicommand" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"$nmicommand",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return (-1); + flush(); + } + } + if ($debug) echo "==) oid BssFunc" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"oid BssFunc",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); + if ($debug) echo "==) set DownLoadInProgress=0" . "
      "; else echo "."; + $retval = send_nmicommand($db,$bssid,"set DownLoadInProgress=0",$resultcode, $responsecode,$response,$debug); + if (($retval != 0) || ($resultcode[0] != 0)) + return -1; + flush(); + + return 0; +} + +?> diff --git a/wxc2_omc/configuration/cdrNotifyConf/cdrNotifyConf.php b/wxc2_omc/configuration/cdrNotifyConf/cdrNotifyConf.php new file mode 100755 index 0000000..5a72b90 --- /dev/null +++ b/wxc2_omc/configuration/cdrNotifyConf/cdrNotifyConf.php @@ -0,0 +1,168 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Maintenance > Control Panel > CDR Alarm Note"; + echo ""; + $helpId="1.2.2"; + //showHelp($helpId); + echo "
      "; + echo " "; + echo " "; + //echo "$strClear"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +if($Save == "Save") +{ + $sqlstr = "SELECT * FROM OMC_PUB.cdrNotifyConf "; + $res = @mysqli_query($pubConn,$sqlstr); + $num=mysqli_num_rows($res); + for($index=0;$index<$num;$index++) + { + $row = @mysqli_fetch_array($res); + $sysTypeNo=$row[sysTypeNo]; + + $name="{$sysTypeNo}_need_alarm"; + $sms_alarm_value=$$name; + + $name="{$sysTypeNo}_need_sms"; + $sms_sms_value=$$name; + + $name="{$sysTypeNo}_msisdn"; + $msisdn_value=$$name; + + $exp=explode(",",$msisdn_value); + if(count($exp)>4 || (trim($msisdn_value) == "" && $sms_sms_value == 1)) + { + echo " Warning: {$row[sysTypeName]}'s MSISDN invalid
      "; + break; + } + + $sqlstr="update OMC_PUB.cdrNotifyConf set need_alarm={$sms_alarm_value},need_sms={$sms_sms_value},sms_receiver='{$msisdn_value}' where sysTypeNo={$sysTypeNo};"; + @mysqli_query($pubConn,$sqlstr); + } + if($index == $num) + echo "Update OK!
      "; + +} + +echo "
      "; +echo "
      CDR Alarm Notification
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$sqlstr = "SELECT * FROM OMC_PUB.cdrNotifyConf "; +$res = @mysqli_query($pubConn,$sqlstr); +$num=mysqli_num_rows($res); +echo mysqli_error($pubConn); + + +for($index=0;$index<$num;$index++) +{ + $row = @mysqli_fetch_array($res); + echo ""; + + $sysTypeNo=$row[sysTypeNo]; + + $flag=$row[need_alarm]-0; + echo ""; + + $flag=$row[need_sms]-0; + echo ""; + + echo ""; + + echo ""; +} + + +echo "
      SystemNeed AlarmNeed SMS NoteMSISDN List (MAX MSISDN Count=4)
      {$row[sysTypeName]}"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + +echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Note: If the empty CDR file is generated, then it will issue an alarm and SMS notification.
      Each MSISDN is separated by comma, 8675500001,8675500002 for example.
      When the configuration is changed, it must restart omcd to become effective"; + echo "
      "; + +echo ""; + +echo ""; + +adjust_content_tail(); +?> + diff --git a/wxc2_omc/configuration/cnf/cnfConf.php b/wxc2_omc/configuration/cnf/cnfConf.php new file mode 100755 index 0000000..9ee1ae6 --- /dev/null +++ b/wxc2_omc/configuration/cnf/cnfConf.php @@ -0,0 +1,560 @@ + + +pTg[$i]=$pTg[$i]"; + $wTg = $wTg." AND level_$lNum = $pTg[$i] "; + $i++; +} + + +/************get default value**************/ +$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wTg; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; + +$statusArr=array( + array('num' => '0', 'remark' => 'Not executable', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Booking', 'color' => '#00FF00'), + array('num' => '2', 'remark' => 'On going', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'Finished', 'color' => '#000000'), + array('num' => '3', 'remark' => 'Draft', 'color' => '#000000') +); + +//**************************************************************** +//函数 +// ChComm($sysId) +//函数说明:检查命令处理结果 +// +//变量说明: +// 无 +// +// +//返回值:$paramType +//$nSubSysParam = 0; +//$nGlobalSubSysParam = 1; +//$nGlobalSysParam = 2; +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function ChComm($sysId,$chkType=1) +{ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + $DEBUG = 0; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + if($DEBUG)echo "
      selComm=$selComm"; + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + do + { + $temCommState = $selRow[commState]; + if($selRow[remark]){ + $remark = $selRow[remark]; + //echo "
      remark=$remark"; + } + //echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc) + return($nWaitProc); + elseif($temCommState == $nInProc) + return($nInProc); + elseif($temCommState == $nOutProc) + $commState = $nOutProc; + else + $commState = 0; + }while($selRow = @mysqli_fetch_array($selRes)); + + return($commState); +} + + + +//**************************************************************** +//函数 +// 从Buffer_2拷贝到$buffer_1 +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$paramType +// +// +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1') +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg; + $DEBUG = 0; + $addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' "; + + //Location management + if($type){ + $uTgSql = " UPDATE $tb_0 set $buffer_1=$buffer_2 WHERE subSysNo = '0' ".$wTg.$addWer; + }else{ + $uTgSql = " UPDATE $tb_0 set $buffer_1=$buffer_2 WHERE subSysNo = '0' ".$wTg.$wDef.$addWer; + } + if($DEBUG) echo "
      uTgSql=$uTgSql "; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + + echo mysqli_error($pubConn); + + if($uTgRes) + return 1; + else + return 0; +} + +//**************************************************************** +//函数 +// get 或 set +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$commType +// +// +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function eSetGet($commType) +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $maxNum,$remark,$nGetComm,$nSetComm; + $DEBUG = 0; + + if($commType == $nGetComm) + $showType = "Get "; + else + $showType = "Set "; + + + //2.2.8 + $sysId = "270_0"; + $objIdStr = "2.2.*"; + $cic = sysCommSend($sysId,$commType,$objIdStr); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Conference parameter  "; + if($i > $maxNum){ + echo "
      Timeout"; + flush(); + break; + } + echo ""; + flush(); + + $sysId = "270"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext2 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + + flush(); + break; + } + + sleep(1); + $i++; + } +}//end of function + + + +if($saveSys) +{ + + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + + eSetGet($nSetComm); + //sleep(1); + + //added by QShuang in 06-24 + eSetGet($nGetComm);//get value + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; + + +}//end of set sys +elseif($readSys) +{ + eSetGet($nGetComm);//get value + + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; +}//end of $readSys +elseif($saveDisk) +{ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $inCed=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      $inCed=$$inCed"; + + if($inCed) + echo "
      Save success."; + else + echo "
      Save Failure."; + + flush(); + sleep(1); + echo ""; +}//end of $saveDisk +elseif($readDisk) +{ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $loadType = 1; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef,$loadType); + if($DEBUG) echo "
      edCin=$edCin"; + + if($edCin) + echo "
      Read success."; + else + echo "
      Read failure."; + + flush(); + sleep(1); + echo ""; + +}//end of $comSys +elseif($delete) +{ + $delSql = " UPDATE $tb_0 set initValue = '$defaultValue' WHERE subSysNo = '0' ".$wTg. " AND instanceNo = $delValue "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} +if($readSys || $saveSys || $saveComm){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + + +/************select value to see************/ +//Location management +$tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_0 WHERE subSysNo = '0' ".$wTg." ORDER BY instanceNo "; +if($DEBUG) echo "
      tgSql=$tgSql"; +$tgRes = @mysqli_query($pubConn,$tgSql); +$tgRow = @mysqli_fetch_array($tgRes); +echo mysqli_error($pubConn); +$wDef = " AND ("; +$defaultValue_1 = "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE000000EE"; +do +{ + $instanceNo = $tgRow[instanceNo]; + $initValue = $tgRow[initValue]; + if($initValue == $defaultValue || $initValue == $defaultValue_1){ + $cnfShow[$instanceNo] = 0; + continue; + }else{ + $cnfShow[$instanceNo] = 1; + + $wDef = $wDef." instanceNo = $instanceNo OR "; + } + + //echo "
      tgShow[$instanceNo]=$cnfShow[$instanceNo]"; + + $grpNum = $cnfArr[$instanceNo][0] = HexDec(substr($initValue,0,2)); + if($DEBUG)echo "
      grpNum=$grpNum"; + + $cphNum = substr($initValue,2,16); + $p1 = explode("E",$cphNum); + $cphNum = $cnfArr[$instanceNo][1] = $p1[0]; + if($DEBUG)echo "
      cphNum=$cphNum"; + + $pwd = $cnfArr[$instanceNo][2] = substr($initValue,18,4); + + $aphNum = substr($initValue,22,16); + $p3 = explode("E",$aphNum); + $aphNum = $cnfArr[$instanceNo][3] = $p3[0]; + if($DEBUG)echo "
      aphNum=$aphNum"; + + $month = omc_keep_length(HexDec(substr($initValue,38,2)),0,2); + $day = omc_keep_length(HexDec(substr($initValue,40,2)),0,2); + $hour = omc_keep_length(HexDec(substr($initValue,42,2)),0,2); + $minute = omc_keep_length(HexDec(substr($initValue,44,2)),0,2); + $bgnTime = $cnfArr[$instanceNo][4] = $month."-".$day." ".$hour.":".$minute; + //echo "cnfArr[$instanceNo][4]={$cnfArr[$instanceNo][4]}
      "; + + $drt = $cnfArr[$instanceNo][5] = HexDec(substr($initValue,46,4))*15; + + $maxNum = $cnfArr[$instanceNo][6] = HexDec(substr($initValue,50,2)); + + $sttNum = HexDec(substr($initValue,52,2)); + $status = $cnfArr[$instanceNo][7] = $statusArr[$sttNum][remark]; + $colorArr[$instanceNo][7] = $statusArr[$sttNum][color]; + //echo "
      status=$status"; + +}while($tgRow = @mysqli_fetch_array($tgRes)); + +$wDef = substr($wDef,0,-3); +$wDef = $wDef.")"; +if(strlen($wDef) < 10){ + $wDef = 'AND instanceNo < 0'; +} +if($DEBUG)echo "
      wDef=$wDef"; +//$cnfShow[0] = "1"; +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo "

      "; +?> +"; +echo ""; +echo ""; +echo "$strConfiguration > CNF"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> + + + + System:"; + echo ""; + echo ""; + ?> + + + + +
      New: + +
      + +

      + + + + + + + + + + + + + + 0) + echo ""; + else + echo ""; + + if($cnfArr[$i][7] == "Unseted"){ + echo ""; + }else{ + echo ""; + } + for($j=0;$j<8;$j++){ + echo ""; + } + if($cnfArr[$i][7] == "Using"){ + echo ""; + //echo ""; + }else{ + echo ""; + } + echo ""; + + } +} +echo "
      No.Conf IDConf numberPasswordApplicantStart timeDuration(M)PartyStatusDelete
      $i$i{$cnfArr[$i][$j]}  
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/cnf/cnfEdit.php b/wxc2_omc/configuration/cnf/cnfEdit.php new file mode 100755 index 0000000..4c913ae --- /dev/null +++ b/wxc2_omc/configuration/cnf/cnfEdit.php @@ -0,0 +1,820 @@ + '0', 'remark' => 'Not executable', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Booking', 'color' => '#00FF00'), + array('num' => '2', 'remark' => 'On going', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'Finished', 'color' => '#000000') +); +?> + +subSysNo=$subSysNo"; +$portNo = $pNum%8; +if($DEBUG)echo "
      portNo=$portNo"; + +//Attributes of TG +$oidTg = "2.2"; +$pTg = explode(".",$oidTg); +$i = 0; +$wTg = ''; +while(isset($pTg[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pTg[$i]=$pTg[$i]"; + $wTg = $wTg." AND level_$lNum = $pTg[$i] "; + $i++; +} + +function judgeDigit($inString){ + $stringLen = strlen($inString); + for($i=0;$i<$stringLen;$i++){ + $tmpStr = substr($inString,$i,1); + switch($tmpStr){ + case "0": + case "1": + case "2": + case "3": + case "4": + case "5": + case "6": + case "7": + case "8": + case "9": + break; + default: + return(0); + } + } + return(1); +}; + +if($set || $add) +{ + $drt = ceil(($drt_d*1440+$drt_h*60+$drt_m)/15); + if($DEBUG)echo "
      drt=$drt"; + + $nowTime=date("Y-m-d H:i:s",mktime()); + $dstTime=date("Y-m-d H:i:s", mktime($hour,$minute,0,$month,$day,date("Y"))); + $maxTime=date("Y-m-d H:i:s", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+20,date("Y"))); + + if($DEBUG)echo "
      nowTime=$nowTime"; + if($DEBUG)echo "
      dstTime=$dstTime"; + if($DEBUG)echo "
      maxTime=$maxTime"; + + $bgnDate = date("Y-m-d H:i:s", mktime($hour,$minute,0,$month,$day,date("Y"))); + $endDate = date("Y-m-d H:i:s", mktime($hour,$minute+15*$drt,0,$month,$day,date("Y"))); + if($DEBUG)echo "
      bgnDate=$bgnDate"; + if($DEBUG)echo "
      endDate=$endDate"; + $bgnTime = ''; + $timeNum = 0; + if($DEBUG)echo "
      Analysis new group."; + + $sltSql = "SELECT count(*) FROM subscriberData WHERE inter_msisdn like '%$aphNum%'"; + if($DEBUG)echo "
      sltSql=$sltSql"; + $sltRes = mysqli_query($pubConn,$sltSql); + $sltRow = mysqli_fetch_array($sltRes); + $aphCount = $sltRow[0]; + if($DEBUG)echo "
      aphCount=$aphCount"; + + for($i=0;$i<$maxDurNum;$i++){ + if($DEBUG)echo "
      i=$i"; + $tmpBgnDate = date("Y-m-d H:i:s", mktime(date("H"),date("i")+$i*15,0,date("m"),date("d"),date("Y"))); + $tmpEndDate = date("Y-m-d H:i:s", mktime(date("H"),date("i")+($i+1)*15,0,date("m"),date("d"),date("Y"))); + if($DEBUG)echo "
      tmpBgnDate=$tmpBgnDate"; + if($DEBUG)echo "
      tmpEndDate=$tmpEndDate"; + + if($tmpEndDate > $bgnDate && $tmpEndDate <= $endDate){ + $timeNum ++; + if(strlen($bgnTime) < 1){ + $bgnTime = $i; + } + $nowArr[$i][0] = $grpNum; + $nowArr[$i][1] = $cphNum; + $nowArr[$i][2] = $maxNum; + }else if($tmpEndDate > $endDate && $tmpBgnDate < $endDate){ + $timeNum ++; + + $nowArr[$i][0] = $grpNum; + $nowArr[$i][1] = $cphNum; + + $nowArr[$i][2] = $maxNum; + }else if($tmpEndDate <= $bgnDate){ + continue; + }else{ + break; + } + } + if($DEBUG)echo "
      Analysis all old groups."; + //added by QShuang in 06-23. + /************select value to see************/ + //Location management + $tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_0 WHERE subSysNo = '0' ".$wTg." ORDER BY instanceNo "; + if($DEBUG) echo "
      tgSql=$tgSql"; + $tgRes = @mysqli_query($pubConn,$tgSql); + $tgRow = @mysqli_fetch_array($tgRes); + echo mysqli_error($pubConn); + $wDef = " AND ("; + $defaultValue_1 = "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE000000EE"; + + do + { + $instanceNo = $tgRow[instanceNo]; + if($instanceNo == $tNum)//owner + continue; + $initValue = $tgRow[initValue]; + if($initValue == $defaultValue || $initValue == $defaultValue_1){ + $cnfShow[$instanceNo] = 0; + continue; + }else{ + $cnfShow[$instanceNo] = 1; + $wDef = $wDef." instanceNo = $instanceNo OR "; + } + + + $grpNumTmp = $cnfArr[$instanceNo][0] = HexDec(substr($initValue,0,2)); + if($DEBUG)echo "
      grpNumTmp=$grpNumTmp"; + + $cphNumTmp = substr($initValue,2,16); + $p1 = explode("E",$cphNumTmp); + $cphNumTmp = $cnfArr[$instanceNo][1] = $p1[0]; + if($DEBUG)echo "
      cphNumTmp=$cphNumTmp"; + + + $pwdTmp = $cnfArr[$instanceNo][2] = substr($initValue,18,4); + + $aphNumTmp = substr($initValue,22,16); + $p3 = explode("E",$aphNumTmp); + $aphNumTmp = $cnfArr[$instanceNo][3] = $p3[0]; + if($DEBUG)echo "
      aphNumTmp=$aphNumTmp"; + + $monthTmp = omc_keep_length(HexDec(substr($initValue,38,2)),0,2); + $dayTmp = omc_keep_length(HexDec(substr($initValue,40,2)),0,2); + $hourTmp = omc_keep_length(HexDec(substr($initValue,42,2)),0,2); + $minuteTmp = omc_keep_length(HexDec(substr($initValue,44,2)),0,2); + $bgnTimeTmp = $cnfArr[$instanceNo][4] = $monthTmp."-".$dayTmp." ".$hourTmp.":".$minuteTmp; + //echo "cnfArr[$instanceNo][4]={$cnfArr[$instanceNo][4]}
      "; + + $drtTmp = $cnfArr[$instanceNo][5] = HexDec(substr($initValue,46,4)); + + $bgnDate = date("Y-m-d H:i:s", mktime($hourTmp,$minuteTmp,0,$monthTmp,$dayTmp,date("Y"))); + + $endDate = date("Y-m-d H:i:s", mktime($hourTmp,$minuteTmp+15*$drtTmp,0,$monthTmp,$dayTmp,date("Y"))); + + $maxNumTmp = $cnfArr[$instanceNo][6] = HexDec(substr($initValue,50,2)); + + $sttNumTmp = HexDec(substr($initValue,52,2)); + $statusTmp = $cnfArr[$instanceNo][7] = $statusArr[$sttNumTmp][remark]; + $colorArr[$instanceNo][7] = $statusArr[$sttNumTmp][color]; + if($DEBUG)echo "
      bgnDate=$bgnDate"; + if($DEBUG)echo "
      endDate=$endDate"; + if($DEBUG)echo "
      statusTmp=$statusTmp"; + if($statusTmp == 'Invalid' || $statusTmp == 'Finished'){ + continue; + } + //echo "
      status=$status"; + for($i=0;$i<$maxDurNum;$i++){ + if($DEBUG)echo "
      i=$i"; + $tmpBgnDate = date("Y-m-d H:i:s", mktime(date("H"),date("i")+$i*15,0,date("m"),date("d"),date("Y"))); + $tmpEndDate = date("Y-m-d H:i:s", mktime(date("H"),date("i")+($i+1)*15,0,date("m"),date("d"),date("Y"))); + if($DEBUG)echo "
      tmpBgnDate=$tmpBgnDate"; + if($DEBUG)echo "
      tmpEndDate=$tmpEndDate"; + + if($tmpEndDate > $bgnDate && $tmpEndDate <= $endDate){ + if(strlen($timeArr[$i][0]) < 1){ + $timeArr[$i][0] = "-".$grpNumTmp."-"; + $timeArr[$i][1] = "-".$cphNumTmp."-"; + }else{ + $timeArr[$i][0] .= $grpNumTmp."-"; + $timeArr[$i][1] .= $cphNumTmp."-"; + } + $timeArr[$i][2] += $maxNumTmp; + }else if($tmpEndDate > $endDate && $tmpBgnDate < $endDate){ + if(strlen($timeArr[$i][0]) < 1){ + $timeArr[$i][0] = "-".$grpNumTmp."-"; + $timeArr[$i][1] = "-".$cphNumTmp."-"; + }else{ + $timeArr[$i][0] .= $grpNumTmp."-"; + $timeArr[$i][1] .= $cphNumTmp."-"; + } + $timeArr[$i][2] += $maxNumTmp; + }else if($tmpEndDate <= $bgnDate){ + continue; + }else{ + break; + } + } + }while($tgRow = @mysqli_fetch_array($tgRes)); + //echo "
      bgnTime=$bgnTime"; + //echo "
      timeNum=$timeNum"; + + //select conf ID + for($j=1;$j<39;$j++){ + if($j%10 == 9 || $j%10 == 0) + continue; + $noFind = 1; + if($DEBUG)echo "
      j=$j"; + + for($i=$bgnTime;$i<$bgnTime+$timeNum;$i++){ + if($DEBUG)echo "
      timeArr[$i][0]=$timeArr[$i][0]"; + if(strlen(strpos($timeArr[$i][0],"-".$j."-"))){ + $noFind = 1; + break; + }else{ + $noFind = 0; + } + } + if($noFind == 0){ + $grpNum = $j; + break; + }elseif($noFind == 1 && $j == 38){ + $noUsedId = 1; + } + } + //echo "
      grpNum=$grpNum"; + + for($i=$bgnTime;$i<$bgnTime+$timeNum;$i++){ + if($DEBUG)echo "
      i=$i"; + if($DEBUG)echo "
      grpOut="; + if($DEBUG)echo strpos($timeArr[$i][0],"-".$nowArr[$i][0]."-"); + if($DEBUG)echo "
      noOut="; + if($DEBUG)echo strpos($timeArr[$i][1],"-".$nowArr[$i][1]."-"); + if($DEBUG)echo "
      numOut="; + if($DEBUG)echo $timeArr[$i][2]+$nowArr[$i][2]; + /* + if(strlen(strpos($timeArr[$i][0],"-".$nowArr[$i][0]."-"))){ + $grpOutflag = 1; + $grpOutNo = $i; + break; + }else*/ + if(strlen(strpos($timeArr[$i][1],"-".$nowArr[$i][1]."-"))){ + $noOutflag = 1; + $noOutNo = $i; + break; + }elseif($timeArr[$i][2]+$nowArr[$i][2] > $maxUseNum){ + $numOutflag = 1; + $numOutNo = $i; + break; + } + } + if($DEBUG){ + for($i=0;$i<10;$i++){//for test + echo "
      timeArr[$i][0]={$timeArr[$i][0]}"; + echo "
      timeArr[$i][1]={$timeArr[$i][1]}"; + echo "
      timeArr[$i][2]={$timeArr[$i][2]}"; + + echo "
      nowArr[$i][0]={$nowArr[$i][0]}"; + echo "
      nowArr[$i][1]={$nowArr[$i][1]}"; + echo "
      nowArr[$i][2]={$nowArr[$i][2]}"; + } + } + + if($dstTime > $maxTime){ + echo ""; + }elseif($dstTime < $nowTime){ + echo ""; + }elseif($noUsedId){ + echo ""; + }elseif(strlen($cphNum) < 1){ + echo ""; + }elseif(judgeDigit($cphNum) < 1){ + echo ""; + }elseif(strlen($pwd) < 4){ + echo ""; + }elseif(judgeDigit($pwd) < 1){ + echo ""; + }elseif(strlen($aphNum) < 1){ + echo ""; + }elseif(judgeDigit($aphNum) < 1){ + echo ""; + }elseif($aphCount != 1){ + echo ""; + }elseif($drt < 1){ + echo ""; + }elseif($maxNum < 3){ + echo ""; + }elseif($grpOutflag){ + echo ""; + }elseif($noOutflag){ + echo ""; + }elseif($numOutflag){ + echo ""; + }else{ + + + $field_1 = omc_keep_length(DecHex($grpNum),0,2); + if($DEBUG)echo "
      field_1=$field_1"; + + $field_2 = omc_keep_length($cphNum,E,16,0); + if($DEBUG)echo "
      field_2=$field_2"; + + $field_3 = omc_keep_length($pwd,0,4); + if($DEBUG)echo "
      field_3=$field_3"; + + $field_4 = omc_keep_length($aphNum,E,16,0); + if($DEBUG)echo "
      field_4=$field_4"; + + $field_5 = omc_keep_length(DecHex($month),0,2).omc_keep_length(DecHex($day),0,2).omc_keep_length(DecHex($hour),0,2).omc_keep_length(DecHex($minute),0,2); + + $field_6 = omc_keep_length(DecHex($drt),0,4); + + $field_7 = omc_keep_length(DecHex($maxNum),0,2); + + //if($add) + $sttNum = 4; + + $field_8 = omc_keep_length(DecHex($sttNum),0,2); + + $initValue = $field_1.$field_2.$field_3.$field_4.$field_5.$field_6.$field_7.$field_8; + $initValue = strtoupper($initValue); + if($DEBUG)echo "
      initValue=$initValue"; + + $uTgSql = " UPDATE $tb_0 set initValue = '$initValue' WHERE subSysNo = '0' AND instanceNo = '$tNum' ".$wTg; + if($DEBUG) echo "
      uTgSql=$uTgSql"; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + echo mysqli_error($pubConn); + + + echo ""; + + } +} + +//echo "
      oType=$oType"; +if($oType < 1 && !$retryInput){ + /************select value to see************/ + //Attributes of TG + $tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_0 WHERE subSysNo = '0' AND instanceNo = '$tNum' ".$wTg." ORDER BY instanceNo "; + if($DEBUG) echo "
      tgSql=$tgSql"; + $tgRes = @mysqli_query($pubConn,$tgSql); + $tgRow = @mysqli_fetch_array($tgRes); + echo mysqli_error($pubConn); + $wDef = " AND ("; + do + { + $instanceNo = $tgRow[instanceNo]; + $initValue = $tgRow[initValue]; + if($initValue == $defaultValue || $initValue == $defaultValue_1){ + $cnfShow[$instanceNo] = 0; + }else{ + $cnfShow[$instanceNo] = 1; + + $wDef = $wDef." instanceNo = $instanceNo OR "; + } + + //echo "
      tgShow[$instanceNo]=$cnfShow[$instanceNo]"; + $grpNum = $cnfArr[$instanceNo][0] = HexDec(substr($initValue,0,2)); + if($DEBUG)echo "
      grpNum=$grpNum"; + + $cphNum = substr($initValue,2,16); + $p1 = explode("E",$cphNum); + $cphNum = $cnfArr[$instanceNo][1] = $p1[0]; + if($DEBUG)echo "
      cphNum=$cphNum"; + + $pwd = $cnfArr[$instanceNo][2] = substr($initValue,18,4); + + $aphNum = substr($initValue,22,16); + $p3 = explode("E",$aphNum); + $aphNum = $cnfArr[$instanceNo][3] = $p3[0]; + if($DEBUG)echo "
      aphNum=$aphNum"; + + $month = omc_keep_length(HexDec(substr($initValue,38,2)),0,2); + $day = omc_keep_length(HexDec(substr($initValue,40,2)),0,2); + $hour = omc_keep_length(HexDec(substr($initValue,42,2)),0,2); + $minute = omc_keep_length(HexDec(substr($initValue,44,2)),0,2); + $bgnTime = $cnfArr[$instanceNo][4] = $month."-".$day." ".$hour.":".$minute; + + $drt = $cnfArr[$instanceNo][5] = HexDec(substr($initValue,46,4)); + $drt_d = floor($drt*15/1440); + $drt_h = floor(($drt*15-$drt_d*1440)/60); + $drt_m = $drt*15-$drt_d*1440-$drt_h*60; + if($DEBUG)echo "
      drt=$drt"; + if($DEBUG)echo "
      drt_d=$drt_d"; + if($DEBUG)echo "
      drt_h=$drt_h"; + if($DEBUG)echo "
      drt_m=$drt_m"; + + $maxNum = $cnfArr[$instanceNo][6] = HexDec(substr($initValue,50,2)); + + $sttNum = HexDec(substr($initValue,52,2)); + $status = $cnfArr[$instanceNo][7] = $statusArr[$sttNum][remark]; + + + }while($tgRow = @mysqli_fetch_array($tgRes)); +} + +echo "
      "; +echo ""; +if($oType){ + //$nowDate = getdate(); + $month = date("m", mktime(date("H"),date("i")+6,date("s"),date("m"),date("d"),date("Y"))); + $day = date("d", mktime(date("H"),date("i")+6,date("s"),date("m"),date("d"),date("Y"))); + $hour = date("H", mktime(date("H"),date("i")+6,date("s"),date("m"),date("d"),date("Y"))); + $minute = date("i", mktime(date("H"),date("i")+6,date("s"),date("m"),date("d"),date("Y"))); + //echo "
      month=$month"; + //echo "
      day=$day"; + //echo "
      hour=$hour"; + //echo "
      minute=$minute"; + + /************get default value**************/ + $defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wTg; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $defaultValue = $defRow[initValue]; + + $defaultValue_1 = "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE000000EE"; + + $tgFlagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_0 WHERE subSysNo = '0' ".$wTg." ORDER BY instanceNo "; + if($DEBUG)echo "
      tgFlagSql=$tgFlagSql"; + $tgFlagRes = @mysqli_query($pubConn,$tgFlagSql); + $tgFlagRow = @mysqli_fetch_array($tgFlagRes); + echo mysqli_error($pubConn); + $crtConfNum = 0; + do + { + $instanceNo = $tgFlagRow[instanceNo]; + $initValue = $tgFlagRow[initValue]; + $tmpConfId = substr($initValue,0,2); + //echo "
      tmpConfId=$tmpConfId"; + if($tmpConfId > 0 && $tmpConfId <= $maxConfNum){ + $confArr[$crtConfNum++] = $tmpConfId; + } + + if($initValue == $defaultValue || $initValue == $defaultValue_1){ + $cnfShow[$instanceNo] = 0; + }else{ + $cnfShow[$instanceNo] = 1; + } + }while($tgFlagRow = @mysqli_fetch_array($tgFlagRes)); + + /* + echo ""; + echo ""; + echo ""; + */ + + echo ""; + //echo ""; + //echo ""; + echo ""; + break; + } + } + //echo ""; + //echo ""; + echo ""; + + /* + //echo "
      crtConfNum=$crtConfNum"; + echo ""; + echo ""; + echo ""; + echo ""; + */ +}else{ + echo ""; + echo ""; + echo ""; + + /* + echo ""; + echo ""; + echo ""; + echo ""; + */ +} + +/* +echo ""; +echo ""; +echo ""; +echo ""; +*/ + + +echo ""; +echo ""; +echo ""; +echo ""; +//class=\"button\" + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; +echo "
      Please add records.
      Reservation "; + //echo "Reservation $i
      Conf ID"; + //echo ""; + echo ""; + echo "
      Reservation $tNum
      Conf ID"; + echo "$grpNum"; + echo "
      Conf ID"; +//echo ""; +echo ""; +echo "
      Conf number
      Password(Please input 4 digits)
      Applicant
      Start time"; +//echo "-"; +echo ""; +echo "-"; +echo ""; +echo "  "; +//echo " "; +echo ""; +echo ":"; +//echo ":"; +echo ""; +//echo ""; +//echo "(e.g. 06-13 09:50)"; +echo "
      Duration(x15min)"; +echo ""; +echo "D  "; +echo ""; +echo "H  "; +echo ""; +echo "M  "; + +/* +echo ""; +echo "(x15min)"; +*/ +echo "
      Max. party"; +echo ""; +echo "
      "; +//echo "
      Remark:"; +echo "
      "; +if($oType){ + echo ""; + echo "  "; +}else{ + echo ""; + echo "  "; + echo ""; + //echo ""; +} +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +?> +Remarks:

      +Reservation: Reservation number of the conference. A CNF supports 400 conference reservations

      +Conf ID: The Conf ID ranges from 1 to 40. A CNF contains four cards. Each card can host ten groups (Card 0-3 has conference 1-10, 11-20, 21-30, and 31-40 respectively). When to select Conf ID, do not assign a group ID to more than one conference which are scheduled at the same time, and make sure that at any time, do not arrange groups with totally more than 30 conference parties on a single card at the same time

      +Conf number: Before setting the Conf number, make sure that the prefix to CNF has been set in MSC. There are total 40 different conference numbers available for 40 conferences. Each conference number is dedicated to one conference and begins with the same CNF prefix. Both conference number and group ID is in control of a conference. For example, the prefix to the CNF is set as 8888 in MSC. We can set 888801 to 888840 for group 1 to 40 respectively

      +Applicant: The Applicant is a system subscriber who will be charged for this conference. The applicant can be suggested by any proposer and confirmed by operator

      +Password: A 4-digit Password used to secure entering to a conference. This password may be proposed by either operator or applicant

      +Start time: The Start time is scheduled per reservation. The format is month-day hour-minute. Debiting will be starts at this scheduled time unless this conference is canceled before the start time

      +Duration: Booked duration of a conference, unit = 15 minutes. Conference will be concluded when the duration is used up

      +Max. party: Limits the quantity of parties for this conference. The quantity of parties is involved in debiting. Conference debiting = Duration x Billing rate x Max party num. System supports maximum 15 parties for a single conference. Each party will be charged as normal call during the conference

      +Status: Read only, status of conference, refreshed on a daily basis. Booked = conference is booked, In use = ongoing conference, Finished = conference has finished, Invalid = applicant is invalid because of low balance or suspended + + + + diff --git a/wxc2_omc/configuration/confSs7/gttLocalConf.php b/wxc2_omc/configuration/confSs7/gttLocalConf.php new file mode 100755 index 0000000..883722b --- /dev/null +++ b/wxc2_omc/configuration/confSs7/gttLocalConf.php @@ -0,0 +1,311 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$paramTable ='OBJ_223.param_99'; + +$sysId ='223_99_99'; +//$instanceNo ='0'; +$listPageUrl = "gttLocalList.php?setObjIdStr=$objIdStr&setInstanceNo=$instanceNo"; + +$valueName ='initValue'; +$totalLen=19; + +$localNodeConfArr=array( + array('NetID', '00.0-00.7'), + array('MSISDN', '01.0-10.7'), + array('IP0', '11.0-14.7'), + array('IP1', '15.0-18.7') +); + +$localNodeArr=array( + array('2.1.4', 'OMC'), + array('2.1.6', 'HLR'), + array('2.1.7', 'VLR'), + array('2.1.8', 'MSC'), + array('2.1.9', 'EIR'), + array('2.1.10', 'AUC'), + array('2.1.11', 'SMSC'), + array('2.1.19', 'SMPP-PPS'), + array('2.1.20', 'SMPP-SMSC'), + array('2.1.21', 'SMPP-OMC'), + + array('2.1.22', 'SRF0'), + array('2.1.23', 'SRF1'), + array('2.1.24', 'SRF2'), + array('2.1.25', 'SRF3'), + + array('2.1.32', 'MNP'), + array('2.1.33', 'OPPS'), + array('2.1.146','SSF'), + array('2.1.147','SCF-CAP'), + array('2.1.153','SCF-MAP'), + array('2.1.254','AIF') +); + +if(isset($setSys)){ + if($DEBUG){ + echo "
      nServerName=$nServerName"; + echo "
      nMsisdn=$nMsisdn"; + echo "
      nNetIDName=$nNetIDName"; + echo "
      nIpStr_0=$nIpStr_0"; + echo "
      nIpStr_1=$nIpStr_1"; + } + + for($i=0;$i<$totalLen;$i++){ + $totalValue=$totalValue."00"; + } + if($DEBUG) echo "
      totalValue=$totalValue
      "; + + if($nIpStr_0=='') + $nIpStr_0="FFFFFFFF"; + else + $nIpStr_0=ip2byte($nIpStr_0); + + if($nIpStr_1=='') + $nIpStr_1="FFFFFFFF"; + else{ + $ip1Des = explode('.',$nIpStr_1); + $nIpStr_1=ip2byte($nIpStr_1); + } + + if($DEBUG) echo "
      nIpStr_0=$nIpStr_0"; + if($DEBUG) echo "
      nIpStr_1=$nIpStr_1"; + + + $nMsisdn =str_replace('-','F',$nMsisdn); + //补齐msisdn + $nMsisdn = omc_keep_length($nMsisdn,"F","22","0"); + if($DEBUG) echo "
      nMsisdn=$nMsisdn"; + + $totalValue=setBitValue($totalValue,$localNodeConfArr[0][1],$nNetIDName); + $totalValue=setBitValue($totalValue,$localNodeConfArr[1][1],$nMsisdn); + $totalValue=setBitValue($totalValue,$localNodeConfArr[2][1],$nIpStr_0); + $totalValue=setBitValue($totalValue,$localNodeConfArr[3][1],$nIpStr_1); + + if($DEBUG) echo "

      sysId=$sysId"; + if($DEBUG) echo "
      objIdStr=$objIdStr"; + if($DEBUG) echo "
      instanceNo=$instanceNo"; + if($DEBUG) echo "
      totalValue=$totalValue
      "; + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $updSql = "UPDATE $paramTable SET initValue = '$totalValue' + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + //setSysParamValue($sysId,$objIdStr,$instanceNo,$totalValue); + echo ""; + exit(); +} + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      sysId =$sysId"; +if($DEBUG) echo "
      instanceNo =$instanceNo"; +if($DEBUG) echo "
      objIdStr =$objIdStr"; + +//========================================================== +//数据处理 +//========================================================== + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> +
      + +
      + +"; +for($i=0;$ilevelArr[$j]={$levelArr[$j]}"; + } + $getSql="SELECT $valueName + FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $value=$rows[0]; + //$value =getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName); + + $netId =getBitValue($value,$localNodeConfArr[0][1]); + /* + for($j=0;$jvalue=$value"; + + echo "
      "; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + +?> + + + + + +"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + break; + } +} +?> +
      NameValue
      Server name$serverName
      MSISDN
      Network indicator + +
      Plane 0's IP
      Plane 1's IP
      + +
      + class="button" name="setSys"> + +"> +"> +"> + +
      +Remark:
      +
      +The local node table contains overall SCCP (MAP and CAP) addressing setup for all entities of the WXC2 System. The local table is used for SCCP addressing. The IP 0 and 1 are IP addresses of the dual server 0 and 1 respectively. Generally the SSN, IP 0 and IP1 are fixed in the local node table, and only MSISDN field needs filling. For All-in-one server (MSS), the IP addresses of MSC, VLR HLR, PPS, SSF, AUC and EIR are same, MSS 0 IP is 172.18.98.1, MSS 1 IP is 172.18.99.1. To modify the local node of a server, click on the name of the server to open the local node set window.

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Entity SSN MSISDN IP 0 IP 1
      MSC 0x08   ----
      VLR 0x07   ----
      HLR 0x06   ----
      PPS 0x93   ----
      SMSC0x0B   ----
      SSF 0x93   ----
      AIF 0xFE   ----
      AUC 0x0A   ----
      EIR 0x09   ----
      VMS 0x0C   ----
      OMC 0x04   ----
      EIR 0x09   ----
      SMPP-EMSE 0x13   ----
      SMPP-SMSC 0x14   ----
      SMPP-OMC 0x15   ----
      SRF0 0x16   ----
      SRF1 0x17   ----
      SRF2 0x18   ----
      SRF3 0x19   ----
      MNP 0x20   ----
      OPPS 0x21   ----
      SSF 0x92   ----
      SCF-CAP 0x93   ----
      SCF-MAP 0x99   ----
      + + + diff --git a/wxc2_omc/configuration/confSs7/gttLocalList.php b/wxc2_omc/configuration/confSs7/gttLocalList.php new file mode 100755 index 0000000..03fb86f --- /dev/null +++ b/wxc2_omc/configuration/confSs7/gttLocalList.php @@ -0,0 +1,433 @@ + + +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$paramTable ='OBJ_223.param_99'; +$maxNum = 30; + +$sysId ='223_99_99'; +$instanceNo ='0'; +$initValue ='initValue'; +$editValue ='editValue'; +$readValue ='readValue'; + +$nGetComm = 0; +$nSetComm = 3; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +if($DEBUG) echo "
      setObjIdStr = $setObjIdStr"; +if($DEBUG) echo "
      setInstanceNo = $setInstanceNo"; + +//========================================================== +//数据处理 +//========================================================== +$localNodeObjId='2.1'; +$localNodeArr=array( + array('2.1.4', 'OMC'), + array('2.1.6', 'HLR'), + array('2.1.7', 'VLR'), + array('2.1.8', 'MSC'), + array('2.1.9', 'EIR'), + array('2.1.10', 'AUC'), + array('2.1.11', 'SMSC'), + array('2.1.19', 'SMPP-PPS'), + array('2.1.20', 'SMPP-SMSC'), + array('2.1.21', 'SMPP-OMC'), + + array('2.1.22', 'SRF0'), + array('2.1.23', 'SRF1'), + array('2.1.24', 'SRF2'), + array('2.1.25', 'SRF3'), + + array('2.1.32', 'MNP'), + array('2.1.33', 'OPPS'), + array('2.1.146','SSF'), + array('2.1.147','SCF-CAP'), + array('2.1.153','SCF-MAP'), + array('2.1.254','AIF') +); + +$localNodeConfArr=array( + array('NetID', '00.0-00.7'), + array('MSISDN', '01.0-10.7'), + array('IP0', '11.0-14.7'), + array('IP1', '15.0-18.7') +); + +$NetIdConfArr=array( + array('0','international'), + array('1','international spare'), + array('2','national'), + array('3','national spare') +); + +if(isset($setSys) || isset($getSys)){ + echo "




      "; + if($DEBUG) echo "
      sysId=$sysId"; + $objIdStr=$localNodeObjId; + if($DEBUG) echo "
      objIdStr=$objIdStr"; + if(isset($setSys)){ + $moveSql = "UPDATE $paramTable SET readValue = initValue + WHERE level_1='2' AND level_2='1' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $commIdStr = sysCommSend($sysId,$nSetComm,$objIdStr); + + if($DEBUG) echo "
      nSetComm"; + $showType="Set"; + }else{ + $commIdStr = sysCommSend($sysId,$nGetComm,$objIdStr); + $showType="Get"; + } + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Local node"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "223_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + sleep(1); + $i++; + } + $needCopyReadBuf=1; + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' AND level_2='1' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); +}elseif(isset($saveSys)){ + $objIdStr=$localNodeObjId; + $updSql = " UPDATE $paramTable SET initValue = '02' + WHERE level_1 = '3' AND level_2 = '2' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.2'); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "223_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +}elseif(isset($resetSys)){ + $objIdStr=$localNodeObjId; + $updSql = " UPDATE $paramTable SET initValue = '00' + WHERE level_1 = '3' AND level_2 = '2' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.2'); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "223_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + sleep(1); + $i++; + } +} + + + +if($setSys || $getSys || $saveSys || $undoSet||$resetSys){ + echo "
      "; + echo "

      $strBack"; + exit(); +} +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + + +remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} +?> + + +

      +"; +echo ""; +echo ""; +echo "$strConfiguration > $strNetwork > SS7 > $strLocalNode"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + + +echo "System:  "; +echo ""; +echo ""; +/* +if ( TRUE == session_is_registered("gttLSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +*/ +echo "      "; +echo "Command:  "; +echo ""; +echo ""; +echo ""; + +echo ""; +echo " "; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +/* +echo "
      "; +echo "System:  "; +echo ""; +echo ""; +echo ""; +if ( TRUE == session_is_registered("gttLSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +echo "OMC:  "; +echo ""; +echo "      "; +echo ""; +echo "
      "; +echo "
      "; +*/ + + +?> +
      + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +for($i=0;$ilevelArr[$j]={$levelArr[$j]}"; + } + $getSql="SELECT $initValue + FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $value=$rows[0]; + //$value =getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName); + $netId =getBitValue($value,$localNodeConfArr[0][1]); + for($j=0;$jvalue=$value"; + if($instanceNo == $setInstanceNo && $objIdStr==$setObjIdStr) + echo "
      "; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> + +
      EntityMSISDNNetwork indicatorIP0 (Server 0)IP1 (Server 1)
      "; + echo "$serverName$msisdn$netIdName$ipStr_0$ipStr_1
      +
      +  + + + diff --git a/wxc2_omc/configuration/confSs7/gttRemoteConf.php b/wxc2_omc/configuration/confSs7/gttRemoteConf.php new file mode 100755 index 0000000..3fca675 --- /dev/null +++ b/wxc2_omc/configuration/confSs7/gttRemoteConf.php @@ -0,0 +1,531 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$numberPerPage = 100; //每页纪录数 +$paramTable ='OBJ_223.param_99'; +$db_1='OBJ_223'; +$sysId ='223_99_99'; +//$instanceNo ='0'; +$valueName ='initValue'; +$totalLen = 45; + +$nProcFailStat = 0; +$nWaitProcStat = 1; +$nInProcStat = 2; +$nProcDoneStat = 3; + +$objIdStr='2.2'; +$listPageUrl = "gttRemoteList.php?setObjIdStr=$objIdStr&setInstanceNo=$instanceNo"; + +/************get default value**************/ +$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 AND level_1 = 2 AND level_2 = 2 AND paramType=2 "; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +do +{ + $defaultValue = $defRow[initValue]; + //echo "
      defaultValue[$leve_3]=$defaultValue[$leve_3]"; +}while($defRow = @mysqli_fetch_array($defRes)); + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      sysId =$sysId"; +if($DEBUG) echo "
      instanceNo =$instanceNo"; +if($DEBUG) echo "
      objIdStr =$objIdStr"; + +//获取命令执行状态 +function getSysCommStat($commId) +{ + $DEBUG = 0; + $pubDb = 'OMC_PUB'; + $commTable = 'parameterComm'; + + $getSql = "SELECT commState FROM $commTable WHERE commId ='$commId'"; + $result=mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + if($result){ + $row=mysqli_fetch_array($result); + $commState=$row[commState]; + return($commState); + }else{ + return(-1); + } +} + + +$GTTtableConfArr=array( + array('Start number', '03.0-12.7'), + array('End number', '13.0-22.7'), + array('On/off', '00.0-00.7'), + array('Numbering plan', '01.0-01.7'), + array('TT', '02.0-02.7'), + array('Network indicator', '23.0-23.7'), + array('DPC', '24.0-26.7'), + array('SSN', '27.0-27.7'), + array('Route indicator', '28.0-28.7'), + array('Address indicator', '29.0-29.7'), + array('Replaced start digit', '30.0-30.7'), + array('Replaced end digit', '31.0-31.7'), + array('Replacing number plan', '32.0-32.7'), + array('Replacing digits', '33.0-42.7') +); + +$NetIdConfArr=array( + array('0','international'), + array('1','international spare'), + array('2','national'), + array('3','national spare') +); + +$numPlanConfArr=array( + array('00','--'), + array('01','MSISDN'), + array('06','IMSI'), + array('07','E.214 GT') +); + +$addressIdConfArr=array( + array('00','NULL'), + array('01','DPC'), + array('02','SSN'), + array('03','DPC+SSN'), + array('04','GT'), + array('05','GT+DPC'), + array('06','GT+SSN'), + array('07','GT+DPC+SSN') +); + +function showNumber($number){ + $newNumber =str_replace('F','',$number); + /* + if($newNumber == ''){ + $newNumber='--'; + } + */ + return($newNumber); +} +//========================================================== +//数据处理 +//========================================================== +//保存改动 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + if($DEBUG){ + echo "
      nStartDigit=$nStartDigit"; + echo "
      nEndDigit=$nEndDigit"; + echo "
      nEnable=$nEnable"; + echo "
      nNumPlan=$nNumPlan"; + echo "
      nNetIDName=$nNetIDName"; + echo "
      nDPC=$nDPC"; + echo "
      nSSN=$nSSN"; + echo "
      nRouterID=$nRouterID"; + echo "
      nAddressID=$nAddressID"; + echo "
      nRep_start=$nRep_start"; + echo "
      nRep_end=$nRep_end"; + echo "
      nOutNumPlan=$nOutNumPlan"; + echo "
      nRep_digit=$nRep_digit"; + } + + //补齐 + $nStartDigit = omc_keep_length($nStartDigit,"F","20","0"); + $nEndDigit = omc_keep_length($nEndDigit,"F","20","0"); + $nTt = omc_keep_length($nTt,"0","2","1"); + $nDPC = omc_keep_length($nDPC,"0","6","1"); + $nRep_digit = omc_keep_length($nRep_digit,"F","20","0"); + $nRep_start = omc_keep_length($nRep_start,"0","2","1"); + $nRep_end = omc_keep_length($nRep_end,"0","2","1"); + $nSSN = omc_keep_length($nSSN,"0","2","1"); + + + if($DEBUG) echo "
      nStartDigit=$nStartDigit"; + for($i=0;$i<$totalLen;$i++){ + $totalValue=$totalValue."00"; + } + if($DEBUG) echo "
      totalValue=$totalValue"; + $totalValue=setBitValue($totalValue,$GTTtableConfArr[0][1],$nStartDigit); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[1][1],$nEndDigit); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[2][1],$nEnable); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[3][1],$nNumPlan); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[4][1],$nTt); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[5][1],$nNetIDName); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[6][1],$nDPC); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[7][1],$nSSN); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[8][1],$nRouterID); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[9][1],$nAddressID); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[10][1],$nRep_start); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[11][1],$nRep_end); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[12][1],$nOutNumPlan); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[13][1],$nRep_digit); + + echo "

      sysId=$sysId"; + echo "
      objIdStr=$objIdStr"; + echo "
      instanceNo=$instanceNo"; + echo "
      totalValue=$totalValue
      "; + + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $updSql = "UPDATE $paramTable SET initValue = '$totalValue' + WHERE level_1='$level_1' AND level_2='$level_2' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + //setSysParamValue($sysId,$objIdStr,$instanceNo,$totalValue); + echo ""; + exit(); +} + + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> +
      + +
      "> + +"; + +if($instanceNo == 'new'){ + $value =$defaultValue; +}else{ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $getSql="SELECT $valueName + FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $value=$rows[0]; + //$value =getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName); +} +if($DEBUG) echo "
      value=$value"; + +if($instanceNo == 'new'){ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $getInstanceSql="SELECT instanceNo FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND $valueName ='$defaultValue'"; + $result=mysqli_query($pubConn,$getInstanceSql); + echo mysqli_error($pubConn); + echo "
      "; +} + +$startDigit =getBitValue($value,$GTTtableConfArr[0][1]); +//if($startDigit == 'FFFFFFFFFFFFFFFFFFFF') continue; +$startDigit =showNumber($startDigit); +$endDigit =getBitValue($value,$GTTtableConfArr[1][1]); +$endDigit =showNumber($endDigit); +$enableFlag =getBitValue($value,$GTTtableConfArr[2][1]); +/* +if($enableFlag > 0){ + $enableFlag ='Y'; +}else{ + $enableFlag ='N'; +} +*/ + +$numPlan =getBitValue($value,$GTTtableConfArr[3][1]); +/* +for($j=0;$jNetID=$NetID"; +for($j=0;$jNetID=$NetID"; +for($j=0;$joutNumPlan=$outNumPlan"; +/* +for($j=0;$j"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      NameValue
      No."; + if($DEBUG) echo "
      $getInstanceSql"; + echo ""; + echo"
      Start GT number
      End GT number
      Enable"; +echo ""; +echo "
      Numbering Plan"; +echo ""; +echo "
      TT(hex)
      Network indicator"; +echo ""; +echo "
      Destination point code(hex)
      SSN(hex)
      Route indicator"; +echo ""; +echo "
      Address indicator"; +echo ""; +echo "
      Replaced start digit(hex)
      Replaced end digit(hex)
      Replacing number plan"; +echo "
      Replacing digits
      "; +echo "
      "; +echo "\n "; +echo "\n "; +if($instanceNo != 'new'){ + echo "\n "; +} +echo "\n   "; +echo "\n "; + +echo "
      "; +?> +Remarks:
      +
      + + + + + + + + + + +
      For the record of the connected network, select "Route on GT" + + + + +
      GTT setupExplanation
      Start GT number + Specify the beginning number of a group of consecutive numbers routed by GTT, for single-number GTT route, the start number is same as the end number +
      End GT numberSpecify the end number of a group of consecutive number routed by GTT. If there are some inconsecutive numbers for a same destination, a different GTT record should be used.
      EnableRecord enable or disable
      Numbering planNumbering planning, include MSISDN (E.164), IMSI (E.212) and GT (E.214)
      Network indicator Network type, include international, international spare, national and national spare
      Destination point code Point code of the destination device
      SSN SSN of the destination device, 3=ISDN user part, 4=OMC, 5=MAP, 6=HLR, 7=VLR, 8=MSC, 9=EIR, 10=AUC, 11=SMSC, 254=A interface, 147=PPS
      Route indicator For IMSI and MSISDN, select "Route on SSN" +
      Address indicatorselect the contribution of SCCP Address.
      Replaced start digitSpecify the beginning digit of a segment of digits to be replaced within a GT number, the replacement is for changing number and numbering plan
      Replaced end digit Specify the end digit of a segment of digits to be replaced within a GT number, the replacement is for changing number and numbering plan
      Replacing digit Replacing digits, the length of replacing digits and replaced digits may be different
      Replacing number plan Replacing number plan, include MSISDN, IMSI and GT
      + + \ No newline at end of file diff --git a/wxc2_omc/configuration/confSs7/gttRemoteList.php b/wxc2_omc/configuration/confSs7/gttRemoteList.php new file mode 100755 index 0000000..3dfb3f9 --- /dev/null +++ b/wxc2_omc/configuration/confSs7/gttRemoteList.php @@ -0,0 +1,584 @@ + + +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$paramTable ='OBJ_223.param_99'; +$maxNum = 30; + +$db_1='OBJ_223'; + +$sysId ='223_99_99'; +$instanceNo ='0'; +$initValue ='initValue'; +$editValue ='editValue'; +$readValue ='readValue'; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +$nGetComm = 0; +$nSetComm = 3; + +if($DEBUG) echo "
      setObjIdStr = $setObjIdStr"; +if($DEBUG) echo "
      setInstanceNo = $setInstanceNo"; + + +/************get default value**************/ +$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 AND level_1 = 2 AND level_2 = 2 AND paramType=2"; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +do +{ + $defaultValue = $defRow[initValue]; + //echo "
      defaultValue[$leve_3]=$defaultValue[$leve_3]"; +}while($defRow = @mysqli_fetch_array($defRes)); + + +if(isset($setSys) || isset($getSys)){ + echo "




      "; + if($DEBUG) echo "
      sysId=$sysId"; + if($DEBUG) echo "
      objIdStr=$objIdStr"; + if(isset($setSys)){ + $moveSql = "UPDATE $paramTable SET readValue = initValue + WHERE level_1='2' AND level_2='2' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $commIdStr = sysCommSend($sysId,$nSetComm,$objIdStr); + + if($DEBUG) echo "
      nSetComm"; + $showType="Set"; + }else{ + $commIdStr = sysCommSend($sysId,$nGetComm,$objIdStr); + $showType="Get"; + } + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType GTT"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "223_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + sleep(1); + $i++; + } + $needCopyReadBuf=1; + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' AND level_2='2' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); +}elseif(isset($saveSys)){ + $updSql = " UPDATE $paramTable SET initValue = '02' + WHERE level_1 = '3' AND level_2 = '2' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.2'); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "223_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +}elseif(isset($resetSys)){ + $updSql = " UPDATE $paramTable SET initValue = '00' + WHERE level_1 = '3' AND level_2 = '2' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.2'); + if($DEBUG) echo "
      commIdStr =$commIdStr"; + if($DEBUG) echo "
      commIdStr =$commIdStr"; + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "223_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + sleep(1); + $i++; + } +} +if(1==$delete) +{ + $delSql = "UPDATE $paramTable SET initValue = '$defaultValue' + WHERE level_1='2' AND level_2='2' AND instanceNo='$delValue'"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} + + + +if($setSys || $getSys || $saveSys || $undoSet||$resetSys){ + echo "
      "; + echo "

      $strBack"; + exit(); +} +//========================================================== +//输入变量 +//========================================================== + +/* +GTT table +[unit]On/off[u]00.0-00.7[u]select +[v]1[opt]on +[v]0[opt]off +[unit]Numbering plan[u]01.0-01.7[u]select +[v]1[opt]MSISDN +[v]6[opt]IMSI +[v]7[opt]E.214 GT +[unit]Start GT number[u]02.0-11.7[u]input +[v]keepHex-low-E +[unit]End GT number[u]12.0-21.7[u]input +[v]keepHex-low-E +[unit]Network indicator[u]22.0-22.7[u]select +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[unit]Destination point code[u]23.0-25.7[u]input +[v]toDec-high-0 +[unit]SSN[u]26.0-26.7[u]input +[v]toDec-high-0 +[unit]Route indicator[u]27.0-27.7[u]select +[v]0[opt]route on GT +[v]1[opt]route on SSN +[unit]Replaced start digit[u]28.0-28.7[u]input +[v]keepHex-high-0 +[unit]Replaced end digit[u]29.0-29.7[u]input +[v]keepHex-high-0 +[unit]Outgoing number plan[u]30.0-30.7[u]select +[v]1[opt]MSISDN +[v]6[opt]IMSI +[v]7[opt]E.214 GT +[unit]Replacing digits[u]31.0-40.7[u]input +[v]keepHex-low-E +*/ +//========================================================== +//数据处理 +//========================================================== +$objIdStr='2.2'; + +$GTTtableConfArr=array( + array('Start number', '03.0-12.7'), + array('End number', '13.0-22.7'), + array('On/off', '00.0-00.7'), + array('Numbering plan', '01.0-01.7'), + array('TT', '02.0-02.7'), + array('Network indicator', '23.0-23.7'), + array('DPC', '24.0-26.7'), + array('SSN', '27.0-27.7'), + array('Route indicator', '28.0-28.7'), + array('Address indicator', '29.0-29.7'), + array('Replaced start digit', '30.0-30.7'), + array('Replaced end digit', '31.0-31.7'), + array('Outgoing number plan', '32.0-32.7'), + array('Replacing digits', '33.0-42.7') +); + +$NetIdConfArr=array( + array('0','International'), + array('1','Inter-S'), + array('2','National'), + array('3','National-S') +); + +$numPlanConfArr=array( + array('0','--'), + array('1','MSISDN'), + array('6','IMSI'), + array('7','E.214 GT') +); + +$addressIdConfArr=array( + array('00','NULL'), + array('01','DPC'), + array('02','SSN'), + array('03','DPC+SSN'), + array('04','GT'), + array('05','GT+DPC'), + array('06','GT+SSN'), + array('07','GT+DPC+SSN') +); + +function showNumber($number){ + $newNumber =str_replace('F','',$number); + if($newNumber == ''){ + $newNumber='--'; + } + return($newNumber); +} + + + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + + +remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} +?> + + +

      +"; +echo ""; +echo ""; +echo "$strConfiguration > $strNetwork > SS7 > GTT"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +echo "System:  "; +echo ""; +echo ""; +/* +if ( TRUE == session_is_registered("gttRSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +*/ +echo "      "; +echo "Command:  "; +echo ""; +echo ""; +echo ""; + +echo ""; +echo " "; +echo ""; +adjust_title_tail(); +adjust_content_head(); +/* +echo "System:  "; +echo ""; +echo ""; +echo ""; +if ( TRUE == session_is_registered("gttRSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +echo "OMC:  "; +echo ""; +echo "      "; +echo ""; +echo "
      "; +echo "
      "; +*/ + +?> +
      + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$levelArr=explode('.',$objIdStr); +for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; +} + +$getSql="SELECT $initValue,instanceNo FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' + "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); + +while($rows =mysqli_fetch_array($result)){ + $instanceNo=$rows[instanceNo]; + $value=$rows[0]; + if(strcasecmp($value,$defaultValue)==0) + continue; + if($DEBUG) echo "
      value=$value"; + $startDigit =getBitValue($value,$GTTtableConfArr[0][1]); + //if($startDigit == 'FFFFFFFFFFFFFFFFFFFF') continue; + $startDigit =showNumber($startDigit); + $endDigit =getBitValue($value,$GTTtableConfArr[1][1]); + $endDigit =showNumber($endDigit); + $enableFlag =getBitValue($value,$GTTtableConfArr[2][1]); + if($enableFlag > 0){ + $enableFlag ='Y'; + }else{ + $enableFlag ='N'; + } + + + $numPlan =getBitValue($value,$GTTtableConfArr[3][1]); + for($j=0;$j"; + else + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> +
      No.Start numberEnd numberEnableNPTTNIDPCSSNRouter IDAddress IDRep-startRep-EndONPRep-numberDelete
      "; + echo "$instanceNo $startDigit $endDigit $enableFlag $numPlanName $tt $NetIDName $SPC $SSN $RouterID $adressIDName $Rep_start $Rep_end $OutNumPlanName $Rep_digit 
      "; +echo "New------------------------------
      +
      +  + + + diff --git a/wxc2_omc/configuration/confSs7/networkCodeConf.php b/wxc2_omc/configuration/confSs7/networkCodeConf.php new file mode 100755 index 0000000..8f6a976 --- /dev/null +++ b/wxc2_omc/configuration/confSs7/networkCodeConf.php @@ -0,0 +1,299 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$nGetComm = 0; +$nSetComm = 3; +$maxNum = 30; + +$pubDb = 'OMC_PUB'; +$paramTable ='OBJ_225.param_99'; +$sysId ='225_99_99'; +$instanceNo ='0'; +$initValue ='initValue'; +$editValue ='editValue'; +$readValue ='readValue'; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +$NetworkCodeArr=array( + //array('oid', 'inputName', 'showName','inputLen'), + array('2.1', 'MCC' ,'Mobile country code (MCC)' ,'4'), + array('2.2', 'MNC' ,'Mobile network code (MNC)' ,'4'), + array('2.3', 'CC' ,'Country code (CC)' ,'4'), + array('2.4', 'NDC' ,'National destination code (NDC)' ,'6'), + array('2.5', 'IP' ,'International prefix' ,'4'), + array('2.6', 'NP' ,'National prefix' ,'4') +); + + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      sysId =$sysId"; +if($DEBUG) echo "
      instanceNo =$instanceNo"; +if($DEBUG) echo "
      objIdStr =$objIdStr"; + +//========================================================== +//数据处理 +//========================================================== +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //发送命令 + if(isset($setSys) || isset($getSys)){ + if(isset($setSys)){ + for($i=0;$isetSysParamValue($sysId,$unitObjIdStr,$instanceNo,$unitSetValue)"; + } + + $commIdStr = sysCommSend($sysId,$nSetComm,$objIdStr); + $showType="Set"; + }else{ + $commIdStr = sysCommSend($sysId,$nGetComm,$objIdStr); + $showType="Get"; + } + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType network code"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "225_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + }elseif(isset($saveSys)){ + $updSql = " UPDATE $paramTable SET initValue = '01' + WHERE level_1 = '3' AND level_2 = '2' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.2'); + if($DEBUG) echo "
      commIdStr =$commIdStr"; + if($DEBUG) echo "
      commIdStr =$commIdStr"; + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "225_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + } +} + + +if($setSys || $getSys || $saveSys || $undoSet||$resetSys){ + echo "
      "; + echo "

      $strBack"; + exit(); +} +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + +remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} +?> + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > $strNetwork > SS7 > $strNetworkCode"; +echo ""; +showHelp($helpId); +echo "
      "; +echo "
      "; +/* +echo "System:  "; +echo ""; +echo ""; +echo ""; +if ( TRUE == session_is_registered("networkSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +echo "OMC:  "; +echo ""; +echo "      "; +echo ""; +echo "

      "; +*/ +echo "System:  "; +echo ""; +echo ""; +/* +if ( TRUE == session_is_registered("networkSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +*/ +echo "      "; +echo "Command:  "; +echo ""; +//echo ""; +echo ""; +echo "

      "; + +$tableHeader =""; + +echo "\n $tableHeader"; +echo "\n "; +echo ""; +echo ""; + +for($i=0;$i"; + echo ""; + echo ""; + echo ""; +} + +echo "\n
      NameValue
      $unitShowName
      "; +?> + + + + diff --git a/wxc2_omc/configuration/confSs7/sgConf.php b/wxc2_omc/configuration/confSs7/sgConf.php new file mode 100755 index 0000000..1b7cf96 --- /dev/null +++ b/wxc2_omc/configuration/confSs7/sgConf.php @@ -0,0 +1,267 @@ + + +"; + + $sgTableConfArr=array( + array('SG Flag','00.0-00.7'), + array('Application Mode','01.0-01.7'), + array('Ack Option','02.0-02.0'), + array('Signaling Type','02.1-02.7'), + array('Remote IP','03.0-06.7') + ); + + $statusLabel=array(0=>"Disable",1=>"Enable"); + $serverLabel=array(0=>"Client",1=>"Server"); + $ackLabel=array(0=>"Allow",1=>"Forbid"); + $typeLabel=array(0=>"M2UA",1=>"IUA",2=>"M3UA"); + + //Get the default value + $OBJ_222="OBJ_222"; + $defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 AND level_1 = 2 AND level_2 = 9 AND paramType=2"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $defaultValue = $defRow[initValue]; + //echo "
      defaultValue=$defaultValue
      "; + + if($_SERVER['REQUEST_METHOD'] == "POST") + { + //echo "instanceNo=$instanceNo,status=$status,server=$server,ack=$ack,typr=$type,ip=$ip
      "; + $status=omc_keep_length($status,"0","2","1"); + $server=omc_keep_length($server,"0","2","1"); + $ip=omc_keep_length($ip,"0","8","1"); + $ip=ipDec2Hex($ip); + //echo "instanceNo=$instanceNo,status=$status,server=$server,ack=$ack,typr=$type,ip=$ip
      "; + $totalValue=$status.$server.$ack.$type.$ip; + $totalValue="00000000000000"; + $totalValue=setBitValue($totalValue,$sgTableConfArr[0][1],$status); + $totalValue=setBitValue($totalValue,$sgTableConfArr[1][1],$server); + $totalValue=setBitValue($totalValue,$sgTableConfArr[2][1],$ack); + //echo "type=$type,{$sgTableConfArr[3][1]},totalValue=$totalValue
      "; + $totalValue=setBitValue($totalValue,$sgTableConfArr[3][1],decbin($type)); + $totalValue=setBitValue($totalValue,$sgTableConfArr[4][1],$ip); + //echo "type=$type,{$sgTableConfArr[3][1]},totalValue=$totalValue
      "; + //exit; + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $updSql="UPDATE OBJ_222.param_99 SET initValue = '$totalValue' WHERE level_1='$level_1' AND level_2='$level_2' AND instanceNo='$instanceNo' "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + echo ""; + exit(); + + } + + + //Get the parameter + //$value,$instanceNoList,instanceNoCount + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + if($instanceNo == 'new') + { + $value=$defaultValue; + } + else + { + $getSql="SELECT initValue FROM OBJ_222.param_99 WHERE level_1='$level_1' AND level_2='$level_2' AND instanceNo='$instanceNo' "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $value=$rows[0]; + } + + if($instanceNo == 'new') + { + $getInstanceSql="SELECT instanceNo FROM OBJ_222.param_99 WHERE level_1='$level_1' AND level_2='$level_2' AND initValue ='$defaultValue'"; + if($DEBUG) echo "
      $getInstanceSql"; + $result=mysqli_query($pubConn,$getInstanceSql); + echo mysqli_error($pubConn); + $instanceNoCount=0; + while($row=mysqli_fetch_array($result)) + { + $instanceNoList[$instanceNoCount++]=$row[instanceNo]; + //echo ""; + } + } + + $sgStatus=getBitValue($value,$sgTableConfArr[0][1])+0; + $sgServer=getBitValue($value,$sgTableConfArr[1][1])+0; + $sgACK=getBitValue($value,$sgTableConfArr[2][1])+0; + $sgType=bindec(getBitValue($value,$sgTableConfArr[3][1]))+0; + $sgIP=getBitValue($value,$sgTableConfArr[4][1]); + $sgIP=ipHex2Dec($sgIP); + if($DEBUG) echo "instanceNo=$instanceNo,status=$sgStatus,server=$sgServer,ack=$sgACK,type=$sgType,ip=$sgIP
      "; + + + + //show the page + echo "
      "; + echo "

      "; + echo ""; + echo ""; + + //instanceNo + echo ""; + if($instanceNo == 'new') + { + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + echo ""; + } + echo ""; + + //SG Flag + echo ""; + echo ""; + echo ""; + echo ""; + + //server + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //ip + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      NameValue
      No.No.$instanceNo
      SG Flag"; + echo ""; + echo "
      Application Mode"; + echo "
      Ack Option"; + echo "
      Signaling Type"; + echo "
      Remote IP"; + echo ""; + echo "
      "; + + echo "
      "; + echo "\n "; + echo "\n "; + if($instanceNo != 'new') + { + echo "\n "; + } + echo "\n   "; + echo "\n "; + + echo "
      "; + echo ""; + + //function define + function ipHex2Dec($ipHex) + { + $ipDec=""; + for($i=0;$i<4;$i++) + { + $temp=substr($ipHex,$i*2,2); + $temp=hexdec($temp); + $ipDec.=$temp."."; + } + $ipDec=substr($ipDec,0,strlen($ipDec)-1); + return $ipDec; + } + + + function ipDec2Hex($ipDec) + { + $ipHex=""; + $unit=explode(".",$ipDec); + for($i=0;$i<4;$i++) + { + $temp=dechex($unit[$i]); + $temp=omc_keep_length($temp,"0","2","1"); + $ipHex.=$temp; + } + return strtoupper($ipHex); + } + +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/confSs7/sgList.php b/wxc2_omc/configuration/confSs7/sgList.php new file mode 100755 index 0000000..164a0ad --- /dev/null +++ b/wxc2_omc/configuration/confSs7/sgList.php @@ -0,0 +1,413 @@ + + + + + + +"Disable",1=>"Enable"); + $serverLabel=array(0=>"Client",1=>"Server"); + $ackLabel=array(0=>"Allow",1=>"Forbid"); + $typeLabel=array(0=>"M2UA",1=>"IUA",2=>"M3UA"); + + //Get the default value + $OBJ_222="OBJ_222"; + $defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 AND level_1 = 2 AND level_2 = 9 AND paramType=2"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $defaultValue = $defRow[initValue]; + //echo "
      defaultValue=$defaultValue
      "; + + //set and get parameter + if(isset($setSys) || isset($getSys)) + { + echo "




      "; + if(isset($setSys)) + { + $moveSql="UPDATE OBJ_222.param_99 SET readValue = initValue WHERE level_1='2' AND level_2='9' "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,$objIdStr); + $showType="Set"; + } + else + { + $commIdStr=sysCommSend($sysId,$nGetComm,$objIdStr); + $showType="Get"; + } + $time = 0; + while(1) + { + if($time == 0) + echo "
      $showType signaling gateway"; + if($time > $maxTimeOut) + { + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chRes=ChComm($sysId,"0"); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail) + { + if($chRes == $nProcFail) + echo "
      $remark
      "; + else if($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + sleep(1); + $time++; + } + $moveSql = "UPDATE OBJ_222.param_99 SET initValue = readValue WHERE level_1='2' AND level_2='9' "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + } + //save parameter + else if(isset($saveSys)) + { + $updSql="UPDATE OBJ_222.param_99 SET initValue='02' WHERE level_1='3' AND level_2='7' "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.7'); + $time=0; + while(1) + { + if($time == 0) + echo "
      Save parameter to system"; + if($time > $maxTimeOut) + { + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chRes=ChComm($sysId,"0"); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $time++; + } + } + //reset parameter + else if(isset($resetSys)) + { + $updSql="UPDATE OBJ_222.param_99 SET initValue = '01' WHERE level_1 = '3' AND level_2 = '7' "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.7'); + if($DEBUG) echo "
      commIdStr=$commIdStr"; + if($DEBUG) echo "
      commIdStr=$commIdStr"; + $time=0; + while(1) + { + //echo "
      i=$i"; + if($time == 0) + echo "
      Reset system"; + if($time > $maxTimeOut){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chRes=ChComm($sysId,"0"); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + sleep(1); + $time++; + } + } + + //delete + if(1==$delete) + { + $delSql = "UPDATE OBJ_222.param_99 SET initValue = '$defaultValue' + WHERE level_1='2' AND level_2='9' AND instanceNo='$delValue'"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + + if($setSys || $getSys || $saveSys ||$resetSys){ + echo "
      "; + echo "

      $strBack"; + exit(); + } + + //Get the parameter + $getSql="SELECT initValue,instanceNo FROM param_99 WHERE level_1=2 AND level_2=9 "; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $sgCount=0; + + while($rows = mysqli_fetch_array($result)){ + $instanceNo=$rows[instanceNo]; + $value=$rows[0]; + if(strcasecmp($value,$defaultValue)==0) + continue; + + $sgInstance[$sgCount]=$instanceNo+0; + $sgStatus[$sgCount]=getBitValue($value,$sgTableConfArr[0][1])+0; + $sgServer[$sgCount]=getBitValue($value,$sgTableConfArr[1][1])+0; + $sgACK[$sgCount]=getBitValue($value,$sgTableConfArr[2][1])+0; + $sgType[$sgCount]=bindec(getBitValue($value,$sgTableConfArr[3][1]))+0; + $sgIP[$sgCount]=ipHex2Dec(getBitValue($value,$sgTableConfArr[4][1])); + + //echo "value=$value,status:{$sgStatus[$sgCount]},server:{$sgServer[$sgCount]},ack:{$sgACK[$sgCount]},type:{$sgType[$sgCount]},IP:{$sgIP[$sgCount]}
      "; + $sgCount++; + } + + //show the page +?> +"; + echo ""; + echo ""; + echo "$strConfiguration > $strNetwork > SS7 > Signaling Gateway"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + + echo "

      "; + echo "System:  "; + echo ""; + echo ""; + + echo "      "; + echo "Command:  "; + // style=\"left: 1; top: 2; width: 60; height: 25; position: relative\" + echo ""; + echo ""; + echo ""; + + echo ""; + echo " "; + echo ""; + echo ""; + + + +adjust_title_tail(); +adjust_content_head(); + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($index=0;$index<$sgCount;$index++) + { + if($sgInstance[$index] == $setInstanceNo && $objIdStr==$setObjIdStr) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      No.SG FlagApplication ModeAck OptionSignaling TypeRemote IPDelete
      "; + echo "{$sgInstance[$index]} {$statusLabel[$sgStatus[$index]]} {$serverLabel[$sgServer[$index]]} {$ackLabel[$sgACK[$index]]} {$typeLabel[$sgType[$index]]} {$sgIP[$index]} 
      "; + echo "New------------
      "; + echo "
      "; + + //function define + function ChComm($sysId,$chkType) + { + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + $outProcCount=0; + do + { + $temCommState = $selRow[commState]; + if(isset($selRow[remark])){ + $remark = $selRow[remark]; + if($DEBUG)echo "
      remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } + } + + + function ipHex2Dec($ipHex) + { + $ipDec=""; + for($i=0;$i<4;$i++) + { + $temp=substr($ipHex,$i*2,2); + $temp=hexdec($temp); + $ipDec.=$temp."."; + } + $ipDec=substr($ipDec,0,strlen($ipDec)-1); + return $ipDec; + } + + + function ipDec2Hex($ipDec) + { + $ipHex=""; + $unit=explode(".",$ipDec); + for($i=0;$i<4;$i++) + { + $temp=dechex($unit[$i]); + $temp=omc_keep_length($temp,"0","2","1"); + $ipHex.=$temp; + } + return strtoupper($ipHex); + } +adjust_content_tail(); +?> + + diff --git a/wxc2_omc/configuration/confSs7/ss7LinkConf.php b/wxc2_omc/configuration/confSs7/ss7LinkConf.php new file mode 100755 index 0000000..b6ca12c --- /dev/null +++ b/wxc2_omc/configuration/confSs7/ss7LinkConf.php @@ -0,0 +1,372 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$numberPerPage = 100; //每页纪录数 +$paramTable = 'OBJ_222.param_99'; + +$sysId ='222_99_99'; +$initValue ='initValue'; +$listPageUrl="./ss7LinkList.php?setObjIdStr=$objIdStr&setInstanceNo=$instanceNo"; + +$objIdStr='2.5.1'; + +$linkAttConfArr=array( + array('Flag','06.0-06.0'), + array('Linkset ID', '00.0-00.7'), + array('SLC No.', '01.0-01.7'), + array('Host IP', '02.0-05.7'), + array('Signaling Type', '06.1-06.3'), + array('MTP3-Lite Application Mode','06.4-06.4'), + array('MTP3-Lite Remote IP','09.0-12.7'), + array('MTP3-Lite Inactivity Timeout','13.0-13.7'), + array('MTP3-Lite Allowed Timeout Times','14.0-14.7'), + array('SG ID', '07.0-07.7'), + array('M2UA Interface ID','08.0-08.7'), + array('Alternative Host IP','15.0-18.7') +); + +$linkTypeArr=array( + 0=>'8ECP', + 1=>'M2UA', + 2=>'MTP3-Lite', + 3=>'IUA', + 4=>'M3UA' +); + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      sysId =$sysId"; +if($DEBUG) echo "
      instanceNo =$instanceNo"; +if($DEBUG) echo "
      objIdStr =$objIdStr"; + +//========================================================== +//数据处理 +//========================================================== + + + +//========================================================== +//输出并显示数据 +//========================================================== + + +$levelWhere = getLevelWhere($objIdStr); +if($DEBUG) echo "
      levelWhere=$levelWhere"; + +$getSql="SELECT $initValue,instanceNo FROM $paramTable + WHERE $levelWhere + "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); + +$defSql = "select initValue from OBJ_222.paramConf where $levelWhere and paramType='2'";//paramType=2,local +$defResult = mysqli_query($pubConn,$defSql); +$defRow = mysqli_fetch_array($defResult); +$defValue = $defRow[initValue]; +if($DEBUG)echo "
      defValue=$defValue"; +if($DEBUG) echo "
      "; +?> +
      + +"; +if($instanceNo == 'new') + { + $orgValue = $defValue; + } +else + { + $selSql = "SELECT initValue + FROM $paramTable + WHERE level_1='2' AND level_2='5' AND level_3='1' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      selSql=$selSql"; + $result=mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + $orgValue=$rows[0]; + if($DEBUG) echo "
      orgvalue=$orgValue"; + echo mysqli_error($pubConn); + //$orgValue = getSysParamValue($sysId,$objIdStr,$instanceNo,$initValue); + } +if($_SERVER['REQUEST_METHOD'] == "POST"){ + //保存改动 + $newValue=$orgValue; + + $flag=dechex($flag); + $newValue=setBitValue($newValue,$linkAttConfArr[0][1],$flag); + + $linksetNo =dechex($linksetNo); + $linksetNo= strlen($linksetNo) < 2?'0'.$linksetNo:$linksetNo; + if($DEBUG) echo "
      linksetNo=$linksetNo"; + $newValue=setBitValue($newValue,$linkAttConfArr[1][1],$linksetNo); + if($DEBUG) echo "
      newValue=$newValue"; + + $slcNo =dechex($slcNo); + $slcNo= strlen($slcNo) < 2?'0'.$slcNo:$slcNo; + if($DEBUG) echo "
      slcNo=$slcNo"; + $newValue=setBitValue($newValue,$linkAttConfArr[2][1],$slcNo); + if($DEBUG) echo "
      newValue=$newValue"; + + + if($cpcIp=='') + $cpcIp="FFFFFFFF"; + else + $cpcIp=ip2byte($cpcIp); + if($DEBUG) echo "
      cpcIp=$cpcIp"; + $newValue=setBitValue($newValue,$linkAttConfArr[3][1],$cpcIp); + if($DEBUG) echo "
      newValue=$newValue"; + + + if($DEBUG) echo "
      linkType=$linkType"; + $linkType=decbin($linkType); + + //get the bit length of link type modfiy JianHuiZheng 2007-11-30 + $pos=explode("-",$linkAttConfArr[4][1]); + $len=$pos[0]*10-$pos[1]*10; + $len=abs($len)+1; + $linkType=omc_keep_length($linkType,"0",$len); + + $newValue=setBitValue($newValue,$linkAttConfArr[4][1],$linkType); + if($DEBUG) echo "
      newValue=$newValue"; + + + //MTP3-Lite Application Mode + $mtp3_lite_app_mode=dechex($mtp3_lite_app_mode); + $newValue=setBitValue($newValue,$linkAttConfArr[5][1],$mtp3_lite_app_mode); + + //MTP3-Lite Remote IP + if($mtp3_lite_remote_ip == '') + $mtp3_lite_remote_ip="FFFFFFFF"; + else + $mtp3_lite_remote_ip=ip2byte($mtp3_lite_remote_ip); + $newValue=setBitValue($newValue,$linkAttConfArr[6][1],$mtp3_lite_remote_ip); + + //MTP3-Lite Inactivity Timeout + $mtp3_lite_inact_timeout=dechex($mtp3_lite_inact_timeout); + $newValue=setBitValue($newValue,$linkAttConfArr[7][1],$mtp3_lite_inact_timeout); + + //MTP3-Lite Allowed Timeout times + $mtp3_lite_allow_timeout_time=dechex($mtp3_lite_allow_timeout_time); + $newValue=setBitValue($newValue,$linkAttConfArr[8][1],$mtp3_lite_allow_timeout_time); + + + $sgNo =dechex($sgNo); + $sgNo = strlen($sgNo) < 2?'0'.$sgNo:$sgNo; + if($DEBUG) echo "
      sgNo=$sgNo"; + $newValue=setBitValue($newValue,$linkAttConfArr[9][1],$sgNo); + if($DEBUG) echo "
      newValue=$newValue"; + + $m2uaInterfaceID =dechex($m2uaInterfaceID); + $m2uaInterfaceID= strlen($m2uaInterfaceID) < 2?'0'.$m2uaInterfaceID:$m2uaInterfaceID; + if($DEBUG) echo "
      m2uaInterfaceID=$m2uaInterfaceID"; + $newValue=setBitValue($newValue,$linkAttConfArr[10][1],$m2uaInterfaceID); + if($DEBUG) echo "
      newValue=$newValue"; + + + if($alternativeMTP3=='') + $alternativeMTP3="FFFFFFFF"; + else + $alternativeMTP3=ip2byte($alternativeMTP3); + if($DEBUG) echo "
      alternativeMTP3=$alternativeMTP3"; + $newValue=setBitValue($newValue,$linkAttConfArr[11][1],$alternativeMTP3); + if($DEBUG) echo "
      newValue=$newValue"; + + + $updSql = "UPDATE $paramTable SET initValue = '$newValue' + WHERE level_1='2' AND level_2='5' AND level_3='1' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + //setSysParamValue($sysId,$objIdStr,$instanceNo,$newValue); + echo ""; + exit(); +}else{ + //显示 + $tableHeader =""; + + //echo "
      orgValue=$orgValue"; + echo "$tableHeader"; + echo ""; + $flag =getBitValue($orgValue,$linkAttConfArr[0][1]); + $flag =hexdec($flag); + $linksetNo =getBitValue($orgValue,$linkAttConfArr[1][1]); + $linksetNo =hexdec($linksetNo); + $slcNo =getBitValue($orgValue,$linkAttConfArr[2][1]); + $slcNo =hexdec($slcNo); + $cpcIp =getBitValue($orgValue,$linkAttConfArr[3][1]); + $cpcIp =byte2ip($cpcIp); + $linkType =getBitValue($orgValue,$linkAttConfArr[4][1]); + $linkType =bindec($linkType); + + $mtp3_lite_app_mode=getBitValue($orgValue,$linkAttConfArr[5][1]); + $mtp3_lite_app_mode=hexdec($mtp3_lite_app_mode); + + $mtp3_lite_remote_ip=getBitValue($orgValue,$linkAttConfArr[6][1]); + $mtp3_lite_remote_ip=byte2ip($mtp3_lite_remote_ip); + + $mtp3_lite_inact_timeout=getBitValue($orgValue,$linkAttConfArr[7][1]); + $mtp3_lite_inact_timeout=hexdec($mtp3_lite_inact_timeout); + + $mtp3_lite_allow_timeout_time=getBitValue($orgValue,$linkAttConfArr[8][1]); + $mtp3_lite_allow_timeout_time=hexdec($mtp3_lite_allow_timeout_time); + + + + $sgNo =getBitValue($orgValue,$linkAttConfArr[9][1]); + $sgNo =hexdec($sgNo); + $m2uaInterfaceID=getBitValue($orgValue,$linkAttConfArr[10][1]); + $m2uaInterfaceID=hexdec($m2uaInterfaceID); + $alternativeMTP3=getBitValue($orgValue,$linkAttConfArr[11][1]); + $alternativeMTP3=byte2ip($alternativeMTP3); + + if($instanceNo == 'new'){ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $getInstanceSql="SELECT instanceNo FROM $paramTable + WHERE level_1='2' AND level_2='5' AND level_3='1'AND initValue = '$defValue'"; + $result=mysqli_query($pubConn,$getInstanceSql); + echo mysqli_error($pubConn); + echo ""; + } + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + //MTP3-Lite Application Mode + $appModeArr=array(0=>"Server",1=>"Client"); + echo ""; + echo ""; + + //MTP3-Lite Remote IP + echo ""; + + //MTP3-Lite Inactivity Timeout + echo ""; + + //MTP3-Lite Allowed Timeout times + echo ""; + + echo ""; + echo ""; + echo ""; + + echo "
      NameValue
      No."; + if($DEBUG) echo "
      $getInstanceSql"; + echo ""; + echo"
      Flag"; + $flagArr=array(0=>'Disable',1=>'Enable'); + echo "
      Linkset ID "; + echo ""; + echo "
      SLC "; + echo ""; + echo "
      Host IP "; + echo ""; + echo "
      Signaling Type "; + + echo ""; + echo "
      MTP3-Lite Application Mode"; + echo ""; + echo "
      MTP3-Lite Remote IP"; + echo ""; + echo "
      MTP3-Lite Inactivity Timeout"; + echo ""; + echo "
      MTP3-Lite Allowed Timeout times"; + echo ""; + echo "
      SG ID"; + echo ""; + echo "
      M2UA Interface ID"; + echo ""; + echo "
      Alternative Host IP "; + echo ""; + echo "
      "; + + echo "\n "; + if($instanceNo != 'new'){ + echo "\n "; + } + echo "\n   "; + echo "\n "; +} + +?> + + +Remarks:

      +Linkset: The number of the linkset assigned to this link, range from 0 to 127

      +SLC: Signaling link code, rang from 0 to 15, identify the E1 links within a same linkset

      +IP: For the link 0 to 127, input 98. For the link 128 to 255, input 99 +  + + diff --git a/wxc2_omc/configuration/confSs7/ss7LinkList.php b/wxc2_omc/configuration/confSs7/ss7LinkList.php new file mode 100755 index 0000000..af963eb --- /dev/null +++ b/wxc2_omc/configuration/confSs7/ss7LinkList.php @@ -0,0 +1,508 @@ + + +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$paramTable ='OBJ_222.param_99'; +$objIdStr ='2.5.1'; +$maxNum = 30; + +$nGetComm = 0; +$nSetComm = 3; + +$sysId ='222_99_99'; +$initValue ='initValue'; +$editValue ='editValue'; +$readValue ='readValue'; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +$linkAttConfArr=array( + array('Flag','06.0-06.0'), + array('Linkset ID', '00.0-00.7'), + array('SLC No.', '01.0-01.7'), + array('Host IP', '02.0-05.7'), + array('Signaling Type', '06.1-06.3'), + array('SG ID', '07.0-07.7'), + array('M2UA Interface ID','08.0-08.7'), + array('Alternative Host IP','15.0-18.7') +); + +$linkTypeArr=array( + 0=>'8ECP', + 1=>'M2UA', + 2=>'MTP3-Lite', + 3=>'IUA', + 4=>'M3UA' +); +$levelWhere = getLevelWhere($objIdStr); +if($DEBUG) echo "
      levelWhere=$levelWhere"; + +$defSql = "select initValue from OBJ_222.paramConf where $levelWhere and paramType='2'";//paramType=2,local +$defResult = mysqli_query($pubConn,$defSql); +$defRow = mysqli_fetch_array($defResult); +$defValue = $defRow[initValue]; + +if($DEBUG)echo "
      defValue=$defValue"; +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      setInstanceNo=$setInstanceNo"; +if($DEBUG) echo "
      setObjIdStr =$setObjIdStr"; +//========================================================== +//数据处理 +//========================================================== +//处理get/set命令 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + echo "




      "; + if(isset($setSys) || isset($getSys)){ + if(isset($setSys)){ + $moveSql = "UPDATE $paramTable SET readValue = initValue + WHERE level_1='2' AND level_2='5' AND level_3='1' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + + $commIdStr = sysCommSend($sysId,$nSetComm,$objIdStr); + + $showType="Set"; + }else{ + $commIdStr = sysCommSend($sysId,$nGetComm,$objIdStr); + $showType="Get"; + } + if($DEBUG) echo "
      commIdStr =$commIdStr"; + if($DEBUG) echo "
      commIdStr =$commIdStr"; + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Link"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + $needCopyReadBuf = 1; + + //Get link status + $commIdStr = sysCommSend($sysId,$nGetComm,"3.1"); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Get Link Status"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' AND level_2='5' AND level_3='1' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='3' AND level_2='1' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + }elseif(isset($saveSys)){ + $updSql = " UPDATE $paramTable SET initValue = '02' + WHERE level_1 = '3' AND level_2 = '7' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.7'); + if($DEBUG) echo "
      commIdStr =$commIdStr"; + if($DEBUG) echo "
      commIdStr =$commIdStr"; + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + }elseif(isset($resetSys)){ + $updSql = " UPDATE $paramTable SET initValue = '01' + WHERE level_1 = '3' AND level_2 = '7' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.7'); + if($DEBUG) echo "
      commIdStr =$commIdStr"; + if($DEBUG) echo "
      commIdStr =$commIdStr"; + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + } +} +if(1==$delete) +{ + $delSql = "UPDATE $paramTable SET initValue = '$defValue' + WHERE level_1='2' AND level_2='5' AND level_3='1' AND instanceNo='$delValue'"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} + +if($setSys || $getSys || $saveSys || $undoSet||$resetSys){ + echo "
      "; + echo "

      $strBack"; + exit(); +} +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + + +remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} +?> + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > $strNetwork > SS7 > $strLink"; +echo ""; +showHelp($helpId); +echo "
      "; + +echo "System:  "; +echo ""; +echo ""; +/* +if ( TRUE == session_is_registered("linkSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +*/ +echo "      "; +echo "Command:  "; +echo ""; +echo ""; +echo ""; +echo ""; + +echo " 
      "; +adjust_title_tail(); +adjust_content_head(); +/* +echo "
      "; +echo "System:  "; +echo ""; +echo ""; +echo ""; +if ( TRUE == session_is_registered("linkSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +echo "Omc:  "; +echo ""; +echo "      "; +echo ""; +echo ""; +*/ + +?> +
      + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$levelWhere = getLevelWhere($objIdStr); +if($DEBUG) echo "
      levelWhere=$levelWhere"; + +$getSql="SELECT $initValue,instanceNo FROM $paramTable + WHERE $levelWhere + "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); + +while($rows=mysqli_fetch_array($result)){ + $instanceNo=$rows[1]; + $value=$rows[0]; + if(strcasecmp($rows[0],$defValue)==0){ + continue; + } + $flag =getBitValue($value,$linkAttConfArr[0][1]); + $flag =hexdec($flag); + $linksetNo =getBitValue($value,$linkAttConfArr[1][1]); + $linksetNo =hexdec($linksetNo); + $slcNo =getBitValue($value,$linkAttConfArr[2][1]); + $slcNo =hexdec($slcNo); + $cpcIp =getBitValue($value,$linkAttConfArr[3][1]); + $cpcIp =byte2ip($cpcIp); + $linkType =getBitValue($value,$linkAttConfArr[4][1]); + $linkType =bindec($linkType); + $sgNo =getBitValue($value,$linkAttConfArr[5][1]); + $sgNo =hexdec($sgNo); + $m2uaInterfaceId=getBitValue($value,$linkAttConfArr[6][1]); + $m2uaInterfaceId=hexdec($m2uaInterfaceId); + $alternativeMTP3=getBitValue($value,$linkAttConfArr[7][1]); + $alternativeMTP3=byte2ip($alternativeMTP3); + + + if($objIdStr == $setObjIdStr && $instanceNo == $setInstanceNo){ + echo ""; + }else{ + echo ""; + } + {//get link Status + $objStr = '3.1'; + $levelWhere = getLevelWhere($objStr); + $selSql = "select initValue from $paramTable where $levelWhere and instanceNo='$rows[instanceNo]'"; + $staResult = @mysqli_query($pubConn,$selSql); + $staRows = @mysqli_fetch_array($staResult); + $status = hexdec($staRows[initValue]); + } + $linkStateArr = array(0=>'Unavailable',1=>'Available',2=>'Inhibited'); + $flagArr=array(0=>'Disable',1=>'Enable'); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +//New +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> +
      No.FlagLinkset IDSLCHost IPSignaling TypeSG IDM2UA Interface IDAlternative Host IPStatusDelete
      "; + echo "$instanceNo{$flagArr[$flag]}$linksetNo$slcNo$cpcIp{$linkTypeArr[$linkType]}$sgNo$m2uaInterfaceId$alternativeMTP3{$linkStateArr[$status]}
      "; +echo "New--------------------
      + +  + + + diff --git a/wxc2_omc/configuration/confSs7/ss7LinksetConf.php b/wxc2_omc/configuration/confSs7/ss7LinksetConf.php new file mode 100755 index 0000000..31401e1 --- /dev/null +++ b/wxc2_omc/configuration/confSs7/ss7LinksetConf.php @@ -0,0 +1,261 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$db = "OBJ_222"; +$numberPerPage = 100; //每页纪录数 +$paramTable ='OBJ_222.param_99'; + +$sysId ='222_99_99'; +$initValue ='initValue'; +$listPageUrl="./ss7LinksetList.php?setObjIdStr=$objIdStr&setInstanceNo=$instanceNo"; +$linksetOid ='2.4.1'; +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      instanceNo =$instanceNo"; +if($DEBUG) echo "
      objIdStr =$objIdStr"; + +//========================================================== +//数据处理 +//========================================================== +$linksetConfArr=array( + array('Linkset DPC', '0.0-2.7', 'DPC'), + array('Network indicator', '3.0-3.1', 'NetID'), + array('Flag', '3.2-3.2', 'Flag'), + array('Loopback Option', '3.3-3.3', 'LoopFlag') + ); +$NetIdConfArr=array( + array('00','International'), + array('01','International Spare'), + array('10','National'), + array('11','National Spare') +); + +$LoopConfArr=array( + array('0','Disable'), + array('1','Enable') +); + +$flagConfArr=array(0=>"Disable",1=>"Enable"); +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> +
      + + +"; +$tableHeader =""; + +$levelArr=explode('.',$linksetOid); +for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; +} + +$defSql = "SELECT initValue from paramConf + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; +if($DEBUG) +echo "defSql=$defSql
      "; +$defRes = mysqli_query($pubConn,$defSql); +$defRow = mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; +if($DEBUG) +echo "defaultValue=$defaultValue
      "; + +switch($objIdStr){ + case '2.4.1': + if($instanceNo == 'new'){ + $orgValue='0000000000000000000000000000000000000000'; + }else{ + $selSql = "SELECT initValue + FROM $paramTable + WHERE level_1='2' AND level_2='4' AND level_3='1' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      selSql=$selSql"; + $result=mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + $orgValue=$rows[0]; + echo mysqli_error($pubConn); + //$orgValue=getSysParamValue($sysId,$objIdStr,$instanceNo,$initValue); + } + if($_SERVER['REQUEST_METHOD'] == "POST"){ + //保存改动 + $newValue=$orgValue; + //OPC + if($DEBUG) echo "
      OPC=$OPC"; + $OPC=omc_keep_length($OPC,"0","6","1"); + $newValue=setBitValue($newValue,$linksetConfArr[0][1],$OPC); + if($DEBUG) echo "
      newValue=$newValue"; + + + //NetID + if($DEBUG) echo "
      NetID=$NetID"; + $newValue=setBitValue($newValue,$linksetConfArr[1][1],$NetID); + if($DEBUG) echo "
      newValue=$newValue"; + + //Flag + if($DEBUG) echo "
      Flag=$Flag"; + $newValue=setBitValue($newValue,$linksetConfArr[2][1],$Flag); + if($DEBUG) echo "
      newValue=$newValue"; + + + //loopFlag + if($DEBUG) echo "
      loopFlag=$loopFlag"; + $newValue=setBitValue($newValue,$linksetConfArr[3][1],$loopFlag); + if($DEBUG) echo "
      newValue=$newValue"; + $updSql = "UPDATE $paramTable SET initValue = '$newValue' + WHERE level_1='2' AND level_2='4' AND level_3='1' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + //setSysParamValue($sysId,$objIdStr,$instanceNo,$newValue); + echo ""; + exit(); + }else{ + //显示 + $OPC =getBitValue($orgValue,$linksetConfArr[0][1]); + $NetID =getBitValue($orgValue,$linksetConfArr[1][1]); + $Flag =getBitValue($orgValue,$linksetConfArr[2][1]); + $loopFlag =getBitValue($orgValue,$linksetConfArr[3][1]); + echo "\n $tableHeader"; + echo "\n
      "; + echo ""; + echo ""; + echo ""; + + if($instanceNo == 'new'){ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $getInstanceSql="SELECT instanceNo FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3'AND $initValue = '$defaultValue'"; + $result=mysqli_query($pubConn,$getInstanceSql); + echo mysqli_error($pubConn); + echo ""; + } + + echo "\n "; + echo ""; + echo ""; + + echo "\n "; + echo ""; + echo ""; + echo ""; + + + + + echo "\n "; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      NameValue
      No."; + if($DEBUG) + echo "
      $getInstanceSql"; + echo ""; + echo"
      Flag"; + echo ""; + echo "
      Linkset DPC(hex)
      Network Indicator"; + echo ""; + echo "
      Loopback Option"; + echo ""; + echo "
      "; + + echo "\n "; + if($instanceNo != 'new'){ + echo "\n "; + } + echo "\n   "; + echo "\n "; + break; + } +} +/* +Opposite point code: The opposite point code of the linkset

      +Network indicator: The network type of the opposite point code

      +Loop back: Loop back enable or disable, used for MSC loop back link +*/ +?> + +Remarks:

      +DPC: Specify a Destination Point Code to this linkset.

      +Network indicator: The signaling network type of this signaling point.

      +Loop back: Enable or disable loopback function on this linkset. Used only for dual platform MSS loopback. + + diff --git a/wxc2_omc/configuration/confSs7/ss7LinksetList.php b/wxc2_omc/configuration/confSs7/ss7LinksetList.php new file mode 100755 index 0000000..33babf8 --- /dev/null +++ b/wxc2_omc/configuration/confSs7/ss7LinksetList.php @@ -0,0 +1,510 @@ + + + +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$db = "OBJ_222"; +$paramTable ='OBJ_222.param_99'; + +$maxNum = 30; + +$nGetComm = 0; +$nSetComm = 3; + +$sysId ='222_99_99'; +$instanceNo ='0'; +$initValue ='initValue'; +$readValue ='readValue'; +$editValue ='editValue'; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      setInstanceNo=$setInstanceNo"; +if($DEBUG) echo "
      setObjIdStr =$setObjIdStr"; +//========================================================== +//数据处理 +//========================================================== +//处理get/set命令 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + echo "




      "; + if(isset($setSys) || isset($getSys)){ + if(isset($setSys)){ + $moveSql = "UPDATE $paramTable SET readValue = initValue + WHERE level_1='2' AND level_2='4' AND level_3='1' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $commIdStr = sysCommSend($sysId,$nSetComm,$objIdStr); + + $showType="Set"; + }else{ + $commIdStr = sysCommSend($sysId,$nGetComm,$objIdStr); + $showType="Get"; + } + + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Linkset"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + //Get linkset status + $commIdStr = sysCommSend($sysId,$nGetComm,"3.2"); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Get Linkset status"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' AND level_2='4' AND level_3='1' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='3' AND level_2='2' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + }elseif(isset($saveSys)){ + $updSql = " UPDATE $paramTable SET initValue = '02' + WHERE level_1 = '3' AND level_2 = '7' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.7'); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + }elseif(isset($resetSys)){ + $updSql = " UPDATE $paramTable SET initValue = '01' + WHERE level_1 = '3' AND level_2 = '7' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $commIdStr=sysCommSend($sysId,$nSetComm,'3.7'); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + } +} +if(1==$delete) +{ + $delSql = "UPDATE $paramTable SET initValue = '0000000000000000000000000000000000000000' + WHERE level_1='2' AND level_2='4' AND level_3='1' AND instanceNo='$delValue'"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} + + +if($setSys || $getSys || $saveSys || $undoSet||$resetSys){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + +$linksetOid ='2.4.1'; +$objIdStr ='2.4.1'; +$linksetConfArr=array( + array('Flag','3.2-3.2'), + array('Linkset DPC','0.0-2.7'), + array('Network indicator','3.0-3.1'), + array('Loopback Option','3.3-3.3') + ); +$NetIdConfArr=array( + array('00','International'), + array('01','International spare'), + array('10','National'), + array('11','National spare') +); +$flagConfArr=array(0=>"Disable",1=>"Enable"); + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + + +remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} +?> + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > $strNetwork > SS7 > $strLinkset"; +echo ""; +showHelp($helpId); +echo "
      "; + +echo "System:  "; +echo ""; +echo ""; +/* +if ( TRUE == session_is_registered("linksetSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +*/ +echo "      "; +echo "Command:  "; +echo ""; +echo ""; +echo ""; +echo ""; + +echo " 
      "; + +adjust_title_tail(); +adjust_content_head(); +/* +echo "
      "; +echo "System:  "; +echo ""; +echo ""; +echo ""; +if ( TRUE == session_is_registered("linksetSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +echo "OMC:  "; +echo ""; +echo "      "; +echo ""; +echo ""; +*/ + +?> +
      + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +$levelArr=explode('.',$linksetOid); +for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; +} + +$defSql = "SELECT initValue from paramConf + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; +if($DEBUG) echo "defSql=$defSql
      "; +$defRes = mysqli_query($pubConn,$defSql); +$defRow = mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; +if($DEBUG) echo "defaultValue=$defaultValue
      "; + +$getSql="SELECT $initValue,instanceNo FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); + +while($rows =mysqli_fetch_array($result)){ + $instanceNo=$rows[instanceNo]; + $value=$rows[0]; + if(strcasecmp($rows[initValue],$defaultValue)==0){ + continue; + } + + $flag =getBitValue($value,$linksetConfArr[0][1]); + $OPC =getBitValue($value,$linksetConfArr[1][1]); + $NetID =getBitValue($value,$linksetConfArr[2][1]); + $loopFlag =getBitValue($value,$linksetConfArr[3][1]); + if($objIdStr == $setObjIdStr && $instanceNo == $setInstanceNo){ + echo "
      "; + }else{ + echo ""; + } + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} + +//New +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +?> +
      No.FlagLinkset DPCNetwork IndicatorLoopback OptionStatusDelete
      "; + echo "$instanceNo{$flagConfArr[$flag]}$OPC"; + if($DEBUG) echo "NetID=$NetID
      "; + for($i=0;$i
      "; + if($DEBUG) echo "loopFlag=$loopFlag
      "; + if($loopFlag > 0){ + echo "Enable"; + }else{ + echo "Disable"; + } + {//get linkset Status + $objStr = '3.2'; + $levelWhere = getLevelWhere($objStr); + $selSql = "select initValue from $paramTable where $levelWhere and instanceNo='$rows[instanceNo]'"; + $staResult = @mysqli_query($pubConn,$selSql); + $staRows = @mysqli_fetch_array($staResult); + $status = hexdec($staRows[initValue]); + } + $lsStateArr = array(0=>'Unavailable',1=>'Available',2=>'Reserved'); + echo "
      "; + echo "{$lsStateArr[$status]}"; + echo "
      "; +echo "New------------
      + +  + + + diff --git a/wxc2_omc/configuration/confSs7/ss7spcRoutineConf.php b/wxc2_omc/configuration/confSs7/ss7spcRoutineConf.php new file mode 100755 index 0000000..baf1d34 --- /dev/null +++ b/wxc2_omc/configuration/confSs7/ss7spcRoutineConf.php @@ -0,0 +1,533 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$nGetComm = 0; +$nSetComm = 3; + +$nProcFaileStat = 0; +$nWaitProcStat = 1; +$nInProcStat = 2; +$nProcDoneStat = 3; + +$listPageUrl="./ss7spcRoutineList.php?setObjIdStr=$objIdStr&setInstanceNo=$instanceNo"; +$pubDb = 'OMC_PUB'; +$paramTable ='OBJ_222.param_99'; +$sysId ='222_99_99'; +//$instanceNo ='0'; +$valueName ='initValue'; + +function getSysCommStat($commId) +{ + $DEBUG = 0; + $pubDb = 'OMC_PUB'; + $commTable = 'parameterComm'; + + $getSql = "SELECT commState FROM $commTable WHERE commId ='$commId'"; + $result=mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + if($result){ + $row=mysqli_fetch_array($result); + $commState=$row[commState]; + return($commState); + }else{ + return(-1); + } +} + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      sysId =$sysId"; +if($DEBUG) echo "
      instanceNo =$instanceNo"; +if($DEBUG) echo "
      objIdStr =$objIdStr"; + +//========================================================== +//数据处理 +//========================================================== +$NetOPLenArr=array( + //array('oid','offset', 'name'), + array('International network','0.0'), + array('International network spare','0.1'), + array('National network','0.2'), + array('National network spare','0.3') +); + +$NetOPTypeArr=array( + //array('oid','offset', 'name'), + array('International network type','0.4'), + array('International network spare type','0.5'), + array('National network type','0.6'), + array('National network spare type','0.7') +);//roger + +$NetOPCArr=array( + //array('oid', 'name'), + array('2.3.1', '14bit international network'), + array('2.3.2', '14bit international network -s'), + array('2.3.3', '14bit national network'), + array('2.3.4', '14bit national network -s'), + array('2.3.5', '24bit international network'), + array('2.3.6', '24bit internation network -s'), + array('2.3.7', '24bit national network'), + array('2.3.8', '24bit national network -s') +); +$RoutingArr=array( + array('2.6.1', 'International network'), + array('2.6.2', 'International network spare'), + array('2.6.3', 'National network'), + array('2.6.4', 'National network spare') +); +$RoutingConfArr=array( + //array('remark', 'offset','inputName','valueLen'), + array('DPC', '0.0-2.7','DPC','6'), + array('Normal linkset', '3.0-3.7','normalLinkset','2'), + array('Alternative linkset', '4.0-4.7','alterLinkSet','2'), + array('M3UA Routing Context', '5.0-8.7','M3UARoutingContext','8') +); + +$ACNArr=array( + array('2.7.1', 'Local ACN'), + array('2.7.2', 'International network'), + array('2.7.3', 'International network spare'), + array('2.7.4', 'National network'), + array('2.7.5', 'National network spare') +); +$ACNConfArr=array( + array('Network Location Update', '0.0-0.7', 'NLU','2'), + array('Location Cancel', '1.0-1.7', 'LC','2'), + array('Roaming Number Enquiry', '2.0-2.7', 'RNN','2'), + array('Location Info Retrieval', '3.0-3.7', 'LIR','2'), + array('Reset Context', '4.0-4.7', 'RC','2'), + array('Handover Control', '5.0-5.7', 'HC','2'), + array('Equipment Management', '6.0-6.7', 'EM','2'), + array('Info Retrieval', '7.0-7.7', 'IR','2'), + array('Inter VLR Info Retrieval', '8.0-8.7', 'IVIR','2'), + array('Subscriber Data Management', '9.0-9.7', 'SDM','2'), + array('Tracing', '10.0-10.7','Trac','2'), + array('Network Functional SS', '11.0-11.7','NFSS','2'), + array('Network Unstructured SS', '12.0-12.7','NUSS','2'), + array('Short Message Gateway', '13.0-13.7','SMG','2'), + array('Short Messsage MO Relay', '14.0-14.7','SMMOR','2'), + array('Short Message Alert', '15.0-15.7','SMA','2'), + array('Short Message Waiting Data Management', '16.0-16.7','SMWDM','2'), + array('Mobile Terminating Short Message Relay', '17.0-17.7','MTSMR','2'), + array('IMSI Retrieval', '18.0-18.7','IMSIR','2'), + array('MS Purging', '19.0-19.7','MSP','2'), + array('Subscriber Info Enquiry', '20.0-20.7','SIE','2'), + array('Any Time Info Enquiry', '21.0-21.7','ATIE','2'), + array('Call Control Transfer', '22.0-22.7','CCT','2'), + array('Invocation Notification', '23.0-23.7','IN','2'), + array('SIWFS Allocation', '24.0-24.7','SA','2'), + array('Group Call Control', '25.0-25.7','GCC','2'), + array('GPRS Location Update', '26.0-26.7','CLU','2'), + array('GPRS Location Info Retrieval', '27.0-27.7','GLIR','2'), + array('Failure Report', '28.0-28.7','FR','2'), + array('GPRS Notify', '29.0-29.7','GN','2'), + array('Reporting', '30.0-30.7','Repo','2'), + array('Call Completion', '31.0-31.7','CallComp','2'), + array('Security Triplets', '32.0-32.7','ST','2'), + array('Subscriber Interrogate', '33.0-33.7','SI','2'), + array('HLR Subscriber Management', '34.0-34.7','HLRSM','2'), + array('HLR Ping AUC', '35.0-35.7','HLRPAUC','2') +); + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + + +
      + +"; +$tableHeader =""; +switch($objIdStr){ + case '2.2.0': + case '2.2.1': + case '2.2.2': + case '2.2.3': + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $getInstanceSql="SELECT initValue + FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2'"; + $result=mysqli_query($pubConn,$getInstanceSql); + $row=mysqli_fetch_array($result); + + if($_SERVER['REQUEST_METHOD'] == "POST"){ + //sysCommSend($sysId,$nGetComm,"2.2"); + //sleep(2); + $getInstanceSql="SELECT initValue + FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' "; + $result=mysqli_query($pubConn,$getInstanceSql); + $row=mysqli_fetch_array($result); + $row[0]=setBitValue($row[0],$NetOPLenArr[$level_3][1],$length_type); + $row[0]=setBitValue($row[0],$NetOPTypeArr[$level_3][1],$type_type);//roger + echo "$row[0]"; + $setSql="UPDATE $paramTable + SET initValue='$row[0]' + WHERE level_1='$level_1' AND level_2='$level_2' "; + + mysqli_query($pubConn,$setSql); + echo mysqli_error($pubConn); + echo ""; + exit(); + } + switch($level_3){ + case '0': + $opcArr="International Network"; + break; + case '1': + $opcArr="International Spare Network"; + break; + case '2': + $opcArr="National Network"; + break; + case '3': + $opcArr="National Spare Network"; + break; + } + + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      $opcArr
      "; + echo ""; + echo ""; + echo ""; + + $arr_LengthType = array("14bit","24bit"); + $arr_TypeType = array("ITU","ANSI"); + if(!$flag) + { + $length_type=getBitValue($row[0],$NetOPLenArr[$level_3][1]); + $type_type=getBitValue($row[0],$NetOPTypeArr[$level_3][1]);//roger + } + else + { + $length_type=$length_type; + $type_type=$type_type;//roger + }; + echo ""; + //roger............................................................ + echo ""; + echo ""; + //roger............................................................... + echo ""; + echo "
      Length "; + echo ""; + echo "Type "; + echo ""; + echo "
      "; + break; + case '2.3.1': + case '2.3.2': + case '2.3.3': + case '2.3.4': + case '2.3.5': + case '2.3.6': + case '2.3.7': + case '2.3.8': + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $getInstanceSql="SELECT initValue + FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3'"; + $result=mysqli_query($pubConn,$getInstanceSql); + $row=mysqli_fetch_array($result); + $row[0] = hexdec($row[0]); + if($_SERVER['REQUEST_METHOD'] == "POST"){ + $opc = dechex($opc); + //if(strlen($opc) > 6)alertmax(); + $opc=omc_keep_length($opc,"0","6","1"); + $setSql="UPDATE $paramTable + SET initValue='$opc' + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' "; + mysqli_query($pubConn,$setSql); + echo mysqli_error($pubConn); + echo ""; + exit(); + } + + switch($level_3){ + case '1': + case '5': + $opcArr="International Network"; + break; + case '2': + case '6': + $opcArr="International Spare Network"; + break; + case '3': + case '7': + $opcArr="National Network"; + break; + case '4': + case '8': + $opcArr="National Spare Network"; + break; + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      $opcArr
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      OPC (dec)
      "; + break; + case '2.6.1': + case '2.6.2': + case '2.6.3': + case '2.6.4': + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + if($instanceNo == 'new'){ + $RoutValue="000000808000000000"; + }else{ + $getSql="SELECT $valueName + FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows= mysqli_fetch_array($result); + $RoutValue=$rows[0]; + } + if($DEBUG) echo "
      RoutValue=$RoutValue"; + if($DEBUG) echo "
      "; + if($_SERVER['REQUEST_METHOD'] == "POST"){ + //保存改动 + $newRoutValue=$RoutValue; + for($i=0;$i$unitName=$unitValue"; + $newRoutValue=setBitValue($newRoutValue,$RoutingConfArr[$i][1],$unitValue); + //if($DEBUG) + echo "
      newRoutValue=$newRoutValue"; + } + + $moveSql="UPDATE $paramTable SET initValue ='$newRoutValue' + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + mysqli_query($pubConn,$moveSql); + echo ""; + exit(); + }else{ + //显示 + echo "\n $tableHeader"; + echo "\n "; + echo "NameValue"; + echo ""; + if($instanceNo == 'new'){ + $getInstanceSql="SELECT instanceNo FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3'AND $valueName = '000000808000000000'"; + $result=mysqli_query($pubConn,$getInstanceSql); + echo mysqli_error($pubConn); + echo "No."; + if($DEBUG) echo "
      $getInstanceSql"; + echo ""; + echo""; + } + + for($i=0;$iunitValue=$unitValue"; + $unitInputName=$RoutingConfArr[$i][2]; + $unitLen=$RoutingConfArr[$i][3]+1;//roger + if($DEBUG) + echo "
      unitLen=$unitLen"; + echo "\n "; + echo "$unitShowName"; + if($i==0){ + echo "";//roger + }else{ + echo ""; + } + echo "  (DEC)"; + echo ""; + } + } + break; + case '2.7.1': + case '2.7.2': + case '2.7.3': + case '2.7.4': + case '2.7.5': + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $acnValue=getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName); + if($_SERVER['REQUEST_METHOD'] == "POST"){ + //保存改动 + $newRoutValue=$acnValue; + for($i=0;$i$unitName=$unitValue"; + $newRoutValue=setBitValue($newRoutValue,$ACNConfArr[$i][1],$unitValue); + if($DEBUG) echo "
      newRoutValue=$newRoutValue"; + } + + $moveSql="UPDATE $paramTable SET initValue ='$newRoutValue' + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + mysqli_query($pubConn,$moveSql); + + echo ""; + exit(); + }else{ + //显示 + echo "\n $tableHeader"; + echo "\n "; + echo "OperationSuggested version"; + echo ""; + for($i=0;$i"; + echo "$unitShowName"; + echo ""; + echo ""; + } + } + break; +} +echo "\n "; + + +echo "\n "; +if($instanceNo != 'new'){ + echo "\n "; +} +echo "\n   "; +echo "\n "; +/* +DPC: Destination point code of the MSC using this OPC

      +Normal linkset: Linkset assigned to the link connected to the device using this DPC

      +Alternative linkset: Alternative linkset of the normal linkset

      +The ACN facility enables the version negotiation for the above messages, which make the WXC2 System more compatible with the other networks by means of flexible message version adjustment. The adjustable version includes Version 1, Version 2 and Version 3 +*/ +?> + + +Remarks:

      +DPC: Specify a Destination Point Code to this route.

      +Normal linkset: Assign a primary linkset to this route.

      +Alternative linkset: Assign an alternative linkset to this route when the normal linkset becomes unavailable.

      +M3UA Routing Context: For M3UA use only. Specify the M3UA Routing Context used by M3UA peers to identify a particular application server. + + \ No newline at end of file diff --git a/wxc2_omc/configuration/confSs7/ss7spcRoutineList.php b/wxc2_omc/configuration/confSs7/ss7spcRoutineList.php new file mode 100755 index 0000000..7deccc3 --- /dev/null +++ b/wxc2_omc/configuration/confSs7/ss7spcRoutineList.php @@ -0,0 +1,809 @@ + + + +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$db = "OBJ_222"; +$paramTable ='OBJ_222.param_99'; +$maxNum = 30; + +$sysId ='222_99_99'; +$instanceNo ='0'; +$editValue ='editValue'; +$initValue ='initValue'; +$readValue ='readValue'; + +$nGetComm = 0; +$nSetComm = 3; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +$NetOPLenArr=array( + //array('oid','offset', 'name'), + array('2.2','0.0','International network'), + array('2.2','0.1','International network spare'), + array('2.2','0.2','National network'), + array('2.2','0.3','National network spare') +); + +$NetOPTypeArr=array( + //array('oid','offset', 'name'), + array('International network type','0.4'), + array('International network spare type','0.5'), + array('National network type','0.6'), + array('National network spare type','0.7') +); + +$NetOPCArr=array( + //array('oid', 'name'), + array('2.3.1', '14bit international network'), + array('2.3.2', '14bit international network -s'), + array('2.3.3', '14bit national network'), + array('2.3.4', '14bit national network -s'), + array('2.3.5', '24bit international network'), + array('2.3.6', '24bit internation network -s'), + array('2.3.7', '24bit national network'), + array('2.3.8', '24bit national network -s') +); + +$RoutingArr=array( + array('2.6.1', 'International network'), + array('2.6.2', 'International network spare'), + array('2.6.3', 'National network'), + array('2.6.4', 'National network spare') +); + +$ACNArr=array( + array('2.7.1', 'Local ACN'), + array('2.7.2', 'International network'), + array('2.7.3', 'International network spare'), + array('2.7.4', 'National network'), + array('2.7.5', 'National network spare') +); + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      setInstanceNo=$setInstanceNo"; +if($DEBUG) echo "
      setObjIdStr =$setObjIdStr"; +//========================================================== +//数据处理 +//========================================================== +//处理get/set命令 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + echo "




      "; + if(isset($setSys)){ + //为set做准备 + $moveSql = "UPDATE $paramTable SET readValue = initValue + WHERE level_1='2' AND level_2='2' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $moveSql = "UPDATE $paramTable SET readValue = initValue + WHERE level_1='2' AND level_2='3' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $moveSql = "UPDATE $paramTable SET readValue = initValue + WHERE level_1='2' AND level_2='6' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $moveSql = "UPDATE $paramTable SET readValue = initValue + WHERE level_1='2' AND level_2='7' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + + $commIdStr = sysCommSend($sysId,$nSetComm,"2.3"); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Set OPC"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + + $commIdStr = sysCommSend($sysId,$nSetComm,"2.2"); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Set PC length"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + $commIdStr = sysCommSend($sysId,$nSetComm,"2.6"); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Set DPC,Normal linkset,Alternative linkset"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + $commIdStr = sysCommSend($sysId,$nSetComm,"2.7"); + + + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Set ACN"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + + }elseif(isset($getSys)){ + $commIdStr = sysCommSend($sysId,$nGetComm,"2.3"); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Get OPC"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + $commIdStr = sysCommSend($sysId,$nGetComm,"2.2"); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Get PC length"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + $commIdStr = sysCommSend($sysId,$nGetComm,"2.6"); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Get DPC,Normal linkset,Alternative linkset"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + $commIdStr = sysCommSend($sysId,$nGetComm,"2.7"); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Get ACN"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' AND level_2='2' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' AND level_2='3' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' AND level_2='6' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE level_1='2' AND level_2='7' + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + }elseif(isset($saveSys)){ + $updSql = " UPDATE $paramTable SET initValue = '02' + WHERE level_1 = '3' AND level_2 = '7' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $objIdStr = "3.7"; + $commIdStr=sysCommSend($sysId,$nSetComm,$objIdStr); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + }elseif(isset($resetSys)){ + $updSql = " UPDATE $paramTable SET initValue = '01' + WHERE level_1 = '3' AND level_2 = '7' + "; + $updRes = @mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + $objIdStr = "3.7"; + $commIdStr=sysCommSend($sysId,$nSetComm,$objIdStr); + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "222_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + } +} +if(1==$delete){ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $delSql = "UPDATE $paramTable SET initValue = '000000808000000000' + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$delValue'"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} + + +if($setSys || $getSys || $saveSys || $undoSet||$resetSys){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + +if($DEBUG) echo "
      =======NetID=========="; +$NetIDArr=array( + //array('name', 'len value','OPC'), + array('International Network', '', ''), + array('International Network Spare','', ''), + array('National Network', '', ''), + array('National Network Spare', '', '') +); + +$NetTypeArr=array( + array('International Network', '', ''), + array('International Network Spare','', ''), + array('National Network', '', ''), + array('National Network Spare', '', '') +); + +$objIdStr =$NetOPLenArr[0][0]; +$NetIDvalue=getSysParamValue($sysId,$objIdStr,$instanceNo,$initValue); +if($DEBUG) echo "
      NetIDvalue=$NetIDvalue"; +for($i=0;$i '0'){ + $NetIDArr[$i][1]='24bit'; + $objIdStr=$NetOPCArr[$i+4][0]; + $OPCvalue=getSysParamValue($sysId,$objIdStr,$instanceNo,$initValue); + $NetIDArr[$i][2]=$OPCvalue; + $m=$i+5; + }else{ + $NetIDArr[$i][1]='14bit'; + $objIdStr=$NetOPCArr[$i][0]; + $OPCvalue=getSysParamValue($sysId,$objIdStr,$instanceNo,$initValue); + $NetIDArr[$i][2]=$OPCvalue; + $m=$i+1; + } + $tmpValue=getBitValue($NetIDvalue,$NetOPTypeArr[$i][1]); + + if($tmpValue > '0'){ + $NetTypeArr[$i][1]='ANSI'; + }else{ + $NetTypeArr[$i][1]='ITU'; + }; + $opcIdArr[$i]="2."."3.".$m; + if($DEBUG) echo "
      {$NetIDArr[$i][0]}:Len={$NetIDArr[$i][1]} ,OPC={$NetIDArr[$i][2]}"; +} + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + + +remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} +?> + + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > $strNetwork > SS7 > SPC Routing"; +echo ""; +showHelp($helpId); +echo "
      "; + +echo "System:  "; +echo ""; +echo ""; +/* +if ( TRUE == session_is_registered("routineSetFlag") ) { + echo "    "; +}else{ + echo "    "; +} +*/ +echo "      "; +echo "Command:  "; +echo ""; +echo ""; +echo ""; +echo ""; + +echo " 
      "; +adjust_title_tail(); +adjust_content_head(); +/* +echo "System:  "; +echo ""; +echo ""; +echo ""; +if ( TRUE == session_is_registered("routineSetFlag") ) { + echo "      "; +}else{ + echo "      "; +} +echo "OMC:  "; +echo ""; +echo ""; +echo ""; +echo ""; +*/ + + +echo "
      "; +$tableHead=""; +for($i=0;$i"; + echo ""; + echo ""; + + $NetworkId="2.2.".$i; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $levelArr=explode('.',$RoutingArr[$i][0]); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $defSql = "SELECT initValue from paramConf + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; + if($DEBUG) echo "defSql=$defSql
      "; + $defRes = mysqli_query($pubConn,$defSql); + $defRow = mysqli_fetch_array($defRes); + $defaultValue = $defRow[initValue]; + if($DEBUG) + echo "defaultValue=$defaultValue
      "; + + $getSql="SELECT $initValue,instanceNo FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows =mysqli_fetch_array($result)){ + if($DEBUG) + echo "$rows[0], <1>"; + if(strcasecmp($rows[0],$defaultValue)==0){ + continue; + } + $DPC=substr($rows[0],0,6); + $NormalLinkset=substr($rows[0],6,2); + $NormalLinkset=hexdec($NormalLinkset); + $M3UA_routing_context=hexdec(substr($rows[0],10,8)); + if($NormalLinkset>127) + $NormalLinkset="--"; + + $AlternativeLinkset=substr($rows[0],8,2); + $AlternativeLinkset=hexdec($AlternativeLinkset); + if($AlternativeLinkset > 127){ + $AlternativeLinkset="--"; + } + + $instanceNo=$rows[instanceNo]; + if(($RTobjIdStr == $setObjIdStr || $ACNobjIdStr== $setObjIdStr) && $instanceNo == $setInstanceNo){ + echo "
      "; + }else{ + echo ""; + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      {$NetIDArr[$i][0]}
      PC length:{$NetIDArr[$i][1]} | PC type:{$NetTypeArr[$i][1]}
      OPC (hex):{$NetIDArr[$i][2]}"; + echo "ACN
      No.DPC (hex)Normal linkset (dec)Alternative linkset (dec)M3UA Routing Context (dec)ACNDelete
      "; + echo "$instanceNo$DPC$NormalLinkset$AlternativeLinkset$M3UA_routing_context"; + echo "ACN
      "; + echo "New------------

      "; +} +?> + +
      Remarks:
      This SPC routing page provides a straightforward interface to set the MTP3 signaling addressing (point code) and ACN (application context name) control. The MSC supports four networks (international, international spare, national and national spare) and both 14-bit and 24-bit signaling point codes. To add or modify a point code, firstly select the type of the network, and then click on the correspondent number of the point code to open the point code set window. + + + diff --git a/wxc2_omc/configuration/element/editElement.php b/wxc2_omc/configuration/element/editElement.php new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/configuration/element/main.php b/wxc2_omc/configuration/element/main.php new file mode 100755 index 0000000..dc89f0e --- /dev/null +++ b/wxc2_omc/configuration/element/main.php @@ -0,0 +1,175 @@ +array('paramTable'=>'OBJ_223.param_99', 'objIdStr'=>'2.1.8') +); +$netInfo = array( + '0'=>'International', + '1'=>'International spare', + '2'=>'National', + '3'=>'National spare' +); +?> + + + + +"; + +adjust_head(); +adjust_title_head(); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Template > Element"; +echo ""; +echo "
      "; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$selSql = "SELECT * FROM element"; +$selRes = @mysqli_query($pubConn,$selSql); +$totalDevice = @mysqli_num_rows($selRes); +for ($i=0; $i<$totalDevice; $i++){ + $selRow = @mysqli_fetch_array($selRes); + $name[$i] = $selRow[name]; + $element[$i] = $selRow[element]; + $signallingPoint[$i] = $selRow[signallingPoint]; + $remarks[$i] = $selRow[remarks]; + if($DEBUG) echo "element[$i] = $element[$i]
      "; +} + +//得到各element的状态和颜色------State +for ($i=0; $i<$totalDevice; $i++){ + $selTimeSql = "SELECT sysStat.sysTypeNo,sysStat.updateTime AS updateTime FROM sysStat,sysConf + WHERE sysStat.sysTypeNo=sysConf.sysTypeNo + AND sysConf.sysTypeName LIKE \"$element[$i]\" + AND sysConf.needHeartBeat=1"; + + if($DEBUG) echo "selTimeSql = $selTimeSql
      "; + $selTimeRes = @mysqli_query($pubConn,$selTimeSql); + $num = @mysqli_num_rows($selTimeRes); + if($DEBUG) echo "num=$num
      "; + for ($j=0; $j<$num; $j++){ + $selTimeRow = @mysqli_fetch_row($selTimeRes); + if($DEBUG) echo "$selTimeRow[0],updateTime = $selTimeRow[1]
      "; + + $due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); + $ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + if($DEBUG) echo "$due_date, $ove_date
      "; + + if ( ($selTimeRow[updateTime] < $due_date) || ($selTimeRow[updateTime] > $ove_date) ){ + $state[$i] = "OK"; + $stateColor[$i] = "#0000FF"; + }else{ + $state[$i] = "Fail"; + $stateColor[$i] = "#FF0000"; + } + } + if($DEBUG) echo "stateColor[$i] = $stateColor[$i]
      "; +} + +//NI and GTT in SCCP-------SS7 network and Global Title/Trunk group +$localNodeConfArr=array( + array('NetID', '00.0-00.7'), + array('MSISDN', '01.0-10.7'), + array('IP0', '11.0-14.7'), + array('IP1', '15.0-18.7') +); +for ($i=0; $i<$totalDevice; $i++){ + $levelArr=explode('.',$ss7Info[$element[$i]][objIdStr]); + $where = " WHERE "; + for($j=0;$jgetSql=$getSql
      "; + $getRes = @mysqli_query($pubConn,$getSql); + $getRow = @mysqli_fetch_row($getRes); + if($DEBUG) echo "getRow=$getRow[0]
      "; + + $ni = hexdec(getBitValue($getRow[0],$localNodeConfArr[0][1])); + $ss7Network[$i] = $netInfo[$ni]; + echo "ss7Network[$i] = {$ss7Network[$i]}
      "; + + $gtt[$i] = getBitValue($getRow[0],$localNodeConfArr[1][1]); + $gtt[$i] = str_replace('F','',$gtt[$i]); + if($gtt[$i] == ''){ + $gtt[$i] = '--'; + } + echo "gtt=$gtt[$i]
      "; +} + +for ($i=0; $i<$totalDevice; $i++){ + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + +//Add an element +echo ""; +echo ""; +echo ""; +adjust_content_tail(); +echo ""; +echo ""; +?> diff --git a/wxc2_omc/configuration/elementConf/elementConf.php b/wxc2_omc/configuration/elementConf/elementConf.php new file mode 100755 index 0000000..fd4694b --- /dev/null +++ b/wxc2_omc/configuration/elementConf/elementConf.php @@ -0,0 +1,122 @@ + + + +selSql=$selSql"; + $res = @mysqli_query($pubConn,$selSql); + $num=mysqli_num_rows($res); + echo "num=$num"; + echo "selSql=$selSql"; + + for($i=1;$i<$num;$i++){ + $tmpExistFlag=$_REQUEST['existFlag_'.$i]; + //echo "
      tmpExistFlag=$tmpExistFlag"; + if(!isset($tmpExistFlag)) + $tmpExistFlag=0; + $updateSql="UPDATE $tableName SET existFlag='$tmpExistFlag' WHERE elementNo='$i'"; + //echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + } +} //end if($save) +?> + + +selSql=$selSql"; +$res = @mysqli_query($pubConn,$selSql); +?> + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      Wxc2-Element"; +echo "GetSet
      No.NameElementSignalling pointSS7 NetworkProtocolGlobal Title/Trunk groupStateRemarksDelete
      $seqNo$name[$i]$element[$i]$signallingPoint[$i]$ss7Network[$i] $gtt[$i]$state[$i]$remarks[$i] 
      "; +echo "New
      "; +echo "Advanced > Network > Element configuration"; +echo " "; +//showHelp($helpId); +echo "
      "; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + +

      " > + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; + +while($row = @mysqli_fetch_array($res)){ + if($row[elementNo]==0) + continue; + //if($row[elementName]=="BSS") continue; + echo ""; + echo ""; + echo "
      "; +echo "

      Element Configuration

      ElementExist Flag
      $row[elementName]"; + $tmpStr="existFlag_".$row[elementNo]; + //echo "
      tmpStr=$tmpStr"; + if($row[existFlag] == '1'){ + echo ""; + }else{ + echo ""; + } +} +echo "
      "; +?> +

      " name="save"> +

      +
      + + + + diff --git a/wxc2_omc/configuration/fileTransConf/fileTransferConfiguration.php b/wxc2_omc/configuration/fileTransConf/fileTransferConfiguration.php new file mode 100755 index 0000000..a8201b0 --- /dev/null +++ b/wxc2_omc/configuration/fileTransConf/fileTransferConfiguration.php @@ -0,0 +1,127 @@ + + + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Template > File Transfer"; + echo ""; + //showHelp($helpId); + echo "
      "; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +?> + +"; + + //delete from the wsmsServConf + $pubDb="OMC_PUB"; + $delSql = "DELETE FROM fileTransConf WHERE instanceNo='$instanceNo' "; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + echo "Delete successfully!
      "; + + + } + + + + //Get the hpmn server info from database + $database="OMC_PUB"; + $selSql = "SELECT * FROM fileTransConf where srcDir IS NOT NULL and dstDir IS NOT NULL AND dstIP IS NOT NULL AND filter IS NOT NULL AND logName IS NOT NULL AND logPass IS NOT NULL "; + $selRes = @mysqli_query($pubConn,$selSql); + $FileTransObjCount=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + //echo "FileTransObjCount:$FileTransObjCount
      "; + + $typeLabel=array(0=>"FTP",1=>"SFTP"); + + $FileTransObjIndex=0; + while($selRow = @mysqli_fetch_array($selRes)) + { + $FileTransObjInstanceNo[$FileTransObjIndex]=$selRow[instanceNo]; + $FileTransObjType[$FileTransObjIndex]=$selRow[type]+0; + $FileTransObjSrcDir[$FileTransObjIndex]=$selRow[srcDir]; + $FileTransObjDstDir[$FileTransObjIndex]=$selRow[dstDir]; + $FileTransObjDstIP[$FileTransObjIndex]=$selRow[dstIP]; + $FileTransObjFilter[$FileTransObjIndex]=$selRow[filter]; + $FileTransObjLogName[$FileTransObjIndex]=$selRow[logName]; + $FileTransObjLogPass[$FileTransObjIndex]=$selRow[logPass]; + if(0) + { + echo "{$FileTransObjInstanceNo[$FileTransObjIndex]} {$typeLabel[$FileTransObjType[$FileTransObjIndex]]} {$FileTransObjSrcDir[$FileTransObjIndex]} {$FileTransObjDstDir[$FileTransObjIndex]} {$FileTransObjDstIP[$FileTransObjIndex]} {$FileTransObjFilter[$FileTransObjIndex]} {$FileTransObjLogName[$FileTransObjIndex]} {$FileTransObjLogPass[$FileTransObjIndex]}
      "; + } + $FileTransObjIndex++; + } + + echo "

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<$FileTransObjCount;$i++) + { + echo ""; + $showIndex=$i+1; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + } + $ti=$FileTransObjCount+1; + echo ""; + + echo "
      No.TypeFilterLogin NameLogin PWDestination IPSource DirectoryDestination DirectoryDelete
      $showIndex{$typeLabel[$FileTransObjType[$i]]}{$FileTransObjFilter[$i]}{$FileTransObjLogName[$i]}{$FileTransObjLogPass[$i]}{$FileTransObjDstIP[$i]}{$FileTransObjSrcDir[$i]}{$FileTransObjDstDir[$i]}Delete
      New----------------
      "; +adjust_content_tail(); +?> diff --git a/wxc2_omc/configuration/fileTransConf/operation.php b/wxc2_omc/configuration/fileTransConf/operation.php new file mode 100755 index 0000000..edeeb5b --- /dev/null +++ b/wxc2_omc/configuration/fileTransConf/operation.php @@ -0,0 +1,276 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Template > File Transfer"; + echo ""; + //showHelp($helpId); + echo "
      "; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + $DEBUG=0; + //debug_log("/tmp/sysCommand.txt","save file transfer object,save_new_obj=$save_new_obj\n"); + + if($save_new_obj == 1) + { + //get the new instanceNo + $database="OMC_PUB"; + $selSql = "SELECT max(instanceNo) as maxInstanceNo FROM fileTransConf "; + $selRes = @mysqli_query($pubConn,$selSql); + $count=mysqli_num_rows($selRes); + if($count == 1) + { + $selRow = @mysqli_fetch_array($selRes); + $maxInstanceNo=$selRow[maxInstanceNo]; + //echo "maxInstanceNo=$maxInstanceNo
      "; + } + //insert the new record + $newInstaceNo=$maxInstanceNo+1; + $saveSql="INSERT INTO fileTransConf values('$newInstaceNo','$type','$srcDir','$dstDir','$dstIP','$filter','$logName','$logPass')"; + debug_log("/tmp/sysCommand.txt",$saveSql); + mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + + echo "\n\n"; + + } + if($save_old_obj == 1) + { + //update the old file transfer object + $pubDb="OMC_PUB"; + + $saveSql="UPDATE fileTransConf SET type=$type,srcDir='$srcDir',dstDir='$dstDir',dstIP='$dstIP',filter='$filter',logName='$logName',logPass='$logPass' where instanceNo=$instance "; + //echo "saveSql=$saveSql
      "; + mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + + echo "\n\n"; + } + + + $typeLabel=array(0=>"FTP",1=>"SFTP"); + echo "

      "; + if($DEBUG) echo "instanceNo=$instanceNo,showIndex=$showIndex,operation=$operation
      "; + //Add a new file transfer object + if($operation=="new") + { + + echo "

      "; + echo ""; + echo ""; + echo ""; + + //No. + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //Type + echo ""; + echo ""; + $type=0; + echo ""; + echo ""; + + //Filter + echo ""; + echo ""; + echo ""; + echo ""; + + //Login Name + echo ""; + echo ""; + echo ""; + echo ""; + + //Login Pass + echo ""; + echo ""; + echo ""; + echo ""; + + //Destination IP + echo ""; + echo ""; + echo ""; + echo ""; + + + //Source Directory + echo ""; + echo ""; + echo ""; + echo ""; + + //Destination Directory + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
      NameValue
      No.$showIndex
      Type
      Filter
      Login Name
      Login PW
      Destination IP
      Source Directory
      Destination Directory
      "; + + //save button + echo ""; + + } + else if($operation=="edit") + { + //Get the hpmn server info from database + $database="OMC_PUB"; + $selSql = "SELECT instanceNo,type,srcDir,dstDir,dstIP,filter,logName,logPass FROM fileTransConf where instanceNo='$instanceNo' "; + $selRes = @mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + + + $selRow = @mysqli_fetch_array($selRes); + $fileTransObjInstanceNo=$selRow[instanceNo]; + $fileTransObjType=$selRow[type]+0; + $fileTransObjSrcDir=$selRow[srcDir]; + $fileTransObjDstDir=$selRow[dstDir]; + $fileTransObjDstIP=$selRow[dstIP]; + $fileTransObjFilter=$selRow[filter]; + $fileTransObjLogName=$selRow[logName]; + $fileTransObjLogPass=$selRow[logPass]; + + + + echo "

      "; + echo ""; + echo ""; + echo ""; + + //No + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //Type + echo ""; + echo ""; + echo ""; + echo ""; + + + //Filter + echo ""; + echo ""; + echo ""; + echo ""; + + //Login Name + echo ""; + echo ""; + echo ""; + echo ""; + + //Login Pass + echo ""; + echo ""; + echo ""; + echo ""; + + //Destination IP + echo ""; + echo ""; + echo ""; + echo ""; + + + //Source Directory + echo ""; + echo ""; + echo ""; + echo ""; + + //Destination Directory + echo ""; + echo ""; + echo ""; + echo ""; + + + echo "
      NameValue
      No.$showIndex
      Type
      Filter
      Login Name
      Login PW
      Destination IP
      Source Directory
      Destination Directory
      "; + + //save button + echo ""; + + } + adjust_content_tail(); +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/msc/callingPrefixConf.php b/wxc2_omc/configuration/msc/callingPrefixConf.php new file mode 100755 index 0000000..fa18de3 --- /dev/null +++ b/wxc2_omc/configuration/msc/callingPrefixConf.php @@ -0,0 +1,787 @@ + + +pPas[$i]=$pPas[$i]"; + $wAnd = $wAnd." AND level_$lNum = $pPas[$i] "; + $i++; +} +if($DEBUG) echo "
      wAnd=$wAnd"; + +/************get default value**************/ +$defSql = " SELECT initValue,level_3 FROM paramConf WHERE keyId > 0 ".$wAnd." ORDER BY level_3 "; +if($DEBUG) echo "
      defSql=$defSql
      "; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +do +{ + $leve_3 = $defRow[level_3]; + $defaultValue[$leve_3] = $defRow[initValue]; + if($DEBUG) echo "
      defaultValue[$leve_3]=$defaultValue[$leve_3]"; +}while($defRow = @mysqli_fetch_array($defRes)); + +$inTonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Unknown', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') +); + +$outTonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Unknown', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') +); + +$trkDelCArr=array( + array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000') +); + +$trkInsCArr=array( + array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000') +); + +if($DEFAULT_SYS == 'MSC'){ + $proTypeArr=array( + array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'MSRN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'MSC', 'color' => '#0000FF') + ); +}else{ + $proTypeArr=array( + array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'PBX', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '3', 'remark' => '--', 'color' => '#0000FF') + ); +} + $callTypeArr=array( + array('num' => '0', 'remark' => 'Normal', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'EM', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'IP', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'VMS', 'color' => '#0000FF') + ); + + $tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'subscriber', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') + ); + + $camelFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $eDelCArr=array( + array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000') + ); + + $eInsCArr=array( + array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000') + ); + + +//**************************************************************** +//函数 +// ChComm($sysId) +//函数说明:检查命令处理结果 +// +//变量说明: +// 无 +// +// +//返回值:$paramType +//$nSubSysParam = 0; +//$nGlobalSubSysParam = 1; +//$nGlobalSysParam = 2; +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function ChComm($sysId,$chkType=1) +{ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + $DEBUG = 0; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + if($DEBUG) echo "
      selComm=$selComm"; + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + do + { + $temCommState = $selRow[commState]; + if($selRow[remark]){ + $remark = $selRow[remark]; + //echo "
      remark=$remark"; + } + //echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc) + return($nWaitProc); + elseif($temCommState == $nInProc) + return($nInProc); + elseif($temCommState == $nOutProc) + $commState = $nOutProc; + else + $commState = 0; + }while($selRow = @mysqli_fetch_array($selRes)); + + return($commState); +} + + + +//**************************************************************** +//函数 +// 从Buffer_2拷贝到$buffer_1 +//函数说明: +// +//变量说明: +// 无 +//返回值:$paramType +//---------------------------------------------------------- + +function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1') +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wAnd; + $DEBUG = 0; + $addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' "; + + //Attributes of TG + if($type){ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wAnd.$addWer; + }else{ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wAnd.$wDef.$addWer; + } + if($DEBUG) echo "
      uTgSql=$uTgSql "; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + echo mysqli_error($pubConn); + + if($uTgRes) + return 1; + else + return 0; +} + +//**************************************************************** +//函数 +// get 或 set +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$commType +//---------------------------------------------------------- +function eSetGet($commType) { + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $maxNum,$remark,$nGetComm,$nSetComm; + $DEBUG = 0; + + if($commType == $nGetComm) { + $showType = "Get "; + } else { + $showType = "Set "; + } + + $pNext1 = 1; + //2.1.8 Calling Number manipulation + if($pNext1) { + $sysId = $sysTypeNo_1."_99"; + $objIdStr = "2.1.8.*"; + $cic = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      cic=$cic"; + + $i = 0; + while (1) { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Calling Number manipulation  "; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + if ($DEBUG) { + echo "
      chRes=$chRes"; + } + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext2 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + }//end of $pNext1 + return 1; +}//end of function + + +if ($saveSys) { + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //Get the value to "readValue" buffer. + eSetGet($nGetComm);//get value + /****************copy readValue to undoValue******************/ + $buffer_1 = "undoValue"; + $buffer_2 = "readValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //set editValue to system. + eSetGet($nSetComm); + $callingPrefixSetFlag = 1; + session_register("callingPrefixSetFlag"); + + //if get fail ( undoValue = NULL ) , unregister set flag. + $where = "WHERE level_1=2 AND level_2=1 AND level_3=8"; + $selSql = "SELECT distinct undoValue FROM $tb_2 $where ORDER BY undoValue"; + if($DEBUG) echo "selSql(1)=$selSql,db=$db_1
      "; + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = mysqli_fetch_array($selRes); + if ('' == $selRow[0]) { + session_unregister("callingPrefixSetFlag"); + if ($DEBUG) { + echo "session_unregister(\"callingPrefixSetFlag\")
      "; + } + } + + sleep(1); + echo ""; +}//end of set sys +elseif($readSys){ + eSetGet($nGetComm);//get value + + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; +}//end of $readSys +elseif($undoSet){ + /****************copy undoValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + if ( 1 == eSetGet($nSetComm) ) { + $buffer_1 = "initValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + } + session_unregister("callingPrefixSetFlag"); + + sleep(1); + echo ""; +} +//end undoSet +elseif($saveDisk) +{ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $inCed=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      $inCed=$$inCed"; + + if($inCed) + echo "
      Save success."; + else + echo "
      Save Failure."; + + flush(); + sleep(1); + echo ""; +}//end of $saveDisk +elseif($readDisk){ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $loadType = 1; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef,$loadType); + if($DEBUG) echo "
      edCin=$edCin"; + + if($edCin) + echo "
      Read success."; + else + echo "
      Read failure."; + + flush(); + sleep(1); + echo ""; + +}//end of $comSys +elseif($delete){ + $delSql = " UPDATE $tb_2 set initValue = '$defaultValue[8]' WHERE subSysNo = '99' ".$wAnd." AND instanceNo = $delValue "; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + + echo mysqli_error($pubConn); +} +elseif($saveComm) +{ + session_unregister("callingPrefixSetFlag"); + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = 'B5' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +elseif($resetComm) +{ + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = '5A' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} + +if($readSys || $saveSys || $saveComm || $undoSet||$resetComm){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + +/**************select used E1 card*******************/ +$getSql = " SELECT sysNo,subSysNo,baseStat + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo_0' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; +//echo "
      getSql=$getSql"; +$getRes = @mysqli_query($pubConn,$getSql); +$getRow = @mysqli_fetch_array($getRes); +echo mysqli_error($pubConn); +do{ + $sysNo = $getRow[sysNo]; + $subSysNo = $getRow[subSysNo]; + $cardArr[$sysNo][subSysNo] = $getRow[baseStat]; +}while($getRow = @mysqli_fetch_array($getRes)); + +/************select value to see************/ +//Attributes of TG + +$andSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wAnd." ORDER BY instanceNo "; +if($DEBUG) echo "
      andSql=$andSql"; +$andRes = @mysqli_query($pubConn,$andSql); +$andRow = @mysqli_fetch_array($andRes); +echo mysqli_error($pubConn); + +do{ + $level_3 = $andRow[level_3]; + $instanceNo = $andRow[instanceNo]; + $initValue = $andRow[initValue]; + if($DEBUG) echo "
      initValue=$initValue"; + + if($initValue == $defaultValue[$level_3]){ + $andShow[$level_3][$instanceNo] = 0; + }else{ + $andShow[$level_3][$instanceNo] = 1; + } + if($DEBUG) echo "
      andShow[$level_3][$instanceNo]={$andShow[$level_3][$instanceNo]}"; + + $prefixDigit = explode("E",substr($initValue,0,8)); + $prefixNum =$prefixArr[$instanceNo][1] = $prefixDigit[0]; + if($DEBUG) echo "
      prefixArr[$instanceNo][1]={$prefixArr[$instanceNo][1]}"; + + $outTon = $prefixArr[$instanceNo][3] = hexdec(substr($initValue,8,1)); + $inTon = $prefixArr[$instanceNo][2] = hexdec(substr($initValue,9,1)); + if($DEBUG) echo "
      inTon=$inTon, outTon=$outTon"; + + $tdc = $prefixArr[$instanceNo][4] = hexdec(substr($initValue,11,1)); + $tic = $prefixArr[$instanceNo][5] = hexdec(substr($initValue,10,1)); + if($DEBUG) echo "
      tdc=$tdc, tic=$tic
      "; + + $tidDigit = explode("E",substr($initValue,12,8)); + $tid = $prefixArr[$instanceNo][6] = $tidDigit[0]; + +}while($andRow = @mysqli_fetch_array($andRes)); + +$wDef = " AND ("; + +for($i=0;$i<256;$i++) +{ + //2.1.8 + if ( $andShow[8][$i] > 0 ){ + $realShow[$i] = 1; + if($DEBUG) echo "
      realShow[$i]=$realShow[$i]"; + $wDef = $wDef." instanceNo = $i OR "; + } +} +$wDef = substr($wDef,0,-3); +$wDef = $wDef.")"; +if(strlen($wDef) < 10){ + $wDef = ' AND instanceNo < 0 '; +} +//echo "
      wDef=$wDef"; +$realShow[0] = "1"; + +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo ""; +?> +"; +echo ""; +echo ""; +echo "$strConfiguration > $strNetwork > $DEFAULT_SYS > Calling prefix"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> +
        + + + + System:"; + echo ""; + echo ""; + if ( TRUE == session_is_registered("callingPrefixSetFlag") ) { + echo ""; + }else{ + echo ""; + } + + ?> + + + Command:"; + echo ""; + echo ""; + ?> + + + + +
      New: + +
      +

      + + + + + 0) + echo ""; + else + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + } +} +echo "
      No.Prefix +In-TON +Out-TON +T-D-C +T-I-C +T-I-D +Delete +
      $i{$prefixArr[$i][1]} {$inTonArr[$prefixArr[$i][2]][remark]} {$outTonArr[$prefixArr[$i][3]][remark]} {$prefixArr[$i][4]} {$prefixArr[$i][5]} {$prefixArr[$i][6]} 
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/msc/callingPrefixEdit.php b/wxc2_omc/configuration/msc/callingPrefixEdit.php new file mode 100755 index 0000000..be7d4c3 --- /dev/null +++ b/wxc2_omc/configuration/msc/callingPrefixEdit.php @@ -0,0 +1,310 @@ +subSysNo=$subSysNo"; +$portNo = $pNum%8; +if($DEBUG)echo "
      portNo=$portNo"; + +//Calling Number manipulation +$oidPas = "2.1.8"; +$pPas = explode(".",$oidPas); +$i = 0; +$wAnd = ''; +while(isset($pPas[$i])){ + $lNum = $i+1; + if($DEBUG) echo "
      pPas[$i]=$pPas[$i]"; + $wAnd = $wAnd." AND level_$lNum = $pPas[$i] "; + $i++; +} +if($DEBUG) echo "
      wAnd=$wAnd"; + +// + +$prefixFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); +$tonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Unknown', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') +); + +$trkDelCArr=array( + array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000') +); + +$trkInsCArr=array( + array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000') +); +// + +if($set || $add) +{ + $field_0 = omc_keep_length($prefixDigit,E,8,0); + if($DEBUG) echo "$field_0=$field_0
      "; + + $field_1 = DecHex($outTon).DecHex($inTon); + $field_1 = omc_keep_length($field_1,0,2); + if($DEBUG) echo "
      field_1=$field_1"; + + $field_2 = DecHex($insNum).DecHex($delNum); + $field_2 = omc_keep_length($field_2,0,2); + if($DEBUG) echo "
      field_2=$field_2"; + + $field_3 = omc_keep_length($insDigit,E,8,0); + if($DEBUG) echo "
      field_3=$field_3"; + + $initValue = $field_0.$field_1.$field_2.$field_3; + if($DEBUG) echo "
      initValue=$initValue"; + + $updateSql = " UPDATE $tb_2 + set initValue = '$initValue' + WHERE subSysNo = '99' AND instanceNo = '$tNum' $wAnd "; + if($DEBUG) echo "
      updateSql=$updateSql"; + $updateRes = @mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + echo ""; +} + +/************select value to see************/ +//Attributes of TG +$defaultValue[7] = "EEEEEEEE2200EEEEEEEE"; +$dispSql = " SELECT level_3,instanceNo,initValue,editValue,readValue + FROM $tb_2 + WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wAnd; +if($DEBUG) echo "
      dispSql=$dispSql"; +$dispRes = @mysqli_query($pubConn,$dispSql); +$dispRow = @mysqli_fetch_array($dispRes); +echo mysqli_error($pubConn); + +do{ + $level_3 = $dispRow[level_3]; + $instanceNo = $dispRow[instanceNo]; + $initValue = $dispRow[initValue]; + if($DEBUG) echo "
      initValue=$initValue"; + + if($initValue == $defaultValue[$level_3]){ + $andShow[$level_3][$instanceNo] = 0; + }else{ + $andShow[$level_3][$instanceNo] = 1; + } + if($DEBUG) echo "
      andShow[$level_3][$instanceNo]={$andShow[$level_3][$instanceNo]}"; + + $prefixDigit = substr($initValue,0,8); + $pDigit = explode("E",$prefixDigit); + $prefixDigit = $prefixArr[$instanceNo][0] = $pDigit[0]; + if($DEBUG) echo "
      prefixArr[$instanceNo][0]={$prefixArr[$instanceNo][0]}"; + + $inTon = substr($initValue,9,1); + $outTon = substr($initValue,8,1); + if($DEBUG) echo "
      inTon=$inTon, outTon=$outTon"; + + $delNum = substr($initValue,11,1); + $insNum = substr($initValue,10,1); + if($DEBUG) echo "
      delNum=$delNum, insNum=$insNum"; + + $insDigit = substr($initValue,12,8); + $pDigit = explode("E",$insDigit); + $insDigit = $insDigitArr[$instanceNo][0] = $pDigit[0]; + if($DEBUG) echo "
      insDigitArr[$instanceNo][0]={$insDigitArr[$instanceNo][0]}"; + +}while($dispRow = @mysqli_fetch_array($dispRes)); + + +echo "
      "; +echo ""; + +//if "ADD", oType == 1 +if($oType){ + $preFlagSql = " SELECT instanceNo,initValue,editValue,readValue + FROM $tb_2 + WHERE subSysNo = '99' $wAnd "." ORDER BY instanceNo "; + //if($DEBUG) + echo "
      preFlagSql=$preFlagSql,db=$db_1"; + $preFlagRes = @mysqli_query($pubConn,$preFlagSql); + $preFlagRow = @mysqli_fetch_array($preFlagRes); + echo mysqli_error($pubConn); + do + { + $instanceNo = $preFlagRow[instanceNo]; + $initValue = $preFlagRow[initValue]; + if($DEBUG)echo "
      initValue=$initValue"; + + $hex_6 = substr($initValue,12,2); + if($DEBUG)echo "
      hex_6=$hex_6"; + $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); + if($DEBUG)echo "
      bin_6=$bin_6"; + + $prefixFlag = $prefixFlagArr[$instanceNo][0] = BinDec(substr($bin_6,1,1)); + //echo "
      prefixFlag=$prefixFlag"; + }while($preFlagRow = @mysqli_fetch_array($preFlagRes)); + + + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + +}else{ + echo ""; + echo ""; + echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      Add Dailing prefix
      Prefix no."; + echo ""; + echo "
      Calling number manipulation #$tNum
      8-digit prefix for calling number
      TON for incoming call"; +echo ""; +echo "
      TON for outgoing call"; +echo ""; +echo "
      Out trunk deletion count"; +echo ""; +echo "
      Out trunk insertion count"; +echo ""; +echo "
      Inserted digits (0 - 99,999,999)
      "; + +echo "
      "; +if($oType){ + echo ""; +}else{ + echo ""; + echo ""; +} +echo ""; +echo ""; +echo ""; + +echo "
      "; +?> +Remarks:

      +byte4: type of number(TON) +bit0-3: TON for incoming call, specified by the originating node for the terminating node to route this call with proper dialed number manipulation.0=spare,1=MSISDN,2=unknown,3=NDD,4=IDD,other=spare,this setup is invalid for prefix 252 to 255 +bit4-7: TON for outgoing call, used to specify the type of an outgoing call for the terminating node to route this call with proper dialed number digit mannipulation.0=spare,1=MSISDN,2=unknown,3=NDD,4=IDD,other=spare + + \ No newline at end of file diff --git a/wxc2_omc/configuration/msc/cellConf.php b/wxc2_omc/configuration/msc/cellConf.php new file mode 100755 index 0000000..98a4c6a --- /dev/null +++ b/wxc2_omc/configuration/msc/cellConf.php @@ -0,0 +1,712 @@ + + +pTg[$i]=$pTg[$i]"; + $wTg = $wTg." AND level_$lNum = $pTg[$i] "; + $i++; +} + + +/************get default value**************/ +$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wTg; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; +//echo "
      defaultValue=$defaultValue"; + +$cellFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + + +$pageCellTypeArr=array( + array('num' => '0', 'remark' => '--'), + array('num' => '1', 'remark' => '--'), + array('num' => '2', 'remark' => '--'), + array('num' => '3', 'remark' => '--'), + array('num' => '4', 'remark' => '--'), + array('num' => '5', 'remark' => 'by LAC'), + array('num' => '6', 'remark' => 'in All Cell') +); + +//**************************************************************** +//函数 +// ChComm($sysId) +//函数说明:检查命令处理结果 +// +//变量说明: +// 无 +// +// +//返回值:$paramType +//$nSubSysParam = 0; +//$nGlobalSubSysParam = 1; +//$nGlobalSysParam = 2; +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function ChComm($sysId,$chkType=1) +{ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + $DEBUG = 0; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + if($DEBUG)echo "
      selComm=$selComm"; + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + do + { + $temCommState = $selRow[commState]; + if($selRow[remark]){ + $remark = $selRow[remark]; + //echo "
      remark=$remark"; + } + //echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc) + return($nWaitProc); + elseif($temCommState == $nInProc) + return($nInProc); + elseif($temCommState == $nOutProc) + $commState = $nOutProc; + else + $commState = 0; + }while($selRow = @mysqli_fetch_array($selRes)); + + return($commState); +} + + + +//**************************************************************** +//函数 +// 从Buffer_2拷贝到$buffer_1 +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$paramType +// +// +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1') +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg; + $DEBUG = 0; + $addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' "; + + //Location management + if($type){ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wTg.$addWer; + }else{ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wTg.$wDef.$addWer; + } + if($DEBUG) echo "
      uTgSql=$uTgSql "; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + + echo mysqli_error($pubConn); + + if($uTgRes) + return 1; + else + return 0; +} + +//**************************************************************** +//函数 +// get 或 set +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$commType +// +// +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function eSetGet($commType) { + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $maxNum,$remark,$nGetComm,$nSetComm; + $DEBUG = 0; + + if($commType == $nGetComm) + $showType = "Get "; + else + $showType = "Set "; + + //2.2.6 + $sysId = $sysTypeNo_1."_99"; + $objIdStr = "2.2.6.*"; + $cic = sysCommSend($sysId,$commType,$objIdStr); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Location management  "; + if($i > $maxNum){ + echo "
      Timeout"; + flush(); + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext2 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + + flush(); + break; + } + + sleep(1); + $i++; + } + return 1; +}//end of function + +if($saveSys) { + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //Get the value to "readValue" buffer. + eSetGet($nGetComm);//get value + /****************copy readValue to undoValue******************/ + $buffer_1 = "undoValue"; + $buffer_2 = "readValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //set editValue to system. + eSetGet($nSetComm); + $cellSetFlag = 1; + session_register("cellSetFlag"); + + //if get fail ( undoValue = NULL ) , unregister set flag. + $where = " level_1=2 AND level_2=2 AND level_3=8 "; + $selSql = "SELECT distinct undoValue FROM $tb_2 WHERE $where ORDER BY undoValue"; + if($DEBUG) echo "selSql(1)=$selSql,db=$db_1
      "; + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = mysqli_fetch_array($selRes); + if ('' == $selRow[0]) { + session_unregister("cellSetFlag"); + } + + sleep(1); + echo ""; +}//end of set sys +elseif($readSys) +{ + eSetGet($nGetComm);//get value + + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; +}//end of $readSys +elseif($saveDisk) +{ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $inCed=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      $inCed=$$inCed"; + + if($inCed) + echo "
      Save success."; + else + echo "
      Save Failure."; + + flush(); + sleep(1); + echo ""; +}//end of $saveDisk +elseif($readDisk) +{ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $loadType = 1; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef,$loadType); + if($DEBUG) echo "
      edCin=$edCin"; + + if($edCin) + echo "
      Read success."; + else + echo "
      Read failure."; + + flush(); + sleep(1); + echo ""; + +}//end of $readSys +elseif($undoSet){ + /****************copy readValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + if ( 1 == eSetGet($nSetComm) ) { + $buffer_1 = "initValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + } + session_unregister("cellSetFlag"); + + sleep(1); + echo ""; +} +//end undoSet +elseif($delete) +{ + $delSql = " UPDATE $tb_2 set initValue = '$defaultValue' WHERE subSysNo = '99' ".$wTg. " AND instanceNo = $delValue "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} +elseif($saveComm) +{ + session_unregister("cellSetFlag"); + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = 'B5' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +elseif($resetComm) +{ + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = '5A' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +if($readSys || $saveSys || $saveComm || $undoSet||$resetComm){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + +/**************select used E1 card*******************/ +$getSql = " SELECT sysNo,subSysNo,baseStat + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo_0' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; +//echo "
      getSql=$getSql"; +$getRes = @mysqli_query($pubConn,$getSql); +$getRow = @mysqli_fetch_array($getRes); +echo mysqli_error($pubConn); +do +{ + $sysNo = $getRow[sysNo]; + $subSysNo = $getRow[subSysNo]; + $cardArr[$sysNo][subSysNo] = $getRow[baseStat]; + +}while($getRow = @mysqli_fetch_array($getRes)); + + + + +/************select value to see************/ +//Location management +$tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wTg." ORDER BY instanceNo "; +if($DEBUG) echo "
      tgSql=$tgSql
      db=$db_1"; +$tgRes = @mysqli_query($pubConn,$tgSql); +$tgRow = @mysqli_fetch_array($tgRes); +echo mysqli_error($pubConn); +$wDef = " AND ("; +do +{ + $instanceNo = $tgRow[instanceNo]; + $initValue = $tgRow[initValue]; + + if($initValue == $defaultValue){ + $tgShow[$instanceNo] = 0; + }else{ + $tgShow[$instanceNo] = 1; + + $wDef = $wDef." instanceNo = $instanceNo OR "; + } + + //echo "
      tgShow[$instanceNo]=$tgShow[$instanceNo]"; + + $hex_0 = substr($initValue,0,2); + if($DEBUG)echo "
      hex_0=$hex_0"; + $bin_0 = omc_keep_length(DecBin(HexDec($hex_0)),0,8); + if($DEBUG)echo "
      bin_0=$bin_0"; + + $cellFlag = $cellArr[$instanceNo][0] = substr($bin_0,7,1); + if($DEBUG)echo "
      cellFlag=$cellFlag"; + + $tgNum = $cellArr[$instanceNo][1] = HexDec(substr($initValue,2,2)); + if($DEBUG)echo "
      tgNum=$tgNum"; + + $hLac = substr($initValue,4,2); + $lLac = substr($initValue,6,2); + $lacNum = $hLac.$lLac; + $lacNum = $cellArr[$instanceNo][2] = HexDec($lacNum); + if($DEBUG)echo "
      lacNum=$lacNum"; + + $cellType = substr($initValue,8,2); + $cellType = $cellArr[$instanceNo][3] = HexDec($cellType); + if($DEBUG)echo "
      cellType=$cellType"; +}while($tgRow = @mysqli_fetch_array($tgRes)); + +$wDef = substr($wDef,0,-3); +$wDef = $wDef.")"; +if(strlen($wDef) < 10){ + $wDef = 'AND instanceNo < 0'; +} +if($DEBUG)echo "
      wDef=$wDef"; +$tgShow[0] = "1"; +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo "

      "; +echo ""; +?> +"; +echo ""; +echo ""; +echo "$strConfiguration > $strNetwork > $DEFAULT_SYS > LAC"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> +
        + + + + System:"; + echo ""; + echo ""; + if ( TRUE == session_is_registered("cellSetFlag") ) { + echo ""; + }else{ + echo ""; + } + ?> + + + Command:"; + echo ""; + echo ""; + ?> + + + + +
      New: + +
      +

      + + + + + + + + + + 0) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + } +} +echo "
      No.EnableTrunk groupLACPage Cell ID TypeDelete
      $i{$cellFlagArr[$cellArr[$i][0]][remark]} {$cellArr[$i][1]} {$cellArr[$i][2]} {$pageCellTypeArr[$cellArr[$i][3]][remark]} 
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/msc/cellEdit.php b/wxc2_omc/configuration/msc/cellEdit.php new file mode 100755 index 0000000..88da4b3 --- /dev/null +++ b/wxc2_omc/configuration/msc/cellEdit.php @@ -0,0 +1,305 @@ + + +subSysNo=$subSysNo"; +$portNo = $pNum%8; +if($DEBUG)echo "
      portNo=$portNo"; + +$tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'subscriber', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') +); +$netTypeArr=array( + array('num' => '0', 'remark' => 'International', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'International spare', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'National ', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'National spare', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') +); +$cirTypeArr=array( + array('num' => '0', 'remark' => 'clockwise', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'anti-clockwise', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'odd', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'even', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') +); + + +$pageCellTypeArr=array( + array('num' => '0', 'remark' => '--'), + array('num' => '1', 'remark' => '--'), + array('num' => '2', 'remark' => '--'), + array('num' => '3', 'remark' => '--'), + array('num' => '4', 'remark' => '--'), + array('num' => '5', 'remark' => 'by LAC'), + array('num' => '6', 'remark' => 'in All Cell') +); + +//Attributes of TG +$oidTg = "2.2.6"; +$pTg = explode(".",$oidTg); +$i = 0; +$wTg = ''; +while(isset($pTg[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pTg[$i]=$pTg[$i]"; + $wTg = $wTg." AND level_$lNum = $pTg[$i] "; + $i++; +} + +/************get default value**************/ +$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wTg; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; +//echo "
      defaultValue=$defaultValue"; + +if($set || $add) +{ + $field_0 = omc_keep_length(DecHex(BinDec($cellFlag)),0,2); + if($DEBUG)echo "
      field_0=$field_0"; + + $field_1 = omc_keep_length(DecHex($tgNum),0,2); + if($DEBUG)echo "
      field_1=$field_1"; + + if($add){ + $cellFlag = 1; + } + + $field_2 = omc_keep_length(DecHex($lacNum),0,4); + if($DEBUG)echo "
      field_2=$field_2"; + + $field_3 = omc_keep_length(DecHex($cellType),0,2); + if($DEBUG)echo "
      field_3=$field_3"; + + $initValue = $field_0.$field_1.$field_2.$field_3; + $initValue = strtoupper($initValue); + if($DEBUG)echo "
      initValue=$initValue"; + + $uTgSql = " UPDATE $tb_2 set initValue = '$initValue' WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wTg; + if($DEBUG)echo "
      uTgSql=$uTgSql"; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + echo mysqli_error($pubConn); + + echo ""; +} + +/************select value to see************/ +//Attributes of TG +$tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wTg." ORDER BY instanceNo "; +if($DEBUG) echo "
      tgSql=$tgSql"; +$tgRes = @mysqli_query($pubConn,$tgSql); +$tgRow = @mysqli_fetch_array($tgRes); +echo mysqli_error($pubConn); +$wDef = " AND ("; +do +{ + $instanceNo = $tgRow[instanceNo]; + $initValue = $tgRow[initValue]; + if($DEBUG) echo "
      initValue=$initValue"; + + if($initValue == $defaultValue){ + $tgShow[$instanceNo] = 0; + }else{ + $tgShow[$instanceNo] = 1; + + $wDef = $wDef." instanceNo = $instanceNo OR "; + } + + //echo "
      tgShow[$instanceNo]=$tgShow[$instanceNo]"; + + $hex_0 = substr($initValue,0,2); + if($DEBUG)echo "
      hex_0=$hex_0"; + $bin_0 = omc_keep_length(DecBin(HexDec($hex_0)),0,8); + if($DEBUG)echo "
      bin_0=$bin_0"; + + $cellFlag = $cellArr[$instanceNo][0] = substr($bin_0,7,1); + if($DEBUG)echo "
      cellFlag=$cellFlag"; + + + $tgNum = $cellArr[$instanceNo][1] = HexDec(substr($initValue,2,2)); + if($DEBUG)echo "
      tgNum=$tgNum"; + + $hLac = substr($initValue,4,2); + $lLac = substr($initValue,6,2); + $lacNum = $hLac.$lLac; + $lacNum = $cellArr[$instanceNo][2] = HexDec($lacNum); + if($DEBUG)echo "
      lacNum=$lacNum"; + + $cellType = substr($initValue,8,2); + $cellType = $cellArr[$instanceNo][3] = HexDec($cellType); + if($DEBUG)echo "
      cellType=$cellType"; +}while($tgRow = @mysqli_fetch_array($tgRes)); + + + +echo "
      "; +echo ""; + +if($oType){ + $tgFlagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wTg." ORDER BY instanceNo "; + if($DEBUG)echo "
      tgFlagSql=$tgFlagSql"; + $tgFlagRes = @mysqli_query($pubConn,$tgFlagSql); + $tgFlagRow = @mysqli_fetch_array($tgFlagRes); + echo mysqli_error($pubConn); + do + { + $instanceNo = $tgFlagRow[instanceNo]; + $initValue = $tgFlagRow[initValue]; + if($DEBUG)echo "
      initValue=$initValue"; + + //echo "
      $initValue == $defaultValue"; + if($initValue == $defaultValue){ + $tgShow[$instanceNo] = 0; + }else{ + $tgShow[$instanceNo] = 1; + $wDef = $wDef." instanceNo = $instanceNo OR "; + } + + if($DEBUG)echo "
      tgShow[$instanceNo]=$tgShow[$instanceNo]"; + $hex_7 = substr($initValue,14,2); + if($DEBUG)echo "
      hex_7=$hex_7"; + $bin_7 = omc_keep_length(DecBin(HexDec($hex_7)),0,8); + if($DEBUG)echo "
      bin_7=$bin_7"; + + $cellFlag = $cellArr[$instanceNo][0] = substr($bin_7,7,1); + if($DEBUG)echo "
      cellFlag=$cellFlag"; + }while($tgFlagRow = @mysqli_fetch_array($tgFlagRes)); + + + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + +}else{ + echo ""; + echo ""; + echo ""; +} +echo ""; +echo ""; +if($cellFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      Add trunk group
      Cell"; + echo ""; + echo "
      Location $tNum
      EnableYes"; + echo "No Yes"; + echo "No 
      Trunk group
      LAC
      Page Cell ID Type"; +echo ""; +echo "
      "; +//echo "
      Remark:"; +echo "
      "; +if($oType){ + echo ""; + echo "  "; +}else{ + echo ""; + echo "  "; + echo ""; +} +echo ""; +echo ""; +echo ""; + +echo "
      "; +?> +Remarks:

      +Manage the MS location by correlating TG, LAC and cell ID. Totally 256 locations + + + + \ No newline at end of file diff --git a/wxc2_omc/configuration/msc/e1Conf.php b/wxc2_omc/configuration/msc/e1Conf.php new file mode 100755 index 0000000..b772a29 --- /dev/null +++ b/wxc2_omc/configuration/msc/e1Conf.php @@ -0,0 +1,1170 @@ + + +pE1[$i]=$pE1[$i]"; + $wFlag = $wFlag." AND level_$lNum = $pE1[$i] "; + $i++; +} + + +//2.6 CRC4 flag +$oidCrc = "2.6"; +$pE1 = explode(".",$oidCrc); +$i = 0; +$wCrc = ''; +while(isset($pE1[$i])) { + $lNum = $i+1; + if($DEBUG)echo "
      pE1[$i]=$pE1[$i]"; + $wCrc = $wCrc." AND level_$lNum = $pE1[$i] "; + $i++; +} + +//2.2 E1 MTP2 alarm flag +$oidDlink = "2.2"; +$pE1 = explode(".",$oidDlink); +$i = 0; +$wDlink = ''; +while(isset($pE1[$i])) +{ + $lNum = $i+1; + if($DEBUG)echo "
      pE1[$i]=$pE1[$i]"; + $wDlink = $wDlink." AND level_$lNum = $pE1[$i] "; + $i++; +} + +//2.4.1 2.4.2 2.4.3 MSC +$uwMsc = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND (level_3 = '1' OR level_3 = '2' OR level_3 = '3') "; + + +$wMsc = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND (level_3 = '1' OR level_3 = '2' OR level_3 = '3') ORDER BY level_3 "; + +$wMsc_1 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '1' AND instanceNo = '$pNum' "; + +$wMsc_2 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '2' AND instanceNo = '$pNum' "; + +$wMsc_3 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '3' AND instanceNo = '$pNum' "; + +$eFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'T', 'color' => '#0000FF') + +); + +$eCrcArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') +); + +$eDlinkArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$mPtArr=array( + array('num' => '0', 'remark' => 'TUP', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'ISUP', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'AIF', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'ISDN NT', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'ISDN LT', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'CIC CNF', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'CIC INT', 'color' => '#0000FF') +); +//**************************************************************** +//函数 +// ChComm($sysId) +//函数说明:检查命令处理结果 +// +//变量说明: +// 无 +// +// +//返回值:$paramType +//$nSubSysParam = 0; +//$nGlobalSubSysParam = 1; +//$nGlobalSysParam = 2; +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function ChComm($sysId,$chkType=1) +{ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + $DEBUG = 0; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + if($DEBUG)echo "
      selComm=$selComm"; + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + $outProcCount=0; + do + { + $temCommState = $selRow[commState]; + if(isset($selRow[remark])){ + $remark = $selRow[remark]; + if($DEBUG)echo "
      remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} + +//**************************************************************** +//函数 +// 从Buffer_2拷贝到$buffer_1 +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$paramType +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +//parameter(dst,src,*,*) +function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1') +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wFlag,$wCrc,$wDlink,$uwMsc; + $DEBUG = 0; + $addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' "; + + //E1 flag + for($i=0;$i<2;$i++) + { + $temTb = ${tb_.$i}; + $uFlagSql = " UPDATE $temTb set $buffer_1=$buffer_2 WHERE subSysNo >= 0 ".$wFlag.$addWer; + if($DEBUG) echo "
      uFlagSql=$uFlagSql"; + $uFlagRes = @mysqli_query($pubConn,$uFlagSql); + if(!$uFlagRes) + $noSuccess=1; + } + + + //2.6 CRC4 flag + for($i=0;$i<2;$i++) + { + $temTb = ${tb_.$i}; + $uCrcSql = " UPDATE $temTb set $buffer_1=$buffer_2 WHERE subSysNo >= 0 ".$wCrc.$addWer; + if($DEBUG)echo "
      uCrcSql=$uCrcSql"; + $uCrcRes = @mysqli_query($pubConn,$uCrcSql); + echo mysqli_error($pubConn); + if(!$uFlagRes) + $noSuccess=1; + } + + //2.2 E1 MTP2 alarm flag + for($i=0;$i<2;$i++) + { + $temTb = ${tb_.$i}; + $uDlinkSql = " UPDATE $temTb set $buffer_1=$buffer_2 WHERE subSysNo >= 0 ".$wDlink.$addWer; + if($DEBUG)echo "
      uDlinkSql=$uDlinkSql"; + $uDlinkRes = @mysqli_query($pubConn,$uDlinkSql); + echo mysqli_error($pubConn); + if(!$uFlagRes) + $noSuccess=1; + } + + + //2.4.1 2.4.2 2.4.3 MSC + $uMscSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 ".$uwMsc.$addWer; + if($DEBUG) echo "
      uMscSql=$uMscSql "; + $uMscRes = @mysqli_query($pubConn,$uMscSql); + $uMscRow = @mysqli_fetch_array($uMscRes); + echo mysqli_error($pubConn); + if(!$uFlagRes) + $noSuccess=1; + + if($noSuccess) + return 0; + else + return 1; +} + +//**************************************************************** +//函数 +// get 或 set +//函数说明: +// +//变量说明: +// 无 +// +//返回值:$commType +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function eSetGet($commType) { + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wFlag,$wCrc,$wDlink,$uwMsc,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $maxNum,$remark,$nGetComm,$nSetComm; + $DEBUG = 0; + + $sysInfoTable = 'OMC_PUB.sysInfo'; + /**************check single plane or dual plane*******************/ + $tmpSql = " SELECT sysNo,subSysNo,updateTime + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo_0' AND updateTime > '0' + ORDER BY sysNo,subSysNo + "; + //echo "
      tmpSql=$tmpSql"; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + echo mysqli_error($pubConn); + do + { + $tmpSysNo = $tmpRow[sysNo]; + $tmpSubSysNo = $tmpRow[subSysNo]; + $tmpIsUpdate[$tmpSysNo][$tmpSubSysNo] = $tmpRow[updateTime] > 0 ? 1:0; + }while($tmpRow = @mysqli_fetch_array($tmpRes)); + + $tmpIsUpdate[0][0]="1"; + + + if($commType == $nGetComm) + $showType = "Get "; + else + $showType = "Set "; + //E1 flag + for($j=0;$j<2;$j++) { + if($sTimeOut) + break; + + for($k=0;$k<16;$k++){ + if($tmpIsUpdate[$j][$k]) + break; + } + + if($k==16) + continue; + + $sysId = "111_".$j."_99"; + //echo "
      sysId=$sysId"; + //$commType = $nSetComm; + $objIdStr = "2.1.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      $showType E1 Flag(plane$j)"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = "111_$j"; + $chRes=ChComm($sysId); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + } + + //2.4.3 CIC of E1 + if($pNext1) + { + $sysId = $sysTypeNo_1."_99"; + //$commType = $nSetComm; + $objIdStr = "2.4.3.*"; + $cic = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      cic=$cic"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType E1 CIC"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext2 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + }//end of $pNext1 + + + //2.4.2 Assign TG to E1 + if($pNext2) + { + $sysId = $sysTypeNo_1."_99"; + //$commType = $nSetComm; + $objIdStr = "2.4.2.*"; + $tg = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      tg=$tg"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType TG"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext3 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + } + + + //2.4.1 E1 interface + if($pNext3) + { + $sysId = $sysTypeNo_1."_99"; + //$commType = $nSetComm; + $objIdStr = "2.4.1.*"; + $port = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      port=$port"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType E1 interface"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext4 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + } + + //2.6 CRC4 flag + if($pNext4) + { + + for($j=0;$j<2;$j++) + { + if($sTimeOut) + break; + + for($k=0;$k<16;$k++){ + if($tmpIsUpdate[$j][$k]) + break; + } + + if($k==16) + continue; + + $sysId = "111_".$j."_99"; + //$commType = $nSetComm; + $objIdStr = "2.6.*"; + $crc4 = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      crc4=$crc4"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType E1 crc4(plane$j)"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = "111_$j"; + $chRes=ChComm($sysId); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext5 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + } + + } + + + //2.2 E1 MTP2 alarm flag + if($pNext5) + { + for($j=0;$j<2;$j++) + { + + if($sTimeOut) + break; + + //check single plane or dual plane + for($k=0;$k<16;$k++){ + if($tmpIsUpdate[$j][$k]) + break; + } + + if($k==16) + continue; + + + $sysId = "111_".$j."_99"; + //$commType = $nSetComm; + $objIdStr = "2.2.*"; + $dlink = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      dlink=$dlink"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i==0) + echo "
      $showType E1 dlink(plane$j)"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = "111_$j"; + $chRes=ChComm($sysId); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext5 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + } + } + + return 1; +}//end of function + +if($saveSys){ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //Get the value to "readValue" buffer. + eSetGet($nGetComm);//get value + /****************copy readValue to undoValue******************/ + $buffer_1 = "undoValue"; + $buffer_2 = "readValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //set editValue to system. + eSetGet($nSetComm); + $e1SetFlag = 1; + session_register("e1SetFlag"); + + //if get fail ( undoValue = NULL ) , unregister set flag. + //8ke1 plat 0 + $where_0 = " level_1=2 AND (level_2=1 OR level_2=2 OR level_2=6) "; + $selSql_0 = "SELECT distinct undoValue FROM $tb_0 WHERE $where_0 ORDER BY undoValue"; + if($DEBUG) echo "selSql_0=$selSql_0,db=$db_0
      "; + $selRes_0 = @mysqli_query($pubConn,$selSql_0); + $selRow_0 = mysqli_fetch_array($selRes_0); + //8ke1 plat 1 + $where_1 = " level_1=2 AND (level_2=1 OR level_2=2 OR level_2=6) "; + $selSql_1 = "SELECT distinct undoValue FROM $tb_1 WHERE $where_1 ORDER BY undoValue"; + if($DEBUG) echo "selSql_1=$selSql_1,db=$db_0
      "; + $selRes_1 = @mysqli_query($pubConn,$selSql_1); + $selRow_1 = mysqli_fetch_array($selRes_1); + //msc + $where_2 = " level_1=2 AND level_2=4 AND (level_3=1 OR level_3=2 OR level_3=3) "; + $selSql_2 = "SELECT distinct undoValue FROM $tb_2 WHERE $where_2 ORDER BY undoValue"; + if($DEBUG) echo "selSql_2=$selSql_2,db=$db_1
      "; + $selRes_2 = @mysqli_query($pubConn,$selSql_2); + $selRow_2 = mysqli_fetch_array($selRes_2); + + if ( ('' == $selRow_0[0]) | ('' == $selRow_1[0]) | ('' == $selRow_2[0])) { + session_unregister("e1SetFlag"); + } + + sleep(1); + echo ""; +}//end of set sys +elseif($readSys) { + eSetGet($nGetComm);//get value + + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; +}//end of $readSys +elseif($undoSet){ + /****************copy readValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + if ( 1 == eSetGet($nSetComm) ) { + $buffer_1 = "initValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + } + session_unregister("e1SetFlag"); + + sleep(1); + echo ""; +} +elseif($saveDisk){ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $inCed=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      $inCed=$$inCed"; + + if($inCed) + echo "
      Save success."; + else + echo "
      Save Failure."; + + flush(); + sleep(1); + echo ""; +}//end of $saveDisk +elseif($readDisk){ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + if($edCin) + echo "
      Read success."; + else + echo "
      Read failure."; + + flush(); + sleep(1); + echo ""; + +}//end of $comSys +elseif($comDisk){ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; +}//end of $comDisk +elseif($comSys){ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $reCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      reCin=$reCin"; +} +elseif($saveComm){ + session_unregister("e1SetFlag"); + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = 'B5' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + //echo "sysId=$sysId"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +elseif($resetComm) +{ + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = '5A' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +if($readSys || $saveSys || $saveComm || $undoSet||$resetComm){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + +/**************select used E1 card*******************/ +$getSql = " SELECT sysNo,subSysNo,baseStat,updateTime + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo_0' AND updateTime > '0' + ORDER BY sysNo,subSysNo + "; +//echo "
      getSql=$getSql"; +$getRes = @mysqli_query($pubConn,$getSql); +$getRow = @mysqli_fetch_array($getRes); +echo mysqli_error($pubConn); +do +{ + $sysNo = $getRow[sysNo]; + $subSysNo = $getRow[subSysNo]; + $isUpdate[$sysNo][$subSysNo] = $getRow[updateTime] > 0 ? 1:0; +}while($getRow = @mysqli_fetch_array($getRes)); + +$isUpdate[0][0]="1"; + +/************select value to see************/ +//E1 flag +for($i=0;$i<2;$i++) +{ + $temTb = ${tb_.$i}; + $flagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE subSysNo >= 0 ".$wFlag." ORDER BY instanceNo "; + if($DEBUG) echo "
      flagSql=$flagSql"; + $flagRes = @mysqli_query($pubConn,$flagSql); + $flagRow = @mysqli_fetch_array($flagRes); + echo mysqli_error($pubConn); + do + { + $instanceNo = $flagRow[instanceNo]; + $initValue = HexDec($flagRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG) echo "
      initValue=$initValue"; + for($j=0;$j<8;$j++) + { + $fNum = $instanceNo*8+7-$j; + $flagArr[$i][$fNum] = substr($initValue,$j,1); + if($DEBUG) echo "
      flagArr[$i][$fNum]={$flagArr[$i][$fNum]}"; + } + }while($flagRow = @mysqli_fetch_array($flagRes)); +} + +//2.6 CRC4 flag +for($i=0;$i<2;$i++) +{ + $temTb = ${tb_.$i}; + $crcSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE subSysNo >= 0 ".$wCrc." ORDER BY instanceNo "; + if($DEBUG)echo "
      crcSql=$crcSql"; + $crcRes = @mysqli_query($pubConn,$crcSql); + $crcRow = @mysqli_fetch_array($crcRes); + if($DEBUG)echo mysqli_error($pubConn); + do + { + $instanceNo = $crcRow[instanceNo]; + $initValue = HexDec($crcRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG)echo "
      initValue=$initValue"; + for($j=0;$j<8;$j++) + { + $fNum = $instanceNo*8+7-$j; + $crcArr[$i][$fNum] = substr($initValue,$j,1); + if($DEBUG)echo "
      crcArr[$i][$fNum]={$crcArr[$i][$fNum]}"; + } + }while($crcRow = @mysqli_fetch_array($crcRes)); +} + +//2.2 E1 MTP2 alarm flag +for($i=0;$i<2;$i++) +{ + $temTb = ${tb_.$i}; + $dlinkSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE subSysNo >= 0 ".$wDlink." ORDER BY instanceNo "; + if($DEBUG)echo "
      dlinkSql=$dlinkSql"; + $dlinkRes = @mysqli_query($pubConn,$dlinkSql); + $dlinkRow = @mysqli_fetch_array($dlinkRes); + echo mysqli_error($pubConn); + do{ + $instanceNo = $dlinkRow[instanceNo]; + $initValue = HexDec($dlinkRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG)echo "
      initValue=$initValue"; + for($j=0;$j<8;$j++) + { + $fNum = $instanceNo*8+7-$j; + $dlinkArr[$i][$fNum] = substr($initValue,$j,1); + if($DEBUG)echo "
      dlinkArr[$i][$fNum]={$dlinkArr[$i][$fNum]}"; + } + }while($dlinkRow = @mysqli_fetch_array($dlinkRes)); +} + + +//2.4.1 2.4.2 2.4.3 MSC +$mscSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 ".$wMsc; +if($DEBUG) echo "
      mscSql=$mscSql"; +$mscRes = @mysqli_query($pubConn,$mscSql); +$mscRow = @mysqli_fetch_array($mscRes); +echo mysqli_error($pubConn); + +do { + $level_3 = $mscRow[level_3]; + $instanceNo = $mscRow[instanceNo]; + $initValue = HexDec($mscRow[initValue]); + $mscArr[$level_3][$instanceNo] = $initValue; + if($DEBUG) echo "
      mscArr[$level_3][$instanceNo]={$mscArr[$level_3][$instanceNo]}"; +}while($mscRow = @mysqli_fetch_array($mscRes)); + + +if($comSys || $comDisk) { + for($i=0;$i<128;$i++) { + if($flagArr[0][$i] != $flagArr[1][$i]) + $flagCol[$i]="#FF0000"; + + if($mscArr[3][$i] != $mscArr[3][$i+128]) + $mscCol[3][$i]="#FF0000"; + + if($mscArr[2][$i] != $mscArr[2][$i+128]) + $mscCol[2][$i]="#FF0000"; + + if($mscArr[1][$i] != $mscArr[1][$i+128]) + $mscCol[1][$i]="#FF0000"; + + if($crcArr[0][$i] != $crcArr[1][$i]) + $crcCol[$i]="#FF0000"; + + if($dlinkArr[0][$i] != $dlinkArr[1][$i]) + $dlinkCol[$i]="#FF0000"; + } +}//end of $comDisk +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo "

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > $strNetwork > $DEFAULT_SYS > E1"; +echo ""; +showHelp($helpId); +echo "
      "; +?> +
        + + + + + + + + + + +
      System: + "; + echo ""; + if ( TRUE == session_is_registered("e1SetFlag") ) { + echo ""; + }else{ + echo ""; + } + ?> + Command: + "; + echo ""; + ?> + +

      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + 0) + echo ""; + else + echo ""; + + echo ""; + echo ""; + echo ""; + if($flagArr[0][$i]){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo ""; + if($flagArr[1][$i]){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //echo ""; + echo ""; +} +echo "
       MSC-0MSC-1
      SlotPortFlagCICTGProtocolCRC4AlarmPortFlagCICTGProtocolCRC4Alarm
      $sNum$pNum{$eFlagArr[$flagArr[0][$i]][remark]}{$mscArr[3][$i]}{$mscArr[2][$i]}{$mPtArr[$mscArr[1][$i]][remark]} {$eCrcArr[$crcArr[0][$i]][remark]}{$eDlinkArr[$dlinkArr[0][$i]][remark]}----------$pNum{$eFlagArr[$flagArr[1][$i]][remark]}{$mscArr[3][$i+128]}{$mscArr[2][$i+128]}{$mPtArr[$mscArr[1][$i+128]][remark]} {$eCrcArr[$crcArr[1][$i]][remark]}{$eDlinkArr[$dlinkArr[1][$i]][remark]}----------
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/msc/e1Edit.php b/wxc2_omc/configuration/msc/e1Edit.php new file mode 100755 index 0000000..82e8a74 --- /dev/null +++ b/wxc2_omc/configuration/msc/e1Edit.php @@ -0,0 +1,425 @@ + + +pNum=$pNum"; +$temTb = ${tb_.$sNum}; +$instanceNo = floor($pNum/8); +$mNum = $sNum*128+$pNum; +if($DEBUG)echo "
      mNum=$mNum"; +if($DEBUG)echo "
      instanceNo=$instanceNo"; +$portNo = $pNum%8; +if($DEBUG)echo "
      portNo=$portNo"; + +$eFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$eCrcArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') +); + +$eLinkArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$mPtArr=array( + array('num' => '0', 'remark' => 'TUP', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'ISUP', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'AIF', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'ISDN NT', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'ISDN LT', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'CI CNF', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'CI loopback', 'color' => '#0000FF') +); + +//E1 flag +$oidFlag = "2.1"; +$pE1 = explode(".",$oidFlag); +$i = 0; +$wFlag = ''; +while(isset($pE1[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pE1[$i]=$pE1[$i]"; + $wFlag = $wFlag." AND level_$lNum = $pE1[$i] "; + $i++; +} + + +//2.6 CRC4 flag +$oidCrc = "2.6"; +$pE1 = explode(".",$oidCrc); +$i = 0; +$wCrc = ''; +while(isset($pE1[$i])) +{ + $lNum = $i+1; + if($DEBUG)echo "
      pE1[$i]=$pE1[$i]"; + $wCrc = $wCrc." AND level_$lNum = $pE1[$i] "; + $i++; +} + +//2.2 E1 MTP2 alarm flag +$oidDlink = "2.2"; +$pE1 = explode(".",$oidDlink); +$i = 0; +$wDlink = ''; +while(isset($pE1[$i])) +{ + $lNum = $i+1; + if($DEBUG)echo "
      pE1[$i]=$pE1[$i]"; + $wDlink = $wDlink." AND level_$lNum = $pE1[$i] "; + $i++; +} + +//2.4.1 2.4.2 2.4.3 MSC + +$wMsc = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND (level_3 = '1' OR level_3 = '2' OR level_3 = '3') AND instanceNo = '$mNum' ORDER BY level_3 "; + +$wMsc_1 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '1' AND instanceNo = '$mNum' "; + +$wMsc_2 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '2' AND instanceNo = '$mNum' "; + +$wMsc_3 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '3' AND instanceNo = '$mNum' "; + +if($set) +{ + //E1 flag + $flagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE instanceNo = '$instanceNo' ".$wFlag; + if($DEBUG)echo "
      flagSql=$flagSql"; + $flagRes = @mysqli_query($pubConn,$flagSql); + $flagRow = @mysqli_fetch_array($flagRes); + $initValue = HexDec($flagRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG) echo "
      initValue=$initValue"; + for($i=0;$i<8;$i++) + { + $flagArr[7-$i] = substr($initValue,$i,1); + if($DEBUG)echo "
      flagArr[7-$i]={$flagArr[7-$i]}"; + + } + + if($DEBUG)echo "
      flag=$flag"; + $flagArr[$portNo]=$flag; + $initValue = ''; + for($i=7;$i>-1;$i--) + { + $initValue = $initValue.$flagArr[$i]; + if($DEBUG)echo "
      initValue=$initValue"; + } + + $initValue = BinDec($initValue); + $initValue = strtoupper(omc_keep_length(DecHex($initValue),0,2)); + $uFlagSql = " UPDATE $temTb set initValue = '$initValue' WHERE instanceNo = '$instanceNo' ".$wFlag; + if($DEBUG)echo "
      uFlagSql=$uFlagSql"; + $uFlagRes = @mysqli_query($pubConn,$uFlagSql); + + + //CRC4 flag + $crcSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE instanceNo = '$instanceNo' ".$wCrc; + if($DEBUG)echo "
      crcSql=$crcSql"; + $crcRes = @mysqli_query($pubConn,$crcSql); + $crcRow = @mysqli_fetch_array($crcRes); + $initValue = HexDec($crcRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG) echo "
      initValue=$initValue"; + for($i=0;$i<8;$i++) + { + $crcArr[7-$i] = substr($initValue,$i,1); + if($DEBUG)echo "
      crcArr[7-$i]={$crcArr[7-$i]}"; + + } + + if($DEBUG)echo "
      crc=$crc"; + $crcArr[$portNo]=$crc; + $initValue = ''; + for($i=7;$i>-1;$i--) + { + $initValue = $initValue.$crcArr[$i]; + if($DEBUG)echo "
      initValue=$initValue"; + } + + $initValue = BinDec($initValue); + $initValue = strtoupper(omc_keep_length(DecHex($initValue),0,2)); + $uCrcSql = " UPDATE $temTb set initValue = '$initValue' WHERE instanceNo = '$instanceNo' ".$wCrc; + if($DEBUG)echo "
      uCrcSql=$uCrcSql"; + $uCrcRes = @mysqli_query($pubConn,$uCrcSql); + + + //2.2 E1 MTP2 alarm flag + $dlinkSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE instanceNo = '$instanceNo' ".$wDlink; + if($DEBUG)echo "
      dlinkSql=$dlinkSql"; + $dlinkRes = @mysqli_query($pubConn,$dlinkSql); + $dlinkRow = @mysqli_fetch_array($dlinkRes); + $initValue = HexDec($dlinkRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG) echo "
      initValue=$initValue"; + for($i=0;$i<8;$i++) + { + $dlinkArr[7-$i] = substr($initValue,$i,1); + if($DEBUG)echo "
      dlinkArr[7-$i]={$dlinkArr[7-$i]}"; + + } + + + $dlinkArr[$portNo]=$dlink; + $initValue = ''; + for($i=7;$i>-1;$i--) + { + $initValue = $initValue.$dlinkArr[$i]; + if($DEBUG)echo "
      initValue=$initValue"; + } + + $initValue = BinDec($initValue); + $initValue = strtoupper(omc_keep_length(DecHex($initValue),0,2)); + $uDlinkSql = " UPDATE $temTb set initValue = '$initValue' WHERE instanceNo = '$instanceNo' ".$wDlink; + if($DEBUG)echo "
      uDlinkSql=$uDlinkSql"; + $uDlinkRes = @mysqli_query($pubConn,$uDlinkSql); + + //PT + $pt = omc_keep_length(DecHex($pt),0,2); + if($DEBUG)echo "
      pt=$pt"; + $uPtSql = " UPDATE $tb_2 set initValue = '$pt' ".$wMsc_1; + if($DEBUG)echo "
      uPtSql=$uPtSql"; + $uPtRes = @mysqli_query($pubConn,$uPtSql); + + $tg = omc_keep_length(DecHex($tg),0,2); + if($DEBUG)echo "
      tg=$tg"; + //TG + $uTgSql = " UPDATE $tb_2 set initValue = '$tg' ".$wMsc_2; + if($DEBUG)echo "
      uTgSql=$uTgSql"; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + + $cic = omc_keep_length(DecHex($cic),0,2); + if($DEBUG)echo "
      cic=$cic"; + //CIC + $uCicSql = " UPDATE $tb_2 set initValue = '$cic' ".$wMsc_3; + if($DEBUG)echo "
      uCicSql=$uCicSql"; + $uCicRes = @mysqli_query($pubConn,$uCicSql); + + echo ""; +} + +//E1 flag +$flagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE instanceNo = '$instanceNo' ".$wFlag; +if($DEBUG)echo "
      flagSql=$flagSql"; +$flagRes = @mysqli_query($pubConn,$flagSql); +$flagRow = @mysqli_fetch_array($flagRes); +$initValue = HexDec($flagRow[initValue]); +$initValue = DecBin($initValue); +$initValue = omc_keep_length($initValue,0,8); +if($DEBUG) echo "
      initValue=$initValue"; +for($i=0;$i<8;$i++) +{ + $flagArr[7-$i] = substr($initValue,$i,1); + if(7-$i == $portNo){ + $flag = $flagArr[7-$i]; + if($DEBUG)echo "
      flag=$flag"; + } + if($DEBUG)echo "
      flagArr[7-$i]={$flagArr[7-$i]}"; + +} + + +//2.6 CRC4 flag +$crcSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE instanceNo = '$instanceNo' ".$wCrc." ORDER BY instanceNo "; +if($DEBUG)echo "
      crcSql=$crcSql"; +$crcRes = @mysqli_query($pubConn,$crcSql); +$crcRow = @mysqli_fetch_array($crcRes); +$initValue = HexDec($crcRow[initValue]); +$initValue = DecBin($initValue); +$initValue = omc_keep_length($initValue,0,8); +if($DEBUG) echo "
      initValue=$initValue"; +for($i=0;$i<8;$i++) +{ + $crcArr[7-$i] = substr($initValue,$i,1); + if(7-$i == $portNo){ + $crc = $crcArr[7-$i]; + if($DEBUG)echo "
      crc=$crc"; + } + if($DEBUG)echo "
      crcArr[7-$i]={$crcArr[7-$i]}"; +} + + + +//2.2 E1 MTP2 alarm flag +$dlinkSql = " SELECT instanceNo,initValue,editValue,readValue FROM $temTb WHERE instanceNo = '$instanceNo' ".$wDlink." ORDER BY instanceNo "; +if($DEBUG)echo "
      flagSql=$flagSql"; +$dlinkRes = @mysqli_query($pubConn,$dlinkSql); +$dlinkRow = @mysqli_fetch_array($dlinkRes); +$initValue = HexDec($dlinkRow[initValue]); +$initValue = DecBin($initValue); +$initValue = omc_keep_length($initValue,0,8); +if($DEBUG) echo "
      initValue=$initValue"; +for($i=0;$i<8;$i++) +{ + $dlinkArr[7-$i] = substr($initValue,$i,1); + if(7-$i == $portNo){ + $dlink = $dlinkArr[7-$i]; + if($DEBUG)echo "
      dlink=$dlink"; + } + if($DEBUG)echo "
      dlinkArr[7-$i]={$dlinkArr[7-$i]}"; +} + + + +//2.4.1 2.4.2 2.4.3 MSC +$mscSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 ".$wMsc; +if($DEBUG)echo "
      mscSql=$mscSql"; +$mscRes = @mysqli_query($pubConn,$mscSql); +$mscRow = @mysqli_fetch_array($mscRes); +if($DEBUG)echo mysqli_error($pubConn); + +do +{ + $level_3 = $mscRow[level_3]; + $initValue = HexDec($mscRow[initValue]); + $mscArr[$level_3] = $initValue; + if($DEBUG)echo "
      mscArr[$level_3]={$mscArr[$level_3]}"; +}while($mscRow = @mysqli_fetch_array($mscRes)); + +$cic = $mscArr[3]; +$tg = $mscArr[2]; +$pt = $mscArr[1]; + + +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +if($flag){ + echo ""; + echo ""; +}else{ + echo ""; + echo ""; +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +if($crc){ + echo ""; + echo ""; +}else{ + echo ""; + echo ""; +} +echo ""; +echo ""; + +if($dlink){ + echo ""; + echo ""; +}else{ + echo ""; + echo ""; +} +echo ""; +echo "
      Plane $sNum, Slot $instanceNo, Port $portNo
      FlagYesNo YesNo 
      CIC
      TG
      Protocol"; +echo ""; +echo "
      CRC4OnOff 
      OnOff 
      AlarmYesNo YesNo 
      "; +//echo "
      Remark:"; +echo "
      "; +echo ""; +echo "  "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; + + +?> + Remarks:

      +Flag: Y=E1 enable, N=E1 disable

      +CIC: Circuit identity code that uniquely identifies each circuit within a trunk group. CIC of both ends of a circuit must be identical. CIC of each circuit of a trunk group must be unique

      +TG: Trunk group to which this E1 port is assigned

      +Protocol: Protocol type of an E1 port
      +CI CNF: Install a CNF module for call intercept
      +CI loopback: Indicate this E1 is one of dual loopback E1 ports between MSC-CSC0 and MSC-CSC1 for call intercept

      +CRC4: Cyclic redundancy check, CRC4 flag of both ends of a traffic channel (TCH) must be identical
      +Alarm: Flag of MTP2 alarm, Yes=MTP2 alarm enable, No=MTP2 alarm disable
      + + + + + + \ No newline at end of file diff --git a/wxc2_omc/configuration/msc/emergencyConf.php b/wxc2_omc/configuration/msc/emergencyConf.php new file mode 100755 index 0000000..2a3f4e0 --- /dev/null +++ b/wxc2_omc/configuration/msc/emergencyConf.php @@ -0,0 +1,653 @@ + + +pPas[$i]=$pPas[$i]"; + $wPas = $wPas." AND level_$lNum = $pPas[$i] "; + $i++; +} +//echo "
      wPas=$wPas
      "; +$wAnd = $wPas; + +/************get default value**************/ +$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wAnd; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; + +/* +$enableFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); +*/ + +$emFlagArr = array( + array('num' => '0', 'remark' => 'Disable'), + array('num' => '1', 'remark' => 'By Cell'), + array('num' => '2', 'remark' => 'By LAC'), + array('num' => '3', 'remark' => 'By MSC') +); + +$regionalZoneFlagArr = array( + array('num' => '0', 'remark' => 'Disable'), + array('num' => '1', 'remark' => 'Enable'), +); + +//**************************************************************** +//函数 +// ChComm($sysId) +//函数说明:检查命令处理结果 +// +//变量说明: +// 无 +// +// +//返回值:$paramType +//$nSubSysParam = 0; +//$nGlobalSubSysParam = 1; +//$nGlobalSysParam = 2; +//作者 +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function ChComm($sysId,$chkType=1){ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + $DEBUG = 0; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + if($DEBUG)echo "
      selComm=$selComm"; + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + do + { + $temCommState = $selRow[commState]; + if($selRow[remark]){ + $remark = $selRow[remark]; + //echo "
      remark=$remark"; + } + //echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc) + return($nWaitProc); + elseif($temCommState == $nInProc) + return($nInProc); + elseif($temCommState == $nOutProc) + $commState = $nOutProc; + else + $commState = 0; + }while($selRow = @mysqli_fetch_array($selRes)); + + return($commState); +} + +//**************************************************************** +//函数 +// 从Buffer_2拷贝到$buffer_1 +//函数说明: +// +//变量说明: +// 无 +// +//返回值:$paramType +// +//作者: +//---------------------------------------------------------- + +function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1'){ + global $sysTypeNo_1,$db_1,$tb_0,$tb_1,$tb_2,$wAnd; + $DEBUG = 0; + $addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' "; + + //Attributes of TG + if($type){ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wAnd.$addWer; + }else{ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wAnd.$wDef.$addWer; + } + if($DEBUG) echo "
      uTgSql=$uTgSql "; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + echo mysqli_error($pubConn); + + if($uTgRes) + return 1; + else + return 0; +} + +//**************************************************************** +//函数 +// get 或 set +//函数说明: +// +//变量说明: +// 无 +// +//返回值:$commType +// +//作者: +//---------------------------------------------------------- +function eSetGet($commType) +{ + global $sysTypeNo_1,$db_1,$tb_0,$tb_1,$tb_2,$wTg,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $maxNum,$remark,$nGetComm,$nSetComm; + $DEBUG = 0; + + if($commType == $nGetComm) + $showType = "Get "; + else + $showType = "Set "; + + $pNext1 = 1; + //2.2.7 Emergency call + if($pNext1) + { + $sysId = $sysTypeNo_1."_99"; + $objIdStr = "2.2.7.*"; + $cic = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      cic=$cic"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Prefix assignment  "; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext2 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + }//end of $pNext1 + + return 1; +}//end of function + + +if ($saveSys) { + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //Get the value to "readValue" buffer. + eSetGet($nGetComm);//get value + /****************copy readValue to undoValue******************/ + $buffer_1 = "undoValue"; + $buffer_2 = "readValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //set editValue to system. + eSetGet($nSetComm); + $emSetFlag = 1; + session_register("emSetFlag"); + + //if get fail ( undoValue = NULL ) , unregister set flag. + $where = " level_1 = 2 AND level_2 = 2 AND level_3 = 5 "; + $selSql = "SELECT distinct undoValue FROM $tb_2 WHERE $where ORDER BY undoValue"; + if($DEBUG) echo "selSql(1)=$selSql,db=$db_1
      "; + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = mysqli_fetch_array($selRes); + if ('' == $selRow[0]) { + session_unregister("emSetFlag"); + } + + sleep(1); + echo ""; +}//end of set sys +elseif($readSys) +{ + eSetGet($nGetComm);//get value + + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; +}//end of $readSys +elseif($undoSet){ + /****************copy readValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + if ( 1 == eSetGet($nSetComm) ) { + $buffer_1 = "initValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + } + session_unregister("emSetFlag"); + + sleep(1); + echo ""; +} +//end undoSet +elseif($saveDisk) +{ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $inCed=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      $inCed=$$inCed"; + + if($inCed) + echo "
      Save success."; + else + echo "
      Save Failure."; + + flush(); + sleep(1); + echo ""; +}//end of $saveDisk +elseif($readDisk) +{ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $loadType = 1; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef,$loadType); + if($DEBUG) echo "
      edCin=$edCin"; + + if($edCin) + echo "
      Read success."; + else + echo "
      Read failure."; + + flush(); + sleep(1); + echo ""; + +}//end of $comSys +elseif($delete) +{ + $delSql = " UPDATE $tb_2 set initValue = '$defaultValue' WHERE subSysNo = '99' ".$wPas." AND instanceNo = $delValue "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + + echo mysqli_error($pubConn); +} +elseif($saveComm) +{ + session_unregister("emSetFlag"); + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = 'B5' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +elseif($resetComm) +{ + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = '5A' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} + + +if($readSys || $saveSys || $saveComm || $undoSet||$resetComm){ + echo "
      "; + echo "

      $strBack"; + exit(); +} +/************select value to see************/ +$andSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wAnd." ORDER BY instanceNo "; +if($DEBUG) echo "
      andSql=$andSql"; +$andRes = @mysqli_query($pubConn,$andSql); +$andRow = @mysqli_fetch_array($andRes); +echo mysqli_error($pubConn); + +do{ + $instanceNo = $andRow[instanceNo]; + $initValue = $andRow[initValue]; + //echo "
      initValue=$initValue"; + + if($initValue == $defaultValue){ + $andShow[$instanceNo] = 0; + }else{ + $andShow[$instanceNo] = 1; + } + //echo "
      andShow[$instanceNo]={$andShow[$instanceNo]}"; + + $enableFlag[$instanceNo] = hexdec(substr($initValue,0,2)); + if($DEBUG) echo "enableFlag[$instanceNo]={$enableFlag[$instanceNo]}
      "; + + $lac[$instanceNo] = hexdec(substr($initValue,2,4)); + if($DEBUG)echo "lac[$instanceNo]={$lac[$instanceNo]}
      "; + + $ci[$instanceNo] = hexdec(substr($initValue,6,4)); + if($DEBUG)echo "ci[$instanceNo]={$ci[$instanceNo]}
      "; + + $dialNum[$instanceNo] = hexdec(substr($initValue,10,2)); + if($DEBUG)echo "dialNum[$instanceNo]={$dialNum[$instanceNo]}
      "; + + $localEmNumArr = explode("E",substr($initValue,12,16)); + $localEmNum[$instanceNo] = $localEmNumArr[0]; + if($DEBUG) echo "localEmNum[$instanceNo]={$localEmNum[$instanceNo]}

      "; + + $regionalZoneFlag[$instanceNo] = hexdec(substr($initValue,28,2)); + if($DEBUG)echo "regionalZoneFlag[$instanceNo]={$regionalZoneFlag[$instanceNo]}
      "; + + $zoneCode[$instanceNo] = hexdec(substr($initValue,30,4)); + if($DEBUG)echo "zoneCode[$instanceNo]={$zoneCode[$instanceNo]}
      "; +}while($andRow = @mysqli_fetch_array($andRes)); + +$wDef = " AND ("; + +for($i=0;$i<1024;$i++) +{ + if( $andShow[$i] > 0 ){ + $realShow[$i] = 1; + //echo "
      realShow[$i]=$realShow[$i]"; + $wDef = $wDef." instanceNo = $i OR "; + } +} +$wDef = substr($wDef,0,-3); +$wDef = $wDef.")"; +if(strlen($wDef) < 10){ + $wDef = ' AND instanceNo < 0 '; +} +//echo "
      wDef=$wDef"; +//$realShow[0] = "1"; + +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo "

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > $strNetwork > $DEFAULT_SYS > CELL"; +echo ""; +showHelp($helpId); +echo "
      "; + +?> +
        + + + System:"; + echo ""; + echo ""; + if ( TRUE == session_is_registered("emSetFlag") ) { + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + echo " + + +
      Command:"; + echo ""; + echo ""; + ?> + + New: + +
      +

      + + + + + + + 0) + echo ""; + else + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +} +echo "
      No.FlagLACCI +Dial number +Local Emergency number +Regional Zone Flag +Zone Code +Delete +
      $i{$emFlagArr[$enableFlag[$i]][remark]} $lac[$i] $ci[$i] $dialNum[$i] $localEmNum[$i] {$regionalZoneFlagArr[$regionalZoneFlag[$i]][remark]} $zoneCode[$i] 
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/msc/emergencyEdit.php b/wxc2_omc/configuration/msc/emergencyEdit.php new file mode 100755 index 0000000..4776914 --- /dev/null +++ b/wxc2_omc/configuration/msc/emergencyEdit.php @@ -0,0 +1,305 @@ +subSysNo=$subSysNo"; +$portNo = $pNum%8; +if($DEBUG)echo "
      portNo=$portNo"; + +$wAnd = " AND level_1 = 2 AND level_2 = 2 AND level_3 = 7 "; + +/************get default value**************/ +$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wAnd; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; +/* +$enableFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); +*/ +$emFlagArr = array( + array('num' => '0', 'remark' => 'Disable'), + array('num' => '1', 'remark' => 'By Cell'), + array('num' => '2', 'remark' => 'By LAC'), + array('num' => '3', 'remark' => 'By MSC') +); + +$regionalZoneFlagArr = array( + array('num' => '0', 'remark' => 'Disable'), + array('num' => '1', 'remark' => 'Enable'), +); + + +if($set || $add) +{ + $field_0= omc_keep_length($prefixNum,E,16,0); + if($DEBUG)echo "
      field_0=$field_0"; + /* + if($add){ + $emFlag = 1; + } + */ + + if($DEBUG)echo "
      emFlag=$emFlag"; + + $field_0 = DecHex($emFlag); + $field_0 = omc_keep_length($field_0,0,2); + if($DEBUG) echo "
      field_0=$field_0"; + + $field_1 = DecHex($lac); + $field_1 = omc_keep_length($field_1,0,4); + if($DEBUG) echo "
      field_1=$field_1"; + + $field_2 = DecHex($ci); + $field_2 = omc_keep_length($field_2,0,4); + if($DEBUG) echo "
      field_2=$field_2"; + + $field_3 = DecHex($dialNum); + $field_3 = omc_keep_length($field_3,0,2); + if($DEBUG) echo "
      field_3=$field_3"; + + $field_4 = omc_keep_length($localEmNum,E,16,0); + if($DEBUG) echo "
      field_4=$field_4"; + + $field_5 = DecHex($regionalZoneFlag); + $field_5 = omc_keep_length($field_5,0,2); + if($DEBUG) echo "
      field_5=$field_5"; + + $field_6 = DecHex($zoneCode); + $field_6 = omc_keep_length($field_6,0,4); + if($DEBUG) echo "
      field_6=$field_6"; + + $initValue = strtoupper($field_0.$field_1.$field_2.$field_3.$field_4.$field_5.$field_6); + + if($DEBUG) echo "
      initValue=$initValue"; + + $uSql = " UPDATE $tb_2 set initValue = '$initValue' + WHERE subSysNo = '99' AND instanceNo = '$tNum' AND level_1 = 2 AND level_2 = 2 AND level_3 = 7 "; + //if($DEBUG) + echo "
      uSql=$uSql"; + $uRes_1 = @mysqli_query($pubConn,$uSql); + echo mysqli_error($pubConn); + //exit(); + echo ""; +} + +/************select value to see************/ +if($oType) + $andSql = " SELECT instanceNo,initValue,editValue,readValue + FROM $tb_2 + WHERE subSysNo = '99'".$wAnd."ORDER BY instanceNo"; +else + $andSql = " SELECT instanceNo,initValue,editValue,readValue + FROM $tb_2 + WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wAnd; +if($DEBUG)echo "
      andSql=$andSql
      db=$db_1"; +$andRes = @mysqli_query($pubConn,$andSql); +$andRow = @mysqli_fetch_array($andRes); +echo mysqli_error($pubConn); + +do{ + $instanceNo = $andRow[instanceNo]; + $initValue = $andRow[initValue]; + //echo "
      initValue=$initValue"; + + if($initValue == $defaultValue){ + $andShow[$instanceNo] = 0; + }else{ + $andShow[$instanceNo] = 1; + } + + $emFlag = hexdec(substr($initValue,0,2)); + if($DEBUG) echo "emFlag=$emFlag
      "; + + $lac = hexdec(substr($initValue,2,4)); + if($DEBUG)echo "lac=$lac
      "; + + $ci = hexdec(substr($initValue,6,4)); + if($DEBUG)echo "ci=$ci
      "; + + $dialNum = hexdec(substr($initValue,10,2)); + if($DEBUG)echo "dialNum={$dialNum}
      "; + + $localEmNumArr = explode("E",substr($initValue,12,16)); + $localEmNum = $localEmNumArr[0]; + if($DEBUG) echo "localEmNum=$localEmNum

      "; + + $regionalZoneFlag = hexdec(substr($initValue,28,2)); + if($DEBUG)echo "regionalZoneFlag={$regionalZoneFlag}
      "; + + $zoneCode = hexdec(substr($initValue,30,4)); + if($DEBUG)echo "zoneCode={$zoneCode}
      "; + +}while($andRow = @mysqli_fetch_array($andRes)); + +echo "
      "; +echo ""; + +if($oType){ + $emFlagSql = " SELECT instanceNo,initValue,editValue,readValue + FROM $tb_2 + WHERE subSysNo = '99' AND level_1 = 2 AND level_2 = 2 AND level_3 = 5 "." ORDER BY instanceNo "; + if($DEBUG) echo "
      emFlagSql=$emFlagSql"; + $emFlagRes = @mysqli_query($pubConn,$emFlagSql); + $emFlagRow = @mysqli_fetch_array($emFlagRes); + echo mysqli_error($pubConn); + + $emFlag = hexdec(substr($initValue,0,2)); + if($DEBUG) echo "enableFlag=$enableFlag
      "; + + echo ""; + echo ""; + echo ""; + /* + echo ""; + echo ""; + echo ""; + echo ""; + */ + + echo ""; + echo ""; + echo ""; + echo ""; +}else{ + echo ""; + echo ""; + echo ""; +} +$DEBUG = 0; + +echo ""; +echo ""; +echo ""; +echo ""; + +/* +echo ""; +echo ""; +if($emFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; +*/ + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      Add Cell parameter
      Cell Parameter no."; + echo ""; + echo "
      Cell Parameter no."; + echo ""; + echo "
      Cell parameter $tNum
      Flag"; +echo ""; +echo "
      Emergency FlagYes"; + echo "No Yes"; + echo "No 
      LAC
      CI
      Dial number
      Local emergency number
      Regional Zone Flag"; +echo ""; +echo "
      Zone code
      "; +//echo "
      Remark:"; +echo "
      "; +if($oType){ + echo ""; +}else{ + echo ""; + echo ""; +} +echo ""; +echo ""; +echo ""; + +echo "
      "; +?> + Remarks:

      + + \ No newline at end of file diff --git a/wxc2_omc/configuration/msc/prefixConf.php b/wxc2_omc/configuration/msc/prefixConf.php new file mode 100755 index 0000000..3e01b98 --- /dev/null +++ b/wxc2_omc/configuration/msc/prefixConf.php @@ -0,0 +1,997 @@ + + +pPas[$i]=$pPas[$i]"; + $wPas = $wPas." AND level_$lNum = $pPas[$i] "; + $i++; +} +//echo "
      wPas=$wPas"; +//Prefix attributes +$oidPat = "2.1.2"; +$pPat = explode(".",$oidPat); +$i = 0; +$wPat = ''; +while(isset($pPat[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pPat[$i]=$pPat[$i]"; + $wPat = $wPat." AND level_$lNum = $pPat[$i] "; + $i++; +} +//echo "
      wPat=$wPat"; + +//Assign TG to prefix +$oidTg = "2.1.3"; +$pTg = explode(".",$oidTg); +$i = 0; +$wTg = ''; +while(isset($pTg[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pTg[$i]=$pTg[$i]"; + $wTg = $wTg." AND level_$lNum = $pTg[$i] "; + $i++; +} +//echo "
      wTg=$wTg"; + +$wAnd = " AND level_1 = 2 AND level_2 = 1 AND (level_3 = 1 OR level_3 = 2 OR level_3 = 3) "; + +/************get default value**************/ +$defSql = " SELECT initValue,level_3 FROM paramConf WHERE keyId > 0 ".$wAnd." ORDER BY level_3 "; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +do +{ + $leve_3 = $defRow[level_3]; + $defaultValue[$leve_3] = $defRow[initValue]; + //echo "
      defaultValue[$leve_3]=$defaultValue[$leve_3]"; +}while($defRow = @mysqli_fetch_array($defRes)); + + $prefixFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + $inTonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'UNK', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') + ); + + $outTonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'UNK', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') + ); + + $cdrFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + +if($DEFAULT_SYS == 'MSC'){ + $proTypeArr=array( + array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'MSRN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'MSC', 'color' => '#0000FF') + ); +}else{ + $proTypeArr=array( + array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'PBX', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '3', 'remark' => '--', 'color' => '#0000FF') + ); +} + $callTypeArr=array( + array('num' => '0', 'remark' => 'Normal', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'EM', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'MCT', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'VMS', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IN', 'color' => '#0000FF') + + ); + + $tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'subscriber', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') + ); + + $camelFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $cliTypeArr = array( + array('num' => '0', 'remark' => 'Sub', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'UNK(local)', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'UNK(NDD)', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'UNK(IDD)', 'color' => '#0000FF') + ); + + + $VoicePromptFlagArr = array( + array('num' => '0', 'remark' => 'disable', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'enable', 'color' => '#0000FF') + ); + +//**************************************************************** +//函数 +// ChComm($sysId) +//函数说明:检查命令处理结果 +// +//变量说明: +// 无 +// +// +//返回值:$paramType +//$nSubSysParam = 0; +//$nGlobalSubSysParam = 1; +//$nGlobalSysParam = 2; +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function ChComm($sysId,$chkType=1) +{ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + $DEBUG = 0; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + if($DEBUG)echo "
      selComm=$selComm"; + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + do + { + $temCommState = $selRow[commState]; + if($selRow[remark]){ + $remark = $selRow[remark]; + //echo "
      remark=$remark"; + } + //echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc) + return($nWaitProc); + elseif($temCommState == $nInProc) + return($nInProc); + elseif($temCommState == $nOutProc) + $commState = $nOutProc; + else + $commState = 0; + }while($selRow = @mysqli_fetch_array($selRes)); + + return($commState); +} + +//**************************************************************** +//函数 +// 从Buffer_2拷贝到$buffer_1 +//函数说明: +// +//变量说明: +// 无 +// +//返回值:$paramType +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1') +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wAnd; + $DEBUG = 0; + $addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' "; + + //Attributes of TG + if($type){ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wAnd.$addWer; + }else{ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wAnd.$wDef.$addWer; + } + if($DEBUG) echo "
      uTgSql=$uTgSql "; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + echo mysqli_error($pubConn); + + if($uTgRes) + return 1; + else + return 0; +} + +//**************************************************************** +//函数 +// get 或 set +//函数说明: +// +//变量说明: +// 无 +// +//返回值:$commType +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function eSetGet($commType) +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $maxNum,$remark,$nGetComm,$nSetComm; + $DEBUG = 0; + + if($commType == $nGetComm) + $showType = "Get "; + else + $showType = "Set "; + + $pNext1 = 1; + //2.1.1 Prefix assignment + if($pNext1) + { + $sysId = $sysTypeNo_1."_99"; + $objIdStr = "2.1.1.*"; + $cic = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      cic=$cic"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Prefix assignment  "; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext2 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + }//end of $pNext1 + + + //2.1.2 Prefix attributes + if($pNext2) + { + $sysId = $sysTypeNo_1."_99"; + //$commType = $nSetComm; + $objIdStr = "2.1.2.*"; + $tg = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      tg=$tg"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Prefix attributes  "; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext3 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + } + + + //2.1.3 Assign TG to prefix + if($pNext3) + { + $sysId = $sysTypeNo_1."_99"; + //$commType = $nSetComm; + $objIdStr = "2.1.3.*"; + $port = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      port=$port"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Assign TG to prefix  "; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext4 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + + } + + return 1; +}//end of function + + +if ($saveSys) { + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //Get the value to "readValue" buffer. + eSetGet($nGetComm);//get value + /****************copy readValue to undoValue******************/ + $buffer_1 = "undoValue"; + $buffer_2 = "readValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //set editValue to system. + eSetGet($nSetComm); + $prefixSetFlag = 1; + session_register("prefixSetFlag"); + + //if get fail ( undoValue = NULL ) , unregister set flag. + $where = " level_1 = 2 AND level_2 = 1 AND (level_3 = 1 OR level_3 = 2 OR level_3 = 3) "; + $selSql = "SELECT distinct undoValue FROM $tb_2 WHERE $where ORDER BY undoValue"; + if($DEBUG) echo "selSql(1)=$selSql,db=$db_1
      "; + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = mysqli_fetch_array($selRes); + if ('' == $selRow[0]) { + session_unregister("prefixSetFlag"); + } + + sleep(1); + echo ""; +}//end of set sys +elseif($readSys) +{ + eSetGet($nGetComm);//get value + + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; +}//end of $readSys +elseif($undoSet){ + /****************copy readValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + if ( 1 == eSetGet($nSetComm) ) { + $buffer_1 = "initValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + } + session_unregister("prefixSetFlag"); + + sleep(1); + echo ""; +} +//end undoSet +elseif($saveDisk) +{ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $inCed=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      $inCed=$$inCed"; + + if($inCed) + echo "
      Save success."; + else + echo "
      Save Failure."; + + flush(); + sleep(1); + echo ""; +}//end of $saveDisk +elseif($readDisk) +{ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $loadType = 1; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef,$loadType); + if($DEBUG) echo "
      edCin=$edCin"; + + if($edCin) + echo "
      Read success."; + else + echo "
      Read failure."; + + flush(); + sleep(1); + echo ""; + +}//end of $comSys +elseif($delete) +{ + $delSql_1 = " UPDATE $tb_2 set initValue = '$defaultValue[1]' WHERE subSysNo = '99' ".$wPas." AND instanceNo = $delValue "; + //echo "
      delSql_1=$delSql_1"; + $delRes_1 = @mysqli_query($pubConn,$delSql_1); + + $delSql_2 = " UPDATE $tb_2 set initValue = '$defaultValue[2]' WHERE subSysNo = '99' ".$wPat." AND instanceNo = $delValue "; + //echo "
      delSql_2=$delSql_2"; + $delRes_2 = @mysqli_query($pubConn,$delSql_2); + + $delSql_3 = " UPDATE $tb_2 set initValue = '$defaultValue[3]' WHERE subSysNo = '99' ".$wTg." AND instanceNo = $delValue "; + //echo "
      delSql_3=$delSql_3"; + $delRes_3 = @mysqli_query($pubConn,$delSql_3); + + echo mysqli_error($pubConn); +} +elseif($saveComm) +{ + session_unregister("prefixSetFlag"); + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = 'B5' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +elseif($resetComm) +{ + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = '5A' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} + + +if($readSys || $saveSys || $saveComm || $undoSet||$resetComm){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + +/**************select used E1 card*******************/ +$getSql = " SELECT sysNo,subSysNo,baseStat + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo_0' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; +//echo "
      getSql=$getSql"; +$getRes = @mysqli_query($pubConn,$getSql); +$getRow = @mysqli_fetch_array($getRes); +echo mysqli_error($pubConn); +do +{ + $sysNo = $getRow[sysNo]; + $subSysNo = $getRow[subSysNo]; + $cardArr[$sysNo][subSysNo] = $getRow[baseStat]; + +}while($getRow = @mysqli_fetch_array($getRes)); + + + + +/************select value to see************/ +//Attributes of TG + +$andSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wAnd." ORDER BY instanceNo "; +if($DEBUG) echo "
      andSql=$andSql"; +$andRes = @mysqli_query($pubConn,$andSql); +$andRow = @mysqli_fetch_array($andRes); +echo mysqli_error($pubConn); + +do +{ + $level_3 = $andRow[level_3]; + $instanceNo = $andRow[instanceNo]; + $initValue = $andRow[initValue]; + //echo "
      initValue=$initValue"; + + if($initValue == $defaultValue[$level_3]){ + $andShow[$level_3][$instanceNo] = 0; + }else{ + $andShow[$level_3][$instanceNo] = 1; + } + //echo "
      andShow[$level_3][$instanceNo]={$andShow[$level_3][$instanceNo]}"; + + if($level_3 == 1){ + $prefixNum = $initValue; + $pNum = explode("E",$prefixNum); + $prefixNum=$prefixArr[$instanceNo][1] = $pNum[0]; + //echo "
      prefixArr[$instanceNo][1]={$prefixArr[$instanceNo][1]}"; + }elseif($level_3 == 2){ + $DEBUG = 0; + $hex_0 = substr($initValue,0,2); + if($DEBUG)echo "
      hex_0=$hex_0"; + $bin_0 = omc_keep_length(DecBin(HexDec($hex_0)),0,8); + if($DEBUG)echo "
      bin_0=$bin_0"; + + $inTon = $prefixArr[$instanceNo][2] = BinDec(substr($bin_0,4,4)); + //echo "
      inTon=$inTon"; + + $outTon = $prefixArr[$instanceNo][3] = BinDec(substr($bin_0,0,4)); + //echo "
      outTon=$outTon"; + + $hex_1 = substr($initValue,2,2); + if($DEBUG)echo "
      hex_1=$hex_1"; + $bin_1 = omc_keep_length(DecBin(HexDec($hex_1)),0,8); + if($DEBUG)echo "
      bin_1=$bin_1"; + + $trkDelC = $prefixArr[$instanceNo][4] = BinDec(substr($bin_1,4,4)); + if($DEBUG)echo "
      trkDelC=$trkDelC"; + + $trkInsC = $prefixArr[$instanceNo][5] = BinDec(substr($bin_1,0,4)); + if($DEBUG)echo "
      trkInsC=$trkInsC"; + + $trkInsD = substr($initValue,4,16); + $pTrk = explode("E",$trkInsD); + $trkInsD = $prefixArr[$instanceNo][6] = $pTrk[0]; + if($DEBUG)echo "
      trkInsD=$trkInsD"; + + $hex_6 = substr($initValue,20,2); + if($DEBUG)echo "
      hex_6=$hex_6"; + $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); + if($DEBUG) echo "
      bin_6=$bin_6"; + + $cdrFlag = $prefixArr[$instanceNo][7] = BinDec(substr($bin_6,7,1)); + if($DEBUG)echo "
      cdrFlag=$cdrFlag"; + + $proType = $prefixArr[$instanceNo][8] = BinDec(substr($bin_6,4,2)); + if($DEBUG)echo "
      proType=$proType"; + + $callType = $prefixArr[$instanceNo][9] = BinDec(substr($bin_6,1,3)); + if($DEBUG)echo "
      callType=$callType"; + + $prefixFlag = $prefixArr[$instanceNo][0] = BinDec(substr($bin_6,0,1)); + if($DEBUG)echo "
      prefixFlag=$prefixFlag"; + + $dLen = $prefixArr[$instanceNo][10] = HexDec(substr($initValue,22,2)); + if($DEBUG)echo "
      dLen=$dLen"; + + $hex_8 = substr($initValue,24,2); + if($DEBUG)echo "
      hex_8=$hex_8"; + $bin_8 = omc_keep_length(DecBin(HexDec($hex_8)),0,8); + if($DEBUG)echo "
      bin_8=$bin_8"; + + $eDelC = $prefixArr[$instanceNo][11] = BinDec(substr($bin_8,4,4)); + if($DEBUG)echo "
      eDelC=$eDelC"; + + $eInsC = $prefixArr[$instanceNo][12] = BinDec(substr($bin_8,0,4)); + if($DEBUG)echo "
      eInsC=$eInsC"; + + $eInsD = substr($initValue,26,8); + $pTrk = explode("E",$eInsD); + $eInsD = $prefixArr[$instanceNo][13] = $pTrk[0]; + if($DEBUG)echo "
      eInsD=$eInsD"; + + $cliType = $prefixArr[$instanceNo][15] = hexdec(substr($initValue,34,2)); + if($DEBUG) echo "cliType = $cliType
      "; + + $VoicePromptFlag= $prefixArr[$instanceNo][16] = hexdec(substr($initValue,36,2)); + if($DEBUG) echo "VoicePromptFlag = $VoicePromptFlag
      "; + }else{ + $tgNum = $prefixArr[$instanceNo][14] = HexDec($initValue); + //echo "
      prefixArr[$instanceNo][14]={$prefixArr[$instanceNo][14]}"; + } +}while($andRow = @mysqli_fetch_array($andRes)); + +$wDef = " AND ("; + +for($i=0;$i<256;$i++) +{ + if($andShow[1][$i] > 0 || $andShow[2][$i] > 0 || $andShow[3][$i] > 0){ + $realShow[$i] = 1; + //echo "
      realShow[$i]=$realShow[$i]"; + $wDef = $wDef." instanceNo = $i OR "; + } +} +$wDef = substr($wDef,0,-3); +$wDef = $wDef.")"; +if(strlen($wDef) < 10){ + $wDef = ' AND instanceNo < 0 '; +} +//echo "
      wDef=$wDef"; +//$realShow[0] = "1"; + +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo "

      "; +?> +"; +echo ""; +echo ""; +echo "$strConfiguration > $strNetwork > $DEFAULT_SYS > $strDailingPrefix"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> +
        + + + + System:"; + echo ""; + echo ""; + if ( TRUE == session_is_registered("prefixSetFlag") ) { + echo ""; + }else{ + echo ""; + } + + ?> + + + Command:"; + echo ""; + echo ""; + ?> + + + + +
      New: + +
      +

      + + + + + + 0) + echo ""; + else + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + } +} +echo "
      No.FlagPrefix +In-TON +Out-TON +T-D-C +T-I-C +T-I-D +CDR +Properties +Call type +Digit-L +E-D-C +E-I-C +E-I-D +TG +CLI +VoiceProFlag +Del +
      $i{$prefixFlagArr[$prefixArr[$i][0]][remark]} {$prefixArr[$i][1]} {$inTonArr[$prefixArr[$i][2]][remark]} {$outTonArr[$prefixArr[$i][3]][remark]} {$prefixArr[$i][4]} {$prefixArr[$i][5]} {$prefixArr[$i][6]} {$cdrFlagArr[$prefixArr[$i][7]][remark]} {$proTypeArr[$prefixArr[$i][8]][remark]} {$callTypeArr[$prefixArr[$i][9]][remark]} {$prefixArr[$i][10]} {$prefixArr[$i][11]} {$prefixArr[$i][12]} {$prefixArr[$i][13]} {$prefixArr[$i][14]} {$cliTypeArr[$prefixArr[$i][15]][remark]} {$VoicePromptFlagArr[$prefixArr[$i][16]][remark]} 
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/msc/prefixEdit.php b/wxc2_omc/configuration/msc/prefixEdit.php new file mode 100755 index 0000000..9f827bb --- /dev/null +++ b/wxc2_omc/configuration/msc/prefixEdit.php @@ -0,0 +1,679 @@ +subSysNo=$subSysNo"; +$portNo = $pNum%8; +if($DEBUG)echo "
      portNo=$portNo"; + +$wAnd = " AND level_1 = 2 AND level_2 = 1 AND (level_3 = 1 OR level_3 = 2 OR level_3 = 3) "; + +/************get default value**************/ +$defSql = " SELECT initValue,level_3 FROM paramConf WHERE keyId > 0 ".$wAnd." ORDER BY level_3 "; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +do +{ + $leve_3 = $defRow[level_3]; + $defaultValue[$leve_3] = $defRow[initValue]; + //echo "
      defaultValue[$leve_3]=$defaultValue[$leve_3]"; +}while($defRow = @mysqli_fetch_array($defRes)); + + + $prefixFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + $inTonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'UNK', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') + ); + + $outTonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'UNK', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') + ); + + $trkDelCArr=array( + array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000'), + array('num' => '9', 'remark' => 'Delete first nine','color' => '#FF0000'), + array('num' => '10', 'remark' => 'Delete first ten','color' => '#FF0000'), + array('num' => '11', 'remark' => 'Delete first eleven','color' => '#FF0000'), + array('num' => '12', 'remark' => 'Delete first twelve','color' => '#FF0000'), + array('num' => '13', 'remark' => 'Delete first thirteen','color' => '#FF0000'), + array('num' => '14', 'remark' => 'Delete first fourteen','color' => '#FF0000'), + array('num' => '15', 'remark' => 'Delete first fifteen','color' => '#FF0000') + ); + + $trkInsCArr=array( + array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000'), + array('num' => '9', 'remark' => 'Insert first nine','color' => '#FF0000'), + array('num' => '10', 'remark' => 'Insert first ten','color' => '#FF0000'), + array('num' => '11', 'remark' => 'Insert first eleven','color' => '#FF0000'), + array('num' => '12', 'remark' => 'Insert first twelve','color' => '#FF0000'), + array('num' => '13', 'remark' => 'Insert first thirteen','color' => '#FF0000'), + array('num' => '14', 'remark' => 'Insert first fourteen','color' => '#FF0000'), + array('num' => '15', 'remark' => 'Insert first fifteen','color' => '#FF0000') + ); + + $cdrFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + + + $proTypeArr=array( + array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'MSRN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'MSC', 'color' => '#0000FF') + ); + + $callTypeArr=array( + array('num' => '0', 'remark' => 'Normal', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Emergency', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'MCT', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'VMS', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IN', 'color' => '#0000FF') + ); + + $camelFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $eDelCArr=array( + array('num' => '0', 'remark' => 'Delete none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Delete first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Delete first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Delete first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Delete first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Delete first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Delete first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Delete first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Delete first eight','color' => '#FF0000') + ); + + $eInsCArr=array( + array('num' => '0', 'remark' => 'Insert none', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Insert first one','color' => '#FF0000'), + array('num' => '2', 'remark' => 'Insert first two','color' => '#FF0000'), + array('num' => '3', 'remark' => 'Insert first three','color' => '#FF0000'), + array('num' => '4', 'remark' => 'Insert first four','color' => '#FF0000'), + array('num' => '5', 'remark' => 'Insert first five','color' => '#FF0000'), + array('num' => '6', 'remark' => 'Insert first six','color' => '#FF0000'), + array('num' => '7', 'remark' => 'Insert first seven','color' => '#FF0000'), + array('num' => '8', 'remark' => 'Insert first eight','color' => '#FF0000') + ); + + $cliTypeArr = array( + array('num' => '0', 'remark' => 'Sub', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'UNK(local)', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'UNK(NDD)', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'UNK(IDD)', 'color' => '#0000FF') + ); + + $VoicePromptFlagArr = array( + array('num' => '0', 'remark' => 'disable', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'enable', 'color' => '#0000FF') + ); + + $needMNPArr = array( + array('num' => '0', 'remark' => 'No'), + array('num' => '1', 'remark' => 'Yes') + ); + + +if($set || $add) +{ + $field_0= omc_keep_length($prefixNum,E,16,0); + if($DEBUG)echo "
      field_0=$field_0"; + + if($add){ + $prefixFlag = 1; + } + if($DEBUG)echo "
      prefixFlag=$prefixFlag"; + + $field_1 = DecHex($outTon).DecHex($inTon); + $field_1 = omc_keep_length($field_1,0,2); + if($DEBUG)echo "
      field_1=$field_1"; + + $field_2 = DecHex($trkInsC).DecHex($trkDelC); + $field_2 = omc_keep_length($field_2,0,2); + if($DEBUG)echo "
      field_2=$field_2"; + + $field_3 = omc_keep_length($trkInsD,E,16,0); + if($DEBUG)echo "
      field_3=$field_3"; + + $field_4 = $prefixFlag.omc_keep_length(DecBin($callType),0,3).omc_keep_length(DecBin($proType),0,2)."0".$cdrFlag; + $field_4 = omc_keep_length(DecHex(BinDec($field_4)),0,2); + if($DEBUG)echo "
      field_4=$field_4"; + + $field_5 = omc_keep_length(DecHex($dLen),0,2); + if($DEBUG)echo "
      field_5=$field_5"; + + $field_6 = DecHex($eInsC).DecHex($eDelC); + $field_6 = omc_keep_length($field_6,0,2); + if($DEBUG)echo "
      field_6=$field_6"; + + $field_7 = omc_keep_length($eInsD,E,8,0); + if($DEBUG)echo "
      field_7=$field_7"; + + $field_8 = omc_keep_length(DecHex($tgNum),0,2); + if($DEBUG)echo "
      field_8=$field_8"; + + $field_9 = omc_keep_length(DecHex($cliType),0,2); + if($DEBUG)echo "
      field_9=$field_9"; + + $field_10 = omc_keep_length(DecHex($VoicePromptFlag),0,2); + if($DEBUG)echo "
      field_10=$field_10"; + + $field_11 = omc_keep_length(DecHex($needMNP),0,2); + if($DEBUG)echo "
      field_11=$field_11"; + + $initValue_1 = strtoupper($field_0); + $initValue_2 = strtoupper($field_1.$field_2.$field_3.$field_4.$field_5.$field_6.$field_7.$field_9.$field_10.$field_11); + $initValue_3 = strtoupper($field_8); + if($DEBUG)echo "
      initValue_1=$initValue_1"; + if($DEBUG)echo "
      initValue_2=$initValue_2"; + if($DEBUG)echo "
      initValue_3=$initValue_3"; + + $uSql_1 = " UPDATE $tb_2 set initValue = '$initValue_1' WHERE subSysNo = '99' AND instanceNo = '$tNum' AND level_1 = 2 AND level_2 = 1 AND level_3 = 1 "; + if($DEBUG)echo "
      uSql_1=$uSql_1"; + $uRes_1 = @mysqli_query($pubConn,$uSql_1); + echo mysqli_error($pubConn); + + $uSql_2 = " UPDATE $tb_2 set initValue = '$initValue_2' WHERE subSysNo = '99' AND instanceNo = '$tNum' AND level_1 = 2 AND level_2 = 1 AND level_3 = 2 "; + if($DEBUG)echo "
      uSql_2=$uSql_2"; + $uRes_2 = @mysqli_query($pubConn,$uSql_2); + echo mysqli_error($pubConn); + + $uSql_3 = " UPDATE $tb_2 set initValue = '$initValue_3' WHERE subSysNo = '99' AND instanceNo = '$tNum' AND level_1 = 2 AND level_2 = 1 AND level_3 = 3 "; + if($DEBUG)echo "
      uSql_3=$uSql_3"; + $uRes_3 = @mysqli_query($pubConn,$uSql_3); + echo mysqli_error($pubConn); + + echo ""; +} + +/************select value to see************/ +//Attributes of TG +if($oType) + $andSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99'".$wAnd." ORDER BY instanceNo "; +else + $andSql = " SELECT level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wAnd; +if($DEBUG) echo "
      andSql=$andSql
      db=$db_1"; +$andRes = @mysqli_query($pubConn,$andSql); +$andRow = @mysqli_fetch_array($andRes); +echo mysqli_error($pubConn); + +do +{ + $level_3 = $andRow[level_3]; + $instanceNo = $andRow[instanceNo]; + $initValue = $andRow[initValue]; + //echo "
      initValue=$initValue"; + + if($initValue == $defaultValue[$level_3]){ + $andShow[$level_3][$instanceNo] = 0; + }else{ + $andShow[$level_3][$instanceNo] = 1; + } + //echo "
      andShow[$level_3][$instanceNo]={$andShow[$level_3][$instanceNo]}"; + + if($level_3 == 1){ + $prefixNum = $initValue; + $pNum = explode("E",$prefixNum); + $prefixNum = $prefixArr[$instanceNo][1] = $pNum[0]; + //echo "
      prefixArr[$instanceNo][1]={$prefixArr[$instanceNo][1]}"; + }elseif($level_3 == 2){ + $DEBUG = 0; + $hex_0 = substr($initValue,0,2); + if($DEBUG)echo "
      hex_0=$hex_0"; + $bin_0 = omc_keep_length(DecBin(HexDec($hex_0)),0,8); + if($DEBUG)echo "
      bin_0=$bin_0"; + + $inTon = $prefixArr[$instanceNo][2] = BinDec(substr($bin_0,4,4)); + //echo "
      inTon=$inTon"; + + $outTon = $prefixArr[$instanceNo][3] = BinDec(substr($bin_0,0,4)); + //echo "
      outTon=$outTon"; + + $hex_1 = substr($initValue,2,2); + if($DEBUG)echo "
      hex_1=$hex_1"; + $bin_1 = omc_keep_length(DecBin(HexDec($hex_1)),0,8); + if($DEBUG)echo "
      bin_1=$bin_1"; + + $trkDelC = $prefixArr[$instanceNo][4] = BinDec(substr($bin_1,4,4)); + if($DEBUG)echo "
      trkDelC=$trkDelC"; + + $trkInsC = $prefixArr[$instanceNo][5] = BinDec(substr($bin_1,0,4)); + if($DEBUG)echo "
      trkInsC=$trkInsC"; + + $trkInsD = substr($initValue,4,16); + $pTrk = explode("E",$trkInsD); + $trkInsD = $prefixArr[$instanceNo][6] = $pTrk[0]; + if($DEBUG)echo "
      trkInsD=$trkInsD"; + + $hex_6 = substr($initValue,20,2); + if($DEBUG)echo "
      hex_6=$hex_6"; + $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); + if($DEBUG)echo "
      bin_6=$bin_6"; + + $cdrFlag = $prefixArr[$instanceNo][7] = BinDec(substr($bin_6,7,1)); + if($DEBUG)echo "
      cdrFlag=$cdrFlag"; + + $proType = $prefixArr[$instanceNo][8] = BinDec(substr($bin_6,4,2)); + if($DEBUG)echo "
      proType=$proType"; + + $callType = $prefixArr[$instanceNo][9] = BinDec(substr($bin_6,1,3)); + if($DEBUG)echo "
      callType=$callType"; + + $prefixFlag = $prefixArr[$instanceNo][0] = BinDec(substr($bin_6,0,1)); + if($DEBUG)echo "
      prefixFlag=$prefixFlag"; + + $dLen = $prefixArr[$instanceNo][10] = HexDec(substr($initValue,22,2)); + if($DEBUG)echo "
      dLen=$dLen"; + + $hex_8 = substr($initValue,24,2); + if($DEBUG)echo "
      hex_8=$hex_8"; + $bin_8 = omc_keep_length(DecBin(HexDec($hex_8)),0,8); + if($DEBUG)echo "
      bin_8=$bin_8"; + + $eDelC = $prefixArr[$instanceNo][11] = BinDec(substr($bin_8,4,4)); + if($DEBUG)echo "
      eDelC=$eDelC"; + + $eInsC = $prefixArr[$instanceNo][12] = BinDec(substr($bin_8,0,4)); + if($DEBUG)echo "
      eInsC=$eInsC"; + + $eInsD = substr($initValue,26,8); + $pTrk = explode("E",$eInsD); + $eInsD = $prefixArr[$instanceNo][13] = $pTrk[0]; + if($DEBUG)echo "
      eInsD=$eInsD"; + + $cliType = substr($initValue,34,2); + if($DEBUG) echo "cliType = $cliType
      "; + + $VoicePromptFlag = hexdec(substr($initValue,36,2)); + if($DEBUG) echo "VoicePromptFlag = $VoicePromptFlag
      "; + + $needMNP = hexdec(substr($initValue,38,2)); + if($DEBUG) echo "needMNP = $needMNP
      "; + }else{ + $tgNum = $prefixArr[$instanceNo][14] = HexDec($initValue); + //echo "
      prefixArr[$instanceNo][14]={$prefixArr[$instanceNo][14]}"; + } +}while($andRow = @mysqli_fetch_array($andRes)); + +echo "
      "; +echo ""; + +if($oType){ + /* + $preFlagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND level_1 = 2 AND level_2 = 1 AND level_3 = 2 "." ORDER BY instanceNo "; + if($DEBUG)echo "
      preFlagSql=$preFlagSql"; + $preFlagRes = @mysqli_query($pubConn,$preFlagSql); + $preFlagRow = @mysqli_fetch_array($preFlagRes); + echo mysqli_error($pubConn); + do + { + $instanceNo = $preFlagRow[instanceNo]; + $initValue = $preFlagRow[initValue]; + if($DEBUG)echo "
      initValue=$initValue"; + + $hex_6 = substr($initValue,12,2); + if($DEBUG)echo "
      hex_6=$hex_6"; + $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); + if($DEBUG)echo "
      bin_6=$bin_6"; + + $prefixFlag = $prefixFlagArr[$instanceNo][0] = BinDec(substr($bin_6,1,1)); + //echo "
      prefixFlag=$prefixFlag"; + }while($preFlagRow = @mysqli_fetch_array($preFlagRes)); + */ + + echo ""; + echo ""; + echo ""; + + /* + echo ""; + echo ""; + echo ""; + echo ""; +*/ + + echo ""; + echo ""; + echo ""; + echo ""; + +}else{ + echo ""; + echo ""; + echo ""; +} +echo ""; +echo ""; +if($prefixFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +if($cdrFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +if($VoicePromptFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($needMNP){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo "
      Add Dailing prefix
      Prefix no."; + echo ""; + echo "
      Prefix no."; + echo ""; + echo "
      Dailing prefix $tNum
      FlagYes"; + echo "No Yes"; + echo "No 
      Prefix
      TON incoming call"; +echo ""; +echo "
      TON outgoing call"; +echo ""; +echo "
      Out trunk deletion count"; +echo ""; +echo "
      Out trunk insertion count"; +echo ""; +echo "
      Out trunk inserted digits
      CDROn "; + echo "OffOn "; + echo "Off
      Properties"; +echo ""; +echo "
      Call type"; +echo ""; +echo "
      Length of dialed number
      E.164 international deletion count"; +echo ""; +echo "
      E.164 international insertion count"; +echo ""; +echo "
      E.164 international inserted digits
      Trunk group
      Cli-type "; +echo ""; +echo "
      Voice Prompt FlagYes"; + echo "No Yes"; + echo "No 
      Need MNPYes"; + echo "No Yes"; + echo "No 
      "; +//echo "
      Remark:"; +echo "
      "; +if($oType){ + echo ""; +}else{ + echo ""; + echo ""; +} +echo ""; +echo ""; +echo ""; + +echo "
      "; +?> + Remarks:

      +Prefix number: It appears when add a new prefix, ranging from 0 to 255

      +Flag: Y=prefix enable, N=prefix disable

      +TON incoming call (In-TON): Type of number for incoming call, include unknown, MSISDN, NDD and IDD. It is specified by originating node for terminating node to route this call with proper dialed number manipulation. +For system subscriber dialed prefix, always use unknown for In-TON except the prefix of international prefix beginning with a "+". For this kind of prefix (such as +86755832) we should set the In-TON as IDD to support "+" dialing

      +TON outgoing call (Out-TON): Type of number for outgoing call, include unknown, MSISDN, NDD and IDD. It specifies the type of an outgoing call for terminating node to route this call with proper dialed number manipulation. Generally the MSC uses IDD for outgoing call

      +Out trunk deletion count (T-D-C): Quantity of deleted digit of a dialed number beginning with this prefix. It ranges from 0 to 8. 0=no deletion, 1-8=delete first 1-8 digits

      +Out trunk insertion count (T-I-C): Quantity of inserted digit for a dialed number beginning with this prefix. It ranges from 0 to 8. 0=no insertion, 1-8=insert 1-8 digits from the beginning of this number

      +Out trunk inserted digits (T-I-D): 8 digits ranging from EEEEEEEE to 99999999, E=any decimal number

      +CDR: Turn on/off the CDR of dialed numbers beginning with this prefix

      +Properties: Specify the properties of a prefix. Trunk=to PSTN, MSISDN=to A interface, MSRN=MS roaming number, MSC=to peer MSC

      +Call type: Normal=no verification for MT, Emergency call=no verification for MO (free call), Intelligent peripheral=MT verification via PPS, VMS call=send signaling carried DTMF to VMS

      +Length of dialed number (Digit-L): Length of dialed number (1-32)

      +E.164 international deletion count (E-D-C): Quantity of deleted digit of E164 international number

      +E.164 international insertion count (E-I-C): Quantity of inserted digit of E164 international number

      +E.164 international inserted digits (E-I-D): Inserted digit to the E164 international number, 8 digits ranging from EEEEEEEE to 99999999, E=any decimal number, MSISDN is used to Locate serving HLR, it also specify the country code of called which is necessary to identify IDD call

      +Trunk group (TG): Assign a trunk group for this prefix. Support assigning a single trunk group to multiple prefixes

      +CLI: Calling line identity +Specify the CLI type for opposite node to perform CLIP or CLIR function. This CLI type should be same as the prefix type. e.g. If a prefix is for NDD call, its CLI type should be NDD +
      + + \ No newline at end of file diff --git a/wxc2_omc/configuration/msc/tgConf.php b/wxc2_omc/configuration/msc/tgConf.php new file mode 100755 index 0000000..612e710 --- /dev/null +++ b/wxc2_omc/configuration/msc/tgConf.php @@ -0,0 +1,861 @@ + + +pTg[$i]=$pTg[$i]"; + $wTg = $wTg." AND level_$lNum = $pTg[$i] "; + $i++; +} + + +/************get default value**************/ +$defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wTg; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; +//echo "
      defaultValue=$defaultValue"; + + $tgFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $mptyFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + $tandemFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $incomingCallTypeArr=array( + array('num' => '0', 'remark' => 'Normal', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'In', 'color' => '#0000FF') + ); + + $cdrFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + + $voFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + +if($DEFAULT_SYS == 'MSC'){ + $tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IP', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Intercept', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'Interconnection', 'color' => '#0000FF') + ); +}else{ + $tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IP', 'color' => '#0000FF'), + //array('num' => '5', 'remark' => 'GP', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Intercept', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'Interconnection', 'color' => '#0000FF') + ); +} + $atFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $lpFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $netTypeArr=array( + array('num' => '0', 'remark' => 'Inter', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Inter-S', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'NAT', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NI-S', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') + ); + + $cirTypeArr=array( + array('num' => '0', 'remark' => 'Clockwise', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Anti-C', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Odd', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'Even', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') + ); + + $backFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + +if($DEFAULT_SYS == 'MSC'){ + $tgLocationArr=array( + array('num' => '0', 'remark' => 'MSC-0', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSC-1', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Both', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'Spare', 'color' => '#0000FF') + ); +}else{ + $tgLocationArr=array( + array('num' => '0', 'remark' => 'SN-0', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'SN-1', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Both', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'Spare', 'color' => '#0000FF') + ); +} + +//**************************************************************** +//函数 +// ChComm($sysId) +//函数说明:检查命令处理结果 +// +//变量说明: +// 无 +// +// +//返回值:$paramType +//$nSubSysParam = 0; +//$nGlobalSubSysParam = 1; +//$nGlobalSysParam = 2; +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function ChComm($sysId,$chkType=1) +{ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + $DEBUG = 0; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + if($DEBUG)echo "
      selComm=$selComm"; + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + do + { + $temCommState = $selRow[commState]; + if($selRow[remark]){ + $remark = $selRow[remark]; + //echo "
      remark=$remark"; + } + //echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc) + return($nWaitProc); + elseif($temCommState == $nInProc) + return($nInProc); + elseif($temCommState == $nOutProc) + $commState = $nOutProc; + else + $commState = 0; + }while($selRow = @mysqli_fetch_array($selRes)); + + return($commState); +} + + + +//**************************************************************** +//函数 +// 从Buffer_2拷贝到$buffer_1 +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$paramType +// +// +// +//作者 +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1') +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg; + $DEBUG = 0; + $addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' "; + + //Attributes of TG + if($type){ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wTg.$addWer; + }else{ + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wTg.$wDef.$addWer; + } + if($DEBUG) echo "
      uTgSql=$uTgSql "; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + + echo mysqli_error($pubConn); + + if($uTgRes) + return 1; + else + return 0; +} + +//**************************************************************** +//函数 +// get 或 set +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$commType +// +// +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function eSetGet($commType) +{ + global $sysTypeNo_0,$sysTypeNo_1,$db_0,$db_1,$tb_0,$tb_1,$tb_2,$wTg,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $maxNum,$remark,$nGetComm,$nSetComm; + $DEBUG = 0; + + if($commType == $nGetComm) + $showType = "Get "; + else + $showType = "Set "; + + + //2.1.4 + $sysId = $sysTypeNo_1."_99"; + $objIdStr = "2.1.4.*"; + $cic = sysCommSend($sysId,$commType,$objIdStr); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Attributes of TG  "; + if($i > $maxNum){ + echo "
      Timeout"; + flush(); + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext2 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + + flush(); + break; + } + + sleep(1); + $i++; + } + + return 1; +}//end of function + + + +if($saveSys) +{ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //Get the value to "readValue" buffer. + eSetGet($nGetComm);//get value + /****************copy readValue to undoValue******************/ + $buffer_1 = "undoValue"; + $buffer_2 = "readValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + //set editValue to system. + eSetGet($nSetComm); + $tgSetFlag = 1; + session_register("tgSetFlag"); + + //if get fail ( undoValue = NULL ) , unregister set flag. + $where = "WHERE level_1=2 AND level_2=1 AND level_3=4"; + $selSql = "SELECT distinct undoValue FROM $tb_2 $where ORDER BY undoValue"; + if($DEBUG) echo "selSql(1)=$selSql,db=$db_1
      "; + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = mysqli_fetch_array($selRes); + if ('' == $selRow[0]) { + session_unregister("tgSetFlag"); + } + + sleep(1); + echo ""; +}//end of set sys +elseif($readSys) +{ + eSetGet($nGetComm);//get value + + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; +}//end of $readSys +elseif($undoSet){ + /****************copy readValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + if ( 1 == eSetGet($nSetComm) ) { + $buffer_1 = "initValue"; + $buffer_2 = "undoValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + } + session_unregister("tgSetFlag"); + + sleep(1); + echo ""; +} +//end undoSet +elseif($saveDisk) +{ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $inCed=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      $inCed=$$inCed"; + + if($inCed) + echo "
      Save success."; + else + echo "
      Save Failure."; + + flush(); + sleep(1); + echo ""; +}//end of $saveDisk +elseif($readDisk) +{ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $loadType = 1; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef,$loadType); + if($DEBUG) echo "
      edCin=$edCin"; + + if($edCin) + echo "
      Read success."; + else + echo "
      Read failure."; + + flush(); + sleep(1); + echo ""; + +}//end of $comSys +elseif($delete) +{ + $delSql = " UPDATE $tb_2 set initValue = '$defaultValue' WHERE subSysNo = '99' ".$wTg. " AND instanceNo = $delValue "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} +elseif($saveComm) { + session_unregister("tgSetFlag"); + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = 'B5' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Save parameter to system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +elseif($resetComm) +{ + $temTb = ${tb_."2"}; + $updSql = " UPDATE $temTb set initValue = '5A' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '2' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + + if($sTimeOut) + break; + + $sysId = $sysTypeNo_1."_99"; + $commType = $nSetComm; + $objIdStr = "3.2.*"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + //echo "
      flag=$flag"; + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Reset system"; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo_1; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } +} +if($readSys || $saveSys || $saveComm || $undoSet||$resetComm){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + +/**************select used E1 card*******************/ +$getSql = " SELECT sysNo,subSysNo,baseStat + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo_0' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; +//echo "
      getSql=$getSql"; +$getRes = @mysqli_query($pubConn,$getSql); +$getRow = @mysqli_fetch_array($getRes); +echo mysqli_error($pubConn); +do +{ + $sysNo = $getRow[sysNo]; + $subSysNo = $getRow[subSysNo]; + $cardArr[$sysNo][subSysNo] = $getRow[baseStat]; + +}while($getRow = @mysqli_fetch_array($getRes)); + +/************select value to see************/ +//Attributes of TG +$tgSql = " SELECT instanceNo,initValue,initValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wTg." ORDER BY instanceNo "; +if($DEBUG) echo "
      tgSql=$tgSql"; +$tgRes = @mysqli_query($pubConn,$tgSql); +$tgRow = @mysqli_fetch_array($tgRes); +echo mysqli_error($pubConn); +$wDef = " AND ("; +$defaultValue_1 = "000000000A0382FF00"; +do +{ + $instanceNo = $tgRow[instanceNo]; + $initValue = $tgRow[initValue]; + + //echo "
      $initValue == $defaultValue == $defaultValue_1"; + if($initValue == $defaultValue || $initValue == $defaultValue_1){ + $tgShow[$instanceNo] = 0; + }else{ + $tgShow[$instanceNo] = 1; + + $wDef = $wDef." instanceNo = $instanceNo OR "; + } + + //echo "
      tgShow[$instanceNo]=$tgShow[$instanceNo]"; + + if($DEBUG)echo "
      initValue=$initValue"; + $dpc = $tgArr[$instanceNo][2] = substr($initValue,2,6); + if($DEBUG)echo "
      dpc=$dpc"; + + $hex_4 = substr($initValue,8,2); + if($DEBUG)echo "
      hex_4=$hex_4"; + $bin_4 = omc_keep_length(DecBin(HexDec($hex_4)),0,8); + if($DEBUG)echo "
      bin_4=$bin_4"; + + $tgFlag = $tgArr[$instanceNo][0] = substr($bin_4,7,1); + if($DEBUG)echo "
      tgFlag=$tgFlag"; + + $cdrFlag = $tgArr[$instanceNo][3] = substr($bin_4,6,1); + if($DEBUG)echo "
      cdrFlag=$cdrFlag"; + + $voFlag = $tgArr[$instanceNo][4] = substr($bin_4,5,1); + if($DEBUG)echo "
      voFlag=$voFlag"; + + $tgType = $tgArr[$instanceNo][1] = BinDec(substr($bin_4,2,3)); + if($DEBUG)echo "
      tgType=$tgType"; + + $atFlag = $tgArr[$instanceNo][5] = substr($bin_4,1,1); + if($DEBUG)echo "
      atFlag=$atFlag"; + + $lpFlag = $tgArr[$instanceNo][7] = substr($bin_4,0,1); + + $netType = $tgArr[$instanceNo][8] = HexDec(substr($initValue,10,2)); + if($DEBUG)echo "
      netType$netType"; + + $hex_6 = substr($initValue,12,2); + if($DEBUG)echo "
      hex_6=$hex_6"; + $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); + if($DEBUG)echo "
      bin_6=$bin_6"; + + $cirType = $tgArr[$instanceNo][9] = BinDec(substr($bin_6,6,2)); + if($DEBUG)echo "
      cirType=$cirType"; + + $backFlag = $tgArr[$instanceNo][10] = substr($bin_6,5,1); + if($DEBUG)echo "
      backFlag=$backFlag"; + + $tgLct = $tgArr[$instanceNo][11] = BinDec(substr($bin_6,0,2)); + if($DEBUG)echo "
      tgLct=$tgLct"; + + $mptyFlag = $tgArr[$instanceNo][12] = BinDec(substr($bin_6,2,1)); + if($DEBUG)echo "
      mptyFlag=$mptyFlag"; + + $tgNum = $tgArr[$instanceNo][6] = HexDec(substr($initValue,14,2)); + if($DEBUG)echo "
      tgNum=$tgNum"; + + $tandemFlag = $tgArr[$instanceNo][13] = HexDec(substr($initValue,16,2)); + if (1 < $tgArr[$instanceNo][13]) { + $tgArr[$instanceNo][13] = 1; + } + if($DEBUG) echo "
      tandemFlag={$tgArr[$instanceNo][13]}"; + + $incomingCallType = $tgArr[$instanceNo][14] = HexDec(substr($initValue,18,2)); + if (1 < $tgArr[$instanceNo][14]) { + $tgArr[$instanceNo][14] = 1; + } + if($DEBUG) echo "
      incomingCallType={$tgArr[$instanceNo][14]}"; + +}while($tgRow = @mysqli_fetch_array($tgRes)); + +$wDef = substr($wDef,0,-3); +$wDef = $wDef.")"; +if(strlen($wDef) < 10){ + $wDef = 'instanceNo < 0'; +} +if($DEBUG)echo "
      wDef=$wDef"; +$tgShow[0] = "1"; + +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo "

      "; +echo ""; +?> +"; +echo ""; +echo ""; +echo "$strConfiguration > $strNetwork > $DEFAULT_SYS > $strTrunkGroup"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> +
        + + + + System:"; + echo ""; + echo ""; + if ( TRUE == session_is_registered("tgSetFlag") ) { + echo ""; + }else{ + echo ""; + } + ?> + + + Command:"; + echo ""; + echo ""; + ?> + + + + +
      New: + +
      +

      + + + + + + + + + + + + + + + + + + + + + 0) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + } +} +echo "
      No.FlagToDPCCDRVoiceALT flagALT TGLoopbackNICircuitBack offLocationMPTYTandemIncoming call typeDelete
      $i{$tgFlagArr[$tgArr[$i][0]][remark]}{$tgTypeArr[$tgArr[$i][1]][remark]}{$tgArr[$i][2]} {$cdrFlagArr[$tgArr[$i][3]][remark]}{$voFlagArr[$tgArr[$i][4]][remark]}{$atFlagArr[$tgArr[$i][5]][remark]}{$tgArr[$i][6]} {$lpFlagArr[$tgArr[$i][7]][remark]}{$netTypeArr[$tgArr[$i][8]][remark]}{$cirTypeArr[$tgArr[$i][9]][remark]}{$backFlagArr[$tgArr[$i][10]][remark]}{$tgLocationArr[$tgArr[$i][11]][remark]}{$mptyFlagArr[$tgArr[$i][12]][remark]}{$tandemFlagArr[$tgArr[$i][13]][remark]}{$incomingCallTypeArr[$tgArr[$i][14]][remark]}
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/msc/tgEdit.php b/wxc2_omc/configuration/msc/tgEdit.php new file mode 100755 index 0000000..763b5f3 --- /dev/null +++ b/wxc2_omc/configuration/msc/tgEdit.php @@ -0,0 +1,610 @@ + + +subSysNo=$subSysNo"; +$portNo = $pNum%8; +if($DEBUG)echo "
      portNo=$portNo"; + +$tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IP', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Intercept', 'color' => '#0000FF') +); +$netTypeArr=array( + array('num' => '0', 'remark' => 'International', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Inter-S', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'National ', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'Na-S', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') +); +$cirTypeArr=array( + array('num' => '0', 'remark' => 'Clockwise', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Anti-C', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Odd', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'Even', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') +); + +$tgLocationArr=array( + array('num' => '0', 'remark' => 'MSC-0', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSC-1', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Both', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'Spare', 'color' => '#0000FF') +); + +//Attributes of TG +$oidTg = "2.1.4"; +$pTg = explode(".",$oidTg); +$i = 0; +$wTg = ''; +while(isset($pTg[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pTg[$i]=$pTg[$i]"; + $wTg = $wTg." AND level_$lNum = $pTg[$i] "; + $i++; +} + + +if($set || $add) +{ + if($DEBUG)echo "
      dpc=$dpc"; + $dpc = omc_keep_length($dpc,0,6); + $field_1 = "00".$dpc; + if($DEBUG)echo "
      field_1=$field_1"; + + $hTgType = omc_keep_length(DecBin($tgType),0,3); + + if($add){ + $tgFlag = 1; + } + $field_2 = $lpFlag.$atFlag.$hTgType.$voFlag.$cdrFlag.$tgFlag; + $field_2 = omc_keep_length(DecHex(BinDec($field_2)),0,2); + if($DEBUG)echo "
      field_2=$field_2"; + + $field_3 = omc_keep_length(DecHex($netType),0,2); + if($DEBUG)echo "
      field_3=$field_3"; + + + if($DEBUG)echo "
      cirType=$cirType"; + $hCirType = omc_keep_length(DecBin($cirType),0,2); + + if($DEBUG)echo "
      tgLct=$tgLct"; + $htgLct = omc_keep_length(DecBin($tgLct),0,2); + + if($DEBUG)echo "
      backFlag=$backFlag"; + $field_4 = $htgLct.$mptyFlag."00".$backFlag.$hCirType; + $field_4 = omc_keep_length(DecHex(BinDec($field_4)),0,2); + if($DEBUG)echo "
      field_4=$field_4"; + + if($DEBUG)echo "
      tgNum=$tgNum"; + $field_5 = omc_keep_length(DecHex($tgNum),0,2); + if($DEBUG)echo "
      field_5=$field_5"; + + if($DEBUG)echo "
      tandemFlag=$tandemFlag"; + $field_6 = omc_keep_length(DecHex($tandemFlag),0,2); + if($DEBUG)echo "
      field_6=$field_6"; + + if($DEBUG)echo "
      incomingCallType=$incomingCallType"; + $field_7 = omc_keep_length(DecHex($incomingCallType),0,2); + if($DEBUG)echo "
      field_7=$field_7"; + + $field_10=omc_keep_length(dechex(bindec($radioChannelControl.'00'.$halfRateSpeechV1.$halfRateSpeechV3.$fullRateSpeechV1.$fullRateSpeechV2.$fullRateSpeechV3)),0,2); + + $field_11=omc_keep_length(dechex($sendST_digitFlag),0,2); + + $field_12=omc_keep_length(dechex($ISUP_type),0,2); + + $initValue = $field_1.$field_2.$field_3.$field_4.$field_5.$field_6.$field_7.$field_10.$field_11.$field_12; + $initValue = strtoupper($initValue); + if($DEBUG)echo "
      initValue=$initValue"; + + $uTgSql = " UPDATE $tb_2 set initValue = '$initValue' WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wTg; + if($DEBUG)echo "
      uTgSql=$uTgSql"; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + echo mysqli_error($pubConn); + + echo ""; +} + +$tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND instanceNo = '$tNum' ".$wTg; +if($DEBUG) echo "
      tgSql=$tgSql"; +$tgRes = @mysqli_query($pubConn,$tgSql); +$tgRow = @mysqli_fetch_array($tgRes); +echo mysqli_error($pubConn); + + $instanceNo = $tgRow[instanceNo]; + $initValue = $tgRow[initValue]; + if($DEBUG)echo "
      initValue=$initValue"; + $dpc = substr($initValue,2,6); + if($DEBUG)echo "
      dpc=$dpc"; + + $hex_4 = substr($initValue,8,2); + if($DEBUG)echo "
      hex_4=$hex_4"; + $bin_4 = omc_keep_length(DecBin(HexDec($hex_4)),0,8); + if($DEBUG)echo "
      bin_4=$bin_4"; + + $tgFlag = substr($bin_4,7,1); + if($DEBUG)echo "
      tgFlag=$tgFlag"; + + $cdrFlag = substr($bin_4,6,1); + if($DEBUG)echo "
      cdrFlag=$cdrFlag"; + + $voFlag = substr($bin_4,5,1); + if($DEBUG)echo "
      voFlag=$voFlag"; + + $tgType = BinDec(substr($bin_4,2,3)); + if($DEBUG)echo "
      tgType=$tgType"; + + $atFlag = substr($bin_4,1,1); + if($DEBUG)echo "
      atFlag=$atFlag"; + + $lpFlag = substr($bin_4,0,1); + + $netType = HexDec(substr($initValue,10,2)); + if($DEBUG)echo "
      netType=$netType"; + + $hex_6 = substr($initValue,12,2); + if($DEBUG)echo "
      hex_6=$hex_6"; + $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); + if($DEBUG)echo "
      bin_6=$bin_6"; + + $cirType = BinDec(substr($bin_6,6,2)); + if($DEBUG)echo "
      cirType=$cirType"; + + $backFlag = substr($bin_6,5,1); + if($DEBUG)echo "
      backFlag=$backFlag"; + + $tgLct = BinDec(substr($bin_6,0,2)); + if($DEBUG)echo "
      tgArr[$instanceNo][11]={$tgArr[$instanceNo][11]}"; + + $mptyFlag = BinDec(substr($bin_6,2,1)); + if($DEBUG)echo "
      mptyFlag=$mptyFlag"; + + $hex_8 = substr($initValue,16,2); + if($DEBUG)echo "
      hex_8=$hex_8"; + $tandemFlag = hexdec($hex_8); + if($DEBUG)echo "
      tandemFlag=$tandemFlag"; + + $tgNum = HexDec(substr($initValue,14,2)); + if($DEBUG)echo "
      tgNum=$tgNum"; + + $incomingCallType=HexDec(substr($initValue,18,2)); + if($DEBUG)echo "
      incomingCallType=$incomingCallType"; + + $hex_10=substr($initValue,20,2); + if($DEBUG)echo "
      hex_10=$hex_10"; + $bin_10=omc_keep_length(DecBin(HexDec($hex_10)),0,8); + if($DEBUG)echo "
      bin_10=$bin_10"; + + $radioChannelControl=substr($bin_10,0,1); + if($DEBUG)echo "
      radioChannelControl=$radioChannelControl"; + + $halfRateSpeechV1=substr($bin_10,3,1); + if($DEBUG)echo "
      halfRateSpeechV1=$halfRateSpeechV1"; + + $halfRateSpeechV3=substr($bin_10,4,1); + if($DEBUG)echo "
      halfRateSpeechV3=$halfRateSpeechV3"; + + $fullRateSpeechV1=substr($bin_10,5,1); + if($DEBUG)echo "
      fullRateSpeechV1=$fullRateSpeechV1"; + + $fullRateSpeechV2=substr($bin_10,6,1); + if($DEBUG)echo "
      fullRateSpeechV2=$fullRateSpeechV2"; + + $fullRateSpeechV3=substr($bin_10,7,1); + if($DEBUG)echo "
      fullRateSpeechV3=$fullRateSpeechV3"; + + + $sendST_digitFlag=HexDec(substr($initValue,22,2)); + if($DEBUG)echo "
      sendST_digitFlag=$sendST_digitFlag"; + + $ISUP_type=HexDec(substr($initValue,24,2)); + if($DEBUG)echo "
      ISUP_type=$ISUP_type"; + + + //$hiddenValue=substr($initValue,20,6); + //if($DEBUG)echo "
      hiddenValue=$hiddenValue"; + + +echo "
      "; +echo ""; + +if($oType){ + $tgFlagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wTg." ORDER BY instanceNo "; + if($DEBUG)echo "
      tgFlagSql=$tgFlagSql"; + $tgFlagRes = @mysqli_query($pubConn,$tgFlagSql); + $tgFlagRow = @mysqli_fetch_array($tgFlagRes); + echo mysqli_error($pubConn); + do + { + $instanceNo = $tgFlagRow[instanceNo]; + $initValue = $tgFlagRow[initValue]; + if($DEBUG)echo "
      initValue=$initValue"; + + $hex_4 = substr($initValue,8,2); + if($DEBUG)echo "
      hex_4=$hex_4"; + $bin_4 = omc_keep_length(DecBin(HexDec($hex_4)),0,8); + if($DEBUG)echo "
      bin_4=$bin_4"; + + $tgFlag = $tgFlagArr[$instanceNo][0] = substr($bin_4,7,1); + //echo "
      tgFlag=$tgFlag"; + }while($tgFlagRow = @mysqli_fetch_array($tgFlagRes)); + + + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + +}else{ + echo ""; + echo ""; + echo ""; +} +echo ""; +echo ""; +if($tgFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +if($cdrFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($voFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($atFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +if($lpFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +if($backFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +if($mptyFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($tandemFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($incomingCallType){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; + +if($radioChannelControl){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($fullRateSpeechV3){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($fullRateSpeechV2){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($fullRateSpeechV1){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($halfRateSpeechV3){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($halfRateSpeechV1){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($sendST_digitFlag){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +if($ISUP_type){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo "
      Add trunk group
      Trunk group#"; + echo ""; + echo "
      Trunk group $tNum
      TG flagYes"; + echo "No Yes"; + echo "No 
      Category"; +echo ""; +echo "
      DPC
      CDROn "; + echo "OffOn "; + echo "Off
      AnnouncementOn "; + echo "OffOn "; + echo "Off
      Alternative TG flagYes"; + echo "No Yes"; + echo "No 
      Alternative TG
      Incoming loopbackYes"; + echo "No Yes"; + echo "No 
      Network indicator"; +echo ""; +echo "
      Circuit selection"; +echo ""; +echo "
      Collision back offOn "; + echo "OffOn "; + echo "Off
      Location"; +echo ""; +echo "
      MPTY enableYes"; + echo "No Yes"; + echo "No 
      Tandem restrictionYes"; + echo "No Yes"; + echo "No 
      Incoming call typeIn "; + echo "NormalIn "; + echo "Normal
      Radio Channel ControlControl By Operator "; + echo "Control By MSControl By Operator "; + echo "Control By MS
      Full Rate speech V3Enable "; + echo "DisableEnable "; + echo "Disable
      Full Rate speech V2Enable "; + echo "DisableEnable "; + echo "Disable
      Full Rate speech V1Enable "; + echo "DisableEnable "; + echo "Disable
      Half Rate speech V3Enable "; + echo "DisableEnable "; + echo "Disable
      Half Rate speech V1Enable "; + echo "DisableEnable "; + echo "Disable
      Send ST digit flagEnable "; + echo "DisableEnable "; + echo "Disable
      ISUP_typeANSI "; + echo "ITUANSI "; + echo "ITU
      "; +//echo "
      Remark:"; +echo "
      "; +if($oType){ + echo ""; + echo "  "; +}else{ + echo ""; + echo "  "; + echo ""; +} +echo ""; +echo ""; +echo ""; + +//echo ""; + +echo "
      "; +?> +Remarks:

      +TG number: Trunk group number, ranging from 0 to 255 (for new trunk group)

      +TG flag: Y=TG enable, N=TG disable

      +Category: PSTN=to PSTN, IP=to VMS and VPS, HPLMN=to HPLMN, VPLMN=to VPLMN, SUB=to BSC

      +DPC: Destination point code of this trunk group

      +CDR: CDR on or off option for this trunk group

      +Announcement (Voice): Voice announcement enable or disable for this trunk group

      +Alternative TG flag (ALT flag): Alternative trunk group enable or disable option

      +Alternative TG (ALT TG): Alternative trunk group for backup purpose

      +Loop back: Incoming call loop back enable or disable, used for MSC loop back

      +Network indicator (NI): Specify network type: International, International spare (Inter-s), National, National spare (Na-s)

      +Circuit selection (Circuit): Preferred circuit selection mode, include clockwise, anti-clockwise, odd and even

      +Collision back off (Back off): Back off on or off when simultaneously select the same channel with the opposite side

      +Location: For normal trunk group, select Both. For a trunk group to a VPS, configure this trunk group as MSC0 or MSC1

      +MPTY enable (MPTY): Multi-party call flag, Yes=enable, No=disable. For all trunk groups to BSC, select Yes

      +Tandem restriction:
      +Y: Tandem disabled. Not support transit call from PSTN to PSTN via this trunk group
      +N: Tandem enabled. Support transit call from PSTN to PSTN via this trunk group + + + + \ No newline at end of file diff --git a/wxc2_omc/configuration/mscSync/getFile b/wxc2_omc/configuration/mscSync/getFile new file mode 100755 index 0000000..43b9de9 --- /dev/null +++ b/wxc2_omc/configuration/mscSync/getFile @@ -0,0 +1,25 @@ +#!/bin/bash + +ip=$1 +fileName=$2 + +ftpUserNameStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPUserName'; +_EOF_` + +ftpPasswordStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPPassword'; +_EOF_` + +ftpUserName=`echo $ftpUserNameStr | awk '{print $2}'` +ftpPassword=`echo $ftpPasswordStr | awk '{print $2}'` + +ftp -n >>result.txt <<__CTL_END +open $ip +user $ftpUserName $ftpPassword +bin +cd /usr/local/wxc2/bin/conf/ +get $fileName +bye +__CTL_END + diff --git a/wxc2_omc/configuration/mscSync/mscSync.php b/wxc2_omc/configuration/mscSync/mscSync.php new file mode 100755 index 0000000..8784fb1 --- /dev/null +++ b/wxc2_omc/configuration/mscSync/mscSync.php @@ -0,0 +1,276 @@ + + + + + + +"; +echo ""; +echo ""; +echo "Maintenance > Control Panel > MSS Sync "; +echo ""; +echo ""; +$helpId="2.58"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + + + //show the page + echo "

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      MSS Configuration Synchronization
      "; + if($operation==1) + { + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + } + echo "
      Warning: This operation will overwrite the MSS configuration data on the target server.
      "; + + $ftpInfo=getMSSFtpAccount(); + + if($operation==1) + { + //start + if($direction==0) + { + echo "

      Start to synchronize from MSS-0 to MSS-1
      "; + insertLog("Synchronize conf files from MSS-0 to MSS-1"); + } + else + { + echo "

      Start to synchronize from MSS-1 to MSS-0
      "; + insertLog("Synchronize conf files from MSS-1 to MSS-0"); + } + echo "The operation will last many minutes, please wait...
      "; + + flush(); + //check the heartbeat of mss-0 + echo "Check the connection to MSS-0..."; + flush(); + $database="OMC_PUB"; + $selSql = "SELECT ip FROM sysInfo where sysTypeNo=320 and sysNo=0 and baseStat=1 "; + $selRes = @mysqli_query($pubConn,$selSql); + $count=0; + $count=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + $mss_0_ip=""; + if($count==1) + { + echo "successful
      "; + $selRow = @mysqli_fetch_array($selRes); + $mss_0_ip=$selRow[ip]; + //echo "mss_0_ip=$mss_0_ip
      "; + } + else + { + echo "failed
      "; + echo "The MSS-0 is unavailable
      "; + back(); + } + flush(); + //check the heartbeat of mss-1 + echo "Check the connection to MSS-1..."; + flush(); + $database="OMC_PUB"; + $selSql = "SELECT ip FROM sysInfo where sysTypeNo=320 and sysNo=1 and baseStat=1 "; + $selRes = @mysqli_query($pubConn,$selSql); + $count=0; + $count=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + $mss_1_ip=""; + if($count==1) + { + echo "successful
      "; + $selRow = @mysqli_fetch_array($selRes); + $mss_1_ip=$selRow[ip]; + //echo "mss_1_ip=$mss_1_ip
      "; + } + else + { + echo "failed
      "; + echo "The MSS-1 is unavailable
      "; + back(); + } + flush(); + //get the conf file from mss + /* + $mss_conf_file=array("msc_art.conf", + "msc_conf", + "msc_cua.conf", + "msc_dps.conf", + "msc_la.conf", + "msc_mg.conf", + "msc_rzs.conf", + "msc_system.conf", + //"none.conf", + "msc_tg.conf"); + */ + + $get_mss_ip=""; + $put_mss_ip=""; + if($direction==0) + { + $get_mss_ip=$mss_0_ip; + $put_mss_ip=$mss_1_ip; + $get_msc_name="MSS-0"; + $put_msc_name="MSS-1"; + } + else + { + $get_mss_ip=$mss_1_ip; + $put_mss_ip=$mss_0_ip; + $get_msc_name="MSS-1"; + $put_msc_name="MSS-0"; + } + + //get the conf file list by ftp + $conn_id=ftp_connect($get_mss_ip); + if($conn_id == FALSE) + { + echo "FTP:connect to $get_mss_ip failed.
      "; + back(); + } + if(FALSE == ftp_login($conn_id,$ftpinfo[UserName],$ftpinfo[Password])) + { + echo "FTP:login to $get_mss_ip failed.
      "; + back(); + } + + $contents=ftp_rawlist($conn_id, "/usr/local/wxc2/bin/conf/"); + foreach ($contents as $entry) + { + $part=explode(" ",$entry); + if(!strstr($part[0],"d")) + { + $mss_conf_file[]=$part[sizeof($part)-1]; + } + } + ftp_close($conn_id); + + //get conf file + for($i=0;$i".$mss_conf_file[$i]." from $get_msc_name...successful
      "; + } + else + { + echo "Get conf file ".$mss_conf_file[$i]." from $get_msc_name...failed
      "; + echo "The operation is failed.
      "; + back(); + } + flush(); + system("rm -rf result.txt"); + } + + //change the privilege and stop msc + echo "
      Prepare to update the conf file into ".$put_msc_name."
      "; + echo "Stop the ".$put_msc_name."..."; + flush(); + system("./stopMsc ".$put_mss_ip); + echo "successful
      "; + flush(); + + //put file + for($i=0;$i".$mss_conf_file[$i]." to $put_msc_name...successful
      "; + } + else + { + echo "Put conf file ".$mss_conf_file[$i]." to $put_msc_name...failed
      "; + } + flush(); + system("rm -rf {$mss_conf_file[$i]}"); + } + + //change the privilege and stop msc + echo "Start the ".$put_msc_name."..."; + flush(); + system("./startMsc ".$put_mss_ip); + echo "successful
      "; + flush(); + + + echo "The operation is successful.
      "; + back(); + } + + + + + //function define + function back() + { + global $mss_conf_file; + for($i=0;$iBack"; + exit; + } +adjust_content_tail(); +?> diff --git a/wxc2_omc/configuration/mscSync/put b/wxc2_omc/configuration/mscSync/put new file mode 100755 index 0000000..9c1df99 --- /dev/null +++ b/wxc2_omc/configuration/mscSync/put @@ -0,0 +1,26 @@ +#!/bin/bash + +ip=$1 +fileName=$2 + +ftpUserNameStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPUserName'; +_EOF_` + +ftpPasswordStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPPassword'; +_EOF_` + +ftpUserName=`echo $ftpUserNameStr | awk '{print $2}'` +ftpPassword=`echo $ftpPasswordStr | awk '{print $2}'` + + +ftp -n >>result.txt <<__CTL_END +open $ip +user $ftpUserName $ftpPassword +bin +cd /tmp/ +put $fileName +bye +__CTL_END + diff --git a/wxc2_omc/configuration/mscSync/putFile b/wxc2_omc/configuration/mscSync/putFile new file mode 100755 index 0000000..5f5e04b --- /dev/null +++ b/wxc2_omc/configuration/mscSync/putFile @@ -0,0 +1,26 @@ +#!/bin/bash + +ip=$1 +fileName=$2 + +ftpUserNameStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPUserName'; +_EOF_` + +ftpPasswordStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPPassword'; +_EOF_` + +ftpUserName=`echo $ftpUserNameStr | awk '{print $2}'` +ftpPassword=`echo $ftpPasswordStr | awk '{print $2}'` + + +ftp -n >>result.txt <<__CTL_END +open $ip +user $ftpUserName $ftpPassword +bin +cd /usr/local/wxc2/bin/conf/ +put $fileName +bye +__CTL_END + diff --git a/wxc2_omc/configuration/mscSync/startMsc b/wxc2_omc/configuration/mscSync/startMsc new file mode 100755 index 0000000..82e8c6b --- /dev/null +++ b/wxc2_omc/configuration/mscSync/startMsc @@ -0,0 +1,54 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="$1" + + +ftpUserNameStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPUserName'; +_EOF_` + +ftpPasswordStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPPassword'; +_EOF_` + +ftpUserName=`echo $ftpUserNameStr | awk '{print $2}'` +ftpPassword=`echo $ftpPasswordStr | awk '{print $2}'` + + +inp1="$ftpUserName" +inp2="$ftpPassword" + +inputfile="inabc" +outputfile="out.log" + +chmodcnf_0="chmod 755 /usr/local/wxc2/bin/conf" +chmodcnf="chmod 755 /usr/local/wxc2/bin/conf/*" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & +sleep 2; echo $inp1 >>$inputfile +sleep 2; echo $inp2 >>$inputfile + +#tail -f $outputfile & + +sleep 3; echo "su -" >>$inputfile +sleep 2; echo "Acrdr00t!" >>$inputfile +sleep 2; echo $chmodcnf_0 >>$inputfile +sleep 2; echo $chmodcnf >>$inputfile +sleep 2; echo "wxc2d start" >>$inputfile +sleep 2; echo "exit" >>$inputfile +sleep 2; echo "exit" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + diff --git a/wxc2_omc/configuration/mscSync/stopMsc b/wxc2_omc/configuration/mscSync/stopMsc new file mode 100755 index 0000000..4b8b628 --- /dev/null +++ b/wxc2_omc/configuration/mscSync/stopMsc @@ -0,0 +1,53 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="$1" + +ftpUserNameStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPUserName'; +_EOF_` + +ftpPasswordStr=`/usr/bin/mysql -prootaa <<_EOF_ +SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName='globalFTPPassword'; +_EOF_` + +ftpUserName=`echo $ftpUserNameStr | awk '{print $2}'` +ftpPassword=`echo $ftpPasswordStr | awk '{print $2}'` + + +inp1="$ftpUserName" +inp2="$ftpPassword" + +inputfile="inabc" +outputfile="out.log" + +chmodcnf_0="chmod 777 /usr/local/wxc2/bin/conf" +chmodcnf="chmod 777 /usr/local/wxc2/bin/conf/*" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & +sleep 2; echo $inp1 >>$inputfile +sleep 2; echo $inp2 >>$inputfile + +#tail -f $outputfile & + +sleep 3; echo "su -" >>$inputfile +sleep 2; echo "Acrdr00t!" >>$inputfile +sleep 2; echo "wxc2d stop" >>$inputfile +sleep 2; echo $chmodcnf_0 >>$inputfile +sleep 2; echo $chmodcnf >>$inputfile +sleep 2; echo "exit" >>$inputfile +sleep 2; echo "exit" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + diff --git a/wxc2_omc/configuration/nibConf/beforeClearSubs b/wxc2_omc/configuration/nibConf/beforeClearSubs new file mode 100755 index 0000000..098b9e6 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/beforeClearSubs @@ -0,0 +1,39 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="$1" +inp1="ems " +inp2="Ems123! " + +inputfile="inabc" +outputfile="out.log" +delbak="rm -f /usr/local/backup/*" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & +sleep 2; echo $inp1 >>$inputfile +sleep 2; echo $inp2 >>$inputfile + +#tail -f $outputfile & + +sleep 3; echo "su -" >>$inputfile +sleep 2; echo "rootaa" >>$inputfile +sleep 2; echo "wxc2d stop" >>$inputfile +sleep 2; echo $delbak >>$inputfile +sleep 2; echo "exit" >>$inputfile +sleep 2; echo "exit" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + +#ps -ef | grep telnet | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh +#ps -ef | grep tail | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh diff --git a/wxc2_omc/configuration/nibConf/beforeFtp b/wxc2_omc/configuration/nibConf/beforeFtp new file mode 100755 index 0000000..d606c6d --- /dev/null +++ b/wxc2_omc/configuration/nibConf/beforeFtp @@ -0,0 +1,46 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="$1" +inp1="ems " +inp2="Ems123! " + +inputfile="inabc" +outputfile="out.log" + +chmodbak_0="chmod -R 777 /usr/local/backup/" +chmodbak="chmod -R 666 /usr/local/backup/*" +chmodcnf_0="chmod -R 777 /usr/local/wxc2/bin/conf/" +chmodcnf="chmod -R 666 /usr/local/wxc2/bin/conf/*" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & +sleep 2; echo $inp1 >>$inputfile +sleep 2; echo $inp2 >>$inputfile + +#tail -f $outputfile & + +sleep 3; echo "su -" >>$inputfile +sleep 2; echo "rootaa" >>$inputfile +sleep 2; echo "wxc2d stop" >>$inputfile +sleep 2; echo $chmodbak_0 >>$inputfile +sleep 2; echo $chmodbak >>$inputfile +sleep 2; echo $chmodcnf_0 >>$inputfile +sleep 2; echo $chmodcnf >>$inputfile +sleep 2; echo "exit" >>$inputfile +sleep 2; echo "exit" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + +#ps -ef | grep telnet | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh +#ps -ef | grep tail | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh diff --git a/wxc2_omc/configuration/nibConf/bssPara/BssGb.db b/wxc2_omc/configuration/nibConf/bssPara/BssGb.db new file mode 100755 index 0000000..ab5b9b0 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/bssPara/BssGb.db differ diff --git a/wxc2_omc/configuration/nibConf/bssPara/abis.db b/wxc2_omc/configuration/nibConf/bssPara/abis.db new file mode 100755 index 0000000..0eb04fa Binary files /dev/null and b/wxc2_omc/configuration/nibConf/bssPara/abis.db differ diff --git a/wxc2_omc/configuration/nibConf/bssPara/aifadmin.db b/wxc2_omc/configuration/nibConf/bssPara/aifadmin.db new file mode 100755 index 0000000..37f36ae Binary files /dev/null and b/wxc2_omc/configuration/nibConf/bssPara/aifadmin.db differ diff --git a/wxc2_omc/configuration/nibConf/bssPara/bscadmin.db b/wxc2_omc/configuration/nibConf/bssPara/bscadmin.db new file mode 100755 index 0000000..a188e41 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/bssPara/bscadmin.db differ diff --git a/wxc2_omc/configuration/nibConf/bssPara/calltrc.db b/wxc2_omc/configuration/nibConf/bssPara/calltrc.db new file mode 100755 index 0000000..287558f Binary files /dev/null and b/wxc2_omc/configuration/nibConf/bssPara/calltrc.db differ diff --git a/wxc2_omc/configuration/nibConf/bssPara/frmgr.db b/wxc2_omc/configuration/nibConf/bssPara/frmgr.db new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/configuration/nibConf/bssPara/sysmon.db b/wxc2_omc/configuration/nibConf/bssPara/sysmon.db new file mode 100755 index 0000000..8633a4f Binary files /dev/null and b/wxc2_omc/configuration/nibConf/bssPara/sysmon.db differ diff --git a/wxc2_omc/configuration/nibConf/bssPara/trkadmin.db b/wxc2_omc/configuration/nibConf/bssPara/trkadmin.db new file mode 100755 index 0000000..aac5c18 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/bssPara/trkadmin.db differ diff --git a/wxc2_omc/configuration/nibConf/bssReboot b/wxc2_omc/configuration/nibConf/bssReboot new file mode 100755 index 0000000..d51dfa5 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/bssReboot @@ -0,0 +1,30 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="$1" + +inputfile="inabc" +outputfile="out.log" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & + +#tail -f $outputfile & + +sleep 2; echo "reboot" >>$inputfile +sleep 2; echo "logout" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + +#ps -ef | grep telnet | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh +#ps -ef | grep tail | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh diff --git a/wxc2_omc/configuration/nibConf/cfg b/wxc2_omc/configuration/nibConf/cfg new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/configuration/nibConf/configureForBss.php b/wxc2_omc/configuration/nibConf/configureForBss.php new file mode 100755 index 0000000..a82ba21 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/configureForBss.php @@ -0,0 +1,634 @@ + + +selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); + +$tmpSn=$snStart; +while($selRows=mysqli_fetch_array($selResult)){ + $localNodeMsisdn=$cc.$ndc.$tmpSn; + $localNodeMsisdn=omc_keep_length($localNodeMsisdn,'F',20,0); + if($selRows[level_3]==4||$selRows[level_3]==21) + $localNode='02'.$localNodeMsisdn.'AC128001'.'FFFFFFFF'; + else + $localNode='02'.$localNodeMsisdn.'AC126201'.'FFFFFFFF'; + + $updateSql="UPDATE OBJ_223.param_99 SET initValue='$localNode',readValue='' + WHERE level_1='2' AND level_2='1' AND level_3='$selRows[level_3]'"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + $tmpSn++; +} + +//hlr gtt +//imsi +//01064600200000000000FFFF4600299999999990FFFF03000064060107000000FFFFFFFFFFFFFFFFFFFF +$gtt='0106'; +$tmpImsiStart=omc_keep_length($imsiStart,'F',20,0); +$gtt=$gtt.$tmpImsiStart; +$tmpImsiEnd=omc_keep_length($imsiEnd,'F',20,0); +$gtt=$gtt.$tmpImsiEnd; +$gtt=$gtt.'03000064060007000000FFFFFFFFFFFFFFFFFFFF'; + +$updateSql="UPDATE OBJ_223.param_99 SET initValue='$gtt',readValue='' + WHERE level_1='2' AND level_2='2' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//hlr gtt +//msisdn +//0101867559000000FFFFFFFF86755999999FFFFFFFFF03000064060107000000FFFFFFFFFFFFFFFFFFFF +if($msrnStart>$msisdnStart+20){ + $gtt='0101'; + $tmpMsisdnStart=$msisdnStart+20; + $tmpMsisdnStart=omc_keep_length($tmpMsisdnStart,'F',20,0); + $gtt=$gtt.$tmpMsisdnStart; + $tmpMsisdnEnd=$msrnStart-1; + $tmpMsisdnEnd=omc_keep_length($tmpMsisdnEnd,'F',20,0); + $gtt=$gtt.$tmpMsisdnEnd; + $gtt=$gtt.'03000064060007000000FFFFFFFFFFFFFFFFFFFF'; + + $updateSql="UPDATE OBJ_223.param_99 SET initValue='$gtt',readValue='' + WHERE level_1='2' AND level_2='2' AND instanceNo='1'"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); +}else{ + $updateSql="UPDATE OBJ_223.param_99 SET initValue='0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000FFFFFFFFFFFFFFFFFFFF',readValue='' + WHERE level_1='2' AND level_2='2' AND instanceNo='1'"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); +} + +if($msrnEnd<$msisdnEnd){ + + $gtt='0101'; + $tmpMsisdnStart=$msrnEnd+1; + $tmpMsisdnStart=omc_keep_length($tmpMsisdnStart,'F',20,0); + $gtt=$gtt.$tmpMsisdnStart; + $tmpMsisdnEnd=omc_keep_length($msisdnEnd,'F',20,0); + $gtt=$gtt.$tmpMsisdnEnd; + $gtt=$gtt.'03000064060007000000FFFFFFFFFFFFFFFFFFFF'; + + $updateSql="UPDATE OBJ_223.param_99 SET initValue='$gtt',readValue='' + WHERE level_1='2' AND level_2='2' AND instanceNo='2'"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); +}else{ + $updateSql="UPDATE OBJ_223.param_99 SET initValue='0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000FFFFFFFFFFFFFFFFFFFF',readValue='' + WHERE level_1='2' AND level_2='2' AND instanceNo='2'"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); +} + + +//xapp parameters +//mcc +$tmpMcc=omc_keep_length($mcc,'E',4,0); +$updateSql="UPDATE OBJ_225.param_99 SET initValue='$tmpMcc',readValue='' + WHERE level_1='2' AND level_2='1' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//mnc +$tmpMnc=omc_keep_length($mnc,'E',4,0); +$updateSql="UPDATE OBJ_225.param_99 SET initValue='$tmpMnc',readValue='' + WHERE level_1='2' AND level_2='2' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//cc +$tmpCc=omc_keep_length($cc,'E',4,0); +$updateSql="UPDATE OBJ_225.param_99 SET initValue='$tmpCc',readValue='' + WHERE level_1='2' AND level_2='3' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//ndc +$tmpNdc=omc_keep_length($ndc,'E',6,0); +$updateSql="UPDATE OBJ_225.param_99 SET initValue='$tmpNdc',readValue='' + WHERE level_1='2' AND level_2='4' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//international prefix +$tmpInternationalPrefix=omc_keep_length($internationalPrefix,'E',4,0); +$updateSql="UPDATE OBJ_225.param_99 SET initValue='$tmpInternationalPrefix',readValue='' + WHERE level_1='2' AND level_2='5' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//national prefix +$tmpNationalPrefix=omc_keep_length($nationalPrefix,'E',4,0); +$updateSql="UPDATE OBJ_225.param_99 SET initValue='$tmpNationalPrefix',readValue='' + WHERE level_1='2' AND level_2='6' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//VLR parameters +//MSRN +$msrn=omc_keep_length($msrnStart,'F',16,0).omc_keep_length($msrnEnd,'F',16,0); +$updateSql="UPDATE OBJ_325.param_99 SET initValue='$msrn',readValue='' + WHERE level_1='2' AND level_2='1' AND level_3='13' AND instanceNo='0'"; +if($DEBUG) + echo "
      updateSql=$updateSql"; +mysqli_query($pubConn,$updateSql); + + +//SMSC parameters +//MSISDN +$tmpMsisdnStart=$msisdnStart+20; +$tmpMsisdnEnd=$msrnStart-1; +$tmpMsisdn=omc_keep_length($tmpMsisdnStart,'E',18,0).omc_keep_length($tmpMsisdnEnd,'E',18,0); +$updateSql="UPDATE OBJ_350.param_99 SET initValue='$tmpMsisdn',readValue='' + WHERE level_1='2' AND level_2='1' AND level_3='4' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +$tmpMsisdnStart=$msrnEnd+1; + +$tmpMsisdn=omc_keep_length($tmpMsisdnStart,'E',18,0).omc_keep_length($msisdnEnd,'E',18,0); +$updateSql="UPDATE OBJ_350.param_99 SET initValue='$tmpMsisdn',readValue='' + WHERE level_1='2' AND level_2='1' AND level_3='4' AND instanceNo='1'"; +mysqli_query($pubConn,$updateSql); + +/**************MSC Prefix*********************************/ +//MSC-MSRN-Prefix +$tmpMsrn=''; +for($i=0;$i + + 'SCCP parameters','sysTypeNo' => '223','sysId' => '223_99_99', 'oid' => '2'), + array('remark' => 'XAPP parameters','sysTypeNo' => '225','sysId' => '225_99_99', 'oid' => '2'), + array('remark' => 'MSC parameters','sysTypeNo' => '322','sysId' => '322_99_99', 'oid' => '2.1'), + array('remark' => 'VLR parameters','sysTypeNo' => '325','sysId' => '325_99_99', 'oid' => '2.1.13'), + array('remark' => 'SMSC parameters','sysTypeNo' => '350','sysId' => '350_99_99', 'oid' => '2.1.4') + ); + + //send set command + echo "
      Setting parameters to MSS!
      "; + $commStr=''; + for($i=0;$isysId={$setForBssArr[$i][sysId]},oid={$setForBssArr[$i][oid]},value={$setForBssArr[$i][value]}"; + $tmpCommStr=sysCommSend($setForBssArr[$i][sysId],$nSetComm,$setForBssArr[$i][oid]); + if($DEBUG)echo "
      tmpCommStr=$tmpCommStr"; + $commStr.=$tmpCommStr; + if($DEBUG)echo "
      commStr=$commStr"; + } + + //check the command status + if($commStr==""){ + echo "
      Send the command error, Please check the device state!
      "; + require("./display.php"); + exit(); + } + + $cmmIdStrArr=explode("-",$commStr); + + for($i=0;$i $maxNum){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + echo "Error: $tmpRemark."; + require("./display.php"); + exit(); + } + + echo ""; + flush(); + + $selComm = "SELECT commState,remark,objId,sysTypeNo FROM $sysCommTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes)>0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpOid=$selRow[objId]; + $tmpSysTypeNo=$selRow[sysTypeNo]; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + for($j=0;$jError: $tmpRemark.({$setForBssArr[$j][remark]})"; + + } + require("./display.php"); + exit(); + } + + $selComm = "SELECT commState,remark FROM $sysCommTable WHERE $tmpWhere AND (commState='$nWaitProc' OR commState='$nInProc')"; + + if($DEBUG) + echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + break; + } + +sleep(2); + //send save command + $commStr=''; + for($i=0;$isysId={$saveCmdArr[$i][sysId]},oid={$saveCmdArr[$i][oid]},value={$saveCmdArr[$i][value]}"; + setSysParamValue($saveCmdArr[$i][sysId],$saveCmdArr[$i][oid],'0',$saveCmdArr[$i][value]); + $tmpCommStr=sysCommSend($saveCmdArr[$i][sysId],$nSetComm,$saveCmdArr[$i][oid]); + if($DEBUG)echo "
      tmpCommStr=$tmpCommStr"; + $commStr.=$tmpCommStr; + if($DEBUG)echo "
      commStr=$commStr"; + } + + //check the command status + if($commStr==""){ + echo "
      Send the command error, Please check the device state!
      "; + require("./display.php"); + exit(); + } + + $cmmIdStrArr=explode("-",$commStr); + + for($i=0;$i $maxNum){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + echo "Error: $tmpRemark."; + require("./display.php"); + exit(); + } + echo ""; + flush(); + + $selComm = "SELECT commState,remark,objId,sysTypeNo FROM $sysCommTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes)>0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpOid=$selRow[objId]; + $tmpSysTypeNo=$selRow[sysTypeNo]; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + for($j=0;$jError: $tmpRemark.({$resetCommArr[$j][remark]})"; + } + require("./display.php"); + exit(); + } + + $selComm = "SELECT commState,remark FROM $sysCommTable WHERE $tmpWhere AND (commState='$nWaitProc' OR commState='$nInProc')"; + + if($DEBUG)echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + echo "Finished"; + break; + } + + + $getSysIdSql = "SELECT * FROM $sysInfoTable + WHERE sysTypeNo='320' + ORDER BY baseStat DESC,updateTime DESC"; + + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult=mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + + while($getSysIdRows=mysqli_fetch_array($getSysIdResult)){ + $dstSeverIp=$getSysIdRows[ip]; + echo "
      Restarting MSS,please wait about 6 minutes!
      "; + flush(); + $tmpScript="./beforeClearSubs".' '.$dstSeverIp; + system($tmpScript); + + //clear heartbeat + $delSql="DELETE FROM OMC_PUB.sysStat"; + mysqli_query($pubConn,$delSql); + + for($i=0;$i<30;$i++){ + echo ""; + flush(); + sleep(4); + } + + $tmpScript="./mssStart".' '.$dstSeverIp; + system($tmpScript); + + for($i=0;$i<45;$i++){ + $tmpSql = "SELECT * FROM OMC_PUB.sysStat WHERE sysTypeNo='200' AND sysNo='9'"; + + if($DEBUG) echo "
      tmpSql=$tmpSql"; + $tmpResult=mysqli_query($pubConn,$tmpSql); + echo mysqli_error($pubConn); + if(mysqli_num_rows($tmpResult)>0) + break; + sleep(4); + echo ""; + flush(); + } + if($i==30) + echo "Starting MSS failed,please check it"; + else + echo "Finished"; + } + echo "
      Process finished
      "; +?> diff --git a/wxc2_omc/configuration/nibConf/configureForPstn.php b/wxc2_omc/configuration/nibConf/configureForPstn.php new file mode 100755 index 0000000..0747480 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/configureForPstn.php @@ -0,0 +1,532 @@ + + +selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); + +switch($ni){ + case 0: + $tmpValue=setBitValue($selRows[initValue],'0.0',0); + break; + case 1: + $tmpValue=setBitValue($selRows[initValue],'0.2',0); + break; + case 2: + $tmpValue=setBitValue($selRows[initValue],'0.0',1); + break; + case 3: + $tmpValue=setBitValue($selRows[initValue],'0.2',1); + break; + default: + break; +} + +$updateSql="UPDATE OBJ_222.param_99 SET initValue='$tmpValue' WHERE level_1='2' AND level_2='2'"; +if($DEBUG)echo "
      updateSql=$updateSql"; +mysqli_query($pubConn,$updateSql); + +$levelWhere = getLevelWhere($NetOPCArr[$ni][0]); +$opc=omc_keep_length($opc,'0',6); + +$updateSql="UPDATE OBJ_222.param_99 SET initValue='$opc',readValue='' WHERE $levelWhere"; +if($DEBUG)echo "
      updateSql=$updateSql"; +mysqli_query($pubConn,$updateSql); + +//Routing +$dpc=omc_keep_length($dpc,'0',6); +$tmpRouting=$dpc.'00'.'80'; + +switch($ni){ + case 0: + case 2: + $updateSql="UPDATE OBJ_222.param_99 SET initValue='$tmpRouting',readValue='' + WHERE level_1='2' AND level_2='6' AND level_3='1' AND instanceNo='0'"; + break; + case 1: + case 3: + $updateSql="UPDATE OBJ_222.param_99 SET initValue='$tmpRouting',readValue='' + WHERE level_1='2' AND level_2='6' AND level_3='3' AND instanceNo='0'"; + break; + default: + break; +} +if($DEBUG) +echo "
      updateSql=$updateSql"; +mysqli_query($pubConn,$updateSql); + +//clear PSTN loopback +$updateSql="UPDATE OBJ_222.param_99 SET initValue='0000008080',readValue='' + WHERE level_1='2' AND level_2='6' AND level_3='3' AND instanceNo='7'"; +mysqli_query($pubConn,$updateSql); + +//linkset +$dpc=omc_keep_length($dpc,'0',6); +$tmpLinkset=$dpc.'00'; +switch($ni){ + case 0: + case 2: + $tmpLinkset=setBitValue($tmpLinkset,'3.0-3.1','00'); + break; + case 1: + case 3: + $tmpLinkset=setBitValue($tmpLinkset,'3.0-3.1','10'); + break; + default: + break; +} + +$updateSql="UPDATE OBJ_222.param_99 SET initValue='$tmpLinkset',readValue='' + WHERE level_1='2' AND level_2='4' AND level_3='1' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//clear PSTN loopback +$updateSql="UPDATE OBJ_222.param_99 SET initValue='00000000',readValue='' + WHERE level_1='2' AND level_2='4' AND level_3='1' AND instanceNo='7'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_222.param_99 SET initValue='00000000',readValue='' + WHERE level_1='2' AND level_2='4' AND level_3='1' AND instanceNo='8'"; +mysqli_query($pubConn,$updateSql); + +//link +$updateSql="UPDATE OBJ_222.param_99 SET initValue='000062',readValue='' + WHERE level_1='2' AND level_2='5' AND level_3='1' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_222.param_99 SET initValue='000162',readValue='' + WHERE level_1='2' AND level_2='5' AND level_3='1' AND instanceNo='2'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_222.param_99 SET initValue='000262',readValue='' + WHERE level_1='2' AND level_2='5' AND level_3='1' AND instanceNo='4'"; +mysqli_query($pubConn,$updateSql); + + + +//E1 +$updateSql="UPDATE OBJ_322.param_99 SET initValue='01',readValue='' + WHERE level_1='2' AND level_2='4' AND level_3='1' AND (instanceNo='0' OR instanceNo='2' OR instanceNo='4')"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='00',readValue='' + WHERE level_1='2' AND level_2='4' AND level_3='2' AND (instanceNo='0' OR instanceNo='2' OR instanceNo='4')"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='00',readValue='' + WHERE level_1='2' AND level_2='4' AND level_3='3' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='01',readValue='' + WHERE level_1='2' AND level_2='4' AND level_3='3' AND instanceNo='2'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='02',readValue='' + WHERE level_1='2' AND level_2='4' AND level_3='3' AND instanceNo='4'"; +mysqli_query($pubConn,$updateSql); + + + +//Trunk Group +$tmpTgAtt='00000008070200FF0000000000'; +$tmpTgAtt=setBitValue($tmpTgAtt,'1.0-3.7',$dpc); +switch($ni){ + case 0: + case 2: + $tmpTgAtt=setBitValue($tmpTgAtt,'5.0-5.7','00'); + break; + case 1: + case 3: + $tmpTgAtt=setBitValue($tmpTgAtt,'5.0-5.7','02'); + break; + default: + break; +} + +switch($ni){ + case 0: + case 1: + $tmpTgAtt=setBitValue($tmpTgAtt,'12.0-12.7','00'); + break; + case 2: + case 3: + $tmpTgAtt=setBitValue($tmpTgAtt,'12.0-12.7','01'); + break; + default: + break; +} + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$tmpTgAtt',readValue='' + WHERE level_1='2' AND level_2='1' AND level_3='4' AND instanceNo='0'"; +mysqli_query($pubConn,$updateSql); + +//clear PSTN loopback +$updateSql="UPDATE OBJ_322.param_99 SET initValue='000000000A0302FF0000000000',readValue='' + WHERE level_1='2' AND level_2='1' AND level_3='4' AND instanceNo='7'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='000000000A0302FF0000000000',readValue='' + WHERE level_1='2' AND level_2='1' AND level_3='4' AND instanceNo='8'"; +mysqli_query($pubConn,$updateSql); + + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='00',readValue='' + WHERE level_1='2' AND level_2='1' AND level_3='3' AND instanceNo='255'"; +mysqli_query($pubConn,$updateSql); + + +//PSTN to mobile prefix +$selSql = "SELECT initValue FROM OBJ_322.param_99 + WHERE level_1='2' AND level_2='1' AND level_3='1' AND instanceNo='1'"; + +if($DEBUG)echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$selRows[initValue]',readValue='EEEEEEEEEEEEEEEE' + WHERE level_1='2' AND level_2='1' AND level_3='1' AND instanceNo='30'"; +mysqli_query($pubConn,$updateSql); + +//PSTN to mobile prefix +$selSql = "SELECT initValue FROM OBJ_322.param_99 + WHERE level_1='2' AND level_2='1' AND level_3='2' AND instanceNo='1'"; + +if($DEBUG)echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); + +$tmpPrefix=setBitValue($selRows[initValue],'00.-0.7','43'); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$tmpPrefix',readValue='2200EEEEEEEEEEEEEEEE010800EEEEEEEE030000' + WHERE level_1='2' AND level_2='1' AND level_3='2' AND instanceNo='30'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='00',readValue='FF' + WHERE level_1='2' AND level_2='1' AND level_3='3' AND instanceNo='30'"; +mysqli_query($pubConn,$updateSql); + +/**************Mobile to PSTN*********************************/ +/* +$selSql = "SELECT initValue FROM OBJ_225.param_99 + WHERE level_1='2' AND level_2='3'"; + +if($DEBUG)echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); + +$tmpArr=explode("E",$selRows[initValue]); +$tmpCc=$tmpArr[0]; + +$tmpPrefixAtt='32'; +$tmpInsertCount=dechex(strlen($tmpCc)); +$tmpPrefixAtt=$tmpPrefixAtt.$tmpInsertCount.'0'.omc_keep_length($tmpCc,'E',16,0).'8100'.'0'.'0'.'EEEEEEEE'.'030100'; +*/ + +/*****************************************/ +/* +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$pstnPrefix_0',readValue='EEEEEEEEEEEEEEEE' + WHERE level_1='2' AND level_2='1' AND level_3='1' AND instanceNo='11'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$tmpPrefixAtt',readValue='2200EEEEEEEEEEEEEEEE010800EEEEEEEE030000' + WHERE level_1='2' AND level_2='1' AND level_3='2' AND instanceNo='11'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='00',readValue='FF' + WHERE level_1='2' AND level_2='1' AND level_3='3' AND instanceNo='11'"; +mysqli_query($pubConn,$updateSql); +*/ +/*****************************************/ +/* +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$pstnPrefix_1',readValue='EEEEEEEEEEEEEEEE' + WHERE level_1='2' AND level_2='1' AND level_3='1' AND instanceNo='12'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$tmpPrefixAtt',readValue='2200EEEEEEEEEEEEEEEE010800EEEEEEEE030000' + WHERE level_1='2' AND level_2='1' AND level_3='2' AND instanceNo='12'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='00',readValue='FF' + WHERE level_1='2' AND level_2='1' AND level_3='3' AND instanceNo='12'"; +mysqli_query($pubConn,$updateSql); +/***********************************************/ +/* +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$pstnPrefix_2',readValue='EEEEEEEEEEEEEEEE' + WHERE level_1='2' AND level_2='1' AND level_3='1' AND instanceNo='13'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='$tmpPrefixAtt',readValue='2200EEEEEEEEEEEEEEEE010800EEEEEEEE030000' + WHERE level_1='2' AND level_2='1' AND level_3='2' AND instanceNo='13'"; +mysqli_query($pubConn,$updateSql); + +$updateSql="UPDATE OBJ_322.param_99 SET initValue='00',readValue='FF' + WHERE level_1='2' AND level_2='1' AND level_3='3' AND instanceNo='13'"; +mysqli_query($pubConn,$updateSql); +*/ +?> + + 'MTP3 parameters','sysTypeNo' => '222','sysId' => '222_99_99', 'oid' => '2'), + array('remark' => 'MSC parameters','sysTypeNo' => '322','sysId' => '322_99_99', 'oid' => '2'), + ); + + //send set command + echo "
      Setting parameters to MSS!
      "; + $commStr=''; + for($i=0;$itmpCommStr=$tmpCommStr"; + $commStr.=$tmpCommStr; + if($DEBUG)echo "
      commStr=$commStr"; + } + + //check the command status + if($commStr==""){ + echo "
      Send the command error, Please check the device state!
      "; + require("./display.php"); + exit(); + } + + $cmmIdStrArr=explode("-",$commStr); + + for($i=0;$i $maxNum){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + echo "Error: $tmpRemark."; + require("./display.php"); + exit(); + } + echo ""; + flush(); + + $selComm = "SELECT commState,remark,objId,sysTypeNo FROM $sysCommTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes)>0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpOid=$selRow[objId]; + $tmpSysTypeNo=$selRow[sysTypeNo]; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + for($j=0;$jError: $tmpRemark.({$setForPstnArr[$j][remark]})"; + } + require("./display.php"); + exit(); + } + + $selComm = "SELECT commState,remark FROM $sysCommTable WHERE $tmpWhere AND (commState='$nWaitProc' OR commState='$nInProc')"; + + if($DEBUG)echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + break; + } + +sleep(2); + //send save command + $commStr=''; + for($i=0;$isysId={$saveCmdArr[$i][sysId]},oid={$saveCmdArr[$i][oid]},value={$saveCmdArr[$i][value]}"; + setSysParamValue($saveCmdArr[$i][sysId],$saveCmdArr[$i][oid],'0',$saveCmdArr[$i][value]); + $tmpCommStr=sysCommSend($saveCmdArr[$i][sysId],$nSetComm,$saveCmdArr[$i][oid]); + if($DEBUG)echo "
      tmpCommStr=$tmpCommStr"; + $commStr.=$tmpCommStr; + if($DEBUG)echo "
      commStr=$commStr"; + } + + //check the command status + if($commStr==""){ + echo "
      Send the command error, Please check the device state!
      "; + require("./display.php"); + exit(); + } + + $cmmIdStrArr=explode("-",$commStr); + + for($i=0;$i $maxNum){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + echo "Error: $tmpRemark."; + require("./display.php"); + exit(); + } + echo ""; + flush(); + + $selComm = "SELECT commState,remark,objId,sysTypeNo FROM $sysCommTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes)>0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpOid=$selRow[objId]; + $tmpSysTypeNo=$selRow[sysTypeNo]; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + for($j=0;$jError: $tmpRemark.({$resetCommArr[$j][remark]})"; + + } + require("./display.php"); + exit(); + } + + $selComm = "SELECT commState,remark FROM $sysCommTable WHERE $tmpWhere AND (commState='$nWaitProc' OR commState='$nInProc')"; + + if($DEBUG)echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + break; + } + + //send reset command + $commStr=''; + for($i=0;$isysId={$resetCmdArr[$i][sysId]},oid={$resetCmdArr[$i][oid]},value={$resetCmdArr[$i][value]}"; + setSysParamValue($resetCmdArr[$i][sysId],$resetCmdArr[$i][oid],'0',$resetCmdArr[$i][value]); + $tmpCommStr=sysCommSend($resetCmdArr[$i][sysId],$nSetComm,$resetCmdArr[$i][oid]); + if($DEBUG)echo "
      tmpCommStr=$tmpCommStr"; + $commStr.=$tmpCommStr; + if($DEBUG)echo "
      commStr=$commStr"; + } + + if($commStr==""){ + echo "
      Send the command error, Please check the device state!
      "; + require("./display.php"); + exit(); + } + + $cmmIdStrArr=explode("-",$commStr); + + for($i=0;$i $maxNum){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + echo "Error: $tmpRemark."; + require("./display.php"); + exit(); + + } + echo ""; + flush(); + + $selComm = "SELECT commState,remark,objId,sysTypeNo FROM $sysCommTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes)>0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpOid=$selRow[objId]; + $tmpSysTypeNo=$selRow[sysTypeNo]; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + for($j=0;$jError: $tmpRemark.({$resetCommArr[$j][remark]})"; + } + require("./display.php"); + exit(); + } + + $selComm = "SELECT commState,remark FROM $sysCommTable WHERE $tmpWhere AND (commState='$nWaitProc' OR commState='$nInProc')"; + + if($DEBUG)echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + echo "
      Process finished
      "; + break; + } + +?> diff --git a/wxc2_omc/configuration/nibConf/defaultPara/AucSysPara b/wxc2_omc/configuration/nibConf/defaultPara/AucSysPara new file mode 100755 index 0000000..91d83b8 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/AucSysPara differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/EirSysPara b/wxc2_omc/configuration/nibConf/defaultPara/EirSysPara new file mode 100755 index 0000000..c3e1f76 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/EirSysPara differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/HlrSysPara b/wxc2_omc/configuration/nibConf/defaultPara/HlrSysPara new file mode 100755 index 0000000..968c6b1 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/HlrSysPara differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/cap_acn.conf b/wxc2_omc/configuration/nibConf/defaultPara/cap_acn.conf new file mode 100755 index 0000000..ba8f855 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/cap_acn.conf @@ -0,0 +1,8 @@ +#application context name configure file for CAP +total data length=4 + +#application context name data +No.1:50 02 // gsmSSF to gsmSCF +No.2:51 02 // assist handoff gsmSSF to gsmSCF +No.3:52 02 // gsmSRF to gsmSCF +No.4:128 02 // gsmSRF to gsmSCF diff --git a/wxc2_omc/configuration/nibConf/defaultPara/cap_operation.conf b/wxc2_omc/configuration/nibConf/defaultPara/cap_operation.conf new file mode 100755 index 0000000..77ca779 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/cap_operation.conf @@ -0,0 +1,36 @@ +# operation code configure file for CAP +total data length=32 + +#operation code +No.1:00 02 5 // initial DP +No.2:16 02 5 // assist request instructions +No.3:17 02 20 // establish temporary connection +No.4:18 04 5 // disconnect forward connection +No.5:19 04 5 // connect to resource +No.6:20 04 5 // connect +No.7:22 04 5 // release call +No.8:23 04 5 // request report BCSM event +No.9:24 04 5 // event report BCSM +No.10:31 04 5 // continue +No.11:33 04 5 // reset timer +No.12:34 04 5 // furnish charging information +No.13:35 04 5 // apply charging +No.14:36 04 5 // apply charging report +No.15:44 04 5 // call information report +No.16:45 04 5 // call information request +No.17:46 04 5 // send charging information +No.18:47 04 60 // play announcement +No.19:48 01 60 // prompt and collect user information +No.20:49 04 5 // specialized resource report +No.21:53 04 5 // cancel +No.22:55 01 5 // activity test +No.23:60 04 5 // initial DPSMS +No.24:61 04 5 // Furnishing charging info.SMS +No.25:62 04 5 // connect DPSMS +No.26:63 04 5 // request SMS event +No.27:64 04 5 // event report SMS +No.28:65 04 5 // continue SMS +No.29:66 04 5 // release DPSMS +No.30:67 04 5 // reset timer DPSMS +No.31:176 04 5 // VPS to PPS +No.32:177 04 5 // PPS to VPS diff --git a/wxc2_omc/configuration/nibConf/defaultPara/cc_table.conf b/wxc2_omc/configuration/nibConf/defaultPara/cc_table.conf new file mode 100755 index 0000000..72da771 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/cc_table.conf @@ -0,0 +1,215 @@ +# Country code table configure file + +#List the country code +0086; // China +0001; // Canada & USA +0007; // Kazakhstan & Kirighzia & Kyrgyzstan & Russia & Sakhalin & Tajikistan & Uzbekistan +0020; // Egypt +0027; // South Africa +0030; // Greece +0031; // Netherlands +0036; // Hungary +0039; // Italy +0040; // Bomania +0041; // Switzerland +0042; // Czech Republic & Slovakia +0043; // Austria +0044; // United Kingdom +0045; // Denmark +0046; // Sweden +0047; // Norway +0048; // Poland +0049; // Germany +0051; // Peru +0052; // South Korea +0053; // Cuba +0054; // Argentina +0055; // Brazil +0056; // Chile +0057; // Colombia +0058; // Venezuela +0060; // Malaysia +0061; // Australia +0062; // Indonesia +0063; // Philippines +0064; // New Zealand +0065; // Singapore +0066; // Thailand +0081; // Japan +0084; // Vietnam +0090; // Turkey +0091; // India +0092; // Pakistan +0093; // Afghanistan +0094; // Sri Lanka +0095; // Myanmar (Burma) +0098; // Iran +0212; // Morocco +0213; // Algeria +0216; // Tunisia +0218; // Libya +0220; // Gambia +0221; // Senegal Republic +0222; // Mauritania +0223; // Mali Republic +0224; // Guinea +0225; // Ivory Coast +0226; // Burkina Faso +0227; // Niger +0228; // Togo +0229; // Benin +0230; // Mauritius +0231; // Liberia +0232; // Sierra Leone +0233; // Ghana +0234; // Nigeria +0235; // Chad Republic +0236; // Central Africa Republic +0237; // Cameroon +0239; // Sao Tome +0240; // Equatorial Guinea +0241; // Gabon +0242; // Congo +0243; // Zaire +0244; // Angola +0245; // Guinea Bissau +0246; // Diego Garcia +0247; // Ascension Islands +0248; // Seychelles +0249; // Sudan +0250; // Rwanda +0251; // Ethiopia +0252; // Somalia +0253; // Djibouti +0254; // Kenya +0255; // Tanzania +0256; // Uganda +0257; // Burundi +0258; // Mozambigue +0259; // Zanzibar +0260; // Zambia +0261; // Madagascar +0262; // Reunion Island +0263; // Zimbabwe +0264; // Namibia +0265; // Malawi +0266; // Lesotho +0267; // Botswana +0268; // Swaziland +0269; // Comoros +0290; // St.Helena +0291; // Eritrea +0297; // Aruba +0298; // Faeroe Islands +0299; // Greenland +#2696 // Mayotte Island +0321; // Belgium +0331; // France +0339; // Monaco +0349; // Spain +0350; // Gibraltar +0351; // Portugal +0352; // Luxembourg +0353; // Ireland +0354; // Iceland +0355; // Albania +0356; // Malta +0357; // Cyprus +0358; // Finland +0359; // Bulgaria +0370; // Lithuania +0371; // Latvia +0372; // Estonia +0373; // Moldova +0374; // Armenia +0375; // Belarus +0376; // Andorra +0380; // Ukraine +0381; // Yugoslavia +0385; // Croatia +0386; // Slovenia +0387; // Bosnia Herzegovina +0389; // Macedonia +0395; // San Marino +0396; // Vatican City +0417; // Liechtenstein +0500; // Falkland Islands +0501; // Belize +0502; // Guatemala +0503; // EI Salvador +0504; // Honduras +0505; // Nicaragua +0506; // Costa Rica +0507; // Panama +0508; // St.Pierre +0509; // Haiti +0521; // Mexico Band 1 +0522; // Mexico Band 2 +0523; // Mexico Band 3 +0524; // Mexico Band 4 +0525; // Mexico Band 5 +0526; // Mexico Band 6 +0527; // Mexico Band 7 +0528; // Mexico Band 8 +0590; // Guadeloupe +0591; // Bolivia +0592; // Ecuador & Guyana +0594; // French Guiana +0595; // Paraguay +0596; // French Antilles +0597; // Suriname +0598; // Uruguay +0599; // Netherlands Antilles +#5399 // Guantanamo Bay +0670; // Saipan +0671; // Guam +0672; // Antarctica(Casey) & Antarctica(Scott) & Christmas/Cocos +0673; // Brunei +0674; // Nauru +0675; // Papau New Guinea +0676; // Tonga +0677; // Solomon Islands +0678; // Vanuatu +0679; // Fiji Islands +0680; // Palau +0681; // Wallis/Futuna +0682; // Cook Island +0683; // Niue Island +0684; // American Samoa +0685; // West Samoa +0686; // Kiribati +0687; // New Caledonia +0688; // Tuvalu Islands +0689; // French Polynesia +0691; // Micronesia +0692; // Marshall Islands +#6723 // Norfolk Island +0787; // Puerto Rico +0809; // Anguilla & Antigua & Bahamas & Barbados & Bermuda...... +0850; // North Korea +0852; // Hong Kong +0853; // Macao +0855; // Cambodia +0856; // Laos +0868; // Trinidad/Tobago +0880; // Bangladesh +0886; // Taiwan +0960; // Maldives +0961; // Lebanon +0962; // Jordan +0963; // Syria +0964; // Iraq +0965; // Kuwait +0966; // Saudi Arabia +0967; // Yemen Arab Rep. +0968; // Oman +0971; // United Arab Emirates +0972; // Israel +0973; // Bahrain +0974; // Qatar +0975; // Bhutan +0976; // Mongolia +0977; // Nepal +0994; // Azerbaijan +0995; // Georgia + diff --git a/wxc2_omc/configuration/nibConf/defaultPara/conv_prefix.conf b/wxc2_omc/configuration/nibConf/defaultPara/conv_prefix.conf new file mode 100755 index 0000000..51c50b5 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/conv_prefix.conf differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/help_page b/wxc2_omc/configuration/nibConf/defaultPara/help_page new file mode 100755 index 0000000..f384302 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/help_page @@ -0,0 +1,20 @@ + + ****************** + * HELP PAGE * + ****************** + + Welcome to DEBUG MONITOR. + + Press 's' or 'S' to enter "SUB MODULE SELECTION PAGE". + + In "SUB MODULE SELECTION PAGE", + Press 'x' or 'X' to return "HELP PAGE", + Press 'a-p' or 'A-P' to select sub module. + + In each sub module, Press '0-9' and 'a-f' to select pages. + + There are two methods to use Debug, + 1. Serial Port, use PC-to-PC serial line. + 2. Telnet, use "telnet dst_host_ip 4965". + +$ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/hlr_parambit.conf b/wxc2_omc/configuration/nibConf/defaultPara/hlr_parambit.conf new file mode 100755 index 0000000..8497c6f Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/hlr_parambit.conf differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/iptrans.conf b/wxc2_omc/configuration/nibConf/defaultPara/iptrans.conf new file mode 100755 index 0000000..c0e7b37 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/iptrans.conf @@ -0,0 +1,18 @@ +#ipconfig for pps +#port=type,num,interface +#type=UDP/TCP +#num=0-6 +#interface=BUFFER/DIRECT +4950=UDP,6,DIRECT +4952=UDP,2,BUFFER +4953=UDP,3,BUFFER +4954=UDP,3,BUFFER +4955=UDP,3,BUFFER +4957=UDP,4,BUFFER +4960=UDP,3,BUFFER +4965=TCP,3,BUFFER +4967=UDP,2,BUFFER +4969=UDP,3,BUFFER +4970=UDP,3,BUFFER +4971=UDP,2,BUFFER +4972=UDP,2,BUFFER diff --git a/wxc2_omc/configuration/nibConf/defaultPara/map_acn.conf b/wxc2_omc/configuration/nibConf/defaultPara/map_acn.conf new file mode 100755 index 0000000..b19a163 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/map_acn.conf @@ -0,0 +1,40 @@ +#application context name configure file +total data length=36 + +#application context name data +No.1:01 03 // network location update +No.2:02 03 // location cancel +No.3:03 03 // roaming number enquiry +No.4:05 03 // location info retrieval +No.5:10 02 // reset context +No.6:11 02 // handover control +No.7:13 02 // equipment management +No.8:14 02 // info retrieval +No.9:15 02 // inter VLR info retrieval +No.10:16 03 // subscriber data management +No.11:17 03 // tracing +No.12:18 02 // network functional SS +No.13:19 02 // network unstructured SS +No.14:20 03 // short message gateway +No.15:21 03 // short message MO relay +No.16:23 03 // short message alert +No.17:24 03 // short message waiting data management +No.18:25 03 // mobile terminating short message relay +No.19:26 02 // imsi retrieval +No.20:27 03 // MS purging +No.21:28 03 // subscriber info enquiry +No.22:29 03 // any time info enquiry +No.23:06 03 // call control transfer +No.24:36 03 // invocation notification +No.25:12 03 // sIWFS allocation +No.26:31 03 // group call control +No.27:32 03 // GPRS location update +No.28:33 03 // GPRS location info retrieval +No.29:34 03 // failure report +No.30:35 03 // GPRS notify +No.31:07 03 // reporting +No.32:08 03 // call completion +No.33:200 02 // security triplets (MAP-H defined by Meng Xiaozhen) +No.34:201 02 // subscriber interrogate (MAP-H defined by Meng Xiaozhen) +No.35:202 02 // HLR subscriber management (MAP-H defined by Meng Xiaozhen) +No.36:203 02 // HLR ping AUC (MAP-H defined by Meng Xiaozhen reserved) diff --git a/wxc2_omc/configuration/nibConf/defaultPara/map_operation.conf b/wxc2_omc/configuration/nibConf/defaultPara/map_operation.conf new file mode 100755 index 0000000..6b8f817 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/map_operation.conf @@ -0,0 +1,67 @@ +# operation code configure file +total data length=63 + +#operation code +No.1:02 01 20 // update location +No.2:03 01 10 // cancel location +No.3:67 01 20 // purge mobile station +No.4:55 01 05 // send identification +No.5:68 01 20 // prepare handover +No.6:29 03 108000 // send end signal +No.7:33 04 05 // process access signalling +No.8:34 04 05 // forward access signalling +No.9:69 01 20 // prepare subsequent handover +No.10:56 01 20 // send authentication info +No.11:43 01 20 // check IMEI +No.12:07 01 20 // insert subscriber data +No.13:08 01 20 // delete subscriber data +No.14:37 04 20 // reset +No.15:38 04 20 // forward check ss indication +No.16:57 01 20 // restore data +No.17:50 01 20 // active trace mode +No.18:51 01 20 // deactive trace mode +No.19:58 01 20 // send imsi +No.20:22 01 20 // send routing info +No.21:04 01 20 // provide roaming number +No.22:06 01 20 // resume call handling +No.23:31 01 20 // provide SIWFS number +No.24:32 01 20 // SIWFS signalling modify +No.25:73 01 20 // set report state +No.26:74 01 20 // status report +No.27:75 01 60 // remote user free +No.28:10 01 20 // register ss +No.29:11 01 20 // erase ss +No.30:12 01 20 // activate ss +No.31:13 01 20 // deactivate ss +No.32:14 01 20 // interrogate ss +No.33:59 01 600 // process unstructure ss request +No.34:60 01 60 // unstructure ss request +No.35:61 01 60 // unstructure ss notify +No.36:17 01 60 // register password +No.37:18 03 20 // get password +No.38:76 01 20 // register cc entry +No.39:77 01 20 // erase cc entry +No.40:45 01 20 // send routing info for sm +No.41:46 01 60 // mo forward sm +No.42:44 01 60 // mt forward sm +No.43:47 01 05 // report sm delivery status +No.44:63 04 05 // inform service centre +No.45:64 01 05 // alert service center +No.46:66 01 05 // ready for sm +No.47:70 01 20 // provider subscriber info +No.48:71 01 20 // any time interrogation +No.49:72 01 20 // ss invocatin notification +No.50:39 01 20 // prepare group call +No.51:40 03 108000 // send group call end signal +No.52:41 04 05 // process group call signalling +No.53:42 04 05 // forward group call signalling +No.54:23 01 20 // update GPRS location +No.55:24 01 20 // send routing info for GPRS +No.56:25 01 20 // failure report +No.57:26 01 20 // note ms present for GPRS +No.58:200 01 05 // security triplets (MAP-H defined by Meng Xiaozhen) +No.59:201 01 05 // interrogate subscriber (MAP-H defined by Meng Xiaozhen) +No.60:202 01 05 // hlr create subscriber (MAP-H defined by Meng Xiaozhen) +No.61:203 01 05 // hlr delete subscriber (MAP-H defined by Meng Xiaozhen) +No.62:204 01 05 // hlr ping auc (MAP-H defined by Meng Xiaozhen reserved) +No.63:09 01 20 // send parameter diff --git a/wxc2_omc/configuration/nibConf/defaultPara/menu_page b/wxc2_omc/configuration/nibConf/defaultPara/menu_page new file mode 100755 index 0000000..29f6fb8 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/menu_page @@ -0,0 +1,13 @@ + + ******************* + * MENU PAGE * + ******************* + + a -- IPTR i -- HLR + b -- MTP3 j -- SMSC + c -- SCCP k -- PPS + d -- TCAP l -- SNMP + e -- XAPP m -- + f -- MSC n -- DEBUG + g -- VLR o -- AUC + h -- p -- EIR diff --git a/wxc2_omc/configuration/nibConf/defaultPara/mnpf.conf b/wxc2_omc/configuration/nibConf/defaultPara/mnpf.conf new file mode 100755 index 0000000..885bce7 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/mnpf.conf differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/msc_conf b/wxc2_omc/configuration/nibConf/defaultPara/msc_conf new file mode 100755 index 0000000..96d9ec9 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/msc_conf differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/mtp3.conf b/wxc2_omc/configuration/nibConf/defaultPara/mtp3.conf new file mode 100755 index 0000000..1a90ca0 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/mtp3.conf @@ -0,0 +1,1408 @@ +#MTP3 CONFIGURE FILE + +[SERVICE NETWORK SP LEN] +[00] + +[LOCAL SP] +[000000] [000000] [000064] [000064] +[000001] [000001] [000001] [000001] + +[LINK ATTRIBUTE] +[07.00.62] [01.00.62] [08.00.62] [01.01.62] +[08.02.62] [01.02.62] [01.03.62] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] +[80.10.ff] [80.10.ff] [80.10.ff] [80.10.ff] + +[LINKSET ATTRIBUTE] +[000000.00] [000001.03] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000007.0a] +[000008.0a] [000009.02] [00000a.03] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] + +[NATIONAL NETWORK SP] +[000008.08.80] [000009.09.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000007.07.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] + +[NATIONAL NETWORK SPARE SP] +[000001.01.80] [00000a.0a.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] + +[INTERNATIONAL NETWORK SP] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] + +[INTERNATIONAL NETWORK SPARE SP] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] + +[LOCAL ACN] +030303030202020202030302020303030303020303030303030303030303030302020202 + +[INTERNATIONAL NETWORK ACN] +030303030202020202030302020202020202020303030303030303030303030302020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 + +[INTERNATIONAL NETWORK SPARE ACN] +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 + +[NATIONAL NETWORK ACN] +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +030303030202020202030302020103020201020303030303030303030303030302020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 + +[NATIONAL NETWORK SPARE ACN] +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 + diff --git a/wxc2_omc/configuration/nibConf/defaultPara/mtp3_ps.conf b/wxc2_omc/configuration/nibConf/defaultPara/mtp3_ps.conf new file mode 100755 index 0000000..f3ae6f2 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/mtp3_ps.conf @@ -0,0 +1,1408 @@ +#MTP3 CONFIGURE FILE + +[SERVICE NETWORK SP LEN] +[0c] + +[LOCAL SP] +[000001] [000002] [000000] [000000] +[000000] [000000] [111111] [010101] + +[LINK ATTRIBUTE] +[00.00.62] [01.00.62] [03.00.62] [20.00.62] +[7e.00.62] [21.00.62] [22.00.62] [80.10.62] +[05.00.62] [02.00.62] [80.10.62] [04.00.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.65] +[46.00.62] [50.00.62] [53.00.62] [54.00.62] +[57.00.62] [40.00.62] [40.01.62] [40.02.62] +[46.01.62] [51.00.62] [52.00.62] [55.00.62] +[56.00.62] [41.00.62] [41.01.62] [41.02.62] +[47.00.62] [58.00.62] [5b.00.62] [5c.00.62] +[23.00.62] [42.00.62] [42.01.62] [42.02.62] +[47.01.62] [59.00.62] [5a.00.62] [5d.00.62] +[24.00.62] [43.00.62] [43.01.62] [43.02.62] +[46.04.62] [5e.00.62] [61.00.62] [62.00.62] +[65.00.62] [66.00.62] [44.00.62] [44.01.62] +[46.05.62] [5f.00.62] [60.00.62] [63.00.62] +[64.00.62] [67.00.62] [45.00.62] [44.02.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[ff.ff.ff] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[80.10.62] [80.10.62] [80.10.62] [80.10.62] +[00.01.63] [01.01.63] [03.01.63] [20.01.63] +[7f.00.63] [21.01.63] [22.01.63] [80.10.63] +[05.01.63] [02.01.63] [80.10.63] [04.01.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[46.02.63] [50.01.63] [53.01.63] [54.01.63] +[57.01.63] [40.03.63] [40.04.63] [40.05.63] +[46.03.63] [51.01.63] [52.01.63] [55.01.63] +[56.01.63] [41.03.63] [41.04.63] [41.05.63] +[47.02.63] [58.01.63] [5b.01.63] [5c.01.63] +[23.01.63] [42.03.63] [42.04.63] [42.05.63] +[47.03.63] [59.01.63] [5a.01.63] [5d.01.63] +[24.01.63] [43.03.63] [43.04.63] [43.05.63] +[47.04.63] [5e.01.63] [61.01.63] [62.01.63] +[65.01.63] [66.01.63] [44.03.63] [44.04.63] +[47.05.63] [5f.01.63] [60.01.63] [63.01.63] +[64.01.63] [67.01.63] [45.01.63] [44.05.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] +[80.10.63] [80.10.63] [80.10.63] [80.10.63] + +[LINKSET ATTRIBUTE] +[060606.02] [020202.03] [030303.03] [222222.02] +[000003.00] [040404.02] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000017.00] [000018.00] [00003c.00] [000019.00] +[00003d.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[0000a0.00] [0000a1.00] [0000a2.00] [0000a3.00] +[0000a4.00] [0000a5.00] [020101.02] [030101.02] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[010102.0a] [010202.0a] [010103.0a] [010203.0a] +[010104.0a] [010204.0a] [010105.0a] [010205.0a] +[000301.0b] [000401.0b] [000302.0b] [000402.0b] +[000303.0b] [000403.0b] [000304.0b] [000404.0b] +[000305.0b] [000405.0b] [000306.0b] [000406.0b] +[000307.0b] [000407.0b] [000308.0b] [000408.0b] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [000000.00] [000000.00] +[000000.00] [000000.00] [00007e.0b] [00007f.0b] + +[NATIONAL NETWORK SP] +[060606.00.80] [222222.03.80] [020101.46.80] [030101.47.80] +[010102.50.80] [010202.51.80] [010103.52.80] [010203.53.80] +[010104.54.80] [010204.55.80] [010105.56.80] [010205.57.80] +[040404.05.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.41] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] + +[NATIONAL NETWORK SPARE SP] +[020202.01.01] [030303.02.02] [00007e.7e.7e] [00007f.7f.7f] +[000301.58.58] [000401.59.59] [000302.5a.5a] [000402.5b.5b] +[000303.5c.5c] [000403.5d.5d] [000304.5e.5e] [000404.5f.5f] +[000305.60.60] [000405.61.61] [000306.62.62] [000406.63.63] +[000307.64.64] [000407.65.65] [000308.66.66] [000408.67.67] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] +[000000.80.80] [000000.80.80] [000000.80.80] [000000.80.80] + +[INTERNATIONAL NETWORK SP] +[000017.20.80] [000018.21.80] [0000a0.40.80] [000003.04.80] +[00003c.22.80] [0000a1.41.80] [0000a2.42.80] [0000a3.43.80] +[0000a4.44.80] [000019.23.80] [00003d.24.80] [0000a5.45.80] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.39] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] +[000000.80.00] [000000.80.00] [000000.80.00] [000000.80.00] + +[INTERNATIONAL NETWORK SPARE SP] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.ff] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.40] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] +[000000.ff.00] [000000.ff.00] [000000.ff.00] [000000.ff.00] + +[LOCAL ACN] +030303030202020202030302020202020202020203030303030303030303030302020202 + +[INTERNATIONAL NETWORK ACN] +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 + +[INTERNATIONAL NETWORK SPARE ACN] +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 + +[NATIONAL NETWORK ACN] +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 + +[NATIONAL NETWORK SPARE ACN] +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 +020202020202020202020202020202020202020202020202020202020202020202020202 + diff --git a/wxc2_omc/configuration/nibConf/defaultPara/ppsConf.txt b/wxc2_omc/configuration/nibConf/defaultPara/ppsConf.txt new file mode 100755 index 0000000..fcddc9d Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/ppsConf.txt differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/ppsCrdConf.txt b/wxc2_omc/configuration/nibConf/defaultPara/ppsCrdConf.txt new file mode 100755 index 0000000..cd0d813 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/ppsCrdConf.txt differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/profile b/wxc2_omc/configuration/nibConf/defaultPara/profile new file mode 100755 index 0000000..de17bc9 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/profile @@ -0,0 +1,37 @@ +# /etc/profile + +# System wide environment and startup programs +# Functions and aliases go in /etc/bashrc + +PATH=".:$PATH:/sbin:/usr/sbin:/usr/X11R6/bin:/etc/rc.d/init.d:/usr/local/wxc2/bin" +PATH=/usr/java/jdk1.3/bin:$PATH + +ulimit -c 80000 +if [ `id -gn` = `id -un` -a `id -u` -gt 14 ]; then + umask 002 +else + umask 022 +fi + +USER=`id -un` +LOGNAME=$USER +MAIL="/var/spool/mail/$USER" + +HOSTNAME=`/bin/hostname` +HISTSIZE=1000 + +if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then + INPUTRC=/etc/inputrc +fi +JAVA_COMPILER=javacomp ; export JAVA_COMPILER +LD_LIBRARY_PATH=/usr/local/mysql/lib ; export LD_LIBRARY_PATH +export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC + +for i in /etc/profile.d/*.sh ; do + if [ -x $i ]; then + . $i + fi +done + +unset i +PATH=/usr/local/wxc2/bin:$PATH diff --git a/wxc2_omc/configuration/nibConf/defaultPara/sccp.conf b/wxc2_omc/configuration/nibConf/defaultPara/sccp.conf new file mode 100755 index 0000000..e81c7e7 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/sccp.conf @@ -0,0 +1,28 @@ +#SCCP Config file (R8V2_04) + +[Local Node] +#ssn NetID msisdn ip0 ip1 +4 2 86755920006 172.18.128.1 172.18.129.1 +6 2 86755920002 172.18.98.1 172.18.99.1 +7 2 86755920001 172.18.98.1 172.18.99.1 +8 2 86755920000 172.18.98.1 172.18.99.1 +9 2 86755920005 172.18.98.1 172.18.99.1 +10 2 86755920004 172.18.98.1 172.18.99.1 +11 2 86755920006 172.18.98.1 172.18.99.1 +19 2 86755920007 172.18.98.1 172.18.99.1 +20 2 86755920008 172.18.98.1 172.18.99.1 +21 2 86755920009 172.18.128.1 172.18.129.1 +22 2 86755920013 172.18.100.1 172.18.101.1 +32 2 86755900012 172.18.98.1 172.18.99.1 +146 2 86755920011 172.18.98.1 172.18.99.1 +147 2 86755920010 172.18.98.1 172.18.99.1 +254 2 - 172.18.98.1 172.18.99.1 +[GTT_Table] +#No NP StartDigits EndDigits NI SPC SSN RI AI S E N Rep +0 6 460020000000000 460029999999999 3 000064 6 0 7 +1 1 86755900020 86755909999 3 000064 6 0 7 +2 1 86755910101 86755999999 3 000064 6 0 7 + +[RL_SSN] +#NetID DPC SSN + \ No newline at end of file diff --git a/wxc2_omc/configuration/nibConf/defaultPara/shm.conf b/wxc2_omc/configuration/nibConf/defaultPara/shm.conf new file mode 100755 index 0000000..b15b4bb --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/shm.conf @@ -0,0 +1,57 @@ +#------------------------------Server paramter----------------------------# + + +#Server Type (0=OMC 1=FUNCTION SERVER) +ServerType=1 + + +#Server ID ( 0=master 1=slave) +ServerID=0 + +#IP Info (OMC0 OMC1 for omc server, SERVER0 and SERVER1 for function server) +OMC0=172.18.128.1 +OMC1=172.18.129.1 +SERVER0=172.18.98.1 +SERVER1=172.18.99.1 + +#------------------------------Share Memory List(MAX=10)-------------------# + +# ID KEY PERM SIZE USR INTTLP INITRP REALP PERIODP REALIP PERIODICIP +* 11 12000000 436 16384 AUC 4957 4957 4972 4972 239.255.4.1 239.255.4.1 +* 12 12040000 436 16384 EIR 4957 4957 4974 4974 239.255.6.1 239.255.6.1 +* 13 45000001 436 33985 HLR 4957 4957 4970 4970 239.255.2.1 239.255.2.1 +* 24 90000000 436 32768 VLR 4957 4957 4973 4973 239.255.5.1 239.255.5.1 +* 5 05020000 436 22528 PPS 4957 4957 4971 4971 239.255.3.1 239.255.3.1 + +#------------------------DataBase info (only used for OMC MAX=10)- ---------# +# HOSTNAME PASSWORD USER DBNAME +<1> localhost rootaa root HlrDb +<2> localhost rootaa root parameter_db +<3> localhost rootaa root account_db +<4> localhost rootaa root tariff_db +<5> localhost rootaa root refresh_card +<6> localhost rootaa root AUC_Para +<7> localhost rootaa root VlrDb +<8> localhost rootaa root EIR_Para + +#-------------------------MIBS Config Files---------------------------------# +PATH:./conf/mibs/ + + +#MIB List +[1] IWV-SMI.txt +[2] WAVEII-SMI.txt +[3] WAVEII-DATASYNC-MIB.txt +[4] WAVEII-AUC-MIB.txt +[5] WAVEII-EIR-MIB.txt +[6] WAVEII-HLR-MIB.txt +[7] WAVEII-MSC-MIB.txt +[8] WAVEII-PPS-MIB.txt + +#ProcedureID(>=0) +#ProID=1 +#Timeout value <256(Minute) (the Max waiting time for the OMC startup) +WaitTime=1 + + + diff --git a/wxc2_omc/configuration/nibConf/defaultPara/smsc_csta.conf b/wxc2_omc/configuration/nibConf/defaultPara/smsc_csta.conf new file mode 100755 index 0000000..b38d7f7 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/smsc_csta.conf @@ -0,0 +1,21 @@ +# This file defines the SMSC CSTA row +# The max number of row is 20 +# Attention: When you want to define the Entity name, the name of "MS" "All" and "Other" is reserved + +# define the entity who send short message to SMSC +Receive from: +MS +PPS +VMS +#VMS+PPS +Other +#All + +# define the entity who receive short message from SMSC +Send to: +MS +PPS +VMS +#VMS+PPS +Other +#All diff --git a/wxc2_omc/configuration/nibConf/defaultPara/smsc_parambit.conf b/wxc2_omc/configuration/nibConf/defaultPara/smsc_parambit.conf new file mode 100755 index 0000000..d1ef3f0 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/smsc_parambit.conf differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/smsc_sys.conf b/wxc2_omc/configuration/nibConf/defaultPara/smsc_sys.conf new file mode 100755 index 0000000..a6081a9 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/smsc_sys.conf @@ -0,0 +1,5 @@ +#SMSC system configure file + +#IP info of SMSC +wxc2-0=172.18.98.1; +wxc2-1=172.18.99.1; diff --git a/wxc2_omc/configuration/nibConf/defaultPara/system.ini b/wxc2_omc/configuration/nibConf/defaultPara/system.ini new file mode 100755 index 0000000..27d718e Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/system.ini differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/vlr.conf b/wxc2_omc/configuration/nibConf/defaultPara/vlr.conf new file mode 100755 index 0000000..c46d71d Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/vlr.conf differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/vlr_conf b/wxc2_omc/configuration/nibConf/defaultPara/vlr_conf new file mode 100755 index 0000000..2f6db83 Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/vlr_conf differ diff --git a/wxc2_omc/configuration/nibConf/defaultPara/wxc2_sys.conf b/wxc2_omc/configuration/nibConf/defaultPara/wxc2_sys.conf new file mode 100755 index 0000000..67abee2 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/wxc2_sys.conf @@ -0,0 +1,2 @@ +mss-0=172.18.98.1; +mss-1=172.18.99.1; diff --git a/wxc2_omc/configuration/nibConf/defaultPara/wxc2exit.txt b/wxc2_omc/configuration/nibConf/defaultPara/wxc2exit.txt new file mode 100755 index 0000000..4371dca --- /dev/null +++ b/wxc2_omc/configuration/nibConf/defaultPara/wxc2exit.txt @@ -0,0 +1,4 @@ +WXC2 procedure exit log + Time: Wed Oct 6 21:28:00 2004 + +Now module: MSC diff --git a/wxc2_omc/configuration/nibConf/defaultPara/xap_sysparam.conf b/wxc2_omc/configuration/nibConf/defaultPara/xap_sysparam.conf new file mode 100755 index 0000000..e6e496d Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultPara/xap_sysparam.conf differ diff --git a/wxc2_omc/configuration/nibConf/defaultSubs/HlrSubsBk.dat b/wxc2_omc/configuration/nibConf/defaultSubs/HlrSubsBk.dat new file mode 100755 index 0000000..3bb5f7a Binary files /dev/null and b/wxc2_omc/configuration/nibConf/defaultSubs/HlrSubsBk.dat differ diff --git a/wxc2_omc/configuration/nibConf/display.php b/wxc2_omc/configuration/nibConf/display.php new file mode 100755 index 0000000..b370c60 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/display.php @@ -0,0 +1,412 @@ +Loading parameters!
      "; + $commStr=''; + for($i=0;$itmpCommStr=$tmpCommStr"; + $commStr.=$tmpCommStr; + if($DEBUG)echo "
      commStr=$commStr"; + } + + //check the command status + if($commStr==""){ + echo "

      Send the command error, Please check the device state!
      "; + } + + $cmmIdStrArr=explode("-",$commStr); + + for($i=0;$i $maxNum){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + echo "Error: $tmpRemark.
      "; + break; + } + echo ""; + flush(); + + $selComm = "SELECT commState,remark,objId,sysTypeNo FROM $sysCommTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes)>0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpOid=$selRow[objId]; + $tmpSysTypeNo=$selRow[sysTypeNo]; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + for($j=0;$j"; + } + } + + $selComm = "SELECT commState,remark FROM $sysCommTable WHERE $tmpWhere AND (commState='$nWaitProc' OR commState='$nInProc')"; + + if($DEBUG)echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + echo "
      Process finished
      "; + break; + } + + for($i=0;$imoveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + } +} + +//XAPP Parameters +$selSql = "SELECT initValue FROM OBJ_225.param_99 + WHERE level_1='2' AND level_2<'7' AND level_3='0' ORDER BY level_2 ASC"; + +if($DEBUG) +echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); + +$selRows=mysqli_fetch_array($selResult); +$tmpArr=explode("E",$selRows[initValue]); +$mcc=$tmpArr[0]; + +$selRows=mysqli_fetch_array($selResult); +$tmpArr=explode("E",$selRows[initValue]); +$mnc=$tmpArr[0]; + +$selRows=mysqli_fetch_array($selResult); +$tmpArr=explode("E",$selRows[initValue]); +$cc=$tmpArr[0]; + +$selRows=mysqli_fetch_array($selResult); +$tmpArr=explode("E",$selRows[initValue]); +$ndc=$tmpArr[0]; + +$selRows=mysqli_fetch_array($selResult); +$tmpArr=explode("E",$selRows[initValue]); +$internationalPrefix=$tmpArr[0]; + +$selRows=mysqli_fetch_array($selResult); +$tmpArr=explode("E",$selRows[initValue]); +$nationalPrefix=$tmpArr[0]; + +//MSRN +$selSql = "SELECT initValue FROM OBJ_325.param_99 + WHERE level_1='2' AND level_2='1' AND level_3='13'"; + +if($DEBUG) +echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); +$msrnStart=getBitValue($selRows[initValue],"0.0-7.7"); +$tmpArr=explode("F",$msrnStart); +$msrnStart=$tmpArr[0]; + +$msrnEnd=getBitValue($selRows[initValue],"8.0-15.7"); +$tmpArr=explode("F",$msrnEnd); +$msrnEnd=$tmpArr[0]; + +//SN +$selSql = "SELECT initValue FROM OBJ_223.param_99 + WHERE level_1='2' AND level_2='1' AND level_3='4'"; + +if($DEBUG) +echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); +$snStart=getBitValue($selRows[initValue],"1.0-10.7"); +$tmpArr=explode("F",$snStart); +$snStart=$tmpArr[0]; + +$selSql = "SELECT initValue FROM OBJ_223.param_99 + WHERE level_1='2' AND level_2='2' AND instanceNo='2'"; + +if($DEBUG) +echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); +$snEnd=getBitValue($selRows[initValue],"12.0-21.7"); +$tmpArr=explode("F",$snEnd); +$snEnd=$tmpArr[0]; +if(strlen($snEnd)<=0) + $snEnd=$msrnEnd; + +$selSql = "SELECT initValue FROM OBJ_223.param_99 + WHERE level_1='2' AND level_2='2' AND instanceNo='1'"; + +if($DEBUG) +echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); + +//check the nib configiration +$gtFlag=getBitValue($selRows[initValue],"0.0-0.7"); +$gtNumber=getBitValue($selRows[initValue],"1.0-1.7"); + +if($gtFlag=0||$gtNumber!=1){ + $snStart=''; + $snEnd=''; +}else{ + $tmpLength=strlen($cc)+strlen($ndc); + $snStart=substr($snStart,$tmpLength); + $snEnd=substr($snEnd,$tmpLength); +} + +//MSIN +$selSql = "SELECT initValue FROM OBJ_223.param_99 + WHERE level_1='2' AND level_2='2' AND instanceNo='0'"; + +if($DEBUG) +echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); +$msinStart=getBitValue($selRows[initValue],"2.0-11.7"); +$tmpArr=explode("F",$msinStart); +$msinStart=$tmpArr[0]; + +$msinEnd=getBitValue($selRows[initValue],"12.0-21.7"); +$tmpArr=explode("F",$msinEnd); +$msinEnd=$tmpArr[0]; + +//check the nib configiration +$gtFlag=getBitValue($selRows[initValue],"0.0-0.7"); +$gtNumber=getBitValue($selRows[initValue],"1.0-1.7"); + +if($gtFlag==0||$gtNumber!=6){ + $msinStart=''; + $msinEnd=''; +}else{ + $tmpLength=strlen($mcc)+strlen($mnc); + $msinStart=substr($msinStart,$tmpLength); + $msinEnd=substr($msinEnd,$tmpLength); + +} + + +//PSTN Parameters +$selSql = "SELECT initValue FROM OBJ_322.param_99 + WHERE level_1='2' AND level_2='1' AND level_3='4' AND instanceNo='0'"; + +if($DEBUG) +echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); +$tgEnableFlag=getBitValue($selRows[initValue],"4.0-4.0"); +$tgCategory=getBitValue($selRows[initValue],"4.3-4.5"); + +if($tgEnableFlag==1&&$tgCategory==0) +{ + $dpc=getBitValue($selRows[initValue],"0.0-3.7"); + $dpc=$dpc-0; + $niType=getBitValue($selRows[initValue],"5.0-5.7"); + $niLength=getBitValue($selRows[initValue],"12.0-12.7"); + $ni=$niLength*2+$niType/2; + + $levelWhere = getLevelWhere($NetOPCArr[$ni][0]); + $tmpSql="SELECT initValue FROM OBJ_222.param_99 WHERE $levelWhere"; + if($DEBUG) + echo "
      tmpSql=$tmpSql"; + $tmpResult=mysqli_query($pubConn,$tmpSql); + $tmpRows=mysqli_fetch_array($tmpResult); + $opc= $tmpRows[initValue]; + $opc=$opc-0; +} +?> + +
      + + +"; +echo ""; +echo ""; +echo "
      "; +echo ""; +echo "
      " +?> +
      + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Upload BSS Parameters"; +echo "
      BSS IP Address  Example:172.18.128.106
      BSS Configuration File Directory  Example: /hd0/iw07_00.010/compile/cfg
      "; +echo ""; +echo "
      " +?> +
      + + + + +"; +echo ""; +echo ""; + +//mcc +echo ""; +echo ""; +echo ""; +echo ""; + +//mnc +echo ""; +echo ""; +echo ""; +echo ""; + + +//cc +echo ""; +echo ""; +echo ""; +echo ""; + +//ndc +echo ""; +echo ""; +echo ""; +echo ""; + +//IMSI Range +echo ""; +echo ""; +echo ""; + + +//sn +echo ""; +echo ""; +echo ""; +echo ""; + +//MSRN Range +echo ""; +echo ""; +echo ""; +echo ""; + +//international prefix +echo ""; +echo ""; +echo ""; +echo ""; + +//national prefix +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; + +echo "
      "; +echo "Connect UNIB To BSS"; +echo "
      MCC
      MNC
      CC
      NDC
      MSIN - "; +echo "
      SN - "; +echo "
      MSRN Range - "; +echo "
      International Prefix
      National Prefix
      "; +echo ""; +echo "
      "; +?> +
      + + + +"; +echo ""; +echo ""; + +//Network Indicator +echo ""; +echo ""; +echo ""; +echo ""; + +//opc +echo ""; +echo ""; +echo ""; +echo ""; + +//dpc +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; + +echo "
      "; +echo "Connect UNIB To PSTN"; +echo "
      Network Indicator"; +echo ""; +echo "
      OPC(Hex)
      DPC(Hex)
      "; +echo ""; +echo "
      "; +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/nibConf/mssStart b/wxc2_omc/configuration/nibConf/mssStart new file mode 100755 index 0000000..850a8d2 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/mssStart @@ -0,0 +1,38 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="$1" +inp1="ems " +inp2="Ems123! " + +inputfile="inabc" +outputfile="out.log" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & +sleep 2; echo $inp1 >>$inputfile +sleep 2; echo $inp2 >>$inputfile + +#tail -f $outputfile & + +sleep 3; echo "su -" >>$inputfile +sleep 2; echo "rootaa" >>$inputfile +sleep 2; echo "/usr/local/wxc2/tools/myipcrm" >>$inputfile +sleep 3; echo "wxc2d start" >>$inputfile +sleep 2; echo "exit" >>$inputfile +sleep 2; echo "exit" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + +#ps -ef | grep telnet | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh +#ps -ef | grep tail | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh diff --git a/wxc2_omc/configuration/nibConf/nibConf.php b/wxc2_omc/configuration/nibConf/nibConf.php new file mode 100755 index 0000000..d1ce6a4 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/nibConf.php @@ -0,0 +1,434 @@ + 'MTP3 parameters','sysTypeNo' => '222', 'sysId' => '222_99_99', 'oid' => '3.7', 'value' => '01'), + array('remark' => 'SCCP parameters','sysTypeNo' => '223','sysId' => '223_99_99', 'oid' => '3.2', 'value' => '00'), + array('remark' => 'MSC parameters','sysTypeNo' => '322','sysId' => '322_99_99', 'oid' => '3.2', 'value' => '5A'), + array('remark' => 'VLR parameters','sysTypeNo' => '325','sysId' => '325_0_0', 'oid' => '3.3', 'value' => '00'), + // reload subs + array('remark' => 'HLR subscribers','sysTypeNo' => '330','sysId' => '330_99_99', 'oid' => '2.1.19', 'value' => '01') +); + + +$saveCmdArr=array( + array('remark' => 'MTP3 parameters','sysTypeNo' => '222', 'sysId' => '222_99_99', 'oid' => '3.7', 'value' => '02'), + array('remark' => 'SCCP parameters','sysTypeNo' => '223','sysId' => '223_99_99', 'oid' => '3.2', 'value' => '02'), + array('remark' => 'XAPP parameters','sysTypeNo' => '225','sysId' => '225_99_99', 'oid' => '3.2', 'value' => '01'), + array('remark' => 'MSC parameters','sysTypeNo' => '322','sysId' => '322_99_99', 'oid' => '3.2', 'value' => 'B5'), + array('remark' => 'VLR parameters','sysTypeNo' => '325','sysId' => '325_0_0', 'oid' => '3.3', 'value' => '01'), + array('remark' => 'HLR parameters','sysTypeNo' => '330','sysId' => '330_0_0', 'oid' => '2.2.2', 'value' => '01'), + array('remark' => 'AUC parameters','sysTypeNo' => '340','sysId' => '340_99_99', 'oid' => '2.2.2', 'value' => '01'), + array('remark' => 'SMSC parameters','sysTypeNo' => '350','sysId' => '350_99_99', 'oid' => '3.3', 'value' => '01') +); + +$getParamArr=array( + array('remark' => 'MTP3 parameters','sysTypeNo' => '222', 'sysId' => '222_99_99','paramTable'=>'OBJ_222.param_99', 'oid' => '2'), + array('remark' => 'SCCP parameters','sysTypeNo' => '223','sysId' => '223_99_99', 'paramTable'=>'OBJ_223.param_99','oid' => '2'), + array('remark' => 'XAPP parameters','sysTypeNo' => '225','sysId' => '225_99_99', 'paramTable'=>'OBJ_225.param_99','oid' => '2'), + array('remark' => 'MSC parameters','sysTypeNo' => '322','sysId' => '322_99_99', 'paramTable'=>'OBJ_322.param_99','oid' => '2.1.4'), + array('remark' => 'VLR parameters','sysTypeNo' => '325','sysId' => '325_99_99', 'paramTable'=>'OBJ_325.param_99','oid' => '2.1.13') +); + + +$NetOPCArr=array( + //array('oid', 'name'), + array('2.3.1', '14bit international network'), + array('2.3.3', '14bit national network'), + array('2.3.5', '24bit international network'), + array('2.3.7', '24bit national network') +); +?> + + + + +

      " name="paraConf" enctype="multipart/form-data"> +"; +echo ""; +echo ""; +echo "$strConfiguration > $strNetwork >NIB"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> + +"; + + $updateSql="REPLACE param_0 SELECT * FROM nibPara"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + + $commStr=sysCommSend('111_0_99',$nSetComm,'2'); + if($DEBUG)echo "
      commStr=$commStr"; + + //check the command status + if($commStr==""){ + echo "
      Send the command error, Please 8KE1 card's state!
      "; + require("./display.php"); + exit(); + } + + $cmmIdStrArr=explode("-",$commStr); + + for($i=0;$i $maxNum){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + echo "
      Error: $tmpRemark."; + require("./display.php"); + exit(); + } + echo ""; + flush(); + + $selComm = "SELECT commState,remark,objId,sysTypeNo FROM $sysCommTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes)>0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpOid=$selRow[objId]; + $tmpSysTypeNo=$selRow[sysTypeNo]; + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + + echo "
      Error: $tmpRemark."; + require("./display.php"); + exit(); + } + + $selComm = "SELECT commState,remark FROM $sysCommTable WHERE $tmpWhere AND (commState='$nWaitProc' OR commState='$nInProc')"; + + if($DEBUG)echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $sysCommTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + echo "Finished"; + break; + } + + $getSysIdSql = "SELECT * FROM $sysInfoTable + WHERE sysTypeNo='320' + ORDER BY baseStat DESC,updateTime DESC"; + + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult=mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + + while($getSysIdRows=mysqli_fetch_array($getSysIdResult)){ + $dstSeverIp=$getSysIdRows[ip]; + echo "
      Stopping MSS,please wait about 3 minutes!
      "; + flush(); + $tmpScript="./beforeFtp".' '.$dstSeverIp; + system($tmpScript); + + //clear heartbeat + $delSql="DELETE FROM OMC_PUB.sysStat"; + mysqli_query($pubConn,$delSql); + + for($i=0;$i<30;$i++){ + echo ""; + flush(); + sleep(4); + } + echo "Finished"; + flush(); + echo "
      Uploading MSS parameters and subscribers!
      "; + flush(); + + $ftpCon=@ftp_connect($dstSeverIp); + + if($ftpCon < 0){ + echo "
      Connect $dstSeverIp Failed!"; + }else{ + if(!@ftp_login($ftpCon,$ftpInfo[UserName],$ftpInfo[Password])){ + echo "
      Login $dstSeverIp Failed!"; + }else{ + $finishFlag=1; + $directory=$defaultParaDirectory; + $mydir=@dir($directory); + while($file=$mydir->read()){ + if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){ + continue; + }elseif($file =="." || $file ==".."){ + continue; + }else{ + $remoteFileName='/usr/local/wxc2/bin/conf/'.$file; + $localFile=$directory.'/'.$file; + if($DEBUG) + echo "
      dstSeverIp=$dstSeverIp,remoteFileName=$remoteFileName,localFile=$localFile"; + if(!@ftp_put($ftpCon,$remoteFileName,$localFile,FTP_ASCII)){ + echo "
      Put $file Failed,please check the network configuration and network speed"; + $finishFlag=0; + break; + } + } + echo ""; + flush(); + }//end of while + $mydir->close(); + + //upload the subscribers + $directory=$defaultSubsDirectory; + $mydir=@dir($directory); + while($file=$mydir->read()){ + if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){ + continue; + }elseif($file =="." || $file ==".."){ + continue; + }else{ + $remoteFileName='/usr/local/backup/'.$file; + $localFile=$directory.'/'.$file; + if(!@ftp_put($ftpCon,$remoteFileName,$localFile,FTP_ASCII)){ + echo "
      Put $file Failed,please check the network configuration and network speed"; + $finishFlag=0; + break; + } + } + echo ""; + flush(); + }//end of while + $mydir->close(); + ftp_quit($ftpCon); + if($finishFlag==1) + echo "Finished"; + } + } + + echo "
      Starting MSS,please wait about 3 minutes!
      "; + flush(); + $tmpScript="./mssStart".' '.$dstSeverIp; + system($tmpScript); + + for($i=0;$i<45;$i++){ + $tmpSql = "SELECT * FROM OMC_PUB.sysStat WHERE sysTypeNo='200' AND sysNo='9'"; + if($DEBUG) echo "
      tmpSql=$tmpSql"; + $tmpResult=mysqli_query($pubConn,$tmpSql); + echo mysqli_error($pubConn); + if(mysqli_num_rows($tmpResult)>0) + break; + echo ""; + flush(); + sleep(4); + } + if($i==30) + echo "Starting MSS failed,please check it"; + else + echo "Finished"; + flush(); + } + + echo "
      Process finished
      "; +} + +if($uploadBss){ + echo "
      Uploading BSS parameters!
      "; + flush(); + if($DEBUG) + echo "
      bssIpAddr=$bssIpAddr"; + + if(!isset($bssIpAddr)||strlen($bssIpAddr)<=0){ + echo "
      BSS's ip is error"; + require("./display.php"); + exit(); + } + + $ftpCon=@ftp_connect($bssIpAddr); + if($ftpCon < 0){ + echo "
      BSS's ip is error or connect $bssIpAddr Failed!"; + require("./display.php"); + exit(); + }else{ + if(!@ftp_login($ftpCon,'','')){ + echo "
      BSS's ip is error or login $bssIpAddr Failed!"; + require("./display.php"); + exit(); + }else{ + if(!isset($bssConfFileDirectory)||strlen($bssConfFileDirectory)<=0){ + echo "
      BSS's directory is error"; + require("./display.php"); + exit(); + }else{ + $directory=$bssParaDirectory; + $mydir=@dir($directory); + while($file=$mydir->read()){ + if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){ + continue; + }elseif($file =="." || $file ==".."){ + continue; + }else{ + $remoteFileName=$bssConfFileDirectory.'/'.$file; + $localFile=$directory.'/'.$file; + if($DEBUG) + echo "
      bssIpAddr=$bssIpAddr,remoteFileName=$remoteFileName,localFile=$localFile"; + if(!@ftp_put($ftpCon,$remoteFileName,$localFile,FTP_BINARY)){ + echo "
      BSS's directory is error or put $file Failed"; + require("./display.php"); + exit(); + } + } + echo ""; + flush(); + }//end of while + echo "Finished"; + flush(); + + $mydir->close(); + ftp_quit($ftpCon); + } + } + } + + echo "
      Rebooting BSS,please wait about 3 minutes!
      "; + flush(); + + $tmpScript="./bssReboot".' '.$bssIpAddr; + + if($DEBUG) + echo "
      tmpScript=$tmpScript"; + + system($tmpScript); + + //clear heartbeat + $delSql="DELETE FROM OMC_PUB.sysStat"; + mysqli_query($pubConn,$delSql); + + for($i=0;$i<4;$i++){ + echo ""; + flush(); + sleep(4); + } + + for($i=0;$i<60;$i++){ + $getStatSql = "SELECT detailStat FROM OMC_PUB.sysStat + WHERE sysTypeNo='111' AND sysNo='0'"; + + if($DEBUG) + echo "
      getStatSql=$getStatSql"; + $getStatResult=mysqli_query($pubConn,$getStatSql); + echo mysqli_error($pubConn); + + if($getStatRows=mysqli_fetch_array($getStatResult)){ + $ALink_stat=getBitValue($getStatRows[detailStat],"25.1-25.1"); + //echo "
      ALink_stat=$ALink_stat"; + if($ALink_stat==1){ + break; + }else{ + echo ""; + flush(); + sleep(4); + } + }else{ + echo "Cannot receive 8KE1 card heartbeat,please check 8KE1 card"; + break; + } + } + if($i==60) + echo "The A link status is error,please check it"; + else + echo "Finished"; + echo "
      Process finished"; +} + +if($configureMss){ + require("./configureForBss.php"); +} + +if($configurePstn){ + require("./configureForPstn.php"); +} + +require("./display.php"); +?> + + + diff --git a/wxc2_omc/configuration/nibConf/pm.cmd b/wxc2_omc/configuration/nibConf/pm.cmd new file mode 100755 index 0000000..56c004e --- /dev/null +++ b/wxc2_omc/configuration/nibConf/pm.cmd @@ -0,0 +1,44 @@ +# +# Copyright (c) 1994, 1995 +# interWAVE Communications Inc, Redwood City, CA USA. All rights reserved. +# +# $Header: /sw2/cvs/iw/compile/pm.cmd,v 1.1.2.2 1999/08/17 22:34:23 cwlin Exp $ +# +# DESCRIPTION: +# +# cwlin - This file is a Post Mortem Advanced command file which is used for +# collecting more information besides tt(), ti(), memShow and i() +# before sysmon reboots the unit. +# Here are some limitation for the syntax: +# +# 1. For all the comments, there has to be a "#" at the VERY beginning +# of every line, which means no blank in front. +# # This is a comment +# +# 2. Only a FUNCTION can be considered as a command. +# Flags (such as SS7Down) will get a printout as "This is not a command!" +# and will not take effect. +# +# 3. There are at most 100 commands can be put in. +# +# 4. Can only support up to TWO arguments in each command, either numeric or textual ones: +# wxlog "all","error" +# cpShowCCB 25 +# +# 5. Can't support arguments with space within the double quote. +# System will ignore everything afterward. +# wxlog "all", " error " ---- BAD argument +# +# 6. Some commands will not response if log_none has not been read in advance. +# So better put "log_none" at first to be safe. +# +# 7. There can be only one command in each line. +# Only the FIRST one will be taken if it's written like "ShowLct; xsWhat" +# +# +# +# + + +# Example command +log_none diff --git a/wxc2_omc/configuration/nibConf/pm_bts.cmd b/wxc2_omc/configuration/nibConf/pm_bts.cmd new file mode 100755 index 0000000..e16b489 --- /dev/null +++ b/wxc2_omc/configuration/nibConf/pm_bts.cmd @@ -0,0 +1,44 @@ +# +# Copyright (c) 1994, 1995 +# interWAVE Communications Inc, Redwood City, CA USA. All rights reserved. +# +# $Header: /sw2/cvs/iw/compile/pm_bts.cmd,v 1.1.2.2 1999/08/17 22:37:31 cwlin Exp $ +# +# DESCRIPTION: +# +# cwlin - This file is a Post Mortem Advanced command file which is used for +# collecting more information besides tt(), ti(), memShow and i() +# before sysmon reboots the unit. +# Here are some limitation for the syntax: +# +# 1. For all the comments, there has to be a "#" at the VERY beginning +# of every line, which means no blank in front. +# # This is a comment +# +# 2. Only a FUNCTION can be considered as a command. +# Flags (such as SS7Down) will get a printout as "This is not a command!" +# and will not take effect. +# +# 3. There are at most 100 commands can be put in. +# +# 4. Can only support up to TWO arguments in each command, either numeric or textual ones: +# wxlog "all","error" +# cpShowCCB 25 +# +# 5. Can't support arguments with space within the double quote. +# System will ignore everything afterward. +# wxlog "all", " error " ---- BAD argument +# +# 6. Some commands will not response if log_none has not been read in advance. +# So better put "log_none" at first to be safe. +# +# 7. There can be only one command in each line. +# Only the FIRST one will be taken if it's written like "ShowLct; xsWhat" +# +# +# +# + + +# Example command +log_none diff --git a/wxc2_omc/configuration/nrtrde/hpmnInfo.php b/wxc2_omc/configuration/nrtrde/hpmnInfo.php new file mode 100755 index 0000000..4655a3d --- /dev/null +++ b/wxc2_omc/configuration/nrtrde/hpmnInfo.php @@ -0,0 +1,122 @@ + + + + + + + + + +"; +echo ""; +echo ""; +echo "$strMaintenance > Control Panel > NRTRDE HPMN"; +echo ""; +echo ""; +$helpId="5.2.2"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +?> +"; + + $pubDb="OMC_PUB"; + $delSql = "DELETE FROM hpmnConf WHERE mcc='$mcc' and mnc='$mnc' "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + echo "Delete successfully!
      "; + } + + //Get the hpmn server info from database + $database="OMC_PUB"; + $selSql = "SELECT * FROM hpmnConf "; + $selRes = @mysqli_query($pubConn,$selSql); + $HpmnCount=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + //echo "count:$HpmnCount
      "; + + $HpmnIndex=0; + while($selRow = @mysqli_fetch_array($selRes)){ + $HpmnMcc[$HpmnIndex]=$selRow[mcc]; + $HpmnMnc[$HpmnIndex]=$selRow[mnc]; + $HpmnTadig[$HpmnIndex]=$selRow[tadig]; + $HpmnServerIP[$HpmnIndex]=$selRow[serverIP]; + $HpmnLoginName[$HpmnIndex]=$selRow[loginName]; + $HpmnLoginPass[$HpmnIndex]=$selRow[loginPass]; + $HpmnTimeSlot[$HpmnIndex]=$selRow[timeslot]; + $HpmnReportDir[$HpmnIndex]=$selRow[reportDir]; + $HpmnNrtrdeDir[$HpmnIndex]=$selRow[nrtrdeDir]; + $HpmnIndex++; + //echo "HpmnMcc[$HpmnIndex]={$HpmnMcc[$HpmnIndex]}
      "; + }; + + echo "

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $valueLabel=array("900"=>"15 Min","1800"=>"30 Min","3600"=>"1 Hour","7200"=>"2 Hours","10800"=>"3 Hours","14400"=>"4 Hours"); + for($i=0;$i<$HpmnCount;$i++) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $show=$valueLabel[$HpmnTimeSlot[$i]]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo ""; + + echo "
      No.MCCMNCTadigServer IPLogin NameLogin PWIntervalReport DirectoryNRTRDE DirectoryDelete
      $i{$HpmnMcc[$i]}{$HpmnMnc[$i]}{$HpmnTadig[$i]}{$HpmnServerIP[$i]}{$HpmnLoginName[$i]}{$HpmnLoginPass[$i]}$show{$HpmnReportDir[$i]}{$HpmnNrtrdeDir[$i]}Delete
      New--------------------
      "; +adjust_content_tail(); +?> diff --git a/wxc2_omc/configuration/nrtrde/operation.php b/wxc2_omc/configuration/nrtrde/operation.php new file mode 100755 index 0000000..2a2dca6 --- /dev/null +++ b/wxc2_omc/configuration/nrtrde/operation.php @@ -0,0 +1,242 @@ + + + + + +"; +echo ""; +echo ""; +echo "$strMaintenance > Control Panel > NRTRDE HPMN"; +echo ""; +echo ""; +$helpId="5.2.2"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + $DEBUG=0; + + if($DEBUG) + echo "mcc=$mcc,mnc=$mnc,operation=$operation
      "; + + echo "

      "; + + if($operation=="save") + { + $pubDb="OMC_PUB"; + if($saveType=="edit") + $updSql = "UPDATE hpmnConf SET tadig='$edit_tadig',serverIP='$edit_serverIP',loginName='$edit_loginName',loginPass='$edit_loginPass',timeslot='$edit_interval',reportDir='$edit_reportDir',nrtrdeDir='$edit_nrtrdeDir' WHERE mcc='$edit_mcc' AND mnc='$edit_mnc' "; + else + $updSql = "INSERT INTO hpmnConf values('$edit_mcc','$edit_mnc','$edit_tadig','$edit_serverIP','$edit_loginName','$edit_loginPass','$edit_interval','$edit_reportDir','$edit_nrtrdeDir') "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + echo "\n\n"; + } + //Add a new hpmn server + else if($operation=="new") + { + + echo "

      "; + echo ""; + echo ""; + echo ""; + + //mcc + echo ""; + echo ""; + echo ""; + echo ""; + + //mnc + echo ""; + echo ""; + echo ""; + echo ""; + + //tadig + echo ""; + echo ""; + echo ""; + + //serverIP + echo ""; + echo ""; + echo ""; + + //loginName + echo ""; + echo ""; + echo ""; + + //loginPass + echo ""; + echo ""; + echo ""; + + //timeslot + $valueList=array(900,1800,3600,7200,10800,14400); + $valueLabel=array("15 Min","30 Min","1 Hour","2 Hours","3 Hours","4 Hours"); + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + //reportDir + echo ""; + echo ""; + echo ""; + + //nrtrdeDir + echo ""; + echo ""; + echo ""; + + echo "
      NameValue
      MCC
      MNC
      Tadig
      Server IP
      Login Name
      Login Password
      Interval
      Report Directory
      NRTRDE Directory
      "; + } + //Edit a hpmn server + else if($operation=="edit") + { + //Get the hpmn server info from database + $database="OMC_PUB"; + $selSql = "SELECT * FROM hpmnConf where mcc='$mcc' and mnc='$mnc' "; + $selRes = @mysqli_query($pubConn,$selSql); + $HpmnCount=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + //echo "count:$HpmnCount
      "; + + $selRow = @mysqli_fetch_array($selRes); + $HpmnMcc=$selRow[mcc]; + $HpmnMnc=$selRow[mnc]; + $HpmnTadig=$selRow[tadig]; + $HpmnServerIP=$selRow[serverIP]; + $HpmnLoginName=$selRow[loginName]; + $HpmnLoginPass=$selRow[loginPass]; + $HpmnTimeSlot=$selRow[timeslot]; + $HpmnReportDir=$selRow[reportDir]; + $HpmnNrtrdeDir=$selRow[nrtrdeDir]; + + + echo "

      "; + echo ""; + echo ""; + echo ""; + + //mcc + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + //mnc + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + //tadig + echo ""; + echo ""; + echo ""; + + //serverIP + echo ""; + echo ""; + echo ""; + + //loginName + echo ""; + echo ""; + echo ""; + + //loginPass + echo ""; + echo ""; + echo ""; + + //timeslot + $valueList=array(900,1800,3600,7200,10800,14400); + $valueLabel=array("15 Min","30 Min","1 Hour","2 Hours","3 Hours","4 Hours"); + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + //reportDir + echo ""; + echo ""; + echo ""; + + //nrtrdeDir + echo ""; + echo ""; + echo ""; + + echo "
      NameValue
      MCC$HpmnMccMCC
      MNC$HpmnMncMNC
      Tadig
      Server IP
      Login Name
      Login Password
      Interval
      Report Directory
      NRTRDE Directory
      "; + } + //save button + echo ""; + + //remark + echo "

      Remark:

      "; + echo "Interval: The interval to make NRTRDE files for the HPMN

      "; + echo "Report Directory: The directory to send the report files to

      "; + echo "NRTRDE Directory: The directory to send the NRTRDE files to

      "; + + echo "

      "; +adjust_content_tail(); +?> diff --git a/wxc2_omc/configuration/paramConfiguration/handleOpaquePara.php b/wxc2_omc/configuration/paramConfiguration/handleOpaquePara.php new file mode 100755 index 0000000..fae7464 --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/handleOpaquePara.php @@ -0,0 +1,667 @@ +paraSql=$paraSql"; +$paraResult=mysqli_query($pubConn,$paraSql); +$paraRows=@mysqli_fetch_array($paraResult); + +$setValue=$paraRows[initValue]; +$readValue=$paraRows[readValue]; +if($DEBUG) + echo "
      setValue=$setValue"; + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + echo "
      Error in omcStrFill:the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + +//=======================Get value From submit=================== +if($set == 'Set'){ + //sort by offset + for($i=1;$i<=$unitNum;$i++){ + $tmpDef = ${'unitDef_'.$i}; + $tmpValue = ${'unit_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$i] = $tmpDef; + $tmpDefArr=explode('-',$tmpDef); + $sortArr[$i] = $tmpDefArr[0]; + $valueArr[$i] = $tmpValue; + } + $lastValue = ''; + $k = 0; + asort($sortArr); + for(reset($sortArr); $key = key($sortArr); next($sortArr)){ + if($DEBUG) echo "
      sortArr[$key] = {$sortArr[$key]}"; + if($DEBUG) echo "
      unitValue = {$valueArr[$key]}"; + $unitValue = $valueArr[$key]; + if($DEBUG) echo "
      defArr[$key] = {$defArr[$key]}"; + $unitDefArr = explode('-',$defArr[$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1){ + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG)echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + }else{//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + }else{ + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'toLatitude': + //feake show 4byte + if($unitValue>90) + { + $unitValue=90; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + if($unitValue<-90) + { + $unitValue=-90; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + $byteValue=$unitValue*pow(2,23)/90; + $byteValue=ceil($byteValue); + $byteValue=dechex($byteValue); + $byteValue=omcStrFill($byteValue,8,'high','0'); + break; + case 'toLongitude': + if($unitValue>180) + { + $unitValue=180; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + if($unitValue<-180) + { + $unitValue=-180; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + $byteValue=$unitValue*pow(2,24)/360; + $byteValue=ceil($byteValue); + $byteValue=dechex($byteValue); + $byteValue=omcStrFill($byteValue,8,'high','0'); + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + } + $lastValue=strtoupper($lastValue); + if($DEBUG) echo "
      lastValue = $lastValue "; + $updateSql="UPDATE $paraTable SET initValue='$lastValue' WHERE $levelWhere AND instanceNo=$instanceNo"; + if($DEBUG)echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + + if($lastValue==$readValue) + $returnColor= $settedColor; + else + $returnColor= $notSettedColor; + if(!$DEBUG){ + + //discard the postfix E + if(strstr($tmpDef,"keepHex-low")) + { + $oidwhere=getLevelWhere($oidStr); + $sql="select setTemplate_2 from OBJ_$sysTypeNo.paramConf where $oidwhere "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $split=explode("[unit]",$row[0]); + $tmplen=sizeof($split); + //only one unit + //if($tmplen == 2) + { + $split2=explode("keepHex-low-",$row[0]); + $repl=substr($split2[1],0,1); + $lastValue=str_replace($repl," ",$lastValue); + } + } + if(strlen(trim($lastValue))<=0) + $lastValue="--"; + + echo ""; + exit(); + }else{ + echo "
      lastValue = $lastValue "; + } +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +
      " > +"; +}else{ + echo ""; +} + +for($i=1;$i"; +}//end of for(..) + +echo "
      "; + //unit input name + $unitName = "unit_".$i; + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$i]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + //show Unit Name + echo "$tlvArr[0]"; + echo " "; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + $inputValue = trim($inputValue);//add by oven 2006-8-2 remvove dirty in Mozilla. + } + break; + case 'toLatitude': + //feake edit float + if($byteValue[0]=='F' || $byteValue[0]=='f') + { + $tmp=hexdec($byteValue)-1; + $orgbin=decbin($tmp); + $lastbin=""; + for($ii=0;$ii8) + $inputValue=substr($inputValue,0,8); + + if($inputValue > 90 || $inputValue < -90) + { + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + break; + case 'toLongitude': + if($byteValue[0]=='F' || $byteValue[0]=='f') + { + $tmp=hexdec($byteValue)-1; + $orgbin=decbin($tmp); + $lastbin=""; + for($ii=0;$ii8) + $inputValue=substr($inputValue,0,8); + + if($inputValue > 180 || $inputValue < -180) + { + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG)echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else if($defArr[0] == 'toAscii'){ + for($ii=0;$ii"; + + break; + case 'select': + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + + echo ""; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + echo "\n "; + echo "
      "; + +$remark=nl2br($remark); +echo "
      Remarks:
      $remark

      "; +$unitNum = $i-1; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
      "; +?> + + \ No newline at end of file diff --git a/wxc2_omc/configuration/paramConfiguration/lockTimeSlot.php b/wxc2_omc/configuration/paramConfiguration/lockTimeSlot.php new file mode 100755 index 0000000..ea53eb3 --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/lockTimeSlot.php @@ -0,0 +1,182 @@ + + + + +"; + $trunkTimeSlotEntriesFiled="trunkTimeSlotEntries"; + //get the trunkTimeSlotEntries oid + $sql="select level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 from OBJ_320.paramConf where name_2='$trunkTimeSlotEntriesFiled' "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + if($num == 0) + exit($trunkTimeSlotEntriesFiled." do not exist!
      "); + $pos=0; + $row=@mysqli_fetch_array($res); + $trunkTimeSlotEntriesOid=""; + while($row[$pos]!=0) + { + $trunkTimeSlotEntriesOid.="{$row[$pos]}."; + $pos++; + } + $trunkTimeSlotEntriesOid=substr($trunkTimeSlotEntriesOid,0,strlen($trunkTimeSlotEntriesOid)-1); + //echo "trunkTimeSlotEntriesOid=$trunkTimeSlotEntriesOid
      "; + + //get the trunkTimeSlotEntries value + $oidWhere=getLevelWhere($trunkTimeSlotEntriesOid); + $sql="select readValue from OBJ_320.param_99 where $oidWhere and instanceNo='$instanceNo' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $trunkTimeSlotEntriesValue=$row[0]+0; + //echo "Entries={$row[0]} {$instanceNo}
      "; + + + //show the title + $split=explode(".",$instanceNo); + $tgno=$split[0]+0; + $tkno=$split[1]+0; + echo "MSC > Trunk Group $tgno > Trunk $tkno > Time Slot

      "; + + //set + if($_SERVER['REQUEST_METHOD'] == "POST") + { + echo "Set parameter...
      "; + //echo "trunkTimeSlotEntriesValue=$trunkTimeSlotEntriesValue"; + if($trunkTimeSlotEntriesValue==24) + $totalNum=25; + else if($trunkTimeSlotEntriesValue==32) + $totalNum=32; + for($i=1;$i<$totalNum;$i++) + { + $param="cb_".$i; + $value=$$param; + $index=0; + if($value=="on") + { + $newInstanceNo=$instanceNo.".".omc_keep_length($i,"0",4); + + $tmpWhere=getLevelWhere("2.4.3.1.4"); + $updateSql="UPDATE OBJ_320.param_99 SET initValue=$typeValue WHERE $tmpWhere AND instanceNo='$newInstanceNo'"; + mysqli_query($pubConn,$updateSql); + //echo "typeValue=$typeValue,updateSql=$updateSql

      "; + + /* + $commInfoArr[$index][sysId]=$sysId; + $commInfoArr[$index][oid]="2.4.3.1.4"; + $commInfoArr[$index][instanceNo]=$newInstanceNo; + $index++; + */ + $commIdStr=oidSysCommSend($sysId,3,"2.4.3.1.4",$selectedSysId=-1,$newInstanceNo); + //checkState($commIdStr,"./param_show_table.php?sysId=$sysId&tableOid=$tableOid&instanceNo=$instanceNo"); + //echo "set $newInstanceNo
      "; + + echo ""; + } + } + echo "
      "; + /* + if($index > 0) + { + setParam($commInfoArr); + } + */ + + echo "Close"; + exit(""); + } + + echo "

      "; + + echo "Type

      "; + + + + if($trunkTimeSlotEntriesValue==24) + $totalNum=25; + else if($trunkTimeSlotEntriesValue==32) + $totalNum=32; + echo ""; + echo ""; + echo ""; + echo ""; + //do not need time slot 0 + + for($i=1;$i<$totalNum;$i++) + { + $cbname="cb_".$i; + + $newInstanceNo=$instanceNo.".".omc_keep_length($i,"0",4); + $tmpWhere=getLevelWhere("2.4.3.1.4"); + $sql="select readValue from OBJ_320.param_99 where $tmpWhere and instanceNo='$newInstanceNo' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + + //do not set dchanal time slot + if($row[readValue] != 5) + { + echo ""; + echo ""; + echo ""; + } + } + echo "
      Select All Time Slots"; + echo "
      Time Slot-$i"; + echo "
      "; + + echo "

      "; + + + echo "

      "; + + echo "Remark:
      "; +?> diff --git a/wxc2_omc/configuration/paramConfiguration/mscNITZ.php b/wxc2_omc/configuration/paramConfiguration/mscNITZ.php new file mode 100755 index 0000000..a842e96 --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/mscNITZ.php @@ -0,0 +1,446 @@ + + + + +param_oid=$param_oid
      "; + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + echo "coding_scheme_select=$coding_scheme_select
      "; + echo "network_name_text=$network_name_text
      "; + echo "ci_select=$ci_select
      "; + echo "time_update_option_select=$time_update_option_select
      "; + echo "time_zone_select=$time_zone_select
      "; + + $network_name_7bit_vec=string8bitTo7bit($network_name_text); + $network_name_7bit_hexlen=sizeof($network_name_7bit_vec); + $network_name_7bit_hexlen=$global_len; + $network_name_7bit_hexstr=""; + for($i=0;$i<$network_name_7bit_hexlen;$i++) + { + $tmp=dechex($network_name_7bit_vec[$i]); + $tmp=omc_keep_length($tmp,0,2); + $network_name_7bit_hexstr.=$tmp; + } + $network_name_7bit_hexstr=omc_keep_length($network_name_7bit_hexstr,0,62,0); + $tmp=dechex($network_name_7bit_hexlen); + $tmp=omc_keep_length($tmp,0,2); + $last_hex_value=$tmp; + + $spare_bit_num=strlen($network_name_text)%8; + $byte3bin="1"; + if($coding_scheme_select == 0) + $byte3bin.="000"; + else + $byte3bin.="001"; + if($ci_select == 1) + $byte3bin.="1"; + else + $byte3bin.="0"; + + $spare_bit_num_bin=decbin($spare_bit_num); + $spare_bit_num_bin=omc_keep_length($spare_bit_num_bin,0,3); + $byte3bin.=$spare_bit_num_bin; + + $byte3hex=omc_keep_length(dechex(bindec($byte3bin)),0,2); + $last_hex_value.=$byte3hex; + $last_hex_value.=$network_name_7bit_hexstr; + + $time_update_option_hex=omc_keep_length(dechex($time_update_option_select),0,2); + $time_zone_hex=omc_keep_length(dechex($time_zone_select),0,2); + + $last_hex_value.=$time_update_option_hex; + $last_hex_value.=$time_zone_hex; + echo "last_hex_value=$last_hex_value
      "; + $levels=getLevelWhere($param_oid); + $updSql = "UPDATE OBJ_320.param_99 SET initValue='$last_hex_value' WHERE $levels and instanceNo='$instanceNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + echo ""; + + echo "\n\n"; + +} + +$pubDb="OMC_PUB"; + +$mscTable="OBJ_320.param_99"; +$levels=getLevelWhere($param_oid); +$sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo"; +$res=mysqli_query($pubConn,$sql); +$rows=@mysqli_fetch_array($res); +$initValue=$rows[initValue]; +//$initValue="0484d4f29c0e0000000000000000000000000000000000000000000000000000000101"; +$readValue=$rows[readValue]; + + +//decode +$byte3=substr($initValue,2,2); +$byte3bin=decbin(hexdec($byte3)); +$coding_scheme_value=bindec(substr($byte3bin,1,3)); +$ci_value=bindec(substr($byte3bin,4,1)); +$spare_bit_num=bindec(substr($byte3bin,5,3)); +$network_name_len=hexdec(substr($initValue,0,2)); +$network_name_value=substr($initValue,4,$network_name_len*2); +$network_name_vec=string7bitTo8bit($network_name_value); +$network_name_l=$global_len; +if($spare_bit_num == 0 && $network_name_len != 0) + $network_name_l++; +//$network_name_l-=$network_name_l/8; + +$network_name_value=""; + +for($i=0;$i<$network_name_l;$i++) +{ + $network_name_value.=chr($network_name_vec[$i]); +} +//echo "network_name_value=$network_name_value,$network_name_l"; +//exit(); +$time_update_option_value=hexdec(substr($initValue,66,2)); +$time_zone_value=hexdec(substr($initValue,68,2)); + +/* +echo "coding_scheme_value=$coding_scheme_value
      "; +echo "ci_value=$ci_value
      "; +echo "network_name_len=$network_name_len,network_name_value=$network_name_value
      "; +echo "time_update_option_value=$time_update_option_value
      "; +echo "time_zone_value=$time_zone_value
      "; +*/ + +echo "
      "; +echo ""; + +//Coding Scheme +echo ""; +echo ""; +echo ""; +echo ""; + +//CI +echo ""; +echo ""; +echo ""; +echo ""; + +//Network name +echo ""; +echo ""; +echo ""; +echo ""; + +//Time update option +echo ""; +echo ""; +echo ""; +echo ""; + +//Time zone +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      "; +echo "Coding Scheme"; +echo ""; +echo ""; +echo "
      "; +echo "Add CI"; +echo ""; +echo ""; +echo "
      Network Name"; +echo ""; +echo "
      "; +echo "Time Update Option"; +echo ""; +echo ""; +echo "
      "; +echo "Time Zone"; +echo ""; +echo ""; +echo "
      "; + +echo "
      Remark:

      "; +echo "Network Identity and Time Zone

      "; +echo "- Coding Scheme: Indicate that 7-bit or UCS2 coding scheme is used.
      "; +echo "- Add CI: Indicate whether the MS should add the letters for the Country's Initials to the text string.
      "; +echo "- Network Name: A text string is to pass to the MS via NITZ.
      "; +echo "- Time Update Option: Determine whether time and time zone info is transferred to MS via NITZ.
      "; +echo "- Time Zone: Specify the local time zone.
      "; + +echo "
      "; +echo ""; +echo "  "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; + +$global_len=0; +function string8bitTo7bit($strin) +{ + global $global_len; + $len=strlen($strin); + if($len <= 0) + return ""; + + $global_len=$len-floor($len/8);; + + for($i=0;$i<$len;$i++) + { + $inHex[$i]=ord($strin[$i]); + switch($inHex[$i]) + { + //'@' + case 64: + $inHex[$i]=0x00; + break; + //'$' + case 36: + $inHex[$i]=0x02; + break; + //'_' + case 95: + $inHex[$i]=0x11; + break; + //'[' + case 91: + $inHex[$i]=0x28; + break; + //']' + case 93: + $inHex[$i]=0x29; + break; + //'/' + case 47: + $inHex[$i]=0x2f; + break; + //''' + case 96: + $inHex[$i]=0x27; + break; + //'{' + case 123: + $inHex[$i]=0x28; + break; + //'}' + case 125: + $inHex[$i]=0x29; + break; + case 0x82: + $inHex[$i]=0x05; + break; + case 0x85: + $inHex[$i]=0x7F; + break; + case 0x8A: + $inHex[$i]=0x04; + break; + case 0x8D: + $inHex[$i]=0x07; + break; + case 0x95: + $inHex[$i]=0x08; + break; + case 0x97: + $inHex[$i]=0x06; + break; + case 0x9D: + $inHex[$i]=0x03; + break; + default: + break; + } + } + + $n=0; + $index=0; + for($i=0;$i<=$len;$i++) + { + if($i<$len-1) + { + $mid1=$inHex[$i]+0; + $mid2=$inHex[$i+1]+0; + $cur=($mid1 >> $n) |(($mid2 << (7-$n)) & 0xff); + } + else + { + $mid1=$inHex[$i]; + $cur=($mid1 >> $n) & 0xff; + } + $outHex[$index++]=$cur; + echo "$cur "; + $n=($n+1)%7; + if($n==0 ) + $i++; + } + + + //for($i=0;$i<$index;$i++) + // $strout[$i]=chr($outHex[$i]); + + return $outHex; +} + +function string7bitTo8bit($strin) +{ + global $global_len; + + $len=strlen($strin); + + $ti=0; + for($i=0;$i<$len;$i+=2) + { + $tmp=substr($strin,$i,2); + $inHex[$ti]=hexdec($tmp); + $ti++; + } + + $global_len=$ti+floor($ti/8); + + + $n=0; + $j=0; + for($i=0;$i <= $ti;) + { + if($i>0) + { + $mid1=$inHex[$i]; + $mid2=$inHex[$i-1]; + $cur=(($mid1 << $n) & 0x7f) |($mid2 >> (8-$n)); + } + else + { + $mid1=$inHex[$i] & 0x7f; + $cur=$mid1; + } + $outHex[$j++] = $cur; + $n =($n+1)%8; + if($n!=0) + $i++; + } + + return $outHex; +} + +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/paramConfiguration/param_comm.inc b/wxc2_omc/configuration/paramConfiguration/param_comm.inc new file mode 100755 index 0000000..5c4a0b2 --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/param_comm.inc @@ -0,0 +1,765 @@ + +"unknown",0=>"LEAF_TYPE",1=>"SCALAR_TABLE_TYPE",2=>"COLUMN_TABLE_TYPE",3=>"ENTRY_TYPE"); + +//access +define(ACCESS_TABLE_NAME,0); +define(ACCESS_ENTRY,21); +define(ACCESS_READ_WRITE,19); +define(ACCESS_READ_ONLY,18); +define(ACCESS_INDEX_CREATE_SPE,48); + +//value type +define(VALUE_NONE,0); +define(VALUE_STRING,2); +define(VALUE_INT,3); +define(VALUE_IP,5); +define(VALUE_TIMESTAMP,8); +define(VALUE_OPAQUE,9); + +//style +define(SHOW_HIDE,0); +define(SHOW_SELECT,1); +define(SHOW_TEXTBOX,2); +define(SHOW_LABEL,3); + +//create method +define(MANUAL_CREATE,0); +define(AUTO_CREATE,1); + +//nest table element +define(TABLE_ENTRY,0); +define(TABLE_ENTRIES,1); +define(TABLE_CREATE,2); + +//sysTypeNo +define(SYSTYPENO_MSC,320); +define(SYSTYPENO_SMSC,350); +define(SYSTYPENO_SMPP,260); +define(SYSTYPENO_OPPS,375); +define(SYSTYPENO_PPS,360); +define(SYSTYPENO_MTP3,222); +define(SYSTYPENO_SCCP,223); +define(SYSTYPENO_AAS,311); +define(SYSTYPENO_VSS,390); +define(SYSTYPENO_VLR,325); +define(SYSTYPENO_HLR,330); +define(SYSTYPENO_AUC,340); +define(SYSTYPENO_SMEG,355); +define(SYSTYPENO_EIR,380); +define(SYSTYPENO_MRFC,385); +define(SYSTYPENO_PALIM,378); +define(SYSTYPENO_RLS,379); +define(SYSTYPENO_MHC,386); +define(SYSTYPENO_IUUPGW,389); +function showTable($oids) +{ + global $paraConfTable,$paraTable,$keyId,$objects; + + $objects[$keyId]["oid"]=$oids; + $oidLevel=getLevel($oids); + //echo "oidLevel=$oidLevel
      "; + $sql="select * from $paraConfTable where $oidLevel order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + $tmpKeyId=$keyId; + if($num != 0) + { + $row=@mysqli_fetch_array($res); + $objects[$keyId]["name_1"]=$row[name_1]; + $objects[$keyId]["name_2"]=$row[name_2]; + //if(!strstr($objects[$keyId]["name_1"],"Table") && !strstr($objects[$keyId]["name_1"],"Entry")) + $objects[$keyId]["nest_num"]=$num-1; + $objects[$keyId]["type"]=-1; + $objects[$keyId]["maxAccess"]=$row[maxAccess]+0; + $objects[$keyId]["desc_1"]=$row[desc_1]; + $objects[$keyId]["valueType"]=$row[valueType]+0; + $objects[$keyId]["setTemplate_1"]=$row[setTemplate_1]; + $objects[$keyId]["note_1"]=$row[note_1]; + $objects[$keyId]["style"]=$row[operType]+0; + if(strstr($objects[$keyId]["name_1"],"Entry")) + $objects[$keyId]["type"]=ENTRY_TYPE; + + + } + //nest + if($num > 1) + { + $keyId++; + + $isTableExsit=0; + $isEntryExsit=0; + do + { + if(strstr($row[name_1],"Table")) + $isTableExsit=1; + if(strstr($row[name_1],"Entry")) + $isEntryExsit=1; + $nextOids=""; + for($i=1;$i<=10;$i++) + { + $level="level_".$i; + if(($row[$level]+0) > 0) + $nextOids.=".{$row[$level]}"; + } + $nextOids=substr($nextOids,1); + if($nextOids != $oids) + { + showTable($nextOids); + //echo "
      $nextOids
      "; + } + }while($row=@mysqli_fetch_array($res)); + + if($isTableExsit && $isEntryExsit) + { + $objects[$tmpKeyId]["type"]=COLUMN_TABLE_TYPE; + } + else if($isTableExsit == 0 && $isEntryExsit == 0) + { + $objects[$tmpKeyId]["type"]=SCALAR_TABLE_TYPE; + } + + } + else + { + $objects[$keyId]["type"]=LEAF_TYPE; + $keyId++; + } +} + + +function showParamInReadOnly($keyId,$sysId) +{ + global $objects; + + + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + $subSysNo=$sysIdArr[2]; + $objDb='OBJ_'.$sysTypeNo; + $paraConfTable=$objDb.'.paramConf'; + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + $oid=$objects[$keyId]['oid']; + $oidwhere=getLevelWhere($oid); + $sql="select initValue from $paraTable where $oidwhere and instanceNo='0000' "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + if($num != 0) + { + $row=@mysqli_fetch_array($res); + $returnvalue=$row[initValue]; + if(($objects[$keyId]["style"] == SHOW_LABEL || $objects[$keyId]["style"] == SHOW_SELECT )&& $objects[$keyId]["valueType"] == VALUE_INT) + { + if(trim($objects[$keyId]["setTemplate_1"]) == "") + return $returnvalue; + $options=explode(";",$objects[$keyId]["setTemplate_1"]); + for($ii=0;$iilevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + $levelNo+=2; + if($levelNo<=10) + $levelWhere.=" AND level_$levelNo=0 "; + return($levelWhere); +} + +function getParamValue($sysId,$oid,$instanceNo) +{ + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + $subSysNo=$sysIdArr[2]; + $objDb='OBJ_'.$sysTypeNo; + $paraConfTable=$objDb.'.paramConf'; + + + + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + $oidWhere=getLevelWhere($oid); + + if(strstr($instanceNo,".")) + $sql="select initValue from $paraTable where $oidWhere and instanceNo='$instanceNo' "; + else + $sql="select initValue from $paraTable where $oidWhere and instanceNo=$instanceNo "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return "--"; + + $row=@mysqli_fetch_array($res); + $originalValue=$row[initValue]; + + return $originalValue; +} + +function getShowNameOfTable($name,$keyId) +{ + global $objects; + + if($keyId != -1 && strstr($objects[$keyId]['desc_1'],"Name:")) + { + $new_name=explode("Name:",$objects[$keyId]['desc_1']); + return str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $len=strlen($name); + $result=""; + + if($name[0]>='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} + +function getShowNameOfField($name,$keyId) +{ + global $objects; + + if($keyId != -1 && strstr($objects[$keyId]['desc_1'],"Name:")) + { + $new_name=explode("Name:",$objects[$keyId]['desc_1']); + return str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $len=strlen($name); + $result=""; + + for($j=0;$j<$len;$j++) + { + if($name[$j]>='A' && $name[$j]<='Z') + break; + } + for($i=$j;$i<$len;$i++) + { + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + return $result; +} + +function translateValueToOpt($keyId,$value) +{ + global $objects; + + $operType=$objects[$keyId]['style']; + $valueType=$objects[$keyId]['valueType']; + $template=$objects[$keyId]['setTemplate_1']; + + if(($operType == SHOW_LABEL || $operType == SHOW_SELECT) && $valueType == VALUE_INT) + { + if(trim($template) == "") + return $value; + $options=explode(";",$template); + for($ii=0;$ii"; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num > 0) + return 1; + else + return 0; +} + +/* + tableName: the name of the table, rountingSelection for example. case-ignored + $type: TABLE_ENTRY, TABLE_ENTRIES, TABLE_CREATE +*/ +function findRelationOid($tableName,$type,$sysTypeNo) +{ + $tableName=strtolower($tableName); + $dbtable="OBJ_".$sysTypeNo.".paramConf"; + if($type == TABLE_ENTRY) + $likestr=$tableName."Entry"; + else if($type == TABLE_ENTRIES) + $likestr=$tableName."Entries"; + else if($type == TABLE_CREATE) + $likestr="CreateEntry".$tableName; + + $sql="select * from $dbtable where name_1 like '%$likestr%' "; + //echo "
      $sql
      "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return ""; + $row=@mysqli_fetch_array($res); + $findOid=""; + for($i=1;$i<=10;$i++) + { + if($row["level_".$i] == '0') + break; + $findOid.=$row["level_".$i]."."; + } + $findOid=substr($findOid,0,strlen($findOid)-1); + //PrintInfo("tableName=$tableName,dbtable=$dbtable,oid=$findOid"); + return $findOid; +} + +function getTableLevel($tableOid,$sysTypeNo) +{ + $tableWhere=getLevelWhere($tableOid); + $database="OBJ_".$sysTypeNo.".paramConf"; + $sql="select desc_1 from $database where $tableWhere "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $desc_1=$row[desc_1]; + $tmp=explode("level:",$desc_1); + $level=$tmp[1]+0; + return $level; +} + + + +function showTitle($page,$tableOid,$instanceNo,$sysId,$sysTypeNo,$module_name,$table_type=1) +{ + if($page == "edit") + { + $tableName=getTableNameByOid($sysId,$tableOid); + $tmp=explode("Entry",$tableName); + $titleTableName=$tmp[0]; + //printInfo("show_table instanceNo=".$instanceNo.",tableOid=".$tableOid.",$tableName"); + $level=getTableLevel($tableOid,$sysTypeNo); + $titlelevel=$level; + $titleTableOid=$tableOid; + $titleInstanceNo=$instanceNo; + echo "

      "; + echo "$module_name"; + while(1) + { + //get table name + $tableName=getTableNameByOid($sysId,$titleTableOid); + //check whether it have the new name + $clevel=getLevelWhere($titleTableOid); + $dbtable="OBJ_".$sysTypeNo.".paramConf"; + $oidsplit=explode(".",$titleTableOid); + $oidsize=sizeof($oidsplit)+1; + $zerowhere=" level_$oidsize=0 "; + $checksql="select * from $dbtable where $clevel and $zerowhere and desc_1 like '%Name:%' "; + $checkres=@mysqli_query($pubConn,$checksql); + $checknum=mysqli_num_rows($checkres); + if($checknum == 1) + { + $checkrow=@mysqli_fetch_array($checkres); + $new_name=explode("Name:",$checkrow[desc_1]); + $title_new_name[$level]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + else + $title_new_name[$level]="none"; + + $tableName=str_replace("Entry","",$tableName); + //echo "tableOid=$titleTableOid,tableName=$tableName instanceNo=$titleInstanceNo"; + //echo "$tableName"; + $title_oid[$level]=$titleTableOid; + $title_name[$level]=$tableName; + $title_instanceNo[$level]=$titleInstanceNo; + + $titleTableOid=findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo); + if($titleTableOid == "") + break; + + $ttmp=explode(".",$titleTableOid); + $sizet=sizeof($ttmp)-1; + $titleTableOid=""; + for($ti=0;$ti<$sizet;$ti++) + { + $titleTableOid.="{$ttmp[$ti]}."; + } + $titleTableOid=substr($titleTableOid,0,strlen($titleTableOid)-1); + + $ttmp=explode(".",$titleInstanceNo); + $sizet=sizeof($ttmp); + if($sizet == 1) + $titleInstanceNo="0000"; + else + { + $titleInstanceNo=""; + for($ti=0;$ti<$sizet-1;$ti++) + { + $titleInstanceNo.="{$ttmp[$ti]}."; + } + $titleInstanceNo=substr($titleInstanceNo,0,strlen($titleInstanceNo)-1); + } + $level--; + } + for($index=1;$index<=$titlelevel;$index++) + { + if($index == 1) + $thisinstance="0000"; + else + $thisinstance=$title_instanceNo[$index-1]; + echo "> "; + echo ""; + $showName=getShowNameOfTable($title_name[$index],-1); + + if($title_new_name[$index] != "none") + $showName=$title_new_name[$index]; + + echo "{$showName}"; + $thisinstance=$title_instanceNo[$index]; + $ttmp=explode(".",$thisinstance); + $instanceShow=$ttmp[sizeof($ttmp)-1]+0; + if($index == $titlelevel) + echo " $instanceShow "; + else + { + echo ""; + echo " $instanceShow "; + echo ""; + } + } + echo "
      "; + } + else if($page == "show") + { + $tableName=getTableNameByOid($sysId,$tableOid); + $tmp=explode("Entry",$tableName); + $titleTableName=$tmp[0]; + //printInfo("show_table instanceNo=".$instanceNo.",tableOid=".$tableOid.",$tableName"); + $level=getTableLevel($tableOid,$sysTypeNo); + $titlelevel=$level; + $titleTableOid=$tableOid; + $titleInstanceNo=$instanceNo; + echo "

      "; + echo "$module_name"; + while(1) + { + //get table name + $tableName=getTableNameByOid($sysId,$titleTableOid); + //check whether it have the new name + $clevel=getLevelWhere($titleTableOid); + $dbtable="OBJ_".$sysTypeNo.".paramConf"; + $oidsplit=explode(".",$titleTableOid); + $oidsize=sizeof($oidsplit)+1; + $zerowhere=" level_$oidsize=0 "; + $checksql="select * from $dbtable where $clevel and $zerowhere and desc_1 like '%Name:%' "; + $checkres=@mysqli_query($pubConn,$checksql); + $checknum=mysqli_num_rows($checkres); + if($checknum == 1) + { + $checkrow=@mysqli_fetch_array($checkres); + $new_name=explode("Name:",$checkrow[desc_1]); + $title_new_name[$level]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + else + $title_new_name[$level]="none"; + + $tableName=str_replace("Entry","",$tableName); + //echo "tableOid=$titleTableOid,tableName=$tableName instanceNo=$titleInstanceNo"; + //echo "$tableName"; + $title_oid[$level]=$titleTableOid; + $title_name[$level]=$tableName; + $title_instanceNo[$level]=$titleInstanceNo; + + $titleTableOid=findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo); + if($titleTableOid == "") + break; + + $ttmp=explode(".",$titleTableOid); + $sizet=sizeof($ttmp)-1; + $titleTableOid=""; + for($ti=0;$ti<$sizet;$ti++) + { + $titleTableOid.="{$ttmp[$ti]}."; + } + $titleTableOid=substr($titleTableOid,0,strlen($titleTableOid)-1); + + $ttmp=explode(".",$titleInstanceNo); + $sizet=sizeof($ttmp); + if($sizet == 1) + $titleInstanceNo="0000"; + else + { + $titleInstanceNo=""; + for($ti=0;$ti<$sizet-1;$ti++) + { + $titleInstanceNo.="{$ttmp[$ti]}."; + } + $titleInstanceNo=substr($titleInstanceNo,0,strlen($titleInstanceNo)-1); + } + $level--; + } + for($index=1;$index<=$titlelevel;$index++) + { + echo "> "; + echo ""; + $showName=getShowNameOfTable($title_name[$index],-1); + + if($title_new_name[$index] != "none") + $showName=$title_new_name[$index]; + + echo "{$showName}"; + if($index == $titlelevel) + { + $instanceShow=""; + } + else + { + $thisinstance=$title_instanceNo[$index+1]; + $ttmp=explode(".",$thisinstance); + $instanceShow=$ttmp[sizeof($ttmp)-1]+0; + } + echo ""; + echo " $instanceShow "; + echo ""; + } + } +} + +function GetOIDByName($sysTypeNo,$name) +{ + $database="OBJ_".$sysTypeNo.".paramConf"; + $sql="select * from $database where name_2 like '%$name%' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + + $oids=""; + for($i=1;$i<=10;$i++) + { + $tmpN="level_".$i; + $tmpV=$row[$tmpN]+0; + if($tmpV == 0) + break; + + $oids.=$tmpV."."; + + } + if($i>1) + $oids=substr($oids,0,strlen($oids)-1); + + return $oids; +} + +/* + This function is for the special issue of getting msc timeslot + Get the timeslot parameter from plat which the Group ID specify in trunk +*/ +function GetTrunkGroupID($tgno,$trunkno) +{ + $trunk_table_oid=GetOIDByName(SYSTYPENO_MSC,"trunkEntry"); + + $tgno_w=omc_keep_length($tgno,"0",4); + $trunkno_w=omc_keep_length($trunkno,"0",4); + $instance=$tgno_w.".".$trunkno_w; + + oidSysCommSend("320_99_99", 0, $trunk_table_oid, -1, $instance); + + $trunkGroupID_oid=GetOIDByName(SYSTYPENO_MSC,"trunkGroupID"); + $oidWhere=getLevelWhere($trunkGroupID_oid); + + $sql="select * from OBJ_320.param_99 where $oidWhere and instanceNo= '$instance' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $value=$row[readValue]+0; + + return $value; +} + +function GetSystemStatus($sysTypeNo,$sysNo,$subSysNo=0) +{ + $due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + $ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); + + $sql="select * from OMC_PUB.sysInfo where sysTypeNo=$sysTypeNo and sysNo=$sysNo and subSysNo=$subSysNo "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return 0; + + $row=@mysqli_fetch_array($res); + $baseStat=$row[baseStat]+0; + if($baseStat == 0) + return 0; + + $updateTime=$row[updateTime]; + if($updateTime < $due_date || $updateTime > $ove_date) + return 0; + + return 1; +} + +function PrintInfo($info) +{ + $command="echo '$info' >> /tmp/omcdebug.txt "; + system($command); +} +?> diff --git a/wxc2_omc/configuration/paramConfiguration/param_edit.php b/wxc2_omc/configuration/paramConfiguration/param_edit.php new file mode 100755 index 0000000..395b8f1 --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/param_edit.php @@ -0,0 +1,807 @@ + + + + + +"; +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; + + +//echo "tableOid=$tableOid,sysId=$sysId,table_type=$table_type,instanceNo=$instanceNo
      "; + +$sysIdArr=explode('_',$sysId); +$sysTypeNo=$sysIdArr[0]; +$sysNo=$sysIdArr[1]; +$subSysNo=$sysIdArr[2]; +$objDb='OBJ_'.$sysTypeNo; +$paraConfTable=$objDb.'.paramConf'; +$pubDb='OMC_PUB'; + +$sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' "; +$res=@mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); +$module_name=$row[sysTypeName]; + +if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; +else + $paraTable=$objDb.".param_99"; + + +//Get all +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + + if($get) + { + //scalar table + if($table_type == 0) + { + getParam($commInfoArr); + } + //column table + else + { + //Get the timeslot parameter from the plat(trunk group id) + $timeslot_table_oid=GetOIDByName(SYSTYPENO_MSC,"timeSlotEntry"); + if($sysTypeNo == SYSTYPENO_MSC && $tableOid == $timeslot_table_oid) + { + $tmps=explode(".",$instanceNo); + $grounp_id=GetTrunkGroupID($tmps[0]+0,$tmps[1]+0); + if($grounp_id == 1) + $tmpSysId="320_1_0"; + else + $tmpSysId="320_0_0"; + + if(!GetSystemStatus(SYSTYPENO_MSC,$grounp_id)) + $tmpSysId="320_99_99"; + + $commIdStr=oidSysCommSend($tmpSysId,0,$tableOid,$selectedSysId=-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + } + else + { + $commIdStr=oidSysCommSend($sysId,0,$tableOid,$selectedSysId=-1,$instanceNo); + echo "oidSysCommSend($sysId,0,$tableOid,$selectedSysId=-1,$instanceNo);
      "; + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + } + } + + } + else if($set) + { + //scalar table + if($table_type == 0) + { + $len=sizeof($setCommInfoArr); + $commIdStr=""; + for($i=0;$i<$len;$i++) + { + $tmpCommIdStr = oidSysCommSend($setCommInfoArr[$i][sysId],3,$setCommInfoArr[$i][oid],-1); + $commIdStr=$commIdStr.$tmpCommIdStr; + } + if($len>0) + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + } + //column table + else + { + $commIdStr=oidSysCommSend($sysId,3,$tableOid,$selectedSysId=-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + } + + } + else if($lock || $unlock) + { + $tmpWhere=getLevelWhere($adminStatOid); + if($lock) + $initValue=0; + else + $initValue=1; + + $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo=$instanceNo "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $updateSql.="and subSysNo='$subSysNo' "; + + mysqli_query($pubConn,$updateSql); + $commIdStr=oidSysCommSend($sysId,3,$adminStatOid,$selectedSysId=-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + } + else if($podUpdateToPod) + { + $tmpWhere=getLevelWhere($podUpdateToPodOid); + //if($lock) + $initValue=1; + // else + // $initValue=1; + + $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo=$instanceNo "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $updateSql.="and subSysNo='$subSysNo' "; + + mysqli_query($pubConn,$updateSql); + $commIdStr=oidSysCommSend($sysId,3,$podUpdateToPodOid,$selectedSysId=-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + } +} + +//create +if($create == 1) +{ + //echo "createIndex=$createIndex,createInstanceNo=$createInstanceNo,createOid=$createOid,sysId=$sysId,tableOid=$tableOid,table_type=$table_type
      "; + $level=getTableLevel($tableOid,$sysTypeNo); + $tmpwhere=getLevelWhere($tableOid); + $newInstanceNo=omc_keep_length($createIndex,'0',4); + if($createMethod == AUTO_CREATE) + $createIndex=1; + + $sql="replace into $paraTable set initValue='$createIndex',instanceNo='$createInstanceNo'"; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.=",subSysNo='$subSysNo' "; + + //nest table + if($level > 1) + { + $createTableName=getTableNameByOid($sysId,$tableOid); + $createTableName=str_replace("Entry","",$createTableName); + $createOid=findRelationOid($createTableName,TABLE_CREATE,$sysTypeNo); + $entriesOid=findRelationOid($createTableName,TABLE_ENTRIES,$sysTypeNo); + //PrintInfo("createOid=".$createOid); + //PrintInfo("entriesOid=".$entriesOid); + } + else + { + $orderBy="order by level_1 desc,level_2 desc,level_3 desc,level_4 desc,level_5 desc,level_6 desc,level_7 desc,level_8 desc,level_9 desc,level_10 desc"; + $sql1="select * from $paraConfTable where $tmpwhere and name_1 like '%Index' $orderBy"; + $res=@mysqli_query($pubConn,$sql1); + $row=@mysqli_fetch_array($res); + $createOid=""; + for($i=1;$i<=10;$i++) + { + if($row["level_".$i] == '0') + break; + $createOid.=$row["level_".$i]."."; + } + $createOid=substr($createOid,0,strlen($createOid)-1); + //echo "createOid=$createOid
      "; + } + + $indexOidArr=explode(".",$createOid); + for($i=0;$i"; + mysqli_query($pubConn,$sql); + + //nest table + if($level > 1) + { + $commIdStr=oidSysCommSend($sysId,9,$createOid,$selectedSysId=-1,$createInstanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + + if($createMethod == AUTO_CREATE) + { + $indexLevelWhere=getLevelWhere($createOid); + $indexSql="select * from $paraTable where $indexLevelWhere and instanceNo='$createInstanceNo' "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $indexSql.="and subSysNo='$subSysNo' "; + + $indexres=@mysqli_query($pubConn,$indexSql); + $indexrow=@mysqli_fetch_array($indexres); + $newIndex=$indexrow[readValue]+0; + } + + + $tmpwhere=getLevelWhere($tableOid); + $sql="delete from $paraTable WHERE $tmpwhere "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + if($DEBUG)echo "
      clearSql=$clearSql"; + mysqli_query($pubConn,$sql); + + $commIdStr=oidSysCommSend($sysId,5,$tableOid,$selectedSysId=-1,""); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + + $commIdStr=oidSysCommSend($sysId,0,$entriesOid,$selectedSysId=-1,$createInstanceNo); + //echo "oidSysCommSend($sysId,0,$entriesOid,$selectedSysId=-1,$createInstanceNo);
      "; + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo&createpage=$createpage"); + + if($createMethod == AUTO_CREATE) + $newInstanceNo=omc_keep_length($newIndex,'0',4); + + $instanceNo=$createInstanceNo.".".$newInstanceNo; + } + else + { + $commIdStr=oidSysCommSend($sysId,9,$createOid,$selectedSysId=-1,$createInstanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + + //some table create instance auto + if($createMethod == AUTO_CREATE) + { + $wheretest=getLevelWhere($createOid); + $sqltest="select * from $paraTable where $wheretest and instanceNo='0000' "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sqltest.="and subSysNo='$subSysNo' "; + + $restest=@mysqli_query($pubConn,$sqltest); + $numtest=mysqli_num_rows($restest); + $rowtest=@mysqli_fetch_array($restest); + $thisnew=$rowtest[readValue]; + $thisnew=omc_keep_length($thisnew,'0',4); + } + + $sql="delete from $paraTable WHERE $tmpwhere "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sqltest.="and subSysNo='$subSysNo' "; + + if($DEBUG)echo "
      clearSql=$clearSql"; + mysqli_query($pubConn,$sql); + + + $commIdStr=oidSysCommSend($sysId,5,$tableOid,$selectedSysId=-1,""); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + + $instanceNo=$newInstanceNo; + if($createMethod == AUTO_CREATE) + $instanceNo=$thisnew; + + } +} + +echo "

      "; + +if($table_type == 1) +{ + if($createpage == 1) + { + showTitle("show",$tableOid,$instanceNo,$sysId,$sysTypeNo,$module_name); + } + else + { + showTitle("edit",$tableOid,$instanceNo,$sysId,$sysTypeNo,$module_name); + } +} +else +{ + echo "

      "; + echo "$module_name > "; +} + +//create page +if($createpage == 1) +{ + //echo "sysId=$sysId,tableOid=$tableOid,instanceNo=$instanceNo
      "; + //get the kind of creation, auto or manual + //get the table level + $level=getTableLevel($tableOid,$sysTypeNo); + + //nest table + if($level > 1) + { + $createTableName=getTableNameByOid($sysId,$tableOid); + $createTableName=str_replace("Entry","",$createTableName); + $createEntryOid=findRelationOid($createTableName,TABLE_CREATE,$sysTypeNo); + $checkWhere=getLevelWhere($createEntryOid); + $checksql="select * from $paraConfTable where $checkWhere "; + $checkres=@mysqli_query($pubConn,$checksql); + $num=mysqli_num_rows($checkres); + if($num != 1) + echo "The table not include create entry column
      "; + else + { + $checkrow=@mysqli_fetch_array($checkres); + if($checkrow[setTemplate_2] == "create=1") + $create_method=AUTO_CREATE; + else + $create_method=MANUAL_CREATE; + } + //PrintInfo("createTableName=".$createTableName.",createEntryOid=".$createEntryOid.",createMethod=".$create_method); + } + else + { + $checkWhere=getLevelWhere($tableOid); + $checksql="select * from $paraConfTable where $checkWhere and name_1 like '%Index' "; + //echo "$checksql
      "; + $checkres=@mysqli_query($pubConn,$checksql); + $num=mysqli_num_rows($checkres); + if($num != 1) + echo "The table not include Index column
      "; + else + { + $checkrow=@mysqli_fetch_array($checkres); + if($checkrow[setTemplate_2] == "create=1") + $create_method=AUTO_CREATE; + else + $create_method=MANUAL_CREATE; + $createEntryOid=""; + for($i=1;$i<=10;$i++) + { + if($checkrow["level_".$i] == '0') + break; + $createEntryOid.=$checkrow["level_".$i]."."; + } + $createEntryOid=substr($createEntryOid,0,strlen($createEntryOid)-1); + } + //PrintInfo("createEntryOid=".$createEntryOid.",createMethod=".$create_method); + } + + + if($create_method == AUTO_CREATE) + { + echo "

      "; + echo ""; + echo ""; + echo "
      Index is assigned by $module_name"; + echo ""; + + echo "
      "; + + echo ""; + } + else if($create_method == MANUAL_CREATE) + { + + //first level + //if($last_table_level == 0) + $tmpwhere=getLevelWhere($tableOid); + $orderBy="order by level_1 desc,level_2 desc,level_3 desc,level_4 desc,level_5 desc,level_6 desc,level_7 desc,level_8 desc,level_9 desc,level_10 desc"; + $sql="select * from $paraConfTable where $tmpwhere and name_1 like '%Index' $orderBy"; + //echo "$sql
      "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $minIndex=$row[minValue]+0; + $maxIndex=$row[maxValue]+0; + + $createIndexOid=""; + for($i=1;$i<=10;$i++) + { + if($row["level_".$i] == '0') + break; + $createIndexOid.=$row["level_".$i]."."; + } + $createIndexOid=substr($createIndexOid,0,strlen($createIndexOid)-1); + //echo "createIndexOid=$createIndexOid,minIndex=$minIndex,maxIndex=$maxIndex
      "; + + $tmpwhere=getLevelWhere($createIndexOid); + if($instanceNo != "0000") + $sql="select initValue from $paraTable where $tmpwhere and instanceNo like '$instanceNo.%' "; + else + $sql="select initValue from $paraTable where $tmpwhere "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + //echo "$sql,instanceNo=$instanceNo
      "; + $res=@mysqli_query($pubConn,$sql); + while($row=@mysqli_fetch_array($res)) + $index_use_flags[$row[initValue]+0]=1; + + + echo "

      "; + echo ""; + echo ""; + echo "
      Please input the index No."; + $no_use_count=0; + //auto + //if($sysTypeNo == 260 && $tableOid == "2.2.1.1") + // echo ""; + for($index=$minIndex;$index<=$maxIndex;$index++) + { + if($index_use_flags[$index] != 1) + { + echo ""; + $no_use_count++; + } + } + echo ""; + echo "
      "; + + //table is full + if($no_use_count == 0) + { + echo ""; + echo "

      "; + echo "
      "; + echo "Note: The table is full"; + echo "
      "; + } + else + { + //echo "instanceNo=$instanceNo,table_type=$table_type
      "; + echo ""; + } + + + } + + + echo "

      "; + exit(); +} + + +$keyId=0; +showTable($tableOid); + +for($i=0;$i<$keyId;$i++) +{ + if(!$objects[$i]['type'] == LEAF_TYPE && !strstr($objects[$i]['name_1'],"Entry") && !strstr($objects[$i]['name_1'],"Table")) + { + $objects[$i]['table_type']=SCALAR_TABLE_TYPE; + } + if($objects[$i]['type'] == UNKNOWN_TYPE) + { + $objects[$i]['type']=SCALAR_TABLE_TYPE; + } +} + +//============================================= +//SCALAR_TABLE_TYPE +if($table_type == 0) +{ + $commInfoArrNo=0; + $setCommInfoArrNo=0; + $table_level=0; + for($index=0;$index<$keyId;$index++) + { + if($objects[$index]['type'] == COLUMN_TABLE_TYPE) + { + echo ""; + break; + } + else if($objects[$index]['type'] == SCALAR_TABLE_TYPE) + { + $table_name=getShowNameOfTable($objects[$index]['name_1'],$index); + echo "{$table_name}

      "; + echo ""; + } + else if($objects[$index]['type'] == LEAF_TYPE) + { + //not accessable + if($objects[$index]['maxAccess'] == ACCESS_ENTRY) + continue; + if(strstr($objects[$index]['desc_1'],"Hidden Parameter")) + continue; + if(stristr($objects[$index]['name_1'],"Command")) + continue; + $showName=getShowNameOfTable($objects[$index]['name_1'],$index); + echo ""; + //title=\"{$objects[$index]['note_1']}\" + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + $commInfoArrNo++; + + if($objects[$index]['maxAccess'] == ACCESS_READ_WRITE) + { + echo ""; + echo ""; + echo ""; + $setCommInfoArrNo++; + } + } + } + if($index == $keyId) + echo "
      {$showName}"; + if($objects[$index]['valueType'] == VALUE_OPAQUE) + showParameter($sysId,$objects[$index]['oid'],$instanceNo); + else + showParameterAdv($sysId,$objects[$index]['oid'],$instanceNo); + echo "
      "; + +} +//COLUMN_TABLE_TYPE +else if($table_type == 1) +{ + $table_level=0; + $this_page_title_object=""; + for($index=0;$index<$keyId;$index++) + { + if($objects[$index]['type'] == ENTRY_TYPE) + { + $this_page_title_object=$objects[$index]['name_1']; + + echo "
      "; + } + else if($objects[$index]['type'] == LEAF_TYPE) + { + //not accessable + if($objects[$index]['maxAccess'] == ACCESS_ENTRY) + continue; + //row status + if(strstr($objects[$index]['name_1'],"RowStatus")) + continue; + echo ""; + + //whether have lock and unlock button + if(strstr($objects[$index]['name_1'],"AdminState")) + { + $lock_unlock_flag=1; + $lock_unlock_oid=$objects[$index]['oid']; + } + // echo "name_1:$objects[$index]['name_1']
      "; + if(strstr($objects[$index]['name_1'],"podUpdateToPod")) + { + $podUpdateToPod_flag=1; + $podUpdateToPod_oid=$objects[$index]['oid']; + } + + + if(strstr($objects[$index]['name_1'],"CreateEntry")) + { + continue; + } + if(strstr($objects[$index]['name_1'],"Entries")) + { + $showName=getShowNameOfField($objects[$index]['name_1'],$index); + echo ""; + + //get the entry value + //get the table name + $tb=$objects[$index][name_1]; + $tlen=strlen($tb); + $fg=0; + $tb1=""; + for($ti=0;$ti<$tlen;$ti++) + { + if($tb[$ti] >= 'A' && $tb[$ti] <= 'Z') + $fg=1; + if($fg==1) + $tb1.=$tb[$ti]; + } + $tb2=explode("Entries",$tb1); + $tb3=$tb2[0]; + $entriesOid=findRelationOid($tb3,TABLE_ENTRY,$sysTypeNo); + //PrintInfo($entriesOid); + + echo ""; + //$nextTableOid= + + } + else + { + $showName=getShowNameOfField($objects[$index]['name_1'],$index); + //title=\"{$objects[$index]['note_1']}\" + echo ""; + echo ""; + } + echo ""; + } + } + echo "
      {$showName}"; + $value=getParamValue($sysId,$objects[$index]['oid'],$instanceNo); + + echo "$value"; + echo "{$showName}"; + if($objects[$index]['valueType'] == VALUE_OPAQUE) + { + if(stristr($objects[$index]['name_1'],"NITZ")) + { + $mscTable="OBJ_320.param_99"; + $levels=getLevelWhere($objects[$index]['oid']); + $sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo"; + $res=mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($res); + $initValue=$rows[initValue]; + $readValue=$rows[readValue]; + if($initValue == '') + $initValue="--"; + echo ""; + if(strlen($initValue)>8) + $showValue=substr($initValue,0,8); + if($initValue == $readValue) + echo "$showValue"; + else + echo "$showValue"; + echo ""; + } + else + { + showParameter($sysId,$objects[$index]['oid'],$instanceNo); + } + } + else if(strstr($objects[$index]['name_1'],"Index")) + { + $value=getParamValue($sysId,$objects[$index]['oid'],$instanceNo); + echo "$value"; + } + else if(strstr($objects[$index]['desc_1'],"RelationPoint")) + { + $tmp1=strstr($objects[$index]['desc_1'],"RelationPoint:"); + $tmp2=explode(";",$tmp1); + $tmp3=explode("RelationPoint:",$tmp2[0]); + $rTableOid=$tmp3[1]; + + $showvalue=getParamValue($sysId,$objects[$index]['oid'],$instanceNo); + + if(trim($showvalue) == "--" || trim($showvalue)=="") + { + echo "--"; + } + else + { + $tmp1=explode(" ",$showvalue); + $tmp2=$tmp1[1]; + $tmp3=explode("-",$tmp2); + $tmp4=omc_keep_length($tmp3[0],'0',4); + $tmp5=omc_keep_length($tmp3[1],'0',4); + $rInstanceNo=$tmp4.".".$tmp5; + $rWhere=getLevelWhere($rTableOid); + $rsql="select * from $paraTable where instanceNo='$rInstanceNo' and $rWhere "; + $rres=mysqli_query($pubConn,$rsql); + $num=mysqli_num_rows($rres); + //echo "$rsql"; + if($num == 0) + echo "--"; + else + echo "$showvalue"; + } + } + else + showParameterAdv($sysId,$objects[$index]['oid'],$instanceNo); + echo "
      "; + + echo ""; + echo ""; + echo ""; + +} + +//======================================= +$DEBUG=0; +if($DEBUG) +{ + echo "

      ============================test========================
      "; + echo "keyId=$keyId
      "; + $test_oid_flag=1; + $test_name_flag=1; + $test_nest_flag=1; + $test_type_flag=1; + + for($i=0;$i<$keyId;$i++) + { + //if($objects[$i]['type'] != LEAF_TYPE && $objects[$i]['type'] != ENTRY_TYPE) + { + echo "$i-"; + if($test_oid_flag) + echo "oid-{$objects[$i]['oid']}, "; + if($test_name_flag) + echo "name-{$objects[$i]['name_1']}, "; + if($test_nest_flag) + echo "nestNum-{$objects[$i]['nest_num']}, "; + if($test_type_flag) + echo "type-{$type_label[$objects[$i]['type']]}, "; + + echo "
      "; + } + } +} + +//lock and unlock +if($lock_unlock_flag == 1) +{ + echo ""; + echo " "; + echo ""; + echo " "; + echo ""; +} +if($podUpdateToPod_flag == 1) +{ + echo ""; + echo " "; + echo ""; +} + + +//get all +echo ""; +echo " "; +echo ""; +echo " "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/paramConfiguration/param_index.php b/wxc2_omc/configuration/paramConfiguration/param_index.php new file mode 100755 index 0000000..f05ead6 --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/param_index.php @@ -0,0 +1,18 @@ + + + + + + + + <body> + + <p>Your browser can not support frame</p> + + </body> + + + + \ No newline at end of file diff --git a/wxc2_omc/configuration/paramConfiguration/param_show_down.php b/wxc2_omc/configuration/paramConfiguration/param_show_down.php new file mode 100755 index 0000000..06c7607 --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/param_show_down.php @@ -0,0 +1,764 @@ +"; +//echo "instanceNo=$instanceNo,tableOid=$tableOid
      "; + +?> + + + + + +"; +$sysIdArr=explode('_',$sysId); +$sysTypeNo=$sysIdArr[0]; +$sysNo=$sysIdArr[1]; +$subSysNo=$sysIdArr[2]; +$objDb='OBJ_'.$sysTypeNo; +$paraConfTable=$objDb.'.paramConf'; +$pubDb='OMC_PUB'; +$sysConfTable = 'sysConf'; +$sysInfoTable = 'sysInfo'; + +$sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' "; +$res=@mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); +$module_name=$row[sysTypeName]; + +if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; +else + $paraTable=$objDb.".param_99"; + +//check the system whether exist +if(($sysNo == '99') || ($subSysNo == '99')){ + if($sysNo == '99'){ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + "; + }else{ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' + "; + } + if($DEBUG)echo "sysIdSql(1) = $sysIdSql
      "; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1){ + echo " $strUninstalled
      "; + exit(); + } +}else{ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' + AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "sysIdSql(2) = $sysIdSql
      "; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1){ + echo " $strUninstalled
      "; + exit(); + } +} +//echo "sysId=$sysId
      "; +//echo "paraConfTable=$paraConfTable,paraTable=$paraTable
      "; + +//delete +if($delete == 1) +{ + //echo "Now delete the object,deleteOid=$deleteOid,deleteInstanceNo=$deleteInstanceNo"; + $deleteOid=trim($deleteOid); + $tmpwhere=getLevelWhere($deleteOid); + $sql="update $paraTable set initValue= '6' where $tmpwhere and instanceNo='$deleteInstanceNo' "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + mysqli_query($pubConn,$sql); + $commIdStr=oidSysCommSend($sysId,3,$deleteOid,$selectedSysId=-1,$deleteInstanceNo); + checkState($commIdStr,"./param_show_down.php?sysId=$sysId"); + + //command success,delete the record in the db + $etmp=explode(".",$deleteOid); + $elen=sizeof($etmp); + $deleteTableOid=""; + for($ti=0;$ti<$elen-1;$ti++) + $deleteTableOid.=$etmp[$ti]."."; + $deleteTableOid=substr($deleteTableOid,0,strlen($deleteTableOid)-1); + //echo "deleteTableOid=$deleteTableOid
      "; + $tmpwhere=getLevelWhere($deleteTableOid); + $sql="delete from $paraTable where $tmpwhere and instanceNo=$deleteInstanceNo "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + //echo "$sql
      "; + mysqli_query($pubConn,$sql); + + //When delete an object, then get all the table + $getArr[0][sysId]=$sysId; + $getArr[0][oid]=$deleteTableOid; + $getArr[0][instanceNo]=""; + getParam($getArr); +} + +//Get all +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if($get) + { + getParam($commInfoArr); + } + + if($set) + { + //print_r($commInfoArr); + $commIndex=0; + for($i=0;$i"; + } + + if($row[maxAccess] == ACCESS_READ_WRITE && !strstr($row[name_1],"Command")) + { + $setCommInfoArr[$commIndex][sysId]=$sysId; + $setCommInfoArr[$commIndex][oid]=$commInfoArr[$i][oid]; + $setCommInfoArr[$commIndex][instanceNo]=''; + $commIndex++; + //echo "{$commInfoArr[$i][sysId]} {$commInfoArr[$i][oid]} {$commInfoArr[$i][instanceNo]}
      "; + } + } + /* + for($i=0;$i"; + } + */ + + setParam($setCommInfoArr); + } + + //command button + $commlen=sizeof($commands); + for($ci=0;$ci<$commlen;$ci++) + { + $paraName="command_id_".$ci; + if($$paraName) + { + $tmpwhere=getLevelWhere($commands[$ci][oid]); + $oidstr=str_replace(".",",",$commands[$ci][oid]); + $oidsep=explode(".",$commands[$ci][oid]); + $oidlen=sizeof($oidsep); + $valuestr=""; + for($oi=0;$oi<$oidlen;$oi++) + { + $valuestr.="level_".($oi+1); + if($oi != ($oidlen-1)) + $valuestr.=","; + } + $delSql="delete from $paraTable where $tmpwhere and instanceNo='0000' "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $delSql.="and subSysNo='$subSysNo' "; + + mysqli_query($pubConn,$delSql); + $insertSql="insert into $paraTable($valuestr,instanceNo,initValue,readValue) values($oidstr,'0000',{$commands[$ci][val]},{$commands[$ci][val]}) "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $insertSql="insert into $paraTable($valuestr,instanceNo,initValue,readValue,subSysNo) values($oidstr,'0000',{$commands[$ci][val]},{$commands[$ci][val]},{$subSysNo}) "; + + mysqli_query($pubConn,$insertSql); + echo mysqli_error($pubConn); + + //echo "send command {$commands[$ci][oid]} {$commands[$ci][val]}
      "; + $commIdStr=oidSysCommSend($sysId,3,$commands[$ci][oid],$selectedSysId=-1,"0000"); + checkState($commIdStr,"./param_show_down.php?sysId=$sysId"); + break; + } + } +} +$keyId=0; +showTable($PARAM_OID_PREFIX); + + +for($i=0;$i<$keyId;$i++) +{ + if(!$objects[$i]['type'] == LEAF_TYPE && !strstr($objects[$i]['name_1'],"Entry") && !strstr($objects[$i]['name_1'],"Table")) + { + $objects[$i]['table_type']=SCALAR_TABLE_TYPE; + } + if($objects[$i]['type'] == UNKNOWN_TYPE) + { + $objects[$i]['type']=SCALAR_TABLE_TYPE; + } +} +//************************************************************************* +$table_level=0; +$commInfoArrNo=0; +//command button +$commandCount=0; +echo "

      "; +for($index=0;$index<$keyId;$index++) +{ + $level_count[$table_level]--; + $pre=strlen($objects[$index-1]['oid']); + $now=strlen($objects[$index]['oid']); + //echo "pre=$pre,now=$now
      "; + + switch($objects[$index]["type"]) + { + + case SCALAR_TABLE_TYPE: + //echo "SCALAR_TABLE_TYPE {$objects[$index]['name_1']}
      "; + $table_level++; + $level_count[$table_level]=$objects[$index]['nest_num']; + $table_type[$table_level]=SCALAR_TABLE_TYPE; + $table_name[$table_level]=$objects[$index]['name_1']; + $table_oid[$table_level]=$objects[$index]["oid"]; + + if($objects[$index]['name_1'] == "parameter") + { + //echo "$module_name"; + continue; + } + echo ""; + $rownum=$level_count[$table_level]+1; + $showName=getShowNameOfTable($table_name[$table_level],$index); + if($objects[$index+1]["type"] != COLUMN_TABLE_TYPE) + { + $countWhere=getLevelWhere($objects[$index]['oid']); + $countSql="select * from $paraConfTable where $countWhere and Not (desc_1 = 'Hidden Parameter' or name_1 like '%Command%') "; + $countRes=mysqli_query($pubConn,$countSql); + echo mysqli_error($pubConn); + $countNum=mysqli_num_rows($countRes); + if($countNum > 1) + echo ""; + } + + $table_title_id[$table_level]="title_".$table_name[$table_level]."_id"; + + if($DEBUG) + { + for($s=0;$s<$table_level;$s++) + echo ".."; + echo "start table({$objects[$index]['name_1']}) {$table_level}
      "; + } + break; + case COLUMN_TABLE_TYPE: + //echo "COLUMN_TABLE_TYPE {$objects[$index]['name_1']}
      "; + $table_level++; + $level_count[$table_level]=$objects[$index+1]['nest_num']+1; + $table_type[$table_level]=COLUMN_TABLE_TYPE; + $table_name[$table_level]=$objects[$index]['name_1']; + + $nlevel=getTableLevel($objects[$index]['oid'].".1",$sysTypeNo); + + if($nlevel > 1) + { + echo "
      $showName
      "; + } + else + { + echo "
      "; + } + //echo ""; + + $rownum=$level_count[$table_level]+1; + $showName=getShowNameOfTable($table_name[$table_level],$index); + echo ""; + + //if the scalar leaf not exist in the db, insert it first + $checklevel=getLevelWhere($objects[$index]['oid']); + $checksql="select * from $paraTable where $checklevel and instanceNo='0000' "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $checksql.="and subSysNo='$subSysNo' "; + + $checkres=mysqli_query($pubConn,$checksql); + echo mysqli_error($pubConn); + $checknum=mysqli_num_rows($checkres); + if($checknum == 0) + { + $insertlevel=str_replace("AND",",",$checklevel); + $insertsql="replace into $paraTable set initValue='',instanceNo='0000',$insertlevel "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $insertsql="replace into $paraTable set subSysNo='$subSysNo',initValue='',instanceNo='0000',$insertlevel "; + + mysqli_query($pubConn,$insertsql); + echo mysqli_error($pubConn); + } + + echo ""; + echo ""; + echo ""; + $commInfoArrNo++; + + } + else if($table_type[$table_level] == COLUMN_TABLE_TYPE) + { + + if(strstr($objects[$index]['name_1'],"Index")) + { + $showKeyIdListIndex=0; + if($table_hide_flag[$table_level] == 1) + echo "
      {$table_name[$table_level]}
      $showName"; + + if($DEBUG) + { + for($s=0;$s<$table_level;$s++) + echo ".."; + echo "start table({$objects[$index]['name_1']}) {$table_level}
      "; + } + break; + case ENTRY_TYPE: + //echo "ENTRY_TYPE {$objects[$index]['name_1']}
      "; + $table_oid[$table_level]=$objects[$index]["oid"]; + + //skip the timeslot + if($sysTypeNo == SYSTYPENO_MSC && $objects[$index]["oid"] == "2.4.3.1") + break; + + echo ""; + echo ""; + echo ""; + $commInfoArrNo++; + break; + case LEAF_TYPE: + //not accessable + if($objects[$index]['maxAccess'] == ACCESS_ENTRY) + break; + if($table_type[$table_level] == SCALAR_TABLE_TYPE) + { + //$table_oid[$table_level] + if(strstr($objects[$index]['desc_1'],"Hidden Parameter")) + continue; + //command button + if(stristr($objects[$index]['name_1'],"Command")) + { + $commandKeyIdList[$commandCount]=$index; + $commandCount++; + continue; + } + + $showValue=showParamInReadOnly($index,$sysId); + echo "
      "; + echo ""; + $showName=getShowNameOfTable($objects[$index]['name_1'],$index); + echo ""; + echo ""; + echo "
      $showName$showValue
      "; + echo "
      "; + else + echo "
      "; + echo ""; + } + + $showName=getShowNameOfField($objects[$index]['name_1'],$index); + + if(strstr($objects[$index]['desc_1'],"Key Parameter")) + { + if(strstr($objects[$index]['name_1'],"RowStatus")) + { + $table_delete_flags[$table_level]=1; + echo ""; + } + else + { + echo ""; + } + $showKeyIdList[$showKeyIdListIndex]=$index; + $showKeyIdListIndex++; + } + + if(strstr($objects[$index]['name_1'],"RowStatus")) + { + echo ""; + echo ""; + else + echo "\n"; + //echo ""; + for($jj=0;$jj<$showKeyIdListIndex;$jj++) + { + + $id=$showKeyIdList[$jj]; + $tmplevel=getLevelWhere($objects[$id]['oid']); + $sql="select initValue from $paraTable where instanceNo='{$instanceList[$tt]}' and $tmplevel "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $rowObj[$tt][$jj]=$row[initValue]; + if($id == $indexKeyId) + { + echo ""; + } + echo ""; + } + + echo ""; + + if($objects[$indexKeyId]['maxAccess'] == ACCESS_INDEX_CREATE_SPE) + { + echo ""; + for($si=0;$si<$showKeyIdListIndex-1;$si++) + { + echo ""; + } + echo ""; + } + + if($instanceCount>MAX_SHOW_ROW_NUM) + { + echo ""; + echo ""; + } + echo "
      Delete"; + echo ""; + echo "{$showName}
      "; + if($table_hide_flag[$table_level] == 1) + continue; + $indexKeyId=-1; + $entries_count=0; + + for($tt=0;$tt<$showKeyIdListIndex;$tt++) + { + $id=$showKeyIdList[$tt]; + if(strstr($objects[$id]['name_1'],"Index")) + $indexKeyId=$id; + else if(strstr($objects[$id]['name_1'],"RowStatus")) + $rowstatusKeyId=$id; + else if(strstr($objects[$id]['name_1'],"Entries")) + { + $entriesKeyIds[$entries_count]=$id; + + //get table name + $tb=$objects[$id][name_1]; + $tlen=strlen($tb); + $fg=0; + $tb1=""; + for($ti=0;$ti<$tlen;$ti++) + { + if($tb[$ti] >= 'A' && $tb[$ti] <= 'Z') + $fg=1; + if($fg==1) + $tb1.=$tb[$ti]; + } + $tb2=explode("Entries",$tb1); + $tb3=$tb2[0]; + //PrintInfo("table3=".$tb3); + $entriesOid=findRelationOid($tb3,TABLE_ENTRY,$sysTypeNo); + $entries_oids[$entries_count]=$entriesOid; + $entries_count++; + } + else + $select_list.=$objects[$id]['name_1'].","; + } + + $tmplevel=getLevelWhere($objects[$indexKeyId]['oid']); + //and instanceNo <> '0000' + $sql="select instanceNo from $paraTable where $tmplevel order by instanceNo "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + $res=@mysqli_query($pubConn,$sql); + $instanceCount=0; + while($row=@mysqli_fetch_array($res)) + { + $instanceList[$instanceCount]=$row[instanceNo]; + $instanceCount++; + } + $tableName=$table_name[$table_level]; + for($tt=0;$tt<$instanceCount;$tt++) + { + if($tt>MAX_SHOW_ROW_NUM-1) + echo "\n
      "; + echo ""; + echo "{$rowObj[$tt][$jj]}"; + echo ""; + } + //$table_delete_flags[$table_level]=1; + else if($id == $rowstatusKeyId) + { + echo ""; + if($table_delete_flags[$table_level] == 1) + { + echo ""; + } + } + //feake + else if($entries_count>0 && in_array($id,$entriesKeyIds)) + { + $sizet=sizeof($entriesKeyIds); + //PrintInfo("entries=".$entriesKeyIds[0]); + for($si=0;$si<$sizet;$si++) + { + if($id == $entriesKeyIds[$si]) + { + //printf("keyId=".$entriesKeyIds[$si]); + $tmpOid=$entries_oids[$si]; + break; + } + } + + echo ""; + echo ""; + echo "{$rowObj[$tt][$jj]}"; + echo ""; + } + else + { + echo ""; + if(trim($rowObj[$tt][$jj]) == "") + echo "--"; + else + { + $showValue=translateValueToOpt($id,$rowObj[$tt][$jj]); + echo "{$showValue}"; + } + } + echo "
      New--
      More >>
      << Hide
      "; + echo ""; + } + + } + if($DEBUG) + { + for($s=0;$s<$table_level+1;$s++) + echo ".."; + echo "LEAF_TYPE {$objects[$index]['name_1']}
      "; + } + break; + default: + echo "UNKNOWN_TYPE {$objects[$index]['name_1']}
      "; + break; + } + + + if($table_level>1 &&($index)<$keyId && strlen($objects[$index+1]['oid']) < strlen($objects[$index]['oid'])) + { + echo "

      "; + if($DEBUG) + { + for($s=0;$s<$table_level;$s++) + echo ".."; + echo "close table level=$table_level
      "; + } + $table_level--; + } + if($level_count[$table_level] <= 0) + { + echo "

      "; + if($DEBUG) + { + for($s=0;$s<$table_level;$s++) + echo ".."; + echo "close table level=$table_level
      "; + } + $table_level--; + } +} + +if($table_level == 1) +{ + echo ""; + if($DEBUG) + { + echo ".."; + echo "close table level=$table_level
      "; + } + $table_level--; +} + +echo ""; + +//whether have set all button +$sql="select * from OMC_PUB.sysMibConf where sysTypeNo='$sysTypeNo' and setAllFlag='1' "; +$res=@mysqli_query($pubConn,$sql); +$num=@mysqli_num_rows($res); +if($num > 0) + echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; + +//command button +$command_index=0; +for($i=0;$i<$commandCount;$i++) +{ + $keyId=$commandKeyIdList[$i]; + //echo "command-$i {$objects[$keyId]['name_1']}
      "; + + + $template=trim($objects[$keyId]["setTemplate_1"]); + $options=explode(";",$template); + for($ii=0;$ii"; + $showName=getShowNameOfTable($val,-1); + echo " "; + echo ""; + + echo ""; + echo ""; + //echo ""; + $command_index++; + } + +} + + +echo ""; +//=============test + +$DEBUG=0; +if($DEBUG) +{ + echo "

      ============================test========================
      "; + echo "keyId=$keyId
      "; + $test_oid_flag=1; + $test_name_flag=1; + $test_nest_flag=1; + $test_type_flag=1; + + for($i=0;$i<$keyId;$i++) + { + //if($objects[$i]['type'] != LEAF_TYPE && $objects[$i]['type'] != ENTRY_TYPE) + { + echo "$i-"; + if($test_oid_flag) + echo "oid-{$objects[$i]['oid']}, "; + if($test_name_flag) + echo "name-{$objects[$i]['name_1']}, "; + if($test_nest_flag) + echo "nestNum-{$objects[$i]['nest_num']}, "; + if($test_type_flag) + echo "type-{$type_label[$objects[$i]['type']]}, "; + + echo "
      "; + } + } +} +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/paramConfiguration/param_show_table.php b/wxc2_omc/configuration/paramConfiguration/param_show_table.php new file mode 100755 index 0000000..67589fd --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/param_show_table.php @@ -0,0 +1,534 @@ + + + + + +"; +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; + + +$sysIdArr=explode('_',$sysId); +$sysTypeNo=$sysIdArr[0]; +$sysNo=$sysIdArr[1]; +$subSysNo=$sysIdArr[2]; +$objDb='OBJ_'.$sysTypeNo; +$paraConfTable=$objDb.'.paramConf'; +$pubDb='OMC_PUB'; + +$sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' "; +$res=@mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); +$module_name=$row[sysTypeName]; + +if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; +else + $paraTable=$objDb.".param_99"; + + +//feake +showTitle("show",$tableOid,$instanceNo,$sysId,$sysTypeNo,$module_name); + + +echo "

      "; +//delete +if($delete == 1) +{ + //echo "Now delete the object,sysId=$sysId,tableOid=$tableOid,deleteOid=$deleteOid,deleteInstanceNo=$deleteInstanceNo"; + $deleteOid=trim($deleteOid); + $tmpwhere=getLevelWhere($deleteOid); + $sql="update $paraTable set initValue='6' where $tmpwhere and instanceNo='$deleteInstanceNo' "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + //echo "$sql
      "; + mysqli_query($pubConn,$sql); + $commIdStr=oidSysCommSend($sysId,3,$deleteOid,$selectedSysId=-1,$deleteInstanceNo); + //echo "oidSysCommSend($sysId,3,$deleteOid,$selectedSysId=-1,$deleteInstanceNo);
      "; + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + + //update the entries num + $tlevel=getTableLevel($tableOid,$sysTypeNo); + if($tlevel > 1) + { + $entriesTableName=getTableNameByOid($sysId,$tableOid); + $entriesTableName=str_replace("Entry","",$entriesTableName); + $entriesOid=findRelationOid($entriesTableName,TABLE_ENTRIES,$sysTypeNo); + $entriesInstanceNo=substr($deleteInstanceNo,0,strlen($deleteInstanceNo)-5); + $commIdStr=oidSysCommSend($sysId,0,$entriesOid,$selectedSysId=-1,$entriesInstanceNo); + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&tableOid=$tableOid&table_type=$table_type&instanceNo=$instanceNo"); + + //echo "entriesTableName=$entriesTableName,entriesOid=$entriesOid,entriesInstanceNo=$entriesInstanceNo
      "; + //echo "deleteOid=$deleteOid,deleteInstanceNo=$deleteInstanceNo,tableOid=$tableOid,tlevel=$tlevel
      "; + } + + //command success,delete the record in the db + //echo "deleteOid=$deleteOid
      "; + $etmp=explode(".",$deleteOid); + $elen=sizeof($etmp); + $deleteTableOid=""; + for($ti=0;$ti<$elen-1;$ti++) + $deleteTableOid.=$etmp[$ti]."."; + $deleteTableOid=substr($deleteTableOid,0,strlen($deleteTableOid)-1); + //echo "deleteTableOid=$deleteTableOid
      "; + $tmpwhere=getLevelWhere($deleteTableOid); + $sql="delete from $paraTable where $tmpwhere and instanceNo=$deleteInstanceNo "; + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $sql.="and subSysNo='$subSysNo' "; + + + //echo "$sql
      "; + mysqli_query($pubConn,$sql); + + //When delete an object, then get all the table + $getArr[0][sysId]=$sysId; + $getArr[0][oid]=$tableOid; + //echo "table=$tableOid,instanceNo=$instanceNo
      "; + $level=getTableLevel($tableOid,$sysTypeNo); + if($level > 1 && $level < 4) + $getArr[0][instanceNo]=$instanceNo; + else + $getArr[0][instanceNo]=""; + getParam($getArr); +} + +//Get all +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if($get) + { + //Get the timeslot parameter from the plat(trunk group id) + $trunk_table_oid=GetOIDByName(SYSTYPENO_MSC,"timeSlotEntry"); + if($sysTypeNo == SYSTYPENO_MSC && $tableOid == $trunk_table_oid) + { + $tmps=explode(".",$instanceNo); + $grounp_id=GetTrunkGroupID($tmps[0]+0,$tmps[1]+0); + if($grounp_id == 1) + $commInfoArr[0][sysId]="320_1_0"; + else + $commInfoArr[0][sysId]="320_0_0"; + if(!GetSystemStatus(SYSTYPENO_MSC,$grounp_id)) + $commInfoArr[0][sysId]="320_99_99"; + } + + getParam($commInfoArr); + } +} + + +$keyId=0; +showTable($tableOid); + + +for($i=0;$i<$keyId;$i++) +{ + if(!$objects[$i]['type'] == LEAF_TYPE && !strstr($objects[$i]['name_1'],"Entry") && !strstr($objects[$i]['name_1'],"Table")) + { + $objects[$i]['table_type']=SCALAR_TABLE_TYPE; + } + if($objects[$i]['type'] == UNKNOWN_TYPE) + { + $objects[$i]['type']=SCALAR_TABLE_TYPE; + } +} +$indexObjectNum=0; +$showObjectNum=0; +$entries_count=0; +for($index=0;$index<$keyId;$index++) +{ + + if($objects[$index]['type'] == ENTRY_TYPE) + { + //echo "{$objects[$index]['name_1']}

      "; + echo ""; + echo ""; + } + else if($objects[$index]['type'] == LEAF_TYPE) + { + + if(strstr($objects[$index]['desc_1'],"Key Parameter")) + { + $displayName=getShowNameOfField($objects[$index]['name_1'],$index); + + if(strstr($objects[$index]['name_1'],"RowStatus")) + echo ""; + else + { + echo ""; + } + $showObjectList[$showObjectNum]=$index; + $showObjectNum++; + } + + if(strstr($objects[$index]['name_1'],"Index")) + { + $indexObjectList[$indexObjectNum]=$index; + $indexObjectNum++; + } + + if(strstr($objects[$index]['name_1'],"Entries")) + { + //$nextEntriesKeyId=$index; + $entries_keyId[$entries_count]=$index; + + $tb=$objects[$index]['name_1']; + $tlen=strlen($tb); + $fg=0; + $tb1=""; + for($ti=0;$ti<$tlen;$ti++) + { + if($tb[$ti] >= 'A' && $tb[$ti] <= 'Z') + $fg=1; + if($fg==1) + $tb1.=$tb[$ti]; + } + $tb2=explode("Entries",$tb1); + $tb3=$tb2[0]; + //PrintInfo("table3=".$tb3); + $entriesOid=findRelationOid($tb3,TABLE_ENTRY,$sysTypeNo); + $objects[$index]['nextEntryOid']=$entriesOid; + + + $entries_count++; + + } + + if(strstr($objects[$index]['name_1'],"RowStatus")) + { + $rowstatusKeyId=$index; + $deleteOid=$objects[$index]['oid']; + } + + } + +} +echo ""; +//show the object rows +for($i=0;$i<$showObjectNum;$i++) +{ + + $sKeyId=$showObjectList[$i]; + $valueTypes[$i]=$objects[$sKeyId]['valueType']; + $objectStyles[$i]=$objects[$sKeyId]['style']; + if($sKeyId == $indexObjectList[$indexObjectNum-1]) + $showIndexPos=$i; + //if($sKeyId == $nextEntriesKeyId) + if($entries_count>0 && in_array($sKeyId,$entries_keyId)) + { + //$nextEntriesPos=$i; + $entries_keyId_pos[$i]=$sKeyId; + $entries_pos[$sKeyId]=$i; + } + if($sKeyId == $rowstatusKeyId) + $rowstatusPos=$i; + $selectLevel=getLevelWhere($objects[$sKeyId]['oid']); + $orderBy="order by instanceNo "; + $tablelevel=getTableLevel($tableOid,$sysTypeNo); + + if($sysTypeNo == 260 && $sysNo != 99 && $subSysNo != 99) + $selectLevel.=" and subSysNo='$subSysNo' "; + + if($instanceNo == "0000") + { + if($tablelevel>1) + { + $likestr=""; + for($tl=0;$tl<$tablelevel-1;$tl++) + $likestr.="0000."; + $likestr.="%"; + $sql="select initValue,instanceNo from $paraTable where $selectLevel and instanceNo like '$likestr' $orderBy"; + } + else + $sql="select initValue,instanceNo from $paraTable where $selectLevel $orderBy"; + } + else + //and instanceNo<>'0000' + $sql="select initValue,instanceNo from $paraTable where $selectLevel and instanceNo like '$instanceNo.%' $orderBy"; + //echo "$sql
      "; + $res=@mysqli_query($pubConn,$sql); + $objectIndex=0; + while($row=@mysqli_fetch_array($res)) + { + if(strstr($objects[$sKeyId]['name_1'],"Index")) + $showValue=$row[initValue]+0; + else + $showValue=translateValueToOpt($sKeyId,$row[initValue]); + $objectValues[$i][$objectIndex]=$showValue; + $objectKeyId[$i][$objectIndex]=$sKeyId; + $objectInstanceNo[$i][$objectIndex]=$row[instanceNo]; + $objectIndex++; + } +} +if(!isset($sort)) + $sort=0; +//echo "style=$objectStyles[$sort],valueType=$valueTypes[$sort]
      "; +if($objectIndex > 0) +{ + if(is_numeric($objectValues[$sort][0])) + asort($objectValues[$sort],SORT_NUMERIC); + else + asort($objectValues[$sort],SORT_STRING); +} +if($objectIndex > 0) +{ + $ki=0; + foreach ($objectValues[$sort] as $key => $val) + { + $keys[$ki]=$key; + $ki++; + //echo "$key = $val
      "; + } +} + +//for($i=0;$i<$objectIndex;$i++) +if($objectIndex > 0) +{ + foreach($keys as $skey => $i) + { + //if($i == $sort) + // array_multisort($objectValues[$i], SORT_DESC); + echo ""; + for($j=0;$j<$showObjectNum;$j++) + { + //$nowpos=array_search($j,$entries_pos); + if($showIndexPos == $j) + { + echo ""; + } + echo ""; + } +} + +//check whether this table can add instance +$haveNewLink=0; +$level=getTableLevel($tableOid,$sysTypeNo); +//nest table +if($level > 1) +{ + $nowTableName=getTableNameByOid($sysId,$tableOid); + $nowTableName=str_replace("Entry","",$nowTableName); + $createEntryOid=findRelationOid($nowTableName,TABLE_CREATE,$sysTypeNo); + //PrintInfo("nowTableName=".$nowTableName.",createEntryOid=".$createEntryOid); + if($createEntryOid != "") + $haveNewLink=1; +} +else +{ + $checkWhere=getLevelWhere($tableOid); + $sql="select * from $paraConfTable where $checkWhere and maxAccess='48' and name_1 like '%Index' "; + //echo "$sql
      "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 1) + $haveNewLink=1; +} + + + + + + +if($haveNewLink == 1) +{ + echo ""; + + for($j=0;$j<$showObjectNum-1;$j++) + echo ""; + echo ""; +} +echo "
      Delete"; + echo "{$displayName}
      "; + + echo ""; + echo "{$objectValues[$j][$i]} "; + echo ""; + //echo "index $tableOid "; + } + //else if($nextEntriesPos == $j) + else if($entries_count>0 && in_array($j,$entries_pos)) + { + $entriesKeyId=$entries_keyId_pos[$j]; + //PrintInfo("nextEntriesOid=".$objects[$entriesKeyId]['nextEntryOid']); + $nextEntryOid=$objects[$entriesKeyId]['nextEntryOid']; + + echo ""; + echo ""; + echo "{$objectValues[$j][$i]} "; + } + else if($rowstatusPos == $j) + { + echo ""; + //echo "{$objectInstanceNo[$j][$i]}"; + echo ""; + } + else + { + echo ""; + $rKeyId=$objectKeyId[$j][$i]; + if(strstr($objects[$rKeyId]['desc_1'],"RelationPoint")) + { + $tmp1=strstr($objects[$rKeyId]['desc_1'],"RelationPoint:"); + $tmp2=explode(";",$tmp1); + $tmp3=explode("RelationPoint:",$tmp2[0]); + $rTableOid=$tmp3[1]; + + $showvalue=$objectValues[$j][$i]; + + if(trim($showvalue) == "--" || trim($showvalue)=="") + { + echo "--"; + } + else + { + $tmp1=explode(" ",$showvalue); + $tmp2=$tmp1[1]; + $tmp3=explode("-",$tmp2); + $tmp4=omc_keep_length($tmp3[0],'0',4); + $tmp5=omc_keep_length($tmp3[1],'0',4); + $rInstanceNo=$tmp4.".".$tmp5; + $rWhere=getLevelWhere($rTableOid); + $rsql="select * from $paraTable where instanceNo='$rInstanceNo' and $rWhere "; + $rres=mysqli_query($pubConn,$rsql); + $num=mysqli_num_rows($rres); + //echo "$rsql"; + if($num == 0) + echo "--"; + else + echo "$showvalue"; + } + } + else + { + echo "{$objectValues[$j][$i]} "; + } + } + echo "
      New--
      "; + + +$DEBUG=0; +if($DEBUG) +{ + echo "

      ============================test========================
      "; + echo "keyId=$keyId
      "; + $test_oid_flag=1; + $test_name_flag=1; + $test_nest_flag=1; + $test_type_flag=1; + + for($i=0;$i<$keyId;$i++) + { + //if($objects[$i]['type'] != LEAF_TYPE && $objects[$i]['type'] != ENTRY_TYPE) + { + echo "$i-"; + if($test_oid_flag) + echo "oid-{$objects[$i]['oid']}, "; + if($test_name_flag) + echo "name-{$objects[$i]['name_1']}, "; + if($test_nest_flag) + echo "nestNum-{$objects[$i]['nest_num']}, "; + if($test_type_flag) + echo "type-{$type_label[$objects[$i]['type']]}, "; + + echo "
      "; + } + } +} +//echo "


      sysId=$sysId,tableOid=$tableOid,instanceNo=$instanceNo
      "; +echo ""; +echo ""; +//for get the instance 0 +if($instanceNo=="0000") + echo ""; +else + echo ""; + + +//get all +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//lock the time slot +if($sysTypeNo == SYSTYPENO_MSC && $tableOid == '2.4.3.1') +{ + //{$sysTypeNo} {$tableOid} {$objects[$index][oid]} + echo ""; + echo ""; + //echo ""; + //echo ""; +} + + +//if not get timeslot, get the timeslot first +if($sysTypeNo == SYSTYPENO_MSC && $tableOid == "2.4.3.1") +{ + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + $count=0; + $database=$objDb; + $selSql = "SELECT T1.* FROM $paraTable AS T1,$paraConfTable AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tsIndex' and instanceNo like '$instanceNo.%' "; + $selRes = @mysqli_query($pubConn,$selSql); + $count=mysqli_num_rows($selRes); + if($count==0) + { + if($hasEnter!=1) + { + $hasEnter=1; + echo ""; + echo "\n\n"; + + } + } +} + +echo "
      "; +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/paramConfiguration/param_show_up.php b/wxc2_omc/configuration/paramConfiguration/param_show_up.php new file mode 100755 index 0000000..d7d7ca5 --- /dev/null +++ b/wxc2_omc/configuration/paramConfiguration/param_show_up.php @@ -0,0 +1,274 @@ + + + + + + +"; +//global variables +define(EMS_APP_ID,0); +define(MSS_APP_ID,9); +define(VSS_APP_ID,8); +define(AAS_APP_ID,11); + +if(!isset($systype_no_select)) + $systype_no_select=320; +if(!isset($system_id_select)) + $system_id_select="320_99_99"; + + +//help id +if($systype_no_select == SYSTYPENO_MSC) + $helpId="2.1.1.1"; +else if($systype_no_select == SYSTYPENO_AAS) + $helpId="2.1.3.1"; +else if($systype_no_select == SYSTYPENO_VLR) + $helpId="2.1.1.2"; +else if($systype_no_select == SYSTYPENO_VLR) + $helpId="2.1.1.2"; +else if($systype_no_select == SYSTYPENO_HLR) + $helpId="2.1.1.3"; +else if($systype_no_select == SYSTYPENO_AUC) + $helpId="2.1.1.4"; +else if($systype_no_select == SYSTYPENO_SMSC) + $helpId="2.1.1.5"; +else if($systype_no_select == SYSTYPENO_SMEG) + $helpId="2.1.1.8"; +else if($systype_no_select == SYSTYPENO_OPPS) + $helpId="2.1.1.9"; +else if($systype_no_select == SYSTYPENO_EIR) + $helpId="2.1.1.7"; +else if($systype_no_select == SYSTYPENO_VSS) + $helpId="2.1.3.2"; +else if($systype_no_select == SYSTYPENO_MRFC) + $helpId="2.66"; +else if($systype_no_select == SYSTYPENO_PALIM) + $helpId="2.1.1.12"; +else if($systype_no_select == SYSTYPENO_RLS) + $helpId="2.1.1.13"; +else + $helpId="2.1.1.1"; +adjust_head_frame("up"); +adjust_title_head_frame("up"); + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > $strNetwork > Parameter"; +echo ""; +showHelp($helpId); +echo "
      "; + +echo "
      "; + + echo "Module:"; + echo ""; + echo "  "; + echo "System ID:"; + echo ""; + + +echo "
       
      "; + + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +//echo "sysTypeName=$sysTypeName,maxSysNum=$maxSysNum,maxSubSysNum=$maxSubSysNum,systype_no_select=$systype_no_select
      "; + +?> + \ No newline at end of file diff --git a/wxc2_omc/configuration/pps/voiceParamImport.php b/wxc2_omc/configuration/pps/voiceParamImport.php new file mode 100755 index 0000000..ff0f8ed --- /dev/null +++ b/wxc2_omc/configuration/pps/voiceParamImport.php @@ -0,0 +1,287 @@ +impObjId= $impObjId"; +if($DEBUG)echo "
      impFileName=$impFileName "; +if($DEBUG)echo "
      ftpDir=$ftpDir "; +if($DEBUG)echo "
      ftpLoginName=$ftpLoginName "; +if($DEBUG)echo "
      ftpLoginPwd=$ftpLoginPwd"; +if($DEBUG)echo "
      paramType=$paramType "; + +function delImpFile() +{ + global $impFileArr,$impFile_1,$impFile_2; + for($j=0;$jPut file $remoteFile Failed"; + return(-1); + }else{ + echo "
      Put file $remoteFile OK"; + } + } + return(1); +} + +function chkImpFile() +{ + $DEBUG=0; + global $impFileArr,$impFile_1,$impFile_2; + global $maxImpFileSize,$maxImpRecordNum; + //检查导入的文件大小,记录条数 + for($j=0;$jimpFileSize=$impFileSize"; + if($impFileSize > $maxImpFileSize){ + echo "
      impRecordNum=$impRecordNum"; + echo "
      File size is too large!"; + return(-1); + } + $impRecordNum = count(file(${$impFileArr[$j][localFile]})); + if($DEBUG) echo "
      impRecordNum=$impRecordNum"; + if($impRecordNum > $maxImpRecordNum){ + echo "
      Records are too much"; + return(-1); + } + } + return(1); +} + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      impFile_1=$impFile_1"; +if($DEBUG) echo "
      impFile_2=$impFile_2"; + +//========================================================== +//数据处理 +//========================================================== +//判断是否有文件上载 +if( $_SERVER['REQUEST_METHOD'] == "POST" && $impFile_1 != "none" && $impFile_2 != "none"){ + if(chkImpFile() < 0){ + delImpFile(); + exit(); + } + + //查找是否有运行的系统被导入参数 + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' + ORDER BY sysNo,subSysNo + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $ppsNum=mysqli_num_rows($getSysIdResult); + if($ppsNum <= 0){ + echo "Error:Can not find any PPS's IP in system list,Please ADD it!"; + delImpFile(); + exit(); + } + $impOkFlag=0; + for($i=0;$i<$ppsNum;$i++){ + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysName='PPS_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $dstSeverIp = $getSysIdRow[ip]; + if($DEBUG) echo "
      sysId = $sysId"; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + + echo "
      Try to ftp voice parameter files to $sysName($dstSeverIp) ......"; + flush(); + + $ftpCon=@ftp_connect($dstSeverIp); + if($ftpCon < 1){ + echo "
      Connect $sysName Failed!"; + continue; + }else{ + echo "
      Connect $sysName OK"; + flush(); + } + if(!@ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + echo "
      Login $sysName Failed!"; + @ftp_quit($ftpCon); + continue; + }else{ + echo "
      Login $sysName OK"; + flush(); + } + if(putImpFile($ftpCon)){ + $impOkFlag = 1; + } + @ftp_quit($ftpCon); + + flush(); + } + delImpFile(); + + if($impOkFlag == 0){ + exit(); + } + + echo "
      Try to send command to $sysTypeName ......"; + flush(); + + switch($paramType){ + case $nPubSubSysParam: + $sysId=$sysTypeNo.'_'.$getSysIdRow[sysNo].'_99'; + break; + case $nPubSysParam: + $sysId=$sysTypeNo.'_99_99'; + break; + default: + break; + } + //修改设备参数 + $instanceNo = 0; + $commState = '01'; + $newValue = '01'; + $chgResult = setSysParamValue($sysId,$impObjId,$instanceNo,$newValue); + + //send set command + if($DEBUG) echo "
      sysCommSend($sysId,$nSetComm,$impObjId)"; + $commStr = sysCommSend($sysId,$nSetComm,$impObjId); + sleep(2); + + echo "OK!"; + flush(); + echo "


       << Return "; + exit(); +}elseif(isset($impFile)){ + echo "
      "; + echo "Upload file failed, File isn't exist or file is empty!"; +} + +//========================================================== +//数据显示 +//========================================================== +?> + + + +" name="subsData" enctype="multipart/form-data" onsubmit="return checkAllInput(this)"> +"; +echo ""; +echo ""; +echo "Advance > Network > PPS voice file "; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> +
      + + + + + + + + + + + + + + + + + + +
      + +
      +Note: Import file's size <= 5M, records <= 5000 +
      Select file 1:(digital_syntax.csv) + + +
      Select file 2:(ivr_syntax.csv) + +
      +"; +?> +
      + +Remarks:

      +The digital_syntax.csv is used to set the pronunciation of numbers for up to eight languages. The ivr_syntax.csv is used to set dial-in numbers for recharge and balance inquiry. + + diff --git a/wxc2_omc/configuration/pubParamConf/Test.php b/wxc2_omc/configuration/pubParamConf/Test.php new file mode 100755 index 0000000..b40db09 --- /dev/null +++ b/wxc2_omc/configuration/pubParamConf/Test.php @@ -0,0 +1,19 @@ + $strLogAlarm> Generator"; + + + +omcProgressBar(100,100); +omcProgressBar(100,80); +omcProgressBar(100,60); +omcProgressBar(100,40); +omcProgressBar(100,20); +omcProgressBar(100,0); +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/pubParamConf/commScan.php b/wxc2_omc/configuration/pubParamConf/commScan.php new file mode 100755 index 0000000..cb80cf1 --- /dev/null +++ b/wxc2_omc/configuration/pubParamConf/commScan.php @@ -0,0 +1,228 @@ +if(isFinish != 0 || (waitTime >= maxWaitTime) ||(stopTime > maxStopTime))
      "; +if($DEBUG) echo "
      if($isFinish != 0 || ($waitTime >= $maxWaitTime) ||($stopTime > $maxStopTime))
      "; + +//命令处理完毕 +//---------------- +if(($isFinish != 0) || ($waitTime >= $maxWaitTime) || ($stopTime > $maxStopTime)){ + if($commId >= $maxOfCommId){ //初始化命令表 + //先删除表 + $dropSql = "DROP TABLE $commTable "; + mysqli_query($pubConn,$dropSql); + //再建一个结构相同的新表 + $createSql="CREATE TABLE parameterComm ( + commId int(6) NOT NULL auto_increment, + commType tinyint(1) NOT NULL default '0', + sysTypeNo smallint(3) NOT NULL default '0', + sysNo smallint(3) NOT NULL default '0', + subSysNo smallint(3) NOT NULL default '0', + instanceNo int(6) unsigned NOT NULL default '0', + paramType tinyint(1) NOT NULL default '0', + objId varchar(30) NOT NULL default '', + commState tinyint(1) NOT NULL default '0', + totalNum int(6) NOT NULL default '0', + finishNum int(6) NOT NULL default '0', + sendTime datetime NOT NULL default '0000-00-00 00:00:00', + bgnTime datetime default '0000-00-00 00:00:00', + endTime datetime default '0000-00-00 00:00:00', + remark varchar(200) binary default NULL, + PRIMARY KEY ( commId ), + KEY commType ( commType ), + KEY sysTypeNo ( sysTypeNo ), + KEY sysNo ( sysNo ), + KEY subSysNo ( subSysNo ), + KEY paramType ( paramType ), + KEY objId ( objId ), + KEY commState ( commState ) + ) "; + mysqli_query($pubConn,$createSql); + }else{ + //删除命令表的相关命令 + $commArr = explode('-',$commIdStr); + for($i=0;$ideleteSql = $deleteSql"; + mysqli_query($pubConn,$deleteSql); + echo mysqli_error($pubConn); + } + } + + // 重定向返回指定页 + if($isFinish != 0){ + if($isFinish > 0){ + echo "Finished!!"; + if($DEBUG) exit(); + echo " "; + }elseif($isFinish == -1){ + echo "Failed in some system!!"; + if($DEBUG) exit(); + echo " "; + }else{ + echo "Failed!!"; + if($DEBUG) exit(); + echo " "; + } + }elseif($usedTime >= $maxOverTime && $stopTime == 1){ + echo "Stoped!!"; + if($DEBUG) exit(); + echo " "; + }else{ //$usedTime >= $maxOverTime + echo "Timeout!!"; + if($DEBUG) exit(); + echo " "; + } + exit(); +}//end of if($isFinish....) + + +//显示命令执行状态 +//----------------------------- +$showTime = $usedTime*2; +echo "Time:$showTime s"; +//$stopTime = 0; +$okNum = 0; +$failNum = 0; +$commNum = 0; +$commArr = explode('-',$commIdStr); +$thisTImeFinishNumstr=''; +$lastTimeFinishNumArr = explode('-',$lastTimeFinishNumStr); +for($i=0;$iget command = $commSql"; + $commResult = mysqli_query($pubConn,$commSql); + if(mysqli_num_rows($commResult) <= 0){ + echo "Cannot find this command's info"; + exit(); + } + $commRows = @mysqli_fetch_array($commResult); + $sysTypeNo = $commRows[sysTypeNo]; + $sysNo = $commRows[sysNo]; + $subSysNo = $commRows[subSysNo]; + $commType = $commRows[commType]; + $paramType = $commRows[paramType]; + $objId = $commRows[objId]; + $commState = $commRows[commState]; + + switch($commType){ + case 0: echo " GET "; + break; + case 3: echo " SET "; + break; + default: + echo "Unknown Command Type"; + exit(); + } + + //获取该系统类型的snmp头和类型名称 + if(!isset($sysTypeName)){ + $sysConfSql = "SELECT snmpHead,sysTypeName FROM $sysConfTable WHERE sysTypeNo='$sysTypeNo'"; + if($DEBUG) echo "
      get conf = $sysConfSql"; + $sysConfResult = mysqli_query($pubConn,$sysConfSql); + echo mysqli_error($pubConn); + $sysConfRows = @mysqli_fetch_array($sysConfResult); + $sysTypeName = $sysConfRows[sysTypeName]; + $snmpHead = $sysConfRows[snmpHead]; + } + $sysName = $sysTypeName.'_'.$sysNo.'_'.$subSysNo; + echo "
      $sysName 's"; + $objIdStr=$snmpHead.'.'.$objId; + echo "$objIdStr"; + + switch($paramType){ + case 0: echo " [sub-system parameter] "; + break; + case 1: echo " [public sub-system parameter]"; + break; + case 2: echo " [public system parameter]"; + break; + default: + echo "Unknown Parameter Type"; + exit(); + } + + switch($commState){ + case 0: //process failed + $failNum++; + echo "
      $commRows[remark]"; + break; + case 1: //wait process + $waitTime++; + break; + case 2: //in process + $waitTime = 0; + //只要有一个命令的完成数在增长,就认为该组命令在运行,否则认为命令处理超时 + if($DEBUG) echo "====> {$commRows[finishNum]} > {$lastTimeFinishNumArr[$i]}"; + if($commRows[finishNum] > $lastTimeFinishNumArr[$i]){ + $stopTime = 0; + }else{ + $stopTime++; + } + omcProgressBar($commRows[totalNum],$commRows[finishNum]); + break; + case 3: //process finished + $okNum++; + omcProgressBar(100,100); + break; + default: + echo "Unknown Command State"; + exit(); + } + $thisTimeFinishNumStr .=$commRows[finishNum].'-'; + echo "

      "; +}//end of for($i=0;$i$commNum =?= $finishNum"; +if($commNum == $okNum){ + $isFinish = 1; +}elseif($failNum > 0 && $okNum > 0){ + $isFinish = -1; +}elseif($commNum == $failNum){ + $isFinish = -2; +}else{ + $isFinish = 0; +} +if($DEBUG) echo"
      lastTimeFinishNumStr=$lastTimeFinishNumStr"; +if($DEBUG) echo"
      thisTimeFinishNumStr=$thisTimeFinishNumStr"; +$lastTimeFinishNumStr = $thisTimeFinishNumStr; +//刷新返回 +//-------------- +$usedTime++; //总时间 +$failURL= rawurlencode($failURL); +$okURL = rawurlencode($okURL); +//保留变量值,传到下次刷新 +$keepStr= "usedTime=$usedTime&waitTime=$waitTime&isFinish=$isFinish&stopTime=$stopTime&failURL=$failURL&okURL=$okURL&commIdStr=$commIdStr&commNum=$commNum&lastTimeFinishNumStr=$lastTimeFinishNumStr&selectedDPC=$selectedDPC"; +if($DEBUG) echo "
      keepStr=$keepStr"; +?> +"> + \ No newline at end of file diff --git a/wxc2_omc/configuration/pubParamConf/paramConf_down.php b/wxc2_omc/configuration/pubParamConf/paramConf_down.php new file mode 100755 index 0000000..0e40edb --- /dev/null +++ b/wxc2_omc/configuration/pubParamConf/paramConf_down.php @@ -0,0 +1,54 @@ + "; + exit(); +} + +$selectedSysId=isset($selectedSysId)? $selectedSysId:-1; +?> + +" scrolling="auto"> +" scrolling="auto" target="_self"> + +<body> + +<p>you browser can not support frame</p> + +</body> + + + diff --git a/wxc2_omc/configuration/pubParamConf/paramConf_down_left.php b/wxc2_omc/configuration/pubParamConf/paramConf_down_left.php new file mode 100755 index 0000000..d3b7e65 --- /dev/null +++ b/wxc2_omc/configuration/pubParamConf/paramConf_down_left.php @@ -0,0 +1,306 @@ +sysTypeNo = $sysTypeNo"; +if($DEBUG) echo "
      sysNo = $sysNo"; +if($DEBUG) echo "
      subSysNo = $subSysNo"; +if($DEBUG) echo "
      selectedDPC = $selectedDPC"; +if($DEBUG) echo "
      selectedSysId = $selectedSysId"; + +//产生菜单时,所依据的表名 +$objDb = 'OBJ_'.$sysTypeNo; +$confTable = 'paramConf'; + +//所链接的页面 +$targetPage = 'paramConf_down_main.php'; + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $showName = name_2; //语种2 +}else{ + $showName = name_1; //语种1 +} +//----------------------- + +echo""; + +//------------------------------------------------------------------------ +//下面列出该菜单依赖的字段名,用逗号隔开 + +//**如果需要添加可显示的层数,以按相同格式更改$levelList和$levelNum + +//**例如:$levelList = "level_0,level_1,level_2,level_3,level_4.menu_6,menu_7,menu_8,menu_9,level_10.......level_n"; +//** 并将$levelNum = n+1; + +$levelList = "level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10"; +$levelNum = 10; +//------------------------------------------------------------------------ + +if($subSysNo == '99'){ + $isSysParam=1; +}else{ + $isSysParam=0; +} +?> + + + +"; +?> +
      + + +
      + "; + if(($sysNo == '99') || ($subSysNo == '99')){ + if($sysNo == '99'){ + $paramType = 2; + if($sysTypeNo[0] == '2'){ + if($sysTypeNo == '222' || $sysTypeNo == '223'|| $sysTypeNo == '260'){ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' AND sysNo!='8' AND sysNo!='11' AND DPC='$selectedDPC' + "; + }else{ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' AND sysNo='9' AND DPC='$selectedDPC' + "; + } + }else{ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + "; + } + }else{ + $paramType = 1; + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' + "; + } + if($DEBUG) echo "sysIdSql(1) = $sysIdSql
      "; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1){ + echo " 
      Can not find Any system be installed.
      "; + exit(); + } + if($sysNo == '99'){ + echo "$sysTypeName"."_pub"; + }else{ + echo "$sysTypeName"."_$sysNo"."_pub"; + } + echo "   Select: "; + echo ""; + }else{ + if ( ('222' == $sysTypeNo) || ('223' == $sysTypeNo) ) //MTP3 OR SCCP) + $paramType = 2; + else + $paramType = 0; + + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' + AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "sysIdSql(2) = $sysIdSql
      "; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1){ + echo " Can not find this system.
      "; + exit(); + } + echo "$sysTypeName"._."$sysNo"._."$subSysNo"; + $sysAlias=$rows[sysAlias]; + if(strlen($sysAlias)){ + echo "   [$sysAlias]"; + } + } + ?> + + + + + + +'0' AND operType !='4' + ORDER BY ".$levelList + ; +if($DEBUG) echo "
      $treeMenuSql"; +$treeMenuResult = mysqli_query($pubConn,$treeMenuSql); +echo mysqli_error($pubConn); +$n=0; +while($treeMenuRows = @mysqli_fetch_array($treeMenuResult)){ + //从第i层开始划分层次,第i层之前不参与显示算法 + for($i=$bgnLevelNo; $i<=$levelNum; $i++){ + $levelId = 'level_'.$i; + $treeMenuArr[$n][$i-1]=$treeMenuRows[$levelId]; + } + $treeMenuArr[$n][$levelNum]=$treeMenuRows[$showName]; + $treeMenuArr[$n][$levelNum+1]=$treeMenuRows[keyId]; + $treeMenuArr[$n][$levelNum+2]=$treeMenuRows[paramType]; + $n++; +} + +/*************************************下面是顺序显示菜单程序***************************************/ + +for($i=0 ; $i < sizeof($treeMenuArr); $i++){ //从上到下 ---> 级 + $objName = $treeMenuArr[$i][$levelNum]; + $objKeyId= $treeMenuArr[$i][$levelNum+1]; + + $num=$bgnLevelNo; + while($treeMenuArr[$i][$num] > 0){ + $num++; + } + $lastLevelNum = $treeMenuArr[$i][$num - 1].'.'; + $isSysParam = $treeMenuArr[$i][$levelNum+2]; + $leaf_show = "".$lastLevelNum.' '.$objName.""; + $knot_show = "".$lastLevelNum.' '.$objName.""; + + $show_1 = "\n$knot_show"; + if($isSysParam > 0){ + $show_2 = "\n $leaf_show"; + $show_4 = "\n $leaf_show"; + }else{ + $show_2 = "\n $leaf_show"; + $show_4 = "\n $leaf_show"; + } + $show_3 = "\n"; + $show_5 = "\n"; + echo""; +}//end for($i=0 ; $i < sizeof($treeMenuArr); $i++) +?> +
      "; + echo ""; + for($j=0; $j < $levelNum;$j++){ //从左到右 ---> 层 + if($treeMenuArr[$i][$j] > 0){ //如果该节点大于零 + if($treeMenuArr[$i+1][$j] > $treeMenuArr[$i][$j] ){ //如果下面有树枝或页子与本节点(树枝或叶子)相连,即下面有兄弟节点 + if($treeMenuArr[$i][$j+1] > 0){ //如果是树枝 + echo "$show_3"; //show_3 + }else{//叶子 + echo "$show_2"; //show_2 + } + }else{//如果下面的节点号不大于本节点号 + if($treeMenuArr[$i][$j+1] > 0){ //如果本节点不是叶子 + $is_line =0; //标志位,用于标志同一树枝下面是否还有分支,或是直接连在本枝上的叶子。 + //顺着上一层目录,向下查找 + for($p=$i+1;$p < sizeof($treeMenuArr) && $treeMenuArr[$p][$j-1] == $treeMenuArr[$i][$j-1];$p++){ + if($treeMenuArr[$p][$j] > $treeMenuArr[$i][$j]){ //找到了!!! + $is_line = 1; + break; + } + } + if($is_line == 1){ //下面还有分支,或是直接连在本枝上的叶子 + echo "$show_3"; //show_3 + }else{//同一树枝下没有分支,或是连在本枝上的叶子 + echo "$show_5"; //show_5 + } + }else{ //本节点是叶子 + if($treeMenuArr[$i+1][$j+1] > 0){ //本节点有分叉,即有起点在本节点的子树 + echo "$show_1"; //show_1 + }else{//本节点是该树枝上最末一片页子 + echo "$show_4"; //show_4 + } + } + } //end else of if($treeMenuArr[$i+1][$j] > $treeMenuArr[$i][$j] ) + } //end if($treeMenuArr[$i][$j] > 0) + } //end for($j=0;$j < $levelNum;$j++) + echo"
      +
      + + + diff --git a/wxc2_omc/configuration/pubParamConf/paramConf_down_main.php b/wxc2_omc/configuration/pubParamConf/paramConf_down_main.php new file mode 100755 index 0000000..08d7346 --- /dev/null +++ b/wxc2_omc/configuration/pubParamConf/paramConf_down_main.php @@ -0,0 +1,666 @@ + + + +"; + +$DEBUG = 0; +//echo "aliasValue_0=$aliasValue_0
      "; + +//echo "strAlias=$strAlias, inputName=$inputName, setValue=$setValue
      "; +$nPubFlag = 99; +$nSubSysParam = 0; +$nGlobalSubSysParam = 1; +$nGlobalSysParam = 2; + +if($DEBUG) echo"
      调试中...对各位带来不便,请原谅"; + +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + +$nGetComm = 0; +$nSetComm = 3; + +$commTable ='OMC_PUB.parameterComm'; +$maxLevelNum = 10; +$maxRecodeOfOnePage=16; + +$nInteger = 2; +$nOctStr = 4; + +//参数定义表,参数表名 +$pubDb = 'OMC_PUB'; +$objDb = 'OBJ_'.$sysTypeNo; +$confTable = 'paramConf'; +$paramTable = 'param_'.$sysNo; + +//------------选择语言版本---------- +if($language == 'eng'){ + $objNameField = 'name_2'; + $objDescField = 'desc_2'; + $objNoteField = 'note_2'; +}else{ + $objNameField = 'name_1'; + $objDescField = 'desc_1'; + $objNoteField = 'note_1'; +} + +//在参数定义表寻找该类型参数的对应信息 +if($objKeyId > 0){ + $paramConfSql = "SELECT * FROM $confTable + WHERE keyId ='$objKeyId' + "; + if($DEBUG) echo "paramConfSql=$paramConfSql
      "; + $paramConfResult = mysqli_query($pubConn,$paramConfSql); + $paramConfRows= mysqli_fetch_array($paramConfResult); + echo mysqli_error($pubConn); + + $paramType = $paramConfRows[paramType]; + $paramNum = $paramConfRows[number]; + $length = $paramConfRows[length]; + $initValue = $paramConfRows[initValue]; + $minValue = $paramConfRows[minValue]; + $maxValue = $paramConfRows[maxValue]; + $objName = $paramConfRows[$objNameField]; + $objDesc = $paramConfRows[$objDescField]; + $isNeedNote = $paramConfRows[needNote]; + $noteMsg = $paramConfRows[$objNoteField]; + $operType = $paramConfRows[operType]; + $valueType = $paramConfRows[valueType]; + $objIdStr = ''; + $objWhereStr= ''; + $lastLevelNo = 0; + for($i=1;$i<=$maxLevelNum;$i++){ + $levelId = 'level_'.$i; + if($paramConfRows[$levelId] == 0){ + if($lastLevelNo <= 0){ + $lastLevelNo = $i-1;//最后一层编号 + } + }else{ + ${$levelId}=$paramConfRows[$levelId]; + $objIdStr .= $paramConfRows[$levelId].'.';//该类参数的对象编号 + $objWhereStr .= $levelId.'='.${$levelId}.' AND '; + } + } + $objIdStr = substr($objIdStr,0,-1); //最后多了一个'.',将其去掉 + $objWhereStr = substr($objWhereStr,0,-5); //最后多了一个' AND ',将其去掉 + $maxlength = $length*2; + if($DEBUG) echo "
      objIdStr = $objIdStr ,lastLevelNo = $lastLevelNo"; + if($DEBUG) echo "
      objWhereStr = $objWhereStr
      "; + }//end if + +$needSaveInitValue = 0; +$needSendComm = 0; + +//*********从设备读参数*************************** +if($DEBUG) echo "
      getFromSys =$getFromSys
      "; +if(isset($getFromSys)){ + $commType = $nGetComm; + $needSendComm = 1; +} +//*********下载参数到设备************************* +if($DEBUG) echo "
      setToSys =$setToSys
      "; +if(isset($setToSys)){ + if($DEBUG) echo "
      setToSys =$setToSys
      "; + if($isKnot > 0){ + $needSaveInitValue = 0; + }else{ + $needSaveInitValue = 1; + } + $commType = $nSetComm; + $needSendComm = 1; +} +//**********数据库各列间相互导入******************* +if(isset($read2init)){ + if($DEBUG) echo "
      read2init=$read2init"; + $needSaveInitValue = 0; + $needSendComm = 0; + $moveType='read2init'; +} + +if(isset($saveInitValue)){ + if($DEBUG) echo "
      saveInitValue =$saveInitValue"; + $needSaveInitValue = 1; + $needSendComm = 0; +} + +//---------保存参数------------------------------ +if($DEBUG) echo "
      needSaveInitValue=$needSaveInitValue"; +if($needSaveInitValue == 1){ + if($DEBUG) echo "
      bgnNo=$bgnNo / endNo=$endNo"; + if($isKnot==1) { + $saveSql = "UPDATE $paramTable SET initValue = editValue + WHERE subSysNo='$subSysNo' AND $objWhereStr"; + $saveResult = mysqli_query($pubConn,$saveSql); + } else { + for($i=$bgnNo;$i<=$endNo;$i++){ + $initValue=${'initValue_'.$i}; + $saveSql = "UPDATE $paramTable SET initValue = '$initValue' + WHERE subSysNo='$subSysNo' AND $objWhereStr AND instanceNo='$i' + "; + + if($DEBUG) echo "
      saveSql=$saveSql"; + $saveResult = mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + } + } +} + +//---------导入各列的参数------------------------------ +if(isset($moveType)){ + switch($moveType){ + case 'read2init': + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE subSysNo='$subSysNo' AND $objWhereStr + AND (LENGTH(readValue) > 0) + AND readValue != 'Null' + AND readValue NOT LIKE 'Error%' + "; + break; + default: + echo "Unknown moveType=$moveType!!"; + exit(); + } + $moveResult=mysqli_query($pubConn,$moveSql); + if($DEBUG) echo "
      moveSql=$moveSql"; + echo mysqli_error($pubConn); +} + +if($needSendComm == 1 &&$commType==$nSetComm){ + $clearSql = "UPDATE $paramTable SET readValue = '' + WHERE subSysNo='$subSysNo' AND $objWhereStr"; + $clearResult=mysqli_query($pubConn,$clearSql); + if($DEBUG) echo "
      clearSql=$clearSql"; + echo mysqli_error($pubConn); +} + +//---------发送命令,跳转页面---------------------------- +if($needSendComm == 1 && isset($commType)){ + $okURL = "$PHP_SELF?isKnot=$isKnot&sysId=$sysId&bgnNo=$bgnNo&objKeyId=$objKeyId&selectedSysId=$selectedSysId&selectedDPC=$selectedDPC"; + $failURL = "$PHP_SELF?isKnot=$isKnot&sysId=$sysId&bgnNo=$bgnNo&objKeyId=$objKeyId&selectedSysId=$selectedSysId&selectedDPC=$selectedDPC"; + if($DEBUG) echo "
      okURL =$okURL
      "; + if($DEBUG) echo "
      sysCommSend($sysId,$commType,$objIdStr,$selectedSysId,$selectedDPC)"; + if($DEBUG) echo "
      selectedSysId=$selectedSysId"; + $commIdStr = sysCommSend($sysId,$commType,$objIdStr,$selectedSysId,$selectedDPC); + if($DEBUG) echo "
      commIdStr=$commIdStr"; + if(isset($commIdStr) && $commIdStr != -1){ + $failURL = urlencode($failURL); + $okURL = urlencode($okURL); + $scanURL ="commIdStr=$commIdStr&okURL=$okURL&failURL=$failURL"; + if($DEBUG) echo "
      scanURL = $scanURL
      "; + if($DEBUG) exit(); + echo " "; + exit(); + }else{ + echo "
      SEND GET COMMAND ERROR!
      "; + } +} +?> + +$strParametersOperations:"; + echo "

      $strParametersOperationsRemarks_1"; + echo "

      $strParametersOperationsRemarks_2"; + echo "

      $strParametersOperationsRemarks_3"; + + //显示操作流程图 + echo "

      "; + echo "

      "; + if($language == 'eng'){ + echo ""; + }else{ + echo ""; + } + echo "

      "; +}else{ + //*********************大类的参数********************* + if($isKnot > 0){ + echo "
      "; + echo "
      Object Id: $objIdStr"; + echo "
      You are going to operate All parameters included in
      $objName
      "; + echo "

      "; + echo ""; + echo ""; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
       "; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "
      "; + echo " "; + echo ""; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo ""; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo ""; + echo " "; + echo " "; + echo " "; + echo " "; + echo " "; + echo "
      No$strParameterdDescription
      xx$objNameALLALL
      ................
      "; + //显示操作流程图 + echo "

      "; + echo "

      "; + if($language == 'eng'){ + echo ""; + }else{ + echo ""; + } + echo "

      "; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + exit(); + echo "
      "; + } + + //*********************显示该对象参数说明********************* + echo ""; + echo "$strParameterDescription: $objName  "; + echo "$strUnitLength:$length byte  "; + //echo "$strObjectID: $objIdStr   $strRemark:"; + echo "
      "; + $valueLen=strlen($initValue); + //echo "
      valueLen=$valueLen"; + if($valueLen<20) + { + echo "$strValueRange:$minValue - $maxValue  "; + echo "$strDefaultValue:$initValue  "; + } + echo "$strTotalRecords:$paramNum"; + //$page_num=round($parameter_num / $number_records_to_display); + //echo "$strTotalPages :$page_num"; + echo "
      "; + //*********************显示参数**************************** + if(!isset($bgnNo)){ + $bgnNoSql = " SELECT snmpInstanceBgn FROM sysConf + WHERE sysTypeNo = '$sysTypeNo' + "; + if($DEBUG) echo"
      bgnNoSql=$bgnNoSql"; + $result = mysqli_query($pubConn,$bgnNoSql); + $rows = mysqli_fetch_array($result); + $bgnNo=$rows[0]; + } + + //------------查询参数表--------------------- + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo >='$bgnNo' + ORDER BY instanceNo LIMIT 0,$maxRecodeOfOnePage + "; + if($DEBUG) echo"
      ParamSql = $paramSql"; + $paramResult = mysqli_query($pubConn,$paramSql); + + //已显示的参数个数 + $endNo=$bgnNo + $maxRecodeOfOnePage - 1; +//*************************************************编辑参数时所用javascript********************************* +?> + + + +
      " onsubmit="return checkAllInput(this)"> + + + "; + if($bgnNo >= $maxRecodeOfOnePage){//设定上一页开始序号 + $preNo = $bgnNo - $maxRecodeOfOnePage; + $keepValue = "objKeyId=$objKeyId&sysId=$sysId&bgnNo=$preNo&selectedSysId=$selectedSysId&selectedDPC=$selectedDPC"; + echo"\"previous"; + } + echo""; + + //select the page. + echo ""; + + echo ""; + ?> + + + + +
      "; + if ( $paramNum > $maxRecodeOfOnePage ) { + echo ""; + } + echo ""; + if($paramNum > ($endNo+1)){//设定下一页开始序号 + $nextNo = $bgnNo + $maxRecodeOfOnePage; + $keepValue = "objKeyId=$objKeyId&sysId=$sysId&bgnNo=$nextNo&selectedSysId=$selectedSysId&selectedDPC=$selectedDPC"; + echo"\"next"; + } + echo"No. + $bgnNo-"; + $endNo=($paramNum < $endNo)?($paramNum-1):$endNo; + //当instanceNo从1开始时,需要将endNo加1 + if($bgnNo == 1){ + $endNo++; + } + echo "$endNo"; + ?> + + "; + }else{ + echo ""; + } + + ?> + + "; + }else{ + echo ""; + } + ?> + +
      + +
      + + + + + + + + 8){ + $inputSize = $maxlength; +}else{ + $inputSize = 8; +} +$objDescArr = explode('+',$objDesc); +$objDescArrSize= sizeof($objDescArr); +while($paramRows = @mysqli_fetch_array($paramResult)){ + $initName='initValue_'.$paramRows[instanceNo]; + $aliasName = "aliasValue_".$paramRows[instanceNo]; + $readName='readValue_'.$paramRows[instanceNo]; + echo "\n "; + echo " "; + if($objDescArrSize == 4){ + $objDescNo =0; + $objDescNo = $objDescArr[1]+$objDescArr[2]*$paramRows[instanceNo]; + $objDescTmp =''; + $objDescTmp = $objDescArr[0].$objDescNo.$objDescArr[3]; + }else{ + $objDescTmp = $objDesc; + } + //echo "aliasName=$aliasName
      "; + echo ""; + if(TRUE == isset($strAlias)){ + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + }else{ + echo ""; + echo "set.."; + echo ""; + echo ""; + } + echo ""; +} +?> +
      No. + + +   + + + +
      $paramRows[instanceNo] $objDescTmp($strAlias)$objDescTmp"; + $rows=ceil($inputSize/20); + //echo "
      rows=$rows"; + if($inputSize > 20){ + $cols=20; + echo ""; + echo "set.."; + echo "
       $paramRows[readValue]
      +"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +adjust_content_tail("down"); +?> +
      + + diff --git a/wxc2_omc/configuration/pubParamConf/paramConf_index.php b/wxc2_omc/configuration/pubParamConf/paramConf_index.php new file mode 100755 index 0000000..67ceafc --- /dev/null +++ b/wxc2_omc/configuration/pubParamConf/paramConf_index.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>your browser can not support frame</p> + + </body> + + + + diff --git a/wxc2_omc/configuration/pubParamConf/paramConf_up.php b/wxc2_omc/configuration/pubParamConf/paramConf_up.php new file mode 100755 index 0000000..1c24231 --- /dev/null +++ b/wxc2_omc/configuration/pubParamConf/paramConf_up.php @@ -0,0 +1,208 @@ + + + + + +
      +"; +echo ""; +echo ""; +echo "Advance > Network > Parameter setting"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; +?> + + + + + + +"; +echo"  $strOpenCodeCommutator"; +echo ""; +*/ +?> + + +
      : + + +: + +
      + +"; +echo " "; +echo ""; +echo ""; +echo ""; +?> + + +
      + + diff --git a/wxc2_omc/configuration/pubParamConf/paramEdit.php b/wxc2_omc/configuration/pubParamConf/paramEdit.php new file mode 100755 index 0000000..eb28e74 --- /dev/null +++ b/wxc2_omc/configuration/pubParamConf/paramEdit.php @@ -0,0 +1,624 @@ + 0)?$TEST:0; +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +//value Type +$nInteger = 2; +$nOctStr = 4; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.paramConf'; + return($tableName); +} + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + echo "
      Error in omcStrFill:the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +$sysConfTable = 'OMC_PUB.sysConf'; +$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:0); + +$pubDb ='OMC_PUB'; +$objDb = omcGetObjDb($sysTypeNo); +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf); +$maxLevelNum = 10; + +if($DEBUG) echo "
      $paramConfTable
      "; +if($DEBUG) echo "
      aliasName=$aliasName
      "; +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + +//=======================Get value From submit=================== +if($set == 'Set'){ + + //sort by offset + for($i=1;$i<=$unitNum;$i++){ + $tmpDef = ${'unitDef_'.$i}; + $tmpValue = ${'unit_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$i] = $tmpDef; + $tmpDefArr=explode('-',$tmpDef); + $sortArr[$i] = $tmpDefArr[0]; + $valueArr[$i] = $tmpValue; + } + $lastValue = ''; + $k = 0; + asort($sortArr); + for(reset($sortArr); $key = key($sortArr); next($sortArr)){ + if($DEBUG) echo "
      sortArr[$key] = {$sortArr[$key]}"; + if($DEBUG) echo "
      unitValue = {$valueArr[$key]}"; + $unitValue = $valueArr[$key]; + if($DEBUG) echo "
      defArr[$key] = {$defArr[$key]}"; + $unitDefArr = explode('-',$defArr[$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1){ + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + + if($bgnByte!=$endByte){ + if($DEBUG) echo "
      substr($bitValue,0,1+$endBit)"; + $tmpBitValue=substr($bitValue,0,1+$endBit); + $newBitValue=$tmpBitValue; + if($DEBUG) echo "
      newBitValue=$newBitValue"; + + for($byteNum=$endByte-1;$byteNum >= $bgnByte;$byteNum--){ + if($DEBUG) echo "
      substr($bitValue,($byteNum-($endByte-1))*8+1+$endBit,8)"; + $tmpBitValue=substr($bitValue,($byteNum-($endByte-1))*8+1+$endBit,8); + if($DEBUG) echo "
      $newBitValue.$tmpBitValue"; + $newBitValue=$newBitValue.$tmpBitValue; + if($DEBUG) echo "
      newBitValue=$newBitValue"; + } + $bitValue=$newBitValue; + } + + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $newByteValue=""; + for($tmp=0;$tmpomcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + } + if($DEBUG) echo "
      lastValue = $lastValue "; + $setValue = $lastValue; + if($TEST != 1){ + //set back to input field + echo "setValue=$setValue
      "; + echo ""; + }else{ + $setValue = strtoupper($setValue); + } +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +
      " > +setValue = $setValue ,inputName = $inputName"; + +if($keyId > 0){ + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE keyId = '$keyId'"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; +}else{ + echo "ERROR!!:keyId == NULL"; + exit(); +} +/************************************** +*objName +*[unit]name[u]xx.xx-yy.yy[u]input[v]toDec-fillHigh-fillChar +*[unit]name[u]xx.xx-yy.yy[u]select[v]value1[opt]desc1[v]value2[opt]desc2 +*[remark] +***************************************/ + +//explode by '[remark]' +$remarkArr = explode('[remark]',$setTemplate); +$remark = $remarkArr[1]; + +//explode by '[unit]' +$unitArr = explode('[unit]',$remarkArr[0]); + +//show instance's name +echo "{$unitArr[0]}

      "; +if($DEBUG) echo "
      $unitArr[1]"; +//show every one unit +//--><-//$setValue = strrev($setValue); +if($DEBUG){ + echo ""; +}else{ + echo "
      "; +} +for($i=1;$i"; +}//end of for(..) + +//parmmeter alias +/* +echo ""; +*/ +echo "
      "; + //unit input name + $unitName = "unit_".$i; + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$i]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + //show Unit Name + echo "$tlvArr[0]"; + echo " "; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + if($DEBUG) + echo "
      byteValue = $byteValue"; + + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $newBitValue=''; + for($byteNum=$bgnByte;$byteNum<=$endByte;$byteNum++){ + $tmpBitValue=substr($bitValue,($byteNum-$bgnByte)*8,8); + if($DEBUG) echo "
      $tmpBitValue=substr($bitValue,($byteNum-$bgnByte)*8,8)"; + $tmpBitValue = strrev($tmpBitValue); + if($DEBUG) echo "
      $tmpBitValue = strrev($tmpBitValue)"; + if($DEBUG) echo "
      bitValue = $bitValue"; + $newBitValue=$newBitValue.$tmpBitValue; + } + + $catBitLen = $endByte*8+$endBit - ($bgnByte*8 + $bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($newBitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($newBitValue,$bgnBit,$catBitLen); + + + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + + } + + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + $inputValue = trim($inputValue);//add by oven 2006-8-2 remvove dirty in Mozilla. + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG)echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else if($defArr[0] == 'toAscii'){ + for($ii=0;$ii$valueType == $nOctStr"; + if($valueType == $nOctStr){ + if($defArr[0] == 'toAscii'){ + $inputLen = $byteLen; + }elseif($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + $inputLen = $byteLen *2; + }else{ + $inputLen = $byteLen *3; + } + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + } + break; + case 'select': + + if($valueType == $nOctStr){ + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + + }else{ + $selectValue = HexDec($byteValue); + + } + }else{ + + $selectValue=$byteValue; + } + + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + if($DEBUG) echo "
      $valueType =?= $nOctStr(nOctStr)"; + echo ""; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + if($valueType == $nOctStr){ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'keepDec-high-0'; + } + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + echo "\n "; + echo "
      "; +echo "Alais:"; +echo ""; +echo "
      "; + +$remark=nl2br($remark); +echo "
      Remarks:
      $remark

      "; +$unitNum = $i-1; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +//echo "\n"; +echo "\n"; +echo "\n"; +echo "
      "; + +//=======================Test input field======================== +if($TEST){ + echo "
      "; + echo "
      "; + //--><--// $setValue = strrev($setValue); + echo "Test Area
      "; + echo "Test Value:   "; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
      "; +} +?> + + diff --git a/wxc2_omc/configuration/smsc/smscConf.php b/wxc2_omc/configuration/smsc/smscConf.php new file mode 100755 index 0000000..37fb9e0 --- /dev/null +++ b/wxc2_omc/configuration/smsc/smscConf.php @@ -0,0 +1,652 @@ + + + 0 ".$wSc." ORDER BY level_2,level_3 "; +if($DEBUG)echo "
      defSql=$defSql"; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); + +do +{ + $level_1 = $defRow[level_1]; + $level_2 = $defRow[level_2]; + $level_3 = $defRow[level_3]; + $defaultValue[$level_2][$level_3] = $defRow[initValue]; + if($DEBUG) echo "
      defaultValue[$level_2][$level_3]={$defaultValue[$level_2][$level_3]}"; + +}while($defRow = @mysqli_fetch_array($defRes)); + +$cellFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +//**************************************************************** +//函数 +// ChComm($sysId) +//函数说明:检查命令处理结果 +// +//变量说明: +// 无 +// +// +//返回值:$paramType +//$nSubSysParam = 0; +//$nGlobalSubSysParam = 1; +//$nGlobalSysParam = 2; +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function ChComm($sysId,$chkType=1) +{ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + $DEBUG = 0; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + + if($DEBUG)echo "
      selComm=$selComm"; + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + do + { + $temCommState = $selRow[commState]; + if($selRow[remark]){ + $remark = $selRow[remark]; + //echo "
      remark=$remark"; + } + //echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc) + return($nWaitProc); + elseif($temCommState == $nInProc) + return($nInProc); + elseif($temCommState == $nOutProc) + $commState = $nOutProc; + else + $commState = 0; + }while($selRow = @mysqli_fetch_array($selRes)); + + return($commState); +} + + + +//**************************************************************** +//函数 +// 从Buffer_2拷贝到$buffer_1 +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$paramType +// +// +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function copyBuffer($buffer_1,$buffer_2,$wDef,$type='1') +{ + global $sysTypeNo,$sysTypeNo_1,$db,$db_1,$tb_0,$tb_1,$tb_2,$wSc; + $DEBUG = 0; + $addWer = " AND (LENGTH($buffer_2) > 0) AND $buffer_2 != 'Null' AND $buffer_2 NOT LIKE 'Error%' "; + + //Location management + if($type) + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wSc.$addWer; + else + $uTgSql = " UPDATE $tb_2 set $buffer_1=$buffer_2 WHERE subSysNo = '99' ".$wSc.$wDef.$addWer; + + if($DEBUG) echo "
      uTgSql=$uTgSql "; + $uTgRes = @mysqli_query($pubConn,$uTgSql); + + echo mysqli_error($pubConn); + + if($uTgRes) + return 1; + else + return 0; +} + +//**************************************************************** +//函数 +// get 或 set +//函数说明: +// +//变量说明: +// 无 +// +// +//返回值:$commType +// +// +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function eSetGet($commType) +{ + global $sysTypeNo,$sysTypeNo_1,$db,$db_1,$tb_0,$tb_1,$tb_2,$wSc,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $maxNum,$remark,$nGetComm,$nSetComm; + $DEBUG = 0; + + if($commType == $nGetComm) + $showType = "Get "; + else + $showType = "Set "; + + + //2.2 + $sysId = "350_99_99"; + $objIdStr = "2.2"; + $scSend = sysCommSend($sysId,$commType,$objIdStr); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType UDP parameters   "; + if($i > $maxNum){ + echo "
      Timeout"; + flush(); + break; + } + echo ""; + flush(); + + $sysId = "350"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + + flush(); + break; + } + + sleep(1); + $i++; + } + + if($pNext1) + { + $sysId = "350_99_99"; + $objIdStr = "2.3"; + $scSend = sysCommSend($sysId,$commType,$objIdStr); + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType TCP parameters   "; + if($i > $maxNum){ + echo "
      Timeout"; + $rValue = -1; + flush(); + break; + } + echo ""; + flush(); + + $sysId = "350"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + + flush(); + break; + } + + sleep(1); + $i++; + } + } +}//end of function + + + +if($saveSys) +{ + + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + + eSetGet($nSetComm); + + sleep(1); + echo ""; + + +}//end of set sys +elseif($readSys) +{ + eSetGet($nGetComm);//get value + + /****************copy readValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "readValue"; + $inCre=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      inCre=$inCr"; + + sleep(1); + echo ""; +}//end of $readSys +elseif($saveDisk) +{ + /****************copy initValue to editValue******************/ + $buffer_1 = "editValue"; + $buffer_2 = "initValue"; + $inCed=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      $inCed=$$inCed"; + + if($inCed) + echo "
      Save success."; + else + echo "
      Save Failure."; + + flush(); + sleep(1); + echo ""; +}//end of $saveDisk +elseif($readDisk) +{ + /****************copy editValue to initValue******************/ + $buffer_1 = "initValue"; + $buffer_2 = "editValue"; + $edCin=copyBuffer($buffer_1,$buffer_2,$wDef); + if($DEBUG) echo "
      edCin=$edCin"; + + if($edCin) + echo "
      Read success."; + else + echo "
      Read failure."; + + flush(); + sleep(1); + echo ""; + +}//end of $comSys +elseif($delete) +{ + $delSql = " UPDATE $tb_2 set initValue = '$defaultValue' WHERE subSysNo = '99' ".$wSc. " AND instanceNo = $delValue "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} +elseif($saveComm) +{ + for($i=0;$i<1;$i++) + { + $temTb = $tb_2; + $updSql = " UPDATE $temTb set initValue = '01' WHERE subSysNo = '99' AND level_1 = '3' AND level_2 = '3' "; + //echo "
      updSql=$updSql"; + $updRes = @mysqli_query($pubConn,$updSql); + //echo "
      updRes=$updRes"; + } + + for($j=0;$j<1;$j++) + { + if($sTimeOut) + break; + + $sysId = $sysTypeNo."_99_99"; + $commType = $nSetComm; + $objIdStr = "3.3"; + $flag = sysCommSend($sysId,$commType,$objIdStr); + + $i = 0; + while(1) + { + if($i == 0) + echo "
      Save parapeter to system "; + if($i > $maxNum){ + echo "
      Timeout"; + $sTimeOut = 1; + break; + } + echo ""; + flush(); + + $sysId = $sysTypeNo; + $chRes=ChComm($sysId); + //echo "
      chRes=$chRes"; + if($chRes == $nOutProc || $chRes == $nProcFail){ + $pNext1 = 1; + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + + sleep(1); + $i++; + } + } +} + +if($readSys || $saveSys || $saveComm){ + echo "
      "; + echo "

      $strBack"; + exit(); +} + +/************select value to see************/ +$scSql = " SELECT level_1,level_2,level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wSc." ORDER BY level_3 "; +if($DEBUG) echo "
      scSql=$scSql"; +$scRes = @mysqli_query($pubConn,$scSql); +$scRow = @mysqli_fetch_array($scRes); +echo mysqli_error($pubConn); +do +{ + $level_1 = $scRow[level_1]; + $level_2 = $scRow[level_2]; + $level_3 = $scRow[level_3]; + $instanceNo = $scRow[instanceNo]; + + if($level_3 > 1){//if no.1=="--",then all="--" + if($showValue[$level_2][$instanceNo][1] == '--'){ + $showValue[$level_2][$instanceNo][$level_3] = "--"; + continue; + } + } + + if($scRow[initValue] == $defaultValue[$level_2][$level_3] && (($level_2 == 2 && $level_3 < 7) OR ($level_2 == 3 && $level_3 < 8)) ){ + $showValue[$level_2][$instanceNo][$level_3] = "--"; + continue; + } + + if($level_3 > 0 && $level_3 < 4){//name,sysid,password + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = substr($scRow[initValue],$i*2,2); + if($temValue[$i] == '00'){ + break; + }else{ + $temValue[$i] = Chr(HexDec($temValue[$i])); + } + } + $aNum = $i; + $tValue = ''; + for($i=0;$i<$aNum;$i++){ + $tValue = $tValue.$temValue[$i]; + } + if($DEBUG)echo "
      tValue=$tValue"; + $showValue[$level_2][$instanceNo][$level_3] = $tValue; + }elseif($level_3 == 4){ + $p4 = explode("E",$scRow[initValue]); + $showValue[$level_2][$instanceNo][$level_3] = $p4[0]; + }elseif($level_3 == 6){ + if($level_2 == 2){ + $p6 = explode("E",$scRow[initValue]); + $showValue[$level_2][$instanceNo][$level_3] = $p6[0]; + }elseif($level_2 == 3){ + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = HexDec(substr($scRow[initValue],$i*2,2)); + } + $showValue[$level_2][$instanceNo][$level_3] = $temValue[0].".".$temValue[1].".".$temValue[2].".".$temValue[3]; + } + }elseif($level_3 == 7){ + if($level_2 == 2){ + $showValue[$level_2][$instanceNo][$level_3] = HexDec($scRow[initValue]); + }else{ + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = HexDec(substr($scRow[initValue],$i*2,2)); + } + $showValue[$level_2][$instanceNo][$level_3] = $temValue[0].".".$temValue[1].".".$temValue[2].".".$temValue[3]; + } + }elseif($level_3 == 12){ + if($scRow[initValue]==0||HexDec($scRow[initValue])==16) + $showValue[$level_2][$instanceNo][$level_3]='7bit'; + else + $showValue[$level_2][$instanceNo][$level_3]='8bit'; + }else{ + $showValue[$level_2][$instanceNo][$level_3] = HexDec($scRow[initValue]); + } + if($DEBUG) echo "
      showValue[$level_2][$instanceNo][$level_3]={$showValue[$level_2][$instanceNo][$level_3]}"; +}while($scRow = @mysqli_fetch_array($scRes)); + +echo ""; +echo "

      "; +?> +"; +echo ""; +echo ""; +echo "$strConfiguration > SMSC"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> +
        + + + System:"; + echo ""; + echo ""; + ?> + + + + + +
      Disk: + "; + ?> +
      +

      + + + + + + + + + + + + + + + + + +"; +echo ""; +echo ""; +for($i=0;$i<8;$i++) +{ + echo ""; + echo ""; + for($j=1;$j<14;$j++){ + if($j == 5||$j == 11){ + continue; + }elseif($j == 7){ + echo ""; + echo ""; + } + + echo ""; + } + echo ""; +} +echo ""; +echo ""; +echo ""; + +for($i=0;$i<32;$i++) +{ + echo ""; + echo ""; + for($j=1;$j<14;$j++){ + if($j == 5){ + continue; + }elseif($j == 6){ + echo ""; + } + + echo ""; + } + echo ""; +} +echo "
      No.NameSystem IDPasswordService numberGTT numberService IPLocal IP Session timerEnquire link timerInactivity timerResponse timerDCSTime to live
      UDP parameters
      $i----{$showValue[2][$i][$j]} 
      TCP parameters
      $i--{$showValue[3][$i][$j]} 
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/configuration/smsc/smscEdit.php b/wxc2_omc/configuration/smsc/smscEdit.php new file mode 100755 index 0000000..74d0380 --- /dev/null +++ b/wxc2_omc/configuration/smsc/smscEdit.php @@ -0,0 +1,362 @@ + + +valueLen=$valueLen"; + for($j=0;$j<$valueLen;$j++){ + $temValue[$j] = substr($showValue[$i],$j,1); + $temValue[$j] = omc_keep_length(DecHex(Ord($temValue[$j])),0,2); + } + $aNum = $j; + $tValue = ''; + for($j=0;$j<$aNum;$j++){ + $tValue = $tValue.$temValue[$j]; + } + if($DEBUG)echo "
      tValue=$tValue"; + + if($i == 1) + $showValue[$i] = omc_keep_length($tValue,0,32,0); + elseif($i == 2) + $showValue[$i] = omc_keep_length($tValue,0,30,0); + elseif($i == 3) + $showValue[$i] = omc_keep_length($tValue,0,16,0); + } + + $showValue[4] = omc_keep_length($showValue[4],E,16,0);//Service number + + for($i=1;$i<$udtNum;$i++){ + if($oType==2&&$i==11) + continue; + $udtSql = " UPDATE $tb_2 SET initValue = '$showValue[$i]' WHERE subSysNo = '99' AND level_2 = '$oType' AND level_3 = '$i' AND instanceNo = '$iNum' ".$wSc; + //echo "
      udtSql=$udtSql"; + $udtRes = @mysqli_query($pubConn,$udtSql); + echo mysqli_error($pubConn); + } + echo ""; +} + +/************select value to see************/ +$scSql = " SELECT level_2,level_3,instanceNo,initValue,editValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND level_2 = '$oType' AND instanceNo = '$iNum' ".$wSc." ORDER BY level_3 "; +if($DEBUG) echo "
      scSql=$scSql"; +$scRes = @mysqli_query($pubConn,$scSql); +$scRow = @mysqli_fetch_array($scRes); +echo mysqli_error($pubConn); +do +{ + $level_2 = $scRow[level_2]; + $level_3 = $scRow[level_3]; + if($DEBUG)echo "
      level_3=$level_3"; + $instanceNo = $scRow[instanceNo]; + //$showValue[$level_3] = $scRow[initValue]; + //if($DEBUG)echo "
      showValue[$level_3]={$showValue[$level_3]}"; + + if($level_3 > 0 && $level_3 < 4){ + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = substr($scRow[initValue],$i*2,2); + if($temValue[$i] == '00'){ + break; + }else{ + $temValue[$i] = Chr(HexDec($temValue[$i])); + } + } + $aNum = $i; + $tValue = ''; + for($i=0;$i<$aNum;$i++){ + $tValue = $tValue.$temValue[$i]; + } + //echo "
      tValue=$tValue"; + $showValue[$level_3] = $tValue; + }elseif($level_3 == 4){ + $p4 = explode("E",$scRow[initValue]); + $showValue[$level_3] = $p4[0]; + }elseif($level_3 == 6){ + if($level_2 == 2){ + $p6 = explode("E",$scRow[initValue]); + $showValue[$level_3] = $p6[0]; + }elseif($level_2 == 3){ + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = HexDec(substr($scRow[initValue],$i*2,2)); + } + $showValue[$level_3] = $temValue[0].".".$temValue[1].".".$temValue[2].".".$temValue[3]; + } + }elseif($level_3 == 7){ + if($level_2 == 2){ + $showValue[$level_3] = HexDec($scRow[initValue]); + }else{ + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = HexDec(substr($scRow[initValue],$i*2,2)); + } + $showValue[$level_3] = $temValue[0].".".$temValue[1].".".$temValue[2].".".$temValue[3]; + } + }else{ + $showValue[$level_3] = HexDec($scRow[initValue]); + } + +}while($scRow = @mysqli_fetch_array($scRes)); + + + +echo "
      "; +echo ""; + +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +if($oType == 2){ + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $arr_DCS=array( + array('num' => '0', 'remark' => 'To smpp=7bit,default=7bit'), + array('num' => '1', 'remark' => 'To smpp=8bit,default=7bit'), + array('num' => '16', 'remark' => 'To smpp=7bit,default=8bit'), + array('num' => '17', 'remark' => 'To smpp=8bit,default=8bit') + ); + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} +elseif($oType == 3) +{ + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $arr_DCS=array( + array('num' => '0', 'remark' => 'To smpp=7bit,default=7bit'), + array('num' => '1', 'remark' => 'To smpp=8bit,default=7bit'), + array('num' => '16', 'remark' => 'To smpp=7bit,default=8bit'), + array('num' => '17', 'remark' => 'To smpp=8bit,default=8bit') + ); + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + +} +echo "
      $pTypeArr[$oType] $iNum
      Name
      System ID
      Password
      Service number
      GTT number
      Session timer
      Enquire link timer
      Inactivity timer
      Response timer
      DCS"; + echo ""; + echo "
      Time to live
      Service IP
      Local IP
      Session timer
      Enquire link timer
      Inactivity timer
      Response timer
      DCS"; + echo ""; + echo "
      Time to live
      "; +echo "
      "; +echo ""; +echo "  "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      "; +?> +Remarks:

      +Name: Name of the SMPP connection, can be any name, generally use the name of the connected device

      +System ID: Character string used to identify a SMPP connection. The System ID must be same as that of the connected device

      +Password: Password for setting up the SMPP connection. The password must be same as that of the connected device

      +Service number: SMSC number used for MO number display on MT MS, can be any number

      +GTT number: E.164 number of the connected device, only for UDP SMPP

      +Service IP: IP address of the connected device, only for TCP SMPP

      +Local IP: IP address of the connected device, only for TCP SMPP

      +Session timer: Specify the time lapse allowed between a network connection being established and a bind_transmitter or bind_receiver request being sent to the SMSC

      +Enquire link timer: Specify the time lapse allowed between operations after which an SMPP entity should interrogate whether it's peer still has an active session

      +Inactivity timer: Specify the maximum time lapse allowed between transactions, after which period of inactivity, an SMPP entity may assume that the session is no longer active

      +Response timer: Specify the time lapse allowed between an SMPP request and the corresponding SMPP response

      + + + \ No newline at end of file diff --git a/wxc2_omc/configuration/sub_inc/getParameter.php b/wxc2_omc/configuration/sub_inc/getParameter.php new file mode 100755 index 0000000..f085ffc --- /dev/null +++ b/wxc2_omc/configuration/sub_inc/getParameter.php @@ -0,0 +1,333 @@ +levelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + +/************************************************* +Function: // translate +Description: // Transfer the value to string + // e.g. AdminState=2 --> AdminState=Unlocked +Calls: // +Called By: // +Table Accessed: // +Table Updated: // +Input: // +Output: // +Return: // +Others: // +*************************************************/ +function translate($input,$data) +{ + $found=-1; + if ($data) + { + $items=split("[;=]",$data); + $no_of_items=count($items); + + for ($i=0;$i<$no_of_items;$i+=2) { + if ( $input == $items[$i+1] ) { + $found=$i; + break; + } + } + if ($found != -1) + return($items[$found]); + else + return('Undefined Value ('.$input.')'); + } + return($input); +} + +/************************************************* +Function: // getInnerValue +Description: // 当用户点击参数时,生成输入框或下拉菜单,供用户输入 +Calls: // +Called By: // +Table Accessed: // +Table Updated: // +Input: // +Output: // +Return: // +Others: // +*************************************************/ + +function getInnerValue($sysId,$oidStr,$instanceNo=0,$otherWhereStr='',$showStr,$inputValueType) +{ + global $language,$Debug,$inputID; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paraConfTable = $objDb.".paramConf"; + if($sysTypeNo[0]=='2')//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + if(strlen($showStr)>0){ + echo ""; + return ""; + } + + if($Debug) echo "
      $paramConfTable
      "; + + //选择语言版本 + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + if($Debug) echo "
      getValue = $getValue"; + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,operType,valueType,minValue,maxValue FROM $paraConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $setTemplate = $objRows[$objSetField]; + $operType = $objRows[operType]; + + $paraSql = " SELECT initValue FROM $paraTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $paraResult = mysqli_query($pubConn,$paraSql); + $paraRow = mysqli_fetch_array($paraResult); + $getValue = $paraRow[initValue]; + if($DEBUG) + echo "
      getValue=$getValue"; + + switch($operType){ + case 2://Text Box + //=============input type===================== + $inputValueType=$inputValueType+0; + + if($inputValueType==1){//===only can input the dec num==== + $chechFnc = "checkInput(this,10)"; + }else if($inputValueType==2){//===only can input the hex num==== + $chechFnc = "checkInput(this,16)"; + }else if($inputValueType==3){//====can input all character + $chechFnc = ""; + }else if($inputValueType==4){//=====can put only dec num but include blank + $chechFnc = "checkInput_patch(this)"; + } + + echo ""; + return $getValue; + break; + case 1://PULLDOWN_MENU + $menu_items=split("[;=]", $setTemplate); + $no_of_menu_items=count($menu_items); + $isSelected = 0; + echo ""; + return $selectedValue; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) +}//end getInnerValue + +function getParamValue(&$initEquRead,$sysId,$oidStr,$instanceNo=0,$otherWhereStr='',$inputValueType) +{ + global $language; + //$Debug=1; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paraConfTable = $objDb.".paramConf"; + if($sysTypeNo[0]=='2')//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,valueType,minValue,maxValue FROM $paraConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $setTemplate = $objRows[$objSetField]; + + $paraSql = " SELECT initValue,readValue FROM $paraTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $paraResult = mysqli_query($pubConn,$paraSql); + $paraRow = mysqli_fetch_array($paraResult); + $initGetValue = $paraRow[initValue]; + $readGetValue = $paraRow[readValue]; + + $initEquRead = false; + if($initGetValue == $readGetValue) + $initEquRead = true; + else + $initEquRead = false; + $returnValue=translate($initGetValue,$setTemplate); + + if($DEBUG) + echo "
      returnValue=$returnValue"; + return $returnValue; +}//end getParamValue + +function setParamValue($setValue,$sysId,$oidStr,$instanceNo=0,$otherWhereStr='',$inputValueType) +{ + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paraConfTable = $objDb.".paramConf"; + if($sysTypeNo[0]=='2')//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + + $objWhereStr = getLevelWhere($oidStr); + + //$setValue = strtoupper($setValue); + $updSql = "UPDATE $paraTable SET initValue = '$setValue' + WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo'"; + if($DEBUG) + echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); +}//end setParamValue + +//0: flag +echo $flag; +echo "###"; + +if($flag=='getVar')//用户点击的是参数 +{ + //1: idName + echo $newId; + echo "###"; + + //2:innerStr + $oldValue=getInnerValue($sysId,$oidStr,$instanceNo,$otherWhereStr,$showStr,$inputValueType); + if(strlen($doingOtherUlr)>0) + { + $doingOtherUlr .= "&oldValue=$oldValue"; + $doingOtherUlr=urlencode($doingOtherUlr); + } + echo "   SAVE "; +} + +if($flag=='saveVar')//用户点击的是右边的‘Save’ +{ + + //1: idName + echo $id; + echo "###"; + + //2: innerStr + setParamValue($setValue,$sysId,$oidStr,$instanceNo,$otherWhereStr,$inputValueType); + $newValue = getParamValue($initEquRead,$sysId,$oidStr,$instanceNo,$otherWhereStr,$inputValueType); + if(strlen($showStr)) + echo $showStr; + else{ + if(strlen($newValue)>0) + echo $newValue; + else + echo "--"; + } + echo "###"; + + //3: isEqual + if($initEquRead||strlen($showStr)) //initValue == readValue + echo "1"; + else + echo "0"; + echo "###"; + + //4: doingOtherUlr + if(strlen($doingOtherUlr)>0) + { + $doingOtherUlr .= "&newValue=$newValue"; + } + echo $doingOtherUlr; +} +?> + + diff --git a/wxc2_omc/configuration/sub_inc/operWebFunc.inc b/wxc2_omc/configuration/sub_inc/operWebFunc.inc new file mode 100755 index 0000000..5bc6b4f --- /dev/null +++ b/wxc2_omc/configuration/sub_inc/operWebFunc.inc @@ -0,0 +1,853 @@ +$showValue "; + }else if($operType==3){//Label + echo "$showValue"; + }else{ + echo "$showValue "; + echo ""; + } +} + + + +function showParameterAdv($sysId,$oidStr,$instanceNo) +{ + global $pubConn,$OMC_server; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + //echo "objdb=$sysId
      "; + $paraConfTable = $objDb.".paramConf"; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$objDb); + //echo mysqli_error($objDbConn ); + $paraConfTable = $objDb.".paramConf"; + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + //get the id of the object + $OBJ_ID_SHOW="ADVID_SHOW_".$oidStr.".".$instanceNo; + $OBJ_ID_MODIFY="ADVID_MODIFY_".$oidStr.".".$instanceNo; + $OBJ_ID_CONTR="ADVID_CONTR_".$oidStr.".".$instanceNo; + $OBJ_ID_SAVE="ADVID_SAVE_".$oidStr.".".$instanceNo; + //get the value of the parameter + $tmp=explode("_",$sysId); + $database="OBJ_".$tmp[0]; + $oidwhere=getLevelWhere($oidStr); + $selSql = "select initValue,readValue from $paraTable where ".$oidwhere." and instanceNo='".$instanceNo."' "; + + //ISSUE-3 + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + { + $selSql.="and subSysNo='$subSysNo' "; + } + + //echo "
      [showParameterAdv]$selSql"; + $selRes = @mysqli_query($objDbConn,$selSql); + $test=mysqli_num_rows($selRes); + //echo "test=$test
      "; + if(mysqli_num_rows($selRes)==0){//此参数在$paramTable里不存在,插入一个值为空的纪录 + $initValue = ''; + $readValue = ''; + $insertSql="INSERT INTO $paraTable SET initValue='',readValue='',instanceNo='$instanceNo'"; + //ISSUE-3 + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + { + $insertSql.=",subSysNo='$subSysNo'"; + } + + $oidStrArr=explode('.',$oidStr); + for($i=0;$i[showParameterAdv]insertSql=$insertSql"; + mysqli_query($objDbConn,$insertSql); + }else{ + $selRow = @mysqli_fetch_array($selRes); + $initValue=$selRow['initValue']; + $readValue=$selRow['readValue']; + } + + //get the operType,valueType,minValue,maxValue + $selSql="select * from $paraConfTable where ".$oidwhere; + //echo "selSql=$selSql
      "; + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + $operType=$selRow['operType']; + if(strstr($selRow['desc_2'],"PASSWORD:Invisible")) + $operType = SHOW_INVISIBLE; + else if(strstr($selRow[desc_2],"PASSWORD:Visible")) + $operType = SHOW_VISIBLE; + $valueType=$selRow['valueType']; + $minValue=$selRow['minValue']; + $maxValue=$selRow['maxValue']; + $maxAccess=$selRow['maxAccess']+0; + $setTemplate=$selRow['setTemplate_1']; + $note=$selRow['note_1']; + $name=$selRow['name_1']; + $isReadOnly=0; + $value=translateValueToOpt($operType,$valueType,$setTemplate,$initValue); + + //echo "
      initValue=$initValue"; + + //echo "$setTemplate"; + //echo "initValue=$value,readValue={$selRow[readValue]}"; + if (strstr($initValue,"'") || strstr($initValue,'"')) + $initValue="--"; + if (strstr($initValue,"'") || strstr($initValue,'"')) + $readValue="--"; + if(trim($initValue) == "") + { + $initValue="--"; + } + if($initValue == $readValue) + { + $showcolor="blue"; + } + else + { + $showcolor="#008000"; + } + + if($maxAccess == 18 || strstr($name,"Index") || strstr($name,"AdministrationState") || !checkWritePrivilege()) + { + $showcolor="black"; + $pointer=""; + $isReadOnly=1; + } + else + { + $pointer=";cursor:pointer"; + } + + if($valueType == VALUE_INT && $maxAccess != 48) + { + //echo "initValue=$initValue"; + $tmpp=explode(";",$setTemplate); + $isfind=0; + if(trim($setTemplate) != "") + { + for($i=0;$i< count($tmpp);$i++) + { + $tmpv=explode("=",$tmpp[$i]); + if($initValue==($tmpv[1]+0)) + { + $initValue=$tmpv[0]; + $isfind=1; + break; + } + } + } + if($isfind==0) + { + $initValue=$initValue; + } + } + if($isReadOnly == 1) + { + echo ""; + echo "$initValue"; + echo ""; + } + else if($operType == SHOW_VISIBLE) + { + echo ""; + echo "$initValue"; + echo ""; + echo ""; + echo "******"; + echo ""; + } + else if($operType == SHOW_INVISIBLE) + { + /*echo ""; + echo "$initValue"; + echo "";*/ + echo ""; + echo "******"; + echo ""; + } + else + { + echo ""; + + if ($value) + echo "$value"; + else + echo "$initValue"; + echo ""; + } + + echo ""; + echo ""; + echo " "; + echo ""; +} + +function getParaValue(&$valueType,&$operType,&$initEquRead,$sysId,$oidStr,$instanceNo=0,$otherWhereStr='') +{ + global $language,$userName,$objDbConn; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paraConfTable = $objDb.".paramConf"; + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + $objWhereStr = getLevelWhere($oidStr); + //echo "
      objWhereStr=$objWhereStr"; + $objSql = "SELECT $objNameField,$objSetField,operType,valueType,minValue,`maxValue` FROM $paraConfTable WHERE $objWhereStr"; + if(0) + echo "
      objSql=$objSql"; + $objResult = mysqli_query($objDbConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $setTemplate = $objRows[$objSetField]; + $operType = $objRows[operType]; + $valueType = $objRows[valueType]; + + $paraSql = " SELECT initValue,readValue FROM $paraTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + if($DEBUG) + echo "
      [getParaValue]paraSql=$paraSql"; + + $paraResult = mysqli_query($objDbConn,$paraSql); + if(mysqli_num_rows($paraResult)==0){//此参数在$paramTable里不存在,插入一个值为空的纪录 + $initGetValue = ''; + $readGetValue = ''; + $insertSql="INSERT INTO $paraTable SET initValue='',readValue='',instanceNo='$instanceNo'"; + $oidStrArr=explode('.',$oidStr); + for($i=0;$i[getParaValue]insertSql=$insertSql"; + mysqli_query($objDbConn,$insertSql); + }else{ + $paraRow = mysqli_fetch_array($paraResult); + $initGetValue = $paraRow[initValue]; + $readGetValue = $paraRow[readValue]; + } + if($DEBUG) + { + echo "
      initGetValue=$initGetValue"; + echo "
      readGetValue=$readGetValue"; + } + $initEquRead = false; + if($initGetValue == $readGetValue) + $initEquRead = true; + else + $initEquRead = false; + if($valueType==9)//TYPE_OPAQUE,It's defined in SNMP module + $returnValue=$initGetValue; + else + $returnValue=translate($initGetValue,$setTemplate); + + if($DEBUG) + echo "
      returnValue=$returnValue"; + return $returnValue; +}//end getParamValue +?> + + diff --git a/wxc2_omc/configuration/sub_inc/operWebFunc.inc_bak b/wxc2_omc/configuration/sub_inc/operWebFunc.inc_bak new file mode 100755 index 0000000..0f53910 --- /dev/null +++ b/wxc2_omc/configuration/sub_inc/operWebFunc.inc_bak @@ -0,0 +1,850 @@ +$showValue "; + }else if($operType==3){//Label + echo "$showValue"; + }else{ + echo "$showValue "; + echo ""; + } +} + + + +function showParameterAdv($sysId,$oidStr,$instanceNo) +{ + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paraConfTable = $objDb.".paramConf"; + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + //get the id of the object + $OBJ_ID_SHOW="ADVID_SHOW_".$oidStr.".".$instanceNo; + $OBJ_ID_MODIFY="ADVID_MODIFY_".$oidStr.".".$instanceNo; + $OBJ_ID_CONTR="ADVID_CONTR_".$oidStr.".".$instanceNo; + $OBJ_ID_SAVE="ADVID_SAVE_".$oidStr.".".$instanceNo; + //get the value of the parameter + $tmp=explode("_",$sysId); + $database="OBJ_".$tmp[0]; + $oidwhere=getLevelWhere($oidStr); + $selSql = "select initValue,readValue from $paraTable where ".$oidwhere." and instanceNo='".$instanceNo."' "; + + //ISSUE-3 + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + { + $selSql.="and subSysNo='$subSysNo' "; + } + + //echo "$selSql"; + $selRes = @mysqli_query($pubConn,$selSql); + + if(mysqli_num_rows($selRes)==0){//此参数在$paramTable里不存在,插入一个值为空的纪录 + $initValue = ''; + $readValue = ''; + $insertSql="INSERT INTO $paraTable SET initValue='',readValue='',instanceNo='$instanceNo'"; + //ISSUE-3 + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + { + $selSql.=",subSysNo='$subSysNo'"; + } + + $oidStrArr=explode('.',$oidStr); + for($i=0;$i"; + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + $operType=$selRow[operType]; + if(strstr($selRow[desc_2],"PASSWORD:Invisible")) + $operType = SHOW_INVISIBLE; + else if(strstr($selRow[desc_2],"PASSWORD:Visible")) + $operType = SHOW_VISIBLE; + $valueType=$selRow[valueType]; + $minValue=$selRow[minValue]; + $maxValue=$selRow[maxValue]; + $maxAccess=$selRow[maxAccess]+0; + $setTemplate=$selRow[setTemplate_1]; + $note=$selRow[note_1]; + $name=$selRow[name_1]; + $isReadOnly=0; + //echo "initValue=$initValue"; + + //echo "$setTemplate"; + //echo "initValue=$value,readValue={$selRow[readValue]}"; + if(trim($initValue) == "") + { + $initValue="--"; + } + if($initValue == $readValue) + { + $showcolor="blue"; + } + else + { + $showcolor="#008000"; + } + + if($maxAccess == ACCESS_READ_ONLY || strstr($name,"Index") || strstr($name,"AdministrationState") || !checkWritePrivilege()) + { + $showcolor="black"; + $pointer=""; + $isReadOnly=1; + } + else + { + $pointer=";cursor:pointer"; + } + + if($valueType == VALUE_INT && $maxAccess != 48) + { + //echo "initValue=$initValue"; + $tmpp=explode(";",$setTemplate); + $isfind=0; + if(trim($setTemplate) != "") + { + for($i=0;$i< count($tmpp);$i++) + { + $tmpv=explode("=",$tmpp[$i]); + if($initValue==($tmpv[1]+0)) + { + $initValue=$tmpv[0]; + $isfind=1; + break; + } + } + } + if($isfind==0) + { + $initValue=$initValue; + } + } + + if($isReadOnly == 1) + echo ""; + else + echo ""; + if($operType == SHOW_VISIBLE || $operType == SHOW_INVISIBLE) + echo "******"; + else + echo "$initValue"; + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; +} + +function getParaValue(&$valueType,&$operType,&$initEquRead,$sysId,$oidStr,$instanceNo=0,$otherWhereStr='') +{ + global $language; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paraConfTable = $objDb.".paramConf"; + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,operType,valueType,minValue,maxValue FROM $paraConfTable WHERE $objWhereStr"; + if($DEBUG) + echo "
      objSql=$objSql"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $setTemplate = $objRows[$objSetField]; + $operType = $objRows[operType]; + $valueType = $objRows[valueType]; + + $paraSql = " SELECT initValue,readValue FROM $paraTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + if($DEBUG) + echo "
      paraSql=$paraSql"; + + $paraResult = mysqli_query($pubConn,$paraSql); + if(mysqli_num_rows($paraResult)==0){//此参数在$paramTable里不存在,插入一个值为空的纪录 + $initGetValue = ''; + $readGetValue = ''; + $insertSql="INSERT INTO $paraTable SET initValue='',readValue='',instanceNo='$instanceNo'"; + $oidStrArr=explode('.',$oidStr); + for($i=0;$iinitGetValue=$initGetValue"; + echo "
      readGetValue=$readGetValue"; + } + + $initEquRead = false; + if($initGetValue == $readGetValue) + $initEquRead = true; + else + $initEquRead = false; + if($valueType==9)//TYPE_OPAQUE,It's defined in SNMP module + $returnValue=$initGetValue; + //else if($operType == SHOW_VISIBLE) + // $returnValue="******"; + else + $returnValue=translate($initGetValue,$setTemplate); + + if($DEBUG) + echo "
      returnValue=$returnValue"; + return $returnValue; +}//end getParamValue +?> + + diff --git a/wxc2_omc/configuration/sub_inc/saveParameter.php b/wxc2_omc/configuration/sub_inc/saveParameter.php new file mode 100755 index 0000000..af51b68 --- /dev/null +++ b/wxc2_omc/configuration/sub_inc/saveParameter.php @@ -0,0 +1,213 @@ +levelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + +function getNameByOID($sysTypeNo,$oidwhere) +{ + global $objDbConn; + $tb="OBJ_".$sysTypeNo.".paramConf"; + $sqlstr="select name_2 from $tb where $oidwhere"; + $res = @mysqli_query( $objDbConn,$sqlstr); + $row = @mysqli_fetch_array($res); + return $row[name_2]; +} + +function adjustShowName($name) +{ + $len=strlen($name); + $result=""; + + if($name[0]>='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} + +function getOptVal($sysTypeNo,$oidwhere,$value) +{ + global $objDbConn; + $tb="OBJ_".$sysTypeNo.".paramConf"; + $sqlstr="select * from $tb where $oidwhere"; + $res = @mysqli_query($objDbConn,$sqlstr); + $row = @mysqli_fetch_array($res); + + if($row[operType] == 1 && $row[valueType] == 3 && strstr($row[setTemplate_2],"=")) + { + $template=$row[setTemplate_2]; + if(trim($template) == "") + return $value; + $options=explode(";",$template); + for($ii=0;$ii>./temptemp.txt"); + //system("date >>./temptemp.txt"); + //system("echo sysId=$sysId oidStr=$oidStr instanceNo=$instanceNo newValue=($newValue) >>./temptemp.txt"); + + + + + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + $subSysNo=$sysIdArr[2]; + + $database='OBJ_'.$sysTypeNo; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $database); + + $paraConfTable=$database.'.paramConf'; + + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$database.".param_".$sysNo; + else + $paraTable=$database.".param_99"; + + + + $oidwhere=getLevelWhere($oidStr); + $updSql = "UPDATE $paraTable SET initValue='$newValue' where $oidwhere and instanceNo='$instanceNo' "; + + //ISSUE-3 + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + { + $updSql.="and subSysNo='$subSysNo' "; + } + + mysqli_query($objDbConn,$updSql); + //system("echo $updSql >>/tmp/temptemp.txt"); + //compare the initValue and readValue + + $selSql = "select initValue,readValue from $paraTable where $oidwhere and instanceNo='$instanceNo' "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + { + $selSql.="and subSysNo='$subSysNo' "; + } + + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + $initValue=$selRow[0]; + $readValue=$selRow[1]; + //echo "$initValue $readValue"; + + if(strcmp($initValue,$readValue) == 0) + { + echo "same"; + $isSaveFlag=0; + } + else + { + echo "different"; + $isSaveFlag=1; + } + + + //insert log + $preoidwhere=$oidwhere; + $tmpstr=getNameByOID($sysTypeNo,$oidwhere); + $tmplen=strlen($tmpstr); + for($i=0;$i<$tmplen;$i++) + { + if($tmpstr[$i] >= 'A' && $tmpstr[$i] <= 'Z') + break; + } + $fieldName=substr($tmpstr,$i); + + + $oidwhere=getLevelWhere(substr($oidStr,0,strlen($oidStr)-2)); + $tableName=getNameByOID($sysTypeNo,$oidwhere); + $tableName=str_replace("Entry","",$tableName); + $sysName=getSystemNameBySysTypeNo($sysTypeNo); + if($isSaveFlag) + { + $tableName=trim(adjustShowName($tableName)); + $readValue=getOptVal($sysTypeNo,$preoidwhere,$readValue); + $initValue=getOptVal($sysTypeNo,$preoidwhere,$initValue); + $log="Change $sysName: $tableName $instanceNo's $fieldName, $readValue -> $initValue"; + //$handle=fopen("/tmp/test.txt","a"); + //fwrite($handle,$oidStr); + //fwrite($handle,"\n"); + //fclose($handle); + insertLog($log); + } + + +?> diff --git a/wxc2_omc/configuration/sub_inc/sub_chinese_gb.inc b/wxc2_omc/configuration/sub_inc/sub_chinese_gb.inc new file mode 100755 index 0000000..246839a --- /dev/null +++ b/wxc2_omc/configuration/sub_inc/sub_chinese_gb.inc @@ -0,0 +1,136 @@ +SLC对应表"; +$strE1ConnectionOUT ="连出的E1"; +$strEditBarPara ="编辑栏参数"; +$strEditBuffer ="参数编辑区"; +$strEditRoute ="编辑路由"; +$strExecutionComplete ="执行完毕"; +$strExecutionTime ="执行时间"; +$strFaultYouNotChosen ="错误,您没有选择任何参数类型"; +$strGroupID ="组编号"; +$strHaltOrder ="中断命令"; +$strIPDPCTable ="IP->DPC对应表"; +$strIsUnderEditOfAnotherUser ="另一用户正在编辑"; +$strLengthOfTheInputValueIsError ="填入数值的长度错误"; +$strLocalEquipmentConnectionOUT ="本地连出设备"; +$strLocalTS ="中央TS"; +$strNetworkManagementAddressing ="远端CSU与OMC间的链路(主+次)"; +$strNoProcess ="无处理"; +$strNoLanguageVersionTemplateAvailable ="没有此语言版本的编辑模板"; +$strOMCSingalingPointCode ="OMC对端信令点编号"; +$strOperationComplete ="操作完毕"; +$strOperationFail ="操作失败"; +$strOperationObject ="操作对象"; +$strOperationOrderTable ="操作命令列表"; +$strOperationTimeout ="操作超时"; +$strOperationPause ="操作中断"; +$strOperationSucceed ="操作成功"; +$strOriginatingPointCode ="本机信令点编号"; +$strOriginatingSystemNumber ="本机系统编号"; +$strParameter ="参数"; +$strParameterdDescription ="参数说明"; +$strParameterOf ="的参数"; +$strParameters ="参数"; +$strParameterSetNote ="注意:只能输入十进制数"; +$strParametersOperations ="参数操作"; +$strParametersOperationsRemarks_1 ="1、选择参数类型进行操作,每个参数类型包含若干参数。(默认为全选)"; +$strParametersOperationsRemarks_2 ="2、第一行可以将编辑缓冲区的参数下载到交换机,或保存到数据库。"; +$strParametersOperationsRemarks_3 ="3、第二行可以从交换机中读参数到读出缓冲区,或将已读出的参数拷贝至编辑缓冲区。"; +$strParameterType ="参数类型"; +$strParaMustBeADecNumber ="参数必须为十进制数"; +$strParaMustBeAHexNumber ="参数必须为十六进制数"; +$strPleaseCorrectIt ="请改正它"; +$strPrepareToExecute ="准备执行"; +$strPrimaryRoute ="主路由"; +$strReadBuffer ="参数读出区"; +$strRemoteEquipmentConnectionIN ="远端连入设备"; +$strRemoteTS ="远端TS"; +$strRouteID ="路由编号"; +$strRouteType ="路由类型"; +$strSaveToDatabase ="保存到数据库"; +$strSecondRoute ="次路由"; +$strSegmentNumber ="分段编号"; +$strSegmentOfDeviceIP ="外设IP所属段号"; +$strSetTheNumberDisplayed ="请将每页显示的个数设成定义长度的倍数"; +$strShowBTSSiteInfo ="显示BTS Site的编号信息"; +$strShowNetRouteParameter ="显示网管路由参数"; +$strShowStartIP ="显示起始IP地址"; +$strSignalingLinkCode ="信令链路编号"; +$strStartIpAddress ="起始IP地址"; +$strSubsystemParameters ="子系统参数"; +$strSwitchConnectionSetup ="交换机连接设置"; +$strSwitchParaInitialization ="初始化交换机参数"; +$strSwitchStatusInitialization ="初始化交换机状态"; +$strSynchronousSwitchPara ="同步交换机参数"; +$strSystemID ="系统编号"; +$strSystemPara ="系统参数"; +$strSystemParameters ="系统参数"; +$strSystemParaOf ="的系统参数"; +$strThereIsNoCommandBeingExecuted ="没有正在执行的命令"; +$strTheRouteAsNetworkManage ="该路由作为网管"; +$strTheValueCannotBeEmpty ="此值不能为空"; +$strThisIPBeUsedByOtherDevice ="此IP已被别的设备占用"; +$strUndefinedOrderInvalidOrder ="未定义命令,无效命令"; +$strUnderEditStatus ="在编辑状态下"; +$strUnitLength ="单位长度"; +$strUploadFromSwitch ="从交换机上载"; +$strUsefulSpecification ="使用说明"; +$strValueRange ="取值范围"; +$strXCoordinate ="X坐标"; +$strYCoordinate ="Y坐标"; +$strIfDisplayName ="是否显示名称"; +$strStateInfoClasses ="状态信息种类"; +$strStateDisplayDirection ="状态显示方向"; +$strEditSystem ="修改设备"; +$strNumericFormatCalculator ="数值转换器"; +$strAddSystem ="添加设备"; +$strAddTSGroup ="添加TS组"; +$strSystenList ="系统列表"; +$strPPSParamImport ="PPS语音参数导入"; + +//added by xiehua, 2003-05-13 +$strNeighborCell ="相邻小区"; +$strBtsName ="BTS名"; +$strHandoverControl ="切换控制"; +$strClockReference ="时钟参考"; +$strNeighborType ="相邻小区类型"; + +//added by lilong, 2003-5-27 +$strMobileCountryCode ="移动国家代码"; +$strMobileNetworkCode ="移动网络代码"; +$strCountryCode ="国家代码"; +$strNationalDestinationCode ="本国目的代码"; +$strInternationalPrefix ="国际字头"; +$strNationalPrefix ="本国字头"; +$strInternationalNetwork ="国际网"; +$strInternationalNetworkSpare ="国际备用网"; +$strNationalNetwork ="国内网"; +$strNationalNetworkSpare ="国内备用网"; +$strMSISDN ="MSISDN"; +$strIMSI ="IMSI"; +$strE214GT ="E214GT"; +$RouteByGT ="Route by GT"; +$RouteByDPCAndSSN ="Route by DPC and SSN"; +$strRestore ="Restore"; + +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/sub_inc/sub_config.inc b/wxc2_omc/configuration/sub_inc/sub_config.inc new file mode 100755 index 0000000..896fe37 --- /dev/null +++ b/wxc2_omc/configuration/sub_inc/sub_config.inc @@ -0,0 +1,971 @@ +='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} + +//锟矫伙拷选锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� + +if($language == 'eng'){ + require("../sub_inc/sub_english.inc"); +}else{ + require("../sub_inc/sub_chinese_gb.inc"); +} + +$buttonStyle = "cursor:pointer; left: 1; top: 2; height: 22; position: relative"; +$nGetComm = 0; +$nSetComm = 3; +$nGetBulkComm = 5; +$nNewEntryComm = 9; + +$nProcFail = 0; +$nWaitProc = 1; +$nInProc = 2; +$nOutProc = 3; + +/************************************************* +Function: // getLevelWhere +Description: // +Calls: // +Called By: // +Table Accessed: // +Table Updated: // +Input: // oid +Output: //level where +Return: // +Others: // +*************************************************/ +function getLevelWhere($objIdStr) +{ + //echo $objIdStr; + $levelArr=explode('.',$objIdStr); + // print_r($levelArr); + //$test=sizeof($levelArr); + //echo "test=$test"; + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + // echo $levelWhere; + + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + //echo $levelWhere; + return($levelWhere); +} + + +/************************************************* +Function: // ip2byte +Description: // Transfer ip format to 4bytes HEX string +Calls: // +Called By: // +Table Accessed: // +Table Updated: // +Input: // +Output: // +Return: // +Others: // +*************************************************/ + +function ip2byte($ipStr){ + $DEBUG=0; + $byteDec = explode('.',$ipStr); + for($i=0;$i255) + echo "
      input ip error"; + else + $tmpStr=dechex($byteDec[$i]); + } + $byteStr=$byteStr.$tmpStr; + } + + if($DEBUG) echo "
      byteStr=$byteStr"; + return ($byteStr); +} + +/************************************************* +Function: // translate +Description: // Transfer the value to string + // e.g. AdminState=2 --> AdminState=Unlocked +Calls: // +Called By: // +Table Accessed: // +Table Updated: // +Input: // +Output: // +Return: // +Others: // +*************************************************/ +function translate($input,$data) +{ + $found=-1; + if ($data) + { + $items=split("[;=]",$data); + $no_of_items=count($items); + + for ($i=0;$i<$no_of_items;$i+=2) { + if ( $input == $items[$i+1] ) { + $found=$i; + break; + } + } + if ($found != -1) + return($items[$found]); + else + //return('Undefined Value ('.$input.')'); + return('--'); + } + return($input); +} + +/************************************************* +Function: // reCombName +Description: // Transfer the coding string to normal string + // e.g. trunkGroup -> Trunk Group;MSRNRange->MSRN Range +Calls: // +Called By: // +Table Accessed: // +Table Updated: // +Input: // +Output: // +Return: // +Others: // +*************************************************/ +function reCombName($name){ + $displayFlag=0; + //$displayName=""; + for($i=0;$i='A'&&$name[$i]<='Z'){ + $displayFlag=1; + } + if($displayFlag==1){ + if($name[$i]>='A'&&$name[$i]<='Z'){ + if($i>1){ + if($name[$i-1]>='a'&&$name[$i-1]<='z'){ + if(isset($displayName)) + $displayName=$displayName.' '.$name[$i]; + else + $displayName=$displayName.$name[$i]; + }else{ + if($name[$i+1]>='a'&&$name[$i+1]<='z') + $displayName=$displayName.' '.$name[$i]; + else + $displayName=$displayName.$name[$i]; + } + }else{ + $displayName=$displayName.$name[$i]; + } + }else{ + $displayName=$displayName.$name[$i]; + } + } + } + return $displayName; +} + +/************************************************* +Function: // oidSysCommSend +Description: // 系统锟斤拷锟斤拷维锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 +Calls: // +Called By: // +Table Accessed: // +Table Updated: // +Input: // +Output: // +Return: //锟缴癸拷: 锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷 + //失锟斤拷: -1 +Others: // +*************************************************/ +function oidSysCommSend($sysId,$commType,$objIdStr,$selectedSysId=-1,$instanceNo='') +{ + //echo "AAA"; + //global $pubDb,$commTable; + global $STR_CONF_COMMAND_ERR_0000; + global $STR_CONF_PROMPT_01,$STR_CONF_COMMAND_ERR_0101,$STR_CONF_COMMAND_ERR_0102; + global $STR_CONF_PROMPT_02,$STR_CONF_COMMAND_ERR_0201,$STR_CONF_COMMAND_ERR_0202; + global $STR_CONF_PROMPT_03,$STR_CONF_COMMAND_ERR_0301,$STR_CONF_COMMAND_ERR_0302,$STR_CONF_COMMAND_ERR_0303; + global $STR_CONF_PROMPT_04,$STR_CONF_COMMAND_ERR_0401,$STR_CONF_COMMAND_ERR_0402,$STR_CONF_COMMAND_ERR_0403; + global $STR_CONF_COMMAND_ERR_9999; + global $pubConn; + global $strBack; + //fj + $DEBUG = 0; + //echo "oidSysCommSend($sysId,$commType,$objIdStr,$selectedSysId=-1,$instanceNo='')"; + $info="oidSysCommSend($sysId, $commType, $objIdStr, $selectedSysId, $instanceNo);"; + system("echo '$info' >> /tmp/sysCommand.txt"); + + + //===get the sysTypeNo===== + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + + //========================start insert log=============== + //===get the operate type set or get== + //opt_type: 0-get object, 1-set, 2-create, 3-delete, 4-get table + $tmpWhere=getLevelWhere($objIdStr); + $fieldName=getNameByOID($sysTypeNo,$tmpWhere); + $showname=trim(adjustShowName($fieldName)); + //echo "showname=$showname
      "; + $sysName=getSystemNameBySysTypeNo($sysTypeNo); + if($commType == 0) + { + $opt_type=0; + } + else if($commType == 5) + { + $opt_type=4; + } + if($commType == 3) + { + if(strstr($fieldName,"RowStatus")) + $opt_type=3; + else + $opt_type=1; + } + else if($commType == 9) + { + $opt_type=2; + } + switch($opt_type) + { + //get object + case 0: + $logstr="Get $sysName: $showname ".trim($instanceNo); + break; + //set object + case 1: + $logstr="Set $sysName: $showname ".trim($instanceNo); + //echo "Set $sysName: $showname ".trim($instanceNo); + break; + //create + case 2: + $oidwhere=getLevelWhere(substr($objIdStr,0,strlen($objIdStr)-2)); + $tableName=getNameByOID($sysTypeNo,$oidwhere); + $tableName=str_replace("Entry","",$tableName); + $showname=trim(adjustShowName($tableName)); + $logstr="Create $sysName: $showname ".trim($instanceNo); + break; + //delete + case 3: + $oidwhere=getLevelWhere(substr($objIdStr,0,strlen($objIdStr)-2)); + $tableName=getNameByOID($sysTypeNo,$oidwhere); + $tableName=str_replace("Entry","",$tableName); + $showname=trim(adjustShowName($tableName)); + $logstr="Delete $sysName: $showname ".trim($instanceNo); + break; + case 4: + $logstr="Get $sysName: $showname"; + break; + } + + insertLog($logstr); + + //$handle=fopen("/tmp/test.txt","a"); + //fwrite($handle,$logstr); + //fwrite($handle,"\n"); + //fclose($handle); + //========================end insert log=============== + + $pubDb = 'OMC_PUB'; + $commTable = 'parameterComm'; + $nGetComm = 0; + $nSetComm = 3; + $nGetBulkComm = 5; + $nNewEntryComm = 9; + $nSubSysParam = 0; + $nGlobalSubSysParam = 1; + $nGlobalSysParam = 2; + + if(checkIndependSystem($sysTypeNo))//Plat + $paramType = $nGlobalSubSysParam; + else + $paramType = $nGlobalSysParam; + + if($selectedSysId != -1){ + $selectedSysIdArr = explode('_',$selectedSysId); + $selectedSysTypeNo = $selectedSysIdArr[0]; + $selectedSysNo = $selectedSysIdArr[1]; + $selectedSubSysNo = $selectedSysIdArr[2]; + } + if($DEBUG) echo"
      selectedSysId=$selectedSysId"; + if($DEBUG) echo"
      selectedSysNo=$selectedSysNo"; + if($DEBUG) echo"
      selectedSubSysNo=$selectedSubSysNo"; + + //step 1: delete overtime and imcompetent command , check the exist command num + $overTime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-1,date("s"),date("m"),date("d"),date("Y"))); + $delSql = "DELETE FROM $commTable WHERE (commState ='0' OR commState ='3') AND sendTime < '$overTime' + "; + if($DEBUG) echo"
      delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $overTime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-30,date("s"),date("m"),date("d"),date("Y"))); + $delSql = "DELETE FROM $commTable WHERE sendTime < '$overTime' + "; + if($DEBUG) echo"
      delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + //check the exist command num + $chkSql = "SELECT commId FROM $commTable"; + if($DEBUG) echo"
      check exist commands sql = $chkSql"; + $chkResult = mysqli_query($pubConn,$chkSql); + echo mysqli_error($pubConn); + $existNum = @mysqli_num_rows($chkResult); + + //step 2:insert commands into command table + if($commType == $nSetComm||$commType == $nNewEntryComm)//写锟斤拷锟斤拷 + { + if($selectedSysId == -1) + { + if($sysNo=='99') + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + else if($subSysNo=='99') + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + }else + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo='$sysNo' AND subSysNo='$subSysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + } + else//选锟斤拷指锟斤拷锟斤拷系统 + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$selectedSysTypeNo' + AND sysNo ='$selectedSysNo' + AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC + "; + } + // fj + if($DEBUG) + { + echo"
      selSql=$selSql"; + //exit(); + } + $selResult = mysqli_query($pubConn,$selSql); + $selRowsNum = mysqli_num_rows($selResult); + + // fj + if(0) + { + echo "selRowsNum:$selRowsNum existNum:$existNum
      "; + } + if($selRowsNum+$existNum>256) + { + echo "

      Error:$STR_CONF_COMMAND_ERR_0302
      "; + echo "Prompt:$STR_CONF_PROMPT_03
      "; + echo "

      Back"; + exit(); + } + + if($selRowsNum > 0) + { + while($selRows = mysqli_fetch_array($selResult)) + { + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','$instanceNo','1',CURRENT_TIMESTAMP) + "; + // fj + if($DEBUG)echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + + $tmpSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' + AND sysNo='$sysNo' + AND subSysNo='$subSysNo' + AND objId='$objIdStr' + AND instanceNo='$instanceNo'" + ; + $tmpResult=mysqli_query($pubConn,$tmpSql); + echo mysqli_error($pubConn); + $tmpRows = mysqli_fetch_array($tmpResult); + $commIdStr .= $tmpRows[commId].'-'; + } + } + else + { + echo "

      Error:$STR_CONF_COMMAND_ERR_0101
      "; + echo "Prompt:$STR_CONF_PROMPT_01
      "; + echo "

      Back"; + exit(); + } + + } + else//锟斤拷系统 + { + if($paramType != $nSubSysParam)//锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷 + { + if($selectedSysId == -1) + { + //get baseStat 0=uninstalled, 1=nomal, 2=warning, 3=error + //锟饺帮拷状态锟斤拷锟斤拷锟劫帮拷系统锟斤拷锟�,锟斤拷系统锟斤拷锟斤拷锟斤拷锟酵拷锟阶刺拷锟斤拷锟窖★拷锟斤拷锟叫★拷锟� + if($sysNo == '99') + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + else if($subSysNo == '99') + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$sysNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + else + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo='$sysNo' AND subSysNo='$subSysNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + } + else + { + //选锟斤拷指锟斤拷锟斤拷系统 + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$selectedSysNo' AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC,updateTime DESC + "; + } + + $selResult=mysqli_query($pubConn,$selSql); + if($DEBUG) + { + echo"
      get system info sql = $selSql"; + + } + echo mysqli_error($pubConn); + if(@mysqli_num_rows($selResult) > 0) + { + $selRows = @mysqli_fetch_array($selResult); + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + } + else + { + echo "

      Error:$STR_CONF_COMMAND_ERR_0101
      "; + echo "Prompt:$STR_CONF_PROMPT_01
      "; + echo "

      Back"; + exit(); + } + } + + if(1+$existNum>256) + { + echo "

      Error:$STR_CONF_COMMAND_ERR_0302
      "; + echo "Prompt:$STR_CONF_PROMPT_03
      "; + echo "

      Back"; + exit(); + } + + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,instanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','$instanceNo','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) + echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + + $tmpSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' + AND sysNo='$sysNo' + AND subSysNo='$subSysNo' + AND objId='$objIdStr' + AND instanceNo='$instanceNo'" + ; + $tmpResult=mysqli_query($pubConn,$tmpSql); + echo mysqli_error($pubConn); + $tmpRows = mysqli_fetch_array($tmpResult); + $commIdStr .= $tmpRows[commId].'-'; + } + + //step 3:Return commIdStr + // fj + if(0) + { + $array =debug_backtrace(); + print_r($array);//锟斤拷锟斤拷锟� + } + if($DEBUG) echo "
      commIdStr = $commIdStr"; + if($DEBUG) exit(); + return($commIdStr); +}//end of function oidSysSendComm() + + +/************************************************* +Function: // getParam +Description: // 锟矫猴拷锟斤拷锟斤拷锟节凤拷锟斤拷get锟斤拷get Bulk锟斤拷锟斤拷 +Calls: // oidSysCommSend,CheckState +Called By: // +Table Accessed: // +Table Updated: // +Input: // $commInfoArr锟斤拷锟斤拷锟斤拷要锟斤拷锟酵碉拷sysId,oid,selectSysId,instanceNo +Output: // +Return: // +Others: // +*************************************************/ +$getParam_showFinishResultFlag=1; + +function getParam($commInfoArr,$sleep=0){ + global $objDbConn,$pubDb,$nGetComm,$nGetBulkComm,$nGetBulkComm,$DEBUG; + #fj + $DEBUG=0; + if(strlen(trim($pubDb)) == 0) + $pubDb="OMC_PUB"; + + + for($i =0;$i< sizeof($commInfoArr);$i++){ + $sysIdArr = explode('_',$commInfoArr[$i][sysId]); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $tmpWhere=getLevelWhere($commInfoArr[$i][oid]); + $selSql="SELECT * FROM OBJ_$sysTypeNo.paramConf WHERE $tmpWhere"; + if($DEBUG) + echo "
      selSql=$selSql"; + $selResult=mysqli_query($objDbConn,$selSql); + echo mysqli_error($objDbConn); + $selRows=mysqli_fetch_array($selResult); + if(strstr($selRows[desc_2],"Table Parameter")){ + $tmpWhere=getLevelWhere($commInfoArr[$i][oid]); + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable="OBJ_".$sysTypeNo.".param_".$sysNo; + else + $paraTable="OBJ_".$sysTypeNo.".param_99"; + $delSql="DELETE FROM $paraTable WHERE $tmpWhere AND instanceNo LIKE '{$commInfoArr[$i][instanceNo]}%'"; + //ISSUE-3 + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + { + $delSql.=" AND subSysNo='$subSysNo' "; + } + if($DEBUG) + echo "
      delSql=$delSql"; + mysqli_query($objDbConn,$delSql); + if($DEBUG) + echo "
      table oidSysCommSend({$commInfoArr[$i][sysId]},$nGetBulkComm,{$commInfoArr[$i][oid]},{$commInfoArr[$i][selectSysId]},{$commInfoArr[$i][instanceNo]})
      "; + $tmpCommIdStr = oidSysCommSend($commInfoArr[$i][sysId],$nGetBulkComm,$commInfoArr[$i][oid],'-1',$commInfoArr[$i][instanceNo]); + }else{ + if($DEBUG) + echo "
      oidSysCommSend({$commInfoArr[$i][sysId]},$nGetComm,{$commInfoArr[$i][oid]},{$commInfoArr[$j][selectSysId]},{$commInfoArr[$j][instanceNo]});"; + $tmpCommIdStr = oidSysCommSend($commInfoArr[$i][sysId],$nGetComm,$commInfoArr[$i][oid],'-1',$commInfoArr[$i][instanceNo]); + } + $commIdStr=$commIdStr.$tmpCommIdStr; + + + + + +flush(); +echo ""; +ob_flush(); +flush(); + +if($sleep) + usleep(200000); +flush(); + + + } + if($DEBUG) echo "$commIdStr
      "; + + checkState($commIdStr); + + for($i =0;$i< sizeof($commInfoArr);$i++){ + $sysIdArr = explode('_',$commInfoArr[$i][sysId]); + $sysTypeNo = $sysIdArr[0]; + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable="OBJ_".$sysTypeNo.".param_".$sysNo; + else + $paraTable="OBJ_".$sysTypeNo.".param_99"; + $tmpWhere=getLevelWhere($commInfoArr[$i][sysId]); + $selSql="UPDATE $paraTable SET initValue=readValue WHERE WHERE $tmpWhere"; + $selResult=mysqli_query($objDbConn,$selSql); + } +} + +/************************************************* +Function: // setParam +Description: // 锟矫猴拷锟斤拷锟斤拷锟节凤拷锟斤拷set锟斤拷锟斤拷 +Calls: // oidSysCommSend,CheckState +Called By: // +Table Accessed: // +Table Updated: // +Input: // $commInfoArr锟斤拷锟斤拷锟斤拷要锟斤拷锟酵碉拷sysId,oid,selectSysId,instanceNo +Output: // +Return: // +Others: // +*************************************************/ +function setParam($commInfoArr){ + global $nSetComm; + + for($i =0;$i< sizeof($commInfoArr);$i++){ + $sysIdArr = explode('_',$commInfoArr[$i][sysId]); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($DEBUG) echo "
      oidSysCommSend({$commInfoArr[$i][sysid]},$nSetComm,{$commInfoArr[$i][oid]},-1,{$commInfoArr[$i][instanceNo]})
      "; + $tmpCommIdStr = oidSysCommSend($commInfoArr[$i][sysId],$nSetComm,$commInfoArr[$i][oid],'-1',$commInfoArr[$i][instanceNo]); + $commIdStr=$commIdStr.$tmpCommIdStr; + } + if($DEBUG)echo "$commIdStr
      "; + checkState($commIdStr); +} + +/************************************************* +Function: // checkState +Description: // 锟矫猴拷锟斤拷锟斤拷锟节硷拷夥拷锟絞et/set锟斤拷锟斤拷锟絩esponse锟斤拷状态 +Calls: // outPutChkMsg +Called By: // +Table Accessed: // +Table Updated: // +Input: // $commIdStr +Output: // +Return: // +Others: // +*************************************************/ +function checkState($commIdStr,$backsrc=''){ + global $pubDb; + global $pubConn; + global $maxNum,$remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + global $getParam_showFinishResultFlag; + //fj + $DEBUG=0; + + if(strlen(trim($pubDb)) == 0) + $pubDb="OMC_PUB"; + $commIdStrArr=explode("-",$commIdStr); + for($i=0;$i 120){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $commTable WHERE $tmpWhere "; + + // fj + //echo "delComm:$delComm
      "; + + mysqli_query($pubConn,$delComm); + outPutChkMsg($tmpSysTypeNo,$tmpSysNo,'0303','Network is busy or managed object response is too slow',$backsrc,$descArr); + break; + } + +flush(); +echo ""; +ob_flush(); +flush(); +usleep(200000); + + + $selComm = "SELECT commState,remark,objId,sysTypeNo,sysNo,subSysNo FROM $commTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) + echo "
      selComm=$selComm,pubDb=$pubDb"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes) > 0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpSysTypeNo=$selRow[sysTypeNo]; + $tmpSysNo=$selRow[sysNo]; + $delComm = " DELETE FROM $commTable WHERE $tmpWhere "; + // fj + // echo "
      delComm:$delComm backsrc:$backsrc mpRemark:$tmpRemark
      "; + mysqli_query($pubConn,$delComm); + $tmpRemarkArr=explode(":",$tmpRemark); + $des=""; + for($ttt=1;$tttselComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $commTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + break; + } + if($getParam_showFinishResultFlag) + echo "
      Finished
      "; + for($index=0;$index<$descArr[Count];$index++) + { + if(strlen(trim($descArr[$index][SysTypeName])) > 0 && strlen(trim($descArr[$index][TableName])) > 0) + { + $log="{$descArr[$index][CommdType]} {$descArr[$index][SysTypeName]}: {$descArr[$index][TableName]} {$descArr[$index][InstanceNo]} successfully"; + insertLog($log); + } + } +} + +function getNameByOID_sub_config($sysTypeNo,$oidwhere) +{ + $tb="OBJ_".$sysTypeNo.".paramConf"; + $sqlstr="select name_2 from $tb where $oidwhere"; + $res = @mysqli_query($pubConn,$sqlstr); + $row = @mysqli_fetch_array($res); + return $row[name_2]; +} + +function adjustShowName_sub_config($name) +{ + $len=strlen($name); + $result=""; + + if($name[0]>='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} + +function getCommdDesc($commIdStr) +{ + $comm=explode("-",$commIdStr); + $len=count($comm); + $desc[Count]=$len; + for($index=0;$index<$len;$index++) + { + $sqlstr="select * from OMC_PUB.parameterComm where commId={$comm[$index]} "; + $res = @mysqli_query($pubConn,$sqlstr); + $row = @mysqli_fetch_array($res); + $desc[$index][SysTypeName]=getSystemNameBySysTypeNo($row[sysTypeNo]); + + $desc[$index][TableName]=getNameByOID_sub_config($row[sysTypeNo],getLevelWhere($row[objId])); + $desc[$index][TableName]=adjustShowName_sub_config(str_replace("Entry","",$desc[$index][TableName])); + $desc[$index][InstanceNo]=$row[instanceNo]; + if($row[commType] == 0) + $desc[$index][CommdType]="Get"; + else if($row[commType] == 3) + $desc[$index][CommdType]="Set"; + else if($row[commType] == 5) + $desc[$index][CommdType]="Get"; + else if($row[commType] == 9) + { + $oidwhere=getLevelWhere(substr($row[objId],0,strlen($row[objId])-2)); + $tableName=getNameByOID($row[sysTypeNo],$oidwhere); + $tableName=str_replace("Entry","",$tableName); + $desc[$index][TableName]=adjustShowName_sub_config($tableName); + $desc[$index][CommdType]="Create"; + } + } + return $desc; +} + +/************************************************* +Function: // outPutChkMsg +Description: // 锟矫猴拷锟斤拷锟斤拷锟斤拷锟斤拷示锟斤拷锟斤拷执锟叫碉拷锟斤拷锟斤拷锟� +Calls: // +Called By: // +Table Accessed: // +Table Updated: // +Input: // $sysTypeNo,$sysNo,$Reason='' +Output: // +Return: // +Others: // +*************************************************/ +function outPutChkMsg($sysTypeNo,$sysNo,$Reason='',$des='',$backsrc='',$descArr) +{ + global $STR_CONF_COMMAND_ERR_0000; + global $STR_CONF_PROMPT_01,$STR_CONF_COMMAND_ERR_0101,$STR_CONF_COMMAND_ERR_0102; + global $STR_CONF_PROMPT_02,$STR_CONF_COMMAND_ERR_0201,$STR_CONF_COMMAND_ERR_0202; + global $STR_CONF_PROMPT_03,$STR_CONF_COMMAND_ERR_0301,$STR_CONF_COMMAND_ERR_0302,$STR_CONF_COMMAND_ERR_0303; + global $STR_CONF_PROMPT_04,$STR_CONF_COMMAND_ERR_0401,$STR_CONF_COMMAND_ERR_0402,$STR_CONF_COMMAND_ERR_0403; + global $STR_CONF_PROMPT_05,$STR_CONF_COMMAND_ERR_0501,$STR_CONF_COMMAND_ERR_0502,$STR_CONF_COMMAND_ERR_0503; + global $STR_CONF_COMMAND_ERR_0504,$STR_CONF_COMMAND_ERR_0505,$STR_CONF_COMMAND_ERR_0506; + global $STR_CONF_COMMAND_ERR_0507,$STR_CONF_COMMAND_ERR_0508,$STR_CONF_COMMAND_ERR_0509; + global $STR_CONF_COMMAND_ERR_0510,$STR_CONF_COMMAND_ERR_0511,$STR_CONF_COMMAND_ERR_0512; + global $STR_CONF_COMMAND_ERR_0513,$STR_CONF_COMMAND_ERR_0514,$STR_CONF_COMMAND_ERR_0515; + global $STR_CONF_COMMAND_ERR_0516,$STR_CONF_COMMAND_ERR_0517,$STR_CONF_COMMAND_ERR_0518; + global $STR_CONF_COMMAND_ERR_9999; + global $pubConn; + global $strBack,$strError,$strPrompt; + //echo "Reason=$Reason"; + global $PlatTypeDefArr; + $pubdb = "OMC_PUB"; + $selSql = "SELECT sysTypeName FROM sysConf WHERE sysTypeNo='$sysTypeNo'"; + $selRes = mysqli_query($pubConn, $selSql); + $selRow = mysqli_fetch_array($selRes); + if($sysTypeNo[0] == '2'){//Plat + $sysName = $selRow[sysTypeName]. "-" .$PlatTypeDefArr[$sysNo][remark]; + }else{ + $sysName = $selRow[sysTypeName]."-".$sysNo; + } + $tmpErrCode="STR_CONF_COMMAND_ERR_".$Reason; + $tmpPromptCode="STR_CONF_PROMPT_".$Reason[0].$Reason[1]; + + // fj + if(0) + { + echo "

      $sysName Error:${$tmpErrCode} ,$des
      "; + echo "Reason: $Reason


      "; + } + +for($index=0;$index<$descArr[Count];$index++) +{ + if(strlen(trim($descArr[$index][SysTypeName])) > 0 && strlen(trim($descArr[$index][TableName])) > 0) + { + $log="{$descArr[$index][CommdType]} {$descArr[$index][SysTypeName]}: {$descArr[$index][TableName]} {$descArr[$index][InstanceNo]} fail"; + insertLog($log); + } +} + + + echo "

      $sysName Error: $des.
      "; + echo "Prompt: ${$tmpPromptCode}
      "; + if($backsrc == '' || strlen($backsrc)==0) + echo "

      Back"; + else + { + //echo "backsrc=$backsrc
      "; + //because the operation error, then get the table again + if(strstr($backsrc,"param_edit.php") || strstr($backsrc,"param_show_table.php") || strstr($backsrc,"param_show_down.php")) + { + $tmp=explode("sysId=",$backsrc); + $tmp2=explode("&",$tmp[1]); + $get_sysId=$tmp2[0]; + + $tmp=explode("tableOid=",$backsrc); + $tmp2=explode("&",$tmp[1]); + $get_tableOid=$tmp2[0]; + + $tmp=explode("table_type=",$backsrc); + $tmp2=explode("&",$tmp[1]); + $get_table_type=$tmp2[0]; + + $tmp=explode("instanceNo=",$backsrc); + $tmp2=explode("&",$tmp[1]); + $get_instanceNo=$tmp2[0]; + + if(strlen($get_instanceNo) == 0) + { + $backsrc="./param_show_table.php?sysId=$get_sysId&tableOid=$get_tableOid&table_type=$get_table_type&instanceNo=0000"; + } + + if(strlen($get_sysId)>0 && strlen($get_tableOid)>0) + { + + $commIdStr=oidSysCommSend($get_sysId,5,$get_tableOid,-1,""); + } + + } + echo "

      Back"; + } + exit(); +} +?> diff --git a/wxc2_omc/configuration/sub_inc/sub_english.inc b/wxc2_omc/configuration/sub_inc/sub_english.inc new file mode 100755 index 0000000..32d33f6 --- /dev/null +++ b/wxc2_omc/configuration/sub_inc/sub_english.inc @@ -0,0 +1,135 @@ +SLC"; +$strE1ConnectionOUT ="E1 port #"; +$strEditBarPara ="Edited parameters"; +$strEditBuffer ="Edit buffer"; +$strEditRoute ="Edit route"; +$strExecutionComplete ="Execution complete"; +$strExecutionTime ="Execution Time"; +$strFaultYouNotChosen ="Error: you have not chosen any parameter type"; +$strGroupID ="Group ID"; +$strHaltOrder ="Halt command"; +$strIPDPCTable ="IP->DPC"; +$strIsUnderEditOfAnotherUser ="Is under edit of another user"; +$strLengthOfTheInputValueIsError ="Length of the input value is error!"; +$strLocalEquipmentConnectionOUT ="Central system"; +$strLocalTS ="Local TS"; +$strNetworkManagementAddressing ="Network management addressing"; +$strNoProcess ="no process"; +$strNoLanguageVersionTemplateAvailable ="No language version template available"; +$strOMCSingalingPointCode ="OMC singaling point code"; +$strOperationComplete ="Operation complete"; +$strOperationFail ="Operation fail"; +$strOperationObject ="Operation object"; +$strOperationOrderTable ="Operation order table"; +$strOperationTimeout ="Operation timeout"; +$strOperationPause ="Operation pause"; +$strOperationSucceed ="Operation succeed"; +$strOriginatingPointCode ="Originating point code"; +$strOriginatingSystemNumber ="Originating system number"; +$strParameter ="Parameter"; +$strParameterdDescription ="Parameter"; +$strParameterOf ="parameter"; +$strParameters ="parameters"; +$strParameterSetNote ="Note:You can only input decimal number"; +$strParametersOperations ="Parameters Operation"; +$strParametersOperationsRemarks_1 ="1. Select parameter, and click GET button to read setting from device to OMC Read Buffer."; +$strParametersOperationsRemarks_2 ="2. Click Copy button to copy read setting to Init Buffer and modify setting."; +$strParametersOperationsRemarks_3 ="3. Click Save button to save modified setting to OMC database, and then click SET button to activate new setting to device."; +$strParameterType ="Parameter type"; +$strParaMustBeADecNumber ="parameter must be a decimal number"; +$strParaMustBeAHexNumber ="parameter must be a hexadecimal number"; +$strPleaseCorrectIt ="Please correct it"; +$strPrepareToExecute ="Prepare to execute"; +$strPrimaryRoute ="Primary"; +$strReadBuffer ="Read buffer"; +$strRemoteEquipmentConnectionIN ="Remote device"; +$strRemoteTS ="Remote TS"; +$strRouteID ="Route ID"; +$strRouteType ="Route type"; +$strSaveToDatabase ="Save to database"; +$strSecondRoute ="Second"; +$strSegmentNumber ="Segment number"; +$strSegmentOfDeviceIP ="Segment of device IP"; +$strSetTheNumberDisplayed ="Please set the number displayed in each page to the multiple of the defined length"; +$strShowBTSSiteInfo ="Show BTS site info"; +$strShowNetRouteParameter ="Show network route parameter"; +$strShowStartIP ="Show start IP"; +$strSignalingLinkCode ="Signaling link code"; +$strStartIpAddress ="Start IP address"; +$strSubsystemParameters ="Subsystem Parameters"; +$strSwitchConnectionSetup ="Switch connection Setup"; +$strSwitchParaInitialization ="Switch parameter initialization"; +$strSwitchStatusInitialization ="Switch status initialization"; +$strSynchronousSwitchPara ="Synchronous switch parameter"; +$strSystemID ="System ID"; +$strSystemPara ="System parameters"; +$strSystemParameters ="System Parameters"; +$strSystemParaOf ="System parameters"; +$strThereIsNoCommandBeingExecuted ="No command is executing"; +$strTheRouteAsNetworkManage ="As network manage"; +$strTheValueCannotBeEmpty ="The value cannot be empty"; +$strThisIPBeUsedByOtherDevice ="This IP be used by other device"; +$strUndefinedOrderInvalidOrder ="Undefined command, invalid command"; +$strUnderEditStatus ="Under editing"; +$strUnitLength ="Unit length"; +$strUploadFromSwitch ="Upload from switch"; +$strUsefulSpecification ="Specification"; +$strValueRange ="Range"; +$strXCoordinate ="X coordinate"; +$strYCoordinate ="Y coordinate"; +$strIfDisplayName ="Display name"; +$strStateInfoClasses ="State info classes"; +$strStateDisplayDirection ="Display direction"; +$strEditSystem ="Edit system"; +$strNumericFormatCalculator ="Numeric format calculator"; +$strAddSystem ="Add system"; +$strAddTSGroup ="Add TS group"; +$strSystenList ="System information list"; +$strPPSParamImport ="PPS voice file import"; + +//added by xiehua, 2003-05-13 +$strNeighborCell ="Neighbor cell"; +$strBtsName ="BTS name"; +$strHandoverControl ="Handover control"; +$strClockReference ="Clock reference"; +$strNeighborType ="Neibhbor type"; + +//added by lilong, 2003-5-27 +$strMobileCountryCode ="Mobile country code"; +$strMobileNetworkCode ="Mobile network code"; +$strCountryCode ="Country code"; +$strNationalDestinationCode ="National destination code"; +$strInternationalPrefix ="International prefix"; +$strNationalPrefix ="National prefix"; +$strInternationalNetwork ="International network"; +$strInternationalNetworkSpare ="International network spare"; +$strNationalNetwork ="National network"; +$strNationalNetworkSpare ="National network spare"; +$strMSISDN ="MSISDN"; +$strIMSI ="IMSI"; +$strE214GT ="E214GT"; +$RouteByGT ="Route by GT"; +$RouteByDPCAndSSN ="Route by DPC and SSN"; +$strRestore ="Restore"; +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/sysMap/centralNetworkMapImport.php b/wxc2_omc/configuration/sysMap/centralNetworkMapImport.php new file mode 100755 index 0000000..53c4c9c --- /dev/null +++ b/wxc2_omc/configuration/sysMap/centralNetworkMapImport.php @@ -0,0 +1,340 @@ +ftpLoginName=$ftpLoginName "; +if($DEBUG)echo "
      ftpLoginPwd=$ftpLoginPwd"; + +function delImpFile() +{ + global $impFileArr,$impFile_1; + for($j=0;$j"; + }else{ + if(FALSE == $delRes) echo "you have no priviledge to delete map.jpg
      "; + } + */ + + /* close ftp + if(!ftp_put($ftpCon,$remoteFile,$localFile,FTP_ASCII)){ + */ + if(!sftp_put($ftpCon,$remoteFile,$localFile,SFTP_ASCII)){ + if($language == 'chn'){ + echo "
      上传失败."; + }else{ + echo "
      Failed."; + } + return(-1); + }else{ + if($language == 'chn'){ + echo "
      上传成功."; + }else{ + echo "
      Successful."; + } + } + } + return(1); +} + +function chkImpFile() +{ + $DEBUG=0; + global $impFileArr,$impFile_1; + global $maxImpFileSize,$language; + //检查导入的文件大小 + for($j=0;$jimpFileSize=$impFileSize"; + if($impFileSize > $maxImpFileSize){ + echo "
      impRecordNum=$impRecordNum"; + if($language == 'chn'){ + echo "
      文件过大!"; + }else{ + echo "
      File size is too large!"; + } + return(-1); + } + } + return(1); +} + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      impFile_1=$impFile_1"; + +//========================================================== +//数据处理 +//========================================================== +//判断是否有文件上载 +if( $_SERVER['REQUEST_METHOD'] == "POST" && $impFile_1 != "none" ){ + if(chkImpFile() < 0){ + delImpFile(); + exit(); + } + + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' + ORDER BY sysNo,subSysNo + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $omcNum=mysqli_num_rows($getSysIdResult); + if($omcNum <= 0){ + if($language == 'chn'){ + echo "[错误]:系统列表中没有配置 OMC 的IP!"; + }else{ + echo "Error:Can not find any OMC's IP in system list,Please ADD it!"; + } + delImpFile(); + exit(); + } + $impOkFlag=0; + for($i=0;$i<$omcNum;$i++){ + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysName='OMC_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $dstSeverIp = $getSysIdRow[ip]; + if($DEBUG) echo "
      sysId = $sysId"; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + + if($language == 'chn'){ + echo "
      上传地图到 $sysName ( $dstSeverIp ) ......"; + }else{ + echo "
      Try to upload omc map to $sysName($dstSeverIp) ......"; + } + flush(); + + /* close ftp + $ftpCon=@ftp_connect($dstSeverIp); + if($ftpCon < 1){ + if($language == 'chn'){ + echo "
      连接 $sysName 失败!"; + }else{ + echo "
      Connect $sysName Failed!"; + } + continue; + }else{ + //echo "
      Connect $sysName OK"; + flush(); + } + */ + + $connection=sftp_connect($dstSeverIp); + if(!$connection){ + if($language == 'chn'){ + echo "
      连接 $sysName 失败!"; + }else{ + echo "
      Connect $sysName Failed!"; + } + continue; + }else{ + //echo "
      Connect $sysName OK"; + flush(); + } + + /* close ftp + if(!@ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + if($language == 'chn'){ + echo "
      登陆 $sysName 失败!"; + }else{ + echo "
      Login $sysName Failed!"; + } + @ftp_quit($ftpCon); + continue; + }else{ + //echo "
      Login $sysName OK"; + flush(); + } + */ + + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + f(!$key){ + if($language == 'chn'){ + echo "
      登陆 $sysName 失败!"; + }else{ + echo "
      Login $sysName Failed!"; + } + continue; + }else{ + //echo "
      Login $sysName OK"; + flush(); + } + + /* close ftp + if(putImpFile($ftpCon)){ + $impOkFlag = 1; + } + @ftp_quit($ftpCon); + */ + + if(putImpFile($key)){ + $impOkFlag = 1; + } + + flush(); + } + delImpFile(); + + if($impOkFlag == 0){ + exit(); + } + + flush(); + if($language == 'chn'){ + echo "


       << 返回 "; + }else{ + echo "


       << Return "; + } + exit(); +}elseif(isset($impFile)){ + echo "
      "; + if($language == 'chn'){ + echo "上传失败,文件不存在!"; + }else{ + echo "Upload file failed, File doesn't exist!"; + } +} + +//========================================================== +//数据显示 +//========================================================== +?> + + + +

      " name="subsData" enctype="multipart/form-data" onsubmit="return checkAllInput(this)"> +"; +echo ""; +echo ""; +if($language == 'chn'){ + echo "高级管理 > 系统地图 > 地图上载 "; +}else{ + echo "Advanced > System Map >Network map "; +} +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> +
      + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + +
      +"; +?> +
      +
      +说明:


      "; + echo "上传文件成功后,请关掉所有的浏览器窗口,再重新打开浏览器,地图更改才能生效。"; +}else{ + echo "Remarks:

      "; + echo "Change OMC system map. after uploaded this file, close all explorer windows and restart, newly updated map should be displayed."; +} +?> + + diff --git a/wxc2_omc/configuration/sysMap/networkMapImport.php b/wxc2_omc/configuration/sysMap/networkMapImport.php new file mode 100755 index 0000000..e35c579 --- /dev/null +++ b/wxc2_omc/configuration/sysMap/networkMapImport.php @@ -0,0 +1,339 @@ +ftpLoginName=$ftpLoginName "; +if($DEBUG)echo "
      ftpLoginPwd=$ftpLoginPwd"; + +function delImpFile() +{ + global $impFileArr,$impFile_1; + for($j=0;$j"; + }else{ + if(FALSE == $delRes) echo "you have no priviledge to delete map.jpg
      "; + } + */ + /* close ftp + if(!ftp_put($ftpCon,$remoteFile,$localFile,FTP_ASCII)){ + */ + if(!sftp_put($ftpCon,$remoteFile,$localFile,SFTP_ASCII)){ + if($language == 'chn'){ + echo "
      上传失败."; + }else{ + echo "
      Failed."; + } + return(-1); + }else{ + if($language == 'chn'){ + echo "
      上传成功."; + }else{ + echo "
      Successful."; + } + } + } + return(1); +} + +function chkImpFile() +{ + $DEBUG=0; + global $impFileArr,$impFile_1; + global $maxImpFileSize,$language; + //检查导入的文件大小 + for($j=0;$jimpFileSize=$impFileSize"; + if($impFileSize > $maxImpFileSize){ + echo "
      impRecordNum=$impRecordNum"; + if($language == 'chn'){ + echo "
      文件过大!"; + }else{ + echo "
      File size is too large!"; + } + return(-1); + } + } + return(1); +} + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      impFile_1=$impFile_1"; + +//========================================================== +//数据处理 +//========================================================== +//判断是否有文件上载 +if( $_SERVER['REQUEST_METHOD'] == "POST" && $impFile_1 != "none" ){ + if(chkImpFile() < 0){ + delImpFile(); + exit(); + } + + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' + ORDER BY sysNo,subSysNo + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $omcNum=mysqli_num_rows($getSysIdResult); + if($omcNum <= 0){ + if($language == 'chn'){ + echo "[错误]:系统列表中没有配置 OMC 的IP!"; + }else{ + echo "Error:Can not find any OMC's IP in system list,Please ADD it!"; + } + delImpFile(); + exit(); + } + $impOkFlag=0; + for($i=0;$i<$omcNum;$i++){ + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysName='OMC_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $dstSeverIp = $getSysIdRow[ip]; + if($DEBUG) echo "
      sysId = $sysId"; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + + if($language == 'chn'){ + echo "
      上传地图到 $sysName ( $dstSeverIp ) ......"; + }else{ + echo "
      Try to upload omc map to $sysName($dstSeverIp) ......"; + } + flush(); + + /* close ftp + $ftpCon=@ftp_connect($dstSeverIp); + if($ftpCon < 1){ + if($language == 'chn'){ + echo "
      连接 $sysName 失败!"; + }else{ + echo "
      Connect $sysName Failed!"; + } + continue; + }else{ + //echo "
      Connect $sysName OK"; + flush(); + } + */ + + $connection=sftp_connect($dstSeverIp); + if(!$connection){ + if($language == 'chn'){ + echo "
      连接 $sysName 失败!"; + }else{ + echo "
      Connect $sysName Failed!"; + } + continue; + }else{ + //echo "
      Connect $sysName OK"; + flush(); + } + + /* close ftp + if(!@ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + if($language == 'chn'){ + echo "
      登陆 $sysName 失败!"; + }else{ + echo "
      Login $sysName Failed!"; + } + @ftp_quit($ftpCon); + continue; + }else{ + //echo "
      Login $sysName OK"; + flush(); + } + */ + + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + if(!$key){ + if($language == 'chn'){ + echo "
      登陆 $sysName 失败!"; + }else{ + echo "
      Login $sysName Failed!"; + } + continue; + }else{ + //echo "
      Login $sysName OK"; + flush(); + } + + /* close ftp + if(putImpFile($ftpCon)){ + $impOkFlag = 1; + } + @ftp_quit($ftpCon); + */ + + if(putImpFile($key)){ + $impOkFlag = 1; + } + + flush(); + } + delImpFile(); + + if($impOkFlag == 0){ + exit(); + } + + flush(); + if($language == 'chn'){ + echo "


       << 返回 "; + }else{ + echo "


       << Return "; + } + exit(); +}elseif(isset($impFile)){ + echo "
      "; + if($language == 'chn'){ + echo "上传失败,文件不存在!"; + }else{ + echo "Upload file failed, File doesn't exist!"; + } +} + +//========================================================== +//数据显示 +//========================================================== +?> + + + +
      " name="subsData" enctype="multipart/form-data" onsubmit="return checkAllInput(this)"> +"; +echo ""; +echo ""; +if($language == 'chn'){ + echo "高级管理 > 系统地图 >地图上载 "; +}else{ + echo "Advanced > System Map > Central Office Map "; +} +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> +
      + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + +
      +"; +?> +
      +
      +说明:


      "; + echo "上传文件成功后,请关掉所有的浏览器窗口,再重新打开浏览器,地图更改才能生效。"; +}else{ + echo "Remarks:

      "; + echo "Change OMC system map. after uploaded this file, close all explorer windows and restart, newly updated map should be displayed."; +} +?> + + diff --git a/wxc2_omc/configuration/systemList/systemConf.php b/wxc2_omc/configuration/systemList/systemConf.php new file mode 100755 index 0000000..8daecc5 --- /dev/null +++ b/wxc2_omc/configuration/systemList/systemConf.php @@ -0,0 +1,678 @@ + + + +"; + +global $pubConn; +$DEBUG = 0; +$mode = $_REQUEST['mode']; +$sysTypeNo = $_REQUEST['sysTypeNo']; +$save = $_POST['save']; + +if($DEBUG) echo "
      mode=$mode"; + + + +$sysConfTable = 'OMC_PUB.sysConf'; + +$sysInfoTable = 'OMC_PUB.sysInfo'; + +$sysInfoDefTable = 'OMC_PUB.sysInfoDef'; + +$pubDb ='OMC_PUB'; + + + + + +$netIdDefArr=array(array('0', "international network"), + + array('1', "international network spare"), + + array('2', "national network"), + + array('3', "national network spare") + + ); + + + +if($DEBUG) echo "
      sysId=$sysId"; + +if(isset($sysId) && strlen($sysId) > 5){ + + $sysIdArr = explode('_',$sysId); + + $sysTypeNo = $sysIdArr[0]; + + $sysNo = $sysIdArr[1]; + + $subSysNo = $sysIdArr[2]; + + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + + if($DEBUG) echo "
      sysNo=$sysNo"; + + if($DEBUG) echo "
      subSysNo=$subSysNo"; + +} + + + +if($sysTypeNo == '500' && isset($bssId)){ + + if($DEBUG) echo "
      Process BSS's return......"; + + if(isset($errorInfo)){ + + echo "
      Error:$errorInfo
      "; + + if($mode == 'delete'){ + + $delSql = "DELETE FROM $sysInfoTable + + WHERE sysTypeNo='$sysTypeNo' AND sysNo = '$sysNo' + + AND subSysNo = '$subSysNo' AND ip = '$ip' + + "; + + if($DEBUG) echo "
      delSql = $delSql"; + + mysqli_query($pubConn,$delSql); + + //echo "
      Delete BSS$bssId OK"; + + //if(!$DEBUG) echo " "; + + //exit(); + + } + + exit(); + + }else{ + + if($mode == 'add'){ + + $addSql = "REPLACE INTO $sysInfoTable (sysTypeNo,sysNo,subSysNo,isRemote,netId,DPC,ip,baseStat,sysAlias,updateTime ) + + VALUES('$sysTypeNo','$sysNo','$subSysNo','$isRemote','$netId','$DPC','$ip','1','$sysAlias',CURRENT_TIMESTAMP) + + "; + + if($DEBUG) echo "
      addSql = $addSql"; + + $result = mysqli_query($pubConn,$addSql); + + echo mysqli_error($pubConn); + + + + echo "
      Create BSS$bssId OK"; + + $mode = 'edit'; + + }elseif($mode == 'delete'){ + + $delSql = "DELETE FROM $sysInfoTable + + WHERE sysTypeNo='$sysTypeNo' AND sysNo = '$sysNo' + + AND subSysNo = '$subSysNo' AND ip = '$ip' + + "; + + if($DEBUG) echo "
      delSql = $delSql"; + + mysqli_query($pubConn,$delSql); + + echo "
      Delete BSS$bssId OK"; + + if(!$DEBUG) echo " "; + + exit(); + + }else{ + + echo "Error:Unknown mode($mode)"; + + exit(); + + } + + } + +} + + + +if(isset($save) && $save != '-1'){ + + if($sysTypeNo == '500' && $mode=='add'){ + + $sysId= $sysTypeNo.'_'.$sysNo.'_'.$subSysNo; + + $addBssUrl="../../bssomc/bsstable.php?mode=add&sysId=$sysId&ip=$ip&remark=$sysAlias&language=$language"; + + echo " "; + + exit(); + + } + + if($mode=='add'){ + + $addSql = "REPLACE INTO $sysInfoTable (sysTypeNo,sysNo,subSysNo,isRemote,netId,DPC,ip,baseStat,sysAlias,updateTime ) + + VALUES('$sysTypeNo','$sysNo','$subSysNo','$isRemote','$netId','$DPC','$ip','1','$sysAlias',CURRENT_TIMESTAMP) + + "; + + if($DEBUG) echo "
      addSql = $addSql"; + + $result = mysqli_query($pubConn,$addSql); + + echo mysqli_error($pubConn); + + + + $sysId=$sysTypeNo.'_'.$sysNo.'_'.$subSysNo; + + $mode = 'edit'; + + }else{ + + $sysIdArr = explode('_',$sysId); + + $sysTypeNo = $sysIdArr[0]; + + $sysNo = $sysIdArr[1]; + + $subSysNo = $sysIdArr[2]; + + $saveSql = "UPDATE $sysInfoTable SET isRemote='$isRemote',netId='$netId',DPC='$DPC',ip ='$ip', + + baseStat='$baseStat',sysAlias='$sysAlias',updateTime = CURRENT_TIMESTAMP + + WHERE sysTypeNo='$sysTypeNo' + + AND sysNo = '$sysNo' + + AND subSysNo = '$subSysNo' + + "; + + if($DEBUG) echo "
      saveSql = $saveSql"; + + $result = mysqli_query($pubConn,$saveSql); + + echo mysqli_error($pubConn); + + } + + if($result > 0){ + + echo "
      OK!"; + + }else{ + + echo "
      Error!"; + + } + + if(!$DEBUG) echo " "; + + exit(); + +}elseif($mode =='delete'){ + + $sysIdArr = explode('_',$sysId); + + $sysTypeNo = $sysIdArr[0]; + + $sysNo = $sysIdArr[1]; + + $subSysNo = $sysIdArr[2]; + + + + if($sureDel == 'Yes'){ + + if($sysTypeNo == '500'){ + + echo " "; + + exit(); + + }else{ + + $delSql = "DELETE FROM $sysInfoTable + + WHERE sysTypeNo='$sysTypeNo' AND sysNo = '$sysNo' + + AND subSysNo = '$subSysNo' AND ip = '$ip' + + "; + + if($DEBUG) echo "
      delSql = $delSql"; + + mysqli_query($pubConn,$delSql); + + echo "
      Delete ok"; + + echo " "; + + } + + exit(); + + }elseif($sureDel == 'No'){ + + echo "
      Delete Canceled"; + + $mode='edit'; + + }else{ + + echo "Are you sure to delete system information of $sysName ?"; + + echo "
      "; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo "
      "; + + exit(); + + } + +} + + + +if(isset($sysId)){ + + $sysIdArr = explode('_',$sysId); + + $sysTypeNo = $sysIdArr[0]; + + $sysNo = $sysIdArr[1]; + + $subSysNo = $sysIdArr[2]; + +} + + + +if($mode == 'edit'){ + + $sysListSql = "SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,isRemote,netId,DPC,ip,baseStat,sysAlias,updateTime + + FROM $sysConfTable,$sysInfoTable + + WHERE $sysConfTable.sysTypeNo = $sysInfoTable.sysTypeNo + + AND $sysInfoTable.sysTypeNo='$sysTypeNo' + + AND $sysInfoTable.sysNo = '$sysNo' + + AND $sysInfoTable.subSysNo = '$subSysNo' + + AND $sysInfoTable.ip = '$ip' + + ORDER BY $sysInfoTable.sysTypeNo,sysNo,subSysNo,updateTime"; + + if($DEBUG) echo "

      sysListSql = $sysListSql"; + + $sysListResult = mysqli_query($pubConn,$sysListSql); + + echo mysqli_error($pubConn); + + $sysListRows= @mysqli_fetch_array($sysListResult); + + $isRemote = $sysListRows[isRemote]; + + $netId = $sysListRows[netId]; + + $DPC = $sysListRows[DPC]; + +} + +?> + + + +
      " > + + + + + + + + + +"; + +echo ""; + +echo ""; + +$baseStatArr=array(array('1',"Normal"),array('0',"False")); + +//do{ + + echo ""; + + //===isRemote=== + + echo ""; + + echo ""; + + //===netId=== + + echo ""; + + echo ""; + + echo ""; + + //===DPC=== + + echo ""; + + echo ""; + + echo ""; + + //===ip== + + echo ""; + + if(isset($ip)){ + + echo ""; + + }else{ + + echo ""; + + } + + echo ""; + +//}while($sysId != 'add' && $sysListRows=@mysql_fetch_array($sysListResult)); + +echo ""; + +echo " "; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + + + +echo ""; + +echo "
      + + + +
      system Name"; + + +if($mode == 'add'){ + + echo ""; + + echo "system Type"; + + echo ""; + + //显示选择系统编号下拉菜单 + + echo "sysNo:"; + + echo ""; + + + + //显示选择子系统编号下拉菜单 + + echo "subSysNo:"; + + echo ""; + + echo ""; + +}else{ + + echo ""; + + $sysName = $sysListRows[sysTypeName].'_'.$sysListRows[sysNo].'_'.$sysListRows[subSysNo]; + + echo "$sysName "; + + echo ""; + +} + +echo "
      Network Type "; + + echo "
      Net ID:
      DPC:
      IP:
      baseStatus:
      updateTime:  $sysListRows[updateTime]
      Alias:
      "; + +echo "  "; + +echo "  "; + +echo ""; + +echo ""; + +echo ""; +adjust_content_tail("down"); +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/systemList/systemList_down.php b/wxc2_omc/configuration/systemList/systemList_down.php new file mode 100755 index 0000000..bd7c609 --- /dev/null +++ b/wxc2_omc/configuration/systemList/systemList_down.php @@ -0,0 +1,137 @@ + + + +"; + +$DEBUG = 0; +$sysConfTable = 'OMC_PUB.sysConf'; +$sysInfoTable = 'OMC_PUB.sysInfo'; +$sysInfoDefTable = 'OMC_PUB.sysInfoDef'; +$pubDb ='OMC_PUB'; +$sysListSql = "SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,isRemote,netId,DPC,ip,baseStat,sysAlias,updateTime,needHeartBeat ,needInstall,needUninstall + FROM $sysConfTable,$sysInfoTable + WHERE $sysConfTable.sysTypeNo = $sysInfoTable.sysTypeNo + ORDER BY $sysInfoTable.sysTypeNo,$sysInfoTable.sysNo,$sysInfoTable.subSysNo"; +if($DEBUG) echo "
      sysListSql = $sysListSql
      "; +$sysListResult = mysqli_query($pubConn,$sysListSql); +echo mysqli_error($pubConn); +?> + + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +}elseif($selectedLanguage == 'chn'){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +while($sysListRows=@mysqli_fetch_array($sysListResult)){ + $sysId=$sysListRows[sysTypeNo].'_'.$sysListRows[sysNo].'_'.$sysListRows[subSysNo]; + $sysName=$sysListRows[sysTypeName].'_'.$sysListRows[sysNo].'_'.$sysListRows[subSysNo]; + echo ""; + echo ""; + if(strlen($sysListRows[sysAlias]) > 0 ){ + echo ""; + }else{ + echo ""; + } + if($sysListRows[isRemote] > 0 ){ + echo ""; + }else{ + echo ""; + } + if($sysListRows[isRemote] > 0 ){ + echo ""; + }else{ + echo ""; + } + + echo ""; + echo ""; + if($sysListRows[needHeartBeat] > 0){ + if($sysListRows[baseStat] > 0){ + echo ""; + }else{ + echo ""; + } + }else{ + echo ""; + } + + if($sysListRows[needHeartBeat] > 0){ + echo ""; + }else{ + echo ""; + } + if($sysListRows[needInstall] > 0){ + echo ""; + }else{ + echo ""; + } + if($sysListRows[needUninstall] > 0){ + echo ""; + }else{ + echo ""; + } + + echo ""; +} +echo "
      + + +
      system NamesysAliasNetwork TypeNetIdDPCIPbase StatusUpdate Time  
      系统名系统别名网络类型网络表示DPCIP基本状态更新时间  
      $sysName$sysListRows[sysAlias] -- SS7 Ethernet $sysListRows[netId]  -- $sysListRows[DPC] $sysListRows[ip] NormalFalse--$sysListRows[updateTime]--Edit--Delete--
      "; +echo "    "; +echo "
      "; + +adjust_content_tail("down"); +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/systemList/systemList_index.php b/wxc2_omc/configuration/systemList/systemList_index.php new file mode 100755 index 0000000..fd9ae51 --- /dev/null +++ b/wxc2_omc/configuration/systemList/systemList_index.php @@ -0,0 +1 @@ + <body> <p>此网页使用了框架,但您的浏览器不支持框架。</p> </body> \ No newline at end of file diff --git a/wxc2_omc/configuration/systemList/systemList_up.php b/wxc2_omc/configuration/systemList/systemList_up.php new file mode 100755 index 0000000..98ab8ee --- /dev/null +++ b/wxc2_omc/configuration/systemList/systemList_up.php @@ -0,0 +1,64 @@ + + + + +
      +"; +echo ""; +echo ""; +echo "Advanced > System List"; +echo ""; +echo " "; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; +?> + + + +     + + + +"; +echo " "; +$helpId="6"; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + +
      + + + diff --git a/wxc2_omc/configuration/systemVarDef/paramList.php b/wxc2_omc/configuration/systemVarDef/paramList.php new file mode 100755 index 0000000..97a7762 --- /dev/null +++ b/wxc2_omc/configuration/systemVarDef/paramList.php @@ -0,0 +1,330 @@ + + + +sql=$sql"; + $res = @mysqli_query($pubConn,$sql); + mysqli_error($pubConn); + while($row = @mysqli_fetch_array($res)){ + $name=$row[pubVarName]; + $value=$_REQUEST[''.$name]; + + $sql = " UPDATE $tableName SET + pubVarValue='$value' + WHERE pubVarName='$name' + "; + if($DEBUG) + echo "
      sql=$sql"; + + if(strcmp($row[pubVarName],"globalFTPUserName") == 0) + { + $updatesql="update OMC_PUB.sysSubsConf set ftpLoginName='$value' "; + @mysqli_query($pubConn,$updatesql); + } + else if(strcmp($row[pubVarName],"globalFTPPassword") == 0) + { + $updatesql="update OMC_PUB.sysSubsConf set ftpLoginPwd='$value' "; + @mysqli_query($pubConn,$updatesql); + } + else if(strcmp($row[pubVarName],"ExternalRCM") == 0) + { + $updatesql="update OMC_PUB.sysSubsConf set ExternalRCM='$value' "; + @mysqli_query($pubConn,$updatesql); + + if($value == 0) + { + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=3 and level_2=21 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='2' where level_1=3 and level_2=20 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=5 and level_2=3 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='3' where level_1=5 and level_2=2 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=7 and level_2=4 and level_3=2; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='4' where level_1=7 and level_2=4 and level_3=1; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysCsvConf set db_name='PPS_DB' where menu_name_2='card_info'"; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysCsvConf set if_enable=1 where menu_name_2='used_card_info'"; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update SMCLI.sysCmdDef set serverStr='pps',sysTypeNo=360,tmpTable='OBJ_360.tmpSubsData_1',srcTable='PPS_DB.card_info' where objectStr='ppscard'"; + @mysqli_query($pubConn,$updatesql); + } + else + { + $updatesql="update OMC_PUB.sysMenuConf set privilege='2' where level_1=3 and level_2=21 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=3 and level_2=20 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysMenuConf set privilege='3' where level_1=5 and level_2=3 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=5 and level_2=2 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysMenuConf set privilege='4' where level_1=7 and level_2=4 and level_3=2; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=7 and level_2=4 and level_3=1; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysCsvConf set db_name='RCM_RC_DB' where menu_name_2='card_info'"; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysCsvConf set if_enable=0 where menu_name_2='used_card_info'"; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update SMCLI.sysCmdDef set serverStr='rcm',sysTypeNo=395,tmpTable='OBJ_395.tmpSubsData_1',srcTable='RCM_RC_DB.card_info' where objectStr='ppscard'"; + @mysqli_query($pubConn,$updatesql); + } + } + + + if(strcmp($name,"fieldName") == 0|| + strcmp($name,"pssCardMinCount") == 0|| + strcmp($name,"currency_decimal") == 0|| + strcmp($name,"AucManagePwd") == 0|| + strcmp($name,"EirManagePwd") == 0|| + strcmp($name,"cdr_store_server") == 0|| + strcmp($name,"csta_store_server") == 0|| + strcmp($name,"SMCLI_timeout") == 0|| + strcmp($name,"globalFTPUserName") == 0|| + strcmp($name,"globalFTPPassword") == 0|| + strcmp($name,"ExternalRCM") == 0 + ) + mysqli_query($pubConn,$sql); + } + echo "
      Save OK!"; +} +?> + + +"; + echo ""; + echo ""; + echo "Maintenance > Control Panel > System"; + echo ""; + echo ""; + $helpId="5.2.1"; + showHelp($helpId); + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> +
      "> + +"; + +//title +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//$sql = " SELECT * FROM $tableName WHERE lowPrivilege='1' ORDER BY instance"; +$sql = " SELECT * FROM $tableName ORDER BY instance"; + +if($DEBUG) + echo "
      sql=$sql db=$db"; +$res = @mysqli_query($pubConn,$sql); + +//fieldName +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Minimum currency unit +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Decimal number of currency +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//AC Subscriber Management Password +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Eir Subscriber Management Password +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CDR Store Server +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//CSTA Store Server +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//Time out of SMCLI client +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +//Global FTP user name +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$row = @mysqli_fetch_array($res); +$row = @mysqli_fetch_array($res); +//ExternalRCM +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +/* +//Get BSS Status And Alarm Timer +$row = @mysqli_fetch_array($res); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +*/ + +?> + +
      "; +echo "System Configuration"; +echo "
      NameValueRemark
      Field Name"; +echo ""; +echo " 
      Minimum currency unit"; +echo ""; +echo "For PPS
      Decimal number of currency"; +echo ""; +echo "For PPS
      AUC Subscriber Management Password"; +echo ""; +echo "For AUC
      EIR Subscriber Management Password"; +echo ""; +echo "For EIR
      CDR Collecting System"; +echo ""; +echo "{$row[remark]}
      CSTA Collecting System"; +echo ""; +echo "{$row[remark]}
      Time out of SMCLI client"; +echo ""; +echo "Unit:Minutes
      MSS FTP User Name"; +echo ""; +echo "For Import subscriber, download PPS Tarriff, backup MSS subs data and MSS Configuration Synchronization
      MSS FTP Password"; +echo ""; +echo "For Import subscriber, download PPS Tarriff, backup MSS subs data and MSS Configuration Synchronization
      External RCM"; +echo ""; +echo "0-disable, 1-enable
      Get BSS Status And Alarm Timer"; +echo ""; +echo " 
      +
      + +     +
      + + + diff --git a/wxc2_omc/configuration/tabParamConfiguration/cos_edit.php b/wxc2_omc/configuration/tabParamConfiguration/cos_edit.php new file mode 100755 index 0000000..afa1c67 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/cos_edit.php @@ -0,0 +1,2074 @@ + + + + +"; + +if($DEBUG) +{ + echo "sysId=$sysId
      "; + //echo "instanceNo=$instanceNo
      "; +} + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$cos_instance=$instanceNo; +$nest_instance0=$cos_instance.".0000"; +$nest_instance1=$cos_instance.".0001"; +$nest_instance2=$cos_instance.".0002"; +$nest_instance3=$cos_instance.".0003"; +$nest_instance4=$cos_instance.".0004"; +$nest_instance5=$cos_instance.".0005"; + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if($get) + { + $index=0; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.51.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.52.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.53.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.54.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.55.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.56.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.57.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.58.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.59.1"; + $getArr[$index][instanceNo]=$instanceNo; + + $index++; + $getArr[$index][sysId]=$sysId; + $getArr[$index][oid]="2.2.60.1"; + $getArr[$index][instanceNo]=$instanceNo; + //$getParam_showFinishResultFlag=0; + getParam($getArr); + + $commstr=oidSysCommSend($sysId,0,"2.2.50.1", -1, $instanceNo); + checkState($commstr); + } + else + { + $totalCommStr=""; + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.50.1", -1, $cos_instance); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.51.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.52.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.53.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.54.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.55.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.55.1", -1, $nest_instance1); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.55.1", -1, $nest_instance2); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.55.1", -1, $nest_instance3); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.55.1", -1, $nest_instance4); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.55.1", -1, $nest_instance5); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.56.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.56.1", -1, $nest_instance1); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.56.1", -1, $nest_instance2); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.56.1", -1, $nest_instance3); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.56.1", -1, $nest_instance4); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.56.1", -1, $nest_instance5); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.57.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.57.1", -1, $nest_instance1); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.57.1", -1, $nest_instance2); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.57.1", -1, $nest_instance3); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.58.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.59.1", -1, $nest_instance0); + $totalCommStr.=oidSysCommSend($sysId, 3, "2.2.60.1", -1, $nest_instance0); + checkState($totalCommStr); + } +} + +//show navigation title +$showInstance=$instanceNo+0; +echo "
      "; +echo ""; +echo ""; +echo "COS"; +echo ""; +echo ""; +echo " "; +echo "$showInstance"; +echo "

      "; + +$left_percent="25%"; +$sub_left_percent="30%"; + +echo ""; +echo ""; + //COS Title + $param_oid="2.2.50.1.2"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; +echo ""; +echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$cos_instance; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; + //MO Tariff ID + $param_oid="2.2.51.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; +echo ""; +echo ""; + //MT Tariff ID + $param_oid="2.2.51.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; +echo ""; +echo "
      "; + echo "Tariff"; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; + //Charge By + $param_oid="2.2.51.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; +echo ""; +echo "
      "; + echo "Tariff Subscription"; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; + echo ""; + echo ""; +echo ""; + +echo ""; + echo ""; + echo ""; +echo ""; + + +//------------------------------------------------------ + +echo ""; + echo ""; + echo ""; +echo ""; + + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo ""; +echo "
      "; + echo "Service Control"; + echo "
      "; + echo "MO Call"; + echo ""; + + echo ""; + echo ""; + //Threshold Flag + $param_oid="2.2.52.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Minimun Balance + $param_oid="2.2.52.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + echo "
      "; + + echo "
      "; + echo "MT Call"; + echo ""; + + echo ""; + echo ""; + //Charged Flag + $param_oid="2.2.52.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Balance Control + $param_oid="2.2.52.1.7"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Balance Threshold + $param_oid="2.2.52.1.8"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo ""; + //MT SMS Charge + $param_oid="2.2.52.1.21"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " "; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + echo "
      "; + echo "
      "; + echo "Parent & Children Number"; + echo ""; + + echo ""; + + echo ""; + //Role + $param_oid="2.2.58.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo ""; + //Parent Chosen COS A + $param_oid="2.2.58.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + //Parent Chosen COS B + $param_oid="2.2.58.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + + echo ""; + //Child Allow Self Transfer + $param_oid="2.2.58.1.8"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo ""; + //Child Credit From + $param_oid="2.2.58.1.9"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo ""; + //Child Max Calls Per Day + $param_oid="2.2.58.1.10"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + //Child Max SMS Per Day + $param_oid="2.2.58.1.11"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + + echo ""; + //Child Max Consumption + $param_oid="2.2.58.1.12"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo ""; + //Pool Account Flag + $param_oid="2.2.52.1.13"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Charge for Change + $param_oid="2.2.52.1.14"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Free Changes + $param_oid="2.2.52.1.15"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo "   "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo "   "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + /* + echo " Child Allow Self Recharge  "; + $param_oid="2.2.58.1.7"; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + */ + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo "   "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo "   "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (times)"; + echo "
      "; + echo "
      "; + echo "Free SMS"; + echo ""; + + echo ""; + echo ""; + //Related COS + $param_oid="2.2.52.1.16"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + + //Active Days + $param_oid="2.2.52.1.17"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + + //Rent Type + $param_oid="2.2.52.1.18"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo "
      "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + +//------------------------------------------------------ + + + + +echo "
      "; + echo "Others"; + echo ""; + + echo ""; + echo ""; + //CUG Service Flag + $param_oid="2.2.52.1.9"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Recharge via Credit Card + $param_oid="2.2.52.1.10"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Credit Vault + $param_oid="2.2.52.1.11"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Credit Vault Amount + $param_oid="2.2.52.1.12"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo ""; + //Call Me Back Threshold + $param_oid="2.2.52.1.19"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo ""; + //Call Me Back Max Times + $param_oid="2.2.52.1.20"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo ""; + //Bundle Data Warning Threshold + $param_oid="2.2.52.1.22"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Bundle Data Warning Threshold + $param_oid="2.2.52.1.23"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Event Charge Flag + $param_oid="2.2.52.1.24"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //CAP or Bundle Function Choice + $param_oid="2.2.52.1.25"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + echo ""; + //Bundle Plan Control + $param_oid="2.2.52.1.26"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo ""; + echo ""; + + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (MB)"; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (MB)"; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "
      "; + + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; + echo ""; + echo ""; +echo ""; +echo ""; + echo ""; + echo ""; +echo ""; +echo "
      "; + echo "Account Validity"; + echo "
      "; + echo "Account Expiration"; + echo ""; + //Maximum Account Validity is + $param_oid="2.2.53.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (days). "; + + //When Account Expires + $param_oid="2.2.53.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + //When expired + echo " "; + $param_oid="2.2.53.1.13"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Keep expired account for + $param_oid="2.2.53.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (days). "; + + //After that + $param_oid="2.2.53.1.7"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "Validity Adjustment"; + echo ""; + + //After Recharge, Account Validity + $param_oid="2.2.53.1.8"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //When Balance is Depleted, Change Account Validity + $param_oid="2.2.53.1.9"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + //Change Validity to + $param_oid="2.2.53.1.10"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (days)"; + echo "
      "; + + //Activation by Inquiring is + $param_oid="2.2.53.1.11"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + //Validity of Activated Account with Zero Balance + $param_oid="2.2.53.1.12"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + //MO or MT expired + $param_oid="2.2.53.1.13"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + //Initial Bundle PlanID + $param_oid="2.2.53.1.14"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; + echo ""; + echo ""; +echo ""; +echo ""; + echo ""; + + echo ""; +echo ""; +echo "
      "; + echo "Short Message Notification & Inquiry"; + echo "
      "; + echo "Short Message Notification"; + echo ""; + //Successful Recharge + $param_oid="2.2.54.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + /* + echo " CAP Plan about to Change "; + $param_oid="2.2.54.1.4"; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + */ + echo "
      "; + //Account Inquiry + $param_oid="2.2.54.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Expiration + $param_oid="2.2.54.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " "; + + //before expiration + $param_oid="2.2.54.1.7"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (days) "; + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + + + + echo "
      "; + //Insufficient Balance + $param_oid="2.2.54.1.8"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + //When Balance Reaches + $param_oid="2.2.54.1.9"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + + echo "
      "; + //SMS Notification + $param_oid="2.2.54.1.12"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + + echo "
      "; + //Notification when Cap Plan Changed + $param_oid="2.2.54.1.13"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Notification when Apply Overdraft + $param_oid="2.2.54.1.14"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Rent Charge + $param_oid="2.2.54.1.15"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Friend and Family Registration + $param_oid="2.2.54.1.16"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Friend and Family Suspended + $param_oid="2.2.54.1.17"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Friend and Family Exceed Threshold + $param_oid="2.2.54.1.18"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Friend and Family Removed + $param_oid="2.2.54.1.19"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + echo "Inquiry by Short Message"; + echo ""; + + //Charge + $param_oid="2.2.54.1.10"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + + echo "
      "; + //Free Inquiry per Day + $param_oid="2.2.54.1.11"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +for($i=0;$i<6;$i++) +{ + echo ""; + echo ""; + + echo ""; + echo ""; +} +echo "
      "; + echo "Recharge Card Validity"; + echo "
      "; + echo "Recharge Card Type $i"; + echo ""; + //Card Credit + $param_oid="2.2.55.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param="nest_instance$i"; + $param_instance=$$param; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "  "; + + //MO Validity + $param_oid="2.2.55.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param="nest_instance$i"; + $param_instance=$$param; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "  "; + + //MT Validity + $param_oid="2.2.55.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param="nest_instance$i"; + $param_instance=$$param; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; + echo ""; +echo ""; +for($i=0;$i<6;$i++) +{ + echo ""; + echo ""; + + echo ""; + echo ""; +} +echo "
      "; + echo "Recharge Promotion"; + echo "
      "; + //Start Date + $param_oid="2.2.51.1.7"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "  "; + + //End Date + $param_oid="2.2.51.1.8"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "Promotion $i"; + echo ""; + //Recharge Card Credit + $param_oid="2.2.56.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param="nest_instance$i"; + $param_instance=$$param; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "  "; + + //Promotion Bonus + $param_oid="2.2.56.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param="nest_instance$i"; + $param_instance=$$param; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "  "; + + //Bonus Validity + $param_oid="2.2.56.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + $param="nest_instance$i"; + $param_instance=$$param; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; + echo "Promotion Application Scopes"; + echo "
      "; + +//IDD MO Call +$param_oid="2.2.51.1.10"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +//NDD MO Call +$param_oid="2.2.51.1.11"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +//Local MO Call +$param_oid="2.2.51.1.12"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +echo "
      "; + +//IDD MO SMS +$param_oid="2.2.51.1.13"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +//NDD MO SMS +$param_oid="2.2.51.1.14"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +//Local MO SMS +$param_oid="2.2.51.1.15"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +//GPRS +$param_oid="2.2.51.1.16"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +echo "
      "; + +//Transfer +$param_oid="2.2.51.1.17"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +//Transfer Priority +$param_oid="2.2.51.1.18"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +//Debit Priority +$param_oid="2.2.51.1.19"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +echo " "; +$param_instance=$nest_instance0; +showParameterAdv($sysId,$param_oid,$param_instance); + +echo "
      "; + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; + //Reset Date + $param_oid="2.2.51.1.9"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; +echo ""; +for($i=0;$i<4;$i++) +{ + echo ""; + echo ""; + + echo ""; +} +echo "
      "; + echo "Call CAP Plan"; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "CAP Plan $i"; + if($i%2) + echo " (Other Network)"; + else + echo " (Home Network)"; + echo ""; + echo ""; + echo ""; + + //Flag + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + + //Type + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + //Threshold 0 + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + + //Threshold 1 + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + + //Threshold 2 + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + echo ""; + + //Tariff ID 0 + echo ""; + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + + //Tariff ID 1 + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + + //Tariff ID 2 + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + + //Tariff ID 3 + echo ""; + $param="nest_instance$i"; + $param_instance=$$param; + echo ""; + echo ""; + echo "
      "; + $param_oid="2.2.57.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + $param_oid="2.2.57.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo " "; + echo ""; + echo " "; + echo ""; + echo " "; + echo "
      "; + $param_oid="2.2.57.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + $param_oid="2.2.57.1.7"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + $param_oid="2.2.57.1.8"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + $param_oid="2.2.57.1.9"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + $param_oid="2.2.57.1.10"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + $param_oid="2.2.57.1.11"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + $param_oid="2.2.57.1.12"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "
      "; + + + + + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; + echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo "
      "; + echo "GPRS Service Control"; + echo "
      "; + +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; + +echo ""; +echo ""; + +echo ""; +echo ""; + + +echo ""; +echo ""; + +echo ""; +echo ""; + +echo ""; +echo ""; + +echo ""; +echo ""; + + +echo ""; +echo ""; + +echo ""; +echo ""; +echo "
      "; +//GPRS Charge Status +$param_oid="2.2.59.1.4"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo ""; +//Minimum Balance for GPRS +$param_oid="2.2.59.1.5"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo " (currency unit)"; +echo "
      "; +//Inactive Session Limit +$param_oid="2.2.59.1.6"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo " (seconds)"; +echo ""; +//GPRS Notification when Terminate +$param_oid="2.2.59.1.7"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo "
      "; +//Max SMS for GPRS Notification Per Day +$param_oid="2.2.59.1.8"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo ""; +//Max Volume Quota Each Time +$param_oid="2.2.59.1.9"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo " (KB)"; +echo "
      "; +//Volume Threshold Diff +$param_oid="2.2.59.1.10"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo " (KB)"; +echo ""; +//Max Duration Quota Each Time +$param_oid="2.2.59.1.11"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo " (seconds)"; +echo "
      "; +//Duration Threshold Diff +$param_oid="2.2.59.1.12"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo " (seconds)"; +echo ""; +//Charge By +$param_oid="2.2.59.1.13"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); +echo "
      "; + +echo "
      "; + echo "GPRS CAP Plan"; + echo "
      "; +//Type +$param_oid="2.2.59.1.14"; +$singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); +echo ""; +echo "{$singleParameterInfo[ShowName]}"; +echo ""; +$param_instance=$nest_instance0; +echo "  "; +showParameterAdv($sysId,$param_oid,$param_instance); + +echo "
      "; + +echo ""; +echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + +echo ""; + +echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + +echo ""; +echo "
      "; + //Threshold 0 + $param_oid="2.2.59.1.15"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + //Threshold 1 + $param_oid="2.2.59.1.16"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + //Threshold 2 + $param_oid="2.2.59.1.17"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " "; + echo " "; + echo "
      "; + //Tariff ID 0 + $param_oid="2.2.59.1.18"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + //Tariff ID 1 + $param_oid="2.2.59.1.19"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + //Tariff ID 2 + $param_oid="2.2.59.1.20"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + //Tariff ID 3 + $param_oid="2.2.59.1.21"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + $param_instance=$nest_instance0; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + +echo "
      "; + + + + + + + + + + +echo "
      "; +echo ""; +echo ""; + echo ""; +echo ""; +echo ""; + echo ""; +echo ""; +$start_index=13; +for($i=0;$i<6;$i++) +{ + echo ""; + echo ""; + + echo ""; +} +echo "
      "; + echo "Friends & Family Number"; + echo "
      "; + + echo ""; + echo ""; + + //Flag + $param_oid="2.2.60.1.4"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + //Charge for Change + $param_oid="2.2.60.1.5"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + //Free Changes + $param_oid="2.2.60.1.6"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + echo ""; + echo ""; + + //Local Number + $param_oid="2.2.60.1.7"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + //NDD Number + $param_oid="2.2.60.1.8"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + //IDD Number + $param_oid="2.2.60.1.9"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + echo ""; + + echo ""; + + //Balance Threshold to Call FF Number + $param_oid="2.2.60.1.10"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + //Keep or Remove FF Number + $param_oid="2.2.60.1.11"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + //Balance Threshold to Keep FF Number + $param_oid="2.2.60.1.12"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + + echo ""; + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo " "; + $param_instance=$nest_instance0; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + echo "
      "; + + echo "
      "; + echo "FF Plan ".($i+1); + echo ""; + echo ""; + echo ""; + + //Registration Fee + echo ""; + $param_instance=$nest_instance0; + echo ""; + + $start_index++; + + //Max Numbers + echo ""; + $param_instance=$nest_instance0; + echo ""; + + $start_index++; + + //Free Call Duration + echo ""; + $param_instance=$nest_instance0; + echo ""; + + $start_index++; + + echo ""; + echo ""; + + //Free SMS + echo ""; + $param_instance=$nest_instance0; + echo ""; + + $start_index++; + + //Rent ID + echo ""; + $param_instance=$nest_instance0; + echo ""; + + $start_index++; + + + echo ""; + echo "
      "; + $param_oid="2.2.60.1.{$start_index}"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (currency unit)"; + echo ""; + $param_oid="2.2.60.1.{$start_index}"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + $param_oid="2.2.60.1.{$start_index}"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo " (minutes)"; + echo "
      "; + $param_oid="2.2.60.1.{$start_index}"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo ""; + $param_oid="2.2.60.1.{$start_index}"; + $singleParameterInfo=GetSingleParameterInfo($sysId,$param_oid); + echo ""; + echo "{$singleParameterInfo[ShowName]}"; + echo ""; + echo " "; + echo ""; + showParameterAdv($sysId,$param_oid,$param_instance); + echo "
      "; + echo "
      "; + + + + + + + + + + +echo ""; +echo "  "; +if($canwrite_flag) + echo ""; +else + echo ""; + +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/tabParamConfiguration/handleOpaquePara.php b/wxc2_omc/configuration/tabParamConfiguration/handleOpaquePara.php new file mode 100755 index 0000000..cc7cb45 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/handleOpaquePara.php @@ -0,0 +1,735 @@ +paraSql=$paraSql"; +$paraResult=mysqli_query($objDbConn,$paraSql); +$paraRows=@mysqli_fetch_array($paraResult); + +$setValue=$paraRows['initValue']; +$readValue=$paraRows['readValue']; +if($DEBUG) + echo "
      setValue=$setValue"; + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + echo "
      Error in omcStrFill:the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField='name_2'; + $objSetField='setTemplate_2' ; //语种2 +}else{ + $objNameField='name_1'; + $objSetField='setTemplate_1' ; //语种1(默认语种) +} +//----------------------- + +//=======================Get value From submit=================== +$set=$_POST['set']; +if($set == 'Set'){ + //sort by offset + $unitNum = $_POST['unitNum']; + echo"unitNum=$unitNum"; + for($i=1;$i<=$unitNum;$i++){ + //$tmpDef = ${'unitDef_'.$i}; + $tmpDef = $_POST['unitDef_'.$i]; + $tmpValue = $_POST['unit_'.$i]; + + //$tmpValue = ${'unit_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$i] = $tmpDef; + $tmpDefArr=explode('-',$tmpDef); + $sortArr[$i] = $tmpDefArr[0]; + $valueArr[$i] = $tmpValue; + } + echo "tmpDef=$tmpDef
      "; + + $lastValue = ''; + $k = 0; + asort($sortArr); + for(reset($sortArr); $key = key($sortArr); next($sortArr)){ + if($DEBUG) echo "
      sortArr[$key] = {$sortArr[$key]}"; + if($DEBUG) echo "
      unitValue = {$valueArr[$key]}"; + $unitValue = $valueArr[$key]; + if($DEBUG) echo "
      defArr[$key] = {$defArr[$key]}"; + $unitDefArr = explode('-',$defArr[$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1){ + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG)echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + }else{//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + }else{ + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'toLatitude': + //feake show 4byte + if($unitValue>90) + { + $unitValue=90; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + if($unitValue<-90) + { + $unitValue=-90; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + $byteValue=$unitValue*pow(2,23)/90; + $byteValue=ceil($byteValue); + $byteValue=dechex($byteValue); + $byteValue=omcStrFill($byteValue,8,'high','0'); + break; + case 'toLongitude': + if($unitValue>180) + { + $unitValue=180; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + if($unitValue<-180) + { + $unitValue=-180; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + $byteValue=$unitValue*pow(2,24)/360; + $byteValue=ceil($byteValue); + $byteValue=dechex($byteValue); + $byteValue=omcStrFill($byteValue,8,'high','0'); + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + } + $lastValue=strtoupper($lastValue); + if($DEBUG) echo "
      lastValue = $lastValue "; + $updateSql="UPDATE $paraTable SET initValue='$lastValue' WHERE $levelWhere AND instanceNo=$instanceNo"; + if($DEBUG)echo "
      updateSql=$updateSql"; + mysqli_query($objDbConn,$updateSql); + + + + if($lastValue==$readValue) + { + $returnColor= $settedColor; + } + else + { + $returnColor= $notSettedColor; + + $oidwhere=getLevelWhere(substr($oidStr,0,strlen($oidStr)-2)); + $tableName=getNameByOID_handle($sysTypeNo,$oidwhere); + $tableName=str_replace("Entry","",$tableName); + $sysName=getSystemNameBySysTypeNo($sysTypeNo); + + $fieldName=getNameByOID_handle($sysTypeNo,$levelWhere); + $log="Change $sysName $tableName's $fieldName, ".$readValue." -> ".$lastValue; + + insertLog($log); + //$handle=fopen("/tmp/test.txt","a"); + //fwrite($handle,$log); + //fwrite($handle,"\n"); + //fclose($handle); + } + if(!$DEBUG){ + echo "tmpDef=$tmpDef"; + //discard the postfix E + if(strstr($tmpDef,"keepHex-low")) + { + $oidwhere=getLevelWhere($oidStr); + echo"$oidwhere
      "; + + $sql="select setTemplate_2 from OBJ_$sysTypeNo.paramConf where $oidwhere "; + echo"
      $sql"; + $res=@mysqli_query($objDbConn,$sql); + $row=@mysqli_fetch_array($res); + $split=explode("[unit]",$row[0]); + $tmplen=sizeof($split); + //only one unit + //if($tmplen == 2) + { + $split2=explode("keepHex-low-",$row[0]); + $repl=substr($split2[1],0,1); + $lastValue=str_replace($repl," ",$lastValue); + } + } + if(strlen(trim($lastValue))<=0) + $lastValue="--"; + + echo ""; + exit(); + }else{ + echo "
      lastValue = $lastValue "; + } +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +
      " > +"; +// echo print_r( $unitArr); +// echo ""; +//echo sizeof( $unitArr); + +//show every one unit +//$setValue = strrev($setValue); +if($DEBUG){ + echo ""; +}else{ + echo "
      "; +} + +for($i=1;$i"; +}//end of for(..) + +echo "
      "; + //unit input name + $unitName = "unit_".$i; + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$i]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + //show Unit Name + echo "$tlvArr[0]"; + echo " "; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) + echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + $inputValue = trim($inputValue);//add by oven 2006-8-2 remvove dirty in Mozilla. + } + break; + case 'toLatitude': + //feake edit float + if($byteValue[0]=='F' || $byteValue[0]=='f') + { + $tmp=hexdec($byteValue)-1; + $orgbin=decbin($tmp); + $lastbin=""; + for($ii=0;$ii8) + $inputValue=substr($inputValue,0,8); + + if($inputValue > 90 || $inputValue < -90) + { + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + break; + case 'toLongitude': + if($byteValue[0]=='F' || $byteValue[0]=='f') + { + $tmp=hexdec($byteValue)-1; + $orgbin=decbin($tmp); + $lastbin=""; + for($ii=0;$ii8) + $inputValue=substr($inputValue,0,8); + + if($inputValue > 180 || $inputValue < -180) + { + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG)echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else if($defArr[0] == 'toAscii'){ + for($ii=0;$ii"; + else + echo ""; + + break; + case 'select': + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + + if($DEBUG) + echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + + echo ""; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + echo "\n "; + echo "
      "; + +$remark=nl2br($remark); +echo "
      Remarks:
      $remark

      "; +$unitNum = $i-1; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +if($canwrite_flag) +{ + echo "\n"; + echo "\n"; +} +else +{ + echo "\n"; + echo "\n"; +} +echo "
      "; +?> + + \ No newline at end of file diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/left_arrow.gif b/wxc2_omc/configuration/tabParamConfiguration/images/left_arrow.gif new file mode 100755 index 0000000..7b9e728 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/left_arrow.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/right_arrow.gif b/wxc2_omc/configuration/tabParamConfiguration/images/right_arrow.gif new file mode 100755 index 0000000..cba3418 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/right_arrow.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_12.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_12.gif new file mode 100755 index 0000000..0593edd Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_12.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_16.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_16.gif new file mode 100755 index 0000000..a87bc1a Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_16.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_20.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_20.gif new file mode 100755 index 0000000..a9b5e53 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_20.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_24.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_24.gif new file mode 100755 index 0000000..5dcb445 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_24.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_4.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_4.gif new file mode 100755 index 0000000..56bfcfa Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_4.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_8.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_8.gif new file mode 100755 index 0000000..0583780 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_dark_8.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_12.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_12.gif new file mode 100755 index 0000000..d748201 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_12.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_16.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_16.gif new file mode 100755 index 0000000..c0a1e16 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_16.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_20.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_20.gif new file mode 100755 index 0000000..ce93ebc Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_20.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_24.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_24.gif new file mode 100755 index 0000000..1734f7e Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_24.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_4.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_4.gif new file mode 100755 index 0000000..ee6f82f Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_4.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_8.gif b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_8.gif new file mode 100755 index 0000000..e89a1bb Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfiguration/images/tab_light_8.gif differ diff --git a/wxc2_omc/configuration/tabParamConfiguration/lockTimeSlot.php b/wxc2_omc/configuration/tabParamConfiguration/lockTimeSlot.php new file mode 100755 index 0000000..514cedd --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/lockTimeSlot.php @@ -0,0 +1,190 @@ + + + + +"; + $trunkTimeSlotEntriesFiled="trunkChannelEntries"; + //get the trunkTimeSlotEntries oid + $sql="select level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 from OBJ_320.paramConf where name_2='$trunkTimeSlotEntriesFiled' "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + if($num == 0) + exit($trunkTimeSlotEntriesFiled." do not exist!
      "); + $pos=0; + $row=@mysqli_fetch_array($res); + $trunkTimeSlotEntriesOid=""; + while($row[$pos]!=0) + { + $trunkTimeSlotEntriesOid.="{$row[$pos]}."; + $pos++; + } + $trunkTimeSlotEntriesOid=substr($trunkTimeSlotEntriesOid,0,strlen($trunkTimeSlotEntriesOid)-1); + //echo "trunkTimeSlotEntriesOid=$trunkTimeSlotEntriesOid
      "; + + //get the trunkTimeSlotEntries value + $oidWhere=getLevelWhere($trunkTimeSlotEntriesOid); + $sql="select readValue from OBJ_320.param_99 where $oidWhere and instanceNo='$instanceNo' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $trunkTimeSlotEntriesValue=$row[0]+0; + //echo "Entries={$row[0]} {$instanceNo}
      "; + + + //show the title + $split=explode(".",$instanceNo); + $tgno=$split[0]+0; + $tkno=$split[1]+0; + echo "MSC > Trunk Group $tgno > Trunk $tkno > Channel

      "; + + //set + if($_SERVER['REQUEST_METHOD'] == "POST") + { + echo "Set parameter...
      "; + //echo "trunkTimeSlotEntriesValue=$trunkTimeSlotEntriesValue"; + if($trunkTimeSlotEntriesValue==24) + $totalNum=25; + else if($trunkTimeSlotEntriesValue==32) + $totalNum=32; + for($i=1;$i<$totalNum;$i++) + { + $param="cb_".$i; + $value=$$param; + $index=0; + if($value=="on") + { + $newInstanceNo=$instanceNo.".".omc_keep_length($i,"0",4); + + $tmpWhere=getLevelWhere("2.4.3.1.4"); + $updateSql="UPDATE OBJ_320.param_99 SET initValue=$typeValue WHERE $tmpWhere AND instanceNo='$newInstanceNo'"; + mysqli_query($pubConn,$updateSql); + //echo "typeValue=$typeValue,updateSql=$updateSql

      "; + + /* + $commInfoArr[$index][sysId]=$sysId; + $commInfoArr[$index][oid]="2.4.3.1.4"; + $commInfoArr[$index][instanceNo]=$newInstanceNo; + $index++; + */ + $commIdStr=oidSysCommSend($sysId,3,"2.4.3.1.4",$selectedSysId=-1,$newInstanceNo); + //checkState($commIdStr,"./param_show_table.php?sysId=$sysId&tableOid=$tableOid&instanceNo=$instanceNo"); + //echo "set $newInstanceNo
      "; + + echo ""; + } + } + echo "
      "; + /* + if($index > 0) + { + setParam($commInfoArr); + } + */ + + echo "Close"; + exit(""); + } + + echo "

      "; + + echo "Type

      "; + + + + if($trunkTimeSlotEntriesValue==24) + $totalNum=25; + else if($trunkTimeSlotEntriesValue==32) + $totalNum=32; + echo ""; + echo ""; + echo ""; + echo ""; + //do not need time slot 0 + + for($i=1;$i<$totalNum;$i++) + { + $cbname="cb_".$i; + + $newInstanceNo=$instanceNo.".".omc_keep_length($i,"0",4); + $tmpWhere=getLevelWhere("2.4.3.1.4"); + $sql="select readValue from OBJ_320.param_99 where $tmpWhere and instanceNo='$newInstanceNo' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + + //do not set dchanal time slot + if($row[readValue] != 5) + { + echo ""; + echo ""; + echo ""; + } + } + echo "
      Select All Time Slots"; + echo "
      Time Slot-$i"; + echo "
      "; + + if($canwrite_flag) + echo "

      "; + else + echo "

      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "

      "; + + echo "Remark:
      "; +?> diff --git a/wxc2_omc/configuration/tabParamConfiguration/mscNITZ.php b/wxc2_omc/configuration/tabParamConfiguration/mscNITZ.php new file mode 100755 index 0000000..c65c1ec --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/mscNITZ.php @@ -0,0 +1,472 @@ + + + + +param_oid=$param_oid
      "; + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + echo "coding_scheme_select=$coding_scheme_select
      "; + echo "network_name_text=$network_name_text
      "; + echo "ci_select=$ci_select
      "; + echo "time_update_option_select=$time_update_option_select
      "; + echo "time_zone_select=$time_zone_select
      "; + + $network_name_7bit_vec=string8bitTo7bit($network_name_text); + $network_name_7bit_hexlen=sizeof($network_name_7bit_vec); + $network_name_7bit_hexlen=$global_len; + $network_name_7bit_hexstr=""; + for($i=0;$i<$network_name_7bit_hexlen;$i++) + { + $tmp=dechex($network_name_7bit_vec[$i]); + $tmp=omc_keep_length($tmp,0,2); + $network_name_7bit_hexstr.=$tmp; + } + $network_name_7bit_hexstr=omc_keep_length($network_name_7bit_hexstr,0,62,0); + $tmp=dechex($network_name_7bit_hexlen); + $tmp=omc_keep_length($tmp,0,2); + $last_hex_value=$tmp; + + $spare_bit_num=strlen($network_name_text)%8; + $byte3bin="1"; + if($coding_scheme_select == 0) + $byte3bin.="000"; + else + $byte3bin.="001"; + if($ci_select == 1) + $byte3bin.="1"; + else + $byte3bin.="0"; + + $spare_bit_num_bin=decbin($spare_bit_num); + $spare_bit_num_bin=omc_keep_length($spare_bit_num_bin,0,3); + $byte3bin.=$spare_bit_num_bin; + + $byte3hex=omc_keep_length(dechex(bindec($byte3bin)),0,2); + $last_hex_value.=$byte3hex; + $last_hex_value.=$network_name_7bit_hexstr; + + $time_update_option_hex=omc_keep_length(dechex($time_update_option_select),0,2); + $time_zone_hex=omc_keep_length(dechex($time_zone_select),0,2); + + $daylight_savetime_hex=omc_keep_length(dechex($daylight_savetime_select),0,2); + + $last_hex_value.=$time_update_option_hex; + $last_hex_value.=$time_zone_hex; + $last_hex_value.=$daylight_savetime_hex; + //echo "last_hex_value=$last_hex_value
      "; + $levels=getLevelWhere($param_oid); + $updSql = "UPDATE OBJ_320.param_99 SET initValue='$last_hex_value' WHERE $levels and instanceNo='$instanceNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + echo ""; + + echo "\n\n"; + +} + +$pubDb="OMC_PUB"; + +$mscTable="OBJ_320.param_99"; +$levels=getLevelWhere($param_oid); +$sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo"; +$res=mysqli_query($pubConn,$sql); +$rows=@mysqli_fetch_array($res); +$initValue=$rows[initValue]; +//$initValue="0484d4f29c0e0000000000000000000000000000000000000000000000000000000101"; +$readValue=$rows[readValue]; + + +//decode +$byte3=substr($initValue,2,2); +$byte3bin=decbin(hexdec($byte3)); +$coding_scheme_value=bindec(substr($byte3bin,1,3)); +$ci_value=bindec(substr($byte3bin,4,1)); +$spare_bit_num=bindec(substr($byte3bin,5,3)); +$network_name_len=hexdec(substr($initValue,0,2)); +$network_name_value=substr($initValue,4,$network_name_len*2); +$network_name_vec=string7bitTo8bit($network_name_value); +$network_name_l=$global_len; +if($spare_bit_num == 0 && $network_name_len != 0) + $network_name_l++; +//$network_name_l-=$network_name_l/8; + +$network_name_value=""; + +for($i=0;$i<$network_name_l;$i++) +{ + $network_name_value.=chr($network_name_vec[$i]); +} +//echo "network_name_value=$network_name_value,$network_name_l"; +//exit(); +$time_update_option_value=hexdec(substr($initValue,66,2)); +$time_zone_value=hexdec(substr($initValue,68,2)); + +$daylight_savetime_value=hexdec(substr($initValue,70,2)); + +/* +echo "coding_scheme_value=$coding_scheme_value
      "; +echo "ci_value=$ci_value
      "; +echo "network_name_len=$network_name_len,network_name_value=$network_name_value
      "; +echo "time_update_option_value=$time_update_option_value
      "; +echo "time_zone_value=$time_zone_value
      "; +*/ + +echo "
      "; +echo ""; + +//Coding Scheme +echo ""; +echo ""; +echo ""; +echo ""; + +//CI +echo ""; +echo ""; +echo ""; +echo ""; + +//Network name +echo ""; +echo ""; +echo ""; +echo ""; + +//Time update option +echo ""; +echo ""; +echo ""; +echo ""; + +//Time zone +echo ""; +echo ""; +echo ""; +echo ""; + +//Daylight Saving Time +echo ""; +echo ""; +echo ""; +echo ""; + + +echo "
      "; +echo "Coding Scheme"; +echo ""; +echo ""; +echo "
      "; +echo "Add CI"; +echo ""; +echo ""; +echo "
      Network Name"; +echo ""; +echo "
      "; +echo "Time Update Option"; +echo ""; +echo ""; +echo "
      "; +echo "Time Zone"; +echo ""; +echo ""; +echo "
      "; +echo "Daylight Saving Time"; +echo ""; +echo ""; +echo "
      "; + +echo "
      Remark:

      "; +echo "Network Identity and Time Zone

      "; +echo "- Coding Scheme: Indicate that 7-bit or UCS2 coding scheme is used.
      "; +echo "- Add CI: Indicate whether the MS should add the letters for the Country's Initials to the text string.
      "; +echo "- Network Name: A text string is to pass to the MS via NITZ.
      "; +echo "- Time Update Option: Determine whether time and time zone info is transferred to MS via NITZ.
      "; +echo "- Time Zone: Specify the local time zone.
      "; + +echo "
      "; +echo ""; +echo "  "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; + +$global_len=0; +function string8bitTo7bit($strin) +{ + global $global_len; + $len=strlen($strin); + if($len <= 0) + return ""; + + $global_len=$len-floor($len/8);; + + for($i=0;$i<$len;$i++) + { + $inHex[$i]=ord($strin[$i]); + switch($inHex[$i]) + { + //'@' + case 64: + $inHex[$i]=0x00; + break; + //'$' + case 36: + $inHex[$i]=0x02; + break; + //'_' + case 95: + $inHex[$i]=0x11; + break; + //'[' + case 91: + $inHex[$i]=0x28; + break; + //']' + case 93: + $inHex[$i]=0x29; + break; + //'/' + case 47: + $inHex[$i]=0x2f; + break; + //''' + case 96: + $inHex[$i]=0x27; + break; + //'{' + case 123: + $inHex[$i]=0x28; + break; + //'}' + case 125: + $inHex[$i]=0x29; + break; + case 0x82: + $inHex[$i]=0x05; + break; + case 0x85: + $inHex[$i]=0x7F; + break; + case 0x8A: + $inHex[$i]=0x04; + break; + case 0x8D: + $inHex[$i]=0x07; + break; + case 0x95: + $inHex[$i]=0x08; + break; + case 0x97: + $inHex[$i]=0x06; + break; + case 0x9D: + $inHex[$i]=0x03; + break; + default: + break; + } + } + + $n=0; + $index=0; + for($i=0;$i<=$len;$i++) + { + if($i<$len-1) + { + $mid1=$inHex[$i]+0; + $mid2=$inHex[$i+1]+0; + $cur=($mid1 >> $n) |(($mid2 << (7-$n)) & 0xff); + } + else + { + $mid1=$inHex[$i]; + $cur=($mid1 >> $n) & 0xff; + } + $outHex[$index++]=$cur; + echo "$cur "; + $n=($n+1)%7; + if($n==0 ) + $i++; + } + + + //for($i=0;$i<$index;$i++) + // $strout[$i]=chr($outHex[$i]); + + return $outHex; +} + +function string7bitTo8bit($strin) +{ + global $global_len; + + $len=strlen($strin); + + $ti=0; + for($i=0;$i<$len;$i+=2) + { + $tmp=substr($strin,$i,2); + $inHex[$ti]=hexdec($tmp); + $ti++; + } + + $global_len=$ti+floor($ti/8); + + + $n=0; + $j=0; + for($i=0;$i <= $ti;) + { + if($i>0) + { + $mid1=$inHex[$i]; + $mid2=$inHex[$i-1]; + $cur=(($mid1 << $n) & 0x7f) |($mid2 >> (8-$n)); + } + else + { + $mid1=$inHex[$i] & 0x7f; + $cur=$mid1; + } + $outHex[$j++] = $cur; + $n =($n+1)%8; + if($n!=0) + $i++; + } + + return $outHex; +} + +?> diff --git a/wxc2_omc/configuration/tabParamConfiguration/param_comm.inc b/wxc2_omc/configuration/tabParamConfiguration/param_comm.inc new file mode 100755 index 0000000..bef15a5 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/param_comm.inc @@ -0,0 +1,1541 @@ + + +"; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1) + { + echo " $strUninstalled
      "; + exit(); + } + } + else + { + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' + AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "sysIdSql(2) = $sysIdSql
      "; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1) + { + echo " $strUninstalled
      "; + exit(); + } + } +} + +function adjustTableName($name) +{ + $len=strlen($name); + $result=""; + + if($name[0]>='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + + if($len <= 4) + { + for($i = 1; $i < $len; $i++) + { + $result.=$name[$i]; + } + } + else + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} +function getOIDByRow($row) +{ + $oid=""; + for($i=1;$i<=10;$i++) + { + $level="level_".$i; + if($row[$level] == 0) + { + break; + } + else + { + $oid.=$row[$level]."."; + } + } + $oid=substr($oid,0,strlen($oid)-1); + return $oid; +} +function GetOIDByName($sysTypeNo,$name) +{ + global $objDbConn; + + $database="OBJ_".$sysTypeNo.".paramConf"; + $sql="select * from $database where name_2 like '%$name%' "; + + $res=@mysqli_query($objDbConn,$sql); + $row=@mysqli_fetch_array($res); + + $oids=""; + for($i=1;$i<=10;$i++) + { + $tmpN="level_".$i; + $tmpV=$row[$tmpN]+0; + if($tmpV == 0) + break; + + $oids.=$tmpV."."; + + } + + if($i>1) + $oids=substr($oids,0,strlen($oids)-1); + + return $oids; +} +function getShowNameOfTable($name,$keyId) +{ + global $objects; + + if($keyId != -1 && strstr($objects[$keyId]['desc_1'],"Name:")) + { + $new_name=explode("Name:",$objects[$keyId]['desc_1']); + return str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $len=strlen($name); + $result=""; + + if($name[0]>='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} +function getShowNameOfField($name,$keyId) +{ + global $objects; + + if($keyId != -1 && strstr($objects[$keyId]['desc_1'],"Name:")) + { + $new_name=explode("Name:",$objects[$keyId]['desc_1']); + return str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $len=strlen($name); + $result=""; + + for($j=0;$j<$len;$j++) + { + if($name[$j]>='A' && $name[$j]<='Z') + break; + } + for($i=$j;$i<$len;$i++) + { + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + return $result; +} +function translateValueToOpt($operType,$valueType,$template,$value) +{ + if(($operType == SHOW_LABEL || $operType == SHOW_SELECT) && $valueType == VALUE_INT) + { + if(trim($template) == "") + return $value; + $options=explode(";",$template); + for($ii=0;$ii$sql
      "; + $res=@mysqli_query($objDbConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return ""; + $row=@mysqli_fetch_array($res); + $findOid=""; + for($i=1;$i<=10;$i++) + { + if($row["level_".$i] == '0') + break; + $findOid.=$row["level_".$i]."."; + } + $findOid=substr($findOid,0,strlen($findOid)-1); + //PrintInfo("tableName=$tableName,dbtable=$dbtable,oid=$findOid"); + return $findOid; +} +?> + + 'parameter' order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + + //PPS do not need show fileOperation in the paramater + //if($sysTypeNo == 360) + // $sql="select * from OBJ_{$sysTypeNo}.paramConf where maxAccess=0 and name_2 <> 'parameter' and name_2 <> 'fileOperation' order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + $res=@mysqli_query($objDbConn,$sql); + + //$num=@mysqli_num_rows($res); + echo mysqli_error($objDbConn); + + if ($res) + { + $num=@mysqli_num_rows($res); + + } + else + { + exit(); + } + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $tabConf[$i][Name]=adjustTableName($row[name_2]); + $tabConf[$i][OID]=getOIDByRow($row); + + $checkoid=$tabConf[$i][OID].".1.1.0"; + $checkwhere=getLevelWhere($checkoid); + $checksql="select desc_2 from OBJ_{$sysTypeNo}.paramConf where $checkwhere"; + $checkres=@mysqli_query($objDbConn,$checksql); + $checknum=@mysqli_num_rows($checkres); + if($checknum == 1) + { + $checkrow=@mysqli_fetch_array($checkres); + $desc=$checkrow[desc_2]; + if(strstr($desc,"Name:")) + { + $new_name=explode("Name:",$desc); + $tabConf[$i][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + } + + } + if($num == 0) + return 0; + return $tabConf; +} +function GetSystemStatus($sysTypeNo,$sysNo,$subSysNo=0) +{ + $due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + $ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); + + $sql="select * from OMC_PUB.sysInfo where sysTypeNo=$sysTypeNo and sysNo=$sysNo and subSysNo=$subSysNo "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return 0; + + $row=@mysqli_fetch_array($res); + $baseStat=$row[baseStat]+0; + if($baseStat == 0) + return 0; + + $updateTime=$row[updateTime]; + if($updateTime < $due_date || $updateTime > $ove_date) + return 0; + + return 1; +} +function GetSubTabConf($sysTypeNo,$tabOid) +{ + $where=getLevelWhere($tabOid); + + + global $objDbConn; + $where=getLevelWhere($tabOid); + $sql="select * from OBJ_{$sysTypeNo}.paramConf where (maxAccess=0 and name_2 <> 'parameter' and $where) or (maxAccess=21 and name_2 like '%Entry' and $where) order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + + $res=@mysqli_query($objDbConn,$sql); + $num=@mysqli_num_rows($res); + //echo"num=$sql
      "; + + + $subTabConf[SubMenuCount]=0; + $subTabConf[ItemCount]=0; + $subTabConf[ScalarParamCount]=0; + $subTabConf[ScalarParamDisplayCount]=0; + $subTabConf[ColumnTableCount]=0; + $subTabConf[ButtonCount]=0; + $subTabConf[ScalarSetParamCount]=0; + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $desc=$row[desc_2]; + $maxAccess=$row[maxAccess]; + $name=$row[name_2]; + + if($maxAccess == 0) + { + $subTabConf[RawName]=$name; + $subTabConf[ShowName]=adjustTableName($name); + $where=getLevelWhere(getOIDByRow($row)); + $pos=1; + while($row["level_".$pos] != 0) + $pos++; + $pos++; + $sql="select * from OBJ_{$sysTypeNo}.paramConf where $where and level_{$pos}=0 and maxAccess >= 18 and maxAccess <= 19 order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + //echo "$sql
      "; + $param_res=@mysqli_query($objDbConn,$sql); + $subTabConf[ScalarParamCount]=@mysqli_num_rows($param_res); + for($j=0;$j<$subTabConf[ScalarParamCount];$j++) + { + $param_row=@mysqli_fetch_array($param_res); + + $subTabConf[ScalarParam][$j][ValueType]=$param_row[valueType]; + $subTabConf[ScalarParam][$j][OID]=getOIDByRow($param_row); + $subTabConf[ScalarParam][$j][MaxAccess]=$param_row[maxAccess]; + $subTabConf[ScalarParam][$j][RawName]=$param_row[name_2]; + $subTabConf[ScalarParam][$j][Tip]=$param_row[note_2]; + $subTabConf[ScalarParam][$j][Tip]=str_replace("'","\'",$subTabConf[ScalarParam][$j][Tip]); + if(strstr($param_row[desc_2],"Name:")) + { + $new_name=explode("Name:",$param_row[desc_2]); + $subTabConf[ScalarParam][$j][ShowName]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + else + { + $subTabConf[ScalarParam][$j][ShowName]=adjustTableName($subTabConf[ScalarParam][$j][RawName]); + } + + if(strstr($param_row[desc_2],"Hidden Parameter")) + { + $subTabConf[ScalarParam][$j][MaxAccess]=999; + } + else + { + if(stristr($param_row[name_2],"command")) + { + $subTabConf[ScalarParam][$j][MaxAccess]=999; + + $template=trim($param_row[setTemplate_2]); + $options=explode(";",$template); + for($ii=0;$ii"; + $showName=getShowNameOfTable($val,-1); + $subTabConf[Button][$subTabConf[ButtonCount]][OID]=$subTabConf[ScalarParam][$j][OID]; + $subTabConf[Button][$subTabConf[ButtonCount]][ShowName]=getShowNameOfTable($val,-1); + $subTabConf[Button][$subTabConf[ButtonCount]][Value]=$opt; + $subTabConf[ButtonCount]++; + } + + } + else + { + $subTabConf[ScalarParam][$j][GetFlag]=1; + $subTabConf[ScalarParamDisplayCount]++; + } + + + if($subTabConf[ScalarParam][$j][MaxAccess] == 19) + { + $subTabConf[ScalarParam][$j][SetFlag]=1; + $subTabConf[ScalarSetParamCount]++; + } + } + } + } + else + { + //echo "THIS IS $i ".$maxAccess; + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][SubMenuFlag]=0; + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][RawName]=$name; + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][OID]=getOIDByRow($row); + if(strstr($desc,"Name:")) + { + $new_name=explode("Name:",$desc); + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][ShowName]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + else + { + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][ShowName]=adjustTableName($subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][RawName]); + } + + if(strstr($row[desc_2],"level:2")) + { + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][TableLevel]=2; + } + else if(strstr($row[desc_2],"level:3")) + { + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][TableLevel]=3; + } + else + { + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][TableLevel]=1; + $subTabConf[ColumnTable][$subTabConf[ColumnTableCount]][SubMenuFlag]=1; + $subTabConf[SubMenuCount]++; + } + $subTabConf[ColumnTableCount]++; + } + + $subTabConf[ItemCount]++; + } + return $subTabConf; +} + +function GetSingleParameterInfo($sysId,$oid) +{ + global $OMC_server; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],'OBJ_'.$sysTypeNo); + + $where=getLevelWhere($oid); + + $sql="select * from OBJ_{$sysTypeNo}.paramConf where {$where}; "; + $res=@mysqli_query($objDbConn,$sql); + $num=@mysqli_num_rows($res); + if($num == 0) + { + echo "can not find this parameter $oid
      "; + return; + } + $row=@mysqli_fetch_array($res); + $singleParameterInfo[ShowName]=getShowNameOfField($row[name_2],-1); + + if(strstr($row[desc_2],"Name:")) + { + $new_name=explode("Name:",$row[desc_2]); + $singleParameterInfo[ShowName]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $singleParameterInfo[Description]=str_replace("'","\'",$row[note_2]); + return $singleParameterInfo; +} + +function GetSingleTableInfo($singleTabConf,$sysTypeNo) +{ + + global $pubConn,$objDbConn; + //echo $singleTabConf[OID]; + $where=getLevelWhere($singleTabConf[OID]); + $sql="select * from OBJ_{$sysTypeNo}.paramConf where $where order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + //echo "sql=$sql
      "; + $res=@mysqli_query($objDbConn,$sql); + $num=@mysqli_num_rows($res); + //echo "num=$num"; + $singleTabInfo[ColumnParamCount]=0; + $singleTabInfo[ColumnParamSetCount]=0; + $singleTabInfo[ButtonCount]=0; + $singleTabInfo[TableLevel]=$singleTabConf[TableLevel]; + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $name=$row[name_2]; + $desc=$row[desc_2]; + if(strstr($name,"Entry") && !strstr($name,"Create")) + { + $singleTabInfo[TableEntryOID]=getOIDByRow($row); + } + else + { + if(strstr($name,"Index")) + { + $singleTabInfo[TableIndexPos]=$singleTabInfo[ColumnParamCount]; + if($singleTabInfo[TableLevel] == 1) + { + if($row[maxAccess] == 48) + { + $singleTabInfo[CreateOID]=getOIDByRow($row); + } + } + else + { + $tableName=str_replace("Entry","",$singleTabConf[RawName]); + $singleTabInfo[CreateOID]=findRelationOid($tableName,TABLE_CREATE,$sysTypeNo); + //find the field need update when create + $singleTabInfo[CreateUpdateOID]=findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo); + } + } + else if(strstr($name,"RowStatus")) + { + $singleTabInfo[TableDeletePos]=$singleTabInfo[ColumnParamCount]; + if(strstr($desc,"Key Parameter")) + { + $singleTabInfo[DeleteOID]=getOIDByRow($row); + if($singleTabInfo[TableLevel] != 1) + { + $tableName=str_replace("Entry","",$singleTabConf[RawName]); + //find the field need update when delete + $singleTabInfo[DeleteUpdateOID]=findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo); + } + } + } + else if(strstr($name,"Entries")) + { + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][EntriesFlag]=1; + //find the sub table entry oid + $len=strlen($name); + for($tpi=0;$tpi<$len;$tpi++) + { + if(!($name[$tpi] >= 'a' && $name[$tpi] <= 'z')) + break; + } + $tableName=substr($name,$tpi); + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][NestEntryOID]=findRelationOid($table,TABLE_ENTRY,$sysTypeNo); + } + + if(strstr($desc,"Key Parameter")) + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][KeyFlag]=1; + else + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][KeyFlag]=0; + + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][RawName]=$name; + if(strstr($desc,"Name:")) + { + $new_name=explode("Name:",$desc); + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][ShowName]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + else + { + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][ShowName]=getShowNameOfField($name,-1); + } + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][MaxAccess]=$row[maxAccess]; + if($row[maxAccess] == 19) + $singleTabInfo[ColumnParamSetCount]++; + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][OperType]=$row[operType]; + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][ValueType]=$row[valueType]; + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][OID]=getOIDByRow($row); + $tmpsp=explode(".",$singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][OID]); + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][LastOID]=$tmpsp[count($tmpsp)-1]; + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][Description]=$row[desc_2]; + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][Tip]=str_replace("'","\'",$row[note_2]); + $singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][Template]=$row[setTemplate_2]; + + //get command Button + if(stristr($name,"command")) + { + + $template=trim($row[setTemplate_2]); + $options=explode(";",$template); + for($ii=0;$ii"; + $showName=getShowNameOfTable($val,-1); + $singleTabInfo[Button][$singleTabInfo[ButtonCount]][OID]=$singleTabInfo[ColumnParam][$singleTabInfo[ColumnParamCount]][OID]; + $singleTabInfo[Button][$singleTabInfo[ButtonCount]][ShowName]=getShowNameOfTable($val,-1); + $singleTabInfo[Button][$singleTabInfo[ButtonCount]][Value]=$opt; + $singleTabInfo[ButtonCount]++; + } + + } + + $singleTabInfo[ColumnParamCount]++; + } + } + + return $singleTabInfo; +} +function getTableLevel($tableOid,$sysTypeNo) +{ + $tableWhere=getLevelWhere($tableOid); + $database="OBJ_".$sysTypeNo.".paramConf"; + $sql="select desc_1 from $database where $tableWhere "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $desc_1=$row[desc_1]; + $tmp=explode("level:",$desc_1); + $level=$tmp[1]+0; + return $level; +} + +function showNavigateTitle($table_id,$sub_table_id,$table_level,$sysId,$columnTable,$instanceNo,$type) +{ + + global $pubConn,$objDbConn; + if(0) + { + echo "table_id=$table_id,sub_table_id=$sub_table_id,table_level=$table_level,instanceNo=$instanceNo,type=$type
      "; + echo "This tableName={$columnTable[$sub_table_id][Name]}
      "; + } + + if(0) + { + echo "
      ";
      +		print_r($columnTable);
      +		echo "
      "; + } + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $table_count=count($columnTable); + if($table_level == 1) + { + if($type == "show") + { + + echo "{$columnTable[$sub_table_id][ShowName]}"; + } + else if($type == "edit") + { + echo ""; + echo "{$columnTable[$sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + echo ""; + echo ($instanceNo+0); + echo ""; + } + else + { + echo ""; + echo "{$columnTable[$sub_table_id][ShowName]}"; + echo ""; + } + } + else if($table_level == 2) + { + //get last table sub_table_id + //echo "sub_table_id=$sub_table_id,{$columnTable[$sub_table_id][Name]}
      "; + $tableName=str_replace(" ","",$columnTable[$sub_table_id][Name]); + $oid=trim(findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo)); + $lastdotpos=strrpos($oid,"."); + $newoid=substr($oid,0,$lastdotpos); + $where=getLevelWhere($newoid); + $sql="select name_2 from OBJ_{$sysTypeNo}.paramConf where $where AND name_2 like '%Entry' "; + //echo ":sql=$sql"; + $res=@mysqli_query($objDbConn,$sql); + $num=@mysqli_num_rows($res); + //echo "num222=$sql
      "; + $row=@mysqli_fetch_array($res); + // echo "
      ";
      +		// print_r($row);
      +		// echo "
      "; + $newname=str_replace("Entry","",$row[name_2]); + //echo "name_2=$newname
      "; + + for($i=0;$i<$table_count;$i++) + { + //echo "$newname+{$columnTable[$i][Name]}
      "; + if(strcasecmp($newname,str_replace(" ","",$columnTable[$i][Name])) == 0) + { + $l1_sub_table_id=$i; + break; + } + } + + if($type == "show") + { + + echo ""; + echo "{$columnTable[$l1_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + echo ""; + echo ($instanceNo+0); + echo ""; + + echo " > "; + echo "{$columnTable[$sub_table_id][ShowName]}"; + } + else if($type == "edit") + { + echo ""; + echo "{$columnTable[$l1_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + echo ""; + echo "{$columnTable[$sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[1]+0); + echo ""; + } + else + { + echo ""; + echo "{$columnTable[$l1_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + echo ""; + echo "{$columnTable[$sub_table_id][ShowName]}"; + echo ""; + } + } + else if($table_level == 3) + { + //get last table sub_table_id + $tableName=str_replace(" ","",$columnTable[$sub_table_id][Name]); + $oid=trim(findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo)); + $lastdotpos=strrpos($oid,"."); + $newoid=substr($oid,0,$lastdotpos); + $where=getLevelWhere($newoid); + $sql="select name_2 from OBJ_{$sysTypeNo}.paramConf where $where "; + $res=@mysqli_query($objDbConn,$sql); + $row=@mysqli_fetch_array($res); + $newname=str_replace("Entry","",$row[name_2]); + for($i=0;$i<$table_count;$i++) + { + if(strcasecmp($newname,str_replace(" ","",$columnTable[$i][Name])) == 0) + { + $l1_sub_table_id=$i; + break; + } + } + + //get last table sub_table_id + $tableName=str_replace(" ","",$newname); + $oid=trim(findRelationOid($tableName,TABLE_ENTRIES,$sysTypeNo)); + $lastdotpos=strrpos($oid,"."); + $newoid=substr($oid,0,$lastdotpos); + $where=getLevelWhere($newoid); + $sql="select name_2 from OBJ_{$sysTypeNo}.paramConf where $where "; + $res=@mysqli_query($objDbConn,$sql); + $row=@mysqli_fetch_array($res); + $newname=str_replace("Entry","",$row[name_2]); + for($i=0;$i<$table_count;$i++) + { + if(strcasecmp($newname,str_replace(" ","",$columnTable[$i][Name])) == 0) + { + $l2_sub_table_id=$i; + break; + } + } + + if($type == "show") + { + echo ""; + echo "{$columnTable[$l2_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[$l1_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[1]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[$sub_table_id][ShowName]}"; + echo ""; + } + else if($type == "edit") + { + echo ""; + echo "{$columnTable[$l2_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[$l1_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[1]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[$sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[2]+0); + echo ""; + } + else + { + echo ""; + echo "{$columnTable[$l2_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[$l1_sub_table_id][ShowName]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[1]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[$sub_table_id][ShowName]}"; + echo ""; + } + } + + //echo "l1_sub_table_id=$l1_sub_table_id,l2_sub_table_id=$l2_sub_table_id
      "; + + +} + +function getParamValue($sysId,$oid,$instanceNo) +{ + global $objDbConn; + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + $subSysNo=$sysIdArr[2]; + $objDb='OBJ_'.$sysTypeNo; + $paraConfTable=$objDb.'.paramConf'; + + + + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + $oidWhere=getLevelWhere($oid); + + if(strstr($instanceNo,".")) + $sql="select initValue from $paraTable where $oidWhere and instanceNo='$instanceNo' "; + else + $sql="select initValue from $paraTable where $oidWhere and instanceNo=$instanceNo "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.="and subSysNo='$subSysNo' "; + + $res=@mysqli_query($objDbConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return "--"; + + $row=@mysqli_fetch_array($res); + $originalValue=$row[initValue]; + + return $originalValue; +} +function DeleteSubTableData($sysTypeNo,$instanceNo,$tableOid,$paraTable) +{ + global $objDbConn; + //echo "DeleteSubTableData($sysTypeNo,$instanceNo,$tableOid,$paraTable)
      "; + $where=getLevelWhere($tableOid); + $sql="delete from $paraTable where $where and instanceNo like '{$instanceNo}%'"; + @mysqli_query($objDbConn,$sql); + //echo "$sql"; + $where=getLevelWhere($tableOid); + $table="OBJ_{$sysTypeNo}.paramConf"; + $sql="select * from $table where name_2 like '%Entries' and $where "; + $res=@mysqli_query($objDbConn,$sql); + $num=mysqli_num_rows($res); + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $entriesName=$row[name_2]; + $len=strlen($entriesName); + for($j=0;$j<$len;$j++) + { + if($entriesName[$j]<'a'||$entriesName[$j]>'z') + break; + } + $entriesName=substr($entriesName,$j); + $entriesName=str_replace("Entries","",$entriesName); + $entryoid=findRelationOid($entriesName,TABLE_ENTRY,$sysTypeNo); + + DeleteSubTableData($sysTypeNo,$instanceNo,$entryoid,$paraTable); + } +} +function GetAllRowData($singleTabInfo,$paraTable,$instanceNo,$sysId) +{ + global $pubConn,$objDbConn; + if (isset($sysId)) + { + + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + $subSysNo=$sysIdArr[2]; + // echo "sysTypeNo=$subSysNo
      "; + + } + // echo "
      ";
      +		// print_r($singleTabInfo);
      +		// echo "
      "; + //echo "$singleTabInfo,$paraTable,$instanceNo"; + if($singleTabInfo[TableLevel] == 1) + $instanceCond=" LENGTH(instanceNo)=4 "; + else if($singleTabInfo[TableLevel] == 2) + $instanceCond=" LENGTH(instanceNo)=9 and instanceNo like '{$instanceNo}.%' "; + else if($singleTabInfo[TableLevel] == 3) + $instanceCond=" LENGTH(instanceNo)=14 and instanceNo like '{$instanceNo}.%' "; + + $oidwhere=getLevelWhere($singleTabInfo[TableEntryOID]); + + $sql="select * from $paraTable where $oidwhere and {$instanceCond} "; + //echo "checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)"; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + { + $sql.=" AND subSysNo='$subSysNo' "; + } + //echo "SSS=$sql
      "; + + $res=@mysqli_query($objDbConn,$sql); + $num=@mysqli_num_rows($res); + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $oid=getOIDByRow($row); + $fieldIndex=sizeof(explode(".",$oid)); + $fieldPos=$row["level_".$fieldIndex]+0; + $instanceValue=substr($row[instanceNo],strlen($row[instanceNo])-4,4)+0; + $showObject[$instanceValue][$fieldPos]=$row[initValue]; + } + + + return $showObject; +} +define(GET_OID,0); +define(SCALAR_ITEM_OID,1); +function GetAllOIDArr($sysTypeNo,$get_type=0) +{ + global $objDbConn; + $tabConf=GetTabConf($sysTypeNo); + if(0) + { + echo "
      ";
      +		print_r($tabConf);
      +		echo "
      "; + } + $tab_id_count=sizeof($tabConf); + for($table_id=0;$table_id<$tab_id_count;$table_id++) + { + $tableOid=$tabConf[$table_id][OID]; + //Get the sub oid of the table + $oidwhere=getLevelWhere($tableOid); + $size=sizeof(explode(".",$tableOid)); + $oidwhere.=" AND level_".($size+1).">0 "; + $lastlevel="level_".($size+2); + $sql="select * from OBJ_{$sysTypeNo}.paramConf where $oidwhere order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + //echo "$sql
      "; + $res=@mysqli_query($objDbConn,$sql); + $num=@mysqli_num_rows($res); + + $scalarTableIndex=0; + $columnTableIndex=0; + $scalarItemIndex=0; + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + if($row[$lastlevel] == 0) + { + //scalar table + if($row[maxAccess] == ACCESS_TABLE_NAME && $row[operType] == 2) + { + $scalarTableIndex++; + } + //column table + else if($row[maxAccess] == ACCESS_ENTRY && strstr($row[name_2],"Table")) + { + //only get the top two level table + $tmpoid=getOIDByRow($row).".1"; + $tablelevel=getTableLevel($tmpoid,$sysTypeNo); + if($tablelevel < 3) + $oidArr[]=$tmpoid; + $columnTableIndex++; + } + //scalar item + else + { + $scalarItemIndex++; + if(stristr($row[name_2],"Command")) + continue; + if($row[maxAccess] == ACCESS_ENTRY) + continue; + if(strstr($row['desc_2'],"Hidden Parameter")) + continue; + $tmpss=getOIDByRow($row); + $oidArr[]=$tmpss; + $scalar_oids[]=$tmpss; + } + } + } + } + + if($get_type == SCALAR_ITEM_OID) + return $scalar_oids; + else + return $oidArr; +} +/* + This function is for the special issue of getting msc timeslot + Get the timeslot parameter from plat which the Group ID specify in trunk +*/ +function GetTrunkGroupID($tgno,$trunkno) +{ + global $OMC_server; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], 'OBJ_'.$sysTypeNo); + + $trunk_table_oid=GetOIDByName(SYSTYPENO_MSC,"trunkEntry"); + + $tgno_w=omc_keep_length($tgno,"0",4); + $trunkno_w=omc_keep_length($trunkno,"0",4); + $instance=$tgno_w.".".$trunkno_w; + + oidSysCommSend("320_99_99", 0, $trunk_table_oid, -1, $instance); + + $trunkGroupID_oid=GetOIDByName(SYSTYPENO_MSC,"trunkGroupID"); + $oidWhere=getLevelWhere($trunkGroupID_oid); + + $sql="select * from OBJ_320.param_99 where $oidWhere and instanceNo= '$instance' "; + $res=@mysqli_query($objDbConn,$sql); + $row=@mysqli_fetch_array($res); + $value=$row[readValue]+0; + + return $value; +} +function BubbleOrder($showObject,$order,$ascFlag) +{ + + //bubble order + $objectCount=sizeof($showObject); + if($objectCount == 0) + return $showObject; + $instance_list_num=0; + foreach($showObject as $instance => $obj) + { + //echo "instance_list_num=$instance
      "; + $instance_list[]=$instance; + $instance_list_num++; + + + } + + for($i=0;$i<$instance_list_num;$i++) + { + for($j=$i;$j<$instance_list_num;$j++) + { + $index1=$instance_list[$i]; + $index2=$instance_list[$j]; + if($ascFlag) + { + if($showObject[$index1][$order] > $showObject[$index2][$order]) + { + //echo "$order index1=$index1,{$showObject[$index1][$order]},index2=$index2,{$showObject[$index2][$order]}
      "; + $tmp=$showObject[$index1]; + $showObject[$index1]=$showObject[$index2]; + $showObject[$index2]=$tmp; + } + } + else + { + if($showObject[$index1][$order] < $showObject[$index2][$order]) + { + //echo "$order index1=$index1,{$showObject[$index1][$order]},index2=$index2,{$showObject[$index2][$order]}
      "; + $tmp=$showObject[$index1]; + $showObject[$index1]=$showObject[$index2]; + $showObject[$index2]=$tmp; + } + } + } + } + + return $showObject; +} + +function InitTab($sysTypeNo) +{ + echo "\n\n"; +} +$previous_left=20; +function AddTab($id,$value,$lable,$image_1,$image_2,$imageWidth,$imageHeight) +{ + global $previous_left; + echo ""; + echo "{$lable}"; + + echo ""; + echo "{$lable}"; + + echo "\n\n"; +} + +?> diff --git a/wxc2_omc/configuration/tabParamConfiguration/param_edit.php b/wxc2_omc/configuration/tabParamConfiguration/param_edit.php new file mode 100755 index 0000000..75f3a7d --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/param_edit.php @@ -0,0 +1,813 @@ + + + + + +"; +//***** +$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +if (!isset($batch_num)) $batch_num=$_REQUEST['batch_num']; +if (!isset($needBatch)) $needBatch=$_REQUEST['needBatch']; + +if (!isset($create)) $create=$_REQUEST['create']; +if (!isset($sysId)) $sysId=$_REQUEST['sysId']; +if (!isset($table_id)) $table_id=$_REQUEST['table_id']; +if (!isset($sub_table_id)) $sub_table_id=$_REQUEST['sub_table_id']; +if (!isset($instanceNo)) $instanceNo=$_REQUEST['instanceNo']; +if (!isset($createOid)) $createOid=$_REQUEST['createOid']; +if (!isset($updateOid)) $updateOid=$_REQUEST['updateOid']; +if (!isset($oldtableOid)) $oldtableOid=$_REQUEST['oldtableOid']; +if (!isset($table_level)) $table_level=$_REQUEST['table_level']; +if (!isset($createIndex)) $createIndex=$_REQUEST['createIndex']; + + + + + +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +if(0) +{ + echo "sysId=$sysId
      "; + echo "table_id=$table_id
      "; + echo "sub_table_id=$sub_table_id
      "; + echo "table_level=$table_level
      "; + echo "instanceNo=$instanceNo
      "; +} +echo "
      "; +echo ""; +echo ""; + +$realcreate = $_REQUEST['realcreate']; +$createMethod = $_REQUEST['createMethod']; +$createIndex = $_REQUEST['createIndex']; +$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$objDb); +$sysIdArr=explode('_',$sysId); +$sysTypeNo=$sysIdArr[0]; +$sysNo=$sysIdArr[1]; +$subSysNo=$sysIdArr[2]; +$objDb='OBJ_'.$sysTypeNo; +$paraConfTable=$objDb.'.paramConf'; +$pubDb='OMC_PUB'; +if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; +else + $paraTable=$objDb.".param_99"; + +$tabConf=GetTabConf($sysTypeNo); +$tableOid=$tabConf[$table_id][OID]; +$subTabConf=GetSubTabConf($sysTypeNo,$tableOid); +$singleTabConf=$subTabConf[ColumnTable][$sub_table_id]; +$singleTabInfo=GetSingleTableInfo($singleTabConf,$sysTypeNo); + +$sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' "; +$res=@mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); + //print_r($row); +$module_name=$row[sysTypeName]; +if(0) +{ + echo "
      ";
      +	print_r($singleTabInfo);
      +	echo "
      "; +} + +//Get the columnTable conf +$oidwhere=getLevelWhere($tableOid); +$size=sizeof(explode(".",$tableOid)); +$oidwhere.=" AND level_".($size+1).">0 "; +$lastlevel="level_".($size+2); +$sql="select * from $paraConfTable where $oidwhere order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; +$res=@mysqli_query($objDbConn,$sql); +$num=@mysqli_num_rows($res); + +$scalarTableIndex=0; +$columnTableIndex=0; +$scalarItemIndex=0; +$scalarItemReadCount=0; +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + if($row[$lastlevel] == 0) + { + if($row[maxAccess] == ACCESS_ENTRY && strstr($row[name_2],"Table")) + { + $columnTable[$columnTableIndex][Name]=adjustTableName($row[name_2]); + $columnTable[$columnTableIndex][OID]=getOIDByRow($row); + $columnTable[$columnTableIndex][ShowName]=$columnTable[$columnTableIndex][Name]; + if(strstr($row[desc_2],"Name:")) + { + $new_name=explode("Name:",$row[desc_2]); + $columnTable[$columnTableIndex][ShowName]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $columnTableIndex++; + } + } +} + + +if(0) +{ + echo "
      ";
      +	print_r($columnTable);
      +	echo "
      "; +} + +if((($subTabConf[ButtonCount] > 0 || $subTabConf[ScalarParamDisplayCount] > 0) && $subTabConf[SubMenuCount] > 0) || ($subTabConf[ButtonCount] == 0 && $subTabConf[ScalarParamDisplayCount] == 0 && $subTabConf[SubMenuCount] > 1)) +{ + if($subTabConf[ButtonCount] > 0 || $subTabConf[ScalarParamDisplayCount] > 0) + { + if($sub_table_id == 999) + echo ""; + else + echo ""; + echo " {$subTabConf[ShowName]} "; + echo ""; + } + for($i=0;$i<$subTabConf[ColumnTableCount];$i++) + { + if($subTabConf[ColumnTable][$i][SubMenuFlag] == 1) + { + if($i == $sub_table_id) + echo ""; + else + echo ""; + echo " {$subTabConf[ColumnTable][$i][ShowName]} "; + echo ""; + } + } + echo "
      "; +} + +//************************* Operation ******************************* +if($_SERVER['REQUEST_METHOD'] == "POST") + +{ + echo "
      "; + $DEBUG = 0; + $get = $_REQUEST['get']; + $set = $_REQUEST['set']; + $lock = $_REQUEST['lock']; + $unlock = $_REQUEST['unlock']; + $podUpdateToPod = $_REQUEST['podUpdateToPod']; + if($_REQUEST['get']) + { + //Get the timeslot parameter from the plat(trunk group id) + $timeslot_table_oid=GetOIDByName(SYSTYPENO_MSC,"channelEntry"); + if($sysTypeNo == SYSTYPENO_MSC && $singleTabInfo[TableEntryOID] == $timeslot_table_oid) + { + $tmps=explode(".",$instanceNo); + $grounp_id=GetTrunkGroupID($tmps[0]+0,$tmps[1]+0); + if($grounp_id == 1) + $tmpSysId="320_1_0"; + else + $tmpSysId="320_0_0"; + + if(!GetSystemStatus(SYSTYPENO_MSC,$grounp_id)) + $tmpSysId="320_99_99"; + + $commIdStr=oidSysCommSend($tmpSysId,0,$singleTabInfo[TableEntryOID],-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); + } + else + { + $commIdStr=oidSysCommSend($sysId,0,$singleTabInfo[TableEntryOID],-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); + } + } + else if($_REQUEST['set']) + { + $commIdStr=oidSysCommSend($sysId,3,$singleTabInfo[TableEntryOID],-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo&need_get_again=1&get=1&getTableOid=$getTableOid"); + } + else if($_REQUEST['lock'] || $_REQUEST['unlock']) + { + $adminStatOid = $_REQUEST['adminStatOid']; + //echo $adminStatOid; + $tmpWhere=getLevelWhere($adminStatOid); + if($_REQUEST['lock']) + $initValue=0; + else + $initValue=1; + + $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo='{$instanceNo}' "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $updateSql.="and subSysNo='$subSysNo' "; + + mysqli_query($objDbConn,$updateSql); + //echo "oidSysCommSend($sysId,3,$adminStatOid,-1,$instanceNo)"; + $commIdStr=oidSysCommSend($sysId,3,$adminStatOid,-1,$instanceNo); + + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); + } + else if($_REQUEST['podUpdateToPod']) + { + $tmpWhere=getLevelWhere($podUpdateToPodOid); + //if($lock) + $initValue=1; + //else + // $initValue=1; + + $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo='{$instanceNo}' "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $updateSql.="and subSysNo='$subSysNo' "; + + mysqli_query($objDbConn,$updateSql); + $commIdStr=oidSysCommSend($sysId,3,$podUpdateToPodOid,-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); + } + else if($_REQUEST['buttonOptFlag']) + { + //echo "button_oid=$button_oid,button_value=$button_value
      "; + $tmpWhere=getLevelWhere($button_oid); + $initValue=$button_value; + $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo='{$instanceNo}' "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $updateSql.="and subSysNo='$subSysNo' "; + + mysqli_query($objDbConn,$updateSql); + $commIdStr=oidSysCommSend($sysId,3,$button_oid,-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); + } +} + +//Oper batch add +if($needBatch){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $oldInstanceNo=$instanceNo; + for($k=0;$k<$batch_num;$k++) + { + + usleep(200000); // 0.2 sec + if($singleTabInfo[TableLevel] == 1) + { + $createInstanceNo=omc_keep_length($createIndex,'0',4); + $instanceNo=$createInstanceNo; + } + else + { + $createInstanceNo=$instanceNo.".".omc_keep_length($createIndex,'0',4); + $instanceNo=$createInstanceNo; + } + + if($createMethod == AUTO_CREATE) + $createIndex=1; + $sql="replace into $paraTable set initValue='$createIndex',readValue='',instanceNo='$createInstanceNo'"; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.=",subSysNo='$subSysNo' "; + + $indexOidArr=explode(".",$createOid); + for($i=0;$i"; + mysqli_query($objDbConn,$sql); + mysqli_error($objDbConn); + //send create command + $commIdStr=oidSysCommSend($sysId,9,$createOid,-1,$createInstanceNo); + + if($createMethod == AUTO_CREATE) + { + $indexLevelWhere=getLevelWhere($createOid); + $indexSql="select * from $paraTable where $indexLevelWhere and instanceNo='$createInstanceNo' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $indexSql.="and subSysNo='$subSysNo' "; + + $indexres=@mysqli_query($objDbConn,$indexSql); + $indexrow=@mysqli_fetch_array($indexres); + $newIndex=$indexrow[readValue]+0; + + $newInstanceNo=omc_keep_length($newIndex,'0',4); + if($singleTabInfo[TableLevel] == 1) + $instanceNo=$newInstanceNo; + else + $instanceNo=$oldInstanceNo.".".$newInstanceNo; + //echo "oldInstanceNo=$oldInstanceNo,newIndex=$newIndex,instanceNo=$instanceNo
      "; + } + //update the entries + if(trim($updateOid)!="") + { + $commIdStr=oidSysCommSend($sysId,0,$updateOid,-1,$oldInstanceNo); + } + + //get the table + if($oldInstanceNo=="0000" && $singleTabInfo[TableLevel] == 1) + { + $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,""); + + } + else{ + $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,$oldInstanceNo); + + } + } + //send table Get Button + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + ?> + + "; + //echo "createIndex=$createIndex,createOid=$createOid,updateOid=$updateOid,indexOid=$indexOid,tableOid=$tableOid
      "; + $oldInstanceNo=$instanceNo; + if($singleTabInfo[TableLevel] == 1) + { + $createInstanceNo=omc_keep_length($createIndex,'0',4); + $instanceNo=$createInstanceNo; + } + else + { + $createInstanceNo=$instanceNo.".".omc_keep_length($createIndex,'0',4); + $instanceNo=$createInstanceNo; + } + + if($createMethod == AUTO_CREATE) + $createIndex=1; + $sql="replace into $paraTable set initValue='$createIndex',readValue='',instanceNo='$createInstanceNo'"; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.=",subSysNo='$subSysNo' "; + + $indexOidArr=explode(".",$createOid); + for($i=0;$i"; + mysqli_query($objDbConn,$sql); + mysqli_error($objDbConn); + //send create command + $commIdStr=oidSysCommSend($sysId,9,$createOid,-1,$createInstanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); + + if($createMethod == AUTO_CREATE) + { + $indexLevelWhere=getLevelWhere($createOid); + $indexSql="select * from $paraTable where $indexLevelWhere and instanceNo='$createInstanceNo' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $indexSql.="and subSysNo='$subSysNo' "; + + $indexres=@mysqli_query($objDbConn,$indexSql); + $indexrow=@mysqli_fetch_array($indexres); + $newIndex=$indexrow[readValue]+0; + + $newInstanceNo=omc_keep_length($newIndex,'0',4); + if($singleTabInfo[TableLevel] == 1) + $instanceNo=$newInstanceNo; + else + $instanceNo=$oldInstanceNo.".".$newInstanceNo; + //echo "oldInstanceNo=$oldInstanceNo,newIndex=$newIndex,instanceNo=$instanceNo
      "; + } + + + //update the entries + if(trim($updateOid)!="") + { + $commIdStr=oidSysCommSend($sysId,0,$updateOid,-1,$oldInstanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); + } + + //get the table + if($oldInstanceNo=="0000" && $singleTabInfo[TableLevel] == 1) + $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,""); + else + $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,$oldInstanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); + +} + +//PPS COS table +if($sysTypeNo == SYSTYPENO_PPS && $table_id == 1 && $realcreate == 1) +{ + echo "\n\n"; +} + +echo "
      "; +if($create) + showNavigateTitle($table_id,$sub_table_id,$table_level,$sysId,$columnTable,$instanceNo,"create"); +else + showNavigateTitle($table_id,$sub_table_id,$table_level,$sysId,$columnTable,$instanceNo,"edit"); +echo "
      "; +if(!$create || $_SERVER['REQUEST_METHOD'] == "POST") + echo "
      "; +if($create) +{ + echo "
      "; + //echo "table_level=$table_level,instanceNo=$instanceNo,createOid=$createOid,updateOid=$updateOid,indexOid=$indexOid,tableOid=$tableOid
      "; + $createwhere=getLevelWhere($createOid); + $createsql="select * from $paraConfTable where $createwhere "; + $createres=@mysqli_query($objDbConn,$createsql); + $createnum=@mysqli_num_rows($createres); + //echo "sql=$createsql"; + if($createnum == 0) + exit("Can not find the create index $createOid"); + $createrow=@mysqli_fetch_array($createres); + $auto=0; + if(strstr($createrow[setTemplate_2],"create=1")) + $auto=1; + + $minValue=$createrow[minValue]+0; + $maxValue=$createrow[maxValue]+0; + echo "
      "; + echo ""; + echo ""; + if($auto) + { + //MSC-tg-trunk + if($createOid=='2.4.1.1.34'){ + echo ""; + echo ""; + echo ""; + echo "
      Batch Num:
      "; + echo "  "; + + }else{ + echo "Index is assigned by $module_name"; + echo ""; + echo ""; + echo ""; + echo "  "; + } + + } + else + { + //echo "tmpwhere=$indexOid"; + $tmpwhere=getLevelWhere($_REQUEST['indexOid']); + + //echo "instanceNo=$instanceNo"; + if($instanceNo != "0000") + $sql="select initValue from $paraTable where $tmpwhere and instanceNo like '$instanceNo.%' "; + else + $sql="select initValue from $paraTable where $tmpwhere "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.="and subSysNo='$subSysNo' "; + //echo "$sql
      "; + $res=@mysqli_query($objDbConn,$sql); + // $test=@mysqli_fetch_array($res); + // echo $test; + // print_r($test); + while($row=@mysqli_fetch_array($res)) + $index_use_flags[$row[initValue]+0]=1; + + echo "Please input the index No."; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if($no_use_count == 0) + { + echo ""; + echo "

      "; + echo "
      "; + echo "Note: The table is full"; + echo "
      "; + } + else + { + echo ""; + } + } + + exit(); +} + + + +//************************** Show *********************************** + +//show the edit table +echo ""; +for($i=0;$i<$singleTabInfo[ColumnParamCount];$i++) +{ + if($singleTabInfo[ColumnParam][$i][MaxAccess] == ACCESS_ENTRY) + continue; + if(strstr($singleTabInfo[ColumnParam][$i][RawName],"RowStatus")) + continue; + if(strstr($singleTabInfo[ColumnParam][$i][RawName],"CreateEntry")) + continue; + if(strstr($singleTabInfo[ColumnParam][$i][RawName],"Command")) + continue; + + echo ""; + echo ""; + echo ""; +} +echo "
      "; + echo "{$singleTabInfo[ColumnParam][$i][ShowName]}"; + echo ""; + if($singleTabInfo[ColumnParam][$i][ValueType] == VALUE_OPAQUE) + { + if(stristr($singleTabInfo[ColumnParam][$i][RawName],"NITZ")) + { + $mscTable="OBJ_320.param_99"; + $levels=getLevelWhere($singleTabInfo[ColumnParam][$i][OID]); + $sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo"; + $res=mysqli_query($objDbConn,$sql); + $rows=@mysqli_fetch_array($res); + $initValue=$rows[initValue]; + $readValue=$rows[readValue]; + if($initValue == '') + $initValue="--"; + echo ""; + if(strlen($initValue)>8) + $showValue=substr($initValue,0,8); + if($initValue == $readValue) + echo "$showValue"; + else + echo "$showValue"; + echo ""; + } + else + { + showParameter($sysId,$singleTabInfo[ColumnParam][$i][OID],$instanceNo); + } + } + else if(strstr($singleTabInfo[ColumnParam][$i][Description],"RelationPoint")) + { + $tmp1=strstr($singleTabInfo[ColumnParam][$i][Description],"RelationPoint:"); + $tmp2=explode(";",$tmp1); + $tmp3=explode("RelationPoint:",$tmp2[0]); + $rTableOid=$tmp3[1]; + + $showvalue=getParamValue($sysId,$singleTabInfo[ColumnParam][$i][OID],$instanceNo); + if(trim($showvalue) == "--" || trim($showvalue)=="") + { + echo "--"; + } + else + { + $tmp1=explode(" ",$showvalue); + $tmp2=$tmp1[1]; + $tmp3=explode("-",$tmp2); + $tmp4=omc_keep_length($tmp3[0],'0',4); + $tmp5=omc_keep_length($tmp3[1],'0',4); + $rInstanceNo=$tmp4.".".$tmp5; + $rWhere=getLevelWhere($rTableOid); + $rsql="select * from $paraTable where instanceNo='$rInstanceNo' and $rWhere "; + $rres=mysqli_query($objDbConn,$rsql); + $rnum=mysqli_num_rows($rres); + if($rnum == 0) + echo "--"; + else + { + + $new_table_level=getTableLevel($rTableOid,$sysTypeNo); + $tmp1=explode(".",$rTableOid); + $new_table_id=$tmp1[1]-1; + //echo "rInstanceNo=$rInstanceNo,rTableOid=$rTableOid,new_table_level=$new_table_level,new_table_id=$new_table_id"; + echo "$showvalue"; + } + } + } + else if($singleTabInfo[ColumnParam][$i][EntriesFlag] == 1) + { + $nextLevel=$singleTabInfo[TableLevel]+1; + + $thisTableName=$singleTabInfo[ColumnParam][$i][RawName]; + $tmpnum=strlen($thisTableName); + for($tmpi=0;$tmpi<$tmpnum;$tmpi++) + { + if($thisTableName[$tmpi] < 'a' || $thisTableName[$tmpi] > 'z') + break; + } + $thisTableName=substr($thisTableName,$tmpi); + $thisTableName=trim(str_replace("Entries","",$thisTableName)); + $thisTableName=getShowNameOfField($thisTableName,-1); + $tmpnum=count($columnTable); + for($tmpi=0;$tmpi<$tmpnum;$tmpi++) + { + //echo "+$thisTableName+ +{$columnTable[$tmpi][Name]}+
      "; + if(strcasecmp($thisTableName,trim($columnTable[$tmpi][Name])) == 0) + break; + } + $new_sub_table_id=$tmpi; + + //$new_sub_table_id=$sub_table_id+1; + $value=getParamValue($sysId,$singleTabInfo[ColumnParam][$i][OID],$instanceNo); + echo "{$value}"; + } + else + { + showParameterAdv($sysId,$singleTabInfo[ColumnParam][$i][OID],$instanceNo); + } + echo "
      "; + +//lock and unlock button +for($i=0;$i<$singleTabInfo[ColumnParamCount];$i++) +{ + if(strstr($singleTabInfo[ColumnParam][$i][RawName],"AdministrationState")) + { + // echo "i'm administrationstate"; + if($canwrite_flag) + echo ""; + else + echo ""; + echo "  "; + if($canwrite_flag) + echo ""; + else + echo ""; + echo "  "; + echo ""; + break; + } + if(strstr($singleTabInfo[ColumnParam][$i][RawName],"podUpdateToPod")) + { + echo ""; + echo "  "; + echo ""; + break; + } +} + +//other command button button +for($i=0;$i<$singleTabInfo[ButtonCount];$i++) +{ + $showName=$singleTabInfo[Button][$i][ShowName]; + $value=$singleTabInfo[Button][$i][Value]; + $oid=$singleTabInfo[Button][$i][OID]; + //echo "
      ShowName=$showName,$value,$oid
      "; + echo "  "; +} + +//get button +echo ""; +echo "  "; + + +//set button +if($singleTabInfo[ColumnParamSetCount] > 0) +{ + if($canwrite_flag) + echo ""; + else + echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/tabParamConfiguration/param_index.php b/wxc2_omc/configuration/tabParamConfiguration/param_index.php new file mode 100755 index 0000000..1926568 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/param_index.php @@ -0,0 +1,21 @@ + + + + + + + + <body> + + <p>Your browser can not support frame</p> + + </body> + + + + \ No newline at end of file diff --git a/wxc2_omc/configuration/tabParamConfiguration/param_show_table.php b/wxc2_omc/configuration/tabParamConfiguration/param_show_table.php new file mode 100755 index 0000000..dbcd9b7 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/param_show_table.php @@ -0,0 +1,1030 @@ + + + + + +"; + +$sysId = $_REQUEST['sysId']; +//echo "
      sysId=$sysId
      "; +$canwrite_flag=checkWritePrivilege(); +//echo "writeFlag=$canwrite_flag
      "; +//***** + +$url_temp=$_SERVER["REQUEST_URI"]; +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +$TEST=$_REQUEST; + +if(0) +{ + echo "

      ";
      +	print_r($TEST);
      +	echo "
      "; +} +echo "
      "; +$sysId=$_REQUEST['sysId']; +if (isset($sysId)) +{ + + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + //echo "sysTypeNo=$sysTypeNo
      "; + $sysNo=$sysIdArr[1]; + $subSysNo=$sysIdArr[2]; +} +// echo "sys=$sysTypeNo"; + +$objDb='OBJ_'.$sysTypeNo; +//$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OMC_PUB"); +$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$objDb); + + + + +$paraConfTable=$objDb.'.paramConf'; +$pubDb='OMC_PUB'; +if(checkIndependSystem($sysTypeNo))//Plat +{ + + $paraTable=$objDb.".param_".$sysNo; +} + + +else{ + $paraTable=$objDb.".param_99"; + +} + + +CheckSystemStatus($sysTypeNo,$sysNo,$subSysNo); + +$tabConf=GetTabConf($sysTypeNo); +//echo"tab=GetTabConf($sysTypeNo)
      "; +$table_id = $_REQUEST['table_id']; +//echo"table_id=GetTabConf($table_id)
      "; +$sub_table_id=$_REQUEST['sub_table_id']; +//echo "sub_table_id=$sub_table_id
      "; +$table_level = $_REQUEST['table_level']; +$instanceNo = $_REQUEST['instanceNo']; +$deleteOid = $_REQUEST['deleteOid']; +$updateOid = $_REQUEST['updateOid']; +$getTableOid = $_REQUEST['getTableOid']; +$deleteIndex = $_REQUEST['deleteIndex']; +$delete=$_REQUEST['delete']; +//echo "num=$tableOid
      "; + +$tableOid=$tabConf[$table_id]['OID']; + +//echo "num=$tableOid
      "; + +$subTabConf=GetSubTabConf($sysTypeNo,$tableOid); +//print_r($subTabConf) ; +//echo "num=$tableOid"; + + +//Get the columnTable conf +$oidwhere=getLevelWhere($tableOid); +$size=sizeof(explode(".",$tableOid)); +$oidwhere.=" AND level_".($size+1).">0 "; +$lastlevel="level_".($size+2); +$sql="select * from $paraConfTable where $oidwhere order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; +$res=@mysqli_query($objDbConn,$sql); +$num=@mysqli_num_rows($res); +//echo "num=$num"; +//var_dump($sql); +$scalarTableIndex=0; +$columnTableIndex=0; +$scalarItemIndex=0; +$scalarItemReadCount=0; +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + + if($row[$lastlevel] == 0) + { + if($row[maxAccess] == ACCESS_ENTRY && strstr($row[name_2],"Table")) + { + $columnTable[$columnTableIndex][Name]=adjustTableName($row[name_2]); + $columnTable[$columnTableIndex][OID]=getOIDByRow($row); + $columnTable[$columnTableIndex][ShowName]=$columnTable[$columnTableIndex][Name]; + if(strstr($row[desc_2],"Name:")) + { + $new_name=explode("Name:",$row[desc_2]); + $columnTable[$columnTableIndex][ShowName]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $columnTableIndex++; + } + } +} + + +if(0) +{ + echo "
      ";
      +	print_r($columnTable);
      +	echo "
      "; +} + +if(0) +{ + echo "
      ";
      +	print_r($subTabConf);
      +	echo "
      "; +} +if(!isset($table_id)) + $table_id=0; +if(!isset($sub_table_id)) +{ + if($subTabConf[ButtonCount] > 0 || $subTabConf[ScalarParamDisplayCount] > 0) + $sub_table_id=999; + else + $sub_table_id=0; +} + +if(0) +{ + echo "sysId=$sysId
      "; + echo "table_id=$table_id
      "; + echo "instanceNo=$instanceNo
      "; + echo "table_level=$table_level
      "; + echo "sub_table_id=$sub_table_id
      "; +} +$instanceNo = $_REQUEST['instanceNo']; +$table_level = $_REQUEST['table_level']; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +if((($subTabConf[ButtonCount] > 0 || $subTabConf[ScalarParamDisplayCount] > 0) && $subTabConf[SubMenuCount] > 0) || ($subTabConf[ButtonCount] == 0 && $subTabConf[ScalarParamDisplayCount] == 0 && $subTabConf[SubMenuCount] > 1)) +{ + if($subTabConf[ButtonCount] > 0 || $subTabConf[ScalarParamDisplayCount] > 0) + { + if($sub_table_id == 999) + echo ""; + else + echo ""; + echo " {$subTabConf[ShowName]} "; + echo ""; + } + for($i=0;$i<$subTabConf[ColumnTableCount];$i++) + { + if($subTabConf[ColumnTable][$i][SubMenuFlag] == 1) + { + if($i == $sub_table_id) + echo ""; + else + echo ""; + echo " {$subTabConf[ColumnTable][$i][ShowName]} "; + echo ""; + } + } + echo "
      "; +} +echo "
      "; + +/************************** Operation ********************************/ +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $delSql="delete from $paraTable where instanceNo='' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $delSql.="and subSysNo='$subSysNo' "; + + mysqli_query($objDbConn,$delSql); + echo "\n\n"; + echo "
      "; + if($_REQUEST['get']) + { + if($DEBUG) echo "
      sub_table_id:$sub_table_id sysId:$sysId
      "; + //get scalar table + if($sub_table_id == 999) + { + if($subTabConf[ScalarParamDisplayCount] > 0) + { + $count=0; + for($i=0;$i<$subTabConf[ScalarParamCount];$i++) + { + if($subTabConf[ScalarParam][$i][GetFlag] == 1) + { + $getArr[$count][sysId]=$sysId; + $getArr[$count][oid]=$subTabConf[ScalarParam][$i][OID]; + $getArr[$count][instanceNo]=""; + $count++; + } + } + if($count > 0) + getParam($getArr); + } + } + //get column table + else + { + $getArr[0][sysId]=$sysId; + $getArr[0][oid]=$subTabConf[ColumnTable][$sub_table_id][OID]; + //echo `sub_table_id:`.$getArr[0][oid]; + + + if($instanceNo=="0000") + $getArr[0][instanceNo]=""; + else + $getArr[0][instanceNo]=$instanceNo; + + //Get the timeslot parameter from the plat(trunk group id) + if($sysTypeNo == SYSTYPENO_MSC) + { + //echo "
      sub_table_id:$sub_table_id sysId:$sysId
      "; + $trunk_table_oid=GetOIDByName(SYSTYPENO_MSC,"channelEntry"); + if($getArr[0][oid] == $trunk_table_oid) + { + $tmps=explode(".",$instanceNo); + $grounp_id=GetTrunkGroupID($tmps[0]+0,$tmps[1]+0); + if($grounp_id == 1) + $getArr[0][sysId]="320_1_0"; + else + $getArr[0][sysId]="320_0_0"; + if(!GetSystemStatus(SYSTYPENO_MSC,$grounp_id)) + $getArr[0][sysId]="320_99_99"; + } + } + getParam($getArr); + + } + } + else if($_REQUEST['set']) + { + //fj + if(0) + { + echo "
      ";
      +                	print_r($sub_table_id);
      +        	        echo "
      "; + } + + if($sub_table_id == 999) + { + if($subTabConf[ScalarSetParamCount] > 0) + { + $commIdStr=""; + for($i=0;$i<$subTabConf[ScalarParamCount];$i++) + { + if($subTabConf[ScalarParam][$i][SetFlag] == 1) + { + $tmpCommIdStr=oidSysCommSend($sysId,3,$subTabConf[ScalarParam][$i][OID],-1); + $commIdStr=$commIdStr.$tmpCommIdStr; + $count++; + } + } + + // fj + if(0) + { + echo "
      ";
      +                        print_r($commIdStr);
      +                        echo "
      "; + } + if($count > 0) + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&table_id=$table_id&instanceNo=$instanceNo&table_level=$table_level&sub_table_id=$sub_table_id"); + } + } + } + else if($_REQUEST['buttonOperate']) + { + $commandIndex=$_POST['commandIndex']; + //echo "buttonOperate=$buttonOperate,commandIndex=$commandIndex
      "; + $oid=$subTabConf[Button][$commandIndex][OID]; + $tmpwhere=getLevelWhere($oid); + $oidstr=str_replace(".",",",$oid); + $oidsep=explode(".",$oid); + $oidlen=sizeof($oidsep); + $valuestr=""; + for($oi=0;$oi<$oidlen;$oi++) + { + $valuestr.="level_".($oi+1); + if($oi != ($oidlen-1)) + $valuestr.=","; + } + $delSql="delete from $paraTable where $tmpwhere and instanceNo='0000' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $delSql.="and subSysNo='$subSysNo' "; + + mysqli_query($objDbConn,$delSql); + $insertSql="insert into $paraTable($valuestr,instanceNo,initValue,readValue) values($oidstr,'0000',{$subTabConf[Button][$commandIndex][Value]},{$subTabConf[Button][$commandIndex][Value]}) "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $insertSql="insert into $paraTable($valuestr,instanceNo,initValue,readValue,subSysNo) values($oidstr,'0000',{$subTabConf[Button][$commandIndex][Value]},{$subTabConf[Button][$commandIndex][Value]},{$subSysNo}) "; + //debug_log("/tmp/debug.txt",$insertSql); + mysqli_query($objDbConn,$insertSql); + echo mysqli_error($objDbConn); + + $commIdStr=oidSysCommSend($sysId,3,$oid,-1,"0000"); + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=0000&sub_table_id=$sub_table_id"); + } + +} + +if($_REQUEST['delete'] == 1) +{ + if(0) + { + echo "sysId=$sysId
      "; + echo "table_id=$table_id
      "; + echo "sub_table_id=$sub_table_id
      "; + echo "table_level=$table_level
      "; + echo "instanceNo=$instanceNo
      "; + echo "deleteOid=$deleteOid
      "; + echo "updateOid=$updateOid
      "; + echo "getTableOid=$getTableOid
      "; + echo "deleteIndex=$deleteIndex
      "; + } + + //Set the value=6 in the db + $tmpwhere=getLevelWhere($deleteOid); + $sql="update $paraTable set initValue='6' where $tmpwhere and instanceNo='$deleteIndex' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.="and subSysNo='$subSysNo' "; + mysqli_query($objDbConn,$sql); + + //Send delete command + $commIdStr=oidSysCommSend($sysId,3,$deleteOid,-1,$deleteIndex); + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); + //Update the entries field + if(strlen(trim($updateOid)) > 0) + { + $commIdStr=oidSysCommSend($sysId,0,$updateOid,-1,$instanceNo); + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&table_id=$table_id&sub_table_id=$sub_table_id&table_level=$table_level&instanceNo=$instanceNo"); + } + + //Get the table + $tmpArr[0][sysId]=$sysId; + $tmpArr[0][oid]=$getTableOid; + if($instanceNo=="0000") + $tmpArr[0][instanceNo]=""; + else + $tmpArr[0][instanceNo]=$instanceNo; + + getParam($tmpArr); + + //delete the sub table object + DeleteSubTableData($sysTypeNo,$deleteIndex,$getTableOid,$paraTable); +} +$getAll = $_REQUEST['getAll']; +if($DEBUG) echo "
      getAll:$getAll
      "; +if($getAll) +{ +echo "\n\n"; +for($i = 1; $i <= 4096; $i++ ) print(" "); +echo "
      "; + + //Insert record when the scalar item is not exist + $scalar_oids=GetAllOIDArr($sysTypeNo,SCALAR_ITEM_OID); + //echo "scalar_oids=$scalar_oids"; + $scalar_oids_num=sizeof($scalar_oids); + + + for($i=0;$i<$scalar_oids_num;$i++) + { + $checkoid=$scalar_oids[$i].".0"; + $oidwhere=getLevelWhere($checkoid); + $checksql="select * from $paraTable where $oidwhere and instanceNo='0000' "; + $checkres=@mysqli_query($objDbConn,$checksql); + $checknum=@mysqli_num_rows($checkres); + if($checknum == 0) + { + $insertlevel=str_replace("AND",",",$oidwhere); + $insertsql="replace into $paraTable set initValue='',instanceNo='0000',$insertlevel "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $insertsql="replace into $paraTable set subSysNo='$subSysNo',initValue='',instanceNo='0000',$insertlevel "; + //echo "$insertsql
      "; + mysqli_query($objDbConn,$insertsql); + echo mysqli_error($objDbConn); + } + } + + + $getAllArr=GetAllOIDArr($sysTypeNo); + if(0) + { + echo "
      ";
      +		print_r($getAllArr);
      +		echo "
      "; + } + if (is_array($getAllArr)) + $get_count=sizeof($getAllArr); + + for($i=0;$i<$get_count;$i++) + { + $tmpArr[$i][sysId]=$sysId; + $tmpArr[$i][oid]=$getAllArr[$i]; + $tmpArr[$i][instanceNo]=""; + } + getParam($tmpArr,1); +} + +/******************************** Show *******************************/ +//show scalar parameter +//echo $sub_table_id; +// echo "
      ";
      +// print_r($subTabConf);
      +// echo "
      "; +if($sub_table_id == 999) +{ + if($subTabConf['ScalarParamDisplayCount'] > 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<$subTabConf[ScalarParamCount];$i++) + { + if($subTabConf[ScalarParam][$i][MaxAccess] == 999) + continue; + + //if the scalar leaf not exist in the db, insert it first + $checklevel=getLevelWhere($subTabConf[ScalarParam][$i][OID]); + $checksql="select * from $paraTable where $checklevel and instanceNo='0000' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $checksql.="and subSysNo='$subSysNo' "; + $checkres=mysqli_query($objDbConn,$checksql); + //var_dump($checksql); + //echo "checksql:$checksql
      "; + echo mysqli_error($objDbConn); + $checknum=mysqli_num_rows($checkres); + if($checknum == 0) + { + $insertlevel=str_replace("AND",",",$checklevel); + $insertsql="replace into $paraTable set initValue='',instanceNo='0000',$insertlevel "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $insertsql="replace into $paraTable set subSysNo='$subSysNo',initValue='',instanceNo='0000',$insertlevel "; + mysqli_query($objDbConn,$insertsql); + //echo "
      $insertsql"; + echo mysqli_error($objDbConn); + } + + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      "; + echo "Parameter"; + echo ""; + echo "Value"; + echo "
      {$subTabConf[ScalarParam][$i][ShowName]}"; + if($subTabConf[ScalarParam][$i][ValueType] == VALUE_OPAQUE) + { + + + showParameter($sysId,$subTabConf[ScalarParam][$i][OID],'0000'); + + } + else { + showParameterAdv($sysId,$subTabConf[ScalarParam][$i][OID],'0000'); + + } + echo "
      "; + } + //get button + if($subTabConf[ScalarParamDisplayCount] > 0) + { + echo "  "; + } + //set button + if($subTabConf[ScalarSetParamCount] > 0) + { + if($canwrite_flag) + echo "  "; + else + echo "  "; + } + //other button + echo ""; + if($subTabConf[ButtonCount] > 0) + { + + for($i=0;$i<$subTabConf[ButtonCount];$i++) + { + if($canwrite_flag) + echo " "; + else + echo " "; + } + } +} +//column table +else +{ + //echo "AAA=$sub_table_id"; + + $singleTabConf=$subTabConf[ColumnTable][$sub_table_id]; + if(0) + { + echo "
      ";
      +		print_r($singleTabConf);
      +		echo "
      "; + } + $singleTabInfo=GetSingleTableInfo($singleTabConf,$sysTypeNo); + if(0) + { + echo"AA
      "; + echo "
      ";
      +		print_r($singleTabInfo);
      +		echo "
      "; + } + + //PPS COS table + if($sysTypeNo == SYSTYPENO_PPS && $table_level == 1 && $table_id == 1) + { + //-------------- TariffEntries => MOTariffID ----------- + $tariff_id=2; + $singleTabInfo[ColumnParam][$tariff_id][EntriesFlag]=0; + $singleTabInfo[ColumnParam][$tariff_id][NestEntryOID]=""; + $singleTabInfo[ColumnParam][$tariff_id][RawName]="tariffMOTariffID"; + $singleTabInfo[ColumnParam][$tariff_id][ShowName]="MO Tariff ID"; + //-------------- ServiceControlEntries => smsNotificationWhenRecharge ----------- + $tariff_id=3; + $singleTabInfo[ColumnParam][$tariff_id][EntriesFlag]=0; + $singleTabInfo[ColumnParam][$tariff_id][NestEntryOID]=""; + $singleTabInfo[ColumnParam][$tariff_id][RawName]="smsNotificationWhenRecharge"; + $singleTabInfo[ColumnParam][$tariff_id][ShowName]="Notification When Recharge"; + //-------------- AccountValidityEntries => smsChargeWhenInquiryBySMS ----------- + $tariff_id=4; + $singleTabInfo[ColumnParam][$tariff_id][EntriesFlag]=0; + $singleTabInfo[ColumnParam][$tariff_id][NestEntryOID]=""; + $singleTabInfo[ColumnParam][$tariff_id][RawName]="smsChargeWhenInquiryBySMS"; + $singleTabInfo[ColumnParam][$tariff_id][ShowName]="Charge When Inquiry By SMS"; + //-------------- SMSNotificationInquiryEntries => smsNotificationWhenCleanBalance ----------- + $tariff_id=5; + $singleTabInfo[ColumnParam][$tariff_id][EntriesFlag]=0; + $singleTabInfo[ColumnParam][$tariff_id][NestEntryOID]=""; + $singleTabInfo[ColumnParam][$tariff_id][RawName]="smsNotificationWhenCleanBalance"; + $singleTabInfo[ColumnParam][$tariff_id][ShowName]="Notification When Clean Balance"; + } + + showNavigateTitle($table_id,$sub_table_id,$table_level,$sysId,$columnTable,$instanceNo,"show"); + echo "
      "; + echo "
      "; + echo ""; + //table header + echo ""; + $showFieldCount=0; + for($i=0;$i<$singleTabInfo[ColumnParamCount];$i++) + { + if($singleTabInfo[ColumnParam][$i][KeyFlag] == 0) + continue; + $showFieldCount++; + if($i == $singleTabInfo[TableDeletePos]) + { + echo ""; + } + else + { + echo ""; + } + } + echo ""; + //table row object + $showObject=GetAllRowData($singleTabInfo,$paraTable,$instanceNo,$sysId); + + if(!isset($order)) + $order=$singleTabInfo[ColumnParam][$singleTabInfo[TableIndexPos]][LastOID]; + $ascFlag=1; + + if(0) + { + echo "
      ";
      +		print_r($showObject);
      +		echo "
      "; + } + + //PPS COS table + if($sysTypeNo == SYSTYPENO_PPS && $table_level == 1 && $table_id == 1) + { + if(sizeof($showObject) > 0) + { + foreach($showObject as $instance => $obj) + { + $cos_instance=omc_keep_length($instance,"0",4); + if($_SERVER['REQUEST_METHOD'] == "POST" && $get) + { + $getParam_showFinishResultFlag=0; + $getArr[0][instanceNo]=$cos_instance; + $getArr[0][oid]="2.2.51.1"; + $getArr[0][sysId]=$sysId; + + $getArr[1][instanceNo]=$cos_instance; + $getArr[1][oid]="2.2.52.1"; + $getArr[1][sysId]=$sysId; + + $getArr[2][instanceNo]=$cos_instance; + $getArr[2][oid]="2.2.53.1"; + $getArr[2][sysId]=$sysId; + + $getArr[3][instanceNo]=$cos_instance; + $getArr[3][oid]="2.2.54.1"; + $getArr[3][sysId]=$sysId; + + $getArr[4][instanceNo]=$cos_instance; + $getArr[4][oid]="2.2.55.1"; + $getArr[4][sysId]=$sysId; + + $getArr[5][instanceNo]=$cos_instance; + $getArr[5][oid]="2.2.56.1"; + $getArr[5][sysId]=$sysId; + + $getArr[6][instanceNo]=$cos_instance; + $getArr[6][oid]="2.2.57.1"; + $getArr[6][sysId]=$sysId; + + $getArr[7][instanceNo]=$cos_instance; + $getArr[7][oid]="2.2.58.1"; + $getArr[7][sysId]=$sysId; + + $getArr[8][instanceNo]=$cos_instance; + $getArr[8][oid]="2.2.59.1"; + $getArr[8][sysId]=$sysId; + + $getArr[9][instanceNo]=$cos_instance; + $getArr[9][oid]="2.2.60.1"; + $getArr[9][sysId]=$sysId; + + getParam($getArr); + $getParam_showFinishResultFlag=1; + } + + $value=getParamValue($sysId,"2.2.51.1.4","{$cos_instance}.0000"); + $showObject[$instance][3]=$value; + //echo "$instance,$showValue
      "; + + $value=getParamValue($sysId,"2.2.54.1.4","{$cos_instance}.0000"); + $showValue=translateValueToOpt(1,3,"disable=0;enable=1",$value); + $showObject[$instance][4]=$showValue; + + $value=getParamValue($sysId,"2.2.54.1.10","{$cos_instance}.0000"); + $showValue=translateValueToOpt(1,3,"notCharge=0;charge=1",$value); + $showObject[$instance][5]=$showValue; + + $value=getParamValue($sysId,"2.2.54.1.12","{$cos_instance}.0000"); + $showValue=translateValueToOpt(1,3,"disable=0;enable=1",$value); + $showObject[$instance][6]=$showValue; + } + } + } + + $showObject=BubbleOrder($showObject,$order,$ascFlag); + + if(sizeof($showObject) > 0) + { + foreach($showObject as $instance => $obj) + { + if($obj[1] === null || $obj[1] === ''||$obj[1]==='Error:NoSuchInstance'){ + continue; + } + echo ""; + + for($i=0;$i<$singleTabInfo[ColumnParamCount];$i++) + { + if($singleTabInfo[ColumnParam][$i][KeyFlag] == 0) + continue; + + $LastOID=$singleTabInfo[ColumnParam][$singleTabInfo[TableIndexPos]][LastOID]; + $newIndex=$obj[$LastOID]; + if($singleTabInfo[TableLevel]==1) + $nextInstance=omc_keep_length($newIndex,"0",4); + else if($singleTabInfo[TableLevel]==2) + $nextInstance=$instanceNo.".".omc_keep_length($newIndex,"0",4); + else if($singleTabInfo[TableLevel]==3) + $nextInstance=$instanceNo.".".omc_keep_length($newIndex,"0",4); + + if($i == $singleTabInfo[TableDeletePos]) + { + echo ""; + } + else if($singleTabInfo[ColumnParam][$i][EntriesFlag] == 1) + { + $LastOID=$singleTabInfo[ColumnParam][$i][LastOID]; + $value=$obj[$LastOID]; + + $next_table_level=$singleTabInfo[TableLevel]+1; + + $thisTableName=$singleTabInfo[ColumnParam][$i][RawName]; + $tmpnum=strlen($thisTableName); + for($tmpi=0;$tmpi<$tmpnum;$tmpi++) + { + if($thisTableName[$tmpi] < 'a' || $thisTableName[$tmpi] > 'z') + break; + } + $thisTableName=substr($thisTableName,$tmpi); + $thisTableName=trim(str_replace("Entries","",$thisTableName)); + $thisTableName=getShowNameOfField($thisTableName,-1); + $tmpnum=count($columnTable); + for($tmpi=0;$tmpi<$tmpnum;$tmpi++) + { + //echo "+$thisTableName+ +{$columnTable[$tmpi][Name]}+
      "; + if(strcasecmp($thisTableName,trim($columnTable[$tmpi][Name])) == 0) + break; + } + $new_sub_table_id=$tmpi; + //$new_sub_table_id=$sub_table_id+1; + echo ""; + } + else if($i == $singleTabInfo[TableIndexPos]) + { + $LastOID=$singleTabInfo[ColumnParam][$i][LastOID]; + $value=$obj[$LastOID]; + echo ""; + } + //RelationPoint + else if(strstr($singleTabInfo[ColumnParam][$i][Description],"RelationPoint")) + { + echo ""; + } + else + { + echo ""; + } + } + echo ""; + } + } + + //new object + if(strlen(trim($singleTabInfo[CreateOID])) > 0 && $canwrite_flag) + { + echo ""; + echo ""; + for($i=0;$i<$showFieldCount-1;$i++) + { + echo ""; + } + echo ""; + } + echo "
      "; + echo "Delete"; + echo ""; + echo ""; + echo "{$singleTabInfo[ColumnParam][$i][ShowName]}"; + echo ""; + echo "
      "; + if($canwrite_flag) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo "$value"; + echo ""; + echo ""; + //PPS COS table + if($sysTypeNo == SYSTYPENO_PPS && $table_level == 1 && $table_id == 1) + echo "{$value}"; + else + echo "{$value}"; + echo ""; + $LastOID=$singleTabInfo[ColumnParam][$i][LastOID]; + $value=$obj[$LastOID]; + + $tmp1=strstr($singleTabInfo[ColumnParam][$i][Description],"RelationPoint:"); + $tmp2=explode(";",$tmp1); + $tmp3=explode("RelationPoint:",$tmp2[0]); + $rTableOid=$tmp3[1]; + + $showvalue=$value; + + if(trim($showvalue) == "--" || trim($showvalue)=="") + { + echo "--"; + } + else + { + $tmp1=explode(" ",$showvalue); + $tmp2=$tmp1[1]; + $tmp3=explode("-",$tmp2); + $tmp4=omc_keep_length($tmp3[0],'0',4); + $tmp5=omc_keep_length($tmp3[1],'0',4); + $rInstanceNo=$tmp4.".".$tmp5; + $rWhere=getLevelWhere($rTableOid); + $rsql="select * from $paraTable where instanceNo='$rInstanceNo' and $rWhere "; + $rres=mysqli_query($objDbConn,$rsql); + $rnum=mysqli_num_rows($rres); + // echo "$rsql"; + if($rnum == 0) + echo "--"; + else + { + $new_table_level=getTableLevel($rTableOid,$sysTypeNo); + $tmp1=explode(".",$rTableOid); + $new_table_id=$tmp1[1]-1; + //echo "rInstanceNo=$rInstanceNo,rTableOid=$rTableOid,new_table_level=$new_table_level,new_table_id=$new_table_id"; + echo "$showvalue"; + } + } + + echo ""; + $LastOID=$singleTabInfo[ColumnParam][$i][LastOID]; + $value=$obj[$LastOID]; + $value=translateValueToOpt($singleTabInfo[ColumnParam][$i][OperType],$singleTabInfo[ColumnParam][$i][ValueType],$singleTabInfo[ColumnParam][$i][Template],$value); + if(strlen(trim($value)) == 0) + $value="--"; + echo "$value"; + echo " 
      "; + $indexOid=$singleTabInfo[ColumnParam][$singleTabInfo[TableIndexPos]][OID]; + + echo ""; + echo "New"; + echo ""; + + + echo "--
      "; + + //get button + echo "  "; + + //lock the channel + if($sysTypeNo == SYSTYPENO_MSC && $singleTabInfo[TableEntryOID] == '2.4.3.1') + { + + echo ""; + echo ""; + } + + //if not get channel, get the channel first + if($sysTypeNo == SYSTYPENO_MSC && $singleTabInfo[TableEntryOID] == "2.4.3.1") + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + $count=0; + $database="OMC_PUB"; + + $selSql = "SELECT T1.* FROM $paraTable AS T1,$paraConfTable AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tsIndex' and instanceNo like '$instanceNo.%' "; + $selRes = @mysqli_query($objDbConn,$selSql); + $count=mysqli_num_rows($selRes); + if($count==0) + { + if($hasEnter!=1) + { + $hasEnter=1; + echo ""; + echo "\n\n"; + + } + } + } + +} + +if(0) +{ + echo "
      ";
      +	print_r($showObject);
      +	echo "
      "; +} + +echo ""; +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/tabParamConfiguration/param_show_up.php b/wxc2_omc/configuration/tabParamConfiguration/param_show_up.php new file mode 100755 index 0000000..0a593fc --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfiguration/param_show_up.php @@ -0,0 +1,455 @@ + + + + + + +"; +switch($sysTypeNo) +{ +case SYSTYPENO_MSC: + $sysTypeName="MSC"; + $helpId="2.1.1.1"; + break; +case SYSTYPENO_SMSC: + $sysTypeName="SMSC"; + $helpId="2.1.1.5"; + break; +case SYSTYPENO_SMPP: + $sysTypeName="SMPP"; + $helpId="2.1.1.20"; + break; +case SYSTYPENO_OPPS: + $sysTypeName="OPPS"; + $helpId="2.1.1.9"; + break; +case SYSTYPENO_PPS: + $sysTypeName="PPS"; + $helpId="none"; + break; +case SYSTYPENO_MME: + $sysTypeName="MME"; + $helpId="none"; + break; +case SYSTYPENO_SPGW: + $sysTypeName="SPGW"; + $helpId="none"; + break; +case SYSTYPENO_IMS: + $sysTypeName="IMS"; + $helpId="none"; + break; +case SYSTYPENO_RCS: + $sysTypeName="RCS"; + $helpId="none"; + break; +case SYSTYPENO_UDM: + $sysTypeName="UDM"; + $helpId="none"; + break; +case SYSTYPENO_AUSF: + $sysTypeName="AUSF"; + $helpId="none"; + break; +case SYSTYPENO_MTP3: + $sysTypeName="MTP3"; + $helpId="2.1.0"; + break; +case SYSTYPENO_SCCP: + $sysTypeName="SCCP"; + $helpId="2.1.0"; + break; +case SYSTYPENO_AAS: + $sysTypeName="AAS"; + $helpId="2.1.3.1"; + break; +case SYSTYPENO_VSS: + $sysTypeName="VSS"; + $helpId="2.1.3.2"; + break; +case SYSTYPENO_VLR: + $sysTypeName="VLR"; + $helpId="2.1.1.2"; + break; +case SYSTYPENO_HLR: + $sysTypeName="HLR"; + $helpId="2.1.1.3"; + break; +case SYSTYPENO_AUC: + $sysTypeName="AUC"; + $helpId="2.1.1.4"; + break; +case SYSTYPENO_SMEG: + $sysTypeName="SMEG"; + $helpId="2.1.1.8"; + break; +case SYSTYPENO_EIR: + $sysTypeName="EIR"; + $helpId="2.1.1.7"; + break; +case SYSTYPENO_MRFC: + $sysTypeName="MRFC"; + $helpId="2.66"; + break; +case SYSTYPENO_PALIM: + $sysTypeName="iPALIM"; + $helpId="2.1.1.12"; + break; +case SYSTYPENO_RLS: + $sysTypeName="iRLS"; + $helpId="2.1.1.13"; + break; +case SYSTYPENO_MHC: + $sysTypeName="MHC"; + $helpId="2.1.1.14"; + break; +case SYSTYPENO_MNP: + $sysTypeName="MNP"; + $helpId="2.1.1.11"; + break; +case SYSTYPENO_XAPP: + $sysTypeName="XAPP"; + $helpId="none"; + break; +case SYSTYPENO_GRS: + $sysTypeName="iGRS"; + $helpId="2.1.1.17"; + break; +case SYSTYPENO_TMG: + $sysTypeName="TMG"; + $helpId="2.1.1.19"; + break; +case SYSTYPENO_AMRMG: + $sysTypeName="AMRMG"; + $helpId="2.1.1.15"; + break; +case SYSTYPENO_GbC: + $sysTypeName="GbC"; + $helpId="2.1.1.16"; + break; +case SYSTYPENO_MCA: + $sysTypeName="MCA"; + $helpId="2.1.1.21"; + break; +case SYSTYPENO_RCM: + $sysTypeName="RCM"; + $helpId="2.1.1.21"; + break; +/*case SYSTYPENO_IUUPGW: + $sysTypeName="IUUPGW"; + //$helpId="2.1.1.21"; + break;*/ +default: + $sysTypeName="Unknown"; + $helpId="none"; + break; +} + +$sql="select sysTypeNo,sysTypeName,maxSysNum,maxSubSysNum from OMC_PUB.sysConf where needParamConf = '1' and sysTypeNo='$sysTypeNo' "; +//echo "sql=$sql
      "; +$res=@mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); +$maxSysNum=$row['maxSysNum']; +$maxSubSysNum=$row['maxSubSysNum']; + + +$statSql="select sysTypeNo,sysNo,subSysNo FROM sysInfo WHERE sysTypeNo='$sysTypeNo' "; +$statRes=@mysqli_query($pubConn,$statSql); +$count=mysqli_num_rows($statRes); +echo mysqli_error($pubConn); +//echo "sql=$statSql
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > NSS > $sysTypeName"; +echo ""; + +echo "
      "; + +echo "System ID:"; + echo "  "; + +echo ""; +echo "  "; + +if($helpId != "none") + showHelp($helpId); +echo "
      "; +echo "
      "; + +$tabConf=GetTabConf($sysTypeNo); +$num=sizeof($tabConf); +InitTab($sysTypeNo); +echo ""; +for($i=0;$i<$num;$i++) +{ + $id=GetGlobalID(); + AddTab($id,$tabConf[$i][OID],$tabConf[$i][Name],"image0.gif","image2.gif",123,17); +} +echo ""; + +if(0) +{ + echo "
      ";
      +	print_r($tabConf);
      +	echo "
      "; +} + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +?> + + diff --git a/wxc2_omc/configuration/tabParamConfigurationB/handleOpaquePara.php b/wxc2_omc/configuration/tabParamConfigurationB/handleOpaquePara.php new file mode 100755 index 0000000..600eede --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfigurationB/handleOpaquePara.php @@ -0,0 +1,707 @@ +paraSql=$paraSql"; +$paraResult=mysqli_query($pubConn,$paraSql); +$paraRows=@mysqli_fetch_array($paraResult); + +$setValue=$paraRows[initValue]; +$readValue=$paraRows[readValue]; +if($DEBUG) + echo "
      setValue=$setValue"; + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + echo "
      Error in omcStrFill:the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + +//=======================Get value From submit=================== +if($set == 'Set'){ + //sort by offset + for($i=1;$i<=$unitNum;$i++){ + $tmpDef = ${'unitDef_'.$i}; + $tmpValue = ${'unit_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$i] = $tmpDef; + $tmpDefArr=explode('-',$tmpDef); + $sortArr[$i] = $tmpDefArr[0]; + $valueArr[$i] = $tmpValue; + } + $lastValue = ''; + $k = 0; + asort($sortArr); + for(reset($sortArr); $key = key($sortArr); next($sortArr)){ + if($DEBUG) echo "
      sortArr[$key] = {$sortArr[$key]}"; + if($DEBUG) echo "
      unitValue = {$valueArr[$key]}"; + $unitValue = $valueArr[$key]; + if($DEBUG) echo "
      defArr[$key] = {$defArr[$key]}"; + $unitDefArr = explode('-',$defArr[$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1){ + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG)echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + }else{//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + }else{ + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + case 'toLatitude': + //feake show 4byte + if($unitValue>90) + { + $unitValue=90; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + if($unitValue<-90) + { + $unitValue=-90; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + $byteValue=$unitValue*pow(2,23)/90; + $byteValue=ceil($byteValue); + $byteValue=dechex($byteValue); + $byteValue=omcStrFill($byteValue,8,'high','0'); + break; + case 'toLongitude': + if($unitValue>180) + { + $unitValue=180; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + if($unitValue<-180) + { + $unitValue=-180; + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + $byteValue=$unitValue*pow(2,24)/360; + $byteValue=ceil($byteValue); + $byteValue=dechex($byteValue); + $byteValue=omcStrFill($byteValue,8,'high','0'); + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + } + $lastValue=strtoupper($lastValue); + if($DEBUG) echo "
      lastValue = $lastValue "; + $updateSql="UPDATE $paraTable SET initValue='$lastValue' WHERE $levelWhere AND instanceNo=$instanceNo"; + if($DEBUG)echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + + + + if($lastValue==$readValue) + { + $returnColor= $settedColor; + } + else + { + $returnColor= $notSettedColor; + + $oidwhere=getLevelWhere(substr($oidStr,0,strlen($oidStr)-2)); + $tableName=getNameByOID_handle($sysTypeNo,$oidwhere); + $tableName=str_replace("Entry","",$tableName); + $sysName=getSystemNameBySysTypeNo($sysTypeNo); + + $fieldName=getNameByOID_handle($sysTypeNo,$levelWhere); + $log="Change $sysName $tableName's $fieldName, ".$readValue." -> ".$lastValue; + + insertLog($log); + //$handle=fopen("/tmp/test.txt","a"); + //fwrite($handle,$log); + //fwrite($handle,"\n"); + //fclose($handle); + } + if(!$DEBUG){ + + //discard the postfix E + if(strstr($tmpDef,"keepHex-low")) + { + $oidwhere=getLevelWhere($oidStr); + $sql="select setTemplate_2 from OBJ_$sysTypeNo.paramConf where $oidwhere "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $split=explode("[unit]",$row[0]); + $tmplen=sizeof($split); + //only one unit + //if($tmplen == 2) + { + $split2=explode("keepHex-low-",$row[0]); + $repl=substr($split2[1],0,1); + $lastValue=str_replace($repl," ",$lastValue); + } + } + if(strlen(trim($lastValue))<=0) + $lastValue="--"; + + echo ""; + exit(); + }else{ + echo "
      lastValue = $lastValue "; + } +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +" > +"; +}else{ + echo ""; +} + +for($i=1;$i"; +}//end of for(..) + +echo "
      "; + //unit input name + $unitName = "unit_".$i; + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$i]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + //show Unit Name + echo "$tlvArr[0]"; + echo " "; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) + echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + $inputValue = trim($inputValue);//add by oven 2006-8-2 remvove dirty in Mozilla. + } + break; + case 'toLatitude': + //feake edit float + if($byteValue[0]=='F' || $byteValue[0]=='f') + { + $tmp=hexdec($byteValue)-1; + $orgbin=decbin($tmp); + $lastbin=""; + for($ii=0;$ii8) + $inputValue=substr($inputValue,0,8); + + if($inputValue > 90 || $inputValue < -90) + { + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + break; + case 'toLongitude': + if($byteValue[0]=='F' || $byteValue[0]=='f') + { + $tmp=hexdec($byteValue)-1; + $orgbin=decbin($tmp); + $lastbin=""; + for($ii=0;$ii8) + $inputValue=substr($inputValue,0,8); + + if($inputValue > 180 || $inputValue < -180) + { + /**************************************************/ + echo "\n\n"; + /***************************************************/ + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG)echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else if($defArr[0] == 'toAscii'){ + for($ii=0;$ii"; + + break; + case 'select': + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + + if($DEBUG) + echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + + echo ""; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + echo "\n "; + echo "
      "; + +$remark=nl2br($remark); +echo "
      Remarks:
      $remark

      "; +$unitNum = $i-1; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +if($canwrite_flag) +{ + echo "\n"; + echo "\n"; +} +else +{ + echo "\n"; + echo "\n"; +} +echo ""; +?> + + \ No newline at end of file diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/left_arrow.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/left_arrow.gif new file mode 100755 index 0000000..7b9e728 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/left_arrow.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/right_arrow.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/right_arrow.gif new file mode 100755 index 0000000..cba3418 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/right_arrow.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_12.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_12.gif new file mode 100755 index 0000000..0593edd Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_12.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_16.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_16.gif new file mode 100755 index 0000000..a87bc1a Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_16.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_20.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_20.gif new file mode 100755 index 0000000..a9b5e53 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_20.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_24.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_24.gif new file mode 100755 index 0000000..5dcb445 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_24.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_4.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_4.gif new file mode 100755 index 0000000..56bfcfa Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_4.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_8.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_8.gif new file mode 100755 index 0000000..0583780 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_dark_8.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_12.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_12.gif new file mode 100755 index 0000000..d748201 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_12.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_16.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_16.gif new file mode 100755 index 0000000..c0a1e16 Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_16.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_20.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_20.gif new file mode 100755 index 0000000..ce93ebc Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_20.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_24.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_24.gif new file mode 100755 index 0000000..1734f7e Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_24.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_4.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_4.gif new file mode 100755 index 0000000..ee6f82f Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_4.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_8.gif b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_8.gif new file mode 100755 index 0000000..e89a1bb Binary files /dev/null and b/wxc2_omc/configuration/tabParamConfigurationB/images/tab_light_8.gif differ diff --git a/wxc2_omc/configuration/tabParamConfigurationB/lockTimeSlot.php b/wxc2_omc/configuration/tabParamConfigurationB/lockTimeSlot.php new file mode 100755 index 0000000..eec9aff --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfigurationB/lockTimeSlot.php @@ -0,0 +1,185 @@ + + + + +"; + $trunkTimeSlotEntriesFiled="trunkChannelEntries"; + //get the trunkTimeSlotEntries oid + $sql="select level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 from OBJ_320.paramConf where name_2='$trunkTimeSlotEntriesFiled' "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + if($num == 0) + exit($trunkTimeSlotEntriesFiled." do not exist!
      "); + $pos=0; + $row=@mysqli_fetch_array($res); + $trunkTimeSlotEntriesOid=""; + while($row[$pos]!=0) + { + $trunkTimeSlotEntriesOid.="{$row[$pos]}."; + $pos++; + } + $trunkTimeSlotEntriesOid=substr($trunkTimeSlotEntriesOid,0,strlen($trunkTimeSlotEntriesOid)-1); + //echo "trunkTimeSlotEntriesOid=$trunkTimeSlotEntriesOid
      "; + + //get the trunkTimeSlotEntries value + $oidWhere=getLevelWhere($trunkTimeSlotEntriesOid); + $sql="select readValue from OBJ_320.param_99 where $oidWhere and instanceNo='$instanceNo' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $trunkTimeSlotEntriesValue=$row[0]+0; + //echo "Entries={$row[0]} {$instanceNo}
      "; + + + //show the title + $split=explode(".",$instanceNo); + $tgno=$split[0]+0; + $tkno=$split[1]+0; + echo "MSC > Trunk Group $tgno > Trunk $tkno > Channel

      "; + + //set + if($_SERVER['REQUEST_METHOD'] == "POST") + { + echo "Set parameter...
      "; + //echo "trunkTimeSlotEntriesValue=$trunkTimeSlotEntriesValue"; + if($trunkTimeSlotEntriesValue==24) + $totalNum=25; + else if($trunkTimeSlotEntriesValue==32) + $totalNum=32; + for($i=1;$i<$totalNum;$i++) + { + $param="cb_".$i; + $value=$$param; + $index=0; + if($value=="on") + { + $newInstanceNo=$instanceNo.".".omc_keep_length($i,"0",4); + + $tmpWhere=getLevelWhere("2.4.3.1.4"); + $updateSql="UPDATE OBJ_320.param_99 SET initValue=$typeValue WHERE $tmpWhere AND instanceNo='$newInstanceNo'"; + mysqli_query($pubConn,$updateSql); + //echo "typeValue=$typeValue,updateSql=$updateSql

      "; + + /* + $commInfoArr[$index][sysId]=$sysId; + $commInfoArr[$index][oid]="2.4.3.1.4"; + $commInfoArr[$index][instanceNo]=$newInstanceNo; + $index++; + */ + $commIdStr=oidSysCommSend($sysId,3,"2.4.3.1.4",$selectedSysId=-1,$newInstanceNo); + //checkState($commIdStr,"./param_show_table.php?sysId=$sysId&tableOid=$tableOid&instanceNo=$instanceNo"); + //echo "set $newInstanceNo
      "; + + echo ""; + } + } + echo "
      "; + /* + if($index > 0) + { + setParam($commInfoArr); + } + */ + + echo "Close"; + exit(""); + } + + echo "

      "; + + echo "Type

      "; + + + + if($trunkTimeSlotEntriesValue==24) + $totalNum=25; + else if($trunkTimeSlotEntriesValue==32) + $totalNum=32; + echo ""; + echo ""; + echo ""; + echo ""; + //do not need time slot 0 + + for($i=1;$i<$totalNum;$i++) + { + $cbname="cb_".$i; + + $newInstanceNo=$instanceNo.".".omc_keep_length($i,"0",4); + $tmpWhere=getLevelWhere("2.4.3.1.4"); + $sql="select readValue from OBJ_320.param_99 where $tmpWhere and instanceNo='$newInstanceNo' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + + //do not set dchanal time slot + if($row[readValue] != 5) + { + echo ""; + echo ""; + echo ""; + } + } + echo "
      Select All Time Slots"; + echo "
      Time Slot-$i"; + echo "
      "; + + echo "

      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "

      "; + + echo "Remark:
      "; +?> diff --git a/wxc2_omc/configuration/tabParamConfigurationB/mscNITZ.php b/wxc2_omc/configuration/tabParamConfigurationB/mscNITZ.php new file mode 100755 index 0000000..8f060a7 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfigurationB/mscNITZ.php @@ -0,0 +1,446 @@ + + + + +param_oid=$param_oid
      "; + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + echo "coding_scheme_select=$coding_scheme_select
      "; + echo "network_name_text=$network_name_text
      "; + echo "ci_select=$ci_select
      "; + echo "time_update_option_select=$time_update_option_select
      "; + echo "time_zone_select=$time_zone_select
      "; + + $network_name_7bit_vec=string8bitTo7bit($network_name_text); + $network_name_7bit_hexlen=sizeof($network_name_7bit_vec); + $network_name_7bit_hexlen=$global_len; + $network_name_7bit_hexstr=""; + for($i=0;$i<$network_name_7bit_hexlen;$i++) + { + $tmp=dechex($network_name_7bit_vec[$i]); + $tmp=omc_keep_length($tmp,0,2); + $network_name_7bit_hexstr.=$tmp; + } + $network_name_7bit_hexstr=omc_keep_length($network_name_7bit_hexstr,0,62,0); + $tmp=dechex($network_name_7bit_hexlen); + $tmp=omc_keep_length($tmp,0,2); + $last_hex_value=$tmp; + + $spare_bit_num=strlen($network_name_text)%8; + $byte3bin="1"; + if($coding_scheme_select == 0) + $byte3bin.="000"; + else + $byte3bin.="001"; + if($ci_select == 1) + $byte3bin.="1"; + else + $byte3bin.="0"; + + $spare_bit_num_bin=decbin($spare_bit_num); + $spare_bit_num_bin=omc_keep_length($spare_bit_num_bin,0,3); + $byte3bin.=$spare_bit_num_bin; + + $byte3hex=omc_keep_length(dechex(bindec($byte3bin)),0,2); + $last_hex_value.=$byte3hex; + $last_hex_value.=$network_name_7bit_hexstr; + + $time_update_option_hex=omc_keep_length(dechex($time_update_option_select),0,2); + $time_zone_hex=omc_keep_length(dechex($time_zone_select),0,2); + + $last_hex_value.=$time_update_option_hex; + $last_hex_value.=$time_zone_hex; + echo "last_hex_value=$last_hex_value
      "; + $levels=getLevelWhere($param_oid); + $updSql = "UPDATE OBJ_320.param_99 SET initValue='$last_hex_value' WHERE $levels and instanceNo='$instanceNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + echo ""; + + echo "\n\n"; + +} + +$pubDb="OMC_PUB"; + +$mscTable="OBJ_320.param_99"; +$levels=getLevelWhere($param_oid); +$sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo"; +$res=mysqli_query($pubConn,$sql); +$rows=@mysqli_fetch_array($res); +$initValue=$rows[initValue]; +//$initValue="0484d4f29c0e0000000000000000000000000000000000000000000000000000000101"; +$readValue=$rows[readValue]; + + +//decode +$byte3=substr($initValue,2,2); +$byte3bin=decbin(hexdec($byte3)); +$coding_scheme_value=bindec(substr($byte3bin,1,3)); +$ci_value=bindec(substr($byte3bin,4,1)); +$spare_bit_num=bindec(substr($byte3bin,5,3)); +$network_name_len=hexdec(substr($initValue,0,2)); +$network_name_value=substr($initValue,4,$network_name_len*2); +$network_name_vec=string7bitTo8bit($network_name_value); +$network_name_l=$global_len; +if($spare_bit_num == 0 && $network_name_len != 0) + $network_name_l++; +//$network_name_l-=$network_name_l/8; + +$network_name_value=""; + +for($i=0;$i<$network_name_l;$i++) +{ + $network_name_value.=chr($network_name_vec[$i]); +} +//echo "network_name_value=$network_name_value,$network_name_l"; +//exit(); +$time_update_option_value=hexdec(substr($initValue,66,2)); +$time_zone_value=hexdec(substr($initValue,68,2)); + +/* +echo "coding_scheme_value=$coding_scheme_value
      "; +echo "ci_value=$ci_value
      "; +echo "network_name_len=$network_name_len,network_name_value=$network_name_value
      "; +echo "time_update_option_value=$time_update_option_value
      "; +echo "time_zone_value=$time_zone_value
      "; +*/ + +echo "
      "; +echo ""; + +//Coding Scheme +echo ""; +echo ""; +echo ""; +echo ""; + +//CI +echo ""; +echo ""; +echo ""; +echo ""; + +//Network name +echo ""; +echo ""; +echo ""; +echo ""; + +//Time update option +echo ""; +echo ""; +echo ""; +echo ""; + +//Time zone +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      "; +echo "Coding Scheme"; +echo ""; +echo ""; +echo "
      "; +echo "Add CI"; +echo ""; +echo ""; +echo "
      Network Name"; +echo ""; +echo "
      "; +echo "Time Update Option"; +echo ""; +echo ""; +echo "
      "; +echo "Time Zone"; +echo ""; +echo ""; +echo "
      "; + +echo "
      Remark:

      "; +echo "Network Identity and Time Zone

      "; +echo "- Coding Scheme: Indicate that 7-bit or UCS2 coding scheme is used.
      "; +echo "- Add CI: Indicate whether the MS should add the letters for the Country's Initials to the text string.
      "; +echo "- Network Name: A text string is to pass to the MS via NITZ.
      "; +echo "- Time Update Option: Determine whether time and time zone info is transferred to MS via NITZ.
      "; +echo "- Time Zone: Specify the local time zone.
      "; + +echo "
      "; +echo ""; +echo "  "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; + +$global_len=0; +function string8bitTo7bit($strin) +{ + global $global_len; + $len=strlen($strin); + if($len <= 0) + return ""; + + $global_len=$len-floor($len/8);; + + for($i=0;$i<$len;$i++) + { + $inHex[$i]=ord($strin[$i]); + switch($inHex[$i]) + { + //'@' + case 64: + $inHex[$i]=0x00; + break; + //'$' + case 36: + $inHex[$i]=0x02; + break; + //'_' + case 95: + $inHex[$i]=0x11; + break; + //'[' + case 91: + $inHex[$i]=0x28; + break; + //']' + case 93: + $inHex[$i]=0x29; + break; + //'/' + case 47: + $inHex[$i]=0x2f; + break; + //''' + case 96: + $inHex[$i]=0x27; + break; + //'{' + case 123: + $inHex[$i]=0x28; + break; + //'}' + case 125: + $inHex[$i]=0x29; + break; + case 0x82: + $inHex[$i]=0x05; + break; + case 0x85: + $inHex[$i]=0x7F; + break; + case 0x8A: + $inHex[$i]=0x04; + break; + case 0x8D: + $inHex[$i]=0x07; + break; + case 0x95: + $inHex[$i]=0x08; + break; + case 0x97: + $inHex[$i]=0x06; + break; + case 0x9D: + $inHex[$i]=0x03; + break; + default: + break; + } + } + + $n=0; + $index=0; + for($i=0;$i<=$len;$i++) + { + if($i<$len-1) + { + $mid1=$inHex[$i]+0; + $mid2=$inHex[$i+1]+0; + $cur=($mid1 >> $n) |(($mid2 << (7-$n)) & 0xff); + } + else + { + $mid1=$inHex[$i]; + $cur=($mid1 >> $n) & 0xff; + } + $outHex[$index++]=$cur; + echo "$cur "; + $n=($n+1)%7; + if($n==0 ) + $i++; + } + + + //for($i=0;$i<$index;$i++) + // $strout[$i]=chr($outHex[$i]); + + return $outHex; +} + +function string7bitTo8bit($strin) +{ + global $global_len; + + $len=strlen($strin); + + $ti=0; + for($i=0;$i<$len;$i+=2) + { + $tmp=substr($strin,$i,2); + $inHex[$ti]=hexdec($tmp); + $ti++; + } + + $global_len=$ti+floor($ti/8); + + + $n=0; + $j=0; + for($i=0;$i <= $ti;) + { + if($i>0) + { + $mid1=$inHex[$i]; + $mid2=$inHex[$i-1]; + $cur=(($mid1 << $n) & 0x7f) |($mid2 >> (8-$n)); + } + else + { + $mid1=$inHex[$i] & 0x7f; + $cur=$mid1; + } + $outHex[$j++] = $cur; + $n =($n+1)%8; + if($n!=0) + $i++; + } + + return $outHex; +} + +?> \ No newline at end of file diff --git a/wxc2_omc/configuration/tabParamConfigurationB/param_comm.inc b/wxc2_omc/configuration/tabParamConfigurationB/param_comm.inc new file mode 100755 index 0000000..c0f5da6 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfigurationB/param_comm.inc @@ -0,0 +1,1111 @@ + +"unknown",0=>"LEAF_TYPE",1=>"SCALAR_TABLE_TYPE",2=>"COLUMN_TABLE_TYPE",3=>"ENTRY_TYPE"); + +//access +define(ACCESS_TABLE_NAME,0); +define(ACCESS_ENTRY,21); +define(ACCESS_READ_WRITE,19); +define(ACCESS_READ_ONLY,18); +define(ACCESS_INDEX_CREATE_SPE,48); + +//value type +define(VALUE_NONE,0); +define(VALUE_STRING,2); +define(VALUE_INT,3); +define(VALUE_IP,5); +define(VALUE_TIMESTAMP,8); +define(VALUE_OPAQUE,9); + +//style +define(SHOW_HIDE,0); +define(SHOW_SELECT,1); +define(SHOW_TEXTBOX,2); +define(SHOW_LABEL,3); + +//create method +define(MANUAL_CREATE,0); +define(AUTO_CREATE,1); + +//nest table element +define(TABLE_ENTRY,0); +define(TABLE_ENTRIES,1); +define(TABLE_CREATE,2); + +//sysTypeNo +define(SYSTYPENO_MSC,320); +define(SYSTYPENO_SMSC,350); +define(SYSTYPENO_SMPP,260); +define(SYSTYPENO_OPPS,375); +define(SYSTYPENO_PPS,360); +define(SYSTYPENO_MTP3,222); +define(SYSTYPENO_SCCP,223); +define(SYSTYPENO_AAS,311); +define(SYSTYPENO_VSS,390); +define(SYSTYPENO_VLR,325); +define(SYSTYPENO_HLR,330); +define(SYSTYPENO_AUC,340); +define(SYSTYPENO_SMEG,355); +define(SYSTYPENO_EIR,380); +define(SYSTYPENO_MRFC,385); +define(SYSTYPENO_PALIM,378); +define(SYSTYPENO_RLS,379); +define(SYSTYPENO_MHC,386); +define(SYSTYPENO_MNP,370); +define(SYSTYPENO_MTP3,222); +define(SYSTYPENO_XAPP,225); + +function showParamInReadOnly($keyId,$sysId) +{ + global $objects; + + + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + $subSysNo=$sysIdArr[2]; + $objDb='OBJ_'.$sysTypeNo; + $paraConfTable=$objDb.'.paramConf'; + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + + $oid=$objects[$keyId]['oid']; + $oidwhere=getLevelWhere($oid); + $sql="select initValue from $paraTable where $oidwhere and instanceNo='0000' "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.="and subSysNo='$subSysNo' "; + + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + if($num != 0) + { + $row=@mysqli_fetch_array($res); + $returnvalue=$row[initValue]; + if(($objects[$keyId]["style"] == SHOW_LABEL || $objects[$keyId]["style"] == SHOW_SELECT )&& $objects[$keyId]["valueType"] == VALUE_INT) + { + if(trim($objects[$keyId]["setTemplate_1"]) == "") + return $returnvalue; + $options=explode(";",$objects[$keyId]["setTemplate_1"]); + for($ii=0;$iilevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + $levelNo+=2; + if($levelNo<=10) + $levelWhere.=" AND level_$levelNo=0 "; + return($levelWhere); +} + +function getParamValue($sysId,$oid,$instanceNo) +{ + $sysIdArr=explode('_',$sysId); + $sysTypeNo=$sysIdArr[0]; + $sysNo=$sysIdArr[1]; + $subSysNo=$sysIdArr[2]; + $objDb='OBJ_'.$sysTypeNo; + $paraConfTable=$objDb.'.paramConf'; + + + + if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; + else + $paraTable=$objDb.".param_99"; + $oidWhere=getLevelWhere($oid); + + if(strstr($instanceNo,".")) + $sql="select initValue from $paraTable where $oidWhere and instanceNo='$instanceNo' "; + else + $sql="select initValue from $paraTable where $oidWhere and instanceNo=$instanceNo "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.="and subSysNo='$subSysNo' "; + + + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return "--"; + + $row=@mysqli_fetch_array($res); + $originalValue=$row[initValue]; + + return $originalValue; +} + +function adjustTableName($name) +{ + $len=strlen($name); + $result=""; + + if($name[0]>='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} + +function getShowNameOfTable($name,$keyId) +{ + global $objects; + + if($keyId != -1 && strstr($objects[$keyId]['desc_1'],"Name:")) + { + $new_name=explode("Name:",$objects[$keyId]['desc_1']); + return str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $len=strlen($name); + $result=""; + + if($name[0]>='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} + +function getShowNameOfField($name,$keyId) +{ + global $objects; + + if($keyId != -1 && strstr($objects[$keyId]['desc_1'],"Name:")) + { + $new_name=explode("Name:",$objects[$keyId]['desc_1']); + return str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $len=strlen($name); + $result=""; + + for($j=0;$j<$len;$j++) + { + if($name[$j]>='A' && $name[$j]<='Z') + break; + } + for($i=$j;$i<$len;$i++) + { + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + return $result; +} + +function translateValueToOpt($operType,$valueType,$template,$value) +{ + + if(($operType == SHOW_LABEL || $operType == SHOW_SELECT) && $valueType == VALUE_INT) + { + if(trim($template) == "") + return $value; + $options=explode(";",$template); + for($ii=0;$ii"; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num > 0) + return 1; + else + return 0; +} + +/* + tableName: the name of the table, rountingSelection for example. case-ignored + $type: TABLE_ENTRY, TABLE_ENTRIES, TABLE_CREATE +*/ +function findRelationOid($tableName,$type,$sysTypeNo) +{ + $tableName=strtolower($tableName); + $dbtable="OBJ_".$sysTypeNo.".paramConf"; + if($type == TABLE_ENTRY) + $likestr=$tableName."Entry"; + else if($type == TABLE_ENTRIES) + $likestr=$tableName."Entries"; + else if($type == TABLE_CREATE) + $likestr="CreateEntry".$tableName; + + $sql="select * from $dbtable where name_1 like '%$likestr%' "; + //echo "
      $sql
      "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return ""; + $row=@mysqli_fetch_array($res); + $findOid=""; + for($i=1;$i<=10;$i++) + { + if($row["level_".$i] == '0') + break; + $findOid.=$row["level_".$i]."."; + } + $findOid=substr($findOid,0,strlen($findOid)-1); + //PrintInfo("tableName=$tableName,dbtable=$dbtable,oid=$findOid"); + return $findOid; +} + +function getTableLevel($tableOid,$sysTypeNo) +{ + $tableWhere=getLevelWhere($tableOid); + $database="OBJ_".$sysTypeNo.".paramConf"; + $sql="select desc_1 from $database where $tableWhere "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $desc_1=$row[desc_1]; + $tmp=explode("level:",$desc_1); + $level=$tmp[1]+0; + return $level; +} + +function showNavigateTitle($table_id,$table_level,$sysId,$columnTable,$instanceNo,$type) +{ + if(0) + { + echo "
      ";
      +		print_r($columnTable);
      +		echo "
      "; + } + + if($type == "show") + { + if($table_level == 1) + { + echo "{$columnTable[0][Name]}"; + } + if($table_level == 2) + { + echo ""; + echo "{$columnTable[0][Name]}"; + echo ""; + + echo " "; + + echo ""; + echo ($instanceNo+0); + echo ""; + + echo " > "; + echo "{$columnTable[1][Name]}"; + } + else if($table_level == 3) + { + echo ""; + echo "{$columnTable[0][Name]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[1][Name]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[1]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[2][Name]}"; + echo ""; + } + } + else if($type == "edit") + { + if($table_level == 1) + { + echo ""; + echo "{$columnTable[0][Name]}"; + echo ""; + + echo " "; + + echo ""; + echo ($instanceNo+0); + echo ""; + } + if($table_level == 2) + { + echo ""; + echo "{$columnTable[0][Name]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + echo ""; + echo "{$columnTable[1][Name]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[1]+0); + echo ""; + } + else if($table_level == 3) + { + echo ""; + echo "{$columnTable[0][Name]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[1][Name]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[1]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[2][Name]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[2]+0); + echo ""; + } + } + else + { + if($table_level == 1) + { + echo ""; + echo "{$columnTable[0][Name]}"; + echo ""; + + } + if($table_level == 2) + { + echo ""; + echo "{$columnTable[0][Name]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + echo ""; + echo "{$columnTable[1][Name]}"; + echo ""; + } + else if($table_level == 3) + { + echo ""; + echo "{$columnTable[0][Name]}"; + echo ""; + + echo " "; + + $tmp=explode(".",$instanceNo); + echo ""; + echo ($tmp[0]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[1][Name]}"; + echo ""; + + echo " "; + + echo ""; + echo ($tmp[1]+0); + echo ""; + + echo " > "; + + echo ""; + echo "{$columnTable[2][Name]}"; + echo ""; + } + } +} + +function GetOIDByName($sysTypeNo,$name) +{ + $database="OBJ_".$sysTypeNo.".paramConf"; + $sql="select * from $database where name_2 like '%$name%' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $oids=""; + for($i=1;$i<=10;$i++) + { + $tmpN="level_".$i; + $tmpV=$row[$tmpN]+0; + if($tmpV == 0) + break; + + $oids.=$tmpV."."; + + } + if($i>1) + $oids=substr($oids,0,strlen($oids)-1); + + return $oids; +} + +/* + This function is for the special issue of getting msc timeslot + Get the timeslot parameter from plat which the Group ID specify in trunk +*/ +function GetTrunkGroupID($tgno,$trunkno) +{ + $trunk_table_oid=GetOIDByName(SYSTYPENO_MSC,"trunkEntry"); + + $tgno_w=omc_keep_length($tgno,"0",4); + $trunkno_w=omc_keep_length($trunkno,"0",4); + $instance=$tgno_w.".".$trunkno_w; + + oidSysCommSend("320_99_99", 0, $trunk_table_oid, -1, $instance); + + $trunkGroupID_oid=GetOIDByName(SYSTYPENO_MSC,"trunkGroupID"); + $oidWhere=getLevelWhere($trunkGroupID_oid); + + $sql="select * from OBJ_320.param_99 where $oidWhere and instanceNo= '$instance' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + $value=$row[readValue]+0; + + return $value; +} + +function GetSystemStatus($sysTypeNo,$sysNo,$subSysNo=0) +{ + $due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + $ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); + + $sql="select * from OMC_PUB.sysInfo where sysTypeNo=$sysTypeNo and sysNo=$sysNo and subSysNo=$subSysNo "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return 0; + + $row=@mysqli_fetch_array($res); + $baseStat=$row[baseStat]+0; + if($baseStat == 0) + return 0; + + $updateTime=$row[updateTime]; + if($updateTime < $due_date || $updateTime > $ove_date) + return 0; + + return 1; +} +function DeleteSubTableData($sysTypeNo,$instanceNo,$tableOid,$paraTable) +{ + //echo "DeleteSubTableData($sysTypeNo,$instanceNo,$tableOid)
      "; + $where=getLevelWhere($tableOid); + $sql="delete from $paraTable where $where and instanceNo like '{$instanceNo}%'"; + @mysqli_query($pubConn,$sql); + + $where=getLevelWhere($tableOid); + $table="OBJ_{$sysTypeNo}.paramConf"; + $sql="select * from $table where name_2 like '%Entries' and $where "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $entriesName=$row[name_2]; + $len=strlen($entriesName); + for($j=0;$j<$len;$j++) + { + if($entriesName[$j]<'a'||$entriesName[$j]>'z') + break; + } + $entriesName=substr($entriesName,$j); + $entriesName=str_replace("Entries","",$entriesName); + $entryoid=findRelationOid($entriesName,TABLE_ENTRY,$sysTypeNo); + + DeleteSubTableData($sysTypeNo,$instanceNo,$entryoid,$paraTable); + } +} + +function PrintInfo($info) +{ + $command="echo '$info' >> /tmp/omcdebug.txt "; + system($command); +} +?> + + + 'parameter' order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + //echo "$sql
      "; + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $tabConf[$i][Name]=adjustTableName($row[name_2]); + $tabConf[$i][OID]=getOIDByRow($row); + + $checkoid=$tabConf[$i][OID].".1.1.0"; + $checkwhere=getLevelWhere($checkoid); + $checksql="select desc_2 from OBJ_{$sysTypeNo}.paramConf where $checkwhere"; + $checkres=@mysqli_query($pubConn,$checksql); + $checknum=@mysqli_num_rows($checkres); + if($checknum == 1) + { + $checkrow=@mysqli_fetch_array($checkres); + $desc=$checkrow[desc_2]; + if(strstr($desc,"Name:")) + { + $new_name=explode("Name:",$desc); + $tabConf[$i][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + } + + } + if($num == 0) + return 0; + return $tabConf; +} + +function InitTab($sysTypeNo) +{ + echo "\n\n"; +} +$previous_left=20; +function AddTab($id,$value,$lable,$image_1,$image_2,$imageWidth,$imageHeight) +{ + global $previous_left; + echo ""; + echo "{$lable}"; + + echo ""; + echo "{$lable}"; + + echo "\n\n"; +} +define(GET_OID,0); +define(SCALAR_ITEM_OID,1); +function GetAllOIDArr($sysTypeNo,$get_type=0) +{ + $tabConf=GetTabConf($sysTypeNo); + if(0) + { + echo "
      ";
      +		print_r($tabConf);
      +		echo "
      "; + } + $tab_id_count=sizeof($tabConf); + for($table_id=0;$table_id<$tab_id_count;$table_id++) + { + $tableOid=$tabConf[$table_id][OID]; + //Get the sub oid of the table + $oidwhere=getLevelWhere($tableOid); + $size=sizeof(explode(".",$tableOid)); + $oidwhere.=" AND level_".($size+1).">0 "; + $lastlevel="level_".($size+2); + $sql="select * from OBJ_{$sysTypeNo}.paramConf where $oidwhere order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + + $scalarTableIndex=0; + $columnTableIndex=0; + $scalarItemIndex=0; + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + if($row[$lastlevel] == 0) + { + //scalar table + if($row[maxAccess] == ACCESS_TABLE_NAME && $row[operType] == 2) + { + $scalarTableIndex++; + } + //column table + else if($row[maxAccess] == ACCESS_ENTRY && strstr($row[name_2],"Table")) + { + //only get the top two level table + if($columnTableIndex < 2) + $oidArr[]=getOIDByRow($row).".1"; + $columnTableIndex++; + } + //scalar item + else + { + $scalarItemIndex++; + if(stristr($row[name_2],"Command")) + continue; + if($row[maxAccess] == ACCESS_ENTRY) + continue; + if(strstr($row['desc_2'],"Hidden Parameter")) + continue; + $tmpss=getOIDByRow($row); + $oidArr[]=$tmpss; + $scalar_oids[]=$tmpss; + } + } + } + } + + if($get_type == SCALAR_ITEM_OID) + return $scalar_oids; + else + return $oidArr; +} +?> + diff --git a/wxc2_omc/configuration/tabParamConfigurationB/param_edit.php b/wxc2_omc/configuration/tabParamConfigurationB/param_edit.php new file mode 100755 index 0000000..b150559 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfigurationB/param_edit.php @@ -0,0 +1,744 @@ + + + + + +"; +global $OMC_server; + +$canwrite_flag=checkWritePrivilege(); +$sysId = $_REQUEST['sysId']; +$table_id = $_REQUEST['table_id']; +$table_level = $_REQUEST['table_level']; +$instanceNo = $_REQUEST['instanceNo']; +$need_get_again = $_REQUEST['need_get_again']; +$getTableOid = $_REQUEST['getTableOid']; + +$sysIdArr=explode('_',$sysId); +$sysTypeNo=$sysIdArr[0]; +$sysNo=$sysIdArr[1]; +$subSysNo=$sysIdArr[2]; +$objDb='OBJ_'.$sysTypeNo; +$paraConfTable=$objDb.'.paramConf'; +$pubDb='OMC_PUB'; +$objConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $objDb); + +if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; +else + $paraTable=$objDb.".param_99"; + +$tabConf=GetTabConf($sysTypeNo); +$tableOid=$tabConf[$table_id][OID]; + +$sql="select sysTypeName from OMC_PUB.sysConf where sysTypeNo='$sysTypeNo' "; +$res=@mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); +$module_name=$row[sysTypeName]; + +if(0) +{ + echo "
      ";
      +	print_r($tabConf);
      +	echo "
      "; +} + +if($need_get_again) +{ + echo "need_get_again=$need_get_again
      "; + $commIdStr=oidSysCommSend($sysId,0,$getTableOid,-1,$instanceNo); + echo "\n"; +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + echo "
      "; + $set = $_REQUEST['set']; + $get = $_REQUEST['get']; + $lock = $_REQUEST['lock']; + $unlock = $_REQUEST['unlock']; + $adminStatOid = $_REQUEST['adminStatOid']; + if($set) + { + $commIdStr=oidSysCommSend($sysId,3,$getTableOid,-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo&need_get_again=1&get=1&getTableOid=$getTableOid"); + } + else if($get) + { + //Get the timeslot parameter from the plat(trunk group id) + $timeslot_table_oid=GetOIDByName(SYSTYPENO_MSC,"channelEntry"); + if($sysTypeNo == SYSTYPENO_MSC && $getTableOid == $timeslot_table_oid) + { + $tmps=explode(".",$instanceNo); + $grounp_id=GetTrunkGroupID($tmps[0]+0,$tmps[1]+0); + if($grounp_id == 1) + $tmpSysId="320_1_0"; + else + $tmpSysId="320_0_0"; + + if(!GetSystemStatus(SYSTYPENO_MSC,$grounp_id)) + $tmpSysId="320_99_99"; + + + $commIdStr=oidSysCommSend($tmpSysId,0,$getTableOid,-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo"); + } + else + { + $commIdStr=oidSysCommSend($sysId,0,$getTableOid,-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo"); + } + } + else if($lock || $unlock) + { + $tmpWhere=getLevelWhere($adminStatOid); + if($lock) + $initValue=0; + else + $initValue=1; + + $updateSql="UPDATE $paraTable SET initValue=$initValue WHERE $tmpWhere AND instanceNo=$instanceNo "; + + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $updateSql.="and subSysNo='$subSysNo' "; + + mysqli_query($objConn,$updateSql); + $commIdStr=oidSysCommSend($sysId,3,$adminStatOid,-1,$instanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo"); + } +} + +echo "
      "; + + +//Get the sub oid of the table +$oidwhere=getLevelWhere($tableOid); +$size=sizeof(explode(".",$tableOid)); +$oidwhere.=" AND level_".($size+1).">0 "; +$lastlevel="level_".($size+2); +$sql="select * from $paraConfTable where $oidwhere order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; +$res=@mysqli_query($objConn,$sql); +$num=@mysqli_num_rows($res); + +$scalarTableIndex=0; +$columnTableIndex=0; +$scalarItemIndex=0; +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + if($row[$lastlevel] == 0) + { + //scalar table + if($row[maxAccess] == ACCESS_TABLE_NAME && $row[operType] == 2) + { + $scalarTable[$scalarTableIndex][Name]=adjustTableName($row[name_2]); + $scalarTable[$scalarTableIndex][OID]=getOIDByRow($row); + $scalarTableIndex++; + } + //column table + else if($row[maxAccess] == ACCESS_ENTRY && strstr($row[name_2],"Table")) + { + $columnTable[$columnTableIndex][Name]=adjustTableName($row[name_2]); + $columnTable[$columnTableIndex][OID]=getOIDByRow($row); + if(strstr($row[desc_2],"Name:")) + { + $new_name=explode("Name:",$row[desc_2]); + $columnTable[$columnTableIndex][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + $columnTableIndex++; + } + //scalar item + else + { + $scalarItem[$scalarItemIndex][Name]=adjustTableName($row[name_2]); + $scalarItem[$scalarItemIndex][OID]=getOIDByRow($row); + $scalarItem[$scalarItemIndex][MaxAccess]=$row[maxAccess]+0; + $scalarItem[$scalarItemIndex][Style]=$row[operType]+0; + $scalarItem[$scalarItemIndex][ValueType]=$row[valueType]+0; + $scalarItem[$scalarItemIndex][MinValue]=$row[minValue]+0; + $scalarItem[$scalarItemIndex][MaxValue]=$row[maxValue]+0; + $scalarItem[$scalarItemIndex][Template]=$row[setTemplate_2]; + $scalarItem[$scalarItemIndex][Tip]=$row[note_2]; + $scalarItem[$scalarItemIndex][Desc]=$row['desc_2']; + if(strstr($row['desc_2'],"Name:")) + { + $new_name=explode("Name:",$row['desc_2']); + $scalarItem[$scalarItemIndex][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $scalarItemIndex++; + } + } +} + +if(0) +{ + echo "
      ";
      +	print_r($columnTable);
      +	echo "
      "; +} + +for($i=0;$i<$columnTableIndex;$i++) +{ + //echo "{$columnTable[$i][Name]} {$columnTable[$i][OID]}
      "; + $oidwhere=getLevelWhere($columnTable[$i][OID]); + $size=sizeof(explode(".",$columnTable[$i][OID])); + $oidwhere.=" AND level_".($size+1)."=1 "; + $sql="select * from $paraConfTable where $oidwhere order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + $res=@mysqli_query($objConn,$sql); + $num=@mysqli_num_rows($res); + $tableObject[$i][FieldCount]=$num; + $tableObject[$i][EntriesCount]=0; + $tableObject[$i][DeleteOID]=-1; + for($j=0;$j<$num;$j++) + { + $row=@mysqli_fetch_array($res); + $tableObject[$i][$j][RawName]=$row[name_2]; + $tableObject[$i][$j][Name]=getShowNameOfField($row[name_2],-1); + $tableObject[$i][$j][MaxAccess]=$row[maxAccess]; + $tableObject[$i][$j][Style]=$row[operType]; + $tableObject[$i][$j][ValueType]=$row[valueType]; + $tableObject[$i][$j][MinValue]=$row[minValue]; + $tableObject[$i][$j][MaxValue]=$row[maxValue]; + $tableObject[$i][$j][Template]=$row[setTemplate_2]; + $tableObject[$i][$j][Desc]=$row[desc_2]; + $tableObject[$i][$j][Tip]=$row[note_2]; + $tableObject[$i][$j][OID]=getOIDByRow($row); + + if(strstr($tableObject[$i][$j][Desc],"Key Parameter")) + $tableObject[$i][$j][KeyFlag]=1; + else + $tableObject[$i][$j][KeyFlag]=0; + + if(strstr($tableObject[$i][$j][Name],"Entry") && $tableObject[$i][$j][MaxAccess] == ACCESS_ENTRY) + { + $tableObject[$i][$j][Name]=getShowNameOfTable($row[name_2],-1); + $tableObject[$i][EntryIndex]=$j; + } + else if(strstr($tableObject[$i][$j][Name],"Entries")) + { + $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][RawName]=$tableObject[$i][$j][RawName]; + $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][Name]=$tableObject[$i][$j][Name]; + $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][OID]=$tableObject[$i][$j][OID]; + $tableObject[$i][EntriesCount]++; + } + if(strstr($tableObject[$i][$j][RawName],"RowStatus")) + { + $tableObject[$i][$j][Name]="Delete"; + if($tableObject[$i][$j][KeyFlag] == 0) + $tableObject[$i][DeleteOID]=-1; + else + $tableObject[$i][DeleteOID]=$tableObject[$i][$j][OID]; + } + if(strstr($tableObject[$i][$j][RawName],"Index")) + $tableObject[$i][IndexIndex]=$j; + + if(strstr($tableObject[$i][$j][Desc],"Name:")) + { + $new_name=explode("Name:",$tableObject[$i][$j][Desc]); + $tableObject[$i][$j][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + //echo "$i $j {$tableObject[$i][$j][Name]} {$tableObject[$i][$j][OID]}
      "; + } + //Table level + if(strstr($tableObject[$i][$tableObject[$i][EntryIndex]][Desc],"level")) + { + $tmp=explode("level:",$tableObject[$i][$tableObject[$i][EntryIndex]][Desc]); + $tableObject[$i][TableLevel]=$tmp[1]+0; + } + else + { + $tableObject[$i][TableLevel]=1; + } +} +$thisTableIndex=-1; +for($i=0;$i<$columnTableIndex;$i++) +{ + if($tableObject[$i][TableLevel] == $table_level) + $thisTableIndex=$i; + //Create index + $tableObject[$i][CreateOID]=-1; + if($tableObject[$i][TableLevel] == 1) + { + for($j=0;$j<$tableObject[$i][FieldCount];$j++) + { + if(strstr($tableObject[$i][$j][Name],"Index")) + { + if($tableObject[$i][$j][MaxAccess] == ACCESS_INDEX_CREATE_SPE) + $tableObject[$i][CreateOID]=$tableObject[$i][$j][OID]; + break; + } + } + } + else + { + $lastCreateLabel="CreateEntry".str_replace("Entry","",$tableObject[$i][$tableObject[$i][EntryIndex]][RawName]); + $lastEntriesLabel=str_replace("Entry","",$tableObject[$i][$tableObject[$i][EntryIndex]][RawName])."Entries"; + $lastLevel=$tableObject[$i][TableLevel]-1; + for($j=0;$j<$columnTableIndex;$j++) + { + if($tableObject[$j][TableLevel] == $lastLevel) + break; + } + if($j != $columnTableIndex) + { + for($z=0;$z<$tableObject[$j][FieldCount];$z++) + { + if(stristr($tableObject[$j][$z][RawName],$lastCreateLabel)) + { + $tableObject[$i][CreateOID]=$tableObject[$j][$z][OID]; + break; + } + } + for($z=0;$z<$tableObject[$j][EntriesCount];$z++) + { + if(stristr($tableObject[$j][Entries][$z][RawName],$lastEntriesLabel)) + { + $tableObject[$i][CreateDeleteRelateOID]=$tableObject[$j][Entries][$z][OID]; + break; + } + } + } + else + { + echo "Some table hasn't configure the level
      "; + exit(); + } + } +} +if($columnTableIndex > 0) +{ + if(0) + { + echo "
      ";
      +		print_r($tableObject);
      +		echo "
      "; + } + + if($thisTableIndex == -1) + { + exit("thisTableIndex error"); + } + $thisTableConf=$tableObject[$thisTableIndex]; + if(0) + { + echo "
      ";
      +		print_r($thisTableConf);
      +		echo "
      "; + } + + $realcreate = $_REQUEST['realcreate']; + $createIndex = $_REQUEST['createIndex']; + $create = $_REQUEST['create']; + $createOid = $_REQUEST['createOid']; + $updateOid = $_REQUEST['updateOid']; + $indexOid = $_REQUEST['indexOid']; + $oldtableOid = $_REQUEST['oldtableOid']; + + if($realcreate) + { + //echo "sysId=$sysId,table_id=$table_id,table_level=$table_level,instanceNo=$instanceNo
      "; + //echo "createIndex=$createIndex,createOid=$createOid,updateOid=$updateOid,indexOid=$indexOid,tableOid=$tableOid
      "; + $oldInstanceNo=$instanceNo; + if($table_level == 1) + { + $createInstanceNo=omc_keep_length($createIndex,'0',4); + $instanceNo=$createInstanceNo; + } + else + { + $createInstanceNo=$instanceNo.".".omc_keep_length($createIndex,'0',4); + $instanceNo=$createInstanceNo; + } + + if($createMethod == AUTO_CREATE) + $createIndex=1; + $sql="replace into $paraTable set initValue='$createIndex',instanceNo='$createInstanceNo'"; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.=",subSysNo='$subSysNo' "; + + $indexOidArr=explode(".",$createOid); + for($i=0;$i"; + mysqli_query($objConn,$sql); + + //send create command + $commIdStr=oidSysCommSend($sysId,9,$createOid,-1,$createInstanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); + + if($createMethod == AUTO_CREATE) + { + $indexLevelWhere=getLevelWhere($createOid); + $indexSql="select * from $paraTable where $indexLevelWhere and instanceNo='$createInstanceNo' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $indexSql.="and subSysNo='$subSysNo' "; + + $indexres=@mysqli_query($pubConn,$indexSql); + $indexrow=@mysqli_fetch_array($indexres); + $newIndex=$indexrow[readValue]+0; + + $newInstanceNo=omc_keep_length($newIndex,'0',4); + if($table_level == 1) + $instanceNo=$newInstanceNo; + else + $instanceNo=$oldInstanceNo.".".$newInstanceNo; + //echo "oldInstanceNo=$oldInstanceNo,newIndex=$newIndex,instanceNo=$instanceNo
      "; + } + + + //update the entries + if(trim($updateOid)!="") + { + $commIdStr=oidSysCommSend($sysId,0,$updateOid,-1,$oldInstanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); + } + + //get the table + if($oldInstanceNo=="0000" && $table_level == 1) + $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,""); + else + $commIdStr=oidSysCommSend($sysId,5,$oldtableOid,-1,$oldInstanceNo); + checkState($commIdStr,"./param_edit.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$oldInstanceNo&create=1&createOid=$createOid&updateOid=$updateOid&indexOid=$indexOid&oldtableOid=$oldtableOid"); + + } + + $oidwhere=getLevelWhere($thisTableConf[$thisTableConf[EntryIndex]][OID]); + $sql="select * from $paraTable where $oidwhere and instanceNo='$instanceNo' "; + //echo "$sql
      "; + $res=@mysqli_query($objConn,$sql); + $num=@mysqli_num_rows($res); + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $oid=getOIDByRow($row); + $fieldIndex=sizeof(explode(".",$oid)); + $fieldPos=$row["level_".$fieldIndex]+0; + $recordData[$fieldPos]=$row[initValue]; + } + if(0) + { + echo "
      ";
      +		print_r($recordData);
      +		echo "
      "; + } + + echo "
      "; + if($create) + showNavigateTitle($table_id,$table_level,$sysId,$columnTable,$instanceNo,"create"); + else + showNavigateTitle($table_id,$table_level,$sysId,$columnTable,$instanceNo,"edit"); + + if($create) + { + echo "
      "; + //echo "table_level=$table_level,instanceNo=$instanceNo,createOid=$createOid,updateOid=$updateOid,indexOid=$indexOid,tableOid=$tableOid
      "; + $createwhere=getLevelWhere($createOid); + $createsql="select * from $paraConfTable where $createwhere "; + $createres=@mysqli_query($objConn,$createsql); + $createnum=@mysqli_num_rows($createres); + if($createnum == 0) + exit("Can not find the create index $createOid"); + $createrow=@mysqli_fetch_array($createres); + $auto=0; + if(strstr($createrow[setTemplate_2],"create=1")) + $auto=1; + + $minValue=$createrow[minValue]+0; + $maxValue=$createrow[maxValue]+0; + echo "
      "; + echo ""; + echo ""; + if($auto) + { + echo ""; + echo ""; + echo ""; + echo "
      Index is assigned by $module_name
      "; + echo ""; + } + else + { + $tmpwhere=getLevelWhere($indexOid); + if($instanceNo != "0000") + $sql="select initValue from $paraTable where $tmpwhere and instanceNo like '$instanceNo.%' "; + else + $sql="select initValue from $paraTable where $tmpwhere "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.="and subSysNo='$subSysNo' "; + //echo "$sql
      "; + $res=@mysqli_query($objConn,$sql); + while($row=@mysqli_fetch_array($res)) + $index_use_flags[$row[initValue]+0]=1; + + echo "Please input the index No."; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if($no_use_count == 0) + { + echo ""; + echo "

      "; + echo "
      "; + echo "Note: The table is full"; + echo "
      "; + } + else + { + echo ""; + } + } + + exit(); + } + echo "

      "; + echo ""; + for($i=0;$i<$thisTableConf[FieldCount];$i++) + { + if($thisTableConf[$i][MaxAccess] == ACCESS_ENTRY) + continue; + if($thisTableConf[$i][Name] == "Delete") + continue; + if(strstr($thisTableConf[$i][RawName],"CreateEntry")) + continue; + + $tmp=explode(".",$thisTableConf[$i][OID]); + $ni=$tmp[sizeof($tmp)-1]+0; + + echo ""; + echo ""; + if(strstr($thisTableConf[$i][RawName],"Entries")) + { + $nextLevel=$table_level+1; + echo ""; + } + else if(strstr($thisTableConf[$i][Desc],"RelationPoint")) + { + $tmp1=strstr($thisTableConf[$i][Desc],"RelationPoint:"); + $tmp2=explode(";",$tmp1); + $tmp3=explode("RelationPoint:",$tmp2[0]); + $rTableOid=$tmp3[1]; + + $showvalue=$recordData[$ni]; + echo ""; + } + else if($thisTableConf[$i][MaxAccess] == ACCESS_READ_ONLY) + { + $showValue=translateValueToOpt($thisTableConf[$i][Style],$thisTableConf[$i][ValueType],$thisTableConf[$i][Template],$recordData[$ni]); + echo ""; + } + else if($thisTableConf[$i][ValueType] == VALUE_OPAQUE) + { + echo ""; + } + else + { + echo ""; + } + + echo ""; + } + echo "
      "; + echo $thisTableConf[$i][Name]; + echo "{$recordData[$ni]}"; + if(trim($showvalue) == "--" || trim($showvalue)=="") + { + echo "--"; + } + else + { + + $tmp1=explode(" ",$showvalue); + $tmp2=$tmp1[1]; + $tmp3=explode("-",$tmp2); + $tmp4=omc_keep_length($tmp3[0],'0',4); + $tmp5=omc_keep_length($tmp3[1],'0',4); + $rInstanceNo=$tmp4.".".$tmp5; + $rWhere=getLevelWhere($rTableOid); + $rsql="select * from $paraTable where instanceNo='$rInstanceNo' and $rWhere "; + $rres=mysqli_query($objConn,$rsql); + $rnum=mysqli_num_rows($rres); + //echo "$rsql"; + if($rnum == 0) + echo "--"; + else + { + + $new_table_level=getTableLevel($rTableOid,$sysTypeNo); + $tmp1=explode(".",$rTableOid); + $new_table_id=$tmp1[1]-1; + //echo "rInstanceNo=$rInstanceNo,rTableOid=$rTableOid,new_table_level=$new_table_level,new_table_id=$new_table_id"; + echo "$showvalue"; + } + } + echo "{$showValue}"; + if(stristr($thisTableConf[$i][RawName],"NITZ")) + { + $mscTable="OBJ_320.param_99"; + $levels=getLevelWhere($thisTableConf[$i][OID]); + $sql="SELECT * FROM $mscTable WHERE $levels AND instanceNo=$instanceNo"; + $res=mysqli_query($objConn,$sql); + $rows=@mysqli_fetch_array($res); + $initValue=$rows[initValue]; + $readValue=$rows[readValue]; + if($initValue == '') + $initValue="--"; + echo ""; + if(strlen($initValue)>8) + $showValue=substr($initValue,0,8); + if($initValue == $readValue) + echo "$showValue"; + else + echo "$showValue"; + echo ""; + } + else + { + showParameter($sysId,$thisTableConf[$i][OID],$instanceNo); + } + echo ""; + showParameterAdv($sysId,$thisTableConf[$i][OID],$instanceNo); + echo "
      "; + + //lock and unlock button + for($i=0;$i<$thisTableConf[FieldCount];$i++) + { + if(strstr($thisTableConf[$i][RawName],"AdministrationState") ) + { + if($canwrite_flag) + echo ""; + else + echo ""; + echo "  "; + if($canwrite_flag) + echo ""; + else + echo ""; + echo "  "; + echo ""; + break; + } + } + + + echo ""; + echo "  "; + if($canwrite_flag) + echo ""; + else + echo ""; +} + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "

      "; +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/tabParamConfigurationB/param_index.php b/wxc2_omc/configuration/tabParamConfigurationB/param_index.php new file mode 100755 index 0000000..c039c27 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfigurationB/param_index.php @@ -0,0 +1,21 @@ + + + + + + + + <body> + + <p>Your browser can not support frame</p> + + </body> + + + + \ No newline at end of file diff --git a/wxc2_omc/configuration/tabParamConfigurationB/param_show_table.php b/wxc2_omc/configuration/tabParamConfigurationB/param_show_table.php new file mode 100755 index 0000000..d75a74d --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfigurationB/param_show_table.php @@ -0,0 +1,1009 @@ + + + + + +"; + +$sysIdArr=explode('_',$sysId); +$sysTypeNo=$sysIdArr[0]; +$sysNo=$sysIdArr[1]; +$subSysNo=$sysIdArr[2]; +$objDb='OBJ_'.$sysTypeNo; +$paraConfTable=$objDb.'.paramConf'; +$pubDb='OMC_PUB'; +if(checkIndependSystem($sysTypeNo))//Plat + $paraTable=$objDb.".param_".$sysNo; +else + $paraTable=$objDb.".param_99"; + +//check the system whether exist +$sysConfTable = 'sysConf'; +$sysInfoTable = 'sysInfo'; +if(($sysNo == '99') || ($subSysNo == '99')){ + if($sysNo == '99'){ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + "; + + }else{ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' + "; + } + if($DEBUG)echo "sysIdSql(1) = $sysIdSql
      "; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1){ + echo " $strUninstalled
      "; + exit(); + } +}else{ + $sysIdSql ="SELECT sysTypeName,$sysInfoTable.sysTypeNo,sysNo,subSysNo,sysAlias + FROM $sysInfoTable,$sysConfTable + WHERE $sysInfoTable.sysTypeNo=$sysConfTable.sysTypeNo + AND $sysInfoTable.sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' + AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "sysIdSql(2) = $sysIdSql
      "; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1){ + echo " $strUninstalled
      "; + exit(); + } +} + + +$tabConf=GetTabConf($sysTypeNo); +$tableOid=$tabConf[$table_id][OID]; + +if(0) +{ + echo "
      ";
      +	print_r($tabConf);
      +	echo "
      "; +} + +/**********************************************/ +//echo "tableOid=$tableOid
      "; +//Gommand + +if($delete == 1) +{ + if(0) + { + //echo "delete
      "; + //echo "sysId=$sysId,table_id=$table_id,table_level=$table_level,instanceNo=$instanceNo,deleteOid=$deleteOid,updateOid=$updateOid,getTableOid=$getTableOid,deleteIndex=$deleteIndex
      "; + } + //Set the value=6 in the db + $tmpwhere=getLevelWhere($deleteOid); + $sql="update $paraTable set initValue='6' where $tmpwhere and instanceNo='$deleteIndex' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $sql.="and subSysNo='$subSysNo' "; + mysqli_query($pubConn,$sql); + + //Send delete command + $commIdStr=oidSysCommSend($sysId,3,$deleteOid,-1,$deleteIndex); + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo"); + + //Update the entries field + if(trim($updateOid)!="") + { + $commIdStr=oidSysCommSend($sysId,0,$updateOid,-1,$instanceNo); + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=$instanceNo"); + } + + //Get the table + $tmpArr[0][sysId]=$sysId; + $tmpArr[0][oid]=$getTableOid; + if($instanceNo=="0000") + $tmpArr[0][instanceNo]=""; + else + $tmpArr[0][instanceNo]=$instanceNo; + getParam($tmpArr); + + //delete the sub table object + DeleteSubTableData($sysTypeNo,$deleteIndex,$getTableOid,$paraTable); +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $delSql="delete from $paraTable where instanceNo='' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $delSql.="and subSysNo='$subSysNo' "; + mysqli_query($pubConn,$delSql); + +echo "\n\n"; +echo "
      "; + + if($scalar_item_get) + { + getParam($getArr); + } + else if($scalar_item_set) + { + $len=sizeof($setArr); + $commIdStr=""; + for($i=0;$i<$len;$i++) + { + $tmpCommIdStr=oidSysCommSend($setArr[$i][sysId],3,$setArr[$i][oid],-1); + $commIdStr=$commIdStr.$tmpCommIdStr; + } + if($len>0) + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&table_id=$table_id&instanceNo=$instanceNo"); + } + else if($column_table_get) + { + //Get the timeslot parameter from the plat(trunk group id) + $trunk_table_oid=GetOIDByName(SYSTYPENO_MSC,"channelEntry"); + for($i=0;$i"; + $commIdStr=oidSysCommSend($sysId,3,$commands[$i][oid],-1,"0000"); + checkState($commIdStr,"./param_show_table.php?sysId=$sysId&table_id=$table_id&table_level=$table_level&instanceNo=0000"); + + break; + } + } +} + +echo "
      "; + +//Get the sub oid of the table +$oidwhere=getLevelWhere($tableOid); +$size=sizeof(explode(".",$tableOid)); +$oidwhere.=" AND level_".($size+1).">0 "; +$lastlevel="level_".($size+2); +$sql="select * from $paraConfTable where $oidwhere order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; +$res=@mysqli_query($pubConn,$sql); +$num=@mysqli_num_rows($res); + +$scalarTableIndex=0; +$columnTableIndex=0; +$scalarItemIndex=0; +$scalarItemReadCount=0; +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + if($row[$lastlevel] == 0) + { + //scalar table + if($row[maxAccess] == ACCESS_TABLE_NAME && $row[operType] == 2) + { + $scalarTable[$scalarTableIndex][Name]=adjustTableName($row[name_2]); + $scalarTable[$scalarTableIndex][OID]=getOIDByRow($row); + $scalarTableIndex++; + } + //column table + else if($row[maxAccess] == ACCESS_ENTRY && strstr($row[name_2],"Table")) + { + $columnTable[$columnTableIndex][Name]=adjustTableName($row[name_2]); + $columnTable[$columnTableIndex][OID]=getOIDByRow($row); + if(strstr($row[desc_2],"Name:")) + { + $new_name=explode("Name:",$row[desc_2]); + $columnTable[$columnTableIndex][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + $columnTableIndex++; + } + //scalar item + else + { + $scalarItem[$scalarItemIndex][Name]=adjustTableName($row[name_2]); + $scalarItem[$scalarItemIndex][RawName]=$row[name_2]; + $scalarItem[$scalarItemIndex][OID]=getOIDByRow($row); + $scalarItem[$scalarItemIndex][MaxAccess]=$row[maxAccess]+0; + $scalarItem[$scalarItemIndex][Style]=$row[operType]+0; + $scalarItem[$scalarItemIndex][ValueType]=$row[valueType]+0; + $scalarItem[$scalarItemIndex][MinValue]=$row[minValue]+0; + $scalarItem[$scalarItemIndex][MaxValue]=$row[maxValue]+0; + $scalarItem[$scalarItemIndex][Template]=$row[setTemplate_2]; + $scalarItem[$scalarItemIndex][Tip]=$row[note_2]; + $scalarItem[$scalarItemIndex][Desc]=$row['desc_2']; + if(strstr($row['desc_2'],"Name:")) + { + $new_name=explode("Name:",$row['desc_2']); + $scalarItem[$scalarItemIndex][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + if($scalarItem[$scalarItemIndex][MaxAccess] != ACCESS_ENTRY && !strstr($scalarItem[$scalarItemIndex][Desc],"Hidden Parameter") && !stristr($scalarItem[$i][Name],"Command")) + $scalarItemReadCount++; + + $scalarItemIndex++; + } + } +} + +if(0) +{ + echo "
      ";
      +	print_r($scalarItem);
      +	echo "
      "; +} + + +if($getAll) +{ + +echo "\n\n"; +for($i = 1; $i <= 4096; $i++ ) print(" "); +echo "
      "; + + //Insert record when the scalar item is not exist + $scalar_oids=GetAllOIDArr($sysTypeNo,SCALAR_ITEM_OID); + $scalar_oids_num=sizeof($scalar_oids); + + + for($i=0;$i<$scalar_oids_num;$i++) + { + $checkoid=$scalar_oids[$i].".0"; + $oidwhere=getLevelWhere($checkoid); + $checksql="select * from $paraTable where $oidwhere and instanceNo='0000' "; + $checkres=@mysqli_query($pubConn,$checksql); + $checknum=@mysqli_num_rows($checkres); + if($checknum == 0) + { + $insertlevel=str_replace("AND",",",$oidwhere); + $insertsql="replace into $paraTable set initValue='',instanceNo='0000',$insertlevel "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $insertsql="replace into $paraTable set subSysNo='$subSysNo',initValue='',instanceNo='0000',$insertlevel "; + //echo "$insertsql
      "; + mysqli_query($pubConn,$insertsql); + echo mysqli_error($pubConn); + } + } + + + $getAllArr=GetAllOIDArr($sysTypeNo); + if(0) + { + echo "
      ";
      +		print_r($getAllArr);
      +		echo "
      "; + } + $get_count=sizeof($getAllArr); + + for($i=0;$i<$get_count;$i++) + { + $tmpArr[$i][sysId]=$sysId; + $tmpArr[$i][oid]=$getAllArr[$i]; + $tmpArr[$i][instanceNo]=""; + } + getParam($tmpArr,1); +} + +//Scalar item +$scalarItemCommandCount=0; +$scalarItemWriteCount=0; +$setArrNo=0; +$getArrNo=0; +if($scalarItemIndex > 0) +{ + echo "
      "; + echo ""; + if($scalarItemReadCount) + echo ""; + for($i=0;$i<$scalarItemIndex;$i++) + { + if($scalarItem[$i][MaxAccess] == ACCESS_ENTRY) + continue; + if(strstr($scalarItem[$i][Desc],"Hidden Parameter")) + continue; + if(stristr($scalarItem[$i][Name],"Command")) + { + $scalarItemCommandIndexes[$scalarItemCommandCount]=$i; + $scalarItemCommandCount++; + continue; + } + if($scalarItem[$i][MaxAccess] == ACCESS_READ_WRITE) + { + echo ""; + echo ""; + echo ""; + $setArrNo++; + $scalarItemWriteCount++; + } + echo ""; + echo ""; + echo ""; + $getArrNo++; + + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      ParameterValue
      {$scalarItem[$i][Name]}"; + //if the scalar leaf not exist in the db, insert it first + $checklevel=getLevelWhere($scalarItem[$i][OID]); + $checksql="select * from $paraTable where $checklevel and instanceNo='0000' "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $checksql.="and subSysNo='$subSysNo' "; + $checkres=mysqli_query($pubConn,$checksql); + echo mysqli_error($pubConn); + $checknum=mysqli_num_rows($checkres); + if($checknum == 0) + { + $insertlevel=str_replace("AND",",",$checklevel); + $insertsql="replace into $paraTable set initValue='',instanceNo='0000',$insertlevel "; + if(checkPlatWhoHaveSubSysNo($sysTypeNo,$sysNo)) + $insertsql="replace into $paraTable set subSysNo='$subSysNo',initValue='',instanceNo='0000',$insertlevel "; + mysqli_query($pubConn,$insertsql); + echo mysqli_error($pubConn); + } + + if($scalarItem[$i][ValueType] == VALUE_OPAQUE) + showParameter($sysId,$scalarItem[$i][OID],'0000'); + else + showParameterAdv($sysId,$scalarItem[$i][OID],'0000'); + echo "
      "; + + if($scalarItemReadCount > 0) + echo ""; + echo "  "; + if($scalarItemWriteCount > 0) + { + if($canwrite_flag) + echo ""; + else + echo ""; + } + echo " "; + $command_index=0; + for($i=0;$i<$scalarItemCommandCount;$i++) + { + $index=$scalarItemCommandIndexes[$i]; + $template=trim($scalarItem[$index][Template]); + $options=explode(";",$template); + for($ii=0;$ii"; + $showName=getShowNameOfTable($val,-1); + echo " "; + if($canwrite_flag) + echo ""; + else + echo ""; + echo ""; + echo ""; + //echo ""; + $command_index++; + } + } +} + +//Scalar table(suspend) + +//Column table +//$table_level=3; +//$instanceNo="0005.0001"; +if(!isset($table_level)) + $table_level=1; +for($i=0;$i<$columnTableIndex;$i++) +{ + //echo "{$columnTable[$i][Name]} {$columnTable[$i][OID]}
      "; + $oidwhere=getLevelWhere($columnTable[$i][OID]); + $size=sizeof(explode(".",$columnTable[$i][OID])); + $oidwhere.=" AND level_".($size+1)."=1 "; + $sql="select * from $paraConfTable where $oidwhere order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + $tableObject[$i][FieldCount]=$num; + $tableObject[$i][EntriesCount]=0; + $tableObject[$i][DeleteOID]=-1; + for($j=0;$j<$num;$j++) + { + $row=@mysqli_fetch_array($res); + $tableObject[$i][$j][RawName]=$row[name_2]; + $tableObject[$i][$j][Name]=getShowNameOfField($row[name_2],-1); + $tableObject[$i][$j][MaxAccess]=$row[maxAccess]; + $tableObject[$i][$j][Style]=$row[operType]; + $tableObject[$i][$j][ValueType]=$row[valueType]; + $tableObject[$i][$j][MinValue]=$row[minValue]; + $tableObject[$i][$j][MaxValue]=$row[maxValue]; + $tableObject[$i][$j][Template]=$row[setTemplate_2]; + $tableObject[$i][$j][Desc]=$row[desc_2]; + $tableObject[$i][$j][Tip]=$row[note_2]; + $tableObject[$i][$j][OID]=getOIDByRow($row); + + if(strstr($tableObject[$i][$j][Desc],"Key Parameter")) + $tableObject[$i][$j][KeyFlag]=1; + else + $tableObject[$i][$j][KeyFlag]=0; + + if(strstr($tableObject[$i][$j][Name],"Entry") && $tableObject[$i][$j][MaxAccess] == ACCESS_ENTRY) + { + $tableObject[$i][$j][Name]=getShowNameOfTable($row[name_2],-1); + $tableObject[$i][EntryIndex]=$j; + } + else if(strstr($tableObject[$i][$j][Name],"Entries")) + { + $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][RawName]=$tableObject[$i][$j][RawName]; + $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][Name]=$tableObject[$i][$j][Name]; + $tableObject[$i][Entries][$tableObject[$i][EntriesCount]][OID]=$tableObject[$i][$j][OID]; + $tableObject[$i][EntriesCount]++; + } + if(strstr($tableObject[$i][$j][RawName],"RowStatus")) + { + $tableObject[$i][$j][Name]="Delete"; + if($tableObject[$i][$j][KeyFlag] == 0) + $tableObject[$i][DeleteOID]=-1; + else + $tableObject[$i][DeleteOID]=$tableObject[$i][$j][OID]; + } + if(strstr($tableObject[$i][$j][RawName],"Index")) + $tableObject[$i][IndexIndex]=$j; + + if(strstr($tableObject[$i][$j][Desc],"Name:")) + { + $new_name=explode("Name:",$tableObject[$i][$j][Desc]); + $tableObject[$i][$j][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + + //echo "$i $j {$tableObject[$i][$j][Name]} {$tableObject[$i][$j][OID]}
      "; + } + //Table level + if(strstr($tableObject[$i][$tableObject[$i][EntryIndex]][Desc],"level")) + { + $tmp=explode("level:",$tableObject[$i][$tableObject[$i][EntryIndex]][Desc]); + $tableObject[$i][TableLevel]=$tmp[1]+0; + } + else + { + $tableObject[$i][TableLevel]=1; + } +} +$thisTableIndex=-1; +for($i=0;$i<$columnTableIndex;$i++) +{ + if($tableObject[$i][TableLevel] == $table_level) + $thisTableIndex=$i; + //Create index + $tableObject[$i][CreateOID]=-1; + if($tableObject[$i][TableLevel] == 1) + { + for($j=0;$j<$tableObject[$i][FieldCount];$j++) + { + if(strstr($tableObject[$i][$j][Name],"Index")) + { + if($tableObject[$i][$j][MaxAccess] == ACCESS_INDEX_CREATE_SPE) + $tableObject[$i][CreateOID]=$tableObject[$i][$j][OID]; + break; + } + } + } + else + { + $lastCreateLabel="CreateEntry".str_replace("Entry","",$tableObject[$i][$tableObject[$i][EntryIndex]][RawName]); + $lastEntriesLabel=str_replace("Entry","",$tableObject[$i][$tableObject[$i][EntryIndex]][RawName])."Entries"; + $lastLevel=$tableObject[$i][TableLevel]-1; + for($j=0;$j<$columnTableIndex;$j++) + { + if($tableObject[$j][TableLevel] == $lastLevel) + break; + } + if($j != $columnTableIndex) + { + for($z=0;$z<$tableObject[$j][FieldCount];$z++) + { + if(stristr($tableObject[$j][$z][RawName],$lastCreateLabel)) + { + $tableObject[$i][CreateOID]=$tableObject[$j][$z][OID]; + break; + } + } + for($z=0;$z<$tableObject[$j][EntriesCount];$z++) + { + if(stristr($tableObject[$j][Entries][$z][RawName],$lastEntriesLabel)) + { + $tableObject[$i][CreateDeleteRelateOID]=$tableObject[$j][Entries][$z][OID]; + break; + } + } + } + else + { + echo "Some table hasn't configure the level
      "; + exit(); + } + } +} +if($columnTableIndex > 0) +{ + if(0) + { + echo "
      ";
      +		print_r($tableObject);
      +		echo "
      "; + } + + if($thisTableIndex == -1) + { + exit("thisTableIndex error"); + } + $thisTableConf=$tableObject[$thisTableIndex]; + if(0) + { + echo "
      ";
      +		print_r($thisTableConf);
      +		echo "
      "; + } + + $oidwhere=getLevelWhere($thisTableConf[$thisTableConf[EntryIndex]][OID]); + + if($thisTableConf[TableLevel] == 1) + $instanceCond=" LENGTH(instanceNo)=4 "; + else if($thisTableConf[TableLevel] == 2) + $instanceCond=" LENGTH(instanceNo)=9 and instanceNo like '{$instanceNo}.%' "; + else if($thisTableConf[TableLevel] == 3) + $instanceCond=" LENGTH(instanceNo)=14 and instanceNo like '{$instanceNo}.%' "; + else + exit("The table nest count > 3"); + + $sql="select * from $paraTable where $oidwhere and {$instanceCond} "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + //echo "$sql
      "; + + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $oid=getOIDByRow($row); + $fieldIndex=sizeof(explode(".",$oid)); + $fieldPos=$row["level_".$fieldIndex]+0; + $instanceValue=substr($row[instanceNo],strlen($row[instanceNo])-4,4)+0; + $showObject[$instanceValue][$fieldPos]=$row[initValue]; + } + + + if(0) + { + echo "
      ";
      +		print_r($showObject);
      +		echo "
      "; + } + + echo "
      "; + if($scalarItemIndex > 0) + echo "

      "; + + showNavigateTitle($table_id,$table_level,$sysId,$columnTable,$instanceNo,"show"); + echo "

      "; + echo ""; + $showFieldCount=0; + $availStatePos=-1; + + + + + + + if(!isset($ascFlag)) + $ascFlag=2; + else + $ascFlag=($ascFlag+1)%2; + + if($_SERVER['REQUEST_METHOD'] == "POST" && $column_table_get) + $ascFlag=1; + + + for($i=0;$i<$thisTableConf[FieldCount];$i++) + { + if(strstr($thisTableConf[$i][RawName],"AvailState")) + $availStatePos=$i; + if($thisTableConf[$i][KeyFlag] == 1) + { + $tmp=explode(".",$thisTableConf[$i][OID]); + $ni=$tmp[sizeof($tmp)-1]+0; + $thisTableConf[KeyFieldIndexList][$i]=$ni; + if($thisTableConf[$i][Name] == "Delete") + echo ""; + else + { + echo ""; + } + $showFieldCount++; + } + } + echo ""; + + if($num > 0) + { + //bubble order + $objectCount=sizeof($showObject); + if(!isset($order)) + $order=$thisTableConf[IndexIndex]; + + $instance_list_num=0; + foreach($showObject as $instance => $obj) + { + $instance_list[]=$instance; + $instance_list_num++; + } + for($i=0;$i<$instance_list_num;$i++) + { + for($j=$i;$j<$instance_list_num;$j++) + { + $index1=$instance_list[$i]; + $index2=$instance_list[$j]; + if($ascFlag) + { + if($showObject[$index1][$order] > $showObject[$index2][$order]) + { + //echo "$order index1=$index1,{$showObject[$index1][$order]},index2=$index2,{$showObject[$index2][$order]}
      "; + $tmp=$showObject[$index1]; + $showObject[$index1]=$showObject[$index2]; + $showObject[$index2]=$tmp; + } + } + else + { + if($showObject[$index1][$order] < $showObject[$index2][$order]) + { + //echo "$order index1=$index1,{$showObject[$index1][$order]},index2=$index2,{$showObject[$index2][$order]}
      "; + $tmp=$showObject[$index1]; + $showObject[$index1]=$showObject[$index2]; + $showObject[$index2]=$tmp; + } + } + } + } + //echo "order=$order,{$thisTableConf[$order][Name]} $instance_list_num
      "; + + foreach($showObject as $instance => $obj) + { + $newIndex=$obj[$thisTableConf[IndexIndex]]; + if($thisTableConf[TableLevel]==1) + $nextInstance=omc_keep_length($newIndex,"0",4); + else if($thisTableConf[TableLevel]==2) + $nextInstance=$instanceNo.".".omc_keep_length($newIndex,"0",4); + else if($thisTableConf[TableLevel]==3) + $nextInstance=$instanceNo.".".omc_keep_length($newIndex,"0",4); + if($availStatePos != -1 && $obj[$availStatePos] == 3) + echo ""; + else + echo ""; + for($i=0;$i<$thisTableConf[FieldCount];$i++) + { + $ni=$thisTableConf[KeyFieldIndexList][$i]; + + if($thisTableConf[$i][KeyFlag] == 1) + { + if($ni == $thisTableConf[IndexIndex]) + { + echo ""; + } + else if(strstr($thisTableConf[$i][RawName],"Entries")) + { + $next_table_level=$table_level+1; + echo ""; + } + else if($thisTableConf[$i][Name] == "Delete") + { + echo ""; + } + //RelationPoint + else if(strstr($thisTableConf[$i][Desc],"RelationPoint")) + { + echo ""; + } + else if(trim($obj[$ni]) == "") + { + echo ""; + } + else + { + $showValue=translateValueToOpt($thisTableConf[$i][Style],$thisTableConf[$i][ValueType],$thisTableConf[$i][Template],$obj[$ni]); + echo ""; + } + } + } + echo ""; + } + } + + //Create new object + if($thisTableConf[CreateOID] != -1 && $canwrite_flag) + { + echo ""; + echo ""; + for($i=0;$i<$showFieldCount-1;$i++) + echo ""; + echo ""; + } + + echo "
      Delete"; + echo $thisTableConf[$i][Name]; + echo "
      {$obj[$ni]}{$obj[$ni]}"; + if($canwrite_flag) + echo ""; + else + echo ""; + echo ""; + + $tmp1=strstr($thisTableConf[$i][Desc],"RelationPoint:"); + $tmp2=explode(";",$tmp1); + $tmp3=explode("RelationPoint:",$tmp2[0]); + $rTableOid=$tmp3[1]; + + $showvalue=$obj[$ni]; + + if(trim($showvalue) == "--" || trim($showvalue)=="") + { + echo "--"; + } + else + { + $tmp1=explode(" ",$showvalue); + $tmp2=$tmp1[1]; + $tmp3=explode("-",$tmp2); + $tmp4=omc_keep_length($tmp3[0],'0',4); + $tmp5=omc_keep_length($tmp3[1],'0',4); + $rInstanceNo=$tmp4.".".$tmp5; + $rWhere=getLevelWhere($rTableOid); + $rsql="select * from $paraTable where instanceNo='$rInstanceNo' and $rWhere "; + $rres=mysqli_query($pubConn,$rsql); + $rnum=mysqli_num_rows($rres); + //echo "$rsql"; + if($rnum == 0) + echo "--"; + else + { + $new_table_level=getTableLevel($rTableOid,$sysTypeNo); + $tmp1=explode(".",$rTableOid); + $new_table_id=$tmp1[1]-1; + //echo "rInstanceNo=$rInstanceNo,rTableOid=$rTableOid,new_table_level=$new_table_level,new_table_id=$new_table_id"; + echo "$showvalue"; + } + } + + echo "--{$showValue}
      "; + echo "New"; + echo "--
      "; + + //Get button + echo ""; + echo ""; + echo ""; + //for get the instance 0 + if($instanceNo=="0000") + echo ""; + else + echo ""; + + //lock the channel + if($sysTypeNo == SYSTYPENO_MSC && $thisTableConf[0][OID] == '2.4.3.1') + { + echo ""; + echo ""; + } + + //if not get channel, get the channel first + if($sysTypeNo == SYSTYPENO_MSC && $thisTableConf[0][OID] == "2.4.3.1") + { + echo ""; + echo ""; + echo ""; + echo ""; + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + $count=0; + $database="OMC_PUB"; + $selSql = "SELECT T1.* FROM $paraTable AS T1,$paraConfTable AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tsIndex' and instanceNo like '$instanceNo.%' "; + $selRes = @mysqli_query($pubConn,$selSql); + $count=mysqli_num_rows($selRes); + if($count==0) + { + if($hasEnter!=1) + { + $hasEnter=1; + echo ""; + echo "\n\n"; + + } + } + } + +} + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/configuration/tabParamConfigurationB/param_show_up.php b/wxc2_omc/configuration/tabParamConfigurationB/param_show_up.php new file mode 100755 index 0000000..a4d0fb6 --- /dev/null +++ b/wxc2_omc/configuration/tabParamConfigurationB/param_show_up.php @@ -0,0 +1,326 @@ + + + + + + +"; +switch($sysTypeNo) +{ +case SYSTYPENO_MSC: + $sysTypeName="MSC"; + $helpId="2.1.1.1"; + break; +case SYSTYPENO_SMSC: + $sysTypeName="SMSC"; + $helpId="2.1.1.5"; + break; +case SYSTYPENO_SMPP: + $sysTypeName="SMPP"; + $helpId="none"; + break; +case SYSTYPENO_OPPS: + $sysTypeName="OPPS"; + $helpId="2.1.1.9"; + break; +case SYSTYPENO_PPS: + $sysTypeName="PPS"; + $helpId="none"; + break; +case SYSTYPENO_MTP3: + $sysTypeName="MTP3"; + $helpId="2.1.0"; + break; +case SYSTYPENO_SCCP: + $sysTypeName="SCCP"; + $helpId="2.1.0"; + break; +case SYSTYPENO_AAS: + $sysTypeName="AAS"; + $helpId="2.1.3.1"; + break; +case SYSTYPENO_VSS: + $sysTypeName="VSS"; + $helpId="2.1.3.2"; + break; +case SYSTYPENO_VLR: + $sysTypeName="VLR"; + $helpId="2.1.1.2"; + break; +case SYSTYPENO_HLR: + $sysTypeName="HLR"; + $helpId="2.1.1.3"; + break; +case SYSTYPENO_AUC: + $sysTypeName="AUC"; + $helpId="2.1.1.4"; + break; +case SYSTYPENO_SMEG: + $sysTypeName="SMEG"; + $helpId="2.1.1.8"; + break; +case SYSTYPENO_EIR: + $sysTypeName="EIR"; + $helpId="2.1.1.7"; + break; +case SYSTYPENO_MRFC: + $sysTypeName="MRFC"; + $helpId="2.66"; + break; +case SYSTYPENO_PALIM: + $sysTypeName="iPALIM"; + $helpId="2.1.1.12"; + break; +case SYSTYPENO_RLS: + $sysTypeName="iRLS"; + $helpId="2.1.1.13"; + break; +case SYSTYPENO_MHC: + $sysTypeName="MHC"; + $helpId="2.1.1.14"; + break; +case SYSTYPENO_MNP: + $sysTypeName="MNP"; + $helpId="2.1.1.11"; + break; +case SYSTYPENO_XAPP: + $sysTypeName="XAPP"; + $helpId="none"; + break; +default: + $sysTypeName="Unknown"; + $helpId="none"; + break; +} + +$sql="select sysTypeNo,sysTypeName,maxSysNum,maxSubSysNum from OMC_PUB.sysConf where needParamConf = '1' and sysTypeNo='$sysTypeNo' "; +//echo "sql=$sql
      "; +$res=@mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); +$maxSysNum=$row[maxSysNum]; +$maxSubSysNum=$row[maxSubSysNum]; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > NSS > $sysTypeName"; +echo ""; + +echo "
      "; + +echo "System ID:"; + echo "  "; + +echo ""; +echo "  "; + +if($helpId != "none") + showHelp($helpId); +echo "
      "; +echo "
      "; + +$tabConf=GetTabConf($sysTypeNo); +$num=sizeof($tabConf); +InitTab($sysTypeNo); +echo ""; +for($i=0;$i<$num;$i++) +{ + $id=GetGlobalID(); + AddTab($id,$tabConf[$i][OID],$tabConf[$i][Name],"image0.gif","image2.gif",123,17); +} +echo ""; + +if(0) +{ + echo "
      ";
      +	print_r($tabConf);
      +	echo "
      "; +} + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +?> + + diff --git a/wxc2_omc/configuration/tftp/tftp.php b/wxc2_omc/configuration/tftp/tftp.php new file mode 100755 index 0000000..6777206 --- /dev/null +++ b/wxc2_omc/configuration/tftp/tftp.php @@ -0,0 +1,393 @@ +command_status_1=$command_status_1"; + if($command_status_1=='1' || $command_status_1=='2')//1--待执行状态 2--在执行状态 + { + echo "
      $strCommandBeExecute!"; + return(-1); + } + else//共享内存可写 + { + if($DEBUG) echo "
      file_name=$file_name"; + if($DEBUG) echo "
      ip=$ip"; + if($DEBUG) echo "
      length=$length"; + $set_result_1=tftp_set_shm(1,0); + $set_result_2=tftp_set_shm($length,1); + $set_result_3=tftp_set_shm($ip,5); + $set_result_4=tftp_set_shm($file_name,20); + if($DEBUG) echo "
      set_result_1=$set_result_1"; + if($DEBUG) echo "
      set_result_2=$set_result_2"; + if($DEBUG) echo "
      set_result_3=$set_result_3"; + if($DEBUG) echo "
      set_result_4=$set_result_4"; + $scan_1=0;//待执行状态标识 + $scan_2=0;//已处理记录标识 + $pre_records=0;//上次处理记录数 + if($set_result_1>0 && $set_result_2>0 && $set_result_3>0 && $set_result_4>0)//设置共享内存成功 + { + do{ + sleep(2); + $command_status_2=tftp_get_shm(0,1); + if($DEBUG) echo "
      command_status_2=$command_status_2"; + if($command_status_2=='1') + { + $scan_1++; + if($DEBUG) echo "
      scan_1=$scan_1"; + if($scan_1>1)//如果连续4秒处于该状态,异常退出 + { + $prompt_name=$strMemoryWaitStatus; + echo "
      $prompt_name"; + break; + } + } + elseif($command_status_2=='2') + { + $the_records=tftp_get_shm(60,4); + if($DEBUG) echo "
      the_records=$the_records"; + if($DEBUG) echo "
      pre_records=$pre_records"; + if($pre_records==$the_records) + { + $scan_2++; + //echo "
      scan_2=$scan_2"; + } + else + { + $pre_records=$the_records;//把本次已处理记录数赋给上次记录数 + } + if($scan_2>1) + { + $prompt_name=$strDaemonRecordNoChange; + echo "
      $prompt_name"; + break;//如果连续4秒已处理记录数不变,异常退出 + } + } + else + { + $describe=tftp_get_shm(64,36); + echo "
      $describe"; + if($command_status_2=='4') + { + $prompt_name="$strDownloadFailureToSwitch"; + echo "
      $prompt_name"; + + } + elseif($command_status_2=='3') + { + $prompt_name="$strDownloadSuccessToSwitch"; + echo "
      $prompt_name"; + $suc_sign=1; + } + } + }while($command_status_2=='1' || $command_status_2=='2'); + $set_result=tftp_set_shm(0,0); + if($suc_sign>0){ + return(1); + }else{ + return(-1); + } + } + else + { + echo "
      $strSetMemoryFailure"; + $set_result=tftp_set_shm(0,0); + return(-1); + } + }//end else共享内存可写 +} + +//**************************************************************** +// 函数2 tftp_set_shm($str,$offset) +// +// 功能说明:该函数用于tftp通知后台程序的共享内存设定. +// +// 调用关系: +// +// 变量说明:$str 写入共享内存中的字串 +// $offset 从开辟的共享内存块中的第几位开始写 +// (0:发送一般命令,1:发送uninstall命令) +// +// 返回值:操作类型的值(正:成功,负:失败) +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +// +//---------------------------------------------------------- + +function tftp_set_shm($str,$offset) + { + //PHP_C_SHM_KEY 0x6AE00000 + //PHP_C_SHM_PERM 0666 + //PHP_C_SEM_KEY 440 + //PHP_C_SEM_PERM 0666 + //size 10*100 bytes + + define("Semaphore_Key",440,1); + define("SharedMem_Key",0x6AE00000,1); + define("SharedMem_Size",1000,1); //共享内存大小 + + $SharedMemID = @shmop_open(SharedMem_Key,"c",0666,SharedMem_Size); + + $sharemen_sign = 0; + + //将指定变量存入共享内存 + if(shmop_write($SharedMemID,$str,$offset)) + $sharemen_sign++; + + if($sharemen_sign == 1){ + return(1); + }else{ + return(-1); + } + } + +//**************************************************************** +// 函数3 tftp_get_shm($offset,$count) +// +// 功能说明:该函数用于tftp通知后台程序的共享内存设定. +// +// 调用关系: +// +// 变量说明: $offset 从开辟的共享内存块中的第几位开始读 +// $count 读多少位 +// +// 返回值:操作类型的值(正:读出的值,负:失败) +// +// 作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +// +//---------------------------------------------------------- + +function tftp_get_shm($offset,$count) +{ + + //PHP_C_SHM_KEY 0x6AE00000 + //PHP_C_SHM_PERM 0666 + //PHP_C_SEM_KEY 440 + //PHP_C_SEM_PERM 0666 + //size 10*100 bytes + + define("Semaphore_Key",440,1); + define("SharedMem_Key",0x6AE00000,1); + define("SharedMem_Size",1000,1); //共享内存大小 + $SharedMemID = @shmop_open(SharedMem_Key,"c",0666,SharedMem_Size); + + //将指定共享内存存入变量 + $Read_str= shmop_read($SharedMemID,$offset,$count); + + return($Read_str); + } + +if($action1){ //if files have been uploaded, process them +$DEBUG=0; +?> + +"; + echo ""; + echo ""; + echo "Advanced > Software Upgrade >Tftp"; + echo ""; + echo " "; + + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> +



      + +path1=$path1"; +$source = $file1; +if($DEBUG) echo "
      source=$source"; +$source_name = $file1_name; +if($DEBUG) echo "
      source_name=$source_name"; +echo "
      FileName:$source_name"; +echo "
      IPAddress:$ip"; +echo "
      MessageLength:$length BYTES
      "; + +$log_name="TFTP ".$strFileUpload; +if(($source <> "none")&&($source <> "")){ // see if the file exists; non-existing file has name of "none" + if($error1 <> 1){ // no need to copy a file if directory not write-enabled + $dest = $path1."/".$source_name; // append file name to our path + if($DEBUG) echo "
      dest=$dest"; + if(copy($source,$dest)){ // copy the file from the temp directory to the upload directory, and test for success + $newname = "../../../tftp/"; + $newname .=$source_name; + if(copy($dest,$newname)) + { + insertLog("$log_name"); + echo "
      $strFileUploadSuccessToServer
      \n"; + $set_result=send_shm_tftp($source_name,$ip,$length); + } + else + { + echo "
      $strUploadFailure
      \n"; + insertLog("$log_name"); + } + unlink ($dest); + }//end if(copy($source,$dest)) + else + { + echo "$strUploadDirectoryNotWriteEnabled\n"; // you need to write-enable the upload directory + $error1 = 1; // set flag + insertLog("$log_name"); + } + }//if($error1 <> 1) +unlink($source); // delete the file from the temp directory +}else{//if(($source <> "none")&&($source <> "")) + echo "
      source=none!
      "; +} +?> + +

      +

      + + + + + + + +"; +echo ""; +echo ""; +echo "Advanced > Software Upgrade >Tftp"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +?> +

      +

      +"> + + + + + + + + + + + + + + + + + + + +
      + +Bytes +
      +"; ?> + 
      + + +

      + +Remarks:

      +Browse to 8K E1 Card software in the File field.
      +Input IP address of LAN module of 8K E1 Card in the IP field.
      +Set 128 bytes for the Message length option.
      + + + + + + + + + diff --git a/wxc2_omc/configuration/wsms/operation.php b/wxc2_omc/configuration/wsms/operation.php new file mode 100755 index 0000000..bf22146 --- /dev/null +++ b/wxc2_omc/configuration/wsms/operation.php @@ -0,0 +1,519 @@ + + + + + +"; + return $result; +} +function unicode2gb($string) +{ + $result=""; + for($i=0;$i + +"; +echo ""; +echo ""; +echo "$strMaintenance > Control Panel > Welcome SMS
      "; +echo ""; +echo ""; +$helpId="5.2.3"; + showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + + $DEBUG=0; + + if($DEBUG) + echo "mcc=$mcc,mnc=$mnc,operation=$operation
      "; + echo "
      "; + + if($delete_ad==1) + { + $pubDb="OMC_PUB"; + $delSql="DELETE FROM wsmsMsgConf where no=$ad_no "; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + echo "\n\n"; + } + if($save_new_ad==1) + { + $pubDb="OMC_PUB"; + if($edit_encode==2) + { + //echo "edit_adContent=$edit_adContent
      "; + $edit_adContent=gb2unicode($edit_adContent); + //echo "edit_adContent=$edit_adContent
      "; + } + $saveSql="INSERT INTO wsmsMsgConf values('$edit_no','$edit_mcc','$edit_mnc','$edit_adContent','$edit_adStart','$edit_adEnd')"; + mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + + echo "\n\n"; + } + if($save_old_ad==1) + { + $pubDb="OMC_PUB"; + if($edit_encode==2) + $edit_adContent=gb2unicode($edit_adContent); + $saveSql="UPDATE wsmsMsgConf SET content='$edit_adContent',validStart='$edit_adStart',validEnd='$edit_adEnd' where no='$edit_no' "; + mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + + echo "\n\n"; + } + + if($save_new_serv==1) + { + $pubDb="OMC_PUB"; + if($edit_smsEncode==2) + $edit_wlContent=gb2unicode($edit_wlContent); + //echo "edit_wlContent=$edit_wlContent
      "; + $saveSql="INSERT INTO wsmsServConf values('$edit_mcc','$edit_mnc','$edit_flag','$edit_smsEncode','$edit_wlContent')"; + + mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + echo "\n\n"; + } + if($save_old_serv==1) + { + + $pubDb="OMC_PUB"; + if($edit_smsEncode==2) + $edit_wlContent=gb2unicode($edit_wlContent); + $saveSql="UPDATE wsmsServConf SET flag='$edit_flag',smsEncode='$edit_smsEncode',welcomeMsg='$edit_wlContent' where mcc='$edit_mcc' and mnc='$edit_mnc' "; + mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + echo "\n\n"; + } + + //Add a new hpmn server + if($operation=="new") + { + echo "

      "; + echo ""; + echo ""; + echo ""; + + //mcc + echo ""; + echo ""; + echo ""; + echo ""; + + //mnc + echo ""; + echo ""; + echo ""; + echo ""; + + //flag + $flagLabel=array(0=>"Disable",1=>"Enable"); + $flag=1; + echo ""; + echo ""; + echo ""; + echo ""; + + //smsEncode + $smsEncodeLabel=array("7 bit","8 bit","16 bit"); + $smsEncode=0; + echo ""; + echo ""; + echo ""; + echo ""; + + //welcome message + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
      NameValue
      MCC
      MNC
      Flag
      Encode
      Welcome Message
      "; + + //save button + echo ""; + + } + //Edit a hpmn server + else if($operation=="edit") + { + //Get the hpmn server info from database + $database="OMC_PUB"; + $selSql = "SELECT * FROM wsmsServConf where mcc='$mcc' and mnc='$mnc' "; + $selRes = @mysqli_query($pubConn,$selSql); + $HpmnCount=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + //echo "count:$HpmnCount
      "; + + + $selRow = @mysqli_fetch_array($selRes); + $HpmnMcc=$selRow[mcc]; + $HpmnMnc=$selRow[mnc]; + $HpmnFlag=$selRow[flag]; + $HpmnSmsEncode=$selRow[smsEncode]; + $HpmnWlContent=$selRow[welcomeMsg]; + + + echo "

      "; + echo ""; + echo ""; + echo ""; + + //mcc + echo ""; + echo ""; + echo ""; + echo ""; + + //mnc + echo ""; + echo ""; + echo ""; + echo ""; + + //flag + $flagLabel=array("Disable","Enable"); + echo ""; + echo ""; + echo ""; + echo ""; + + //smsEncode + $smsEncodeLabel=array("7 bit","8 bit","16 bit"); + echo ""; + echo ""; + echo ""; + echo ""; + + //wlContent + echo ""; + //echo ""; + echo ""; + if($HpmnSmsEncode==2) + $HpmnWlContent=unicode2gb($HpmnWlContent); + echo ""; + + echo "
      NameValue
      MCC$HpmnMcc
      MNC$HpmnMnc
      Flag
      Encode
      Welcome MessageWelcome Message"; + echo "
      "; + + //save button + echo ""; + + } + else if($operation=="ad_edit") + { + //Get the hpmn server info from database + $database="OMC_PUB"; + $selSql = "SELECT * FROM wsmsMsgConf where mcc='$mcc' and mnc='$mnc' and no='$no'"; + $selRes = @mysqli_query($pubConn,$selSql); + $HpmnCount=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + //echo "count:$HpmnCount
      "; + + + $selRow = @mysqli_fetch_array($selRes); + $adNo=$selRow[no]; + $adContent=$selRow[content]; + $adStart=$selRow[validStart]; + $adEnd=$selRow[validEnd]; + + + + echo "

      "; + echo ""; + echo ""; + echo ""; + + //mcc + echo ""; + echo ""; + echo ""; + echo ""; + + //mnc + echo ""; + echo ""; + echo ""; + echo ""; + + //no + echo ""; + echo ""; + echo ""; + echo ""; + + //validStart + echo ""; + echo ""; + echo ""; + echo ""; + + //validEnd + echo ""; + echo ""; + echo ""; + echo ""; + + //content + echo ""; + echo ""; + echo ""; + if($encode==2) + $adContent=unicode2gb($adContent); + echo ""; + + echo "
      NameValue
      MCC$mcc
      MNC$mnc
      No.$no
      Start Date
      End Date
      AD Message
      "; + + //save button + echo ""; + + //delete button + echo ""; + + + } + else if($operation=="ad_new") + { + //get the new ad no + for($new_no=1;$new_no<1600;$new_no++) + { + $database="OMC_PUB"; + $selSql = "SELECT * FROM wsmsMsgConf where no='$new_no'"; + $selRes = @mysqli_query($pubConn,$selSql); + $tmp_count=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + if($tmp_count!=1) + { + break; + } + } + //echo "new_no=$new_no
      "; + echo "

      "; + echo ""; + echo ""; + echo ""; + + //mcc + echo ""; + echo ""; + echo ""; + echo ""; + + //mnc + echo ""; + echo ""; + echo ""; + echo ""; + + //no + echo ""; + echo ""; + echo ""; + echo ""; + + //validStart + echo ""; + echo ""; + echo ""; + echo ""; + + //validEnd + echo ""; + echo ""; + echo ""; + echo ""; + + //content + echo ""; + echo ""; + echo ""; + if($encode==2) + $show="编辑广告短信"; + else + $show="Edit AD Message..."; + echo ""; + + echo "
      NameValue
      MCC$mcc
      MNC$mnc
      No.$new_no
      Start Date
      End Date
      AD Message
      "; + //save button + echo ""; + + } + + //remark + echo "

      Remark:

      "; + /* + echo "Interval: The interval to make NRTRDE files for the HPMN

      "; + echo "Report Directory: The directory to send the report files to

      "; + echo "NRTRDE Directory: The directory to send the NRTRDE files to

      "; + */ + echo "

      "; +adjust_content_tail(); +?> diff --git a/wxc2_omc/configuration/wsms/wsms.php b/wxc2_omc/configuration/wsms/wsms.php new file mode 100755 index 0000000..b7fa488 --- /dev/null +++ b/wxc2_omc/configuration/wsms/wsms.php @@ -0,0 +1,221 @@ + + + + + + + + + + + +"; +echo ""; +echo ""; +echo "$strMaintenance > Control Panel > Welcome SMS
      "; +echo ""; +echo ""; +$helpId="5.2.3"; + showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + + +?> + +"; + + //delete from the wsmsServConf + $pubDb="OMC_PUB"; + $delSql = "DELETE FROM wsmsServConf WHERE mcc='$mcc' and mnc='$mnc' "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + + //delete from wsmsMsgConf + $delSql = "DELETE FROM wsmsMsgConf WHERE mcc='$mcc' and mnc='$mnc' "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + echo "Delete successfully!
      "; + + + } + + //Get the hpmn server info from database + $database="OMC_PUB"; + $selSql = "SELECT * FROM wsmsServConf "; + $selRes = @mysqli_query($pubConn,$selSql); + $HpmnCount=mysqli_num_rows($selRes); + echo mysqli_error($pubConn); + //echo "count:$HpmnCount
      "; + + $HpmnIndex=0; + while($selRow = @mysqli_fetch_array($selRes)) + { + $HpmnMcc[$HpmnIndex]=$selRow[mcc]; + $HpmnMnc[$HpmnIndex]=$selRow[mnc]; + $HpmnFlag[$HpmnIndex]=$selRow[flag]; + $HpmnSmsEncode[$HpmnIndex]=$selRow[smsEncode]; + $HpmnWelcomeMsg[$HpmnIndex]=$selRow[welcomeMsg]; + if($HpmnSmsEncode[$HpmnIndex]==2) + $HpmnWelcomeMsg[$HpmnIndex]=unicode2gb($HpmnWelcomeMsg[$HpmnIndex]); + + + + $HpmnIndex++; + //echo "HpmnMcc[$HpmnIndex]={$HpmnMcc[$HpmnIndex]}
      "; + } + + echo "

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $flagLabel=array(0=>"Disable",1=>"Enable"); + $encodeSchemeLabel=array(0=>"7 bit",1=>"8 bit",2=>"16 bit"); + for($i=0;$i<$HpmnCount;$i++) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $tmpWl=$HpmnWelcomeMsg[$i]; + $maxLen=70; + if($HpmnSmsEncode[$i]==2) + $maxLen=$maxLen*3; + if(strlen($HpmnWelcomeMsg[$i])>$maxLen) + $tmpWl=substr($HpmnWelcomeMsg[$i],0,$maxLen)."..."; + $cc=strlen($HpmnWelcomeMsg[$i]); + echo ""; + + //echo ""; + $select="SELECT * FROM wsmsMsgConf where mcc={$HpmnMcc[$i]} and mnc={$HpmnMnc[$i]} order by no ASC "; + $select_res = @mysqli_query($pubConn,$select); + echo ""; + + + + echo ""; + echo ""; + } + echo ""; + + echo "
      No.MCCMNCFlagEncodeWelcome MessageAD MessageDelete
      $i{$HpmnMcc[$i]}{$HpmnMnc[$i]}{$flagLabel[$HpmnFlag[$i]]}{$encodeSchemeLabel[$HpmnSmsEncode[$i]]}$tmpWl
      {$HpmnAdContent[$i]}
      |"; + $id=1; + while($select_row= @mysqli_fetch_array($select_res)) + { + $adno=$select_row[no]; + $content=$select_row[content]; + if($HpmnSmsEncode[$i]==2) + $content=unicode2gb($content); + echo "$id|"; + $id++; + } + //The max ad count is 8 + if($id<=8) + echo "New
      Delete
      New--------------
      "; +adjust_content_tail(); +?> diff --git a/wxc2_omc/element/bssSpecific/alarm_show.php b/wxc2_omc/element/bssSpecific/alarm_show.php new file mode 100755 index 0000000..f411efa --- /dev/null +++ b/wxc2_omc/element/bssSpecific/alarm_show.php @@ -0,0 +1,22 @@ +"; + echo ""; + echo ""; + flush(); + echo " 
      "; + + $se_info=explode("---",$info); + echo "$se_info[0]
      $se_info[1]
      "; + echo " 

      "; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Back
      "; +?> diff --git a/wxc2_omc/element/bssSpecific/bssSpecific.php b/wxc2_omc/element/bssSpecific/bssSpecific.php new file mode 100755 index 0000000..cf606de --- /dev/null +++ b/wxc2_omc/element/bssSpecific/bssSpecific.php @@ -0,0 +1,823 @@ +正在调试中,给您的工作带来不便,请原谅!! :^_^"; + +//****** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network"; +echo " > BSS Specific"; +echo "
      "; + +function flash($bssid) +{ + + echo ""; +} +if($addtype=="BtsMgr") +{ + if($btsid>12) + { + echo ""; + } + else + { + $nmicmd="create BtsMgr ".$btsid; + $objectid="BssFunc"; + putcommand($bssid,$objectid,$nmicmd); + sleep(1); + } + + flash($bssid); +} +if($deltype=="BtsMgr") +{ + //echo "BtsMgr is OK!
      "; + $nmicmd="delete BtsMgr ".$btsid; + $objectid="BssFunc"; + putcommand($bssid,$objectid,$nmicmd); + sleep(1); + flash($bssid); +} +if($upload==1) +{ + $nmicmd="upload 12"; + $objectid="BssFunc"; + putcommand($bssid,$objectid,$nmicmd); + sleep(3); + flash($bssid); +} + + $nmicmd="get"; + $objectid="BssFunc"; +// putcommand($bssid,$objectid,$nmicmd); + + $sqlstring = "select BsPlus,BsPlusMaxExtBtsMgr from OMCR_BssFunc where bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $isbsplus = $row[0]; + //if($row[0]=='') + //{ + // $nmicmd="get"; + // $objectid="BssFunc"; + // putcommand($bssid,$objectid,$nmicmd); + //flash($bssid); + //} + $bsplusbtsno = $row[1]; + if($isbsplus==1) + $checkbsstype="Bsplus"; + else if($isbsplus==0) + $checkbsstype="BSC+BTS"; + + + +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +$sqlstring = "select name,ip from OMCR_BSSTABLE where bssid=$bssid"; + +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +$row = mysqli_fetch_row($result); +{ + $name = $row[0]; + $ip = $row[1]; +} +//if($software=='') +// { +// $nmicmd="get"; +// $objectid="Software.0"; +// putcommand($bssid,$objectid,$nmicmd); +// } +$sqlstring = "select CurrentBuildDir,CurrentSoftwareVersion from OMCR_Software where bssid=$bssid"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +$row = mysqli_fetch_row($result); + +$software = $row[0]; +$version = $row[1]; +$upload = 1; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Back
      "; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      BSS Name: $nameIP Address: $ipSoftware Version: $software/$versionBSS Type: $checkbsstype
      "; + +?> + + + +"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$pc,$ni) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + //International =0;SPARE=1;National=2;RNational=3 + if($ni==0)$ni="International"; + else if($ni==1)$ni="SPARE"; + else if($ni==2)$ni="National"; + else if($ni==3)$ni="RNational"; + +echo ""; + echo ""; + echo ""; +//shelf============================================================ +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +//Add BtsMgr----------------> +$sqlstring = "select ObjectId from OMCR_BSSTREE where engDisplayName like 'BTS Manager%' and Presence=1 and bssid=$bssid"; +$objectid = 'BssFunc'; +$addtype = 'BtsMgr'; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + $bts_objectid[] =$row[0]; +} +$no_bts_exist=count($bts_objectid); + +$array = array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12); +//print_r($array); + +for($n=0;$n<$no_bts_exist;$n++) +{ + $bts_num = explode(".",$bts_objectid[$n]); + $num[$n] = $bts_num[1]; + unset($array[$num[$n]-1]); +} +$array = array_values($array); +//print_r($array); +$btsid = $array[0]; + +echo ""; +echo ""; +//SmsCb..>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> +$sqlstring = "select CBCHLoading_0,CBCHLoading_1,CBCHLoading_2,CBCHLoading_3,CBCHLoading_4 from OMCR_SmsCb where ObjectId='SmsCb.0' and bssid=$bssid"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($cbc0,$cbc1,$cbc2,$cbc3,$cbc4) =$row; + } +$ref = "./objShow.php?language=$language&objectid=SmsCb.0&tablename=OMCR_SmsCb&bssid=$bssid"; +echo ""; +echo ""; +echo ""; +echo ""; + +?> diff --git a/wxc2_omc/element/bssSpecific/bss_aif.php b/wxc2_omc/element/bssSpecific/bss_aif.php new file mode 100755 index 0000000..b078a48 --- /dev/null +++ b/wxc2_omc/element/bssSpecific/bss_aif.php @@ -0,0 +1,207 @@ +正在调试中,给您的工作带来不便,请原谅!!:^_^"; +echo "
      AIf"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + echo "
      BSS Point CodeAdminStateOperStateAvailStatusNI
      $pc$availstatus$operstate$availstatus$ni
      "; +echo "
      SHELF"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; +/////////////////////////////////////////////////////////////////////////////// + echo "
      Door AlarmUplink Volume ControlDownlink Volume Control
      Disablenormalnormal
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +//Card ================================================================================================ +//...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> + + +$sqlstring = "select engDisplayName,ObjectId from OMCR_BSSTREE where engDisplayName like 'Card%' and Presence=1 and ObjectId not like 'BtsMgr_Shelf%' and bssid=$bssid"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($display_name[],$object_name[]) =$row; +} +$no_of_obj = count($object_name); + + + +$sqlstring = "select engDisplayName,ObjectId from OMCR_BSSTREE where engDisplayName like 'DSP Card%' and Presence=1 and bssid=$bssid"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while($row = mysqli_fetch_row($result)) + { + list($dsp_display_name[],$dsp_object_name[]) =$row; + } +$no_of_dsp = count($dsp_object_name); +echo ""; +for($i=0;$i<$no_of_obj;$i++) +{ + $conts = explode(".",$object_name[$i]);//Card.0.1 + $sqlstring = "select Presence from OMCR_BSSTREE where ObjectId='Port.0.$conts[2].0' and bssid=$bssid"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $presence0 = $row[0]; + $sqlstring = "select Presence from OMCR_BSSTREE where ObjectId='Port.0.$conts[2].1' and bssid=$bssid"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $presence1 = $row[0]; +if($presence0==1&&$presence1==1){////////////////////////////////// + + //print_r($object_name); + echo "
      NoAdminStateOperStateAvailStatusInterface
      "; + //echo ""; + + + + + $sqlstring = "select AdminState,OperState,AvailStatus,INTERFACE from OMCR_E1port where ObjectId='Port.0.$conts[2].0' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$interface) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + if($interface==0)$interface="Unused"; + else if($interface==1)$interface="AIF"; + else if($interface==2)$interface="ABIS"; + else if($interface==5)$interface="R2"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + + + + + + echo "
      Port 0"; + echo "$display_name[$i]Port 0";//-----Port 0 + + echo "$adminstate$operstate$availstatus$interface
      "; + + echo ""; + $sqlstring = "select AdminState,OperState,AvailStatus,INTERFACE from OMCR_E1port where ObjectId='Port.0.$conts[2].1' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$interface) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + if($interface==0)$interface="Unused"; + else if($interface==1)$interface="AIF"; + else if($interface==2)$interface="ABIS"; + else if($interface==5)$interface="R2"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + +//Dsp Card===================================================================================== +//AdminState OperaState AvailStatus DSP Type + echo "
      Port 1"; + + echo "$adminstate$operstate$availstatus$interface
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + + + for($j=0;$j<$no_of_dsp;$j++) + { + $dconts = explode(".",$dsp_object_name[$j]);//DSP.0.cardnum.dspnum.(0~3) + $cardnum = $dconts[2]; + $dspnum = $dconts[3]; + if($dconts[2] == ($i+1)) + { + + //print_r($dsp_object_name[$j]); + echo ""; + echo "
      Dsp NoAdminStateOperaStateAvailStatusDSP Type
      "; + //$temp=substr($dsp_display_name[$j],4); + echo ""; + //echo ""; + //dsp 0 + + echo ""; + $sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.0' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($type,$adminstate,$operstate,$availstatus) =$row; + } + if($type==0)$type="Half Rate"; + else if($type==1)$type="Full Rate"; + else if($type==2)$type="Enhanced Full Rate"; + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //dsp 1 + echo ""; + echo ""; + echo ""; + $sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.1' and bssid=$bssid"; + //echo $sqlstring . "
      "; + + + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($type,$adminstate,$operstate,$availstatus) =$row; + } + if($type==0)$type="Half Rate"; + else if($type==1)$type="Full Rate"; + else if($type==2)$type="Enhanced Full Rate"; + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //dsp 2 + echo ""; + echo ""; + echo ""; + $sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.2' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($type,$adminstate,$operstate,$availstatus) =$row; + } + if($type==0)$type="Half Rate"; + else if($type==1)$type="Full Rate"; + else if($type==2)$type="Enhanced Full Rate"; + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //dsp 3 + echo ""; + echo ""; + echo ""; + $sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.3' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($type,$adminstate,$operstate,$availstatus) =$row; + } + if($type==0)$type="Half Rate"; + else if($type==1)$type="Full Rate"; + else if($type==2)$type="Enhanced Full Rate"; + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + + + + if($j==0) + { + + echo "
      $dsp_display_name[$j]$dsp_display_name[$j]Dsp 0$adminstate$operstate$availstatus$type
      Dsp 1$adminstate$operstate$availstatus$type
      Dsp 2$adminstate$operstate$availstatus$type
      Dsp 3$adminstate$operstate$availstatus$type
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } + + + } + }/////////////////////////////////////////////////////////// + /* + + */ +} + $sqlstring = "select Presence from OMCR_BSSTREE where ObjectId='Card.0.17' and bssid=$bssid"; +//echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + $presence =$row[0]; + } + if($presence==1){ + echo ""; + + +//====clock module================= + echo "
      NoAdminStateOperStateAvailStatusInterface
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + //get the data from database + + $sqlstring = "select PartNumber,RevNumber,SerialNumber from OMCR_ClockMod where ObjectId='Card.0.17' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($PartNumber,$RevNumber,$SerialNumber) =$row; + } + + + echo ""; + + + + echo "
      Part NumberRevision NumberSerial Number
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + +//Bsc.0===========================================> +echo "
      ClockModule$PartNumber$RevNumber$SerialNumber
      "; +echo "
      Bsc"; + $sqlstring = "select AdminState,OperState,AvailStatus,Label,EnableVeryEarlyAssignment from OMCR_Bsc where ObjectId='Bsc.0' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$label,$vea) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + if($vea==0)$vea="Disable"; + else if($vea==1)$vea="Enable"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo ""; + + echo ""; + + echo "
      LabelAdminStateOperaStateAvailStatusVEA
      "; + + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      \"$label\"$adminstate$operstate$availstatus$vea
      "; + echo "
      "; +echo ""; + echo ""; + echo ""; +echo "
      BtsMgr+
      "; + +//BtsMgr>====================================================================== +$sqlstring = "select engDisplayName,ObjectId from OMCR_BSSTREE where engDisplayName like 'BTS Manager%' and ObjectId<>'BtsMgr.0' and Presence=1 and bssid=$bssid"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($bts_display_name[],$bts_object_name[]) =$row; +} +$no_of_bts = count($bts_object_name); + +$bsplus = 0; +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //BtsMgr 0 >>>>>>>Bsplus + if($isbsplus==1) + { + $sqlstring = "select Label,E1UseType,RfdType from OMCR_BtsMgr where ObjectId='BtsMgr.$bsplus' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $btsid=0; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($label,$e1tp,$rfd) =$row; + } + + + if($e1tp==0)$e1tp="Dedicated"; + else if($e1tp==1)$e1tp="DC_String"; + else if($e1tp==2)$e1tp="DC_Ring"; + else if($e1tp==3)$e1tp="XConnect"; + + echo ""; + echo "
      BtsMgr_NumBtsMgrNameE1UseTypeRfdTypeDelete
      "; + + echo "";//bsplus + $helf = "./objShow.php?language=$language&objectid=BtsMgr.0&tablename=OMCR_BtsMgr&bssid=$bssid&btsid=$btsid"; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + } + //BtsMgr (1~12)==========================================================> + + for($k=0;$k<$no_of_bts;$k++) + { + $bconts = explode(".",$bts_object_name[$k]); + $btsid = $bconts[1]; + $sqlstring = "select Label,E1UseType,RfdType from OMCR_BtsMgr where ObjectId='BtsMgr.$bconts[1]' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($label,$e1tp,$rfd) =$row; + } + + if($e1tp==0)$e1tp="Dedicated"; + else if($e1tp==1)$e1tp="DC_String"; + else if($e1tp==2)$e1tp="DC_Ring"; + else if($e1tp==3)$e1tp="XConnect"; + + echo ""; + echo "
      0\"$label\"$e1tp$rfd
      "; + + echo ""; + $deltype="BtsMgr"; + $btsid =$bconts[1]; + $objectid="BssFunc"; + $helf = "./objShow.php?language=$language&objectid=BtsMgr.$btsid&tablename=OMCR_BtsMgr&bssid=$bssid&btsid=$btsid"; + + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo "
      $bconts[1]"; + + echo "\"$label\"$e1tp$rfd"; + echo "
      "; +echo "
      SmsCb"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo "
      CBCHLoading_0CBCHLoading_1CBCHLoading_2CBCHLoading_3CBCHLoading_4
      $cbc0$cbc1$cbc2$cbc3$cbc4
      "; +echo "
      "; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network"; +echo " > BSS Specific"; +echo " > AIf "; +echo "
      "; +echo "
      "; +?> +"; + $href="$PHP_SELF?bssid=$bssid"; + echo "window.location.href='$href';"; + echo ""; +} +if($addtype=='ALink') +{ + if($linkno > 3) + { + echo ""; + } + else + { + $nmicmd="create ALink ".$linkno; + $objectid="ALinkSet.0.0"; + putcommand($bssid,$objectid,$nmicmd); + sleep(1); + flash($bssid); + } + +} +if($deltype=='ALink') +{ + //echo "ALink is OK!
      "; + $nmicmd="delete ALink ".$linkno; + $objectid="ALinkSet.0.0"; + putcommand($bssid,$objectid,$nmicmd); + flash($bssid); +} +//$upload = 1; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + //echo ""; + echo "Back"; + echo "
      "; +?> + + +"; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "" ; + $sqlstring = "select ObjectId from OMCR_BSSTREE where engDisplayName like 'ALink%' and Presence=1 and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($object[])=$row;//e.g ALink.0.0.(0~3) + } + $no_of_link=count($object); + $array = array(0, 1, 2, 3, 4); +//print_r($array); + +for($n=0;$n<$no_of_link;$n++) +{ + $link_num = explode(".",$object[$n]); + $num[$n] = $link_num[3]; + unset($array[$num[$n]]); +} +$array = array_values($array); +//print_r($array); + + echo ""; +echo ""; +echo ""; + +echo ""; +?> + diff --git a/wxc2_omc/element/bssSpecific/bss_assigntrx.php b/wxc2_omc/element/bssSpecific/bss_assigntrx.php new file mode 100755 index 0000000..12ba485 --- /dev/null +++ b/wxc2_omc/element/bssSpecific/bss_assigntrx.php @@ -0,0 +1,166 @@ +"; +echo ""; +echo ""; +echo ""; +echo "
      LinkSet"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + $sqlstring = "select AdminState,OperState,AvailStatus,TheirPC from OMCR_ALinkSet where bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$theirpc) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      SPCAdminStateOperStateAvailStatus
      $theirpc$adminstate$operstate$availstatus
      "; + echo "
      "; + $linkno = $array[0]; + + $addtype = 'ALink'; + $objectid = 'ALinkSet.0.0'; + echo ""; + echo ""; + echo ""; + echo "
      ALink+
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<$no_of_link;$i++) + { + $alink = explode(".",$object[$i]); + + $alinkno = $alink[3]; + $sqlstring = "select AdminState,OperState,AvailStatus from OMCR_ALink where ObjectId='Alink.0.0.$alinkno' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus) =$row; + } + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo ""; + echo "
      NoAdminStateOperStateAvailStatusDelete
      "; + + echo ""; + + echo ""; + echo ""; + echo ""; + + $deltype="ALink"; + $linkno = $i; + $objectid = "ALinkSet.0.0"; + echo ""; + + + echo ""; + } + echo "
      $alinkno$adminstate$operstate$availstatus"; + echo "
      "; +echo "
      "; +echo "Configuration > Network"; +echo "> BSS Specific"; +echo "> BtsMgr $btsid"; +echo "> AssignTrx for Bts.$btsid.$cellid
      "; +echo "
      "; + +function flash($bssid,$btsid,$cellid) +{ + $sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Trx.$btsid%' and Presence=1 and ObjectId not like 'Trx.$btsid.$cellid%' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + echo ""; +} +if($deltype=='AssignTrx') +{ + $nmicmd="action 9:4 ".$trxnum; + $objectid="Bts.".$btsid.".".$cellid; + putcommand($bssid,$objectid,$nmicmd); +/* $sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Trx.$btsid%' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($trx_object_name[]) =$row; + } + for($i=0;$i"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "Back";//back + echo ""; +echo ""; + +?> + + + +"; +echo ""; + +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo "
      UnAssigned TRXs"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Trx.$btsid%' and Presence=1 and ObjectId not like 'Trx.$btsid.$cellid%' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($trx_object_name[]) =$row; + } + $no_of_trx = count($trx_object_name);//e.g RCarrier.0.0.4 + + for($i=0;$i<$no_of_trx;$i++) + { + $trx_cont = explode(".",$trx_object_name[$i]); + echo ""; + echo "
      BtsMgrNumberBtsNumberTrxNumberAssign to Bts.$btsid.$cellid
      "; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      BtsMgr $trx_cont[1]Bts $trx_cont[2]Trx $trx_cont[3]"; + $trxnum = $trx_cont[3]; + $objectid = "Bts.".$btsid.".".$cellid; + $deltype = "AssignTrx"; + echo "
      "; + echo "
      Assigned TRXs"; + echo ""; + /* echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +*/ + $sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Trx.$btsid.$cellid%' and Presence=1 and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($trx_object[]) =$row; + } + $no_of_trx_1 = count($trx_object);//e.g RCarrier.0.0.4 + + for($i=0;$i<$no_of_trx_1;$i++) + { + $trx_cont = explode(".",$trx_object[$i]); + echo ""; + echo "
      BtsMgrNumberBtsNumberTrxNumber
      "; + + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + } + echo "
      BtsMgr $trx_cont[1]Bts $trx_cont[2]Trx $trx_cont[3]
      "; + echo "
      "; +echo "
      Note: If you want to assign trx,you must Lock AbisMgr !"; +?> \ No newline at end of file diff --git a/wxc2_omc/element/bssSpecific/bss_bts.php b/wxc2_omc/element/bssSpecific/bss_bts.php new file mode 100755 index 0000000..5dd2aad --- /dev/null +++ b/wxc2_omc/element/bssSpecific/bss_bts.php @@ -0,0 +1,403 @@ +正在调试中,给您的工作带来不便,请原谅!!:^_^"; + + + + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network"; +echo "> BSS Specific"; +echo "> BtsMgr $btsid"; +echo "> Bts.$btsid.$cellid"; +echo "
      "; +echo "
      "; + +function flash($bssid,$btsid,$cellid) +{ + echo ""; +} +if($addtype=='AdjHand') +{ + $nmicmd="create AdjHand ".$adjhand; + $objectid="Bts.".$btsid.".".$cellid; + putcommand($bssid,$objectid,$nmicmd); + sleep(1); + flash($bssid,$btsid,$cellid); +} +if($deltype=='AdjHand') +{ + $nmicmd="delete AdjHand ".$adjhand; + $objectid="Bts.".$btsid.".".$cellid; + putcommand($bssid,$objectid,$nmicmd); + sleep(1); + flash($bssid,$btsid,$cellid); +} + +if($upload==1) +{ + $nmicmd="upload 12"; + $objectid="BssFunc"; + + putcommand($bssid,$objectid,$nmicmd); + sleep(3); + flash($bssid,$btsid,$cellid); +} +$upload = 1; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo ""; + echo "Back";//back + echo "
      "; +?> + + +"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($trx_disp_name[],$trx_object_name[]) =$row; + } + $no_of_trx = count($trx_object_name);//e.g RCarrier.0.0.4 + +for($i=0;$i<$no_of_trx;$i++) +{ +//RCarrier >>>>>>>>> +$trx_cont = explode(".",$trx_object_name[$i]); +//echo ">>>>>$trx_$cont[0].$trx_cont[1].$trx_cont[2].$trx_cont[3]"; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +//Trx .............. +$sqlstring="select AdminState,OperState,AvailStatus,trxDiagResult from OMCR_Trx where bssid=$bssid and ObjectId like 'Trx.$trx_cont[1].$trx_cont[2].$trx_cont[3]'"; +//echo "$sqlstring
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$rxresult) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + //Failed=0;Passed=1;Not Performed=2 + if($rxresult==0)$rxresult="Failed"; + else if($rxresult==1)$rxresult="Passed"; + else if($rxresult==2)$rxresult="Not Performed"; + +echo ""; +echo ""; +echo ""; +} +//PowerControl +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +//AdjHand >>>>>>>>> +echo ""; +//Check AdjHand is ok....... +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'AdjHand.$btsid.$cellid%' and engDisplayName='' and Presence=1 and bssid=$bssid"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($adjhand_object[]) =$row; +} +//echo "$adjhand_object[0]"; +$no_of_adj = count($adjhand_object); +$array = array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31); +//print_r($array); + +for($n=0;$n<$no_of_adj;$n++) +{ + $adj_num = explode(".",$adjhand_object[$n]); + $num[$n] = $adj_num[3]; + unset($array[$num[$n]]); +} +$array = array_values($array); +//print_r($array); +$adjhand = $array[0]; +$objectid = "AdjHand.".$btsid.".".$cellid.".".$adjhand; +$addtype = "AdjHand"; +echo ""; +echo ""; + +?> \ No newline at end of file diff --git a/wxc2_omc/element/bssSpecific/bss_btsmgr.php b/wxc2_omc/element/bssSpecific/bss_btsmgr.php new file mode 100755 index 0000000..ff5751b --- /dev/null +++ b/wxc2_omc/element/bssSpecific/bss_btsmgr.php @@ -0,0 +1,444 @@ +正在调试中,给您的工作带来不便,请原谅!!:^_^"; +echo "
      RCarrier $trx_cont[3]"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $sqlstring = "select AdminState,OperState,AvailStatus,RxAntenna from OMCR_RCarrier where ObjectId='RCarrier.$trx_cont[1].$trx_cont[2].$trx_cont[3]' and bssid=$bssid";//$trx_object_name[$i] + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$rxmode) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + if($rxmode==0)$rxmode="DIVERSITY"; + else if($rxmode==1)$rxmode="ANTENNA 1"; + else if($rxmode==2)$rxmode="ANTENNA 2"; + + echo ""; + echo "
      Receive ModeAdminStateOperStateAvailStatus
      "; + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      $rxmode"; + + echo "$adminstate$operstate$availstatus
      "; + echo "
      Trx $trx_cont[3]"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + //TrxCh======== + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + for($j=0;$j<8;$j++) + { + $sqlstring="select AdminState,OperState,AvailStatus,UsageState from OMCR_TrxCh where bssid=$bssid and ObjectId like 'TrxCh.$btsid.$cellid.$trx_cont[3].$j'"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$usagestate) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + //IDLE=0;ACTIVE=1;BUSY=2 + if($usagestate==0)$usagestate="IDLE"; + else if($usagestate==1)$usagestate="ACTIVE"; + else if($usagestate==2)$usagestate="BUSY"; + + echo ""; + echo""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo "
      Diagnostic ResultAdminStateOperStateAvailStatus
      $rxresult$adminstate$operstate$availstatus
      NoAdminStateOperStateAvailStatusUsage Status
      TRXCH $j$adminstate$operstate$availstatus$usagestate
      "; + +echo "
      Power Control"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $sqlstring="select MsTxPwrMin,BtsTxPwrMin,PcAveragingLevelParamHreqave,PcAveragingQualParamHreqave from OMCR_PwrCont where bssid=$bssid and ObjectId like 'PwrCont.$btsid.$cellid.0'"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($mtpm,$btpm,$alph,$aqph) =$row; + } + + echo ""; + echo "
      MsTxPwrMinBtsTxPwrMinAverging window for LevelAverging window for Quality
      "; + + echo ""; + + echo ""; + echo ""; + echo ""; + + echo "
      $mtpm$btpm$alph$aqph
      "; + echo "
      Handover Control"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $sqlstring="select HoThresholdLevUl,HoThresholdQualUl,HoThresholdLevDl,HoThresholdQualDl from OMCR_HandCont where bssid=$bssid and ObjectId like 'HandCont.$btsid.$cellid.0'"; + + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($htlu,$htqu,$htld,$htqd) =$row; + } + + echo ""; + echo "
      Uplink RxLev ThresholdUplink RxQual ThresholdDownlink RxLev ThresholdDownlink RxQual Threshold
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
      $htlu$htqu$htld$htqd
      "; + echo "
      "; +echo ""; +echo ""; + echo ""; +echo "
      Adjacent Hand+
      "; + +//////////////////////////////AdjHand Parametet////////////////////////////////////////// +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + +for($i=0;$i<$no_of_adj;$i++) +{ + $adjconts = explode(".",$adjhand_object[$i]); + $sqlstring = "select Label,CellGlobalIdentityLaiMcc,CellGlobalIdentityLaiMnc,LocationAreaCodes,CellGlobalIdentityCi,BsIdentityCodes,BcchFrequency from OMCR_AdjHand where bssid=$bssid and ObjectId like 'AdjHand.$btsid.$adjconts[2].$adjconts[3]'"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($cellname,$mcc,$mnc,$lac,$cellid,$bsic,$bcch) =$row; + } + echo ""; + //echo "
      NameMCCMNCLACCell IdBSICBCCHDelete
      "; + + $objectid = "AdjHand.".$btsid.".".$adjconts[2].".".$adjconts[3]; + $deltype = "AdjHand"; + $adjhand = $adjconts[3]; + $cellid = $adjconts[2]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; +} +echo "
      \"$cellname\"$mcc$mnc$lac$cellid$bsic$bcch"; + echo "
      "; +echo "
      "; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network"; +echo "> BSS Specific"; +echo ">BtsMgr $btsid"; +echo "
      "; +echo "
      "; +//run add or del +function flash($bssid,$btsid) +{ + echo ""; +} +if($addtype=='Bts') +{ + if($cellid > 2) + { + echo ""; + } + else + { + $nmicmd="create Bts ".$cellid; + $objectid="BtsMgr.".$btsid; + putcommand($bssid,$objectid,$nmicmd); + sleep(2); + flash($bssid,$btsid); + } +} +/* +if($deltype=='Bts') +{ + $nmicmd="delete Bts ".$cellid; + $objectid="BtsMgr.".$btsid; + echo "obj=$objectid"; + putcommand($bssid,$objectid,$nmicmd); + flash($bssid,$btsid); +} +*/ +//display table + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + //echo ""; + echo "Back"; + echo "
      "; +?> + + +>> +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//////////////////////////////////////////////////////////////////////////////////////////////// +//Bts.......................................> +echo ""; +//echo ""; +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.$btsid%' and Presence=1 and bssid=$bssid"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($cell_object[]) =$row; +} +$no_of_cell = count($cell_object); +$array = array(0,1,2,3); + + +for($n=0;$n<$no_of_cell;$n++) +{ + $cell_num = explode(".",$cell_object[$n]); + $num[$n] = $cell_num[2]; + unset($array[$num[$n]]); +} +$array = array_values($array); +//print_r($array); +$cellid = $array[0]; +$objectid = "Bts.".$btsid.".".$cellid; +$addtype = "Bts"; + +echo ""; +echo ""; +echo ""; + +//Shelf for BtsMgr (1~11)===== +if($btsid != 0){ +echo ""; +echo ""; +echo ""; +echo ""; +}//end btsid!=0 +$sqlstring = "select Presence from OMCR_BSSTREE where ObjectId='BtsMgr_Software.$btsid.0' and bssid=$bssid"; +//echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + $presence =$row[0]; + } + +//Software +if($presence==1){ +echo ""; +echo ""; +echo ""; +}//end presence==1 + +?> diff --git a/wxc2_omc/element/bssSpecific/bss_dsp.php b/wxc2_omc/element/bssSpecific/bss_dsp.php new file mode 100755 index 0000000..83c6d27 --- /dev/null +++ b/wxc2_omc/element/bssSpecific/bss_dsp.php @@ -0,0 +1,178 @@ +正在调试中,给您的工作带来不便,请原谅!!:^_^"; +echo "
      AbisMgr"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $sqlstring = "select AdminState,OperState,AvailStatus,E1Port,E1Slot,E1Chan from OMCR_AbisMgr where ObjectId='AbisMgr.$btsid.0' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$e1port,$e1slot,$e1chan) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      SlotPortChanAdminStateOperaStateAvailStatus
      $e1slot$e1port$e1chan$adminstate$operstate$availstatus
      "; + echo "
      Bts"; +echo ""; +echo ""; + echo ""; +echo "
      Cell+
      "; + +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<$no_of_cell;$i++) + { + $cellconts = explode(".",$cell_object[$i]); + $sqlstring = "select AdminState,OperState,AvailStatus,Label from OMCR_Bts where ObjectId='Bts.$btsid.$cellconts[2]' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$cellname) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + /* $sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Trx.$btsid.$cellconts[2]%' and Presence=1 and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while($row = mysqli_fetch_row($result)) + { + list($trx_list[]) =$row; + } + $no_of_trx = count($trx_list); + */ + echo ""; + echo "
      NoCell NameAdminStateOperStateAvailStatus
      "; + $cellid = $cellconts[2]; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //echo ""; + /*echo ""; + */ + echo ""; + + }//end for... + echo "
      $cellconts[2]\"$cellname\"$adminstate$operstate$availstatus$no_of_trx"; + $deltype = "Bts"; + + $objectid = "Bts.".$btsid.".".$cellid; + echo ""; + + echo "
      "; + echo "
      SHELF"; +$sqlstring = "select DoorInterlockEnable,bssUplinkVolumeControl,bssDownlinkVolumeControl from OMCR_Wavex where ObjectId like 'BtsMgr_Shelf.$btsid.0' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($dooralarm,$uvc,$dvc) =$row; + } + //-6dB=0;-4dB=1;-2dB=2;normal =3;+2dB=4;+4dB=5;+6dB=6;+8dB=7 + if($dooralarm==0)$dooralarm="Disable"; + else if($dooralarm==1)$dooralarm="Enable"; + if($uvc==0)$uvc="-6dB"; + else if($uvc==1)$uvc="-4dB"; + else if($uvc==2)$uvc="-2dB"; + else if($uvc==3)$uvc="normal"; + else if($uvc==4)$uvc="+2dB"; + else if($uvc==5)$uvc="+4dB"; + else if($uvc==6)$uvc="+6dB"; + else if($uvc==7)$uvc="+8dB"; + if($dvc==0)$dvc="-6dB"; + else if($dvc==1)$dvc="-4dB"; + else if($dvc==2)$dvc="-2dB"; + else if($dvc==3)$dvc="normal"; + else if($dvc==4)$dvc="+2dB"; + else if($dvc==5)$dvc="+4dB"; + else if($dvc==6)$dvc="+6dB"; + else if($dvc==7)$dvc="+8dB"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + + echo ""; + +/************************************************************************************************************/ +//BtsMgr_Shelf_Card_Port.$btsid.0.1.0 + $sqlstring="select Presence from OMCR_BSSTREE where engDisplayName like 'Card%' and ObjectId like 'BtsMgr_Shelf_Card.$btsid.0%' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while($row = mysqli_fetch_row($result)) + { + list($presence) =$row; + } + if($presence==1){ + echo ""; + + echo "
      Door AlarmUplink Volume ControlDownlink Volume Control
      $dooralarm$uvc$dvc
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + echo "
      NoAdminStateOperStateAvailStatusInterface
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo "
      Card 1"; + $sqlstring="select AdminState,OperState,AvailStatus,INTERFACE from OMCR_E1port where bssid=$bssid and ObjectId = 'BtsMgr_Shelf_Card_Port.$btsid.0.1.0'"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$interface) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + if($interface==0)$interface="Unused"; + else if($interface==1)$interface="AIF"; + else if($interface==2)$interface="ABIS"; + else if($interface==5)$interface="R2"; + echo "
      Port 0"; + + echo "$adminstate$operstate$availstatus$interface
      "; + + echo ""; + $sqlstring="select AdminState,OperState,AvailStatus,INTERFACE from OMCR_E1port where bssid=$bssid and ObjectId = 'BtsMgr_Shelf_Card_Port.$btsid.0.1.1'"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($adminstate,$operstate,$availstatus,$interface) =$row; + } + + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + if($interface==0)$interface="Unused"; + else if($interface==1)$interface="AIF"; + else if($interface==2)$interface="ABIS"; + else if($interface==5)$interface="R2"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +//Clock Module +$sqlstring = "select Presence from OMCR_BSSTREE where ObjectId='BtsMgr_Shelf_Card.$btsid.0.17' and bssid=$bssid"; +//echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + $presence =$row[0]; + } + if($presence==1){ + + echo ""; + echo "
      Port 1"; + + echo "$adminstate$operstate$availstatus$interface
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }//if presence==1 + + }//if card presence==1 +echo "
      ClockModule--------
      "; +echo "
      Software"; +$sqlstring = "select CurrentFlashVersion,PrimaryFlashVersion,SecondaryFlashVersion from OMCR_Software where bssid=$bssid and ObjectId like 'BtsMgr_Software.$btsid.0'"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($cfv,$pfv,$sfv) =$row; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo "
      CurrentFlashVersionPrimaryFlashVersionSecondaryFlashVersion
      \"$cfv\"\"$pfv\"\"$sfv\"
      "; + echo "
      "; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network"; +echo "> BSS Specific"; +echo ">DSP Card "; +echo "
      "; +echo "
      "; + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      Back";//back + echo "
      "; +?> + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      DSP"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "";//Half Rate=0;Full Rate=1;Enhanced Full Rate =2 + $sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.0' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($type,$adminstate,$operstate,$availstatus) =$row; + } + if($type==0)$type="Half Rate"; + else if($type==1)$type="Full Rate"; + else if($type==2)$type="Enhanced Full Rate"; + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo "";//DSP 0 + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + $sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.1' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($type,$adminstate,$operstate,$availstatus) =$row; + } + if($type==0)$type="Half Rate"; + else if($type==1)$type="Full Rate"; + else if($type==2)$type="Enhanced Full Rate"; + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo "";//DSP 1 + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + $sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.2' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($type,$adminstate,$operstate,$availstatus) =$row; + } + if($type==0)$type="Half Rate"; + else if($type==1)$type="Full Rate"; + else if($type==2)$type="Enhanced Full Rate"; + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo "";//DSP 2 + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + $sqlstring = "select Type,AdminState,OperState,AvailStatus from OMCR_TrauDsp where ObjectId='DSP.0.$cardnum.$dspnum.3' and bssid=$bssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($type,$adminstate,$operstate,$availstatus) =$row; + } + if($type==0)$type="Half Rate"; + else if($type==1)$type="Full Rate"; + else if($type==2)$type="Enhanced Full Rate"; + if($adminstate==1)$adminstate="Locked"; + else if($adminstate==2)$adminstate="Unlocked"; + if($operstate==1)$operstate="Disable"; + else if($operstate==2)$operstate="Enable"; + if($availstatus==0)$availstatus="In_Test"; + else if($availstatus==1)$availstatus="Failed"; + else if($availstatus==2)$availstatus="Power_Off"; + else if($availstatus==3)$availstatus="Offline"; + else if($availstatus==4)$availstatus="Online"; + else if($availstatus==5)$availstatus="Dependency"; + else if($availstatus==6)$availstatus="Degraded"; + else if($availstatus==7)$availstatus="Not_Installed"; + + echo "";//DSP 3 + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      DSP_NumAdminStateOperaStateAvailStatusDSP Type
      0$adminstate$operstate$availstatus$type
      1$adminstate$operstate$availstatus$type
      2$adminstate$operstate$availstatus$type
      3$adminstate$operstate$availstatus$type
      "; + echo "
      "; diff --git a/wxc2_omc/element/bssSpecific/bss_smmsg.php b/wxc2_omc/element/bssSpecific/bss_smmsg.php new file mode 100755 index 0000000..ae59695 --- /dev/null +++ b/wxc2_omc/element/bssSpecific/bss_smmsg.php @@ -0,0 +1,131 @@ +正在调试中,给您的工作带来不便,请原谅!!:^_^"; +function flash($bssid) +{ + echo "
      $action
      "; + echo ""; +} +if($addtp=='SmMsg') +{ + $nmicmd="create SmMsg ".$msgnum; + $objectid="SmsCb.0"; + putcommand($bssid,$objectid,$nmicmd); + flash($bssid); +} +if($deltp=='SmMsg') +{ + $nmicmd="delete SmMsg ".$msgnum; + $objectid="SmsCb.0"; + putcommand($bssid,$objectid,$nmicmd); + flash($bssid); +} + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network >"; +echo " BSS Specific > SmMsg"; +echo "
      "; +echo "
      "; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + //echo ""; + echo "Back"; + echo "
      "; +?> + + +"; +//Check SmMsg is ok....... +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'SmMsg.0%' and Presence=1 and bssid=$bssid"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($smmsg_object[]) =$row; +} +//echo "$adjhand_object[0]"; +$no_of_msg = count($smmsg_object); +$array = array(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31); +//print_r($array); + +for($n=0;$n<$no_of_msg;$n++) +{ + $msg_num = explode(".",$smmsg_object[$n]); + $num[$n] = $msg_num[2]; + unset($array[$num[$n]]); +} +$array = array_values($array); +//print_r($array); +$msgnum = $array[0]; +$objectid = "SmMsg.0.".$msgnum; +$addtp = "SmMsg"; +echo ""; +echo ""; +?> diff --git a/wxc2_omc/element/bssSpecific/function.php b/wxc2_omc/element/bssSpecific/function.php new file mode 100755 index 0000000..433a43d --- /dev/null +++ b/wxc2_omc/element/bssSpecific/function.php @@ -0,0 +1,423 @@ + + + +"; + $bssDb = "BssOmcDb"; + $sqlstring = "LOCK TABLES OMCR_COMMAND WRITE"; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + $sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; + //echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while (list($row_no[]) = mysqli_fetch_row($res)); + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + + if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) + { + // No available row in OMCR_COMMAND + // Send error to MySQL() + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&status='{${$parameter}[cmdtablefull]}'" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"")); + return; + } + // Insert 2 commands in OMCR_COMMAND out of 10 possible available rows + $i=0; + do//OidCommand + { + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . $row_no[$i] . + ",$bssid,'oid $objectid',null,255,-1,null,null,null)"; + //echo "sql>>>$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; + } while ($i<10 && mysql_affected_rows() != 2); + + $cmd1_row_no = $row_no[$i-1]; + + do//nmicommand + { + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + $row_no[$i] . ",$bssid,'$nmicmd',null,255,-1,null,null,null)"; + //echo "sql>>>$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; + } while (mysql_affected_rows() != 2 && $i<10); + $cmd2_row_no = $row_no[$i-1]; + //Unlock Tables + $sqlstring = "UNLOCK TABLES"; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + + //Waiting for Response + $timewait=0; + $timeout =24; + $interval=500000; // in micro-seconds + while ($timewait < 1000000 * $timeout) + { + if($nmicmd!="get") + { + $cmd = explode(" ",$nmicmd); + if($timewait==0){ + echo "
      "; + if($nmicmd=="upload 12"){ + echo "upload data"; + }else if($cmd[0]=="action") + { + echo "Doing this action"; + }else{ + echo "$nmicmd"; + } + echo "
      "; + } + echo ""; + flush(); + } + $resultcode=$responsecode=$result=$response=null; + usleep($interval); + $timewait += $interval; + + $sqlstring = "SELECT t1.resultcode,t1.responsecode," . + "t2.engStatInfo,t3.engStatInfo " . + "FROM OMCR_COMMAND AS t1,OMCR_STATCODE AS t2,OMCR_VARSTATCODE AS t3 " . + "WHERE t2.statcode=t1.resultcode AND t3.statcode=t1.responsecode " . + "AND t1.status=0 " . + "AND (t1.row_no=$cmd1_row_no OR t1.row_no=$cmd2_row_no) " . + "ORDER BY seqNum ASC"; + + //echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + { + list($resultcode[],$responsecode[],$result[],$response[]) = $mydata; + } + $no_of_rows = mysqli_num_rows($res); + //echo "$resultcode[0],$responsecode[0],$result[0],$response[0]
      "; + //echo "$resultcode[1],$responsecode[1],$result[1],$response[1]
      "; + //echo "no_of_rows = $no_of_rows
      "; + mysql_free_result($res); + if ($no_of_rows == 2) + { + + if ($resultcode[0] != 0) // 0='ok' + { + /* + echo "
      "; + echo "BSS and OMC connection broken!"; + echo "
      "; + + + echo "
      "; +echo ""; +echo ""; + echo ""; +echo "
      SmMsg+
      "; + +//////////////////////////////SmMsg Parametet////////////////////////////////////////// +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + +for($i=0;$i<$no_of_msg;$i++) +{ + $msgconts = explode(".",$smmsg_object[$i]); + $sqlstring = "select MsgId,SerialNo,numBroadcast,RepetitionRate,NumPages from OMCR_SmMsg where bssid=$bssid and ObjectId like 'SmMsg.0.$msgconts[2]'"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + + while($row = mysqli_fetch_row($result)) + { + list($msgid,$serialno,$numbc,$rr,$np) =$row; + } + $ref = "./objShow.php?language=$language&objectid=SmMsg.0.$msgconts[2]&tablename=OMCR_SmMsg&bssid=$bssid"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + +} +echo "
      MsgIdSerialNoNumBroadcastRepetitionRateNumPagesDelete
      $msgid$serialno$numbc$rr$np"; + $objectid = "SmMsg.0.".$msgconts[2]; + $msgnum = $msgconts[2]; + $deltp = "SmMsg"; + echo "
      "; +echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      Back
      "; + */ + + $alarm_info="BSS and OMC connection broken!"; + $back_url="./bssSpecific.php?bssid=$bssid"; + show_alarm($alarm_info,$back_url); + + + + exit(); + } + elseif ($resultcode[1] != 0) + { + /* + echo "
      "; + echo "Imp Command fail!!!"; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Back
      "; + */ + + $alarm_info="Imp command fail!"; + $back_url="./bssSpecific.php?bssid=$bssid"; + show_alarm($alarm_info,$back_url); + + exit(); + } + return; + } + + }//end while + + // Server or BSC has no response + // OMCR_COMMAND.status did not change to zero before timeout + // + $sqlstring = "SELECT * FROM OMCR_COMMAND " . + "WHERE status=254 AND (row_no=$cmd1_row_no OR row_no=$cmd2_row_no) "; + //echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + $test = mysqli_fetch_row($res); + //echo "You are >>> $test"; + if (mysqli_fetch_row($res)) + { + /* + echo "
      "; + echo "No response from Bsc!!!"; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Back
      "; + */ + + $alarm_info="No response from Bsc!"; + $back_url="./bssSpecific.php?bssid=$bssid"; + show_alarm($alarm_info,$back_url); + + exit(); + } + else + { + /* + echo "
      "; + echo "No response from BssComm!!!"; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Back
      "; + */ + + $alarm_info="No response from BssComm!"; + $back_url="./bssSpecific.php?bssid=$bssid"; + show_alarm($alarm_info,$back_url); + + exit(); + //echo date('h:i:s') . "\n"; + + } + $sqlstring = "UPDATE OMCR_COMMAND SET status=0 WHERE row_no=$cmd1_row_no OR row_no=$cmd2_row_no"; + //echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + + +} + +//==================show the alarm info========================== +function show_alarm($info,$backurl) +{ + echo "\n\n"; + +} +?> \ No newline at end of file diff --git a/wxc2_omc/element/bssSpecific/logdb.inc b/wxc2_omc/element/bssSpecific/logdb.inc new file mode 100755 index 0000000..76c904d --- /dev/null +++ b/wxc2_omc/element/bssSpecific/logdb.inc @@ -0,0 +1,8 @@ + + diff --git a/wxc2_omc/element/bssSpecific/objModify.php b/wxc2_omc/element/bssSpecific/objModify.php new file mode 100755 index 0000000..90b3fcb --- /dev/null +++ b/wxc2_omc/element/bssSpecific/objModify.php @@ -0,0 +1,339 @@ +"; +//echo "modified_data = $modified_data
      "; +//exit(); +if (!isset($url)) + $url = "objShow.php"; +if (!isset($timeout)) + $timeout = 15; + +if (!isset($language)) + $language = "eng"; + + +if($language == "chn"){ + $parameter = Array( + saveiscompleted => "保存完成", + actioniscompleted => "任务完成", + nobsscommresponse => "BssComm 没有回应", + nobscresponse => "BSC 没有回应", + cmdtablefull => "命令表没有空间,一会儿后再试" + ); +}else{ + $parameter = Array( + saveiscompleted => "Save is Completed: (modified items are highlighted)", + actioniscompleted => "Action is completed", + nobsscommresponse => "No response from BssComm", + nobscresponse => "No response from BSC", + cmdtablefull => "Command table is full: wait and send the command later" + ); +} + +// Display_Type +define("DO_NOT_DISPLAY",0); +define("PULLDOWN_MENU",1); +define("TEXTBOX",2); +define("LABEL",3); +define("RADIO_BUTTON",4); +define("PUSH_BUTTON",5); +define("CHECKBOX",6); +define("TEXTAREA",7); +define("CONFIRM_PUSH_BUTTON",8); + +// Attribute_Type +define("READONLY", 0); +define("NUMBERS", 1); +define("STRINGS", 2); +define("INTEGER_ARRAY", 3); + +$bssDb = "BssOmcDb"; +// +// if nothing has been modified, reload the original page +// + +if ( ($modified_data == '') && ($nmicommand == '')) +{ + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&status='Nothing is requested'" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + return; +} + +// +// Find the available row in OMCR_COMMAND to insert nmi commands +// Get 10 available and insert 2 nmi commands +// 1. oid $objectid +// 2. set $para1=$val1 [$para2=$val2] ... +// +function displayaction() +{ + echo ""; + flush(); +} +$dbname="BssOmcDb"; +$hostname="localhost"; +$username="root"; +$password="rootaa"; + +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +if ($nmicommand != '') +{ + $nmicmd = $nmicommand; +} +else if ($modified_data != '') +{ + //echo $modified_data . "
      "; + $parm_name = explode(",",$modified_data); + $nmicmd="set"; + foreach ($parm_name as $attribute) + { + switch(${"t$attribute"}) + { + + case NUMBERS: + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + + if (${$attribute}) + { + //$nmicmd.=" $attribute=${$attribute}"; + $nmicmd.=" $tmpStr=${$attribute}"; + } + else // for checkbox: ${$attribute}=true or false + { + //$nmicmd.=" $attribute=0"; + $nmicmd.=" $tmpStr=0"; + } + break; + case STRINGS: + if($attribute=="Label"){ + $nmicmd.=" $attribute=\"" . rawurlencode(${$attribute}) . "\""; + } + else + { + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + //$nmicmd.=" $tmpStr=\"" . rawurlencode(${$attribute}) . "\""; + $nmicmd.=" $tmpStr=\"" . (${$attribute}) . "\""; + //echo "string == ${$attribute}"; + } + break; + case INTEGER_ARRAY: + $tmpSql="SELECT Attribute_Id FROM OMCR_Meta_Table WHERE Attribute_Name='$attribute'"; + $tmpResult = mysql_query($tmpSql,$db) or + die("Invalid query: $tmpSql\n" . mysqli_error($pubConn)); + $tmpRow = mysqli_fetch_row($tmpResult); + $tmpStr=$tmpRow[0]; + $stringarray = explode("_",$tmpStr); + $nmicmd.= " $stringarray[0]=[$stringarray[1]=${$attribute}]"; + break; + default: + break;; + } + //echo $nmicmd . "
      "; + } +} + +$sqlstring = "LOCK TABLES OMCR_COMMAND WRITE"; +$res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +$sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; +//echo "$sqlstring
      "; +$res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +while (list($row_no[]) = mysqli_fetch_row($res)); +$no_of_rows = mysqli_num_rows($res); +mysql_free_result($res); + +if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) +{ + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + header("Location: " . + "$url?language=$language&bssid=$bssid&objectid=$objectid" . + "&tablename=$tablename" . + "&status='{${$parameter}[cmdtablefull]}'" . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + return; +} + +// +// Insert 2 commands in OMCR_COMMAND out of 10 possible available rows +// +$i=0; +do +{ + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . $row_no[$i] . + ",$bssid,'oid $objectid',null,255,-1,null,null,null)"; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while ($i<10 && mysql_affected_rows() != 2); + +$cmd1_row_no = $row_no[$i-1]; + +do +{ + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + $row_no[$i] . ",$bssid,'$nmicmd',null,255,-1,null,null,null)"; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; +} while (mysql_affected_rows() != 2 && $i<10); +$cmd2_row_no = $row_no[$i-1]; +//echo "cmd1_row_no=$cmd1_row_no,cmd2_row_no=$cmd2_row_no
      "; +$sqlstring = "UNLOCK TABLES"; +$res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + +// +// Wait for response: timeout value = $timeout +// +$timewait=0; +$interval=500000; // in micro-seconds + +while ($timewait < 1000000 * $timeout) +{ + $resultcode=$responsecode=$result=$response=null; + usleep($interval); + //echo ""; + //flush(); + $timewait += $interval; + + $sqlstring = "SELECT t1.resultcode,t1.responsecode," . + "t2.engStatInfo,t3.engStatInfo " . + "FROM OMCR_COMMAND AS t1,OMCR_STATCODE AS t2,OMCR_VARSTATCODE AS t3 " . + "WHERE t2.statcode=t1.resultcode AND t3.statcode=t1.responsecode " . + "AND t1.status=0 " . + "AND (t1.row_no=$cmd1_row_no OR t1.row_no=$cmd2_row_no) " . + "ORDER BY seqNum ASC"; + + //echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + { + list($resultcode[],$responsecode[],$result[],$response[]) = $mydata; + } + $no_of_rows = mysqli_num_rows($res); + //echo "no_of_row=$no_of_rows
      "; + mysql_free_result($res); + + if ($no_of_rows == 2) + { + if ($resultcode[0] != 0) // 0='ok' + { + // Oid failed !!! + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&objectid=$objectid&tablename=$tablename" . + "&alarm=$result[0]" . + (($responsecode[0]!=0)? " --- $response[0]":"") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"")); + //echo ""; + + } + elseif ($resultcode[1] != 0) + { + // Nmi command failed !!! + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&objectid=$objectid&tablename=$tablename" . + "&alarm=$result[1]" . + (($responsecode[1]!=0)? " --- $response[1]":"") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"")); + } + else + { + // Success !!! + header("Location: " . + "$url?language=$language&bssid=$bssid" . + "&objectid=$objectid" . + "&tablename=$tablename" . + ( (strncmp(strtolower($nmicommand), "create",6) + && strncmp(strtolower($nmicommand), "delete",6) + && (strncmp(strtolower($objectid),"abismgr",7) || strncmp(strtolower($nmicommand),"set adminstate=2",16)) + )? + "&status={${$parameter}[saveiscompleted]}": + "&status={${$parameter}[actioniscompleted]}" + ) . +// (($nmicommand != '') ? "&status={${$parameter}[actioniscompleted]}": +// "&status={${$parameter}[saveiscompleted]}") . + (($modified_data == '') ? "":"&saved=$modified_data") . + (isset($x)?"&x=$x":"") . + (isset($y)?"&y=$y":"") + ); + } + + return; + }//end if + +}//end while + + // + // Server or BSC has no response + // OMCR_COMMAND.status did not change to zero before timeout + // + $sqlstring = "SELECT * FROM OMCR_COMMAND " . + "WHERE status=254 AND (row_no=$cmd1_row_no OR row_no=$cmd2_row_no) "; + //echo "sql>$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + $test = mysqli_fetch_row($res); + //echo "result>>$test
      "; + if (mysqli_fetch_row($res)) + { + echo "
      "; + echo "No response from Bsc!!!"; + echo "
      "; + echo "Back"; + } + else + { + echo "
      "; + echo "No response from BssComm!!!"; + echo "
      "; + echo "Back"; + } + + // + // Change status to 0 + // + $sqlstring = "UPDATE OMCR_COMMAND SET status=0 WHERE row_no=$cmd1_row_no OR row_no=$cmd2_row_no"; + //echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); +?> diff --git a/wxc2_omc/element/bssSpecific/objShow.php b/wxc2_omc/element/bssSpecific/objShow.php new file mode 100755 index 0000000..a814717 --- /dev/null +++ b/wxc2_omc/element/bssSpecific/objShow.php @@ -0,0 +1,709 @@ +"; + + + +//onclick('objects.php?language=eng&bssid=0&objectid=ALinkSet.0.0&tablename=OMCR_ALinkSet');"> +if($language == 'chn'){ + $parameter = Array( + confirmquestionbegin => "决定要", + confirmquestionend => "吗?", + entervalidvalue => "请输入有效数值", + actioniscompleted => "任务完成", + savenotneed => "没有变动" + ); +}else{ + $parameter = Array( + confirmquestionbegin => "Are you sure you want to ", + confirmquestionend => "?", + entervalidvalue => "You must enter valid value", + actioniscompleted => "Action is completed", + savenotneed => "Save Not needed" + ); +} + +// Display_Type +define("DO_NOT_DISPLAY",0); +define("PULLDOWN_MENU",1); +define("TEXTBOX",2); +define("LABEL",3); +define("RADIO_BUTTON",4); +define("PUSH_BUTTON",5); +define("CHECKBOX",6); +define("TEXTAREA",7); +define("CONFIRM_PUSH_BUTTON",8); + +// Attribute_Type +define("READONLY", 0); +define("NUMBERS", 1); +define("STRINGS", 2); +define("INTEGER_ARRAY", 3); + +?> + + + + + + + + WXC2 OMC V8.3 + + + +$alarm"; + + +$url_temp=$_SERVER["REQUEST_URI"]; + +if(isset($alarm)&&$alarm!="OMC"&&$alarm!="attr") +{ + $url_temp=urlencode($url_temp); + show_alarm($alarm,$url_temp); +} + + +$status=""; + +if (!isset($bssid) || !isset($objectid) || !isset($tablename)) +{ + echo "The required information for this page is invalid.
      \n"; + echo "\n"; + exit(); +} + +// +// Translate the value to string +// e.g. AdminState=2 --> AdminState=Unlocked +// +function translate($input,$data) +{ + $found=-1; + if ($data) + { + $items=split("[;=]",$data); + $no_of_items=count($items); + + for ($i=0;$i<$no_of_items;$i+=2) { + if ( $input == $items[$i+1] ) { + $found=$i; + break; + } + } + if ($found != -1) + return($items[$found]); + } + return($input); +} + +$db = mysql_connect($hostname, $username, $password); +mysql_select_db($dbname,$db); + +// LOOK UP OMCR_META_TABLE for display parameters and buttons +// +// Display different xxxDisplay_Name base on the language selected +// +// +$sqlstring = "select Object_Name,Attribute_Name,Attribute_Id,Attribute_Type,Display_Type," . + "${language}Display_Name,${language}Lookup,${language}Help_Text" . + " from OMCR_Meta_Table " . + "where Display_Type<> 0 AND Object_Name='" . substr($tablename,5) . "'"; + +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while ( $row = mysqli_fetch_row($result) ) +{ + + //echo "object_name:{$rows[0]}
      "; + if (($row[4] == PUSH_BUTTON) || ($row[4] == CONFIRM_PUSH_BUTTON)) //For action item in NMI + list($act_object_name[], $act_attribute_name[], $act_attribute_id[], $act_attribute_type[], + $act_display_type[], $act_display_name[], $act_lookup[], + $act_help_text[]) = $row; + else + list($object_name[],$attribute_name[],$attribute_id[],$attribute_type[],$display_type[], + $display_name[],$lookup[],$help_text[]) = $row; +} +// +// Display the action buttons & confirmed action buttons +// +$no_of_actions = count($act_attribute_name); + +//========move the Bsc's reboot button on the buttom of the page================== +//echo "no_of_Actions:$no_of_actions
      "; +//print_r($act_lookup); +//echo "


      "; +//print_r($act_attribute_name); +$bscFlag=substr($objectid,0,3); +$rebootButtonIndex=0; +//echo "object_id:$bscFlag
      "; +//=================================================================================== +//echo "$objectid:"; +echo "
      "; +echo "
      "; + + +if($tablename=="OMCR_BtsMgr")//||$tablename=="OMCR_Bts") +{ + $PubDb = "OMC_PUB"; + $sqlstring="select Label from $tablename where ObjectId like '$objectid%'"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $cellname = $row[0]; + $objconts = explode(".",$objectid); + $bts_id = $objconts[1]; + if($cellname!='') + { + //$tab = explode("_",$tablename); + //$str=strtoupper($tab[1]); + $sqlstring="select ledOffset from sysConf where sysTypeName like 'BTS%'";//368 + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + //echo "sql>$sqlstring
      "; + //echo "ledOffset=$row[0]
      "; + $ext = $row[0]*16+(($bssid*12)+$bts_id)*16; + //echo "
      bssid=$bssid,btsid=$bts_id"; + $key_led_num=$ext; + //echo "key_led_num=$key_led_num
      "; + $sqlstring = "select key_src_page_num from sysLedConf where key_led_num=$key_led_num"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $key_led_num2=$row[0]; + //echo "key_src_page_num=$key_led_num2
      "; + $sqlstring = "select remark from sysLedConf where key_led_num=$key_led_num2"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + //echo "$row[0]
      "; + $sqlstring = "select remark from sysLedConf where sync_from_led=$key_led_num2"; + //echo "$sqlstring
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $remark = $row[0]; + //echo "$row[0]"; + //echo "cellname=$cellname
      "; + $site = explode("[",$cellname); + $point= explode(",",$site[1]); + $pointx=$point[0];$point_t=explode("]",$point[1]); + $pointy=$point_t[0]; + //echo "x=$pointx,y=$pointy
      "; + if($pointx!='') + { + $sqlstring = "update sysLedConf set point_x=$pointx,point_y=$pointy where sync_from_led=$key_led_num2"; + //echo "sql>$sqlstring"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + } + $test = explode(":",$remark); + $sqlstring = "update sysLedConf set remark = '$test[0]:$cellname' where remark='$remark'";//sync_from_led=$key_led_num2";and remark not like '$remark:$cellname%' + //echo "sql>$sqlstring
      "; + $remark = "$remark:$cellname"; + $conts = explode(":",$remark); + //if($conts[2]=='') + //echo "
      PubDb=$PubDb"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + } +} +$sqlbuf = "select CurrentBuildDir from OMCR_Software where bssid=$bssid"; +//echo $sqlstring . "
      "; +$results = mysqli_query($pubConn,$sqlbuf) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +$rows = mysqli_fetch_row($results); + + +$software = explode("_",$rows[0]); + +$flag = 1; +$contain = explode(".",$objectid); +switch($contain[0]) +{ + case "Shelf": + case "Port": + case "Card": + $backurl = "./bssSpecific.php?bssid=$bssid"; + break; + case "DSP": + //$dspcont =explode(".",$objectid); + //$dspnum = $dspcont[3]; + //$cardnum = $dspcont[2]; + //$backurl = "./bss_dsp.php?bssid=$bssid&dspnum=$dspnum&cardnum=$cardnum"; + $backurl = "./bssSpecific.php?bssid=$bssid"; + break; + case "BtsMgr_Shelf": + case "BtsMgr_Shelf_Card_Port": + case "BtsMgr_Software": + case "BtsMgr_Shelf_Card": + $btscont = explode(".",$objectid); + $btsid = $btscont[1]; + $backurl = "./bss_btsmgr.php?bssid=$bssid&btsid=$btsid"; + break; + case "AdjHand": + $btscont = explode(".",$objectid); + $btsid = $btscont[1]; + $backurl = "./bss_bts.php?bssid=$bssid&btsid=$btsid&cellid=$cellid"; + break; + default: + break; +} + +switch($tablename) +{ + case "OMCR_AIf": + case "OMCR_Bsc": + case "OMCR_BtsMgr": + $backurl = "./bssSpecific.php?bssid=$bssid"; + break; + case "OMCR_SmsCb": + $backurl = "./bssSpecific.php?bssid=$bssid"; + break; + case "OMCR_SmMsg": + $backurl = "./bss_smmsg.php?bssid=$bssid"; + break; + case "OMCR_ALinkSet": + case "OMCR_ALink": + $backurl = "./bss_aif.php?bssid=$bssid"; + break; + case "OMCR_AbisMgr": + case "OMCR_Bts": + $btscont = explode(".",$objectid); + $btsid = $btscont[1]; + $backurl = "./bss_btsmgr.php?bssid=$bssid&btsid=$btsid"; + break; + case "OMCR_RCarrier": + case "OMCR_Trx": + case "OMCR_TrxCh": + case "OMCR_PwrCont": + case "OMCR_HandCont": + $btscont = explode(".",$objectid); + $btsid = $btscont[1]; + $cellid = $btscont[2]; + $backurl = "./bss_bts.php?bssid=$bssid&btsid=$btsid&cellid=$cellid"; + break; + default: + break; +} + + +//show the navigation for this page + + +$temp=explode("/",$backurl); +$temp=explode("?",$temp[1]); +$temp=$temp[0]; +//echo "
      $temp
      "; +if($temp=="bssSpecific.php") + $navigation_title="Configuration > Network > BSS Specific > $objectid"; +if($temp=="bss_aif.php") + $navigation_title="Configuration > Network > BSS Specific > AIf > $objectid"; +if($temp=="bss_smmsg.php") + $navigation_title="Configuration > Network > BSS Specific > SmMsg > $objectid"; +if($tablename=="OMCR_ClockMod") + $navigation_title="Configuration > Network > BSS Specific > Clock Module"; + + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      $navigation_title
      "; +echo "
      "; + + +echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + + + +if(isset($backurl)) +echo "
      $objectid:"; +for ($i=0;$i<$no_of_actions;$i++) +{ + if($bscFlag=="Bsc"&&$act_attribute_name[$i]=="Reboot") + { + $rebootButtonIndex=$i; + continue; + } + + if (!strncmp($act_lookup[$i],"javascript:",11)) // Direct to another webpage + { + echo ""; + + } + else if ($act_lookup[$i] != '') // NMI Actions + { + + if ($act_display_type[$i] == CONFIRM_PUSH_BUTTON) + $need_confirm = "true"; + else + $need_confirm = "false"; + + if ($act_attribute_name[$i] == "Audit") + { + + echo ""; + echo " $nbsp  "; + + } + else if($act_attribute_name[$i] != "New_ALink1"&&$act_attribute_name[$i] != "Del_ALink1"&&$act_attribute_name[$i] != "Del_Bss_DB") + { + echo ""; + } + } + else if ($act_attribute_name[$i] == "Revert") // Reset Webpage input the original value + { + + //echo "\n"; + } + else // Simply Save the altered values + { + + if ($act_attribute_name[$i] == "Save") + { + echo ""; + + } + else + { + echo ""; + } + } + +} +echo "Back
      "; +else +echo "Back"; +//////////////////////////////////////////////// +$no_of_parms = count($attribute_name); + +if ($no_of_parms == 0) +{ + echo "
      "; +} +else +{ + + // + // LOOK UP OMCR_ getting real parameter + // + $sqlstring = "select " . join(",",$attribute_name) . + ",ObjectId from $tablename " . + "where bssid=$bssid and ObjectId like '$objectid'"; + + //echo "
      ".$sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $no_of_instance = mysqli_num_rows($result); + + while ( $row = mysqli_fetch_row($result) ) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for ($i=0; $i<$no_of_parms; $i++) + { + if($tablename=="OMCR_E1port" && $row[7]==0 && $attribute_name[$i]=="FrameFormat")//if E1 not display T1 + { + $display_type[$i]=0; + $display_name[$i]=""; + } + if($tablename=="OMCR_AIf" && $software[0]=="iw06" && $attribute_name[$i]=="dpcLen") + { + $display_type[$i]=0; + $display_name[$i]=""; + } + switch($display_type[$i]) + { + case DO_NOT_DISPLAY: //do not display + $widget=""; + continue; + case PULLDOWN_MENU: //pulldown menu + $widget=""; + if (!$existed) + $widget="* Unknown value ($row[$i]) *"; + break; + case TEXTBOX: //text box + $widget=""; + break; + case LABEL: //label + if (!strcasecmp($attribute_name[$i], "adminstate")) + $adminstate = $row[$i]; + $widget=translate($row[$i],$lookup[$i]); + $widget.= "\n"; + break; + case RADIO_BUTTON: //radio button + $widget="" . + $row[$i] . "\n"; + break; + case CHECKBOX: //check box + $widget=""; + break; + case TEXTAREA: //text area + $tmpText=rawurldecode($row[$i]); + $widget=""; + //$str = "(MaxLength=36)"; + break; + + } + + if (strstr($saved,$attribute_name[$i]) != false) + $color="#D2F0FF"; + else + $color="#FFFFFF"; + + $widget_type = ""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      ParameterValue
      $display_name[$i]$widget_type$widget
      \n"; + } /* End of while() */ +} + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +//==================Add the Bsc reboot button on the buttom of the page============ +if($bscFlag=="Bsc") +{ + echo "
      "; +if ($act_display_type[$rebootButtonIndex] == CONFIRM_PUSH_BUTTON) + $need_confirm = "true"; + else + $need_confirm = "false"; + + if ($act_attribute_name[$rebootButtonIndex] == "Audit") + { + + echo ""; + echo " $nbsp  "; + + } + else if($act_attribute_name[$rebootButtonIndex] != "New_ALink1"&&$act_attribute_name[$rebootButtonIndex] != "Del_ALink1"&&$act_attribute_name[$rebootButtonIndex] != "Del_Bss_DB") + { + echo ""; + } + echo "
      "; +} +//================================================================================= +//echo "
      \n"; +?> + + + + diff --git a/wxc2_omc/element/mss/ACNview.php b/wxc2_omc/element/mss/ACNview.php new file mode 100755 index 0000000..43824e6 --- /dev/null +++ b/wxc2_omc/element/mss/ACNview.php @@ -0,0 +1,585 @@ + 0)?$TEST:0; + +//value Type +$nInteger = 2; +$nOctStr = 4; + +$nShowsize = '40%'; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.paramConf'; + return($tableName); +} + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + echo "
      Error in omcStrFill:the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +$sysConfTable = 'OMC_PUB.sysConf'; +$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:0); + +$pubDb ='OMC_PUB'; +$paramTable = 'param_99'; +$objDb = omcGetObjDb($sysTypeNo); +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf); +$maxLevelNum = 10; + +if($DEBUG) echo "
      $paramConfTable
      "; +if($DEBUG) echo "
      aliasName=$aliasName
      "; +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + +//=======================Get value From submit=================== + +if($set == 'Set') +{ + + //sort by offset + for($i=1;$i<=$unitNum;$i++) + { + $tmpDef = ${'unitDef_'.$i}; + $tmpValue = ${'unit_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$i] = $tmpDef; + $tmpDefArr = explode('-',$tmpDef); + $sortArr[$i] = $tmpDefArr[0]; + $valueArr[$i] = $tmpValue; + } + $lastValue = ''; + $k = 0; + asort($sortArr); + for(reset($sortArr); $key = key($sortArr); next($sortArr)) + { + if($DEBUG) echo "
      sortArr[$key] = {$sortArr[$key]}"; + if($DEBUG) echo "
      unitValue = {$valueArr[$key]}"; + $unitValue = $valueArr[$key]; + if($DEBUG) echo "
      defArr[$key] = {$defArr[$key]}"; + $unitDefArr = explode('-',$defArr[$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1) + { + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + }else{//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + }else{ + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + } + if($DEBUG) echo "
      lastValue = $lastValue "; + $setValue = $lastValue; + +{ + $objWhereStr =getLevelWhere($objIdStr); + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + +} + +echo ""; +exit(); +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +
      " > +setValue = $setValue ,inputName = $inputName"; +if($objIdStr != NULL){ + $objWhereStr =getLevelWhere($objIdStr); + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + {//get $setValue + $paramTable = 'param_99'; + + $paramSql = " SELECT initValue FROM $paramTable + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + +// echo "$paramSql"; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $setValue = $v_Row[0]; + } + +}else{ + echo "ERROR!!:oid == NULL"; + exit(); +} +/************************************** +*objName +*[unit]name[u]xx.xx-yy.yy[u]input[v]toDec-fillHigh-fillChar +*[unit]name[u]xx.xx-yy.yy[u]select[v]value1[opt]desc1[v]value2[opt]desc2 +*[remark] +***************************************/ + +//explode by '[remark]' +$remarkArr = explode('[remark]',$setTemplate); +$remark = $remarkArr[1]; + +//explode by '[unit]' +$unitArr = explode('[unit]',$remarkArr[0]); + +//show instance's name + +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "ACN  "; + +echo ""; +echo "

      $strBack"; +echo "

      "; + +//show every one unit +//--><-//$setValue = strrev($setValue); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +for($i=1;$i"; +}//end of for(..) + +//parmmeter alias +/* +echo ""; +*/ +echo "
      ParametersValue
      "; + //unit input name + $unitName = "unit_".$i; + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$i]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + //show Unit Name + echo "$tlvArr[0]"; + echo " "; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $operType = chop($valueArr[0]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) { + switch($defArr[2]){ + case '0': + $inputValue = str_replace('00','',$inputValue); + break; + case 'E': + $inputValue = str_replace('E','',$inputValue); + break; + default: break; + } + } + break; + default: break; + } + if($DEBUG) echo "
      $valueType == $nOctStr"; + if($valueType == $nOctStr){ + if($defArr[0] == 'toAscii'){ + $inputLen = $byteLen; + }elseif($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + $inputLen = $byteLen *2; + }else{ + $inputLen = $byteLen *3; + } + //echo ""; + echo ""; + }else{ + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + break; + case 'select': + if($valueType == $nOctStr){ + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + }else{ + $selectValue=$byteValue; + } + + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + if($DEBUG) echo "
      $valueType =?= $nOctStr(nOctStr)"; + //echo "";*/ + $isSelected = 0; + for($j=1;$jReserved Value";*/ + echo "Reserved Value"; + break; + }elseif($defArr[0] == $selectValue){ + /* echo "";*/ + echo "$defArr[1]"; + //echo "$defArr[0]"; + $isSelected = 1; + }/*else{ + // echo ""; + echo "$defArr[1]"; + $defArr[1]; + }*/ + } + + if($isSelected ==0 && $j == sizeof($valueArr)){ + echo ""; + } + echo ""; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + if($valueType == $nOctStr){ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'keepDec-high-0'; + } + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + echo "\n "; + echo "
      "; +echo "Alais:"; +echo ""; +echo "
      "; + +$unitNum = $i-1; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +//echo "\n"; + +$remark=nl2br($remark); +//echo "

      Remarks:
      $remark

      "; +echo "
      "; + +//=======================Test input field======================== +if($TEST){ + echo "
      "; + echo "
      "; + //--><--// $setValue = strrev($setValue); + echo "Test Area
      "; + echo "Test Value:   "; + echo ""; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "
      "; +} +?> + + \ No newline at end of file diff --git a/wxc2_omc/element/mss/announcement.php b/wxc2_omc/element/mss/announcement.php new file mode 100755 index 0000000..19bdd4c --- /dev/null +++ b/wxc2_omc/element/mss/announcement.php @@ -0,0 +1,263 @@ + + + + + + +"; + if(!$DEBUG){ + echo "\n window.location.href=\"$backurl\";"; + } + echo "\n "; + exit(); +} + +{ + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strConfiguration > Network > MSC > Announcement"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo "

      $strBack"; + echo "

      "; + echo "
      "; +} +?> + +'None',1=>'Tone',2=>'Voice',3=>'lease line'); + +echo ""; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + +echo ""; +for($r=0; $r< 8; $r++) +{ + echo ""; + for($c=0; $c<2; $c++) + { + $i=$c*8 + $r; + $annType = hexdec(getBitValue($announcementArr[$i],'0.0-0.7')); + $annMs0E1 = hexdec(getBitValue($announcementArr[$i],'1.0-1.7')); + $annMs1E1 = hexdec(getBitValue($announcementArr[$i],'2.0-2.7')); + $annSlot = hexdec(getBitValue($announcementArr[$i],'3.0-3.7')); + + echo ""; + echo ""; + + echo ""; +} + +echo ""; +echo "
      NoTypeMSC0 E1MSC1 E1Time SlotNoTypeMSC0 E1MSC1 E1Time Slot
      $i"; + echo ""; + if($annType==3) + echo ""; + + echo ""; + if($annType==3) + echo ""; + + echo ""; + if($annType==3) + echo ""; + } + echo "
       "; +echo ""; + +//System has up to 11 inline announcements and tones to fit different unattained reasons: + + +?> + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      Remarks: 
        
      Announcement 0: The number dialed is invalid.Announcement 6: Feature not available to caller.
      Announcement 1: The subscriber dialed is offline.Announcement 7: The subscriber dialed is not available.
      Announcement 2: The subscriber is busy.Announcement 8: Caller's line is stopped.
      Announcement 3: The network is busy.Announcement 9: Caller's balance is going to be used up.
      Announcement 4: Caller's account is deactivated.Announcement 10: The call is cut for account balance exhaust.
      Announcement 5: The subscriber dialed is deactivated.Announcement 15: Used for call hold.
        
      Announcement 11-14: Reserved. 
      + + + + + + + + + diff --git a/wxc2_omc/element/mss/auc.php b/wxc2_omc/element/mss/auc.php new file mode 100755 index 0000000..be5bd81 --- /dev/null +++ b/wxc2_omc/element/mss/auc.php @@ -0,0 +1,285 @@ +正在调试中!!"; +?> + + + +'2.2.3', 'sysid'=> '340_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.10', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), +); + +$NI_arr=array('International','International spare','National','National spare'); +$SaveArr=array( + array('oidstr'=>'2.2.2', 'setvalue'=>'01' ,'sysid'=>'340_99_99'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99') +); +$backurl = "./auc.php"; +//loading +if($load_flag == 1) +{ + echo "
      Loading"; + + GetParam($sysId_arr,1);//1 means return to overview if getting parameters fails. + + echo ""; +} + +{//set system ip + for($i=0; $i < 2; $i++) + { + $getsql = "SELECT ip FROM $sysinfo where sysTypeNo = $sysTypeNo and sysNo = '$i'"; + if($DEBUG) echo "getsql = $getsql
      "; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = strtoupper(omc_keep_length($mss_ip[0],'0','8')); + $mss_ip[1] = strtoupper(omc_keep_length($mss_ip[1],'0','8')); + if($DEBUG) + { + echo "
      mss0_ip = $mss_ip[0]
      "; + echo "mss1_ip = $mss_ip[1]
      "; + } + + $sysId = "223_99_99"; + //auc + $oidStr = "2.1.10"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); +}//end set system ip +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { +// echo "
      Getting parameters
      "; +// GetParam(0,1); + + echo "
      Setting parameters
      "; + SetParam($sysId_arr); + session_register("acSetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + echo ""; + //exit(); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } +// elseif(isset($undoSet)) +// { +// echo "
      Setting parameters
      "; +// SetParam(1); +// session_unregister("acSetFlag"); +// +// } + + echo ""; + exit(); +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; + +?> + +"; +echo ""; +echo ""; +echo "Configuration > Network > AUC"; +echo ""; +$helpId = '2.1.1.4'; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       "; + //echo "Authentication Center:  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +echo "
      "; +?> + + +indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } + + for($i = 0; $i < 4; $i ++) + { + $levelWhere = getLevelWhere($spcTree_array[$spc_index[$i]][3]); + + $getsql = "select initValue from $mtp3_sqlTable where $levelWhere"; + $result = mysqli_query($pubConn,$getsql); + $row[$i] = mysqli_fetch_array($result); + $row[$i] = hexdec($row[$i][0]); + if($DEBUG)echo "getsql = $getsql
      "; + if($DEBUG)echo "spc_$i=$row[$i]
      "; + } +} + +echo "" ; +echo ""; +echo ""; +echo ""; + +{//gtt + $sysId = "223_99_99"; + $oidStr = "2.1.10"; + $instanceNo=0; + echo "" ; + echo ""; +}//end gtt + +$getSql="SELECT detailStat FROM $sysStatTable WHERE sysTypeNo='340' ORDER BY sysNo,subSysNo"; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +$rows=mysqli_fetch_array($result); + +$max_lic=hexdec(substr($rows[0],62,8)); +$used_lic=hexdec(substr($rows[0],70,8)); + +$license_arr=array( + array('Subscriber', 'used_lic'), + array('License', 'max_lic') +); + +if($DEBUG) +{ + echo "
      Max = $max_lic
      "; + echo "Used = $used_lic
      "; +} + echo ""; + echo ""; + echo ""; + echo ""; +/* + {//license + echo "" ; + echo ""; + echo ""; + echo ""; + }//end license +*/ +//========================================================== +//输出Command +//========================================================== +/* +echo ""; +echo ""; +*/ +echo "
      Signaling point code"; +for($i=0; $i<4; $i++) + echo ""; +echo "
      {$spcTree_array[$i][0]} : {$spcTree_array[$spc_index[$i]][1]} : $row[$i]
      $strE164Number"; + echo ""; + + echo ""; + echo "
      "; + showParameter($sysId,$oidStr,2,1); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      {$license_arr[0][0]} ${$license_arr[0][1]}
      License control "; + $sysId = '340_99_99'; + $oidStr = "2.2.3"; + showParameter($sysId,$oidStr,1,1,0,'','','Update'); + echo "
      Command"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      AC0LockAC1Lock
      "; +?> + +"; +?> diff --git a/wxc2_omc/element/mss/check8kCardSignalSlot.php b/wxc2_omc/element/mss/check8kCardSignalSlot.php new file mode 100755 index 0000000..7677d52 --- /dev/null +++ b/wxc2_omc/element/mss/check8kCardSignalSlot.php @@ -0,0 +1,25 @@ + \ No newline at end of file diff --git a/wxc2_omc/element/mss/clock.php b/wxc2_omc/element/mss/clock.php new file mode 100755 index 0000000..97ad17c --- /dev/null +++ b/wxc2_omc/element/mss/clock.php @@ -0,0 +1,505 @@ +"; + +/* +if($clock==1) + echo "This is clock
      "; +if($signal==1) + echo "This is signal
      "; +*/ + +$helpId = ""; +$DEBUG = 0; +$leftWidth = '20%'; +$pubDb = 'OMC_PUB'; +$sysInfoTab = 'sysInfo'; +$nSetComm = 3; +//echo "
      cardNo:$cardNo"; +if(!isset($cardNo)) +{ + $selSql = "select sysNo,subSysNo from $sysInfoTab where sysTypeNo='111' order by sysNo,subSysNo"; + $Result = mysqli_query($pubConn,$selSql); + if($Rows = mysqli_fetch_array($Result)) + $cardNo=$Rows[sysNo].'-'.$Rows[subSysNo]; +} + +$temp=trim($sysNo_slot); +if(strlen($temp)==0) + $sysNo_slot=0; +if(!isset($sysNo_slot)) + $sysNo_slot=0; + +$tmpArr = explode('-',$cardNo); +$sysNo_slot = $tmpArr[0]; +$subSysNo_slot = $tmpArr[1]; + +$k8e1Table = 'param_' . $sysNo_slot; +$k8e1Db = "OBJ_111"; +$pubSysId = '111_' . $sysNo_slot . '_99'; +$subSysId = '111_' . $sysNo_slot . '_'.$subSysNo_slot; +?> + + + +cardNo:$cardNo"; + +{//get all sysNo. + $selSql = "select sysNo,subSysNo from $sysInfoTab where sysTypeNo='111' order by sysNo,subSysNo"; + $Result = mysqli_query($pubConn,$selSql); + $sysNo = -1; + $i = 0; + while($Rows = mysqli_fetch_array($Result)) + { + if($sysNo==$Rows[sysNo]) + continue; + $sysNo = $Rows[sysNo]; + $sysNoArr[$i] = $sysNo; + $sysId = '111_' . $sysNo . '_99'; + //$sysId_arr[$i] = array($sysId, array('2.5'), '8ke1'); + $sysId_arr[$i] = array('oid'=>'2.5','sysid'=>$sysId, 'selectsysid'=>'-1'); + $i++; + } + + //$sysId_arr[$i] = array($pubSysId,array('2.10.2'),'8ke1',$subSysId); + //echo "pubSysId:$pubSysId---subSysId:$subSysId
      "; + $sysId_arr[$i] = array('oid'=>'2.10.2','sysid'=>$pubSysId, 'selectsysid'=>'-1'); + + +}//end + +?> + + + +Setting parameters
      "; + $sysId_arr[$i] = array('oid'=>'2.10.2','sysid'=>$pubSysId, 'selectsysid'=>'-1'); + + //print_r($sysId_arr); + + SetParam($sysId_arr); + //echo "$resetCard
      "; + + + //exit; + session_register("SetFlag"); + $showType="Set"; + + + if(isset($resetCard)) + { + + echo "
      Reseting CSU$sysNo-Card $subSysNo_slot ..."; + //echo "

      $subSysId"; + + $SaveArr=array( + array('oidstr'=>'3.1', 'setvalue'=>'5A' ,'sysid'=> $subSysId) + ); + + /* + $SaveArr=array( + array('oidstr'=>'3.1', 'setvalue'=>'5A' ,'sysid'=> '111_0_99'), + array('oidstr'=>'3.1', 'setvalue'=>'5A' ,'sysid'=> '111_1_99'), + ); + */ + //print_r($SaveArr); + SaveParam($SaveArr); + } + } + else + { + + $database="OMC_PUB"; + $sql="select detailStat from sysStat where sysTypeNo=111 and sysNo=0 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + $plat0_have=1; + else + $plat0_have=0; + + $database="OMC_PUB"; + $sql="select detailStat from sysStat where sysTypeNo=111 and sysNo=1 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + $plat1_have=1; + else + $plat1_have=0; + if($plat1_have==1&&$plat0_have==1) + { + $sysId_arr_get = array( + array('oid'=>'2.5','sysid'=>'111_0_99', 'selectsysid'=>'-1'), + array('oid'=>'2.10.2','sysid'=>'111_0_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5','sysid'=>'111_1_99', 'selectsysid'=>'-1'), + array('oid'=>'2.10.2','sysid'=>'111_1_99', 'selectsysid'=>'-1') + ); + } + if($plat1_have==1&&$plat0_have==0) + { + $sysId_arr_get = array( + array('oid'=>'2.5','sysid'=>'111_1_99', 'selectsysid'=>'-1'), + array('oid'=>'2.10.2','sysid'=>'111_1_99', 'selectsysid'=>'-1') + ); + } + + if($plat1_have==0&&$plat0_have==1) + { + $sysId_arr_get = array( + array('oid'=>'2.5','sysid'=>'111_0_99', 'selectsysid'=>'-1'), + array('oid'=>'2.10.2','sysid'=>'111_0_99', 'selectsysid'=>'-1') + ); + } + if($plat1_have==0&&$plat0_have==0) + { + $sysId_arr_get = array( + array('oid'=>'2.5','sysid'=>'111_0_99', 'selectsysid'=>'-1'), + array('oid'=>'2.10.2','sysid'=>'111_0_99', 'selectsysid'=>'-1') + ); + } + + echo "
      Getting parameters
      "; + session_register("GetFlag"); + //echo "
      Get"; + //print_r($sysId_arr_get); + GetParam($sysId_arr_get); + $showType="Get"; + } + } + echo ""; + exit(); +} +if($clock==1) + echo ""; +else + echo ""; +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strConfiguration > Network > MSC > "; + if($clock==1) + echo "Clock"; + else + echo "Signaling Channel"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + //WXC2-MSC + if($clock==1) + echo ""; + echo ""; + echo ""; + echo "   "; + echo ""; + echo "$strBack"; + echo "
      "; + echo "
      "; + +} +?> + +"; +else + echo ""; + +{//DPLL + $disabled0 = $disabled1 = 'disabled'; + for($i=0; $i< sizeof($sysNoArr); $i++) + { + $sysNo = $sysNoArr[$i]; + if($sysNo==0) + $disabled0 = ''; + if($sysNo==1) + $disabled1 = ''; + $tmpTable = 'param_' . $sysNo; + $levelWhere = getLevelWhere('2.5'); + $selSql = "select instanceNo,initValue from $tmpTable where $levelWhere and (instanceNo='0' or instanceNo='1')"; + $Result = mysqli_query($pubConn,$selSql); + while($Rows = mysqli_fetch_array($Result)) + { + $name = "csu".$sysNo."_card".$Rows[instanceNo]; + $$name = hexdec($Rows[initValue]); + } + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; +}//END DPLL +echo "
      PriorityCSU0CSU1
      Primary"; + echo ""; + echo ""; + echo ""; + echo "
      Secondary"; + echo ""; + echo ""; + echo ""; + echo "
      "; + + + + +echo ""; + +{ + $selSql = "select initValue from $k8e1Table + where level_1='2' and level_2='10' and level_3='2' and instanceNo='$subSysNo_slot' "; + + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + + + $sigSlot = hexdec($row[initValue]); +if($signal==1) +{ + echo ""; + echo ""; +} +else + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      CardParameterValue
      "; + {//select a 8ke1 card. + $selSql = "select sysNo,subSysNo from $sysInfoTab where sysTypeNo='111' order by sysNo,subSysNo"; + $Result = mysqli_query($pubConn,$selSql); + + echo ""; + }//end select + echo "Signaling Time Slot"; + echo ""; + + echo "   "; + echo "Reset 8kE1/T1 Card."; + echo ""; + echo "
      "; +} +?> + +
      + diff --git a/wxc2_omc/element/mss/convert_overview.php b/wxc2_omc/element/mss/convert_overview.php new file mode 100755 index 0000000..bbf0a43 --- /dev/null +++ b/wxc2_omc/element/mss/convert_overview.php @@ -0,0 +1,270 @@ + +"; +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > Convert overview"; +echo ""; +//showHelp($helpId); +echo ""; +echo "

      $strBack"; +echo "

      "; + +echo "
      "; +//echo "Convert overview:
      "; + + + //===============================get the default value of Prefix manipulation============================== + $database="OBJ_225"; + $sql="select initValue from paramConf where level_1=2 and level_2=8 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $default_initValue=$rows[initValue]; + //echo "default_initValue:$default_initValue
      "; + //================================data init=================================================== + for($i=0;$i<128;$i++) + { + $prefix_show[$i]=0; + $prefix_prefix[$i]=0; + } + //===============================get the data from OBJ_225 param_99=========================== + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=8 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + do + { + //====instance No + $instanceNo=$rows[instanceNo]; + $initValue=$rows[initValue]; + //====show or no + if($initValue!=$default_initValue) + $prefix_show[$instanceNo]=1; + //====prefix + $prefix_prefix[$instanceNo]=getBitValue($rows[initValue],'0.0-15.7'); + //echo "prefix:{$prefix_prefix[$i]}
      "; + //=====Deletion Count + $prefix_deletion_count[$instanceNo]=hexdec(getBitValue($rows[initValue],'16.0-16.7')); + //======Insertion Count + $prefix_insertion_count[$instanceNo]=hexdec(getBitValue($rows[initValue],'17.0-17.7')); + //======Inserted Digits + $prefix_inserted_digits[$instanceNo]=getBitValue($rows[initValue],'18.0-33.7'); + //=======Number Length + $prefix_number_length[$instanceNo]=hexdec(getBitValue($rows[initValue],'34.0-34.7')); + //======Name + $prefix_name[$instanceNo]=getBitValue($rows[initValue],'35.0-42.7'); + + + //echo "instanceNo:$instanceNo----initValue:$initValue
      "; + }while($rows=mysqli_fetch_array($result)); + + + //==================format the data======================== + + for($i=0;$i<128;$i++) + { + + //=======prefix + $temp=""; + for($num=0;$num<16;$num++) + { + $str=substr($prefix_prefix[$i],$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $prefix_prefix[$i]=$temp; + //======Inserted Digits + $temp=""; + for($num=0;$num<16;$num++) + { + $str=substr($prefix_inserted_digits[$i],$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $prefix_inserted_digits[$i]=$temp; + + + //======Name + $temp=""; + for($num=0;$num<8;$num++) + { + $str=substr($prefix_name[$i],$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $prefix_name[$i]=$temp; + + } + + //====================test====================== + /* + for($i=0;$i<128;$i++) + { + echo "
      "; + echo "instanceNo:$i
      "; + echo "prefix_show:{$prefix_show[$i]}
      "; + echo "prefix:{$prefix_prefix[$i]}
      "; + echo "deletion_count:{$prefix_deletion_count[$i]}
      "; + echo "insertion_count:{$prefix_insertion_count[$i]}
      "; + echo "inserted_digits:{$prefix_inserted_digits[$i]}
      "; + echo "number_length:{$prefix_number_length[$i]}
      "; + echo "name:{$prefix_name[$i]}
      "; + echo "
      "; + } + */ + + //===============================sort by the name================================ + //echo "sort_flag:$name_sort_flag
      "; + if($name_sort_flag==1) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + arsort($prefix_name,SORT_STRING); + + foreach($prefix_name as $key => $value) + { + if($prefix_show[$key]==0) + echo ""; + else + echo ""; + + + $tmp=trim($prefix_prefix[$key]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_deletion_count[$key]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_insertion_count[$key]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_inserted_digits[$key]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_number_length[$key]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_name[$key]); + if($tmp=="") + echo ""; + else + echo ""; + + /* + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + */ + echo ""; + + } + + + + + } + else + { + //===========================show the table================================ + echo "
      No.PrefixDeletion CountInsertion CountInserted DigitsNumber LengthName"; + echo "
      --$tmp--$tmp--$tmp--$tmp--$tmp--$tmp$key $prefix_prefix[$key] $prefix_deletion_count[$key] $prefix_insertion_count[$key] $prefix_inserted_digits[$key] $prefix_number_length[$key] $prefix_name[$key]
      "; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<128;$i++) + { + if($prefix_show[$i]==0) + echo ""; + else + echo ""; + + echo ""; + + $tmp=trim($prefix_prefix[$i]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_deletion_count[$i]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_insertion_count[$i]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_inserted_digits[$i]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_number_length[$i]); + if($tmp=="") + echo ""; + else + echo ""; + + $tmp=trim($prefix_name[$i]); + if($tmp=="") + echo ""; + else + echo ""; + + + /* + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + */ + echo ""; + } + echo "
      No.PrefixDeletion CountInsertion CountInserted DigitsNumber LengthName"; + echo "
      $i--$tmp--$tmp--$tmp--$tmp--$tmp--$tmp $prefix_prefix[$i] $prefix_deletion_count[$i] $prefix_insertion_count[$i] $prefix_inserted_digits[$i] $prefix_number_length[$i] $prefix_name[$i]
      "; + } + +echo "
      "; +?> diff --git a/wxc2_omc/element/mss/csrr.php b/wxc2_omc/element/mss/csrr.php new file mode 100755 index 0000000..54b1351 --- /dev/null +++ b/wxc2_omc/element/mss/csrr.php @@ -0,0 +1,174 @@ +正在调试中!!"; +?> + + + + +"; +$csrr_array = array( + array('Not allowed','0'), + array('Allowed','1') + ); + +$getsql = "select initValue from $sqltable +where level_1 = '2' and level_2 = '1' and level_3 = '13' and instanceNo ='$instanceNo' "; +$result = @mysqli_query($pubConn,$getsql); +$row = @mysqli_fetch_array($result); +echo mysqli_error($pubConn); + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if($DEBUG) echo "csrr = $csrr
      "; + $initValue = omc_keep_length($initValue,'0','64','0'); + $k = 255; + for($i=0; $i < 32; $i++) + { + for($j=7; $j >= 0; $j--) + { + if(isset(${'no'.$k})) ${'no'.$k} = 1; + else ${'no'.$k} = 0; + //echo "$k=${$k}
      "; + $loc = $i.'.'.$j; + $initValue = setBitValue($initValue,$loc,${'no'.$k}); + $k--; + } + } + if($DEBUG) echo "instanceNo = $instanceNo
      "; + if($DEBUG) echo "initValue = $initValue
      "; + $setsql = "update $sqltable set initValue = '$initValue' + where level_1 = '2' and level_2 = '1' and level_3 = '13' and instanceNo = '$instanceNo'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + echo ""; +} + + +$k=255; +for($i = 0;$i < 32; $i++) +{ + for($j=7; $j>=0; $j--) + { + $loc = $i.'.'.$j; + $csrr[$k] = getBitValue($row[0],$loc); + $k--; + } +} + +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +//echo "Configuration > Network > Element > MSC > HLR CSRR"; +echo "$strConfiguration > Network > HLR > CSRR"; +echo ""; +//showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "CSRR Type $instanceNo list:  "; +echo ""; +echo ""; +echo "    "; +echo ""; +echo "

      $strBack"; +echo "

      "; +?> + + + + +"; +for($i=0; $i< 4; $i++) +{ + $start = $i*64; + $end = $start + 64; + echo ""; + echo ""; +} +echo ""; +for($i=0; $i< 64; $i++) +{ + echo ""; + for($j=0; $j< 4; $j++) + { + $no = $j * 64 + $i; + echo ""; + echo ""; + } + echo ""; +} + +echo ""; +echo ""; + +echo "
      VPLMN roamingAllowed"; + $checkedStr = 'checked'; + for($j=$start; $j< $end; $j++) + { + if(1 != $csrr[$j]) + { + $checkedStr = ''; + break; + } + } + echo ""; + echo "
      VPLMN $no"; + if (1 == $csrr[$no]) + echo ""; + else + echo ""; + echo "$no
      "; + +?> + +"; +?> diff --git a/wxc2_omc/element/mss/e1_overview.php b/wxc2_omc/element/mss/e1_overview.php new file mode 100755 index 0000000..8a5f143 --- /dev/null +++ b/wxc2_omc/element/mss/e1_overview.php @@ -0,0 +1,407 @@ + + +tmpSql=$tmpSql"; + $tmpResult =mysqli_query($pubConn,$tmpSql); + echo mysqli_error($pubConn); + if(mysqli_num_rows($tmpResult)>0) + { + $tmpRows =mysqli_fetch_array($tmpResult); + $title = toAscii(getBitValue($tmpRows[0],"7.0-16.7")); + } + else + $title = "--"; + + return $title; +}//end getTitleByTg + +$sysTypeNo_0 = "111"; +if($thisOmcType==10){ + $sysTypeNo_1 = "251"; +}else{ + $sysTypeNo_1 = "322"; +} + +$db_0 = "OBJ_".$sysTypeNo_0; +$db_1 = "OBJ_".$sysTypeNo_1; + +$tb_0 = "param_0"; +$tb_1 = "param_1"; +$tb_2 = "param_99"; + +$maxNum = 30; + +$nPubFlag = 99; +$nSubSysParam = 0; +$nGlobalSubSysParam = 1; +$nGlobalSysParam = 2; + +$nGetComm = 0; +$nSetComm = 3; + +$nInteger = 2; +$nOctStr = 4; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +//E1 flag +$oidFlag = "2.1"; +$pE1 = explode(".",$oidFlag); +$i = 0; +$wFlag = ''; +while(isset($pE1[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pE1[$i]=$pE1[$i]"; + $wFlag = $wFlag." AND level_$lNum = $pE1[$i] "; + $i++; +} + + +//2.6 CRC4 flag +$oidCrc = "2.6"; +$pE1 = explode(".",$oidCrc); +$i = 0; +$wCrc = ''; +while(isset($pE1[$i])) { + $lNum = $i+1; + if($DEBUG)echo "
      pE1[$i]=$pE1[$i]"; + $wCrc = $wCrc." AND level_$lNum = $pE1[$i] "; + $i++; +} + +//2.2 E1 MTP2 alarm flag +$oidDlink = "2.2"; +$pE1 = explode(".",$oidDlink); +$i = 0; +$wDlink = ''; +while(isset($pE1[$i])) +{ + $lNum = $i+1; + if($DEBUG)echo "
      pE1[$i]=$pE1[$i]"; + $wDlink = $wDlink." AND level_$lNum = $pE1[$i] "; + $i++; +} + +//2.4.1 2.4.2 2.4.3 MSC +$uwMsc = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND (level_3 = '1' OR level_3 = '2' OR level_3 = '3') "; + + +$wMsc = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND (level_3 = '1' OR level_3 = '2' OR level_3 = '3') ORDER BY level_3 "; + +$wMsc_1 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '1' AND instanceNo = '$pNum' "; + +$wMsc_2 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '2' AND instanceNo = '$pNum' "; + +$wMsc_3 = " WHERE subSysNo = '99' AND level_1 = '2' AND level_2 = '4' AND level_3 = '3' AND instanceNo = '$pNum' "; + +$eFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'T', 'color' => '#0000FF') + +); + +$eCrcArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') +); + +$eDlinkArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$mPtArr=array( + array('num' => '0', 'remark' => 'TUP', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'ISUP', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'AIF', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'ISDN NT', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'ISDN LT', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'CIC CNF', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'CIC INT', 'color' => '#0000FF') +); + + + +/**************select used E1 card*******************/ +$getSql = " SELECT sysNo,subSysNo,baseStat,updateTime + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo_0' AND updateTime > '0' + ORDER BY sysNo,subSysNo + "; +//echo "
      getSql=$getSql"; +$getRes = @mysqli_query($pubConn,$getSql); +$getRow = @mysqli_fetch_array($getRes); +echo mysqli_error($pubConn); +do +{ + $sysNo = $getRow[sysNo]; + $subSysNo = $getRow[subSysNo]; + $isUpdate[$sysNo][$subSysNo] = $getRow[updateTime] > 0 ? 1:0; +}while($getRow = @mysqli_fetch_array($getRes)); + +$isUpdate[0][0]="1"; + + +/************select value to see************/ +//E1 flag +for($i=0;$i<2;$i++) +{ + $temTb = ${tb_.$i}; + $flagSql = " SELECT instanceNo,initValue,readValue FROM $temTb WHERE subSysNo >= 0 ".$wFlag." ORDER BY instanceNo "; + if($DEBUG) echo "
      flagSql=$flagSql"; + $flagRes = @mysqli_query($pubConn,$flagSql); + $flagRow = @mysqli_fetch_array($flagRes); + echo mysqli_error($pubConn); + do + { + $instanceNo = $flagRow[instanceNo]; + $initValue = HexDec($flagRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG) echo "
      initValue=$initValue"; + for($j=0;$j<8;$j++) + { + $fNum = $instanceNo*8+7-$j; + $flagArr[$i][$fNum] = substr($initValue,$j,1); + if($DEBUG) echo "
      flagArr[$i][$fNum]={$flagArr[$i][$fNum]}"; + } + }while($flagRow = @mysqli_fetch_array($flagRes)); +} + +//2.6 CRC4 flag +for($i=0;$i<2;$i++) +{ + $temTb = ${tb_.$i}; + $crcSql = " SELECT instanceNo,initValue,readValue FROM $temTb WHERE subSysNo >= 0 ".$wCrc." ORDER BY instanceNo "; + if($DEBUG)echo "
      crcSql=$crcSql"; + $crcRes = @mysqli_query($pubConn,$crcSql); + $crcRow = @mysqli_fetch_array($crcRes); + if($DEBUG)echo mysqli_error($pubConn); + do + { + $instanceNo = $crcRow[instanceNo]; + $initValue = HexDec($crcRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG)echo "
      initValue=$initValue"; + for($j=0;$j<8;$j++) + { + $fNum = $instanceNo*8+7-$j; + $crcArr[$i][$fNum] = substr($initValue,$j,1); + if($DEBUG)echo "
      crcArr[$i][$fNum]={$crcArr[$i][$fNum]}"; + } + }while($crcRow = @mysqli_fetch_array($crcRes)); +} + +//2.2 E1 MTP2 alarm flag +for($i=0;$i<2;$i++) +{ + $temTb = ${tb_.$i}; + $dlinkSql = " SELECT instanceNo,initValue,readValue FROM $temTb WHERE subSysNo >= 0 ".$wDlink." ORDER BY instanceNo "; + if($DEBUG)echo "
      dlinkSql=$dlinkSql"; + $dlinkRes = @mysqli_query($pubConn,$dlinkSql); + $dlinkRow = @mysqli_fetch_array($dlinkRes); + echo mysqli_error($pubConn); + do{ + $instanceNo = $dlinkRow[instanceNo]; + $initValue = HexDec($dlinkRow[initValue]); + $initValue = DecBin($initValue); + $initValue = omc_keep_length($initValue,0,8); + if($DEBUG)echo "
      initValue=$initValue"; + for($j=0;$j<8;$j++) + { + $fNum = $instanceNo*8+7-$j; + $dlinkArr[$i][$fNum] = substr($initValue,$j,1); + if($DEBUG)echo "
      dlinkArr[$i][$fNum]={$dlinkArr[$i][$fNum]}"; + } + }while($dlinkRow = @mysqli_fetch_array($dlinkRes)); +} + + +//2.4.1 2.4.2 2.4.3 MSC +$mscSql = " SELECT level_3,instanceNo,initValue,readValue FROM $tb_2 ".$wMsc; +if($DEBUG) + echo "
      mscSql=$mscSql
      db_1=$db_1"; +$mscRes = @mysqli_query($pubConn,$mscSql); +$mscRow = @mysqli_fetch_array($mscRes); +echo mysqli_error($pubConn); + +do { + $level_3 = $mscRow[level_3]; + $instanceNo = $mscRow[instanceNo]; + $initValue = HexDec($mscRow[initValue]); + $mscArr[$level_3][$instanceNo] = $initValue; + if($DEBUG) echo "
      mscArr[$level_3][$instanceNo]={$mscArr[$level_3][$instanceNo]}"; +}while($mscRow = @mysqli_fetch_array($mscRes)); + + +if($comSys || $comDisk) { + for($i=0;$i<128;$i++) { + if($flagArr[0][$i] != $flagArr[1][$i]) + $flagCol[$i]="#FF0000"; + + if($mscArr[3][$i] != $mscArr[3][$i+128]) + $mscCol[3][$i]="#FF0000"; + + if($mscArr[2][$i] != $mscArr[2][$i+128]) + $mscCol[2][$i]="#FF0000"; + + if($mscArr[1][$i] != $mscArr[1][$i+128]) + $mscCol[1][$i]="#FF0000"; + + if($crcArr[0][$i] != $crcArr[1][$i]) + $crcCol[$i]="#FF0000"; + + if($dlinkArr[0][$i] != $dlinkArr[1][$i]) + $dlinkCol[$i]="#FF0000"; + } +}//end of $comDisk +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > E1 overview"; +echo ""; +//showHelp($helpId); +echo ""; +echo "

      $strBack"; +echo "

      "; + +echo "
      "; +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0) + echo ""; + else + echo ""; + + echo ""; + if($flagArr[0][$i]){ + $title = getTitleByTg($mscArr[2][$i]); + echo ""; + } + else + echo ""; + echo ""; + echo ""; + if($flagArr[0][$i]){ + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + if($flagArr[1][$i]){ + $title = getTitleByTg($mscArr[2][$i+128]); + echo ""; + } + else + echo ""; + echo ""; + echo ""; + if($flagArr[1][$i]){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //echo ""; + echo ""; +} +echo "
       MSC-0MSC-1
      SlotTitlePortFlagCICTGProtocolCRC4AlarmTitlePortFlagCICTGProtocolCRC4Alarm
      $sNum$title--$pNum{$eFlagArr[$flagArr[0][$i]][remark]}{$mscArr[3][$i]}{$mscArr[2][$i]}{$mPtArr[$mscArr[1][$i]][remark]} {$eCrcArr[$crcArr[0][$i]][remark]}{$eDlinkArr[$dlinkArr[0][$i]][remark]}----------$title--$pNum{$eFlagArr[$flagArr[1][$i]][remark]}{$mscArr[3][$i+128]}{$mscArr[2][$i+128]}{$mPtArr[$mscArr[1][$i+128]][remark]} {$eCrcArr[$crcArr[1][$i]][remark]}{$eDlinkArr[$dlinkArr[1][$i]][remark]}----------
      "; +echo ""; +echo "
      "; +?> + + diff --git a/wxc2_omc/element/mss/eir.php b/wxc2_omc/element/mss/eir.php new file mode 100755 index 0000000..bcd9278 --- /dev/null +++ b/wxc2_omc/element/mss/eir.php @@ -0,0 +1,513 @@ +正在调试中!!"; + +//************ +$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +?> + + + +"; + //===============delete the local prefix by instanceNo========== + $database="OMC_PUB"; + $setsql = "update OBJ_380.param_99 set initValue='$white_list_number_default_value' where level_1=2 and level_2=1 and level_3=2 and instanceNo={$white_list_number_instanceNo_tmp[$i]} "; + if($DEBUG) + echo "setsql=$setsql
      "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + + + echo "\n\n"; +} + +$sysId = '380_99_99'; + +$sqltable_sccp = 'OBJ_223.param_99'; +$sysStatTable='OMC_PUB.sysStat'; +$sqltable = 'OBJ_380.param_99'; +$pubDb = 'OMC_PUB'; +$sysinfo = 'OMC_PUB.sysInfo'; +$sysTypeNo = '322'; + +$mtp3_sqlTable = 'OBJ_222.param_99'; + +$sysId_arr = array( + //array('222_99_99',array('2.2','2.3'),'mtp3'), + //array('223_99_99',array("2.1.9"),'sccp'), + array('oid'=>'2.1.9','sysid'=>'223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2','sysid'=>'380_99_99', 'selectsysid'=>'-1') +); +$NI_arr=array('International','International spare','National','National spare'); +$SaveArr=array( + //array('oidstr'=>'2.2.2', 'setvalue'=>'01' ,'sysid'=>'380_99_99'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99') +); +$backurl = "./eir.php"; +//loading +if($load_flag == 1) +{ + echo "
      Loading"; + + GetParam($sysId_arr,1);//1 means return to overview if getting parameters fails. + + echo ""; +} + +if(isset($doingOtherFlag)) +{ + {//get system ip + for($i=0; $i < 2; $i++) + { + $getsql = "SELECT ip FROM $sysinfo where sysTypeNo = $sysTypeNo and sysNo = '$i'"; + if($DEBUG) echo "getsql = $getsql
      "; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = strtoupper(omc_keep_length($mss_ip[0],'0','8')); + $mss_ip[1] = strtoupper(omc_keep_length($mss_ip[1],'0','8')); + + $sysId = "223_99_99"; + }//end get system ip + + if($setEirGtt==1) + { + //scf_map + $oidStr = "2.1.9"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + + exit; +} +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { +// echo "
      Getting parameters
      "; +// GetParam(0,1); + + echo "
      Setting parameters
      "; + SetParam($sysId_arr); + session_register("acSetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + echo ""; + //exit(); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } + + echo ""; + exit(); +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; + +?> + +"; +echo ""; +echo ""; +echo "Configuration > Network > EIR"; +echo ""; +$helpId = '2.1.1.7'; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       "; + //echo "Equipment Identity Register:  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +?> + + +indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } + + for($i = 0; $i < 4; $i ++) + { + $levelWhere = getLevelWhere($spcTree_array[$spc_index[$i]][3]); + + $getsql = "select initValue from $mtp3_sqlTable where $levelWhere"; + $result = mysqli_query($pubConn,$getsql); + $row[$i] = mysqli_fetch_array($result); + $row[$i] = hexdec($row[$i][0]); + if($DEBUG)echo "getsql = $getsql
      "; + if($DEBUG)echo "spc_$i=$row[$i]
      "; + } +} + +echo "" ; +echo ""; +echo ""; +echo ""; + +{//gtt + echo ""; + echo ""; +}//end gtt + +/* +{//license + echo "" ; + echo ""; + echo ""; + echo ""; +}//end license +*/ + +//==================white list numbers=================== +{ + //===========get the default value== + $database="OBJ_380"; + $sql="select initValue from paramConf where level_1=2 and level_2=1 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $white_list_number_default_value=$rows[initValue]; + + //====set every record to the default value============ + /* + $updSql = "UPDATE param_99 SET initValue = '$white_list_number_default_value' + WHERE level_1=2 and level_2=1 and level_3=2 + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + */ + //=================================================== + + //===================get the count of white list numbers======================== + $database="OBJ_380"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $white_list_number_count=0; + + do{ + + $initValue_tmp=$rows[initValue]; + if(strcmp($initValue_tmp,$white_list_number_default_value)!=0) + { + $white_list_number_instanceNo[$white_list_number_count]=$rows[instanceNo]; + $start_type[$white_list_number_count]=getBitValue($rows[initValue],'0.0-2.7'); + $end_type[$white_list_number_count]=getBitValue($rows[initValue],'8.0-10.7'); + $start_final[$white_list_number_count]=getBitValue($rows[initValue],'3.0-3.7'); + $end_final[$white_list_number_count]=getBitValue($rows[initValue],'11.0-11.7'); + $start_serial[$white_list_number_count]=getBitValue($rows[initValue],'4.0-6.7'); + $end_serial[$white_list_number_count]=getBitValue($rows[initValue],'12.0-14.7'); + $start_software[$white_list_number_count]=getBitValue($rows[initValue],'7.0-7.7'); + $end_software[$white_list_number_count]=getBitValue($rows[initValue],'15.0-15.7'); + + $white_list_number_count++; + + } + + }while($rows=mysqli_fetch_array($result)); + + //====================get the unused instanceNo of local prefix==== + $database="OBJ_380"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + do{ + + $initValue_tmp=$rows[initValue]; + if(strcmp($initValue_tmp,$white_list_number_default_value)==0) + { + $unused_white_list_number_instanceNo=$rows[instanceNo]; + break; + } + }while($rows=mysqli_fetch_array($result)); + + + //=======show the white list number + + + echo ""; + echo ""; + echo ""; + +} + + + +echo "
      Signaling point code"; +for($i=0; $i<4; $i++) + echo ""; +echo "
      {$spcTree_array[$i][0]} : {$spcTree_array[$spc_index[$i]][1]} : $row[$i]
      $strE164Number"; + $sysId = "223_99_99"; + $oidStr = "2.1.9"; + $instanceNo=0; + echo ""; + echo ""; + echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setEirGtt=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      License control "; + $sysIdd = '380_99_99'; + $oidStrr = "2.2.4"; + //showParameter($sysIdd,$oidStrr,1,1,0,'','','Update'); + showParameter($sysIdd,$oidStrr,1,1,0,'','','Update'); + echo "
      White List Number        "; + echo "+"; + echo ""; + echo ""; + if($white_list_number_count==0) + { + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + } + if($white_list_number_count==0) + { + echo ""; + } + else + { + for($i=0;$i<$white_list_number_count;$i++) + { + if($i>3) + echo ""; + else + echo ""; + //=====white list number instanceNo=== + echo ""; + //=====start type ============= + echo ""; + //=====end type ============= + echo ""; + //======delete select box========= + echo ""; + echo ""; + } + //======more and hide button================ + if($white_list_number_count>4) + { + echo ""; + echo ""; + + } + + } + echo "
      No.Start IMEI Type Approval CodeStart IMEI Final Assembly CodeDelete"; + echo "
      No.Start IMEI Type Approval CodeEnd IMEI Type Approval CodeDelete"; + echo "
      --
      {$white_list_number_instanceNo[$i]}{$start_type[$i]}{$end_type[$i]}
      More >>
      Hide >>
      "; + echo "
      "; + + +?> + +"; +?> diff --git a/wxc2_omc/element/mss/gttEdit.php b/wxc2_omc/element/mss/gttEdit.php new file mode 100755 index 0000000..d5224ee --- /dev/null +++ b/wxc2_omc/element/mss/gttEdit.php @@ -0,0 +1,451 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== + +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; + + +$pubDb = 'OMC_PUB'; +$numberPerPage = 100; //每页纪录数 +$paramTable ='OBJ_223.param_99'; + +$nEnable = '01'; + +$sysId ='223_99_99'; +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + +//echo "sub_page_top:$sub_page_top
      "; + +$objDb = 'OBJ_'.$sysTypeNo; +if(1) +{//get ni & dpc + {//get dpcRow + $spcTree_array = array( + array('INT', '14-bit', 'spc_int_14', '2.3.1'), + array('INT-S', '14-bit', 'spc_int_sp_14', '2.3.2'), + array('NAT', '14-bit', 'spc_nat_14', '2.3.3'), + array('NAT-S', '14-bit', 'spc_nat_sp_14', '2.3.4'), + array('International', '24-bit', 'spc_int_24', '2.3.5'), + array('International spare', '24-bit', 'spc_int_sp_24', '2.3.6'), + array('National', '24-bit', 'spc_nat_24', '2.3.7'), + array('National spare', '24-bit', 'spc_nat_sp_24', '2.3.8') + ); + $sqltable_spc = 'OBJ_222.param_99'; + $querysql = "select initValue from $sqltable_spc where level_1 = '2' and level_2 = '2' and level_3 = '0'"; + $result = mysqli_query($pubConn,$querysql); + $indicator = mysqli_fetch_array($result); + echo mysqli_error($pubConn); + if ($DEBUG )echo "
      indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $tmpflag = getBitValue($indicator[0],"0.$i"); + if ($tmpflag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } + + for($i = 0; $i < 4; $i ++) + { + $levelWhere = getLevelWhere($spcTree_array[$spc_index[$i]][3]); + $getsql = "select initValue from $sqltable_spc where $levelWhere "; + $result = mysqli_query($pubConn,$getsql); + $dpcRow[$i] = mysqli_fetch_array($result); + $dpcRow[$i] = hexdec($dpcRow[$i][0]); + if ($DEBUG ) + { + echo "
      getsql = $getsql
      "; + echo "
      spc_$i=$dpcRow[$i]"; + } + } + }//end get dpcRow + $getsql = "select initValue from $paramTable + where level_1 = '2' and level_2 = '1' and level_3 = '6' "; + $result = @mysqli_query($pubConn,$getsql); + $sccp_row = @mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $ni= hexdec(getBitValue($sccp_row[0],"0.0-0.7")); + $gtt = getBitValue($sccp_row[0],"1.0-10.7"); + $gtt = str_replace('F','',$gtt); + $DPC=$dpcRow[$ni]; +}//end get ni & dpc + +//echo "
      ni=$ni"; +//echo "
      DPC=$DPC"; +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      sysId = $sysId"; +if($DEBUG) echo "
      instanceNo = $instanceNo"; +if($DEBUG) echo "
      objIdStr = $objIdStr"; + + +$GTTtableConfArr=array( + array('Start number', '03.0-12.7'), + array('End number', '13.0-22.7'), + array('On/off', '00.0-00.7'), + array('Numbering plan', '01.0-01.7'), + array('Network indicator', '23.0-23.7'), + array('DPC', '24.0-26.7'), + array('SSN', '27.0-27.7'), + array('Route indicator', '28.0-28.7'), + array('Address indicator', '29.0-29.7'), + array('Replaced start digit', '30.0-30.7'), + array('Replaced end digit', '31.0-31.7'), + array('Outgoing number plan', '32.0-32.7'), + array('Replacing digits', '33.0-42.7'), + array('TT', '02.0-02.7') +); + +$NetIdConfArr=array( + array('0','International'), + array('1','International spare'), + array('2','National'), + array('3','National spare') +); + +$numPlanConfArr=array( +// array('00','0'), +// array('01','MSISDN'), + array('06','IMSI(E.212)'), + array('07','GT(E.214)') +); +$ttArr = array(14,10,142); + +$addressIdConfArr=array( + array('00','NULL'), + array('01','DPC'), + array('02','SSN'), + array('03','DPC+SSN'), + array('04','GT'), + array('05','GT+DPC'), + array('06','GT+SSN'), + array('07','GT+DPC+SSN') +); + +function showNumber($number) +{ + $newNumber =str_replace('F','',$number); + return($newNumber); +} +//========================================================== +//数据处理 +//========================================================== +$niTypeArr = getNiType(); +//保存改动 +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $nStartDigit = omc_keep_length($nStartDigit,"F","20","0"); + $nEndDigit = omc_keep_length($nEndDigit,"F","20","0"); + $nDPC = dechex($DPC); + $nDPC = omc_keep_length($nDPC,"0","6","1"); + + $nSSN = dechex(6);//roger + $nSSN = omc_keep_length($nSSN,"0","2","1");//roger + if($niTypeArr[$ni] == 0)//ITU + { + + //========IMSI==== + if($flag=='imsi') + { + $nTT = '00'; + //$nNumPlan = '06'; + $nNumPlan = $setNP; + } + //========MSISDN==== + else + { + $nTT = omc_keep_length(dechex($setTT),0,2); + $nNumPlan = '01'; + } + } + else//ANSI + { + $nNumPlan = '00'; + $nTT = omc_keep_length(dechex($setTT),0,2); + } + //echo "setTT:$setTT
      "; + $NI = omc_keep_length($ni,'0','2'); + $nRep_digit = omc_keep_length('',"F","20","0"); + $nRep_start = omc_keep_length(0,"0","2","1"); + $nRep_end = omc_keep_length(0,"0","2","1"); + + $totalValue=omc_keep_length($totalValue,'0','86'); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[0][1],$nStartDigit); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[1][1],$nEndDigit); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[2][1],'01');//on/off + $totalValue=setBitValue($totalValue,$GTTtableConfArr[3][1],$nNumPlan); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[4][1],$NI);//NI + $totalValue=setBitValue($totalValue,$GTTtableConfArr[5][1],$nDPC); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[6][1],$nSSN); + + $totalValue=setBitValue($totalValue,$GTTtableConfArr[7][1],0);//Route indicator + $totalValue=setBitValue($totalValue,$GTTtableConfArr[8][1],'07');//Address indicator + $totalValue=setBitValue($totalValue,$GTTtableConfArr[9][1],$nRep_start); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[10][1],$nRep_end); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[11][1],0);//Outgoing num_plan + $totalValue=setBitValue($totalValue,$GTTtableConfArr[12][1],$nRep_digit); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[13][1],$nTT); + + $objIdStr='2.2'; + $objWhereStr =getLevelWhere($objIdStr); + $totalValue = strtoupper($totalValue); + $updSql = "UPDATE $paramTable SET initValue = '$totalValue' + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + {//set gtt attribution from 2.4 + $selSql = "select initValue from $paramTable where level_1='2' and level_2='4' and instanceNo='$instanceNo'"; + $Result = mysqli_query($pubConn,$selSql); + $Row = mysqli_fetch_array($Result); + $setValue = $Row[initValue]; + $eleName = 'HLR'; + $tmpEleName = omc_keep_length(toHex($eleName),"0",20,"0"); + + $setValue = setBitValue($setValue,'3.0-12.7',$tmpEleName); + + $updSql = "update $paramTable set initValue = '$setValue' where level_1='2' and level_2='4' and instanceNo='$instanceNo'"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + }//end set gtt attribution form 2.4 + if($DEBUG) + { + echo "DEBUG
      "; + } + else + { + echo ""; + exit(); + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> +
      + +"> + +"; + echo ""; + echo ""; + $CurName = strtoupper($flag); + echo "$strConfiguration > Network > HLR > $CurName Range"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       "; + //echo "$CurName Range:  "; + echo ""; + echo ""; + echo "    "; + echo ""; + echo ""; + $backurl=$backurl."&scroll_y=".$sub_page_top; + echo "$strBack"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; +} +echo ""; + +$objIdStr='2.2'; +$objWhereStr =getLevelWhere($objIdStr); +$getSql="SELECT initValue + FROM $paramTable + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); +$rows =mysqli_fetch_array($result); +echo mysqli_error($pubConn); +$value=$rows[0]; + +$SsnValue = 6; + +$startDigit =getBitValue($value,$GTTtableConfArr[0][1]); +$startDigit =showNumber($startDigit); +$endDigit =getBitValue($value,$GTTtableConfArr[1][1]); +$endDigit =showNumber($endDigit); + +$enableFlag =getBitValue($value,$GTTtableConfArr[2][1]); +$numPlan =getBitValue($value,$GTTtableConfArr[3][1]); +$TT =hexdec(getBitValue($value,$GTTtableConfArr[13][1])); + + +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +if($niTypeArr[$ni] == 0)//ITU +{ + if($flag=='imsi') + { + echo ""; + echo ""; + echo ""; + echo ""; + + + } + + else + { + echo ""; + echo ""; + echo ""; + } + + +} +else//ANSI +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +echo "
      ParametersValue
      Start $CurName number
      End $CurName number
      Number plan"; + echo ""; + echo "
      Translation Type"; + echo ""; + echo "
      Translation Type"; + $ttArr_ANSI_label=array(10=>"NET NODE(10)",14=>"MSISDN(14)",142=>"MNP ENABLED(142)"); + if($flag=='imsi') + { + $ttValue=9; + echo $ttValue; + echo ""; + } + else + { + $ttValue=14; + echo ""; + } + echo "
      "; +echo "
      "; + +echo "\n "; +echo "\n "; +echo "\n "; +echo "\n "; +echo "\n "; + +?> + + diff --git a/wxc2_omc/element/mss/gtt_overview.php b/wxc2_omc/element/mss/gtt_overview.php new file mode 100755 index 0000000..453612b --- /dev/null +++ b/wxc2_omc/element/mss/gtt_overview.php @@ -0,0 +1,258 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$paramTable ='OBJ_223.param_99'; +$paramConf ='OBJ_223.paramConf'; +$maxNum = 30; +/* +GTT table +[unit]On/off[u]00.0-00.7[u]select +[v]1[opt]on +[v]0[opt]off +[unit]Numbering plan[u]01.0-01.7[u]select +[v]1[opt]MSISDN +[v]6[opt]IMSI +[v]7[opt]E.214 GT +[unit]Start GT number[u]02.0-11.7[u]input +[v]keepHex-low-E +[unit]End GT number[u]12.0-21.7[u]input +[v]keepHex-low-E +[unit]Network indicator[u]22.0-22.7[u]select +[v]0[opt]0 +[v]1[opt]1 +[v]2[opt]2 +[v]3[opt]3 +[unit]Destination point code[u]23.0-25.7[u]input +[v]toDec-high-0 +[unit]SSN[u]26.0-26.7[u]input +[v]toDec-high-0 +[unit]Route indicator[u]27.0-27.7[u]select +[v]0[opt]route on GT +[v]1[opt]route on SSN +[unit]Replaced start digit[u]28.0-28.7[u]input +[v]keepHex-high-0 +[unit]Replaced end digit[u]29.0-29.7[u]input +[v]keepHex-high-0 +[unit]Outgoing number plan[u]30.0-30.7[u]select +[v]1[opt]MSISDN +[v]6[opt]IMSI +[v]7[opt]E.214 GT +[unit]Replacing digits[u]31.0-40.7[u]input +[v]keepHex-low-E +*/ +//========================================================== +//数据处理 +//========================================================== +$objIdStr='2.2'; + +$GTTtableConfArr=array( + array('Start number', '03.0-12.7'), + array('End number', '13.0-22.7'), + array('On/off', '00.0-00.7'), + array('Numbering plan', '01.0-01.7'), + array('Network indicator', '23.0-23.7'), + array('DPC', '24.0-26.7'), + array('SSN', '27.0-27.7'), + array('Route indicator', '28.0-28.7'), + array('Address indicator', '29.0-29.7'), + array('Replaced start digit', '30.0-30.7'), + array('Replaced end digit', '31.0-31.7'), + array('Outgoing number plan', '32.0-32.7'), + array('Replacing digits', '33.0-42.7'), + array('TT', '2.0-2.7') +); + +$NetIdConfArr=array( + array('0','International'), + array('1','Inter-S'), + array('2','National'), + array('3','National-S') +); + +$numPlanConfArr=array( + array('0','--'), + array('1','MSISDN'), + array('6','IMSI'), + array('7','E.214 GT') +); + +$addressIdConfArr=array( + array('00','NULL'), + array('01','DPC'), + array('02','SSN'), + array('03','DPC+SSN'), + array('04','GT'), + array('05','GT+DPC'), + array('06','GT+SSN'), + array('07','GT+DPC+SSN') +); + +function showNumber($number){ + $newNumber =str_replace('F','',$number); + if($newNumber == ''){ + $newNumber='--'; + } + return($newNumber); +} + +?> + + +"; +echo ""; +echo ""; +echo "Configuration > Network > GTT overview"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "

      $strBack"; +echo ""; +echo ""; +echo ""; +echo "
      "; + +?> + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$levelStr=getLevelWhere($objIdStr); +$defSql = "select initValue from $paramConf WHERE $levelStr "; +$defRes = mysqli_query($pubConn, $defSql); +$defRow = mysqli_fetch_array($defRes); +if($DEBUG) echo "
      defSql = $defSql"; +$getSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $levelStr and initValue!='{$defRow[0]}'"; + +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); + +$levelStr_1 = getLevelWhere("2.4"); +while($rows =mysqli_fetch_array($result)){ + $instanceNo=$rows[instanceNo]; + $value=$rows[0]; + if($DEBUG) echo "
      value=$value"; + $startDigit =getBitValue($value,$GTTtableConfArr[0][1]); + //if($startDigit == 'FFFFFFFFFFFFFFFFFFFF') continue; + $startDigit =showNumber($startDigit); + $endDigit =getBitValue($value,$GTTtableConfArr[1][1]); + $endDigit =showNumber($endDigit); + $enableFlag =getBitValue($value,$GTTtableConfArr[2][1]); + if($enableFlag > 0){ + $enableFlag ='Y'; + }else{ + $enableFlag ='N'; + } + + + $numPlan =getBitValue($value,$GTTtableConfArr[3][1]); + for($j=0;$jtmpSql=$tmpSql"; + $tmpResult =mysqli_query($pubConn,$tmpSql); + $tmpRows =mysqli_fetch_array($tmpResult); + $Title =toAscii(getBitValue($tmpRows[0],"3.0-12.7")); + + if(ord($Title)==0) + $Title="--"; + + if($instanceNo == $setInstanceNo &&$objIdStr==$setObjIdStr) + echo ""; + else + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + +?> +
      No.TitleStart numberEnd numberEnableNPTTNIDPCSSNRouter IDAddress IDRep-startRep-EndONPRep-number
      "; + //echo "$instanceNo $instanceNo$Title$startDigit $endDigit $enableFlag $numPlanName $TT $NetIDName $SPC $SSN $RouterID $adressIDName $Rep_start $Rep_end $OutNumPlanName $Rep_digit 
      +

      +  + + diff --git a/wxc2_omc/element/mss/hlr.php b/wxc2_omc/element/mss/hlr.php new file mode 100755 index 0000000..3e69595 --- /dev/null +++ b/wxc2_omc/element/mss/hlr.php @@ -0,0 +1,1186 @@ +正在调试中!!"; +?> + + +"; + +$backurl = "./hlr.php"; +$sysId = '330_99_99'; + +$nGetComm = 0; +$nSetComm = 3; + +$pubDb = "OMC_PUB"; +$sqltable_sccp = 'OBJ_223.param_99'; +$sqlSccpConf = 'OBJ_223.paramConf'; +$sqltable = 'OBJ_330.param_99'; +$sqlConf = 'OBJ_330.paramConf'; +$sqltable_spc = 'OBJ_222.param_99'; +$mtp3_sqlTable = 'OBJ_222.param_99'; +$sysStatTable='OMC_PUB.sysStat'; + +$sysinfo = 'OMC_PUB.sysInfo'; +$sysTypeNo = '322'; + +$NI_arr=array('International','International spare','National','National spare'); + +$sysId_arr=array( + array('oid'=>'2.1.6', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2.0', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.0', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.11', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.12', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.13', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.14', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.15', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.16', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.17', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.18', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.20', 'sysid'=> '330_99_99', 'selectsysid'=>'-1'), +); + +$SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99') +); +$getsql = "SELECT sysNo FROM $sysinfo where sysTypeNo = 330"; +if($DEBUG) echo "getsql = $getsql
      "; +$Result = @mysqli_query($pubConn,$getsql); +while($Rows = mysqli_fetch_array($Result)) +{ + $hlrSysId = "330_".$Rows[sysNo]."_0"; + $SaveArr[] = array('oidstr'=>'2.2.2', 'setvalue'=>'01' ,'sysid'=> $hlrSysId); +} + +$spcTree_array = array( +array('INT', '14-bit', 'spc_int_14', '2.3.1'), +array('INT-S', '14-bit', 'spc_int_sp_14', '2.3.2'), +array('NAT', '14-bit', 'spc_nat_14', '2.3.3'), +array('NAT-S', '14-bit', 'spc_nat_sp_14', '2.3.4'), +array('International', '24-bit', 'spc_int_24', '2.3.5'), +array('International spare', '24-bit', 'spc_int_sp_24', '2.3.6'), +array('National', '24-bit', 'spc_nat_24', '2.3.7'), +array('National spare', '24-bit', 'spc_nat_sp_24', '2.3.8') +); + +$GTTtableConfArr=array( + array('Start number', '03.0-12.7'), + array('End number', '13.0-22.7'), + array('On/off', '00.0-00.7'), + array('Numbering plan', '01.0-01.7'), + array('Network indicator', '23.0-23.7'), + array('DPC', '24.0-26.7'), + array('SSN', '27.0-27.7'), + array('Route indicator', '28.0-28.7'), + array('Address indicator', '29.0-29.7'), + array('Replaced start digit', '30.0-30.7'), + array('Replaced end digit', '31.0-31.7'), + array('Outgoing number plan', '32.0-32.7'), + array('Replacing digits', '33.0-42.7'), + array('TT', '02.0-02.7') +); + +$hplmn_loc = array( + 'start' => '05.0-10.7', + 'end' => '11.0-16.7' +); + +//loading +if($load_flag == 1) +{ + echo "
      Loading"; + + GetParam($sysId_arr,1);//1 means return to overview if getting parameters fails. + + echo ""; +} +$querysql = "select initValue from $sqltable_spc where level_1 = '2' and level_2 = '2' and level_3 = '0'"; +$result = mysqli_query($pubConn,$querysql); +$indicator = mysqli_fetch_array($result); +echo mysqli_error($pubConn); +if ($DEBUG )echo "
      indicator = {$indicator[0]}
      "; + +for($i = 0; $i < 4; $i++) +{ + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; +} + +for($i = 0; $i < 4; $i ++) +{ + $levelWhere = getLevelWhere($spcTree_array[$spc_index[$i]][3]); + $getsql = "select initValue from $sqltable_spc where $levelWhere "; + $result = mysqli_query($pubConn,$getsql); + $dpcRow[$i] = mysqli_fetch_array($result); + $dpcRow[$i] = hexdec($dpcRow[$i][0]); + if ($DEBUG ) + { + echo "
      getsql = $getsql
      "; + echo "
      spc_$i=$dpcRow[$i]"; + } +} +$niTypeArr = getNiType(); +echo ""; +if(isset($doingOtherFlag)) +{ + {//set system ip + for($i=0; $i < 2; $i++) + { + $getsql = "SELECT ip FROM $sysinfo where sysTypeNo = $sysTypeNo and sysNo = '$i'"; + if($DEBUG) echo "getsql = $getsql
      "; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = strtoupper(omc_keep_length($mss_ip[0],'0','8')); + $mss_ip[1] = strtoupper(omc_keep_length($mss_ip[1],'0','8')); + if($DEBUG) + { + echo "
      mss0_ip = $mss_ip[0]
      "; + echo "mss1_ip = $mss_ip[1]
      "; + } + + $sysId = "223_99_99"; + //hlr + if($setHlrGtt==1) + { + $oidStr = "2.1.6"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + }//end set system ip + exit; +} +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + SetParam($sysId_arr); + session_register("hlrSetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + echo ""; + //exit(); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } + + + echo ""; + exit(); +} + +if ($DEBUG ) echo "delFlag = $delflag
      "; +if ($DEBUG ) echo "delNO = $delValue
      "; +if (isset($delflag)) +{ + $delNoStr = rtrim($delNoStr,'.'); + $delNoArr = explode('.',$delNoStr); + $instNoWhereStr = ''; + for($i=0; $i< sizeof($delNoArr); $i++) + { + if($i==0) + $instNoWhereStr = "(instanceNo='$delNoArr[$i]'"; + else + $instNoWhereStr .= " or instanceNo='$delNoArr[$i]'" ; + } + $instNoWhereStr .= ')'; + + if($delflag=='Regional') + { + $getsql = "select initValue from $sqlConf where level_1 = '2' and level_2 = '1' and level_3 = '14'"; + $rsl_org = @mysqli_query($pubConn,$getsql); + $rsl_org = @mysqli_fetch_array($rsl_org); + $rsl_org = $rsl_org[0]; + echo mysqli_error($pubConn); + if ($DEBUG ) echo "rsl_org = $rsl_org
      "; + + $setsql = "update $sqltable set initValue = '$rsl_org' + where level_1 = '2' and level_2 = '1' and level_3 = '14' and $instNoWhereStr "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + elseif($delflag=='IMSIRange' || $delflag=='MSISDNRange') + { + $defSql = " SELECT initValue FROM $sqlSccpConf WHERE level_1 = '2' and level_2 = '2' and level_3 = '0'"; + $defRes = @mysqli_query($pubConn,$defSql); + $defrow = @mysqli_fetch_array($defRes); + + $setsql = "update $sqltable_sccp set initValue = '$defrow[initValue]' + where level_1 = '2' and level_2 = '2' and level_3 = '0' and $instNoWhereStr "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + $defSql = " SELECT initValue FROM $sqlSccpConf WHERE level_1 = '2' and level_2 = '4' and level_3 = '0'"; + $defRes = @mysqli_query($pubConn,$defSql); + $defrow = @mysqli_fetch_array($defRes); + $setsql = "update $sqltable_sccp set initValue = '$defrow[initValue]' + where level_1 = '2' and level_2 = '4' and level_3 = '0' and $instNoWhereStr "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + elseif($delflag=='VPLMNs') + { + $defSql = " SELECT initValue FROM paramConf WHERE level_1 = '2' and level_2 = '1' and level_3 = '12'"; + $defRes = @mysqli_query($pubConn,$defSql); + $defrow = @mysqli_fetch_array($defRes); + + $setsql = "update $sqltable set initValue = '$defrow[initValue]' + where level_1 = '2' and level_2 = '1' and level_3 = '12' and $instNoWhereStr "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + elseif($delflag=='USSDEAE') + { + $oidStr = "2.1.20.3"; + $levelWhere = getLevelWhere($oidStr); + $defSql = " SELECT initValue FROM paramConf WHERE $levelWhere"; + $defRes = @mysqli_query($pubConn,$defSql); + $defrow = @mysqli_fetch_array($defRes); + + $setsql = "update $sqltable set initValue = '$defrow[initValue]' + where $levelWhere and $instNoWhereStr "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + elseif($delflag=='faxGsmBcId') + { + $defSql = " SELECT initValue FROM paramConf WHERE level_1 = '2' and level_2 = '1' and level_3 = '17'"; + $defRes = @mysqli_query($pubConn,$defSql); + $defrow = @mysqli_fetch_array($defRes); + + $setsql = "update $sqltable set initValue = '$defrow[initValue]' + where level_1 = '2' and level_2 = '1' and level_3 = '17' and instanceNo = '$delValue' "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + elseif($delflag=='dataGsmBcId') + { + $defSql = " SELECT initValue FROM paramConf WHERE level_1 = '2' and level_2 = '1' and level_3 = '18'"; + $defRes = @mysqli_query($pubConn,$defSql); + $defrow = @mysqli_fetch_array($defRes); + + $setsql = "update $sqltable set initValue = '$defrow[initValue]' + where level_1 = '2' and level_2 = '1' and level_3 = '18' and instanceNo = '$delValue' "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + elseif($delflag=='RSA') + { + $getsql = "select initValue from $sqlConf where level_1 = '2' and level_2 = '1' and level_3 = '29'"; + $rsl_org = @mysqli_query($pubConn,$getsql); + $rsl_org = @mysqli_fetch_array($rsl_org); + $rsl_org = $rsl_org[0]; + echo mysqli_error($pubConn); + if ($DEBUG ) echo "rsl_org = $rsl_org
      "; + + $setsql = "update $sqltable set initValue = '$rsl_org' + where level_1 = '2' and level_2 = '1' and level_3 = '29' and instanceNo = '$delValue' "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + elseif($delflag=='ACS_DIGI') + { + if($DEBUG)echo "

      Deleteing access digits instance $delValue of RA $delValue2"; + + //delete access_digits + $setsql = "update $sqltable set initValue = '$access_digit_default' + where level_1 = '2' and level_2 = '1' and level_3 = '30' and instanceNo = '$delValue'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + //delete prefix + delete_prefix_of_RA($delValue2); + } +} +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > HLR"; +echo ""; +$helpId = '2.1.1.3'; +showHelp($helpId); +echo "
      "; +echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       "; + //echo "Home Location Register:  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +?> + + +" ; + echo ""; + echo ""; + echo ""; +}//end Signaling point + +{//gtt + $sysId = "223_99_99"; + $oidStr = "2.1.6"; + $instanceNo=0; + echo "" ; + echo ""; +}//end gtt + +//========================================================== +//取GTT数据 +//========================================================== +/*byte26: subsystem number (SSN), function with DPC for GTT over SCCP, +4=OMC, 6=HLR, +7=VLR, 8=MSC, 9=EIR, 10=AuC, 11=SMSC , 254=AIF, 147=PPSSCF +*/ + +$getsql = "select initValue from $sqltable_sccp +where level_1 = '2' and level_2 = '1' and level_3 = '6' "; +$result = @mysqli_query($pubConn,$getsql); +$sccp_row = @mysqli_fetch_array($result); +echo mysqli_error($pubConn); +$ni_hlr= hexdec(getBitValue($sccp_row[0],"0.0-0.7")); +$gtt = getBitValue($sccp_row[0],"1.0-10.7"); +$gtt = str_replace('F','',$gtt); +$setGttDPC=$dpcRow[$ni_hlr]; + +$getsql = "select initValue,instanceNo from $sqltable_sccp +where level_1 = '2' and level_2 = '2' and level_3 = '0'"; +$result = @mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); + +$n = 0; +$m = 0; +while($gtt_row = @mysqli_fetch_array($result)) +{ + $flag = BinDec(getBitValue($gtt_row[0],'0.0-0.7')); + $ssn = hexdec(getBitValue($gtt_row[0],'27.0-27.7')); + $indicator = hexdec(getBitValue($gtt_row[0],'23.0-23.7')); + $dpc = hexdec(getBitValue($gtt_row[0],'24.0-26.7')); + if ($flag == 1 && $ssn == 6 && $indicator==$ni_hlr && $dpc==$dpcRow[$ni_hlr]) + { + $TT = hexdec(getBitValue($gtt_row[0],$GTTtableConfArr[13][1])); + $numberPlan=hexdec(getBitValue($gtt_row[0],$GTTtableConfArr[3][1])); + + if($niTypeArr[$ni_hlr]==0)//ITU + { + $imsiFlag = ($numberPlan==6 || $numberPlan==7); + $msisdnFlag = ($numberPlan==1); + } + else + { + $imsiFlag = ($TT == 9); + $msisdnFlag = ($TT == 14 || $TT == 10||$TT == 142); + } + if($imsiFlag)//imsi + { + $imsi_inst[$n] = $gtt_row[instanceNo]; + $imsi_start[$n] = getBitValue($gtt_row[0],'3.0-12.7'); + $imsi_start[$n] = str_replace('F','',$imsi_start[$n]); + if($imsi_start[$n] == '') + $imsi_start[$n] = 0; + $imsi_end[$n] = getBitValue($gtt_row[0],'13.0-22.7'); + $imsi_end[$n] = str_replace('F','',$imsi_end[$n]); + if($imsi_end[$n] == '') + $imsi_end[$n] = 0; + + $n++; + if ($DEBUG ) echo "imsi_start=$imsi_start
      "; + if ($DEBUG ) echo "imsi_end=$imsi_end
      "; + if ($DEBUG ) echo "imsi_no=$imsi_no
      "; + } + else if($msisdnFlag) + { + $msisdn_inst[$m] = $gtt_row[instanceNo]; + $msisdn_start[$m] = getBitValue($gtt_row[0],'3.0-12.7'); + $msisdn_start[$m] = str_replace('F','',$msisdn_start[$m]); + if($msisdn_start[$m] == '') + $msisdn_start[$m] = 0; + $msisdn_end[$m] = getBitValue($gtt_row[0],'13.0-22.7'); + $msisdn_end[$m] = str_replace('F','',$msisdn_end[$m]); + if($msisdn_end[$m] == '') + $msisdn_end[$m] = 0; + + $m++; + if ($DEBUG ) echo "msisdn_start=$msisdn_start
      "; + if ($DEBUG ) echo "msisdn_end=$msisdn_end
      "; + if ($DEBUG ) echo "msisdn_no=$msisdn_no
      "; + } + $imsiFlag=$msisdnFlag=0; + } +} +if ($DEBUG ) echo "imsi_no=$imsi_no
      "; +if ($DEBUG ) echo "msisdn_no=$msisdn_no
      "; + +{ + {//imsi range + $nrow = $n + 1; + $getsql = "SELECT initValue,instanceNo from $sqltable_sccp + where level_1 = '2' and level_2 = '2' and level_3 = '0' + and initValue like '00%'"; + $result = mysqli_query($pubConn,$getsql); + + echo "" ; + echo ""; + + if($n == 0) + { + echo ""; + } + else + { + echo ""; + } + echo ""; + }//end imsi range + + {//msisdn range + $nrow = $m + 1; + $getsql = "SELECT initValue,instanceNo from $sqltable_sccp + where level_1 = '2' and level_2 = '2' and level_3 = '0' + and initValue like '00%'"; + //echo ""; + $result = mysqli_query($pubConn,$getsql); + echo "" ; + echo ""; + + if($m == 0) + { + echo ""; + } + else + { + echo ""; + } + echo ""; + }//end msisdn range +} + +{//HPLMN SN Range + $sysId = "330_99_99"; + $oidStr = "2.1.11"; + echo ""; + echo ""; + echo ""; + echo ""; +} + +//========================================================== +//输出VPLMNs SN Range +//========================================================== +$objWhereStr = getLevelWhere('2.1.12'); + +$defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; +$defRes = @mysqli_query($pubConn,$defSql); +$defrow = @mysqli_fetch_array($defRes); + + +$getsql = "SELECT initValue,instanceNo from $sqltable where $objWhereStr AND initValue !='$defrow[initValue]'"; +$result = mysqli_query($pubConn,$getsql); +if($DEBUG) echo "
      getsql:$getsql"; +$n=0; +while($vplmn_init = mysqli_fetch_array($result)) +{ + $init = $vplmn_init[initValue]; + $vp_insno[$n] = $vplmn_init[instanceNo]; + $vp_CC[$n] = str_replace('E','',getBitValue($init,'00.0-01.7')); + $vp_NDC[$n] = str_replace('E','',getBitValue($init,'02.0-04.7')); + $vp_sn_start[$n] = str_replace('E','',getBitValue($init,$hplmn_loc['start'])); + $vp_sn_end[$n] = str_replace('E','',getBitValue($init,$hplmn_loc['end'])); + $n++; +} + +$nrow = $n + 1; +$getsql = "SELECT initValue,instanceNo from $sqltable where $objWhereStr AND initValue ='$defrow[initValue]'"; +$result = mysqli_query($pubConn,$getsql); + +echo "" ; +echo ""; + +if($n == 0) +{ + echo ""; +} +else +{ + $flag = 'VPLMNs'; + echo ""; +} +echo ""; + +if(1) +{ + //========================================================== + //输出CSRR + //========================================================== + echo ""; + echo ""; + echo ""; + + echo ""; + */ + } + echo "    "; + + //========================================================== + //输出Regional subscription zone code list + //========================================================== + $getsql = "select initValue from $sqlConf + where level_1 = '2' and level_2 = '1' and level_3 = '14' "; + $reg_org = @mysqli_query($pubConn,$getsql); + $reg_org = @mysqli_fetch_array($reg_org); + $reg_def = $reg_org[0]; + + $getsql = "select initValue ,instanceNo from $sqltable + where level_1 = '2' and level_2 = '1' and level_3 = '14' and initValue !='$reg_def' "; + $reg_result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $n = 0; + while($reg_row = mysqli_fetch_array($reg_result)) + { + $cntryCode[$n] = str_replace('E','',getBitValue($reg_row[initValue],'00.0-01.7')); + $nationalDesCode[$n] = str_replace('E','',getBitValue($reg_row[initValue],'02.0-04.7')); + $zoneCode[$n] = hexdec(getBitValue($reg_row[initValue],'05.0-06.7')); + $reg_ins[$n] = $reg_row[instanceNo]; + $n++; + } + $nrow = $n + 2; + $getsql = "select initValue ,instanceNo from $sqltable + where level_1 = '2' and level_2 = '1' and level_3 = '14' and initValue ='$reg_def' "; + $reg_new = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $regnew = mysqli_fetch_array($reg_new); + echo "" ; + echo ""; + + if($n == 0) + { + echo ""; + } + else + { + echo ""; + } + echo ""; +} + +//========================================================== +//输出CDR +echo ""; +echo ""; + echo ""; +echo ""; + +//========================================================== +//输出USSD Format +//========================================================== +{ + echo ""; + echo ""; + echo ""; + echo ""; +}//end 输出USSD Format + +{//UG-CSI + echo ""; + echo ""; + echo ""; + echo ""; +}//end UG-CSI +//output ussd eae +{ + //$relayTypeArr = array("SMPP","MAP"); + $levelWhere = getLevelWhere("2.1.20.3"); + $ussdEAE_defsql = "select initValue from $sqlConf where $levelWhere"; + $ussdEAE_defresult = @mysqli_query($pubConn,$ussdEAE_defsql); + $ussdEAE_defrow = @mysqli_fetch_array($ussdEAE_defresult); + $ussdEAE_def = $ussdEAE_defrow[0]; + + $ussdEAE_sql = "select instanceNo,initValue from $sqltable where $levelWhere and initValue != '$ussdEAE_def'"; + $ussdEAE_result = mysqli_query($pubConn,$ussdEAE_sql); + $n=0; + while($ussdEAE_row = mysqli_fetch_array($ussdEAE_result)) + { + $ussdEaeArr[$n][inst] = $ussdEAE_row[instanceNo]; + $ussdEaeArr[$n][smppNumber] = toAscii(getBitValue($ussdEAE_row[initValue],'00.0-08.7')); + $ussdEaeArr[$n][ussdCode] = toAscii(getBitValue($ussdEAE_row[initValue],'9.0-12.7')); + //$ussdEaeArr[$n][relayType] = hexdec(getBitValue($ussdEAE_row[initValue],'14.0-14.7')); + $n++; + } + $nrow = $n + 1; + $getsql = "SELECT initValue,instanceNo from $sqltable where $levelWhere AND initValue = '$ussdEAE_def'"; + $result = mysqli_query($pubConn,$getsql); + + echo "" ; + echo ""; + + if($n == 0) + { + echo ""; + } + else + { + $flag = 'USSDEAE'; + echo ""; + } + echo ""; +}//end output ussd eae + +$getSql="SELECT detailStat FROM $sysStatTable WHERE sysTypeNo='330' ORDER BY sysNo,subSysNo"; +if ($DEBUG ) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +$rows=mysqli_fetch_array($result); + +$max_lic=hexdec(substr($rows[0],44,8)); +$used_lic=hexdec(substr($rows[0],52,8)); + +$license_arr=array( + array('Subscriber', 'used_lic'), + array('License', 'max_lic') +); + +if($DEBUG) +{ + echo "
      Max = $max_lic
      "; + echo "Used = $used_lic
      "; +} + echo ""; + echo ""; + echo ""; + echo ""; +/* + {//license + echo "" ; + echo ""; + echo ""; + echo ""; + }//end license +*/ +//========================================================== +//输出Command +//========================================================== +/* +echo ""; +echo ""; +*/ +echo ""; +echo ""; + + +?> +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Signaling point code"; + for($i=0; $i<4; $i++) + echo ""; + echo "
      {$spcTree_array[$i][0]} : {$spcTree_array[$spc_index[$i]][1]} : $dpcRow[$i]
      $strE164Number"; + echo ""; + + echo ""; + echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setHlrGtt=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1,$instanceNo,$doingOtherUlr); + echo "
      "; + echo ""; + echo ""; + if($imsi_new = mysqli_fetch_array($result)){ + echo ""; + } + echo "
      IMSI range+
       --"; + echo ""; + $flag = 'IMSIRange'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0; $i < $n; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //==============the more and hide button=================== + + if($n>4) + { + + echo ""; + echo ""; + } + + echo "
      No.StartEndDelete"; + echo ""; + echo "
       $i$imsi_start[$i]$imsi_end[$i]
      More >>
      Hide >>
      $getsql
      "; + echo ""; + echo ""; + if($msisdn_new = mysqli_fetch_array($result)){ + echo ""; + } + echo "
      MSISDN range+
       --"; + echo ""; + $flag = 'MSISDNRange'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0; $i < $m; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + } + //===============more button============== + if($m>4) + { + echo ""; + echo ""; + } + echo "
      No.StartEndDelete"; + echo ""; + echo "
       $i$msisdn_start[$i]$msisdn_end[$i]
      More >>
      Hide >>
      VLR SN range"; + echo ""; + echo ""; + echo "
      Start: "; + showParameter($sysId,$oidStr,3,1); + echo "End: "; + showParameter($sysId,$oidStr,4,1); + echo "
      "; +echo ""; +echo ""; +if($vplmn_new = mysqli_fetch_array($result)){ + echo ""; +} +echo "
      VPLMNs+
       --"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0; $i < $n; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + $vp_CC[$i] = strlen($vp_CC[$i])==0 ? '--' : $vp_CC[$i]; + $vp_NDC[$i] = strlen($vp_NDC[$i])==0 ? '--' : $vp_NDC[$i]; + $vp_sn_start[$i] = strlen($vp_sn_start[$i])==0 ? '--' : $vp_sn_start[$i]; + $vp_sn_end[$i] = strlen($vp_sn_end[$i])==0 ? '--' : $vp_sn_end[$i]; + + if($i>3) + echo ""; + else + echo ""; + + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + if($n>4) + { + echo ""; + echo ""; + } + echo "
      No.CCNDCStart SNEnd SNDelete"; + echo ""; + echo "
       $vp_insno[$i]$vp_CC[$i]$vp_NDC[$i]$vp_sn_start[$i]$vp_sn_end[$i]
      More >>
      Hide >>
      "; + echo "CSRR type
      "; + for ($i=0; $i < 8; $i++) + { + $getsql = "select initValue from $sqltable + where level_1 = '2' and level_2 = '1' and level_3 = '13' and instanceNo ='$i' "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $row = $row[0]; + + echo " $i     "; + /* + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       $i$row
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      Regional subscription zone code list+
       --"; + echo ""; + $flag = 'Regional'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + for($i=0; $i < $n; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //======more button======= + if($n>4) + { + echo ""; + echo ""; + } + echo "
      No.CCNDCZCDelete"; + echo ""; + echo "
       $reg_ins[$i]$cntryCode[$i]$nationalDesCode[$i]$zoneCode[$i]
      More >>
      Hide >>
      "; +echo "CDR "; + $sysId = "330_99_99"; + $oidStr = "2.1.16"; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo "USSD format "; + $sysId = "330_99_99"; + $oidStr = "2.1.20.1"; + showParameter($sysId,$oidStr,1,3); + echo "
      "; + echo "UG-CSI"; + $sysId = "330_99_99"; + $oidStr = "2.1.20.2"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Service Code "; + showParameter($sysId,$oidStr,1,1); + echo "Number Plan + MSISDN "; + showParameter($sysId,$oidStr,2,1); + echo "
      "; + echo ""; + echo ""; + if($USSDEAE_new = mysqli_fetch_array($result)){ + echo ""; + } + echo "
      USSDEAE+
       --"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + + for($i=0; $i < $n; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + + $ussdEaeArr[$i][smppNumber] = strlen($ussdEaeArr[$i][smppNumber]) == 0 ? '--' : $ussdEaeArr[$i][smppNumber]; + $ussdEaeArr[$i][ussdCode] = strlen($ussdEaeArr[$i][ussdCode]) == 0 ? '--' : $ussdEaeArr[$i][ussdCode]; + //$ussdEaeArr[$i][relayType]; + $tmpInst = $ussdEaeArr[$i][inst]; + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + /*echo "";*/ + echo ""; + echo ""; + } + //==more button======= + if($n>4) + { + echo ""; + echo ""; + } + echo "
      No.SMPP NumberUSSD CodeRelay TypeDelete"; + echo ""; + echo "
       {$ussdEaeArr[$i][inst]}{$ussdEaeArr[$i][smppNumber]}{$ussdEaeArr[$i][ussdCode]}{$relayTypeArr[$ussdEaeArr[$i][relayType]]}
      More >>
      Hide >>
      {$license_arr[0][0]} ${$license_arr[0][1]}
      License control "; + $sysId = '330_99_99'; + $oidStr = "2.1.15"; + showParameter($sysId,$oidStr,1,1,0,'','','Update'); + echo "
      Command"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      HLR0LockHLR1Lock
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +echo "
      "; +?> + diff --git a/wxc2_omc/element/mss/licenseControl.php b/wxc2_omc/element/mss/licenseControl.php new file mode 100755 index 0000000..cb44696 --- /dev/null +++ b/wxc2_omc/element/mss/licenseControl.php @@ -0,0 +1,319 @@ +impObjId= $impObjId"; +if($DEBUG)echo "
      impFileName=$impFileName "; +if($DEBUG)echo "
      ftpDir=$ftpDir "; +if($DEBUG)echo "
      ftpLoginName=$ftpLoginName "; +if($DEBUG)echo "
      ftpLoginPwd=$ftpLoginPwd"; +if($DEBUG)echo "
      paramType=$paramType "; +if($DEBUG)echo "
      maxImpFileSize=$maxImpFileSize "; + +//判断是否有文件上载 +if(isset($impFile) && $impFile != "none"){ + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='200' AND sysNo='9' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $runningServerNum = mysqli_num_rows($getSysIdResult); + if($runningServerNum <= 0){ + echo "
      Error: No system run normally"; + } + if($DEBUG) echo "running server number = $runningServerNum
      "; + + //检查导入的文件大小,记录条数 + $impFileSize = @filesize($impFile); + if($DEBUG) { + echo "
      impFile=$impFile"; + echo "
      impFileSize=$impFileSize"; + } + if($impFileSize > $maxImpFileSize){ + echo "
      Import File Size is $impFileSize bytes"; + echo "
      File size is too large!(Must be <= $maxImpFileSize)"; + @unlink ($impFile); + echo "

      Back"; + exit(); + } + + if($impFileSize <=0){ + echo "
      No import File"; + @unlink ($impFile); + echo "

      Back"; + exit(); + } + + $submitStat = 'DISABLED'; + for ($k=0; $k<$runningServerNum; $k++) { + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $dstSeverIp = $getSysIdRow[ip]; + $dstSeverIpArr[$k] = $getSysIdRow[ip]; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + + /* close ftp + $ftpCon=@ftp_connect($dstSeverIp); + if($ftpCon < 0){ + echo "
      Connect $dstSeverIp Failed!"; + @unlink ($impFile); + echo "

      Back"; + exit(); + } + */ + + $connection=sftp_connect($dstSeverIp); + if(!$connection) + { + echo "
      Connect $dstSeverIp Failed!"; + @unlink ($impFile); + echo "

      Back"; + exit(); + } + + /* close ftp + if(!@ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + echo "
      Login $dstSeverIp Failed!"; + @unlink ($impFile); + echo "

      Back"; + exit(); + } + */ + + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + if(!$key) + { + echo "
      Login $dstSeverIp Failed!"; + @unlink ($impFile); + echo "

      Back"; + exit(); + } + + $remoteFileName=$ftpDir.$impFileName; + if($DEBUG)echo "$ftpCon,$remoteFileName,$impFile"; + /* close ftp + if(!@ftp_put($ftpCon,$remoteFileName,$impFile,FTP_BINARY)){ + echo "
      Put file to $dstSeverIp Failed"; + exit(); + @unlink ($impFile); + echo "

      Back"; + exit(); + } + ftp_quit($ftpCon); + */ + + if(!sftp_put($key,$remoteFileName,$impFile,SFTP_ASCII)) + { + echo "
      Put file to $dstSeverIp Failed"; + exit(); + @unlink ($impFile); + echo "

      Back"; + exit(); + } + } + @unlink ($impFile); + + $sysId='388_99_99'; + if($DEBUG) echo "
      (2) sysId=$sysId"; + + //send set command + + $chgResult = setSysParamValue('388_99_99',$impObjId,$instanceNo,'00'); + $commIdArr = sysCommSend('388_99_99',$nSetComm,$impObjId); + if($DEBUG){ + echo "setSysParamValue($sysId,$impObjId,$instanceNo,$newValue)
      "; + echo "sysCommSend($sysId,$nSetComm,$impObjId)"; + } + + + CheckState($commIdArr); + echo "
      Finished"; + + for($k=0;$kdstSeverIp=$dstSeverIp"; + $dstSeverIp=$dstSeverIpArr[$k]; + /* close ftp + $ftpCon=@ftp_connect($dstSeverIp); + if($ftpCon < 0){ + echo "
      Connect $dstSeverIp Failed!"; + echo "

      Back"; + exit(); + } + */ + + $connection=sftp_connect($dstSeverIp); + if(!$connection){ + echo "
      Connect $dstSeverIp Failed!"; + echo "

      Back"; + exit(); + } + + /* close ftp + if(!@ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + echo "
      Login $dstSeverIp Failed!"; + echo "

      Back"; + exit(); + } + */ + + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + if(!$key) + { + echo "
      Login $dstSeverIp Failed!"; + echo "

      Back"; + exit(); + } + + $remoteFileName =$ftpDir.$baseLogFileName; + $timestamp = time(); + $nameArray = explode(".",$baseLogFileName); + $logFileName = $nameArray[0].$timestamp."_".$k.".log"; + $localFileName ="/usr/local/apache/htdocs/ftpFile/$logFileName"; + /* + //delete *.log + $handle=opendir('/usr/local/apache/htdocs/ftpFile/'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + $delFileName = "/usr/local/apache/htdocs/ftpFile/".$file; + if($retval=='log') unlink($delFileName); + } + */ + //echo "$ftpCon,$localFileName,$remoteFileName"; + /* close ftp + if(!ftp_get($ftpCon,$localFileName,$remoteFileName,FTP_ASCII)){ + echo "
      Get log file from $dstSeverIp Failed"; + echo "

      Back"; + exit(); + } + ftp_quit($ftpCon); + */ + + //if(!sftp_get($key,$localFileName,$remoteFileName,SFTP_ASCII)) + if(!sftp_get($connection,$localFileName,$remoteFileName,SFTP_ASCII)) + { + echo "
      Get log file from $dstSeverIp Failed"; + echo "

      Back"; + exit(); + } + + $logFileUrl="../../../ftpFile/$logFileName"; + echo "

      Click here to open the log  ($dstSeverIp)."; + } + echo "

      Back"; + exit(); +}elseif(isset($impFile)){ + echo "
      Upload file failed, File isn't exist or file is empty!"; +} +?> + + + +"; +echo ""; +echo ""; +echo "$strConfiguration > MSS License Control"; +echo ""; +echo ""; +$helpId="2.61"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + +

      " name="subsData" enctype="multipart/form-data"> + + +"; + echo ""; + echo ""; +?> + + + + + + + + + + + + +
      "; + echo "$title"; + echo "
      +Note:Import File's size <= bytes +
      Select File: + + +
      +submitStat=$submitStat"; + +if($submitStat == 'DISABLED'){ + echo ""; +}else{ + echo ""; +} + +echo ""; +echo ""; +?> +
      + + + + diff --git a/wxc2_omc/element/mss/link_overview.php b/wxc2_omc/element/mss/link_overview.php new file mode 100755 index 0000000..8a24359 --- /dev/null +++ b/wxc2_omc/element/mss/link_overview.php @@ -0,0 +1,118 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$numberPerPage = 100; //每页纪录数 +$paramTable ='OBJ_222.param_99'; + +$nGetComm = 0; +$nSetComm = 3; + +$sysId ='222_99_99'; + +$linkAttConfArr=array( + array('Linkset no.', '00.0-00.7'), + array('SLC no.', '01.0-01.7'), + array('CPC IP.', '02.0-05.7') +); + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      setInstanceNo=$setInstanceNo"; +if($DEBUG) echo "
      setObjIdStr =$setObjIdStr"; +//========================================================== +//数据处理 +//========================================================== +//处理get/set命令 +if($_SERVER['REQUEST_METHOD'] == "POST"){ + +} + +//========================================================== +//输出并显示数据 +//========================================================== +$objIdStr ='2.5.1'; +if($DEBUG) echo "
      "; +?> + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > Link overview"; +echo ""; +//showHelp($helpId); +echo ""; +echo "

      $strBack"; +echo "

      "; +?> +
      + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$levelWhere = getLevelWhere($objIdStr); +if($DEBUG) echo "
      levelWhere=$levelWhere"; + +$getSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $levelWhere + "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); + +while($rows=mysqli_fetch_array($result)) +{ + $instanceNo=$rows[1]; + $value=$rows[0]; + $linksetNo =getBitValue($value,$linkAttConfArr[0][1]); + $linksetNo =hexdec($linksetNo); + $slcNo =getBitValue($value,$linkAttConfArr[1][1]); + $slcNo =hexdec($slcNo); + if($linksetNo > '127' || $slcNo > '15'){ + continue; + } + $cpcIpHex =getBitValue($value,$linkAttConfArr[2][1]); + $cpcIp = ''; + for($i=0; $i< 4; $i++) + { + $tmp = substr($cpcIpHex, $i*2, 2); + $tmp = hexdec($tmp); + $cpcIp .= "$tmp."; + } + $cpcIp = rtrim($cpcIp,'.'); + + if($objIdStr == $setObjIdStr && $instanceNo == $setInstanceNo){ + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
      No.Linkset no.SLC no.CPC IP
      $instanceNo$linksetNo$slcNo$cpcIp
      + +  + + diff --git a/wxc2_omc/element/mss/linkset_overview.php b/wxc2_omc/element/mss/linkset_overview.php new file mode 100755 index 0000000..5a8b46c --- /dev/null +++ b/wxc2_omc/element/mss/linkset_overview.php @@ -0,0 +1,163 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$db = "OBJ_222"; +$paramTable ='OBJ_222.param_99'; +$objIdStr ='2.4.1'; +$maxNum = 30; + +$nGetComm = 0; +$nSetComm = 3; + +$sysId ='222_99_99'; +$instanceNo ='0'; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; +?> +setInstanceNo=$setInstanceNo"; +if($DEBUG) echo "
      setObjIdStr =$setObjIdStr"; +//========================================================== +//数据处理 +//========================================================== +//处理get/set命令 + +$linksetOid ='2.4.1'; +$objIdStr ='2.4.1'; +$linksetConfArr=array( + array('Linkset DPC','0.0-2.7'), + array('Network indicator','3.0-3.1'), + array('Linkset loopback','3.3-3.3'), + array('Linkset title','7.0-16.7') + ); +$NetIdConfArr=array( + array('00','International'), + array('01','International spare'), + array('10','National'), + array('11','National spare') +); + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > Linkset overview"; +echo ""; +//showHelp($helpId); +echo ""; +echo "

      $strBack"; +echo "

      "; + +echo "
      "; +echo ""; +?> + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +$levelArr=explode('.',$linksetOid); +for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; +} + +$defSql = "SELECT initValue from paramConf + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; +if($DEBUG) echo "defSql=$defSql
      "; +$defRes = mysqli_query($pubConn,$defSql); +$defRow = mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; +if($DEBUG) echo "defaultValue=$defaultValue
      "; + +$getSql="SELECT initValue,instanceNo FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); + +while($rows =mysqli_fetch_array($result)){ + $instanceNo=$rows[instanceNo]; + $value=$rows[0]; + if($rows[initValue] == $defaultValue){ + continue; + } + + + $OPC =getBitValue($value,$linksetConfArr[0][1]); + $OPC = hexdec($OPC); + $NetID =getBitValue($value,$linksetConfArr[1][1]); + $loopFlag =getBitValue($value,$linksetConfArr[2][1]); + $title =toAscii(getBitValue($value,$linksetConfArr[3][1])); + if($objIdStr == $setObjIdStr && $instanceNo == $setInstanceNo){ + echo "
      "; + }else{ + echo ""; + } + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; +} + + + +?> +
      No.TitileOpposite point codeNetwork indicatorLoop back
      "; + echo "$instanceNo$title$OPC"; + if($DEBUG) echo "NetID=$NetID
      "; + for($i=0;$i
      "; + if($DEBUG) echo "loopFlag=$loopFlag
      "; + if($loopFlag > 0){ + echo "Enable"; + }else{ + echo "Disable"; + } + echo "
      + +  + + diff --git a/wxc2_omc/element/mss/loadpps.php b/wxc2_omc/element/mss/loadpps.php new file mode 100755 index 0000000..9fbb74d --- /dev/null +++ b/wxc2_omc/element/mss/loadpps.php @@ -0,0 +1,124 @@ +levelWhere=$levelWhere"; + $ElementInfoParamTable='OBJ_225.param_99'; + $getSql="SELECT initValue,instanceNo FROM $ElementInfoParamTable + WHERE $levelWhere and initValue LIKE '01%' "; + if($DEBUG) + echo "
      getSql=$getSql"; + //exit(); + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $typeOffset = '1.0-1.7'; + $sysNoOffset = '2.0-2.3'; + $subSysNoOffset = '2.4-2.7'; + $tgOffset = '3.0-3.7'; + $lsOffset = '4.0-4.7'; + $appTypeOffset = '5.0-5.7'; + $appGrpOffset = '6.0-6.7'; + $nameOffset = '14.0-23.7'; + $i=0; + $j=0; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $typeValue=hexdec(getBitValue($rows[initValue],$typeOffset)); + $sysNo = bindec(getBitValue($rows[initValue],$sysNoOffset)); + $subsysNo = bindec(getBitValue($rows[initValue],$subSysNoOffset)); + $tmpSystemNo= $sysNo; + $assignedTg = hexdec(getBitValue($rows[initValue],$tgOffset)); + $assignedls = hexdec(getBitValue($rows[initValue],$lsOffset)); + $appType = hexdec(getBitValue($rows[initValue],$appTypeOffset)); + $appGrp = hexdec(getBitValue($rows[initValue],$appGrpOffset)); + $name = trim(toAscii(getBitValue($rows[initValue],$nameOffset))); + $eleInfoNo = $rows[instanceNo]; + if($typeValue==2)//aas + { + } + if($typeValue==3)//VSS + { + $hbSel = "select detailStat from sysStat where sysTypeNo = 390 and sysNo=$sysNo"; + //echo "
      hbSel:$hbSel"; + $hbResult = mysqli_query($pubConn,$hbSel); + if($hbRow=mysqli_fetch_array($hbResult)) + { + $hex_mes=$hbRow[detailStat]; + $licenseCtrl = 80; + $license_ctrl=hexdec(substr($hex_mes,$licenseCtrl*2,2)); + //echo "
      license_ctrl:$license_ctrl"; + if($flag=='srf') + { + if($license_ctrl==2 || $license_ctrl==3) + { + $otherWhereStr = "and subSysNo=$sysNo"; + $getsql_2 = "select initValue from $tmpTable where $objWhereStr $otherWhereStr"; + $result_2 = @mysqli_query($pubConn,$getsql_2); + $row_2 = @mysqli_fetch_array($result_2); + $SCCP_MSISDN_value = str_replace('F','',getBitValue($row_2[0],"01.0-10.7")); + if(strlen($SCCP_MSISDN_value)>0) + { + $vssArr[$i][name]=$name; + $vssArr[$i][srf] = $SCCP_MSISDN_value; + $vssArr[$i][sysNo] = $sysNo; + $i++; + } + } + } + else if($flag=='segment') + { + if($license_ctrl==1 || $license_ctrl==3) + { + $vssArr[$i][name]=$name; + $vssArr[$i][srf] = ''; + $vssArr[$i][sysNo] = $sysNo; + $i++; + } + } + + } + } + } + $vssArr[$i][name] = "None"; + $vssArr[$i][srf] = ''; + $vssArr[$i][sysNo] = -1; +}//end getVssArr. + +getVssArr('segment',$vssSegArr); +session_register("vssSegArr"); + +getVssArr('srf',$vssArr); +session_register("vssArr"); + +if($DEBUG) exit(); +echo ""; + +exit(); +?> \ No newline at end of file diff --git a/wxc2_omc/element/mss/localNode_overview.php b/wxc2_omc/element/mss/localNode_overview.php new file mode 100755 index 0000000..58e8e8d --- /dev/null +++ b/wxc2_omc/element/mss/localNode_overview.php @@ -0,0 +1,213 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$paramTable ='OBJ_223.param_99'; +$maxNum = 30; + +$sysId ='223_99_99'; +$instanceNo ='0'; +$initValue ='initValue'; +$readValue ='readValue'; + +$nGetComm = 0; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +if($DEBUG) echo "
      setObjIdStr = $setObjIdStr"; +if($DEBUG) echo "
      setInstanceNo = $setInstanceNo"; + +//========================================================== +//数据处理 +//========================================================== +$localNodeObjId='2.1'; +$localNodeArr=array( + array('2.1.4', 'OMC'), + array('2.1.6', 'HLR'), + array('2.1.7', 'VLR'), + array('2.1.8', 'MSC'), + array('2.1.9', 'EIR'), + array('2.1.10', 'AUC'), + array('2.1.11', 'SMSC'), + array('2.1.19', 'SMPP-PPS'), + array('2.1.20', 'SMPP-SMSC'), + array('2.1.21', 'SMPP-OMC'), + array('2.1.32', 'MNP'), + array('2.1.146','SSF'), + array('2.1.147','SCF'), + array('2.1.254','AIF') +); + +$localNodeConfArr=array( + array('NetID', '00.0-00.7'), + array('MSISDN', '01.0-10.7'), + array('IP0', '11.0-14.7'), + array('IP1', '15.0-18.7') +); + +$NetIdConfArr=array( + array('0','international'), + array('1','international spare'), + array('2','national'), + array('3','national spare') +); + +if($getFlag==1){ + if($DEBUG) echo "
      sysId=$sysId"; + $objIdStr=$localNodeObjId; + if($DEBUG) echo "
      objIdStr=$objIdStr"; + $commIdStr = sysCommSend($sysId,$nGetComm,$objIdStr); + $showType="Get"; + + $i = 0; + while(1) + { + //echo "
      i=$i"; + if($i == 0) + echo "
      $showType Local node"; + if($i > $maxNum){ + echo "
      Timeout"; + break; + } + echo ""; + flush(); + $sysId = "223_99_99"; + $chkType = "0"; + $chRes=ChComm($sysId,$chkType); + if($chRes == $nOutProc || $chRes == $nProcFail){ + if($chRes == $nProcFail) + echo "
      $remark
      "; + elseif($remark == 'response timeout') + echo "
      $remark
      "; + else + echo "
      $remark
      "; + break; + } + sleep(1); + $i++; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + +
      +"; +echo ""; +echo ""; +echo "Configuration > Network > Local Node"; +echo ""; +//echo ""; +//showHelp($helpId); +//echo ""; +echo ""; +echo "

      $strBack"; +echo ""; +echo ""; +echo ""; +?> +
      + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +for($i=0;$ilevelArr[$j]={$levelArr[$j]}"; + } + $getSql="SELECT $initValue + FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $value=$rows[0]; + //$value =getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName); + $netId =getBitValue($value,$localNodeConfArr[0][1]); + for($j=0;$jvalue=$value"; + if($instanceNo == $setInstanceNo && $objIdStr==$setObjIdStr) + echo "
      "; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> + +
      EntityMSISDNNetwork indicatorIP0 (Server 0)IP1 (Server 1)
      $serverName$msisdn$netIdName$ipStr_0$ipStr_1
      +

      +  + + diff --git a/wxc2_omc/element/mss/local_prefix_edit.php b/wxc2_omc/element/mss/local_prefix_edit.php new file mode 100755 index 0000000..2d38d73 --- /dev/null +++ b/wxc2_omc/element/mss/local_prefix_edit.php @@ -0,0 +1,255 @@ +正在调试中!!"; +?> + + + +"; + echo "cc = $cc
      "; + echo "ndc = $ndc
      "; + echo "IPrefix = $IPrefix
      "; + echo "NPrefix = $NPrefix
      "; +} + +$getsql = "select initValue from $net_Conf where level_1 = '2' and level_2 = '8' and level_3 = '0'"; +$pre_org = @mysqli_query($pubConn,$getsql); +$pre_org = @mysqli_fetch_array($pre_org); +$pre_org = $pre_org[0]; +echo mysqli_error($pubConn); +if($DEBUG) echo "pre_org = $pre_org
      "; + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $xapp_prefix_loc = array('00.0-15.7','16.0-16.7','17.0-17.7','18.0-33.7','34.0-34.7','35.0-35.7','36.0-36.7'); + $xapp_prefix = array( + array( + omc_keep_length(toHex($prefix_new),'0','32','0'), + '00', + omc_keep_length(dechex(strlen($cc.$ndc)),'0','2','1'), + omc_keep_length(toHex($cc.$ndc),'0','32','0'), + '00', + omc_keep_length(dechex($prefix_group_no),'0','2','1'), + '00' + ), + array( + omc_keep_length(toHex($ndc.$prefix_new),'0','32','0'), + '00', + omc_keep_length(dechex(strlen($cc)),'0','2','1'), + omc_keep_length(toHex($cc),'0','32','0'), + '00', + omc_keep_length(dechex($prefix_group_no),'0','2','1'), + '01' + ), + array( + omc_keep_length(toHex($NPrefix.$ndc.$prefix_new),'0','32','0'), + omc_keep_length(dechex(strlen($NPrefix)),'0','2','1'), + omc_keep_length(dechex(strlen($cc)),'0','2','1'), + omc_keep_length(toHex($cc),'0','32','0'), + '00', + omc_keep_length(dechex($prefix_group_no),'0','2','1'), + '02' + ), + array( + omc_keep_length(toHex($cc.$ndc.$prefix_new),'0','32','0'), + '00', + '00', + omc_keep_length('0','0','32','0'), + '00', + omc_keep_length(dechex($prefix_group_no),'0','2','1'), + '03' + ), + array( + omc_keep_length(toHex($IPrefix.$cc.$ndc.$prefix_new),'0','32','0'), + omc_keep_length(dechex(strlen($IPrefix)),'0','2','1'), + '00', + omc_keep_length('0','0','32','0'), + '00', + omc_keep_length(dechex($prefix_group_no),'0','2','1'), + '04' + ), + ); + + if(isset($addFlag)) //add a prefix group + { + $getsql = "select instanceNo from $sqltable where level_1 = '2' and level_2 = '8' and level_3 = '0' + and initValue = '$pre_org'"; + $result = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $i = 0; + while($row = @mysqli_fetch_array($result)) + { + $prefix_ins[$i] = $row[instanceNo]; + if($DEBUG) echo "
      prefix instanceNo[$i] = $prefix_ins[$i]"; + + if(++$i >= sizeof($xapp_prefix)) + break; + } + } + else //edit a prefix group + { + $getsql = "select instanceNo from $sqltable where level_1 = '2' and level_2 = '8' and level_3 = '0' + and initValue != '$pre_org'"; + $result = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $i = 0; + while($row = @mysqli_fetch_array($result)) + { + $prefix_ins[$i] = $row[instanceNo]; + if(++$i >= sizeof($xapp_prefix)) + break; + } + if($i < sizeof($xapp_prefix)) + { + $getsql = "select instanceNo from $sqltable where level_1 = '2' and level_2 = '8' and level_3 = '0' + and initValue = '$pre_org'"; + $result = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + while($row = @mysqli_fetch_array($result)) + { + $prefix_ins[$i] = $row[instanceNo]; + if(++$i >= sizeof($xapp_prefix)) + break; + } + } + if($DEBUG) + { + for($i=0; $i < sizeof($prefix_ins); $i++) + echo "
      prefix_ins[$i] = $prefix_ins[$i]"; + } + } + + if(sizeof($prefix_ins) < sizeof($xapp_prefix) || $prefix_group_no < 0) + { + echo ""; + } + else + { + for($k=0; $k < sizeof($xapp_prefix); $k++) + { + $initValue = omc_keep_length($initValue,'0',strlen($pre_org)); + for($j=0; $j < sizeof($xapp_prefix[$k]); $j++) + $initValue = setBitValue($initValue,$xapp_prefix_loc[$j],$xapp_prefix[$k][$j]); + + $setsql = "update $sqltable set initValue = '$initValue' + where level_1 = '2' and level_2 = '8' and instanceNo = '$prefix_ins[$k]'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + } + + echo ""; +} + + +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > Element > MSC "; +echo ""; +showHelp($helpId); +echo "
      "; +echo "
      "; + +$getsql = "select initValue from $sqltable where level_1 = '2' and level_2 = '8' and level_3 = '0' + and initValue != '$pre_org'"; +$result = @mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); +if($prefix_group_no > 0) //edit a prefix group +{ + while($row = @mysqli_fetch_array($result)) + { + $tmpGroupNo = hexdec(getbitValue($row[initValue],'35.0-35.7')); + $tmpPrefixType = hexdec(getbitValue($row[initValue],'36.0-36.7')); + if($tmpGroupNo == $prefix_group_no && $tmpPrefixType == 0) + { + $prefix = trim(toAscii(getBitValue($row[initValue],'00.0-15.7'))); + if($DEBUG) + { + echo "
      tmpGroupNo = $tmpGroupNo"; + echo "
      tmpPrefixType = $tmpPrefixType"; + } + break; + } + } +} +else //found a unused prefix group no. +{ + $i = 0; + while($row = @mysqli_fetch_array($result)) + $tmpGroupNo[$i++] = getbitValue($row[initValue],'35.0-35.7'); + + for($j=1; $j < 256; $j++) + { + $tmpFlag = 0; + for($k=0; $k < $i; $k++) + { + if($j == $tmpGroupNo[$k]) + $tmpFlag = 1; + } + if($tmpFlag == 0) + { + $prefix_group_no = $j; + break; + } + } + echo ""; +} + + +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Local prefix:  "; +echo ""; +echo ""; +echo "

      $strBack"; +echo "

      "; +?> + + + +"; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      ParametersValue
      Local prefix
      "; + +?> + +"; +?> diff --git a/wxc2_omc/element/mss/loop_back.php b/wxc2_omc/element/mss/loop_back.php new file mode 100755 index 0000000..fbc1561 --- /dev/null +++ b/wxc2_omc/element/mss/loop_back.php @@ -0,0 +1,895 @@ +正在调试中!!"; +?> + + + +"; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = omc_keep_length($mss_ip[0],'0','8'); + $mss_ip[1] = omc_keep_length($mss_ip[1],'0','8'); + if($DEBUG) + { + echo "
      mss0_ip = $mss_ip[0]
      "; + echo "mss1_ip = $mss_ip[1]
      "; + } +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + //update E1 port + { + $failFlag = 0; + if($DEBUG) + { + echo "e1_num = $e1_num
      "; + echo "avail_cic = $avail_cic
      "; + } + + for($i=0; $i < $e1_num; $i++) + { + $org_253 = ${'e1_253_org_'.$i}; + $org_254 = ${'e1_254_org_'.$i}; + + $new_253 = ${'e1_253_'.$i}; + $new_254 = ${'e1_254_'.$i}; + + $e1_cic_org = ${'e1_cic_'.$i}; + + if($DEBUG) + { + echo "
      org_253 = $org_253
      "; + echo "org_254 = $org_254
      "; + echo "new_253 = $new_253
      "; + echo "new_254 = $new_254
      "; + echo "e1_cic_org = $e1_cic_org
      "; + } + + if($new_253 == '' || $new_254 == '') + { + echo ""; + $failFlag = 1; + continue; + } + + //if($org_253 == $new_253 && $org_254 == $new_254) + //continue; + + $flag_253 = 0; + $flag_254 = 0; + $flag_126 = 0; + $flag_127 = 0; + if($org_253 != $new_253) + { + $objWhereStr = getLevelWhere($e1_oid[4]); + $getsql = "SELECT initValue FROM $msc_paramTable where $objWhereStr and instanceNo = '$new_253'"; + if($DEBUG) echo "getsql = $getsql
      "; + $init_253 = @mysqli_query($pubConn,$getsql); + $init_253 = mysqli_fetch_array($init_253); + $init_253 = $init_253[0]; + $flag_253 = getBitValue($init_253,'0.0-0.0'); + + $objWhereStr = getLevelWhere($link_oid); + $getsql = "SELECT initValue FROM $mtp3_sqltable where $objWhereStr and instanceNo = '$new_253'"; + if($DEBUG) echo "getsql = $getsql
      "; + $link_init = @mysqli_query($pubConn,$getsql); + $link_init = mysqli_fetch_array($link_init); + $link_init = $link_init[0]; + $flag_126 = getBitValue($link_init,'06.5-06.5'); + } + + if($org_254 != $new_254) + { + $objWhereStr = getLevelWhere($e1_oid[4]); + $getsql = "SELECT initValue FROM $msc_paramTable where $objWhereStr and instanceNo = '$new_254'"; + if($DEBUG) echo "getsql = $getsql
      "; + $init_254 = @mysqli_query($pubConn,$getsql); + $init_254 = mysqli_fetch_array($init_254); + $init_254 = $init_254[0]; + $flag_254 = getBitValue($init_254,'0.0-0.0'); + + $objWhereStr = getLevelWhere($link_oid); + $getsql = "SELECT initValue FROM $mtp3_sqltable where $objWhereStr and instanceNo = '$new_254'"; + if($DEBUG) echo "getsql = $getsql
      "; + $link_init = @mysqli_query($pubConn,$getsql); + $link_init = mysqli_fetch_array($link_init); + $link_init = $link_init[0]; + $flag_127 = getBitValue($link_init,'06.5-06.5'); + } + + if($flag_253 == 1 || $flag_254 == 1 || $flag_126 == 1 || $flag_127 == 1) + { + if($flag_253 == 1 || $falg_126 == 1) $alert_no = $new_253; + else $alert_no = $new_254; + + echo ""; + $failFlag = 1; + continue; + } + //update + if($e1_cic_org == (hexdec('FF')+1)/32) + $cic_init = $avail_cic; + else + $cic_init = $e1_cic_org; + if($cic_init >= 8) + { + echo ""; + $failFlag = 1; + continue; + } + + $slc_no = $cic_init; + $slc_no = omc_keep_length(dechex($slc_no),'0','2'); + $cic_init = $cic_init * 32; + $cic_init = omc_keep_length(dechex($cic_init),'0','2'); + + if($mss_ip[0] != '' and $mss_ip[1] != '') + { + $link_init_arr = array('7E00AC12620101000000000000000000000007','7F00AC12630101000000000000000000000007'); + $link_init_arr[0] = setBitValue($link_init_arr[0],'02.0-05.7',$mss_ip[0]); + $link_init_arr[0] = setBitValue($link_init_arr[0],'15.0-18.7',$mss_ip[1]); + $link_init_arr[1] = setBitValue($link_init_arr[1],'02.0-05.7',$mss_ip[1]); + $link_init_arr[1] = setBitValue($link_init_arr[1],'15.0-18.7',$mss_ip[0]); + } + + for($k=253; $k < 255; $k++) + { + $org = ${'org_'.$k}; + $new = ${'new_'.$k}; + if($org != $new && $org != '') + { + $objWhereStr = getLevelWhere($e1_oid[1]);//e1 interface + $setsql = "update $msc_paramTable set initValue = '00' where $objWhereStr and instanceNo = '$org'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($e1_oid[2]);//assign tg to e1 + $setsql = "update $msc_paramTable set initValue = 'EE' where $objWhereStr and instanceNo = '$org'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($e1_oid[3]);//cic + $setsql = "update $msc_paramTable set initValue = '00' where $objWhereStr and instanceNo = '$org'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($e1_oid[4]);//e1 flag + $setsql = "update $msc_paramTable set initValue = '00' where $objWhereStr and instanceNo = '$org'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($link_oid); + $setsql = "update $mtp3_sqltable set initValue = '8000FFFFFFFF000000000000000000FFFFFFFF' + where $objWhereStr and instanceNo = '$org'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + } + + $objWhereStr = getLevelWhere($e1_oid[1]);//'01 = ISUP' + $setsql = "update $msc_paramTable set initValue = '01' where $objWhereStr and instanceNo = '$new'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $tg_init = dechex($k); + $objWhereStr = getLevelWhere($e1_oid[2]); + $setsql = "update $msc_paramTable set initValue = '$tg_init' where $objWhereStr and instanceNo = '$new'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($e1_oid[3]); + $setsql = "update $msc_paramTable set initValue = '$cic_init' where $objWhereStr and instanceNo = '$new'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($e1_oid[4]); + $setsql = "update $msc_paramTable set initValue = '03' where $objWhereStr and instanceNo = '$new'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $index = $k - 253; + $e1_link_init = setBitValue($link_init_arr[$index],'01.0-01.7',$slc_no); + $e1_link_init = setBitValue($e1_link_init,'08.0-08.7',$slc_no); + $e1_link_init = strtoupper($e1_link_init); + $objWhereStr = getLevelWhere($link_oid); + $setsql = "update $mtp3_sqltable set initValue = '$e1_link_init' where $objWhereStr and instanceNo = '$new'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + //open k8e1 enable + open8ke1Enable($new,1); + } + } + } + //update Loopback trunk group + { + $spcTree_array = array( + array('International', '14-bit', 'spc_int_14', '2.3.1'), + array('International spare','14-bit', 'spc_int_sp_14', '2.3.2'), + array('National', '14-bit', 'spc_nat_14', '2.3.3'), + array('National spare', '14-bit', 'spc_nat_sp_14', '2.3.4'), + array('International', '24-bit', 'spc_int_24', '2.3.5'), + array('International spare','24-bit', 'spc_int_sp_24', '2.3.6'), + array('National', '24-bit', 'spc_nat_24', '2.3.7'), + array('National spare', '24-bit', 'spc_nat_sp_24', '2.3.8') + ); + + $querysql = "select initValue from $mtp3_sqltable where level_1 = '2' and level_2 = '2' and level_3 = '0'"; + $result = mysqli_query($pubConn,$querysql); + $indicator = mysqli_fetch_array($result); + echo mysqli_error($pubConn); + if($DEBUG)echo "
      indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } + + for($i = 0; $i < 4; $i ++) + { + $level_array = explode('.',$spcTree_array[$spc_index[$i]][3]); + + for($j = 0;$j < sizeof($level_array);$j ++) + { + $level_no = $j + 1; + ${level_.$level_no} = $level_array[$j]; + } + $getsql = "select initValue from $mtp3_sqltable + where level_1 = '$level_1' and level_2 = '$level_2' and level_3 = '$level_3' "; + $result = mysqli_query($pubConn,$getsql); + $row[$i] = mysqli_fetch_array($result); + $row[$i] = $row[$i][0]; + if($DEBUG)echo "getsql = $getsql
      "; + if($DEBUG)echo "spc_$i=$row[$i]
      "; + } + +// $dpc1 = dechex(hexdec($row[3]) + 1);//14bit NS +// $dpc2 = dechex(hexdec($row[3]) + 2); + $dpc1 = dechex(253);//arwean modified 2006-8-21 15:43 + $dpc2 = dechex(254); + + $initValue_126 = '0000000F00000000000000000000000000000000'; + $initValue_127 = '0000000F00000000000000000000000000000000'; + + $dpc1 = omc_keep_length($dpc1,'0','6'); + $dpc2 = omc_keep_length($dpc2,'0','6'); + + $initValue_126 = strtoupper(setBitValue($initValue_126,'0.0-2.7',$dpc1)); + $initValue_127 = strtoupper(setBitValue($initValue_127,'0.0-2.7',$dpc2)); + + $objWhereStr = getLevelWhere($linkset_oid);//2.4.1 + $setsql = "update $mtp3_sqltable set initValue = '$initValue_126' where $objWhereStr and instanceNo = '126'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $setsql = "update $mtp3_sqltable set initValue = '$initValue_127' where $objWhereStr and instanceNo = '127'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $initValue_254 = '0000007E80'; + $initValue_255 = '0000007F80'; + + $initValue_254 = setBitValue($initValue_254,'0.0-2.7',$dpc1); + $initValue_255 = setBitValue($initValue_255,'0.0-2.7',$dpc2); + + $objWhereStr = getLevelWhere($route_oid);//2.6.4 + $setsql = "update $mtp3_sqltable set initValue = '$initValue_254' where $objWhereStr and instanceNo = '254'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $setsql = "update $mtp3_sqltable set initValue = '$initValue_255' where $objWhereStr and instanceNo = '255'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + //====old + //$initValue_253 = '000000FD730304FE0000EE0000000000'; + //$initValue_254 = '000000FE330341FF0000EE0000000000'; + //====new + $initValue_253 = '000000FD450304FE00006E0000000000'; + + $initValue_254 = '000000FE450341FD00006E0000000000'; + + $dpc1 = omc_keep_length($dpc1,'0','8'); + $dpc2 = omc_keep_length($dpc2,'0','8'); + $initValue_253 = strtoupper(setBitValue($initValue_253,'0.0-3.7',$dpc1)); + $initValue_254 = strtoupper(setBitValue($initValue_254,'0.0-3.7',$dpc2)); + + $objWhereStr = getLevelWhere($e1_oid[0]); + $setsql = "update $msc_paramTable set initValue = '$initValue_253' where $objWhereStr and instanceNo = '253'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $setsql = "update $msc_paramTable set initValue = '$initValue_254' where $objWhereStr and instanceNo = '254'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $initValue_252 = '01010000000000'; + $initValue_253 = '01000000000000'; + + $initValue_252 = setBitValue($initValue_252,'03.0-06.7',$mss_ip[1]); + $initValue_253 = setBitValue($initValue_253,'03.0-06.7',$mss_ip[0]); + + $objWhereStr = getLevelWhere($sg_oid); + $setsql = "update $mtp3_sqltable set initValue = '$initValue_252' where $objWhereStr and instanceNo = '252'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $setsql = "update $mtp3_sqltable set initValue = '$initValue_253' where $objWhereStr and instanceNo = '253'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + } + //update serverd tg + for($i=0; $i< $tg_no; $i++) + { + $checkboxName=${"servedTg_$i"}; + $inst = ${"servedTgIns_$i"}; + $objWhereStr = getLevelWhere($e1_oid[0]); + $getsql = "SELECT initValue FROM $msc_paramTable where $objWhereStr and instanceNo = '$inst'"; + if($DEBUG) echo "getsql = $getsql
      "; + $tg_init = @mysqli_query($pubConn,$getsql); + $tg_init = mysqli_fetch_array($tg_init); + $tg_init = $tg_init[0]; + + if(isset($checkboxName)) + { + $setValue='FD'; + $tg_init = setBitValue($tg_init,'4.6-4.6','1'); + } + + else + { + $setValue='FF'; + $tg_init = setBitValue($tg_init,'4.6-4.6','0'); + } + + $tg_init = setBitValue($tg_init,'7.0-7.7',$setValue); + + $objWhereStr = getLevelWhere($e1_oid[0]); + $setsql = "update $msc_paramTable set initValue = '$tg_init' where $objWhereStr and instanceNo = '$inst'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + }//end update servered tg. + if(!$DEBUG && $failFlag) + { + echo ""; + } + else if(!$DEBUG && isset($Set)) + { + echo ""; + } +} + +if(isset($delflag)) +{ + if($delflag == 'e1') + { + for($i=1;$i < 3; $i++) + { + $instanceNo = ${'delValue'.$i}; + delete_e1($instanceNo); + //disable 8ke1. + open8ke1Enable($instanceNo,0); + } + } + else if($delflag == 'tg') + { + $objWhereStr = getLevelWhere($e1_oid[0]); + $getsql = "SELECT initValue FROM $msc_paramTable where $objWhereStr and instanceNo = '$delValue'"; + if($DEBUG) echo "getsql = $getsql
      "; + $tg_init = @mysqli_query($pubConn,$getsql); + $tg_init = mysqli_fetch_array($tg_init); + $tg_init = $tg_init[0]; + if($setValue=='FF') + $tg_init = setBitValue($tg_init,'4.6-4.6','0'); + else + $tg_init = setBitValue($tg_init,'4.6-4.6','1'); + + $tg_init = setBitValue($tg_init,'7.0-7.7',$setValue); + + $objWhereStr = getLevelWhere($e1_oid[0]); + $setsql = "update $msc_paramTable set initValue = '$tg_init' where $objWhereStr and instanceNo = '$delValue'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + } + if(!$DEBUG) + { + echo ""; + } + +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > Network > MSC > Loopback"; +echo ""; +//showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo "
       "; +//echo "MSS interconnection:  "; +echo ""; +echo ""; +echo "    "; +echo ""; +echo "$strBack"; +echo "
      "; +?> + +"; + $e1_link_result = @mysqli_query($pubConn,$getsql); + + $objWhereStr = getLevelWhere($e1_oid[2]);//2.4.2 asign tg to e1 + $defSql = "select initValue from $msc_parConfTable where $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $defValue = $defRow[0]; + + $getsql="SELECT initValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND initValue != '$defValue' "; + if($DEBUG) echo "getsql = $getsql
      "; + $result = @mysqli_query($pubConn,$getsql); + $e1_253_num = 0; + $e1_254_num = 0; + $e1_e1_num = 0; + while($e1_tg = mysqli_fetch_array($result)) + { + $insNo = $e1_tg[instanceNo]; + $e1_tg = hexdec($e1_tg[0]); + + $objWhereStr = getLevelWhere($e1_oid[3]);//2.4.3 cic of e1 + $getsql = "SELECT initValue FROM $msc_paramTable where $objWhereStr and instanceNo = '$insNo'"; + if($DEBUG) echo "getsql = $getsql
      "; + $e1_cic = mysqli_query($pubConn,$getsql); + $e1_cic = mysqli_fetch_array($e1_cic); + $e1_cic = hexdec($e1_cic[0]); + + if($e1_tg == 253) + { + $e1_253[$e1_253_num] = $insNo; + $e1_253_cic[$e1_253_num] = $e1_cic; + $e1_253_num++; + + } + else if ($e1_tg == 254) + { + $e1_254[$e1_254_num] = $insNo; + $e1_254_cic[$e1_254_num] = $e1_cic; + $e1_254_num++; + } + } + + if(isset($e1_new)) + { + $e1_254[$e1_254_num] = ''; + $e1_254_cic[$e1_254_num] = hexdec('FF')+1; + $e1_254_num++; + + $e1_253[$e1_253_num] = ''; + $e1_253_cic[$e1_253_num] = hexdec('FF')+1; + $e1_253_num++; + } + + $total_num = ($e1_253_num >= $e1_254_num) ? $e1_253_num : $e1_254_num; + + if($DEBUG) echo "e1_253_num = $e1_253_num
      "; + if($DEBUG) echo "e1_254_num = $e1_254_num
      "; + if($DEBUG) echo "total_num = $total_num
      "; + + if($total_num == 0) + $e1_nrow = 2; + else + $e1_nrow = $total_num + 1; + echo ""; + echo ""; + echo ""; + echo ""; + + if($total_num == 0) + { + echo ""; + echo ""; + echo ""; + } + + + //used for exception handle + //用于处理tg 253和tg 254对应的e1 link数目不一致的情况 + { + + $e1_253_cic[$total_num] = hexdec('FF')+2; + $e1_254_cic[$total_num] = hexdec('FF')+2; + //$e1_253[$total_num] = -1; + //$e1_254[$total_num] = -1; + } + for($i=0; $i < $total_num; $i++) + { + $e1_253_min = 0; + $e1_254_min = 0; + for($j=0; $j < $total_num; $j++) + { + if($DEBUG) echo "
      e1_253_cic[$j]=$e1_253_cic[$j]
      "; + if($DEBUG) echo "e1_254_cic[$j]=$e1_254_cic[$j]
      "; + if(!isset($e1_253_cic[$j])) $e1_253_cic[$j] = hexdec('FF')+2;//used for exception handle + if($e1_253_cic[$j] < $e1_253_cic[$e1_253_min]) + { + $e1_253_min = $j; + } + if(!isset($e1_254_cic[$j])) $e1_254_cic[$j] = hexdec('FF')+2;//used for exception handle + if($e1_254_cic[$j] < $e1_254_cic[$e1_254_min]) + { + $e1_254_min = $j; + } + } + //used for exception handle + if($e1_253_cic[$e1_253_min] != $e1_254_cic[$e1_254_min]) + { + if($e1_253_cic[$e1_253_min] > $e1_254_cic[$e1_254_min]) + { + $e1_253_min = $total_num; + $cur_cic = $e1_254_cic[$e1_254_min] / 32; + } + else + { + $e1_254_min = $total_num; + $cur_cic = $e1_253_cic[$e1_253_min] / 32; + } + } + else + $cur_cic = $e1_254_cic[$e1_254_min] / 32; + + if($DEBUG) echo "
      e1_253_cic[$e1_253_min] = $e1_253_cic[$e1_253_min]
      "; + if($DEBUG) echo "e1_254_cic[$e1_254_min] = $e1_254_cic[$e1_254_min]
      "; + if($DEBUG) echo "cur_cic = $cur_cic
      "; + + //if($e1_254_cic[$e1_254_min] != $e1_253_cic[$e1_253_min]) + //continue; + + echo ""; + echo ""; + echo ""; + + if($cur_cic != $i && !isset($unused_cic)) + { + $unused_cic = $i; + echo ""; + } + echo ""; + echo ""; + echo ""; + + $e1_253_cic[$e1_253_min] = hexdec('FF')+2; + $e1_254_cic[$e1_254_min] = hexdec('FF')+2; + } + if(!isset($unused_cic)) + { + $unused_cic = $cur_cic + 1; + echo ""; + } + echo ""; +} +//output Trunk group +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +//output Served trunk group +{ + {//get linkset name. + $levelWhere = getLevelWhere('2.4.1'); + $sqlTab = "OBJ_222.param_99"; + $selSql = "select initValue from $sqlTab where $levelWhere"; + if($DEBUG) echo "
      Line ". __LINE__ . ": $selSql"; + $result =mysqli_query($pubConn,$selSql); + $i=0; + while($rows=mysqli_fetch_array($result)) + { + $enable=getBitValue($rows[initValue],'3.2-3.2'); + if($enable) + { + $linksetArr[$i][dpc]=hexdec(getBitValue($rows[initValue],'0.0-2.7')); + $linksetArr[$i][name] = getBitValue($rows[initValue],'7.0-16.7'); + $i++; + } + } + }//end get linkset name. + $objWhereStr = getLevelWhere($e1_oid[0]); + $defSql = "select initValue from $msc_parConfTable where $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = mysqli_fetch_array($defRes); + $getsql = "SELECT initValue,instanceNo FROM $msc_paramTable where $objWhereStr and initValue!='{$defRow[initValue]}'"; + if($DEBUG) + echo "getsql = $getsql
      "; + + + + + $result = @mysqli_query($pubConn,$getsql); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + +echo ""; +?> +
      "; + echo ""; + echo ""; + echo ""; + echo "
      E1 port
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      MSS0(0-127)MSS1(128-255)Delete
      "; + echo ""; + echo ""; + echo ""; + echo "
      ----
      "; + if(isset($e1_new) && $i==$e1_253_num-1) + { + $objDb = "OBJ_322"; + $paramTable = "param_99"; + $objIdStr='2.4.2'; + $objWhereStr =getLevelWhere($objIdStr); + {//e1_253 + echo ""; + } + {//e1_254 + echo ""; + } + } + else + { + echo ""; + echo ""; + } + if(!isset($e1_new) || ($i != $e1_253_num-1)) + { + if(!isset($e1_253[$e1_253_min])) $e1_253[$e1_253_min] = -1;//used for exception handle + if(!isset($e1_254[$e1_254_min])) $e1_254[$e1_254_min] = -1;//used for exception handle + + echo ""; + } + echo ""; + echo "
      "; + $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND initValue = 'EE' and instanceNo<'128' + "; + // $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr "; + $result=mysqli_query($pubConn,$getInstanceSql); + + //echo "
      $getInstanceSql"; + echo ""; + echo "
      "; + $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND initValue = 'EE' and instanceNo>'127' + "; + // $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr "; + $result=mysqli_query($pubConn,$getInstanceSql); + + //echo "
      $getInstanceSql"; + echo ""; + echo "
      Loopback trunk group"; + echo ""; + echo ""; + echo ""; + echo "
      253254
      Served trunk group"; + $i=0; + while($tgRows = mysqli_fetch_array($result)) + { + if($tgRows[instanceNo]==253 || $tgRows[instanceNo]== 254||$tgRows[instanceNo]==250||$tgRows[instanceNo]==251||$tgRows[instanceNo]==252||$tgRows[instanceNo]==255) + continue; + $tg_row = $tgRows[0]; + $enable_flag = getBitValue($tg_row,'4.0-4.0'); + if($enable_flag==1) + { + $alter_TG = hexdec(getBitValue($tg_row,'7.0-7.7')); + $alterTgFlag = getBitValue($tg_row,'4.6-4.6'); + $DPC = hexdec(getBitValue($tg_row,'0.0-3.7')); + for($j=0; $j< sizeof($linksetArr); $j++) + { + if($DPC == $linksetArr[$j][dpc]) + { + $linksetName = trim(toAscii($linksetArr[$j][name])); + break; + } + } + if(!isset($linksetName) || ord($linksetName)==0) + $linksetName = 'TG_'.$tgRows[instanceNo]; + if($linksetName==='CNF Center') + continue; + if($i%5==0) + echo ""; + echo ""; + unset($linksetName); + $i++; + } + } + echo "
      "; + if($alterTgFlag == 1 && $alter_TG == 253) + $checkedStr = 'checked'; + else + $checkedStr = ''; + echo "$linksetName";//onClick=\"javascript:slctTG(this,'tg',$tgRows[instanceNo])\" + echo ""; + echo "
      diff --git a/wxc2_omc/element/mss/mg_edit.php b/wxc2_omc/element/mss/mg_edit.php new file mode 100755 index 0000000..2454c0c --- /dev/null +++ b/wxc2_omc/element/mss/mg_edit.php @@ -0,0 +1,506 @@ +正在调试中!!"; +?> + + + +"; +$result = @mysqli_query($pubConn,$getsql); +$loc_num = 0; +while($row = @mysqli_fetch_array($result)) +{ + $loc_arr[$loc_num][0] = $row[keyId]; + $loc_arr[$loc_num][1] = $row[Location_name]; + + if($DEBUG) + { + echo "loc_arr[$loc_num][0] = {$loc_arr[$loc_num][0]}
      "; + echo "loc_arr[$loc_num][1] = {$loc_arr[$loc_num][1]}
      "; + } + $loc_num++; +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if($DEBUG) echo "mg_num = $mg_num
      "; + for($i=0;$i < $mg_num;$i++) + { + $ip = ''; + $ipname =256; + for($j=0; $j < 4; $j++) + { + $tmp = "mg_".$i."_ip".$j; + $tmp = ${$tmp}; + + if($ipname==256) + $ipname =$tmp; + else + $ipname =$ipname.'.'.$tmp; + + $tmp = dechex($tmp); + $tmp = omc_keep_length($tmp,'0','2'); + if($DEBUG) echo "mg_$i_$j = $tmp
      "; + $ip .= $tmp; + } + if($DEBUG) echo "mg_ip = $ip
      "; + $initValue = ''; + $initValue = omc_keep_length($initValue,'0','106'); + $initValue = setBitValue($initValue,'0.0-0.0','1'); + $initValue = setBitValue($initValue,'0.4-0.7',1); + $initValue = setBitValue($initValue,'1.0-4.7',$ip); + if($DEBUG) echo "initValue = $initValue
      "; + + $tmp = toHex($ipname); + $tmp = omc_keep_length($tmp,'0','64','0'); + $initValue = setBitValue($initValue,'5.0-36.7',$tmp); + + $tmp = 'mg_unit_num_'.$i; + $tmp = toHex($loc_arr[${$tmp}][1]); + $tmp = omc_keep_length($tmp,'0','20','0'); + $initValue = setBitValue($initValue,'37.0-46.7',$tmp); + + $tmp = 'mg_unit_num_'.$i; + $tmp = omc_keep_length(decHex($showNum_to_unitNum[${$tmp}]),"0","2"); + $initValue = setBitValue($initValue,'51.0-51.7',$tmp); + + $tmp = 'mg_dev_num_'.$i; + $tmp = omc_keep_length(decHex(${$tmp}),"0","2"); + $initValue = setBitValue($initValue,'52.0-52.7',$tmp); + + if($DEBUG) echo "initValue = $initValue
      "; + $levelArr=explode('.',$mg_oid); + for($j=0;$j"; + } + + if($DEBUG) echo "sg_num = $sg_num
      "; + for($i=0;$i < $sg_num;$i++) + { + $ip = ''; + for($j=0; $j<4; $j++) + { + $tmp = "sg_".$i."_ip".$j; + $tmp = ${$tmp}; + $tmp = dechex($tmp); + $tmp = omc_keep_length($tmp,'0','2'); + if($DEBUG) echo "sg_$i_ip$j = $tmp
      "; + $ip .= $tmp; + } + if($DEBUG) echo "sg_ip = $ip
      "; + $initValue = ''; + $initValue = omc_keep_length($initValue,'0','14'); + $sg_mode_val = omc_keep_length(${'sg_mode_'.$i},'0','2'); + $sg_ack_val = omc_keep_length(${'sg_ack_'.$i},'0','2'); + $initValue = setBitValue($initValue,'00.0-00.7','01'); + $initValue = setBitValue($initValue,'01.0-01.7',$sg_mode_val); + $initValue = setBitValue($initValue,'02.0-02.7',$sg_ack_val); + $initValue = setBitValue($initValue,'03.0-06.7',$ip); + if($DEBUG) echo "initValue = $initValue
      "; + $levelArr=explode('.',$sg_oid); + for($j=0;$j"; + } + + if(isset($mg_new) || isset($sg_new)) + { + if($DEBUG) + { + echo "mg_unused = $mg_ins_no
      "; + echo "sg_unused = $sg_ins_no
      "; + } + if(isset($mg_new) && $mg_num != 16) + { + $initValue = ''; + $initValue = omc_keep_length($initValue,'0','106'); + $initValue = setBitValue($initValue,'00.0-00.0','1'); + $initValue = setBitValue($initValue,'0.4-0.7',1); + $tmp = toHex("0.0.0.0"); + $tmp = omc_keep_length($tmp,'0','64','0'); + $initValue = setBitValue($initValue,'5.0-36.7',$tmp); + $levelArr=explode('.',$mg_oid); + for($j=0;$j"; + } + else if(isset($sg_new) && $sg_num != 256) + { + $initValue = ''; + $initValue = omc_keep_length($initValue,'0','14'); + $initValue = setBitValue($initValue,'00.0-00.7','01'); + $levelArr=explode('.',$sg_oid); + for($j=0;$j"; + } + } + else if(!$DEBUG) + { + echo ""; + } +} + +if(isset($delflag)) +{ + if($delflag == 'mg') + { + if($DEBUG) echo "delValue = $delValue
      "; + $initValue = ''; + $initValue = omc_keep_length($initValue,'0','106'); + $initValue = setBitValue($initValue,'00.0-00.0','0'); + $levelArr=explode('.',$mg_oid); + for($j=0;$j"; + } + else + { + if($DEBUG) echo "delValue = $delValue
      "; + $initValue = ''; + $initValue = omc_keep_length($initValue,'0','14'); + $initValue = setBitValue($initValue,'00.0-00.7','00'); + $levelArr=explode('.',$sg_oid); + for($j=0;$j"; + } +} +//========================================================== +//取数据库数据 +//========================================================== +$levelArr=explode('.',$mg_oid); +for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; +} +$getsql = "SELECT initValue FROM $mg_sqltable +where level_1='$level_1' and level_2 = '$level_2' and level_3 = '$level_3'"; +if($DEBUG) echo "getsql = $getsql
      "; +$mg_result = @mysqli_query($pubConn,$getsql); +$i = 0; +$mg_num = 0; +while($mg_row = @mysqli_fetch_array($mg_result)) +{ + $mg_row = $mg_row[0]; + $enable_flag = getBitValue($mg_row,'0.0-0.0'); + $mg_type = getBitValue($mg_row,'0.4-0.7'); + //echo "mg_row $i = $mg_row
      "; + if($enable_flag == 1 && $mg_type == 1) + { + $mg_name[$mg_num] = trim(toascii(getBitValue($mg_row,'5.0-36.7'))); + $mg_ip_tmp = getBitValue($mg_row,'1.0-4.7'); + $mg_unit_num[$mg_num]=$tmpnum=hexdec(getBitValue($mg_row,'51.0-51.7')); + $mg_dev_num[$mg_num]=$tmpnum=hexdec(getBitValue($mg_row,'52.0-52.7')); + $unitnumflag[$tmpnum]=1; + $mg_ip[$mg_num][0] = hexdec(getBitValue($mg_ip_tmp,'0.0-0.7')); + $mg_ip[$mg_num][1] = hexdec(getBitValue($mg_ip_tmp,'1.0-1.7')); + $mg_ip[$mg_num][2] = hexdec(getBitValue($mg_ip_tmp,'2.0-2.7')); + $mg_ip[$mg_num][3] = hexdec(getBitValue($mg_ip_tmp,'3.0-3.7')); + $mg_ins[$mg_num] = $i; + if($DEBUG) + { + echo "mg_unit_num = $mg_unit_num[$mg_num]
      "; + $index = $mg_dev_num[$mg_num]; + echo "mg_dev_num = $unitNum_to_showNum[$index]
      "; + echo "mg_ins = $mg_ins[$mg_num]
      "; + echo "mg_name = $mg_name[$mg_num]
      "; + echo "mg_ip = $mg_ip_tmp
      "; + } + $mg_num++; + } + else if($enable_flag == 0 && !isset($mg_unuesd)) + $mg_unuesd = $i; + $i++; +} + +$levelArr=explode('.',$sg_oid); +for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; +} +$getsql = "SELECT initValue FROM $sg_sqltable +where level_1='$level_1' and level_2 = '$level_2' and level_3 = '$level_3'"; +if($DEBUG) echo "getsql = $getsql
      "; +$sg_result = @mysqli_query($pubConn,$getsql); + +$k = 0; +$sg_num = 0; +while($sg_row = @mysqli_fetch_array($sg_result)) +{ + $sg_row = $sg_row[0]; + $enable_flag = getBitValue($sg_row,'0.0-0.7'); + if($enable_flag == 1) + { + $sg_mode[$sg_num] = getBitValue($sg_row,'1.0-1.7'); + $sg_ack[$sg_num] = getBitValue($sg_row,'02.0-02.7'); + $sg_ip_tmp = getBitValue($sg_row,'03.0-06.7'); + $sg_ip[$sg_num][0] = hexdec(getBitValue($sg_ip_tmp,'0.0-0.7')); + $sg_ip[$sg_num][1] = hexdec(getBitValue($sg_ip_tmp,'1.0-1.7')); + $sg_ip[$sg_num][2] = hexdec(getBitValue($sg_ip_tmp,'2.0-2.7')); + $sg_ip[$sg_num][3] = hexdec(getBitValue($sg_ip_tmp,'3.0-3.7')); + $sg_ins[$sg_num] = $k; + if($DEBUG) + { + echo "sg_row = $sg_row
      "; + echo "sg_ins = $sg_ins[$sg_num]
      "; + echo "sg_mode = $sg_mode[$sg_num]
      "; + echo "sg_ip = $sg_ip_tmp
      "; + echo "sg_ack = $sg_ack[$sg_num]
      "; + } + $sg_num++; + } + else if(!isset($sg_unuesd)) + $sg_unuesd = $k; + $k++; +} +//========================================================== +//输出并显示数据 +//========================================================== +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      "; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > MSC > MG "; +echo ""; +showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Media Gateway:  "; +echo ""; +echo ""; +echo "$strBack"; +echo "
      "; +?> + +"; +echo ""; +for($i=0;$i < $mg_num;$i++) +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      No.ClusterIPDevice NumberDelete
      "; + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo "
      $mg_ins[$i]"; + echo ""; + echo ""; + for($j=0; $j < 4; $j++) + { + $name = 'mg_'.$i.'_ip'.$j; + echo ""; + if($j != 3) + echo '.'; + } + echo ""; + echo ""; + echo "
      "; + +echo "
      "; +echo ""; +echo ""; +echo ""; +echo "
      Signaling Gateway:  
      "; +?> + +"; +echo ""; +for($i=0;$i < $sg_num;$i++) +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +echo ""; +?> +
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      No.ModeIPSignaling ACKDelete
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      $sg_ins[$i]"; + for($j=0; $j < 4; $j++) + { + $name = 'sg_'.$i.'_ip'.$j; + echo ""; + if($j != 3) + echo '.'; + } + echo "
      diff --git a/wxc2_omc/element/mss/mnp.php b/wxc2_omc/element/mss/mnp.php new file mode 100755 index 0000000..3997c48 --- /dev/null +++ b/wxc2_omc/element/mss/mnp.php @@ -0,0 +1,580 @@ +"; +if($DEBUG) echo "
      正在调试中!!"; +?> + + + +'2.2', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.32', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + + //array('oid'=>'2.1.1', 'sysid'=> '370_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=> '370_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=> '370_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.4', 'sysid'=> '370_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.5', 'sysid'=> '370_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.7', 'sysid'=> '370_99_99', 'selectsysid'=>'-1') + +); + +$NI_arr=array('International','International spare','National','National spare'); +$SaveArr=array( + //array('oidstr'=>'2.2.2', 'setvalue'=>'01' ,'sysid'=>'370_99_99'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99'), + array('oidstr'=>'2.1.32', 'setvalue'=>'01' ,'sysid'=>'370_99_99') +); +$backurl = "./mnp.php"; +//loading +if($load_flag == 1) +{ + echo "
      Loading"; + + GetParam($sysId_arr,1);//1 means return to overview if getting parameters fails. + + echo ""; +} + +if(isset($doingOtherFlag)) +{ + {//get system ip + for($i=0; $i < 2; $i++) + { + $getsql = "SELECT ip FROM $sysinfo where sysTypeNo = $sysTypeNo and sysNo = '$i'"; + if($DEBUG) echo "getsql = $getsql
      "; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = strtoupper(omc_keep_length($mss_ip[0],'0','8')); + $mss_ip[1] = strtoupper(omc_keep_length($mss_ip[1],'0','8')); + + $sysId = "223_99_99"; + }//end get system ip + + if($setMnpGtt==1) + { + //scf_map + $oidStr = "2.1.32"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + + exit; +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { +// echo "
      Getting parameters
      "; +// GetParam(0,1); + + echo "
      Setting parameters
      "; + SetParam($sysId_arr); + session_register("acSetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + echo ""; + //exit(); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } + + echo ""; + exit(); +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; + +?> + +"; +echo ""; +echo ""; +echo "Configuration > Network > MNP"; + +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       "; + //echo "MNP:  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +?> + + +indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } + + for($i = 0; $i < 4; $i ++) + { + $levelWhere = getLevelWhere($spcTree_array[$spc_index[$i]][3]); + + $getsql = "select initValue from $mtp3_sqlTable where $levelWhere"; + $result = mysqli_query($pubConn,$getsql); + $row[$i] = mysqli_fetch_array($result); + $row[$i] = hexdec($row[$i][0]); + if($DEBUG)echo "getsql = $getsql
      "; + if($DEBUG)echo "spc_$i=$row[$i]
      "; + } +} + +echo "" ; +echo ""; +echo ""; +echo ""; + + +{//gtt + echo ""; + echo ""; + + /* + //========================Portability Flag=========================== + echo ""; + echo ""; + echo ""; + echo ""; + */ + + //========================NPLR Number================================= + echo ""; + echo ""; + echo ""; + echo ""; + + + + //=======================Routing Number=============================== + echo ""; + echo ""; + echo ""; + echo ""; + + //=======================Routing Method=============================== + echo ""; + echo ""; + echo ""; + echo ""; + + //=======================RN Position=================================== + echo ""; + echo ""; + echo ""; + echo ""; + + + //=======================local prefix================================= + //====================get the default value of local prefix============== + $database="OBJ_370"; + $sql="select initValue from paramConf where level_1=2 and level_2=1 and level_3=7 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $local_prefix_default_value=$rows[initValue]; + //===================get the count of local prefix======================== + $database="OBJ_370"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=7 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $local_prefix_count=0; + + do{ + + $initValue_tmp=$rows[initValue]; + if(strcmp($initValue_tmp,$local_prefix_default_value)!=0) + { + $tmp_value=getBitValue($rows[initValue],'0.0-15.7'); + $temp=""; + for($num=0;$num<16;$num++) + { + $str=substr($tmp_value,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $local_prefix_prefix[$local_prefix_count]=trim($temp); + $local_prefix_instanceNo[$local_prefix_count]=$rows[instanceNo]; + $local_prefix_count++; + } + }while($rows=mysqli_fetch_array($result)); + + //====================get the unused instanceNo of local prefix==== + $database="OBJ_370"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=7 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + do{ + + $initValue_tmp=$rows[initValue]; + if(strcmp($initValue_tmp,$local_prefix_default_value)==0) + { + $unused_local_prefix_instanceNo=$rows[instanceNo]; + break; + } + }while($rows=mysqli_fetch_array($result)); + + + + $objIdStr = "no-2.1.7"; + $sysId = "370_99_99"; + $webname = "MNP"; + $setname = "Local Prefix"; + $backurl = "./mnp.php?license=$license&users=$users"; + echo ""; + if($local_prefix_count>=32) + { + echo ""; + //echo "+"; + + } + else + { + echo ""; + } + echo ""; + echo ""; + +}//end gtt +echo "
      Signaling point code"; +for($i=0; $i<4; $i++) + echo ""; +echo "
      {$spcTree_array[$i][0]} : {$spcTree_array[$spc_index[$i]][1]} : $row[$i]
      $strE164Number"; + $sysId = "223_99_99"; + $oidStr = "2.1.32"; + $instanceNo=0; + echo ""; + echo ""; + echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setMnpGtt=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      Portability Flag"; + $sysIdd = '370_99_99'; + $oidStrr = "2.1.1"; + showParameter($sysIdd,$oidStrr,1,1,0,'','','Update'); + echo "
      NPLR Number "; + $sysId = "370_99_99"; + $oidStr = "2.1.2"; + showParameter($sysId,$oidStr,1,1); + echo "
      Routing Number "; + $sysId = "370_99_99"; + $oidStr = "2.1.3"; + showParameter($sysId,$oidStr,1,1); + echo "
      Routing Method "; + $sysId = "370_99_99"; + $oidStr = "2.1.4"; + showParameter($sysId,$oidStr,1,1); + echo "
      RN Position "; + $sysId = "370_99_99"; + $oidStr = "2.1.5"; + showParameter($sysId,$oidStr,1,1); + echo "
      Local PrefixLocal Prefix               "; + echo "+"; + + echo ""; + //===================title===================== + if($local_prefix_count==0) + { + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + } + + //==============local prefix element==================== + if($local_prefix_count==0) + { + echo ""; + } + else + { + for($i=0;$i<$local_prefix_count;$i++) + { + if($i>3) + echo ""; + else + echo ""; + //=====local prefix instanceNo=== + echo ""; + //=====local prefix ============= + echo ""; + //======delete select box========= + echo ""; + echo ""; + } + //======more and hide button================ + if($local_prefix_count>4) + { + echo ""; + echo ""; + + } + + } + + + + + echo "
      No.Local PrefixDelete"; + echo "
      No.Local PrefixDelete"; + echo "
      --
      {$local_prefix_instanceNo[$i]}{$local_prefix_prefix[$i]}
      More >>
      Hide >>
      "; + echo "
      "; +?> + +"; +?> + +"; + //===============delete the local prefix by instanceNo========== + $database="OMC_PUB"; + $setsql = "update OBJ_370.param_99 set initValue='$local_prefix_default_value' where level_1=2 and level_2=1 and level_3=7 and instanceNo={$local_prefix_instanceNo_tmp[$i]} "; + if($DEBUG) + echo "setsql=$setsql
      "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + + + echo "\n\n"; +} +?> diff --git a/wxc2_omc/element/mss/msc.php b/wxc2_omc/element/mss/msc.php new file mode 100755 index 0000000..ffecca5 --- /dev/null +++ b/wxc2_omc/element/mss/msc.php @@ -0,0 +1,1696 @@ +正在调试中,给您的工作带来不便,请原谅!!:)"; +?> + + +"; + +$backurl = "./msc.php"; +$pubDb = 'OMC_PUB'; + +$sqltable_sccp ="OBJ_223.param_99"; + +$net_paramTable ='OBJ_225.param_99';//xapp +$net_paramConf ='OBJ_225.paramConf'; + + +$vlr_paramTable ='OBJ_325.param_99';//vlr +$vlr_paramConf ='OBJ_325.paramConf'; + +$msc_paramTable ='OBJ_322.param_99'; +$msc_paramConf ='OBJ_322.paramConf'; + +$mtp3_sqlTable = 'OBJ_222.param_99'; + +$sqltable_spc = 'OBJ_222.param_99'; + +$sysStatTable='OMC_PUB.sysStat'; +$sysinfo = 'OMC_PUB.sysInfo'; +$sysTypeNo = '322'; + +$localPrefixTg = 251; +//000000004B0302FD0000000000000000 +//000000000B0302FF0000000000000000 +$setsql = "update $msc_paramTable set initValue = '000000004B0302FD0000000000000000' + where level_1 = '2' and level_2 = '1' and level_3 = '4' and instanceNo ='$localPrefixTg'"; +//$setsql = "update $msc_paramTable set initValue = '000000000B0302FF0000000000000000' +// where level_1 = '2' and level_2 = '1' and level_3 = '4' and instanceNo ='$localPrefixTg'"; +//echo "
      setsql=$setsql"; +mysqli_query($pubConn,$setsql); +echo mysqli_error($pubConn); + +$spcTree_array = array( + array('INT', '14-bit', '2.3.1'), + array('INT-S', '14-bit', '2.3.2'), + array('NAT', '14-bit', '2.3.3'), + array('NAT-S', '14-bit', '2.3.4'), + array('INT', '24-bit', '2.3.5'), + array('INT-S', '24-bit', '2.3.6'), + array('NAT', '24-bit', '2.3.7'), + array('NAT-S', '24-bit', '2.3.8'), +); + +$sysId_arr=array( + array('oid'=>'2.1.8', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.146', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.254', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.0', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2.0', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3.0', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.0', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.0', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.0', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.8.0', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.13', 'sysid'=> '325_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3.1', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3.7', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.2', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.3', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), +); + +//when set mtp3's parameters, sccp'c parameter will be reset. so, should set mtp3's param at first. +$sysId_arr1=array( + array('oid'=>'2.2', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.1', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), +); + +$SaveArr=array( + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99'),//mtp3 + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99'),//sccp +// array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99'),//XAPP + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99'),//MSC +); + + $getsql = "SELECT sysNo FROM $sysinfo where sysTypeNo = $sysTypeNo"; + if($DEBUG) echo "getsql = $getsql
      "; + $Result = @mysqli_query($pubConn,$getsql); + while($Rows = mysqli_fetch_array($Result)) + { + $vlrSysId = "325_".$Rows[sysNo]."_0"; + $SaveArr[] = array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=> $vlrSysId); + } + +$vlrConfArr = array( + array('Start','0.0-7.7','2.1.13'), + array('End','8.0-15.7','2.1.13') + ); + +$localNodeConfArr=array( + array('NetID', '00.0-00.7'), + array('MSISDN', '01.0-10.7'), + array('IP0', '11.0-14.7'), + array('IP1', '15.0-18.7') +); + +$NetworkCodeArr=array( +// array('oid', 'inputName', 'Maxlength','showName'), + array('2.3.0', 'CC' , '4', 'CC'), + array('2.4.0', 'NDC' , '6', 'NDC'), + array('2.1.0', 'MCC' , '4', 'MCC'), + array('2.2.0', 'MNC' , '4', 'MNC'), + array('2.5.0', 'IPrefix' , '4', 'Int prefix'), + array('2.6.0', 'NPrefix' , '4', 'Nat prefix') +); + + +$CDR_status=array( + // name //order + array('MO', '12'), + array('MT', '11'), + array('OutGateway', '8'), + array('InGateway', '9'), + array('Roaming', '10'), + array('Transit', '7'), + array('Sorm', '3'), + array('MCT', '4'), + array('MO SMS', '6'), + array('MT SMS', '5'), +// array('Redirection', '0.3-0.3'), +// array('Feature Request','0.2-0.2') +); + +$max_duration = array( + array('Duration','0.0-0.7','2.3.7') + ); + +$obj_array = array( + array('SCCP','223_99_99','2.1','OBJ_223.param_99','WHERE level_1=\'2\' and level_2 = \'1\' '), + array('XAPP','225_99_99','2','OBJ_225.param_99','WHERE level_1=\'2\' '), + array('VLR','325_99_99','2.1.3','OBJ_325.param_99','WHERE level_1=\'2\' and level_2 = \'1\' and level_3 = \'3\' '), + array('CCF','322_99_99','2','OBJ_322.param_99','WHERE level_1=\'2\' '), + array('MTP3','222_99_99','2','OBJ_222.param_99','WHERE level_1=\'2\' '), + array('8KE1_0','111_0_99','2','OBJ_111.param_0','WHERE level_1=\'2\' '), + array('8KE1_1','111_1_99','2','OBJ_111.param_1','WHERE level_1=\'2\' '), + array('AAS_0','311_0_0','2.5','OBJ_311.param_0','WHERE level_1=\'2\' and level_2 = \'5\' '), + array('AAS_1','311_1_0','2.5','OBJ_311.param_1','WHERE level_1=\'2\' and level_2 = \'5\' ') + ); + +//loading +if($load_flag == 1) +{ + echo "
      Loading"; + + GetParam($sysId_arr1,1);//1 means return to overview if getting parameters fails. + GetParam($sysId_arr,1);//1 means return to overview if getting parameters fails. + + echo ""; +} + +//get default value of local prefix(conv prefix) +$getsql = "select initValue from $net_paramConf where level_1 = '2' and level_2 = '8' and level_3 = '0'"; +$conv_pre_def = @mysqli_query($pubConn,$getsql); +$conv_pre_def = @mysqli_fetch_array($conv_pre_def); +$conv_pre_def = $conv_pre_def[0]; +echo mysqli_error($pubConn); +if($DEBUG) + echo "conv_pre_def = $conv_pre_def
      "; + +if(isset($doingOtherFlag)) +{ + //=====set NITX name then set namc DCS ,name length====== + if($setNITZName==1) + { + //===to get the old value from database + $database="OBJ_322"; + $sql="select initValue from param_99 where level_1=2 and level_2=2 and level_3=5 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $oldValue=$rows[initValue]; + $tempV=substr($oldValue,4); + $name_DCS="00"; + //======get the name length + $tmp=substr($tempV,0,64); + $count=0; + for($i=0;$i<32;$i++) + { + $t=substr($tmp,$i*2,2); + if($t!="00") + $count++; + } + + //$count=6; + $name_length=hexdec($count).""; + if(strlen($name_length)==1) + $name_length="0".$name_length; + + $newValue=$name_DCS.$name_length.$tempV; + $update_sql="update OBJ_322.param_99 set initValue = '$newValue' + where level_1 ='2' and level_2 ='2' and level_3='5' "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + exit; + + } + + + if($setMSC_spc==1){ + changeGTT($newValue,$netId,$oldValue,$netId); + + $setSPC = strtoupper(omc_keep_length(dechex($newValue),'0','6')); + $setsql = "update $mtp3_sqlTable set initValue = '$setSPC' + where level_1 = '2' and level_2 = '3' and (level_3-1)%4 = '$netId'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + exit; + } + if($setMsrnStart==1 || $setMsrnEnd==1||$setLocalCliType==1) + { + + $getsql = "select initValue from $vlr_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '13'"; + $msrn_rst = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "getsql = $getsql
      "; + + $msrn_row = @mysqli_fetch_array($msrn_rst); + $msrn_start=getBitValue($msrn_row[0],'00.0-07.7'); + $msrn_start = str_replace('F','',$msrn_start); + $msrn_end = getBitValue($msrn_row[0],'08.0-15.7'); + $msrn_end = str_replace('F','',$msrn_end); + + $getsql = "select initValue from $msc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '2' and instanceNo='249'"; + $msrnPrefixAtt_rst = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + if($DEBUG) + echo "getsql = $getsql
      "; + $msrnPrefixAtt_row = @mysqli_fetch_array($msrnPrefixAtt_rst); + + $msrnPrefixAtt=$msrnPrefixAtt_row[initValue]; + + $local_cliType=getBitValue($msrnPrefixAtt,'17.0-17.7'); + $msrnPrefixAtt=setBitValue('4400EEEEEEEEEEEEEEEE890000EEEEEEEE030100','17.0-17.7',$local_cliType); + + //set some roaming prefixs automatically + if($newValue!==$oldValue) + { + {//delete old msrn prefix + $selSql = "select instanceNo,initValue from $msc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '2'"; + $Result = mysqli_query($pubConn,$selSql); + while($Rows=mysqli_fetch_array($Result)) + { + $flag = getBitValue($Rows[initValue],'10.7-10.7'); + $property = bindec(getBitValue($Rows[initValue],'10.2-10.3')); + if($flag && $property==2)//msrn + { + delPrefix($Rows[instanceNo]); + } + } + }//end delete + if(strlen($msrn_end)== strlen($msrn_start) && strlen($msrn_start)>0) + { + $i=0; + while(substr($msrn_start,$i,1)==substr($msrn_end,$i,1)) + { + $i++; + } + $start = substr($msrn_start,$i,1); + $end = substr($msrn_end,$i,1); + //echo "
      start:$start, end:$end"; + + if($start == 0 && $end==9) + { + $roamPreArr[0][prefix]=substr($msrn_start,0,$i); + $roamPreArr[0][inst] = 249; + } + else + { + for($k=0,$j=$start; $j<= $end; $j++,$k++) + { + $roamPreArr[$k][prefix]=substr($msrn_start,0,$i) . $j; + $roamPreArr[$k][inst] = 249 - $k; + } + } + for($i=0; $i< sizeof($roamPreArr); $i++) + { + + $roamingPrefix = omc_keep_length($roamPreArr[$i][prefix],'E','16','0'); + $setsql = "update $msc_paramTable set initValue = '$roamingPrefix' + where level_1 = '2' and level_2 = '1' and level_3 = '1' and instanceNo ='{$roamPreArr[$i][inst]}'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + $setsql = "update $msc_paramTable set initValue = '$msrnPrefixAtt' + where level_1 = '2' and level_2 = '1' and level_3 = '2' and instanceNo ='{$roamPreArr[$i][inst]}'"; + //echo "
      setsql=$setsql"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + $setPrefixTG = omc_keep_length(dechex($localPrefixTg),'0','2'); + $setsql = "update $msc_paramTable set initValue = '$setPrefixTG' + where level_1 = '2' and level_2 = '1' and level_3 = '3' and instanceNo ='{$roamPreArr[$i][inst]}'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + } + //else{ + // $msg="MSRN Range is error"; + // alertMsgAndGoLast($msg); + //} + }//end set a roaming prefix + exit; + } + {//set system ip + for($i=0; $i < 2; $i++) + { + $getsql = "SELECT ip FROM $sysinfo where sysTypeNo = $sysTypeNo and sysNo = '$i'"; + if($DEBUG) echo "getsql = $getsql
      "; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = strtoupper(omc_keep_length($mss_ip[0],'0','8')); + $mss_ip[1] = strtoupper(omc_keep_length($mss_ip[1],'0','8')); + if($DEBUG) + { + echo "
      mss0_ip = $mss_ip[0]
      "; + echo "mss1_ip = $mss_ip[1]
      "; + } + + $sysId = "223_99_99"; + if($setMscGtt==1)//msc + { + $oidStr = "2.1.8"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + if($setSsfGtt==1)//ssf + { + $oidStr = "2.1.146"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + if($setAifNI==1)//aif + { + $oidStr = "2.1.254"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + }//end set system ip + exit; +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + + SetParam($sysId_arr1); + SetParam($sysId_arr); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + + echo ""; + //exit(); + + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr1); + GetParam($sysId_arr); + $showType="Get"; + } + } +//exit; + echo ""; + exit(); +} + +if(isset($delflag)) +{ + if($DEBUG) echo "delValue = $delValue
      "; + if($DEBUG) echo "delflag = $delflag
      "; + if($delflag == 'pp') //pstn prefix + { + $objWhereStr = getLevelWhere('2.8.0'); + $setsql = "update $net_paramTable set initValue = '$conv_pre_def' where $objWhereStr and instanceNo='$delValue'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + else if($delflag == 'dailing') //Dailing prefix + { + $delNoStr = rtrim($delNoStr,'.'); + $delNoArr = explode('.',$delNoStr); + $instNoWhereStr = ''; + for($i=0; $i< sizeof($delNoArr); $i++) + { + if($i==0) + $instNoWhereStr = "(instanceNo='$delNoArr[$i]'"; + else + $instNoWhereStr .= " or instanceNo='$delNoArr[$i]'" ; + } + $instNoWhereStr .= ')'; + {//delete localprefix + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $flagoffset = "10.7-10.7"; + $row[initValue] = setBitValue($row[initValue],$flagoffset,0); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND $instNoWhereStr"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND $instNoWhereStr"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $oidstr = '2.1.3'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND $instNoWhereStr"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + } + else if($delflag == 'conv') //conv prefix + { + $delNoStr = rtrim($delNoStr,'.'); + $delNoArr = explode('.',$delNoStr); + $instNoWhereStr = ''; + for($i=0; $i< sizeof($delNoArr); $i++) + { + if($i==0) + $instNoWhereStr = "(instanceNo='$delNoArr[$i]'"; + else + $instNoWhereStr .= " or instanceNo='$delNoArr[$i]'" ; + } + $instNoWhereStr .= ')'; + + $objWhereStr = getLevelWhere('2.8.0'); + $setsql = "update $net_paramTable set initValue = '$conv_pre_def' where $objWhereStr and $instNoWhereStr"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + + if(!$DEBUG) + { + echo ""; + } +} + +if(isset($resetDevice))//reset mss,sccp,mtp3 +{ + $resetArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'5A' ,'sysid'=>'322_99_99'),//MSC + array('oidstr'=>'3.7', 'setvalue'=>'01' ,'sysid'=>'222_99_99'),//mtp3 + array('oidstr'=>'3.2', 'setvalue'=>'00' ,'sysid'=>'223_99_99'),//sccp + ); + SaveParam($resetArr); + echo ""; + exit(); +}//end reset. + +?> + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > MSC"; +echo ""; +$helpId = '2.1.1.1'; +showHelp($helpId); +echo "
      "; +echo "
      "; + +{ + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + //echo "Mobile Switching Center:  "; + //echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +?> + + + +indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } +} +echo "" ; +echo ""; +echo ""; +echo ""; + +//========================================================== +//输出Global title +//========================================================== +//msc +$sysId = "223_99_99"; +$oidStr = "2.1.8"; +$instanceNo=0; +echo ""; +echo ""; +echo ""; + +//ssf +$oidStr = "2.1.146"; +echo "" ; +echo ""; + +//aif +$oidStr = "2.1.254"; +echo "" ; +echo ""; + echo ""; +echo ""; + +//========================================================== +//输出Network +//========================================================== +$NetworkCodeArr=array( +// array('oid', 'showName'), + array('2.3.0', 'CC'), + array('2.4.0', 'NDC'), + array('2.1.0', 'MCC'), + array('2.2.0', 'MNC'), + array('2.5.0', 'Int prefix'), + array('2.6.0', 'Nat prefix') +); +echo "" ; +echo ""; +echo ""; + + + +echo ""; +echo ""; + +//echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +{//输出MSRN Range + $sysId = "325_99_99"; + $oidStr = "2.1.13"; + $instanceNo = 0; + echo ""; + echo ""; + echo ""; + echo ""; +} + +/* +{//输出Local CLI type + $sysId = "322_99_99"; + $oidStr = "2.1.2"; + $instanceNo = 249; + echo ""; + echo ""; + echo ""; + echo ""; +} +*/ + +{//输出dailing prefix + {//get all local prefix + //find prefix + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + {//get all enable prefix No + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr and instanceNo<252 + ORDER BY instanceNo"; + //echo $defSql; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $prefix_num=0; + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=bindec(getBitValue($row[initValue],$offset_enable)); + $prefix_property=bindec(getBitValue($row[initValue],$offset_Properties)); + $prefix_calltype=bindec(getBitValue($row[initValue],$offset_calltype)); + //echo "
      {$row[instanceNo]}->enable:$prefix_enable; property:$prefix_property; callType:$prefix_calltype"; + //$flag = ($prefix_enable && ($prefix_property==1) && ($prefix_calltype==0));//enable,msisdn,normalcall + //$flag = ($prefix_enable && ($prefix_calltype==0)); + //$flag = ($prefix_enable ); + //$flag = ($prefix_enable && $prefix_property!=2 && $prefix_calltype!=4); + $flag = ($prefix_enable && $prefix_calltype!=4); + //$emFlag = $prefix_enable && $prefix_calltype==1; + if($flag) + { + $enablePrefix[$prefix_num][inst_no]=$row[instanceNo]; + $enablePrefix[$prefix_num][init_value]=$row[initValue]; + //echo "
      ".$prefix_num . ": ".$enablePrefix[$prefix_num][inst_no]; + $prefix_num++; + } + if($prefix_enable==0 && !isset($unused_ins)) + $unused_ins = $row[instanceNo]; + } + }//end get enable prefix No + { + $oidstr = '2.1.3'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo<252 + ORDER BY instanceNo + "; + //echo "
      paramSql: $paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + $valid_num=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$enablePrefix[$prefix_no][inst_no]) + { + $tmpTg=hexdec($Row_1[initValue]); + //echo "
      {$Row_1[instanceNo]}->tmpTg: $tmpTg"; + if($tmpTg == $localPrefixTg) + { + $validPrefix[$valid_num][inst_no] = $enablePrefix[$prefix_no][inst_no]; + $validPrefix[$valid_num][init_value] = $enablePrefix[$prefix_no][init_value]; + $validPrefix[$valid_num][tg] = $tmpTg; + $valid_num++; + } + $prefix_no++; + } + if($prefix_no >= $prefix_num) + break; + } + } + {//get prefix value + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo<252 + ORDER BY instanceNo + "; + // echo "$paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$validPrefix[$prefix_no][inst_no]) + { + $tempprefix=strtoupper($Row_1[initValue]); + $prefix = explode('E',$tempprefix); + if($prefix[0] =="") + $prefix[0]="--"; + $validPrefix[$prefix_no][prefix]=$prefix[0]; + //echo "
      ".$validPrefix[$prefix_no][prefix]; + $prefix_no++; + } + if($prefix_no >= $valid_num) + break; + } + }//end get prefix value + }//end get all local prefix + $dailingPre_nrow = $valid_num + 1; + $objIdStr='no-2.1.1-2.1.2'; + $sysId = '322_99_99'; + $webname="MSC"; + $setname="Prefix"; + $backurl="./msc.php"; + + echo "" ; + echo ""; + if($valid_num == 0) echo ""; + else + { + $flag = 'dailing'; + $showNum = $valid_num >= 4 ? 4 : $valid_num; + $slctNum = ($$flag==1) ? $valid_num : $showNum; + echo ""; + } + echo ""; +}//end 输出 Dialing prefix +{//default prefix +echo "" ; + echo ""; + $flag = 'Default'; + echo ""; +echo ""; +}//end default prefix +//========================================================== +//输出Call control +//========================================================== +echo ""; +echo ""; +echo ""; + +//output Suspend Timer,Call Diverty Display,Repeat Paging Times +{ + echo ""; +} + +//output max call Duration,Location Number +{ + $sysId = '322_99_99'; + echo ""; +} +{//out put Announcement and Warning tone timer + echo ""; +} + +//output E1 port +{ + $e1_oid = array('2.1.4','2.4.1','2.4.2','2.4.3'); + $link_oid = '2.5.1'; + echo ""; + + echo ""; +} + +//Cell Parameter automatically add 112 at instanceNo 1023 +{ + $oidEmergency = '2.2.7'; + $objWhereStr =getLevelWhere($oidEmergency); + $Em_paramUpdSql = "update $msc_paramTable set initValue='000000000000112EEEEEEEEEEEEE000000' WHERE $objWhereStr and instanceNo=1023"; + $Em_Result = mysqli_query($pubConn,$Em_paramUpdSql); +} +echo ""; + +{//输出 conv prefix + $objIdStr='no-2.8'; + $sysId = '225_99_99'; + $webname="MSC"; + $setname="Prefix manipulation"; + $backurl="./msc.php"; + + $oidStr = '2.8.0'; + $levelWhere = getLevelWhere($oidStr); + + $getsql = "select initValue,instanceNo from $net_paramTable where $levelWhere and initValue!='$conv_pre_def'"; + $result = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $convNo=0; + while($pre_row = @mysqli_fetch_array($result)) + { + $nameFlag = toAscii(getBitValue($pre_row[initValue],'35.0-42.7')); + if($nameFlag == $webname) + { + $convPrefix[$convNo][initValue]=$pre_row[initValue]; + $convPrefix[$convNo][inst_no] = $pre_row[instanceNo]; + $prefix = getBitValue($pre_row[initValue],'00.0-15.7'); + if($convPrefix != 0) + $prefix = toAscii($prefix); + else + $prefix = '--'; + $addDigs = getBitValue($pre_row[initValue],'18.0-33.7'); + if($addDigs != 0) + $addDigs = toAscii($addDigs); + else + $addDigs = '--'; + $convPrefix[$convNo][prefix] = $prefix; + $convPrefix[$convNo][delLen] = hexdec(getBitValue($pre_row[initValue],'16.0-16.7')); + $convPrefix[$convNo][addLen] = hexdec(getBitValue($pre_row[initValue],'17.0-17.7')); + $convPrefix[$convNo][addDigs] = $addDigs; + $convPrefix[$convNo][valiLen] = hexdec(getBitValue($pre_row[initValue],'34.0-34.7')); + //echo "
      convPrefix[$convNo][prefix]:{$convPrefix[$convNo][initValue]}"; + $convNo++; + } + }//end while + $getsql = "select initValue,instanceNo from $net_paramTable where $levelWhere and initValue='$conv_pre_def'"; + //echo "
      getsql: $getsql;"; + $result = @mysqli_query($pubConn,$getsql); + $Row = @mysqli_fetch_array($result); + $newConvInst=$Row[instanceNo]; + $conv_nrow = $convNo + 1; + + echo "" ; + echo ""; + if($convNo == 0) echo ""; + else + { + echo ""; + } + echo ""; +} + +/* +{//license + echo "" ; + echo ""; + echo ""; + echo ""; +}//end license +*/ +$flag = 'deviceReset'; +if(!$$flag) + echo ""; +if($$flag) +{ + echo ""; + echo ""; + echo ""; + echo ""; +} + +echo ""; + + +{ + echo "
      Signaling point code"; +$sysId = "222_99_99"; +for($i=0; $i<4; $i++){ + echo ""; +echo "
      {$spcTree_array[$i][0]}: "; + showParameter($sysId,'2.2',$i+1,1); + echo " "; + showParameter($sysId,'2.2',$i+5,1); + echo " "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setMSC_spc=1&netId=$i"; + showParameter($sysId,$spcTree_array[$spc_index[$i]][2],1,1,0,$doingOtherUlr); +} + +echo " ACN
      $strE164Number(MSC)"; + + echo ""; + + echo ""; +echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setMscGtt=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      $strE164Number(SSF)"; + echo ""; + + echo ""; +echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setSsfGtt=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      AIF network indicator "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setAifNI=1"; + showParameter($sysId,$oidStr,1,1,$instanceNo,$doingOtherUlr); + echo "
      Network
      "; +$sysId = "225_99_99"; +for($i=0;$i < sizeof($NetworkCodeArr);$i+=2) +{ + echo ""; + echo ""; + echo ""; + $j = $i+1; + echo ""; + echo ""; + echo ""; +} +echo "
      {$NetworkCodeArr[$i][1]}"; + $oidStr = $NetworkCodeArr[$i][0]; + + + showParameter($sysId,$oidStr,1,1); + echo "{$NetworkCodeArr[$j][1]}"; + $oidStr = $NetworkCodeArr[$j][0]; + if($i==0) + showParameter($sysId,$oidStr,1,4); + else + showParameter($sysId,$oidStr,1,1); + echo "

      NITZ"; +//=====add NITZ parameter================= +{ + $sysIdd="322_99_99"; + $oidStrr="2.2.5"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setNITZName=1"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +//===================== +echo "
      Name"; + echo ""; + showParameter($sysIdd,$oidStrr,3,3,0,$doingOtherUlr); + echo "Time Flag"; + echo ""; + showParameter($sysIdd,$oidStrr,4,3); + echo "
      Time Zone"; + echo ""; + showParameter($sysIdd,$oidStrr,5,1); + echo "
      MSRN range"; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo "
      Start:"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setMsrnStart=1"; + showParameter($sysId,$oidStr,1,1,$instanceNo,$doingOtherUlr); + echo "End:"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setMsrnEnd=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo "
      "; + echo "
      Local CLI type"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setLocalCliType=1"; + showParameter($sysId,$oidStr,15,1,$instanceNo,$doingOtherUlr); + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      WXC2
      subscriber prefix
      +
      "; + echo "
       --"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + + $TON_in = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $TON_out = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $Properties = array('Trunk','MSISDN','MSRN','MSC'); + $callTypeArr= array('Normal Call','Emergency','MCT','VMS','IN'); + + for($i=0;$i < $valid_num;$i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + + $tmpInitValue = $validPrefix[$i][init_value]; + $tmpInst = $validPrefix[$i][inst_no]; + echo ""; + echo ""; + $oTON_in = BinDec(getBitValue($tmpInitValue,'0.0-0.3')); + $oTON_out = BinDec(getBitValue($tmpInitValue,'0.4-0.7')); + $oProperties = BinDec(getBitValue($tmpInitValue,'10.2-10.3')); + $oCallType = BinDec(getBitValue($tmpInitValue,'10.4-10.6')); + $oCDR = BinDec(getBitValue($tmpInitValue,'10.0-10.0')); + $oCDR = ($oCDR) ? ("ON") : ("OFF"); + + $oRano = $validPrefix[$i][prefix]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + // echo ""; + + echo ""; + echo ""; + if(($i< $valid_num-1)&& $i==$showNum-1 && $$flag==0) + { + echo ""; + break; + } + } + if($$flag) + echo ""; + + echo "
      No.PrefixTON-inTON-outPropertiesCall TypeCDRDelete"; + echo ""; + echo "
      $i$oRano $TON_in[$oTON_in] $TON_out[$oTON_out] $Properties[$oProperties] $callTypeArr[$oCallType] $oCDR 
      more >>
      Hide <<
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      Default prefix
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + $objIdStr='no-2.1.1-2.1.2'; + $sysId = '322_99_99'; + $webname="MSC"; + $setname="Def Prefix"; + $backurl="./msc.php"; + {//get all DefPrefix + $oidstr = '2.1.2'; + $objWhereStr =getLevelWhere($oidstr); + + $selSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr and instanceNo>251 ORDER BY instanceNo"; + //echo $defSql; + $result = @mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $valid_num=0; + while($row = @mysqli_fetch_array($result)) + { + $prefix_enable=bindec(getBitValue($row[initValue],$offset_enable)); + if($prefix_enable==0) + { + if($row[instanceNo]==252) + { + $tmpInst = 252; + $tmpSetValue = '2200EEEEEEEEEEEEEEEE810000EEEEEEEE030000'; + } + if($row[instanceNo]==253) + { + $tmpInst = 253; + $tmpSetValue = '4202EEEEEEEEEEEEEEEE810000EEEEEEEE030000'; + $objStr_2 = '2.1.1'; + $levelWhere_2 = getLevelWhere($objStr_2); + $updSql_2 = "update $paramTable set initValue='00EEEEEEEEEEEEEE' where $levelWhere_2 and instanceNo=$tmpInst"; + mysqli_query($pubConn,$updSql_2); + } + if($row[instanceNo]==254) + { + $tmpInst = 254; + $tmpSetValue = '3300EEEEEEEEEEEEEEEE810000EEEEEEEE030000'; + } + if($row[instanceNo]==255) + { + $tmpInst = 255; + $tmpSetValue = '4400EEEEEEEEEEEEEEEE810000EEEEEEEE030000'; + } + + $tmpUpdSql = "update $paramTable set initValue='$tmpSetValue' where $objWhereStr and instanceNo='$tmpInst'"; + mysqli_query($pubConn,$tmpUpdSql); + } + $prefix_property=bindec(getBitValue($row[initValue],$offset_Properties)); + $prefix_calltype=bindec(getBitValue($row[initValue],$offset_calltype)); + $validPrefix[$valid_num][inst_no]=$row[instanceNo]; + $validPrefix[$valid_num][init_value]=$row[initValue]; + $valid_num++; + } + $oidstr = '2.1.1'; + $objWhereStr =getLevelWhere($oidstr); + + $selSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr and instanceNo>251 ORDER BY instanceNo"; + //echo $defSql; + $result = @mysqli_query($pubConn,$selSql); + $valid_num = 0; + while($row = @mysqli_fetch_array($result)) + { + $tempprefix=strtoupper($row[initValue]); + $prefix = explode('E',$tempprefix); + if($prefix[0] =="") + $prefix[0]="--"; + $validPrefix[$valid_num][prefix]=$prefix[0]; + $valid_num++; + } + + {//other elements + $othersElementObjIdStr='2.11'; + $levelWhere = getLevelWhere($othersElementObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $othersElementParamTable='OBJ_225.param_99'; + $getSql="SELECT initValue,instanceNo FROM $othersElementParamTable + WHERE $levelWhere and initValue LIKE '01%'"; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $typeOffset = '1.0-1.7'; + $tgOffset = '3.0-3.7'; + $nameOffset = '14.0-23.7'; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $tmpType=getBitValue($rows[initValue],$typeOffset); + if($tmpType==0) + continue; + $type = hexdec($tmpType); + if($type==16 || $type == 17) + { + $tg = hexdec(getBitValue($rows[initValue],$tgOffset)); + $name=getBitValue($rows[initValue],$nameOffset); + if($name==0) + $name=$tg; + else + $name=trim(toAscii($name)); + $SwitchNameArr[$tg] = $name; + } + } + }//end otherelments + $oidstr = '2.1.3'; + $objWhereStr =getLevelWhere($oidstr); + $selSql =" SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr and instanceNo>251 ORDER BY instanceNo"; + $result = @mysqli_query($pubConn,$selSql); + $valid_num = 0; + while($row = @mysqli_fetch_array($result)) + { + $validPrefix[$valid_num][tg]=$tmpTg=hexdec($row[initValue]); + $validPrefix[$valid_num][tgName] = $SwitchNameArr[$tmpTg]; + $valid_num++; + } + }//end get enable prefix No + $TON_in = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $TON_out = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $Properties = array('Trunk','MSISDN','MSRN','MSC'); + $callTypeArr= array('Normal Call','Emergency','MCT','VMS','IN'); + for($i=0;$i < $valid_num;$i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + + $tmpInitValue = $validPrefix[$i][init_value]; + $tmpInst = $validPrefix[$i][inst_no]; + echo ""; + echo ""; + $oTON_in = BinDec(getBitValue($tmpInitValue,'0.0-0.3')); + $oTON_out = BinDec(getBitValue($tmpInitValue,'0.4-0.7')); + $oProperties = BinDec(getBitValue($tmpInitValue,'10.2-10.3')); + $oCallType = BinDec(getBitValue($tmpInitValue,'10.4-10.6')); + $oCDR = BinDec(getBitValue($tmpInitValue,'10.0-10.0')); + $oCDR = ($oCDR) ? ("ON") : ("OFF"); + + $oRano = $validPrefix[$i][prefix]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + // echo ""; + $showSwithName = sizeof($validPrefix[$i][tgName])==0 ? '--' : $validPrefix[$i][tgName]; + echo ""; + echo ""; + } + echo "
      No.PrefixTON-inTON-outPropertiesCall TypeCDRSwitch"; + echo "
      $i$oRano $TON_in[$oTON_in] $TON_out[$oTON_out] $Properties[$oProperties] $callTypeArr[$oCallType] $oCDR $showSwithName
      "; + echo "
      Call control"; + +echo ""; +echo ""; +echo "
      CDR"; +for ($i = 0;$i < sizeof($CDR_status);$i ++) +{ + $width = '10%'; + echo ""; +} +echo ""; + +echo "
      "; + echo ""; + echo ""; + echo "
      {$CDR_status[$i][0]}
      "; + showParameter('322_99_99','2.1.5',$CDR_status[$i][1],1); + echo "
      "; + $sysId = '322_99_99'; + echo ""; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo "
      ISUP suspend timer:  "; + $oidStr = "2.2.1"; + showParameter($sysId,$oidStr,1,1); + echo "  minutesCall divert display:  "; + $oidStr = "2.2.2"; + showParameter($sysId,$oidStr,1,1); + echo "Repeat paging times:  "; + $oidStr = "2.2.3"; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo ""; + echo ""; + + $oidStr = "2.3.1"; + + echo ""; + + echo ""; + + + echo "
      Max call duration:  "; + $oidStr = "2.3.7"; + showParameter($sysId,$oidStr,1,1); + echo "   minutesLocation number:  "; + showParameter($sysId,$oidStr,2,1); + echo "Len of location number:  "; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo ""; + echo ""; + echo "
      AnnouncementWarning tone timer:  "; + $oidStr = "2.1.7"; + showParameter($sysId,$oidStr,1,1); + echo "  seconds
      "; + /*echo "";*/ + echo ""; + $objWhereStr = getLevelWhere($link_oid); + $getsql = "SELECT initValue FROM $mtp3_sqlTable where $objWhereStr"; + if($DEBUG) echo "getsql = $getsql
      "; + $e1_link_result = @mysqli_query($pubConn,$getsql); + + $objWhereStr = getLevelWhere($e1_oid[2]);//2.4.2 + $defSql = "select initValue from $msc_paramConf where $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $defValue = $defRow[0]; + + $getsql="SELECT initValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND initValue != '$defValue' "; + if($DEBUG) echo "getsql = $getsql
      "; + $result = @mysqli_query($pubConn,$getsql); + $e1_253_num = 0; + $e1_254_num = 0; + $e1_e1_num = 0; + while($e1_tg = mysqli_fetch_array($result)) + { + $insNo = $e1_tg[instanceNo]; + $e1_tg = hexdec($e1_tg[0]); + + $objWhereStr = getLevelWhere($e1_oid[3]);//2.4.3 + $getsql = "SELECT initValue FROM $msc_paramTable where $objWhereStr and instanceNo = '$insNo'"; + if($DEBUG) echo "getsql = $getsql
      "; + $e1_cic = mysqli_query($pubConn,$getsql); + $e1_cic = mysqli_fetch_array($e1_cic); + $e1_cic = hexdec($e1_cic[0]); + + if($e1_tg == 253) + { + $e1_253[$e1_253_num] = $insNo; + $e1_253_cic[$e1_253_num] = $e1_cic; + $e1_253_num++; + + } + else if ($e1_tg == 254) + { + $e1_254[$e1_254_num] = $insNo; + $e1_254_cic[$e1_254_num] = $e1_cic; + $e1_254_num++; + } + } + + if($DEBUG) echo "e1_253_num = $e1_253_num
      "; + + $total_num = ($e1_253_num >= $e1_254_num) ? $e1_253_num : $e1_254_num; + + //used for exception handle + { + $e1_253_cic[$total_num] = hexdec('FFFFFFFF')+2; + $e1_254_cic[$total_num] = hexdec('FFFFFFFF')+2; + //$e1_253[$total_num] = -1; + //$e1_254[$total_num] = -1; + } + for($i=0; $i < $total_num; $i++) + { + $e1_253_min = 0; + $e1_254_min = 0; + for($j=0; $j < $total_num; $j++) + { + if(!isset($e1_253_cic[$j])) $e1_253_cic[$j] = hexdec('FFFFFFFF')+2;//used for exception handle + if($e1_253_cic[$j] < $e1_253_cic[$e1_253_min]) + { + $e1_253_min = $j; + } + if(!isset($e1_254_cic[$j])) $e1_254_cic[$j] = hexdec('FFFFFFFF')+2;//used for exception handle + if($e1_254_cic[$j] < $e1_254_cic[$e1_254_min]) + { + $e1_254_min = $j; + } + } + //used for exception handle + if($e1_253_cic[$e1_253_min] != $e1_254_cic[$e1_254_min]) + { + $e1_253_cic[$e1_253_min] > $e1_254_cic[$e1_254_min] ? ($e1_253_min = $total_num) : ($e1_254_min = $total_num); + } + if($DEBUG) echo "
      e1_253_cic[$e1_253_min] = $e1_253_cic[$e1_253_min]
      "; + if($DEBUG) echo "e1_254_cic[$e1_254_min] = $e1_254_cic[$e1_254_min]
      "; + + //if($e1_254_cic[$e1_254_min] != $e1_253_cic[$e1_253_min]) + //continue; + + $e1_show_253[$i] = $e1_253[$e1_253_min]; + $e1_show_254[$i] = $e1_254[$e1_254_min]; + + $e1_253_cic[$e1_253_min] = hexdec('FFFFFFFF')+2; + $e1_254_cic[$e1_254_min] = hexdec('FFFFFFFF')+2; + } + if($total_num == 0) + { + echo ""; + echo ""; + } + else + { + echo ""; + + echo ""; + } + echo ""; + echo "
      Inter-ConnectionInter-ConnectionMSC0 E1: --MSC1 E1: --MSC0 E1: "; + for($i=0; $i < sizeof($e1_show_253); $i++) + { + echo "$e1_show_253[$i] "; + $e1_no .= $e1_show_253[$i]; + $e1_no .= '_'; + } + echo "MSC1 E1: "; + for($i=0; $i < sizeof($e1_show_253); $i++) + { + echo "$e1_show_254[$i] "; + $e1_no .= $e1_show_254[$i]; + if($i != sizeof($e1_show_253)-1) $e1_no .= '_'; + } + echo "
      "; + echo ""; + echo ""; + echo ""; + + +echo ""; +echo "
      ToneClockSignaling channel
      "; + echo ""; + echo ""; + echo ""; + } + else + echo "+"; + echo "
      Prefix manipulation"; + if($newConvInst=='') + { + echo "+
       --"; + echo ""; + $flag = 'conv'; + $showNum = $convNo >= 4 ? 4 : $convNo; + $slctNum = ($$flag==1) ? $convNo : $showNum; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0; $i< $convNo; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + if($i<$convNo-1 && $i==$showNum-1 && $$flag==0) + { + echo ""; + break; + } + } + if($$flag) + echo ""; + + echo "
      No.PrefixDelete lengthAdd lengthAdd digitsValid lengthDelete"; + echo ""; + echo "
      {$convPrefix[$i][inst_no]}{$convPrefix[$i][prefix]} {$convPrefix[$i][delLen]} {$convPrefix[$i][addLen]} {$convPrefix[$i][addDigs]} {$convPrefix[$i][valiLen]} 
      more >>
      Hide <<
      "; + echo "
      License control "; + $sysId = '322_99_99'; + $oidStr = "2.6.3"; + showParameter($sysId,$oidStr,1,1,0,'','','Update'); + echo "
      More >>
      System reset Reset
      Hide <<
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} + +echo "

      "; +?> + + + + diff --git a/wxc2_omc/element/mss/msc_emergency_call.php b/wxc2_omc/element/mss/msc_emergency_call.php new file mode 100755 index 0000000..de8c2b7 --- /dev/null +++ b/wxc2_omc/element/mss/msc_emergency_call.php @@ -0,0 +1,284 @@ +'3.1', 'setvalue'=>'00' ,'sysid'=>'311_99_99'), + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99') +); + + +$NetIdConfArr=array('International','International-S','National','National-S'); + + +$SignalingArr=array( + array('oid'=>'2.1.2', 'inputName'=>'NetID' ,'showName'=>'NetWork indicator' ,'length'=>'2' ,'value'=>''), + array('oid'=>'2.1.3', 'inputName'=>'Wxc2PC' ,'showName'=>'WXC2 Point Code' ,'length'=>'6' ,'value'=>''), + array('oid'=>'2.1.8', 'inputName'=>'CIC' ,'showName'=>'CIC' ,'length'=>'10' ,'value0'=>'','value1'=>''), + array('oid'=>'2.1.4', 'inputName'=>'CC' ,'showName'=>'Country code' ,'length'=>'4' ,'value'=>''), + array('oid'=>'2.1.5', 'inputName'=>'NDC' ,'showName'=>'National destination code','length'=>'4' ,'value'=>''), + array('oid'=>'2.1.6', 'inputName'=>'MSISDN' ,'showName'=>'MSISDN' ,'length'=>'16','value'=>'') +); + +$AASannounArr=array( + array('oid'=>'2.3.1', 'inputName'=>'Prefix' ,'showName'=>'Prefix' ,'length'=>'16' ,'value'=>''), + array('oid'=>'2.3.2', 'inputName'=>'playtimes' ,'showName'=>'Play times' ,'length'=>'3' ,'value'=>''), + array('oid'=>'2.3.3', 'inputName'=>'' ,'showName'=>'Call unattainable announcement' ,'length'=>'1' ,'value'=>''), +); + +$Causearr=array( + array('name'=>'MAP', 'oid'=>'2.3.5', 'offset_vg'=>'02.0-03.7','offset_cv'=>'00.0-01.7'), + array('name'=>'AIF', 'oid'=>'2.3.7', 'offset_vg'=>'02.0-03.7','offset_cv'=>'00.0-01.7'), + array('name'=>'ISUP', 'oid'=>'2.3.8', 'offset_vg'=>'02.0-03.7','offset_cv'=>'00.0-01.7') +); +?> + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > Cell overview"; +echo ""; +//showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "  

      $strBack"; +echo "

      "; +} +?> + +"; +$emFlagArr = array( + 'Disable', + 'By Cell', + 'By LAC', + 'By MSC' +); +$sysId = '322_99_99'; +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; + +$oidEmergency = '2.2.7'; +$objWhereStr =getLevelWhere($oidEmergency); + +$defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +$defValue = $defRow[initValue]; + +$Em_paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND initValue!='$defValue' + "; +if($DEBUG)echo "
      Em_paramSql: $Em_paramSql"; +$Em_Result = mysqli_query($pubConn,$Em_paramSql); +$num = 0; +while($Em_Row = mysqli_fetch_array($Em_Result)) +{ + $Em_flag[$num] = hexdec(getBitValue($Em_Row[initValue],'00.0-00.7')); + $Em_LAC[$num] = hexdec(getBitValue($Em_Row[initValue],'01.0-02.7')); + $Em_CellNum[$num] = hexdec(getBitValue($Em_Row[initValue],'03.0-04.7')); + $tempPrefix = getBitValue($Em_Row[initValue],'05.0-5.7'); + $Em_prefix[$num] = str_replace('E','',$tempPrefix); + $temprouted = getBitValue($Em_Row[initValue],'6.0-13.7'); + $Em_routed[$num] = str_replace('E','',$temprouted); + $Em_ID[$num] = $Em_Row[instanceNo]; + {//Location management + $oidstr_Loc = '2.2.6'; + $objWhereStr_loc =getLevelWhere($oidstr_Loc); + + $paramSql_Loc = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr_loc + "; + if($DEBUG)echo "
      paramSql_Loc: $paramSql_Loc"; + $Result_Loc = mysqli_query($pubConn,$paramSql_Loc); + while($Row_Loc = mysqli_fetch_array($Result_Loc)) + { + $LAC = hexdec(getBitValue($Row_Loc[initValue],'02.0-03.7')); + $tempFlag = hexdec(getBitValue($Row_Loc[initValue],'0.0-0.7')); + if($tempFlag&&($LAC==$Em_LAC[$num])) + { + $trunkgp_Loc[$num] = hexdec(getBitValue($Row_Loc[initValue],'01.0-01.7')); + { + $tmpDb = 'OBJ_322'; + $tmpTable = 'param_99'; + $tmpoid = '2.1.4'; + $objWhereStr = getLevelWhere($tmpoid); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND instanceNo ='$trunkgp_Loc[$num]' + "; + //echo "$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $DPC_TG = hexdec(getBitValue($Row[initValue],'0.0-3.7')); + $NetID_TG = hexdec(getBitValue($Row[initValue],'5.0-5.7')); + + + $tmpDb = 'OBJ_222'; + $tmpTable = 'param_99'; + $tmpoid = '2.4.1'; + $objWhereStr = getLevelWhere($tmpoid); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr + "; + //echo "$paramSql
      "; + $Result_Link = mysqli_query($pubConn,$paramSql); + while($Row_Link = mysqli_fetch_array($Result_Link)) + { + $DPC_link = hexdec(getBitValue($Row_Link[initValue],'0.0-2.7')); + $NetID_link = bindec(getBitValue($Row_Link[initValue],'3.0-3.1')); + if(($DPC_link == $DPC_TG)&&($NetID_link == $NetID_TG)) + { + $linkset[$num] = $Row_Link[instanceNo]; + $num++; + break; + } + } + } + break; + } + } + + }//Location management +} +//echo "$num"; +$rowspan = $num +1; +echo ""; +echo "No."; +echo "Emergency Call flag"; +echo "LAC"; +echo "Cell ID"; +echo "Prefix Number"; +echo "Local emergency number"; +echo ""; + +for($i=0;$i< $num;$i++) +{ + echo ""; + echo "$i"; + echo "{$emFlagArr[$Em_flag[$i]]} "; + echo "$Em_LAC[$i] "; + echo "$Em_CellNum[$i] "; + $temp=hexdec($Em_prefix[$i]); + echo "$temp "; + echo "$Em_routed[$i] "; + echo ""; +} +echo " "; + +?> + +
      + + + + + + diff --git a/wxc2_omc/element/mss/msc_local.php b/wxc2_omc/element/mss/msc_local.php new file mode 100755 index 0000000..cb45961 --- /dev/null +++ b/wxc2_omc/element/mss/msc_local.php @@ -0,0 +1,143 @@ +正在调试中!!"; +?> + + + +indicator = {$indicator[0]}"; + +for($i = 0; $i < 4; $i++) +{ + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + $j= $i+4; + $flag = getBitValue($indicator[0],"0.$j"); + if ($flag == 0) + $spc_index[$j] = $j+4; + else + $spc_index[$j] = $j+8; +} + +for($i = 0; $i < 4; $i ++) +{ + $level_array = explode('.',$spcTree_array[$spc_index[$i]][3]); + + for($j = 0;$j < sizeof($level_array);$j ++) + { + $level_no = $j + 1; + ${level_.$level_no} = $level_array[$j]; + } + $getsql = "select initValue from $sqltable + where level_1 = '$level_1' and level_2 = '$level_2' and level_3 = '$level_3' "; + $result = mysqli_query($pubConn,$getsql); + $row[$i] = mysqli_fetch_array($result); + $row[$i] = hexdec($row[$i][0]); + echo mysqli_error($pubConn); + if($DEBUG)echo "
      getsql = $getsql"; + if($DEBUG)echo "{$row[$i]}"; +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; + +?> + +"; +echo ""; +echo ""; +$BackName = strtoupper(substr($back_page,2,strlen($back_page)-6)); +echo "Configuration > Network > $BackName > MSC SP"; + +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "MSC SP local:  ACNsetting"; +echo "

      $strBack"; +echo "

      "; +?> + + + +" ; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; + +for ($i = 0; $i < 4; $i++) +{ + echo ""; + echo ""; + echo ""; +// echo ""; + echo "" ; + echo ""; +} +?> + +"; +?> diff --git a/wxc2_omc/element/mss/network_edit.php b/wxc2_omc/element/mss/network_edit.php new file mode 100755 index 0000000..a2a55b4 --- /dev/null +++ b/wxc2_omc/element/mss/network_edit.php @@ -0,0 +1,168 @@ +正在调试中!!"; +?> + + + +"; + if($tmpValue == 0 && ($i == 2 || $i == 3)) + $initValue = omc_keep_length($tmpValue,'0',$NetworkCodeArr[$i][2],'0'); + else + $initValue = omc_keep_length($tmpValue,'E',$NetworkCodeArr[$i][2],'0'); + + //write cc, ndc to HLR-HPLMN + if($i < 2) + { + $objWhereStr = getLevelWhere('2.1.11'); + $getsql = "select initValue from $sqltable_hlr where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + $hplmn_init = mysqli_fetch_array($result); + $hplmn_init = $hplmn_init[0]; + if($DEBUG) echo "hplmn_init = $hplmn_init
      "; + if($DEBUG) echo "NetworkCodeArr[$i][4] = {$NetworkCodeArr[$i][4]}
      "; + $hplmn_init = setBitValue($hplmn_init,$NetworkCodeArr[$i][4],$initValue); + + $setsql = "update $sqltable_hlr set initValue = '$hplmn_init' where $objWhereStr"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + } + + $setsql = "update $sqltable set initValue = '$initValue' + where level_1 = '$level_1' and level_2 = '$level_2' and level_3 = '$level_3'"; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + } + + if(!$DEBUG) + { + echo ""; + } +} + +//========================================================== +//取数据库数据 +//========================================================== +for ($i = 0;$i < sizeof($NetworkCodeArr);$i++) +{ + + $sqltable = 'OBJ_225.param_99'; + + $levelArr=explode('.',$NetworkCodeArr[$i][0]); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $getsql = "SELECT initValue FROM $sqltable + where level_1='$level_1' and level_2 = '$level_2' "; + if($DEBUG) echo "
      getsql = $getsql"; + $result = @mysqli_query($pubConn,$getsql); + $Net_row = @mysqli_fetch_array($result); + + ${$NetworkCodeArr[$i][1]} = str_replace('E','',$Net_row[0]); + echo mysqli_error($pubConn); +}; +//========================================================== +//输出并显示数据 +//========================================================== +echo ""; + +echo "
      Network indicatorSPC lengthSPC typeSPC
      {$spcTree_array[$spc_index[$i]][0]}{$spcTree_array[$spc_index[$i]][1]}{$spcTree_array[$spc_index[$i+4]][1]}{$row[$i]}
      "; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > Network > MSC > Network"; +echo ""; +//showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Network edit:  "; +echo ""; +echo ""; +echo "    "; +echo ""; +echo "$strBack"; +echo "
      "; +?> + +"; +echo ""; +echo ""; +echo ""; +for($i=0;$i < sizeof($NetworkCodeArr);$i++) +{ + if($i==$clrFlag) + echo ""; + else + echo ""; + echo ""; + + echo "" ; + + echo ""; +} + +echo "
      ParametersValue
      {$NetworkCodeArr[$i][3]}
      "; + +echo "
      "; + +?> diff --git a/wxc2_omc/element/mss/paramconf.php b/wxc2_omc/element/mss/paramconf.php new file mode 100755 index 0000000..7c51857 --- /dev/null +++ b/wxc2_omc/element/mss/paramconf.php @@ -0,0 +1,1385 @@ + 0)?$TEST:0; + +//echo "page_top:$page_top
      "; +//test +//echo "smsFormatShow:$isShowSms
      "; + +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +//value Type + +$setname= urldecode($setname); +$webname= urldecode($webname); +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; +//$paramTable = 'param_99'; + +if($instanceNo == -1) +{ + echo ""; +} + +function checkInput($upstr,$flag) +{ + if ($flag == 16) + { + $checkOK = "0123456789ABCDEF"; + $checkOK_length = 16; + $showmsg ="Parameter must be a hexadecimal value!"; + } + else + { + $checkOK = "0123456789"; + $checkOK_length = 10; + $showmsg ="Parameter must be a decimal value!"; + } + + $checkStr = $upstr; + $allValid = 1; + $chkstr_len = strlen($checkStr); + for ($i = 0; $i < $chkstr_len; $i++){ + $ch = substr($checkStr,$i,1); + for ($j = 0; $j < $checkOK_length; $j++){ + if ($ch == substr($checkOK,$j,1)) + break; + } + if ($j == $checkOK_length){ + $allValid = 0; + break; + } + } + + if (!$allValid){ + echo ""; + exit(); + } +} + + + + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.paramConf'; + return($tableName); +} + +//=======================Get value From submit=================== + +if($set == 'Save'){ + $oIdstrarr = explode('-',$objIdStr); + $externID = explode('-',$instanceNo); + if($instanceNo == 'new'){ + $instanceNo = ${$setname}; + } + + + if($setname =='Linkset'){ + $tmpDb = 'OBJ_222'; + $tmpTable = 'param_99'; + $tmpoid = '2.4.1'; + $objWhereStr = getLevelWhere($tmpoid); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND instanceNo ='$linkset' + "; +// echo "$paramSql"; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $oldDPC = hexdec(getBitValue($Row[initValue],'0.0-2.7')); + $oldNetID = getBitValue($Row[initValue],'3.0-3.1'); + $oldNetID = bindec($oldNetID); + if($DEBUG) echo "Row[initValue] = $Row[initValue]
      "; + if($DEBUG) echo "oldNetID = $oldNetID
      "; + + if($trunkgp =="" && !($webname =='HLR' ||$webname =='VLR' || $webname =='MSC')){ + $TGsysId = '322_99_99'; + + $TG_sysIdArr = explode('_',$TGsysId); + $TG_sysTypeNo = $TG_sysIdArr[0]; + $TG_sysNo = $TG_sysIdArr[1]; + $TG_subSysNo = $TG_sysIdArr[2]; + + $TG_oidstr = '2.1.4'; + $TG_objWhereStr = getLevelWhere($TG_oidstr); + $TG_objDb = 'OBJ_'.$TG_sysTypeNo; + $TG_paramTable = 'param_'.$TG_sysNo; + + $TG_defSql = " SELECT initValue FROM paramConf WHERE $TG_objWhereStr"; + $TG_defRes = @mysqli_query($pubConn,$TG_defSql); + $TG_row = @mysqli_fetch_array($TG_defRes); + + $TG_paramSql = " SELECT initValue,readValue,instanceNo FROM $TG_paramTable + WHERE $TG_objWhereStr AND initValue ='$TG_row[initValue]' + "; + if($DEBUG) echo "TG_paramSql = $TG_paramSql
      "; + $TG_Result = mysqli_query($pubConn,$TG_paramSql); + $TG_Row = mysqli_fetch_array($TG_Result); + $trunkgp = $TG_Row[instanceNo]; + $strnew = "trunkgp=".$trunkgp; + $backurl = str_replace("trunkgp=",$strnew,$backurl); + if($DEBUG) echo "instanceNo = $TG_Row[instanceNo]
      "; + $flagoffset = "4.0-4.0"; + $TG_Row[initValue] = setBitValue($TG_Row[initValue],$flagoffset,1); + $TG_upSql = "UPDATE $TG_paramTable SET initValue = '$TG_Row[initValue]' + WHERE $TG_objWhereStr AND instanceNo='$trunkgp'"; + if($DEBUG) echo "GPGPGPPGPGPGPGP = $trunkgp
      "; + $delRes = @mysqli_query($pubConn,$TG_upSql); + echo mysqli_error($pubConn); + + + } + + } + if($setname =='Prefix') + { + $setPrefix = strtoupper($unit_1_1); + $setTonIn = $unit_2_1; + $setTonOut = $unit_2_2; + checkDupPrefix($instanceNo,$setPrefix,$setTonIn,$setTonOut); + } + + for($j=1;$j$oIdstrarr[$j]"; + $unitNum = ${'unitNum_'.$j}; +// echo "
      num:$unitNum
      "; + for($i=1;$i<=$unitNum;$i++) + { + $tmpDef = ${'unitDef_'.$j.'_'.$i}; + $tmpValue = ${'unit_'.$j.'_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$j][$i] = $tmpDef; + $tmpDefArr[$j] = explode('-',$tmpDef); + $sortArr[$j][$i] = $tmpDefArr[$j][0]; + $valueArr[$j][$i] = $tmpValue; + +// echo "$tmpValue
      "; + + } + $lastValue = ''; + $k = 0; + asort($sortArr[$j]); + for(reset($sortArr[$j]); $key = key($sortArr[$j]); next($sortArr[$j])) + { + + $unitValue = $valueArr[$j][$key]; + + $unitDefArr = explode('-',$defArr[$j][$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1) + { + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + }else{//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + }else{ + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + + } + if($DEBUG) echo "
      lastValue = $lastValue "; + $setValue = $lastValue; + } + + { + $objWhereStr =getLevelWhere($oIdstrarr[$j]); + $setValue = strtoupper($setValue); + checkInput($setValue,16); + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + } + } + + {//关联参数设置 + $oIdstrarr = explode('-',$objIdStr); + switch($setname){ + case 'TrunkGroup': + { + $RAoffsetarr = array( + "0.0-0.7","2.0-2.7","4.0-4.7","6.0-6.7", + "8.0-8.7","10.0-10.7","12.0-12.7","14.0-14.7", + "16.0-16.7","18.0-18.7","20.0-20.7","22.0-22.7", + "24.0-24.7","26.0-26.7","28.0-28.7","30.0-30.7", + "32.0-32.7"); + + $objstrset='2.1.4'; + $objWhereStr =getLevelWhere($objstrset); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$trunkgp' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + //echo "$paramSql"; + $RAC = hexdec(getBitValue($Row[initValue],'10.0-10.7')); + $RAC = $RAC <= 15 ? $RAC : 16; + $externID[1] = $externID[1] <= 15 ? $externID[1] : 16; + + + $objstrset='2.1.3'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr + "; + $Result = mysqli_query($pubConn,$paramSql); + while($Row = mysqli_fetch_array($Result)) + { + $tempGp = hexdec(getBitValue($Row[initValue],$RAoffsetarr[$externID[1]])); + + if($trunkgp == $tempGp) + { + //$tmp = $externID[1]; + $Row[initValue] = setBitValue($Row[initValue],$RAoffsetarr[$externID[1]],FF); + $tempGp = dechex($tempGp); + $tempGp = omc_keep_length($tempGp,0,2); + $Row[initValue] = setBitValue($Row[initValue],$RAoffsetarr[$RAC],$tempGp); + $updSql = "UPDATE $paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$Row[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + } + } + + break; + } + case 'Linkset': + { + switch($webname){ + case 'HLR': + $SSN = 6; + break; + case 'VLR': + $SSN = 7; + break; + case 'MSC': + $SSN = 8; + break; + } + + $tmpDb = 'OBJ_222'; + $tmpTable = 'param_99'; + $tmpoid = '2.4.1'; + $objWhereStr = getLevelWhere($tmpoid); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND instanceNo ='$linkset' + "; +// echo "$paramSql"; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $DPC = hexdec(getBitValue($Row[initValue],'0.0-2.7')); + $NetID = getBitValue($Row[initValue],'3.0-3.1'); + $NetID = bindec($NetID); + $newNetID = $NetID; + if($DEBUG) echo "Row[initValue] = $Row[initValue]"; + if($DEBUG) echo "NetID = $NetID"; + + //关联GTT的DPC 关联GTT的Network indicator + if($webname =='HLR' ||$webname =='VLR' || $webname =='MSC'){ + $tmpDb = 'OBJ_223'; + $tmpTable = 'param_99'; + $tmpoid = '2.2'; + $objWhereStr = getLevelWhere($tmpoid); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr + "; + $Result = mysqli_query($pubConn,$paramSql); + while($Row = mysqli_fetch_array($Result)){ + $GTT_DPC = hexdec(getBitValue($Row[initValue],'24.0-26.7')); + $GTT_SSN = hexdec(getBitValue($Row[initValue],'27.0-27.7')); + $GTT_NetID = hexdec(getBitValue($Row[initValue],'23.0-23.7')); + $flag = hexdec(getBitValue($Row[initValue],'00.0-00.7')); + if($GTT_DPC == $oldDPC && $GTT_SSN ==$SSN && $flag == 1 && $GTT_NetID == $oldNetID){ + $DPC_GTT = hexdec($DPC); + $DPC_GTT = omc_keep_length($DPC_GTT,0,6); + $Row[initValue] = setBitValue($Row[initValue],'24.0-26.7',$DPC_GTT); + $SSN_GTT = hexdec($SSN); + $SSN_GTT = omc_keep_length($SSN_GTT,0,2); + $Row[initValue] = setBitValue($Row[initValue],'27.0-27.7',$SSN_GTT); + $NetID_GTT = hexdec($NetID); + $NetID_GTT = omc_keep_length($NetID_GTT,0,2); + $Row[initValue] = setBitValue($Row[initValue],'23.0-23.7',$NetID_GTT); + $updSql = "UPDATE $tmpTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$Row[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + } + } + } + else//关联TG的DPC 关联TG的Network indicator + { + + $tmpDb = 'OBJ_322'; + $tmpTable = 'param_99'; + $tmpoid = '2.1.4'; + $objWhereStr = getLevelWhere($tmpoid); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND instanceNo ='$trunkgp' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $DPC_TG = dechex($DPC); + $DPC_TG = omc_keep_length($DPC_TG,0,8); + $Row[initValue] = setBitValue($Row[initValue],'0.0-3.7',$DPC_TG); + $NetID = dechex($NetID); + $NetID = omc_keep_length($NetID,0,2); + $Row[initValue] = setBitValue($Row[initValue],'5.0-5.7',$NetID); + + $updSql = "UPDATE $tmpTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$trunkgp' + "; + mysqli_query($pubConn,$updSql); + } + + //修改routing DPC + //修改AAS OPC + { + $routeNO = $externID[1]; + $DPC = dechex($DPC); + $DPC = omc_keep_length($DPC,0,6); + $AlternativeArr=array( + array('Linkset DPC', '0.0-2.7', 'DPC'), + array('Normal linkset', '3.0-3.7', 'linkset'), + array('Alternative linkset', '4.0-4.7', 'Alternative') + ); + $objDb = 'OBJ_222'; + $paramTable = 'param_99'; + + if($oldNetID == $newNetID){ + $temp = $newNetID+1; + $oidstr = '2.6.'.$temp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo = '$routeNO' + "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + $Row_2[initValue] = setBitValue($Row_2[initValue],$AlternativeArr[0][1],$DPC); + $updSql = "UPDATE $paramTable SET initValue = '$Row_2[initValue]' + WHERE $objWhereStr AND instanceNo = '$routeNO' + "; + mysqli_query($pubConn,$updSql); + if('AAS' == $externID[2]){ + $NIoffset = array("0.0-0.0","0.1-0.1","0.2-0.2","0.3-0.3"); + $oidstr = '2.2'; + $aas_link_Db = 'OBJ_222'; + $aas_link_Table = 'param_11'; + //$subSysNo = $externID[3]; + $subSysNo = 99; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $aas_link_Table + WHERE $objWhereStr AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + $aas_Result = mysqli_query($pubConn,$paramSql); + $aas_Row = mysqli_fetch_array($aas_Result); + + $NIbit = getBitValue($aas_Row[initValue],$NIoffset[$newNetID]); + $tmp = $newNetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + if($DEBUG) echo "oldNetID = $oldNetID
      "; + if($DEBUG) echo "newNetID = $newNetID
      "; + if($DEBUG) echo "$NIbit
      "; + if($DEBUG) echo "$oidstr
      "; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $updSql = "UPDATE $aas_link_Table SET initValue = '$DPC' + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$updSql
      "; + mysqli_query($pubConn,$updSql); + } + + }else{ + $temp = $oldNetID+1; + $oidstr = '2.6.'.$temp; + + $objWhereStr_old= ''; + $objWhereStr_old =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr_old AND instanceNo = '$routeNO' + "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + $Alternative = getBitValue($Row_2[initValue],$AlternativeArr[2][1]); + $updSql = "UPDATE $paramTable SET initValue = '0000008080' + WHERE $objWhereStr_old AND instanceNo = '$routeNO' + "; + mysqli_query($pubConn,$updSql); + + {//拷贝 + $temp = $newNetID+1; + $oidstr = '2.6.'.$temp; + $objWhereStr_new= ''; + $objWhereStr_new =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE initValue = '0000008080' AND $objWhereStr_new + "; + $Result_1 = mysqli_query($pubConn,$paramSql); + $Row_1 = mysqli_fetch_array($Result_1); + + $Row_1[initValue] = setBitValue($Row_1[initValue],$AlternativeArr[0][1],$DPC); + $hex_linkset = dechex($linkset); + $hex_linkset = omc_keep_length($hex_linkset,0,2); + $Row_1[initValue] = setBitValue($Row_1[initValue],$AlternativeArr[1][1],$hex_linkset); + if(isset($Alternative)){ + $Alternative = omc_keep_length($Alternative,0,2); + $Row_1[initValue] = setBitValue($Row_1[initValue],$AlternativeArr[2][1],$Alternative); + } + $updSql = "UPDATE $paramTable SET initValue = '$Row_1[initValue]' + WHERE $objWhereStr_new AND instanceNo = '$Row_1[instanceNo]' + "; +// echo "$Alternative
      "; +// echo "$updSql
      "; + mysqli_query($pubConn,$updSql); + } + + + if('AAS' == $externID[2]){ + $aas_link_Db = 'OBJ_222'; + $aas_link_Table = 'param_11'; + $NIoffset = array("0.0-0.0","0.1-0.1","0.2-0.2","0.3-0.3"); +// $subSysNo = $externID[3]; + $subSysNo = 99; + + $oidstr = '2.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $aas_link_Table + WHERE $objWhereStr AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + $aas_Result = mysqli_query($pubConn,$paramSql); + $aas_Row = mysqli_fetch_array($aas_Result); + + $NIbit = getBitValue($aas_Row[initValue],$NIoffset[$oldNetID]); + $tmp = $oldNetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; +// echo "$oidstr"; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $updSql = "UPDATE $aas_link_Table SET initValue = '000000' + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + mysqli_query($pubConn,$updSql); + + $NIbit_new = getBitValue($aas_Row[initValue],$NIoffset[$newNetID]); + $tmp = $newNetID+1+$NIbit_new*4; + $oidstr = '2.3.'.$tmp; +// echo "$oidstr"; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $updSql = "UPDATE $aas_link_Table SET initValue = '$DPC' + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + mysqli_query($pubConn,$updSql); + } + + + } + } + + + break; + } + case 'E1': + { + $objstrset='2.4.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($objstrset); + $zero = $trunkgp < 15 ? '0' :''; + $HEXtrunkgp = strtoupper($zero.dechex($trunkgp)); + $updSql = "UPDATE $paramTable SET initValue = '$HEXtrunkgp' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + mysqli_query($pubConn,$updSql); + //set flag=1 + + $oidstr = '2.4.4'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $defSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr AND instanceNo ='$instanceNo'"; + $defRes = mysqli_query($pubConn,$defSql); + $row = mysqli_fetch_array($defRes); + + $flagoffset = "1.0-1.7"; + $row[initValue] = setBitValue($row[initValue],$flagoffset,'01'); + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE $objWhereStr AND instanceNo ='$instanceNo'"; + $delRes = mysqli_query($pubConn,$delSql); + + break; + } + case 'Prefix': + case 'Def Prefix': + { + if($setname=='Prefix') + $setTG = $trunkgp; + else + $setTG = $defPrefixTg; + //echo "trunktg:$trunkgp
      "; + //echo "defPrefixTg:$defPrefixTg
      "; + $objstrset='2.1.3'; + $objDb = 'OBJ_322'; + $paramTable = 'param_99'; + $objWhereStr =getLevelWhere($objstrset); + $hex_set_tg = $HEXtrunkgp = omc_keep_length(dechex($setTG),0,2); + $updSql = "UPDATE $paramTable SET initValue = '$hex_set_tg' + WHERE $objWhereStr AND instanceNo = '$instanceNo'"; + //echo "
      $updSql"; + mysqli_query($pubConn,$updSql); + //exit(); + + //Set flag = 1 + $objstrset='2.1.2'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' + "; + //echo "
      $paramSql"; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $Row[initValue] = setBitValue($Row[initValue],'10.7-10.7','1'); + $Row[initValue] = strtoupper($Row[initValue]); + $updSql = "UPDATE $paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + //echo "
      $updSql"; + mysqli_query($pubConn,$updSql); + break; + } + case 'E1_link': + { + $objstrset='2.5.1'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' + "; +// echo "$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $zero = $linkset < 15 ? '0' :''; + $HEXlinkset = strtoupper($zero.dechex($linkset)); + $Row[initValue] = setBitValue($Row[initValue],'00.0-00.7',$HEXlinkset); + $Row[initValue] = setBitValue($Row[initValue],'06.1-06.1','1'); + $updSql = "UPDATE $paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + //Set flag = 1 + mysqli_query($pubConn,$updSql); + + + break; + } + case 'BTS': + { + $objstrset='2.2.8'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + if($DEBUG) echo "$paramSql
      "; + if($DEBUG) echo "$Row[initValue]
      "; + $tempGp = dechex($trunkgp); + $tempGp = omc_keep_length($tempGp,0,2); + $Row[initValue] = setBitValue($Row[initValue],'01.0-01.7',$tempGp); + if($DEBUG) echo "$Row[initValue]
      "; + $LAC = dechex($externID[1]); + $LAC = omc_keep_length($LAC,0,4); + $Row[initValue] = setBitValue($Row[initValue],'02.0-03.7',$LAC); + $Row[initValue] = setBitValue($Row[initValue],'0.0-0.7','01'); + + if($DEBUG) echo "$Row[initValue]
      "; + $Em_CellNum = getBitValue($Row[initValue],'04.0-05.7'); + $updSql = "UPDATE $paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + mysqli_query($pubConn,$updSql); + if($DEBUG) echo "$updSql
      "; + //---------------------------- + $objstrset='2.2.5'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $Row[initValue] = setBitValue($Row[initValue],'03.0-04.7',$Em_CellNum); + $LAC = dechex($externID[1]); + $LAC = omc_keep_length($LAC,0,4); + $Row[initValue] = setBitValue($Row[initValue],'01.0-02.7',$LAC); + $updSql = "UPDATE $paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + mysqli_query($pubConn,$updSql); + break; + } + case 'GTT': + { + switch($webname){ + case 'HLR': + $SSN = 6; + break; + case 'VLR': + $SSN = 7; + break; + case 'MSC': + $SSN = 8; + break; + } + //LINKSET DPC + $sysId = '222_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.4.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo ='$linkset' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $DPC = getBitValue($Row[initValue],'0.0-2.7'); + $NetID = bindec(getBitValue($Row[initValue],'3.0-3.1')); + + //DPC END + + $sysId = '223_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' + "; +// echo "$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + $DPC = omc_keep_length($DPC,"0","6"); + $Row[initValue] = setBitValue($Row[initValue],'24.0-26.7',$DPC); + $SSN = omc_keep_length($SSN,"0","2"); + $Row[initValue] = setBitValue($Row[initValue],'27.0-27.7',$SSN); + $NetID = dechex($NetID); + $NetID = omc_keep_length($NetID,"0","2"); + $Row[initValue] = setBitValue($Row[initValue],'23.0-23.7',$NetID); + $Row[initValue] = setBitValue($Row[initValue],'00.0-00.7','01'); + + $updSql = "UPDATE $paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + //Set flag = 1 + mysqli_query($pubConn,$updSql); + + + } + case 'Service number': + { + $smscTable = "OBJ_350.param_99"; + $setValue = omc_keep_length($unit_2_1,'E',16,0); + $updSql = "update $smscTable set initValue='$setValue' where level_1=2 and level_2=2 and level_3=4 and instanceNo=0"; + mysqli_query($pubConn,$updSql); + + $setValue = omc_keep_length($unit_3_1,'E',16,0); + $updSql = "update $smscTable set initValue='$setValue' where level_1=2 and level_2=2 and level_3=4 and instanceNo=1"; + mysqli_query($pubConn,$updSql); + break; + } + default: + } +// echo "$updSql"; + echo mysqli_error($pubConn); + + + if($setname=='Prefix manipulation')//add by arwean 2006-9-1 16:21 + { + //getElementInfo($infoNo,$elementInfoArr); + //$eleName = $elementInfoArr[eleName]; + $eleName = "Info".$infoNo; + $setDb = "OBJ_225"; + $levelWhere = getLevelWhere($oIdstrarr[1]); + $selSql = "select initValue from param_99 where $levelWhere and instanceNo='$instanceNo'"; + $Result = mysqli_query($pubConn,$selSql); + $Row = mysqli_fetch_array($Result); + if(strlen($infoNo)==0) + $eleName = $webname; + //====get the ISDN title + else + { + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + do + { + + //======assign tg + $trunk_tmp=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; + if($trunk_tmp==$trunkgp) + { + //=======title + $title=getBitValue($rows[initValue],'14.0-23.7'); + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($title,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $title=$temp; + $eleName=$title; + break; + } + }while($rows=mysqli_fetch_array($result)); + + } + + $tmpName = omc_keep_length(toHex($eleName),'0','16',0);//$webname=MSC,SWITCH,PPS. + $setValue = setBitValue($Row[initValue],'35.0-42.7',$tmpName); + $updSql = "update OBJ_225.param_99 set initValue='$setValue' where $levelWhere and instanceNo='$instanceNo'"; + mysqli_query($pubConn,$updSql); + + } + + } + + + if($setname =='Local Prefix') + { + //local_prefix_text + //====把值补到16个字节== + $local_prefix_text=trim($local_prefix_text); + + $n=strlen($local_prefix_text); + $m=16-$n; + $set_value=""; + + for($i=0;$i<$n;$i++) + { + $temp=substr($local_prefix_text,$i,1); + $temp=ord($temp); + $temp=dechex($temp); + $set_value.=$temp; + } + for($i=0;$i<$m;$i++) + $set_value.="00"; + + + $database="OMC_PUB"; + //==========set the value======== + $setsql = "update OBJ_370.param_99 set initValue='$set_value' where level_1=2 and level_2=1 and level_3=7 and instanceNo=$instanceNo "; + if($DEBUG) + echo "setsql=$setsql
      "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + + //=========set the white list number======= + if($setname="white_list_number") + { + //====start imei type approval code + $start_type_text=trim($start_type_text); + $n=strlen($start_type_text); + for($i=0;$i<6-$n;$i++) + { + $start_type_text="0".$start_type_text; + } + //====end imei type approval code======== + $end_type_text=trim($end_type_text); + $n=strlen($end_type_text); + for($i=0;$i<6-$n;$i++) + { + $end_type_text="0".$end_type_text; + } + //====start imei final assembly code===== + $start_final_text=trim($start_final_text); + $n=strlen($start_final_text); + for($i=0;$i<2-$n;$i++) + { + $start_final_text="0".$start_final_text; + } + //=====end imei final assembly code======= + $end_final_text=trim($end_final_text); + $n=strlen($end_final_text); + for($i=0;$i<2-$n;$i++) + { + $end_final_text="0".$end_final_text; + } + //=====start imei serial number======== + $start_serial_text=trim($start_serial_text); + $n=strlen($start_serial_text); + for($i=0;$i<6-$n;$i++) + { + $start_serial_text="0".$start_serial_text; + } + //=======end imei serial number========== + $end_serial_text=trim($end_serial_text); + $n=strlen($end_serial_text); + for($i=0;$i<6-$n;$i++) + { + $end_serial_text="0".$end_serial_text; + } + //========start imei software version======== + $start_software_text=trim($start_software_text); + $n=strlen($start_software_text); + for($i=0;$i<2-$n;$i++) + { + $start_software_text="0".$start_software_text; + } + //=======end imei software version=========== + $end_software_text=trim($end_software_text); + $n=strlen($end_software_text); + for($i=0;$i<2-$n;$i++) + { + $end_software_text="0".$end_software_text; + } + + $database="OMC_PUB"; + $set_value=$start_type_text.$start_final_text.$start_serial_text.$start_software_text; + $set_value=$set_value.$end_type_text.$end_final_text.$end_serial_text.$end_software_text; + /* + $n=strlen($set_value); + echo "\n\n"; +*/ + //==========set the value======== + + $setsql = "update OBJ_380.param_99 set initValue='$set_value' where level_1=2 and level_2=1 and level_3=2 and instanceNo=$instanceNo "; + if($DEBUG) + echo "setsql=$setsql
      "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + } + +if($DEBUG){ + echo "
      debug"; +}else{//return page + echo ""; + exit(); +} + +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +
      " > +"; +echo ""; +echo ""; +if($from_bss==1) + echo "$strConfiguration > Network > BSS > $setname"; +else + echo "$strConfiguration > Network > $webname > $setname"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; +$oIdstrarr = explode('-',$objIdStr); +$routingNo = explode('-',$instanceNo); + +echo ""; +echo ""; +echo ""; + +echo ""; + +echo ""; +echo "
       "; +/* + if($instanceNo == 'new' || $oIdstrarr[0] =='new'){ + echo "Add a $setname:  "; + }else{ + echo "Edit $setname:  "; + } + */ +echo ""; + echo ""; + echo "   "; + echo ""; +echo ""; +//echo "$backurl"; +$backurl=$backurl."&smsFormatShow=$isShowSms"."&scroll_y=".$sub_page_top; + +echo "

      $strBack"; +echo "

      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +if($setname=="Local Prefix") +{ + //================get the value of the local prefix of mnp========= + $database="OBJ_370"; + $sql="select initValue from param_99 where level_1=2 and level_2=1 and level_3=7 and instanceNo=$instanceNo "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $tmp_value=$rows[initValue]; + $temp=""; + for($num=0;$num<16;$num++) + { + $str=substr($tmp_value,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $local_prefix_value=trim($temp); + echo ""; + echo ""; + echo ""; + echo ""; +} + +//=====================white list number for eir============================ +if($setname=="white_list_number") +{ + //================get the value of this instanceNo========= + $database="OBJ_380"; + $sql="select initValue from param_99 where level_1=2 and level_2=1 and level_3=2 and instanceNo=$instanceNo "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + + $start_type=getBitValue($rows[initValue],'0.0-2.7'); + $end_type=getBitValue($rows[initValue],'8.0-10.7'); + $start_final=getBitValue($rows[initValue],'3.0-3.7'); + $end_final=getBitValue($rows[initValue],'11.0-11.7'); + $start_serial=getBitValue($rows[initValue],'4.0-6.7'); + $end_serial=getBitValue($rows[initValue],'12.0-14.7'); + $start_software=getBitValue($rows[initValue],'7.0-7.7'); + $end_software=getBitValue($rows[initValue],'15.0-15.7'); + + + //=====start IMEI type approval code + echo ""; + echo ""; + echo ""; + echo ""; + //=====end IMEI type approval code + echo ""; + echo ""; + echo ""; + echo ""; + + //=====start IMEI final assembly code + echo ""; + echo ""; + echo ""; + echo ""; + + //=====end IMEI final assembly code + echo ""; + echo ""; + echo ""; + echo ""; + + //=====start IMEI serial number + echo ""; + echo ""; + echo ""; + echo ""; + + //=====end IMEI serial number + echo ""; + echo ""; + echo ""; + echo ""; + //=====start IMEI software version + echo ""; + echo ""; + echo ""; + echo ""; + //=====end IMEI software version + echo ""; + echo ""; + echo ""; + echo ""; +} + +if($setname != 'BTS' && $oIdstrarr[0] !='no'){ + {//xxx No. + echo ""; + echo ""; + if($instanceNo == 'new') + { + switch($setname){ + case 'TrunkGroup': + $nowid = $trunkgp; + break; + case 'Linkset': + $nowid = $linkset; + break; + default: + $nowid = $instanceNo; + } + $objDb = omcGetObjDb($sysTypeNo); + $paramConfTable = omcGetObjTbl($sysTypeNo,paramConf); + + $objWhereStr =getLevelWhere($oIdstrarr[0]); + +//200510004 $paramTable = 'param_99'; + $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr"; + // echo "$getInstanceSql"; + $result=mysqli_query($pubConn,$getInstanceSql); + + $flagoffset = omcShowParam($oIdstrarr[0],$sysTypeNo,'flag',$language,'1'); + + + echo ""; + } + else + { + //echo ""; + echo ""; + + } + + echo ""; + } +} +for($j=1;$jlevelWhere=$levelWhere"; + $othersElementParamTable='OBJ_225.param_99'; + $getSql="SELECT initValue,instanceNo FROM $othersElementParamTable + WHERE $levelWhere and initValue LIKE '01%'"; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $typeOffset = '1.0-1.7'; + $tgOffset = '3.0-3.7'; + $nameOffset = '14.0-23.7'; + $i=0; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $tmpType=getBitValue($rows[initValue],$typeOffset); + if($tmpType==0) + continue; + $type = hexdec($tmpType); + if($type==16 || $type == 17) + { + $tg = hexdec(getBitValue($rows[initValue],$tgOffset)); + $name=getBitValue($rows[initValue],$nameOffset); + if($name==0) + $name=$tg; + else + $name=trim(toAscii($name)); + + $switchArr[$i][tg] = $tg; + $switchArr[$i][name] = $name; + $i++; + } + } + }//end otherelments + + echo "
      "; + echo ""; + echo ""; + echo ""; + + + + + + +} +echo "
      ParametersValue
      Local Prefix
      Start IMEI Type Approval Code
      End IMEI Type Approval Code
      Start IMEI Final Assembly Code
      End IMEI Final Assembly Code
      Start IMEI Serial Number
      End IMEI Serial Number
      Start IMEI Software Version
      End IMEI Software Version
      $setname No."; + $nShowsize ='40%'; + echo ""; + echo "$instanceNo$routingNo[0]
      Trunk Group"; + echo ""; + echo "
      "; +if(isset($convInstNo)) + echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
      "; +?> + + + + + diff --git a/wxc2_omc/element/mss/pps.php b/wxc2_omc/element/mss/pps.php new file mode 100755 index 0000000..dac2e28 --- /dev/null +++ b/wxc2_omc/element/mss/pps.php @@ -0,0 +1,2522 @@ +正在调试中!!!"; + +//echo "page_top:$page_top
      "; +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +?> + +\n"; + echo "alert('$msg')"; + echo "\n"; + } +?> + +"; + + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +$nGetComm = 0; +$nSetComm = 3; + +$maxNum = 120; + +$mtp3_sqlTable = 'OBJ_222.param_99'; +$sqltable = 'OBJ_360.param_99'; +$sqltable_conf = 'OBJ_360.paramConf'; +$sqltable_sccp = 'OBJ_223.param_99'; +$sysStatTable='OMC_PUB.sysStat'; +$sysId = '360_99_99'; +$net_paramTable ='OBJ_225.param_99';//xapp +$net_paramConf ='OBJ_225.paramConf'; + +$pubDb = 'OMC_PUB'; +$sysinfo = 'OMC_PUB.sysInfo'; +$sysTypeNo = '322'; + +$sysId_arr=array( + array('oid'=>'2.1.1', 'sysid'=> '360_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=> '360_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=> '360_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.5', 'sysid'=> '360_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.19', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.147', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.153', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.8', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.2', 'sysid'=> '350_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.1', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.4', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'), +); + +$SaveArr=array( + array('oidstr'=>'2.1.6.2', 'setvalue'=>'01' ,'sysid'=>'360_99_99'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99'), + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99'), + array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=>'350_99_99'), +); + +$url_add = './pps.php'; + +//loading +if($load_flag == 1) +{ + echo "
      Loading"; + + GetParam($sysId_arr,1);//1 means return to overview if getting parameters fails. + + echo ""; +} + +if(isset($doingOtherFlag)) +{ + if($setVmsRouting==1) + { + $callType=4; + $trunkgp=252; + $oldPrefix = $oldValue; + $newPrefix = $newValue; + updatePrefix($oldPrefix,$newPrefix,$callType,$trunkgp); + + {//set tg 252 enable + $levelWhere = getLevelWhere("2.1.4"); + $updSql = "update OBJ_322.param_99 set initValue='000000000B0302FF0000000000' where $levelWhere and instanceNo=252"; + mysqli_query($pubConn, $updSql); + }//end set tg 252 enable + exit; + } + {//get system ip + for($i=0; $i < 2; $i++) + { + $getsql = "SELECT ip FROM $sysinfo where sysTypeNo = $sysTypeNo and sysNo = '$i'"; + if($DEBUG) echo "getsql = $getsql
      "; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = strtoupper(omc_keep_length($mss_ip[0],'0','8')); + $mss_ip[1] = strtoupper(omc_keep_length($mss_ip[1],'0','8')); + + $sysId = "223_99_99"; + }//end get system ip + if($setEmse==1) + { + //emse + $oidStr = "2.1.19"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + + {//get service number + $service_num_arr = array( + array('Hotline','Hotline'), + array('Inquiry','Inquiry'), + array('Recharge via recharge card','recharge_card'), + array('Recharge via credit card','recharge_credit'), + array('Third party recharge','third_party'), + array('Customer care center','care_center'), + array('Recharge number','recharge_num'), + ); + + $objWhereStr = getLevelWhere('2.1.2.2'); + $getsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + + $i=0; + while($service_row = mysqli_fetch_array($result)) + { + ${$service_num_arr[$i][1]} = trim(toAscii($service_row[0])); + $i++; + } + + $serviceNumArr = array(${$service_num_arr[1][1]},${$service_num_arr[2][1]}); + }//end get service number + {//update smsc udp smpp parameters. + $gtt_emse = $newValue; + $smscTable = "OBJ_350.param_99"; + $updDataArr = array( + array('value' => 'PPS', 'level_3' => '1', 'len' => 32),//name + array('value' => 'PPS', 'level_3' => '2', 'len' => 30), //system id + array('value' => '123456', 'level_3' => '3', 'len' => 16), //password + array('value' => $gtt_emse, 'level_3' => '6', 'len' => 18), //opposite sccp number + array('value' => '03', 'level_3' => '14', 'len' => 2) //link flag + ); + for($j=0; $j< sizeof($serviceNumArr); $j++) + { + $updDataArr[5] = array('value' => $serviceNumArr[$j], 'level_3' => '4', 'len' => 16); //service number + $instNo = $j; + for($i=0; $i< sizeof($updDataArr); $i++) + { + if($i==3 || $i==4 || $i==5) + $setValue = omc_keep_length($updDataArr[$i][value],'E',$updDataArr[$i][len],0); + else + $setValue = omc_keep_length(toHex($updDataArr[$i][value]),'0',$updDataArr[$i][len],0); + $updSql = "update $smscTable set initValue='$setValue' where level_1=2 and level_2=2 and level_3={$updDataArr[$i][level_3]} and instanceNo=$instNo"; + mysqli_query($pubConn,$updSql); + if($DEBUG) echo "
      $updSql
      "; + } + } + }//end update smsc udp smpp parameters. + } + if($setScf==1) + { + //scf + $oidStr = "2.1.147"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + if($setScfMap==1) + { + //scf_map + $oidStr = "2.1.153"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + + exit; +} +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + for($i=0; $i < 2; $i++) + { + $tmp = ${'srf'.$i.'_save'}; + if(isset($tmp)) + { + $oid = '2.1.2.1.'.($i+1); + $initValue_0 = omc_keep_length(toHex(${'srf'.$i}),'0','32',0); + $objWhereStr = getLevelWhere($oid); + $setsql = "update $sqltable set initValue = '$initValue_0' where $objWhereStr"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + } + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + + SetParam($sysId_arr); + session_register("SetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + echo ""; + //exit(); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } + + echo ""; + exit(); +} + +if ($DEBUG) echo "delFlag = $delflag
      "; +if ($DEBUG) echo "delNO = $delValue
      "; +if (isset($delflag)) +{ + $delNoStr = rtrim($delNoStr,'.'); + $delNoArr = explode('.',$delNoStr); + $instNoWhereStr = ''; + for($i=0; $i< sizeof($delNoArr); $i++) + { + if($i==0) + $instNoWhereStr = "(instanceNo='$delNoArr[$i]'"; + else + $instNoWhereStr .= " or instanceNo='$delNoArr[$i]'" ; + } + $instNoWhereStr .= ')'; + //echotest + //echo "instNoWhereStr:$instNoWhereStr
      "; + if($delflag == 'vmsSeg') + { + $objWhereStr = getLevelWhere('2.1.5.5'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $vmsSegOrg = mysqli_fetch_array($result); + $init = $vmsSegOrg[0]; + + $objWhereStr = getLevelWhere('2.1.5.5'); + $setsql = "update $sqltable set initValue = '$init' where $objWhereStr and $instNoWhereStr "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + else if($delflag == 'tar') + { + $objWhereStr = getLevelWhere('2.1.1.10'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $tariff_org = mysqli_fetch_array($result); + $init = $tariff_org[0]; + + $objWhereStr = getLevelWhere('2.1.1.10'); + $setsql = "update $sqltable set initValue = '$init' where $objWhereStr and $instNoWhereStr "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + else if($delflag == 'sms') + { + $objWhereStr = getLevelWhere('2.1.1.6'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $tariff_org = mysqli_fetch_array($result); + $init = $tariff_org[0]; + + $objWhereStr = getLevelWhere('2.1.1.6'); + $setsql = "update $sqltable set initValue = '$init' where $objWhereStr and instanceNo = '$delValue' "; + mysqli_query($pubConn,$setsql); + + $objWhereStr = getLevelWhere('2.1.1.7'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $tariff_org = mysqli_fetch_array($result); + $init = $tariff_org[0]; + + $objWhereStr = getLevelWhere('2.1.1.7'); + $setsql = "update $sqltable set initValue = '$init' where $objWhereStr and instanceNo = '$delValue' "; + mysqli_query($pubConn,$setsql); + } + else if($delflag == 'thirdPar') + { + $objWhereStr = getLevelWhere('2.1.1.9'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $thirdPart_org = mysqli_fetch_array($result); + $init = $thirdPart_org[0]; + + $objWhereStr = getLevelWhere('2.1.1.9'); + $setsql = "update $sqltable set initValue = '$init' where $objWhereStr and $instNoWhereStr "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + else if($delflag == 'mnpPrefix') + { + $objWhereStr = getLevelWhere('2.1.1.12'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $mnpPrefix_org = mysqli_fetch_array($result); + $init = $mnpPrefix_org[0]; + + $setsql = "update $sqltable set initValue = '$init' where $objWhereStr and $instNoWhereStr "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + else if($delflag == 'dailing'||$delflag=='srf') + { + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $flagoffset = "10.7-10.7"; + $row[initValue] = setBitValue($row[initValue],$flagoffset,0); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND $instNoWhereStr"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND $instNoWhereStr"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $oidstr = '2.1.3'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND $instNoWhereStr"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + else if($delflag == 'conv'||$delflag=='conv_srf') //conv prefix + { + //=====get the default value ======================= + $database="OBJ_225"; + $sql="select initValue from paramConf where level_1=2 and level_2=8 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $conv_default=$rows[initValue]; + //========================= + $objWhereStr = getLevelWhere('2.8.0'); + $setsql = "update $net_paramTable set initValue = '$conv_default' where $objWhereStr and $instNoWhereStr"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; +{//show header part + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + + echo "Configuration > Network > PPS"; + echo ""; + $helpID = '2.1.1.6'; + showHelp($helpID); + echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +}//end show header part + +if(!isset($smsShow)&&!isset($srfShow)&&!isset($vmsShow)) + $smsShow=1; +if($smsShow==1) +{ + $bcSMS = '#E6E6E6'; + $smsShowStr = ''; +} +else +{ + $bcSMS = ''; + $smsShowStr = 'none'; +} +if($srfShow==1) +{ + $srfShowStr = ''; + $bcSRF = '#E6E6E6'; +} +else +{ + $bcSRF = ''; + $srfShowStr = 'none'; +} + +if($vmsShow==1) +{ + $vmsShowStr = ''; + $bcVMS = '#E6E6E6'; +} +else +{ + $bcVMS = ''; + $vmsShowStr = 'none'; +} + +$backurl = "./pps.php?smsShow=$smsShow&srfShow=$srfShow&vmsShow=$vmsShow"; + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "PPS Service"; + echo ""; + echo "SRF Service"; + echo ""; + echo "VMS Routing"; + echo "
      "; + +{// pps service. +echo ""; +echo ""; +{//signaling point + $spcTree_array = array( + array('INT', '14-bit', 'spc_int_14', '2.3.1'), + array('INT-S', '14-bit', 'spc_int_sp_14', '2.3.2'), + array('NAT', '14-bit', 'spc_nat_14', '2.3.3'), + array('NAT-S', '14-bit', 'spc_nat_sp_14', '2.3.4'), + array('International', '24-bit', 'spc_int_24', '2.3.5'), + array('International spare','24-bit', 'spc_int_sp_24', '2.3.6'), + array('National', '24-bit', 'spc_nat_24', '2.3.7'), + array('National spare', '24-bit', 'spc_nat_sp_24', '2.3.8') + ); + + $querysql = "select initValue from $mtp3_sqlTable where level_1 = '2' and level_2 = '2' and level_3 = '0'"; + $result = mysqli_query($pubConn,$querysql); + $indicator = mysqli_fetch_array($result); + echo mysqli_error($pubConn); + if($DEBUG)echo "
      indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } + + for($i = 0; $i < 4; $i ++) + { + $level_array = explode('.',$spcTree_array[$spc_index[$i]][3]); + + for($j = 0;$j < sizeof($level_array);$j ++) + { + $level_no = $j + 1; + ${level_.$level_no} = $level_array[$j]; + } + $getsql = "select initValue from $mtp3_sqlTable + where level_1 = '$level_1' and level_2 = '$level_2' and level_3 = '$level_3' "; + $result = mysqli_query($pubConn,$getsql); + $row[$i] = mysqli_fetch_array($result); + $row[$i] = hexdec($row[$i][0]); + if($DEBUG)echo "getsql = $getsql
      "; + if($DEBUG)echo "spc_$i=$row[$i]
      "; + } +} + +echo "" ; +echo ""; +echo ""; +echo ""; + +//========================================================== +//输出Global Title +//========================================================== +{//start emse + + echo ""; + echo ""; +}//end emse +{//start scf + $oidStr = "2.1.147"; + echo ""; + echo ""; + echo ""; +}//end scf +{//start scf_map + $oidStr = "2.1.153"; + $instanceNo=0; + echo ""; + echo ""; + echo ""; + echo "" ; +}//end scf_map + + echo ""; + echo ""; + echo ""; + +$sysId = "360_99_99"; +//========================================================== +//输出CDR +//========================================================== +{ + echo ""; + echo ""; + $oidStr = '2.1.1.1'; + echo ""; + echo ""; +} + +//========================================================== +//输出Maximum balance +//========================================================== +{ + echo ""; + echo ""; + $oidStr = '2.1.1.3'; + echo ""; + echo ""; +} +//========================================================== +//输出Blacklist threshold +//========================================================== +{ + echo ""; + echo ""; + $oidStr = '2.1.1.2'; + echo ""; + echo ""; +} +//========================================================== +//输出Currency symbol +//========================================================== +{ + echo ""; + echo ""; + $oidStr = '2.1.1.8'; + echo ""; + echo ""; +} +//========================================================== +//输出Prompt resolution +//========================================================== +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +//========================================================== +//输出Third party info. +//========================================================== +{ + $objWhereStr = getLevelWhere('2.1.1.9'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $thirdPart_org = mysqli_fetch_array($result); + $thirdPart_org = $thirdPart_org[0]; + if($DEBUG) echo "thirdPart_org = $thirdPart_org
      "; + + $objWhereStr = getLevelWhere('2.1.1.9'); + $getsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + + $i = 0; + $thirdPart_num = 0; + while($thirdPart_row = mysqli_fetch_array($result)) + { + $thirdPart_row = $thirdPart_row[0]; + if($thirdPart_row != $thirdPart_org) + { + $serverID[$thirdPart_num] = trim(toAscii(getBitValue($thirdPart_row,'00.0-07.7'))); + $serverPWD[$thirdPart_num] = trim(toAscii(getBitValue($thirdPart_row,'08.0-15.7'))); + $thirdPar_ins[$thirdPart_num]=$i; + if($DEBUG) + { + echo "
      serverID = $serverID[$thirdPart_num]
      "; + echo "serverPWD = $serverPWD[$thirdPart_num]
      "; + } + $thirdPart_num++; + } + else if(!isset($thirdPar_ins_unused)) + { + $thirdPar_ins_unused = $i; + } + $i++; + } + + if($thirdPart_num == 0) $nrow = $thirdPart_num + 2; + else $nrow = $thirdPart_num + 1; + $objIdStr = "no-2.1.1.9"; + $webname = "PPS"; + $setname = "Third party info"; + echo ""; + echo ""; + + if($thirdPart_num == 0) + echo ""; + else + { + echo ""; + } + echo ""; +} +//========================================================== +//输出Basic tariff zone +//========================================================== +{ + $objWhereStr = getLevelWhere('2.1.1.10'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $tariff_org = mysqli_fetch_array($result); + $tariff_org = $tariff_org[0]; + if($DEBUG) echo "tariff_org = $tariff_org
      "; + + $objWhereStr = getLevelWhere('2.1.1.10'); + $getsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + + $i = 0; + $tariff_num = 0; + while($tariff_row = mysqli_fetch_array($result)) + { + $tariff_row = $tariff_row[0]; + if($tariff_row != $tariff_org) + { + $mcc[$tariff_num] = getBitValue($tariff_row,'00.0-01.7'); + $mnc[$tariff_num] = getBitValue($tariff_row,'02.0-02.7'); + $lac[$tariff_num] = hexdec(getBitValue($tariff_row,'03.0-04.7')); + $cell_id[$tariff_num] = hexdec(getBitValue($tariff_row,'05.0-06.7')); + $mo_tar[$tariff_num] = hexdec(getBitValue($tariff_row,'07.0-07.7')); + $mt_tar[$tariff_num] = hexdec(getBitValue($tariff_row,'08.0-08.7')); + $tar_ins[$tariff_num] = $i; + if($DEBUG) + { + echo "
      mcc = $mcc[$tariff_num]
      "; + echo "mnc = $mnc[$tariff_num]
      "; + echo "lac = $lac[$tariff_num]
      "; + echo "cell_id = $cell_id[$tariff_num]
      "; + echo "mo_tar = $mo_tar[$tariff_num]
      "; + echo "mt_tar = $mt_tar[$tariff_num]
      "; + } + $tariff_num++; + } + else if(!isset($tar_ins_unused)) + { + $tar_ins_unused = $i; + } + $i++; + } + + if($tariff_num == 0) $nrow = $tariff_num + 2; + else $nrow = $tariff_num + 1; + + $objIdStr = "no-2.1.1.10"; + $webname = "PPS"; + $setname = "Basic tariff zone"; + + echo ""; + echo ""; + + if($tariff_num == 0) + echo ""; + else + { + echo ""; + } + echo ""; +} + + +//========================================================== +//输出Support MNP +//========================================================== +{ + echo ""; + echo ""; + $sysId = "360_99_99"; + $oidStr = '2.1.1.11'; + echo ""; + echo ""; +} + +//========================================================== +//输出MNP Prefix. +//========================================================== +{ + $objWhereStr = getLevelWhere('2.1.1.12'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $mnpPrefix_org = mysqli_fetch_array($result); + $mnpPrefix_org = $mnpPrefix_org[0]; + if($DEBUG) echo "mnpPrefix_org = $mnpPrefix_org
      "; + + $getsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + + $i = 0; + $mnpPrefix_num = 0; + while($mnpPrefix_row = mysqli_fetch_array($result)) + { + $mnpPrefix_row = $mnpPrefix_row[0]; + if($mnpPrefix_row != $mnpPrefix_org) + { + $mnpPrefix[$mnpPrefix_num] = trim(toAscii(getBitValue($mnpPrefix_row,'00.0-15.7'))); + $mnpPrefix_ins[$mnpPrefix_num]=$i; + if($DEBUG) + { + echo "
      mnpPrefix = $mnpPrefix[$mnpPrefix_num]
      "; + } + $mnpPrefix_num++; + } + else if(!isset($mnpPrefix_ins_unused)) + { + $mnpPrefix_ins_unused = $i; + } + $i++; + } + + if($mnpPrefix_num == 0) + $nrow = $mnpPrefix_num + 2; + else + $nrow = $mnpPrefix_num + 1; + $objIdStr = "no-2.1.1.12"; + $webname = "PPS"; + $setname = "MNP Prefix"; + echo ""; + echo ""; + + if($mnpPrefix_num == 0) + echo ""; + else + { + echo ""; + } + echo ""; +} + +/* +//========================================================== +//输出License +//========================================================== +{ + echo ""; + echo ""; + $sysId = "360_99_99"; + $oidStr = '2.1.1.4'; + echo ""; + echo ""; +} +*/ +//========================================================== +//输出COS +//========================================================== +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +if($smsFormatShow==1) +{ + $showStr = ''; + $cmdShowStr = "none"; +} +else +{ + $showStr = "none"; + $cmdShowStr = ''; +} +echo ""; + echo ""; + echo ""; +echo ""; + +//========================================================== +//输出SMS format +//========================================================== +{ + $smEncodeTypeArr = array(0 => '7 bit', 4 => 'Octet', 8 => 'Unicode'); + $objWhereStr = getLevelWhere('2.1.1.6'); + $defSql = "select initValue from $sqltable_conf where $objWhereStr"; + $defRes = mysqli_query($pubConn,$defSql); + $defRow = mysqli_fetch_array($defRes); + $smsDefValue = $defRow[initValue]; + + $getsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + + $i = 0; + $sms_num = 0; + while($sms_row = mysqli_fetch_array($result)) + { + $sms_row = strtoupper($sms_row[0]); + $enable_flag = getBitValue($sms_row,'0.4-0.7'); +// if($sms_row != $smsDefValue) +// { + $encode[$sms_num] = hexdec(getBitValue($sms_row,'00.0-00.7')); + $acc_balance[$sms_num] = trim(toAscii(getBitValue($sms_row,'01.0-31.7'))); + $expire[$sms_num] = trim(toAscii(getBitValue($sms_row,'32.0-63.7'))); + $recharge[$sms_num] = trim(toAscii(getBitValue($sms_row,'64.0-111.7'))); + + if($DEBUG) + { + echo "
      encode[$sms_num] = $encode[$sms_num]
      "; + echo "acc_balance[$sms_num] = $acc_balance[$sms_num]
      "; + echo "expire[$sms_num] = $expire[$sms_num]
      "; + echo "recharge[$sms_num] = $recharge[$sms_num]
      "; + } + + $objWhereStr = getLevelWhere('2.1.1.7'); + $getsql = "select initValue from $sqltable where $objWhereStr and instanceNo=$i"; + $lc_result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $last_call_row = mysqli_fetch_array($lc_result); + $last_call_row = $last_call_row[0]; + + $last_sent[$sms_num] = trim(toAscii(getBitValue($last_call_row,'00.0-31.7'))); + $to[$sms_num] = trim(toAscii(getBitValue($last_call_row,'72.0-79.7'))); + $recv_on[$sms_num] = trim(toAscii(getBitValue($last_call_row,'32.0-63.7'))); + $from[$sms_num] = trim(toAscii(getBitValue($last_call_row,'80.0-87.7'))); + $at[$sms_num] = trim(toAscii(getBitValue($last_call_row,'64.0-71.7'))); + + if($DEBUG) + { + echo "
      last_sent[$sms_num] = $last_sent[$sms_num]
      "; + echo "to[$sms_num] = $to[$sms_num]
      "; + echo "recv_on[$sms_num] = $recv_on[$sms_num]
      "; + echo "from[$sms_num] = $from[$sms_num]
      "; + echo "at[$sms_num] = $at[$sms_num]
      "; + } + + $sms_ins[$sms_num] = $i; + $sms_num++; +// } +// if(!isset($tar_ins_unused)) +// { +// $sms_ins_unused = $i; +// } + $i++; + } + + $nrow = ($sms_num + 1) * 2; + + echo ""; + echo ""; + + echo "";//end +} +echo ""; + echo ""; + echo ""; +echo ""; + +echo ""; +}//end pps service. + +{//srf service. +echo "
      PPS Service
      Signaling point code"; +for($i=0; $i<4; $i++) + echo ""; +echo "
      {$spcTree_array[$i][0]} : {$spcTree_array[$spc_index[$i]][1]} : $row[$i]
      $strE164Number(EMSE)"; + $sysId = "223_99_99"; + $oidStr = "2.1.19"; + $instanceNo=0; + echo ""; + echo ""; + echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setEmse=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      $strE164Number(SCF-CAP)"; + echo ""; + + echo ""; + echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setScf=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      $strE164Number(SCF-MAP)"; + echo ""; + + echo ""; + echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setScfMap=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo "CDR flag "; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo "Maximum balance "; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo "Blacklist threshold "; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo "Currency symbol "; + showParameter($sysId,$oidStr,1,3); + echo "
      Prompt resolution"; + echo ""; + echo ""; + + echo ""; + $oidStr="2.1.1.5"; + echo ""; + echo "
      Currency resolution"; + echo "Date format"; + echo "Currency symbol position"; + echo "
      "; + showParameter($sysId, $oidStr,1,1); + echo ""; + echo ""; + showParameter($sysId, $oidStr,2,1); + echo ""; + echo ""; + showParameter($sysId, $oidStr,3,1); + echo ""; + echo "
      "; + echo ""; + //alert($thirdPart_num); + if($thirdPart_num>=8) + echo ""; + else + echo ""; + echo "
      Third party info +
      --"; + echo ""; + $flag = 'thirdPar'; + echo ""; + echo ""; + echo ""; + for($i=0; $i < $thirdPart_num; $i++) + { + $inst = $thirdPar_ins[$i]; + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + if($i>3) + echo ""; + else + echo ""; + + //echo ""; + echo ""; + echo ""; + } + //===more button=== + if($thirdPart_num>4) + { + echo ""; + echo ""; + } + echo "
      No."; + echo "Service ID"; + echo "Service password"; + /*echo "Delete";*/ + echo "Delete"; + echo ""; + echo "
      $i"; + echo "$serverID[$i]"; + echo "$serverPWD[$i]"; + /*echo "";*/ + echo "
      More >>
      Hide >>
      "; + echo ""; + + echo ""; + echo "
      Basic tariff zone+
      --"; + echo ""; + echo ""; + $flag='tar'; + echo ""; + echo ""; + for($i=0; $i < $tariff_num; $i++) + { + $inst = $tar_ins[$i]; + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + + if($i>3) + echo ""; + else + echo ""; + + + + + echo ""; + echo ""; + } + //====more button==== + if($tariff_num>4) + { + echo ""; + echo ""; + } + echo "
      No."; + echo "MCC"; + echo "MNC"; + echo "LAC"; + echo "Cell ID"; + echo "MO tariff"; + echo "MT tariff"; + /*echo "Delete";*/ + echo "Delete"; + echo ""; + echo "
      $i"; + echo "$mcc[$i]"; + echo "$mnc[$i]"; + echo "$lac[$i]"; + echo "$cell_id[$i]"; + echo "$mo_tar[$i]"; + echo "$mt_tar[$i]"; + /*echo "";*/ + echo "
      More >>
      Hide >>
      Support MNP "; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo ""; + echo ""; + echo "
      MNP prefix+
      --"; + echo ""; + $flag = 'mnpPrefix'; + echo ""; + echo ""; + echo ""; + for($i=0; $i < $mnpPrefix_num; $i++) + { + $inst = $mnpPrefix_ins[$i]; + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + echo ""; + echo ""; + echo ""; + } + echo "
      No."; + echo "MNP prefix"; + echo " "; + + echo "Delete"; + echo ""; + echo "
      $i"; + echo "$mnpPrefix[$i]"; + echo " "; + echo "
      License control "; + showParameter($sysId,$oidStr,1,1,0,'','','Update'); + echo "
      "; + echo "COS parameters"; + echo ""; + echo ""; + for($i=0; $i<16; $i++) + { + echo ""; + } + echo ""; + echo "
        "; + echo " $i "; + echo "  
      "; + echo "
       More >>
      "; + echo ""; +// echo ""; + echo "
      SMS format+
      ";//start + echo ""; + echo""; + echo ""; + + $objIdStr = "no-2.1.1.6"; + $webname = "PPS"; + $setname = "SMS format"; + for($i=0; $i < $sms_num; $i++) + { + $inst = $sms_ins[$i]; + echo ""; + echo ""; + } + echo "
      Language"; + echo "SM encoding"; + echo "Account balance"; + echo "Expire in"; + echo "Recharge in time"; + echo "
      {$sms_ins[$i]}"; + echo "{$smEncodeTypeArr[$encode[$i]]}"; + echo "$acc_balance[$i]"; + echo "$expire[$i]"; + echo "$recharge[$i]"; + echo "
      "; + echo ""; + echo ""; + echo ""; + + $objIdStr = "no-2.1.1.7"; + $webname = "PPS"; + $setname = "SMS format"; + for($i=0; $i < $sms_num; $i++) + { + $inst = $sms_ins[$i]; + echo ""; + echo ""; + } + echo "
      Language"; + echo "Last call sent on"; + echo "To"; + echo "Received on"; + echo "From"; + echo "At"; +// echo "Delete"; + echo "
      {$sms_ins[$i]}"; + echo "$last_sent[$i]"; + echo "$to[$i]"; + echo "$recv_on[$i]"; + echo "$from[$i]"; + echo "$at[$i]"; +// echo ""; + echo "
      "; + + echo "
       Hide <<
      "; +echo ""; + +//========================================================== +//输出SRF MSISDN +//========================================================== +{ + $objWhereStr = getLevelWhere('2.1.2.1.1'); + $getsql = "select initValue from $sqltable where $objWhereStr"; + if($DEBUG) + echo "
      getsql = $getsql
      "; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $srf0_row = mysqli_fetch_array($result); + if($srf0_row[0] == 0) + $srf0 = '--'; + else + $srf0 = (toAscii($srf0_row[0])); + + $objWhereStr = getLevelWhere('2.1.2.1.2'); + $getsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + if($DEBUG) echo "
      getsql = $getsql
      "; + echo mysqli_error($pubConn); + $srf1_row = mysqli_fetch_array($result); + if($srf1_row[0] == 0) + $srf1 = '--'; + else + $srf1 = trim(toAscii($srf1_row[0])); + + if($DEBUG) echo "
      srf0 = $srf0
      "; + if($DEBUG) echo "srf1_row = $srf1_row[0]
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +//========================================================== +//输出Service number +//========================================================== +{ + $service_num_arr = array( + array('Hotline','2.1.2.2.1'), + array('Inquiry','2.1.2.2.2'), + array('Recharge via recharge card','2.1.2.2.3'), + array('Recharge via credit card','2.1.2.2.4'), + array('Third party recharge','2.1.2.2.5'), + array('Customer care center','2.1.2.2.6'), + array('Recharge number','2.1.2.2.7'), + ); + $nrow = sizeof($service_num_arr) + 1; + echo ""; + echo ""; + echo ""; + + for($i=0; $i < sizeof($service_num_arr); $i++) + { + echo ""; + echo ""; + echo ""; + } +} +//========================================================== +//输出Service key +//========================================================== +/* +{ + $service_key_arr = array( + array('Inquiry','2.1.2.3.2'), + array('Recharge via recharge card','2.1.2.3.3'), + array('Recharge via credit card','2.1.2.3.4'), + array('Set favorite number','2.1.2.3.5'), + array('Select language','2.1.2.3.6'), + array('Set password','2.1.2.3.7'), + ); + $nrow = sizeof($service_key_arr) + 1; + echo ""; + echo ""; + echo ""; + for($i=0; $i < sizeof($service_key_arr); $i++) + { + echo ""; + echo ""; + echo ""; + } +} +*/ + +//=================输出SRF prefix===================== + +{ + + + + //输出SRF prefix + {//get all local prefix + + //find prefix + $localPrefixTg = 250; + + + //=======set the 250 trunk group enable======= + $database="OBJ_322"; + $sql="update param_99 set initValue = '000000000B0302FF0000000000000000' + where level_1 = '2' and level_2 = '1' and level_3 = '4' and instanceNo ='$localPrefixTg'"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + mysqli_query($pubConn,$sql); + + + + + + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + {//get all enable prefix No + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr and instanceNo<252 ORDER BY instanceNo"; + //echo $defSql; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $prefix_num=0; + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=bindec(getBitValue($row[initValue],$offset_enable)); + $prefix_property=bindec(getBitValue($row[initValue],$offset_Properties)); + $prefix_calltype=bindec(getBitValue($row[initValue],$offset_calltype)); + + $flag = ($prefix_enable && $prefix_property!=2 && $prefix_calltype == 4); + if($flag) + { + $enablePrefix[$prefix_num][inst_no]=$row[instanceNo]; + $enablePrefix[$prefix_num][init_value]=$row[initValue]; + $prefix_num++; + } + if($prefix_enable==0 && !isset($unused_ins)) + $unused_ins = $row[instanceNo]; + } + }//end get enable prefix No + { + $oidstr = '2.1.3'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo<252 + ORDER BY instanceNo + "; + //echo "
      paramSql: $paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + $valid_num=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$enablePrefix[$prefix_no][inst_no]) + { + $tmpTg=hexdec($Row_1[initValue]); + //echo "
      {$Row_1[instanceNo]}->tmpTg: $tmpTg"; + if($tmpTg == $localPrefixTg) + { + $validPrefix[$valid_num][inst_no] = $enablePrefix[$prefix_no][inst_no]; + $validPrefix[$valid_num][init_value] = $enablePrefix[$prefix_no][init_value]; + $validPrefix[$valid_num][tg] = $tmpTg; + $valid_num++; + } + $prefix_no++; + } + if($prefix_no >= $prefix_num) + break; + } + } + {//get prefix value + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo<252 ORDER BY instanceNo "; + // echo "$paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$validPrefix[$prefix_no][inst_no]) + { + $tempprefix=strtoupper($Row_1[initValue]); + $prefix = explode('E',$tempprefix); + if($prefix[0] =="") + $prefix[0]="--"; + $validPrefix[$prefix_no][prefix]=$prefix[0]; + //echo "
      ".$validPrefix[$prefix_no][prefix]; + $prefix_no++; + } + if($prefix_no >= $valid_num) + break; + } + }//end get prefix value + }//end get all local prefix + $objIdStr='no-2.1.1-2.1.2'; + $sysId = '322_99_99'; + $webname="PPS"; + $setname="Prefix"; + + echo "" ; + echo ""; + if($valid_num == 0) echo ""; + else + { + $flag = 'srf'; + echo ""; + } + echo ""; + + +}//end 输出 SRF prefix + + + + + + + + +//=====================SRF prefix manipulation================== +{ + $objIdStr='no-2.8'; + $sysId = '225_99_99'; + $webname="SRF"; + $setname="Prefix manipulation"; + + $oidStr = '2.8.0'; + $levelWhere = getLevelWhere($oidStr); + + //get default value of local prefix(conv prefix) + $getsql = "select initValue from $net_paramConf where $levelWhere"; + $conv_pre_def = @mysqli_query($pubConn,$getsql); + $conv_pre_def = @mysqli_fetch_array($conv_pre_def); + $conv_pre_def = $conv_pre_def[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "conv_pre_def = $conv_pre_def
      "; + + $getsql = "select initValue,instanceNo from $net_paramTable where $levelWhere and initValue!='$conv_pre_def'"; + $result = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $convNo=0; + while($pre_row = @mysqli_fetch_array($result)) + { + $nameFlag = toAscii(getBitValue($pre_row[initValue],'35.0-42.7')); + if($nameFlag == $webname) + { + $convPrefix[$convNo][initValue]=$pre_row[initValue]; + $convPrefix[$convNo][inst_no] = $pre_row[instanceNo]; + $prefix = getBitValue($pre_row[initValue],'00.0-15.7'); + if($convPrefix != 0) + $prefix = toAscii($prefix); + else + $prefix = '--'; + $addDigs = getBitValue($pre_row[initValue],'18.0-33.7'); + if($addDigs != 0) + $addDigs = toAscii($addDigs); + else + $addDigs = '--'; + $convPrefix[$convNo][prefix] = $prefix; + $convPrefix[$convNo][delLen] = hexdec(getBitValue($pre_row[initValue],'16.0-16.7')); + $convPrefix[$convNo][addLen] = hexdec(getBitValue($pre_row[initValue],'17.0-17.7')); + $convPrefix[$convNo][addDigs] = $addDigs; + $convPrefix[$convNo][valiLen] = hexdec(getBitValue($pre_row[initValue],'34.0-34.7')); + //echo "
      convPrefix[$convNo][prefix]:{$convPrefix[$convNo][initValue]}"; + $convNo++; + } + }//end while + $getsql = "select initValue,instanceNo from $net_paramTable where $levelWhere and initValue='$conv_pre_def'"; + //echo "
      getsql: $getsql;"; + $result = @mysqli_query($pubConn,$getsql); + $Row = @mysqli_fetch_array($result); + $newConvInst=$Row[instanceNo]; + $conv_nrow = $convNo + 1; + + echo "" ; + echo ""; + if($convNo == 0) echo ""; + else + { + echo ""; + } + echo ""; +} + + + + + + + +$sysId="360_99_99"; +if(0) +{//IVR Location + + $oidStr="2.1.2.4"; + echo ""; + echo ""; + echo ""; + echo ""; +} +echo "
      SRF Service
      SRF MSISDN"; + echo ""; + + } + else + { + for($i=0; $i-- " ; + else + echo "" ; + } + + echo "
      SRF0"; + if(isset($srf0_edit)) + { + echo ""; + echo ""; + echo ""; + echo "$showSrf0 
      "; + echo "" ; + } + else + { + for($i=0; $i-- " ; + else + echo "" ; + } + + echo "
      SRF1"; + + if(isset($srf1_edit)) + { + echo ""; + echo ""; + echo ""; + echo "$showSrf1 
      "; + echo ""; + echo "
      Service number
      "; + echo ""; + echo ""; + echo "
      {$service_num_arr[$i][0]}"; + $oidStr = $service_num_arr[$i][1]; + showParameter($sysId, $oidStr,1,1); + echo "
      "; + echo ""; + echo "
      Service key
      "; + echo ""; + echo "
      {$service_key_arr[$i][0]}"; + echo ""; + $oidStr = $service_key_arr[$i][1]; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + + echo ""; + echo ""; + echo ""; + //alert("backurl ".$backurl); + //openSetPrefix('$localPrefixTg','$unused_ins','$objIdStr','$sysId','$webname','$setname','$backurl') + echo ""; + echo ""; + echo "
      SRF prefix+
      "; + + echo "
       --"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + $addurl = 'srfShow=1'; + //javascript:delSelected('Set','$flag',0,$valid_num,'$addurl') + echo ""; + echo ""; + + $TON_in = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $TON_out = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $Properties = array('Trunk','MSISDN','MSRN','MSC'); + $callTypeArr= array('Normal Call','Emergency','MCT','VMS','IN'); + for($i=0;$i < $valid_num;$i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + + $tmpInitValue = $validPrefix[$i][init_value]; + $tmpInst = $validPrefix[$i][inst_no]; + + if($i>3) + echo ""; + else + echo ""; + + echo ""; + //javascript:openSetPrefix('$localPrefixTg','{$validPrefix[$i][inst_no]}','$objIdStr','$sysId','$webname','$setname','$backurl') + //echo ""; + //echo ""; + $oTON_in = BinDec(getBitValue($tmpInitValue,'0.0-0.3')); + $oTON_out = BinDec(getBitValue($tmpInitValue,'0.4-0.7')); + $oProperties = BinDec(getBitValue($tmpInitValue,'10.2-10.3')); + $oCallType = BinDec(getBitValue($tmpInitValue,'10.4-10.6')); + $oCDR = BinDec(getBitValue($tmpInitValue,'10.0-10.0')); + $oCDR = ($oCDR) ? ("ON") : ("OFF"); + + $oRano = $validPrefix[$i][prefix]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + // echo ""; + + echo ""; + echo ""; + } + + //====more button========= + if($valid_num>4) + { + echo ""; + echo ""; + } + echo "
      No.PrefixTON-inTON-outPropertiesCall TypeCDRDelete"; + echo ""; + echo "
      $i
      $i$oRano $TON_in[$oTON_in] $TON_out[$oTON_out] $Properties[$oProperties] $callTypeArr[$oCallType] $oCDR 
      More >>
      Hide >>
      "; + + echo "
      "; + echo ""; + echo ""; + echo ""; + } + else + echo "+"; + echo "
      $setname"; + if($newConvInst=='') + { + echo "+
       --"; + echo ""; + $flag = 'conv_srf'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $addurl='srfShow=1'; + echo ""; + echo ""; + for($i=0; $i< $convNo; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + if($i>3) + echo ""; + else + echo ""; + + + //echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + } + + //===more button==== + if($convNo>4) + { + echo ""; + echo ""; + } + echo "
      No.PrefixDelete lengthAdd lengthAdd digitsValid lengthDelete"; + echo ""; + echo "
      $i{$convPrefix[$i][prefix]} {$convPrefix[$i][delLen]} {$convPrefix[$i][addLen]} {$convPrefix[$i][addDigs]} {$convPrefix[$i][valiLen]} 
      More >>
      Hide >>
      "; + echo "
      "; + echo "IVR Location"; + echo ""; + echo ""; + echo "
      Inquiry: "; + showParameter($sysId, $oidStr,1,1); + echo "Recharge: "; + showParameter($sysId, $oidStr,2,1); + echo "
      "; +}//end srf service. + +{//vms routing +echo ""; +echo ""; + +//========================================================== +//输出Call routing to VMS (VMS server no 2.1.5.1 - 2.1.5.3) +//========================================================== +{ + $call_routing_vms_arr = array( + array('VMS Service No. - PLMN','PLMN_ServerNo','2.1.5.1'), + array('VMS Service No. - PSTN','PSTN_ServerNo','2.1.5.2'), + array('VMS Leave Message No.','LeaveMessageNo','2.1.5.3'), + array('Routing Rule.','routingRule','2.1.5.4'), + ); + $nrow = sizeof($call_routing_vms_arr) + 1; + echo ""; + echo ""; + echo ""; + for($i=0; $i < sizeof($call_routing_vms_arr); $i++) + { + $oidStr = $call_routing_vms_arr[$i][2]; + if($i==3) + { + echo ""; + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + echo ""; + } + } +} +//========================================================== +//输出Call routing to VMS (VMS user segments 2.1.5.5) +//========================================================== +{ + $objWhereStr = getLevelWhere('2.1.5.5'); + $getsql = "select initValue from $sqltable_conf where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $vmsSeg_org = mysqli_fetch_array($result); + $vmsSeg_org = $vmsSeg_org[0]; + if($DEBUG) echo "vmsSeg_org=$vmsSeg_org
      "; + + $objWhereStr = getLevelWhere('2.1.5.5'); + $getsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + + $i = 0; + $vmsSeg_num = 0; + while($vmsSeg_row = mysqli_fetch_array($result)) + { + $vmsSeg_row = $vmsSeg_row[0]; + if(strcmp($vmsSeg_row,$vmsSeg_org)!=0) + { + $startMSISDN[$vmsSeg_num] = trim(toAscii(getBitValue($vmsSeg_row,'00.0-15.7'))); + $endMSISDN[$vmsSeg_num] = trim(toAscii(getBitValue($vmsSeg_row,'16.0-31.7'))); + $servNumPLMN[$vmsSeg_num] = trim(toAscii(getBitValue($vmsSeg_row,'32.0-47.7'))); + $servNumPSTN[$vmsSeg_num] = trim(toAscii(getBitValue($vmsSeg_row,'48.0-63.7'))); + $numberDeposit[$vmsSeg_num] = trim(toAscii(getBitValue($vmsSeg_row,'64.0-79.7'))); + $vmsSeg_ins[$vmsSeg_num] = $i; + $vmsSeg_num++; + } + else if(!isset($vmsSeg_ins_unused)) + { + $vmsSeg_ins_unused = $i; + } + $i++; + } + + if($vmsSeg_num == 0) $nrow = $vmsSeg_num + 2; + else $nrow = $vmsSeg_num + 1; + + $objIdStr = "no-2.1.5.5"; + $webname = "PPS"; + $setname = "Basic vmsSeg zone"; + //alert($vmsSeg_num); + echo ""; + echo ""; + + {//get all vss serv number + for($i=0; $i < $vmsSeg_num; $i++) + { + for($j=0; $j< sizeof($vssSegArr)-1; $j++)//vss serv number + { + $vms_objDB = "OBJ_390"; + $vms_paramTable = 'param_99'; + $oidstr = "2.2.1.1"; + $objWhereStr = getLevelWhere($oidstr); + $tmpInstNo = $vssSegArr[$j][sysNo]; + $getsql = "select initValue from $vms_paramTable where $objWhereStr and instanceNo='$tmpInstNo'"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + + $PLMNServNo = getBitValue($row[0],'08.0-15.7'); + $PLMNServNo = str_replace('F','',$PLMNServNo); + + $PSTNServNo = getBitValue($row[0],'16.0-23.7'); + $PSTNServNo = str_replace('F','',$PSTNServNo); + + $LeaveMessNo = getBitValue($row[0],'24.0-31.7'); + $LeaveMessNo = str_replace('F','',$LeaveMessNo); + + if(strcmp($PLMNServNo,$servNumPLMN[$i])==0 + &&strcmp($PSTNServNo,$servNumPSTN[$i])==0 + &&strcmp($LeaveMessNo,$numberDeposit[$i])==0) + + { + $vssNameArr[$i] = $vssSegArr[$j][name]; + break; + } + }//end vss serv number + if(!isset($vssNameArr[$i])) + { + $vssNameArr[$i] = $servNumPLMN[$i] = $servNumPSTN[$i] = $numberDeposit[$i] = '--'; + } + } + }//end get vss serv number + if($vmsSeg_num == 0) + { + echo ""; + } + else + { + $flag = 'vmsSeg'; + echo ""; + echo ""; + } + //======================================== +if($vmsSeg_num!=0) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      VMS Routing
      "; + echo ""; + echo "
      Call routing to VMS
      "; + echo ""; + echo ""; + echo "
      route by: "; + showParameter($sysId, $oidStr,1,1); + echo "route: "; + showParameter($sysId, $oidStr,2,1); + echo "
      "; + echo ""; + echo "
      {$call_routing_vms_arr[$i][0]}"; + echo ""; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setVmsRouting=1"; + showParameter($sysId, $oidStr,1,1,0,$doingOtherUlr); + echo "
      "; + echo ""; + if($vmsSeg_num>=128) + echo ""; + else + echo ""; + echo "
      VMS user segments +
       --
      "; + echo ""; + echo "
      No."; + echo "Start MSISDN"; + echo "End MSISDN"; + echo "VSS Name"; + echo "PLMN Num"; + echo "PSTN Num"; + echo "Deposit Num"; + /*echo "Delete";*/ + echo "Delete"; + echo ""; + echo "
      "; + echo ""; + for($i=0; $i < $vmsSeg_num; $i++) + { + $inst = $vmsSeg_ins[$i]; + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + + //echo ""; + + //echo ""; +} + for($i=0;$i<$vmsSeg_num-1;$i++) + { + echo ""; + } + + //========================================= + +} +{//输出dailing prefix + {//get all local prefix + //直接指定TG=252作为local prefix + //find prefix + $localPrefixTg = 252; + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + {//get all enable prefix No + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr and instanceNo<252 ORDER BY instanceNo"; + //echo $defSql; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $prefix_num=0; + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=bindec(getBitValue($row[initValue],$offset_enable)); + $prefix_property=bindec(getBitValue($row[initValue],$offset_Properties)); + $prefix_calltype=bindec(getBitValue($row[initValue],$offset_calltype)); + + $flag = ($prefix_enable && $prefix_property!=2 && $prefix_calltype == 4); + if($flag) + { + $enablePrefix[$prefix_num][inst_no]=$row[instanceNo]; + $enablePrefix[$prefix_num][init_value]=$row[initValue]; + $prefix_num++; + } + if($prefix_enable==0 && !isset($unused_ins)) + $unused_ins = $row[instanceNo]; + } + }//end get enable prefix No + { + $oidstr = '2.1.3'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo<252 + ORDER BY instanceNo + "; + //echo "
      paramSql: $paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + $valid_num=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$enablePrefix[$prefix_no][inst_no]) + { + $tmpTg=hexdec($Row_1[initValue]); + //echo "
      {$Row_1[instanceNo]}->tmpTg: $tmpTg"; + if($tmpTg == $localPrefixTg) + { + $validPrefix[$valid_num][inst_no] = $enablePrefix[$prefix_no][inst_no]; + $validPrefix[$valid_num][init_value] = $enablePrefix[$prefix_no][init_value]; + $validPrefix[$valid_num][tg] = $tmpTg; + $valid_num++; + } + $prefix_no++; + } + if($prefix_no >= $prefix_num) + break; + } + } + {//get prefix value + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo<252 ORDER BY instanceNo "; + // echo "$paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$validPrefix[$prefix_no][inst_no]) + { + $tempprefix=strtoupper($Row_1[initValue]); + $prefix = explode('E',$tempprefix); + if($prefix[0] =="") + $prefix[0]="--"; + $validPrefix[$prefix_no][prefix]=$prefix[0]; + //echo "
      ".$validPrefix[$prefix_no][prefix]; + $prefix_no++; + } + if($prefix_no >= $valid_num) + break; + } + }//end get prefix value + }//end get all local prefix + $objIdStr='no-2.1.1-2.1.2'; + $sysId = '322_99_99'; + $webname="PPS"; + $setname="Prefix"; + + echo "" ; + echo ""; + if($valid_num == 0) echo ""; + else + { + $flag = 'dailing'; + echo ""; + } + echo ""; +}//end 输出 Dialing prefix + +{//输出 conv prefix + $objIdStr='no-2.8'; + $sysId = '225_99_99'; + $webname="PPS"; + $setname="Prefix manipulation"; + + $oidStr = '2.8.0'; + $levelWhere = getLevelWhere($oidStr); + + //get default value of local prefix(conv prefix) + $getsql = "select initValue from $net_paramConf where $levelWhere"; + $conv_pre_def = @mysqli_query($pubConn,$getsql); + $conv_pre_def = @mysqli_fetch_array($conv_pre_def); + $conv_pre_def = $conv_pre_def[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "conv_pre_def = $conv_pre_def
      "; + + $getsql = "select initValue,instanceNo from $net_paramTable where $levelWhere and initValue!='$conv_pre_def'"; + $result = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $convNo=0; + while($pre_row = @mysqli_fetch_array($result)) + { + $nameFlag = toAscii(getBitValue($pre_row[initValue],'35.0-42.7')); + if($nameFlag == $webname) + { + $convPrefix[$convNo][initValue]=$pre_row[initValue]; + $convPrefix[$convNo][inst_no] = $pre_row[instanceNo]; + $prefix = getBitValue($pre_row[initValue],'00.0-15.7'); + if($convPrefix != 0) + $prefix = toAscii($prefix); + else + $prefix = '--'; + $addDigs = getBitValue($pre_row[initValue],'18.0-33.7'); + if($addDigs != 0) + $addDigs = toAscii($addDigs); + else + $addDigs = '--'; + $convPrefix[$convNo][prefix] = $prefix; + $convPrefix[$convNo][delLen] = hexdec(getBitValue($pre_row[initValue],'16.0-16.7')); + $convPrefix[$convNo][addLen] = hexdec(getBitValue($pre_row[initValue],'17.0-17.7')); + $convPrefix[$convNo][addDigs] = $addDigs; + $convPrefix[$convNo][valiLen] = hexdec(getBitValue($pre_row[initValue],'34.0-34.7')); + //echo "
      convPrefix[$convNo][prefix]:{$convPrefix[$convNo][initValue]}"; + $convNo++; + } + }//end while + $getsql = "select initValue,instanceNo from $net_paramTable where $levelWhere and initValue='$conv_pre_def'"; + //echo "
      getsql: $getsql;"; + $result = @mysqli_query($pubConn,$getsql); + $Row = @mysqli_fetch_array($result); + $newConvInst=$Row[instanceNo]; + $conv_nrow = $convNo + 1; + + echo "" ; + echo ""; + if($convNo == 0) echo ""; + else + { + echo ""; + } + echo ""; +} + + + +//========================================================== +//输出Command +//========================================================== +/* +{ + echo ""; + echo ""; +} +*/ +echo "
      "; + if($i>3) + echo ""; + else + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + /*echo ""; + echo ""; + + + + } + + if($vmsSeg_num>4) + { + echo ""; + echo ""; + } + + echo "
      $i"; + + echo "$startMSISDN[$i]$endMSISDN[$i]$vssNameArr[$i]$servNumPLMN[$i]$servNumPSTN[$i]$numberDeposit[$i]";*/ + echo "
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      VMS prefix+
      "; + echo "
       --"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + $addurl = 'vmsShow=1'; + echo ""; + echo ""; + + $TON_in = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $TON_out = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $Properties = array('Trunk','MSISDN','MSRN','MSC'); + $callTypeArr= array('Normal Call','Emergency','MCT','VMS','IN'); + for($i=0;$i < $valid_num;$i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + + $tmpInitValue = $validPrefix[$i][init_value]; + $tmpInst = $validPrefix[$i][inst_no]; + + if($i>3) + echo ""; + else + echo ""; + + + //echo ""; + echo ""; + $oTON_in = BinDec(getBitValue($tmpInitValue,'0.0-0.3')); + $oTON_out = BinDec(getBitValue($tmpInitValue,'0.4-0.7')); + $oProperties = BinDec(getBitValue($tmpInitValue,'10.2-10.3')); + $oCallType = BinDec(getBitValue($tmpInitValue,'10.4-10.6')); + $oCDR = BinDec(getBitValue($tmpInitValue,'10.0-10.0')); + $oCDR = ($oCDR) ? ("ON") : ("OFF"); + + $oRano = $validPrefix[$i][prefix]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + // echo ""; + + echo ""; + echo ""; + } + + //====more button========= + if($valid_num>4) + { + echo ""; + echo ""; + } + echo "
      No.PrefixTON-inTON-outPropertiesCall TypeCDRDelete"; + echo ""; + echo "
      $i$oRano $TON_in[$oTON_in] $TON_out[$oTON_out] $Properties[$oProperties] $callTypeArr[$oCallType] $oCDR 
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + } + else + echo "+"; + echo "
      $setname"; + if($newConvInst=='') + { + echo "+
       --"; + echo ""; + $flag = 'conv'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + + + $addurl = 'vmsShow=1'; + echo ""; + echo ""; + for($i=0; $i< $convNo; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + if($i>3) + echo ""; + else + echo ""; + + + //echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + } + + //===more button==== + if($convNo>4) + { + echo ""; + echo ""; + } + echo "
      No.PrefixDelete lengthAdd lengthAdd digitsValid lengthDelete"; + echo ""; + echo "
      $i{$convPrefix[$i][prefix]} {$convPrefix[$i][delLen]} {$convPrefix[$i][addLen]} {$convPrefix[$i][addDigs]} {$convPrefix[$i][valiLen]} 
      More >>
      Hide >>
      "; + echo "
      Command"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      PPS0LockPPS1Lock
      "; +}//end vms routint +?> +"; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +if(!isset($smsFormatShow)) + $smsFormatShow=0; +echo ""; +echo "
      "; + + +//echo "
      smsFormatShow:$smsFormatShow
      "; +?> diff --git a/wxc2_omc/element/mss/pps_cos.php b/wxc2_omc/element/mss/pps_cos.php new file mode 100755 index 0000000..67a701e --- /dev/null +++ b/wxc2_omc/element/mss/pps_cos.php @@ -0,0 +1,756 @@ +正在调试中!!"; +?> + + + + +"; + +//test +//echo "smsFormatShow:$isShowSms
      "; + +$helpID = "1.1.1"; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +$nGetComm = 0; +$nSetComm = 3; + +$maxNum = 120; + +$mtp3_sqlTable = 'OBJ_222.param_99'; +$sqltable = 'OBJ_360.param_99'; +$sqltable_conf = 'OBJ_360.paramConf'; +$sqltable_sccp = 'OBJ_223.param_99'; +$sysStatTable='OMC_PUB.sysStat'; +$pubdb = 'OMC_PUB'; +$sysId = '360_99_99'; +$sysOid = "2.1.4.$level_4" ; + +$sysId_arr=array( + array('oid'=>$sysOid, 'sysid'=> '360_99_99', 'selectsysid'=>'-1'), +); + +$SaveArr=array( + array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=>'350_99_99'), +); + +$url_add = './pps.php'; +$post_url = "$PHP_SELF?level_4=$level_4&scroll_y=$scroll_y"; +$back_url = "./pps_cos.php?level_4=$level_4"; + +{//update elementParamConf level_4 + $selSql = "select paramOBJ from OBJ_360.elementParamConf where paramOBJ like '2.1.4%' "; + $Result = mysqli_query($pubConn,$selSql); + while($rows = mysqli_fetch_array($Result)) + { + $tmpArr = explode('.',$rows[paramOBJ]); + $setValue = ''; + for($i=0; $i< sizeof($tmpArr); $i++) + { + if($i==3) + $setValue .= ".$level_4"; + else + $setValue .= ".{$tmpArr[$i]}"; + } + $setValue = trim($setValue, '.'); + $updSql = "update OBJ_360.elementParamConf set paramOBJ='$setValue' where paramOBJ='{$rows[paramOBJ]}'"; + mysqli_query($pubConn,$updSql); + } +}//end update elementParamConf level_4 + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + + SetParam($sysId_arr); + session_register("SetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + echo ""; + exit(); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } + + echo ""; + exit(); +} + +//========================================================== +//输出并显示数据 +//========================================================== + +echo "
      "; +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + $cosNo = $level_4-1; + echo "Configuration > Network > PPS > COS $cosNo"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "COS $cosNo edit:  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +} +?> + +$defSql"; + $setsql = "select instanceNo,initValue from $sqltable where $objWhereStr and initValue!='{$defRow[initValue]}'"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $ProBonusNo=0; + while($row = mysqli_fetch_array($result)) + { + $promotionBonus[$ProBonusNo][cardCredit] = hexdec(getBitValue($row[initValue],'00.0-03.7')); + $promotionBonus[$ProBonusNo][bonus] = hexdec(getBitValue($row[initValue],'04.0-07.7')); + $promotionBonus[$ProBonusNo][validity] = hexdec(getBitValue($row[initValue],'08.0-08.7')); + $promotionBonus[$ProBonusNo][instNo] = $row[instanceNo]; + $ProBonusNo++; + } + + $setsql = "select instanceNo,initValue from $sqltable where $objWhereStr and initValue='{$defRow[initValue]}'"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $newInstNo = $row[instanceNo]; + } + + $rowsRecPro = 4 + $ProBonusNo; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $webName = "PPS"; + $setName = "start date"; + echo ""; + echo ""; + + echo ""; + echo ""; + $webName = "PPS"; + $setName = "end date"; + echo ""; + echo ""; + + echo ""; + $rowProBonu = $ProBonusNo+1; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0; $i< $ProBonusNo; $i++) + { + echo ""; + $instNo = $promotionBonus[$i][instNo]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +}//end Recharge Promotion + +{//Tariff resolution + + {//MOTariffID + $levelMOTariffID = "2.1.4.$level_4.2.1"; + $objWhereStr = getLevelWhere($levelMOTariffID); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $MOTariffID = $row[initValue]; + } + + {//MT tariff ID + $levelMTTariffID = "2.1.4.$level_4.2.2"; + $objWhereStr = getLevelWhere($levelMTTariffID); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $MTTariffID = $row[initValue]; + } + + {//Tariff subscription + $levelTariffSub = "2.1.4.$level_4.2.3"; + $objWhereStr = getLevelWhere($levelTariffSub); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $TariffSub = hexdec($row[initValue]); + $TariffSubArr = array("Tariff set in subscriber profile","Parameter \"Basic tariff zone\""); + } + + {//Recharge card validity + $levelRechCardVali = "2.1.4.$level_4.2.4"; + $objWhereStr = getLevelWhere($levelRechCardVali); + $defSql = "select initValue from $sqltable_conf where $objWhereStr"; + $defRes = mysqli_query($pubConn,$defSql); + $defRow = mysqli_fetch_array($defRes); + //echo "
      $defSql"; + $setsql = "select instanceNo,initValue from $sqltable where $objWhereStr and initValue!='{$defRow[initValue]}'"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $RechCardValNo=0; + while($row = mysqli_fetch_array($result)) + { + $RechargeCardVali[$RechCardValNo][Face] = hexdec(getBitValue($row[initValue],'00.0-01.7')); + $RechargeCardVali[$RechCardValNo][MoVali] = hexdec(getBitValue($row[initValue],'02.0-03.7')); + $RechargeCardVali[$RechCardValNo][MtVali] = hexdec(getBitValue($row[initValue],'04.0-05.7')); + $RechargeCardVali[$RechCardValNo][instNo] = $row[instanceNo]; + $RechCardValNo++; + } + + $setsql = "select instanceNo,initValue from $sqltable where $objWhereStr and initValue='{$defRow[initValue]}'"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $newInstNo = $row[instanceNo]; + } + + $rowsRecPro = 5 + $RechCardValNo; + echo ""; + echo ""; + echo ""; + $webName = "PPS"; + $setName = "Tariff Resolution"; + $objId = "no-$levelMOTariffID-$levelMTTariffID-$levelTariffSub"; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + $rowProBonu = $RechCardValNo+1; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0; $i< $RechCardValNo; $i++) + { + echo ""; + $instNo = $RechargeCardVali[$i][instNo]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +}//end Tariff resolution + +{//Account control + {//Minimum balance for MO call + + $levelMinBalance = "2.1.4.$level_4.3.1"; + $objWhereStr = getLevelWhere($levelMinBalance); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $binValue = omc_keep_length(decbin(hexdec($row[initValue])),'0',16); + $setThreshold = substr($binValue,0,1); + $minBalance = bindec(substr($binValue,1,15)); + $setThresholdArr = array("Not set","Set"); + } + + {//Maximum account validity + $levelMaxAccountVali = "2.1.4.$level_4.3.2"; + $objWhereStr = getLevelWhere($levelMaxAccountVali); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $maxAccountVali = hexdec($row[initValue]); + } + + {//Release day + $levelReleaseDay = "2.1.4.$level_4.3.3"; + $objWhereStr = getLevelWhere($levelReleaseDay); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $ReleaseDay = hexdec($row[initValue]); + } + + $rowsRecPro = 4; + echo ""; + echo ""; + echo ""; + $webName = "PPS"; + $setName = "Recharge Card Validity"; + $objId = "no-$levelMinBalance-$levelMaxAccountVali-$levelReleaseDay"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +}//end Account control + +{//MT call control + {//MT call charge flag + + $levelMTCallFlag = "2.1.4.$level_4.4.1"; + $objWhereStr = getLevelWhere($levelMTCallFlag); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $MtCallFlag = hexdec($row[initValue]); + $MtCallFlagArr = array("Not charged","Charged"); + } + + {//MT balance control + $levelMTBalCtl = "2.1.4.$level_4.4.2"; + $objWhereStr = getLevelWhere($levelMTBalCtl); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $MTBalCtl = hexdec($row[initValue]); + $MTBalCtlArr = array("No limitation","Threshold used"); + } + + {//MT balance threshold + $levelMTBalThre = "2.1.4.$level_4.4.3"; + $objWhereStr = getLevelWhere($levelMTBalThre); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $MTBalThre = hexdec($row[initValue]); + } + + $rowsMTCtrl = 4; + echo ""; + echo ""; + echo ""; + $webName = "PPS"; + $setName = "MT Call Control"; + $objId = "no-$levelMTCallFlag-$levelMTBalCtl-$levelMTBalThre"; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +}//end MT call control + +{//Validity solution + {//Clear balance option + $levelCleBalOpt = "2.1.4.$level_4.5.1"; + $objWhereStr = getLevelWhere($levelCleBalOpt); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $accountExpires = bindec(getBitValue($row[initValue],'00.0-00.0')); + $accountReleased = bindec(getBitValue($row[initValue],'00.1-00.1')); + $clearArr = array("Not clear balance","Clear balance"); + } + + {//Validity after recharge + $levelValiAfterRech = "2.1.4.$level_4.5.2"; + $objWhereStr = getLevelWhere($levelValiAfterRech); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $ValiAfterRech = hexdec(getBitValue($row[initValue],'00.0-00.7')); + $ValiAfterRechArr = array("Accumulate","Replace"); + } + + {//Validity on zero balance + $levelValionZero = "2.1.4.$level_4.5.3"; + $objWhereStr = getLevelWhere($levelValionZero); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $ValionZero = bindec(getBitValue($row[initValue],'00.7-00.7')); + $ValionZeroArr = array("Not change","Change"); + $Days = bindec(getBitValue($row[initValue],'00.0-00.6')); + } + + {//Activated account validity + $levelActAcntVali = "2.1.4.$level_4.5.4"; + $objWhereStr = getLevelWhere($levelActAcntVali); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $ActbyInquir = bindec(getBitValue($row[initValue],'00.7-00.7')); + $ActbyInquirArr = array("Disable","Enable"); + $ValiofActiwithZero = bindec(getBitValue($row[initValue],'00.0-00.6')); + } + + {//Friends & family number + $levelFriFamNum = "2.1.4.$level_4.5.5"; + $objWhereStr = getLevelWhere($levelFriFamNum); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $CUGflg = bindec(getBitValue($row[initValue],'00.7-00.7')); + $FFflg = bindec(getBitValue($row[initValue],'00.6-00.6')); + $EditionFFflag = bindec(getBitValue($row[initValue],'00.5-00.5')); + $FreeTimesofChange = bindec(getBitValue($row[initValue],'00.0-00.3')); + $CugFFflagArr = array("Disable","Enable"); + $EditionFFflagArr = array("Not charge","Charge"); + } + + {//Support credit card + $levelSupCreCard = "2.1.4.$level_4.5.6"; + $objWhereStr = getLevelWhere($levelSupCreCard); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $SupportFlag = hexdec(getBitValue($row[initValue],'00.0-00.7')); + $SupportFlagArr = array("Support","Not Support"); + } + + {//Credit vault + $levelCredVault = "2.1.4.$level_4.5.7"; + $objWhereStr = getLevelWhere($levelCredVault); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $binValue = omc_keep_length(decbin(hexdec($row[initValue])),'0',16); + $SupportVaultFlag = substr($binValue,0,1); + $CreditVault = bindec(substr($binValue,1,15)); + $SupportVaultFlagArr = array("Not Support","Support"); + } + + $ValiSolutionRow = 9; + echo ""; + echo ""; + echo ""; + $webName = "PPS"; + $setName = "Validity Solution"; + $objId = "no-$levelCleBalOpt-$levelValiAfterRech-$levelValionZero-$levelActAcntVali"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $FriFamNumObj = "no-$levelFriFamNum"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $SupCreCardObj = "no-$levelSupCreCard"; + echo ""; + echo ""; + echo ""; + echo ""; + + $CredVaultObj = "no-$levelCredVault"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + +}//end Validity solution + +{//SM inquiry/notification + {//Feedback SM + $levelFeedbackSM = "2.1.4.$level_4.6.1"; + $objWhereStr = getLevelWhere($levelFeedbackSM); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $rechargeSendSM = bindec(getBitValue($row[initValue],'00.0-00.0')); + $inquirySendSM = bindec(getBitValue($row[initValue],'00.1-00.1')); + $sendSMArr = array("Disable","Enable"); + } + + {//Inquiry SM + $levelInquirySM = "2.1.4.$level_4.6.2"; + $objWhereStr = getLevelWhere($levelInquirySM); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $chargeOnInqSM = bindec(getBitValue($row[initValue],'00.7-00.7')); + $freeSmEveryDay = bindec(getBitValue($row[initValue],'00.0-00.6')); + $chargeOnInqSMArr = array("Not charged","Charged"); + } + + {//SM for expiry + $levelSMforexpiry = "2.1.4.$level_4.6.3"; + $objWhereStr = getLevelWhere($levelSMforexpiry); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + + $SendSMNoti = bindec(getBitValue($row[initValue],'00.7-00.7')); + $DaysPrior2Expiry = bindec(getBitValue($row[initValue],'00.0-00.6')); + $SendSMNotiArr = array("Disable","Enable"); + } + + {//SM for low balance + $levelLowBalSM = "2.1.4.$level_4.6.4"; + $objWhereStr = getLevelWhere($levelLowBalSM); + $setsql = "select initValue from $sqltable where $objWhereStr"; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($result); + $binValue = omc_keep_length(decbin(hexdec($row[initValue])),'0',16); + $SendSMNotiLovBal = substr($binValue,0,1); + $BalLevel2sendSM = bindec(substr($binValue,1,15)); + //$SendSMNotiLovBal = bindec(getBitValue($row[initValue],'01.7-01.7')); + //$BalLevel2sendSM = bindec(getBitValue($row[initValue],'00.0-01.6')); + } + $SMInquiry = 5; + echo ""; + echo ""; + echo ""; + $webName = "PPS"; + $setName = "SM Inquiry Notification"; + $objId = "no-$levelFeedbackSM-$levelInquirySM-$levelSMforexpiry-$levelLowBalSM"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +}//end SM inquiry/notification + +echo "
      Recharge Promotion
      Start date$startDate 
      End date$endDate 
      "; + echo ""; + echo ""; + echo ""; + $webName = "PPS"; + $setName = "Promotion Bonus"; + if(!isset($newInstNo)) + $newInstNo=-1; + echo ""; + echo ""; + echo "
      Promotion Bonus+
      "; + echo "
      No.Recharge card creditPromotion bonusBonus validity
      $i{$promotionBonus[$i][cardCredit]}{$promotionBonus[$i][bonus]}{$promotionBonus[$i][validity]}
      Tariff resolution
      MO tariff ID$MOTariffID 
      MT tariff ID$MTTariffID 
      Tariff subscription{$TariffSubArr[$TariffSub]} 
      "; + echo ""; + echo ""; + echo ""; + if(!isset($newInstNo)) + $newInstNo=-1; + echo ""; + echo ""; + echo "
      Recharge card validity+
      "; + echo "
      No.Face valueMO validityMT validity
      $i{$RechargeCardVali[$i][Face]}{$RechargeCardVali[$i][MoVali]}{$RechargeCardVali[$i][MtVali]}
      Account control
      Min balance for MO callSet threshold: {$setThresholdArr[$setThreshold]} Min balance for MO call:  $minBalance 
      Max account validity$maxAccountVali 
      Release day$ReleaseDay 
      MT call control
      MT call charge flag{$MtCallFlagArr[$MtCallFlag]} 
      MT balance control{$MTBalCtlArr[$MTBalCtl]} 
      MT balance threshold$MTBalThre 
      Validity solution
      Clear balance optionWhen account expires: {$clearArr[$accountExpires]} When account is released: {$clearArr[$accountReleased]} 
      Validity after recharge{$ValiAfterRechArr[$ValiAfterRech]} 
      Validity on zero balanceValidity on zero balance: {$ValionZeroArr[$ValionZero]} Days: $Days 
      Activated account validityActivation by inquiring: {$ActbyInquirArr[$ActbyInquir]} Validity of activated account with zero balance: $ValiofActiwithZero 
      Friends & family numberCUG serivce flag: {$CugFFflagArr[$CUGflg]} F & F service flag: {$CugFFflagArr[$FFflg]} 
      Edition F & F list charge flag: {$EditionFFflagArr[$EditionFFflag]} Free times of changing: $FreeTimesofChange 
      Support credit card{$SupportFlagArr[$SupportFlag]} 
      Activated account validitySupport credit vault: {$SupportVaultFlagArr[$SupportVaultFlag]} Credit vault: $CreditVault 
      SM inquiry/notification
      Feedback SMSend SM for recharge result: {$sendSMArr[$rechargeSendSM]} Send SM for inquiry result: {$sendSMArr[$rechargeSendSM]} 
      Inquiry SMCharge on inquiry SM: {$chargeOnInqSMArr[$chargeOnInqSM]} Free SM every day: $freeSmEveryDay 
      SM notification for expirySend SM notification: {$SendSMNotiArr[$SendSMNoti]} Days prior to expiry date: $DaysPrior2Expiry 
      SM notification for low balanceSend SM notification: {$SendSMNotiArr[$SendSMNotiLovBal]} Balance level to send SM: $BalLevel2sendSM 
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} + +echo ""; +echo "
      "; +?> + + + diff --git a/wxc2_omc/element/mss/prefix_overview.php b/wxc2_omc/element/mss/prefix_overview.php new file mode 100755 index 0000000..0b698b6 --- /dev/null +++ b/wxc2_omc/element/mss/prefix_overview.php @@ -0,0 +1,382 @@ + +pPas[$i]=$pPas[$i]"; + $wPas = $wPas." AND level_$lNum = $pPas[$i] "; + $i++; +} +//echo "
      wPas=$wPas"; +//Prefix attributes +$oidPat = "2.1.2"; +$pPat = explode(".",$oidPat); +$i = 0; +$wPat = ''; +while(isset($pPat[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pPat[$i]=$pPat[$i]"; + $wPat = $wPat." AND level_$lNum = $pPat[$i] "; + $i++; +} +//echo "
      wPat=$wPat"; + +//Assign TG to prefix +$oidTg = "2.1.3"; +$pTg = explode(".",$oidTg); +$i = 0; +$wTg = ''; +while(isset($pTg[$i])) +{ + $lNum = $i+1; + if($DEBUG) echo "
      pTg[$i]=$pTg[$i]"; + $wTg = $wTg." AND level_$lNum = $pTg[$i] "; + $i++; +} +//echo "
      wTg=$wTg"; + +$wAnd = " AND level_1 = 2 AND level_2 = 1 AND (level_3 = 1 OR level_3 = 2 OR level_3 = 3) "; + +/************get default value**************/ +$defSql = " SELECT initValue,level_3 FROM paramConf WHERE keyId > 0 ".$wAnd." ORDER BY level_3 "; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +do +{ + $leve_3 = $defRow[level_3]; + $defaultValue[$leve_3] = $defRow[initValue]; + //echo "
      defaultValue[$leve_3]=$defaultValue[$leve_3]"; +}while($defRow = @mysqli_fetch_array($defRes)); + + $prefixFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + $inTonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'UNK', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') + ); + + $outTonArr=array( + array('num' => '0', 'remark' => 'Spare', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'UNK', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Spare', 'color' => '#0000FF') + ); + + $cdrFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + +if($DEFAULT_SYS == 'MSC'){ + $proTypeArr=array( + array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSISDN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'MSRN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'MSC', 'color' => '#0000FF') + ); + $callTypeArr=array( + array('num' => '0', 'remark' => 'Normal Call', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Emergency', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'MCT', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'IP', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IN', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'FC', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'Free Call', 'color' => '#0000FF'), + + ); +}else{ + $proTypeArr=array( + array('num' => '0', 'remark' => 'Trunk', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'PBX', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '3', 'remark' => '--', 'color' => '#0000FF') + ); + $callTypeArr=array( + array('num' => '0', 'remark' => 'Normal', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'EM', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'MCT', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'VMS', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IN', 'color' => '#0000FF') + + ); +} + + + $tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'subscriber', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') + ); + + $camelFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $cliTypeArr = array( + array('num' => '0', 'remark' => 'Sub', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'NDD', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'IDD', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'UNK(local)', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'UNK(NDD)', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'UNK(IDD)', 'color' => '#0000FF') + ); + + +/************select value to see************/ +//Attributes of TG + +$andSql = " SELECT level_3,instanceNo,initValue,readValue FROM $tb_2 WHERE subSysNo = '99' ".$wAnd." ORDER BY instanceNo "; +if($DEBUG) echo "
      andSql=$andSql"; +$andRes = @mysqli_query($pubConn,$andSql); +$andRow = @mysqli_fetch_array($andRes); +echo mysqli_error($pubConn); + +do +{ + $level_3 = $andRow[level_3]; + $instanceNo = $andRow[instanceNo]; + $initValue = $andRow[initValue]; + //echo "
      initValue=$initValue"; + + if($initValue == $defaultValue[$level_3]){ + $andShow[$level_3][$instanceNo] = 0; + }else{ + $andShow[$level_3][$instanceNo] = 1; + } + //echo "
      andShow[$level_3][$instanceNo]={$andShow[$level_3][$instanceNo]}"; + + if($level_3 == 1){ + $prefixNum = $initValue; + $pNum = explode("E",$prefixNum); + $prefixNum=$prefixArr[$instanceNo][1] = $pNum[0]; + //echo "
      prefixArr[$instanceNo][1]={$prefixArr[$instanceNo][1]}"; + }elseif($level_3 == 2){ + $DEBUG = 0; + $hex_0 = substr($initValue,0,2); + if($DEBUG)echo "
      hex_0=$hex_0"; + $bin_0 = omc_keep_length(DecBin(HexDec($hex_0)),0,8); + if($DEBUG)echo "
      bin_0=$bin_0"; + + $inTon = $prefixArr[$instanceNo][2] = BinDec(substr($bin_0,4,4)); + //echo "
      inTon=$inTon"; + + $outTon = $prefixArr[$instanceNo][3] = BinDec(substr($bin_0,0,4)); + //echo "
      outTon=$outTon"; + + $hex_1 = substr($initValue,2,2); + if($DEBUG)echo "
      hex_1=$hex_1"; + $bin_1 = omc_keep_length(DecBin(HexDec($hex_1)),0,8); + if($DEBUG)echo "
      bin_1=$bin_1"; + + $trkDelC = $prefixArr[$instanceNo][4] = BinDec(substr($bin_1,4,4)); + if($DEBUG)echo "
      trkDelC=$trkDelC"; + + $trkInsC = $prefixArr[$instanceNo][5] = BinDec(substr($bin_1,0,4)); + if($DEBUG)echo "
      trkInsC=$trkInsC"; + + $trkInsD = substr($initValue,4,16); + $pTrk = explode("E",$trkInsD); + $trkInsD = $prefixArr[$instanceNo][6] = $pTrk[0]; + if($DEBUG)echo "
      trkInsD=$trkInsD"; + + $hex_6 = substr($initValue,20,2); + if($DEBUG)echo "
      hex_6=$hex_6"; + $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); + if($DEBUG) echo "
      bin_6=$bin_6"; + + $cdrFlag = $prefixArr[$instanceNo][7] = BinDec(substr($bin_6,7,1)); + if($DEBUG)echo "
      cdrFlag=$cdrFlag"; + + $proType = $prefixArr[$instanceNo][8] = BinDec(substr($bin_6,4,2)); + if($DEBUG)echo "
      proType=$proType"; + + $callType = $prefixArr[$instanceNo][9] = BinDec(substr($bin_6,1,3)); + if($DEBUG)echo "
      callType=$callType"; + + $prefixFlag = $prefixArr[$instanceNo][0] = BinDec(substr($bin_6,0,1)); + if($DEBUG)echo "
      prefixFlag=$prefixFlag"; + + $dLen = $prefixArr[$instanceNo][10] = HexDec(substr($initValue,22,2)); + if($DEBUG)echo "
      dLen=$dLen"; + + $hex_8 = substr($initValue,24,2); + if($DEBUG)echo "
      hex_8=$hex_8"; + $bin_8 = omc_keep_length(DecBin(HexDec($hex_8)),0,8); + if($DEBUG)echo "
      bin_8=$bin_8"; + + $eDelC = $prefixArr[$instanceNo][11] = BinDec(substr($bin_8,4,4)); + if($DEBUG)echo "
      eDelC=$eDelC"; + + $eInsC = $prefixArr[$instanceNo][12] = BinDec(substr($bin_8,0,4)); + if($DEBUG)echo "
      eInsC=$eInsC"; + + $eInsD = substr($initValue,26,8); + $pTrk = explode("E",$eInsD); + $eInsD = $prefixArr[$instanceNo][13] = $pTrk[0]; + if($DEBUG)echo "
      eInsD=$eInsD"; + + $cliType = $prefixArr[$instanceNo][15] = hexdec(substr($initValue,34,2)); + if($DEBUG) echo "cliType = $cliType
      "; + }else{ + $tgNum = $prefixArr[$instanceNo][14] = HexDec($initValue); + //echo "
      prefixArr[$instanceNo][14]={$prefixArr[$instanceNo][14]}"; + } +}while($andRow = @mysqli_fetch_array($andRes)); + +$wDef = " AND ("; + +//for($i=0;$i<256;$i++) +for($i=0;$i<1024;$i++) +{ + if($andShow[1][$i] > 0 || $andShow[2][$i] > 0 || $andShow[3][$i] > 0){ + $realShow[$i] = 1; + //echo "
      realShow[$i]=$realShow[$i]"; + $wDef = $wDef." instanceNo = $i OR "; + } +} +$wDef = substr($wDef,0,-3); +$wDef = $wDef.")"; +if(strlen($wDef) < 10){ + $wDef = ' AND instanceNo < 0 '; +} +//echo "
      wDef=$wDef"; +//$realShow[0] = "1"; + +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo "
      "; +?> +"; +echo ""; +echo ""; +echo "Configuration > Network > Prefix overview"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo "

      $strBack"; +echo ""; +echo ""; +?> + + + "; + ?> + +
      +

      + + + + + + + + + + + + +"; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + } +} +echo "
      No.PrefixIn-TONOut-TONT-D-CT-I-CT-I-DCDR +Properties +Call type +Digit-L +M-D-C +M-I-C +M-I-D +TG +CLI +
      $i{$prefixArr[$i][1]} {$inTonArr[$prefixArr[$i][2]][remark]} {$outTonArr[$prefixArr[$i][3]][remark]} {$prefixArr[$i][4]} {$prefixArr[$i][5]} {$prefixArr[$i][6]} {$cdrFlagArr[$prefixArr[$i][7]][remark]} {$proTypeArr[$prefixArr[$i][8]][remark]} {$callTypeArr[$prefixArr[$i][9]][remark]} {$prefixArr[$i][10]} {$prefixArr[$i][11]} {$prefixArr[$i][12]} {$prefixArr[$i][13]} {$prefixArr[$i][14]} {$cliTypeArr[$prefixArr[$i][15]][remark]} 
      "; +echo ""; +echo ""; +?> + + diff --git a/wxc2_omc/element/mss/ra_default.php b/wxc2_omc/element/mss/ra_default.php new file mode 100755 index 0000000..287900c --- /dev/null +++ b/wxc2_omc/element/mss/ra_default.php @@ -0,0 +1,406 @@ +正在调试中!!"; +?> + + + +getsql = $getsql"; + $result = @mysqli_query($pubConn,$getsql); + $Net_row = @mysqli_fetch_array($result); + + ${$NetworkCodeArr[$i][1]} = str_replace('E','',$Net_row[0]); + echo mysqli_error($pubConn); +}; + +if($DEBUG) +{ + echo "
      instanceNo = $instanceNo
      "; + echo "cc = $cc
      "; + echo "ndc = $ndc
      "; + echo "IPrefix = $IPrefix
      "; + echo "NPrefix = $NPrefix
      "; +} + +//=========================================================// +//Get Database data // +//=========================================================// +if($typeFlag == 'TLDN') +{ + $getsql = "select initValue from $vlr_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '13'"; + $msrn_org = @mysqli_query($pubConn,$getsql); + $msrn_org = @mysqli_fetch_array($msrn_org); + if($DEBUG) echo "getsql = $getsql
      "; + $msrn_org = $msrn_org[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "msrn_org = $msrn_org
      "; + + $getsql = "select initValue from $msc_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '1'"; + $subprefix_org = @mysqli_query($pubConn,$getsql); + $subprefix_org = @mysqli_fetch_array($subprefix_org); + $subprefix_org = $subprefix_org[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "subprefix_org = $subprefix_org
      "; + + $getsql = "select initValue from $msc_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '2'"; + $subpre_attr_org = @mysqli_query($pubConn,$getsql); + $subpre_attr_org = @mysqli_fetch_array($subpre_attr_org); + $subpre_attr_org = $subpre_attr_org[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "subpre_attr_org = $subpre_attr_org
      "; + + $getsql = "select initValue from $msc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '1' and instanceNo < '400'"; + $sub_prefix_rst = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "getsql = $getsql
      "; + + $sub_ra_org = hexdec(getBitValue($subprefix_org,'8.0-8.7')); + if($DEBUG) echo "sub_ra_org=$sub_ra_org
      "; + $subprefix_no = 0; + $unused_no = 0; + $i = 0; + while($sub_prefix_row = @mysqli_fetch_array($sub_prefix_rst)) + { + $sub_prefix_row = $sub_prefix_row[0]; + $sub_ra = hexdec(getBitValue($sub_prefix_row,'8.0-8.7')); + if($DEBUG) echo "sub_ra=$sub_ra
      "; + if($sub_ra == $DEFAULT_MSRN_RAC) + { + $curr_sub_ins = $i; + break; + } + else if($sub_prefix_row == $subprefix_org) + { + $unused_sub_ins[$unused_no] = $i; + $unused_no++; + } + $i++; + } +} +else +{ + $getsql = "select initValue from $mc_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '4'"; + $msisdn_org = @mysqli_query($pubConn,$getsql); + $msisdn_org = @mysqli_fetch_array($msisdn_org); + $msisdn_org = $msisdn_org[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "msisdn_org = $msisdn_org
      "; +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + //update vlr-TLDN + if($typeFlag == 'TLDN') + { + //blank if start or end value equals cc+ndc + $start == '' ? $start = '' : $start = $cc.$ndc.$start; + $end == '' ? $end = '' : $end = $cc.$ndc.$end; + + $start = omc_keep_length($start,'F','16','0'); + $end = omc_keep_length($end,'F','16','0'); + $init = setBitValue($msrn_org,'0.0-7.7',$start); + $init = setBitValue($init,'8.0-15.7',$end); + $setsql = "update $vlr_paramTable set initValue = '$init' + where level_1 = '2' and level_2 = '1' and level_3 = '13' and instanceNo = '$DEFAULT_MSRN_RAC'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + for($i=0; $i < strlen($start); $i++) + { + if(substr($start,0,$i) != substr($end,0,$i)) + break; + $msrn_prefix = substr($start,0,$i); + } + if($DEBUG) echo "msrn_prefix=$msrn_prefix
      "; + + $prefix_loc = array('0.0-7.7','8.0-8.7'); + $ra_no = omc_keep_length(dechex($DEFAULT_MSRN_RAC),'0','2'); + $prefix_arr = array(omc_keep_length($msrn_prefix,'E','16','0'),$ra_no); + + $pre_attr_loc = array('0.0-0.3','0.4-0.7','10.0-10.0','10.2-10.3','10.4-10.6','10.7-10.7','11.0-11.7','12.0-12.3', + '12.4-12.7','13.0-16.7','17.0-17.7'); + + //array('TON incoming call','TON outgoing call','CDR','Properties','Call type','Enable','Length of dialed number','deletion count', + // 'insertion count','inserted digits','Cli-type','annoucement'); + $pre_attr_arr = array('0100','0100','0','10','000','1',omc_keep_length(strlen($cc.$ndc.$msrn_start),'0','2'),'0', + '0',omc_keep_length(0,'E','8','0'),'02'); + + $prefix_init = $subprefix_org; + for($j=0; $j < sizeof($prefix_loc); $j++) + $prefix_init = setBitValue($prefix_init,$prefix_loc[$j],$prefix_arr[$j]); + + $prefix_attr_init = $subpre_attr_org; + for($j=0; $j < sizeof($pre_attr_loc); $j++) + { + if($DEBUG) + { + echo "pre_attr_loc = $pre_attr_loc[$j]
      "; + echo "pre_attr_arr = {$pre_attr_arr[$i][$j]}
      "; + } + $prefix_attr_init = setBitValue($prefix_attr_init,$pre_attr_loc[$j],$pre_attr_arr[$j]); + } + + if($DEBUG) + { + echo "prefix_init = $prefix_init
      "; + echo "prefix_attr_init = $prefix_attr_init
      "; + } + + if(!isset($curr_sub_ins)) + $curr_sub_ins = $unused_sub_ins[0]; + + $setsql = "update $msc_paramTable set initValue = '$prefix_init' + where level_1 = '2' and level_2 = '1' and level_3 = '1' and instanceNo = '$curr_sub_ins'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + $setsql = "update $msc_paramTable set initValue = '$prefix_attr_init' + where level_1 = '2' and level_2 = '1' and level_3 = '2' and instanceNo = '$curr_sub_ins'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + else + { + if($DEBUG) + { + echo "start = $start
      "; + echo "end = $end
      "; + } + + $init = $msisdn_org; + //blank if start or end value equals cc+ndc + if($start != '') + { + //$start = omc_keep_length($cc.$ndc.$start,'E','18','0'); + $start = omc_keep_length($start,'E','18','0'); + $init = setBitValue($init,'00.0-08.7',$start); + } + + if($end != '') + { + //$end = omc_keep_length($cc.$ndc.$end,'E','18','0'); + $end = omc_keep_length($end,'E','18','0'); + $init = setBitValue($init,'09.0-17.7',$end); + } + $setsql = "update $mc_paramTable set initValue = '$init' + where level_1 = '2' and level_2 = '1' and level_3 = '4' and instanceNo = '$instanceNo'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + + echo ""; +} + +$i = 0; +$free_no = 0; + +if($typeFlag == 'TLDN') +{ + $getsql = "select initValue from $vlr_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '13' and instanceNo = '$DEFAULT_MSRN_RAC'"; + $msrn_rst = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "getsql = $getsql
      "; + + $msrn_row = @mysqli_fetch_array($msrn_rst); + $msrn_row = $msrn_row[0]; + + if($DEBUG) echo "
      msrn_row = $msrn_row
      "; + $start = getBitValue($msrn_row,'00.0-07.7'); + $end = getBitValue($msrn_row,'08.0-15.7'); + + $prefix_length = strlen($cc.$ndc); + $tmp_len = strlen($start) - $prefix_length; + $start = substr($start,$prefix_length,$tmp_len); + $tmp_len = strlen($end) - $prefix_length; + $end = substr($end,$prefix_length,$tmp_len); + $start = str_replace('F','',$start); + $end = str_replace('F','',$end); + if($DEBUG) + { + echo "start = $start
      "; + echo "end = $end
      "; + } +} +else +{ + $getsql = "select initValue from $mc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '4' and instanceNo = '$instanceNo'"; + $msisdn_rst = @mysqli_query($pubConn,$getsql); + $msisdn_rst = @mysqli_fetch_array($msisdn_rst); + $msisdn_rst = $msisdn_rst[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "getsql = $getsql
      "; + + if($DEBUG) echo "
      msisdn_rst = $msisdn_rst
      "; + if($msisdn_rst == $msisdn_org) + $msisdn_rst = ''; + $start = getBitValue($msisdn_rst,'00.0-08.7'); + $end = getBitValue($msisdn_rst,'09.0-17.7'); + if($DEBUG) + { + echo "start = $start
      "; + echo "end = $end
      "; + } + /* + $prefix_length = strlen($cc.$ndc); + $tmp_len = strlen($start) - $prefix_length; + $start = substr($start,$prefix_length,$tmp_len); + $tmp_len = strlen($end) - $prefix_length; + $end = substr($end,$prefix_length,$tmp_len); + */ + $start = str_replace('E','',$start); + $end = str_replace('E','',$end); + if($DEBUG) + { + echo "start = $start
      "; + echo "end = $end
      "; + } +} + +echo "
      "; +echo ""; +echo ""; +echo ""; + echo ""; + echo "
      "; +if($typeFlag == 'TLDN') +{ + echo "Configuration > Network > Element > MSC "; + echo ""; + //showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Routing area:    "; + if($instanceNo == 'new') + { + echo "    "; + } + else + { + echo "$instanceNo    "; + } +} +else +{ + echo "$strConfiguration > Network > SMSC > $typeFlag"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo "
      "; +} + +echo ""; +echo ""; +echo ""; +$backurl=$backurl."?scroll_y=".$sub_page_top; +echo ""; +echo "
       "; +//echo "$typeFlag Segment:    "; +echo ""; +echo ""; +echo "    "; +echo ""; +echo "

      $strBack"; +echo "

      "; +?> + + + +"; + echo ""; + echo ""; + echo ""; +} +//TLDN or MSISDN +{ + $prefix = $cc.$ndc; + if($typeFlag == 'TLDN') + $len = 16 - strlen($prefix); + else + $len = 18 - strlen($prefix); + echo ""; + echo ""; + //echo ""; + echo ""; + + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; +} +echo ""; +echo ""; +echo ""; +echo "
      ParametersValue
      Start $typeFlag$prefix
      End $typeFlag$prefix
      "; + +?> +"; + +?> diff --git a/wxc2_omc/element/mss/ra_edit.php b/wxc2_omc/element/mss/ra_edit.php new file mode 100755 index 0000000..a8ab39a --- /dev/null +++ b/wxc2_omc/element/mss/ra_edit.php @@ -0,0 +1,773 @@ +正在调试中!!"; +?> + + + + +"; + echo "all_ins_no = $all_ins_no
      "; + echo "allFlag = $allFlag
      "; + echo "instanceNo = $instanceNo
      "; + echo "cc = $cc
      "; + echo "ndc = $ndc
      "; + echo "IPrefix = $IPrefix
      "; + echo "NPrefix = $NPrefix
      "; +} + +//=========================================================// +//Get Database data // +//=========================================================// +$getsql = "select initValue from $vlr_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '13'"; +$msrn_org = @mysqli_query($pubConn,$getsql); +$msrn_org = @mysqli_fetch_array($msrn_org); +$msrn_org = $msrn_org[0]; +echo mysqli_error($pubConn); +if($DEBUG) echo "msrn_org = $msrn_org
      "; + +$getsql = "select initValue from $msc_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '1'"; +$subprefix_org = @mysqli_query($pubConn,$getsql); +$subprefix_org = @mysqli_fetch_array($subprefix_org); +$subprefix_org = $subprefix_org[0]; +echo mysqli_error($pubConn); +if($DEBUG) echo "subprefix_org = $subprefix_org
      "; + +$getsql = "select initValue from $msc_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '2'"; +$subpre_attr_org = @mysqli_query($pubConn,$getsql); +$subpre_attr_org = @mysqli_fetch_array($subpre_attr_org); +$subpre_attr_org = $subpre_attr_org[0]; +echo mysqli_error($pubConn); +if($DEBUG) echo "subpre_attr_org = $subpre_attr_org
      "; + +$getsql = "select initValue from $msc_paramConf where level_1 = '2' and level_2 = '6' and level_3 = '5'"; +$bill_org = @mysqli_query($pubConn,$getsql); +$bill_org = @mysqli_fetch_array($bill_org); +$bill_org = $bill_org[0]; +echo mysqli_error($pubConn); +if($DEBUG) echo "bill_org = $bill_org
      "; + +$getsql = "select initValue from $vlr_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '13'"; +$msrn_rst = @mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); +if($DEBUG) echo "getsql = $getsql
      "; + +$getsql = "select initValue from $msc_paramTable where level_1 = '2' and level_2 = '6' and level_3 = '5'"; +$bill_mscid_rst = @mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); +if($DEBUG) echo "getsql = $getsql
      "; + +$getsql = "select initValue from $msc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '2' and instanceNo < '400'"; +$prefix_attr_rst = @mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); +if($DEBUG) echo "getsql = $getsql
      "; + +$getsql = "select initValue from $msc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '1' and instanceNo < '400'"; +$sub_prefix_rst = @mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); +if($DEBUG) echo "getsql = $getsql
      "; + +$sub_ra_org = hexdec(getBitValue($subprefix_org,'8.0-8.7')); +if($DEBUG) echo "sub_ra_org=$sub_ra_org
      "; + +$subprefix_no = 0; +$unused_no = 0; +$i = 0; +while($sub_prefix_row = @mysqli_fetch_array($sub_prefix_rst)) +{ + $prefix_attr_row = mysqli_fetch_array($prefix_attr_rst); + $prefix_attr_row = $prefix_attr_row[0]; + $sub_prefix_row = $sub_prefix_row[0]; + $sub_ra = hexdec(getBitValue($sub_prefix_row,'8.0-8.7')); + $flag = getBitValue($prefix_attr_row,'10.1'); + if($sub_ra != $sub_ra_org && $sub_prefix_row != $subprefix_org) + { + $sub_prefix_tmp[$subprefix_no] = $sub_prefix_row; + $sub_prefix_ins[$subprefix_no] = $i; + $prefix_attr_tmp[$subprefix_no] = $prefix_attr_row; + $msrn_prefix_flag[$subprefix_no] = $flag; + $subprefix_no++; + } + else + { + if($DEBUG)echo "unused_no = $i
      "; + $curr_sub_ins[$unused_no] = $i; + $unused_no++; + } + $i++; +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if($instanceNo == 'new') + { + if($ra_ins == 'all') + $ra_ins = $all_ins_no; + + $ra_no = $ra_ins; + } + else + { + $ra_no = $instanceNo; + $msrn_prefix_found_flag == 0; + $sub_tmp = 0; + $i=0; + while($sub_tmp < $subprefix_no) + { + $sub_row_tmp = $sub_prefix_tmp[$sub_tmp]; + $sub_ra = hexdec(getBitValue($sub_row_tmp,'8.0-8.7')); + if($DEBUG) echo "
      sub_ra = $sub_ra
      "; + if($ra_no == $sub_ra) + { + if($msrn_prefix_flag[$sub_tmp] == 0) + { + $curr_sub_ins[$i] = $sub_prefix_ins[$sub_tmp]; + if($DEBUG) echo "
      curr_sub_ins = $curr_sub_ins[$i]
      "; + $i++; + } + else if($msrn_prefix_flag[$sub_tmp] == 1 && $msrn_prefix_found_flag == 0) + { + $msrn_prefix_insNo = $sub_prefix_ins[$sub_tmp]; //TLDN prefix instanceNo + if($DEBUG) echo "
      msrn_prefix_insNo = $msrn_prefix_insNo
      "; + $msrn_prefix_found_flag == 1; + } + } + $sub_tmp++; + + } + } + if($DEBUG) + { + echo "instanceNo = $instanceNo
      "; + echo "ra_no = $ra_no
      "; + echo "sub_prefix = $sub_prefix
      "; + echo "msrn_start = $msrn_start
      "; + echo "msrn_end = $msrn_end
      "; + echo "bill_market = $bill_market
      "; + echo "bill_switch = $bill_switch
      "; + } + //update vlr-TLDN + if($allFlag != 1) + { + //blank if start or end value equals cc+ndc + $msrn_start == '' ? $start = '' : $start = $cc.$ndc.$msrn_start; + $msrn_end == '' ? $end = '' : $end = $cc.$ndc.$msrn_end; + + $start = omc_keep_length($start,'F','16','0'); + $end = omc_keep_length($end,'F','16','0'); + $msrn_init = setBitValue($msrn_org,'0.0-7.7',$start); + $msrn_init = setBitValue($msrn_init,'8.0-15.7',$end); + $setsql = "update $vlr_paramTable set initValue = '$msrn_init' + where level_1 = '2' and level_2 = '1' and level_3 = '13' and instanceNo = '$ra_no'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + for($i=0; $i < strlen($msrn_start); $i++) + { + if(substr($msrn_start,0,$i) != substr($msrn_end,0,$i)) + break; + $msrn_prefix = substr($msrn_start,0,$i); + } + if($DEBUG) echo "msrn_prefix=$msrn_prefix
      "; + } + + //update msc-billing MSCID + if($allFlag != 1) + { + $bill_market = omc_keep_length(dechex($bill_market),'0','4','1'); + $bill_switch = omc_keep_length(dechex($bill_switch),'0','2','1'); + $bill_init = setBitValue($bill_org,'0.0-1.7',$bill_market); + $bill_init = setBitValue($bill_init,'2.0-2.7',$bill_switch); + $setsql = "update $msc_paramTable set initValue = '$bill_init' + where level_1 = '2' and level_2 = '6' and level_3 = '5' and instanceNo = '$ra_no'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } + + //update msc-prefix and prefix attribute + if($sub_prefix != '' || $msrn_prefix != '') + { + if(!isset($num_length)) + $num_length = 0; + //$num_length = omc_keep_length($num_length,'0','2','1'); + $ra_no = omc_keep_length(dechex($ra_no),'0','2'); + $prefix_loc = array('0.0-7.7','8.0-8.7'); + $prefix_arr = array( + array(omc_keep_length($sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($NPrefix.$ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($IPrefix.$cc.$ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($cc.$ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($cc.$ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($cc.$ndc.$sub_prefix,'E','16','0'),$ra_no), + array(omc_keep_length($cc.$ndc.$msrn_prefix,'E','16','0'),$ra_no) + ); + + $pre_attr_loc = array('0.0-0.3','0.4-0.7','10.0-10.0','10.1-10.1','10.2-10.3','10.4-10.6','10.7-10.7','11.0-11.7','12.0-12.3', + '12.4-12.7','13.0-16.7','17.0-17.7','18.0-18.0','18.4-18.7'); + $pre_attr_arr = array( + //array('TON incoming call','TON outgoing call','CDR','TLDN/Prefix Flag','Properties','Call type','Enable','Length of dialed number','deletion count', + // 'insertion count','inserted digits','Cli-type','annoucement','MAP TON outgoing'); + //prefix --Unkown + array('0010','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length),'0','2'),'0', + decbin(strlen($cc.$ndc)),omc_keep_length($cc.$ndc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //prefix --MSISDN + array('0001','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length),'0','2'),'0', + decbin(strlen($cc.$ndc)),omc_keep_length($cc.$ndc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //prefix --IDD + array('0011','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length),'0','2'),'0', + decbin(strlen($cc.$ndc)),omc_keep_length($cc.$ndc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //prefix --NDD + array('0100','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length),'0','2'),'0', + decbin(strlen($cc.$ndc)),omc_keep_length($cc.$ndc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //NP+NDC+Prefix --Unkown + array('0010','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($NPrefix.$ndc)),'0','2'),decbin(strlen($NPrefix)), + decbin(strlen($cc)),omc_keep_length($cc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //IP+CC+NDC+Prefix --Unkown + array('0010','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($IPrefix.$cc.$ndc)),'0','2'),decbin(strlen($IPrefix)), + '000',omc_keep_length(0,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //NDC+Prefix -- Unknown + array('0010','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($ndc)),'0','2'),'0', + decbin(strlen($cc)),omc_keep_length($cc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //CC+NDC+Prefix -- Unknown + array('0010','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($cc.$ndc)),'0','2'),'0', + '000',omc_keep_length(0,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //NDC+Prefix -- MSISDN + array('0001','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($ndc)),'0','2'),'0', + decbin(strlen($cc)),omc_keep_length($cc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //CC+NDC+Prefix -- MSISDN + array('0001','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($cc.$ndc)),'0','2'),'0', + '000',omc_keep_length(0,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //NDC+Prefix -- NDD + array('0011','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($ndc)),'0','2'),'0', + decbin(strlen($cc)),omc_keep_length($cc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //NDC+Prefix -- IDD + array('0100','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($ndc)),'0','2'),'0', + decbin(strlen($cc)),omc_keep_length($cc,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //CC+NDC+Prefix -- IDD + array('0100','0100',$cdr,'0','01','000','1',omc_keep_length(dechex($num_length+strlen($cc.$ndc)),'0','2'),'0', + '000',omc_keep_length(0,'E','8','0'),omc_keep_length($cli_type,'0','2'),omc_keep_length($VoicePrompt,'0','1'),omc_keep_length(decbin($MAP_type),'0','4')), + //MSRN_Prefix + array('0100','0100','0','1','10','000','1',omc_keep_length(strlen($cc.$ndc.$msrn_start),'0','2'),'0', + '000',omc_keep_length(0,'E','8','0'),'02','0',omc_keep_length(decbin($MAP_type),'0','4')) + ); + + //needn't add TLDN to prefix table when adding ALL prefix + if($allFlag == 1) + { + $start_loc = 0; + $arr_size = sizeof($prefix_arr) - 1; + } + else + { + if($sub_prefix == '') + { + $start_loc = 6; + }else + { + $start_loc = 0; + } + $arr_size = sizeof($prefix_arr); + } + $index = 0; + for($i=$start_loc; $i < $arr_size; $i++) + { + $prefix_init = $subprefix_org; + for($j=0; $j < sizeof($prefix_loc); $j++) + $prefix_init = setBitValue($prefix_init,$prefix_loc[$j],$prefix_arr[$i][$j]); + + $prefix_attr_init = $subpre_attr_org; + for($j=0; $j < sizeof($pre_attr_loc); $j++) + { + if($DEBUG) + { + echo "pre_attr_loc = $pre_attr_loc[$j]
      "; + echo "pre_attr_arr = {$pre_attr_arr[$i][$j]}
      "; + } + $prefix_attr_init = setBitValue($prefix_attr_init,$pre_attr_loc[$j],$pre_attr_arr[$i][$j]); + } + + if($DEBUG) + { + echo "prefix_init = $prefix_init
      "; + echo "prefix_attr_init = $prefix_attr_init
      "; + } + + if($i == 6 && isset($msrn_prefix_insNo)) + $prefix_insNo = $msrn_prefix_insNo; + else + $prefix_insNo = $curr_sub_ins[$index]; + + $setsql = "update $msc_paramTable set initValue = '$prefix_init' + where level_1 = '2' and level_2 = '1' and level_3 = '1' and instanceNo = '$prefix_insNo'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + $setsql = "update $msc_paramTable set initValue = '$prefix_attr_init' + where level_1 = '2' and level_2 = '1' and level_3 = '2' and instanceNo = '$prefix_insNo'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + $index++; + } + +// //insert two prefix to XAPP +// $tmpSQL = "SELECT $net_paramTable.instanceNo FROM $net_paramTable,$net_paramConf WHERE $net_paramTable.initValue = $net_paramConf.initValue +// AND $net_paramTable.level_1 = '2' AND $net_paramTable.level_2 = '8' AND $net_paramTable.level_1 = $net_paramConf.level_1 +// AND $net_paramTable.level_2 = $net_paramConf.level_2"; +// if($DEBUG) echo "tmpSQL = $tmpSQL
      "; +// $xapp_rst = @mysql_db_query($netdb,$tmpSQL); +// echo mysqli_error($pubConn); +// if(mysqli_num_rows($xapp_rst) < 2) +// { +// echo ""; +// } +// else +// { +// $k = 0; +// while($xapp_row = mysqli_fetch_array($xapp_rst)) +// { +// $xapp_prefix_ins[$k++] = $xapp_row[0]; +// if($k >= 2) +// break; +// } +// +// $xapp_prefix_loc = array('00.0-15.7','16.0-16.7','17.0-17.7','18.0-33.7','34.0-34.7'); +// $xapp_prefix = array( +// array(omc_keep_length(toHex($sub_prefix),'0','32','0'),'00', +// omc_keep_length(dechex(strlen($cc.$ndc)),'0','2','1'),omc_keep_length(toHex($cc.$ndc),'0','32','0'),'00'), +// array(omc_keep_length(toHex($ndc.$sub_prefix),'0','32','0'),'00', +// omc_keep_length(dechex(strlen($cc)),'0','2','1'),omc_keep_length(toHex($cc),'0','32','0'),'00'), +// ); +// +// for($k=0; $k < sizeof($xapp_prefix); $k++) +// { +// $initValue = omc_keep_length($initValue,'0','70'); +// for($j=0; $j < sizeof($xapp_prefix[$k]); $j++) +// $initValue = setBitValue($initValue,$xapp_prefix_loc[$j],$xapp_prefix[$k][$j]); +// +// echo "
      initValue = $initValue"; +// +// $setsql = "update $net_paramTable set initValue = '$initValue' +// where level_1 = '2' and level_2 = '8' and instanceNo = '$xapp_prefix_ins[$k]'"; +// // if($DEBUG) +// echo "setsql = $setsql
      "; +// mysql_db_query($netdb,$setsql); +// echo mysqli_error($pubConn); +// } +// exit(); +// } + } + + echo ""; +} + +if($DEBUG) +{ + echo "
      delFlag = $delFlag
      "; + echo "delValue = $delValue
      "; +} +if($delFlag == 1 && $delValue != '') +{ + $getsql = "select initValue from $msc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '1' and instanceNo < '400'"; + $sub_prefix_rst = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "getsql = $getsql
      "; + $i = 0; + while($sub_prefix_row = @mysqli_fetch_array($sub_prefix_rst)) + { + $sub_prefix_row = $sub_prefix_row[0]; + $sub_ra = hexdec(getBitValue($sub_prefix_row,'8.0-8.7')); + if($sub_ra == $delValue) + { + $objWhereStr = getLevelWhere('2.1.1'); + $setsql = "update $msc_paramTable set initValue = '$subprefix_org' where $objWhereStr and instanceNo='$i'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + + $objWhereStr = getLevelWhere('2.1.2'); + $setsql = "update $msc_paramTable set initValue = '$subpre_attr_org' where $objWhereStr and instanceNo='$i'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + $i++; + } + + //back to msc + echo ""; +} + +$i = 0; +$free_no = 0; +$all_free_no = 0; +while($i < 100) +{ + $msrn_row = @mysqli_fetch_array($msrn_rst); + $msrn_row = $msrn_row[0]; + + $bill_mscid_row = @mysqli_fetch_array($bill_mscid_rst); + $bill_mscid_row = $bill_mscid_row[0]; + + $sub_prefix_row = ''; + $sub_tmp = 0; + while($sub_tmp < $subprefix_no) + { + $sub_row_tmp = $sub_prefix_tmp[$sub_tmp]; + $sub_ra = hexdec(getBitValue($sub_row_tmp,'8.0-8.7')); + if($DEBUG) echo "
      $i = $sub_ra
      msrn_prefix_flag[$sub_tmp]=$msrn_prefix_flag[$sub_tmp]
      "; + if($msrn_prefix_flag[$sub_tmp]==0 && $i == $sub_ra) + { + $sub_prefix_row = $sub_row_tmp; + $prefix_attr_row = $prefix_attr_tmp[$sub_tmp]; + break; + } + $sub_tmp++; + } + + if($msrn_row == $msrn_org + &&$bill_mscid_row == $bill_org + &&$sub_prefix_row == '') + { + $ra_unused[$free_no] = $i; + //if($DEBUG) echo "ra_unused = $ra_unused[$free_no]
      "; + $free_no++; + } + else if($i >= 50 && $sub_prefix_row == '') + { + $all_unused[$all_free_no] = $i; + //if($DEBUG) echo "all_unused = $all_unused[$all_free_no]
      "; + $all_free_no++; + } + else if($i == $instanceNo && $instanceNo != 'new') + { + //Get TLDN + if($DEBUG) echo "
      msrn_row = $msrn_row
      "; + $msrn_start = getBitValue($msrn_row,'00.0-07.7'); + $msrn_end = getBitValue($msrn_row,'08.0-15.7'); + $msrn_start = str_replace('F','',$msrn_start); + $msrn_end = str_replace('F','',$msrn_end); + $prefix_length = strlen($cc.$ndc); + $tmp_len = strlen($msrn_start) - $prefix_length; + $msrn_start = substr($msrn_start,$prefix_length,$tmp_len); + $tmp_len = strlen($msrn_end) - $prefix_length; + $msrn_end = substr($msrn_end,$prefix_length,$tmp_len); + if($DEBUG) + { + echo "msrn_start = $msrn_start
      "; + echo "msrn_end = $msrn_end
      "; + } + + //Get Subscriber prefix + if($sub_prefix_row != '') + { + if($DEBUG) echo "
      sub_prefix_row = $sub_prefix_row
      "; + $sub_prefix = getBitValue($sub_prefix_row,'0.0-7.7'); + $sub_prefix = str_replace('E','',$sub_prefix ); + if($DEBUG) echo "sub_prefix = $sub_prefix
      "; + + //Get prefix attribute + if($DEBUG) echo "
      prefix_attr_row = $prefix_attr_row
      "; + $num_length = hexdec(getBitValue($prefix_attr_row,'11.0-11.7')); + $cdr_flag = getBitValue($prefix_attr_row,'10.0-10.0'); + $MAP_type = bindec(getBitValue($prefix_attr_row,'18.4-18.7')); + $VoicePrompt = getBitValue($prefix_attr_row,'18.0-18.0'); + $cli_type = getBitValue($prefix_attr_row,'17.0-17.7'); + + //Get Billing MSCID + if($DEBUG) echo "
      msrn_row = $msrn_row
      "; + $bill_market_id = hexdec(getBitValue($bill_mscid_row,'0.0-1.7')); + $bill_switch_num = hexdec(getBitValue($bill_mscid_row,'2.0-2.7')); + } + } + $i++; +} +if($DEBUG) echo "free_no = $free_no
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > Element > MSC "; +echo ""; +showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +if($allFlag == 1 && $instanceNo != 'new') + echo ""; +echo ""; +echo "
      "; +echo "Routing area:    "; +if($instanceNo == 'new') +{ + echo "    "; + + if($DEBUG) echo "ra_ins = $ra_ins
      "; + if($DEBUG) echo "all_unused = $all_unused[0]
      "; +} +else if($allFlag == 1) +{ + echo "ALL    "; +} +else +{ + echo "$instanceNo    "; +} +echo ""; +echo ""; +echo "
      del

      $strBack"; +echo "

      "; +?> + + + +"; + echo ""; + echo ""; + echo ""; +} +//TLDN +if($allFlag != 1) +{ + $prefix = $cc.$ndc; + $len = 16 - strlen($prefix); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +//prefix attribute +{ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + $MAP_type_arr = array('','Sub' ,'Unknown','NDD','IDD'); + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; +} +//Billing MSCID +if($allFlag != 1) +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +if($ra_ins >= 50) +{ + echo ""; + echo ""; +} +echo "
      ParametersValue
      Start TLDN$prefix
      End TLDN$prefix
      Subscriber prefix
      Number length
      CDR
      MAP TON outgoing
      Voice Prompt
      CLI   type
      Billing MSCIDBilling market ID:     + Billing switch number:
      "; + +?> +"; +?> diff --git a/wxc2_omc/element/mss/reg_edit.php b/wxc2_omc/element/mss/reg_edit.php new file mode 100755 index 0000000..079f22b --- /dev/null +++ b/wxc2_omc/element/mss/reg_edit.php @@ -0,0 +1,145 @@ +正在调试中!!"; +?> + + + +"; + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if($DEBUG) echo "row = $row
      "; + $initValue = $row; + $initValue =setBitValue($initValue,'4.0-4.7','01'); + $k = 0; + for($i=5; $i < 72; $i++) + { + if($DEBUG) echo "k = ${$k}
      "; + $tmp = dechex(${$k}); + if($k == 1) + { + $j = $i; + $tmp = omc_keep_length($tmp,'0','2'); + } + else + { + $j = $i + 1; + $tmp = omc_keep_length($tmp,'0','4'); + } + $loc = $i.'.0'.'-'.$j.'.7'; + $initValue = setBitValue($initValue,$loc,$tmp); + if($k != 1) $i++; + $k++; + } + if($DEBUG) echo "instanceNo = $instanceNo
      "; + if($DEBUG) echo "initValue = $initValue
      "; + $setsql = "update $sqltable set initValue = '$initValue' + where level_1 = '2' and level_2 = '1' and level_3 = '14' and instanceNo = '$instanceNo'"; + if($DEBUG) echo "setsql = $setsql
      "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + echo ""; +} + +$getsql = "select initValue from $sqltable +where level_1 = '2' and level_2 = '1' and level_3 = '14' and instanceNo ='$instanceNo' "; +$result = @mysqli_query($pubConn,$getsql); +$row = @mysqli_fetch_array($result); +echo mysqli_error($pubConn); +$row = $row[0]; + +$k = 0; +for($i = 5;$i < 72; $i++) +{ + if($i == 7) $j = $i; + else $j = $i + 1; + $loc = $i.'.0'.'-'.$j.'.7'; + $reg[$k] = hexdec(getBitValue($row,$loc)); + $k++; + if($i != 7) $i++; +} + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > Element > MSC > HLR"; +echo ""; +showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Regional subscription list:  "; +echo ""; +echo ""; +echo "

      $strBack"; +echo "

      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      Market ID: 
      Switch number: 
      "; +?> + + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +for($i = 0;$i<16;$i++) +{ + $j = $i + 2; + echo ""; + echo ""; + echo ""; + + $j = $j + 16; + $k = $i + 16; + echo ""; + echo ""; + echo ""; +}; +echo ""; +echo ""; +echo "
      Regional subscriptionLocation area identityRegional subscriptionLocation area identity
      $i$k
      "; + +?> + +"; +?> diff --git a/wxc2_omc/element/mss/smpp_detail.php b/wxc2_omc/element/mss/smpp_detail.php new file mode 100755 index 0000000..d3954da --- /dev/null +++ b/wxc2_omc/element/mss/smpp_detail.php @@ -0,0 +1,495 @@ +正在调试中!!"; +?> + + + + +'2.2.0', 'sysid'=> '350_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.0', 'sysid'=> '260_99_99', 'selectsysid'=>'-1'), +); + +$SaveArr=array( + array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=>'350_99_99'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'260_99_99') +); + +$smpp_sqltable = 'OBJ_260.param_99'; +$smsc_sqltable = 'OBJ_350.param_99'; +$pubdb = 'OMC_PUB'; + +$curr_page = './smpp_detail.php'; + +$smpp_array = array( + array('Link type', '1.0-1.7'), + array('Connection type', '2.0-2.7'), + array('Session type', '3.0-3.7'), + array('System ID', '4.0-19.7'), + array('Password', '20.0-28.7'), + array('Local GTT ', '42.0-57.7'), + array('Remote GTT', '58.0-73.7'), + array('Local IP', '74.0-77.7'), + array('Remote IP', '78.0-81.7'), + array('Session timer', '82.0-85.7'), + array('Enquire link timer', '86.0-89.7'), + array('Inactivity timer', '90.0-93.7'), + array('Response timer', '94.0-97.7'), + array('Opposite service number','98.0-105.7'), + array('flag', '0.0-0.7') +); +$smsc_array = array( + array('flag', '00.0-00.7'), + array('Session type', '01.0-01.7'), + array('Service number', '02.0-09.7'), + array('Message mode', '10.0-10.7'), + array('Data Coding Scheme', '11.0-11.7') +); + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + //echo "
      Getting parameters
      "; + //GetParam($sysId_arr); + + echo "
      Setting parameters
      "; + SetParam($sysId_arr); + session_register("SetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } + /* + elseif(isset($undoSet)) + { + echo "
      Setting parameters
      "; + SetParam(1); + } + */ + if($setSys || $getSys || $undoSet) + { + echo ""; + exit(); + } + +} + +if($delflag == 1) +{ + $setsql = "select initValue from $smpp_sqltable + WHERE level_1='2' AND level_2='1' AND level_3='0' and instanceNo='$delValue' "; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + $smpp_del = mysqli_fetch_array($result); + $session_type = getBitValue($smpp_del[0],'3.0-3.7'); + $opposite_num = getBitValue($smpp_del[0],'98.0-105.7'); + + $setsql = "select initValue from $smsc_sqltable + WHERE level_1='2' AND level_2='2' AND level_3='0' "; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + + $smsc_ins = 0; + while($smsc_row = mysqli_fetch_array($result)) + { + $smsc_session_type = getBitValue($smsc_row[0],'01.0-01.7'); + $smsc_opposite_num = getBitValue($smsc_row[0],'02.0-9.7'); + if($smsc_session_type == $session_type && $smsc_opposite_num == $opposite_num) + break; + $smsc_ins++; + } + + $initValue = omc_keep_length($initValue,'0','24'); + $setsql = "update $smsc_sqltable set initValue = '$initValue' + where level_1 = '2' and level_2 = '2' and level_3 = '0' and instanceNo = '$smsc_ins' "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + + $initValue = omc_keep_length($initValue,'0','212'); + $setsql = "update $smpp_sqltable set initValue = '$initValue' + where level_1 = '2' and level_2 = '1' and level_3 = '0' and instanceNo = '$delValue' "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; +} + +if($DEBUG) echo "back_page=$back_page
      "; + +//========================================================== +//取数据库数据 +//========================================================== +$levelArr=explode('.',$smpp_oid[0]); +for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; +} + +$setsql = "select initValue from $smpp_sqltable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3'"; +$result = mysqli_query($pubConn,$setsql); +echo mysqli_error($pubConn); +if($DEBUG) echo "
      $setsql
      "; + +$i = 0; +$n = 0; +while($smpp_row = mysqli_fetch_array($result)) +{ + $enable_flag = getBitValue($smpp_row[0],$smpp_array[14][1]); + if ($DEBUG)echo "
      smpp_row = $smpp_row[0]
      "; + if($enable_flag == 0) + { + $i++; + continue; + } + $link_type[$n] = getBitValue($smpp_row[0],$smpp_array[0][1]); + $connect_type[$n] = getBitValue($smpp_row[0],$smpp_array[1][1]); + $session_type[$n] = getBitValue($smpp_row[0],$smpp_array[2][1]); + $system_id[$n] = toAscii(getBitValue($smpp_row[0],$smpp_array[3][1])); + $password[$n] = toAscii(getBitValue($smpp_row[0],$smpp_array[4][1])); + $local_gtt[$n] = toAscii(getBitValue($smpp_row[0],$smpp_array[5][1])); + $remote_gtt[$n] = toAscii(getBitValue($smpp_row[0],$smpp_array[6][1])); + $local_ip[$n] = getBitValue($smpp_row[0],$smpp_array[7][1]); + $remote_ip[$n] = getBitValue($smpp_row[0],$smpp_array[8][1]); + $session_timer[$n] = hexdec(getBitValue($smpp_row[0],$smpp_array[9][1])); + $enquire_timer[$n] = hexdec(getBitValue($smpp_row[0],$smpp_array[10][1])); + $inact_timer[$n] = hexdec(getBitValue($smpp_row[0],$smpp_array[11][1])); + $response_timer[$n] = hexdec(getBitValue($smpp_row[0],$smpp_array[12][1])); + $opposite_num[$n] = toAscii(getBitValue($smpp_row[0],$smpp_array[13][1])); + $ins_no[$n] = $i; + + if($DEBUG) + { + echo "SMPP:
      "; + echo "link_type=$link_type[$n]
      "; + echo "connect_type=$connect_type[$n]
      "; + echo "session_type=$session_type[$n]
      "; + echo "system_id=$system_id[$n]
      "; + echo "password=$password[$n]
      "; + echo "local_gtt=$local_gtt[$n]
      "; + echo "remote_gtt=$remote_gtt[$n]
      "; + echo "local_ip=$local_ip[$n]
      "; + echo "remote_ip=$remote_ip[$n]
      "; + echo "session_timer=$session_timer[$n]
      "; + echo "enquire_timer=$enquire_timer[$n]
      "; + echo "inact_timer=$inact_timer[$n]
      "; + echo "response_timer=$response_timer[$n]
      "; + echo "opposite_num=$opposite_num[$n]
      "; + } + $levelArr=explode('.',$smsc_oid[0]); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $setsql = "select initValue from $smsc_sqltable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' "; + $smsc_result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $smsc_ins = 0; + while($smsc_row = mysqli_fetch_array($smsc_result)) + { + $smsc_session_type = getBitValue($smsc_row[0],$smsc_array[1][1]); + $smsc_opposite_num = toAscii(getBitValue($smsc_row[0],$smsc_array[2][1])); + if($smsc_session_type == $session_type[$n] && $smsc_opposite_num == $opposite_num[$n]) + { + $smsc_dcs[$n] = getBitValue($smsc_row[0],$smsc_array[4][1]); + break; + } + $smsc_ins++; + } + if($DEBUG) echo "dcs=$smsc_dcs[$n]
      "; + + $n++; + $i++; +} +//========================================================== +//输出并显示数据 +//========================================================== +echo ""; + +echo ""; +?> + +"; +echo ""; +echo ""; +echo "Configuration > Network > Element > SMSC"; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "SMPP link:  "; +echo ""; +echo ""; +if ( TRUE == session_is_registered("SetFlag") ) +{ + echo ""; +} +else +{ + echo ""; +} +echo "Add"; +echo "

      $strBack"; +echo "

      "; +?> + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$i = 0; +while($n != 0) +{ +echo ""; +//========================================================== +//输出No. +//========================================================== +echo ""; +//========================================================== +//输出Link type +//========================================================== +if($DEBUG) echo "link_type_$i = $link_type[$i]
      "; +if ($link_type[$i] == 0) +{ + echo ""; +} +else +{ + echo ""; +} +//========================================================== +//输出Connection type +//========================================================== +if ($connect_type[$i] == 0) +{ + echo ""; +} +else +{ + echo ""; +} +/*//========================================================== +//输出Session type +//========================================================== +switch ($session_type[$i]) +{ + case 0: + { + echo ""; + } + break; + case 1: + { + echo ""; + } + break; + case 2: + { + echo ""; + } + break; +}*/ +//========================================================== +//输出System ID +//========================================================== +echo ""; +//========================================================== +//输出Password +//========================================================== +echo ""; +//========================================================== +//输出DCS +//========================================================== +switch ($smsc_dcs[$i]) +{ + case 0: + { + echo ""; + } + break; + case 1: + { + echo ""; + } + break; + case 16: + { + echo ""; + } + break; + case 17: + { + echo ""; + } + break; +} +//========================================================== +//输出Opposite service number +//========================================================== +echo ""; +//========================================================== +//输出GT +//========================================================== +if($link_type[$i] == 0) +{ + echo ""; + echo ""; + + echo ""; +} +//========================================================== +//输出IP +//========================================================== +else +{ + echo ""; + +// echo ""; + $rmt_ip[0] = hexdec(getBitValue($remote_ip[$i],'0.0-0.7')); + $rmt_ip[1] = hexdec(getBitValue($remote_ip[$i],'1.0-1.7')); + $rmt_ip[2] = hexdec(getBitValue($remote_ip[$i],'2.0-2.7')); + $rmt_ip[3] = hexdec(getBitValue($remote_ip[$i],'3.0-3.7')); + echo ""; +// echo ""; + $lcl_ip[0] = hexdec(getBitValue($local_ip[$i],'0.0-0.7')); + $lcl_ip[1] = hexdec(getBitValue($local_ip[$i],'1.0-1.7')); + $lcl_ip[2] = hexdec(getBitValue($local_ip[$i],'2.0-2.7')); + $lcl_ip[3] = hexdec(getBitValue($local_ip[$i],'3.0-3.7')); + echo ""; +} +//========================================================== +//输出Session timer +//========================================================== +echo ""; +//========================================================== +//输出Enquire link timer +//========================================================== +echo ""; +//========================================================== +//输出Inactivity timer +//========================================================== +echo ""; +//========================================================== +//输出Response timer +//========================================================== +echo ""; + +echo ""; + +$n--; +$i++; +echo ""; +}//end while + +echo "
      No.Link typeConnection typeSystem IDPasswordDCSService numberLocal GTTOpposite GTTLocal IPOpposite IP Session init timerEnquire link timerInactivity timerResponse timerDel
      $ins_no[$i]UDPTCPClientServerBIND_TXBIND_RXBIND_TRX$system_id[$i] $password[$i] out=7bit,in=7bitout=8bit,in=7bitout=7bit,in=8bitout=8bit,in=8bit$opposite_num[$i] $remote_gtt[$i] $local_gtt[$i] --------$remote_ip[$i] "; + for($k=0; $k<4; $k++) + { + echo $rmt_ip[$k]; + if($k != 3) + echo "."; + + } + echo "$local_ip[$i] "; + for($k=0; $k<4; $k++) + { + echo $lcl_ip[$k]; + if($k != 3) + echo "."; + + } + echo "$session_timer[$i] $enquire_timer[$i] $inact_timer[$i] $response_timer[$i] 
      "; + +echo ""; +?> diff --git a/wxc2_omc/element/mss/smpp_edit.php b/wxc2_omc/element/mss/smpp_edit.php new file mode 100755 index 0000000..4b301ef --- /dev/null +++ b/wxc2_omc/element/mss/smpp_edit.php @@ -0,0 +1,590 @@ +正在调试中!!"; +?> + + + + + +"; + $remote_ip .= $tmp; + + $tmp = "lcl_ip_$i"; + $tmp = dechex(${$tmp}); + $tmp = omc_keep_length($tmp,'0','2'); + if($DEBUG) echo "lcl_ip_$i = $tmp
      "; + $local_ip .= $tmp; + } + if($DEBUG) + { + echo "SMPP:
      "; + echo "link_type=$link_type
      "; + echo "connect_type=$connect_type
      "; + echo "session_type=$session_type
      "; + echo "system_id=$system_id
      "; + echo "password=$password
      "; + echo "local_gtt=$local_gtt
      "; + echo "remote_gtt=$remote_gtt
      "; + echo "local_ip=$local_ip
      "; + echo "remote_ip=$remote_ip
      "; + echo "session_timer=$session_timer
      "; + echo "enquire_timer=$enquire_timer
      "; + echo "inact_timer=$inact_timer
      "; + echo "response_timer=$response_timer
      "; + echo "opposite_num=$opposite_num
      "; + } + $link_type = omc_keep_length($link_type,'0','2'); + $connect_type = omc_keep_length($connect_type,'0','2'); + $session_type = omc_keep_length($session_type,'0','2'); + $system_id = omc_keep_length(toHex($system_id),'0','32','0'); + $password = omc_keep_length(toHex($password),'0','18','0'); + $local_gtt = omc_keep_length(toHex($local_gtt),'0','32','0'); + $remote_gtt= omc_keep_length(toHex($remote_gtt),'0','32','0'); + $local_ip = omc_keep_length($local_ip,'F','8','0'); + $remote_ip = omc_keep_length($remote_ip,'F','8','0'); + $session_timer= omc_keep_length(dechex($session_timer),'0','8'); + $enquire_timer= omc_keep_length(dechex($enquire_timer),'0','8'); + $inact_timer = omc_keep_length(dechex($inact_timer),'0','8'); + $response_timer = omc_keep_length(dechex($response_timer),'0','8'); + $opposite_num = omc_keep_length(toHex($opposite_num),'0','16','0'); + + $initValue_0 = $smpp_init; + $initValue_0 = setBitValue($initValue_0,$smpp_array[0][1],$link_type); + $initValue_0 = setBitValue($initValue_0,$smpp_array[1][1],$connect_type); + $initValue_0 = setBitValue($initValue_0,$smpp_array[2][1],$session_type); + $initValue_0 = setBitValue($initValue_0,$smpp_array[3][1],$system_id); + $initValue_0 = setBitValue($initValue_0,$smpp_array[4][1],$password); + $initValue_0 = setBitValue($initValue_0,$smpp_array[5][1],$local_gtt); + $initValue_0 = setBitValue($initValue_0,$smpp_array[6][1],$remote_gtt); + $initValue_0 = setBitValue($initValue_0,$smpp_array[7][1],$local_ip); + $initValue_0 = setBitValue($initValue_0,$smpp_array[8][1],$remote_ip); + $initValue_0 = setBitValue($initValue_0,$smpp_array[9][1],$session_timer); + $initValue_0 = setBitValue($initValue_0,$smpp_array[10][1],$enquire_timer); + $initValue_0 = setBitValue($initValue_0,$smpp_array[11][1],$inact_timer); + $initValue_0 = setBitValue($initValue_0,$smpp_array[12][1],$response_timer); + $initValue_0 = setBitValue($initValue_0,$smpp_array[13][1],$opposite_num); + $initValue_0 = setBitValue($initValue_0,$smpp_array[14][1],'01'); + if($DEBUG) echo "initValue_0 = $initValue_0
      "; + $levelArr=explode('.',$smpp_oid); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $setsql = "update $smpp_sqltable set initValue = '$initValue_0' + where level_1 = '$level_1' and level_2 = '$level_2' and level_3 = '$level_3' and instanceNo = '$instanceNo'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + if($DEBUG) + { + echo "SMSC:
      "; + echo "smsc_session_type=$session_type
      "; + echo "smsc_opposite_num=$opposite_num
      "; + echo "smsc_dcs=$smsc_dcs
      "; + } + + $smsc_dcs= omc_keep_length($smsc_dcs,'0','2'); + $initValue_1 = $smsc_init; + $initValue_1 = setBitValue($initValue_1,$smsc_array[0][1],'01'); + $initValue_1 = setBitValue($initValue_1,$smsc_array[1][1],$session_type); + $initValue_1 = setBitValue($initValue_1,$smsc_array[2][1],$opposite_num); + $initValue_1 = setBitValue($initValue_1,$smsc_array[3][1],'01'); + $initValue_1 = setBitValue($initValue_1,$smsc_array[4][1],$smsc_dcs); + if($DEBUG) echo "initValue_1 = $initValue_1
      "; + $levelArr=explode('.',$smsc_oid); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $setsql = "update $smsc_sqltable set initValue = '$initValue_1' + where level_1 = '$level_1' and level_2 = '$level_2' and level_3 = '$level_3' and instanceNo = '$smsc_ins'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + if(!$DEBUG) + { + echo ""; + } + +} + +if($DEBUG) echo "instanceNo=$instanceNo
      "; +if($DEBUG) echo "back_page=$back_page
      "; + +if($instanceNo == 'New') +{ + $levelArr=explode('.',$smpp_oid); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $setsql = "select initValue from $smpp_sqltable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' "; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + + $smpp_ins = 0; + while($smpp_row = mysqli_fetch_array($result)) + { + $enable_flag = getBitValue($smpp_row[0],$smpp_array[14][1]); + if ($DEBUG) echo "smpp_flag = $enable_flag
      "; + if($enable_flag == 0) + break; + $smpp_ins++; + } + if($DEBUG) echo "smpp_ins = $smpp_ins
      "; + $levelArr=explode('.',$smsc_oid); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $setsql = "select initValue from $smsc_sqltable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' "; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + + $smsc_ins = 0; + while($smsc_row = mysqli_fetch_array($result)) + { + $enable_flag = getBitValue($smsc_row[0],$smsc_array[0][1]); + if ($DEBUG)echo "smsc_flag = $enable_flag
      "; + if($enable_flag == 0) + break; + $smsc_ins++; + } + if($DEBUG) echo "smsc_ins = $smsc_ins
      "; + + //clear old value + $initValue = omc_keep_length($initValue,'0','24'); + $setsql = "update $smsc_sqltable set initValue = '$initValue' + where level_1 = '2' and level_2 = '2' and level_3 = '0' and instanceNo = '$smsc_ins' "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + $initValue = omc_keep_length($initValue,'0','212'); + $setsql = "update $smpp_sqltable set initValue = '$initValue' + where level_1 = '2' and level_2 = '1' and level_3 = '0' and instanceNo = '$smpp_ins' "; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + if($DEBUG) echo "dcs=$smsc_dcs
      "; +} +else +{ + $smpp_ins = $instanceNo; +} + +//========================================================== +//取数据库数据 +//========================================================== +$levelArr=explode('.',$smpp_oid); +for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; +} + +$setsql = "select initValue from $smpp_sqltable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' AND instanceNo='$smpp_ins'"; +$result = mysqli_query($pubConn,$setsql); +$smpp_row = mysqli_fetch_array($result); +echo mysqli_error($pubConn); +if($DEBUG) echo "
      $setsql
      "; + +$link_type = getBitValue($smpp_row[0],$smpp_array[0][1]); +$connect_type = getBitValue($smpp_row[0],$smpp_array[1][1]); +$session_type = getBitValue($smpp_row[0],$smpp_array[2][1]); +$system_id = toAscii(getBitValue($smpp_row[0],$smpp_array[3][1])); +$password = toAscii(getBitValue($smpp_row[0],$smpp_array[4][1])); +$local_gtt = toAscii(getBitValue($smpp_row[0],$smpp_array[5][1])); +$remote_gtt = toAscii(getBitValue($smpp_row[0],$smpp_array[6][1])); +$local_ip = getBitValue($smpp_row[0],$smpp_array[7][1]); +$remote_ip = getBitValue($smpp_row[0],$smpp_array[8][1]); +$session_timer = hexdec(getBitValue($smpp_row[0],$smpp_array[9][1])); +$enquire_timer = hexdec(getBitValue($smpp_row[0],$smpp_array[10][1])); +$inact_timer = hexdec(getBitValue($smpp_row[0],$smpp_array[11][1])); +$response_timer = hexdec(getBitValue($smpp_row[0],$smpp_array[12][1])); +$opposite_num = toAscii(getBitValue($smpp_row[0],$smpp_array[13][1])); + +if($instanceNo != 'New') +{ + $levelArr=explode('.',$smsc_oid); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + $setsql = "select initValue from $smsc_sqltable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' "; + $result = mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + + $smsc_ins = 0; + while($smsc_row = mysqli_fetch_array($result)) + { + $smsc_session_type = getBitValue($smsc_row[0],$smsc_array[1][1]); + $smsc_opposite_num = toAscii(getBitValue($smsc_row[0],$smsc_array[2][1])); + if($smsc_session_type == $session_type && $smsc_opposite_num == $opposite_num) + { + $smsc_dcs = getBitValue($smsc_row[0],$smsc_array[4][1]); + break; + } + $smsc_ins++; + } +} +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; + +if ($DEBUG)echo "---$smpp_ins---$smsc_ins---
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> + +"; +echo ""; +echo ""; +echo "Configuration > Network > Element > SMSC"; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "SMPP link:  "; +echo ""; +echo ""; +echo "$strBack"; +echo "
      "; +?> + +"; +echo ""; +echo ""; +echo ""; +//========================================================== +//输出Link type +//========================================================== +if($DEBUG) echo "chang_link_type = $change_link_type"; +if (isset($change_link_type)) + $link_type = $change_link_type; +if($DEBUG) echo "link_type = $link_type
      "; +echo "" ; +echo ""; +echo ""; + +//========================================================== +//输出Connection type +//========================================================== +echo "" ; +echo ""; +echo ""; + +//========================================================== +//输出Session type +//========================================================== +echo "" ; +echo ""; +echo ""; + +//========================================================== +//输出System ID +//========================================================== +echo ""; +echo ""; +echo ""; +echo ""; +//========================================================== +//输出Password +//========================================================== +echo ""; +echo ""; +echo ""; +echo ""; +//========================================================== +//输出GT +//========================================================== +if($link_type == 0) +{ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} +//========================================================== +//输出IP +//========================================================== +else +{ + $rmt_ip[0] = hexdec(getBitValue($remote_ip,'0.0-0.7')); + $rmt_ip[1] = hexdec(getBitValue($remote_ip,'1.0-1.7')); + $rmt_ip[2] = hexdec(getBitValue($remote_ip,'2.0-2.7')); + $rmt_ip[3] = hexdec(getBitValue($remote_ip,'3.0-3.7')); + + $lcl_ip[0] = hexdec(getBitValue($local_ip,'0.0-0.7')); + $lcl_ip[1] = hexdec(getBitValue($local_ip,'1.0-1.7')); + $lcl_ip[2] = hexdec(getBitValue($local_ip,'2.0-2.7')); + $lcl_ip[3] = hexdec(getBitValue($local_ip,'3.0-3.7')); + + echo ""; + echo ""; + echo ""; + echo ""; +} +//========================================================== +//输出Opposite service number +//========================================================== +echo ""; +echo ""; +echo ""; +echo ""; +//========================================================== +//输出DCS +//========================================================== +echo "
      "; +echo "" ; +echo ""; +echo ""; +//========================================================== +//输出Session timer +//========================================================== +echo ""; +echo ""; +echo ""; +echo ""; +//========================================================== +//输出Enquire link timer +//========================================================== +echo ""; +echo ""; +echo ""; +echo ""; +//========================================================== +//输出Inactivity timer +//========================================================== +echo ""; +echo ""; +echo ""; +echo ""; +//========================================================== +//输出Response timer +//========================================================== +echo ""; +echo ""; +echo ""; +echo ""; + + + +echo "
      ParametersValue
      Link type
      Connection type
      Session type
      System ID
      Password
      Opposite GT
      Local GT
      Opposite IP"; + for($i=0; $i<4; $i++) + { + echo ""; + if($i != 3) + echo "."; + + } + echo "
      Local IP"; + for($i=0; $i<4; $i++) + { + echo ""; + if($i != 3) + echo "."; + + } + echo "
      Opposite service number
      Data coding scheme
      Session timer
      Enquire link timer
      Inactivity timer
      Response timer
      "; + +echo "
      "; + +?> diff --git a/wxc2_omc/element/mss/smsc.php b/wxc2_omc/element/mss/smsc.php new file mode 100755 index 0000000..40bb2e1 --- /dev/null +++ b/wxc2_omc/element/mss/smsc.php @@ -0,0 +1,1294 @@ +正在调试中!!"; +?> + + + +\n"; + echo "alert('$msg')"; + echo ""; +} +$scroll_y = isset($scroll_y) ? $scroll_y : 0; + +echo ""; + +$backurl = './smsc.php'; +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +$nGetComm = 0; +$nSetComm = 3; + +$maxNum = 60; + +$sysId = '350_99_99'; +$oidarr = array('2.1.1','2.1.3','2.2.0'); + +$smpp_id = '260_99_99'; +$smpp_oid = "2.1.0"; + +$sccp_id = '223_99_99'; +$sccp_oid = array('2.1.11','2.1.20'); + +$sqltable = 'OBJ_350.param_99'; +$mtp3_sqlTable = 'OBJ_222.param_99'; +$sqltable_conf = 'OBJ_350.paramConf'; +$sqltable_smpp = 'OBJ_260.param_99'; +$sqltable_sccp = 'OBJ_223.param_99'; +$sqltable_pub = 'OMC_PUB.sysStat'; +$sqlConf_pub = 'OMC_PUB.sysConf'; +$pubDb = 'OMC_PUB'; +$sqltable_spc = 'OBJ_222.param_99'; +$sysinfo = 'OMC_PUB.sysInfo'; +$sysTypeNo = '322'; + +$net_paramTable ='OBJ_225.param_99';//xapp +$net_paramConf ='OBJ_225.paramConf'; + + +$sysId_arr=array( + array('oid'=>'2.2', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1', 'sysid'=> '350_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=> '350_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3', 'sysid'=> '350_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5', 'sysid'=> '350_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.9.0', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.11', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.20', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), +); + +$size=sizeof($sysId_arr); +$selSql = "select sysNo,subSysNo from OMC_PUB.sysStat where sysTypeNo='350'"; +$result = mysqli_query($pubConn,$selSql); +$no=0; +while($rows = mysqli_fetch_array($result)) +{ + $smscSysNo[$no] = $rows[sysNo]; + $smscTable[$no] = "OBJ_350.param_".$rows[sysNo]; + $tmpsysId = '350_'.$rows[sysNo].'_0'; + $sysId_arr[$size++] = array('oid'=>'2.1.6', 'sysid'=> $tmpsysId,'selectsysid'=>'-1'); + $no++; +} + +$SaveArr=array( + array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=>'350_99_99'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99'), +); +$getsql = "SELECT sysNo FROM $sysinfo where sysTypeNo = 322"; +if($DEBUG) echo "getsql = $getsql
      "; +$Result = @mysqli_query($pubConn,$getsql); +while($Rows = mysqli_fetch_array($Result)) +{ + $xappSysId = "225_9"."_".$Rows[sysNo]; + $SaveArr[] = array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=> '225_99_99','selectsysid' => $xappSysId); +} + +$url_add = './smsc.php'; +$localNodeConfArr=array( + array('NetID', '00.0-00.7'), + array('MSISDN', '01.0-10.7'), + array('IP0', '11.0-14.7'), + array('IP1', '15.0-18.7') +); + + +//loading +if($load_flag == 1) +{ + echo "
      Loading"; + + GetParam($sysId_arr,1);//1 means return to overview if getting parameters fails. + + echo ""; +} +{//get upd and tcp default value + $wSc = " AND level_1 = 2 AND (level_2 = 2 OR level_2 = 3)"; + + $defSql = " SELECT level_1,level_2,level_3,initValue FROM $sqltable_conf WHERE keyId > 0 ".$wSc." ORDER BY level_2,level_3 "; + if($DEBUG)echo "
      defSql=$defSql"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + + do + { + $level_1 = $defRow[level_1]; + $level_2 = $defRow[level_2]; + $level_3 = $defRow[level_3]; + $defaultValue[$level_2][$level_3] = $defRow[initValue]; + if($DEBUG) echo "
      defaultValue[$level_2][$level_3]={$defaultValue[$level_2][$level_3]}"; + + }while($defRow = @mysqli_fetch_array($defRes)); +}//end get default value + +$getsql = "select initValue from $net_paramConf where level_1 = '2' and level_2 = '9'"; +$result = @mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); +$cli_conv_def = mysqli_fetch_array($result); +$cli_conv_def = $cli_conv_def[0]; + +if(isset($doingOtherFlag)) +{ + {//set system ip + for($i=0; $i < 2; $i++) + { + $getsql = "SELECT ip FROM $sysinfo where sysTypeNo = $sysTypeNo and sysNo = '$i'"; + if($DEBUG) echo "getsql = $getsql
      "; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = strtoupper(omc_keep_length($mss_ip[0],'0','8')); + $mss_ip[1] = strtoupper(omc_keep_length($mss_ip[1],'0','8')); + if($DEBUG) + { + echo "
      mss0_ip = $mss_ip[0]
      "; + echo "mss1_ip = $mss_ip[1]
      "; + } + + $sysId = "223_99_99"; + if($setMapGtt==1)//MAP + { + $oidStr = "2.1.11"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + if($setSmppGtt==1)//smpp + { + $oidStr = "2.1.20"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); + } + }//end set system ip + exit; +} + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + + for($i=0; $i<2; $i++) + { + $updTable = 'OBJ_350.param_' . $i; + $updSql = "update $updTable set initValue = '{$mss_ip[$i]}' + where level_1='2' and level_2='1' and level_3='6' "; + mysqli_query($pubConn,$updSql); + } + + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { +// echo "
      Getting parameters
      "; +// GetParam(0,1); + + echo "
      Setting parameters
      "; + SetParam($sysId_arr); + session_register("mcSetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + echo ""; + //exit(); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } + echo ""; + //exit(); +} + +if (isset($delflag)) +{ + $delNoStr = rtrim($delNoStr,'.'); + $delNoArr = explode('.',$delNoStr); + $instNoWhereStr = ''; + for($i=0; $i< sizeof($delNoArr); $i++) + { + if($i==0) + $instNoWhereStr = "(instanceNo='$delNoArr[$i]'"; + else + $instNoWhereStr .= " or instanceNo='$delNoArr[$i]'" ; + } + $instNoWhereStr .= ')'; + + if($delflag == 'msisdn') + { + $getsql = "select initValue from $sqltable_conf + where level_1 = '2' and level_2 = '1' and level_3 = '4'"; + $msisdn_result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $msisdn_org = mysqli_fetch_array($msisdn_result); + $msisdn_org = $msisdn_org[0]; + + $setsql = "update $sqltable set initValue = '$msisdn_org' + where level_1 = '2' and level_2 = '1' and level_3 = '4' and $instNoWhereStr "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if(0) echo "
      $setsql
      "; + } + if($delflag == 'udp'||$delflag=='tcp') + { + if($delflag=='udp') + $tmp_level_2 = 2; + else + $tmp_level_2 = 3; + $setsql = "SELECT level_3 FROM $sqltable + WHERE subSysNo = '99' AND level_1 = 2 AND level_2 = $tmp_level_2 + ORDER BY level_3 "; + $Result = mysqli_query($pubConn,$setsql); + while($rows = mysqli_fetch_array($Result)) + { + $level_3 = $rows[0]; + $updSql = "update $sqltable set initValue = '{$defaultValue[$tmp_level_2][$level_3]}' + where level_1='2' and level_2='$tmp_level_2' and level_3='$level_3' and $instNoWhereStr"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + } + if ($delflag == 'cli') //CLI prefix + { + $delNoStr = rtrim($delNoStr,'.'); + $delNoArr = explode('.',$delNoStr); + $instNoWhereStr = ''; + for($i=0; $i< sizeof($delNoArr); $i++) + { + if($i==0) + $instNoWhereStr = "(instanceNo='$delNoArr[$i]'"; + else + $instNoWhereStr .= " or instanceNo='$delNoArr[$i]'" ; + } + $instNoWhereStr .= ')'; + $objWhereStr = getLevelWhere('2.9.0'); + + $setsql = "update $net_paramTable set initValue = '$cli_conv_def' + where $objWhereStr and $instNoWhereStr"; + if($DEBUG) echo "
      setsql:$setsql
      "; + //exit; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + } +} + +if(1==$E1lock || 1==$E1unlock) +{ + if($flag == 'udp') + $level2 = 2; + else + $level2 = 3; + $getsql = "select initValue from $sqltable + where level_1 = '2' and level_2 = '$level2' and level_3 = '14'"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $Row = mysqli_fetch_array($result); + $setValue = $Row[initValue]; + if(1==$E1lock) + $bitValue=0; + if(1==$E1unlock) + $bitValue=1; + $offset = '00.1-00.1'; + + $setValue = setBitValue($setValue,$offset,$bitValue); + + $setsql = "update $sqltable set initValue = '$setValue' + where level_1 = '2' and level_2 = '$level2' and level_3 = '14' and instanceNo='$delValue'"; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + $oidstr = "2.$level2.14"; + $commIdStr =oidSysCommSend($sysId,$nSetComm,$oidstr); + if($commIdStr=='-1') + { + DelComm($commArr); + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo "

      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > SMSC"; +echo ""; +$helpId = '2.1.1.5'; +showHelp($helpId); +echo "
      "; +echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +?> + +indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } + + for($i = 0; $i < 4; $i ++) + { + $levelWhere = getLevelWhere($spcTree_array[$spc_index[$i]][3]); + + $getsql = "select initValue from $mtp3_sqlTable where $levelWhere"; + $result = mysqli_query($pubConn,$getsql); + $row[$i] = mysqli_fetch_array($result); + $row[$i] = hexdec($row[$i][0]); + if($DEBUG)echo "getsql = $getsql
      "; + if($DEBUG)echo "spc_$i=$row[$i]
      "; + } +} + +echo "" ; +echo ""; +echo ""; +echo ""; + + +//========================================================== +//输出Global Title +//========================================================== +$sysId = "223_99_99"; +$oidStr = "2.1.11"; +$instanceNo=0; +echo ""; +echo ""; +echo ""; + +echo "" ; +$oidStr = "2.1.20"; +echo ""; +echo ""; + +{//输出SMS validity + $getsql = "select initValue from $sqltable + where level_1 = '2' and level_2 = '1' and level_3 = '3'"; + $count_result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $count_result = @mysqli_fetch_array($count_result); + $sms_time = hexdec(getBitValue($count_result[0],'00.0-03.7')); + $sms_time = $sms_time / 3600; + echo "" ; + echo ""; + $sysId = "350_99_99"; + $oidStr = "2.1.3"; + echo ""; + echo ""; +}//end SMS validity + +{//输出CDR + echo "" ; + echo ""; + $sysId = "350_99_99"; + $oidStr = "2.1.1"; + echo ""; + echo ""; + +}//end cdr + +{//输出log + echo "" ; + echo ""; + + $oidStr = "2.1.10"; + echo ""; + echo ""; + + echo ""; +}//end log + + +{//输出MSISDN range +$getsql = "select initValue from $sqltable_conf +where level_1 = '2' and level_2 = '1' and level_3 = '4'"; +$msisdn_result = mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); +$msisdn_org = mysqli_fetch_array($msisdn_result); +$msisdn_org = $msisdn_org[0]; + +echo ""; + +$getsql = "select initValue from $sqltable +where level_1 = '2' and level_2 = '1' and level_3 = '4'"; +$msisdn_result = mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); + +$n = 0; +$i = 0; +//if($DEBUG) echo "msisdn_org = $msisdn_org
      "; +while($msisdn_row = mysqli_fetch_array($msisdn_result)) +{ + //if($DEBUG) echo "msisdn_row = $msisdn_row[0]
      "; + $msisdn_row = $msisdn_row[0]; + //$ms_ins[$i] + + if($msisdn_row != $msisdn_org) + { + $ms_row[$n] = $msisdn_row; + if($DEBUG) echo "msisdn_row = $msisdn_row
      "; + $ms_start[$n] = getBitValue($msisdn_row,'0.0-8.7'); + if($DEBUG) echo "ms_start = $ms_start[$n]
      "; + $ms_start[$n] = str_replace('E','',$ms_start[$n]); + if($ms_start[$n] == '') + $ms_start[$n] = 0; + $ms_end[$n] = getBitValue($msisdn_row,'9.0-17.7'); + if($DEBUG) echo "ms_end = $ms_end[$n]
      "; + $ms_end[$n] = str_replace('E','',$ms_end[$n]); + if($ms_end[$n] == '') + $ms_end[$n] = 0; + $ms_ins[$n] = $i; + $n++; + } + else if(!isset($unused_no)) + { + $unused_no = $i; + } + $i++; +} + +if(!isset($unused_no)) + $unused_no = -1; +$nrow = $n + 1; +echo "" ; + echo ""; + + if($n == 0) + { + echo ""; + } + else + { + $flag = 'msisdn'; + echo ""; + } +}//end msisdn range + +{//show udp and tcp smpp + {//get upd and tcp status from heartbeat + $linkStatArray = array('Unavailable','Available'); + $selSql = "select detailStat from sysStat where sysTypeNo='350' "; + $result = mysqli_query($pubConn,$selSql); + $Rows = mysqli_fetch_array($result); + if($DEBUG) echo $Rows[0]; + $updStart = 47; + $hexStr = substr($Rows[0],$updStart*2,2); + $binStr = omc_keep_length(decbin(hexdec($hexStr)),'0',8); + for($i=strlen($binStr)-1; $i>=0; $i--) + { + $udpLinkStat[$i] = $linkStatArray[substr($binStr,7-$i,1)]; + //echo "
      udpLinkStat[$i]: ".$udpLinkStat[$i]; + } + $tcpStart = 48; + for($i=0; $i< 4; $i++) + { + $hexStr = substr($Rows[0],($tcpStart+$i)*2,2); + $binStr = omc_keep_length(decbin(hexdec($hexStr)),'0',8); + //echo "
      $binStr"; + for($j=7; $j>=0; $j--) + { + $no = $i*8+$j; + $tcpLinkStat[$no] = $linkStatArray[substr($binStr,7-$j,1)]; + } + } + }//end get status + {//get udp and tcp value + /************select value to see************/ + $scSql = " SELECT level_1,level_2,level_3,instanceNo,initValue,readValue FROM $sqltable WHERE subSysNo = '99' ".$wSc." ORDER BY level_3 "; + if($DEBUG) echo "
      scSql=$scSql"; + $scRes = @mysqli_query($pubConn,$scSql); + $scRow = @mysqli_fetch_array($scRes); + echo mysqli_error($pubConn); + do + { + $level_1 = $scRow[level_1]; + $level_2 = $scRow[level_2]; + $level_3 = $scRow[level_3]; + $instanceNo = $scRow[instanceNo]; + +// if($level_3 > 1){//if no.1=="--",then all="--" +// if($showValue[$level_2][$instanceNo][1] == '--') +// { +// $showValue[$level_2][$instanceNo][$level_3] = "--"; +// continue; +// } +// } + + if($scRow[initValue] == $defaultValue[$level_2][$level_3] && (($level_2 == 2 && $level_3 < 7) OR ($level_2 == 3 && $level_3 < 8)) ){ + $showValue[$level_2][$instanceNo][$level_3] = "--"; + continue; + } + + if($level_3 > 0 && $level_3 < 4){//name,sysid,password + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = substr($scRow[initValue],$i*2,2); + if($temValue[$i] == '00'){ + break; + }else{ + $temValue[$i] = Chr(HexDec($temValue[$i])); + } + } + $aNum = $i; + $tValue = ''; + for($i=0;$i<$aNum;$i++){ + $tValue = $tValue.$temValue[$i]; + } + if($DEBUG)echo "
      tValue=$tValue"; + $showValue[$level_2][$instanceNo][$level_3] = $tValue; + }elseif($level_3 == 4){ + $p4 = explode("E",$scRow[initValue]); + $showValue[$level_2][$instanceNo][$level_3] = $p4[0]; + }elseif($level_3 == 6){ + if($level_2 == 2){ + $p6 = explode("E",$scRow[initValue]); + $showValue[$level_2][$instanceNo][$level_3] = $p6[0]; + }elseif($level_2 == 3){ + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = HexDec(substr($scRow[initValue],$i*2,2)); + } + $showValue[$level_2][$instanceNo][$level_3] = $temValue[0].".".$temValue[1].".".$temValue[2].".".$temValue[3]; + } + }elseif($level_3 == 7){ + if($level_2 == 2){ + $showValue[$level_2][$instanceNo][$level_3] = HexDec($scRow[initValue]); + }else{ + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = HexDec(substr($scRow[initValue],$i*2,2)); + } + $showValue[$level_2][$instanceNo][$level_3] = $temValue[0].".".$temValue[1].".".$temValue[2].".".$temValue[3]; + } + }elseif($level_3 == 12){ + if($scRow[initValue]==0||HexDec($scRow[initValue])==16) + $showValue[$level_2][$instanceNo][$level_3]='7bit'; + else + $showValue[$level_2][$instanceNo][$level_3]='8bit'; + }else{ + $showValue[$level_2][$instanceNo][$level_3] = HexDec($scRow[initValue]); + } + if($DEBUG) echo "
      showValue[$level_2][$instanceNo][$level_3]={$showValue[$level_2][$instanceNo][$level_3]}"; + }while($scRow = @mysqli_fetch_array($scRes)); + }//end get value + {//$showUdpmArr + $showUdpmArr = array( + "", + "Name", + "System ID", + "Password", + "Service Number", + "Destination addr. type", + "GTT Number", + "Session timer", + "Enquire link timer", + "Inactivity timer", + "Response timer", + "", + "DCS", + "Time to live", + ); + } + + {//find not used instanceNo + for($i=2;$i< 8;$i++)//find from instanceNo=2; instanceNo 0,1:reserved for pps Global title(EMSE), 0:Inquiry number, 1:Recharge via recharge card + { + $enable = getBitValue($showValue[2][$i][14],'0.0-0.0'); + if($enable==0) + { + $newInstNo=$i; + break; + } + } + if(!isset($newInstNo)) + $newInstNo=-1; + } + + + + $flag = 'udp'; + $showNum=0; + for($i=0;$i< 8;$i++) + { + $enable = getBitValue($showValue[2][$i][14],'0.0-0.0'); + if($enable==1) + $showNum++; + } + echo "" ; + echo ""; + + + if($showNum==0) + { + echo ""; + } + else + { + echo ""; + } + + //show tcp smpp + $showTcpmArr = array( + "", + "Name", + "System ID", + "Password", + "Service Number", + "Destination addr. type", + "Service IP", + "Local IP address", + "Session timer", + "Enquire link timer", + "Inactivity timer", + "Response timer", + "DCS", + "Time to live", + ); + {//find not used instanceNo + for($i=0;$i< 32;$i++) + { + $enable = getBitValue($showValue[3][$i][14],'0.0-0.0'); + if($enable==0) + { + $newInstNo=$i; + break; + } + } + if(!isset($newInstNo)) + $newInstNo=-1; + } + + + $flag = 'tcp'; + $showNum=0; + for($i=0;$i< 32;$i++) + { + $enable = getBitValue($showValue[3][$i][14],'0.0-0.0'); + if($enable==1) + $showNum++; + } + echo "" ; + echo ""; + + + if($showNum==0) + { + echo ""; + } + else + { + echo ""; + } +}//end show udp and tcp smpp + + +{//输出CLI conversion prefix +//show text define + +$cli_conv_showText_define = array('','IDD','NDD','Unknown'); + +$getsql = "select instanceNo,initValue from $net_paramTable where level_1 = '2' and level_2 = '9' + and initValue != '$cli_conv_def'"; +$result = @mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); + +$cli_conv_num = 0; +while($cli_conv_row = @mysqli_fetch_array($result)) +{ + $cli_prefix[$cli_conv_num][instanceNo] = $cli_conv_row[instanceNo]; + $cli_prefix[$cli_conv_num][in_property] = hexdec(getBitValue($cli_conv_row[initValue],'00.0-00.7')); + $cli_prefix[$cli_conv_num][Prefix] = trim(toAscii(getBitValue($cli_conv_row[initValue],'01.0-16.7'))); + $cli_prefix[$cli_conv_num][delete_length] = hexdec(getBitValue($cli_conv_row[initValue],'17.0-17.7')); + $cli_prefix[$cli_conv_num][out_property] = hexdec(getBitValue($cli_conv_row[initValue],'18.0-18.7')); + $cli_prefix[$cli_conv_num][add_length] = hexdec(getBitValue($cli_conv_row[initValue],'19.0-19.7')); + $cli_prefix[$cli_conv_num][add_digits] = toAscii(getBitValue($cli_conv_row[initValue],'20.0-35.7')); + $cli_prefix[$cli_conv_num][valid_length] = hexdec(getBitValue($cli_conv_row[initValue],'36.0-36.7')); + $cli_conv_num++; +} + +if ($cli_conv_num != 0) +{ + for($i=0; $i < 256; $i++) + { + if($i != $cli_prefix[$i][instanceNo]) + { + $unused_cli_ins = $i; + break; + } + } +} +else + $unused_cli_ins = 0; +if($DEBUG) echo "cli_conv_num = $cli_conv_num
      "; +$cli_conv_nrow = $cli_conv_num+1; +if($cli_conv_num>10) + $cli_conv_nrow = $cli_conv_num+2; + +$objIdStr='no-2.9'; +$sysId_xapp = '225_99_99'; +$webname="MSC"; +$setname="CLI Manipulation"; + +echo "" ; + echo ""; +if($cli_conv_num == 0) echo ""; +else +{ + echo ""; +} +echo ""; + +}//end CLI conversion prefix +/* +{//license + echo "" ; + echo ""; + echo ""; + echo ""; +}//end license +*/ +echo "
      Signaling point code"; +for($i=0; $i<4; $i++) + echo ""; +echo "
      {$spcTree_array[$i][0]}: {$spcTree_array[$spc_index[$i]][1]} {$spcTree_array[$spc_index[$i+4]][1]} $row[$i]
      $strE164Number(MAP)"; + echo ""; + + echo ""; +echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setMapGtt=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      $strE164Number(SMPP)"; +echo ""; + + echo ""; +echo "
      "; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setSmppGtt=1"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      SMS validity "; + showParameter($sysId,$oidStr,1,1); + echo " Seconds
      CDR flag "; + showParameter($sysId,$oidStr,1,1); + echo "
      Log flag "; + $sysId = "350_99_99"; + showParameter($sysId,$oidStr,1,1); + echo "
      "; + echo ""; + echo ""; + echo ""; + //href=\"./ra_default.php?typeFlag=MSISDN&instanceNo=$unused_no&backurl=./smsc.php\" + echo ""; + echo ""; + echo "
      Subscriber segment +
      "; + echo "
       --"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + for($i=0; $i < $n; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + /*echo "";*/ + + echo ""; + echo ""; + } + //==more button==== + if($n>4) + { + echo ""; + echo ""; + } + echo "
      No.Start MSISDNEnd MSISDNDeleteDelete"; + echo ""; + echo "
       $ms_ins[$i]$ms_start[$i]$ms_end[$i]
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + //alert($showNum); + if($showNum>=8) + echo ""; + else + echo ""; + echo ""; + echo "
      SMPP link(UDP) +
      "; + echo "
       --"; + echo ""; + echo ""; + echo ""; + for($j=1;$j< 14;$j++) + { + if($j==1 || $j==4 || $j==6) + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + $showNum=0; + for($i=0;$i< 8;$i++) + { + $enable = getBitValue($showValue[2][$i][14],'0.0-0.0'); + if($enable==0) + continue; + $checkBoxName=$flag . 'checkBox_'.$showNum; + $deleteNo = $flag . 'deleteno_'.$showNum; + if($showNum>3) + echo ""; + else + echo ""; + + + $showNum++; + + //echo ""; + echo ""; + for($j=1;$j< 14;$j++) + { + if($j==1 || $j==4 || $j==6) + echo ""; + } + {//link status + if($udpLinkStat[$i]=='Available') + $color="#0000ff"; + else + $color = "#FF0000"; + $input_name = 'udplinkStat_' . $i; + //echo ""; + echo ""; + }//end link status + //echo ""; + + $udpflag =getBitValue($showValue[2][$i][14],'00.1-00.1'); + if($udpflag) + echo ""; + echo ""; + } + if($showNum>4) + { + echo ""; + echo ""; + } + echo "
      No.{$showUdpmArr[$j]}StatusAdmin StateDelete"; + echo ""; + echo "
      $i{$showValue[2][$i][$j]} {$udpLinkStat[$i]}--{$udpLinkStat[$i]}Unlocked"; + else + echo "Locked"; + + echo "
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + //alert($showNum); + if($showNum>=32) + echo ""; + else + echo ""; + echo ""; + echo "
      SMPP link(TCP) +
      "; + echo "
       --"; + echo ""; + echo ""; + echo ""; + for($j=1;$j< 14;$j++) + { + if($j==1 || $j==4 || $j==6) + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + $showNum=0; + for($i=0;$i< 32;$i++) + { + $enable = getBitValue($showValue[3][$i][14],'0.0-0.0'); + if($enable==0) + { + continue; + } + $checkBoxName=$flag . 'checkBox_'.$showNum; + $deleteNo = $flag . 'deleteno_'.$showNum; + if($showNum>3) + echo ""; + else + echo ""; + + + + $showNum++; + //echo ""; + echo ""; + for($j=1;$j< 14;$j++) + { + if($j==1 || $j==4 || $j==6) + echo ""; + } + {//link status + if($tcpLinkStat[$i]=='Available') + $color="#0000ff"; + else + $color = "#FF0000"; + $input_name = 'tcplinkStat_' . $i; + echo ""; + }//end link status + $tcpflag =getBitValue($showValue[3][$i][14],'00.1-00.1'); + if($tcpflag) + echo ""; + echo ""; + } + //====more button==== + if($showNum>4) + { + echo ""; + echo ""; + } + echo "
      No.{$showTcpmArr[$j]}StatusAdmin StateDelete"; + echo ""; + echo "
      $i{$showValue[3][$i][$j]} {$tcpLinkStat[$i]}Unlocked"; + else + echo "Locked"; + + echo "
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      CLI manipulation+
       --"; + echo ""; + $flag = 'cli'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + for($i=0; $i < $cli_conv_num; $i++) + { + $checkBoxName=$flag . 'checkBox_'.$i; + $deleteNo = $flag . 'deleteno_'.$i; + $cli_prefix[$i][Prefix] = ord($cli_prefix[$i][Prefix])==0 ? '--' : $cli_prefix[$i][Prefix]; + $cli_prefix[$i][add_digits] = ord($cli_prefix[$i][add_digits])==0 ? '--' : $cli_prefix[$i][add_digits]; +// $cli_prefix[$i][delete_length] = strlen($cli_prefix[$i][delete_length])==0 ? '--' : $cli_prefix[$i][delete_length]; +// $cli_prefix[$i][in_property] = strlen($cli_prefix[$i][in_property])==0 ? '--' : $cli_prefix[$i][in_property]; +// $cli_prefix[$i][out_property] = strlen($cli_prefix[$i][out_property])==0 ? '--' : $cli_prefix[$i][out_property]; +// $cli_prefix[$i][add_length] = strlen($cli_prefix[$i][add_length])==0 ? '--' : $cli_prefix[$i][add_length]; +// $cli_prefix[$i][valid_length] = strlen($cli_prefix[$i][valid_length])==0 ? '--' : $cli_prefix[$i][valid_length]; + if($i>3) + echo ""; + else + echo ""; + + + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + } + if($cli_conv_num>10) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + //==more button==== + if($cli_conv_num>4) + { + echo ""; + echo ""; + } + echo "
      No.InPrefixDel lenOutAdd lenAdd digitsValid lenDelete"; + echo "Delete"; + echo ""; + echo "
      $i{$cli_conv_showText_define[$cli_prefix[$i][in_property]]}{$cli_prefix[$i][Prefix]}{$cli_prefix[$i][delete_length]}{$cli_conv_showText_define[$cli_prefix[$i][out_property]]}{$cli_prefix[$i][add_length]}{$cli_prefix[$i][add_digits]}{$cli_prefix[$i][valid_length]}
      Delete"; + echo ""; + echo "
      More >>
      Hide >>
      License control "; + $sysId = '350_99_99'; + $oidStr = "2.5"; + showParameter($sysId,$oidStr,1,1,0,'','','Update'); + echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +echo "
      "; +?> + + diff --git a/wxc2_omc/element/mss/smscEdit.php b/wxc2_omc/element/mss/smscEdit.php new file mode 100755 index 0000000..f8c9904 --- /dev/null +++ b/wxc2_omc/element/mss/smscEdit.php @@ -0,0 +1,379 @@ + + +valueLen=$valueLen"; + for($j=0;$j<$valueLen;$j++){ + $temValue[$j] = substr($showValue[$i],$j,1); + $temValue[$j] = omc_keep_length(DecHex(Ord($temValue[$j])),0,2); + } + $aNum = $j; + $tValue = ''; + for($j=0;$j<$aNum;$j++){ + $tValue = $tValue.$temValue[$j]; + } + if($DEBUG)echo "
      tValue=$tValue"; + + if($i == 1) + $showValue[$i] = omc_keep_length($tValue,0,32,0); + elseif($i == 2) + $showValue[$i] = omc_keep_length($tValue,0,30,0); + elseif($i == 3) + $showValue[$i] = omc_keep_length($tValue,0,16,0); + } + + $showValue[4] = omc_keep_length($showValue[4],E,16,0);//Service number + + for($i=1;$i< $udtNum;$i++){ + if($oType==2&&$i==11) + continue; + + $udtSql = " UPDATE $tb_2 SET initValue = '$showValue[$i]' WHERE subSysNo = '99' AND level_2 = '$oType' AND level_3 = '$i' AND instanceNo = '$iNum' ".$wSc; + $udtRes = @mysqli_query($pubConn,$udtSql); + echo mysqli_error($pubConn); + } + echo ""; +} + +/************select value to see************/ +$scSql = " SELECT level_2,level_3,instanceNo,initValue,readValue FROM $tb_2 WHERE subSysNo = '99' AND level_2 = '$oType' AND instanceNo = '$iNum' ".$wSc." ORDER BY level_3 "; +if($DEBUG) echo "
      scSql=$scSql"; +$scRes = @mysqli_query($pubConn,$scSql); +$scRow = @mysqli_fetch_array($scRes); +echo mysqli_error($pubConn); +do +{ + $level_2 = $scRow[level_2]; + $level_3 = $scRow[level_3]; + if($DEBUG)echo "
      level_3=$level_3"; + $instanceNo = $scRow[instanceNo]; + //$showValue[$level_3] = $scRow[initValue]; + //if($DEBUG)echo "
      showValue[$level_3]={$showValue[$level_3]}"; + + if($level_3 > 0 && $level_3 < 4) + { + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++){ + $temValue[$i] = substr($scRow[initValue],$i*2,2); + if($temValue[$i] == '00'){ + break; + }else{ + $temValue[$i] = Chr(HexDec($temValue[$i])); + } + } + $aNum = $i; + $tValue = ''; + for($i=0;$i<$aNum;$i++){ + $tValue = $tValue.$temValue[$i]; + } + //echo "
      tValue=$tValue"; + $showValue[$level_3] = $tValue; + } + elseif($level_3 == 4) + { + $p4 = explode("E",$scRow[initValue]); + $showValue[$level_3] = $p4[0]; + } + elseif($level_3 == 6) + { + if($level_2 == 2) + { + $p6 = explode("E",$scRow[initValue]); + $showValue[$level_3] = $p6[0]; + } + elseif($level_2 == 3) + { + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++) + { + $temValue[$i] = HexDec(substr($scRow[initValue],$i*2,2)); + } + $showValue[$level_3] = $temValue[0].".".$temValue[1].".".$temValue[2].".".$temValue[3]; + } + } + elseif($level_3 == 7) + { + if($level_2 == 2) + { + $showValue[$level_3] = HexDec($scRow[initValue]); + } + else + { + $valueLen = floor(strLen($scRow[initValue])/2); + for($i=0;$i<$valueLen;$i++) + { + $temValue[$i] = HexDec(substr($scRow[initValue],$i*2,2)); + } + $showValue[$level_3] = $temValue[0].".".$temValue[1].".".$temValue[2].".".$temValue[3]; + } + } + elseif($level_3 == 14) + { + $showValue[$level_3] = $scRow[initValue]; + } + else + { + $showValue[$level_3] = HexDec($scRow[initValue]); + } + +}while($scRow = @mysqli_fetch_array($scRes)); + + + +echo "
      "; +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strConfiguration > Network > SMSC > {$pTypeArr[$oType]}"; + + echo ""; + //showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$pTypeArr[$oType] $iNum:    "; + echo ""; + echo ""; + echo "    "; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +?> + +"; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +if($oType == 2){ + echo ""; +// echo ""; +// echo ""; +// echo ""; +// echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $arr_DCS=array( + array('num' => '0', 'remark' => 'To smpp=7bit,default=7bit'), + array('num' => '1', 'remark' => 'To smpp=8bit,default=7bit'), + array('num' => '16', 'remark' => 'To smpp=7bit,default=8bit'), + array('num' => '17', 'remark' => 'To smpp=8bit,default=8bit') + ); + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} +elseif($oType == 3) +{ + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $arr_DCS=array( + array('num' => '0', 'remark' => 'To smpp=7bit,default=7bit'), + array('num' => '1', 'remark' => 'To smpp=8bit,default=7bit'), + array('num' => '16', 'remark' => 'To smpp=7bit,default=8bit'), + array('num' => '17', 'remark' => 'To smpp=8bit,default=8bit') + ); + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + +} +echo ""; + +echo "
      ParametersValue
      Name
      System ID
      Password
      Service number
      Destination addr. type
      GTT number
      Session timer
      Enquire link timer
      Inactivity timer
      Response timer
      DCS"; + echo ""; + echo "
      Time to live
      Service IP
      Local IP
      Session timer
      Enquire link timer
      Inactivity timer
      Response timer
      DCS"; + echo ""; + echo "
      Time to live
      "; +echo "
      "; +echo "  "; +echo ""; +echo ""; +echo ""; +echo "
      "; +?> + diff --git a/wxc2_omc/element/mss/spc_overview.php b/wxc2_omc/element/mss/spc_overview.php new file mode 100755 index 0000000..f0ec29f --- /dev/null +++ b/wxc2_omc/element/mss/spc_overview.php @@ -0,0 +1,280 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$db = "OBJ_222"; +$paramTable ='OBJ_222.param_99'; +$maxNum = 30; + +$sysId ='222_99_99'; +$instanceNo ='0'; +$initValue ='initValue'; +$readValue ='readValue'; + +$nGetComm = 0; +$nSetComm = 3; + +$nProcFail = 0;//failure +$nWaitProc = 1;//wait +$nInProc = 2; +$nOutProc = 3; + +$NetOPLenArr=array( + //array('oid','offset', 'name'), + array('2.2','0.0','International network'), + array('2.2','0.1','International network spare'), + array('2.2','0.2','National network'), + array('2.2','0.3','National network spare') +); + +$NetOPTypeArr=array( + //array('oid','offset', 'name'), + array('International network type','0.4'), + array('International network spare type','0.5'), + array('National network type','0.6'), + array('National network spare type','0.7') +);//roger + +$NetOPCArr=array( + //array('oid', 'name'), + array('2.3.1', '14bit international network'), + array('2.3.2', '14bit international network -s'), + array('2.3.3', '14bit national network'), + array('2.3.4', '14bit national network -s'), + array('2.3.5', '24bit international network'), + array('2.3.6', '24bit internation network -s'), + array('2.3.7', '24bit national network'), + array('2.3.8', '24bit national network -s') +); + +$RoutingArr=array( + array('2.6.1', 'International network'), + array('2.6.2', 'International network spare'), + array('2.6.3', 'National network'), + array('2.6.4', 'National network spare') +); + +$ACNArr=array( + array('2.7.1', 'Local ACN'), + array('2.7.2', 'International network'), + array('2.7.3', 'International network spare'), + array('2.7.4', 'National network'), + array('2.7.5', 'National network spare') +); + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      setInstanceNo=$setInstanceNo"; +if($DEBUG) echo "
      setObjIdStr =$setObjIdStr"; +//========================================================== +//数据处理 +//========================================================== +//处理get/set命令 + + +if($DEBUG) echo "
      =======NetID=========="; +$NetIDArr=array( + //array('name', 'len value','OPC'), + array('International Network', '', ''), + array('International Network Spare','', ''), + array('National Network', '', ''), + array('National Network Spare', '', '') +); +//roger.................................... +$NetTypeArr=array( + array('International Network', '', ''), + array('International Network Spare','', ''), + array('National Network', '', ''), + array('National Network Spare', '', '') +); +//roger.................................... +$objIdStr =$NetOPLenArr[0][0]; +$NetIDvalue=getSysParamValue($sysId,$objIdStr,$instanceNo,$initValue); +if($DEBUG) echo "
      NetIDvalue=$NetIDvalue"; +for($i=0;$i '0'){ + $NetIDArr[$i][1]='24bit'; + $objIdStr=$NetOPCArr[$i+4][0]; + $OPCvalue=getSysParamValue($sysId,$objIdStr,$instanceNo,$initValue); + $OPCvalue = hexdec($OPCvalue);//roger + $NetIDArr[$i][2]=$OPCvalue; + $m=$i+5; + }else{ + $NetIDArr[$i][1]='14bit'; + $objIdStr=$NetOPCArr[$i][0]; + $OPCvalue=getSysParamValue($sysId,$objIdStr,$instanceNo,$initValue); + $OPCvalue = hexdec($OPCvalue);//roger + $NetIDArr[$i][2]=$OPCvalue; + $m=$i+1; + }; + if($tmpValue_type > '0'){ + $NettypeArr[$i][1]='ANSI'; + }else{ + $NettypeArr[$i][1]='ITU'; + };//roger + $opcIdArr[$i]="2."."3.".$m; + if($DEBUG) echo "
      {$NetIDArr[$i][0]}:Len={$NetIDArr[$i][1]} ,OPC={$NetIDArr[$i][2]}"; +} + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> + + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      "; +echo "Configuration > Network > SPC overview"; +echo ""; +//showHelp($helpId); +echo ""; +echo "

      $strBack"; +echo "

      "; +echo "
      "; + +echo ""; +echo "
      "; + +//echo ""; + +echo ""; +echo "
      "; +echo ""; + +//echo "SPC overview:
      "; + +$tableHead=""; +for($i=0;$i"; + echo ""; + echo ""; + + $NetworkId="2.2.".$i; + echo ""; + echo "";//roger + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $levelArr=explode('.',$RoutingArr[$i][0]); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + } + + $defSql = "SELECT initValue from paramConf + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; + if($DEBUG) echo "defSql=$defSql
      "; + $defRes = mysqli_query($pubConn,$defSql); + $defRow = mysqli_fetch_array($defRes); + $defaultValue = $defRow[initValue]; + if($DEBUG) echo "defaultValue=$defaultValue
      "; + + $getSql="SELECT $initValue,instanceNo FROM $paramTable + WHERE level_1='$level_1' AND level_2='$level_2' AND level_3='$level_3' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows =mysqli_fetch_array($result)){ + if($DEBUG) echo "$rows[0], <1>"; + if($rows[0] == $defaultValue){ + continue; + } + $DPC=substr($rows[0],0,6); + $DPC = hexdec($DPC); + + $NormalLinkset=substr($rows[0],6,2); + $NormalLinkset=hexdec($NormalLinkset); + + if($NormalLinkset>127){ + $NormalLinkset="--"; + $NormalLinksetTitle='--'; + }else{ + $tmpSql="SELECT $initValue FROM $paramTable + WHERE level_1='2' AND level_2='4' AND level_3='1' AND instanceNo='$NormalLinkset' + "; + if($DEBUG) echo "
      tmpSql=$tmpSql"; + $tmpResult =mysqli_query($pubConn,$tmpSql); + echo mysqli_error($pubConn); + + $tmpRows =mysqli_fetch_array($tmpResult); + + $NormalLinksetTitle =toAscii(getBitValue($tmpRows[0],"7.0-16.7")); + } + + + $AlternativeLinkset=substr($rows[0],8,2); + $AlternativeLinkset=hexdec($AlternativeLinkset); + + if($AlternativeLinkset > 127){ + $AlternativeLinkset="--"; + $AlternativeLinksetTitle="--"; + }else{ + $tmpSql="SELECT $initValue FROM $paramTable + WHERE level_1='2' AND level_2='4' AND level_3='1' AND instanceNo='$AlternativeLinkset' + "; + if($DEBUG) echo "
      tmpSql=$tmpSql"; + $tmpResult =mysqli_query($pubConn,$tmpSql); + echo mysqli_error($pubConn); + + $tmpRows =mysqli_fetch_array($tmpResult); + + $AlternativeLinksetTitle =toAscii(getBitValue($tmpRows[0],"7.0-16.7")); + } + + $instanceNo=$rows[instanceNo]; + if(($RTobjIdStr == $setObjIdStr || $ACNobjIdStr== $setObjIdStr) && $instanceNo == $setInstanceNo){ + echo "
      "; + }else{ + echo ""; + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      {$NetIDArr[$i][0]}
      PC length:{$NetIDArr[$i][1]} | PC type:{$NettypeArr[$i][1]}
      OPC:{$NetIDArr[$i][2]}
      No.DPCNormal linksetAlternative linkset
      $instanceNo$DPCNo.$NormalLinkset($NormalLinksetTitle)No.$AlternativeLinkset($AlternativeLinksetTitle)

      "; +} + + +?> + + + diff --git a/wxc2_omc/element/mss/tg_overview.php b/wxc2_omc/element/mss/tg_overview.php new file mode 100755 index 0000000..adebdec --- /dev/null +++ b/wxc2_omc/element/mss/tg_overview.php @@ -0,0 +1,364 @@ + + + 0 "; +$defRes = @mysqli_query($pubConn,$defSql); +$defRow = @mysqli_fetch_array($defRes); +$defaultValue = $defRow[initValue]; +//echo "
      defaultValue=$defaultValue"; + + $tgFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $mptyFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + $tandemFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $incomingCallTypeArr=array( + array('num' => '0', 'remark' => 'Normal', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'In', 'color' => '#0000FF') + ); + + $cdrFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + + $voFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + +if($DEFAULT_SYS == 'MSC'){ + $tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IP', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Intercept', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'Interconnection', 'color' => '#0000FF'), + ); +}else{ + $tgTypeArr=array( + array('num' => '0', 'remark' => 'PSTN', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'HPLMN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'VPLMN', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'SUB', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'IP', 'color' => '#0000FF'), + //array('num' => '5', 'remark' => 'GP', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Intercept', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'Interconnection', 'color' => '#0000FF'), + ); +} + $atFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $lpFlagArr=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') + ); + + $netTypeArr=array( + array('num' => '0', 'remark' => 'INT', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'INT-S', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'NAT', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'NAT-S', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') + ); + + $cirTypeArr=array( + array('num' => '0', 'remark' => 'Clockwise', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Anti-C', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Odd', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'Even', 'color' => '#0000FF'), + array('num' => '4', 'remark' => '--', 'color' => '#0000FF') + ); + + $backFlagArr=array( + array('num' => '0', 'remark' => 'Off', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'On', 'color' => '#0000FF') + ); + +if($DEFAULT_SYS == 'MSC'){ + $tgLocationArr=array( + array('num' => '0', 'remark' => 'MSC-0', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSC-1', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Both', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'Spare', 'color' => '#0000FF') + ); +}else{ + $tgLocationArr=array( + array('num' => '0', 'remark' => 'MSC-0', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'MSC-1', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Both', 'color' => '#FF0000'), + array('num' => '3', 'remark' => 'Spare', 'color' => '#0000FF') + ); +} + + +/************select value to see************/ +//Attributes of TG +$tgSql = " SELECT instanceNo,initValue,readValue FROM $tb_2 + WHERE subSysNo = '99' and $wTg and initValue!='$defaultValue' ORDER BY instanceNo"; +if($DEBUG) +echo "
      tgSql=$tgSql"; +$tgRes = @mysqli_query($pubConn,$tgSql); +echo mysqli_error($pubConn); +$wDef = " AND ("; +$defaultValue_1 = "000000000A0382FF00"; +$tgNo=0; +while($tgRow = @mysqli_fetch_array($tgRes)) +{ + $tgArr[$tgNo][inst] = $tgRow[instanceNo]; + $initValue = $tgRow[initValue]; + $wDef = $wDef." instanceNo = $tgNo OR "; + + //echo "
      tgShow[$tgNo]=$tgShow[$tgNo]"; + + if($DEBUG)echo "
      initValue=$initValue"; + $dpc = $tgArr[$tgNo][2] = hexdec(substr($initValue,2,6)); + if($DEBUG)echo "
      dpc=$dpc"; + + $tgArr[$tgNo][hexDpc]=strtoupper(omc_keep_length(dechex($dpc),0,6)); + + $hex_4 = substr($initValue,8,2); + if($DEBUG)echo "
      hex_4=$hex_4"; + $bin_4 = omc_keep_length(DecBin(HexDec($hex_4)),0,8); + if($DEBUG)echo "
      bin_4=$bin_4"; + + $tgFlag = $tgArr[$tgNo][0] = substr($bin_4,7,1); + if($DEBUG)echo "
      tgFlag=$tgFlag"; + + $cdrFlag = $tgArr[$tgNo][3] = substr($bin_4,6,1); + if($DEBUG)echo "
      cdrFlag=$cdrFlag"; + + $voFlag = $tgArr[$tgNo][4] = substr($bin_4,5,1); + if($DEBUG)echo "
      voFlag=$voFlag"; + + $tgType = $tgArr[$tgNo][1] = BinDec(substr($bin_4,2,3)); + if($DEBUG)echo "
      tgType=$tgType"; + + $atFlag = $tgArr[$tgNo][5] = substr($bin_4,1,1); + if($DEBUG)echo "
      atFlag=$atFlag"; + + $lpFlag = $tgArr[$tgNo][7] = substr($bin_4,0,1); + + $netType = $tgArr[$tgNo][8] = HexDec(substr($initValue,10,2)); + if($DEBUG)echo "
      netType$netType"; + + $hex_6 = substr($initValue,12,2); + if($DEBUG)echo "
      hex_6=$hex_6"; + $bin_6 = omc_keep_length(DecBin(HexDec($hex_6)),0,8); + if($DEBUG)echo "
      bin_6=$bin_6"; + + $cirType = $tgArr[$tgNo][9] = BinDec(substr($bin_6,6,2)); + if($DEBUG)echo "
      cirType=$cirType"; + + $backFlag = $tgArr[$tgNo][10] = substr($bin_6,5,1); + if($DEBUG)echo "
      backFlag=$backFlag"; + + $tgLct = $tgArr[$tgNo][11] = BinDec(substr($bin_6,0,2)); + if($DEBUG)echo "
      tgLct=$tgLct"; + + $mptyFlag = $tgArr[$tgNo][12] = BinDec(substr($bin_6,2,1)); + if($DEBUG)echo "
      mptyFlag=$mptyFlag"; + + $tgNum = $tgArr[$tgNo][6] = HexDec(substr($initValue,14,2)); + if($DEBUG)echo "
      tgNum=$tgNum"; + + $tandemFlag = $tgArr[$tgNo][13] = HexDec(substr($initValue,16,2)); + if (1 < $tgArr[$tgNo][13]) { + $tgArr[$tgNo][13] = 1; + } + if($DEBUG) echo "
      tandemFlag={$tgArr[$tgNo][13]}"; + + $incomingCallType = $tgArr[$tgNo][14] = HexDec(substr($initValue,18,2)); + if (1 < $tgArr[$tgNo][14]) { + $tgArr[$tgNo][14] = 1; + } + if($DEBUG) echo "
      incomingCallType={$tgArr[$tgNo][14]}"; + + $tgNo++; +} + +if(0) +for($i=0; $i<$tgNo; $i++) +{ + echo "
      $i:
      "; + print_r($tgArr[$i]); +} + +$tmpSql="SELECT initValue FROM OBJ_225.param_99 + WHERE level_1='2' AND level_2='11' + "; +if($DEBUG) + echo "
      tmpSql=$tmpSql"; +$tmpResult =mysqli_query($pubConn,$tmpSql); +echo mysqli_error($pubConn); +$i=0; +while($tmpRows = @mysqli_fetch_array($tmpResult)){ + $tmpArr[$i][tgNum] = hexdec(getBitValue($tmpRows[0],"3.0-3.7")); + $tmpArr[$i][name]=toAscii(getBitValue($tmpRows[0],"14.0-23.7")); + $i++; +} + +for($i=0; $i< $tgNo; $i++) +{ + if($tgArr[$i][inst]==253 || $tgArr[$i][inst]==254) + { + $tgArr[$i][name] = $tgTitleArr[$tgArr[$i][inst]]='LoopBack'.$tgArr[$i][inst]; + } + else + { + for($j=0;$j<256;$j++){ + if($tgArr[$i][inst]==$tmpArr[$j][tgNum]){ + $tgArr[$i][name] = $tgTitleArr[$tgArr[$i][inst]]=$tmpArr[$j][name]; + break; + } + } + } + +} +/* +if(sizeof($tgArr)>0) +{ + foreach($tgArr as $key => $row) + { + $name[$key] = $row['name']; + } + array_multisort($name, SORT_ASC, $tgArr); +} +*/ +$wDef = substr($wDef,0,-3); +$wDef = $wDef.")"; +if(strlen($wDef) < 10){ + $wDef = 'instanceNo < 0'; +} +if($DEBUG)echo "
      wDef=$wDef"; +$tgShow[0] = "1"; + +$scroll_x = isset($scroll_x)?$scroll_x:'0'; +$scroll_y = isset($scroll_y)?$scroll_y:'0'; +echo ""; +echo "
      "; +?> +"; +echo ""; +echo ""; +echo "Configuration > Network > TG overview"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo "

      $strBack"; +echo ""; +echo ""; + +?> + + + + +
      +

      + + + + + + + + + + + + + + + + + + + + + +{$tgArr[$i][inst]}"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + +} +echo "
      No.TitleCategoryDPCCDRVoiceALT flagALT TGLoopbackNICircuitBack offLocationMPTYTandemIncoming call type
      {$tgArr[$i][name]} {$tgTypeArr[$tgArr[$i][1]][remark]}{$tgArr[$i][2]} {$cdrFlagArr[$tgArr[$i][3]][remark]}{$voFlagArr[$tgArr[$i][4]][remark]}{$atFlagArr[$tgArr[$i][5]][remark]}{$tgTitleArr[$tgArr[$i][6]]} {$lpFlagArr[$tgArr[$i][7]][remark]}{$netTypeArr[$tgArr[$i][8]][remark]}{$cirTypeArr[$tgArr[$i][9]][remark]}{$backFlagArr[$tgArr[$i][10]][remark]}{$tgLocationArr[$tgArr[$i][11]][remark]}{$mptyFlagArr[$tgArr[$i][12]][remark]}{$tandemFlagArr[$tgArr[$i][13]][remark]}{$incomingCallTypeArr[$tgArr[$i][14]][remark]}
      "; +echo ""; +echo ""; + + +?> + + diff --git a/wxc2_omc/element/mss/toneAnnounce.php b/wxc2_omc/element/mss/toneAnnounce.php new file mode 100755 index 0000000..b0e035a --- /dev/null +++ b/wxc2_omc/element/mss/toneAnnounce.php @@ -0,0 +1,457 @@ +cardNo:$cardNo"; +if(!isset($cardNo)) +{ + $selSql = "select sysNo,subSysNo from $sysInfoTab where sysTypeNo='111' order by sysNo,subSysNo"; + $Result = mysqli_query($pubConn,$selSql); + if($Rows = mysqli_fetch_array($Result)) + $cardNo=$Rows[sysNo].'-'.$Rows[subSysNo]; +} +//echo "
      cardNo:$cardNo"; +$tmpArr = explode('-',$cardNo); +$sysNo = $tmpArr[0]; +$subSysNo = $tmpArr[1]; + +$temp=trim($sysNo); +if(strlen($temp)==0) + $sysNo=0; +if(!isset($sysNo)) + $sysNo=0; + +//echo "sysNo:$sysNo
      "; +//============================================================= +if(!isset($plat_select)) +{ + $plat_label=array(0=>"CSC-0",1=>"CSC-1"); + $database="OMC_PUB"; + $sql="select detailStat from sysStat where sysTypeNo=111 and sysNo=0 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + $plat_select=1; + else + $plat_select=0; + +} +$plat_select=$plat_select+0; +//echo "plat select:$plat_select"; + +$sysNo=$plat_select; +$k8e1Table = 'param_' . $sysNo; +$k8e1Db = "OBJ_111"; + +$sysId = '111_' . $sysNo . '_99'; +$slctSysId = "111_$sysNo"."_$subSysNo"; +//echo "
      $sysId,$slctSysId"; + +/* +$sysId_arr = array( + array($sysId, array('2.7'), '8ke1',$slctSysId) + ); +*/ + +$sysId_arr=array( + array('oid'=>'2.7', 'sysid'=> $sysId, 'selectsysid'=>$slctSysId), +); +$toneMapArr = array( + "0" => "Ringback tone", + "1" => "Busy tone", + "2" => "Unavailable tone", + "3" => "Congestion tone", + "4" => "Proceeding tone", + "5" => "Warning tone", + //"6" => "Call hold tone", + ); +$toneArray = array( + "Called number invalid ", + "Called number not activated", + "Subscriber busy", + "Network busy", + "Caller party deactivated", + "Called party deactivated", + "Feature unavailable", + "Called party unavailable", + "Phone ringing", + "Warning before termination", + "Warning after termination", + "Reserve", + "Reserve", + "Reserve", + "Reserve", + "Call hold" + ); + +$ToneSettingArr = array( + array("oid" => "2.7.1", "remark" => "Ringback"), + array("oid" => "2.7.2", "remark" => "Busy"), + array("oid" => "2.7.3", "remark" => "Unavailable"), + array("oid" => "2.7.4", "remark" => "Congestion"), + array("oid" => "2.7.5", "remark" => "Proceeding"), + array("oid" => "2.7.6", "remark" => "Warning tone"), + array("oid" => "2.7.7", "remark" => "Call hold tone") + ); +$toneOffsetArr = array( + array("offset" => "00.0-00.7", "len" => '2' , "min" => 0, "max" => 31), + array("offset" => "01.0-01.7", "len" => '2', "min" => 1, "max" => 128), + array("offset" => "02.0-17.7", "len" => '32') + ); +?> + + + +Setting parameters
      "; + //print_r($sysId_arr); + echo "plat_select"; + if($plat_select==0) + $sysId_arr_set=array( + array('oid'=>'2.7', 'sysid'=> '111_0_99', 'selectsysid'=>'-1'), + ); + else + $sysId_arr_set=array( + array('oid'=>'2.7', 'sysid'=> '111_1_99', 'selectsysid'=>'-1'), + ); + //SetParam($sysId_arr); + SetParam($sysId_arr_set); + session_register("SetFlag"); + + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + //print_r($sysId_arr); + if($plat_select==0) + $sysId_arr_get=array( + array('oid'=>'2.7', 'sysid'=> '111_0_99', 'selectsysid'=>'-1'), + ); + else + $sysId_arr_get=array( + array('oid'=>'2.7', 'sysid'=> '111_1_99', 'selectsysid'=>'-1'), + ); + //GetParam($sysId_arr); + GetParam($sysId_arr_get); + $showType="Get"; + } + } + echo ""; + exit(); +} + +echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strConfiguration > Network > MSC > Tone"; + echo ""; + $helpId='2.14'; + //showHelp($helpId); + echo "
      "; + echo "
      "; + + + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + /* + {//select a 8ke1 card. + $selSql = "select sysNo,subSysNo from $sysInfoTab where sysTypeNo='111' order by sysNo,subSysNo"; + $Result = mysqli_query($pubConn,$selSql); + echo ""; + }//end select + */ + //===select a plat no========================== + //==================add the CSC plat selection=========================== + //===================wether the system have csc-0====== + $plat_label=array(0=>"CSC-0",1=>"CSC-1"); + $database="OMC_PUB"; + $sql="select detailStat from sysStat where sysTypeNo=111 and sysNo=0 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + $plat1_plat2[0]=0; + else + $plat1_plat2[0]=1; + + $database="OMC_PUB"; + $sql="select detailStat from sysStat where sysTypeNo=111 and sysNo=1 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + $plat1_plat2[1]=0; + else + $plat1_plat2[1]=1; + + //print_r($plat1_plat2); + echo ""; + //========================================================================= + //============================================= + echo ""; + echo ""; + echo "   "; + echo ""; + echo "

      $strBack"; + echo "

      "; + echo "
      "; +} +?> + +"; +{//Announcement + echo ""; + echo "Tone Usage"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $oidStr = '2.7.9'; + $levelWhere = getLevelWhere($oidStr); + $selSql = "select initValue from $k8e1Table where $levelWhere"; + if($DEBUG) echo "
      Line ".__LINE__.": ".$selSql; + $Result = mysqli_query($pubConn,$selSql); + $Rows = mysqli_fetch_array($Result); + for($i=0; $i< sizeof($toneArray); $i++) + { + $offset = "$i.0-$i.7"; + $toneValue = hexdec(getBitValue($Rows[initValue],$offset)); + if($i>=11&&$i<=14) + echo ""; + else + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      No.Call failureTone
      $i{$toneArray[$i]}"; + echo "
      "; + echo ""; +}//end Announcement + +{//Tone + echo ""; + echo "Tone Setup"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0; $i< sizeof($ToneSettingArr); $i++) + { + echo ""; + $levelWhere = getLevelWhere($ToneSettingArr[$i][oid]); + $selSql = "select initValue from $k8e1Table where $levelWhere"; + $Result = mysqli_query($pubConn,$selSql); + $Rows = mysqli_fetch_array($Result); + echo ""; + for($j=0;$j< sizeof($toneOffsetArr); $j++) + { + if($j==2) + { + $tmp_value = explode('000',getBitValue($Rows[initValue],$toneOffsetArr[$j][offset])); + $tmp_value = $tmp_value[0]; + if(strlen($tmp_value)%2) + $tmp_value .= '0'; + } + else + $tmp_value = hexdec(getBitValue($Rows[initValue],$toneOffsetArr[$j][offset])); + $len = $toneOffsetArr[$j][len]+1; + $size=$len + 2; + $tmp_name = "type_".$i."_".$j; + echo ""; + } + echo ""; + } + echo "
      TypeChannelCycle(*50ms)Cadence
      {$ToneSettingArr[$i][remark]}"; + echo ""; + echo "
      "; + echo ""; +}//end Tone + +{//DTMF + $levelWhere = getLevelWhere('2.7.10'); + $selSql = "select initValue from $k8e1Table where $levelWhere"; + $Result = mysqli_query($pubConn,$selSql); + $Rows = mysqli_fetch_array($Result); + $mark = hexdec(getBitValue($Rows[initValue],'0.0-0.7')); + $space = hexdec(getBitValue($Rows[initValue],'1.0-1.7')); + echo ""; + echo "DTMF"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Mark:Space:
      "; + echo ""; + echo ""; +}//END DTMF +echo ""; +echo ""; + +?> + +
      + diff --git a/wxc2_omc/element/mss/vlr.php b/wxc2_omc/element/mss/vlr.php new file mode 100755 index 0000000..ec6f306 --- /dev/null +++ b/wxc2_omc/element/mss/vlr.php @@ -0,0 +1,441 @@ +正在调试中!!"; +?> + + + +'2.1', 'sysid'=> '325_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.7', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2.0', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), +); + +$SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99'), +); + +$getsql = "SELECT sysNo FROM $sysinfo where sysTypeNo = $sysTypeNo"; +if($DEBUG) echo "getsql = $getsql
      "; +$Result = @mysqli_query($pubConn,$getsql); +while($Rows = mysqli_fetch_array($Result)) +{ + $vlrSysId = "325_".$Rows[sysNo]."_0"; + $SaveArr[] = array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=> $vlrSysId); +} + +//loading +if($load_flag == 1) +{ + echo "
      Loading"; + + GetParam($sysId_arr,1);//1 means return to overview if getting parameters fails. + + echo ""; +} + +{//set system ip + for($i=0; $i < 2; $i++) + { + $getsql = "SELECT ip FROM $sysinfo where sysTypeNo = $sysTypeNo and sysNo = '$i'"; + if($DEBUG) echo "getsql = $getsql
      "; + $ip_init = @mysqli_query($pubConn,$getsql); + $ip_init = mysqli_fetch_array($ip_init); + $ip_init = $ip_init[0]; + $ip_array = explode('.',$ip_init); + + for($j = 0;$j < sizeof($ip_array);$j++) + { + $ip = $ip_array[$j]; + $mss_ip[$i] .= omc_keep_length(dechex($ip),'0','2'); + } + } + $mss_ip[0] = strtoupper(omc_keep_length($mss_ip[0],'0','8')); + $mss_ip[1] = strtoupper(omc_keep_length($mss_ip[1],'0','8')); + if($DEBUG) + { + echo "
      mss0_ip = $mss_ip[0]
      "; + echo "mss1_ip = $mss_ip[1]
      "; + } + + $sysId = "223_99_99"; + //vlr + $oidStr = "2.1.7"; + setParamValue($mss_ip[0],$sysId,$oidStr,3); + setParamValue($mss_ip[1],$sysId,$oidStr,4); +}//end set system ip + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + SetParam($sysId_arr); + session_register("vlrSetFlag"); + + $showType="Set"; + echo "
      Sending save command
      "; + SaveParam($SaveArr); + echo ""; + //exit(); + } + else + { + echo "
      Getting parameters
      "; + session_register("GetFlag"); + GetParam($sysId_arr); + $showType="Get"; + } + } + + echo ""; + exit(); +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > VLR"; +echo ""; +$helpId = '2.1.1.2'; +showHelp($helpId); +echo "
      "; +echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       "; + //echo "Visitor Location Register:  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +?> + + +indicator = {$indicator[0]}
      "; + + for($i = 0; $i < 4; $i++) + { + $flag = getBitValue($indicator[0],"0.$i"); + if ($flag == 0) + $spc_index[$i] = $i; + else + $spc_index[$i] = $i+4; + } + + for($i = 0; $i < 4; $i ++) + { + $level_array = explode('.',$spcTree_array[$spc_index[$i]][3]); + + for($j = 0;$j < sizeof($level_array);$j ++) + { + $level_no = $j + 1; + ${level_.$level_no} = $level_array[$j]; + } + $getsql = "select initValue from $mtp3_sqlTable + where level_1 = '$level_1' and level_2 = '$level_2' and level_3 = '$level_3' "; + $result = mysqli_query($pubConn,$getsql); + $row[$i] = mysqli_fetch_array($result); + $row[$i] = hexdec($row[$i][0]); + if($DEBUG)echo "getsql = $getsql
      "; + if($DEBUG)echo "spc_$i=$row[$i]
      "; + } + } + + echo "" ; + echo ""; + echo ""; + echo ""; +}//end Signaling point + +{//gtt + $sysId = "223_99_99"; + $oidStr = "2.1.7"; + $instanceNo=0; + echo "" ; + echo ""; +}//end gtt + +{//purge + echo "" ; + echo ""; + echo ""; + echo ""; +}//end purge + +{//Idle period to purge + echo "" ; + echo ""; + echo ""; + echo ""; +}//end Idle period to purge + +{//cdr + echo "" ; + echo ""; + echo ""; + echo ""; +}//end cdr + +{//emgAllow + echo "" ; + echo ""; + echo ""; + echo ""; +}//end emgAllow + +{//ciphering + echo "" ; + echo ""; + echo ""; + echo ""; +}//end ciphering + +{//cipAlg + echo "" ; + echo ""; + echo ""; + +}//end cipAlg + +{//alloTmsi + echo "" ; + echo ""; + echo ""; +}//end alloTmsi + +{//Authentication + $auc_array = array( + array('Location update','location_auc',1), + array('MO Call','mo_call_auc',2), + array('MT Call','mt_call_auc',3) + );//2.1.1 + echo "" ; + echo ""; + echo ""; + echo ""; +}//en Authentication + +{//reuAucTrip + $reuAucTrip_array = array( + array('Reuse Triplets','OptReuseTriplets',1), + array(' Double Authentication','doubleAut',2) + );//2.1.2 + + echo "" ; + echo ""; + echo ""; + echo ""; +}//end reuAucTrip + +{//checkImei + $checkimsi_array = array( + array('Location update','location_checkimsi',1), + array('MO Call','mo_call_checkimsi',2), + array('MT Call','mt_call_checkimsi',3) + );//2.1.8 + + echo "" ; + echo ""; + echo ""; + echo ""; +}//end checkImei + + +{//Location update flag + $LocUpFlg_array = array( + array('Normal LU to HLR','Normal_lu',1), + array('Periodic LU','Periodic_lu',2), + array('IMSI Attach','IMSI_lu',3) + );//2.1.15 + $sysId = "325_99_99"; + $oidStr = "2.1.15"; + echo "" ; + echo ""; + echo ""; + echo ""; +}//end Location update flag + +/* +{//license + echo "" ; + echo ""; + echo ""; + echo ""; +}//end license +*/ +echo "
      Signaling point code"; + for($i=0; $i<4; $i++) + echo ""; + echo "
      {$spcTree_array[$i][0]}: {$spcTree_array[$spc_index[$i]][1]} {$spcTree_array[$spc_index[$i+4]][1]} $row[$i]
      $strE164Number"; + echo ""; + + echo ""; + echo "
      "; + showParameter($sysId,$oidStr,2,1); + echo ""; + showParameter($sysId,$oidStr,1,1); + echo "
      VLR purge "; + $sysId = "325_99_99"; + $oidStr = "2.1.9"; + showParameter($sysId,$oidStr,1,1); + echo "
      Idle period to purge "; + $sysId = "325_99_99"; + $oidStr = "2.1.10"; + showParameter($sysId,$oidStr,1,1); + echo " *6 Minutes
      CDR flag "; + $sysId = "325_99_99"; + $oidStr = "2.1.11"; + showParameter($sysId,$oidStr,1,1); + echo "
      Emergency call "; + $sysId = "325_99_99"; + $oidStr = "2.1.7"; + showParameter($sysId,$oidStr,1,1); + echo "
      Ciphering "; + $sysId = "325_99_99"; + $oidStr = "2.1.3"; + showParameter($sysId,$oidStr,1,1); + echo "
      Ciphering algorithm "; + $sysId = "325_99_99"; + $oidStr = "2.1.4"; + showParameter($sysId,$oidStr,1,1); + echo "
      TMSI Allocation "; + $sysId = "325_99_99"; + $oidStr = "2.1.5"; + showParameter($sysId,$oidStr,1,1); + echo "
      Authentication"; + echo ""; + $sysId = "325_99_99"; + $oidStr = "2.1.1"; + for($i = 0;$i < sizeof($auc_array);$i++ ) + { + echo ""; + echo ""; + } + + echo "
      {$auc_array[$i][0]}"; + $order=$auc_array[$i][2]; + showParameter($sysId,$oidStr,$order,1); + echo "
      Reuse authentication triplet"; + echo ""; + $sysId = "325_99_99"; + $oidStr = "2.1.2"; + for($i = 0;$i < sizeof($reuAucTrip_array);$i++ ) + { + echo ""; + echo ""; + } + echo "
      {$reuAucTrip_array[$i][0]}"; + $order=$reuAucTrip_array[$i][2]; + showParameter($sysId,$oidStr,$order,1); + echo "
      Validate IMEI"; + echo ""; + $sysId = "325_99_99"; + $oidStr = "2.1.8"; + for($i = 0;$i < sizeof($checkimsi_array);$i++ ) + { + echo ""; + echo ""; + } + echo "
      {$checkimsi_array[$i][0]}"; + $order=$checkimsi_array[$i][2]; + showParameter($sysId,$oidStr,$order,1); + echo "
      Location update flag"; + echo ""; + for($i = 0;$i < sizeof($LocUpFlg_array);$i++ ) + { + echo ""; + echo ""; + } + echo "
      {$LocUpFlg_array[$i][0]}"; + $order=$LocUpFlg_array[$i][2]; + showParameter($sysId,$oidStr,$order,1); + echo "
      License control "; + $sysId = "325_99_99"; + $oidStr = "2.1.16"; + showParameter($sysId,$oidStr,1,1,0,'','','Update'); + echo "
      "; +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +echo "
      "; +?> diff --git a/wxc2_omc/element/mss/vmsSeg.php b/wxc2_omc/element/mss/vmsSeg.php new file mode 100755 index 0000000..1286b83 --- /dev/null +++ b/wxc2_omc/element/mss/vmsSeg.php @@ -0,0 +1,195 @@ +正在调试中!!"; + +$sqltable = 'OBJ_360.param_99'; + +?> + + + getsql: $getsql"; + $result = mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $vmsSeg_row = mysqli_fetch_array($result); + $vmsSeg_row = $vmsSeg_row[initValue]; + + $tmpStartMSISDN = omc_keep_length(toHex($startMSISDN),'0',32,0); + $tmpendMSISDN = omc_keep_length(toHex($endMSISDN),'0',32,0); + + $tmpPLMNServNo = omc_keep_length(toHex($PLMNServNo),'0',32,0); + $tmpPSTNServNo = omc_keep_length(toHex($PSTNServNo),'0',32,0); + $tmpLeaveMessNo = omc_keep_length(toHex($LeaveMessNo),'0',32,0); + + $setValue = setBitValue($vmsSeg_row, '00.0-15.7' ,$tmpStartMSISDN); + $setValue = setBitValue($setValue, '16.0-31.7' ,$tmpendMSISDN); + $setValue = setBitValue($setValue, '32.0-47.7' ,$tmpPLMNServNo); + $setValue = setBitValue($setValue, '48.0-63.7' ,$tmpPSTNServNo); + $setValue = setBitValue($setValue, '64.0-79.7' ,$tmpLeaveMessNo); + + $objWhereStr = getLevelWhere('2.1.5.5'); + $updSql = "update $sqltable set initvalue='$setValue' where $objWhereStr and instanceNo=$instanceNo"; + if(0) echo "
      updSql: $updSql"; + $result = mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + + echo ""; + exit(); +} + +?> +
      "> +"; + echo ""; + echo ""; + + $backurl1 = str_replace("wxc2_sp_signaling","wxc2_sp",$backurl); + echo "Configuration > Network > "; + echo "PPS > "; + echo "Basic vmsSeg zone"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + + echo "$strBack"; + + + echo ""; + echo ""; + echo ""; + + echo "
      "; +} + +$objWhereStr = getLevelWhere('2.1.5.5'); +$getsql = "select initValue from $sqltable where $objWhereStr and instanceNo=$instanceNo"; +if(0) echo "
      getsql: $getsql"; +$result = mysqli_query($pubConn,$getsql); +echo mysqli_error($pubConn); +$vmsSeg_row = mysqli_fetch_array($result); +$vmsSeg_row = $vmsSeg_row[initValue]; + +$startMSISDN = trim(toAscii(getBitValue($vmsSeg_row,'00.0-15.7'))); +$endMSISDN = trim(toAscii(getBitValue($vmsSeg_row,'16.0-31.7'))); +$servNumPLMN = trim(toAscii(getBitValue($vmsSeg_row,'32.0-47.7'))); +$servNumPSTN = trim(toAscii(getBitValue($vmsSeg_row,'48.0-63.7'))); +$numberDeposit = trim(toAscii(getBitValue($vmsSeg_row,'64.0-79.7'))); + +//print_r($vssSegArr); +$vssIns = -1; +for($j=0; $j< sizeof($vssSegArr)-1; $j++)//vss serv number +{ + $vms_objDB = "OBJ_390"; + $vms_paramTable = 'param_99'; + $oidstr = "2.2.1.1"; + $objWhereStr = getLevelWhere($oidstr); + $tmpInstNo = $vssSegArr[$j][sysNo]; + $getsql = "select initValue from $vms_paramTable where $objWhereStr and instanceNo='$tmpInstNo'"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + /* + $MSISDN = getBitValue($row[0],'00.0-07.7'); + $MSISDN = str_replace('F','',$MSISDN); + $CheckMessNo = getBitValue($row[0],'32.0-39.7'); + $CheckMessNo = str_replace('F','',$CheckMessNo); + */ + $PLMNServNo = getBitValue($row[0],'08.0-15.7'); + $PLMNServNo = str_replace('F','',$PLMNServNo); + + $PSTNServNo = getBitValue($row[0],'16.0-23.7'); + $PSTNServNo = str_replace('F','',$PSTNServNo); + + $LeaveMessNo = getBitValue($row[0],'24.0-31.7'); + $LeaveMessNo = str_replace('F','',$LeaveMessNo); + + if(strcmp($PLMNServNo,$servNumPLMN)==0 + &&strcmp($PSTNServNo,$servNumPSTN)==0 + &&strcmp($LeaveMessNo,$numberDeposit)==0) + + { + $vssIns = $vssSegArr[$j][sysNo]; + break; + } +}//end vss serv number +echo ""; +echo ""; +echo ""; + echo ""; + echo ""; +echo ""; + +echo ""; + echo ""; + echo ""; +echo ""; + +echo ""; + echo ""; + echo ""; +echo ""; +?> diff --git a/wxc2_omc/element/mss/xapp_overview.php b/wxc2_omc/element/mss/xapp_overview.php new file mode 100755 index 0000000..49c6c91 --- /dev/null +++ b/wxc2_omc/element/mss/xapp_overview.php @@ -0,0 +1,238 @@ + +"; +echo ""; +echo "
      ParametersValue
      Start MSISDN
      End MSISDN
      VSS Name"; + echo ""; + echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > Element overview"; +echo ""; +//showHelp($helpId); +echo ""; +echo "

      $strBack"; +echo "

      "; + +echo "
      "; +//echo "Element overview:
      "; + + + +//===============================get the default value of XAPP element info============================== + $database="OBJ_225"; + $sql="select initValue from paramConf where level_1=2 and level_2=11 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $default_initValue=$rows[initValue]; + //echo "default_initValue:$default_initValue
      "; +//===============================init==================================================== + for($i=0;$i<128;$i++) + { + $xapp_show[$i]=0; + + } + + //===============================get the data from OBJ_225 param_99=========================== + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + do + { + //====instance No + $instanceNo=$rows[instanceNo]; + $initValue=$rows[initValue]; + //====show or no + if($initValue!=$default_initValue) + $xapp_show[$instanceNo]=1; + //====device type + $xapp_deviceType[$instanceNo]=hexdec(getBitValue($rows[initValue],'1.0-1.7'))+0; + //=====sysNo + $xapp_sysNo[$instanceNo]=hexdec(getBitValue($rows[initValue],'2.0-2.3'))+0; + //======subSysNo + $xapp_subSysNo[$instanceNo]=hexdec(getBitValue($rows[initValue],'2.4-2.7'))+0; + //======assign tg + $xapp_assign_tg[$instanceNo]=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; + //======assign linkset + $xapp_assign_linkset[$instanceNo]=hexdec(getBitValue($rows[initValue],'4.0-4.7'))+0; + //======application type + $xapp_application_type[$instanceNo]=hexdec(getBitValue($rows[initValue],'5.0-5.7'))+0; + //=======grp no + $xapp_grp_no[$instanceNo]=hexdec(getBitValue($rows[initValue],'6.0-6.7'))+0; + //=======title + $xapp_title[$instanceNo]=getBitValue($rows[initValue],'14.0-23.7'); + //echo "{$xapp_title[$instanceNo]}
      "; + }while($rows=mysqli_fetch_array($result)); + + //========================format the data================================================ + $device_type_label=array(1=>"BSC",2=>"AAS",3=>"VSS",4=>"PCR",5=>"CNF",16=>"Switch(SS7)",17=>"switch(ISDN)",18=>"Application"); + $application_type_label=array(0=>"MSC",1=>"HLR",2=>"VLR",3=>"SMSC",4=>"SGSN",5=>"NewElement"); + for($i=0;$i<256;$i++) + { + + //=======device type + $xapp_deviceType[$i]=$device_type_label[$xapp_deviceType[$i]]; + //=======application type + $xapp_application_type[$i]=$application_type_label[$xapp_application_type[$i]]; + //=======element title + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($xapp_title[$i],$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $xapp_title[$i]=$temp; + + } + + + //====================================test============================================== + /* + for($i=0;$i<256;$i++) + { + echo "
      "; + echo "instanceNo---$i
      "; + echo "device type---{$xapp_deviceType[$i]}
      "; + echo "sysNo---{$xapp_sysNo[$i]}
      "; + echo "subSysNo---{$xapp_subSysNo[$i]}
      "; + echo "assign tg---{$xapp_assign_tg[$i]}
      "; + echo "assign linkset---{$xapp_assign_linkset[$i]}
      "; + echo "application type---{$xapp_application_type[$i]}
      "; + echo "grp no---{$xapp_application_type[$i]}
      "; + echo "title---{$xapp_title[$i]}
      "; + echo "
      "; + } + */ + + //====================================show the table==================================== + //0 by instanceNo + //1 by device type + //2 by application type + if(!isset($sort_type)) + $sort_type=0; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + + if($sort_type==0) + { + for($i=0;$i<256;$i++) + { + if($xapp_show[$i]==0) + echo ""; + else + echo ""; + + echo ""; + + if(trim($xapp_deviceType[$i])=="") + echo ""; + else + echo ""; + + if(trim($xapp_sysNo[$i])=="") + echo ""; + else + echo ""; + + if(trim($xapp_subSysNo[$i])=="") + echo ""; + else + echo ""; + + if(trim($xapp_assign_tg[$i])=="") + echo ""; + else + echo ""; + + if(trim($xapp_assign_linkset[$i])=="") + echo ""; + else + echo ""; + + if(trim($xapp_application_type[$i])=="") + echo ""; + else + echo ""; + + if(trim($xapp_grp_no[$i])=="") + echo ""; + else + echo ""; + + if(trim($xapp_title[$i])=="") + echo ""; + else + echo ""; + + + echo ""; + } + echo "
      No.Device TypeSystem No.Subsystem No.Assign TGAssign LinksetApplication Type"; + echo "Grp No.Element Title
      $i--$xapp_deviceType[$i]--$xapp_sysNo[$i]--$xapp_subSysNo[$i]--$xapp_assign_tg[$i]--$xapp_assign_linkset[$i]--$xapp_application_type[$i]--$xapp_grp_no[$i]--$xapp_title[$i]
      "; + } + else if($sort_type==1) + { + arsort($xapp_deviceType,SORT_STRING); + + foreach($xapp_deviceType as $key => $value) + { + if($xapp_show[$key]==0) + echo ""; + else + echo ""; + + echo "$key"; + echo " $xapp_deviceType[$key]"; + echo " $xapp_sysNo[$key]"; + echo " $xapp_subSysNo[$key]"; + echo " $xapp_assign_tg[$key]"; + echo " $xapp_assign_linkset[$key]"; + echo " $xapp_application_type[$key]"; + echo " $xapp_grp_no[$key]"; + echo " $xapp_title[$key]"; + echo ""; + + } + } + else if($sort_type==2) + { + arsort($xapp_application_type,SORT_STRING); + + foreach($xapp_application_type as $key => $value) + { + if($xapp_show[$key]==0) + echo ""; + else + echo ""; + + echo "$key"; + echo " $xapp_deviceType[$key]"; + echo " $xapp_sysNo[$key]"; + echo " $xapp_subSysNo[$key]"; + echo " $xapp_assign_tg[$key]"; + echo " $xapp_assign_linkset[$key]"; + echo " $xapp_application_type[$key]"; + echo " $xapp_grp_no[$key]"; + echo " $xapp_title[$key]"; + echo ""; + + } + } + + +?> diff --git a/wxc2_omc/element/overview/addElement.php b/wxc2_omc/element/overview/addElement.php new file mode 100755 index 0000000..50dd090 --- /dev/null +++ b/wxc2_omc/element/overview/addElement.php @@ -0,0 +1,2121 @@ +调试中..."; + exit(); +} +//****** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; + + +//===================function========================== +function alert($msg) +{ + echo "\n"; +} +//===================================================== +//echo "bssIP:$bssIP
      "; +//echo "sysType:$sysType
      "; +//$readValue ='readValue'; +//$nGetComm = 0; +//$nSetComm = 3; +//$maxNum = 30; +//$nProcFail = 0;//failure +//$nWaitProc = 1;//wait +//$nInProc = 2; +//$nOutProc = 3; + +$pubDb = 'OMC_PUB'; +$initValue ='initValue'; + +$niArr=array( + array('id'=>'0','name'=>'International'), + array('id'=>'1','name'=>'International spare'), + array('id'=>'2','name'=>'National'), + array('id'=>'3','name'=>'National spare') +); +$sysTypeArr=array( + array('id'=>'0','name'=>'MSS'), + array('id'=>'1','name'=>'BSS'), + array('id'=>'2','name'=>'Peripheral'), + array('id'=>'3','name'=>'Switch'), + array('id'=>'4','name'=>$strGttObjects) +); + +$locEleArr=array( + array('sysTypeName'=>'MSC', 'sysTypeNo'=>'320','sysTypeSSN'=>'8','GT'=>'--','extFlg'=>'0'), + array('sysTypeName'=>'VLR', 'sysTypeNo'=>'325','sysTypeSSN'=>'7','GT'=>'--','extFlg'=>'0'), + array('sysTypeName'=>'HLR', 'sysTypeNo'=>'330','sysTypeSSN'=>'6','GT'=>'--','extFlg'=>'0'), + array('sysTypeName'=>'AUC', 'sysTypeNo'=>'340','sysTypeSSN'=>'10','GT'=>'--','extFlg'=>'0'), + array('sysTypeName'=>'SMSC','sysTypeNo'=>'350','sysTypeSSN'=>'11','GT'=>'--','extFlg'=>'0'), + array('sysTypeName'=>'PPS', 'sysTypeNo'=>'360','sysTypeSSN'=>'147','GT'=>'--','extFlg'=>'0'), + array('sysTypeName'=>'EIR','sysTypeNo'=>'380','sysTypeSSN'=>'9','GT'=>'--','extFlg'=>'0'), + array('sysTypeName'=>'MNP','sysTypeNo'=>'370','sysTypeSSN'=>'32','GT'=>'--','extFlg'=>'0') +); + +$peripheEleArr=array( + array('sysTypeName'=>'--','sysTypeNo'=>'311'), + array('sysTypeName'=>'VSS','sysTypeNo'=>'390'), + array('sysTypeName'=>'','sysTypeNo'=>''), + //array('sysTypeName'=>'PCR','sysTypeNo'=>'130'), + array('sysTypeName'=>'CNF','sysTypeNo'=>'160'), + array('sysTypeName'=>'CNF Center','sysTypeNo'=>'270') +); +$switchEleArr=array( + array('sysTypeName'=>'SS7','sysTypeNo'=>''), + array('sysTypeName'=>'ISDN','sysTypeNo'=>'') +); +$appliEleArr=array( + array('sysTypeName'=>'MSC','sysTypeNo'=>'320'), + array('sysTypeName'=>'HLR','sysTypeNo'=>'330'), + array('sysTypeName'=>'VLR','sysTypeNo'=>'325'), + array('sysTypeName'=>'SMSC','sysTypeNo'=>'350'), + array('sysTypeName'=>'SGSN','sysTypeNo'=>''), + array('sysTypeName'=>'-New-','sysTypeNo'=>'') +); + +getExistElements($existElementArr); + +//print_r($existElementArr); +//if have CNF,then add a CNF-center +if(@array_search('160', $existElementArr)==TRUE) + $existElementArr[sizeof($existElementArr)] = '270'; + +if(@array_search('500', $existElementArr)==TRUE)//BSS + $needBssIp = 1; +?> + +Adding Element ...
      "; + //echo "add:$add
      "; + if(strlen($add) >0) + { + //alert("trunk_no".$trunk_select); + //alert("linkset_no".$linkset_select); + if(strlen($elementName)<=0) + { + $errorInfo='Please input the element Name'; + alertMsgAndGoLast($errorInfo); + } + + + + chkEleName($elementName); + + switch($sysType) + { + //add mss + case 0: + { + $sysId_arr=array( + array('oid'=>'2.1', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + ); + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99'),//sccp + ); + {//MSC IP + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='320' AND sysNo='0' + "; + if($DEBUG)echo "
      getSysIdSql:$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + if($getSysIdRow = @mysqli_fetch_array($getSysIdResult)) + { + $MSCIP0 =$getSysIdRow[ip]; + } + else + { + $MSCIP0 ='255.255.255.255'; + } + $IP = explode('.',$MSCIP0); + $IP0 = omc_keep_length(dechex($IP[0]),"0","2"); + $IP1 = omc_keep_length(dechex($IP[1]),"0","2"); + $IP2 = omc_keep_length(dechex($IP[2]),"0","2"); + $IP3 = omc_keep_length(dechex($IP[3]),"0","2"); + $MSCIP0 = $IP0.$IP1.$IP2.$IP3; + + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='320' AND sysNo='1' + "; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + if($getSysIdRow=@mysqli_fetch_array($getSysIdResult)) + { + $MSCIP1 =$getSysIdRow[ip]; + } + else + { + $MSCIP1 ='255.255.255.255'; + } + $IP = explode('.',$MSCIP1); + $IP0 = omc_keep_length(dechex($IP[0]),"0","2"); + $IP1 = omc_keep_length(dechex($IP[1]),"0","2"); + $IP2 = omc_keep_length(dechex($IP[2]),"0","2"); + $IP3 = omc_keep_length(dechex($IP[3]),"0","2"); + $MSCIP1 = $IP0.$IP1.$IP2.$IP3; + }//end MSC IP + //echo "ni:$ni
      "; + $tmpNi=omc_keep_length($ni,'0',2); + //echo "tmpNi:$tmpNi
      "; + $tmpInitValue=$tmpNi.'FFFFFFFFFFFFFFFFFFFF'.$MSCIP0.$MSCIP1; + $tmpInitValue = strtoupper($tmpInitValue); + $tmpObjIdStr='2.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_223.param_99'; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere AND level_3='{$locEleArr[$eleType][sysTypeSSN]}' + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + break; + } + //add mss end + case 1://BSS; + case 2://Peripheral; + { + + //================================================================================= + //echo "needBssIp:$needBssIp
      "; + if($sysType==1&&$needBssIp==1) + { + + //************check the IP*********************** + if(!strcmp(long2ip(sprintf("%u",ip2long($bssIP))),$bssIP)) + $is_ip_valid=1; + else + $is_ip_valid=0; + if($is_ip_valid==0) + { + alertMsgAndGoLast("IP address format error"); + } + $result=exec("ping -c 1 ".$bssIP); + if($result=="1 packets transmitted, 0 packets received, +1 errors, 100% packet loss") + alertMsgAndGoLast("object unreachable: The BSS cannot be reached"); + + } + + ///==========There has an bug ,add the second CNF do not need DPC + if($sysType==2&&$eleType==3) + $temp=""; + else + { + if(strlen($dpc)<=0) + { + $errorInfo='Please input the DPC!'; + alertMsgAndGoLast($errorInfo); + } + } + + + + + //================================================================================= + //echo "BSS
      "; + $sysId_arr=array( + array('oid'=>'2.4.1', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'),//ls + array('oid'=>'2.1.4', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'),//tg + array('oid'=>'2.11', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'),//xapp + ); + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99'),//MSC + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99'),//mtp3 + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99'),//xapp + ); + //bss + if($sysType==1) + { + //echo "aaa
      "; + $sysId_arr[]= array('oid'=>'2.2.6', 'sysid'=> '322_99_99', 'selectsysid'=>'-1');//lac + } + if($sysType==2) + { + $sysId_arr[]= array('oid'=>'2.1.6', 'sysid'=> '322_99_99', 'selectsysid'=>'-1');//announcement + } + //print_r($sysId_arr); + + + if($useSameCnfLinkset!=1) + { + //echo "useSameCnfLinkset:$useSameCnfLinkset
      "; + if(strlen($dpc)<=0) + { + $errorInfo='Please input the DPC!'; + alertMsgAndGoLast($errorInfo); + } + + for($i=0;$i$dpc[$i]||'9'<$dpc[$i]) + { + $errorInfo='The DPC is error'; + alertMsgAndGoLast($errorInfo); + } + } + //echo "ni$$ni
      "; + chkDPC($dpc,$ni); + } + + + if($sysType==1 && $needBssIp==1)//add BSS sysInfo & OMCR_BSSTABLE + { + //echo "bbb
      "; + $sysInfoTable = "OMC_PUB.sysInfo"; + $tmpSysType = 500; + $tmpSubSysNo = 0; + $isRemote = 0; + //$sysAlias='BSS'.$systemNo; + //echo "elementName:$elementName
      "; + $sysAlias=$elementName; + //============================================================= + + /* + echo isset($ni)."
      "; + echo isset($systemNo); + echo "systemNo:$systemNo
      "; + echo "ni:$ni
      "; + echo "dpc:$dpc
      "; + echo "bssIP:$bssIP
      "; + */ + $bssid=$systemNo; + + sendBssCommand($bssid,$bssIP,$sysAlias); + //============================================================= + $addSql = "REPLACE INTO $sysInfoTable (sysTypeNo,sysNo,subSysNo,isRemote,netId,DPC,ip,baseStat,sysAlias,updateTime ) + VALUES('$tmpSysType','$systemNo','$tmpSubSysNo','$isRemote','$ni','$dpc','$bssIP','1','$sysAlias',CURRENT_TIMESTAMP)"; + + if($DEBUG) echo "
      addSql = $addSql"; + $result = mysqli_query($pubConn,$addSql); + echo mysqli_error($pubConn); + + + }//end add BSS sysinfo & OMCR_BSSTABLE + + + + {//linkset + $tmpObjIdStr='2.4.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_222.param_99'; + if($useSameCnfLinkset==1) + { + + $tmpDecValue=hexdec(getBitValue($lsValue,'6.0-6.7'));//total elements in the linkset + $tmpDecValue++; + $tmpHexValue=omc_keep_length(dechex($tmpDecValue),'0',2); + $tmpInitValue=setBitValue($lsValue,'6.0-6.7',$tmpHexValue); + + $tmpInitValue = strtoupper($tmpInitValue); + $tmpInstanceNo=$cnfLS; + } + else + { + $getSql="SELECT $initValue,instanceNo FROM $tmpParamTable + WHERE $levelWhere "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $enableFlg=getBitValue($rows[initValue],'3.2-3.2');//enable flag + if($enableFlg==0) + break; + } + //alert("linkset ".$linkset_select); + //alert("trunk ".$trunk_select); + $tmpInstanceNo=$linkset_select;//$rows[instanceNo]; + $lsAssigned=$linkset_select;//$rows[instanceNo]; + + $tmpInitValue=strtoupper(omc_keep_length(dechex($dpc),'0',6)); + $tmpNi=omc_keep_length(decbin($ni),'0',2); + //echo "
      tmpNi=$tmpNi"; + $tmpUnitBinValue='00000'.'1'.$tmpNi; + $tmpUnitHexValue=omc_keep_length(dechex(bindec($tmpUnitBinValue)),'0',2); + $tmpInitValue=$tmpInitValue.$tmpUnitHexValue; + if($DEBUG) + echo "
      tmpInitValue=$tmpInitValue"; + if($sysType==1)//BSS + { + $tmpType='01'; + } + else if($sysType==2)//Peripheral + { + if($eleType==0)//AAS + $tmpType='02'; + else if($eleType==1)//VSS + $tmpType='03'; + else if($eleType==2)//PCR + $tmpType='04'; + else if($eleType==3)//CNF + $tmpType='05'; + else if($eleType==4)//CNF Center + $tmpType='06'; + } + else + $tmpType='00'; + $tmpInitValue=$tmpInitValue.$tmpType; + if($DEBUG) + echo "
      tmpInitValue=$tmpInitValue"; + if($sysType==2 && $eleType==3)//cnf + { + $tmp_subSysNo = floor($systemNo/2); + $tmp_sysNo = $systemNo%2; + + if($eleType==3) //第一个cnf,高四位设置为0001 + $tmp_subSysNo = 1; + + $bin_subSysNo = omc_keep_length(decbin($tmp_subSysNo),'0',4); + $bin_sysNo = omc_keep_length(decbin($tmp_sysNo),'0',4); + $bin_systemNo = $bin_subSysNo.$bin_sysNo; + $tolSystemNo = bindec($bin_systemNo); + + $tmpUnitHexValue=omc_keep_length(dechex($tolSystemNo),'0',2); + } + else + { + $bin_subSysNo = omc_keep_length(decbin($subSysNo),'0',4); + $bin_sysNo = omc_keep_length(decbin($systemNo),'0',4); + $bin_systemNo = $bin_subSysNo.$bin_sysNo; + $tolSystemNo = bindec($bin_systemNo); + $tmpUnitHexValue=omc_keep_length(dechex($tolSystemNo),'0',2); + } + $tmpInitValue=$tmpInitValue.$tmpUnitHexValue; + if($DEBUG) + echo "
      tmpInitValue=$tmpInitValue"; + $tmpName=toHex($elementName); + $tmpName=omc_keep_length($tmpName,"0",20,"0"); + if($sysType==2 && $eleType==3)//cnf 第一个 + $tmpInitValue=$tmpInitValue.'01'.$tmpName.'000000'; + else + $tmpInitValue=$tmpInitValue.'00'.$tmpName.'000000'; + $tmpInitValue = strtoupper($tmpInitValue); + } + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere AND instanceNo='$tmpInstanceNo' "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + }//end linkset + + if($useSameCnfLinkset!=1)//tg + { + + $tmpObjIdStr='2.1.4'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_322.param_99'; + $getSql="SELECT $initValue,instanceNo FROM $tmpParamTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $tgFlag=getBitValue($rows[initValue],'4.0-4.0');//tgFlag + if($tgFlag==0) + break; + } + $tmpInstanceNo=$trunk_select;//$rows[instanceNo]; + $tgAssigned=$trunk_select;//$rows[instanceNo]; + + $tmpInitValue=strtoupper(omc_keep_length(dechex($dpc),'0',8)); + if($sysType==1)//BSS + $tmpInitValue=$tmpInitValue.'9F';//category =SUB + elseif($sysType==2)//AAS,(VSS,PCR,CNF)? + $tmpInitValue=$tmpInitValue.'A7';//category =IP + $tmpNi=strtoupper(omc_keep_length(dechex($ni),'0',2)); + //echo "
      tmpNi=$tmpNi"; + $tmpInitValue=$tmpInitValue.$tmpNi.'80FD0000000000000000';//Alternative TG =FD + //80=(Circuit =Clockwise ;Back off =off; Location =Both) + if($DEBUG) echo "
      tmpInitValue=$tmpInitValue"; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere AND instanceNo='$tmpInstanceNo' + "; + if($DEBUG) echo "
      updateSql=$updateSql"; + + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + }//end tg + + if($sysType==1)//LAC + { + $tmpObjIdStr='2.2.6'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_322.param_99'; + $getSql="SELECT $initValue,instanceNo FROM $tmpParamTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $enableFlg=getBitValue($rows[initValue],'0.0-0.7'); + if($enableFlg==0) + break; + } + $tmpInstanceNo=$rows[instanceNo]; + + $tmpInitValue='01'; + $tmpHexValue=strtoupper(omc_keep_length(dechex($tgAssigned),'0',2)); + $tmpInitValue=$tmpInitValue.$tmpHexValue.'000000'; + if($DEBUG) + echo "
      tmpInitValue=$tmpInitValue"; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere AND instanceNo='$tmpInstanceNo' + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + if($DEBUG) + exit(); + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + }//end LAC + if($sysType==2)//set announcement; + { + $tmpObjIdStr='2.1.6'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $tmpParamTable='OBJ_322.param_99'; + $tmpInitValue ="02000000020000000200000002000000020000000200000002006000020000000200000002000000020000000200000002000000020000000200000002000000"; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere AND instanceNo='0' "; + mysqli_query($pubConn,$updateSql); + }//end announcement + break; + } + case 3://Switch; + case 4://Application; + { + $sysId_arr=array( + array('oid'=>'2.4.1', 'sysid'=> '222_99_99', 'selectsysid'=>'-1'),//mtp3 + array('oid'=>'2.11', 'sysid'=> '225_99_99', 'selectsysid'=>'-1'),//xapp + ); + $SaveArr=array( + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99'),//mtp3 + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99'),//xapp + ); + if($sysType==3) + { + $sysId_arr[] = array('oid'=>'2.1.4', 'sysid'=> '322_99_99', 'selectsysid'=>'-1'); + $SaveArr[] = array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99');//MSC + } + if($sysType == 4) + { +// $sysId_arr[] = array('oid'=>'2.2', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'); +// $sysId_arr[] = array('oid'=>'2.4', 'sysid'=> '223_99_99', 'selectsysid'=>'-1'); +// $SaveArr[] = array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99');//sccp + } + //linkset + if(!($sysType==3 && $eleType==1))//(SS7 Switch/Application) + { + $tmpObjIdStr='2.4.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_222.param_99'; + // alert("neednewlinkset:".$needNewLinkset); + if($needNewLinkset==1) + { + if(strlen($dpc)<=0) + { + $errorInfo='Please input the DPC'; + alertMsgAndGoLast($errorInfo); + } + + for($i=0;$i$dpc[$i]||'9'<$dpc[$i]) + { + $errorInfo='The DPC is error'; + alertMsgAndGoLast($errorInfo); + } + } + chkDPC($dpc,$ni); + + $getSql="SELECT $initValue,instanceNo FROM $tmpParamTable + WHERE $levelWhere "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $unitValue=getBitValue($rows[initValue],'4.0-4.7'); + if($unitValue==0) + break; + } + //alert("linkset no".$linkset_select); + //alert("trunk no".$trunk_select); + $tmpInstanceNo=$linkset_select;//$rows[instanceNo]; + $lsAssigned=$linkset_select;//$rows[instanceNo]; + + $tmpInitValue=omc_keep_length(dechex($dpc),'0',6); + $tmpNi=omc_keep_length(decbin($ni),'0',2); + //echo "
      tmpNi=$tmpNi"; + $tmpUnitBinValue='0000'.'0'.'1'.$tmpNi;//reserved+loopback+flag+ni. + $tmpUnitHexValue=omc_keep_length(dechex(bindec($tmpUnitBinValue)),'0',2); + $tmpInitValue=$tmpInitValue.$tmpUnitHexValue; + if($DEBUG) + echo "
      tmpInitValue=$tmpInitValue"; + if($sysType==3) $tmpType = '10';//16, SS7 Switch + if($sysType==4) $tmpType = '12';//18, Application + $tmpInitValue=$tmpInitValue.$tmpType;//device type. + if($DEBUG) + echo "
      tmpInitValue=$tmpInitValue"; + + $tmpUnitHexValue=omc_keep_length(dechex($systemNo),'0',2); //systemNo '5.0-5.7' + $tmpInitValue=$tmpInitValue.$tmpUnitHexValue; + if($DEBUG) + echo "
      tmpInitValue=$tmpInitValue"; + $tmpName=toHex($elementName); + $tmpName=omc_keep_length($tmpName,'0',20,'0'); + //$elementName=omc_keep_length($elementName,'0',10,'0'); + $tmpInitValue=$tmpInitValue.'01'.$tmpName.'000000'; + } + else + { + $tmpDecValue=hexdec(getBitValue($lsValue,'6.0-6.7'));//total elements in the linkset + //echo "
      tmpDecValue=$tmpDecValue"; + $tmpDecValue=$tmpDecValue+1; + $tmpHexValue=omc_keep_length(dechex($tmpDecValue),'0',2); + $tmpInitValue=setBitValue($lsValue,'6.0-6.7',$tmpHexValue); + $tmpInitValue = strtoupper($tmpInitValue); + $tmpInstanceNo=$lsInstNo; + } + if($sysType==3) + { + $tmpInitValue = setBitValue($tmpInitValue,'17.0-17.0',1);//set isSwitch flag. + } + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere AND instanceNo='$tmpInstanceNo' + "; + + if($DEBUG) + echo "
      updateSql=$updateSql"; + if($DEBUG) + exit(); + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + }//end linkset + + if($sysType==3)//Switch; + { + if($eleType==1)//ISDN Switch + { + $dpc = 0; + $ni = 3; + $needNewLinkset = 1; + } + $tmpObjIdStr='2.1.4'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_322.param_99'; + $getSql="SELECT $initValue,instanceNo FROM $tmpParamTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows=mysqli_fetch_array($result)){ + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $unitValue=getBitValue($rows[initValue],'4.0-4.0'); + if($unitValue==0) + break; + } + $tmpInstanceNo=$trunk_select;//$rows[instanceNo]; + $tgAssigned =$trunk_select;// $rows[instanceNo]; + + $tmpInitValue=strtoupper(omc_keep_length(dechex($dpc),'0',8)); + $tmpInitValue=$tmpInitValue.'87';//Loopback =enable + $tmpNi=strtoupper(omc_keep_length(dechex($ni),'0',2)); + //echo "
      tmpNi=$tmpNi"; + $tmpInitValue=$tmpInitValue.$tmpNi.'80FD0000000000000000';//Alternative TG =FD RAC=EE + //alert($tmpInitValue); + if($DEBUG) + echo "
      tmpInitValue=$tmpInitValue"; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere AND instanceNo='$tmpInstanceNo' + "; + //echo "$updateSql
      "; + //alert($updateSql); + if($DEBUG) + echo "
      updateSql=$updateSql"; + if($DEBUG) + exit(); + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + if($needNewLinkset!=1){//把switch挂载到Application时根据已有的E1link编号添加对应tg下的E1connect + //查找linksetValue下的E1link + /* + $tmplinkset=strtoupper(omc_keep_length(dechex($lsInstNo),'0',2)); + $tmpObjIdStr='2.5.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $tmpParamTable='OBJ_222.param_99'; + $getSql = " SELECT initValue,instanceNo FROM $tmpParamTable + WHERE $levelWhere AND initValue LIKE '$tmplinkset%' ORDER BY instanceNo "; + $Result = mysqli_query($pubConn,$getSql); + $tmpWhere="(0"; + while($Row = mysqli_fetch_array($Result)){ + $flag = getBitValue($Row[initValue],'06.0-06.0'); + if($flag){ + if($tmpWhere=='(0') + $tmpWhere="(instanceNo='$Row[instanceNo]'"; + else + $tmpWhere=$tmpWhere." OR instanceNo='$Row[instanceNo]'"; + } + } + $tmpWhere=$tmpWhere.")"; + + //添加E1connect + $tmpParamTable='OBJ_322.param_99'; + + $tmpObjIdStr='2.4.1';//interface = isup + $levelWhere = getLevelWhere($tmpObjIdStr); + $updateSql="UPDATE $tmpParamTable SET initValue='01' + WHERE $levelWhere AND $tmpWhere "; + mysqli_query($pubConn,$updateSql); + + $tmpObjIdStr='2.4.2';//TG + $levelWhere = getLevelWhere($tmpObjIdStr); + $setvalue=strtoupper(omc_keep_length(dechex($tgAssigned),'0',2)); + $updateSql="UPDATE $tmpParamTable SET initValue='$setvalue' + WHERE $levelWhere AND $tmpWhere "; + mysqli_query($pubConn,$updateSql); + + $objIdStr='2.4.4'; + $objWhereStr =getLevelWhere($objIdStr); + $setValue = '03'; + $updSql = "UPDATE $tmpParamTable SET initValue = '$setValue' + WHERE $objWhereStr AND $tmpWhere "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + */ + } + if($eleType==0 && $needNewLinkset!=1)//把Application加载到Switch时, change tg=255 to tg=assigned tg; + { + $tmpObjIdStr='2.11'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $tmpParamTable='OBJ_225.param_99'; + + $updEleInfoNoStr = rtrim($updEleInfoNoStr,'-'); + $updEleNoArr = explode('-',$updEleInfoNoStr); + $tgOffset = '3.0-3.7'; + for($i=0; $igetSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows=mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $tmpSetValue = $rows[initValue]; + $tmpTG=strtoupper(omc_keep_length(dechex($tgAssigned),'0',2)); + $tmpSetValue = setBitValue($tmpSetValue,$tgOffset,$tmpTG); + + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpSetValue' + WHERE $levelWhere AND instanceNo='$updEleNoArr[$i]'"; + if(0) echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + } + }//end update element info tg. + }//end Switch + else if($sysType==4)//Application + { + + if(1) + { + //====================close the type selection when sysType=GTT object============== + + $eleType=5; + switch ($eleType) + { + case 0://msc + { + $addcount = 1; + $addssn = '08'; + if($niTypeArr[$ni]==0)//ITU + { + $addnp[0] = '01'; + $TT[0] = '00'; + } + else + { + $addnp[0] = '00'; + $TT[0] = '0E'; + } + break; + } + case 1://hlr + { + $addcount = 3; + $addssn = '06'; + if($niTypeArr[$ni]==0)//ITU + { + $addnp[0] = '01'; + $addnp[1] = '01'; + $addnp[2] = '06'; + $TT[0] = $TT[1] =$TT[2] ='00'; + } + else + { + $addnp[0] = $addnp[1] =$addnp[2] ='00'; + $TT[0] = '0E'; + $TT[1] = '0E'; + $TT[2] = '09'; + } + break; + } + case 2://vlr + { + $addcount = 1; + $addssn = '07'; + if($niTypeArr[$ni]==0)//ITU + { + $addnp[0] = '01'; + $TT[0] = '00'; + } + else + { + $addnp[0] = '00'; + $TT[0] = '0E'; + } + break; + } + case 3://smsc + { + $addcount = 2; + $addssn = '0B'; + if($niTypeArr[$ni]==0)//ITU + { + $addnp[0] = '01'; + $addnp[1] = '01'; + $TT[0] = $TT[1] = '00'; + } + else + { + $addnp[0] = '00'; + $addnp[1] = '00'; + $TT[0] = $TT[1] = '0E'; + } + break; + } + case 4://sgsn + { + $addcount = 1; + $addssn = '00'; + if($niTypeArr[$ni]==0)//ITU + { + $addnp[0] = '01'; + $TT[0] = '00'; + } + else + { + $addnp[0] = '00'; + $TT[0] = '0E'; + } + break; + } + case 5://new + { + $addcount = 2; + $addssn = '06'; + if($niTypeArr[$ni]==0)//ITU + { + $addnp[0] = '01'; + $addnp[1] = '06'; + $TT[0] = $TT[1] = '00'; + } + else + { + $addnp[0] = $addnp[1] = '00'; + $TT[0] = '0E'; + $TT[1] = '09'; + } + break; + } + default: + { + $addcount = 1; + $addssn = '00'; + $addnp[0] = '00'; + break; + } + } + $tmpObjIdStr='2.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_223.param_99'; + $getSql="SELECT $initValue,instanceNo FROM $tmpParamTable + WHERE $levelWhere AND initValue LIKE '00%' + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $n=0; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $tmpInstanceNo=$rows[instanceNo]; + {//set gtt attribution from 2.4 + if($eleType == 5) $bitFlag = 0; + else + { + if($n==0) //添加的第一个gtt为远端号码 + $bitFlag = 1; + else + $bitFlag = 0; + } + $setValue = '00000000000000000000000000000000'; + $tmpEleType = strtoupper(omc_keep_length(dechex($eleType),'0',2)); + $tmpGrpNo=strtoupper(omc_keep_length(dechex($setAppGrp),'0',2)); + $tmpGtFlag = strtoupper(omc_keep_length(dechex($bitFlag),'0',2)); + $setValue = setBitValue($setValue,$offsetAppType,$tmpEleType); + $setValue = setBitValue($setValue,$offsetGrpNo,$tmpGrpNo); + $setValue = setBitValue($setValue,$offsetBitFlag,$tmpGtFlag); + + $tmpEleName = omc_keep_length(toHex($elementName),"0",20,"0"); + $setValue = setBitValue($setValue,'3.0-12.7',$tmpEleName); + + $updSql = "update $tmpParamTable set initValue = '$setValue' where level_1='2' and level_2='4' and instanceNo='$tmpInstanceNo'"; + //mysqli_query($pubConn,$updSql); + //echo mysqli_error($pubConn); + }//end set gtt attribution from 2.4 + + {//add a gtt + $tmpInitValue='01'; + $tmpInitValue=$tmpInitValue.$addnp[$n]; + + $tmpInitValue .= $TT[$n]; // TT + $tmpInitValue=$tmpInitValue.'FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF'; + $tmpNi=strtoupper(omc_keep_length(dechex($ni),'0',2)); + $tmpInitValue=$tmpInitValue.$tmpNi; + $tmpHexValue=strtoupper(omc_keep_length(dechex($dpc),'0',6)); + $tmpInitValue=$tmpInitValue.$tmpHexValue; + $tmpInitValue=$tmpInitValue.$addssn; + $tmpInitValue=$tmpInitValue.'0007000000FFFFFFFFFFFFFFFFFFFF'; + if($DEBUG)echo "
      tmpInitValue=$tmpInitValue"; + if($DEBUG)echo "
      tmpInitValue=$tmpInitValue"; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere AND instanceNo='$tmpInstanceNo' + "; + if($DEBUG) echo "
      updateSql=$updateSql"; + if($DEBUG) exit(); + //mysqli_query($pubConn,$updateSql); + //echo mysqli_error($pubConn); + }//end add gtt + $n++; + if($n%$addcount==0) + break; + } + } + }//end Application + break; + } + default: + break; + }//end switch($sysType) + + if($sysType > 0) + {//update elementInfo + $tmpObjIdStr='2.11'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_225.param_99'; + $getSql="SELECT $initValue,instanceNo FROM $tmpParamTable + WHERE $levelWhere and initValue LIKE '00%' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + $rows=mysqli_fetch_array($result); + $tmpInstanceNo=$rows[instanceNo]; + $tmpSetValue = '010000000000000000000000000000000000000000000000'; + + $typeOffset = '1.0-1.7'; + $sysNoOffset = '2.0-2.3'; + $subSysNoOffset = '2.4-2.7'; + $tgOffset = '3.0-3.7'; + $lsOffset = '4.0-4.7'; + $appTypeOffset = '5.0-5.7'; + $appGrpOffset = '6.0-6.7'; + $nameOffset = '14.0-23.7'; + if($sysType==1)//BSS + $tmpType='01'; + else if($sysType==2)//Peripheral + { + if($eleType==0)//AAS + $tmpType='02'; + else if($eleType==1)//VSS + $tmpType='03'; + else if($eleType==2)//PCR + $tmpType='04'; + else if($eleType==3)//CNF + $tmpType='05'; + else if($eleType==4)//CNF Center + $tmpType='06'; + } + else if($sysType == 3)//switch + { + if($eleType==0)//ss7 switch + $tmpType='10'; + else if($eleType==1)//ISDN switch + $tmpType='11'; + } + else if($sysType == 4) + $tmpType = '12'; + else + $tmpType='00'; + $tmpSetValue = setBitValue($tmpSetValue,$typeOffset,$tmpType); + + $bin_sysNo = omc_keep_length(decbin($systemNo),'0',4); + $tmpSetValue = setBitValue($tmpSetValue,$sysNoOffset,$bin_sysNo); + + $bin_subSysNo = omc_keep_length(decbin($subSysNo),'0',4); + $tmpSetValue = setBitValue($tmpSetValue,$subSysNoOffset,$bin_subSysNo); + if($sysType==4) + { + $bin_appType = omc_keep_length(dechex($eleType),'0',2); + $tmpSetValue = setBitValue($tmpSetValue,$appTypeOffset,$bin_appType); + + $bin_appGrp = omc_keep_length(dechex($setAppGrp),'0',2); + $tmpSetValue = setBitValue($tmpSetValue,$appGrpOffset,$bin_appGrp); + } + if($sysType==4 && $needNewLinkset==1) $tgAssigned = 255; + if($sysType==2 && $useSameCnfLinkset==1) + { + $tgAssigned = $cnfTG; + $lsAssigned = $cnfLS; + } + $tmpTG=strtoupper(omc_keep_length(dechex($tgAssigned),'0',2)); + $tmpSetValue = setBitValue($tmpSetValue,$tgOffset,$tmpTG); + + $tmpLs=strtoupper(omc_keep_length(dechex($lsAssigned),'0',2)); + if(($sysType==3 || $sysType==4) + &&$needNewLinkset != 1) + $tmpLs=strtoupper(omc_keep_length(dechex($lsInstNo),'0',2)); + $tmpSetValue = setBitValue($tmpSetValue,$lsOffset,$tmpLs); + + $tmpName=toHex($elementName); + $tmpName=omc_keep_length($tmpName,'0',20,'0'); + $tmpSetValue = setBitValue($tmpSetValue,$nameOffset,$tmpName); + + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpSetValue' + WHERE $levelWhere AND instanceNo='$tmpInstanceNo'"; + if(0){ + echo "
      updateSql=$updateSql"; + //exit(); + } + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + }//end update elementInfo + //print_r($sysId_arr); + SetParam($sysId_arr); + SaveParam($SaveArr); + + echo "

      Finished!

      "; + echo "
      "; + if($sysType==2 && $eleType==4)//after added cnf center, turn to cnf add page. + { + echo ""; + exit(); + } + echo ""; + //echo "

      $strBack"; + exit(); + } +}//end POST +?> +levelWhere=$levelWhere"; + $localElementParamConfTable='OBJ_223.paramConf'; + for($i=0; $igetSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $localElementDefaultValue[$i]=$rows[initValue]; + } + $localElementParamTable='OBJ_223.param_99'; + $getSql="SELECT $initValue,level_3 FROM $localElementParamTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + while($rows=mysqli_fetch_array($result)) + { + for($i=0;$ilevelWhere=$levelWhere"; + $othersElementParamTable='OBJ_222.param_99'; + $getSql="SELECT $initValue,instanceNo FROM $othersElementParamTable + WHERE $levelWhere "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $lsFlag=getBitValue($rows[initValue],'3.2-3.2');//flag + if($lsFlag==0) + continue; + $i = $rows[instanceNo]; + $lsArr[$i][lsValue] = $rows[initValue]; + $lsArr[$i][dpc]=hexdec(getBitValue($rows[initValue],'0.0-2.7')); + $lsArr[$i][ni]=bindec(getBitValue($rows[initValue],'3.0-3.1')); + $lsArr[$i][isSwitch] = getBitValue($rows[initValue],'17.0-17.0'); + $lsArr[$i][name] = getBitValue($rows[initValue],'7.0-16.7'); + if($lsArr[$i][name]==0) + $lsArr[$i][name]=$rows[instanceNo]; + else + $lsArr[$i][name]=trim(toAscii($lsArr[$i][name])); + } +}//end linkset value + +{//others element + $ElementInfoObjId='2.11'; + $levelWhere = getLevelWhere($ElementInfoObjId); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $ElementInfoParamTable='OBJ_225.param_99'; + $getSql="SELECT $initValue,instanceNo FROM $ElementInfoParamTable + WHERE $levelWhere and initValue LIKE '01%' "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $typeOffset = '1.0-1.7'; + $sysNoOffset = '2.0-2.3'; + $subSysNoOffset = '2.4-2.7'; + $tgOffset = '3.0-3.7'; + $lsOffset = '4.0-4.7'; + $appTypeOffset = '5.0-5.7'; + $appGrpOffset = '6.0-6.7'; + $nameOffset = '14.0-23.7'; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $typeValue=hexdec(getBitValue($rows[initValue],$typeOffset)); + $sysNo = bindec(getBitValue($rows[initValue],$sysNoOffset)); + $subsysNo = bindec(getBitValue($rows[initValue],$subSysNoOffset)); + $tmpSystemNo= $sysNo; + $assignedTg = hexdec(getBitValue($rows[initValue],$tgOffset)); + $assignedls = hexdec(getBitValue($rows[initValue],$lsOffset)); + $appType = hexdec(getBitValue($rows[initValue],$appTypeOffset)); + $appGrp = hexdec(getBitValue($rows[initValue],$appGrpOffset)); + $name = trim(toAscii(getBitValue($rows[initValue],$nameOffset))); + $eleInfoNo = $rows[instanceNo]; + switch($typeValue) + { + case '1'://BSS + $othEleArr[1][0][$tmpSystemNo][extFlg]=1; + break; + case '2'://AAS + $othEleArr[2][0][$sysNo][$subsysNo][extFlg]=1; + break; + case '3'://VSS + $othEleArr[2][1][$sysNo][$subsysNo][extFlg]=1; + break; + case '4'://PCR + $othEleArr[2][2][$sysNo][$subsysNo][extFlg]=1; + break; + case '5'://CNF + { + $othEleArr[2][3][$sysNo][$subsysNo][extFlg]=1; + $cnfTG = $assignedTg; + $cnfLS = $assignedls; + $cnfLsValue = $lsArr[$assignedls][lsValue]; + break; + } + case '6'://CNF Center + { + $othEleArr[2][4][0][0][extFlg]=1; + break; + } + case '16'://SS7 Switch + { + $othEleArr[3][0][$tmpSystemNo][extFlg]=1; + $switchInfoNoArr[$assignedls][eleInfoNoStr] .= $eleInfoNo.'-'; + $switchInfoNoArr[$assignedls][assignedTg] = $assignedTg; + break; + } + case '17'://ISDN Switch + { + $othEleArr[3][1][$tmpSystemNo][extFlg]=1; + break; + } + case '18'://Application + { + $othEleArr[4][$appType][$appGrp][extFlg]=1; + + $AppInfoNoArr[$assignedls][eleInfoNoStr] .= $eleInfoNo.'-'; + $AppInfoNoArr[$assignedls][assignedTg] = $assignedTg; + break; + } + default: + break; + } + } + $lsNum = 128; + $sno=$ano=0; + for($i=0; $i< $lsNum; $i++) + { + if(isset($switchInfoNoArr[$i][eleInfoNoStr])) + { + $switchLSArr[$sno][lsValue]=$lsArr[$i][lsValue]; + $switchLSArr[$sno][lsInstNo]=$i; + $switchLSArr[$sno][dpc]=$lsArr[$i][dpc]; + $switchLSArr[$sno][ni]=$lsArr[$i][ni]; + $switchLSArr[$sno][name]=$lsArr[$i][name]; + $switchLSArr[$sno][eleInfoNoStr]=$AppInfoNoArr[$i][eleInfoNoStr]; + $switchLSArr[$sno][assignedTg]=$AppInfoNoArr[$i][assignedTg]; + $sno++; + } + if(isset($AppInfoNoArr[$i][eleInfoNoStr])) + { + $appLSArr[$ano][lsValue]=$lsArr[$i][lsValue]; + $appLSArr[$ano][lsInstNo]=$i; + $appLSArr[$ano][dpc]=$lsArr[$i][dpc]; + $appLSArr[$ano][ni]=$lsArr[$i][ni]; + $appLSArr[$ano][isSwitch]=$lsArr[$i][isSwitch]; + $appLSArr[$ano][name]=$lsArr[$i][name]; + $appLSArr[$ano][eleInfoNoStr]=$AppInfoNoArr[$i][eleInfoNoStr]; + $appLSArr[$ano][assignedTg]=$AppInfoNoArr[$i][assignedTg]; + $ano++; + } + } + + $sno=0; + $ano=0; + for($i=0; $i + + + + +"> +"; +echo ""; +echo ""; +echo "Configuration > Network > Add Element"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo " "; +echo "$strBack"; +echo ""; +echo ""; +?> + +"; +echo ""; +echo ""; +echo ""; + +if($DEBUG) + echo "
      sysType=$sysType"; +if(!isset($sysType)||$sysType==999) + exit(); + +switch($sysType) +{ + case 0 ://local element + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo ""; +if($sysType==1) + $eleType=0; +if((!isset($eleType)||$eleType==999) + &&($sysType==0||$sysType==2||$sysType==3||$sysType==4)) + exit(); + + +if($sysType==0) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + } + +} +else if($sysType==3) +{ + if($eleType==1)//ISDN switch + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo ""; + +if(0) +{ + echo "
      sysType:$sysType
      eleType:$eleType
      systemNo:$tmp_systemNo
      subSysNo:$subSysNo"; + echo "
      appType:$appType
      setAppGrp:$setAppGrp
      slcLsNo:$slcLsNo"; +} +if((!isset($systemNo)||$systemNo==999)&&$sysType!=0) + exit(); + + + //==========================get the disable Alinkset instanceNo======================== + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=1 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $disable_linkSet_num=0; + if(!$rows) + exit("No record"); + + do{ + + $Flag=getBitValue($rows[initValue],'3.2-3.2')+0; + if($Flag==0) + { + $aa=$rows[instanceNo]; + //alert($aa." no use"); + $disable_linkset[$disable_linkSet_num]=$aa; + $disable_linkSet_num++; + } + }while($rows=mysqli_fetch_array($result)); + //===========================get the disable trunk group==================================== + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $disable_trunk_num=0; + if(!$rows) + exit("No record"); + + do{ + if($rows[instanceNo]==250||$rows[instanceNo]==251||$rows[instanceNo]==252||$rows[instanceNo]==253||$rows[instanceNo]==254||$rows[instanceNo]==255) + continue; + $Flag=getBitValue($rows[initValue],'4.0-4.0')+0; + if($Flag==0) + { + $aa=$rows[instanceNo]; + //alert($aa." no use"); + $disable_trunk[$disable_trunk_num]=$aa; + $disable_trunk_num++; + } + }while($rows=mysqli_fetch_array($result)); +//==============================end trunk and linkset==================================== + + +if($sysType==0) +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +elseif($sysType<3) +{ + //alert("hi"); + + //=========================add linkset selection============================ + echo ""; + echo ""; + echo ""; + echo ""; + //=========================add trunk group========================================== + echo ""; + echo ""; + echo ""; + echo ""; + + if($sysType==2) + { + if($eleType==3 && $othEleArr[2][4][0][0][extFlg]!=1) //cnf.( if cnf center have been added at first?) + { + echo ""; + } + } + for($i=0; $i<4; $i++) + { + if($othEleArr[2][3][0][$i][extFlg]==1) + { + $cnfExistFlag = 1; + break; + } + } + if($sysType==2 && $eleType==3 && $cnfExistFlag==1) + { + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + if($sysType == 1 && $needBssIp==1) //bss ip + { + echo ""; + echo ""; + echo ""; + echo ""; + }//end bss ip + } +} +elseif($sysType==3||$sysType==4) +{ + if($sysType==3 && $eleType==1)//ISDN switch + { + + + + + //=========================add linkset selection============================ + echo ""; + echo ""; + echo ""; + echo ""; + //=========================add trunk group========================================== + if($sysType==3) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + + + + + echo ""; + echo ""; + echo ""; + echo ""; + } + else if(!isset($slcLsNo) || $slcLsNo==999) exit; + else if($slcLsNo==888)//new + { + //=========================add linkset selection============================ + echo ""; + echo ""; + echo ""; + echo ""; + //=========================add trunk group========================================== + if($sysType==3) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + /* + if($sysType==3) + alert("ss7 new"); + if($sysType==4) + alert("gtt new"); + */ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + } + else + { + if($sysType==3) + { + /* + echo "\n"; + */ + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + if($sysType==4) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + else if($sysType==3) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + } +} +echo "
      System"; +$width="20%"; +echo ""; +echo "
      Element"; + echo ""; + + break; + } + case 1 ://bss + { + echo "
      Element"; + echo " "; + echo ""; + break; + } + case 2 ://peripheral + { + echo "
      Type"; + echo ""; + break; + } + case 3 ://switch + { + echo "
      Type"; + echo ""; + break; + } + case 4 ://Application + { + //===close the type selection when the sysType is GTT object================ + echo "
      Type"; + echo ""; + break; + } +} +echo "
      System No."; + echo " "; + echo ""; +} +else if($sysType==1) +{ + + echo "
      System No."; + for($i=0;$i<128;$i++) + { + if($othEleArr[$sysType][$eleType][$i][extFlg]!=1) + { + echo "$i"; + echo ""; + $systemNo =$i; + break; + } + } +} +else if($sysType==2) +{ + switch($eleType) + { + case 0 : //AAS + + $elementsNum=2; + $sysNum=2; + $subSysNum=1; + break; + case 1 : //vss + + $elementsNum=10; + $sysNum=10; + $subSysNum=1; + break; + case 2 ://pcr + + $elementsNum=32; + $sysNum=2; + $subSysNum=16; + break; + case 3 ://cnf + + $elementsNum=4; + $sysNum=1; + $subSysNum=4; + break; + case 4 ://cnf center + + $elementsNum=1; + $sysNum=1; + $subSysNum=1; + break; + } + $allExist=1; + for($i=0; $i< $sysNum; $i++) + { + for($j=0; $j< $subSysNum; $j++) + { + if($othEleArr[$sysType][$eleType][$i][$j][extFlg]!=1) + { + $allExist=0; + break; + } + } + } + if($allExist) + { + echo ""; + exit; + } + if($eleType==4) + { + echo ""; + echo ""; + $systemNo=$subSysNo=0; + } + else + { + echo "
      sysNo."; + echo "
      subSysNo."; + echo "
      System No."; + for($i=0;$i<32;$i++) + { + if($othEleArr[$systemType][$eleType][$i][extFlg]!=1) + { + echo "$i"; + echo ""; + $systemNo =$i; + break; + } + } + } + else //SS7 switch + { + + echo "
      Linkset"; + for($i=0; $i<128; $i++) + if($othEleArr[3][$eleType][$i][extFlg]!=1) + { + $tmp_systemNo = $i; + break; + } + echo ""; + echo ""; + $systemNo = $tmp_systemNo; + $subSysNo = 0; + + echo ""; + } +} +else if($sysType==4) +{ + echo "
      Linkset"; + for($i=0; $i< 256; $i++) + if($othEleArr[4][$eleType][$i][extFlg]!=1) + { + echo ""; + $setAppGrp = $i; + $tmp_systemNo = $i; + break; + } + echo ""; + echo ""; + $systemNo = $tmp_systemNo; + $subSysNo = 0; + + echo ""; +} +echo "
      Network Indicator"; + echo ""; + echo "
      Linkset no."; + echo ""; + echo "
      Trunk group no."; + echo ""; + echo "
      Element Name"; + echo ""; + echo "
      Network Indicator"; + echo ""; + echo "
      Element Name"; + if($sysType==2 && $eleType==4) + { + echo ""; + echo ""; + } + else + echo ""; + echo "
      DPC"; + echo ""; + echo "
      IP"; + echo ""; + echo "
      Linkset no."; + echo ""; + echo "
      Trunk group no."; + echo ""; + echo "
      Element Name"; + echo ""; + echo "
      Linkset no."; + echo ""; + echo "
      Trunk group no."; + echo ""; + echo "
      Element Name"; + echo ""; + echo "
      Network Indicator"; + echo ""; + echo "
      DPC"; + echo ""; + echo "
      Trunk group no."; + echo ""; + echo "
      Element Name"; + echo ""; + echo "
      "; +?> +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo ""; +echo " "; +echo "
      "; +?> + + + diff --git a/wxc2_omc/element/overview/bssReboot b/wxc2_omc/element/overview/bssReboot new file mode 100755 index 0000000..d51dfa5 --- /dev/null +++ b/wxc2_omc/element/overview/bssReboot @@ -0,0 +1,30 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="$1" + +inputfile="inabc" +outputfile="out.log" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & + +#tail -f $outputfile & + +sleep 2; echo "reboot" >>$inputfile +sleep 2; echo "logout" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + +#ps -ef | grep telnet | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh +#ps -ef | grep tail | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh diff --git a/wxc2_omc/element/overview/bsscommRestart b/wxc2_omc/element/overview/bsscommRestart new file mode 100755 index 0000000..8b8fbcb --- /dev/null +++ b/wxc2_omc/element/overview/bsscommRestart @@ -0,0 +1,40 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="localhost" +inp1="ems " +inp2="Ems123! " + +inputfile="inabc" +outputfile="out.log" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & +sleep 2; echo $inp1 >>$inputfile +sleep 2; echo $inp2 >>$inputfile + +#tail -f $outputfile & + +sleep 3; echo "su -" >>$inputfile +sleep 2; echo "rootaa" >>$inputfile +sleep 2; echo "kill -9 `pidof bsscomm`" >>$inputfile +sleep 2; echo "kill -9 `pidof alive`" >>$inputfile +sleep 2; echo "/usr/local/omc/bin/bsscomm &" >>$inputfile +sleep 2; echo "/usr/local/omc/bin/alive &" >>$inputfile +sleep 2; echo "exit" >>$inputfile +sleep 2; echo "exit" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + +#ps -ef | grep telnet | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh +#ps -ef | grep tail | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh diff --git a/wxc2_omc/element/overview/delElement.php b/wxc2_omc/element/overview/delElement.php new file mode 100755 index 0000000..d2214da --- /dev/null +++ b/wxc2_omc/element/overview/delElement.php @@ -0,0 +1,1764 @@ +"; + //========get the default value of Prefix Assignment,Prefix Attributes,Assign TG to Prefix + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=1 and level_3=1 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $prefix_assignment_default_value=$rows[initValue]; + + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=1 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $prefix_attributes_default_value=$rows[initValue]; + + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=1 and level_3=3 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $prefix_tg_default_value=$rows[initValue]; + + //========get the prefix instanceNo by trunk group======= + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=3 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + do{ + + $prefix_tg_no=hexdec(getBitValue($rows[initValue],'0.0-0.7'))+0; + if($prefix_tg_no==$tg) + { + $prefix_instance_no=$rows[instanceNo]; + //================delete the prefix in Prefix Assignment========= + $database="OBJ_322"; + $update_sql="UPDATE param_99 SET + initValue='$prefix_assignment_default_value' + WHERE level_1=2 AND level_2=1 AND level_3=1 AND instanceNo='$prefix_instance_no' + "; + //echo "


      $update_sql
      "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + //================delete the prefix in Prefix Attributes========= + $database="OBJ_322"; + $update_sql="UPDATE param_99 SET + initValue='$prefix_attributes_default_value' + WHERE level_1=2 AND level_2=1 AND level_3=2 AND instanceNo='$prefix_instance_no' + "; + //echo "
      $update_sql
      "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + //================delete the prefix in Assign TG to Prefix========= + $database="OBJ_322"; + $update_sql="UPDATE param_99 SET + initValue='$prefix_tg_default_value' + WHERE level_1=2 AND level_2=1 AND level_3=3 AND instanceNo='$prefix_instance_no' + "; + //echo "
      $update_sql
      "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + } + //echo "Flag=$Flag
      "; + }while($rows=mysqli_fetch_array($result)); + + + + + + //echo "oidSysCommSend
      "; + $tmpSysId ='322_99_99'; + + $tmpObjIdStr='2.1.1'; + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + $commArr = $commArr.$commIdStr; + + $tmpObjIdStr='2.1.2'; + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + $commArr = $commArr.$commIdStr; + + $tmpObjIdStr='2.1.3'; + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + $commArr = $commArr.$commIdStr; + + + $SaveArrt=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'),//SCCP + ); + //echo "SaveParam
      "; + SaveParam($SaveArrt); + + if($DEBUG) echo "
      $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + + +} + + + + +//===============This function use to delete a prefix manipulation when delete an ISDN===== + +function delete_prefix_manipulation($tg) +{ + global $nSetComm; + $tg=$tg+0; + + //===============get the defaule value============================== + $database="OBJ_225"; + $sql="select initValue from paramConf where level_1=2 and level_2=8 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $prefix_manipulation_default_value=$rows[initValue]; + + //==============get the element title by tg============== + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + + do + { + $tmp_tg_no=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; + if($tmp_tg_no==$tg) + { + + $element_title=getBitValue($rows[initValue],'14.0-23.7'); + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($element_title,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $element_title=trim($temp); + + break; + } + }while($rows=mysqli_fetch_array($result)); + + + //=======delete the prefix manipulation from prefix manipulation table by element title============ + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=8 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + do + { + $this_title=getBitValue($rows[initValue],'35.0-42.7'); + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($this_title,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $this_title=trim($temp); + + if(strcmp($this_title,$element_title)==0) + { + $gtt_instance_no=$rows[instanceNo]; + //=========delete in the prefix manipulation table======================= + $database="OBJ_225"; + $update_sql="UPDATE param_99 SET + initValue='$prefix_manipulation_default_value' + WHERE level_1=2 AND level_2=8 AND instanceNo='$gtt_instance_no' + "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + + } + }while($rows=mysqli_fetch_array($result)); + + + $tmpSysId ='225_99_99'; + + $tmpObjIdStr='2.8'; + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + $commArr = $commArr.$commIdStr; + + $SaveArrt=array( + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99','selectsysid'=>'-1'),//SCCP + ); + //echo "SaveParam
      "; + SaveParam($SaveArrt); + + if($DEBUG) echo "
      $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } +} + + + +//======================hide============================ +function deletePrefix($tg) +{ + + global $pubDb; + $tmpObjIdStr='2.1.3'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + while($rows=mysqli_fetch_array($result)) + { + $tmpTg = hexdec($rows[initValue]); + if($tmpTg == $tg) + { + if(!isset($tmpswInstanceNo)) + { + $tmpswInstanceNo=$rows[instanceNo]; + $swprefixArr=$rows[instanceNo]; + } + else + { + $swprefixArr=$swprefixArr.'.'.$rows[instanceNo]; + } + } + } + + //delete prefix + $tmpParamConfTable='OBJ_322.paramConf'; + $tmpObjIdStr='2.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue,level_3 FROM $tmpParamConfTable + WHERE $levelWhere AND (level_3='1' OR level_3='2' OR level_3='3') ORDER BY level_3 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $i=0; + unset($tmpDefaultValueArr); + while($rows=mysqli_fetch_array($result)){ + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $tmpDefaultValueArr[$i][initValue]=$rows[initValue]; + //echo "
      level_3=$rows[level_3]"; + $tmpDefaultValueArr[$i][level_3]=$rows[level_3]; + $i++; + } + if($DEBUG) echo "
      $aasprefixArr
      "; + if(!isset($tmpswInstanceNo)){ + $tmpInstanceNoArr=-1; + }else{ + $tmpInstanceNoArr=explode(".",$swprefixArr); + } + + for($i=0;$iupdateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='322_99_99'; + $tmpObjIdStr='2.1.'.$tmpDefaultValueArr[$i][level_3]; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + + $SaveArrt=array( + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'322_99_99'),//SCCP + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99'),//mtp3 + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99'),//xapp + ); + SaveParam($SaveArrt); + + if($DEBUG) echo "
      $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** + } +} + + + + +$SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'322_99_99'),//SCCP + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99'),//mtp3 + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99'),//xapp + ); + //SaveParam($SaveArr); + +$localElementArr=array( + array('sysTypeName'=>'MSC', 'sysTypeNo'=>'320','sysTypeSSN'=>'8','GT'=>'--','existFlag'=>'0'), + array('sysTypeName'=>'VLR', 'sysTypeNo'=>'325','sysTypeSSN'=>'7','GT'=>'--','existFlag'=>'0'), + array('sysTypeName'=>'HLR', 'sysTypeNo'=>'330','sysTypeSSN'=>'6','GT'=>'--','existFlag'=>'0'), + array('sysTypeName'=>'AC', 'sysTypeNo'=>'340','sysTypeSSN'=>'10','GT'=>'--','existFlag'=>'0'), + array('sysTypeName'=>'SMSC','sysTypeNo'=>'350','sysTypeSSN'=>'11','GT'=>'--','existFlag'=>'0'), + array('sysTypeName'=>'PPS', 'sysTypeNo'=>'360','sysTypeSSN'=>'147','GT'=>'--','existFlag'=>'0') +); + + + + + +//========================================================== +//读取数据 +//========================================================== +getElementInfo($infoNo,$elementInfoArr); +$this_sysNo = $TypeNo = $elementInfoArr[sysNo]; +$eleName = $elementInfoArr[eleName]; +$tg = $elementInfoArr[tg]; + +getExistElements($existElementArr); +if(@array_search('500', $existElementArr)==TRUE)//BSS + $needBssIp = 1; +{//initial param + //填充oid + switch($systemNo) + { + case 1://bss + { + $devicename = 'BSC'; + $oidsysarr=array( + array('oid'=>'2.2.6', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2.7', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1') + ); + break; + } + case 2://peripheral + { + $devicename = 'Peripheral'; + $oidsysarr=array( + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.4.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1') + ); + break; + } + case 3://switch + { + $devicename = 'Switch'; + $oidsysarr=array( + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1') + ); + break; + } + case 4://application + { + $devicename = $strGttObjects; + $oidsysarr=array( + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.12','sysid'=>'330_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1') + ); + break; + } + default: + break; + } + echo "
      Deleting an element ...
      "; + if($systemNo==1 && $needBssIp==1)//delete BSS sysinfo & OMCR_BSSTABLE + { + $sysInfoTable = "OMC_PUB.sysInfo"; + $tmpSysType = 500; + $tmpSubSysNo = 0; + $delSql = "DELETE FROM $sysInfoTable WHERE sysTypeNo='$tmpSysType' AND sysNo = '$sysNo' + AND subSysNo = '$tmpSubSysNo'"; + if($DEBUG) echo "
      delSql = $delSql"; + mysqli_query($pubConn,$delSql); + + /* + //OMCR_BSSTABLE + $bssTable = "BssOmcDb.OMCR_BSSTABLE"; + $updSql = "update $bssTable set ip='',name='' where bssid='$sysNo'"; + if(0) echo "
      updSql:$updSql"; + mysqli_query($pubConn,$updSql); + */ + $bssTable = "BssOmcDb.OMCR_BSSTABLE"; + $selSql = "select ip from $bssTable where bssid='$sysNo'"; + $result = mysqli_query($pubConn,$selSql); + if($row = mysqli_fetch_array($result)) + { + $bssIP = $row[ip]; + $bssid=$sysNo; + if(strlen($bssIP)>0) + sendBssCommand($bssid,$bssIP,'',0); + } + } //end delete BSS sysinfo & OMCR_BSSTABLE + + //get填充oid参数 + + if($systemNo!=0){ + GetParam($oidsysarr); + if($DEBUG) echo "
      delete"; + } + +} + +?> +systemNo=$systemNo;elementNo=$elementNo;sysNo=$sysNo;linkset=$linkset;otherVar_1=$otherVar_1;otherVar_2=$otherVar_2;"; + + + + +//********************************************************** +//Set parameters +if($systemNo==0)//local element +{ + //local element + //case (elementNo ){... } + + $localElementObjIdStr='2.1'; + $levelWhere = getLevelWhere($localElementObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $localElementParamConfTable='OBJ_223.paramConf'; + $getSql="SELECT initValue FROM $localElementParamConfTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $localElementDefaultValue=$rows[initValue]; + + $updateSql="UPDATE OBJ_223.param_99 SET + initValue='$localElementDefaultValue' + WHERE $levelWhere AND level_3='{$localElementArr[$elementNo][sysTypeSSN]}' + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + $result =mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='223_99_99'; + $tmpObjIdStr='2.1'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** + +} +else +{//others element + //delete linkset + { + $othersElementObjIdStr='2.4.1'; + $levelWhere = getLevelWhere($othersElementObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $getSql="SELECT initValue FROM OBJ_222.param_99 + WHERE $levelWhere AND instanceNo='$linkset' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $tmpInitValue=$rows[initValue]; + $TypeIn = hexdec(getBitValue($tmpInitValue,'4.0-4.7')); + $tmpDecValue=hexdec(getBitValue($tmpInitValue,'6.0-6.7'));//total elements in the linkset(when system type is 16) + $tmpDecValueForRouting=$tmpDecValue; + $DPC = hexdec(getBitValue($tmpInitValue,'0.0-2.7')); + $NI = bindec(getBitValue($tmpInitValue,'3.0-3.1')); + if($tmpDecValue<=1) + { + $othEleParConfTab='OBJ_222.paramConf'; + $getSql="SELECT initValue FROM $othEleParConfTab + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $othEleDefVal=$rows[initValue]; + + if($DEBUG) + echo "
      updateSql=$updateSql"; + if($TypeIn==5)//delete cnfcenter + { + $tmpSelSql = "select initValue,instanceNo from OBJ_222.param_99 where $levelWhere "; + $tmpResult = @mysqli_query($pubConn,$tmpSelSql); + while($tmpRows = mysqli_fetch_array($tmpResult)) + { + $tmpTypeIn = hexdec(getBitValue($tmpRows[initValue],'4.0-4.7')); + if($tmpTypeIn==6)//cnfcenter + { + $updateSql="UPDATE OBJ_222.param_99 SET + initValue='$othEleDefVal' + WHERE $levelWhere AND (instanceNo='$linkset' or instanceNo='$tmpRows[instanceNo]') + "; + break; + } + } + } + else + { + $updateSql="UPDATE OBJ_222.param_99 SET + initValue='$othEleDefVal' + WHERE $levelWhere AND instanceNo='$linkset' + "; + } + } + else + { + $tmpDecValue=$tmpDecValue-1; + $tmpHexValue=omc_keep_length(dechex($tmpDecValue),'0',2); + $tmpInitValue=setBitValue($tmpInitValue,'6.0-6.7',$tmpHexValue); + if($systemNo==3)//set isSwitch flag 0. + $tmpInitValue=setBitValue($tmpInitValue,'17.0-17.0',0); + $updateSql="UPDATE OBJ_222.param_99 SET + initValue='$tmpInitValue' + WHERE $levelWhere AND instanceNo='$linkset' + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + } + $result =mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='222_99_99'; + $tmpObjIdStr='2.4.1'; + + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1') + { + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** + } + + if($tmpDecValueForRouting<=1) + { + //delete Routing + { + $tmpParamTable='OBJ_222.param_99'; + $tmpObjIdStr='2.6'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue,instanceNo,level_3 FROM $tmpParamTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $routeflag=0; + while($rows=mysqli_fetch_array($result)) + { + $unitValue=hexdec(getBitValue($rows[initValue],'3.0-3.7'));//normal linkset + if($unitValue==$linkset) + { + $routeflag=1; + break; + } + } + if($routeflag) + { + //echo "
      instanceNo=$rows[instanceNo]"; + $tmpInstanceNo=$rows[instanceNo]; + $tmpLevel_3=$rows[level_3]; + + $updateSql="UPDATE $tmpParamTable SET initValue='0000008080' + WHERE $levelWhere AND level_3='$tmpLevel_3' AND instanceNo='$tmpInstanceNo' + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + $tmpSysId ='222_99_99'; + $tmpObjIdStr='2.6'.'.'.$tmpLevel_3; + if($DEBUG) echo "
      tmpObjIdStr=$tmpObjIdStr"; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** + } + } + + //delete link + { + $tmpObjIdStr='2.5.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamConfTable='OBJ_222.paramConf'; + $getSql="SELECT initValue FROM $tmpParamConfTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $tmpDefaultValue=$rows[initValue]; + + $tmpLinksetValue=strtoupper(omc_keep_length(dechex($linkset),0,2)); + $tmpWhere=initValue." LIKE "."'$tmpLinksetValue"."%'"; + + $updateSql="UPDATE OBJ_222.param_99 SET + initValue='$tmpDefaultValue',initValue='$tmpDefaultValue' + WHERE $levelWhere AND $tmpWhere + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + $result =mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='222_99_99'; + $tmpObjIdStr='2.5.1'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1') + { + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** + } + } + + if($systemNo<4)// delete tg and e1 + { + //delete tg + $tmpObjIdStr='2.1.4'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamConfTable='OBJ_322.paramConf'; + $getSql="SELECT initValue FROM $tmpParamConfTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $tmpDefaultValue=$rows[initValue]; + + $updateSql="UPDATE OBJ_322.param_99 SET + initValue='$tmpDefaultValue' + WHERE $levelWhere AND instanceNo='$otherVar_1' + "; + if($elementNo==3)//cnf + { + //echo "
      otherVar_1:------>$otherVar_1"; + $tmpArr = explode('.',$otherVar_1); + if(sizeof($tmpArr)==3)//the last one CNF + { + $instNo1 = $tmpArr[0]; + $instNo2 = $tmpArr[1]; + $cnfcenterInfoNo = $tmpArr[2]; + $updateSql="UPDATE OBJ_322.param_99 SET + initValue='$tmpDefaultValue' + WHERE $levelWhere AND (instanceNo='$instNo1' or instanceNo='$instNo2') + "; + } + } + if(0) + { + echo "
      updateSql=$updateSql"; + exit; + } + $result =mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='322_99_99'; + $tmpObjIdStr='2.1.4'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** + + + //delete the e1 parameters + { + + + + + + + $tmpParamConfTable='OBJ_322.paramConf'; + $tmpObjIdStr='2.4'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue FROM $tmpParamConfTable + WHERE $levelWhere AND (level_3='1' OR level_3='2' OR level_3='3' OR level_3='4') ORDER BY level_3 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $i=1; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $tmpDefaultValueArr[$i]=$rows[initValue]; + if($DEBUG)echo "
      value=$tmpDefaultValueArr[$i]"; + $i++; + } + + + + $tmpTgValue=strtoupper(omc_keep_length(dechex($otherVar_1),0,2)); + + $getSql="SELECT instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere AND level_3='2' AND initValue='$tmpTgValue' + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG) echo "
      instanceNo=$rows[instanceNo]"; + for($i=1;$i<=4;$i++) + { + $updateSql="UPDATE OBJ_322.param_99 SET + initValue='$tmpDefaultValueArr[$i]' + WHERE $levelWhere AND level_3='$i' AND instanceNo='$rows[instanceNo]' + "; + if($DEBUG)echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + } + } + + + + + + + + + /* + //=============get the default value=========================== + //=====port interface + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=4 and level_3=1 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $port_interface_default_initValue=$rows[initValue]; + + echo "\n"; + + //=====Assign TG to port + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=4 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $tg_port_default_initValue=$rows[initValue]; + echo "\n"; + //=====CIC of port + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=4 and level_3=3 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $cic_port_default_initValue=$rows[initValue]; + echo "\n"; + //======port flag + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=4 and level_3=4 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $flag_port_default_initValue=$rows[initValue]; + echo "\n"; + + //======find the ports by trunk group no($otherVar_1)============ + $this_trunk_no=$otherVar_1+0; + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=3 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + do{ + //$initV=$rows[initValue]; + $tg_tmp=hexdec($rows[initValue])+0; + + //fint the ports of the trunk group + if($this_trunk_no==$tg_tmp) + { + $port_instance_no=$rows[instanceNo]; + //=======delete the port interface to default value + $database="OBJ_322"; + $update_sql="UPDATE param_99 SET + initValue='$port_interface_default_initValue' + WHERE level_1=2 AND level_2=4 AND level_3=1 AND instanceNo='$port_instance_no' + "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + //=======delete the assign tg to port table + $database="OBJ_322"; + $update_sql="UPDATE param_99 SET + initValue='$tg_port_default_initValue' + WHERE level_1=2 AND level_2=4 AND level_3=2 AND instanceNo='$port_instance_no' + "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + //=======delete the cic of port + $database="OBJ_322"; + $update_sql="UPDATE param_99 SET + initValue='$cic_port_default_initValue' + WHERE level_1=2 AND level_2=4 AND level_3=3 AND instanceNo='$port_instance_no' + "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + //=======delete the port flag + $database="OBJ_322"; + $update_sql="UPDATE param_99 SET + initValue='$flag_port_default_initValue' + WHERE level_1=2 AND level_2=4 AND level_3=4 AND instanceNo='$port_instance_no' + "; + mysqli_query($pubConn,$update_sql); + echo mysqli_error($pubConn); + } + + }while($rows=mysqli_fetch_array($result)); + */ + + }//end delete e1 + + $tmpSysId ='322_99_99'; + $tmpObjIdStr='2.4'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + } + switch($systemNo) + { + case 1://BSC + { + //find bts + $tmpTgValue=strtoupper(omc_keep_length(dechex($otherVar_1),0,2)); + $tmpWhere=initValue." LIKE '01".$tmpTgValue."%'"; + $tmpObjIdStr='2.2.6'; + $levelWhere = getLevelWhere($tmpObjIdStr); + //get default value. + $getSql = "select initValue from OBJ_322.paramConf where $levelWhere "; + $result = mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + $defValue = $rows[initValue]; + + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere AND $tmpWhere + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + while($rows=mysqli_fetch_array($result))//2006-04-14should be "while" -> "if", but when tg=0,lac=0, there will be very nums get. + { + $lacValue=hexdec(getBitValue($rows[initValue],'2.0-3.7')); + if($lacValue==0) continue; //add by arwean , lac should not be zero. + $updateSql="update OBJ_322.param_99 set initValue='$defValue' + WHERE $levelWhere AND instanceNo='$rows[instanceNo]' + "; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + //delete cells through the same Lac. + $tmpObjIdStr='2.2.7'; + $levelWhere = getLevelWhere($tmpObjIdStr); + //get default value. + $getSql = "select initValue from OBJ_322.paramConf where $levelWhere "; + $result = mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + $defCellValue = $rows[initValue]; + + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere and initValue!='$defValue' + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + while($rows=mysqli_fetch_array($result)) + { + if($lacValue==hexdec(getBitValue($rows[initValue],'1.0-2.7'))) + { + $delPrefixNo = hexdec(getBitValue($rows[initValue],'5.0-5.7')); + + $updateSql = "update OBJ_322.param_99 set initValue='$defCellValue' + where $levelWhere and instanceNo='$rows[instanceNo]' "; + mysqli_query($pubConn,$updateSql); + } + } + }//end while + { + $tmpSysId ='322_99_99'; + $tmpObjIdStr='2.2'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1') + { + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + } + {//delete prefix not used by any BTS + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM OBJ_322.param_99 WHERE $objWhereStr ORDER BY instanceNo"; + if($DEBUG) echo "
      $defSql"; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $offset_ton_in = "0.0-0.3"; + $offset_ton_out="0.4-0.7"; + + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=hexdec(getBitValue($row[initValue],$offset_enable)); + $prefix_calltype=hexdec(getBitValue($row[initValue],$offset_calltype)); + if($prefix_enable && $prefix_calltype==1)//enable,Emergency + { + $delPrefixNo=$row[instanceNo]; + + $paramSql = " SELECT initValue FROM OBJ_322.param_99 + WHERE $levelWhere and initValue!='$defCellValue'"; + if($DEBUG)echo "
      paramSql:$paramSql"; + $delPreResult = mysqli_query($pubConn,$paramSql); + $otherUsed=0; + while($delPreRow = mysqli_fetch_array($delPreResult)) + { + $prefixNo=hexdec(getBitValue($delPreRow[initValue],'5.0-5.7')); + if($prefixNo==$delPrefixNo) + { + $otherUsed=1; + break; + } + } + if($otherUsed==0)//delete $delPrefixNo. + { + $tmpParamConfTable='OBJ_322.paramConf'; + $tmpObjIdStr='2.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue,level_3 FROM $tmpParamConfTable + WHERE $levelWhere AND (level_3='1' OR level_3='2' OR level_3='3') ORDER BY level_3 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $delPreResult =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $i=0; + unset($tmpDefaultValueArr); + while($rows=mysqli_fetch_array($delPreResult)) + { + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $tmpDefaultValueArr[$i][initValue]=$rows[initValue]; + //echo "
      level_3=$rows[level_3]"; + $tmpDefaultValueArr[$i][level_3]=$rows[level_3]; + $i++; + } + if($DEBUG) echo "
      $aasprefixArr
      "; + + for($i=0;$iupdateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='322_99_99'; + $tmpObjIdStr='2.1.'.$tmpDefaultValueArr[$i][level_3]; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($DEBUG) echo "
      $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + } + } + }//end if enable,Emergency + }//end while + }//end delete prefix + break; + } + case 2://peripheral + { + //VSS + if($elementNo==1)//VSS + { + + + + + //InitialAAS($sysNo); + //delete gtt table + { + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_99'; + $tmpConf = 'paramConf'; + $oidstr = '2.2'; + $objWhereStr = getLevelWhere($oidstr); + + $defSql = "select initValue from $tmpConf where $objWhereStr"; + $defResult = mysqli_query($pubConn,$defSql); + $defRows = mysqli_fetch_array($defResult); + $tmpDefValue = $defRows[initValue]; + + $getSql="SELECT instanceNo,initValue FROM $tmpTable WHERE $objWhereStr AND initValue LIKE '01%' "; + if(0) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + while($rows =mysqli_fetch_array($result)) + { + $tmpDpc = hexdec(getBitValue($rows[initValue],'24.0-26.7')); + $tmpSSN = hexdec(getBitValue($rows[initValue],'27.0-27.7')); + $tmpNi = hexdec(getBitValue($rows[initValue],'23.0-23.7')); + if( $tmpDpc==$DPC && $tmpNi == $NI) + { + //echo "
      $tmpStartMSISDN
      $MSISDN_old"; + $tmpInstanceNo = $rows[instanceNo]; + //echo "
      tmpInstanceNo: $tmpInstanceNo"; + $updSql = "update $tmpTable set initValue='$tmpDefValue' + where $objWhereStr and instanceNo='$tmpInstanceNo'"; + if(0) echo "
      updSql:$updSql"; + mysqli_query($pubConn,$updSql); + //break; + } + //echo "
      $tmpStartMSISDN
      $MSISDN_old
      "; + } + }//end delete gtt table + } + if($elementNo==2)//pcr + ; + if($elementNo==3)//cnf + ; + //find prefix + $tmpObjIdStr='2.1.3'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + while($rows=mysqli_fetch_array($result)) + { + $tmpValue=hexdec($rows[initValue]); + //echo "
      tmpValue=$tmpValue"; + if($tmpValue==$otherVar_1) + { + //echo "
      instance=$rows[instanceNo]"; + //echo "
      initValue=$rows[initValue]"; + if(!isset($tmpaasInstanceNo)) + { + $tmpaasInstanceNo=$rows[instanceNo]; + $aasprefixArr=$rows[instanceNo]; + } + else + { + $aasprefixArr=$aasprefixArr.'.'.$rows[instanceNo]; + } + } + } + + //delete prefix + $tmpParamConfTable='OBJ_322.paramConf'; + $tmpObjIdStr='2.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue,level_3 FROM $tmpParamConfTable + WHERE $levelWhere AND (level_3='1' OR level_3='2' OR level_3='3') ORDER BY level_3 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $i=0; + unset($tmpDefaultValueArr); + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $tmpDefaultValueArr[$i][initValue]=$rows[initValue]; + //echo "
      level_3=$rows[level_3]"; + $tmpDefaultValueArr[$i][level_3]=$rows[level_3]; + $i++; + } + if($DEBUG) echo "
      $aasprefixArr
      "; + if(!isset($tmpaasInstanceNo)) + { + $tmpInstanceNoArr[0]=-1; + } + else + { + $tmpInstanceNoArr=explode(".",$aasprefixArr); + } + for($i=0;$iupdateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='322_99_99'; + $tmpObjIdStr='2.1.'.$tmpDefaultValueArr[$i][level_3]; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($DEBUG) echo "
      $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** + } + //end delete prefix + break; + } + case 3://switch + { + {//delete conv prefix + //get default value of local prefix(conv prefix) + $net_paramConf ='OBJ_225.paramConf'; + $net_paramTable ="OBJ_225.param_99"; + $getsql = "select initValue from $net_paramConf where level_1 = '2' and level_2 = '8' and level_3 = '0'"; + $conv_pre_def = @mysqli_query($pubConn,$getsql); + $conv_pre_def = @mysqli_fetch_array($conv_pre_def); + $conv_pre_def = $conv_pre_def[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "
      conv_pre_def = $conv_pre_def
      "; + + $getsql = "select instanceNo,initValue from $net_paramTable where level_1 = '2' and level_2 = '8' and level_3 = '0' and initValue!='$conv_pre_def'"; + if($DEBUG) echo "
      getsql:$getsql"; + $xappResult = mysqli_query($pubConn,$getsql); + while($xappRow = mysqli_fetch_array($xappResult)) + { + $tmpName = toAscii(getBitValue($xappRow[initValue],'35.0-42.7')); + $cmpName = "Info".$infoNo; + if(strcmp($tmpName,$cmpName)==0) + { + $instNo = $xappRow[instanceNo]; + $updSql = "update $net_paramTable set initValue='$conv_pre_def' where level_1 = '2' and level_2 = '8' and level_3 = '0' and instanceNo='$instNo'"; + mysqli_query($pubConn,$updSql); + } + } + $tmpSysId ='225_99_99'; + $tmpObjIdStr='2.8'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + }//end delete conv prefix + //delete prefix + if($otherVar_1!=-1) + { + //deletePrefix($otherVar_1); + //echo "delete_prefix
      "; + delete_prefix($otherVar_1); + delete_prefix_manipulation($otherVar_1); + } + break; + } + case 4://application + { + + $tmpParamConfTable='OBJ_223.paramConf'; + $tmpObjIdStr='2.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue FROM $tmpParamConfTable + WHERE $levelWhere + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $tmpDefaultValue=$rows[initValue]; + + $tmpObjIdStr='2.4'; + $levelWhere1 = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere1=$levelWhere1"; + + $getSql="SELECT initValue FROM $tmpParamConfTable + WHERE $levelWhere1 + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $tmpDefaultValue1=$rows[initValue]; + + $selSql = "select initValue,instanceNo from OBJ_223.param_99 where $levelWhere and initValue like '01%' "; + $result = mysqli_query($pubConn,$selSql); + + $offsetAppType='00.0-00.7'; + $offsetGrpNo = '01.0-01.7'; + + $i=0; + $GTTWhere="(0"; + while($rows=mysqli_fetch_array($result)) + { + $tmpDpc = hexdec(getBitValue($rows[initValue],'24.0-26.7')); + $tmpNi = hexdec(getBitValue($rows[initValue],'23.0-23.7')); + $SSN = hexdec(getBitValue($rows[initValue],'27.0-27.7')); + if($tmpDpc==$DPC && $tmpNi==$NI ) + { + {//get gtt attribution form 2.4 + $selSql = "select initValue from OBJ_223.param_99 where level_1='2' and level_2='4' and instanceNo='$rows[instanceNo]'"; + $tmpResult = mysqli_query($pubConn,$selSql); + $tmpRow = mysqli_fetch_array($tmpResult); + $tmpGrpNo = hexdec(getBitValue($tmpRow[initValue],$offsetGrpNo)); + $tmpAppType = hexdec(getBitValue($tmpRow[initValue],$offsetAppType)); + }//end get gtt attribution +// echo "
      $selSql
      $tmpRow[initValue]"; +// echo "
      ($tmpGrpNo==$otherVar_2 && $tmpAppType==$otherVar_1)"; + if($tmpGrpNo==$otherVar_2 && $tmpAppType==$otherVar_1) + { +// echo "
      1: dpc=$tmpDpc, ni=$tmpNi, grpNo=$tmpGrpNo, ssn=$SSN, instanceNo={$rows[instanceNo]}"; +// echo "
      2: dpc=$DPC, ni=$NI, grpNo=$otherVar_2, ssn=$otherVar_1"; + if($i==0) + $GTTWhere="(instanceNo='{$rows[instanceNo]}'"; + else + $GTTWhere=$GTTWhere." OR instanceNo='{$rows[instanceNo]}'"; + $i++; + } + } + } + $GTTWhere=$GTTWhere.")"; + + $getSql="SELECT initValue FROM OBJ_223.param_99 + WHERE $levelWhere AND $GTTWhere + "; + if(0) + { + echo "
      levelWhere=$levelWhere"; + echo "
      GTTWhere=$GTTWhere"; + echo "
      getSql=$getSql"; + exit; + } + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $GTT_start = getBitValue($rows[initValue],'3.0-12.7'); + $GTT_start = str_replace('F','',$GTT_start);//for delete xapp(vlr) + + $updateSql="UPDATE OBJ_223.param_99 SET + initValue='$tmpDefaultValue' + WHERE $levelWhere AND $GTTWhere"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $updateSql="UPDATE OBJ_223.param_99 SET + initValue='$tmpDefaultValue1' + WHERE $levelWhere1 AND $GTTWhere"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='223_99_99'; + $tmpObjIdStr='2.2'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + + $tmpSysId ='223_99_99'; + $tmpObjIdStr='2.4'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + + //**************************************************************** + if($elementNo==2){ + //(VLR)delete VPLMNs add by yizane + $tmpParamConfTable='OBJ_330.paramConf'; + $tmpObjIdStr='2.1.12'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue FROM $tmpParamConfTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $tmpDefaultValue=$rows[initValue]; + $updateSql="UPDATE OBJ_330.param_99 SET + initValue='$tmpDefaultValue' + WHERE $levelWhere AND instanceNo='$otherVar_2'"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='330_99_99'; + $tmpObjIdStr='2.1.12'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** + } + break; + } + default: + break; + } + if(1)//delete element info + { + $tmpObjIdStr='2.11'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamConfTable='OBJ_225.paramConf'; + $getSql="SELECT initValue FROM $tmpParamConfTable + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $tmpDefaultValue=$rows[initValue]; + $instanceNoWhere = "(instanceNo='$infoNo')"; + if(isset($cnfcenterInfoNo)) + $instanceNoWhere = "(instanceNo='$infoNo' or instanceNo='$cnfcenterInfoNo')"; + $updateSql="UPDATE OBJ_225.param_99 SET initValue='$tmpDefaultValue' + WHERE $levelWhere AND $instanceNoWhere"; + if($DEBUG) + echo "
      updateSql=$updateSql"; + $result =mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + + $tmpSysId ='225_99_99'; + $tmpObjIdStr='2.11'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($commArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + } //end delete element info +}//end other element +CheckState($commArr); + +//********************************************************** + + + + + +//Save parameters +if($systemNo==0) +{ + //save parameters + $tmpInitValue='02'; + $tmpObjIdStr='3.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_223.param_99'; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + $tmpSysId ='223_99_99'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($SavecommArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $SavecommArr = $SavecommArr.$commIdStr; + //**************************************************************** +} +else//others element +{ + $tmpInitValue='02'; + $tmpObjIdStr='3.7'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_222.param_99'; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + $tmpSysId ='222_99_99'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($SavecommArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $SavecommArr = $SavecommArr.$commIdStr; + //**************************************************************** + if($systemNo<4) + { + //save parameters + $tmpInitValue='B5'; + $tmpObjIdStr='3.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_322.param_99'; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + $tmpSysId ='322_99_99'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($SavecommArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $SavecommArr = $SavecommArr.$commIdStr; + //**************************************************************** + } + else + { + //save parameters + $tmpInitValue='02'; + $tmpObjIdStr='3.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_223.param_99'; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + $tmpSysId ='223_99_99'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($SavecommArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $SavecommArr = $SavecommArr.$commIdStr; + //**************************************************************** + } + { + $tmpInitValue='01'; + $tmpObjIdStr='3.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $tmpParamTable='OBJ_225.param_99'; + $updateSql="UPDATE $tmpParamTable SET initValue='$tmpInitValue' + WHERE $levelWhere + "; + if($DEBUG) + echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + $tmpSysId ='225_99_99'; + //**************************************************************** + $commIdStr =oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr); + //SetParam($oidsysarr); + //SaveParam($SaveArr); + if($commIdStr=='-1'){ + DelComm($SavecommArr); + + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + $SavecommArr = $SavecommArr.$commIdStr; + //**************************************************************** + } +} + +CheckState($SavecommArr); + +//==============save the mtp3 sccp parameter in server========================== +$SaveArrt=array( + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'322_99_99'),//SCCP + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99'),//mtp3 + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99'),//xapp + ); + SaveParam($SaveArrt); +//********************************************************** +echo "

      Finished!

      "; +if($DEBUG) exit(); +echo "
      "; +//echo "

      $strBack"; +echo ""; +exit(); +?> + + diff --git a/wxc2_omc/element/overview/downloadFile.php b/wxc2_omc/element/overview/downloadFile.php new file mode 100755 index 0000000..ef36042 --- /dev/null +++ b/wxc2_omc/element/overview/downloadFile.php @@ -0,0 +1,699 @@ + + + + Network > Backup"; +$DEBUG = 0; +$pubDb = "OMC_PUB"; +set_time_limit(3600); + +function MsgBox($str) +{ + echo ""; +}//end MsgBox + +function createParamCVS($path,$tbNameArr) +{ + $pubDb = "OMC_PUB"; + for($i=0; $i(isFinish != 0) || (waitTime >= maxWaitTime) || (stopTime > maxStopTime)"; + while(1) { + echo ""; + flush(); + //echo "
      ($isFinish != 0) || ($waitTime >= $maxWaitTime) || ($stopTime > $maxStopTime)"; + if(($isFinish != 0) || ($waitTime >= $maxWaitTime) || ($stopTime > $maxStopTime)){ + if($commId >= $maxOfCommId){ //初始化命令表 + //先删除表 + $dropSql = "DROP TABLE $commTable "; + mysqli_query($pubConn,$dropSql); + //再建一个结构相同的新表 + $createSql="CREATE TABLE subscriberComm ( + commId smallint(5) unsigned NOT NULL auto_increment, + commType tinyint(1) DEFAULT '0' NOT NULL, + dataTypeNo tinyint(4) DEFAULT '0' NOT NULL, + sysTypeNo smallint(5) unsigned DEFAULT '0' NOT NULL, + sysNo smallint(5) unsigned DEFAULT '0' NOT NULL, + subSysNo smallint(5) unsigned DEFAULT '0' NOT NULL, + indexValueList varchar(255) NOT NULL, + fieldNameList tinytext NOT NULL, + paramType tinyint(4) DEFAULT '0' NOT NULL, + commState tinyint(3) unsigned DEFAULT '0' NOT NULL, + totalNum smallint(5) unsigned DEFAULT '0' NOT NULL, + finishNum smallint(5) unsigned DEFAULT '0' NOT NULL, + sendTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + bgnTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + endTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + remark varchar(200) binary NOT NULL, + PRIMARY KEY (commId), + KEY sysTypeNo (sysTypeNo), + KEY sysNo (sysNo), + KEY subSysNo (subSysNo), + KEY bufferKey (indexValueList) + ) + "; + mysqli_query($pubConn,$createSql); + }else{ + //删除命令表的相关命令 + $commArr = explode('-',$commIdStr); + for($i=0;$ideleteSql = $deleteSql"; + mysqli_query($pubConn,$deleteSql); + echo mysqli_error($pubConn); + } + } + + // 重定向返回指定页 + if($isFinish != 0){ + if($isFinish > 0){ + echo "Finished."; + flush(); + if($commType == $nLoadIndexComm){ + sleep(8);//等8秒,这样数据库插入才能完全完成 + } + return 1; + }elseif($isFinish == -1){ + echo "Failed in some system!!"; + flush(); + return 0; + }else{ + echo "Failed!!"; + flush(); + return 0; + } + }elseif($usedTime >= $maxOverTime && $stopTime == 1){ + echo "Stoped!!"; + flush(); + return 0; + }else{ //$usedTime >= $maxOverTime + echo "Timeout!!"; + flush(); + return 0; + } + }//end of if($isFinish....) + + //显示命令执行状态 + //----------------------------- + $okNum = 0; + $failNum = 0; + $commNum = 0; + $commArr = explode('-',$commIdStr); + $thisTimeFinishNumStr = ''; + $lastTimeFinishNumArr = explode('-',$lastTimeFinishNumStr); + for($i=0;$iget command = $commSql"; + $commResult = mysqli_query($pubConn,$commSql); + if(mysqli_num_rows($commResult) <= 0){ + echo "
      Can not find this command's info in datebase"; + exit(); + } + $commRows = @mysqli_fetch_array($commResult); + $sysTypeNo = $commRows[sysTypeNo]; + $sysNo = $commRows[sysNo]; + $subSysNo = $commRows[subSysNo]; + $commType = $commRows[commType]; + $paramType = $commRows[paramType]; + $objId = $commRows[objId]; + $commState = $commRows[commState]; + $indexValueList = $commRows[indexValueList]; + $fieldNameList = $commRows[fieldNameList]; + $remark = $commRows[remark]; + + switch($commState){ + case 0: //process failed + $failNum++; + echo " $commRows[remark] "; + flush(); + return 0; + //break; + case 1: //wait process + $waitTime++; + break; + case 2: //in process + $waitTime = 0; + //只要有一个命令的完成数在增长,就认为该组命令在运行,否则认为命令处理超时 + if($DEBUG) echo "====> {$commRows[finishNum]} > {$lastTimeFinishNumArr[$i]}"; + if($commRows[finishNum] > $lastTimeFinishNumArr[$i]){ + $stopTime = 0; + }else{ + $stopTime++; + } + $thisTimeFinishNumStr .=$commRows[finishNum].'-'; + break; + case 3: //process finished + $okNum++; + break; + default: + echo "Unknown Command State"; + flush(); + exit(); + } + }//end of for($i=0;$i$commNum =?= $finishNum"; + if($commNum == $okNum){ + $isFinish = 1; + }elseif($failNum > 0 && $okNum > 0){ + $isFinish = -1; + }elseif($commNum == $failNum){ + $isFinish = -2; + }else{ + $isFinish = 0; + } + + if($DEBUG) echo"
      lastTimeFinishNumStr=$lastTimeFinishNumStr"; + if($DEBUG) echo"
      thisTimeFinishNumStr=$thisTimeFinishNumStr"; + $lastTimeFinishNumStr = $thisTimeFinishNumStr; + //刷新返回 + //-------------- + $usedTime++; //总时间 + sleep(5); + }//end while +} +function createSubsCVS($path,$subsTlbName,$sysId) +{ + $pubDb = "OMC_PUB"; + $filePath = $path . "$subsTlbName.$sysId.csv"; + if (is_file($filePath)) + unlink($filePath); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '{$filePath}' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $subsTlbName limit 0,5000 + "; + //echo "
      csvFileUpdateSql= $csvFileUpdateSql"; + $csvFileUpdateResult = mysqli_query($pubConn ,$csvFileUpdateSql); + echo mysqli_error($pubConn); +}//end createSubsCVS + +function getBssIp (&$bssIpArr) +{ + $bssDb = "BssOmcDb"; + $bssTable = "OMCR_BSSTABLE"; + $selSql = "select ip,bssid from $bssTable"; + $bssResult = mysqli_query($pubConn,$selSql); + while($bssRow = mysqli_fetch_array($bssResult)) + { + $ip = $bssRow[ip]; + if(strlen($ip)< 7) continue; + $bssIpArr[] = $ip; + } +}//end getBssIp + +function getBssDb($bssDbPath,$bssIpAddr) +{ + $fileArr = array('abis.db', 'bscadmin.db', 'calltrc.db', 'sysmon.db', + 'aifadmin.db', 'BssGb.db', 'frmgr.db', 'trkadmin.db'); + $remoteDir = "/hd0/iw07_00.010/compile/cfg/"; + $ftpCon=@ftp_connect($bssIpAddr); + if($ftpCon < 0){ + echo "BSS's ip is error or connect $bssIpAddr Failed!"; + flush(); + return 0; + } + if(!@ftp_login($ftpCon,'','')){ + echo "BSS's ip is error or login $bssIpAddr Failed!"; + @ftp_close($ftpCon); + flush(); + return 0; + } + if(!@ftp_chdir($ftpCon, $remoteDir)){ + echo "Change dir error!"; + @ftp_close($ftpCon); + flush(); + return 0; + } + $localDir = $bssDbPath . $bssIpAddr . '/'; + mkdir($localDir, 0755); + for($i=0; $i< sizeof($fileArr); $i++) { + $file = $fileArr[$i]; + $remoteFile=$remoteDir.$file; + $localFile=$localDir.$file; + if (!@ftp_get($ftpCon, $localFile, $remoteFile, FTP_BINARY)) { + flush(); + echo "Get file error!"; + @ftp_close($ftpCon); + return 0; + } + }//end for + + @ftp_close($ftpCon); + return 1; +}//end get BssDb +?> + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> + + 111, 'name' => 'PLAT'), + array('typeNo' => 222, 'name' => 'PLAT'), + array('typeNo' => 223, 'name' => 'PLAT'), + array('typeNo' => 225, 'name' => 'PLAT') + ); + + $tmpAllSysArr = $needBackupArr; + for($i=0; $iselSql:$selSql"; + $result = mysqli_query($pubConn,$selSql); + $rowNum = mysqli_num_rows($result); + if($rowNum<=0) continue; + if($curSys < 300 && $curSys != 225) + { + $lastSysNo=-1; + while($rows = mysqli_fetch_array($result)) + { + $sysNo=$rows[sysNo]; + $subSysNo = $rows[subSysNo]; + if($curSys > 200 && $sysNo==0) continue; + + $sysId = $curSys."_".$sysNo."_99"; + $slcsysId=-1; + $tlbNo = $sysNo; + if($curSys==222 || $curSys==223) { + if(($sysNo==8) || ($sysNo==11)) { + if((!$vssExist && $sysNo==8) || (!$aasExist && $sysNo==11)) continue; + $sysId = $curSys . '_' . $sysNo . '_' . $subSysNo; + } + else if($sysNo==9) { + $sysId = $curSys . '_99_99'; + $slcsysId = $curSys . '_' . $sysNo . '_' . $subSysNo; + $tlbNo = 99; + } + } + if($curSys==111) + { + $slcsysId = $curSys."_".$sysNo."_".$subSysNo; + } + $oidsysArr[]= array('oid'=>'2', 'sysid'=> $sysId, 'selectsysid'=> $slcsysId); + if($sysNo != $lastSysNo) + $tbNameArr[] = "OBJ_".$curSys.".param_".$tlbNo; + $lastSysNo=$sysNo; + } + } + if($curSys > 300 || $curSys==225) + { + $slcsysId = -1; + $sysId = $curSys."_99_99"; + $oidsysArr[]= array('oid'=>'2', 'sysid'=> $sysId, 'selectsysid'=> $slcsysId); + $tbNameArr[] = "OBJ_".$curSys.".param_99"; + } + $allSysArr[$j] = $tmpAllSysArr[$i]; + $allSysArr[$j][oidsysArr]=$oidsysArr; + $allSysArr[$j][tbNameArr]=$tbNameArr; + $j++; + unset($oidsysArr); + unset($tbNameArr); + } +}//end get allSysArr. +//print_r($allSysArr); +//exit; +{//get subsDbArr. + $tmpdbArr = array( + array('typeNo' => '330'), //HLR + //array('typeNo' => '325'), //VLR + array('typeNo' => '360'), //PPS + //array('typeNo' => '340'), //AUC + array('typeNo' => '380'), //EIR + array('typeNo' => '370'), //MNP + array('typeNo' => '390')//must be the last one. + ); + for($i=0; $i< sizeof($tmpdbArr); $i++) + { + $tmpTypeNo = $tmpdbArr[$i][typeNo]; + for($j=0; $j< sizeof($needBackupArr); $j++){ + if($tmpTypeNo==$needBackupArr[$j][typeNo]){ + $tmpsubsDbArr[] = $tmpdbArr[$i]; + break; + } + } + } + + for($i=0; $i 0){ + if($sysTypeNo==390){ + $j=$i; + while($infoRows = mysqli_fetch_array($infoResult)) + { + $sysNo = $infoRows[sysNo]; + $subSysNo = $infoRows[subSysNo]; + $sysId = $sysTypeNo.'_'.$sysNo.'_'.$subSysNo; + $subsTlb = "VMS_DB.subscriberData_" . $sysNo; + $subsDbArr[$j][typeNo] = $sysTypeNo; + $subsDbArr[$j][sysId] = $sysId; + $subsDbArr[$j][name] = 'VMS'; + $subsDbArr[$j][subsTlb] = $subsTlb; + $j++; + } + } else { + $sysSubsConfTable ='OMC_PUB.sysSubsConf'; + $systemConfTable = 'OMC_PUB.sysConf'; + $getConfSql="SELECT sysTypeName,dataTypeNo,indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable,$systemConfTable + WHERE $sysSubsConfTable.sysTypeNo='$sysTypeNo' + AND $systemConfTable.sysTypeNo='$sysTypeNo' + AND $sysSubsConfTable.dataTypeNo='$dataTypeNo' + "; + $getConfResult=mysqli_query($pubConn,$getConfSql); + echo mysqli_error($pubConn); + $getConfRows=mysqli_fetch_array($getConfResult); + $sysTypeName =$getConfRows[sysTypeName]; + //$indexFieldName =$getConfRows[indexFieldName]; + $subsTlb =$getConfRows[subsDataTable]; + //$tmpDataTable =$getConfRows[tmpDataTable]; + + $infoRows = mysqli_fetch_array($infoResult); + + $sysNo = $infoRows[sysNo]; + $subSysNo = $infoRows[subSysNo]; + $sysId = $sysTypeNo.'_'.$sysNo.'_'.$subSysNo; + + $subsDbArr[$i][typeNo] = $sysTypeNo; + $subsDbArr[$i][sysId] = $sysId; + $subsDbArr[$i][name] = $sysTypeName; + $subsDbArr[$i][subsTlb] = $subsTlb; + } + } + + } +}//end get subsDbArr. + +if($needGetParam)//get parameters from devices +{ + echo "
      Getting parameter data from devices ...
      "; + flush(); + for($i=0; $i    [ $sysName ]  "; + flush(); + } + GetParam($oidsysArr,0,0); + $oldName = $sysName; + } +}//end get parameters from devices + +if($needGetParam)//create parameters' cvs files +{ + echo "
          Creating tables
        "; + exec("mkdir $paremerPath -p"); + exec("chmod -R 755 $paremerPath"); + for($i=0; $i"; + flush(); + } + $tbNameArr = $allSysArr[$i][tbNameArr]; + createParamCVS($paremerPath,$tbNameArr); + $oldName = $sysName; + } + + + //========download the OBJ_222.param_8 OBJ_223.param_8 table + $vss_tbNameArr_222=array(0=>'OBJ_222.param_8'); + $vss_tbNameArr_223=array(0=>'OBJ_223.param_8'); + createParamCVS($paremerPath,$vss_tbNameArr_222); + createParamCVS($paremerPath,$vss_tbNameArr_223); + + +}//end create parameters' cvs files + +if($needGetSubs) //get Subscriber data from devices +{ + echo "
      "; + echo "
      Getting subscribers data from devices ...
      "; + flush(); + for($i=0; $i    [ $sysName ]  "; + flush(); + } + $rtn = getSubsData($sysId,$dataTypeNo); + $subsDbArr[$i][getSubsOk] = $rtn; + $oldName = $sysName; + } +}//end get subscriber data from devices. +//exit; +if($needGetSubs)//create subscribers' cvs files +{ + exec("mkdir $subsPath -p"); + exec("chmod -R 755 $subsPath"); + echo "
          Creating tables
        "; + for($i=0; $i< sizeof($subsDbArr); $i++) + { + if($subsDbArr[$i][getSubsOk]!=1) continue; + $subsTlbName = $subsDbArr[$i][subsTlb]; + $sysId = $subsDbArr[$i][sysId]; + $sysName = $subsDbArr[$i][name]; + if($sysName !== $oldName) { + echo ""; + flush(); + } + + createSubsCVS($subsPath,$subsTlbName,$sysId); + $oldName = $sysName; + }//end subscribers table. +}//end create subscribers cvs files. + +if($needBss)//get bss data +{ + echo "
      "; + echo "
      Getting BSS data ...
      "; + flush(); + + exec("mkdir $bssOmcTlbPath -p"); + exec("chmod -R 755 $bssOmcTlbPath"); + $tbNameArr = array('BssOmcDb.OMCR_BSSTABLE'); + echo "
          Creating parameter tables ... "; + createParamCVS($bssOmcTlbPath,$tbNameArr); + echo "Finished."; + + //get bss db. + exec("mkdir $bssDbPath -p"); + exec("chmod -R 755 $bssDbPath"); + chdir($bssDbPath); + getBssIp ($bssIpArr); + for($i=0; $i    Getting $bssIpArr[$i] dbs ... "; + flush(); + if(getBssDb($bssDbPath,$bssIpArr[$i])){ + echo "Finished."; + flush(); + } + } +}//end get bss database. + +$needCompress = $needGetParam||$needGetSubs||$needBss; + +if($needCompress)//compress files +{ + $time = date("Ymd_Hi"); + $tgzName = "backup_".$time.'_'; + if($needGetParam) $tgzName .= 'param_'; + if($needGetSubs) $tgzName .= 'subs_'; + if($needBss) $tgzName .= 'bss_'; + $tgzName = rtrim($tgzName,'_'); + $tgzName .= '.tgz'; + echo "
      "; + echo "
      Compressing files ...
      "; + flush(); + + if (is_dir($tgzPath)) + exec("rm -rf $tgzPath"); + exec("mkdir $tgzPath -p"); + exec("chmod -R 755 $tgzPath"); + + chdir($tmpPath); + exec("tar zcvf $tgzName *"); + + exec("mv $tgzName $tgzPath"); + + exec("rm -rf $tmpPath"); + + echo "Finished."; + flush(); +}//end compress files. + +sleep(3); +//exit; +echo ""; +?> + + diff --git a/wxc2_omc/element/overview/getOverviewSta.php b/wxc2_omc/element/overview/getOverviewSta.php new file mode 100755 index 0000000..0796860 --- /dev/null +++ b/wxc2_omc/element/overview/getOverviewSta.php @@ -0,0 +1,526 @@ +selSql=$selSql"; + $res = @mysqli_query($pubConn,$selSql); + $i=0; + while($rows = mysqli_fetch_array($res)) + { + $existElementArr[$i++] = $rows[elementTypeNo]; + } + if(0)print_r($existElementArr); +}//end get all exisit elements + +$localElementArr=array( + array('sysTypeName'=>'MSC', 'sysTypeNo'=>'320','sysTypeSSN'=>'8','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/msc.php?load_flag=$getflag"), + array('sysTypeName'=>'VLR', 'sysTypeNo'=>'325','sysTypeSSN'=>'7','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/vlr.php?load_flag=$getflag"), + array('sysTypeName'=>'HLR', 'sysTypeNo'=>'330','sysTypeSSN'=>'6','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/hlr.php?load_flag=$getflag"), + array('sysTypeName'=>'AUC', 'sysTypeNo'=>'340','sysTypeSSN'=>'10','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/auc.php?load_flag=$getflag"), + array('sysTypeName'=>'SMSC','sysTypeNo'=>'350','sysTypeSSN'=>'11','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/smsc.php?load_flag=$getflag"), + array('sysTypeName'=>'PPS', 'sysTypeNo'=>'360','sysTypeSSN'=>'147','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/pps.php?load_flag=$getflag"), + array('sysTypeName'=>'EIR', 'sysTypeNo'=>'380','sysTypeSSN'=>'9','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/eir.php?load_flag=$getflag"), + array('sysTypeName'=>'MNP', 'sysTypeNo'=>'370','sysTypeSSN'=>'32','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/mnp.php?load_flag=$getflag")); + + +if($DEBUG) echo "
      正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +?> + +getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + if(mysqli_num_rows($result)==0) + { + $localElementArr[$i][state]=0; + $localElementArr[$i][stateColor]='#FF0000'; + } + else + { + while($rows=mysqli_fetch_array($result)) + { + $out_time=date("Y-m-d H:i:s",mktime(date("H"),date("i")-10,0,date("m"),date("d"),date("Y"))); + //if(1&&$localElementArr[$i][sysTypeNo]==360) echo "
      " . "{$rows[1]}< $out_time"; + if($rows[0]==0||$rows[1]< $out_time) + { + $localElementArr[$i][state]=0; + $localElementArr[$i][stateColor]='#FF0000'; + } + } + } + } +} +?> + +levelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + +function getSubSyss($num) +{ + $i=0; + do + { + $arr[$i++] = $num % 2; + }while($num = floor($num/2)); + for($j=$i; $j<4; $j++) + $arr[$j] = 0; + + return $arr; +} +function toAscii($byteValue){ + $charValue = ""; + $tmpLen=strlen($byteValue); + for($charCount=0; $charCount < $tmpLen; $charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $charCount++; + if($unitByte == 0) break; + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + $charValue .= $unitChar; + } + return $charValue; +} +?> + 15 ? 1 : 0; + $subSysNo = $cardno % 16; + $port = $i - $cardno*8; + //e1 install + $bin_mes = $e1HeartBeatArr[$sysNo][$subSysNo]; + //if($DEBUG)echo "
      $i: $bin_mes"; + $bin_ins=substr($bin_mes,$ins_bgn*8+7-$port,1);//0:'--'; 1:'Y' + $tmp1 = bindec($bin_ins); + + //e1 layer1 + $bin_phy=substr($bin_mes,$phy_bgn*8+7-$port,1);//0:'Y'; 1:'N'; 2:'--' + $tmp2 = bindec($bin_phy); + $tmp2++; + $tmp2 = ($tmp2>1) ? 0 : $tmp2; + + //e1 layer2 install + $bin_inl=substr($bin_mes,$el2_bgn*8+7-$port,1);//0:'N'; 1:'Y'; + $tmp3 = bindec($bin_inl); + + $E1stateArr1[$i] = $E1state1 & $tmp2 & $tmp3; + $E1stateArr2[$i] = $E1state2 | $tmp2 | $tmp3; +// echo "
      E1stateArr1[$i]:{$E1stateArr1[$i]},E1stateArr2[$i]:{$E1stateArr2[$i]}"; +} + +$tmpObjIdStr='2.4.2'; +$levelWhere = getLevelWhere($tmpObjIdStr); +$tmpTgValue=strtoupper(omc_keep_length($tmpTgValue,0,2)); +$getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere and initValue!='EE' order by instanceNo"; +$result =mysqli_query($pubConn,$getSql); +while($Rows = mysqli_fetch_array($result)) +{ + $tg = hexdec($Rows[initValue]); + if(!isset($e1StatAtTgArr1[$tg])) $e1StatAtTgArr1[$tg]=1; + if(!isset($e1StatAtTgArr2[$tg])) $e1StatAtTgArr2[$tg]=0; + $e1StatAtTgArr1[$tg] &= $E1stateArr1[$Rows[instanceNo]]; + $e1StatAtTgArr2[$tg] |= $E1stateArr2[$Rows[instanceNo]]; +// echo "
      $Rows[instanceNo]:{$E1stateArr1[$Rows[instanceNo]]};e1StatAtTgArr1[$tg]:{$e1StatAtTgArr1[$tg]},e1StatAtTgArr2[$tg]:{$e1StatAtTgArr2[$tg]}"; +} + +////////////////get lins status +$out_time=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-30,date("m"),date("d"),date("Y"))); +//E1 link status +$HbparamSql = " SELECT detailStat FROM OMC_PUB.sysStat + WHERE sysTypeNo='200' AND sysNo='9' AND (subSysNo='0' or subSysNo='1') AND updateTime>'$out_time' + "; +$Hbresult = mysqli_query($pubConn,$HbparamSql); +while($Hbvalue_mpt3Arr[] = mysqli_fetch_array($Hbresult));//取mtp3 的heartbeat +if(sizeof($Hbvalue_mpt3Arr)==3) + $isDualServ = 1; +//E1 link +$tmpObjIdStr='2.5.1'; +$levelWhere = getLevelWhere($tmpObjIdStr); +$tmpValue=dechex($linkset); +$tmpValue=strtoupper(omc_keep_length($tmpValue,0,2)); +$getSql="SELECT initValue,instanceNo FROM OBJ_222.param_99 + WHERE $levelWhere order by instanceNo"; +$result =mysqli_query($pubConn,$getSql); +while($rows=mysqli_fetch_array($result)) +{ + $linkflag = getBitValue($rows[initValue],'06.5-06.5'); + $ls = hexdec(getBitValue($rows[initValue],'00.0-00.7')); + if($linkflag) + { + if(!isset($e1StatAtLsArr1[$ls])) $e1StatAtLsArr1[$ls]=1; + if(!isset($e1StatAtLsArr2[$ls])) $e1StatAtLsArr2[$ls]=0; + + $Hboffset=39+Floor($rows[instanceNo]/4); + $tmpValue=substr($Hbvalue_mpt3Arr[0][detailStat],$Hboffset*2,2); + if($isDualServ && $rows[instanceNo]>=128) + $tmpValue=substr($Hbvalue_mpt3Arr[1][detailStat],$Hboffset*2,2); + $bitoff =$rows[instanceNo]%4; + $bitoff1=$bitoff*2; + $bitoff2=$bitoff1+1; + $bitoff='0.'.$bitoff1.'-0.'.$bitoff2; +//echo "
      $bitoff"; + $tmp=bindec(getBitValue($tmpValue,$bitoff)); + if($tmp>1) + $tmp=0; + $e1StatAtLsArr1[$ls] &= $tmp; + $e1StatAtLsArr2[$ls] |= $tmp; +// echo "
      $rows[instanceNo]: e1StatAtLsArr1[$ls]:{$e1StatAtLsArr1[$ls]},e1StatAtLsArr2[$ls]:{$e1StatAtLsArr2[$ls]}"; + } +} + +?> +levelWhere=$levelWhere"; + $othersElementParamTable='OBJ_225.param_99'; + $getSql="SELECT $initValue,instanceNo FROM $othersElementParamTable + WHERE $levelWhere and initValue LIKE '01%' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + $typeOffset = '1.0-1.7'; + $sysNoOffset = '2.0-2.3'; + $subSysNoOffset = '2.4-2.7'; + $tgOffset = '3.0-3.7'; + $lsOffset = '4.0-4.7'; + $appTypeOffset = '5.0-5.7'; + $appGrpOffset = '6.0-6.7'; + $nameOffset = '14.0-23.7'; + $i=0; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $typeValue=getBitValue($rows[initValue],$typeOffset); + if($typeValue==0) + continue; + $type = $elementsArr[$i][type]=hexdec($typeValue); + $ls2tg = $elementsArr[$i][tg]=hexdec(getBitValue($rows[initValue],$tgOffset)); + $ls = $elementsArr[$i][ls]=hexdec(getBitValue($rows[initValue],$lsOffset)); + $elementsArr[$i][appType]=hexdec(getBitValue($rows[initValue],$appTypeOffset)); + $elementsArr[$i][name]=getBitValue($rows[initValue],$nameOffset); + if($elementsArr[$i][name]==0) + $elementsArr[$i][name]=$elementsArr[$i][tg]; + else + $elementsArr[$i][name]=trim(toAscii($elementsArr[$i][name])); + if($type==17)//isdn switch + { + $e1State1 = $e1StatAtTgArr1[$ls2tg]; + $e1State2 = $e1StatAtTgArr2[$ls2tg]; + if($e1State1==1&&$e1State2==1) + $E1state='Available'; + elseif($e1State1==0&&$e1State2==1) + $E1state='Alarm'; + else + $E1state='Unavailable'; + } + else if($type==18/* && $ls2tg==255*/)//only link, but no e1 + { + $e1State1 = $e1StatAtLsArr1[$ls]; + $e1State2 = $e1StatAtLsArr2[$ls]; + if($e1State1==1&&$e1State2==1) + $E1state='Available'; + elseif($e1State1==0&&$e1State2==1) + $E1state='Alarm'; + else + $E1state='Unavailable'; + } + else + { + $e1State1 = $e1StatAtTgArr1[$ls2tg] & $e1StatAtLsArr1[$ls]; + $e1State2 = $e1StatAtTgArr2[$ls2tg] | $e1StatAtLsArr2[$ls]; + if($e1State1==1&&$e1State2==1) + $E1state='Available'; + elseif($e1State1==0&&$e1State2==1) + $E1state='Alarm'; + else + $E1state='Unavailable'; + } +// if($ls<=5)$E1state='Available'; + $elementsArr[$i][state] = $E1state; + $i++; + } +}//end element status +//print_r($elementsArr); +for($i=0;$i cnf-0-1; 1000 0000 -> cnf-0-4 + { + $cnfElementNo=sizeof($cnfElementArr); + $cnfElementArr[$cnfElementNo][state] = $elementsArr[$i][state]; + break; + } + case '16'://remote elements + { + $switchElementNo=sizeof($switchElementArr); + $switchElementArr[$switchElementNo][state]=$elementsArr[$i][state]; + break; + } + case '17'://isdn switch + { + $switchElementNo=sizeof($switchElementArr); + $switchElementArr[$switchElementNo][state]=$elementsArr[$i][state]; + break; + } + case '18'://application status + { + switch($elementsArr[$i][appType]) + { + case 0 : + $mscElementNo=sizeof($mscElementArr); + $mscElementArr[$mscElementNo][state]=$elementsArr[$i][state]; + break; + case 1 : + $hlrElementNo=sizeof($hlrElementArr); + $hlrElementArr[$hlrElementNo][state]=$elementsArr[$i][state]; + break; + case 2 : + $vlrElementNo=sizeof($vlrElementArr); + $vlrElementArr[$vlrElementNo][state]=$elementsArr[$i][state]; + break; + case 3 : + $mcElementNo=sizeof($mcElementArr); + $mcElementArr[$mcElementNo][state]=$elementsArr[$i][state]; + break; + case 4 : + $sgsnElementNo=sizeof($sgsnElementArr); + $sgsnElementArr[$sgsnElementNo][state]=$elementsArr[$i][state]; + break; + case 5 : + $newElementNo=sizeof($newElementArr); + $newElementArr[$newElementNo][state]=$elementsArr[$i][state]; + break; + } + break; + } + default: + break; + } +} + +?> + +0) + echo "Normal"; + else + echo "Alarm"; + } + } + echo "end"; + +//To BSS + if(sizeof($bssElementArr)>0) + { + foreach($bssElementArr as $key => $row) + { + $name[$key] = $row['name']; + } + array_multisort($name, SORT_ASC, $bssElementArr); + } + for($i=0;$i \ No newline at end of file diff --git a/wxc2_omc/element/overview/overview.php b/wxc2_omc/element/overview/overview.php new file mode 100755 index 0000000..81fb09c --- /dev/null +++ b/wxc2_omc/element/overview/overview.php @@ -0,0 +1,3159 @@ +"; +?> + + + +"; + $helpId="2"; + showHelp($helpId); + echo ""; + +} + +$SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_11_99','selectsysid'=> $vmsMtp3_sysId) + ); + +//echo "

      "; +$DEBUG = 0; +$pubDb = 'OMC_PUB'; +$sysInfoTable='OMC_PUB.sysInfo'; +$sysStatTable='OMC_PUB.sysStat'; + + +$getSql="SELECT pubVarValue FROM omcPubVarConf + WHERE pubVarName='getparam_from' + "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); +$rows=mysqli_fetch_array($result); +$getflag=$rows[0]; + +if(isset($changeflag)){ + $getSql="UPDATE omcPubVarConf set pubVarValue = '$changeflag' + WHERE pubVarName='getparam_from' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + if($DEBUG) echo "
      initValue=$rows[initValue]"; + $getflag=$changeflag; +} + +{//get all exist elements from elementExistConf + getExistElements($existElementArr); + + if(@array_search('500', $existElementArr)==TRUE)//BSS + $needBssIp = 1; +}//end get all exisit elements + +$localElementArr=array( + array('sysTypeName'=>'MSC', 'sysTypeNo'=>'320','sysTypeSSN'=>'8','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/msc.php?load_flag=$getflag"), + array('sysTypeName'=>'VLR', 'sysTypeNo'=>'325','sysTypeSSN'=>'7','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/vlr.php?load_flag=$getflag"), + array('sysTypeName'=>'HLR', 'sysTypeNo'=>'330','sysTypeSSN'=>'6','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/hlr.php?load_flag=$getflag"), + array('sysTypeName'=>'AUC', 'sysTypeNo'=>'340','sysTypeSSN'=>'10','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/auc.php?load_flag=$getflag"), + array('sysTypeName'=>'SMSC','sysTypeNo'=>'350','sysTypeSSN'=>'11','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/smsc.php?load_flag=$getflag"), + array('sysTypeName'=>'PPS', 'sysTypeNo'=>'360','sysTypeSSN'=>'147','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/loadpps.php?load_flag=$getflag"), + array('sysTypeName'=>'EIR', 'sysTypeNo'=>'380','sysTypeSSN'=>'9','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/eir.php?load_flag=$getflag"), + array('sysTypeName'=>'MNP', 'sysTypeNo'=>'370','sysTypeSSN'=>'32','GT'=>'--','existFlag'=>'0','license'=>'--','licenseColor'=>'','users'=>'--','usersColor'=>'','state'=>'1','stateColor'=>'','confLink'=>"../mss/mnp.php?load_flag=$getflag")); + +$NetIdConfArr=array( + "0"=>"International", + "1"=>"International spare", + "2"=>"National", + "3"=>"National spare" +); + +if($DEBUG) echo "
      正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +// +?> +"; + + +echo ""; +echo ""; +echo ""; +/* +if($getflag==1){ + echo ""; +}else{ + echo ""; +} +echo ""; +*/echo ""; +echo "
      "; +echo "$strConfiguration > $strNetwork"; +echo ""; + echo ""; + echo ""; +$helpId = "2"; +showHelp($helpId); +echo "
      "; + +?> + +getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows = mysqli_fetch_array($result); + $tmpHex=substr($rows[0],2,20); + $tmpHexArr=explode("F",$tmpHex); + $localElementArr[$i][GT]=$tmpHexArr[0]; + break; + } + } +} +if($localElementArr[0][existFlag]==1) +{ + $localElementArr[1][existFlag]=1; + $tmpOid = "2.1.".$localElementArr[1][sysTypeSSN]; + $levelWhere = getLevelWhere($tmpOid); + $getSql="SELECT initValue FROM $locEleParTab WHERE $levelWhere"; + $result =mysqli_query($pubConn,$getSql); + $rows = mysqli_fetch_array($result); + $tmpHex=substr($rows[0],2,20); + $tmpHexArr=explode("F",$tmpHex); + $localElementArr[1][GT]=$tmpHexArr[0]; +} +//////////////// + +for($i=0;$igetSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + if(mysqli_num_rows($result)==0) + { + $localElementArr[$i][state]=0; + $localElementArr[$i][stateColor]='#FF0000'; + } + else + { + while($rows=mysqli_fetch_array($result)) + { + $out_time=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + //$ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + + //if(1&&$localElementArr[$i][sysTypeNo]==360) echo "
      " . "{$rows[1]}< $out_time"; + if($rows[0]==0||$rows[1]< $out_time) + { + $localElementArr[$i][state]=0; + $localElementArr[$i][stateColor]='#FF0000'; + } + } + } + } +} + +for($i=0;$igetSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $serverNum=mysqli_num_rows($result); + switch($localElementArr[$i][sysTypeNo]) + { + case 320://msc + { + $byteLicStart = 31; + $lenLic = 4; + $byteUseStart = 35; + $lenUse = 4; + break; + } + + case 330://HLR + case 340://auc + case 350://smsc + case 360://pps + case 370://mnp + case 380://eir + { + $byteLicStart = 31; + $lenLic = 4; + $byteUseStart = 35; + $lenUse = 4; + break; + } + default: + { + $byteLicStart = 31; + $lenLic = 4; + $byteUseStart = 35; + $lenUse = 4; + break; + } + + } + + if($localElementArr[$i][sysTypeNo]==320) + { + if($serverNum==0) + { + $localElementArr[$i][licenseColor]='#FF0000'; + $localElementArr[$i][usersColor]='#FF0000'; + $localElementArr[1][licenseColor]='#FF0000'; //VLR + $localElementArr[1][usersColor]='#FF0000'; + } + else if($serverNum==1) + { + $rows=mysqli_fetch_array($result); + + $msc_bgn_byt=21; + $msc_len_hex=substr($rows[0],$msc_bgn_byt*2,4);//msc length + $msc_len_dec=HexDec($msc_len_hex); + if($DEBUG) + echo "
      msc_len_dec=$msc_len_dec"; + $vlr_bgn_byt=$msc_bgn_byt+4+$msc_len_dec; + $byteVlrLicStart = $vlr_bgn_byt+10; + $lenVlrLic = 4; + $byteVlrUseStart = $vlr_bgn_byt+14; + $lenVlrUse = 4; + + $localElementArr[$i][licenseColor]='#FF0000'; + $localElementArr[$i][usersColor]='#FF0000'; + $localElementArr[1][licenseColor]='#FF0000'; + $localElementArr[1][usersColor]='#FF0000'; + $localElementArr[$i][license]=hexdec(substr($rows[0],$byteLicStart*2,$lenLic*2)); + $localElementArr[$i][users]=hexdec(substr($rows[0],$byteUseStart*2,$lenUse*2)); + $localElementArr[1][license]=hexdec(substr($rows[0],$byteVlrLicStart*2,$lenVlrLic*2)); + $localElementArr[1][users]=hexdec(substr($rows[0],$byteVlrUseStart*2,$lenVlrUse*2)); + } + else + { + $rows=mysqli_fetch_array($result); + + + $msc_bgn_byt=21; + $msc_len_hex=substr($rows[0],$msc_bgn_byt*2,4);//msc length + $msc_len_dec=HexDec($msc_len_hex); + if($DEBUG) + echo "
      msc_len_dec=$msc_len_dec"; + $vlr_bgn_byt=$msc_bgn_byt+4+$msc_len_dec; + $byteVlrLicStart = $vlr_bgn_byt+10; + $lenVlrLic = 4; + $byteVlrUseStart = $vlr_bgn_byt+14; + $lenVlrUse = 4; + $localElementArr[$i][license]=hexdec(substr($rows[0],$byteLicStart*2,$lenLic*2)); + $localElementArr[$i][users]=hexdec(substr($rows[0],$byteUseStart*2,$lenUse*2)); + $localElementArr[1][license]=hexdec(substr($rows[0],$byteVlrLicStart*2,$lenVlrLic*2)); + $localElementArr[1][users]=hexdec(substr($rows[0],$byteVlrUseStart*2,$lenVlrUse*2)); + + $rows=mysqli_fetch_array($result); + $tmp_license=hexdec(substr($rows[0],$byteLicStart*2,$lenLic*2)); + $tmp_users=hexdec(substr($rows[0],$byteUseStart*2,$lenUse*2)); + $tmp_license_1=hexdec(substr($rows[0],$byteVlrLicStart*2,$lenVlrLic*2)); + $tmp_users_1=hexdec(substr($rows[0],$byteVlrUseStart*2,$lenVlrUse*2)); + + if($tmp_license!=$localElementArr[$i][license]) + $localElementArr[$i][licenseColor]='#FF0000'; + if($tmp_users!=$localElementArr[$i][users]) + $localElementArr[$i][usersColor]='#FF0000'; + if($tmp_license_1!=$localElementArr[1][license]) + $localElementArr[1][licenseColor]='#FF0000'; + if($tmp_users_1!=$localElementArr[1][users]) + $localElementArr[1][usersColor]='#FF0000'; + } + } + else + { + if($serverNum==0) + { + $localElementArr[$i][licenseColor]='#FF0000'; + $localElementArr[$i][usersColor]='#FF0000'; + } + else if($serverNum==1) + { + $rows=mysqli_fetch_array($result); + $localElementArr[$i][licenseColor]='#FF0000'; + $localElementArr[$i][usersColor]='#FF0000'; + $localElementArr[$i][license]=hexdec(substr($rows[0],$byteLicStart*2,$lenLic*2)); + $localElementArr[$i][users]=hexdec(substr($rows[0],$byteUseStart*2,$lenUse*2)); + } + else + { + $rows=mysqli_fetch_array($result); + $localElementArr[$i][license]=hexdec(substr($rows[0],$byteLicStart*2,$lenLic*2)); + $localElementArr[$i][users]=hexdec(substr($rows[0],$byteUseStart*2,$lenUse*2)); + $rows=mysqli_fetch_array($result); + $tmp_license=hexdec(substr($rows[0],$byteLicStart*2,$lenLic*2)); + $tmp_users=hexdec(substr($rows[0],$byteUseStart*2,$lenUse*2)); + if($tmp_license!=$localElementArr[$i][license]) + $localElementArr[$i][licenseColor]='#FF0000'; + if($tmp_users!=$localElementArr[$i][users]) + $localElementArr[$i][usersColor]='#FF0000'; + } + } + } +} + +?> + + 15 ? 1 : 0; + $subSysNo = $cardno % 16; + $port = $i - $cardno*8; + //e1 install + $bin_mes = $e1HeartBeatArr[$sysNo][$subSysNo]; + //if($DEBUG)echo "
      $i: $bin_mes"; + $bin_ins=substr($bin_mes,$ins_bgn*8+7-$port,1);//0:'--'; 1:'Y' + $tmp1 = bindec($bin_ins); + + //e1 layer1 + $bin_phy=substr($bin_mes,$phy_bgn*8+7-$port,1);//0:'Y'; 1:'N'; 2:'--' + $tmp2 = bindec($bin_phy); + $tmp2++; + $tmp2 = ($tmp2>1) ? 0 : $tmp2; + + //e1 layer2 install + $bin_inl=substr($bin_mes,$el2_bgn*8+7-$port,1);//0:'N'; 1:'Y'; + $tmp3 = bindec($bin_inl); + + $E1stateArr1[$i] = $E1state1 & $tmp2 & $tmp3; + $E1stateArr2[$i] = $E1state2 | $tmp2 | $tmp3; + //echo "
      E1stateArr1[$i]:{$E1stateArr1[$i]},E1stateArr2[$i]:{$E1stateArr2[$i]}"; + }//end for + + $tmpObjIdStr='2.4.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $tmpTgValue=strtoupper(omc_keep_length($tmpTgValue,0,2)); + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere and initValue!='EE' order by instanceNo"; + $result =mysqli_query($pubConn,$getSql); + while($Rows = mysqli_fetch_array($result)) + { + $tg = hexdec($Rows[initValue]); + if(!isset($e1StatAtTgArr1[$tg])) $e1StatAtTgArr1[$tg]=1; + if(!isset($e1StatAtTgArr2[$tg])) $e1StatAtTgArr2[$tg]=0; + $e1StatAtTgArr1[$tg] &= $E1stateArr1[$Rows[instanceNo]]; + $e1StatAtTgArr2[$tg] |= $E1stateArr2[$Rows[instanceNo]]; + //echo "
      $Rows[instanceNo]:{$E1stateArr1[$Rows[instanceNo]]};e1StatAtTgArr1[$tg]:{$e1StatAtTgArr1[$tg]},e1StatAtTgArr2[$tg]:{$e1StatAtTgArr2[$tg]}"; + } + + ////////////////get lins status + $out_time=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-30,date("m"),date("d"),date("Y"))); + //E1 link status + $HbparamSql = " SELECT detailStat FROM OMC_PUB.sysStat + WHERE sysTypeNo='200' AND sysNo='9' AND (subSysNo='0' or subSysNo='1') AND updateTime>'$out_time' + "; + $Hbresult = mysqli_query($pubConn,$HbparamSql); + while($Hbvalue_mpt3Arr[] = mysqli_fetch_array($Hbresult));//取mtp3 的heartbeat + if(sizeof($Hbvalue_mpt3Arr)==3) + $isDualServ = 1; + //E1 link + $tmpObjIdStr='2.5.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + //echo "$levet:$levelWhere
      "; + $tmpValue=dechex($linkset); + $tmpValue=strtoupper(omc_keep_length($tmpValue,0,2)); + $getSql="SELECT initValue,instanceNo FROM OBJ_222.param_99 + WHERE $levelWhere order by instanceNo"; + $result =mysqli_query($pubConn,$getSql); + while($rows=mysqli_fetch_array($result)) + { + $linkflag = getBitValue($rows[initValue],'06.5-06.5'); + $ls = hexdec(getBitValue($rows[initValue],'00.0-00.7')); + if($linkflag) + { + if(!isset($e1StatAtLsArr1[$ls])) $e1StatAtLsArr1[$ls]=1; + if(!isset($e1StatAtLsArr2[$ls])) $e1StatAtLsArr2[$ls]=0; + + $Hboffset=39+Floor($rows[instanceNo]/4); + $tmpValue=substr($Hbvalue_mpt3Arr[0][detailStat],$Hboffset*2,2); + if($isDualServ && $rows[instanceNo]>=128) + $tmpValue=substr($Hbvalue_mpt3Arr[1][detailStat],$Hboffset*2,2); + $bitoff =$rows[instanceNo]%4; + $bitoff1=$bitoff*2; + $bitoff2=$bitoff1+1; + $bitoff='0.'.$bitoff1.'-0.'.$bitoff2; + //echo "
      $bitoff"; + $tmp=bindec(getBitValue($tmpValue,$bitoff)); + if($tmp>1) + $tmp=0; + $e1StatAtLsArr1[$ls] &= $tmp; + $e1StatAtLsArr2[$ls] |= $tmp; + // echo "
      $rows[instanceNo]: e1StatAtLsArr1[$ls]:{$e1StatAtLsArr1[$ls]},e1StatAtLsArr2[$ls]:{$e1StatAtLsArr2[$ls]}"; + } + }//end while +}//end get e1 status. + + +$niTypeArr = getNiType(); +//others element +$othersElementObjIdStr='2.4.1'; +$levelWhere = getLevelWhere($othersElementObjIdStr); +if($DEBUG) echo "
      levelWhere=$levelWhere"; +$othersElementParamTable='OBJ_222.param_99'; +$getSql="SELECT initValue,instanceNo FROM $othersElementParamTable + WHERE $levelWhere "; +if($DEBUG) echo "
      getSql=$getSql"; +$result =mysqli_query($pubConn,$getSql); +echo mysqli_error($pubConn); + +while($rows=mysqli_fetch_array($result)) +{ + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $tmpType=getBitValue($rows[initValue],'4.0-4.7');//system type + if($tmpType==0) + continue; + $i = $rows[instanceNo]; + $lsArr[$i][dpc]=hexdec(getBitValue($rows[initValue],'0.0-2.7')); + $lsArr[$i][ni]=bindec(getBitValue($rows[initValue],'3.0-3.1')); + if($DEBUG) echo "
      linkset={$elementsArr[$i][linkset]}"; + +} +{//other elements + $othersElementObjIdStr='2.11'; + $levelWhere = getLevelWhere($othersElementObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $othersElementParamTable='OBJ_225.param_99'; + $getSql="SELECT initValue,instanceNo FROM $othersElementParamTable + WHERE $levelWhere and initValue LIKE '01%' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $typeOffset = '1.0-1.7'; + $sysNoOffset = '2.0-2.3'; + $subSysNoOffset = '2.4-2.7'; + $tgOffset = '3.0-3.7'; + $lsOffset = '4.0-4.7'; + $appTypeOffset = '5.0-5.7'; + $appGrpOffset = '6.0-6.7'; + $nameOffset = '14.0-23.7'; + $i=0; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $tmpType=getBitValue($rows[initValue],'1.0-1.7'); + if($tmpType==0) + continue; + $elementsArr[$i][infoNo]=$rows[instanceNo]; + $type = $elementsArr[$i][type]=hexdec($tmpType); + $elementsArr[$i][sysNo]=bindec(getBitValue($rows[initValue],$sysNoOffset)); + $elementsArr[$i][subSysNo]=bindec(getBitValue($rows[initValue],$subSysNoOffset)); + $ls2tg = $elementsArr[$i][tg]=hexdec(getBitValue($rows[initValue],$tgOffset)); + $ls = $elementsArr[$i][linkset] = $ls = hexdec(getBitValue($rows[initValue],$lsOffset)); + $elementsArr[$i][appType]=hexdec(getBitValue($rows[initValue],$appTypeOffset)); + $elementsArr[$i][appGrp]=hexdec(getBitValue($rows[initValue],$appGrpOffset)); + $elementsArr[$i][name]=getBitValue($rows[initValue],$nameOffset); + if($elementsArr[$i][name]==0) + $elementsArr[$i][name]=$elementsArr[$i][tg]; + else + $elementsArr[$i][name]=trim(toAscii($elementsArr[$i][name])); + $elementsArr[$i][ni] = $lsArr[$ls][ni]; + $elementsArr[$i][dpc]= $lsArr[$ls][dpc]; + if($getState) + {//get state + if($type==17)//isdn switch + { + $e1State1 = $e1StatAtTgArr1[$ls2tg]; + $e1State2 = $e1StatAtTgArr2[$ls2tg]; + if($e1State1==1&&$e1State2==1) + $E1state='Available'; + elseif($e1State1==0&&$e1State2==1) + $E1state='Alarm'; + else + $E1state='Unavailable'; + } + else if($type==18/* && $ls2tg==255*/)//only link, but no e1 + { + $e1State1 = $e1StatAtLsArr1[$ls]; + $e1State2 = $e1StatAtLsArr2[$ls]; + if($e1State1==1&&$e1State2==1) + $E1state='Available'; + elseif($e1State1==0&&$e1State2==1) + $E1state='Alarm'; + else + $E1state='Unavailable'; + } + else + { + $e1State1 = $e1StatAtTgArr1[$ls2tg] & $e1StatAtLsArr1[$ls]; + $e1State2 = $e1StatAtTgArr2[$ls2tg] | $e1StatAtLsArr2[$ls]; + if($e1State1==1&&$e1State2==1) + $E1state='Available'; + elseif($e1State1==0&&$e1State2==1) + $E1state='Alarm'; + else + $E1state='Unavailable'; + } + $elementsArr[$i][state] = $E1state; + }//end get state. + $i++; + } +}//end otherelments + +{//LAC parameters + $lacObjIdStr='2.2.6'; //find lac + $levelWhere = getLevelWhere($lacObjIdStr); + $mscParamTable='OBJ_322.param_99'; + $getSql="SELECT initValue FROM $mscParamTable + WHERE $levelWhere ORDER BY instanceNo + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + $i=0; + while($rows=mysqli_fetch_array($result)) + { + if(hexdec(getBitValue($rows[initValue],'0.0-0.1'))==1) + { + $lacAtt[$i][tg]=hexdec(getBitValue($rows[initValue],'1.0-1.7')); + $lacAtt[$i][lac]=hexdec(getBitValue($rows[initValue],'2.0-3.7')); + } + $i++; + } + $lacTotalNum=$i; +}//end lac parameters +//print_r($elementsArr); +if(0) +{//get bss' ip + $bssTable = "BssOmcDb.OMCR_BSSTABLE"; + $selSql = "select ip,bssid from $bssTable"; + $bssResult = mysqli_query($pubConn,$selSql); + while($bssRow = mysqli_fetch_array($bssResult)) + { + $bssIpArr[$bssRow[bssid]] = $bssRow[ip]; + } +}//end get bss' ip +//print_r($bssIpArr); +for($i=0;$itype={$elementsArr[$i][type]}"; + switch($elementsArr[$i][type]) + { + case '1'://BSS + { + $bssElementNo=sizeof($bssElementArr); + if($DEBUG) + echo"
      bssElementNo=$bssElementNo"; + $bssElementArr[$bssElementNo][linkset]=$elementsArr[$i][linkset]; + $bssElementArr[$bssElementNo][sysNo] = $tmp_sysNo = $elementsArr[$i][sysNo]; + $bssElementArr[$bssElementNo][name]=$elementsArr[$i][name]; + $bssElementArr[$bssElementNo][dpc]=$elementsArr[$i][dpc]; + $bssElementArr[$bssElementNo][ni]=$elementsArr[$i][ni]; + $bssElementArr[$bssElementNo][tg]=$elementsArr[$i][tg]; + $bssElementArr[$bssElementNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $bssElementArr[$bssElementNo][state]=$elementsArr[$i][state]; + else $bssElementArr[$bssElementNo][state] = "Refreshing"; + //$bssElementArr[$bssElementNo][ip]=$bssIpArr[$tmp_sysNo]; + if($DEBUG) echo "bssElementArr[$bssElementNo][state]$rows[instanceNo],{$elementsArr[$i][linkset]}={$bssElementArr[$bssElementNo][state]}
      "; + + for($k=0;$k< $lacTotalNum;$k++) + { + if(isset($lacAtt[$k][tg])&&$bssElementArr[$bssElementNo][tg]==$lacAtt[$k][tg]) + { + $bssElementArr[$bssElementNo][lac]=$lacAtt[$k][lac]; + break; + } + } + if($k==$lacTotalNum) + { + $bssElementArr[$bssElementNo][lac]='--'; + } + break; + } + case '2'://AAS + { + $aasElementNo=sizeof($aasElementArr); + $aasElementArr[$aasElementNo][linkset]=$elementsArr[$i][linkset]; + $aasElementArr[$aasElementNo][sysNo]=$elementsArr[$i][sysNo]; + $aasElementArr[$aasElementNo][name]=$elementsArr[$i][name]; + $aasElementArr[$aasElementNo][tg]=$elementsArr[$i][tg]; + $aasElementArr[$aasElementNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $aasElementArr[$aasElementNo][state]=$elementsArr[$i][state]; + else $aasElementArr[$aasElementNo][state]='Refreshing'; + + $tmpObjIdStr='2.1.3'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere and instanceNo<252 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + if(isset($tmpInstanceNo)) + unset($tmpInstanceNo); + while($rows=mysqli_fetch_array($result)) + { + $tmpValue=hexdec($rows[initValue]); + //echo "
      tmpValue=$tmpValue"; + if($tmpValue==$aasElementArr[$aasElementNo][tg]) + { + //echo "
      instance=$rows[instanceNo]"; + //echo "
      initValue=$rows[initValue]"; + //echo "
      prefixNoStr={$aasElementArr[$aasElementNo][prefixNoStr]}"; + $tmpObjIdStr='2.1.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue FROM OBJ_322.param_99 + WHERE $levelWhere AND instanceNo='$rows[instanceNo]' + "; + if($DEBUG)echo "
      getSql=$getSql"; + $result_2 =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows_2=mysqli_fetch_array($result_2); + $tmpPrefixArr=explode("E",$rows_2[initValue]); + if(strlen($tmpPrefixArr[0])==0) + continue; + $aasElementArr[$aasElementNo][prefix]=$tmpPrefixArr[0]; + + if(!isset($tmpInstanceNo)) + { + $tmpInstanceNo=$rows[instanceNo]; + $aasElementArr[$aasElementNo][prefixNoStr]=$rows[instanceNo]; + } + else + { + $aasElementArr[$aasElementNo][prefixNoStr] .= '.'.$rows[instanceNo]; + } + //echo "
      aasElementArr[$aasElementNo][prefixNoStr]: {$aasElementArr[$aasElementNo][prefixNoStr]}"; + } + } + + //Number of links + $hexTg = strtoupper(omc_keep_length(dechex($aasElementArr[$aasElementNo][tg]),'0',2)); + $tmpObjIdStr='2.4.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue FROM OBJ_322.param_99 + WHERE $levelWhere AND initValue like '$hexTg' + "; + if($DEBUG)echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $aasElementArr[$aasElementNo][linkNum]=mysqli_num_rows($result); + break; + } + case '3'://VSS + { + $vssElementNo=sizeof($vssElementArr); + $vssElementArr[$vssElementNo][linkset]=$elementsArr[$i][linkset]; + $vssElementArr[$vssElementNo][sysNo]=$elementsArr[$i][sysNo]; + $vssElementArr[$vssElementNo][name]=$elementsArr[$i][name]; + $vssElementArr[$vssElementNo][tg]=$elementsArr[$i][tg]; + $vssElementArr[$vssElementNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $vssElementArr[$vssElementNo][state]=$elementsArr[$i][state]; + else $vssElementArr[$vssElementNo][state]= 'Refreshing'; + $tmpObjIdStr='2.1.3'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere and instanceNo<252 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + if(isset($tmpInstanceNo)) + unset($tmpInstanceNo); + while($rows=mysqli_fetch_array($result)) + { + $tmpValue=hexdec($rows[initValue]); + //echo "
      tmpValue=$tmpValue"; + if($tmpValue==$vssElementArr[$vssElementNo][tg]) + { + //echo "
      instance=$rows[instanceNo]"; + //echo "
      initValue=$rows[initValue]"; + //echo "
      prefixNoStr={$vssElementArr[$vssElementNo][prefixNoStr]}"; + $tmpObjIdStr='2.1.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue FROM OBJ_322.param_99 + WHERE $levelWhere AND instanceNo='$rows[instanceNo]' + "; + if($DEBUG)echo "
      getSql=$getSql"; + $result_2 =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows_2=mysqli_fetch_array($result_2); + $tmpPrefixArr=explode("E",$rows_2[initValue]); + if(strlen($tmpPrefixArr[0])==0) + continue; + $vssElementArr[$vssElementNo][prefix]=$tmpPrefixArr[0]; + + if(!isset($tmpInstanceNo)) + { + $tmpInstanceNo=$rows[instanceNo]; + $vssElementArr[$vssElementNo][prefixNoStr]=$rows[instanceNo]; + } + else + { + $vssElementArr[$vssElementNo][prefixNoStr]=$vssElementArr[$vssElementNo][prefixNoStr].'.'.$rows[instanceNo]; + } + } + } + + //Number of links + $hexTg = strtoupper(omc_keep_length(dechex($vssElementArr[$vssElementNo][tg]),'0',2)); + $tmpObjIdStr='2.4.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue FROM OBJ_322.param_99 + WHERE $levelWhere AND initValue like '$hexTg' + "; + if($DEBUG)echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $vssElementArr[$vssElementNo][linkNum]=mysqli_num_rows($result); + break; + } + case '4'://PCR + { + $pcrElementNo=sizeof($pcrElementArr); + $pcrElementArr[$pcrElementNo][linkset]=$elementsArr[$i][linkset]; + $pcrElementArr[$pcrElementNo][sysNo]=$elementsArr[$i][sysNo]; + $pcrElementArr[$pcrElementNo][name]=$elementsArr[$i][name]; + $pcrElementArr[$pcrElementNo][tg]=$elementsArr[$i][tg]; + $pcrElementArr[$pcrElementNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $pcrElementArr[$pcrElementNo][state]=$elementsArr[$i][state]; + else $pcrElementArr[$pcrElementNo][state] = 'Refreshing'; + //$pcrElementArr[$pcrElementNo][state]=getE1State($pcrElementArr[$pcrElementNo][tg],$elementsArr[$i][linkset]); + + $tmpObjIdStr='2.1.3'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere and instanceNo<252 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + if(isset($tmpInstanceNo)) + unset($tmpInstanceNo); + while($rows=mysqli_fetch_array($result)) + { + $tmpValue=hexdec($rows[initValue]); + //echo "
      tmpValue=$tmpValue"; + if($tmpValue==$pcrElementArr[$pcrElementNo][tg]) + { + //echo "
      instance=$rows[instanceNo]"; + //echo "
      initValue=$rows[initValue]"; + //echo "
      prefixNoStr={$pcrElementArr[$pcrElementNo][prefixNoStr]}"; + $tmpObjIdStr='2.1.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue FROM OBJ_322.param_99 + WHERE $levelWhere AND instanceNo='$rows[instanceNo]' + "; + if($DEBUG)echo "
      getSql=$getSql"; + $result_2 =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows_2=mysqli_fetch_array($result_2); + $tmpPrefixArr=explode("E",$rows_2[initValue]); + if(strlen($tmpPrefixArr[0])==0 || $tmpPrefixArr[0]!='BB') + continue; + $pcrElementArr[$pcrElementNo][prefix]=$tmpPrefixArr[0]; + + if(!isset($tmpInstanceNo)) + { + $tmpInstanceNo=$rows[instanceNo]; + $pcrElementArr[$pcrElementNo][prefixNoStr]=$rows[instanceNo]; + } + else + { + $pcrElementArr[$pcrElementNo][prefixNoStr]=$pcrElementArr[$pcrElementNo][prefixNoStr].'.'.$rows[instanceNo]; + } + } + } + + //Number of links + $hexTg = omc_keep_length(dechex($pcrElementArr[$pcrElementNo][tg]),'0',2); + $tmpObjIdStr='2.4.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue FROM OBJ_322.param_99 + WHERE $levelWhere AND initValue like '$hexTg' + "; + if($DEBUG)echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $pcrElementArr[$pcrElementNo][linkNum]=mysqli_num_rows($result); + break; + } + case '5'://CNF 多个cnf公用一个linkset,从SubsysNo中区分每个cnf:(sysNo + subSysNo) 0001 0000 -> cnf-0-1; 1000 0000 -> cnf-0-4 + { + $cnfElementNo=sizeof($cnfElementArr); + $cnfElementArr[$cnfElementNo][infoNo]=$elementsArr[$i][infoNo]; + $cnfElementArr[$cnfElementNo][linkset]=$elementsArr[$i][linkset]; + $cnfElementArr[$cnfElementNo][subSysNo]=$elementsArr[$i][subSysNo]; + $cnfElementArr[$cnfElementNo][sysNo]=$elementsArr[$i][sysNo]; + //$cnfElementArr[$cnfElementNo][name]=$elementsArr[$i][name]."-0-$j"; + $cnfElementArr[$cnfElementNo][name]=$elementsArr[$i][name]; + $cnfElementArr[$cnfElementNo][tg] = $elementsArr[$i][tg]; + if($getState) $cnfElementArr[$cnfElementNo][state] = $elementsArr[$i][state]; + else $cnfElementArr[$cnfElementNo][state] = 'Refreshing'; + $cnfElementArr[$cnfElementNo][prefixNoStr] = $cnfPrefixArr; + $cnfElementArr[$cnfElementNo][prefix] = $cnfPrefix; + $cnfElementArr[$cnfElementNo][linkNum] = $cnfLinkNum; + $cnfElementNo++; + break; + } + case '6'://CNF Center + { + $cnfCenterTg = $elementsArr[$i][tg]; + $cnfCenterInfoNo = $elementsArr[$i][infoNo]; + break; + } + case '16'://ss7 switch + { + $switchElementNo=sizeof($switchElementArr); + $switchElementArr[$switchElementNo][linkset]=$elementsArr[$i][linkset]; + $switchElementArr[$switchElementNo][ni]=$elementsArr[$i][ni]; + $switchElementArr[$switchElementNo][dpc]=$elementsArr[$i][dpc]; + $switchElementArr[$switchElementNo][sysNo]=$elementsArr[$i][sysNo]; + $switchElementArr[$switchElementNo][name]=$elementsArr[$i][name]; + $switchElementArr[$switchElementNo][tg]=$elementsArr[$i][tg]; + $for_application_tg = $rows[instanceNo]; + $switchElementArr[$switchElementNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $switchElementArr[$switchElementNo][state]=$elementsArr[$i][state]; + else $switchElementArr[$switchElementNo][state]= 'Refreshing'; + + //$switchElementArr[$switchElementNo][state]=getE1State($switchElementArr[$switchElementNo][tg],$elementsArr[$i][linkset]); + if($DEBUG) echo "switchElementArr[$switchElementNo][state]$rows[instanceNo],{$elementsArr[$i][linkset]}={$switchElementArr[$switchElementNo][state]}
      "; + + $tmpObjIdStr='2.1.3'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere and instanceNo<252 + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + if(isset($tmpInstanceNo)) + unset($tmpInstanceNo); + while($rows=mysqli_fetch_array($result)) + { + //echo "
      instance=$rows[instanceNo]"; + //echo "
      initValue=$rows[initValue]"; + $tmpValue=hexdec($rows[initValue]); + if($tmpValue==$switchElementArr[$switchElementNo][tg]) + { + $tmpObjIdStr='2.1.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue FROM OBJ_322.param_99 + WHERE $levelWhere AND instanceNo='$rows[instanceNo]' + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result_2 =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows_2=mysqli_fetch_array($result_2); + $tmpPrefixArr=explode("E",$rows_2[initValue]); + if(strlen($tmpPrefixArr[0])==0) + continue; + + //$tmpValue=hexdec($tmpValue); + if(!isset($tmpInstanceNo)) + { + $tmpInstanceNo=$rows[instanceNo]; + $switchElementArr[$switchElementNo][prefixNoStr]=$rows[instanceNo]; + $switchElementArr[$switchElementNo][prefix]=$tmpPrefixArr[0]; + } + else + { + $switchElementArr[$switchElementNo][prefixNoStr]=$switchElementArr[$switchElementNo][prefixNoStr].'.'.$rows[instanceNo]; + } + } + } + + break; + } + case '17'://ISDN switch + { + $switchElementNo=sizeof($switchElementArr); + $switchElementArr[$switchElementNo][linkset]=-1;//no linkset + //$switchElementArr[$switchElementNo][networkIndicator]=-1; + //$switchElementArr[$switchElementNo][dpc]='-1'; + $switchElementArr[$switchElementNo][sysNo]=$elementsArr[$i][sysNo]; + $switchElementArr[$switchElementNo][name]=$elementsArr[$i][name]; + $switchElementArr[$switchElementNo][tg]=$elementsArr[$i][tg]; + $switchElementArr[$switchElementNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $switchElementArr[$switchElementNo][state]=$elementsArr[$i][state]; + else $switchElementArr[$switchElementNo][state]='Refreshing'; + break; + } + case '18'://Application + { + $tmpEleType = $elementsArr[$i][appType]; + if($tmpEleType==0)//MSC + { + $mscEleNo = sizeof($mscElementArr); + $mscElementArr[$mscEleNo][linkset]=$elementsArr[$i][linkset]; + $mscElementArr[$mscEleNo][name]= $elementsArr[$i][name]; + $mscElementArr[$mscEleNo][tg]=$elementsArr[$i][tg]; + $mscElementArr[$mscEleNo][grpNo]=$elementsArr[$i][appGrp]; + $mscElementArr[$mscEleNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $mscElementArr[$mscEleNo][state]=$elementsArr[$i][state]; + else $mscElementArr[$mscEleNo][state]='Refreshing'; + } + //else if($tmpApplicationType==6)//hlr + else if($tmpEleType==1)//hlr + { + $hlrEleNo = sizeof($hlrElementArr); + $hlrElementArr[$hlrEleNo][linkset]=$elementsArr[$i][linkset]; + $hlrElementArr[$hlrEleNo][name]= $elementsArr[$i][name]; + $hlrElementArr[$hlrEleNo][tg]=$elementsArr[$i][tg]; + $hlrElementArr[$hlrEleNo][grpNo]=$elementsArr[$i][appGrp]; + $hlrElementArr[$hlrEleNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $hlrElementArr[$hlrEleNo][state]=$elementsArr[$i][state]; + else $hlrElementArr[$hlrEleNo][state]='Refreshing'; + } + else if($tmpEleType==2)//vlr + { + $vlrEleNo = sizeof($vlrElementArr); + $vlrElementArr[$vlrEleNo][linkset]=$elementsArr[$i][linkset]; + $vlrElementArr[$vlrEleNo][name]= $elementsArr[$i][name]; + $vlrElementArr[$vlrEleNo][tg]=$elementsArr[$i][tg]; + $vlrElementArr[$vlrEleNo][grpNo]=$elementsArr[$i][appGrp]; + $vlrElementArr[$vlrEleNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $vlrElementArr[$vlrEleNo][state]=$elementsArr[$i][state]; + else $vlrElementArr[$vlrEleNo][state]='Refreshing'; + } + else if($tmpEleType==3)//mc + { + $mcEleNo = sizeof($mcElementArr); + $mcElementArr[$mcEleNo][linkset]=$elementsArr[$i][linkset]; + $mcElementArr[$mcEleNo][name]= $elementsArr[$i][name]; + $mcElementArr[$mcEleNo][tg]=$elementsArr[$i][tg]; + $mcElementArr[$mcEleNo][grpNo]=$elementsArr[$i][appGrp]; + $mcElementArr[$mcEleNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $mcElementArr[$mcEleNo][state]=$elementsArr[$i][state]; + else $mcElementArr[$mcEleNo][state]='Refreshing'; + } + else if($tmpEleType==4)//sgsn + { + $sgsnEleNo = sizeof($sgsnElementArr); + $sgsnElementArr[$sgsnEleNo][linkset]=$elementsArr[$i][linkset]; + $sgsnElementArr[$sgsnEleNo][name]= $elementsArr[$i][name]; + $sgsnElementArr[$sgsnEleNo][tg]=$elementsArr[$i][tg]; + $sgsnElementArr[$sgsnEleNo][grpNo]=$elementsArr[$i][appGrp]; + $sgsnElementArr[$sgsnEleNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $sgsnElementArr[$sgsnEleNo][state]=$elementsArr[$i][state]; + else $sgsnElementArr[$sgsnEleNo][state]='Refreshing'; + } + else if($tmpEleType==5)//new element + { + $newEleNo = sizeof($newElementArr); + $newElementArr[$newEleNo][linkset]=$elementsArr[$i][linkset]; + $newElementArr[$newEleNo][name]= $elementsArr[$i][name]; + $newElementArr[$newEleNo][tg]=$elementsArr[$i][tg]; + $newElementArr[$newEleNo][grpNo]=$elementsArr[$i][appGrp]; + $newElementArr[$newEleNo][infoNo]=$elementsArr[$i][infoNo]; + if($getState) $newElementArr[$newEleNo][state]=$elementsArr[$i][state]; + else $newElementArr[$newEleNo][state]= 'Refreshing'; + } + break; + } + default: + break; + } + +} +?> + + +"; + +if(isset($upLoadResult)&&(strlen($upLoadResult)>0)){ + if($upLoadResult=='success') + echo ""; + elseif($upLoadResult=='setsuccess') + echo ""; + elseif($upLoadResult=='getsuccess') + echo ""; + else + echo ""; +}else{ + echo ""; +} +echo ""; +echo ""; +echo ""; + echo ""; + echo ""; +echo ""; +?> +
      Download SuccessfulSet All Parameters SuccessfulGet All Parameters SuccessfulDownload failed.
      $upLoadResult
        
      "; + echo "   "; + //echo ""; + echo ""; + echo "Add"; +echo "
      + +existflag={$localElementArr[$i][existFlag]}"; + if($localElementArr[$i][existFlag]==1) + break; +} + +if($i==sizeof($localElementArr) + &&sizeof($bssElementArr)==0 + &&sizeof($aasElementArr)==0 + &&sizeof($vssElementArr)==0 + &&sizeof($pcrElementArr)==0 + &&sizeof($cnfElementArr)==0 + &&sizeof($switchElementArr)==0 + &&sizeof($mscElementArr)==0 + &&sizeof($vlrElementArr)==0 + &&sizeof($hlrElementArr)==0 + &&sizeof($mcElementArr)==0 + &&sizeof($sgsnElementArr)==0 + &&sizeof($newElementArr)==0) +{ + echo "
      No element"; + exit(); +} +//rules=rows +?> + +
      +{${$eleName}[$i][state]}"; +} + +for($i=0;$iexistflag={$localElementArr[$i][existFlag]}"; + if($localElementArr[$i][existFlag]==1) + { + + //MSS + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + break; + } +} +unset($needBackupArr); +if(session_is_registered("needBackupArr")) + session_unregister("needBackupArr"); + +$overBgColor = "#D2F0FF"; +$indexNum=0; +for($i=0;$iexistflag={$localElementArr[$i][existFlag]}"; + if($localElementArr[$i][existFlag]==1) + { + $tmpTypNo = $localElementArr[$i][sysTypeNo]; + if($tmpTypNo==320) $tmpTypNo = 322; + $needBackupArr[] = array('typeNo' => $tmpTypNo, 'name' => $localElementArr[$i][sysTypeName]); + echo ""; + //{$localElementArr[$i][confLink]}?license={$localElementArr[$i][license]}&users={$localElementArr[$i][users]} + echo ""; + //echo ""; + if(strlen($localElementArr[$i][GT])>0) + echo ""; + else + echo ""; + if($localElementArr[$i][sysTypeNo]==320) + { + //============get the E1 license for MSC============================== + $sel_mes_sql="SELECT detailStat FROM sysStat + WHERE + sysTypeNo='320' + "; + if($DEBUG)echo "
      sel_mes_sql=$sel_mes_sql"; + $sel_mes_res=mysqli_query($pubConn,$sel_mes_sql); + $sel_mes_row=@mysqli_fetch_array($sel_mes_res); + + echo mysqli_error($pubConn); + + if(!$sel_mes_row) + { + $e1_license_msc="--"; + } + else + { + $hex_mes=$sel_mes_row[detailStat]; + $lcn_bgn = 31; //license user + //$real_bgn = 35; //real user + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + $e1_license_msc=$lcnNum."(E1)"; + } + + + + echo ""; + echo ""; + } + else if($localElementArr[$i][sysTypeNo]==350) + { + echo ""; + echo ""; + + } + else + { + echo ""; + echo ""; + } + if($localElementArr[$i][state]>0) + { + $value="Normal"; + $color="#0000ff"; + $cursor="pointer"; + } + else + { + $value = "Alarm"; + $color = "#FF0000"; + $cursor='pointer'; + } + $id_name = "localEleSta_".$indexNum; + //echo ""; + echo ""; + + echo ""; + echo ""; + $indexNum++; + } + +} + +//To BSS +$indexNum=0; +if(sizeof($bssElementArr)>0) +{ + $bssNeedBackup=1; + foreach($bssElementArr as $key => $row) + { + $name[$key] = $row['name']; + } + array_multisort($name, SORT_ASC, $bssElementArr); + echo ""; + if($needBssIp==1){ + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo ""; + echo ""; +} +for($i=0;$i"; + //echo ""; + if($needBssIp==1){ + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + } + if($needBssIp==1) + {//get numbers of bts. + $bssDb = "BssOmcDb"; + $tmpBssid = $bssElementArr[$i][sysNo]; + $sqlstring = "select engDisplayName,ObjectId from OMCR_BSSTREE where engDisplayName like 'BTS Manager%' and ObjectId<>'BtsMgr.0' and Presence=1 and bssid=$tmpBssid"; + //echo $sqlstring . "
      "; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + while($row = mysqli_fetch_row($result)) + { + list($bts_display_name[],$bts_object_name[]) =$row; + } + $no_of_bts = count($bts_object_name); + echo ""; + }//end get bts number. + else + echo ""; + + $flg = 'bss'; + showStatus($flg,$i,$indexNum); + + if(strlen($bssElementArr[$i][tg])<=0) + $otherVar_1='-1'; + else + $otherVar_1=$bssElementArr[$i][tg]; + if(strlen($bssElementArr[$i][btsArr])<=0) + $otherVar_2='-1'; + else + $otherVar_2=$bssElementArr[$i][btsArr]; + //echo "
      otherVar_2=$otherVar_2"; + echo ""; + $indexNum++; +} + +//To Periphreal +{ +if(sizeof($aasElementArr)>0 + ||sizeof($vssElementArr)>0 + ||sizeof($pcrElementArr)>0 + ||sizeof($cnfElementArr)>0) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; +} +//To AAS +if(sizeof($aasElementArr)) +{ + $needBackupArr[] = array('typeNo' => 311, 'name' => 'AAS'); + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$aasElementArr[$i][infoNo]}&linkset={$aasElementArr[$i][linkset]}&trunkgp={$aasElementArr[$i][tg]}&sysNo={$aasElementArr[$i][sysNo]}&flag=$getflag + echo ""; + //../toElement/loadaas.php?infoNo={$aasElementArr[$i][infoNo]}&linkset={$aasElementArr[$i][linkset]}&trunkgp={$aasElementArr[$i][tg]}&sysNo={$aasElementArr[$i][sysNo]}&flag=$getflag + echo ""; + + if(strlen($aasElementArr[$i][prefix])>0) + echo ""; + else + echo ""; + + echo ""; + $flg = 'aas'; + showStatus($flg,$i,$indexNum); + + if(strlen($aasElementArr[$i][tg])<=0) + $otherVar_1='-1'; + else + $otherVar_1=$aasElementArr[$i][tg]; + if(strlen($aasElementArr[$i][prefixNoStr])<=0) + $otherVar_2='-1'; + else + $otherVar_2=$aasElementArr[$i][prefixNoStr]; + echo ""; + $indexNum++; + } +} +//to VSS +if(sizeof($vssElementArr)) +{ + $needBackupArr[] = array('typeNo' => 390, 'name' => 'VSS'); + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$vssElementArr[$i][infoNo]}&linkset={$vssElementArr[$i][linkset]}&trunkgp={$vssElementArr[$i][tg]}&sysNo={$vssElementArr[$i][sysNo]}&flag=$getflag + echo ""; + //../toElement/loadvss.php?infoNo={$vssElementArr[$i][infoNo]}&linkset={$vssElementArr[$i][linkset]}&trunkgp={$vssElementArr[$i][tg]}&sysNo={$vssElementArr[$i][sysNo]}&flag=$getflag + echo ""; + + //======hide the VSS prefix=================== + /* + if(strlen($vssElementArr[$i][prefix])>0) + echo ""; + else + echo ""; + */ + //===========VSS DPC============ + $tg_tmp=$vssElementArr[$i][tg]; + $database="OBJ_322"; + $sql="select initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$tg_tmp "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $dpc_tmp=hexdec(getBitValue($rows[initValue],'0.0-3.7'))+0; + echo ""; + echo ""; + $flg = 'vss'; + showStatus($flg,$i,$indexNum); + + if(strlen($vssElementArr[$i][tg])<=0) + $otherVar_1='-1'; + else + $otherVar_1=$vssElementArr[$i][tg]; + if(strlen($vssElementArr[$i][prefixNoStr])<=0) + $otherVar_2='-1'; + else + $otherVar_2=$vssElementArr[$i][prefixNoStr]; + echo ""; + $indexNum++; + } +} +//to PCR +if(sizeof($pcrElementArr)) +{ + $needBackupArr[] = array('typeNo' => 130, 'name' => 'PCR'); + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$pcrElementArr[$i][infoNo]}&linkset={$pcrElementArr[$i][linkset]}&trunkgp={$pcrElementArr[$i][tg]}&sysNo={$pcrElementArr[$i][sysNo]}&flag=$getflag + echo ""; + //../toElement/loadpcr.php?infoNo={$pcrElementArr[$i][infoNo]}&linkset={$pcrElementArr[$i][linkset]}&trunkgp={$pcrElementArr[$i][tg]}&sysNo={$pcrElementArr[$i][sysNo]}&flag=$getflag + echo ""; + + + + + //======PCR DPC====== + $tg_tmp=$pcrElementArr[$i][tg]; + $database="OBJ_322"; + $sql="select initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$tg_tmp "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $dpc_tmp=hexdec(getBitValue($rows[initValue],'0.0-3.7'))+0; + echo ""; + + echo ""; + $flg = 'pcr'; + showStatus($flg,$i,$indexNum); + + if(strlen($pcrElementArr[$i][tg])<=0) + $otherVar_1='-1'; + else + $otherVar_1=$pcrElementArr[$i][tg]; + if(strlen($pcrElementArr[$i][prefixNoStr])<=0) + $otherVar_2='-1'; + else + $otherVar_2=$pcrElementArr[$i][prefixNoStr]; + echo ""; + $indexNum++; + } +} +//to CNF +if(sizeof($cnfElementArr)) +{ + $needBackupArr[] = array('typeNo' => 160, 'name' => 'CNF'); + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$cnfElementArr[$i][infoNo]}&linkset={$cnfElementArr[$i][linkset]}&trunkgp={$cnfElementArr[$i][tg]}&subSysNo={$cnfElementArr[$i][subSysNo]}&flag=$getflag + echo ""; + //../toElement/loadcnf.php?infoNo={$cnfElementArr[$i][infoNo]}&linkset={$cnfElementArr[$i][linkset]}&trunkgp={$cnfElementArr[$i][tg]}&subSysNo={$cnfElementArr[$i][subSysNo]}&flag=$getflag + echo ""; + + + + //=======CNF DPC============ + $tg_tmp=$cnfElementArr[$i][tg]; + $database="OBJ_322"; + $sql="select initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$tg_tmp "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $dpc_tmp=hexdec(getBitValue($rows[initValue],'0.0-3.7'))+0; + echo ""; + + echo ""; + $flg = 'cnf'; + showStatus($flg,$i,$indexNum); + + if(strlen($cnfElementArr[$i][tg])<=0) + $otherVar_1='-1'; + else + $otherVar_1=$cnfElementArr[$i][tg]; + if(strlen($cnfElementArr[$i][prefixNoStr])<=0) + $otherVar_2='-1'; + else + $otherVar_2=$cnfElementArr[$i][prefixNoStr]; + if(sizeof($cnfElementArr)==1)//最后一个CNF时,删除相应的TG,以及CNF使用的TG, infoNo。 + { + $otherVar_1 = $otherVar_1 . '.' . $cnfCenterTg . '.' . $cnfCenterInfoNo; + } + else //不是最后一个CNF,$otherVar_1=-1将不会删除他们使用的TG + $otherVar_1 = '-1'; + echo ""; + $indexNum++; + } +} +}//end Peripheral +//To Switch +if(sizeof($switchElementArr)>0){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +if(sizeof($switchElementArr)==1) + $otherTg_Str="-1"; +$indexNum=0; +for($i=0;$i"; + //../toElement/loaddata.php?linkset={$switchElementArr[$i][linkset]}&infoNo={$switchElementArr[$i][infoNo]}&trunkgp={$switchElementArr[$i][tg]}&sysNo={$switchElementArr[$i][sysNo]}&flag=$getflag + echo ""; + if($switchElementArr[$i][linkset]==-1) + { + for($k=0; $k<2; $k++) + echo ""; + //============get the E1 Number of ISDN ================= + $tg_tmp=$switchElementArr[$i][tg]+0; + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $e1_count=0; + + do{ + $tmp=hexdec(getBitValue($rows[initValue],'0.0-0.7'))+0; + if($tmp==$tg_tmp) + $e1_count++; + }while($rows=mysqli_fetch_array($result)); + echo ""; + } + else + { + $tmpni = $switchElementArr[$i][ni]; + + echo ""; + + $decdpc = ($switchElementArr[$i][dpc]); + echo ""; + //echo ""; + //======hide the prefix==================== + /* + if(strlen($switchElementArr[$i][prefix])>0) + echo ""; + else + echo ""; + */ + //==============show the number of E1================ + + + //============get the E1 Number of SS7 ================= + $tg_tmp=$switchElementArr[$i][tg]+0; + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $e1_count=0; + + do{ + $tmp=hexdec(getBitValue($rows[initValue],'0.0-0.7'))+0; + if($tmp==$tg_tmp) + $e1_count++; + }while($rows=mysqli_fetch_array($result)); + echo ""; + } + $flg = 'switch'; + showStatus($flg,$i,$indexNum); + + if(strlen($switchElementArr[$i][tg])<=0) + $otherVar_1='-1'; + else + $otherVar_1=$switchElementArr[$i][tg]; + if(strlen($switchElementArr[$i][prefixNoStr])<=0) + $otherVar_2='-1'; + else + $otherVar_2=$switchElementArr[$i][prefixNoStr]; + //echo "
      otherVar_1=$otherVar_1"; + if(strlen($switchElementArr[$i][infoNo])<=0) + $switchElementArr[$i][infoNo]=-1; + + echo ""; + $indexNum++; + $otherTg_Str=''; +} + +//To Application +if(sizeof($mscElementArr)>0||sizeof($hlrElementArr)>0||sizeof($vlrElementArr)>0||sizeof($mcElementArr)>0||sizeof($sgsnElementArr)>0 ||sizeof($newElementArr)>0){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +{//Application + + + //=======get the all attribute from gtt table================== + for($i=0;$i<256;$i++) + { + $gtt_number_plan[$i]=-1; + $gtt_translation_type[$i]=-1; + $gtt_DPC[$i]="--"; + $gtt_start_gt[$i]=-1; + $gtt_end_gt[$i]=-1; + $gtt_title_name[$i]="--"; + } + $database="OBJ_223"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + do{ + + + //==instanceNo + $tmpInstanceNo=$rows[instanceNo]; + //==number plan + $gtt_number_plan[$tmpInstanceNo]=hexdec(getBitValue($rows[initValue],'1.0-1.7'))+0; + //==translation type + $gtt_translation_type[$tmpInstanceNo]=hexdec(getBitValue($rows[initValue],'2.0-2.7'))+0; + //==DPC + $gtt_DPC[$tmpInstanceNo]=hexdec(getBitValue($rows[initValue],'24.0-26.7')); + //==start gt + $temp=getBitValue($rows[initValue],'3.0-12.7'); + $temp=str_replace('F','',$temp); + if(strlen($temp)==0) + $gtt_start_gt[$tmpInstanceNo]=-1; + else + $gtt_start_gt[$tmpInstanceNo]=$temp; + //==end gt + $temp=getBitValue($rows[initValue],'13.0-22.7'); + $temp=str_replace('F','',$temp); + if(strlen($temp)==0) + $gtt_end_gt[$tmpInstanceNo]=-1; + else + $gtt_end_gt[$tmpInstanceNo]=$temp; + + + //if($tmpInstanceNo==15) + // alert($gtt_start_gt[$tmpInstanceNo]); + + }while($rows=mysqli_fetch_array($result)); + + + //================get the GTT title name from GTT application table================== + $database="OBJ_223"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + do{ + //==instanceNo + $tmpInstanceNo=$rows[instanceNo]; + $tmp_title_name=getBitValue($rows[initValue],'3.0-12.7'); + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($tmp_title_name,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $gtt_title_name[$tmpInstanceNo]=trim($temp); + }while($rows=mysqli_fetch_array($result)); + + //===================================test========================================== + /* + for($i=0;$i<256;$i++) + { + echo "
      "; + echo "InstanceNo: $i
      "; + echo "---NP:{$gtt_number_plan[$i]}
      "; + echo "---TT:{$gtt_translation_type[$i]}
      "; + echo "---DPC:{$gtt_DPC[$i]}
      "; + echo "---start_gt:{$gtt_start_gt[$i]}
      "; + echo "---end_gt:{$gtt_end_gt[$i]}
      "; + + } + */ + //================================================================================= + + + //======================================msc========================================== + $indexNum = 0; + for($i=0; $i"; + //../toElement/loaddata.php?infoNo={$mscElementArr[$i][infoNo]}&infoNo={$mscElementArr[$i][infoNo]}&linkset={$mscElementArr[$i][linkset]}&appType=0>tSSN=8&grpNo={$mscElementArr[$i][grpNo]}&trunkgp={$mscElementArr[$i][tg]}&flag=$getflag + echo ""; + + + //================get the DPC by linkset instanceNo=================== + $linksetInstanceNo=$mscElementArr[$i][linkset]; + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=1 and instanceNo=$linksetInstanceNo"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $DPCtmp=hexdec(getBitValue($rows[initValue],'0.0-2.7'))+0; + //alert("MSC DPC:".$DPCtmp); + + $NItmp=bindec(getBitValue($rows[initValue],'3.0-3.1'))+0; + //alert("MSC NI:".$NItmp); + //==========================decide ansi or itu======================================== + switch($NItmp) + { + case 0: + $NIoffset='0.4-0.4'; + break; + case 1: + $NIoffset='0.5-0.5'; + break; + case 2: + $NIoffset='0.6-0.6'; + break; + case 3: + $NIoffset='0.7-0.7'; + break; + } + + //alert("MSC offset:".$NIoffset); + + + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $ITU_ANSI=getBitValue($rows[initValue],$NIoffset); + + $E164_number="--"; + $MSISDN_Range="--"; + $IMSI_Range="--"; + + //==ANSI + if($ITU_ANSI) + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==1) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //===========================MSISDN ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + + if($gtt_translation_type[$index]==14) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //===========================IMSI ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==9) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + //==ITU + else + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + //alert("MSC NP:".$gtt_number_plan[$index]); + //$gtt_number_plan[$index]=7; + if($gtt_number_plan[$index]==7) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + //break; + } + } + } + //alert("MSC E164 number:".$E164_number); + //=========================MSISDN======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==1) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //=========================IMSI======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==6) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + + echo ""; + echo ""; + echo ""; + + + + //state + $flg = 'msc'; + showStatus($flg,$i,$indexNum); + echo ""; + $indexNum++; + } + //=====================================hlr========================================== + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$hlrElementArr[$i][infoNo]}&linkset={$hlrElementArr[$i][linkset]}&appType=1>tSSN=6&grpNo={$hlrElementArr[$i][grpNo]}&trunkgp={$hlrElementArr[$i][tg]}&flag=$getflag + echo ""; + + + //================get the DPC by linkset instanceNo=================== + $linksetInstanceNo=$hlrElementArr[$i][linkset]; + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=1 and instanceNo=$linksetInstanceNo"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $DPCtmp=hexdec(getBitValue($rows[initValue],'0.0-2.7'))+0; + //alert($DPCtmp); + $NItmp=bindec(getBitValue($rows[initValue],'3.0-3.1'))+0; + //alert($NItmp); + //==========================decide ansi or itu======================================== + switch($NItmp) + { + case 0: + $NIoffset='0.4-0.4'; + break; + case 1: + $NIoffset='0.5-0.5'; + break; + case 2: + $NIoffset='0.6-0.6'; + break; + case 3: + $NIoffset='0.7-0.7'; + break; + } + + //alert($NIoffset); + + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $ITU_ANSI=getBitValue($rows[initValue],$NIoffset); + + $E164_number="--"; + $MSISDN_Range="--"; + $IMSI_Range="--"; + + //==ANSI + if($ITU_ANSI) + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==1) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //===========================MSISDN ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==14) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //===========================IMSI ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==9) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + //==ITU + else + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==7) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //=========================MSISDN======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==1) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //=========================IMSI======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==6) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + + echo ""; + echo ""; + echo ""; + + + + + + //state + $flg = 'hlr'; + showStatus($flg,$i,$indexNum); + $indexNum++; + echo ""; + } + + //====================================vlr========================================== + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$vlrElementArr[$i][infoNo]}&linkset={$vlrElementArr[$i][linkset]}&appType=2>tSSN=7&grpNo={$vlrElementArr[$i][grpNo]}&trunkgp={$vlrElementArr[$i][tg]}&flag=$getflag + echo ""; + + + //================get the DPC by linkset instanceNo=================== + $linksetInstanceNo=$vlrElementArr[$i][linkset]; + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=1 and instanceNo=$linksetInstanceNo"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $DPCtmp=hexdec(getBitValue($rows[initValue],'0.0-2.7'))+0; + //alert($DPCtmp); + $NItmp=bindec(getBitValue($rows[initValue],'3.0-3.1'))+0; + //alert($NItmp); + //==========================decide ansi or itu======================================== + switch($NItmp) + { + case 0: + $NIoffset='0.4-0.4'; + break; + case 1: + $NIoffset='0.5-0.5'; + break; + case 2: + $NIoffset='0.6-0.6'; + break; + case 3: + $NIoffset='0.7-0.7'; + break; + } + + //alert($NIoffset); + + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $ITU_ANSI=getBitValue($rows[initValue],$NIoffset); + + $E164_number="--"; + $MSISDN_Range="--"; + $IMSI_Range="--"; + + //==ANSI + if($ITU_ANSI) + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==1) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //===========================MSISDN ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==14) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //===========================IMSI ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==9) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + //==ITU + else + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==7) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //=========================MSISDN======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==1) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //=========================IMSI======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==6) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + + echo ""; + echo ""; + echo ""; + + + + + + //state + $flg = 'vlr'; + showStatus($flg,$i,$indexNum); + $indexNum++; + echo ""; + } + + //===================================mc============================================== + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$mcElementArr[$i][infoNo]}&linkset={$mcElementArr[$i][linkset]}&appType=3>tSSN=11&grpNo={$mcElementArr[$i][grpNo]}&trunkgp={$mcElementArr[$i][tg]}&flag=$getflag + echo ""; + + + + //================get the DPC by linkset instanceNo=================== + $linksetInstanceNo=$mcElementArr[$i][linkset]; + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=1 and instanceNo=$linksetInstanceNo"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $DPCtmp=hexdec(getBitValue($rows[initValue],'0.0-2.7'))+0; + //alert($DPCtmp); + $NItmp=bindec(getBitValue($rows[initValue],'3.0-3.1'))+0; + //alert($NItmp); + //==========================decide ansi or itu======================================== + switch($NItmp) + { + case 0: + $NIoffset='0.4-0.4'; + break; + case 1: + $NIoffset='0.5-0.5'; + break; + case 2: + $NIoffset='0.6-0.6'; + break; + case 3: + $NIoffset='0.7-0.7'; + break; + } + + //alert($NIoffset); + + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $ITU_ANSI=getBitValue($rows[initValue],$NIoffset); + + $E164_number="--"; + $MSISDN_Range="--"; + $IMSI_Range="--"; + + //==ANSI + if($ITU_ANSI) + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==1) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //===========================MSISDN ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==14) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //===========================IMSI ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==9) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + //==ITU + else + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==7) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //=========================MSISDN======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==1) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //=========================IMSI======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==6) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + + echo ""; + echo ""; + echo ""; + + + + + //state + $flg = 'mc'; + showStatus($flg,$i,$indexNum); + $indexNum++; + echo ""; + } + //===============================sgsn=============================================== + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$sgsnElementArr[$i][infoNo]}&linkset={$sgsnElementArr[$i][linkset]}&appType=3>tSSN=11&grpNo={$sgsnElementArr[$i][grpNo]}&trunkgp={$sgsnElementArr[$i][tg]}&flag=$getflag + echo ""; + + + //================get the DPC by linkset instanceNo=================== + $linksetInstanceNo=$sgsnElementArr[$i][linkset]; + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=1 and instanceNo=$linksetInstanceNo"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $DPCtmp=hexdec(getBitValue($rows[initValue],'0.0-2.7'))+0; + //alert($DPCtmp); + $NItmp=bindec(getBitValue($rows[initValue],'3.0-3.1'))+0; + //alert($NItmp); + //==========================decide ansi or itu======================================== + switch($NItmp) + { + case 0: + $NIoffset='0.4-0.4'; + break; + case 1: + $NIoffset='0.5-0.5'; + break; + case 2: + $NIoffset='0.6-0.6'; + break; + case 3: + $NIoffset='0.7-0.7'; + break; + } + + //alert($NIoffset); + + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $ITU_ANSI=getBitValue($rows[initValue],$NIoffset); + + $E164_number="--"; + $MSISDN_Range="--"; + $IMSI_Range="--"; + + //==ANSI + if($ITU_ANSI) + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==1) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //===========================MSISDN ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==14) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //===========================IMSI ====================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_translation_type[$index]==9) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + //==ITU + else + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==7) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //=========================MSISDN======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==1) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //=========================IMSI======================================= + for($index=0;$index<256;$index++) + { + if($gtt_DPC[$index]==$DPCtmp) + { + if($gtt_number_plan[$index]==6) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + + echo ""; + echo ""; + echo ""; + + + + + //state + $flg = 'sgsn'; + showStatus($flg,$i,$indexNum); + $indexNum++; + echo ""; + } + //================================new element=========================================== + $indexNum = 0; + for($i=0;$i"; + //../toElement/loaddata.php?infoNo={$newElementArr[$i][infoNo]}&linkset={$newElementArr[$i][linkset]}&appType=5>tSSN=6&grpNo={$newElementArr[$i][grpNo]}&trunkgp={$newElementArr[$i][tg]}&flag=$getflag + echo ""; + + + + + + //================get the DPC by linkset instanceNo=================== + $NI_label=array(0=>"International",1=>"International spare",2=>"National",3=>"National spare"); + $linksetInstanceNo=$newElementArr[$i][linkset]; + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=1 and instanceNo=$linksetInstanceNo"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $DPCtmp=hexdec(getBitValue($rows[initValue],'0.0-2.7'))+0; + //alert($DPCtmp); + $NItmp=bindec(getBitValue($rows[initValue],'3.0-3.1'))+0; + //alert($NItmp); + //==========================decide ansi or itu======================================== + switch($NItmp) + { + case 0: + $NIoffset='0.4-0.4'; + break; + case 1: + $NIoffset='0.5-0.5'; + break; + case 2: + $NIoffset='0.6-0.6'; + break; + case 3: + $NIoffset='0.7-0.7'; + break; + } + + //alert($NIoffset); + + + $database="OBJ_222"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //alert($rows[initValue]); + $ITU_ANSI=getBitValue($rows[initValue],$NIoffset); + + $E164_number="--"; + $MSISDN_Range="--"; + $IMSI_Range="--"; + + //==ANSI + if($ITU_ANSI) + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + //if($gtt_DPC[$index]==$DPCtmp) + if(strcmp($gtt_title_name[$index],$newElementArr[$i][name])==0) + { + if($gtt_translation_type[$index]==1) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //===========================MSISDN ====================================== + for($index=0;$index<256;$index++) + { + //if($gtt_DPC[$index]==$DPCtmp) + if(strcmp($gtt_title_name[$index],$newElementArr[$i][name])==0) + { + if($gtt_translation_type[$index]==14) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //===========================IMSI ====================================== + for($index=0;$index<256;$index++) + { + //if($gtt_DPC[$index]==$DPCtmp) + if(strcmp($gtt_title_name[$index],$newElementArr[$i][name])==0) + { + if($gtt_translation_type[$index]==9) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + //==ITU + else + { + //===========================E164 number=================================== + for($index=0;$index<256;$index++) + { + //if($gtt_DPC[$index]==$DPCtmp) + if(strcmp($gtt_title_name[$index],$newElementArr[$i][name])==0) + { + if($gtt_number_plan[$index]==7) + { + if($gtt_start_gt[$index]==-1) + $E164_number="--"; + else + $E164_number=$gtt_start_gt[$index]; + break; + } + } + } + //=========================MSISDN======================================= + for($index=0;$index<256;$index++) + { + //if($gtt_DPC[$index]==$DPCtmp) + if(strcmp($gtt_title_name[$index],$newElementArr[$i][name])==0) + { + if($gtt_number_plan[$index]==1) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $MSISDN_Range="--"; + else + $MSISDN_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + //=========================IMSI======================================= + for($index=0;$index<256;$index++) + { + //if($gtt_DPC[$index]==$DPCtmp) + if(strcmp($gtt_title_name[$index],$newElementArr[$i][name])==0) + { + if($gtt_number_plan[$index]==6) + { + if($gtt_start_gt[$index]==-1||$gtt_end_gt[$index]==-1) + $IMSI_Range="--"; + else + $IMSI_Range=$gtt_start_gt[$index]."-".$gtt_end_gt[$index]; + break; + } + } + } + } + + echo ""; + echo ""; + echo ""; + //state + $flg = 'new'; + showStatus($flg,$i,$indexNum); + $indexNum++; + echo ""; + } +}//end application + +session_register("needBackupArr"); +?> +
      Local$strE164NumberLicenseSubscriberStatus$strDelete
      {$localElementArr[$i][sysTypeName]}{$localElementArr[$i][sysTypeName]}{$localElementArr[$i][GT]}--$e1_license_msc--{$localElementArr[$i][license]}--{$localElementArr[$i][license]}{$localElementArr[$i][users]}$value
      MSS-BSS SettingDevice SettingNI / DPCBTS MgrBSS SettingNIDPCLACStatus$strDelete
      "; + echo ""; + + if(strlen($bssElementArr[$i][name])>0) + echo "{$bssElementArr[$i][name]}"; + else + echo "{$bssElementArr[$i][linkset]}"; + echo "BSS{$NetIdConfArr[$bssElementArr[$i][ni]]} / {$bssElementArr[$i][dpc]}{$NetIdConfArr[$bssElementArr[$i][ni]]}{$bssElementArr[$i][dpc]}$no_of_bts{$bssElementArr[$i][lac]}
      PeripheralDevice SettingDPCNumber of linksStatus$strDelete
      "; + if(strlen($aasElementArr[$i][name])>0) + echo "{$aasElementArr[$i][name]}"; + else + echo "{$aasElementArr[$i][linkset]}"; + echo "AAS{$aasElementArr[$i][prefix]}--{$aasElementArr[$i][linkNum]}"; + if(strlen($vssElementArr[$i][name])>0) + echo "{$vssElementArr[$i][name]}"; + else + echo "{$vssElementArr[$i][linkset]}"; + echo "VSS{$vssElementArr[$i][prefix]}--$dpc_tmp {$vssElementArr[$i][linkNum]}"; + if(strlen($pcrElementArr[$i][name])>0) + echo "{$pcrElementArr[$i][name]}"; + else + echo "{$pcrElementArr[$i][linkset]}"; + echo "PCR$dpc_tmp --"; + if(strlen($cnfElementArr[$i][name])>0) + echo "{$cnfElementArr[$i][name]}"; + else + echo "{$cnfElementArr[$i][linkset]}"; + echo "CNF$dpc_tmp --
      SwitchNetwork IndicatorDPCNumber of E1/T1Status$strDelete
      "; + if(strlen($switchElementArr[$i][name])>0) + echo "{$switchElementArr[$i][name]}"; + else + echo "{$switchElementArr[$i][linkset]}"; + echo "--$e1_count$NetIdConfArr[$tmpni]$decdpc---{$switchElementArr[$i][prefix]}--$e1_count
      $strGttObjectsNI/DPCMSISDN RangeIMSI RangeStatus$strDelete
      "; + echo $mscElementArr[$i][name]; + echo "$E164_number$MSISDN_Range$IMSI_Range"; + echo $hlrElementArr[$i][name]; + echo "$E164_number$MSISDN_Range$IMSI_Range"; + echo $vlrElementArr[$i][name]; + echo "$E164_number$MSISDN_Range$IMSI_Range"; + echo $mcElementArr[$i][name]; + echo "$E164_number$MSISDN_Range$IMSI_Range"; + echo $sgsnElementArr[$i][name]; + echo "$E164_number$MSISDN_Range$IMSI_Range"; + echo $newElementArr[$i][name]; + echo "{$NI_label[$NItmp]}/$DPCtmp$MSISDN_Range$IMSI_Range
      + +\n"; + echo "alert('$msg');\n"; + echo ""; +} + +function getusedCount($oid,$sysId,$otherWhereStr='') +{ + $db = "OMC_PUB"; + $tmpArr = explode('_',$sysId); + $table = "OBJ_".$tmpArr[0].".param_".$tmpArr[1]; + $confTable = "OBJ_".$tmpArr[0].".paramConf"; + $levelWhere = getLevelWhere($oid); + $defSql = "select initValue from $confTable where $levelWhere"; + $defResult = mysqli_query($pubConn, $defSql); + $defRow = mysqli_fetch_array($defResult); + $defValue = $defRow[initValue]; + //echo "
      defSql:$defSql"; + $slcSql = "select count(*) as usedNum from $table where $levelWhere and initValue!='$defValue' $otherWhereStr"; + $result = mysqli_query($pubConn,$slcSql); + $row = mysqli_fetch_array($result); + //echo "
      slcSql:$slcSql"; + return $row[0]; +} +function outputUsedNum($usedNum) +{ + if($usedNum>0) + $showStr = "[ $usedNum ]"; + echo "$showStr"; +} +for($i=1; $i<=4; $i++) { + $oidStr = '2.6.'.$i; + $spcUsed += getusedCount($oidStr, '222_99_99'); +} +$lsUsed = getusedCount('2.4.1','222_99_99'); +$lkUsed = getusedCount('2.5.1','222_99_99'); +$gttUsed = getusedCount('2.2.0','223_99_99'); +$prefixUsed = getusedCount('2.1.2','322_99_99'); +$tgUsed = getusedCount('2.1.4','322_99_99'); +$e1Used = getusedcount('2.4.4','322_99_99'); +$cellUsed = getusedCount('2.2.7','322_99_99','and instanceNo!=1023'); +$Prefix_Manipulation_used=getusedCount('2.8','225_99_99'); +$xapp_used=getusedCount('2.11','225_99_99'); +echo "

      "; +echo "Utilization Summary [Active]"; +echo ""; +echo ""; + echo ""; + outputUsedNum($spcUsed); + echo ""; + outputUsedNum($lsUsed); + echo ""; + outputUsedNum($lkUsed); + echo ""; + outputUsedNum($gttUsed); + echo ""; + echo ""; +echo ""; +echo ""; + echo ""; + outputUsedNum($e1Used); + echo ""; + outputUsedNum($prefixUsed); + echo ""; + outputUsedNum($tgUsed); + echo ""; + outputUsedNum($cellUsed); + echo ""; + //outputUsedNum($Prefix_Manipulation_used); + echo ""; +echo ""; + + +echo ""; + echo ""; + outputUsedNum($xapp_used); + echo ""; + + echo ""; + + echo ""; + + echo ""; + + + echo ""; +echo ""; + + +echo "
      SPCLinksetLinkGTTLocal Node 
      E1PrefixTGCELLConvert 
      Element     
      "; +echo "

      "; +$btnbackupStyleStr = ''; +if($backupShow) + $btnbackupStyleStr = ";background:yellow"; +$btnrestoreStyleStr = ''; +if($restoreShow) + $btnrestoreStyleStr = ";background:yellow"; +//title=\"Backup all the system's parameters and subscribers(5000 Items)\" +//title=\"Restore all the system's parameters and subscribers(5000 Items)\" +echo "Backup & "; +echo "Restore"; +//=============backup and restore remark===================== +$backup_remark="";//Backup lets operator back up System Parameters and Subscriber Data from application servers to a tgz file. Select the check box for the contents that want to back up. Click “Create tgz File” to start the backup operation: EMS downloads data from application servers and compresses it to a tgz package. Click “Download tgz File” to download the latest backed up file to client PC."; +$restore_remark="";//Restore lets operator recover the System Parameters and Subscriber Data to a previous state. It also can be used to configure a new application server in a very quick way. Click the Browse button to locate the folder and previous backed up file. Click the Upload button to start the restore operation. Please be caution that the Restore will erase the System Parameter and Subscriber Data that is currently on the application servers and replace with the restoring data."; + +echo "

      "; +echo "

      $backup_remark
      "; +echo "
      $restore_remark
      "; +echo "

      "; +function getFileList($dir,&$fileListArr) +{ + if ($handle = opendir($dir)) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { + $fileListArr[] = $file; + } + } + closedir($handle); + } +} + +if($backupShow) + echo "
      "; +else + echo "
      "; + echo "
      "; + $serverip = getenv("HTTP_HOST"); + if( $serverip == "" ){ + $serverip = getenv("SERVER_ADDR"); + } + $downLinkStr = ''; + $downFilePath = "/usr/local/apache/htdocs/db_backup/archive/tgzFile/"; + unset($fileListArr); + if(is_dir($downFilePath)) + getFileList($downFilePath,$fileListArr); + if (sizeof($fileListArr)>0) + { + $fileName=$fileListArr[0]; + $filePathName = $downFilePath.$fileName; + $lastModifiedTime = date("Y-m-d H:i:s", filemtime($filePathName)); + $downurl = "http://$serverip/db_backup/archive/tgzFile/".$fileName; + $downLinkStr = "Download tgz File [$lastModifiedTime]"; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if($needBssIp!=1) + { + $need_bss_ip=0; + } + else + { + $need_bss_ip=1; + } + + echo ""; + echo ""; + echo "
      Select items to backup"; + echo "Parameters  "; + + + if($needBssIp==1) + echo "Subscribers  "; + + if($bssNeedBackup==1 && $needBssIp==1) { + $bssDisplay=''; + $bssShow="BSS"; + } else { + $bssDisplay='none'; + $bssShow=""; + } + echo "$bssShow"; + echo "
      Create Tgz File"; + echo "$downLinkStr
      "; +echo "
      "; +if($restoreShow) + echo "
      "; +else + echo "
      "; + ?> + " enctype="multipart/form-data"> + + File(.tgz) to Restore: + + + + +"; +?> + + + + diff --git a/wxc2_omc/element/overview/upLoadingElements.php b/wxc2_omc/element/overview/upLoadingElements.php new file mode 100755 index 0000000..2338ac4 --- /dev/null +++ b/wxc2_omc/element/overview/upLoadingElements.php @@ -0,0 +1,295 @@ +'2', 'sysid'=>'390_99_99', 'selectsysid'=>'-1'),//VSS + //array('oid'=>'2', 'sysid'=>'222_8', 'selectsysid'=>'-1'),//VSS + //array('oid'=>'2', 'sysid'=>'223_8', 'selectsysid'=>'-1'),//VSS + array('oid'=>'2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'),//MSC + array('oid'=>'2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'),//MTP3 + array('oid'=>'2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'),//SCCP + array('oid'=>'2', 'sysid'=>'225_99_99', 'selectsysid'=>'-1'),//XAPP + array('oid'=>'2', 'sysid'=>'330_99_99', 'selectsysid'=>'-1'),//HLR + array('oid'=>'2', 'sysid'=>'325_99_99', 'selectsysid'=>'-1'),//VLR + array('oid'=>'2', 'sysid'=>'350_99_99', 'selectsysid'=>'-1'),//SMSC + array('oid'=>'2', 'sysid'=>'360_99_99', 'selectsysid'=>'-1'),//PPS + array('oid'=>'2', 'sysid'=>'370_99_99', 'selectsysid'=>'-1'),//MNP + +// array('oid'=>'2', 'sysid'=>'260_99_99', 'selectsysid'=>'-1'),//SMPP + array('oid'=>'2', 'sysid'=>'340_99_99', 'selectsysid'=>'-1'),//AUC + ); + + + $database="OMC_PUB"; + $sql="select * from sysInfo where sysTypeNo=390 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + $oidsysarr[]=array('oid'=>'2', 'sysid'=>'222_8', 'selectsysid'=>'-1'); + $oidsysarr[]=array('oid'=>'2', 'sysid'=>'223_8', 'selectsysid'=>'-1'); + } + + + if(1) + {//get all 8ke1 sysNo. + $sysInfoTab = 'sysInfo'; + $selSql = "select sysNo,subSysNo from $sysInfoTab where sysTypeNo='111' order by sysNo,subSysNo"; + $Result = mysqli_query($pubConn,$selSql); + $sysNo = -1; + $i = sizeof($oidsysarr); + while($Rows = mysqli_fetch_array($Result)) + { + if($sysNo==$Rows[sysNo]) + continue; + $sysNo = $Rows[sysNo]; + $sysNoArr[$i] = $sysNo; + $sysId = '111_' . $sysNo . '_99'; + $oidsysarr[$i] = array('oid'=>'2', 'sysid'=> $sysId,'selectsysid'=>'-1'); + $i++; + } + }//end + + $SaveArr=array( + array('oidstr'=>'3.1','setvalue'=>'01' ,'sysid'=>'390_99_99','selectsysid'=>'-1'),//VSS + //array('oidstr'=>'3.7','setvalue'=>'02' ,'sysid'=>'222_8','selectsysid'=>'-1'),//VSS-MTP3 + //array('oidstr'=>'3.2','setvalue'=>'02' ,'sysid'=>'223_8','selectsysid'=>'-1'),//VSS-SCCP + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'),//MSC + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'),//MTP3 + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99','selectsysid'=>'-1'),//SCCP + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99','selectsysid'=>'-1'),//XAPP + array('oidstr'=>'2.2.2','setvalue'=>'01' ,'sysid'=>'330_0_0','selectsysid'=>'-1'),//HLR-0 + array('oidstr'=>'2.2.2','setvalue'=>'01' ,'sysid'=>'330_1_0','selectsysid'=>'-1'),//HLR-1 + array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=>'325_0_0','selectsysid'=>'-1'),//VLR-0 + array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=>'325_1_0','selectsysid'=>'-1'),//VLR-1 + array('oidstr'=>'3.3', 'setvalue'=>'01' ,'sysid'=>'350_99_99','selectsysid'=>'-1'),//SMSC + array('oidstr'=>'2.1.6.2','setvalue'=>'01','sysid'=>'360_99_99','selectsysid'=>'-1'),//PPS + array('oidstr'=>'2.1.32','setvalue'=>'01' ,'sysid'=>'370_99_99','selectsysid'=>'-1'),//MNP + + +// array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'260_99_99','selectsysid'=>'-1'),/SMPP + array('oidstr'=>'2.2.2','setvalue'=>'01' ,'sysid'=>'340_99_99','selectsysid'=>'-1'),//AUC + + ); + + $database="OMC_PUB"; + $sql="select * from sysInfo where sysTypeNo=390 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + $SaveArr[]=array('oidstr'=>'3.7','setvalue'=>'02' ,'sysid'=>'222_8','selectsysid'=>'-1');//VSS-MTP3 + $SaveArr[]=array('oidstr'=>'3.2','setvalue'=>'02' ,'sysid'=>'223_8','selectsysid'=>'-1');//VSS-SCCP + } + + + + //AAS + $getSql="SELECT sysTypeNo,sysNo,subSysNo FROM sysInfo WHERE sysTypeNo=311"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $count=0; + while($rows=mysqli_fetch_array($result)){ + $AASoidsysarr[$count][oid]="2"; + $AASoidsysarr[$count][sysid]="311_".$rows[sysNo]."_0"; + $AASoidsysarr[$count][selectsysid]="-1"; + + $AAS_SaveArr[$count][oidstr]="3.1"; + $AAS_SaveArr[$count][setvalue]="00"; + $AAS_SaveArr[$count][sysid]="311_".$rows[sysNo]."_0"; + $AAS_SaveArr[$count][selectsysid]="-1"; + $count++; + //MTP3 + $AASoidsysarr[$count][oid]="2"; + $AASoidsysarr[$count][sysid]="222_11_99"; + $AASoidsysarr[$count][selectsysid]="222_11_".$rows[sysNo]; + + $AAS_SaveArr[$count][oidstr]="3.7"; + $AAS_SaveArr[$count][setvalue]="02"; + $AAS_SaveArr[$count][sysid]="222_11_99"; + $AAS_SaveArr[$count][selectsysid]="222_11_".$rows[sysNo]; + $count++; + //SCCP + $AASoidsysarr[$count][oid]="2"; + $AASoidsysarr[$count][sysid]="223_11_99"; + $AASoidsysarr[$count][selectsysid]="223_11_".$rows[sysNo]; + + $AAS_SaveArr[$count][oidstr]="3.1"; + $AAS_SaveArr[$count][setvalue]="02"; + $AAS_SaveArr[$count][sysid]="223_11_99"; + $AAS_SaveArr[$count][selectsysid]="223_11_".$rows[sysNo]; + $count++; + } + + } + else + { + $oidsysarr=array( + //MSC + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2.6', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2.7', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2', 'sysid'=>'225_99_99', 'selectsysid'=>'-1'),//XAPP + //SCCP + array('oid'=>'2.1', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1') + ); + } + //根据填充oid,set/get参数 + if($pageaction=="getall"||$pageaction=="setall") + { + if($pageaction=="getall") + { + echo "
      Get All Parameters
      "; + GetParam($oidsysarr,1,1); + + + $vss_count=0; + for($i=0;$i<10;$i++) + { + //==========set VSS Parameters====== + $database="OBJ_PUB"; + $sql="select distinct sysNo from sysInfo where sysTypeNo=390 and sysNo=$i "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + $temp='223_8_'.$i; + $vss_oid_arr[]=array('oid'=>'2', 'sysid'=>$temp, 'selectsysid'=>'-1'); + $vss_count++; + } + } + + if($vss_count!=0) + { + GetParam($vss_oid_arr,1,1); + } + + + //AAS与其他参数分开设置 + if($count) GetParam($AASoidsysarr,1,1); + + echo "

      Finished!

      "; + echo ""; + exit(); + } + else + { + echo "
      Set All Parameters
      "; + Clear_readValud($oidsysarr); + SetParam($oidsysarr,1); + + SaveParam($SaveArr); + + //=========set vss parameter + $vss_count=0; + for($i=0;$i<10;$i++) + { + //==========set VSS Parameters====== + $database="OBJ_PUB"; + $sql="select distinct sysNo from sysInfo where sysTypeNo=390 and sysNo=$i "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + $temp='223_8_'.$i; + $vss_oid_arr[]=array('oid'=>'2', 'sysid'=>$temp, 'selectsysid'=>'-1'); + $vss_save_arr[]=array('oidstr'=>'3.2', 'setvalue'=>'02', 'sysid'=>$temp, 'selectsysid'=>'-1'); + + $vss_count++; + } + } + + if($vss_count!=0) + { + Clear_readValud($vss_oid_arr); + SetParam($vss_oid_arr,1); + SaveParam($vss_save_arr); + } + + + + //AAS与其他参数分开设置 + if($count) + { + Clear_readValud($AASoidsysarr); + SetParam($AASoidsysarr,1); + + SaveParam($AAS_SaveArr); + } + + if(isset($resetDevice))//reset mss,sccp,mtp3 when restore an new system. (invoked by uploadFile.php) + { + $resetArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'5A' ,'sysid'=>'322_99_99'),//MSC + array('oidstr'=>'3.7', 'setvalue'=>'01' ,'sysid'=>'222_99_99'),//mtp3 + array('oidstr'=>'3.2', 'setvalue'=>'00' ,'sysid'=>'223_99_99'),//sccp + ); + SaveParam($resetArr); + }//end reset. + echo "

      Finished!

      "; + echo ""; + exit(); + } + } + else + { + $getSql="SELECT pubVarValue FROM omcPubVarConf + WHERE pubVarName='getparam_from' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows=mysqli_fetch_array($result); + $getflag=$rows[0];//get param from omc or mss(omc:0,mss:1) + if($getflag) + { + echo "
      Downloading the elements
      "; + GetParam($oidsysarr,1); + echo "

      Finished!

      "; + echo ""; + exit(); + } + } + echo ""; + exit(); +?> + diff --git a/wxc2_omc/element/overview/uploadFile.php b/wxc2_omc/element/overview/uploadFile.php new file mode 100755 index 0000000..a753521 --- /dev/null +++ b/wxc2_omc/element/overview/uploadFile.php @@ -0,0 +1,621 @@ + + + Network > Restore"; +$DEBUG = 0; +$db=$omc_db; +set_time_limit(3600); +$strNoInput = "No file input!"; + +function MsgBox($str) +{ + echo ""; +} +function getNameByTypeNo($sysTypeNo) +{ + $pubDb = "OMC_PUB"; + $selSql = "select sysTypeName from OMC_PUB.sysConf where sysTypeNo=$sysTypeNo"; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $name = $row[sysTypeName]; + return $name; +} +function getFileList($dir,&$fileListArr) +{ + if ($handle = opendir($dir)) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { + $fileListArr[] = $file; + } + } + closedir($handle); + } +} +function updateParamer($db_name,$table_name,$csvFileName) +{ + $del_sql = "DELETE FROM $table_name"; + if($DEBUG) echo "
      del_sql = $del_sql"; + $del_result = mysqli_query($pubConn,$del_sql); + if($DEBUG) echo "
      del_result=$del_result"; + + $insert_sql = "LOAD DATA LOCAL INFILE '$csvFileName' + INTO TABLE $table_name + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + "; + if(0) echo "
      insert_sql=$insert_sql"; + $insert_result=mysqli_query($pubConn,$insert_sql); + if($DEBUG) echo "
      insert_result=$insert_result"; + if ($insert_result) + return 1; + else + return 0; +}//end updateParamer + +function updateSubs($sysId,$dataTypeNo,$impFile) +{ + $nSetComm = 3; + $pubDb = 'OMC_PUB'; + $sysSubsConfTable = 'OMC_PUB.sysSubsConf'; + $sysInfoTable = 'OMC_PUB.sysInfo'; + + $sysIdArr=explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; + + if($sysTypeNo==390) + $getConfSql="SELECT subsDataTable,impObjId,impFileName,ftpDir,ftpLoginName,ftpLoginPwd, + logFileName,maxSegmentNum,maxIndexNumPerSeg + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' AND dataTypeNo='$dataTypeNo' AND sysNo='$sysNo' + "; + else + $getConfSql="SELECT subsDataTable,impObjId,impFileName,ftpDir,ftpLoginName,ftpLoginPwd, + logFileName,maxSegmentNum,maxIndexNumPerSeg + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' AND dataTypeNo='$dataTypeNo' + "; + if($DEBUG) echo "
      getConfSql=$getConfSql"; + $getConfResult=mysqli_query($pubConn,$getConfSql); + echo mysqli_error($pubConn); + $getConfRows=mysqli_fetch_array($getConfResult); + + $subsDataTable = $getConfRows[subsDataTable]; + $impObjId = $getConfRows[impObjId]; + $impFileName = $getConfRows[impFileName]; + $logFileName = $getConfRows[logFileName]; + $ftpDir = $getConfRows[ftpDir]; + $ftpLoginName = $getConfRows[ftpLoginName]; + $ftpLoginPwd = $getConfRows[ftpLoginPwd]; + $maxSegmentNum = $getConfRows[maxSegmentNum]; + $maxIndexNumPerSeg = $getConfRows[maxIndexNumPerSeg]; + $maxTotalNum = $maxSegmentNum * $maxIndexNumPerSeg; + $maxImpFileSize = 5*1024*1024; + $maxImpRecordNum = 5000; + + //Get the system name; + $selSql = "SELECT sysTypeName FROM sysConf WHERE sysTypeNo='$sysTypeNo'"; + if ($DEBUG) echo "selSql = $selSql
      "; + $selRes = @mysqli_query($pubConn, $selSql); + echo mysqli_error($pubConn); + $selRow = @mysqli_fetch_array($selRes); + $sysName = $selRow[sysTypeName]; + + if($sysTypeNo==390) + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo + "; + else + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $runningServerNum = mysqli_num_rows($getSysIdResult); + if($runningServerNum <= 0){ + echo "No system running normally"; + return 0; + } + if($DEBUG) echo "running server number = $runningServerNum
      "; + //找出已有的记录个数 + $getTotalSql = "SELECT count(*) FROM $subsDataTable"; + if($DEBUG) echo "
      getTotalSql=$getTotalSql"; + $getTotalRes = mysqli_query($pubConn,$getTotalSql); + $getTotalRow = @mysqli_fetch_array($getTotalRes); + $existNum = $getTotalRow[0]; + + if($DEBUG) echo "
      existNum=$existNum"; + + //检查导入的文件大小,记录条数 + $impFileSize = filesize($impFile); + if($DEBUG) { + echo "
      impFile=$impFile"; + echo "
      impFileSize=$impFileSize"; + } + if($impFileSize > $maxImpFileSize){ + $impFileSizeM=ceil($impFileSize/1024/1024); + echo "File size is too large!(Must <= 5M)"; + @unlink ($impFile); + return 0; + } + + if($impFileSize <=0){ + echo "subscriber data is null."; + @unlink ($impFile); + return 0; + } + + $impRecordNum = count(file($impFile)); + if($DEBUG) echo "
      impRecordNum=$impRecordNum"; + if($impRecordNum > $maxImpRecordNum){ + echo "Records are too much!(Must <= $maxImpRecordNum)"; + @unlink ($impFile); + return 0; + } + + if($impRecordNum > $maxTotalNum-$existNum){ + echo "User number is too much!"; + @unlink ($impFile); + return 0; + } + for ($k=0; $k<$runningServerNum; $k++) { + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysId=$sysTypeNo.'_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $dstSeverIp = $getSysIdRow[ip]; + if($sysTypeNo==360) + $sysIdCyc[$k] = '360_99_99'; + else if($sysTypeNo==390) + $sysIdCyc[$k]='390_'.$getSysIdRow[sysNo].'_99'; + else + $sysIdCyc[$k] = $sysId; + if($DEBUG) echo "
      sysId = $sysId"; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + + $ftpCon=ftp_connect($dstSeverIp); + if($ftpCon < 0){ + echo "Connect Failed!"; + @unlink ($impFile); + return 0; + } + if(!ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + echo "Login Failed!"; + @unlink ($impFile); + return 0; + } + + $remoteFileName=$ftpDir.$impFileName; + if(!ftp_put($ftpCon,$remoteFileName,$impFile,FTP_ASCII)){ + echo "Put file Failed"; + @unlink ($impFile); + return 0; + } + ftp_quit($ftpCon); + $logFile="/usr/local/apache/htdocs/ftpFile/$logFileName"; + @unlink ($logFile); + } + @unlink ($impFile); + + //修改设备参数 + if($sysTypeNo==340){ + $k4_flag = 0; //should be 0 or 8. + $instanceNo = 0; + $commState = $k4_flag.'1'; + $totalNum = DecHex($impRecordNum); + $totalNum = omc_keep_length($totalNum,'0',6); + if($k4_flag!=8) + $k4 = '0000000000000000'; + else{ + if(strlen($k4)<16){ + echo "K4 is incorrect!"; + return 0; + } + } + $newValue = $commState.$totalNum.$k4; + }else{ + $instanceNo = 0; + $commState = '01'; + $totalNum = DecHex($impRecordNum); + $totalNum = omc_keep_length($totalNum,'0',6); + $finishNum = '000000'; + $newValue = $commState.$totalNum.$finishNum; + } + if($DEBUG)echo "
      newValue=$newValue"; + + //send set command + + for ($k=0; $k< $runningServerNum; $k++) { + $chgResult = setSysParamValue($sysIdCyc[$k],$impObjId,$instanceNo,$newValue); + $commStr = sysCommSend($sysIdCyc[$k],$nSetComm,$impObjId); + + chkCommStat($sysId,$impObjId,$impRecordNum,$commStr); + } +}//end updateSubs + +function chkCommStat($sysId,$impObjId,$impRecordNum,$commStr) +{ + $nProcFail =0; + $nWaitProc =1; + $nInProc =2; + $nOutProc =3; + $sysIdArr=explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; + $maxSeconds = 20; + while(1) { + $paramValue = getSysParamValue($sysId,$impObjId,0,'readValue'); + $impCommState = substr($paramValue,0,2); + $runSeconds += 2; + if($sysTypeNo==340){ + $allNum=$impRecordNum; + $doneNum = substr($paramValue,2,6); + $doneNum = HexDec($doneNum); + }else{ + $allNum = substr($paramValue,2,6); + $allNum = HexDec($allNum); + $doneNum = substr($paramValue,8,6); + $doneNum = HexDec($doneNum); + } + if($doneNum > $oldDoneNum){ + $runSeconds = 0; + } + $oldDoneNum = $doneNum; + sleep(2); + if($runSeconds > $maxSeconds || $doneNum >= $allNum || $impCommState == '03' || $impCommState == '04') + { + if($impCommState == '04'){ + echo "Failed!"; + }elseif($runSeconds > $maxSeconds){ + echo "Response Time Out!"; + }else{ + echo "SUCCESS!"; + } + break; + } + + + $commIdArr = explode('-',$commStr); + $commId = $commIdArr[0]; + + $commSql = " SELECT commState FROM parameterComm WHERE commId = '$commId' "; + $commRes = mysqli_query($pubConn,$commSql); + $commRow = @mysqli_fetch_array($commRes); + $commStat = $commRow[commState]; + if($commStat == $nOutProc || !isset($commStat)){ + $commStr = sysCommSend($sysId,0,$impObjId); + } + }//end while +}//end chkCommStat +function updateBssDb($bssIpAddr,$localDir) +{ + $remoteDir = "/hd0/iw07_00.010/compile/cfg/"; + $ftpCon=@ftp_connect($bssIpAddr); + if($ftpCon < 0){ + echo "BSS's ip is error or connect $bssIpAddr Failed!"; + flush(); + return 0; + } + if(!@ftp_login($ftpCon,'','')){ + echo "BSS's ip is error or login $bssIpAddr Failed!"; + @ftp_close($ftpCon); + flush(); + return 0; + } + if(!@ftp_chdir($ftpCon, $remoteDir)){ + echo "Change dir error!"; + @ftp_close($ftpCon); + flush(); + return 0; + } + $dir = @dir($localDir); + while(false !== ($entry=$dir->read())) { + if(is_file("$localDir$entry") && $entry!='.' && $entry!='..') + $fileArr[] = $entry; + } + for($i=0; $i< sizeof($fileArr); $i++) { + $file = $fileArr[$i]; + $remoteFile=$remoteDir.$file; + $localFile=$localDir.$file; + if (!@ftp_put($ftpCon, $remoteFile, $localFile, FTP_BINARY)) { + flush(); + echo "Put file error!"; + @ftp_close($ftpCon); + return 0; + } + }//end for + + @ftp_close($ftpCon); + return 1; +}//end get BssDb +?> + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +if(isset($inputFile)&&$inputFile!='') +{ + $upload_file = $_FILES['inputFile']['tmp_name']; + $upload_file_name = $_FILES['inputFile']['name']; + $upload_file_size = $_FILES['inputFile']['size']; + $upload_file_type = $_FILES['inputFile']['type']; + $file_size_max = 20*1000*1000;// 20M限制文件上传最大容量(bytes) + $accept_overwrite = 1;//是否允许覆盖相同文件 + + //echo "
      upload_file_type:$upload_file_type"; + if($upload_file_type != 'application/x-gzip-compressed' + &&$upload_file_type != 'application/x-tgz') + MsgBox("File Type is not correct, it should be a tgz file!"); + //exit; + // 检查文件大小 + if ($upload_file_size > $file_size_max) + { + MsgBox("The file size is too large!"); + } + $uploadPath = "/usr/local/apache/htdocs/db_backup/archive/uploaded/";// 上传文件的储存位置 + system("rm -rf $uploadPath"); + exec("mkdir $uploadPath -p"); + //exec("chmod -R 777 $uploadPath"); + chmod($uploadPath,0777); + + // 检查读写文件 + if (file_exists($uploadPath . $upload_file_name) && !$accept_overwrite) + { + MsgBox("The file is already existed!"); + } + + //复制文件到指定目录 + if (!copy($upload_file,$uploadPath.$upload_file_name)) + { + MsgBox("File copy error!"); + } + + //解压缩文件 + chdir($uploadPath); + exec("tar zxvf $upload_file_name"); + system("rm -f $upload_file_name"); + sleep(2); +} +else +{ + MsgBox($strNoInput); +} +//exit; +////////////////////////////////////////// +$allSuccess = 1; + +$needUpdateParam = 1; +$needUpdateSubs = 1; +$needUpdateBSS = 1; +$needReboot = 1; + +if($needUpdateParam && $allSuccess) +{//update parameters + $paramDir = 'params'; + $paramPath = $uploadPath . $paramDir . '/'; + if(is_dir($paramPath)) {//if there is exist paramPath. + echo "
      Updating system parameters ... "; + flush(); + getFileList($paramPath,$fileListArr); + + // print_r($fileListArr); + // exit; + for($i=0; $i    Updating [ $sysTypeName ] ... "; + flush(); + } + $rtn = updateParamer($db_name,$table_name,$csvFileName); + if($oldName !== $sysTypeName){ + if($rtn==1) + echo " SUCCESS"; + else + echo " FAIL"; + flush(); + } + $oldName = $sysTypeName; + $allSuccess &= $rtn; + } + } + + system("rm -rf $paramDir"); + }//end if + +}//end update parameters. + +if($needUpdateSubs && $allSuccess) +{//update subscribers' data + $subsDir = 'subs'; + $subsPath = $uploadPath . $subsDir . '/'; + + if(is_dir($subsPath)) {//if there is exist subsPath + echo "

      Updating system subscribers ... "; + flush(); + unset($fileListArr); + getFileList($subsPath,$fileListArr); + + for($i=0; $i 0) { + echo "
          Updating [ $sysTypeName ] ... "; + flush(); + updateSubs($sysId,0,$csvFileName); + } + } + } + system("rm -rf $subsDir"); + } +}//end update subscribers' data + +if($needUpdateBSS && $allSuccess) +{//update bss. + $bssDir = "bssDir"; + $bssPath = $uploadPath . $bssDir . '/'; + $bssOmcTlbDir = "omcTlb"; + $bssOmcTlbPath = $bssPath . $bssOmcTlbDir . '/'; + $bssDbDir = "dbs"; + $bssDbPath = $bssPath . $bssDbDir . '/'; + if(is_dir($bssPath)){//if there exist this bssDir + echo "

      Updating BSS ... "; + flush(); + + //1. update bss db. + if(1) + { + $dir = dir($bssDbPath); + while(false !== ($entry = $dir->read())) { + if(is_dir("$bssDbPath/$entry") && $entry != "." && $entry != "..") + $bssIpArr[] = $entry; + } + for($i=0; $i< sizeof($bssIpArr); $i++) { + $ip = $bssIpArr[$i]; + //$ip = '172.18.128.111'; + echo "
          Updating BSS' Database [ $ip ] ... "; + flush(); + $rtn = updateBssDb($ip,"$bssDbPath/$ip/"); + if($rtn) + echo " SUCCESS
      "; + $allSuccess &= $rtn; + } + }//end update bss db. + + //2. update bssomctable. + if($allSuccess) + { + unset($fileListArr); + getFileList($bssOmcTlbPath,$fileListArr); + for($i=0; $i    Updating BSS' parameters ... "; + $rtn = updateParamer($db_name,$table_name,$csvFileName); + if($rtn==1) + echo " SUCCESS"; + else + echo " FAIL"; + flush(); + $allSuccess &= $rtn; + } + } + + {//2.2 insert bss info to sysInfo table + $lines = file($csvFileName); + + foreach ($lines as $line_num => $line) { + //echo "Line #{$line_num} : " . htmlspecialchars($line) . "
      \n"; + $lineArr = explode(',',$line); + $bssInfoArr[$line_num][sysNo] = $lineArr[0]; + $bssInfoArr[$line_num][ip] = $lineArr[1]; + } + $sysInfoTable = "OMC_PUB.sysInfo"; + $tmpSysType = 500; + $tmpSubSysNo = 0; + $isRemote = 0; + $pubDb = "OMC_PUB"; + for($i=0; $i< sizeof($bssInfoArr); $i++){ + if(strlen($bssInfoArr[$i][ip])<7) continue; + $bssIP = $bssInfoArr[$i][ip]; + $tmpSysNo = $bssInfoArr[$i][sysNo]; + $sysAlias='BSS'.$tmpSysNo; + $addSql = "REPLACE INTO $sysInfoTable (sysTypeNo,sysNo,subSysNo,isRemote,netId,DPC,ip,baseStat,sysAlias,updateTime ) + VALUES('$tmpSysType','$tmpSysNo','$tmpSubSysNo','$isRemote','0','0','$bssIP','1','$sysAlias',CURRENT_TIMESTAMP)"; + + if($DEBUG) echo "
      addSql = $addSql"; + $result = mysqli_query($pubConn,$addSql); + echo mysqli_error($pubConn); + } + }//end nsert bss info to sysInfo table + }//end update bssomctable. + system("rm -rf $bssDir"); + if($needReboot && $allSuccess)//3. reboot bss. + { + chdir("/usr/local/apache/htdocs/wxc2_omc/security/backupRestore"); + for($i=0; $i< sizeof($bssIpArr); $i++) { + $ip = $bssIpArr[$i]; + echo "
          Rebooting BSS [ $ip ] ... "; + flush(); + $tmpCmd ="/usr/local/apache/htdocs/wxc2_omc/element/overview/bssReboot".' '.$ip; + system($tmpCmd); + //$lastLine = system($tmpCmd, $rtn); + //echo "
      $tmpCmd
      $lastLine
      $rtn"; + } + //var_dump($bssIpArr); + }//end reboot bss. + + $tmpCmd ="/usr/local/apache/htdocs/wxc2_omc/element/overview/bsscommRestart"; + system($tmpCmd); + } +}//end update bss. + +//exit; + +if($allSuccess) { + //MsgBox("All needed success"); + echo ""; +} +else { + echo "

      Back"; +} + +?> diff --git a/wxc2_omc/element/sub_inc/commfunc.php b/wxc2_omc/element/sub_inc/commfunc.php new file mode 100755 index 0000000..e2cb064 --- /dev/null +++ b/wxc2_omc/element/sub_inc/commfunc.php @@ -0,0 +1,2278 @@ +"; + } + } + if($DEBUG) echo "sysCommSend($sys_id,$nSetComm,$oid,$selectsysid)
      "; + $commIdStr = oidSysCommSend($sys_id,$nSetComm,$oid,$selectsysid); + + CheckState($commIdStr); + + for($i=0; $i < $count; $i++) + { + mysqli_query($pubConn,$setsql_back[$i]); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql_back[$i]
      "; + } +} + +//**************************************************************** +// update_sg +//函数说明: +// 该函数用于设置SG参数前先Disable SG,然后再Enable SG +// +//参数: +// 需要sys_id,selectsysid +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function update_sg($sys_id,$selectsysid=-1){ + global $pubDb,$nSetComm; + $DEBUG = 0; + $sysIdArr = explode('_',$sys_id); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $oid = '2.9'; + $objWhereStr = getLevelWhere($oid); + + $getsql = "SELECT initValue,instanceNo FROM $paramTable where $objWhereStr and initValue LIKE '01%' and initValue !=readValue "; + $result = @mysqli_query($pubConn,$getsql); + + $count=0; + while($sg_attr = mysqli_fetch_array($result)) + { + $setsql_back[$count] = "update $paramTable set initValue = '$sg_attr[initValue]' where $objWhereStr and instanceNo = '$sg_attr[instanceNo]'"; + $count++; + $sg_attr[initValue] = setBitValue($sg_attr[initValue],'00.0-00.7','00'); + $setsql = "update $paramTable set initValue = '$sg_attr[initValue]' where $objWhereStr and instanceNo = '$sg_attr[instanceNo]'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + } + + + if($DEBUG) echo "sysCommSend($sys_id,$nSetComm,$oid,$selectsysid)
      "; + $commIdStr = oidSysCommSend($sys_id,$nSetComm,$oid,$selectsysid); + + CheckState($commIdStr); + + for($i=0; $i < $count; $i++) + { + mysqli_query($pubConn,$setsql_back[$i]); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql_back[$i]
      "; + } +} + +//**************************************************************** +// CheckState +//函数说明: +// 该函数用于监测发送get/set命令后,response的状态 +// +//参数: +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function CheckState($cmmIdStr,$errRetFlag=0,$outFlag=1){ + global $omc_db; + global $maxNum,$remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $cmmIdStrArr=explode("-",$cmmIdStr); + $tmpWhere = '(1'; + for($i=0;$i 180){ + $tmpRemark='Timeout'; + $delComm = " DELETE FROM $commTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + outPutChkMsg($tmpsysTypeNo,$tmpsysNo,'0033',$errRetFlag); + break; + } + if($outFlag) + { + echo ""; + flush(); + } + + $selComm = "SELECT commState,remark,objId,sysTypeNo,sysNo,subSysNo FROM $commTable WHERE $tmpWhere AND commState='$nProcFail'"; + if($DEBUG) echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + + if(mysqli_num_rows($selRes)>0){ + $selRow = mysqli_fetch_array($selRes); + $tmpRemark=$selRow[remark]; + $tmpoidId=$selRow[objId]; + $tmpsysTypeNo=$selRow[sysTypeNo]; + $tmpsysNo=$selRow[sysNo]; + $delComm = " DELETE FROM $commTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + $tmpRemarkArr=explode(":",$tmpRemark); + outPutChkMsg($tmpsysTypeNo,$tmpsysNo,$tmpRemarkArr[0],$errRetFlag); + } + + $selComm = "SELECT commState,remark FROM $commTable WHERE $tmpWhere AND (commState='$nWaitProc' OR commState='$nInProc')"; + + if($DEBUG)echo "
      selComm=$selComm"; + + $selRes = mysqli_query($pubConn,$selComm); + if($DEBUG) $tmpNum=mysqli_num_rows($selRes); + if($DEBUG) echo "
      tmpNum=$tmpNum"; + + if(mysqli_num_rows($selRes)>0){ + sleep(1); + $i++; + continue; + } + $delComm = " DELETE FROM $commTable WHERE $tmpWhere "; + mysqli_query($pubConn,$delComm); + break; + } +} + +//**************************************************************** +// ChDbMov +//函数说明: +// 该函数用于把readValue copy到 initValue +// +//参数: +// $sysId,$oidstr +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function ChDbMov($sysId,$oidstr){ + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $levelArr=explode('.',$oidstr); + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $selSql ="SELECT distinct readValue FROM $paramTable + WHERE $objWhereStr + ORDER BY readValue"; + + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + +// if ('' != $selRow[0]){ + if (1){ + $moveSql = "UPDATE $paramTable SET initValue = readValue + WHERE $objWhereStr + "; + if($DEBUG) echo "
      moveSql=$moveSql"; + mysqli_query($pubConn,$moveSql); + echo mysqli_error($pubConn); + } +} + +/**************************************************************** +SaveParam +函数说明: + 该函数用于发送save命令 + +参数: + $SaveArr include $sysId,$oidstr,$Value,$selectedSysId + +修改注释: +NO.1 +姓名: +时间: +修改说明: +****************************************************************/ +function SaveParam($SaveArr) +{ + global $nSetComm; + + for($j =0;$j< sizeof($SaveArr);$j++) + { + $sysId = $SaveArr[$j]['sysid']; + $oidstr = $SaveArr[$j]['oidstr']; + $Value = $SaveArr[$j]['setvalue']; + if(isset($SaveArr[$j]['selectsysid']))//added by oven 2006-9-19 17:39 + $selectedSysId =$SaveArr[$j]['selectsysid']; + else + $selectedSysId = '-1'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $saveSql = "UPDATE $paramTable SET initValue = '$Value', readValue = 'FF' WHERE $objWhereStr"; + mysqli_query($pubConn,$saveSql); + + $commIdStr = oidSysCommSend($sysId,$nSetComm,$oidstr,$selectedSysId); + if($DEBUG) echo "sysCommSend($sysId,$nSetComm,$oidstr,$selectedSysId)"; + $cmmIdStr = $cmmIdStr.$commIdStr; + } + CheckState($cmmIdStr,2); +} + +//**************************************************************** +// GetParam +//函数说明: +// 该函数用于发送get命令 +// +//参数: +// $oidsysarr,$errRetFlag=0,$checkflag=0 +// $oidsysarr包含需要发送的oid ,sysid,selectsysid +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function GetParam($oidsysarr,$errRetFlag=0,$checkflag=0,$showflg=1){ + global $nGetComm; + for($j =0;$j< sizeof($oidsysarr);$j++){ + $sysIdArr = explode('_',$oidsysarr[$j][sysid]); + $sysTypeNo = $sysIdArr[0]; + if($checkflag ==0 || (getHeartbeat($sysTypeNo)>0)){ + if($DEBUG) echo "
      sysCommSend({$oidsysarr[$j][sysid]},$nGetComm,{$oidsysarr[$j][oid]},{$oidsysarr[$j][selectsysid]})
      "; + $commIdStr = oidSysCommSend($oidsysarr[$j][sysid],$nGetComm,$oidsysarr[$j][oid],$oidsysarr[$j][selectsysid]); + }else{ + continue; + } + $cmmIdStr = $cmmIdStr.$commIdStr; + } + if($DEBUG) echo "$cmmIdStr
      "; + CheckState($cmmIdStr,$errRetFlag,$showflg); + + for($j =0;$j< sizeof($oidsysarr);$j++){ + ChDbMov($oidsysarr[$j][sysid],$oidsysarr[$j][oid]); + } +} + + +//**************************************************************** +// DelComm +//函数说明: +// 该函数用于删除掉parameterComm里面的纪录 +// +//参数: +// $cmmIdStr为要删除的commId字串 +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function DelComm($cmmIdStr){ + if($cmmIdStr==""){ + return; + } + $cmmIdStrArr=explode("-",$cmmIdStr); + for($i=0;$i0)) + { + if($DEBUG) echo "
      sysCommSend({$oidsysarr[$j][sysid]},$nSetComm,{$oidsysarr[$j][oid]},{$oidsysarr[$j][selectsysid]})
      "; + $commIdStr = oidSysCommSend($oidsysarr[$j][sysid],$nSetComm,$oidsysarr[$j][oid],$oidsysarr[$j][selectsysid]); + } + else + { + continue; + } + + $cmmIdStr =$cmmIdStr.$commIdStr; + } + if($DEBUG)echo "$cmmIdStr
      "; + CheckState($cmmIdStr); +} + + +//**************************************************************** +// Clear_readValud +//函数说明: +// 该函数用于清空readValue +// +//参数: +// $oidsysarr +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function Clear_readValud($oidsysarr){ + for($j =0;$j< sizeof($oidsysarr);$j++){ + $sysIdArr = explode('_',$oidsysarr[$j][sysid]); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + $updSql = "UPDATE $paramTable SET readValue = ''"; + mysqli_query($pubConn,$updSql); + } +} + + +//**************************************************************** +// get_e1channel +//函数说明: +// 该函数用于get相应trunkgroup所属E1的channel参数 +// +//参数: +// $trunkgp +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function get_e1channel($trunkgp){ + global $nSetComm,$nGetComm,$DEBUG; + + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.4.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $HEXtrunkgp = omc_keep_length(dechex($trunkgp),"0","2"); + $HEXtrunkgp = strtoupper($HEXtrunkgp); + $paramSql = " SELECT instanceNo FROM $paramTable + WHERE $objWhereStr AND initValue = '$HEXtrunkgp' + ORDER BY instanceNo + "; + + $Result = mysqli_query($pubConn,$paramSql); + if(0)echo "
      paramSql:$paramSql"; + //------------读E1参数表--------------------- + $n = 0; + while($Row = mysqli_fetch_array($Result)){ + $tempnum = $Row[instanceNo]/8; + $cardno = Floor($tempnum); + $cardname = "cardno"."_$cardno"; + $tempno = $cardno+1; + $E1Cardno[$tempno]=1; + $n++; + } + $sendflag=0; + $E1cmmIdStr=''; + for($i=1;$i<33;$i++){ + if($E1Cardno[$i]){ + $oidCard = "2.5."."$i"; + if($DEBUG) echo "
      oidSysCommSend('322_99_99',$nGetComm,$oidCard)
      "; + $commIdStr = oidSysCommSend('322_99_99',$nGetComm,$oidCard); + + $E1cmmIdStr =$E1cmmIdStr.$commIdStr; + + { + $obj = ($i<17) ? '322_0_0' : '322_1_0'; + if($i < 17) + $oidCard = "3.5."."$i"; + else + { + $ii = $i-16; + $oidCard = "3.5."."$ii"; + } + $commIdStr = oidSysCommSend($obj,$nGetComm,$oidCard); + if($DEBUG) echo "
      oidSysCommSend($obj,$nGetComm,$oidCard)
      "; + + $E1cmmIdStr =$E1cmmIdStr.$commIdStr; + } + $sendflag=1; + } + } + if($sendflag){ + CheckState($E1cmmIdStr); + } + for($i=1;$i<33;$i++){ + if($E1Cardno[$i]){ + $oidCard = "2.5."."$i"; + ChDbMov('322_99_99',$oidCard); + } + } + return; + +} + + +//**************************************************************** +// set_e1channel +//函数说明: +// 该函数用于set相应trunkgroup所属E1的channel参数 +// +//参数: +// $trunkgp +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function set_e1channel($trunkgp){ + global $nSetComm,$nGetComm,$DEBUG; + + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.4.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $HEXtrunkgp = omc_keep_length(dechex($trunkgp),"0","2"); + $HEXtrunkgp = strtoupper($HEXtrunkgp); + $paramSql = " SELECT instanceNo FROM $paramTable + WHERE $objWhereStr AND initValue = '$HEXtrunkgp' + ORDER BY instanceNo + "; + + $Result = mysqli_query($pubConn,$paramSql); + if(0)echo "
      paramSql:$paramSql"; + //------------读E1参数表--------------------- + $n = 0; + while($Row = mysqli_fetch_array($Result)){ + $tempnum = $Row[instanceNo]/8; + $cardno = Floor($tempnum); + $cardname = "cardno"."_$cardno"; + $tempno = $cardno+1; + $E1Cardno[$tempno]=1; + $n++; + } + $E1cmmIdStr=''; + for($i=1;$i<33;$i++){ + if($E1Cardno[$i]){ + $oidCard = "2.5."."$i"; + if($DEBUG) echo "
      oidSysCommSend('322_99_99',$nSetComm,$oidCard)
      "; + $commIdStr = oidSysCommSend('322_99_99',$nSetComm,$oidCard); + $E1cmmIdStr =$E1cmmIdStr.$commIdStr; + } + } + CheckState($E1cmmIdStr); + + return; + +} + + + +//**************************************************************** +// changeGTT +//函数说明: +// 该函数用于修改dpc参数是修改相应的GTT纪录 +// +//参数: +// $DPC,$NetID,$oldDPC,$oldNetID +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function changeGTT($DPC,$NetID,$oldDPC,$oldNetID){ + $tmpDb = 'OBJ_223'; + $tmpTable = 'param_99'; + $tmpoid = '2.2'; + $objWhereStr = getLevelWhere($tmpoid); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr + "; + $Result = mysqli_query($pubConn,$paramSql); + $num = 0; + while($Row = mysqli_fetch_array($Result)){ + $GTT_DPC = hexdec(getBitValue($Row[initValue],'24.0-26.7')); + $GTT_SSN = hexdec(getBitValue($Row[initValue],'27.0-27.7')); + $GTT_NetID = hexdec(getBitValue($Row[initValue],'23.0-23.7')); + $flag = hexdec(getBitValue($Row[initValue],'00.0-00.7')); + if($GTT_DPC == $oldDPC && $flag == 1 && $GTT_NetID == $oldNetID){ + $DPC_GTT = dechex($DPC); + $DPC_GTT = omc_keep_length($DPC_GTT,0,6); + $Row[initValue] = setBitValue($Row[initValue],'24.0-26.7',$DPC_GTT); + //$SSN_GTT = dechex($SSN); + $SSN_GTT = dechex($GTT_SSN); + $SSN_GTT = omc_keep_length($SSN_GTT,0,2); + $Row[initValue] = setBitValue($Row[initValue],'27.0-27.7',$SSN_GTT); + $NetID_GTT = dechex($NetID); + $NetID_GTT = omc_keep_length($NetID_GTT,0,2); + $Row[initValue] = setBitValue($Row[initValue],'23.0-23.7',$NetID_GTT); + $Row[initValue] = strtoupper($Row[initValue]); + $updSql = "UPDATE $tmpTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$Row[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + $num++; + } + } +} + + +//**************************************************************** +// toAscii +//函数说明: +// 该函数用于把byte转换成字符串 +// +//参数: +// $DPC,$NetID,$oldDPC,$oldNetID +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function toAscii($byteValue){ + $charValue = ""; + $tmpLen=strlen($byteValue); + for($charCount=0; $charCount < $tmpLen; $charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $charCount++; + if($unitByte == 0) break; + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + $charValue .= $unitChar; + } + return $charValue; +} + +//**************************************************************** +// toHex +//函数说明: +// 该函数用于把字符串转换成byte +// +//参数: +// $DPC,$NetID,$oldDPC,$oldNetID +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function toHex($byteValue){ + $charValue = ""; + $tmpLen=strlen($byteValue); + for($charCount=0; $charCount < $tmpLen; $charCount++){ + $unitByte = substr($byteValue,$charCount,1); + $unitChar = dechex(ord($unitByte)); + $charValue .= $unitChar; + } + return $charValue; +} + + +//**************************************************************** +// getHeartbeat +//函数说明: +// 该函数用于从heartbeat取状态判断设备是否存在 +// +//参数: +// $sysTypeNo +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function getHeartbeat($sysTypeNo){ + global $pubDb; + $getSql="SELECT sysTypeNo,sysNo,subSysNo FROM OMC_PUB.sysInfo WHERE sysTypeNo=$sysTypeNo"; + $result =mysqli_query($pubConn,$getSql); + //echo "$getSql
      "; + echo mysqli_error($pubConn); + $count=0; + while($rows=mysqli_fetch_array($result)){ + $count++; + } + return $count; +} + + +//**************************************************************** +// InitialAAS +//函数说明: +// 该函数用于初始化aas参数 +// +//参数: +// $systemNo +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function InitialAAS($systemNo) +{ + global $nSetComm; + + $objDB = "OBJ_311"; + $paramTable = 'param_'.$systemNo; + $sccp_sysId = "223_11_".$systemNo; + $AasSysId = "311_".$systemNo."_0"; + + $oidsysarr=array('2.1.3','2.1.4','2.1.5','2.1.8','2.1.9','2.1.10','2.3.1','2.3.2'); + + + for($i=0;$i"; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + + //**************************************************************** + $commIdStr =oidSysCommSend($AasSysId,$nSetComm,$oidstr); + + $commArr = $commArr.$commIdStr; + //**************************************************************** + } + +/* + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_11'; + $oidstr = '2.1.8'; + + $objWhereStr = getLevelWhere($oidstr); + + $paramSql = " SELECT initValue FROM OBJ_223.paramConf + WHERE $objWhereStr"; + + $Result_def = mysql_db_query('OBJ_223',$paramSql); + $Row_def = mysqli_fetch_array($Result_def); + $tmpDefValue= $Row_def[initValue]; + + + $updflag = "UPDATE $tmpTable SET initValue = '$tmpDefValue' + WHERE $objWhereStr + "; + if($debug) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + + //**************************************************************** + $commIdStr =oidSysCommSend('223_11_99',$nSetComm,$oidstr,$sccp_sysId); + if($commIdStr=='-1'){ + DelComm($commArr); + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend('223_11_99',$nSetComm,$oidstr,$sccp_sysId)
      "; + echo "

      Back"; + exit(); + } + $commArr = $commArr.$commIdStr; + //**************************************************************** +*/ + CheckState($commArr); +} + + +//**************************************************************** +// InitialAAS +//函数说明: +// 该函数用于检查dpc有没有重复 +// +//参数: +// $DPC,$NI +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function chkDPC($DPC,$NI){ + //dpc ni不能设重 + $tmpDb = 'OBJ_222'; + $tmpTable = 'param_99'; + $tmpoid = '2.4.1'; + $objWhereStr = getLevelWhere($tmpoid); + + $setDPC = omc_keep_length(dechex($DPC),0,6); + $setDPC = strtoupper($setDPC); + $setNetID = $NI; + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND initValue LIKE '$setDPC%' + "; + $Result = mysqli_query($pubConn,$paramSql); + while($Row = mysqli_fetch_array($Result)){ + $flag=getBitValue($Row[initValue],'3.2-3.2'); + if($flag&&($setNetID==bindec(getBitValue($Row[initValue],'3.0-3.1')))){ + echo ""; + exit(); + } + } + + //不能与 spc 重复 + { + $oidstr = '2.2'; + $link_Db = 'OBJ_222'; + $link_Table = 'param_99'; + + $subSysNo = 99; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $link_Table + WHERE $objWhereStr + "; + if($DEBUG) echo "$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + $NIbit = getBitValue($Row[initValue],"0.$setNetID"); + $tmp = $setNetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = "SELECT initValue FROM $link_Table + WHERE $objWhereStr AND instanceNo = '0' + "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $WXC2DPC = strtoupper($Row[initValue]); + if(hexdec($setDPC) == hexdec($WXC2DPC)){ + echo ""; + exit(); + } + } + +} +function chkEleName($setName) +{ + global $pubDb; + $DEBUG = 0; + $ElementInfoObjId='2.11'; + $levelWhere = getLevelWhere($ElementInfoObjId); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + $ElementInfoParamTable='OBJ_225.param_99'; + $getSql="SELECT initValue,instanceNo FROM $ElementInfoParamTable + WHERE $levelWhere and initValue LIKE '01%' "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $nameOffset = '14.0-23.7'; + while($rows=mysqli_fetch_array($result)) + { + $name = trim(toAscii(getBitValue($rows[initValue],$nameOffset))); + + if(strcmp($name,$setName)==0){ + echo ""; + exit(); + } + } +} + +//**************************************************************** +// getE1State +//函数说明: +// 该函数用于检查所属TG,Linkset下E1 ,E1 link的状态 +// +//参数: +// $TG,$linkset +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function getE1State($TG,$linkset) +{ + global $pubDb; + if(strlen($TG)<=0) + $TG =255; + if(strlen($linkset)<=0) + $linkset = 255; + + + $tmpObjIdStr='2.4.2'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $tmpTgValue=dechex($TG); + $tmpTgValue=strtoupper(omc_keep_length($tmpTgValue,0,2)); + $getSql="SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE $levelWhere AND initValue='$tmpTgValue' + "; + $result =mysqli_query($pubConn,$getSql); + + $flag=0; + $E1state1=1;//OK + $E1state2=0;//DOWN + $ins_bgn = 22; //e1 installed + $phy_bgn = 24; //e1 layer1(physical layer) + $el2_bgn = 25; //e1 layer2 + while($rows = mysqli_fetch_array($result)) + { + {//e1 enable,L1,L2 status + $tempnum = $rows[instanceNo]/8; + $cardno = Floor($tempnum); + $sysNo = $cardno > 15 ? 1 : 0; + $slot = $cardno % 16; + $port = $rows[instanceNo] - $cardno*8; + + $e1selSql = "SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime + FROM sysStat WHERE sysTypeNo='111' AND sysNo='$sysNo' and subSysNo='$slot' "; + + $e1Result = @mysqli_query($pubConn,$e1selSql); + if($e1Row = @mysqli_fetch_array($e1Result)) + { + $hex_mes = $e1Row[detailStat]; + $bin_mes=''; + for($i=0;$i1) ? 0 : $tmp2; + + //e1 layer2 install + $bin_inl=substr($bin_mes,$el2_bgn*8+7-$port,1);//0:'N'; 1:'Y'; + $tmp3 = bindec($bin_inl); + + $E1state1 = $E1state1 & $tmp2 & $tmp3; + $E1state2 = $E1state2 | $tmp2 | $tmp3; + $flag = 1; + } + }//end e1 L1,L2 status + } + + $out_time=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-30,date("m"),date("d"),date("Y"))); + //E1 link status + $HbparamSql = " SELECT detailStat FROM OMC_PUB.sysStat + WHERE sysTypeNo='200' AND sysNo='9' AND subSysNo='0' AND updateTime>'$out_time' + "; + $Hbresult = mysqli_query($pubConn,$HbparamSql); + $Hbvalue_mpt3 = mysqli_fetch_array($Hbresult);//取mtp3 的heartbeat + + //E1 link + $tmpObjIdStr='2.5.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $tmpValue=dechex($linkset); + $tmpValue=strtoupper(omc_keep_length($tmpValue,0,2)); + $getSql="SELECT initValue,instanceNo FROM OBJ_222.param_99 + WHERE $levelWhere AND initValue LIKE '$tmpValue%' + "; + $result =mysqli_query($pubConn,$getSql); +//echo "
      $getSql"; + $flaglink=0; + while($rows=mysqli_fetch_array($result)) + { + $linkflag = getBitValue($rows[initValue],'06.5-06.5'); + if($linkflag) + { + $Hboffset=34+Floor($rows[instanceNo]/4); + $tmpValue=substr($Hbvalue_mpt3[detailStat],$Hboffset*2,2); + $bitoff =$rows[instanceNo]%4; + $bitoff1=$bitoff*2; + $bitoff2=$bitoff1+1; + $bitoff='0.'.$bitoff1.'-0.'.$bitoff2; +//echo "
      $bitoff"; + $tmp=bindec(getBitValue($tmpValue,$bitoff)); + if($tmp>1) + $tmp=0; + $E1state1 = $E1state1 & $tmp; + $E1state2 = $E1state2 | $tmp; + $flaglink=1; + } + } + if(0) + { + $return = "$tmp; $tmp2 ;$tmp3"; + $return1 = "$sysNo; $slot; $port"; + //return $return1; + return $return; + } + if($flag&&$flaglink&&$E1state1==1&&$E1state2==1) + $E1state='Available'; + elseif($flag&&$flaglink&&$E1state1==0&&$E1state2==1) + $E1state='Alarm'; + else + $E1state='Unavailable'; + return $E1state; +} + +function delete_e1($ins_no) +{ + global $e1_oid,$link_oid,$msc_paramTable,$mtp3_sqltable,$DEBUG,$pubdb; + $objWhereStr = getLevelWhere($e1_oid[1]); + $setsql = "update $msc_paramTable set initValue = '00' where $objWhereStr and instanceNo = '$ins_no'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($e1_oid[2]); + $setsql = "update $msc_paramTable set initValue = 'EE' where $objWhereStr and instanceNo = '$ins_no'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($e1_oid[3]); + $setsql = "update $msc_paramTable set initValue = '00' where $objWhereStr and instanceNo = '$ins_no'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($e1_oid[4]); + $setsql = "update $msc_paramTable set initValue = '00' where $objWhereStr and instanceNo = '$ins_no'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; + + $objWhereStr = getLevelWhere($link_oid); + $setsql = "update $mtp3_sqltable set initValue = '8010FFFFFFFF000000000000000000FFFFFFFF' where $objWhereStr and instanceNo = '$ins_no'"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$setsql
      "; +} + +function is8ke1Enable($instanceNo) +{ + $nSetComm = 3; + $tempnum = $instanceNo/8; + $cardno = Floor($tempnum); + $tmp = $cardno/16; + $k8e1SysNo = floor($tmp); + $k8e1Table = "param_$k8e1SysNo"; + $k8e1Db = "OBJ_111"; + $setInstNo = $cardno%16; + $cardE1no = $instanceNo - $cardno*8; + + $selSql = "select initValue from $k8e1Table + where level_1='2' and level_2='1' and instanceNo='$setInstNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setbit = "0.$cardE1no-0.$cardE1no"; + $enable = getBitValue($row[initValue],$setbit); + return $enable; +} + +function set8ke1($objIdStr,$instanceNo,$value) +{ + + $nSetComm = 3; + $tempnum = $instanceNo/8; + $cardno = Floor($tempnum); + $tmp = $cardno/16; + $k8e1SysNo = floor($tmp); + $k8e1Table = "param_$k8e1SysNo"; + $k8e1Db = "OBJ_111"; + $setInstNo = $cardno%16; + $cardE1no = $instanceNo - $cardno*8; + if(strcmp($objIdStr,'2.9')==0 && $cardE1no % 2 != 0)//set8ke1Canceller, 偶数端口才设置 + return; + $levelWhere = getLevelWhere($objIdStr); + + $selSql = "select initValue from $k8e1Table + where $levelWhere and instanceNo='$setInstNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + + $setbit = "0.$cardE1no-0.$cardE1no"; + if(strcmp($objIdStr,'2.12')==0)//set8kIdleCode + $setbit = "$cardE1no.0-$cardE1no.7"; + $setValue = strtoupper(setBitValue($row[initValue],$setbit,$value)); + + if(strcmp($objIdStr,'2.10.2')==0 //set8ke1SigSlot + || strcmp($objIdStr,'2.11')==0)// + $setValue = omc_keep_length(dechex($value),0,2); + + $updSql = "update $k8e1Table set initValue='$setValue' + where $levelWhere and instanceNo='$setInstNo' "; + + mysqli_query($pubConn,$updSql); + + $sysId ="111_".$k8e1SysNo."_99"; + //$slcSysId = "111_".$k8e1SysNo."_"."$setInstNo"; + $slcSysId = '-1'; + $commIdStr =oidSysCommSend($sysId,$nSetComm,$objIdStr,$slcSysId); + if($commIdStr=='-1') + { + //DelComm($commIdStr); + outPutErrMsg($sysId,$slcSysId); + } + CheckState($commIdStr); +} + +function open8ke1Enable($instanceNo, $value) +{ + $objIdStr = '2.1'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function open8ke1mtpAlarm($instanceNo, $value) +{ + $objIdStr = '2.2'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function set8ke1LinkType($instanceNo, $value) +{ + $objIdStr = '2.3'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function set8ke1NTLT($instanceNo, $value) +{ + $objIdStr = '2.4'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function open8ke1CRC4Flag($instanceNo, $value) +{ + $objIdStr = '2.6'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function set8ke1Mtp2ErrCrct($instanceNo, $value) +{ + $objIdStr = '2.8'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function set8ke1Canceller($instanceNo, $value) +{ + $objIdStr = '2.9'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function set8ke1SigSlot($instanceNo, $value) +{ + $objIdStr = '2.10.2'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function set8kT156K64K($instanceNo, $value) +{ + $objIdStr = '2.10.6'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function set8kCardType($instanceNo, $value) +{ + $objIdStr = '2.11'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function set8kIdleCode($instanceNo, $value) +{ + $objIdStr = '2.12'; + set8ke1($objIdStr,$instanceNo,$value); +} + +function getNiType() +{ + global $pubDb; + $mtp3_sqlTable = 'OBJ_222.param_99'; + $querysql = "select initValue from $mtp3_sqlTable where level_1 = '2' and level_2 = '2' and level_3 = '0'"; + $indiResult = mysqli_query($pubConn,$querysql); + $indiRow = mysqli_fetch_array($indiResult); + echo mysqli_error($pubConn); + for($i=0; $i<4; $i++) + { + $j = $i+4; + $off_set = "0.$j-0.$j"; + $niTypeArr[$i] = getBitValue($indiRow[initValue],$off_set);//0:ITU; 1:ANSI + //$niTypeArr[2] = 1; + } + return $niTypeArr; +} + +function outPutErrMsg($sysId,$slcSysId=-1) +{ + global $PlatTypeDefArr; + $pubdb = "OMC_PUB"; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + if($slcSysId!=-1) + { + $slcSysIdArr = explode('_',$slcSysId); + $slcSysTypeNo = $slcSysIdArr[0]; + $slcSysNo = $slcSysIdArr[1]; + $slcSubSysNo = $slcSysIdArr[2]; + } + $selSql = "select sysTypeName from sysConf where sysTypeNo='$sysTypeNo'"; + $Result = mysqli_query($pubConn, $selSql); + $Row = mysqli_fetch_array($Result); + + $sysName = $Row[sysTypeName]; + if($sysTypeNo == 111) + { + $sysName = "CSU$slcSysNo Card-$slcSubSysNo"; + } + + if(isset($slcSysNo)) $sysName .= "-$slcSysNo"; + + if($sysTypeNo=='222' || $sysTypeNo=='223') + { + if($slcSysId != -1) + { + $sysName = $PlatTypeDefArr[$slcSysNo][remark]; + $sysName .= "-$slcSubSysNo"; + } + } + echo "

      $sysName Error, Please check the device state!
      "; + echo "

      Back"; + exit(); +} +function outPutChkMsg($sysTypeNo,$sysNo,$Reason='',$errRetFlag) +{ + global $STR_CONF_COMMAND_ERR_0000; + global $STR_CONF_PROMPT_001,$STR_CONF_COMMAND_ERR_0011,$STR_CONF_COMMAND_ERR_0012; + global $STR_CONF_PROMPT_002,$STR_CONF_COMMAND_ERR_0021,$STR_CONF_COMMAND_ERR_0022; + global $STR_CONF_PROMPT_003,$STR_CONF_COMMAND_ERR_0031,$STR_CONF_COMMAND_ERR_0032,$STR_CONF_COMMAND_ERR_0033; + global $STR_CONF_PROMPT_004,$STR_CONF_COMMAND_ERR_0041,$STR_CONF_COMMAND_ERR_0042,$STR_CONF_COMMAND_ERR_0043; + global $STR_CONF_COMMAND_ERR_9999; + + //echo "Reason=$Reason"; + global $PlatTypeDefArr; + $pubdb = "OMC_PUB"; + $selSql = "select sysTypeName from sysConf where sysTypeNo='$sysTypeNo'"; + $Result = mysqli_query($pubConn, $selSql); + $Row = mysqli_fetch_array($Result); + if($sysTypeNo == '222' || $sysTypeNo=='223') + { + $sysName = $PlatTypeDefArr[$sysNo][remark] . "-" . $Row[sysTypeName]; + } + else + { + $sysName = $Row[sysTypeName]."-".$sysNo; + } + $tmpErrCode="STR_CONF_COMMAND_ERR_".$Reason; + $tmpPromptCode="STR_CONF_PROMPT_".$Reason[0].$Reason[1].$Reason[2]; + echo "

      $sysName Error:${$tmpErrCode}
      "; + echo "Prompt:${$tmpPromptCode}
      "; + + if($errRetFlag == 1){ + $tmpResult= "$sysName Error:${$tmpErrCode}.
      Prompt:${$tmpPromptCode}"; + echo ""; + }else{ + echo "

      Back"; + } + exit(); +} + +function getElementInfo($infoNo,&$elementInfoArr) +{ + global $sysTypeInLinkSetDef,$strGttObjects; + $tmpobj = 'OBJ_225'; + $tmpparam = 'param_99'; + $typeOffset = '1.0-1.7'; + $sysNoOffset = '2.0-2.3'; + $subSysNoOffset = '2.4-2.7'; + $tgOffset = '3.0-3.7'; + $lsOffset = '4.0-4.7'; + $appTypeOffset = '5.0-5.7'; + $appGrpOffset = '6.0-6.7'; + $nameOffset = '14.0-23.7'; + + $objWhereStr =" level_1 = '2' and level_2 = '11'"; + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpparam + WHERE $objWhereStr AND instanceNo ='$infoNo'"; + $Result = mysqli_query($pubConn,$paramSql); + $rows = mysqli_fetch_array($Result); + $typeValue=hexdec(getBitValue($rows[initValue],$typeOffset)); + $sysNo = bindec(getBitValue($rows[initValue],$sysNoOffset)); + $subsysNo = bindec(getBitValue($rows[initValue],$subSysNoOffset)); + $tmpSystemNo= $sysNo; + $assignedTg = hexdec(getBitValue($rows[initValue],$tgOffset)); + $assignedls = hexdec(getBitValue($rows[initValue],$lsOffset)); + $appType = hexdec(getBitValue($rows[initValue],$appTypeOffset)); + $appGrp = hexdec(getBitValue($rows[initValue],$appGrpOffset)); + $name = trim(toAscii(getBitValue($rows[initValue],$nameOffset))); + + $TypeNo = getBitValue($Row[initValue],'2.0-2.7'); + $TypeNo = hexdec($TypeNo); + + if($typeValue==0) + { + $Spname = "Undefined"; + } + elseif($typeValue < 16) + { + $tmpno = $typeValue - 1; + $Spname = $sysTypeInLinkSetDef[$tmpno][name]; + } + elseif($typeValue==16) + { + $Spname = 'Switch'; + } + elseif($typeValue==17) + $Spname = 'IUA'; + elseif( $typeValue==18) + { + switch($appType) + { + case '0': + $Spname = 'MSC'; + break; + case '1': + $Spname = 'HLR'; + break; + case '2': + $Spname = 'VLR'; + break; + case '3': + $Spname = 'SMSC'; + break; + case '4': + $Spname = 'SGSN'; + break; + case '5': + { + $Spname = $name; + } + } + } + else + { + $Spname = "Undefined"; + } + + $webname = $Spname; + switch($webname) + { + case 'BSC': + $devicename = 'BSC'; + break; + case 'AAS': + case 'VSS': + case 'PCR': + case 'CNF': + $devicename = 'Peripheral'; + break; + case 'Switch': + case 'IUA': + $devicename = 'Switch'; + break; + case 'MSC': + case 'VLR': + case 'HLR': + case 'SMSC': + case 'SGSN': + $devicename = $strGttObjects; + break; + default: + $devicename = 'Unknow'; + break; + } + + if($appType == 5) $devicename = $strGttObjects; + + $elementInfoArr[typeName] = $devicename; + $elementInfoArr[eleName] = $name; + $elementInfoArr[webName] = $webname; + $elementInfoArr[typeValue] = $typeValue; + $elementInfoArr[sysNo] = $sysNo; + $elementInfoArr[subSysNo] = $subsysNo; + $elementInfoArr[tg] = $assignedTg; +} + +function checkDevices($sysTypeNo) +{ + global $pubDb; + $sysIdSql="SELECT DPC,ip,sysTypeName,sysInfo.sysTypeNo,sysNo,subSysNo,sysAlias FROM sysInfo,sysConf WHERE sysInfo.sysTypeNo=sysConf.sysTypeNo AND sysInfo.sysTypeNo = $sysTypeNo "; + $result = mysqli_query($pubConn,$sysIdSql); + echo mysqli_error($pubConn); + $rowsNum=mysqli_num_rows($result); + $rows=mysqli_fetch_array($result); + $sysTypeName=$rows[sysTypeName]; + if($rowsNum < 1) + { + echo "Can't find this device!"; + echo "

      Back"; + exit(); + } +} +function alertMsg($msg) +{ + echo ""; + exit(); +} +function sendBssCommand($bssid,$ip,$sysAlias,$add=1) +{ + $DEBUG = 0; + $db = "BssOmcDb"; + $remark = $sysAlias; + if($add==1) + $nmicmd="newbss $bssid $ip"; + else + $nmicmd = "dropbss $bssid $ip"; + + /* Old MySql */ + $sqlstring = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 " . + "ORDER BY seqNum ASC LIMIT 10"; + //echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while (list($row_no[]) = mysqli_fetch_row($res)); + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + if ( $no_of_rows <= 0 || ($no_of_rows > 10) ) + { + // + // No available row in OMCR_COMMAND + // Send error to MySQL() + // + $errorInfo = "Command table is full: Wait and send the command again"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + alertMsg($errorInfo); + + } + if($add==1) + { + // + // Save "Name and remark" in OMCR_BSSTABLE + // A non-null IP field in OMCR_BSSTABLE means the entry is valid + // + $sqlstring = "UPDATE OMCR_BSSTABLE SET name='$remark', ip='$ip'," . + "remark='$remark' WHERE bssid=$bssid"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + // + // Insert 1 commands in OMCR_COMMAND out of 10 possible available rows + // + $i=0; + do + { + if ($row_no[$i] != '') + { + $sqlstring = "REPLACE INTO OMCR_COMMAND VALUES(" . + $row_no[$i] . ",-1,'$nmicmd',null,255,-1,null,null,null)"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + } + $i++; + } while ($i<10 && mysql_affected_rows() != 2); //replace=delete+insert (2 task) + + $cmd1_row_no = $row_no[$i-1]; + + // + // Wait for response: timeout after 500ms x 20 = 10 secs + // + $i=0; + while ($i<20) + { + usleep(500000); + $sqlstring = "SELECT resultcode,result,responsecode,response from OMCR_COMMAND WHERE status=0 AND " . + "row_no=$cmd1_row_no ORDER BY seqNum ASC"; + if($DEBUG) echo "$sqlstring
      "; + $res = mysqli_query($pubConn,$sqlstring) or + die("Invalid query:$sqlstring\n" . mysqli_error($pubConn)); + while ( $mydata = mysqli_fetch_row($res) ) + list($resultcode,$result,$responsecode,$response) = $mydata; + //list($a[],$b[],$c[],$d[],$e[],$f[],$result[],$response[]) = $mydata; + $no_of_rows = mysqli_num_rows($res); + mysql_free_result($res); + + if ($no_of_rows == 1) + { + if($add==1)//add + { + if ($result != 'ok') + { + // Create/Delete failed !!! + $errorInfo = "$result: $response"; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + //$errorInfo=rawurlencode($errorInfo); + alertMsg($errorInfo); + } + } + else//delete + { + if ($resultcode != 0) + { + $errorInfo = "dropbss command failed: ".$response; + if($DEBUG) echo "
      errorInfo=$errorInfo"; + //$errorInfo=rawurlencode($errorInfo); + alertMsg($errorInfo); + } + } + } + echo ""; + flush(); + $i++; + } +}//end sendBssCommand + +function getExistElements(&$existElementArr) +{ + global $pubDb; + $elementConfTb = 'elementExistConf'; + $selSql = " select elementTypeNo from $elementConfTb where existFlag='1' and elementTypeNo!='0' order by elementNo"; + if($DEBUG) echo "
      selSql=$selSql"; + $res = @mysqli_query($pubConn,$selSql); + $i=0; + while($rows = mysqli_fetch_array($res)) + { + $existElementArr[$i++] = $rows[elementTypeNo]; + } + return $existElementArr; +}//end getExistElements + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + $errorInfo = "Error in omcStrFill:the defLen < lengh of string!!\\ndefLen=$defLen and string=$string!!"; + echo ""; + exit(); + + echo "
      Error in omcStrFill : the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +function omcShowParam($oIdstrarr,$sysTypeNo,$instanceNo,$webname,$no){ + global $language,$paramTable; + + $nShowsize = '40%'; + + $nInteger = 2; + $nOctStr = 4; + $sysConfTable = 'OMC_PUB.sysConf'; + $sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:0); + + $pubDb ='OMC_PUB'; + $objDb = omcGetObjDb($sysTypeNo); + $paramConfTable = omcGetObjTbl($sysTypeNo,paramConf); + $maxLevelNum = 10; + + if($DEBUG) echo "
      $paramConfTable
      "; + if($DEBUG) echo "
      aliasName=$aliasName
      "; + //---------------------- + //选择语言版本 + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + if($DEBUG) echo "
      setValue = $setValue ,inputName = $inputName"; + //if($keyId > 0){ + if($oIdstrarr !=NULL){ + + $levelArr=explode('.',$oIdstrarr); + $objWhereStr= ''; + + for($j=0;$jERROR!!:oid == NULL"; + exit(); + } + + //explode by '[remark]' + $remarkArr = explode('[remark]',$setTemplate); + $remark = $remarkArr[1]; + + $orderSql = "SELECT paramOBJ ,paramName ,webPageName ,fileOption FROM elementParamConf WHERE paramOBJ ='$oIdstrarr' AND webPageName = '$webname'"; + $orderResult = mysqli_query($pubConn ,$orderSql); + $orderRows = @mysqli_fetch_array($orderResult); + + + $reorder = $orderRows[fileOption]; + //$reorder = 'order.2.1-h-100.16.9.5-h-5'; + if($DEBUG) echo "$reorder
      "; + //explode by '[unit]' + $unitArr = explode('[unit]',$remarkArr[0]); + $unitOrderArr = explode('.',$reorder); + + for($i=1;$i{$unitArr[$i]}"; + continue; + } + + if($instanceNo =='flag'){ + if($tlvArr[0] == 'flag'){ +// echo "$tlvArr[1]"; + return $tlvArr[1]; + } + else{ + continue; + } + } + + + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($showflag){ + if($webname=="BSC") + echo "\n "; + else + echo "\n "; + }else{ + echo "\n "; + } + + //show Unit Name + echo "$tlvArr[0]"; + + echo " "; + if($DEBUG) echo "$tlvArr[1]"; + + if($DEBUG) echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + //$unitChar = chr(HexDec($unitByte)); // hex -> ascii + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $charValue = trim($charValue); + $inputValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) { + switch($defArr[2]){ + case '0': + $inputValue = str_replace('00','',$inputValue); + break; + case 'E': + $inputValue = str_replace('E','',$inputValue); + break; + case 'F': //modify zane 20051004 + $inputValue = str_replace('F','',$inputValue); + break; + default: break; + } + } + break; + default: break; + } + if($DEBUG) echo "
      $valueType == $nOctStr"; + if($def_flag){ + $inputValue = $defaultVaule; + } + if($valueType == $nOctStr){ + if($defArr[0] == 'toAscii'){ + $inputLen = $byteLen; + }elseif($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + $inputLen = $byteLen *2; + }else{ + $inputLen = $byteLen *3; + } + //echo ""; + if($readonly){ + echo ""; + echo "$inputValue"; + }else{ + echo ""; + } + + }else{ + //echo ""; + if($readonly){ + echo ""; + echo "$inputValue"; + }else{ + echo ""; + } + echo ""; + echo ""; + echo ""; + } + break; + case 'select': + if($valueType == $nOctStr){ + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + }else{ + $selectValue=$byteValue; + } + if($def_flag){ + $selectValue = $defaultVaule; + } + + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + if($DEBUG) echo "
      $valueType =?= $nOctStr(nOctStr)"; + if($readonly){ + echo ""; + } + $isSelected = 0; + for($j=1;$jReserved Value"; + $selectshwo = "Reserved Value"; + break; + }elseif($defArr[0] == $selectValue){ + + echo ""; + + $selectshwo ="$selectValue"; + $isSelected = 1; + }else{ + echo ""; + } + } + + if($isSelected ==0 && $j == sizeof($valueArr)){ + echo ""; + $selectshwo = "Undefined Value"; + } + echo ""; + if($readonly){ + echo "$selectshwo"; + } + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + if($valueType == $nOctStr){ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'keepDec-high-0'; + } + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + $unitDefName = "unitDef_".$no.'_'.$i; + echo "\n "; + echo ""; + }//end of for(..) + + $unitNum = $order-1; + + echo "\n"; +} +?> + + + + + + diff --git a/wxc2_omc/element/sub_inc/expand.js b/wxc2_omc/element/sub_inc/expand.js new file mode 100755 index 0000000..4085f3e --- /dev/null +++ b/wxc2_omc/element/sub_inc/expand.js @@ -0,0 +1,134 @@ + \ No newline at end of file diff --git a/wxc2_omc/element/sub_inc/getParameter.php b/wxc2_omc/element/sub_inc/getParameter.php new file mode 100755 index 0000000..fa23fbc --- /dev/null +++ b/wxc2_omc/element/sub_inc/getParameter.php @@ -0,0 +1,838 @@ +levelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + +function omcStrFill($string,$defLen,$fillWay='high',$fillChar='0'){ + if(strlen($string) <= $defLen){ + $fillLen=$defLen - strlen($string); + for($i=0;$i<$fillLen;$i++){ + if($fillWay == 'low'){ + $string = $string.$fillChar; + }else{ + $string = $fillChar.$string; + } + } + return($string); + }else{ + $errorInfo = "Error in omcStrFill:the defLen < lengh of string!!\\ndefLen=$defLen and string=$string!!"; + echo ""; + exit(); + + echo "
      Error in omcStrFill : the defLen < lengh of string!!"; + echo "
      defLen=$defLen and string=$string!!"; + exit(); + } +} + +function getInnerValue($sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$showStr,$inputValueType) +{ + global $language,$Debug,$inputID; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $sysConfTable = 'OMC_PUB.sysConf'; + $pubDb ='OMC_PUB'; + $paramConfTable = $objDb.".paramConf"; + + $maxLevelNum = 10; + $nInteger = 2; + $nOctStr = 4; + + + + + if(strlen($showStr)>0){ + echo ""; + return ""; + } + + if($Debug) echo "
      $paramConfTable
      "; + //---------------------- + //选择语言版本 + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + if($Debug) echo "
      getValue = $getValue"; + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + + $paramSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $getValue = $v_Row[0]; + + + //explode by '[remark]' + $remarkArr = explode('[remark]',$setTemplate); + $remark = $remarkArr[1]; + //explode by '[unit]' + $unitArr = explode('[unit]',$remarkArr[0]); + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$order]); + + //Unit Name + if($Debug) echo "$tlvArr[0] : $tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($getValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + + if($Debug) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + if($Debug) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($Debug) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($Debug) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($Debug) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($Debug) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + //$operType = chop($valueArr[0]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + if($Debug) echo "
      operType = $operType"; + switch($operType){ + case 'input': + { + //explode by '-' + $defArr = explode('-',$valueArr[1]); + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($Debug) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $charValue = trim($charValue); + $inputValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($Debug) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) { + switch($defArr[2]){ + case '0': + $inputValue = str_replace('00','',$inputValue); + break; + case 'E': + $inputValue = str_replace('E','',$inputValue); + break; + case 'F': //modify zane 20051004 + $inputValue = str_replace('F','',$inputValue); + break; + default: break; + } + } + break; + default: break; + } + if($Debug) echo "
      $valueType == $nOctStr"; + if($def_flag){ + $inputValue = $defaultVaule; + } + //echo "valueType:$valueType
      "; + //if($valueType == $nOctStr) + //echo "getInner----inputValueType:$inputValueType
      "; + //$inputValueType=$inputValueType+0; + if($valueType==2) + { + $chechFnc = "checkInput(this,16)"; + + if($defArr[0] == 'toAscii') + { + $inputLen = $byteLen; + $chechFnc = ""; + } + elseif($defArr[0] == 'toHex' || $defArr[0] == 'keepHex') + { + $inputLen = $byteLen *2; + } + else + { + $inputLen = $byteLen *3; + } + $inputSize = $inputLen + 2; + } + else + { + $chechFnc = "checkInput(this,10)"; + } + + //=============input type===================== + $inputValueType=$inputValueType+0; + //echo "getInner----inputValueType:$inputValueType
      "; + //===only can input the dec num==== + if($inputValueType==1) + { + $chechFnc = "checkInput(this,10)"; + } + //===only can input the hex num==== + else if($inputValueType==2) + { + $chechFnc = "checkInput(this,16)"; + } + //====can input all character + else if($inputValueType==3) + { + $chechFnc = ""; + } + //=====can put only dec num but include blank + else if($inputValueType==4) + { + $chechFnc = "checkInput_patch(this)"; + } + + + + echo ""; + return $inputValue; + break; + } + case 'select': + { + if($valueType == $nOctStr){ + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + }else{ + $selectValue=$byteValue; + } + if($def_flag){ + $selectValue = $defaultVaule; + } + + if($Debug) echo "
      bitValue = $bitValue"; + if($Debug) echo "
      selectValue = $selectValue"; + if($Debug) echo "
      $valueType =?= $nOctStr(nOctStr)"; + echo ""; + if($readonly){ + echo "$selectshwo"; + } + return $selectshwo; + break; + } + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) +}//end getInnerValue + +function getParamValue(&$titleStr,&$IniEquRead,$sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$inputValueType) +{ + global $language; + //$Debug=1; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $sysConfTable = 'OMC_PUB.sysConf'; + $pubDb ='OMC_PUB'; + $paramConfTable = $objDb.".paramConf"; + + $maxLevelNum = 10; + $nInteger = 2; + $nOctStr = 4; + + + + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + //explode by '[remark]' + $remarkArr = explode('[remark]',$setTemplate); + $remark = $remarkArr[1]; + //explode by '[unit]' + $unitArr = explode('[unit]',$remarkArr[0]); + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$order]); + + //Unit Name + if($Debug) echo "$tlvArr[0] : $tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + + $paramSql = " SELECT initValue,readValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $initGetValue = $v_Row[0]; + $readGetValue = $v_Row[1]; + + $initByteValue = substr($initGetValue,$bgnByte*2,$byteLen*2); + $readByteValue = substr($readGetValue,$bgnByte*2,$byteLen*2); + if($Debug) echo "
      init:$initByteValue
      read:$readByteValue"; + $readBitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8;//1 byte = 8 bit + $readBitValue = DecBin(HexDec($readByteValue)); + $readBitValue = omcStrFill($readBitValue,$bitLen,'high','0'); + $readBitValue = strrev($readBitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($Debug) echo "
      readBitValue = substr($readBitValue,$bgnBit,$catBitLen)"; + $readBitValue = substr($readBitValue,$bgnBit,$catBitLen); + $readBitValue = strrev($readBitValue); + if($Debug) echo "
      readBitValue = $readBitValue"; + } + $initBitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8;//1 byte = 8 bit + $initBitValue = DecBin(HexDec($initByteValue)); + $initBitValue = omcStrFill($initBitValue,$bitLen,'high','0'); + $initBitValue = strrev($initBitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($Debug) echo "
      initBitValue = substr($initBitValue,$bgnBit,$catBitLen)"; + $initBitValue = substr($initBitValue,$bgnBit,$catBitLen); + $initBitValue = strrev($initBitValue); + if($Debug) echo "
      initBitValue = $initBitValue"; + } + $IniEquRead = false; + if(strlen($initBitValue)>0) + { + if($initBitValue==$readBitValue) + $IniEquRead = true; + } + else + { + if($initByteValue == $readByteValue) + $IniEquRead = true; + } + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($Debug) echo "
      operType = $operType"; + switch($operType) + { + case 'input': + { + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($Debug) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]) + { + case 'toDec': + if(strlen($initBitValue) > 0){ + $initParsedValue = BinDec($initBitValue); + }else{ + $initParsedValue = HexDec($initByteValue); + } + break; + case 'keepDec': + $initParsedValue = $initByteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $initParsedValue = $initByteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7) + { + echo "
      Error:toAscii"; + exit(1); + } + else + { + $tmpLen=strlen($initByteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++) + { + $unitByte = substr($initByteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($Debug) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $charValue = trim($charValue); + $initParsedValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($Debug) echo "
      initParsedValue = $initParsedValue"; + switch($defArr[1]) + { + case 'high': + switch($defArr[2]) + { + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$initParsedValue = str_replace('0','',$initParsedValue); + }else{ + $initParsedValue = $initParsedValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) + { + switch($defArr[2]){ + case '0': + $initParsedValue = str_replace('00','',$initParsedValue); + break; + case 'E': + $initParsedValue = str_replace('E','',$initParsedValue); + break; + case 'F': //modify zane 20051004 + $initParsedValue = str_replace('F','',$initParsedValue); + break; + default: break; + } + } + break; + default: break; + } + $returnValue = $initParsedValue; + break; + } + case 'select': + { + if($valueType == $nOctStr){ + if($initBitValue != ''){ + $selectValue = BinDec($initBitValue); + }else{ + $selectValue = HexDec($initByteValue); + } + }else{ + $selectValue=$initByteValue; + } + $isSelected = 0; + for($j=1;$j$defArr[1]"; + } + } + + if($isSelected ==0 && $j == sizeof($valueArr)){ + $selectShow = "Undefined Value"; + } + $returnValue = $selectShow; + break; + } + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + if(strlen($returnValue)==0) $returnValue='--'; + return $returnValue; +}//end getParamValue + +function setParamValue($unitValue,$sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='',$inputValueType) +{ + global $language; + $Debug=0; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $sysConfTable = 'OMC_PUB.sysConf'; + $pubDb ='OMC_PUB'; + $paramConfTable = $objDb.".paramConf"; + + $maxLevelNum = 10; + $nInteger = 2; + $nOctStr = 4; + + + + if($Debug) echo "===================
      unitValue:$unitValue
      "; + //---------------------- + //选择语言版本 + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + + $paramSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $getValue = $v_Row[0]; + if($Debug) echo "
      getValue = $getValue"; + + + //explode by '[remark]' + $remarkArr = explode('[remark]',$setTemplate); + $remark = $remarkArr[1]; + //explode by '[unit]' + $unitArr = explode('[unit]',$remarkArr[0]); + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$order]); + + //Unit Name + if($Debug) echo "
      $tlvArr[0] : $tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + //$operType = chop($valueArr[0]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($Debug) echo "
      operType = $operType"; + if($operType == 'select') + { //select + if($valueType == $nOctStr) + $changeTypeStr = 'toDec-high-0'; + else + $changeTypeStr = 'keepDec-high-0'; + } + else + { + $changeTypeStr = $valueArr[1]; + } + $changeTypeArr = explode('-',$changeTypeStr); + $changeType = $changeTypeArr[0]; + $fillWay = $changeTypeArr[1]; + $fillChar = $changeTypeArr[2]; + + $setUnitValue = ''; + if($Debug)echo "
      changeType:$changeType"; + switch($changeType) + { + case 'toDec': + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $endBit - $bgnBit +1; + $bitValue = DecBin($unitValue); + if($Debug) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($Debug) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $setUnitValue = $bitValue; + } + else + { + $setUnitValue = DecHex($unitValue); + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + if($Debug) echo "
      omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar)"; + } + if($Debug) echo "
      setUnitValue = $setUnitValue"; + break; + case 'keepHex': + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $endBit - $bgnBit +1; + $bitValue = ($unitValue); + if($Debug) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($Debug) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $setUnitValue = $bitValue; + } + else + { + $setUnitValue = ($unitValue); + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + if($Debug) echo "
      omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar)"; + } + if($Debug) echo "
      setUnitValue = $setUnitValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $setUnitValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $setUnitValue .= DecHex($decValue); + if(strlen($setUnitValue) < 2){ + $setUnitValue = '0'.$setUnitValue; + } + } + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + } + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($Debug) echo "
      setUnitValue = $setUnitValue "; + //--><-//$lastValue = $setUnitValue.$lastValue; + + $setValue = setBitValue($getValue,$tlvArr[1],$setUnitValue); + + $setValue = strtoupper($setValue); + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo'"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); +}//end setParamValue + +//0: flag +echo $flag; +echo "###"; + +if($flag=='getVar')//用户点击的是参数 +{ + //1: idName + echo $newId; + echo "###"; + + //2: innerStr + $oldValue=getInnerValue($sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$showStr,$inputValueType); + if(strlen($doingOtherUlr)>0) + { + $doingOtherUlr .= "&oldValue=$oldValue"; + $doingOtherUlr=urlencode($doingOtherUlr); + } + echo "   SAVE "; +} + +if($flag=='saveVar')//用户点击的是右边的‘Save’ +{ + + //1: idName + echo $id; + echo "###"; + + //2: innerStr + setParamValue($setValue,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$inputValueType); + $newValue = getParamValue($titleStr,$IniEquRead,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr,$inputValueType); + if(strlen($showStr)) + echo $showStr; + else + echo $newValue; + echo "###"; + + //3: isEqual + if($IniEquRead||strlen($showStr)) //initValue == readValue + echo "1"; + else + echo "0"; + echo "###"; + + //4: doingOtherUlr + if(strlen($doingOtherUlr)>0) + { + $doingOtherUlr .= "&newValue=$newValue"; + } + echo $doingOtherUlr; +} +?> + + diff --git a/wxc2_omc/element/sub_inc/lib.inc b/wxc2_omc/element/sub_inc/lib.inc new file mode 100755 index 0000000..f9c4591 --- /dev/null +++ b/wxc2_omc/element/sub_inc/lib.inc @@ -0,0 +1,822 @@ +levelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + +function getSubSyss($num) +{ + $i=0; + do + { + $arr[$i++] = $num % 2; + }while($num = floor($num/2)); + for($j=$i; $j<4; $j++) + $arr[$j] = 0; + + return $arr; +} + +//******************************************************************************************* +//函 数 名: oidSysCommSend($sysId,$commType,$objIdStr,$selectedSysId=-1,$instanceNo='') +//功能说明: 系统参数维护发送命令,与~www/wxc2_omc/inc/lib.inc sysCommSend()的区别是:此函数可以 +// 同时操作同一个系统不同的oid) +//变量说明: 略 +//返 回 值: +// 成功: 命令编号字符串 +// 失败: -1 + +//作者:崔体存 2006-01-10 +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function oidSysCommSend($sysId,$commType,$objIdStr,$selectedSysId=-1,$instanceNo='') +{ + + //global $pubDb,$commTable; + global $STR_CONF_COMMAND_ERR_0000; + global $STR_CONF_PROMPT_001,$STR_CONF_COMMAND_ERR_0011,$STR_CONF_COMMAND_ERR_0012; + global $STR_CONF_PROMPT_002,$STR_CONF_COMMAND_ERR_0021,$STR_CONF_COMMAND_ERR_0022; + global $STR_CONF_PROMPT_003,$STR_CONF_COMMAND_ERR_0031,$STR_CONF_COMMAND_ERR_0032,$STR_CONF_COMMAND_ERR_0033; + global $STR_CONF_PROMPT_004,$STR_CONF_COMMAND_ERR_0041,$STR_CONF_COMMAND_ERR_0042,$STR_CONF_COMMAND_ERR_0043; + global $STR_CONF_COMMAND_ERR_9999; + + + + + //=========insert the operation log into sysOperLog table==================== + + + //===get the operate type set or get== + $logStr=""; + if($commType==0) + $logStr.="Get "; + else if($commType==3) + $logStr.="Set "; + //===get the sysTypeNo===== + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + //=====get the LevelWhere + $temp=getLevelWhere($objIdStr); + + + $database="OBJ_".$sysTypeNo; + $ssql="select name_2 from paramConf where $temp "; + $resultt=@mysqli_query($pubConn,$ssql); + $rowss=@mysqli_fetch_array($resultt); + //==get the parameter name + $p_name=$rowss[name_2]; + + + $logStr.=$p_name; + + insertLog($logStr); + + + + $DEBUG = 0; + $pubDb = 'OMC_PUB'; + $commTable = 'parameterComm'; + $nGetComm = 0; + $nSetComm = 3; + + $nSubSysParam = 0; + $nGlobalSubSysParam = 1; + $nGlobalSysParam = 2; + + + + if(0) echo "
      oidSysCommSend($sysId,$commType,$objIdStr,$selectedSysId)"; + + if($sysNo == '99'){ + $paramType = $nGlobalSysParam; + }else if($subSysNo == '99'){ + $paramType = $nGlobalSubSysParam; + }else{ + $paramType = $nSubSysParam; + } + + if($selectedSysId != -1){ + $selectedSysIdArr = explode('_',$selectedSysId); + $selectedSysTypeNo = $selectedSysIdArr[0]; + $selectedSysNo = $selectedSysIdArr[1]; + $selectedSubSysNo = $selectedSysIdArr[2]; + } + if($DEBUG) echo"
      selectedSysId=$selectedSysId"; + if($DEBUG) echo"
      selectedSysNo=$selectedSysNo"; + if($DEBUG) echo"
      selectedSubSysNo=$selectedSubSysNo"; + + /* + $objIdStrArr=explode(".",$objIdStr); + + $oidQueryWhere=" AND ("; + for($i=0;$ioidQueryWhere=$oidQueryWhere"; + exit(); + } + */ + + //step 1: delete overtime and imcompetent command , check the exist command num + $overTime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-1,date("s"),date("m"),date("d"),date("Y"))); + $delSql = "DELETE FROM $commTable WHERE (commState ='0' OR commState ='3') AND sendTime < '$overTime' + "; + if($DEBUG) echo"
      delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $overTime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-30,date("s"),date("m"),date("d"),date("Y"))); + $delSql = "DELETE FROM $commTable WHERE sendTime < '$overTime' + "; + if($DEBUG) echo"
      delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + //check the exist command num + $chkSql = "SELECT commId FROM $commTable"; + if($DEBUG) echo"
      check exist commands sql = $chkSql"; + $chkResult = mysqli_query($pubConn,$chkSql); + echo mysqli_error($pubConn); + $existNum = @mysqli_num_rows($chkResult); + + /* + //step 2: check the command(不能同时操作同一个系统的相同的oid) + if($paramType == $nGlobalSysParam) { + if($selectedSysId == -1){ + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' $oidQueryWhere + "; + }else{ + //选择指定子系统 + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$selectedSysTypeNo' $oidQueryWhere + "; + } + }else if($paramType == $nGlobalSubSysParam) { + if($selectedSysId == -1){ + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' $oidQueryWhere + "; + }else{ + //选择指定子系统 + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$selectedSysTypeNo' + AND sysNo='$selectedSysNo' $oidQueryWhere + "; + } + }else{ + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' $oidQueryWhere + "; + } + if($DEBUG)echo"
      check command sql = $chkSql"; + //exit(); + + $chkResult = mysqli_query($pubConn,$chkSql); + echo mysqli_error($pubConn); + //exit(); + $rowsNum = @mysqli_num_rows($chkResult); + //echo "
      rowsNum=$rowsNum"; + if($rowsNum > 0){ + echo ""; + return(-1); + } + */ + + //step 3:insert commands into command table + if(($paramType != $nSubSysParam) && ($commType == $nSetComm))//写公共参数 + { + if($selectedSysId == -1) + { + if($paramType == $nGlobalSysParam) + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + else + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + } + else//选择指定子系统 + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$selectedSysTypeNo' + AND sysNo ='$selectedSysNo' + AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC + "; + } + if($DEBUG) + { + echo"
      selSql=$selSql"; + exit(); + } + $selResult = mysqli_query($pubConn,$selSql); + $selRowsNum = mysqli_num_rows($selResult); + + if($selRowsNum+$existNum>256) + { + echo "

      Error:$STR_CONF_COMMAND_ERR_0032
      "; + echo "Prompt1:$STR_CONF_PROMPT_003
      "; + echo "

      Back"; + exit(); + } + + //echo "paramType=$paramType"; + //exit(); + + if($selRowsNum > 0) + { + while($selRows = mysqli_fetch_array($selResult)) + { + $sysNo = $selRows[sysNo]; + if(($paramType==$nGlobalSysParam) + &&($sysTypeNo == '222' || $sysTypeNo == '223') + &&('8' == $sysNo ||'11'==$sysNo))//MTP3,SCCP + continue; + //add by oven 2006-8-22 19:23 + if(($paramType==$nGlobalSysParam)&& + ($sysTypeNo == '225'&&'9' != $sysNo)) + continue; + //end add by oven + $subSysNo = $selRows[subSysNo]; + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','$instanceNo','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + } + else + { + echo "

      Error:$STR_CONF_COMMAND_ERR_0011
      "; + echo "Prompt:$STR_CONF_PROMPT_001
      "; + echo "

      Back"; + exit(); + } + } + else//读系统/子系统参数或写子系统参数 + { + if($paramType != $nSubSysParam)//读公共参数 + { + if($selectedSysId == -1) + { + //get baseStat 0=uninstalled, 1=nomal, 2=warning, 3=error + //先按状态排序,再按系统编号,子系统编号排序,同种状态优先选择编号小的 + if($paramType == $nGlobalSysParam) + { + if($sysTypeNo[0]=='2')//Platform + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + ORDER BY baseStat DESC,sysNo DESC,subSysNo,updateTime DESC + "; + } + else + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + } + else + { + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$sysNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + } + else + { + //选择指定子系统 + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$selectedSysNo' AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC,updateTime DESC + "; + } + + $selResult=mysqli_query($pubConn,$selSql); + if($DEBUG) + { + echo"
      get system info sql = $selSql"; + } + echo mysqli_error($pubConn); + if(@mysqli_num_rows($selResult) > 0) + { + $selRows = @mysqli_fetch_array($selResult); + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + } + else + { + echo "

      Error:$STR_CONF_COMMAND_ERR_0011
      "; + echo "Prompt:$STR_CONF_PROMPT_001
      "; + echo "

      Back"; + exit(); + } + } + + if(1+$existNum>256) + { + echo "

      Error:$STR_CONF_COMMAND_ERR_0032
      "; + echo "Prompt2:$STR_CONF_PROMPT_003
      "; + echo "

      Back"; + exit(); + } + + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','$instanceNo','1',CURRENT_TIMESTAMP) + "; + if($DEBUGs) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + + //step 4:Return commIdStr + if($DEBUG) echo"
      if(($paramType != $nSubSysParam) && ($commType == $nSetComm))"; + if(($paramType != $nSubSysParam) && ($commType == $nSetComm)) + { + if($instanceNo=='') + { + if($paramType == $nGlobalSysParam) + { + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' AND objId='$objIdStr' + ORDER BY sysTypeNo,sysNo,subSysNo"; + } + else + { + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND objId='$objIdStr' + ORDER BY sysTypeNo,sysNo,subSysNo"; + } + } + else + { + if($paramType == $nGlobalSysParam) + { + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' AND objId='$objIdStr' AND instanceNo='$instanceNo' + ORDER BY sysTypeNo,sysNo,subSysNo,instanceNo"; + } + else + { + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND objId='$objIdStr' AND instanceNo='$instanceNo' + ORDER BY sysTypeNo,sysNo,subSysNo,instanceNo"; + } + } + } + else + { + if($instanceNo=='') + { + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' AND objId='$objIdStr'" + ; + } + else + { + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' AND objId='$objIdStr' AND instanceNo='$instanceNo'" + ; + } + + } + if($DEBUG) echo"
      get command id sql = $selSql"; + $selResult=mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $commIdStr=''; + while($selRows = mysqli_fetch_array($selResult)) + { + $commIdStr .= $selRows[commId].'-'; + } + if($DEBUG) echo "
      commIdStr = $commIdStr"; + if($DEBUG) exit(); + return($commIdStr); +}//end of function oidSysSendComm() + +function ChComm($sysId,$chkType) +{ + global $omc_db; + global $remark,$nProcFail,$nWaitProc,$nInProc,$nOutProc; + + $commTable = "parameterComm"; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + if($chkType==0) + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' "; + else + $selComm = " SELECT commState,remark FROM $commTable WHERE sysTypeNo = '$sysTypeNo' AND sysNo = '$sysNo' "; + if($DEBUG)echo "
      selComm=$selComm"; + + $selRes = @mysqli_query($pubConn,$selComm); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + $outProcCount=0; + do + { + $temCommState = $selRow[commState]; + if(isset($selRow[remark])){ + $remark = $selRow[remark]; + if($DEBUG)echo "
      remark=$remark"; + } + if($DEBUG)echo "
      temCommState=$temCommState"; + if($temCommState == $nWaitProc){ + return($nWaitProc); + }elseif($temCommState == $nInProc){ + return($nInProc); + }elseif($temCommState == $nOutProc){ + $commState = $nOutProc; + $outProcCount++; + }else{ + $commState = $nProcFail; + } + }while($selRow = @mysqli_fetch_array($selRes)); + if($outProcCount > 0){ + return($nOutProc); + }else{ + return($nProcFail); + } +} + +//**************************************************************** +//函 数 名: function checkSaveFunction($saveHref) +//功能说明: 在打开一个编辑参数页面后,按"back"按钮,判断参数是否修改,如果修改,提醒操作者进行保存操作 +//变量说明: $saveHref=$backHref+"OBJ:"+"$sysTypeNo&$oidStr&$instanceNo&$newValue"+ +// "OBJ:"+"$sysTypeNo&$oidStr&$instanceNo&$newValue"+ +// "OBJ:"+"$sysTypeNo&$oidStr&$instanceNo&$newValue"+ +// .................................................. +// "OBJ:"+"$sysTypeNo&$oidStr&$instanceNo&$newValue" +//返 回 值: +// +//作者:崔体存 2005-12-19 +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function checkSaveFunction($saveHref) +{ + $tmpSaveHref=$saveHref; + //echo "
      saveHref=$saveHref"; + $varAttributeArr=explode("OBJ:",$tmpSaveHref); + + for($i=1;$ivar=$varAttributeArr[$i]"; + //continue; + $unitVarAttributeArr=explode("&",($varAttributeArr[$i])); + + $tmpSysIdArr = explode("_",$unitVarAttributeArr[0]); + $tmpSysTypeNo = $tmpSysIdArr[0]; + $tmpSysNo = $tmpSysIdArr[1]; + $tmpSubSysNo = $tmpSysIdArr[2]; + + $tmpObjDb = 'OBJ_'.$tmpSysTypeNo; + //echo "
      tmpObjDb=$tmpObjDb"; + $tmpParamTable = 'param_'.$tmpSysNo; + $tmpObjWhereStr = getLevelWhere($unitVarAttributeArr[1]); + $tmpGetsql = "select initValue from $tmpParamTable + where $tmpObjWhereStr AND instanceNo='$unitVarAttributeArr[2]'"; + //echo "
      $tmpGetsql
      "; + + $tmpResult = mysqli_query($pubConn,$tmpGetsql); + $tmpRow = mysqli_fetch_array($tmpResult); + $tmpInitValue=$tmpRow[initValue]; + //echo "
      tmpInitValue=$tmpInitValue"; + //echo "
      inputValue=$unitVarAttributeArr[3]"; + + if($tmpInitValue!=$unitVarAttributeArr[3]){ + ?> + + + + if($i==sizeof($varAttributeArr)) + + "; + $Result_2 = mysqli_query($pubConn,$paramSql_2); + $Row_2 = mysqli_fetch_array($Result_2); + $prefixflag=bindec(getBitValue($Row_2[initValue],'10.7-10.7')); + $call_type =bindec(getBitValue($Row_2[initValue],'10.4-10.6')); + if($prefixflag==1&&$call_type==$callType) + { + + $paramSql_3 = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr_3 AND instanceNo ='$Row_2[instanceNo]'"; + + $Result_3 = mysqli_query($pubConn,$paramSql_3); + $Row_3 = mysqli_fetch_array($Result_3); + $prefixTG = hexdec($Row_3[initValue]); + if($prefixTG==$trunkgp) + { + $prefixIns=$Row_2[instanceNo]; + $findflag=1; + break; + } + } + } + + return $findflag; +} +function setPrefix($prefix,$callType,$trunkgp,$setInstanceNo) +{ + $msc_objDb = 'OBJ_322'; + $msc_paramTable = 'param_99'; + $setPrefix = omc_keep_length($prefix,'E',16,0); + $objstrset='2.1.1'; + $objWhereStr =getLevelWhere($objstrset); + $updSql = "UPDATE $msc_paramTable SET initValue = '$setPrefix' WHERE $objWhereStr AND instanceNo = '$setInstanceNo'"; + if($DEBUG) echo "updSql=$updSql
      "; + mysqli_query($pubConn,$updSql); + + $objstrset='2.1.2'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result_def = mysqli_query($pubConn,$paramSql); + $Row_def = mysqli_fetch_array($Result_def); + $CT = omc_keep_length(decbin($callType),0,3); + if($prefix=='BB') + $tonIN=$tonOut = 2;//unkown + else + $tonIN=$tonOut = 4;//idd + $setTonIn = omc_keep_length(decbin($tonIN),0,4); + $setTonOut = omc_keep_length(decbin($tonOut),0,4); + $Row_def[initValue] = setBitValue($Row_def[initValue],'0.0-0.3',$setTonIn);//ton in = IDD:4 + $Row_def[initValue] = setBitValue($Row_def[initValue],'0.4-0.7',$setTonOut);//TON OUT= IDD:4 + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.7-10.7','1');//flag on + $Row_def[initValue] = setBitValue($Row_def[initValue],'18.0-18.0','1');//VoicePromptFlag=on + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.4-10.6',$CT);//call type + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.2-10.3','00');//trunk + $Row_def[initValue] = setBitValue($Row_def[initValue],'11.0-11.7','00');//length=0 + + $setValue = strtoupper($Row_def[initValue]); + $updSql = "UPDATE $msc_paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo = '$setInstanceNo'"; + if($DEBUG) echo "updSql=$updSql
      "; + mysqli_query($pubConn,$updSql); + + $objstrset='2.1.3'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND instanceNo ='$setInstanceNo'"; + + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + $HEXtrunkgp = omc_keep_length(dechex($trunkgp),0,2); + $Row[initValue] = strtoupper($HEXtrunkgp); + $updSql = "UPDATE $msc_paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$setInstanceNo'"; + mysqli_query($pubConn,$updSql); +} +function delPrefix($inst) +{ + global $pubDb,$DEBUG; + $tmpParamConfTable='OBJ_322.paramConf'; + $tmpObjIdStr='2.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue,level_3 FROM $tmpParamConfTable + WHERE $levelWhere AND (level_3='1' OR level_3='2' OR level_3='3') ORDER BY level_3 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $delPreResult =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $i=0; + while($rows=mysqli_fetch_array($delPreResult)) + { + $tmpDefaultValueArr[$i][initValue]=$rows[initValue]; + $tmpDefaultValueArr[$i][level_3]=$rows[level_3]; + $i++; + } + + for($i=0;$iupdateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + } +} +function updatePrefix($oldPrefix,$newPrefix,$callType,$trunkgp) +{ + $msc_objDb = 'OBJ_322'; + $msc_paramTable = 'param_99'; + + $oldPreIns = $newPreIns = -1; + $oldExist = $newExist = 0; + $oldExist = isPrefixExsit($oldPrefix,$callType,$trunkgp,$oldPreIns); + $newExist = isPrefixExsit($newPrefix,$callType,$trunkgp,$newPreIns); + if($oldExist==1) + { + if(strcmp($oldPrefix,$newPrefix)==0) + return; + if($newExist==1 || strlen($newPrefix)==0) + { + delPrefix($oldPreIns); + return; + } + $findflag = 1; + $setInstanceNo = $oldPreIns; + //delPrefix($setInstanceNo); + } + else + { + if($newExist==1 || strlen($newPrefix)==0) + return; + $objstrset_2='2.1.2'; + $objWhereStr_2 =getLevelWhere($objstrset_2); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable WHERE $objWhereStr_2 "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result_2 = mysqli_query($pubConn,$paramSql); + while($Row_2 = mysqli_fetch_array($Result_2)) + { + $prefixflag=bindec(getBitValue($Row_2[initValue],'10.7-10.7')); + if($prefixflag==0) + { + $setInstanceNo = $Row_2[instanceNo]; + $findflag=1; + break; + } + } + } + if($findflag==1) + setPrefix($newPrefix,$callType,$trunkgp,$setInstanceNo); + + return $setInstanceNo; + //exit; +}//end updatePrefix + +function checkDupPrefix($instNo,$setPrefix,$setTonIn,$setTonOut) +{ + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + {//get all valid prefix No + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr ORDER BY instanceNo"; + //echo $defSql; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $offset_ton_in = "0.0-0.3"; + $offset_ton_out="0.4-0.7"; + $prefix_num=0; + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=hexdec(getBitValue($row[initValue],$offset_enable)); + if($prefix_enable)//enable + { + $validPrefix[$prefix_num][inst_no]=$row[instanceNo]; + $validPrefix[$prefix_num][init_value]=$row[initValue]; + $validPrefix[$prefix_num][ton_in]=BinDec(getBitValue($row[initValue],$offset_ton_in)); + $validPrefix[$prefix_num][ton_out]=BinDec(getBitValue($row[initValue],$offset_ton_out)); + $prefix_num++; + } + } + }//end get valid prefix No + + {//get prefix value + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr ORDER BY instanceNo"; + // echo "$paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$validPrefix[$prefix_no][inst_no]) + { + $tempprefix=strtoupper($Row_1[initValue]); + $prefix = explode('E',$tempprefix); + if($prefix[0] =="") + $prefix[0]="--"; + $validPrefix[$prefix_no][prefix]=$prefix[0]; + //echo "
      asas->".$validPrefix[$prefix_no][prefix]; + $prefix_no++; + } + if($prefix_no >= $prefix_num) + break; + } + }//end get prefix value + //exit; + + for($i=0; $i< $prefix_num; $i++) + { + //echo "
      ".$validPrefix[$i][inst_no].":".$validPrefix[$i][prefix].":".$validPrefix[$i][ton_in].":".$validPrefix[$i][ton_out]; + if($instNo==$validPrefix[$i][inst_no]) + continue; + if(strcmp($setPrefix,$validPrefix[$i][prefix])==0 + &&($setTonIn==$validPrefix[$i][ton_in]) + /*&&($setTonOut==$validPrefix[$i][ton_out])*/) + { + echo ""; + exit(); + } + } +}//end checkDupPrefix +?> diff --git a/wxc2_omc/element/sub_inc/operwebfunc.inc b/wxc2_omc/element/sub_inc/operwebfunc.inc new file mode 100755 index 0000000..248cef1 --- /dev/null +++ b/wxc2_omc/element/sub_inc/operwebfunc.inc @@ -0,0 +1,561 @@ + + +init:$initByteValue
      read:$readByteValue"; + $readBitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8;//1 byte = 8 bit + $readBitValue = DecBin(HexDec($readByteValue)); + $readBitValue = omcStrFill($readBitValue,$bitLen,'high','0'); + $readBitValue = strrev($readBitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      readBitValue = substr($readBitValue,$bgnBit,$catBitLen)"; + $readBitValue = substr($readBitValue,$bgnBit,$catBitLen); + $readBitValue = strrev($readBitValue); + if($DEBUG) echo "
      readBitValue = $readBitValue"; + } + $initBitValue = ''; + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8;//1 byte = 8 bit + $initBitValue = DecBin(HexDec($initByteValue)); + $initBitValue = omcStrFill($initBitValue,$bitLen,'high','0'); + $initBitValue = strrev($initBitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      initBitValue = substr($initBitValue,$bgnBit,$catBitLen)"; + $initBitValue = substr($initBitValue,$bgnBit,$catBitLen); + $initBitValue = strrev($initBitValue); + if($DEBUG) echo "
      initBitValue = $initBitValue"; + } + $IniEquRead = false; + if(strlen($initBitValue)>0) + { + if($initBitValue==$readBitValue) + $IniEquRead = true; + } + else + { + if($initByteValue == $readByteValue) + $IniEquRead = true; + } + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + switch($operType) + { + case 'input': + { + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]) + { + case 'toDec': + if(strlen($initBitValue) > 0){ + $initParsedValue = BinDec($initBitValue); + }else{ + $initParsedValue = HexDec($initByteValue); + } + break; + case 'keepDec': + $initParsedValue = $initByteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $initParsedValue = $initByteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7) + { + echo "
      Error:toAscii"; + exit(1); + } + else + { + $tmpLen=strlen($initByteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++) + { + $unitByte = substr($initByteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $charValue = trim($charValue); + $initParsedValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      initParsedValue = $initParsedValue"; + switch($defArr[1]) + { + case 'high': + switch($defArr[2]) + { + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$initParsedValue = str_replace('0','',$initParsedValue); + }else{ + $initParsedValue = $initParsedValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) + { + switch($defArr[2]){ + case '0': + $initParsedValue = str_replace('00','',$initParsedValue); + break; + case 'E': + $initParsedValue = str_replace('E','',$initParsedValue); + break; + case 'F': //modify zane 20051004 + $initParsedValue = str_replace('F','',$initParsedValue); + break; + default: break; + } + } + break; + default: break; + } + $returnValue = $initParsedValue; + break; + } + case 'select': + { + if($valueType == $nOctStr){ + if($initBitValue != ''){ + $selectValue = BinDec($initBitValue); + }else{ + $selectValue = HexDec($initByteValue); + } + }else{ + $selectValue=$initByteValue; + } + $isSelected = 0; + for($j=1;$j$defArr[1]"; + } + } + + if($isSelected ==0 && $j == sizeof($valueArr)){ + $selectShow = "Undefined Value"; + } + $returnValue = $selectShow; + break; + } + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + if(strlen($returnValue)==0) $returnValue='--'; + return $returnValue; +}//end getParamValue + +function setParamValue($unitValue,$sysId,$oidStr,$order,$instanceNo=0,$otherWhereStr='') +{ + global $language; + $DEBUG=0; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $sysConfTable = 'OMC_PUB.sysConf'; + $pubDb ='OMC_PUB'; + $paramConfTable = $objDb.".paramConf"; + + $maxLevelNum = 10; + $nInteger = 2; + $nOctStr = 4; + + if($DEBUG) echo "===================
      unitValue:$unitValue
      "; + //---------------------- + //选择语言版本 + if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 + }else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) + } + + + $objWhereStr = getLevelWhere($oidStr); + + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + + $paramSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo' "; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $getValue = $v_Row[0]; + if($DEBUG) echo "
      getValue = $getValue"; + + + //explode by '[remark]' + $remarkArr = explode('[remark]',$setTemplate); + $remark = $remarkArr[1]; + //explode by '[unit]' + $unitArr = explode('[unit]',$remarkArr[0]); + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$order]); + + //Unit Name + if($DEBUG) echo "
      $tlvArr[0] : $tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + //$operType = chop($valueArr[0]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + if($operType == 'select') + { //select + if($valueType == $nOctStr) + $changeTypeStr = 'toDec-high-0'; + else + $changeTypeStr = 'keepDec-high-0'; + } + else + { + $changeTypeStr = $valueArr[1]; + } + $changeTypeArr = explode('-',$changeTypeStr); + $changeType = $changeTypeArr[0]; + $fillWay = $changeTypeArr[1]; + $fillChar = $changeTypeArr[2]; + + $setUnitValue = ''; + if($DEBUG)echo "
      changeType:$changeType"; + switch($changeType) + { + case 'toDec': + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $endBit - $bgnBit +1; + $bitValue = DecBin($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $setUnitValue = $bitValue; + } + else + { + $setUnitValue = DecHex($unitValue); + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      setUnitValue = $setUnitValue"; + break; + case 'keepHex': + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $endBit - $bgnBit +1; + $bitValue = ($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $setUnitValue = $bitValue; + } + else + { + $setUnitValue = ($unitValue); + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      setUnitValue = $setUnitValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $setUnitValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $setUnitValue .= DecHex($decValue); + if(strlen($setUnitValue) < 2){ + $setUnitValue = '0'.$setUnitValue; + } + } + $strLen = $byteLen*2; + $setUnitValue = omcStrFill($setUnitValue,$strLen,$fillWay,$fillChar); + } + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      setUnitValue = $setUnitValue "; + //--><-//$lastValue = $setUnitValue.$lastValue; + + $setValue = setBitValue($getValue,$tlvArr[1],$setUnitValue); + + $setValue = strtoupper($setValue); + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr $otherWhereStr AND instanceNo = '$instanceNo'"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); +}//end setParamValue + +function showParameter($sysId,$oidStr,$order,$inputValueType,$instanceNo=0,$doingOtherUlr='',$otherWhereStr='',$showStr='') +{ + global $language,$notSettedColor,$settedColor; + $tmp1 = str_replace('.','_',$oidStr); + $id = 'ID_' . $sysId . '_' . $tmp1 . '_' . $order . '_ist' . $instanceNo; + $newId = "New".$id; + $showValue = getParamValue($titleStr,$IniEquRead,$sysId,$oidStr,$order,$instanceNo,$otherWhereStr); + if($IniEquRead)$color = $settedColor; + else $color = $notSettedColor; + $doingOtherUlr=urlencode($doingOtherUlr); + if(strlen($showStr)) + { + $color = $settedColor; + $showValue = $showStr; + } + //$otherWhereStr=urlencode($otherWhereStr); + echo "$showValue"; + echo ""; +} + +?> + + diff --git a/wxc2_omc/element/sub_inc/saveParameters.php b/wxc2_omc/element/sub_inc/saveParameters.php new file mode 100755 index 0000000..87e2b01 --- /dev/null +++ b/wxc2_omc/element/sub_inc/saveParameters.php @@ -0,0 +1,57 @@ +var=$varAttributeArr[$i]"; + $unitVarAttributeArr=explode("&",($varAttributeArr[$i])); + + $tmpSysIdArr = explode("_",$unitVarAttributeArr[0]); + $tmpSysTypeNo = $tmpSysIdArr[0]; + $tmpSysNo = $tmpSysIdArr[1]; + $tmpSubSysNo = $tmpSysIdArr[2]; + + $tmpObjDb = 'OBJ_'.$tmpSysTypeNo; + //echo "
      tmpObjDb=$tmpObjDb"; + $tmpParamTable = 'param_'.$tmpSysNo; + $tmpObjWhereStr = getLevelWhere($unitVarAttributeArr[1]); + $tmpUpdatesql = "UPDATE $tmpParamTable SET initValue='$unitVarAttributeArr[3]' + where $tmpObjWhereStr AND instanceNo='$unitVarAttributeArr[2]'"; + //echo "
      $tmpUpdatesql
      "; + //echo "tmpObjDb=$tmpObjDb"; + + mysqli_query($pubConn,$tmpUpdatesql); + } +}else + $tmpBackHref=$varAttributeArr[0]; +?> +; + + diff --git a/wxc2_omc/element/sub_inc/sub_config.inc b/wxc2_omc/element/sub_inc/sub_config.inc new file mode 100755 index 0000000..c40c093 --- /dev/null +++ b/wxc2_omc/element/sub_inc/sub_config.inc @@ -0,0 +1,20 @@ +'BSC','no'=>'1'),//system=BSS + array('name'=>'AAS','no'=>'2'),//system=Peripheral + array('name'=>'VSS','no'=>'3'),//system=Peripheral + array('name'=>'PCR','no'=>'4'),//system=Peripheral + array('name'=>'CNF','no'=>'5'),//system=Peripheral + + /*The follow are the remote elements*/ + array('name'=>'remoteElements','no'=>'16')//Switch,MSC,HLR,VLR,SMSC +); + +$showNum_to_unitNum = array(0,6,11,17,22,1,7,12,18,23,2,8,13,19,24,3,9,14,20,25,4,10,15,21,26,5,16,27); +$unitNum_to_showNum = array(0,5,10,15,20,25,1,6,11,16,21,2,7,12,17,22,26,3,8,13,18,23,4,9,14,19,24,27); + + +?> diff --git a/wxc2_omc/element/toElement/AASconf.php b/wxc2_omc/element/toElement/AASconf.php new file mode 100755 index 0000000..f654304 --- /dev/null +++ b/wxc2_omc/element/toElement/AASconf.php @@ -0,0 +1,1636 @@ + + + + + +"; + +{//parameter define + $objDB = "OBJ_311"; + $paramTable = 'param_'.$this_sysNo; + + $sysId = "311_".$this_sysNo."_0"; + $sccp_sysId = "223_11_".$this_sysNo; + $iptrans_sysId = "221_11_".$this_sysNo; + $aasMtp3_sysId = "222_11_".$this_sysNo; + + $ppsOid = '2.1.2.1.'.($this_sysNo+1); + + $oidsysarr0=array( + array('oid'=>'2.1.3', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //Point code + array('oid'=>'2.1.4', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //Country Code + array('oid'=>'2.1.5', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //NDC + array('oid'=>'2.1.8', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //CIC + array('oid'=>'2.1.9', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //Link type + array('oid'=>'2.1.10', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //Encode rule + array('oid'=>'2.3.1', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //VAS prefix + array('oid'=>'2.3.2', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //play times + array('oid'=>'2.3.3', 'sysid'=> $sysId, 'selectsysid'=>'-1'), //voice groups + + array('oid'=>'2.1', 'sysid'=> $iptrans_sysId, 'selectsysid'=>'-1'), //MGIP arwean add 2006-03-02 + ); + $oidsysarr=array( + array('oid'=>'2.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), //获得wxc2 dpc + + array('oid'=>'2.1.147', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), //SCF + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), //srf msisdn + array('oid'=> $ppsOid, 'sysid'=>'360_99_99', 'selectsysid'=>'-1'),//pps + + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), //Prefix assignment + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), //Prefix attributes + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), //Assign TG to prefix + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), //TG attributes + array('oid'=>'2.1.6', 'sysid'=>'322_99_99', 'selectsysid'=>'-1') //Announcement option + ); + + $oidAASarr=array( + array('oid'=>'2.2', 'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), + array('oid'=>'2.3', 'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), //aas dpc + array('oid'=>'2.4.1', 'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), //aas linkset + array('oid'=>'2.6', 'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), //aas route + array('oid'=>'3.1', 'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), //aas link status + + array('oid'=>'2.1.8', 'sysid'=>'223_11_99', 'selectsysid'=> $sccp_sysId), //MSC + array('oid'=>'2.2', 'sysid'=>'223_11_99', 'selectsysid'=> '-1'), //GTT Table pub + array('oid'=>'2.2', 'sysid'=>'223_11_99', 'selectsysid'=> $sccp_sysId) //GTT Table + + ); + + $SaveArr=array( + array('oidstr'=>'3.1', 'setvalue'=>'00' ,'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_11_99', 'selectsysid'=> $sccp_sysId), + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99', 'selectsysid'=>'-1'), +// array('oidstr'=>'3.1', 'setvalue'=>'01' ,'sysid'=> $iptrans_sysId, 'selectsysid'=>'-1'),//arwean add 2006-03-02 + ); + +}//END parameter define + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + //保存改动 + if(isset($CC_save)||isset($setSys)) + { + $tmp = "CC"; + $tmp = ${$tmp}; + $tmp = omc_keep_length($tmp,'F',4,0); + $tmp = strtoupper($tmp); + $oidstr = "2.1.4"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr + "; + + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($CC_save)){ + echo ""; + exit(); + } + } + if(isset($NDC_save)||isset($setSys)) + { + $tmp = "NDC"; + $tmp = ${$tmp}; + $tmp = omc_keep_length($tmp,'F',4,0); + $tmp = strtoupper($tmp); + $oidstr = "2.1.5"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($NDC_save)){ + echo ""; + exit(); + } + } + if(isset($time_save)||isset($setSys)) + { + $tmp = "playtimes"; + $tmp = ${$tmp}; + $tmp = dechex($tmp); + $tmp = omc_keep_length($tmp,'0',2); + $tmp = strtoupper($tmp); + $oidstr = "2.3.2"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($time_save)){ + echo ""; + exit(); + } + } + if(isset($MSISDN_save)||isset($setSys)) + { + {//set param_11 sccp 2.1.8 + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='311' AND sysNo='0' AND subSysNo='0' + "; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + //echo "
      getSysIdRow[ip]:$getSysIdRow[ip]"; + $IP = explode('.',$getSysIdRow[ip]); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $AAS0_ip = $IP[0].$IP[1].$IP[2].$IP[3]; + + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='311' AND sysNo='1' AND subSysNo='0' + "; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + + $IP = explode('.',$getSysIdRow[ip]); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $AAS1_ip = $IP[0].$IP[1].$IP[2].$IP[3]; + + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_11'; + $oidstr = '2.1.8'; + + $objWhereStr = getLevelWhere($oidstr); + $tmp = omc_keep_length($MSISDN,'F',20,0); + $MSISDN_total = setBitValue($MSISDN_total,'01.0-10.7',$tmp); + $tmp = omc_keep_length($NetID,'0',2); + $MSISDN_total = setBitValue($MSISDN_total,'0.0-0.7',$tmp); + $MSISDN_total = setBitValue($MSISDN_total,'11.0-14.7',$AAS0_ip); + $MSISDN_total = setBitValue($MSISDN_total,'15.0-18.7',$AAS1_ip); + + $MSISDN_total = strtoupper($MSISDN_total); + + $updflag = "UPDATE $tmpTable SET initValue = '$MSISDN_total' + WHERE $objWhereStr + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + } + if(isset($MSISDN_save))//set pps SRF MSISDN + { + $sqltable = 'OBJ_360.param_99'; + $oid = '2.1.2.1.'.($this_sysNo+1); + $initValue_0 = omc_keep_length(toHex($MSISDN),'0','32',0); + $objWhereStr = getLevelWhere($oid); + $setsql = "update $sqltable set initValue = '$initValue_0' where $objWhereStr"; + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $setsql
      "; + } + if(isset($MSISDN_save))//set Dailing prefix + { + $msc_objDb = 'OBJ_322'; + $msc_paramTable = 'param_99'; + $AAS_prefix = omc_keep_length($MSISDN_old,'E',16,0); + + $objstrset='2.1.1'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND initValue = '$AAS_prefix' "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $objstrset='2.1.2'; + $objWhereStr =getLevelWhere($objstrset); + $findflag=0; + while($Row = mysqli_fetch_array($Result)) + { + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND instanceNo = '$Row[instanceNo]' "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + $prefixflag=bindec(getBitValue($Row_2[initValue],'10.7-10.7')); + $calltype =bindec(getBitValue($Row_2[initValue],'10.4-10.6')); + if($prefixflag==1&&$calltype==3)//type = vms + { + $Assign_objstrset='2.1.3'; + $Assign_objWhereStr =getLevelWhere($Assign_objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $Assign_objWhereStr AND instanceNo ='$Row_2[instanceNo]' + "; + + $Assign_Result = mysqli_query($pubConn,$paramSql); + $Assign_Row = mysqli_fetch_array($Assign_Result); + $prefixTG = hexdec($Assign_Row[initValue]); + if($prefixTG==$trunkgp) + { + $prefixinstNo=$Row_2[instanceNo]; + $findflag=1; + break; + } + } + } + if($findflag==0) + { + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result_2 = mysqli_query($pubConn,$paramSql); + while($Row_2 = mysqli_fetch_array($Result_2)) + { + $prefixflag=bindec(getBitValue($Row_2[initValue],'10.7-10.7')); + if($prefixflag==0) + { + $findflag=1; + break; + } + } + } + + if($findflag==1) + { + $AAS_prefix = omc_keep_length($MSISDN,'E',16,0); + $objstrset='2.1.1'; + $objWhereStr =getLevelWhere($objstrset); + $updSql = "UPDATE $msc_paramTable SET initValue = '$AAS_prefix' + WHERE $objWhereStr AND instanceNo = '$Row_2[instanceNo]' + "; + if($DEBUG) echo "updSql=$updSql
      "; + mysqli_query($pubConn,$updSql); + + $objstrset='2.1.2'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue FROM paramConf + WHERE $objWhereStr + "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result_def = mysqli_query($pubConn,$paramSql); + $Row_def = mysqli_fetch_array($Result_def); + + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.7-10.7','1');//flag on + $Row_def[initValue] = setBitValue($Row_def[initValue],'18.0-18.0','1');//VoicePromptFlag=on + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.4-10.6','011');//emergency + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.2-10.3','00');//trunk + $Row_def[initValue] = setBitValue($Row_def[initValue],'11.0-11.7','08');//length=8 + + $setValue = strtoupper($Row_def[initValue]); + $updSql = "UPDATE $msc_paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo = '$Row_2[instanceNo]' + "; + if($DEBUG) echo "updSql=$updSql
      "; + mysqli_query($pubConn,$updSql); + + $objstrset='2.1.3'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND instanceNo ='$Row_2[instanceNo]' + "; + + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + + $HEXtrunkgp = omc_keep_length(dechex($trunkgp),0,2); + $Row[initValue] = strtoupper($HEXtrunkgp); + $updSql = "UPDATE $msc_paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$Row_2[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + } + } + if(isset($MSISDN_save))//SCF-- GTT table param_99 + { + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_99'; + $tmpConf = 'paramConf'; + $oidstr = '2.2'; + $objWhereStr = getLevelWhere($oidstr); + $getSql="SELECT instanceNo,initValue FROM $tmpTable WHERE $objWhereStr AND initValue LIKE '01%' "; + if(0) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $haveSeted = 0; + while($rows =mysqli_fetch_array($result)) + { + $tmpStartMSISDN = getBitValue($rows[initValue],'03.0-12.7'); + $tmpStartMSISDN = str_replace('F','',$tmpStartMSISDN); + $tmpDpc = hexdec(getBitValue($rows[initValue],'24.0-26.7')); + $tmpSSN = hexdec(getBitValue($rows[initValue],'27.0-27.7')); + if(strcmp($tmpStartMSISDN,$MSISDN_old)==0 + && $tmpDpc==$DPC + && $tmpSSN == 8) + { + //echo "
      $tmpStartMSISDN
      $MSISDN_old"; + $tmpInstanceNo = $rows[instanceNo]; + $haveSeted = 1; + break; + } + //echo "
      $tmpStartMSISDN
      $MSISDN_old
      "; + } + //exit; + if($haveSeted) + { + $setInstNo = $tmpInstanceNo; + } + else + { + $getSql="SELECT instanceNo,initValue FROM $tmpTable WHERE $objWhereStr AND initValue LIKE '00%' "; + if(0) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + $setInstNo = $rows[instanceNo]; + } + + $rows[initValue] = setBitValue($rows[initValue],'0.0-0.7','01');//flag + $rows[initValue] = setBitValue($rows[initValue],'01.0-01.7','01');//MSISDN + $tmp = omc_keep_length($MSISDN,'F',20,0); + $rows[initValue] = setBitValue($rows[initValue],'03.0-12.7',$tmp);// + $rows[initValue] = setBitValue($rows[initValue],'13.0-22.7',$tmp);// + $tmp = omc_keep_length($NetID,'0',2); + $rows[initValue] = setBitValue($rows[initValue],'23.0-23.7',$tmp);//NI + $tmp = omc_keep_length(dechex($DPC),'0',6); + $rows[initValue] = setBitValue($rows[initValue],'24.0-26.7',$tmp);//DPC WXC2sp + $tmp = omc_keep_length(dechex(8),'0',2); + $rows[initValue] = setBitValue($rows[initValue],'27.0-27.7',$tmp);//SSN=8 + $tmp = omc_keep_length(dechex(7),'0',2); + $rows[initValue] = setBitValue($rows[initValue],'29.0-29.7',$tmp);//Address indicator + $rows[initValue] = strtoupper($rows[initValue]); + //echo "
      rows[initValue]:{$rows[initValue]}"; + $updflag = "UPDATE $tmpTable SET initValue = '$rows[initValue]' + WHERE $objWhereStr and instanceNo='$setInstNo' + "; + if(0) echo "
      $updflag
      "; + //exit; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + } + + if(isset($MSISDN_save)) + { + echo ""; + exit(); + } + + } + //arwean add 2006-03-01 + if(isset($linkType0_save)||isset($setSys)) + { + $tmp = dechex($link0_type); + $tmp = omc_keep_length($tmp,'0',2); + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr and instanceNo='0' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($linkType0_save)){ + echo ""; + exit(); + } + } + + if(isset($linkType1_save)||isset($setSys)) + { + $tmp = dechex($link1_type); + $tmp = omc_keep_length($tmp,'0',2); + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr and instanceNo='1' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($linkType1_save)){ + echo ""; + exit(); + } + } + + if(isset($MG_IP_LK0_save)||isset($setSys)) + { + $setValue=''; + $ipArr=explode(".",$MG_IP_LK0); + for($i=0;$i"; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($MG_IP_LK0_save)){ + echo ""; + exit(); + } + + } + + if(isset($MG_IP_LK1_save)||isset($setSys)) + { + $setValue=''; + $ipArr=explode(".",$MG_IP_LK1); + for($i=0;$i"; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($MG_IP_LK1_save)){ + echo ""; + exit(); + } + + } + + if(isset($encode_rule0_save)||isset($setSys)) + { + $tmp = dechex($encode_rule0); + $tmp = omc_keep_length($tmp,'0',2); + $oidstr = "2.1.10"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr and instanceNo='0' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($encode_rule0_save)){ + echo ""; + exit(); + } + } + + if(isset($encode_rule1_save)||isset($setSys)) + { + $tmp = dechex($encode_rule1); + $tmp = omc_keep_length($tmp,'0',2); + $oidstr = "2.1.10"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr and instanceNo='1' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(isset($encode_rule1_save)){ + echo ""; + exit(); + } + } + + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + SetParam($oidsysarr0); + SetParam($oidsysarr); + SetParam($oidAASarr); + + SaveParam($SaveArr); + + } + else + { + echo "
      Getting parameters
      "; + GetParam($oidsysarr0); + GetParam($oidsysarr); + GetParam($oidAASarr); + } + } +} + +if($setSys || $getSys || $undoSet) +{ + echo "

      Finished!

      "; + if($DEBUG) exit(); + echo ""; + exit(); +} + +{//show help and back + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Configuration > Network > AAS"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + checkDevices(311); + + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Audio Announcement System  $Spname"; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; + echo "
      "; + } +} + + + + +echo ""; + +{// Signaling/Traffic + {//DPC + $DPC_sysId = '222_99_99'; + + $DPC_sysIdArr = explode('_',$DPC_sysId); + $DPC_sysTypeNo = $DPC_sysIdArr[0]; + $DPC_sysNo = $DPC_sysIdArr[1]; + $DPC_subSysNo = $DPC_sysIdArr[2]; + + $DPC_oidstr = '2.4.1'; + $DPC_objWhereStr= ''; + $DPC_objWhereStr =getLevelWhere($DPC_oidstr); + $DPC_objDb = 'OBJ_'.$DPC_sysTypeNo; + $DPC_paramTable = 'param_'.$DPC_sysNo; + + $DPC_paramSql = " SELECT initValue,readValue,instanceNo FROM $DPC_paramTable + WHERE $DPC_objWhereStr AND instanceNo ='$linkset' + "; + if($DEBUG) echo "$DPC_paramSql
      "; + $DPC_Result = mysqli_query($pubConn,$DPC_paramSql); + $DPC_Row = mysqli_fetch_array($DPC_Result); + $DPC= hexdec(getBitValue($DPC_Row[initValue],'0.0-2.7')); + $NetID = bindec(getBitValue($DPC_Row[initValue],'3.0-3.1')); + } + + {//WXC2 OPC + $oidstr = '2.2'; + $link_Db = 'OBJ_222'; + $link_Table = 'param_99'; + + $subSysNo = 99; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $link_Table + WHERE $objWhereStr AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + $NIbit = getBitValue($Row[initValue],"0.$NetID"); + $tmp = $NetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $updSql = "SELECT initValue FROM $link_Table + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + $Result = mysqli_query($pubConn,$updSql); + $Row = mysqli_fetch_array($Result); + $WXC2PC = hexdec($Row[initValue]); + } + + {//CC ***************************** + $oidstr = "2.1.4"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $CC_value = str_replace('F','',$row[0]); + } + {//NDC ************************** + $oidstr = "2.1.5"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $NDC_value = str_replace('F','',$row[0]); + } + {//Linktype ************************** + //Linktype0 + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr order by instanceNo + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $link0_type = hexdec($row[initValue]); + + //Linktype1 + $row = @mysqli_fetch_array($result); + $link1_type = hexdec($row[initValue]); + } + {//MG_IP + //MG_IP_LK0 + $iptrans_objDB="OBJ_221"; + $iptrans_Table="param_11"; + $oidstr = "2.1"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $iptrans_Table + where $objWhereStr and subSysNo='$this_sysNo' order by instanceNo + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $ip[0]=hexdec(getBitValue($row[initValue],"0.0-0.7")); + $ip[1]=hexdec(getBitValue($row[initValue],"1.0-1.7")); + $ip[2]=hexdec(getBitValue($row[initValue],"2.0-2.7")); + $ip[3]=hexdec(getBitValue($row[initValue],"3.0-3.7")); + $MG_IP_LK0 = $ip[0].".".$ip[1].".".$ip[2].".".$ip[3]; + + //MG_IP_LK1 + $row = @mysqli_fetch_array($result); + $ip[0]=hexdec(getBitValue($row[initValue],"0.0-0.7")); + $ip[1]=hexdec(getBitValue($row[initValue],"1.0-1.7")); + $ip[2]=hexdec(getBitValue($row[initValue],"2.0-2.7")); + $ip[3]=hexdec(getBitValue($row[initValue],"3.0-3.7")); + $MG_IP_LK1 = $ip[0].".".$ip[1].".".$ip[2].".".$ip[3]; + } + {//Encode Rule0 + //Encode Rule0 + $oidstr = "2.1.10"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr order by instanceNo + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $encode_rule0 = hexdec($row[initValue]); + + // Encode Rule1 + $row = @mysqli_fetch_array($result); + $encode_rule1 = hexdec($row[initValue]); + } + {//get link status + $db="OMC_PUB"; + $sql = "SELECT detailStat,updateTime FROM sysStat WHERE sysTypeNo='311' AND sysNo='$this_sysNo' AND subSysNo='0'"; + //echo "$sql"; + if($DEBUG)echo "
      sql=$sql"; + $res=mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + //echo mysqli_error($pubConn); + + + $due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); + $ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + + $hex_mes=$row[detailStat]; + $refresh_time=$row[updateTime]; + //echo $heatbeat_overtime; + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + $stt_e0 = 21; //E1 #0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) + $stt_e1 = 22; //E1 #1 status + + //E1#0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) + for($i=0;$i<2;$i++){ + $binSttE0=substr($bin_mes,$stt_e0*8+7-$i,1); + $sttE0[$i]=BinDec($binSttE0); + if($DEBUG)echo "
      sttE0[$i]=$sttE0[$i]"; + } + + if(!$sttE0[0]){ + $sttE0[1] = 2; + } + + //E1#1 status + for($i=0;$i<2;$i++){ + $binSttE1=substr($bin_mes,$stt_e1*8+7-$i,1); + $sttE1[$i]=BinDec($binSttE1); + if($DEBUG)echo "
      sttE1[$i]=$sttE1[$i]"; + } + + if(!$sttE1[0]){ + $sttE1[1] = 2; + } + + } + $aasLink0_status=$sttE0[1]; + $aasLink1_status=$sttE1[1]; + + if($aasLink0_status==1) + $color_aasLink0_stat='blue'; + elseif($aasLink0_status==0) + $color_aasLink0_stat='red'; + if($aasLink1_status==1) + $color_aasLink1_stat='blue'; + elseif($aasLink1_status==0) + $color_aasLink1_stat='red'; + + {//SCCP MSC ---AAS MSISDN + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_11'; + $oidstr = '2.1.8'; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $tmpTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $MSISDN = getBitValue($row[initValue],"01.0-10.7"); + $MSISDN = str_replace('F','',$MSISDN); + echo ""; + echo ""; + } + + {//SCCP SCF --- MSISDN(SCF_num) arwean + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_99'; + $oidstr = '2.1.147'; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $tmpTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $SCF_num = getBitValue($row[initValue],"01.0-10.7"); + $SCF_num = str_replace('F','',$SCF_num); + echo ""; + } + + echo "
      "; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + if($SCF_num ==''){ + echo ""; + }else{ + echo ""; + } + echo ""; + $linkTypeArr=array("E1","T1"); + $linkStaArr=array("N","Y","--"); + $encodeRuleArr=array("A Law","Mu Law"); + {//add by arwean 20060301 + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + {//link0 + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + echo ""; + } + {//link1 + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + } + } +} +echo "
      Signaling/Traffic
      Signaling point code$DPC 
      NetWork indicator$NetIdConfArr[$NetID]"; + echo ""; + echo "
      WXC2 Point Code$WXC2PC"; + echo "
      Network numberCC: "; + if(isset($CC_edit)) + { + echo " "; + echo ""; + } + else + { + echo ""; + if($CC_value =='') + { + $CC_value ='--'; + } + echo "$CC_value"; + } + echo "NDC: "; + if(isset($NDC_edit)) + { + echo " "; + echo ""; + } + else + { + echo ""; + if($NDC_value =='') + { + $NDC_value ='--'; + } + echo "$NDC_value"; + } + echo "MSISDN: "; + if(isset($MSISDN_edit)){ + echo " "; + echo ""; + }else{ + echo ""; + if($MSISDN ==''){ + $MSISDN ='--'; + } + echo "$MSISDN"; + } + echo "
      SCF number--$SCF_num
      Link
      NoLink typeMG IpEncode ruleStatus
      0"; + if(isset($linkType0_edit)) + { + echo ""; + echo ""; + } + else + { + echo ""; + echo "{$linkTypeArr[$link0_type]}"; + } + echo""; + if(isset($MG_IP_LK0_edit)) + { + echo " "; + echo ""; + } + else + { + if($MG_IP_LK0 ==''){ + $MG_IP_LK0 ='--'; + } + echo ""; + echo "$MG_IP_LK0"; + } + echo ""; + if(isset($encode_rule0_edit)) + { + echo ""; + echo ""; + } + else + { + echo ""; + echo "{$encodeRuleArr[$encode_rule0]}"; + } + echo"{$linkStaArr[$aasLink0_status]}
      1"; + if(isset($linkType1_edit)) + { + echo ""; + echo ""; + } + else + { + echo ""; + echo "{$linkTypeArr[$link1_type]}"; + } + echo""; + if(isset($MG_IP_LK1_edit)) + { + echo " "; + echo ""; + } + else + { + if($MG_IP_LK1 ==''){ + $MG_IP_LK1 ='--'; + } + echo ""; + echo "$MG_IP_LK1"; + } + echo ""; + if(isset($encode_rule1_edit)) + { + echo ""; + echo ""; + } + else + { + echo ""; + echo "{$encodeRuleArr[$encode_rule1]}"; + } + echo"{$linkStaArr[$aasLink1_status]}
       "; + +{//AAS announcement + {//repeat count + $oidstr = "2.3.2"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $play_times = hexdec($row[0]); + } + +echo " "; + $languageArr=array("French","English","Chinese","Russian","Spanish"); + $selSql = " SELECT instance,languageNum,showfiled FROM aasAnnounce where name ='AAS' and showfiled !='' order by instance"; + $Result = @mysqli_query($pubConn,$selSql); + $announceNum=@mysqli_num_rows($Result); + + $selSql = " SELECT showfiled FROM aasAnnounce where name ='languageNum'"; + $lan_re = @mysqli_query($pubConn,$selSql); + $lan_row = @mysqli_fetch_array($lan_re); + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +*/ + $rowsNum=$announceNum+2; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($num=0;$num< $announceNum;$num++) + { + echo ""; + echo ""; + $Row = @mysqli_fetch_array($Result); + $fileno = $Row[instance]; + $fileno = omc_keep_length($Row[instance],0,3); + echo ""; + + echo ""; + + echo ""; + echo ""; + } + /* + {//SRF announcement + echo ""; + echo ""; + echo ""; + echo ""; + } + */ +echo "
      AAS announcement"; + echo " (Laguage:"; + echo ")"; + echo "
      Repeatition Counter"; + if(isset($time_edit)) + { + echo " "; + echo ""; + } + else + { + echo ""; + if($play_times =='') + { + $play_times ='--'; + } + echo "$play_times"; + } +/* + echo "
      Voice Group"; + for($i=0; $i<32; $i++) + { + echo "$i "; + echo " "; + } + echo "
      Call unattainable
      announcement
      No.AnnouncementPlayUpdate
      $num$Row[showfiled]"; + $path = "language0".$slctLanguage."/"; + $fullpath =$path.$fileno; + echo "play "; + echo ""; + $path = "language0".$slctLanguage."/"; + $fullpath =$path.$fileno; + echo "upload "; + echo "
      PPS announcement"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Language 0(English)   Language 1(French)   Language 2(--)   Language 3(--)   Language 4(--)   
      "; + echo "
      "; +} +echo "
      "; + echo "Link to AAS"; + echo "
      "; +echo "
      "; +echo "

      "; + +{//update aas param + + if(1) + {//add BB prefix for aas + $tmp = omc_keep_length('BB','F',16,0); + $tmp = strtoupper($tmp); + $oidstr = "2.3.1"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + + //aas0 添加prefix + if($this_sysNo==0) + { + $msc_objDb = 'OBJ_322'; + $msc_paramTable = 'param_99'; + $AAS_prefix = omc_keep_length('BB','E',16,0); + + $objstrset='2.1.1'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND initValue = '$AAS_prefix' "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $objstrset='2.1.2'; + $objWhereStr =getLevelWhere($objstrset); + $findflag=0; + while($Row = mysqli_fetch_array($Result)) + { + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND instanceNo = '$Row[instanceNo]' "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + $prefixflag=bindec(getBitValue($Row_2[initValue],'10.7-10.7')); + $calltype =bindec(getBitValue($Row_2[initValue],'10.4-10.6')); + if($prefixflag==1&&$calltype==1)//type = emergency + { + $Assign_objstrset='2.1.3'; + $Assign_objWhereStr =getLevelWhere($Assign_objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $Assign_objWhereStr AND instanceNo ='$Row_2[instanceNo]' + "; + + $Assign_Result = mysqli_query($pubConn,$paramSql); + $Assign_Row = mysqli_fetch_array($Assign_Result); + $prefixTG = hexdec($Assign_Row[initValue]); + if($prefixTG==$trunkgp) + { + $prefixinstNo=$Row_2[instanceNo]; + $findflag=1; + break; + } + } + } + if($findflag==0) + { + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result_2 = mysqli_query($pubConn,$paramSql); + while($Row_2 = mysqli_fetch_array($Result_2)) + { + $prefixflag=bindec(getBitValue($Row_2[initValue],'10.7-10.7')); + if($prefixflag==0) + { + $findflag=1; + break; + } + } + } + + if($findflag==1) + { + $objstrset='2.1.1'; + $objWhereStr =getLevelWhere($objstrset); + $updSql = "UPDATE $msc_paramTable SET initValue = '$AAS_prefix' + WHERE $objWhereStr AND instanceNo = '$Row_2[instanceNo]' + "; + if($DEBUG) echo "updSql=$updSql
      "; + mysqli_query($pubConn,$updSql); + + $objstrset='2.1.2'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue FROM paramConf + WHERE $objWhereStr + "; + if($DEBUG) echo "paramSql=$paramSql
      "; + $Result_def = mysqli_query($pubConn,$paramSql); + $Row_def = mysqli_fetch_array($Result_def); + + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.7-10.7','1');//flag on + $Row_def[initValue] = setBitValue($Row_def[initValue],'18.0-18.0','1');//VoicePromptFlag=on + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.4-10.6','001');//emergency + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.2-10.3','00');//trunk + $Row_def[initValue] = setBitValue($Row_def[initValue],'11.0-11.7','08');//length=8 + $Row_def[initValue] = setBitValue($Row_def[initValue],'10.0-10.0','0');//cdr=off + + $setValue = strtoupper($Row_def[initValue]); + $updSql = "UPDATE $msc_paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo = '$Row_2[instanceNo]' + "; + if($DEBUG) echo "updSql=$updSql
      "; + mysqli_query($pubConn,$updSql); + + $objstrset='2.1.3'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $msc_paramTable + WHERE $objWhereStr AND instanceNo ='$Row_2[instanceNo]' + "; + + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + + $HEXtrunkgp = omc_keep_length(dechex($trunkgp),0,2); + $Row[initValue] = strtoupper($HEXtrunkgp); + $updSql = "UPDATE $msc_paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$Row_2[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + } + } + } + if(1) + {//修改AAS_mtp3 OPC DPC NI Route (arwean 060223) + $aas_link_Db = 'OBJ_222'; + $pub_link_Table = 'param_99'; + $oidstr = '2.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $pub_link_Table + WHERE $objWhereStr + "; + $aas_Result = mysqli_query($pubConn,$paramSql); + $aas_Row = mysqli_fetch_array($aas_Result); + + $aas_link_Table = 'param_11'; + $updSql = "UPDATE $aas_link_Table SET initValue = '$aas_Row[initValue]' + WHERE $objWhereStr AND instanceNo = '0' + "; + mysqli_query($pubConn,$updSql); + + + $NIoffset = array("0.0-0.0","0.1-0.1","0.2-0.2","0.3-0.3"); + $NI_bit = getBitValue($aas_Row[initValue],$NIoffset[$NetID]); + $tmp = $NetID+1+$NI_bit*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $set_OPC = dechex($DPC); + $set_OPC = omc_keep_length($set_OPC,0,6); + $set_OPC = strtoupper($set_OPC); + $updSql = "UPDATE $aas_link_Table SET initValue = '$set_OPC' + WHERE $objWhereStr + "; + if($DEBUG) echo "$updSql
      "; + mysqli_query($pubConn,$updSql); + + //AAS_11_pub--Linkset0 + $aas_objDB = 'OBJ_222'; + $aas_Table = 'param_11'; + $oidstr = '2.4.1'; + $objWhereStr = getLevelWhere($oidstr); + $getSql="SELECT initValue + FROM $aas_Table + WHERE $objWhereStr AND instanceNo='0' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + + + $tmp = omc_keep_length(dechex($WXC2PC),'0',6); + $rows[initValue] = setBitValue($rows[initValue],'0.0-2.7',$tmp);//DPC + + $tmp = omc_keep_length(decbin($NetID),'0',2); + $rows[initValue] = setBitValue($rows[initValue],'3.0-3.1',$tmp);//NI + + $rows[initValue] = strtoupper($rows[initValue]); + + $updflag = "UPDATE $aas_Table SET initValue = '$rows[initValue]' + WHERE $objWhereStr AND instanceNo='0' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + //AAS_11_pub--route + $aas_objDB = 'OBJ_222'; + $aas_Table = 'param_11'; + $tmp=$NetID+1; + $oidstr = '2.6.'.$tmp; + $objWhereStr = getLevelWhere($oidstr); + $getSql="SELECT initValue + FROM $aas_Table + WHERE $objWhereStr AND instanceNo='0' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + + + $tmp = omc_keep_length(dechex($WXC2PC),'0',6); + $rows[initValue] = setBitValue($rows[initValue],'0.0-2.7',$tmp); + + $rows[initValue] = setBitValue($rows[initValue],'3.0-3.7','00'); + + $rows[initValue] = setBitValue($rows[initValue],'4.0-4.7','00'); + + $rows[initValue] = strtoupper($rows[initValue]); + + $updflag = "UPDATE $aas_Table SET initValue = '$rows[initValue]' + WHERE $objWhereStr AND instanceNo='0' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + } + if(1) + {//set AAS-NI-length-OPC-DPC (arwean 060223) + $oidstr="2.1.3"; + $objWhereStr = getLevelWhere($oidstr); + $selSql = "select initValue from $paramTable where $objWhereStr"; + $Result = mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $Row = mysqli_fetch_array($Result); + + $tmp = omc_keep_length(decbin($NetID),'0',4); + $Row[initValue] = setBitValue($Row[initValue], "0.0-0.3", $tmp);//NI + + $tmp = omc_keep_length(decbin($NIbit),'0',4); + $Row[initValue] = setBitValue($Row[initValue], "0.4-0.7", $tmp);//length + + $tmp = omc_keep_length(dechex($DPC),'0',6); + $Row[initValue] = setBitValue($Row[initValue], "1.0-3.7", $tmp);//OPC + + $tmp = omc_keep_length(dechex($WXC2PC),'0',6);//DPC + $Row[initValue] = setBitValue($Row[initValue], "4.0-6.7", $tmp);//DPC + + $updflag = "UPDATE $paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr + "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + } + if(1) + {//SCF-- GTT table (arwean 060224) + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_11'; + $oidstr = '2.2'; + $objWhereStr = getLevelWhere($oidstr); + $getSql="SELECT initValue + FROM $tmpTable + WHERE $objWhereStr AND instanceNo='0' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + + $rows[initValue] = setBitValue($rows[initValue],'0.0-0.7','01');//flag + $rows[initValue] = setBitValue($rows[initValue],'01.0-01.7','01');//MSISDN + $tmp = omc_keep_length($SCF_num,'F',20,0); + $rows[initValue] = setBitValue($rows[initValue],'03.0-12.7',$tmp);//SCF number + $rows[initValue] = setBitValue($rows[initValue],'13.0-22.7',$tmp);//SCF number + $tmp = omc_keep_length($NetID,'0',2); + $rows[initValue] = setBitValue($rows[initValue],'23.0-23.7',$tmp);//NI + $tmp = omc_keep_length(dechex($WXC2PC),'0',6); + $rows[initValue] = setBitValue($rows[initValue],'24.0-26.7',$tmp);//DPC WXC2sp + $tmp = dechex(147); + $rows[initValue] = setBitValue($rows[initValue],'27.0-27.7',$tmp);//SSN=147 + $rows[initValue] = strtoupper($rows[initValue]); + + $updflag = "UPDATE $tmpTable SET initValue = '$rows[initValue]' + WHERE $objWhereStr AND instanceNo='0' + "; + if($DEBUG) echo "
      $updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + } + if(1) + {//CIC0 =0 (arwean 060224) + $CIC_0 =0; + $tmp = dechex($CIC_0); + $tmp = omc_keep_length($tmp,'0',2); + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr AND instanceNo = '0' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + } + if(1) + {//CIC1 =32 (arwean 060224) + $CIC_1 =32; + $tmp = dechex($CIC_1); + $tmp = omc_keep_length($tmp,'0',2); + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr AND instanceNo = '1' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + } + if(0) + {//Announcement option + $announce_sysId = '322_99_99'; + $announce_sysIdArr = explode('_',$announce_sysId); + $announce_sysTypeNo = $announce_sysIdArr[0]; + $announce_sysNo = $announce_sysIdArr[1]; + $announce_subSysNo = $announce_sysIdArr[2]; + $announce_oidstr = '2.1.6'; + $announce_objWhereStr =getLevelWhere($announce_oidstr); + + $announce_objDb = 'OBJ_'.$announce_sysTypeNo; + $announce_paramTable = 'param_'.$announce_sysNo; + + $announce_paramSql = " SELECT initValue,readValue,instanceNo FROM $announce_paramTable + WHERE $announce_objWhereStr + "; + $Result = mysqli_query($pubConn,$announce_paramSql); + $Row = mysqli_fetch_array($Result); + $tmpInitValue =$tmp."02020202020202020202020202020202"; + $tmpInitValue = strtoupper($tmpInitValue); + $announce_updflag = "UPDATE $announce_paramTable SET initValue = '$tmpInitValue' + WHERE $announce_objWhereStr + "; + if($DEBUG) echo "$announce_updflag
      "; + mysqli_query($pubConn,$announce_updflag); + echo mysqli_error($pubConn); + } +} +?> + +
      + + diff --git a/wxc2_omc/element/toElement/ACNconf.php b/wxc2_omc/element/toElement/ACNconf.php new file mode 100755 index 0000000..38d6f0e --- /dev/null +++ b/wxc2_omc/element/toElement/ACNconf.php @@ -0,0 +1,594 @@ + 0)?$TEST:0; + +//value Type +$nInteger = 2; +$nOctStr = 4; + +$nShowsize = '40%'; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.paramConf'; + return($tableName); +} + + +//$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:0); + +$pubDb ='OMC_PUB'; +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf); +$maxLevelNum = 10; + + +if($DEBUG) echo "
      $paramConfTable
      "; +if($DEBUG) echo "
      aliasName=$aliasName
      "; +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; + $objSetField=setTemplate_2 ; //语种2 +}else{ + $objNameField=name_1; + $objSetField=setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + +//=======================Get value From submit=================== + +if($set == 'Save') +{ + + //sort by offset + for($i=1;$i<=$unitNum;$i++) + { + $tmpDef = ${'unitDef_'.$i}; + $tmpValue = ${'unit_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$i] = $tmpDef; + $tmpDefArr = explode('-',$tmpDef); + $sortArr[$i] = $tmpDefArr[0]; + $valueArr[$i] = $tmpValue; + } + $lastValue = ''; + $k = 0; + asort($sortArr); + for(reset($sortArr); $key = key($sortArr); next($sortArr)) + { + if($DEBUG) echo "
      sortArr[$key] = {$sortArr[$key]}"; + if($DEBUG) echo "
      unitValue = {$valueArr[$key]}"; + $unitValue = $valueArr[$key]; + if($DEBUG) echo "
      defArr[$key] = {$defArr[$key]}"; + $unitDefArr = explode('-',$defArr[$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1) + { + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType){ + case 'toDec': + if($bgnBit > 0 ||$endBit < 7){ + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7){//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++){ + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + }else{//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + }else{ + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7){//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + }else{ + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++){ + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2){ + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + } + if($DEBUG) echo "
      lastValue = $lastValue "; + $setValue = $lastValue; + +{ + $objWhereStr =getLevelWhere($objIdStr); + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + if($DEBUG) echo "$updSql
      "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + +} +if($DEBUG) exit(); +echo ""; +exit(); +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +
      " > +setValue = $setValue ,inputName = $inputName"; +if($objIdStr != NULL){ + $objWhereStr =getLevelWhere($objIdStr); + $objSql = "SELECT $objNameField,$objSetField,valueType,length,minValue,maxValue FROM $paramConfTable WHERE $objWhereStr"; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + $totalLen = $objRows[length]*2; + $objName = $objRows[$objNameField]; + $setTemplate = $objRows[$objSetField]; + $valueType = $objRows[valueType]; + $minValue = $objRows[minValue]; + $maxValue = $objRows[maxValue]; + + {//get $setValue +// $paramTable = 'param_99'; + + $paramSql = " SELECT initValue FROM $paramTable + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + + //echo "$paramSql"; + $v_Result = mysqli_query($pubConn,$paramSql); + $v_Row = mysqli_fetch_array($v_Result); + $setValue = $v_Row[0]; + } + +}else{ + echo "ERROR!!:oid == NULL"; + exit(); +} +/************************************** +*objName +*[unit]name[u]xx.xx-yy.yy[u]input[v]toDec-fillHigh-fillChar +*[unit]name[u]xx.xx-yy.yy[u]select[v]value1[opt]desc1[v]value2[opt]desc2 +*[remark] +***************************************/ + +//explode by '[remark]' +$remarkArr = explode('[remark]',$setTemplate); +$remark = $remarkArr[1]; + +//explode by '[unit]' +$unitArr = explode('[unit]',$remarkArr[0]); + +//show instance's name +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + if(isset($devicename)) + { + $backurl1 = str_replace("wxc2_sp_signaling","wxc2_sp",$backurl); + echo "Configuration > Network > "; + echo "$devicename > "; + echo "$webname > "; + } + else + { + echo "Configuration > Network > "; + echo "MSC > "; + } + echo "ACN"; + + echo ""; +// showHelp($helpId); + echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
       "; +//echo "ACN  "; +echo ""; +echo ""; +echo "    "; +echo ""; + +echo ""; +echo "

      $strBack"; +echo "

      "; + +//show every one unit +//--><-//$setValue = strrev($setValue); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +for($i=1;$i"; +}//end of for(..) + +//parmmeter alias +/* +echo ""; +*/ +echo "
      ParametersValue
      "; + //unit input name + $unitName = "unit_".$i; + + //explode by '[u]' + $tlvArr = explode('[u]',$unitArr[$i]); + if(sizeof($tlvArr) <= 1 ){ + echo "{$unitArr[$i]}"; + continue; + } + + //show Unit Name + echo "$tlvArr[0]"; + echo " "; + if($DEBUG) echo "$tlvArr[1]"; + //explode by '-' + $offsetArr = explode('-',$tlvArr[1]); + $bgnOffsetArr = explode('.',$offsetArr[0]); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$offsetArr[1]); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = substr($setValue,$bgnByte*2,$byteLen*2); + //--><-//$byteValue = strrev($byteValue); + + if($DEBUG) echo "
      byteValue = $byteValue"; + $bitValue = ''; + if($bgnBit > 0 ||$endBit < 7){ + if($DEBUG) echo "
      $bgnBit > 0 ||$endBit < 7"; + $bitValue = HexDec($byteValue); + $bitValue = DecBin($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitLen = $byteLen*8;//1 byte = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,'high','0')"; + + $bitValue = strrev($bitValue); + $catBitLen = $endByte*8+$endBit - ($bgnByte*8+$bgnBit) + 1; //1 byte = 8 bit + if($DEBUG) echo "
      bitValue = substr($bitValue,$bgnBit,$catBitLen)"; + $bitValue = substr($bitValue,$bgnBit,$catBitLen); + $bitValue = strrev($bitValue); + if($DEBUG) echo "
      bitValue = $bitValue"; + } + + //explode by '[v]' + $valueArr = explode('[v]',$tlvArr[2]); + $typeAddTitleArr = explode('[t]',$valueArr[0]); + $operType = chop($typeAddTitleArr[0]); + $titleStr = chop($typeAddTitleArr[1]); + $valueArr[1] = chop($valueArr[1]); + + if($DEBUG) echo "
      operType = $operType"; + switch($operType){ + case 'input':// + //explode by '-' + $defArr = explode('-',$valueArr[1]); + if($DEBUG) echo "
      defArr = $defArr[0],$defArr[1],$defArr[2]"; + switch($defArr[0]){ + case 'toDec': + if(strlen($bitValue) > 0){ + $inputValue = BinDec($bitValue); + }else{ + $inputValue = HexDec($byteValue); + } + break; + case 'keepDec': + $inputValue = $byteValue; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + $inputValue = $byteValue; + break; + case 'toAscii': + $charValue = ""; + if($bgnBit > 0 ||$endBit < 7){ + echo "
      Error:toAscii"; + exit(1); + }else{ + $tmpLen=strlen($byteValue); + for($charCount=0;$charCount<$tmpLen;$charCount++){ + $unitByte = substr($byteValue,$charCount,2); + $unitChar = chr(HexDec($unitByte)); // hex -> ascii + if($DEBUG) echo "
      unitChar=$unitChar"; + $charValue .= $unitChar; + $charCount++; + } + $inputValue = $charValue; + } + break; + default: + echo "
      Error:valueType=$defArr[0]"; + break; + } + if($DEBUG) echo "
      inputValue = $inputValue"; + switch($defArr[1]){ + case 'high': + switch($defArr[2]){ + case '0': + if($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + //$inputValue = str_replace('0','',$inputValue); + }else{ + $inputValue = $inputValue - 0; + } + break; + case 'E': + echo "Error:high fill E"; + break; + default: break; + } + break; + case 'low': + if ("toAscii" != $defArr[0]) { + switch($defArr[2]){ + case '0': + $inputValue = str_replace('00','',$inputValue); + break; + case 'E': + $inputValue = str_replace('E','',$inputValue); + break; + default: break; + } + } + break; + default: break; + } + if($DEBUG) echo "
      $valueType == $nOctStr"; + if($valueType == $nOctStr){ + if($defArr[0] == 'toAscii'){ + $inputLen = $byteLen; + }elseif($defArr[0] == 'toHex' || $defArr[0] == 'keepHex'){ + $inputLen = $byteLen *2; + }else{ + $inputLen = $byteLen *3; + } + //echo ""; + echo ""; + }else{ + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + break; + case 'select': + if($valueType == $nOctStr){ + if($bitValue != ''){ + $selectValue = BinDec($bitValue); + }else{ + $selectValue = HexDec($byteValue); + } + }else{ + $selectValue=$byteValue; + } + + if($DEBUG) echo "
      bitValue = $bitValue"; + if($DEBUG) echo "
      selectValue = $selectValue"; + if($DEBUG) echo "
      $valueType =?= $nOctStr(nOctStr)"; + //echo ""; + $isSelected = 0; + for($j=1;$jReserved Value"; + break; + }elseif($defArr[0] == $selectValue){ + echo ""; + $isSelected = 1; + }else{ + echo ""; + } + } + + if($isSelected ==0 && $j == sizeof($valueArr)){ + echo ""; + } + echo ""; + break; + default: echo "
      Error:operType =|$operType|"; + break; + }//end of switch(..) + //like:unitDef_1 = 1.0-2.0-select-keepHex-high-0 -->$tlvArr[1]-$operType- + + if($operType == 'select'){ //select + if($valueType == $nOctStr){ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'toDec-high-0'; + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.'keepDec-high-0'; + } + }else{ + $tempDef = $tlvArr[1].'-'.$operType.'-'.$valueArr[1]; + } + $tempDef = str_replace(" ", "", $tempDef); + $tempDef = chop($tempDef); + echo "\n "; + echo "
      "; +echo "Alais:"; +echo ""; +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
       "; +echo ""; +echo "    "; +echo ""; + +echo " 
      "; + +$unitNum = $i-1; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; + +echo "
      "; +?> + + diff --git a/wxc2_omc/element/toElement/CNFconf.php b/wxc2_omc/element/toElement/CNFconf.php new file mode 100755 index 0000000..92007ab --- /dev/null +++ b/wxc2_omc/element/toElement/CNFconf.php @@ -0,0 +1,576 @@ +this_sysNo=$this_sysNo"; + echo "
      this_subSysNo=$this_subSysNo"; + echo "
      TypeIn=$TypeIn"; + echo "
      webname=$webname"; + echo "
      Spname=$Spname"; + } + + $sysId = "160_$this_sysNo" . "_$this_subSysNo"; + $sysIdPub = "160_$this_sysNo" . "_99"; + $objDB = 'OBJ_160'; + $paramTab = 'param_'.$this_sysNo; + + $center_objDB='OBJ_270'; + $center_paramTab='param_0'; + $center_sysId = "270_0_0"; +} + +{//CNF center + $tmpobj = 'OBJ_222'; + $tmpparam = 'param_99'; + $tmpoid = '2.4.1'; + $objWhereStr = getLevelWhere($tmpoid); + $paramSql = " SELECT initValue,instanceNo FROM $tmpparam + WHERE subSysNo = '99' AND $objWhereStr + "; + + $Result = mysqli_query($pubConn,$paramSql); + while($Row = mysqli_fetch_array($Result)) + { + $TypeIn = getBitValue($Row[initValue],'4.0-4.7'); + $TypeIn = hexdec($TypeIn); + if($TypeIn==6)//CNF Center + { + $center_DPC = hexdec(getBitValue($Row[initValue],'0.0-2.7')); + $center_NI = bindec(getBitValue($Row[initValue],'3.0-3.1')); + $center_lks_inst = $Row[instanceNo]; + break; + } + } +} + +$NetIdConfArr=array('International','International-S','National','National-S'); + +$cnfPubOidArr=array( + array('oid'=>'2.1.8', 'sysid'=> $sysIdPub, 'selectsysid'=>'-1'), + array('oid'=>'2.1.9', 'sysid'=> $sysIdPub, 'selectsysid'=>'-1') +); + +$cnfOidArr=array( + array('oid'=>'2.2', 'sysid'=> $sysId, 'selectsysid'=>'-1'), +); + +$cnfCenterOidArr=array( + array('oid'=>'2.1', 'sysid'=> $center_sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=> $center_sysId, 'selectsysid'=>'-1') +); + +$SaveArr=array( + array('oidstr'=>'2.3.2', 'setvalue'=>'01' ,'sysid' => $center_sysId, 'selectsysid'=>'-1'), +); + +?> + + +Setting parameters
      "; + SetParam($cnfPubOidArr); + SetParam($cnfOidArr); + SetParam($cnfCenterOidArr); + + SaveParam($SaveArr); + } + else + { + echo "
      Getting parameters
      "; + GetParam($cnfPubOidArr); + GetParam($cnfOidArr); + GetParam($cnfCenterOidArr); + } + + echo ""; + exit(); +} + +if($Prifdel==1) +{ + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + $setValue = "0000"; + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='99' and instanceNo='$delValue'"; + mysqli_query($pubConn,$updSql); + + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $setValue = "00"; + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='99' and instanceNo='$delValue'"; + mysqli_query($pubConn,$updSql); + + echo ""; + exit(); +} +if($Confdel==1) +{ + $oidstr = "2.2"; + $objWhereStr = getLevelWhere($oidstr); + $setValue='EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE000000EE'; + $updSql = "update $center_paramTab set initValue='$setValue' where $objWhereStr and instanceNo='$delValue' "; + mysqli_query($pubConn,$updSql); + + echo ""; + exit(); +} + +{//show head part + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Configuration > Network > CNF"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo "
      "; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +echo ""; +echo ""; +{// Signaling/Traffic + {//DPC + $DPC_sysId = '222_99_99'; + + $DPC_sysIdArr = explode('_',$DPC_sysId); + $DPC_sysTypeNo = $DPC_sysIdArr[0]; + $DPC_sysNo = $DPC_sysIdArr[1]; + $DPC_subSysNo = $DPC_sysIdArr[2]; + + $DPC_oidstr = '2.4.1'; + $DPC_objWhereStr= ''; + $DPC_objWhereStr =getLevelWhere($DPC_oidstr); + $DPC_objDb = 'OBJ_'.$DPC_sysTypeNo; + $DPC_paramTable = 'param_'.$DPC_sysNo; + + $DPC_paramSql = " SELECT initValue,readValue,instanceNo FROM $DPC_paramTable + WHERE $DPC_objWhereStr AND instanceNo ='$linkset' + "; + if($DEBUG) echo "$DPC_paramSql
      "; + $DPC_Result = mysqli_query($pubConn,$DPC_paramSql); + $DPC_Row = mysqli_fetch_array($DPC_Result); + $linkset_DPC = hexdec(getBitValue($DPC_Row[initValue],'0.0-2.7')); + $NetID = bindec(getBitValue($DPC_Row[initValue],'3.0-3.1')); + } + + {//WXC2 OPC ************************ + $oidstr = '2.2'; + $aas_link_Db = 'OBJ_222'; + $aas_link_Table = 'param_99'; + + $subSysNo = 99; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $aas_link_Table + WHERE $objWhereStr AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + $aas_Result = mysqli_query($pubConn,$paramSql); + $aas_Row = mysqli_fetch_array($aas_Result); + + $NIbit = getBitValue($aas_Row[initValue],"0.$NetID"); + $tmp = $NetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $updSql = "SELECT initValue FROM $aas_link_Table + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + $Result = mysqli_query($pubConn,$updSql); + $Row = mysqli_fetch_array($Result); + $WXC2PC = hexdec($Row[initValue]); + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +} + +{//card type +echo ""; + echo ""; + echo ""; +echo ""; +}//end card type + +{//DPLL priority +echo ""; + echo ""; + echo ""; +echo ""; +}//end DPLL priority + +{//Voice Prompt Setting + echo ""; + echo ""; + echo ""; + echo ""; +}//end voice prompt Setting + +{//prefix + $leadDigArr = array( + 'Internal', + 'Conference', + 'PPS' + ); + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select instanceNo,initValue from $paramTab where $objWhereStr and subSysNo='99' and initValue!='0000' order by instanceNo "; + $result = mysqli_query($pubConn,$selSql); +// echo "
      selSql: $selSql"; + $n=0; + $whereStr = "(0"; + while($row = mysqli_fetch_array($result)) + { + $prefixArr[$n][prefix] = str_replace('E','',$row[initValue]); + $prefixArr[$n][inst] = $row[instanceNo]; +// echo "
      prefixArr[$n][inst]:{$prefixArr[$n][inst]}"; + $whereStr .= " or instanceNo={$prefixArr[$n][inst]}" ; + $n++; + } + $whereStr .= ")"; +// echo "
      whereStr: $whereStr"; + + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select instanceNo,initValue from $paramTab where $objWhereStr and subSysNo='99' and $whereStr order by instanceNo "; + $result = mysqli_query($pubConn,$selSql); + $n=0; + while($row=mysqli_fetch_array($result)) + { + $prefixArr[$n][dialLen] = bindec(getBitValue($row[initValue],'00.0-00.5')); + $leadDig = bindec(getBitValue($row[initValue],'00.6-00.7')); + $prefixArr[$n][leadDig] = $leadDigArr[$leadDig]; +// echo "
      prefixArr[$n][leadDig]: {$prefixArr[$n][leadDig]}"; + $n++; + } +// echo "
      selSql: $selSql"; + + {//show prefix + echo "" ; + echo ""; + if($n == 0) echo ""; + else + { + echo ""; + }//end else + echo ""; + } +}//end prefix + +echo "
      $Spname
      Signaling point code$linkset_DPC 
      NetWork indicator$NetIdConfArr[$NetID]"; + echo ""; + echo "
      WXC2 point code$WXC2PC"; + echo "
      Card Type"; + showParameter($sysId,'2.2.1',1,1); + echo"
      DPLL priority"; + showParameter($sysId,'2.2.2',1,1); + echo"
      Voice prompt setting"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Join meetingLeave MeetingConference FullPassword InvalidFive Minutes LeftEnd Conference
      "; + echo ""; + echo ""; + echo ""; + echo "
      Prefix+
      "; + echo "
       --"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0; $i"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      NoPrefixDialed LengthLead digitDelete
      $i{$prefixArr[$i][prefix]}{$prefixArr[$i][dialLen]}{$prefixArr[$i][leadDig]}"; + echo "
      "; + +echo "
      "; + +/*************** CNF Center parameter part *********************/ +{//cnf center table +echo ""; +//echo ""; +echo ""; +{//cc and ndc +echo ""; + echo ""; + echo ""; +echo ""; +} + +{//OPC +echo ""; + echo ""; + echo ""; +echo ""; +} +{//NI +echo ""; + echo ""; + echo ""; +echo ""; +} +{// HRL0 IP +echo ""; + echo ""; +echo ""; +} + +{//Conference parameters + $confParaArr = array( + array('name' => 'Conf ID', 'bit' => '00.0-00.7', 'value' => ''), + array('name' => 'Conf Number', 'bit' => '01.0-08.7', 'value' => ''), + array('name' => 'Password', 'bit' => '09.0-10.7', 'value' => ''), + array('name' => 'Applicant', 'bit' => '11.0-18.7', 'value' => ''), + array('name' => 'Start time', 'bit' => '19.0-22.7', 'value' => ''), + array('name' => 'Duration', 'bit' => '23.0-24.7', 'value' => ''), + array('name' => 'Maximum party', 'bit' => '25.0-25.7', 'value' => ''), + array('name' => 'Status', 'bit' => '26.0-26.7', 'value' => '') + ); + { + $oidstr = "2.2"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue from paramConf where $objWhereStr "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $defualtValue=$row[initValue]; + + $selSql = "select initValue,instanceNo from $center_paramTab where $objWhereStr "; + $result = mysqli_query($pubConn,$selSql); + $n=0; + while($row = mysqli_fetch_array($result)) + { + $confNumber = getBitValue($row[initValue],$confParaArr[1][bit]); + $confNumber = str_replace('E','',$confNumber); + if(strlen($confNumber)>0) + { + $showParaArr[$n][0][value] = hexdec(getBitValue($row[initValue],$confParaArr[0][bit])); + $showParaArr[$n][1][value] = $confNumber; + $showParaArr[$n][2][value] = str_replace('E','',getBitValue($row[initValue],$confParaArr[2][bit])); + $showParaArr[$n][3][value] = str_replace('E','',getBitValue($row[initValue],$confParaArr[3][bit])); + $showParaArr[$n][4][value] = str_replace('E','E',getBitValue($row[initValue],$confParaArr[4][bit])); + $showParaArr[$n][5][value] = hexdec(getBitValue($row[initValue],$confParaArr[5][bit])); + $showParaArr[$n][6][value] = hexdec(getBitValue($row[initValue],$confParaArr[6][bit])); + $showParaArr[$n][7][value] = getBitValue($row[initValue],$confParaArr[7][bit]); + + for($j=0; $j" ; + echo ""; + if($n == 0) echo ""; + else + { + echo ""; + } + echo ""; +} + +echo "
      CNF Center linkset=$center_lks_inst
      CNF Center
      CC and NDC"; + showParameter($center_sysId,'2.1.1',1,1); + echo"
      OPC"; + showParameter($center_sysId,'2.1.2',1,1); + echo"
      NI"; + showParameter($center_sysId,'2.1.3',1,1); + echo"
      IP"; +echo ""; +echo ""; + echo ""; + echo ""; +echo ""; + +echo ""; + echo ""; + echo ""; +echo ""; +echo "
      HLR0 IP: "; + showParameter($center_sysId,'2.1.4',1,3); + echo"HLR1 IP: "; + showParameter($center_sysId,'2.1.5',1,3); + echo"
      PPS0 IP: "; + showParameter($center_sysId,'2.1.6',1,3); + echo"PPS1 IP: "; + showParameter($center_sysId,'2.1.7',1,3); + echo"
      "; + echo ""; + echo ""; + echo ""; + echo "
      Conference Booking+
      "; + echo "
       --"; + echo ""; + echo ""; + echo ""; + for($i=0; $i< sizeof($confParaArr); $i++) + { + echo ""; + } + echo ""; + echo ""; + $status_label=array(0=>"Not Executable",1=>"Booking",2=>"On Going",3=>"Finished",4=>"Draft"); + + for($i=0; $i< $n; $i++) + { + echo ""; + $inst = $instanceNoArr[$i]; + echo ""; + for($j=0; $j< sizeof($confParaArr); $j++) + { + echo ""; + } + echo ""; + echo ""; + } + + echo "
      No"; + echo $confParaArr[$i][name]; + echo "Delete
      $i"; + if($j==4) + { + $startTimeArr=array( + array('name' => 'm', 'lin' => '-', 'value' => ''), + array('name' => 'd', 'lin' => ' ', 'value' => ''), + array('name' => 'H', 'lin' => ':', 'value' => ''), + array('name' => 'M', 'lin' => '', 'value' => '') + ); + $showParaArr[$i][$j][value] = omc_keep_length($showParaArr[$i][$j][value],'0',8,0); + for($k=0; $k< sizeof($startTimeArr); $k++) + { + $startTimeArr[$k][value] = omc_keep_length(hexdec(substr($showParaArr[$i][$j][value],$k*2,2)),'0',2); + echo $startTimeArr[$k][value] . $startTimeArr[$k][lin]; + } + } + else if($j==7) + { + $status_show=$status_label[$showParaArr[$i][$j][value]+0]; + echo $status_show; + } + else + { + echo $showParaArr[$i][$j][value]; + } + echo "
      "; +}//end cnf center table + + +echo "
      "; + echo "CNF -> MSS"; + echo "
      "; +echo "
      "; +?> +
      + + diff --git a/wxc2_omc/element/toElement/E1channelEdit.php b/wxc2_omc/element/toElement/E1channelEdit.php new file mode 100755 index 0000000..5e4f52e --- /dev/null +++ b/wxc2_omc/element/toElement/E1channelEdit.php @@ -0,0 +1,466 @@ + + + +ERROR!!:instanceNo == NULL
      "; + if(!isset($Protocol)) + echo "ERROR!!:Protocol == NULL
      "; + exit(0); +} + +?> + + + + $stat_oidstr, 'sysid' => $statSysId, 'selectsysid' => '-1'), +); + +//print_r($stat_oidsysArr); + +if($_SERVER['REQUEST_METHOD'] == "POST"){ + if(isset($setSys)) + {//保存改动 + for($i=0; $i< 32;$i++) + { + { + $selSql = "SELECT initValue + FROM $paramTable + WHERE $objWhereStr AND instanceNo='$timeslotno' + "; + if($DEBUG) echo "
      selSql=$selSql"; + $result=mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + $orgValue=$rows[0]; + $old_Value=$rows[0]; + //echo "$orgValue
      "; + echo mysqli_error($pubConn); + } + + $newValue=$orgValue; + + // echo "
      orgValue=$orgValue"; + for($j =1;$j< sizeof($E1ConfArr);$j++) + { + $tmpname = $E1ConfArr[$j][3]."_$i"; + $tmpval = ${$tmpname}; + if($j==1) + { + $tmpval = decbin($tmpval); + $tmpval = omc_keep_length($tmpval,0,$E1ConfArr[$j][4]); + $newValue=setBitValue($newValue,$E1ConfArr[$j][1],$tmpval); + } + if(isset($tmpval)) + { + if($j==3) + { + $set1 = $tmpval/8; + $set1 = Floor($set1); + $set2 = $tmpval - $set1*8; + + $tmpval = decbin($set1); + $tmpval = omc_keep_length($tmpval,0,$E1ConfArr[$j][4]); + $newValue= setBitValue($newValue,$E1ConfArr[$j][1],$tmpval); + $j++; + $tmpval = decbin($set2); + $tmpval = omc_keep_length($tmpval,0,$E1ConfArr[$j][4]); + $newValue= setBitValue($newValue,$E1ConfArr[$j][1],$tmpval); + continue; + } + $tmpval = decbin($tmpval); + $tmpval = omc_keep_length($tmpval,0,$E1ConfArr[$j][4]); + $newValue=setBitValue($newValue,$E1ConfArr[$j][1],$tmpval); + } + } + $newValue=strtoupper($newValue); + + $updSql = "UPDATE $paramTable SET initValue = '$newValue' + WHERE $objWhereStr AND instanceNo='$timeslotno' + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + //echo "
      updSql=$updSql"; + // echo "
      newValue=$newValue"; + $timeslotno++; + } + + //echo "
      saveHref=$saveHref"; + if($btn_back==$strBack){ + checkSaveFunction($saveHref); + exit(); + } + echo ""; + exit(); + } + else if(isset($refresh)) + { + GetParam($stat_oidsysArr,0,0,0); + } + +} +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > "; +echo "$webname > "; +echo "Time slot"; +echo ""; +//showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "\n"; +echo "\n"; +//echo "
      backurl=$backurl"; +echo "
      "; +echo "MSC timeslot:  "; +echo "E1 No. $instanceNo  "; +echo "Protocol: $Protocol  "; +echo ""; +echo "    "; +echo ""; + +echo ""; +//echo "$backurl
      "; +echo "

      $strBack"; +//echo "

      "; +echo "

      "; + + +echo ""; +echo ""; +for($j =0;$j< sizeof($E1ConfArr);$j++) +{ + if($j==4) continue; + if($j==1) + { + echo ""; + } + else + echo ""; +} +echo ""; +echo ""; + +$channelStatArr = array(0=>'Disable',1=>'Idle',2=>'Busy',3=>'Local blocked',4=>'Remote blocked'); + +//echo "$objWhereStr
      "; + +$tmp = $timeslotno+32; +$selSql = "SELECT initValue,instanceNo + FROM $paramTable + WHERE $objWhereStr AND instanceNo>='$timeslotno' AND instanceNo<='$tmp' + "; +if($DEBUG) echo "
      selSql=$selSql"; +$result=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); + +for($i=0; $i< 32;$i++) +{ + { + $rows =mysqli_fetch_array($result); + $orgValue=$rows[0]; + //echo "{$rows[1]}:$orgValue
      "; + echo mysqli_error($pubConn); + } + echo ""; + {//显示 + echo ""; + {//show enable/Disable + echo ""; + } + for($j =2;$j< sizeof($E1ConfArr);$j++) + { + $getval = bindec(getBitValue($orgValue,$E1ConfArr[$j][1])); + $tmpname = $E1ConfArr[$j][3]."_$i"; + if($j==2) + { + echo ""; + } + { + $tmpInsNo = $timeslotno + $i; + $selSql_stat = "SELECT initValue + FROM $paramTable_status + WHERE $objWhereStr_status AND instanceNo='$tmpInsNo'"; + if($DEBUG) echo "
      $i:selSql_stat=$selSql_stat"; + $result_stat=mysqli_query($pubConn,$selSql_stat); + $row_stat = mysqli_fetch_array($result_stat); + $status = hexdec($row_stat[initValue]); + } + echo ""; + } + echo ""; +} +echo ""; +echo "
      {$E1ConfArr[$j][0]}"; + echo ""; + echo "{$E1ConfArr[$j][0]}Channel Status
      $i"; + $flag = bindec(getBitValue($orgValue,$E1ConfArr[1][1])); + $tmpname = $E1ConfArr[1][3]."_$i"; + if($flag == 1) + { + echo ""; + $disableStr = ''; + } + else + { + echo ""; + $disableStr = 'disabled'; + } + echo "{$channelStatArr[$status]}
       "; + + +?> + +
      + + diff --git a/wxc2_omc/element/toElement/E1connectconf.php b/wxc2_omc/element/toElement/E1connectconf.php new file mode 100755 index 0000000..92e935c --- /dev/null +++ b/wxc2_omc/element/toElement/E1connectconf.php @@ -0,0 +1,935 @@ +"; +if($DEBUG) echo "
      正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$nGetComm = 0; +$nSetComm = 3; + +$pubDb = 'OMC_PUB'; +$sysId = '322_99_99'; +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; + +//========================================================== +//输入变量 +//========================================================== +$nShowsize ='40%'; + +$objIdarr = array("2.4.1","2.4.3"); + +$ProtocolArr=array("TUP","ISUP","AIF","ISDN NT","ISDN LT","CI-CNF","CI-loopback"); + + +//========================================================== +//数据处理 +//========================================================== +{//设备类型 与设备编号 + getElementInfo($infoNo,$elementInfoArr); + $this_sysNo = $TypeNo = $elementInfoArr[sysNo]; + $TypeIn = $elementInfoArr[typeValue]; +} + +//echo "TypeIn:$TypeIn
      "; +{//get all 8ke1 cards' heart beat + $selSql = "select sysNo,subSysNo,detailStat from sysStat where sysTypeNo='111'"; + $Result = mysqli_query($pubConn,$selSql); + while($Row = mysqli_fetch_array($Result)) + { + $cardNo = $Row[sysNo] * 16 + $Row[subSysNo]; + $bitValue = substr($Row[detailStat],42,2); + if($bitValue=='00') $type='E1'; + else if($bitValue=='01') $type='T1'; + $k8e1CardTypeArr[$cardNo] = $type; + //echo "
      $Row[sysNo]-$Row[subSysNo]:$bitValue"; + } +}//end get 8ke1's heart beat. + +//保存改动 +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + + + if($instanceNo == 'New' ||$instanceNo == 'new') + { + $instanceNo = $newID; + } + + + //============save for mtp2 error correction parameter===================== + $instance_no_tmp=$instanceNo; + //=======get the plat no======================= + $plat_no_tmp=-1; + if($instance_no_tmp>=0&&$instance_no_tmp<=127) + { + $plat_no_tmp=0; + $ins_no_tmp=floor($instance_no_tmp/8); + $bit_tmp=$instance_no_tmp%8; + } + else if($instance_no_tmp>=128&&$instance_no_tmp<=255) + { + $plat_no_tmp=1; + $instance_no_tmp=$instance_no_tmp-128; + $ins_no_tmp=floor($instance_no_tmp/8); + $bit_tmp=$instance_no_tmp%8; + } + //=====get the table name in database=========== + $table_name_tmp="param_".$plat_no_tmp; + $database="OBJ_111"; + $sql="select instanceNo,initValue from $table_name_tmp where level_1=2 and level_2=8 and instanceNo=$ins_no_tmp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $old_value=$rows[initValue]; + $tmp="0.".$bit_tmp."-0.".$bit_tmp; + $new_value= setBitValue($old_value,$tmp,$mtp2_error_correction_select); + + $updSql = "UPDATE $table_name_tmp SET initValue = '$new_value' + where level_1=2 and level_2=8 and instanceNo=$ins_no_tmp + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + //========================================================================== + + $sysId = '322_99_99'; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + + $objIdStr='2.4.1'; + $objWhereStr =getLevelWhere($objIdStr); + $totalValue = omc_keep_length(dechex($Protocol),"0","2"); + $totalValue = strtoupper($totalValue); + $updSql = "UPDATE $paramTable SET initValue = '$totalValue' + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) + echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + //=====to set the interface first=============================== + $commIdStr = oidSysCommSend("322_99_99",$nSetComm,"2.4.1",-1); + CheckState($commIdStr); + sleep(1); + $commIdStr = oidSysCommSend("322_99_99",$$nGetComm,"2.4.1",-1); + CheckState($commIdStr); + + + $database="OBJ_322"; + $sql="select readValue from param_99 where level_1=2 and level_2=4 and level_3=1 and instanceNo=$instanceNo "; + if($DEBUG) + echo "
      Sql=$sql"; + $result=@mysqli_query($pubConn,$sql); + + $rows=@mysqli_fetch_array($result); + $readValue=$rows[readValue]; + //=========no E1 license==================== + //echo "setValue----$totalValue
      "; + //echo "readValue----$readValue
      "; + if($totalValue!=$readValue) + { + //========get the default value================== + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=4 and level_3=1 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $default_Value=$rows[initValue]; + //========resume the value====================== + $updSql = "UPDATE param_99 SET initValue = '$default_Value' + WHERE level_1=2 and level_2=4 and level_3=1 AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + + echo ""; + exit(); + + } + + + + + if($instanceNo == 'New' ||$instanceNo == 'new') + { + $instanceNo = $newID; + //初始化时序参数 + $tempnum = $instanceNo/8; + $cardno = Floor($tempnum); + $cardname = "cardno"."_$cardno"; + $tempno = $cardno+1; + $oidCard = "2.5."."$tempno"; + $objWhereStr =getLevelWhere($oidCard); + + $cardE1no = $instanceNo - $cardno*8; + $timeslotno = $cardE1no*32; + for($j=0; $j< 32;$j++) + { + $updSql = "UPDATE param_99 SET initValue = '05EEEE' + WHERE $objWhereStr AND instanceNo='$timeslotno' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn',$updSql); + echo mysqli_error($pubConn); + $timeslotno++; + } + //open k8e1 enable + open8ke1Enable($instanceNo,1); + } + //echo "crc4flag:$crc4flag"; + if($webname=='PCR') + { + open8ke1CRC4Flag($instanceNo,0); + } + else + { + if($crc4flag==1) + open8ke1CRC4Flag($instanceNo,1); + else + open8ke1CRC4Flag($instanceNo,0); + } + if($mtpAlarm==1) + open8ke1mtpAlarm($instanceNo,1); + else + open8ke1mtpAlarm($instanceNo,0); + + if($webname=='Switch') + { + set8ke1Canceller($instanceNo,$echoCanceller); + } + $tempnum = $instanceNo/8; + $cardno = Floor($tempnum); + $cscNo = Floor($cardno/16); + $subCardNo = $cardno%16; + if($k8e1CardTypeArr[$cardno]=='T1') + { +// set8ke1SigSlot($instanceNo,$sigSlot); + set8kT156K64K($instanceNo,$T1_56K64K); + set8kCardType($instanceNo,90); + if(isset($resetCard)) + { + echo "
      Reseting CSU$sysNo-Card $subSysNo ..."; + $tmpObjId = '3.1'; + $setValue = '5A'; + $subSysId = '111_' . $cscNo . '_'.$subCardNo; + echo "subSysId:$subSysId"; + $SaveArr[0]['sysid'] =$subSysId; + $SaveArr[0]['oidstr'] =$tmpObjId; + $SaveArr[0]['setvalue'] =$setValue; + + SaveParam($SaveArr); + } + } + else + { + set8kCardType($instanceNo,0); + } + set8kIdleCode($instanceNo,$T1_idleCode); + + if($Protocol==3 || $Protocol==4) + { + set8ke1LinkType($instanceNo, 1); + if($Protocol==3) + set8ke1NTLT($instanceNo, 1); + else + set8ke1NTLT($instanceNo, 0); + } + else + { + set8ke1LinkType($instanceNo, 0); + set8ke1NTLT($instanceNo, 0); + } + //exit; + + + $objIdStr='2.4.2'; + $objWhereStr =getLevelWhere($objIdStr); + $totalValue = omc_keep_length(dechex($trunkgp),"0","2"); + $totalValue = strtoupper($totalValue); + + $updSql = "UPDATE $paramTable SET initValue = '$totalValue' + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + $objIdStr='2.4.3'; + $objWhereStr =getLevelWhere($objIdStr); + + $tmp = dechex($CIC); + $tmp = omc_keep_length($tmp,'0',2); + $setValue = strtoupper($tmp); + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + $objIdStr='2.4.4'; + $objWhereStr =getLevelWhere($objIdStr); + + $selSql = "SELECT initValue from $paramTable + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + $result = mysqli_query($pubConn,$selSql); + $Rows = mysqli_fetch_array($result); + $setValue = setBitValue($Rows[initValue],'0.0-0.0','1');//asigned + $setValue = setBitValue($setValue,'00.1-001','1');//unlock + + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + if($DEBUG) + { + exit(); + } + else + { + echo ""; + exit(); + } +} + + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +echo ""; +?> + +
      "> + +"; +echo ""; +echo ""; +echo "Configuration > Network > "; +echo "$webname > "; +echo "E1"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; + +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + if($instanceNo == 'new') + { + //echo "Add E1 connection:  "; + echo "  "; + } + else + { + //echo "Edit E1 connection:  "; + echo "  "; + } + echo ""; + echo ""; + echo "   "; + //echo ""; + echo ""; + echo "$strBack"; + echo "
      "; + echo "
      "; +} +echo ""; + +//E1 connection +if($instanceNo == 'New' ||$instanceNo == 'new') +{ + for($i=0;$i< sizeof($objIdarr);$i++) + { + $objIdStr=$objIdarr[$i]; + $objWhereStr =getLevelWhere($objIdStr); + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr "; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $defaultValue = $defRow[initValue]; + $value[$i] =$defaultValue; + } + if($TypeIn==2)//AAS自动配置参数 + { + if($cicflag==0) + { + $value[1]=20; + } + else + { + $value[1]=0; + } + } + else + { + $tmp=0; + $tmp = omc_keep_length(dechex($ctrflag%32),"0","2"); + $value[1]=$tmp; + } + +} +else +{ + for($i=0;$i< sizeof($objIdarr);$i++) + { + $objIdStr=$objIdarr[$i]; + $objWhereStr =getLevelWhere($objIdStr); + $getSql="SELECT initValue,instanceNo + FROM $paramTable + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + $value[$i]=$rows[initValue]; + if($DEBUG) echo "
      value[$i]=$value[$i]"; + } +} + +$Protocol = hexdec($value[0]); +$CIC = hexdec($value[1]); + +echo ""; +echo ""; +echo ""; +if($instanceNo == 'new') +{ + echo ""; +} +else +{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +//if($TypeIn == 2)//aas +if($TypeIn > 1 && $TypeIn < 6) //aas, vms, pcr, cnf +{ + echo ""; +} +elseif($TypeIn == 1)//bss +{ + echo ""; +} +elseif($TypeIn == 17) +{ + echo ""; +} +else +{ + echo ""; +} +echo ""; + +if($TypeIn!=17){ + echo ""; + echo ""; + $tmpvalue = $CIC; + echo ""; +}//end if($TypeIn!=17) +//==========IUA CIC============ +else +{ + //==================get the trunk instanceNo============= + $tg_no_tmp=$trunkgp; + $database="OBJ_322"; + $sql="select initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$tg_no_tmp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $tg_protocal_stack=hexdec(getBitValue($rows[initValue],'12.0-12.7'))+0; + //====ANSI==== + if($tg_protocal_stack==1) + { + echo ""; + echo ""; + $tmpvalue = $CIC; + echo ""; + } + //====ITU==== + else + { + $tmp=""; + } +} +if($instanceNo=='new') + $insNo = $slctInstNo; +else + $insNo = $instanceNo; +$tempnum = $insNo/8; +$cardno = Floor($tempnum); +$tmp = $cardno/16; +$k8e1SysNo = floor($tmp); +$k8e1Table = "param_$k8e1SysNo"; +$k8e1Db = "OBJ_111"; +$setInstNo = $cardno%16; +$cardE1no = $insNo - $cardno*8; + +if(!($webname=='PCR' || $webname=='VSS')) +{ + echo ""; + echo ""; + { + if($instanceNo=='new') + $checked = 0; + else + { + $selSql = "select initValue from $k8e1Table + where level_1='2' and level_2='6' and instanceNo='$setInstNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setbit = "0.$cardE1no-0.$cardE1no"; + $checked = getBitValue($row[initValue],$setbit); + } + $checkeStr = $checked == 1 ? 'checked':''; + echo ""; + } + echo ""; +} +echo ""; +echo ""; +{ + if($instanceNo=='new') + $checked = 1; + else + { + $selSql = "select initValue from $k8e1Table + where level_1='2' and level_2='2' and instanceNo='$setInstNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setbit = "0.$cardE1no-0.$cardE1no"; + $checked = getBitValue($row[initValue],$setbit); + } + $checkeStr = $checked == 1 ? 'checked':''; + echo ""; +} +echo ""; + +if($webname=='Switch') +{ + if($cardE1no % 2 == 0) + { + $selSql = "select initValue from $k8e1Table + where level_1='2' and level_2='9' and instanceNo='$setInstNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $tmpBit = $cardE1no/2; + $setbit = "0.$tmpBit-0.$tmpBit"; + $cancellerType = getBitValue($row[initValue],$setbit);//0:A-law, 1: Mu-Law + } + if(isset($cancellerType)) + $showStr = ''; + else + $showStr = 'none'; + + echo ""; + echo ""; + { + echo ""; + } + echo ""; +} +if($k8e1CardTypeArr[$cardno]=='T1')//show T1 8ke1 card type parameters +{ + {//2.10.6 + $levelWhere = getLevelWhere('2.10.6'); + $selSql = "select initValue from $k8e1Table where $levelWhere and instanceNo='$setInstNo'"; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setbit = "0.$cardE1no-0.$cardE1no"; + $T1_56K64K = getBitValue($row[initValue],$setbit); +// echo "
      $selSql;
      $setbit;
      $T1_56K64K"; + echo ""; + echo ""; + { + echo ""; + } + echo ""; + }//end 2.10.6 + +}//end show T1 8ke1 card type parameters +{//2.12 + if($k8e1CardTypeArr[$cardno]=='E1') $tmpDefault = 'D5'; + else $tmpDefault = 'FE'; + $levelWhere = getLevelWhere('2.12'); + $selSql = "select initValue from $k8e1Table where $levelWhere and instanceNo='$setInstNo'"; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setbit = "$cardE1no.0-$cardE1no.7"; + $T1_idleCode = getBitValue($row[initValue],$setbit); +// echo "
      $selSql;
      $setbit;
      $T1_idleCode"; + echo ""; + echo ""; + echo ""; + echo ""; +}//end 2.12 + +//====================MTP2 error correction======================= +{ +$mtp2_error_correction_label=array(0=>"Basic Error Correction",1=>"Preventive Cyclic Retransmission"); +echo ""; + echo ""; + echo ""; +echo ""; +} + + + +echo "
      ParametersValue
      E1/T1 no."; + + $objIdStr='2.4.4'; + $objWhereStr =getLevelWhere($objIdStr); + $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr "; + $result=mysqli_query($pubConn,$getInstanceSql); + if($webname=='Switch') + echo ""; + $i=0; + while($row=mysqli_fetch_array($result)) + { + $oflag = getBitValue($row[initValue],'0.0-0.0'); + $tempnum = $row[instanceNo]/8; + $cardno = Floor($tempnum); + $cardE1no = $row[instanceNo] - $cardno*8; + $cscNo = Floor($cardno/16); + $subCardNo = $cardno%16; + $cardname = "CSC$cscNo"." "."Card-$subCardNo-$cardE1no"; + + $show=0; + foreach($k8e1CardTypeArr as $card => $value) + { + if($cardno==$card) + { + $show=1; + break; + } + } + + if($show==1 && $oflag==0) + { + $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable + WHERE instanceNo='$row[instanceNo]' and level_1 = '2' and level_2 = '5' and level_3 = '1' + "; + $result_1=mysqli_query($pubConn,$getInstanceSql); + $LinkRow=mysqli_fetch_array($result_1); + $tempFlag = getBitValue($LinkRow[initValue],'06.5-06.5'); + + //if($tempFlag==0)//E1 link disbale + { + if($i==0) + { + if(!isset($slctInstNo)) + $slctInstNo = $row[instanceNo]; + } + echo ""; + $i++; + } + } + } + echo""; + + echo "$instanceNo
      TrunkGroup no.$trunkgp
      Protocol{$ProtocolArr[1]}{$ProtocolArr[2]}
      Circuit ID"; + if($TypeIn==2) + { + echo "$tmpvalue"; + } + else + { + echo ""; + } + echo "
      Interface ID"; + + echo ""; + + echo "
      CRC4 Flag"; + echo "On"; + echo "
      MTP Alarm"; + echo "On"; + echo "
      Echo Canceller"; + if($cancellerType==0) + { + echo "A-law"; + echo "Mu-Law"; + } + else + { + echo "A-law"; + echo "Mu-Law"; + } + echo "
      T1 64K/56K"; + if($T1_56K64K==0) + { + echo "64K"; + echo "56K"; + } + else + { + echo "64K"; + echo "56K"; + } + echo "   "; + echo "Reset 8kE1/T1 Card."; + echo ""; + echo "
      $k8e1CardTypeArr[$cardno] Idle Code"; + echo ""; + echo "  Usual Idle Code = $tmpDefault"; + echo "
      MTP2 Error Correction"; + if($instanceNo=="New"||$instanceNo=="new") + $mtp2_error_correction_value=0; + else + { + //=====get the specfic port no.,then show the parameter======= + $instance_no_tmp=$instanceNo; + //=======get the plat no======================= + $plat_no_tmp=-1; + if($instance_no_tmp>=0&&$instance_no_tmp<=127) + { + $plat_no_tmp=0; + $ins_no_tmp=floor($instance_no_tmp/8); + $bit_tmp=$instance_no_tmp%8; + } + else if($instance_no_tmp>=128&&$instance_no_tmp<=255) + { + $plat_no_tmp=1; + $instance_no_tmp=$instance_no_tmp-128; + $ins_no_tmp=floor($instance_no_tmp/8); + $bit_tmp=$instance_no_tmp%8; + } + //=====get the table name in database=========== + $table_name_tmp="param_".$plat_no_tmp; + $database="OBJ_111"; + $sql="select instanceNo,initValue from $table_name_tmp where level_1=2 and level_2=8 and instanceNo=$ins_no_tmp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $tmp="0.".$bit_tmp."-0.".$bit_tmp; + $mtp2_error_correction_value=hexdec(getBitValue($rows[initValue],$tmp))+0; + + } + + echo ""; + echo "
      "; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      "; + +?> + + diff --git a/wxc2_omc/element/toElement/E1linkconf.php b/wxc2_omc/element/toElement/E1linkconf.php new file mode 100755 index 0000000..b4aa767 --- /dev/null +++ b/wxc2_omc/element/toElement/E1linkconf.php @@ -0,0 +1,769 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; + +$sysId ='222_99_99'; +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; +$AAS_MTP3Table = 'param_11'; +$VSS_MTP3Table = 'param_8'; + +//========================================================== +//输入变量 +//========================================================== +$nShowsize ='45%'; + +$E1linkConfArr=array( + array('showname'=>'SLC', 'inputname'=>'Linkconf0', 'offset'=>'01.0-01.7','value'=>''), + array('showname'=>'Host IP', 'inputname'=>'Linkconf1', 'offset'=>'02.0-05.7','value'=>''), + array('showname'=>'Link type', 'inputname'=>'Linkconf2', 'offset'=>'06.1-06.3','value'=>''), + array('showname'=>'LinkNo', 'inputname'=>'Linkconf3', 'offset'=>'00.0-00.7','value'=>''), + array('showname'=>'Flag', 'inputname'=>'Linkconf4', 'offset'=>'06.5-06.5','value'=>''), + array('showname'=>'Lock', 'inputname'=>'Linkconf5', 'offset'=>'06.0-06.0','value'=>'1') +); + +{//MSC IP + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='320' AND sysNo='0' + "; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + if(@mysqli_num_rows($getSysIdResult)){ + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $MSCIP0 =$getSysIdRow[ip]; + }else{ + $MSCIP0 ='255.255.255.255'; + } + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='320' AND sysNo='1' + "; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + if(@mysqli_num_rows($getSysIdResult)){ + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $MSCIP1 =$getSysIdRow[ip]; + }else{ + $MSCIP1 ='255.255.255.255'; + } +} +//========================================================== +//数据处理 +//========================================================== +{ + getElementInfo($infoNo,$elementInfoArr); + $this_sysNo = $TypeNo = $elementInfoArr[sysNo]; + $TypeIn = $elementInfoArr[typeValue]; + + $otherWhereStr = "and subSysNo=$TypeNo"; +} + + +//保存改动 +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if($instanceNo == 'new') + { + $instanceNo = $newID; + } + + $E1linkConfArr[0][value] = omc_keep_length(dechex($Linkconf0),"0","2"); + $subIpArr = explode('.',$mtp3_IP); + $IP1 = omc_keep_length(dechex($subIpArr[0]),"0","2"); + $IP2 = omc_keep_length(dechex($subIpArr[1]),"0","2"); + $IP3 = omc_keep_length(dechex($subIpArr[2]),"0","2"); + $IP4 = omc_keep_length(dechex($subIpArr[3]),"0","2"); + $E1linkConfArr[1][value] = $IP1.$IP2.$IP3.$IP4; + + $E1linkConfArr[2][value] = omc_keep_length(decbin($Linkconf2),'0',2); + $E1linkConfArr[3][value] = omc_keep_length(dechex($Linkconf3),"0","2"); + $E1linkConfArr[4][value] = $Linkconf4; + for($i=0;$i< sizeof($E1linkConfArr);$i++) + { + $totalValue=setBitValue($totalValue,$E1linkConfArr[$i][offset],$E1linkConfArr[$i][value]); + } + + {//MTP3_99_pub E1 link + $sysId = '222_99_99'; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $objIdStr='2.5.1'; + $objWhereStr =getLevelWhere($objIdStr); + + $totalValue = strtoupper($totalValue); + $updSql = "UPDATE $paramTable SET initValue = '$totalValue' + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + + if($TypeIn == 2)//MTP3_11_pub(AAS) E1 link + { + {//AAS IP + $AAS_sysId = "311_".$this_sysNo."_0"; + $sysIdArr = explode('_',$AAS_sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $IP = explode('.',$getSysIdRow[ip]); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $tmp = $IP[0].$IP[1].$IP[2].$IP[3]; + $totalValue=setBitValue($totalValue,$E1linkConfArr[1][offset],$tmp); + $totalValue=setBitValue($totalValue,'00.0-00.7','00');//LINKSET =0 + $totalValue = strtoupper($totalValue); + } + //$instanceNo =0 or =1 + $updSql = "UPDATE $AAS_MTP3Table SET initValue = '$totalValue' + WHERE $objWhereStr $otherWhereStr AND instanceNo='$Linkconf0' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + + if($TypeIn == 3)//MTP3_9_pub(VSS) E1 link + { + {//vms IP + $VSS_sysId = "390_".$this_sysNo."_0"; + $sysIdArr = explode('_',$VSS_sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $IP = explode('.',$getSysIdRow[ip]); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $tmp = $IP[0].$IP[1].$IP[2].$IP[3]; + $totalValue=setBitValue($totalValue,$E1linkConfArr[1][offset],$tmp); + $totalValue=setBitValue($totalValue,'00.0-00.7','00');//LINKSET =0 + $totalValue = strtoupper($totalValue); + } + $updSql = "UPDATE $VSS_MTP3Table SET initValue = '$totalValue' + WHERE $objWhereStr $otherWhereStr AND instanceNo='$Linkconf0' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + + {//link command + $objIdStr='2.5.2'; + $objWhereStr =getLevelWhere($objIdStr); + + $updSql = "UPDATE $paramTable SET initValue = '$Link_cmd' + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + //MTP3_11_pub(AAS) E1 command + if($TypeIn == 2) + { + $updSql = "UPDATE $AAS_MTP3Table SET initValue = '$Link_cmd' + WHERE $objWhereStr $otherWhereStr AND instanceNo='$Linkconf0' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + //MTP3_8_pub(VSS) E1 command + if($TypeIn == 3) + { + $updSql = "UPDATE $VSS_MTP3Table SET initValue = '$Link_cmd' + WHERE $objWhereStr $otherWhereStr AND instanceNo='$Linkconf0' + "; + if($DEBUG) echo "
      updSql=$updSql"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + if($devicename!='BSC') + set8ke1Mtp2ErrCrct($instanceNo,$mtp2ErrCrct); + + if($tmpTg==-1) + { + open8ke1Enable($instanceNo,1); + open8ke1mtpAlarm($instanceNo,0); + } + if($DEBUG) + { + } + else + { + echo ""; + exit(); + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +//**********************************编辑参数时所用javascript***************************************** +echo ""; +?> + + +
      "> + +"; + echo ""; + echo ""; + + $backurl1 = str_replace("wxc2_sp_signaling","wxc2_sp",$backurl); + echo "Configuration > Network > "; + echo "$devicename > "; + echo "$elementInfoArr[eleName] > "; + echo "Link"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + if($instanceNo == 'new') + { + //echo "Add a link:  "; + echo "  "; + } + else + { + //echo "Edit link:  "; + echo "  "; + } + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + + echo "$strBack"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
      "; +} +echo ""; + +//E1link show +$ctrflag = explode('>',$addflag); +$objIdStr='2.5.1'; +$objWhereStr =getLevelWhere($objIdStr); + +if($instanceNo == 'new') +{ + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr "; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $defaultValue = $defRow[initValue]; + $value =$defaultValue; + + if($TypeIn==2)//AAS自动配置参数 + { + if($slc==0) + { + $value=setBitValue($value,$E1linkConfArr[0][offset],'01'); + } + else + { + $value=setBitValue($value,$E1linkConfArr[0][offset],'00'); + } + } + else + { + $tmp=0; + $tmp = omc_keep_length(dechex($ctrflag[1]%16),"0","2"); + $value=setBitValue($value,$E1linkConfArr[0][offset],$tmp); + } +} +else +{ + $getSql="SELECT initValue,instanceNo + FROM $paramTable + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $value=$rows[initValue]; +} +echo ""; + +for($i=0;$i< sizeof($E1linkConfArr);$i++) +{ + $E1linkConfArr[$i][value] = getBitValue($value,$E1linkConfArr[$i][offset]); +} +echo ""; +echo ""; +echo ""; +$tmpTg = ($trunkgp==255 ? -1 : $trunkgp); + +if($instanceNo == 'new') +{ + if($ctrflag[0]<0) + { + $selinstID="instanceNo >127 "; + } + else + { + $selinstID="instanceNo >=0 "; + } + + $ins_no = 0; + if($tmpTg==-1) + { + echo ""; + } + else + { + $HEXtrunkgp = omc_keep_length(dechex($trunkgp),"0","2"); + $HEXtrunkgp = strtoupper($HEXtrunkgp); + $paramSql = " SELECT initValue,instanceNo FROM OBJ_322.param_99 + WHERE level_1 = '2' and level_2 = '4' and level_3 = '2' AND initValue = '$HEXtrunkgp' + ORDER BY instanceNo"; + if($DEBUG) echo "
      $paramSql"; + $Result = mysqli_query($pubConn',$paramSql); + + $tmpWhere='(0'; + $E1connarr=""; + while($Row = mysqli_fetch_array($Result)) + { + if($tmpWhere=='(0') + $tmpWhere="(instanceNo='$Row[instanceNo]'"; + else + $tmpWhere=$tmpWhere." OR instanceNo='$Row[instanceNo]'"; + } + $tmpWhere=$tmpWhere.")"; + {//show as select + $LinkparamSql = " SELECT initValue,instanceNo FROM OBJ_222.param_99 + WHERE level_1 = '2' and level_2 = '5' and level_3 = '1' AND $tmpWhere + ORDER BY instanceNo"; + if($DEBUG) echo "
      $LinkparamSql"; + $LinkResult = mysqli_query($pubConn,$LinkparamSql); + + + echo ""; +*/ + } +} +else +{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +$tmpvalue = hexdec($E1linkConfArr[0][value]); +echo ""; +echo ""; + +//自动设置ip地址 +if($instanceNo == 'new') +{ + if($firstShowInst<128) + $MTP3IP = $MSCIP0; + else + $MTP3IP = $MSCIP1; +} +else +{ + if($instanceNo<128) + $MTP3IP = $MSCIP0; + else + $MTP3IP = $MSCIP1; +} +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +//echo ""; +//$tmpvalue = bindec($E1linkConfArr[2][value]); +//echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; + +$objIdStr='2.5.2'; +$objWhereStr =getLevelWhere($objIdStr); +if($instanceNo == 'new') +{ + $value ='01'; +} +else +{ + $getSql="SELECT initValue,instanceNo + FROM $paramTable + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $value=$rows[initValue]; +} +echo ""; +/* +echo ""; +echo ""; +$tmpvalue = hexdec($value); +echo ""; +echo ""; +*/ +if($devicename=='Switch') +{ +echo ""; + $tempnum = $instanceNo/8; + $cardno = Floor($tempnum); + $tmp = $cardno/16; + $k8e1SysNo = floor($tmp); + $k8e1Table = "param_$k8e1SysNo"; + $k8e1Db = "OBJ_111"; + $setInstNo = $cardno%16; + $cardE1no = $instanceNo - $cardno*8; + $selSql = "select initValue from $k8e1Table + where level_1='2' and level_2='8' and instanceNo='$setInstNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setbit = "0.$cardE1no-0.$cardE1no"; + $mtp2ErrCrct = getBitValue($row[initValue],$setbit);//0:Basic error correction, 1: Preventive cyclic retransmission + + echo ""; + { + echo ""; + } +echo ""; +} +echo "
      ParametersValue
      E1 link no."; + $objIdStr='2.4.2'; + $objWhereStr =getLevelWhere($objIdStr); + $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND initValue = 'EE' + "; + // $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr "; + $result=mysqli_query($pubConn',$getInstanceSql); + $spanId = "divMTP3IP"; + echo ""; + echo ""; + echo ""; + // echo ""; + echo "$LinkRow[instanceNo]"; + $instanceNo = $LinkRow[instanceNo]; + echo "$instanceNo
      Linkset no.$linkset
      {$E1linkConfArr[0][showname]}"; +if($TypeIn == 2) +{ + echo "$tmpvalue"; +} +else +{ + echo ""; +} +echo "
      {$E1linkConfArr[1][showname]}$MTP3IP"; + +echo "  "; +echo "
      {$E1linkConfArr[2][showname]}"; +//$linkTypeArr = array(0 => 'Non-sigtran', 1 => 'Sigtran', 2 => 'MTP3-Lite'); +// +//echo ""; +//echo "
      Link command"; +echo ""; +echo "
      MTP2 error correction"; + if($mtp2ErrCrct==0) + { + echo "Basic error correction"; + echo "Preventive cyclic retransmission"; + } + else + { + echo "Basic error correction"; + echo "Preventive cyclic retransmission"; + } + echo "
      "; + +?> + diff --git a/wxc2_omc/element/toElement/LACconf.php b/wxc2_omc/element/toElement/LACconf.php new file mode 100755 index 0000000..4ed64b9 --- /dev/null +++ b/wxc2_omc/element/toElement/LACconf.php @@ -0,0 +1,366 @@ + 0)?$TEST:0; +$objIdStr = '2.2.6'; +//value Type +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; + +$tmpArr = explode('-',$instanceNo); +$lac_inst = $tmpArr[0]; +$lac_value = $tmpArr[1]; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.paramConf'; + return($tableName); +} + +//----------------------- + +//=======================Get value From submit=================== + +if($set == 'Save') +{ + {//check if lac==0 or same lac. + if($LAC==0) + { + echo ""; + exit; + } + $oidstr = '2.2.6'; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr ORDER BY instanceNo + "; + $Result = mysqli_query($pubConn,$paramSql); + $n=0; + while($Row = mysqli_fetch_array($Result)) + { + $tempGp = hexdec(getBitValue($Row[initValue],'01.0-01.7')); + $tempFlag = hexdec(getBitValue($Row[initValue],'0.0-0.7')); + + if( $tempFlag == 1 && $trunkgp == $tempGp) + { + $LAC_value[$n] = hexdec(getBitValue($Row[initValue],'02.0-03.7')); + $LAC_inst[$n] = $Row[instanceNo]; + //$LAC_pageType[$n] = hexdec(getBitValue($Row[initValue],'4.0-4.7')); + $n++; + } + } + for($i=0; $i<$n; $i++) + { + if($LAC == $LAC_value[$i] && $lac_inst!=$LAC_inst[$i]) + { + echo ""; + exit; + break; + } + } + }//end check lac + if($lac_inst == 'new') + { + $objDb = omcGetObjDb($sysTypeNo); + $objWhereStr =getLevelWhere($objIdStr); + $paramTable = 'param_99'; + + $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND initValue LIKE '00%' + "; + $result=mysqli_query($pubConn,$getInstanceSql); + $row=mysqli_fetch_array($result); + + $row[initValue] = setBitValue($row[initValue],'0.0-0.7','01'); + if($DEBUG) echo "flag--->$row[initValue]
      "; + $tmp = dechex($LAC); + $tmp = omc_keep_length($tmp,0,4); + $row[initValue] = setBitValue($row[initValue],'02.0-03.7',$tmp); + $tempGp = dechex($trunkgp); + $tempGp = omc_keep_length($tempGp,0,2); + $row[initValue] = setBitValue($row[initValue],'01.0-01.7',$tempGp); + $tmpPageType = dechex($page_Type); + $tmpPageType = omc_keep_length($tmpPageType,0,2); + $row[initValue] = setBitValue($row[initValue],'4.0-4.7',$tmpPageType); + $row[initValue] = strtoupper($row[initValue]); + $updSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE $objWhereStr AND instanceNo = '$row[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + } + else + { + $objDb = omcGetObjDb($sysTypeNo); + $objWhereStr =getLevelWhere($objIdStr); + $paramTable = 'param_99'; + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo='$lac_inst' + "; + $result = mysqli_query($pubConn,$paramSql); + $row = mysqli_fetch_array($result); + $tmp = dechex($LAC); + $tmp = omc_keep_length($tmp,0,4); + $row[initValue] = setBitValue($row[initValue],'02.0-03.7',$tmp); + + $tmpPageType = dechex($page_Type); + $tmpPageType = omc_keep_length($tmpPageType,0,2); + $row[initValue] = setBitValue($row[initValue],'4.0-4.7',$tmpPageType); + + $row[initValue] = strtoupper($row[initValue]); + $updSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE $objWhereStr AND instanceNo = '$lac_inst' + "; + mysqli_query($pubConn,$updSql); + if($lac_value != $LAC ) + { + if($lac_value != 0)//update cell parameter(原来lac不为0,且lac改变时,则对应的cell中的lac值作相应改变) + { + $oidEmergency = '2.2.7'; + $EM_objWhereStr =getLevelWhere($oidEmergency); + $Em_paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $EM_objWhereStr "; + if($DEBUG) echo "$Em_paramSql
      "; + $Em_Result = mysqli_query($pubConn,$Em_paramSql); + while($Em_Row = mysqli_fetch_array($Em_Result)) + { + $lacValue=hexdec(getBitValue($Em_Row[initValue],'01.0-02.7')); + if($lacValue==$lac_value) + { + $tmp = dechex($LAC); + $tmp = omc_keep_length($tmp,0,4); + $Em_Row[initValue] = setBitValue($Em_Row[initValue],'01.0-02.7',$tmp); + $setValue = strtoupper($Em_Row[initValue]); + if($LAC==0)//如果设置lac为0,那么改变对应的cell为默认值 + { + $defSql = " SELECT initValue FROM paramConf WHERE $EM_objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $setValue = $defRow[initValue]; + } + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $EM_objWhereStr AND instanceNo = '$Em_Row[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + if($DEBUG) echo "$updSql
      "; + } + } + } + if($DEBUG) echo "$num -$LAC
      "; + } + + } + if($DEBUG) + { + echo "
      debug"; + } + else + {//return page + echo ""; + exit(); + } + +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +" > +"; +echo ""; +echo ""; + echo "Configuration > Network > BSC > LAC"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "  "; +echo ""; +echo ""; +echo "   "; +echo ""; +echo ""; +echo "

      $strBack"; +echo "

      "; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +if($lac_inst =='new'){ + echo ""; +}else{ + echo ""; +} +echo ""; + +echo ""; +echo ""; +$pageTypeArr=array( + 5 => 'by LAC', + 6 => 'in All Cell' + ); +echo ""; +echo ""; + +echo "
      ParametersValue
      LAC
      Page Type"; +echo ""; +echo "
      "; + +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "
      "; +?> + + diff --git a/wxc2_omc/element/toElement/PCRconf.php b/wxc2_omc/element/toElement/PCRconf.php new file mode 100755 index 0000000..b8b093e --- /dev/null +++ b/wxc2_omc/element/toElement/PCRconf.php @@ -0,0 +1,682 @@ + + + + +'2.1', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.3.1', 'sysid'=> $sysId, 'selectsysid'=>'-1') +); + +$oidsysarr=array( + array('oid'=>'2.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), //获得wxc2 dpc +); + +$SaveArr=array( + array('oidstr'=>'3.1', 'setvalue'=>'A5' ,'sysid'=> $sysId, 'selectsysid'=>'-1') +); + +$clockSourceArr = array( + array('value' => 0, 'name' => 'Lock E1-0'), + array('value' => 1, 'name' => 'Lock E1-1'), + array('value' => 2, 'name' => 'Lock E1-2'), + array('value' => 3, 'name' => 'Lock E1-3'), + array('value' => 4, 'name' => 'Lock E1-4'), + array('value' => 5, 'name' => 'Lock E1-5'), + array('value' => 6, 'name' => 'Lock E1-6'), + array('value' => 7, 'name' => 'Lock E1-7'), + + array('value' => 8, 'name' => 'Internal Clock') +); +$enableArr = array( + array('value' => 0, 'name' => 'N'), + array('value' => 1, 'name' => 'Y') +); + +$CRC4Arr = array( + array('value' => 0, 'name' => 'OFF'), + array('value' => 1, 'name' => 'ON') +); + +$NTLTArr = array( + array('value' => 0, 'name' => 'LT'), + array('value' => 1, 'name' => 'NT') +); +$E1T1Arr = array( + array('value' => 0, 'name' => 'E1'), + array('value' => 1, 'name' => 'T1') +); +$portTypeArr = array( + array('value' => 0, 'name' => 'SS7'), + array('value' => 1, 'name' => 'ANSI SS7'), + array('value' => 2, 'name' => 'ISDN'), + array('value' => 3, 'name' => 'China No.1'), + array('value' => 4, 'name' => 'Sri Lanka R2'), + array('value' => 5, 'name' => 'QSIG'), + array('value' => 6, 'name' => 'ANSI ISDN') +); + +$backoffArr = array( + array('value' => 0, 'name' => 'OFF'), + array('value' => 1, 'name' => 'ON') +); + +$circuitSlcArr = array( + 2 => 'Clockwise', + 3 => 'Counterclockwise' +); +$commandArr= array( + 90 => 'Reset', + 165 => 'Initialization', + 238 => 'No operation' +); +$groupArr = array( + 0 => '0', + 1 => '1', + 2 => '2', + 3 => '3' +); +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($clockSource_save)||isset($setSys)) + { + $tmp = $clockSource; + $tmp = dechex($tmp); + $tmp = omc_keep_length($tmp,'0',2); + $oidstr = "2.2.2"; + $objWhereStr = getLevelWhere($oidstr); + $updSql = "update $paramTab set initValue='$tmp' where $objWhereStr and subSysNo='$this_subSysNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + if(isset($command_save)||isset($setSys)) + { + $tmp = $command; + $tmp = dechex($tmp); + $tmp = omc_keep_length($tmp,'0',2); + $oidstr = "2.3.1"; + $objWhereStr = getLevelWhere($oidstr); + $updSql = "update $paramTab set initValue='$tmp' where $objWhereStr and subSysNo='$this_subSysNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + { + for($i=0;$i<8;$i++) + { + $setname=${"enable_save_$i"}; + if(isset($setname)) + { + for($j=7;$j>=0;$j--) + { + $bitValue=${"enable_$j"}; + if($j==7) + $setvalue = $bitValue; + else + $setValue .= $bitValue; + } + $setValue = bindec($setValue); + $setValue = strtoupper(dechex($setValue)); + $setValue = omc_keep_length($setValue,'0',2); + $oidstr = "2.2.1"; + $objWhereStr = getLevelWhere($oidstr); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$this_subSysNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + for($i=4;$i<8;$i++) + { + $setname=${"CRC4_save_$i"}; + if(isset($setname)) + { + for($j=7;$j>3;$j--) + { + $bitValue=${"CRC4_$j"}; + $setValue .= $bitValue; + } + $setValue .= '0000'; + $setValue = bindec($setValue); + $setValue = strtoupper(dechex($setValue)); + $setValue = omc_keep_length($setValue,'0',2); + + $oidstr = "2.2.3"; + $objWhereStr = getLevelWhere($oidstr); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$this_subSysNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + for($i=0;$i<8;$i++) + { + $setname=${"NTLT_save_$i"}; + if(isset($setname)) + { + for($j=7;$j>=0;$j--) + { + $bitValue=${"NTLT_$j"}; + if($j==7) + $setvalue = $bitValue; + else + $setValue .= $bitValue; + } + $setValue = bindec($setValue); + $setValue = strtoupper(dechex($setValue)); + $setValue = omc_keep_length($setValue,'0',2); + $oidstr = "2.1.1"; + $objWhereStr = getLevelWhere($oidstr); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$this_subSysNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + for($i=0;$i<8;$i++)//E1/T1 + { + $setname=${"E1T1_save_$i"}; + if(isset($setname)) + { + for($j=7;$j>=0;$j--) + { + $bitValue=${"E1T1_$j"}; + if($j==7) + $setvalue = $bitValue; + else + $setValue .= $bitValue; + } + $setValue = bindec($setValue); + $setValue = strtoupper(dechex($setValue)); + $setValue = omc_keep_length($setValue,'0',2); + $oidstr = "2.1.5"; + $objWhereStr = getLevelWhere($oidstr); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$this_subSysNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + for($i=0;$i<8;$i++) + { + $setname1=${"portType_save_$i"}; + $setname2=${"backoff_save_$i"}; + $setname3=${"circuitSlc_save_$i"}; + $setname4=${"group_save_$i"}; + if(isset($setname1)||isset($setname2)||isset($setname3)||isset($setname4)) + { + $oidstr = "2.1.2"; + $objWhereStr = getLevelWhere($oidstr); + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$this_subSysNo' and instanceNo='$i' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setValue = $row[initValue]; + + $tmp1 = ${"circuitSlc_$i"}; + $tmp2 = ${"backoff_$i"}; + $tmp3 = ${"portType_$i"}; + $tmp4 = ${"group_$i"}; + $tmp1 = omc_keep_length(decbin($tmp1),'0',2); + $tmp2 = omc_keep_length(decbin($tmp2),'0',1); + $tmp3 = omc_keep_length(decbin($tmp3),'0',3); + $tmp4 = omc_keep_length(decbin($tmp4),'0',2); + $setValue = $tmp4.$tmp3.$tmp2.$tmp1; + $setValue = bindec($setValue); + $setValue = strtoupper(dechex($setValue)); + $setValue = omc_keep_length($setValue,'0',2); + +// $setValue = setBitValue($setBitValue,'00.0-00.1',$tmp1); +// $setValue = setBitValue($setBitValue,'00.2-00.2',$tmp2); +// $setValue = setBitValue($setBitValue,'00.3-00.5',$tmp3); +// $setValue = setBitValue($setBitValue,'00.6-00.7',$tmp4); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$this_subSysNo' and instanceNo='$i' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + } + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + SetParam($oidsysarr0); + SetParam($oidsysarr); + + //SaveParam($SaveArr); + } + else + { + echo "
      Getting parameters
      "; + GetParam($oidsysarr0); + GetParam($oidsysarr); + } + } + echo ""; + exit(); +} + +if($setSys || $getSys || $undoSet) +{ + echo "

      Finished!

      "; + if($DEBUG) exit(); + echo ""; + exit(); +} + +{ + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + //echo "$strConfiguration > $strNetwork > PCR"; + echo "Configuration > Network > PCR"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$Spname"; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; + echo "
      "; + } +} +echo ""; + +{// Signaling/Traffic + {//DPC + $DPC_sysId = '222_99_99'; + + $DPC_sysIdArr = explode('_',$DPC_sysId); + $DPC_sysTypeNo = $DPC_sysIdArr[0]; + $DPC_sysNo = $DPC_sysIdArr[1]; + $DPC_subSysNo = $DPC_sysIdArr[2]; + + $DPC_oidstr = '2.4.1'; + $DPC_objWhereStr= ''; + $DPC_objWhereStr =getLevelWhere($DPC_oidstr); + $DPC_objDb = 'OBJ_'.$DPC_sysTypeNo; + $DPC_paramTable = 'param_'.$DPC_sysNo; + + $DPC_paramSql = " SELECT initValue,readValue,instanceNo FROM $DPC_paramTable + WHERE $DPC_objWhereStr AND instanceNo ='$linkset' + "; + if($DEBUG) echo "$DPC_paramSql
      "; + $DPC_Result = mysqli_query($pubConn,$DPC_paramSql); + $DPC_Row = mysqli_fetch_array($DPC_Result); + $linkset_DPC = hexdec(getBitValue($DPC_Row[initValue],'0.0-2.7')); + $NetID = bindec(getBitValue($DPC_Row[initValue],'3.0-3.1')); + } + + {//WXC2 OPC ************************ + $oidstr = '2.2'; + $aas_link_Db = 'OBJ_222'; + $aas_link_Table = 'param_99'; + + $subSysNo = 99; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $aas_link_Table + WHERE $objWhereStr AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + $aas_Result = mysqli_query($pubConn,$paramSql); + $aas_Row = mysqli_fetch_array($aas_Result); + + $NIbit = getBitValue($aas_Row[initValue],"0.$NetID"); + $tmp = $NetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $updSql = "SELECT initValue FROM $aas_link_Table + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + $Result = mysqli_query($pubConn,$updSql); + $Row = mysqli_fetch_array($Result); + $WXC2PC = hexdec($Row[initValue]); + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +/* + echo ""; + echo ""; + echo ""; + echo ""; +*/ +} + +$otherWhereStr = "and subSysNo=$this_subSysNo"; + +{//clock source + + {//show clockSource + echo ""; + echo ""; + echo ""; + echo ""; + } + + {//show COMMAND + echo ""; + echo ""; + echo ""; + echo ""; + } +} + +{ + $oidstr = "2.2.1"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$this_subSysNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $enableValue = $row[initValue]; + + $oidstr = "2.2.3"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$this_subSysNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $CRC4Value = $row[initValue]; + + $oidstr = "2.1.1"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$this_subSysNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $NTLTValue = $row[initValue]; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0; $i<8; $i++) + { + $oidstr = "2.1.2"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$this_subSysNo' and instanceNo='$i'"; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $CircuitValue = $row[initValue]; + $portType= bindec(getBitValue($CircuitValue,'00.3-00.5')); + $backoff = bindec(getBitValue($CircuitValue,'00.2-00.2')); + $circuitSlc = bindec(getBitValue($CircuitValue,'00.0-00.1')); + $group = bindec(getBitValue($CircuitValue,'00.6-00.7')); + echo ""; + echo ""; + {//Enable + echo ""; + } + + {//CRC4 + echo ""; + } + + {//port type + echo ""; + } + + {//back off + echo ""; + } + + {//circuit selection + echo ""; + } + + {//NT/LT + echo ""; + } + {//Group + echo ""; + } + echo ""; + echo ""; + } +} +echo "
      Signaling point code$linkset_DPC 
      NetWork indicator$NetIdConfArr[$NetID]"; + echo ""; + echo "
      WXC2 Point Code$WXC2PC"; + echo "
      Clock source"; + $oidStr = "2.2.2"; + $instanceNo = 0; + $doingOtherUlr=""; + showParameter($sysId,$oidStr,1,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + echo"
      Command"; + $oidStr = "2.3.1"; + $instanceNo = 0; + $doingOtherUlr=""; + showParameter($sysId,$oidStr,1,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + echo"
      E1E1#EnableCRC4Port typeBack offCircuit selectNT/LTGroupChannel
      $i"; + $oidStr = "2.2.1"; + $instanceNo = 0; + $doingOtherUlr=""; + $order = $i+1; + showParameter($sysId,$oidStr,$order,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + + echo ""; + $bitStr = "{0.$i-0.$i}"; + $CRC4[$i]=bindec(getBitValue($CRC4Value,$bitStr)); + if($i < 4)//后四个可以设置,前四个与8ke1板对应(默认为off => 0) + { + if($CRC4[$i] == 1) + { + $CRC4Value = setBitValue($CRC4Value,$bitStr,'0'); + $oidstr = "2.2.3"; + $objWhereStr = getLevelWhere($oidstr); + $updSql = "update $paramTab set initValue='$CRC4Value' where $objWhereStr and subSysNo='$this_subSysNo' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + if(0)echo "
      $updSql"; + } + echo "{$CRC4Arr[0][name]}"; + } + else + { + $oidStr = "2.2.3"; + $instanceNo = 0; + $doingOtherUlr=""; + $order = $i+1; + showParameter($sysId,$oidStr,$order,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + } + echo "
      "; + if(isset(${"portType_edit_$i"})) + { + echo ""; + echo ""; + } + else + { + echo ""; + echo "{$portTypeArr[$portType][name]}"; + } + echo""; + if($i < 4)//前四个与TG中的Backoff相反,设为on + { + echo ""; + echo "{$backoffArr[1][name]}"; + if($backoff!=1) + { + $oidstr = "2.1.2"; + $objWhereStr = getLevelWhere($oidstr); + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$this_subSysNo' and instanceNo='$i' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setValue = $row[initValue]; + $setValue = setBitValue($setValue,'00.2-00.2','1'); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$this_subSysNo' and instanceNo='$i' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + else + { + $oidStr = "2.1.2"; + $instanceNo = $i; + $doingOtherUlr=""; + $order = 2; + showParameter($sysId,$oidStr,$order,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + } + echo""; + if($i < 4)//前四个与TG中的circuit selection相反,设为3 + { + echo ""; + echo "{$circuitSlcArr[3]}"; + if($circuitSlc != 3) + { + $oidstr = "2.1.2"; + $objWhereStr = getLevelWhere($oidstr); + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$this_subSysNo' and instanceNo='$i' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setValue = $row[initValue]; + $setValue = setBitValue($setValue,'00.0-00.1','11'); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$this_subSysNo' and instanceNo='$i' "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + else + { + $oidStr = "2.1.2"; + $instanceNo = $i; + $doingOtherUlr=""; + $order = 1; + showParameter($sysId,$oidStr,$order,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + } + echo""; + $bitStr = "{0.$i-0.$i}"; + $NTLT[$i]=bindec(getBitValue($NTLTValue,$bitStr)); + if($i < 4) + { + echo ""; + echo "--"; + } + else + { + $oidStr = "2.1.1"; + $instanceNo = 0; + $doingOtherUlr=""; + $order = $i+1; + showParameter($sysId,$oidStr,$order,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + } + echo ""; + $oidStr = "2.1.2"; + $instanceNo = $i; + $doingOtherUlr=""; + $order = 4; + showParameter($sysId,$oidStr,$order,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + echo"Edit
      "; + +echo "
      "; + echo "Link to PCR"; + echo "
      "; +echo "
      "; +?> +
      + + diff --git a/wxc2_omc/element/toElement/SRFLanguage.php b/wxc2_omc/element/toElement/SRFLanguage.php new file mode 100755 index 0000000..4511dfe --- /dev/null +++ b/wxc2_omc/element/toElement/SRFLanguage.php @@ -0,0 +1,124 @@ + + + +ERROR!!:instanceNo == NULL
      "; + exit(0); +} + +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strConfiguration > $strNetwork > AAS"; +echo ""; +showHelp($helpId); +echo "
      "; +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      "; +echo "SRF announcement  "; +echo "language $instanceNo  "; +switch($instanceNo){ + case 0: + echo "(English)"; + break; + case 1: + echo "(French)"; + break; + case 2: + case 3: + case 4: + echo "(--)"; + break; + } +//echo ""; +//echo ""; +echo ""; +echo "

      $strBack"; +echo "

      "; + +?> + + + +"; +echo ""; + echo "No."; + echo "Announcement"; +echo ""; + +$path = "language0".$instanceNo."/"; +//echo "$objWhereStr
      "; + $selSql = " SELECT instance ,showfiled FROM aasAnnounce where name='SRF' order by instance"; + $Result = @mysqli_query($pubConn,$selSql); + $conut = mysqli_num_rows($Result); +$num = $startnum; +for($i=0; $i< $conut;$i++){ + + echo "$i"; + echo ""; + $Row = @mysqli_fetch_array($Result); + $num = $Row[instance]; + echo ""; + $fullpath =$path.$num; + echo ""; + echo ""; + echo ""; + echo "
      $Row[showfiled]PlayChangeDefault
      "; + $num++; +} + +echo " "; + + +?> + +
      + + diff --git a/wxc2_omc/element/toElement/VSSconf.php b/wxc2_omc/element/toElement/VSSconf.php new file mode 100755 index 0000000..b871944 --- /dev/null +++ b/wxc2_omc/element/toElement/VSSconf.php @@ -0,0 +1,1787 @@ +sql=$sql"; + $res=mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + //echo mysqli_error($pubConn); + + $due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); + $ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + + $hex_mes=$row[detailStat]; + $refresh_time=$row[updateTime]; + //echo $heatbeat_overtime; + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + $stt_e0 = 45+22; //E1 #0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) + $stt_e1 = 46+22; //E1 #1 status + $licenseByte = 58+22; + $licenseFlg = hexdec(substr($hex_mes,$licenseByte*2,2));//1:aas 2:vms 3:both + //echo "
      licenseFlg:$licenseFlg"; + //Field08 E1#0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) + for($i=0;$i<2;$i++) + { + $binSttE0=substr($bin_mes,$stt_e0*8+7-$i,1); + $sttE0[$i]=BinDec($binSttE0); + if($DEBUG)echo "
      sttE0[$i]=$sttE0[$i]"; + } + + if(!$sttE0[0]) + { + $sttE0[1] = 2; + } + + //Field09 E1#1 status + for($i=0;$i<2;$i++) + { + $binSttE1=substr($bin_mes,$stt_e1*8+7-$i,1); + $sttE1[$i]=BinDec($binSttE1); + if($DEBUG)echo "
      sttE1[$i]=$sttE1[$i]"; + } + + if(!$sttE1[0]) + { + $sttE1[1] = 2; + } +}//end get heartbeat +$aasDisable = $vmsDisable = 0; +if($licenseFlg == 3) +{ + $bothShow = 1; +} +else if($licenseFlg == 2) +{ + $setAAS = 1; + $setVMS = 0; + $vmsDisable = 1; +} +else if($licenseFlg == 1) +{ + $setVMS = 1; + $setAAS = 0; + $aasDisable = 1; +} +else +{ + $hideBoth=1; +} +if(!isset($setAAS)&&!isset($setVMS)) + $setAAS=1; +$backurl_un = "$PHP_SELF?trunkgp=$trunkgp&infoNo=$infoNo&linkset=$linkset&selectedSysId=$selectedSysId&setAAS=$setAAS&setVMS=$setVMS&slctLanguage=$slctLanguage"; +$selfurl = "$PHP_SELF?trunkgp=$trunkgp&infoNo=$infoNo&linkset=$linkset&selectedSysId=$selectedSysId&slctLanguage=$slctLanguage"; +$backurl = urlencode($backurl_un); +function goLastWeb() +{ + global $backurl_un; + global $scroll_y; + echo ""; + exit(); +} +$NetIdConfArr=array('International','International-S','National','National-S'); + +?> + + + + +"; +else + echo ""; + +$objDB = "OBJ_390"; +$paramTable = 'param_99'; + +$vms_sysId = "390_99_99"; +$vms_slctSysId = "390_" . $TypeNo . "_0"; + +$vms_mtp3_sysId = "222_8_" . $TypeNo; +$vms_mtp3_slctSysId = "-1"; + +$mtp3_sysId = "222_99_99"; +$mtp3_slctSysId = "-1"; + +$msc_sysId = "322_99_99"; +$msc_slctSysId = "-1"; + +$vms_sccp_sysId = "223_8_" . $TypeNo; +$vms_sccp_slctSysId = "-1"; + +$iptrans_sysId = "221_0_".$TypeNo; + +$vms_oidsysArr=array( + array('oid' => '2.1', 'sysid' => $vms_sysId, 'selectsysid' => $vms_slctSysId), + array('oid' => '2.2', 'sysid' => $vms_sysId, 'selectsysid' => $vms_slctSysId), + array('oid' => '2.3', 'sysid' => $vms_sysId, 'selectsysid' => $vms_slctSysId), + array('oid' => '2.4', 'sysid' => $vms_sysId, 'selectsysid' => $vms_slctSysId) +); + +$pub_oidsysArr=array( + array('oid'=>'2.2', 'sysid'=> $mtp3_sysId, 'selectsysid'=> $mtp3_slctSysId), + array('oid'=>'2.4.1', 'sysid'=> $mtp3_sysId, 'selectsysid'=> $mtp3_slctSysId), + array('oid'=>'2.3', 'sysid'=> $mtp3_sysId, 'selectsysid'=> $mtp3_slctSysId), //获得wxc2 dpc + + + array('oid'=>'2.1.1', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.2', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.3', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.4', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.6', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId) +); + +$mtp3_vms_oidsysArr=array( + array('oid'=>'2.2', 'sysid'=> $vms_mtp3_sysId, 'selectsysid'=> $vms_mtp3_slctSysId), + array('oid'=>'2.3', 'sysid'=> $vms_mtp3_sysId, 'selectsysid'=> $vms_mtp3_slctSysId), //vms dpc + array('oid'=>'2.4.1', 'sysid'=> $vms_mtp3_sysId, 'selectsysid'=> $vms_mtp3_slctSysId), //vms linkset + array('oid'=>'2.6', 'sysid'=> $vms_mtp3_sysId, 'selectsysid'=> $vms_mtp3_slctSysId), //vms route + + array('oid'=>'2.2', 'sysid'=> '223_99_99', 'selectsysid'=> '-1'), + array('oid'=>'2.1.8', 'sysid'=> $vms_sccp_sysId, 'selectsysid'=> $vms_sccp_slctSysId), + array('oid'=>'2.2', 'sysid'=> $vms_sccp_sysId, 'selectsysid'=> $vms_sccp_slctSysId), + +); + +$SaveArr=array( + array('oidstr'=>'3.1', 'setvalue'=>'01' ,'sysid'=> $vms_sysId, 'selectsysid'=> $vms_slctSysId), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=> $vms_mtp3_sysId, 'selectsysid'=> $vms_mtp3_slctSysId), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=> $vms_sccp_sysId, 'selectsysid'=> $vms_sccp_slctSysId), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=> '223_99_99', 'selectsysid'=>'-1'), + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=> '322_99_99', 'selectsysid'=>'-1'), +); +{//DPC + $DPC_sysId = '222_99_99'; + + $DPC_sysIdArr = explode('_',$DPC_sysId); + $DPC_sysTypeNo = $DPC_sysIdArr[0]; + $DPC_sysNo = $DPC_sysIdArr[1]; + $DPC_subSysNo = $DPC_sysIdArr[2]; + + $DPC_oidstr = '2.4.1'; + $DPC_objWhereStr= ''; + $DPC_objWhereStr =getLevelWhere($DPC_oidstr); + $DPC_objDb = 'OBJ_'.$DPC_sysTypeNo; + $DPC_paramTable = 'param_'.$DPC_sysNo; + + $DPC_paramSql = " SELECT initValue,readValue,instanceNo FROM $DPC_paramTable + WHERE $DPC_objWhereStr AND instanceNo ='$linkset' + "; + if($DEBUG) echo "$DPC_paramSql
      "; + $DPC_Result = mysqli_query($pubConn,$DPC_paramSql); + $DPC_Row = mysqli_fetch_array($DPC_Result); + $DPC= hexdec(getBitValue($DPC_Row[initValue],'0.0-2.7')); + $NetID = bindec(getBitValue($DPC_Row[initValue],'3.0-3.1')); +} + +if(isset($doingOtherFlag)) +{ + if($setPLMNServNo || $setPSTNServNo || $setLeaveMessNo||$setCheckMessNo) + { + $callType = 0;//normal + + $prefix_instance_no=updatePrefix($oldValue,$newValue,$callType,$trunkgp); + //=======================to set the cli type to IDD ========= + //=======================get the initValue ============ + $database="OBJ_322"; + $sql="select initValue from param_99 where level_1=2 and level_2=1 and level_3=2 and instanceNo='$prefix_instance_no' "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $old_initValue=$rows[initValue]; + $new_initValue=substr($old_initValue,0,35); + //set cli type to IDD + $new_initValue.="2"; + $new_initValue.=substr($old_initValue,36,4); + ////======= + $objDB="OBJ_322"; + $oidstr = "2.1.2"; + $objWhereStr = getLevelWhere($oidstr); + + $updSql = "update param_99 set initValue='$new_initValue' where $objWhereStr and instanceNo='$prefix_instance_no'"; + mysqli_query($pubConn,$updSql); + //======================================= + + $vms_tmpOidArr=array( + array('oid'=>'2.1.1', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.2', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.3', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid' => '2.2.1.1', 'sysid' => $vms_sysId, 'selectsysid' => '-1') + ); + SetParam($vms_tmpOidArr); + exit; + } + if(isset($setSCCP_MSISDN)) + { + {//set VMS SCCP 2.1.8 + $ipSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='390' AND sysNo='$TypeNo' AND subSysNo='0' + "; + $ipResult= mysqli_query($pubConn,$ipSql); + $Row=mysqli_fetch_array($ipResult); + + $IP = explode('.',$Row[ip]); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $VMS_ip = $IP[0].$IP[1].$IP[2].$IP[3]; + + $sysId = "223_8_" . $TypeNo; + $oidStr = '2.1.8'; + $otherWhereStr = "and subSysNo=$TypeNo"; + setParamValue($VMS_ip,$sysId,$oidStr,3,0,$otherWhereStr); + setParamValue($NetID,$sysId,$oidStr,1,0,$otherWhereStr); + }//end set VMS SCCP 2.1.8 + $SCCP_MSISDN = $newValue; + $SCCP_MSISDN_old = $oldValue; + {//set Dailing prefix + $callType = 0;//normal + $prefix_instance_no=updatePrefix($SCCP_MSISDN_old,$SCCP_MSISDN,$callType,$trunkgp); + //=======================to set the cli type to IDD ========= + //=======================get the initValue ============ + $database="OBJ_322"; + $sql="select initValue from param_99 where level_1=2 and level_2=1 and level_3=2 and instanceNo='$prefix_instance_no' "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $old_initValue=$rows[initValue]; + $new_initValue=substr($old_initValue,0,35); + //set cli type to IDD + $new_initValue.="2"; + $new_initValue.=substr($old_initValue,36,4); + ////======= + $objDB="OBJ_322"; + $oidstr = "2.1.2"; + $objWhereStr = getLevelWhere($oidstr); + + $updSql = "update param_99 set initValue='$new_initValue' where $objWhereStr and instanceNo='$prefix_instance_no'"; + mysqli_query($pubConn,$updSql); + //======================================= + + + + }//end set Dailing prefix + if($newValue===$oldValue) exit; + {//SCF-- GTT table param_99 + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_99'; + $tmpConf = 'paramConf'; + $oidstr = '2.2'; + $objWhereStr = getLevelWhere($oidstr); + $getSql="SELECT instanceNo,initValue FROM $tmpTable WHERE $objWhereStr AND initValue LIKE '01%' "; + if(0) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $haveSeted = 0; + while($rows =mysqli_fetch_array($result)) + { + $tmpStartSCCP_MSISDN = getBitValue($rows[initValue],'03.0-12.7'); + $tmpStartSCCP_MSISDN = str_replace('F','',$tmpStartSCCP_MSISDN); + + $tmpEndSCCP_MSISDN = getBitValue($rows[initValue],'13.0-22.7'); + $tmpEndSCCP_MSISDN = str_replace('F','',$tmpEndSCCP_MSISDN); + + $tmpNi = hexdec(getBitValue($rows[initValue],'23.0-23.7')); + $tmpDpc = hexdec(getBitValue($rows[initValue],'24.0-26.7')); + $tmpSSN = hexdec(getBitValue($rows[initValue],'27.0-27.7')); + if(strcmp($tmpStartSCCP_MSISDN,$SCCP_MSISDN_old)==0 + && strcmp($tmpStartSCCP_MSISDN,$tmpEndSCCP_MSISDN)==0 && $tmpSSN == 0) + { + //echo "
      $tmpStartSCCP_MSISDN
      $SCCP_MSISDN_old"; + $tmpInstanceNo = $rows[instanceNo]; + $haveSeted = 1; + break; + } + //echo "
      $tmpStartSCCP_MSISDN
      $SCCP_MSISDN_old
      "; + } + //exit; + if($haveSeted) + { + $setInstNo = $tmpInstanceNo; + } + else + { + $getSql="SELECT instanceNo,initValue FROM $tmpTable WHERE $objWhereStr AND initValue LIKE '00%' "; + if(0) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + $setInstNo = $rows[instanceNo]; + } + $niTypeArr = getNiType(); + if($niTypeArr[$NetID]==0)//ITU + { + $TT = '00'; + $NP = '01'; + } + else + { + $TT = '0E'; + $NP = '00'; + } + if(strlen($SCCP_MSISDN)==0) + { + $rows[initValue] = "000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000FFFFFFFFFFFFFFFFFFFF"; + } + else + { + $rows[initValue] = setBitValue($rows[initValue],'0.0-0.7','01');//flag + $rows[initValue] = setBitValue($rows[initValue],'01.0-01.7',$NP);//SCCP_MSISDN + $rows[initValue] = setBitValue($rows[initValue],'02.0-02.7',$TT);//SCCP_MSISDN + $tmp = omc_keep_length($SCCP_MSISDN,'F',20,0); + $rows[initValue] = setBitValue($rows[initValue],'03.0-12.7',$tmp);// + $rows[initValue] = setBitValue($rows[initValue],'13.0-22.7',$tmp);// + $tmp = omc_keep_length($NetID,'0',2); + $rows[initValue] = setBitValue($rows[initValue],'23.0-23.7',$tmp);//NI + $tmp = omc_keep_length(dechex($DPC),'0',6); + $rows[initValue] = setBitValue($rows[initValue],'24.0-26.7',$tmp);//DPC WXC2sp + $tmp = omc_keep_length(dechex(0),'0',2); + $rows[initValue] = setBitValue($rows[initValue],'27.0-27.7',$tmp);//SSN=0 + $tmp = omc_keep_length(dechex(7),'0',2); + $rows[initValue] = setBitValue($rows[initValue],'29.0-29.7',$tmp);//Address indicator + } + $rows[initValue] = strtoupper($rows[initValue]); + //echo "
      rows[initValue]:{$rows[initValue]}"; + $updflag = "UPDATE $tmpTable SET initValue = '$rows[initValue]' + WHERE $objWhereStr and instanceNo='$setInstNo' + "; + if(0) echo "
      $updflag
      "; + //exit; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + + {//set gtt attribution from 2.4 + $selSql = "select initValue from $tmpTable where level_1='2' and level_2='4' and instanceNo='$instanceNo'"; + $Result = mysqli_query($pubConn,$selSql); + $Row = mysqli_fetch_array($Result); + $setValue = $Row[initValue]; + $eleName = $Spname; + $tmpEleName = omc_keep_length(toHex($eleName),"0",20,"0"); + + $setValue = setBitValue($setValue,'3.0-12.7',$tmpEleName); + + $updSql = "update $tmpTable set initValue = '$setValue' where level_1='2' and level_2='4' and instanceNo='$setInstNo'"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + }//end set gtt attribution form 2.4 + }//end gtt table. + + $vms_tmpOidArr=array( + array('oid'=>'2.1.1', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.2', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.3', 'sysid'=> $msc_sysId, 'selectsysid'=> $msc_slctSysId), + array('oid'=>'2.1.8', 'sysid'=> $vms_sccp_sysId, 'selectsysid'=> $vms_sccp_slctSysId) + ); + SetParam($vms_tmpOidArr); + + $sccpSaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'02', 'sysid'=> $vms_sccp_sysId, 'selectsysid'=> $vms_sccp_slctSysId) + ); + SaveParam($sccpSaveArr); + $sccpResetArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'00', 'sysid'=> $vms_sccp_sysId, 'selectsysid'=> $vms_sccp_slctSysId) + ); + SaveParam($sccpResetArr); + + exit; + }//end if(isset($SCCP_MSISDN_save)) +}// + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + {//Signaling/Traffic + if(isset($LicenseCtl_save)) + { + $tmp = "LicenseCtl"; + $tmp = ${$tmp}; + $tmp = omc_keep_length($tmp,'0',16); + $oidstr = "2.5"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr and instanceNo='$TypeNo'"; + + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + $tmp_vms_oidsysArr=array( + array('oid' => '2.5', 'sysid' => $vms_sysId, 'selectsysid' => $vms_slctSysId), + ); + SetParam($tmp_vms_oidsysArr); + $i=0; + while(1) + { + echo ""; + flush(); + sleep(1); + $i++; + if($i>10) + break; + } + goLastWeb(); + } + } + if($setVMS==1) + { + //Basic Parameters + { + if(isset($SMSC_port_save) + ||isset($SMSC0_ip_save) + ||isset($SMSC1_ip_save) + ||isset($setSys)) + { + $oidstr = "2.2.1.6"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $setValue=$row[0]; + + $tmp = dechex($SMSC_port); + $tmp = omc_keep_length($tmp,'0',4); + $setValue = setBitValue($setValue,'00.0-01.7',$tmp); + + $IP = explode('.',$SMSC0_ip); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $tmp = $IP[0].$IP[1].$IP[2].$IP[3]; + $setValue = setBitValue($setValue,'02.0-05.7',$tmp); + + $IP = explode('.',$SMSC1_ip); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $tmp = $IP[0].$IP[1].$IP[2].$IP[3]; + $setValue = setBitValue($setValue,'06.0-09.7',$tmp); + + $updflag = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(!isset($setSys)) + goLastWeb(); + } + + if(isset($PPS0_ip_save)||isset($PPS1_ip_save)||isset($setSys)) + { + $oidstr = "2.2.1.7"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $setValue=$row[0]; + + $IP = explode('.',$PPS0_ip); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $tmp = $IP[0].$IP[1].$IP[2].$IP[3]; + $setValue = setBitValue($setValue,'02.0-05.7',$tmp); + + $IP = explode('.',$PPS1_ip); + $IP[0] = omc_keep_length(dechex($IP[0]),"0","2"); + $IP[1] = omc_keep_length(dechex($IP[1]),"0","2"); + $IP[2] = omc_keep_length(dechex($IP[2]),"0","2"); + $IP[3] = omc_keep_length(dechex($IP[3]),"0","2"); + $tmp = $IP[0].$IP[1].$IP[2].$IP[3]; + $setValue = setBitValue($setValue,'06.0-09.7',$tmp); + + $updflag = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + if(!isset($setSys)) + goLastWeb(); + } + } + } + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + SetParam($vms_oidsysArr); + SetParam($pub_oidsysArr); + SetParam($mtp3_vms_oidsysArr); + + SaveParam($SaveArr); + } + else + { + echo "
      Getting parameters
      "; + GetParam($vms_oidsysArr); + GetParam($mtp3_vms_oidsysArr); + } + } +} +if($setSys || $getSys || $undoSet) +{ + echo "

      Finished!

      "; + if($DEBUG) exit(); + goLastWeb(); +} + + +echo "
      "; + +{//show head part + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + //echo "$strConfiguration > $strNetwork > VMS"; + echo "Configuration > Network > VSS"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + //checkDevices(390); + + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "VSS System  $Spname"; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; + echo "
      "; + } +} +if($hideBoth == 1) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Input License Please: "; + echo " "; + echo ""; + echo "
      "; + exit; +} +{//get parameters + + + {//WXC2 OPC + $oidstr = '2.2'; + $vms_link_Db = 'OBJ_222'; + $vms_link_Table = 'param_99'; + + $subSysNo = 99; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $vms_link_Table + WHERE $objWhereStr AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + $vms_Result = mysqli_query($pubConn,$paramSql); + $vms_Row = mysqli_fetch_array($vms_Result); + + $NIbit = getBitValue($vms_Row[initValue],"0.$NetID"); + $tmp = $NetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $updSql = "SELECT initValue FROM $vms_link_Table + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + $Result = mysqli_query($pubConn,$updSql); + $Row = mysqli_fetch_array($Result); + $WXC2OPC = hexdec($Row[initValue]); + } + + {//MG IP + $oidstr = "2.1.6"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr order by instanceNo"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $mgIp = getBitValue($row[0],'0.0-3.7'); + for($i=0; $i<4; $i++) + { + $tmp = hexdec(substr($mgIp,$i*2,2)); + $mgIp_0 .= $tmp . '.'; + } + $mgIp_0 = rtrim($mgIp_0,'.'); + + $row = @mysqli_fetch_array($result); + $mgIp = getBitValue($row[0],'0.0-3.7'); + for($i=0; $i<4; $i++) + { + $tmp = hexdec(substr($mgIp,$i*2,2)); + $mgIp_1 .= $tmp . '.'; + } + $mgIp_1 = rtrim($mgIp_1,'.'); + } + {//SMSC address + $oidstr = "2.2.1.6"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + //SMSC_port + $SMSC_port = hexdec(getBitValue($row[0],'0.0-1.7')); + //SMSC0 IP + $hexip = getBitValue($row[0],'2.0-5.7'); + $ip[0]=hexdec(getBitValue($hexip,"0.0-0.7")); + $ip[1]=hexdec(getBitValue($hexip,"1.0-1.7")); + $ip[2]=hexdec(getBitValue($hexip,"2.0-2.7")); + $ip[3]=hexdec(getBitValue($hexip,"3.0-3.7")); + $SMSC0_ip = $ip[0] . "." . $ip[1] . "." . $ip[2] . "." . $ip[3]; + //SMSC1 IP + $hexip = getBitValue($row[0],'6.0-9.7'); + $ip[0]=hexdec(getBitValue($hexip,"0.0-0.7")); + $ip[1]=hexdec(getBitValue($hexip,"1.0-1.7")); + $ip[2]=hexdec(getBitValue($hexip,"2.0-2.7")); + $ip[3]=hexdec(getBitValue($hexip,"3.0-3.7")); + $SMSC1_ip = $ip[0] . "." . $ip[1] . "." . $ip[2] . "." . $ip[3]; + } + + {//PPS address + $oidstr = "2.2.1.7"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + + //PPS0 IP + $hexip = getBitValue($row[0],'2.0-5.7'); + $ip[0]=hexdec(getBitValue($hexip,"0.0-0.7")); + $ip[1]=hexdec(getBitValue($hexip,"1.0-1.7")); + $ip[2]=hexdec(getBitValue($hexip,"2.0-2.7")); + $ip[3]=hexdec(getBitValue($hexip,"3.0-3.7")); + $PPS0_ip = $ip[0] . "." . $ip[1] . "." . $ip[2] . "." . $ip[3]; + //PPS1 IP + $hexip = getBitValue($row[0],'6.0-9.7'); + $ip[0]=hexdec(getBitValue($hexip,"0.0-0.7")); + $ip[1]=hexdec(getBitValue($hexip,"1.0-1.7")); + $ip[2]=hexdec(getBitValue($hexip,"2.0-2.7")); + $ip[3]=hexdec(getBitValue($hexip,"3.0-3.7")); + $PPS1_ip = $ip[0] . "." . $ip[1] . "." . $ip[2] . "." . $ip[3]; + } + + {//Link0 type + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $link0_type = hexdec($row[initValue]); + } + {//Link1 type + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $link1_type = hexdec($row[initValue]); + } + {//encode_rule0 + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $encode_rule0 = hexdec($row[initValue]); + } + {//encode_rule1 + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $encode_rule1 = hexdec($row[initValue]); + } + {//ISUP_TYPE_LK0 + $oidstr = "2.1.10"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $ISUP_TYPE_LK0 = hexdec($row[initValue]); + } + {//ISUP_TYPE_LK1 + $oidstr = "2.1.10"; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $paramTable + where $objWhereStr"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $ISUP_TYPE_LK1 = hexdec($row[initValue]); + } + {//SCCP 2.1.8 MSISDN + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_8'; + $oidstr = '2.1.8'; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $tmpTable + where $objWhereStr"; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $SCCP_MSISDN_value = getBitValue($row[0],"01.0-10.7"); + $SCCP_MSISDN_value = str_replace('F','',$SCCP_MSISDN_value); + echo ""; + } + {//SCCP SCF --- MSISDN(SCF_num) arwean + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_99'; + $oidstr = '2.1.147'; + $objWhereStr = getLevelWhere($oidstr); + $getsql = "select initValue from $tmpTable + where $objWhereStr + "; + $result = @mysqli_query($pubConn,$getsql); + $row = @mysqli_fetch_array($result); + $SCF_num = getBitValue($row[initValue],"01.0-10.7"); + $SCF_num = str_replace('F','',$SCF_num); + echo ""; + } + + {//link0 status + + $vmsLink0_status=$sttE0[1]; + $vmsLink1_status=$sttE1[1]; + if($vmsLink0_status==1) + $color_vmsLink0_stat='blue'; + elseif($vmsLink0_status==0) + $color_vmsLink0_stat='red'; + + if($vmsLink1_status==1) + $color_vmsLink1_stat='blue'; + elseif($vmsLink1_status==0) + $color_vmsLink1_stat='red'; + } +}//end get parameters + +$linkStaArr=array("N","Y","--"); +if($setAAS==1) + $bcAAS = '#E6E6E6'; +else + $bcAAS = ''; +if($setVMS==1) + $bcVMS = '#E6E6E6'; +else + $bcVMS = ''; +echo ""; + echo ""; + if($aasDisable != 1) + { + echo ""; + } + if($vmsDisable != 1) + { + echo ""; + } + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "AAS Service"; + echo ""; + echo "VMS Service"; + echo "
      "; +echo ""; +{//Signaling/Traffic +echo " "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + {//network number + echo ""; + echo ""; + echo ""; + echo ""; + }//end network number + + {//star link + echo ""; + echo ""; + echo ""; + }//end link + if($licenseFlg==2) $licenseStr = 'AAS'; + else if($licenseFlg==1) $licenseStr = 'VMS'; + else if($licenseFlg==3) $licenseStr = 'AAS and VMS'; + else $licenseStr = 'Error'; + echo ""; + echo ""; + echo ""; + echo ""; + + +echo "
      Signaling/Traffic
      Signaling Point Code$DPC
      Network Indicator$NetIdConfArr[$NetID]"; + echo ""; + echo "
      Network Number"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($setAAS) + { + echo ""; + echo ""; + } + if($setVMS) + { +// echo ""; +// echo ""; + echo ""; + } + echo "
      CC:"; + $sysId="390_99_99"; + $oidStr = "2.1.3"; + showParameter($sysId,$oidStr,1,1); + + echo "NDC:"; + $oidStr = "2.1.4"; + showParameter($sysId,$oidStr,1,1); + echo "
      MSISDN(SCCP):"; + $sysId="223_8_" . $TypeNo; + $oidStr = "2.1.8"; + $instanceNo = 0; + $otherWhereStr = "and subSysNo=$TypeNo"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setSCCP_MSISDN=1&infoNo=$infoNo&linkset=$linkset&trunkgp=$trunkgp"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr,$otherWhereStr); + echo "MSISDN(local):$local_MSISDN
      Link"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + $i=0; + $mgIpName = "mgIp_".$i; + $mgIp = $$mgIpName; + echo ""; + $linkStateId = "link".$i."_state"; + $colorState = ${"color_vmsLink".$i."_stat"}; + $vmsLinkState = ${"vmsLink".$i."_status"}; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + $i=1; + $mgIpName = "mgIp_".$i; + $mgIp = $$mgIpName; + echo ""; + $linkStateId = "link".$i."_state"; + $colorState = ${"color_vmsLink".$i."_stat"}; + $vmsLinkState = ${"vmsLink".$i."_status"}; + echo ""; + + echo ""; + + echo "
      NoE1/T1ITU/ANSIA/MU LAWCICMG IPStatus
      0"; + $sysId="390_99_99"; + $oidStr = "2.1.8"; + showParameter($sysId,$oidStr,1,1); + echo""; + $oidStr = "2.1.10"; + showParameter($sysId,$oidStr,1,1); + echo ""; + $oidStr = "2.1.9"; + showParameter($sysId,$oidStr,1,1); + echo""; + $oidStr = "2.1.7"; + showParameter($sysId,$oidStr,1,1); + echo "$mgIp{$linkStaArr[$vmsLinkState]}
      1"; + $oidStr = "2.1.7"; + showParameter($sysId,$oidStr,2,1); + echo "$mgIp{$linkStaArr[$vmsLinkState]}
      License Control"; + if(isset($LicenseCtl_edit)) + { + echo " "; + echo ""; + } + else + { + echo "$licenseStr"; + } + echo "
      "; +} +echo "
      "; +if($setVMS) +{//Basic Parameters +echo " "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      Basic Parameters
      VMS Number"; + {//show VMS Number + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      MSISDN:"; + $sysId = "390_99_99"; + $oidStr = "2.2.1.1"; + $instanceNo=$TypeNo; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo "
      Service No. PLMN:"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setPLMNServNo=1&trunkgp=$trunkgp"; + showParameter($sysId,$oidStr,2,1,$instanceNo,$doingOtherUlr); + echo "Service No. PSTN:"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setPSTNServNo=1&trunkgp=$trunkgp"; + showParameter($sysId,$oidStr,3,1,$instanceNo,$doingOtherUlr); + echo "
      Leave message:"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setLeaveMessNo=1&trunkgp=$trunkgp"; + showParameter($sysId,$oidStr,4,1,$instanceNo,$doingOtherUlr); + echo "Check message:"; + $doingOtherUlr="$PHP_SELF?doingOtherFlag=1&setCheckMessNo=1&trunkgp=$trunkgp"; + showParameter($sysId,$oidStr,5,1,$instanceNo,$doingOtherUlr); + echo "
      SMPP Parameter"; + {//show ESME Parameter + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      SMPP ID:"; + $sysId = "390_99_99"; + $oidStr = "2.2.1.2"; + $instanceNo=$TypeNo; + showParameter($sysId,$oidStr,1,3,$instanceNo); + echo "SMPP type:"; + $sysId = "390_99_99"; + $oidStr = "2.2.1.4"; + $instanceNo=$TypeNo; + showParameter($sysId,$oidStr,1,3,$instanceNo); + echo "
      SMPP password:"; + $sysId = "390_99_99"; + $oidStr = "2.2.1.3"; + $instanceNo=$TypeNo; + showParameter($sysId,$oidStr,1,3,$instanceNo); + echo "
      SMSC Address"; + {//show SMSC address + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + } + echo "
      SMPP port:"; + if(isset($SMSC_port_edit)) + { + echo " "; + echo ""; + } + else + { + echo ""; + if($SMSC_port ==='') + $SMSC_port ='--'; + echo "$SMSC_port"; + } + echo "
      SMSC0 IP:"; + if(isset($SMSC0_ip_edit)) + { + echo " "; + echo ""; + } + else + { + echo ""; + if($SMSC0_ip =='...') + $SMSC0_ip ='--'; + echo "$SMSC0_ip"; + } + echo "SMSC1 IP:"; + if(isset($SMSC1_ip_edit)) + { + echo " "; + echo ""; + } + else + { + echo ""; + if($SMSC1_ip =='...') + $SMSC1_ip ='--'; + echo "$SMSC1_ip"; + } + echo "
      PPS Address"; + {//show PPS address + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + } + echo "
      PPS0 IP:"; + + if(isset($PPS0_ip_edit)) + { + echo " "; + echo ""; + } + else + { + echo ""; + if($PPS0_ip =='') + $PPS0_ip ='--'; + echo "$PPS0_ip"; + } + echo "PPS1 IP:"; + if(isset($PPS1_ip_edit)) + { + echo " "; + echo ""; + } + else + { + echo ""; + if($PPS1_ip =='') + $PPS1_ip ='--'; + echo "$PPS1_ip"; + } + echo "
      Prefix"; + {//show Prefix + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      International:"; + $sysId = "390_99_99"; + $oidStr = "2.2.1.5"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo "National:"; + showParameter($sysId,$oidStr,2,1,$instanceNo); + echo "
      Number modification"; + {//show Number modification + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + } + echo "
      Greeting:"; + $sysId = "390_99_99"; + $oidStr = "2.2.1.9"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo "Ringback Calling:"; + $sysId = "390_99_99"; + $oidStr = "2.2.1.10"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo "
      SMS:"; + for($i=0; $i<32; $i++) + { + echo "$i"; + echo " "; + } + echo "
      "; + +echo "
      "; +} +if($setVMS) +{//Mailbox preferences +echo " "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + {//show play mode + echo ""; + } + echo ""; + +echo "
      Mailbox Preferences
      Length"; + {//show Length + $w1 = '20%'; + $w2 = '30%'; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      Min. voicemail length:"; + $sysId = "390_99_99"; + $oidStr = "2.2.2.1"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo "Max. voicemail length:"; + $sysId = "390_99_99"; + $oidStr = "2.2.2.2"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo "
      Validity"; + {//show Validity + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      New voicemail validity:"; + $sysId = "390_99_99"; + $oidStr = "2.2.2.3"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo " DaysOld voicemail validity:"; + echo "
      Digit Collection"; + {//show Digit collection + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      Password retry times:"; + $sysId = "390_99_99"; + $oidStr = "2.2.2.5"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo " TimesKey-press timeout:"; + showParameter($sysId,$oidStr,2,1,$instanceNo); + echo " Seconds
      Circuit"; + {//show Circuit + echo ""; + echo ""; + + echo ""; + echo ""; + } + echo "
      Circuit selection:Clockwise"; + echo "Circuit delay:"; + $sysId = "390_99_99"; + $oidStr = "2.2.2.7"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo "
      Play Mode "; + $sysId = "390_99_99"; + $oidStr = "2.2.2.4"; + $instanceNo=0; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo "
      "; +echo "
      "; +} +$languageArr=array("Language 0","Language 1","Language 2","Language 3","Language 4"); +if($setVMS) +{//Short message notification +//$languageArr=array("English","French","Chinese","Russian","Spanish"); +echo " "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + {//show New Message + echo ""; + echo ""; + echo ""; + } + echo ""; + + echo ""; + echo ""; + {//show Unanswered call - CLI + echo ""; + echo ""; + echo ""; + } + echo ""; + + echo ""; + echo ""; + {//show Full mailbox + echo ""; + echo ""; + echo ""; + } + echo ""; + + echo ""; + echo ""; + {//show Unanswered call – no CLI + echo ""; + echo ""; + echo ""; + } + echo ""; +echo "
      Short Message Notification"; + echo " (Laguage:"; + echo ")"; + echo "
       CodingShort Message ContentsCalling Number Prompt
      New Message"; + $sysId = "390_99_99"; + $oidStr = "2.2.3.1"; + $instanceNo=$slctLanguage; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo ""; + showParameter($sysId,$oidStr,2,3,$instanceNo); + echo ""; + showParameter($sysId,$oidStr,3,3,$instanceNo); + echo "
      Unanswered Call - CLI";$sysId = "390_99_99"; + $oidStr = "2.2.3.2"; + $instanceNo=$slctLanguage; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo ""; + showParameter($sysId,$oidStr,2,3,$instanceNo); + echo ""; + showParameter($sysId,$oidStr,3,3,$instanceNo); + echo "
      Full Mailbox";$sysId = "390_99_99"; + $oidStr = "2.2.3.3"; + $instanceNo=$slctLanguage; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo ""; + showParameter($sysId,$oidStr,2,3,$instanceNo); + echo ""; + showParameter($sysId,$oidStr,3,3,$instanceNo); + echo "
      Unanswered call – no CLI";$sysId = "390_99_99"; + $oidStr = "2.2.3.4"; + $instanceNo=$slctLanguage; + showParameter($sysId,$oidStr,1,1,$instanceNo); + echo ""; + showParameter($sysId,$oidStr,2,3,$instanceNo); + echo ""; + echo "--"; + echo "
      "; +echo "
      "; +} + +{//Announcement play and update +if($setAAS) +{ + $tableName = 'aasAnnounce'; + $wName = 'AAS'; +} +else +{ + $tableName = 'vmsAnnounce'; + $wName = 'VMS'; +} +echo " "; + //$languageArr=array("English","French","Chinese","Russian","Spanish"); + $selSql = " SELECT instance,languageNum,showfiled FROM $tableName where name ='$wName' and showfiled !='' order by instance"; + $Result = @mysqli_query($pubConn,$selSql); + $announceNum=@mysqli_num_rows($Result); + + $selSql = " SELECT showfiled FROM $tableName where name ='languageNum'"; + $lan_re = @mysqli_query($pubConn,$selSql); + $lan_row = @mysqli_fetch_array($lan_re); + + echo ""; +if($setAAS) +{ + + echo ""; + echo ""; + echo ""; + echo ""; +} + echo ""; + // + if($setVMS==1) + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($num=0;$num< $announceNum;$num++) + { + echo ""; + echo ""; + $Row = @mysqli_fetch_array($Result); + $fileno = $Row[instance]; + $fileno = omc_keep_length($Row[instance],0,3); + echo ""; + + echo ""; + + echo ""; + echo ""; + } +echo "
      $wName Announcement"; + echo " (Laguage:"; + echo ")"; + echo "
      Repetition Counter "; + $sysId = "390_99_99"; + $oidStr = "2.4.2"; + showParameter($sysId,$oidStr,1,1); + echo "
      Leave Message
      Announcement
      Call Unattainable
      Announcement
      No.AnnouncementPlayUpdate
      $num$Row[showfiled]"; + $path = "language0".$slctLanguage."/"; + $fullpath =$path.$fileno; + $tmpSysId='390_'.$sysNo.'_0'; + echo "play "; + echo ""; + $path = "language0".$slctLanguage."/"; + $fullpath =$path.$fileno; + echo "upload "; + echo "
      "; +} +echo "
      "; + echo "VSS -> MSS"; + echo "
      "; +echo "
      "; + +{//update vms param + $otherWhereStr = "and subSysNo=$TypeNo"; + if($setAAS) + {//add BB prefix for aas + $tmp = omc_keep_length('BB','F',16,0); + $tmp = strtoupper($tmp); + $oidstr = "2.4.1"; + $objWhereStr = getLevelWhere($oidstr); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr + "; + if(0) echo "objDB,$objDB,$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + + //aas0 添加prefix + //====change the BB prefix callType to Emergency + $callType = 1; + if($TypeNo==0) + updatePrefix('BB','BB',$callType,$trunkgp); + } + if($setAAS) + {//SCF-- GTT table (arwean 060224) + $sccp_objDB = 'OBJ_223'; + $tmpTable = 'param_8'; + $oidstr = '2.2'; + $objWhereStr = getLevelWhere($oidstr); + $getSql="SELECT initValue + FROM $tmpTable + WHERE $objWhereStr $otherWhereStr AND instanceNo='0' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + + $niTypeArr = getNiType(); + if($niTypeArr[$NetID]==0)//ITU + { + $TT = '00'; + $NP = '01'; + } + else + { + $TT = '0E'; + $NP = '00'; + } + $rows[initValue] = setBitValue($rows[initValue],'0.0-0.7','01');//flag + $rows[initValue] = setBitValue($rows[initValue],'01.0-01.7',$NP); + $rows[initValue] = setBitValue($rows[initValue],'02.0-02.7',$TT); + $tmp = omc_keep_length($SCF_num,'F',20,0); + $rows[initValue] = setBitValue($rows[initValue],'03.0-12.7',$tmp);//SCF number + $rows[initValue] = setBitValue($rows[initValue],'13.0-22.7',$tmp);//SCF number + $tmp = omc_keep_length($NetID,'0',2); + $rows[initValue] = setBitValue($rows[initValue],'23.0-23.7',$tmp);//NI + $tmp = omc_keep_length(dechex($WXC2OPC),'0',6); + $rows[initValue] = setBitValue($rows[initValue],'24.0-26.7',$tmp);//DPC WXC2sp + $tmp = dechex(147); + $rows[initValue] = setBitValue($rows[initValue],'27.0-27.7',$tmp);//SSN=147 + $rows[initValue] = setBitValue($rows[initValue],'29.0-29.7','07');//Address indicator + $rows[initValue] = strtoupper($rows[initValue]); + + $updflag = "UPDATE $tmpTable SET initValue = '$rows[initValue]' + WHERE $objWhereStr $otherWhereStr AND instanceNo='0' + "; + if($DEBUG) echo "
      updflag:: $updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + } + + if(1)//修改VMS_mtp3 OPC DPC NI Route (arwean 060309) + { + $link_Db = 'OBJ_222'; + $link_pub_Table = 'param_99'; + $oidstr = '2.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $link_pub_Table + WHERE $objWhereStr + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + $link_vms_Table = 'param_8'; + $updSql = "UPDATE $link_vms_Table SET initValue = '$Row[initValue]' + WHERE $objWhereStr $otherWhereStr AND instanceNo = '0' + "; + mysqli_query($pubConn,$updSql); + + $NIoffset = array("0.0-0.0","0.1-0.1","0.2-0.2","0.3-0.3"); + $NI_bit = getBitValue($vms_Row[initValue],$NIoffset[$NetID]); + $tmp = $NetID+1+$NI_bit*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $set_OPC = dechex($DPC); + $set_OPC = omc_keep_length($set_OPC,0,6); + $set_OPC = strtoupper($set_OPC); + $updSql = "UPDATE $link_vms_Table SET initValue = '$set_OPC' + WHERE $objWhereStr $otherWhereStr + "; + if($DEBUG) echo "$updSql
      "; + mysqli_query($pubConn,$updSql); + + //VMS_8_pub--Linkset $TypeNo: + $oidstr = '2.4.1'; + $objWhereStr = getLevelWhere($oidstr); + $getSql="SELECT initValue + FROM $link_vms_Table + WHERE $objWhereStr $otherWhereStr AND instanceNo='$TypeNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + + $tmp = omc_keep_length(dechex($WXC2OPC),'0',6); + $rows[initValue] = setBitValue($rows[initValue],'0.0-2.7',$tmp);//DPC + + $tmp = omc_keep_length(decbin($NetID),'0',2); + $rows[initValue] = setBitValue($rows[initValue],'3.0-3.1',$tmp);//NI + + $rows[initValue] = strtoupper($rows[initValue]); + + $updflag = "UPDATE $link_vms_Table SET initValue = '$rows[initValue]' + WHERE $objWhereStr $otherWhereStr AND instanceNo='$TypeNo' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + //VMS_8_pub--route + $tmp=$NetID+1; + $oidstr = '2.6.'.$tmp; + $objWhereStr = getLevelWhere($oidstr); + $getSql="SELECT initValue + FROM $link_vms_Table + WHERE $objWhereStr $otherWhereStr AND instanceNo='$TypeNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + $rows =mysqli_fetch_array($result); + + $tmp = omc_keep_length(dechex($WXC2OPC),'0',6); + $rows[initValue] = setBitValue($rows[initValue],'0.0-2.7',$tmp); //DPC + $rows[initValue] = setBitValue($rows[initValue],'3.0-3.7','00'); //Normal linkset + $rows[initValue] = setBitValue($rows[initValue],'4.0-4.7','00'); //Alternative linkset + $rows[initValue] = strtoupper($rows[initValue]); + + $updflag = "UPDATE $link_vms_Table SET initValue = '$rows[initValue]' + WHERE $objWhereStr $otherWhereStr AND instanceNo='$TypeNo' + "; + if($DEBUG) echo "$updflag
      "; + mysqli_query($pubConn,$updflag); + } + if(1)//set vms NI DPC (arwean 060310) + { + $oidstr = "2.1.1"; //NI + $objWhereStr = getLevelWhere($oidstr); + $tmp = omc_keep_length(dechex($NetID),'0',2); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr and instanceNo='$TypeNo' + "; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + + $oidstr = "2.1.2"; //DPC + $objWhereStr = getLevelWhere($oidstr); + $tmp = omc_keep_length(dechex($WXC2OPC),'0',6);//DPC + $tmp = strtoupper($tmp); + $updflag = "UPDATE $paramTable SET initValue = '$tmp' + WHERE $objWhereStr and instanceNo='$TypeNo' + "; + if($DEBUG) echo "
      updflag: $updflag"; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + } +} +?> + +
      + + diff --git a/wxc2_omc/element/toElement/aas_voiceGrp.php b/wxc2_omc/element/toElement/aas_voiceGrp.php new file mode 100755 index 0000000..445b866 --- /dev/null +++ b/wxc2_omc/element/toElement/aas_voiceGrp.php @@ -0,0 +1,120 @@ + + + + +"; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + + echo ""; +} + +$oidstr = "2.3.3"; +$objWhereStr = getLevelWhere($oidstr); +$getsql = "select initValue from $paramTable + where $objWhereStr and instanceNo='$inst' + "; +if($DEBUG)echo "
      getsql: $getsql"; +$result = @mysqli_query($pubConn,$getsql); +$row = @mysqli_fetch_array($result); +for($i=0; $i< 32; $i++) +{ + ${"unit$i"} = substr($row[initValue],$i*4,4); +} + + +$selfPage = "$PHP_SELF?linkset=$linkset&trunkgp=$trunkgp&inst=$inst&sysNo=$sysNo"; + +echo "
      "; +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Configuration > Network > Element > AAS > Voice Group"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Number - $inst:  "; + echo "$subChannelName"; + echo ""; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} + +echo ""; + echo ""; + + echo ""; +echo "
      "; + echo ""; + for($i=0; $i< 16; $i++) + { + $value=${"unit$i"}; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      voice unit #$i
      "; + echo "
      "; + echo ""; + for($i=16; $i< 32; $i++) + { + $value=${"unit$i"}; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      voice unit #$i
      "; + echo "
      "; + +?> diff --git a/wxc2_omc/element/toElement/cell_edit.php b/wxc2_omc/element/toElement/cell_edit.php new file mode 100755 index 0000000..c2352ec --- /dev/null +++ b/wxc2_omc/element/toElement/cell_edit.php @@ -0,0 +1,369 @@ + + + +"; +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($save_action) || isset($undo_action)) + { + if(isset($save_action)) + { + //============save the cell by the instanceNo===================== + //========Emergency Call Flag + if(!isset($emergency_call_flag_select)) + $emergency_call_flag_select=0; + if($emergency_call_flag_select==0) + $emergency_call_flag_bit="00"; + if($emergency_call_flag_select==1) + $emergency_call_flag_bit="01"; + if($emergency_call_flag_select==2) + $emergency_call_flag_bit="02"; + if($emergency_call_flag_select==3) + $emergency_call_flag_bit="03"; + //========LAC + $cell_lac_bit=dechex($cell_lac_select); + $cell_lac_bit=omc_keep_length($cell_lac_bit,"0",4); + //=========cell ID + if(!isset($cell_id_text)) + $cell_id_text="0"; + $cell_id_bit=dechex($cell_id_text); + $cell_id_bit=omc_keep_length($cell_id_bit,"0",4); + //=========prefix index number + //=====add a new prefix for emergency call + if($cell_prefix_index_number_select==-1) + { + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=1 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $prefix_default_value=$rows[initValue]; + + $database="OBJ_322"; + $sql="select initValue,instanceNo from param_99 where level_1=2 and level_2=1 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $emergency_prefix_count=0; + do + { + if($rows[initValue]==$prefix_default_value) + { + $cell_prefix_index_number_select=$rows[instanceNo]; + break; + } + + }while($rows=@mysqli_fetch_array($result)); + } + $cell_prefix_index_number_bit=dechex($cell_prefix_index_number_select); + $cell_prefix_index_number_bit=omc_keep_length($cell_prefix_index_number_bit,"0",2); + //=========local emergency + if(!isset($cell_local_emergency_number_text)) + $cell_local_emergency_number_text="0000000000000000"; + $cell_local_emergency_number_bit=trim($cell_local_emergency_number_text); + $cell_local_emergency_number_bit=omc_keep_length($cell_local_emergency_number_bit,"E",16,0); + //===regional zone flag + if(!isset($cell_regional_zone_flag_select)) + $cell_regional_zone_flag_select=0; + if($cell_regional_zone_flag_select==0) + $cell_regional_zone_flag_bit="00"; + else if($cell_regional_zone_flag_select==1) + $cell_regional_zone_flag_bit="01"; + //=======zone code + if(!isset($cell_zone_code_text)) + $cell_zone_code_text="0"; + $cell_zone_code_bit=dechex($cell_zone_code_text); + $cell_zone_code_bit=omc_keep_length($cell_zone_code_bit,"0",4); + + $save_value=$emergency_call_flag_bit.$cell_lac_bit.$cell_id_bit.$cell_prefix_index_number_bit.$cell_local_emergency_number_bit.$cell_regional_zone_flag_bit.$cell_zone_code_bit; + + + $database="OBJ_322"; + $setsql = "update OBJ_322.param_99 set initValue='$save_value' where level_1=2 and level_2=2 and level_3=7 and instanceNo=$instanceNo "; + if($DEBUG) + echo "setsql=$setsql
      "; + + mysqli_query($pubConn,$setsql); + echo mysqli_error($pubConn); + + + $backurl="./wxc2_sp.php?instanceNo=$no_tmp&trunkgp=$trunkgp&linkset=$linkset&infoNo=$infoNo&operation=$oper&backurl=$url_temp"; + $cmd="window.location.href='$backurl';\n"; + echo "\n\n"; + } + if(isset($undo_action)) + { + $backurl=urlencode($backurl); + $url="./cell_edit.php?instanceNo=$instanceNo&trunkgp=$trunkgp&linkset=$linkset&infoNo=$infoNo&operation=$operation&backurl=$backurl"; + $cmd="window.location.href='$url';\n"; + echo "\n\n"; + } + } +} + + + + + + + + + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Configuration > Network > BSC > Emergency Call"; +echo ""; +//showHelp($helpId); +echo "
      "; + + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; + echo ""; +echo ""; + echo ""; +echo ""; + echo "

      $strBack"; +echo "

      "; + + +//==============get the cell parameter by the instanceNo================== + $database="OBJ_322"; + $sql="select initValue,instanceNo from param_99 where level_1=2 and level_2=2 and level_3=7 and instanceNo=$instanceNo "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + $cell_instance_no=$rows[instanceNo]; + $cell_emergency_call_flag=hexdec(getBitValue($rows[initValue],'0.0-0.7'))+0; + $cell_lac=hexdec(getBitValue($rows[initValue],'1.0-2.7'))+0; + $cell_id=hexdec(getBitValue($rows[initValue],'3.0-4.7'))+0; + $cell_prefix_index_number=hexdec(getBitValue($rows[initValue],'5.0-5.7'))+0; + $cell_local_emergency_number=getBitValue($rows[initValue],'6.0-13.7'); + $cell_regional_zone_flag=hexdec(getBitValue($rows[initValue],'14.0-14.7'))+0; + $cell_zone_code=hexdec(getBitValue($rows[initValue],'15.0-16.7'))+0; +//==============show the parameter====================================== +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; + +//===instanceNo======= +if($operation=="new") + echo ""; +else if($operation=="edit") + echo ""; +echo ""; +echo ""; +echo ""; + +//===emergency call flag +$emergency_call_flag_label=array(0=>"Disable",1=>"By Cell",2=>"By LAC",3=>"By MSC"); +if($operation=="new") + echo ""; +else if($operation=="edit") + echo ""; + +echo ""; +echo ""; +echo ""; + +//===LAC +//===get the exist LAC + +//=====get the default value of lac================= + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=2 and level_3=6 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $lac_default_value=$rows[initValue]; + + $database="OBJ_322"; + $sql="select initValue,instanceNo from param_99 where level_1=2 and level_2=2 and level_3=6 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $lac_count=0; + do + { + if($rows[initValue]==$lac_default_value) + continue; + else + { + $lac_instance_no[$lac_count]=$rows[instanceNo]; + $lac_flag[$lac_count]=hexdec(getBitValue($rows[initValue],'0.0-0.7'))+0; + $lac_tg[$lac_count]=hexdec(getBitValue($rows[initValue],'1.0-1.7'))+0; + $lac_lac[$lac_count]=hexdec(getBitValue($rows[initValue],'2.0-3.7'))+0; + $lac_paging_type[$lac_count]=hexdec(getBitValue($rows[initValue],'4.0-4.7'))+0; + $lac_count++; + } + }while($rows=@mysqli_fetch_array($result)); + +echo ""; +echo ""; +echo ""; +echo ""; + +//===Cell ID +if($operation=="new") + echo ""; +else if($operation=="edit") + echo ""; +echo ""; +echo ""; +echo ""; + +//===prefix index number +//=====get the default value of prefix================= + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=1 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $prefix_default_value=$rows[initValue]; + + $database="OBJ_322"; + $sql="select initValue,instanceNo from param_99 where level_1=2 and level_2=1 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $emergency_prefix_count=0; + do + { + if($rows[initValue]==$prefix_default_value) + continue; + else + { + $prefix_call_type=hexdec(getBitValue($rows[initValue],'10.4-10.6'))+0; + if($prefix_call_type==1) + { + $prefix_instance_no[$emergency_prefix_count]=$rows[instanceNo]; + $temp_no=$rows[instanceNo]; + { + $databasee="OBJ_322"; + $sqll="select initValue,instanceNo from param_99 where level_1=2 and level_2=1 and level_3=1 and instanceNo=$temp_no "; + $resultt=@mysqli_query($pubConn,$sqll); + $rowss=@mysqli_fetch_array($resultt); + + $cell_prefix_prefix[$emergency_prefix_count]=str_replace("E","",$rowss[initValue]); + if($cell_prefix_prefix[$emergency_prefix_count]=="") + $cell_prefix_prefix[$emergency_prefix_count]="--"; + } + $emergency_prefix_count++; + } + + } + }while($rows=@mysqli_fetch_array($result)); + +echo ""; +echo ""; +echo ""; +echo ""; + +//===local emergency number +if($operation=="new") + echo ""; +else if($operation=="edit") + echo ""; +echo ""; +echo ""; +echo ""; + +//===regional zone flag +$cell_regional_zone_flag_label=array(0=>"Disable",1=>"Enable"); +if($operation=="new") + echo ""; +else if($operation=="edit") + echo ""; +echo ""; +echo ""; +echo ""; + +//===zone code +if($operation=="new") + echo ""; +else if($operation=="edit") + echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> + diff --git a/wxc2_omc/element/toElement/cnf_confPara.php b/wxc2_omc/element/toElement/cnf_confPara.php new file mode 100755 index 0000000..07f0308 --- /dev/null +++ b/wxc2_omc/element/toElement/cnf_confPara.php @@ -0,0 +1,204 @@ + + + + + 'Conference ID', 'bit' => '00.0-00.7', 'inputName' => 'conf1', 'value' => ''), +array('name' => 'Conference number', 'bit' => '01.0-08.7', 'inputName' => 'conf2', 'value' => ''), +array('name' => 'Password', 'bit' => '09.0-10.7', 'inputName' => 'conf3', 'value' => ''), +array('name' => 'Applicant', 'bit' => '11.0-18.7', 'inputName' => 'conf4', 'value' => ''), +array('name' => 'Start time', 'bit' => '19.0-22.7', 'inputName' => 'conf5', 'value' => ''), +array('name' => 'Duration', 'bit' => '23.0-24.7', 'inputName' => 'conf6', 'value' => ''), +array('name' => 'Maximum party', 'bit' => '25.0-25.7', 'inputName' => 'conf7', 'value' => ''), +array('name' => 'Status', 'bit' => '26.0-26.7', 'inputName' => 'conf8', 'value' => '') +); + +$startTimeArr=array( + array('name' => 'month', 'value' => ''), + array('name' => 'day', 'value' => ''), + array('name' => 'House', 'value' => ''), + array('name' => 'Minute', 'value' => '') +); + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $oidstr = "2.2"; + $objWhereStr = getLevelWhere($oidstr); + $setValue='EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE000000EE'; + $conf1 = omc_keep_length(dechex($conf1),'0',2); + $conf2 = omc_keep_length($conf2,'E',16,1); + $conf3 = omc_keep_length($conf3,'E',4,1); + $conf4 = omc_keep_length($conf4,'E',16,1); + $conf5 = ''; + for($i=0;$i< sizeof($startTimeArr); $i++) + { + $tmp = ${"{$startTimeArr[$i][name]}"}; +// echo "
      {$startTimeArr[$i][name]}:$tmp"; + $startTimeArr[$i][value] = omc_keep_length(dechex($tmp),'0',2); + $conf5 .= $startTimeArr[$i][value]; + } + $conf6 = omc_keep_length(dechex($conf6),'0',4); + $conf7 = omc_keep_length(dechex($conf7),'0',2); + $conf8 = omc_keep_length(dechex($conf8),'0',2); + for($i=0; $i< sizeof($confParaArr); $i++) + { +// echo "
      {$confParaArr[$i][inputName]}:" . ${"{$confParaArr[$i][inputName]}"}; + $setValue = setBitValue($setValue,$confParaArr[$i][bit],${"{$confParaArr[$i][inputName]}"}); + } + $setValue = strtoupper($setValue); +// echo "
      setValue: $setValue"; +// exit; + $updSql = "update $center_paramTab set initValue='$setValue' where $objWhereStr and instanceNo='$instanceNo' "; + mysqli_query($pubConn,$updSql); + echo ""; +} + +if($instanceNo=='new') +{ + + //===============get the default value====================== + $database="OBJ_270"; + $sql="select initValue from paramConf where level_1=2 and level_2=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $conference_parameter_default_value=$rows[initValue]; + //===================== + $oidstr = "2.2"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue,instanceNo from $center_paramTab where $objWhereStr "; + $result = mysqli_query($pubConn,$selSql); + $n=0; + while($row = mysqli_fetch_array($result)) + { + //$confNumber = getBitValue($row[initValue],$confParaArr[1][bit]); + //$confNumber = str_replace('E','',$confNumber); + //if(strlen($confNumber)==0) + if($conference_parameter_default_value==$row[initValue]) + { + $instanceNo = $row[instanceNo]; + break; + } + } +} +else +{ + + $oidstr = "2.2"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue,instanceNo from $center_paramTab where $objWhereStr and instanceNo='$instanceNo' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + + $confParaArr[0][value] = hexdec(getBitValue($row[initValue],$confParaArr[0][bit])); + $confParaArr[1][value] = str_replace('E','',getBitValue($row[initValue],$confParaArr[1][bit])); + $confParaArr[2][value] = str_replace('E','',getBitValue($row[initValue],$confParaArr[2][bit])); + $confParaArr[3][value] = str_replace('E','',getBitValue($row[initValue],$confParaArr[3][bit])); + $confParaArr[4][value] = str_replace('E','E',getBitValue($row[initValue],$confParaArr[4][bit])); + $confParaArr[5][value] = hexdec(getBitValue($row[initValue],$confParaArr[5][bit])); + $confParaArr[6][value] = hexdec(getBitValue($row[initValue],$confParaArr[6][bit])); + $confParaArr[7][value] = getBitValue($row[initValue],$confParaArr[7][bit]); +} +$selfPage = "$PHP_SELF?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&instanceNo=$instanceNo&sysNo=$sysNo&subSysNo=$subSysNo"; +echo ""; +{ + echo "
      ParametersValue
      No."; +echo "{$cell_instance_no}"; +echo "
      Emergency Call Flag"; +echo ""; +echo "
      LAC"; + echo ""; +echo "
      Cell ID"; +echo ""; +echo "
      Prefix Index Number"; +echo ""; +echo "
      Local Emergency Number"; +$tmp=str_replace("E","",$cell_local_emergency_number); +echo ""; +echo "
      Regional Zone Flag"; +echo ""; +echo "
      Zone Code"; +echo ""; +echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Configuration > Network > CNF > Conference parameter"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + //echo "$instanceNo"; + echo ""; + echo ""; + echo "    "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} + +echo ""; + echo ""; + echo ""; + echo ""; + $status_label=array(0=>"Not Executable",1=>"Booking",2=>"On Going",3=>"Finished",4=>"Draft"); + + for($i=0; $i< sizeof($confParaArr); $i++) + { + echo ""; + echo ""; + echo ""; + echo ""; + } +// echo ""; +// echo ""; +// echo ""; +// echo ""; +// echo ""; +echo ""; +?> + diff --git a/wxc2_omc/element/toElement/cnf_prefix.php b/wxc2_omc/element/toElement/cnf_prefix.php new file mode 100755 index 0000000..b087b80 --- /dev/null +++ b/wxc2_omc/element/toElement/cnf_prefix.php @@ -0,0 +1,169 @@ + + + + + 'Conference ID', 'bit' => '00.0-00.7', 'inputName' => 'conf1', 'value' => ''), +array('name' => 'Conference number', 'bit' => '01.0-08.7', 'inputName' => 'conf2', 'value' => ''), +array('name' => 'Password', 'bit' => '09.0-10.7', 'inputName' => 'conf3', 'value' => ''), +array('name' => 'Applicant', 'bit' => '11.0-18.7', 'inputName' => 'conf4', 'value' => ''), +array('name' => 'Start time', 'bit' => '19.0-22.7', 'inputName' => 'conf5', 'value' => ''), +array('name' => 'Duration', 'bit' => '23.0-24.7', 'inputName' => 'conf6', 'value' => ''), +array('name' => 'Maximum party', 'bit' => '25.0-25.7', 'inputName' => 'conf7', 'value' => ''), +array('name' => 'Status', 'bit' => '26.0-26.7', 'inputName' => 'conf8', 'value' => '') +); + +$startTimeArr=array( + array('name' => 'month', 'value' => ''), + array('name' => 'day', 'value' => ''), + array('name' => 'House', 'value' => ''), + array('name' => 'Minute', 'value' => '') +); + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + $setValue = omc_keep_length($prefix,'E',4,0); + $setValue = strtoupper($setValue); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='99' and instanceNo='$instanceNo'"; + mysqli_query($pubConn,$updSql); + + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $tmp1 = omc_keep_length(decbin($dialLen),'0',6); + $tmp2 = omc_keep_length(decbin($leadDig),'0',2); + $tmpbin = $tmp2.$tmp1; + $setValue = bindec($tmpbin); + $setValue = omc_keep_length(dechex($setValue),'0',2); + $setValue = strtoupper($setValue); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='99' and instanceNo='$instanceNo'"; + mysqli_query($pubConn,$updSql); + + echo ""; +} + +if($instanceNo=='new') +{ + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue,instanceNo from $paramTab where $objWhereStr and subSysNo='99' and initValue='0000'"; + $result = @mysqli_query($pubConn,$selSql); + if($row = @mysqli_fetch_array($result)) + { + $instanceNo = $row[instanceNo]; + $prefix = str_replace('E','',$row[initValue]); + + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $selSql = "select initValue,instanceNo from $paramTab where $objWhereStr and subSysNo='99' and instanceNo='{$inst}'"; + $result = @mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $dialLen = bindec(getBitValue($row[initValue],'00.0-00.5')); + $leadDig = bindec(getBitValue($row[initValue],'00.6-00.7')); + } + else + { + echo ""; + } +} +else +{ + $oidstr = "2.1.8"; + $objWhereStr = getLevelWhere($oidstr); + $selSql = "select initValue,instanceNo from $paramTab where $objWhereStr and subSysNo='99' and instanceNo='$instanceNo'"; + $result = @mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $prefix = str_replace('E','',$row[initValue]); + + $oidstr = "2.1.9"; + $objWhereStr = getLevelWhere($oidstr); + $selSql = "select initValue,instanceNo from $paramTab where $objWhereStr and subSysNo='99' and instanceNo='$instanceNo'"; + $result = @mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $dialLen = bindec(getBitValue($row[initValue],'00.0-00.5')); + $leadDig = bindec(getBitValue($row[initValue],'00.6-00.7')); +} +$selfPage = "$PHP_SELF?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&instanceNo=$instanceNo&sysNo=$sysNo&subSysNo=$subSysNo"; + +echo ""; +{ + echo "
      Conference parameter
      "; + echo $confParaArr[$i][name]; + echo ""; + if($i==4) + { + $confParaArr[$i][value] = omc_keep_length($confParaArr[$i][value],'0',8,0); + for($k=0; $k< sizeof($startTimeArr); $k++) + { + $startTimeArr[$k][value] = omc_keep_length(hexdec(substr($confParaArr[$i][value],$k*2,2)),'0',2); + echo ""; + if($k==0) + echo " - "; + else if($k==1) echo "    "; + else if($k==2) echo " : "; + } + //echo " Month Day House Minute"; + } + else if($i==7) + { + $status_tmp=$status_label[$confParaArr[$i][value]+0]; + echo "$status_tmp"; + echo ""; + } + else if($i==0) + { + $tmp=$instanceNo+1; + echo "$tmp"; + echo ""; + } + else + { + echo ""; + } + echo "
      "; +// echo $confParaArr[$i][name]; +// echo ""; +// echo $confParaArr[$i][value]; +// echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Configuration > Network > CNF > Prefix"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "CNF Prefix:  "; + echo "$instanceNo"; + echo ""; + echo ""; + echo "    "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} + +$leadDigArr = array( + 'Internal', + 'Conference', + 'PPS' + ); +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo ""; +?> + diff --git a/wxc2_omc/element/toElement/cnf_voicePrmt.php b/wxc2_omc/element/toElement/cnf_voicePrmt.php new file mode 100755 index 0000000..770f674 --- /dev/null +++ b/wxc2_omc/element/toElement/cnf_voicePrmt.php @@ -0,0 +1,114 @@ + + + + +"; + if(!$DEBUG) + { + echo "\n window.location.href=\"$listPageUrl\";"; + } + echo "\n "; +} + +$selfPage = "$PHP_SELF?infoNo=$infoNo&linkset=$linkset&trunkgp=$trunkgp&sysNo=$sysNo&subSysNo=$subSysNo&levelStr=$levelStr"; +echo ""; +{ + echo "
      Conference parameter
      Prefix
      Length of dialed number
      Lead digit"; + echo ""; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      "; + //echo "Configuration > Network > Element > CNF > Channel"; + echo "Configuration > Network > CNF > Voice Prompt"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Voice Prompt Setting:  "; + echo "$subChannelName"; + echo ""; + echo ""; + echo "    "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} + +echo ""; + $tmpArr=explode('.',$levelStr); + switch($tmpArr[3]) + { + case 9: + $tableName='Join meeting'; + break; + case 10: + $tableName='Leave Meeting'; + break; + case 11: + $tableName='Conference Full'; + break; + case 12: + $tableName='Password Invalid'; + break; + case 13: + $tableName='Five Minutes Left'; + break; + case 14: + $tableName='End Conference'; + break; + default: + break; + } + { + $objWhereStr = getLevelWhere($levelStr); + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$subSysNo'"; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + } + echo ""; + for($i=0;$i< 8;$i++) + { + echo ""; + for($j=0; $j< 6; $j++) + { + $no = $j*8 + $i; + $name="byte_" . $no; + $value = substr("$row[initValue]",2*$no,2); + echo ""; + } + echo ""; + } +echo ""; +?> + diff --git a/wxc2_omc/element/toElement/getAASLinkSta.php b/wxc2_omc/element/toElement/getAASLinkSta.php new file mode 100755 index 0000000..227f199 --- /dev/null +++ b/wxc2_omc/element/toElement/getAASLinkSta.php @@ -0,0 +1,75 @@ +sql=$sql"; +$res=mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); +//echo mysqli_error($pubConn); + +if(!$row) +{ + echo 2; + echo "###"; + echo 2; + exit(); +} + +$due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +$ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +$hex_mes=$row[detailStat]; +$refresh_time=$row[updateTime]; +//echo $heatbeat_overtime; +if(!($refresh_time > $due_date && $refresh_time < $ove_date)) +{ + echo 0; + echo "###"; + echo 0; + exit(); +} +$bin_mes=''; +for($i=0;$ibin_mes=$bin_mes"; +$stt_e0 = 21; //E1 #0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) +$stt_e1 = 22; //E1 #1 status + +//E1#0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) +for($i=0;$i<2;$i++){ + $binSttE0=substr($bin_mes,$stt_e0*8+7-$i,1); + $sttE0[$i]=BinDec($binSttE0); + if($DEBUG)echo "
      sttE0[$i]=$sttE0[$i]"; +} + +if(!$sttE0[0]){ + $sttE0[1] = 2; +} + +//E1#1 status +for($i=0;$i<2;$i++){ + $binSttE1=substr($bin_mes,$stt_e1*8+7-$i,1); + $sttE1[$i]=BinDec($binSttE1); + if($DEBUG)echo "
      sttE1[$i]=$sttE1[$i]"; +} + +if(!$sttE1[0]){ + $sttE1[1] = 2; +} + + + +echo $sttE0[1]; +echo "###"; +echo $sttE1[1]; +?> diff --git a/wxc2_omc/element/toElement/getVMSLinkSta.php b/wxc2_omc/element/toElement/getVMSLinkSta.php new file mode 100755 index 0000000..d7ccde2 --- /dev/null +++ b/wxc2_omc/element/toElement/getVMSLinkSta.php @@ -0,0 +1,163 @@ +sql=$sql"; +$res=mysqli_query($pubConn,$sql); +$row=@mysqli_fetch_array($res); +//echo mysqli_error($pubConn); + +if(!$row) +{ + echo 2; + echo "###"; + echo 2; + exit(); +} + +$due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +$ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +$hex_mes=$row[detailStat]; +$refresh_time=$row[updateTime]; +//echo $heatbeat_overtime; +if(!($refresh_time > $due_date && $refresh_time < $ove_date)) +{ + echo 0; + echo "###"; + echo 0; + exit(); +} +$bin_mes=''; +for($i=0;$ibin_mes=$bin_mes"; +$stt_e0 = 45; //E1 #0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) +$stt_e1 = 46; //E1 #1 status + +//Field08 E1#0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) + for($i=0;$i<2;$i++) + { + $binSttE0=substr($bin_mes,$stt_e0*8+7-$i,1); + $sttE0[$i]=BinDec($binSttE0); + if($DEBUG)echo "
      sttE0[$i]=$sttE0[$i]"; + } + + if(!$sttE0[0]) + { + $sttE0[1] = 2; + } + + //Field09 E1#1 status + for($i=0;$i<2;$i++) + { + $binSttE1=substr($bin_mes,$stt_e1*8+7-$i,1); + $sttE1[$i]=BinDec($binSttE1); + if($DEBUG)echo "
      sttE1[$i]=$sttE1[$i]"; + } + + if(!$sttE1[0]) + { + $sttE1[1] = 2; + } + +echo $sttE0[1]; +echo "###"; +echo $sttE1[1]; + + +*/ + + + + + + + +{ + $db="OMC_PUB"; + + $sql = "SELECT detailStat,updateTime FROM sysStat WHERE sysTypeNo='390' AND sysNo='$TypeNo' AND subSysNo='0'"; + //$sql = "SELECT detailStat,updateTime FROM sysStat WHERE sysTypeNo='390' AND sysNo='$subSysNo' AND subSysNo='0'"; + + //echo "$sql"; + if($DEBUG)echo "
      sql=$sql"; + $res=mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + //echo mysqli_error($pubConn); + + $due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); + $ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + + $hex_mes=$row[detailStat]; + $refresh_time=$row[updateTime]; + //echo $heatbeat_overtime; + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + $stt_e0 = 45+22; //E1 #0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) + $stt_e1 = 46+22; //E1 #1 status + $licenseByte = 58+22; + $licenseFlg = hexdec(substr($hex_mes,$licenseByte*2,2));//1:aas 2:vms 3:both + //echo "
      licenseFlg:$licenseFlg"; + //Field08 E1#0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok) + for($i=0;$i<2;$i++) + { + $binSttE0=substr($bin_mes,$stt_e0*8+7-$i,1); + $sttE0[$i]=BinDec($binSttE0); + if($DEBUG)echo "
      sttE0[$i]=$sttE0[$i]"; + } + + if(!$sttE0[0]) + { + $sttE0[1] = 2; + } + + //Field09 E1#1 status + for($i=0;$i<2;$i++) + { + $binSttE1=substr($bin_mes,$stt_e1*8+7-$i,1); + $sttE1[$i]=BinDec($binSttE1); + if($DEBUG)echo "
      sttE1[$i]=$sttE1[$i]"; + } + + if(!$sttE1[0]) + { + $sttE1[1] = 2; + } +} + + + + +echo $sttE0[1]; +echo "###"; +echo $sttE1[1]; + + + + + + +?> diff --git a/wxc2_omc/element/toElement/gtt_edit.php b/wxc2_omc/element/toElement/gtt_edit.php new file mode 100755 index 0000000..07b0aee --- /dev/null +++ b/wxc2_omc/element/toElement/gtt_edit.php @@ -0,0 +1,856 @@ +正在调试中!!"; +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$numberPerPage = 100; //每页纪录数 +$paramTable ='OBJ_223.param_99'; + + + +$totalLen = 43; + +$nEnable = '01'; + +$sysId ='223_99_99'; +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      sysId = $sysId"; +if($DEBUG) echo "
      instanceNo = $instanceNo"; +if($DEBUG) echo "
      objIdStr = $objIdStr"; + + +$GTTtableConfArr=array( + array('Start number', '03.0-12.7'), + array('End number', '13.0-22.7'), + array('On/off', '00.0-00.7'), + array('Numbering plan', '01.0-01.7'), + array('Network indicator', '23.0-23.7'), + array('DPC', '24.0-26.7'), + array('SSN', '27.0-27.7'), + array('Route indicator', '28.0-28.7'), + array('Address indicator', '29.0-29.7'), + array('Replaced start digit', '30.0-30.7'), + array('Replaced end digit', '31.0-31.7'), + array('Outgoing number plan', '32.0-32.7'), + array('Replacing digits', '33.0-42.7'), + array('TT', '02.0-02.7') +); + +$NetIdConfArr=array( + array('0','International'), + array('1','International spare'), + array('2','National'), + array('3','National spare') +); + +$numPlanConfArr=array( + array('00','0'), + array('01','MSISDN'), + array('06','IMSI(E.212)'), + array('07','GT(E.214)') +); + +$addressIdConfArr=array( + array('00','NULL'), + array('01','DPC'), + array('02','SSN'), + array('03','DPC+SSN'), + array('04','GT'), + array('05','GT+DPC'), + array('06','GT+SSN'), + array('07','GT+DPC+SSN') +); + +{//LINKSET DPC + $sysId = '222_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.4.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $tmpDb = 'OBJ_'.$sysTypeNo; + $tmpTable = 'param_'.$sysNo; + + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo ='$linkset' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $DPC = hexdec(getBitValue($Row[initValue],'0.0-2.7')); + $NetID = bindec(getBitValue($Row[initValue],'3.0-3.1')); + $NetID = omc_keep_length($NetID,"0","2"); + //DPC END +}//end linset dpc + +$offsetAppType='00.0-00.7'; +$offsetGrpNo = '01.0-01.7'; +$offsetBitFlag = '02.0-02.7';//if '1', global title. + +$niTypeArr = getNiType(); + + +function showNumber($number) +{ + $newNumber =str_replace('F','',$number); + return($newNumber); +} +//========================================================== +//数据处理 +//========================================================== + + +//保存改动 +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(0) + { + echo "
      nStartDigit=$nStartDigit"; + echo "
      nEndDigit=$nEndDigit"; + echo "
      nEnable=$nEnable"; + echo "
      nNumPlan=$nNumPlan"; + echo "
      nNetIDName=$nNetIDName"; + echo "
      nDPC=$nDPC"; + echo "
      nSSN=$nSSN"; + echo "
      nRouterID=$nRouterID"; + echo "
      nAddressID=$nAddressID"; + echo "
      nRep_start=$nRep_start"; + echo "
      nRep_end=$nRep_end"; + echo "
      nOutNumPlan=$nOutNumPlan"; + echo "
      nRep_digit=$nRep_digit"; + } + + //补齐 + $nStartDigit = omc_keep_length($nStartDigit,"F","20","0"); + $nEndDigit = omc_keep_length($nEndDigit,"F","20","0"); + $nDPC = dechex($nDPC); + $nDPC = omc_keep_length($nDPC,"0","6","1"); + $nSSN = dechex($nSSN);//roger + $nSSN = omc_keep_length($nSSN,"0","2","1");//roger + + for($i=0;$i< $totalLen;$i++) + { + $totalValue=$totalValue."00"; + } + $totalValue=setBitValue($totalValue,$GTTtableConfArr[0][1],$nStartDigit); + //if($SSN == 6||$SSN == 11) + if($appType == 1||$appType == 3||$appType == 5) + { + $totalValue=setBitValue($totalValue,$GTTtableConfArr[1][1],$nEndDigit); + } + else + { + $totalValue=setBitValue($totalValue,$GTTtableConfArr[1][1],$nStartDigit); + } + $totalValue=setBitValue($totalValue,$GTTtableConfArr[2][1],$nEnable); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[3][1],$nNumPlan); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[4][1],$nNetIDName); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[5][1],$nDPC); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[6][1],$nSSN); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[7][1],$nRouterID); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[8][1],$nAddressID); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[9][1],$nRep_start); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[10][1],$nRep_end); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[11][1],$nOutNumPlan); + $nRep_digit = omc_keep_length($nRep_digit,"F","20","0"); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[12][1],$nRep_digit); + $totalValue=setBitValue($totalValue,$GTTtableConfArr[13][1],$nTT); +if(0) echo "
      totalValue=$nTT
      "; + + if($DEBUG) echo "

      sysId=$sysId"; + if($DEBUG) echo "
      objIdStr=$objIdStr"; + if($DEBUG) echo "
      instanceNo=$instanceNo"; + if(0) echo "
      totalValue=$totalValue
      "; + + $objIdStr='2.2'; + $objWhereStr =getLevelWhere($objIdStr); + $totalValue = strtoupper($totalValue); + $updSql = "UPDATE $paramTable SET initValue = '$totalValue' + WHERE $objWhereStr AND instanceNo='$instanceNo'"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + {//set gtt attribution from 2.4 + $selSql = "select initValue from $paramTable where level_1='2' and level_2='4' and instanceNo='$instanceNo'"; + $Result = mysqli_query($pubConn,$selSql); + $Row = mysqli_fetch_array($Result); + $setValue = $Row[initValue]; + $tmpEleType = strtoupper(omc_keep_length(dechex($appType),'0',2)); + $tmpGrpNo=strtoupper(omc_keep_length(dechex($grpNo),'0',2)); + $tmpGtFlag = strtoupper(omc_keep_length(dechex($bitFlag),'0',2)); + $tmpEleName = omc_keep_length(toHex($eleName),"0",20,"0"); + + $setValue = setBitValue($setValue,$offsetAppType,$tmpEleType); + $setValue = setBitValue($setValue,$offsetGrpNo,$tmpGrpNo); + $setValue = setBitValue($setValue,$offsetBitFlag,$tmpGtFlag); + $setValue = setBitValue($setValue,'3.0-12.7',$tmpEleName); + + $updSql = "update $paramTable set initValue = '$setValue' where level_1='2' and level_2='4' and instanceNo='$instanceNo'"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + }//end set gtt attribution form 2.4 + + + if(0) + { + echo "
      bitFlag:$bitFlag, grpNo:$grpNo"; + echo "
      save:$save"; + echo "
      updSql=$updSql"; + exit; + } + //HPLMN VPLMN 设置判断 + if($DEBUG) echo "save=$save
      "; + if($save == 1) + { + $hlr_sysId = "330_99_99"; + + $hlr_sysIdArr = explode('_',$hlr_sysId); + $hlr_sysTypeNo = $hlr_sysIdArr[0]; + $hlr_sysNo = $hlr_sysIdArr[1]; + $hlr_subSysNo = $hlr_sysIdArr[2]; + + $hlr_oidstr = '2.1.12'; + $hlr_objWhereStr= ''; + $hlr_objWhereStr =getLevelWhere($hlr_oidstr); + + $hlr_objDb = 'OBJ_'.$hlr_sysTypeNo; + $hlr_paramTable = 'param_'.$hlr_sysNo; + + $defSql = " SELECT initValue, instanceNo FROM $hlr_paramTable WHERE $hlr_objWhereStr AND instanceNo='$instanceNo'"; + if($DEBUG) echo "defSql=$defSql
      "; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + + $nHead = "$nCC"."$nNDC"; + $nHeadlen = strlen($nHead); + $DigHead = substr($nStartDigit,0,$nHeadlen); + if($DigHead !=$nHead) + { + echo ""; + exit(); + } + + $stratSN = substr($nStartDigit,$nHeadlen,12); + $nCC = omc_keep_length($nCC,"E","4","0"); + $nNDC = omc_keep_length($nNDC,"E","6","0"); + $stratSN =str_replace('F','E',$stratSN); + + if($DEBUG) echo "CC = $nCC
      "; + if($DEBUG) echo "NDC = $nNDC
      "; + if($DEBUG) echo " stratSN = $stratSN
      "; + $row[initValue]=setBitValue($row[initValue],'00.0-01.7',$nCC); + $row[initValue]=setBitValue($row[initValue],'02.0-04.7',$nNDC); + $row[initValue]=setBitValue($row[initValue],'05.0-10.7',$stratSN); + $row[initValue]=setBitValue($row[initValue],'11.0-16.7',$stratSN); + + $upSql = "UPDATE $hlr_paramTable SET initValue = '$row[initValue]' + WHERE $hlr_objWhereStr AND instanceNo='$instanceNo'"; + if($DEBUG) echo "upSql=$upSql
      "; + $upRes = @mysqli_query($pubConn,$upSql); + echo mysqli_error($pubConn); + } + else if($save ==2) + { + $hlr_sysId = "330_99_99"; + + $hlr_sysIdArr = explode('_',$hlr_sysId); + $hlr_sysTypeNo = $hlr_sysIdArr[0]; + $hlr_sysNo = $hlr_sysIdArr[1]; + $hlr_subSysNo = $hlr_sysIdArr[2]; + + $hlr_oidstr = '2.1.12'; + $hlr_objWhereStr= ''; + $hlr_objWhereStr =getLevelWhere($hlr_oidstr); + + $hlr_objDb = 'OBJ_'.$hlr_sysTypeNo; + $hlr_paramTable = 'param_'.$hlr_sysNo; + + $defSql = " SELECT initValue FROM paramConf WHERE $hlr_objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $delSql = "UPDATE $hlr_paramTable SET initValue = '$row[initValue]' + WHERE $hlr_objWhereStr AND instanceNo='$instanceNo'"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + + if($DEBUG) + { + echo "DEBUG
      "; + } + else + { + echo ""; + exit(); + } +} + +//========================================================== +//输出并显示数据 +//========================================================== +if($DEBUG) echo "
      "; +?> +
      + +"> + +"; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      $tableName
      Byte $no: "; + echo " "; + echo "
      "; + //echo "$strConfiguration > $strNetwork > Element > GTT"; + echo "Configuration > Network > "; + echo "$strGttObjects > "; + echo "GTT"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "    "; + echo ""; + echo ""; + + echo "$strBack"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; +} +echo ""; + +$objIdStr='2.2'; +$objWhereStr =getLevelWhere($objIdStr); + +if($instanceNo == 'new') +{ + /************get default value**************/ + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr "; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $defaultValue = $defRow[initValue]; + $value =$defaultValue; +} +else +{ + $getSql="SELECT initValue + FROM $paramTable + WHERE $objWhereStr AND instanceNo='$instanceNo' + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $rows =mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $value=$rows[0]; +} +if($DEBUG) echo "value=$value
      "; + +if($instanceNo == 'new') +{ + $SsnValue = $SSN; + $addressID = '7'; +} +else +{ + $SsnValue = hexdec(getBitValue($value,$GTTtableConfArr[6][1])); + $addressID =getBitValue($value,$GTTtableConfArr[8][1]); +} + +$startDigit =getBitValue($value,$GTTtableConfArr[0][1]); +$startDigit =showNumber($startDigit); +$endDigit =getBitValue($value,$GTTtableConfArr[1][1]); +$endDigit =showNumber($endDigit); + +$numPlan =getBitValue($value,$GTTtableConfArr[3][1]); +if($DEBUG) echo "
      NetID=$NetID"; +for($j=0;$jNetID=$NetID"; +for($j=0;$joutNumPlan=$outNumPlan"; + +$Rep_digit =getBitValue($value,$GTTtableConfArr[12][1]); +$Rep_digit =showNumber($Rep_digit); + +$TT =hexdec(getBitValue($value,$GTTtableConfArr[13][1])); + + +$ni=hexdec($NetID); +if($instanceNo=='new') +{ + $numPlan = omc_keep_length(dechex($NP),'0','2'); + + if($niTypeArr[$ni]==0)//ITU + { + $TT = 0; + } + else//ansi + { + if($NP==1||$NP==0) + $TT = 14; + else + $TT = 9; + $numPlan='00'; + } +} +if($instanceNo == 'new') +{ + $getInstanceSql="SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr "; + $result=mysqli_query($pubConn,$getInstanceSql); + echo mysqli_error($pubConn); + if($DEBUG) echo "
      $getInstanceSql"; + $ins_no = 0; + while($row=mysqli_fetch_array($result)) + { + $flag = hexDec(getBitValue($row[initValue],'0.0-0.7')); + //echo "$flag"; + if ($flag == 0) + { + $instanceNo = $row[instanceNo]; + $ins_no++; + break; + } + } + if($ins_no == 0) + { + echo ""; + exit(); + } +} +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +if($niTypeArr[$ni]==0)//ITU +{ + $tmpTT = omc_keep_length(dechex($TT),'0',2); + echo ""; + echo ""; + echo ""; + echo ""; +} +else//ansi +{ + echo ""; + echo ""; + echo ""; + echo ""; + +} +//=========================change the ssn to selection formation====================== +/* +echo ""; +echo ""; +echo ""; +echo ""; +*/ +//================= +$ssn_label=array(0=>"UNKNOW(0)",6=>"HLR(6)",7=>"VLR(7)",8=>"MSC(8)",9=>"EIR(9)",10=>"AUC(10)",11=>"SMSC(11)",22=>"SRF(22)",32=>"NPLR(32)",146=>"SSF(146)",147=>"SCF-CAP(147)",149=>"SGSN(149)",153=>"SCF-MAP(153)",254=>"AIF(254)"); +echo ""; +echo ""; +echo ""; +echo ""; + + + +//if($SSN == 7) +if($appType == 2) +{ + //取数据 + $hlr_sysId = "330_99_99"; + + $hlr_sysIdArr = explode('_',$hlr_sysId); + $hlr_sysTypeNo = $hlr_sysIdArr[0]; + $hlr_sysNo = $hlr_sysIdArr[1]; + $hlr_subSysNo = $hlr_sysIdArr[2]; + + $hlr_oidstr = '2.1.12'; + $hlr_objWhereStr= ''; + $hlr_objWhereStr =getLevelWhere($hlr_oidstr); + + $hlr_objDb = 'OBJ_'.$hlr_sysTypeNo; + $hlr_paramTable = 'param_'.$hlr_sysNo; + + $hlr_paramSql = " SELECT initValue,readValue,instanceNo FROM $hlr_paramTable + WHERE $hlr_objWhereStr AND instanceNo = '$instanceNo' + "; + $hlr_Result = mysqli_query($pubConn,$hlr_paramSql); + $hlr_Row = mysqli_fetch_array($hlr_Result); + + $CC = getBitValue($hlr_Row[initValue],'00.0-01.7'); + $CC = str_replace('E','',$CC); + $NDC = getBitValue($hlr_Row[initValue],'02.0-04.7'); + $NDC = str_replace('E','',$NDC); + $Start_SN = getBitValue($hlr_Row[initValue],'05.0-10.7'); + $Start_SN = str_replace('E','',$Start_SN); + + $fullNum = "$CC"."$NDC"."$Start_SN"; + if(0) echo "cc:$CC"."ndc:$NDC"."start:$Start_SN
      "."Hlr-fullNum=$fullNum
      "; + if(0) echo "startDigit=$startDigit
      "; + + //显示 + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; +} +//当startDigit与endDigit要设置为相同时只显示startDigit给用户设置 +//if($SSN == 6||$SSN == 11) +if($appType == 1||$appType == 3||$appType == 5) +{ + if($bitFlag==1) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +} +else +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      ParametersValue
      Network indicator"; +echo "$NetIDName"; +echo "
      Destination point code"; +echo "$DPC
      Numbering Plan"; + if($NP==1||$NP==0) + { + for($j=0;$j"; + for($j=2;$j{$numPlanConfArr[$j][1]}"; + }else{ + echo "
      TT"; + if($NP==6) + { + echo "$TT"; + echo ""; + for($j=0;$j{$ttArr[$j][1]}"; + } + else + { + echo "
      $SsnValue
      SSN"; + echo ""; +echo "
      Location"; + if($fullNum != $startDigit || $startDigit==0) + { + echo "HPLMN "; + echo "VPLMN "; + $cc_ndc_Show = 'none'; + } + else + { + echo "HPLMN "; + echo "VPLMN "; + $cc_ndc_Show = ''; + } + echo "
      CC+NDC"; + if($fullNum != $startDigit) + { + echo "  "; + echo ""; + } + else + { + echo "  "; + echo ""; + } + echo "
      $strE164Number
      Start GT number
      End GT number
      GT number (CC+NDC+SN)
      Route indicator"; +echo ""; +echo "
      Address indicator"; +echo ""; +echo "
      Replaced start digit
      Replaced end digit
      Outgoing number plan"; +echo "
      Replacing digits
      "; +echo "
      "; + +echo "\n "; +echo "\n "; +echo "\n "; +echo "\n "; +echo "\n "; +echo "\n "; + +echo "\n "; + +?> + + diff --git a/wxc2_omc/element/toElement/loadaas.php b/wxc2_omc/element/toElement/loadaas.php new file mode 100755 index 0000000..2f8a572 --- /dev/null +++ b/wxc2_omc/element/toElement/loadaas.php @@ -0,0 +1,103 @@ +'2.1.3', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.1.4', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.1.5', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.1.8', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.1.9', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.1.10', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.3.1', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.3.2', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.3.3', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + ); + $oidsysarr1=array( + array('oid'=>'2.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), +// array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.147', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.6', 'sysid'=>'322_99_99', 'selectsysid'=>'-1') + ); + $oidsysarr2=array( + array('oid'=>'2.2', 'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), + array('oid'=>'2.3', 'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), + array('oid'=>'2.4.1', 'sysid'=>'222_11_99', 'selectsysid'=> $aasMtp3_sysId), + array('oid'=>'2.1.8', 'sysid'=>'223_11_99', 'selectsysid'=> $sccp_sysId), + array('oid'=>'2.2', 'sysid'=>'223_11_99', 'selectsysid'=> $sccp_sysId) + ); + //========================================================== + //数据处理 + //========================================================== + + echo "
      Loading
      "; + session_register("linksetGetFlag"); + + GetParam($oidsysarr,1); + GetParam($oidsysarr1,1); + GetParam($oidsysarr2,1); + echo "

      Finished!

      "; +} +echo ""; +echo ""; + + +if($DEBUG) exit(); +echo ""; + +exit(); +?> \ No newline at end of file diff --git a/wxc2_omc/element/toElement/loadcnf.php b/wxc2_omc/element/toElement/loadcnf.php new file mode 100755 index 0000000..6097241 --- /dev/null +++ b/wxc2_omc/element/toElement/loadcnf.php @@ -0,0 +1,92 @@ +'2.2.1', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.2.2', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + array('oid'=>'2.2.3', 'sysid'=> $sysId, 'selectsysid'=>'-1'), + + array('oid'=>'2.1.1', 'sysid'=> $sysIdPub, 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=> $sysIdPub, 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=> $sysIdPub, 'selectsysid'=>'-1') + ); + //========================================================== + //数据处理 + //========================================================== + + echo "
      Loading
      "; + session_register("linksetGetFlag"); + + GetParam($oidsysarr,1); + echo "

      Finished!

      "; +} + +echo ""; +echo ""; +echo ""; + +if($DEBUG) exit(); +echo ""; + +exit(); +?> \ No newline at end of file diff --git a/wxc2_omc/element/toElement/loaddata.php b/wxc2_omc/element/toElement/loaddata.php new file mode 100755 index 0000000..ad4f855 --- /dev/null +++ b/wxc2_omc/element/toElement/loaddata.php @@ -0,0 +1,123 @@ +'2.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.9', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1') + ); + break; + } + case 'Peripheral': + { + $oidsysarr=array( + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1') + ); + break; + } + case 'Switch': + { + $oidsysarr=array( + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1') + ); + break; + } + case $strGttObjects: + { + $oidsysarr=array( + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.12','sysid'=>'330_99_99', 'selectsysid'=>'-1'), + //MTP3 + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1') + ); + break; + } + default: + { + $oidarr = array(); + $SaveArr=array(); + break; + } + } + } + //========================================================== + //数据处理 + //========================================================== + + echo "
      Loading
      "; + GetParam($oidsysarr,1); + if($elementInfoArr[typeName]!=$strGttObjects) get_e1channel($trunkgp); + +} + +if($DEBUG) exit(); +echo ""; +exit(); +?> \ No newline at end of file diff --git a/wxc2_omc/element/toElement/loadpcr.php b/wxc2_omc/element/toElement/loadpcr.php new file mode 100755 index 0000000..3c88083 --- /dev/null +++ b/wxc2_omc/element/toElement/loadpcr.php @@ -0,0 +1,28 @@ +"; +echo ""; + + +if($DEBUG) exit(); +echo ""; + +exit(); +?> \ No newline at end of file diff --git a/wxc2_omc/element/toElement/loadvss.php b/wxc2_omc/element/toElement/loadvss.php new file mode 100755 index 0000000..1ebcd87 --- /dev/null +++ b/wxc2_omc/element/toElement/loadvss.php @@ -0,0 +1,82 @@ +'2.1.8', 'sysid'=> $vms_sccp_sysId, 'selectsysid'=> $vms_sccp_slctSysId) + ); + + $vms_oidsysArr=array + ( + array('oid' => '2.2.1', 'sysid' => $vms_sysId, 'selectsysid' => $vms_slctSysId), + ); + GetParam($vms_oidsysArr); + GetParam($vms_sccpOidArr); +} +echo ""; +echo ""; + + +if($DEBUG) exit(); +echo ""; + +exit(); +?> \ No newline at end of file diff --git a/wxc2_omc/element/toElement/paramconf.php b/wxc2_omc/element/toElement/paramconf.php new file mode 100755 index 0000000..6374b77 --- /dev/null +++ b/wxc2_omc/element/toElement/paramconf.php @@ -0,0 +1,2315 @@ + + +"; + + + + +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; + +function checkInput($upstr,$flag) +{ + if ($flag == 16) + { + $checkOK = "0123456789ABCDEF"; + $checkOK_length = 16; + $showmsg ="Parameter must be a hexadecimal value!"; + } + else + { + $checkOK = "0123456789"; + $checkOK_length = 10; + $showmsg ="Parameter must be a decimal value!"; + } + + $checkStr = $upstr; + $allValid = 1; + $chkstr_len = strlen($checkStr); + for ($i = 0; $i < $chkstr_len; $i++){ + $ch = substr($checkStr,$i,1); + for ($j = 0; $j < $checkOK_length; $j++){ + if ($ch == substr($checkOK,$j,1)) + break; + } + if ($j == $checkOK_length){ + $allValid = 0; + break; + } + } + + if (!$allValid){ + echo ""; + exit(); + } +} + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.paramConf'; + return($tableName); +} + +//=======================Get value From submit=================== +//$unit_x_y表示显示页面第x组oid,第y个参数 +if($set == 'Save') +{ + + + $oIdstrarr = explode('-',$objIdStr); + $externID = explode('-',$instanceNo); + if($instanceNo == 'new') + { + $instanceNo = $newID; + } + //保存前检查Prefix设置参数 + if($setname == 'Prefix')//check prefix valid arwean: + { + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + {//get all valid prefix No + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr ORDER BY instanceNo"; + //echo $defSql; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $offset_ton_in = "0.0-0.3"; + $offset_ton_out="0.4-0.7"; + $prefix_num=0; + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=hexdec(getBitValue($row[initValue],$offset_enable)); + if($prefix_enable)//enable + { + $validPrefix[$prefix_num][inst_no]=$row[instanceNo]; + $validPrefix[$prefix_num][init_value]=$row[initValue]; + $validPrefix[$prefix_num][ton_in]=BinDec(getBitValue($row[initValue],$offset_ton_in)); + $validPrefix[$prefix_num][ton_out]=BinDec(getBitValue($row[initValue],$offset_ton_out)); +// echo "
      ".$prefix_num . ": ".$validPrefix[$prefix_num][inst_no]; +// echo "validPrefix[$prefix_num][ton_in]: {$validPrefix[$prefix_num][ton_in]}"; + $prefix_num++; + + } + } + }//end get valid prefix No + + {//get prefix value + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr + ORDER BY instanceNo + "; + // echo "$paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$validPrefix[$prefix_no][inst_no]) + { + $tempprefix=strtoupper($Row_1[initValue]); + $prefix = explode('E',$tempprefix); + if($prefix[0] =="") + $prefix[0]="--"; + $validPrefix[$prefix_no][prefix]=$prefix[0]; + //echo "
      asas->".$validPrefix[$prefix_no][prefix]; + $prefix_no++; + } + if($prefix_no >= $prefix_num) + break; + } + }//end get prefix value + //exit; + $setPrefix = strtoupper($unit_1_1); + $setTonIn = $unit_2_1; + $setTonOut = $unit_2_2; + + for($i=0; $i< $prefix_num; $i++) + { + //echo "
      ".$validPrefix[$i][inst_no].":".$validPrefix[$i][prefix].":".$validPrefix[$i][ton_in].":".$validPrefix[$i][ton_out]; + if($instanceNo==$validPrefix[$i][inst_no]) + continue; + if(($setPrefix==$validPrefix[$i][prefix]) + &&($setTonIn==$validPrefix[$i][ton_in]) + /*&&($setTonOut==$validPrefix[$i][ton_out])*/) + { + echo ""; + exit(); + } + } + } + //保存前检查dpc有没有设重 + //$unit_1_1表示显示页面是 第1组oid,第1个参数 + //$unit_1_2表示显示页面是 第1组oid,第2个参数 + if($setname =='Linkset') + { + checkInput($unit_1_1,10); + + $tmpDb = 'OBJ_222'; + $tmpTable = 'param_99'; + $tmpoid = '2.4.1'; + $objWhereStr = getLevelWhere($tmpoid); + + $setDPC = omc_keep_length(dechex($unit_1_1),0,6); + $setDPC = strtoupper($setDPC); + $setNetID = $unit_1_2; + + if($webname!='CNF')//cnf与cnf的dpc和ni可以重复。 + { + //dpc ni不能设重 + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND instanceNo !='$linkset' AND initValue LIKE '$setDPC%' + "; + $Result = mysqli_query($pubConn,$paramSql); + while($Row = mysqli_fetch_array($Result)) + { + $flag=getBitValue($Row[initValue],'3.2-3.2'); + if($flag&&($setNetID == bindec(getBitValue($Row[initValue],'3.0-3.1')))) + { + echo ""; + exit(); + } + } + } + + //不能与 spc 重复 + { + $oidstr = '2.2'; + $link_Db = 'OBJ_222'; + $link_Table = 'param_99'; + + $subSysNo = 99; + $spcobjWhereStr= ''; + $spcobjWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $link_Table + WHERE $spcobjWhereStr + "; + if($DEBUG) echo "$paramSql
      "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + $NIbit = getBitValue($Row[initValue],"0.$setNetID"); + $tmp = $setNetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + $spcobjWhereStr= ''; + $spcobjWhereStr =getLevelWhere($oidstr); + $paramSql = "SELECT initValue FROM $link_Table + WHERE $spcobjWhereStr AND instanceNo = '0' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $WXC2DPC = strtoupper($Row[initValue]); + + //$setDPC is hex +// if($setDPC == $WXC2PC) + if(hexdec($setDPC) == hexdec($WXC2DPC)) + { + echo ""; + exit(); + } + } + + //old dpc NI + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND instanceNo ='$linkset' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $oldDPC = hexdec(getBitValue($Row[initValue],'0.0-2.7')); + $oldNetID = getBitValue($Row[initValue],'3.0-3.1'); + $oldNetID = bindec($oldNetID); + + if($DEBUG) echo "Row[initValue] = $Row[initValue]
      "; + if($DEBUG) echo "oldNetID = $oldNetID
      "; + + //TG未定,选择一条未用的TG + if($trunkgp =="" && !($webname =='HLR' ||$webname =='VLR' || $webname =='MSC'||$webname=='SMSC')){ + $TGsysId = '322_99_99'; + $TG_sysIdArr = explode('_',$TGsysId); + $TG_sysTypeNo = $TG_sysIdArr[0]; + $TG_sysNo = $TG_sysIdArr[1]; + $TG_subSysNo = $TG_sysIdArr[2]; + + $TG_oidstr = '2.1.4'; + $TG_objWhereStr = getLevelWhere($TG_oidstr); + $TG_objDb = 'OBJ_'.$TG_sysTypeNo; + $TG_paramTable = 'param_'.$TG_sysNo; + + $TG_defSql = " SELECT initValue FROM paramConf WHERE $TG_objWhereStr"; + $TG_defRes = @mysqli_query($pubConn,$TG_defSql); + $TG_row = @mysqli_fetch_array($TG_defRes); + + $TG_paramSql = " SELECT initValue,readValue,instanceNo FROM $TG_paramTable + WHERE $TG_objWhereStr AND initValue ='$TG_row[initValue]' + "; + if($DEBUG) echo "TG_paramSql = $TG_paramSql
      "; + $TG_Result = mysqli_query($pubConn,$TG_paramSql); + $TG_Row = mysqli_fetch_array($TG_Result); + $trunkgp = $TG_Row[instanceNo]; + $strnew = "trunkgp=".$trunkgp; + $backurl = str_replace("trunkgp=",$strnew,$backurl); + if($DEBUG) echo "instanceNo = $TG_Row[instanceNo]
      "; + $flagoffset = "4.0-4.0"; + $TG_Row[initValue] = setBitValue($TG_Row[initValue],$flagoffset,1); + $TG_Row[initValue] = strtoupper($TG_Row[initValue]); + $TG_upSql = "UPDATE $TG_paramTable SET initValue = '$TG_Row[initValue]' + WHERE $TG_objWhereStr AND instanceNo='$trunkgp'"; + if($DEBUG) echo "GPGPGPPGPGPGPGP = $trunkgp
      "; + $delRes = @mysqli_query($pubConn,$TG_upSql); + echo mysqli_error($pubConn); + } + } + //保存前检查BTS设置参数 + //$unit_1_4表示显示页面是 第1组oid,第4个参数 + if($setname=='BTS') + { + if($unit_1_1==1)//Emergency Call flag==by Cell. + {//CELL ID 不能设重 + $objstrset='2.2.7'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo!='$externID[0]' + "; + $Result = mysqli_query($pubConn,$paramSql); + + while($Row=mysqli_fetch_array($Result)) + { + $CELLID=hexdec(getBitValue($Row[initValue],'03.0-04.7')); + $cellPrefix=hexdec(getBitValue($Row[initValue],'5.0-5.7')); + if($CELLID==$unit_1_3 && $set_PrefixNo == $cellPrefix) + { + echo ""; + exit(); + } + } + } + + $objstrset='2.2.7'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + if($DEBUG) echo "$paramSql
      "; + if($DEBUG) echo "$Row[initValue]
      "; + $Em_prefix_old = hexdec(getBitValue($Row[initValue],'05.0-5.7')); + } + + + for($j=1;$j$oIdstrarr[$j]"; + $unitNum = ${'unitNum_'.$j}; +// echo "
      num:$unitNum
      "; + for($i=1;$i<=$unitNum;$i++) + { + $tmpDef = ${'unitDef_'.$j.'_'.$i}; + $tmpValue = ${'unit_'.$j.'_'.$i}; + if($DEBUG) echo "
      tmpDef = $tmpDef"; + $defArr[$j][$i] = $tmpDef; + $tmpDefArr[$j] = explode('-',$tmpDef); + $sortArr[$j][$i] = $tmpDefArr[$j][0]; + $valueArr[$j][$i] = $tmpValue; + +// echo "$tmpValue
      "; + + } + $lastValue = ''; + $k = 0; + + asort($sortArr[$j]); + for(reset($sortArr[$j]); $key = key($sortArr[$j]); next($sortArr[$j])) + { + $unitValue = $valueArr[$j][$key]; + + $unitDefArr = explode('-',$defArr[$j][$key]); //例:0.0-0.7-input -toDec-high-0 + if(sizeof($unitDefArr) <= 1) + { + if($DEBUG) echo "
      nothing,just a name"; + continue; + } + $bgnOffset = $unitDefArr[0]; + $endOffset = $unitDefArr[1]; + $operType = $unitDefArr[2]; + $valueType = $unitDefArr[3]; + $fillWay = $unitDefArr[4]; + $fillChar = $unitDefArr[5]; + + $bgnOffsetArr = explode('.',$bgnOffset); + $bgnByte = $bgnOffsetArr[0]; + $bgnBit = $bgnOffsetArr[1]; + $endOffsetArr = explode('.',$endOffset); + $endByte = $endOffsetArr[0]; + $endBit = $endOffsetArr[1]; + $byteLen = $endByte - $bgnByte + 1; + $byteValue = ''; + if($DEBUG) echo "
      valueType = $valueType"; + switch($valueType) + { + case 'toDec': + if($bgnBit > 0 ||$endBit < 7) + { + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = DecBin($unitValue); + if($DEBUG) echo "
      bitValue = $bitValue "; + $bitValue = omcStrFill($bitValue,$bitLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($bitValue,$bitLen,$fillWay,$fillChar)"; + $bitValueArr[$k] = $bitValue; + if($DEBUG) echo "
      bitValueArr[$k] = {$bitValueArr[$k]}"; + if($endBit == 7) + {//发现这个单元结束,并没有跨byte,这时需要组成一个byte值 + $bitValue = ''; + for($bitNo=0; $bitNo<=$k; $bitNo++) + { + if($DEBUG) echo "
      bitValueArr[$bitNo] = {$bitValueArr[$bitNo]}"; + $bitValue = $bitValueArr[$bitNo].$bitValue; + } + $k=0; + if($DEBUG) echo "
      bitValue = $bitValue"; + $byteLen = strlen($bitValue) / 8; + if($DEBUG) echo "
      byteLen = $byteLen"; + $byteValue = BinDec($bitValue); + $byteValue = DecHex($byteValue); + $strLen = $byteLen*2; + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + else + {//否则,继续组合下一个bit组 + $byteValue = ''; + $k++; + } + } + else + { + $byteValue = DecHex($unitValue); + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + if($DEBUG) echo "
      byteValue = $byteValue"; + break; + case 'keepDec': + //echo "
      Error:keepDec"; + $byteValue = $unitValue - 0; + break; + case 'toHex': + echo "
      Error:toHex"; + break; + case 'keepHex': + if($bgnBit > 0 || $endBit < 7) + {//这里的处理不够全面,没有对=7的进行收尾 + $byteValue = $unitValue; + $strLen = $byteLen; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + $bitValue = DecBin(HexDec($byteValue)); + $byteValue=''; + $bitLen = $byteLen*8 - $bgnBit - (7 - $endBit) ; //1 BYTE = 8 bit + $bitValue = omcStrFill($bitValue,$bitLen,'high','0'); + if($DEBUG) echo "
      bitValue = $bitValue"; + $bitValueArr[$k] = $bitValue; + $k++; + } + else + { + $k=0; + $byteValue = $unitValue; + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + if($DEBUG) echo "
      omcStrFill($byteValue,$strLen,$fillWay,$fillChar)"; + } + break; + case 'toAscii': + if($bgnBit > 0 ||$endBit < 7) + { + echo "
      Error:toAscii"; + exit(1); + } + else + { + $tmpLen=strlen($unitValue); + for($i=0;$i<$tmpLen;$i++) + { + $unitChar = substr($unitValue,$i,1); + $decValue = ord($unitChar); //ascii -> dec + $byteValue .= DecHex($decValue); + if(strlen($byteValue) < 2) + { + $byteValue = '0'.$byteValue; + } + } + $strLen = $byteLen*2; + $byteValue = omcStrFill($byteValue,$strLen,$fillWay,$fillChar); + } + break; + default: + echo "Error:Unknown valueType"; + break; + } + if($DEBUG) echo "
      byteValue = $byteValue "; + //--><-//$lastValue = $byteValue.$lastValue; + $lastValue = $lastValue.$byteValue; + + } + + if($DEBUG) echo "
      lastValue = $lastValue "; + $setValue = $lastValue; + } + + { + $objWhereStr =getLevelWhere($oIdstrarr[$j]); + $setValue = strtoupper($setValue); + checkInput($setValue,16); + $updSql = "UPDATE $paramTable SET initValue = '$setValue' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + } + } + if($setname=='BTS') + { + {//update the lac value of cell + $sysId = '322_99_99'; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $oidstr = '2.2.7'; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $istNo = $externID[0]; + //$lacValue = $externID[1]; + $lacValueHex = omc_keep_length(strtoupper(dechex($LAC)),0,4); + $selSql = "select initValue from $paramTable where $objWhereStr AND instanceNo ='$istNo'"; + $Result = mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $row=@mysqli_fetch_array($Result); + $setValue = $row[initValue]; + $setValue = setBitValue($setValue,'1.0-2.7',$lacValueHex); + $updSql = "update $paramTable set initValue = '$setValue' + where $objWhereStr AND instanceNo ='$istNo' "; + mysqli_query($pubConn,$updSql); + } + } + +{//关联参数设置 + $oIdstrarr = explode('-',$objIdStr); + switch($setname) + { + case 'Trunk Group': + { + if($webname!='BSC')//bsc don't need to set alternative TG + {//add by arwean + $objstrset='2.1.4'; + $objWhereStr =getLevelWhere($objstrset); + + $paramSql = " SELECT initValue FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$trunkgp' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + $hex_setAltTg = strtoupper(DecHex($set_AlterTg)); + $hex_setAltTg = omc_keep_length($hex_setAltTg,0,2); + if($alterTgFlag==1) + $Row[initValue] = setBitValue($Row[initValue],'7.0-7.7',$hex_setAltTg); + $Row[initValue] = setBitValue($Row[initValue],'4.6-4.6',$alterTgFlag); + //echo $Row[initValue]; + //exit(); + $updSql = "update $paramTable set initValue = '$Row[initValue]' + where $objWhereStr AND instanceNo ='$trunkgp' "; + mysqli_query($pubConn,$updSql); + }//end add + + break; + } + case 'Linkset'://修改linkset的dpc,ni修改相应routing与TG,GTT的dpc,ni + { + switch($webname) + { + case 'HLR': + $SSN = 6; + break; + case 'VLR': + $SSN = 7; + break; + case 'MSC': + $SSN = 8; + break; + case 'SMSC': + $SSN = 11; + break; + } + + $tmpDb = 'OBJ_222'; + $tmpTable = 'param_99'; + $tmpoid = '2.4.1'; + $objWhereStr = getLevelWhere($tmpoid); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND instanceNo ='$linkset' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $DPC = hexdec(getBitValue($Row[initValue],'0.0-2.7')); + $NetID = getBitValue($Row[initValue],'3.0-3.1'); + $NetID = bindec($NetID); + $newNetID = $NetID; + if($DEBUG) echo "Row[initValue] = $Row[initValue]"; + if($DEBUG) echo "NetID = $NetID"; + + //关联GTT的DPC 关联GTT的Network indicator + if($webname =='Switch' || $webname =='VSS' || $webname =='HLR' ||$webname =='VLR' || $webname =='MSC'|| $webname =='SMSC') + { + $tmpDb = 'OBJ_223'; + $tmpTable = 'param_99'; + $tmpoid = '2.2'; + $objWhereStr = getLevelWhere($tmpoid); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr + "; + $Result = mysqli_query($pubConn,$paramSql); + $num = 1; + while($Row = mysqli_fetch_array($Result)) + { + $GTT_DPC = hexdec(getBitValue($Row[initValue],'24.0-26.7')); + $GTT_SSN = hexdec(getBitValue($Row[initValue],'27.0-27.7')); + $GTT_NetID = hexdec(getBitValue($Row[initValue],'23.0-23.7')); + $flag = hexdec(getBitValue($Row[initValue],'00.0-00.7')); + if($GTT_DPC == $oldDPC && $flag == 1 && $GTT_NetID == $oldNetID) + { + $DPC_GTT = dechex($DPC); + $DPC_GTT = omc_keep_length($DPC_GTT,0,6); + $Row[initValue] = setBitValue($Row[initValue],'24.0-26.7',$DPC_GTT); + $NetID_GTT = dechex($NetID); + $NetID_GTT = omc_keep_length($NetID_GTT,0,2); + $Row[initValue] = setBitValue($Row[initValue],'23.0-23.7',$NetID_GTT); + $Row[initValue] = strtoupper($Row[initValue]); + $updSql = "UPDATE $tmpTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$Row[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + $num++; + } + } + } + //else//关联TG的DPC 关联TG的Network indicator + { + $tmpDb = 'OBJ_322'; + $tmpTable = 'param_99'; + $tmpoid = '2.1.4'; + $objWhereStr = getLevelWhere($tmpoid); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $tmpTable + WHERE $objWhereStr AND instanceNo ='$trunkgp' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $DPC_TG = dechex($DPC); + $DPC_TG = omc_keep_length($DPC_TG,0,8); + $Row[initValue] = setBitValue($Row[initValue],'0.0-3.7',$DPC_TG); + $NetID = dechex($NetID); + $NetID = omc_keep_length($NetID,0,2); + $Row[initValue] = setBitValue($Row[initValue],'5.0-5.7',$NetID); + $Row[initValue] = strtoupper($Row[initValue]); + $updSql = "UPDATE $tmpTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$trunkgp' + "; + mysqli_query($pubConn,$updSql); + } + //修改routing DPC + { + $routeNO = $externID[1]; + $DPC = dechex($DPC); + $DPC = omc_keep_length($DPC,0,6); + $AlternativeArr=array( + array('Linkset DPC', '0.0-2.7', 'DPC'), + array('Normal linkset', '3.0-3.7', 'linkset'), + array('Alternative linkset', '4.0-4.7', 'Alternative') + ); + $objDb = 'OBJ_222'; + $paramTable = 'param_99'; + + if($oldNetID == $newNetID){ + $temp = $newNetID+1; + $oidstr = '2.6.'.$temp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo = '$routeNO' + "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + $Row_2[initValue] = setBitValue($Row_2[initValue],$AlternativeArr[0][1],$DPC); + $Row_2[initValue] = strtoupper($Row_2[initValue]); + $updSql = "UPDATE $paramTable SET initValue = '$Row_2[initValue]' + WHERE $objWhereStr AND instanceNo = '$routeNO' + "; + mysqli_query($pubConn,$updSql); + /* + if('AAS' == $externID[2]){ + $NIoffset = array("0.0-0.0","0.1-0.1","0.2-0.2","0.3-0.3"); + $oidstr = '2.2'; + $aas_link_Db = 'OBJ_222'; + $aas_link_Table = 'param_11'; + //$subSysNo = $externID[3]; + $subSysNo = 99; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $aas_link_Table + WHERE $objWhereStr AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + $aas_Result = mysqli_query($pubConn,$paramSql); + $aas_Row = mysqli_fetch_array($aas_Result); + + $NIbit = getBitValue($aas_Row[initValue],$NIoffset[$newNetID]); + $tmp = $newNetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + if($DEBUG) echo "oldNetID = $oldNetID
      "; + if($DEBUG) echo "newNetID = $newNetID
      "; + if($DEBUG) echo "$NIbit
      "; + if($DEBUG) echo "$oidstr
      "; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $DPC = strtoupper($DPC); + $updSql = "UPDATE $aas_link_Table SET initValue = '$DPC' + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$updSql
      "; + mysqli_query($pubConn,$updSql); + } + */ + }else{ + $temp = $oldNetID+1; + $oidstr = '2.6.'.$temp; + $objWhereStr_old= ''; + $objWhereStr_old =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr_old AND instanceNo = '$routeNO' + "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + $Alternative = getBitValue($Row_2[initValue],$AlternativeArr[2][1]); + $updSql = "UPDATE $paramTable SET initValue = '0000008080' + WHERE $objWhereStr_old AND instanceNo = '$routeNO' + "; + mysqli_query($pubConn,$updSql); + + $temp = $oldNetID+2; + $oidstr = '2.7.'.$temp; + $objWhereStr_old= ''; + $objWhereStr_old =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr_old AND instanceNo = '$routeNO' + "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + $ACNoldvalue = $Row_2[initValue]; + + $paramSql = " SELECT initValue FROM paramConf WHERE $objWhereStr_old + "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + $ACNdefvalue= $Row_2[initValue]; + + $updSql = "UPDATE $paramTable SET initValue = '$ACNdefvalue' + WHERE $objWhereStr_old AND instanceNo = '$routeNO' + "; + mysqli_query($pubConn,$updSql); + + {//拷贝 + $temp = $newNetID+1; + $oidstr = '2.6.'.$temp; + $objWhereStr_new= ''; + $objWhereStr_new =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE initValue = '0000008080' AND $objWhereStr_new + "; + $Result_1 = mysqli_query($pubConn,$paramSql); + $Row_1 = mysqli_fetch_array($Result_1); + + $Row_1[initValue] = setBitValue($Row_1[initValue],$AlternativeArr[0][1],$DPC); + $hex_linkset = dechex($linkset); + $hex_linkset = omc_keep_length($hex_linkset,0,2); + $Row_1[initValue] = setBitValue($Row_1[initValue],$AlternativeArr[1][1],$hex_linkset); + if(isset($Alternative)){ + $Alternative = omc_keep_length($Alternative,0,2); + $Row_1[initValue] = setBitValue($Row_1[initValue],$AlternativeArr[2][1],$Alternative); + } + $Row_1[initValue] = strtoupper($Row_1[initValue]); + $updSql = "UPDATE $paramTable SET initValue = '$Row_1[initValue]' + WHERE $objWhereStr_new AND instanceNo = '$Row_1[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + $temp = $newNetID+2; + $oidstr = '2.7.'.$temp; + $objWhereStr_new= ''; + $objWhereStr_new =getLevelWhere($oidstr); + $updSql = "UPDATE $paramTable SET initValue = '$ACNoldvalue' + WHERE $objWhereStr_new AND instanceNo = '$Row_1[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + } + /* + if('AAS' == $externID[2]){ + $aas_link_Db = 'OBJ_222'; + $aas_link_Table = 'param_11'; + $NIoffset = array("0.0-0.0","0.1-0.1","0.2-0.2","0.3-0.3"); + // $subSysNo = $externID[3]; + $subSysNo = 99; + + $oidstr = '2.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $aas_link_Table + WHERE $objWhereStr AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + $aas_Result = mysqli_query($pubConn,$paramSql); + $aas_Row = mysqli_fetch_array($aas_Result); + + $NIbit = getBitValue($aas_Row[initValue],$NIoffset[$oldNetID]); + $tmp = $oldNetID+1+$NIbit*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $updSql = "UPDATE $aas_link_Table SET initValue = '000000' + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + mysqli_query($pubConn,$updSql); + + $NIbit_new = getBitValue($aas_Row[initValue],$NIoffset[$newNetID]); + $tmp = $newNetID+1+$NIbit_new*4; + $oidstr = '2.3.'.$tmp; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $DPC = strtoupper($DPC); + $updSql = "UPDATE $aas_link_Table SET initValue = '$DPC' + WHERE $objWhereStr AND instanceNo = '0' AND subSysNo = '$subSysNo' + "; + if($DEBUG) echo "$paramSql
      "; + mysqli_query($pubConn,$updSql); + } + */ + } + } + break; + } + case 'Prefix': + { + $tempRAC=11; + $objstrset='2.1.3'; + $objWhereStr =getLevelWhere($objstrset); + $hex_set_tg = $HEXtrunkgp = omc_keep_length(dechex($trunkgp),0,2); + $updSql = "UPDATE $paramTable SET initValue = '$hex_set_tg' + WHERE $objWhereStr AND instanceNo = '$instanceNo'"; + //echo $updSql; + if($webname != 'BSC')//Emergency prefix'TG 不一定要是相应的BTS对应tg,所以不用改变。2006-7-18 14:56 arwean + mysqli_query($pubConn,$updSql); + //exit(); + + //Set flag = 1 + $objstrset='2.1.2'; + $objWhereStr =getLevelWhere($objstrset); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' + "; + + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $Row[initValue] = setBitValue($Row[initValue],'10.7-10.7','1'); + $Row[initValue] = strtoupper($Row[initValue]); + $updSql = "UPDATE $paramTable SET initValue = '$Row[initValue]' + WHERE $objWhereStr AND instanceNo = '$instanceNo' + "; + mysqli_query($pubConn,$updSql); + break; + } + case 'BTS': //修改BTS Prefix + { + $objstrset='2.2.7'; + $objWhereStr =getLevelWhere($objstrset); + + $paramSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $org_PrefixNo=hexdec(getBitValue($Row[initValue],'5.0-5.7')); + if($org_Prefix==0 || $org_PrefixNo != $set_PrefixNo)//由于prefixno默认为0,所以也要更新一下 + { + + $hexPrefixNo = strtoupper(omc_keep_length(dechex($set_PrefixNo),'0','2')); + $setValue = setBitValue($Row[initValue],'5.0-5.7',$hexPrefixNo); + + $updSql = "update $paramTable set initValue='$setValue' + where $objWhereStr and instanceNo='$instanceNo' "; + mysqli_query($pubConn,$updSql); + + //update prefixno (enable, Emergency call) + { + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $offset_enable = "10.7-10.7"; + $offset_calltype = "10.4-10.6"; + + $selSql = " SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr and instanceNo='$set_PrefixNo' "; + //echo $defSql; + $selRes = @mysqli_query($pubConn,$selSql); + $Row = @mysqli_fetch_array($selRes); + $Row[initValue] = setBitValue($Row[initValue],$offset_enable,'1'); + $Row[initValue] = setBitValue($Row[initValue],$offset_calltype,'001'); + + $updSql = "update $paramTable set initValue='$Row[initValue]' where $objWhereStr and instanceNo='$set_PrefixNo'"; + @mysqli_query($pubConn,$updSql); + } + //delete the org_PrefixNo if there is no other cells use it. + if($org_PrefixNo != $set_PrefixNo) + { + $objstrset='2.2.7'; + $objWhereStr =getLevelWhere($objstrset); + + $paramSql = " SELECT initValue FROM $paramTable + WHERE $objWhereStr "; + $result = mysqli_query($pubConn,$paramSql); + $otherUsed=0; + while($row = mysqli_fetch_array($result)) + { + $prefixNo=hexdec(getBitValue($row[initValue],'5.0-5.7')); + if($prefixNo==$org_PrefixNo) + { + $otherUsed=1; + break; + } + } + if($otherUsed==0)//delete $org_PrefixNo. + { + $tmpParamConfTable='paramConf'; + $tmpObjIdStr='2.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue,level_3 FROM $tmpParamConfTable + WHERE $levelWhere AND (level_3='1' OR level_3='2' OR level_3='3') ORDER BY level_3 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $i=0; + unset($tmpDefaultValueArr); + while($rows=mysqli_fetch_array($result)){ + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $tmpDefaultValueArr[$i][initValue]=$rows[initValue]; + //echo "
      level_3=$rows[level_3]"; + $tmpDefaultValueArr[$i][level_3]=$rows[level_3]; + $i++; + } + if($DEBUG) echo "
      $aasprefixArr
      "; + + for($i=0;$iupdateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + } +// exit; + } + } + } + break; + } + default: + } + echo mysqli_error($pubConn); +} + + + +if($setname=='Trunk Group') +{ + + + + //==================trunk group back off flag for all system========================= + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $old_initValue=$rows[initValue]; + //back_off_flag_checkbox + $new_initValue=setBitValue($old_initValue,'6.2',$back_off_flag_checkbox); + + $updSql = "UPDATE param_99 SET initValue = '$new_initValue' + WHERE level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + if($webname=='BSC') + { + + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $old_initValue=$rows[initValue]; + //=================CDR flag========== + $new_initValue=setBitValue($old_initValue,'4.1',$cdr_flag_select); + + //=================location=========== + if($location_select==0) + { + $bit0=0; + $bit1=0; + } + else if($location_select==1) + { + $bit0=1; + $bit1=0; + } + else if($location_select==2) + { + $bit0=0; + $bit1=1; + } + else if($location_select==3) + { + $bit0=1; + $bit1=1; + } + + $new_initValue=setBitValue($new_initValue,'6.6',$bit0); + $new_initValue=setBitValue($new_initValue,'6.7',$bit1); + + //============radio channel control======= + $new_initValue=setBitValue($new_initValue,'10.7',$radio_channel_control_select); + + //=============protocol stack for BSC======= + $new_initValue=setBitValue($new_initValue,'12.7',0); + $new_initValue=setBitValue($new_initValue,'12.6',0); + $new_initValue=setBitValue($new_initValue,'12.5',0); + $new_initValue=setBitValue($new_initValue,'12.4',0); + $new_initValue=setBitValue($new_initValue,'12.3',0); + $new_initValue=setBitValue($new_initValue,'12.2',0); + $new_initValue=setBitValue($new_initValue,'12.1',0); + $new_initValue=setBitValue($new_initValue,'12.0',$protocol_stack_bsc_select); + + + + $new_initValue=strtoupper($new_initValue); + $updSql = "UPDATE param_99 SET initValue = '$new_initValue' + WHERE level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + //=======================Full rate speech V3====================================== + //half_rate_speech_v1_checkbox + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $old_initValue=$rows[initValue]; + + if(!isset($full_rate_speech_v3_checkbox)) + $full_rate_speech_v3_checkbox=0; + if(!isset($full_rate_speech_v2_checkbox)) + $full_rate_speech_v2_checkbox=0; + if(!isset($full_rate_speech_v1_checkbox)) + $full_rate_speech_v1_checkbox=0; + if(!isset($half_rate_speech_v3_checkbox)) + $half_rate_speech_v3_checkbox=0; + if(!isset($half_rate_speech_v1_checkbox)) + $half_rate_speech_v1_checkbox=0; + + $new_initValue=setBitValue($old_initValue,'10.0',$full_rate_speech_v3_checkbox); + $new_initValue=setBitValue($new_initValue,'10.1',$full_rate_speech_v2_checkbox); + $new_initValue=setBitValue($new_initValue,'10.2',$full_rate_speech_v1_checkbox); + $new_initValue=setBitValue($new_initValue,'10.3',$half_rate_speech_v3_checkbox); + $new_initValue=setBitValue($new_initValue,'10.4',$half_rate_speech_v1_checkbox); + + $updSql = "UPDATE param_99 SET initValue = '$new_initValue' + WHERE level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + } +} + +//======================add the trunk three parameters========== + + if($setname=='Trunk Group'&&$webname=='IUA') + { + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $old_initValue=getBitValue($rows[initValue],'0.0-12.7'); + + //==NFAS_flag + $nfas_flag_hex=dechex($nfas_flag_select); + if(strlen($nfas_flag_hex)==1) + $nfas_flag_hex="0".$nfas_flag_hex; + //==Primary_D_channel + $Primary_D_channel_hex=dechex($Primary_D_channel_text); + if(strlen($Primary_D_channel_hex)==1) + $Primary_D_channel_hex="0".$Primary_D_channel_hex; + //==Backup_D_channel + $Backup_D_channel_hex=dechex($Backup_D_channel_text); + if(strlen($Backup_D_channel_hex)==1) + $Backup_D_channel_hex="0".$Backup_D_channel_hex; + + $new_initValue=$old_initValue.$nfas_flag_hex.$Primary_D_channel_hex.$Backup_D_channel_hex; + //==protocol stact + //$protocol_stact_hex=dechex($protocol_stack_select); + //if(strlen($protocol_stact_hex)==1) + $protocol_stack_select=$protocol_stack_select+0; + if($protocol_stack_select==0) + $v='0'; + else + $v='1'; + + $new_initValue=setBitValue($new_initValue,'12.0',$v); + /* + echo ""; + */ + + $updSql = "UPDATE param_99 SET initValue = '$new_initValue' + WHERE level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp + "; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + + /* + echo "\n"; + */ + } + + + + + + +if($DEBUG){ + echo "
      debug"; +}else{//return page + echo ""; + exit(); +} + + + + + + +}//end of if($set == 1) + +//=======================Show GUI ======================== +?> + + + +" > +"; +echo ""; +echo ""; +echo "Configuration > Network > "; +if(isset($devicename)) +{ + $backurl1 = str_replace("wxc2_sp_signaling","wxc2_sp",$backurl); + echo "$devicename > "; +} +$tmp_name = strstr($instanceNo,$routingNo[2]);//if instanceNo = 0-0-bss-0, the name should be bss-0 but not bss. +$showLink = $setname=='Linkset' ? $tmp_name : $webname; + +echo "$showLink > "; +echo "$setname"; +echo ""; +echo ""; +switch ($showLink) +{ + case 'BSC': + if($setname=='BTS') + $helpId='2.19'; + break; + + default: + $helpId='2'; + break; +} +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo "
      "; + + +echo ""; +echo ""; +$buttonStyle = "cursor:pointer; left: 1; top: 2; width: 80; height: 22; position: relative"; +echo ""; + +echo ""; +echo "
      "; +/* +if($instanceNo == 'new' || $oIdstrarr[0] =='new'){ + echo "Add a $setname:  "; +}else{ + echo "Edit $setname:  "; +}*/ +echo " "; +echo ""; +echo "   "; +echo ""; +echo "$strBack"; +echo "
      "; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +if($setname != 'BTS' && $oIdstrarr[0] !='no') +{ + {//xxx No. + //第0组用来查找未用的instanceNo,查找时与默认值比较,相同为可用instanceNo + echo ""; + echo ""; + if($instanceNo == 'new') + { + $objDb = omcGetObjDb($sysTypeNo); + $paramConfTable = omcGetObjTbl($sysTypeNo,paramConf); + $objWhereStr =getLevelWhere($oIdstrarr[0]); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $DefValue = $defRow[initValue]; + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE initValue = '$DefValue' AND $objWhereStr order by instanceNo + "; + if($setname=='Prefix') + { + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr order by instanceNo "; + } + $result = mysqli_query($pubConn,$paramSql); + $nShowsize ='40%'; + $find=0; + echo ""; + } + else{ + echo ""; + } + + echo ""; + } +} +//要显示参数的oid,必须是同一个sysTypeNo 下的oid +for($j=1;$j"; +if($setname=="Trunk Group") +{ + //===============BSC parameter CDR_flag,location,Radion channel control,protocol stack===== + + if($webname=='BSC') + { + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + //======CDR flag + $cdr_flag=getBitValue($rows[initValue],'4.1-4.1')+0; + $cdr_flag_label=array(0=>"OFF",1=>"ON"); + echo ""; + echo ""; + echo ""; + echo ""; + //======location + $location=bindec(getBitValue($rows[initValue],'6.6-6.7'))+0; + $location_label=array(0=>"MSC-0",1=>"MSC-1",2=>"Both",3=>"Spare"); + echo ""; + echo ""; + echo ""; + echo ""; + //======Radio channel control + $radio_channel_control=getBitValue($rows[initValue],'10.7-10.7')+0; + $radio_channel_control_label=array(0=>"Depend On MS",1=>"Control By Operator"); + echo ""; + echo ""; + echo ""; + echo ""; + //======protocol stack on BSC + $protocol_stack_bsc=hexdec(getBitValue($rows[initValue],'12.0-12.7'))+0; + $protocol_stack_bsc_label=array(0=>"ITU",1=>"ANSI"); + echo ""; + echo ""; + echo ""; + echo ""; + + } + + //================================add Back off flag parameter to all system========== + { + + + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //=====get the parameter of Back off flag 6.2-6.2 + $back_off_flag=getBitValue($rows[initValue],'6.2-6.2')+0; + if($back_off_flag==1) + $is_checked="checked"; + else + $is_checked=""; + + echo ""; + echo ""; + echo ""; + echo ""; + } + //===================add parameter 'Full Rate Speech V3' 'Full Rate Speech V2' ====== + //==========='Full Rate Speech V1' 'Half Rate Speech V3' 'Half Rate Speech V1' ====== + if($webname=='BSC') + { + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //=========radio Channel Control==== + $tmp_radio_channel_control=getBitValue($rows[initValue],'10.7-10.7')+0; + if($tmp_radio_channel_control==1) + $is_disabled=""; + else + $is_disabled="disabled"; + //=====parameter of 'Full Rate Speech V3' + $full_rate_speech_v3=getBitValue($rows[initValue],'10.0-10.0')+0; + if($full_rate_speech_v3==1) + $is_checked="checked"; + else + $is_checked=""; + + echo ""; + echo ""; + echo ""; + echo ""; + + //=====parameter of 'Full Rate Speech V2' + $full_rate_speech_v2=getBitValue($rows[initValue],'10.1-10.1')+0; + if($full_rate_speech_v2==1) + $is_checked="checked"; + else + $is_checked=""; + + echo ""; + echo ""; + echo ""; + echo ""; + + //=====parameter of 'Full Rate Speech V1' + $full_rate_speech_v1=getBitValue($rows[initValue],'10.2-10.2')+0; + if($full_rate_speech_v1==1) + $is_checked="checked"; + else + $is_checked=""; + + echo ""; + echo ""; + echo ""; + echo ""; + + //=====parameter of 'Half Rate Speech V3' + $half_rate_speech_v3=getBitValue($rows[initValue],'10.3-10.3')+0; + if($half_rate_speech_v3==1) + $is_checked="checked"; + else + $is_checked=""; + + echo ""; + echo ""; + echo ""; + echo ""; + + //=====parameter of 'Half Rate Speech V1' + $half_rate_speech_v1=getBitValue($rows[initValue],'10.4-10.4')+0; + if($half_rate_speech_v1==1) + $is_checked="checked"; + else + $is_checked=""; + + echo ""; + echo ""; + echo ""; + echo ""; + + } +} + + +if($setname=="Trunk Group" && $webname!='BSC') +{ + //echo "
      $webname"; + {//get all TG (added by arwean 2006-03-29) + $tmpDB = 'OBJ_222'; + $tmpobjIdStr='2.4.1'; + $levelWhere = getLevelWhere($tmpobjIdStr); + $paramTab='param_99'; + $getSql="SELECT initValue,instanceNo FROM $paramTab + WHERE $levelWhere + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + $i=0; + while($rows=mysqli_fetch_array($result)) + { + if($DEBUG)echo "
      initValue=$rows[initValue]"; + $unitValue=getBitValue($rows[initValue],'4.0-4.7');//system type + $usedLinksetArr[$i][type]=hexdec($unitValue); + if($unitValue==0) + continue; + if(($webname=='PCR' || $webname=='Switch') + && ($usedLinksetArr[$i][type]==1 || $usedLinksetArr[$i][type]==2 || $usedLinksetArr[$i][type]==3))//don't need bsc + continue; + if($webname=='AAS' && $usedLinksetArr[$i][type]!=2) + continue; + if($webname=='VSS' && $usedLinksetArr[$i][type]!=3) + continue; + $usedLinksetArr[$i][sysNo]=hexdec(getBitValue($rows[initValue],'5.0-5.7')); + $usedLinksetArr[$i][dpc]=getBitValue($rows[initValue],'0.0-2.7'); + $usedLinksetArr[$i][name]=getBitValue($rows[initValue],'7.0-16.7'); + if($usedLinksetArr[$i][name]==0) + $usedLinksetArr[$i][name]=$rows[instanceNo]; + else + $usedLinksetArr[$i][name]=trim(toAscii($usedLinksetArr[$i][name])); + $usedLinksetArr[$i][ni]=bindec(getBitValue($rows[initValue],'3.0-3.1')); + $usedLinksetArr[$i][linkset]=$rows[instanceNo]; + if($DEBUG) + echo "
      linkset={$usedLinksetArr[$i][linkset]}"; + $i++; + } + + //============hide temp==== + /* + for($i=0; $i< sizeof($usedLinksetArr); $i++) + { + + $ElementNo=sizeof($ElementArr); + + $tmpOpcValue=strtoupper(omc_keep_length($usedLinksetArr[$i][dpc],0,8)); + $tmpWhere="initValue LIKE "."'$tmpOpcValue"."%'"; + $tmpDB='OBJ_322'; + $tmpTab = 'param_99'; + $tmpObjIdStr='2.1.4'; + $levelWhere = getLevelWhere($tmpObjIdStr); + $getSql="SELECT initValue,instanceNo FROM $tmpTab + WHERE $levelWhere AND $tmpWhere + "; + if($DEBUG) + echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + + while($rows=mysqli_fetch_array($result)) + { + if(hexdec(getBitValue($rows[initValue],'5.0-5.7'))==$usedLinksetArr[$i][ni]) + { + $ElementArr[$ElementNo][tg]=$rows[instanceNo]; + $ElementArr[$ElementNo][name]=$usedLinksetArr[$i][name]; + break; + } + } + } + */ + //==================================================== + //==========================get the ss7 and isdn tg no=========================== + + if($webname=='IUA'||$webname=='Switch') + { + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $alternative_tg_count=0; + if($rows) + { + do{ + + $device_type_tmp=hexdec(getBitValue($rows[initValue],'1.0-1.7'))+0; + $tg_tmp=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; + $title_tmp=getBitValue($rows[initValue],'14.0-23.7'); + if($device_type_tmp==16||$device_type_tmp==17) + { + if($tg_tmp!=$trunkgp) + { + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($title_tmp,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $ElementArr[$alternative_tg_count][tg]=$tg_tmp; + $ElementArr[$alternative_tg_count][name]=trim($temp); + $alternative_tg_count++; + } + } + + //echo "Flag=$Flag
      "; + }while($rows=mysqli_fetch_array($result)); + } + } + else if($webname=='VSS') + { + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $alternative_tg_count=0; + if($rows) + { + do{ + + $device_type_tmp=hexdec(getBitValue($rows[initValue],'1.0-1.7'))+0; + $tg_tmp=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; + $title_tmp=getBitValue($rows[initValue],'14.0-23.7'); + if($device_type_tmp==3) + { + if($tg_tmp!=$trunkgp) + { + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($title_tmp,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $ElementArr[$alternative_tg_count][tg]=$tg_tmp; + $ElementArr[$alternative_tg_count][name]=trim($temp); + $alternative_tg_count++; + } + } + + //echo "Flag=$Flag
      "; + }while($rows=mysqli_fetch_array($result)); + } + } + else if($webname=='PCR') + { + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $alternative_tg_count=0; + if($rows) + { + do{ + + $device_type_tmp=hexdec(getBitValue($rows[initValue],'1.0-1.7'))+0; + $tg_tmp=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; + $title_tmp=getBitValue($rows[initValue],'14.0-23.7'); + if($device_type_tmp==4) + { + if($tg_tmp!=$trunkgp) + { + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($title_tmp,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $ElementArr[$alternative_tg_count][tg]=$tg_tmp; + $ElementArr[$alternative_tg_count][name]=trim($temp); + $alternative_tg_count++; + } + } + + //echo "Flag=$Flag
      "; + }while($rows=mysqli_fetch_array($result)); + } + } + else if($webname=='CNF') + { + $database="OBJ_225"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $alternative_tg_count=0; + if($rows) + { + do{ + + $device_type_tmp=hexdec(getBitValue($rows[initValue],'1.0-1.7'))+0; + $tg_tmp=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; + $title_tmp=getBitValue($rows[initValue],'14.0-23.7'); + if($device_type_tmp==5) + { + if($tg_tmp!=$trunkgp) + { + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($title_tmp,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $ElementArr[$alternative_tg_count][tg]=$tg_tmp; + $ElementArr[$alternative_tg_count][name]=trim($temp); + $alternative_tg_count++; + } + } + + //echo "Flag=$Flag
      "; + }while($rows=mysqli_fetch_array($result)); + } + } + + //=============================================================================== + if($webname=='Switch' || $webname=='PCR'||$webname=='IUA'||$webname=='VSS'||$webname=='CNF') + { + $tmpEleNo=sizeof($ElementArr); + $ElementArr[$tmpEleNo][tg]=253; + $ElementArr[$tmpEleNo][name]='Loopback'; + } + }//end get all tg + { + $objstrset='2.1.4'; + $objWhereStr =getLevelWhere($objstrset); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$trunkgp' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $alternativeTG = hexdec(getBitValue($Row[initValue],'7.0-7.7')); + $alterTgFlag = (getBitValue($Row[initValue],'4.6-4.6')); + } + {//alterTgFlag + echo ""; + echo ""; + echo ""; + echo ""; + }//end flag + + +// echo "
      ParametersValue
      $setname No."; + /* + echo ""; + */ + //change to select a prefix no automatically + while($row=mysqli_fetch_array($result)) + { + if($setname=='Prefix') + { + $pre_Flag = BinDec(getBitValue($row[initValue],'10.7-10.7')); + if($pre_Flag==0) + { + $find=1; + break; + } + } + } + echo "{$row[instanceNo]}"; + echo ""; + if(!$find) + { + echo ""; + } + echo "$routingNo[0]
      CDRR Flag"; + echo ""; + echo "
      Location"; + echo ""; + echo "
      Radio Channel Control"; + echo ""; + echo "
      Protocol Stack"; + echo ""; + echo "
      Back Off Flag"; + echo "Enable"; + echo "
      Full Rate Speech V3"; + echo "Enable"; + echo "
      Full Rate Speech V2"; + echo "Enable"; + echo "
      Full Rate Speech V1"; + echo "Enable"; + echo "
      Half Rate Speech V3"; + echo "Enable"; + echo "
      Half Rate Speech V1"; + //onClick=\"javascript:selCheckBox(this)\" + echo "Enable"; + echo "
      Alternative TG Flag"; + $checkeStr = $alterTgFlag == 1 ? 'checked':''; + echo "Enable"; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + //=================================webname=IUA========================================== + if($webname=="IUA") + { + + //===============get the all ports instanceNo belong the ISDN trunk group========= + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $e1_count=0; + + do + { + $temp_trunk_no=hexdec(getBitValue($rows[initValue],'0.0-0.7'))+0; + if($trunkgp==$temp_trunk_no) + { + $e1_contain[$e1_count]=$rows[instanceNo]; + $e1_count++; + } + + }while($rows=mysqli_fetch_array($result)); + /* + echo ""; + */ + //===============get the ISDN trunk group parameter============================= + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=1 and level_3=4 and instanceNo=$trunkgp"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + //=====get the parameter of trunk protocol stack 12.0-12.7 + $protocol_stack=hexdec(getBitValue($rows[initValue],'12.0-12.7'))+0; + $protocol_stack_label=array(0=>"ITU",1=>"ANSI"); + + echo ""; + echo ""; + echo ""; + echo ""; + //=====get the parameter of trunk NFAS Flag + $NFAS_flag=hexdec(getBitValue($rows[initValue],'13.0-13.7'))+0; + $NFAS_flag_label=array(0=>"Disable",1=>"Enable"); + echo ""; + echo ""; + echo ""; + echo ""; + //=======get the parameter of trunk Primary D-channel + $Primary_D_channel=hexdec(getBitValue($rows[initValue],'14.0-14.7'))+0; + echo ""; + echo ""; + echo ""; + echo ""; + //=========get the parameter of trunk Backup D-channel + $Backup_D_channel=hexdec(getBitValue($rows[initValue],'15.0-15.7'))+0; + echo ""; + echo ""; + echo ""; + echo ""; + + } + // + + + echo "
      Alternative TG"; + { + if($alterTgFlag==1) + echo ""; + for($i=0; $i< sizeof($ElementArr); $i++) + { + if($ElementArr[$i][tg]==$trunkgp || $ElementArr[$i][name]=="CNF Center") + continue; + echo ""; + echo ""; + } + echo "
      Protocol Stack"; + // + echo ""; + echo "
      NFAS Flag"; + //==ITU + if($protocol_stack==0) + echo ""; + for($i=0;$i<2;$i++) + { + if($i==$NFAS_flag) + echo ""; + else + echo ""; + } + echo ""; + echo "
      Primary D-channel"; + //==ITU + if($protocol_stack==0) + { + //echo ""; + echo ""; + } + //==ANSI + else + { + //echo ""; + echo ""; + } + echo "
      Backup D-channel"; + //==ITU + if($protocol_stack==0) + { + //echo ""; + echo ""; + } + //==ANSI + else + { + //echo ""; + echo ""; + } + echo "
      "; +} + + + + + +if($setname=="BTS") +{ + + + + {//get all prefix use bye BTS + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr ORDER BY instanceNo"; + //echo $defSql; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $offset_ton_in = "0.0-0.3"; + $offset_ton_out="0.4-0.7"; + $i=0; + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=hexdec(getBitValue($row[initValue],$offset_enable)); + $prefix_calltype=hexdec(getBitValue($row[initValue],$offset_calltype)); + if($prefix_enable && $prefix_calltype==1)//enable,Emergency + { + $PrefixNoArr[$i][no]=$row[instanceNo]; + //getPrefix + $oidstr = '2.1.1'; + $objWhereStr =getLevelWhere($oidstr); + + $tmpSql = " SELECT initValue from $paramTable WHERE $objWhereStr and instanceNo='$row[instanceNo]'"; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + $tmpPrefix=str_replace('E','',$tmpRow[initValue]); + if(strlen($tmpPrefix)==0) + //$tmpPrefix = "PrefixNo " . $row[instanceNo]; + $tmpPrefix = '--'; + + //$PrefixNoArr[$i][prefix]=$row[instanceNo] . "(prefix=$tmpPrefix)"; + $PrefixNoArr[$i][prefix]=$tmpPrefix; + $i++; + } + } + + {//增加一个新的备选prefix + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM $paramTable WHERE $objWhereStr ORDER BY instanceNo"; + //echo $defSql; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=hexdec(getBitValue($row[initValue],$offset_enable)); + if(!$prefix_enable)//disable + { + $newInstanceNo=$row[instanceNo]; + //getPrefix + $oidstr = '2.1.1'; + $objWhereStr =getLevelWhere($oidstr); + + $tmpSql = " SELECT initValue $paramTable WHERE $objWhereStr and instanceNo='$row[instanceNo]'"; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + $newPrefix=str_replace('E','',$tmpRow[initValue]); + break; + } + } + $PrefixNoArr[$i][no]=$newInstanceNo; + //$PrefixNoArr[$i][prefix]="New {$newInstanceNo}"; + $PrefixNoArr[$i][prefix]="New"; + } + } + {//get org prefix + $objstrset='2.2.7'; + $objWhereStr =getLevelWhere($objstrset); + + $paramSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$instanceNo' "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + + $PrefixNo = hexdec(getBitValue($Row[initValue],'5.0-5.7')); + } + {//show select +// echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + {//get all lac belong to this BSS + $oidstr = '2.2.6'; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE $objWhereStr ORDER BY instanceNo + "; + $Result = mysqli_query($pubConn,$paramSql); + $n=0; + while($Row = mysqli_fetch_array($Result)) + { + $tempGp = hexdec(getBitValue($Row[initValue],'01.0-01.7')); + $tempFlag = hexdec(getBitValue($Row[initValue],'0.0-0.7')); + + if( $tempFlag == 1 && $trunkgp == $tempGp) + { + $LAC_value[$n] = hexdec(getBitValue($Row[initValue],'02.0-03.7')); + $LAC_inst[$n] = $Row[instanceNo]; + //$LAC_pageType[$n] = hexdec(getBitValue($Row[initValue],'4.0-4.7')); + $n++; + } + } + }//end get lacs + {//show lac select + $externID = explode('-',$instanceNo); + $lacValue = $externID[1]; + echo ""; + echo ""; + echo ""; + echo ""; + } +}//end $setName="BTS" + +echo "
      Prefix"; + { + echo ""; + } + echo "
      LAC"; + { + echo ""; + } + echo "
      "; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo "\n"; +echo ""; +?> + + diff --git a/wxc2_omc/element/toElement/pcrChannel.php b/wxc2_omc/element/toElement/pcrChannel.php new file mode 100755 index 0000000..dd6e189 --- /dev/null +++ b/wxc2_omc/element/toElement/pcrChannel.php @@ -0,0 +1,322 @@ + + + + + + 'Disable', + 1 => 'IN', + 3 => 'OUT', + 5 => 'BI-direction', + 7 => 'Lease-Line', +); + +$LccpE1Arr = array( + 0 => '0', 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7' +); + +$LccpTimeslotArr = array( + 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', + 9 => '9', 10 => '10', 11 => '11', 12 => '12', 13 => '13', 14 => '14', 15 => '15', + + 17 => '17', 18 => '18', 19 => '19', 20 => '20', 21 => '21', 22 => '22', 23 => '23', 24 => '24', + 25 => '25', 26 => '26', 27 => '27', 28 => '28', 29 => '29', 30 => '30', 31 => '31' +); + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + //direction + $oidstr = "2.1.3"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setValue = $row[initValue]; + for($i=0;$i<32;$i++) + { + $tmp = ${"direction_$i"}; + $tmp = omc_keep_length(decbin($tmp),'0',3); + $bitStr = $i.".0-".$i.".2"; + $setValue = setBitValue($setValue,$bitStr,$tmp); + } + $setValue = strtoupper($setValue); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' "; + mysqli_query($pubConn,$updSql); + + //Lccp + $oidstr = "2.1.4"; + $objWhereStr = getLevelWhere($oidstr); + + $selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $setValue = $row[initValue]; + for($i=0;$i<32;$i++) + { + $tmp = ${"lccp_e1_$i"}; + if(isset($tmp)) + { + $tmp = omc_keep_length(decbin($tmp),'0',3); + $bitStr = $i.".5-".$i.".7"; + $setValue = setBitValue($setValue,$bitStr,$tmp); + } + + $tmp = ${"lccp_timeslot_$i"}; + if(isset($tmp)) + { + $tmp = omc_keep_length(decbin($tmp),'0',5); + $bitStr = $i.".0-".$i.".4"; + $setValue = setBitValue($setValue,$bitStr,$tmp); + } + } + $setValue = strtoupper($setValue); + $updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' "; + mysqli_query($pubConn,$updSql); + + + echo ""; +} + +//========================================================== +//输出并显示数据 +//========================================================== +echo "
      "; +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + //echo "Configuration > Network > Element > PCR > Channel"; + echo "Configuration > Network > PCR > Channel"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "PCR Channel set:  "; + echo "$subChannelName"; + echo ""; + echo ""; + echo "    "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} +?> + + + +"; + echo ""; + + echo ""; + echo ""; + + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<16;$i++) + { + echo ""; + echo ""; + {//Direction + $bitStr = $i.".0-".$i.".2"; + $direction = bindec(getBitValue($directionSource,$bitStr)); + echo ""; + }//end direction + if($direction==7)//lease-Line + { + $disableStr = ''; + } + else + $disableStr = 'disabled'; + {//LCCP-E1 + $lccp_e1_bitStr = $i.".5-".$i.".7"; + $lccp_e1 = bindec(getBitValue($LccpSource,$lccp_e1_bitStr)); + echo ""; + }//end LCCP-E1 + + {//LCCP-Timeslot + $lccp_timeslot_bitStr = $i.".0-".$i.".4"; + $lccp_timeslot = bindec(getBitValue($LccpSource,$lccp_timeslot_bitStr)); + echo ""; + }//end LCCP-Timeslot + echo ""; + } + echo "
      Timeslot#DirectionLCCP-E1LCCP-Timeslot
      $i"; + echo ""; + echo ""; + echo "
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=16;$i<32;$i++) + { + echo ""; + echo ""; + { + $bitStr = $i.".0-".$i.".2"; + $direction = bindec(getBitValue($directionSource,$bitStr)); + echo ""; + } + + if($direction==7)//lease-Line + { + $disableStr = ''; + } + else + $disableStr = 'disabled'; + + { + $lccp_e1_bitStr = $i.".5-".$i.".7"; + $lccp_e1 = bindec(getBitValue($LccpSource,$lccp_e1_bitStr)); + echo ""; + } + { + $lccp_timeslot_bitStr = $i.".0-".$i.".4"; + $lccp_timeslot = bindec(getBitValue($LccpSource,$lccp_timeslot_bitStr)); + echo ""; + } + echo ""; + } + echo "
      Timeslot#DirectionLCCP-E1LCCP-Timeslot
      $i"; + echo ""; + echo ""; + echo "
      "; + echo "
      "; +echo "
      "; +echo "

      "; +?> diff --git a/wxc2_omc/element/toElement/uploadfile.php b/wxc2_omc/element/toElement/uploadfile.php new file mode 100755 index 0000000..bd18653 --- /dev/null +++ b/wxc2_omc/element/toElement/uploadfile.php @@ -0,0 +1,353 @@ +ftpLoginName=$ftpLoginName "; +if($DEBUG)echo "
      ftpLoginPwd=$ftpLoginPwd"; +if($DEBUG)echo "
      impFileArr[0][localFile]={$impFileArr[0][localFile]}"; + +function delImpFile() +{ + global $impFileArr,$impFile_1; + for($j=0;$j"; + }else{ + if(FALSE == $delRes) echo "you have no priviledge to delete files
      "; + } +*/ + + //echo "r = $remoteFile, L =$localFile
      "; + if(!@ftp_put($ftpCon,$remoteFile,$localFile,FTP_BINARY)){ + if($language == 'chn'){ + echo "
      上传失败."; + }else{ + echo "
      Failed."; + } + return(-1); + }else{ + if($language == 'chn'){ + echo "
      上传成功."; + }else{ + echo "
      Successful."; + } + } + } + return(1); +} + +function chkImpFile() +{ + $DEBUG=0; + global $impFileArr,$impFile_1; + global $maxImpFileSize,$language; + //检查导入的文件大小 + for($j=0;$jimpFileSize=$impFileSize"; + if($impFileSize > $maxImpFileSize){ + echo "
      impRecordNum=$impRecordNum"; + if($language == 'chn'){ + echo "
      文件过大!"; + }else{ + echo "
      File size is too large!"; + } + return(-1); + } + } + return(1); +} + +//========================================================== +//输入变量 +//========================================================== +if($DEBUG) echo "
      impFile_1=$impFile_1"; + +//========================================================== +//数据处理 +//========================================================== + + +//判断是否有文件上载 dafault--恢复默认语音 +if(($_SERVER['REQUEST_METHOD'] == "POST" && $impFile_1 != "none")|| $default == 1){ + if($default !=1 && chkImpFile() < 0){ + delImpFile(); + exit(); + } + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $omcNum=mysqli_num_rows($getSysIdResult); + if($omcNum <= 0){ + if($language == 'chn'){ + echo "[错误]:系统列表中没有配置 $strName 的IP!"; + }else{ + echo "Error:Can not find any $strName's IP in system list,Please ADD it!"; + } + if($default !=1){ + delImpFile(); + } + if($default == 1){ + $backpage =1; + }else{ + $backpage =2; + } + if(isset($backurl)){ + echo " "; + }else{ + echo " "; + } + exit(); + } + $impOkFlag=0; + for($i=0;$i<$omcNum;$i++){ + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysName=$strName.'_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $dstSeverIp = $getSysIdRow[ip]; + + if($language == 'chn'){ + echo "
      上传语音文件到 $sysName ( $dstSeverIp ) ......"; + }else{ + echo "
      Try to upload $strName wav to $sysName($dstSeverIp) ......"; + } + flush(); + + $ftpCon=@ftp_connect($dstSeverIp); + if($ftpCon < 1){ + if($language == 'chn'){ + echo "
      连接 $sysName 失败!"; + }else{ + echo "
      Connect $sysName Failed!"; + } + continue; + }else{ + flush(); + } + if(!@ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + if($language == 'chn'){ + echo "
      登陆 $sysName 失败!"; + }else{ + echo "
      Login $sysName Failed!"; + } + @ftp_quit($ftpCon); + continue; + }else{ + flush(); + } + if(putImpFile($ftpCon)){ + $impOkFlag = 1; + } + @ftp_quit($ftpCon); + + flush(); + } + if($default !=1){ + delImpFile(); + } + + if($impOkFlag == 0){ + if($default == 1){ + $backpage =1; + }else{ + $backpage =2; + } + if(isset($backurl)){ + echo " "; + }else{ + echo " "; + } + exit(); + } + + flush(); + if($default == 1){ + $backpage =1; + }else{ + $backpage =2; + } + if(isset($backurl)){ + echo " "; + }else{ + echo " "; + + } + exit(); +}elseif(isset($impFile)){ + echo "
      "; + if($language == 'chn'){ + echo "上传失败,文件不存在!"; + }else{ + echo "Upload file failed, File doesn't exist!"; + } +} + +//========================================================== +//数据显示 +//========================================================== +?> + + + +
      " name="subsData" enctype="multipart/form-data" onsubmit="return checkAllInput(this)"> +"; +echo ""; +echo ""; +//echo "Advanced > Upload voice file. "; +echo "Configuration > Network > $strName > Upload voice file"; +echo ""; +echo ""; +//showHelp($helpId); +if(isset($backurl)){ + echo ""; + echo "

      $strBack"; +}else{ + echo "

      $strBack"; +} + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> +
      + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + + +
      +"; +?> +
      +

      + + diff --git a/wxc2_omc/element/toElement/vmsAnnounce/1170870407.wav b/wxc2_omc/element/toElement/vmsAnnounce/1170870407.wav new file mode 100755 index 0000000..ab0a3e9 Binary files /dev/null and b/wxc2_omc/element/toElement/vmsAnnounce/1170870407.wav differ diff --git a/wxc2_omc/element/toElement/vms_numModRemote.php b/wxc2_omc/element/toElement/vms_numModRemote.php new file mode 100755 index 0000000..f1e472c --- /dev/null +++ b/wxc2_omc/element/toElement/vms_numModRemote.php @@ -0,0 +1,167 @@ + + + + +"; + mysqli_query($pubConn,$updflag); + echo mysqli_error($pubConn); + + echo ""; +} + +$oidstr = "2.2.1.8"; +$objWhereStr = getLevelWhere($oidstr); +$getsql = "select initValue from $paramTable + where $objWhereStr and instanceNo='$inst' + "; +if($DEBUG)echo "
      getsql: $getsql"; +$result = @mysqli_query($pubConn,$getsql); +$row = @mysqli_fetch_array($result); + +$Prefix = getBitValue($row[0],'0.0-7.7'); +$Prefix = str_replace('F','',$Prefix); + +$OriNAI = getBitValue($row[0],'08.0-08.7'); +$OriNAI = hexdec($OriNAI); + +$Del_digit = hexdec(getBitValue($row[0],'09.0-09.7')); + +$Ins_digit = getBitValue($row[0],'10.0-17.7'); +$Ins_digit = str_replace('F','',$Ins_digit); + +$ModiNAI = getBitValue($row[0],'18.0-18.7'); +$ModiNAI = hexdec($ModiNAI); + +$NAIArr = array("","Subscriber","Unknown","National","International"); + +$selfPage = "$PHP_SELF?linkset=$linkset&trunkgp=$trunkgp&infoNo=$infoNo&inst=$inst&sysNo=$sysNo"; + +echo "
      "; +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Configuration > Network > VSS > Number modification remote"; + echo ""; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Number - $inst:  "; + echo "$subChannelName"; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +} + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      Prefix"; + echo " "; + echo "
      Delete digit"; + echo " "; + echo "
      Insert digit"; + echo " "; + echo "
      Original NAI"; + echo "
      Modified NAI"; + echo "
      "; + +?> diff --git a/wxc2_omc/element/toElement/voiceplay.php b/wxc2_omc/element/toElement/voiceplay.php new file mode 100755 index 0000000..f7c5017 --- /dev/null +++ b/wxc2_omc/element/toElement/voiceplay.php @@ -0,0 +1,326 @@ +ftpCon:$ftpCon"; +//echo "
      localFile:$localFile"; +//echo "
      remoteFile:$remoteFile"; + if(!@ftp_get($ftpCon,$localFile,$remoteFile,FTP_BINARY)) + { + if($language == 'chn') + { + echo "
      下载失败.
      "; + exit(); + } + else + { + echo "
      Get File Failed.
      "; + exit(); + } + return(-1); + } + else + { + if($language == 'chn') + { + //echo "
      下载成功.
      "; + } + else + { + //echo "
      Successful.
      "; + } + } + } + return(1); +} + +function PCMtoWAV($infile) +{ + $fsize2 = filesize($infile); + $fsize1 = $fsize2+36; + $fsize2 = dechex($fsize2); + $fsize1 = dechex($fsize1); + $tmp = ""; + $tmp = omc_keep_length($fsize2,"0","8"); + $unitByte3 = substr($tmp,0,2); + $unitByte2 = substr($tmp,2,2); + $unitByte1 = substr($tmp,4,2); + $unitByte0 = substr($tmp,6,2); + $setfsize2 = $unitByte0.$unitByte1.$unitByte2.$unitByte3; + $tmp = ""; + $tmp = omc_keep_length($fsize1,"0","8"); + $unitByte3 = substr($tmp,0,2); + $unitByte2 = substr($tmp,2,2); + $unitByte1 = substr($tmp,4,2); + $unitByte0 = substr($tmp,6,2); + $setfsize1 = $unitByte0.$unitByte1.$unitByte2.$unitByte3; + $wavehead = "52494646".$setfsize1."57415645666d74201000000006000100401f0000401f00000200080064617461".$setfsize2; + $szwavehead = toAscii($wavehead); + $fp = fopen($infile, 'r+'); + if(!$fp) + { + echo "open file fail."; + exit(); + } + $contents = fread($fp, filesize($infile)); + if(!$contents) + { + echo "read file fail."; + exit(); + } + if(!rewind($fp)) + { + echo "rewind file fail."; + exit(); + } + + if(!fwrite($fp, $szwavehead.$contents)) + { + echo "write file fail."; + exit(); + } + if(!fclose($fp)) + { + echo "close file fail."; + exit(); + } +} +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Voice Play"; +if(isset($backurl)) +{ + echo ""; + echo "

      $strBack"; +} +else +{ + echo "

      $strBack"; +} +echo "

      "; +echo " + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + " valuetype="ref"> //把地址傳遞到這裡 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      "; +//========================================================== +//数据处理 +//========================================================== + //delete *.wav *.evr + $handle=opendir($localpath); + while($file=readdir($handle)) + { + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='wav') unlink($localpath.$file); + if($retval=='evr') unlink($localpath.$file); + } + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + + $getSysIdSql = "SELECT sysNo,subSysNo,ip FROM sysInfo + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; +// echo "
      getSysIdSql:$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + $omcNum=mysqli_num_rows($getSysIdResult); + if($omcNum <= 0) + { + if($language == 'chn') + { + echo "[错误]:系统列表中没有配置 OMC or VSS 的IP!"; + exit(); + } + else + { + echo "Error:Can not find any OMC's or VSS's IP in system list,Please ADD it!"; + exit(); + } + if($default !=1) + { + delImpFile(); + } + exit(); + } + + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $dstSeverIp = $getSysIdRow[ip]; + flush(); + $ftpCon=@ftp_connect($dstSeverIp); + if($ftpCon < 1) + { + if($language == 'chn') + { + echo "
      连接 $dstSeverIp 失败!"; + exit(); + } + else + { + echo "
      Connect $dstSeverIp Failed!"; + exit(); + } + continue; + } + else + { + flush(); + } + if(!@ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)) + { + if($language == 'chn') + { + echo "
      登陆 $sysName 失败!"; + exit(); + } + else + { + echo "
      Login $sysName Failed!"; + exit(); + } + @ftp_quit($ftpCon); + continue; + } + else + { + flush(); + } + getFile($ftpCon); + ftp_quit($ftpCon); + + flush(); + //$result = exec("mv {$impFileArr[0][localFile]} $output"); + + $tmpSql = "SELECT detailStat FROM sysStat + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + $tmpResult= mysqli_query($pubConn,$tmpSql); + $tmpRows=mysqli_num_rows($tmpResult); + + $voiceRule=bindec(getBitValue($tmpRows[detailStat],'68.3-68.3')); + if($voiceRule==1)//MU LAW + PCMtoWAV($impFileArr[0][localFile]); +?> +
      diff --git a/wxc2_omc/element/toElement/wxc2_sp.php b/wxc2_omc/element/toElement/wxc2_sp.php new file mode 100755 index 0000000..3353532 --- /dev/null +++ b/wxc2_omc/element/toElement/wxc2_sp.php @@ -0,0 +1,2706 @@ +"; +?> + + + + +"; + +//==========================delete the cell===================== +if($delete_cell==1) +{ + + //=====get the default value of cell================= + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=2 and level_3=7 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $cell_default_value=$rows[initValue]; + //===============delete + $updSql = "update param_99 set initValue='$cell_default_value' where level_1 =2 and level_2 =2 and level_3 =7 and instanceNo='$cell_instance_no_delete'"; + mysqli_query($pubConn,$updSql); + echo mysqli_error($pubConn); + unset($delete_cell); +} + +//========================================================== +//变量定义 +//========================================================== +$pubDb = 'OMC_PUB'; +$db = "OBJ_322"; +$paramTable ='OBJ_322.param_99'; +$SP_show = 0; +$TG_show = 0; +$prefix_show = 0; +$E1_show = 0; +$BSC_show = 0; +$GTT_show = 0; +$nSetComm = 3; +//$backurl用于页面跳转是回到正确的页面 +$backurl =$PHP_SELF."?trunkgp=".$trunkgp.">t=".$gtt."&sysNo=".$sysNo."&infoNo=".$infoNo."&linkset=".$linkset.">tSSN=".$gttSSN."&grpNo=".$grpNo."&appType=".$appType; + +//echo "$backurl
      "; +//Spname +//取设备名,编号 +getElementInfo($infoNo,$elementInfoArr); +$this_sysNo = $TypeNo = $elementInfoArr[sysNo]; +$TypeIn = $elementInfoArr[typeValue]; +$eleName = $elementInfoArr[eleName]; +$devicename = $elementInfoArr[typeName]; +$webname = $elementInfoArr[webName]; + +if($DEBUG) echo "
      trunkgp: $trunkgp; webname: $webname"; +{//initial params + switch($devicename) + { + case 'BSC': + { + $SP_show = 1; + $TG_show = 1; + $prefix_show = 0; + $E1_show = 1; + $BSC_show = 1; + $GTT_show = 0; + $oidsysarr=array( + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'),//time 2,3s + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.4.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.2.6', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2.7', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + ); + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1') + ); + if($trunkgp=="") + { + $SP_show = 1; + $TG_show = 0; + $prefix_show = 0; + $E1_show = 0; + $BSC_show = 0; + $GTT_show = 0; + } + break; + } + case 'Peripheral': + { + if($webname=='CNF') + { + $this_sysNo = 0; + $this_subSysNo = $subSysNo; + $TypeNo = 0; + } + if($webname=='VSS') + { + $vssPrefix_show=1; + } + if($webname=='PCR') + { + $pcrPrefix_show=1; + } + $SP_show = 1; + $TG_show = 1; + $prefix_show = 0; + $E1_show = 1; + $BSC_show = 0; + $GTT_show = 0; + $aasMtp3_sysId = "222_11_".$TypeNo; + $vssMtp3_sysId = "222_8_".$TypeNo; + $vssSCCP_sysId = "223_8_".$TypeNo; + $oidsysarr=array( + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + ); + $oidAASarr=array( + array('oid'=>'2.5.1', 'sysid'=> $aasMtp3_sysId, 'selectsysid'=>'-1' ), + ); + $oidVSSarr=array( + array('oid'=>'2.5.1', 'sysid'=> $vssMtp3_sysId, 'selectsysid'=> '-1'), + array('oid'=>'2.1.8', 'sysid'=> $vssSCCP_sysId, 'selectsysid'=> '-1'), + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + ); + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + ); + if($webname=='AAS') + { + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=> $aasMtp3_sysId,'selectsysid'=> '-1'), + ); + } + if($webname=='VSS') + { + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=> $vssMtp3_sysId,'selectsysid'=> '-1'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=> $vssSCCP_sysId,'selectsysid'=> '-1'), + ); + } + if($trunkgp=="") + { + $SP_show = 1; + $TG_show = 0; + $prefix_show = 0; + $E1_show = 0; + $BSC_show = 0; + $GTT_show = 0; + } + break; + } + case 'Switch': + { + $SP_show = 1; + $TG_show = 1; + $prefix_show = 1; + $E1_show = 1; + $BSC_show = 0; + $GTT_show = 0; + $oidsysarr=array( + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.3', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.2', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.1', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.8.0', 'sysid'=>'225_99_99', 'selectsysid'=>'-1'), + ); + $SaveArr=array( + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.2', 'setvalue'=>'01' ,'sysid'=>'225_99_99'),//XAPP + ); + + if($trunkgp=="") + { + $SP_show = 1; + $TG_show = 0; + $prefix_show = 0; + $E1_show = 0; + $BSC_show = 0; + $GTT_show = 0; + } + break; + } + + case $strGttObjects: + { + $SP_show = 1; + $TG_show = 0; + $prefix_show = 0; + $E1_show = 0; + $BSC_show = 0; + $GTT_show = 1; + $oidsysarr=array( + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4', 'sysid'=>'223_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.1.12', 'sysid'=>'330_99_99', 'selectsysid'=>'-1') + ); + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99','selectsysid'=>'-1'), + ); + break; + } + + default: + { + $SP_show = 0; + $TG_show = 0; + $prefix_show = 0; + $E1_show = 0; + $BSC_show = 0; + $GTT_show = 0; + break; + } + } +}//end initial params + +if($webname=='CNF') + $Spname = $Spname; +if($webname=='PCR') + $Spname = "$Spname-$this_sysNo-$this_subSysNo"; +else + $Spname = $Spname."$TypeNo"; + + +$sysId ='322_99_99'; + +$NetIdConfArr=array('International','International-S','National','National-S'); + +//========================================================== +//数据处理 +//========================================================== +?> + + + + +Setting parameters
      "; + //========set the parameter for 8kboard (2007-6-5)===================================== + $database="OMC_PUB"; + $sql="select sysNo from sysInfo where sysNo=0 and sysTypeNo=111 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if($rows[sysNo]==0) + $OidArr_8ke1[]=array('oid'=>'2.8', 'sysid'=>'111_0_99', 'selectsysid'=> '-1'); + + $database="OMC_PUB"; + $sql="select sysNo from sysInfo where sysNo=1 and sysTypeNo=111 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if($rows[sysNo]==1) + $OidArr_8ke1[]=array('oid'=>'2.8', 'sysid'=>'111_1_99', 'selectsysid'=> '-1'); + SetParam($OidArr_8ke1); + //=============================================================================== + + + if($TypeIn ==2) + { + SetParam($oidAASarr); + } + if($TypeIn ==3) + { + SetParam($oidVSSarr); + } + + if($devicename!=$strGttObjects) + { + set_e1channel($trunkgp); + } + + SetParam($oidsysarr); + + SaveParam($SaveArr); + + } + else + { + echo "
      Getting parameters
      "; + + //========get the parameter for 8kboard (2007-6-5)===================================== + $database="OMC_PUB"; + $sql="select sysNo from sysInfo where sysNo=0 and sysTypeNo=111 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if($rows[sysNo]==0) + $OidArr_8ke1[]=array('oid'=>'2.8', 'sysid'=>'111_0_99', 'selectsysid'=> '-1'); + + $database="OMC_PUB"; + $sql="select sysNo from sysInfo where sysNo=1 and sysTypeNo=111 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if($rows[sysNo]==1) + $OidArr_8ke1[]=array('oid'=>'2.8', 'sysid'=>'111_1_99', 'selectsysid'=> '-1'); + GetParam($OidArr_8ke1); + //=============================================================================== + + if($TypeIn ==2) + { + GetParam($oidAASarr); + } + if($TypeIn ==3) + { + GetParam($oidVSSarr); + } + if($devicename!=$strGttObjects) + { + get_e1channel($trunkgp); + } + GetParam($oidsysarr); + + } + } +} + +if(1==$prefixdel) +{ + if($thisUsedRa==''&&$otherUsedRa=='')//delete it + { + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $flagoffset = "10.7-10.7"; + $row[initValue] = setBitValue($row[initValue],$flagoffset,0); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $oidstr = '2.1.3'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + if($thisUsedRa!='')//set used RA part to default value + { + $thisUsedRaArr=explode(",", $thisUsedRa); + for($i=0; $i"; + echo "\n window.location.href=\"$backurl\";"; + echo "\n "; + exit(); +} +if(1==$convPrefixDel) +{ + $pubDb = "OMC_PUB"; + //get default value of local prefix(conv prefix) + $net_paramConf ='OBJ_225.paramConf'; + $net_paramTable ="OBJ_225.param_99"; + $getsql = "select initValue from $net_paramConf where level_1 = '2' and level_2 = '8' and level_3 = '0'"; + $conv_pre_def = @mysqli_query($pubConn,$getsql); + $conv_pre_def = @mysqli_fetch_array($conv_pre_def); + $conv_pre_def = $conv_pre_def[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "conv_pre_def = $conv_pre_def
      "; + + $updSql = "update $net_paramTable set initValue='$conv_pre_def' where level_1 = '2' and level_2 = '8' and level_3 = '0' and instanceNo='$delValue'"; + mysqli_query($pubConn,$updSql); +} + +if(1==$E1del)//删除E1connect时需删除相同编号的E1 link +{ + $IdArr = explode('_',$delValue); + $delValue = $IdArr[0]; + $AAS_E1ID = $IdArr[1]; + + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.4.4'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + $delRes = @mysqli_query($pubConn,$delSql); + + $oidstr = '2.4.3'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + $delRes = @mysqli_query($pubConn,$delSql); + + $oidstr = '2.4.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + $delRes = @mysqli_query($pubConn,$delSql); + + $oidstr = '2.4.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + $delRes = @mysqli_query($pubConn,$delSql); + + {//close 8ke1 enable, crc4flag + open8ke1Enable($delValue,0); + open8ke1CRC4Flag($delValue,0); + }//end close + + $sysId = '222_99_99'; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $E1link_oidstr = '2.5.1'; + $E1link_objWhereStr= ''; + $E1link_objWhereStr =getLevelWhere($E1link_oidstr); + + + $E1link_objDb = 'OBJ_'.$sysTypeNo; + $E1link_paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM paramConf WHERE $E1link_objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + if($TypeIn == 3)//added by arwean 2006-03-30 + { + $selSql = "select initValue from $paramTable where $E1link_objWhereStr and instanceNo='$delValue' "; + $result = @mysqli_query($pubConn,$selSql); + $rowFind = @mysqli_fetch_array($result); + //MTP3_8_pub + $VSS_MTP3Table = 'param_8'; + $selSql = "select initValue,instanceNo from $VSS_MTP3Table where $E1link_objWhereStr and initValue!='$row[initValue]'"; + $result = @mysqli_query($pubConn,$selSql); + if(0) + { + echo "
      selSql: $selSql"; + echo mysqli_num_rows($result); + exit; + } + while($Row_1=@mysqli_fetch_array($result)) + { + if($Row_1[initValue]==$rowFind[initValue]) + { + $delSql = "UPDATE $VSS_MTP3Table SET initValue = '$row[initValue]' + WHERE $E1link_objWhereStr AND instanceNo='$Row_1[instanceNo]'"; + if(0) + { + echo "
      delSql: $delSql"; + exit; + } + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + break; + } + } + }//end if + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE $E1link_objWhereStr AND instanceNo='$delValue'"; +// echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + if($TypeIn == 2) + { + //MTP3_11_pub + $AAS_MTP3Table = 'param_11'; + $delSql = "UPDATE $AAS_MTP3Table SET initValue = '$row[initValue]' + WHERE $E1link_objWhereStr AND instanceNo='$AAS_E1ID'"; +// echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + + echo ""; + exit(); +} + +if(1==$BTSdel) +{ + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.2.7'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $paramSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr AND instanceNo ='$delValue' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $delPrefixNo = hexdec(getBitValue($Row[initValue],'5.0-5.7')); + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $defCellValue = $row[initValue]; + $delSql = "UPDATE $paramTable SET initValue = '$defCellValue' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + {//delete the delPrefixNo if there is no other cells use it. + $paramSql = " SELECT initValue FROM $paramTable + WHERE $objWhereStr and initValue!='$defCellValue' "; + $result = mysqli_query($pubConn,$paramSql); + $otherUsed=0; + while($row = mysqli_fetch_array($result)) + { + $prefixNo=hexdec(getBitValue($row[initValue],'5.0-5.7')); + if($prefixNo==$delPrefixNo) + { + $otherUsed=1; + break; + } + } + if($otherUsed==0)//delete $delPrefixNo. + { + $tmpParamConfTable='paramConf'; + $tmpObjIdStr='2.1'; + $levelWhere = getLevelWhere($tmpObjIdStr); + if($DEBUG) echo "
      levelWhere=$levelWhere"; + + $getSql="SELECT initValue,level_3 FROM $tmpParamConfTable + WHERE $levelWhere AND (level_3='1' OR level_3='2' OR level_3='3') ORDER BY level_3 + "; + if($DEBUG) echo "
      getSql=$getSql"; + $result =mysqli_query($pubConn,$getSql); + echo mysqli_error($pubConn); + $i=0; + unset($tmpDefaultValueArr); + while($rows=mysqli_fetch_array($result)){ + if($DEBUG) + echo "
      initValue=$rows[initValue]"; + $tmpDefaultValueArr[$i][initValue]=$rows[initValue]; + //echo "
      level_3=$rows[level_3]"; + $tmpDefaultValueArr[$i][level_3]=$rows[level_3]; + $i++; + } + if($DEBUG) echo "
      $aasprefixArr
      "; + + for($i=0;$iupdateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + } +// exit; + } + } + echo ""; + exit(); +} + +if(1==$GTTdel) +{ + $sysId = '223_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $flagoffset = "00.0-00.7"; + $row[initValue] = setBitValue($row[initValue],$flagoffset,'00'); + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + echo ""; + exit(); +} + +if(1==$lacdel) +{ + $objDb = 'OBJ_322'; + $objIdStr = '2.2.6'; + $objWhereStr =getLevelWhere($objIdStr); + $paramTable = 'param_99'; + $updSql = "UPDATE $paramTable SET initValue = '0000000000' + WHERE $objWhereStr AND instanceNo = '$delValue' + "; + if($DEBUG) echo "$updSql
      "; + mysqli_query($pubConn,$updSql); + echo ""; + exit(); +} + +if((1==$E1lock)||(1==$E1unlock)){ + $IdArr = explode('_',$delValue); + $delValue = $IdArr[0]; + $AAS_E1ID = $IdArr[1]; + + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + if(1==$E1lock) $set_value=0; + if(1==$E1unlock)$set_value=1; + open8ke1Enable($delValue,$set_value); + + $oidstr = '2.4.4'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr AND instanceNo='$delValue'"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $flagoffset = "00.1-00.1"; + + $row[initValue] = setBitValue($row[initValue],$flagoffset,$set_value); + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + $commIdStr =oidSysCommSend($sysId,$nSetComm,$oidstr); + if($commIdStr=='-1') + { + DelComm($commArr); + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + echo ""; +} + +if(2==$E1unlock){ + $IdArr = explode('_',$delValue); + $delValue = $IdArr[0]; + $AAS_E1ID = $IdArr[1]; + + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + open8ke1Enable($delValue,1); + + $oidstr = '2.4.4'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr AND instanceNo='$delValue'"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $flagoffset = "00.1-00.1"; + $row[initValue] = setBitValue($row[initValue],$flagoffset,'1'); + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; +// echo "$delSql
      "; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + $commIdStr =oidSysCommSend($sysId,$nSetComm,$oidstr); + if($commIdStr=='-1') + { + DelComm($commArr); + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + echo ""; +} +if($setSys || $getSys || $undoSet) +{ + echo "

      Finished!

      "; + if($DEBUG) exit(); + //sleep(1); + echo ""; + exit(); +} + +//========================================================== +//输出并显示数据 +//========================================================== +?> + + +ERROR!!:linkset == NULL
      "; + exit(0); +} +echo ""; +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + if($TypeIn==17) + echo "Configuration > Network > $webname"; + else + echo "Configuration > Network > $devicename"; + echo ""; + switch ($devicename) + { + case 'Switch': + $helpId='2.32'; + break; + case 'BSC': + $helpId='2.31'; + break; + case 'Peripheral': + { + switch($webname) + { + case 'PCR': + $helpId='2.1.3.3'; + break; + case 'AAS': + $helpId='2.1.3.1'; + break; + case 'VSS': + $helpId='2.1.3.2'; + break; + case 'CNF': + $helpId='2.1.3.4'; + break; + default: + $helpId='2'; + break; + } + break; + } + default: + $helpId='2'; + break; + } + if($devicename!=$strGttObjects) + showHelp($helpId); + echo "
      "; + echo "
      "; + + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; + echo "
      "; + } +} +echo ""; + +if($SP_show) +{ + if($TypeIn==17)//ISDN Switch + { + $oidstr = '2.11'; + + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,instanceNo FROM param_99 + WHERE $objWhereStr AND instanceNo ='$infoNo' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $elementname = trim(toAscii(getBitValue($Row[initValue],"14.0-23.7"))); + echo ""; + echo ""; + echo ""; + echo ""; + } + else + { + $oidstr = '2.4.1'; + + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + $paramSql = " SELECT initValue,instanceNo FROM param_99 + WHERE $objWhereStr AND instanceNo ='$linkset' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $linksetname = trim(toAscii(getBitValue($Row[initValue],"7.0-16.7"))); + if(strlen($linksetname)==0) + $linksetname = '--'; + echo ""; + echo ""; + echo ""; + echo ""; + } +} + +if($TG_show) +{ + {//Trunk group strat + echo ""; + echo ""; + echo ""; + echo ""; + }//Trunk group end +} +if($E1_show) +{ + {//E1 strat + //------------查询E1参数表--------------- + $sysId = '322_99_99'; + + $oidstr = '2.4.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $HEXtrunkgp = omc_keep_length(dechex($trunkgp),"0","2"); + $HEXtrunkgp = strtoupper($HEXtrunkgp); + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND initValue = '$HEXtrunkgp' + ORDER BY instanceNo"; + //echo "$paramSql"; + $Result = mysqli_query($pubConn,$paramSql); + + + //------------读E1参数表--------------------- + $tmpWhere='(0'; + $E1connarr=""; + + $out_time=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-30,date("m"),date("d"),date("Y"))); + $el2_bgn = 25; //e1 layer2 + while($Row = mysqli_fetch_array($Result)) + { + if($tmpWhere=='(0') + $tmpWhere="(instanceNo='$Row[instanceNo]'"; + else + $tmpWhere=$tmpWhere." OR instanceNo='$Row[instanceNo]'"; + } + $tmpWhere=$tmpWhere.")"; + + { + $oidstr = '2.4.4'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND $tmpWhere ORDER BY instanceNo + "; + $Result_3 = mysqli_query($pubConn,$paramSql); + //echo $paramSql; + $tmpWhere='(0'; + $n = 0; + while($Row_3 = mysqli_fetch_array($Result_3)) + { + $oflag = getBitValue($Row_3[initValue],'0.0-0.0'); + if($oflag) + { + if($tmpWhere=='(0') + $tmpWhere="(instanceNo='$Row_3[instanceNo]'"; + else + $tmpWhere=$tmpWhere." OR instanceNo='$Row_3[instanceNo]'"; + + {//E1 state + $tempnum = $Row_3[instanceNo]/8; + $cardno = Floor($tempnum); + $sysNo = $cardno > 15 ? 1 : 0; + $slot = $cardno % 16; + $port = $Row_3[instanceNo] - $cardno*8; + + $e1selSql = "SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime + FROM sysStat WHERE sysTypeNo='111' AND sysNo='$sysNo' and subSysNo='$slot' "; + $e1Result = @mysqli_query($pubConn,$e1selSql); + if($e1Row = @mysqli_fetch_array($e1Result)) + { + $hex_mes = $e1Row[detailStat]; + $bin_mes=''; + for($i=0;$i"; + if($DEBUG) echo "E1connarr=$E1connarr
      "; + //------------显示E1参数表--------------------- + $rowspan = $n +1; + if($n ==0) + { + $tmpcic = 255; + $rowspan =2; + } + else + { + $tmpcic = hexdec($E1cic[0][initValue]); + } + +echo "
      "; + echo ""; + + echo ""; + echo ""; + }//E1 end +} +if($vssPrefix_show || $prefix_show || $pcrPrefix_show)//SHOW VSS PREFIX or switch prefix +{ + + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + {//get all valid prefix No + $oidstr = '2.1.2'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $defSql = " SELECT initValue,instanceNo FROM $paramTable + WHERE $objWhereStr and instanceNo<252 + ORDER BY instanceNo"; + //echo $defSql; + $defRes = @mysqli_query($pubConn,$defSql); + echo mysqli_error($pubConn); + $offset_enable = "10.7-10.7"; + $offset_Properties = "10.2-10.3"; + $offset_calltype = "10.4-10.6"; + $prefix_num=0; + while($row = @mysqli_fetch_array($defRes)) + { + $prefix_enable=hexdec(getBitValue($row[initValue],$offset_enable)); + $prefix_property=hexdec(getBitValue($row[initValue],$offset_Properties)); + $prefix_calltype=hexdec(getBitValue($row[initValue],$offset_calltype)); + + if($vssPrefix_show||$pcrPrefix_show) + $flag = $prefix_enable; + if($prefix_show) + //$flag = ($prefix_enable && ($prefix_property==0) && ($prefix_calltype==0));//enable,trunk,normalcall + $flag = $prefix_enable; + if($flag) + { + $enablePrefix[$prefix_num][inst_no]=$row[instanceNo]; + $enablePrefix[$prefix_num][init_value]=$row[initValue]; + //echo "
      enablePrefix[$prefix_num][init_value]:{$enablePrefix[$prefix_num][init_value]}"; + $prefix_num++; + } + } + }//end get valid prefix No + { + $oidstr = '2.1.3'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo<252 + ORDER BY instanceNo + "; + //echo "
      paramSql: $paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + $valid_num=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$enablePrefix[$prefix_no][inst_no]) + { + $tmpTg=hexdec($Row_1[initValue]); + //echo "
      tmpTg: $tmpTg"; + if($tmpTg == $trunkgp) + { + $validPrefix[$valid_num][inst_no] = $enablePrefix[$prefix_no][inst_no]; + $validPrefix[$valid_num][init_value] = $enablePrefix[$prefix_no][init_value]; + $valid_num++; + } + $prefix_no++; + } + if($prefix_no >= $prefix_num) + break; + } + } + {//get prefix value + $oidstr = '2.1.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo<252 + ORDER BY instanceNo + "; +// echo "$paramSql"; + $Result_1 = mysqli_query($pubConn,$paramSql); + $prefix_no=0; + while($Row_1 = mysqli_fetch_array($Result_1)) + { + if($Row_1[instanceNo]==$validPrefix[$prefix_no][inst_no]) + { + $tempprefix=strtoupper($Row_1[initValue]); + $prefix = explode('E',$tempprefix); + if($prefix[0] =="") + $prefix[0]="--"; + $validPrefix[$prefix_no][prefix]=$prefix[0]; + //echo "
      validPrefix[$prefix_no][prefix]:{$validPrefix[$prefix_no][prefix]}"; + $prefix_no++; + } + if($prefix_no >= $valid_num) + break; + } + }//end get prefix value + + //------------显示prefix参数表--------------------- + $n=$prefix_no; + $rowspan = $prefix_no +1; + if($prefix_no==0) $rowspan=2; + + $setobjIdstr = "2.1.2-2.1.1-2.1.2"; + $backurlprefix=$backurl; + + echo ""; + echo ""; + echo ""; + echo ""; +} + +if($prefix_show )//show conv prefix in switch +{ + $pubDb = "OMC_PUB"; + + + //get default value of local prefix(conv prefix) + $net_paramConf ='OBJ_225.paramConf'; + $net_paramTable ="OBJ_225.param_99"; + $getsql = "select initValue from $net_paramConf where level_1 = '2' and level_2 = '8' and level_3 = '0'"; + $conv_pre_def = @mysqli_query($pubConn,$getsql); + $conv_pre_def = @mysqli_fetch_array($conv_pre_def); + $conv_pre_def = $conv_pre_def[0]; + echo mysqli_error($pubConn); + if($DEBUG) echo "conv_pre_def = $conv_pre_def
      "; + + $objIdStr='no-2.8'; + $sysId = '225_99_99'; + $setname="Prefix manipulation"; + + $oidStr = '2.8.0'; + $levelWhere = getLevelWhere($oidStr); + + $getsql = "select initValue,instanceNo from $net_paramTable where $levelWhere and initValue!='$conv_pre_def'"; + $result = @mysqli_query($pubConn,$getsql); + echo mysqli_error($pubConn); + $convNo=0; + $cmpName = "Info".$infoNo; + + //===================get the ISDN name + $databases="OBJ_225"; + $sqll="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 "; + $resultt=@mysqli_query($pubConn,$sqll); + $rowss=@mysqli_fetch_array($resultt); + do + { + //======assign tg + $trunk_tmp=hexdec(getBitValue($rowss[initValue],'3.0-3.7'))+0; + if($trunk_tmp==$trunkgp) + { + //=======title + $title=getBitValue($rowss[initValue],'14.0-23.7'); + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($title,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + $title=$temp; + $ISDN_Name=$title; + break; + } + }while($rowss=mysqli_fetch_array($resultt)); + $ISDN_Name=trim($ISDN_Name); + + + + + while($pre_row = @mysqli_fetch_array($result)) + { + $nameFlag = trim(toAscii(getBitValue($pre_row[initValue],'35.0-42.7'))); + if(strcmp($nameFlag,$ISDN_Name)==0) + { + $convPrefix[$convNo][initValue]=$pre_row[initValue]; + $convPrefix[$convNo][inst_no] = $pre_row[instanceNo]; + $prefix = getBitValue($pre_row[initValue],'00.0-15.7'); + if($convPrefix != 0) + $prefix = toAscii($prefix); + else + $prefix = '--'; + $addDigs = getBitValue($pre_row[initValue],'18.0-33.7'); + if($addDigs != 0) + $addDigs = toAscii($addDigs); + else + $addDigs = '--'; + $convPrefix[$convNo][prefix] = $prefix; + $convPrefix[$convNo][delLen] = hexdec(getBitValue($pre_row[initValue],'16.0-16.7')); + $convPrefix[$convNo][addLen] = hexdec(getBitValue($pre_row[initValue],'17.0-17.7')); + $convPrefix[$convNo][addDigs] = $addDigs; + $convPrefix[$convNo][valiLen] = hexdec(getBitValue($pre_row[initValue],'34.0-34.7')); + //echo "
      convPrefix[$convNo][prefix]:{$convPrefix[$convNo][initValue]}"; + $convNo++; + } + }//end while + $getsql = "select initValue,instanceNo from $net_paramTable where $levelWhere and initValue='$conv_pre_def'"; + //echo "
      getsql: $getsql;"; + $result = @mysqli_query($pubConn,$getsql); + $Row = @mysqli_fetch_array($result); + $newConvInst=$Row[instanceNo]; + $conv_nrow = $convNo + 1; + + echo ""; + echo ""; + + echo ""; + echo ""; +} + + + + +if($BSC_show) +{ + {//LAC + $sysId = '322_99_99'; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $oidstr = '2.2.6'; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr + "; + $Result = mysqli_query($pubConn,$paramSql); + $n=0; + while($Row = mysqli_fetch_array($Result)) + { + $tempGp = hexdec(getBitValue($Row[initValue],'01.0-01.7')); + $tempFlag = hexdec(getBitValue($Row[initValue],'0.0-0.7')); + + if( $tempFlag == 1 && $trunkgp == $tempGp) + { + $LAC_value[$n] = hexdec(getBitValue($Row[initValue],'02.0-03.7')); + $LAC_inst[$n] = $Row[instanceNo]; + $LAC_pageType[$n] = hexdec(getBitValue($Row[initValue],'4.0-4.7')); + $n++; + } + } + + $setobjIdstr = '2.2.6'; + echo ""; + echo ""; + + echo ""; + echo ""; + }//LAC end + + {//BTS + $emFlagArr = array( + 'Disable', + 'By Cell', + 'By LAC', + 'By MSC' + ); + + $sysId = '322_99_99'; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $oidstr = '2.2.7'; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + //************get default value************* + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $defRow = @mysqli_fetch_array($defRes); + $BTS_DefValue = $defRow[initValue]; + if($DEBUG) echo "BTS_DefValue] = $BTS_DefValue"; + //查找一个未用的Cell parameter,供新加bts时使用 + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND initValue='$BTS_DefValue' + "; + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + $newID = $Row[instanceNo]; + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr + "; + $Result = mysqli_query($pubConn,$paramSql); + $num = 0; + while($Row = mysqli_fetch_array($Result)) + { + $lacValue = hexdec(getBitValue($Row[initValue],'1.0-2.7')); + + if($lacValue!=0)// $lacValue!=0 ? + { + for($j=0; $j"; + echo ""; + echo ""; + */ + + + //================Emergency call parameter (add 2007-6-5)================== + { + //=====get the default value of cell================= + $database="OBJ_322"; + $sql="select initValue from paramConf where level_1=2 and level_2=2 and level_3=7 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $cell_default_value=$rows[initValue]; + + //=====get the count of cell================ + $database="OBJ_322"; + $sql="select initValue,instanceNo from param_99 where level_1=2 and level_2=2 and level_3=7 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + $cell_count=0; + do + { + if($rows[initValue]==$cell_default_value) + continue; + else + { + //============store the parameter + $cell_instance_no[$cell_count]=$rows[instanceNo]; + $cell_emergency_call_flag[$cell_count]=hexdec(getBitValue($rows[initValue],'0.0-0.7'))+0; + $cell_lac[$cell_count]=hexdec(getBitValue($rows[initValue],'1.0-2.7'))+0; + $cell_id[$cell_count]=hexdec(getBitValue($rows[initValue],'3.0-4.7'))+0; + $cell_prefix_index_number[$cell_count]=hexdec(getBitValue($rows[initValue],'5.0-5.7'))+0; + $prefix_instance_no_tmp=$cell_prefix_index_number[$cell_count]; + { + $databasee="OBJ_322"; + $sqll="select initValue,instanceNo from param_99 where level_1=2 and level_2=1 and level_3=1 and instanceNo=$prefix_instance_no_tmp "; + $resultt=@mysqli_query($pubConn,$sqll); + $rowss=@mysqli_fetch_array($resultt); + + $cell_prefix_prefix[$cell_count]=str_replace("E","",$rowss[initValue]); + if($cell_prefix_prefix[$cell_count]=="") + $cell_prefix_prefix[$cell_count]="--"; + } + $cell_local_emergency_number[$cell_count]=getBitValue($rows[initValue],'6.0-13.7'); + $cell_regional_zone_flag[$cell_count]=hexdec(getBitValue($rows[initValue],'14.0-14.7'))+0; + $cell_zone_code[$cell_count]=hexdec(getBitValue($rows[initValue],'15.0-16.7'))+0; + + //test + /* + { + echo "
      "; + echo "{$cell_instance_no[$cell_count]}
      "; + echo "----{$cell_emergency_call_flag[$cell_count]}
      "; + echo "----{$cell_lac[$cell_count]}
      "; + echo "----{$cell_id[$cell_count]}
      "; + echo "----{$cell_prefix_index_number[$cell_count]}
      "; + echo "----{$cell_local_emergency_number[$cell_count]}
      "; + echo "----{$cell_regional_zone_flag[$cell_count]}
      "; + echo "----{$cell_zone_code[$cell_count]}
      "; + } + */ + $cell_count++; + } + }while($rows=@mysqli_fetch_array($result)); + + //========get the unuse cell instanceNo====================== + $database="OBJ_322"; + $sql="select initValue,instanceNo from param_99 where level_1=2 and level_2=2 and level_3=7 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + do + { + if($rows[initValue]==$cell_default_value) + { + $cell_unuse_instanceNo=$rows[instanceNo]; + break; + } + }while($rows=@mysqli_fetch_array($result)); + + //=======================show==================== + $u_t=$url_temp; + $url_temp=urlencode($url_temp); + echo ""; + echo ""; + echo ""; + echo ""; + } + } + + + + +} + +if($GTT_show) +{ + $sysId = '222_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $oidstr = '2.4.1'; + $objWhereStr= ''; + + $objWhereStr =getLevelWhere($oidstr); + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $selSql = "select initValue from $paramTable where $objWhereStr and instanceNo='$linkset' "; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + + $DPC = hexdec(getBitValue($row[initValue],'0.0-2.7')); + $NI = bindec(getBitValue($row[initValue],'3.0-3.1')); + //echo "$DPC,$NI"; + + {//GTT + $NetIdConfArr=array( + "0"=>"International", + "1"=>"International spare", + "2"=>"National", + "3"=>"National spare" + ); + + $numPlanArr = array( + "7" => "GT", + "6"=> "IMSI", + "1"=> "MSISDN", + "0"=> "0" + ); + + $sysId = '223_99_99'; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $oidstr = '2.2'; + $objWhereStr= ''; + + $objWhereStr =getLevelWhere($oidstr); + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $selSql = "select initValue,instanceNo from $paramTable where $objWhereStr and initValue like '01%' "; + $result = mysqli_query($pubConn,$selSql); + + $offsetAppType='00.0-00.7'; + $offsetGrpNo = '01.0-01.7'; + $offsetBitFlag = '02.0-02.7';//if '1', global title. + + $niTypeArr = getNiType(); + + $n=0; + $m=0; + while($rows=mysqli_fetch_array($result)) + { + $tmpDpc = hexdec(getBitValue($rows[initValue],'24.0-26.7')); + $tmpNi = hexdec(getBitValue($rows[initValue],'23.0-23.7')); + $SSN = hexdec(getBitValue($rows[initValue],'27.0-27.7')); + $TT = hexdec(getBitValue($rows[initValue],'2.0-2.7')); + if($tmpDpc==$DPC && $tmpNi==$NI) + { + {//get gtt attribution form 2.4 + $selSql = "select initValue from OBJ_223.param_99 where level_1='2' and level_2='4' and instanceNo='$rows[instanceNo]'"; + if(0)echo "
      selSql:$selSql"; + $tmpResult = mysqli_query($pubConn,$selSql); + $tmpRow = mysqli_fetch_array($tmpResult); + $tmpGrpNo = hexdec(getBitValue($tmpRow[initValue],$offsetGrpNo)); + $tmpAppType = hexdec(getBitValue($tmpRow[initValue],$offsetAppType)); + $bitFlag = hexdec(getBitValue($tmpRow[initValue],$offsetBitFlag)); + }//end get gtt attribution + if($grpNo==$tmpGrpNo && $tmpAppType==$appType) + { + if(0)echo "
      1: dpc=$tmpDpc, ni=$tmpNi, grpNo=$tmpGrpNo, ssn=$SSN,instanceNo={$rows[instanceNo]}"; + $NP = hexdec(getBitValue($rows[initValue],'01.0-01.7')); + $tmpStart = getBitValue($rows[initValue],'3.0-12.7'); + $tmpEnd = getBitValue($rows[initValue],'13.0-22.7'); + $startGT = str_replace('F','',$tmpStart); + $endGT = str_replace('F','',$tmpEnd); + if(strlen($startGT)==0) $startGT='--'; + if(strlen($endGT)==0) $endGT='--'; + if($niTypeArr[$NI]==0)//ITU + { + $msisdnFlag = ($NP==1); + $imsiFlag = ($NP==6 || $NP==7); + } + else//ansi + { + $msisdnFlag = ($TT==14 || $TT==10); + $imsiFlag = ($TT==9); + } + if(0)echo "
      np:$NP, tt:$TT, msisdnFlag:$msisdnFlag, imsiFlag:$imsiFlag"; + switch($appType) + { + case '1'://hlr + { + if($bitFlag) + { + $globalTitle = $startGT; + $instNo = $rows[instanceNo]; + $np = $NP; + $tt = $TT; + } + else + { + if($msisdnFlag) + { + $msisdnGTTArr[$n][np]=$NP; + $msisdnGTTArr[$n][tt]=$TT; + $msisdnGTTArr[$n][instanceNo] = $rows[instanceNo]; + $msisdnGTTArr[$n][start] = $startGT; + $msisdnGTTArr[$n][end] = $endGT; + $n++; + } + if($imsiFlag) + { + $imsiGTTArr[$m][np] = $NP; + $imsiGTTArr[$m][tt] = $TT; + $imsiGTTArr[$m][instanceNo] = $rows[instanceNo]; + $imsiGTTArr[$m][start] = $startGT; + $imsiGTTArr[$m][end] = $endGT; + $m++; + } + } + break; + } + case '5'://new Element + { + if($msisdnFlag) + { + $msisdnGTTArr[$n][np]=$NP; + $msisdnGTTArr[$n][tt]=$TT; + $msisdnGTTArr[$n][instanceNo] = $rows[instanceNo]; + $msisdnGTTArr[$n][start] = $startGT; + $msisdnGTTArr[$n][end] = $endGT; + $n++; + } + if($imsiFlag) + { + $imsiGTTArr[$m][np] = $NP; + $imsiGTTArr[$m][tt] = $TT; + $imsiGTTArr[$m][instanceNo] = $rows[instanceNo]; + $imsiGTTArr[$m][start] = $startGT; + $imsiGTTArr[$m][end] = $endGT; + $m++; + } + break; + } + + case '2'://vlr + case '0'://msc + case '4'://sgsn + { + $globalTitle = $startGT; + $instNo = $rows[instanceNo]; + $np = $NP; + $tt = $TT; + break; + } + + case '3'://smsc + { + if($bitFlag) + { + $globalTitle = $startGT; + $instNo = $rows[instanceNo]; + $np = $NP; + } + else + { + if($msisdnFlag) + { + $msisdnGTTArr[$n][np] = $NP; + $msisdnGTTArr[$n][tt] = $TT; + $msisdnGTTArr[$n][instanceNo] = $rows[instanceNo]; + $msisdnGTTArr[$n][start] = $startGT; + $msisdnGTTArr[$n][end] = $endGT; + $n++; + } + } + break; + } + } + } + } + } +// echo "
      gttSSN=$gttSSN, n=$n, m=$m"; + {//show GTT + $setobjIdstr = "2.2-2.2"; + if($appType != 5) + { + echo ""; + echo ""; + echo ""; + echo ""; + } + //if($gttSSN==6 || $gttSSN==11) + if($appType==1 || $appType==3 || $appType==5) + { + $rowspan = $n+1; + echo ""; + echo ""; + + echo ""; + echo ""; + //if($gttSSN==6) + if($appType==1 || $appType == 5) + { + $rowspan = $m+1; + + echo ""; + echo ""; + + echo ""; + echo ""; + } + } + }//end show GTT + }//GTT +} + +echo "
      IUA Link$elementname
      SS7$linksetname
      Trunk group"; + echo ""; + echo ""; + echo ""; + if($webname=='IUA') + { + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + } + echo ""; + + //------------查询TrunkGroup参数表--------------------- + + $sysId = '322_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.1.4'; + $objWhereStr= ''; + $objWhereStr = getLevelWhere($oidstr); + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo ='$trunkgp' + "; + + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + //------------读TrunkGroup参数表--------------------- + //echo "
      paramSql: $paramSql"; + +// $RAC = hexdec(getBitValue($Row[initValue],'10.0-10.7')); + $Flag = getBitValue($Row[initValue],'4.0-4.0'); + $Category = getBitValue($Row[initValue],'4.3-4.5'); + $NetID = hexdec(getBitValue($Row[initValue],'5.0-5.7')); + $DPC = hexdec(getBitValue($Row[initValue],'0.0-3.7')); + $Alternative = hexdec( getBitValue($Row[initValue],'7.0-7.7')); + + $CDR = getBitValue($Row[initValue],'4.1-4.1'); + $Flag = (BinDec($Flag)) ? ("Enable") : ("Disable"); + $CDR = (BinDec($CDR)) ? ("on") : ("off"); + switch(BinDec($Category)) + { + case 0: + $Category = "PSTN"; + break; + case 1: + $Category = "HPLMN"; + break; + case 2: + $Category = "VPLMN"; + break; + case 3: + $Category = "SUB"; + break; + case 4: + $Category = "IP"; + break; + case 5: + $Category = "Intercept"; + break; + default: + $Category = "N/A"; + } + //echo "$Row[initValue]"; + //------------显示TrunkGroup参数表--------------------- + echo ""; + if(isset($trunkgp)) + { + $setobjIdstr = "2.1.4-2.1.4"; + $setname = 'Trunk Group'; + if($TypeIn==17) + echo ""; + else + echo ""; + echo ""; + if($webname=='IUA') + { + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + } + } + else + { + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo "
      No.Category  NIDPC
      $trunkgp $trunkgp $Category   $NetIdConfArr[$NetID] $DPC --------
      "; + echo ""; + echo ""; + if($TypeIn ==2 && $n > 1)//AAS最多加2条E1connect + { + echo ""; + } + elseif($TypeIn ==2) + { + echo ""; + } + elseif($TypeIn !=2&& $n > 31)//最多加32条E1connect + { + echo ""; + } + else + { + echo ""; + } + echo "
      E1/T1 connection++++
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + if($webname=="IUA") + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($n==0) + { + echo ""; + } + $Protocol = array("TUP","ISUP","AIF","ISDN NT","ISDN LT","CI-CNF","CI-loopback"); + for($i=0;$i < $n;$i++) + { + $tempnum = $instNo[$i]/8; + $cardno = Floor($tempnum); + $cardE1no = $instNo[$i] - $cardno*8; + $cscNo = Floor($cardno/16); + $subCardNo = $cardno%16; + $cardname = "CSC$cscNo"." "."Card-$subCardNo-$cardE1no"; + + $cic = hexdec(getBitValue($E1cic[$i][initValue],'0.0-0.7')); + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + $p = hexdec(getBitValue($E1Protocol[$i][initValue],'0.0-0.7')); + echo ""; + + echo ""; + + echo ""; + + if($cic == 0) + { + $delE1ID = 0; + } + else + { + $delE1ID = 1; + } + $delID = $instNo[$i]."_".$delE1ID; + if($DEBUG) echo "$delID
      "; + if(isset($E1state[$i]) && $E1state[$i]==1)//$E1state[$i]也可能没有赋值 + echo ""; + else + echo ""; + + if($Lockflag[$i]) + echo ""; + + echo ""; + echo ""; + } + if($n>4) + { + echo ""; + echo ""; + } + echo "
      No.ProtocolInterface IDCircuit IDE1/T1 channelStatusAdmin StateDelete
      --
      $cardname$Protocol[$p] $cic "; + + $tempnum = $instNo[$i]/8; + $cardno = Floor($tempnum); + $cardname = "cardno"."_$cardno"; + $tempno = $cardno+1; + $oidCard = "2.5."."$tempno"; +// $objWhereStr =getLevelWhere($oidCard); + $objWhereStr =" level_1 = '2' and level_2 = '5' and level_3 = '$tempno'"; + $cardE1no = $instNo[$i] - $cardno*8; + $timeslotno = $cardE1no*32; + $enabletime = 0; + + $tmp = $timeslotno+32; + $selSql = "SELECT initValue + FROM $paramTable + WHERE $objWhereStr AND instanceNo>='$timeslotno' AND instanceNo<='$tmp' + "; + //echo "
      E1 Enable Sql: $selSql"; + $result=mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + for($j=0; $j< 32;$j++) + { + $rows =mysqli_fetch_array($result); + $orgValue=$rows[0]; + echo mysqli_error($pubConn); + + $getval = bindec(getBitValue($orgValue,'00.0-00.0')); + if($getval) + $enabletime++; + $timeslotno++; + } + + echo ""; + echo "$enabletime enable
      OKDownUnlocked"; + else + echo "Locked"; + + echo "
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      Prefix+
      "; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + + $TON_in = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $TON_out = array('Spare','MSISDN','Unkown','NDD','IDD','Spare'); + $Properties = array('Trunk','MSISDN','MSRN','MSC'); + $callTypeArr= array('Normal Call','Emergency','MCT','VMS','IN'); + if($n==0){ + echo ""; + } + for($i=0;$i < $n;$i++) + { + $tmpInitValue = $validPrefix[$i][init_value]; + $tmpInst = $validPrefix[$i][inst_no]; + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + $oTON_in = BinDec(getBitValue($tmpInitValue,'0.0-0.3')); + $oTON_out = BinDec(getBitValue($tmpInitValue,'0.4-0.7')); + $oProperties = BinDec(getBitValue($tmpInitValue,'10.2-10.3')); + $oCallType = BinDec(getBitValue($tmpInitValue,'10.4-10.6')); + $oCDR = BinDec(getBitValue($tmpInitValue,'10.0-10.0')); + $oCDR = ($oCDR) ? ("ON") : ("OFF"); + $oRano = $validPrefix[$i][prefix]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //==============the more and hide button=================== + if($n>4) + { + echo ""; + echo ""; + } + echo "
      No.PrefixTON-inTON-outPropertiesCall TypeCDRDelete
      --
      $i $oRano $TON_in[$oTON_in] $TON_out[$oTON_out] $Properties[$oProperties] $callTypeArr[$oCallType] 
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      Prefix manipulation+
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($convNo==0){ + echo ""; + } + for($i=0; $i< $convNo; $i++) + { + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + } + //===============more button============== + if($convNo>4) + { + echo ""; + echo ""; + } + echo "
      No.PrefixDelete lengthAdd lengthAdd digitsValid lengthDelete
      --
      $i{$convPrefix[$i][prefix]} {$convPrefix[$i][delLen]} {$convPrefix[$i][addLen]} {$convPrefix[$i][addDigs]} {$convPrefix[$i][valiLen]} 
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      LAC+
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + if($n==0) + { + echo ""; + } + for($i=0;$i < $n;$i++) + { + if($i>3) + echo ""; + else + echo ""; + //echo ""; + if($LAC_pageType[$i]==5) $pageTypeStr='By LAC'; + else if($LAC_pageType[$i]==6) $pageTypeStr='In All Cell'; + else $pageTypeStr='--'; + $lac_inst = $LAC_inst[$i]; + $lac_value = $LAC_value[$i]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //===============more button============== + if($n>4) + { + echo ""; + echo ""; + } + echo "
      No.LACPage ModeDelete
      --
      $i {$LAC_value[$i]}$pageTypeStr
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + if(!isset($newID)) + { + echo ""; + } + elseif(sizeof($LAC_value)==0) + { + echo ""; + } + else + { + echo ""; + } + echo "
      Emergency call+++
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //显示CELL + if($num==0) + { + echo ""; + } + for($i=0;$i < $num;$i++) + { + $tmpInst=$Em_prefix[$i]; + //get Prefix + { + $sysId = '322_99_99'; + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + $oidstr = '2.1.1'; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr and instanceNo='$tmpInst' + "; + $result = @mysqli_query($pubConn,$paramSql); + $Row = @mysqli_fetch_array($result); + $tmpPrefix = str_replace('E','',$Row[initValue]); + if(strlen($tmpPrefix)==0) + $tmpPrefix='--'; + } + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //===============more button============== + if($num>4) + { + echo ""; + echo ""; + } + + echo "
      NoPrefixLACCellEm NumberEm FlagDelete
      --
      {$CellID[$i]} $tmpPrefix $Em_lac[$i]$CellNum[$i]{$Em_routed[$i]}{$emFlagArr[$Em_flag[$i]]}
      More >>
      Hide >>
      "; + echo "
      "; + $oper="new"; + echo "Emergency Call+"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($cell_count==0) + { + echo ""; + echo ""; + echo ""; + } + else + { + + for($i=0;$i<$cell_count;$i++) + { + + if($i>3) + echo ""; + else + echo ""; + + $no_tmp=$cell_instance_no[$i]; + + $prefix_tmp_no=$cell_prefix_index_number[$i]; + $oper="edit"; + echo ""; + echo ""; + echo ""; + echo ""; + $tmp=str_replace("E","",$cell_local_emergency_number[$i]); + echo ""; + echo ""; + //=======delete button================== + echo ""; + echo ""; + + + + } + //===============more button============== + if($cell_count>4) + { + echo ""; + echo ""; + } + } + echo "
      No.PrefixLACCell IDEmergency NumberEmergency FlagDelete
      --
      {$cell_instance_no[$i]}{$cell_prefix_prefix[$i]}{$cell_lac[$i]}{$cell_id[$i]}$tmp{$cell_emergency_call_flag[$i]}
      More >>
      Hide >>
      "; + echo "
      $strE164Number"; + echo ""; + echo ""; + echo ""; + if($niTypeArr[$NI]==0)//ITU + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + if($niTypeArr[$NI]==0)//ITU + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      No.NPTT$strE164Number NIDPC 
      0MSISDN$tt$globalTitle{$NetIdConfArr[$NI]}$DPC 
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      MSISDN+
      "; + echo ""; + echo ""; + echo ""; + if($niTypeArr[$NI]==0)//ITU + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($n==0) + echo ""; + for($i=0; $i< $n; $i++) + { + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + if($niTypeArr[$NI]==0)//ITU + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + if($n>4) + { + echo ""; + echo ""; + } + echo "
      No.NPTTstart GTend GTNIDPCDelete
      --
      $iMSISDN{$msisdnGTTArr[$i][tt]}{$msisdnGTTArr[$i][start]}{$msisdnGTTArr[$i][end]}{$NetIdConfArr[$NI]}$DPC
      More >>
      Hide >>
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo "
      IMSI+
      "; + echo ""; + echo ""; + echo ""; + + if($niTypeArr[$NI]==0)//ITU + echo ""; + else + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($m==0) + echo ""; + for($i=0; $i< $m; $i++) + { + if($i>3) + echo ""; + else + echo ""; + //echo ""; + echo ""; + if($niTypeArr[$NI]==0)//ITU + { + if($imsiGTTArr[$i][np]==6) + echo ""; + else if($imsiGTTArr[$i][np]==7) + echo ""; + } + else + { + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + //===============more button============== + if($m>4) + { + echo ""; + echo ""; + } + echo "
      No.NPTTstart GTend GTNIDPCDelete
      --
      $iIMSIGT{$imsiGTTArr[$i][tt]}{$imsiGTTArr[$i][start]}{$imsiGTTArr[$i][end]}{$NetIdConfArr[$NI]}$DPC
      More >>
      Hide >>
      "; + echo "
       "; + +if($devicename=='Peripheral') +{ + $lowerWebname = strtolower($webname); + $loadfile = "load$lowerWebname.php"; + echo "
      "; + echo "MSS -> $webname"; + echo "
      "; +} +{//get all exist elements from elementExistConf + getExistElements($existElementArr); + + if(@array_search('500', $existElementArr)==TRUE)//BSS + $BssExist = 1; +}//end get all exisit elements +if($BssExist==1) +if($devicename=='BSC') +{ + echo "
      "; + echo "MSS -> $webname"; + echo "
      "; +} + +/*{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; +}*/ +?> + + + +Notes:
      +1. Add E1/T1 Connection first. +
      +2. Link to SS7 webpage, add Signalling link. +
      + + + diff --git a/wxc2_omc/element/toElement/wxc2_sp_signaling.php b/wxc2_omc/element/toElement/wxc2_sp_signaling.php new file mode 100755 index 0000000..9f2c3e8 --- /dev/null +++ b/wxc2_omc/element/toElement/wxc2_sp_signaling.php @@ -0,0 +1,918 @@ +'2.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1')//sccp + ); + $oidsysarr1=array( + array('oid'=>'2.7.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.5', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'),//TG 保存修改的dpc + array('oid'=>'2.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + ); + $oidAASarr=array( + array('oid'=>'2.5.1', 'sysid'=> $aasMtp3_sysId, 'selectsysid'=> '-1'), + array('oid'=>'2.5.2', 'sysid'=> $aasMtp3_sysId, 'selectsysid'=> '-1') + ); + $SaveArr=array( + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=> $aasMtp3_sysId,'selectsysid'=> '-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99','selectsysid'=>'-1') + ); +} +elseif($TypeIn ==3)//vms +{ + $vmsMtp3_sysId = "222_8_".$TypeNo; + $oidsysarr=array( + array('oid'=>'2.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1')//sccp + ); + $oidsysarr1=array( + array('oid'=>'2.7.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.5', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'),//TG 保存修改的dpc + array('oid'=>'2.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + ); + $oidVSSarr=array( + array('oid'=>'2.5.1', 'sysid'=> $vmsMtp3_sysId, 'selectsysid'=>'-1' ), + array('oid'=>'2.5.2', 'sysid'=> $vmsMtp3_sysId, 'selectsysid'=>'-1' ) + ); + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=> $vmsMtp3_sysId,'selectsysid'=>'-1' ), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99','selectsysid'=>'-1') + ); +} +elseif($devicename==$strGttObjects) +{ + $oidsysarr=array( + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + ); + $oidsysarr1=array( + array('oid'=>'2.7.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.5', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1')//sccp + ); + $SaveArr=array( + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99','selectsysid'=>'-1') + ); +} +else +{ + $oidsysarr=array( + array('oid'=>'2.4.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.5.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.5.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.6.1', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.6.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.2', 'sysid'=>'223_99_99', 'selectsysid'=>'-1')//sccp + ); + $oidsysarr1=array( + array('oid'=>'2.7.2', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.3', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.4', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + array('oid'=>'2.7.5', 'sysid'=>'222_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1'), + + array('oid'=>'2.1.4', 'sysid'=>'322_99_99', 'selectsysid'=>'-1')//TG 保存修改的dpc + ); + $SaveArr=array( + array('oidstr'=>'3.2', 'setvalue'=>'B5' ,'sysid'=>'322_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.7', 'setvalue'=>'02' ,'sysid'=>'222_99_99','selectsysid'=>'-1'), + array('oidstr'=>'3.2', 'setvalue'=>'02' ,'sysid'=>'223_99_99','selectsysid'=>'-1') + ); +} +//========================================================== +//数据处理 +//========================================================== + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + if(isset($setSys) || isset($getSys)) + { + if(isset($setSys)) + { + echo "
      Setting parameters
      "; + if($TypeIn ==2) + { + SetParam($oidAASarr); + } + if($TypeIn ==3) + { + SetParam($oidVSSarr); + } + + update_e1($linkset,'222_99_99'); + + if($TypeIn ==2) + { + update_e1(0,'222_11_99',$aasMtp3_sysId); + } + + SetParam($oidsysarr); + SetParam($oidsysarr1); + + SaveParam($SaveArr); + } + else + { + echo "
      Getting parameters
      "; + + if($TypeIn ==2) + { + GetParam($oidAASarr); + } + if($TypeIn ==3) + { + GetParam($oidVSSarr); + } + GetParam($oidsysarr); + GetParam($oidsysarr1); + if($devicename!=$strGttObjects) get_e1channel($trunkgp); + } + } +} + +if(1==$E1del) +{ + $IdArr = explode('_',$delValue); + $delValue = $IdArr[0]; + $AAS_E1ID = $IdArr[1]; + + $sysId = '222_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.5.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM paramConf WHERE $objWhereStr"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + + if($TypeIn == 3)//added by arwean 2006-03-30 + { + $selSql = "select initValue from $paramTable where $objWhereStr and instanceNo='$delValue' "; + $result = @mysqli_query($pubConn,$selSql); + $rowFind = @mysqli_fetch_array($result); + //MTP3_8_pub + $VSS_MTP3Table = 'param_8'; + $selSql = "select initValue,instanceNo from $VSS_MTP3Table where $objWhereStr and initValue!='$row[initValue]'"; + $result = @mysqli_query($pubConn,$selSql); + if(0) + { + echo "
      selSql: $selSql"; + echo mysqli_num_rows($result); + exit; + } + while($Row_1=@mysqli_fetch_array($result)) + { + if($Row_1[initValue]==$rowFind[initValue]) + { + $delSql = "UPDATE $VSS_MTP3Table SET initValue = '$row[initValue]' + WHERE $objWhereStr AND instanceNo='$Row_1[instanceNo]'"; + if(0) + { + echo "
      delSql: $delSql"; + exit; + } + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + break; + } + } + }//end if + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + if($DEBUG) echo "$TypeIn
      "; + if($TypeIn == 2) + { + //MTP3_11_pub + $AAS_MTP3Table = 'param_11'; + $delSql = "UPDATE $AAS_MTP3Table SET initValue = '$row[initValue]' + WHERE $objWhereStr AND instanceNo='$AAS_E1ID'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + + echo ""; + exit(); +} +if(1==$E1lock) +{ + $IdArr = explode('_',$delValue); + $delValue = $IdArr[0]; + $AAS_E1ID = $IdArr[1]; + + $sysId = '222_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.5.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr AND instanceNo='$delValue'"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $flagoffset = "06.0-06.0"; + $row[initValue] = setBitValue($row[initValue],$flagoffset,0); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $commIdStr =oidSysCommSend($sysId,$nSetComm,$oidstr); + if($commIdStr=='-1') + { + DelComm($commArr); + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + + if($DEBUG) echo "$TypeIn
      "; + if($TypeIn == 2){ + //MTP3_11_pub + $AAS_MTP3Table = 'param_11'; + $delSql = "UPDATE $AAS_MTP3Table SET initValue = '$row[initValue]' + WHERE $objWhereStr AND instanceNo='$AAS_E1ID'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + + echo ""; + exit(); +} +if(1==$E1unlock) +{ + $IdArr = explode('_',$delValue); + $delValue = $IdArr[0]; + $AAS_E1ID = $IdArr[1]; + + $sysId = '222_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.5.1'; + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + $defSql = " SELECT initValue FROM $paramTable WHERE $objWhereStr AND instanceNo='$delValue'"; + $defRes = @mysqli_query($pubConn,$defSql); + $row = @mysqli_fetch_array($defRes); + $flagoffset = "06.0-06.0"; + $row[initValue] = setBitValue($row[initValue],$flagoffset,1); + + $delSql = "UPDATE $paramTable SET initValue = '$row[initValue]' + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo='$delValue'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $commIdStr =oidSysCommSend($sysId,$nSetComm,$oidstr); + if($commIdStr=='-1') + { + DelComm($commArr); + echo "

      Error while getting/setting parameters. Please check the device state!
      "; + echo "oidSysCommSend($tmpSysId,$nSetComm,$tmpObjIdStr)
      "; + echo "

      Back"; + exit(); + } + + if($DEBUG) echo "$TypeIn
      "; + if($TypeIn == 2){ + //MTP3_11_pub + $AAS_MTP3Table = 'param_11'; + $delSql = "UPDATE $AAS_MTP3Table SET initValue = '$row[initValue]' + WHERE $objWhereStr AND instanceNo='$AAS_E1ID'"; + if($DEBUG) echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + + echo ""; + exit(); +} + +if($setSys) +{ + echo ""; +} + +if($setSys || $getSys || $undoSet) +{ + echo "

      Finished!

      "; + if($DEBUG) exit(); + //sleep(1); + echo ""; + exit(); +} + + +//========================================================== +//输出并显示数据 +//========================================================== +?> + + +ERROR!!:linkset == NULL
      "; + exit(0); +} +echo "
      "; +{//show help and back + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Configuration > Network > "; + echo "$devicename > "; + echo "$elementName"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo "
      "; + + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + /* + echo "MSC SP $devicename:  "; + */ + echo "$Spname  "; + echo ""; + echo ""; + echo "   "; + echo ""; + echo ""; + echo "

      $strBack"; + echo "

      "; + echo "
      "; + } +} +?> + +"; +if($linkset!=-1) +{//Linkset start + echo ""; + echo " Linkset"; + echo "No."; + echo "NI"; + echo "DPC"; + echo "ACN"; + echo "Status"; + echo ""; + + {//查询LinkSet参数表 + $out_time=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-30,date("m"),date("d"),date("Y"))); + $HbparamSql = " SELECT detailStat FROM OMC_PUB.sysStat + WHERE sysTypeNo='200' AND sysNo='9' AND (subSysNo='0' or subSysNo='1') AND updateTime>'$out_time' + "; + $Hbresult = mysqli_query($pubConn,$HbparamSql); + while($Hbvalue_mpt3Arr[] = mysqli_fetch_array($Hbresult));//取mtp3 的heartbeat + if(sizeof($Hbvalue_mpt3Arr)==3) + $isDualServ=1; + if(0)echo "
      $HbparamSql
      Hbvalue_mpt3: {$Hbvalue_mpt3Arr[0][detailStat]}"; + + $linksetConfArr=array( + array('Linkset DPC', '0.0-2.7', 'DPC'), + array('Network indicator', '3.0-3.1', 'NetID'), + array('Linkset loopback', '3.3-3.3', 'LoopFlag') + ); + + $NetIdConfArr=array('International','International-S','National','National-S'); + + $LoopConfArr=array('Disable','Enable'); + + $sysId = '222_99_99'; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $oidstr = '2.4.1'; + + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $objDb = 'OBJ_'.$sysTypeNo; + $paramTable = 'param_'.$sysNo; + + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr AND instanceNo ='$linkset' + "; + + $Result = mysqli_query($pubConn,$paramSql); + $Row = mysqli_fetch_array($Result); + //------------读LinkSet参数表--------------------- + $DPC = getBitValue($Row[initValue],$linksetConfArr[0][1]); + $DPC = hexdec($DPC); + $NetID = BinDec(getBitValue($Row[initValue],$linksetConfArr[1][1])); + $loopFlag = getBitValue($Row[initValue],$linksetConfArr[2][1]); + } + + {//Alternative linkset + $AlternativeArr=array( + array('Linkset DPC', '0.0-2.7', 'DPC'), + array('Normal linkset', '3.0-3.7', 'linkset'), + array('Alternative linkset','4.0-4.7', 'Alternative') + ); + $temp = $NetID+1; + $oidstr = '2.6.'.$temp; + + $objWhereStr= ''; + $objWhereStr =getLevelWhere($oidstr); + + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr + "; + + $Result_2 = mysqli_query($pubConn,$paramSql); + $num =0; + while($Row_2 = mysqli_fetch_array($Result_2)) + { + $t_DPC = hexdec(getBitValue($Row_2[initValue],$AlternativeArr[0][1])); + $t_LINKSET = hexdec(getBitValue($Row_2[initValue],$AlternativeArr[1][1])); + + if($t_DPC == $DPC && $t_LINKSET == $linkset) + { + $Alternative = hexdec(getBitValue($Row_2[initValue],$AlternativeArr[2][1])); + $ACNinstNo = $Row_2[instanceNo]; + $num++; + break; + } + } + + if($num == 0 ) + { + $paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE initValue = '0000008080' AND $objWhereStr + "; + $Result_2 = mysqli_query($pubConn,$paramSql); + $Row_2 = mysqli_fetch_array($Result_2); + + $DPC_new = dechex($DPC); + $DPC_new = omc_keep_length($DPC_new,0,6); + $Row_2[initValue] = setBitValue($Row_2[initValue],$AlternativeArr[0][1],$DPC_new); + + $hex_linkset = dechex($linkset); + $hex_linkset = omc_keep_length($hex_linkset,0,2); + $Row_2[initValue] = setBitValue($Row_2[initValue],$AlternativeArr[1][1],$hex_linkset); + $Alternative = 128; + $ACNinstNo = $Row_2[instanceNo]; + + $updSql = "UPDATE $paramTable SET initValue = '$Row_2[initValue]' + WHERE $objWhereStr AND instanceNo = '$Row_2[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + + if($devicename==$strGttObjects) + { + //ACNinstNo + $temp = $NetID+2; + $tmpACN = '2.7.'.$temp; + $tmpWhereStr =getLevelWhere($tmpACN); + + $tmpParamConfTable='OBJ_222.paramConf'; + $getSql="SELECT initValue FROM $tmpParamConfTable + WHERE $tmpWhereStr + "; + $result =mysqli_query($pubConn,$getSql); + $rows=mysqli_fetch_array($result); + $tmpDefaultValue=$rows[initValue]; + + $updSql = "UPDATE $paramTable SET initValue = '$tmpDefaultValue' + WHERE $tmpWhereStr AND instanceNo = '$Row_2[instanceNo]' + "; + mysqli_query($pubConn,$updSql); + } + } + } + + {//status + + $StatArr=array('Unavailable','Available','Inhibited','Reserved'); + + //从heartbeat读statue + $Hboffset=39+64+Floor($linkset/4); + //echo "
      $linkset
      "; + $tmpValue=substr($Hbvalue_mpt3Arr[0][detailStat],$Hboffset*2,2); + $bitoff =$linkset%4; + $bitoff1=$bitoff*2; + $bitoff2=$bitoff1+1; + $bitoff='0.'.$bitoff1.'-0.'.$bitoff2; + $tmp=bindec(getBitValue($tmpValue,$bitoff)); + if(0) echo "
      offset:$Hboffset
      tmpValue:$tmpValue
      bitoffset: $bitoff
      tmp: $tmp"; + if($tmp>1) + $tmp=0; + + $Status = $StatArr[$tmp]; + //echo "
      $Status
      "; + } + + + {//显示Linkset参数表 + $setobjIdstr = "2.4.1-2.4.1-2.6."; + $temp = $NetID+1; + $setobjIdstr = $setobjIdstr.$temp; + echo ""; + echo " "; + if($TypeIn == 16) + echo "$linkset "; + else + echo "$linkset "; + echo "$NetIdConfArr[$NetID] "; + echo ""; + echo "$DPC "; + echo ""; + + $temp = $NetID+2; + $oidACN = '2.7.'.$temp; + echo ""; + if($devicename==$strGttObjects) + echo "Edit "; + else + echo "--"; + echo "$Status "; + } + echo ""; +}//Linkset end + +{//E1 strat +//------------查询E1参数表--------------------- + +$E1ConfArr=array( + array('Flag', '06.5-06.5', 'Flag'), + array('Linkset', '00.0-00.7', 'Linkset'), + array('SLC', '01.0-01.7', 'SLC'), + array('MTP3IP', '02.0-05.7', 'MTP3IP'), + array('Link type', '06.1-06.3', 'Link type') + ); + +$LinkTypeArr=array('Non-sigtran','Sigtran','SCCP Lite'); + +$sysId = '222_99_99'; + +$sysIdArr = explode('_',$sysId); +$sysTypeNo = $sysIdArr[0]; +$sysNo = $sysIdArr[1]; +$subSysNo = $sysIdArr[2]; + +$oidstr = '2.5.1'; + +$objWhereStr= ''; +$objWhereStr =getLevelWhere($oidstr); + +$objDb = 'OBJ_'.$sysTypeNo; +$paramTable = 'param_'.$sysNo; + +$paramSql = " SELECT initValue,readValue,instanceNo FROM $paramTable + WHERE subSysNo = '$subSysNo' AND $objWhereStr + ORDER BY instanceNo + "; +//echo "
      $paramSql"; +$Result = mysqli_query($pubConn,$paramSql); + + +//------------读E1参数表--------------------- +$n = 0; +$addflag=0; +$E1listarr=""; +while($Row = mysqli_fetch_array($Result)) +{ + $flag = getBitValue($Row[initValue],$E1ConfArr[0][1]); + $E1linkset = hexdec(getBitValue($Row[initValue],$E1ConfArr[1][1])); + + if($flag && $E1linkset == $linkset) + { + //echo "
      $n:".$Row[instanceNo]; + $instNo[$n] = $Row[instanceNo]; + $SLC[$n] = hexdec(getBitValue($Row[initValue],$E1ConfArr[2][1])); + $MTP3IP[$n] = getBitValue($Row[initValue],$E1ConfArr[3][1]); + $tmptype = bindec(getBitValue($Row[initValue],$E1ConfArr[4][1])); + $Linktype[$n] = $LinkTypeArr[$tmptype]; + $Lockflag[$n] = getBitValue($Row[initValue],"06.0-06.0"); + {//status + + $StatArr=array('Unavailable','Available','Reserved'); + + //从heartbeat读statue + $Hboffset=39+Floor($Row[instanceNo]/4); + $tmpValue=substr($Hbvalue_mpt3Arr[0][detailStat],$Hboffset*2,2); + if($isDualServ && $Row[instanceNo]>=128) + $tmpValue=substr($Hbvalue_mpt3Arr[1][detailStat],$Hboffset*2,2); + $bitoff =$Row[instanceNo]%4; + $bitoff1=$bitoff*2; + $bitoff2=$bitoff1+1; + $bitoff='0.'.$bitoff1.'-0.'.$bitoff2; + + $tmp=bindec(getBitValue($tmpValue,$bitoff)); + if(0) echo "
      offset:$Hboffset
      tmpValue:$tmpValue
      bitoffset: $bitoff
      tmp: $tmp"; + if($tmp>1) + $tmp=0; + $Linkstate[$n] = $StatArr[$tmp]; + + } + //$addflag,用来决定在哪一个平面添加下一个E1 link + if($instNo[$n]>127){ + $addflag++; + }else{ + $addflag--; + } + if($n==0){ + $E1listarr = $instNo[$n]; + }else{ + $E1listarr = $E1listarr."_".$instNo[$n]; + } + $n++; + } + +} +echo ""; + +//------------显示E1参数表--------------------- +$rowspan = $n +1; +if($n == 0) +{ + $SLC[0] = 256; + $rowspan=2; +} +$setobjIdstr = "2.5.1-2.5.1-2.5.2"; +echo ""; +echo ""; + echo ""; + echo ""; + $tmpBackUrl="./wxc2_sp_signaling.php?trunkgp=$trunkgp>t=$gtt&sysNo=$sysNo&infoNo=$infoNo&linkset=$linkset>tSSN=$gttSSN&grpNo=$grpNo&appType=$appType"; + if($TypeIn ==2 && $n > 1) + { + echo ""; + } + elseif($n > 15) + { + echo ""; + } + else + { + echo ""; + } + echo "
      Link++$n','$trunkgp','$linkset','$webname','$tmpBackUrl','$infoNo')\">+
      "; +echo ""; +echo "No."; +echo "SLC"; +//echo "Link type"; +//echo "SG no."; +echo "Admin State"; +echo "Status"; +echo "Delete"; +echo ""; + +if($n == 0) +{ + echo "--"; +} +else +{ + echo " "; +} +for($i=0;$i < $n;$i++) +{ + $tempnum = $instNo[$i]/8; + $cardno = Floor($tempnum); + $cardE1no = $instNo[$i] - $cardno*8; + $cscNo = Floor($cardno/16); + $subCardNo = $cardno%16; + $cardname = "CSC$cscNo"." "."Card-$subCardNo-$cardE1no"; + + echo ""; + echo "$cardname"; + echo "$SLC[$i]"; +// echo "$Linktype[$i] "; +// echo "$SGno[$i] "; + + if($SLC[$i] == 0) + { + $delE1ID = 0; + } + else + { + $delE1ID = 1; + } + $delID = $instNo[$i]."_".$delE1ID; + if($DEBUG) echo "$delID
      "; + +// if($Lockflag[$i]) +// echo ""; +// else +// echo ""; + + if($Lockflag[$i]) + echo "Unlocked"; + else + echo "Locked"; + + echo ""; + + echo "$Linkstate[$i] "; + + echo ""; + echo ""; +} +}//E1 end +?> +
      + + + + diff --git a/wxc2_omc/fault/alarmList/alarmList_down.php b/wxc2_omc/fault/alarmList/alarmList_down.php new file mode 100755 index 0000000..9326a53 --- /dev/null +++ b/wxc2_omc/fault/alarmList/alarmList_down.php @@ -0,0 +1,701 @@ + + + + +"; +adjust_head_frame("down"); +adjust_title_head_frame("down"); +adjust_title_tail_frame("down"); + +adjust_content_head_frame("down"); +echo "
      "; + + + +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +/********************************************************* + 程序说明: + 功能说明:告警查询的下部页面,查询显示 + 调用关系: + 变量说明: + + 作者: + +修改注释: +NO.1 +姓名: +时间: +修改说明: +*********************************************************/ + +$DEBUG = 0; + +//if(!isset($selSysTypeNo)) $selSysTypeNo='all'; +//========================================================== +//变量定义 +//========================================================== +$dbName = 'OMC_PUB'; +$defTable = 'sysAlarmConf'; +$logTable = 'sysAlarmLog'; +$numberPerPage = 100; //每页纪录数 +$orderByStr = "alarmTime DESC,sysTypeNo,sysNo,subSysNo";//排序顺序 + +//确定告警内容显示语言种类 +if($language=='chn'){ + $alarmDesc = alarmDesc_1; //chinese +}else{ + $alarmDesc = alarmDesc_2; +} + +//初始化设备名和设备编号数组, +//由于三张表一起查时,速度太慢,占用系统资源太大。 +//所以系统类型编号对应的系统类型名称不从数据库中直接取。 +//将数据到如数组,显示时,从数组中来取。 +$device_sql ="SELECT sysTypeNo,sysTypeName + FROM $sysconf_table + WHERE needHeartBeat >'0' + ORDER BY sysTypeNo + "; +$device_result = @mysqli_query($pubConn,$device_sql); +$device_rows = @mysqli_fetch_array($device_result); +echo mysqli_error($pubConn); +if($DEBUG)echo "
      device_sql:$device_sql"; +$i=0; +do{ + $sysTypeDef[$i][sysTypeNo] = $device_rows[sysTypeNo]; + $sysTypeDef[$i][sysTypeName]= $device_rows[sysTypeName]; + $i++; +}while($device_rows = mysqli_fetch_array($device_result)); + +//需要被查询的字段名 +$selectFieldList="$logTable.sysTypeNo,sysNo,subSysNo,$logTable.compCode,$logTable.alarmCode,alarmLevel,$alarmDesc ,alarmTime,clearTime,clearMode,clearInfo"; + +//显示列表时的表头标题 +$noop=0; +if($noop!=1) +{ + if ($selectedLanguage == 'eng') + $showFieldArr=array('System','Alarm level','Events','Alarm time','Clear time','Clear'); + elseif ($selectedLanguage == 'chn') + $showFieldArr=array('系统号','告警等级','描述','告警时间','清除时间','清除'); +} +else +{ + if ($selectedLanguage == 'eng') + $showFieldArr=array('System','Alarm level','Events','Alarm time','Clear time'); + elseif ($selectedLanguage == 'chn') + $showFieldArr=array('系统号','告警等级','描述','告警时间','清除时间'); +} + +//========================================================== +//输入变量 +//========================================================== +//========================================================== +//数据处理 +//========================================================== +//告警手动清除 + +if($actMode == 'clear') +{ + + $compCode=$_REQUEST['compCode']; + $alarmCode=$_REQUEST['alarmCode']; + $alarmTime=$_REQUEST['alarmTime']; + $alarmLevel=$_REQUEST['alarmLevel']; + $sysTypeNo=$_REQUEST['sysTypeNo']; + $sysNo=$_REQUEST['sysNo']; + $subSysNo=$_REQUEST['subSysNo']; + //告警清除时需要的变量 +if($DEBUG) echo "
      actMode = $actMode"; +if($DEBUG) echo "
      sysTypeNo = $sysTypeNo"; +if($DEBUG) echo "
      sysNo = $sysNo"; +if($DEBUG) echo "
      subSysNo = $subSysNo"; +if($DEBUG) echo "
      compCode = $compCode"; +if($DEBUG) echo "
      alarmCode = $alarmCode"; +if($DEBUG) echo "
      alarmTime = $alarmTime"; +if($DEBUG) echo "
      clearMode = $clearMode"; +//上部页面传入的变量 +if($DEBUG) echo "
      selAlarmLevel = $selAlarmLevel"; +if($DEBUG) echo "
      selSysTypeNo = $selSysTypeNo"; +//翻页或选择页面时传入的变量,需要包含上部页面传入的变量 +if($DEBUG) echo "
      bgnNo = $bgnNo"; +if($DEBUG) echo "
      numberOfRecords= $numberOfRecords"; +$bssDbConn=mysqli_connect($$OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "BssOmcDb"); + if($sysTypeNo == 500) + { + // Clear this alarm in OMCR_ALARMEVENT and OMCR_BSSTREE + + $sqlstring = "UPDATE OMCR_ALARMEVENT SET Severity=0, ClearTime=NOW()" . + " WHERE bssid=$sysNo" . + " AND ObjectId='$rmObjectid'" . + " AND EventTime='$alarmTime'"; + //echo $sqlstring . "

      "; + $result=mysqli_query($bssDbConn,$sqlstring); + + $sqlstring = "SELECT min(Severity) FROM OMCR_ALARMEVENT" . + " WHERE bssid=$sysNo" . + " AND ObjectId='$Objectid'" . + " AND Severity>0 AND Severity<=3"; + //echo $sqlstring . "
      "; + $result=mysqli_query($bssDbConn,$sqlstring); + $row = mysqli_fetch_row($result); + + if ( $row[0] == null ) // All alarm cleared + $row[0] = 0; + + $sqlstring = "UPDATE OMCR_BSSTREE SET MaxSeverity=" . $row[0] . + " WHERE bssid=$sysNo" . + " AND ObjectId='$rmObjectid'"; + //echo $sqlstring . "
      "; + $result=mysqli_query($pubConn,$sqlstring); + + + } + else + { + $clearAlarmSql=" UPDATE $logTable + SET clearTime=CURRENT_TIMESTAMP,clearMode='1',clearBy='$userInfo[ID]' + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' + AND subSysNo = '$subSysNo' + AND compCode = '$compCode' + AND alarmCode = '$alarmCode' + AND alarmTime = '$alarmTime' + "; + if($DEBUG) + echo "
      clearAlarmSql=$clearAlarmSql"; + $result=mysqli_query($pubConn ,$clearAlarmSql); + echo mysqli_error($pubConn); + } + /* + echo "\n\n"; + */ +} +if($selSysTypeNo==500) +{ + //echo "selSysTypeNo:$selSysTypeNo
      "; + $dbName = 'BssOmcDb'; + $defTable = 'BssOmcDb.OMCR_ALARMCODE'; + $logTable = 'BssOmcDb.OMCR_ALARMEVENT'; + $orderByStr = "EventTime DESC,bssid";//排序顺序 + $numberPerPage = 100; //每页纪录数 + + $whereStr = ""; + if($selAlarmLevel == 'all'){ + $whereStr .="(1)"; + }elseif( $selAlarmLevel == 'unclear'){ + if(strlen($whereStr) > 0){ + $whereStr .=" AND (ClearTime is null or ClearTime='0')"; + }else{ + $whereStr .=" (ClearTime is null or ClearTime='0')"; + } + }elseif( $selAlarmLevel == 'cleared'){ + if(strlen($whereStr) > 0){ + $whereStr .=" AND ClearTime > '0' "; + }else{ + $whereStr .=" ClearTime > '0' "; + } + }else{ + if(strlen($whereStr) > 0){ + $whereStr .=" AND AlarmLevel = '$selAlarmLevel' AND (ClearTime is null or ClearTime='0')"; + }else{ + $whereStr .=" AlarmLevel = '$selAlarmLevel' AND (ClearTime is null or ClearTime='0')"; + } + } + //echo "selAlarmLevel:$selAlarmLevel
      "; + //echo "logTable:$logTable
      "; + if($DEBUG) echo "
      whereStr=$whereStr"; + + //首次查询,查出符合条件的纪录条数,并在以后的页面跳转中传递。 + if(!$numberOfRecords){ + $bgnNo=0; + $countSql="SELECT count(*) as totalNum FROM $logTable WHERE $whereStr"; + if($DEBUG) echo "
      countSql=$countSql"; + $result=mysqli_query($bssDbConn,$countSql); + echo mysqli_error($bssDbConn); + $record = @mysqli_fetch_array($result); + $numberOfRecords = $record[0]; + + if($DEBUG) echo "
      numberOfRecords=$numberOfRecords"; + //插入日志 + insertLog("Veiw Alarm Log"); + } + $thisPageOtherNum = $numberOfRecords; + //找到需要显示的纪录 + //$selectFieldList="bssid,AlarmLevel,EventInfo ,alarmTime,clearTime,clearMode,clearInfo"; + $selectFieldList="500 as sysTypeNo,bssid as sysNo,0 as subSysNo,Severity as alarmLevel,EventInfo as $alarmDesc ,EventTime as alarmTime,ClearTime as clearTime,0 as clearMode,ObjectId"; + if($numberOfRecords > 0){ + $showSql=" SELECT $selectFieldList FROM $logTable WHERE $whereStr + ORDER BY $orderByStr LIMIT $bgnNo, $numberPerPage "; + if($DEBUG) echo "
      showSql=$showSql"; + $result=@mysqli_query($bssDbConn,$showSql); + echo mysqli_error($bssDbConn); + $rows=@mysqli_fetch_array($result); + + //下面是控制分页显示需要传递的变量传递变量 + if ($numberOfRecords >= 1) { + $nextBgnNo = $bgnNo + $numberPerPage; //本页的结束数目 + if ($nextBgnNo > $numberOfRecords){ + $nextBgnNo = $numberOfRecords; + } + $t1 = $bgnNo + 1; + $prevBgnNo = $bgnNo - $numberPerPage; + if ($prevBgnNo < 0) { + $prevBgnNo = 0; + } + $basePageLink ="selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&numberOfRecords=$numberOfRecords"; + $prePageLink ="bgnNo=$prevBgnNo"; + $nextPageLink ="bgnNo=$nextBgnNo"; + } + $showBgnNo=$bgnNo+1; + } +} +else +{ + //根据上部页面传来的变量,生成查询条件 + if( strlen($selSysTypeNo) > 0){ + if( $selSysTypeNo != 'all'){ + $whereStr .=" $logTable.sysTypeNo = '$selSysTypeNo'"; + } + + if($selAlarmLevel == 'all'){ + $whereStr .=" "; + }elseif( $selAlarmLevel == 'unclear'){ + if(strlen($whereStr) > 0){ + $whereStr .=" AND clearTime = '0000-00-00 00:00:00' "; + }else{ + $whereStr .=" clearTime = '0000-00-00 00:00:00' "; + } + }elseif( $selAlarmLevel == 'cleared'){ + if(strlen($whereStr) > 0){ + $whereStr .=" AND clearTime <> '0000-00-00 00:00:00' "; + }else{ + $whereStr .=" clearTime <> '0000-00-00 00:00:00' "; + } + }else{ + if(strlen($whereStr) > 0){ + $whereStr .=" AND alarmLevel = '$selAlarmLevel' AND clearTime = '0000-00-00 00:00:00'"; + }else{ + $whereStr .=" alarmLevel = '$selAlarmLevel' AND clearTime = '0000-00-00 00:00:00'"; + } + } + }else{ + if(strlen($whereStr) < 1){ + $whereStr =" clearTime = '0000-00-00 00:00:00' "; + } + } + + if($DEBUG) echo "
      whereStr=$whereStr"; + + //查询基本条件 + if(strlen($whereStr) > 10){ + $bascWhereStr =" + AND $logTable.sysTypeNo = $defTable.sysTypeNo + AND $logTable.compCode = $defTable.compCode + AND $logTable.alarmCode = $defTable.alarmCode + "; + }else{ + $bascWhereStr =" + $logTable.sysTypeNo = $defTable.sysTypeNo + AND $logTable.compCode = $defTable.compCode + AND $logTable.alarmCode = $defTable.alarmCode + "; + } + + //首次查询,查出符合条件的纪录条数,并在以后的页面跳转中传递。 + if($selSysTypeNo=='all' || !isset($selSysTypeNo)|| strlen($selSysTypeNo)==0) + {//get $bssWhereStr + $bssDB = 'BssOmcDb'; + $bssLogTable = 'BssOmcDb.OMCR_ALARMEVENT'; + $bssOrderByStr = "EventTime DESC,bssid";//排序顺序 + + $bssWhereStr = ""; + if($selAlarmLevel == 'all'){ + $bssWhereStr .="(1)"; + }elseif( strlen($selAlarmLevel)==0 || $selAlarmLevel == 'unclear'){ + if(strlen($bssWhereStr) > 0){ + $bssWhereStr .=" AND (ClearTime is null or ClearTime='0000-00-00 00:00:00')"; + }else{ + $bssWhereStr .=" (ClearTime is null or ClearTime='0000-00-00 00:00:00')"; + } + }elseif( $selAlarmLevel == 'cleared'){ + if(strlen($bssWhereStr) > 0){ + $bssWhereStr .=" AND ClearTime <> '0000-00-00 00:00:00' "; + }else{ + $bssWhereStr .=" ClearTime <> '0000-00-00 00:00:00' "; + } + }else{ + if(strlen($bssWhereStr) > 0){ + $bssWhereStr .=" AND AlarmLevel = '$selAlarmLevel' AND (ClearTime is null or ClearTime='0000-00-00 00:00:00')"; + }else{ + $bssWhereStr .=" AlarmLevel = '$selAlarmLevel' AND (ClearTime is null or ClearTime='0000-00-00 00:00:00')"; + } + } + if($DEBUG) echo "
      bssWhereStr=$bssWhereStr"; + }//end get $bssWhereStr + + if(!$numberOfRecords){ + if(!isset($bgnNo)) + $bgnNo=0; + $countSql="SELECT count(*) as totalNum + FROM $logTable,$defTable + WHERE $whereStr + $bascWhereStr + "; + if($DEBUG) echo "
      countSql=$countSql"; + $result=mysqli_query($pubConn,$countSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($result); + $numberOfRecords = $record[0]; + + if($DEBUG) + echo "
      numberOfRecords=$numberOfRecords"; + if($selSysTypeNo=='all' || !isset($selSysTypeNo)|| strlen($selSysTypeNo)==0) + { + if(!$numberofBSS){ + //$bgnNo=0; + $countSql="SELECT count(*) as totalNum FROM $bssLogTable WHERE $bssWhereStr"; + if($DEBUG) echo "
      countBSSSql=$countSql"; + $bssResult=mysqli_query($pubConn,$countSql); + echo mysqli_error($pubConn); + $bssRecord = @mysqli_fetch_array($bssResult); + $numberofBSS = $bssRecord[0]; + } + $numberOfRecords +=$numberofBSS; + } + + if($DEBUG) echo "
      numberofBSS=$numberofBSS"; + //插入日志 + if($nolog != 1) + insertLog("View Alarm Log"); + } + + //找到需要显示的纪录 + if($numberOfRecords > 0){ + $showSql=" SELECT $selectFieldList + FROM $logTable,$defTable + WHERE $whereStr + $bascWhereStr + ORDER BY $orderByStr + LIMIT $bgnNo, $numberPerPage + "; + if($DEBUG) echo "
      showSql=$showSql"; + $result=@mysqli_query($pubConn,$showSql); + echo mysqli_error($pubConn); + $thisPageOtherNum = @mysqli_num_rows($result); + $rows=@mysqli_fetch_array($result); + + if($DEBUG)echo "
      thisPageOtherNum:$thisPageOtherNum"; + + if($selSysTypeNo=='all' || !isset($selSysTypeNo)|| strlen($selSysTypeNo)==0) + if($thisPageOtherNum==0 || $thisPageOtherNum< $numberPerPage) + { + //echo "$thisPageOtherNum< $numberPerPage"; + $countSql="SELECT count(*) as totalNum + FROM $logTable,$defTable + WHERE $whereStr + $bascWhereStr + "; + if($DEBUG) echo "
      countSql=$countSql"; + $cntResult=mysqli_query($pubConn,$countSql); + echo mysqli_error($pubConn); + $record = @mysqli_fetch_array($cntResult); + $otherTotalNum = $record[0]; + + $bssBgnNo = $bgnNo+$thisPageOtherNum-$otherTotalNum; + $selectFieldList="500 as sysTypeNo,bssid as sysNo,0 as subSysNo,Severity as alarmLevel,EventInfo as $alarmDesc ,EventTime as alarmTime,ClearTime as clearTime,0 as clearMode,ObjectId"; + + $showSql=" SELECT $selectFieldList FROM $bssLogTable WHERE $bssWhereStr + ORDER BY $bssOrderByStr LIMIT $bssBgnNo, $numberPerPage "; + if(0) + echo "
      bssShowSql=$showSql"; + $bss_Result=@mysqli_query($pubConn,$showSql); + echo mysqli_error($pubConn); + $thisPageBSSNum = @mysqli_num_rows($bss_Result); + $bss_Rows=@mysqli_fetch_array($bss_Result); + } + + //下面是控制分页显示需要传递的变量传递变量 + if ($numberOfRecords >= 1) { + + $nextBgnNo = $bgnNo + $numberPerPage; //本页的结束数目 + + if ($nextBgnNo > $numberOfRecords){ + $nextBgnNo = $numberOfRecords; + } + $t1 = $bgnNo + 1; + $prevBgnNo = $bgnNo - $numberPerPage; + if ($prevBgnNo < 0) { + $prevBgnNo = 0; + } + $basePageLink ="selSysTypeNo=$selSysTypeNo&selAlarmLevel=$selAlarmLevel&numberOfRecords=$numberOfRecords"; + $prePageLink ="bgnNo=$prevBgnNo"; + $nextPageLink ="bgnNo=$nextBgnNo"; + + } + $showBgnNo=$bgnNo+1; + } +}//end else. +//========================================================== +//输出并显示数据 +//========================================================== + +?> + + + +
      +"; +echo ""; +echo ""; +if($numberOfRecords == 0){ + echo "
      Currently there is no alarm!"; + exit(); +} + +?> + + + + + + +
      +  $showBgnNo - $nextBgnNo, "; + echo "($strTotal:$numberOfRecords)"; + ?> + + "; + echo "Previous $strPreviousPage "; + }else{ + echo "Previous $strPreviousPage "; + } + + //根据纪录条数,算出页码数,本页页码 + if($numberOfRecords > 0){ + $totalPageNum = ceil($numberOfRecords / $numberPerPage ); + $pageNo = $bgnNo / $numberPerPage + 1; + } + + echo ""; + + // NEW: Display a link for the next set of records. + if ($nextBgnNo != $numberOfRecords && $numberOfRecords >0) { + echo ""; + echo "$strNextPage Next"; + }else{ + echo "$strNextPage Next"; + } + ?> +
      + + + "; + echo "$showFieldArr[$i]"; + echo ""; + } + ?> + + + 0) +do +{ + if($selSysTypeNo==500) + { + $sysName = "BSS_".$rows[sysNo]."_".$rows[subSysNo]; + } + else + { + for($i=0; $i < sizeof($sysTypeDef); $i++){ + if($rows[sysTypeNo] == $sysTypeDef[$i][sysTypeNo]){ + $sysName=$sysTypeDef[$i][sysTypeName].'_'.$rows[sysNo].'_'.$rows[subSysNo]; + $sysId=$rows[sysTypeName].'_'.$rows[sysNo].'_'.$rows[subSysNo]; + + break; + } + } + if(strlen($sysName) < 3){ + $sysName='unknown'; + //continue; + } + } + $sysTypeNo =$rows[sysTypeNo]; + $sysNo =$rows[sysNo]; + $subSysNo =$rows[subSysNo]; + $compCode =$rows[compCode]; + $alarmCode =$rows[alarmCode]; + $alarmLevel =$rows[alarmLevel]; + $descript =$rows[$alarmDesc]; + $alarmTime =$rows[alarmTime]; + $clearTime =$rows[clearTime]; + $clearMode =$rows[clearMode]; + $sysName=getSystemNameBySysTypeNo($sysTypeNo).'_'.$rows[sysNo].'_'.$rows[subSysNo];; + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + if($noop!=1) + { + echo ""; + } + echo ""; +}while($rows=mysqli_fetch_array($result)); + +if($thisPageBSSNum>0) +do +{ + $sysName = "BSS_".$bss_Rows[sysNo]."_".$bss_Rows[subSysNo]; + $sysTypeNo =$bss_Rows[sysTypeNo]; + $sysNo =$bss_Rows[sysNo]; + $subSysNo =$bss_Rows[subSysNo]; + $compCode =$bss_Rows[compCode]; + $alarmCode =$bss_Rows[alarmCode]; + $alarmLevel =$bss_Rows[alarmLevel]; + $descript =$bss_Rows[$alarmDesc]; + $alarmTime =$bss_Rows[alarmTime]; + $clearTime =$bss_Rows[clearTime]; + $clearMode =$bss_Rows[clearMode]; + + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + if($noop!=1) + echo ""; + echo ""; +}while($bss_Rows=@mysqli_fetch_array($bss_Result)); +?> +
      "; + echo "  $sysName"; + echo ""; + $alarmLevelRemark=$alarmLevelDefArr[$alarmLevel][remark]; + echo "  $alarmLevelRemark"; + echo ""; + echo "  $descript"; + echo ""; + echo "  $alarmTime"; + echo ""; + echo "  $clearTime"; + echo ""; + if($clearTime == "0000-00-00 00:00:00"){ + if($sysTypeNo==500){ + echo ""; + }else{ + + echo ""; + } + + }elseif( $clearTime != '0000-00-00 00:00:00' && $clearMode == 1){ + echo "--"; + }elseif( $clearTime != '0000-00-00 00:00:00' && $clearMode == 0){ + echo "--"; + } + echo "
      "; + echo "  $sysName"; + echo ""; + $alarmLevelRemark=$alarmLevelDefArr[$alarmLevel][remark]; + echo "  $alarmLevelRemark"; + echo ""; + echo "  $descript"; + echo ""; + echo "  $alarmTime"; + echo ""; + echo "  $clearTime"; + echo ""; + if($clearTime == '0000-00-00 00:00:00' && $noop!=1){ + if($sysTypeNo==500){ + echo ""; + }else{ + echo ""; + } + }elseif( $clearTime != '0000-00-00 00:00:00' && $clearMode == 1 && $noop!=1){ + echo "--"; + }elseif( $clearTime != '0000-00-00 00:00:00' && $clearMode == 0 && $noop!=1){ + echo "--"; + } + echo "
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/fault/alarmList/alarmList_index.php b/wxc2_omc/fault/alarmList/alarmList_index.php new file mode 100755 index 0000000..3023263 --- /dev/null +++ b/wxc2_omc/fault/alarmList/alarmList_index.php @@ -0,0 +1,28 @@ + + + + +"; + echo ""; + } + else + { + echo ""; + echo ""; + } +?> + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/fault/alarmList/alarmList_up.php b/wxc2_omc/fault/alarmList/alarmList_up.php new file mode 100755 index 0000000..c6b53f5 --- /dev/null +++ b/wxc2_omc/fault/alarmList/alarmList_up.php @@ -0,0 +1,98 @@ + $strLogAlarm"; +$device_sql ="SELECT sysTypeNo,sysTypeName + FROM $sysconf_table + WHERE needHeartBeat >'0' + ORDER BY sysTypeNo + "; +$device_result = @mysqli_query($pubConn,$device_sql); +$device_rows = @mysqli_fetch_array($device_result); +echo mysqli_error($pubConn); + +?> + + +
      +"; +echo ""; +echo ""; +echo "$pageTitle"; +echo ""; +echo ""; +$helpId = "4.1"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +echo "$strSysType"; +echo " "; + +echo "$strAlamState"; +echo "     "; +echo ""; +?> + + + +"; +echo ""; + +echo ""; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + +
      + + + diff --git a/wxc2_omc/fault/alarmList/alarmNumList.php b/wxc2_omc/fault/alarmList/alarmNumList.php new file mode 100755 index 0000000..b56844c --- /dev/null +++ b/wxc2_omc/fault/alarmList/alarmNumList.php @@ -0,0 +1,126 @@ +showSql=$showSql"; +$result=@mysqli_query($pubConn,$showSql); +echo mysqli_error($pubConn); + +while($rows=@mysqli_fetch_array($result)){ + $alarmNumArr[$rows[alarmLevel]][number]=$rows[number]; +} + +//========================================================== +//输出并显示数据 +//========================================================== + +?> + + + + + +"> + +
      + + + + + +
      +$ttlSerial"; +?> + + +{$alarmNumArr[$i][number]}"; +echo ""; +for($i=1;$i<=sizeof($alarmNumArr);$i++){ + echo "\n "; +} +echo ""; +?> + +
      "; + echo "{$alarmNumArr[$i][number]}"; + echo "
      +
      +
      + + diff --git a/wxc2_omc/fault/alarmList/alarmgen_down.php b/wxc2_omc/fault/alarmList/alarmgen_down.php new file mode 100755 index 0000000..8d2066b --- /dev/null +++ b/wxc2_omc/fault/alarmList/alarmgen_down.php @@ -0,0 +1,83 @@ +'0' + ORDER BY sysTypeNo + "; +$device_result = @mysqli_query($pubConn,$device_sql); +$device_rows = @mysqli_fetch_array($device_result); +echo mysqli_error($pubConn); +$i=0; +do{ + $sysTypeDef[$i][sysTypeNo] = $device_rows[sysTypeNo]; + $sysTypeDef[$i][sysTypeName]= $device_rows[sysTypeName]; + $i++; +}while($device_rows = mysqli_fetch_array($device_result)); + +//需要被查询的字段名 +$selectFieldList="$logTable.sysTypeNo,sysNo,subSysNo,$logTable.compCode,$logTable.alarmCode,alarmLevel,$alarmDesc ,alarmTime,clearTime,clearMode,clearInfo"; + +//显示列表时的表头标题 +if ($selectedLanguage == 'eng') + $showFieldArr=array('System','Alarm code','Alarm level','Events','Alarm time','Clear time','Clear'); +elseif ($selectedLanguage == 'chn') + $showFieldArr=array('系统号','告警代码','告警等级','描述','告警时间','清除时间','清除'); + +//========================================================== +//输入变量 +//========================================================== + +//上部页面传入的变量 + if($DEBUG) echo "
      selSysTypeNo = $selSysTypeNo"; + if($DEBUG) echo "
      selAlarmLevel = $selAlarmLevel"; + if($DEBUG) echo "
      selAlarmCode = $selAlarmCode"; + if($DEBUG) echo "
      Clr = $Clr"; + if($DEBUG) echo "
      Gen = $Gen"; + +omcProgressBar(100,100); +omcProgressBar(100,80); +omcProgressBar(100,60); +omcProgressBar(100,40); +omcProgressBar(100,20); +omcProgressBar(100,$selAlarmCode); +?> + + + diff --git a/wxc2_omc/fault/alarmList/alarmgen_index.php b/wxc2_omc/fault/alarmList/alarmgen_index.php new file mode 100755 index 0000000..de44851 --- /dev/null +++ b/wxc2_omc/fault/alarmList/alarmgen_index.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/fault/alarmList/alarmgen_up.php b/wxc2_omc/fault/alarmList/alarmgen_up.php new file mode 100755 index 0000000..895a224 --- /dev/null +++ b/wxc2_omc/fault/alarmList/alarmgen_up.php @@ -0,0 +1,105 @@ + $strLogAlarm> Generator"; + +$device_sql ="SELECT sysTypeNo,sysTypeName + FROM $sysconf_table + WHERE needHeartBeat >'0' + ORDER BY sysTypeNo + "; +$device_result = @mysqli_query($pubConn,$device_sql); +$device_rows = @mysqli_fetch_array($device_result); +echo mysqli_error($pubConn); +?> + + +"; +echo ""; +echo ""; +echo "$pageTitle"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> + +
      + + + + + + + + +
      + + "; +echo ""; +do{ + echo ""; +}while($device_rows = mysqli_fetch_array($device_result)); +echo "    "; + +echo "Alarm Severity  "; +echo "     "; + +echo "Alarm Code  "; +echo "     "; +?> + + +"; +?> + +"; +?> +
      +
      + + + diff --git a/wxc2_omc/fault/alarmList/debug.txt b/wxc2_omc/fault/alarmList/debug.txt new file mode 100755 index 0000000..b27db95 --- /dev/null +++ b/wxc2_omc/fault/alarmList/debug.txt @@ -0,0 +1 @@ +sn= diff --git a/wxc2_omc/fault/alarmList/getAlarmLevelandNum.php b/wxc2_omc/fault/alarmList/getAlarmLevelandNum.php new file mode 100755 index 0000000..88dd338 --- /dev/null +++ b/wxc2_omc/fault/alarmList/getAlarmLevelandNum.php @@ -0,0 +1,67 @@ +showSql=$showSql"; + +$result=@mysqli_query($pubConn,$showSql); + +echo mysqli_error($pubConn); + + + +while($rows=@mysql_fetch_array($result)) + +{ + + $alarmNumArr[$rows[alarmLevel]][number]=$rows[number]; + +} + + + +$selSql = "SELECT AlarmLevel as alarmLevel,count(*) as numbe + + FROM BssOmcDb.OMCR_ALARMEVENT WHERE ClearTime = '0' GROUP BY alarmLevel"; + +$result=@mysqli_query($pubConn,$showSql); + +echo mysqli_error($pubConn); + +while($rows=@mysql_fetch_array($result)) + +{ + + $alarmNumArr[$rows[alarmLevel]][number]+=$rows[number]; + +} + + + +?> \ No newline at end of file diff --git a/wxc2_omc/fault/bssStatus.tgz b/wxc2_omc/fault/bssStatus.tgz new file mode 100755 index 0000000..8511fdf Binary files /dev/null and b/wxc2_omc/fault/bssStatus.tgz differ diff --git a/wxc2_omc/fault/bssStatus/bscStatus.php b/wxc2_omc/fault/bssStatus/bscStatus.php new file mode 100755 index 0000000..ad0a81b --- /dev/null +++ b/wxc2_omc/fault/bssStatus/bscStatus.php @@ -0,0 +1,402 @@ +'', + "alias"=>'', + "status"=>'', + "ALink_0_stat"=>'', + "ALink_0_slot"=>'', + "ALink_0_port"=>'', + "ALink_1_stat"=>'', + "ALink_1_slot"=>'', + "ALink_1_port"=>'', + "ALink_2_stat"=>'', + "ALink_2_slot"=>'', + "ALink_2_port"=>'', + "ALink_3_stat"=>'', + "ALink_3_slot"=>'', + "ALink_3_port"=>'', + "ClockOperStat"=>'', + "ClockReference"=>'', + "refreshTime"=>'' + ); +*/ +//========================================================== +//输入变量 +//========================================================== +//清除一个BSC的状态时,需传入的变量 +if($DEBUG) echo "
      actMode=$actMode"; +if($DEBUG) echo "
      sysTypeNo=$bscSysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; + +//========================================================== +//数据处理 +//========================================================== +//清除一个BSC的状态 +if($actMode == 'clear'){ + $clrSql="DELETE FROM sysStat + WHERE sysTypeNo='$bscSysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + if($DEBUG) echo "
      clrSql=$clrSql"; + mysqli_query($pubConn,$clrSql); + echo mysqli_error($pubConn); +} + +$listSql = "SELECT a.bssid,a.ip,b.Label as name,a.connected FROM BssOmcDb.OMCR_BSSTABLE as a, BssOmcDb.OMCR_BssFunc as b" . + " WHERE a.ip!='' AND a.bssid=b.bssid ORDER BY bssid"; +if($DEBUG) echo "
      listSql = $listSql
      "; +$listResult = mysqli_query($bssConn,$listSql); +$i=0; +while($listRows=@mysqli_fetch_array($listResult)){ + //get installed bsc id, alias,updateTime form sysInfo table + $updateTimeSql = "SELECT updateTime FROM sysStat + WHERE sysTypeNo='$bscSysTypeNo' + AND sysNo='$listRows[bssid]' + "; + if($DEBUG) + echo "
      updateTimeSql = $updateTimeSql"; + $result = mysqli_query($pubConn,$updateTimeSql); + echo mysqli_error($pubConn); + //if(mysqli_num_rows($result) <= 0){ + // echo "
      $strNotFoundAnyBSC"; + // exit(); + //} + + $rows = mysqli_fetch_array($result); + $bscInfo[$i][bscId]=$listRows[bssid]; + $bscInfo[$i][alias]=$listRows[name]; + $bscInfo[$i][refreshTime]=$rows[updateTime]; + if($DEBUG) echo "
      ==================="; + if($DEBUG) echo "
      bscInfo[$i][bscId]={$bscInfo[$i][bscId]}"; + if($DEBUG) echo "
      bscInfo[$i][alias]={$bscInfo[$i][alias]}"; + if($DEBUG) echo "
      bscInfo[$i][refreshTime]={$bscInfo[$i][refreshTime]}"; + $i++; +} +$bscNum = $i; +//echo "
      bscNum=$bscNum"; +//get system alias +//$sysAlias= + +for($i=0; $i<$bscNum; $i++){ + //Bsc status --> Bsc.bsc_id + $ObjectId = 'Bsc.0'; + $Bsc_sql="SELECT t1.AdminState,t1.OperState,t1.AvailStatus,t1.UsageState,t2.Presence + FROM OMCR_Bsc as t1,OMCR_BSSTREE as t2 + WHERE t1.bssid = '{$bscInfo[$i][bscId]}' + AND t2.bssid = '{$bscInfo[$i][bscId]}' + AND t1.ObjectId = '$ObjectId' + AND t1.ObjectId = t2.ObjectId + "; + if($DEBUG) echo "

      Bsc_sql = $Bsc_sql"; + $result = mysqli_query($bssConn,$Bsc_sql); + echo mysqli_error($bssConn); + $rows = mysqli_fetch_array($result); + $bscInfo[$i][bscStatus]= $AvailState[$rows[AvailStatus]]; + $bscInfo[$i][bscStatusColor]= $AvailStateColor[$rows[AvailStatus]]; + + //clock module->Card.0.10 + $ObjectId = 'Card.0.17'; + $clock_module_sql = "SELECT t1.CurrentOperationalState,t1.CurrentClockReference,t2.Presence + FROM OMCR_ClockMod as t1,OMCR_BSSTREE as t2 + WHERE t1.bssid = '{$bscInfo[$i][bscId]}' + AND t2.bssid = '{$bscInfo[$i][bscId]}' + AND t1.ObjectId = '$ObjectId' + AND t1.ObjectId = t2.ObjectId + ORDER BY t1.ObjectId + "; + if($DEBUG) echo "

      clock_module_sql = $clock_module_sql"; + $result = mysqli_query($bssConn,$clock_module_sql); + echo mysqli_error($bssConn); + $rows = mysqli_fetch_array($result); + $bscInfo[$i][ClockOperStat]=$ClockOperState[$rows[CurrentOperationalState]]; + $bscInfo[$i][ClockReference]=$ClockReference[$rows[CurrentClockReference]]; + + //get ALink status -> ALink.Bsc_id.0.n + $ObjectId = 'ALink.0.0.%'; + $ALink_sql = " SELECT t1.AvailStatus,t1.UsageState,t1.e1Slots,t1.e1Framer,t1.e1Channel,t2.Presence + FROM OMCR_ALink as t1,OMCR_BSSTREE as t2 + WHERE t1.bssid = '{$bscInfo[$i][bscId]}' + AND t2.bssid = '{$bscInfo[$i][bscId]}' + AND t1.ObjectId = t2.ObjectId + "; + if($DEBUG) echo "
      ALink_sql = $ALink_sql"; + $result = mysqli_query($bssConn,$ALink_sql); + echo mysqli_error($bssConn); + $AlinkNum=mysqli_num_rows($result); + for($k=0;$k<$AlinkNum;$k++){ + $rows = mysqli_fetch_array($result); + if($rows[Presence] > 0){ + $bscInfo[$i]["ALink_".$k."_stat"]=$AvailState[$rows[AvailStatus]]; + $bscInfo[$i]["ALink_".$k."_statColor"]=$AvailStateColor[$rows[AvailStatus]]; + $bscInfo[$i]["ALink_".$k."_slot"]=$rows[e1Slots]; + $bscInfo[$i]["ALink_".$k."_port"]=$rows[e1Framer]; + }else{ + $bscInfo[$i]["ALink_".$k."_stat"]='--'; + $bscInfo[$i]["ALink_".$k."_slot"]='--'; + $bscInfo[$i]["ALink_".$k."_port"]='--'; + } + } + + if($DEBUG) echo "
      ==================="; + if($DEBUG) echo "
      bscInfo[$i][bscId]={$bscInfo[$i][bscId]}"; + if($DEBUG) echo "
      bscInfo[$i][alias]={$bscInfo[$i][alias]}"; + if($DEBUG) echo "
      bscInfo[$i][refreshTime]={$bscInfo[$i][refreshTime]}"; + if($DEBUG) echo "
      bscInfo[$i][bscStatus]= {$bscInfo[$i][bscStatus]}"; + if($DEBUG) echo "
      bscInfo[$i][ClockOperStat]={$bscInfo[$i][ClockOperStat]}"; + if($DEBUG) echo "
      bscInfo[$i][ClockReference]={$bscInfo[$i][ClockReference]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_0_stat]={$bscInfo[$i][ALink_0_stat]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_0_slot]={$bscInfo[$i][ALink_0_slot]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_0_port]={$bscInfo[$i][ALink_0_port]}"; + + if($DEBUG) echo "
      bscInfo[$i][ALink_1_stat]={$bscInfo[$i][ALink_1_stat]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_1_slot]={$bscInfo[$i][ALink_1_slot]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_1_port]={$bscInfo[$i][ALink_1_port]}"; + + if($DEBUG) echo "
      bscInfo[$i][ALink_2_stat]={$bscInfo[$i][ALink_2_stat]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_2_slot]={$bscInfo[$i][ALink_2_slot]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_2_port]={$bscInfo[$i][ALink_2_port]}"; + + if($DEBUG) echo "
      bscInfo[$i][ALink_3_stat]={$bscInfo[$i][ALink_3_stat]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_3_slot]={$bscInfo[$i][ALink_3_slot]}"; + if($DEBUG) echo "
      bscInfo[$i][ALink_3_port]={$bscInfo[$i][ALink_3_port]}"; +} + + +//========================================================== +//输出并显示数据 +//========================================================== + +?> +"> + +"; +echo ""; +echo ""; +echo "$strSysStatus > $strCentralOffice > BSC"; +echo ""; +echo ""; +$helpId="1.2.6.1"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> +
      " > + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +"; + $tmpBscName=urldecode($bscInfo[$i][alias]); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
      IDALINK 0ALINK 1ALINK 2ALINK 3
       $tmpBscName{$bscInfo[$i][bscId]}{$bscInfo[$i][ALink_0_stat]}{$bscInfo[$i][ALink_0_slot]}{$bscInfo[$i][ALink_0_port]}{$bscInfo[$i][ALink_1_stat]}{$bscInfo[$i][ALink_1_slot]}{$bscInfo[$i][ALink_1_port]}{$bscInfo[$i][ALink_2_stat]}{$bscInfo[$i][ALink_2_slot]}{$bscInfo[$i][ALink_2_port]}{$bscInfo[$i][ALink_3_stat]}{$bscInfo[$i][ALink_3_slot]}{$bscInfo[$i][ALink_3_port]}{$bscInfo[$i][bscStatus]}{$bscInfo[$i][ClockOperStat]}{$bscInfo[$i][ClockReference]}{$bscInfo[$i][refreshTime]}
      +
      + + + + + +
      + :     + Y = ,     + N = ,    + -- = . + + "; + echo ""; + echo "$strBack"; + ?> +
      + + + 0 AND Severity > 0 + "; +if($DEBUG) echo "
      Alarm_sql = $Alarm_sql"; +$result = mysqli_query($bssConn,$Alarm_sql); +echo mysqli_error($bssConn); +if(mysqli_num_rows($result)){ + echo "
      BSS Alarm List"; + echo ""; + echo " "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo " "; + + while($rows = mysqli_fetch_array($result)){ + echo ""; + echo ""; + echo ""; + $tmpLevel=$rows[Severity]; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      BSS IDObject nameAlarm levelAlarm infoAlarm Time
      $rows[bssid]$rows[ObjectId]$AlarmLevel[$tmpLevel]$rows[EventInfo]$rows[EventTime]
      "; +} + +//========================================================== +//发送NMI命令,读出数据,更新数据库 +//========================================================== +$getCommNoSql = "SELECT row_no FROM OMCR_COMMAND WHERE status=0 ORDER BY seqNum ASC LIMIT 0,1"; +if($DEBUG) +echo "
      getCommNoSql=$getCommNoSql"; +$result = mysqli_query($bssConn,$getCommNoSql); +$rows= mysqli_fetch_array($result); +$bgn_row_num = $rows['row_no']; + +for($j=0;$j<$bscNum;$j++){ + for($i=0;$iset Oid_sql = $Oid_sql"; + $result = mysqli_query($bssConn,$Oid_sql); + echo mysqli_error($bssConn); + $bgn_row_num++; + $nmi_command = $nmiCommArr[$i][1]; + $Command_sql = "REPLACE INTO OMCR_COMMAND + VALUES('$bgn_row_num','{$bscInfo[$j][bscId]}','$nmi_command',null,'255','-1',null,null,null)"; + if($DEBUG) + echo "
      Commnad_sql = $Command_sql"; + $result = mysqli_query($bssConn,$Command_sql); + echo mysqli_error($bssConn); + $bgn_row_num++; + } +} +?> + diff --git a/wxc2_omc/fault/bssStatus/btsStatus.php b/wxc2_omc/fault/bssStatus/btsStatus.php new file mode 100755 index 0000000..ee1113c --- /dev/null +++ b/wxc2_omc/fault/bssStatus/btsStatus.php @@ -0,0 +1,477 @@ +'', + 'btsId'=>'', + 'name'=>'', + 'status'=>'', + 'AbisStatus'=>'', + 'AbisSlot'=>'', + 'AbisPort'=>'', + 'AbisChannel'=>'', + 'Trx2_stat'=>'', + 'Trx4_stat'=>'', + 'Trx6_stat'=>'', + "ClockOperStat"=>'', + "ClockReference"=>'', + "refreshTime"=>'' +); +*/ +//========================================================== +//输入变量 +//========================================================== +//清除一个BTS的状态时,需传入的变量 +if($DEBUG) echo "
      actMode=$actMode"; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +if($DEBUG) echo "
      sysNo=$sysNo"; +if($DEBUG) echo "
      subSysNo=$subSysNo"; + +//========================================================== +//数据处理 +//========================================================== +//清除一个BTS的状态 +if($actMode == 'clear'){ + $clrSql="DELETE FROM sysStat + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='($subSysNo-1)' + "; + if($DEBUG) echo "
      clrSql=$clrSql"; + mysqli_query($pubConn,$clrSql); + echo mysqli_error($pubConn); +} + +$listSql = "SELECT a.bssid,a.ip,b.Label as name,a.connected FROM BssOmcDb.OMCR_BSSTABLE as a, BssOmcDb.OMCR_BssFunc as b" . + " WHERE a.ip!='' AND a.bssid=b.bssid ORDER BY bssid"; +if($DEBUG) echo "
      listSql = $listSql
      "; +$listResult = mysqli_query($pubConn,$listSql); +$i=0; +while($listRows=@mysqli_fetch_array($listResult)){ + //get installed bsc id, alias,updateTime form sysInfo table + $updateTimeSql = "SELECT updateTime FROM sysStat + WHERE sysTypeNo='$bscSysTypeNo' + AND sysNo='$listRows[bssid]' + "; + if($DEBUG) + echo "
      updateTimeSql = $updateTimeSql"; + $result = mysqli_query($pubConn,$updateTimeSql); + echo mysqli_error($pubConn); + //if(mysqli_num_rows($result) <= 0){ + // echo "
      $strNotFoundAnyBSC"; + // exit(); + //} + + $rows = mysqli_fetch_array($result); + $bscInfo[$i][bscId]=$listRows[bssid]; + $bscInfo[$i][refreshTime]=$rows[updateTime]; + if($DEBUG) echo "
      ==================="; + if($DEBUG) echo "
      bscInfo[$i][bscId]={$bscInfo[$i][bscId]}"; + if($DEBUG) echo "
      bscInfo[$i][refreshTime]={$bscInfo[$i][refreshTime]}"; + $i++; +} +$bscNum = $i; +if($DEBUG) +echo "
      bscNum=$bscNum"; + +$j = 0; + +/* +//get installed BTS's +for($i=0;$i<$bscNum;$i++){ + + $bscId=$bscInfo[$i][bscId]; + + //Bts refreshTime + $Bts_sql="SELECT subSysNo,updateTime + FROM sysStat + WHERE sysTypeNo='$btsSysTypeNo' AND sysNo='$bscId' + "; + if($DEBUG) echo "

      Bts_sql = $Bts_sql"; + $result = mysqli_query($pubConn,$Bts_sql); + echo mysqli_error($pubConn); + $k=0; + while($rows = mysqli_fetch_array($result)){ + $refreshTimeArr[$k][btsId]=$rows[subSysNo] + 1; + $refreshTimeArr[$k][refreshTime]=$rows[updateTime]; + $k++; + } + + //Bts status --> Bts.$btsId.0 + $ObjectId = "Bts.".$btsId.".0"; + //echo "
      ObjectId=$ObjectId"; + $Bts_sql="SELECT ObjectId + FROM OMCR_BSSTREE + WHERE bssid = '$bscId' AND ObjectId like 'Bts.%.0' AND Presence > '0' + "; + //if($DEBUG) + echo "

      Bts_sql = $Bts_sql"; + $result = mysqli_query($pubConn,$Bts_sql); + echo mysqli_error($pubConn); + while($rows = mysqli_fetch_array($result)){ + $btsInfo[$j][bscId]=$bscId; + $tmpObjArr=explode('.',$rows[ObjectId]); + $tmpBtsId=$tmpObjArr[1]; + $btsInfo[$j][btsId]=$tmpBtsId; + for($k=0;$k==================="; + if($DEBUG) echo "
      btsInfo[$j][bscId]={$btsInfo[$j][bscId]}"; + if($DEBUG) echo "
      btsInfo[$j][btsId]={$btsInfo[$j][btsId]}"; + if($DEBUG) echo "
      btsInfo[$j][refreshTime]={$btsInfo[$j][refreshTime]}"; + $j++; + } +} +*/ + +//get installed BTS's +$j=0; +for($i=0;$i<$bscNum;$i++){ + $bscId=$bscInfo[$i][bscId]; + + $Bts_sql="SELECT subSysNo,updateTime + FROM sysStat + WHERE sysTypeNo='$btsSysTypeNo' AND sysNo='$bscId' + "; + if($DEBUG) echo "

      Bts_sql = $Bts_sql"; + $result = mysqli_query($pubConn,$Bts_sql); + echo mysqli_error($pubConn); + while($rows = mysqli_fetch_array($result)){ + $btsInfo[$j][bscId]=$bscId; + $btsInfo[$j][btsId]=$rows[subSysNo]; + $btsInfo[$j][refreshTime]=$rows[updateTime]; + if($DEBUG) echo "
      ==================="; + if($DEBUG) echo "
      btsInfo[$j][bscId]={$btsInfo[$j][bscId]}"; + if($DEBUG) echo "
      btsInfo[$j][btsId]={$btsInfo[$j][btsId]}"; + if($DEBUG) echo "
      btsInfo[$j][refreshTime]={$btsInfo[$j][refreshTime]}"; + $j++; + } +} + + +$btsNum=$j; +if($DEBUG) echo "
      btsNum=$btsNum"; +for($j=0;$j<$btsNum;$j++){ + $bscId=$btsInfo[$j][bscId]; + $btsId=$btsInfo[$j][btsId]; + + //Bts status --> Bts.$btsId.0 + $ObjectId = "Bts.".$btsId.".0"; + $Bts_sql="SELECT t1.AdminState,t1.OperState,t1.AvailStatus,t1.UsageState,t2.Presence,t1.Label + FROM OMCR_Bts as t1,OMCR_BSSTREE as t2 + WHERE t1.bssid = '$bscId' AND t2.bssid = '$bscId' + AND t1.ObjectId = '$ObjectId' AND t2.ObjectId = '$ObjectId' + "; + if($DEBUG) + echo "

      Bts_sql = $Bts_sql"; + $result = mysqli_query($pubConn,$Bts_sql); + echo mysqli_error($pubConn); + $rows = mysqli_fetch_array($result); + $btsInfo[$j][status] = $AvailState[$rows[AvailStatus]]; + $btsInfo[$j][statusColor] = $AvailStateColor[$rows[AvailStatus]]; + $btsInfo[$j][name] = $rows[Label]; + + //clock module->BtsMgr_Shelf_Card.$btsId.0.10 + $ObjectId = "BtsMgr_Shelf_Card.".$btsId.".0.17"; + $clock_module_sql = "SELECT t1.CurrentOperationalState,t1.CurrentClockReference,t2.Presence + FROM OMCR_ClockMod as t1,OMCR_BSSTREE as t2 + WHERE t1.bssid = '$bscId' AND t2.bssid = '$bscId' + AND t1.ObjectId = '$ObjectId' AND t1.ObjectId = t2.ObjectId + "; + if($DEBUG) echo "

      clock_module_sql = $clock_module_sql"; + $result = mysqli_query($pubConn,$clock_module_sql); + echo mysqli_error($pubConn); + if(mysqli_num_rows($result) > 0){ + $rows = mysqli_fetch_array($result); + $btsInfo[$j][ClockOperStat] = $ClockOperState[$rows[CurrentOperationalState]]; + $btsInfo[$j][ClockReference]= $ClockReference[$rows[CurrentClockReference]]; + }else{ + $btsInfo[$j][ClockOperStat] = '--'; + $btsInfo[$j][ClockReference]= '--'; + } + //get Abis status -> AbisMgr.$btsId.0 + $ObjectId = "AbisMgr.".$btsId.".0"; + $Abis_sql="SELECT t1.AvailStatus,t1.UsageState,t1.e1Slot,t1.e1Port,t1.e1Chan,t2.Presence + FROM OMCR_AbisMgr as t1,OMCR_BSSTREE as t2 + WHERE t1.bssid = '$bscId' AND t2.bssid = '$bscId' + AND t1.ObjectId = '$ObjectId' AND t1.ObjectId = t2.ObjectId + "; + if($DEBUG) echo "

      Abis_sql = $Abis_sql"; + $result = mysqli_query($pubConn,$Abis_sql); + echo mysqli_error($pubConn); + $rows = mysqli_fetch_array($result); + if($rows[Presence] > 0){ + $btsInfo[$j][AbisStatus] = $AvailState[$rows[AvailStatus]]; + $btsInfo[$j][AbisStatusColor] = $AvailStateColor[$rows[AvailStatus]]; + $btsInfo[$j][AbisSlot] = $rows[e1Slot]; + $btsInfo[$j][AbisPort] = $rows[e1Port]; + $btsInfo[$j][AbisChannel] = $rows[e1Chan]; + }else{ + $btsInfo[$j][AbisStatus] = '--'; + $btsInfo[$j][AbisSlot] = '--'; + $btsInfo[$j][AbisPort] = '--'; + $btsInfo[$j][AbisChannel] = '--'; + } + //TRX status --> Trx.bts_id.0.n + $ObjectId = "Trx.".$btsId.".0.%"; + $Trx_sql="SELECT t1.ObjectId,t1.AvailStatus,t1.UsageState,t2.Presence + FROM OMCR_Trx as t1,OMCR_BSSTREE as t2 + WHERE t1.bssid = '$bscId' AND t2.bssid = '$bscId' + AND t1.ObjectId like '$ObjectId' AND t1.ObjectId = t2.ObjectId + "; + if($DEBUG) echo "

      Trx_sql = $Trx_sql"; + $result = mysqli_query($pubConn,$Trx_sql); + echo mysqli_error($pubConn); + while($rows = mysqli_fetch_array($result)){ + $tmpStr=explode('.',$rows[ObjectId]); + $p=$tmpStr[3] - 0; + if($rows[Presence] > 0){ + $btsInfo[$j]["Trx".$p."_stat"]=$AvailState[$rows[AvailStatus]]; + }else{ + $btsInfo[$j]["Trx".$p."_stat"]='--'; + } + } + + if($DEBUG) echo "
      =============="; + if($DEBUG) echo "
      btsInfo[$j][bscId] ={$btsInfo[$j][bscId]}"; + if($DEBUG) echo "
      btsInfo[$j][btsId] ={$btsInfo[$j][btsId]}"; + if($DEBUG) echo "
      btsInfo[$j][name] ={$btsInfo[$j][name]}"; + if($DEBUG) echo "
      btsInfo[$j][status] ={$btsInfo[$j][status]}"; + if($DEBUG) echo "
      btsInfo[$j][AbisStatus]={$btsInfo[$j][AbisStatus]}"; + if($DEBUG) echo "
      btsInfo[$j][AbisSlot] ={$btsInfo[$j][AbisSlot]}"; + if($DEBUG) echo "
      btsInfo[$j][AbisPort] ={$btsInfo[$j][AbisPort]}"; + if($DEBUG) echo "
      btsInfo[$j][AbisChannel]={$btsInfo[$j][AbisChannel]}"; + if($DEBUG) echo "
      btsInfo[$j][Trx2_stat] ={$btsInfo[$j][Trx2_stat]}"; + if($DEBUG) echo "
      btsInfo[$j][Trx4_stat] ={$btsInfo[$j][Trx4_stat]}"; + if($DEBUG) echo "
      btsInfo[$j][Trx6_stat] ={$btsInfo[$j][Trx6_stat]}"; + if($DEBUG) echo "
      btsInfo[$j][ClockOperStat] ={$btsInfo[$j][ClockOperStat]}"; + if($DEBUG) echo "
      btsInfo[$j][ClockReference]={$btsInfo[$j][ClockReference]}"; + if($DEBUG) echo "
      btsInfo[$j][refreshTime] ={$btsInfo[$j][refreshTime]}"; +} + + + +//========================================================== +//输出并显示数据 +//========================================================== + +?> + +"; +echo ""; +echo ""; +echo "$strSysStatus > BTS"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> + + +
      + +
      + + + + + + + + + + + + + + + + + + + + + + + +"; + $tmpBtsName=urldecode($btsInfo[$j][name]); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + /* + echo ""; + echo ""; + echo ""; + */ + echo ""; + echo ""; + echo ""; + echo ""; +} +?> + +
      IDABISBTS
      BSCBTS
       $tmpBtsName{$btsInfo[$j][bscId]}{$btsInfo[$j][btsId]} {$btsInfo[$j][AbisStatus]} {$btsInfo[$j][AbisSlot]} {$btsInfo[$j][AbisPort]} {$btsInfo[$j][AbisChannel]} {$btsInfo[$j][status]} {$btsInfo[$j][Trx2_stat]} {$btsInfo[$j][Trx4_stat]} {$btsInfo[$j][Trx6_stat]} {$btsInfo[$j][ClockOperStat]} {$btsInfo[$j][ClockReference]} {$btsInfo[$j][refreshTime]}
      + + + + + + +
      + :     + Y = ,     + N = ,    + -- = . + + "; + + echo ""; + echo "$strBack"; + ?> +
      + +set Oid_sql = $Oid_sql"; + $result = mysqli_query($pubConn,$Oid_sql); + echo mysqli_error($pubConn); + $bgn_row_num++; + $nmi_command = $nmiCommArr[$i][1]; + $Command_sql = "REPLACE INTO OMCR_COMMAND + VALUES('$bgn_row_num','{$btsInfo[$j][bscId]}','$nmi_command',null,'255','-1',null,null,null)"; + if($DEBUG) + echo "
      Commnad_sql = $Command_sql"; + $result = mysqli_query($pubConn,$Command_sql); + echo mysqli_error($pubConn); + $bgn_row_num++; + } +} +?> + + + \ No newline at end of file diff --git a/wxc2_omc/fault/create/config.ini b/wxc2_omc/fault/create/config.ini new file mode 100755 index 0000000..6f83deb --- /dev/null +++ b/wxc2_omc/fault/create/config.ini @@ -0,0 +1,19 @@ +# This file conf the total plat definition + +PlatSysTypeNo=200 +[0] +PlatformName="EMS" +PlatformID=0 +PlatformNo=2 +[8] +PlatformName="VSS" +PlatformID=8 +PlatformNo=10 +[9] +PlatformName="MSS" +PlatformID=9 +PlatformNo=2 +[18] +PlatformName="RCM" +PlatformID=18 +PlatformNo=2 diff --git a/wxc2_omc/fault/create/plat_status_detail.php b/wxc2_omc/fault/create/plat_status_detail.php new file mode 100755 index 0000000..e7670e5 --- /dev/null +++ b/wxc2_omc/fault/create/plat_status_detail.php @@ -0,0 +1,385 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > Platform"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strBack"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); +foreach($config as $key => $val) +{ + if($config[$key][PlatformID] == $platID) + { + $thisconfig=$config[$key]; + break; + } +} + +$tmpconf[PlatNo]=$platID; +$plat=GetPlatInfo($tmpconf,$subSysNo); +if(0) +{ + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; +} +echo "
      {$thisconfig[PlatformName]}_$subSysNo platform information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      Status"; + //platform Status + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      Refresh Time"; + //Refresh Time + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      Start Time"; + //Start Time + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      CPU Usage"; + //CPU Usage PN + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + //CPU Usage Rate + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + +echo "
      Physical Memory"; + //Physical Memory Used/Total + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + echo "(Used/Total)"; + echo "
      "; + + //Physical Memory Used/Swap + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + echo "(Used/Swap)"; + echo "
      "; + + + $id=AssignID(); + echo "Buffers:"; + echo " "; + echo ""; + echo "--"; + echo ""; + + echo "; "; + + $id=AssignID(); + echo "Cached:"; + echo " "; + echo ""; + echo "--"; + echo ""; + + echo "
      "; + +echo "
      Harddisk Space"; + //Harddisk, support 16 harddisk + for($i=0;$i<16;$i++) + { + $id=AssignID(); + if($i==0) + echo ""; + else + echo ""; + + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo "
      "; + + echo "
      "; + + } + +echo "
      "; + +//Remark Table +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "$strBack"; + echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$platID','$subSysNo');\n"; + echo "\n"; +?> diff --git a/wxc2_omc/fault/create/plat_status_detail_update.php b/wxc2_omc/fault/create/plat_status_detail_update.php new file mode 100755 index 0000000..1be8eda --- /dev/null +++ b/wxc2_omc/fault/create/plat_status_detail_update.php @@ -0,0 +1,181 @@ + $val) +{ + if($config[$key][PlatformID] == $platID) + { + $thisconfig=$config[$key]; + break; + } +} + +$sql="select * from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$platID} and subSysNo=$subSysNo "; +//echo "$sql
      "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num == 0) + exit(); + +$tmpconf[PlatNo]=$platID; +$plat=GetPlatInfo($tmpconf,$subSysNo); + + + +//platform Status +$id=AssignID(); +$sql="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$platID} and subSysNo=$subSysNo "; +//echo "$sql
      "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num != 1) +{ + $baseStat=0; +} +else +{ + $row=@mysqli_fetch_array($res); + $baseStat=$row[baseStat]+0; +} +$refresh_time=$row[updateTime]; +$due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); +$ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); +if($refresh_time < $due_date || $refresh_time > $ove_date) +{ + $valid_time=0; +} +else +{ + $valid_time=1; +} +if($valid_time == 0 || $baseStat == 0) + $total_response.="$id,block,N,#ff0000;"; +else + $total_response.="$id,block,Y,#0000ff;"; + +//Refresh Time +$id=AssignID(); +if($valid_time) + $total_response.="$id,block,$refresh_time,#0000ff;"; +else + $total_response.="$id,block,$refresh_time,#ff0000;"; + +//Start Time +$id=AssignID(); +if(trim($plat[StartTime][Value]) == "") + $total_response.="$id,block,--,#000000;"; +else + $total_response.="$id,block,{$plat[StartTime][Value]},#0000ff;"; + + +//CPU Usage PN +$id=AssignID(); +$message="{$id},{$plat[CPURatePN][Display]},{$plat[CPURatePN][Value]},{$plat[CPURatePN][Color]};"; +$total_response.=$message; + +//CPU Usage +$id=AssignID(); +$message="{$id},{$plat[CPURate][Display]},{$plat[CPURate][Value]},{$plat[CPURate][Color]};"; +$total_response.=$message; + +//Physical Memory +$id=AssignID(); +$message="{$id},{$plat[PMTotalRatePN][Display]},{$plat[PMTotalRatePN][Value]},{$plat[PMTotalRatePN][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMTotalRate][Display]},{$plat[PMTotalRate][Value]},{$plat[PMTotalRate][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMTotalRateV][Display]},{$plat[PMTotalRateV][Value]},{$plat[PMTotalRateV][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRatePN][Display]},{$plat[PMSwapRatePN][Value]},{$plat[PMSwapRatePN][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRate][Display]},{$plat[PMSwapRate][Value]},{$plat[PMSwapRate][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRateV][Display]},{$plat[PMSwapRateV][Value]},{$plat[PMSwapRateV][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMBuffers][Display]},{$plat[PMBuffers][Value]},{$plat[PMBuffers][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMCached][Display]},{$plat[PMCached][Value]},{$plat[PMCached][Color]};"; +$total_response.=$message; + +//Harddisk +for($i=0;$i<16;$i++) +{ + if($i<$plat[HDNum]) + { + $id=AssignID(); + $message="{$id},layerShow,no,no;"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][PN][Display]},{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][Rate][Display]},{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][V][Display]},{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][Path][Display]},{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};"; + $total_response.=$message; + } + else + { + $id=AssignID(); + $message="{$id},layerHide,no,no;"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};"; + //$total_response.=$message; + } +} + +echo "$total_response"; +?> diff --git a/wxc2_omc/fault/csuStatus/csuStatus.php b/wxc2_omc/fault/csuStatus/csuStatus.php new file mode 100755 index 0000000..6bd5216 --- /dev/null +++ b/wxc2_omc/fault/csuStatus/csuStatus.php @@ -0,0 +1,763 @@ + + + 0){ + echo ""; +}else{ + echo ""; +} +$DEBUG = 0; +$db = $omc_db; +$dueDate = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +//==test +//echo "heatbeat_overtime:$heatbeat_overtime
      "; +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +//echo "backpage:$backpage
      "; +/******************************8KE1 status*************************/ +$sysTypeNo_1 = 150; +$sysType = "8KE1"; +$sysTypeNo = omc_sys_type2code($sysType); +$sysNo = omc_sys_id_info($sys_id,sys_num); +$subSysNo = omc_sys_id_info($sys_id,subsys_num); +$sysId = $sysType."_".$sysNo."_".$subSysNo; + +$sysTypeNo_2= 112; + +//begin bit +$ver_bgn = 18; //version +$typ_bgn = 21; //subsys type +$ins_bgn = 22; //e1 installed +$inl_bgn = 23; //e1 layer2 installed +$phy_bgn = 24; //e1 layer1(physical layer) +$tra_bgn = 25; //e1 layer2(transport layer) +$can_bgn = 26; //echo canceller status +$cpu_bgn = 27; //cpu loading +$loc_bgn = 28; //lock status +$fre_bgn = 29; //frequency +$pow_bgn = 30; //power card and master clock +$pra_bgn = 31; //E1 FRAMER status +$ch_bgn = 31; +$att_bgn = 39; + +$HWaddr_bgn = 17; + +//subsys type +$arrayType=array( + array('num' => '0', 'remark' => 'SS7', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'ISDN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'PCR', 'color' => '#0000FF') +); + +//e1 install +$arrayIns=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +//e1 layer1 +$arrayPhy=array( + array('num' => '0', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '2', 'remark' => '--', 'color' => '#000000') +); + +//e1 layer2 +$arrayTra=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '2', 'remark' => '--', 'color' => '#000000') +); + +//echo canceller status +$arrayCan=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +//lock status +$arrayLock=array( + array('num' => '0', 'remark' => 'Init', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Search', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Locked', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'Threshold', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'Adjust', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'Hold over', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'Stop At 0ppm', 'color' => '#0000FF'), + array('num' => '7', 'remark' => 'Idle', 'color' => '#0000FF') +); + +//master clock +$arrayMaster=array( + array('num' => '0', 'remark' => 'Slave', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Master', 'color' => '#0000FF') +); +if($clear){ + $delSql = " Delete FROM OMC_PUB.sysStat + WHERE + (sysTypeNo='$sysTypeNo' OR sysTypeNo='$sysTypeNo_1') AND (sysNo='0' OR sysNo='1') + "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $delSql = " Delete FROM OMC_PUB.sysStat + WHERE + sysTypeNo='$sysTypeNo_2' + "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $delSql = " Delete FROM OMC_PUB.sysInfo where sysTypeNo!='500'"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} + + +$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE + (sysTypeNo='$sysTypeNo' OR sysTypeNo='$sysTypeNo_1') AND (sysNo='0' OR sysNo='1') + "; +if($DEBUG) + echo "
      selSql=$selSql"; +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + +do{ + $sysTypeNo = $selRow[sysTypeNo]; + $sysNo = $selRow[sysNo]; + $subSysNo = $selRow[subSysNo]; + $hex_mes = $selRow[detailStat]; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + + if(!$selRow) + break; + + if($selRow) + $showArr[$sysNo][$subSysNo] = 1; + + $refreshTime[$sysNo][$subSysNo][0] = $selRow[updateTime]; + if($refreshTime[$sysNo][$subSysNo][0] > $dueDate){ + $refreshTime[$sysNo][$subSysNo][1] = "#0000FF"; + }else{ + $refreshTime[$sysNo][$subSysNo][1] = "#FF0000"; + $noBasicStatus[$sysNo][$subSysNo]=1; + } + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + + //version + $bin_ver_0=substr($bin_mes,$ver_bgn*8,8); + $dec_ver_0=BinDec($bin_ver_0); + + $bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8); + $dec_ver_1=BinDec($bin_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8); + $dec_ver_2=BinDec($bin_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $versionArr[$sysNo][$subSysNo][0] = $version = $dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + $versionArr[$sysNo][$subSysNo][1] = $color_version = "#0000FF"; + $verNum[$sysNo] = $subSysNo; + //echo "version:$version
      "; + if($DEBUG) echo "
      verNum[$sysNo]=$verNum[$sysNo]"; + if($DEBUG) + echo "
      versionArr[$sysNo][$subSysNo][0]={$versionArr[$sysNo][$subSysNo][0]}"; + + //subsys type + $bin_typ = substr($bin_mes,$typ_bgn*8,8); + $subTypeArr[$sysNo][$subSysNo][0] = $dec_typ = BinDec($bin_typ); + if($DEBUG) echo "
      subTypeArr[$sysNo][$subSysNo][0] = {$subTypeArr[$sysNo][$subSysNo][0]}"; + + //e1 install + for($i=0;$i<8;$i++){ + $bin_ins=substr($bin_mes,$ins_bgn*8+7-$i,1); + $eInstallArr[$sysNo][$subSysNo][$i]=BinDec($bin_ins); + if($DEBUG) + echo "
      eInstallArr[$sysNo][$subSysNo][$i]={$eInstallArr[$sysNo][$subSysNo][$i]}"; + } + + + //e1 layer2 install + for($i=0;$i<8;$i++) + { + $bin_inl=substr($bin_mes,$inl_bgn*8+7-$i,1); + $eL2InsArr[$sysNo][$subSysNo][$i]=BinDec($bin_inl); + if($DEBUG) + echo "
      eL2InsArr[$sysNo][$subSysNo][$i]={$eL2InsArr[$sysNo][$subSysNo][$i]}"; + } + + //e1 layer1 + for($i=0;$i<8;$i++){ + $bin_phy=substr($bin_mes,$phy_bgn*8+7-$i,1); + $eL1StatusArr[$sysNo][$subSysNo][$i] = BinDec($bin_phy); + if($DEBUG) + echo "
      eL1StatusArr[$sysNo][$subSysNo][$i]={$eL1StatusArr[$sysNo][$subSysNo][$i]}"; + if($eInstallArr[$sysNo][$subSysNo][$i] == 0){ + $eL1StatusArr[$sysNo][$subSysNo][$i]=2; + } + + if($eL1StatusArr[$sysNo][$subSysNo][$i] == 1){ + $noBasicStatus[$sysNo][$subSysNo]=1; + } + } + + //e1 layer2 + for($i=0;$i<8;$i++) { + $bin_tra=substr($bin_mes,$tra_bgn*8+7-$i,1); + $eL2StatusArr[$sysNo][$subSysNo][$i]=BinDec($bin_tra); + if($eInstallArr[$sysNo][$subSysNo][$i] == 0 || $eL2InsArr[$sysNo][$subSysNo][$i] == 0){ + $eL2StatusArr[$sysNo][$subSysNo][$i]=2; + } + if($DEBUG) + echo "
      eL2StatusArr[$sysNo][$subSysNo][$i]={$eL2StatusArr[$sysNo][$subSysNo][$i]}"; + if($eL2StatusArr[$sysNo][$subSysNo][$i] == 0){ + $noBasicStatus[$sysNo][$subSysNo]=1; + } + + } + + //echo canceller status + for($i=0;$i<8;$i++){ + $bin_can=substr($bin_mes,$can_bgn*8+7-$i,1); + $canStatusArr[$sysNo][$subSysNo][$i]=BinDec($bin_can); + if($eInstallArr[$sysNo][$subSysNo][$i] == 0){ + $canStatusArr[$sysNo][$subSysNo][$i] = 0; + } + if($DEBUG) echo "
      canStatusArr[$sysNo][$subSysNo][$i]={$canStatusArr[$sysNo][$subSysNo][$i]}"; + } + + //cpu loading + $bin_cpu=substr($bin_mes,$cpu_bgn*8,8); + $dec_cpu=BinDec($bin_cpu); + if($DEBUG) echo "
      dec_cpu=$dec_cpu"; + + $cpu_load=change2point($dec_cpu/126); + if($cpu_load>100){ + $cpu_load=100; + } + elseif($cpu_load<0){ + $cpu_load=0; + } + if($DEBUG) echo "
      cpu_load=$cpu_load"; + + if($cpu_load>90){ + $noBasicStatus[$sysNo][$subSysNo] = 1; + $cpuLoadArr[$sysNo][$subSysNo][1] = "#FF0000"; + }else{ + $cpuLoadArr[$sysNo][$subSysNo][1] = "#0000FF"; + } + $cpuLoadArr[$sysNo][$subSysNo][0] = $cpu_load."%"; + $bin_loc = substr($bin_mes,$loc_bgn*8,8); + $lockStatusArr[$sysNo][$subSysNo] = BinDec($bin_loc); + if($DEBUG) echo "
      lockStatusArr[$sysNo][$subSysNo]={$lockStatusArr[$sysNo][$subSysNo]}"; + + //frequency + $bin_fre=substr($bin_mes,$fre_bgn*8,8); + $dec_fre=BinDec($bin_fre); + $freqArr[$sysNo][$subSysNo][0] = omc_keep_length($dec_fre,0,3); + if($dec_loc==7){ + $freqArr[$sysNo][$subSysNo][0] = '--'; + $freqArr[$sysNo][$subSysNo][1] = "#000000"; + }else{ + $freqArr[$sysNo][$subSysNo][1] = "#0000FF"; + } + if($DEBUG) echo "
      freqArr[$sysNo][$subSysNo][0]={$freqArr[$sysNo][$subSysNo][0]}"; + + //master clock + //echo "bin_mes:$bin_mes
      "; + $bin_mas = substr($bin_mes,$pow_bgn*8+7,1); + $masClockArr[$sysNo][$subSysNo] = BinDec($bin_mas); + if($DEBUG) echo "
      masClockArr[$sysNo][$subSysNo]=$masClockArr[$sysNo][$subSysNo]"; + + if($sysTypeNo == '150') + { + $pcrcArr[$sysNo][$subSysNo] = 1; + + $chNum = $subSysNo*8; + for($i=0;$i<8;$i++) + { + $chArr[$sysNo][$chNum+$i] = HexDec(substr($hex_mes,($ch_bgn+$i)*2,2)); + if($DEBUG) echo "
      chArr[$sysNo][$chNum+$i]={$chArr[$sysNo][$chNum+$i]}"; + $attArr[$sysNo][$chNum+$i] = HexDec(substr($hex_mes,($att_bgn+$i)*2,2)); + if($DEBUG) echo "
      attArr[$sysNo][$chNum+$i]={$attArr[$sysNo][$chNum+$i]}"; + } + } + +}while($selRow = @mysqli_fetch_array($selRes)); + +$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE + sysTypeNo='$sysTypeNo_2' + "; +if($DEBUG) + echo "
      selSql=$selSql"; +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + +do{ + $sysTypeNo = $selRow[sysTypeNo]; + $sysNo = $selRow[sysNo]; + $subSysNo = $selRow[subSysNo]; + $hex_mes = $selRow[detailStat]; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + + if(!$selRow) + break; + + if($selRow) + $HWaddrArr[$sysNo][$subSysNo] = substr($hex_mes,$HWaddr_bgn*2,12); +}while($selRow = @mysqli_fetch_array($selRes)); + + +/******************************MSC status*************************/ +$sysType = $DEFAULT_SYS; +$sysTypeNo = omc_sys_type2code($sysType); +$sysNo = omc_sys_id_info($sysId,sys_num); +$subSysNo = omc_sys_id_info($sysId,subsys_num); +$sysId = $sysType."_".$sysNo."_".$subSysNo; + +$array_main_server_status=array( + array('num'=> '0','remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1','remark' => $strRestart, 'color' => '#0000FF'), + array('num'=> '2','remark' => $strInitialize, 'color' => '#0000FF'), + array('num'=> '3','remark' => $strSuspend, 'color' => '#0000FF'), + array('num'=> '4','remark' => $strStop, 'color' => '#FF0000') +); + +//E1 status +$arrayDefineStatus=array( + array('num'=> '0','remark' => 'TUP', 'color' => '#0000FF'), + array('num'=> '1','remark' => 'ISUP', 'color' => '#0000FF'), + array('num'=> '2','remark' => 'AIF', 'color' => '#0000FF'), + array('num'=> '3','remark' => 'ISDN NT', 'color' => '#0000FF'), + array('num'=> '4','remark' => 'ISDN LT', 'color' => '#0000FF'), + array('num'=> '5','remark' => 'CI-CNF', 'color' => '#0000FF'), + array('num'=> '6','remark' => 'CI-INT', 'color' => '#0000FF'), + array('num'=> '7','remark' => '--', 'color' => '#FF0000') +); + +//begin bit +$msc_bgn_byt=19; +if($DEBUG)echo "
      msc_len_dec=$msc_len_dec"; + +$selSql = " SELECT sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE + sysTypeNo='$sysTypeNo' AND (sysNo='0' OR sysNo='1') + "; +if($DEBUG) + echo "
      selSql=$selSql"; +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + +do +{ + $sysNo = $selRow[sysNo]; + $subSysNo = $selRow[subSysNo]; + $hex_mes = $selRow[detailStat]; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + + if(!$selRow) + break; + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + + //Field01(3bytes,18-20):Version Information + $version_0=substr($hex_mes,($msc_bgn_byt+1)*2,2); + + $version_1=substr($hex_mes,($msc_bgn_byt+2)*2,2); + $version_1=omc_keep_length($version_1,0,2); + + $version_2=substr($hex_mes,($msc_bgn_byt+3)*2,2); + $version_2=omc_keep_length($version_2,0,2); + + $mscVersionArr[$sysNo][$subSysNo]=$version_0.".".$version_1.".".$version_2; + if($DEBUG) + echo "
      mscVersionArr[$sysNo][$subSysNo]={$mscVersionArr[$sysNo][$subSysNo]}"; + + + //main server status(0/1/2/3/4=normal/restart/initialize/suspend/stop) + $hex_main_server_status=substr($hex_mes,($msc_bgn_byt+4)*2,2); + $serStatArr[$sysNo][$subSysNo] = HexDec($hex_main_server_status); + if($DEBUG)echo "
      serStatArr[$sysNo][$subSysNo]={$serStatArr[$sysNo][$subSysNo]}"; + + + for($i=0;$i<128;$i++) + { + if($DEBUG)echo "
      i=$i"; + $BinStatus=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8,3); + $DecStatus=BinDec($BinStatus); + if($DEBUG)echo "
      DecStatus=$DecStatus"; + + $BinAttribute=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8+3,5); + $DecAttribute=BinDec($BinAttribute); + if($DEBUG)echo "
      DecAttribute=$DecAttribute"; + + $arrayDefineE1[$sysNo][$subSysNo][$i][0]=$arrayDefineStatus[$DecStatus][remark]; + $arrayDefineE1[$sysNo][$subSysNo][$i][1]=$arrayDefineStatus[$DecStatus][color]; + if($arrayDefineE1[$sysNo][$subSysNo][$i][0]=='--'){ + $arrayDefineE1[$sysNo][$subSysNo][$i][2]='--'; + $arrayDefineE1[$sysNo][$subSysNo][$i][3]='#000000'; + }else{ + $arrayDefineE1[$sysNo][$subSysNo][$i][2]=$DecAttribute; + $arrayDefineE1[$sysNo][$subSysNo][$i][3]='#0000FF'; + } + if($DEBUG) echo "
      arrayDefineE1[$sysNo][$subSysNo][$i][0]={$arrayDefineE1[$sysNo][$subSysNo][$i][0]}"; + if($DEBUG) echo "
      arrayDefineE1[$sysNo][$subSysNo][$i][2]={$arrayDefineE1[$sysNo][$subSysNo][$i][2]}"; + } + +}while($selRow = @mysqli_fetch_array($selRes)); + + +?> + +"; +echo ""; +echo ""; +if($backpage=='overview') + echo "Configuration > Network > $strServer"; +else + echo "$strSysStatus > $strCentralOffice > MSC-CSC"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo ""; +if($backpage=='overview') + echo "

      $strBack"; +else + echo "

      $strBack"; +echo "     "; +echo "$strClear"; + +echo "

      "; +echo "
      "; + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + // + echo ""; + // + echo ""; + + // + echo ""; + + // + echo ""; + echo ""; + // + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + // + echo ""; + // + echo ""; + + // + echo ""; + + // + echo ""; + echo ""; + // +echo "

      CSC0-8K E1/T1 Card $strStatusInfo

       

      CSC1-8K E1/T1 Card $strStatusInfo

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<16;$i++) + { + $showId = omc_keep_length($i,0,2); + echo ""; + if($showArr[0][$i]){ + echo ""; + + echo ""; + + echo ""; + + echo ""; + + if($HWaddrArr[0][$i]) + echo ""; + else + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + } + echo "
      ID$strBasicStatus$strRefreshTimeClock/SyncVersionHWaddr
      $showId"; + if($noBasicStatus[0][$i]) + echo "N"; + else + echo "Y"; + echo ""; + if($showArr[0][$i]) + echo "{$refreshTime[0][$i][0]}"; + echo ""; + echo "{$arrayMaster[$masClockArr[0][$i]][remark]}/{$arrayLock[$lockStatusArr[0][$i]][remark]}"; + echo ""; + echo "{$versionArr[0][$i][0]}"; + echo "{$HWaddrArr[0][$i][0]}{$HWaddrArr[0][$i][1]}:{$HWaddrArr[0][$i][2]}{$HWaddrArr[0][$i][3]}:{$HWaddrArr[0][$i][4]}{$HWaddrArr[0][$i][5]}:{$HWaddrArr[0][$i][6]}{$HWaddrArr[0][$i][7]}:{$HWaddrArr[0][$i][8]}{$HWaddrArr[0][$i][9]}:{$HWaddrArr[0][$i][10]}{$HWaddrArr[0][$i][11]}------------
      "; + echo "
       "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<16;$i++) + { + $showId = omc_keep_length($i,0,2); + echo ""; + if($showArr[1][$i]){ + echo ""; + + echo ""; + + echo ""; + + echo ""; + + if($HWaddrArr[1][$i]) + echo ""; + else + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + } + echo "
      ID$strBasicStatus$strRefreshTimeClock/SyncVersionHWaddr
      $showId"; + if($noBasicStatus[1][$i]) + echo "N"; + else + echo "Y"; + echo ""; + if($showArr[1][$i]) + echo "{$refreshTime[1][$i][0]}"; + echo ""; + echo ""; + echo "{$arrayMaster[$masClockArr[1][$i]][remark]}/{$arrayLock[$lockStatusArr[1][$i]][remark]}"; + echo ""; + echo "{$versionArr[1][$i][0]}"; + echo "{$HWaddrArr[1][$i][0]}{$HWaddrArr[1][$i][1]}:{$HWaddrArr[1][$i][2]}{$HWaddrArr[1][$i][3]}:{$HWaddrArr[1][$i][4]}{$HWaddrArr[1][$i][5]}:{$HWaddrArr[1][$i][6]}{$HWaddrArr[1][$i][7]}:{$HWaddrArr[1][$i][8]}{$HWaddrArr[1][$i][9]}:{$HWaddrArr[1][$i][10]}{$HWaddrArr[1][$i][11]}------------
      "; + echo "

      $strPane0Status

       

      $strPane1Status

      "; + echo ""; + for($i=0;$i<128;$i++) + { + if($i % 8 == 0) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + $slotNum = floor($i/8); + $portNum = $i%8; + echo ""; + echo ""; + echo ""; + if($showArr[0][$slotNum]){ + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + if(strlen($chArr[0][$i]) > 0) + echo ""; + elseif(isset($arrayDefineE1[0][0][$i][2])) + echo ""; + else + echo ""; + + if($attArr[0][$i] < 7 && strlen($attArr[0][$i]) > 0) + echo ""; + elseif(isset($arrayDefineE1[0][0][$i][0])) + echo ""; + else + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + } + echo "
      SlotPortENL1L2ECCHTY
      $slotNum$portNum{$arrayIns[$eInstallArr[0][$slotNum][$portNum]][remark]}{$arrayPhy[$eL1StatusArr[0][$slotNum][$portNum]][remark]}{$arrayTra[$eL2StatusArr[0][$slotNum][$portNum]][remark]}{$arrayCan[$canStatusArr[0][$slotNum][$portNum]][remark]}--{$chArr[0][$i]}{$arrayDefineE1[0][0][$i][2]}--{$arrayDefineStatus[$attArr[0][$i]][remark]}{$arrayDefineE1[0][0][$i][0]}--------------
      "; + echo "
      "; + echo ""; + for($i=0;$i<128;$i++){ + if($i % 8 == 0){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + $slotNum = floor($i/8); + $portNum = $i%8; + echo ""; + echo ""; + echo ""; + if($showArr[1][$slotNum]){ + echo ""; + echo ""; + echo ""; + echo ""; + if(strlen($chArr[1][$i]) > 0) + echo ""; + elseif(isset($arrayDefineE1[1][0][$i][2])) + echo ""; + else + echo ""; + + if($attArr[1][$i] < 7 && strlen($attArr[1][$i]) > 0 ) + echo ""; + elseif(isset($arrayDefineE1[1][0][$i][0])) + echo ""; + else + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + + } + echo "
      SlotPortENL1L2ECCHTY
      $slotNum$portNum{$arrayIns[$eInstallArr[1][$slotNum][$portNum]][remark]}{$arrayPhy[$eL1StatusArr[1][$slotNum][$portNum]][remark]}{$arrayTra[$eL2StatusArr[1][$slotNum][$portNum]][remark]}{$arrayCan[$canStatusArr[1][$slotNum][$portNum]][remark]}{$chArr[1][$i]}{$arrayDefineE1[1][0][$i][2]}--{$arrayDefineStatus[$attArr[1][$i]][remark]}{$arrayDefineE1[1][0][$i][0]}--------------
      "; + echo "
      "; + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "

      $strRemark:  "; + echo "Y = $strNormal,    "; + echo "N = $strAbnormal,   -- = $strNothing."; + echo "

      "; + echo "

      "; + echo "$strBack"; + echo "     "; + echo ""; + echo "$strClear"; + echo "

      "; + echo "
      "; +echo " + + diff --git a/wxc2_omc/fault/csuStatus/csuStatus_deal.php b/wxc2_omc/fault/csuStatus/csuStatus_deal.php new file mode 100755 index 0000000..3ba54d7 --- /dev/null +++ b/wxc2_omc/fault/csuStatus/csuStatus_deal.php @@ -0,0 +1,611 @@ + + + + + +"; +echo "
      "; +echo ""; +echo "
      "; +echo ""; +//================================data define=============================================== +//$card_status[platNo][cardNo] due to: refresh time,Layer1,Layer2,cpuLoad,0-normal 1-abnormal +//$card_refreshTime[platNo][cardNo] +//$card_clock[platNo][cardNo] +//$card_sync[platNo][cardNo] +//$card_version[platNo][cardNo] +//$card_HWaddr[platNo][cardNo] +//$card_type[platNo][cardNo] +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + $card_status[$i][$j]="--"; + $card_refreshTime[$i][$j]="--"; + $card_refreshTime_full[$i][$j]="--"; + $card_clock[$i][$j]="--"; + $card_sync[$i][$j]="--"; + $card_version[$i][$j]="--"; + $card_HWaddr[$i][$j]="--"; + $card_type[$i][$j]="--"; + } +} +//$port_e1Install[platNo][cardNo][portNo] port enable or disable +//$port_layer1[platNo][cardNo][portNo] +//$port_layer2[platNo][cardNo][portNo] +//$port_echoCanceller[platNo][cardNo][portNo] +//$port_channel[platNo][cardNo][portNo] +//$port_type[platNo][cardNo][portNo] +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + for($k=0;$k<8;$k++) + { + + $port_layer1[$i][$j][$k]="--"; + $port_layer2[$i][$j][$k]="--"; + $port_echoCanceller[$i][$j][$k]="--"; + $port_channel[$i][$j][$k]="--"; + $port_type[$i][$j][$k]="--"; + + $port_e1Install[$i][$j][$k]="--"; + $port_e1L2Install[$i][$j][$k]="--"; + } + } +} + + +//===============================initial================================================== +$database=$omc_db; +$table_name="sysStat"; +$dueDate = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); +//echo "heatbeat_overtime:$heatbeat_overtime
      "; +//echo "$database--$table_name--$dueDate
      "; +//begin bit +$ver_bgn = 18; //version +$typ_bgn = 21; //subsys type +$ins_bgn = 22; //e1 installed +$inl_bgn = 23; //e1 layer2 installed +$phy_bgn = 24; //e1 layer1(physical layer) +$tra_bgn = 25; //e1 layer2(transport layer) +$can_bgn = 26; //echo canceller status +$cpu_bgn = 27; //cpu loading +$loc_bgn = 28; //lock status +$fre_bgn = 29; //frequency +$pow_bgn = 30; //power card and master clock +$pra_bgn = 31; //E1 FRAMER status +$ch_bgn = 31; +$att_bgn = 39; + +$HWaddr_bgn = 17; +$msc_bgn_byt=19; + +//========================Get the data from database sysTypeNo=111============================ + +$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE sysTypeNo=111 AND (sysNo='0' OR sysNo='1')"; + +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + +do{ + //If there is not any card,then break + if(!$selRow) + break; + $platNo = $selRow[sysNo]; + $cardNo = $selRow[subSysNo]; + $hex_mes = $selRow[detailStat]; + $bin_mes=''; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + for($i=0;$ibin_mes=$bin_mes"; + //=============card status=============== + $card_status[$platNo][$cardNo] = 0; + //==============card refresh time============== + $card_refreshTime[$platNo][$cardNo]=$selRow[updateTime]; + $card_refreshTime_full[$platNo][$cardNo]=$selRow[updateTime]; + if($card_refreshTime[$platNo][$cardNo] <= $dueDate) + { + $card_status[$platNo][$cardNo]=1; + } + + + //================version=============== + $bin_ver_0=substr($bin_mes,$ver_bgn*8,8); + $dec_ver_0=BinDec($bin_ver_0); + + $bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8); + $dec_ver_1=BinDec($bin_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8); + $dec_ver_2=BinDec($bin_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $card_version[$platNo][$cardNo]= $dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + + + + //===============card type================== + $bin_typ = substr($bin_mes,$typ_bgn*8,8); + $card_type[$platNo][$cardNo]= BinDec($bin_typ); + + //==================e1 install=============== + for($i=0;$i<8;$i++){ + $bin_ins=substr($bin_mes,$ins_bgn*8+7-$i,1); + $port_e1Install[$platNo][$cardNo][$i]=BinDec($bin_ins); + } + + + //==============e1 layer2 install============== + for($i=0;$i<8;$i++) + { + $bin_inl=substr($bin_mes,$inl_bgn*8+7-$i,1); + $port_e1L2Install[$platNo][$cardNo][$i]=BinDec($bin_inl); + } + + //================e1 layer1============= + for($i=0;$i<8;$i++){ + $bin_phy=substr($bin_mes,$phy_bgn*8+7-$i,1); + $port_layer1[$platNo][$cardNo][$i] = BinDec($bin_phy); + + if($port_e1Install[$platNo][$cardNo][$i] == 0){ + $port_layer1[$platNo][$cardNo][$i]=2; + } + + if($port_layer1[$platNo][$cardNo][$i] == 1){ + $card_status[$platNo][$cardNo]=1; + } + } + + //=============e1 layer2================ + for($i=0;$i<8;$i++) { + $bin_tra=substr($bin_mes,$tra_bgn*8+7-$i,1); + $port_layer2[$platNo][$cardNo][$i]=BinDec($bin_tra); + if($port_e1Install[$platNo][$cardNo][$i] == 0 || $port_e1L2Install[$platNo][$cardNo][$i] == 0){ + $port_layer2[$platNo][$cardNo][$i]=2; + } + if($port_layer2[$platNo][$cardNo][$i] == 0){ + $card_status[$platNo][$cardNo]=1; + } + } + + //===========echo canceller status========= + for($i=0;$i<8;$i++){ + $bin_can=substr($bin_mes,$can_bgn*8+7-$i,1); + $port_echoCanceller[$platNo][$cardNo][$i]=BinDec($bin_can); + if($port_e1Install[$platNo][$cardNo][$i] == 0){ + $port_echoCanceller[$platNo][$cardNo][$i] = 0; + } + } + + //============cpu loading=============== + $bin_cpu=substr($bin_mes,$cpu_bgn*8,8); + $dec_cpu=BinDec($bin_cpu); + if($DEBUG) echo "
      dec_cpu=$dec_cpu"; + + $cpu_load=change2point($dec_cpu/126); + if($cpu_load>100){ + $cpu_load=100; + } + elseif($cpu_load<0){ + $cpu_load=0; + } + if($DEBUG) echo "
      cpu_load=$cpu_load"; + if($cpu_load>90){ + $card_status[$platNo][$cardNo] = 1; + } + + //===========card sync================ + $bin_loc = substr($bin_mes,$loc_bgn*8,8); + $card_sync[$platNo][$cardNo] = BinDec($bin_loc); + + //===========master clock============= + $bin_mas = substr($bin_mes,$pow_bgn*8+7,1); + $card_clock[$platNo][$cardNo] = BinDec($bin_mas); + +}while($selRow = @mysqli_fetch_array($selRes)); + + + +//==========================Get the data from database sysTypeNo=112========================= +$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE sysTypeNo=112"; +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + +do{ + if(!$selRow) + break; + $platNo = $selRow[sysNo]; + $cardNo = $selRow[subSysNo]; + $hex_mes = $selRow[detailStat]; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + + $card_HWaddr[$platNo][$cardNo] = substr($hex_mes,$HWaddr_bgn*2,12); +}while($selRow = @mysqli_fetch_array($selRes)); + + + +//===========================Get the data from database sysTypeNo=320======================= + + +$selSql = " SELECT sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE sysTypeNo=320 AND (sysNo='0' OR sysNo='1')"; +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + + +do +{ + if(!$selRow) + break; + $platNo = $selRow[sysNo]; + $hex_mes = $selRow[detailStat]; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + + + for($i=0;$i<128;$i++) + { + $cardNo = floor($i/8); + $portNo=$i%8; + //=================port type======================== + if($DEBUG)echo "
      i=$i"; + $BinStatus=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8,3); + $DecStatus=BinDec($BinStatus); + if($DEBUG)echo "
      DecStatus=$DecStatus"; + $port_type[$platNo][$cardNo][$portNo]=$DecStatus; + //===============port channel====================== + $BinAttribute=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8+3,5); + $DecAttribute=BinDec($BinAttribute); + if($DEBUG) + echo "
      DecAttribute=$DecAttribute"; + if($port_e1Install[$platNo][$cardNo][$portNo]=="--") + { + $port_channel[$platNo][$cardNo][$portNo]="--"; + } + else + $port_channel[$platNo][$cardNo][$portNo]=$DecAttribute; + + } + +}while($selRow = @mysqli_fetch_array($selRes)); + +//==============================format the data====================================== + +$card_status_format=array(0=>"Y",1=>"N","--"=>"--"); +$card_clock_format=array(0=>"Slave",1=>"Master","--"=>"--"); +$card_sync_format=array(0=>"Init",1=>"Search",2=>"Locked",3=>"Threshold",4=>"Adjust",5=>"HoldOver",6=>"StopAtOppm",7=>"Idle","--"=>"--"); +$card_type_format=array(0=>"E1",1=>"T1","--"=>"--"); +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + $card_status[$i][$j]=$card_status_format[$card_status[$i][$j]]; + $card_clock[$i][$j]=$card_clock_format[$card_clock[$i][$j]]; + $card_sync[$i][$j]=$card_sync_format[$card_sync[$i][$j]]; + + if(strlen($card_refreshTime[$i][$j])>5) + $card_refreshTime[$i][$j]=substr($card_refreshTime[$i][$j],11,8); + + if(strlen($card_refreshTime[$i][$j])<3) + { + $card_HWaddr[$i][$j]="--"; + } + else + { + if(strlen($card_HWaddr[$i][$j])>5) + { + $temp=""; + for($z=0;$z<5;$z++) + { + $temp.=substr($card_HWaddr[$i][$j],$z*2,2); + $temp.=":"; + } + $temp.=substr($card_HWaddr[$i][$j],10,2); + $card_HWaddr[$i][$j]=$temp; + + } + } + $card_type[$i][$j]=$card_type_format[$card_type[$i][$j]]; + } +} + + +$port_enable_format=array(0=>"--",1=>"Y","--"=>"--"); +$port_layer1_format=array(0=>"Y",1=>"N",2=>"--","--"=>"--"); +$port_layer2_format=array(0=>"N",1=>"Y",2=>"--","--"=>"--"); +$port_echoCanceller_format=array(0=>"--",1=>"Y","--"=>"--"); +$port_type_format=array(0=>"TUP",1=>"ISUP",2=>"AIF",3=>"ISDN-NT",4=>"ISDN-LT",5=>"CI-CNF",6=>"CI-INT",7=>"--","--"=>"--"); +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + for($k=0;$k<8;$k++) + { + if($card_status[$i][$j] == "--") + { + $port_e1Install[$i][$j][$k]="--"; + $port_layer1[$i][$j][$k]="--"; + $port_layer2[$i][$j][$k]="--"; + $port_echoCanceller[$i][$j][$k]="--"; + $port_type[$i][$j][$k]="--"; + } + else + { + $port_e1Install[$i][$j][$k]=$port_enable_format[$port_e1Install[$i][$j][$k]]; + $port_layer1[$i][$j][$k]=$port_layer1_format[$port_layer1[$i][$j][$k]]; + $port_layer2[$i][$j][$k]=$port_layer2_format[$port_layer2[$i][$j][$k]]; + $port_echoCanceller[$i][$j][$k]=$port_echoCanceller_format[$port_echoCanceller[$i][$j][$k]]; + $port_type[$i][$j][$k]=$port_type_format[$port_type[$i][$j][$k]]; + } + } + } +} + +//==========================test the data=================================================== +/* +echo "==================card attribute=================
      "; +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + echo "CSC-$i-Card-$j-status:{$card_status[$i][$j]}
      "; + echo "CSC-$i-Card-$j-refreshTime:{$card_refreshTime[$i][$j]}
      "; + echo "CSC-$i-Card-$j-clock:{$card_clock[$i][$j]}
      "; + echo "CSC-$i-Card-$j-sync:{$card_sync[$i][$j]}
      "; + echo "CSC-$i-Card-$j-version:{$card_version[$i][$j]}
      "; + echo "CSC-$i-Card-$j-HWaddr:{$card_HWaddr[$i][$j]}
      "; + echo "CSC-$i-Card-$j-type:{$card_type[$i][$j]}
      "; + } +} + +echo "==================port attribute=================
      "; +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + for($k=0;$k<8;$k++) + { + + //echo "CSC-$i-Card-$j-Port-$k-enable:{$port_e1Install[$i][$j][$k]}
      "; + //echo "CSC-$i-Card-$j-Port-$k-layer1:{$port_layer1[$i][$j][$k]}
      "; + //echo "CSC-$i-Card-$j-Port-$k-layer2:{$port_layer2[$i][$j][$k]}
      "; + //echo "CSC-$i-Card-$j-Port-$k-echoCanceller:{$port_echoCanceller[$i][$j][$k]}
      "; + echo "CSC-$i-Card-$j-Port-$k-channel:{$port_channel[$i][$j][$k]}
      "; + //echo "CSC-$i-Card-$j-Port-$k-type:{$port_type[$i][$j][$k]}
      "; + + //$port_e1Install[$i][$j][$k]="--"; + //$port_e1L2Install[$i][$j][$k]="--"; + } + } +} +*/ + + +//=========================send the data to csuStatus_show page============================== + +echo ""; +?> + \ No newline at end of file diff --git a/wxc2_omc/fault/csuStatus/csuStatus_frame.php b/wxc2_omc/fault/csuStatus/csuStatus_frame.php new file mode 100755 index 0000000..f7518ce --- /dev/null +++ b/wxc2_omc/fault/csuStatus/csuStatus_frame.php @@ -0,0 +1,18 @@ + + + +"; + echo ""; +?> + + <body> + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + </body> + + + + + \ No newline at end of file diff --git a/wxc2_omc/fault/csuStatus/csuStatus_show.php b/wxc2_omc/fault/csuStatus/csuStatus_show.php new file mode 100755 index 0000000..cf0dc10 --- /dev/null +++ b/wxc2_omc/fault/csuStatus/csuStatus_show.php @@ -0,0 +1,882 @@ + + + + + +"; +//begin bit +$ver_bgn = 18; //version +$typ_bgn = 21; //subsys type +$ins_bgn = 22; //e1 installed +$inl_bgn = 23; //e1 layer2 installed +$phy_bgn = 24; //e1 layer1(physical layer) +$tra_bgn = 25; //e1 layer2(transport layer) +$can_bgn = 26; //echo canceller status +$cpu_bgn = 27; //cpu loading +$loc_bgn = 28; //lock status +$fre_bgn = 29; //frequency +$pow_bgn = 30; //power card and master clock +$pra_bgn = 31; //E1 FRAMER status +$ch_bgn = 31; +$att_bgn = 39; + +$HWaddr_bgn = 17; +$msc_bgn_byt=19; + +//========================Get the data from database sysTypeNo=111============================ + +$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE sysTypeNo=111 AND (sysNo='0' OR sysNo='1')"; + +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + +do{ + //If there is not any card,then break + if(!$selRow) + break; + + $platNo = $selRow[sysNo]; + $cardNo = $selRow[subSysNo]; + $hex_mes = $selRow[detailStat]; + $bin_mes=''; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + for($i=0;$ibin_mes=$bin_mes"; + //=============card status=============== + $card_status[$platNo][$cardNo] = 0; + //==============card refresh time============== + $card_refreshTime[$platNo][$cardNo]=$selRow[updateTime]; + $card_refreshTime_full[$platNo][$cardNo]=$selRow[updateTime]; + + + if($card_refreshTime[$platNo][$cardNo] <= $dueDate) + { + $card_status[$platNo][$cardNo]=1; + } + + + //================version=============== + $bin_ver_0=substr($bin_mes,$ver_bgn*8,8); + $dec_ver_0=BinDec($bin_ver_0); + + $bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8); + $dec_ver_1=BinDec($bin_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8); + $dec_ver_2=BinDec($bin_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $card_version[$platNo][$cardNo]= $dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + + + + //===============card type================== + $bin_typ = substr($bin_mes,$typ_bgn*8,8); + $card_type[$platNo][$cardNo]= BinDec($bin_typ); + + //==================e1 install=============== + for($i=0;$i<8;$i++){ + $bin_ins=substr($bin_mes,$ins_bgn*8+7-$i,1); + $port_e1Install[$platNo][$cardNo][$i]=BinDec($bin_ins); + + + } + + + //==============e1 layer2 install============== + for($i=0;$i<8;$i++) + { + $bin_inl=substr($bin_mes,$inl_bgn*8+7-$i,1); + $port_e1L2Install[$platNo][$cardNo][$i]=BinDec($bin_inl); + } + + //================e1 layer1============= + for($i=0;$i<8;$i++){ + $bin_phy=substr($bin_mes,$phy_bgn*8+7-$i,1); + $port_layer1[$platNo][$cardNo][$i] = BinDec($bin_phy); + + if($port_e1Install[$platNo][$cardNo][$i] == 0){ + $port_layer1[$platNo][$cardNo][$i]=2; + } + + + if($port_layer1[$platNo][$cardNo][$i] == 1){ + $card_status[$platNo][$cardNo]=1; + } + } + + //=============e1 layer2================ + for($i=0;$i<8;$i++) { + $bin_tra=substr($bin_mes,$tra_bgn*8+7-$i,1); + $port_layer2[$platNo][$cardNo][$i]=BinDec($bin_tra); + if($port_e1Install[$platNo][$cardNo][$i] == 0 || $port_e1L2Install[$platNo][$cardNo][$i] == 0){ + $port_layer2[$platNo][$cardNo][$i]=2; + } + if($port_layer2[$platNo][$cardNo][$i] == 0){ + $card_status[$platNo][$cardNo]=1; + } + } + + //===========echo canceller status========= + for($i=0;$i<8;$i++){ + $bin_can=substr($bin_mes,$can_bgn*8+7-$i,1); + $port_echoCanceller[$platNo][$cardNo][$i]=BinDec($bin_can); + if($port_e1Install[$platNo][$cardNo][$i] == 0){ + $port_echoCanceller[$platNo][$cardNo][$i] = 0; + } + } + + //============cpu loading=============== + $bin_cpu=substr($bin_mes,$cpu_bgn*8,8); + $dec_cpu=BinDec($bin_cpu); + if($DEBUG) echo "
      dec_cpu=$dec_cpu"; + + $cpu_load=change2point($dec_cpu/126); + if($cpu_load>100){ + $cpu_load=100; + } + elseif($cpu_load<0){ + $cpu_load=0; + } + if($DEBUG) + echo "
      cpu_load=$cpu_load"; + if($cpu_load>90){ + $card_status[$platNo][$cardNo] = 1; + } + + //===========card sync================ + $bin_loc = substr($bin_mes,$loc_bgn*8,8); + $card_sync[$platNo][$cardNo] = BinDec($bin_loc); + + //===========master clock============= + $bin_mas = substr($bin_mes,$pow_bgn*8+7,1); + $card_clock[$platNo][$cardNo] = BinDec($bin_mas); + +}while($selRow = @mysqli_fetch_array($selRes)); + + + +//==========================Get the data from database sysTypeNo=112========================= +$selSql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE sysTypeNo=112"; +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + +do{ + if(!$selRow) + break; + $platNo = $selRow[sysNo]; + $cardNo = $selRow[subSysNo]; + $hex_mes = $selRow[detailStat]; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + + $card_HWaddr[$platNo][$cardNo] = substr($hex_mes,$HWaddr_bgn*2,12); +}while($selRow = @mysqli_fetch_array($selRes)); + + + +//===========================Get the data from database sysTypeNo=320======================= + + +$selSql = " SELECT sysNo,subSysNo,detailStat,updateTime FROM OMC_PUB.sysStat + WHERE sysTypeNo=320 AND (sysNo='0' OR sysNo='1')"; +$selRes = @mysqli_query($pubConn,$selSql); +$selRow = @mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + + +do +{ + if(!$selRow) + break; + $platNo = $selRow[sysNo]; + $hex_mes = $selRow[detailStat]; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + + + for($i=0;$i<128;$i++) + { + $cardNo = floor($i/8); + $portNo=$i%8; + //=================port type======================== + if($DEBUG)echo "
      i=$i"; + $BinStatus=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8,3); + $DecStatus=BinDec($BinStatus); + if($DEBUG)echo "
      DecStatus=$DecStatus"; + $port_type[$platNo][$cardNo][$portNo]=$DecStatus; + //===============port channel====================== + $BinAttribute=substr($bin_mes,($msc_bgn_byt+24)*8+$i*8+3,5); + $DecAttribute=BinDec($BinAttribute); + if($DEBUG) + echo "
      DecAttribute=$DecAttribute"; + + if($port_e1Install[$platNo][$cardNo][$portNo]=="--") + { + $port_channel[$platNo][$cardNo][$portNo]="--"; + } + else + $port_channel[$platNo][$cardNo][$portNo]=$DecAttribute; + + } + +}while($selRow = @mysqli_fetch_array($selRes)); + +//==============================format the data====================================== +$card_status_format=array(0=>"Y",1=>"N","--"=>"--"); +$card_clock_format=array(0=>"Slave",1=>"Master","--"=>"--"); +$card_sync_format=array(0=>"Init",1=>"Search",2=>"Locked",3=>"Threshold",4=>"Adjust",5=>"HoldOver",6=>"StopAtOppm",7=>"Idle","--"=>"--"); +$card_type_format=array(0=>"E1",1=>"T1","--"=>"--"); +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + $card_status[$i][$j]=$card_status_format[$card_status[$i][$j]]; + $card_clock[$i][$j]=$card_clock_format[$card_clock[$i][$j]]; + $card_sync[$i][$j]=$card_sync_format[$card_sync[$i][$j]]; + + if(strlen($card_refreshTime[$i][$j])>5) + $card_refreshTime[$i][$j]=substr($card_refreshTime[$i][$j],11,8); + + if(strlen($card_refreshTime[$i][$j])<3) + { + $card_HWaddr[$i][$j]="--"; + } + else + { + if(strlen($card_HWaddr[$i][$j])>5) + { + $temp=""; + for($z=0;$z<5;$z++) + { + $temp.=substr($card_HWaddr[$i][$j],$z*2,2); + $temp.=":"; + } + $temp.=substr($card_HWaddr[$i][$j],10,2); + $card_HWaddr[$i][$j]=$temp; + + } + } + $card_type[$i][$j]=$card_type_format[$card_type[$i][$j]]; + } +} + + +$port_enable_format=array(0=>"--",1=>"Y","--"=>"--"); +$port_layer1_format=array(0=>"Y",1=>"N",2=>"--","--"=>"--"); +$port_layer2_format=array(0=>"N",1=>"Y",2=>"--","--"=>"--"); +$port_echoCanceller_format=array(0=>"--",1=>"Y","--"=>"--"); +$port_type_format=array(0=>"TUP",1=>"ISUP",2=>"AIF",3=>"ISDN-NT",4=>"ISDN-LT",5=>"CI-CNF",6=>"CI-INT",7=>"--","--"=>"--"); +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + for($k=0;$k<8;$k++) + { + if($card_status[$i][$j] == "--") + { + $port_e1Install[$i][$j][$k]="--"; + $port_layer1[$i][$j][$k]="--"; + $port_layer2[$i][$j][$k]="--"; + $port_echoCanceller[$i][$j][$k]="--"; + $port_type[$i][$j][$k]="--"; + } + else + { + $port_e1Install[$i][$j][$k]=$port_enable_format[$port_e1Install[$i][$j][$k]]; + $port_layer1[$i][$j][$k]=$port_layer1_format[$port_layer1[$i][$j][$k]]; + $port_layer2[$i][$j][$k]=$port_layer2_format[$port_layer2[$i][$j][$k]]; + $port_echoCanceller[$i][$j][$k]=$port_echoCanceller_format[$port_echoCanceller[$i][$j][$k]]; + $port_type[$i][$j][$k]=$port_type_format[$port_type[$i][$j][$k]]; + } + } + } +} +//============================clear button============================================= +if($clear){ + for($i=0;$i<2;$i++) + { + for($j=0;$j<16;$j++) + { + $card_status[$i][$j]="--"; + $card_refreshTime[$i][$j]="--"; + $card_clock[$i][$j]="--"; + $card_sync[$i][$j]="--"; + $card_version[$i][$j]="--"; + $card_HWaddr[$i][$j]="--"; + $card_type[$i][$j]="--"; + } + } + + for($i=0;$i<2;$i++) + { + for($j=0;$j<16;$j++) + { + for($k=0;$k<8;$k++) + { + + $port_layer1[$i][$j][$k]="--"; + $port_layer2[$i][$j][$k]="--"; + $port_echoCanceller[$i][$j][$k]="--"; + $port_channel[$i][$j][$k]="--"; + $port_type[$i][$j][$k]="--"; + + $port_e1Install[$i][$j][$k]="--"; + $port_e1L2Install[$i][$j][$k]="--"; + } + } + } + //==================clear the record in the database========================= + $db=$omc_db; + $delSql = " Delete FROM OMC_PUB.sysStat + WHERE sysTypeNo='111' + + "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + $tmpSql="SELECT sysTypeNo FROM sysConf WHERE needInstall = 1"; + $tmpRes = mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + $i=0; + do{ + if($i==0) + $tmpWhere="sysTypeNo != $tmpRow[sysTypeNo]"; + else + $tmpWhere=$tmpWhere." AND sysTypeNo != $tmpRow[sysTypeNo]"; + $i++; + }while($tmpRow = @mysqli_fetch_array($tmpRes)); + + //echo "tmpWhere=$tmpWhere"; + + $delSql = " Delete FROM OMC_PUB.sysInfo WHERE $tmpWhere"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $delSql = "Delete FROM OMC_PUB.sysLedStat"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} +//==========================test the data=================================================== +/* +echo "==================card attribute=================
      "; +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + echo "CSC-$i-Card-$j-status:{$card_status[$i][$j]}
      "; + echo "CSC-$i-Card-$j-refreshTime:{$card_refreshTime[$i][$j]}
      "; + echo "CSC-$i-Card-$j-clock:{$card_clock[$i][$j]}
      "; + echo "CSC-$i-Card-$j-sync:{$card_sync[$i][$j]}
      "; + echo "CSC-$i-Card-$j-version:{$card_version[$i][$j]}
      "; + echo "CSC-$i-Card-$j-HWaddr:{$card_HWaddr[$i][$j]}
      "; + echo "CSC-$i-Card-$j-type:{$card_type[$i][$j]}
      "; + } +} + +echo "==================port attribute=================
      "; +for($i=0;$i<2;$i++) +{ + for($j=0;$j<16;$j++) + { + for($k=0;$k<8;$k++) + { + + echo "CSC-$i-Card-$j-Port-$k-enable:{$port_e1Install[$i][$j][$k]}
      "; + echo "CSC-$i-Card-$j-Port-$k-layer1:{$port_layer1[$i][$j][$k]}
      "; + echo "CSC-$i-Card-$j-Port-$k-layer2:{$port_layer2[$i][$j][$k]}
      "; + echo "CSC-$i-Card-$j-Port-$k-echoCanceller:{$port_echoCanceller[$i][$j][$k]}
      "; + echo "CSC-$i-Card-$j-Port-$k-channel:{$port_channel[$i][$j][$k]}
      "; + echo "CSC-$i-Card-$j-Port-$k-type:{$port_type[$i][$j][$k]}
      "; + + //$port_e1Install[$i][$j][$k]="--"; + //$port_e1L2Install[$i][$j][$k]="--"; + } + } +} +*/ + + +//===================================show the data in table================================== +//==========================online help======================= +{ + + echo "
      "; + $helpId="1.2.1"; + showHelp($helpId); + echo "
      "; + +} + +echo "$strSysStatus > $strCentralOffice > MSC-CSC"; +echo "

      $strBack"; +echo "     "; +echo "$strClear"; + +echo "

      "; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //==============================csc0 table=============================================== + echo ""; + echo ""; + //================================csc1 table================================================ + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + // + echo ""; + echo ""; + // + echo ""; +echo "

      CSC0-8K E1/T1 Card $strStatusInfo

       

      CSC1-8K E1/T1 Card $strStatusInfo

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + for($i=0;$i<16;$i++) + { + + echo ""; + //==ID=== + $showId = omc_keep_length($i,0,2); + echo ""; + + //==type== + $tempV=$card_type[0][$i]; + $tempN="plat0card".$i."type"; + if(strcmp($card_type[0][$i],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + + + //==status== + $tempV=$card_status[0][$i]; + $tempN="plat0card".$i."status"; + + if(strcmp($tempV,"Y")==0) + $tempC="blue"; + else if(strcmp($tempV,"N")==0) + $tempC="red"; + else + $tempC="black"; + echo ""; + //==refresh time== + $tempV=$card_refreshTime[0][$i]; + + $tmp_total=explode(" ",$card_refreshTime_full[0][$i]); + $tmp_year_month_day=explode("-",$tmp_total[0]); + $tmp_hour_minute_second=explode(":",$tmp_total[1]); + $tmp_now=time(); + $tmp_fresh=mktime($tmp_hour_minute_second[0],$tmp_hour_minute_second[1],$tmp_hour_minute_second[2],$tmp_year_month_day[1],$tmp_year_month_day[2],$tmp_year_month_day[0]); + + + $tempN="plat0card".$i."refreshtime"; + $slot=$tmp_now-$tmp_fresh; + if(strlen($card_refreshTime[0][$i])>5) + { + //if($card_refreshTime[0][$i]>$dueDate) + if($slot<=40) + $tempC="#0000FF"; + else + $tempC="#FF0000"; + } + else + $tempC="#000000"; + //echo ""; + echo ""; + + //==clock sync== + $tempV=$card_clock[0][$i]."/".$card_sync[0][$i]; + if($card_clock[0][$i]=="--") + $tempV="--"; + $tempN="plat0card".$i."clocksync"; + if(strcmp($card_sync[0][$i],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + //==version== + $tempV=$card_version[0][$i]; + $tempN="plat0card".$i."version"; + if(strcmp($card_version[0][$i],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + //==HWaddr== + $tempV=$card_HWaddr[0][$i]; + $tempN="plat0card".$i."hwaddr"; + if(strcmp($card_HWaddr[0][$i],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + + echo ""; + } + + echo "
      IDType$strBasicStatus$strRefreshTimeClock/SyncVersionHWaddr
      $showId
      "; + echo "
       "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + for($i=0;$i<16;$i++) + { + + echo ""; + //==ID=== + $showId = omc_keep_length($i,0,2); + echo ""; + + //==type== + $tempV=$card_type[1][$i]; + $tempN="plat1card".$i."type"; + if(strcmp($card_type[1][$i],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + + //==status== + $tempV=$card_status[1][$i]; + $tempN="plat1card".$i."status"; + + if(strcmp($tempV,"Y")==0) + $tempC="blue"; + else if(strcmp($tempV,"N")==0) + $tempC="red"; + else + $tempC="black"; + echo ""; + //==refresh time== + $tempV=$card_refreshTime[1][$i]; + $tempN="plat1card".$i."refreshtime"; + + $tmp_total=explode(" ",$card_refreshTime_full[1][$i]); + $tmp_year_month_day=explode("-",$tmp_total[0]); + $tmp_hour_minute_second=explode(":",$tmp_total[1]); + $tmp_now=time(); + $tmp_fresh=mktime($tmp_hour_minute_second[0],$tmp_hour_minute_second[1],$tmp_hour_minute_second[2],$tmp_year_month_day[1],$tmp_year_month_day[2],$tmp_year_month_day[0]); + + + $slot=$tmp_now-$tmp_fresh; + if(strlen($card_refreshTime[1][$i])>5) + { + //if($card_refreshTime[1][$i]<=$dueDate) + if($slot<=40) + $tempC="#0000FF"; + else + $tempC="#FF0000"; + } + else + $tempC="#000000"; + echo ""; + //==clock sync== + $tempV=$card_clock[1][$i]."/".$card_sync[1][$i]; + if($card_clock[1][$i]=="--") + $tempV="--"; + $tempN="plat1card".$i."clocksync"; + if(strcmp($card_sync[1][$i],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + //==version== + $tempV=$card_version[1][$i]; + $tempN="plat1card".$i."version"; + if(strcmp($card_version[1][$i],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + //==HWaddr== + $tempV=$card_HWaddr[1][$i]; + $tempN="plat1card".$i."hwaddr"; + if(strcmp($card_HWaddr[1][$i],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + + echo ""; + } + echo "
      IDType$strBasicStatus$strRefreshTimeClock/SyncVersionHWaddr
      $showId
      "; + echo "

      $strPane0Status

       

      $strPane1Status

      "; + echo ""; + for($i=0;$i<16;$i++) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($j=0;$j<8;$j++) + { + echo ""; + //==slot== + echo ""; + //==port== + echo ""; + //==status== + $tempV=$port_e1Install[0][$i][$j]; + $tempN="plat0card".$i."port".$j."status"; + if(strcmp($port_e1Install[0][$i][$j],"Y")==0) + $tempC="#0000FF"; + else if(strcmp($port_e1Install[0][$i][$j],"N")==0) + $tempC="#FF0000"; + else + $tempC="#000000"; + echo ""; + //==layer1== + $tempV=$port_layer1[0][$i][$j]; + $tempN="plat0card".$i."port".$j."layer1"; + if(strcmp($port_layer1[0][$i][$j],"Y")==0) + $tempC="#0000FF"; + else if(strcmp($port_layer1[0][$i][$j],"N")==0) + $tempC="#FF0000"; + else + $tempC="#000000"; + echo ""; + //==layer2== + $tempV=$port_layer2[0][$i][$j]; + $tempN="plat0card".$i."port".$j."layer2"; + if(strcmp($port_layer2[0][$i][$j],"Y")==0) + $tempC="#0000FF"; + else if(strcmp($port_layer2[0][$i][$j],"N")==0) + $tempC="#FF0000"; + else + $tempC="#000000"; + echo ""; + //==echo canceller== + $tempV=$port_echoCanceller[0][$i][$j]; + $tempN="plat0card".$i."port".$j."echocanceller"; + if(strcmp($port_echoCanceller[0][$i][$j],"Y")==0) + $tempC="#0000FF"; + else if(strcmp($port_echoCanceller[0][$i][$j],"N")==0) + $tempC="#FF0000"; + else + $tempC="#000000"; + echo ""; + //==channel== + $tempV=$port_channel[0][$i][$j]; + $tempN="plat0card".$i."port".$j."channel"; + if(strcmp($port_channel[0][$i][$j],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + //==type== + $tempV=$port_type[0][$i][$j]; + $tempN="plat0card".$i."port".$j."type"; + if(strcmp($port_type[0][$i][$j],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + + echo ""; + } + } + echo "
      SlotPortENL1L2ECCHTY
      $i$j
      "; + echo "
      "; + echo ""; + for($i=0;$i<16;$i++) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($j=0;$j<8;$j++) + { + echo ""; + //==slot== + echo ""; + //==port== + echo ""; + //==status== + $tempV=$port_e1Install[1][$i][$j]; + $tempN="plat1card".$i."port".$j."status"; + if(strcmp($port_e1Install[1][$i][$j],"Y")==0) + $tempC="#0000FF"; + else if(strcmp($port_e1Install[1][$i][$j],"N")==0) + $tempC="#FF0000"; + else + $tempC="#000000"; + echo ""; + //==layer1== + $tempV=$port_layer1[1][$i][$j]; + $tempN="plat1card".$i."port".$j."layer1"; + if(strcmp($port_layer1[1][$i][$j],"Y")==0) + $tempC="#0000FF"; + else if(strcmp($port_layer1[1][$i][$j],"N")==0) + $tempC="#FF0000"; + else + $tempC="#000000"; + echo ""; + //==layer2== + $tempV=$port_layer2[1][$i][$j]; + $tempN="plat1card".$i."port".$j."layer2"; + if(strcmp($port_layer2[1][$i][$j],"Y")==0) + $tempC="#0000FF"; + else if(strcmp($port_layer2[1][$i][$j],"N")==0) + $tempC="#FF0000"; + else + $tempC="#000000"; + echo ""; + //==echo canceller== + $tempV=$port_echoCanceller[1][$i][$j]; + $tempN="plat1card".$i."port".$j."echocanceller"; + if(strcmp($port_echoCanceller[1][$i][$j],"Y")==0) + $tempC="#0000FF"; + else if(strcmp($port_echoCanceller[1][$i][$j],"N")==0) + $tempC="#FF0000"; + else + $tempC="#000000"; + echo ""; + //==channel== + $tempV=$port_channel[1][$i][$j]; + $tempN="plat1card".$i."port".$j."channel"; + if(strcmp($port_channel[1][$i][$j],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + //==type== + $tempV=$port_type[1][$i][$j]; + $tempN="plat1card".$i."port".$j."type"; + if(strcmp($port_type[1][$i][$j],"--")==0) + $tempC="#000000"; + else + $tempC="#0000FF"; + echo ""; + + echo ""; + } + } + echo "
      SlotPortENL1L2ECCHTY
      $i$j
      "; + echo "
      "; +echo "
      "; + +?> + \ No newline at end of file diff --git a/wxc2_omc/fault/good_status/config.ini b/wxc2_omc/fault/good_status/config.ini new file mode 100755 index 0000000..6f83deb --- /dev/null +++ b/wxc2_omc/fault/good_status/config.ini @@ -0,0 +1,19 @@ +# This file conf the total plat definition + +PlatSysTypeNo=200 +[0] +PlatformName="EMS" +PlatformID=0 +PlatformNo=2 +[8] +PlatformName="VSS" +PlatformID=8 +PlatformNo=10 +[9] +PlatformName="MSS" +PlatformID=9 +PlatformNo=2 +[18] +PlatformName="RCM" +PlatformID=18 +PlatformNo=2 diff --git a/wxc2_omc/fault/good_status/iptrans_status.php b/wxc2_omc/fault/good_status/iptrans_status.php new file mode 100755 index 0000000..5ba9066 --- /dev/null +++ b/wxc2_omc/fault/good_status/iptrans_status.php @@ -0,0 +1,229 @@ + + + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > IPTRANS Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "Back"; + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,0); + +if(0) +{ + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; +} + +$table_title="IPTRANS( Version:"; +$id=AssignID(); +$table_title.="$id"; +$table_title.=","; + +$table_title.=" Status:"; +$id=AssignID(); +$table_title.="$id"; +$table_title.=","; + +$table_title.="RefreshTime:"; +$id=AssignID(); +$table_title.="4id"; +$table_title.=")"; + + + echo "
      $table_title
      "; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + +for($i=0;$i<8;$i++) +{ + echo ""; + for($j=0;$j<4;$j++) + { + + $dis_no=4950+($j)*8+$i; + echo ""; + + $id=AssignID(); + echo ""; + } + echo ""; +} + +echo "
      Port noStatusPort noStatusPort noStatusPort noStatus
      "; + echo $dis_no; + echo ""; + $dis_port=($j)*8+$i; + echo "$id"; + echo "
      "; + + +//Remark Table +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "Back"; + echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$sysNo','$subSysNo');\n"; + echo "\n"; +?> + diff --git a/wxc2_omc/fault/good_status/iptrans_status_update.php b/wxc2_omc/fault/good_status/iptrans_status_update.php new file mode 100755 index 0000000..eba92b1 --- /dev/null +++ b/wxc2_omc/fault/good_status/iptrans_status_update.php @@ -0,0 +1,51 @@ + + diff --git a/wxc2_omc/fault/good_status/linksetStatus_deal.php b/wxc2_omc/fault/good_status/linksetStatus_deal.php new file mode 100755 index 0000000..2a2c325 --- /dev/null +++ b/wxc2_omc/fault/good_status/linksetStatus_deal.php @@ -0,0 +1,314 @@ + + +1) + $oids=substr($oids,0,strlen($oids)-1); + + return $oids; +} +function getLevel($objIdStr) +{ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + $levelNo+=1; + if($levelNo<=10) + $levelWhere.=" AND level_$levelNo=0 "; + return($levelWhere); +} +function getLinkInfo($table,$titleoid,$statusoid,$instance) +{ + $instanceNo=omc_keep_length($instance,"0",4); + + $tmpwhere=getLevel($titleoid); + $sql="select * from $table where $tmpwhere and instanceNo = '$instanceNo' "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + $linkInfo[Title]=""; + else + { + $row=@mysqli_fetch_array($res); + $linkInfo[Title]=$row[initValue]; + } + + $tmpwhere=getLevel($statusoid); + $sql="select * from $table where $tmpwhere and instanceNo = '$instanceNo' "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + $linkInfo[Status]=0; + else + { + $row=@mysqli_fetch_array($res); + $linkInfo[Status]=$row[initValue]+0; + } + return $linkInfo; +} + +function getStatusByHeartbeat() +{ + global $mss_platno,$plat_systypeno; + $sql="select * from OMC_PUB.sysStat where sysTypeNo={$plat_systypeno} and sysNo={$mss_platno} order by updateTime desc "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + + if($num == 0) + return $StatusSet; + + $row=@mysqli_fetch_array($res); + $baseStat=$row[detailStat]; + $compStat=substr($baseStat,38); + $compStatLen=strlen($compStat)-1; + //echo "$compStat
      "; + $index=0; + $i=0; + while($i<$compStatLen) + { + $tmp=substr($compStat,$i,4); + $component[$index][ID]=$tmp+0; + $i+=4; + $tmp=substr($compStat,$i,4); + $component[$index][Length]=hexdec($tmp); + $i+=4; + $component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2); + $i+=$component[$index][Length]*2; + $index++; + } + + + + if($component[1][Length] == 0) + return $StatusSet; + + + $mtp3_hb=$component[1][Content]; + $pos=0; + $link_hb=substr($mtp3_hb,8,256*2); + $linkset_hb=substr($mtp3_hb,520,128*2); + + for($i=0;$i<256;$i++) + { + $tmpi=hexdec(substr($link_hb,$i*2,2)); + $tmpb=omc_keep_length(decbin($tmpi),"0",8); + $tmpb=strrev($tmpb); + for($j=0;$j<4;$j++) + { + $tmp2bit=strrev(substr($tmpb,$j*2,2)); + $StatusSet[LinkStatus][$i*4+$j]=bindec($tmp2bit); + } + } + + for($i=0;$i<128;$i++) + { + $tmpi=hexdec(substr($linkset_hb,$i*2,2)); + $tmpb=omc_keep_length(decbin($tmpi),"0",8); + $tmpb=strrev($tmpb); + for($j=0;$j<4;$j++) + { + $tmp2bit=strrev(substr($tmpb,$j*2,2)); + $tt=$i*4+$j; + $yy=bindec($tmp2bit); + $StatusSet[LinkSetStatus][$i*4+$j]=bindec($tmp2bit); + } + } + + return $StatusSet; +} + +?> +> /tmp/test.txt"); + + +if($num > 0) + $response.="layer".$field_sep."blank_row_id".$field_sep."hide".$line_sep; +else + $response.="layer".$field_sep."blank_row_id".$field_sep."show".$line_sep; + +for($index=0;$index<$maxRowPerPage;$index++) +{ + //system("echo 'linksetCount=$linksetCount' >> /tmp/test.txt"); + if($index < $linksetCount) + $response.="layer".$field_sep."row_id_{$index}".$field_sep."show".$line_sep; + else + $response.="layer".$field_sep."row_id_{$index}".$field_sep."hide".$line_sep; +} + +$linkset_id_cond=" and ("; +for($index=0;$index < $num;$index++) +{ + $row=@mysqli_fetch_array($res); + $linkset[$index][Instance]=$row[instanceNo]+0; + $linkset_id_cond.=" initValue={$linkset[$index][Instance]} "; + if($index != ($num-1)) + $linkset_id_cond.=" or "; + $linkset[$index][LinkIndex]=0; + $index_mirror[$linkset[$index][Instance]][Index]=$index; +} +$linkset_id_cond.=") "; +if($num == 0) + $linkset_id_cond=""; + +$statusSet=getStatusByHeartbeat(); + +//get linkset status and title +$tmpwhere=getLevel($linkset_title_oid); +$from=$current_page_no * $maxRowPerPage; +$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage "; +$res=@mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); + +for($index=0;$index < $num;$index++) +{ + $row=@mysqli_fetch_array($res); + $instance=$row[instanceNo]+0; + $pos=$index_mirror[$instance][Index]; + $linkset[$index][Title]=$row[initValue]; +} + +$tmpwhere=getLevel($linkset_status_oid); +$from=$current_page_no * $maxRowPerPage; +$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage "; +$res=@mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); + +for($index=0;$index < $num;$index++) +{ + $row=@mysqli_fetch_array($res); + $instance=$row[instanceNo]+0; + $pos=$index_mirror[$instance][Index]; + //$linkset[$index][Status]=$row[initValue]+0; + $linkset[$index][Status]=$statusSet[LinkSetStatus][$instance]+0; +} + +$status_value=array(0=>"N",1=>"Y",2=>"I",3=>"--"); +$status_color=array(0=>"#ff0000",1=>"#0000ff",2=>"#cecece",3=>"#000000"); +for($index=0;$index<$linksetCount;$index++) +{ + if(strlen($linkset[$index][Title])>0) + $value=$linkset[$index][Instance]."[".$linkset[$index][Title]."]"; + else + $value=$linkset[$index][Instance]; + $response.="obj".$field_sep."ls_title_id_{$index}".$field_sep.$value.$field_sep."#000000".$line_sep; + + $value=$linkset[$index][Status]+0; + $response.="obj".$field_sep."ls_status_id_{$index}".$field_sep.$status_value[$value].$field_sep.$status_color[$value].$line_sep; +} + +//get link status +$tmpwhere=getLevel($link_lsID_oid); +$from=$current_page_no * $maxRowPerPage; +$sql="select * from $mtp3_param_table where $tmpwhere $linkset_id_cond order by instanceNo asc "; +$res=@mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); + +for($index=0;$index<$num;$index++) +{ + $row=@mysqli_fetch_array($res); + $ls_instance=$row[initValue]+0; + $lk_instance=$row[instanceNo]+0; + $ls_index=$index_mirror[$ls_instance][Index]; + $lk_index=$linkset[$ls_index][LinkIndex]; + + $lkInfo=getLinkInfo($mtp3_param_table,$link_title_oid,$link_status_oid,$lk_instance); + + $value=$lk_instance; + //$color=$status_color[$lkInfo[Status]]; + $color=$status_color[$statusSet[LinkStatus][$lk_instance]]; + $response.="obj".$field_sep."lk_status_id_{$ls_index}_{$lk_index}".$field_sep."{$value}".$field_sep."{$color}".$line_sep; + + //$response.="title".$field_sep."lk_title_id_{$ls_index}_{$lk_index}".$field_sep."{$lkInfo[Title]}".$line_sep; + + + $linkset[$ls_index][LinkIndex]++; +} + +for($index=0;$index<$num;$index++) +{ + for($j=$linkset[$index][LinkIndex];$j<$maxRowPerPage;$j++) + { + $response.="obj".$field_sep."lk_status_id_{$index}_{$j}".$field_sep."--".$field_sep."#000000".$line_sep; + //$response.="obj".$field_sep."lk_status_id_{$index}_{$j}".$field_sep."--".$line_sep; + } +} + +$response=substr($response,0,strlen($response)-1); +//system("date >> /tmp/test.txt"); +echo $response; + + + +?> + \ No newline at end of file diff --git a/wxc2_omc/fault/good_status/linksetStatus_show.php b/wxc2_omc/fault/good_status/linksetStatus_show.php new file mode 100755 index 0000000..259b2f4 --- /dev/null +++ b/wxc2_omc/fault/good_status/linksetStatus_show.php @@ -0,0 +1,187 @@ + + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo "
      "; + echo "Advanced > MTP3 Status > LinkSet"; + echo ""; + $helpId="1.2.4"; + //showHelp($helpId); + echo "
      "; + + echo ""; + echo ""; + echo "Back"; + echo "
      "; + +adjust_title_tail(); +adjust_content_head(); + + //echo "
      Linkset Status

      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + for($i=0;$i<$maxRowPerPage;$i++) + { + echo ""; + echo ""; + echo ""; + for($j=0;$j<16;$j++) + { + echo ""; + } + + echo ""; + } + echo "
      Linkset Status
      NameStatusLinks Status
      ------
      "; + echo "--"; + echo ""; + echo "--"; + echo ""; + echo "--"; + echo "
      "; + echo "Remarks: Y = Available, N = Unavailable, I = Inhibited."; + + echo ""; + echo ""; + + + + echo ""; + +adjust_content_tail(); +?> + + + diff --git a/wxc2_omc/fault/good_status/plat_status.php b/wxc2_omc/fault/good_status/plat_status.php new file mode 100755 index 0000000..7736756 --- /dev/null +++ b/wxc2_omc/fault/good_status/plat_status.php @@ -0,0 +1,388 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > PLAT Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "Back"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); +foreach($config as $key => $val) +{ + if($config[$key][PlatformID] == $sysNo) + { + $thisconfig=$config[$key]; + break; + } +} + +$tmpconf[PlatNo]=$sysNo; +$plat=GetPlatInfo($tmpconf,$subSysNo); +if(0) +{ + echo "

      ";
      +	print_r($plat);
      +	echo "
      "; +} +echo "
      {$thisconfig[PlatformName]}_$subSysNo platform information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      Status"; + //platform Status + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      Refresh Time"; + //Refresh Time + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      Start Time"; + //Start Time + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      CPU Usage"; + //CPU Usage PN + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + //CPU Usage Rate + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + +echo "
      Physical Memory"; + //Physical Memory Used/Total + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + echo "(Used/Total)"; + echo "
      "; + + //Physical Memory Used/Swap + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + echo "(Used/Swap)"; + echo "
      "; + + + $id=AssignID(); + echo "Buffers:"; + echo " "; + echo ""; + echo "--"; + echo ""; + + echo "; "; + + $id=AssignID(); + echo "Cached:"; + echo " "; + echo ""; + echo "--"; + echo ""; + + echo "
      "; + +echo "
      Harddisk Space"; + //Harddisk, support 16 harddisk + for($i=0;$i<16;$i++) + { + $id=AssignID(); + if($i==0) + echo ""; + else + echo ""; + + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo "
      "; + + echo "
      "; + + } + +echo "
      "; + +//Remark Table +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "Back"; + echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$sysNo','$subSysNo');\n"; + echo "\n"; +?> diff --git a/wxc2_omc/fault/good_status/plat_status_update.php b/wxc2_omc/fault/good_status/plat_status_update.php new file mode 100755 index 0000000..7d2be74 --- /dev/null +++ b/wxc2_omc/fault/good_status/plat_status_update.php @@ -0,0 +1,181 @@ + $val) +{ + if($config[$key][PlatformID] == $sysNo) + { + $thisconfig=$config[$key]; + break; + } +} + +$sql="select * from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$sysNo} and subSysNo=$subSysNo "; +//echo "$sql
      "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num == 0) + exit(); + +$tmpconf[PlatNo]=$sysNo; +$plat=GetPlatInfo($tmpconf,$subSysNo); + + + +//platform Status +$id=AssignID(); +$sql="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$sysNo} and subSysNo=$subSysNo "; +//echo "$sql
      "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num != 1) +{ + $baseStat=0; +} +else +{ + $row=@mysqli_fetch_array($res); + $baseStat=$row[baseStat]+0; +} +$refresh_time=$row[updateTime]; +$due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); +$ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); +if($refresh_time < $due_date || $refresh_time > $ove_date) +{ + $valid_time=0; +} +else +{ + $valid_time=1; +} +if($valid_time == 0 || $baseStat == 0) + $total_response.="$id,block,N,#ff0000;"; +else + $total_response.="$id,block,Y,#0000ff;"; + +//Refresh Time +$id=AssignID(); +if($valid_time) + $total_response.="$id,block,$refresh_time,#0000ff;"; +else + $total_response.="$id,block,$refresh_time,#ff0000;"; + +//Start Time +$id=AssignID(); +if(trim($plat[StartTime][Value]) == "") + $total_response.="$id,block,--,#000000;"; +else + $total_response.="$id,block,{$plat[StartTime][Value]},#0000ff;"; + + +//CPU Usage PN +$id=AssignID(); +$message="{$id},{$plat[CPURatePN][Display]},{$plat[CPURatePN][Value]},{$plat[CPURatePN][Color]};"; +$total_response.=$message; + +//CPU Usage +$id=AssignID(); +$message="{$id},{$plat[CPURate][Display]},{$plat[CPURate][Value]},{$plat[CPURate][Color]};"; +$total_response.=$message; + +//Physical Memory +$id=AssignID(); +$message="{$id},{$plat[PMTotalRatePN][Display]},{$plat[PMTotalRatePN][Value]},{$plat[PMTotalRatePN][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMTotalRate][Display]},{$plat[PMTotalRate][Value]},{$plat[PMTotalRate][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMTotalRateV][Display]},{$plat[PMTotalRateV][Value]},{$plat[PMTotalRateV][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRatePN][Display]},{$plat[PMSwapRatePN][Value]},{$plat[PMSwapRatePN][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRate][Display]},{$plat[PMSwapRate][Value]},{$plat[PMSwapRate][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRateV][Display]},{$plat[PMSwapRateV][Value]},{$plat[PMSwapRateV][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMBuffers][Display]},{$plat[PMBuffers][Value]},{$plat[PMBuffers][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMCached][Display]},{$plat[PMCached][Value]},{$plat[PMCached][Color]};"; +$total_response.=$message; + +//Harddisk +for($i=0;$i<16;$i++) +{ + if($i<$plat[HDNum]) + { + $id=AssignID(); + $message="{$id},layerShow,no,no;"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][PN][Display]},{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][Rate][Display]},{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][V][Display]},{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][Path][Display]},{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};"; + $total_response.=$message; + } + else + { + $id=AssignID(); + $message="{$id},layerHide,no,no;"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};"; + //$total_response.=$message; + } +} + +echo "$total_response"; +?> diff --git a/wxc2_omc/fault/good_status/plat_test_status.php b/wxc2_omc/fault/good_status/plat_test_status.php new file mode 100755 index 0000000..3ba1889 --- /dev/null +++ b/wxc2_omc/fault/good_status/plat_test_status.php @@ -0,0 +1,639 @@ + + + + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > Plat Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "Clear"; + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + + + +$config=parse_ini_file("../platStatus/config.ini",true); +$config_count=sizeof($config); + + +if(0) +{ + echo "config_count=$config_count
      "; + echo "
      ";
      +	print_r($config);
      +	echo "
      "; +} + + + +if($clearAll == 1) +{ + //echo "clear
      "; + $sql="delete from OMC_PUB.sysInfo where sysTypeNo=200 "; + @mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); +} + + + +echo "
      Platform summary information
      "; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; + + + +foreach($config as $key => $val) +{ + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + + + if($config[$key][PlatformID] == 0) + { + for($j=0;$j<2;$j++) + { + //Rowline + $id=AssignID(); + echo ""; + //Item Name + echo ""; + + //Application status + $id=AssignID(); + echo ""; + + + //IPTRANS + $id=AssignID(); + echo ""; + + + //MTP3 + $id=AssignID(); + echo ""; + + //SCCP + $id=AssignID(); + echo ""; + + //TCAP + $id=AssignID(); + echo ""; + + //SNMP + $id=AssignID(); + echo ""; + + //DEBUG + $id=AssignID(); + echo ""; + + //SMPP + $id=AssignID(); + echo ""; + + + //PLAT STATUS + $id=AssignID(); + echo ""; + + + + //Refresh Time + $id=AssignID(); + echo ""; + + + //IP Address + $id=AssignID(); + echo ""; + + echo ""; + } + } + + if($config[$key][PlatformID] == 8) + { + for($j=0;$j<10;$j++) + { + + //Rowline + $id=AssignID(); + echo ""; + //Item Name + echo ""; + + //Application status + $id=AssignID(); + echo ""; + + + //IPTRANS + $id=AssignID(); + echo ""; + + + //MTP3 + $id=AssignID(); + echo ""; + + //SCCP + $id=AssignID(); + echo ""; + + //TCAP + $id=AssignID(); + echo ""; + + //SNMP + $id=AssignID(); + echo ""; + + //DEBUG + $id=AssignID(); + echo ""; + + //SMPP + $id=AssignID(); + echo ""; + + + //PLAT STATUS + $id=AssignID(); + echo ""; + + + + //Refresh Time + $id=AssignID(); + echo ""; + + + //IP Address + $id=AssignID(); + echo ""; + + echo ""; + } + } + + if($config[$key][PlatformID] == 9) + { + for($j=0;$j<2;$j++) + { + + //Rowline + $id=AssignID(); + echo ""; + //Item Name + echo ""; + + //Application status + $id=AssignID(); + echo ""; + + + //IPTRANS + $id=AssignID(); + echo ""; + + + //MTP3 + $id=AssignID(); + echo ""; + + //SCCP + $id=AssignID(); + echo ""; + + //TCAP + $id=AssignID(); + echo ""; + + //SNMP + $id=AssignID(); + echo ""; + + //DEBUG + $id=AssignID(); + echo ""; + + //SMPP + $id=AssignID(); + echo ""; + + + //PLAT STATUS + $id=AssignID(); + echo ""; + + + + //Refresh Time + $id=AssignID(); + echo ""; + + + //IP Address + $id=AssignID(); + echo ""; + + echo ""; + } + } + + if($config[$key][PlatformID] == 18) + { + for($j=0;$j<2;$j++) + { + + //Rowline + $id=AssignID(); + echo ""; + //Item Name + echo ""; + + //Application status + $id=AssignID(); + echo ""; + + + //IPTRANS + $id=AssignID(); + echo ""; + + + //MTP3 + $id=AssignID(); + echo ""; + + //SCCP + $id=AssignID(); + echo ""; + + //TCAP + $id=AssignID(); + echo ""; + + //SNMP + $id=AssignID(); + echo ""; + + //DEBUG + $id=AssignID(); + echo ""; + + //SMPP + $id=AssignID(); + echo ""; + + + //PLAT STATUS + $id=AssignID(); + echo ""; + + + + //Refresh Time + $id=AssignID(); + echo ""; + + + //IP Address + $id=AssignID(); + echo ""; + + echo ""; + } + } +} + + +echo "
      ItemApplication statusIPTRANSMTP3SCCPTCAPSNMPDEBUGSMPPPLAT STATUSRefresh TimeIP Address
      ------------------------
      {$config[$key][PlatformName]}_{$j}"; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "--"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "--"; + echo ""; + echo "$id"; + echo "
      {$config[$key][PlatformName]}_{$j}"; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "--"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "--"; + echo ""; + echo "$id"; + echo "
      {$config[$key][PlatformName]}_{$j}"; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "--"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "--"; + echo ""; + echo "$id"; + echo "
      {$config[$key][PlatformName]}_{$j}"; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "--"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "--"; + echo ""; + echo "$id"; + echo "
      "; + + + +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "Clear"; + echo "
      "; + +if($clearAll) +{ + echo "\n"; +} + +echo ""; +adjust_content_tail(); + +?> + + + + + diff --git a/wxc2_omc/fault/good_status/plat_test_status_update.php b/wxc2_omc/fault/good_status/plat_test_status_update.php new file mode 100755 index 0000000..a75ebc9 --- /dev/null +++ b/wxc2_omc/fault/good_status/plat_test_status_update.php @@ -0,0 +1,156 @@ + + + + + + + $val) +{ + + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + + + for($sys=0;$sys<$config[$key][PlatformNo];$sys++) + { + $sql="select * from OMC_PUB.sysInfo where sysTypeNo={$config[PlatSysTypeNo]} and sysNo={$config[$key][PlatformID]} and subSysNo={$sys} "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + + // $module_vertion=GetModuleVersion({$config[PlatSysTypeNo]},{$config[$key][PlatformID]},{$sysNo}); + + + if($num == 0) + { + + $id=AssignID(); + $total_response.="$id,none,none,none;"; + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + continue; + } + else + { + $row=@mysqli_fetch_array($res); + $id=AssignID(); + $total_response.="$id,block,none,none;"; + + + $platDetailInfo=GetDetailPlatInfo($config[$key][PlatformID],$sys,9999); + + $debug_message="GetDetailPlatInfo($config[$key][PlatformID],$sys,9999);
      "; + debug_log("/tmp/test.txt",$debug_message); + + //Application status + $id=AssignID(); + if(strcmp($platDetailInfo[Application][Status][Value],"--")) + $platDetailInfo[Application][Status][Value]="Y"; + $total_response.="$id,block,{$platDetailInfo[Application][Status][Value]},#0000FF;"; + + //IPTRANS + $id=AssignID(); + //if(strcmp($platDetailInfo[IPTRANS][Status][Value],"--")) + //$platDetailInfo[IPTRANS][Status][Value]="".$platDetailInfo[IPTRANS][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[IPTRANS][Status][Value]},{$platDetailInfo[IPTRANS][Status][Color]};"; + + + //MTP3 + $id=AssignID(); + // if(strcmp($platDetailInfo[MTP3][Status][Value],"--")) + // $platDetailInfo[MTP3][Status][Value]="".$platDetailInfo[MTP3][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[MTP3][Status][Value]},{$platDetailInfo[MTP3][Status][Color]};"; + + //SCCP + $id=AssignID(); + //if(strcmp($platDetailInfo[SCCP][Status][Value],"--")) + //$platDetailInfo[SCCP][Status][Value]="".$platDetailInfo[SCCP][Status][Value].""; + //$platDetailInfo[SCCP][Status][Value]=$platDetailInfo[SCCP][Status][Value]; + $total_response.="$id,block,{$platDetailInfo[SCCP][Status][Value]},{$platDetailInfo[SCCP][Status][Color]};"; + + //TCAP + $id=AssignID(); + //if(strcmp($platDetailInfo[TCAP][Status][Value],"--")) + //$platDetailInfo[TCAP][Status][Value]="".$platDetailInfo[TCAP][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[TCAP][Status][Value]},{$platDetailInfo[TCAP][Status][Color]};"; + + //SNMP + $id=AssignID(); + //if(strcmp($platDetailInfo[SNMP][Status][Value],"--")) + //$platDetailInfo[SNMP][Status][Value]="".$platDetailInfo[SNMP][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[SNMP][Status][Value]},{$platDetailInfo[SNMP][Status][Color]};"; + + //DEBUG + $id=AssignID(); + //if(strcmp($platDetailInfo[DEBUG][Status][Value],"--")) + //$platDetailInfo[DEBUG][Status][Value]="".$platDetailInfo[DEBUG][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[DEBUG][Status][Value]},{$platDetailInfo[DEBUG][Status][Color]};"; + + //SMPP + $id=AssignID(); + //if(strcmp($platDetailInfo[SMPP][Status][Value],"--")) + //$platDetailInfo[SMPP][Status][Value]="".$platDetailInfo[SMPP][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[SMPP][Status][Value]},{$platDetailInfo[SMPP][Status][Color]};"; + + + + //PLAT Status + $id=AssignID(); + //if(strcmp($platDetailInfo[Application][Status][Value],"--")) + //$platDetailInfo[Application][Status][Value]="".$platDetailInfo[Application][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[Application][Status][Value]},#0000FF;"; + + //Refresh Time + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},{$platDetailInfo[RefreshTime][Color]};"; + + //IP Address + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[IPAddress][Value]},{$platDetailInfo[IPAddress][Color]};"; + $show_num++; + } + } +} + + +if($show_num) + $total_response.="blank_line,none,none,none;"; +else + $total_response.="blank_line,block,none,none;"; + +debug_log("/tmp/test.txt",$total_response); +echo $total_response; + +?> diff --git a/wxc2_omc/fault/good_status/sccp_status.php b/wxc2_omc/fault/good_status/sccp_status.php new file mode 100755 index 0000000..c962e0c --- /dev/null +++ b/wxc2_omc/fault/good_status/sccp_status.php @@ -0,0 +1,226 @@ + + + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > SCCP Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "Back"; + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,2); + +if(0) +{ + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; +} + +$table_title="SCCP( Version:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=","; + +$table_title.=" Status:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=","; + +$table_title.="RefreshTime:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=")"; + + + echo "
      $table_title
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + + for($i=0;$i<256;$i++) + { + + echo ""; + + $id=AssignID(); + echo ""; + $id=AssignID(); + echo ""; + echo ""; + + } + + echo "
      NumName
      ----
      "; + + +//Remark Table +echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + //echo "Back"; + //echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$sysNo','$subSysNo');\n"; + echo "\n"; +?> + diff --git a/wxc2_omc/fault/good_status/sccp_status_update.php b/wxc2_omc/fault/good_status/sccp_status_update.php new file mode 100755 index 0000000..77a2648 --- /dev/null +++ b/wxc2_omc/fault/good_status/sccp_status_update.php @@ -0,0 +1,66 @@ + + diff --git a/wxc2_omc/fault/good_status/smpp_status.php b/wxc2_omc/fault/good_status/smpp_status.php new file mode 100755 index 0000000..36c3865 --- /dev/null +++ b/wxc2_omc/fault/good_status/smpp_status.php @@ -0,0 +1,223 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > SMPP Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "Back"; + echo "
      "; + +adjust_title_tail(); +adjust_content_head(); + +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,9); + +if(0) +{ + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; +} + +$table_title="SMPP( Status:"; +$id=AssignID(); +$table_title.="$id"; +$table_title.=","; + +$table_title.="RefreshTime:"; +$id=AssignID(); +$table_title.="$id"; +$table_title.=")"; + + + echo "
      $table_title
      "; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + +for($i=0;$i<8;$i++) + { + echo ""; + + for($j=0;$j<4;$j++) + { + $dis_no=($j)*8+$i; + echo ""; + + echo ""; + } + + echo ""; + } + + echo "
      Port noStatusPort noStatusPort noStatusPort noStatus
      "; + echo $dis_no; + echo ""; + $id=AssignID(); + echo "$id"; + echo "
      "; + + +//Remark Table +echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; +echo "
      "; + echo "Remarks: 0 = Not initializing , 1 = Idle, 2 = Waiting, 3 =Established."; + echo ""; + echo "Back"; + echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$sysNo','$subSysNo');\n"; + echo "\n"; +?> + diff --git a/wxc2_omc/fault/good_status/smpp_status_update.php b/wxc2_omc/fault/good_status/smpp_status_update.php new file mode 100755 index 0000000..25c9a86 --- /dev/null +++ b/wxc2_omc/fault/good_status/smpp_status_update.php @@ -0,0 +1,52 @@ + + diff --git a/wxc2_omc/fault/good_status/snmp_status.php b/wxc2_omc/fault/good_status/snmp_status.php new file mode 100755 index 0000000..4b56546 --- /dev/null +++ b/wxc2_omc/fault/good_status/snmp_status.php @@ -0,0 +1,237 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > SNMP Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "Back"; + echo "
      "; + +adjust_title_tail(); +adjust_content_head(); + +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,4); + +if(0) +{ + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; +} + + + +$table_title="SNMP( Version:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=","; + +$table_title.=" Status:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=","; + +$table_title.="RefreshTime:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=")"; + + + echo "
      $table_title
      "; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + $id=AssignID(); + echo ""; + echo ""; + + echo ""; + echo ""; + $id=AssignID(); + echo ""; + echo ""; + + echo ""; + echo ""; + $id=AssignID(); + + echo ""; + + echo ""; + + echo ""; + echo ""; + $id=AssignID(); + echo ""; + echo ""; + + echo "
      Function typeRegistered number
      TARP"; + echo "$id"; + echo "
      SET"; + echo "$id"; + echo "
      GET"; + echo "$id"; + echo "
      RSP"; + echo "$id"; + echo "
      "; + + +//Remark Table +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "Back"; + echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$sysNo','$subSysNo');\n"; + echo "\n"; +?> + diff --git a/wxc2_omc/fault/good_status/snmp_status_update.php b/wxc2_omc/fault/good_status/snmp_status_update.php new file mode 100755 index 0000000..4bcb3a6 --- /dev/null +++ b/wxc2_omc/fault/good_status/snmp_status_update.php @@ -0,0 +1,59 @@ + + diff --git a/wxc2_omc/fault/good_status/tcap_status.php b/wxc2_omc/fault/good_status/tcap_status.php new file mode 100755 index 0000000..de427c5 --- /dev/null +++ b/wxc2_omc/fault/good_status/tcap_status.php @@ -0,0 +1,212 @@ + + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > TCAP Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "Back"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,3); + +if(0) +{ + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; +} + +$table_title="TCAP( Version:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=","; + +$table_title.=" Status:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=","; + +$table_title.="RefreshTime:"; +$id=AssignID(); +$table_title.="--"; +$table_title.=")"; + + + echo "
      $table_title
      "; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + $id=AssignID(); + echo ""; + + echo ""; + echo ""; + +echo "
      Current Used Dialogue IDMax Used Dialogue ID
      "; + echo "--"; + echo ""; + $id=AssignID(); + echo "--"; + echo "
      "; + + +//Remark Table +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "Back"; + echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$sysNo','$subSysNo');\n"; + echo "\n"; +?> + diff --git a/wxc2_omc/fault/good_status/tcap_status_update.php b/wxc2_omc/fault/good_status/tcap_status_update.php new file mode 100755 index 0000000..a7acd75 --- /dev/null +++ b/wxc2_omc/fault/good_status/tcap_status_update.php @@ -0,0 +1,60 @@ + + diff --git a/wxc2_omc/fault/linksetStatus.tgz b/wxc2_omc/fault/linksetStatus.tgz new file mode 100755 index 0000000..82ed270 Binary files /dev/null and b/wxc2_omc/fault/linksetStatus.tgz differ diff --git a/wxc2_omc/fault/linksetStatus/linksetStatus_deal.php b/wxc2_omc/fault/linksetStatus/linksetStatus_deal.php new file mode 100755 index 0000000..77297e8 --- /dev/null +++ b/wxc2_omc/fault/linksetStatus/linksetStatus_deal.php @@ -0,0 +1,329 @@ + + +1) + $oids=substr($oids,0,strlen($oids)-1); + + return $oids; +} +function getLevel($objIdStr) +{ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + $levelNo+=1; + if($levelNo<=10) + $levelWhere.=" AND level_$levelNo=0 "; + return($levelWhere); +} +function getLinkInfo($table,$titleoid,$statusoid,$instance) +{ + global $OMC_server,$mtp3_systypeno; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OBJ_".$mtp3_systypeno); + $instanceNo=omc_keep_length($instance,"0",4); + $tmpwhere=getLevel($titleoid); + + + $sql="select * from $table where $tmpwhere and instanceNo = '$instanceNo' "; + //echo "sql=$sql
      "; + $res=@mysqli_query($objDbConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + $linkInfo[Title]=""; + else + { + $row=@mysqli_fetch_array($res); + $linkInfo[Title]=$row[initValue]; + } + + $tmpwhere=getLevel($statusoid); + $sql="select * from $table where $tmpwhere and instanceNo = '$instanceNo' "; + $res=@mysqli_query($objDbConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + $linkInfo[Status]=0; + else + { + $row=@mysqli_fetch_array($res); + $linkInfo[Status]=$row[initValue]+0; + } + return $linkInfo; +} + +function getStatusByHeartbeat() +{ + global $mss_platno,$plat_systypeno,$OMC_server; + $pubConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OMC_PUB"); + $sql="select * from OMC_PUB.sysStat where sysTypeNo=$plat_systypeno and sysNo=$mss_platno order by updateTime desc "; + $res=@mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + + if($num == 0) + return $StatusSet; + + $row=@mysqli_fetch_array($res); + $baseStat=$row[detailStat]; + $compStat=substr($baseStat,38); + $compStatLen=strlen($compStat)-1; + //echo "$compStat
      "; + $index=0; + $i=0; + while($i<$compStatLen) + { + $tmp=substr($compStat,$i,4); + $component[$index][ID]=$tmp+0; + $i+=4; + $tmp=substr($compStat,$i,4); + $component[$index][Length]=hexdec($tmp); + $i+=4; + $component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2); + $i+=$component[$index][Length]*2; + $index++; + } + + + + if($component[1][Length] == 0) + return $StatusSet; + + + $mtp3_hb=$component[1][Content]; + $pos=0; + $link_hb=substr($mtp3_hb,8,256*2); + $linkset_hb=substr($mtp3_hb,520,128*2); + + for($i=0;$i<256;$i++) + { + $tmpi=hexdec(substr($link_hb,$i*2,2)); + $tmpb=omc_keep_length(decbin($tmpi),"0",8); + $tmpb=strrev($tmpb); + for($j=0;$j<4;$j++) + { + $tmp2bit=strrev(substr($tmpb,$j*2,2)); + $StatusSet[LinkStatus][$i*4+$j]=bindec($tmp2bit); + } + } + + for($i=0;$i<128;$i++) + { + $tmpi=hexdec(substr($linkset_hb,$i*2,2)); + $tmpb=omc_keep_length(decbin($tmpi),"0",8); + $tmpb=strrev($tmpb); + for($j=0;$j<4;$j++) + { + $tmp2bit=strrev(substr($tmpb,$j*2,2)); + $tt=$i*4+$j; + $yy=bindec($tmp2bit); + $StatusSet[LinkSetStatus][$i*4+$j]=bindec($tmp2bit); + } + } + + return $StatusSet; +} + +?> +> /tmp/test.txt"); + + +if($num > 0) + $response.="layer".$field_sep."blank_row_id".$field_sep."hide".$line_sep; +else + $response.="layer".$field_sep."blank_row_id".$field_sep."show".$line_sep; + +for($index=0;$index<$maxRowPerPage;$index++) +{ + //system("echo 'linksetCount=$linksetCount' >> /tmp/test.txt"); + if($index < $linksetCount) + $response.="layer".$field_sep."row_id_{$index}".$field_sep."show".$line_sep; + else + $response.="layer".$field_sep."row_id_{$index}".$field_sep."hide".$line_sep; +} + +$linkset_id_cond=" and ("; +for($index=0;$index < $num;$index++) +{ + $row=@mysqli_fetch_array($res); + $linkset[$index][Instance]=$row[instanceNo]+0; + $linkset_id_cond.=" initValue={$linkset[$index][Instance]} "; + if($index != ($num-1)) + $linkset_id_cond.=" or "; + $linkset[$index][LinkIndex]=0; + $index_mirror[$linkset[$index][Instance]][Index]=$index; +} +$linkset_id_cond.=") "; +if($num == 0) + $linkset_id_cond=""; + + + $statusSet=getStatusByHeartbeat(); + +//get linkset status and title +$tmpwhere=getLevel($linkset_title_oid); +$from=$current_page_no * $maxRowPerPage; +$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage "; +$res=@mysqli_query($objDbConn,$sql); +$num=mysqli_num_rows($res); + +for($index=0;$index < $num;$index++) +{ + $row=@mysqli_fetch_array($res); + $instance=$row[instanceNo]+0; + $pos=$index_mirror[$instance][Index]; + $linkset[$index][Title]=$row[initValue]; +} + +$tmpwhere=getLevel($linkset_status_oid); +$from=$current_page_no * $maxRowPerPage; +$sql="select * from $mtp3_param_table where $tmpwhere order by instanceNo LIMIT $from, $maxRowPerPage "; +$res=@mysqli_query($objDbConn,$sql); +$num=mysqli_num_rows($res); + +for($index=0;$index < $num;$index++) +{ + $row=@mysqli_fetch_array($res); + $instance=$row[instanceNo]+0; + $pos=$index_mirror[$instance][Index]; + //$linkset[$index][Status]=$row[initValue]+0; + $linkset[$index][Status]=$statusSet[LinkSetStatus][$instance]+0; +} + +$status_value=array(0=>"N",1=>"Y",2=>"I",3=>"--"); +$status_color=array(0=>"#ff0000",1=>"#0000ff",2=>"#cecece",3=>"#000000"); +for($index=0;$index<$linksetCount;$index++) +{ + if(strlen($linkset[$index][Title])>0) + $value=$linkset[$index][Instance]."[".$linkset[$index][Title]."]"; + else + $value=$linkset[$index][Instance]; + $response.="obj".$field_sep."ls_title_id_{$index}".$field_sep.$value.$field_sep."#000000".$line_sep; + + $value=$linkset[$index][Status]+0; + $response.="obj".$field_sep."ls_status_id_{$index}".$field_sep.$status_value[$value].$field_sep.$status_color[$value].$line_sep; +} + +//get link status +//echo "AAA=$link_lsID_oid
      "; +$tmpwhere=getLevel($link_lsID_oid); +$from=$current_page_no * $maxRowPerPage; +$sql="select * from $mtp3_param_table where $tmpwhere $linkset_id_cond order by instanceNo asc "; +//echo "SSSSS=$sql
      "; +$res=@mysqli_query($objDbConn,$sql); +$num=mysqli_num_rows($res); + +for($index=0;$index<$num;$index++) +{ + $row=@mysqli_fetch_array($res); + $ls_instance=$row[initValue]+0; + $lk_instance=$row[instanceNo]+0; + $ls_index=$index_mirror[$ls_instance][Index]; + $lk_index=$linkset[$ls_index][LinkIndex]; + + $lkInfo=getLinkInfo($mtp3_param_table,$link_title_oid,$link_status_oid,$lk_instance); + + $value=$lk_instance; + //$color=$status_color[$lkInfo[Status]]; + $color=$status_color[$statusSet[LinkStatus][$lk_instance]]; + $response.="obj".$field_sep."lk_status_id_{$ls_index}_{$lk_index}".$field_sep."{$value}".$field_sep."{$color}".$line_sep; + + //$response.="title".$field_sep."lk_title_id_{$ls_index}_{$lk_index}".$field_sep."{$lkInfo[Title]}".$line_sep; + + + $linkset[$ls_index][LinkIndex]++; +} + +for($index=0;$index<$num;$index++) +{ + for($j=$linkset[$index][LinkIndex];$j<$maxRowPerPage;$j++) + { + $response.="obj".$field_sep."lk_status_id_{$index}_{$j}".$field_sep."--".$field_sep."#000000".$line_sep; + //$response.="obj".$field_sep."lk_status_id_{$index}_{$j}".$field_sep."--".$line_sep; + } +} + +$response=substr($response,0,strlen($response)-1); +//system("date >> /tmp/test.txt"); +echo $response; + + + +?> + \ No newline at end of file diff --git a/wxc2_omc/fault/linksetStatus/linksetStatus_show.php b/wxc2_omc/fault/linksetStatus/linksetStatus_show.php new file mode 100755 index 0000000..06bc344 --- /dev/null +++ b/wxc2_omc/fault/linksetStatus/linksetStatus_show.php @@ -0,0 +1,195 @@ + + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo "
      "; + echo "Status > NSS > LinkSet"; + echo ""; + $helpId="1.2.4"; + showHelp($helpId); + echo "
      "; + + echo ""; + echo ""; + echo "$strClear"; + echo "
      "; + +adjust_title_tail(); +adjust_content_head(); + + //echo "
      Linkset Status

      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + for($i=0;$i<$maxRowPerPage;$i++) + { + echo ""; + echo ""; + echo ""; + for($j=0;$j<16;$j++) + { + echo ""; + } + + echo ""; + } + echo "
      Linkset Status
      NameStatusLinks Status
      ------
      "; + echo "--"; + echo ""; + echo "--"; + echo ""; + echo "--"; + echo "
      "; + echo "Remarks: Y = Available, N = Unavailable, I = Inhibited."; + + echo ""; + echo ""; + + + + echo ""; + +adjust_content_tail(); +?> + + + diff --git a/wxc2_omc/fault/networkStatus/dragElement.php b/wxc2_omc/fault/networkStatus/dragElement.php new file mode 100755 index 0000000..add181a --- /dev/null +++ b/wxc2_omc/fault/networkStatus/dragElement.php @@ -0,0 +1,64 @@ + + diff --git a/wxc2_omc/fault/networkStatus/dragElement_test.php b/wxc2_omc/fault/networkStatus/dragElement_test.php new file mode 100755 index 0000000..b8896be --- /dev/null +++ b/wxc2_omc/fault/networkStatus/dragElement_test.php @@ -0,0 +1,64 @@ + + diff --git a/wxc2_omc/fault/networkStatus/dragTest/dragIE.js b/wxc2_omc/fault/networkStatus/dragTest/dragIE.js new file mode 100755 index 0000000..6f780f9 --- /dev/null +++ b/wxc2_omc/fault/networkStatus/dragTest/dragIE.js @@ -0,0 +1,57 @@ +function beginDrag(elementToDrag,event) +{ + var deltaX=event.clientX-parseInt(elementToDrag.style.left); + var deltaY=event.clientY-parseInt(elementToDrag.style.top); + + if(document.addEventListener) + { + document.addEventListener("mousemove",moveHandler,true); + document.addEventListener("mouseup",upHandler,true); + } + else if(document.attachEvent) + { + document.attachEvent("onmousemove",moveHandler); + document.attachEvent("onmouseup",upHandler); + } + + if(event.stopPropagation) + event.stopPropagation(); + else + event.cancelBubble=true; + + if(event.preventDefault) + event.preventDefault(); + else + event.returnValue=false; + + function moveHandler(e) + { +  if (!e) e=window.event; //如果是IE的事件对象,那么就用window.event +  //全局属性,否则就用DOM二级标准的Event对象。 + elementToDrag.style.left=(event.clientX-deltaX)+"px"; + elementToDrag.style.top=(event.clientY-deltaY)+"px"; + + if(event.stopPropagation) + event.stopPropagation(); + else + event.cancelBubble=true; + } + +function upHandler(e) +{ + if(document.removeEventListener) + { + document.removeEventListener("mouseup",upHandler,true); + document.removeEventListener("mousemove",moveHandler,true); + } + else + { + document.detachEvent("onmouseup",upHandler); + document.detachEvent("onmousemove",moveHandler);} + } + if(event.stopPropagation) + event.stopPropagation(); + else + event.cancelBubble=true; + } + diff --git a/wxc2_omc/fault/networkStatus/dragTest/func.php b/wxc2_omc/fault/networkStatus/dragTest/func.php new file mode 100755 index 0000000..ca1ecb8 --- /dev/null +++ b/wxc2_omc/fault/networkStatus/dragTest/func.php @@ -0,0 +1,72 @@ + + + + diff --git a/wxc2_omc/fault/networkStatus/dragTest/func_other.php b/wxc2_omc/fault/networkStatus/dragTest/func_other.php new file mode 100755 index 0000000..0401187 --- /dev/null +++ b/wxc2_omc/fault/networkStatus/dragTest/func_other.php @@ -0,0 +1,107 @@ + + diff --git a/wxc2_omc/fault/networkStatus/dragTest/func_test.php b/wxc2_omc/fault/networkStatus/dragTest/func_test.php new file mode 100755 index 0000000..0fa201c --- /dev/null +++ b/wxc2_omc/fault/networkStatus/dragTest/func_test.php @@ -0,0 +1,758 @@ + \ No newline at end of file diff --git a/wxc2_omc/fault/networkStatus/dragTest/tes.php b/wxc2_omc/fault/networkStatus/dragTest/tes.php new file mode 100755 index 0000000..b59c129 --- /dev/null +++ b/wxc2_omc/fault/networkStatus/dragTest/tes.php @@ -0,0 +1,14 @@ + +  +  Untitled Page +  +  +  + 

      + 
      +  拖动我          + 
      + 
      + 

      This is a test.Testing,testing

      + 
      +  \ No newline at end of file diff --git a/wxc2_omc/fault/networkStatus/images/Thumbs.db b/wxc2_omc/fault/networkStatus/images/Thumbs.db new file mode 100755 index 0000000..22b4079 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/Thumbs.db differ diff --git a/wxc2_omc/fault/networkStatus/images/bg_bsc_group.jpg b/wxc2_omc/fault/networkStatus/images/bg_bsc_group.jpg new file mode 100755 index 0000000..2c42e18 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/bg_bsc_group.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/bg_bts_group.jpg b/wxc2_omc/fault/networkStatus/images/bg_bts_group.jpg new file mode 100755 index 0000000..d2b4563 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/bg_bts_group.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/bg_csu.jpg b/wxc2_omc/fault/networkStatus/images/bg_csu.jpg new file mode 100755 index 0000000..5cf112c Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/bg_csu.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/bg_shelf.jpg b/wxc2_omc/fault/networkStatus/images/bg_shelf.jpg new file mode 100755 index 0000000..c2e2c76 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/bg_shelf.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/bg_shelf.jpgbak b/wxc2_omc/fault/networkStatus/images/bg_shelf.jpgbak new file mode 100755 index 0000000..bfb74a5 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/bg_shelf.jpgbak differ diff --git a/wxc2_omc/fault/networkStatus/images/bg_shelf_noBss.jpg b/wxc2_omc/fault/networkStatus/images/bg_shelf_noBss.jpg new file mode 100755 index 0000000..0bd3a84 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/bg_shelf_noBss.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/bss.jpg b/wxc2_omc/fault/networkStatus/images/bss.jpg new file mode 100755 index 0000000..f4f6a7b Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/bss.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/circle_gray.gif b/wxc2_omc/fault/networkStatus/images/circle_gray.gif new file mode 100755 index 0000000..7cf16f9 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/circle_gray.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/circle_green.gif b/wxc2_omc/fault/networkStatus/images/circle_green.gif new file mode 100755 index 0000000..56485d8 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/circle_green.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/circle_green_f.gif b/wxc2_omc/fault/networkStatus/images/circle_green_f.gif new file mode 100755 index 0000000..ac3903b Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/circle_green_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/circle_red.gif b/wxc2_omc/fault/networkStatus/images/circle_red.gif new file mode 100755 index 0000000..1cc538e Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/circle_red.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/circle_red_f.gif b/wxc2_omc/fault/networkStatus/images/circle_red_f.gif new file mode 100755 index 0000000..78b643a Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/circle_red_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/circle_yellow.gif b/wxc2_omc/fault/networkStatus/images/circle_yellow.gif new file mode 100755 index 0000000..58bf334 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/circle_yellow.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/circle_yellow_f.gif b/wxc2_omc/fault/networkStatus/images/circle_yellow_f.gif new file mode 100755 index 0000000..38998a5 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/circle_yellow_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/config.gif b/wxc2_omc/fault/networkStatus/images/config.gif new file mode 100755 index 0000000..e389fb3 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/config.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/gray.jpg b/wxc2_omc/fault/networkStatus/images/gray.jpg new file mode 100755 index 0000000..b562360 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/gray.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/green.jpg b/wxc2_omc/fault/networkStatus/images/green.jpg new file mode 100755 index 0000000..bef4b37 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/green.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/hbsc_group.jpg b/wxc2_omc/fault/networkStatus/images/hbsc_group.jpg new file mode 100755 index 0000000..5cf112c Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/hbsc_group.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/hbts_group.jpg b/wxc2_omc/fault/networkStatus/images/hbts_group.jpg new file mode 100755 index 0000000..5c43e98 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/hbts_group.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/help.gif b/wxc2_omc/fault/networkStatus/images/help.gif new file mode 100755 index 0000000..af364b7 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/help.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/link_off.gif b/wxc2_omc/fault/networkStatus/images/link_off.gif new file mode 100755 index 0000000..35f3713 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/link_off.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/link_on.gif b/wxc2_omc/fault/networkStatus/images/link_on.gif new file mode 100755 index 0000000..5254878 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/link_on.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/loading_bar.gif b/wxc2_omc/fault/networkStatus/images/loading_bar.gif new file mode 100755 index 0000000..701297c Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/loading_bar.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/map.jpg b/wxc2_omc/fault/networkStatus/images/map.jpg new file mode 100755 index 0000000..e0f6dd2 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/map.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/map1.jpg b/wxc2_omc/fault/networkStatus/images/map1.jpg new file mode 100755 index 0000000..09f2b04 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/map1.jpg differ diff --git a/wxc2_omc/fault/networkStatus/images/null.gif b/wxc2_omc/fault/networkStatus/images/null.gif new file mode 100755 index 0000000..d0b3242 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/null.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_gray.gif b/wxc2_omc/fault/networkStatus/images/rectangle_gray.gif new file mode 100755 index 0000000..509ff16 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_gray.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_green.gif b/wxc2_omc/fault/networkStatus/images/rectangle_green.gif new file mode 100755 index 0000000..e127b70 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_green.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_green_f.gif b/wxc2_omc/fault/networkStatus/images/rectangle_green_f.gif new file mode 100755 index 0000000..3d39916 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_green_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_red.gif b/wxc2_omc/fault/networkStatus/images/rectangle_red.gif new file mode 100755 index 0000000..a4a6841 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_red.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_red_f.gif b/wxc2_omc/fault/networkStatus/images/rectangle_red_f.gif new file mode 100755 index 0000000..e838218 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_red_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_v_gray.gif b/wxc2_omc/fault/networkStatus/images/rectangle_v_gray.gif new file mode 100755 index 0000000..1d849e1 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_v_gray.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_v_green.gif b/wxc2_omc/fault/networkStatus/images/rectangle_v_green.gif new file mode 100755 index 0000000..fc7749f Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_v_green.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_v_green_f.gif b/wxc2_omc/fault/networkStatus/images/rectangle_v_green_f.gif new file mode 100755 index 0000000..db71cd1 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_v_green_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_v_red.gif b/wxc2_omc/fault/networkStatus/images/rectangle_v_red.gif new file mode 100755 index 0000000..efe1e01 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_v_red.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_v_red_f.gif b/wxc2_omc/fault/networkStatus/images/rectangle_v_red_f.gif new file mode 100755 index 0000000..d922a5a Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_v_red_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_v_yellow.gif b/wxc2_omc/fault/networkStatus/images/rectangle_v_yellow.gif new file mode 100755 index 0000000..6060a69 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_v_yellow.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_v_yellow_f.gif b/wxc2_omc/fault/networkStatus/images/rectangle_v_yellow_f.gif new file mode 100755 index 0000000..1a4c86a Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_v_yellow_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_yellow.gif b/wxc2_omc/fault/networkStatus/images/rectangle_yellow.gif new file mode 100755 index 0000000..ae3f71c Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_yellow.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/rectangle_yellow_f.gif b/wxc2_omc/fault/networkStatus/images/rectangle_yellow_f.gif new file mode 100755 index 0000000..ba978b1 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/rectangle_yellow_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/reset.gif b/wxc2_omc/fault/networkStatus/images/reset.gif new file mode 100755 index 0000000..97767a2 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/reset.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/save.gif b/wxc2_omc/fault/networkStatus/images/save.gif new file mode 100755 index 0000000..28f66e2 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/save.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/speaker_off.gif b/wxc2_omc/fault/networkStatus/images/speaker_off.gif new file mode 100755 index 0000000..8d9afe8 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/speaker_off.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/speaker_on.gif b/wxc2_omc/fault/networkStatus/images/speaker_on.gif new file mode 100755 index 0000000..386efc1 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/speaker_on.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/speaker_on_old.gif b/wxc2_omc/fault/networkStatus/images/speaker_on_old.gif new file mode 100755 index 0000000..fd58f8f Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/speaker_on_old.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/square_gray.gif b/wxc2_omc/fault/networkStatus/images/square_gray.gif new file mode 100755 index 0000000..820533c Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/square_gray.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/square_green.gif b/wxc2_omc/fault/networkStatus/images/square_green.gif new file mode 100755 index 0000000..ee4a01f Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/square_green.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/square_green_f.gif b/wxc2_omc/fault/networkStatus/images/square_green_f.gif new file mode 100755 index 0000000..bb8afe9 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/square_green_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/square_red.gif b/wxc2_omc/fault/networkStatus/images/square_red.gif new file mode 100755 index 0000000..4ffa236 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/square_red.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/square_red_f.gif b/wxc2_omc/fault/networkStatus/images/square_red_f.gif new file mode 100755 index 0000000..688c44a Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/square_red_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/square_yellow.gif b/wxc2_omc/fault/networkStatus/images/square_yellow.gif new file mode 100755 index 0000000..8f822d2 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/square_yellow.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/square_yellow_f.gif b/wxc2_omc/fault/networkStatus/images/square_yellow_f.gif new file mode 100755 index 0000000..1a5dfab Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/square_yellow_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/transparency_square.gif b/wxc2_omc/fault/networkStatus/images/transparency_square.gif new file mode 100755 index 0000000..d0b3242 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/transparency_square.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/triangle_gray.gif b/wxc2_omc/fault/networkStatus/images/triangle_gray.gif new file mode 100755 index 0000000..63a3367 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/triangle_gray.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/triangle_green.gif b/wxc2_omc/fault/networkStatus/images/triangle_green.gif new file mode 100755 index 0000000..ffc442a Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/triangle_green.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/triangle_green_f.gif b/wxc2_omc/fault/networkStatus/images/triangle_green_f.gif new file mode 100755 index 0000000..87cca3e Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/triangle_green_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/triangle_red.gif b/wxc2_omc/fault/networkStatus/images/triangle_red.gif new file mode 100755 index 0000000..a49f51e Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/triangle_red.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/triangle_red_f.gif b/wxc2_omc/fault/networkStatus/images/triangle_red_f.gif new file mode 100755 index 0000000..813b221 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/triangle_red_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/triangle_yellow.gif b/wxc2_omc/fault/networkStatus/images/triangle_yellow.gif new file mode 100755 index 0000000..e7791f0 Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/triangle_yellow.gif differ diff --git a/wxc2_omc/fault/networkStatus/images/triangle_yellow_f.gif b/wxc2_omc/fault/networkStatus/images/triangle_yellow_f.gif new file mode 100755 index 0000000..ac0d27b Binary files /dev/null and b/wxc2_omc/fault/networkStatus/images/triangle_yellow_f.gif differ diff --git a/wxc2_omc/fault/networkStatus/jsgraphics.php b/wxc2_omc/fault/networkStatus/jsgraphics.php new file mode 100755 index 0000000..d1119a8 --- /dev/null +++ b/wxc2_omc/fault/networkStatus/jsgraphics.php @@ -0,0 +1,944 @@ + diff --git a/wxc2_omc/fault/networkStatus/ledxyedit.php b/wxc2_omc/fault/networkStatus/ledxyedit.php new file mode 100755 index 0000000..85a27c9 --- /dev/null +++ b/wxc2_omc/fault/networkStatus/ledxyedit.php @@ -0,0 +1,86 @@ +operator the point of x,y"; +//update sysLedConf set point_x=20 WHERE key_src_page_type = '0' AND key_src_page_num = '20480' AND point_x != '999' and remark like '$likeStr' +$pubDb = "OMC_PUB"; + +if(0)//map +for($i=0; $i<=11; $i++) +{ + if(strlen($i)==1) $ii = '0'.$i; + else $ii = $i; + $likeStr = 'BTS_'.$ii.'%'; + $point_x = 20+$i*60; + + $updSql = "update sysLedConf set point_x=$point_x WHERE key_src_page_type = '0' AND key_src_page_num = '20480' AND point_x != '999' and remark like '$likeStr'"; + echo "
      updSql x = $updSql"; + mysqli_query($pubConn,$updSql); + + //exit; + + $selSql = "select * from sysLedConf where point_x=$point_x AND key_src_page_num = '20480' AND point_x != '999' and remark like '$likeStr' order by key_led_num"; + //echo "
      selSql=$selSql"; + $result = mysqli_query($pubConn,$selSql); + $tmp=0; + while($row = mysqli_fetch_array($result)) { + $keyLedNum = $row[key_led_num]; + if($tmp==0)$num = $keyLedNum; + $poin_y = ($keyLedNum-$num+1)*40+20; + $updSql = "update sysLedConf set point_y=$poin_y where key_led_num=$keyLedNum AND key_src_page_num = '20480' AND point_x != '999' and remark like '$likeStr'"; + //echo "
      $updSql"; + mysqli_query($pubConn,$updSql); + $tmp++; + } +} + +if(0)//BSS-x +{ + $pointArr = array( + array('x' => 263, 'y' => 268), + array('x' => 346, 'y' => 268), + array('x' => 430, 'y' => 268), + array('x' => 514, 'y' => 268), + array('x' => 598, 'y' => 268), + array('x' => 679, 'y' => 268), + + array('x' => 263, 'y' => 455), + array('x' => 346, 'y' => 455), + array('x' => 430, 'y' => 455), + array('x' => 514, 'y' => 455), + array('x' => 598, 'y' => 455), + array('x' => 679, 'y' => 455) + ); + for($i=20577; $i<=20588; $i++){ + $selSql = "SELECT * FROM sysLedConf WHERE key_src_page_type = '2' AND key_src_page_num = '$i' AND point_x != '999' and remark like 'BTS%' ORDER BY key_src_page_type,key_led_num ASC"; + $Result = mysqli_query($pubConn,$selSql); + while($Rows = mysqli_fetch_array($Result)){ + $remark = $Rows[remark]; + $subNo = explode('_',$remark); + $subNo = $subNo[2]; + $subNo -= 0; + //echo "
      $subNo"; + $key_led_num = $Rows[key_led_num]; + $pointX = $pointArr[$subNo][x]; + $pointY = $pointArr[$subNo][y]; + $updSql = "update sysLedConf set point_x=$pointX,point_y=$pointY WHERE key_src_page_type = '2' AND key_src_page_num = '$i' AND point_x != '999' and remark like 'BTS%' and key_led_num=$key_led_num"; + echo "
      $updSql"; + mysqli_query($pubConn,$updSql); + } + } + + for($i=20577; $i<=20588; $i++){ + $selSql = "SELECT * FROM sysLedConf WHERE key_src_page_type = '2' AND key_src_page_num = '$i' AND point_x != '999' and remark like 'BSC%' ORDER BY key_src_page_type,key_led_num ASC"; + $Result = mysqli_query($pubConn,$selSql); + $Rows = mysqli_fetch_array($Result); + + $key_led_num = $Rows[key_led_num]; + $pointX = 37; + $pointY = 454; + $updSql = "update sysLedConf set point_x=$pointX,point_y=$pointY WHERE key_src_page_type = '2' AND key_src_page_num = '$i' AND point_x != '999' and remark like 'BSC%' and key_led_num=$key_led_num"; + echo "
      $updSql"; + mysqli_query($pubConn,$updSql); + } +} + +?> \ No newline at end of file diff --git a/wxc2_omc/fault/networkStatus/mapStatus.php b/wxc2_omc/fault/networkStatus/mapStatus.php new file mode 100755 index 0000000..bc1a44f --- /dev/null +++ b/wxc2_omc/fault/networkStatus/mapStatus.php @@ -0,0 +1,473 @@ +"; + $helpId="1.1"; + showHelp($helpId); + echo "
      "; + +} + + + + +$tmpSql = "SELECT existFlag From elementExistConf WHERE elementName='BSS'"; + global $pubConn; + +if($DEBUG) + echo "
      tmpSql=$tmpSql"; +$tmpResult=mysqli_query($pubConn,$tmpSql); +echo mysqli_error($pubConn); +$tmpRows=mysqli_fetch_array('$tmpResult'); + +$bssExistFlag=$tmpRows['existFlag']; + +if($bssExistFlag==1) + $showingTypeDefine=array( + array('needDragElement'=>'1','typeOffset'=>'20480','maxPageNum'=>'1','maxLedNum'=>'512','bg_img'=>'map.jpg','title'=>'MAP'), + array('needDragElement'=>'0','typeOffset'=>'20489','maxPageNum'=>'1','maxLedNum'=>'512','bg_img'=>'bg_shelf.jpg','title'=>'Central Office'), + array('needDragElement'=>'0','typeOffset'=>'20577','maxPageNum'=>'12','maxLedNum'=>'512','bg_img'=>'bss.jpg','title'=>'BSS') + ); +else + $showingTypeDefine=array( + array('needDragElement'=>'1','typeOffset'=>'20480','maxPageNum'=>'1','maxLedNum'=>'512','bg_img'=>'map.jpg','title'=>'MAP'), + array('needDragElement'=>'0','typeOffset'=>'20489','maxPageNum'=>'1','maxLedNum'=>'512','bg_img'=>'bg_shelf_noBss.jpg','title'=>'Central Office'), + array('needDragElement'=>'0','typeOffset'=>'20577','maxPageNum'=>'12','maxLedNum'=>'512','bg_img'=>'bss.jpg','title'=>'BSS') + ); + +if(!isset($pageNum)||strlen($pageNum)<=0) + $pageNum=0; +if(!isset($showingPageType)||strlen($showingPageType)<=0) + $showingPageType=0; +if($bssExistFlag==0) + $showingPageType=1; + +$needDragElement=$showingTypeDefine[$showingPageType]['needDragElement']; +$typeOffset =$showingTypeDefine[$showingPageType]['typeOffset']; +$maxPageNum =$showingTypeDefine[$showingPageType]['maxPageNum']; +$maxLedNum =$showingTypeDefine[$showingPageType]['maxLedNum']; +$bg_img =$showingTypeDefine[$showingPageType]['bg_img']; + +if($DEBUG) +{ + echo "
      showingPageType=$showingPageType"; + echo "
      needDragElement=$needDragElement"; + echo "
      typeOffset=$typeOffset"; + echo "
      pageNum=$pageNum"; + echo "
      maxPageNum=$maxPageNum"; + echo "
      maxLedNum=$maxLedNum"; + echo "
      bg_img=$bg_img"; +} + +echo ""; + +if($needDragElement==1){ + require("./dragElement.php"); + require("./jsgraphics.php"); +} +?> + + + + +"; + //echo "led_num:$led_num
      "; + global $NotShowLED,$divideNumber; + $status_num = $NotShowLED; + + $offset = 0; + if($led_num < $divideNumber){ + $offset = ($led_num % 16)*2; + }else{ + $offset = 0; + } + if($DEBUG) + echo "
      led_num=$led_num,status_str=$status_str,offset=$offset"; + $status_num = substr($status_str,$offset,2); + if($DEBUG) + echo "
      status_num=$status_num"; + + if($status_num >=0 && $status_num <=$NotShowLED){ + return($status_num&0x07); + }else{ + return($NotShowLED); + } +} +?> + +"; + echo "
      updateSql=$updateSql"; + echo ""; + } + mysqli_query($pubConn,$updateSql); +} +?> + += 0 && T2.key_led_num < $divideNumber,floor(T1.sync_from_led/16) = T2.key_led_num,T1.sync_from_led = T2.key_led_num) + ) + AND T1.key_src_page_type ='$showingPageType' + AND T1.key_src_page_num = '$pageIndex' + AND T2.key_status != '15151515151515151515151515151515' + "; +else + $selSql = "SELECT T1.key_led_num,T2.key_status,T1.point_x,T1.point_y,T1.shape,T1.remark,T1.dst_page_type,T1.dst_page_num + FROM $ledConfTable AS T1,$ledStatTable AS T2 + WHERE ( + if(T1.sync_from_led < 0 && T2.key_led_num < $divideNumber,floor(T1.key_led_num/16) = T2.key_led_num,T1.key_led_num = T2.key_led_num) + OR + if(T1.sync_from_led >= 0 && T2.key_led_num < $divideNumber,floor(T1.sync_from_led/16) = T2.key_led_num,T1.sync_from_led = T2.key_led_num) + ) + AND T1.key_src_page_type ='$showingPageType' + AND T1.key_src_page_num = '$pageIndex' + AND T2.key_status != '15151515151515151515151515151515' + AND (T1.key_led_num <='20576' OR T1.key_led_num >='20589') + "; + +if($DEBUG) + echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$i = 0; +while($selRows=mysqli_fetch_array($selResult)) +{ + $key_led_num_Arr[$i] = $selRows['key_led_num']; + $X_Arr[$i] = $selRows['point_x']; + $Y_Arr[$i] = $selRows['point_y']; + $status[$i] = getLedStatus($selRows['key_status'],$selRows['key_led_num']); + + if(strchr($selRows['remark'],":")){ + $tmpRemarkArr = explode(":",$selRows['remark']); + $remark[$i] = $tmpRemarkArr[1]; + }else + $remark[$i] = $selRows['remark']; + + $dst_page_type[$i] = $selRows['dst_page_type']; + $dst_page_num[$i] = $selRows['dst_page_num']; + $shape[$i] = $selRows['shape']; + $type[$i] = $selRows['type']; + + if($key_led_num_Arr[$i]==20489){ + $cntrlLed_X=$X_Arr[$i]; + $cntrlLed_Y=$Y_Arr[$i]; + } + + /* + $tmpX=$selRows[point_x]+10; + $tmpY=$selRows[point_y]+60; + + $updateSql="UPDATE $ledConfTable SET point_x='$tmpX',point_Y='$tmpY' where key_led_num='$key_led_num_Arr[$i]'"; + // echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + */ + if($DEBUG) + { + echo "

      key_led_num_Arr[$i]=$key_led_num_Arr[$i]"; + echo "
      X_Arr[$i]=$X_Arr[$i]"; + echo "
      Y_Arr[$i]=$Y_Arr[$i]"; + echo "
      type[$i]=$type[$i]"; + echo "
      status[$i]=$status[$i]"; + echo "
      remark[$i]=$remark[$i]"; + echo "
      dst_page_num[$i]=$dst_page_num[$i]"; + } + $i++; +} +$ledNum = $i; +?> + + + +"; +echo ""; +echo ""; +echo ""; +echo "Status > "; + +for($i=0;$i{$showingTypeDefine[$i]['title']}"; + + if($showingTypeDefine[$i]['title']=='BSS'&&$showingTypeDefine[$showingPageType]['title']=='BSS'){ + if($pageNum>0){ + $tmpPageNum=$pageNum-1; + echo "<"; + }else{ + echo "<"; + } + echo " $pageNum "; + + if($pageNum<11){ + $tmpPageNum=$pageNum+1; + echo ">"; + }else{ + echo ">"; + } + } + echo "|"; +} +echo ""; +echo ""; +echo ""; +echo ""; + +//display all led status +$totalImgY=0; +for($j=0;$jstatus = $status[$j]
      "; + switch($status[$j]){ + case $nLedOk: + $tmpImage="./images/".$shapeArr[$shape[$j]]."_green"; + break; + case $nLedWarn: + $tmpImage="./images/".$shapeArr[$shape[$j]]."_yellow"; + break; + case $nLedError: + $tmpImage="./images/".$shapeArr[$shape[$j]]."_red"; + break; + case $nLedNoUsed: + $tmpImage="./images/".$shapeArr[$shape[$j]]."_gray"; + break; + default : + $continueFlag=1; + //$tmpImage="./images/".$shapeArr[$shape[$j]]."_gray"; + break; + } + + if($continueFlag==1){ + $ledNum--; + $continueFlag=0; + continue; + } + + $tmpImage = $tmpImage.$suffixArr[0]; + $tmpId='statusLed_'.$key_led_num_Arr[$j]; + + echo "\n
      "; + if($needDragElement){ + echo "\n
      "; + echo ""; + echo "\n
      "; + + $tmpPageNum=$dst_page_num[$j]-$showingTypeDefine[$dst_page_type[$j]]['typeOffset']; + + if($dst_page_type[$j] >= $htmlPageType){ + $linkURL=$routerURL."page_type=$dst_page_type[$j]&page_num=$dst_page_num[$j]&src_page_type=$showingPageType&src_page_num=$pageNum"; + if($DEBUG) + echo "
      linkURL=$linkURL"; + echo "$remark[$j]"; + }else{ + $i=$dst_page_type[$j]; + echo "$remark[$j]"; + } + }else{ + $tmpPageNum=$dst_page_num[$j]-$showingTypeDefine[$dst_page_type[$j]]['typeOffset']; + if($dst_page_type[$j] >= $htmlPageType){ + $linkURL=$routerURL."page_type=$dst_page_type[$j]&page_num=$dst_page_num[$j]&src_page_type=$showingPageType&src_page_num=$pageNum"; + if($DEBUG) + echo "
      linkURL=$linkURL"; + echo ""; + if($key_led_num_Arr[$j]>=20577)// BSC or BTS, need display the remark + echo "
      $remark[$j]"; + }else{ + //echo "
      page_num[$j]=$dst_page_num[$j]"; + //echo "
      Define[$dst_page_type[$j]][tO]={$showingTypeDefine[$dst_page_type[$j]][typeOffset]}"; + $i=$dst_page_type[$j]; + echo ""; + if($key_led_num_Arr[$j]>=20577)// BSC or BTS, need display the remark + echo "
      $remark[$j]"; + + + } + } + echo "\n
      "; + if(0)//锟斤拷锟轿伙拷锟斤拷 + if($key_led_num_Arr!=20489){ + echo "\n\n"; + } +} + +echo ""; +?> + + + + diff --git a/wxc2_omc/fault/networkStatus/mapStatusServer.php b/wxc2_omc/fault/networkStatus/mapStatusServer.php new file mode 100755 index 0000000..abfb2f6 --- /dev/null +++ b/wxc2_omc/fault/networkStatus/mapStatusServer.php @@ -0,0 +1,134 @@ +tmpSql=$tmpSql"; +$tmpResult=mysqli_query($pubConn,$tmpSql); +echo mysqli_error($pubConn); +$tmpRows=mysqli_fetch_array($tmpResult); + +$bssExistFlag=$tmpRows['existFlag']; + +$dbName='OMC_PUB'; +$ledConfTable='sysLedConf'; +$ledStatTable='sysLedStat'; + +$nLedNoUsed ='00'; +$nLedOk ='01'; +$nLedWarn ='02'; +$nLedError ='03'; +$nLedAlarm ='04'; +$NotShowLED ='15'; +$shapeArr=array("circle","square","rectangle","triangle","rectangle_v","star"); +$suffixArr=array(".gif","_f.gif"); +$divideNumber='20489'; + +function getLedStatus($status_str,$led_num){ + global $NotShowLED,$divideNumber; + $status_num = $NotShowLED; + + $offset = 0; + if($led_num < $divideNumber){ + $offset = ($led_num % 16)*2; + }else{ + $offset = 0; + } + if($DEBUG) + echo "
      led_num=$led_num,status_str=$status_str,offset=$offset"; + $status_num = substr($status_str,$offset,2); + if($DEBUG) + echo "
      status_num=$status_num"; + + if($status_num >=0 && $status_num <=$NotShowLED){ + return($status_num&0x07); + }else{ + return($NotShowLED); + } +} + +$pageIndex=$typeOffset+$pageNum; +if($bssExistFlag==1) + $selSql = "SELECT T1.key_led_num,T2.key_status,T1.point_x,T1.point_y,T1.shape,T1.remark,T1.dst_page_type,T1.dst_page_num + FROM $ledConfTable AS T1,$ledStatTable AS T2 + WHERE ( + if(T1.sync_from_led < 0 && T2.key_led_num < $divideNumber,floor(T1.key_led_num/16) = T2.key_led_num,T1.key_led_num = T2.key_led_num) + OR + if(T1.sync_from_led >= 0 && T2.key_led_num < $divideNumber,floor(T1.sync_from_led/16) = T2.key_led_num,T1.sync_from_led = T2.key_led_num) + ) + AND T1.key_src_page_type ='$showingPageType' + AND T1.key_src_page_num = '$pageIndex' + AND T2.key_status != '15151515151515151515151515151515' + "; +else + $selSql = "SELECT T1.key_led_num,T2.key_status,T1.point_x,T1.point_y,T1.shape,T1.remark,T1.dst_page_type,T1.dst_page_num + FROM $ledConfTable AS T1,$ledStatTable AS T2 + WHERE ( + if(T1.sync_from_led < 0 && T2.key_led_num < $divideNumber,floor(T1.key_led_num/16) = T2.key_led_num,T1.key_led_num = T2.key_led_num) + OR + if(T1.sync_from_led >= 0 && T2.key_led_num < $divideNumber,floor(T1.sync_from_led/16) = T2.key_led_num,T1.sync_from_led = T2.key_led_num) + ) + AND T1.key_src_page_type ='$showingPageType' + AND T1.key_src_page_num = '$pageIndex' + AND T2.key_status != '15151515151515151515151515151515' + AND (T1.key_led_num <='20576' OR T1.key_led_num >='20589') + "; +if($DEBUG) + echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$selRows=mysqli_fetch_array($selResult); +do{ + + //echo "
      selRows[key_status]"; + $tmpStatus=getLedStatus($selRows['key_status'],$selRows['key_led_num']); + switch($tmpStatus){ + case $nLedOk: + $tmpImage="./images/".$shapeArr[$selRows['shape']]."_green"; + break; + case $nLedWarn: + $tmpImage="./images/".$shapeArr[$selRows['shape']]."_yellow"; + break; + case $nLedError: + $tmpImage="./images/".$shapeArr[$selRows['shape']]."_red"; + break; + case $nLedNoUsed: + $tmpImage="./images/".$shapeArr[$selRows['shape']]."_gray"; + break; + default : + $continueFlag=1; + //$tmpImage="./images/".$shapeArr[$shape[$j]]."_gray"; + break; + } + + if($continueFlag==1){ + $continueFlag=0; + continue; + } + + $tmpImage = $tmpImage.$suffixArr[0]; + + echo "$tmpImage"; + echo "@@@"; +}while($selRows=mysqli_fetch_array($selResult)); +?> + + + + diff --git a/wxc2_omc/fault/networkStatus/mapStatus_test.php b/wxc2_omc/fault/networkStatus/mapStatus_test.php new file mode 100755 index 0000000..846e76b --- /dev/null +++ b/wxc2_omc/fault/networkStatus/mapStatus_test.php @@ -0,0 +1,375 @@ +'1','typeOffset'=>'20480','maxPageNum'=>'1','maxLedNum'=>'512','bg_img'=>'map.jpg','title'=>'MAP'), + array('needDragElement'=>'1','typeOffset'=>'20489','maxPageNum'=>'1','maxLedNum'=>'512','bg_img'=>'bg_shelf.jpg','title'=>'Central Office'), + array('needDragElement'=>'1','typeOffset'=>'20577','maxPageNum'=>'12','maxLedNum'=>'512','bg_img'=>'bss.jpg','title'=>'BSS') + ); + +if(!isset($pageNum)||strlen($pageNum)<=0) + $pageNum=0; +if(!isset($showingPageType)||strlen($showingPageType)<=0) + $showingPageType=0; + +$needDragElement=$showingTypeDefine[$showingPageType][needDragElement]; +$typeOffset =$showingTypeDefine[$showingPageType][typeOffset]; +$maxPageNum =$showingTypeDefine[$showingPageType][maxPageNum]; +$maxLedNum =$showingTypeDefine[$showingPageType][maxLedNum]; +$bg_img =$showingTypeDefine[$showingPageType][bg_img]; + +if($DEBUG) +{ + echo "
      showingPageType=$showingPageType"; + echo "
      needDragElement=$needDragElement"; + echo "
      typeOffset=$typeOffset"; + echo "
      pageNum=$pageNum"; + echo "
      maxPageNum=$maxPageNum"; + echo "
      maxLedNum=$maxLedNum"; + echo "
      bg_img=$bg_img"; +} + +echo ""; + +if($needDragElement==1) + require("./dragElement_test.php"); +?> + + + + +led_num=$led_num,status_str=$status_str,offset=$offset"; + $status_num = substr($status_str,$offset,2); + if($DEBUG) + echo "
      status_num=$status_num"; + + if($status_num >=0 && $status_num <=$NotShowLED){ + return($status_num&0x07); + }else{ + return($NotShowLED); + } +} +?> + +"; + echo "
      updateSql=$updateSql"; + echo ""; + } + mysqli_query($pubConn,$updateSql); +} +?> + += 0 && T2.key_led_num < $divideNumber,floor(T1.sync_from_led/16) = T2.key_led_num,T1.sync_from_led = T2.key_led_num) + ) + AND T1.key_src_page_type ='$showingPageType' + AND T1.key_src_page_num = '$pageIndex' + "; +if($DEBUG) + echo "
      selSql=$selSql"; +$selResult=mysqli_query($pubConn,$selSql); +echo mysqli_error($pubConn); +$i = 0; +while($selRows=mysqli_fetch_array($selResult)) +{ + $key_led_num_Arr[$i] = $selRows[key_led_num]; + $X_Arr[$i] = $selRows[point_x]; + $Y_Arr[$i] = $selRows[point_y]; + $status[$i] = getLedStatus($selRows[key_status],$selRows[key_led_num]); + if(strchr($selRows[remark],":")){ + $tmpRemarkArr = explode(":",$selRows[remark]); + $remark[$i] = $tmpRemarkArr[1]; + }else + $remark[$i] = $selRows[remark]; + $dst_page_type[$i] = $selRows[dst_page_type]; + $dst_page_num[$i] = $selRows[dst_page_num]; + $shape[$i] = $selRows[shape]; + $type[$i] = $selRows[type]; + + /* + $tmpX=$selRows[point_x]+10; + $tmpY=$selRows[point_y]+60; + + $updateSql="UPDATE $ledConfTable SET point_x='$tmpX',point_Y='$tmpY' where key_led_num='$key_led_num_Arr[$i]'"; + // echo "
      updateSql=$updateSql"; + mysqli_query($pubConn,$updateSql); + */ + if($DEBUG) + { + echo "
      key_led_num_Arr[$i]=$key_led_num_Arr[$i]"; + echo "
      X_Arr[$i]=$X_Arr[$i]"; + echo "
      Y_Arr[$i]=$Y_Arr[$i]"; + echo "
      type[$i]=$type[$i]"; + echo "
      status[$i]=$status[$i]"; + echo "
      remark[$i]=$remark[$i]"; + } + $i++; +} +$ledNum = $i; +?> + + + +"; +echo ""; +echo ""; +echo ""; +echo "Status > "; +for($i=0;$i{$showingTypeDefine[$i][title]}"; + + if($showingTypeDefine[$i][title]=='BSS'&&$showingTypeDefine[$showingPageType][title]=='BSS'){ + if($pageNum>0){ + $tmpPageNum=$pageNum-1; + echo "<"; + }else{ + echo "<"; + } + echo " $pageNum "; + + if($pageNum<11){ + $tmpPageNum=$pageNum+1; + echo ">"; + }else{ + echo ">"; + } + } + echo "|"; +} +echo ""; +echo ""; +echo ""; +echo ""; + +//display all led status +$totalImgY=0; +for($j=0;$jstatus = $status[$j]
      "; + switch($status[$j]){ + case $nLedOk: + $tmpImage="./images/".$shapeArr[$shape[$j]]."_green"; + break; + case $nLedWarn: + $tmpImage="./images/".$shapeArr[$shape[$j]]."_yellow"; + break; + case $nLedError: + $tmpImage="./images/".$shapeArr[$shape[$j]]."_red"; + break; + case $nLedNoUsed: + $tmpImage="./images/".$shapeArr[$shape[$j]]."_gray"; + break; + default : + + $tmpImage="./images/".$shapeArr[$shape[$j]]."_gray"; + break; + } + + if($continueFlag==1){ + $ledNum--; + $continueFlag=0; + continue; + } + + $tmpImage = $tmpImage.$suffixArr[0]; + $tmpId='statusLed_'.$key_led_num_Arr[$j]; + + echo "\n
      "; + if($needDragElement){ + echo "\n
      "; + echo ""; + echo "\n
      "; + + $tmpPageNum=$dst_page_num[$j]-$showingTypeDefine[$dst_page_type[$j]][typeOffset]; + + if($dst_page_type[$j] >= $htmlPageType){ + $linkURL=$routerURL."page_type=$dst_page_type[$j]&page_num=$dst_page_num[$j]&src_page_type=$showingPageType&src_page_num=$pageNum"; + if($DEBUG) + echo "
      linkURL=$linkURL"; + echo "$remark[$j]"; + }else{ + $i=$dst_page_type[$j]; + echo "$remark[$j]"; + } + }else{ + $tmpPageNum=$dst_page_num[$j]-$showingTypeDefine[$dst_page_type[$j]][typeOffset]; + if($dst_page_type[$j] >= $htmlPageType){ + $linkURL=$routerURL."page_type=$dst_page_type[$j]&page_num=$dst_page_num[$j]&src_page_type=$showingPageType&src_page_num=$pageNum"; + if($DEBUG) + echo "
      linkURL=$linkURL"; + echo ""; + }else{ + $i=$dst_page_type[$j]; + echo ""; + } + } + echo "\n
      "; +} + +echo ""; +?> + + diff --git a/wxc2_omc/fault/networkStatus/status_router.php b/wxc2_omc/fault/networkStatus/status_router.php new file mode 100755 index 0000000..7a3872c --- /dev/null +++ b/wxc2_omc/fault/networkStatus/status_router.php @@ -0,0 +1,106 @@ +page_type = $page_type , page_num = $page_num"; +$page_num = omc_keep_length($page_num,0,4); +if($DEBUG) echo "
      page_type = $page_type page_num = $page_num"; +$sys_code = $page_type - 50; +$sys_type = omc_sys_code2type($sys_code); +$sys_num = substr($page_num,0,2)+0; +$subsys_num = substr($page_num,2,2)+0; +$sys_id = $sys_type.'_'.$sys_num.'_'.$subsys_num; +$sys_id_2 = $sys_type.'_'.$sys_num; + +switch($sys_type){ + case '8KE1': + $page_url = "../../fault/csuStatus/csuStatus_frame.php"; + break; + case 'CCF(MSC)': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'MSC': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'VPS': + $page_url = "../../fault/perStatus/devStatus.php"; + break; + case 'PCR': + $page_url = "../../fault/perStatus/devStatus.php"; + break; + case 'PCRK': + $page_url = "../../fault/perStatus/devStatus.php"; + break; + case 'PCR8': + $page_url = "../../fault/perStatus/devStatus.php"; + break; + case 'CNF': + $page_url = "../../fault/perStatus/devStatus.php"; + break; + case 'CNFC': + $page_url = "../../fault/perStatus/devStatus.php"; + break; + case 'IWF': + $page_url = "../../fault/perStatus/devStatus.php"; + break; + case 'OMC': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'HLR': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'AUC': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'EIR': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'PPS': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'SMSC': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'VLR': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'VSS': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'VAS': + $page_url = "../../fault/serverStatus/serverStatus.php"; + break; + case 'BSC': + $page_url = "../../fault/bssStatus/bscStatus.php?src_page_type=$src_page_type&src_page_num=$src_page_num"; + break; + case 'BTS': + $page_url = "../../fault/bssStatus/btsStatus.php?src_page_type=$src_page_type&src_page_num=$src_page_num"; + break; + case 'PWR': + $page_url = "../../fault/csuStatus/csuStatus.php"; + break; + default: + echo "Can't find this system's define!please check it:$sys_id"; + exit(); +} +if($DEBUG) echo "
      $page_url"; +if($DEBUG) exit(); +echo ""; +exit(); +?> diff --git a/wxc2_omc/fault/networkStatus/wz_jsgraphics.js b/wxc2_omc/fault/networkStatus/wz_jsgraphics.js new file mode 100755 index 0000000..652add4 --- /dev/null +++ b/wxc2_omc/fault/networkStatus/wz_jsgraphics.js @@ -0,0 +1,943 @@ +/* This notice must be untouched at all times. + +wz_jsgraphics.js v. 2.36 +The latest version is available at +http://www.walterzorn.com +or http://www.devira.com +or http://www.walterzorn.de + +Copyright (c) 2002-2004 Walter Zorn. All rights reserved. +Created 3. 11. 2002 by Walter Zorn (Web: http://www.walterzorn.com ) +Last modified: 21. 6. 2006 + +Performance optimizations for Internet Explorer +by Thomas Frank and John Holdsworth. +fillPolygon method implemented by Matthieu Haller. + +High Performance JavaScript Graphics Library. +Provides methods +- to draw lines, rectangles, ellipses, polygons + with specifiable line thickness, +- to fill rectangles and ellipses +- to draw text. +NOTE: Operations, functions and branching have rather been optimized +to efficiency and speed than to shortness of source code. + +LICENSE: LGPL + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License (LGPL) as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA, +or see http://www.gnu.org/copyleft/lesser.html +*/ + + +var jg_ihtm, jg_ie, jg_fast, jg_dom, jg_moz, +jg_n4 = (document.layers && typeof document.classes != "undefined"); + + +function chkDHTM(x, i) +{ + x = document.body || null; + jg_ie = x && typeof x.insertAdjacentHTML != "undefined"; + jg_dom = (x && !jg_ie && + typeof x.appendChild != "undefined" && + typeof document.createRange != "undefined" && + typeof (i = document.createRange()).setStartBefore != "undefined" && + typeof i.createContextualFragment != "undefined"); + jg_ihtm = !jg_ie && !jg_dom && x && typeof x.innerHTML != "undefined"; + jg_fast = jg_ie && document.all && !window.opera; + jg_moz = jg_dom && typeof x.style.MozOpacity != "undefined"; +} + + +function pntDoc() +{ + this.wnd.document.write(jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvDom() +{ + var x = this.wnd.document.createRange(); + x.setStartBefore(this.cnv); + x = x.createContextualFragment(jg_fast? this.htmRpc() : this.htm); + if(this.cnv) this.cnv.appendChild(x); + this.htm = ''; +} + + +function pntCnvIe() +{ + if(this.cnv) this.cnv.insertAdjacentHTML("BeforeEnd", jg_fast? this.htmRpc() : this.htm); + this.htm = ''; +} + + +function pntCnvIhtm() +{ + if(this.cnv) this.cnv.innerHTML += this.htm; + this.htm = ''; +} + + +function pntCnv() +{ + this.htm = ''; +} + + +function mkDiv(x, y, w, h) +{ + this.htm += '
      <\/div>'; +} + + +function mkDivIe(x, y, w, h) +{ + this.htm += '%%'+this.color+';'+x+';'+y+';'+w+';'+h+';'; +} + + +function mkDivPrt(x, y, w, h) +{ + this.htm += '
      <\/div>'; +} + + +function mkLyr(x, y, w, h) +{ + this.htm += '<\/layer>\n'; +} + + +var regex = /%%([^;]+);([^;]+);([^;]+);([^;]+);([^;]+);/g; +function htmRpc() +{ + return this.htm.replace( + regex, + '
      \n'); +} + + +function htmPrtRpc() +{ + return this.htm.replace( + regex, + '
      \n'); +} + + +function mkLin(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox, 1); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, 1, oy-y+1); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, 1, oy-y2+1); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, 1, y-oy); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, 1, y2-oy+1); + } + } +} + + +function mkLin2D(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1; + + var s = this.stroke; + if (dx >= dy) + { + if (dx > 0 && s-3 > 0) + { + var _s = (s*dx*Math.sqrt(1+dy*dy/(dx*dx))-dx-(s>>1)*dy) / dx; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.ceil(s/2); + + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx, + ox = x; + while ((dx--) > 0) + { + ++x; + if (p > 0) + { + this.mkDiv(ox, y, x-ox+ad, _s); + y += yIncr; + p += pru; + ox = x; + } + else p += pr; + } + this.mkDiv(ox, y, x2-ox+ad+1, _s); + } + + else + { + if (s-3 > 0) + { + var _s = (s*dy*Math.sqrt(1+dx*dx/(dy*dy))-(s>>1)*dx-dy) / dy; + _s = (!(s-4)? Math.ceil(_s) : Math.round(_s)) + 1; + } + else var _s = s; + var ad = Math.round(s/2); + + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy, + oy = y; + if (y2 <= y1) + { + ++ad; + while ((dy--) > 0) + { + if (p > 0) + { + this.mkDiv(x++, y, _s, oy-y+ad); + y += yIncr; + p += pru; + oy = y; + } + else + { + y += yIncr; + p += pr; + } + } + this.mkDiv(x2, y2, _s, oy-y2+ad); + } + else + { + while ((dy--) > 0) + { + y += yIncr; + if (p > 0) + { + this.mkDiv(x++, oy, _s, y-oy+ad); + p += pru; + oy = y; + } + else p += pr; + } + this.mkDiv(x2, oy, _s, y2-oy+ad+1); + } + } +} + + +function mkLinDott(x1, y1, x2, y2) +{ + if (x1 > x2) + { + var _x2 = x2; + var _y2 = y2; + x2 = x1; + y2 = y1; + x1 = _x2; + y1 = _y2; + } + var dx = x2-x1, dy = Math.abs(y2-y1), + x = x1, y = y1, + yIncr = (y1 > y2)? -1 : 1, + drw = true; + if (dx >= dy) + { + var pr = dy<<1, + pru = pr - (dx<<1), + p = pr-dx; + while ((dx--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + if (p > 0) + { + y += yIncr; + p += pru; + } + else p += pr; + ++x; + } + if (drw) this.mkDiv(x, y, 1, 1); + } + + else + { + var pr = dx<<1, + pru = pr - (dy<<1), + p = pr-dy; + while ((dy--) > 0) + { + if (drw) this.mkDiv(x, y, 1, 1); + drw = !drw; + y += yIncr; + if (p > 0) + { + ++x; + p += pru; + } + else p += pr; + } + if (drw) this.mkDiv(x, y, 1, 1); + } +} + + +function mkOv(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1), + w, h; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + if (w&2 && h&2) + { + this.mkOvQds(cx, cy, -x+2, ox+wod, -oy, oy-1+hod, 1, 1); + this.mkOvQds(cx, cy, -x+1, x-1+wod, -y-1, y+hod, 1, 1); + } + else this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, oy-h+hod, w, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, a-ox+1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, a-ox+1, (oy<<1)+hod); +} + + +function mkOv2D(left, top, width, height) +{ + var s = this.stroke; + width += s-1; + height += s-1; + var a = width>>1, b = height>>1, + wod = width&1, hod = (height&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa = (a*a)<<1, bb = (b*b)<<1, + st = (aa>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa*((b<<1)-1); + + if (s-4 < 0 && (!(s-2) || width-51 > 0 && height-51 > 0)) + { + var ox = 0, oy = b, + w, h, + pxl, pxr, pxt, pxb, pxw; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + w = x-ox; + h = oy-y; + + if (w-1) + { + pxw = w+1+(s&1); + h = s; + } + else if (h-1) + { + pxw = s; + h += 1+(s&1); + } + else pxw = h = s; + this.mkOvQds(cx, cy, -x+1, ox-pxw+w+wod, -oy, -h+oy+hod, pxw, h); + ox = x; + oy = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + } + this.mkDiv(cx-a, cy-oy, s, (oy<<1)+hod); + this.mkDiv(cx+a+wod-s+1, cy-oy, s, (oy<<1)+hod); + } + + else + { + var _a = (width-((s-1)<<1))>>1, + _b = (height-((s-1)<<1))>>1, + _x = 0, _y = _b, + _aa = (_a*_a)<<1, _bb = (_b*_b)<<1, + _st = (_aa>>1)*(1-(_b<<1)) + _bb, + _tt = (_bb>>1) - _aa*((_b<<1)-1), + + pxl = new Array(), + pxt = new Array(), + _pxb = new Array(); + pxl[0] = 0; + pxt[0] = b; + _pxb[0] = _b-1; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - (aa<<1)*(y-1); + tt += (bb<<1)*(++x) - aa*(((y--)<<1)-3); + pxl[pxl.length] = x; + pxt[pxt.length] = y; + } + else + { + tt -= aa*((y<<1)-3); + st -= (aa<<1)*(--y); + } + + if (_y > 0) + { + if (_st < 0) + { + _st += _bb*((_x<<1)+3); + _tt += (_bb<<1)*(++_x); + _pxb[_pxb.length] = _y-1; + } + else if (_tt < 0) + { + _st += _bb*((_x<<1)+3) - (_aa<<1)*(_y-1); + _tt += (_bb<<1)*(++_x) - _aa*(((_y--)<<1)-3); + _pxb[_pxb.length] = _y-1; + } + else + { + _tt -= _aa*((_y<<1)-3); + _st -= (_aa<<1)*(--_y); + _pxb[_pxb.length-1]--; + } + } + } + + var ox = 0, oy = b, + _oy = _pxb[0], + l = pxl.length, + w, h; + for (var i = 0; i < l; i++) + { + if (typeof _pxb[i] != "undefined") + { + if (_pxb[i] < _oy || pxt[i] < oy) + { + x = pxl[i]; + this.mkOvQds(cx, cy, -x+1, ox+wod, -oy, _oy+hod, x-ox, oy-_oy); + ox = x; + oy = pxt[i]; + _oy = _pxb[i]; + } + } + else + { + x = pxl[i]; + this.mkDiv(cx-x+1, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + ox = x; + oy = pxt[i]; + } + } + this.mkDiv(cx-a, cy-oy, 1, (oy<<1)+hod); + this.mkDiv(cx+ox+wod, cy-oy, 1, (oy<<1)+hod); + } +} + + +function mkOvDott(left, top, width, height) +{ + var a = width>>1, b = height>>1, + wod = width&1, hod = height&1, + cx = left+a, cy = top+b, + x = 0, y = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + drw = true; + while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + if (drw) this.mkOvQds(cx, cy, -x, x+wod, -y, y+hod, 1, 1); + drw = !drw; + } +} + + +function mkRect(x, y, w, h) +{ + var s = this.stroke; + this.mkDiv(x, y, w, s); + this.mkDiv(x+w, y, s, h); + this.mkDiv(x, y+h, w+s, s); + this.mkDiv(x, y+s, s, h-s); +} + + +function mkRectDott(x, y, w, h) +{ + this.drawLine(x, y, x+w, y); + this.drawLine(x+w, y, x+w, y+h); + this.drawLine(x, y+h, x+w, y+h); + this.drawLine(x, y, x, y+h); +} + + +function jsgFont() +{ + this.PLAIN = 'font-weight:normal;'; + this.BOLD = 'font-weight:bold;'; + this.ITALIC = 'font-style:italic;'; + this.ITALIC_BOLD = this.ITALIC + this.BOLD; + this.BOLD_ITALIC = this.ITALIC_BOLD; +} +var Font = new jsgFont(); + + +function jsgStroke() +{ + this.DOTTED = -1; +} +var Stroke = new jsgStroke(); + + +function jsGraphics(id, wnd) +{ + this.setColor = new Function('arg', 'this.color = arg.toLowerCase();'); + + this.setStroke = function(x) + { + this.stroke = x; + if (!(x+1)) + { + this.drawLine = mkLinDott; + this.mkOv = mkOvDott; + this.drawRect = mkRectDott; + } + else if (x-1 > 0) + { + this.drawLine = mkLin2D; + this.mkOv = mkOv2D; + this.drawRect = mkRect; + } + else + { + this.drawLine = mkLin; + this.mkOv = mkOv; + this.drawRect = mkRect; + } + }; + + + this.setPrintable = function(arg) + { + this.printable = arg; + if (jg_fast) + { + this.mkDiv = mkDivIe; + this.htmRpc = arg? htmPrtRpc : htmRpc; + } + else this.mkDiv = jg_n4? mkLyr : arg? mkDivPrt : mkDiv; + }; + + + this.setFont = function(fam, sz, sty) + { + this.ftFam = fam; + this.ftSz = sz; + this.ftSty = sty || Font.PLAIN; + }; + + + this.drawPolyline = this.drawPolyLine = function(x, y, s) + { + for (var i=0 ; i>1, b = (h -= 1)>>1, + wod = (w&1)+1, hod = (h&1)+1, + cx = left+a, cy = top+b, + x = 0, y = b, + ox = 0, oy = b, + aa2 = (a*a)<<1, aa4 = aa2<<1, bb = (b*b)<<1, + st = (aa2>>1)*(1-(b<<1)) + bb, + tt = (bb>>1) - aa2*((b<<1)-1), + pxl, dw, dh; + if (w+1) while (y > 0) + { + if (st < 0) + { + st += bb*((x<<1)+3); + tt += (bb<<1)*(++x); + } + else if (tt < 0) + { + st += bb*((x<<1)+3) - aa4*(y-1); + pxl = cx-x; + dw = (x<<1)+wod; + tt += (bb<<1)*(++x) - aa2*(((y--)<<1)-3); + dh = oy-y; + this.mkDiv(pxl, cy-oy, dw, dh); + this.mkDiv(pxl, cy+y+hod, dw, dh); + ox = x; + oy = y; + } + else + { + tt -= aa2*((y<<1)-3); + st -= aa4*(--y); + } + } + this.mkDiv(cx-a, cy-oy, w+1, (oy<<1)+hod); + }; + + +/* fillPolygon method, implemented by Matthieu Haller. +This javascript function is an adaptation of the gdImageFilledPolygon for Walter Zorn lib. +C source of GD 1.8.4 found at http://www.boutell.com/gd/ + +THANKS to Kirsten Schulz for the polygon fixes! + +The intersection finding technique of this code could be improved +by remembering the previous intertersection, and by using the slope. +That could help to adjust intersections to produce a nice +interior_extrema. */ + this.fillPolygon = function(array_x, array_y) + { + var i; + var y; + var miny, maxy; + var x1, y1; + var x2, y2; + var ind1, ind2; + var ints; + + var n = array_x.length; + + if (!n) return; + + + miny = array_y[0]; + maxy = array_y[0]; + for (i = 1; i < n; i++) + { + if (array_y[i] < miny) + miny = array_y[i]; + + if (array_y[i] > maxy) + maxy = array_y[i]; + } + for (y = miny; y <= maxy; y++) + { + var polyInts = new Array(); + ints = 0; + for (i = 0; i < n; i++) + { + if (!i) + { + ind1 = n-1; + ind2 = 0; + } + else + { + ind1 = i-1; + ind2 = i; + } + y1 = array_y[ind1]; + y2 = array_y[ind2]; + if (y1 < y2) + { + x1 = array_x[ind1]; + x2 = array_x[ind2]; + } + else if (y1 > y2) + { + y2 = array_y[ind1]; + y1 = array_y[ind2]; + x2 = array_x[ind1]; + x1 = array_x[ind2]; + } + else continue; + + // modified 11. 2. 2004 Walter Zorn + if ((y >= y1) && (y < y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + + else if ((y == maxy) && (y > y1) && (y <= y2)) + polyInts[ints++] = Math.round((y-y1) * (x2-x1) / (y2-y1) + x1); + } + polyInts.sort(integer_compare); + for (i = 0; i < ints; i+=2) + this.mkDiv(polyInts[i], y, polyInts[i+1]-polyInts[i]+1, 1); + } + }; + + + this.drawString = function(txt, x, y) + { + this.htm += '
      '+ + txt + + '<\/div>'; + }; + + +/* drawStringRect() added by Rick Blommers. +Allows to specify the size of the text rectangle and to align the +text both horizontally (e.g. right) and vertically within that rectangle */ + this.drawStringRect = function(txt, x, y, width, halign) + { + this.htm += '
      '+ + txt + + '<\/div>'; + }; + + + this.drawImage = function(imgSrc, x, y, w, h, a) + { + this.htm += '
      '+ + ''+ + '<\/div>'; + }; + + + this.clear = function() + { + this.htm = ""; + if (this.cnv) this.cnv.innerHTML = this.defhtm; + }; + + + this.mkOvQds = function(cx, cy, xl, xr, yt, yb, w, h) + { + this.mkDiv(xr+cx, yt+cy, w, h); + this.mkDiv(xr+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yb+cy, w, h); + this.mkDiv(xl+cx, yt+cy, w, h); + }; + + this.setStroke(1); + this.setFont('verdana,geneva,helvetica,sans-serif', String.fromCharCode(0x31, 0x32, 0x70, 0x78), Font.PLAIN); + this.color = '#000000'; + this.htm = ''; + this.wnd = wnd || window; + + if (!(jg_ie || jg_dom || jg_ihtm)) chkDHTM(); + if (typeof id != 'string' || !id) this.paint = pntDoc; + else + { + this.cnv = document.all? (this.wnd.document.all[id] || null) + : document.getElementById? (this.wnd.document.getElementById(id) || null) + : null; + this.defhtm = (this.cnv && this.cnv.innerHTML)? this.cnv.innerHTML : ''; + this.paint = jg_dom? pntCnvDom : jg_ie? pntCnvIe : jg_ihtm? pntCnvIhtm : pntCnv; + } + + this.setPrintable(false); +} + + + +function integer_compare(x,y) +{ + return (x < y) ? -1 : ((x > y)*1); +} + diff --git a/wxc2_omc/fault/perStatus/devStatus.php b/wxc2_omc/fault/perStatus/devStatus.php new file mode 100755 index 0000000..24ec6ca --- /dev/null +++ b/wxc2_omc/fault/perStatus/devStatus.php @@ -0,0 +1,970 @@ +delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); +} + +$selSql="SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='120' OR sysTypeNo='130' OR sysTypeNo='140' OR sysTypeNo='160' OR sysTypeNo='280' + "; +if($DEBUG) echo "
      selSql=$selSql"; +$selRes=mysqli_query($pubConn,$selSql); +$selRow=@mysqli_fetch_array($selRes); +echo mysqli_error($pubConn); + +$arrayName=array( + array('num' => '0', 'remark' => $strStatus, 'color' => '#000000'), + array('num' => '1', 'remark' => $strType, 'color' => '#000000'), + array('num' => '2', 'remark' => $strE1InstalledOrNot, 'color' => '#000000'), + array('num' => '3', 'remark' => $strPhysicalLayer, 'color' => '#000000'), + array('num' => '4', 'remark' => $strTransportLayer, 'color' => '#000000'), + array('num' => '5', 'remark' => $strE1CHUse, 'color' => '#000000'), + array('num' => '6', 'remark' => $strCPULoad, 'color' => '#000000'), + array('num' => '7', 'remark' => $strMasterClock, 'color' => '#000000'), + array('num' => '8', 'remark' => $strVersion, 'color' => '#000000') + +); +//begin bit +$typ_bgn = 18; //subsys type +$ver_bgn = 19; //version +$ins_bgn = 20; //e1 installed +$chu_bgn = 21; //E1 CH# in use/local +$cpu_bgn = 22; //cpu loading +$grp_bgn = 23; //group offsest + +//type num +$stat = 0; //status +$type = 1; //subsys type +$enab = 2; //e1 install +$phys = 3; //e1 layer1 +$tran = 4; //e1 layer2 +$chus = 5; //E1 CH# in use/local +$load = 6; //cpu loading +$cloc = 7; //send master clock +$vers = 8; //version +$time = 9; //freshtime + +//subsys type +$arrayType=array( + array('num' => '0', 'remark' => 'SS7', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'ISDN', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'V5', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'R2', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'Static', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'CNF', 'color' => '#0000FF') + +); + +//e1 installed +$arrayInstall=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +//e1 layer1 +$arrayPhysical=array( + array('num' => '0', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '2', 'remark' => '--', 'color' => '#000000') +); + +//e1 layer2 +$arrayTransport=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '2', 'remark' => '--', 'color' => '#000000') +); + +//send master clock +$arrayClock=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + + +//echo canceller status +$arrayCan=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +//lock status +$arrayLock=array( + array('num' => '0', 'remark' => 'INIT', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'SEARCH', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'LOCK', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'CENTER', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'ADJUST', 'color' => '#0000FF'), + array('num' => '5', 'remark' => 'NOREF1', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'NOREF', 'color' => '#0000FF'), + array('num' => '7', 'remark' => 'IDLE', 'color' => '#0000FF') +); + +//master clock +$arrayMaster=array( + array('num' => '0', 'remark' => 'Slave', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Master', 'color' => '#0000FF') +); + +do{ + $no_basic_status=0; + $sysTypeNo = $selRow[sysTypeNo]; + $sysNo = $selRow[sysNo]; + $subSysNo = $selRow[subSysNo]; + + if($sysTypeNo == 120){ + $sysTypeNo = 0; + }elseif($sysTypeNo == 160){ + $sysTypeNo = 1; + }elseif($sysTypeNo == 280){ + $sysTypeNo = 2; + } + + if($selRow) + $showSysArr[$sysTypeNo][$sysNo] = 1; + + if($DEBUG)echo "
      showSysArr[$sysTypeNo][$sysNo]={$showSysArr[$sysTypeNo][$sysNo]}"; + + $hex_mes=$selRow[detailStat]; + if($DEBUG) echo "
      hex_mes=$hex_mes"; + $refresh_time=$selRow[updateTime]; + if($refresh_time>$dueDate){ + $color_refresh_time="#0000FF"; + }else{ + $color_refresh_time="#FF0000"; + $no_basic_status=1; + } + + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$time][value]=$refresh_time; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$time][color]=$color_refresh_time; + if($DEBUG) echo "
      time value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$time][value]}"; + if($DEBUG) echo "
      time color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$time][color]}"; + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + + //subsys type + $bin_typ=substr($bin_mes,$typ_bgn*8,8); + $dec_typ=BinDec($bin_typ); + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$type][value]=$arrayType[$dec_typ][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$type][color]=$arrayType[$dec_typ][color]; + if($selTypeNo == 2){ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$type][value]="ISUP"; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$type][color]=$arrayType[$dec_typ][color]; + } + if($DEBUG) echo "
      type value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$type][value]}"; + if($DEBUG) echo "
      type color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$type][color]}"; + //type num + + //version + $bin_ver=substr($bin_mes,$ver_bgn*8,8); + $dec_ver=BinDec($bin_ver); + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$vers][value]=DecHex($dec_ver); + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$vers][color]="#0000FF"; + if($DEBUG) echo "
      version value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$vers][value]}"; + if($DEBUG) echo "
      version color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$vers][color]}"; + + //e1 installed + $bin_ins=substr($bin_mes,$ins_bgn*8+7,1); + $dec_ins=BinDec($bin_ins); + if($selTypeNo == 2){ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$enab][value]=$arrayInstall[$dec_ins][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$enab][color]=$arrayInstall[$dec_ins][color]; + }else{ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$enab][value]=$arrayInstall[$dec_ins][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$enab][color]=$arrayInstall[$dec_ins][color]; + } + + if($DEBUG) echo "
      install value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$enab][value]}"; + if($DEBUG) echo "
      install color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$enab][color]}"; + + //e1 layer1 + $bin_phy=substr($bin_mes,$ins_bgn*8+6,1); + $dec_phy=BinDec($bin_phy); + if($dec_ins==0){ + $dec_phy=2; + } + if($dec_phy==1){ + $no_basic_status=1; + } + if($selTypeNo == 2){ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$phys][value]=$arrayPhysical[$dec_phy][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$phys][color]=$arrayPhysical[$dec_phy][color]; + }else{ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$phys][value]=$arrayPhysical[$dec_phy][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$phys][color]=$arrayPhysical[$dec_phy][color]; + } + if($DEBUG) echo "
      layer1 value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$phys][value]}"; + if($DEBUG) echo "
      layer1 color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$phys][color]}"; + + + //e1 layer2 + $bin_tra=substr($bin_mes,$ins_bgn*8+5,1); + $dec_tra=BinDec($bin_tra); + if($dec_ins==0){ + $dec_tra=2; + } + if($dec_tra==0){ + $no_basic_status=1; + } + if($selTypeNo == 2){ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$tran][value]=$arrayTransport[$dec_tra][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$tran][color]=$arrayTransport[$dec_tra][color]; + }else{ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$tran][value]=$arrayTransport[$dec_tra][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$tran][color]=$arrayTransport[$dec_tra][color]; + } + if($DEBUG) echo "
      layer2 value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$tran][value]}"; + if($DEBUG) echo "
      layer2 color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$tran][color]}"; + + //send master clock + $bin_clk=substr($bin_mes,$ins_bgn*8+4,1); + $dec_clk=BinDec($bin_clk); + if($selTypeNo == 2){ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$cloc][value]=$arrayClock[$dec_clk][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$cloc][color]=$arrayClock[$dec_clk][color]; + }else{ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$cloc][value]=$arrayClock[$dec_clk][remark]; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$cloc][color]=$arrayClock[$dec_clk][color]; + } + if($DEBUG) echo "
      clock value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$cloc][value]}"; + if($DEBUG) echo "
      clock color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$cloc][color]}"; + + //E1 CH# in use/local + $bin_chu=substr($bin_mes,$chu_bgn*8,8); + if($selTypeNo == 2){ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$chus][value]=BinDec($bin_chu)." / 30"; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$chus][color]="#0000FF"; + }else{ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$chus][value]=BinDec($bin_chu)." / 30"; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$chus][color]="#0000FF"; + } + if($DEBUG) echo "
      ch value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$chus][value]}"; + if($DEBUG) echo "
      ch color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$chus][color]}"; + + //cpu loading + $bin_cpu=substr($bin_mes,$cpu_bgn*8,8); + $dec_cpu=BinDec($bin_cpu); + if($selTypeNo == 2){ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$load][value]=($dec_cpu*3.34)."%"; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$load][color]="#0000FF"; + }else{ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$load][value]=($dec_cpu*3.34)."%"; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$load][color]="#0000FF"; + } + if($DEBUG) echo "
      cpu value={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$load][value]}"; + if($DEBUG) echo "
      cpu color={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$load][color]}"; + + if($no_basic_status){ + $bStatusArr[$sysTypeNo][$sysNo][$subSysNo] = 1; + $basic_status="N"; + $basic_status_color="FF0000"; + }else{ + $basic_status="Y"; + $basic_status_color="0000FF"; + } + if($selTypeNo == 2 || $sysTypeNo == 2){ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$stat][value]=$basic_status; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$stat][color]=$basic_status_color; + + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$stat][value]=$basic_status; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo-4][$stat][color]=$basic_status_color; + }else{ + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$stat][value]=$basic_status; + $arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$stat][color]=$basic_status_color; + } + if($DEBUG) echo "
      arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$stat][value]={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$stat][value]}"; + if($DEBUG) echo "
      arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$stat][color]={$arrayTotal[$sysTypeNo][$sysNo][$subSysNo][$stat][color]}"; + + if($sysTypeNo == 2){ + $hex_grp = substr($hex_mes,$grp_bgn*2,2); + $grpNum = HexDec($hex_grp); + //echo "
      grpNum=$grpNum"; + + for($i=0;$i<5;$i++){ + for($j=0;$j<2;$j++){ + $grpNo = $i*2+$j; + $userNum[$sysNo][$grpNum][$grpNo] = HexDec(substr($hex_mes,($grp_bgn+1+$i)*2+1-$j,1)); + //echo "
      userNum[$sysNo][$grpNum][$grpNo]={$userNum[$sysNo][$grpNum][$grpNo]}"; + } + } + } +}while($selRow=@mysqli_fetch_array($selRes)); + +for($i=0;$i<4;$i++){ + $sysNum = get_sys_total($ttlSysArr[$i]); + for($j=0;$j<$sysNum;$j++){ + for($k=0;$k<8;$k++){ + if($bStatusArr[$i][$j][$k]) + $showStatus[$i][$j] = 1; + } + if($showSysArr[$i][$j]){ + if($showStatus[$i][$j]){ + $showStatusArr[$i][$j][0] = "N"; + $showStatusArr[$i][$j][1] = "#FF0000"; + }else{ + $showStatusArr[$i][$j][0] = "Y"; + $showStatusArr[$i][$j][1] = "#0000FF"; + } + } + } +} + +//get pcr8 status +$pcr8Sql = " SELECT sysTypeNo,sysNo,subSysNo,detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='130' + "; +if($DEBUG) echo "
      pcr8Sql=$pcr8Sql"; +$pcr8Res=mysqli_query($pubConn,$pcr8Sql); +$pcr8Row=@mysqli_fetch_array($pcr8Res); +echo mysqli_error($pubConn); + +//begin bit +$ver_bgn = 18; //version +$typ_bgn = 21; //subsys type +$ins_bgn = 22; //e1 installed +$inl_bgn = 23; //e1 layer2 installed +$phy_bgn = 24; //e1 layer1(physical layer) +$tra_bgn = 25; //e1 layer1(transport layer) +$can_bgn = 26; //echo canceller status +$cpu_bgn = 27; //cpu loading +$loc_bgn = 28; //lock status +$fre_bgn = 29; //frequency +$pow_bgn = 30; //power card and master clock +$pra_bgn = 31; //E1 FRAMER status +do{ + $sysNo = $pcr8Row[sysNo]; + $subSysNo = $pcr8Row[subSysNo]; + $hex_mes = $pcr8Row[detailStat]; + //echo "
      hex_mes=$hex_mes"; + + if(!$pcr8Row){ + break; + } + + $showPcr8SysArr[$sysNo] = 1; + $showPcr8SubArr[$sysNo][$subSysNo] = 1; + + $refreshTime[$sysNo][$subSysNo][0] = $pcr8Row[updateTime]; + if($refreshTime[$sysNo][$subSysNo][0] > $dueDate){ + $refreshTime[$sysNo][$subSysNo][1] = "#0000FF"; + }else{ + $refreshTime[$sysNo][$subSysNo][1] = "#FF0000"; + $noBasicStatus[$sysNo][$subSysNo]=1; + } + + $bin_mes=''; + for($i=0;$ibin_mes=$bin_mes"; + + //version + $bin_ver_0=substr($bin_mes,$ver_bgn*8,8); + $dec_ver_0=BinDec($bin_ver_0); + + $bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8); + $dec_ver_1=BinDec($bin_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8); + $dec_ver_2=BinDec($bin_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $versionArr[$sysNo][$subSysNo][0] = $version = $dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + $versionArr[$sysNo][$subSysNo][1] = $color_version = "#0000FF"; + $verNum[$sysNo] = $subSysNo; + if($DEBUG) echo "
      verNum[$sysNo]=$verNum[$sysNo]"; + if($DEBUG) echo "
      versionArr[$sysNo][$subSysNo][0]={$versionArr[$sysNo][$subSysNo][0]}"; + + //subsys type + $bin_typ = substr($bin_mes,$typ_bgn*8,8); + $subTypeArr[$sysNo][$subSysNo][0] = $dec_typ = BinDec($bin_typ); + if($DEBUG) echo "
      subTypeArr[$sysNo][$subSysNo][0] = {$subTypeArr[$sysNo][$subSysNo][0]}"; + + //e1 install + for($i=0;$i<8;$i++){ + $bin_ins=substr($bin_mes,$ins_bgn*8+7-$i,1); + $eInstallArr[$sysNo][$subSysNo][$i]=BinDec($bin_ins); + if($DEBUG) echo "
      eInstallArr[$sysNo][$subSysNo][$i]={$eInstallArr[$sysNo][$subSysNo][$i]}"; + } + + //e1 layer2 install + for($i=0;$i<8;$i++) + { + $bin_inl=substr($bin_mes,$inl_bgn*8+7-$i,1); + $eL2InsArr[$sysNo][$subSysNo][$i]=BinDec($bin_inl); + if($DEBUG) echo "
      eL2InsArr[$sysNo][$subSysNo][$i]={$eL2InsArr[$sysNo][$subSysNo][$i]}"; + } + + //e1 layer1 + for($i=0;$i<8;$i++){ + $bin_phy=substr($bin_mes,$phy_bgn*8+7-$i,1); + $eL1StatusArr[$sysNo][$subSysNo][$i] = BinDec($bin_phy); + if($DEBUG) echo "
      eL1StatusArr[$sysNo][$subSysNo][$i]={$eL1StatusArr[$sysNo][$subSysNo][$i]}"; + if($eInstallArr[$sysNo][$subSysNo][$i] == 0){ + $eL1StatusArr[$sysNo][$subSysNo][$i]=2; + } + + if($eL1StatusArr[$sysNo][$subSysNo][$i] == 1){ + $noBasicStatus[$sysNo][$subSysNo]=1; + } + } + + //e1 layer2 + for($i=0;$i<8;$i++) + { + $bin_tra=substr($bin_mes,$tra_bgn*8+7-$i,1); + $eL2StatusArr[$sysNo][$subSysNo][$i]=BinDec($bin_tra); + if($eInstallArr[$sysNo][$subSysNo][$i] == 0 || $eL2InsArr[$sysNo][$subSysNo][$i] == 0){ + $eL2StatusArr[$sysNo][$subSysNo][$i]=2; + } + if($DEBUG) echo "
      eL2StatusArr[$sysNo][$subSysNo][$i]={$eL2StatusArr[$sysNo][$subSysNo][$i]}"; + if($eL2StatusArr[$sysNo][$subSysNo][$i] == 0){ + $noBasicStatus[$sysNo][$subSysNo]=1; + } + } + + //echo canceller status + for($i=0;$i<8;$i++) + { + $bin_can=substr($bin_mes,$can_bgn*8+7-$i,1); + $canStatusArr[$sysNo][$subSysNo][$i]=BinDec($bin_can); + if($eInstallArr[$sysNo][$subSysNo][$i] == 0){ + $canStatusArr[$sysNo][$subSysNo][$i] = 0; + } + if($DEBUG) echo "
      canStatusArr[$sysNo][$subSysNo][$i]={$canStatusArr[$sysNo][$subSysNo][$i]}"; + } + + //cpu loading + $bin_cpu=substr($bin_mes,$cpu_bgn*8,8); + $dec_cpu=BinDec($bin_cpu); + if($DEBUG) echo "
      dec_cpu=$dec_cpu"; + + $cpu_load=change2point($dec_cpu/126); + if($cpu_load>100){ + $cpu_load=100; + } + elseif($cpu_load<0){ + $cpu_load=0; + } + if($DEBUG) echo "
      cpu_load=$cpu_load"; + if($cpu_load>90){ + $noBasicStatus[$sysNo][$subSysNo] = 1; + $cpuLoadArr[$sysNo][$subSysNo][1] = "#FF0000"; + }else{ + $cpuLoadArr[$sysNo][$subSysNo][1] = "#0000FF"; + } + $cpuLoadArr[$sysNo][$subSysNo][0] = $cpu_load."%"; + + //lock status + $bin_loc = substr($bin_mes,$loc_bgn*8,8); + $lockStatusArr[$sysNo][$subSysNo] = BinDec($bin_loc); + if($DEBUG) echo "
      lockStatusArr[$sysNo][$subSysNo]={$lockStatusArr[$sysNo][$subSysNo]}"; + + //frequency + $bin_fre=substr($bin_mes,$fre_bgn*8,8); + $dec_fre=BinDec($bin_fre); + $freqArr[$sysNo][$subSysNo][0] = omc_keep_length($dec_fre,0,3); + if($dec_loc==7){ + $freqArr[$sysNo][$subSysNo][0] = '--'; + $freqArr[$sysNo][$subSysNo][1] = "#000000"; + }else{ + $freqArr[$sysNo][$subSysNo][1] = "#0000FF"; + } + if($DEBUG) echo "
      freqArr[$sysNo][$subSysNo][0]={$freqArr[$sysNo][$subSysNo][0]}"; + + //master clock + $bin_mas = substr($bin_mes,$pow_bgn*8+7,1); + $masClockArr[$sysNo][$subSysNo] = BinDec($bin_mas); + if($DEBUG) echo "
      masClockArr[$sysNo][$subSysNo]=$masClockArr[$sysNo][$subSysNo]"; +}while($pcr8Row = @mysqli_fetch_array($pcr8Res)); + +$pcr8Num = get_sys_total('PCR'); +for($i=0;$i<$pcr8Num;$i++){ + for($j=0;$j<16;$j++){ + if($noBasicStatus[$i][$j]){ + $showPcr8[$i] = 1; + $showSubArr[$i][$j][0] = "N"; + $showSubArr[$i][$j][1] = "#FF0000"; + }else{ + $showSubArr[$i][$j][0] = "Y"; + $showSubArr[$i][$j][1] = "#0000FF"; + } + } + + if($showPcr8SysArr[$sysNo]){ + if($showPcr8[$i]){ + $showPcr8Arr[$i][0] = "N"; + $showPcr8Arr[$i][1] = "#FF0000"; + }else{ + $showPcr8Arr[$i][0] = "Y"; + $showPcr8Arr[$i][1] = "#0000FF"; + } + } +} +?> + +"; +echo ""; +echo ""; +echo "$strSysStatus > $strCentralOffice > $strPeripheral"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +$old_sys_id = $sys_id; +//echo "sys_id=$sys_id,selTypeNo=$selTypeNo
      "; +if($sys_id == 'all'){ + echo "

      $strPeripheral

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for ( $i=0; $i<16; $i++ ){ + echo ""; + } + echo ""; + + for($i=0;$i<$ttlNum;$i++){ + if($DEFAULT_SYS=='SN' && $ttlSysArr[$i]!='VPS'){ + continue; + } + if($ttlSysArr[$i]=='VPS') + continue; + + $tmpSql = " SELECT * FROM elementExistConf WHERE elementName='$ttlSysArr[$i]' AND existFlag='1'"; + if($DEBUG) + echo "
      tmpSql=$tmpSql"; + $tmpRes = mysqli_query($pubConn,$tmpSql); + if(mysqli_num_rows($tmpRes)<=0) + continue; + + $sysNum = get_sys_total($ttlSysArr[$i]); + for($j=0;$j<$sysNum;$j++){ + if($j == $sysNum-1 && $i == $ttlNum-1){ + $colNum = 1; + }else{ + $colNum = 1; + } + echo ""; + $sys_id = $ttlSysArr[$i]."_".$j; + echo ""; + if($showSysArr[$i][$j]){ + echo ""; + for($k=0;$k<16;$k++){ + if(isset($arrayTotal[$i][$j][$k][$stat][value])){ + echo ""; + }else{ + echo ""; + } + } + }else{ + echo ""; + for($p=0; $p<16; $p++){ + echo ""; + } + } + echo ""; + } + } + $tmpSql = " SELECT * FROM elementExistConf WHERE elementName='PCR' AND existFlag='1'"; + if($DEBUG) + echo "
      tmpSql=$tmpSql"; + $tmpRes = mysqli_query($pubConn,$tmpSql); + if(mysqli_num_rows($tmpRes)>0) + { + //show pcr8 + for($j=0;$j<$pcr8Num;$j++){ + echo ""; + $sys_id = 'PCR_'.$j; + echo ""; + if($showPcr8SysArr[$j]){ + echo ""; + for($k=0;$k<16;$k++){ + if(isset($showPcr8SubArr[$j][$k])){ + echo ""; + }else{ + echo ""; + } + } + + }else{ + echo ""; + for($p=0; $p<16; $p++){ + echo ""; + } + } + echo ""; + } + } + echo ""; + echo "
      $strItem$strBasicStatus"; + echo "

      $strSubsystemID

      "; + echo "
      $i
      $ttlSysArr[$i]_$j{$showStatusArr[$i][$j][0]}{$arrayTotal[$i][$j][$k][$stat][value]}------
      $sys_id{$showPcr8Arr[$j][0]}{$showSubArr[$j][$k][0]}------
      "; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "

      $strRemark:  Y = $strNormal,    N = $strAbnormal,   -- = $strNothing.

      "; + echo "

      $strBack"; + echo "     "; + echo "$strClear"; + echo "

      "; + echo "
      "; + echo ""; + exit(); +}//end if ($sys_id == 'all') +elseif($selTypeNo == '130'){ + $paneNum = explode("_",$sys_id); + $sysCode = $paneNum[1]; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo "

      PCR_$sysCode  $strStatusInfo

      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + for($i=0;$i<16;$i++){ + $showId = omc_keep_length($i,0,2); + echo ""; + if($showPcr8SubArr[$sysCode][$i]){ + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + + } + echo ""; + } + echo "
      ID$strBasicStatus$strRefreshTime$strClockStatus$strPCM2MClockPhaseStatus$strVersion$strClockReference
      $showId"; + if($noBasicStatus[$sysCode][$i]) + echo "Error"; + else + echo "Normal"; + echo ""; + if($showPcr8SubArr[$sysCode][$i]) + echo "{$refreshTime[$sysCode][$i][0]}"; + echo ""; + echo "{$arrayMaster[$masClockArr[$sysCode][$i]][remark]}"; + echo ""; + echo "{$arrayLock[$lockStatusArr[$sysCode][$i]][remark]}"; + echo ""; + echo "{$versionArr[$sysNo][$subSysNo][0]}"; + echo "------------

      PCR_$sysCode E1 Status

      "; + echo ""; + echo ""; + for($i=0;$i<128;$i++){ + if($i % 8 == 0){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + $slotNum = floor($i/8); + $portNum = $i%8; + echo ""; + echo ""; + echo ""; + if($showPcr8SubArr[$sysCode][$slotNum]){ + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + } + echo ""; + + } + echo "
      SlotPortENL1L2EC
      $slotNum$portNum{$arrayInstall[$eInstallArr[$sysCode][$slotNum][$portNum]][remark]}{$arrayPhysical[$eL1StatusArr[$sysCode][$slotNum][$portNum]][remark]}{$arrayTransport[$eL2StatusArr[$sysCode][$slotNum][$portNum]][remark]}{$arrayCan[$canStatusArr[$sysCode][$slotNum][$portNum]][remark]}--------
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "

      $strRemark:  Y = $strNormal,    N = $strAbnormal,   -- = $strNothing.

      "; + echo "

      $strBack"; + echo "     "; + echo "$strClear"; + echo "

      "; + echo "
      "; + + exit(); +}//elseif($selTypeNo == '130') + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +if($selTypeNo == '2'){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +}//endif($sysTypeNo==2) + +echo "

      $ttlSysArr[$selTypeNo]_0 $strStatusInformation"; +echo "

      $ttlSysArr[$selTypeNo]_1 status information"; +echo "

      "; +echo ""; +echo ""; +echo ""; +for($i=0;$i<8;$i++){ + echo ""; +} +echo ""; +for($i=0;$i<9;$i++){ + echo ""; + echo ""; + for($j=0;$j<8;$j++){ + if(isset($arrayTotal[$selTypeNo][0][$j][$i][value])) + echo ""; + else + echo ""; + } + echo ""; +} + +echo "
      Subsystem ID"; + echo "$i"; + echo "
      {$arrayName[$i][remark]}{$arrayTotal[$selTypeNo][0][$j][$i][value]}--
      "; +echo "
      "; +echo ""; +echo ""; +echo ""; +for($i=0;$i<8;$i++){ + echo ""; +} +echo ""; +for($i=0;$i<9;$i++){ + echo ""; + echo ""; + for($j=0;$j<8;$j++){ + if(isset($arrayTotal[$selTypeNo][1][$j][$i][value])) + echo ""; + else + echo ""; + } + echo ""; +} + +echo "
      Subsystem ID"; + echo "$i"; + echo "
      {$arrayName[$i][remark]}{$arrayTotal[$selTypeNo][1][$j][$i][value]}--
      "; +echo "

      "; +echo "$strRefreshTime

      "; +echo "

      "; +echo "$strRefreshTime

      "; +echo ""; +for($i=0;$i<4;$i++){ + echo ""; + for($j=0;$j<2;$j++){ + $sub_code=$i*2+$j; + $dis_code=$sub_code; + echo ""; + if(isset($arrayTotal[$selTypeNo][0][$sub_code][$time][value])) + echo ""; + else + echo ""; + } + echo ""; +} +echo "
      $dis_code{$arrayTotal[$selTypeNo][0][$sub_code][$time][value]}--
      "; +echo "
      "; +echo ""; +for($i=0;$i<4;$i++){ + echo ""; + for($j=0;$j<2;$j++){ + $sub_code=$i*2+$j; + $dis_code=$sub_code; + echo ""; + if(isset($arrayTotal[$selTypeNo][1][$sub_code][$time][value])) + echo ""; + else + echo ""; + } + echo ""; +} +echo "
      $dis_code{$arrayTotal[$selTypeNo][1][$sub_code][$time][value]}--
      "; +echo "

      "; + echo "Online users

      "; + echo "

      "; + echo "Online users

      "; + echo ""; + echo ""; + echo ""; + for($i=1;$i<11;$i++){ + echo ""; + } + echo ""; + + for($i=0;$i<4;$i++){ + echo ""; + for($j=0;$j<10;$j++){ + if(isset($userNum[0][$i][$j])) + echo ""; + else + echo ""; + } + echo ""; + } + echo "
       $i
      $i{$userNum[0][$i][$j]}--
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + for($i=1;$i<11;$i++){ + echo ""; + } + echo ""; + + for($i=0;$i<4;$i++){ + echo ""; + for($j=0;$j<10;$j++){ + if(isset($userNum[1][$i][$j])) + echo ""; + else + echo ""; + } + echo ""; + } + echo "
       $i
      $i{$userNum[0][$i][$j]}--
      "; + echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "

      $strRemark:  Y = $strNormal,    N = $strAbnormal,   -- = $strNothing.

      "; +echo "

      "; +echo "$strBack

      "; +echo "
      "; +?> +"> + + diff --git a/wxc2_omc/fault/php.ini/320_php.ini b/wxc2_omc/fault/php.ini/320_php.ini new file mode 100755 index 0000000..91b37ea --- /dev/null +++ b/wxc2_omc/fault/php.ini/320_php.ini @@ -0,0 +1,82 @@ + + recordType + serviceCentre + servedIMSI + servedIMEI + servedMSISDN + callingNumber + calledNumber + recordingEntity + mscIncomingTKGP + mscOutgoingTKGP + location + [supplServicesUsed] + flag=0 + size=4 + fileName=320 + [msClassmark] + flag=0 + size=4 + fileName=320 + [seizureTime] + flag=0 + size=4 + fileName=320 + [answerTime] + flag=0 + size=4 + fileName=320 + [releaseTime] + flag=0 + size=4 + fileName=320 + [callDuration] + flag=0 + size=4 + fileName=320 + [causeForTerm] + flag=0 + size=4 + fileName=320 + [diagnostics] + flag=0 + size=4 + fileName=320 + [callReference] + flag=0 + size=4 + fileName=320 + [sequenceNumber] + flag=0 + size=4 + fileName=320 + [recordExtensions] + flag=0 + size=4 + fileName=320 + [Msrn] + flag=0 + size=4 + fileName=320 + [basicService] + flag=0 + size=4 + fileName=320 + [SSA] + flag=0 + size=4 + fileName=320 + SSParm + SSR + RadoiChannalUsed + SmDeliveryTime + ScAdress + SmRslf + MsgRf + gsmSCFAddress + NetworkCallReference + CamelInitCFIndicator + DefaultCallHandling + IntTimeStamp + CAMELDestNumber + MSCAddress diff --git a/wxc2_omc/fault/platAdvanceStatus.tgz b/wxc2_omc/fault/platAdvanceStatus.tgz new file mode 100755 index 0000000..4351e58 Binary files /dev/null and b/wxc2_omc/fault/platAdvanceStatus.tgz differ diff --git a/wxc2_omc/fault/platAdvanceStatus/create_status.php/plat_status_detail.php b/wxc2_omc/fault/platAdvanceStatus/create_status.php/plat_status_detail.php new file mode 100755 index 0000000..3d45d56 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/create_status.php/plat_status_detail.php @@ -0,0 +1,385 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > Platform"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strBack"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); +foreach($config as $key => $val) +{ + if($config[$key][PlatformID] == $platID) + { + $thisconfig=$config[$key]; + break; + } +} + +$tmpconf[PlatNo]=$platID; +$plat=GetPlatInfo($tmpconf,$subSysNo); +if(0) +{ + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; +} +echo "
      {$thisconfig[PlatformName]}_$subSysNo platform information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      Status"; + //platform Status + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      Refresh Time"; + //Refresh Time + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      Start Time"; + //Start Time + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      CPU Usage"; + //CPU Usage PN + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + //CPU Usage Rate + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + +echo "
      Physical Memory"; + //Physical Memory Used/Total + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + echo "(Used/Total)"; + echo "
      "; + + //Physical Memory Used/Swap + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + echo "(Used/Swap)"; + echo "
      "; + + + $id=AssignID(); + echo "Buffers:"; + echo " "; + echo ""; + echo "--"; + echo ""; + + echo "; "; + + $id=AssignID(); + echo "Cached:"; + echo " "; + echo ""; + echo "--"; + echo ""; + + echo "
      "; + +echo "
      Harddisk Space"; + //Harddisk, support 16 harddisk + for($i=0;$i<16;$i++) + { + $id=AssignID(); + if($i==0) + echo ""; + else + echo ""; + + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo "
      "; + + echo "
      "; + + } + +echo "
      "; + +//Remark Table +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "$strBack"; + echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$platID','$subSysNo');\n"; + echo "\n"; +?> diff --git a/wxc2_omc/fault/platAdvanceStatus/create_status.php/plat_status_detail_update.php b/wxc2_omc/fault/platAdvanceStatus/create_status.php/plat_status_detail_update.php new file mode 100755 index 0000000..1be8eda --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/create_status.php/plat_status_detail_update.php @@ -0,0 +1,181 @@ + $val) +{ + if($config[$key][PlatformID] == $platID) + { + $thisconfig=$config[$key]; + break; + } +} + +$sql="select * from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$platID} and subSysNo=$subSysNo "; +//echo "$sql
      "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num == 0) + exit(); + +$tmpconf[PlatNo]=$platID; +$plat=GetPlatInfo($tmpconf,$subSysNo); + + + +//platform Status +$id=AssignID(); +$sql="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$platID} and subSysNo=$subSysNo "; +//echo "$sql
      "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num != 1) +{ + $baseStat=0; +} +else +{ + $row=@mysqli_fetch_array($res); + $baseStat=$row[baseStat]+0; +} +$refresh_time=$row[updateTime]; +$due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); +$ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); +if($refresh_time < $due_date || $refresh_time > $ove_date) +{ + $valid_time=0; +} +else +{ + $valid_time=1; +} +if($valid_time == 0 || $baseStat == 0) + $total_response.="$id,block,N,#ff0000;"; +else + $total_response.="$id,block,Y,#0000ff;"; + +//Refresh Time +$id=AssignID(); +if($valid_time) + $total_response.="$id,block,$refresh_time,#0000ff;"; +else + $total_response.="$id,block,$refresh_time,#ff0000;"; + +//Start Time +$id=AssignID(); +if(trim($plat[StartTime][Value]) == "") + $total_response.="$id,block,--,#000000;"; +else + $total_response.="$id,block,{$plat[StartTime][Value]},#0000ff;"; + + +//CPU Usage PN +$id=AssignID(); +$message="{$id},{$plat[CPURatePN][Display]},{$plat[CPURatePN][Value]},{$plat[CPURatePN][Color]};"; +$total_response.=$message; + +//CPU Usage +$id=AssignID(); +$message="{$id},{$plat[CPURate][Display]},{$plat[CPURate][Value]},{$plat[CPURate][Color]};"; +$total_response.=$message; + +//Physical Memory +$id=AssignID(); +$message="{$id},{$plat[PMTotalRatePN][Display]},{$plat[PMTotalRatePN][Value]},{$plat[PMTotalRatePN][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMTotalRate][Display]},{$plat[PMTotalRate][Value]},{$plat[PMTotalRate][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMTotalRateV][Display]},{$plat[PMTotalRateV][Value]},{$plat[PMTotalRateV][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRatePN][Display]},{$plat[PMSwapRatePN][Value]},{$plat[PMSwapRatePN][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRate][Display]},{$plat[PMSwapRate][Value]},{$plat[PMSwapRate][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRateV][Display]},{$plat[PMSwapRateV][Value]},{$plat[PMSwapRateV][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMBuffers][Display]},{$plat[PMBuffers][Value]},{$plat[PMBuffers][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMCached][Display]},{$plat[PMCached][Value]},{$plat[PMCached][Color]};"; +$total_response.=$message; + +//Harddisk +for($i=0;$i<16;$i++) +{ + if($i<$plat[HDNum]) + { + $id=AssignID(); + $message="{$id},layerShow,no,no;"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][PN][Display]},{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][Rate][Display]},{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][V][Display]},{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][Path][Display]},{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};"; + $total_response.=$message; + } + else + { + $id=AssignID(); + $message="{$id},layerHide,no,no;"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};"; + //$total_response.=$message; + } +} + +echo "$total_response"; +?> diff --git a/wxc2_omc/fault/platAdvanceStatus/iptrans_status.php b/wxc2_omc/fault/platAdvanceStatus/iptrans_status.php new file mode 100755 index 0000000..b43a4f5 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/iptrans_status.php @@ -0,0 +1,146 @@ + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > IPTRANS Status"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + //echo "$strBlack"; + echo "back"; + + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + + + +$config=parse_ini_file("../platStatus/config.ini",true); +$config_count=sizeof($config); + + +if(0) +{ + echo "config_count=$config_count
      "; + echo "
      ";
      +	print_r($config);
      +	echo "
      "; +} + + + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,0); + +$table_title="IPTRANS( Version:"; +$table_title.=" {$platDetailInfo[IPTRANS][Version][Value]}"; +$table_title.=","; +$table_title.=" Status:"; +$table_title.="{$platDetailInfo[IPTRANS][Status][Value]}"; +$table_title.=","; +$table_title.="RefreshTime:"; +$table_title.="{$platDetailInfo[RefreshTime][Value]}"; +$table_title.=")"; + + + echo "
      $table_title
      "; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + +?> + + +"; + for($j=0;$j<8;$j++) + { + if($j%2==0) + { + $dis_no=4950+($j/2)*8+$i; + echo ""; + } + else + { + $dis_port=(($j-1)/2)*8+$i; + echo ""; + } + } + echo ""; +} +*/ +for($i=0;$i<8;$i++) +{ + echo ""; + for($j=0;$j<4;$j++) + { + $dis_no=4950+($j)*8+$i; + echo ""; + echo ""; + } + echo ""; +} +?> +
      Port noStatusPort noStatusPort noStatusPort noStatus
      "; + echo $dis_no; + echo ""; + echo "{$platDetailInfo[IPTRANS][Port][$dis_port][Status][Value]}"; + echo "
      "; + echo $dis_no; + echo ""; + $dis_port=($j)*8+$i; + //echo "$dis_port"; + echo "{$platDetailInfo[IPTRANS][Port][$dis_port][Status][Value]}"; + echo "
      +"; + echo ""; + echo ""; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + + //echo "back"; + echo ""; + echo "back"; + echo ""; + echo ""; + echo ""; +?> + diff --git a/wxc2_omc/fault/platAdvanceStatus/iptrans_status_up.php b/wxc2_omc/fault/platAdvanceStatus/iptrans_status_up.php new file mode 100755 index 0000000..8ea5cb8 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/iptrans_status_up.php @@ -0,0 +1 @@ +wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww diff --git a/wxc2_omc/fault/platAdvanceStatus/mtp3_status.php b/wxc2_omc/fault/platAdvanceStatus/mtp3_status.php new file mode 100755 index 0000000..9b44aa5 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/mtp3_status.php @@ -0,0 +1,204 @@ + + + + + + + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > MTP3 Status"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "back"; + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + + + +$config=parse_ini_file("../platStatus/config.ini",true); +$config_count=sizeof($config); + + +if(0) +{ + echo "config_count=$config_count
      "; + echo "
      ";
      +	print_r($config);
      +	echo "
      "; +} + +echo "
      Platform summary information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; + + + +foreach($config as $key => $val) +{ + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + + + for($j=0;$j<$config[$key][PlatformNo];$j++) + { + + //Rowline + $id=AssignID(); + echo ""; + + //Item Name + echo ""; + + //Application status + $id=AssignID(); + echo ""; + + + //IPTRANS + $id=AssignID(); + echo ""; + + + //MTP3 + $id=AssignID(); + echo ""; + + //SCCP + $id=AssignID(); + echo ""; + + //TCAP + $id=AssignID(); + echo ""; + + //SNMP + $id=AssignID(); + echo ""; + + //DEBUG + $id=AssignID(); + echo ""; + + //SMPP + $id=AssignID(); + echo ""; + + //Refresh Time + $id=AssignID(); + echo ""; + + + //IP Address + $id=AssignID(); + echo ""; + + echo ""; + } +} +echo "
      ItemApplication statusIPTRANSMTP3SCCPTCAPSNMPDEBUGSMPPRefresh TimeIP Address
      ----------------------
      {$config[$key][PlatformName]}_{$j}"; + echo "$id"; + echo ""; + echo ""; + //echo ""; + echo "$id"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo "
      "; + + + +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "back"; + echo "
      "; +if($clearAll) +{ + echo "\n"; +} + +echo ""; +adjust_content_tail(); + +?> + diff --git a/wxc2_omc/fault/platAdvanceStatus/plat_detail_status.php b/wxc2_omc/fault/platAdvanceStatus/plat_detail_status.php new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/fault/platAdvanceStatus/plat_detail_status_update.php b/wxc2_omc/fault/platAdvanceStatus/plat_detail_status_update.php new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/fault/platAdvanceStatus/plat_general_status.php b/wxc2_omc/fault/platAdvanceStatus/plat_general_status.php new file mode 100755 index 0000000..29ec220 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/plat_general_status.php @@ -0,0 +1,245 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > Plat Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strClear"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +$config=parse_ini_file("../platStatus/config.ini",true); +$config_count=sizeof($config); +if(0) +{ + echo "config_count=$config_count
      "; + echo "
      ";
      +	print_r($config);
      +	echo "
      "; +} + +if($clearAll == 1) +{ + $sql="delete from OMC_PUB.sysInfo where sysTypeNo={$config[PlatSysTypeNo]} "; + @mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); +} + +echo "
      Platform summary information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +foreach($config as $key => $val) +{ + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + + for($j=0;$j<$config[$key][PlatformNo];$j++) + { + //Rowline + $id=AssignID(); + echo ""; + //Item Name + echo ""; + //IPTRANS + $id=AssignID(); + echo ""; + + //MTP3 + $id=AssignID(); + echo ""; + + //SCCP + $id=AssignID(); + echo ""; + + //TCAP + $id=AssignID(); + echo ""; + + //SNMP + $id=AssignID(); + echo ""; + + //DEBUG + $id=AssignID(); + echo ""; + + //Refresh Time + $id=AssignID(); + echo ""; + + //IP Address + $id=AssignID(); + echo ""; + + echo ""; + } +} +echo "
      ItemIPTRANSMTP3SCCPTCAPSNMPDEBUGRefresh TimeIP Address
      ------------------
      {$config[$key][PlatformName]}_{$j}"; + //echo ""; + echo "$id"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo "
      "; + +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "$strClear"; + echo "
      "; +if($clearAll) +{ + echo "\n"; +} + +echo ""; +adjust_content_tail(); + +?> + + diff --git a/wxc2_omc/fault/platAdvanceStatus/plat_general_status_update.php b/wxc2_omc/fault/platAdvanceStatus/plat_general_status_update.php new file mode 100755 index 0000000..8936d7a --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/plat_general_status_update.php @@ -0,0 +1,104 @@ + + + + $val) +{ + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + for($sysNo=0;$sysNo<$config[$key][PlatformNo];$sysNo++) + { + $sql="select * from OMC_PUB.sysInfo where sysTypeNo={$config[PlatSysTypeNo]} and sysNo={$config[$key][PlatformID]} and subSysNo={$sysNo} "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + + if($num == 0) + { + $id=AssignID(); + $total_response.="$id,none,none,none;"; + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + continue; + } + else + { + $row=@mysqli_fetch_array($res); + $id=AssignID(); + $total_response.="$id,block,none,none;"; + + + $platDetailInfo=GetDetailPlatInfo($config[$key][PlatformID],$sysNo,9999); + //IPTRANS + $id=AssignID(); + if(strcmp($platDetailInfo[IPTRANS][Status][Value],"--")) + $platDetailInfo[IPTRANS][Status][Value]="".$platDetailInfo[IPTRANS][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[IPTRANS][Status][Value]},{$platDetailInfo[IPTRANS][Status][Color]};"; + + //MTP3 + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[MTP3][Status][Value]},{$platDetailInfo[MTP3][Status][Color]};"; + + //SCCP + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[SCCP][Status][Value]},{$platDetailInfo[SCCP][Status][Color]};"; + + //TCAP + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[TCAP][Status][Value]},{$platDetailInfo[TCAP][Status][Color]};"; + + //SNMP + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[SNMP][Status][Value]},{$platDetailInfo[SNMP][Status][Color]};"; + + //DEBUG + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[DEBUG][Status][Value]},{$platDetailInfo[DEBUG][Status][Color]};"; + + + //Refresh Time + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},{$platDetailInfo[RefreshTime][Color]};"; + + //IP Address + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[IPAddress][Value]},{$platDetailInfo[IPAddress][Color]};"; + + $show_num++; + } + } +} +if($show_num) + $total_response.="blank_line,none,none,none;"; +else + $total_response.="blank_line,block,none,none;"; +debug_log("/tmp/test.txt",$total_response); +echo $total_response; +?> diff --git a/wxc2_omc/fault/platAdvanceStatus/plat_status.php b/wxc2_omc/fault/platAdvanceStatus/plat_status.php new file mode 100755 index 0000000..7bf40f8 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/plat_status.php @@ -0,0 +1,352 @@ + + +"; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num != 1) + { + return 0; + } + $row=@mysqli_fetch_array($res); + $baseStat=$row[detailStat]; + $compStat=substr($baseStat,38); + $compStatLen=strlen($compStat)-1; + //echo "$compStat
      "; + $index=0; + $i=0; + while($i<$compStatLen) + { + $tmp=substr($compStat,$i,4); + $component[$index][ID]=$tmp+0; + $i+=4; + $tmp=substr($compStat,$i,4); + $component[$index][Length]=hexdec($tmp); + $i+=4; + $component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2); + $i+=$component[$index][Length]*2; + $index++; + } + + //echo "
      ";
      +	//print_r($component);
      +	//echo "
      "; + + if($component[8][Length] > 0) + { + $snmp_hb=$component[8][Content]; + //echo "{$component[8][Length]}
      $snmp_hb
      "; + + //Start Time + $pos=0; + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $plat[StartTime][Value]=date("Y-m-d H:i:s",$tmpValue); + $plat[StartTime][Color]="#0000ff"; + $plat[StartTime][Display]="block"; + $pos+=8; + + //CPU Use Rate + $tmpValue=100-hexdec(substr($snmp_hb,$pos,2)); + $plat[CPURate][Value]="{$tmpValue}%"; + $plat[CPURate][Color]="#000000"; + $plat[CPURate][Display]="block"; + + //增加 + $plat[CPU]=GetLabel(floor($tmpValue/10)); + + //增加 + + //CPU Use Rate Process Num + $plat[CPURatePN][Value]=floor($tmpValue/10); + $plat[CPURatePN][Color]="#0000ff"; + $plat[CPURatePN][Display]="Rect"; + $pos+=2; + + //Physical Memory Used/Total + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue1=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue2=floor(($tmpValue/$tmpValue1)*100); + + $plat[PMTotalRate][Value]="{$tmpValue2}%"; + $plat[PMTotalRate][Color]="#000000"; + $plat[PMTotalRate][Display]="block"; + + $plat[PMTotalRateV][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M"; + $plat[PMTotalRateV][Color]="#000000"; + $plat[PMTotalRateV][Display]="block"; + + $plat[PMTotalRatePN][Value]=floor($tmpValue2/10); + $plat[PMTotalRatePN][Color]="#0000ff"; + $plat[PMTotalRatePN][Display]="Rect"; + + //Physical Memory Used/Swap + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue1=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue2=floor(($tmpValue/$tmpValue1)*100); + + $plat[PMSwapRate][Value]="{$tmpValue2}%"; + $plat[PMSwapRate][Color]="#000000"; + $plat[PMSwapRate][Display]="block"; + + $plat[PMSwapRateV][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M"; + $plat[PMSwapRateV][Color]="#000000"; + $plat[PMSwapRateV][Display]="block"; + + $plat[PMSwapRatePN][Value]=floor($tmpValue2/10); + $plat[PMSwapRatePN][Color]="#0000ff"; + $plat[PMSwapRatePN][Display]="Rect"; + + //Physical Memory Buffers + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $plat[PMBuffers][Value]=(floor($tmpValue/1024))."M"; + $plat[PMBuffers][Color]="#000000"; + $plat[PMBuffers][Display]="block"; + + //Physical Memory Cached + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $plat[PMCached][Value]=(floor($tmpValue/1024))."M"; + $plat[PMCached][Color]="#000000"; + $plat[PMCached][Display]="block"; + + //Harddisk + $tmpValue=hexdec(substr($snmp_hb,$pos,2)); + $pos+=2; + $plat[HDNum]=$tmpValue; + for($i=0;$i<$plat[HDNum];$i++) + { + $tmpValue=hexdec(substr($snmp_hb,$pos,2)); + $pos+=2; + $path_len=$tmpValue; + $path=""; + for($j=0;$j<$path_len;$j++) + { + $path.=chr(hexdec(substr($snmp_hb,$pos,2))); + $pos+=2; + } + $plat[HD][$i][Path][Value]="($path)"; + $plat[HD][$i][Path][Color]="#000000"; + $plat[HD][$i][Path][Display]="block"; + + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue1=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + + $tmpValue2=floor(($tmpValue/$tmpValue1)*100); + $plat[HD][$i][PN][Value]=floor($tmpValue2/10); + $plat[HD][$i][PN][Color]="#0000ff"; + $plat[HD][$i][PN][Display]="Rect"; + + $plat[HD][$i][V][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M"; + $plat[HD][$i][V][Color]="#000000"; + $plat[HD][$i][V][Display]="block"; + + $plat[HD][$i][Rate][Value]="{$tmpValue2}%"; + $plat[HD][$i][Rate][Color]="#000000"; + $plat[HD][$i][Rate][Display]="block"; + } + } + + + return $plat; +} + +?> + + +"; +echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + + + echo ""; + /* + echo ""; + */ + + echo ""; + echo ""; +echo "
      "; + echo "Advanced > PLAT Status"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + //echo "$strBlack"; + echo "back"; + + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + +?> + + +PLAT STATUS information( Version:"; +$table_title.="{$platDetailInfo[version][Status][Value]}"; +$table_title.=")"; + + + echo "
      $table_title

      "; + echo ""; + + echo ""; + + echo ""; + echo ""; + //echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + //Start Time + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + //CPU Use Rate + echo ""; + echo ""; + echo ""; + + //echo ""; + echo ""; + + + + //CPU Use Rate Process Num + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + + //Physical Memory Used/Total + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + + //Physical Memory Used/Swap + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + + //Harddisk + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + + + + + echo "
      StatusY--
      Dual server modeSingle
      Reflash time{$platDetailInfo[RefreshTime][Value]}--
      Start time{$plat_status[StartTime][Value]}--
      CPU use rate/Process Num"; + echo "{$plat_status[CPU]}"; + echo "{$plat_status[CPURate][Value]}/{$plat_status[CPURatePN][Value]}--/--
      Physical Memory Used/Total{$plat_status[PMTotalRate][Value]}/ {$plat_status[PMTotalRateV][Value]} / {$plat_status[PMTotalRatePN][Value]}--/--/--
      Physical Memory Used/Swap{$plat_status[PMSwapRate][Value]}/{$plat_status[PMSwapRateV][Value]}/{$plat_status[PMSwapRatePN][Value]}--/--/--
      Physical Memory Buffers/Cached{$plat_status[PMBuffers][Value]}/{$plat_status[PMCached][Value]}--/--/--
      Harddisk{$plat_status[PMBuffers][Value]}/{$plat_status[PMCached][Value]}--/--/--
      "; +?> + +"; + echo ""; + //echo "back"; + echo ""; + echo "back"; + echo ""; + echo ""; + echo ""; +?> diff --git a/wxc2_omc/fault/platAdvanceStatus/plat_test_status.php b/wxc2_omc/fault/platAdvanceStatus/plat_test_status.php new file mode 100755 index 0000000..9b46c6a --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/plat_test_status.php @@ -0,0 +1,313 @@ + + + + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > Plat Status"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strClear"; + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + + + +$config=parse_ini_file("../platStatus/config.ini",true); +$config_count=sizeof($config); + + +if(0) +{ + echo "config_count=$config_count
      "; + echo "
      ";
      +	print_r($config);
      +	echo "
      "; +} + + + +if($clearAll == 1) +{ + $sql="delete from OMC_PUB.sysInfo where sysTypeNo=200 "; + @mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); +} + + + +echo "
      Platform summary information
      "; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; + + + +foreach($config as $key => $val) +{ + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + + + for($j=0;$j<$config[$key][PlatformNo];$j++) + { + + //Rowline + $id=AssignID(); + echo ""; + //Item Name + echo ""; + + //Application status + $id=AssignID(); + echo ""; + + + //IPTRANS + $id=AssignID(); + echo ""; + + + //MTP3 + $id=AssignID(); + echo ""; + + //SCCP + $id=AssignID(); + echo ""; + + //TCAP + $id=AssignID(); + echo ""; + + //SNMP + $id=AssignID(); + echo ""; + + //DEBUG + $id=AssignID(); + echo ""; + + //SMPP + $id=AssignID(); + echo ""; + + + //PLAT STATUS + $id=AssignID(); + echo ""; + + + + //Refresh Time + $id=AssignID(); + echo ""; + + + //IP Address + $id=AssignID(); + echo ""; + + echo ""; + } +} +echo "
      ItemApplication statusIPTRANSMTP3SCCPTCAPSNMPDEBUGSMPPPLAT STATUSRefresh TimeIP Address
      --------------------Y--
      {$config[$key][PlatformName]}_{$j}"; + echo "$id"; + echo ""; + echo ""; + //echo ""; + echo "$id"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + //echo ""; + echo "$id"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo "
      "; + + + +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "$strClear"; + echo "
      "; +if($clearAll) +{ + echo "\n"; +} + +echo ""; +adjust_content_tail(); + +?> + + + + + diff --git a/wxc2_omc/fault/platAdvanceStatus/plat_test_status_update.php b/wxc2_omc/fault/platAdvanceStatus/plat_test_status_update.php new file mode 100755 index 0000000..edf6593 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/plat_test_status_update.php @@ -0,0 +1,158 @@ + + + + + + + $val) +{ + + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + + + for($sys=0;$sys<$config[$key][PlatformNo];$sys++) + { + $sql="select * from OMC_PUB.sysInfo where sysTypeNo={$config[PlatSysTypeNo]} and sysNo={$config[$key][PlatformID]} and subSysNo={$sys} "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + + // $module_vertion=GetModuleVersion({$config[PlatSysTypeNo]},{$config[$key][PlatformID]},{$sysNo}); + + + if($num == 0) + { + + $id=AssignID(); + $total_response.="$id,none,none,none;"; + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + continue; + } + else + { + $row=@mysqli_fetch_array($res); + $id=AssignID(); + $total_response.="$id,block,none,none;"; + + + $platDetailInfo=GetDetailPlatInfo($config[$key][PlatformID],$sys,9999); + $debug_message="GetDetailPlatInfo($config[$key][PlatformID],$sys,9999);
      "; + debug_log("/tmp/test.txt",$debug_message); + + //Application status + $id=AssignID(); + if(strcmp($platDetailInfo[Application][Status][Value],"--")) + $platDetailInfo[Application][Status][Value]="Y"; + $total_response.="$id,block,{$platDetailInfo[Application][Status][Value]},{$platDetailInfo[Application][Status][Color]};"; + + //IPTRANS + $id=AssignID(); + if(strcmp($platDetailInfo[IPTRANS][Status][Value],"--")) + $platDetailInfo[IPTRANS][Status][Value]="".$platDetailInfo[IPTRANS][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[IPTRANS][Status][Value]},{$platDetailInfo[IPTRANS][Status][Color]};"; + + + //MTP3 + $id=AssignID(); + if(strcmp($platDetailInfo[MTP3][Status][Value],"--")) + //$platDetailInfo[MTP3][Status][Value]="".$platDetailInfo[MTP3][Status][Value].""; + $platDetailInfo[MTP3][Status][Value]="".$platDetailInfo[MTP3][Status][Value].""; + + + $total_response.="$id,block,{$platDetailInfo[MTP3][Status][Value]},{$platDetailInfo[MTP3][Status][Color]};"; + + //SCCP + $id=AssignID(); + if(strcmp($platDetailInfo[SCCP][Status][Value],"--")) + $platDetailInfo[SCCP][Status][Value]="".$platDetailInfo[SCCP][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[SCCP][Status][Value]},{$platDetailInfo[SCCP][Status][Color]};"; + + //TCAP + $id=AssignID(); + if(strcmp($platDetailInfo[TCAP][Status][Value],"--")) + $platDetailInfo[TCAP][Status][Value]="".$platDetailInfo[TCAP][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[TCAP][Status][Value]},{$platDetailInfo[TCAP][Status][Color]};"; + + //SNMP + $id=AssignID(); + if(strcmp($platDetailInfo[SNMP][Status][Value],"--")) + $platDetailInfo[SNMP][Status][Value]="".$platDetailInfo[SNMP][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[SNMP][Status][Value]},{$platDetailInfo[SNMP][Status][Color]};"; + + //DEBUG + $id=AssignID(); + if(strcmp($platDetailInfo[DEBUG][Status][Value],"--")) + $platDetailInfo[DEBUG][Status][Value]="".$platDetailInfo[DEBUG][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[DEBUG][Status][Value]},{$platDetailInfo[DEBUG][Status][Color]};"; + + //SMPP + $id=AssignID(); + if(strcmp($platDetailInfo[SMPP][Status][Value],"--")) + $platDetailInfo[SMPP][Status][Value]="".$platDetailInfo[SMPP][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[SMPP][Status][Value]},{$platDetailInfo[SMPP][Status][Color]};"; + + + + //PLAT Status + $id=AssignID(); + if(strcmp($platDetailInfo[Application][Status][Value],"--")) + $platDetailInfo[Application][Status][Value]="".$platDetailInfo[Application][Status][Value].""; + $total_response.="$id,block,{$platDetailInfo[Application][Status][Value]},{$platDetailInfo[SMPP][Status][Color]};"; + + //Refresh Time + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[RefreshTime][Value]},{$platDetailInfo[RefreshTime][Color]};"; + + + //IP Address + $id=AssignID(); + $total_response.="$id,block,{$platDetailInfo[IPAddress][Value]},{$platDetailInfo[IPAddress][Color]};"; + $show_num++; + } + } +} + + +if($show_num) + $total_response.="blank_line,none,none,none;"; +else + $total_response.="blank_line,block,none,none;"; + +debug_log("/tmp/test.txt",$total_response); +echo $total_response; + +?> diff --git a/wxc2_omc/fault/platAdvanceStatus/sccp_status.php b/wxc2_omc/fault/platAdvanceStatus/sccp_status.php new file mode 100755 index 0000000..15bacd6 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/sccp_status.php @@ -0,0 +1,69 @@ + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > SCCP Status"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "back"; + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,2); + +$table_title="SCCP( Version:"; +$table_title.=" {$platDetailInfo[SCCP][Version][Value]}"; +$table_title.=","; +$table_title.=" Status:"; +$table_title.="{$platDetailInfo[SCCP][Status][Value]}"; +$table_title.=","; +$table_title.="RefreshTime:"; +$table_title.="{$platDetailInfo[RefreshTime][Value]}"; +$table_title.=")"; + + + + +echo "
      {$table_title}
      "; + + +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "back"; + echo "
      "; + +echo ""; +adjust_content_tail(); + +?> + diff --git a/wxc2_omc/fault/platAdvanceStatus/smpp_status.php b/wxc2_omc/fault/platAdvanceStatus/smpp_status.php new file mode 100755 index 0000000..3e99409 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/smpp_status.php @@ -0,0 +1,114 @@ + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > SMPP Status"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + //echo "$strBlack"; + echo "back"; + + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + + + +$config=parse_ini_file("../platStatus/config.ini",true); +$config_count=sizeof($config); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,9); + + +$table_title="SMPP( "; +$table_title.=" Status:"; +$table_title.="{$platDetailInfo[SMPP][Status][Value]}"; +$table_title.=","; +$table_title.="RefreshTime:"; +$table_title.="{$platDetailInfo[RefreshTime][Value]}"; +$table_title.=")"; + + + echo "
      $table_title

      "; + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<8;$i++) + { + echo ""; + + for($j=0;$j<4;$j++) + { + $dis_no=($j)*8+$i; + echo ""; + echo ""; + } + + echo ""; + } + + echo "
      Port noStatusPort noStatusPort noStatusPort noStatus
      "; + echo $dis_no; + echo ""; + $dis_port=($j)*8+$i; + //echo "$dis_port"; + echo "{$platDetailInfo[SMPP][SMPPLink][$dis_port][Value]}"; + echo "
      "; +?> +"; + echo ""; + echo ""; + echo "Remarks: 0 = Not initializing , 1 = Idle, 2 = Waiting, 3 =Established."; + echo ""; + + //echo "back"; + echo ""; + echo "back"; + echo ""; + echo ""; + echo ""; +?> + + + + + + + + diff --git a/wxc2_omc/fault/platAdvanceStatus/snmp_status.php b/wxc2_omc/fault/platAdvanceStatus/snmp_status.php new file mode 100755 index 0000000..a18d7c6 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/snmp_status.php @@ -0,0 +1,105 @@ + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > SNMP Status"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + //echo "$strBlack"; + echo "back"; + + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + +$config=parse_ini_file("../platStatus/config.ini",true); +$config_count=sizeof($config); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,4); + +$table_title="SNMP( Version:"; +$table_title.=" {$platDetailInfo[SNMP][Version][Value]}"; +$table_title.=","; +$table_title.=" Status:"; +$table_title.="{$platDetailInfo[SNMP][Status][Value]}"; +$table_title.=","; +$table_title.="RefreshTime:"; +$table_title.="{$platDetailInfo[RefreshTime][Value]}"; +$table_title.=")"; + + + echo "
      $table_title
      "; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo "
      "; +?> + +"; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo "
      Function typeRegistered number
      TARP{$platDetailInfo[SNMP][TrapFuncCount][Value]}
      SET{$platDetailInfo[SNMP][SetFuncCount][Value]}
      GET{$platDetailInfo[SNMP][GetFuncCount][Value]}
      RSP{$platDetailInfo[SNMP][RspFuncCount][Value]}
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo "
      "; + //echo "$strBlack"; + echo "back"; + + echo "
      "; +?> + + diff --git a/wxc2_omc/fault/platAdvanceStatus/tcap_status.php b/wxc2_omc/fault/platAdvanceStatus/tcap_status.php new file mode 100755 index 0000000..3192668 --- /dev/null +++ b/wxc2_omc/fault/platAdvanceStatus/tcap_status.php @@ -0,0 +1,109 @@ + + +"; +echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Advanced > TCAP Status"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + //echo "$strBlack"; + echo "back"; + + echo "
      "; + + +adjust_title_tail(); +adjust_content_head(); + + + +$config=parse_ini_file("../platStatus/config.ini",true); +$config_count=sizeof($config); + +$platDetailInfo=GetDetailPlatInfo($sysNo,$subSysNo,3); + + +$table_title="TCAP( Version:"; +$table_title.=" {$platDetailInfo[TCAP][Version][Value]}"; +$table_title.=","; +$table_title.=" Status:"; +$table_title.="{$platDetailInfo[TCAP][Status][Value]}"; +$table_title.=","; +$table_title.="RefreshTime:"; +$table_title.="{$platDetailInfo[RefreshTime][Value]}"; +$table_title.=")"; + + + echo "
      $table_title

      "; + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + if(strcmp($platDetailInfo[TCAP][Status][Value],"--")) + { + echo ""; + echo ""; + + echo ""; + + echo ""; + } + else + { + echo ""; + echo " "; + echo " "; + echo ""; + } + + + echo "
      Current Used Dialogue IDMax Used Dialogue ID
      "; + echo "{$platDetailInfo[TCAP][CurrentUsedDialogueID][Value]}"; + echo ""; + echo "{$platDetailInfo[TCAP][MaxUsedDialogueID][Value]}"; + echo "
      ----
      "; +?> + +"; + echo ""; + //echo "back"; + echo ""; + echo "back"; + echo ""; + echo ""; + echo ""; +?> + + + + + + + + diff --git a/wxc2_omc/fault/platAdvanceStatus_our.tgz b/wxc2_omc/fault/platAdvanceStatus_our.tgz new file mode 100755 index 0000000..27c0dcc Binary files /dev/null and b/wxc2_omc/fault/platAdvanceStatus_our.tgz differ diff --git a/wxc2_omc/fault/platStatus/config.ini b/wxc2_omc/fault/platStatus/config.ini new file mode 100755 index 0000000..6f83deb --- /dev/null +++ b/wxc2_omc/fault/platStatus/config.ini @@ -0,0 +1,19 @@ +# This file conf the total plat definition + +PlatSysTypeNo=200 +[0] +PlatformName="EMS" +PlatformID=0 +PlatformNo=2 +[8] +PlatformName="VSS" +PlatformID=8 +PlatformNo=10 +[9] +PlatformName="MSS" +PlatformID=9 +PlatformNo=2 +[18] +PlatformName="RCM" +PlatformID=18 +PlatformNo=2 diff --git a/wxc2_omc/fault/platStatus/plat_status.php b/wxc2_omc/fault/platStatus/plat_status.php new file mode 100755 index 0000000..c069e33 --- /dev/null +++ b/wxc2_omc/fault/platStatus/plat_status.php @@ -0,0 +1,223 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > NSS > Platform"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strClear"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); +if(0) +{ + echo "config_count=$config_count
      "; + echo "
      ";
      +	print_r($config);
      +	echo "
      "; +} + +if($clearAll == 1) +{ + $sql="delete from OMC_PUB.sysInfo where sysTypeNo={$config[PlatSysTypeNo]} "; + @mysqli_query($pubConn,$sql); + echo mysqli_error($pubConn); +} + +echo "
      Platform summary information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +foreach($config as $key => $val) +{ + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + + + + for($j=0;$j<$config[$key][PlatformNo];$j++) + { + //Rowline + $id=AssignID(); + echo ""; + //Item Name + + echo ""; + //Status + $id=AssignID(); + echo ""; + + //Start Time + $id=AssignID(); + echo ""; + + //Refresh Time + $id=AssignID(); + echo ""; + + //IP Address + $id=AssignID(); + echo ""; + + echo ""; + } +} + +echo "
      ItemStatusStart TimeRefresh TimeIP Address
      ----------
      {$config[$key][PlatformName]}_{$j}"; + echo ""; + echo "$id"; + echo ""; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo ""; + echo "$id"; + echo "
      "; + + +echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "$strClear"; + echo "
      "; +if($clearAll) +{ + echo "\n"; +} + +echo ""; +adjust_content_tail(); +?> + + diff --git a/wxc2_omc/fault/platStatus/plat_status_detail.php b/wxc2_omc/fault/platStatus/plat_status_detail.php new file mode 100755 index 0000000..6619581 --- /dev/null +++ b/wxc2_omc/fault/platStatus/plat_status_detail.php @@ -0,0 +1,387 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > Platform"; + echo ""; + //showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strBack"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +$platID=$_REQUEST['platID']; +$subSysNo=$_REQUEST['subSysNo']; +if(0) +{ + echo "subSysNo=$subSysNo,platID=$platID
      "; +} + +$config=parse_ini_file("config.ini",true); +$config_count=sizeof($config); +foreach($config as $key => $val) +{ + if($config[$key][PlatformID] == $platID) + { + $thisconfig=$config[$key]; + break; + } +} + +$tmpconf[PlatNo]=$platID; +$plat=GetPlatInfo($tmpconf,$subSysNo); +if(0) +{ + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; +} +echo "
      {$thisconfig[PlatformName]}_$subSysNo platform information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      Status"; + //platform Status + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      Refresh Time"; + //Refresh Time + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      Start Time"; + //Start Time + $id=AssignID(); + echo ""; + echo "--"; + echo ""; +echo "
      CPU Usage"; + //CPU Usage PN + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + //CPU Usage Rate + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + +echo "
      Physical Memory"; + //Physical Memory Used/Total + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + echo "(Used/Total)"; + echo "
      "; + + //Physical Memory Used/Swap + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + echo "(Used/Swap)"; + echo "
      "; + + + $id=AssignID(); + echo "Buffers:"; + echo " "; + echo ""; + echo "--"; + echo ""; + + echo "; "; + + $id=AssignID(); + echo "Cached:"; + echo " "; + echo ""; + echo "--"; + echo ""; + + echo "
      "; + +echo "
      Harddisk Space"; + //Harddisk, support 16 harddisk + for($i=0;$i<16;$i++) + { + $id=AssignID(); + if($i==0) + echo ""; + else + echo ""; + + $id=AssignID(); + $val=GetProcessLabel(0); + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo " "; + + $id=AssignID(); + echo ""; + echo "--"; + echo ""; + + echo "
      "; + + echo "
      "; + + } + +echo "
      "; + +//Remark Table +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "$strBack"; + echo "
      "; + +adjust_content_tail(); +?> + + +\n"; + echo "updateStatus('$platID','$subSysNo');\n"; + echo "\n"; +?> diff --git a/wxc2_omc/fault/platStatus/plat_status_detail_update.php b/wxc2_omc/fault/platStatus/plat_status_detail_update.php new file mode 100755 index 0000000..0267253 --- /dev/null +++ b/wxc2_omc/fault/platStatus/plat_status_detail_update.php @@ -0,0 +1,185 @@ + $val) +{ + if($config[$key][PlatformID] == $platID) + { + $thisconfig=$config[$key]; + break; + } +} + + + +$sql="select * from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$platID} and subSysNo=$subSysNo "; +//echo "$sql
      "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num == 0) + exit(); + +$tmpconf['PlatNo']=$platID; +$plat=GetPlatInfo($tmpconf,$subSysNo); + + + +//platform Status +$id=AssignID(); +$sql="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$platID} and subSysNo=$subSysNo "; +//echo "$sql
      "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num != 1) +{ + $baseStat=0; +} +else +{ + $row=@mysqli_fetch_array($res); + $baseStat=$row[baseStat]+0; +} +$refresh_time=$row[updateTime]; +$due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); +$ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); +if($refresh_time < $due_date || $refresh_time > $ove_date) +{ + $valid_time=0; +} +else +{ + $valid_time=1; +} +if($valid_time == 0 || $baseStat == 0) + $total_response.="$id,block,N,#ff0000;"; +else + $total_response.="$id,block,Y,#0000ff;"; + +//Refresh Time +$id=AssignID(); +if($valid_time) + $total_response.="$id,block,$refresh_time,#0000ff;"; +else + $total_response.="$id,block,$refresh_time,#ff0000;"; + +//Start Time +$id=AssignID(); +if(trim($plat[StartTime][Value]) == "") + $total_response.="$id,block,--,#000000;"; +else + $total_response.="$id,block,{$plat[StartTime][Value]},#0000ff;"; + + +//CPU Usage PN +$id=AssignID(); +$message="{$id},{$plat[CPURatePN][Display]},{$plat[CPURatePN][Value]},{$plat[CPURatePN][Color]};"; +$total_response.=$message; + +//CPU Usage +$id=AssignID(); +$message="{$id},{$plat[CPURate][Display]},{$plat[CPURate][Value]},{$plat[CPURate][Color]};"; +$total_response.=$message; + +//Physical Memory +$id=AssignID(); +$message="{$id},{$plat[PMTotalRatePN][Display]},{$plat[PMTotalRatePN][Value]},{$plat[PMTotalRatePN][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMTotalRate][Display]},{$plat[PMTotalRate][Value]},{$plat[PMTotalRate][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMTotalRateV][Display]},{$plat[PMTotalRateV][Value]},{$plat[PMTotalRateV][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRatePN][Display]},{$plat[PMSwapRatePN][Value]},{$plat[PMSwapRatePN][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRate][Display]},{$plat[PMSwapRate][Value]},{$plat[PMSwapRate][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMSwapRateV][Display]},{$plat[PMSwapRateV][Value]},{$plat[PMSwapRateV][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMBuffers][Display]},{$plat[PMBuffers][Value]},{$plat[PMBuffers][Color]};"; +$total_response.=$message; + +$id=AssignID(); +$message="{$id},{$plat[PMCached][Display]},{$plat[PMCached][Value]},{$plat[PMCached][Color]};"; +$total_response.=$message; + +//Harddisk +for($i=0;$i<16;$i++) +{ + if($i<$plat[HDNum]) + { + $id=AssignID(); + $message="{$id},layerShow,no,no;"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][PN][Display]},{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][Rate][Display]},{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][V][Display]},{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},{$plat[HD][$i][Path][Display]},{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};"; + $total_response.=$message; + } + else + { + $id=AssignID(); + $message="{$id},layerHide,no,no;"; + $total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][PN][Value]},{$plat[HD][$i][PN][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][Rate][Value]},{$plat[HD][$i][Rate][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][V][Value]},{$plat[HD][$i][V][Color]};"; + //$total_response.=$message; + + $id=AssignID(); + $message="{$id},none,{$plat[HD][$i][Path][Value]},{$plat[HD][$i][Path][Color]};"; + //$total_response.=$message; + } +} + +echo "$total_response"; +?> diff --git a/wxc2_omc/fault/platStatus/plat_status_update.php b/wxc2_omc/fault/platStatus/plat_status_update.php new file mode 100755 index 0000000..88d9584 --- /dev/null +++ b/wxc2_omc/fault/platStatus/plat_status_update.php @@ -0,0 +1,103 @@ + + + + $val) +{ + if(strcmp($key,"PlatSysTypeNo")==0) + { + continue; + } + for($sysNo=0;$sysNo<$config[$key]['PlatformNo'];$sysNo++) + { + $sql="select * from OMC_PUB.sysInfo where sysTypeNo={$config['PlatSysTypeNo']} and sysNo={$config[$key]['PlatformID']} and subSysNo={$sysNo} "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + + if($num == 0) + { + $id=AssignID(); + $total_response.="$id,none,none,none;"; + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + $id=AssignID(); + continue; + } + else + { + $row=@mysqli_fetch_array($res); + $id=AssignID(); + $total_response.="$id,block,none,none;"; + + //Status + $id=AssignID(); + $value=$row['baseStat']+0; + $refresh_time=$row['updateTime']; + $due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + $ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); + if($refresh_time < $due_date || $refresh_time > $ove_date) + { + $valid_time=0; + } + else + { + $valid_time=1; + } + if($valid_time == 0 || $value == 0) + $total_response.="$id,block,N,#ff0000;"; + else + $total_response.="$id,block,Y,#0000ff;"; + + //Start Time + $id=AssignID(); + $tmpConf['PlatNo']=$config[$key]['PlatformID']; + $plat=GetPlatInfo($tmpConf,$sysNo); + if(trim($plat['StartTime']['Value']) == "") + $total_response.="$id,block,--,#0000ff;"; + else + $total_response.="$id,block,{$plat['StartTime']['Value']},#0000ff;"; + + //Refresh Time + $id=AssignID(); + if($valid_time) + $total_response.="$id,block,$refresh_time,#0000ff;"; + else + $total_response.="$id,block,$refresh_time,#ff0000;"; + + //IP Address + $id=AssignID(); + $value=$row['ip']; + $total_response.="$id,block,$value,#0000ff;"; + + $show_num++; + } + } +} +if($show_num) + $total_response.="blank_line,none,none,none;"; + +echo $total_response; +?> diff --git a/wxc2_omc/fault/raidStatus/diskStatus.php b/wxc2_omc/fault/raidStatus/diskStatus.php new file mode 100755 index 0000000..a405873 --- /dev/null +++ b/wxc2_omc/fault/raidStatus/diskStatus.php @@ -0,0 +1,173 @@ + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > NSS > RAID"; + echo ""; + $helpId="1.2.7"; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strBack"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +$diskInfo=GetDiskInfo($sysTypeNo,$sysNo); + +echo "
      "; +echo "
      {$diskInfo[ServerName][Value]} Raid detail information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      Card Name-- 
      Disk Count-- 
      Update Time-- 
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +for($index=0;$index<6;$index++) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +echo "
      Disk No.StateSizeVendor IDProduct IDDisk SlotError CountOperation Progress
      ----------------
      $index-- -- -- -- -- -- -- 
      "; + +//Alarm Table +echo "
      "; +echo "
      "; + +adjust_content_tail(); + +?> + + + +\n"; + echo "updateStatus('$sysTypeNo','$sysNo');\n"; + echo "\n"; +?> diff --git a/wxc2_omc/fault/raidStatus/diskStatus_update.php b/wxc2_omc/fault/raidStatus/diskStatus_update.php new file mode 100755 index 0000000..0cda758 --- /dev/null +++ b/wxc2_omc/fault/raidStatus/diskStatus_update.php @@ -0,0 +1,109 @@ + + +0) + $response.="tr{$td_opt}blank_line{$td_opt}none{$tr_opt}"; +else + $response.="tr{$td_opt}blank_line{$td_opt}block{$tr_opt}"; + + +for($index=0;$index<6;$index++) +{ + if($index < $diskInfo[DiskCount][Value]) + { + $response.="tr{$td_opt}tr_{$index}{$td_opt}block{$tr_opt}"; + $response.="td{$td_opt}td_{$index}_1{$td_opt}{$diskInfo[$index][DiskState][Value]}{$td_opt}{$diskInfo[$index][DiskState][Color]}{$tr_opt}"; + $response.="td{$td_opt}td_{$index}_2{$td_opt}{$diskInfo[$index][DiskSize][Value]}{$td_opt}{$diskInfo[$index][DiskSize][Color]}{$tr_opt}"; + $response.="td{$td_opt}td_{$index}_3{$td_opt}{$diskInfo[$index][VendorID][Value]}{$td_opt}{$diskInfo[$index][VendorID][Color]}{$tr_opt}"; + $response.="td{$td_opt}td_{$index}_4{$td_opt}{$diskInfo[$index][ProductID][Value]}{$td_opt}{$diskInfo[$index][ProductID][Color]}{$tr_opt}"; + $response.="td{$td_opt}td_{$index}_5{$td_opt}{$diskInfo[$index][DiskSlot][Value]}{$td_opt}{$diskInfo[$index][DiskSlot][Color]}{$tr_opt}"; + $response.="td{$td_opt}td_{$index}_6{$td_opt}{$diskInfo[$index][DiskERRC][Value]}{$td_opt}{$diskInfo[$index][DiskERRC][Color]}{$tr_opt}"; + $response.="td{$td_opt}td_{$index}_7{$td_opt}{$diskInfo[$index][OptProg][Value]}{$td_opt}{$diskInfo[$index][OptProg][Color]}{$tr_opt}"; + } + else + { + $response.="tr{$td_opt}tr_{$index}{$td_opt}none{$tr_opt}"; + } +} + +//Alarm +$omcSysNo=getOmcSysNo(); +$confInfo=GetConfInfo(); +if($sysTypeNo == 0) +{ + if(strcmp($confInfo[SystemType],"MCSS")==0) + $reg_rule="^2{$sysNo}.$"; + else + $reg_rule="^1{$sysNo}.$"; +} +else if($sysTypeNo == 320) +{ + $reg_rule="^3{$sysNo}.$"; +} +else if($sysTypeNo == 390) +{ + $reg_rule="^4{$sysNo}.$"; +} +else if($sysTypeNo == 395) +{ + $reg_rule="^5{$sysNo}.$"; +} + +$sql="select * from sysAlarmLog where sysTypeNo=234 and sysNo={$omcSysNo} and clearMode=0 and compCode regexp '{$reg_rule}' order by alarmTime desc"; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num > 0) +{ + $message="
      {$diskInfo[ServerName][Value]} Alarm List
      "; + $message.=""; + $message.=""; + $message.=""; + $message.=""; + $message.=""; + $message.=""; + + for($i=0;$i<$num;$i++) + { + $row=mysqli_fetch_array($res); + $alarmTime=$row[alarmTime]; + $tmpsql="select * from sysAlarmConf where sysTypeNo=234 and compCode='$row[compCode]' and alarmCode='$row[alarmCode]' "; + $tmpres=@mysqli_query($pubConn,$tmpsql); + echo mysqli_error($pubConn); + $tmprow=@mysqli_fetch_array($tmpres); + $alarmLevel=$tmprow[alarmLevel]; + if(trim($tmprow[alarmDesc_2]) == "") + $message.=""; + else + $message.=""; + $message.=""; + $message.=""; + $message.=""; + $message.=""; + } + $message.="
      Alarm LevelEventsAlarm Time
      {$alarmLevelDefArr[$alarmLevel][remark]}{$tmprow[alarmDesc_2]}$alarmTime
      "; + + $response.="alarm{$td_opt}AlarmTable{$td_opt}{$message}{$tr_opt}"; +} +else +{ + $response.="alarm{$td_opt}AlarmTable{$td_opt}none{$tr_opt}"; +} + +//system("echo '$response'>>/tmp/test.txt"); + +echo $response; +?> diff --git a/wxc2_omc/fault/raidStatus/function.inc b/wxc2_omc/fault/raidStatus/function.inc new file mode 100755 index 0000000..5a965a3 --- /dev/null +++ b/wxc2_omc/fault/raidStatus/function.inc @@ -0,0 +1,211 @@ += $diskInfo[UpdateTime][Value]) + $diskInfo[UpdateTime][Value]=$row[updateTime]; + + if(strcmp($row[fieldName],"CardName") == 0) + { + $diskInfo[CardName][Value]=$row[fieldValue]; + $diskInfo[CardName][Color]="#000000"; + } + else if(strcmp($row[fieldName],"DiskNum") == 0) + { + $diskInfo[DiskCount][Value]=$row[fieldValue]-0; + $diskInfo[DiskCount][Color]="#000000"; + } + else if(strcmp($row[fieldName],"DiskState") == 0) + { + $value=$row[fieldValue]-0; + + //Intel + if($confInfo[ServerType][$sysTypeNo] == 0) + { + switch($value) + { + case 24: + $diskInfo[$disk_no][DiskState][Value]="Online"; + $diskInfo[$disk_no][DiskState][Color]="#0000ff"; + break; + case 16: + $diskInfo[$disk_no][DiskState][Value]="Offline"; + $diskInfo[$disk_no][DiskState][Color]="#ff0000"; + break; + case 17: + $diskInfo[$disk_no][DiskState][Value]="Failed"; + $diskInfo[$disk_no][DiskState][Color]="#ff0000"; + break; + case 20: + $diskInfo[$disk_no][DiskState][Value]="Rebuild"; + $diskInfo[$disk_no][DiskState][Color]="#ff0000"; + break; + default: + $diskInfo[$disk_no][DiskState][Value]="Unknown"; + $diskInfo[$disk_no][DiskState][Color]="#ff0000"; + break; + } + } + //Dell + else + { + switch($value) + { + case 3: + $diskInfo[$disk_no][DiskState][Value]="Online"; + $diskInfo[$disk_no][DiskState][Color]="#0000ff"; + break; + case 4: + $diskInfo[$disk_no][DiskState][Value]="Offline"; + $diskInfo[$disk_no][DiskState][Color]="#ff0000"; + break; + case 2: + $diskInfo[$disk_no][DiskState][Value]="Failed"; + $diskInfo[$disk_no][DiskState][Color]="#ff0000"; + break; + case 24: + $diskInfo[$disk_no][DiskState][Value]="Rebuild"; + $diskInfo[$disk_no][DiskState][Color]="#ff0000"; + break; + default: + $diskInfo[$disk_no][DiskState][Value]="Unknown"; + $diskInfo[$disk_no][DiskState][Color]="#ff0000"; + break; + } + } + } + else + { + $disk_no=$row[instance]-0; + $diskInfo[$disk_no][$row[fieldName]][Value]=$row[fieldValue]; + $diskInfo[$disk_no][$row[fieldName]][Color]="#000000"; + } + } + + $refresh_time=$diskInfo[UpdateTime][Value]; + $due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + $ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); + if($refresh_time < $due_date || $refresh_time > $ove_date) + $diskInfo[UpdateTime][Color]="#ff0000"; + else + $diskInfo[UpdateTime][Color]="#0000ff"; + + return $diskInfo; +} +?> diff --git a/wxc2_omc/fault/raidStatus/raidStatus.php b/wxc2_omc/fault/raidStatus/raidStatus.php new file mode 100755 index 0000000..fee6f4d --- /dev/null +++ b/wxc2_omc/fault/raidStatus/raidStatus.php @@ -0,0 +1,144 @@ + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > NSS > RAID"; + echo ""; + $helpId="1.2.7"; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strClear"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + + +echo "
      "; +echo "
      Raid summary information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; + +if($clear_flag == 1) +{ + $sql="delete from RAID_DB.raid_status "; + //echo "$sql
      "; + mysqli_query($pubConn,$sql); +} + +for($index=0;$index<16;$index++) +{ + echo ""; + for($disk_index=0;$disk_index<9;$disk_index++) + { + echo ""; + } + echo ""; +} + +adjust_content_tail(); +?> + + + diff --git a/wxc2_omc/fault/raidStatus/raidStatus_update.php b/wxc2_omc/fault/raidStatus/raidStatus_update.php new file mode 100755 index 0000000..8ee9ace --- /dev/null +++ b/wxc2_omc/fault/raidStatus/raidStatus_update.php @@ -0,0 +1,63 @@ + + +"; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); + +if($num == 0) +{ + $response.="tr,blank_line,block;"; + for($i=0;$i<16;$i++) + $response.="tr,tr_{$i},none;"; +} +else +{ + $response.="tr,blank_line,none;"; + for($i=0;$i<16;$i++) + { + if($i<$num) + { + $row=@mysqli_fetch_array($res); + $sysTypeNo=$row['sysTypeNo']-0; + $sysNo=$row[sysNo]-0; + $diskInfo=GetDiskInfo($sysTypeNo,$sysNo); + $response.="tr,tr_{$i},block;"; + //if($diskInfo[DiskCount][Value] > 0) + $response.="td,td_{$i}_0,{$diskInfo[ServerName][Value]},{$diskInfo[ServerName][Color]};"; + //else + // $response.="td,td_{$i}_0,{$diskInfo[ServerName][Value]},{$diskInfo[ServerName][Color]};"; + + $response.="td,td_{$i}_1,{$diskInfo[DiskCount][Value]},{$diskInfo[DiskCount][Color]};"; + for($j=0;$j<6;$j++) + { + $id=2+$j; + if($j<$diskInfo[DiskCount][Value]) + echo "td,td_{$i}_{$id},{$diskInfo[$j][DiskState][Value]},{$diskInfo[$j][DiskState][Color]};"; + else + $response.="td,td_{$i}_{$id},--,#000000;"; + } + $response.="td,td_{$i}_8,{$diskInfo[UpdateTime][Value]},{$diskInfo[UpdateTime][Color]};"; + } + else + { + $response.="tr,tr_{$i},none;"; + } + } +} + +//system("echo '$response'>>/tmp/test.txt"); +echo $response; + +?> diff --git a/wxc2_omc/fault/serverStatus/serverStatus.php b/wxc2_omc/fault/serverStatus/serverStatus.php new file mode 100755 index 0000000..f5cdc30 --- /dev/null +++ b/wxc2_omc/fault/serverStatus/serverStatus.php @@ -0,0 +1,20 @@ + + + +"; + echo ""; +?> + + <body> + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + </body> + + + + diff --git a/wxc2_omc/fault/serverStatus/serverStatusDetail.php b/wxc2_omc/fault/serverStatus/serverStatusDetail.php new file mode 100755 index 0000000..f44f65b --- /dev/null +++ b/wxc2_omc/fault/serverStatus/serverStatusDetail.php @@ -0,0 +1,23 @@ +sys_id=$sys_id"; +$mod_type = isset($mod_type)?$mod_type:'0'; + +?> + + +"; + echo ""; +?> + + <body> + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + </body> + + + + diff --git a/wxc2_omc/fault/serverStatus/serverStatusDetailDown.php b/wxc2_omc/fault/serverStatus/serverStatusDetailDown.php new file mode 100755 index 0000000..850cfbe --- /dev/null +++ b/wxc2_omc/fault/serverStatus/serverStatusDetailDown.php @@ -0,0 +1,2642 @@ +$innerHtml"; +} +getSerial(); + + + +// +//***** +//$url_temp=$_SERVER["REQUEST_URI"]; +//echo "This page URL:$url_temp
      "; +$db=$omc_db; +$sys_id = isset($sys_id)?$sys_id:'all'; +$showRange = isset($showRange)?$showRange:'low'; +if($DEBUG)echo "
      sys_id=$sys_id"; +$mod_type = isset($mod_type)?$mod_type:'0'; + +$sysType = omc_sys_id_info($sys_id,sys_type); +$sysTypeNo = omc_sys_type2code($sysType); +$sysType=$PlatTypeDefArr[$sysNo][remark]; +$TypeNo = omc_sys_type2code($sysType); +if($DEBUG)echo "
      sys_id=$sys_id"; + +//echo "
      mod_type=$mod_type"; + +$due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); +$ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +?> + + + + +"; + + +$defineStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineIptransStatus=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineMtp3Status=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '2', 'remark' => '--', 'color' => '#000000'), + array('num' => '3', 'remark' => '--', 'color' => '#000000') +); + +$defineSnmpStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineSccpStatus=array( + array('num' => '0', 'remark' => 'Fail', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Congest', 'color' => '#FF0000'), + array('num' => '2', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineTcapStatus=array( + array('num' => '0', 'remark' => 'Not used', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineDebugStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$omcDebugModule=array( + array('num' => '0', 'remark' => 'IPTRANS', 'color' => '#000000'), + array('num' => '1', 'remark' => 'MTP3', 'color' => '#000000'), + array('num' => '2', 'remark' => 'SCCP', 'color' => '#000000'), + array('num' => '3', 'remark' => 'TCAP', 'color' => '#000000'), + array('num' => '4', 'remark' => 'XAP-P', 'color' => '#000000'), + array('num' => '5', 'remark' => 'MSC', 'color' => '#000000'), + array('num' => '6', 'remark' => 'VLR', 'color' => '#000000'), + array('num' => '7', 'remark' => '--', 'color' => '#000000'), + array('num' => '8', 'remark' => 'HLR', 'color' => '#000000'), + array('num' => '9', 'remark' => 'SMSC', 'color' => '#000000'), + array('num' => '10', 'remark' => 'PPS', 'color' => '#000000'), + array('num' => '11', 'remark' => 'SNMP', 'color' => '#000000'), + array('num' => '12', 'remark' => '--', 'color' => '#000000'), + array('num' => '13', 'remark' => 'DEBUG', 'color' => '#000000'), + array('num' => '14', 'remark' => 'CDR', 'color' => '#000000'), + array('num' => '15', 'remark' => 'SS7 Gate','color' => '#000000') +); +$aucDebugModule=array( + array('num' => '0', 'remark' => 'IPTRANS', 'color' => '#000000'), + array('num' => '1', 'remark' => 'MTP3', 'color' => '#000000'), + array('num' => '2', 'remark' => 'SCCP', 'color' => '#000000'), + array('num' => '3', 'remark' => 'TCAP', 'color' => '#000000'), + array('num' => '4', 'remark' => 'XAP-P', 'color' => '#000000'), + array('num' => '5', 'remark' => 'MSC', 'color' => '#000000'), + array('num' => '6', 'remark' => 'VLR', 'color' => '#000000'), + array('num' => '7', 'remark' => '--', 'color' => '#000000'), + array('num' => '8', 'remark' => 'HLR', 'color' => '#000000'), + array('num' => '9', 'remark' => 'SMSC', 'color' => '#000000'), + array('num' => '10', 'remark' => 'PPS', 'color' => '#000000'), + array('num' => '11', 'remark' => 'SNMP', 'color' => '#000000'), + array('num' => '12', 'remark' => '--', 'color' => '#000000'), + array('num' => '13', 'remark' => 'DEBUG', 'color' => '#000000'), + array('num' => '14', 'remark' => 'AUC', 'color' => '#000000'), + array('num' => '15', 'remark' => 'EIR', 'color' => '#000000') +); +$otherDebugModule=array( + array('num' => '0', 'remark' => 'IPTRANS', 'color' => '#000000'), + array('num' => '1', 'remark' => 'MTP3', 'color' => '#000000'), + array('num' => '2', 'remark' => 'SCCP', 'color' => '#000000'), + array('num' => '3', 'remark' => 'TCAP', 'color' => '#000000'), + array('num' => '4', 'remark' => 'XAP-P', 'color' => '#000000'), + array('num' => '5', 'remark' => 'MSC', 'color' => '#000000'), + array('num' => '6', 'remark' => 'VLR', 'color' => '#000000'), + array('num' => '7', 'remark' => '--', 'color' => '#000000'), + array('num' => '8', 'remark' => 'HLR', 'color' => '#000000'), + array('num' => '9', 'remark' => 'SMSC', 'color' => '#000000'), + array('num' => '10', 'remark' => 'PPS', 'color' => '#000000'), + array('num' => '11', 'remark' => 'SNMP', 'color' => '#000000'), + array('num' => '12', 'remark' => '--', 'color' => '#000000'), + array('num' => '13', 'remark' => 'DEBUG', 'color' => '#000000'), + array('num' => '14', 'remark' => 'AUC', 'color' => '#000000'), + array('num' => '15', 'remark' => 'EIR', 'color' => '#000000') +); + +$defineModuleStatus=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineSyncStatus=array( + array('num' => '0', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Restart', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Init', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'suspend', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'Stop', 'color' => '#FF0000') +); + +$defineSsnStatus=array( + array('num' => '0', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '1', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '2', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '3', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'OMC', 'color' => '#0000FF'), + array('num' => '5', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'HLR', 'color' => '#0000FF'), + array('num' => '7', 'remark' => 'VLR', 'color' => '#0000FF'), + array('num' => '8', 'remark' => 'MSC', 'color' => '#0000FF'), + array('num' => '9', 'remark' => 'EIR', 'color' => '#0000FF'), + array('num' => '10', 'remark' => 'AUC', 'color' => '#0000FF'), + array('num' => '11', 'remark' => 'SMSC', 'color' => '#0000FF'), + array('num' => '12', 'remark' => 'CAP(CCF)', 'color' => '#0000FF'), + array('num' => '13', 'remark' => 'CAP(SCF)', 'color' => '#0000FF'), + array('num' => '14', 'remark' => 'AIF', 'color' => '#0000FF'), + array('num' => '15', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '16', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '17', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '18', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '19', 'remark' => 'ESME', 'color' => '#0000FF'), + array('num' => '20', 'remark' => 'SMPP', 'color' => '#0000FF'), + array('num' => '21', 'remark' => 'MNP', 'color' => '#0000FF'), + array('num' => '22', 'remark' => 'USSD', 'color' => '#0000FF') +); + + +$sysType = omc_sys_id_info($sys_id,sys_type); +$sysTypeNo = omc_sys_type2code($sysType); +$sysNo = omc_sys_id_info($sys_id,sys_num); +$subSysNo = omc_sys_id_info($sys_id,subsys_num); +if($DEBUG)echo "
      sysType=$sysType"; +if($DEBUG)echo "
      sysNo=$sysNo"; +if($DEBUG)echo "
      subSysNo=$subSysNo"; + +$sysType=$PlatTypeDefArr[$sysNo][remark]; +$TypeNo = omc_sys_type2code($sysType); +$selPlat="SELECT platHeart FROM sysConf WHERE sysTypeNo = '$TypeNo' "; +if($DEBUG)echo "
      selPlat=$selPlat"; +$resPlat=@mysqli_query($pubConn,$selPlat); +$rowPlat=@mysqli_fetch_array($resPlat); +$sysNo = $rowPlat[0]; + +if($DEBUG)echo "
      sysType=$sysType"; +if($DEBUG)echo "
      sysNo=$sysNo"; +if($DEBUG)echo "
      subSysNo=$subSysNo"; + + +if($sysType == 'EMS') + $helpId="1.2.2.1"; +else + $helpId="1.2.2.2"; + +adjust_title_head(); +echo "
      ServerDisk CountDisk#0Disk#1Disk#2Disk#3Disk#4Disk#5Refresh Time"; +echo "
      ------------------
      --
      "; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > Subsystem > $strServer"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo ""; + echo "$strBack"; + echo "
      "; + +adjust_title_tail(); +adjust_content_head(); + +$sel_mes_sql="SELECT detailStat,updateTime,sysTypeNo FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; +if($DEBUG) + echo "
      sel_mes_sql=$sel_mes_sql"; +$sel_mes_res=mysqli_query($pubConn,$sel_mes_sql); +$sel_mes_row=@mysqli_fetch_array($sel_mes_res); +echo mysqli_error($pubConn); +//echo "
      sel_mes_sql=$sel_mes_sql"; +if(!$sel_mes_row) +{ + echo "
      $strNotInstalled"; + exit(); +} + +$hex_mes=$sel_mes_row[detailStat]; + +if($DEBUG) + echo "
      hex_mes=$hex_mes"; +$refresh_time=$sel_mes_row[updateTime]; +if($refresh_time > $due_date && $refresh_time < $ove_date) +{ + $color_refresh_time="#0000FF"; +} +else +{ + $no_sys_status=1; + $no_vlr_status=1; + $color_refresh_time="#FF0000"; +} + +$bin_mes=''; +//============================ +/* +$ty=$sel_mes_row[sysTypeNo]; +$tt=$sel_mes_row[updateTime]; +echo "sysType:$ty
      "; +echo "time:$tt
      "; +echo "hex_mes:$hex_mes
      "; +*/ +//============================ + + + +for($i=0;$ibin_mes=$bin_mes"; + + +/************************************iptrans************************************/ +$iptrans_bgn_byt=21; +$iptrans_len_bin=substr($bin_mes,$iptrans_bgn_byt*8,16);//iptrans所占长度,19bytes +$iptrans_len_dec=BinDec($iptrans_len_bin); +if($iptrans_len_dec > 0){ + $showIptrans = 1; +} + +if($DEBUG)echo "
      iptrans_len_dec=$iptrans_len_dec"; + +//版本号 +$bin_version_0=substr($bin_mes,($iptrans_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($iptrans_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($iptrans_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG) +echo "
      version=$version"; + +//状态 +$iptrans_state_bin=substr($bin_mes,($iptrans_bgn_byt+5)*8,8); +$iptrans_state_dec=BinDec($iptrans_state_bin); +if($DEBUG)echo "
      iptrans_state_dec=$iptrans_state_dec"; + +//port状态 +for($i=0;$i<4;$i++){ + for($j=0;$j<8;$j++){ + $num=($i+1)*8-1-$j; + $port_bin="port_".$num."_bin"; + $port_dec="port_".$num."_dec"; + ${$port_bin}=substr($bin_mes,($iptrans_bgn_byt+6)*8+$i*8+$j,1); + ${$port_dec}=BinDec(${$port_bin}); + if($DEBUG)echo "
      $port_dec=${$port_dec}"; + } +} + +if($mod_type==1){ + if(!$showIptrans){ + echo "
      $strNotInstalled"; + exit(); + } +?> + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; + +$id = "input_iptrans_state"; +if($iptrans_state_dec<2){ + $color = $defineStatus[$iptrans_state_dec][color]; + $innerHtml = $defineStatus[$iptrans_state_dec][remark]; +}else{ + $color = "#0000FF"; + $innerHtml = '--'; +} +outSpanId($id,$innerHtml,$color); + +echo ", "; +echo "$strRefreshTime:"; +$id = "input_refresh_time"; +outSpanId($id,$refresh_time,$color_refresh_time); +echo " )"; +?> +

      +

      + + + + + + + + + + + +"; + for($j=0;$j<8;$j++) + { + if($j%2==0) + { + $dis_no=4950+($j/2)*8+$i; + echo ""; + } + else + { + $id="input_port_status" . "_$i" . "_$j"; + $dis_port=(($j-1)/2)*8+$i; + $port_name="port_".$dis_port."_dec"; + $port_status=${$port_name}; + echo ""; + } + } + echo ""; +} +?> +
      + + + + + + + + + + + + + + + +
      "; + echo $dis_no; + echo ""; + outSpanId($id,$defineIptransStatus[$port_status][remark],$defineIptransStatus[$port_status][color]); + echo "
      +mtp3_bgn_byt=$mtp3_bgn_byt"; +$mtp3_len_bin=substr($bin_mes,$mtp3_bgn_byt*8,16);//mtp3所占长度 +$mtp3_len_dec=BinDec($mtp3_len_bin); +if($mtp3_len_dec){ + $showMtp3=1; +} +if($DEBUG)echo "
      mtp3_len_dec=$mtp3_len_dec"; + +//版本号 +$bin_version_0=substr($bin_mes,($mtp3_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($mtp3_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($mtp3_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 +$mtp3_state_bin=substr($bin_mes,($mtp3_bgn_byt+5)*8,8); +$mtp3_state_dec=BinDec($mtp3_state_bin); +if($DEBUG)echo "
      mtp3_state_dec=$mtp3_state_dec"; + +//link状态 +for($i=0;$i<64;$i++) +{ + for($j=0;$j<4;$j++) + { + $num=($i+1)*4-1-$j; + if($DEBUG)echo "
      num=$num"; + $link_bin="link_".$num."_bin"; + $link_dec="link_".$num."_dec"; + ${$link_bin}=substr($bin_mes,($mtp3_bgn_byt+6)*8+$i*8+$j*2,2); + ${$link_dec}=BinDec(${$link_bin}); + if($DEBUG)echo "
      $link_dec=${$link_dec}"; + } +} + +//linkset状态 +for($i=0;$i<32;$i++) +{ + for($j=0;$j<4;$j++) + { + $num=($i+1)*4-1-$j; + if($DEBUG)echo "
      num=$num"; + $linkset_bin="linkset_".$num."_bin"; + $linkset_dec="linkset_".$num."_dec"; + ${$linkset_bin}=substr($bin_mes,($mtp3_bgn_byt+6+64)*8+$i*8+$j*2,2); + ${$linkset_dec}=BinDec(${$linkset_bin}); + if($DEBUG)echo "
      $linkset_dec=${$linkset_dec}"; + } +} + + +if($mod_type==2) +{ + if(!$showMtp3) + { + echo "
      $strNotInstalled"; + exit(); + } +?> +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +$id = 'input_mtp3_state'; +if($mtp3_state_dec<2){ + $innerHtml = $defineStatus[$mtp3_state_dec][remark]; + $color = $defineStatus[$mtp3_state_dec][color]; +}else{ + $innerHtml = '--'; + $color = '#0000FF'; +} +outSpanId($id,$innerHtml,$color); +echo ", "; +echo "$strRefreshTime:"; +$id = "input_refresh_time"; +outSpanId($id,$refresh_time,$color_refresh_time); +echo " )"; +?> +

      +

      + + + + + + + + + + + + + +"; + for($j=0;$j<8;$j++) + { + if($j%2==0) + { + $dis_no=($j/2)*64+$i; + echo ""; + } + else + { + $id = "input_mtp3_link_status" . "_$i" . "_$j"; + $dis_link=(($j-1)/2)*64+$i; + $link_name="link_".$dis_link."_dec"; + $link_status=${$link_name}; + echo ""; + } + } + echo ""; +} +?> +
      +Link +
      + + + + + + + + + + + + + + + +
      "; + echo $dis_no; + echo ""; + if($link_status<2){ + $innerHtml = $defineMtp3Status[$link_status][remark]; + $color = $defineMtp3Status[$link_status][color]; + }else{ + $innerHtml = "--"; + $color = '#000000'; + } + outSpanId($id,$innerHtml,$color); + echo "
      +

      + + + + + + + + + + + + + +"; + for($j=0;$j<8;$j++) + { + if($j%2==0) + { + $dis_no=($j/2)*32+$i; + echo ""; + } + else + { + $id = "input_mtp3_linkset_status" . "_$i" . "_$j"; + $dis_linkset=(($j-1)/2)*32+$i; + $linkset_name="linkset_".$dis_linkset."_dec"; + $linkset_status=${$linkset_name}; + echo ""; + } + } + echo ""; +} +?> +
      +Linkset +
      + + + + + + + + + + + + + + + + +
      "; + echo $dis_no; + echo ""; + if($linkset_status<2){ + $innerHtml = $defineMtp3Status[$linkset_status][remark]; + $color = $defineMtp3Status[$linkset_status][color]; + }else{ + $innerHtml = "--"; + $color = '#000000'; + } + outSpanId($id,$innerHtml,$color); + echo "
      + +sccp_len_dec=$sccp_len_dec"; +$ssnNum=$sccp_len_dec-4; +if($sccp_len_dec > 0){ + $showSccp = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($sccp_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($sccp_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($sccp_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG) +echo "
      version=$version"; + +//状态 +$sccp_state_bin=substr($bin_mes,($sccp_bgn_byt+5)*8,8); +$sccp_state_dec=BinDec($sccp_state_bin); +if($DEBUG)echo "
      sccp_state_dec=$sccp_state_dec"; + +for($i=0;$i<$ssnNum;$i++) +{ + $ssn_hex="ssn_".$i."_hex"; + $ssn_dec="ssn_".$i."_dec"; + ${$ssn_hex}=substr($hex_mes,($sccp_bgn_byt+6+$i)*2,2); + ${$ssn_dec}=HexDec(${$ssn_hex}); + if($DEBUG) echo "
      $ssn_dec=${$ssn_dec}"; +} + +if($mod_type==3) +{ + if(!$showSccp) + { + echo "
      $strNotInstalled"; + exit(); + } +?> + +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +$id = 'input_sccp_state'; +if($sccp_state_dec<3){ + $innerHtml = $defineSccpStatus[$sccp_state_dec][remark]; + $color = $defineSccpStatus[$sccp_state_dec][color]; +}else{ + $innerHtml = '--'; + $color = '#000000'; +} +outSpanId($id,$innerHtml,$color); +echo ", "; +echo "$strRefreshTime:"; +$id = "input_refresh_time"; +outSpanId($id,$refresh_time,$color_refresh_time); +echo " )"; +?> +

      +

      + +0) +{ + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<$ssnNum;$i++) + { + $ssn_dec="ssn_".$i."_dec"; + $showSsn=${$ssn_dec}; + $showNum=omc_keep_length($showSsn,0,3); + echo ""; + echo ""; + if($showSsn==146) { + $showSsn=12; + } + elseif($showSsn==147){ + $showSsn=13; + } + elseif($showSsn==254){ + $showSsn=14; + } + elseif($showSsn==32){ + $showSsn=21; + } + elseif($showSsn==153){ + $showSsn=22; + } + echo ""; + echo ""; + } +} +echo "
      Registered ssn numRegistered ssn name
      $showNum"; + echo "{$defineSsnStatus[$showSsn][remark]}"; + echo "
      "; +}//end if($mod_type==3) + +/************************************tcap************************************/ +$tcap_bgn_byt=$sccp_bgn_byt+4+$sccp_len_dec; +$tcap_len_bin=substr($bin_mes,$tcap_bgn_byt*8,16);//tcap所占长度 +$tcap_len_dec=BinDec($tcap_len_bin); +if($DEBUG)echo "
      tcap_len_dec=$tcap_len_dec"; +if($tcap_len_dec > 0){ + $showTcap = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($tcap_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($tcap_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($tcap_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG) +echo "
      version=$version"; + +//状态 +$tcap_state_bin=substr($bin_mes,($tcap_bgn_byt+5)*8,8); +$tcap_state_dec=BinDec($tcap_state_bin); +if($DEBUG)echo "
      tcap_state_dec=$tcap_state_dec"; + +//Transaction ID +$tsid_state_bin=substr($bin_mes,($tcap_bgn_byt+6)*8,16); +$tsid_state_dec=BinDec($tsid_state_bin); +if($DEBUG)echo "
      tsid_state_bin=$tsid_state_bin"; +if($DEBUG)echo "
      tsid_state_dec=$tsid_state_dec"; + +//Dialogue ID +$dlid_state_bin=substr($bin_mes,($tcap_bgn_byt+8)*8,16); +$dlid_state_dec=BinDec($dlid_state_bin); +if($DEBUG)echo "
      dlid_state_bin=$dlid_state_bin"; +if($DEBUG)echo "
      dlid_state_dec=$dlid_state_dec"; + +if($mod_type==4){ + if(!$showTcap){ + echo "
      $strNotInstalled"; + exit(); + } + +?> +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +$id = 'input_tcap_state'; +if($tcap_state_dec<2){ + $innerHtml = $defineTcapStatus[$tcap_state_dec][remark]; + $color = $defineTcapStatus[$tcap_state_dec][color]; +}else{ + $innerHtml = '--'; + $color = '#000000'; +} +outSpanId($id,$innerHtml,$color); +echo ", "; +echo "$strRefreshTime:"; +$id = "input_refresh_time"; +outSpanId($id,$refresh_time,$color_refresh_time); +echo " )"; +?> +

      +

      + + + + + + + + + + + + + +
      +ID + +Occupied +
      +Current Used Dialogue ID + + +
      +Max Used Dialogue ID + + +
      +snmp_len_dec=$snmp_len_dec"; +if($snmp_len_dec > 0){ + $showSnmp = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($snmp_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($snmp_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($snmp_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); + +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG) +echo "
      version=$version"; + +//状态 + +$snmp_state_bin=substr($bin_mes,($snmp_bgn_byt+5)*8,8); +$snmp_state_dec=BinDec($snmp_state_bin); +if($DEBUG)echo "
      snmp_state_dec=$snmp_state_dec"; + +//trap function +$trap_func_bin=substr($bin_mes,($snmp_bgn_byt+6)*8,8); +$trap_func_dec=BinDec($trap_func_bin); +if($DEBUG)echo "
      trap_func_dec=$trap_func_dec"; + +//set function +$set_func_bin=substr($bin_mes,($snmp_bgn_byt+7)*8,8); +$set_func_dec=BinDec($set_func_bin); +if($DEBUG)echo "
      set_func_dec=$set_func_dec"; + +//get function +$get_func_bin=substr($bin_mes,($snmp_bgn_byt+8)*8,8); +$get_func_dec=BinDec($get_func_bin); +if($DEBUG)echo "
      get_func_dec=$get_func_dec"; + +//rsp function +$rsp_func_bin=substr($bin_mes,($snmp_bgn_byt+9)*8,8); +$rsp_func_dec=BinDec($rsp_func_bin); +if($DEBUG)echo "
      rsp_func_dec=$rsp_func_dec"; +if($mod_type==5){ + if(!$showSnmp){ + echo "
      $strNotInstalled"; + exit(); + } + +?> + +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +$id = 'input_snmp_state'; +if($snmp_state_dec<2){ + $innerHtml = $defineStatus[$snmp_state_dec][remark]; + $color = $defineStatus[$snmp_state_dec][color]; +}else{ + $innerHtml = '--'; + $color = '#000000'; +} +outSpanId($id,$innerHtml,$color); +echo ", "; +echo "$strRefreshTime:"; +$id = "input_refresh_time"; +outSpanId($id,$refresh_time,$color_refresh_time); +echo " )"; +?> + +

      +

      + + + + + + + + + + + + + + + + + + +
      +Function type + +Registered number +
      +TRAP + + +
      +SET + + +
      GET + +
      RSP + +
      +debug_len_dec=$debug_len_dec"; +if($debug_len_dec > 0){ + $showDebug = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($debug_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($debug_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($debug_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG) +echo "
      version=$version"; + +//状态 +$debug_state_bin=substr($bin_mes,($debug_bgn_byt+5)*8,8); +$debug_state_dec=BinDec($debug_state_bin); +if($DEBUG)echo "
      debug_state_dec=$debug_state_dec"; + +//use debug count +$count_bin=substr($bin_mes,($debug_bgn_byt+6)*8,8); +$count_dec=BinDec($count_bin); +if($DEBUG)echo "
      count_dec=$count_dec"; + +//use debug module +for($i=0;$i<16;$i++) +{ + $use_bin="use_".$i."_bin"; + $use_dec="use_".$i."_dec"; + ${$use_bin}=substr($bin_mes,($debug_bgn_byt+7)*8+$i,1); + ${$use_dec}=BinDec(${$use_bin}); + if($DEBUG)echo "
      $use_dec=${$use_dec}"; +} + +if($mod_type==6) +{ + if(!$showDebug) + { + echo "
      $strNotInstalled"; + exit(); + } + +?> +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +$id = 'input_debug_state'; +if($debug_state_dec<2){ + $innerHtml = $defineDebugStatus[$debug_state_dec][remark]; + $color = $defineDebugStatus[$debug_state_dec][color]; +}else{ + $innerHtml = '--'; + $color = '#000000'; +} +outSpanId($id,$innerHtml,$color); +echo ", "; +echo "$strRefreshTime:"; +$id = "input_refresh_time"; +outSpanId($id,$refresh_time,$color_refresh_time); +echo " )"; +?> +

      +

      + + + + + + + + + + + +"; + for($j=0;$j<8;$j++) + { + $id = "input_debug_items" . "_$i" . "_$j"; + if($j%2==0) + { + $dis_no=($j/2)*4+$i; + echo ""; + } + else + { + $dis_port=(($j-1)/2)*4+$i; + $port_name="use_".$dis_port."_dec"; + $port_status=${$port_name}; + echo ""; + } + } + echo ""; +} +?> +
      + + + + + + + + + + + + + + + +
      "; + if($PlatTypeDefArr[$sysNo][remark]=='EMS') + { + echo $omcDebugModule[$dis_no][remark]; + } + elseif($sysType=='AUC' || $sysType=='EIR' || $sysType=='HLR') + { + echo $aucDebugModule[$dis_no][remark]; + } + else + { + echo $otherDebugModule[$dis_no][remark]; + } + echo ""; + outSpanId($id,$defineModuleStatus[$port_status][remark],$defineModuleStatus[$port_status][color]); + echo "
      +syn_len_dec=$syn_len_dec"; +if($syn_len_dec > 0){ + $showDatasync = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($syn_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($syn_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($syn_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 +$syn_state_bin=substr($bin_mes,($syn_bgn_byt+5)*8,8); +$syn_state_dec=BinDec($syn_state_bin); +if($DEBUG)echo "
      syn_state_dec=$syn_state_dec"; + +//shmnum +$shmnum_hex=substr($hex_mes,($syn_bgn_byt+6)*2,2); +$shmnum_dec=HexDec($shmnum_hex); + +//shmid +$shmid_hex=substr($hex_mes,($syn_bgn_byt+7)*2,2); +$shmid_dec=HexDec($shmid_hex); + +//Init progress +$init_hex=substr($hex_mes,($syn_bgn_byt+8)*2,2); +$init_dec=HexDec($init_hex); +$initPro=$init_dec."%"; + +//Init progress +$init_hex=substr($hex_mes,($syn_bgn_byt+8)*2,2); +$init_dec=HexDec($init_hex); + +//time +$time_hex=substr($hex_mes,($syn_bgn_byt+9)*2,2); +$time_dec=HexDec($time_hex); + +if($mod_type==7) +{ + if(!$showDatasync) + { + echo "
      $strNotInstalled"; + exit(); + } +?> +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +if($syn_state_dec<5){ + echo "{$defineSyncStatus[$syn_state_dec][remark]}"; +}else{ + echo "--"; +} +echo ", "; +echo "$strRefreshTime:"; +echo "$refresh_time"; +echo " )"; +?> +

      +

      + + + + + + + + + + + + + + + + +
      SHM NUM$shmnum_dec";?>
      SHM ID +$shmid_dec"; +?> +
      Initialization progress +$initPro"; +else + echo "--"; +?> +
      +Time(minutes) + +$time_dec"; +else + echo "--"; +?> +
      + basic_len_dec=$basic_len_dec"; +if($basic_len_dec > 0){ + $showbasic = 1; +} + +//cpu loading +$bin_cpu_0=substr($bin_mes,($basic_bgn_byt+2)*8,16); +$dec_cpu_0=BinDec($bin_cpu_0); +$dec_cpu_0=1000-$dec_cpu_0; +if($dec_cpu_0<0){ + $dec_cpu_0=0; +}elseif($dec_cpu_0>1000){ + $dec_cpu_0=1000; +} +if($dec_cpu_0>900){ + $color_cpu_loading="#FF0000"; + $no_sys_status=1; +}else{ + $color_cpu_loading="#0000FF"; +} +$cpu_loading=($dec_cpu_0/10)."%"; +if($DEBUG)echo "
      cpu_loading=$cpu_loading"; + +//uptime +$uptime_hex=substr($hex_mes,($basic_bgn_byt+4)*2,8); +$uptime_dec=HexDec($uptime_hex); +$uptime=date("Y-m-d H:i:s",$uptime_dec); + +//total memory +$total_memory_hex=substr($hex_mes,($basic_bgn_byt+8)*2,8); +$total_memory_dec=HexDec($total_memory_hex); +if($DEBUG)echo "
      total_memory_dec=$total_memory_dec"; + +//free memory +$free_memory_hex=substr($hex_mes,($basic_bgn_byt+12)*2,8); +$free_memory_dec=HexDec($free_memory_hex); +if($DEBUG)echo "
      free_memory_dec=$free_memory_dec"; +if(isset($total_memory_dec)&&$total_memory_dec!=0) +{ + $memoryRate=($free_memory_dec/$total_memory_dec)*100; + $memoryRate=number_format($memoryRate, 2, '.', ''); +} +$memory=$free_memory_dec." / ".$total_memory_dec."  ".$memoryRate."%"; +if($free_memory_dec*10<$total_memory_dec){ + $color_memory="#FF0000"; +}else{ + $color_memory="#0000FF"; +} +if($DEBUG)echo "
      memory=$memory"; + +//total disk space +$total_disk_hex=substr($hex_mes,($basic_bgn_byt+16)*2,8); +$total_disk_dec=HexDec($total_disk_hex); +if($DEBUG)echo "
      total_disk_dec=$total_disk_dec"; + +//free disk space +$free_disk_hex=substr($hex_mes,($basic_bgn_byt+20)*2,8); +$free_disk_dec=HexDec($free_disk_hex); +if($DEBUG)echo "
      free_disk_dec=$free_disk_dec"; +if(isset($total_disk_dec)&&$total_disk_dec!=0) +{ + $diskRate=($free_disk_dec/$total_disk_dec)*100; + $diskRate=number_format($diskRate, 2, '.', ''); +} +$disk=$free_disk_dec." / ".$total_disk_dec."  ".$diskRate."%"; +if($free_disk_dec*10<$total_disk_dec){ + $color_disk="#FF0000"; + $no_sys_status=1; +}else{ + $color_disk="#0000FF"; +} +if($DEBUG)echo "
      disk=$memory"; + +/******************* +server send heartbeat +********************/ +if($DEBUG)echo "
      sysType=$sysType"; +$sysTypeNo=omc_sys_type2code($sysType); +$sysSubNum=get_subsys_total($sysType); +$sysNo=floor($subSysNo/$sysSubNum); +$subSysNo=$subSysNo%$sysSubNum; + +$showId=$sysType."_".$sysNo."_".$subSysNo; + +$sel_mes_sql="SELECT detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; +if($DEBUG) + echo "
      sel_mes_sql=$sel_mes_sql"; +$sel_mes_res=mysqli_query($pubConn,$sel_mes_sql); +$sel_mes_row=@mysqli_fetch_array($sel_mes_res); +echo "
      "; +echo mysqli_error($pubConn); + +if(!$sel_mes_row) +{ + echo "
      $strNotInstalled"; + exit(); +} + +$refresh_time=$sel_mes_row[updateTime]; +if($DEBUG) + echo "refresh_time=$refresh_time
      "; +if($refresh_time > $due_date && $refresh_time < $ove_date) +{ + $color_refresh_time="#0000FF"; +} +else +{ + $no_sys_status=1; + $color_refresh_time="#FF0000"; +} + +$hex_mes=$sel_mes_row[detailStat]; +if($DEBUG) + echo "
      hex_mes=$hex_mes"; + +/* +$refresh_time=$sel_mes_row[updateTime]; +if($refresh_time > $due_date && $refresh_time < $ove_date) +{ + $color_refresh_time="#0000FF"; +} +else +{ + $color_refresh_time="#FF0000"; + $no_sys_status=1; +} +if($DEBUG)echo "
      refresh_time=$refresh_time"; +*/ + +$bin_mes=''; +for($i=0;$ibin_mes=$bin_mes"; + + +if($sysType=='EMS') +{ + //begin bit + $verBgn = 23;//version + $sta_bgn=26; + $sync_bgn=46; + $num_bgn=66;//进程数目 + $pro_bgn=67;//服务器进程状态 + + + //main server status + $hex_sta=substr($hex_mes,$sta_bgn*2,2); + $dec_sta=HexDec($hex_sta); + + + if($defineSyncStatus[$syn_state_dec][remark]=='Init') + { + $dec_sta=1; + } + $defineServerState=array( + array('num'=> '0', 'remark' => 'Offline', 'color' => '#0000FF'), + array('num'=> '1', 'remark' => 'Init', 'color' => '#0000FF'), + array('num'=> '2', 'remark' => 'Detect', 'color' => '#0000FF'), + array('num'=> '3', 'remark' => 'Slave', 'color' => '#0000FF'), + array('num'=> '4', 'remark' => 'Sync', 'color' => '#0000FF'), + array('num'=> '5', 'remark' => 'Master', 'color' => '#0000FF'), + array('num'=> '6', 'remark' => 'Degrade', 'color' => '#0000FF'), + array('num'=> '7', 'remark' => 'Single', 'color' => '#0000FF') + ); + + //sync information + $arrSyncInfor[0]="First master log_file number"; + $arrSyncInfor[1]="Last master log_file number"; + $arrSyncInfor[2]="Master log position"; + $arrSyncInfor[3]="Slave log_file number"; + $arrSyncInfor[4]="Slave log position"; + for($i=0;$i<5;$i++) + { + $hex_sync=substr($hex_mes,$sync_bgn*2+$i*8,8); + $dec_sync[$i]=HexDec($hex_sync); + if($DEBUG)echo "
      dec_sync[$i]=$dec_sync[$i]"; + } + //进程数目 + $hex_pro_num=substr($hex_mes,$num_bgn*2,2); + $pro_num=HexDec($hex_pro_num); + if($DEBUG) echo "
      dec_pro_num=$pro_num"; + + //服务器进程状态,每个byte表示一个进程的状态 (0=未运行,1=部分子进程未运行,2=正常运行,3=服务器上不运行该进程) + $array_proc_status=array( + array('num'=> '0','remark' => 'stopped', 'color' => '#FF0000'), + array('num'=> '1','remark' => 'working', 'color' => '#0000FF'), + array('num'=> '2','remark' => 'suspended', 'color' => '#FF0000') + ); + for($i=0;$i< $pro_num;$i++) + { + ${hex_process_.$i}=substr($hex_mes,$pro_bgn*2+$i*2,2); + ${dec_process_.$i}=HexDec(${hex_process_.$i}); + if($DEBUG)echo "
      dec_process_$i=${dec_process_.$i}"; + if(${dec_process_.$i} < 1){ + $no_sys_status=1; + } + } + + //Version Information + $hex_version_0=substr($hex_mes,($verBgn)*2,2); + $dec_version_0=HexDec($hex_version_0); + + $hex_version_1=substr($hex_mes,($verBgn)*2+2,2); + $dec_version_1=HexDec($hex_version_1); + $dec_version_1=omc_keep_length($dec_version_1,0,2); + + $hex_version_2=substr($hex_mes,($verBgn)*2+4,2); + $dec_version_2=HexDec($hex_version_2); + $dec_version_2=omc_keep_length($dec_version_2,0,2); + + $version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + + $array_display_proc=array( + array('num'=>'0', 'remark'=>'mysqld', 'proc_status'=>$array_proc_status[$dec_process_0][remark], 'proc_color'=>$array_proc_status[$dec_process_0][color], 'run'=>'Y'), + array('num'=>'1', 'remark'=>'httpd', 'proc_status'=>$array_proc_status[$dec_process_1][remark], 'proc_color'=>$array_proc_status[$dec_process_1][color], 'run'=>'Y'), + array('num'=>'2', 'remark'=>'omcMain', 'proc_status'=>$array_proc_status[$dec_process_2][remark], 'proc_color'=>$array_proc_status[$dec_process_2][color], 'run'=>'Y'), + array('num'=>'3', 'remark'=>'iptrans', 'proc_status'=>$array_proc_status[$dec_process_3][remark], 'proc_color'=>$array_proc_status[$dec_process_3][color], 'run'=>'Y'), + array('num'=>'4', 'remark'=>'paraComm', 'proc_status'=>$array_proc_status[$dec_process_4][remark], 'proc_color'=>$array_proc_status[$dec_process_4][color], 'run'=>'Y'), + array('num'=>'5', 'remark'=>'subsComm', 'proc_status'=>$array_proc_status[$dec_process_5][remark], 'proc_color'=>$array_proc_status[$dec_process_5][color], 'run'=>'Y'), + array('num'=>'6', 'remark'=>'logCollector', 'proc_status'=>$array_proc_status[$dec_process_6][remark], 'proc_color'=>$array_proc_status[$dec_process_6][color], 'run'=>'Y'), + array('num'=>'7', 'remark'=>'omcCleaner', 'proc_status'=>$array_proc_status[$dec_process_7][remark], 'proc_color'=>$array_proc_status[$dec_process_7][color], 'run'=>'N'), + array('num'=>'8','remark'=>'smcli', 'proc_status'=>$array_proc_status[$dec_process_8][remark], 'proc_color'=>$array_proc_status[$dec_process_8][color], 'run'=>'Y'), + array('num'=>'9','remark'=>'cdrCollector', 'proc_status'=>$array_proc_status[$dec_process_9][remark], 'proc_color'=>$array_proc_status[$dec_process_9][color], 'run'=>'Y'), + array('num'=>'10','remark'=>'subsDataBackup', 'proc_status'=>$array_proc_status[$dec_process_10][remark], 'proc_color'=>$array_proc_status[$dec_process_10][color], 'run'=>'Y'), + array('num'=>'11','remark'=>'ftpSend', 'proc_status'=>$array_proc_status[$dec_process_11][remark], 'proc_color'=>$array_proc_status[$dec_process_11][color], 'run'=>'Y'), + array('num'=>'12','remark'=>'alarmAgent', 'proc_status'=>$array_proc_status[$dec_process_12][remark], 'proc_color'=>$array_proc_status[$dec_process_12][color], 'run'=>'Y'), + array('num'=>'13','remark'=>'nrtrde', 'proc_status'=>$array_proc_status[$dec_process_13][remark], 'proc_color'=>$array_proc_status[$dec_process_13][color], 'run'=>'Y'), + array('num'=>'14','remark'=>'sftpSend', 'proc_status'=>$array_proc_status[$dec_process_14][remark], 'proc_color'=>$array_proc_status[$dec_process_14][color], 'run'=>'Y'), + + ); +} +elseif($sysType=='HLR' || $sysType=='SMSC') +{ + //echo "sysType=$sysType
      "; + //begin bit + + $ver_bgn = 23; //version + $sta_bgn = 26; //hlr state + $lcn_bgn = 31; //license user + $real_bgn = 35; //real user + $snum_bgn = 39; //serial number + + //version + $bin_ver_0=substr($bin_mes,$ver_bgn*8,8); + $dec_ver_0=BinDec($bin_ver_0); + + $bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8); + $dec_ver_1=BinDec($bin_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8); + $dec_ver_2=BinDec($bin_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $version=$dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + //main server status + $bin_sta=substr($bin_mes,$sta_bgn*8,8); + $dec_sta=BinDec($bin_sta); + if($defineSyncStatus[$syn_state_dec][remark]=='Init'){ + $dec_sta=2; + } + if($dec_sta==4){ + $color_stoped="#FF0000"; + $no_sys_status=1; + } + else{ + $color_stoped="#0000FF"; + } + $defineServerState=array( + array('num'=> '0', 'remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1', 'remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '2', 'remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '3', 'remark' => $strSuspend, 'color' => '#ff8c00'), + array('num'=> '4', 'remark' => $strStop, 'color' => $color_stoped) + ); + + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + + + $serialNum = $srlArr[1][$sysNo][number]; + +}elseif($sysType=='AAS') +{ + //echo "sysType=$sysType
      "; + //begin bit + + $alarmComp_bgn = 14;// alarm component + $alarmCode_bgn = 16;// alarm code + $ver_bgn = 23; //version + $sta_bgn = 26; //hlr state + $lcn_bgn = 31; //license user + $real_bgn = 35; //real user + $snum_bgn = 39; //serial number + + $bin_alarmComp=substr($bin_mes,$alarmComp_bgn*8,16); + $dec_alarmComp=BinDec($bin_alarmComp); + + $bin_alarmCode=substr($bin_mes,$alarmCode_bgn*8,8); + $dec_alarmCode=BinDec($bin_alarmCode); + if($dec_alarmComp==1&&$dec_alarmCode==1) + $biccAlarm=1; + + //version + $bin_ver_0=substr($bin_mes,$ver_bgn*8,8); + $dec_ver_0=BinDec($bin_ver_0); + + $bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8); + $dec_ver_1=BinDec($bin_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8); + $dec_ver_2=BinDec($bin_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $version=$dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + //main server status + $bin_sta=substr($bin_mes,$sta_bgn*8,8); + $dec_sta=BinDec($bin_sta); + if($defineSyncStatus[$syn_state_dec][remark]=='Init'){ + $dec_sta=2; + } + if($dec_sta==4){ + $color_stoped="#FF0000"; + $no_sys_status=1; + } + else{ + $color_stoped="#0000FF"; + } + + $defineServerState=array( + array('num'=> '0', 'remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1', 'remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '2', 'remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '3', 'remark' => $strSuspend, 'color' => '#ff8c00'), + array('num'=> '4', 'remark' => $strStop, 'color' => $color_stoped) + ); + + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + + + + $serialNum = $srlArr[5][$sysNo][number]; +}elseif($sysType=='AUC' || $sysType=='EIR'){ + //begin bit + $mas_bgn = 26; //main master + $ver_bgn = 23; //version information + $snum = 39; //serial number + + $lcn_bgn = 31; //license user + $real_bgn = 35; //real user + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + + //whether master or not(0/1=Y/N) + $bin_if_master=substr($bin_mes,$mas_bgn*8,1); + $dec_if_master=BinDec($bin_if_master); + if($DEBUG)echo "
      dec_if_master=$dec_if_master"; + + //bit5-3:main server status(0/1/2/3/4=restart/initialize/normal/suspend/stop) + $bin_main_server_status=substr($bin_mes,$mas_bgn*8+2,3); + $dec_sta=BinDec($bin_main_server_status); + if($DEBUG)echo "
      dec_sta=$dec_sta"; + if($defineSyncStatus[$syn_state_dec][remark]=='Init') + { + $dec_sta=1; + } + + if($dec_if_master==0 && $dec_sta==4){ + $color_stoped="#FF0000"; + $no_sys_status=1; + } + else + { + $color_stoped="#0000FF"; + } + + $defineServerState=array( + array('num'=> '0','remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '1','remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '2','remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '3','remark' => $strPause, 'color' => '#ff8c00'), + array('num'=> '4','remark' => $strStop, 'color' => $color_stoped) + ); + + //Version Information + $hex_version_0=substr($hex_mes,$ver_bgn*2,2); + $dec_version_0=HexDec($hex_version_0); + + $hex_version_1=substr($hex_mes,$ver_bgn*2+2,2); + $dec_version_1=HexDec($hex_version_1); + $dec_version_1=omc_keep_length($dec_version_1,0,2); + + $hex_version_2=substr($hex_mes,$ver_bgn*2+4,2); + $dec_version_2=HexDec($hex_version_2); + $dec_version_2=omc_keep_length($dec_version_2,0,2); + + $version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + if($sysType == 'AUC') + $serialNum = $srlArr[2][$sysNo][number]; + else + $serialNum = $srlArr[4][$sysNo][number]; + +} +elseif($sysType=='PPS') +{ + //begin bit + $ver_bgn = 23; //version + $sta_bgn = 26; //pps state + $lcn_bgn = 31; //licensed users + $real_bgn = 35; //real users + $snum_bgn = 39; //serial number + + //version + $hex_ver_0=substr($hex_mes,$ver_bgn*2,2); + $dec_ver_0=HexDec($hex_ver_0); + + $hex_ver_1=substr($hex_mes,($ver_bgn+1)*2,2); + $dec_ver_1=HexDec($hex_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $hex_ver_2=substr($hex_mes,($ver_bgn+2)*2,2); + $dec_ver_2=HexDec($hex_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $version=$dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + //main server status + $hex_sta=substr($hex_mes,$sta_bgn*2,2); + $dec_sta=HexDec($hex_sta); + if($DEBUG)echo "
      dec_sta=$dec_sta"; + if($defineSyncStatus[$syn_state_dec][remark]=='Init') + { + $dec_sta=2; + } + if($dec_sta==4) + { + $no_sys_status=1; + } + + $defineServerState=array( + array('num'=> '0', 'remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1', 'remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '2', 'remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '3', 'remark' => $strSuspend, 'color' => '#ff8c00'), + array('num'=> '4', 'remark' => $strStop, 'color' => '#FF0000') + ); + + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + + $serialNum = $srlArr[3][$sysNo][number]; +}elseif($sysType=='VSS'){ + $useSttArr = array( + array(num => '0', remark => '--', color => '#000000'), + array(num => '1', remark => 'Y', color => '#0000FF') + ); + + $linkSttArr = array( + array(num => '0', remark => 'N', color => '#FF0000'), + array(num => '1', remark => 'Y', color => '#0000FF'), + array(num => '2', remark => '--', color => '#000000') + ); + + $linkTypeArr = array( + array(num => '0', remark => 'E1', color => '#000000'), + array(num => '1', remark => 'T1', color => '#000000'), + array(num => '2', remark => '--', color => '#000000') + ); + + $voiceRuleArr = array( + array(num => '0', remark => 'A LAW', color => '#000000'), + array(num => '1', remark => 'MU LAW', color => '#000000') + ); + + $chnSttArr = array( + array(num => '0', remark => '--', color => '#000000'), + array(num => '1', remark => 'Y', color => '#0000FF') + ); + + $VSS_funcFlagArr = array( + array(num => '0', remark => 'None'), + array(num => '1', remark => 'VMS'), + array(num => '2', remark => 'AAS'), + array(num => '3', remark => 'VMS&AAS') + ); + + //begin byte + $ver_bgn = 23; //version + $ttl_box = 31; //total mailboxs + $ena_box = 35; //registered mailboxs + $act_box = 43; //active mailboxs + $ttl_vce = 47; //total voicemails + $ttl_sec = 51; //total seconds of voicemails + $avr_sec = 55; //average seconds of voicemails + $stt_e0 = 67; //E1 #0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok + // link type bit 2: 0/1 in E1/T1;voice rule bit 3: 0/1 in A LAW/MU LAW) + $stt_e1 = 68; //E1 #1 status + $chn_u0 = 69; //E1 #0 used channel + $chn_u1 = 70; //E1 #1 used channel + $chn_s0 = 71; //E1 #0 channel status (use a bit to indetify one channel) + $chn_s1 = 75; //E1 #1 channel status + $smpp_stat = 59; //smpp status + $func_flag = 80; //VSS function flag + + //Field01:Version Information + $version_0=substr($hex_mes,($ver_bgn+0)*2,2); + $version_0=hexdec($version_0); + + $version_1=substr($hex_mes,($ver_bgn+1)*2,2); + $version_1=omc_keep_length($version_1,0,2); + $version_1=hexdec($version_1); + + $version_2=substr($hex_mes,($ver_bgn+2)*2,2); + $version_2=omc_keep_length($version_2,0,2); + $version_2=hexdec($version_2); + + $version=$version_0.".".$version_1.".".$version_2; + + $color_version="#0000FF"; + if($DEBUG) echo "
      version=$version"; + + //Field02:total mailboxs + $hexTotBox=substr($hex_mes,$ttl_box*2,8); + $totBox=HexDec($hexTotBox); + if($DEBUG)echo "
      totBox=$totBox"; + + //Field03:$ena_box + $hexEnaBox=substr($hex_mes,$ena_box*2,8); + $enaBox=HexDec($hexEnaBox); + if($DEBUG)echo "
      enaBox=$enaBox"; + + //Field04:$act_box + $hexActBox=substr($hex_mes,$act_box*2,8); + $actBox=HexDec($hexActBox); + if($DEBUG)echo "
      actBox=$actBox"; + + //Field05:total voicemails + $hexTotVoi=substr($hex_mes,$ttl_vce*2,8); + $totVoi=HexDec($hexTotVoi); + if($DEBUG)echo "
      totVoi=$totVoi"; + + //Field06: + $hexTtlVoi=substr($hex_mes,$ttl_sec*2,8); + $ttlVoi=HexDec($hexTtlVoi); + if($DEBUG)echo "
      ttlVoi=$ttlVoi"; + + //Field07: + $hexAvrVoi=substr($hex_mes,$avr_sec*2,8); + $avrVoi=HexDec($hexAvrVoi); + if($DEBUG)echo "
      avrVoi=$avrVoi"; + + //Field08 E1#0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok + //link type bit 2: 0/1 in E1/T1;voice rule bit 3: 0/1 in A LAW/MU LAW) + for($i=0;$i<4;$i++){ + $binSttE0=substr($bin_mes,$stt_e0*8+7-$i,1); + $sttE0[$i]=BinDec($binSttE0); + if($DEBUG)echo "
      sttE0[$i]=$sttE0[$i]"; + } + + if(!$sttE0[0]){ + $sttE0[1] = 2; + $sttE0[2] = 2; + $sttE0[3] = 2; + } + + //Field09 E1#1 status + for($i=0;$i<4;$i++){ + $binSttE1=substr($bin_mes,$stt_e1*8+7-$i,1); + $sttE1[$i]=BinDec($binSttE1); + if($DEBUG)echo "
      sttE1[$i]=$sttE1[$i]"; + } + + if(!$sttE1[0]){ + $sttE1[1] = 2; + $sttE1[2] = 2; + $sttE1[3] = 2; + } + + if(($sttE0[0] && !$sttE0[1]) || ($sttE1[0] && !$sttE1[1])){ + $no_sys_status = 1; + } + + //Field10 E1 #0 used channel + $hexChnU0=substr($hex_mes,$chn_u0*2,2); + $chnU0=HexDec($hexChnU0); + if(!$sttE0[0]){ + $chnU0 = "--"; + } + + //Field11 E1 #1 used channel + $hexChnU1=substr($hex_mes,$chn_u1*2,2); + $chnU1=HexDec($hexChnU1); + if(!$sttE1[0]){ + $chnU1 = "--"; + } + + //Field12 E1 #0 channel status (use a bit to indetify one channel) + for($i=0;$i<4;$i++){ + for($j=0;$j<8;$j++){ + $dstNum = $i*8+$j; + $binChnS0=substr($bin_mes,($chn_s0+$i)*8+7-$j,1); + $chnS0[$dstNum]=BinDec($binChnS0); + if($DEBUG)echo "
      chnS0[$dstNum]={$chnS0[$dstNum]}"; + } + } + + //Field13 E1 #1 channel status (use a bit to indetify one channel) + for($i=0;$i<4;$i++){ + for($j=0;$j<8;$j++){ + $dstNum = $i*8+$j; + $binChnS1=substr($bin_mes,($chn_s1+$i)*8+7-$j,1); + $chnS1[$dstNum]=BinDec($binChnS1); + if($DEBUG)echo "
      chnS1[$dstNum]={$chnS1[$dstNum]}"; + } + } + + //Field14 SMPP status(1bytes,smpp_stat): + $smppStat=substr($hex_mes,$smpp_stat*2,2); + if($DEBUG)echo "
      smppStat=$smppStat"; + + $funcFlag=hexdec(substr($hex_mes,$func_flag*2,2)); + if($DEBUG)echo "
      funcFlag=$funcFlag"; + + $serialNum = $srlArr[5][$sysNo][number]; +// if($smppStat < 1){ +// $no_sys_status = 1; +// } +}elseif($sysType=='MSC' || $sysType=='SN'){ + + //begin bit + $lcn_bgn = 31; //license user + $real_bgn = 35; //real user + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + $msc_bgn_byt=21; + $msc_len_hex=substr($hex_mes,$msc_bgn_byt*2,4);//msc length + $msc_len_dec=HexDec($msc_len_hex); + if($DEBUG)echo "
      msc_len_dec=$msc_len_dec"; + + //Field01(3bytes,18-20):Version Information + $version_0=substr($hex_mes,($msc_bgn_byt+2)*2,2); + $version_0=hexdec($version_0); + + $version_1=substr($hex_mes,($msc_bgn_byt+3)*2,2); + $version_1=omc_keep_length($version_1,0,2); + $version_1=hexdec($version_1); + + $version_2=substr($hex_mes,($msc_bgn_byt+4)*2,2); + $version_2=omc_keep_length($version_2,0,2); + $version_2=hexdec($version_2); + + $version=$version_0.".".$version_1.".".$version_2; + $color_version="#0000FF"; + if($DEBUG) echo "
      version=$version"; + + //main server status(0/1/2/3/4=normal/restart/initialize/suspend/stop) + $hex_sta=substr($hex_mes,($msc_bgn_byt+5)*2,2); + $dec_sta=HexDec($hex_sta); + if($DEBUG)echo "
      dec_sta=$dec_sta"; + if($defineSyncStatus[$syn_state_dec][remark]=='Init'){ + $dec_sta=2; + } + if($dec_sta==4){ + $no_sys_status=1; + } + + $defineServerState=array( + array('num'=> '0','remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1','remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '2','remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '3','remark' => $strSuspend, 'color' => '#ff8c00'), + array('num'=> '4','remark' => $strStop, 'color' => '#FF0000'), + array('num'=> '5','remark' => $strWait, 'color' => '#ff8c00'), + array('num'=> '6','remark' => $strSingle, 'color' => '#0000FF') + ); + + //E1 status + $arrayDefineStatus=array( + array('num'=> '0','remark' => 'TUP', 'color' => '#0000FF'), + array('num'=> '1','remark' => 'ISUP', 'color' => '#0000FF'), + array('num'=> '2','remark' => 'AIF', 'color' => '#0000FF'), + array('num'=> '3','remark' => 'ISDN NT', 'color' => '#0000FF'), + array('num'=> '4','remark' => 'ISDN LT', 'color' => '#0000FF'), + array('num'=> '5','remark' => 'Error', 'color' => '#FF0000'), + array('num'=> '6','remark' => 'Error', 'color' => '#FF0000'), + array('num'=> '7','remark' => '--', 'color' => '#000000') + ); + + if($no_sys_status) + { + $color_sys_status="#FF0000"; + $sys_status="Error"; + } + else + { + $color_sys_status="#0000FF"; + $sys_status="Normal"; + } + + /****************VLR heartbeat***************/ + $showVlrId="VLR_".$sysNo."_".$subSysNo; + $vlr_bgn_byt=$msc_bgn_byt+4+$msc_len_dec; + if($DEBUG)echo "
      vlr_bgn_byt=$vlr_bgn_byt"; + $vlr_len_hex=substr($hex_mes,$vlr_bgn_byt*2,4);//vlr length + $vlr_len_dec=HexDec($vlr_len_hex); + if($DEBUG)echo "
      vlr_len_dec=$vlr_len_dec"; + if($vlr_len_dec==0) + { + $noShowVlr=1; + } + //Field01:Version Information + $vlr_version_0=substr($hex_mes,($vlr_bgn_byt+2)*2,2); + $vlr_version_0=hexdec($vlr_version_0); + + $vlr_version_1=substr($hex_mes,($vlr_bgn_byt+3)*2,2); + $vlr_version_1=hexdec($vlr_version_1); + $vlr_version_1=omc_keep_length($vlr_version_1,0,2); + + $vlr_version_2=substr($hex_mes,($vlr_bgn_byt+4)*2,2); + $vlr_version_2=hexdec($vlr_version_2); + $vlr_version_2=omc_keep_length($vlr_version_2,0,2); + + $vlr_version=$vlr_version_0.".".$vlr_version_1.".".$vlr_version_2; + $color_vlr_version="#0000FF"; + if($DEBUG)echo "
      vlr_version=$vlr_version"; + + //vlr status(/1/2/3/4=SearchVLR/Sync/Single/Dual/) + $hex_vlr_status=substr($hex_mes,($vlr_bgn_byt+5)*2,2); + $dec_vlr_status=HexDec($hex_vlr_status); + if($DEBUG)echo "
      dec_vlr_status=$dec_vlr_status"; + {//add by arwean 2006-03-15 + $hex_vlr_lcn=substr($hex_mes,($vlr_bgn_byt+10)*2,8); + $vlr_lcnNum=HexDec($hex_vlr_lcn); + } + //VLR user number + $hex_vlr_num = substr($hex_mes,($vlr_bgn_byt+14)*2,8); + $dec_vlr_num = hexdec($hex_vlr_num); + if($DEBUG) echo "
      dec_vlr_num = $dec_vlr_num"; + + $array_vlr_status=array( + array('num'=> '1','remark' => 'SearchVLR', 'color' => '#0000FF'), + array('num'=> '2','remark' => 'Sync', 'color' => '#0000FF'), + array('num'=> '3','remark' => 'Single', 'color' => '#0000FF'), + array('num'=> '4','remark' => 'Normal', 'color' => '#0000FF') + ); + + if($no_vlr_status){ + $color_vlr_status="#FF0000"; + $vlr_status="Error"; + $no_sys_status = 1; + } + else{ + $color_vlr_status="#0000FF"; + $vlr_status="Normal"; + } + $serialNum = $srlArr[0][$sysNo][number];//add by arwean 2006-03-15 + //system("echo sn srlArr[4][$sysNo][number] == {$srlArr[4][$sysNo][number]} status>>debug.txt"); +}elseif($sysType=='SMEG') +{ + if($DEBUG)echo "SMEG.bin=$hex_mes
      "; + $smeg_state_label=array(0=>"Normal",1=>"Restart",2=>"Init",3=>"Suspend",4=>"Stop",5=>"Disable"); + $smeg_state_color=array(0=>"#0000FF",1=>"#0000FF",2=>"#0000FF",3=>"#0000FF",4=>"#FF0000",5=>"#FF0000"); + $smpp_smtp_pos=43; + $smeg_smpp_tx=substr($hex_mes,$smpp_smtp_pos++*2,2)+0; + $smeg_smpp_rx=substr($hex_mes,$smpp_smtp_pos++*2,2)+0; + $smeg_smtp_tx=substr($hex_mes,$smpp_smtp_pos++*2,2)+0; + $smeg_smtp_rx=substr($hex_mes,$smpp_smtp_pos*2,2)+0; + if($DEBUG)echo "smeg_smpp_tx=$smeg_smpp_tx,smeg_smpp_rx=$smeg_smpp_rx,smeg_smtp_tx=$smeg_smtp_tx,smeg_smtp_rx=$smeg_smtp_rx
      "; +}elseif($sysType=='OPPS') +{ + //$DEBUG=1; + if($DEBUG)echo "OPPS.bin=$hex_mes
      "; + $opr_state_pos=52; + $opr_license_pos=70; + $opr_realuser_pos=78; + $opr_serial_pos=86; + $opr_service_state_pos=94; + $opr_state_label=array(0=>"Normal",1=>"Restart",2=>"Init",3=>"Suspend",4=>"Shutdown"); + $opr_state_color=array(0=>"#0000FF",1=>"#FF0000",2=>"#0000FF",3=>"#FF0000",4=>"#FF0000"); + $opr_state=hexdec(substr($hex_mes,$opr_state_pos,2)); + $opr_license=hexdec(substr($hex_mes,$opr_license_pos,8)); + $opr_realuser=hexdec(substr($hex_mes,$opr_realuser_pos,8)); + $opr_serial=substr($hex_mes,$opr_serial_pos,8); + $opr_service_state_label=array(0=>"Disabled",1=>"Normal"); + $opr_service_state=substr($hex_mes,$opr_service_state_pos,2); + if($DEBUG)echo "state=$opr_state,license=$opr_license,realuser=$opr_realuser,serial=$opr_serial
      "; + //$DEBUG=0; +} + + + +if($no_sys_status){ + $color_sys_status="#FF0000"; + $sys_status="Error"; +}else{ + $color_sys_status="#0000FF"; + $sys_status="Normal"; +} + +if($mod_type==0) +{ + if(!$showbasic) + { + echo "
      $strNotInstalled"; + exit(); + } + if($platStatus) + { + $showPlatRemark = "N"; + $showPlatColor = "#FF0000"; + } + else + { + $showPlatRemark = "Y"; + $showPlatColor = "0000FF"; + } +?> + +

      + + "; + echo ""; + echo ""; + ?> + +
       "; + echo ""; + echo "

      + "; + + if($sysType=='HLR' || $sysType=='AUC' || $sysType=='EIR' || $sysType=='SMSC' || $sysType=='PPS' || $sysType=='VSS' || $sysType=='MSC' || $sysType=='EMS' || $sysType=='SN' || $sysType=='AAS') + { + echo "($strVersion:"; + echo "$version"; + echo ")"; + } + ?> +

      + + + + + + + + "; + echo ""; + echo ""; + } + ?> + + + + + + + + + + + + + + + + + "; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + } + + if($sysType=="OPPS") + { + //echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $opr_service_state1=substr($opr_service_state,0,1)+0; + $opr_service_state2=substr($opr_service_state,1,1)+0; + echo ""; + echo ""; + echo ""; + echo ""; + + } + + + if($sysType=='EMS') + { + for($i=0;$i<5;$i++) + { + $id = "input_dec_sync" . "_$i"; + echo ""; + echo ""; + echo ""; + echo ""; + } + } + if($sysType=='HLR' || $sysType=='PPS' || $sysType=='SMSC' || $sysType=='AUC' || $sysType=='MSC'){ + $LicenseStr = ($sysType=='MSC') ? "E1 license" : "License"; + $UserStr = ($sysType=='MSC') ? "E1 used" : "Users"; + echo ""; + echo ""; + echo ""; + echo ""; + // if($sysType=='PPS'){ + if($sysType=='SMSC') + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + // } + } + + if($sysType=='HLR' || $sysType=='PPS' || $sysType=='AUC' || $sysType=='EIR' || $sysType=='VSS' || $sysType=='MSC' || $sysType=='SMSC'){ + echo ""; + echo ""; + echo ""; + echo ""; + } + + + if($sysType=='VSS'){ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + if($smppStat > 0){ + echo ""; + }else{ + echo ""; + } + echo ""; + + /* + echo ""; + echo ""; + echo ""; + echo ""; + */ + echo "
      + + + +
      + $strDualServerMode"; + echo ""; + echo "
      + + + + +
      + + + +
      (KB) + +
      (KB) + + +
      SMPP TX$smeg_state_label[$smeg_smpp_tx]
      SMPP RX$smeg_state_label[$smeg_smpp_rx]
      SMTP TX$smeg_state_label[$smeg_smtp_tx]
      SMTP RX$smeg_state_label[$smeg_smtp_rx]
      State$opr_state_label[$opr_state]
      License$opr_license
      Real user$opr_realuser
      Serial number$opr_serial
      OPR{$opr_service_state_label[$opr_service_state1]}
      IMDX{$opr_service_state_label[$opr_service_state2]}
      + $arrSyncInfor[$i]"; + echo ""; + outSpanId($id,$dec_sync[$i],'#0000FF'); + echo "
      $LicenseStr$lcnNum
      $UserStr"; + outSpanId('input_realNum',$realNum,'#0000FF'); + echo "
      Serial number$serialNum
      Total mailboxs$totBox
      Registered mailboxs$enaBox
      Active mailboxs$actBox
      Total voicemails$totVoi
      Total seconds of voicemails$ttlVoi
      Average seconds of voicemails$avrVoi
      SMPP stateEstablishedNot established
      VSS function flag{$VSS_funcFlagArr[$funcFlag][remark]}
      "; + + echo "

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + for($i=0;$i<16;$i++){ + echo ""; + for($j=0;$j<2;$j++){ + $showNum = $j*16+$i; + echo ""; + echo ""; + } + for($j=0;$j<2;$j++){ + $showNum = $j*16+$i; + echo ""; + echo ""; + } + echo ""; + } + } + + if($sysType=='AAS'){ + echo "
      {$linkTypeArr[$sttE0[2]][remark]} #0{$linkTypeArr[$sttE1[2]][remark]} #1
      Used flag: {$useSttArr[$sttE0[0]][remark]}"; + echo "      Link status: {$linkSttArr[$sttE0[1]][remark]}"; + echo "      CH in used: $chnU0"; + echo "      Voice rule: {$voiceRuleArr[$sttE0[3]][remark]}"; + + echo "Used flag: {$useSttArr[$sttE1[0]][remark]}"; + echo "      Link status: {$linkSttArr[$sttE1[1]][remark]}"; + echo "      CH in used: $chnU1"; + echo "      Voice rule: {$voiceRuleArr[$sttE1[3]][remark]}"; + echo "
      "; + echo omc_keep_length($showNum,0,2); + echo ""; + echo "{$chnSttArr[$chnS0[$showNum]][remark]}"; + echo ""; + echo omc_keep_length($showNum,0,2); + echo ""; + echo "{$chnSttArr[$chnS1[$showNum]][remark]}"; + echo "
      "; + echo "

      "; + echo ""; + if($biccAlarm==1){ + echo ""; + echo ""; + echo ""; + echo ""; + } + + } + + echo "
      AlarmBICC trunk not reachable
      "; + if($sysType=='EMS') + { + echo ""; + echo "

      $strProcessStatus

      "; + echo ""; + echo ""; + + for($i=0;$i< $pro_num;$i++) + { + $proc_num=${dec_process_.$i}; + $show_num=omc_keep_length($i,0,2); + + if($proc_num!=3) + { + $id = "input_proc_status" . "_$show_num"; + echo ""; + echo ""; + echo""; + } + } + echo "
      $strProcessID$strProcessName$strProcessStatus
      $show_num{$array_display_proc[$i][remark]}"; + outSpanId($id,$array_display_proc[$i][proc_status],$array_display_proc[$i][proc_color]); + echo "
      "; + }//end if($PlatTypeDefArr[$sysNo][remark]=='EMS') + elseif(!$noShowVlr && $sysType == 'MSC') + { + echo "

      "; + echo ""; + echo "

      "; + echo "$showVlrId"; + $sysAlias=omc_get_sysAlias($sysTypeNo,$sysNo,$subSysNo); + if($sysAlias!=-1){ + echo " [$sysAlias]"; + } + echo " $strStatusInformation"; + echo "($strVersion:"; + echo "$vlr_version"; + echo ")

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo "
      "; + echo "$strRefreshTime"; + outSpanId('input_refresh_time_vlr',$refresh_time,$color_refresh_time); + echo "
      "; + echo "$strBasicStatus"; + outSpanId('input_vlr_status',$vlr_status,$color_vlr_status); + echo "
      $strDualServerMode"; + outSpanId('input_servState_vlr',$defineServerState[$dec_sta][remark],$defineServerState[$dec_sta][color]); + echo "
      $strVlrNum"; + outSpanId('input_dec_vlr_num',$dec_vlr_num,'#0000FF'); + echo "
      License"; + echo "$vlr_lcnNum"; + echo "
      "; + } + if($sysType=='SMSC') + { + //show smpp link status, zhengjianhui 2008-12-3 + $smpp_link_status_color=array(0=>"#aeaeae",1=>"#000000",2=>"#00ff00",3=>"#0000ff",4=>"#ff00ff"); + $smpp_link_status_label=array(0=>"Not Init",1=>"Idle",2=>"Waiting",3=>"Established",4=>"Suspend"); + + //echo "sysNo=$sysNo
      $hex_mes
      "; + $smpp_link_status_pos=47; + $smpp_link_status_len=32; + $smpp_link_status_hex=substr($hex_mes,$smpp_link_status_pos*2,$smpp_link_status_len*2); + echo "
      SMPP Link Status
      "; + echo ""; + + //smpp link alias + $smpp_link_alias_oid="2.2.1.1.2"; + //oidwhere + $levelArr=explode('.',$smpp_link_alias_oid); + for($j=0;$j"; + while($row=@mysqli_fetch_array($res)) + { + $instanceNo=$row[instanceNo]+0; + $smpp_link_alias[$instanceNo]=$row[initValue]; + //echo "$instanceNo-{$row[initValue]}
      "; + } + + for($row=0;$row<4;$row++) + { + echo "
      "; + for($col=0;$col<8;$col++) + { + $no=$row*8+$col; + $status=substr($smpp_link_status_hex,$no*2,2); + $istatus=hexdec($status)+0; + $noshow=omc_keep_length($no,0,2); + if($smpp_link_alias[$no] != "") + echo ""; + else + echo ""; + + } + echo ""; + + + echo ""; + for($col=0;$col<8;$col++) + { + $no=$row*8+$col; + $status=substr($smpp_link_status_hex,$no*2,2); + $istatus=hexdec($status)+0; + if($istatus>=0&&$istatus<5) + echo ""; + else + echo ""; + } + echo ""; + + } + + echo "
      $noshow [ {$smpp_link_alias[$no]} ]$no
      {$smpp_link_status_label[$istatus]}--
      "; + + /* + echo " SMPP Link Status: "; + echo "Not Init;   "; + echo "Idle;   "; + echo "Waiting;   "; + echo "Established;   "; + echo "Suspend; "; + */ + + } + {//if there are some alarm, show it (add by arwean 2006-7-11 15:05) + $selSql = "select * from sysAlarmLog where sysTypeNo='$sysTypeNo' and sysNo='$sysNo' and clearBy is null"; + if($DEBUG) echo "
      db=$db;
      selSql=$selSql"; + $Result = mysqli_query($pubConn,$selSql); + if(mysqli_num_rows($Result)) + { + echo "

      "; + echo ""; + echo "

      "; + echo "{$sysType}_{$sysNo}_{$subSysNo} alarm list"; + echo "

      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + while($Rows=mysqli_fetch_array($Result)) + { + $alarmTime = $Rows[alarmTime]; + $tmpSql="SELECT * FROM sysAlarmConf + WHERE sysTypeNo='$sysTypeNo' AND compCode='$Rows[compCode]' AND alarmCode='$Rows[alarmCode]'"; + if($DEBUG)echo "
      tmpSql=$tmpSql"; + $tmpResult=@mysqli_query($pubConn,$tmpSql); + echo mysqli_error($pubConn); + $tmpRows=@mysqli_fetch_array($tmpResult); + $alarmLevel= $tmpRows[alarmLevel]; + if(trim($tmpRows[alarmDesc_2])=="") + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      Alarm levelEventsAlarm time
      {$alarmLevelDefArr[$alarmLevel][remark]}{$tmpRows[alarmDesc_2]}$alarmTime
      "; + } + }//end show alarm. +}//end if($mod_type==0) +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "

      $strRemark:  Y = $strNormal,    N = $strAbnormal,   -- = $strNothing.

      "; +echo "

      "; +echo "$strBack

      "; +echo "
      "; +adjust_content_tail(); +?> + + + + diff --git a/wxc2_omc/fault/serverStatus/serverStatusDetailUp.php b/wxc2_omc/fault/serverStatus/serverStatusDetailUp.php new file mode 100755 index 0000000..73fdc86 --- /dev/null +++ b/wxc2_omc/fault/serverStatus/serverStatusDetailUp.php @@ -0,0 +1,2517 @@ +sys_id=$sys_id"; +$mod_type = isset($mod_type)?$mod_type:'0'; + +if($showRange == 'low'){ + $helpId = "1.2.2"; +}else{ + $helpId = "6.12"; +} + +if($DEBUG)echo "
      sys_id=$sys_id"; + +//echo "
      mod_type=$mod_type"; + +$due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +$ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +?> + +"; + echo ""; + echo ""; + echo "$strSysStatus > $strCentralOffice > $strServer"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; +echo ""; + +$definePlatExt=array( + array('num' => '0', 'remark' => 'IPTR', version => '3', state => '1', state => '4'), + array('num' => '1', 'remark' => 'MTP3', version => '3', state => '1', state => '32'), + array('num' => '2', 'remark' => 'SCCP', version => '3', state => '1', state => '4'), + array('num' => '3', 'remark' => 'TCAP', version => '3', state => '1', state => '4'), + array('num' => '4', 'remark' => 'AP-P', version => '3', state => '1', state => '4'), + array('num' => '5', 'remark' => 'SNMP', version => '3', state => '1', state => '4'), + array('num' => '6', 'remark' => 'Debug', version => '3', state => '1', state => '4'), + array('num' => '7', 'remark' => 'Data sync', version => '3', state => '1', state => '4') +); + +$defineStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineIptransStatus=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineMtp3Status=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '2', 'remark' => '--', 'color' => '#000000'), + array('num' => '3', 'remark' => '--', 'color' => '#000000') +); + +$defineSnmpStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineSccpStatus=array( + array('num' => '0', 'remark' => 'Fail', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Congest', 'color' => '#FF0000'), + array('num' => '2', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineTcapStatus=array( + array('num' => '0', 'remark' => 'Not used', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineDebugStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$omcDebugModule=array( + array('num' => '0', 'remark' => 'IPTRANS', 'color' => '#000000'), + array('num' => '1', 'remark' => 'MTP3', 'color' => '#000000'), + array('num' => '2', 'remark' => 'SCCP', 'color' => '#000000'), + array('num' => '3', 'remark' => 'TCAP', 'color' => '#000000'), + array('num' => '4', 'remark' => 'XAP-P', 'color' => '#000000'), + array('num' => '5', 'remark' => 'MSC', 'color' => '#000000'), + array('num' => '6', 'remark' => 'VLR', 'color' => '#000000'), + array('num' => '7', 'remark' => '--', 'color' => '#000000'), + array('num' => '8', 'remark' => 'HLR', 'color' => '#000000'), + array('num' => '9', 'remark' => 'SMSC', 'color' => '#000000'), + array('num' => '10', 'remark' => 'PPS', 'color' => '#000000'), + array('num' => '11', 'remark' => 'SNMP', 'color' => '#000000'), + array('num' => '12', 'remark' => '--', 'color' => '#000000'), + array('num' => '13', 'remark' => 'DEBUG', 'color' => '#000000'), + array('num' => '14', 'remark' => 'CDR', 'color' => '#000000'), + array('num' => '15', 'remark' => 'SS7 Gate','color' => '#000000') +); +$aucDebugModule=array( + array('num' => '0', 'remark' => 'IPTRANS', 'color' => '#000000'), + array('num' => '1', 'remark' => 'MTP3', 'color' => '#000000'), + array('num' => '2', 'remark' => 'SCCP', 'color' => '#000000'), + array('num' => '3', 'remark' => 'TCAP', 'color' => '#000000'), + array('num' => '4', 'remark' => 'XAP-P', 'color' => '#000000'), + array('num' => '5', 'remark' => 'MSC', 'color' => '#000000'), + array('num' => '6', 'remark' => 'VLR', 'color' => '#000000'), + array('num' => '7', 'remark' => '--', 'color' => '#000000'), + array('num' => '8', 'remark' => 'HLR', 'color' => '#000000'), + array('num' => '9', 'remark' => 'SMSC', 'color' => '#000000'), + array('num' => '10', 'remark' => 'PPS', 'color' => '#000000'), + array('num' => '11', 'remark' => 'SNMP', 'color' => '#000000'), + array('num' => '12', 'remark' => '--', 'color' => '#000000'), + array('num' => '13', 'remark' => 'DEBUG', 'color' => '#000000'), + array('num' => '14', 'remark' => 'AUC', 'color' => '#000000'), + array('num' => '15', 'remark' => 'EIR', 'color' => '#000000') +); +$otherDebugModule=array( + array('num' => '0', 'remark' => 'IPTRANS', 'color' => '#000000'), + array('num' => '1', 'remark' => 'MTP3', 'color' => '#000000'), + array('num' => '2', 'remark' => 'SCCP', 'color' => '#000000'), + array('num' => '3', 'remark' => 'TCAP', 'color' => '#000000'), + array('num' => '4', 'remark' => 'XAP-P', 'color' => '#000000'), + array('num' => '5', 'remark' => 'MSC', 'color' => '#000000'), + array('num' => '6', 'remark' => 'VLR', 'color' => '#000000'), + array('num' => '7', 'remark' => '--', 'color' => '#000000'), + array('num' => '8', 'remark' => 'HLR', 'color' => '#000000'), + array('num' => '9', 'remark' => 'SMSC', 'color' => '#000000'), + array('num' => '10', 'remark' => 'PPS', 'color' => '#000000'), + array('num' => '11', 'remark' => 'SNMP', 'color' => '#000000'), + array('num' => '12', 'remark' => '--', 'color' => '#000000'), + array('num' => '13', 'remark' => 'DEBUG', 'color' => '#000000'), + array('num' => '14', 'remark' => 'AUC', 'color' => '#000000'), + array('num' => '15', 'remark' => 'EIR', 'color' => '#000000') +); + +$defineModuleStatus=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineSyncStatus=array( + array('num' => '0', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Restart', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Init', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'suspend', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'Stop', 'color' => '#FF0000') +); + +$defineSsnStatus=array( + array('num' => '0', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '1', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '2', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '3', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'OMC', 'color' => '#0000FF'), + array('num' => '5', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '6', 'remark' => 'HLR', 'color' => '#0000FF'), + array('num' => '7', 'remark' => 'VLR', 'color' => '#0000FF'), + array('num' => '8', 'remark' => 'MSC', 'color' => '#0000FF'), + array('num' => '9', 'remark' => 'EIR', 'color' => '#0000FF'), + array('num' => '10', 'remark' => 'AUC', 'color' => '#0000FF'), + array('num' => '11', 'remark' => 'SMSC', 'color' => '#0000FF'), + array('num' => '12', 'remark' => 'CAP(CCF)', 'color' => '#0000FF'), + array('num' => '13', 'remark' => 'CAP(SCF)', 'color' => '#0000FF'), + array('num' => '14', 'remark' => 'AIF', 'color' => '#0000FF'), + array('num' => '15', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '16', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '17', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '18', 'remark' => '--', 'color' => '#0000FF'), + array('num' => '19', 'remark' => 'ESME', 'color' => '#0000FF'), + array('num' => '20', 'remark' => 'SMPP', 'color' => '#0000FF') +); + + +$sysType = omc_sys_id_info($sys_id,sys_type); +$sysTypeNo = omc_sys_type2code($sysType); +$sysNo = omc_sys_id_info($sys_id,sys_num); +$subSysNo = omc_sys_id_info($sys_id,subsys_num); +if($DEBUG)echo "
      sysType=$sysType"; +if($DEBUG)echo "
      sysNo=$sysNo"; +if($DEBUG)echo "
      subSysNo=$subSysNo"; + +$sysType=$PlatTypeDefArr[$sysNo][remark]; +$TypeNo = omc_sys_type2code($sysType); +$selPlat="SELECT platHeart FROM sysConf WHERE sysTypeNo = '$TypeNo' "; +if($DEBUG)echo "
      selPlat=$selPlat"; +$resPlat=@mysqli_query($pubConn,$selPlat); +$rowPlat=@mysqli_fetch_array($resPlat); +$sysNo = $rowPlat[0]; + +if($DEBUG)echo "
      sysType=$sysType"; +if($DEBUG)echo "
      sysNo=$sysNo"; +if($DEBUG)echo "
      subSysNo=$subSysNo"; + + +$sel_mes_sql="SELECT detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; +if($DEBUG)echo "
      sel_mes_sql=$sel_mes_sql"; +$sel_mes_res=mysqli_query($pubConn,$sel_mes_sql); +$sel_mes_row=@mysqli_fetch_array($sel_mes_res); +echo "
      "; +echo mysqli_error($pubConn); + +if(!$sel_mes_row) +{ + echo "
      $strNotInstalled"; + exit(); +} + +$hex_mes=$sel_mes_row[detailStat]; +if($DEBUG)echo "
      hex_mes=$hex_mes"; +$refresh_time=$sel_mes_row[updateTime]; +if($refresh_time > $due_date && $refresh_time < $ove_date) +{ + $color_refresh_time="#0000FF"; +} +else +{ + $no_sys_status=1; + $no_vlr_status=1; + $color_refresh_time="#FF0000"; +} + +$bin_mes=''; +for($i=0;$ibin_mes=$bin_mes"; + + +/************************************iptrans************************************/ +$iptrans_bgn_byt=21; +$iptrans_len_bin=substr($bin_mes,$iptrans_bgn_byt*8,16);//iptrans所占长度,19bytes +$iptrans_len_dec=BinDec($iptrans_len_bin); +if($iptrans_len_dec > 0){ + $showIptrans = 1; +} + +if($DEBUG)echo "
      iptrans_len_dec=$iptrans_len_dec"; + +//版本号 +$bin_version_0=substr($bin_mes,($iptrans_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($iptrans_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($iptrans_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 +$iptrans_state_bin=substr($bin_mes,($iptrans_bgn_byt+5)*8,8); +$iptrans_state_dec=BinDec($iptrans_state_bin); +if($DEBUG)echo "
      iptrans_state_dec=$iptrans_state_dec"; + +//port状态 +for($i=0;$i<4;$i++){ + for($j=0;$j<8;$j++){ + $num=($i+1)*8-1-$j; + $port_bin="port_".$num."_bin"; + $port_dec="port_".$num."_dec"; + ${$port_bin}=substr($bin_mes,($iptrans_bgn_byt+6)*8+$i*8+$j,1); + ${$port_dec}=BinDec(${$port_bin}); + if($DEBUG)echo "
      $port_dec=${$port_dec}"; + } +} + +if($mod_type==1){ + if(!$showIptrans){ + echo "
      $strNotInstalled"; + exit(); + } +?> + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +if($iptrans_state_dec<2) +{ + echo "{$defineStatus[$iptrans_state_dec][remark]}"; + $input_iptrans_state_value=$defineStatus[$iptrans_state_dec][remark]; + $input_iptrans_state_color=$defineStatus[$iptrans_state_dec][color]; +} +else +{ + echo "--"; + $input_iptrans_state_value="--"; + $input_iptrans_state_color="#0000FF"; +} +echo ", "; +echo "$strRefreshTime:"; +echo "$refresh_time"; +echo " )"; +echo ""; +?> +

      +

      + + + + + + + + + + + +"; + for($j=0;$j<8;$j++) + { + if($j%2==0) + { + $dis_no=4950+($j/2)*8+$i; + echo ""; + } + else + { + $idArr[$i][$j]="input_port_status" . "_$i" . "_$j"; + $dis_port=(($j-1)/2)*8+$i; + $port_name="port_".$dis_port."_dec"; + $port_status=${$port_name}; + echo ""; + $input_port_status_value[$i][$j]=$defineIptransStatus[$port_status][remark]; + $input_port_status_color[$i][$j]=$defineIptransStatus[$port_status][color]; + } + } + echo ""; +} +echo ""; +?> +
      + + + + + + + + + + + + + + + +
      "; + echo $dis_no; + echo ""; + echo "{$defineIptransStatus[$port_status][remark]}"; + echo "
      +mtp3_bgn_byt=$mtp3_bgn_byt"; +$mtp3_len_bin=substr($bin_mes,$mtp3_bgn_byt*8,16);//mtp3所占长度 +$mtp3_len_dec=BinDec($mtp3_len_bin); +if($mtp3_len_dec){ + $showMtp3=1; +} +if($DEBUG)echo "
      mtp3_len_dec=$mtp3_len_dec"; + +//版本号 +$bin_version_0=substr($bin_mes,($mtp3_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($mtp3_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($mtp3_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 +$mtp3_state_bin=substr($bin_mes,($mtp3_bgn_byt+5)*8,8); +$mtp3_state_dec=BinDec($mtp3_state_bin); +if($DEBUG)echo "
      mtp3_state_dec=$mtp3_state_dec"; + +//link状态 +for($i=0;$i<64;$i++) +{ + for($j=0;$j<4;$j++) + { + $num=($i+1)*4-1-$j; + if($DEBUG)echo "
      num=$num"; + $link_bin="link_".$num."_bin"; + $link_dec="link_".$num."_dec"; + ${$link_bin}=substr($bin_mes,($mtp3_bgn_byt+6)*8+$i*8+$j*2,2); + ${$link_dec}=BinDec(${$link_bin}); + if($DEBUG)echo "
      $link_dec=${$link_dec}"; + } +} + +//linkset状态 +for($i=0;$i<32;$i++) +{ + for($j=0;$j<4;$j++) + { + $num=($i+1)*4-1-$j; + if($DEBUG)echo "
      num=$num"; + $linkset_bin="linkset_".$num."_bin"; + $linkset_dec="linkset_".$num."_dec"; + ${$linkset_bin}=substr($bin_mes,($mtp3_bgn_byt+6+64)*8+$i*8+$j*2,2); + ${$linkset_dec}=BinDec(${$linkset_bin}); + if($DEBUG)echo "
      $linkset_dec=${$linkset_dec}"; + } +} + + +if($mod_type==2) +{ + if(!$showMtp3) + { + echo "
      $strNotInstalled"; + exit(); + } +?> +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +if($mtp3_state_dec<2){ + echo "{$defineStatus[$mtp3_state_dec][remark]}"; + $input_mtp3_state_value=$defineStatus[$mtp3_state_dec][remark]; + $input_mtp3_state_color=$defineStatus[$mtp3_state_dec][color]; +}else{ + echo "--"; + $input_mtp3_state_value="--"; + $input_mtp3_state_color="#0000FF"; +} +echo ", "; +echo "$strRefreshTime:"; +echo "$refresh_time"; +echo " )"; + +echo ""; +?> +

      +

      + + + + + + + + + + + + + +"; + for($j=0;$j<8;$j++) + { + if($j%2==0) + { + $dis_no=($j/2)*64+$i; + echo ""; + } + else + { + $lkIdArr[$i][$j] = "input_mtp3_link_status" . "_$i" . "_$j"; + $dis_link=(($j-1)/2)*64+$i; + $link_name="link_".$dis_link."_dec"; + $link_status=${$link_name}; + echo ""; + } + } + echo ""; +} + +echo ""; +?> +
      +Link +
      + + + + + + + + + + + + + + + +
      "; + echo $dis_no; + echo ""; + if($link_status<2) + { + echo " {$defineMtp3Status[$link_status][remark]} "; + $input_mtp3_link_status_value[$i][$j]=$defineMtp3Status[$link_status][remark]; + $input_mtp3_link_status_color[$i][$j]=$defineMtp3Status[$link_status][color]; + } + else + { + echo "--"; + $input_mtp3_link_status_value[$i][$j]="--"; + $input_mtp3_link_status_color[$i][$j]="#000000"; + } + echo "
      +

      + + + + + + + + + + + + + +"; + for($j=0;$j<8;$j++) + { + if($j%2==0) + { + $dis_no=($j/2)*32+$i; + echo ""; + } + else + { + $lsIdArr[$i][$j] = "input_mtp3_linkset_status" . "_$i" . "_$j"; + $dis_linkset=(($j-1)/2)*32+$i; + $linkset_name="linkset_".$dis_linkset."_dec"; + $linkset_status=${$linkset_name}; + echo ""; + } + } + echo ""; +} +for($i=0;$i<32;$i++){ + for($j=0;$j<8;$j++){ + if($j%2!=0) + outputInnerHtml($lsIdArr[$i][$j],$input_mtp3_linkset_status_value[$i][$j],$input_mtp3_linkset_status_color[$i][$j]); + } +} +?> +
      +Linkset +
      + + + + + + + + + + + + + + + + +
      "; + echo $dis_no; + echo ""; + if($linkset_status<2) + { + echo " {$defineMtp3Status[$linkset_status][remark]} "; + $input_mtp3_linkset_status_value[$i][$j]=$defineMtp3Status[$linkset_status][remark]; + $input_mtp3_linkset_status_color[$i][$j]=$defineMtp3Status[$linkset_status][color]; + } + else + { + echo "--"; + $input_mtp3_linkset_status_value[$i][$j]="--"; + $input_mtp3_linkset_status_color[$i][$j]="#000000"; + } + echo "
      + +sccp_len_dec=$sccp_len_dec"; +$ssnNum=$sccp_len_dec-4; +if($sccp_len_dec > 0){ + $showSccp = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($sccp_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($sccp_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($sccp_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 +$sccp_state_bin=substr($bin_mes,($sccp_bgn_byt+5)*8,8); +$sccp_state_dec=BinDec($sccp_state_bin); +if($DEBUG)echo "
      sccp_state_dec=$sccp_state_dec"; + +for($i=0;$i<$ssnNum;$i++) +{ + $ssn_hex="ssn_".$i."_hex"; + $ssn_dec="ssn_".$i."_dec"; + ${$ssn_hex}=substr($hex_mes,($sccp_bgn_byt+6+$i)*2,2); + ${$ssn_dec}=HexDec(${$ssn_hex}); + if($DEBUG) echo "
      $ssn_dec=${$ssn_dec}"; +} + +if($mod_type==3) +{ + if(!$showSccp) + { + echo "
      $strNotInstalled"; + exit(); + } +?> + +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +if($sccp_state_dec<3) +{ + echo "{$defineSccpStatus[$sccp_state_dec][remark]}"; + $input_sccp_state_value=$defineSccpStatus[$sccp_state_dec][remark]; + $input_sccp_state_color=$defineSccpStatus[$sccp_state_dec][color]; +} +else +{ + echo "--"; + $input_sccp_state_value="--"; + $input_sccp_state_color="#0000FF"; +} +echo ", "; +echo "$strRefreshTime:"; +echo "$refresh_time"; +echo " )"; + +echo ""; +?> +

      +

      + +0) +{ + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<$ssnNum;$i++) + { + $ssn_dec="ssn_".$i."_dec"; + $showSsn=${$ssn_dec}; + $showNum=omc_keep_length($showSsn,0,3); + echo ""; + echo ""; + if($showSsn==146) { + $showSsn=12; + } + elseif($showSsn==147){ + $showSsn=13; + } + elseif($showSsn==254){ + $showSsn=14; + } + echo ""; + echo ""; + } +} +echo "
      Registered ssn numRegistered ssn name
      $showNum"; + echo "{$defineSsnStatus[$showSsn][remark]}"; + echo "
      "; +}//end if($mod_type==3) + +/************************************tcap************************************/ +$tcap_bgn_byt=$sccp_bgn_byt+4+$sccp_len_dec; +$tcap_len_bin=substr($bin_mes,$tcap_bgn_byt*8,16);//tcap所占长度 +$tcap_len_dec=BinDec($tcap_len_bin); +if($DEBUG)echo "
      tcap_len_dec=$tcap_len_dec"; +if($tcap_len_dec > 0){ + $showTcap = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($tcap_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($tcap_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($tcap_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 +$tcap_state_bin=substr($bin_mes,($tcap_bgn_byt+5)*8,8); +$tcap_state_dec=BinDec($tcap_state_bin); +if($DEBUG)echo "
      tcap_state_dec=$tcap_state_dec"; + +//Transaction ID +$tsid_state_bin=substr($bin_mes,($tcap_bgn_byt+6)*8,16); +$tsid_state_dec=BinDec($tsid_state_bin); +if($DEBUG)echo "
      tsid_state_bin=$tsid_state_bin"; +if($DEBUG)echo "
      tsid_state_dec=$tsid_state_dec"; + +//Dialogue ID +$dlid_state_bin=substr($bin_mes,($tcap_bgn_byt+8)*8,16); +$dlid_state_dec=BinDec($dlid_state_bin); +if($DEBUG)echo "
      dlid_state_bin=$dlid_state_bin"; +if($DEBUG)echo "
      dlid_state_dec=$dlid_state_dec"; + +if($mod_type==4){ + if(!$showTcap){ + echo "
      $strNotInstalled"; + exit(); + } + +?> +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +if($tcap_state_dec<2){ + echo "{$defineTcapStatus[$tcap_state_dec][remark]}"; + $input_tcap_state_value=$defineTcapStatus[$tcap_state_dec][remark]; + $input_tcap_state_color=$defineTcapStatus[$tcap_state_dec][color]; +} +else{ + echo "--"; + $input_tcap_state_value="--"; + $input_tcap_state_color="#0000FF"; +} +echo ", "; +echo "$strRefreshTime:"; +echo "$refresh_time"; +echo " )"; +echo ""; + +?> +

      +

      + + + + + + + + + + + + + +
      +ID + +Occupied +
      +Current Used Dialogue ID + +$tsid_state_dec"; +?> +
      +Max Used Dialogue ID + +$dlid_state_dec"; +?> +
      +"; + outputInnerHtml('input_tsid_state_dec',$tsid_state_dec,'#0000ff'); + outputInnerHtml('input_dlid_state_dec',$dlid_state_dec,'#0000ff'); +echo ""; +}//end if($mod_type==4) + +/************************************snmp************************************/ + +$snmp_bgn_byt=$tcap_bgn_byt+4+$tcap_len_dec; +$snmp_len_bin=substr($bin_mes,$snmp_bgn_byt*8,16);//snmp所占长度 +$snmp_len_dec=BinDec($snmp_len_bin); +if($DEBUG)echo "
      snmp_len_dec=$snmp_len_dec"; +if($snmp_len_dec > 0){ + $showSnmp = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($snmp_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($snmp_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($snmp_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); + +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 + +$snmp_state_bin=substr($bin_mes,($snmp_bgn_byt+5)*8,8); +$snmp_state_dec=BinDec($snmp_state_bin); +if($DEBUG)echo "
      snmp_state_dec=$snmp_state_dec"; + +//trap function +$trap_func_bin=substr($bin_mes,($snmp_bgn_byt+6)*8,8); +$trap_func_dec=BinDec($trap_func_bin); +if($DEBUG)echo "
      trap_func_dec=$trap_func_dec"; + +//set function +$set_func_bin=substr($bin_mes,($snmp_bgn_byt+7)*8,8); +$set_func_dec=BinDec($set_func_bin); +if($DEBUG)echo "
      set_func_dec=$set_func_dec"; + +//get function +$get_func_bin=substr($bin_mes,($snmp_bgn_byt+8)*8,8); +$get_func_dec=BinDec($get_func_bin); +if($DEBUG)echo "
      get_func_dec=$get_func_dec"; + +//rsp function +$rsp_func_bin=substr($bin_mes,($snmp_bgn_byt+9)*8,8); +$rsp_func_dec=BinDec($rsp_func_bin); +if($DEBUG)echo "
      rsp_func_dec=$rsp_func_dec"; +if($mod_type==5){ + if(!$showSnmp){ + echo "
      $strNotInstalled"; + exit(); + } + +?> + +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +if($snmp_state_dec<2){ + echo "{$defineStatus[$snmp_state_dec][remark]}"; + $input_snmp_state_value=$defineStatus[$snmp_state_dec][remark]; + $input_snmp_state_color=$defineStatus[$snmp_state_dec][color]; +}else{ + echo "--"; + $input_snmp_state_value="--"; + $input_snmp_state_color="#0000FF"; +} +echo ", "; +echo "$strRefreshTime:"; +echo "$refresh_time"; +echo " )"; + +echo ""; +?> + +

      +

      + + + + + + + + + + + + + + + + + + +
      +Function type + +Registered number +
      +TRAP + +$trap_func_dec"; +?> +
      +SET + +$set_func_dec"; +?> +
      GET +$get_func_dec"; +?> +
      RSP +$rsp_func_dec"; +?> +
      +"; + outputInnerHtml('input_trap_func_dec',$trap_func_dec,'#0000ff'); + outputInnerHtml('input_set_func_dec',$set_func_dec,'#0000ff'); + outputInnerHtml('input_get_func_dec',$get_func_dec,'#0000ff'); + outputInnerHtml('input_rsp_func_dec',$rsp_func_dec,'#0000ff'); +echo ""; + +}//end if($mod_type==5) + +/************************************debug************************************/ +$debug_bgn_byt=$snmp_bgn_byt+4+$snmp_len_dec; +$debug_len_bin=substr($bin_mes,$debug_bgn_byt*8,16);//debug所占长度 +$debug_len_dec=BinDec($debug_len_bin); +if($DEBUG)echo "
      debug_len_dec=$debug_len_dec"; +if($debug_len_dec > 0){ + $showDebug = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($debug_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($debug_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($debug_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 +$debug_state_bin=substr($bin_mes,($debug_bgn_byt+5)*8,8); +$debug_state_dec=BinDec($debug_state_bin); +if($DEBUG)echo "
      debug_state_dec=$debug_state_dec"; + +//use debug count +$count_bin=substr($bin_mes,($debug_bgn_byt+6)*8,8); +$count_dec=BinDec($count_bin); +if($DEBUG)echo "
      count_dec=$count_dec"; + +//use debug module +for($i=0;$i<16;$i++) +{ + $use_bin="use_".$i."_bin"; + $use_dec="use_".$i."_dec"; + ${$use_bin}=substr($bin_mes,($debug_bgn_byt+7)*8+$i,1); + ${$use_dec}=BinDec(${$use_bin}); + if($DEBUG)echo "
      $use_dec=${$use_dec}"; +} + +if($mod_type==6) +{ + if(!$showDebug) + { + echo "
      $strNotInstalled"; + exit(); + } + +?> +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +if($debug_state_dec<2){ + echo "{$defineDebugStatus[$debug_state_dec][remark]}"; + $input_debug_state_value=$defineDebugStatus[$debug_state_dec][remark]; + $input_debug_state_color=$defineDebugStatus[$debug_state_dec][color]; +}else{ + $input_debug_state_value="--"; + $input_debug_state_color="#0000FF"; + echo "--"; +} +echo ", "; +echo "$strRefreshTime:"; +echo "$refresh_time"; +echo " )"; +echo ""; +?> +

      +

      + + + + + + + + + + + +"; + for($j=0;$j<8;$j++) + { + $idArr[$i][$j] = "input_debug_items" . "_$i" . "_$j"; + if($j%2==0) + { + $dis_no=($j/2)*4+$i; + echo ""; + } + else + { + $dis_port=(($j-1)/2)*4+$i; + $port_name="use_".$dis_port."_dec"; + $port_status=${$port_name}; + echo ""; + $input_debug_items_value[$i][$j]=$defineModuleStatus[$port_status][remark]; + $input_debug_items_color[$i][$j]=$defineModuleStatus[$port_status][color]; + } + } + echo ""; +} +echo ""; +?> + +
      + + + + + + + + + + + + + + + +
      "; + if($PlatTypeDefArr[$sysNo][remark]=='EMS') + { + echo $omcDebugModule[$dis_no][remark]; + } + elseif($sysType=='AUC' || $sysType=='EIR' || $sysType=='HLR') + { + echo $aucDebugModule[$dis_no][remark]; + } + else + { + echo $otherDebugModule[$dis_no][remark]; + } + echo ""; + echo "{$defineModuleStatus[$port_status][remark]}"; + echo "
      +syn_len_dec=$syn_len_dec"; +if($syn_len_dec > 0){ + $showDatasync = 1; +} + +//版本号 +$bin_version_0=substr($bin_mes,($syn_bgn_byt+2)*8,8); +$dec_version_0=BinDec($bin_version_0); + +$bin_version_1=substr($bin_mes,($syn_bgn_byt+3)*8,8); +$dec_version_1=BinDec($bin_version_1); +$dec_version_1=omc_keep_length($dec_version_1,0,2); + +$bin_version_2=substr($bin_mes,($syn_bgn_byt+4)*8,8); +$dec_version_2=BinDec($bin_version_2); +$dec_version_2=omc_keep_length($dec_version_2,0,2); + +$version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; +$color_version="#0000FF"; +if($DEBUG)echo "
      version=$version"; + +//状态 +$syn_state_bin=substr($bin_mes,($syn_bgn_byt+5)*8,8); +$syn_state_dec=BinDec($syn_state_bin); +if($DEBUG)echo "
      syn_state_dec=$syn_state_dec"; + +//shmnum +$shmnum_hex=substr($hex_mes,($syn_bgn_byt+6)*2,2); +$shmnum_dec=HexDec($shmnum_hex); + +//shmid +$shmid_hex=substr($hex_mes,($syn_bgn_byt+7)*2,2); +$shmid_dec=HexDec($shmid_hex); + +//Init progress +$init_hex=substr($hex_mes,($syn_bgn_byt+8)*2,2); +$init_dec=HexDec($init_hex); +$initPro=$init_dec."%"; + +//Init progress +$init_hex=substr($hex_mes,($syn_bgn_byt+8)*2,2); +$init_dec=HexDec($init_hex); + +//time +$time_hex=substr($hex_mes,($syn_bgn_byt+9)*2,2); +$time_dec=HexDec($time_hex); + +if($mod_type==7) +{ + if(!$showDatasync) + { + echo "
      $strNotInstalled"; + exit(); + } +?> +

      + + +

      +"; +echo "( $strVersion:"; +echo "$version"; +echo ", "; +echo " $strStatus:"; +if($syn_state_dec<5){ + echo "{$defineSyncStatus[$syn_state_dec][remark]}"; +}else{ + echo "--"; +} +echo ", "; +echo "$strRefreshTime:"; +echo "$refresh_time"; +echo " )"; +?> +

      +

      + + + + + + + + + + + + + + + + +
      SHM NUM$shmnum_dec";?>
      SHM ID +$shmid_dec"; +?> +
      Initialization progress +$initPro"; +else + echo "--"; +?> +
      +Time(minutes) + +$time_dec"; +else + echo "--"; +?> +
      + basic_len_dec=$basic_len_dec"; +if($basic_len_dec > 0){ + $showbasic = 1; +} + +//cpu loading +$bin_cpu_0=substr($bin_mes,($basic_bgn_byt+2)*8,16); +$dec_cpu_0=BinDec($bin_cpu_0); +$dec_cpu_0=1000-$dec_cpu_0; +if($dec_cpu_0<0){ + $dec_cpu_0=0; +}elseif($dec_cpu_0>1000){ + $dec_cpu_0=1000; +} +if($dec_cpu_0>900){ + $color_cpu_loading="#FF0000"; + $no_sys_status=1; +}else{ + $color_cpu_loading="#0000FF"; +} +$cpu_loading=($dec_cpu_0/10)."%"; +if($DEBUG)echo "
      cpu_loading=$cpu_loading"; + +//uptime +$uptime_hex=substr($hex_mes,($basic_bgn_byt+4)*2,8); +$uptime_dec=HexDec($uptime_hex); +$uptime=date("Y-m-d H:i:s",$uptime_dec); + +//total memory +$total_memory_hex=substr($hex_mes,($basic_bgn_byt+8)*2,8); +$total_memory_dec=HexDec($total_memory_hex); +if($DEBUG)echo "
      total_memory_dec=$total_memory_dec"; + +//free memory +$free_memory_hex=substr($hex_mes,($basic_bgn_byt+12)*2,8); +$free_memory_dec=HexDec($free_memory_hex); +if($DEBUG)echo "
      free_memory_dec=$free_memory_dec"; + +$memoryRate=($free_memory_dec/$total_memory_dec)*100; +$memoryRate=number_format($memoryRate, 2, '.', ''); +$memory=$free_memory_dec." / ".$total_memory_dec."  ".$memoryRate."%"; +if($free_memory_dec*10<$total_memory_dec){ + $color_memory="#FF0000"; +}else{ + $color_memory="#0000FF"; +} +if($DEBUG)echo "
      memory=$memory"; + +//total disk space +$total_disk_hex=substr($hex_mes,($basic_bgn_byt+16)*2,8); +$total_disk_dec=HexDec($total_disk_hex); +if($DEBUG)echo "
      total_disk_dec=$total_disk_dec"; + +//free disk space +$free_disk_hex=substr($hex_mes,($basic_bgn_byt+20)*2,8); +$free_disk_dec=HexDec($free_disk_hex); +if($DEBUG)echo "
      free_disk_dec=$free_disk_dec"; + +$diskRate=($free_disk_dec/$total_disk_dec)*100; +$diskRate=number_format($diskRate, 2, '.', ''); +$disk=$free_disk_dec." / ".$total_disk_dec."  ".$diskRate."%"; +if($free_disk_dec*10<$total_disk_dec){ + $color_disk="#FF0000"; + $no_sys_status=1; +}else{ + $color_disk="#0000FF"; +} +if($DEBUG)echo "
      disk=$memory"; + +/******************* +server send heartbeat +********************/ +if($DEBUG)echo "
      sysType=$sysType"; +$sysTypeNo=omc_sys_type2code($sysType); +$sysSubNum=get_subsys_total($sysType); +$sysNo=floor($subSysNo/$sysSubNum); +$subSysNo=$subSysNo%$sysSubNum; + +$showId=$sysType."_".$sysNo."_".$subSysNo; + +$sel_mes_sql="SELECT detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; +if($DEBUG)echo "
      sel_mes_sql=$sel_mes_sql"; +$sel_mes_res=mysqli_query($pubConn,$sel_mes_sql); +$sel_mes_row=@mysqli_fetch_array($sel_mes_res); +echo "
      "; +echo mysqli_error($pubConn); + +if(!$sel_mes_row) +{ + echo "
      $strNotInstalled"; + exit(); +} + +$refresh_time=$sel_mes_row[updateTime]; +if($refresh_time > $due_date && $refresh_time < $ove_date) +{ + $color_refresh_time="#0000FF"; +} +else +{ + $no_sys_status=1; + $color_refresh_time="#FF0000"; +} + +$hex_mes=$sel_mes_row[detailStat]; +$bin_mes=''; +for($i=0;$ibin_mes=$bin_mes"; + + +if($sysType=='EMS') +{ + //begin bit + $verBgn = 23;//version + $sta_bgn=26; + $sync_bgn=46; + $num_bgn=66;//进程数目 + $pro_bgn=67;//服务器进程状态 + + + //main server status + $hex_sta=substr($hex_mes,$sta_bgn*2,2); + $dec_sta=HexDec($hex_sta); + + if($defineSyncStatus[$syn_state_dec][remark]=='Init') + { + $dec_sta=1; + } + $defineServerState=array( + array('num'=> '0', 'remark' => 'Offline', 'color' => '#0000FF'), + array('num'=> '1', 'remark' => 'Init', 'color' => '#0000FF'), + array('num'=> '2', 'remark' => 'Detect', 'color' => '#0000FF'), + array('num'=> '3', 'remark' => 'Slave', 'color' => '#0000FF'), + array('num'=> '4', 'remark' => 'Sync', 'color' => '#0000FF'), + array('num'=> '5', 'remark' => 'Master', 'color' => '#0000FF'), + array('num'=> '6', 'remark' => 'Degrade', 'color' => '#0000FF'), + array('num'=> '7', 'remark' => 'Single', 'color' => '#0000FF') + ); + + //sync information + $arrSyncInfor[0]="First master log_file number"; + $arrSyncInfor[1]="Last master log_file number"; + $arrSyncInfor[2]="Master log position"; + $arrSyncInfor[3]="Slave log_file number"; + $arrSyncInfor[4]="Slave log position"; + for($i=0;$i<5;$i++) + { + $hex_sync=substr($hex_mes,$sync_bgn*2+$i*8,8); + $dec_sync[$i]=HexDec($hex_sync); + if($DEBUG)echo "
      dec_sync[$i]=$dec_sync[$i]"; + } + //进程数目 + $hex_pro_num=substr($hex_mes,$num_bgn*2,2); + $pro_num=HexDec($hex_pro_num); + if($DEBUG) echo "
      dec_pro_num=$pro_num"; + + //服务器进程状态,每个byte表示一个进程的状态 (0=未运行,1=部分子进程未运行,2=正常运行,3=服务器上不运行该进程) + $array_proc_status=array( + array('num'=> '0','remark' => 'stopped', 'color' => '#FF0000'), + array('num'=> '1','remark' => 'working', 'color' => '#0000FF'), + array('num'=> '2','remark' => 'suspended', 'color' => '#FF0000') + ); + for($i=0;$i<$pro_num;$i++) + { + ${hex_process_.$i}=substr($hex_mes,$pro_bgn*2+$i*2,2); + ${dec_process_.$i}=HexDec(${hex_process_.$i}); + if($DEBUG)echo "
      dec_process_$i=${dec_process_.$i}"; + if(${dec_process_.$i} < 1){ + $no_sys_status=1; + } + } + + //Version Information + $hex_version_0=substr($hex_mes,($verBgn)*2,2); + $dec_version_0=HexDec($hex_version_0); + + $hex_version_1=substr($hex_mes,($verBgn)*2+2,2); + $dec_version_1=HexDec($hex_version_1); + $dec_version_1=omc_keep_length($dec_version_1,0,2); + + $hex_version_2=substr($hex_mes,($verBgn)*2+4,2); + $dec_version_2=HexDec($hex_version_2); + $dec_version_2=omc_keep_length($dec_version_2,0,2); + + $version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + + $array_display_proc=array( + array('num'=>'0', 'remark'=>'mysqld', 'proc_status'=>$array_proc_status[$dec_process_0][remark], 'proc_color'=>$array_proc_status[$dec_process_0][color], 'run'=>'Y'), + array('num'=>'1', 'remark'=>'httpd', 'proc_status'=>$array_proc_status[$dec_process_1][remark], 'proc_color'=>$array_proc_status[$dec_process_1][color], 'run'=>'Y'), + array('num'=>'2', 'remark'=>'omcMain', 'proc_status'=>$array_proc_status[$dec_process_2][remark], 'proc_color'=>$array_proc_status[$dec_process_2][color], 'run'=>'Y'), + array('num'=>'3', 'remark'=>'iptrans', 'proc_status'=>$array_proc_status[$dec_process_3][remark], 'proc_color'=>$array_proc_status[$dec_process_3][color], 'run'=>'Y'), + array('num'=>'4', 'remark'=>'paraComm', 'proc_status'=>$array_proc_status[$dec_process_4][remark], 'proc_color'=>$array_proc_status[$dec_process_4][color], 'run'=>'Y'), + array('num'=>'5', 'remark'=>'subsComm', 'proc_status'=>$array_proc_status[$dec_process_5][remark], 'proc_color'=>$array_proc_status[$dec_process_5][color], 'run'=>'Y'), + array('num'=>'6', 'remark'=>'logCollector', 'proc_status'=>$array_proc_status[$dec_process_6][remark], 'proc_color'=>$array_proc_status[$dec_process_6][color], 'run'=>'Y'), + array('num'=>'7', 'remark'=>'omcCleaner', 'proc_status'=>$array_proc_status[$dec_process_7][remark], 'proc_color'=>$array_proc_status[$dec_process_7][color], 'run'=>'N'), + array('num'=>'8','remark'=>'smcli', 'proc_status'=>$array_proc_status[$dec_process_8][remark], 'proc_color'=>$array_proc_status[$dec_process_8][color], 'run'=>'Y'), + array('num'=>'9','remark'=>'cdrColletor', 'proc_status'=>$array_proc_status[$dec_process_9][remark], 'proc_color'=>$array_proc_status[$dec_process_9][color], 'run'=>'Y'), + array('num'=>'10','remark'=>'subsDataBackup', 'proc_status'=>$array_proc_status[$dec_process_10][remark], 'proc_color'=>$array_proc_status[$dec_process_10][color], 'run'=>'Y'), + array('num'=>'11','remark'=>'ftpSend', 'proc_status'=>$array_proc_status[$dec_process_11][remark], 'proc_color'=>$array_proc_status[$dec_process_11][color], 'run'=>'Y'), + array('num'=>'12','remark'=>'alarmAgent', 'proc_status'=>$array_proc_status[$dec_process_12][remark], 'proc_color'=>$array_proc_status[$dec_process_12][color], 'run'=>'Y'), + array('num'=>'13','remark'=>'nrtrde', 'proc_status'=>$array_proc_status[$dec_process_13][remark], 'proc_color'=>$array_proc_status[$dec_process_13][color], 'run'=>'Y'), + array('num'=>'14','remark'=>'sftpSend', 'proc_status'=>$array_proc_status[$dec_process_14][remark], 'proc_color'=>$array_proc_status[$dec_process_14][color], 'run'=>'Y'), + + ); + + +} +elseif($sysType=='HLR' || $sysType=='SMSC') +{ + //echo "sysType=$sysType
      "; + //begin bit + + $ver_bgn = 23; //version + $sta_bgn = 26; //hlr state + $lcn_bgn = 31; //license user + $real_bgn = 35; //real user + $snum_bgn = 39; //serial number + + //version + $bin_ver_0=substr($bin_mes,$ver_bgn*8,8); + $dec_ver_0=BinDec($bin_ver_0); + + $bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8); + $dec_ver_1=BinDec($bin_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8); + $dec_ver_2=BinDec($bin_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $version=$dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + //main server status + $bin_sta=substr($bin_mes,$sta_bgn*8,8); + $dec_sta=BinDec($bin_sta); + if($defineSyncStatus[$syn_state_dec][remark]=='Init'){ + $dec_sta=2; + } + if($dec_sta==4){ + $color_stoped="#FF0000"; + $no_sys_status=1; + } + else{ + $color_stoped="#0000FF"; + } + + $defineServerState=array( + array('num'=> '0', 'remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1', 'remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '2', 'remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '3', 'remark' => $strSuspend, 'color' => '#ff8c00'), + array('num'=> '4', 'remark' => $strStop, 'color' => $color_stoped) + ); + + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + + + + $serialNum = $srlArr[1][$sysNo][number]; +}elseif($sysType=='AAS') +{ + //echo "sysType=$sysType
      "; + //begin bit + + $alarmComp_bgn = 14;// alarm component + $alarmCode_bgn = 16;// alarm code + $ver_bgn = 23; //version + $sta_bgn = 26; //hlr state + $lcn_bgn = 31; //license user + $real_bgn = 35; //real user + $snum_bgn = 39; //serial number + + $bin_alarmComp=substr($bin_mes,$alarmComp_bgn*8,16); + $dec_alarmComp=BinDec($bin_alarmComp); + + $bin_alarmCode=substr($bin_mes,$alarmCode_bgn*8,8); + $dec_alarmCode=BinDec($bin_alarmCode); + if($dec_alarmComp==1&&$dec_alarmCode==1) + $biccAlarm=1; + + //version + $bin_ver_0=substr($bin_mes,$ver_bgn*8,8); + $dec_ver_0=BinDec($bin_ver_0); + + $bin_ver_1=substr($bin_mes,($ver_bgn+1)*8,8); + $dec_ver_1=BinDec($bin_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $bin_ver_2=substr($bin_mes,($ver_bgn+2)*8,8); + $dec_ver_2=BinDec($bin_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $version=$dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + //main server status + $bin_sta=substr($bin_mes,$sta_bgn*8,8); + $dec_sta=BinDec($bin_sta); + if($defineSyncStatus[$syn_state_dec][remark]=='Init'){ + $dec_sta=2; + } + if($dec_sta==4){ + $color_stoped="#FF0000"; + $no_sys_status=1; + } + else{ + $color_stoped="#0000FF"; + } + + $defineServerState=array( + array('num'=> '0', 'remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1', 'remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '2', 'remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '3', 'remark' => $strSuspend, 'color' => '#ff8c00'), + array('num'=> '4', 'remark' => $strStop, 'color' => $color_stoped) + ); + + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + + + + $serialNum = $srlArr[5][$sysNo][number]; +}elseif($sysType=='AUC' || $sysType=='EIR'){ + //begin bit + $mas_bgn = 26; //main master + $ver_bgn = 23; //version information + $snum = 39; //serial number + + $lcn_bgn = 31; //license user + $real_bgn = 35; //real user + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + + //whether master or not(0/1=Y/N) + $bin_if_master=substr($bin_mes,$mas_bgn*8,1); + $dec_if_master=BinDec($bin_if_master); + if($DEBUG)echo "
      dec_if_master=$dec_if_master"; + + //bit5-3:main server status(0/1/2/3/4=restart/initialize/normal/suspend/stop) + $bin_main_server_status=substr($bin_mes,$mas_bgn*8+2,3); + $dec_sta=BinDec($bin_main_server_status); + if($DEBUG)echo "
      dec_sta=$dec_sta"; + if($defineSyncStatus[$syn_state_dec][remark]=='Init') + { + $dec_sta=1; + } + + if($dec_if_master==0 && $dec_sta==4){ + $color_stoped="#FF0000"; + $no_sys_status=1; + } + else + { + $color_stoped="#0000FF"; + } + + $defineServerState=array( + array('num'=> '0','remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '1','remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '2','remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '3','remark' => $strPause, 'color' => '#ff8c00'), + array('num'=> '4','remark' => $strStop, 'color' => $color_stoped) + ); + + //Version Information + $hex_version_0=substr($hex_mes,$ver_bgn*2,2); + $dec_version_0=HexDec($hex_version_0); + + $hex_version_1=substr($hex_mes,$ver_bgn*2+2,2); + $dec_version_1=HexDec($hex_version_1); + $dec_version_1=omc_keep_length($dec_version_1,0,2); + + $hex_version_2=substr($hex_mes,$ver_bgn*2+4,2); + $dec_version_2=HexDec($hex_version_2); + $dec_version_2=omc_keep_length($dec_version_2,0,2); + + $version=$dec_version_0.".".$dec_version_1.".".$dec_version_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + + if($sysType == 'AUC') + $serialNum = $srlArr[2][$sysNo][number]; + else + $serialNum = $srlArr[4][$sysNo][number]; + +} +elseif($sysType=='PPS') +{ + //begin bit + $ver_bgn = 23; //version + $sta_bgn = 26; //pps state + $lcn_bgn = 31; //licensed users + $real_bgn = 35; //real users + $snum_bgn = 39; //serial number + + //version + $hex_ver_0=substr($hex_mes,$ver_bgn*2,2); + $dec_ver_0=HexDec($hex_ver_0); + + $hex_ver_1=substr($hex_mes,($ver_bgn+1)*2,2); + $dec_ver_1=HexDec($hex_ver_1); + $dec_ver_1=omc_keep_length($dec_ver_1,0,2); + + $hex_ver_2=substr($hex_mes,($ver_bgn+2)*2,2); + $dec_ver_2=HexDec($hex_ver_2); + $dec_ver_2=omc_keep_length($dec_ver_2,0,2); + + $version=$dec_ver_0.".".$dec_ver_1.".".$dec_ver_2; + $color_version="#0000FF"; + if($DEBUG)echo "
      version=$version"; + + //main server status + $hex_sta=substr($hex_mes,$sta_bgn*2,2); + $dec_sta=HexDec($hex_sta); + if($DEBUG)echo "
      dec_sta=$dec_sta"; + if($defineSyncStatus[$syn_state_dec][remark]=='Init') + { + $dec_sta=2; + } + if($dec_sta==4) + { + $no_sys_status=1; + } + + $defineServerState=array( + array('num'=> '0', 'remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1', 'remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '2', 'remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '3', 'remark' => $strSuspend, 'color' => '#ff8c00'), + array('num'=> '4', 'remark' => $strStop, 'color' => '#FF0000') + ); + + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + + + $serialNum = $srlArr[3][$sysNo][number]; +}elseif($sysType=='VSS'){ + $useSttArr = array( + array(num => '0', remark => '--', color => '#000000'), + array(num => '1', remark => 'Y', color => '#0000FF') + ); + + $linkSttArr = array( + array(num => '0', remark => 'N', color => '#FF0000'), + array(num => '1', remark => 'Y', color => '#0000FF'), + array(num => '2', remark => '--', color => '#000000') + ); + + $linkTypeArr = array( + array(num => '0', remark => 'E1', color => '#000000'), + array(num => '1', remark => 'T1', color => '#000000'), + array(num => '2', remark => '--', color => '#000000') + ); + + $voiceRuleArr = array( + array(num => '0', remark => 'A LAW', color => '#000000'), + array(num => '1', remark => 'MU LAW', color => '#000000') + ); + + $chnSttArr = array( + array(num => '0', remark => '--', color => '#000000'), + array(num => '1', remark => 'Y', color => '#0000FF') + ); + + $VSS_funcFlagArr = array( + array(num => '0', remark => 'None'), + array(num => '1', remark => 'VMS'), + array(num => '2', remark => 'AAS'), + array(num => '3', remark => 'VMS&AAS') + ); + + //begin byte + $ver_bgn = 23; //version + $ttl_box = 43; //total mailboxs + $ena_box = 47; //registered mailboxs + $act_box = 51; //active mailboxs + $ttl_vce = 55; //total voicemails + $ttl_sec = 59; //total seconds of voicemails + $avr_sec = 63; //average seconds of voicemails + $stt_e0 = 67; //E1 #0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok + // link type bit 2: 0/1 in E1/T1;voice rule bit 3: 0/1 in A LAW/MU LAW) + $stt_e1 = 68; //E1 #1 status + $chn_u0 = 69; //E1 #0 used channel + $chn_u1 = 70; //E1 #1 used channel + $chn_s0 = 71; //E1 #0 channel status (use a bit to indetify one channel) + $chn_s1 = 75; //E1 #1 channel status + $smpp_stat = 79; //smpp status + $func_flag = 80; //VSS function flag + + //Field01:Version Information + $version_0=substr($hex_mes,($ver_bgn+0)*2,2); + $version_0=hexdec($version_0); + + $version_1=substr($hex_mes,($ver_bgn+1)*2,2); + $version_1=omc_keep_length($version_1,0,2); + $version_1=hexdec($version_1); + + $version_2=substr($hex_mes,($ver_bgn+2)*2,2); + $version_2=omc_keep_length($version_2,0,2); + $version_2=hexdec($version_2); + + $version=$version_0.".".$version_1.".".$version_2; + + $color_version="#0000FF"; + if($DEBUG) echo "
      version=$version"; + + //Field02:total mailboxs + $hexTotBox=substr($hex_mes,$ttl_box*2,8); + $totBox=HexDec($hexTotBox); + if($DEBUG)echo "
      totBox=$totBox"; + + //Field03:$ena_box + $hexEnaBox=substr($hex_mes,$ena_box*2,8); + $enaBox=HexDec($hexEnaBox); + if($DEBUG)echo "
      enaBox=$enaBox"; + + //Field04:$act_box + $hexActBox=substr($hex_mes,$act_box*2,8); + $actBox=HexDec($hexActBox); + if($DEBUG)echo "
      actBox=$actBox"; + + //Field05:total voicemails + $hexTotVoi=substr($hex_mes,$ttl_vce*2,8); + $totVoi=HexDec($hexTotVoi); + if($DEBUG)echo "
      totVoi=$totVoi"; + + //Field06: + $hexTtlVoi=substr($hex_mes,$ttl_sec*2,8); + $ttlVoi=HexDec($hexTtlVoi); + if($DEBUG)echo "
      ttlVoi=$ttlVoi"; + + //Field07: + $hexAvrVoi=substr($hex_mes,$avr_sec*2,8); + $avrVoi=HexDec($hexAvrVoi); + if($DEBUG)echo "
      avrVoi=$avrVoi"; + + //Field08 E1#0 status (bit 0: 0/1 not in used / in used; bit 1: 0/1 link not ok / link ok + //link type bit 2: 0/1 in E1/T1;voice rule bit 3: 0/1 in A LAW/MU LAW) + for($i=0;$i<4;$i++){ + $binSttE0=substr($bin_mes,$stt_e0*8+7-$i,1); + $sttE0[$i]=BinDec($binSttE0); + if($DEBUG)echo "
      sttE0[$i]=$sttE0[$i]"; + } + + if(!$sttE0[0]){ + $sttE0[1] = 2; + $sttE0[2] = 2; + $sttE0[3] = 2; + } + + //Field09 E1#1 status + for($i=0;$i<4;$i++){ + $binSttE1=substr($bin_mes,$stt_e1*8+7-$i,1); + $sttE1[$i]=BinDec($binSttE1); + if($DEBUG)echo "
      sttE1[$i]=$sttE1[$i]"; + } + + if(!$sttE1[0]){ + $sttE1[1] = 2; + $sttE1[2] = 2; + $sttE1[3] = 2; + } + + if(($sttE0[0] && !$sttE0[1]) || ($sttE1[0] && !$sttE1[1])){ + $no_sys_status = 1; + } + + //Field10 E1 #0 used channel + $hexChnU0=substr($hex_mes,$chn_u0*2,2); + $chnU0=HexDec($hexChnU0); + if(!$sttE0[0]){ + $chnU0 = "--"; + } + + //Field11 E1 #1 used channel + $hexChnU1=substr($hex_mes,$chn_u1*2,2); + $chnU1=HexDec($hexChnU1); + if(!$sttE1[0]){ + $chnU1 = "--"; + } + + //Field12 E1 #0 channel status (use a bit to indetify one channel) + for($i=0;$i<4;$i++){ + for($j=0;$j<8;$j++){ + $dstNum = $i*8+$j; + $binChnS0=substr($bin_mes,($chn_s0+$i)*8+7-$j,1); + $chnS0[$dstNum]=BinDec($binChnS0); + if($DEBUG)echo "
      chnS0[$dstNum]={$chnS0[$dstNum]}"; + } + } + + //Field13 E1 #1 channel status (use a bit to indetify one channel) + for($i=0;$i<4;$i++){ + for($j=0;$j<8;$j++){ + $dstNum = $i*8+$j; + $binChnS1=substr($bin_mes,($chn_s1+$i)*8+7-$j,1); + $chnS1[$dstNum]=BinDec($binChnS1); + if($DEBUG)echo "
      chnS1[$dstNum]={$chnS1[$dstNum]}"; + } + } + + //Field14 SMPP status(1bytes,smpp_stat): + $smppStat=substr($hex_mes,$smpp_stat*2,2); + if($DEBUG)echo "
      smppStat=$smppStat"; + + $funcFlag=hexdec(substr($hex_mes,$func_flag*2,2)); + if($DEBUG)echo "
      funcFlag=$funcFlag"; + + $serialNum = $srlArr[5][$sysNo][number]; +// if($smppStat < 1){ +// $no_sys_status = 1; +// } +}elseif($sysType=='MSC' || $sysType=='SN'){ + + //begin bit + $lcn_bgn = 31; //license user + $real_bgn = 35; //real user + $hex_lcn=substr($hex_mes,$lcn_bgn*2,8); + $lcnNum=HexDec($hex_lcn); + $hex_real=substr($hex_mes,$real_bgn*2,8); + $realNum=HexDec($hex_real); + $msc_bgn_byt=21; + $msc_len_hex=substr($hex_mes,$msc_bgn_byt*2,4);//msc length + $msc_len_dec=HexDec($msc_len_hex); + if($DEBUG)echo "
      msc_len_dec=$msc_len_dec"; + + //Field01(3bytes,18-20):Version Information + $version_0=substr($hex_mes,($msc_bgn_byt+2)*2,2); + $version_0=hexdec($version_0); + + $version_1=substr($hex_mes,($msc_bgn_byt+3)*2,2); + $version_1=omc_keep_length($version_1,0,2); + $version_1=hexdec($version_1); + + $version_2=substr($hex_mes,($msc_bgn_byt+4)*2,2); + $version_2=omc_keep_length($version_2,0,2); + $version_2=hexdec($version_2); + + $version=$version_0.".".$version_1.".".$version_2; + $color_version="#0000FF"; + if($DEBUG) echo "
      version=$version"; + + //main server status(0/1/2/3/4=normal/restart/initialize/suspend/stop) + $hex_sta=substr($hex_mes,($msc_bgn_byt+5)*2,2); + $dec_sta=HexDec($hex_sta); + if($DEBUG)echo "
      dec_sta=$dec_sta"; + if($defineSyncStatus[$syn_state_dec][remark]=='Init'){ + $dec_sta=2; + } + if($dec_sta==4){ + $no_sys_status=1; + } + + $defineServerState=array( + array('num'=> '0','remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '1','remark' => $strRestart, 'color' => '#ff8c00'), + array('num'=> '2','remark' => $strInitialize, 'color' => '#ff8c00'), + array('num'=> '3','remark' => $strSuspend, 'color' => '#ff8c00'), + array('num'=> '4','remark' => $strStop, 'color' => '#FF0000'), + array('num'=> '5','remark' => $strWait, 'color' => '#ff8c00'), + array('num'=> '6','remark' => $strSingle, 'color' => '#0000FF') + ); + + //E1 status + $arrayDefineStatus=array( + array('num'=> '0','remark' => 'TUP', 'color' => '#0000FF'), + array('num'=> '1','remark' => 'ISUP', 'color' => '#0000FF'), + array('num'=> '2','remark' => 'AIF', 'color' => '#0000FF'), + array('num'=> '3','remark' => 'ISDN NT', 'color' => '#0000FF'), + array('num'=> '4','remark' => 'ISDN LT', 'color' => '#0000FF'), + array('num'=> '5','remark' => 'Error', 'color' => '#FF0000'), + array('num'=> '6','remark' => 'Error', 'color' => '#FF0000'), + array('num'=> '7','remark' => '--', 'color' => '#000000') + ); + + if($no_sys_status) + { + $color_sys_status="#FF0000"; + $sys_status="Error"; + } + else + { + $color_sys_status="#0000FF"; + $sys_status="Normal"; + } + + /****************VLR heartbeat***************/ + $showVlrId="VLR_".$sysNo."_".$subSysNo; + $vlr_bgn_byt=$msc_bgn_byt+4+$msc_len_dec; + if($DEBUG)echo "
      vlr_bgn_byt=$vlr_bgn_byt"; + $vlr_len_hex=substr($hex_mes,$vlr_bgn_byt*2,4);//vlr length + $vlr_len_dec=HexDec($vlr_len_hex); + if($DEBUG)echo "
      vlr_len_dec=$vlr_len_dec"; + if($vlr_len_dec==0) + { + $noShowVlr=1; + } + //Field01:Version Information + $vlr_version_0=substr($hex_mes,($vlr_bgn_byt+2)*2,2); + $vlr_version_0=hexdec($vlr_version_0); + + $vlr_version_1=substr($hex_mes,($vlr_bgn_byt+3)*2,2); + $vlr_version_1=hexdec($vlr_version_1); + $vlr_version_1=omc_keep_length($vlr_version_1,0,2); + + $vlr_version_2=substr($hex_mes,($vlr_bgn_byt+4)*2,2); + $vlr_version_2=hexdec($vlr_version_2); + $vlr_version_2=omc_keep_length($vlr_version_2,0,2); + + $vlr_version=$vlr_version_0.".".$vlr_version_1.".".$vlr_version_2; + $color_vlr_version="#0000FF"; + if($DEBUG)echo "
      vlr_version=$vlr_version"; + + //vlr status(/1/2/3/4=SearchVLR/Sync/Single/Dual/) + $hex_vlr_status=substr($hex_mes,($vlr_bgn_byt+5)*2,2); + $dec_vlr_status=HexDec($hex_vlr_status); + if($DEBUG)echo "
      dec_vlr_status=$dec_vlr_status"; + + //VLR user number + $hex_vlr_num = substr($hex_mes,($vlr_bgn_byt+14)*2,8); + $dec_vlr_num = hexdec($hex_vlr_num); + if($DEBUG) echo "
      dec_vlr_num = $dec_vlr_num"; + + $array_vlr_status=array( + array('num'=> '1','remark' => 'SearchVLR', 'color' => '#0000FF'), + array('num'=> '2','remark' => 'Sync', 'color' => '#0000FF'), + array('num'=> '3','remark' => 'Single', 'color' => '#0000FF'), + array('num'=> '4','remark' => 'Normal', 'color' => '#0000FF') + ); + + if($no_vlr_status){ + $color_vlr_status="#FF0000"; + $vlr_status="Error"; + $no_sys_status = 1; + } + else{ + $color_vlr_status="#0000FF"; + $vlr_status="Normal"; + } + $serialNum = $srlArr[4][$sysNo][number]; +} +if($no_sys_status){ + $color_sys_status="#FF0000"; + $sys_status="Error"; +}else{ + $color_sys_status="#0000FF"; + $sys_status="Normal"; +} + +if($mod_type==0){ + if(!$showbasic){ + echo "
      $strNotInstalled"; + exit(); + } + if($platStatus){ + $showPlatRemark = "N"; + $showPlatColor = "#FF0000"; + }else{ + $showPlatRemark = "Y"; + $showPlatColor = "0000FF"; + } +?> + +

      + + "; + echo ""; + echo ""; + ?> + +
      "; + echo "

      "; + echo "$strBack

      "; + echo "

      + "; + + if($sysType=='HLR' || $sysType=='AUC' || $sysType=='EIR' || $sysType=='SMSC' || $sysType=='PPS' || $sysType=='VSS' || $sysType=='MSC' || $sysType=='EMS' || $sysType=='SN' || $sysType=='AAS') + { + echo "($strVersion:"; + echo "$version"; + echo ")"; + } + ?> +

      + + + + + + "; + echo ""; + echo ""; + echo ""; + + echo ""; + } + ?> + "; + outputInnerHtml('input_sys_status',$sys_status,$color_sys_status); + outputInnerHtml('input_refresh_time',$refresh_time,$color_refresh_time); + outputInnerHtml('input_memory',$memory,$color_memory); + outputInnerHtml('input_disk',$disk,$color_disk); + echo "\n"; + ?> + + + + + + + + + + + + + + + + + "; + echo ""; + echo ""; + echo ""; + + $ipArr[$i] = "input_dec_sync" . "_$i"; + } + echo ""; + } + if($sysType=='HLR' || $sysType=='PPS' || $sysType=='SMSC' || $sysType=='AUC' || $sysType=='MSC'){ + echo ""; + echo ""; + echo ""; + echo ""; + // if($sysType=='PPS'){ + echo ""; + echo ""; + echo ""; + echo ""; + // } + echo ""; + } + + if($sysType=='HLR' || $sysType=='PPS' || $sysType=='AUC' || $sysType=='EIR'||$sysType=='VSS'|| $sysType=='MSC'||$sysType=='SMSC'){ + echo ""; + echo ""; + echo ""; + echo ""; + } + + + if($sysType=='VSS'){ + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + if($smppStat > 0){ + echo ""; + }else{ + echo ""; + } + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
      + + +
      + $strDualServerMode"; + echo "{$defineServerState[$dec_sta][remark]} "; + echo "
      + + + +
      + + + +
      (KB)
      (KB)
      + $arrSyncInfor[$i]"; + echo "$dec_sync[$i]"; + echo "
      License$lcnNum
      Users$realNum
      Serial number$serialNum
      Total mailboxs$totBox
      Registered mailboxs$enaBox
      Active mailboxs$actBox
      Total voicemails$totVoi
      Total seconds of voicemails$ttlVoi
      Average seconds of voicemails$avrVoi
      SMPP stateEstablishedNot established
      VSS function flag{$VSS_funcFlagArr[$funcFlag][remark]}
      "; + + echo "

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + for($i=0;$i<16;$i++){ + echo ""; + for($j=0;$j<2;$j++){ + $showNum = $j*16+$i; + echo ""; + echo ""; + } + for($j=0;$j<2;$j++){ + $showNum = $j*16+$i; + echo ""; + echo ""; + } + echo ""; + } + } + + if($sysType=='AAS'){ + echo "
      {$linkTypeArr[$sttE0[2]][remark]} #0{$linkTypeArr[$sttE1[2]][remark]} #1
      Used flag: {$useSttArr[$sttE0[0]][remark]}"; + echo "      Link status: {$linkSttArr[$sttE0[1]][remark]}"; + echo "      CH in used: $chnU0"; + echo "      Voice rule: {$voiceRuleArr[$sttE0[3]][remark]}"; + + echo "Used flag: {$useSttArr[$sttE1[0]][remark]}"; + echo "      Link status: {$linkSttArr[$sttE1[1]][remark]}"; + echo "      CH in used: $chnU1"; + echo "      Voice rule: {$voiceRuleArr[$sttE1[3]][remark]}"; + echo "
      "; + echo omc_keep_length($showNum,0,2); + echo ""; + echo "{$chnSttArr[$chnS0[$showNum]][remark]}"; + echo ""; + echo omc_keep_length($showNum,0,2); + echo ""; + echo "{$chnSttArr[$chnS1[$showNum]][remark]}"; + echo "
      "; + echo "

      "; + echo ""; + if($biccAlarm==1){ + echo ""; + echo ""; + echo ""; + echo ""; + } + + /* + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + for($i=0;$i<16;$i++){ + echo ""; + for($j=0;$j<2;$j++){ + $showNum = $j*16+$i; + echo ""; + echo ""; + } + for($j=0;$j<2;$j++){ + $showNum = $j*16+$i; + echo ""; + echo ""; + } + echo ""; + }*/ + } + + echo "
      AlarmBICC trunk not reachable
      E1 #0E1 #1
      Used flag: {$useSttArr[$sttE0[0]][remark]}"; + echo "      Link status: {$linkSttArr[$sttE0[1]][remark]}"; + echo "      CH in used: $chnU0"; + + echo "Used flag: {$useSttArr[$sttE1[0]][remark]}"; + echo "      Link status: {$linkSttArr[$sttE1[1]][remark]}"; + echo "      CH in used: $chnU1"; + echo "
      "; + echo omc_keep_length($showNum,0,2); + echo ""; + echo "{$chnSttArr[$chnS0[$showNum]][remark]}"; + echo ""; + echo omc_keep_length($showNum,0,2); + echo ""; + echo "{$chnSttArr[$chnS1[$showNum]][remark]}"; + echo "
      "; + if($sysType=='EMS') + { + echo ""; + echo "

      $strProcessStatus

      "; + echo ""; + echo ""; + + for($i=0;$i<$pro_num;$i++) + { + $proc_num=${dec_process_.$i}; + $show_num=omc_keep_length($i,0,2); + + if($proc_num!=3) + { + $idArr[$i] = "input_proc_status" . "_$show_num"; + + echo ""; + echo ""; + + if(${dec_process_.$i}<3) + { + echo ""; + $input_proc_status_value[$proc_num] = $array_display_proc[$i][proc_status]; + $input_proc_status_color[$proc_num] = $array_display_proc[$i][proc_color]; + } + else + { + echo ""; + $input_proc_status_value[$proc_num] = "--"; + $input_proc_status_color[$proc_num]="#000000"; + } + } + } + echo "
      $strProcessID$strProcessName$strProcessStatus
      $show_num{$array_display_proc[$i][remark]}{$array_display_proc[$i][proc_status]}
      --
      "; + + echo ""; + }//end if($PlatTypeDefArr[$sysNo][remark]=='EMS') + elseif(!$noShowVlr && $sysType == 'MSC') + { + echo "

      "; + echo ""; + echo "

      "; + echo "$showVlrId"; + $sysAlias=omc_get_sysAlias($sysTypeNo,$sysNo,$subSysNo); + if($sysAlias!=-1){ + echo " [$sysAlias]"; + } + echo " $strStatusInformation"; + echo "($strVersion:"; + echo "$vlr_version"; + echo ")

      "; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strRefreshTime"; + echo "$refresh_time
      "; + echo "$strBasicStatus$vlr_status
      $strDualServerMode{$defineServerState[$dec_sta][remark]} "; + + //echo "{$array_vlr_status[$dec_vlr_status][remark]}
      $strVlrNum$dec_vlr_num
      "; + + echo ""; + + } +}//end if($mod_type==0) +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "

      $strRemark:  Y = $strNormal,    N = $strAbnormal,   -- = $strNothing.

      "; +echo "

      "; +echo "$strBack

      "; +echo "
      "; +?> + + + diff --git a/wxc2_omc/fault/serverStatus/serverStatusDown.php b/wxc2_omc/fault/serverStatus/serverStatusDown.php new file mode 100755 index 0000000..fcbfbdc --- /dev/null +++ b/wxc2_omc/fault/serverStatus/serverStatusDown.php @@ -0,0 +1,916 @@ + + + + +sys_id=$sys_id"; +if($DEBUG)echo "
      showRange=$showRange"; +if($DEBUG)echo "
      mod_type=$mod_type"; + +if($showRange == 'low') +{ + $helpId = "1.2.2"; +} +else +{ + $helpId = "1.2.2.1"; +} + +$due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); +$ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +/*';" onunload="javascript:parent.header.document.location=null;" leftmargin="12"> + +*/ +?> + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > Subsystem > $strServer"; + echo ""; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strClear"; + echo "
      "; + +adjust_title_tail(); +adjust_content_head(); + + + +$defineIptransStatus=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineMtp3Status=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '2', 'remark' => '--', 'color' => '#000000'), + array('num' => '3', 'remark' => '--', 'color' => '#000000') +); + +$defineSnmpStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineSccpStatus=array( + array('num' => '0', 'remark' => 'Fail', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Congest', 'color' => '#FF0000'), + array('num' => '2', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineTcapStatus=array( + array('num' => '0', 'remark' => 'Not used', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineDebugStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineSyncStatus=array( + array('num' => '0', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Restart', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Init', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'suspend', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'Stop', 'color' => '#FF0000') +); + + + +//deal with summary +if($sys_id == 'all') +{ + //clear heartbeat + + if($clear){ + $delSql = " Delete FROM OMC_PUB.sysStat + WHERE sysTypeNo='200' + OR sysTypeNo='0' + OR sysTypeNo='320' + OR sysTypeNo='330' + OR sysTypeNo='340' + OR sysTypeNo='350' + OR sysTypeNo='355' + OR sysTypeNo='360' + OR sysTypeNo='370' + OR sysTypeNo='380' + OR sysTypeNo='390' + OR sysTypeNo='311' + "; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + $tmpSql="SELECT sysTypeNo FROM sysConf WHERE needInstall = 1"; + + $tmpRes = mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + $i=0; + do{ + if($i==0) + $tmpWhere="sysTypeNo != $tmpRow[sysTypeNo]"; + else + $tmpWhere=$tmpWhere." AND sysTypeNo != $tmpRow[sysTypeNo]"; + $i++; + }while($tmpRow = @mysqli_fetch_array($tmpRes)); + + //echo "tmpWhere=$tmpWhere"; + + $delSql = " Delete FROM OMC_PUB.sysInfo ";// WHERE $tmpWhere"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + $delSql = "Delete FROM OMC_PUB.sysLedStat"; + //echo "
      delSql=$delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + } + + //get plat message + $selSql = " SELECT * FROM $sysStat_table WHERE sysTypeNo='200' "; + if($DEBUG) echo "selSql=$selSql
      "; + $selRes = mysqli_query($pubConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $sysNo = $selRow[sysNo]; + $subSysNo = $selRow[subSysNo]; + if($DEBUG) echo "
      sysNo=$sysNo; subSysNo=$subSysNo"; + $hexMes = $selRow[detailStat]; + + if($DEBUG)echo "
      hexMes=$hexMes"; + $refreshTime = $selRow[updateTime]; + $sysType = $PlatTypeDefArr[$sysNo][remark]; + $sysNum=get_sys_total($sysType); + $subSysNum=get_subsys_total($sysType); + if($DEBUG)echo "
      sysNum=$sysNum; subSysNum=$subSysNum"; + if($subSysNum) + { + $rSysNo = floor($subSysNo/$subSysNum); + } + $rSubSysNo = $subSysNo-$rSysNo*$subSysNum; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][0] = $refreshTime; + if($refreshTime < $due_date || $refreshTime > $ove_date) + { + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][1] = "#FF0000"; + } + else + { + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][1] = "#0000FF"; + } + + if($DEBUG) + echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][0]}"; + if($DEBUG) + echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][1]}"; + + $iptrans_bgn_byt=21; + if($DEBUG)echo "
      iptrans_bgn_byt=$iptrans_bgn_byt"; + $iptrans_len_hex=substr($hexMes,$iptrans_bgn_byt*2,4);//iptrans所占长度,19bytes + $iptrans_len_dec=HexDec($iptrans_len_hex); + if($DEBUG)echo "
      iptrans_len_dec=$iptrans_len_dec"; + //status + if($iptrans_len_dec) + { + $iptrans_state_hex=substr($hexMes,($iptrans_bgn_byt+5)*2,2); + $iptrans_state_dec=HexDec($iptrans_state_hex); + if($DEBUG) + echo "
      iptrans_state_dec=$iptrans_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]=$defineIptransStatus[$iptrans_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]=$defineIptransStatus[$iptrans_state_dec][color]; + if($defineIptransStatus[$iptrans_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]}"; + + $mtp3_bgn_byt=$iptrans_bgn_byt+4+$iptrans_len_dec; + if($DEBUG)echo "
      mtp3_bgn_byt=$mtp3_bgn_byt"; + $mtp3_len_hex=substr($hexMes,$mtp3_bgn_byt*2,4);//mtp3所占长度 + $mtp3_len_dec=HexDec($mtp3_len_hex); + if($DEBUG)echo "
      mtp3_len_dec=$mtp3_len_dec"; + //status + if($mtp3_len_dec) + { + $mtp3_state_hex=substr($hexMes,($mtp3_bgn_byt+5)*2,2); + $mtp3_state_dec=HexDec($mtp3_state_hex); + if($DEBUG) + echo "
      mtp3_state_dec=$mtp3_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][0]=$defineMtp3Status[$mtp3_state_dec][remark]; + + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][1]=$defineMtp3Status[$mtp3_state_dec][color]; + if($defineMtp3Status[$mtp3_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][1]}"; + + $sccp_bgn_byt=$mtp3_bgn_byt+4+$mtp3_len_dec; + $sccp_len_hex=substr($hexMes,$sccp_bgn_byt*2,4);//sccp所占长度 + $sccp_len_dec=hexDec($sccp_len_hex); + if($DEBUG)echo "
      sccp_len_dec=$sccp_len_dec"; + //status + if($sccp_len_dec) + { + $sccp_state_hex=substr($hexMes,($sccp_bgn_byt+5)*2,2); + $sccp_state_dec=HexDec($sccp_state_hex); + if($DEBUG) + echo "
      sccp_state_dec=$sccp_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][0]=$defineSccpStatus[$sccp_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][1]=$defineSccpStatus[$sccp_state_dec][color]; + + if($defineSccpStatus[$sccp_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][1]}"; + + $tcap_bgn_byt=$sccp_bgn_byt+4+$sccp_len_dec; + $tcap_len_hex=substr($hexMes,$tcap_bgn_byt*2,4);//tcap所占长度 + $tcap_len_dec=HexDec($tcap_len_hex); + if($DEBUG)echo "
      tcap_len_dec=$tcap_len_dec"; + //status + if($tcap_len_dec) + { + $tcap_state_hex=substr($hexMes,($tcap_bgn_byt+5)*2,2); + $tcap_state_dec=HexDec($tcap_state_hex); + if($DEBUG) + echo "
      tcap_state_dec=$tcap_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][0]=$defineTcapStatus[$tcap_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][1]=$defineTcapStatus[$tcap_state_dec][color]; + if($defineTcapStatus[$tcap_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][1]}"; + + $snmp_bgn_byt=$tcap_bgn_byt+4+$tcap_len_dec; + $snmp_len_hex=substr($hexMes,$snmp_bgn_byt*2,4);//snmp所占长度 + $snmp_len_dec=HexDec($snmp_len_hex); + if($DEBUG)echo "
      snmp_len_dec=$snmp_len_dec"; + //status + if($snmp_len_dec) + { + $snmp_state_hex=substr($hexMes,($snmp_bgn_byt+5)*2,2); + $snmp_state_dec=HexDec($snmp_state_hex); + if($DEBUG) + echo "
      snmp_state_dec=$snmp_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][0]=$defineSnmpStatus[$snmp_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][1]=$defineSnmpStatus[$snmp_state_dec][color]; + if($defineSnmpStatus[$snmp_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][1]}"; + + $debug_bgn_byt=$snmp_bgn_byt+4+$snmp_len_dec; + $debug_len_hex=substr($hexMes,$debug_bgn_byt*2,4);//debug所占长度 + $debug_len_dec=HexDec($debug_len_hex); + if($DEBUG)echo "
      debug_len_dec=$debug_len_dec"; + //status + if($debug_len_dec) + { + $debug_state_hex=substr($hexMes,($debug_bgn_byt+5)*2,2); + $debug_state_dec=HexDec($debug_state_hex); + if($DEBUG) + echo "
      debug_state_dec=$debug_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][0]=$defineDebugStatus[$debug_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][1]=$defineDebugStatus[$debug_state_dec][color]; + + if($defineDebugStatus[$debug_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][1]}"; + + $syn_bgn_byt=$debug_bgn_byt+4+$debug_len_dec; + if($DEBUG)echo "
      syn_bgn_byt=$syn_bgn_byt"; + $syn_len_hex=substr($hexMes,$syn_bgn_byt*2,4);//syn所占长度 + $syn_len_dec=HexDec($syn_len_hex); + if($DEBUG)echo "
      syn_len_dec=$syn_len_dec"; + //status + + if($syn_len_dec) + { + $syn_state_hex=substr($hex_mes,($syn_bgn_byt+5)*2,2); + $syn_state_dec=HexDec($syn_state_hex); + if($DEBUG) + echo "
      syn_state_dec=$syn_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][0]=$defineSyncStatus[$syn_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][1]=$defineSyncStatus[$syn_state_dec][color]; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][1]}"; + + if($DEBUG) echo "
      ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = {$ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo]}"; + if($showRange == 'low') + { + if($ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo]) + { + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0] = "N"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1] = "#FF0000"; + } + else + { + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0] = "Y"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1] = "#0000FF"; + } + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]}"; + + }while($selRow = @mysqli_fetch_array($selRes)); + + + //get basic status + $plat_num=count($PlatTypeDefArr); + if($DEBUG) echo "
      plat_num=$plat_num "; + $sumWhere = " WHERE "; + for($i=0;$i<$plat_num;$i++) + { + $sysTypeNo = $PlatTypeDefArr[$i][sysTypeNo]; + if($i==0) + { + $sumWhere = $sumWhere." sysTypeNo = $sysTypeNo " ; + } + else + { + $sumWhere = $sumWhere." OR sysTypeNo = $sysTypeNo "; + } + } + if($DEBUG)echo "
      sumWhere=$sumWhere"; + $selPlat="SELECT * FROM sysConf" . $sumWhere; + if($DEBUG)echo "
      selPlat=$selPlat"; + $resPlat=@mysqli_query($pubConn,$selPlat); + $rowPlat=@mysqli_fetch_array($resPlat); + do{ + $sysTypeNo = $rowPlat[sysTypeNo]; + $platHeart = $rowPlat[platHeart]; + if($DEBUG)echo "
      platHeart=$platHeart"; + for($i=0;$iselPlatNo[$i]=$selPlatNo[$i]"; + } + }while($rowPlat=@mysqli_fetch_array($resPlat)); + + $basSql = " SELECT * FROM sysInfo ".$sumWhere; + if($DEBUG) echo "
      basSql=$basSql"; + $basRes = mysqli_query($pubConn,$basSql); + $basRow = @mysqli_fetch_array($basRes); + echo mysqli_error($pubConn); + do + { + $sysTypeNo = $basRow[sysTypeNo]; + if($DEBUG)echo "
      sysTypeNo=$sysTypeNo"; + $sysNo = $basRow[sysNo]; + if($DEBUG)echo "
      sysNo=$sysNo"; + $subSysNo = $basRow[subSysNo]; + if($DEBUG)echo "
      subSysNo=$subSysNo"; + $baseStat = $basRow[baseStat]; + if($DEBUG)echo "
      baseStat=$baseStat"; + $sysIp = $basRow[ip]; + if($DEBUG)echo "
      sysIp=$sysIp"; + $okStat = 0; + for($i=0;$i<$plat_num;$i++) + { + if($DEBUG)echo "
      i=$i"; + $platNo = $selPlatNo[$i]; + + if($okStat) + { + break; + } + $selSysType=$PlatTypeDefArr[$i][remark]; + $selSysTypeNo=$PlatTypeDefArr[$i][sysTypeNo]; + if($DEBUG)echo "
      selSysTypeNo=$selSysTypeNo"; + + if($selSysTypeNo != $sysTypeNo) + { + if($DEBUG)echo "
      continue i=$i"; + continue; + } + $sysNum=get_sys_total($selSysType); + if($DEBUG)echo "
      sysNum=$sysNum"; + + $subSysNum=get_subsys_total($selSysType); + if($DEBUG)echo "
      subSysNum=$subSysNum"; + if($DEFAULT_SYS=='GMSC' && ($selSysType=='MSC' || $selSysType=='AUC' || $selSysType=='PPS' || $selSysType=='SMSC')) + { + continue; + } + elseif($DEFAULT_SYS=='MSC' && $selSysType=='GMSC') + { + continue; + } + elseif($DEFAULT_SYS=='HBSC' && $selSysType!='EMS') + { + continue; + } + + for($j=0;$j<$sysNum;$j++) + { + if($DEBUG)echo "
      j=$j"; + if($okStat) + { + break; + } + if($j != $sysNo) + { + if($DEBUG)echo "
      continue j=$j"; + continue; + } + for($k=0;$k<$subSysNum;$k++) + { + if($DEBUG)echo "
      k=$k"; + if($k != $subSysNo) + { + continue; + } + if($DEBUG)echo "
      arrBeat[$platNo][$j][$k][8][0]={$arrBeat[$platNo][$j][$k][8][0]}"; + //echo "due_date=$due_date,ove_date=$ove_date
      "; + //$i == 2 MSC + //$i == 6 SMSC + if ( ($platNo == 9) && ($i!=2) && ($i!=6) ) + { + if($baseStat && $arrBeat[$platNo][$j][$k][8][0] > $due_date && $arrBeat[$platNo][$j][$k][8][0] < $ove_date) + { + $arrBeat[$i][$j][$k][0][0]="Y"; + $arrBeat[$i][$j][$k][0][1]="#0000FF"; + } + + else + { + $arrBeat[$i][$j][$k][0][0]="N"; + $arrBeat[$i][$j][$k][0][1]="#FF0000"; + } + + } + else + { + if($baseStat && $arrBeat[$platNo][$j][$k][8][0] > $due_date && $arrBeat[$platNo][$j][$k][8][0] < $ove_date) + { + $arrBeat[$i][$j][$k][0][0]="Y"; + $arrBeat[$i][$j][$k][0][1]="#0000FF"; + } + else + { + $arrBeat[$i][$j][$k][0][0]="N"; + $arrBeat[$i][$j][$k][0][1]="#FF0000"; + } + if($i==0 && $arrBeat[$i][$j][$k][0][0]=='Y') {//OMC状态为Y,还要进一步判断其进程是否全部起来了add by arwean 2006-11-30 16:09 + $sel_mes_sql="SELECT detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + if(0)echo "
      sel_mes_sql=$sel_mes_sql"; + + //echo "
      sel_mes_sql=$sel_mes_sql"; + $sel_mes_res=mysqli_query($pubConn,$sel_mes_sql); + $sel_mes_row=@mysqli_fetch_array($sel_mes_res); + $hex_mes=$sel_mes_row[detailStat]; + $num_bgn=66;//进程数目 + $pro_bgn=67;//服务器进程状态 + //进程数目 + $hex_pro_num=substr($hex_mes,$num_bgn*2,2); + $pro_num=HexDec($hex_pro_num); + for($ix=0;$ix< $pro_num;$ix++) + { + ${hex_process_.$ix}=substr($hex_mes,$pro_bgn*2+$ix*2,2); + ${dec_process_.$ix}=HexDec(${hex_process_.$ix}); + if($DEBUG)echo "
      dec_process_$ix=${dec_process_.$ix}"; + if(${dec_process_.$ix} < 1){ + $arrBeat[$i][$j][$k][0][0]="N"; + $arrBeat[$i][$j][$k][0][1]="#FF0000"; + } + } + }//end add + } + //$arrBeat[$i][$j][$k][0][0]="Y"; + //$arrBeat[$i][$j][$k][0][1]="#0000FF"; + if($DEBUG) + { + echo "
      arrBeat[$i][$j][$k][0][0]={$arrBeat[$i][$j][$k][0][0]}"; + echo "
      arrBeat[$i][$j][$k][0][1]={$arrBeat[$i][$j][$k][0][1]}"; + } + $okStat = 1; + if(0) + { + echo "
      noSrlStt: $noSrlStt, baseStat: $baseStat"; + echo "
      arrBeat[$i][$j][$k][0][0]={$arrBeat[$i][$j][$k][0][0]}"; + echo "
      "; + } + //echo the each system's ip address + + $arrBeat[$i][$j][$k][10][0]=$sysIp; + if($DEBUG)echo "
      arrBeat[$i][$j][$k][10][0]={$arrBeat[$i][$j][$k][10][0]}"; + + break; + } + } + } + }while($basRow = @mysqli_fetch_array($basRes)); + + +if ($selectedLanguage == 'eng') +{ + $arrModName[0] = 'Application status'; + $arrModName[1] = 'IPTRANS'; + if($showRange == 'low') + { + $arrModName[1] = 'Platform module'; + } + $arrModName[2] = 'MTP3'; + $arrModName[3] = 'SCCP'; + $arrModName[4] = 'TCAP'; + $arrModName[5] = 'SNMP'; + $arrModName[6] = 'DEBUG'; + $arrModName[7] = 'DATA SYNC'; + $arrModName[8] = 'Refresh time'; + $arrModName[9] = 'Version'; + $arrModName[10] = 'IP address'; +} +elseif ($selectedLanguage == 'chn') +{ + $arrModName[0] = '基本状态'; + $arrModName[1] = 'IPTRANS'; + if($showRange == 'low') + { + $arrModName[1] = '平台模块'; + } + $arrModName[2] = 'MTP3'; + $arrModName[3] = 'SCCP'; + $arrModName[4] = 'TCAP'; + $arrModName[5] = 'SNMP'; + $arrModName[6] = 'DEBUG'; + $arrModName[7] = 'DATA SYNC'; + $arrModName[8] = '刷新时间'; + $arrModName[9] = '版本号'; + $arrModName[10] = 'IP 地址'; +} + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "

      ";/* + if($showRange=='low')//show back + { + if($backpage=='overview') + echo "$strBack"; + else + echo "$strBack"; + } + echo "     ";*/ + echo " 

      "; + echo "

      $strServerSummaryInfo

      "; + + //echo ""; + //echo ""; + $modNum = count($arrModName); + //echo ""; + for($i=0;$i<$modNum;$i++) + { + if($i == 7 || ($showRange == 'low') && $i > 1 && $i < 7) + { + continue; + } + //echo ""; + } + //echo ""; + + for($i=0;$i<$plat_num;$i++) + { + if($DEBUG) echo "plat_num=$plat_num
      "; + $selSysType=$PlatTypeDefArr[$i][remark]; + if($DEBUG) echo "selSysType=$selSysType
      "; + $selSysTypeNo=$PlatTypeDefArr[$i][sysTypeNo]; + $tmpSql = " SELECT * FROM elementExistConf WHERE elementTypeNo='$selSysTypeNo' AND existFlag='1'"; + if($DEBUG) + echo "
      tmpSql=$tmpSql"; + $tmpRes = mysqli_query($pubConn,$tmpSql); + if(mysqli_num_rows($tmpRes)<=0) + continue; + $platNo = $selPlatNo[$i]; + if($DEBUG)echo "i=$i,platNo=$platNo
      "; + if($DEBUG) echo "
      selSysTypeNo=$selSysTypeNo"; + $sysNum=get_sys_total($selSysType); + if($DEBUG) echo "sysNum=$sysNum,
      "; + $subSysNum=get_subsys_total($selSysType); + if($DEBUG)echo "
      subSysNum=$subSysNum"; + + if($DEFAULT_SYS=='GMSC' && ($selSysType=='MSC' || $selSysType=='AUC' || $selSysType=='PPS' || $selSysType=='SMSC')) + { + continue; + } + elseif($DEFAULT_SYS=='MSC' && ($selSysType=='GMSC' || $selSysType=='SN'||$selSysType=='MSS')) + { + continue; + } + elseif($DEFAULT_SYS=='HBSC' && $selSysType!='EMS') + { + continue; + } + elseif($DEFAULT_SYS=='SN' && $selSysType!='EMS' && $selSysType!='SN') + { + continue; + } + elseif($selSysTypeNo == 388) + {//wxc2 + continue; + } + + for($j=0;$j<$sysNum;$j++) + { + for($k=0;$k<$subSysNum;$k++) + { + static $rows_of_show=0; + $sysName=$selSysType."_".$j."_".$k; + if($DEBUG)echo "
      sysName=$sysName
      "; + //echo ""; + //echo ""; //Item + + $show_sysName[$rows_of_show]=$sysName;//add by arwean + + + /**************** Get Module's Version *****************/ + //$selTypeNoSQL = "SELECT sysTypeNo from OMC_PUB.sysConf WHERE sysTypeName='{$PlatTypeDefArr[$platNo][remark]}'"; + $selTypeNoSQL = "SELECT sysTypeNo from OMC_PUB.sysConf WHERE sysTypeName='$selSysType'"; + if($DEBUG) echo "sysNum=$sysNum,subSysNum=$subSysNum
      "; + if ($DEBUG) echo "selTypeNoSQL=$selTypeNoSQL
      "; + $selTypeNoRes = mysqli_query($pubConn,$selTypeNoSQL); + $selTypeNoRow = @mysqli_fetch_array($selTypeNoRes); + echo mysqli_error($pubConn); + do{ + $sysTypeNo = $selTypeNoRow[sysTypeNo]; + //echo "sysTypeNo=$sysTypeNo
      "; + $selSQL = "SELECT detailStat from OMC_PUB.sysStat WHERE sysTypeNo=$sysTypeNo and sysNo=$j and subSysNo=$k"; + if($DEBUG) echo "selSQL=$selSQL
      "; + $selRes = mysqli_query($pubConn,$selSQL); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + $hexMes = $selRow[detailStat]; + if ($DEBUG) echo "hexMes=$hexMes
      "; + $versionLen = 3; + $versionBgnByte=23; + + if($versionLen) + { + $versionHex_0 = substr($hexMes,$versionBgnByte*2,2); + $versionDec_0 = HexDec($versionHex_0); + //$versionDec_0=omc_keep_length($versionDec_0,0,2); + + $versionHex_1 = substr($hexMes,($versionBgnByte+1)*2,2); + $versionDec_1 = HexDec($versionHex_1); + $versionDec_1=omc_keep_length($versionDec_1,0,2); + + $versionHex_2 = substr($hexMes,($versionBgnByte+2)*2,2); + $versionDec_2 = HexDec($versionHex_2); + $versionDec_2=omc_keep_length($versionDec_2,0,2); + + $version = $versionDec_0.".".$versionDec_1.".".$versionDec_2; + if($version == '0.00.00') + { + $version ='--'; + } + if($DEBUG) echo "sysTypeNo=$sysTypeNo,"; + $arrBeat[$i][$j][$k][9][0] = $version; + if($DEBUG) echo "arrBeat[$i][$j][$k][9][0]=$version
      "; + } + }while($selTypeNoRow=@mysqli_fetch_array($selTypeNoRes)); + + + for($t=0;$t<$modNum;$t++) + { + $color_fields[$rows_of_show][$t] = "#000000"; + if($t == 7 || ($showRange == 'low') && $t > 1 && $t < 7) + { + continue; + } + + if($t==9) + { + if ((isset($arrBeat[$i][$j][$k][$t][0]))&&($arrBeat[$i][$j][$k][$t][0]!='0.0.0')) + { + //echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$i][$j][$k][$t][0]; + } + else + { + //echo ""; + $show_fields[$rows_of_show][$t] = "--"; + } + } + else + { + if($DEBUG) + echo "
      arrBeat[$platNo][$j][$k][0][0]={$arrBeat[$platNo][$j][$k][0][0]}"; + + if(isset($arrBeat[$platNo][$j][$k][$t][0])) + { + $platSys=$i; + $platSubSys=$j*$subSysNum+$k; + $platId=PLAT."_".$platSys."_".$platSubSys; + if($t==0) + { + + if(isset($arrBeat[$platNo][$j][$k][8][0])) + { + //echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$i][$j][$k][$t][0]; + $color_fields[$rows_of_show][$t] = $arrBeat[$i][$j][$k][$t][1]; + + } + else + { + + //echo ""; + $show_fields[$rows_of_show][$t] = "--"; + $color_fields[$rows_of_show][$t] = "#000000"; + } + } + elseif($t==10) + { + if(isset($arrBeat[$platNo][$j][$k][8][0])) + { + //echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$i][$j][$k][$t][0]; + } + else + { + //echo ""; + $show_fields[$rows_of_show][$t] = "--"; + } + } + elseif($t==$modNum-1) + { + //echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][0]; + $color_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][1]; + } + elseif($showRange == 'low') + { + //echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][0]; + $color_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][1]; + } + else + { + //echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][0]; + $color_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][1]; + } + } + else + { + //echo ""; + $show_fields[$rows_of_show][$t] = "--"; + $color_fields[$rows_of_show][$t] = "#000000"; + + } + if (ord($show_fields[$rows_of_show][$t])==0) + $show_fields[$rows_of_show][$t]="--"; + } + + } + //echo ""; + $rows_of_show++;//add by arwean + } + } + } + + //echo "
      $strItem$i: $arrModName[$i]
      $sysName"; + //echo "{$arrBeat[$i][$j][$k][$t][0]}";//Version + //echo "-- + //{$arrBeat[$i][$j][$k][$t][0]}--{$arrBeat[$i][$j][$k][$t][0]}--{$arrBeat[$platNo][$j][$k][$t][0]}{$arrBeat[$platNo][$j][$k][$t][0]}{$arrBeat[$platNo][$j][$k][$t][0]}--
      "; + + //define frame items + for($i=0; $i<$rows_of_show; $i++) + { + $input_sysName[$i]="input_sysName" . "_$i"; + for($t=0; $t<$modNum; $t++) + { + $fields_id[$i][$t]="fields_id" . "_$i" . "_$t"; + } + } + + //show items + echo ""; + echo ""; + $modNum = count($arrModName); + echo ""; + for($i=0;$i<$modNum;$i++) + { + if($i == 7 || ($showRange == 'low') && $i > 1 && $i < 7) + { + continue; + } + echo ""; + } + echo ""; + + for($i=0;$i< $rows_of_show; $i++) + { + $size="10%"; + echo ""; + echo ""; + for($t=0;$t< $modNum;$t++) + { + if($t==0) + $size="1"; + else if($t==8) + $size="20%"; + else if($t==9) + $size="10%"; + else if($t==10) + $size="16%"; + else + $size="1"; + if(isset($show_fields[$i][$t])) + { + echo ""; + } + } + echo ""; + } + echo "
      $strItem$arrModName[$i]
      "; + echo "$show_sysName[$i]"; + echo ""; + echo "{$show_fields[$i][$t]}"; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "

      $strRemark:  Y = $strNormal,    N = $strAbnormal,   -- = $strNothing.

      "; + echo "

      ";/* + if($showRange=='low') + { + if($backpage=='overview') + echo "$strBack"; + else + echo "$strBack"; + } + echo "     ";*/ + echo "$strClear"; + echo "

      "; + echo "
      "; + + $time_end=getmicrotime(); + $time = $time_end-$time_start; + //echo "deal with datas in $time seconds.
      "; + +} +adjust_content_tail(); +?> + + + diff --git a/wxc2_omc/fault/serverStatus/serverStatusUp.php b/wxc2_omc/fault/serverStatus/serverStatusUp.php new file mode 100755 index 0000000..250fc7e --- /dev/null +++ b/wxc2_omc/fault/serverStatus/serverStatusUp.php @@ -0,0 +1,798 @@ +sys_id=$sys_id"; +if($DEBUG)echo "
      showRange=$showRange"; +if($DEBUG)echo "
      mod_type=$mod_type"; + +if($showRange == 'low') +{ + $helpId = "1.2.2"; +} +else +{ + $helpId = "6.12"; +} + +$due_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-$heatbeat_overtime,date("m"),date("d"),date("Y"))); +$ove_date = date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+$heatbeat_overtime,date("m"),date("d"),date("Y"))); + +?> + +"; + echo ""; + echo ""; + echo "$strSysStatus > $strCentralOffice > $strServer"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; +echo ""; + +$defineIptransStatus=array( + array('num' => '0', 'remark' => '--', 'color' => '#000000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineMtp3Status=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '2', 'remark' => '--', 'color' => '#000000'), + array('num' => '3', 'remark' => '--', 'color' => '#000000') +); + +$defineSnmpStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineSccpStatus=array( + array('num' => '0', 'remark' => 'Fail', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Congest', 'color' => '#FF0000'), + array('num' => '2', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineTcapStatus=array( + array('num' => '0', 'remark' => 'Not used', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + +$defineDebugStatus=array( + array('num' => '0', 'remark' => 'N', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Y', 'color' => '#0000FF') +); + + +$defineSyncStatus=array( + array('num' => '0', 'remark' => 'Y', 'color' => '#0000FF'), + array('num' => '1', 'remark' => 'Restart', 'color' => '#0000FF'), + array('num' => '2', 'remark' => 'Init', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'suspend', 'color' => '#0000FF'), + array('num' => '4', 'remark' => 'Stop', 'color' => '#FF0000') +); + + +//deal with summary +if($sys_id == 'all') +{ + //get plat message + $selSql = " SELECT * FROM $sysStat_table WHERE sysTypeNo='200' "; + if($DEBUG) echo "selSql=$selSql
      "; + $selRes = mysqli_query($pubConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $sysNo = $selRow[sysNo]; + $subSysNo = $selRow[subSysNo]; + if($DEBUG) echo "
      sysNo=$sysNo; subSysNo=$subSysNo"; + $hexMes = $selRow[detailStat]; + if($DEBUG)echo "
      hexMes=$hexMes"; + $refreshTime = $selRow[updateTime]; + $sysType = $PlatTypeDefArr[$sysNo][remark]; + $sysNum=get_sys_total($sysType); + $subSysNum=get_subsys_total($sysType); + if($DEBUG)echo "
      sysNum=$sysNum; subSysNum=$subSysNum"; + if($subSysNum) + { + $rSysNo = floor($subSysNo/$subSysNum); + } + $rSubSysNo = $subSysNo-$rSysNo*$subSysNum; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][0] = $refreshTime; + if($refreshTime < $due_date || $refreshTime > $ove_date) + { + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][1] = "#FF0000"; + } + else + { + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][1] = "#0000FF"; + } + if($DEBUG) + echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][0]}"; + if($DEBUG) + echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][8][1]}"; + + $iptrans_bgn_byt=21; + if($DEBUG)echo "
      iptrans_bgn_byt=$iptrans_bgn_byt"; + $iptrans_len_hex=substr($hexMes,$iptrans_bgn_byt*2,4);//iptrans所占长度,19bytes + $iptrans_len_dec=HexDec($iptrans_len_hex); + if($DEBUG)echo "
      iptrans_len_dec=$iptrans_len_dec"; + //status + if($iptrans_len_dec) + { + $iptrans_state_hex=substr($hexMes,($iptrans_bgn_byt+5)*2,2); + $iptrans_state_dec=HexDec($iptrans_state_hex); + if($DEBUG)echo "
      iptrans_state_dec=$iptrans_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]=$defineIptransStatus[$iptrans_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]=$defineIptransStatus[$iptrans_state_dec][color]; + if($defineIptransStatus[$iptrans_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]}"; + + $mtp3_bgn_byt=$iptrans_bgn_byt+4+$iptrans_len_dec; + if($DEBUG)echo "
      mtp3_bgn_byt=$mtp3_bgn_byt"; + $mtp3_len_hex=substr($hexMes,$mtp3_bgn_byt*2,4);//mtp3所占长度 + $mtp3_len_dec=HexDec($mtp3_len_hex); + if($DEBUG)echo "
      mtp3_len_dec=$mtp3_len_dec"; + //status + if($mtp3_len_dec) + { + $mtp3_state_hex=substr($hexMes,($mtp3_bgn_byt+5)*2,2); + $mtp3_state_dec=HexDec($mtp3_state_hex); + if($DEBUG)echo "
      mtp3_state_dec=$mtp3_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][0]=$defineMtp3Status[$mtp3_state_dec][remark]; + + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][1]=$defineMtp3Status[$mtp3_state_dec][color]; + if($defineMtp3Status[$mtp3_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][2][1]}"; + + $sccp_bgn_byt=$mtp3_bgn_byt+4+$mtp3_len_dec; + $sccp_len_hex=substr($hexMes,$sccp_bgn_byt*2,4);//sccp所占长度 + $sccp_len_dec=hexDec($sccp_len_hex); + if($DEBUG)echo "
      sccp_len_dec=$sccp_len_dec"; + //status + if($sccp_len_dec) + { + $sccp_state_hex=substr($hexMes,($sccp_bgn_byt+5)*2,2); + $sccp_state_dec=HexDec($sccp_state_hex); + if($DEBUG)echo "
      sccp_state_dec=$sccp_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][0]=$defineSccpStatus[$sccp_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][1]=$defineSccpStatus[$sccp_state_dec][color]; + + if($defineSccpStatus[$sccp_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][3][1]}"; + + $tcap_bgn_byt=$sccp_bgn_byt+4+$sccp_len_dec; + $tcap_len_hex=substr($hexMes,$tcap_bgn_byt*2,4);//tcap所占长度 + $tcap_len_dec=HexDec($tcap_len_hex); + if($DEBUG)echo "
      tcap_len_dec=$tcap_len_dec"; + //status + if($tcap_len_dec) + { + $tcap_state_hex=substr($hexMes,($tcap_bgn_byt+5)*2,2); + $tcap_state_dec=HexDec($tcap_state_hex); + if($DEBUG)echo "
      tcap_state_dec=$tcap_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][0]=$defineTcapStatus[$tcap_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][1]=$defineTcapStatus[$tcap_state_dec][color]; + if($defineTcapStatus[$tcap_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][4][1]}"; + + $snmp_bgn_byt=$tcap_bgn_byt+4+$tcap_len_dec; + $snmp_len_hex=substr($hexMes,$snmp_bgn_byt*2,4);//snmp所占长度 + $snmp_len_dec=HexDec($snmp_len_hex); + if($DEBUG)echo "
      snmp_len_dec=$snmp_len_dec"; + //status + if($snmp_len_dec) + { + $snmp_state_hex=substr($hexMes,($snmp_bgn_byt+5)*2,2); + $snmp_state_dec=HexDec($snmp_state_hex); + if($DEBUG)echo "
      snmp_state_dec=$snmp_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][0]=$defineSnmpStatus[$snmp_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][1]=$defineSnmpStatus[$snmp_state_dec][color]; + if($defineSnmpStatus[$snmp_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][5][1]}"; + + $debug_bgn_byt=$snmp_bgn_byt+4+$snmp_len_dec; + $debug_len_hex=substr($hexMes,$debug_bgn_byt*2,4);//debug所占长度 + $debug_len_dec=HexDec($debug_len_hex); + if($DEBUG)echo "
      debug_len_dec=$debug_len_dec"; + //status + if($debug_len_dec) + { + $debug_state_hex=substr($hexMes,($debug_bgn_byt+5)*2,2); + $debug_state_dec=HexDec($debug_state_hex); + if($DEBUG)echo "
      debug_state_dec=$debug_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][0]=$defineDebugStatus[$debug_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][1]=$defineDebugStatus[$debug_state_dec][color]; + + if($defineDebugStatus[$debug_state_dec][color] == '#FF0000') + $ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = 1; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][6][1]}"; + + $syn_bgn_byt=$debug_bgn_byt+4+$debug_len_dec; + if($DEBUG)echo "
      syn_bgn_byt=$syn_bgn_byt"; + $syn_len_hex=substr($hexMes,$syn_bgn_byt*2,4);//syn所占长度 + $syn_len_dec=HexDec($syn_len_hex); + if($DEBUG)echo "
      syn_len_dec=$syn_len_dec"; + //status + if($syn_len_dec) + { + $syn_state_hex=substr($hex_mes,($syn_bgn_byt+5)*2,2); + $syn_state_dec=HexDec($syn_state_hex); + if($DEBUG)echo "
      syn_state_dec=$syn_state_dec"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][0]=$defineSyncStatus[$syn_state_dec][remark]; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][1]=$defineSyncStatus[$syn_state_dec][color]; + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][7][1]}"; + + if($DEBUG) echo "
      ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo] = {$ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo]}"; + if($showRange == 'low') + { + if($ttlPlatArr[$sysNo][$rSysNo][$rSubSysNo]) + { + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0] = "N"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1] = "#FF0000"; + } + else + { + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0] = "Y"; + $arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1] = "#0000FF"; + } + } + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][0]}"; + if($DEBUG)echo "
      arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]={$arrBeat[$sysNo][$rSysNo][$rSubSysNo][1][1]}"; + + }while($selRow = @mysqli_fetch_array($selRes)); + + + //get basic status + $plat_num=count($PlatTypeDefArr); + if($DEBUG) echo "
      plat_num=$plat_num "; + $sumWhere = " WHERE "; + for($i=0;$i<$plat_num;$i++) + { + $sysTypeNo = $PlatTypeDefArr[$i][sysTypeNo]; + if($i==0) + { + $sumWhere = $sumWhere." sysTypeNo = $sysTypeNo " ; + } + else + { + $sumWhere = $sumWhere." OR sysTypeNo = $sysTypeNo "; + } + } + if($DEBUG)echo "
      sumWhere=$sumWhere"; + $selPlat="SELECT * FROM sysConf" . $sumWhere; + if($DEBUG)echo "
      selPlat=$selPlat"; + $resPlat=@mysqli_query($pubConn,$selPlat); + $rowPlat=@mysqli_fetch_array($resPlat); + do{ + $sysTypeNo = $rowPlat[sysTypeNo]; + $platHeart = $rowPlat[platHeart]; + if($DEBUG)echo "
      platHeart=$platHeart"; + for($i=0;$iselPlatNo[$i]=$selPlatNo[$i]"; + } + }while($rowPlat=@mysqli_fetch_array($resPlat)); + + $basSql = " SELECT * FROM sysInfo ".$sumWhere; + if($DEBUG) echo "
      basSql=$basSql"; + $basRes = mysqli_query($pubConn,$basSql); + $basRow = @mysqli_fetch_array($basRes); + echo mysqli_error($pubConn); + do + { + $sysTypeNo = $basRow[sysTypeNo]; + if($DEBUG)echo "
      sysTypeNo=$sysTypeNo"; + $sysNo = $basRow[sysNo]; + if($DEBUG)echo "
      sysNo=$sysNo"; + $subSysNo = $basRow[subSysNo]; + if($DEBUG)echo "
      subSysNo=$subSysNo"; + $baseStat = $basRow[baseStat]; + if($DEBUG)echo "
      baseStat=$baseStat"; + $sysIp = $basRow[ip]; + if($DEBUG)echo "
      sysIp=$sysIp"; + $okStat = 0; + for($i=0;$i<$plat_num;$i++) + { + if($DEBUG)echo "
      i=$i"; + $platNo = $selPlatNo[$i]; + + if($okStat) + { + break; + } + $selSysType=$PlatTypeDefArr[$i][remark]; + $selSysTypeNo=$PlatTypeDefArr[$i][sysTypeNo]; + if($DEBUG)echo "
      selSysTypeNo=$selSysTypeNo"; + + if($selSysTypeNo != $sysTypeNo) + { + if($DEBUG)echo "
      continue i=$i"; + continue; + } + $sysNum=get_sys_total($selSysType); + if($DEBUG)echo "
      sysNum=$sysNum"; + + $subSysNum=get_subsys_total($selSysType); + if($DEBUG)echo "
      subSysNum=$subSysNum"; + if($DEFAULT_SYS=='GMSC' && ($selSysType=='MSC' || $selSysType=='AUC' || $selSysType=='PPS' || $selSysType=='SMSC')) + { + continue; + } + elseif($DEFAULT_SYS=='MSC' && $selSysType=='GMSC') + { + continue; + } + elseif($DEFAULT_SYS=='HBSC' && $selSysType!='EMS') + { + continue; + } + + for($j=0;$j<$sysNum;$j++) + { + if($DEBUG)echo "
      j=$j"; + if($okStat) + { + break; + } + if($j != $sysNo) + { + if($DEBUG)echo "
      continue j=$j"; + continue; + } + for($k=0;$k<$subSysNum;$k++) + { + if($DEBUG)echo "
      k=$k"; + if($k != $subSysNo) + { + continue; + } + if($DEBUG)echo "
      arrBeat[$platNo][$j][$k][8][0]={$arrBeat[$platNo][$j][$k][8][0]}"; + //echo "due_date=$due_date,ove_date=$ove_date
      "; + //$i == 2 MSC + //$i == 6 SMSC + if ( ($platNo == 9) && ($i!=2) && ($i!=6) ) + { + if($baseStat && $arrBeat[$platNo][$j][$k][8][0] > $due_date && $arrBeat[$platNo][$j][$k][8][0] < $ove_date) + { + $arrBeat[$i][$j][$k][0][0]="Y"; + $arrBeat[$i][$j][$k][0][1]="#0000FF"; + } + else + { + $arrBeat[$i][$j][$k][0][0]="N"; + $arrBeat[$i][$j][$k][0][1]="#FF0000"; + } + } + else + { + if($baseStat && $arrBeat[$platNo][$j][$k][8][0] > $due_date && $arrBeat[$platNo][$j][$k][8][0] < $ove_date) + { + $arrBeat[$i][$j][$k][0][0]="Y"; + $arrBeat[$i][$j][$k][0][1]="#0000FF"; + } + else + { + $arrBeat[$i][$j][$k][0][0]="N"; + $arrBeat[$i][$j][$k][0][1]="#FF0000"; + } + if($i==0 && $arrBeat[$i][$j][$k][0][0]=='Y') {//OMC状态为Y,还要进一步判断其进程是否全部起来了add by arwean 2006-11-30 16:09 + $sel_mes_sql="SELECT detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + if(0)echo "
      sel_mes_sql=$sel_mes_sql"; + $sel_mes_res=mysqli_query($pubConn,$sel_mes_sql); + $sel_mes_row=@mysqli_fetch_array($sel_mes_res); + $hex_mes=$sel_mes_row[detailStat]; + $num_bgn=66;//进程数目 + $pro_bgn=67;//服务器进程状态 + //进程数目 + $hex_pro_num=substr($hex_mes,$num_bgn*2,2); + $pro_num=HexDec($hex_pro_num); + for($ix=0;$ix< $pro_num;$ix++) + { + ${hex_process_.$ix}=substr($hex_mes,$pro_bgn*2+$ix*2,2); + ${dec_process_.$ix}=HexDec(${hex_process_.$ix}); + if($DEBUG)echo "
      dec_process_$ix=${dec_process_.$ix}"; + if(${dec_process_.$ix} < 1){ + $arrBeat[$i][$j][$k][0][0]="N"; + $arrBeat[$i][$j][$k][0][1]="#FF0000"; + } + } + }//end add + } + if($DEBUG)echo "
      arrBeat[$i][$j][$k][0][0]={$arrBeat[$i][$j][$k][0][0]}"; + if($DEBUG)echo "
      arrBeat[$i][$j][$k][0][1]={$arrBeat[$i][$j][$k][0][1]}"; + $okStat = 1; + + //echo the each system's ip address + + $arrBeat[$i][$j][$k][10][0]=$sysIp; + if($DEBUG)echo "
      arrBeat[$i][$j][$k][10][0]={$arrBeat[$i][$j][$k][10][0]}"; + + break; + } + } + } + }while($basRow = @mysqli_fetch_array($basRes)); + + +if ($selectedLanguage == 'eng') +{ + $arrModName[0] = 'Application status'; + $arrModName[1] = 'IPTRANS'; + if($showRange == 'low') + { + $arrModName[1] = 'Platform module'; + } + $arrModName[2] = 'MTP3'; + $arrModName[3] = 'SCCP'; + $arrModName[4] = 'TCAP'; + $arrModName[5] = 'SNMP'; + $arrModName[6] = 'DEBUG'; + $arrModName[7] = 'DATA SYNC'; + $arrModName[8] = 'Refresh time'; + $arrModName[9] = 'Version'; + $arrModName[10] = 'IP address'; +} +elseif ($selectedLanguage == 'chn') +{ + $arrModName[0] = '基本状态'; + $arrModName[1] = 'IPTRANS'; + if($showRange == 'low') + { + $arrModName[1] = '平台模块'; + } + $arrModName[2] = 'MTP3'; + $arrModName[3] = 'SCCP'; + $arrModName[4] = 'TCAP'; + $arrModName[5] = 'SNMP'; + $arrModName[6] = 'DEBUG'; + $arrModName[7] = 'DATA SYNC'; + $arrModName[8] = '刷新时间'; + $arrModName[9] = '版本号'; + $arrModName[10] = 'IP 地址'; +} + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "
      "; + echo "

      "; + if($showRange=='low')//show back + { + if($backpage=='overview') + echo "$strBack"; + else + echo "$strBack"; + } + echo "     "; + echo "$strClear"; + echo "

      "; + echo "

      $strServerSummaryInfo

      "; + + echo ""; + echo ""; + $modNum = count($arrModName); + echo ""; + for($i=0;$i<$modNum;$i++) + { + if($i == 7 || ($showRange == 'low') && $i > 1 && $i < 7) + { + continue; + } + echo ""; + } + echo ""; + + for($i=0;$i<$plat_num;$i++) + { + if($DEBUG) echo "plat_num=$plat_num
      "; + $selSysType=$PlatTypeDefArr[$i][remark]; + if($DEBUG) echo "selSysType=$selSysType
      "; + $selSysTypeNo=$PlatTypeDefArr[$i][sysTypeNo]; + $tmpSql = " SELECT * FROM elementExistConf WHERE elementTypeNo='$selSysTypeNo' AND existFlag='1'"; + if($DEBUG) + echo "
      tmpSql=$tmpSql"; + $tmpRes = mysqli_query($pubConn,$tmpSql); + if(mysqli_num_rows($tmpRes)<=0) + continue; + $platNo = $selPlatNo[$i]; + if($DEBUG)echo "i=$i,platNo=$platNo
      "; + if($DEBUG) echo "
      selSysTypeNo=$selSysTypeNo"; + $sysNum=get_sys_total($selSysType); + if($DEBUG) echo "sysNum=$sysNum,
      "; + $subSysNum=get_subsys_total($selSysType); + if($DEBUG)echo "
      subSysNum=$subSysNum"; + if($DEFAULT_SYS=='GMSC' && ($selSysType=='MSC' || $selSysType=='AUC' || $selSysType=='PPS' || $selSysType=='SMSC')) + { + continue; + } + elseif($DEFAULT_SYS=='MSC' && ($selSysType=='GMSC' || $selSysType=='SN'||$selSysType=='MSS')) + { + continue; + } + elseif($DEFAULT_SYS=='HBSC' && $selSysType!='EMS') + { + continue; + } + elseif($DEFAULT_SYS=='SN' && $selSysType!='EMS' && $selSysType!='SN') + { + continue; + } + elseif($selSysTypeNo == 388) + {//wxc2 + continue; + } + + for($j=0;$j<$sysNum;$j++) + { + for($k=0;$k<$subSysNum;$k++) + { + static $rows_of_show=0; + $sysName=$selSysType."_".$j."_".$k; + + if($DEBUG)echo "
      sysName=$sysName
      "; + echo ""; + echo ""; //Item + + $show_sysName[$rows_of_show]=$sysName;//add by arwean + + + /**************** Get Module's Version *****************/ + //$selTypeNoSQL = "SELECT sysTypeNo from OMC_PUB.sysConf WHERE sysTypeName='{$PlatTypeDefArr[$platNo][remark]}'"; + $selTypeNoSQL = "SELECT sysTypeNo from OMC_PUB.sysConf WHERE sysTypeName='$selSysType'"; + if($DEBUG) echo "sysNum=$sysNum,subSysNum=$subSysNum
      "; + if ($DEBUG) echo "selTypeNoSQL=$selTypeNoSQL
      "; + $selTypeNoRes = mysqli_query($pubConn,$selTypeNoSQL); + $selTypeNoRow = @mysqli_fetch_array($selTypeNoRes); + echo mysqli_error($pubConn); + do{ + $sysTypeNo = $selTypeNoRow[sysTypeNo]; + //echo "sysTypeNo=$sysTypeNo
      "; + $selSQL = "SELECT detailStat from OMC_PUB.sysStat WHERE sysTypeNo=$sysTypeNo and sysNo=$j and subSysNo=$k"; + if($DEBUG) echo "selSQL=$selSQL
      "; + $selRes = mysqli_query($pubConn,$selSQL); + $selRow = @mysqli_fetch_array($selRes); + echo mysqli_error($pubConn); + $hexMes = $selRow[detailStat]; + if ($DEBUG) echo "hexMes=$hexMes
      "; + $versionLen = 3; + $versionBgnByte=23; + + if($versionLen) + { + $versionHex_0 = substr($hexMes,$versionBgnByte*2,2); + $versionDec_0 = HexDec($versionHex_0); + //$versionDec_0=omc_keep_length($versionDec_0,0,2); + + $versionHex_1 = substr($hexMes,($versionBgnByte+1)*2,2); + $versionDec_1 = HexDec($versionHex_1); + $versionDec_1=omc_keep_length($versionDec_1,0,2); + + $versionHex_2 = substr($hexMes,($versionBgnByte+2)*2,2); + $versionDec_2 = HexDec($versionHex_2); + $versionDec_2=omc_keep_length($versionDec_2,0,2); + + $version = $versionDec_0.".".$versionDec_1.".".$versionDec_2; + if($version == '0.00.00') + { + $version ='--'; + } + if($DEBUG) echo "sysTypeNo=$sysTypeNo,"; + $arrBeat[$i][$j][$k][9][0] = $version; + if($DEBUG) echo "arrBeat[$i][$j][$k][9][0]=$version
      "; + } + }while($selTypeNoRow=@mysqli_fetch_array($selTypeNoRes)); + + for($t=0;$t<$modNum;$t++) + { + $color_fields[$rows_of_show][$t] = "#000000"; + + if($t == 7 || ($showRange == 'low') && $t > 1 && $t < 7) + { + continue; + } + + if($t==9) + { + if ((isset($arrBeat[$i][$j][$k][$t][0]))&&($arrBeat[$i][$j][$k][$t][0]!='0.0.0')) + { + echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$i][$j][$k][$t][0]; + } + else + { + echo ""; + $show_fields[$rows_of_show][$t] = "--"; + } + } + else + { + if($DEBUG) + echo "
      arrBeat[$platNo][$j][$k][$t][0]={$arrBeat[$platNo][$j][$k][$t][0]}"; + if(isset($arrBeat[$platNo][$j][$k][$t][0])) + { + $platSys=$i; + $platSubSys=$j*$subSysNum+$k; + $platId=PLAT."_".$platSys."_".$platSubSys; + if($t==0) + { + if(isset($arrBeat[$platNo][$j][$k][8][0])) + { + echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$i][$j][$k][$t][0]; + $color_fields[$rows_of_show][$t] = $arrBeat[$i][$j][$k][$t][1]; + $href_fields[$rows_of_show][$t] = "serverStatusDetail.php?sys_id=$platId&backpage=$backpage&showRange=$showRange&mod_type=$t&platStatus={$ttlPlatArr[$platNo][$j][$k]}"; + + } + else + { + echo ""; + $show_fields[$rows_of_show][$t] = "--"; + $color_fields[$rows_of_show][$t] = "#000000"; + } + } + elseif($t==10) + { + if(isset($arrBeat[$platNo][$j][$k][8][0])) + { + echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$i][$j][$k][$t][0]; + } + else + { + echo ""; + $show_fields[$rows_of_show][$t] = "--"; + } + } + elseif($t==$modNum-1) + { + echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][0]; + $color_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][1]; + } + elseif($showRange == 'low') + { + echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][0]; + $color_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][1]; + } + else + { + echo ""; + $show_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][0]; + $color_fields[$rows_of_show][$t] = $arrBeat[$platNo][$j][$k][$t][1]; + $href_fields[$rows_of_show][$t] = "serverStatusDetail.php?sys_id=$platId&backpage=$backpage&showRange=$showRange&mod_type=$t"; + + } + } + else + { + echo ""; + $show_fields[$rows_of_show][$t] = "--"; + $color_fields[$rows_of_show][$t] = "#000000"; + } + if (ord($show_fields[$rows_of_show][$t])==0) + $show_fields[$rows_of_show][$t]="--"; + } + + } + echo ""; + $rows_of_show++;//add by arwean + } + } + } + + echo "
      $strItem$i: $arrModName[$i]
      $sysName"; + echo "{$arrBeat[$i][$j][$k][$t][0]}";//Version + echo "-- + {$arrBeat[$i][$j][$k][$t][0]}--{$arrBeat[$i][$j][$k][$t][0]}--{$arrBeat[$platNo][$j][$k][$t][0]}{$arrBeat[$platNo][$j][$k][$t][0]}{$arrBeat[$platNo][$j][$k][$t][0]}--
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "

      $strRemark:  Y = $strNormal,    N = $strAbnormal,   -- = $strNothing.

      "; + echo "

      "; + if($showRange=='low') + { + if($backpage=='overview') + echo "$strBack"; + else + echo "$strBack"; + } + echo "     "; + echo "$strClear"; + echo "

      "; + echo "
      "; +// echo ""; + + //define frame items + for($i=0; $i<$rows_of_show; $i++) + { + for($t=0; $t<$modNum; $t++) + { + $fields_id[$i][$t]="fields_id" . "_$i" . "_$t"; + } + } + + echo ""; +} +?> + + + diff --git a/wxc2_omc/fault/serverStatusImprove.tgz b/wxc2_omc/fault/serverStatusImprove.tgz new file mode 100755 index 0000000..58177b9 Binary files /dev/null and b/wxc2_omc/fault/serverStatusImprove.tgz differ diff --git a/wxc2_omc/fault/serverStatusImprove/config.ini b/wxc2_omc/fault/serverStatusImprove/config.ini new file mode 100755 index 0000000..f03b9e5 --- /dev/null +++ b/wxc2_omc/fault/serverStatusImprove/config.ini @@ -0,0 +1,187 @@ +; This config.ini file must be configured when add a new module +[0] +Module="EMS" +SysTypeNo=0 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=0 +[1] +Module="MSC" +SysTypeNo=320 +MaxSysNo=20 +MaxSubsysNo=0 +PlatNo=9 +[2] +Module="HLR" +SysTypeNo=330 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=3 +[3] +Module="AUC" +SysTypeNo=340 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=3 +[4] +Module="PPS" +SysTypeNo=360 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=5 +[5] +Module="MME" +SysTypeNo=361 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=0 +[6] +Module="SPGW" +SysTypeNo=362 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=0 +[7] +Module="IMS" +SysTypeNo=363 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=0 +[8] +Module="RCS" +SysTypeNo=364 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=0 +[9] +Module="UDM" +SysTypeNo=365 +MaxSysNo=20 +MaxSubsysNo=0 +PlatNo=999 +[10] +Module="AUSF" +SysTypeNo=366 +MaxSysNo=20 +MaxSubsysNo=0 +PlatNo=999 +[11] +Module="SMSC" +SysTypeNo=350 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=6 +[12] +Module="EIR" +SysTypeNo=380 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=9 +[13] +Module="VSS" +SysTypeNo=390 +MaxSysNo=10 +MaxSubsysNo=0 +PlatNo=8 +[14] +Module="MNP" +SysTypeNo=370 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=9 +[15] +Module="AAS" +SysTypeNo=311 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=9 +[16] +Module="SMEG" +SysTypeNo=355 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=0 +[17] +Module="OPPS" +SysTypeNo=375 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=9 +[18] +Module="MRFC" +SysTypeNo=385 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=9 +[19] +Module="iPALIM" +SysTypeNo=378 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=9 +[20] +Module="iRLS" +SysTypeNo=379 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=9 +[21] +Module="MHC" +SysTypeNo=386 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=9 +[22] +Module="IWF" +SysTypeNo=384 +MaxSysNo=8 +MaxSubsysNo=0 +PlatNo=999 +[23] +Module="iGRS" +SysTypeNo=387 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=999 +[24] +Module="IUUPGW" +SysTypeNo=389 +MaxSysNo=11 +MaxSubsysNo=0 +PlatNo=999 +[25] +Module="TMG" +SysTypeNo=391 +MaxSysNo=8 +MaxSubsysNo=0 +PlatNo=999 +[26] +Module="AMRMG" +SysTypeNo=392 +MaxSysNo=8 +MaxSubsysNo=0 +PlatNo=999 +[27] +Module="GbC" +SysTypeNo=393 +MaxSysNo=8 +MaxSubsysNo=0 +PlatNo=999 +[28] +Module="MCA" +SysTypeNo=394 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=999 +[29] +Module="RCM" +SysTypeNo=395 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=18 +[30] +Module="SGSN" +SysTypeNo=400 +MaxSysNo=2 +MaxSubsysNo=0 +PlatNo=999 diff --git a/wxc2_omc/fault/serverStatusImprove/function.inc b/wxc2_omc/fault/serverStatusImprove/function.inc new file mode 100755 index 0000000..e1ab587 --- /dev/null +++ b/wxc2_omc/fault/serverStatusImprove/function.inc @@ -0,0 +1,1727 @@ +"; + global $pubConn; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return "--"; + + $row=mysqli_fetch_array($res); + + if(strlen($row['detailStat']) < 6) + return "--"; + if($sysTypeNo == 362) + $version_string=substr($row['detailStat'],36,6); + else + $version_string=substr($row['detailStat'],46,6); + $version_string=hexdec(substr($version_string,0,2)).".".hexdec(substr($version_string,2,2)).".".hexdec(substr($version_string,4,2)); + return $version_string; +} + +function GetModuleInfo($conf) +{ + $sql="select * from OMC_PUB.sysInfo where sysTypeNo={$conf['SysTypeNo']} order by sysNo,subSysNo "; + //echo "$sql
      "; + global $pubConn; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + //echo "num=$num"; + if($num<=0) + return 0; + + for($i=0;$i<$num;$i++) + { + $row=mysqli_fetch_array($res); + + $sql_plat="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$conf['PlatNo']} and subSysNo={$row['sysNo']} "; + //echo "$sql_plat
      "; + $res_plat=mysqli_query($pubConn,$sql_plat); + $num_plat=mysqli_num_rows($res_plat); + + $module[$i]['sysNo']=$row['sysNo']+0; + + $module[$i]['Name']['Value']=$conf['Module']."_".$row['sysNo']; + $module[$i]['Name']['Color']="#000000"; + + $module[$i]['Version']['Value']=GetModuleVersion($conf['SysTypeNo'],$row['sysNo'],$row['subSysNo']); + $module[$i]['Version']['Color']="#000000"; + + $module[$i]['IPAddress']['Value']=$row['ip']; + $module[$i]['IPAddress']['Color']="#000000"; + + if($num_plat != 1) + { + $module[$i]['PlatStatus']['Value']="N"; + $module[$i]['PlatStatus']['Color']="#ff0000"; + } + else + { + $module[$i]['PlatStatus']['Value']="Y"; + $module[$i]['PlatStatus']['Color']="#0000ff"; + } + + + $refresh_time=$row['updateTime']; + $due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + $ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); + if($refresh_time < $due_date || $refresh_time > $ove_date) + { + $module[$i]['RefreshTime']['Value']="$refresh_time"; + $module[$i]['RefreshTime']['Color']="#ff0000"; + $valid_time=0; + } + else + { + $module[$i]['RefreshTime']['Value']="$refresh_time"; + $module[$i]['RefreshTime']['Color']="#0000ff"; + $valid_time=1; + } + + $baseStat=$row['baseStat']+0; + if($valid_time && $baseStat) + { + $module[$i]['AppStatus']['Value']="Y"; + $module[$i]['AppStatus']['Color']="#0000ff"; + } + else + { + $module[$i]['AppStatus']['Value']="N"; + $module[$i]['AppStatus']['Color']="#ff0000"; + } + } + + return $module; +} + +function GetSingleModuleInfo($sysTypeNo,$sysNo) +{ + $sql="select * from OMC_PUB.sysInfo where sysTypeNo={$sysTypeNo} and sysNo={$sysNo} "; + //echo "$sql
      "; + global $pubConn,$strStatusIsNormal,$strStatusIsAbnormal,$strStatusNone,$strStatusIsAlarm; + $res=mysqli_query($pubConn,$sql); + if ($res)$num=mysqli_num_rows($res); + if($num == 0) + return 0; + $row=mysqli_fetch_array($res); + //echo print_r($row); + $baseStat=$row['baseStat']+0; + + $sql="select * from OMC_PUB.sysStat where sysTypeNo={$sysTypeNo} and sysNo={$sysNo} "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num == 0) + return 0; + $row=mysqli_fetch_array($res); + $detailStat=$row['detailStat']; + + //Refresh Time + $refresh_time=$row['updateTime']; + $due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + $ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); + if($refresh_time < $due_date || $refresh_time > $ove_date) + { + $module['RefreshTime']['Value']="$refresh_time"; + $module['RefreshTime']['Color']="#ff0000"; + $module['RefreshTime']['Display']="block"; + $valid_time=0; + } + else + { + $module['RefreshTime']['Value']="$refresh_time"; + $module['RefreshTime']['Color']="#0000ff"; + $module['RefreshTime']['Display']="block"; + $valid_time=1; + } + + //Application Status + if($baseStat && $valid_time) + { + $module['AppStatus']['Value']="Y"; + $module['AppStatus']['Color']="#0000ff"; + $module['AppStatus']['Display']="block"; + } + else + { + $module['AppStatus']['Value']="N"; + $module['AppStatus']['Color']="#ff0000"; + $module['AppStatus']['Display']="block"; + } + + //Serial Number + $module['SerialNumber']['Value']=substr($detailStat,78,8); + $module['SerialNumber']['Color']="#000000"; + $module['SerialNumber']['Display']="block"; + + switch($sysTypeNo) + { + //EMS + case 0: + //IOTotalMasterLogFile + $IOTotalMasterLogFile=hexdec(substr($detailStat,92,8)); + $IOTotalMasterLogFile=omc_keep_length($IOTotalMasterLogFile,'0',$length=6,1); + $IOTotalMasterLogPos=hexdec(substr($detailStat,100,8)); + $IOCurrentMasterLogFile=hexdec(substr($detailStat,108,8)); + $IOCurrentMasterLogFile=omc_keep_length($IOCurrentMasterLogFile,'0',$length=6,1); + $IOCurrentMasterLogPos=hexdec(substr($detailStat,116,8)); + $SQLTotalRelayLogFile=hexdec(substr($detailStat,124,8)); + $SQLTotalRelayLogFile=omc_keep_length($SQLTotalRelayLogFile,'0',$length=6,1); + $SQLTotalRelayLogPos=hexdec(substr($detailStat,132,8)); + $SQLCurrentRelayLogFile=hexdec(substr($detailStat,140,8)); + $SQLCurrentRelayLogFile=omc_keep_length($SQLCurrentRelayLogFile,'0',$length=6,1); + $SQLCurrentRelayLogPos=hexdec(substr($detailStat,148,8)); + + $module['IOSyncInfo']['Value']="$IOCurrentMasterLogFile $IOCurrentMasterLogPos => $IOTotalMasterLogFile $IOTotalMasterLogPos"; + $module['IOSyncInfo']['Color']="#000000"; + $module['IOSyncInfo']['Display']="block"; + + $module['SQLSyncInfo']['Value']="$SQLCurrentRelayLogFile $SQLCurrentRelayLogPos => $SQLTotalRelayLogFile $SQLTotalRelayLogPos"; + $module['SQLSyncInfo']['Color']="#000000"; + $module['SQLSyncInfo']['Display']="block"; + + //Dual Server Status + $dual_server_status_label=array( + 0=>"Offline", + 1=>"Initial", + 2=>"Detect", + 3=>"Slave", + 4=>"Sync", + 5=>"Master", + 6=>"Degrade", + 7=>"Single" + ); + $val=hexdec(substr($detailStat,52,2)); + $module['DualServerStatus']['Value']=$dual_server_status_label[$val]; + $module['DualServerStatus']['Color']="#0000ff"; + $module['DualServerStatus']['Display']="block"; + + //Process Num + $process_name_label=array( + 0=>"mysqld", + 1=>"apache2", + 2=>"omcMain", + 3=>"iptrans", + 4=>"paraComm", + 5=>"subsComm", + 6=>"logCollector", + 7=>"omcCleaner", + 8=>"smcli", + 9=>"cdrCollector", + 10=>"subsDataBackup", + 11=>"ftpSend", + 12=>"alarmAgent", + 13=>"nrtrde", + 14=>"sftpSend", + 15=>"cstaCollector" + ); + + + $process_status_label=array( + 0=>"stopped", + 1=>"working", + 2=>"suspended" + ); + + $process_status_color=array( + 0=>"#ff0000", + 1=>"#0000ff", + 2=>"#ff0000" + ); + + $module['CurrentProcessNum']=hexdec(substr($detailStat,156,2)); + $module['TotalProcessNum']=sizeof($process_name_label); + for($i=0;$i<$module['TotalProcessNum'];$i++) + { + $module['Process'][$i]['Name']=$process_name_label[$i]; + $module['Process'][$i]['Value']=hexdec(substr($detailStat,158+$i*2,2)); + $module['Process'][$i]['Color']=$process_status_color[$module['Process'][$i]['Value']]; + $module['Process'][$i]['Value']=$process_status_label[$module['Process'][$i]['Value']]; + if($i<$module['CurrentProcessNum']) + { + $module['Process'][$i]['Display']="block"; + } + else + { + $module['Process'][$i]['Display']="none"; + } + } + + break; + //MSC + case 320: + //Dual Server Status + $dual_server_status_label=array( + 0=>"Normal", + 1=>"Restart", + 2=>"Initial", + 3=>"Suspended", + 4=>"Stop", + 5=>"Wait", + 6=>"Single" + ); + $dual_server_status_color=array( + 0=>"#0000ff", + 1=>"#ff8c00", + 2=>"#ff8c00", + 3=>"#ff8c00", + 4=>"#ff0000", + 5=>"#ff8c00", + 6=>"#0000ff" + ); + $module['DualServerStatus']['Value']=$dual_server_status_label[hexdec(substr($detailStat,52,2))]; + $module['DualServerStatus']['Color']=$dual_server_status_color[hexdec(substr($detailStat,52,2))]; + $module['DualServerStatus']['Display']="block"; + + //E1 License + $module['E1License']['Value']=hexdec(substr($detailStat,62,8)); + $module['E1License']['Color']="#0000ff"; + $module['E1License']['Display']="block"; + + //E1 Used + $module['E1Used']['Value']=hexdec(substr($detailStat,70,8)); + $module['E1Used']['Color']="#0000ff"; + $module['E1Used']['Display']="block"; + + //VLR Version + $version_string=substr($detailStat,94,6); + $version_string=(substr($version_string,0,2)+0).".".substr($version_string,2,2).".".substr($version_string,4,2); + $module['VLR']['Version']=$version_string; + + //VLR Refresh Time + $module['VLR']['RefreshTime']['Value']=$module['RefreshTime']['Value']; + $module['VLR']['RefreshTime']['Color']=$module['RefreshTime']['Color']; + $module['VLR']['RefreshTime']['Display']=$module['RefreshTime']['Display']; + + //VLR Status + $status_label=array( + 0=>"Initial", + 1=>"Server VLR", + 2=>"Sync", + 3=>"Single", + 4=>"Dual" + ); + $status_color=array( + 0=>"#0000ff", + 1=>"#0000ff", + 2=>"#0000ff", + 3=>"#0000ff", + 4=>"#0000ff" + ); + $module['VLR']['AppStatus']['Value']=$status_label[hexdec(substr($detailStat,100,2))]; + $module['VLR']['AppStatus']['Color']=$status_color[hexdec(substr($detailStat,100,2))]; + $module['VLR']['AppStatus']['Display']="block"; + + //VLR Subscriber Number + $module['VLR']['SubscriberNumber']['Value']=hexdec(substr($detailStat,118,8)); + $module['VLR']['SubscriberNumber']['Color']="#0000ff"; + $module['VLR']['SubscriberNumber']['Display']="block"; + + //License + $module['VLR']['License']['Value']=hexdec(substr($detailStat,110,8)); + $module['VLR']['License']['Color']="#0000ff"; + $module['VLR']['License']['Display']="block"; + + break; + //HLR + case 330: + //AUC + case 340: + //PPS + case 360: + case 395: + //EIR + case 380: + //MNP + case 370: + //License + $module['License']['Value']=hexdec(substr($detailStat,62,8)); + $module['License']['Color']="#0000ff"; + $module['License']['Display']="block"; + + //User + $module['User']['Value']=hexdec(substr($detailStat,70,8)); + $module['User']['Color']="#0000ff"; + $module['User']['Display']="block"; + break; + //SMEG + case 355: + //License + $module['License']['Value']=hexdec(substr($detailStat,62,8)); + $module['License']['Color']="#0000ff"; + $module['License']['Display']="block"; + + //User + $module['User']['Value']=hexdec(substr($detailStat,70,8)); + $module['User']['Color']="#0000ff"; + $module['User']['Display']="block"; + + //SMPP TX Status + $value=hexdec(substr($detailStat,86,2)); + if($value == 0) + { + $module['SMPPTXStatus']['Value']="Y"; + $module['SMPPTXStatus']['Color']="#0000ff"; + } + else + { + $module['SMPPTXStatus']['Value']="N"; + $module['SMPPTXStatus']['Color']="#ff0000"; + } + $module['SMPPTXStatus']['Display']="block"; + + //SMPP RX Status + $value=hexdec(substr($detailStat,88,2)); + if($value == 0) + { + $module['SMPPRXStatus']['Value']="Y"; + $module['SMPPRXStatus']['Color']="#0000ff"; + } + else + { + $module['SMPPRXStatus']['Value']="N"; + $module['SMPPRXStatus']['Color']="#ff0000"; + } + $module['SMPPRXStatus']['Display']="block"; + + //SMTP TX Status + $value=hexdec(substr($detailStat,90,2)); + if($value == 0) + { + $module['SMTPTXStatus']['Value']="Y"; + $module['SMTPTXStatus']['Color']="#0000ff"; + } + else + { + $module['SMTPTXStatus']['Value']="N"; + $module['SMTPTXStatus']['Color']="#ff0000"; + } + $module['SMTPTXStatus']['Display']="block"; + + //SMTP RX Status + $value=hexdec(substr($detailStat,92,2)); + if($value == 0) + { + $module['SMTPRXStatus']['Value']="Y"; + $module['SMTPRXStatus']['Color']="#0000ff"; + } + else + { + $module['SMTPRXStatus']['Value']="N"; + $module['SMTPRXStatus']['Color']="#ff0000"; + } + $module['SMTPRXStatus']['Display']="block"; + + break; + //MME + case 361: + //SystemID + $module['SystemID']['Value']=substr($detailStat,0,2)+0; + $module['SystemID']['Color']="#0000ff"; + $module['SystemID']['Display']="block"; + + //SubsystemID + $module['SubsystemID']['Value']=substr($detailStat,2,2)+0; + $module['SubsystemID']['Color']="#0000ff"; + $module['SubsystemID']['Display']="block"; + + //TimeStamp + $module['TimeStamp']['Value']=$module['RefreshTime']['Value']; + $module['TimeStamp']['Color']=$module['RefreshTime']['Color']; + $module['TimeStamp']['Display']=$module['RefreshTime']['Display']; + + //Software Version + $software_string=substr($detailStat,46,6); + $software_string=hexdec(substr($software_string,0,2)).".".hexdec(substr($software_string,2,2)).".".hexdec(substr($software_string,4,2)); + $module['SoftwareVersion']['Value']=$software_string; + $module['SoftwareVersion']['Color']="#0000ff"; + $module['SoftwareVersion']['Display']="block"; + + //Status 0->unconnected;1->connected + $Status=substr($detailStat,52,2)+0; + if($Status == 0) + { + $module['Status']['Value']="N"; + $module['Status']['Color']="#ff0000"; + } + else + { + $module['Status']['Value']="Y"; + $module['Status']['Color']="#0000ff"; + } + $module['Status']['Display']="block"; + + // Checksum + $module['Checksum']['Value']=hexdec(substr($detailStat,54,8)); + $module['Checksum']['Color']="#0000ff"; + $module['Checksum']['Display']="block"; + + //LicenseUser 12345 + $module['LicenseUser']['Value']=hexdec(substr($detailStat,62,8)); + $module['LicenseUser']['Color']="#0000ff"; + $module['LicenseUser']['Display']="block"; + + //RegisterUES 12345 + $module['RegisterUES']['Value']=hexdec(substr($detailStat,70,8)); + $module['RegisterUES']['Color']="#0000ff"; + $module['RegisterUES']['Display']="block"; + + //ConnectedUES 12345 + $module['ConnectedUES']['Value']=hexdec(substr($detailStat,78,8)); + $module['ConnectedUES']['Color']="#0000ff"; + $module['ConnectedUES']['Display']="block"; + + //OnlineENBNum 12345 + $module['OnlineENBNum']['Value']=hexdec(substr($detailStat,86,8)); + $module['OnlineENBNum']['Color']="#0000ff"; + $module['OnlineENBNum']['Display']="block"; + + //SequenceNum 12345 + $module['SequenceNum']['Value']= substr($detailStat,94,8);// hexdec(substr($detailStat,94,8)); + $module['SequenceNum']['Color']="#0000ff"; + $module['SequenceNum']['Display']="block"; + + //License date + $LicenseDate=substr($detailStat,102,6); + $LicenseDate=(hexdec(substr($LicenseDate,0,2))+2000).".".hexdec(substr($LicenseDate,2,2)).".".hexdec(substr($LicenseDate,4,2)); + $module['LicenseDate']['Value']=$LicenseDate; + $module['LicenseDate']['Color']="#0000ff"; + $module['LicenseDate']['Display']="block"; + break; + //SGPW + case 362: + //SystemID + $module['SystemID']['Value']=substr($detailStat,0,2)+0; + $module['SystemID']['Color']="#0000ff"; + $module['SystemID']['Display']="block"; + + //SubsystemID + $module[SubsystemID][Value]=substr($detailStat,2,2)+0; + $module[SubsystemID][Color]="#0000ff"; + $module[SubsystemID][Display]="block"; + + //TimeStamp + $module[TimeStamp][Value]=$module[RefreshTime][Value]; + $module[TimeStamp][Color]=$module[RefreshTime][Color]; + $module[TimeStamp][Display]=$module[RefreshTime][Display]; + + //Version + $version_string=substr($detailStat,36,6); + $version_string=hexdec(substr($version_string,0,2)).".".hexdec(substr($version_string,2,2)).".".hexdec(substr($version_string,4,2)); + $module[Version][Value]=$version_string; + $module[Version][Color]="#0000ff"; + $module[Version][Display]="block"; + + //S11ConnStatus 0->unconnected;1->connected + $Status=substr($detailStat,42,2)+0; + if($Status == 0) + { + $module[S11ConnStatus][Value]="N"; + $module[S11ConnStatus][Color]="#ff0000"; + } + else + { + $module[S11ConnStatus][Value]="Y"; + $module[S11ConnStatus][Color]="#0000ff"; + } + $module[S11ConnStatus][Display]="block"; + + //s1UConnStatus 0->unconnected;1->connected + $Status=substr($detailStat,44,2)+0; + if($Status == 0) + { + $module[s1UConnStatus][Value]="N"; + $module[s1UConnStatus][Color]="#ff0000"; + } + else + { + $module[s1UConnStatus][Value]="Y"; + $module[s1UConnStatus][Color]="#0000ff"; + } + $module[s1UConnStatus][Display]="block"; + + //SGIConnStatus 0->unconnected;1->connected + $Status=substr($detailStat,46,2)+0; + if($Status == 0) + { + $module[SGIConnStatus][Value]="N"; + $module[SGIConnStatus][Color]="#ff0000"; + } + else + { + $module[SGIConnStatus][Value]="Y"; + $module[SGIConnStatus][Color]="#0000ff"; + } + $module[SGIConnStatus][Display]="block"; + + //GxConnStatus 0->unconnected;1->connected + $Status=substr($detailStat,48,2)+0; + if($Status == 0) + { + $module[GxConnStatus][Value]="N"; + $module[GxConnStatus][Color]="#ff0000"; + } + else + { + $module[GxConnStatus][Value]="Y"; + $module[GxConnStatus][Color]="#0000ff"; + } + $module[GxConnStatus][Display]="block"; + + //GyConnStatus 0->unconnected;1->connected + $Status=substr($detailStat,50,2)+0; + if($Status == 0) + { + $module[GyConnStatus][Value]="N"; + $module[GyConnStatus][Color]="#ff0000"; + } + else + { + $module[GyConnStatus][Value]="Y"; + $module[GyConnStatus][Color]="#0000ff"; + } + $module[GyConnStatus][Display]="block"; + + //SystemCapability 12345 + $module[SystemCapability][Value]=hexdec(substr($detailStat,52,8)); + $module[SystemCapability][Color]="#0000ff"; + $module[SystemCapability][Display]="block"; + + //LicenseUser 12345 + $module[LicenseUser][Value]=hexdec(substr($detailStat,60,8)); + $module[LicenseUser][Color]="#0000ff"; + $module[LicenseUser][Display]="block"; + + //SequenceNum 12345 + $module[SequenceNum][Value]= substr($detailStat,68, 8);// hexdec(substr($detailStat,94,8)); + $module[SequenceNum][Color]="#0000ff"; + $module[SequenceNum][Display]="block"; + + //License date + $LicenseDate=substr($detailStat,76,6); + $LicenseDate=(hexdec(substr($LicenseDate,0,2))+2000).".".hexdec(substr($LicenseDate,2,2)).".".hexdec(substr($LicenseDate,4,2)); + $module[LicenseDate][Value]=$LicenseDate; + $module[LicenseDate][Color]="#0000ff"; + $module[LicenseDate][Display]="block"; + break; + //IMS + case 363: + //SystemID + $module[SystemID][Value]=substr($detailStat,0,2)+0; + $module[SystemID][Color]="#0000ff"; + $module[SystemID][Display]="block"; + + //SubsystemID + $module[SubsystemID][Value]=substr($detailStat,2,2)+0; + $module[SubsystemID][Color]="#0000ff"; + $module[SubsystemID][Display]="block"; + + //TimeStamp + $module[TimeStamp][Value]=$module[RefreshTime][Value]; + $module[TimeStamp][Color]=$module[RefreshTime][Color]; + $module[TimeStamp][Display]=$module[RefreshTime][Display]; + + //Version + $version_string=substr($detailStat,46,6); + $version_string=hexdec(substr($version_string,0,2)).".".hexdec(substr($version_string,2,2)).".".hexdec(substr($version_string,4,2)); + $module[Version][Value]=$version_string; + $module[Version][Color]="#0000ff"; + $module[Version][Display]="block"; + + //status + $Status=substr($detailStat,52,2)+0; + if($Status == 0) + { + $module[Status][Value]="N"; + $module[Status][Color]="#ff0000"; + } + else + { + $module[Status][Value]="Y"; + $module[Status][Color]="#0000ff"; + } + $module[Status][Display]="block"; + + //checksum + $module[Checksum][Value]=hexdec(substr($detailStat,54,8)); + $module[Checksum][Color]="#0000ff"; + $module[Checksum][Display]="block"; + + //license user + $module[LicenseUser][Value]=hexdec(substr($detailStat,62,8)); + $module[LicenseUser][Color]="#0000ff"; + $module[LicenseUser][Display]="block"; + + //volte pcscf status + $VoltePCSCFStatus=substr($detailStat,70,2)+0; + if($VoltePCSCFStatus == 0) + { + $module[VoltePCSCFStatus][Value]="N"; + $module[VoltePCSCFStatus][Color]="#ff0000"; + } + else + { + $module[VoltePCSCFStatus][Value]="Y"; + $module[VoltePCSCFStatus][Color]="#0000ff"; + } + $module[VoltePCSCFStatus][Display]="block"; + + //voip pcscf status + $VoipPCSCFStatus=substr($detailStat,72,2)+0; + if($VoipPCSCFStatus == 0) + { + $module[VoipPCSCFStatus][Value]="N"; + $module[VoipPCSCFStatus][Color]="#ff0000"; + } + else + { + $module[VoipPCSCFStatus][Value]="Y"; + $module[VoipPCSCFStatus][Color]="#0000ff"; + } + $module[VoipPCSCFStatus][Display]="block"; + + //icscf status + $IcscfStatus=substr($detailStat,74,2)+0; + if($IcscfStatus == 0) + { + $module[IcscfStatus][Value]="N"; + $module[IcscfStatus][Color]="#ff0000"; + } + else + { + $module[IcscfStatus][Value]="Y"; + $module[IcscfStatus][Color]="#0000ff"; + } + $module[IcscfStatus][Display]="block"; + + //scscf status + $ScscfStatus=substr($detailStat,76,2)+0; + if($ScscfStatus == 0) + { + $module[ScscfStatus][Value]="N"; + $module[ScscfStatus][Color]="#ff0000"; + } + else + { + $module[ScscfStatus][Value]="Y"; + $module[ScscfStatus][Color]="#0000ff"; + } + $module[ScscfStatus][Display]="block"; + + //mmtel status + $MMETelStatus=substr($detailStat,78,2)+0; + if($MMETelStatus == 0) + { + $module[MMETelStatus][Value]="N"; + $module[MMETelStatus][Color]="#ff0000"; + } + else + { + $module[MMETelStatus][Value]="Y"; + $module[MMETelStatus][Color]="#0000ff"; + } + $module[MMETelStatus][Display]="block"; + + //SequenceNum 12345 + $module[SequenceNum][Value]= substr($detailStat,94, 8);// hexdec(substr($detailStat,94,8)); + $module[SequenceNum][Color]="#0000ff"; + $module[SequenceNum][Display]="block"; + + //License date + // $LicenseDate=substr($detailStat,76,6); + // $LicenseDate=(hexdec(substr($LicenseDate,0,2))+2000).".".hexdec(substr($LicenseDate,2,2)).".".hexdec(substr($LicenseDate,4,2)); + // $module[LicenseDate][Value]=$LicenseDate; + // $module[LicenseDate][Color]="#0000ff"; + // $module[LicenseDate][Display]="block"; + break; + //IMS + case 364: + //SystemID + $module[SystemID][Value]=substr($detailStat,0,2)+0; + $module[SystemID][Color]="#0000ff"; + $module[SystemID][Display]="block"; + + //SubsystemID + $module[SubsystemID][Value]=substr($detailStat,2,2)+0; + $module[SubsystemID][Color]="#0000ff"; + $module[SubsystemID][Display]="block"; + + //TimeStamp + $module[TimeStamp][Value]=$module[RefreshTime][Value]; + $module[TimeStamp][Color]=$module[RefreshTime][Color]; + $module[TimeStamp][Display]=$module[RefreshTime][Display]; + + //Version + $version_string=substr($detailStat,46,6); + $version_string=hexdec(substr($version_string,0,2)).".".hexdec(substr($version_string,2,2)).".".hexdec(substr($version_string,4,2)); + $module[Version][Value]=$version_string; + $module[Version][Color]="#0000ff"; + $module[Version][Display]="block"; + + //status + $Status=substr($detailStat,52,2)+0; + if($Status == 0) + { + $module[Status][Value]="N"; + $module[Status][Color]="#ff0000"; + } + else + { + $module[Status][Value]="Y"; + $module[Status][Color]="#0000ff"; + } + $module[Status][Display]="block"; + + //checksum + $module[Checksum][Value]=hexdec(substr($detailStat,54,8)); + $module[Checksum][Color]="#0000ff"; + $module[Checksum][Display]="block"; + + //license user + $module[LicenseUser][Value]=hexdec(substr($detailStat,62,8)); + $module[LicenseUser][Color]="#0000ff"; + $module[LicenseUser][Display]="block"; + + //registeredUES + $module[registeredUES][Value]=hexdec(substr($detailStat,70,8)); + $module[registeredUES][Color]="#0000ff"; + $module[registeredUES][Display]="block"; + + //onlineHNBNum + $module[onlineHNBNum][Value]=hexdec(substr($detailStat,78,8)); + $module[onlineHNBNum][Color]="#0000ff"; + $module[onlineHNBNum][Display]="block"; + + //SequenceNum 12345 + $module[SequenceNum][Value]= substr($detailStat,94, 8);// hexdec(substr($detailStat,94,8)); + $module[SequenceNum][Color]="#0000ff"; + $module[SequenceNum][Display]="block"; + + //expireDate + $expireDate=substr($detailStat,102,6); + $expireDate=(hexdec(substr($expireDate,0,2))+2000).".".hexdec(substr($expireDate,2,2)).".".hexdec(substr($expireDate,4,2)); + $module[expireDate][Value]=$expireDate; + $module[expireDate][Color]="#0000ff"; + $module[expireDate][Display]="block"; + break; + //UDM + case 365: + //SystemID + $module[SystemID][Value]=substr($detailStat,0,2)+0; + $module[SystemID][Color]="#0000ff"; + $module[SystemID][Display]="block"; + + //SubsystemID + $module[SubsystemID][Value]=substr($detailStat,2,2)+0; + $module[SubsystemID][Color]="#0000ff"; + $module[SubsystemID][Display]="block"; + + //TimeStamp + $module[TimeStamp][Value]=$module[RefreshTime][Value]; + $module[TimeStamp][Color]=$module[RefreshTime][Color]; + $module[TimeStamp][Display]=$module[RefreshTime][Display]; + + //Version + $version_string=substr($detailStat,46,6); + $version_string=hexdec(substr($version_string,0,2)).".".hexdec(substr($version_string,2,2)).".".hexdec(substr($version_string,4,2)); + $module[Version][Value]=$version_string; + $module[Version][Color]="#0000ff"; + $module[Version][Display]="block"; + + //status + $Status=substr($detailStat,52,2)+0; + if($Status == 0) + { + $module[Status][Value]="N"; + $module[Status][Color]="#ff0000"; + } + else + { + $module[Status][Value]="Y"; + $module[Status][Color]="#0000ff"; + } + $module[Status][Display]="block"; + + //checksum + $module[Checksum][Value]=hexdec(substr($detailStat,54,8)); + $module[Checksum][Color]="#0000ff"; + $module[Checksum][Display]="block"; + + //license user + $module[LicenseUser][Value]=hexdec(substr($detailStat,62,8)); + $module[LicenseUser][Color]="#0000ff"; + $module[LicenseUser][Display]="block"; + + //SequenceNum 12345 + $module[SequenceNum][Value]= substr($detailStat,94, 8); + $module[SequenceNum][Color]="#0000ff"; + $module[SequenceNum][Display]="block"; + break; + //AUSF + case 366: + //SystemID + $module[SystemID][Value]=substr($detailStat,0,2)+0; + $module[SystemID][Color]="#0000ff"; + $module[SystemID][Display]="block"; + + //SubsystemID + $module[SubsystemID][Value]=substr($detailStat,2,2)+0; + $module[SubsystemID][Color]="#0000ff"; + $module[SubsystemID][Display]="block"; + + //TimeStamp + $module[TimeStamp][Value]=$module[RefreshTime][Value]; + $module[TimeStamp][Color]=$module[RefreshTime][Color]; + $module[TimeStamp][Display]=$module[RefreshTime][Display]; + + //Version + $version_string=substr($detailStat,46,6); + $version_string=hexdec(substr($version_string,0,2)).".".hexdec(substr($version_string,2,2)).".".hexdec(substr($version_string,4,2)); + $module[Version][Value]=$version_string; + $module[Version][Color]="#0000ff"; + $module[Version][Display]="block"; + + //status + $Status=substr($detailStat,52,2)+0; + if($Status == 0) + { + $module[Status][Value]="N"; + $module[Status][Color]="#ff0000"; + } + else + { + $module[Status][Value]="Y"; + $module[Status][Color]="#0000ff"; + } + $module[Status][Display]="block"; + + //checksum + $module[Checksum][Value]=hexdec(substr($detailStat,54,8)); + $module[Checksum][Color]="#0000ff"; + $module[Checksum][Display]="block"; + + //license user + $module[LicenseUser][Value]=hexdec(substr($detailStat,62,8)); + $module[LicenseUser][Color]="#0000ff"; + $module[LicenseUser][Display]="block"; + + //SequenceNum 12345 + $module[SequenceNum][Value]= substr($detailStat,94, 8); + $module[SequenceNum][Color]="#0000ff"; + $module[SequenceNum][Display]="block"; + break; + //OPPS + case 375: + //License + $module[License][Value]=hexdec(substr($detailStat,62,8)); + $module[License][Color]="#0000ff"; + $module[License][Display]="block"; + + //User + $module[User][Value]=hexdec(substr($detailStat,70,8)); + $module[User][Color]="#0000ff"; + $module[User][Display]="block"; + + //OPR Status + $value=hexdec(substr($detailStat,86,1)); + if($value == 0) + { + $module[OPRStatus][Value]="Disabled"; + $module[OPRStatus][Color]="#000000"; + } + else + { + $module[OPRStatus][Value]="Normal"; + $module[OPRStatus][Color]="#0000ff"; + } + $module[OPRStatus][Display]="block"; + + //IMDX Status + $value=hexdec(substr($detailStat,87,1)); + if($value == 0) + { + $module[IMDXStatus][Value]="Disabled"; + $module[IMDXStatus][Color]="#000000"; + } + else + { + $module[IMDXStatus][Value]="Normal"; + $module[IMDXStatus][Color]="#0000ff"; + } + $module[IMDXStatus][Display]="block"; + + //Serial Number + $module[SerialNumber][Value]=substr($detailStat,78,8); + $module[SerialNumber][Color]="#000000"; + $module[SerialNumber][Display]="block"; + + break; + //MHC + case 386: + //Serial Number + $module[SerialNumber][Value]=substr($detailStat,86,8); + $module[SerialNumber][Color]="#000000"; + $module[SerialNumber][Display]="block"; + break; + //VSS + case 390: + //Total Mailbox + $module[TotalMailbox][Value]=hexdec(substr($detailStat,62,8)); + $module[TotalMailbox][Color]="#0000ff"; + $module[TotalMailbox][Display]="block"; + + //Registered Mailbox + $module[RegisteredMailbox][Value]=hexdec(substr($detailStat,70,8)); + $module[RegisteredMailbox][Color]="#0000ff"; + $module[RegisteredMailbox][Display]="block"; + + //Active Mailbox + $module[ActiveMailbox][Value]=hexdec(substr($detailStat,86,8)); + $module[ActiveMailbox][Color]="#0000ff"; + $module[ActiveMailbox][Display]="block"; + + //Total Voicemail + $module[TotalVoicemail][Value]=hexdec(substr($detailStat,94,8)); + $module[TotalVoicemail][Color]="#0000ff"; + $module[TotalVoicemail][Display]="block"; + + //Total seconds of Voicemail + $module[TotalSecondVoicemail][Value]=hexdec(substr($detailStat,102,8)); + $module[TotalSecondVoicemail][Color]="#0000ff"; + $module[TotalSecondVoicemail][Display]="block"; + + //Average seconds of Voicemail + $module[AverageSecondVoicemail][Value]=hexdec(substr($detailStat,110,8)); + $module[AverageSecondVoicemail][Color]="#0000ff"; + $module[AverageSecondVoicemail][Display]="block"; + + //SMPP State + $value=hexdec(substr($detailStat,118,2)); + if($value > 0) + { + $module[SMPPState][Value]="Established"; + $module[SMPPState][Color]="#0000ff"; + } + else + { + $module[SMPPState][Value]="Not established"; + $module[SMPPState][Color]="#000000"; + } + $module[AverageSecondVoicemail][Display]="block"; + + break; + //TMG + case 391: + //AMRMG + case 392: + //GbC + case 393: + //MaxE1Number + $module[MaxE1Number][Value]=hexdec(substr($detailStat,62,8)); + $module[MaxE1Number][Color]="#0000ff"; + $module[MaxE1Number][Display]="block"; + + //MaxE1Number + $module[OnlineUser][Value]=hexdec(substr($detailStat,70,8)); + $module[OnlineUser][Color]="#0000ff"; + $module[OnlineUser][Display]="block"; + + //Serial Number + $module[SerialNumber][Value]=substr($detailStat,78,8); + $module[SerialNumber][Color]="#000000"; + $module[SerialNumber][Display]="block"; + + break; + //MCA + case 394: + //Serial Number + $module[SerialNumber][Value]=substr($detailStat,78,8); + $module[SerialNumber][Color]="#000000"; + $module[SerialNumber][Display]="block"; + break; + //SMSC + case 350: + //License + $module[License][Value]=hexdec(substr($detailStat,62,8)); + $module[License][Color]="#0000ff"; + $module[License][Display]="block"; + + //User + $module[User][Value]=hexdec(substr($detailStat,70,8)); + $module[User][Color]="#0000ff"; + $module[User][Display]="block"; + + //SMPP Link + $smpp_link_status_color=array(0=>"#aeaeae",1=>"#000000",2=>"#00ff00",3=>"#0000ff",4=>"#ff00ff"); + $smpp_link_status_label=array(0=>"Not Init",1=>"Idle",2=>"Waiting",3=>"Established",4=>"Suspend"); + $smpp_link_status_pos=47; + $smpp_link_status_len=32; + $smpp_link_status_hex=substr($detailStat,$smpp_link_status_pos*2,$smpp_link_status_len*2); + //smpp link alias + $smpp_link_alias_oid="2.2.1.1.2"; + //oidwhere + $levelArr=explode('.',$smpp_link_alias_oid); + for($j=0;$j"; + while($row=@mysqli_fetch_array($res)) + { + $instanceNo=$row[instanceNo]+0; + $module[SMPPLink][$instanceNo][Name][Value]="[{$row[initValue]}]"; + //echo "$instanceNo-{$row[initValue]}
      "; + } + + for($row=0;$row<4;$row++) + { + for($col=0;$col<8;$col++) + { + $no=$row*8+$col; + $status=substr($smpp_link_status_hex,$no*2,2); + $istatus=hexdec($status)+0; + if($istatus>=0&&$istatus<5) + { + $module[SMPPLink][$no][Status][Value]=$smpp_link_status_label[$istatus]; + $module[SMPPLink][$no][Status][Color]=$smpp_link_status_color[$istatus]; + } + else + { + $module[SMPPLink][$no][Status][Value]="--"; + $module[SMPPLink][$no][Status][Color]="#000000"; + } + } + } + break; + //IWF + case 384: + //License + $module[License][Value]=hexdec(changeByteOrder(substr($detailStat,62,8))); + $module[License][Color]="#0000ff"; + $module[License][Display]="block"; + + //User + $module[User][Value]=hexdec(changeByteOrder(substr($detailStat,70,8))); + $module[User][Color]="#0000ff"; + $module[User][Display]="block"; + + break; + //VIM + case 389: + //Used Count + $module[UsedCount][Value]=hexdec(substr($detailStat,86,4)); + $module[UsedCount][Color]="#0000ff"; + $module[UsedCount][Display]="block"; + break; + default: + break; + } + + return $module; +} + + +function GetPlatInfo($conf,$sysNo) +{ + global $pubConn; + $sql="select detailStat from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$conf[PlatNo]} and subSysNo=$sysNo "; + //echo "$sql
      "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num != 1) + { + return 0; + } + + $row=@mysqli_fetch_array($res); + $baseStat=$row[detailStat]; + $compStat=substr($baseStat,38); + $compStatLen=strlen($compStat)-1; + //echo "$compStat
      "; + $index=0; + $i=0; + while($i<$compStatLen) + { + $tmp=substr($compStat,$i,4); + $component[$index][ID]=$tmp+0; + $i+=4; + $tmp=substr($compStat,$i,4); + $component[$index][Length]=hexdec($tmp); + $i+=4; + $component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2); + $i+=$component[$index][Length]*2; + $index++; + } + + //echo "
      ";
      +	//print_r($component);
      +	//echo "
      "; + if($component[8][Length] > 0) + { + $snmp_hb=$component[8][Content]; + //echo "{$component[8][Length]}
      $snmp_hb
      "; + + //Start Time + $pos=0; + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + + $plat[StartTime][Value]=date("Y-m-d H:i:s",$tmpValue); + $plat[StartTime][Color]="#0000ff"; + $plat[StartTime][Display]="block"; + $pos+=8; + + //CPU Use Rate + $tmpValue=100-hexdec(substr($snmp_hb,$pos,2)); + $plat[CPURate][Value]="{$tmpValue}%"; + $plat[CPURate][Color]="#000000"; + $plat[CPURate][Display]="block"; + + + + //CPU Use Rate Process Num + $plat[CPURatePN][Value]=floor($tmpValue/10); + $plat[CPURatePN][Color]="#0000ff"; + $plat[CPURatePN][Display]="Rect"; + $pos+=2; + + //Physical Memory Used/Total + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue1=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue2=floor(($tmpValue/$tmpValue1)*100); + + $plat[PMTotalRate][Value]="{$tmpValue2}%"; + $plat[PMTotalRate][Color]="#000000"; + $plat[PMTotalRate][Display]="block"; + + $plat[PMTotalRateV][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M"; + $plat[PMTotalRateV][Color]="#000000"; + $plat[PMTotalRateV][Display]="block"; + + $plat[PMTotalRatePN][Value]=floor($tmpValue2/10); + $plat[PMTotalRatePN][Color]="#0000ff"; + $plat[PMTotalRatePN][Display]="Rect"; + + //Physical Memory Used/Swap + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue1=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue2=floor(($tmpValue/$tmpValue1)*100); + + $plat[PMSwapRate][Value]="{$tmpValue2}%"; + $plat[PMSwapRate][Color]="#000000"; + $plat[PMSwapRate][Display]="block"; + + $plat[PMSwapRateV][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M"; + $plat[PMSwapRateV][Color]="#000000"; + $plat[PMSwapRateV][Display]="block"; + + $plat[PMSwapRatePN][Value]=floor($tmpValue2/10); + $plat[PMSwapRatePN][Color]="#0000ff"; + $plat[PMSwapRatePN][Display]="Rect"; + + //Physical Memory Buffers + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $plat[PMBuffers][Value]=(floor($tmpValue/1024))."M"; + $plat[PMBuffers][Color]="#000000"; + $plat[PMBuffers][Display]="block"; + + //Physical Memory Cached + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $plat[PMCached][Value]=(floor($tmpValue/1024))."M"; + $plat[PMCached][Color]="#000000"; + $plat[PMCached][Display]="block"; + + //Harddisk + $tmpValue=hexdec(substr($snmp_hb,$pos,2)); + $pos+=2; + $plat[HDNum]=$tmpValue; + for($i=0;$i<$plat[HDNum];$i++) + { + $tmpValue=hexdec(substr($snmp_hb,$pos,2)); + $pos+=2; + $path_len=$tmpValue; + $path=""; + for($j=0;$j<$path_len;$j++) + { + $path.=chr(hexdec(substr($snmp_hb,$pos,2))); + $pos+=2; + } + $plat[HD][$i][Path][Value]="($path)"; + $plat[HD][$i][Path][Color]="#000000"; + $plat[HD][$i][Path][Display]="block"; + + $tmpValue=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + $tmpValue1=hexdec(substr($snmp_hb,$pos,8)); + $pos+=8; + + $tmpValue2=floor(($tmpValue/$tmpValue1)*100); + $plat[HD][$i][PN][Value]=floor($tmpValue2/10); + $plat[HD][$i][PN][Color]="#0000ff"; + $plat[HD][$i][PN][Display]="Rect"; + + $plat[HD][$i][V][Value]=(floor($tmpValue/1024))."M/".(floor($tmpValue1/1024))."M"; + $plat[HD][$i][V][Color]="#000000"; + $plat[HD][$i][V][Display]="block"; + + $plat[HD][$i][Rate][Value]="{$tmpValue2}%"; + $plat[HD][$i][Rate][Color]="#000000"; + $plat[HD][$i][Rate][Display]="block"; + } + } + + + return $plat; +} + +function GetProcessLabel($pn) +{ + $sign="锟斤拷"; + $label=""; + for($i=0;$i<$pn;$i++) + $label.=$sign; + return $label; +} + +function GetLevel($objIdStr) +{ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + + + +function GetDetailPlatInfo($sysNo,$subSysNo,$component_show_id) +{ + $sql="select * from OMC_PUB.sysInfo where sysTypeNo=200 and sysNo={$sysNo} and subSysNo={$subSysNo} "; + //echo "$sql
      "; + + $res=mysqli_query($pubConn,$sql); + + //$res=mysql_query($sql,$link); + + $num=mysqli_num_rows($res); + + if($num != 1) + { + return 0; + } + + $row=@mysqli_fetch_array($res); + $refresh_time=$row[updateTime]; + $due_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-60,date("m"),date("d"),date("Y"))); + $ove_date=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")+60,date("m"),date("d"),date("Y"))); + + + + if($refresh_time < $due_date || $refresh_time > $ove_date) + { + $detailPlatInfo[RefreshTime][Value]="$refresh_time"; + $detailPlatInfo[RefreshTime][Color]="#ff0000"; + $valid_time=0; + } + else + { + $detailPlatInfo[RefreshTime][Value]="$refresh_time"; + $detailPlatInfo[RefreshTime][Color]="#0000ff"; + $valid_time=1; + } + + $detailPlatInfo[IPAddress][Value]=$row[ip]; + $detailPlatInfo[IPAddress][Color]="#000000"; + + +//锟斤拷锟斤拷 + +$status=$row[baseStat]; +if($valid_time && $status) +{ + $detailPlatInfo[Application][Status][Value]="Y"; + $detailPlatInfo[Application][Status][Color]="#0000FF"; +} +else +{ + $detailPlatInfo[Application][Status][Value]="N"; + $detailPlatInfo[Application][Status][Color]="#000000"; +} + +//锟斤拷锟斤拷 + + + + + + $sql="select * from OMC_PUB.sysStat where sysTypeNo=200 and sysNo={$sysNo} and subSysNo={$subSysNo} "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + + + if($num < 1) + { + return 0; + } + $row=@mysqli_fetch_array($res); + $baseStat=$row[detailStat]; + $compStat=substr($baseStat,38); + $compStatLen=strlen($compStat)-1; + //echo "$compStat
      "; + $index=0; + $i=0; + + + + //锟斤拷锟斤拷 + $version_string=substr($row[detailStat],46,6); + if(strlen($version_string) < 6) + { + $detailPlatInfo[version][Status][Value]="--"; + } + else + { + $detailPlatInfo[version][Status][Value]=(substr($version_string,0,2)+0).".".substr($version_string,2,2).".".substr($version_string,4,2); + $detailPlatInfo[version][Status][Color]="#0000FF"; + } + + //锟斤拷锟斤拷 + + + + + + while($i<$compStatLen) + { + $tmp=substr($compStat,$i,4); + $component[$index][ID]=$tmp+0; + $i+=4; + $tmp=substr($compStat,$i,4); + $component[$index][Length]=hexdec($tmp); + $i+=4; + $component[$index][Content]=substr($compStat,$i,$component[$index][Length]*2); + $i+=$component[$index][Length]*2; + $index++; + } + if(0) + { + echo "
      ";
      +		print_r($component);
      +		echo "
      "; + } + + //IPTRANS + $component_id=0; + if($component[$component_id][Length] > 0) + { + $value=substr($component[$component_id][Content],0,6); + $newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2); + $detailPlatInfo[IPTRANS][Version][Value]=$newValue; + $detailPlatInfo[IPTRANS][Version][Color]="#000000"; + + $value=hexdec(substr($component[$component_id][Content],6,2)); + if($value == 1) + { + $detailPlatInfo[IPTRANS][Status][Value]="Y"; + $detailPlatInfo[IPTRANS][Status][Color]="#0000FF"; + } + else + { + $detailPlatInfo[IPTRANS][Status][Value]="N"; + $detailPlatInfo[IPTRANS][Status][Color]="#FF0000"; + } + $detail_flag=0; + if($component_show_id == $component_id) + { + $value=substr($component[$component_id][Content],8,8); + $value=hexdec($value); + $value=decbin($value); + $value=omc_keep_length($value,"0",32); + $test=""; + for($i=0;$i<32;$i++) + { + if($value[$i] == "1") + { + $detailPlatInfo[IPTRANS][Port][$i][Status][Value]="Y"; + $detailPlatInfo[IPTRANS][Port][$i][Status][Color]="#0000FF"; + } + else + { + $detailPlatInfo[IPTRANS][Port][$i][Status][Value]="--"; + $detailPlatInfo[IPTRANS][Port][$i][Status][Color]="#000000"; + } + } + } + } + else + { + $detailPlatInfo[IPTRANS][Status][Value]="--"; + $detailPlatInfo[IPTRANS][Status][Color]="#000000"; + } + + //MTP3 + $component_id=1; + if($component[$component_id][Length] > 0) + { + $value=substr($component[$component_id][Content],0,6); + $newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2); + $detailPlatInfo[MTP3][Version][Value]=$newValue; + $detailPlatInfo[MTP3][Version][Color]="#000000"; + + $value=hexdec(substr($component[$component_id][Content],6,2)); + if($value == 1) + { + $detailPlatInfo[MTP3][Status][Value]="Y"; + $detailPlatInfo[MTP3][Status][Color]="#0000FF"; + } + else + { + $detailPlatInfo[MTP3][Status][Value]="N"; + $detailPlatInfo[MTP3][Status][Color]="#FF0000"; + } + } + else + { + $detailPlatInfo[MTP3][Status][Value]="--"; + $detailPlatInfo[MTP3][Status][Color]="#000000"; + } + + //SCCP + $component_id=2; + if($component[$component_id][Length] > 0) + { + + $detailPlatInfo[SCCP][Status][sum]=$component[$component_id][Length]-4; + $value=substr($component[$component_id][Content],0,6); + $newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2); + $detailPlatInfo[SCCP][Version][Value]=$newValue; + $detailPlatInfo[SCCP][Version][Color]="#000000"; + + $value=hexdec(substr($component[$component_id][Content],6,2)); + if($value == 2) + { + $detailPlatInfo[SCCP][Status][Value]="Y"; + $detailPlatInfo[SCCP][Status][Color]="#0000FF"; + } + else + { + $detailPlatInfo[SCCP][Status][Value]="N"; + $detailPlatInfo[SCCP][Status][Color]="#FF0000"; + } + if($component_show_id == $component_id) + { + for($i=8;$i<$component[$component_id][Length]*2;$i++) + { + if($i%2 == 0) + { + $value=hexdec(substr($component[$component_id][Content],$i,2)); + $detailPlatInfo[SCCP][LocalNode][$value][Flag]=1; + $instanceNo=omc_keep_length($value,"0",4); + $sql_find="select initValue from OBJ_223.param_{$sysNo} where level_1=2 and level_2=2 and level_3=1 and level_4=1 and level_5=2 and level_6=0 and instanceNo='$instanceNo' "; + $res_find=mysqli_query($pubConn,$sql_find); + $num_find=mysqli_num_rows($res_find); + if($num_find < 1) + continue; + $row_find=@mysqli_fetch_array($res_find); + $detailPlatInfo[SCCP][LocalNode][$value][Value]=trim($row_find[initValue])." "; + $detailPlatInfo[SCCP][LocalNode][$value][Value1]=trim($row_find[initValue]); + $detailPlatInfo[SCCP][LocalNode][$value][Color]="#000000"; + + } + } + } + } + else + { + $detailPlatInfo[SCCP][Status][Value]="--"; + $detailPlatInfo[SCCP][Status][Color]="#000000"; + } + + //TCAP + $component_id=3; + if($component[$component_id][Length] > 0) + { + $value=substr($component[$component_id][Content],0,6); + $newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2); + $detailPlatInfo[TCAP][Version][Value]=$newValue; + $detailPlatInfo[TCAP][Version][Color]="#000000"; + + $value=hexdec(substr($component[$component_id][Content],6,2)); + if($value == 1) + { + $detailPlatInfo[TCAP][Status][Value]="Y"; + $detailPlatInfo[TCAP][Status][Color]="#0000FF"; + } + else + { + $detailPlatInfo[TCAP][Status][Value]="N"; + $detailPlatInfo[TCAP][Status][Color]="#FF0000"; + } + if($component_show_id == $component_id) + { + $detailPlatInfo[TCAP][CurrentUsedDialogueID][Value]=hexdec(substr($component[$component_id][Content],8,4)); + $detailPlatInfo[TCAP][CurrentUsedDialogueID][Color]="#000000"; + $detailPlatInfo[TCAP][MaxUsedDialogueID][Value]=hexdec(substr($component[$component_id][Content],12,4)); + $detailPlatInfo[TCAP][MaxUsedDialogueID][Color]="#000000"; + } + } + else + { + $detailPlatInfo[TCAP][Status][Value]="--"; + $detailPlatInfo[TCAP][Status][Color]="#000000"; + } + + //SNMP + $component_id=4; + if($component[$component_id][Length] > 0) + { + $value=substr($component[$component_id][Content],0,6); + $newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2); + $detailPlatInfo[SNMP][Version][Value]=$newValue; + $detailPlatInfo[SNMP][Version][Color]="#000000"; + + $value=hexdec(substr($component[$component_id][Content],6,2)); + if($value == 1) + { + $detailPlatInfo[SNMP][Status][Value]="Y"; + $detailPlatInfo[SNMP][Status][Color]="#0000FF"; + } + else + { + $detailPlatInfo[SNMP][Status][Value]="N"; + $detailPlatInfo[SNMP][Status][Color]="#FF0000"; + } + if($component_show_id == $component_id) + { + $detailPlatInfo[SNMP][TrapFuncCount][Value]=hexdec(substr($component[$component_id][Content],8,2)); + $detailPlatInfo[SNMP][TrapFuncCount][Color]="#000000"; + $detailPlatInfo[SNMP][SetFuncCount][Value]=hexdec(substr($component[$component_id][Content],10,2)); + $detailPlatInfo[SNMP][SetFuncCount][Color]="#000000"; + + $detailPlatInfo[SNMP][GetFuncCount][Value]=hexdec(substr($component[$component_id][Content],12,2)); + $detailPlatInfo[SNMP][GetFuncCount][Color]="#000000"; + $detailPlatInfo[SNMP][RspFuncCount][Value]=hexdec(substr($component[$component_id][Content],14,2)); + $detailPlatInfo[SNMP][RspFuncCount][Color]="#000000"; + } + } + else + { + $detailPlatInfo[SNMP][Status][Value]="--"; + $detailPlatInfo[SNMP][Status][Color]="#000000"; + } + + + //DEBUG + $component_id=5; + if($component[$component_id][Length] > 0) + { + $value=substr($component[$component_id][Content],0,6); + $newValue=(substr($value,0,2)-0).".".substr($value,2,2).".".substr($value,4,2); + $detailPlatInfo[DEBUG][Version][Value]=$newValue; + $detailPlatInfo[DEBUG][Version][Color]="#000000"; + + $value=hexdec(substr($component[$component_id][Content],6,2)); + if($value == 1) + { + $detailPlatInfo[DEBUG][Status][Value]="Y"; + $detailPlatInfo[DEBUG][Status][Color]="#0000FF"; + } + else + { + $detailPlatInfo[DEBUG][Status][Value]="N"; + $detailPlatInfo[DEBUG][Status][Color]="#FF0000"; + } + if($component_show_id == $component_id) + { + $value=hexdec(substr($component[$component_id][Content],8,6)); + $value=decbin($value); + $value=omc_keep_length($value,"0",24); + for($i=0;$i<24;$i++) + { + if($value[$i] == "1") + { + $detailPlatInfo[DEBUG][Module][$i][Value]="Y"; + $detailPlatInfo[DEBUG][Module][$i][Color]="#0000FF"; + } + else + { + $detailPlatInfo[DEBUG][Module][$i][Value]="--"; + $detailPlatInfo[DEBUG][Module][$i][Color]="#000000"; + } + } + } + } + else + { + $detailPlatInfo[DEBUG][Status][Value]="--"; + $detailPlatInfo[DEBUG][Status][Color]="#000000"; + } + + //SMPP + $component_id=9; + if($component[$component_id][Length] > 0) + { + $detailPlatInfo[SMPP][Status][Value]="Y"; + $detailPlatInfo[SMPP][Status][Color]="#0000FF"; + if($component_show_id == $component_id) + { + $binstr=""; + for($i=0;$i<8;$i++) + { + $value=hexdec(substr($component[$component_id][Content],$i*2,2)); + $value=decbin($value); + $value=omc_keep_length($value,"0",8); + $binstr.=$value; + } + + for($i=0;$i<32;$i++) + { + $value=substr($binstr,$i*2,2); + $value=bindec($value); + $detailPlatInfo[SMPP][SMPPLink][$i][Value]=$value; + } + } + } + else + { + $detailPlatInfo[SMPP][Status][Value]="--"; + $detailPlatInfo[SMPP][Status][Color]="#000000"; + } + + if(0) + { + echo "
      ";
      +		print_r($detailPlatInfo);
      +		echo "
      "; + } + return $detailPlatInfo; +} +?> + diff --git a/wxc2_omc/fault/serverStatusImprove/server_status.php b/wxc2_omc/fault/serverStatusImprove/server_status.php new file mode 100755 index 0000000..cf93aa2 --- /dev/null +++ b/wxc2_omc/fault/serverStatusImprove/server_status.php @@ -0,0 +1,270 @@ + + + + +\n"; + echo "line_id_arr[line_id_index++]='$line_id';\n"; + echo "\n"; +} + +?> +"; + +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strSysStatus > NSS > Application"; +echo ""; +$helpId = "1.2.2"; +showHelp($helpId); +echo "
      "; +echo " "; +echo ""; +echo "$strClear"; +echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +if ($_REQUEST['clearAll'] == 1) { + $sql = "delete from OMC_PUB.sysInfo "; + @mysqli_query($pubConn, $sql); + echo mysqli_error($pubConn); +} + +$config = parse_ini_file("config.ini", true); +$config_count = sizeof($config); +//echo "config_count=$config_count
      "; + +echo "
      "; +echo "
      Server summary information
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +for ($index = 0; $index < $config_count; $index++) { + $module = GetModuleInfo($config[$index]); + if (is_array($module)) $module_count = sizeof($module); + if ($module == 0) continue; + + for ($sysNo = 0; $sysNo < $config[$index]['MaxSysNo']; $sysNo++) { + $isfind = 0; + $module_index = -1; + for ($i = 0; $i < $module_count; $i++) { + if ($module[$i]['sysNo'] == $sysNo) { + $isfind = 1; + $module_index = $i; + break; + } + } + + $line_id = "{$config[$index]['SysTypeNo']}_{$sysNo}"; + AddLine($line_id); + + if ($isfind) { + echo ""; + //Name + echo ""; + //Application Status + echo ""; + //Platform Status + echo ""; + //Refresh Time + echo ""; + //Version + echo ""; + //IPAddress + echo ""; + echo ""; + } else { + echo ""; + //Name + echo ""; + //Application Status + echo ""; + //Platform Status + echo ""; + //Refresh Time + echo ""; + //Version + echo ""; + //IPAddress + echo ""; + echo ""; + } + } +} + + +echo "
      ItemApplication StatusPlatform ModuleRefresh TimeVersionIP Address
      "; + echo ""; + echo "{$module[$module_index]['Name']['Value']}"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "{$module[$module_index]['AppStatus']['Value']}"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "{$module[$module_index]['PlatStatus']['Value']}"; + echo ""; + echo ""; + echo ""; + echo "{$module[$module_index]['RefreshTime']['Value']}"; + echo ""; + echo ""; + echo ""; + echo "{$module[$module_index]['Version']['Value']}"; + echo ""; + echo ""; + echo ""; + echo "{$module[$module_index]['IPAddress']['Value']}"; + echo ""; + echo "
      "; + echo ""; + echo "{$config[$index]['Module']}_{$sysNo}"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "--"; + echo ""; + echo ""; + echo ""; + echo ""; + echo "--"; + echo ""; + echo ""; + echo ""; + echo "--"; + echo ""; + echo ""; + echo ""; + echo "--"; + echo ""; + echo ""; + echo ""; + echo "--"; + echo ""; + echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Remarks: Y = Normal, N = Abnormal, -- = None."; +echo ""; +echo "$strClear"; +echo "
      "; + + +adjust_content_tail(); +?> + diff --git a/wxc2_omc/fault/serverStatusImprove/server_status_detail.php b/wxc2_omc/fault/serverStatusImprove/server_status_detail.php new file mode 100755 index 0000000..f89ac71 --- /dev/null +++ b/wxc2_omc/fault/serverStatusImprove/server_status_detail.php @@ -0,0 +1,1665 @@ + + + + +"; +// print_r($config); +// echo ""; +$config_count=sizeof($config); +$config_index=-1; +for($index=0;$index<$config_count;$index++) +{ + if($config[$index][SysTypeNo] == $sysTypeNo) + { + $config_index=$index; + break; + } +} +if($config_index == -1) +{ + exit("System=$sysTypeNo not found!"); +} + +adjust_title_head(); +echo ""; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "$strSysStatus > Subsystem > $strServer"; + echo ""; + if($sysTypeNo == 0) + $helpId="1.2.2.1"; + else + $helpId="1.2.2.2"; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + echo "$strBack"; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +//some module have no plat heartbeat +$test=$config[$index]; +//print_r($test); +if($config[$index][PlatNo] == 999 || $config[$index][PlatNo] == 9) +//if($sysTypeNo == 384 || $sysTypeNo == 387 || $sysTypeNo == 389 || $sysTypeNo == 391 || $sysTypeNo == 392 || $sysTypeNo == 393) + $plat=1; +else +echo GetPlatInfo($config[$config_index],$sysNo); + + $plat=GetPlatInfo($config[$config_index],$sysNo); + $module=GetSingleModuleInfo($sysTypeNo,$sysNo); +if($plat == 0) +{ + exit("No plat heartbeat
      "); +} + +$version_str=GetModuleVersion($sysTypeNo,$sysNo); +//if($sysTypeNo == 362) +// echo "
      spgw status information(Version:$version_str)
      "; +//else + echo "
      {$config[$config_index][Module]}_{$sysNo} status information(Version:$version_str)
      "; +echo ""; +if($DEBUG) +{ + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; +} +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +//Add into the first table +switch($sysTypeNo) +{ +case 0: + //Dual Server Status + echo ""; + echo ""; + echo ""; + echo ""; + + //IOSyncInfo + echo ""; + echo ""; + echo ""; + echo ""; + + //SQLSyncInfo + echo ""; + echo ""; + echo ""; + echo ""; + + break; +case 320: + //Dual Server Status + echo ""; + echo ""; + echo ""; + echo ""; + //E1 License + echo ""; + echo ""; + echo ""; + echo ""; + //E1 Used + echo ""; + echo ""; + echo ""; + echo ""; + + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +//HLR +case 330: +//AUC +case 340: +//PPS +case 360: +case 395: +//SMSC +case 350: +//EIR +case 380: +//MNP +case 370: + //License + echo ""; + echo ""; + echo ""; + echo ""; + + //User + echo ""; + echo ""; + echo ""; + echo ""; + + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +//AAS +case 311: + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +//SMEG +case 355: + //License + echo ""; + echo ""; + echo ""; + echo ""; + + //User + echo ""; + echo ""; + echo ""; + echo ""; + + //SMPP TX Status + echo ""; + echo ""; + echo ""; + echo ""; + + //SMPP RX Status + echo ""; + echo ""; + echo ""; + echo ""; + + //SMTP TX Status + echo ""; + echo ""; + echo ""; + echo ""; + + //SMTP RX Status + echo ""; + echo ""; + echo ""; + echo ""; + + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +//MME +case 361: + //SystemID 00 + echo ""; + echo ""; + echo ""; + echo ""; + + //SubsystemID 00 + echo ""; + echo ""; + echo ""; + echo ""; + + //TimeStamp + echo ""; + echo ""; + echo ""; + echo ""; + + //Software Version + echo ""; + echo ""; + echo ""; + echo ""; + + //Status + echo ""; + echo ""; + echo ""; + echo ""; + + //Checksum + echo ""; + echo ""; + echo ""; + echo ""; + + //LicenseUser + echo ""; + echo ""; + echo ""; + echo ""; + + //RegisterUES + echo ""; + echo ""; + echo ""; + echo ""; + + //ConnectedUES + echo ""; + echo ""; + echo ""; + echo ""; + + //OnlineENBNum + echo ""; + echo ""; + echo ""; + echo ""; + + //SequenceNum + echo ""; + echo ""; + echo ""; + echo ""; + + //$LicenseDate + echo ""; + echo ""; + echo ""; + echo ""; + break; +//SPGW +case 362: + //SystemID 00 + echo ""; + echo ""; + echo ""; + echo ""; + + //SubsystemID + echo ""; + echo ""; + echo ""; + echo ""; + + //TimeStamp 2018 + echo ""; + echo ""; + echo ""; + echo ""; + + //Version 1.2.0 + echo ""; + echo ""; + echo ""; + echo ""; + + //S11ConnStatus 0->unconnected;1->connected + echo ""; + echo ""; + echo ""; + echo ""; + + //s1UConnStatus 0->unconnected;1->connected + echo ""; + echo ""; + echo ""; + echo ""; + + //SGIConnStatus 0->unconnected;1->connected + echo ""; + echo ""; + echo ""; + echo ""; + + //GxConnStatus 0->unconnected;1->connected + echo ""; + echo ""; + echo ""; + echo ""; + + //GyConnStatus 0->unconnected;1->connected + echo ""; + echo ""; + echo ""; + echo ""; + + //SystemCapability 12345 + echo ""; + echo ""; + echo ""; + echo ""; + + //LicenseUser 12345 + echo ""; + echo ""; + echo ""; + echo ""; + + //SequenceNum + echo ""; + echo ""; + echo ""; + echo ""; + + //$LicenseDate + echo ""; + echo ""; + echo ""; + echo ""; + break; +// ims +case 363: + //SystemID 00 + echo ""; + echo ""; + echo ""; + echo ""; + + //SubsystemID + echo ""; + echo ""; + echo ""; + echo ""; + + //TimeStamp 2018 + echo ""; + echo ""; + echo ""; + echo ""; + + //Version 1.2.0 + echo ""; + echo ""; + echo ""; + echo ""; + + //status + echo ""; + echo ""; + echo ""; + echo ""; + + //checksum + echo ""; + echo ""; + echo ""; + echo ""; + + //license user + echo ""; + echo ""; + echo ""; + echo ""; + + //volte pcscf status + echo ""; + echo ""; + echo ""; + echo ""; + + //voip pcscf status + echo ""; + echo ""; + echo ""; + echo ""; + + //icscf status + echo ""; + echo ""; + echo ""; + echo ""; + + //scscf status + echo ""; + echo ""; + echo ""; + echo ""; + + //mmtel status + echo ""; + echo ""; + echo ""; + echo ""; + + //sequence num + echo ""; + echo ""; + echo ""; + echo ""; + break; +//OPPS +// rcs +case 364: + //SystemID 00 + echo ""; + echo ""; + echo ""; + echo ""; + + //SubsystemID + echo ""; + echo ""; + echo ""; + echo ""; + + //TimeStamp 2018 + echo ""; + echo ""; + echo ""; + echo ""; + + //Version 1.2.0 + echo ""; + echo ""; + echo ""; + echo ""; + + //status + echo ""; + echo ""; + echo ""; + echo ""; + + //checksum + echo ""; + echo ""; + echo ""; + echo ""; + + //license user + echo ""; + echo ""; + echo ""; + echo ""; + + //registered user + echo ""; + echo ""; + echo ""; + echo ""; + + //online hnb num + echo ""; + echo ""; + echo ""; + echo ""; + + //sequence num + echo ""; + echo ""; + echo ""; + echo ""; + + //expire date + echo ""; + echo ""; + echo ""; + echo ""; + break; +// UDM +case 365: + //SystemID 00 + echo ""; + echo ""; + echo ""; + echo ""; + + //SubsystemID + echo ""; + echo ""; + echo ""; + echo ""; + + //TimeStamp 2018 + echo ""; + echo ""; + echo ""; + echo ""; + + //Version 1.2.0 + echo ""; + echo ""; + echo ""; + echo ""; + + //status + echo ""; + echo ""; + echo ""; + echo ""; + + //checksum + echo ""; + echo ""; + echo ""; + echo ""; + + //license user + echo ""; + echo ""; + echo ""; + echo ""; + + //sequence num + echo ""; + echo ""; + echo ""; + echo ""; + break; +// AUSF +case 366: + //SystemID 00 + echo ""; + echo ""; + echo ""; + echo ""; + + //SubsystemID + echo ""; + echo ""; + echo ""; + echo ""; + + //TimeStamp 2018 + echo ""; + echo ""; + echo ""; + echo ""; + + //Version 1.2.0 + echo ""; + echo ""; + echo ""; + echo ""; + + //status + echo ""; + echo ""; + echo ""; + echo ""; + + //checksum + echo ""; + echo ""; + echo ""; + echo ""; + + //license user + echo ""; + echo ""; + echo ""; + echo ""; + + //sequence num + echo ""; + echo ""; + echo ""; + echo ""; + break; +//OPPS +case 375: + //License + echo ""; + echo ""; + echo ""; + echo ""; + + //User + echo ""; + echo ""; + echo ""; + echo ""; + + //OPR Status + echo ""; + echo ""; + echo ""; + echo ""; + + //IMDX Status + echo ""; + echo ""; + echo ""; + echo ""; + + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +//iRLS +case 379: +//iPALIM +case 378: +//MHC +case 386: + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +//TMG +case 391: +//AMRMG +case 392: +//GbC +case 393: + //Max E1 Number + echo ""; + echo ""; + echo ""; + echo ""; + + //Online User + echo ""; + echo ""; + echo ""; + echo ""; + + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +case 394: + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +//VSS +case 390: + //Total Mailbox + echo ""; + echo ""; + echo ""; + echo ""; + + //Registered Mailbox + echo ""; + echo ""; + echo ""; + echo ""; + + //Active Mailbox + echo ""; + echo ""; + echo ""; + echo ""; + + //Total Voicemail + echo ""; + echo ""; + echo ""; + echo ""; + + //Total Seconds of Voicemail + echo ""; + echo ""; + echo ""; + echo ""; + + //Average Seconds of Voicemail + echo ""; + echo ""; + echo ""; + echo ""; + + //SMPP State + echo ""; + echo ""; + echo ""; + echo ""; + + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + break; +//IWF +case 384: + //License + echo ""; + echo ""; + echo ""; + echo ""; + + //User + echo ""; + echo ""; + echo ""; + echo ""; + break; +//IUUGW +case 389: + //Serial Number + echo ""; + echo ""; + echo ""; + echo ""; + //Used Count + echo ""; + echo ""; + echo ""; + echo ""; + break; +default: + break; +} +echo "
      "; + echo "
      ";
      +	print_r($plat);
      +	echo "
      "; + echo "
      "; + echo "
      ";
      +	print_r($module);
      +	echo "
      "; + echo "
      Status"; + //Application Status + $id=AssignID($sysTypeNo,$sysNo); + echo ""; + echo "{$module[AppStatus][Value]}"; + echo ""; +echo "
      Refresh Time"; + //Refresh Time + $id=AssignID($sysTypeNo,$sysNo); + echo ""; + echo "{$module[RefreshTime][Value]}"; + echo ""; +echo "
      Start Time"; + //Start Time + $id=AssignID($sysTypeNo,$sysNo); + echo ""; + echo "{$plat[StartTime][Value]}"; + echo ""; +echo "
      "; + echo "Dual Server Status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[DualServerStatus][Value]}"; + echo "
      "; + echo "BIN Log Transfer Information"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[IOSyncInfo][Value]}"; + echo "
      "; + echo "Relay Log Execute Information"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SQLSyncInfo][Value]}"; + echo "
      "; + echo "Dual Server Status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[DualServerStatus][Value]}"; + echo "
      "; + echo "E1 License"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[E1License][Value]}"; + echo "
      "; + echo "E1 Used"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[E1Used][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "License"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[License][Value]}"; + echo "
      "; + echo "User"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[User][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "License"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[License][Value]}"; + echo "
      "; + echo "User"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[User][Value]}"; + echo "
      "; + echo "SMPP TX Status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SMPPTXStatus][Value]}"; + echo "
      "; + echo "SMPP RX Status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SMPPRXStatus][Value]}"; + echo "
      "; + echo "SMTP TX Status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SMTPTXStatus][Value]}"; + echo "
      "; + echo "SMTP RX Status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SMTPRXStatus][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "SystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SystemID][Value]}"; + echo "
      "; + echo "SubsystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SubsystemID][Value]}"; + echo "
      "; + echo "TimeStamp"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TimeStamp][Value]}"; + echo "
      "; + echo "SoftwareVersion"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SoftwareVersion][Value]}"; + echo "
      "; + echo "Status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Status][Value]}"; + echo "
      "; + echo "Checksum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Checksum][Value]}"; + echo "
      "; + echo "LicenseUser"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[LicenseUser][Value]}"; + echo "
      "; + echo "RegisterUES"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[RegisterUES][Value]}"; + echo "
      "; + echo "ConnectedUES"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[ConnectedUES][Value]}"; + echo "
      "; + echo "OnlineENBNum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[OnlineENBNum][Value]}"; + echo "
      "; + echo "SequenceNum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SequenceNum][Value]}"; + echo "
      "; + echo "LicenseDate"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[LicenseDate][Value]}"; + echo "
      "; + echo "SystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SystemID][Value]}"; + echo "
      "; + echo "SubsystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SubsystemID][Value]}"; + echo "
      "; + echo "TimeStamp"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TimeStamp][Value]}"; + echo "
      "; + echo "Version"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Version][Value]}"; + echo "
      "; + echo "S11ConnStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[S11ConnStatus][Value]}"; + echo "
      "; + echo "s1UConnStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[s1UConnStatus][Value]}"; + echo "
      "; + echo "SGIConnStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SGIConnStatus][Value]}"; + echo "
      "; + echo "GxConnStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[GxConnStatus][Value]}"; + echo "
      "; + echo "GyConnStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[GyConnStatus][Value]}"; + echo "
      "; + echo "SystemCapability"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SystemCapability][Value]}"; + echo "
      "; + echo "LicenseUser"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[LicenseUser][Value]}"; + echo "
      "; + echo "SequenceNum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SequenceNum][Value]}"; + echo "
      "; + echo "LicenseDate"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[LicenseDate][Value]}"; + echo "
      "; + echo "SystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SystemID][Value]}"; + echo "
      "; + echo "SubsystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SubsystemID][Value]}"; + echo "
      "; + echo "TimeStamp"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TimeStamp][Value]}"; + echo "
      "; + echo "Version"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Version][Value]}"; + echo "
      "; + echo "status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Status][Value]}"; + echo "
      "; + echo "checksum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Checksum][Value]}"; + echo "
      "; + echo "licenseUser"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[LicenseUser][Value]}"; + echo "
      "; + echo "voltePCSCFStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[VoltePCSCFStatus][Value]}"; + echo "
      "; + echo "voipPCSCFStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[VoipPCSCFStatus][Value]}"; + echo "
      "; + echo "IcscfStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[IcscfStatus][Value]}"; + echo "
      "; + echo "ScscfStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[ScscfStatus][Value]}"; + echo "
      "; + echo "MMETelStatus"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[MMETelStatus][Value]}"; + echo "
      "; + echo "SequenceNum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SequenceNum][Value]}"; + echo "
      "; + echo "SystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SystemID][Value]}"; + echo "
      "; + echo "SubsystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SubsystemID][Value]}"; + echo "
      "; + echo "TimeStamp"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TimeStamp][Value]}"; + echo "
      "; + echo "Version"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Version][Value]}"; + echo "
      "; + echo "status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Status][Value]}"; + echo "
      "; + echo "checksum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Checksum][Value]}"; + echo "
      "; + echo "licenseUser"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[LicenseUser][Value]}"; + echo "
      "; + echo "registeredUES"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[registeredUES][Value]}"; + echo "
      "; + echo "onlineHNBNum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[onlineHNBNum][Value]}"; + echo "
      "; + echo "SequenceNum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SequenceNum][Value]}"; + echo "
      "; + echo "expireDate"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[expireDate][Value]}"; + echo "
      "; + echo "SystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SystemID][Value]}"; + echo "
      "; + echo "SubsystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SubsystemID][Value]}"; + echo "
      "; + echo "TimeStamp"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TimeStamp][Value]}"; + echo "
      "; + echo "Version"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Version][Value]}"; + echo "
      "; + echo "status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Status][Value]}"; + echo "
      "; + echo "checksum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Checksum][Value]}"; + echo "
      "; + echo "licenseUser"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[LicenseUser][Value]}"; + echo "
      "; + echo "SequenceNum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SequenceNum][Value]}"; + echo "
      "; + echo "SystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SystemID][Value]}"; + echo "
      "; + echo "SubsystemID"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SubsystemID][Value]}"; + echo "
      "; + echo "TimeStamp"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TimeStamp][Value]}"; + echo "
      "; + echo "Version"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Version][Value]}"; + echo "
      "; + echo "status"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Status][Value]}"; + echo "
      "; + echo "checksum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[Checksum][Value]}"; + echo "
      "; + echo "licenseUser"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[LicenseUser][Value]}"; + echo "
      "; + echo "SequenceNum"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SequenceNum][Value]}"; + echo "
      "; + echo "License"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[License][Value]}"; + echo "
      "; + echo "User"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[User][Value]}"; + echo "
      "; + echo "OPR"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[OPRStatus][Value]}"; + echo "
      "; + echo "IMDX"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[IMDXStatus][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "Max E1 Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[MaxE1Number][Value]}"; + echo "
      "; + echo "Online User"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[OnlineUser][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "Total Mailbox"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TotalMailbox][Value]}"; + echo "
      "; + echo "Registered Mailbox"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[RegisteredMailbox][Value]}"; + echo "
      "; + echo "Active Mailbox"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[ActiveMailbox][Value]}"; + echo "
      "; + echo "Total Voicemail"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TotalVoicemail][Value]}"; + echo "
      "; + echo "Total Seconds of Voicemail"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[TotalSecondVoicemail][Value]}"; + echo "
      "; + echo "Average Seconds of Voicemail"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[AverageSecondVoicemail][Value]}"; + echo "
      "; + echo "SMPP State"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SMPPState][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "Max Call License"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[License][Value]}"; + echo "
      "; + echo "Online Call"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[User][Value]}"; + echo "
      "; + echo "Serial Number"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SerialNumber][Value]}"; + echo "
      "; + echo "Used Count"; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[UsedCount][Value]}"; + echo "
      "; + +//Additional Table +switch($sysTypeNo) +{ +case 0: + echo "
      Process Status
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<$module[TotalProcessNum];$i++) + { + if($i < $module[CurrentProcessNum]) + { + $id=AssignID($sysTypeNo,$sysNo); + echo ""; + echo ""; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo ""; + echo ""; + } + else + { + $id=AssignID($sysTypeNo,$sysNo); + echo ""; + echo ""; + echo ""; + $id=AssignID($sysTypeNo,$sysNo); + echo ""; + echo ""; + } + } + + echo "
      Process IDProcess NameProcess Status
      $i{$module[Process][$i][Name]}{$module[Process][$i][Value]}
      $i{$module[Process][$i][Name]}{$module[Process][$i][Value]}
      "; + break; +case 320: + echo "
      VLR_{$sysNo} status information(Version:{$module[VLR][Version]})
      "; + echo ""; + //VLR Refresh Time + echo ""; + echo ""; + echo ""; + echo ""; + + //VLR AppStatus + echo ""; + echo ""; + echo ""; + echo ""; + + //VLR Subscriber Number + echo ""; + echo ""; + echo ""; + echo ""; + + //VLR License + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
      Refresh Time"; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[VLR][RefreshTime][Value]}"; + echo "
      Status"; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[VLR][AppStatus][Value]}"; + echo "
      VLR Subscriber Number"; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[VLR][SubscriberNumber][Value]}"; + echo "
      License"; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[VLR][License][Value]}"; + echo "
      "; + break; +//SMSC +case 350: + echo "
      SMPP Link Status
      "; + echo ""; + for($i=0;$i<4;$i++) + { + echo ""; + for($j=0;$j<8;$j++) + { + $no=$i*8+$j; + $noshow=omc_keep_length($no,0,2); + echo ""; + } + echo ""; + + echo ""; + for($j=0;$j<8;$j++) + { + $no=$i*8+$j; + echo ""; + } + echo ""; + } + echo "
      $noshow "; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SMPPLink][$no][Name][Value]}"; + echo "
      "; + $id=AssignID($sysTypeNo,$sysNo); + echo "{$module[SMPPLink][$no][Status][Value]}"; + echo "
      "; + break; +default: + break; +} + +//Alarm Table +echo "
      "; +$sql="select * from sysAlarmLog where sysTypeNo=$sysTypeNo and sysNo=$sysNo and clearBy is null "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); +if($num > 0) +{ + echo "
      {$config[$config_index][Module]}_{$sysNo} Alarm List
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<$num;$i++) + { + $row=mysqli_fetch_array($res); + $alarmTime=$row[alarmTime]; + $tmpsql="select * from sysAlarmConf where sysTypeNo=$sysTypeNo and compCode='$row[compCode]' and alarmCode='$row[alarmCode]' "; + $tmpres=@mysqli_query($pubConn,$tmpsql); + echo mysqli_error($pubConn); + $tmprow=@mysqli_fetch_array($tmpres); + $alarmLevel=$tmprow[alarmLevel]; + if(trim($tmprow[alarmDesc_2]) == "") + echo ""; + else + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + echo "
      Alarm LevelEventsAlarm Time
      {$alarmLevelDefArr[$alarmLevel][remark]}{$tmprow[alarmDesc_2]}$alarmTime
      "; +} +echo "
      "; + +//Remark Table +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Remarks: Y = Normal, N = Abnormal, -- = None."; + echo ""; + echo "$strBack"; + echo "
      "; + +adjust_content_tail(); +?> + +\n"; + echo "updateStatus('$sysTypeNo','$sysNo');\n"; + echo "\n"; +?> diff --git a/wxc2_omc/fault/serverStatusImprove/server_status_detail_update.php b/wxc2_omc/fault/serverStatusImprove/server_status_detail_update.php new file mode 100755 index 0000000..cea09ad --- /dev/null +++ b/wxc2_omc/fault/serverStatusImprove/server_status_detail_update.php @@ -0,0 +1,429 @@ + + + 0) +{ + // if($sysTypeNo == 362) + // $message="
      SPGW Alarm List
      "; + // else + $message="
      {$config[$config_index][Module]}_{$sysNo} Alarm List
      "; + $message.=""; + $message.=""; + $message.=""; + $message.=""; + $message.=""; + $message.=""; + + for($i=0;$i<$num;$i++) + { + $row=mysqli_fetch_array($res); + $alarmTime=$row[alarmTime]; + $tmpsql="select * from sysAlarmConf where sysTypeNo=$sysTypeNo and compCode='$row[compCode]' and alarmCode='$row[alarmCode]' "; + $tmpres=@mysqli_query($pubConn,$tmpsql); + echo mysqli_error($pubConn); + $tmprow=@mysqli_fetch_array($tmpres); + $alarmLevel=$tmprow[alarmLevel]; + if(trim($tmprow[alarmDesc_2]) == "") + $message.=""; + else + $message.=""; + $message.=""; + $message.=""; + $message.=""; + $message.=""; + } + $message.="
      Alarm LevelEventsAlarm Time
      {$alarmLevelDefArr[$alarmLevel][remark]}{$tmprow[alarmDesc_2]}$alarmTime
      "; + + $total_response.=$message; +} +else +{ + $total_response.="none"; +} + + +echo $total_response; +//echo "hhelo"; +?> + diff --git a/wxc2_omc/fault/serverStatusImprove/server_status_update.php b/wxc2_omc/fault/serverStatusImprove/server_status_update.php new file mode 100755 index 0000000..2157d6c --- /dev/null +++ b/wxc2_omc/fault/serverStatusImprove/server_status_update.php @@ -0,0 +1,114 @@ + + + $ove_date) + { + $response.="{$id}_RefreshTime,$refresh_time,#ff0000,"; + $valid_time=0; + } + else + { + $response.="{$id}_RefreshTime,$refresh_time,#0000ff,"; + $valid_time=1; + } + + //Application Status + $baseStat=$row['baseStat']+0; + if($valid_time && $baseStat) + { + $response.="{$id}_AppStatus,Y,#0000ff,"; + } + else + { + $response.="{$id}_AppStatus,N,#ff0000,"; + } + + //Platform Status + if($num_plat == 1) + { + $response.="{$id}_PlatStatus,Y,#0000ff,"; + } + else + { + $response.="{$id}_PlatStatus,N,#ff0000,"; + } + + //Version + $version=GetModuleVersion($config[$index]['SysTypeNo'],$sysNo,0); + $response.="{$id}_Version,{$version},#000000,"; + + //IPAddress + $response.="{$id}_IPAddress,{$row['ip']},#000000;"; + + $total_response.=$response; + } +} +if($show_num) + $total_response.="blank_line,none;"; +$total_response=substr($total_response,0,strlen($total_response)-1); +echo $total_response; +//system("echo '$total_response' >> /tmp/test.txt"); +?> + diff --git a/wxc2_omc/fault/sub_inc/header.inc b/wxc2_omc/fault/sub_inc/header.inc new file mode 100755 index 0000000..3389c55 --- /dev/null +++ b/wxc2_omc/fault/sub_inc/header.inc @@ -0,0 +1,94 @@ +"; + echo "var logon='Please Logon System';"; + echo "alert(logon);"; + echo "window.parent.parent.location.href=\"../../security/logout/logout.php\";"; + echo ""; + exit(); +} + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); +header("Cache-Control: no-cache, must-revalidate"); +header("Pragma: no-cache"); + +if($selectedLanguage == 'chn'){ +?> + + + + + + + + + diff --git a/wxc2_omc/fault/sub_inc/sub_chinese_gb.inc b/wxc2_omc/fault/sub_inc/sub_chinese_gb.inc new file mode 100755 index 0000000..523262e --- /dev/null +++ b/wxc2_omc/fault/sub_inc/sub_chinese_gb.inc @@ -0,0 +1,118 @@ + \ No newline at end of file diff --git a/wxc2_omc/fault/sub_inc/sub_config.inc b/wxc2_omc/fault/sub_inc/sub_config.inc new file mode 100755 index 0000000..1ace571 --- /dev/null +++ b/wxc2_omc/fault/sub_inc/sub_config.inc @@ -0,0 +1,26 @@ + \ No newline at end of file diff --git a/wxc2_omc/fault/sub_inc/sub_english.inc b/wxc2_omc/fault/sub_inc/sub_english.inc new file mode 100755 index 0000000..2d75d8d --- /dev/null +++ b/wxc2_omc/fault/sub_inc/sub_english.inc @@ -0,0 +1,118 @@ + \ No newline at end of file diff --git a/wxc2_omc/fault/tgmgStatus/tgmgStatus_deal.php b/wxc2_omc/fault/tgmgStatus/tgmgStatus_deal.php new file mode 100755 index 0000000..e3aa498 --- /dev/null +++ b/wxc2_omc/fault/tgmgStatus/tgmgStatus_deal.php @@ -0,0 +1,573 @@ + +"; + } + else + { + //exit; + //echo "other system
      "; + } + //sleep(1); + echo ""; + + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + + /*******************************************************************************/ + /************** TrunkGroup x 256 ********************/ + /*******************************************************************************/ + //Get the count of TrunkGroup + $TrunkGroupCount=0; + $database="OBJ_320"; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$database); + $selSql = "SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgIndex'"; + if($DEBUG) echo "
      selSql=$selSql"; + $selRes = @mysqli_query($objDbConn,$selSql); + $TrunkGroupCount=mysqli_num_rows($selRes); + echo mysqli_error($objDbConn); + //echo "count:$TrunkGroupCount
      "; + + $TrunkGroupInstanceNoList=""; + while($selRow = @mysqli_fetch_array($selRes)){ + $tmpSelRow=$selRow; + $TrunkGroupInstanceNoList=$TrunkGroupInstanceNoList.$selRow[instanceNo].","; + if($DEBUG) echo "
      TrunkGroupInstanceNoList=$TrunkGroupInstanceNoList"; + }; + + + for($i=0;$i<=10;$i++){ + $level='level_'.$i; + $nextLevel='level_'.($i+1); + if($tmpSelRow[$level]!='0'&&$tmpSelRow[$nextLevel]==0) + break; + if($i==1) + $tmpLevelWhere='T1.'.$level.'='.$tmpSelRow[$level]; + else + $tmpLevelWhere=$tmpLevelWhere.' AND T1.'.$level.'='.$tmpSelRow[$level]; + + } + + if($DEBUG) echo "
      tmpLevelWhere=$tmpLevelWhere"; + //Get the parameter of TrunkGroup + $index=0; + $database="OBJ_320"; + $selSql = "SELECT T1.*,T2.name_2 FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND $tmpLevelWhere "; + if($DEBUG) echo "
      selSql=$selSql"; + + if($TrunkGroupCount!=0) + { + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $instanceNo_tmp=$selRow[instanceNo].""; + //Title + if(stristr($selRow[name_2],'tgTitle')) + { + if(strlen($selRow[initValue])==0) + $TrunkGroup_Title[$instanceNo_tmp]="--"; + else + $TrunkGroup_Title[$instanceNo_tmp]=$selRow[initValue]; + + } + + //Status + else if(stristr($selRow[name_2],'tgAvailabilityStatus')) + { + $TrunkGroup_Status[$instanceNo_tmp]=$selRow[initValue]; + //echo "instanceNo $instanceNo_tmp status:{$TrunkGroup_Status[$instanceNo_tmp]}
      "; + } + //Protocol Type + else if(stristr($selRow[name_2],'tgProtocolType')) + { + $TrunkGroup_ProtocolType[$instanceNo_tmp]=$selRow[initValue]; + } + //Protocol Variant + else if(stristr($selRow[name_2],'tgProtocolVariant')) + { + $TrunkGroup_ProtocolVariant[$instanceNo_tmp]=$selRow[initValue]; + } + + }while($selRow = @mysqli_fetch_array($selRes)); + } + + /******************** Trunk x 256 ****************************/ + //Get the count of Trunk + $TrunkCount=0; + $database="OBJ_320"; + $selSql = "SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='trunkIndex'"; + //echo "$selSql
      "; + $selRes = @mysqli_query($objDbConn,$selSql); + $TrunkCount=mysqli_num_rows($selRes); + echo mysqli_error($objDbConn); + //echo "count:$TrunkCount
      "; + + $TrunkInstanceNoList=""; + while($selRow = @mysqli_fetch_array($selRes)){ + $tmpSelRow=$selRow; + $TrunkInstanceNoList=$TrunkInstanceNoList.$selRow[instanceNo].","; + if($DEBUG) echo "
      TrunkInstanceNoList=$TrunkInstanceNoList"; + }; + for($i=0;$i<=10;$i++){ + $level='level_'.$i; + $nextLevel='level_'.($i+1); + if($tmpSelRow[$level]!='0'&&$tmpSelRow[$nextLevel]==0) + break; + if($i==1) + $tmpLevelWhere='T1.'.$level.'='.$tmpSelRow[$level]; + else + $tmpLevelWhere=$tmpLevelWhere.' AND T1.'.$level.'='.$tmpSelRow[$level]; + + } + + //Get the parameter of Trunk + $database="OBJ_320"; + $selSql = "SELECT T1.*,T2.name_2 FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND $tmpLevelWhere "; + if($DEBUG) echo "selSql=$selSql
      "; + if($TrunkCount!=0) + { + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $instanceNo_tmp=$selRow[instanceNo]; + $t=explode(".",$instanceNo_tmp); + //index for tg + if(stristr($selRow[name_2],'trunkTgIndex')) + { + $Trunk_TrunkGroupIndex[$instanceNo_tmp]=$t[0]; + if(stristr($TrunkInstanceNoList,$instanceNo_tmp)!=FALSE) + $TrunkGroup_TrunkCount[$t[0]]++; + //echo "TrunkInstanceNoList=$TrunkInstanceNoList, find={$t[0]}, instanceNo_tmp=$instanceNo_tmp
      "; + //echo "tK:$instanceNo_tmp,{$Trunk_TrunkGroupIndex[$instanceNo_tmp]}
      "; + } + //Title + else if(stristr($selRow[name_2],'trunkTitle')) + { + + if(strlen($selRow[initValue])==0) + $Trunk_Title[$instanceNo_tmp]="--"; + else + $Trunk_Title[$instanceNo_tmp]=$selRow[initValue]; + } + //Status + else if(stristr($selRow[name_2],'trunkAvailabilityStatus')) + { + $Trunk_Status[$instanceNo_tmp]=$selRow[initValue]; + } + //MG ID + else if(stristr($selRow[name_2],'trunkMgID')) + { + $Trunk_MGID[$instanceNo_tmp]=$selRow[initValue]; + } + //MG Port + else if(stristr($selRow[name_2],'trunkPortID')) + { + $Trunk_PortID[$instanceNo_tmp]=$selRow[initValue]; + } + //Channel In Use + else if(stristr($selRow[name_2],'trunkChannelInUse')) + { + $Trunk_ChannelInUse[$instanceNo_tmp]=$selRow[initValue]; + } + + }while($selRow = @mysqli_fetch_array($selRes)); + } + + + /******************** Media Gate x 256 *****************************/ + //Get the count of MG + $MGCount=0; + $database="OBJ_320"; + $selSql = "SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='mgIndex'"; + $selRes = @mysqli_query($objDbConn,$selSql); + $MGCount=mysqli_num_rows($selRes); + echo mysqli_error($objDbConn); + //echo "MGCount:$MGCount
      "; + + $MGInstanceNoList=""; + while($selRow = @mysqli_fetch_array($selRes)){ + $tmpSelRow=$selRow; + if($selRow[instanceNo]!=0) + $MGInstanceNoList=$MGInstanceNoList.$selRow[instanceNo].","; + if($DEBUG) echo "
      MGInstanceNoList=$MGInstanceNoList"; + }; + + //echo "MGInstanceNoList:$MGInstanceNoList
      "; + + for($i=0;$i<=10;$i++){ + $level='level_'.$i; + $nextLevel='level_'.($i+1); + if($tmpSelRow[$level]!='0'&&$tmpSelRow[$nextLevel]==0) + break; + if($i==1) + $tmpLevelWhere='T1.'.$level.'='.$tmpSelRow[$level]; + else + $tmpLevelWhere=$tmpLevelWhere.' AND T1.'.$level.'='.$tmpSelRow[$level]; + + } + + + //Get the parameter of MG + $database="OBJ_320"; + $selSql = "SELECT T1.*,T2.name_2 FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND $tmpLevelWhere "; + if($MGCount!=0) + { + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $instanceNo_tmp=$selRow[instanceNo]; + + //ID + if(stristr($selRow[name_2],'mgIndex')) + { + if(strlen($selRow[initValue])==0) + $MG_ID[$instanceNo_tmp]="--"; + else + $MG_ID[$instanceNo_tmp]=$selRow[initValue]; + } + //Title + else if(stristr($selRow[name_2],'mgTitle')) + { + if(strlen($selRow[initValue])==0) + $MG_Title[$instanceNo_tmp]="--"; + else + $MG_Title[$instanceNo_tmp]=$selRow[initValue]; + } + //Domain Name + else if(stristr($selRow[name_2],'mgDomainName')) + { + if(strlen($selRow[initValue])==0) + $MG_DomainName[$instanceNo_tmp]="--"; + else + $MG_DomainName[$instanceNo_tmp]=$selRow[initValue]; + } + //IP + else if(stristr($selRow[name_2],'mgIp')) + { + if(strlen($selRow[initValue])==0) + $MG_IP[$instanceNo_tmp]="--"; + else + $MG_IP[$instanceNo_tmp]=$selRow[initValue]; + } + + + }while($selRow = @mysqli_fetch_array($selRes)); + } + + /******************* Port 256 x 32 ************************/ + //Get the count of Port + $PortCount=0; + $database="OBJ_320"; + $selSql = "SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='ppIndex'"; + $selRes = @mysqli_query($objDbConn,$selSql); + $PortCount=mysqli_num_rows($selRes); + echo mysqli_error($objDbConn); + //echo "PortCount:$PortCount
      "; + + $PortInstanceNoList=""; + while($selRow = @mysqli_fetch_array($selRes)){ + $tmpSelRow=$selRow; + $PortInstanceNoList=$PortInstanceNoList.$selRow[instanceNo].","; + }; + for($i=0;$i<=10;$i++){ + $level='level_'.$i; + $nextLevel='level_'.($i+1); + if($tmpSelRow[$level]!='0'&&$tmpSelRow[$nextLevel]==0) + break; + if($i==1) + $tmpLevelWhere='T1.'.$level.'='.$tmpSelRow[$level]; + else + $tmpLevelWhere=$tmpLevelWhere.' AND T1.'.$level.'='.$tmpSelRow[$level]; + + } + + + //echo "PortInstanceNoList:$PortInstanceNoList
      "; + + //Get the parameter of Port + $database="OBJ_320"; + $selSql = "SELECT T1.*,T2.name_2 FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND $tmpLevelWhere "; + if($DEBUG) echo "selSql=$selSql
      "; + if($PortCount!=0) + { + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $instanceNo_tmp=$selRow[instanceNo]; + $t=explode(".",$instanceNo_tmp); + //index for mg + if(stristr($selRow[name_2],'ppMgIndex')) + { + $Port_MGIndex[$instanceNo_tmp]=$t[0]; + $Port_Index[$instanceNo_tmp]=$t[1]+0; + } + //Used flag + else if(stristr($selRow[name_2],'ppUsedFlag')) + { + $Port_UsedFlag[$instanceNo_tmp]=$selRow[initValue]; + } + //Status + else if(stristr($selRow[name_2],'ppStatus')) + { + $Port_Status[$instanceNo_tmp]=$selRow[initValue]; + } + + }while($selRow = @mysqli_fetch_array($selRes)); + } + + /*********** Test the data ************************/ + + //echo "TG InstanceNo:$TrunkGroupInstanceNoList
      "; + //echo "TK InstanceNo:$TrunkInstanceNoList
      "; + $insTg=explode(",",$TrunkGroupInstanceNoList); + //TG + for($i=0;$i<$TrunkGroupCount;$i++) + { + $instanceNo_tmp=$insTg[$i]; + + if(0) + { + echo "TrunkGroup InstanceNo:$instanceNo_tmp
      "; + echo " Title:{$TrunkGroup_Title[$instanceNo_tmp]}
      "; + echo " Status:{$TrunkGroup_Status[$instanceNo_tmp]}
      "; + echo " ProtocolType:{$TrunkGroup_ProtocolType[$instanceNo_tmp]}
      "; + echo " ProtocolVariant:{$TrunkGroup_ProtocolVariant[$instanceNo_tmp]}
      "; + echo " Trunk Count:{$TrunkGroup_TrunkCount[$instanceNo_tmp]}
      "; + } + } + + /* + //Trunk + for($i=0;$i<$TrunkCount;$i++) + { + $instanceNo_tmp=$i; + echo "Trunk InstanceNo:{$Trunk_InstanceNo[$i]} index:$i
      "; + echo " Title:{$Trunk_Title[$instanceNo_tmp]}
      "; + echo " Status:{$AvailStatusLabel[$Trunk_Status[$instanceNo_tmp]]}
      "; + echo " MGID:{$Trunk_MGID[$instanceNo_tmp]}
      "; + echo " PortID:{$Trunk_PortID[$instanceNo_tmp]}
      "; + echo " CH In use:{$Trunk_ChannelInUse[$instanceNo_tmp]}
      "; + echo " Be to Tg:{$Trunk_TrunkGroupIndex[$instanceNo_tmp]}

      "; + } + */ + /* + $insMg=explode(",",$MGInstanceNoList); + for($i=0;$i<$MGCount;$i++) + { + $instance_tmp=$insMg[$i]; + echo "MG ID:{$MG_ID[$instance_tmp]}
      "; + echo " Title:{$MG_Title[$instance_tmp]}
      "; + echo " Domain:{$MG_DomainName[$instance_tmp]}
      "; + echo " IP::{$MG_IP[$instance_tmp]}
      "; + } + + echo "--------------------------------------------
      "; + $insP=explode(",",$PortInstanceNoList); + for($i=0;$i<$PortCount;$i++) + { + $instance_tmp=$insP[$i]; + echo "Port Index:{$Port_Index[$instance_tmp]}
      "; + echo "Port to MG:{$Port_MGIndex[$instance_tmp]}
      "; + echo "Port InstanceNo:{$insP[$i]}
      "; + echo "Port UsedFlag:{$Port_UsedFlag[$instance_tmp]}
      "; + echo "Port Status:{$Port_Status[$instance_tmp]}
      "; + } + */ + /************ Create the HTML for TrunkGroup Table ***************/ + //Table Title + $TrunkGroupHTML=""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Table Column Name + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + + //Table Content + $AvailStatusLabel=array(0=>"In Test",1=>"Failed",2=>"Power Off",3=>"Offline",4=>"Online",5=>"Dependency",6=>"Degraded",7=>"Not Installed","null"=>"--"); + $AvailStatusColor=array(0=>"#CECECE",1=>"#FF0000",2=>"#FF0000",3=>"#FF0000",4=>"#0000FF",5=>"#0000FF",6=>"#0000FF",7=>"#C6C6C6","null"=>"#CECECE"); + $ProtocolTypeLabel=getParamOptionArray("320","ProtocolType",PARAM_NAME); + $ProtocolVariantLabel=getParamOptionArray("320","ProtocolVariant",PARAM_NAME); + + $insTg=explode(",",$TrunkGroupInstanceNoList); + //echo "TrunkCount:$TrunkCount
      "; + for($i=0;$i<$TrunkGroupCount;$i++) + { + $instanceNo_tmp=$insTg[$i]; + $trunkCount_tmp=$TrunkGroup_TrunkCount[$instanceNo_tmp]; + //echo "rowspan:$trunkCount_tmp
      "; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //title + $TrunkGroupHTML=$TrunkGroupHTML.""; + //status + if(strlen($TrunkGroup_Status[$instanceNo_tmp]) == 0) + { + $TrunkGroup_Status[$instanceNo_tmp]="null"; + } + $tmpColor=$AvailStatusColor[$TrunkGroup_Status[$instanceNo_tmp]]; + $tmpValue=$AvailStatusLabel[$TrunkGroup_Status[$instanceNo_tmp]]; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Type + $tmpValue=$ProtocolTypeLabel[$TrunkGroup_ProtocolType[$instanceNo_tmp]]; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Variant + $tmpValue=$ProtocolVariantLabel[$TrunkGroup_ProtocolVariant[$instanceNo_tmp]]; + $TrunkGroupHTML=$TrunkGroupHTML.""; + + $trunkCount_tmp=$trunkCount_tmp+0; + if($trunkCount_tmp==0) + { + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + } + + $insTk=explode(",",$TrunkInstanceNoList); + for($j=0;$j<$TrunkCount;$j++) + { + $inst=$insTk[$j]; + if($Trunk_TrunkGroupIndex[$inst]==$instanceNo_tmp) + { + //echo "$instanceNo_tmp
      "; + //title + $TrunkGroupHTML=$TrunkGroupHTML.""; + //MG ID + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Port ID + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Status + if(strlen($Trunk_Status[$inst]) == 0) + $Trunk_Status[$inst]="null"; + $tmpColor=$AvailStatusColor[$Trunk_Status[$inst]]; + $tmpValue=$AvailStatusLabel[$Trunk_Status[$inst]]; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Channel In Use + if(strlen($Trunk_ChannelInUse[$inst]) == 0) + $Trunk_ChannelInUse[$inst]=0; + $TrunkGroupHTML=$TrunkGroupHTML.""; + } + } + $TrunkGroupHTML=$TrunkGroupHTML.""; + + } + $TrunkGroupHTML=$TrunkGroupHTML."
      TG Status
      TitleStatusProtocol
      Type
      Protocol
      Variant
      Trunk
      TitleMG IDMG PortStatusChannel In Use
      ".$TrunkGroup_Title[$instanceNo_tmp]."".$tmpValue."".$tmpValue."
      ".$tmpValue."
      ----------
      ".$Trunk_Title[$inst]."".$Trunk_MGID[$inst]."".$Trunk_PortID[$inst]."".$tmpValue."".$Trunk_ChannelInUse[$inst]."
      "; + + /*********** Create the MG Table *************************/ + //Table Title + $MGHTML=""; + $MGHTML=$MGHTML.""; + //Table Column Name + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + + //Table Content + $PortStatusLabel=array(0=>"Offline",1=>"Online",2=>"--"); + $PortStatusColor=array(0=>"#FF0000",1=>"#0000FF",2=>"#CECECE"); + $insMg=explode(",",$MGInstanceNoList); + $insPo=explode(",",$PortInstanceNoList); + for($i=0;$i<$MGCount;$i++) + { + $insMg_tmp=$insMg[$i]; + $MGHTML=$MGHTML.""; + //MG ID + $MGHTML=$MGHTML.""; + //Title + $MGHTML=$MGHTML.""; + //Domain Name + $MGHTML=$MGHTML.""; + //IP Address + $MGHTML=$MGHTML.""; + + //initial + for($j=0;$j<32;$j++) + { + //no use + $Port_Status_Show[$j]=2; + } + + //get the state of ports for every MG + for($j=0;$j<$PortCount;$j++) + { + $insPo_tmp=$insPo[$j]; + if($Port_MGIndex[$insPo_tmp]==$MG_ID[$insMg_tmp]) + { + if($Port_UsedFlag[$insPo_tmp]==1) + $Port_Status_Show[$Port_Index[$insPo_tmp]]=$Port_Status[$insPo_tmp]; + /* + //in use + if($Port_UsedFlag[$insPo_tmp]==1) + { + //ready + if($Port_Status[$insPo_tmp]==1) + $Port_Status_Show[$Port_Index[$insPo_tmp]]=1; + //not ready + else + $Port_Status_Show[$Port_Index[$insPo_tmp]]=2; + } + //idle + else + { + //do nothing + } + */ + } + } + + //show the status for ports + for($j=0;$j<4;$j++) + { + for($k=0;$k<8;$k++) + { + if(strlen($Port_Status_Show[$j*8+$k]) == 0) + $Port_Status_Show[$j*8+$k]=2; + $tmpColor=$PortStatusColor[$Port_Status_Show[$j*8+$k]]; + $tmpValue=$PortStatusLabel[$Port_Status_Show[$j*8+$k]]; + $MGHTML=$MGHTML.""; + } + $MGHTML=$MGHTML.""; + } + } + $MGHTML=$MGHTML."
      MG Status
      MG IDTitleDomain NameIP AddressPort Status(0-31)
      ".$MG_ID[$insMg_tmp]."".$MG_Title[$insMg_tmp]."".$MG_DomainName[$insMg_tmp]."".$MG_IP[$insMg_tmp]."".$tmpValue." 
      "; + + /*********** Write the HTML to the div object ********************/ + echo "\n"; + +?> diff --git a/wxc2_omc/fault/tgmgStatus/tgmgStatus_frame.php b/wxc2_omc/fault/tgmgStatus/tgmgStatus_frame.php new file mode 100755 index 0000000..6d399ad --- /dev/null +++ b/wxc2_omc/fault/tgmgStatus/tgmgStatus_frame.php @@ -0,0 +1,18 @@ + + + +"; + echo ""; +?> + + <body> + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + </body> + + + + + \ No newline at end of file diff --git a/wxc2_omc/fault/tgmgStatus/tgmgStatus_show.php b/wxc2_omc/fault/tgmgStatus/tgmgStatus_show.php new file mode 100755 index 0000000..4465705 --- /dev/null +++ b/wxc2_omc/fault/tgmgStatus/tgmgStatus_show.php @@ -0,0 +1,748 @@ + + + + + + +"; + echo ""; + echo ""; + echo "Status > NSS > TG&MG"; + echo ""; + echo ""; + $helpId="1.2.5"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; + echo "$strClear"; + echo ""; + echo ""; + echo ""; +} +adjust_title_tail(); +adjust_content_head(); + +//sunOs mozilla +if(stristr($HTTP_USER_AGENT,"sun") != false) +{ + //echo "Sun system
      "; + echo ""; + + //clear the status + if($_REQUEST['clear']== 1) + { + + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + + $db="OBJ_320"; + $clearParam=array("tgAvailabilityStatus","trunkAvailabilityStatus","trunkChannelInUse","ppStatus"); + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$db); + for($index=0;$index"; + $delRes = @mysqli_query($objDbConn,$delSql); + } + + + + $TrunkGroupHTML=""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Table Column Name + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + + + $MGHTML="
      TG Status
      TitleStatusProtocol
      Type
      Protocol
      Variant
      Trunk
      TitleMG IDMG PortStatusChannel In Use
      ------------------
      "; + $MGHTML=$MGHTML.""; + //Table Column Name + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + + echo $TrunkGroupHTML; + echo $MGHTML; + exit; + } + + + + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + /*******************************************************************************/ + /************** TrunkGroup x 256 ********************/ + /*******************************************************************************/ + //Get the count of TrunkGroup + $TrunkGroupCount=0; + $database="OBJ_320"; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$database); + + $selSql = "SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgIndex'"; + if($DEBUG)echo "
      selSql=$selSql"; + $selRes = @mysqli_query($objDbConn,$selSql); + $TrunkGroupCount=mysqli_num_rows($selRes); + echo mysqli_error($objDbConn); + //echo "count:$TrunkGroupCount
      "; + + $TrunkGroupInstanceNoList=""; + while($selRow = @mysqli_fetch_array($selRes)){ + $tmpSelRow=$selRow; + $TrunkGroupInstanceNoList=$TrunkGroupInstanceNoList.$selRow[instanceNo].","; + if($DEBUG)echo "
      TrunkGroupInstanceNoList=$TrunkGroupInstanceNoList"; + }; + + for($i=0;$i<=10;$i++){ + $level='level_'.$i; + $nextLevel='level_'.($i+1); + if($tmpSelRow[$level]!='0'&&$tmpSelRow[$nextLevel]==0) + break; + if($i==1) + $tmpLevelWhere='T1.'.$level.'='.$tmpSelRow[$level]; + else + $tmpLevelWhere=$tmpLevelWhere.' AND T1.'.$level.'='.$tmpSelRow[$level]; + } + if($DEBUG)echo "
      tmpLevelWhere=$tmpLevelWhere"; + + //Get the parameter of TrunkGroup + $index=0; + $database="OBJ_320"; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$database); + $selSql = "SELECT T1.*,T2.name_2 FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND $tmpLevelWhere "; + if($DEBUG)echo "
      selSql=$selSql"; + + if($TrunkGroupCount!=0) + { + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $instanceNo_tmp=$selRow[instanceNo].""; + //Title + if(stristr($selRow[name_2],'tgTitle')) + { + if(strlen($selRow[initValue])==0) + $TrunkGroup_Title[$instanceNo_tmp]="--"; + else + $TrunkGroup_Title[$instanceNo_tmp]=$selRow[initValue]; + + } + + //Status + else if(stristr($selRow[name_2],'tgAvailabilityStatus')) + { + $TrunkGroup_Status[$instanceNo_tmp]=$selRow[initValue]; + //echo "instanceNo $instanceNo_tmp status:{$TrunkGroup_Status[$instanceNo_tmp]}
      "; + } + //Protocol Type + else if(stristr($selRow[name_2],'tgProtocolType')) + { + $TrunkGroup_ProtocolType[$instanceNo_tmp]=$selRow[initValue]; + } + //Protocol Variant + else if(stristr($selRow[name_2],'tgProtocolVariant')) + { + $TrunkGroup_ProtocolVariant[$instanceNo_tmp]=$selRow[initValue]; + } + }while($selRow = @mysqli_fetch_array($selRes)); + } + + /******************** Trunk x 256 ****************************/ + //Get the count of Trunk + $TrunkCount=0; + $database="OBJ_320"; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$database); + $selSql = "SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='trunkIndex'"; + $selRes = @mysqli_query($objDbConn,$selSql); + $TrunkCount=mysqli_num_rows($selRes); + echo mysqli_error($objDbConn); + //echo "count:$TrunkCount
      "; + + $TrunkInstanceNoList=""; + while($selRow = @mysqli_fetch_array($selRes)){ + $tmpSelRow=$selRow; + $TrunkInstanceNoList=$TrunkInstanceNoList.$selRow[instanceNo].","; + if($DEBUG)echo "
      TrunkInstanceNoList=$TrunkInstanceNoList"; + }; + + for($i=0;$i<=10;$i++){ + $level='level_'.$i; + $nextLevel='level_'.($i+1); + if($tmpSelRow[$level]!='0'&&$tmpSelRow[$nextLevel]==0) + break; + if($i==1) + $tmpLevelWhere='T1.'.$level.'='.$tmpSelRow[$level]; + else + $tmpLevelWhere=$tmpLevelWhere.' AND T1.'.$level.'='.$tmpSelRow[$level]; + } + + //Get the parameter of Trunk + $database="OBJ_320"; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$database); + $selSql = "SELECT T1.*,T2.name_2 FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND $tmpLevelWhere "; + if($TrunkCount!=0) + { + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $instanceNo_tmp=$selRow[instanceNo]; + $t=explode(".",$instanceNo_tmp); + //index for tg + if(stristr($selRow[name_2],'trunkTgIndex')) + { + $Trunk_TrunkGroupIndex[$instanceNo_tmp]=$t[0]; + if(stristr($TrunkInstanceNoList,$instanceNo_tmp)!=FALSE) + $TrunkGroup_TrunkCount[$t[0]]++; + //echo "TrunkInstanceNoList=$TrunkInstanceNoList, find={$t[0]}, instanceNo_tmp=$instanceNo_tmp
      "; + //echo "tK:$instanceNo_tmp,{$Trunk_TrunkGroupIndex[$instanceNo_tmp]}
      "; + } + //Title + else if(stristr($selRow[name_2],'trunkTitle')) + { + if(strlen($selRow[initValue])==0) + $Trunk_Title[$instanceNo_tmp]="--"; + else + $Trunk_Title[$instanceNo_tmp]=$selRow[initValue]; + } + //Status + else if(stristr($selRow[name_2],'trunkAvailabilityStatus')) + { + $Trunk_Status[$instanceNo_tmp]=$selRow[initValue]; + } + //MG ID + else if(stristr($selRow[name_2],'trunkMgID')) + { + $Trunk_MGID[$instanceNo_tmp]=$selRow[initValue]; + } + //MG Port + else if(stristr($selRow[name_2],'trunkPortID')) + { + $Trunk_PortID[$instanceNo_tmp]=$selRow[initValue]; + } + //Channel In Use + else if(stristr($selRow[name_2],'trunkChannelInUse')) + { + $Trunk_ChannelInUse[$instanceNo_tmp]=$selRow[initValue]; + } + + }while($selRow = @mysqli_fetch_array($selRes)); + } + + /******************** Media Gate x 256 *****************************/ + //Get the count of MG + $MGCount=0; + $database="OBJ_320"; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$database); + $selSql = "SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='mgIndex'"; + $selRes = @mysqli_query($objDbConn,$selSql); + $MGCount=mysqli_num_rows($selRes); + echo mysqli_error($objDbConn); + //echo "MGCount:$MGCount
      "; + + $MGInstanceNoList=""; + while($selRow = @mysqli_fetch_array($selRes)){ + $tmpSelRow=$selRow; + if($selRow[instanceNo]!=0) + $MGInstanceNoList=$MGInstanceNoList.$selRow[instanceNo].","; + if($DEBUG) + echo "
      MGInstanceNoList=$MGInstanceNoList"; + }; + //echo "MGInstanceNoList:$MGInstanceNoList
      "; + + for($i=0;$i<=10;$i++){ + $level='level_'.$i; + $nextLevel='level_'.($i+1); + if($tmpSelRow[$level]!='0'&&$tmpSelRow[$nextLevel]==0) + break; + if($i==1) + $tmpLevelWhere='T1.'.$level.'='.$tmpSelRow[$level]; + else + $tmpLevelWhere=$tmpLevelWhere.' AND T1.'.$level.'='.$tmpSelRow[$level]; + } + + //Get the parameter of MG + $database="OBJ_320"; + $selSql = "SELECT T1.*,T2.name_2 FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND $tmpLevelWhere "; + if($MGCount!=0) + { + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $instanceNo_tmp=$selRow[instanceNo]; + + //ID + if(stristr($selRow[name_2],'mgIndex')) + { + if(strlen($selRow[initValue])==0) + $MG_ID[$instanceNo_tmp]="--"; + else + $MG_ID[$instanceNo_tmp]=$selRow[initValue]; + } + //Title + else if(stristr($selRow[name_2],'mgTitle')) + { + if(strlen($selRow[initValue])==0) + $MG_Title[$instanceNo_tmp]="--"; + else + $MG_Title[$instanceNo_tmp]=$selRow[initValue]; + } + //Domain Name + else if(stristr($selRow[name_2],'mgDomainName')) + { + if(strlen($selRow[initValue])==0) + $MG_DomainName[$instanceNo_tmp]="--"; + else + $MG_DomainName[$instanceNo_tmp]=$selRow[initValue]; + } + //IP + else if(stristr($selRow[name_2],'mgIp')) + { + if(strlen($selRow[initValue])==0) + $MG_IP[$instanceNo_tmp]="--"; + else + $MG_IP[$instanceNo_tmp]=$selRow[initValue]; + } + }while($selRow = @mysqli_fetch_array($selRes)); + } + + /******************* Port 256 x 32 ************************/ + //Get the count of Port + $PortCount=0; + $database="OBJ_320"; + $selSql = "SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='ppIndex'"; + $selRes = @mysqli_query($objDbConn,$selSql); + $PortCount=mysqli_num_rows($selRes); + echo mysqli_error($objDbConn); + //echo "PortCount:$PortCount
      "; + + $PortInstanceNoList=""; + while($selRow = @mysqli_fetch_array($selRes)){ + $tmpSelRow=$selRow; + $PortInstanceNoList=$PortInstanceNoList.$selRow[instanceNo].","; + }; + for($i=0;$i<=10;$i++){ + $level='level_'.$i; + $nextLevel='level_'.($i+1); + if($tmpSelRow[$level]!='0'&&$tmpSelRow[$nextLevel]==0) + break; + if($i==1) + $tmpLevelWhere='T1.'.$level.'='.$tmpSelRow[$level]; + else + $tmpLevelWhere=$tmpLevelWhere.' AND T1.'.$level.'='.$tmpSelRow[$level]; + } + //echo "PortInstanceNoList:$PortInstanceNoList
      "; + + //Get the parameter of Port + $database="OBJ_320"; + $selSql = "SELECT T1.*,T2.name_2 FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND $tmpLevelWhere "; + if($PortCount!=0) + { + $selRes = @mysqli_query($objDbConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + do + { + $instanceNo_tmp=$selRow[instanceNo]; + $t=explode(".",$instanceNo_tmp); + //index for mg + if(stristr($selRow[name_2],'ppMgIndex')) + { + $Port_MGIndex[$instanceNo_tmp]=$t[0]; + $Port_Index[$instanceNo_tmp]=$t[1]+0; + } + //Used flag + else if(stristr($selRow[name_2],'ppUsedFlag')) + { + $Port_UsedFlag[$instanceNo_tmp]=$selRow[initValue]; + } + //Status + else if(stristr($selRow[name_2],'ppStatus')) + { + $Port_Status[$instanceNo_tmp]=$selRow[initValue]; + } + + }while($selRow = @mysqli_fetch_array($selRes)); + } + + /*********** Test the data ************************/ + /* + echo "TG InstanceNo:$TrunkGroupInstanceNoList
      "; + echo "TK InstanceNo:$TrunkInstanceNoList
      "; + $insTg=explode(",",$TrunkGroupInstanceNoList); + //TG + for($i=0;$i<$TrunkGroupCount;$i++) + { + $instanceNo_tmp=$insTg[$i]; + + + echo "TrunkGroup InstanceNo:$instanceNo_tmp
      "; + echo " Title:{$TrunkGroup_Title[$instanceNo_tmp]}
      "; + echo " Status:{$TrunkGroup_Status[$instanceNo_tmp]}
      "; + echo " ProtocolType:{$TrunkGroup_ProtocolType[$instanceNo_tmp]}
      "; + echo " ProtocolVariant:{$TrunkGroup_ProtocolVariant[$instanceNo_tmp]}
      "; + echo " Trunk Count:{$TrunkGroup_TrunkCount[$instanceNo_tmp]}
      "; + + } + + + //Trunk + for($i=0;$i<$TrunkCount;$i++) + { + $instanceNo_tmp=$i; + echo "Trunk InstanceNo:{$Trunk_InstanceNo[$i]} index:$i
      "; + echo " Title:{$Trunk_Title[$instanceNo_tmp]}
      "; + echo " Status:{$AvailStatusLabel[$Trunk_Status[$instanceNo_tmp]]}
      "; + echo " MGID:{$Trunk_MGID[$instanceNo_tmp]}
      "; + echo " PortID:{$Trunk_PortID[$instanceNo_tmp]}
      "; + echo " CH In use:{$Trunk_ChannelInUse[$instanceNo_tmp]}
      "; + echo " Be to Tg:{$Trunk_TrunkGroupIndex[$instanceNo_tmp]}

      "; + } + */ + /* + $insMg=explode(",",$MGInstanceNoList); + for($i=0;$i<$MGCount;$i++) + { + $instance_tmp=$insMg[$i]; + echo "MG ID:{$MG_ID[$instance_tmp]}
      "; + echo " Title:{$MG_Title[$instance_tmp]}
      "; + echo " Domain:{$MG_DomainName[$instance_tmp]}
      "; + echo " IP::{$MG_IP[$instance_tmp]}
      "; + } + + echo "--------------------------------------------
      "; + $insP=explode(",",$PortInstanceNoList); + for($i=0;$i<$PortCount;$i++) + { + $instance_tmp=$insP[$i]; + echo "Port Index:{$Port_Index[$instance_tmp]}
      "; + echo "Port to MG:{$Port_MGIndex[$instance_tmp]}
      "; + echo "Port InstanceNo:{$insP[$i]}
      "; + echo "Port UsedFlag:{$Port_UsedFlag[$instance_tmp]}
      "; + echo "Port Status:{$Port_Status[$instance_tmp]}
      "; + } + */ + /************ Create the HTML for TrunkGroup Table ***************/ + //Table Title + $TrunkGroupHTML="
      MG Status
      MG IDTitleDomain NameIP AddressPort Status(0-31)
      ------------------------
      "; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Table Column Name + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + + //Table Content + $AvailStatusLabel=array(0=>"In Test",1=>"Failed",2=>"Power Off",3=>"Offline",4=>"Online",5=>"Dependency",6=>"Degraded",7=>"Not Installed","null"=>"--"); + $AvailStatusColor=array(0=>"#CECECE",1=>"#FF0000",2=>"#FF0000",3=>"#FF0000",4=>"#0000FF",5=>"#0000FF",6=>"#0000FF",7=>"#C6C6C6","null"=>"#CECECE"); + $ProtocolTypeLabel=getParamOptionArray("320","tgProtocolType",PARAM_NAME); + $ProtocolVariantLabel=getParamOptionArray("320","ProtocolVariant",PARAM_NAME); + + $insTg=explode(",",$TrunkGroupInstanceNoList); + //echo "TrunkCount:$TrunkCount
      "; + for($i=0;$i<$TrunkGroupCount;$i++) + { + $instanceNo_tmp=$insTg[$i]; + $trunkCount_tmp=$TrunkGroup_TrunkCount[$instanceNo_tmp]; + //echo "rowspan:$trunkCount_tmp
      "; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //title + $TrunkGroupHTML=$TrunkGroupHTML.""; + //status + if(strlen($TrunkGroup_Status[$instanceNo_tmp]) == 0) + { + $TrunkGroup_Status[$instanceNo_tmp]="null"; + } + $tmpColor=$AvailStatusColor[$TrunkGroup_Status[$instanceNo_tmp]]; + $tmpValue=$AvailStatusLabel[$TrunkGroup_Status[$instanceNo_tmp]]; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Type + $tmpValue=$ProtocolTypeLabel[$TrunkGroup_ProtocolType[$instanceNo_tmp]]; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Variant + $tmpValue=$ProtocolVariantLabel[$TrunkGroup_ProtocolVariant[$instanceNo_tmp]]; + $TrunkGroupHTML=$TrunkGroupHTML.""; + + $trunkCount_tmp=$trunkCount_tmp+0; + if($trunkCount_tmp==0) + { + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + } + + $insTk=explode(",",$TrunkInstanceNoList); + for($j=0;$j<$TrunkCount;$j++) + { + $inst=$insTk[$j]; + if($Trunk_TrunkGroupIndex[$inst]==$instanceNo_tmp) + { + //echo "$instanceNo_tmp
      "; + //title + $TrunkGroupHTML=$TrunkGroupHTML.""; + //MG ID + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Port ID + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Status + if(strlen($Trunk_Status[$inst]) == 0) + $Trunk_Status[$inst]="null"; + $tmpColor=$AvailStatusColor[$Trunk_Status[$inst]]; + $tmpValue=$AvailStatusLabel[$Trunk_Status[$inst]]; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Channel In Use + if(strlen($Trunk_ChannelInUse[$inst]) == 0) + $Trunk_ChannelInUse[$inst]=0; + $TrunkGroupHTML=$TrunkGroupHTML.""; + } + } + $TrunkGroupHTML=$TrunkGroupHTML.""; + + } + $TrunkGroupHTML=$TrunkGroupHTML."
      TG Status
      TitleStatusProtocol
      Type
      Protocol
      Variant
      Trunk
      TitleMG IDMG PortStatusChannel In Use
      ".$TrunkGroup_Title[$instanceNo_tmp]."".$tmpValue."".$tmpValue."
      ".$tmpValue."
      ----------
      ".$Trunk_Title[$inst]."".$Trunk_MGID[$inst]."".$Trunk_PortID[$inst]."".$tmpValue."".$Trunk_ChannelInUse[$inst]."
      "; + + /*********** Create the MG Table *************************/ + //Table Title + $MGHTML=""; + $MGHTML=$MGHTML.""; + //Table Column Name + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + + //Table Content + $PortStatusLabel=array(0=>"Offline",1=>"Online",2=>"--"); + $PortStatusColor=array(0=>"#FF0000",1=>"#0000FF",2=>"#CECECE"); + $insMg=explode(",",$MGInstanceNoList); + $insPo=explode(",",$PortInstanceNoList); + for($i=0;$i<$MGCount;$i++) + { + $insMg_tmp=$insMg[$i]; + $MGHTML=$MGHTML.""; + //MG ID + $MGHTML=$MGHTML.""; + //Title + $MGHTML=$MGHTML.""; + //Domain Name + $MGHTML=$MGHTML.""; + //IP Address + $MGHTML=$MGHTML.""; + + //initial + for($j=0;$j<32;$j++) + { + //no use + $Port_Status_Show[$j]=2; + } + + //get the state of ports for every MG + for($j=0;$j<$PortCount;$j++) + { + $insPo_tmp=$insPo[$j]; + if($Port_MGIndex[$insPo_tmp]==$MG_ID[$insMg_tmp]) + { + if($Port_UsedFlag[$insPo_tmp]==1) + $Port_Status_Show[$Port_Index[$insPo_tmp]]=$Port_Status[$insPo_tmp]; + /* + //in use + if($Port_UsedFlag[$insPo_tmp]==1) + { + //ready + if($Port_Status[$insPo_tmp]==1) + $Port_Status_Show[$Port_Index[$insPo_tmp]]=1; + //not ready + else + $Port_Status_Show[$Port_Index[$insPo_tmp]]=2; + } + //idle + else + { + //do nothing + } + */ + } + } + + //show the status for ports + for($j=0;$j<4;$j++) + { + for($k=0;$k<8;$k++) + { + if(strlen($Port_Status_Show[$j*8+$k]) == 0) + $Port_Status_Show[$j*8+$k]=2; + $tmpColor=$PortStatusColor[$Port_Status_Show[$j*8+$k]]; + $tmpValue=$PortStatusLabel[$Port_Status_Show[$j*8+$k]]; + $MGHTML=$MGHTML.""; + } + $MGHTML=$MGHTML.""; + } + } + $MGHTML=$MGHTML."
      MG Status
      MG IDTitleDomain NameIP AddressPort Status(0-31)
      ".$MG_ID[$insMg_tmp]."".$MG_Title[$insMg_tmp]."".$MG_DomainName[$insMg_tmp]."".$MG_IP[$insMg_tmp]."".$tmpValue."
      "; + + echo "$TrunkGroupHTML"; + echo "$MGHTML"; +} +//windowOs mozilla and IE +else +{ + + + //echo "other system
      "; + /*******************************************************/ + /************* TrunkGroup Table **************/ + echo "
      "; + echo "
      "; + echo "
      "; + /*******************************************************/ + /************* MediaGate Table **************/ + echo "
      "; + echo "
      "; + echo "
      "; + /*******************************************************/ + if($clear == 1) + { + + + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + + $db="OBJ_320"; + $clearParam=array("tgAvailabilityStatus","trunkAvailabilityStatus","trunkChannelInUse","ppStatus"); + for($index=0;$index"; + $delRes = @mysqli_query($objDbConn,$delSql); + } + + + + $TrunkGroupHTML=""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + //Table Column Name + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + $TrunkGroupHTML=$TrunkGroupHTML.""; + + + $MGHTML="
      TG Status
      TitleStatusProtocol
      Type
      Protocol
      Variant
      Trunk
      TitleMG IDMG PortStatusChannel In Use
      ------------------
      "; + $MGHTML=$MGHTML.""; + //Table Column Name + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + $MGHTML=$MGHTML.""; + + + echo "\n\n"; + + } +} + +adjust_content_tail(); + +?> diff --git a/wxc2_omc/frame/contents/default.php b/wxc2_omc/frame/contents/default.php new file mode 100755 index 0000000..e3fe9b7 --- /dev/null +++ b/wxc2_omc/frame/contents/default.php @@ -0,0 +1,64 @@ + 0 ?$level_1 :1); +//$myPrivilege = $user_info["permission"]; +$myPrivilege = 9; +$max_layer=5; +if($selectedLanguage == 'eng'){ + $menuName = "name_2"; + $menuRemark = "remark_2"; +}else{ + $menuName = "name_1"; + $menuRemark = "remark_1"; +} + +//menuTypeNo level_1 level_2 level_3 level_4 level_5 name_1 name_2 link_1 link_2 privilege remark_1 remark_2 +$menuSql = "SELECT $menuName,httpLink,$menuRemark + FROM sysMenuConf + WHERE menuTypeNo = '$OmcTypeNo' AND privilege <= '$myPrivilege' AND privilege >= '0' + AND level_1='$level_1' + ORDER BY level_1,level_2,level_3,level_4,level_5 + LIMIT 0,1 + "; +if($DEBUG) echo "
      menuSql = $menuSql"; +$menuResult = mysqli_query($pubConn,$menuSql); +echo mysqli_error($pubConn); +$menuRowsNum = mysqli_num_rows($menuResult); +$menuRow=mysqli_fetch_array($menuResult); +if($DEBUG) echo "
      menuName=$menuRow[$menuName]"; +if($DEBUG) echo "
      httpLink=$menuRow[httpLink]"; +if($DEBUG) echo "
      menuRemark=$menuRow[$menuRemark]"; +$httpLink=$menuRow['httpLink']; +if($DEBUG) exit(); +if(strlen($httpLink) > 5){ + echo " "; +}else{ + echo "Error httpLink"; +} +?> + \ No newline at end of file diff --git a/wxc2_omc/frame/downIndex/downIndex.php b/wxc2_omc/frame/downIndex/downIndex.php new file mode 100755 index 0000000..e68afcb --- /dev/null +++ b/wxc2_omc/frame/downIndex/downIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/frame/leftMenu/demoCheckbox.html b/wxc2_omc/frame/leftMenu/demoCheckbox.html new file mode 100755 index 0000000..86f7f2e --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoCheckbox.html @@ -0,0 +1,23 @@ + + +Checkbox Tree in JavaScript + + + + + + + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoCheckboxLeftFrame.html b/wxc2_omc/frame/leftMenu/demoCheckboxLeftFrame.html new file mode 100755 index 0000000..d4b6f73 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoCheckboxLeftFrame.html @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + +Checkbox Tree JavasScript + + + + + + +
      MG Status
      MG IDTitleDomain NameIP AddressPort Status(0-31)
      ------------------------
      Javascript Tree Menu
      + + + + + + + + +

      +
      + + diff --git a/wxc2_omc/frame/leftMenu/demoCheckboxNodes.js b/wxc2_omc/frame/leftMenu/demoCheckboxNodes.js new file mode 100755 index 0000000..643767c --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoCheckboxNodes.js @@ -0,0 +1,74 @@ +// You can find general instructions for this file here: +// http://www.treeview.net +// Intructions on how to add checkboxes to a tree are only provided in this file. + +USETEXTLINKS = 1 +STARTALLOPEN = 0 +HIGHLIGHT = 0 +PERSERVESTATE = 1 +USEICONS = 0 + +// In this case we want the whole tree to be built, +// even those branches that are closed. The reason is that +// otherwise some form elements might not be built at all +// before the user presses "Get Values" +BUILDALL = 1 + +// This configuration file is used to demontrate how to add checkboxes to your tree. +// If your site will not display checkboxes, picka a different configuration file as +// the example to follow and adapt + +// Notes: +// If you are going to set USEICONS = 1, then you will want to edit the gif files and +// remove the white space on the right + + +// Auxiliary functions for the contruction of the tree +// You will mcertainly want to change these functions for your own purposes + +// If you want to add checkboxes to the folder you will have to create a function +// similar to this one to do that and call it below in the tree construction section + +// These functions are directly realted with the additional JavaScript in the +// page holding the tree (demoCheckbox.html), where the form handling code +// resides +function generateCheckBox(parentfolderObject, itemLabel, checkBoxDOMId) { + var newObj; + + // Read the online documentation for an explanation of insDoc and gLnk, + // they are the base of the simplest Treeview trees + newObj = insDoc(parentfolderObject, gLnk("R", itemLabel, "javascript:parent.op()")) + + // The trick to show checkboxes in a tree that was made to display links is to + // use the prependHTML. There are general instructions about this member + // in the online documentation + newObj.prependHTML = "" +} + +// Function similar to the above, but instead of creating checkboxes, it creates +// radio buttons +function generateRadioB(parentfolderObject, itemLabel, checkBoxDOMId) { + var newObj; + + // Read the online documentation for an explanation of insDoc and gLnk, + // they are the base of the simplest Treeview trees + newObj = insDoc(parentfolderObject, gLnk("R", itemLabel, "javascript:parent.op()")) + + // The trick to show checkboxes in a tree that was made to display links is to + // use the prependHTML. There are general instructions about this member + // in the online documentation + newObj.prependHTML = "" +} + +// Construction of the tree + +foldersTree = gFld("Best time to try demos:", "demoCheckboxRightFrame.html") +foldersTree.treeID = "checkboxTree" +aux1 = insFld(foldersTree, gFld("Day of the week", "javascript:parent.op()")) +generateCheckBox(aux1, "Monday", "BOX1") +generateCheckBox(aux1, "Wednesday", "BOX2") +generateCheckBox(aux1, "Friday", "BOX3") +aux2 = insFld(foldersTree, gFld("Hour", "javascript:parent.op()")) +generateRadioB(aux2, "10AM", "RD1") +generateRadioB(aux2, "2PM", "RD2") +generateRadioB(aux2, "6PM", "RD3") diff --git a/wxc2_omc/frame/leftMenu/demoCheckboxRightFrame.html b/wxc2_omc/frame/leftMenu/demoCheckboxRightFrame.html new file mode 100755 index 0000000..95cc74e --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoCheckboxRightFrame.html @@ -0,0 +1,75 @@ + + + + + + + + + + + + +

      Showing checkboxes in a JavaScript tree

      + +The layout used for this demo is just one of many possible combinations of Treeview settings. If your site requires a different look-and-feel, check some of the things you can change: +
        +
      • Use one frameless page +
      • Link the items to pages. +
      • Display folder and document icons. +
      • Activate highlight of last selection. +
      • See the other demos in this site for more. +
      +

      + +Make your selection on the left frame and then press the Get Values button at the bottom. The selected options are shown in this frame. Notice that the Hour group in the tree contains radio buttons; only one can be pressed at a time. +

      + + +Days selected: + + +
      + +Time selected: + + + +

      +Instructions about how to configure a Treeview script to show checkboxes are provided in the source files demoCheckbox*.* available with the free download. +

      +Note: This demo runs on IE4+, Mozilla 0.9+, and NS6+. The old NS4.* handles all the other Treeview demos, but does not support the dynamic creation of form elements used by this checkbox tree. The new Opera7 also runs correctly all configurations of the regular Treeview but has one problem with the checkbox demo: it cannot query form elements that are not visible (closed branches.)

      + + diff --git a/wxc2_omc/frame/leftMenu/demoDynamic.html b/wxc2_omc/frame/leftMenu/demoDynamic.html new file mode 100755 index 0000000..4232083 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoDynamic.html @@ -0,0 +1,27 @@ + + +Treeview example + + + + + + + + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoFrameless.html b/wxc2_omc/frame/leftMenu/demoFrameless.html new file mode 100755 index 0000000..f1f1f75 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFrameless.html @@ -0,0 +1,138 @@ + + + + + + + +Frameless JavaScript Tree + + + + + + + + + + + + + + + + + + + + + + + + + Home + Demo + Download + Install + Visual Build + FAQ + Contact + + +
      +
      + + + + + +
      +
      +
      +
      + + + + + +
      JavaScript Tree Menu
      + + + + + + + + + +
      +
      +
      + + + +

      Frameless Layout For Treeview

      + This is the demo for the frameless configuration of the tree menu. For instructions on this type of layout and others check the install page.

      + + For simplification of the demo, most links on the tree actually reload the same page (only with different arguments for different pics.) In your site you will probably be linking to different pages, and many of them will also contain the tree. This way the user can jump from page to page clicking the tree.

      + + Note how some of the expandable/collapsible nodes have an hyperlink on their name (the folder itself can load a page) and others don't. The two types were mixed here for demo purposes. + +

      + + + diff --git a/wxc2_omc/frame/leftMenu/demoFramelessHili.html b/wxc2_omc/frame/leftMenu/demoFramelessHili.html new file mode 100755 index 0000000..a27ee49 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFramelessHili.html @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Home + Demo + Download + Install + Visual Build + FAQ + Contact + + +
      +
      + + + + + +
      +
      +
      +
      + + + + + +
      Javascript Tree Menu
      + + + + + + + + +
      +
      +
      + + + +

      Testing highlight of selected node (and show-all display)

      + This demo is based on the Frameless Layout demo. Check that demo first for more information on frameless layout configurations.

      + + Two options are being tested here: the selected-node highlight (HIGHLIGHT) and the opening of the tree with all branches expanded (STARTALLOPEN.) These variables can be set on or off independently of each other. They also work just as well with frame-based layouts. They are only being set on together here for the purposes of demonstration.

      + + Note how clicking on nodes that are themselves connected to pages (such as Unites States) highlights the text of the node. Clicking on the +/- sign or on a node that does not load a page (such as Europe) does not highlight it.

      + + Note also that, in the case of this demo, the page loads with all nodes visible. Some webmasters prefer it that way. Not recommended for very large trees. + +

      + + + diff --git a/wxc2_omc/frame/leftMenu/demoFramelessHiliNodes.js b/wxc2_omc/frame/leftMenu/demoFramelessHiliNodes.js new file mode 100755 index 0000000..eea0919 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFramelessHiliNodes.js @@ -0,0 +1,24 @@ +// You can find instructions for this file at http://www.treeview.net + +//Environment variables are usually set at the top of this file. +USETEXTLINKS = 1 +STARTALLOPEN = 1 +USEFRAMES = 0 +USEICONS = 0 +WRAPTEXT = 1 +PERSERVESTATE = 1 +HIGHLIGHT = 1 + + +foldersTree = gFld("Tree Options", "demoFramelessHili.html") + aux2 = insFld(foldersTree, gFld("United States", "demoFramelessHili.html?pic=%22beenthere_unitedstates%2Egif%22")) + insDoc(aux2, gLnk("S", "Boston", "demoFramelessHili.html?pic=%22beenthere_boston%2Ejpg%22")) + insDoc(aux2, gLnk("S", "Tiny pic of New York City", "demoFramelessHili.html?pic=%22beenthere_newyork%2Ejpg%22")) + insDoc(aux2, gLnk("S", "Washington", "demoFramelessHili.html?pic=%22beenthere_washington%2Ejpg%22")) + aux2 = insFld(foldersTree, gFld("Europe", "javascript:undefined")) + insDoc(aux2, gLnk("S", "London", "demoFramelessHili.html?pic=%22beenthere_london%2Ejpg%22")) + insDoc(aux2, gLnk("S", "Lisbon", "demoFramelessHili.html?pic=%22beenthere_lisbon%2Ejpg%22")) + +//Set this string if Treeview and other configuration files may also be loaded in the same session +foldersTree.treeID = "t2" + \ No newline at end of file diff --git a/wxc2_omc/frame/leftMenu/demoFramelessNodes.js b/wxc2_omc/frame/leftMenu/demoFramelessNodes.js new file mode 100755 index 0000000..cb42c12 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFramelessNodes.js @@ -0,0 +1,27 @@ +// You can find instructions for this file at http://www.treeview.net + +//Environment variables are usually set at the top of this file. +USETEXTLINKS = 1 +STARTALLOPEN = 0 +USEFRAMES = 0 +USEICONS = 0 +WRAPTEXT = 1 +PERSERVESTATE = 1 + + +foldersTree = gFld("Tree Options", "demoFrameless.html") + aux1 = insFld(foldersTree, gFld("Expand for example with pics and flags", "javascript:undefined")) + aux2 = insFld(aux1, gFld("United States", "demoFrameless.html?pic=%22beenthere_unitedstates%2Egif%22")) + insDoc(aux2, gLnk("S", "Boston", "demoFrameless.html?pic=%22beenthere_boston%2Ejpg%22")) + insDoc(aux2, gLnk("S", "Tiny pic of New York City", "demoFrameless.html?pic=%22beenthere_newyork%2Ejpg%22")) + insDoc(aux2, gLnk("S", "Washington", "demoFrameless.html?pic=%22beenthere_washington%2Ejpg%22")) + aux2 = insFld(aux1, gFld("Europe", "demoFrameless.html?pic=%22beenthere_europe%2Egif%22")) + insDoc(aux2, gLnk("S", "London", "demoFrameless.html?pic=%22beenthere_london%2Ejpg%22")) + insDoc(aux2, gLnk("S", "Lisbon", "demoFrameless.html?pic=%22beenthere_lisbon%2Ejpg%22")) + aux1 = insFld(foldersTree, gFld("Types of node", "javascript:undefined")) + aux2 = insFld(aux1, gFld("Expandable with link", "demoFrameless.html?pic=%22beenthere_europe%2Egif%22")) + insDoc(aux2, gLnk("S", "London", "demoFrameless.html?pic=%22beenthere_london%2Ejpg%22")) + aux2 = insFld(aux1, gFld("Expandable without link", "javascript:undefined")) + insDoc(aux2, gLnk("S", "NYC", "demoFrameless.html?pic=%22beenthere_newyork%2Ejpg%22")) + insDoc(aux1, gLnk("B", "Opens in new window", "http://www.treeview.net/treemenu/demopics/beenthere_pisa.jpg")) + \ No newline at end of file diff --git a/wxc2_omc/frame/leftMenu/demoFrameset.html b/wxc2_omc/frame/leftMenu/demoFrameset.html new file mode 100755 index 0000000..c263e62 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFrameset.html @@ -0,0 +1,27 @@ + + +Treeview example + + + + + + + + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoFramesetLeftFrame.html b/wxc2_omc/frame/leftMenu/demoFramesetLeftFrame.html new file mode 100755 index 0000000..5074a72 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFramesetLeftFrame.html @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoFramesetNodes.js b/wxc2_omc/frame/leftMenu/demoFramesetNodes.js new file mode 100755 index 0000000..92d09bf --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFramesetNodes.js @@ -0,0 +1,60 @@ +// You can find instructions for this file here: +// http://www.treeview.net + +// Decide if the names are links or just the icons +USETEXTLINKS = 1 //replace 0 with 1 for hyperlinks + +// Decide if the tree is to start all open or just showing the root folders +STARTALLOPEN = 0 //replace 0 with 1 to show the whole tree + +ICONPATH = '' //change if the gif's folder is a subfolder, for example: 'images/' + + +foldersTree = gFld("Treeview Demo", "demoFramesetRightFrame.html") + aux1 = insFld(foldersTree, gFld("Photos example", "demoFramesetRightFrame.html")) + aux2 = insFld(aux1, gFld("United States", "http://www.treeview.net/treemenu/demopics/beenthere_america.gif")) + insDoc(aux2, gLnk("R", "Boston", "http://www.treeview.net/treemenu/demopics/beenthere_boston.jpg")) + insDoc(aux2, gLnk("R", "New York", "http://www.treeview.net/treemenu/demopics/beenthere_newyork.jpg")) + insDoc(aux2, gLnk("R", "Washington", "http://www.treeview.net/treemenu/demopics/beenthere_washington.jpg")) + aux2 = insFld(aux1, gFld("Europe", "http://www.treeview.net/treemenu/demopics/beenthere_europe.gif")) + insDoc(aux2, gLnk("R", "Edinburgh", "http://www.treeview.net/treemenu/demopics/beenthere_edinburgh.gif")) + insDoc(aux2, gLnk("R", "London", "http://www.treeview.net/treemenu/demopics/beenthere_london.jpg")) + insDoc(aux2, gLnk("R", "Munich", "http://www.treeview.net/treemenu/demopics/beenthere_munich.jpg")) + insDoc(aux2, gLnk("R", "Athens", "http://www.treeview.net/treemenu/demopics/beenthere_athens.jpg")) + insDoc(aux2, gLnk("R", "Florence", "http://www.treeview.net/treemenu/demopics/beenthere_florence.jpg")) + //The next three links have their http protocol appended by the script + insDoc(aux2, gLnk("Rh", "Pisa", "www.treeview.net/treemenu/demopics/beenthere_pisa.jpg")) + insDoc(aux2, gLnk("Rh", "Rome", "www.treeview.net/treemenu/demopics/beenthere_rome.jpg")) + insDoc(aux2, gLnk("Rh", "Lisboa", "www.treeview.net/treemenu/demopics/beenthere_lisbon.jpg")) + aux3 = insFld(aux2, gFld("United States", "http://www.treeview.net/treemenu/demopics/beenthere_america.gif")) + insDoc(aux3, gLnk("R", "Boston", "http://www.treeview.net/treemenu/demopics/beenthere_boston.jpg")) + insDoc(aux3, gLnk("R", "New York", "http://www.treeview.net/treemenu/demopics/beenthere_newyork.jpg")) + insDoc(aux2, gLnk("Rh", "Lisboa", "www.treeview.net/treemenu/demopics/beenthere_lisbon.jpg")) + aux1 = insFld(foldersTree, gFld("3 Types of folders", "javascript:parent.op()")) + aux2 = insFld(aux1, gFld("Linked", "http://www.treeview.net/treemenu/demopics/beenthere_unitedstates.gif")) + insDoc(aux2, gLnk("R", "New York", "http://www.treeview.net/treemenu/demopics/beenthere_newyork.jpg")) + aux2 = insFld(aux1, gFld("Empty, linked", "http://www.treeview.net/treemenu/demopics/beenthere_europe.gif")) + //NS4 needs the href to be non-empty to process other events such as open folder, + //hence the op function + aux2 = insFld(aux1, gFld("Not linked", "javascript:parent.op()")) + insDoc(aux2, gLnk("R", "New York", "http://www.treeview.net/treemenu/demopics/beenthere_newyork.jpg")) + aux1 = insFld(foldersTree, gFld("Targets", "javascript:parent.op()")) + insDoc(aux1, gLnk("R", "Right frame", "http://www.treeview.net/treemenu/demopics/beenthere_edinburgh.gif")) + insDoc(aux1, gLnk("B", "New window", "http://www.treeview.net/treemenu/demopics/beenthere_london.jpg")) + insDoc(aux1, gLnk("T", "Whole window", "http://www.treeview.net/treemenu/demopics/beenthere_munich.jpg")) + insDoc(aux1, gLnk("S", "This frame", "http://www.treeview.net/treemenu/demopics/beenthere_athens.jpg")) + // The S target is required and the \\\ before the ' for string arguments are required too + // If you define your function in the parent frame, use javascript:parent.myfunc + insDoc(aux1, gLnk("S", "JavaScript link", "javascript:alert(\\\'This JavaScript link simply calls the built-in alert function,\\\\nbut you can define your own function.\\\')")) + + + aux1 = insFld(foldersTree, gFld("Other icons", "javascript:parent.op()")) + aux1.iconSrc = ICONPATH + "diffFolder.gif" + aux1.iconSrcClosed = ICONPATH + "diffFolder.gif" + docAux = insDoc(aux1, gLnk("B", "D/L Treeview", "http://www.treeview.net/treemenu/download.asp")) + docAux.iconSrc = ICONPATH + "diffDoc.gif" + + + aux1 = insFld(foldersTree, gFld("Formats", "javascript:parent.op()")) + docAux = insDoc(aux1, gLnk("R", "
      CSS Class
      ", "http://www.treeview.net/treemenu/demopics/beenthere_newyork.jpg")) + diff --git a/wxc2_omc/frame/leftMenu/demoFramesetRightFrame.html b/wxc2_omc/frame/leftMenu/demoFramesetRightFrame.html new file mode 100755 index 0000000..16cb61e --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFramesetRightFrame.html @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + +
      +

      Treeview

      + The JavaScript tree menu
      + Dynamic HTML (IE, NN, and more) +
      +      + + Awarded:
      + +
      + +

      +There are many possible ways of displaying and using the links in the tree, and they are all configurable by you. The four main folders in this demo try to show the more relevant variations for a frame-based layout

      + +Photos Example organizes photos and maps. You can put any other type of document in the tree: html, asp, movies, sounds, etc. You can even fill the outliner with data from a database or list the files and directories of a computer drive.

      + +Types of folders illustrates the two roles the folder plays in the Treeview script: it is used to contain others entries, but it may also be itself a link. Folders with entries inside show the +/- icon, which is used to expand it or collapse it. Clicking on the folder icon also expands its contents. For those "linked" folders, clicking on the folder icon not only expands it but also loads a page. "Europe" and "United States" in the "Photos example" are linked folders that, when clicked, load maps of the continents.

      + +Targets shows the different places where the linked page may be loaded: right frame, blank window, top frame (removes frameset), and the self frame. Additionaly, instead of an http link, you may have a node in the tree that calls a JavaScript function (a javascript: link.)

      + +Other icons is a folder with a customized icon, and so is the document inside. Your tree may use a custom icon uniformly (all folders with same icon, for example) or apply different icons on a node-by-node basis.

      + +Formats exemplifies ways of changing the default format used for the entries' text. The default font, size, etc. in the left frame are specified by CSS for the generic TD and A. For the "Formats" folder, the colors were specified by embedding HTML tags within the Title argument of the gLnk function itself. For the "CSS Class" link, the the name was enclosed in a <DIV> tag that points to a predefined style sheet class.

      + +
      +These combinations are just examples of what can be done with Treeview. Check the documentation and see how to set-up the tree for your particular site-navigation needs. + + +

      牋 How +to install the applet in your web site + + +

      + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoFuncs.html b/wxc2_omc/frame/leftMenu/demoFuncs.html new file mode 100755 index 0000000..f9fa9ec --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFuncs.html @@ -0,0 +1,42 @@ + + + + +Treeview example + + + + + + + + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoFuncsLeftFrame.html b/wxc2_omc/frame/leftMenu/demoFuncsLeftFrame.html new file mode 100755 index 0000000..a4b105a --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFuncsLeftFrame.html @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + +

      + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoFuncsMenu.html b/wxc2_omc/frame/leftMenu/demoFuncsMenu.html new file mode 100755 index 0000000..9583d5e --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFuncsMenu.html @@ -0,0 +1,102 @@ + + + + + + + + + + +
      +
      + + + + + +
      +
      + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoFuncsNodes.js b/wxc2_omc/frame/leftMenu/demoFuncsNodes.js new file mode 100755 index 0000000..f3e20d6 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFuncsNodes.js @@ -0,0 +1,46 @@ +// You can find instructions for this file here: +// http://www.treeview.net + +// Decide if the names are links or just the icons +USETEXTLINKS = 1 //replace 0 with 1 for hyperlinks + +// Decide if the tree is to start all open or just showing the root folders +STARTALLOPEN = 0 //replace 0 with 1 to show the whole tree + +HIGHLIGHT = 1 + +foldersTree = gFld("Flags and maps", "demoFuncsRightFrame.html") + aux1 = insFld(foldersTree, gFld("Flags", "javascript:parent.op()")) + insDoc(aux1, gLnk("R", "Germany", "http://www.treeview.net/treemenu/demopics/beenthere_germany.gif")) + insDoc(aux1, gLnk("R", "Greece", "http://www.treeview.net/treemenu/demopics/beenthere_greece.gif")) + insDoc(aux1, gLnk("R", "Italy", "http://www.treeview.net/treemenu/demopics/beenthere_italy.gif")) + insDoc(aux1, gLnk("R", "Portugal", "http://www.treeview.net/treemenu/demopics/beenthere_portugal.gif")) + insDoc(aux1, gLnk("R", "United Kingdom", "http://www.treeview.net/treemenu/demopics/beenthere_unitedkingdom.gif")) + insDoc(aux1, gLnk("R", "United States", "http://www.treeview.net/treemenu/demopics/beenthere_unitedstates.gif")) + aux1 = insFld(foldersTree, gFld("Maps", "javascript:parent.op()")) + insDoc(aux1, gLnk("R", "North America", "http://www.treeview.net/treemenu/demopics/beenthere_america.gif")) + insDoc(aux1, gLnk("R", "Europe", "http://www.treeview.net/treemenu/demopics/beenthere_europe.gif")) + + // If your tree instead of the regular http links has "javascript:function(arg)" + // links, and the type of the argument is string, special care is needed regarding + // the quotes and double quotes. Please use exactly the same kind of + // quotes or double quotes used in this example (they change from folder to document). + // Use the exact same number of backslashes for escaping the (double)quote + // characters, and pay attention not only to the (double)quotes surrouding the + // strings, but also to any (double)quote characters inside of that string + + // If you are going to use a frameless layout, you will need to move the functions + // exampleFunction and windowWithoutToolbar to the main page and change + // parent.functionname to window.functionname in this file + + //Note the "S" target in the first argument of gLnk + aux1 = insFld(foldersTree, gFld("javascript: links", "javascript:parent.op()")) + //Use \" to delimit your string arguments and \\\" inside + insDoc(aux1, gLnk("S", "Window w/o bars", "javascript:parent.windowWithoutToolbar(\\\'http://www.treeview.net/treemenu/demopics/beenthere_tuscany.gif\\\', 410, 415)")) + //Use \\\' to delimit your string arguments and \\\\\\' inside + //Double quote characters (") are not allowed in the string argument + insDoc(aux1, gLnk("S", "A js: doc", "javascript:parent.exampleFunction(\\\'Special care with: " and \\\\\\'\\\')")) + //Single quote characters (') are not allowed in the string argument but you can replace them with ' + aux2 = insFld(aux1, gFld("A js: folder", "javascript:parent.exampleFunction(\"Take special care with: \\\" and '\")")) + + diff --git a/wxc2_omc/frame/leftMenu/demoFuncsRightFrame.html b/wxc2_omc/frame/leftMenu/demoFuncsRightFrame.html new file mode 100755 index 0000000..052c486 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoFuncsRightFrame.html @@ -0,0 +1,39 @@ + + + + + + + + + +

      Treeview and programmable links

      + +JavaScript functions can be used to manipulate the Treeview. Conversely, tree nodes can be used to call JavaScript functions. Both cases are demonstrated in this example.

      + +How other pages can manipulate the tree

      + +The menu in the bottom-left corner shows four common options that manipulate the tree programmatically. Download the Treeview ZIP to get access to these functions and to all the code in this demo. The last two buttons in the menu activate nodes in the tree. With these functions it is possible to keep the tree in synch with what is happening in the right frame, by opening folders and selecting documents without any actual mouse click on them. Links and buttons to trigger these operations are more commonly found in the right frame than really in a menu.

      + +Imagine for example a tree of photos. You may want to let the user load a photo by clicking on the tree or by clicking on a "Next" link in the right frame, under the photo. This "Next" link should not only load the next photo in sequence like in a slideshow, but should also select the correspondent node in the tree. You can accomplish this by putting in the HREF of the "Next" link something similar to what is found in the onClick parameter of the "Load Map of Europe" button in this demo.

      + +Note that the "Load Map of Europe" button not only selects the node and loads the image, but it also scrolls down the tree frame. To see the scroll function working, we are going to do a couple of steps that are only really needed in this example because of the small dimensions of this tree. (You may want to first read through the whole next paragraph one time, and, later, to return to this page, press "Flags and maps".)

      + +Start by making the browser window really small such that, above the menu, you can only see the root folder and maybe the Flags folder; now press "Open All"; now press "Load Map of Europe". See how the tree scrolled down to show the Europe node?

      + +How a node can execute a function

      + +Instead of actual pages, images, etc., the folders and "documents" in the tree can be made to call JavaScript functions. Three of such links can be found inside the "javascript: links" folder. To learn more about exactly what is the definition of these functions and how they are called by the tree nodes, see the comments in the code of these pages.

      + +

      One simple case where a node needs to call a function is when the window for the new page should not have menu bar, status bar, etc. In this demo we created a generic function that takes the URL of the page to load as an argument, we and are using it with the "Window w/o bars" link.

      + +

      The other two links, including the final folder, simply call the built-in function "alert". They show how you can pass strings to functions and how it is possible for these strings to have the characters " and ' (which are reserved in JavaScript.) + +

      + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoLarge.html b/wxc2_omc/frame/leftMenu/demoLarge.html new file mode 100755 index 0000000..b400998 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoLarge.html @@ -0,0 +1,23 @@ + + +Treeview example + + + + + + + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoLargeLeftFrame.html b/wxc2_omc/frame/leftMenu/demoLargeLeftFrame.html new file mode 100755 index 0000000..440e368 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoLargeLeftFrame.html @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/wxc2_omc/frame/leftMenu/demoLargeNodes.js b/wxc2_omc/frame/leftMenu/demoLargeNodes.js new file mode 100755 index 0000000..46f05a3 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoLargeNodes.js @@ -0,0 +1,1185 @@ +// You can find instructions for this file here: +// http://www.treeview.net + +USETEXTLINKS = 1 +STARTALLOPEN = 0 +HIGHLIGHT = 1 +PERSERVESTATE = 1 + + +// If you don't have server-side coding, make your nodes.js file similar to the others +// in the ZIP, not this one. +// Without a database, the auxiliary functions defined and used here are the only way +// I am able to test the "PERSERVESTATE through .xID keys" functionality. +// Your server side code will do something similar, but without the need to these functions. +// It will simply output nodes with two lines of statements, one for insDoc or insFld call, +// the other with the assignment of xID to an actual database ID +// See online instructions for limitations on the use of xID +var counterI = 0 +function insFldX(parentOb, childOb) +{ + childOb.xID = 'X' + counterI; + counterI--; + return insFld(parentOb, childOb) +} +function insDocX(parentOb, childOb) +{ + childOb.xID = 'Y' + counterI; + counterI--; + return insDoc(parentOb, childOb) +} +//In my QA tests I use this function to test what happens in terms of PERSERVESTATE +//when the structure of the tree changes +function insertExtraFolder(parentOb) +{ + auxxx1 = insFld(parentOb, gFld("insert", "http://www.treeview.net/treemenu/demopics/beenthere_london.jpg")) + auxxx1.xID = "gg1" + auxxx2 = insDoc(auxxx1, gLnk("R", "Ben", "http://www.treeview.net/treemenu/demopics/beenthere_london.jpg")) + auxxx2.xID = "gg2" +} + +foldersTree = gFld("Three years", "demoLargeRightFrame.html") +foldersTree.treeID = "big" +foldersTree.xID = 'X0'; +counterI--; +//insertExtraFolder(foldersTree) +aux2000 = insFldX(foldersTree, gFld("2000", "javascript:parent.op()")) +aux20001 = insFldX(aux2000, gFld("January", "javascript:parent.op()")) +//insertExtraFolder(aux20001) +insDocX(aux20001, gLnk("R", "January 1, 2000", "demoLargeRightFrame.html?January+1%2C+2000")) +insDocX(aux20001, gLnk("R", "January 2, 2000", "demoLargeRightFrame.html?January+2%2C+2000")) +insDocX(aux20001, gLnk("R", "January 3, 2000", "demoLargeRightFrame.html?January+3%2C+2000")) +insDocX(aux20001, gLnk("R", "January 4, 2000", "demoLargeRightFrame.html?January+4%2C+2000")) +insDocX(aux20001, gLnk("R", "January 5, 2000", "demoLargeRightFrame.html?January+5%2C+2000")) +insDocX(aux20001, gLnk("R", "January 6, 2000", "demoLargeRightFrame.html?January+6%2C+2000")) +insDocX(aux20001, gLnk("R", "January 7, 2000", "demoLargeRightFrame.html?January+7%2C+2000")) +insDocX(aux20001, gLnk("R", "January 8, 2000", "demoLargeRightFrame.html?January+8%2C+2000")) +insDocX(aux20001, gLnk("R", "January 9, 2000", "demoLargeRightFrame.html?January+9%2C+2000")) +insDocX(aux20001, gLnk("R", "January 10, 2000", "demoLargeRightFrame.html?January+10%2C+2000")) +insDocX(aux20001, gLnk("R", "January 11, 2000", "demoLargeRightFrame.html?January+11%2C+2000")) +insDocX(aux20001, gLnk("R", "January 12, 2000", "demoLargeRightFrame.html?January+12%2C+2000")) +insDocX(aux20001, gLnk("R", "January 13, 2000", "demoLargeRightFrame.html?January+13%2C+2000")) +insDocX(aux20001, gLnk("R", "January 14, 2000", "demoLargeRightFrame.html?January+14%2C+2000")) +insDocX(aux20001, gLnk("R", "January 15, 2000", "demoLargeRightFrame.html?January+15%2C+2000")) +insDocX(aux20001, gLnk("R", "January 16, 2000", "demoLargeRightFrame.html?January+16%2C+2000")) +insDocX(aux20001, gLnk("R", "January 17, 2000", "demoLargeRightFrame.html?January+17%2C+2000")) +insDocX(aux20001, gLnk("R", "January 18, 2000", "demoLargeRightFrame.html?January+18%2C+2000")) +insDocX(aux20001, gLnk("R", "January 19, 2000", "demoLargeRightFrame.html?January+19%2C+2000")) +insDocX(aux20001, gLnk("R", "January 20, 2000", "demoLargeRightFrame.html?January+20%2C+2000")) +insDocX(aux20001, gLnk("R", "January 21, 2000", "demoLargeRightFrame.html?January+21%2C+2000")) +insDocX(aux20001, gLnk("R", "January 22, 2000", "demoLargeRightFrame.html?January+22%2C+2000")) +insDocX(aux20001, gLnk("R", "January 23, 2000", "demoLargeRightFrame.html?January+23%2C+2000")) +insDocX(aux20001, gLnk("R", "January 24, 2000", "demoLargeRightFrame.html?January+24%2C+2000")) +insDocX(aux20001, gLnk("R", "January 25, 2000", "demoLargeRightFrame.html?January+25%2C+2000")) +insDocX(aux20001, gLnk("R", "January 26, 2000", "demoLargeRightFrame.html?January+26%2C+2000")) +insDocX(aux20001, gLnk("R", "January 27, 2000", "demoLargeRightFrame.html?January+27%2C+2000")) +insDocX(aux20001, gLnk("R", "January 28, 2000", "demoLargeRightFrame.html?January+28%2C+2000")) +insDocX(aux20001, gLnk("R", "January 29, 2000", "demoLargeRightFrame.html?January+29%2C+2000")) +insDocX(aux20001, gLnk("R", "January 30, 2000", "demoLargeRightFrame.html?January+30%2C+2000")) +insDocX(aux20001, gLnk("R", "January 31, 2000", "demoLargeRightFrame.html?January+31%2C+2000")) +aux20002 = insFldX(aux2000, gFld("February", "javascript:parent.op()")) +aux20002.maySelect = false +id = insDocX(aux20002, gLnk("R", "February 1, 2000", "demoLargeRightFrame.html?February+1%2C+2000")) +id.maySelect = false +insDocX(aux20002, gLnk("R", "February 2, 2000", "demoLargeRightFrame.html?February+2%2C+2000")) +insDocX(aux20002, gLnk("R", "February 3, 2000", "demoLargeRightFrame.html?February+3%2C+2000")) +insDocX(aux20002, gLnk("R", "February 4, 2000", "demoLargeRightFrame.html?February+4%2C+2000")) +insDocX(aux20002, gLnk("R", "February 5, 2000", "demoLargeRightFrame.html?February+5%2C+2000")) +insDocX(aux20002, gLnk("R", "February 6, 2000", "demoLargeRightFrame.html?February+6%2C+2000")) +insDocX(aux20002, gLnk("R", "February 7, 2000", "demoLargeRightFrame.html?February+7%2C+2000")) +insDocX(aux20002, gLnk("R", "February 8, 2000", "demoLargeRightFrame.html?February+8%2C+2000")) +insDocX(aux20002, gLnk("R", "February 9, 2000", "demoLargeRightFrame.html?February+9%2C+2000")) +insDocX(aux20002, gLnk("R", "February 10, 2000", "demoLargeRightFrame.html?February+10%2C+2000")) +insDocX(aux20002, gLnk("R", "February 11, 2000", "demoLargeRightFrame.html?February+11%2C+2000")) +insDocX(aux20002, gLnk("R", "February 12, 2000", "demoLargeRightFrame.html?February+12%2C+2000")) +insDocX(aux20002, gLnk("R", "February 13, 2000", "demoLargeRightFrame.html?February+13%2C+2000")) +insDocX(aux20002, gLnk("R", "February 14, 2000", "demoLargeRightFrame.html?February+14%2C+2000")) +insDocX(aux20002, gLnk("R", "February 15, 2000", "demoLargeRightFrame.html?February+15%2C+2000")) +insDocX(aux20002, gLnk("R", "February 16, 2000", "demoLargeRightFrame.html?February+16%2C+2000")) +insDocX(aux20002, gLnk("R", "February 17, 2000", "demoLargeRightFrame.html?February+17%2C+2000")) +insDocX(aux20002, gLnk("R", "February 18, 2000", "demoLargeRightFrame.html?February+18%2C+2000")) +insDocX(aux20002, gLnk("R", "February 19, 2000", "demoLargeRightFrame.html?February+19%2C+2000")) +insDocX(aux20002, gLnk("R", "February 20, 2000", "demoLargeRightFrame.html?February+20%2C+2000")) +insDocX(aux20002, gLnk("R", "February 21, 2000", "demoLargeRightFrame.html?February+21%2C+2000")) +insDocX(aux20002, gLnk("R", "February 22, 2000", "demoLargeRightFrame.html?February+22%2C+2000")) +insDocX(aux20002, gLnk("R", "February 23, 2000", "demoLargeRightFrame.html?February+23%2C+2000")) +insDocX(aux20002, gLnk("R", "February 24, 2000", "demoLargeRightFrame.html?February+24%2C+2000")) +insDocX(aux20002, gLnk("R", "February 25, 2000", "demoLargeRightFrame.html?February+25%2C+2000")) +insDocX(aux20002, gLnk("R", "February 26, 2000", "demoLargeRightFrame.html?February+26%2C+2000")) +insDocX(aux20002, gLnk("R", "February 27, 2000", "demoLargeRightFrame.html?February+27%2C+2000")) +insDocX(aux20002, gLnk("R", "February 28, 2000", "demoLargeRightFrame.html?February+28%2C+2000")) +insDocX(aux20002, gLnk("R", "February 29, 2000", "demoLargeRightFrame.html?February+29%2C+2000")) +aux20003 = insFldX(aux2000, gFld("March", "javascript:parent.op()")) +insDocX(aux20003, gLnk("R", "March 1, 2000", "demoLargeRightFrame.html?March+1%2C+2000")) +insDocX(aux20003, gLnk("R", "March 2, 2000", "demoLargeRightFrame.html?March+2%2C+2000")) +insDocX(aux20003, gLnk("R", "March 3, 2000", "demoLargeRightFrame.html?March+3%2C+2000")) +insDocX(aux20003, gLnk("R", "March 4, 2000", "demoLargeRightFrame.html?March+4%2C+2000")) +insDocX(aux20003, gLnk("R", "March 5, 2000", "demoLargeRightFrame.html?March+5%2C+2000")) +insDocX(aux20003, gLnk("R", "March 6, 2000", "demoLargeRightFrame.html?March+6%2C+2000")) +insDocX(aux20003, gLnk("R", "March 7, 2000", "demoLargeRightFrame.html?March+7%2C+2000")) +insDocX(aux20003, gLnk("R", "March 8, 2000", "demoLargeRightFrame.html?March+8%2C+2000")) +insDocX(aux20003, gLnk("R", "March 9, 2000", "demoLargeRightFrame.html?March+9%2C+2000")) +insDocX(aux20003, gLnk("R", "March 10, 2000", "demoLargeRightFrame.html?March+10%2C+2000")) +insDocX(aux20003, gLnk("R", "March 11, 2000", "demoLargeRightFrame.html?March+11%2C+2000")) +insDocX(aux20003, gLnk("R", "March 12, 2000", "demoLargeRightFrame.html?March+12%2C+2000")) +insDocX(aux20003, gLnk("R", "March 13, 2000", "demoLargeRightFrame.html?March+13%2C+2000")) +insDocX(aux20003, gLnk("R", "March 14, 2000", "demoLargeRightFrame.html?March+14%2C+2000")) +insDocX(aux20003, gLnk("R", "March 15, 2000", "demoLargeRightFrame.html?March+15%2C+2000")) +insDocX(aux20003, gLnk("R", "March 16, 2000", "demoLargeRightFrame.html?March+16%2C+2000")) +insDocX(aux20003, gLnk("R", "March 17, 2000", "demoLargeRightFrame.html?March+17%2C+2000")) +insDocX(aux20003, gLnk("R", "March 18, 2000", "demoLargeRightFrame.html?March+18%2C+2000")) +insDocX(aux20003, gLnk("R", "March 19, 2000", "demoLargeRightFrame.html?March+19%2C+2000")) +insDocX(aux20003, gLnk("R", "March 20, 2000", "demoLargeRightFrame.html?March+20%2C+2000")) +insDocX(aux20003, gLnk("R", "March 21, 2000", "demoLargeRightFrame.html?March+21%2C+2000")) +insDocX(aux20003, gLnk("R", "March 22, 2000", "demoLargeRightFrame.html?March+22%2C+2000")) +insDocX(aux20003, gLnk("R", "March 23, 2000", "demoLargeRightFrame.html?March+23%2C+2000")) +insDocX(aux20003, gLnk("R", "March 24, 2000", "demoLargeRightFrame.html?March+24%2C+2000")) +insDocX(aux20003, gLnk("R", "March 25, 2000", "demoLargeRightFrame.html?March+25%2C+2000")) +insDocX(aux20003, gLnk("R", "March 26, 2000", "demoLargeRightFrame.html?March+26%2C+2000")) +insDocX(aux20003, gLnk("R", "March 27, 2000", "demoLargeRightFrame.html?March+27%2C+2000")) +insDocX(aux20003, gLnk("R", "March 28, 2000", "demoLargeRightFrame.html?March+28%2C+2000")) +insDocX(aux20003, gLnk("R", "March 29, 2000", "demoLargeRightFrame.html?March+29%2C+2000")) +insDocX(aux20003, gLnk("R", "March 30, 2000", "demoLargeRightFrame.html?March+30%2C+2000")) +insDocX(aux20003, gLnk("R", "March 31, 2000", "demoLargeRightFrame.html?March+31%2C+2000")) +aux20004 = insFldX(aux2000, gFld("April", "javascript:parent.op()")) +insDocX(aux20004, gLnk("R", "April 1, 2000", "demoLargeRightFrame.html?April+1%2C+2000")) +insDocX(aux20004, gLnk("R", "April 2, 2000", "demoLargeRightFrame.html?April+2%2C+2000")) +insDocX(aux20004, gLnk("R", "April 3, 2000", "demoLargeRightFrame.html?April+3%2C+2000")) +insDocX(aux20004, gLnk("R", "April 4, 2000", "demoLargeRightFrame.html?April+4%2C+2000")) +insDocX(aux20004, gLnk("R", "April 5, 2000", "demoLargeRightFrame.html?April+5%2C+2000")) +insDocX(aux20004, gLnk("R", "April 6, 2000", "demoLargeRightFrame.html?April+6%2C+2000")) +insDocX(aux20004, gLnk("R", "April 7, 2000", "demoLargeRightFrame.html?April+7%2C+2000")) +insDocX(aux20004, gLnk("R", "April 8, 2000", "demoLargeRightFrame.html?April+8%2C+2000")) +insDocX(aux20004, gLnk("R", "April 9, 2000", "demoLargeRightFrame.html?April+9%2C+2000")) +insDocX(aux20004, gLnk("R", "April 10, 2000", "demoLargeRightFrame.html?April+10%2C+2000")) +insDocX(aux20004, gLnk("R", "April 11, 2000", "demoLargeRightFrame.html?April+11%2C+2000")) +insDocX(aux20004, gLnk("R", "April 12, 2000", "demoLargeRightFrame.html?April+12%2C+2000")) +insDocX(aux20004, gLnk("R", "April 13, 2000", "demoLargeRightFrame.html?April+13%2C+2000")) +insDocX(aux20004, gLnk("R", "April 14, 2000", "demoLargeRightFrame.html?April+14%2C+2000")) +insDocX(aux20004, gLnk("R", "April 15, 2000", "demoLargeRightFrame.html?April+15%2C+2000")) +insDocX(aux20004, gLnk("R", "April 16, 2000", "demoLargeRightFrame.html?April+16%2C+2000")) +insDocX(aux20004, gLnk("R", "April 17, 2000", "demoLargeRightFrame.html?April+17%2C+2000")) +insDocX(aux20004, gLnk("R", "April 18, 2000", "demoLargeRightFrame.html?April+18%2C+2000")) +insDocX(aux20004, gLnk("R", "April 19, 2000", "demoLargeRightFrame.html?April+19%2C+2000")) +insDocX(aux20004, gLnk("R", "April 20, 2000", "demoLargeRightFrame.html?April+20%2C+2000")) +insDocX(aux20004, gLnk("R", "April 21, 2000", "demoLargeRightFrame.html?April+21%2C+2000")) +insDocX(aux20004, gLnk("R", "April 22, 2000", "demoLargeRightFrame.html?April+22%2C+2000")) +insDocX(aux20004, gLnk("R", "April 23, 2000", "demoLargeRightFrame.html?April+23%2C+2000")) +insDocX(aux20004, gLnk("R", "April 24, 2000", "demoLargeRightFrame.html?April+24%2C+2000")) +insDocX(aux20004, gLnk("R", "April 25, 2000", "demoLargeRightFrame.html?April+25%2C+2000")) +insDocX(aux20004, gLnk("R", "April 26, 2000", "demoLargeRightFrame.html?April+26%2C+2000")) +insDocX(aux20004, gLnk("R", "April 27, 2000", "demoLargeRightFrame.html?April+27%2C+2000")) +insDocX(aux20004, gLnk("R", "April 28, 2000", "demoLargeRightFrame.html?April+28%2C+2000")) +insDocX(aux20004, gLnk("R", "April 29, 2000", "demoLargeRightFrame.html?April+29%2C+2000")) +insDocX(aux20004, gLnk("R", "April 30, 2000", "demoLargeRightFrame.html?April+30%2C+2000")) +aux20005 = insFldX(aux2000, gFld("May", "javascript:parent.op()")) +insDocX(aux20005, gLnk("R", "May 1, 2000", "demoLargeRightFrame.html?May+1%2C+2000")) +insDocX(aux20005, gLnk("R", "May 2, 2000", "demoLargeRightFrame.html?May+2%2C+2000")) +insDocX(aux20005, gLnk("R", "May 3, 2000", "demoLargeRightFrame.html?May+3%2C+2000")) +insDocX(aux20005, gLnk("R", "May 4, 2000", "demoLargeRightFrame.html?May+4%2C+2000")) +insDocX(aux20005, gLnk("R", "May 5, 2000", "demoLargeRightFrame.html?May+5%2C+2000")) +insDocX(aux20005, gLnk("R", "May 6, 2000", "demoLargeRightFrame.html?May+6%2C+2000")) +insDocX(aux20005, gLnk("R", "May 7, 2000", "demoLargeRightFrame.html?May+7%2C+2000")) +insDocX(aux20005, gLnk("R", "May 8, 2000", "demoLargeRightFrame.html?May+8%2C+2000")) +insDocX(aux20005, gLnk("R", "May 9, 2000", "demoLargeRightFrame.html?May+9%2C+2000")) +insDocX(aux20005, gLnk("R", "May 10, 2000", "demoLargeRightFrame.html?May+10%2C+2000")) +insDocX(aux20005, gLnk("R", "May 11, 2000", "demoLargeRightFrame.html?May+11%2C+2000")) +insDocX(aux20005, gLnk("R", "May 12, 2000", "demoLargeRightFrame.html?May+12%2C+2000")) +insDocX(aux20005, gLnk("R", "May 13, 2000", "demoLargeRightFrame.html?May+13%2C+2000")) +insDocX(aux20005, gLnk("R", "May 14, 2000", "demoLargeRightFrame.html?May+14%2C+2000")) +insDocX(aux20005, gLnk("R", "May 15, 2000", "demoLargeRightFrame.html?May+15%2C+2000")) +insDocX(aux20005, gLnk("R", "May 16, 2000", "demoLargeRightFrame.html?May+16%2C+2000")) +insDocX(aux20005, gLnk("R", "May 17, 2000", "demoLargeRightFrame.html?May+17%2C+2000")) +insDocX(aux20005, gLnk("R", "May 18, 2000", "demoLargeRightFrame.html?May+18%2C+2000")) +insDocX(aux20005, gLnk("R", "May 19, 2000", "demoLargeRightFrame.html?May+19%2C+2000")) +insDocX(aux20005, gLnk("R", "May 20, 2000", "demoLargeRightFrame.html?May+20%2C+2000")) +insDocX(aux20005, gLnk("R", "May 21, 2000", "demoLargeRightFrame.html?May+21%2C+2000")) +insDocX(aux20005, gLnk("R", "May 22, 2000", "demoLargeRightFrame.html?May+22%2C+2000")) +insDocX(aux20005, gLnk("R", "May 23, 2000", "demoLargeRightFrame.html?May+23%2C+2000")) +insDocX(aux20005, gLnk("R", "May 24, 2000", "demoLargeRightFrame.html?May+24%2C+2000")) +insDocX(aux20005, gLnk("R", "May 25, 2000", "demoLargeRightFrame.html?May+25%2C+2000")) +insDocX(aux20005, gLnk("R", "May 26, 2000", "demoLargeRightFrame.html?May+26%2C+2000")) +insDocX(aux20005, gLnk("R", "May 27, 2000", "demoLargeRightFrame.html?May+27%2C+2000")) +insDocX(aux20005, gLnk("R", "May 28, 2000", "demoLargeRightFrame.html?May+28%2C+2000")) +insDocX(aux20005, gLnk("R", "May 29, 2000", "demoLargeRightFrame.html?May+29%2C+2000")) +insDocX(aux20005, gLnk("R", "May 30, 2000", "demoLargeRightFrame.html?May+30%2C+2000")) +insDocX(aux20005, gLnk("R", "May 31, 2000", "demoLargeRightFrame.html?May+31%2C+2000")) +aux20006 = insFldX(aux2000, gFld("June", "javascript:parent.op()")) +insDocX(aux20006, gLnk("R", "June 1, 2000", "demoLargeRightFrame.html?June+1%2C+2000")) +insDocX(aux20006, gLnk("R", "June 2, 2000", "demoLargeRightFrame.html?June+2%2C+2000")) +insDocX(aux20006, gLnk("R", "June 3, 2000", "demoLargeRightFrame.html?June+3%2C+2000")) +insDocX(aux20006, gLnk("R", "June 4, 2000", "demoLargeRightFrame.html?June+4%2C+2000")) +insDocX(aux20006, gLnk("R", "June 5, 2000", "demoLargeRightFrame.html?June+5%2C+2000")) +insDocX(aux20006, gLnk("R", "June 6, 2000", "demoLargeRightFrame.html?June+6%2C+2000")) +insDocX(aux20006, gLnk("R", "June 7, 2000", "demoLargeRightFrame.html?June+7%2C+2000")) +insDocX(aux20006, gLnk("R", "June 8, 2000", "demoLargeRightFrame.html?June+8%2C+2000")) +insDocX(aux20006, gLnk("R", "June 9, 2000", "demoLargeRightFrame.html?June+9%2C+2000")) +insDocX(aux20006, gLnk("R", "June 10, 2000", "demoLargeRightFrame.html?June+10%2C+2000")) +insDocX(aux20006, gLnk("R", "June 11, 2000", "demoLargeRightFrame.html?June+11%2C+2000")) +insDocX(aux20006, gLnk("R", "June 12, 2000", "demoLargeRightFrame.html?June+12%2C+2000")) +insDocX(aux20006, gLnk("R", "June 13, 2000", "demoLargeRightFrame.html?June+13%2C+2000")) +insDocX(aux20006, gLnk("R", "June 14, 2000", "demoLargeRightFrame.html?June+14%2C+2000")) +insDocX(aux20006, gLnk("R", "June 15, 2000", "demoLargeRightFrame.html?June+15%2C+2000")) +insDocX(aux20006, gLnk("R", "June 16, 2000", "demoLargeRightFrame.html?June+16%2C+2000")) +insDocX(aux20006, gLnk("R", "June 17, 2000", "demoLargeRightFrame.html?June+17%2C+2000")) +insDocX(aux20006, gLnk("R", "June 18, 2000", "demoLargeRightFrame.html?June+18%2C+2000")) +insDocX(aux20006, gLnk("R", "June 19, 2000", "demoLargeRightFrame.html?June+19%2C+2000")) +insDocX(aux20006, gLnk("R", "June 20, 2000", "demoLargeRightFrame.html?June+20%2C+2000")) +insDocX(aux20006, gLnk("R", "June 21, 2000", "demoLargeRightFrame.html?June+21%2C+2000")) +insDocX(aux20006, gLnk("R", "June 22, 2000", "demoLargeRightFrame.html?June+22%2C+2000")) +insDocX(aux20006, gLnk("R", "June 23, 2000", "demoLargeRightFrame.html?June+23%2C+2000")) +insDocX(aux20006, gLnk("R", "June 24, 2000", "demoLargeRightFrame.html?June+24%2C+2000")) +insDocX(aux20006, gLnk("R", "June 25, 2000", "demoLargeRightFrame.html?June+25%2C+2000")) +insDocX(aux20006, gLnk("R", "June 26, 2000", "demoLargeRightFrame.html?June+26%2C+2000")) +insDocX(aux20006, gLnk("R", "June 27, 2000", "demoLargeRightFrame.html?June+27%2C+2000")) +insDocX(aux20006, gLnk("R", "June 28, 2000", "demoLargeRightFrame.html?June+28%2C+2000")) +insDocX(aux20006, gLnk("R", "June 29, 2000", "demoLargeRightFrame.html?June+29%2C+2000")) +insDocX(aux20006, gLnk("R", "June 30, 2000", "demoLargeRightFrame.html?June+30%2C+2000")) +aux20007 = insFldX(aux2000, gFld("July", "javascript:parent.op()")) +insDocX(aux20007, gLnk("R", "July 1, 2000", "demoLargeRightFrame.html?July+1%2C+2000")) +insDocX(aux20007, gLnk("R", "July 2, 2000", "demoLargeRightFrame.html?July+2%2C+2000")) +insDocX(aux20007, gLnk("R", "July 3, 2000", "demoLargeRightFrame.html?July+3%2C+2000")) +insDocX(aux20007, gLnk("R", "July 4, 2000", "demoLargeRightFrame.html?July+4%2C+2000")) +insDocX(aux20007, gLnk("R", "July 5, 2000", "demoLargeRightFrame.html?July+5%2C+2000")) +insDocX(aux20007, gLnk("R", "July 6, 2000", "demoLargeRightFrame.html?July+6%2C+2000")) +insDocX(aux20007, gLnk("R", "July 7, 2000", "demoLargeRightFrame.html?July+7%2C+2000")) +insDocX(aux20007, gLnk("R", "July 8, 2000", "demoLargeRightFrame.html?July+8%2C+2000")) +insDocX(aux20007, gLnk("R", "July 9, 2000", "demoLargeRightFrame.html?July+9%2C+2000")) +insDocX(aux20007, gLnk("R", "July 10, 2000", "demoLargeRightFrame.html?July+10%2C+2000")) +insDocX(aux20007, gLnk("R", "July 11, 2000", "demoLargeRightFrame.html?July+11%2C+2000")) +insDocX(aux20007, gLnk("R", "July 12, 2000", "demoLargeRightFrame.html?July+12%2C+2000")) +insDocX(aux20007, gLnk("R", "July 13, 2000", "demoLargeRightFrame.html?July+13%2C+2000")) +insDocX(aux20007, gLnk("R", "July 14, 2000", "demoLargeRightFrame.html?July+14%2C+2000")) +insDocX(aux20007, gLnk("R", "July 15, 2000", "demoLargeRightFrame.html?July+15%2C+2000")) +insDocX(aux20007, gLnk("R", "July 16, 2000", "demoLargeRightFrame.html?July+16%2C+2000")) +insDocX(aux20007, gLnk("R", "July 17, 2000", "demoLargeRightFrame.html?July+17%2C+2000")) +insDocX(aux20007, gLnk("R", "July 18, 2000", "demoLargeRightFrame.html?July+18%2C+2000")) +insDocX(aux20007, gLnk("R", "July 19, 2000", "demoLargeRightFrame.html?July+19%2C+2000")) +insDocX(aux20007, gLnk("R", "July 20, 2000", "demoLargeRightFrame.html?July+20%2C+2000")) +insDocX(aux20007, gLnk("R", "July 21, 2000", "demoLargeRightFrame.html?July+21%2C+2000")) +insDocX(aux20007, gLnk("R", "July 22, 2000", "demoLargeRightFrame.html?July+22%2C+2000")) +insDocX(aux20007, gLnk("R", "July 23, 2000", "demoLargeRightFrame.html?July+23%2C+2000")) +insDocX(aux20007, gLnk("R", "July 24, 2000", "demoLargeRightFrame.html?July+24%2C+2000")) +insDocX(aux20007, gLnk("R", "July 25, 2000", "demoLargeRightFrame.html?July+25%2C+2000")) +insDocX(aux20007, gLnk("R", "July 26, 2000", "demoLargeRightFrame.html?July+26%2C+2000")) +insDocX(aux20007, gLnk("R", "July 27, 2000", "demoLargeRightFrame.html?July+27%2C+2000")) +insDocX(aux20007, gLnk("R", "July 28, 2000", "demoLargeRightFrame.html?July+28%2C+2000")) +insDocX(aux20007, gLnk("R", "July 29, 2000", "demoLargeRightFrame.html?July+29%2C+2000")) +insDocX(aux20007, gLnk("R", "July 30, 2000", "demoLargeRightFrame.html?July+30%2C+2000")) +insDocX(aux20007, gLnk("R", "July 31, 2000", "demoLargeRightFrame.html?July+31%2C+2000")) +aux20008 = insFldX(aux2000, gFld("August", "javascript:parent.op()")) +insDocX(aux20008, gLnk("R", "August 1, 2000", "demoLargeRightFrame.html?August+1%2C+2000")) +insDocX(aux20008, gLnk("R", "August 2, 2000", "demoLargeRightFrame.html?August+2%2C+2000")) +insDocX(aux20008, gLnk("R", "August 3, 2000", "demoLargeRightFrame.html?August+3%2C+2000")) +insDocX(aux20008, gLnk("R", "August 4, 2000", "demoLargeRightFrame.html?August+4%2C+2000")) +insDocX(aux20008, gLnk("R", "August 5, 2000", "demoLargeRightFrame.html?August+5%2C+2000")) +insDocX(aux20008, gLnk("R", "August 6, 2000", "demoLargeRightFrame.html?August+6%2C+2000")) +insDocX(aux20008, gLnk("R", "August 7, 2000", "demoLargeRightFrame.html?August+7%2C+2000")) +insDocX(aux20008, gLnk("R", "August 8, 2000", "demoLargeRightFrame.html?August+8%2C+2000")) +insDocX(aux20008, gLnk("R", "August 9, 2000", "demoLargeRightFrame.html?August+9%2C+2000")) +insDocX(aux20008, gLnk("R", "August 10, 2000", "demoLargeRightFrame.html?August+10%2C+2000")) +insDocX(aux20008, gLnk("R", "August 11, 2000", "demoLargeRightFrame.html?August+11%2C+2000")) +insDocX(aux20008, gLnk("R", "August 12, 2000", "demoLargeRightFrame.html?August+12%2C+2000")) +insDocX(aux20008, gLnk("R", "August 13, 2000", "demoLargeRightFrame.html?August+13%2C+2000")) +insDocX(aux20008, gLnk("R", "August 14, 2000", "demoLargeRightFrame.html?August+14%2C+2000")) +insDocX(aux20008, gLnk("R", "August 15, 2000", "demoLargeRightFrame.html?August+15%2C+2000")) +insDocX(aux20008, gLnk("R", "August 16, 2000", "demoLargeRightFrame.html?August+16%2C+2000")) +insDocX(aux20008, gLnk("R", "August 17, 2000", "demoLargeRightFrame.html?August+17%2C+2000")) +insDocX(aux20008, gLnk("R", "August 18, 2000", "demoLargeRightFrame.html?August+18%2C+2000")) +insDocX(aux20008, gLnk("R", "August 19, 2000", "demoLargeRightFrame.html?August+19%2C+2000")) +insDocX(aux20008, gLnk("R", "August 20, 2000", "demoLargeRightFrame.html?August+20%2C+2000")) +insDocX(aux20008, gLnk("R", "August 21, 2000", "demoLargeRightFrame.html?August+21%2C+2000")) +insDocX(aux20008, gLnk("R", "August 22, 2000", "demoLargeRightFrame.html?August+22%2C+2000")) +insDocX(aux20008, gLnk("R", "August 23, 2000", "demoLargeRightFrame.html?August+23%2C+2000")) +insDocX(aux20008, gLnk("R", "August 24, 2000", "demoLargeRightFrame.html?August+24%2C+2000")) +insDocX(aux20008, gLnk("R", "August 25, 2000", "demoLargeRightFrame.html?August+25%2C+2000")) +insDocX(aux20008, gLnk("R", "August 26, 2000", "demoLargeRightFrame.html?August+26%2C+2000")) +insDocX(aux20008, gLnk("R", "August 27, 2000", "demoLargeRightFrame.html?August+27%2C+2000")) +insDocX(aux20008, gLnk("R", "August 28, 2000", "demoLargeRightFrame.html?August+28%2C+2000")) +insDocX(aux20008, gLnk("R", "August 29, 2000", "demoLargeRightFrame.html?August+29%2C+2000")) +insDocX(aux20008, gLnk("R", "August 30, 2000", "demoLargeRightFrame.html?August+30%2C+2000")) +insDocX(aux20008, gLnk("R", "August 31, 2000", "demoLargeRightFrame.html?August+31%2C+2000")) +aux20009 = insFldX(aux2000, gFld("September", "javascript:parent.op()")) +insDocX(aux20009, gLnk("R", "September 1, 2000", "demoLargeRightFrame.html?September+1%2C+2000")) +insDocX(aux20009, gLnk("R", "September 2, 2000", "demoLargeRightFrame.html?September+2%2C+2000")) +insDocX(aux20009, gLnk("R", "September 3, 2000", "demoLargeRightFrame.html?September+3%2C+2000")) +insDocX(aux20009, gLnk("R", "September 4, 2000", "demoLargeRightFrame.html?September+4%2C+2000")) +insDocX(aux20009, gLnk("R", "September 5, 2000", "demoLargeRightFrame.html?September+5%2C+2000")) +insDocX(aux20009, gLnk("R", "September 6, 2000", "demoLargeRightFrame.html?September+6%2C+2000")) +insDocX(aux20009, gLnk("R", "September 7, 2000", "demoLargeRightFrame.html?September+7%2C+2000")) +insDocX(aux20009, gLnk("R", "September 8, 2000", "demoLargeRightFrame.html?September+8%2C+2000")) +insDocX(aux20009, gLnk("R", "September 9, 2000", "demoLargeRightFrame.html?September+9%2C+2000")) +insDocX(aux20009, gLnk("R", "September 10, 2000", "demoLargeRightFrame.html?September+10%2C+2000")) +insDocX(aux20009, gLnk("R", "September 11, 2000", "demoLargeRightFrame.html?September+11%2C+2000")) +insDocX(aux20009, gLnk("R", "September 12, 2000", "demoLargeRightFrame.html?September+12%2C+2000")) +insDocX(aux20009, gLnk("R", "September 13, 2000", "demoLargeRightFrame.html?September+13%2C+2000")) +insDocX(aux20009, gLnk("R", "September 14, 2000", "demoLargeRightFrame.html?September+14%2C+2000")) +insDocX(aux20009, gLnk("R", "September 15, 2000", "demoLargeRightFrame.html?September+15%2C+2000")) +insDocX(aux20009, gLnk("R", "September 16, 2000", "demoLargeRightFrame.html?September+16%2C+2000")) +insDocX(aux20009, gLnk("R", "September 17, 2000", "demoLargeRightFrame.html?September+17%2C+2000")) +insDocX(aux20009, gLnk("R", "September 18, 2000", "demoLargeRightFrame.html?September+18%2C+2000")) +insDocX(aux20009, gLnk("R", "September 19, 2000", "demoLargeRightFrame.html?September+19%2C+2000")) +insDocX(aux20009, gLnk("R", "September 20, 2000", "demoLargeRightFrame.html?September+20%2C+2000")) +insDocX(aux20009, gLnk("R", "September 21, 2000", "demoLargeRightFrame.html?September+21%2C+2000")) +insDocX(aux20009, gLnk("R", "September 22, 2000", "demoLargeRightFrame.html?September+22%2C+2000")) +insDocX(aux20009, gLnk("R", "September 23, 2000", "demoLargeRightFrame.html?September+23%2C+2000")) +insDocX(aux20009, gLnk("R", "September 24, 2000", "demoLargeRightFrame.html?September+24%2C+2000")) +insDocX(aux20009, gLnk("R", "September 25, 2000", "demoLargeRightFrame.html?September+25%2C+2000")) +insDocX(aux20009, gLnk("R", "September 26, 2000", "demoLargeRightFrame.html?September+26%2C+2000")) +insDocX(aux20009, gLnk("R", "September 27, 2000", "demoLargeRightFrame.html?September+27%2C+2000")) +insDocX(aux20009, gLnk("R", "September 28, 2000", "demoLargeRightFrame.html?September+28%2C+2000")) +insDocX(aux20009, gLnk("R", "September 29, 2000", "demoLargeRightFrame.html?September+29%2C+2000")) +insDocX(aux20009, gLnk("R", "September 30, 2000", "demoLargeRightFrame.html?September+30%2C+2000")) +aux200010 = insFldX(aux2000, gFld("October", "javascript:parent.op()")) +insDocX(aux200010, gLnk("R", "October 1, 2000", "demoLargeRightFrame.html?October+1%2C+2000")) +insDocX(aux200010, gLnk("R", "October 2, 2000", "demoLargeRightFrame.html?October+2%2C+2000")) +insDocX(aux200010, gLnk("R", "October 3, 2000", "demoLargeRightFrame.html?October+3%2C+2000")) +insDocX(aux200010, gLnk("R", "October 4, 2000", "demoLargeRightFrame.html?October+4%2C+2000")) +insDocX(aux200010, gLnk("R", "October 5, 2000", "demoLargeRightFrame.html?October+5%2C+2000")) +insDocX(aux200010, gLnk("R", "October 6, 2000", "demoLargeRightFrame.html?October+6%2C+2000")) +insDocX(aux200010, gLnk("R", "October 7, 2000", "demoLargeRightFrame.html?October+7%2C+2000")) +insDocX(aux200010, gLnk("R", "October 8, 2000", "demoLargeRightFrame.html?October+8%2C+2000")) +insDocX(aux200010, gLnk("R", "October 9, 2000", "demoLargeRightFrame.html?October+9%2C+2000")) +insDocX(aux200010, gLnk("R", "October 10, 2000", "demoLargeRightFrame.html?October+10%2C+2000")) +insDocX(aux200010, gLnk("R", "October 11, 2000", "demoLargeRightFrame.html?October+11%2C+2000")) +insDocX(aux200010, gLnk("R", "October 12, 2000", "demoLargeRightFrame.html?October+12%2C+2000")) +insDocX(aux200010, gLnk("R", "October 13, 2000", "demoLargeRightFrame.html?October+13%2C+2000")) +insDocX(aux200010, gLnk("R", "October 14, 2000", "demoLargeRightFrame.html?October+14%2C+2000")) +insDocX(aux200010, gLnk("R", "October 15, 2000", "demoLargeRightFrame.html?October+15%2C+2000")) +insDocX(aux200010, gLnk("R", "October 16, 2000", "demoLargeRightFrame.html?October+16%2C+2000")) +insDocX(aux200010, gLnk("R", "October 17, 2000", "demoLargeRightFrame.html?October+17%2C+2000")) +insDocX(aux200010, gLnk("R", "October 18, 2000", "demoLargeRightFrame.html?October+18%2C+2000")) +insDocX(aux200010, gLnk("R", "October 19, 2000", "demoLargeRightFrame.html?October+19%2C+2000")) +insDocX(aux200010, gLnk("R", "October 20, 2000", "demoLargeRightFrame.html?October+20%2C+2000")) +insDocX(aux200010, gLnk("R", "October 21, 2000", "demoLargeRightFrame.html?October+21%2C+2000")) +insDocX(aux200010, gLnk("R", "October 22, 2000", "demoLargeRightFrame.html?October+22%2C+2000")) +insDocX(aux200010, gLnk("R", "October 23, 2000", "demoLargeRightFrame.html?October+23%2C+2000")) +insDocX(aux200010, gLnk("R", "October 24, 2000", "demoLargeRightFrame.html?October+24%2C+2000")) +insDocX(aux200010, gLnk("R", "October 25, 2000", "demoLargeRightFrame.html?October+25%2C+2000")) +insDocX(aux200010, gLnk("R", "October 26, 2000", "demoLargeRightFrame.html?October+26%2C+2000")) +insDocX(aux200010, gLnk("R", "October 27, 2000", "demoLargeRightFrame.html?October+27%2C+2000")) +insDocX(aux200010, gLnk("R", "October 28, 2000", "demoLargeRightFrame.html?October+28%2C+2000")) +insDocX(aux200010, gLnk("R", "October 29, 2000", "demoLargeRightFrame.html?October+29%2C+2000")) +insDocX(aux200010, gLnk("R", "October 30, 2000", "demoLargeRightFrame.html?October+30%2C+2000")) +insDocX(aux200010, gLnk("R", "October 31, 2000", "demoLargeRightFrame.html?October+31%2C+2000")) +aux200011 = insFldX(aux2000, gFld("November", "javascript:parent.op()")) +insDocX(aux200011, gLnk("R", "November 1, 2000", "demoLargeRightFrame.html?November+1%2C+2000")) +insDocX(aux200011, gLnk("R", "November 2, 2000", "demoLargeRightFrame.html?November+2%2C+2000")) +insDocX(aux200011, gLnk("R", "November 3, 2000", "demoLargeRightFrame.html?November+3%2C+2000")) +insDocX(aux200011, gLnk("R", "November 4, 2000", "demoLargeRightFrame.html?November+4%2C+2000")) +insDocX(aux200011, gLnk("R", "November 5, 2000", "demoLargeRightFrame.html?November+5%2C+2000")) +insDocX(aux200011, gLnk("R", "November 6, 2000", "demoLargeRightFrame.html?November+6%2C+2000")) +insDocX(aux200011, gLnk("R", "November 7, 2000", "demoLargeRightFrame.html?November+7%2C+2000")) +insDocX(aux200011, gLnk("R", "November 8, 2000", "demoLargeRightFrame.html?November+8%2C+2000")) +insDocX(aux200011, gLnk("R", "November 9, 2000", "demoLargeRightFrame.html?November+9%2C+2000")) +insDocX(aux200011, gLnk("R", "November 10, 2000", "demoLargeRightFrame.html?November+10%2C+2000")) +insDocX(aux200011, gLnk("R", "November 11, 2000", "demoLargeRightFrame.html?November+11%2C+2000")) +insDocX(aux200011, gLnk("R", "November 12, 2000", "demoLargeRightFrame.html?November+12%2C+2000")) +insDocX(aux200011, gLnk("R", "November 13, 2000", "demoLargeRightFrame.html?November+13%2C+2000")) +insDocX(aux200011, gLnk("R", "November 14, 2000", "demoLargeRightFrame.html?November+14%2C+2000")) +insDocX(aux200011, gLnk("R", "November 15, 2000", "demoLargeRightFrame.html?November+15%2C+2000")) +insDocX(aux200011, gLnk("R", "November 16, 2000", "demoLargeRightFrame.html?November+16%2C+2000")) +insDocX(aux200011, gLnk("R", "November 17, 2000", "demoLargeRightFrame.html?November+17%2C+2000")) +insDocX(aux200011, gLnk("R", "November 18, 2000", "demoLargeRightFrame.html?November+18%2C+2000")) +insDocX(aux200011, gLnk("R", "November 19, 2000", "demoLargeRightFrame.html?November+19%2C+2000")) +insDocX(aux200011, gLnk("R", "November 20, 2000", "demoLargeRightFrame.html?November+20%2C+2000")) +insDocX(aux200011, gLnk("R", "November 21, 2000", "demoLargeRightFrame.html?November+21%2C+2000")) +insDocX(aux200011, gLnk("R", "November 22, 2000", "demoLargeRightFrame.html?November+22%2C+2000")) +insDocX(aux200011, gLnk("R", "November 23, 2000", "demoLargeRightFrame.html?November+23%2C+2000")) +insDocX(aux200011, gLnk("R", "November 24, 2000", "demoLargeRightFrame.html?November+24%2C+2000")) +insDocX(aux200011, gLnk("R", "November 25, 2000", "demoLargeRightFrame.html?November+25%2C+2000")) +insDocX(aux200011, gLnk("R", "November 26, 2000", "demoLargeRightFrame.html?November+26%2C+2000")) +insDocX(aux200011, gLnk("R", "November 27, 2000", "demoLargeRightFrame.html?November+27%2C+2000")) +insDocX(aux200011, gLnk("R", "November 28, 2000", "demoLargeRightFrame.html?November+28%2C+2000")) +insDocX(aux200011, gLnk("R", "November 29, 2000", "demoLargeRightFrame.html?November+29%2C+2000")) +insDocX(aux200011, gLnk("R", "November 30, 2000", "demoLargeRightFrame.html?November+30%2C+2000")) +aux200012 = insFldX(aux2000, gFld("December", "javascript:parent.op()")) +insDocX(aux200012, gLnk("R", "December 1, 2000", "demoLargeRightFrame.html?December+1%2C+2000")) +insDocX(aux200012, gLnk("R", "December 2, 2000", "demoLargeRightFrame.html?December+2%2C+2000")) +insDocX(aux200012, gLnk("R", "December 3, 2000", "demoLargeRightFrame.html?December+3%2C+2000")) +insDocX(aux200012, gLnk("R", "December 4, 2000", "demoLargeRightFrame.html?December+4%2C+2000")) +insDocX(aux200012, gLnk("R", "December 5, 2000", "demoLargeRightFrame.html?December+5%2C+2000")) +insDocX(aux200012, gLnk("R", "December 6, 2000", "demoLargeRightFrame.html?December+6%2C+2000")) +insDocX(aux200012, gLnk("R", "December 7, 2000", "demoLargeRightFrame.html?December+7%2C+2000")) +insDocX(aux200012, gLnk("R", "December 8, 2000", "demoLargeRightFrame.html?December+8%2C+2000")) +insDocX(aux200012, gLnk("R", "December 9, 2000", "demoLargeRightFrame.html?December+9%2C+2000")) +insDocX(aux200012, gLnk("R", "December 10, 2000", "demoLargeRightFrame.html?December+10%2C+2000")) +insDocX(aux200012, gLnk("R", "December 11, 2000", "demoLargeRightFrame.html?December+11%2C+2000")) +insDocX(aux200012, gLnk("R", "December 12, 2000", "demoLargeRightFrame.html?December+12%2C+2000")) +insDocX(aux200012, gLnk("R", "December 13, 2000", "demoLargeRightFrame.html?December+13%2C+2000")) +insDocX(aux200012, gLnk("R", "December 14, 2000", "demoLargeRightFrame.html?December+14%2C+2000")) +insDocX(aux200012, gLnk("R", "December 15, 2000", "demoLargeRightFrame.html?December+15%2C+2000")) +insDocX(aux200012, gLnk("R", "December 16, 2000", "demoLargeRightFrame.html?December+16%2C+2000")) +insDocX(aux200012, gLnk("R", "December 17, 2000", "demoLargeRightFrame.html?December+17%2C+2000")) +insDocX(aux200012, gLnk("R", "December 18, 2000", "demoLargeRightFrame.html?December+18%2C+2000")) +insDocX(aux200012, gLnk("R", "December 19, 2000", "demoLargeRightFrame.html?December+19%2C+2000")) +insDocX(aux200012, gLnk("R", "December 20, 2000", "demoLargeRightFrame.html?December+20%2C+2000")) +insDocX(aux200012, gLnk("R", "December 21, 2000", "demoLargeRightFrame.html?December+21%2C+2000")) +insDocX(aux200012, gLnk("R", "December 22, 2000", "demoLargeRightFrame.html?December+22%2C+2000")) +insDocX(aux200012, gLnk("R", "December 23, 2000", "demoLargeRightFrame.html?December+23%2C+2000")) +insDocX(aux200012, gLnk("R", "December 24, 2000", "demoLargeRightFrame.html?December+24%2C+2000")) +insDocX(aux200012, gLnk("R", "December 25, 2000", "demoLargeRightFrame.html?December+25%2C+2000")) +insDocX(aux200012, gLnk("R", "December 26, 2000", "demoLargeRightFrame.html?December+26%2C+2000")) +insDocX(aux200012, gLnk("R", "December 27, 2000", "demoLargeRightFrame.html?December+27%2C+2000")) +insDocX(aux200012, gLnk("R", "December 28, 2000", "demoLargeRightFrame.html?December+28%2C+2000")) +insDocX(aux200012, gLnk("R", "December 29, 2000", "demoLargeRightFrame.html?December+29%2C+2000")) +insDocX(aux200012, gLnk("R", "December 30, 2000", "demoLargeRightFrame.html?December+30%2C+2000")) +insDocX(aux200012, gLnk("R", "December 31, 2000", "demoLargeRightFrame.html?December+31%2C+2000")) +aux2001 = insFldX(foldersTree, gFld("2001", "javascript:parent.op()")) +aux20011 = insFldX(aux2001, gFld("January", "javascript:parent.op()")) +insDocX(aux20011, gLnk("R", "January 1, 2001", "demoLargeRightFrame.html?January+1%2C+2001")) +insDocX(aux20011, gLnk("R", "January 2, 2001", "demoLargeRightFrame.html?January+2%2C+2001")) +insDocX(aux20011, gLnk("R", "January 3, 2001", "demoLargeRightFrame.html?January+3%2C+2001")) +insDocX(aux20011, gLnk("R", "January 4, 2001", "demoLargeRightFrame.html?January+4%2C+2001")) +insDocX(aux20011, gLnk("R", "January 5, 2001", "demoLargeRightFrame.html?January+5%2C+2001")) +insDocX(aux20011, gLnk("R", "January 6, 2001", "demoLargeRightFrame.html?January+6%2C+2001")) +insDocX(aux20011, gLnk("R", "January 7, 2001", "demoLargeRightFrame.html?January+7%2C+2001")) +insDocX(aux20011, gLnk("R", "January 8, 2001", "demoLargeRightFrame.html?January+8%2C+2001")) +insDocX(aux20011, gLnk("R", "January 9, 2001", "demoLargeRightFrame.html?January+9%2C+2001")) +insDocX(aux20011, gLnk("R", "January 10, 2001", "demoLargeRightFrame.html?January+10%2C+2001")) +insDocX(aux20011, gLnk("R", "January 11, 2001", "demoLargeRightFrame.html?January+11%2C+2001")) +insDocX(aux20011, gLnk("R", "January 12, 2001", "demoLargeRightFrame.html?January+12%2C+2001")) +insDocX(aux20011, gLnk("R", "January 13, 2001", "demoLargeRightFrame.html?January+13%2C+2001")) +insDocX(aux20011, gLnk("R", "January 14, 2001", "demoLargeRightFrame.html?January+14%2C+2001")) +insDocX(aux20011, gLnk("R", "January 15, 2001", "demoLargeRightFrame.html?January+15%2C+2001")) +insDocX(aux20011, gLnk("R", "January 16, 2001", "demoLargeRightFrame.html?January+16%2C+2001")) +insDocX(aux20011, gLnk("R", "January 17, 2001", "demoLargeRightFrame.html?January+17%2C+2001")) +insDocX(aux20011, gLnk("R", "January 18, 2001", "demoLargeRightFrame.html?January+18%2C+2001")) +insDocX(aux20011, gLnk("R", "January 19, 2001", "demoLargeRightFrame.html?January+19%2C+2001")) +insDocX(aux20011, gLnk("R", "January 20, 2001", "demoLargeRightFrame.html?January+20%2C+2001")) +insDocX(aux20011, gLnk("R", "January 21, 2001", "demoLargeRightFrame.html?January+21%2C+2001")) +insDocX(aux20011, gLnk("R", "January 22, 2001", "demoLargeRightFrame.html?January+22%2C+2001")) +insDocX(aux20011, gLnk("R", "January 23, 2001", "demoLargeRightFrame.html?January+23%2C+2001")) +insDocX(aux20011, gLnk("R", "January 24, 2001", "demoLargeRightFrame.html?January+24%2C+2001")) +insDocX(aux20011, gLnk("R", "January 25, 2001", "demoLargeRightFrame.html?January+25%2C+2001")) +insDocX(aux20011, gLnk("R", "January 26, 2001", "demoLargeRightFrame.html?January+26%2C+2001")) +insDocX(aux20011, gLnk("R", "January 27, 2001", "demoLargeRightFrame.html?January+27%2C+2001")) +insDocX(aux20011, gLnk("R", "January 28, 2001", "demoLargeRightFrame.html?January+28%2C+2001")) +insDocX(aux20011, gLnk("R", "January 29, 2001", "demoLargeRightFrame.html?January+29%2C+2001")) +insDocX(aux20011, gLnk("R", "January 30, 2001", "demoLargeRightFrame.html?January+30%2C+2001")) +insDocX(aux20011, gLnk("R", "January 31, 2001", "demoLargeRightFrame.html?January+31%2C+2001")) +aux20012 = insFldX(aux2001, gFld("February", "javascript:parent.op()")) +insDocX(aux20012, gLnk("R", "February 1, 2001", "demoLargeRightFrame.html?February+1%2C+2001")) +insDocX(aux20012, gLnk("R", "February 2, 2001", "demoLargeRightFrame.html?February+2%2C+2001")) +insDocX(aux20012, gLnk("R", "February 3, 2001", "demoLargeRightFrame.html?February+3%2C+2001")) +insDocX(aux20012, gLnk("R", "February 4, 2001", "demoLargeRightFrame.html?February+4%2C+2001")) +insDocX(aux20012, gLnk("R", "February 5, 2001", "demoLargeRightFrame.html?February+5%2C+2001")) +insDocX(aux20012, gLnk("R", "February 6, 2001", "demoLargeRightFrame.html?February+6%2C+2001")) +insDocX(aux20012, gLnk("R", "February 7, 2001", "demoLargeRightFrame.html?February+7%2C+2001")) +insDocX(aux20012, gLnk("R", "February 8, 2001", "demoLargeRightFrame.html?February+8%2C+2001")) +insDocX(aux20012, gLnk("R", "February 9, 2001", "demoLargeRightFrame.html?February+9%2C+2001")) +insDocX(aux20012, gLnk("R", "February 10, 2001", "demoLargeRightFrame.html?February+10%2C+2001")) +insDocX(aux20012, gLnk("R", "February 11, 2001", "demoLargeRightFrame.html?February+11%2C+2001")) +insDocX(aux20012, gLnk("R", "February 12, 2001", "demoLargeRightFrame.html?February+12%2C+2001")) +insDocX(aux20012, gLnk("R", "February 13, 2001", "demoLargeRightFrame.html?February+13%2C+2001")) +insDocX(aux20012, gLnk("R", "February 14, 2001", "demoLargeRightFrame.html?February+14%2C+2001")) +insDocX(aux20012, gLnk("R", "February 15, 2001", "demoLargeRightFrame.html?February+15%2C+2001")) +insDocX(aux20012, gLnk("R", "February 16, 2001", "demoLargeRightFrame.html?February+16%2C+2001")) +insDocX(aux20012, gLnk("R", "February 17, 2001", "demoLargeRightFrame.html?February+17%2C+2001")) +insDocX(aux20012, gLnk("R", "February 18, 2001", "demoLargeRightFrame.html?February+18%2C+2001")) +insDocX(aux20012, gLnk("R", "February 19, 2001", "demoLargeRightFrame.html?February+19%2C+2001")) +insDocX(aux20012, gLnk("R", "February 20, 2001", "demoLargeRightFrame.html?February+20%2C+2001")) +insDocX(aux20012, gLnk("R", "February 21, 2001", "demoLargeRightFrame.html?February+21%2C+2001")) +insDocX(aux20012, gLnk("R", "February 22, 2001", "demoLargeRightFrame.html?February+22%2C+2001")) +insDocX(aux20012, gLnk("R", "February 23, 2001", "demoLargeRightFrame.html?February+23%2C+2001")) +insDocX(aux20012, gLnk("R", "February 24, 2001", "demoLargeRightFrame.html?February+24%2C+2001")) +insDocX(aux20012, gLnk("R", "February 25, 2001", "demoLargeRightFrame.html?February+25%2C+2001")) +insDocX(aux20012, gLnk("R", "February 26, 2001", "demoLargeRightFrame.html?February+26%2C+2001")) +insDocX(aux20012, gLnk("R", "February 27, 2001", "demoLargeRightFrame.html?February+27%2C+2001")) +insDocX(aux20012, gLnk("R", "February 28, 2001", "demoLargeRightFrame.html?February+28%2C+2001")) +aux20013 = insFldX(aux2001, gFld("March", "javascript:parent.op()")) +insDocX(aux20013, gLnk("R", "March 1, 2001", "demoLargeRightFrame.html?March+1%2C+2001")) +insDocX(aux20013, gLnk("R", "March 2, 2001", "demoLargeRightFrame.html?March+2%2C+2001")) +insDocX(aux20013, gLnk("R", "March 3, 2001", "demoLargeRightFrame.html?March+3%2C+2001")) +insDocX(aux20013, gLnk("R", "March 4, 2001", "demoLargeRightFrame.html?March+4%2C+2001")) +insDocX(aux20013, gLnk("R", "March 5, 2001", "demoLargeRightFrame.html?March+5%2C+2001")) +insDocX(aux20013, gLnk("R", "March 6, 2001", "demoLargeRightFrame.html?March+6%2C+2001")) +insDocX(aux20013, gLnk("R", "March 7, 2001", "demoLargeRightFrame.html?March+7%2C+2001")) +insDocX(aux20013, gLnk("R", "March 8, 2001", "demoLargeRightFrame.html?March+8%2C+2001")) +insDocX(aux20013, gLnk("R", "March 9, 2001", "demoLargeRightFrame.html?March+9%2C+2001")) +insDocX(aux20013, gLnk("R", "March 10, 2001", "demoLargeRightFrame.html?March+10%2C+2001")) +insDocX(aux20013, gLnk("R", "March 11, 2001", "demoLargeRightFrame.html?March+11%2C+2001")) +insDocX(aux20013, gLnk("R", "March 12, 2001", "demoLargeRightFrame.html?March+12%2C+2001")) +insDocX(aux20013, gLnk("R", "March 13, 2001", "demoLargeRightFrame.html?March+13%2C+2001")) +insDocX(aux20013, gLnk("R", "March 14, 2001", "demoLargeRightFrame.html?March+14%2C+2001")) +insDocX(aux20013, gLnk("R", "March 15, 2001", "demoLargeRightFrame.html?March+15%2C+2001")) +insDocX(aux20013, gLnk("R", "March 16, 2001", "demoLargeRightFrame.html?March+16%2C+2001")) +insDocX(aux20013, gLnk("R", "March 17, 2001", "demoLargeRightFrame.html?March+17%2C+2001")) +insDocX(aux20013, gLnk("R", "March 18, 2001", "demoLargeRightFrame.html?March+18%2C+2001")) +insDocX(aux20013, gLnk("R", "March 19, 2001", "demoLargeRightFrame.html?March+19%2C+2001")) +insDocX(aux20013, gLnk("R", "March 20, 2001", "demoLargeRightFrame.html?March+20%2C+2001")) +insDocX(aux20013, gLnk("R", "March 21, 2001", "demoLargeRightFrame.html?March+21%2C+2001")) +insDocX(aux20013, gLnk("R", "March 22, 2001", "demoLargeRightFrame.html?March+22%2C+2001")) +insDocX(aux20013, gLnk("R", "March 23, 2001", "demoLargeRightFrame.html?March+23%2C+2001")) +insDocX(aux20013, gLnk("R", "March 24, 2001", "demoLargeRightFrame.html?March+24%2C+2001")) +insDocX(aux20013, gLnk("R", "March 25, 2001", "demoLargeRightFrame.html?March+25%2C+2001")) +insDocX(aux20013, gLnk("R", "March 26, 2001", "demoLargeRightFrame.html?March+26%2C+2001")) +insDocX(aux20013, gLnk("R", "March 27, 2001", "demoLargeRightFrame.html?March+27%2C+2001")) +insDocX(aux20013, gLnk("R", "March 28, 2001", "demoLargeRightFrame.html?March+28%2C+2001")) +insDocX(aux20013, gLnk("R", "March 29, 2001", "demoLargeRightFrame.html?March+29%2C+2001")) +insDocX(aux20013, gLnk("R", "March 30, 2001", "demoLargeRightFrame.html?March+30%2C+2001")) +insDocX(aux20013, gLnk("R", "March 31, 2001", "demoLargeRightFrame.html?March+31%2C+2001")) +aux20014 = insFldX(aux2001, gFld("April", "javascript:parent.op()")) +insDocX(aux20014, gLnk("R", "April 1, 2001", "demoLargeRightFrame.html?April+1%2C+2001")) +insDocX(aux20014, gLnk("R", "April 2, 2001", "demoLargeRightFrame.html?April+2%2C+2001")) +insDocX(aux20014, gLnk("R", "April 3, 2001", "demoLargeRightFrame.html?April+3%2C+2001")) +insDocX(aux20014, gLnk("R", "April 4, 2001", "demoLargeRightFrame.html?April+4%2C+2001")) +insDocX(aux20014, gLnk("R", "April 5, 2001", "demoLargeRightFrame.html?April+5%2C+2001")) +insDocX(aux20014, gLnk("R", "April 6, 2001", "demoLargeRightFrame.html?April+6%2C+2001")) +insDocX(aux20014, gLnk("R", "April 7, 2001", "demoLargeRightFrame.html?April+7%2C+2001")) +insDocX(aux20014, gLnk("R", "April 8, 2001", "demoLargeRightFrame.html?April+8%2C+2001")) +insDocX(aux20014, gLnk("R", "April 9, 2001", "demoLargeRightFrame.html?April+9%2C+2001")) +insDocX(aux20014, gLnk("R", "April 10, 2001", "demoLargeRightFrame.html?April+10%2C+2001")) +insDocX(aux20014, gLnk("R", "April 11, 2001", "demoLargeRightFrame.html?April+11%2C+2001")) +insDocX(aux20014, gLnk("R", "April 12, 2001", "demoLargeRightFrame.html?April+12%2C+2001")) +insDocX(aux20014, gLnk("R", "April 13, 2001", "demoLargeRightFrame.html?April+13%2C+2001")) +insDocX(aux20014, gLnk("R", "April 14, 2001", "demoLargeRightFrame.html?April+14%2C+2001")) +insDocX(aux20014, gLnk("R", "April 15, 2001", "demoLargeRightFrame.html?April+15%2C+2001")) +insDocX(aux20014, gLnk("R", "April 16, 2001", "demoLargeRightFrame.html?April+16%2C+2001")) +insDocX(aux20014, gLnk("R", "April 17, 2001", "demoLargeRightFrame.html?April+17%2C+2001")) +insDocX(aux20014, gLnk("R", "April 18, 2001", "demoLargeRightFrame.html?April+18%2C+2001")) +insDocX(aux20014, gLnk("R", "April 19, 2001", "demoLargeRightFrame.html?April+19%2C+2001")) +insDocX(aux20014, gLnk("R", "April 20, 2001", "demoLargeRightFrame.html?April+20%2C+2001")) +insDocX(aux20014, gLnk("R", "April 21, 2001", "demoLargeRightFrame.html?April+21%2C+2001")) +insDocX(aux20014, gLnk("R", "April 22, 2001", "demoLargeRightFrame.html?April+22%2C+2001")) +insDocX(aux20014, gLnk("R", "April 23, 2001", "demoLargeRightFrame.html?April+23%2C+2001")) +insDocX(aux20014, gLnk("R", "April 24, 2001", "demoLargeRightFrame.html?April+24%2C+2001")) +insDocX(aux20014, gLnk("R", "April 25, 2001", "demoLargeRightFrame.html?April+25%2C+2001")) +insDocX(aux20014, gLnk("R", "April 26, 2001", "demoLargeRightFrame.html?April+26%2C+2001")) +insDocX(aux20014, gLnk("R", "April 27, 2001", "demoLargeRightFrame.html?April+27%2C+2001")) +insDocX(aux20014, gLnk("R", "April 28, 2001", "demoLargeRightFrame.html?April+28%2C+2001")) +insDocX(aux20014, gLnk("R", "April 29, 2001", "demoLargeRightFrame.html?April+29%2C+2001")) +insDocX(aux20014, gLnk("R", "April 30, 2001", "demoLargeRightFrame.html?April+30%2C+2001")) +aux20015 = insFldX(aux2001, gFld("May", "javascript:parent.op()")) +insDocX(aux20015, gLnk("R", "May 1, 2001", "demoLargeRightFrame.html?May+1%2C+2001")) +insDocX(aux20015, gLnk("R", "May 2, 2001", "demoLargeRightFrame.html?May+2%2C+2001")) +insDocX(aux20015, gLnk("R", "May 3, 2001", "demoLargeRightFrame.html?May+3%2C+2001")) +insDocX(aux20015, gLnk("R", "May 4, 2001", "demoLargeRightFrame.html?May+4%2C+2001")) +insDocX(aux20015, gLnk("R", "May 5, 2001", "demoLargeRightFrame.html?May+5%2C+2001")) +insDocX(aux20015, gLnk("R", "May 6, 2001", "demoLargeRightFrame.html?May+6%2C+2001")) +insDocX(aux20015, gLnk("R", "May 7, 2001", "demoLargeRightFrame.html?May+7%2C+2001")) +insDocX(aux20015, gLnk("R", "May 8, 2001", "demoLargeRightFrame.html?May+8%2C+2001")) +insDocX(aux20015, gLnk("R", "May 9, 2001", "demoLargeRightFrame.html?May+9%2C+2001")) +insDocX(aux20015, gLnk("R", "May 10, 2001", "demoLargeRightFrame.html?May+10%2C+2001")) +insDocX(aux20015, gLnk("R", "May 11, 2001", "demoLargeRightFrame.html?May+11%2C+2001")) +insDocX(aux20015, gLnk("R", "May 12, 2001", "demoLargeRightFrame.html?May+12%2C+2001")) +insDocX(aux20015, gLnk("R", "May 13, 2001", "demoLargeRightFrame.html?May+13%2C+2001")) +insDocX(aux20015, gLnk("R", "May 14, 2001", "demoLargeRightFrame.html?May+14%2C+2001")) +insDocX(aux20015, gLnk("R", "May 15, 2001", "demoLargeRightFrame.html?May+15%2C+2001")) +insDocX(aux20015, gLnk("R", "May 16, 2001", "demoLargeRightFrame.html?May+16%2C+2001")) +insDocX(aux20015, gLnk("R", "May 17, 2001", "demoLargeRightFrame.html?May+17%2C+2001")) +insDocX(aux20015, gLnk("R", "May 18, 2001", "demoLargeRightFrame.html?May+18%2C+2001")) +insDocX(aux20015, gLnk("R", "May 19, 2001", "demoLargeRightFrame.html?May+19%2C+2001")) +insDocX(aux20015, gLnk("R", "May 20, 2001", "demoLargeRightFrame.html?May+20%2C+2001")) +insDocX(aux20015, gLnk("R", "May 21, 2001", "demoLargeRightFrame.html?May+21%2C+2001")) +insDocX(aux20015, gLnk("R", "May 22, 2001", "demoLargeRightFrame.html?May+22%2C+2001")) +insDocX(aux20015, gLnk("R", "May 23, 2001", "demoLargeRightFrame.html?May+23%2C+2001")) +insDocX(aux20015, gLnk("R", "May 24, 2001", "demoLargeRightFrame.html?May+24%2C+2001")) +insDocX(aux20015, gLnk("R", "May 25, 2001", "demoLargeRightFrame.html?May+25%2C+2001")) +insDocX(aux20015, gLnk("R", "May 26, 2001", "demoLargeRightFrame.html?May+26%2C+2001")) +insDocX(aux20015, gLnk("R", "May 27, 2001", "demoLargeRightFrame.html?May+27%2C+2001")) +insDocX(aux20015, gLnk("R", "May 28, 2001", "demoLargeRightFrame.html?May+28%2C+2001")) +insDocX(aux20015, gLnk("R", "May 29, 2001", "demoLargeRightFrame.html?May+29%2C+2001")) +insDocX(aux20015, gLnk("R", "May 30, 2001", "demoLargeRightFrame.html?May+30%2C+2001")) +insDocX(aux20015, gLnk("R", "May 31, 2001", "demoLargeRightFrame.html?May+31%2C+2001")) +aux20016 = insFldX(aux2001, gFld("June", "javascript:parent.op()")) +insDocX(aux20016, gLnk("R", "June 1, 2001", "demoLargeRightFrame.html?June+1%2C+2001")) +insDocX(aux20016, gLnk("R", "June 2, 2001", "demoLargeRightFrame.html?June+2%2C+2001")) +insDocX(aux20016, gLnk("R", "June 3, 2001", "demoLargeRightFrame.html?June+3%2C+2001")) +insDocX(aux20016, gLnk("R", "June 4, 2001", "demoLargeRightFrame.html?June+4%2C+2001")) +insDocX(aux20016, gLnk("R", "June 5, 2001", "demoLargeRightFrame.html?June+5%2C+2001")) +insDocX(aux20016, gLnk("R", "June 6, 2001", "demoLargeRightFrame.html?June+6%2C+2001")) +insDocX(aux20016, gLnk("R", "June 7, 2001", "demoLargeRightFrame.html?June+7%2C+2001")) +insDocX(aux20016, gLnk("R", "June 8, 2001", "demoLargeRightFrame.html?June+8%2C+2001")) +insDocX(aux20016, gLnk("R", "June 9, 2001", "demoLargeRightFrame.html?June+9%2C+2001")) +insDocX(aux20016, gLnk("R", "June 10, 2001", "demoLargeRightFrame.html?June+10%2C+2001")) +insDocX(aux20016, gLnk("R", "June 11, 2001", "demoLargeRightFrame.html?June+11%2C+2001")) +insDocX(aux20016, gLnk("R", "June 12, 2001", "demoLargeRightFrame.html?June+12%2C+2001")) +insDocX(aux20016, gLnk("R", "June 13, 2001", "demoLargeRightFrame.html?June+13%2C+2001")) +insDocX(aux20016, gLnk("R", "June 14, 2001", "demoLargeRightFrame.html?June+14%2C+2001")) +insDocX(aux20016, gLnk("R", "June 15, 2001", "demoLargeRightFrame.html?June+15%2C+2001")) +insDocX(aux20016, gLnk("R", "June 16, 2001", "demoLargeRightFrame.html?June+16%2C+2001")) +insDocX(aux20016, gLnk("R", "June 17, 2001", "demoLargeRightFrame.html?June+17%2C+2001")) +insDocX(aux20016, gLnk("R", "June 18, 2001", "demoLargeRightFrame.html?June+18%2C+2001")) +insDocX(aux20016, gLnk("R", "June 19, 2001", "demoLargeRightFrame.html?June+19%2C+2001")) +insDocX(aux20016, gLnk("R", "June 20, 2001", "demoLargeRightFrame.html?June+20%2C+2001")) +insDocX(aux20016, gLnk("R", "June 21, 2001", "demoLargeRightFrame.html?June+21%2C+2001")) +insDocX(aux20016, gLnk("R", "June 22, 2001", "demoLargeRightFrame.html?June+22%2C+2001")) +insDocX(aux20016, gLnk("R", "June 23, 2001", "demoLargeRightFrame.html?June+23%2C+2001")) +insDocX(aux20016, gLnk("R", "June 24, 2001", "demoLargeRightFrame.html?June+24%2C+2001")) +insDocX(aux20016, gLnk("R", "June 25, 2001", "demoLargeRightFrame.html?June+25%2C+2001")) +insDocX(aux20016, gLnk("R", "June 26, 2001", "demoLargeRightFrame.html?June+26%2C+2001")) +insDocX(aux20016, gLnk("R", "June 27, 2001", "demoLargeRightFrame.html?June+27%2C+2001")) +insDocX(aux20016, gLnk("R", "June 28, 2001", "demoLargeRightFrame.html?June+28%2C+2001")) +insDocX(aux20016, gLnk("R", "June 29, 2001", "demoLargeRightFrame.html?June+29%2C+2001")) +insDocX(aux20016, gLnk("R", "June 30, 2001", "demoLargeRightFrame.html?June+30%2C+2001")) +aux20017 = insFldX(aux2001, gFld("July", "javascript:parent.op()")) +insDocX(aux20017, gLnk("R", "July 1, 2001", "demoLargeRightFrame.html?July+1%2C+2001")) +insDocX(aux20017, gLnk("R", "July 2, 2001", "demoLargeRightFrame.html?July+2%2C+2001")) +insDocX(aux20017, gLnk("R", "July 3, 2001", "demoLargeRightFrame.html?July+3%2C+2001")) +insDocX(aux20017, gLnk("R", "July 4, 2001", "demoLargeRightFrame.html?July+4%2C+2001")) +insDocX(aux20017, gLnk("R", "July 5, 2001", "demoLargeRightFrame.html?July+5%2C+2001")) +insDocX(aux20017, gLnk("R", "July 6, 2001", "demoLargeRightFrame.html?July+6%2C+2001")) +insDocX(aux20017, gLnk("R", "July 7, 2001", "demoLargeRightFrame.html?July+7%2C+2001")) +insDocX(aux20017, gLnk("R", "July 8, 2001", "demoLargeRightFrame.html?July+8%2C+2001")) +insDocX(aux20017, gLnk("R", "July 9, 2001", "demoLargeRightFrame.html?July+9%2C+2001")) +insDocX(aux20017, gLnk("R", "July 10, 2001", "demoLargeRightFrame.html?July+10%2C+2001")) +insDocX(aux20017, gLnk("R", "July 11, 2001", "demoLargeRightFrame.html?July+11%2C+2001")) +insDocX(aux20017, gLnk("R", "July 12, 2001", "demoLargeRightFrame.html?July+12%2C+2001")) +insDocX(aux20017, gLnk("R", "July 13, 2001", "demoLargeRightFrame.html?July+13%2C+2001")) +insDocX(aux20017, gLnk("R", "July 14, 2001", "demoLargeRightFrame.html?July+14%2C+2001")) +insDocX(aux20017, gLnk("R", "July 15, 2001", "demoLargeRightFrame.html?July+15%2C+2001")) +insDocX(aux20017, gLnk("R", "July 16, 2001", "demoLargeRightFrame.html?July+16%2C+2001")) +insDocX(aux20017, gLnk("R", "July 17, 2001", "demoLargeRightFrame.html?July+17%2C+2001")) +insDocX(aux20017, gLnk("R", "July 18, 2001", "demoLargeRightFrame.html?July+18%2C+2001")) +insDocX(aux20017, gLnk("R", "July 19, 2001", "demoLargeRightFrame.html?July+19%2C+2001")) +insDocX(aux20017, gLnk("R", "July 20, 2001", "demoLargeRightFrame.html?July+20%2C+2001")) +insDocX(aux20017, gLnk("R", "July 21, 2001", "demoLargeRightFrame.html?July+21%2C+2001")) +insDocX(aux20017, gLnk("R", "July 22, 2001", "demoLargeRightFrame.html?July+22%2C+2001")) +insDocX(aux20017, gLnk("R", "July 23, 2001", "demoLargeRightFrame.html?July+23%2C+2001")) +insDocX(aux20017, gLnk("R", "July 24, 2001", "demoLargeRightFrame.html?July+24%2C+2001")) +insDocX(aux20017, gLnk("R", "July 25, 2001", "demoLargeRightFrame.html?July+25%2C+2001")) +insDocX(aux20017, gLnk("R", "July 26, 2001", "demoLargeRightFrame.html?July+26%2C+2001")) +insDocX(aux20017, gLnk("R", "July 27, 2001", "demoLargeRightFrame.html?July+27%2C+2001")) +insDocX(aux20017, gLnk("R", "July 28, 2001", "demoLargeRightFrame.html?July+28%2C+2001")) +insDocX(aux20017, gLnk("R", "July 29, 2001", "demoLargeRightFrame.html?July+29%2C+2001")) +insDocX(aux20017, gLnk("R", "July 30, 2001", "demoLargeRightFrame.html?July+30%2C+2001")) +insDocX(aux20017, gLnk("R", "July 31, 2001", "demoLargeRightFrame.html?July+31%2C+2001")) +aux20018 = insFldX(aux2001, gFld("August", "javascript:parent.op()")) +insDocX(aux20018, gLnk("R", "August 1, 2001", "demoLargeRightFrame.html?August+1%2C+2001")) +insDocX(aux20018, gLnk("R", "August 2, 2001", "demoLargeRightFrame.html?August+2%2C+2001")) +insDocX(aux20018, gLnk("R", "August 3, 2001", "demoLargeRightFrame.html?August+3%2C+2001")) +insDocX(aux20018, gLnk("R", "August 4, 2001", "demoLargeRightFrame.html?August+4%2C+2001")) +insDocX(aux20018, gLnk("R", "August 5, 2001", "demoLargeRightFrame.html?August+5%2C+2001")) +insDocX(aux20018, gLnk("R", "August 6, 2001", "demoLargeRightFrame.html?August+6%2C+2001")) +insDocX(aux20018, gLnk("R", "August 7, 2001", "demoLargeRightFrame.html?August+7%2C+2001")) +insDocX(aux20018, gLnk("R", "August 8, 2001", "demoLargeRightFrame.html?August+8%2C+2001")) +insDocX(aux20018, gLnk("R", "August 9, 2001", "demoLargeRightFrame.html?August+9%2C+2001")) +insDocX(aux20018, gLnk("R", "August 10, 2001", "demoLargeRightFrame.html?August+10%2C+2001")) +insDocX(aux20018, gLnk("R", "August 11, 2001", "demoLargeRightFrame.html?August+11%2C+2001")) +insDocX(aux20018, gLnk("R", "August 12, 2001", "demoLargeRightFrame.html?August+12%2C+2001")) +insDocX(aux20018, gLnk("R", "August 13, 2001", "demoLargeRightFrame.html?August+13%2C+2001")) +insDocX(aux20018, gLnk("R", "August 14, 2001", "demoLargeRightFrame.html?August+14%2C+2001")) +insDocX(aux20018, gLnk("R", "August 15, 2001", "demoLargeRightFrame.html?August+15%2C+2001")) +insDocX(aux20018, gLnk("R", "August 16, 2001", "demoLargeRightFrame.html?August+16%2C+2001")) +insDocX(aux20018, gLnk("R", "August 17, 2001", "demoLargeRightFrame.html?August+17%2C+2001")) +insDocX(aux20018, gLnk("R", "August 18, 2001", "demoLargeRightFrame.html?August+18%2C+2001")) +insDocX(aux20018, gLnk("R", "August 19, 2001", "demoLargeRightFrame.html?August+19%2C+2001")) +insDocX(aux20018, gLnk("R", "August 20, 2001", "demoLargeRightFrame.html?August+20%2C+2001")) +insDocX(aux20018, gLnk("R", "August 21, 2001", "demoLargeRightFrame.html?August+21%2C+2001")) +insDocX(aux20018, gLnk("R", "August 22, 2001", "demoLargeRightFrame.html?August+22%2C+2001")) +insDocX(aux20018, gLnk("R", "August 23, 2001", "demoLargeRightFrame.html?August+23%2C+2001")) +insDocX(aux20018, gLnk("R", "August 24, 2001", "demoLargeRightFrame.html?August+24%2C+2001")) +insDocX(aux20018, gLnk("R", "August 25, 2001", "demoLargeRightFrame.html?August+25%2C+2001")) +insDocX(aux20018, gLnk("R", "August 26, 2001", "demoLargeRightFrame.html?August+26%2C+2001")) +insDocX(aux20018, gLnk("R", "August 27, 2001", "demoLargeRightFrame.html?August+27%2C+2001")) +insDocX(aux20018, gLnk("R", "August 28, 2001", "demoLargeRightFrame.html?August+28%2C+2001")) +insDocX(aux20018, gLnk("R", "August 29, 2001", "demoLargeRightFrame.html?August+29%2C+2001")) +insDocX(aux20018, gLnk("R", "August 30, 2001", "demoLargeRightFrame.html?August+30%2C+2001")) +insDocX(aux20018, gLnk("R", "August 31, 2001", "demoLargeRightFrame.html?August+31%2C+2001")) +aux20019 = insFldX(aux2001, gFld("September", "javascript:parent.op()")) +insDocX(aux20019, gLnk("R", "September 1, 2001", "demoLargeRightFrame.html?September+1%2C+2001")) +insDocX(aux20019, gLnk("R", "September 2, 2001", "demoLargeRightFrame.html?September+2%2C+2001")) +insDocX(aux20019, gLnk("R", "September 3, 2001", "demoLargeRightFrame.html?September+3%2C+2001")) +insDocX(aux20019, gLnk("R", "September 4, 2001", "demoLargeRightFrame.html?September+4%2C+2001")) +insDocX(aux20019, gLnk("R", "September 5, 2001", "demoLargeRightFrame.html?September+5%2C+2001")) +insDocX(aux20019, gLnk("R", "September 6, 2001", "demoLargeRightFrame.html?September+6%2C+2001")) +insDocX(aux20019, gLnk("R", "September 7, 2001", "demoLargeRightFrame.html?September+7%2C+2001")) +insDocX(aux20019, gLnk("R", "September 8, 2001", "demoLargeRightFrame.html?September+8%2C+2001")) +insDocX(aux20019, gLnk("R", "September 9, 2001", "demoLargeRightFrame.html?September+9%2C+2001")) +insDocX(aux20019, gLnk("R", "September 10, 2001", "demoLargeRightFrame.html?September+10%2C+2001")) +insDocX(aux20019, gLnk("R", "September 11, 2001", "demoLargeRightFrame.html?September+11%2C+2001")) +insDocX(aux20019, gLnk("R", "September 12, 2001", "demoLargeRightFrame.html?September+12%2C+2001")) +insDocX(aux20019, gLnk("R", "September 13, 2001", "demoLargeRightFrame.html?September+13%2C+2001")) +insDocX(aux20019, gLnk("R", "September 14, 2001", "demoLargeRightFrame.html?September+14%2C+2001")) +insDocX(aux20019, gLnk("R", "September 15, 2001", "demoLargeRightFrame.html?September+15%2C+2001")) +insDocX(aux20019, gLnk("R", "September 16, 2001", "demoLargeRightFrame.html?September+16%2C+2001")) +insDocX(aux20019, gLnk("R", "September 17, 2001", "demoLargeRightFrame.html?September+17%2C+2001")) +insDocX(aux20019, gLnk("R", "September 18, 2001", "demoLargeRightFrame.html?September+18%2C+2001")) +insDocX(aux20019, gLnk("R", "September 19, 2001", "demoLargeRightFrame.html?September+19%2C+2001")) +insDocX(aux20019, gLnk("R", "September 20, 2001", "demoLargeRightFrame.html?September+20%2C+2001")) +insDocX(aux20019, gLnk("R", "September 21, 2001", "demoLargeRightFrame.html?September+21%2C+2001")) +insDocX(aux20019, gLnk("R", "September 22, 2001", "demoLargeRightFrame.html?September+22%2C+2001")) +insDocX(aux20019, gLnk("R", "September 23, 2001", "demoLargeRightFrame.html?September+23%2C+2001")) +insDocX(aux20019, gLnk("R", "September 24, 2001", "demoLargeRightFrame.html?September+24%2C+2001")) +insDocX(aux20019, gLnk("R", "September 25, 2001", "demoLargeRightFrame.html?September+25%2C+2001")) +insDocX(aux20019, gLnk("R", "September 26, 2001", "demoLargeRightFrame.html?September+26%2C+2001")) +insDocX(aux20019, gLnk("R", "September 27, 2001", "demoLargeRightFrame.html?September+27%2C+2001")) +insDocX(aux20019, gLnk("R", "September 28, 2001", "demoLargeRightFrame.html?September+28%2C+2001")) +insDocX(aux20019, gLnk("R", "September 29, 2001", "demoLargeRightFrame.html?September+29%2C+2001")) +insDocX(aux20019, gLnk("R", "September 30, 2001", "demoLargeRightFrame.html?September+30%2C+2001")) +aux200110 = insFldX(aux2001, gFld("October", "javascript:parent.op()")) +insDocX(aux200110, gLnk("R", "October 1, 2001", "demoLargeRightFrame.html?October+1%2C+2001")) +insDocX(aux200110, gLnk("R", "October 2, 2001", "demoLargeRightFrame.html?October+2%2C+2001")) +insDocX(aux200110, gLnk("R", "October 3, 2001", "demoLargeRightFrame.html?October+3%2C+2001")) +insDocX(aux200110, gLnk("R", "October 4, 2001", "demoLargeRightFrame.html?October+4%2C+2001")) +insDocX(aux200110, gLnk("R", "October 5, 2001", "demoLargeRightFrame.html?October+5%2C+2001")) +insDocX(aux200110, gLnk("R", "October 6, 2001", "demoLargeRightFrame.html?October+6%2C+2001")) +insDocX(aux200110, gLnk("R", "October 7, 2001", "demoLargeRightFrame.html?October+7%2C+2001")) +insDocX(aux200110, gLnk("R", "October 8, 2001", "demoLargeRightFrame.html?October+8%2C+2001")) +insDocX(aux200110, gLnk("R", "October 9, 2001", "demoLargeRightFrame.html?October+9%2C+2001")) +insDocX(aux200110, gLnk("R", "October 10, 2001", "demoLargeRightFrame.html?October+10%2C+2001")) +insDocX(aux200110, gLnk("R", "October 11, 2001", "demoLargeRightFrame.html?October+11%2C+2001")) +insDocX(aux200110, gLnk("R", "October 12, 2001", "demoLargeRightFrame.html?October+12%2C+2001")) +insDocX(aux200110, gLnk("R", "October 13, 2001", "demoLargeRightFrame.html?October+13%2C+2001")) +insDocX(aux200110, gLnk("R", "October 14, 2001", "demoLargeRightFrame.html?October+14%2C+2001")) +insDocX(aux200110, gLnk("R", "October 15, 2001", "demoLargeRightFrame.html?October+15%2C+2001")) +insDocX(aux200110, gLnk("R", "October 16, 2001", "demoLargeRightFrame.html?October+16%2C+2001")) +insDocX(aux200110, gLnk("R", "October 17, 2001", "demoLargeRightFrame.html?October+17%2C+2001")) +insDocX(aux200110, gLnk("R", "October 18, 2001", "demoLargeRightFrame.html?October+18%2C+2001")) +insDocX(aux200110, gLnk("R", "October 19, 2001", "demoLargeRightFrame.html?October+19%2C+2001")) +insDocX(aux200110, gLnk("R", "October 20, 2001", "demoLargeRightFrame.html?October+20%2C+2001")) +insDocX(aux200110, gLnk("R", "October 21, 2001", "demoLargeRightFrame.html?October+21%2C+2001")) +insDocX(aux200110, gLnk("R", "October 22, 2001", "demoLargeRightFrame.html?October+22%2C+2001")) +insDocX(aux200110, gLnk("R", "October 23, 2001", "demoLargeRightFrame.html?October+23%2C+2001")) +insDocX(aux200110, gLnk("R", "October 24, 2001", "demoLargeRightFrame.html?October+24%2C+2001")) +insDocX(aux200110, gLnk("R", "October 25, 2001", "demoLargeRightFrame.html?October+25%2C+2001")) +insDocX(aux200110, gLnk("R", "October 26, 2001", "demoLargeRightFrame.html?October+26%2C+2001")) +insDocX(aux200110, gLnk("R", "October 27, 2001", "demoLargeRightFrame.html?October+27%2C+2001")) +insDocX(aux200110, gLnk("R", "October 28, 2001", "demoLargeRightFrame.html?October+28%2C+2001")) +insDocX(aux200110, gLnk("R", "October 29, 2001", "demoLargeRightFrame.html?October+29%2C+2001")) +insDocX(aux200110, gLnk("R", "October 30, 2001", "demoLargeRightFrame.html?October+30%2C+2001")) +insDocX(aux200110, gLnk("R", "October 31, 2001", "demoLargeRightFrame.html?October+31%2C+2001")) +aux200111 = insFldX(aux2001, gFld("November", "javascript:parent.op()")) +insDocX(aux200111, gLnk("R", "November 1, 2001", "demoLargeRightFrame.html?November+1%2C+2001")) +insDocX(aux200111, gLnk("R", "November 2, 2001", "demoLargeRightFrame.html?November+2%2C+2001")) +insDocX(aux200111, gLnk("R", "November 3, 2001", "demoLargeRightFrame.html?November+3%2C+2001")) +insDocX(aux200111, gLnk("R", "November 4, 2001", "demoLargeRightFrame.html?November+4%2C+2001")) +insDocX(aux200111, gLnk("R", "November 5, 2001", "demoLargeRightFrame.html?November+5%2C+2001")) +insDocX(aux200111, gLnk("R", "November 6, 2001", "demoLargeRightFrame.html?November+6%2C+2001")) +insDocX(aux200111, gLnk("R", "November 7, 2001", "demoLargeRightFrame.html?November+7%2C+2001")) +insDocX(aux200111, gLnk("R", "November 8, 2001", "demoLargeRightFrame.html?November+8%2C+2001")) +insDocX(aux200111, gLnk("R", "November 9, 2001", "demoLargeRightFrame.html?November+9%2C+2001")) +insDocX(aux200111, gLnk("R", "November 10, 2001", "demoLargeRightFrame.html?November+10%2C+2001")) +insDocX(aux200111, gLnk("R", "November 11, 2001", "demoLargeRightFrame.html?November+11%2C+2001")) +insDocX(aux200111, gLnk("R", "November 12, 2001", "demoLargeRightFrame.html?November+12%2C+2001")) +insDocX(aux200111, gLnk("R", "November 13, 2001", "demoLargeRightFrame.html?November+13%2C+2001")) +insDocX(aux200111, gLnk("R", "November 14, 2001", "demoLargeRightFrame.html?November+14%2C+2001")) +insDocX(aux200111, gLnk("R", "November 15, 2001", "demoLargeRightFrame.html?November+15%2C+2001")) +insDocX(aux200111, gLnk("R", "November 16, 2001", "demoLargeRightFrame.html?November+16%2C+2001")) +insDocX(aux200111, gLnk("R", "November 17, 2001", "demoLargeRightFrame.html?November+17%2C+2001")) +insDocX(aux200111, gLnk("R", "November 18, 2001", "demoLargeRightFrame.html?November+18%2C+2001")) +insDocX(aux200111, gLnk("R", "November 19, 2001", "demoLargeRightFrame.html?November+19%2C+2001")) +insDocX(aux200111, gLnk("R", "November 20, 2001", "demoLargeRightFrame.html?November+20%2C+2001")) +insDocX(aux200111, gLnk("R", "November 21, 2001", "demoLargeRightFrame.html?November+21%2C+2001")) +insDocX(aux200111, gLnk("R", "November 22, 2001", "demoLargeRightFrame.html?November+22%2C+2001")) +insDocX(aux200111, gLnk("R", "November 23, 2001", "demoLargeRightFrame.html?November+23%2C+2001")) +insDocX(aux200111, gLnk("R", "November 24, 2001", "demoLargeRightFrame.html?November+24%2C+2001")) +insDocX(aux200111, gLnk("R", "November 25, 2001", "demoLargeRightFrame.html?November+25%2C+2001")) +insDocX(aux200111, gLnk("R", "November 26, 2001", "demoLargeRightFrame.html?November+26%2C+2001")) +insDocX(aux200111, gLnk("R", "November 27, 2001", "demoLargeRightFrame.html?November+27%2C+2001")) +insDocX(aux200111, gLnk("R", "November 28, 2001", "demoLargeRightFrame.html?November+28%2C+2001")) +insDocX(aux200111, gLnk("R", "November 29, 2001", "demoLargeRightFrame.html?November+29%2C+2001")) +insDocX(aux200111, gLnk("R", "November 30, 2001", "demoLargeRightFrame.html?November+30%2C+2001")) +aux200112 = insFldX(aux2001, gFld("December", "javascript:parent.op()")) +insDocX(aux200112, gLnk("R", "December 1, 2001", "demoLargeRightFrame.html?December+1%2C+2001")) +insDocX(aux200112, gLnk("R", "December 2, 2001", "demoLargeRightFrame.html?December+2%2C+2001")) +insDocX(aux200112, gLnk("R", "December 3, 2001", "demoLargeRightFrame.html?December+3%2C+2001")) +insDocX(aux200112, gLnk("R", "December 4, 2001", "demoLargeRightFrame.html?December+4%2C+2001")) +insDocX(aux200112, gLnk("R", "December 5, 2001", "demoLargeRightFrame.html?December+5%2C+2001")) +insDocX(aux200112, gLnk("R", "December 6, 2001", "demoLargeRightFrame.html?December+6%2C+2001")) +insDocX(aux200112, gLnk("R", "December 7, 2001", "demoLargeRightFrame.html?December+7%2C+2001")) +insDocX(aux200112, gLnk("R", "December 8, 2001", "demoLargeRightFrame.html?December+8%2C+2001")) +insDocX(aux200112, gLnk("R", "December 9, 2001", "demoLargeRightFrame.html?December+9%2C+2001")) +insDocX(aux200112, gLnk("R", "December 10, 2001", "demoLargeRightFrame.html?December+10%2C+2001")) +insDocX(aux200112, gLnk("R", "December 11, 2001", "demoLargeRightFrame.html?December+11%2C+2001")) +insDocX(aux200112, gLnk("R", "December 12, 2001", "demoLargeRightFrame.html?December+12%2C+2001")) +insDocX(aux200112, gLnk("R", "December 13, 2001", "demoLargeRightFrame.html?December+13%2C+2001")) +insDocX(aux200112, gLnk("R", "December 14, 2001", "demoLargeRightFrame.html?December+14%2C+2001")) +insDocX(aux200112, gLnk("R", "December 15, 2001", "demoLargeRightFrame.html?December+15%2C+2001")) +insDocX(aux200112, gLnk("R", "December 16, 2001", "demoLargeRightFrame.html?December+16%2C+2001")) +insDocX(aux200112, gLnk("R", "December 17, 2001", "demoLargeRightFrame.html?December+17%2C+2001")) +insDocX(aux200112, gLnk("R", "December 18, 2001", "demoLargeRightFrame.html?December+18%2C+2001")) +insDocX(aux200112, gLnk("R", "December 19, 2001", "demoLargeRightFrame.html?December+19%2C+2001")) +insDocX(aux200112, gLnk("R", "December 20, 2001", "demoLargeRightFrame.html?December+20%2C+2001")) +insDocX(aux200112, gLnk("R", "December 21, 2001", "demoLargeRightFrame.html?December+21%2C+2001")) +insDocX(aux200112, gLnk("R", "December 22, 2001", "demoLargeRightFrame.html?December+22%2C+2001")) +insDocX(aux200112, gLnk("R", "December 23, 2001", "demoLargeRightFrame.html?December+23%2C+2001")) +insDocX(aux200112, gLnk("R", "December 24, 2001", "demoLargeRightFrame.html?December+24%2C+2001")) +insDocX(aux200112, gLnk("R", "December 25, 2001", "demoLargeRightFrame.html?December+25%2C+2001")) +insDocX(aux200112, gLnk("R", "December 26, 2001", "demoLargeRightFrame.html?December+26%2C+2001")) +insDocX(aux200112, gLnk("R", "December 27, 2001", "demoLargeRightFrame.html?December+27%2C+2001")) +insDocX(aux200112, gLnk("R", "December 28, 2001", "demoLargeRightFrame.html?December+28%2C+2001")) +insDocX(aux200112, gLnk("R", "December 29, 2001", "demoLargeRightFrame.html?December+29%2C+2001")) +insDocX(aux200112, gLnk("R", "December 30, 2001", "demoLargeRightFrame.html?December+30%2C+2001")) +insDocX(aux200112, gLnk("R", "December 31, 2001", "demoLargeRightFrame.html?December+31%2C+2001")) +aux2002 = insFldX(foldersTree, gFld("2002", "javascript:parent.op()")) +aux20021 = insFldX(aux2002, gFld("January", "javascript:parent.op()")) +insDocX(aux20021, gLnk("R", "January 1, 2002", "demoLargeRightFrame.html?January+1%2C+2002")) +insDocX(aux20021, gLnk("R", "January 2, 2002", "demoLargeRightFrame.html?January+2%2C+2002")) +insDocX(aux20021, gLnk("R", "January 3, 2002", "demoLargeRightFrame.html?January+3%2C+2002")) +insDocX(aux20021, gLnk("R", "January 4, 2002", "demoLargeRightFrame.html?January+4%2C+2002")) +insDocX(aux20021, gLnk("R", "January 5, 2002", "demoLargeRightFrame.html?January+5%2C+2002")) +insDocX(aux20021, gLnk("R", "January 6, 2002", "demoLargeRightFrame.html?January+6%2C+2002")) +insDocX(aux20021, gLnk("R", "January 7, 2002", "demoLargeRightFrame.html?January+7%2C+2002")) +insDocX(aux20021, gLnk("R", "January 8, 2002", "demoLargeRightFrame.html?January+8%2C+2002")) +insDocX(aux20021, gLnk("R", "January 9, 2002", "demoLargeRightFrame.html?January+9%2C+2002")) +insDocX(aux20021, gLnk("R", "January 10, 2002", "demoLargeRightFrame.html?January+10%2C+2002")) +insDocX(aux20021, gLnk("R", "January 11, 2002", "demoLargeRightFrame.html?January+11%2C+2002")) +insDocX(aux20021, gLnk("R", "January 12, 2002", "demoLargeRightFrame.html?January+12%2C+2002")) +insDocX(aux20021, gLnk("R", "January 13, 2002", "demoLargeRightFrame.html?January+13%2C+2002")) +insDocX(aux20021, gLnk("R", "January 14, 2002", "demoLargeRightFrame.html?January+14%2C+2002")) +insDocX(aux20021, gLnk("R", "January 15, 2002", "demoLargeRightFrame.html?January+15%2C+2002")) +insDocX(aux20021, gLnk("R", "January 16, 2002", "demoLargeRightFrame.html?January+16%2C+2002")) +insDocX(aux20021, gLnk("R", "January 17, 2002", "demoLargeRightFrame.html?January+17%2C+2002")) +insDocX(aux20021, gLnk("R", "January 18, 2002", "demoLargeRightFrame.html?January+18%2C+2002")) +insDocX(aux20021, gLnk("R", "January 19, 2002", "demoLargeRightFrame.html?January+19%2C+2002")) +insDocX(aux20021, gLnk("R", "January 20, 2002", "demoLargeRightFrame.html?January+20%2C+2002")) +insDocX(aux20021, gLnk("R", "January 21, 2002", "demoLargeRightFrame.html?January+21%2C+2002")) +insDocX(aux20021, gLnk("R", "January 22, 2002", "demoLargeRightFrame.html?January+22%2C+2002")) +insDocX(aux20021, gLnk("R", "January 23, 2002", "demoLargeRightFrame.html?January+23%2C+2002")) +insDocX(aux20021, gLnk("R", "January 24, 2002", "demoLargeRightFrame.html?January+24%2C+2002")) +insDocX(aux20021, gLnk("R", "January 25, 2002", "demoLargeRightFrame.html?January+25%2C+2002")) +insDocX(aux20021, gLnk("R", "January 26, 2002", "demoLargeRightFrame.html?January+26%2C+2002")) +insDocX(aux20021, gLnk("R", "January 27, 2002", "demoLargeRightFrame.html?January+27%2C+2002")) +insDocX(aux20021, gLnk("R", "January 28, 2002", "demoLargeRightFrame.html?January+28%2C+2002")) +insDocX(aux20021, gLnk("R", "January 29, 2002", "demoLargeRightFrame.html?January+29%2C+2002")) +insDocX(aux20021, gLnk("R", "January 30, 2002", "demoLargeRightFrame.html?January+30%2C+2002")) +insDocX(aux20021, gLnk("R", "January 31, 2002", "demoLargeRightFrame.html?January+31%2C+2002")) +aux20022 = insFldX(aux2002, gFld("February", "javascript:parent.op()")) +insDocX(aux20022, gLnk("R", "February 1, 2002", "demoLargeRightFrame.html?February+1%2C+2002")) +insDocX(aux20022, gLnk("R", "February 2, 2002", "demoLargeRightFrame.html?February+2%2C+2002")) +insDocX(aux20022, gLnk("R", "February 3, 2002", "demoLargeRightFrame.html?February+3%2C+2002")) +insDocX(aux20022, gLnk("R", "February 4, 2002", "demoLargeRightFrame.html?February+4%2C+2002")) +insDocX(aux20022, gLnk("R", "February 5, 2002", "demoLargeRightFrame.html?February+5%2C+2002")) +insDocX(aux20022, gLnk("R", "February 6, 2002", "demoLargeRightFrame.html?February+6%2C+2002")) +insDocX(aux20022, gLnk("R", "February 7, 2002", "demoLargeRightFrame.html?February+7%2C+2002")) +insDocX(aux20022, gLnk("R", "February 8, 2002", "demoLargeRightFrame.html?February+8%2C+2002")) +insDocX(aux20022, gLnk("R", "February 9, 2002", "demoLargeRightFrame.html?February+9%2C+2002")) +insDocX(aux20022, gLnk("R", "February 10, 2002", "demoLargeRightFrame.html?February+10%2C+2002")) +insDocX(aux20022, gLnk("R", "February 11, 2002", "demoLargeRightFrame.html?February+11%2C+2002")) +insDocX(aux20022, gLnk("R", "February 12, 2002", "demoLargeRightFrame.html?February+12%2C+2002")) +insDocX(aux20022, gLnk("R", "February 13, 2002", "demoLargeRightFrame.html?February+13%2C+2002")) +insDocX(aux20022, gLnk("R", "February 14, 2002", "demoLargeRightFrame.html?February+14%2C+2002")) +insDocX(aux20022, gLnk("R", "February 15, 2002", "demoLargeRightFrame.html?February+15%2C+2002")) +insDocX(aux20022, gLnk("R", "February 16, 2002", "demoLargeRightFrame.html?February+16%2C+2002")) +insDocX(aux20022, gLnk("R", "February 17, 2002", "demoLargeRightFrame.html?February+17%2C+2002")) +insDocX(aux20022, gLnk("R", "February 18, 2002", "demoLargeRightFrame.html?February+18%2C+2002")) +insDocX(aux20022, gLnk("R", "February 19, 2002", "demoLargeRightFrame.html?February+19%2C+2002")) +insDocX(aux20022, gLnk("R", "February 20, 2002", "demoLargeRightFrame.html?February+20%2C+2002")) +insDocX(aux20022, gLnk("R", "February 21, 2002", "demoLargeRightFrame.html?February+21%2C+2002")) +insDocX(aux20022, gLnk("R", "February 22, 2002", "demoLargeRightFrame.html?February+22%2C+2002")) +insDocX(aux20022, gLnk("R", "February 23, 2002", "demoLargeRightFrame.html?February+23%2C+2002")) +insDocX(aux20022, gLnk("R", "February 24, 2002", "demoLargeRightFrame.html?February+24%2C+2002")) +insDocX(aux20022, gLnk("R", "February 25, 2002", "demoLargeRightFrame.html?February+25%2C+2002")) +insDocX(aux20022, gLnk("R", "February 26, 2002", "demoLargeRightFrame.html?February+26%2C+2002")) +insDocX(aux20022, gLnk("R", "February 27, 2002", "demoLargeRightFrame.html?February+27%2C+2002")) +insDocX(aux20022, gLnk("R", "February 28, 2002", "demoLargeRightFrame.html?February+28%2C+2002")) +aux20023 = insFldX(aux2002, gFld("March", "javascript:parent.op()")) +insDocX(aux20023, gLnk("R", "March 1, 2002", "demoLargeRightFrame.html?March+1%2C+2002")) +insDocX(aux20023, gLnk("R", "March 2, 2002", "demoLargeRightFrame.html?March+2%2C+2002")) +insDocX(aux20023, gLnk("R", "March 3, 2002", "demoLargeRightFrame.html?March+3%2C+2002")) +insDocX(aux20023, gLnk("R", "March 4, 2002", "demoLargeRightFrame.html?March+4%2C+2002")) +insDocX(aux20023, gLnk("R", "March 5, 2002", "demoLargeRightFrame.html?March+5%2C+2002")) +insDocX(aux20023, gLnk("R", "March 6, 2002", "demoLargeRightFrame.html?March+6%2C+2002")) +insDocX(aux20023, gLnk("R", "March 7, 2002", "demoLargeRightFrame.html?March+7%2C+2002")) +insDocX(aux20023, gLnk("R", "March 8, 2002", "demoLargeRightFrame.html?March+8%2C+2002")) +insDocX(aux20023, gLnk("R", "March 9, 2002", "demoLargeRightFrame.html?March+9%2C+2002")) +insDocX(aux20023, gLnk("R", "March 10, 2002", "demoLargeRightFrame.html?March+10%2C+2002")) +insDocX(aux20023, gLnk("R", "March 11, 2002", "demoLargeRightFrame.html?March+11%2C+2002")) +insDocX(aux20023, gLnk("R", "March 12, 2002", "demoLargeRightFrame.html?March+12%2C+2002")) +insDocX(aux20023, gLnk("R", "March 13, 2002", "demoLargeRightFrame.html?March+13%2C+2002")) +insDocX(aux20023, gLnk("R", "March 14, 2002", "demoLargeRightFrame.html?March+14%2C+2002")) +insDocX(aux20023, gLnk("R", "March 15, 2002", "demoLargeRightFrame.html?March+15%2C+2002")) +insDocX(aux20023, gLnk("R", "March 16, 2002", "demoLargeRightFrame.html?March+16%2C+2002")) +insDocX(aux20023, gLnk("R", "March 17, 2002", "demoLargeRightFrame.html?March+17%2C+2002")) +insDocX(aux20023, gLnk("R", "March 18, 2002", "demoLargeRightFrame.html?March+18%2C+2002")) +insDocX(aux20023, gLnk("R", "March 19, 2002", "demoLargeRightFrame.html?March+19%2C+2002")) +insDocX(aux20023, gLnk("R", "March 20, 2002", "demoLargeRightFrame.html?March+20%2C+2002")) +insDocX(aux20023, gLnk("R", "March 21, 2002", "demoLargeRightFrame.html?March+21%2C+2002")) +insDocX(aux20023, gLnk("R", "March 22, 2002", "demoLargeRightFrame.html?March+22%2C+2002")) +insDocX(aux20023, gLnk("R", "March 23, 2002", "demoLargeRightFrame.html?March+23%2C+2002")) +insDocX(aux20023, gLnk("R", "March 24, 2002", "demoLargeRightFrame.html?March+24%2C+2002")) +insDocX(aux20023, gLnk("R", "March 25, 2002", "demoLargeRightFrame.html?March+25%2C+2002")) +insDocX(aux20023, gLnk("R", "March 26, 2002", "demoLargeRightFrame.html?March+26%2C+2002")) +insDocX(aux20023, gLnk("R", "March 27, 2002", "demoLargeRightFrame.html?March+27%2C+2002")) +insDocX(aux20023, gLnk("R", "March 28, 2002", "demoLargeRightFrame.html?March+28%2C+2002")) +insDocX(aux20023, gLnk("R", "March 29, 2002", "demoLargeRightFrame.html?March+29%2C+2002")) +insDocX(aux20023, gLnk("R", "March 30, 2002", "demoLargeRightFrame.html?March+30%2C+2002")) +insDocX(aux20023, gLnk("R", "March 31, 2002", "demoLargeRightFrame.html?March+31%2C+2002")) +aux20024 = insFldX(aux2002, gFld("April", "javascript:parent.op()")) +insDocX(aux20024, gLnk("R", "April 1, 2002", "demoLargeRightFrame.html?April+1%2C+2002")) +insDocX(aux20024, gLnk("R", "April 2, 2002", "demoLargeRightFrame.html?April+2%2C+2002")) +insDocX(aux20024, gLnk("R", "April 3, 2002", "demoLargeRightFrame.html?April+3%2C+2002")) +insDocX(aux20024, gLnk("R", "April 4, 2002", "demoLargeRightFrame.html?April+4%2C+2002")) +insDocX(aux20024, gLnk("R", "April 5, 2002", "demoLargeRightFrame.html?April+5%2C+2002")) +insDocX(aux20024, gLnk("R", "April 6, 2002", "demoLargeRightFrame.html?April+6%2C+2002")) +insDocX(aux20024, gLnk("R", "April 7, 2002", "demoLargeRightFrame.html?April+7%2C+2002")) +insDocX(aux20024, gLnk("R", "April 8, 2002", "demoLargeRightFrame.html?April+8%2C+2002")) +insDocX(aux20024, gLnk("R", "April 9, 2002", "demoLargeRightFrame.html?April+9%2C+2002")) +insDocX(aux20024, gLnk("R", "April 10, 2002", "demoLargeRightFrame.html?April+10%2C+2002")) +insDocX(aux20024, gLnk("R", "April 11, 2002", "demoLargeRightFrame.html?April+11%2C+2002")) +insDocX(aux20024, gLnk("R", "April 12, 2002", "demoLargeRightFrame.html?April+12%2C+2002")) +insDocX(aux20024, gLnk("R", "April 13, 2002", "demoLargeRightFrame.html?April+13%2C+2002")) +insDocX(aux20024, gLnk("R", "April 14, 2002", "demoLargeRightFrame.html?April+14%2C+2002")) +insDocX(aux20024, gLnk("R", "April 15, 2002", "demoLargeRightFrame.html?April+15%2C+2002")) +insDocX(aux20024, gLnk("R", "April 16, 2002", "demoLargeRightFrame.html?April+16%2C+2002")) +insDocX(aux20024, gLnk("R", "April 17, 2002", "demoLargeRightFrame.html?April+17%2C+2002")) +insDocX(aux20024, gLnk("R", "April 18, 2002", "demoLargeRightFrame.html?April+18%2C+2002")) +insDocX(aux20024, gLnk("R", "April 19, 2002", "demoLargeRightFrame.html?April+19%2C+2002")) +insDocX(aux20024, gLnk("R", "April 20, 2002", "demoLargeRightFrame.html?April+20%2C+2002")) +insDocX(aux20024, gLnk("R", "April 21, 2002", "demoLargeRightFrame.html?April+21%2C+2002")) +insDocX(aux20024, gLnk("R", "April 22, 2002", "demoLargeRightFrame.html?April+22%2C+2002")) +insDocX(aux20024, gLnk("R", "April 23, 2002", "demoLargeRightFrame.html?April+23%2C+2002")) +insDocX(aux20024, gLnk("R", "April 24, 2002", "demoLargeRightFrame.html?April+24%2C+2002")) +insDocX(aux20024, gLnk("R", "April 25, 2002", "demoLargeRightFrame.html?April+25%2C+2002")) +insDocX(aux20024, gLnk("R", "April 26, 2002", "demoLargeRightFrame.html?April+26%2C+2002")) +insDocX(aux20024, gLnk("R", "April 27, 2002", "demoLargeRightFrame.html?April+27%2C+2002")) +insDocX(aux20024, gLnk("R", "April 28, 2002", "demoLargeRightFrame.html?April+28%2C+2002")) +insDocX(aux20024, gLnk("R", "April 29, 2002", "demoLargeRightFrame.html?April+29%2C+2002")) +insDocX(aux20024, gLnk("R", "April 30, 2002", "demoLargeRightFrame.html?April+30%2C+2002")) +aux20025 = insFldX(aux2002, gFld("May", "javascript:parent.op()")) +insDocX(aux20025, gLnk("R", "May 1, 2002", "demoLargeRightFrame.html?May+1%2C+2002")) +insDocX(aux20025, gLnk("R", "May 2, 2002", "demoLargeRightFrame.html?May+2%2C+2002")) +insDocX(aux20025, gLnk("R", "May 3, 2002", "demoLargeRightFrame.html?May+3%2C+2002")) +insDocX(aux20025, gLnk("R", "May 4, 2002", "demoLargeRightFrame.html?May+4%2C+2002")) +insDocX(aux20025, gLnk("R", "May 5, 2002", "demoLargeRightFrame.html?May+5%2C+2002")) +insDocX(aux20025, gLnk("R", "May 6, 2002", "demoLargeRightFrame.html?May+6%2C+2002")) +insDocX(aux20025, gLnk("R", "May 7, 2002", "demoLargeRightFrame.html?May+7%2C+2002")) +insDocX(aux20025, gLnk("R", "May 8, 2002", "demoLargeRightFrame.html?May+8%2C+2002")) +insDocX(aux20025, gLnk("R", "May 9, 2002", "demoLargeRightFrame.html?May+9%2C+2002")) +insDocX(aux20025, gLnk("R", "May 10, 2002", "demoLargeRightFrame.html?May+10%2C+2002")) +insDocX(aux20025, gLnk("R", "May 11, 2002", "demoLargeRightFrame.html?May+11%2C+2002")) +insDocX(aux20025, gLnk("R", "May 12, 2002", "demoLargeRightFrame.html?May+12%2C+2002")) +insDocX(aux20025, gLnk("R", "May 13, 2002", "demoLargeRightFrame.html?May+13%2C+2002")) +insDocX(aux20025, gLnk("R", "May 14, 2002", "demoLargeRightFrame.html?May+14%2C+2002")) +insDocX(aux20025, gLnk("R", "May 15, 2002", "demoLargeRightFrame.html?May+15%2C+2002")) +insDocX(aux20025, gLnk("R", "May 16, 2002", "demoLargeRightFrame.html?May+16%2C+2002")) +insDocX(aux20025, gLnk("R", "May 17, 2002", "demoLargeRightFrame.html?May+17%2C+2002")) +insDocX(aux20025, gLnk("R", "May 18, 2002", "demoLargeRightFrame.html?May+18%2C+2002")) +insDocX(aux20025, gLnk("R", "May 19, 2002", "demoLargeRightFrame.html?May+19%2C+2002")) +insDocX(aux20025, gLnk("R", "May 20, 2002", "demoLargeRightFrame.html?May+20%2C+2002")) +insDocX(aux20025, gLnk("R", "May 21, 2002", "demoLargeRightFrame.html?May+21%2C+2002")) +insDocX(aux20025, gLnk("R", "May 22, 2002", "demoLargeRightFrame.html?May+22%2C+2002")) +insDocX(aux20025, gLnk("R", "May 23, 2002", "demoLargeRightFrame.html?May+23%2C+2002")) +insDocX(aux20025, gLnk("R", "May 24, 2002", "demoLargeRightFrame.html?May+24%2C+2002")) +insDocX(aux20025, gLnk("R", "May 25, 2002", "demoLargeRightFrame.html?May+25%2C+2002")) +insDocX(aux20025, gLnk("R", "May 26, 2002", "demoLargeRightFrame.html?May+26%2C+2002")) +insDocX(aux20025, gLnk("R", "May 27, 2002", "demoLargeRightFrame.html?May+27%2C+2002")) +insDocX(aux20025, gLnk("R", "May 28, 2002", "demoLargeRightFrame.html?May+28%2C+2002")) +insDocX(aux20025, gLnk("R", "May 29, 2002", "demoLargeRightFrame.html?May+29%2C+2002")) +insDocX(aux20025, gLnk("R", "May 30, 2002", "demoLargeRightFrame.html?May+30%2C+2002")) +insDocX(aux20025, gLnk("R", "May 31, 2002", "demoLargeRightFrame.html?May+31%2C+2002")) +aux20026 = insFldX(aux2002, gFld("June", "javascript:parent.op()")) +insDocX(aux20026, gLnk("R", "June 1, 2002", "demoLargeRightFrame.html?June+1%2C+2002")) +insDocX(aux20026, gLnk("R", "June 2, 2002", "demoLargeRightFrame.html?June+2%2C+2002")) +insDocX(aux20026, gLnk("R", "June 3, 2002", "demoLargeRightFrame.html?June+3%2C+2002")) +insDocX(aux20026, gLnk("R", "June 4, 2002", "demoLargeRightFrame.html?June+4%2C+2002")) +insDocX(aux20026, gLnk("R", "June 5, 2002", "demoLargeRightFrame.html?June+5%2C+2002")) +insDocX(aux20026, gLnk("R", "June 6, 2002", "demoLargeRightFrame.html?June+6%2C+2002")) +insDocX(aux20026, gLnk("R", "June 7, 2002", "demoLargeRightFrame.html?June+7%2C+2002")) +insDocX(aux20026, gLnk("R", "June 8, 2002", "demoLargeRightFrame.html?June+8%2C+2002")) +insDocX(aux20026, gLnk("R", "June 9, 2002", "demoLargeRightFrame.html?June+9%2C+2002")) +insDocX(aux20026, gLnk("R", "June 10, 2002", "demoLargeRightFrame.html?June+10%2C+2002")) +insDocX(aux20026, gLnk("R", "June 11, 2002", "demoLargeRightFrame.html?June+11%2C+2002")) +insDocX(aux20026, gLnk("R", "June 12, 2002", "demoLargeRightFrame.html?June+12%2C+2002")) +insDocX(aux20026, gLnk("R", "June 13, 2002", "demoLargeRightFrame.html?June+13%2C+2002")) +insDocX(aux20026, gLnk("R", "June 14, 2002", "demoLargeRightFrame.html?June+14%2C+2002")) +insDocX(aux20026, gLnk("R", "June 15, 2002", "demoLargeRightFrame.html?June+15%2C+2002")) +insDocX(aux20026, gLnk("R", "June 16, 2002", "demoLargeRightFrame.html?June+16%2C+2002")) +insDocX(aux20026, gLnk("R", "June 17, 2002", "demoLargeRightFrame.html?June+17%2C+2002")) +insDocX(aux20026, gLnk("R", "June 18, 2002", "demoLargeRightFrame.html?June+18%2C+2002")) +insDocX(aux20026, gLnk("R", "June 19, 2002", "demoLargeRightFrame.html?June+19%2C+2002")) +insDocX(aux20026, gLnk("R", "June 20, 2002", "demoLargeRightFrame.html?June+20%2C+2002")) +insDocX(aux20026, gLnk("R", "June 21, 2002", "demoLargeRightFrame.html?June+21%2C+2002")) +insDocX(aux20026, gLnk("R", "June 22, 2002", "demoLargeRightFrame.html?June+22%2C+2002")) +insDocX(aux20026, gLnk("R", "June 23, 2002", "demoLargeRightFrame.html?June+23%2C+2002")) +insDocX(aux20026, gLnk("R", "June 24, 2002", "demoLargeRightFrame.html?June+24%2C+2002")) +insDocX(aux20026, gLnk("R", "June 25, 2002", "demoLargeRightFrame.html?June+25%2C+2002")) +insDocX(aux20026, gLnk("R", "June 26, 2002", "demoLargeRightFrame.html?June+26%2C+2002")) +insDocX(aux20026, gLnk("R", "June 27, 2002", "demoLargeRightFrame.html?June+27%2C+2002")) +insDocX(aux20026, gLnk("R", "June 28, 2002", "demoLargeRightFrame.html?June+28%2C+2002")) +insDocX(aux20026, gLnk("R", "June 29, 2002", "demoLargeRightFrame.html?June+29%2C+2002")) +insDocX(aux20026, gLnk("R", "June 30, 2002", "demoLargeRightFrame.html?June+30%2C+2002")) +aux20027 = insFldX(aux2002, gFld("July", "javascript:parent.op()")) +insDocX(aux20027, gLnk("R", "July 1, 2002", "demoLargeRightFrame.html?July+1%2C+2002")) +insDocX(aux20027, gLnk("R", "July 2, 2002", "demoLargeRightFrame.html?July+2%2C+2002")) +insDocX(aux20027, gLnk("R", "July 3, 2002", "demoLargeRightFrame.html?July+3%2C+2002")) +insDocX(aux20027, gLnk("R", "July 4, 2002", "demoLargeRightFrame.html?July+4%2C+2002")) +insDocX(aux20027, gLnk("R", "July 5, 2002", "demoLargeRightFrame.html?July+5%2C+2002")) +insDocX(aux20027, gLnk("R", "July 6, 2002", "demoLargeRightFrame.html?July+6%2C+2002")) +insDocX(aux20027, gLnk("R", "July 7, 2002", "demoLargeRightFrame.html?July+7%2C+2002")) +insDocX(aux20027, gLnk("R", "July 8, 2002", "demoLargeRightFrame.html?July+8%2C+2002")) +insDocX(aux20027, gLnk("R", "July 9, 2002", "demoLargeRightFrame.html?July+9%2C+2002")) +insDocX(aux20027, gLnk("R", "July 10, 2002", "demoLargeRightFrame.html?July+10%2C+2002")) +insDocX(aux20027, gLnk("R", "July 11, 2002", "demoLargeRightFrame.html?July+11%2C+2002")) +insDocX(aux20027, gLnk("R", "July 12, 2002", "demoLargeRightFrame.html?July+12%2C+2002")) +insDocX(aux20027, gLnk("R", "July 13, 2002", "demoLargeRightFrame.html?July+13%2C+2002")) +insDocX(aux20027, gLnk("R", "July 14, 2002", "demoLargeRightFrame.html?July+14%2C+2002")) +insDocX(aux20027, gLnk("R", "July 15, 2002", "demoLargeRightFrame.html?July+15%2C+2002")) +insDocX(aux20027, gLnk("R", "July 16, 2002", "demoLargeRightFrame.html?July+16%2C+2002")) +insDocX(aux20027, gLnk("R", "July 17, 2002", "demoLargeRightFrame.html?July+17%2C+2002")) +insDocX(aux20027, gLnk("R", "July 18, 2002", "demoLargeRightFrame.html?July+18%2C+2002")) +insDocX(aux20027, gLnk("R", "July 19, 2002", "demoLargeRightFrame.html?July+19%2C+2002")) +insDocX(aux20027, gLnk("R", "July 20, 2002", "demoLargeRightFrame.html?July+20%2C+2002")) +insDocX(aux20027, gLnk("R", "July 21, 2002", "demoLargeRightFrame.html?July+21%2C+2002")) +insDocX(aux20027, gLnk("R", "July 22, 2002", "demoLargeRightFrame.html?July+22%2C+2002")) +insDocX(aux20027, gLnk("R", "July 23, 2002", "demoLargeRightFrame.html?July+23%2C+2002")) +insDocX(aux20027, gLnk("R", "July 24, 2002", "demoLargeRightFrame.html?July+24%2C+2002")) +insDocX(aux20027, gLnk("R", "July 25, 2002", "demoLargeRightFrame.html?July+25%2C+2002")) +insDocX(aux20027, gLnk("R", "July 26, 2002", "demoLargeRightFrame.html?July+26%2C+2002")) +insDocX(aux20027, gLnk("R", "July 27, 2002", "demoLargeRightFrame.html?July+27%2C+2002")) +insDocX(aux20027, gLnk("R", "July 28, 2002", "demoLargeRightFrame.html?July+28%2C+2002")) +insDocX(aux20027, gLnk("R", "July 29, 2002", "demoLargeRightFrame.html?July+29%2C+2002")) +insDocX(aux20027, gLnk("R", "July 30, 2002", "demoLargeRightFrame.html?July+30%2C+2002")) +insDocX(aux20027, gLnk("R", "July 31, 2002", "demoLargeRightFrame.html?July+31%2C+2002")) +aux20028 = insFldX(aux2002, gFld("August", "javascript:parent.op()")) +insDocX(aux20028, gLnk("R", "August 1, 2002", "demoLargeRightFrame.html?August+1%2C+2002")) +insDocX(aux20028, gLnk("R", "August 2, 2002", "demoLargeRightFrame.html?August+2%2C+2002")) +insDocX(aux20028, gLnk("R", "August 3, 2002", "demoLargeRightFrame.html?August+3%2C+2002")) +insDocX(aux20028, gLnk("R", "August 4, 2002", "demoLargeRightFrame.html?August+4%2C+2002")) +insDocX(aux20028, gLnk("R", "August 5, 2002", "demoLargeRightFrame.html?August+5%2C+2002")) +insDocX(aux20028, gLnk("R", "August 6, 2002", "demoLargeRightFrame.html?August+6%2C+2002")) +insDocX(aux20028, gLnk("R", "August 7, 2002", "demoLargeRightFrame.html?August+7%2C+2002")) +insDocX(aux20028, gLnk("R", "August 8, 2002", "demoLargeRightFrame.html?August+8%2C+2002")) +insDocX(aux20028, gLnk("R", "August 9, 2002", "demoLargeRightFrame.html?August+9%2C+2002")) +insDocX(aux20028, gLnk("R", "August 10, 2002", "demoLargeRightFrame.html?August+10%2C+2002")) +insDocX(aux20028, gLnk("R", "August 11, 2002", "demoLargeRightFrame.html?August+11%2C+2002")) +insDocX(aux20028, gLnk("R", "August 12, 2002", "demoLargeRightFrame.html?August+12%2C+2002")) +insDocX(aux20028, gLnk("R", "August 13, 2002", "demoLargeRightFrame.html?August+13%2C+2002")) +insDocX(aux20028, gLnk("R", "August 14, 2002", "demoLargeRightFrame.html?August+14%2C+2002")) +insDocX(aux20028, gLnk("R", "August 15, 2002", "demoLargeRightFrame.html?August+15%2C+2002")) +insDocX(aux20028, gLnk("R", "August 16, 2002", "demoLargeRightFrame.html?August+16%2C+2002")) +insDocX(aux20028, gLnk("R", "August 17, 2002", "demoLargeRightFrame.html?August+17%2C+2002")) +insDocX(aux20028, gLnk("R", "August 18, 2002", "demoLargeRightFrame.html?August+18%2C+2002")) +insDocX(aux20028, gLnk("R", "August 19, 2002", "demoLargeRightFrame.html?August+19%2C+2002")) +insDocX(aux20028, gLnk("R", "August 20, 2002", "demoLargeRightFrame.html?August+20%2C+2002")) +insDocX(aux20028, gLnk("R", "August 21, 2002", "demoLargeRightFrame.html?August+21%2C+2002")) +insDocX(aux20028, gLnk("R", "August 22, 2002", "demoLargeRightFrame.html?August+22%2C+2002")) +insDocX(aux20028, gLnk("R", "August 23, 2002", "demoLargeRightFrame.html?August+23%2C+2002")) +insDocX(aux20028, gLnk("R", "August 24, 2002", "demoLargeRightFrame.html?August+24%2C+2002")) +insDocX(aux20028, gLnk("R", "August 25, 2002", "demoLargeRightFrame.html?August+25%2C+2002")) +insDocX(aux20028, gLnk("R", "August 26, 2002", "demoLargeRightFrame.html?August+26%2C+2002")) +insDocX(aux20028, gLnk("R", "August 27, 2002", "demoLargeRightFrame.html?August+27%2C+2002")) +insDocX(aux20028, gLnk("R", "August 28, 2002", "demoLargeRightFrame.html?August+28%2C+2002")) +insDocX(aux20028, gLnk("R", "August 29, 2002", "demoLargeRightFrame.html?August+29%2C+2002")) +insDocX(aux20028, gLnk("R", "August 30, 2002", "demoLargeRightFrame.html?August+30%2C+2002")) +insDocX(aux20028, gLnk("R", "August 31, 2002", "demoLargeRightFrame.html?August+31%2C+2002")) +aux20029 = insFldX(aux2002, gFld("September", "javascript:parent.op()")) +insDocX(aux20029, gLnk("R", "September 1, 2002", "demoLargeRightFrame.html?September+1%2C+2002")) +insDocX(aux20029, gLnk("R", "September 2, 2002", "demoLargeRightFrame.html?September+2%2C+2002")) +insDocX(aux20029, gLnk("R", "September 3, 2002", "demoLargeRightFrame.html?September+3%2C+2002")) +insDocX(aux20029, gLnk("R", "September 4, 2002", "demoLargeRightFrame.html?September+4%2C+2002")) +insDocX(aux20029, gLnk("R", "September 5, 2002", "demoLargeRightFrame.html?September+5%2C+2002")) +insDocX(aux20029, gLnk("R", "September 6, 2002", "demoLargeRightFrame.html?September+6%2C+2002")) +insDocX(aux20029, gLnk("R", "September 7, 2002", "demoLargeRightFrame.html?September+7%2C+2002")) +insDocX(aux20029, gLnk("R", "September 8, 2002", "demoLargeRightFrame.html?September+8%2C+2002")) +insDocX(aux20029, gLnk("R", "September 9, 2002", "demoLargeRightFrame.html?September+9%2C+2002")) +insDocX(aux20029, gLnk("R", "September 10, 2002", "demoLargeRightFrame.html?September+10%2C+2002")) +insDocX(aux20029, gLnk("R", "September 11, 2002", "demoLargeRightFrame.html?September+11%2C+2002")) +insDocX(aux20029, gLnk("R", "September 12, 2002", "demoLargeRightFrame.html?September+12%2C+2002")) +insDocX(aux20029, gLnk("R", "September 13, 2002", "demoLargeRightFrame.html?September+13%2C+2002")) +insDocX(aux20029, gLnk("R", "September 14, 2002", "demoLargeRightFrame.html?September+14%2C+2002")) +insDocX(aux20029, gLnk("R", "September 15, 2002", "demoLargeRightFrame.html?September+15%2C+2002")) +insDocX(aux20029, gLnk("R", "September 16, 2002", "demoLargeRightFrame.html?September+16%2C+2002")) +insDocX(aux20029, gLnk("R", "September 17, 2002", "demoLargeRightFrame.html?September+17%2C+2002")) +insDocX(aux20029, gLnk("R", "September 18, 2002", "demoLargeRightFrame.html?September+18%2C+2002")) +insDocX(aux20029, gLnk("R", "September 19, 2002", "demoLargeRightFrame.html?September+19%2C+2002")) +insDocX(aux20029, gLnk("R", "September 20, 2002", "demoLargeRightFrame.html?September+20%2C+2002")) +insDocX(aux20029, gLnk("R", "September 21, 2002", "demoLargeRightFrame.html?September+21%2C+2002")) +insDocX(aux20029, gLnk("R", "September 22, 2002", "demoLargeRightFrame.html?September+22%2C+2002")) +insDocX(aux20029, gLnk("R", "September 23, 2002", "demoLargeRightFrame.html?September+23%2C+2002")) +insDocX(aux20029, gLnk("R", "September 24, 2002", "demoLargeRightFrame.html?September+24%2C+2002")) +insDocX(aux20029, gLnk("R", "September 25, 2002", "demoLargeRightFrame.html?September+25%2C+2002")) +insDocX(aux20029, gLnk("R", "September 26, 2002", "demoLargeRightFrame.html?September+26%2C+2002")) +insDocX(aux20029, gLnk("R", "September 27, 2002", "demoLargeRightFrame.html?September+27%2C+2002")) +insDocX(aux20029, gLnk("R", "September 28, 2002", "demoLargeRightFrame.html?September+28%2C+2002")) +insDocX(aux20029, gLnk("R", "September 29, 2002", "demoLargeRightFrame.html?September+29%2C+2002")) +insDocX(aux20029, gLnk("R", "September 30, 2002", "demoLargeRightFrame.html?September+30%2C+2002")) +aux200210 = insFldX(aux2002, gFld("October", "javascript:parent.op()")) +insDocX(aux200210, gLnk("R", "October 1, 2002", "demoLargeRightFrame.html?October+1%2C+2002")) +insDocX(aux200210, gLnk("R", "October 2, 2002", "demoLargeRightFrame.html?October+2%2C+2002")) +insDocX(aux200210, gLnk("R", "October 3, 2002", "demoLargeRightFrame.html?October+3%2C+2002")) +insDocX(aux200210, gLnk("R", "October 4, 2002", "demoLargeRightFrame.html?October+4%2C+2002")) +insDocX(aux200210, gLnk("R", "October 5, 2002", "demoLargeRightFrame.html?October+5%2C+2002")) +insDocX(aux200210, gLnk("R", "October 6, 2002", "demoLargeRightFrame.html?October+6%2C+2002")) +insDocX(aux200210, gLnk("R", "October 7, 2002", "demoLargeRightFrame.html?October+7%2C+2002")) +insDocX(aux200210, gLnk("R", "October 8, 2002", "demoLargeRightFrame.html?October+8%2C+2002")) +insDocX(aux200210, gLnk("R", "October 9, 2002", "demoLargeRightFrame.html?October+9%2C+2002")) +insDocX(aux200210, gLnk("R", "October 10, 2002", "demoLargeRightFrame.html?October+10%2C+2002")) +insDocX(aux200210, gLnk("R", "October 11, 2002", "demoLargeRightFrame.html?October+11%2C+2002")) +insDocX(aux200210, gLnk("R", "October 12, 2002", "demoLargeRightFrame.html?October+12%2C+2002")) +insDocX(aux200210, gLnk("R", "October 13, 2002", "demoLargeRightFrame.html?October+13%2C+2002")) +insDocX(aux200210, gLnk("R", "October 14, 2002", "demoLargeRightFrame.html?October+14%2C+2002")) +insDocX(aux200210, gLnk("R", "October 15, 2002", "demoLargeRightFrame.html?October+15%2C+2002")) +insDocX(aux200210, gLnk("R", "October 16, 2002", "demoLargeRightFrame.html?October+16%2C+2002")) +insDocX(aux200210, gLnk("R", "October 17, 2002", "demoLargeRightFrame.html?October+17%2C+2002")) +insDocX(aux200210, gLnk("R", "October 18, 2002", "demoLargeRightFrame.html?October+18%2C+2002")) +insDocX(aux200210, gLnk("R", "October 19, 2002", "demoLargeRightFrame.html?October+19%2C+2002")) +insDocX(aux200210, gLnk("R", "October 20, 2002", "demoLargeRightFrame.html?October+20%2C+2002")) +insDocX(aux200210, gLnk("R", "October 21, 2002", "demoLargeRightFrame.html?October+21%2C+2002")) +insDocX(aux200210, gLnk("R", "October 22, 2002", "demoLargeRightFrame.html?October+22%2C+2002")) +insDocX(aux200210, gLnk("R", "October 23, 2002", "demoLargeRightFrame.html?October+23%2C+2002")) +insDocX(aux200210, gLnk("R", "October 24, 2002", "demoLargeRightFrame.html?October+24%2C+2002")) +insDocX(aux200210, gLnk("R", "October 25, 2002", "demoLargeRightFrame.html?October+25%2C+2002")) +insDocX(aux200210, gLnk("R", "October 26, 2002", "demoLargeRightFrame.html?October+26%2C+2002")) +insDocX(aux200210, gLnk("R", "October 27, 2002", "demoLargeRightFrame.html?October+27%2C+2002")) +insDocX(aux200210, gLnk("R", "October 28, 2002", "demoLargeRightFrame.html?October+28%2C+2002")) +insDocX(aux200210, gLnk("R", "October 29, 2002", "demoLargeRightFrame.html?October+29%2C+2002")) +insDocX(aux200210, gLnk("R", "October 30, 2002", "demoLargeRightFrame.html?October+30%2C+2002")) +insDocX(aux200210, gLnk("R", "October 31, 2002", "demoLargeRightFrame.html?October+31%2C+2002")) +aux200211 = insFldX(aux2002, gFld("November", "javascript:parent.op()")) +insDocX(aux200211, gLnk("R", "November 1, 2002", "demoLargeRightFrame.html?November+1%2C+2002")) +insDocX(aux200211, gLnk("R", "November 2, 2002", "demoLargeRightFrame.html?November+2%2C+2002")) +insDocX(aux200211, gLnk("R", "November 3, 2002", "demoLargeRightFrame.html?November+3%2C+2002")) +insDocX(aux200211, gLnk("R", "November 4, 2002", "demoLargeRightFrame.html?November+4%2C+2002")) +insDocX(aux200211, gLnk("R", "November 5, 2002", "demoLargeRightFrame.html?November+5%2C+2002")) +insDocX(aux200211, gLnk("R", "November 6, 2002", "demoLargeRightFrame.html?November+6%2C+2002")) +insDocX(aux200211, gLnk("R", "November 7, 2002", "demoLargeRightFrame.html?November+7%2C+2002")) +insDocX(aux200211, gLnk("R", "November 8, 2002", "demoLargeRightFrame.html?November+8%2C+2002")) +insDocX(aux200211, gLnk("R", "November 9, 2002", "demoLargeRightFrame.html?November+9%2C+2002")) +insDocX(aux200211, gLnk("R", "November 10, 2002", "demoLargeRightFrame.html?November+10%2C+2002")) +insDocX(aux200211, gLnk("R", "November 11, 2002", "demoLargeRightFrame.html?November+11%2C+2002")) +insDocX(aux200211, gLnk("R", "November 12, 2002", "demoLargeRightFrame.html?November+12%2C+2002")) +insDocX(aux200211, gLnk("R", "November 13, 2002", "demoLargeRightFrame.html?November+13%2C+2002")) +insDocX(aux200211, gLnk("R", "November 14, 2002", "demoLargeRightFrame.html?November+14%2C+2002")) +insDocX(aux200211, gLnk("R", "November 15, 2002", "demoLargeRightFrame.html?November+15%2C+2002")) +insDocX(aux200211, gLnk("R", "November 16, 2002", "demoLargeRightFrame.html?November+16%2C+2002")) +insDocX(aux200211, gLnk("R", "November 17, 2002", "demoLargeRightFrame.html?November+17%2C+2002")) +insDocX(aux200211, gLnk("R", "November 18, 2002", "demoLargeRightFrame.html?November+18%2C+2002")) +insDocX(aux200211, gLnk("R", "November 19, 2002", "demoLargeRightFrame.html?November+19%2C+2002")) +insDocX(aux200211, gLnk("R", "November 20, 2002", "demoLargeRightFrame.html?November+20%2C+2002")) +insDocX(aux200211, gLnk("R", "November 21, 2002", "demoLargeRightFrame.html?November+21%2C+2002")) +insDocX(aux200211, gLnk("R", "November 22, 2002", "demoLargeRightFrame.html?November+22%2C+2002")) +insDocX(aux200211, gLnk("R", "November 23, 2002", "demoLargeRightFrame.html?November+23%2C+2002")) +insDocX(aux200211, gLnk("R", "November 24, 2002", "demoLargeRightFrame.html?November+24%2C+2002")) +insDocX(aux200211, gLnk("R", "November 25, 2002", "demoLargeRightFrame.html?November+25%2C+2002")) +insDocX(aux200211, gLnk("R", "November 26, 2002", "demoLargeRightFrame.html?November+26%2C+2002")) +insDocX(aux200211, gLnk("R", "November 27, 2002", "demoLargeRightFrame.html?November+27%2C+2002")) +insDocX(aux200211, gLnk("R", "November 28, 2002", "demoLargeRightFrame.html?November+28%2C+2002")) +insDocX(aux200211, gLnk("R", "November 29, 2002", "demoLargeRightFrame.html?November+29%2C+2002")) +insDocX(aux200211, gLnk("R", "November 30, 2002", "demoLargeRightFrame.html?November+30%2C+2002")) +aux200212 = insFldX(aux2002, gFld("December", "javascript:parent.op()")) +insDocX(aux200212, gLnk("R", "December 1, 2002", "demoLargeRightFrame.html?December+1%2C+2002")) +insDocX(aux200212, gLnk("R", "December 2, 2002", "demoLargeRightFrame.html?December+2%2C+2002")) +insDocX(aux200212, gLnk("R", "December 3, 2002", "demoLargeRightFrame.html?December+3%2C+2002")) +insDocX(aux200212, gLnk("R", "December 4, 2002", "demoLargeRightFrame.html?December+4%2C+2002")) +insDocX(aux200212, gLnk("R", "December 5, 2002", "demoLargeRightFrame.html?December+5%2C+2002")) +insDocX(aux200212, gLnk("R", "December 6, 2002", "demoLargeRightFrame.html?December+6%2C+2002")) +insDocX(aux200212, gLnk("R", "December 7, 2002", "demoLargeRightFrame.html?December+7%2C+2002")) +insDocX(aux200212, gLnk("R", "December 8, 2002", "demoLargeRightFrame.html?December+8%2C+2002")) +insDocX(aux200212, gLnk("R", "December 9, 2002", "demoLargeRightFrame.html?December+9%2C+2002")) +insDocX(aux200212, gLnk("R", "December 10, 2002", "demoLargeRightFrame.html?December+10%2C+2002")) +insDocX(aux200212, gLnk("R", "December 11, 2002", "demoLargeRightFrame.html?December+11%2C+2002")) +insDocX(aux200212, gLnk("R", "December 12, 2002", "demoLargeRightFrame.html?December+12%2C+2002")) +insDocX(aux200212, gLnk("R", "December 13, 2002", "demoLargeRightFrame.html?December+13%2C+2002")) +insDocX(aux200212, gLnk("R", "December 14, 2002", "demoLargeRightFrame.html?December+14%2C+2002")) +insDocX(aux200212, gLnk("R", "December 15, 2002", "demoLargeRightFrame.html?December+15%2C+2002")) +insDocX(aux200212, gLnk("R", "December 16, 2002", "demoLargeRightFrame.html?December+16%2C+2002")) +insDocX(aux200212, gLnk("R", "December 17, 2002", "demoLargeRightFrame.html?December+17%2C+2002")) +insDocX(aux200212, gLnk("R", "December 18, 2002", "demoLargeRightFrame.html?December+18%2C+2002")) +insDocX(aux200212, gLnk("R", "December 19, 2002", "demoLargeRightFrame.html?December+19%2C+2002")) +insDocX(aux200212, gLnk("R", "December 20, 2002", "demoLargeRightFrame.html?December+20%2C+2002")) +insDocX(aux200212, gLnk("R", "December 21, 2002", "demoLargeRightFrame.html?December+21%2C+2002")) +insDocX(aux200212, gLnk("R", "December 22, 2002", "demoLargeRightFrame.html?December+22%2C+2002")) +insDocX(aux200212, gLnk("R", "December 23, 2002", "demoLargeRightFrame.html?December+23%2C+2002")) +insDocX(aux200212, gLnk("R", "December 24, 2002", "demoLargeRightFrame.html?December+24%2C+2002")) +insDocX(aux200212, gLnk("R", "December 25, 2002", "demoLargeRightFrame.html?December+25%2C+2002")) +insDocX(aux200212, gLnk("R", "December 26, 2002", "demoLargeRightFrame.html?December+26%2C+2002")) +insDocX(aux200212, gLnk("R", "December 27, 2002", "demoLargeRightFrame.html?December+27%2C+2002")) +insDocX(aux200212, gLnk("R", "December 28, 2002", "demoLargeRightFrame.html?December+28%2C+2002")) +insDocX(aux200212, gLnk("R", "December 29, 2002", "demoLargeRightFrame.html?December+29%2C+2002")) +insDocX(aux200212, gLnk("R", "December 30, 2002", "demoLargeRightFrame.html?December+30%2C+2002")) +insDocX(aux200212, gLnk("R", "December 31, 2002", "demoLargeRightFrame.html?December+31%2C+2002")) + +foldersTree.treeID = "L1" diff --git a/wxc2_omc/frame/leftMenu/demoLargeRightFrame.html b/wxc2_omc/frame/leftMenu/demoLargeRightFrame.html new file mode 100755 index 0000000..ad69231 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/demoLargeRightFrame.html @@ -0,0 +1,32 @@ + + + + + + + + + + + +

      Thousands-of-nodes Example

      + +See how fast it is to build a large tree

      +Transfering the files to the browser on a slow connection may still take some unavoidable seconds because the definition of this 1500 nodes tree still takes a 105KB definition file. However, after the internet transfer, creating the actual tree on the browser, setting it up, and displaying it doesn't take much longer than with the smallest of the trees.

      + +Folders for years and folders for months do not load pages themselves and, thus, cannot be highlighted. All days can be highlighted with the exception of Feb 1, 2000. The exclusion of highlight for one node shows the flexibility of the highlight settings in Treeview.

      + +A tree with years, months, and days is a rather ficticious example; there are better ways to pick a date. Real world examples of very large trees include presenting data from a database or with the structure of a file system.

      + + + diff --git a/wxc2_omc/frame/leftMenu/diffDoc.gif b/wxc2_omc/frame/leftMenu/diffDoc.gif new file mode 100755 index 0000000..00dab18 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/diffDoc.gif differ diff --git a/wxc2_omc/frame/leftMenu/diffFolder.gif b/wxc2_omc/frame/leftMenu/diffFolder.gif new file mode 100755 index 0000000..6f67c82 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/diffFolder.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftiens4.js b/wxc2_omc/frame/leftMenu/ftiens4.js new file mode 100755 index 0000000..eca263a --- /dev/null +++ b/wxc2_omc/frame/leftMenu/ftiens4.js @@ -0,0 +1,1127 @@ +//**************************************************************** +// Keep this copyright notice: +// This copy of the script is the property of the owner of the +// particular web site you were visiting. +// Do not download the script's files from there. +// For a free download and full instructions go to: +// http://www.treeview.net +//**************************************************************** + + +// Log of changes: +// +// 12 May 03 - Support for Safari Beta 3 +// 01 Mar 03 - VERSION 4.3 - Support for checkboxes +// 21 Feb 03 - Added support for Opera 7 +// 22 Sep 02 - Added maySelect member for node-by-node control +// of selection and highlight +// 21 Sep 02 - Cookie values are now separated by cookieCutter +// 12 Sep 02 - VERSION 4.2 - Can highlight Selected Nodes and +// can preserve state through external (DB) IDs +// 29 Aug 02 - Fine tune 'supportDeferral' for IE4 and IE Mac +// 25 Aug 02 - Fixes: STARTALLOPEN, and multi-page frameless +// 09 Aug 02 - Fix repeated folder on Mozilla 1.x +// 31 Jul 02 - VERSION 4.1 - Dramatic speed increase for trees +// with hundreds or thousands of nodes; changes to the control +// flags of the gLnk function +// 18 Jul 02 - Changes in pre-load images function +// 13 Jun 02 - Add ICONPATH var to allow for gif subdir +// 20 Apr 02 - Improve support for frame-less layout +// 07 Apr 02 - Minor changes to support server-side dynamic feeding +// (example: FavoritesManagerASP) + + +// Definition of class Folder +// ***************************************************************** +function Folder(folderDescription, hreference) //constructor +{ + //constant data + this.desc = folderDescription; + this.hreference = hreference; + this.id = -1; + this.navObj = 0; + this.iconImg = 0; + this.nodeImg = 0; + this.isLastNode = 0; + this.iconSrc = ICONPATH + "ftv2folderopen.gif"; + this.iconSrcClosed = ICONPATH + "ftv2folderclosed.gif"; + this.children = new Array; + this.nChildren = 0; + this.level = 0; + this.leftSideCoded = ""; + this.isLastNode=false; + this.parentObj = null; + this.maySelect=true; + this.prependHTML = "" + + //dynamic data + this.isOpen = false + this.isLastOpenedFolder = false + this.isRendered = 0 + + //methods + this.initialize = initializeFolder + this.setState = setStateFolder + this.addChild = addChild + this.createIndex = createEntryIndex + this.escondeBlock = escondeBlock + this.esconde = escondeFolder + this.folderMstr = folderMstr + this.renderOb = drawFolder + this.totalHeight = totalHeight + this.subEntries = folderSubEntries + this.linkHTML = linkFolderHTML + this.blockStartHTML = blockStartHTML + this.blockEndHTML = blockEndHTML + this.nodeImageSrc = nodeImageSrc + this.iconImageSrc = iconImageSrc + this.getID = getID + this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders +} + +function initializeFolder(level, lastNode, leftSide) +{ + var j=0 + var i=0 + nc = this.nChildren + + this.createIndex() + this.level = level + this.leftSideCoded = leftSide + + if (browserVersion == 0 || STARTALLOPEN==1) + this.isOpen=true; + + if (level>0) + if (lastNode) //the last child in the children array + leftSide = leftSide + "0" + else + leftSide = leftSide + "1" + + this.isLastNode = lastNode + + if (nc > 0) + { + level = level + 1 + for (i=0 ; i < this.nChildren; i++) + { + if (i == this.nChildren-1) + this.children[i].initialize(level, 1, leftSide) + else + this.children[i].initialize(level, 0, leftSide) + } + } +} + +function drawFolder(insertAtObj) +{ + var nodeName = "" + var auxEv = "" + var docW = "" + + var leftSide = leftSideHTML(this.leftSideCoded) + + if (browserVersion > 0) + auxEv = "" + else + auxEv = "" + + nodeName = this.nodeImageSrc() + + if (this.level>0) + if (this.isLastNode) //the last child in the children array + leftSide = leftSide + "" + auxEv + "" + else + leftSide = leftSide + "" + auxEv + "" + + this.isRendered = 1 + + if (browserVersion == 2) { + if (!doc.yPos) + doc.yPos=20 + } + + docW = this.blockStartHTML("folder"); + + docW = docW + "" + leftSide + ""; + if (USEICONS) + { + docW = docW + this.linkHTML(false) + docW = docW + "" + } + else + { + if (this.prependHTML == "") + docW = docW + "" + } + if (WRAPTEXT) + docW = docW + ""+this.prependHTML+"" + else + docW = docW + ""+this.prependHTML+"" + if (USETEXTLINKS) + { + docW = docW + this.linkHTML(true) + docW = docW + this.desc + "" + } + else + docW = docW + this.desc + docW = docW + "" + + docW = docW + this.blockEndHTML() + + if (insertAtObj == null) + { + if (supportsDeferral) { + doc.write("

      ") //transition between regular flow HTML, and node-insert DOM DHTML + insertAtObj = getElById("domRoot") + insertAtObj.insertAdjacentHTML("beforeEnd", docW) + } + else + doc.write(docW) + } + else + { + insertAtObj.insertAdjacentHTML("afterEnd", docW) + } + + if (browserVersion == 2) + { + this.navObj = doc.layers["folder"+this.id] + if (USEICONS) + this.iconImg = this.navObj.document.images["folderIcon"+this.id] + this.nodeImg = this.navObj.document.images["nodeIcon"+this.id] + doc.yPos=doc.yPos+this.navObj.clip.height + } + else if (browserVersion != 0) + { + this.navObj = getElById("folder"+this.id) + if (USEICONS) + this.iconImg = getElById("folderIcon"+this.id) + this.nodeImg = getElById("nodeIcon"+this.id) + } +} + +function setStateFolder(isOpen) +{ + var subEntries + var totalHeight + var fIt = 0 + var i=0 + var currentOpen + + if (isOpen == this.isOpen) + return + + if (browserVersion == 2) + { + totalHeight = 0 + for (i=0; i < this.nChildren; i++) + totalHeight = totalHeight + this.children[i].navObj.clip.height + subEntries = this.subEntries() + if (this.isOpen) + totalHeight = 0 - totalHeight + for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++) + indexOfEntries[fIt].navObj.moveBy(0, totalHeight) + } + this.isOpen = isOpen; + + if (this.getID()!=foldersTree.getID() && PERSERVESTATE && !this.isOpen) //closing + { + currentOpen = GetCookie("clickedFolder") + if (currentOpen != null) { + currentOpen = currentOpen.replace(this.getID()+cookieCutter, "") + SetCookie("clickedFolder", currentOpen) + } + } + + if (!this.isOpen && this.isLastOpenedfolder) + { + lastOpenedFolder = null; + this.isLastOpenedfolder = false; + } + propagateChangesInState(this) +} + +function propagateChangesInState(folder) +{ + var i=0 + + //Change icon + if (folder.nChildren > 0 && folder.level>0) //otherwise the one given at render stays + folder.nodeImg.src = folder.nodeImageSrc() + + //Change node + if (USEICONS) + folder.iconImg.src = folder.iconImageSrc() + + //Propagate changes + for (i=folder.nChildren-1; i>=0; i--) + if (folder.isOpen) + folder.children[i].folderMstr(folder.navObj) + else + folder.children[i].esconde() +} + +function escondeFolder() +{ + this.escondeBlock() + + this.setState(0) +} + +function linkFolderHTML(isTextLink) +{ + var docW = ""; + + if (this.hreference) + { + if (USEFRAMES) + docW = docW + " 0) + docW = docW + "onClick='javascript:clickOnFolder(\""+this.getID()+"\")'" + + docW = docW + ">" + } + else + docW = docW + "" + + return docW; +} + +function addChild(childNode) +{ + this.children[this.nChildren] = childNode + childNode.parentObj = this + this.nChildren++ + return childNode +} + +function folderSubEntries() +{ + var i = 0 + var se = this.nChildren + + for (i=0; i < this.nChildren; i++){ + if (this.children[i].children) //is a folder + se = se + this.children[i].subEntries() + } + + return se +} + +function nodeImageSrc() { + var srcStr = ""; + + if (this.isLastNode) //the last child in the children array + { + if (this.nChildren == 0) + srcStr = ICONPATH + "ftv2lastnode.gif" + else + if (this.isOpen) + srcStr = ICONPATH + "ftv2mlastnode.gif" + else + srcStr = ICONPATH + "ftv2plastnode.gif" + } + else + { + if (this.nChildren == 0) + srcStr = ICONPATH + "ftv2node.gif" + else + if (this.isOpen) + srcStr = ICONPATH + "ftv2mnode.gif" + else + srcStr = ICONPATH + "ftv2pnode.gif" + } + return srcStr; +} + +function iconImageSrc() { + if (this.isOpen) + return(this.iconSrc) + else + return(this.iconSrcClosed) +} + +// Definition of class Item (a document or link inside a Folder) +// ************************************************************* + +function Item(itemDescription, itemLink, target) // Constructor +{ + // constant data + this.desc = itemDescription + this.link = itemLink + this.id = -1 //initialized in initalize() + this.navObj = 0 //initialized in render() + this.iconImg = 0 //initialized in render() + this.iconSrc = ICONPATH + "ftv2doc.gif" + this.isRendered = 0 + this.isLastNode = false + this.level = 0 + this.leftSideCoded = "" + this.nChildren = 0 + this.target = target + this.parentObj = null + this.maySelect=true + this.prependHTML = "" + + // methods + this.initialize = initializeItem + this.createIndex = createEntryIndex + this.escondeBlock = escondeBlock + this.esconde = escondeBlock + this.folderMstr = folderMstr + this.renderOb = drawItem + this.totalHeight = totalHeight + this.blockStartHTML = blockStartHTML + this.blockEndHTML = blockEndHTML + this.getID = getID + this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders +} + +function initializeItem(level, lastNode, leftSide) +{ + this.createIndex() + this.level = level + this.leftSideCoded = leftSide + this.isLastNode = lastNode +} + +function drawItem(insertAtObj) +{ + var leftSide = leftSideHTML(this.leftSideCoded) + var docW = "" + + var fullLink = "href=\""+this.link+"\" target=\""+this.target+"\" onClick=\"clickOnLink('"+this.getID()+"\', '"+this.link+"','"+this.target+"');return false;\""; + this.isRendered = 1 + + if (this.level>0) + if (this.isLastNode) //the last 'brother' in the children array + { + leftSide = leftSide + "" + } + else + { + leftSide = leftSide + "" + } + + docW = docW + this.blockStartHTML("item") + + docW = docW + "" + leftSide + "" + if (USEICONS) + docW = docW + "" + "" + "" + else + if (this.prependHTML == "") + docW = docW + "" + + if (WRAPTEXT) + docW = docW + ""+this.prependHTML+"" + else + docW = docW + ""+this.prependHTML+"" + + if (USETEXTLINKS) + docW = docW + "" + this.desc + "" + else + docW = docW + this.desc + + docW = docW + "" + + docW = docW + this.blockEndHTML() + + if (insertAtObj == null) + { + doc.write(docW) + } + else + { + insertAtObj.insertAdjacentHTML("afterEnd", docW) + } + + if (browserVersion == 2) { + this.navObj = doc.layers["item"+this.id] + if (USEICONS) + this.iconImg = this.navObj.document.images["itemIcon"+this.id] + doc.yPos=doc.yPos+this.navObj.clip.height + } else if (browserVersion != 0) { + this.navObj = getElById("item"+this.id) + if (USEICONS) + this.iconImg = getElById("itemIcon"+this.id) + } +} + + +// Methods common to both objects (pseudo-inheritance) +// ******************************************************** + +function forceOpeningOfAncestorFolders() { + if (this.parentObj == null || this.parentObj.isOpen) + return + else { + this.parentObj.forceOpeningOfAncestorFolders() + clickOnNodeObj(this.parentObj) + } +} + +function escondeBlock() +{ + if (browserVersion == 1 || browserVersion == 3) { + if (this.navObj.style.display == "none") + return + this.navObj.style.display = "none" + } else { + if (this.navObj.visibility == "hidden") + return + this.navObj.visibility = "hidden" + } +} + +function folderMstr(domObj) +{ + if (browserVersion == 1 || browserVersion == 3) { + if (t==-1) + return + var str = new String(doc.links[t]) + if (str.slice(14,16) != "em") + return + } + + if (!this.isRendered) + this.renderOb(domObj) + else + if (browserVersion == 1 || browserVersion == 3) + this.navObj.style.display = "block" + else + this.navObj.visibility = "show" +} + +function blockStartHTML(idprefix) { + var idParam = "id='" + idprefix + this.id + "'" + var docW = "" + + if (browserVersion == 2) + docW = "" + else if (browserVersion != 0) + docW = "
      " + + docW = docW + "" + + return docW +} + +function blockEndHTML() { + var docW = "" + + docW = "
      " + + if (browserVersion == 2) + docW = docW + "" + else if (browserVersion != 0) + docW = docW + "
      " + + return docW +} + +function createEntryIndex() +{ + this.id = nEntries + indexOfEntries[nEntries] = this + nEntries++ +} + +// total height of subEntries open +function totalHeight() //used with browserVersion == 2 +{ + var h = this.navObj.clip.height + var i = 0 + + if (this.isOpen) //is a folder and _is_ open + for (i=0 ; i < this.nChildren; i++) + h = h + this.children[i].totalHeight() + + return h +} + + +function leftSideHTML(leftSideCoded) { + var i; + var retStr = ""; + + for (i=0; i" + } + if (leftSideCoded.charAt(i) == "0") + { + retStr = retStr + "" + } + } + return retStr +} + +function getID() +{ + //define a .xID in all nodes (folders and items) if you want to PERVESTATE that + //work when the tree changes. The value eXternal value must be unique for each + //node and must node change when other nodes are added or removed + //The value may be numeric or string, but cannot have the same char used in cookieCutter + if (typeof this.xID != "undefined") + return this.xID + else + return this.id +} + + +// Events +// ********************************************************* + +function clickOnFolder(folderId) +{ + var clicked = findObj(folderId) + + if (!clicked.isOpen) { + clickOnNodeObj(clicked) + } + + if (lastOpenedFolder != null && lastOpenedFolder != folderId) + clickOnNode(lastOpenedFolder); //sets lastOpenedFolder to null + + if (clicked.nChildren==0) { + lastOpenedFolder = folderId; + clicked.isLastOpenedfolder = true + } + + if (isLinked(clicked.hreference)) { + highlightObjLink(clicked); + } +} + +function clickOnNode(folderId) +{ + clickOnNodeObj(findObj(folderId)) +} + +function clickOnNodeObj(folderObj) +{ + var state = 0 + var currentOpen + + state = folderObj.isOpen + folderObj.setState(!state) //open<->close + + if (folderObj.id!=foldersTree.id && PERSERVESTATE) + { + currentOpen = GetCookie("clickedFolder") + if (currentOpen == null) + currentOpen = "" + + if (!folderObj.isOpen) //closing + { + currentOpen = currentOpen.replace(folderObj.getID()+cookieCutter, "") + SetCookie("clickedFolder", currentOpen) + } + else + SetCookie("clickedFolder", currentOpen+folderObj.getID()+cookieCutter) + } +} + +function clickOnLink(clickedId, target, windowName) { + highlightObjLink(findObj(clickedId)); + if (isLinked(target)) { + window.open(target,windowName); + } +} + +function ld () +{ + return document.links.length-1 +} + + +// Auxiliary Functions +// ******************* + +function findObj(id) +{ + var i=0; + var nodeObj; + if (typeof foldersTree.xID != "undefined") { + nodeObj = indexOfEntries[i]; + for(i=0;i= nEntries) + return null; //example: node removed in DB + else + return indexOfEntries[id]; +} + +function isLinked(hrefText) { + var result = true; + result = (result && hrefText !=null); + result = (result && hrefText != ''); + result = (result && hrefText.indexOf('undefined') < 0); + result = (result && hrefText.indexOf('parent.op') < 0); + return result; +} + +// Do highlighting by changing background and foreg. colors of folder or doc text +function highlightObjLink(nodeObj) { + if (!HIGHLIGHT || nodeObj==null || nodeObj.maySelect==false) {//node deleted in DB + return; + } + + if (browserVersion == 1 || browserVersion == 3) { + var clickedDOMObj = getElById('itemTextLink'+nodeObj.id); + if (clickedDOMObj != null) { + if (lastClicked != null) { + var prevClickedDOMObj = getElById('itemTextLink'+lastClicked.id); + prevClickedDOMObj.style.color=lastClickedColor; + prevClickedDOMObj.style.backgroundColor=lastClickedBgColor; + } + + lastClickedColor = clickedDOMObj.style.color; + lastClickedBgColor = clickedDOMObj.style.backgroundColor; + clickedDOMObj.style.color=HIGHLIGHT_COLOR; + clickedDOMObj.style.backgroundColor=HIGHLIGHT_BG; + } + } + lastClicked = nodeObj; + if (PERSERVESTATE) + SetCookie('highlightedTreeviewLink', nodeObj.getID()); +} + +function gFld(description, hreference) +{ + folder = new Folder(description, hreference); + return folder; +} + +function gLnk(optionFlags, description, linkData) +{ + var fullLink = ""; + var targetFlag = ""; + var target = ""; + var protocolFlag = ""; + var protocol = ""; + + if (optionFlags>=0) //is numeric (old style) or empty (error) + { + return oldGLnk(optionFlags, description, linkData) + } + + targetFlag = optionFlags.charAt(0) + if (targetFlag=="B") + target = "_blank" + if (targetFlag=="P") + target = "_parent" + if (targetFlag=="R") + target = "basefrm" + if (targetFlag=="S") + target = "_self" + if (targetFlag=="T") + target = "_top" + + if (optionFlags.length > 1) { + protocolFlag = optionFlags.charAt(1) + if (protocolFlag=="h") + protocol = "http://" + if (protocolFlag=="s") + protocol = "https://" + if (protocolFlag=="f") + protocol = "ftp://" + if (protocolFlag=="m") + protocol = "mailto:" + } + + fullLink = "'" + protocol + linkData + "' target=" + target + + linkItem = new Item(description, protocol+linkData, target) + return linkItem +} + +//Function created Aug 1, 2002 for backwards compatibility purposes +function oldGLnk(target, description, linkData) +{ + var fullLink = ""; + //Backwards compatibility code + if (USEFRAMES) + { + if (target==0) + { + fullLink = "'"+linkData+"' target=\"basefrm\"" + } + else + { + if (target==1) + fullLink = "'http://"+linkData+"' target=_blank" + else + if (target==2) + fullLink = "'http://"+linkData+"' target=\"basefrm\"" + else + fullLink = linkData+" target=\"_top\"" + } + } + else + { + if (target==0) + { + fullLink = "'"+linkData+"' target=_top" + } + else + { + if (target==1) + fullLink = "'http://"+linkData+"' target=_blank" + else + fullLink = "'http://"+linkData+"' target=_top" + } + } + + linkItem = new Item(description, fullLink) + return linkItem +} + +function insFld(parentFolder, childFolder) +{ + return parentFolder.addChild(childFolder) +} + +function insDoc(parentFolder, document) +{ + return parentFolder.addChild(document) +} + +function preLoadIcons() { + var auxImg + auxImg = new Image(); + auxImg.src = ICONPATH + "ftv2vertline.gif"; + auxImg.src = ICONPATH + "ftv2mlastnode.gif"; + auxImg.src = ICONPATH + "ftv2mnode.gif"; + auxImg.src = ICONPATH + "ftv2plastnode.gif"; + auxImg.src = ICONPATH + "ftv2pnode.gif"; + auxImg.src = ICONPATH + "ftv2blank.gif"; + auxImg.src = ICONPATH + "ftv2lastnode.gif"; + auxImg.src = ICONPATH + "ftv2node.gif"; + auxImg.src = ICONPATH + "ftv2folderclosed.gif"; + auxImg.src = ICONPATH + "ftv2folderopen.gif"; + auxImg.src = ICONPATH + "ftv2doc.gif"; +} + +//Open some folders for initial layout, if necessary +function setInitialLayout() { + if (browserVersion > 0 && !STARTALLOPEN) + clickOnNodeObj(foldersTree); + + if (!STARTALLOPEN && (browserVersion > 0) && PERSERVESTATE) + PersistentFolderOpening(); +} + +//Used with NS4 and STARTALLOPEN +function renderAllTree(nodeObj, parent) { + var i=0; + nodeObj.renderOb(parent) + if (supportsDeferral) + for (i=nodeObj.nChildren-1; i>=0; i--) + renderAllTree(nodeObj.children[i], nodeObj.navObj) + else + for (i=0 ; i < nodeObj.nChildren; i++) + renderAllTree(nodeObj.children[i], null) +} + +function hideWholeTree(nodeObj, hideThisOne, nodeObjMove) { + var i=0; + var heightContained=0; + var childrenMove=nodeObjMove; + + if (hideThisOne) + nodeObj.escondeBlock() + + if (browserVersion == 2) + nodeObj.navObj.moveBy(0, 0-nodeObjMove) + + for (i=0 ; i < nodeObj.nChildren; i++) { + heightContainedInChild = hideWholeTree(nodeObj.children[i], true, childrenMove) + if (browserVersion == 2) { + heightContained = heightContained + heightContainedInChild + nodeObj.children[i].navObj.clip.height + childrenMove = childrenMove + heightContainedInChild + } + } + + return heightContained; +} + + +// Simulating inserAdjacentHTML on NS6 +// Code by thor@jscript.dk +// ****************************************** + +if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement){ + HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode) + { + switch (where){ + case 'beforeBegin': + this.parentNode.insertBefore(parsedNode,this) + break; + case 'afterBegin': + this.insertBefore(parsedNode,this.firstChild); + break; + case 'beforeEnd': + this.appendChild(parsedNode); + break; + case 'afterEnd': + if (this.nextSibling) + this.parentNode.insertBefore(parsedNode,this.nextSibling); + else this.parentNode.appendChild(parsedNode); + break; + } + } + + HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr) + { + var r = this.ownerDocument.createRange(); + r.setStartBefore(this); + var parsedHTML = r.createContextualFragment(htmlStr); + this.insertAdjacentElement(where,parsedHTML) + } +} + +function getElById(idVal) { + if (document.getElementById != null) + return document.getElementById(idVal) + if (document.all != null) + return document.all[idVal] + + alert("Problem getting element by id") + return null +} + + +// Functions for cookies +// Note: THESE FUNCTIONS ARE OPTIONAL. No cookies are used unless +// the PERSERVESTATE variable is set to 1 (default 0) +// The separator currently in use is ^ (chr 94) +// *********************************************************** + +function PersistentFolderOpening() +{ + var stateInCookie; + var fldStr="" + var fldArr + var fldPos=0 + var id + var nodeObj + stateInCookie = GetCookie("clickedFolder"); + SetCookie('clickedFolder', "") //at the end of function it will be back, minus null cases + + if(stateInCookie!=null) + { + fldArr = stateInCookie.split(cookieCutter) + for (fldPos=0; fldPos 2) ? argv[2] : null; + //var path = (argc > 3) ? argv[3] : null; + var domain = (argc > 4) ? argv[4] : null; + var secure = (argc > 5) ? argv[5] : false; + var path = "/"; //allows the tree to remain open across pages with diff names & paths + + name = CookieBranding(name) + + document.cookie = name + "=" + escape (value) + + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + + ((path == null) ? "" : ("; path=" + path)) + + ((domain == null) ? "" : ("; domain=" + domain)) + + ((secure == true) ? "; secure" : ""); +} + +function ExpireCookie (name) +{ + var exp = new Date(); + exp.setTime (exp.getTime() - 1); + var cval = GetCookie (name); + name = CookieBranding(name) + document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); +} + + +//To customize the tree, overwrite these variables in the configuration file (demoFramesetNode.js, etc.) +var USETEXTLINKS = 0 +var STARTALLOPEN = 0 +var USEFRAMES = 1 +var USEICONS = 1 +var WRAPTEXT = 0 +var PERSERVESTATE = 0 +var ICONPATH = '' +var HIGHLIGHT = 0 +var HIGHLIGHT_COLOR = 'white'; +var HIGHLIGHT_BG = 'blue'; +var BUILDALL = 0 + + +//Other variables +var lastClicked = null; +var lastClickedColor; +var lastClickedBgColor; +var indexOfEntries = new Array +var nEntries = 0 +var browserVersion = 0 +var selectedFolder=0 +var lastOpenedFolder=null +var t=5 +var doc = document +var supportsDeferral = false +var cookieCutter = '^' //You can change this if you need to use ^ in your xID or treeID values + +doc.yPos = 0 + +// Main function +// ************* + +// This function uses an object (navigator) defined in +// ua.js, imported in the main html page (left frame). +function initializeDocument() +{ + preLoadIcons(); + switch(navigator.family) + { + case 'ie4': + browserVersion = 1 //Simply means IE > 3.x + break; + case 'opera': + browserVersion = (navigator.version > 6 ? 1 : 0); //opera7 has a good DOM + break; + case 'nn4': + browserVersion = 2 //NS4.x + break; + case 'gecko': + browserVersion = 3 //NS6.x + break; + case 'safari': + browserVersion = 1 //Safari Beta 3 seems to behave like IE in spite of being based on Konkeror + break; + default: + browserVersion = 0 //other, possibly without DHTML + break; + } + + supportsDeferral = ((navigator.family=='ie4' && navigator.version >= 5 && navigator.OS != "mac") || browserVersion == 3); + supportsDeferral = supportsDeferral & (!BUILDALL) + if (!USEFRAMES && browserVersion == 2) + browserVersion = 0; + eval(String.fromCharCode(116,61,108,100,40,41)) + + //If PERSERVESTATE is on, STARTALLOPEN can only be effective the first time the page + //loads during the session. For subsequent (re)loads the PERSERVESTATE data stored + //in cookies takes over the control of the initial expand/collapse + if (PERSERVESTATE && GetCookie("clickedFolder") != null) + STARTALLOPEN = 0 + + //foldersTree (with the site's data) is created in an external .js (demoFramesetNode.js, for example) + foldersTree.initialize(0, true, "") + if (supportsDeferral && !STARTALLOPEN) + foldersTree.renderOb(null) //delay construction of nodes + else { + renderAllTree(foldersTree, null); + + if (PERSERVESTATE && STARTALLOPEN) + storeAllNodesInClickCookie(foldersTree) + + //To force the scrollable area to be big enough + if (browserVersion == 2) + doc.write(" ") + + if (browserVersion != 0 && !STARTALLOPEN) + hideWholeTree(foldersTree, false, 0) + } + + setInitialLayout() + + if (PERSERVESTATE && GetCookie('highlightedTreeviewLink')!=null && GetCookie('highlightedTreeviewLink')!="") { + var nodeObj = findObj(GetCookie('highlightedTreeviewLink')) + if (nodeObj!=null){ + nodeObj.forceOpeningOfAncestorFolders() + highlightObjLink(nodeObj); + } + else + SetCookie('highlightedTreeviewLink', '') + } +} + \ No newline at end of file diff --git a/wxc2_omc/frame/leftMenu/ftv2blank.gif b/wxc2_omc/frame/leftMenu/ftv2blank.gif new file mode 100755 index 0000000..85df9a3 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2blank.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2doc.gif b/wxc2_omc/frame/leftMenu/ftv2doc.gif new file mode 100755 index 0000000..c59fcc7 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2doc.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2folderclosed.gif b/wxc2_omc/frame/leftMenu/ftv2folderclosed.gif new file mode 100755 index 0000000..560b0bf Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2folderclosed.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2folderopen.gif b/wxc2_omc/frame/leftMenu/ftv2folderopen.gif new file mode 100755 index 0000000..aa1acd1 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2folderopen.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2lastnode.gif b/wxc2_omc/frame/leftMenu/ftv2lastnode.gif new file mode 100755 index 0000000..b7b3e55 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2lastnode.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2link.gif b/wxc2_omc/frame/leftMenu/ftv2link.gif new file mode 100755 index 0000000..32d3b9e Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2link.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2mlastnode.gif b/wxc2_omc/frame/leftMenu/ftv2mlastnode.gif new file mode 100755 index 0000000..11ae43a Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2mlastnode.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2mnode.gif b/wxc2_omc/frame/leftMenu/ftv2mnode.gif new file mode 100755 index 0000000..fcc2d37 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2mnode.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2node.gif b/wxc2_omc/frame/leftMenu/ftv2node.gif new file mode 100755 index 0000000..40167db Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2node.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2plastnode.gif b/wxc2_omc/frame/leftMenu/ftv2plastnode.gif new file mode 100755 index 0000000..b87f003 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2plastnode.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2pnode.gif b/wxc2_omc/frame/leftMenu/ftv2pnode.gif new file mode 100755 index 0000000..5b68013 Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2pnode.gif differ diff --git a/wxc2_omc/frame/leftMenu/ftv2vertline.gif b/wxc2_omc/frame/leftMenu/ftv2vertline.gif new file mode 100755 index 0000000..63ee93a Binary files /dev/null and b/wxc2_omc/frame/leftMenu/ftv2vertline.gif differ diff --git a/wxc2_omc/frame/leftMenu/index.html_bak b/wxc2_omc/frame/leftMenu/index.html_bak new file mode 100755 index 0000000..7b033e9 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/index.html_bak @@ -0,0 +1,25 @@ + + + +Treeview demos + + + +

      Treeview demos:

      + +These don't require a Web Server to be tested:
      + +Frame-based layout
      +Frameless layout
      +Frameless layout with highlight
      +Thousands-of-nodes example
      +Using JavaSript functions with the tree
      +Small tree where each node is a checkbox or radio box for a form
      +

      +This demo can only run if you call it through a web server (http:...) and if that web server can execute ASP code (i.e. IIS) and supports database connections: +
      +Dynamic server-side script builds tree by reading a database of folders and links
      + + + + diff --git a/wxc2_omc/frame/leftMenu/leftFrame.php b/wxc2_omc/frame/leftMenu/leftFrame.php new file mode 100755 index 0000000..5988bfe --- /dev/null +++ b/wxc2_omc/frame/leftMenu/leftFrame.php @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + +helpId=$helpId"; +if(strlen($helpId) > 0){ + echo "\n "; +} +?> + + + + + + + +

      + + + + +level_1=$level_1"; + +$mysqluser=str_rot13('nccyvpngvba'); +$mysqlpw=str_rot13('abvgnpvycCN#68*'); + +if(strlen($level_1) > 0){ + $dbLink = mysql_pconnect('localhost',$mysqluser,$mysqlpw); + $pubDb = 'OMC_PUB'; + $menuTable='sysMenuConf'; + $sortNoArr=array(0,0,0,0,0); + + $menuIdArr=explode('.',$level_1); + $levelWhere=''; + for($i=0;$i 0){ + $levelWhere .= "AND level_$j = {$menuIdArr[$i]} "; + }else{ + $levelWhere .= " level_$j = {$menuIdArr[$i]} "; + } + if($menuIdArr[$i] == 0) break; + $sortWhere=''; + switch($i){ + case 0: + $sortWhere .= " level_1 < {$menuIdArr[0]} "; + break; + case 1: + $sortWhere .= " level_1={$menuIdArr[0]} + AND level_2 < {$menuIdArr[1]} "; + break; + case 2: + $sortWhere .= " level_1={$menuIdArr[0]} + AND level_2 = {$menuIdArr[1]} + AND level_3 < {$menuIdArr[2]}"; + break; + case 3: + $sortWhere .= " level_1={$menuIdArr[0]} + AND level_2 = {$menuIdArr[1]} + AND level_3 = {$menuIdArr[2]} + AND level_4 < {$menuIdArr[3]}"; + break; + case 4: + $sortWhere .= " level_1={$menuIdArr[0]} + AND level_2 = {$menuIdArr[1]} + AND level_3 = {$menuIdArr[2]} + AND level_4 = {$menuIdArr[3]} + AND level_5 < {$menuIdArr[4]}"; + break; + } + + $menuSql = "SELECT count(*) as sortNo + FROM $menuTable + WHERE $sortWhere + "; + if($DEBUG) echo "
      menuSql = $menuSql"; + $menuResult = @mysqli_query($pubConn,$menuSql); + echo mysqli_error($pubConn); + $menuRow=mysqli_fetch_array($menuResult); + if($DEBUG) echo "
      menuRow[sortNo]={$menuRow[sortNo]}"; + if($i > 0){ + $sortNoArr[$i]=$sortNoArr[$i-1] + $menuRow[sortNo]; + }else{ + $sortNoArr[$i]=$menuRow[sortNo] + 1; + } + if($DEBUG) echo "
      sortNoArr[$i]={$sortNoArr[$i]}"; + } + if($DEBUG) echo "
      levelWhere=$levelWhere"; + if(!$DEBUG) echo "\n "; +} +?> + + + diff --git a/wxc2_omc/frame/leftMenu/leftMenu.php b/wxc2_omc/frame/leftMenu/leftMenu.php new file mode 100755 index 0000000..cab6543 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/leftMenu.php @@ -0,0 +1,292 @@ +"; +$level_1 = ($level_1 > 0 ?$level_1 :1); +$myPrivilege = $userInfo['privilege']; +$max_layer=5; +if($selectedLanguage == 'eng'){ + $menuName = 'name_2'; + $menuRemark = 'remark_2'; +}else{ + $menuName = 'name_1'; + $menuRemark = 'remark_1'; +} +getSerial(); +$tmpSql="SELECT * FROM $elementTable ORDER BY elementNo"; +if($DEBUG) echo "
      menuSql = $menuSql"; +$tmpResult = mysqli_query($pubConn,$tmpSql); +echo mysqli_error($pubConn); +while($tmpRow=mysqli_fetch_array($tmpResult)){ + $tmpNum=$tmpRow['elementNo']; + $elementExistArr[$tmpNum]=$tmpRow['existFlag']; +} + + +//for($i=0;$i$i=$elementExistArr[$i]"; + +//menuTypeNo level_1 level_2 level_3 level_4 level_5 name_1 name_2 link_1 link_2 privilege remark_1 remark_2 +$menuSql = "SELECT level_1,level_2,level_3,level_4,level_5,$menuName,httpLink,$menuRemark,menuTypeNo + FROM $menuTable + WHERE privilege <= '$myPrivilege' AND privilege >= '0' + AND level_1='$level_1' + ORDER BY level_1,level_2,level_3,level_4,level_5 + "; +if($DEBUG) echo "
      menuSql = $menuSql"; +$menuResult = mysqli_query($pubConn,$menuSql); +echo mysqli_error($pubConn); +$menuRowsNum = mysqli_num_rows($menuResult); + +//init menu array +$tmpArrNo=0; +for($i=0;$i< $menuRowsNum;$i++){ + $menuRow=mysqli_fetch_array($menuResult); + //echo "
      menuTypeNo=$menuRow[menuTypeNo]"; + if($elementExistArr[$menuRow['menuTypeNo']]!=1) + continue; + $menu_arr[$tmpArrNo]=array(0,0,0,0,0,'menuName','menuLink','menuRemak'); //match to $max_layer + $menu_arr[$tmpArrNo][0]=$menuRow['level_1']; + $menu_arr[$tmpArrNo][1]=$menuRow['level_2']; + $menu_arr[$tmpArrNo][2]=$menuRow['level_3']; + $menu_arr[$tmpArrNo][3]=$menuRow['level_4']; + $menu_arr[$tmpArrNo][4]=$menuRow['level_5']; + $menu_arr[$tmpArrNo][$max_layer]=$menuRow[$menuName]; + $menu_arr[$tmpArrNo][$max_layer + 1]=$menuRow['httpLink']; + $menu_arr[$tmpArrNo][$max_layer + 2]=$menuRow[$menuRemark]; + $tmpArrNo++; +} +$topMenuName=$menu_arr[0][$max_layer]; +/* +if($DEBUG){ + echo "
      menuRowsNum = $menuRowsNum"; + echo "
      -------------------------------------"; + //鏄剧ず瀵煎叆鏁扮粍鐨勪俊鎭� + for($i=0;$i<$menuRowsNum;$i++){ + echo "
      >"; + for($j=0;$j<$max_layer;$j++){ + if($menu_arr[$i][$j] > 0){ + echo "{$menu_arr[$i][$j]}"; + echo "."; + } + } + echo "-{$menu_arr[$i][$max_layer]}"; + echo "-{$menu_arr[$i][$max_layer+1]}"; + echo "-{$menu_arr[$i][$max_layer+2]}"; + } +} +*/ +?> + + + + + + + + + + + + + +
      +
      + + + + +"; +?> + +
        + +
      +  $fieldName"; + ?> +
      SN:$ttlSerial
      + +
      +
      +
      + + + + + + +"; +echo ""; +echo ""; +echo ""; + +echo ""; +?> + + + + + + + + + + + + + + + +
       
      Online Help
      Site map
      +
      + +$strExit"; ?> +
      +
      + + + + + + + + + + + + + diff --git a/wxc2_omc/frame/leftMenu/menuTree.php b/wxc2_omc/frame/leftMenu/menuTree.php new file mode 100755 index 0000000..d91ae91 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/menuTree.php @@ -0,0 +1,523 @@ + +"; +$level_1 = ($level_1 > 0 ?$level_1 :1); +$myPrivilege = $userInfo['privilege']; +$max_layer=5; +if($selectedLanguage == 'eng'){ + $menuName = 'name_2'; + $menuRemark = 'remark_2'; +}else{ + $menuName = 'name_1'; + $menuRemark = 'remark_1'; +} +getSerial(); +$tmpSql="SELECT * FROM $elementTable ORDER BY elementNo"; +//$tmpResult = @mysqli_query($pubConn,$tmpSql); +$tmpResult = mysqli_query($pubConn,$tmpSql); +echo mysqli_error($pubConn); +while($tmpRow=mysqli_fetch_array($tmpResult)){ + $tmpNum=$tmpRow['elementNo']; + $elementExistArr[$tmpNum]=$tmpRow['existFlag']; +} + +//for($i=0;$i$i=$elementExistArr[$i]"; + +//menuTypeNo level_1 level_2 level_3 level_4 level_5 name_1 name_2 link_1 link_2 privilege remark_1 remark_2 +$menuSql = "SELECT level_1,level_2,level_3,level_4,level_5,$menuName,httpLink,$menuRemark,menuTypeNo + FROM $menuTable + WHERE privilege <= '$myPrivilege' AND privilege >= '0' + AND level_1='$level_1' + ORDER BY level_1,level_2,level_3,level_4,level_5 + "; +if($DEBUG) echo "
      menuSql = $menuSql"; +$menuResult = mysqli_query($pubConn,$menuSql); +echo mysqli_error($pubConn); +$menuRowsNum = mysqli_num_rows($menuResult); + +//init menu array +$tmpArrNo=0; +for($i=0;$i< $menuRowsNum;$i++){ + $menuRow=mysqli_fetch_array($menuResult); + //echo "
      menuTypeNo=$menuRow[menuTypeNo]"; + if($elementExistArr[$menuRow['menuTypeNo']]!=1) + continue; + $menu_arr[$tmpArrNo]=array(0,0,0,0,0,'menuName','menuLink','menuRemak'); //match to $max_layer + $menu_arr[$tmpArrNo][0]=$menuRow['level_1']; + $menu_arr[$tmpArrNo][1]=$menuRow['level_2']; + $menu_arr[$tmpArrNo][2]=$menuRow['level_3']; + $menu_arr[$tmpArrNo][3]=$menuRow['level_4']; + $menu_arr[$tmpArrNo][4]=$menuRow['level_5']; + $menu_arr[$tmpArrNo][$max_layer]=$menuRow[$menuName]; + $menu_arr[$tmpArrNo][$max_layer + 1]=$menuRow['httpLink']; + $menu_arr[$tmpArrNo][$max_layer + 2]=$menuRow[$menuRemark]; + $tmpArrNo++; +} +$topMenuName=$menu_arr[0][$max_layer]; +/* +if($DEBUG){ + echo "
      menuRowsNum = $menuRowsNum"; + echo "
      -------------------------------------"; + //鏄剧ず瀵煎叆鏁扮粍鐨勪俊鎭� + for($i=0;$i<$menuRowsNum;$i++){ + echo "
      >"; + for($j=0;$j<$max_layer;$j++){ + if($menu_arr[$i][$j] > 0){ + echo "{$menu_arr[$i][$j]}"; + echo "."; + } + } + echo "-{$menu_arr[$i][$max_layer]}"; + echo "-{$menu_arr[$i][$max_layer+1]}"; + echo "-{$menu_arr[$i][$max_layer+2]}"; + } +} +*/ +?> + + + + + + + + + + + + + + + + + + + + +menuIdbgnNumendNum"; +for($i=0 ; $i < sizeof($menu_arr); $i++) //浠庝笂鍒颁笅 ---> 绾� +{ + $tree_menu[$i]=array(0,'',0,0); + $menu_temp=''; + $div_bgn_num=0; + $div_end_num=0; + $menu_id=''; + for($id=0;$id<$max_layer;$id++){ + if($menu_arr[$i][$id] > 0){ + if($id > 0){ + $menu_id = $menu_id.'_'.$menu_arr[$i][$id]; + }else{ + $menu_id = $menu_arr[$i][$id]; + } + }else{ + break; + } + } + + $show_name = $menu_arr[$i][$level_num]; + + $num=1; + while($menu_arr[$i][$num] > 0){ + $num++; + } + + $show_level = $menu_arr[$i][$num - 1].'.'; + $lastLevelNo=$num - 1; + $show = "".$show_name.""; + + //$show = "".' '.$show_name.""; + $show_1 = "$show"; + $show_2 = "$show"; + $show_3 = ""; + $show_4 = "$show"; + $show_5 = ""; + + $menu_temp.="\n"; + for($j=$bgnLevelNo;$j < $level_num; $j++){ //浠庡乏鍒板彸 ---> 灞� + if($menu_arr[$i][$j] > 0){ //濡傛灉璇ヨ妭鐐瑰ぇ浜庨浂 + //濡傛灉涓嬮潰鏈夋爲鏋濇垨椤靛瓙涓庢湰鑺傜偣锛堟爲鏋濇垨鍙跺瓙锛夌浉杩烇紝鍗充笅闈㈡湁鍏勫紵鑺傜偣 + if($menu_arr[$i+1][$j] > $menu_arr[$i][$j] ){ + //濡傛灉鏄爲鏋� + if($menu_arr[$i][$j+1] > 0){ + $menu_temp.="$show_3"; //show_3 + //鍚﹀垯鏄彾瀛� + }else{ + $menu_temp.="$show_2"; //show_2 + } + }else{ + //濡傛灉涓嬮潰鐨勮妭鐐瑰彿涓嶅ぇ浜庢湰鑺傜偣鍙� + if($menu_arr[$i][$j+1] > 0){ //濡傛灉鏈妭鐐逛笉鏄彾瀛� + $is_line =0; //鏍囧織浣嶏紝鐢ㄤ簬鏍囧織鍚屼竴鏍戞灊涓嬮潰鏄惁杩樻湁鍒嗘敮锛屾垨鏄洿鎺ヨ繛鍦ㄦ湰鏋濅笂鐨勫彾瀛愩�� + + //椤虹潃涓婁竴灞傜洰褰曪紝鍚戜笅鏌ユ壘 + for($p=$i+1;$p < sizeof($menu_arr) && $menu_arr[$p][$j-1] == $menu_arr[$i][$j-1];$p++){ + if($menu_arr[$p][$j] > $menu_arr[$i][$j]){ //鎵惧埌浜嗭紒锛侊紒 + $is_line = 1; + break; + } + } + + if($is_line == 1){ + //涓嬮潰杩樻湁鍒嗘敮锛屾垨鏄洿鎺ヨ繛鍦ㄦ湰鏋濅笂鐨勫彾瀛� + $menu_temp.= "$show_3"; //show_3 + }else{ + //鍚屼竴鏍戞灊涓嬫病鏈夊垎鏀紝鎴栨槸杩炲湪鏈灊涓婄殑鍙跺瓙 + $menu_temp.= "$show_5"; //show_5 + } + }else{ + //鏈妭鐐规槸鍙跺瓙 + if($menu_arr[$i+1][$j+1] > 0){ + //鏈妭鐐规湁鍒嗗弶锛屽嵆鏈夎捣鐐瑰湪鏈妭鐐圭殑瀛愭爲 + $menu_temp.= "$show_1"; //show_1 + $div_bgn_num++; + }else{ + $menu_temp.= "$show_4"; //show_4 + //鏈妭鐐规槸鏍戞灊鏈�鏈竴鐗囬〉瀛� + for($k=$bgnLevelNo;$k < $level_num;$k++){ + if($menu_arr[$i+1][$k] == 0){ + $div_end_num = $j - $k + 1; + break; + } + } + //if($menu_arr[$i][$bgnLevelNo] != $menu_arr[$i+1][$bgnLevelNo] + // || $menu_arr[$i+1][$bgnLevelNo] == 0){ + // $div_end_num = $j - $bgnLevelNo; + //} + if($div_end_num == 0){ + $div_end_num = 1; + } + if($DEBUG) echo "$j / $k $div_bgn_num $div_end_num"; + for($k=($i-1);$k >= $bgnLevelNo;$k--){ + if($menu_arr[$k][$j-1] == $menu_arr[$i][$j-1] && $menu_arr[$k][$j] > 0){//鍚屼竴涓埗鑺傜偣 + if($tree_menu[$k][3] > 2){ + $tree_menu[$k][3] --; + if($DEBUG) echo "$j / $k {$tree_menu[$k][2]} {$tree_menu[$k][3]}"; + } + }else{ + break; + } + } + } + } + } //end else of if($menu_arr[$i+1][$j] > $menu_arr[$i][$j] ) + } //end if($menu_arr[$i][$j] > 0) + } //end for($j=0;$j < $level_num;$j++) + $menu_temp.="
      "; + $tree_menu[$i][0]=$menu_id; + $tree_menu[$i][1]=$menu_temp; + $tree_menu[$i][2]=$div_bgn_num; + $tree_menu[$i][3]=$div_end_num; + if($DEBUG) echo "$menu_id $div_bgn_num $div_end_num"; +} //end for($i=0 ; $i < sizeof($menu_arr); $i++) +if($DEBUG) echo ""; +//echo "
      menu_num = $i"; +/*************************************涓嬮潰鏄『搴忔樉绀鸿彍鍗曠▼搴�***************************************/ + + +echo ">> $topMenuName"; +for($i=0;$i<=sizeof($tree_menu);$i++){ + $menu_id = $tree_menu[$i][0]; + $menu_content = $tree_menu[$i][1]; + $div_bgn_num = $tree_menu[$i][2]; + $div_end_num = $tree_menu[$i][3]; + if($div_bgn_num > 0){ + echo "\n
      "; + echo "$menu_content"; + echo "\n
      "; + echo "\n
      "; + }else{ + echo "$menu_content"; + } + + for($j=0;$j<$div_end_num;$j++){ + echo "\n
      "; + } +} + + +//echo "
      i=$i"; + +//榧犳爣褰㈢姸 +//灏忔墜: style="cursor:hand" +//宸︾澶�: style="cursor:w-resize" +?> + + + + + + diff --git a/wxc2_omc/frame/leftMenu/readme.html b/wxc2_omc/frame/leftMenu/readme.html new file mode 100755 index 0000000..d15ccd2 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/readme.html @@ -0,0 +1,9 @@ + +For instructions go to + +http://www.treeview.net/treemenu/instructions.asp + +

      +To test the code you downloaded, start with index.html + + \ No newline at end of file diff --git a/wxc2_omc/frame/leftMenu/siteMap.php b/wxc2_omc/frame/leftMenu/siteMap.php new file mode 100755 index 0000000..0acb987 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/siteMap.php @@ -0,0 +1,156 @@ + + += '0' + ORDER BY level_1,level_2,level_3,level_4,level_5 + "; +//WHERE menuTypeNo = '$OmcTypeNo' AND +if($DEBUG) + echo "selSQL=$selSQL
      "; +$selResult = @mysqli_query($pubConn,$selSQL); +echo mysqli_error($pubConn); +$selRowsNum = mysqli_num_rows($selResult); +if($DEBUG) echo "selRowsNum=$selRowsNum
      "; +adjust_title_head(); +?> + + + + + +

      Site map

      + +
      +{$menu_arr[$i][5]}"; + }else{ + if($menu_arr[$i][2] == 0){ + if($menu_arr[$i][6]!=''){ + echo "
    • {$menu_arr[$i][5]}"; + }else{ + echo "
    • {$menu_arr[$i][5]}"; + } + $preLevel2 = $menu_arr[$i][1]; + $middleLineFlag = 1; + $compartFlag = 1; + }else{ + if($menu_arr[$i][3] == 0){ + if ( ($menu_arr[$i][1] == $preLevel2) && (1 == $middleLineFlag) ){ + echo " -- "; + unset($middleLineFlag); + } + if( 1 == $compartFlag ){ + unset($compartFlag); + }else{ + echo " | "; + } + if($menu_arr[$i][6]!=''){ + echo "{$menu_arr[$i][5]}"; + }else{ + echo "{$menu_arr[$i][5]}"; + } + $preLevel3 = $menu_arr[$i][2]; + $arrowFlag = 1; + $spaceFlag = 1; + }else{ + if($menu_arr[$i][4] == 0){ + if ( ($menu_arr[$i][2] == $preLevel3) && (1==$arrowFlag) ) { + echo " -> "; + unset($arrowFlag); + } + if( 1 == $spaceFlag ){ + unset($spaceFlag); + }else{ + echo "  "; + } + if($menu_arr[$i][6]!=''){ + echo "{$menu_arr[$i][5]}"; + }else{ + echo "{$menu_arr[$i][5]}"; + } + }else{ + echo "  "; + if($menu_arr[$i][6]!=''){ + echo "{$menu_arr[$i][5]}"; + }else{ + echo "{$menu_arr[$i][5]}"; + } + }//end 4 + }//end 3 + }//end 2 + }//end 1 + +} +?> +
    • + + + \ No newline at end of file diff --git a/wxc2_omc/frame/leftMenu/siteMap.php.bak b/wxc2_omc/frame/leftMenu/siteMap.php.bak new file mode 100755 index 0000000..561894d --- /dev/null +++ b/wxc2_omc/frame/leftMenu/siteMap.php.bak @@ -0,0 +1,125 @@ += '0' + ORDER BY level_1,level_2,level_3,level_4,level_5 + "; +if($DEBUG) echo "selSQL=$selSQL
      "; +$selResult = @mysqli_query($pubConn,$selSQL); +echo mysqli_error($pubConn); +$selRowsNum = mysqli_num_rows($selResult); +if($DEBUG) echo "selRowsNum=$selRowsNum
      "; +?> + + + + + +

      Site map

      +
      +{$menu_arr[$i][5]}"; + }else{ + if($menu_arr[$i][2] == 0){ + if($menu_arr[$i][6]!=''){ + echo "
    • {$menu_arr[$i][5]}"; + }else{ + echo "
    • {$menu_arr[$i][5]}"; + } + }else{ + if($menu_arr[$i][3] == 0){ + echo "
      "; + echo "    "; + if($menu_arr[$i][6]!=''){ + echo "{$menu_arr[$i][5]}"; + }else{ + echo "{$menu_arr[$i][5]}"; + } + }else{ + if($menu_arr[$i][4] == 0){ + echo "
      "; + echo "    "; + echo "    "; + if($menu_arr[$i][6]!=''){ + echo "{$menu_arr[$i][5]}"; + }else{ + echo "{$menu_arr[$i][5]}"; + } + }else{ + echo "
      "; + echo "    "; + echo "    "; + echo "    "; + if($menu_arr[$i][6]!=''){ + echo "{$menu_arr[$i][5]}"; + }else{ + echo "{$menu_arr[$i][5]}"; + } + }//end 4 + }//end 3 + }//end 2 + }//end 1 + +} +?> +
    • + \ No newline at end of file diff --git a/wxc2_omc/frame/leftMenu/treeMenuDef.php b/wxc2_omc/frame/leftMenu/treeMenuDef.php new file mode 100755 index 0000000..d709cb0 --- /dev/null +++ b/wxc2_omc/frame/leftMenu/treeMenuDef.php @@ -0,0 +1,112 @@ +// Decide if the names are links or just the icons +USETEXTLINKS = 1 //replace 0 with 1 for hyperlinks + +// Decide if the tree is to start all open or just showing the root folders +STARTALLOPEN = 0 //replace 0 with 1 to show the whole tree +HIGHLIGHT = 1 +PERSERVESTATE = 1 +USEICONS = 0 + +ICONPATH = '' //change if the gif's folder is a subfolder, for example: 'images/' +"; +if($selectedLanguage == 'eng'){ + $menuName = name_2; + $menuRemark = remark_2; +}else{ + $menuName = name_1; + $menuRemark = remark_1; +} + +//menuTypeNo level_1 level_2 level_3 level_4 level_5 name_1 name_2 link_1 link_2 privilege remark_1 remark_2 +$menuSql = "SELECT level_1,level_2,level_3,level_4,level_5,$menuName,httpLink,$menuRemark + FROM $menuTable + WHERE menuTypeNo = '$OmcTypeNo' AND privilege <= '$myPrivilege' AND privilege >= '0' + AND level_1='$level_1' + ORDER BY level_1,level_2,level_3,level_4,level_5 + "; +//if($DEBUG) +echo "
      menuSql = $menuSql"; +$menuResult = @mysqli_query($pubConn,$menuSql); +echo mysqli_error($pubConn); +$menuRowsNum = mysqli_num_rows($menuResult); + +//init menu array +for($i=0;$i<$menuRowsNum;$i++){ + $menuRow=mysqli_fetch_array($menuResult); + $menu_arr[$i]=array(0,0,0,0,0,'menuName','httpLink','menuRemark'); //match to $maxLevelNum + $menu_arr[$i][0]=$menuRow[level_1]; + $menu_arr[$i][1]=$menuRow[level_2]; + $menu_arr[$i][2]=$menuRow[level_3]; + $menu_arr[$i][3]=$menuRow[level_4]; + $menu_arr[$i][4]=$menuRow[level_5]; + $menu_arr[$i][$maxLevelNum]=$menuRow[$menuName]; + //if(strlen($menuRow[helpPageBookmark]) > 0){ + // $menu_arr[$i][$maxLevelNum + 1]=$menuRow[helpPagePath].'#'.$menuRow[helpPageBookmark]; + //}else{ + $menu_arr[$i][$maxLevelNum + 1]=$menuRow[httpLink]; + //} + +} +$topMenuName=$menu_arr[0][$maxLevelNum]; +if($DEBUG){ + echo "
      menuRowsNum = $menuRowsNum"; + echo "
      -------------------------------------"; + //显示导入数组的信息 + for($i=0;$i<$menuRowsNum;$i++){ + echo "
      >"; + for($j=0;$j<$maxLevelNum;$j++){ + if($menu_arr[$i][$j] > 0){ + echo "{$menu_arr[$i][$j]}"; + echo "."; + } + } + echo "-{$menu_arr[$i][$maxLevelNum]}"; + echo "-{$menu_arr[$i][$maxLevelNum+1]}"; + } +} +if($DEBUG) echo "
      "; +echo "\n\n foldersTree = gFld(\"Menus\", \"\")"; + +for($i=0 ; $i < sizeof($menu_arr); $i++){ //从上到下 ---> 级 + $isShowed = 0; + for($j=0;$j < $maxLevelNum; $j++){ //从左到右 ---> 层 + if($menu_arr[$i][$j] > 0 && $menu_arr[$i][$j+1] == 0 && $isShowed == 0){ //找到最后一层 + $menuName="{$menu_arr[$i][$j]}. {$menu_arr[$i][$maxLevelNum]}"; + if(strlen($menu_arr[$i][$maxLevelNum + 1]) > 0){ + $menuLink="../{$menu_arr[$i][$maxLevelNum + 1]} "; + }else{ + $menuLink="../default.htm "; + } + + //如果下面有树枝或页子与本节点(树枝或叶子)相连,即下面有兄弟节点 + //if($menu_arr[$i+1][$j] > $menu_arr[$i][$j] ){ + if($DEBUG) echo "
      "; + $parentId=$j; + $thisId=$j+1; + if($menu_arr[$i+1][$j+1] > 0){//如果是树枝 + if($j == 0){ + echo "\n aux{$thisId} = insFld(foldersTree, gFld(\"$menuName\", \"$menuLink\"))"; + }else{ + echo "\n aux{$thisId} = insFld(aux{$parentId}, gFld(\"$menuName\", \"$menuLink\"))"; + } + }else{ //否则是叶子 + echo "\n insDoc(aux{$parentId}, gLnk(\"R\", \"$menuName\", \"$menuLink\"))"; + } + //} + $isShowed = 1; + } //end if($menu_arr[$i][$j+1] == 0) + } //end for($j=0;$j < $level_num;$j++) +} + +?> \ No newline at end of file diff --git a/wxc2_omc/frame/leftMenu/ua.js b/wxc2_omc/frame/leftMenu/ua.js new file mode 100755 index 0000000..699a02b --- /dev/null +++ b/wxc2_omc/frame/leftMenu/ua.js @@ -0,0 +1,150 @@ +/* + * $Log: ua.js,v $ + * Revision 1.1.1.1 2003/08/27 12:32:00 cvsroot + * omcWeb_v5 project + * + * Revision 1.9 2002/07/22 14:06:21 bc6ix + * fix license path, change version reporting to use 2 digits for each level + * + * Revision 1.8 2002/07/07 08:23:07 bc6ix + * fix line endings + * + * Revision 1.7 2002/05/14 16:52:52 bc6ix + * use CVS Log for revision history + * + * + */ + +/* ***** BEGIN LICENSE BLOCK ***** + * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * Full Terms at http://bclary.com/lib/js/license/mpl-tri-license.txt + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Netscape code. + * + * The Initial Developer of the Original Code is + * Netscape Corporation. + * Portions created by the Initial Developer are Copyright (C) 2001 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Bob Clary + * + * ***** END LICENSE BLOCK ***** */ + +function xbDetectBrowser() +{ + var oldOnError = window.onerror; + var element = null; + + window.onerror = null; + + // work around bug in xpcdom Mozilla 0.9.1 + window.saveNavigator = window.navigator; + + navigator.OS = ''; + navigator.version = parseFloat(navigator.appVersion); + navigator.org = ''; + navigator.family = ''; + + var platform; + if (typeof(window.navigator.platform) != 'undefined') + { + platform = window.navigator.platform.toLowerCase(); + if (platform.indexOf('win') != -1) + navigator.OS = 'win'; + else if (platform.indexOf('mac') != -1) + navigator.OS = 'mac'; + else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1) + navigator.OS = 'nix'; + } + + var i = 0; + var ua = window.navigator.userAgent.toLowerCase(); + + if (ua.indexOf('safari') != -1) + { + i = ua.indexOf('safari'); + navigator.family = 'safari'; + navigator.org = 'safari'; + navigator.version = parseFloat('0' + ua.substr(i+7), 10); + } + else if (ua.indexOf('opera') != -1) + { + i = ua.indexOf('opera'); + navigator.family = 'opera'; + navigator.org = 'opera'; + navigator.version = parseFloat('0' + ua.substr(i+6), 10); + } + else if ((i = ua.indexOf('msie')) != -1) + { + navigator.org = 'microsoft'; + navigator.version = parseFloat('0' + ua.substr(i+5), 10); + + if (navigator.version < 4) + navigator.family = 'ie3'; + else + navigator.family = 'ie4' + } + else if (ua.indexOf('gecko') != -1) + { + navigator.family = 'gecko'; + var rvStart = ua.indexOf('rv:'); + var rvEnd = ua.indexOf(')', rvStart); + var rv = ua.substring(rvStart+3, rvEnd); + var rvParts = rv.split('.'); + var rvValue = 0; + var exp = 1; + + for (var i = 0; i < rvParts.length; i++) + { + var val = parseInt(rvParts[i]); + rvValue += val / exp; + exp *= 100; + } + navigator.version = rvValue; + + if (ua.indexOf('netscape') != -1) + navigator.org = 'netscape'; + else if (ua.indexOf('compuserve') != -1) + navigator.org = 'compuserve'; + else + navigator.org = 'mozilla'; + } + else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1)) + { + var is_major = parseFloat(navigator.appVersion); + + if (is_major < 4) + navigator.version = is_major; + else + { + i = ua.lastIndexOf('/') + navigator.version = parseFloat('0' + ua.substr(i+1), 10); + } + navigator.org = 'netscape'; + navigator.family = 'nn' + parseInt(navigator.appVersion); + } + else if ((i = ua.indexOf('aol')) != -1 ) + { + // aol + navigator.family = 'aol'; + navigator.org = 'aol'; + navigator.version = parseFloat('0' + ua.substr(i+4), 10); + } + else if ((i = ua.indexOf('hotjava')) != -1 ) + { + // hotjava + navigator.family = 'hotjava'; + navigator.org = 'sun'; + navigator.version = parseFloat(navigator.appVersion); + } + + window.onerror = oldOnError; +} + +xbDetectBrowser(); + diff --git a/wxc2_omc/frame/sub_inc/sub_config.inc b/wxc2_omc/frame/sub_inc/sub_config.inc new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/frame/topMenu/topMenu.php b/wxc2_omc/frame/topMenu/topMenu.php new file mode 100755 index 0000000..4e78204 --- /dev/null +++ b/wxc2_omc/frame/topMenu/topMenu.php @@ -0,0 +1,415 @@ += '0' + AND level_2 = '0' AND level_3 = '0' AND level_4 = '0' AND level_5 = '0' + ORDER BY level_1 + "; +if($DEBUG) + echo "
      menuSql = $menuSql"; +//$menuResult = @mysqli_query($pubConn,$menuSql); +$menuResult = mysqli_query($pubConn,$menuSql); +echo mysqli_error($pubConn); +$menuRowsNum = mysqli_num_rows($menuResult); +?> + + + + + +"; +?> + + + + + + + + + + +
      + +   + + + + + "; + echo ""; + echo ""; + } + ?> + +
      "; + echo ""; + echo "
      "; + echo ""; + $blankLen=ceil(($keepLenght - strlen($menuRow[$menuName])) / 2); + //echo "
      blankLen=$blankLen"; + $blankStr=''; + for($i=0;$i<$blankLen/3;$i++){ + $blankStr .= ' '; + } + echo "$blankStr$menuRow[$menuName]$blankStr"; + echo "
      "; + echo "
      "; + echo "
      "; + echo "
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +    +
      + + diff --git a/wxc2_omc/frame/topMenu/updateAlarm.php b/wxc2_omc/frame/topMenu/updateAlarm.php new file mode 100755 index 0000000..57fa58e --- /dev/null +++ b/wxc2_omc/frame/topMenu/updateAlarm.php @@ -0,0 +1,48 @@ +showSql=$showSql"; +$result=@mysqli_query($pubConn,$showSql); +echo mysqli_error($pubConn); +global $alarmNumArr; +while ($rows = @mysqli_fetch_array($result)) { + $alarmNumArr[$rows['alarmLevel']]['number'] = $rows['number']; +} +//echo "alarmNumArr=$alarmNumArr
      "; +// echo "
      ";
      +// echo print_r($alarmNumArr);
      +// echo "
      "; + +for ($i = 1; $i <= 5; $i++) { + if (trim($alarmNumArr[$i]['number']) == "") + $alarmNumArr[$i]['number'] = 0; +} +$retureValue = $alarmNumArr[1]['number'] . "_" . $alarmNumArr[2]['number'] . "_" . $alarmNumArr[3]['number'] . "_" . $alarmNumArr[4]['number'] . "_" . $alarmNumArr[5]['number']; +echo "$retureValue"; ///is should +?> + diff --git a/wxc2_omc/images/ADC_Logo_Red_40x40.gif b/wxc2_omc/images/ADC_Logo_Red_40x40.gif new file mode 100755 index 0000000..3efd62a Binary files /dev/null and b/wxc2_omc/images/ADC_Logo_Red_40x40.gif differ diff --git a/wxc2_omc/images/ADC_Logo_Red_80x80.gif b/wxc2_omc/images/ADC_Logo_Red_80x80.gif new file mode 100755 index 0000000..e29e6da Binary files /dev/null and b/wxc2_omc/images/ADC_Logo_Red_80x80.gif differ diff --git a/wxc2_omc/images/Thumbs.db b/wxc2_omc/images/Thumbs.db new file mode 100755 index 0000000..a82bc0f Binary files /dev/null and b/wxc2_omc/images/Thumbs.db differ diff --git a/wxc2_omc/images/add.gif b/wxc2_omc/images/add.gif new file mode 100755 index 0000000..6398783 Binary files /dev/null and b/wxc2_omc/images/add.gif differ diff --git a/wxc2_omc/images/admin.gif b/wxc2_omc/images/admin.gif new file mode 100755 index 0000000..6b7e909 Binary files /dev/null and b/wxc2_omc/images/admin.gif differ diff --git a/wxc2_omc/images/alto_logo_40.gif b/wxc2_omc/images/alto_logo_40.gif new file mode 100755 index 0000000..ad58b3e Binary files /dev/null and b/wxc2_omc/images/alto_logo_40.gif differ diff --git a/wxc2_omc/images/alto_logo_80.gif b/wxc2_omc/images/alto_logo_80.gif new file mode 100755 index 0000000..d2f5f2b Binary files /dev/null and b/wxc2_omc/images/alto_logo_80.gif differ diff --git a/wxc2_omc/images/alvr_125.gif b/wxc2_omc/images/alvr_125.gif new file mode 100755 index 0000000..7ed323e Binary files /dev/null and b/wxc2_omc/images/alvr_125.gif differ diff --git a/wxc2_omc/images/alvr_250.gif b/wxc2_omc/images/alvr_250.gif new file mode 100755 index 0000000..1633079 Binary files /dev/null and b/wxc2_omc/images/alvr_250.gif differ diff --git a/wxc2_omc/images/alvr_300.gif b/wxc2_omc/images/alvr_300.gif new file mode 100755 index 0000000..050f718 Binary files /dev/null and b/wxc2_omc/images/alvr_300.gif differ diff --git a/wxc2_omc/images/arrow.gif b/wxc2_omc/images/arrow.gif new file mode 100755 index 0000000..93ec490 Binary files /dev/null and b/wxc2_omc/images/arrow.gif differ diff --git a/wxc2_omc/images/background_left.gif b/wxc2_omc/images/background_left.gif new file mode 100755 index 0000000..05bc41f Binary files /dev/null and b/wxc2_omc/images/background_left.gif differ diff --git a/wxc2_omc/images/background_left_bak.gif b/wxc2_omc/images/background_left_bak.gif new file mode 100755 index 0000000..9efcc28 Binary files /dev/null and b/wxc2_omc/images/background_left_bak.gif differ diff --git a/wxc2_omc/images/background_main_L.gif b/wxc2_omc/images/background_main_L.gif new file mode 100755 index 0000000..433ebfa Binary files /dev/null and b/wxc2_omc/images/background_main_L.gif differ diff --git a/wxc2_omc/images/background_main_M.gif b/wxc2_omc/images/background_main_M.gif new file mode 100755 index 0000000..55f3a85 Binary files /dev/null and b/wxc2_omc/images/background_main_M.gif differ diff --git a/wxc2_omc/images/background_main_R.gif b/wxc2_omc/images/background_main_R.gif new file mode 100755 index 0000000..0653be1 Binary files /dev/null and b/wxc2_omc/images/background_main_R.gif differ diff --git a/wxc2_omc/images/background_top.gif b/wxc2_omc/images/background_top.gif new file mode 100755 index 0000000..6c7db0a Binary files /dev/null and b/wxc2_omc/images/background_top.gif differ diff --git a/wxc2_omc/images/backup.gif b/wxc2_omc/images/backup.gif new file mode 100755 index 0000000..a809eb4 Binary files /dev/null and b/wxc2_omc/images/backup.gif differ diff --git a/wxc2_omc/images/batchAdd.gif b/wxc2_omc/images/batchAdd.gif new file mode 100755 index 0000000..e397ac5 Binary files /dev/null and b/wxc2_omc/images/batchAdd.gif differ diff --git a/wxc2_omc/images/begin_show.gif b/wxc2_omc/images/begin_show.gif new file mode 100755 index 0000000..ae13338 Binary files /dev/null and b/wxc2_omc/images/begin_show.gif differ diff --git a/wxc2_omc/images/bg_shelf_noBss.jpg b/wxc2_omc/images/bg_shelf_noBss.jpg new file mode 100755 index 0000000..0bd3a84 Binary files /dev/null and b/wxc2_omc/images/bg_shelf_noBss.jpg differ diff --git a/wxc2_omc/images/blank.gif b/wxc2_omc/images/blank.gif new file mode 100755 index 0000000..4ebef74 Binary files /dev/null and b/wxc2_omc/images/blank.gif differ diff --git a/wxc2_omc/images/block_blue.gif b/wxc2_omc/images/block_blue.gif new file mode 100755 index 0000000..fb8353e Binary files /dev/null and b/wxc2_omc/images/block_blue.gif differ diff --git a/wxc2_omc/images/block_gray.gif b/wxc2_omc/images/block_gray.gif new file mode 100755 index 0000000..c4235ee Binary files /dev/null and b/wxc2_omc/images/block_gray.gif differ diff --git a/wxc2_omc/images/block_green.gif b/wxc2_omc/images/block_green.gif new file mode 100755 index 0000000..1924ab5 Binary files /dev/null and b/wxc2_omc/images/block_green.gif differ diff --git a/wxc2_omc/images/block_red.gif b/wxc2_omc/images/block_red.gif new file mode 100755 index 0000000..895e41d Binary files /dev/null and b/wxc2_omc/images/block_red.gif differ diff --git a/wxc2_omc/images/blue.GIF b/wxc2_omc/images/blue.GIF new file mode 100755 index 0000000..fd59225 Binary files /dev/null and b/wxc2_omc/images/blue.GIF differ diff --git a/wxc2_omc/images/blue_blink.gif b/wxc2_omc/images/blue_blink.gif new file mode 100755 index 0000000..1aabb7c Binary files /dev/null and b/wxc2_omc/images/blue_blink.gif differ diff --git a/wxc2_omc/images/blue_gray.gif b/wxc2_omc/images/blue_gray.gif new file mode 100755 index 0000000..056bf4f Binary files /dev/null and b/wxc2_omc/images/blue_gray.gif differ diff --git a/wxc2_omc/images/book.gif b/wxc2_omc/images/book.gif new file mode 100755 index 0000000..3ee493a Binary files /dev/null and b/wxc2_omc/images/book.gif differ diff --git a/wxc2_omc/images/box_blue.gif b/wxc2_omc/images/box_blue.gif new file mode 100755 index 0000000..5975228 Binary files /dev/null and b/wxc2_omc/images/box_blue.gif differ diff --git a/wxc2_omc/images/box_red.gif b/wxc2_omc/images/box_red.gif new file mode 100755 index 0000000..aaf76da Binary files /dev/null and b/wxc2_omc/images/box_red.gif differ diff --git a/wxc2_omc/images/bulk_add.GIF b/wxc2_omc/images/bulk_add.GIF new file mode 100755 index 0000000..b981491 Binary files /dev/null and b/wxc2_omc/images/bulk_add.GIF differ diff --git a/wxc2_omc/images/cal.gif b/wxc2_omc/images/cal.gif new file mode 100755 index 0000000..5ebdba9 Binary files /dev/null and b/wxc2_omc/images/cal.gif differ diff --git a/wxc2_omc/images/card.gif b/wxc2_omc/images/card.gif new file mode 100755 index 0000000..833e610 Binary files /dev/null and b/wxc2_omc/images/card.gif differ diff --git a/wxc2_omc/images/card_bak.gif b/wxc2_omc/images/card_bak.gif new file mode 100755 index 0000000..ff2d905 Binary files /dev/null and b/wxc2_omc/images/card_bak.gif differ diff --git a/wxc2_omc/images/cdr.gif b/wxc2_omc/images/cdr.gif new file mode 100755 index 0000000..3f16e38 Binary files /dev/null and b/wxc2_omc/images/cdr.gif differ diff --git a/wxc2_omc/images/chinese.gif b/wxc2_omc/images/chinese.gif new file mode 100755 index 0000000..31f0f06 Binary files /dev/null and b/wxc2_omc/images/chinese.gif differ diff --git a/wxc2_omc/images/clear.gif b/wxc2_omc/images/clear.gif new file mode 100755 index 0000000..02a923d Binary files /dev/null and b/wxc2_omc/images/clear.gif differ diff --git a/wxc2_omc/images/close.gif b/wxc2_omc/images/close.gif new file mode 100755 index 0000000..b12849b Binary files /dev/null and b/wxc2_omc/images/close.gif differ diff --git a/wxc2_omc/images/compare.gif b/wxc2_omc/images/compare.gif new file mode 100755 index 0000000..915a021 Binary files /dev/null and b/wxc2_omc/images/compare.gif differ diff --git a/wxc2_omc/images/connect.gif b/wxc2_omc/images/connect.gif new file mode 100755 index 0000000..94df154 Binary files /dev/null and b/wxc2_omc/images/connect.gif differ diff --git a/wxc2_omc/images/content_down.gif b/wxc2_omc/images/content_down.gif new file mode 100755 index 0000000..9045a86 Binary files /dev/null and b/wxc2_omc/images/content_down.gif differ diff --git a/wxc2_omc/images/content_down_middle.gif b/wxc2_omc/images/content_down_middle.gif new file mode 100755 index 0000000..c0e3d69 Binary files /dev/null and b/wxc2_omc/images/content_down_middle.gif differ diff --git a/wxc2_omc/images/content_down_noleft.gif b/wxc2_omc/images/content_down_noleft.gif new file mode 100755 index 0000000..cb0899a Binary files /dev/null and b/wxc2_omc/images/content_down_noleft.gif differ diff --git a/wxc2_omc/images/content_down_small.gif b/wxc2_omc/images/content_down_small.gif new file mode 100755 index 0000000..48d33f6 Binary files /dev/null and b/wxc2_omc/images/content_down_small.gif differ diff --git a/wxc2_omc/images/content_up.gif b/wxc2_omc/images/content_up.gif new file mode 100755 index 0000000..81888b1 Binary files /dev/null and b/wxc2_omc/images/content_up.gif differ diff --git a/wxc2_omc/images/csv_file.gif b/wxc2_omc/images/csv_file.gif new file mode 100755 index 0000000..c8fe980 Binary files /dev/null and b/wxc2_omc/images/csv_file.gif differ diff --git a/wxc2_omc/images/customer.gif b/wxc2_omc/images/customer.gif new file mode 100755 index 0000000..5dcfe84 Binary files /dev/null and b/wxc2_omc/images/customer.gif differ diff --git a/wxc2_omc/images/cyan.GIF b/wxc2_omc/images/cyan.GIF new file mode 100755 index 0000000..1a3d2bc Binary files /dev/null and b/wxc2_omc/images/cyan.GIF differ diff --git a/wxc2_omc/images/dark_blue.GIF b/wxc2_omc/images/dark_blue.GIF new file mode 100755 index 0000000..530e919 Binary files /dev/null and b/wxc2_omc/images/dark_blue.GIF differ diff --git a/wxc2_omc/images/datefolder.gif b/wxc2_omc/images/datefolder.gif new file mode 100755 index 0000000..a33ed0f Binary files /dev/null and b/wxc2_omc/images/datefolder.gif differ diff --git a/wxc2_omc/images/delete.gif b/wxc2_omc/images/delete.gif new file mode 100755 index 0000000..3d5b9e2 Binary files /dev/null and b/wxc2_omc/images/delete.gif differ diff --git a/wxc2_omc/images/device2switch.gif b/wxc2_omc/images/device2switch.gif new file mode 100755 index 0000000..e6c7143 Binary files /dev/null and b/wxc2_omc/images/device2switch.gif differ diff --git a/wxc2_omc/images/dialing.gif b/wxc2_omc/images/dialing.gif new file mode 100755 index 0000000..0ba1d1f Binary files /dev/null and b/wxc2_omc/images/dialing.gif differ diff --git a/wxc2_omc/images/down.gif b/wxc2_omc/images/down.gif new file mode 100755 index 0000000..b969030 Binary files /dev/null and b/wxc2_omc/images/down.gif differ diff --git a/wxc2_omc/images/email.gif b/wxc2_omc/images/email.gif new file mode 100755 index 0000000..6291714 Binary files /dev/null and b/wxc2_omc/images/email.gif differ diff --git a/wxc2_omc/images/english.gif b/wxc2_omc/images/english.gif new file mode 100755 index 0000000..39d49f2 Binary files /dev/null and b/wxc2_omc/images/english.gif differ diff --git a/wxc2_omc/images/exit.gif b/wxc2_omc/images/exit.gif new file mode 100755 index 0000000..403e26f Binary files /dev/null and b/wxc2_omc/images/exit.gif differ diff --git a/wxc2_omc/images/flash.gif b/wxc2_omc/images/flash.gif new file mode 100755 index 0000000..1b4a124 Binary files /dev/null and b/wxc2_omc/images/flash.gif differ diff --git a/wxc2_omc/images/flow_c.gif b/wxc2_omc/images/flow_c.gif new file mode 100755 index 0000000..5b2d97c Binary files /dev/null and b/wxc2_omc/images/flow_c.gif differ diff --git a/wxc2_omc/images/flow_e.gif b/wxc2_omc/images/flow_e.gif new file mode 100755 index 0000000..9b16aeb Binary files /dev/null and b/wxc2_omc/images/flow_e.gif differ diff --git a/wxc2_omc/images/gogogo.gif b/wxc2_omc/images/gogogo.gif new file mode 100755 index 0000000..3d326f9 Binary files /dev/null and b/wxc2_omc/images/gogogo.gif differ diff --git a/wxc2_omc/images/green.GIF b/wxc2_omc/images/green.GIF new file mode 100755 index 0000000..0c48180 Binary files /dev/null and b/wxc2_omc/images/green.GIF differ diff --git a/wxc2_omc/images/held.gif b/wxc2_omc/images/held.gif new file mode 100755 index 0000000..d396195 Binary files /dev/null and b/wxc2_omc/images/held.gif differ diff --git a/wxc2_omc/images/help.gif b/wxc2_omc/images/help.gif new file mode 100755 index 0000000..af364b7 Binary files /dev/null and b/wxc2_omc/images/help.gif differ diff --git a/wxc2_omc/images/home1.gif b/wxc2_omc/images/home1.gif new file mode 100755 index 0000000..1649193 Binary files /dev/null and b/wxc2_omc/images/home1.gif differ diff --git a/wxc2_omc/images/hook_on.gif b/wxc2_omc/images/hook_on.gif new file mode 100755 index 0000000..70e1e14 Binary files /dev/null and b/wxc2_omc/images/hook_on.gif differ diff --git a/wxc2_omc/images/icon_black.gif b/wxc2_omc/images/icon_black.gif new file mode 100755 index 0000000..7c24478 Binary files /dev/null and b/wxc2_omc/images/icon_black.gif differ diff --git a/wxc2_omc/images/icon_blue.gif b/wxc2_omc/images/icon_blue.gif new file mode 100755 index 0000000..f1a38a0 Binary files /dev/null and b/wxc2_omc/images/icon_blue.gif differ diff --git a/wxc2_omc/images/icon_brown.gif b/wxc2_omc/images/icon_brown.gif new file mode 100755 index 0000000..dae12a7 Binary files /dev/null and b/wxc2_omc/images/icon_brown.gif differ diff --git a/wxc2_omc/images/icon_green.gif b/wxc2_omc/images/icon_green.gif new file mode 100755 index 0000000..e235d02 Binary files /dev/null and b/wxc2_omc/images/icon_green.gif differ diff --git a/wxc2_omc/images/icon_light_blue.gif b/wxc2_omc/images/icon_light_blue.gif new file mode 100755 index 0000000..fe8fd8e Binary files /dev/null and b/wxc2_omc/images/icon_light_blue.gif differ diff --git a/wxc2_omc/images/icon_orange.gif b/wxc2_omc/images/icon_orange.gif new file mode 100755 index 0000000..bbbbe64 Binary files /dev/null and b/wxc2_omc/images/icon_orange.gif differ diff --git a/wxc2_omc/images/icon_red.gif b/wxc2_omc/images/icon_red.gif new file mode 100755 index 0000000..936648b Binary files /dev/null and b/wxc2_omc/images/icon_red.gif differ diff --git a/wxc2_omc/images/icon_yellow.gif b/wxc2_omc/images/icon_yellow.gif new file mode 100755 index 0000000..4be0909 Binary files /dev/null and b/wxc2_omc/images/icon_yellow.gif differ diff --git a/wxc2_omc/images/idle.gif b/wxc2_omc/images/idle.gif new file mode 100755 index 0000000..70e1e14 Binary files /dev/null and b/wxc2_omc/images/idle.gif differ diff --git a/wxc2_omc/images/import_1.gif b/wxc2_omc/images/import_1.gif new file mode 100755 index 0000000..c529220 Binary files /dev/null and b/wxc2_omc/images/import_1.gif differ diff --git a/wxc2_omc/images/in_use.gif b/wxc2_omc/images/in_use.gif new file mode 100755 index 0000000..0ba1d1f Binary files /dev/null and b/wxc2_omc/images/in_use.gif differ diff --git a/wxc2_omc/images/iwv_logo(250x56).gif b/wxc2_omc/images/iwv_logo(250x56).gif new file mode 100755 index 0000000..b786e90 Binary files /dev/null and b/wxc2_omc/images/iwv_logo(250x56).gif differ diff --git a/wxc2_omc/images/iwv_logo.gif b/wxc2_omc/images/iwv_logo.gif new file mode 100755 index 0000000..5546ffd Binary files /dev/null and b/wxc2_omc/images/iwv_logo.gif differ diff --git a/wxc2_omc/images/lastblk.gif b/wxc2_omc/images/lastblk.gif new file mode 100755 index 0000000..c533260 Binary files /dev/null and b/wxc2_omc/images/lastblk.gif differ diff --git a/wxc2_omc/images/ldmsapp.gif b/wxc2_omc/images/ldmsapp.gif new file mode 100755 index 0000000..f5ba10f Binary files /dev/null and b/wxc2_omc/images/ldmsapp.gif differ diff --git a/wxc2_omc/images/leaf.gif b/wxc2_omc/images/leaf.gif new file mode 100755 index 0000000..cb3b1c3 Binary files /dev/null and b/wxc2_omc/images/leaf.gif differ diff --git a/wxc2_omc/images/left.gif b/wxc2_omc/images/left.gif new file mode 100755 index 0000000..b36d83a Binary files /dev/null and b/wxc2_omc/images/left.gif differ diff --git a/wxc2_omc/images/left_1.gif b/wxc2_omc/images/left_1.gif new file mode 100755 index 0000000..1c3d42d Binary files /dev/null and b/wxc2_omc/images/left_1.gif differ diff --git a/wxc2_omc/images/legend_blue.GIF b/wxc2_omc/images/legend_blue.GIF new file mode 100755 index 0000000..f42c7ea Binary files /dev/null and b/wxc2_omc/images/legend_blue.GIF differ diff --git a/wxc2_omc/images/legend_cyan.GIF b/wxc2_omc/images/legend_cyan.GIF new file mode 100755 index 0000000..329296c Binary files /dev/null and b/wxc2_omc/images/legend_cyan.GIF differ diff --git a/wxc2_omc/images/legend_dark_blue.GIF b/wxc2_omc/images/legend_dark_blue.GIF new file mode 100755 index 0000000..6b9472d Binary files /dev/null and b/wxc2_omc/images/legend_dark_blue.GIF differ diff --git a/wxc2_omc/images/legend_simple_blue.GIF b/wxc2_omc/images/legend_simple_blue.GIF new file mode 100755 index 0000000..ee6a33a Binary files /dev/null and b/wxc2_omc/images/legend_simple_blue.GIF differ diff --git a/wxc2_omc/images/lgc_125.gif b/wxc2_omc/images/lgc_125.gif new file mode 100755 index 0000000..85e7b3b Binary files /dev/null and b/wxc2_omc/images/lgc_125.gif differ diff --git a/wxc2_omc/images/lgc_300.gif b/wxc2_omc/images/lgc_300.gif new file mode 100755 index 0000000..7981fce Binary files /dev/null and b/wxc2_omc/images/lgc_300.gif differ diff --git a/wxc2_omc/images/lightblue_blink.gif b/wxc2_omc/images/lightblue_blink.gif new file mode 100755 index 0000000..dc90161 Binary files /dev/null and b/wxc2_omc/images/lightblue_blink.gif differ diff --git a/wxc2_omc/images/lightblue_gray.gif b/wxc2_omc/images/lightblue_gray.gif new file mode 100755 index 0000000..5883d25 Binary files /dev/null and b/wxc2_omc/images/lightblue_gray.gif differ diff --git a/wxc2_omc/images/line.gif b/wxc2_omc/images/line.gif new file mode 100755 index 0000000..85ada3d Binary files /dev/null and b/wxc2_omc/images/line.gif differ diff --git a/wxc2_omc/images/list.gif b/wxc2_omc/images/list.gif new file mode 100755 index 0000000..90b3555 Binary files /dev/null and b/wxc2_omc/images/list.gif differ diff --git a/wxc2_omc/images/lock.gif b/wxc2_omc/images/lock.gif new file mode 100755 index 0000000..1a166c3 Binary files /dev/null and b/wxc2_omc/images/lock.gif differ diff --git a/wxc2_omc/images/loginPwd.gif b/wxc2_omc/images/loginPwd.gif new file mode 100755 index 0000000..347a33c Binary files /dev/null and b/wxc2_omc/images/loginPwd.gif differ diff --git a/wxc2_omc/images/loginUser.gif b/wxc2_omc/images/loginUser.gif new file mode 100755 index 0000000..fe000bb Binary files /dev/null and b/wxc2_omc/images/loginUser.gif differ diff --git a/wxc2_omc/images/logout.gif b/wxc2_omc/images/logout.gif new file mode 100755 index 0000000..4277f00 Binary files /dev/null and b/wxc2_omc/images/logout.gif differ diff --git a/wxc2_omc/images/main_top_L.gif b/wxc2_omc/images/main_top_L.gif new file mode 100755 index 0000000..2de04ae Binary files /dev/null and b/wxc2_omc/images/main_top_L.gif differ diff --git a/wxc2_omc/images/main_top_R.gif b/wxc2_omc/images/main_top_R.gif new file mode 100755 index 0000000..22c8805 Binary files /dev/null and b/wxc2_omc/images/main_top_R.gif differ diff --git a/wxc2_omc/images/menu_back1.gif b/wxc2_omc/images/menu_back1.gif new file mode 100755 index 0000000..4873716 Binary files /dev/null and b/wxc2_omc/images/menu_back1.gif differ diff --git a/wxc2_omc/images/menu_back1_bak.gif b/wxc2_omc/images/menu_back1_bak.gif new file mode 100755 index 0000000..02b27bb Binary files /dev/null and b/wxc2_omc/images/menu_back1_bak.gif differ diff --git a/wxc2_omc/images/menu_back2.gif b/wxc2_omc/images/menu_back2.gif new file mode 100755 index 0000000..ced5b9b Binary files /dev/null and b/wxc2_omc/images/menu_back2.gif differ diff --git a/wxc2_omc/images/menu_file.gif b/wxc2_omc/images/menu_file.gif new file mode 100755 index 0000000..0ad9f2e Binary files /dev/null and b/wxc2_omc/images/menu_file.gif differ diff --git a/wxc2_omc/images/menu_file2.gif b/wxc2_omc/images/menu_file2.gif new file mode 100755 index 0000000..9e0feb4 Binary files /dev/null and b/wxc2_omc/images/menu_file2.gif differ diff --git a/wxc2_omc/images/menu_file3.gif b/wxc2_omc/images/menu_file3.gif new file mode 100755 index 0000000..9071927 Binary files /dev/null and b/wxc2_omc/images/menu_file3.gif differ diff --git a/wxc2_omc/images/midblk.gif b/wxc2_omc/images/midblk.gif new file mode 100755 index 0000000..2716bb3 Binary files /dev/null and b/wxc2_omc/images/midblk.gif differ diff --git a/wxc2_omc/images/midminus.gif b/wxc2_omc/images/midminus.gif new file mode 100755 index 0000000..9546945 Binary files /dev/null and b/wxc2_omc/images/midminus.gif differ diff --git a/wxc2_omc/images/midplus.gif b/wxc2_omc/images/midplus.gif new file mode 100755 index 0000000..57afafb Binary files /dev/null and b/wxc2_omc/images/midplus.gif differ diff --git a/wxc2_omc/images/network_adm.gif b/wxc2_omc/images/network_adm.gif new file mode 100755 index 0000000..9ee388c Binary files /dev/null and b/wxc2_omc/images/network_adm.gif differ diff --git a/wxc2_omc/images/new_weblinks.gif b/wxc2_omc/images/new_weblinks.gif new file mode 100755 index 0000000..73769d1 Binary files /dev/null and b/wxc2_omc/images/new_weblinks.gif differ diff --git a/wxc2_omc/images/nextPage.gif b/wxc2_omc/images/nextPage.gif new file mode 100755 index 0000000..c1ae2c5 Binary files /dev/null and b/wxc2_omc/images/nextPage.gif differ diff --git a/wxc2_omc/images/next_page.gif b/wxc2_omc/images/next_page.gif new file mode 100755 index 0000000..030a89c Binary files /dev/null and b/wxc2_omc/images/next_page.gif differ diff --git a/wxc2_omc/images/not_in_use.gif b/wxc2_omc/images/not_in_use.gif new file mode 100755 index 0000000..5776a9e Binary files /dev/null and b/wxc2_omc/images/not_in_use.gif differ diff --git a/wxc2_omc/images/omc.gif b/wxc2_omc/images/omc.gif new file mode 100755 index 0000000..e8529cc Binary files /dev/null and b/wxc2_omc/images/omc.gif differ diff --git a/wxc2_omc/images/omc.gif.bak b/wxc2_omc/images/omc.gif.bak new file mode 100755 index 0000000..71f132d Binary files /dev/null and b/wxc2_omc/images/omc.gif.bak differ diff --git a/wxc2_omc/images/omc_small.gif b/wxc2_omc/images/omc_small.gif new file mode 100755 index 0000000..6e11bd3 Binary files /dev/null and b/wxc2_omc/images/omc_small.gif differ diff --git a/wxc2_omc/images/omc_small.gif.bak b/wxc2_omc/images/omc_small.gif.bak new file mode 100755 index 0000000..a2611a3 Binary files /dev/null and b/wxc2_omc/images/omc_small.gif.bak differ diff --git a/wxc2_omc/images/open.gif b/wxc2_omc/images/open.gif new file mode 100755 index 0000000..2f23114 Binary files /dev/null and b/wxc2_omc/images/open.gif differ diff --git a/wxc2_omc/images/oper_manage.gif b/wxc2_omc/images/oper_manage.gif new file mode 100755 index 0000000..10083f3 Binary files /dev/null and b/wxc2_omc/images/oper_manage.gif differ diff --git a/wxc2_omc/images/orange_blink.gif b/wxc2_omc/images/orange_blink.gif new file mode 100755 index 0000000..12cfc55 Binary files /dev/null and b/wxc2_omc/images/orange_blink.gif differ diff --git a/wxc2_omc/images/orange_gray.gif b/wxc2_omc/images/orange_gray.gif new file mode 100755 index 0000000..3fdc09f Binary files /dev/null and b/wxc2_omc/images/orange_gray.gif differ diff --git a/wxc2_omc/images/page.gif b/wxc2_omc/images/page.gif new file mode 100755 index 0000000..29fce60 Binary files /dev/null and b/wxc2_omc/images/page.gif differ diff --git a/wxc2_omc/images/parameter.gif b/wxc2_omc/images/parameter.gif new file mode 100755 index 0000000..c8fe980 Binary files /dev/null and b/wxc2_omc/images/parameter.gif differ diff --git a/wxc2_omc/images/prePage.gif b/wxc2_omc/images/prePage.gif new file mode 100755 index 0000000..c5aa34f Binary files /dev/null and b/wxc2_omc/images/prePage.gif differ diff --git a/wxc2_omc/images/pre_page.gif b/wxc2_omc/images/pre_page.gif new file mode 100755 index 0000000..f628c49 Binary files /dev/null and b/wxc2_omc/images/pre_page.gif differ diff --git a/wxc2_omc/images/prepire.gif b/wxc2_omc/images/prepire.gif new file mode 100755 index 0000000..cccd034 Binary files /dev/null and b/wxc2_omc/images/prepire.gif differ diff --git a/wxc2_omc/images/previous.jpg b/wxc2_omc/images/previous.jpg new file mode 100755 index 0000000..28c6142 Binary files /dev/null and b/wxc2_omc/images/previous.jpg differ diff --git a/wxc2_omc/images/printer.gif b/wxc2_omc/images/printer.gif new file mode 100755 index 0000000..68b3f57 Binary files /dev/null and b/wxc2_omc/images/printer.gif differ diff --git a/wxc2_omc/images/rate_manage.gif b/wxc2_omc/images/rate_manage.gif new file mode 100755 index 0000000..5eb15a0 Binary files /dev/null and b/wxc2_omc/images/rate_manage.gif differ diff --git a/wxc2_omc/images/red_blink.gif b/wxc2_omc/images/red_blink.gif new file mode 100755 index 0000000..cd0c3e4 Binary files /dev/null and b/wxc2_omc/images/red_blink.gif differ diff --git a/wxc2_omc/images/red_gray.gif b/wxc2_omc/images/red_gray.gif new file mode 100755 index 0000000..4696af1 Binary files /dev/null and b/wxc2_omc/images/red_gray.gif differ diff --git a/wxc2_omc/images/reload.gif b/wxc2_omc/images/reload.gif new file mode 100755 index 0000000..97767a2 Binary files /dev/null and b/wxc2_omc/images/reload.gif differ diff --git a/wxc2_omc/images/reset.gif b/wxc2_omc/images/reset.gif new file mode 100755 index 0000000..97767a2 Binary files /dev/null and b/wxc2_omc/images/reset.gif differ diff --git a/wxc2_omc/images/rick.gif b/wxc2_omc/images/rick.gif new file mode 100755 index 0000000..39d5f06 Binary files /dev/null and b/wxc2_omc/images/rick.gif differ diff --git a/wxc2_omc/images/right.gif b/wxc2_omc/images/right.gif new file mode 100755 index 0000000..a56db11 Binary files /dev/null and b/wxc2_omc/images/right.gif differ diff --git a/wxc2_omc/images/right_1.gif b/wxc2_omc/images/right_1.gif new file mode 100755 index 0000000..3bd72dc Binary files /dev/null and b/wxc2_omc/images/right_1.gif differ diff --git a/wxc2_omc/images/ringing.gif b/wxc2_omc/images/ringing.gif new file mode 100755 index 0000000..6042f2f Binary files /dev/null and b/wxc2_omc/images/ringing.gif differ diff --git a/wxc2_omc/images/save.gif b/wxc2_omc/images/save.gif new file mode 100755 index 0000000..28f66e2 Binary files /dev/null and b/wxc2_omc/images/save.gif differ diff --git a/wxc2_omc/images/search.gif b/wxc2_omc/images/search.gif new file mode 100755 index 0000000..b0f1750 Binary files /dev/null and b/wxc2_omc/images/search.gif differ diff --git a/wxc2_omc/images/server.gif b/wxc2_omc/images/server.gif new file mode 100755 index 0000000..6fc69ec Binary files /dev/null and b/wxc2_omc/images/server.gif differ diff --git a/wxc2_omc/images/server.gif.bak b/wxc2_omc/images/server.gif.bak new file mode 100755 index 0000000..1eab1f3 Binary files /dev/null and b/wxc2_omc/images/server.gif.bak differ diff --git a/wxc2_omc/images/server_small.gif b/wxc2_omc/images/server_small.gif new file mode 100755 index 0000000..cdccece Binary files /dev/null and b/wxc2_omc/images/server_small.gif differ diff --git a/wxc2_omc/images/server_small.gif.bak b/wxc2_omc/images/server_small.gif.bak new file mode 100755 index 0000000..2c3ad6a Binary files /dev/null and b/wxc2_omc/images/server_small.gif.bak differ diff --git a/wxc2_omc/images/set_template.gif b/wxc2_omc/images/set_template.gif new file mode 100755 index 0000000..a052974 Binary files /dev/null and b/wxc2_omc/images/set_template.gif differ diff --git a/wxc2_omc/images/simple_blue.GIF b/wxc2_omc/images/simple_blue.GIF new file mode 100755 index 0000000..896cfaa Binary files /dev/null and b/wxc2_omc/images/simple_blue.GIF differ diff --git a/wxc2_omc/images/stats.gif b/wxc2_omc/images/stats.gif new file mode 100755 index 0000000..1ca13e8 Binary files /dev/null and b/wxc2_omc/images/stats.gif differ diff --git a/wxc2_omc/images/switch_keep.gif b/wxc2_omc/images/switch_keep.gif new file mode 100755 index 0000000..17f0a27 Binary files /dev/null and b/wxc2_omc/images/switch_keep.gif differ diff --git a/wxc2_omc/images/sys_close.gif b/wxc2_omc/images/sys_close.gif new file mode 100755 index 0000000..a33ed0f Binary files /dev/null and b/wxc2_omc/images/sys_close.gif differ diff --git a/wxc2_omc/images/sys_status.gif b/wxc2_omc/images/sys_status.gif new file mode 100755 index 0000000..a312b80 Binary files /dev/null and b/wxc2_omc/images/sys_status.gif differ diff --git a/wxc2_omc/images/system_logo.gif b/wxc2_omc/images/system_logo.gif new file mode 100755 index 0000000..ec918ea Binary files /dev/null and b/wxc2_omc/images/system_logo.gif differ diff --git a/wxc2_omc/images/temp2device.gif b/wxc2_omc/images/temp2device.gif new file mode 100755 index 0000000..c907eb0 Binary files /dev/null and b/wxc2_omc/images/temp2device.gif differ diff --git a/wxc2_omc/images/title_sitemap.gif b/wxc2_omc/images/title_sitemap.gif new file mode 100755 index 0000000..792e28d Binary files /dev/null and b/wxc2_omc/images/title_sitemap.gif differ diff --git a/wxc2_omc/images/top_back1.gif b/wxc2_omc/images/top_back1.gif new file mode 100755 index 0000000..bacb20f Binary files /dev/null and b/wxc2_omc/images/top_back1.gif differ diff --git a/wxc2_omc/images/top_back2.gif b/wxc2_omc/images/top_back2.gif new file mode 100755 index 0000000..75b3fc6 Binary files /dev/null and b/wxc2_omc/images/top_back2.gif differ diff --git a/wxc2_omc/images/top_back3.gif b/wxc2_omc/images/top_back3.gif new file mode 100755 index 0000000..02daecc Binary files /dev/null and b/wxc2_omc/images/top_back3.gif differ diff --git a/wxc2_omc/images/tree.gif b/wxc2_omc/images/tree.gif new file mode 100755 index 0000000..ec65157 Binary files /dev/null and b/wxc2_omc/images/tree.gif differ diff --git a/wxc2_omc/images/ts_node.gif b/wxc2_omc/images/ts_node.gif new file mode 100755 index 0000000..9802cc6 Binary files /dev/null and b/wxc2_omc/images/ts_node.gif differ diff --git a/wxc2_omc/images/unknown_file.gif b/wxc2_omc/images/unknown_file.gif new file mode 100755 index 0000000..73676b7 Binary files /dev/null and b/wxc2_omc/images/unknown_file.gif differ diff --git a/wxc2_omc/images/up.gif b/wxc2_omc/images/up.gif new file mode 100755 index 0000000..5174afd Binary files /dev/null and b/wxc2_omc/images/up.gif differ diff --git a/wxc2_omc/images/user_manage.gif b/wxc2_omc/images/user_manage.gif new file mode 100755 index 0000000..3a9024f Binary files /dev/null and b/wxc2_omc/images/user_manage.gif differ diff --git a/wxc2_omc/images/user_mange.gif b/wxc2_omc/images/user_mange.gif new file mode 100755 index 0000000..3f74a7b Binary files /dev/null and b/wxc2_omc/images/user_mange.gif differ diff --git a/wxc2_omc/images/white.GIF b/wxc2_omc/images/white.GIF new file mode 100755 index 0000000..d3b86a7 Binary files /dev/null and b/wxc2_omc/images/white.GIF differ diff --git a/wxc2_omc/images/write.gif b/wxc2_omc/images/write.gif new file mode 100755 index 0000000..b731e9a Binary files /dev/null and b/wxc2_omc/images/write.gif differ diff --git a/wxc2_omc/images/yellow_blink.gif b/wxc2_omc/images/yellow_blink.gif new file mode 100755 index 0000000..604f68e Binary files /dev/null and b/wxc2_omc/images/yellow_blink.gif differ diff --git a/wxc2_omc/images/yellow_gray.gif b/wxc2_omc/images/yellow_gray.gif new file mode 100755 index 0000000..6e63788 Binary files /dev/null and b/wxc2_omc/images/yellow_gray.gif differ diff --git a/wxc2_omc/images/zip.gif b/wxc2_omc/images/zip.gif new file mode 100755 index 0000000..c7fd320 Binary files /dev/null and b/wxc2_omc/images/zip.gif differ diff --git a/wxc2_omc/images/zip_file.gif b/wxc2_omc/images/zip_file.gif new file mode 100755 index 0000000..c7fd320 Binary files /dev/null and b/wxc2_omc/images/zip_file.gif differ diff --git a/wxc2_omc/inc/D2H2B.inc b/wxc2_omc/inc/D2H2B.inc new file mode 100755 index 0000000..df91ce3 --- /dev/null +++ b/wxc2_omc/inc/D2H2B.inc @@ -0,0 +1,319 @@ + +
      + + + + + + + + + + + + + + + +
        
      + +
      + + +
      +$strRemarks : $strCalculatorRemarks";?> +
      +
      + + + diff --git a/wxc2_omc/inc/chinese_gb.inc b/wxc2_omc/inc/chinese_gb.inc new file mode 100755 index 0000000..e59375f --- /dev/null +++ b/wxc2_omc/inc/chinese_gb.inc @@ -0,0 +1,477 @@ + "; +$strCurrentTariff ="当前费率"; +$strRent ="租金"; +$strTariffRentID ="对象"; +$strTariffRentChargeDate ="充值时间"; +$strTariffRentChargeAmount ="充值金额"; +$strTariffRentCapFlag ="Cap Flag"; +$strGet ="Get"; +$strSet ="Set"; +$strCompare ="比较"; +$strLoad ="Load"; +$strSave ="保存"; +$strLock ="锁定"; +$strUnlock ="解锁"; +$strDailingPrefix ="字头"; +$strTrunkGroup ="局向"; +$strCell ="小区"; +$strClockReference ="时钟模块"; +$strParameter ="参数"; +$strBHCA ="话务统计"; +$strData ="数据"; +$strFlow ="流量统计"; +$strAnalysis ="分析"; +$strTitlePerformance ="话务统计"; +$strTariffPlan ="费率计划"; +$strBasicTariff ="基本费率"; +$strHoliday ="节假日"; +$strMultiServices ="其它业务"; +$strPlanManage ="计划管理"; +$strMessageLength ="拆分包长"; +$strConfiguration ="系统配置"; + +//added by xiehua +$strTitleConfiguration ="系统配置"; +$strTitleAccount ="账户信息"; +$strTitlePerformance ="话务统计"; +$strSubscriberManage ="客户管理"; +$strRefreshCard ="充值卡"; +$strSubscriber ="用户"; +$strLog ="日志"; +$strMaintenance ="系统维护"; +$strLink ="链路"; +$strNetwork ="网络"; +$strBackupRestore ="数据备份和恢复"; +$strDualServerMode ="双机模式"; +$strCharge ="金额"; +$strAdvanced ="高级"; +$strPerformance ="性能"; +$strGetAll ="Get All"; + +//added by Cui Ticun +$strDiscountID ="折扣号"; +$strFreeChargeUnit ="免费计时单位"; +$strFav_call ="亲情呼叫"; +$strFav_listedtion ="亲情表编辑"; +$strUndo ="取消"; +$strLinkset ="链路组"; +$strLink ="链路"; +$strLocalNode ="本地服务地址"; +$strNetworkCode ="网络基本设定"; +$strMtTariff ="被叫费率"; +$strSMContent ="短信内容"; +$strPriority ="优先级"; +$strTimeToLive ="有效时间"; +$strSent ="发送成功"; +$strDiscarded ="丢弃"; +$strPending ="待发"; +$strCaller ="主叫号码"; +$strCalled ="被叫号码"; +$strUpdate ="刷新时间"; +$strLastAttempt ="最后试发"; + +$strGttObjects ="GTT Objects"; + +//add by Jianhui Zheng +$strE164Number="E164 号码"; +$strUndo="撤消"; +$strModule="模块"; +$strVMSOrVSS="VSS"; +$strSMSEG="SMEG"; + +/***********************错误和提示定义***************************/ +$STR_CONF_COMMAND_ERR_0000 ="命令操作成功"; + +//ERR_001*:should prompt the operator "Check the device's status" +$STR_CONF_PROMPT_001 ="请检查设备状态"; +$STR_CONF_COMMAND_ERR_0011 ="OMC找不到设备IP"; +$STR_CONF_COMMAND_ERR_0012 ="设备IP错误"; + +//ERR_002*:should prompt the operator "Check the software version of OMC and device" +$STR_CONF_PROMPT_002 ="检查OMC和设备的软件版本是否相符"; +$STR_CONF_COMMAND_ERR_0021 ="OMC找不到相应的目标的值"; +$STR_CONF_COMMAND_ERR_0022 ="OMC找不到相应的序列好的值"; + +//ERR_003*:should prompt the operator "Check the OMC's status or send command again" +$STR_CONF_PROMPT_003 ="检查OMC状态或重发命令"; +$STR_CONF_COMMAND_ERR_0031 ="OMC发送SNMP消息错误"; +$STR_CONF_COMMAND_ERR_0032 ="OMC命令缓存已满"; +$STR_CONF_COMMAND_ERR_0033 ="OMC发送命令太慢,或者没有发送命令"; + +//ERR_004*:should prompt the operator "Check the device's status or send command again" +$STR_CONF_PROMPT_004 ="检查设备的状态或重发命令.发送命令前,确保OMC和对端服务器在线"; +$STR_CONF_COMMAND_ERR_0041 ="回应消息无效"; +$STR_CONF_COMMAND_ERR_0042 ="回应消息错误"; +$STR_CONF_COMMAND_ERR_0043 ="回应超时"; + +$STR_CONF_COMMAND_ERR_9999 ="未定义错误"; +$strPleaseInputIndexNo ="请输入Index"; +$indexNoDefinedBy ="Index is defined by"; + +?> \ No newline at end of file diff --git a/wxc2_omc/inc/config.inc b/wxc2_omc/inc/config.inc new file mode 100755 index 0000000..17684d3 --- /dev/null +++ b/wxc2_omc/inc/config.inc @@ -0,0 +1,349 @@ + '0', 'name' => 'WXC2 OMC', 'path' => 'wxc2_omc'), + array('typeNo' => '1', 'name' => 'GMSC OMC', 'path' => 'gmsc_omc'), + array('typeNo' => '2', 'name' => 'MSC OMC', 'path' => 'msc_omc'), + array('typeNo' => '3', 'name' => 'HLR OMC', 'path' => 'hlr_omc'), + array('typeNo' => '4', 'name' => 'AUC OMC', 'path' => 'auc_omc'), + array('typeNo' => '5', 'name' => 'PPS OMC', 'path' => 'pps_omc'), + array('typeNo' => '6', 'name' => 'SMSC OMC', 'path' => 'smsc_omc'), + array('typeNo' => '7', 'name' => 'BSS OMC', 'path' => 'bss_omc'), + array('typeNo' => '8', 'name' => 'EIR OMC', 'path' => 'eir_omc'), + array('typeNo' => '9', 'name' => 'HBSC OMC', 'path' => 'hbsc_omc'), + array('typeNo' => '10', 'name' => 'SN OMC', 'path' => 'sn_omc'), +); +//echo "cofnig $PHP_SELF"; +$PHP_SELF = $_SERVER['PHP_SELF']; +$DEBUG=0; + +if(isset($selectedOmcPath) && strlen($selectedOmcPath) > 0){ + $thisOmcPath=$selectedOmcPath; +}else{ + $PHP_SELF = $_SERVER['PHP_SELF']; + $pathArr=explode('/',$PHP_SELF); + $thisOmcPath=$pathArr[1]; +} + + +for ($ii = 0; $ii < sizeof($omcTypeArr); $ii++) { + //echo "
      if($thisOmcPath == {$omcTypeArr[$ii][path]})"; + if ($thisOmcPath == $omcTypeArr[$ii]['path']) { + $thisOmcType = $omcTypeArr[$ii]['typeNo']; + break; + } +} + + +//===============================OMC说明变量============================================================== +$COMPANY_NAME = "InterWave"; +$COMPANY_WEBSITE = "www.iwv.com"; +$COMPANY_E_MAIL = "Help@iwv.com"; + +$SYSTEM_VERSION = $omcTypeArr[$thisOmcType]['name'] . "
      R3V3_09"; +$SYSTEM_VERSION_ISSUE_DATE = "2002-11-19"; + +$OMC_NAME = $omcTypeArr[$thisOmcType]['name']; +$OMC_VERSION = "R6V5_10"; +$OMC_VERSION_ISSUE_DATE = "2002-10-21"; + +$WELCOME_WORDS = "WELCOME TO $OMC_NAME"; +$COPY_RIGHT_WORDS = "Copyright 2001-2002 iwv.com All rights reserved."; + + +//==============================各OMC的URL================================================================= +$host_ip = getenv("HTTP_HOST"); +//echo "
      host_ip=$host_ip"; + +global $userInfo; + +//用户选择的语言类型 +if ($userInfo['language'] == 'chn') { + require("../../inc/chinese_gb.inc"); + $USER_GUIDE_DIR = "../../../guide/index_cn.htm"; + $language = 'chn'; + $language_type = 1; +//}elseif ($language == 'eng'){ +} else { + require("../../inc/english.inc"); + $USER_GUIDE_DIR = "../../../guide/index_en.htm"; + $language = 'eng'; + $language_type = 0; +} + +//=============================数据下载设置============================================================== +$load_sys_type = 0;//与HLR有关的CSV数据模版类型(msc-->0/hlr-->1/pps-->2); + +//=============================数据库设置================================================================= +//---------------服务器设置----------------- +//OMC-0 + +$handle = fopen("../../inc/mysqlpw.inc", "r"); +$mysqluser = str_rot13(trim(fgets($handle))); +$mysqlpw = str_rot13(trim(fgets($handle))); +fclose($handle); + + +$OMC_server[0]['host'] = 'localhost'; // MySQL hostname,如果该主机名无法被解释,将出现无法打开页面的情况!! +$OMC_server[0]['user'] = $mysqluser; // MySQL user (only needed with basic auth) +$OMC_server[0]['password'] = $mysqlpw; // MySQL password (only needed with basic auth) +//$OMC_server[0]['user'] = 'root'; // MySQL user (only needed with basic auth) +//$OMC_server[0]['password'] = 'root'; // MySQL password (only needed with basic auth) +$OMC_server[0]['port'] = ''; // MySQL port - leave blank for default port +$OMC_server[0]['adv_auth'] = false; // Use advanced authentication? +$OMC_server[0]['adv_user'] = ''; // MySQL standard user (only needed with advanced auth) +$OMC_server[0]['adv_pass'] = ''; // MySQL standard password (only needed with advanced auth) +$OMC_server[0]['only_db'] = ''; // If set to a db-name, only this db is accessible +$OMC_server[0]['verbose'] = 'master server'; // Verbose name for this host - leave blank to show the hostname + +//OMC-1 +$OMC_server[1]['host'] = 'omc-1'; +$OMC_server[1]['user'] = $mysqluser; +$OMC_server[1]['password'] = $mysqlpw; +$OMC_server[1]['port'] = ''; +$OMC_server[1]['adv_auth'] = false; +$OMC_server[1]['adv_user'] = ''; +$OMC_server[1]['adv_pass'] = ''; +$OMC_server[1]['only_db'] = ''; +$OMC_server[1]['verbose'] = 'second server'; + +//数据库连接 +//$link[0] = mysql_pconnect($OMC_server[0]['host'], $OMC_server[0]['user'], $OMC_server[0]['password']); +//if (!$link[0]) {//可惜在该主机名无法被解释的条件下,这段程序无法执行 +// echo "Connect databese error!! please check the server name or the user_id and password"; +// exit(); +//} +$pubConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OMC_PUB"); +//$bssDbConn=mysqli_connect($$OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "BssOmcDb"); +@mysqli_query($pubConn, "set names 'gb2312'"); +@mysqli_query($pubConn, "set character_set_client=gb2312"); +@mysqli_query($pubConn, "set character_set_results=gb2312"); +//$link[1]=mysql_pconnect($OMC_server[1]['host'],$OMC_server[1]['user'],$OMC_server[1]['password']); + +//-----------数据库数据表设置------------------- +//数据库列表 +$omc_db = 'OMC_PUB'; //omc公用数据库 +$cdr_db = 'CDR_DB'; //存放各种话单资料 +$csta_db = 'CSTA_DB'; //存放话务统计数据 +$auc_para = 'AUC_Para'; //存放AUC数据 +$eir_para = 'EIR_Para'; //存放EIR数据 +$account_db = 'account_db'; +$bill_db = 'tariff_db'; +$hlr_db = 'hlr_db'; +$bss_db = 'BssOmcDb'; +$refresh_card_db = 'refresh_card'; +$parameter_db = 'parameter_db'; +$sysconf_table = 'sysConf'; //设备定义表,是设备信息的基础 +$paramConf_table = 'paramConf'; //参数定义表 +$alarmconf_table = 'sysAlarmConf'; //告警定义 +$sysStat_table = 'sysStat'; //状态信息表 +$sysoperlog_table = 'sysOperLog'; //日志表 +$sysoperconf_table = 'sysOperConf'; //日志类型定义表 +$syscsvconf_table = 'sysCsvConf'; //CSV模板定义 +$cstadefine_table = 'cstaDefine'; //csta配置 +$cdrdefine_table = 'cdrSource'; //cdr配置 + +//==============================平台类型定义================================================ +$PlatTypeDefArr=array( + array('num'=> '0', 'remark' => 'EMS', 'sysTypeNo' => '0', 'maxSysNum' => '2', 'platAgent' => '0'), + array('num'=> '1', 'remark' => 'GMSC', 'sysTypeNo' => '310', 'maxSysNum' => '2', 'platAgent' => '1'), + array('num'=> '2', 'remark' => 'MSC', 'sysTypeNo' => '320', 'maxSysNum' => '2', 'platAgent' => '2'), + array('num'=> '3', 'remark' => 'HSS', 'sysTypeNo' => '330', 'maxSysNum' => '2', 'platAgent' => '2'), + array('num'=> '4', 'remark' => 'AUC', 'sysTypeNo' => '340', 'maxSysNum' => '2', 'platAgent' => '4'), + array('num'=> '5', 'remark' => 'PPS', 'sysTypeNo' => '360', 'maxSysNum' => '2', 'platAgent' => '5'), + array('num'=> '6', 'remark' => 'SMSC', 'sysTypeNo' => '350', 'maxSysNum' => '2', 'platAgent' => '6'), + array('num'=> '7', 'remark' => 'EIR', 'sysTypeNo' => '380', 'maxSysNum' => '2', 'platAgent' => '4'), + array('num'=> '8', 'remark' => 'VSS', 'sysTypeNo' => '390', 'maxSysNum' => '10', 'platAgent' => '4'), + array('num'=> '9', 'remark' => 'MSS', 'sysTypeNo' => '388', 'maxSysNum' => '2', 'platAgent' => '4'), + array('num'=> '10', 'remark' => 'MNP', 'sysTypeNo' => '370', 'maxSysNum' => '2', 'platAgent' => '4'), + array('num'=> '11', 'remark' => 'AAS', 'sysTypeNo' => '311', 'maxSysNum' => '2', 'platAgent' => '2'), + array('num'=> '12', 'remark' => 'SMEG', 'sysTypeNo' => '355', 'maxSysNum' => '2', 'platAgent' => '1'), + array('num'=> '13', 'remark' => 'OPPS', 'sysTypeNo' => '375', 'maxSysNum' => '2', 'platAgent' => '2'), + array('num'=> '14', 'remark' => 'MRFC', 'sysTypeNo' => '385', 'maxSysNum' => '2', 'platAgent' => '2'), + array('num'=> '15', 'remark' => 'iPALIM', 'sysTypeNo' => '378', 'maxSysNum' => '2', 'platAgent' => '2'), + array('num'=> '16', 'remark' => 'iRLS', 'sysTypeNo' => '379', 'maxSysNum' => '2', 'platAgent' => '2'), + array('num'=> '17', 'remark' => 'MHC', 'sysTypeNo' => '386', 'maxSysNum' => '2', 'platAgent' => '2'), + array('num'=> '18', 'remark' => 'RCM', 'sysTypeNo' => '395', 'maxSysNum' => '2', 'platAgent' => '2'), +); +//==============================告警等级设定================================================ +$alarmLevelDefArr=array( + array('value' => '0', 'remark' => $strClearedAlarm, 'color' => '#0000FF'), + array('value' => '1', 'remark' => $strCriticalAlarm, 'color' => '#FF0000'), + array('value' => '2', 'remark' => $strMajorAlarm, 'color' => '#980030'), + array('value' => '3', 'remark' => $strMinorAlarm, 'color' => '#980030'), + array('value' => '4', 'remark' => $strWarningAlarm, 'color' => '#980030'), + //array(value => '5', remark => $strClearedAlarm, color => '#0000FF'), + +); + +//=============================系统配置参数================================== + +$separator = ','; //csv数据的字段分割符 +$heatbeat_overtime = 48; //heartbeat的超时设置。单位为秒。 + +/*被注释掉的变量定义将删除 + +$def_sys_param_sign = 99; //系统参数在参数表中用一个特殊的子系统编号,该编号不等于其他的子系统编号。 + +$total_subsys_num = 8; //每个系统中子系统数,每个系统的子系统数相等 + +$len_of_sys_num = 2; //sys_id编号方式中系统编号的长度 + +$len_of_subsys_num = 2; //sys_id编号方式中子系统编号的长度 + +$def_len_of_record = 32; // 参数表中每条记录默认所含的Byte个数 +*/ + + +//服务器工作状态定义,这个需要放在子模块中 +$server_work_status = array( + array('num' => '0', 'remark' => $strRestart, 'color' => '#FF0000'), + array('num' => '1', 'remark' => $strInitialize, 'color' => '#FF0000'), + array('num' => '2', 'remark' => $strNormal, 'color' => '#0000FF'), + array('num' => '3', 'remark' => $strPause, 'color' => '#FF0000'), + array('num' => '4', 'remark' => $strStop, 'color' => '#FF0000') +); + +//================================操作权限设定====================================== +//---------------------操作种类权限定义------------------------------ +/* +$privilegeDefArr=array( + array('permit' => '0', 'remark' => 'any one', 'show'=>0), + array('permit' => '1', 'remark' => $strOprationRestriction, 'show'=>1), + array('permit' => '2', 'remark' => $strConfigurationRestriction, 'show'=>1), + array('permit' => '3', 'remark' => $strManagementRestriction, 'show'=>1), + array('permit' => '4', 'remark' => 'System management', 'show'=>1), + array('permit' => '5', 'remark' => 'Development', 'show'=>0) +); +*/ +$privilegeDefArr = array( + array('permit' => '0', 'remark' => 'any one', 'show' => 0), + array('permit' => '1', 'remark' => $strOprationRestriction, 'show' => 1), + array('permit' => '2', 'remark' => 'Technician', 'show' => 1), + array('permit' => '3', 'remark' => 'Engineer', 'show' => 1), + array('permit' => '4', 'remark' => $strManagementRestriction, 'show' => 1), + array('permit' => '5', 'remark' => 'Development', 'show' => 0) +); + +//-------------------------按操作种类划分页面----------------------- +//每个dir[$n][0]都是该类操作的操作权限等级值 +//具体的值对照oper_type的定义 + +$omcDir = '/' . $omcTypeArr[$thisOmcType]['path']; +//$omcDir = '/omcWeb_v5'; +//echo "
      omcDir=$omcDir"; +//---------------every one (包括未登录用户)可访问的目录----------------- +$dirAccessDefArr[0][0] = $omcDir . '/security/login/'; +$dirAccessDefArr[0][1] = $omcDir . '/security/logout/'; + + +//---------------class one:operator 可访问的目录----------------- +$dirAccessDefArr[1][0] = $omcDir . '/security/'; +$dirAccessDefArr[1][1] = $omcDir . '/frame/'; +$dirAccessDefArr[1][2] = $omcDir . '/fault/'; + +//---------------class two:engineer 可访问的目录----------------- +$dirAccessDefArr[2][0] = $omcDir . '/security/'; +$dirAccessDefArr[2][1] = $omcDir . '/frame/'; +$dirAccessDefArr[2][2] = $omcDir . '/fault/'; +$dirAccessDefArr[2][3] = $omcDir . '/performance/'; +$dirAccessDefArr[2][4] = $omcDir . '/account/'; +$dirAccessDefArr[2][5] = $omcDir . '/element/'; +$dirAccessDefArr[2][6] = $omcDir . '/configuration/'; + +//---------------class three:manager 可访问的目录----------------- +$dirAccessDefArr[3][0] = $omcDir . '/security/'; +$dirAccessDefArr[3][1] = $omcDir . '/frame/'; +$dirAccessDefArr[3][2] = $omcDir . '/fault/'; +$dirAccessDefArr[3][3] = $omcDir . '/account/'; +$dirAccessDefArr[3][4] = $omcDir . '/configuration/'; +$dirAccessDefArr[3][5] = $omcDir . '/element/'; +$dirAccessDefArr[3][6] = $omcDir . '/performance/'; + +//--------------class four:system manager 可访问的目录----------------- +$dirAccessDefArr[4][0] = $omcDir . '/security/'; +$dirAccessDefArr[4][1] = $omcDir . '/frame/'; +$dirAccessDefArr[4][2] = $omcDir . '/fault/'; +$dirAccessDefArr[4][3] = $omcDir . '/account/'; +$dirAccessDefArr[4][4] = $omcDir . '/configuration/'; +$dirAccessDefArr[4][5] = $omcDir . '/element/'; +$dirAccessDefArr[4][6] = $omcDir . '/performance/'; + +//--------------developer 可访问的目录----------------- +$dirAccessDefArr[5][0] = $omcDir . '/security/'; +$dirAccessDefArr[5][1] = $omcDir . '/frame/'; +$dirAccessDefArr[5][2] = $omcDir . '/fault/'; +$dirAccessDefArr[5][3] = $omcDir . '/account/'; +$dirAccessDefArr[5][4] = $omcDir . '/configuration/'; +$dirAccessDefArr[5][5] = $omcDir . '/element/'; +$dirAccessDefArr[5][6] = $omcDir . '/performance/'; +$dirAccessDefArr[5][7] = $omcDir . '/sysDefine/'; +?> + diff --git a/wxc2_omc/inc/english.inc b/wxc2_omc/inc/english.inc new file mode 100755 index 0000000..b324186 --- /dev/null +++ b/wxc2_omc/inc/english.inc @@ -0,0 +1,506 @@ + "; +$strRent ="Rent"; +$strTariffRentID ="ID"; +$strTariffRentChargeDate ="Charge date"; +$strTariffRentChargeAmount ="Charge amount"; +$strTariffRentCapFlag ="Cap flag"; +$strGet ="Get"; +$strSet ="Set"; +$strCompare ="Compare"; +$strLoad ="Load"; +$strSave ="Save"; +$strLock ="Lock"; +$strUnlock ="Unlock"; +$strDailingPrefix ="Dailing prefix"; +$strTrunkGroup ="Trunk group"; +$strCell ="Cell"; +$strClockReference ="Clock reference"; +$strParameter ="Parameter"; +$strBHCA ="BHCA"; +$strData ="Data"; +$strFlow ="Flow"; +$strAnalysis ="Analysis"; +$strTariffPlan ="Tariff plan"; +$strBasicTariff ="Basic tariff"; +$strHoliday ="Holiday"; +$strMultiServices ="Multiple services"; +$strPlanManage ="Plan management"; +$strMessageLength ="Message length"; +$strConfiguration ="Configuration"; + +//added by xiehua +$strTitleConfiguration ="Configuration"; +$strTitleAccount ="Account"; +$strTitlePerformance ="Performance"; +$strSubscriberManage ="Subscriber"; +$strRefreshCard ="Referesh card"; +$strSubscriber ="Subscriber"; +$strLog ="Log"; +$strMaintenance ="Maintenance"; +$strNetwork ="Network"; +$strBackupRestore ="Backup&Restore"; +$strDualServerMode ="Dual server mode"; +$strCharge ="Charge"; +$strAdvanced ="Advanced"; +$strPerformance ="Performance"; +$strGetAll ="Get All"; + +//added by Cui Ticun +$strDiscountID ="Discount ID"; +$strFreeChargeUnit ="Free charge unit(s)"; +$strFav_call ="Friends and family number call"; +$strFav_listedtion ="Friends and family number list edition"; +$strCf_Cug_call ="Forward + CUG call"; +$strCf_Fav_call ="Forward + F&F call"; +$strCug_Fav_call ="CUG + F&F call"; +$strCf_Cug_Fav_call ="Forward + CUG + F&F call"; +$strUndo ="Undo"; +$strLinkset ="Linkset"; +$strLink ="Link"; +$strLocalNode ="Local node"; +$strNetworkCode ="Network code"; +$strMtTariff ="MT Tariff"; +$strSMContent ="Content"; +$strPriority ="Priority"; +$strTimeToLive ="Time to live"; +$strSent ="Sent"; +$strDiscarded ="Discarded"; +$strPending ="Pending"; +$strCaller ="Caller #"; +$strCalled ="Called #"; +$strUpdate ="Update"; +$strReceive ="Receive"; +$strLastAttempt ="Last attempt"; +$strGttObjects ="GTT Objects"; + +$strTitleGet="Get all Parameters from device"; +$strTitleSet="Set all Parameters to device"; +$flagColor = "#E6FFFF"; + +//add by Zheng Jianhui +$strE164Number="E164 Number"; +$strUndo="Undo"; +$strModule="Module"; +$strVMSOrVSS="VSS"; +$strSMSEG="SMEG"; + +/***********************Error and prompt display define***************************/ +$STR_CONF_COMMAND_ERR_0000 ="Command successful"; + +//ERR_001*:should prompt the operator "Check the device's status" +$STR_CONF_PROMPT_01 ="Please check the device status"; +$STR_CONF_COMMAND_ERR_0101 ="OMC cannot get the device IP"; +$STR_CONF_COMMAND_ERR_0102 ="The device IP is error"; + +//ERR_002*:should prompt the operator "Check the software version of OMC and device" +$STR_CONF_PROMPT_02 ="Please check the software version of OMC and device"; +$STR_CONF_COMMAND_ERR_0201 ="OMC cannot get the object value"; +$STR_CONF_COMMAND_ERR_0202 ="OMC cannot get the instance value"; + +//ERR_003*:should prompt the operator "Check the OMC's status or send command again" +$STR_CONF_PROMPT_03 ="Please check the OMC status or send command again"; +$STR_CONF_COMMAND_ERR_0301 ="OMC send snmp message failed"; +$STR_CONF_COMMAND_ERR_0302 ="OMC command buffer is full"; +$STR_CONF_COMMAND_ERR_0303 ="Network is busy or managed object response is too slow"; + +//ERR_04*:should prompt the operator "Check the device's status or send command again" +$STR_CONF_PROMPT_04 ="Please check the device status or send commands again.Before sending commands, please make sure OMC servers and managed servers are online."; +$STR_CONF_COMMAND_ERR_0401 ="Invailed response message"; +$STR_CONF_COMMAND_ERR_0402 ="Error Response message"; +$STR_CONF_COMMAND_ERR_0403 ="Response timeout"; + +//ERR_05*:Value Error +$STR_CONF_PROMPT_05 ="Please check the value range and syntax in the online help then try it again."; +$STR_CONF_COMMAND_ERR_0501 ="Too Big"; +$STR_CONF_COMMAND_ERR_0502 ="No Such Name"; +$STR_CONF_COMMAND_ERR_0503 ="Bad Value"; +$STR_CONF_COMMAND_ERR_0504 ="Read Only"; +$STR_CONF_COMMAND_ERR_0505 ="Generate Error"; +$STR_CONF_COMMAND_ERR_0506 ="No Access"; +$STR_CONF_COMMAND_ERR_0507 ="Wrong Type"; +$STR_CONF_COMMAND_ERR_0508 ="Wrong Length"; +$STR_CONF_COMMAND_ERR_0509 ="Wrong Encoding"; +$STR_CONF_COMMAND_ERR_0510 ="Wrong Value"; +$STR_CONF_COMMAND_ERR_0511 ="No Creation"; +$STR_CONF_COMMAND_ERR_0512 ="Inconsistent Value"; +$STR_CONF_COMMAND_ERR_0513 ="Resource Unavailabe"; +$STR_CONF_COMMAND_ERR_0514 ="Commit Failed"; +$STR_CONF_COMMAND_ERR_0515 ="Undo Failed"; +$STR_CONF_COMMAND_ERR_0516 ="Authorization Error"; +$STR_CONF_COMMAND_ERR_0517 ="No Writable"; +$STR_CONF_COMMAND_ERR_0518 ="InconsistentName"; + +$STR_CONF_COMMAND_ERR_9999 ="Unknown error"; +$strPleaseInputIndexNo ="Please input index No."; +$indexNoDefinedBy ="Index is defined by"; +?> diff --git a/wxc2_omc/inc/expand.js b/wxc2_omc/inc/expand.js new file mode 100755 index 0000000..6d27982 --- /dev/null +++ b/wxc2_omc/inc/expand.js @@ -0,0 +1,134 @@ + \ No newline at end of file diff --git a/wxc2_omc/inc/ftiens4.js b/wxc2_omc/inc/ftiens4.js new file mode 100755 index 0000000..eca263a --- /dev/null +++ b/wxc2_omc/inc/ftiens4.js @@ -0,0 +1,1127 @@ +//**************************************************************** +// Keep this copyright notice: +// This copy of the script is the property of the owner of the +// particular web site you were visiting. +// Do not download the script's files from there. +// For a free download and full instructions go to: +// http://www.treeview.net +//**************************************************************** + + +// Log of changes: +// +// 12 May 03 - Support for Safari Beta 3 +// 01 Mar 03 - VERSION 4.3 - Support for checkboxes +// 21 Feb 03 - Added support for Opera 7 +// 22 Sep 02 - Added maySelect member for node-by-node control +// of selection and highlight +// 21 Sep 02 - Cookie values are now separated by cookieCutter +// 12 Sep 02 - VERSION 4.2 - Can highlight Selected Nodes and +// can preserve state through external (DB) IDs +// 29 Aug 02 - Fine tune 'supportDeferral' for IE4 and IE Mac +// 25 Aug 02 - Fixes: STARTALLOPEN, and multi-page frameless +// 09 Aug 02 - Fix repeated folder on Mozilla 1.x +// 31 Jul 02 - VERSION 4.1 - Dramatic speed increase for trees +// with hundreds or thousands of nodes; changes to the control +// flags of the gLnk function +// 18 Jul 02 - Changes in pre-load images function +// 13 Jun 02 - Add ICONPATH var to allow for gif subdir +// 20 Apr 02 - Improve support for frame-less layout +// 07 Apr 02 - Minor changes to support server-side dynamic feeding +// (example: FavoritesManagerASP) + + +// Definition of class Folder +// ***************************************************************** +function Folder(folderDescription, hreference) //constructor +{ + //constant data + this.desc = folderDescription; + this.hreference = hreference; + this.id = -1; + this.navObj = 0; + this.iconImg = 0; + this.nodeImg = 0; + this.isLastNode = 0; + this.iconSrc = ICONPATH + "ftv2folderopen.gif"; + this.iconSrcClosed = ICONPATH + "ftv2folderclosed.gif"; + this.children = new Array; + this.nChildren = 0; + this.level = 0; + this.leftSideCoded = ""; + this.isLastNode=false; + this.parentObj = null; + this.maySelect=true; + this.prependHTML = "" + + //dynamic data + this.isOpen = false + this.isLastOpenedFolder = false + this.isRendered = 0 + + //methods + this.initialize = initializeFolder + this.setState = setStateFolder + this.addChild = addChild + this.createIndex = createEntryIndex + this.escondeBlock = escondeBlock + this.esconde = escondeFolder + this.folderMstr = folderMstr + this.renderOb = drawFolder + this.totalHeight = totalHeight + this.subEntries = folderSubEntries + this.linkHTML = linkFolderHTML + this.blockStartHTML = blockStartHTML + this.blockEndHTML = blockEndHTML + this.nodeImageSrc = nodeImageSrc + this.iconImageSrc = iconImageSrc + this.getID = getID + this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders +} + +function initializeFolder(level, lastNode, leftSide) +{ + var j=0 + var i=0 + nc = this.nChildren + + this.createIndex() + this.level = level + this.leftSideCoded = leftSide + + if (browserVersion == 0 || STARTALLOPEN==1) + this.isOpen=true; + + if (level>0) + if (lastNode) //the last child in the children array + leftSide = leftSide + "0" + else + leftSide = leftSide + "1" + + this.isLastNode = lastNode + + if (nc > 0) + { + level = level + 1 + for (i=0 ; i < this.nChildren; i++) + { + if (i == this.nChildren-1) + this.children[i].initialize(level, 1, leftSide) + else + this.children[i].initialize(level, 0, leftSide) + } + } +} + +function drawFolder(insertAtObj) +{ + var nodeName = "" + var auxEv = "" + var docW = "" + + var leftSide = leftSideHTML(this.leftSideCoded) + + if (browserVersion > 0) + auxEv = "" + else + auxEv = "" + + nodeName = this.nodeImageSrc() + + if (this.level>0) + if (this.isLastNode) //the last child in the children array + leftSide = leftSide + "" + auxEv + "" + else + leftSide = leftSide + "" + auxEv + "" + + this.isRendered = 1 + + if (browserVersion == 2) { + if (!doc.yPos) + doc.yPos=20 + } + + docW = this.blockStartHTML("folder"); + + docW = docW + "" + leftSide + ""; + if (USEICONS) + { + docW = docW + this.linkHTML(false) + docW = docW + "" + } + else + { + if (this.prependHTML == "") + docW = docW + "" + } + if (WRAPTEXT) + docW = docW + ""+this.prependHTML+"" + else + docW = docW + ""+this.prependHTML+"" + if (USETEXTLINKS) + { + docW = docW + this.linkHTML(true) + docW = docW + this.desc + "" + } + else + docW = docW + this.desc + docW = docW + "" + + docW = docW + this.blockEndHTML() + + if (insertAtObj == null) + { + if (supportsDeferral) { + doc.write("
      ") //transition between regular flow HTML, and node-insert DOM DHTML + insertAtObj = getElById("domRoot") + insertAtObj.insertAdjacentHTML("beforeEnd", docW) + } + else + doc.write(docW) + } + else + { + insertAtObj.insertAdjacentHTML("afterEnd", docW) + } + + if (browserVersion == 2) + { + this.navObj = doc.layers["folder"+this.id] + if (USEICONS) + this.iconImg = this.navObj.document.images["folderIcon"+this.id] + this.nodeImg = this.navObj.document.images["nodeIcon"+this.id] + doc.yPos=doc.yPos+this.navObj.clip.height + } + else if (browserVersion != 0) + { + this.navObj = getElById("folder"+this.id) + if (USEICONS) + this.iconImg = getElById("folderIcon"+this.id) + this.nodeImg = getElById("nodeIcon"+this.id) + } +} + +function setStateFolder(isOpen) +{ + var subEntries + var totalHeight + var fIt = 0 + var i=0 + var currentOpen + + if (isOpen == this.isOpen) + return + + if (browserVersion == 2) + { + totalHeight = 0 + for (i=0; i < this.nChildren; i++) + totalHeight = totalHeight + this.children[i].navObj.clip.height + subEntries = this.subEntries() + if (this.isOpen) + totalHeight = 0 - totalHeight + for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++) + indexOfEntries[fIt].navObj.moveBy(0, totalHeight) + } + this.isOpen = isOpen; + + if (this.getID()!=foldersTree.getID() && PERSERVESTATE && !this.isOpen) //closing + { + currentOpen = GetCookie("clickedFolder") + if (currentOpen != null) { + currentOpen = currentOpen.replace(this.getID()+cookieCutter, "") + SetCookie("clickedFolder", currentOpen) + } + } + + if (!this.isOpen && this.isLastOpenedfolder) + { + lastOpenedFolder = null; + this.isLastOpenedfolder = false; + } + propagateChangesInState(this) +} + +function propagateChangesInState(folder) +{ + var i=0 + + //Change icon + if (folder.nChildren > 0 && folder.level>0) //otherwise the one given at render stays + folder.nodeImg.src = folder.nodeImageSrc() + + //Change node + if (USEICONS) + folder.iconImg.src = folder.iconImageSrc() + + //Propagate changes + for (i=folder.nChildren-1; i>=0; i--) + if (folder.isOpen) + folder.children[i].folderMstr(folder.navObj) + else + folder.children[i].esconde() +} + +function escondeFolder() +{ + this.escondeBlock() + + this.setState(0) +} + +function linkFolderHTML(isTextLink) +{ + var docW = ""; + + if (this.hreference) + { + if (USEFRAMES) + docW = docW + " 0) + docW = docW + "onClick='javascript:clickOnFolder(\""+this.getID()+"\")'" + + docW = docW + ">" + } + else + docW = docW + "" + + return docW; +} + +function addChild(childNode) +{ + this.children[this.nChildren] = childNode + childNode.parentObj = this + this.nChildren++ + return childNode +} + +function folderSubEntries() +{ + var i = 0 + var se = this.nChildren + + for (i=0; i < this.nChildren; i++){ + if (this.children[i].children) //is a folder + se = se + this.children[i].subEntries() + } + + return se +} + +function nodeImageSrc() { + var srcStr = ""; + + if (this.isLastNode) //the last child in the children array + { + if (this.nChildren == 0) + srcStr = ICONPATH + "ftv2lastnode.gif" + else + if (this.isOpen) + srcStr = ICONPATH + "ftv2mlastnode.gif" + else + srcStr = ICONPATH + "ftv2plastnode.gif" + } + else + { + if (this.nChildren == 0) + srcStr = ICONPATH + "ftv2node.gif" + else + if (this.isOpen) + srcStr = ICONPATH + "ftv2mnode.gif" + else + srcStr = ICONPATH + "ftv2pnode.gif" + } + return srcStr; +} + +function iconImageSrc() { + if (this.isOpen) + return(this.iconSrc) + else + return(this.iconSrcClosed) +} + +// Definition of class Item (a document or link inside a Folder) +// ************************************************************* + +function Item(itemDescription, itemLink, target) // Constructor +{ + // constant data + this.desc = itemDescription + this.link = itemLink + this.id = -1 //initialized in initalize() + this.navObj = 0 //initialized in render() + this.iconImg = 0 //initialized in render() + this.iconSrc = ICONPATH + "ftv2doc.gif" + this.isRendered = 0 + this.isLastNode = false + this.level = 0 + this.leftSideCoded = "" + this.nChildren = 0 + this.target = target + this.parentObj = null + this.maySelect=true + this.prependHTML = "" + + // methods + this.initialize = initializeItem + this.createIndex = createEntryIndex + this.escondeBlock = escondeBlock + this.esconde = escondeBlock + this.folderMstr = folderMstr + this.renderOb = drawItem + this.totalHeight = totalHeight + this.blockStartHTML = blockStartHTML + this.blockEndHTML = blockEndHTML + this.getID = getID + this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders +} + +function initializeItem(level, lastNode, leftSide) +{ + this.createIndex() + this.level = level + this.leftSideCoded = leftSide + this.isLastNode = lastNode +} + +function drawItem(insertAtObj) +{ + var leftSide = leftSideHTML(this.leftSideCoded) + var docW = "" + + var fullLink = "href=\""+this.link+"\" target=\""+this.target+"\" onClick=\"clickOnLink('"+this.getID()+"\', '"+this.link+"','"+this.target+"');return false;\""; + this.isRendered = 1 + + if (this.level>0) + if (this.isLastNode) //the last 'brother' in the children array + { + leftSide = leftSide + "" + } + else + { + leftSide = leftSide + "" + } + + docW = docW + this.blockStartHTML("item") + + docW = docW + "" + leftSide + "" + if (USEICONS) + docW = docW + "" + "" + "" + else + if (this.prependHTML == "") + docW = docW + "" + + if (WRAPTEXT) + docW = docW + ""+this.prependHTML+"" + else + docW = docW + ""+this.prependHTML+"" + + if (USETEXTLINKS) + docW = docW + "" + this.desc + "" + else + docW = docW + this.desc + + docW = docW + "" + + docW = docW + this.blockEndHTML() + + if (insertAtObj == null) + { + doc.write(docW) + } + else + { + insertAtObj.insertAdjacentHTML("afterEnd", docW) + } + + if (browserVersion == 2) { + this.navObj = doc.layers["item"+this.id] + if (USEICONS) + this.iconImg = this.navObj.document.images["itemIcon"+this.id] + doc.yPos=doc.yPos+this.navObj.clip.height + } else if (browserVersion != 0) { + this.navObj = getElById("item"+this.id) + if (USEICONS) + this.iconImg = getElById("itemIcon"+this.id) + } +} + + +// Methods common to both objects (pseudo-inheritance) +// ******************************************************** + +function forceOpeningOfAncestorFolders() { + if (this.parentObj == null || this.parentObj.isOpen) + return + else { + this.parentObj.forceOpeningOfAncestorFolders() + clickOnNodeObj(this.parentObj) + } +} + +function escondeBlock() +{ + if (browserVersion == 1 || browserVersion == 3) { + if (this.navObj.style.display == "none") + return + this.navObj.style.display = "none" + } else { + if (this.navObj.visibility == "hidden") + return + this.navObj.visibility = "hidden" + } +} + +function folderMstr(domObj) +{ + if (browserVersion == 1 || browserVersion == 3) { + if (t==-1) + return + var str = new String(doc.links[t]) + if (str.slice(14,16) != "em") + return + } + + if (!this.isRendered) + this.renderOb(domObj) + else + if (browserVersion == 1 || browserVersion == 3) + this.navObj.style.display = "block" + else + this.navObj.visibility = "show" +} + +function blockStartHTML(idprefix) { + var idParam = "id='" + idprefix + this.id + "'" + var docW = "" + + if (browserVersion == 2) + docW = "" + else if (browserVersion != 0) + docW = "
      " + + docW = docW + "" + + return docW +} + +function blockEndHTML() { + var docW = "" + + docW = "
      " + + if (browserVersion == 2) + docW = docW + "" + else if (browserVersion != 0) + docW = docW + "
      " + + return docW +} + +function createEntryIndex() +{ + this.id = nEntries + indexOfEntries[nEntries] = this + nEntries++ +} + +// total height of subEntries open +function totalHeight() //used with browserVersion == 2 +{ + var h = this.navObj.clip.height + var i = 0 + + if (this.isOpen) //is a folder and _is_ open + for (i=0 ; i < this.nChildren; i++) + h = h + this.children[i].totalHeight() + + return h +} + + +function leftSideHTML(leftSideCoded) { + var i; + var retStr = ""; + + for (i=0; i" + } + if (leftSideCoded.charAt(i) == "0") + { + retStr = retStr + "" + } + } + return retStr +} + +function getID() +{ + //define a .xID in all nodes (folders and items) if you want to PERVESTATE that + //work when the tree changes. The value eXternal value must be unique for each + //node and must node change when other nodes are added or removed + //The value may be numeric or string, but cannot have the same char used in cookieCutter + if (typeof this.xID != "undefined") + return this.xID + else + return this.id +} + + +// Events +// ********************************************************* + +function clickOnFolder(folderId) +{ + var clicked = findObj(folderId) + + if (!clicked.isOpen) { + clickOnNodeObj(clicked) + } + + if (lastOpenedFolder != null && lastOpenedFolder != folderId) + clickOnNode(lastOpenedFolder); //sets lastOpenedFolder to null + + if (clicked.nChildren==0) { + lastOpenedFolder = folderId; + clicked.isLastOpenedfolder = true + } + + if (isLinked(clicked.hreference)) { + highlightObjLink(clicked); + } +} + +function clickOnNode(folderId) +{ + clickOnNodeObj(findObj(folderId)) +} + +function clickOnNodeObj(folderObj) +{ + var state = 0 + var currentOpen + + state = folderObj.isOpen + folderObj.setState(!state) //open<->close + + if (folderObj.id!=foldersTree.id && PERSERVESTATE) + { + currentOpen = GetCookie("clickedFolder") + if (currentOpen == null) + currentOpen = "" + + if (!folderObj.isOpen) //closing + { + currentOpen = currentOpen.replace(folderObj.getID()+cookieCutter, "") + SetCookie("clickedFolder", currentOpen) + } + else + SetCookie("clickedFolder", currentOpen+folderObj.getID()+cookieCutter) + } +} + +function clickOnLink(clickedId, target, windowName) { + highlightObjLink(findObj(clickedId)); + if (isLinked(target)) { + window.open(target,windowName); + } +} + +function ld () +{ + return document.links.length-1 +} + + +// Auxiliary Functions +// ******************* + +function findObj(id) +{ + var i=0; + var nodeObj; + if (typeof foldersTree.xID != "undefined") { + nodeObj = indexOfEntries[i]; + for(i=0;i= nEntries) + return null; //example: node removed in DB + else + return indexOfEntries[id]; +} + +function isLinked(hrefText) { + var result = true; + result = (result && hrefText !=null); + result = (result && hrefText != ''); + result = (result && hrefText.indexOf('undefined') < 0); + result = (result && hrefText.indexOf('parent.op') < 0); + return result; +} + +// Do highlighting by changing background and foreg. colors of folder or doc text +function highlightObjLink(nodeObj) { + if (!HIGHLIGHT || nodeObj==null || nodeObj.maySelect==false) {//node deleted in DB + return; + } + + if (browserVersion == 1 || browserVersion == 3) { + var clickedDOMObj = getElById('itemTextLink'+nodeObj.id); + if (clickedDOMObj != null) { + if (lastClicked != null) { + var prevClickedDOMObj = getElById('itemTextLink'+lastClicked.id); + prevClickedDOMObj.style.color=lastClickedColor; + prevClickedDOMObj.style.backgroundColor=lastClickedBgColor; + } + + lastClickedColor = clickedDOMObj.style.color; + lastClickedBgColor = clickedDOMObj.style.backgroundColor; + clickedDOMObj.style.color=HIGHLIGHT_COLOR; + clickedDOMObj.style.backgroundColor=HIGHLIGHT_BG; + } + } + lastClicked = nodeObj; + if (PERSERVESTATE) + SetCookie('highlightedTreeviewLink', nodeObj.getID()); +} + +function gFld(description, hreference) +{ + folder = new Folder(description, hreference); + return folder; +} + +function gLnk(optionFlags, description, linkData) +{ + var fullLink = ""; + var targetFlag = ""; + var target = ""; + var protocolFlag = ""; + var protocol = ""; + + if (optionFlags>=0) //is numeric (old style) or empty (error) + { + return oldGLnk(optionFlags, description, linkData) + } + + targetFlag = optionFlags.charAt(0) + if (targetFlag=="B") + target = "_blank" + if (targetFlag=="P") + target = "_parent" + if (targetFlag=="R") + target = "basefrm" + if (targetFlag=="S") + target = "_self" + if (targetFlag=="T") + target = "_top" + + if (optionFlags.length > 1) { + protocolFlag = optionFlags.charAt(1) + if (protocolFlag=="h") + protocol = "http://" + if (protocolFlag=="s") + protocol = "https://" + if (protocolFlag=="f") + protocol = "ftp://" + if (protocolFlag=="m") + protocol = "mailto:" + } + + fullLink = "'" + protocol + linkData + "' target=" + target + + linkItem = new Item(description, protocol+linkData, target) + return linkItem +} + +//Function created Aug 1, 2002 for backwards compatibility purposes +function oldGLnk(target, description, linkData) +{ + var fullLink = ""; + //Backwards compatibility code + if (USEFRAMES) + { + if (target==0) + { + fullLink = "'"+linkData+"' target=\"basefrm\"" + } + else + { + if (target==1) + fullLink = "'http://"+linkData+"' target=_blank" + else + if (target==2) + fullLink = "'http://"+linkData+"' target=\"basefrm\"" + else + fullLink = linkData+" target=\"_top\"" + } + } + else + { + if (target==0) + { + fullLink = "'"+linkData+"' target=_top" + } + else + { + if (target==1) + fullLink = "'http://"+linkData+"' target=_blank" + else + fullLink = "'http://"+linkData+"' target=_top" + } + } + + linkItem = new Item(description, fullLink) + return linkItem +} + +function insFld(parentFolder, childFolder) +{ + return parentFolder.addChild(childFolder) +} + +function insDoc(parentFolder, document) +{ + return parentFolder.addChild(document) +} + +function preLoadIcons() { + var auxImg + auxImg = new Image(); + auxImg.src = ICONPATH + "ftv2vertline.gif"; + auxImg.src = ICONPATH + "ftv2mlastnode.gif"; + auxImg.src = ICONPATH + "ftv2mnode.gif"; + auxImg.src = ICONPATH + "ftv2plastnode.gif"; + auxImg.src = ICONPATH + "ftv2pnode.gif"; + auxImg.src = ICONPATH + "ftv2blank.gif"; + auxImg.src = ICONPATH + "ftv2lastnode.gif"; + auxImg.src = ICONPATH + "ftv2node.gif"; + auxImg.src = ICONPATH + "ftv2folderclosed.gif"; + auxImg.src = ICONPATH + "ftv2folderopen.gif"; + auxImg.src = ICONPATH + "ftv2doc.gif"; +} + +//Open some folders for initial layout, if necessary +function setInitialLayout() { + if (browserVersion > 0 && !STARTALLOPEN) + clickOnNodeObj(foldersTree); + + if (!STARTALLOPEN && (browserVersion > 0) && PERSERVESTATE) + PersistentFolderOpening(); +} + +//Used with NS4 and STARTALLOPEN +function renderAllTree(nodeObj, parent) { + var i=0; + nodeObj.renderOb(parent) + if (supportsDeferral) + for (i=nodeObj.nChildren-1; i>=0; i--) + renderAllTree(nodeObj.children[i], nodeObj.navObj) + else + for (i=0 ; i < nodeObj.nChildren; i++) + renderAllTree(nodeObj.children[i], null) +} + +function hideWholeTree(nodeObj, hideThisOne, nodeObjMove) { + var i=0; + var heightContained=0; + var childrenMove=nodeObjMove; + + if (hideThisOne) + nodeObj.escondeBlock() + + if (browserVersion == 2) + nodeObj.navObj.moveBy(0, 0-nodeObjMove) + + for (i=0 ; i < nodeObj.nChildren; i++) { + heightContainedInChild = hideWholeTree(nodeObj.children[i], true, childrenMove) + if (browserVersion == 2) { + heightContained = heightContained + heightContainedInChild + nodeObj.children[i].navObj.clip.height + childrenMove = childrenMove + heightContainedInChild + } + } + + return heightContained; +} + + +// Simulating inserAdjacentHTML on NS6 +// Code by thor@jscript.dk +// ****************************************** + +if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement){ + HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode) + { + switch (where){ + case 'beforeBegin': + this.parentNode.insertBefore(parsedNode,this) + break; + case 'afterBegin': + this.insertBefore(parsedNode,this.firstChild); + break; + case 'beforeEnd': + this.appendChild(parsedNode); + break; + case 'afterEnd': + if (this.nextSibling) + this.parentNode.insertBefore(parsedNode,this.nextSibling); + else this.parentNode.appendChild(parsedNode); + break; + } + } + + HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr) + { + var r = this.ownerDocument.createRange(); + r.setStartBefore(this); + var parsedHTML = r.createContextualFragment(htmlStr); + this.insertAdjacentElement(where,parsedHTML) + } +} + +function getElById(idVal) { + if (document.getElementById != null) + return document.getElementById(idVal) + if (document.all != null) + return document.all[idVal] + + alert("Problem getting element by id") + return null +} + + +// Functions for cookies +// Note: THESE FUNCTIONS ARE OPTIONAL. No cookies are used unless +// the PERSERVESTATE variable is set to 1 (default 0) +// The separator currently in use is ^ (chr 94) +// *********************************************************** + +function PersistentFolderOpening() +{ + var stateInCookie; + var fldStr="" + var fldArr + var fldPos=0 + var id + var nodeObj + stateInCookie = GetCookie("clickedFolder"); + SetCookie('clickedFolder', "") //at the end of function it will be back, minus null cases + + if(stateInCookie!=null) + { + fldArr = stateInCookie.split(cookieCutter) + for (fldPos=0; fldPos 2) ? argv[2] : null; + //var path = (argc > 3) ? argv[3] : null; + var domain = (argc > 4) ? argv[4] : null; + var secure = (argc > 5) ? argv[5] : false; + var path = "/"; //allows the tree to remain open across pages with diff names & paths + + name = CookieBranding(name) + + document.cookie = name + "=" + escape (value) + + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + + ((path == null) ? "" : ("; path=" + path)) + + ((domain == null) ? "" : ("; domain=" + domain)) + + ((secure == true) ? "; secure" : ""); +} + +function ExpireCookie (name) +{ + var exp = new Date(); + exp.setTime (exp.getTime() - 1); + var cval = GetCookie (name); + name = CookieBranding(name) + document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); +} + + +//To customize the tree, overwrite these variables in the configuration file (demoFramesetNode.js, etc.) +var USETEXTLINKS = 0 +var STARTALLOPEN = 0 +var USEFRAMES = 1 +var USEICONS = 1 +var WRAPTEXT = 0 +var PERSERVESTATE = 0 +var ICONPATH = '' +var HIGHLIGHT = 0 +var HIGHLIGHT_COLOR = 'white'; +var HIGHLIGHT_BG = 'blue'; +var BUILDALL = 0 + + +//Other variables +var lastClicked = null; +var lastClickedColor; +var lastClickedBgColor; +var indexOfEntries = new Array +var nEntries = 0 +var browserVersion = 0 +var selectedFolder=0 +var lastOpenedFolder=null +var t=5 +var doc = document +var supportsDeferral = false +var cookieCutter = '^' //You can change this if you need to use ^ in your xID or treeID values + +doc.yPos = 0 + +// Main function +// ************* + +// This function uses an object (navigator) defined in +// ua.js, imported in the main html page (left frame). +function initializeDocument() +{ + preLoadIcons(); + switch(navigator.family) + { + case 'ie4': + browserVersion = 1 //Simply means IE > 3.x + break; + case 'opera': + browserVersion = (navigator.version > 6 ? 1 : 0); //opera7 has a good DOM + break; + case 'nn4': + browserVersion = 2 //NS4.x + break; + case 'gecko': + browserVersion = 3 //NS6.x + break; + case 'safari': + browserVersion = 1 //Safari Beta 3 seems to behave like IE in spite of being based on Konkeror + break; + default: + browserVersion = 0 //other, possibly without DHTML + break; + } + + supportsDeferral = ((navigator.family=='ie4' && navigator.version >= 5 && navigator.OS != "mac") || browserVersion == 3); + supportsDeferral = supportsDeferral & (!BUILDALL) + if (!USEFRAMES && browserVersion == 2) + browserVersion = 0; + eval(String.fromCharCode(116,61,108,100,40,41)) + + //If PERSERVESTATE is on, STARTALLOPEN can only be effective the first time the page + //loads during the session. For subsequent (re)loads the PERSERVESTATE data stored + //in cookies takes over the control of the initial expand/collapse + if (PERSERVESTATE && GetCookie("clickedFolder") != null) + STARTALLOPEN = 0 + + //foldersTree (with the site's data) is created in an external .js (demoFramesetNode.js, for example) + foldersTree.initialize(0, true, "") + if (supportsDeferral && !STARTALLOPEN) + foldersTree.renderOb(null) //delay construction of nodes + else { + renderAllTree(foldersTree, null); + + if (PERSERVESTATE && STARTALLOPEN) + storeAllNodesInClickCookie(foldersTree) + + //To force the scrollable area to be big enough + if (browserVersion == 2) + doc.write(" ") + + if (browserVersion != 0 && !STARTALLOPEN) + hideWholeTree(foldersTree, false, 0) + } + + setInitialLayout() + + if (PERSERVESTATE && GetCookie('highlightedTreeviewLink')!=null && GetCookie('highlightedTreeviewLink')!="") { + var nodeObj = findObj(GetCookie('highlightedTreeviewLink')) + if (nodeObj!=null){ + nodeObj.forceOpeningOfAncestorFolders() + highlightObjLink(nodeObj); + } + else + SetCookie('highlightedTreeviewLink', '') + } +} + \ No newline at end of file diff --git a/wxc2_omc/inc/header.inc b/wxc2_omc/inc/header.inc new file mode 100755 index 0000000..26c1dab --- /dev/null +++ b/wxc2_omc/inc/header.inc @@ -0,0 +1,595 @@ +"; + echo "var logon='Please Logon System';"; + echo "alert(logon);"; + echo "window.parent.parent.location.href=\"../../security/logout/logout.php\";"; + echo ""; + exit(); +} + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); +header("Cache-Control: no-cache, must-revalidate"); +header("Pragma: no-cache"); + +if ($selectedLanguage == 'chn'){ +?> + + + + + + + + +"; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; +} + +function adjust_title_head() +{ + echo "
      "; +} + +function adjust_title_tail() +{ + echo "
      "; +} + +function adjust_content_head() +{ + global $userInfo, $session_timeout; + + echo "
      "; + + $now = time(); + if ($now - $userInfo['refresh_time'] > $session_timeout) + $userInfo['privilege'] = 0; + else + $userInfo['refresh_time'] = $now; +} + +function adjust_content_tail() +{ + echo "
      "; +} + +//-----------------for frame window----------------------- +function adjust_head_frame($flag = "up") +{ + if ($flag == "up") { + echo "
      "; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; + } else { + + echo "
      "; + echo ""; + echo "
      "; + //background-color:red; + echo "
      "; + echo ""; + echo "
      "; + } +} + +function adjust_head_small_frame($flag = "up") +{ + if ($flag == "up") { + echo "
      "; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; + } else { + + echo "
      "; + echo ""; + echo "
      "; + //background-color:red; + echo "
      "; + echo ""; + echo "
      "; + } +} + +function adjust_head_middle_frame($flag = "up") +{ + if ($flag == "up") { + echo "
      "; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; + } else { + + echo "
      "; + echo ""; + echo "
      "; + //background-color:red; + echo "
      "; + echo ""; + echo "
      "; + } +} + +function adjust_head_noleft_frame($flag = "up") +{ + if ($flag == "up") { + echo "
      "; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; + } else { + + echo "
      "; + echo ""; + echo "
      "; + //background-color:red; + echo "
      "; + echo ""; + echo "
      "; + } +} + +function adjust_title_head_frame($flag = "up") +{ + echo "
      "; +} + +function adjust_title_tail_frame($flag = "up") +{ + echo "
      "; +} + +function adjust_content_head_frame($flag = "up") +{ + global $userInfo, $session_timeout; + + if ($flag == "up") + echo "
      "; + else + echo "
      "; + + $now = time(); + if ($now - $userInfo[refresh_time] > $session_timeout) + $userInfo[privilege] = 0; + else + $userInfo[refresh_time] = $now; + $_SESSION['userInfo'] = $userInfo; + +} + +function adjust_content_tail_frame($flag = "up") +{ + echo "
      "; +} + +?> diff --git a/wxc2_omc/inc/language.inc b/wxc2_omc/inc/language.inc new file mode 100755 index 0000000..6fa151d --- /dev/null +++ b/wxc2_omc/inc/language.inc @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/wxc2_omc/inc/lib.inc b/wxc2_omc/inc/lib.inc new file mode 100755 index 0000000..472cb01 --- /dev/null +++ b/wxc2_omc/inc/lib.inc @@ -0,0 +1,2341 @@ +"; + return $connection; +} + +function sftp_login($connection, $logName, $logPass) +{ + ssh2_auth_password($connection, $logName, $logPass); + $sftp_key = ssh2_sftp($connection); + return $sftp_key; +} + +define("SFTP_ASCII", 0); +define("SFTP_BINARY", 1); +function sftp_put($key, $remote_file, $local_file, $mode) +{ + $read_mode = "r"; + $write_mode = "w"; + if ($mode == SFTP_BINARY) { + $open_mode .= "b"; + $write_mode .= "b"; + } + $handle = fopen($local_file, $read_mode); + if (!$handle) { + echo "sftp_put:Can not open $local_file
      "; + return FALSE; + } + + //echo "fopen(ssh2.sftp://".intval($key).$remote_file."a=$write_mode)"; + $stream=fopen("ssh2.sftp://".intval($key).$remote_file, $write_mode); + if (!$stream) { + echo "sftp_put:Can not open $remote_file
      "; + return FALSE; + } + + $content = stream_get_contents($handle); + fwrite($stream, $content); + + fclose($handle); + fclose($stream); + + return TRUE; +} + +function sftp_get($connection, $local_file, $remote_file, $mode) +{ + $remoteStream = ssh2_scp_recv($connection, $remote_file, $local_file); + if (!$remoteStream) { + $error = error_get_last(); + echo "ssh2_scp_recv error: " . $error['message'] . "\n"; + return FALSE; + } + fclose($remoteStream); // close remote download stream + //echo "ssh2_scp_recv sucessful" . "\n"; + return TRUE; +} + +function sftp_get_org($key, $local_file, $remote_file, $mode) +{ + $read_mode="r"; + $write_mode="w"; + if($mode == SFTP_BINARY) + { + $open_mode.="b"; + $write_mode.="b"; + } + $handle=fopen($local_file,$write_mode); + if(!$handle) + { + echo "sftp_put:Can not open $local_file
      "; + return FALSE; + } + echo "$remote_file=$read_mode"; + + $stream=fopen("ssh2.sftp://$key"."$remote_file", $read_mode); + if(!$stream) + { + echo "sftp_put:Can not open $remote_file
      "; + return FALSE; + } + + $content=stream_get_contents($stream); + fwrite($handle,$content); + + fclose($handle); + fclose($stream); + + return TRUE; +} + +function checkWritePrivilege() +{ + global $userInfo; + // echo "
      ";
      +    // print_r($userInfo);
      +    // echo "
      ";
      +
      +    if ($userInfo['privilege'] > 2)
      +        return 1;
      +    else
      +        return 0;
      +}
      +
      +
      +function debug_log($file, $info)
      +{
      +    $handle = fopen($file, "a+");
      +    if ($handle == false)
      +        return;
      +    fwrite($handle, $info . "\n");
      +    fclose($handle);
      +}
      +
      +//****************************************************************
      +//鍑芥暟4 pageAccessChk($pageURL)
      +//鍑芥暟璇存槑:
      +//	妫�娴嬬敤鎴锋槸鍚﹀彲杩涘叆鏈〉, 
      +//	濡傛灉鐢ㄦ埛鐨勬潈闄愬寘鍚�$page_url鎵�瀵瑰簲鐨勬潈闄愶紝鍒欏彲杩涘叆璇ラ〉闈€��
      +//
      +//鍙橀噺璇存槑: 
      +//	$page_url                                       
      +//                                                             
      +//杩斿洖鍊硷細 1 = 鍙� -1 = 鍚�
      +//
      +//浣滆�咃細 
      +//      
      +//淇敼娉ㄩ噴锛�      
      +//NO.1      
      +//濮撳悕锛�           
      +//鏃堕棿锛�2002-03-26      
      +//淇敼璇存槑锛氫慨鏀逛簡鏉冮檺瀹氫箟鏂瑰紡锛岃鍑芥暟鏀瑰彉浜嗗ぇ閮ㄥ垎
      +//NO.2      
      +//濮撳悕锛�          
      +//鏃堕棿锛�2002-04-09      
      +//淇敼璇存槑锛氫慨鏀逛簡鏉冮檺瀹氫箟鏂瑰紡锛岃鍑芥暟鏀瑰彉浜嗗ぇ閮ㄥ垎
      +//----------------------------------------------------------
      +
      +function pageAccessChk($pageURL)
      +{
      +    global $userInfo, $privilegeDefArr, $dirAccessDefArr;
      +    $funcDebug = 0;
      +    $privilege = $userInfo['privilege'];
      +
      +    if ($funcDebug) echo "
      privilege:$privilege"; + if (strlen($privilege) > 0) { //鍒ゆ柇宸茬櫥褰曠殑鐢ㄦ埛 + //妫�鏌ヨ鏉冮檺缂栧彿鏄惁瀛樺湪 + $isPass = 0; + for ($k = 0; $k < sizeof($privilegeDefArr); $k++) { + if ($privilege == $privilegeDefArr[$k]['permit']) { + $isPass = 1; + break; + } + } + if ($isPass == 0) { + if ($funcDebug) echo "
      Invailed privilege"; + return (-1); + } + + + //瀵规瘮鍒ゆ柇璇ョ紪鍙峰搴旂殑鏉冮檺鑳藉惁璁块棶璇ョ洰褰� + for ($p = 0; $p < sizeof($dirAccessDefArr[$privilege]); $p++) { + $tmpDir = $dirAccessDefArr[$privilege][$p]; + $tmpLen = strlen($tmpDir); + if ($funcDebug) echo "
      $tmpDir == substr($pageURL,0,$tmpLen)"; + + if ($tmpDir == substr($pageURL, 0, $tmpLen) && $tmpLen > 0) { + return (1); + } + } + //鎵句笉鍒�,娓呮帀杩欎釜鏃犳晥鏉冮檺浠g爜 + if ($funcDebug) echo "1:$userInfo[privilege]"; + $userInfo['privilege'] = 0; + if ($funcDebug) echo "2:$userInfo[privilege]"; + return (-1); + } else {//鍒ゆ柇鏈櫥褰曠殑鐢ㄦ埛 + for ($p = 0; $p < sizeof($dirAccessDefArr[0]); $p++) { + $tmpDir = $dirAccessDefArr[0][$p]; + $tmpLen = strlen($tmpDir); + $thisDir = substr($pageURL, 0, $tmpLen); + if ($funcDebug) echo "
      $tmpDir == $thisDir"; + if ($tmpDir == $thisDir && $tmpLen > 0) { + return (1); + } + } + } + if ($funcDebug) echo "
      ??"; + + return (1); +} + + +//**************************************************************** +//鍑芥暟5 +// function insertLog($operDesc,$operTypeNo='0',$OperNo='0') +//鍑芥暟璇存槑: +// 璇ュ嚱鏁扮敤浜庤褰曟棩蹇� +// +//鍙橀噺璇存槑: +// $operDesc ->鎿嶄綔璇存槑 +// $operTypeNo ->鎿嶄綔绫诲瀷缂栧彿 +// $OperNo ->鎿嶄綔浠g爜 +// +//杩斿洖鍊硷細 +// 鏃� +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛�2003-04-09 +//淇敼璇存槑锛氱畝鍖栬緭鍏ュ弬鏁帮紝缂虹渷鎿嶄綔绫诲瀷涓簎nknown +//---------------------------------------------------------- + +function insertLog($operDesc, $operTypeNo = '0', $OperNo = '0') +{ + global $userInfo, $link, $pubConn; + $userName = $userInfo['ID']; + $operDesc = isset($operDesc) ? stripslashes($operDesc) : ''; //瑙g爜 + $operDesc = addslashes($operDesc); //瑙g爜 + + $insertLogSql = "INSERT INTO sysOperLog + (operTypeNo,OperNo,remark,userName,datetime) + VALUES + ('$operTypeNo','$OperNo','$operDesc','$userName',CURRENT_TIMESTAMP) + "; + //echo "$insertLogSql"; + $result = mysqli_query($pubConn, $insertLogSql); + //echo mysqli_error($pubConn); + if ($result < 0) { + echo "Error:Insert the log failed"; + } +} + + +//**************************************************************** +//鍑芥暟6 +// change_percent($num) +//鍑芥暟璇存槑: +// 璇ュ嚱鏁扮敤浜庢妸涓や釜鏁扮浉闄ゅ悗寰楀埌鐨勫皬鏁板彉涓虹簿纭埌鐧惧垎浣嶇殑鐧惧垎鏁� +// 濡傛妸0.91233456790鍙樹负91.23% +// +//鍙橀噺璇存槑: +// $num <= 1 +// +//杩斿洖鍊硷細 +// 涓�涓甫鐧惧垎鍙风殑瀛楃 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function change_percent($num) +{ + if ($num >= 1) { + $num = 100; + } else { + $num = $num * 1000000; + $num = round($num); + $num = $num / 10000; + } + $string = $num . '%'; + return ($string); +} + +//**************************************************************** +//鍑芥暟7 +// omc_keep_length($value,$add_value='0',$length='2',$position='1') +//鍑芥暟璇存槑: +// 璇ュ嚱鏁扮敤浜庡湪瀛楃涓�$value宸﹁竟娣�$add_value,鐩村埌琛ヨ冻鎵�闇�浣嶆暟$length +// 渚嬪:omc_keep_length(2,0,2)鍙樹负02 +// 甯哥敤浜庤幏鍙栫郴缁熺紪鍙枫�� +// +//鍙橀噺璇存槑: +// $value 闇�瑕佽ˉ瓒充綅鏁扮殑瀛楃 +// $add_value 闇�瑕佺敤浠�涔堝幓琛ヨ冻浣嶆暟锛岄粯璁や负'0' +// $length 闇�瑕佽ˉ瓒冲埌澶氬皯浣嶏紝榛樿涓�'2'绯荤粺缂栧彿鐨勯暱搴� +// +//杩斿洖鍊硷細 +// 琚ˉ瓒充綅鏁扮殑瀛楃涓� +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_keep_length($value, $add_value = '0', $length = '2', $position = '1') +{ + + while (strlen($value) < $length) { + if ($position) + $value = $add_value . $value; + else + $value = $value . $add_value; + + } + //echo "
      value=$value"; + return ($value); +} + + +//**************************************************************** +//鍑芥暟8 +// omc_table_name($sys_type,$table_type) +//鍑芥暟璇存槑: +// 璇ュ嚱鏁伴�氳繃$sys_type,$table_type鐢熸垚璇ョ郴缁熺殑鍚勭鐩稿叧琛ㄥ悕 +// 鏍规嵁$sys_id纭畾绯荤粺缂栧彿 +// 鏍规嵁$table_type纭畾瑕佽繑鍥炵殑琛ㄥ悕锛� +// 1銆乧sta-h -->(姣忓皬鏃�)璇濆姟缁熻琛� +// 2銆乧sta-q -->(姣�15鍒嗛挓)璇濆姟缁熻琛� +// +// +// +//鍙橀噺璇存槑: +// $sys_type 闇�瑕佽幏鍙栬〃鍚嶇殑绯荤粺 +// $table_type 璇ヨ〃鍚嶇殑绫诲瀷瀛楃涓� +// +//杩斿洖鍊硷細 +// 鎵�闇�鐨勮〃鍚嶅瓧绗︿覆 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_table_name($sys_type, $table_type) +{ + switch ($table_type) { + case 'csta-h': + $sys_type = strtolower($sys_type); + $table_name = $sys_type . 'Sum'; + break; + case 'csta-q': + $sys_type = strtolower($sys_type); + $table_name = $sys_type . 'Detail'; + break; + default: + echo "
      database's table name can not be maked,please check table type"; + break; + } + if ($table_name) { + return ($table_name); + } else { + exit(); + } +} + + +//**************************************************************** +//鍑芥暟9 +// omc_sys_type2code($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺畝鍐欒幏鍙栫郴缁熺紪鍙凤紝閫氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// 渚�:omc_sys_type2code(TS) = '04' +// +//鍙橀噺璇存槑: +// $sys_type +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺缂栧彿 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_sys_type2code($sysTypeName) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT sysTypeNo FROM $sysconf_table WHERE sysTypeName = '$sysTypeName'"; + //echo "
      $sel_sql"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + //echo "
      result_rows[sysTypeNo]=$result_rows[sysTypeNo]"; + return ($result_rows[sysTypeNo]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this device's code by omc_sys_type2code($sysTypeName)"; + return (-1); + } +} + + +//**************************************************************** +//鍑芥暟10 +// omc_sys_code2type($sys_code) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺紪鍙疯幏鍙栫郴缁熺畝鍐欙紝閫氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_code +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺绠�鍐� +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function omc_sys_code2type($sysTypeNo) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT sysTypeName FROM $sysconf_table WHERE sysTypeNo = '$sysTypeNo'"; + //echo "$sel_sql"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[sysTypeName]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this device's code by omc_sys_code2type($sysTypeNo)"; + return (-1); + } + +} + + +//**************************************************************** +//鍑芥暟11 +// get_subsys_total($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺被鍨嬭幏鍙栫郴缁熸瘡涓郴缁熺殑瀛愮郴缁熸�绘暟锛岄�氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_type:绯荤粺绫诲瀷 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺瀛愮郴缁熶釜鏁� +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function get_subsys_total($sys_type) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT maxSubsysNum FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[maxSubsysNum]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this system's subsystem quantity by get_subsys_total($sys_type)"; + return (-1); + } +} + +//**************************************************************** +//鍑芥暟12 +// get_e1_total($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺被鍨嬭幏鍙栫郴缁熸瘡涓郴缁熺殑e1鎬绘暟锛岄�氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_type:绯荤粺绫诲瀷 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺瀛愮郴缁熶釜鏁� +// 澶辫触: -1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function get_e1_total($sys_type) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT maxE1Num FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + //echo "
      sel_sql=$sel_sql"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[maxE1Num]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this system's e1 quantity by get_e1_total($sys_type)"; + return (-1); + } +} + +//**************************************************************** +//鍑芥暟13 +// get_sys_total($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺被鍨嬭幏鍙栫郴缁熺郴缁熸�绘暟锛岄�氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_type:绯荤粺绫诲瀷 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺鎬绘暟 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� 2002-5-14 +//淇敼璇存槑锛� 琛ㄥ悕銆佸瓧娈垫湁鍙� +//---------------------------------------------------------- +function get_sys_total($sys_type) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT maxSysNum FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + //echo "
      sel_sql=$sel_sql"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[maxSysNum]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this system's system quantity by get_sys_total($sys_type)"; + return (-1); + } +} + +//**************************************************************** +//鍑芥暟14 +// get_sys_offset($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺被鍨嬭幏鍙栬绫荤郴缁熺殑椤哄簭缂栧彿offset锛岄�氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_type :绯荤粺绫诲瀷 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺椤哄簭缂栧彿 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function get_sys_offset($sys_type) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT ledOffset FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[0]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this system's offset by get_sys_offset($sys_type)"; + return (-1); + } + +} + +//**************************************************************** +//鍑芥暟15 +// omc_sys_id_info($sys_id,$info_type) +//鍑芥暟璇存槑: +// 璇ュ嚱鏁伴�氳繃$sys_id鐨勫垎鏋愶紝鍙栧緱鐩稿簲淇℃伅 +// 渚嬶細鐢� "TS00_01" 鍙緱绯荤粺缂栧彿涓�"00" +// +//鍙橀噺璇存槑: +// 鍙傛暟$info_type瀵瑰簲瑕佸彇寰楃殑淇℃伅 +// sys_type -->绯荤粺绫诲瀷 +// sys_num -->绯荤粺缂栧彿 +// subsys_num -->瀛愮郴缁熺紪鍙� +// led_num -->led offset +// +//杩斿洖鍊硷細 +// 鎴愬姛: 瑕佸彇寰楃殑淇℃伅 +// 澶辫触: -1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_sys_id_info($sys_id, $info_type) +{ + global $sysconf_table, $omc_db; + $db = $omc_db; + $pieces = explode('_', $sys_id); + $sys_type = $pieces[0]; + $sys_num = $pieces[1]; + $subsys_num = $pieces[2]; + //echo "
      sys_type=$sys_type"; + + switch ($info_type) { + case 'sys_type': + $info = $sys_type; + break; + case 'sys_num': + $info = $sys_num; + break; + case 'subsys_num': + $info = $subsys_num; + break; + case 'led_num': + $sysTypeNo = omc_sys_type2code($sys_type); + $ledSql = " SELECT ledOffset FROM $sysconf_table WHERE sysTypeNo = '$sysTypeNo' "; + $ledRes = @mysqli_query($pubConn, $ledSql); + $ledRow = @mysqli_fetch_array($ledRes); + $info = $ledRow[0]; + break; + default: + echo "
      the $sys_id information can not be get,please check parameter: info_typ!"; + break; + } + if ($info) { + return ($info); + } else { + return (0); + } +} + +//**************************************************************** +//鍑芥暟16 +// omc_uninstall_device($sys_id) +//鍑芥暟璇存槑: +// 鍒犻櫎绯荤粺 +// +//鍙橀噺璇存槑: +// 鍒犻櫎绯荤粺鐨勭郴缁熺紪鍙�$sys_id +// +//杩斿洖鍊硷細 +// 鎴愬姛: 1 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛�2002-5-17 +//淇敼璇存槑锛� +//---------------------------------------------------------------------------------- + +function omc_uninstall_device($sys_id) +{ + global $omc_db, $sysStat_table; + //echo "
      sys_id=$sys_id"; + $sysType = omc_sys_id_info($sys_id, sys_type); + $sysTypeNo = omc_sys_type2code($sysType); + $sysNo = omc_sys_id_info($sys_id, sys_num); + $subSysNo = omc_sys_id_info($sys_id, subsys_num); + $del_sql = "DELETE FROM $sysStat_table WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo'"; + + if ($sys_id = 'all') { + $del_sql = " DELETE FROM $sysStat_table "; + } + //echo "
      del_sql=$del_sql"; + $result = mysqli_query($pubConn, $del_sql); + //echo "
      result=$result"; + if ($result) { + return (1); + } else { + return (-1); + } + +} + +//**************************************************************** +//鍑芥暟17 +// omc_chk_load_in($file_info,$remark_style) +//鍑芥暟璇存槑: +// 瀵煎叆鏂囦欢妫�鏌ュ嚱鏁� +// 鏍规嵁闇�瀵煎叆鏂囦欢鐨勪俊鎭紙鍖呮嫭鏂囦欢鍚嶏紝闇�瀵煎叆鐨勬湇鍔″櫒锛屾暟鎹簱锛岃〃锛夛紝瀵煎叆鏂囦欢鐨勬敞閲婁俊鎭紙鎸囧嚭璇ユ枃鐨勫瓧娈靛悕鍒楄〃鎵�鍦ㄨ锛� +// 鏂规硶锛氫竴涓�姣旇緝鏁版嵁搴撲腑琛ㄧ殑瀛楁鍜屾敞閲婁腑鍒楀嚭鐨勫瓧娈碉紝濡傛灉浜掔浉鍖归厤锛岃繑鍥炴垚鍔� +// +//鍙橀噺璇存槑: +// $file_info 鎵�闇�瀵煎叆鏂囦欢鐨勪俊鎭暟缁�,鍖呮嫭: +// $file_info[db] 鎵�闇�瀵煎叆鐨勬暟鎹簱鍚� +// $file_info[table] 鎵�闇�瀵煎叆鐨勬暟鎹簱涓殑琛ㄥ悕 +// $file_info[name] 鎵�闇�瀵煎叆鏁版嵁搴撶殑鏂囦欢鍚� +// $remark_style 鏁版嵁鏂囦欢娉ㄩ噴椋庢牸 +// $remark_style[fields_seek] 鏂囦欢寮�澶达紝闇�瑕佸拷鐣ョ殑琛屾暟锛屼竴鑸负1 +// $remark_style[sign] 娉ㄩ噴绗︼紝涓�鑸负'#' +// $remark_style[fields_by] 瀛楁鍒嗗壊绗︼紝涓�鑸负';' + +// +//杩斿洖鍊硷細 +// 鎴愬姛: 1 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function omc_chk_load_in($file_info, $remark_style) +{ + //-------------1.get database's information--------------- + global $link; + $field_sql = "SELECT * FROM {$file_info[table]} LIMIT 0,1"; + //echo "
      field_sql=$field_sql"; + $field_result = mysqli_query($pubConn, $field_sql); + + //-------------check the data file's fields------------- + //echo "
      name={$file_info[name]}"; + $fp = fopen($file_info[name], r); + for ($i = 1; $i <= $remark_style[fields_seek]; $i++) { + $field_line = fgets($fp, 4096); //4096 is a constant + } + //echo "
      field_line=$field_line"; + if (substr($field_line, 0, 1) != $remark_style[sign]) { + echo "the remark sign not exist"; //娉ㄩ噴绗﹂敊璇� + return (-1); + } else { + //echo "
      field_line=$field_line"; + $file_fields_line = substr($field_line, 1); + //echo "
      file_fields_line=$file_fields_line"; + $file_fields_rows = explode($remark_style[fields_by], $file_fields_line); + $fields_num = mysql_num_fields($field_result); + //echo "
      fields_num=$fields_num"; + for ($i = 0; $i < $fields_num; $i++) { + $this_field = mysql_field_name($field_result, $i); + //echo "
      $file_fields_rows[$i] -- $this_field"; + if ($file_fields_rows[$i] != $this_field && $this_field != '') { + echo "
      error: fields is not matching.";//瀛楁鍚嶄笉鍖归厤 + return (-1); + } + } + fclose($fp); + return (1); + } +} + + +//******************************************************************* +//鍑芥暟18 +// Get the content of $table as a CSV output. +// $sep contains the separation string. +// After every row, a custom callback function $handler gets called. +// $handler must accept one parameter ($sql_insert); + +function get_table_csv($server_link, $db_name, $table, $where, $handler) +{ + global $separator; + + $sep = $separator; + if (strlen($where) > 1) { + $sel_sql = "SELECT * FROM $table $where"; + $sel_sql = stripslashes($sel_sql); + } else { + $sel_sql = "SELECT * FROM $table "; + } + //echo "
      sel_sql=$sel_sql
      "; + $result = mysqli_query($pubConn, $sel_sql, $server_link); + if ($result < 0) { + echo "$sel_sql /n"; + echo mysqli_error($pubConn); + exit(); + } + + /* + //杈撳嚭瀛楁鍚� + $schema_insert = "#"; + for($j=0; $jschema_insert=$schema_insert
      "; + } + $handler(trim($schema_insert));//鎸夋煇绉嶆柟寮忓鐞嗗悗,杈撳嚭涓�琛� + */ + + $i = 0; + while ($row = mysqli_fetch_row($result)) { + set_time_limit(60); // HaRa + $schema_insert = ""; + for ($j = 0; $j < mysql_num_fields($result); $j++) { + if (!isset($row[$j])) + $schema_insert .= "NULL" . $sep; + elseif ($row[$j] != "") + $schema_insert .= "$row[$j]" . $sep; + else + $schema_insert .= "" . $sep; + } + $schema_insert = str_replace($sep . "$", "", $schema_insert); + $handler(trim($schema_insert)); + $i++; + } + return (true); +} + + +//**************************************************************** +//鍑芥暟19 +// omc_die($warning_words) +//鍑芥暟璇存槑: +// 杈撳嚭閿欒淇℃伅,閫�鍑� +// +//鍙橀噺璇存槑: +// $warning_words 璀﹀憡璇存槑 +// +//杩斿洖鍊硷細 +// 鏃� +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function omc_die($warning_words) +{ + echo "
      $warning_words"; + exit(); +} + + +//**************************************************************** +//鍑芥暟20 +// change2point($number) +//鍑芥暟璇存槑: +// 灏嗚鏁板瓧鎸変繚鐣欏皬鏁扮偣鍚庝袱浣嶇殑瑙勫垯杞崲锛屽父鐢ㄤ簬璐у竵鐨勭粺涓�鏍囩ず +// +//鍙橀噺璇存槑: +// $number ->鎵�闇�杞崲鐨勬暟瀛� +// +//杩斿洖鍊硷細 +// 鎴愬姛: 杩斿洖杞崲鍚庣殑瀛楃 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛�2003-07-10 +//淇敼璇存槑锛氬共浜嗚牏浜嬶紝涓�鍙ヨ瘽鐨勪簨锛岀敤浜嗕竴涓嚱鏁般�� +//---------------------------------------------------------- + +function change2point($number) +{ + /* + $num = explode(".",$number); + $num_1 = $num[0]; + $num_2 = substr($num[1],0,2); + if(strlen($num_2) < 2){ + if(strlen($num_2) == 0){ + $num_2 = '00'; + }else{ + $num_2 = $num_2.'0'; + } + } + if($num_1==0 && $num_2 == 0){ + $number = 0; + }else{ + $number = $num_1.'.'.$num_2; + } + */ + $number = sprintf("%01.2f", $number); + return ($number); +} + +//**************************************************************** +//鍑芥暟21 +// Second2format($number) +//鍑芥暟璇存槑: +// 鎶婄鏁板彉鎴愭爣鍑嗘椂闂存樉绀哄锛�17绉�->00:00:17 +// +//鍙橀噺璇存槑: +// $number 绉掓暟 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 杩斿洖鏍囧噯鏃堕棿 +// 澶辫触: 杩斿洖0 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +// +function Second2format($number) +{ + if ($number > 0) { + $number_h = floor($number / 3600); + if (strlen($number_h) < 2) { + $number_h = "0" . $number_h; + } + $number_ms = $number % 3600; + $number_m = floor($number_ms / 60); + if (strlen($number_m) < 2) { + $number_m = "0" . $number_m; + } + $number_s = $number_ms % 60; + if (strlen($number_s) < 2) { + $number_s = "0" . $number_s; + } + $format = $number_h . ":" . $number_m . ":" . $number_s; + return ($format); + } else { + return (0); + } +} + +//**************************************************************** +//鍑芥暟22 +// getDetailedStatus($sysTypeNo,$sysNo,$subSysNo,$getType) +// 寰楀埌璇︾粏鐘舵�佷俊鎭垨鍒锋柊鏃堕棿 +// +//鍙橀噺璇存槑: +// $sysTypeNo绯荤粺绫诲瀷缂栧彿 +// $sysNo绯荤粺缂栧彿 +// $subSysNo瀛愮郴缁熺紪鍙� +// $getType璇︾粏鐘舵��(status)鎴栧埛鏂版椂闂�(time) +// +//杩斿洖鍊硷細 +// 鎴愬姛: 杩斿洖鐘舵�佹垨鏃堕棿 +// 澶辫触: 杩斿洖-1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +// +function getDetailedStatus($sysTypeNo, $sysNo, $subSysNo, $getType = 'time') +{ + global $omc_db, $sysStat_table; + $db = $omc_db; + $DEBUG = 0; + $sel_mes_sql = "SELECT detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + "; + if ($DEBUG) echo "
      sel_mes_sql=$sel_mes_sql"; + $sel_mes_res = mysqli_query($pubConn, $sel_mes_sql); + $sel_mes_row = @mysqli_fetch_array($sel_mes_res); + if ($getType == 'Time') { + $value = $sel_mes_row[detailStat]; + } else { + $value = $sel_mes_row[updateTime]; + } + if ($DEBUG) echo "
      value=$value"; + if (!$sel_mes_row) { + return (-1); + } else { + return ($value); + } +} + + +//**************************************************************** +//鍑芥暟23 omc_get_sysAlias($sysTypeNo,$sysNo,$subSysNo) +// +//鍔熻兘璇存槑:鏍规嵁鎸囧畾绯荤粺缂栧彿鑾峰彇绯荤粺鍒悕 +// +//鍙橀噺璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺鍒悕瀛楃涓� +// 澶辫触:-1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_get_sysAlias($sysTypeNo, $sysNo, $subSysNo) +{ + $sysAliasSql = "SELECT sysAlias + FROM sysInfo + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo'AND subSysNo='$subSysNo' + ORDER BY sysTypeNo,sysNo,subSysNo + "; + $sysAliasResult = mysqli_query($pubConn, $sysAliasSql); + echo mysqli_error($pubConn); + $sysAliasRows = @mysqli_fetch_array($sysAliasResult); + $sysAlias = $sysAliasRows[sysAlias]; + if (strlen($sysAlias) > 0) { + return ($sysAlias); + } else { + return (-1); + } +} + + +//**************************************************************** +//鍑� 鏁� 鍚�: omcProgressBar($allNum,$doneNum) +//鍔熻兘璇存槑: 鏄剧ず杩涘害鏉� +//鍙橀噺璇存槑: $allNum鎬绘暟,$doneNum宸插畬鎴愮殑鏁扮洰 +//杩� 鍥� 鍊�: 鏃� +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function omcProgressBar($allNum, $doneNum) +{ + if ($allNum > 0) { + if ($doneNum >= $allNum) { + $quoNum = 100; + } else { + $quoNum = $doneNum / $allNum * 100; + $quoNum = round($quoNum); + } + } else { + echo "omcProgressBar() Error:allNum cannot < 0!"; + exit(); + } + $big_width = 320; + $border = 10; + $lit_width = $big_width - 2 * $border; + $height = 10; + echo "
      "; + echo "\n"; + echo "
      "; + echo "$strProgressIsShowedAsFollowing"; + echo "
      "; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n

      "; + echo "\n$quoNum%"; + echo "\n

      "; + $lineNum = $quoNum * 3; + echo "\n"; + echo "\n
      "; + //echo "\n
      "; +} + + +//**************************************************************** +//鍑� 鏁� 鍚�: sysCommSend($sysId,$commType,$objIdStr,$selectedSysId=-1) +//鍔熻兘璇存槑: 绯荤粺鍙傛暟缁存姢鍙戦�佸懡浠� +//鍙橀噺璇存槑: 鐣� +//杩� 鍥� 鍊�: +// 鎴愬姛: 鍛戒护缂栧彿瀛楃涓� +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛歝uiticun +//鏃堕棿锛�2005-7-13 +//淇敼璇存槑锛歝heck the exist command num in the buffer +//---------------------------------------------------------- +function sysCommSend($sysId, $commType, $objIdStr, $selectedSysId = -1, $selectedDPC = 0) +{ + global $OMC_server,$pubConn; + $DEBUG = 0; + $pubDb = 'OMC_PUB'; + $commTable = 'parameterComm'; + $nGetComm = 0; + $nSetComm = 3; + + $nSubSysParam = 0; + $nGlobalSubSysParam = 1; + $nGlobalSysParam = 2; + + $sysIdArr = explode('_', $sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], 'OBJ_'.$sysTypeNo); + + //insert the operation log into the database + $logStr = ""; + if ($commType == 0) + $logStr .= "Get "; + else if ($commType == 3) + $logStr .= "Set "; + //=====get the LevelWhere + $levelArr = explode('.', $objIdStr); + for ($j = 0; $j < sizeof($levelArr); $j++) { + $levelNo = $j + 1; + ${"level_$levelNo"} = $levelArr[$j]; + if ($DEBUG) echo "
      levelArr[$j]={$levelArr[$j]}"; + if ($j == 0) { + $levelWhere = "level_$levelNo='${"level_$levelNo"}'"; + } else { + $levelWhere .= " AND level_$levelNo='${"level_$levelNo"}'"; + } + } + $temp = $levelWhere; + + $database = "OBJ_" . $sysTypeNo; + $ssql = "select name_2 from paramConf where $temp "; + $resultt = @mysqli_query($objConn, $ssql); + $rowss = @mysqli_fetch_array($resultt); + //==get the parameter name + $p_name = $rowss[name_2]; + + $p_name = str_replace("Entry", "", $p_name); + $sysName = getSystemNameBySysTypeNo($sysTypeNo); + $logStr .= "$sysName $p_name's parameter"; + + $logStr .= $p_name; + + insertLog($logStr); + //end insert operation log + + if ($sysNo == '99') { + $paramType = $nGlobalSysParam; + } else if ($subSysNo == '99') { + $paramType = $nGlobalSubSysParam; + } else { + $paramType = $nSubSysParam; + } + + if ($selectedSysId != -1) { + $selectedSysIdArr = explode('_', $selectedSysId); + $selectedSysTypeNo = $selectedSysIdArr[0]; + $selectedSysNo = $selectedSysIdArr[1]; + $selectedSubSysNo = $selectedSysIdArr[2]; + } + if ($DEBUG) echo "
      selectedSysId=$selectedSysId"; + if ($DEBUG) echo "
      selectedSysNo=$selectedSysNo"; + if ($DEBUG) echo "
      selectedSubSysNo=$selectedSubSysNo"; + + //step 1: delete overtime and imcompetent command , check the exist command num + $overTime = date("Y-m-d H:i:s", mktime(date("H"), date("i") - 1, date("s"), date("m"), date("d"), date("Y"))); + $delSql = "DELETE FROM $commTable + WHERE commState ='0' OR commState ='3' OR sendTime < '$overTime' + "; + if ($DEBUG) echo "
      delete command sql = $delSql"; + mysqli_query($pubConn, $delSql); + echo mysqli_error($pubConn); + + //check the exist command num + $chkSql = "SELECT commId FROM $commTable"; + if ($DEBUG) echo "
      check exist commands sql = $chkSql"; + $chkResult = mysqli_query($pubConn, $chkSql); + echo mysqli_error($pubConn); + $existNum = @mysqli_num_rows($chkResult); + + //step 2: check the command(涓嶈兘鍚屾椂鎿嶄綔鍚屼竴涓瓙绯荤粺锛屼篃涓嶈兘鍚屾椂璇诲悓涓�涓郴缁熺殑涓嶅悓瀛愮郴缁熺殑鍏叡鍙傛暟) + if (($paramType != $nSubSysParam) && ($commType == $nGetComm)) { //0=Get,2=response,3=Set + if ($selectedSysId == -1) { + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND commType ='$nGetComm' + "; + } else { + //閫夋嫨鎸囧畾瀛愮郴缁� + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$selectedSysTypeNo' AND sysNo='$selectedSysNo' + AND subSysNo='$selectedSubSysNo' AND commType ='$nGetComm' + "; + } + } else { + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + } + if ($DEBUG) echo "
      check command sql = $chkSql"; + $chkResult = mysqli_query($pubConn, $chkSql); + echo mysqli_error($pubConn); + $rowsNum = @mysqli_num_rows($chkResult); + if ($rowsNum > 0) { + echo ""; + return (-1); + } + + //step 3:insert commands into command table + if (($paramType != $nSubSysParam) && ($commType == $nSetComm)) { //鍐欏叕鍏卞弬鏁� + //get maxSubSysNum + //$selSql="SELECT maxSysNum, maxSubSysNum FROM sysConf WHERE sysTypeNo = '$sysTypeNo'"; + //$selResult=mysqli_query($pubConn,$selSql); + //$selRows=mysqli_fetch_array($selResult); + //echo mysqli_error($pubConn); + //$maxSysNum = $selRows[maxSysNum]; + //$maxSubSysNum = $selRows[maxSubSysNum]; + if ($selectedSysId == -1) { + if ($paramType == $nGlobalSysParam) { + if ($sysTypeNo[0] == '2') { + if ($sysTypeNo == '222' || $sysTypeNo == '223') {//MTP3,SCCP + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo!='8' AND sysNo!='11' + AND DPC = '$selectedDPC' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + AND DPC = '$selectedDPC' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + } else { + //閫夋嫨鎸囧畾瀛愮郴缁� + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$selectedSysTypeNo' + AND sysNo ='$selectedSysNo' + AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC + "; + } + if ($DEBUG) { + echo "
      selSql=$selSql"; + exit(); + } + $selResult = mysqli_query($pubConn, $selSql); + $selRowsNum = mysqli_num_rows($selResult); + + if ($selRowsNum + $existNum > 64) { + echo ""; + return (-1); + } + + if ($selRowsNum > 0) { + while ($selRows = mysqli_fetch_array($selResult)) { + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + $sendSql = "INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','','1',CURRENT_TIMESTAMP) + "; + if ($DEBUG) echo "
      send command sql = $sendSql"; + $sendResult = mysqli_query($pubConn, $sendSql); + echo mysqli_error($pubConn); + } + } else { + echo "
      Error:This canot get this system's IP"; + return (-1); + } + //鍐橵PS 鎴朠CR 鍙傛暟 + /* + }elseif(($sysTypeNo == 120 || $sysTypeNo == 130 || $sysTypeNo == 140) && ($commType == $nSetComm)){ + $tmpLevelOne = $sysNo + 1; + $tmpLevelTwo = $subSysNo + 1; + switch($sysTypeNo){ + case 120: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.7.2.1'; + break; + case 130: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.6.2.1'; + break; + case 140: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.8.2.1'; + break; + default: echo "error sysTypeNo"; + exit(); + } + if($DEBUG) echo"
      strstr($objIdStr, $sysParamOidPrefix)"; + + if(strstr($objIdStr, $sysParamOidPrefix)){//鍐橵PS 鎴朠CR鐨勫叕鍏卞弬鏁� + //get maxSubSysNum + $selSql="SELECT maxSubSysNum FROM sysConf WHERE sysTypeNo = '$sysTypeNo'"; + $selResult=mysqli_query($pubConn,$selSql); + $selRows=mysqli_fetch_array($selResult); + echo mysqli_error($pubConn); + $maxSubSysNum = $selRows[maxSubSysNum]; + //get alive system + $selSql="SELECT DISTINCT subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + $selResult = mysqli_query($pubConn,$selSql); + $selRowsNum = mysqli_num_rows($selResult); + if($selRowsNum > 0){ + while($selRows = mysqli_fetch_array($selResult)){ + $subSysNo = $selRows[subSysNo]; + $tmpLevelOne = $sysNo + 1; + $tmpLevelTwo = $subSysNo + 1; + $tmpOidLen = strlen($objIdStr); + $tmpSubfixOid = substr($objIdStr,3,$tmpOidLen); + $objIdStr = $tmpLevelOne.'.'.$tmpLevelTwo.$tmpSubfixOid; + if($DEBUG) echo"
      VPS OR PCR'S system parameter Oid:$objIdStr"; + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','0','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + }else{ + echo "
      Error:This canot get this system's IP"; + return(-1); + } + }else{//鍐橵PS锛孭CR瀛愮郴缁熷弬鏁� + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','0','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + */ + } else {//璇荤郴缁�/瀛愮郴缁熷弬鏁版垨鍐欏瓙绯荤粺鍙傛暟 + if ($paramType != $nSubSysParam) {//璇诲叕鍏卞弬鏁� + if ($selectedSysId == -1) { + //get baseStat 0=uninstalled, 1=nomal, 2=warning, 3=error + //鍏堟寜鐘舵�佹帓搴忥紝鍐嶆寜绯荤粺缂栧彿,瀛愮郴缁熺紪鍙锋帓搴忥紝鍚岀鐘舵�佷紭鍏堥�夋嫨缂栧彿灏忕殑 + if ($paramType == $nGlobalSysParam) { + /*if($sysTypeNo == '222' || $sysTypeNo == '223'){//MTP3,SCCP + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + AND DPC = '$selectedDPC' + ORDER BY baseStat DESC,updateTime DESC,sysNo DESC,subSysNo + "; + }else{ + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + }*/ + + if ($sysTypeNo[0] == '2') {//Platform + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + ORDER BY baseStat DESC,sysNo DESC,subSysNo,updateTime DESC + "; + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$sysNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + } else { + //閫夋嫨鎸囧畾瀛愮郴缁� + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$selectedSysNo' AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC,updateTime DESC + "; + } + + $selResult = mysqli_query($pubConn, $selSql); + if ($DEBUG) { + echo "
      get system info sql = $selSql"; + } + echo mysqli_error($pubConn); + if (@mysqli_num_rows($selResult) > 0) { + $selRows = @mysqli_fetch_array($selResult); + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + } else { + echo ""; + return (-1); + } + } + // special for sccp and mtp3 add by lilong 2004-6-11 + if ($selectedSysId == -1) { + $DEBUG = 0; + if ($DEBUG) echo "sysTypeNo = $sysTypeNo, sysNo = $sysNo
      "; + if (($sysTypeNo == '222' || $sysTypeNo == '223') && ('8' != $sysNo) && ('11' != $sysNo)) {//MTP3,SCCP + $selSql_1 = "SELECT sysNo,subsysNo FROM sysInfo + WHERE baseStat=1 AND sysTypeNo=320"; + if ($DEBUG) echo "selSql_1 = $selSql_1
      "; + $selRes_1 = mysqli_query($pubConn, $selSql_1); + if (mysqli_num_rows($selRes_1) > 0) { + $selRows_1 = @mysqli_fetch_array($selRes_1); + $sysNo = 9; + $subSysNo = $selRows_1[sysNo]; + } else { + $selSql_2 = "SELECT sysNo,subsysNo FROM sysInfo + WHERE baseStat=1 AND sysTypeNo=0"; + if ($DEBUG) echo "selSql_2 = $selSql_2
      "; + $selRes_2 = mysqli_query($pubConn, $selSql_2); + if (mysqli_num_rows($selRes_2) > 0) { + $selRows_2 = @mysqli_fetch_array($selRes_2); + $sysNo = 0; + $subSysNo = $selRows_2[subsysNo]; + } + } + } + if ($DEBUG) { + echo "sysNo=$sysNo, subSysNo=$subSysNo
      "; + exit(); + } + $DEBUG = 0; + //add end by lilong 2004-6-11 + } + + if (1 + $existNum > 64) { + echo ""; + return (-1); + } + + $sendSql = "INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','','1',CURRENT_TIMESTAMP) + "; + if ($DEBUG) echo "
      send command sql = $sendSql"; + $sendResult = mysqli_query($pubConn, $sendSql); + echo mysqli_error($pubConn); + } + + //step 4:Return commIdStr + if ($DEBUG) echo "
      if(($paramType != $nSubSysParam) && ($commType == $nSetComm))"; + if (($paramType != $nSubSysParam) && ($commType == $nSetComm)) { + if ($paramType == $nGlobalSysParam) { + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + } else { + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + } + /* + //鍐橵PS 鎴朠CR 鍙傛暟 + }elseif(($sysTypeNo == 120 || $sysTypeNo == 130 || $sysTypeNo == 140) && ($commType == $nSetComm)){ + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + */ + } else { + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo'"; + } + if ($DEBUG) echo "
      get command id sql = $selSql"; + $selResult = mysqli_query($pubConn, $selSql); + echo mysqli_error($pubConn); + $commIdStr = ''; + while ($selRows = mysqli_fetch_array($selResult)) { + $commIdStr .= $selRows[commId] . '-'; + } + if ($DEBUG) echo "
      commIdStr = $commIdStr"; + if ($DEBUG) exit(); + return ($commIdStr); +}//end of function sysSendComm() + +//**************************************************************** +//鍑� 鏁� 鍚�: setSysParamValue($sysId,$objIdStr,$instanceNo,$newValue) +//鍔熻兘璇存槑: 淇敼璁惧鍙傛暟鐨刬nitValue,涓哄彂閫佸懡浠ゅ仛鍑嗗 +//鍙橀噺璇存槑: 鐣� +//杩� 鍥� 鍊�: +// 鎴愬姛: 鍛戒护缂栧彿瀛楃涓� +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function setSysParamValue($sysId, $objIdStr, $instanceNo, $newValue) +{ + global $paramConf_table; + $DEBUG = 0; + + if ($DEBUG) echo "
      sysId=$sysId"; + $tmpSysIdArr = explode('_', $sysId); + $sysTypeNo = $tmpSysIdArr[0]; + $sysNo = $tmpSysIdArr[1]; + $subSysNo = $tmpSysIdArr[2]; + + $paramDb = 'OBJ_' . $sysTypeNo; + if ($DEBUG) echo "
      paramDb=$paramDb"; + //鑾峰彇鍙傛暟瀹氫箟琛ㄧ殑琛ㄥ悕锛屾牴鎹畂id鍙栧嚭鍙傛暟瀹氫箟 + $tmpObjArr = explode('.', $objIdStr); + $objWhereStr = ''; + for ($i = 0; $i < sizeof($tmpObjArr); $i++) { + $j = $i + 1; + $objWhereStr .= ' level_' . $j . "='{$tmpObjArr[$i]}' AND "; + } + $objWhereStr = substr($objWhereStr, 0, -5); //鏈�鍚庡浜嗕竴涓�' AND ',灏嗗叾鍘绘帀 + $getParamDefSql = "SELECT paramType FROM $paramConf_table WHERE $objWhereStr"; + if ($DEBUG) echo "
      $getParamDefSql"; + $getParamDefResult = mysqli_query($pubConn, $getParamDefSql); + echo mysqli_error($pubConn); + if (mysqli_num_rows($getParamDefResult) <= 0) { + echo "Cannot find this objId from paramConf"; + return (-1); + } + $getParamDefRows = mysqli_fetch_array($getParamDefResult); + $paramType = $getParamDefRows[paramType]; + + //鏍规嵁鍙傛暟绫诲瀷锛屾帹鍑哄弬鏁拌〃鐨勮〃鍚� + if ($paramType == 2) { + $paramTable = 'param_99'; + } else { + $paramTable = 'param_' . $sysNo; + } + if ($paramType != 0) { + $subSysNo = '99'; + } + + //淇敼瀵瑰簲鐨勫弬鏁板�� + $setParamValueSql = "UPDATE $paramTable + SET initValue='$newValue',readValue='' + WHERE subSysNo = '$subSysNo' AND instanceNo = '$instanceNo' + AND $objWhereStr + "; + if ($DEBUG) echo "
      $setParamValueSql
      "; + $setResult = mysqli_query($pubConn, $setParamValueSql); + echo mysqli_error($pubConn); + if ($setResult) { + return (1); + } else { + return (-1); + } +}//end of function setSysParamValue + +//**************************************************************** +//鍑� 鏁� 鍚�: getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName) +//鍔熻兘璇存槑: 鑾峰彇鎸囧畾鐨勮澶囧弬鏁� +//鍙橀噺璇存槑: 鐣� +//杩� 鍥� 鍊�: +// 鎴愬姛: 鍙傛暟鍊� +// 澶辫触: exit()閫�鍑� +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function getSysParamValue($sysId, $objIdStr, $instanceNo, $valueName) +{ + global $paramConf_table; + $DEBUG = 0; + + $tmpSysIdArr = explode('_', $sysId); + $sysTypeNo = $tmpSysIdArr[0]; + $sysNo = $tmpSysIdArr[1]; + $subSysNo = $tmpSysIdArr[2]; + + $paramDb = 'OBJ_' . $sysTypeNo; + //鑾峰彇鍙傛暟瀹氫箟琛ㄧ殑琛ㄥ悕锛屾牴鎹畂id鍙栧嚭鍙傛暟瀹氫箟 + $tmpObjArr = explode('.', $objIdStr); + $objWhereStr = ''; + for ($i = 0; $i < sizeof($tmpObjArr); $i++) { + $j = $i + 1; + $objWhereStr .= ' level_' . $j . "='{$tmpObjArr[$i]}' AND "; + } + $objWhereStr = substr($objWhereStr, 0, -5); //鏈�鍚庡浜嗕竴涓�' AND ',灏嗗叾鍘绘帀 + $getParamDefSql = "SELECT paramType FROM $paramConf_table WHERE $objWhereStr"; + if ($DEBUG) echo "
      $getParamDefSql"; + $getParamDefResult = mysqli_query($pubConn, $getParamDefSql); + echo mysqli_error($pubConn); + if (@mysqli_num_rows($getParamDefResult) <= 0) { + echo "Cannot find this objId from paramConf"; + return (-1); + } + $getParamDefRows = mysqli_fetch_array($getParamDefResult); + $paramType = $getParamDefRows[paramType]; + + //鏍规嵁鍙傛暟绫诲瀷锛屾帹鍑哄弬鏁拌〃鐨勮〃鍚� + if ($paramType == 2) { + $paramTable = 'param_99'; + } else { + $paramTable = 'param_' . $sysNo; + } + if ($paramType != 0) { + $subSysNo = '99'; + } + + //淇敼瀵瑰簲鐨勫弬鏁板�� + $getParamValueSql = "SELECT $valueName FROM $paramTable + WHERE subSysNo = '$subSysNo' AND instanceNo = '$instanceNo' + AND $objWhereStr + "; + if ($DEBUG) echo "
      $getParamValueSql
      "; + $getResult = mysqli_query($pubConn, $getParamValueSql); + echo mysqli_error($pubConn); + if (mysqli_num_rows($getResult) > 0) { + $paramRows = mysqli_fetch_array($getResult); + $paramValue = $paramRows[0]; + return ($paramValue); + } else { + return (-1); + } +}//end of function getSysParamValue + +//**************************************************************** +//鍑芥暟8 +// getMoneyPara() +//鍑芥暟璇存槑: +// 璇ュ嚱鏁伴�氳繃鏌ヨPPS绯荤粺閰嶇疆寰楀埌鏄剧ず鐨勮揣甯佸崟浣嶆槸鏈�灏忚揣甯佸崟浣嶇殑鍊嶆暟 +// +// +// +// +//鍙橀噺璇存槑: +// 鏃� +// +// +//杩斿洖鍊硷細 +// 鏄剧ず鐨勮揣甯佸崟浣嶆槸鏈�灏忚揣甯佸崟浣嶇殑鍊嶆暟 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function getMoneyPara() +{ + global $pubConn; + $getSql = " SELECT pubVarValue FROM omcPubVarConf WHERE pubVarName='pssCardMinCount'"; + $getRes = @mysqli_query($pubConn, $getSql); + $getRow = @mysqli_fetch_array($getRes); + echo mysqli_error($pubConn); + $multiple = $getRow[pubVarValue]; + /* + if($multiple < 0.1) + { + $multiple = 100; + } + elseif($multiple < 1) + { + $multiple = 10; + } + */ + return ($multiple); +} + +function getMoneyPara_forPpsReport() +{ + global $omc_db; + $getSql = " SELECT pubVarValue FROM omcPubVarConf WHERE pubVarName='currency_decimal'"; + $getRes = @mysqli_query($pubConn, $getSql); + $getRow = @mysqli_fetch_array($getRes); + echo mysqli_error($pubConn); + $multiple = $getRow[pubVarValue]; + /* + if($multiple < 0.1) + { + $multiple = 100; + } + elseif($multiple < 1) + { + $multiple = 10; + } + */ + return ($multiple); +} + +//**************************************************************** +//鍑芥暟: +// getBitValue($hexStr,$offset) +//鍔熻兘璇存槑: +//浠庝竴涓崄鍏繘鍒跺瓧绗︿覆$hexStr涓彇鍑烘寚瀹氫綅缃�$offset鐨勪簩杩涘埗瀛楃 +//渚�: getBitValue('F1','0.1')=1 +// getBitValue('F1','1.0')=1 +// getBitValue('F1','1.1')=0 +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鍙栧嚭鐨勪簩杩涘埗瀛楃 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function getBitValue($hexStr, $offset) +{ + $DEBUG = 0; + if ($DEBUG) echo "
      hexStr=$hexStr"; + if ($DEBUG) echo "
      offset=$offset"; + $tmpArr = explode('-', $offset); + $tmpBgnArr = explode('.', $tmpArr[0]); + $bgnByteOffset = $tmpBgnArr[0]; + $bgnBitOffset = $tmpBgnArr[1]; + if ($DEBUG) echo "
      bgnByteOffset=$bgnByteOffset"; + if ($DEBUG) echo "
      bgnBitOffset=$bgnBitOffset"; + if (sizeof($tmpArr) > 1 && $tmpArr[0] != $tmpArr[1]) { + $tmpEndArr = explode('.', $tmpArr[1]); + $endByteOffset = $tmpEndArr[0]; + $endBitOffset = $tmpEndArr[1]; + if ($bgnBitOffset == 0 && $endBitOffset == 7) { + $byteOffset = $endByteOffset - $bgnByteOffset + 1; + $selByte = substr($hexStr, $bgnByteOffset * 2, $byteOffset * 2); + return ($selByte); + } else { + $tmpByte_1 = substr($hexStr, 0, $bgnByteOffset * 2); + $tmpByte_2 = substr($hexStr, ($endByteOffset + 1) * 2); + $selByte = substr($hexStr, $bgnByteOffset * 2, ($endByteOffset - $bgnByteOffset + 1) * 2); + if (strlen($selByte) > 2) {//涓嶈兘璺╞yte + return (-1); + } + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpDec = HexDec($selByte); + $binStr = DecBin($tmpDec); + for ($i = strlen($binStr); $i < strlen($selByte) * 4; $i++) { + $binStr = '0' . $binStr; + } + if ($DEBUG) echo "
      binStr=$binStr"; + if ($bgnBitOffset == 0) { + $selBit = substr($binStr, -($endBitOffset + 1)); + } else { + $selBit = substr($binStr, -($endBitOffset + 1), ($endBitOffset - $bgnBitOffset + 1)); + } + + return ($selBit); + } + } else { + if ($bgnByteOffset >= ceil(strlen($hexStr) / 2)) { + return (0); + } else { + $selByte = substr($hexStr, $bgnByteOffset * 2, 2); + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpDec = HexDec($selByte); + $binStr = DecBin($tmpDec); + if ($DEBUG) echo "
      binStr=$binStr"; + $binStrLen = strlen($binStr); + if ($bgnBitOffset >= $binStrLen) { + return (0); + } else { + $tmpLen = 0 - $bgnBitOffset - 1; + $selBit = substr($binStr, $tmpLen, 1); + if ($DEBUG) echo "
      selBit=$selBit=substr($binStr,$tmpLen,1)"; + return ($selBit); + } + } + } +} + +//**************************************************************** +//鍑芥暟: +// setBitValue($hexStr,$offset,$bitValue) +//鍔熻兘璇存槑: +//灏嗕竴涓崄鍏繘鍒跺瓧绗︿覆$hexStr涓寚瀹氫綅缃�$offset鐨勪簩杩涘埗瀛楃锛岃鎴愭寚瀹氱殑鍊�$bitValue +//渚�: setBitValue('F1','1.1','1')=F3 +// setBitValue('F1','0.1','0')=E1 +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 琚敼杩囩殑鍗佸叚杩涘埗瀛楃涓�$hexStr +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function setBitValue($hexStr, $offset, $bitValue) +{ + $DEBUG = 0; + if ($DEBUG) echo "
      ===================="; + if ($DEBUG) echo "
      hexStr=$hexStr"; + if ($DEBUG) echo "
      offset=$offset"; + $tmpArr = explode('-', $offset); + $tmpBgnArr = explode('.', $tmpArr[0]); + $bgnByteOffset = $tmpBgnArr[0]; + $bgnBitOffset = $tmpBgnArr[1]; + if ($DEBUG) echo "
      bgnByteOffset=$bgnByteOffset"; + if ($DEBUG) echo "
      bgnBitOffset=$bgnBitOffset"; + if (sizeof($tmpArr) > 1) { + $tmpEndArr = explode('.', $tmpArr[1]); + $endByteOffset = $tmpEndArr[0]; + $endBitOffset = $tmpEndArr[1]; + if ($DEBUG) echo "
      endByteOffset=$endByteOffset"; + if ($DEBUG) echo "
      endBitOffset=$endBitOffset"; + if ($bgnBitOffset == 0 && $endBitOffset == 7) { + //杩欐椂锛�$bitValue鏄�16杩涘�煎瓧绗︿覆锛屽叾浠栨儏鍐典笅锛岄兘鏄簩杩涘埗瀛楃涓� + $tmpByte_1 = substr($hexStr, 0, $bgnByteOffset * 2); + if ($DEBUG) echo "
      tmpByte_1=$tmpByte_1"; + $tmpByte_2 = substr($hexStr, ($endByteOffset + 1) * 2); + if ($DEBUG) echo "
      tmpByte_2=$tmpByte_2"; + $tmpHexStr = $tmpByte_1 . $bitValue . $tmpByte_2; + if ($DEBUG) echo "
      tmpHexStr=$tmpHexStr"; + return ($tmpHexStr); + } else { + $tmpByte_1 = substr($hexStr, 0, $bgnByteOffset * 2); + $tmpByte_2 = substr($hexStr, ($endByteOffset + 1) * 2); + $selByte = substr($hexStr, $bgnByteOffset * 2, ($endByteOffset - $bgnByteOffset + 1) * 2); + if (strlen($selByte) > 2) {//涓嶈兘璺╞yte + return (-1); + } + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpDec = HexDec($selByte); + $binStr = DecBin($tmpDec); + for ($i = strlen($binStr); $i < strlen($selByte) * 4; $i++) { + $binStr = '0' . $binStr; + } + if ($DEBUG) echo "
      binStr=$binStr"; + + $tmpBit_1 = substr($binStr, 0, 8 - $endBitOffset - 1); + if ($DEBUG) echo "
      tmpBit_1=$tmpBit_1"; + if ($bgnBitOffset == 0) { + $tmpBit_2 = ''; + } else { + $tmpBit_2 = substr($binStr, -($bgnBitOffset)); + } + if ($DEBUG) echo "
      tmpBit_2=$tmpBit_2"; + $tmpBit = $tmpBit_1 . $bitValue . $tmpBit_2; + if ($DEBUG) echo "
      tmpBit=$tmpBit"; + $tmpByte = dechex(BinDec($tmpBit)); + if ($DEBUG) echo "
      tmpByte=$tmpByte"; + for ($i = strlen($tmpByte); $i < strlen($selByte); $i++) { + $tmpByte = '0' . $tmpByte; + } + $tmpHexStr = $tmpByte_1 . $tmpByte . $tmpByte_2; + return ($tmpHexStr); + } + } else { + if ($bgnByteOffset >= ceil(strlen($hexStr) / 2)) { + return (-1); + } else { + $selByte = substr($hexStr, $bgnByteOffset * 2, 2); + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpDec = HexDec($selByte); + $binStr = DecBin($tmpDec); + $binStr = omc_keep_length($binStr, '0', '8', '1'); + if ($DEBUG) echo "
      binStr=$binStr"; + $tmpLen = 7 - $bgnBitOffset; + $tmpBit_1 = substr($binStr, 0, $tmpLen); + if ($DEBUG) echo "
      tmpBit_1=$tmpBit_1=substr($binStr,0,$tmpLen)"; + $tmpLen = 8 - $bgnBitOffset; + $tmpBit_2 = substr($binStr, $tmpLen); + if ($DEBUG) echo "
      tmpBit_2=$tmpBit_2=substr($binStr,$tmpLen) "; + $newBitStr = $tmpBit_1 . $bitValue . $tmpBit_2; + if ($DEBUG) echo "
      newBitStr=$newBitStr"; + $tmpDec = BinDec($newBitStr); + $selByte = DecHex($tmpDec); + $selByte = omc_keep_length($selByte, '0', '2', '1'); + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpHexStr_1 = substr($hexStr, 0, $bgnByteOffset * 2); + $tmpHexStr_2 = substr($hexStr, $bgnByteOffset * 2 + 2); + if ($DEBUG) echo "
      tmpHexStr_1=$tmpHexStr_1 / tmpHexStr_2=$tmpHexStr_2 "; + $tmpHexStr = $tmpHexStr_1 . $selByte . $tmpHexStr_2; + if ($DEBUG) echo "
      tmpHexStr=$tmpHexStr"; + return ($tmpHexStr); + } + } +} + +//**************************************************************** +//鍑芥暟: +// getPubVar($pubVarName) +//鍔熻兘璇存槑: +//浠庤〃OMC_PUB.omcPubVarConf涓彇鍑哄搴斿彉閲忓悕鐨勫�� +//渚�: getPubVar('pssCardMinCount')=100 +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛氬彇鍑哄彉閲忓悕鐨勫�硷紝澶辫触锛�-1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function getPubVar($pubVarName) +{ + $DEBUG = 0; + global $pubConn; + $db = 'OMC_PUB'; + $tableName = 'omcPubVarConf'; + $sql = " SELECT pubVarValue + FROM $tableName + WHERE pubVarName='$pubVarName' + "; + if ($DEBUG) echo "
      sql=$sql"; + //$res = @mysqli_query($pubConn,$sql); + $res = mysqli_query($pubConn, $sql); + if (NULL == $res) return (-1); + if (mysqli_num_rows($res) > 0) { + $row = mysqli_fetch_array($res); + return ($row['pubVarValue']); + } else { + return (-1); + } +} + + +//**************************************************************** +//鍑芥暟: +// showComma($value) +//鍔熻兘璇存槑:濡傛灉鍊煎ぇ浜�3浣�,鍔犻�楀彿鏄剧ず +// +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛氳浆鎹㈢殑鍊硷紝澶辫触锛�-1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function showComma($value) +{ + $sValue = explode("-", $value); + if (isset($sValue[1])) + $pValue = explode(".", $sValue[1]); + else + $pValue = explode(".", $sValue[0]); + + $intValue = $pValue[0]; + $len = strlen($intValue); + $temValue = ''; + while ($len > 3) { + $value_1 = substr($intValue, -3); + $intValue = substr($intValue, 0, -3); + $temValue = "," . $value_1 . $temValue; + $len = strlen($intValue); + } + $temValue = $intValue . $temValue; + if (isset($pValue[1])) { + $temValue = $temValue . "." . $pValue[1]; + } + if (isset($sValue[1])) + $temValue = "-" . $temValue; + + return $temValue; +} + +//**************************************************************** +//鍑芥暟: +// showHelp($helpId) +//鍔熻兘璇存槑:鏄剧ず甯粍鏂囦欢 +// +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛� +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function showHelp($helpId) +{ + echo " "; + echo ""; + //echo "
      "; +} + + +//**************************************************************** +//鍑芥暟: +// getSerial() +//鍔熻兘璇存槑:寰楀埌鍚勬ā鍧楃殑绯诲垪鍙�,浠ュ強鎬荤殑绯诲垪鍙�. +// +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛� +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function getSerial() +{ + $DEBUG = 0; + $dbName = 'OMC_PUB'; + $tbName = 'sysStat'; + global $ttlSerial; + global $srlArr; + global $noSrlStt, $ttlSrlClr; + global $pubConn; + + $selSql = " SELECT * FROM $tbName WHERE sysTypeNo = 0"; + if ($DEBUG) echo "
      selSql=$selSql"; + $selRes = mysqli_query($pubConn, $selSql); + $selRow = mysqli_fetch_array($selRes); + $detailStat = $selRow['detailStat']; + $ttlSerial = substr($detailStat, 39 * 2, 8); + $ttlSrlClr = "#000000"; + if ($DEBUG) echo "
      ttlSerial=$ttlSerial
      "; + + $selSql = " SELECT * FROM $tbName WHERE sysTypeNo=320 OR sysTypeNo = 330 OR sysTypeNo = 340 OR sysTypeNo = 360 OR sysTypeNo = 380 OR sysTypeNo = 390 OR sysTypeNo = 350 "; + + if ($DEBUG) echo "
      selSql=$selSql"; + $selRes = mysqli_query($pubConn, $selSql); + $selRow = mysqli_fetch_array($selRes); + + do { + if (!$selRow) + break; + $sysTypeNo = $selRow['sysTypeNo']; + $sysNo = $selRow['sysNo']; + if ($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + if ($DEBUG) echo "
      sysNo=$sysNo"; + $detailStat = $selRow['detailStat']; + if ($DEBUG) echo "
      detailStat=$detailStat"; + switch ($sysTypeNo) { + case '320': //MSC + $arrNum = 0; + $subBgn = 39; + break; + case '330': //HLR + $arrNum = 1; + $subBgn = 39; + break; + case '340': //AUC + $arrNum = 2; + $subBgn = 39; + break; + case '360': //PPS + $arrNum = 3; + $subBgn = 39; + break; + case '380': //EIR + $arrNum = 4; + $subBgn = 39; + break; + case '390': //VSS + $arrNum = 5; + $subBgn = 39; + break; + case '350': //SMSC + $arrNum = 6; + $subBgn = 39; + break; + default: + break; + } + + $srlArr[$arrNum][$sysNo]['number'] = substr($detailStat, $subBgn * 2, 8); + $srlArr[$arrNum][$sysNo]['color'] = "#000000"; + + if ($DEBUG) echo "
      srlArr[$arrNum][$sysNo] = {$srlArr[$arrNum][$sysNo]}
      "; + if ($srlArr[$arrNum][$sysNo]['number'] != $ttlSerial) { + $srlArr[$arrNum][$sysNo]['color'] = "#FF0000"; + $noSrlStt = 1; + } + if ($DEBUG) echo "
      noSrlStt=$noSrlStt"; + + } while ($selRow = mysqli_fetch_array($selRes)); + + + if ($DEBUG) echo "
      ttlSerial=$ttlSerial"; + if ($noSrlStt) + $ttlSrlClr = "#FF0000"; + else + $ttlSrlClr = "#000000"; + if ($DEBUG) echo "
      ttlSrlClr=$ttlSrlClr
      "; + + + return 1; +} + +function byte2ip($byteStr) +{ + for ($i = 0; $i < 4; $i++) { + $unitIp = substr($byteStr, $i * 2, 2); + $unitIp = hexdec($unitIp); + if ($i == 0) { + $ipStr = $unitIp; + } else { + $ipStr .= ".$unitIp"; + } + } + return ($ipStr); +} + +function changeByteOrder($hex_byte) +{ + while (strlen($hex_byte) % 2 == 1) + $hex_byte = "0" . $hex_byte; + $byte_len = strlen($hex_byte) / 2; + + $res = ""; + for ($i = 0; $i < $byte_len; $i++) { + $tmpstr = substr($hex_byte, $i * 2, 2); + $res = $tmpstr . $res; + } + return $res; +} + +function getSystemNameBySysTypeNo($sysTypeNo) +{ + global $pubConn; + + $sqlstr = "select sysTypeName from OMC_PUB.sysConf where sysTypeNo = $sysTypeNo "; + $res = @mysqli_query($pubConn, $sqlstr); + $row = @mysqli_fetch_array($res); + return $row['sysTypeName']; +} + +function getSystemState($sysTypeNo, $byteStart, $length) +{ + global $pubConn; + $sql = "select detailStat from OMC_PUB.sysStat where sysTypeNo=$sysTypeNo order by updateTime DESC "; + if ($DEBUG) echo "$sql
      "; + $result = @mysqli_query($pubConn, $sql); + $record_num = 0; + $record_num = @mysqli_num_rows($result); + + if ($record_num == 0) + return ""; + + $rows = @mysqli_fetch_array($result); + $allbin = $rows['detailStat']; + + if (strlen($allbin) < $length) + return ""; + + $resbin = substr($allbin, $byteStart, $length); + + return $resbin; +} + +//**************************************************************** +//鍑芥暟: +// getParamOptionArray +//鍔熻兘璇存槑:杩斿洖鍙傛暟閫夐」鍊肩殑鏁扮粍 +// +//鍙傛暟璇存槑: +// sysTypeNo: sysTypeNo +// value: parameter oid or name +// mode: PARAM_OID PARAM_NAME +//杩斿洖鍊硷細 +// 鎴愬姛锛� +// +//浣滆�咃細zhengjianhui +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +define("PARAM_OID", 0); +define("PARAM_NAME", 1); +function getParamOptionArray($sysTypeNo, $value, $mode) +{ + $db = "OBJ_" . $sysTypeNo; + global $objDbConn; + if ($mode == PARAM_NAME) { + $sql = "select * from OBJ_$sysTypeNo.paramConf where name_2 like '%$value%' "; + } else { + $levelArr = explode('.', $value); + for ($j = 0; $j < sizeof($levelArr); $j++) { + $levelNo = $j + 1; + ${"level_$levelNo"} = $levelArr[$j]; + if ($DEBUG) echo "
      levelArr[$j]={$levelArr[$j]}"; + if ($j == 0) { + $levelWhere = "level_$levelNo='${"level_$levelNo"}'"; + } else { + $levelWhere .= " AND level_$levelNo='${"level_$levelNo"}'"; + } + } + + $sql = "select * from OBJ_$sysTypeNo.paramConf where $levelWhere "; + } + + $res = @mysqli_query($objDbConn, $sql); + $row = @mysqli_fetch_array($res); + $template = $row['setTemplate_2']; + $options = explode(";", $template); + for ($i = 0; $i < sizeof($options); $i++) { + $tmp = explode("=", $options[$i]); + $n = $tmp[0]; + $v = $tmp[1] + 0; + //echo "value=$v,name=$n
      "; + $arr[$v] = $n; + + } + return $arr; +} + + +function getMSSFtpAccount() +{ + global $pubConn; + + $default_user_name = "subsManager"; + $default_password = "iammanager"; + + $sql = "select * from OMC_PUB.omcPubVarConf where pubVarName='globalFTPUserName' "; +// $res=@mysqli_query($pubConn,$sql); +// $num=@mysqli_num_rows($res); + $res = @mysqli_query($pubConn, $sql); + $num = @mysqli_fetch_array($res); + if ($num == 0) { + $isql = "insert into OMC_PUB.omcPubVarConf(instance,pubVarName,pubVarValue,remark)values(18,'globalFTPUserName','subsManager','For Import subscriber, download PPS Tarriff, backup MSS subs data and MSS Configuration Synchronization');"; + @mysqli_query($pubConn, $isql); + $isql = "insert into OMC_PUB.omcPubVarConf(instance,pubVarName,pubVarValue,remark)values(18,'globalFTPPassword','iammanager','For Import subscriber, download PPS Tarriff, backup MSS subs data and MSS Configuration Synchronization');"; + @mysqli_query($pubConn, $isql); + } + + $row = @mysqli_fetch_array($res); + if (strlen(trim($row['pubVarValue'])) > 0) + $ftpInfo['UserName'] = $row['pubVarValue']; + else + $ftpInfo['UserName'] = $default_user_name; + + $sql = "select * from OMC_PUB.omcPubVarConf where pubVarName='globalFTPPassword' "; + $res = @mysqli_query($pubConn, $sql); + $row = @mysqli_fetch_array($res); + if (strlen(trim($row['pubVarValue'])) > 0) + $ftpInfo['Password'] = $row['pubVarValue']; + else + $ftpInfo['Password'] = $default_password; + + return $ftpInfo; +} + +//**************************************************************** +//鍑芥暟: +// alertMsgAndGoLastl() +//鍔熻兘璇存槑:浣跨敤JS鎻愮ず涓�浜涗俊鎭�. +// +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛� +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function alertMsgAndGoLast($msg) +{ + echo ""; + exit(); +} + +//娉ㄦ剰锛氫笅闈㈢殑"? >"鍚庨潰涓嶈兘鏈夌┖琛岋紝鍚﹀垯cvs鏁版嵁涓嬭浇鏃讹紝浼氬嚭閿欍�� +?> + diff --git a/wxc2_omc/inc/lib.inc.bak b/wxc2_omc/inc/lib.inc.bak new file mode 100755 index 0000000..5c0a8a2 --- /dev/null +++ b/wxc2_omc/inc/lib.inc.bak @@ -0,0 +1,2328 @@ +"; + return $connection; +} + +function sftp_login($connection, $logName, $logPass) +{ + ssh2_auth_password($connection, $logName, $logPass); + $sftp_key = ssh2_sftp($connection); + return $sftp_key; +} + +define("SFTP_ASCII", 0); +define("SFTP_BINARY", 1); +function sftp_put($key, $remote_file, $local_file, $mode) +{ + $read_mode = "r"; + $write_mode = "w"; + if ($mode == SFTP_BINARY) { + $open_mode .= "b"; + $write_mode .= "b"; + } + $handle = fopen($local_file, $read_mode); + if (!$handle) { + echo "sftp_put:Can not open $local_file
      "; + return FALSE; + } + + + $stream=fopen("ssh2.sftp://".intval($key).$remote_file, $write_mode); + if (!$stream) { + echo "sftp_put:Can not open $remote_file
      "; + return FALSE; + } + + $content = stream_get_contents($handle); + fwrite($stream, $content); + + fclose($handle); + fclose($stream); + + return TRUE; +} + +function sftp_get($key, $local_file, $remote_file, $mode) +{ + $read_mode="r"; + $write_mode="w"; + if($mode == SFTP_BINARY) + { + $open_mode.="b"; + $write_mode.="b"; + } + $handle=fopen($local_file,$write_mode); + if(!$handle) + { + echo "sftp_put:Can not open $local_file
      "; + return FALSE; + } + echo "$remote_file=$read_mode"; + + $stream=fopen("ssh2.sftp://$key"."$remote_file", $read_mode); + if(!$stream) + { + echo "sftp_put:Can not open $remote_file
      "; + return FALSE; + } + + $content=stream_get_contents($stream); + fwrite($handle,$content); + + fclose($handle); + fclose($stream); + + return TRUE; +} + +function checkWritePrivilege() +{ + global $userInfo; + // echo "
      ";
      +    // print_r($userInfo);
      +    // echo "
      ";
      +
      +    if ($userInfo['privilege'] > 2)
      +        return 1;
      +    else
      +        return 0;
      +}
      +
      +
      +function debug_log($file, $info)
      +{
      +    $handle = fopen($file, "a+");
      +    if ($handle == false)
      +        return;
      +    fwrite($handle, $info . "\n");
      +    fclose($handle);
      +}
      +
      +//****************************************************************
      +//鍑芥暟4 pageAccessChk($pageURL)
      +//鍑芥暟璇存槑:
      +//	妫�娴嬬敤鎴锋槸鍚﹀彲杩涘叆鏈〉, 
      +//	濡傛灉鐢ㄦ埛鐨勬潈闄愬寘鍚�$page_url鎵�瀵瑰簲鐨勬潈闄愶紝鍒欏彲杩涘叆璇ラ〉闈€��
      +//
      +//鍙橀噺璇存槑: 
      +//	$page_url                                       
      +//                                                             
      +//杩斿洖鍊硷細 1 = 鍙� -1 = 鍚�
      +//
      +//浣滆�咃細 
      +//      
      +//淇敼娉ㄩ噴锛�      
      +//NO.1      
      +//濮撳悕锛�           
      +//鏃堕棿锛�2002-03-26      
      +//淇敼璇存槑锛氫慨鏀逛簡鏉冮檺瀹氫箟鏂瑰紡锛岃鍑芥暟鏀瑰彉浜嗗ぇ閮ㄥ垎
      +//NO.2      
      +//濮撳悕锛�          
      +//鏃堕棿锛�2002-04-09      
      +//淇敼璇存槑锛氫慨鏀逛簡鏉冮檺瀹氫箟鏂瑰紡锛岃鍑芥暟鏀瑰彉浜嗗ぇ閮ㄥ垎
      +//----------------------------------------------------------
      +
      +function pageAccessChk($pageURL)
      +{
      +    global $userInfo, $privilegeDefArr, $dirAccessDefArr;
      +    $funcDebug = 0;
      +    $privilege = $userInfo['privilege'];
      +
      +    if ($funcDebug) echo "
      privilege:$privilege"; + if (strlen($privilege) > 0) { //鍒ゆ柇宸茬櫥褰曠殑鐢ㄦ埛 + //妫�鏌ヨ鏉冮檺缂栧彿鏄惁瀛樺湪 + $isPass = 0; + for ($k = 0; $k < sizeof($privilegeDefArr); $k++) { + if ($privilege == $privilegeDefArr[$k]['permit']) { + $isPass = 1; + break; + } + } + if ($isPass == 0) { + if ($funcDebug) echo "
      Invailed privilege"; + return (-1); + } + + + //瀵规瘮鍒ゆ柇璇ョ紪鍙峰搴旂殑鏉冮檺鑳藉惁璁块棶璇ョ洰褰� + for ($p = 0; $p < sizeof($dirAccessDefArr[$privilege]); $p++) { + $tmpDir = $dirAccessDefArr[$privilege][$p]; + $tmpLen = strlen($tmpDir); + if ($funcDebug) echo "
      $tmpDir == substr($pageURL,0,$tmpLen)"; + + if ($tmpDir == substr($pageURL, 0, $tmpLen) && $tmpLen > 0) { + return (1); + } + } + //鎵句笉鍒�,娓呮帀杩欎釜鏃犳晥鏉冮檺浠g爜 + if ($funcDebug) echo "1:$userInfo[privilege]"; + $userInfo['privilege'] = 0; + if ($funcDebug) echo "2:$userInfo[privilege]"; + return (-1); + } else {//鍒ゆ柇鏈櫥褰曠殑鐢ㄦ埛 + for ($p = 0; $p < sizeof($dirAccessDefArr[0]); $p++) { + $tmpDir = $dirAccessDefArr[0][$p]; + $tmpLen = strlen($tmpDir); + $thisDir = substr($pageURL, 0, $tmpLen); + if ($funcDebug) echo "
      $tmpDir == $thisDir"; + if ($tmpDir == $thisDir && $tmpLen > 0) { + return (1); + } + } + } + if ($funcDebug) echo "
      ??"; + + return (1); +} + + +//**************************************************************** +//鍑芥暟5 +// function insertLog($operDesc,$operTypeNo='0',$OperNo='0') +//鍑芥暟璇存槑: +// 璇ュ嚱鏁扮敤浜庤褰曟棩蹇� +// +//鍙橀噺璇存槑: +// $operDesc ->鎿嶄綔璇存槑 +// $operTypeNo ->鎿嶄綔绫诲瀷缂栧彿 +// $OperNo ->鎿嶄綔浠g爜 +// +//杩斿洖鍊硷細 +// 鏃� +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛�2003-04-09 +//淇敼璇存槑锛氱畝鍖栬緭鍏ュ弬鏁帮紝缂虹渷鎿嶄綔绫诲瀷涓簎nknown +//---------------------------------------------------------- + +function insertLog($operDesc, $operTypeNo = '0', $OperNo = '0') +{ + global $userInfo, $link, $pubConn; + $userName = $userInfo['ID']; + $operDesc = isset($operDesc) ? stripslashes($operDesc) : ''; //瑙g爜 + $operDesc = addslashes($operDesc); //瑙g爜 + + $insertLogSql = "INSERT INTO sysOperLog + (operTypeNo,OperNo,remark,userName,datetime) + VALUES + ('$operTypeNo','$OperNo','$operDesc','$userName',CURRENT_TIMESTAMP) + "; + //echo "$insertLogSql"; + $result = mysqli_query($pubConn, $insertLogSql); + //echo mysqli_error($pubConn); + if ($result < 0) { + echo "Error:Insert the log failed"; + } +} + + +//**************************************************************** +//鍑芥暟6 +// change_percent($num) +//鍑芥暟璇存槑: +// 璇ュ嚱鏁扮敤浜庢妸涓や釜鏁扮浉闄ゅ悗寰楀埌鐨勫皬鏁板彉涓虹簿纭埌鐧惧垎浣嶇殑鐧惧垎鏁� +// 濡傛妸0.91233456790鍙樹负91.23% +// +//鍙橀噺璇存槑: +// $num <= 1 +// +//杩斿洖鍊硷細 +// 涓�涓甫鐧惧垎鍙风殑瀛楃 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function change_percent($num) +{ + if ($num >= 1) { + $num = 100; + } else { + $num = $num * 1000000; + $num = round($num); + $num = $num / 10000; + } + $string = $num . '%'; + return ($string); +} + +//**************************************************************** +//鍑芥暟7 +// omc_keep_length($value,$add_value='0',$length='2',$position='1') +//鍑芥暟璇存槑: +// 璇ュ嚱鏁扮敤浜庡湪瀛楃涓�$value宸﹁竟娣�$add_value,鐩村埌琛ヨ冻鎵�闇�浣嶆暟$length +// 渚嬪:omc_keep_length(2,0,2)鍙樹负02 +// 甯哥敤浜庤幏鍙栫郴缁熺紪鍙枫�� +// +//鍙橀噺璇存槑: +// $value 闇�瑕佽ˉ瓒充綅鏁扮殑瀛楃 +// $add_value 闇�瑕佺敤浠�涔堝幓琛ヨ冻浣嶆暟锛岄粯璁や负'0' +// $length 闇�瑕佽ˉ瓒冲埌澶氬皯浣嶏紝榛樿涓�'2'绯荤粺缂栧彿鐨勯暱搴� +// +//杩斿洖鍊硷細 +// 琚ˉ瓒充綅鏁扮殑瀛楃涓� +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_keep_length($value, $add_value = '0', $length = '2', $position = '1') +{ + + while (strlen($value) < $length) { + if ($position) + $value = $add_value . $value; + else + $value = $value . $add_value; + + } + //echo "
      value=$value"; + return ($value); +} + + +//**************************************************************** +//鍑芥暟8 +// omc_table_name($sys_type,$table_type) +//鍑芥暟璇存槑: +// 璇ュ嚱鏁伴�氳繃$sys_type,$table_type鐢熸垚璇ョ郴缁熺殑鍚勭鐩稿叧琛ㄥ悕 +// 鏍规嵁$sys_id纭畾绯荤粺缂栧彿 +// 鏍规嵁$table_type纭畾瑕佽繑鍥炵殑琛ㄥ悕锛� +// 1銆乧sta-h -->(姣忓皬鏃�)璇濆姟缁熻琛� +// 2銆乧sta-q -->(姣�15鍒嗛挓)璇濆姟缁熻琛� +// +// +// +//鍙橀噺璇存槑: +// $sys_type 闇�瑕佽幏鍙栬〃鍚嶇殑绯荤粺 +// $table_type 璇ヨ〃鍚嶇殑绫诲瀷瀛楃涓� +// +//杩斿洖鍊硷細 +// 鎵�闇�鐨勮〃鍚嶅瓧绗︿覆 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_table_name($sys_type, $table_type) +{ + switch ($table_type) { + case 'csta-h': + $sys_type = strtolower($sys_type); + $table_name = $sys_type . 'Sum'; + break; + case 'csta-q': + $sys_type = strtolower($sys_type); + $table_name = $sys_type . 'Detail'; + break; + default: + echo "
      database's table name can not be maked,please check table type"; + break; + } + if ($table_name) { + return ($table_name); + } else { + exit(); + } +} + + +//**************************************************************** +//鍑芥暟9 +// omc_sys_type2code($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺畝鍐欒幏鍙栫郴缁熺紪鍙凤紝閫氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// 渚�:omc_sys_type2code(TS) = '04' +// +//鍙橀噺璇存槑: +// $sys_type +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺缂栧彿 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_sys_type2code($sysTypeName) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT sysTypeNo FROM $sysconf_table WHERE sysTypeName = '$sysTypeName'"; + //echo "
      $sel_sql"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + //echo "
      result_rows[sysTypeNo]=$result_rows[sysTypeNo]"; + return ($result_rows[sysTypeNo]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this device's code by omc_sys_type2code($sysTypeName)"; + return (-1); + } +} + + +//**************************************************************** +//鍑芥暟10 +// omc_sys_code2type($sys_code) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺紪鍙疯幏鍙栫郴缁熺畝鍐欙紝閫氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_code +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺绠�鍐� +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function omc_sys_code2type($sysTypeNo) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT sysTypeName FROM $sysconf_table WHERE sysTypeNo = '$sysTypeNo'"; + //echo "$sel_sql"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[sysTypeName]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this device's code by omc_sys_code2type($sysTypeNo)"; + return (-1); + } + +} + + +//**************************************************************** +//鍑芥暟11 +// get_subsys_total($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺被鍨嬭幏鍙栫郴缁熸瘡涓郴缁熺殑瀛愮郴缁熸�绘暟锛岄�氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_type:绯荤粺绫诲瀷 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺瀛愮郴缁熶釜鏁� +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function get_subsys_total($sys_type) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT maxSubsysNum FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[maxSubsysNum]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this system's subsystem quantity by get_subsys_total($sys_type)"; + return (-1); + } +} + +//**************************************************************** +//鍑芥暟12 +// get_e1_total($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺被鍨嬭幏鍙栫郴缁熸瘡涓郴缁熺殑e1鎬绘暟锛岄�氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_type:绯荤粺绫诲瀷 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺瀛愮郴缁熶釜鏁� +// 澶辫触: -1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function get_e1_total($sys_type) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT maxE1Num FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + //echo "
      sel_sql=$sel_sql"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[maxE1Num]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this system's e1 quantity by get_e1_total($sys_type)"; + return (-1); + } +} + +//**************************************************************** +//鍑芥暟13 +// get_sys_total($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺被鍨嬭幏鍙栫郴缁熺郴缁熸�绘暟锛岄�氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_type:绯荤粺绫诲瀷 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺鎬绘暟 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� 2002-5-14 +//淇敼璇存槑锛� 琛ㄥ悕銆佸瓧娈垫湁鍙� +//---------------------------------------------------------- +function get_sys_total($sys_type) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT maxSysNum FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + //echo "
      sel_sql=$sel_sql"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[maxSysNum]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this system's system quantity by get_sys_total($sys_type)"; + return (-1); + } +} + +//**************************************************************** +//鍑芥暟14 +// get_sys_offset($sys_type) +//鍑芥暟璇存槑: +// 鐢辩郴缁熺被鍨嬭幏鍙栬绫荤郴缁熺殑椤哄簭缂栧彿offset锛岄�氳繃鏌ヨ绯荤粺瀹氫箟琛�$sysconf_table鑾峰彇 +// +// +//鍙橀噺璇存槑: +// $sys_type :绯荤粺绫诲瀷 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺椤哄簭缂栧彿 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function get_sys_offset($sys_type) +{ + global $omc_db, $sysconf_table; + $sel_sql = "SELECT ledOffset FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + $result = mysqli_query($pubConn, $sel_sql); + if ($result > 0) { + $result_rows = mysqli_fetch_array($result); + return ($result_rows[0]); + } else { + echo mysqli_error($pubConn); + echo "
      Can not get this system's offset by get_sys_offset($sys_type)"; + return (-1); + } + +} + +//**************************************************************** +//鍑芥暟15 +// omc_sys_id_info($sys_id,$info_type) +//鍑芥暟璇存槑: +// 璇ュ嚱鏁伴�氳繃$sys_id鐨勫垎鏋愶紝鍙栧緱鐩稿簲淇℃伅 +// 渚嬶細鐢� "TS00_01" 鍙緱绯荤粺缂栧彿涓�"00" +// +//鍙橀噺璇存槑: +// 鍙傛暟$info_type瀵瑰簲瑕佸彇寰楃殑淇℃伅 +// sys_type -->绯荤粺绫诲瀷 +// sys_num -->绯荤粺缂栧彿 +// subsys_num -->瀛愮郴缁熺紪鍙� +// led_num -->led offset +// +//杩斿洖鍊硷細 +// 鎴愬姛: 瑕佸彇寰楃殑淇℃伅 +// 澶辫触: -1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_sys_id_info($sys_id, $info_type) +{ + global $sysconf_table, $omc_db; + $db = $omc_db; + $pieces = explode('_', $sys_id); + $sys_type = $pieces[0]; + $sys_num = $pieces[1]; + $subsys_num = $pieces[2]; + //echo "
      sys_type=$sys_type"; + + switch ($info_type) { + case 'sys_type': + $info = $sys_type; + break; + case 'sys_num': + $info = $sys_num; + break; + case 'subsys_num': + $info = $subsys_num; + break; + case 'led_num': + $sysTypeNo = omc_sys_type2code($sys_type); + $ledSql = " SELECT ledOffset FROM $sysconf_table WHERE sysTypeNo = '$sysTypeNo' "; + $ledRes = @mysqli_query($pubConn, $ledSql); + $ledRow = @mysqli_fetch_array($ledRes); + $info = $ledRow[0]; + break; + default: + echo "
      the $sys_id information can not be get,please check parameter: info_typ!"; + break; + } + if ($info) { + return ($info); + } else { + return (0); + } +} + +//**************************************************************** +//鍑芥暟16 +// omc_uninstall_device($sys_id) +//鍑芥暟璇存槑: +// 鍒犻櫎绯荤粺 +// +//鍙橀噺璇存槑: +// 鍒犻櫎绯荤粺鐨勭郴缁熺紪鍙�$sys_id +// +//杩斿洖鍊硷細 +// 鎴愬姛: 1 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛�2002-5-17 +//淇敼璇存槑锛� +//---------------------------------------------------------------------------------- + +function omc_uninstall_device($sys_id) +{ + global $omc_db, $sysStat_table; + //echo "
      sys_id=$sys_id"; + $sysType = omc_sys_id_info($sys_id, sys_type); + $sysTypeNo = omc_sys_type2code($sysType); + $sysNo = omc_sys_id_info($sys_id, sys_num); + $subSysNo = omc_sys_id_info($sys_id, subsys_num); + $del_sql = "DELETE FROM $sysStat_table WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo'"; + + if ($sys_id = 'all') { + $del_sql = " DELETE FROM $sysStat_table "; + } + //echo "
      del_sql=$del_sql"; + $result = mysqli_query($pubConn, $del_sql); + //echo "
      result=$result"; + if ($result) { + return (1); + } else { + return (-1); + } + +} + +//**************************************************************** +//鍑芥暟17 +// omc_chk_load_in($file_info,$remark_style) +//鍑芥暟璇存槑: +// 瀵煎叆鏂囦欢妫�鏌ュ嚱鏁� +// 鏍规嵁闇�瀵煎叆鏂囦欢鐨勪俊鎭紙鍖呮嫭鏂囦欢鍚嶏紝闇�瀵煎叆鐨勬湇鍔″櫒锛屾暟鎹簱锛岃〃锛夛紝瀵煎叆鏂囦欢鐨勬敞閲婁俊鎭紙鎸囧嚭璇ユ枃鐨勫瓧娈靛悕鍒楄〃鎵�鍦ㄨ锛� +// 鏂规硶锛氫竴涓�姣旇緝鏁版嵁搴撲腑琛ㄧ殑瀛楁鍜屾敞閲婁腑鍒楀嚭鐨勫瓧娈碉紝濡傛灉浜掔浉鍖归厤锛岃繑鍥炴垚鍔� +// +//鍙橀噺璇存槑: +// $file_info 鎵�闇�瀵煎叆鏂囦欢鐨勪俊鎭暟缁�,鍖呮嫭: +// $file_info[db] 鎵�闇�瀵煎叆鐨勬暟鎹簱鍚� +// $file_info[table] 鎵�闇�瀵煎叆鐨勬暟鎹簱涓殑琛ㄥ悕 +// $file_info[name] 鎵�闇�瀵煎叆鏁版嵁搴撶殑鏂囦欢鍚� +// $remark_style 鏁版嵁鏂囦欢娉ㄩ噴椋庢牸 +// $remark_style[fields_seek] 鏂囦欢寮�澶达紝闇�瑕佸拷鐣ョ殑琛屾暟锛屼竴鑸负1 +// $remark_style[sign] 娉ㄩ噴绗︼紝涓�鑸负'#' +// $remark_style[fields_by] 瀛楁鍒嗗壊绗︼紝涓�鑸负';' + +// +//杩斿洖鍊硷細 +// 鎴愬姛: 1 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function omc_chk_load_in($file_info, $remark_style) +{ + //-------------1.get database's information--------------- + global $link; + $field_sql = "SELECT * FROM {$file_info[table]} LIMIT 0,1"; + //echo "
      field_sql=$field_sql"; + $field_result = mysqli_query($pubConn, $field_sql); + + //-------------check the data file's fields------------- + //echo "
      name={$file_info[name]}"; + $fp = fopen($file_info[name], r); + for ($i = 1; $i <= $remark_style[fields_seek]; $i++) { + $field_line = fgets($fp, 4096); //4096 is a constant + } + //echo "
      field_line=$field_line"; + if (substr($field_line, 0, 1) != $remark_style[sign]) { + echo "the remark sign not exist"; //娉ㄩ噴绗﹂敊璇� + return (-1); + } else { + //echo "
      field_line=$field_line"; + $file_fields_line = substr($field_line, 1); + //echo "
      file_fields_line=$file_fields_line"; + $file_fields_rows = explode($remark_style[fields_by], $file_fields_line); + $fields_num = mysql_num_fields($field_result); + //echo "
      fields_num=$fields_num"; + for ($i = 0; $i < $fields_num; $i++) { + $this_field = mysql_field_name($field_result, $i); + //echo "
      $file_fields_rows[$i] -- $this_field"; + if ($file_fields_rows[$i] != $this_field && $this_field != '') { + echo "
      error: fields is not matching.";//瀛楁鍚嶄笉鍖归厤 + return (-1); + } + } + fclose($fp); + return (1); + } +} + + +//******************************************************************* +//鍑芥暟18 +// Get the content of $table as a CSV output. +// $sep contains the separation string. +// After every row, a custom callback function $handler gets called. +// $handler must accept one parameter ($sql_insert); + +function get_table_csv($server_link, $db_name, $table, $where, $handler) +{ + global $separator; + + $sep = $separator; + if (strlen($where) > 1) { + $sel_sql = "SELECT * FROM $table $where"; + $sel_sql = stripslashes($sel_sql); + } else { + $sel_sql = "SELECT * FROM $table "; + } + //echo "
      sel_sql=$sel_sql
      "; + $result = mysqli_query($pubConn, $sel_sql, $server_link); + if ($result < 0) { + echo "$sel_sql /n"; + echo mysqli_error($pubConn); + exit(); + } + + /* + //杈撳嚭瀛楁鍚� + $schema_insert = "#"; + for($j=0; $jschema_insert=$schema_insert
      "; + } + $handler(trim($schema_insert));//鎸夋煇绉嶆柟寮忓鐞嗗悗,杈撳嚭涓�琛� + */ + + $i = 0; + while ($row = mysqli_fetch_row($result)) { + set_time_limit(60); // HaRa + $schema_insert = ""; + for ($j = 0; $j < mysql_num_fields($result); $j++) { + if (!isset($row[$j])) + $schema_insert .= "NULL" . $sep; + elseif ($row[$j] != "") + $schema_insert .= "$row[$j]" . $sep; + else + $schema_insert .= "" . $sep; + } + $schema_insert = str_replace($sep . "$", "", $schema_insert); + $handler(trim($schema_insert)); + $i++; + } + return (true); +} + + +//**************************************************************** +//鍑芥暟19 +// omc_die($warning_words) +//鍑芥暟璇存槑: +// 杈撳嚭閿欒淇℃伅,閫�鍑� +// +//鍙橀噺璇存槑: +// $warning_words 璀﹀憡璇存槑 +// +//杩斿洖鍊硷細 +// 鏃� +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function omc_die($warning_words) +{ + echo "
      $warning_words"; + exit(); +} + + +//**************************************************************** +//鍑芥暟20 +// change2point($number) +//鍑芥暟璇存槑: +// 灏嗚鏁板瓧鎸変繚鐣欏皬鏁扮偣鍚庝袱浣嶇殑瑙勫垯杞崲锛屽父鐢ㄤ簬璐у竵鐨勭粺涓�鏍囩ず +// +//鍙橀噺璇存槑: +// $number ->鎵�闇�杞崲鐨勬暟瀛� +// +//杩斿洖鍊硷細 +// 鎴愬姛: 杩斿洖杞崲鍚庣殑瀛楃 +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛�2003-07-10 +//淇敼璇存槑锛氬共浜嗚牏浜嬶紝涓�鍙ヨ瘽鐨勪簨锛岀敤浜嗕竴涓嚱鏁般�� +//---------------------------------------------------------- + +function change2point($number) +{ + /* + $num = explode(".",$number); + $num_1 = $num[0]; + $num_2 = substr($num[1],0,2); + if(strlen($num_2) < 2){ + if(strlen($num_2) == 0){ + $num_2 = '00'; + }else{ + $num_2 = $num_2.'0'; + } + } + if($num_1==0 && $num_2 == 0){ + $number = 0; + }else{ + $number = $num_1.'.'.$num_2; + } + */ + $number = sprintf("%01.2f", $number); + return ($number); +} + +//**************************************************************** +//鍑芥暟21 +// Second2format($number) +//鍑芥暟璇存槑: +// 鎶婄鏁板彉鎴愭爣鍑嗘椂闂存樉绀哄锛�17绉�->00:00:17 +// +//鍙橀噺璇存槑: +// $number 绉掓暟 +// +//杩斿洖鍊硷細 +// 鎴愬姛: 杩斿洖鏍囧噯鏃堕棿 +// 澶辫触: 杩斿洖0 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +// +function Second2format($number) +{ + if ($number > 0) { + $number_h = floor($number / 3600); + if (strlen($number_h) < 2) { + $number_h = "0" . $number_h; + } + $number_ms = $number % 3600; + $number_m = floor($number_ms / 60); + if (strlen($number_m) < 2) { + $number_m = "0" . $number_m; + } + $number_s = $number_ms % 60; + if (strlen($number_s) < 2) { + $number_s = "0" . $number_s; + } + $format = $number_h . ":" . $number_m . ":" . $number_s; + return ($format); + } else { + return (0); + } +} + +//**************************************************************** +//鍑芥暟22 +// getDetailedStatus($sysTypeNo,$sysNo,$subSysNo,$getType) +// 寰楀埌璇︾粏鐘舵�佷俊鎭垨鍒锋柊鏃堕棿 +// +//鍙橀噺璇存槑: +// $sysTypeNo绯荤粺绫诲瀷缂栧彿 +// $sysNo绯荤粺缂栧彿 +// $subSysNo瀛愮郴缁熺紪鍙� +// $getType璇︾粏鐘舵��(status)鎴栧埛鏂版椂闂�(time) +// +//杩斿洖鍊硷細 +// 鎴愬姛: 杩斿洖鐘舵�佹垨鏃堕棿 +// 澶辫触: 杩斿洖-1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +// +function getDetailedStatus($sysTypeNo, $sysNo, $subSysNo, $getType = 'time') +{ + global $omc_db, $sysStat_table; + $db = $omc_db; + $DEBUG = 0; + $sel_mes_sql = "SELECT detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + "; + if ($DEBUG) echo "
      sel_mes_sql=$sel_mes_sql"; + $sel_mes_res = mysqli_query($pubConn, $sel_mes_sql); + $sel_mes_row = @mysqli_fetch_array($sel_mes_res); + if ($getType == 'Time') { + $value = $sel_mes_row[detailStat]; + } else { + $value = $sel_mes_row[updateTime]; + } + if ($DEBUG) echo "
      value=$value"; + if (!$sel_mes_row) { + return (-1); + } else { + return ($value); + } +} + + +//**************************************************************** +//鍑芥暟23 omc_get_sysAlias($sysTypeNo,$sysNo,$subSysNo) +// +//鍔熻兘璇存槑:鏍规嵁鎸囧畾绯荤粺缂栧彿鑾峰彇绯荤粺鍒悕 +// +//鍙橀噺璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛: 绯荤粺鍒悕瀛楃涓� +// 澶辫触:-1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function omc_get_sysAlias($sysTypeNo, $sysNo, $subSysNo) +{ + $sysAliasSql = "SELECT sysAlias + FROM sysInfo + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo'AND subSysNo='$subSysNo' + ORDER BY sysTypeNo,sysNo,subSysNo + "; + $sysAliasResult = mysqli_query($pubConn, $sysAliasSql); + echo mysqli_error($pubConn); + $sysAliasRows = @mysqli_fetch_array($sysAliasResult); + $sysAlias = $sysAliasRows[sysAlias]; + if (strlen($sysAlias) > 0) { + return ($sysAlias); + } else { + return (-1); + } +} + + +//**************************************************************** +//鍑� 鏁� 鍚�: omcProgressBar($allNum,$doneNum) +//鍔熻兘璇存槑: 鏄剧ず杩涘害鏉� +//鍙橀噺璇存槑: $allNum鎬绘暟,$doneNum宸插畬鎴愮殑鏁扮洰 +//杩� 鍥� 鍊�: 鏃� +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function omcProgressBar($allNum, $doneNum) +{ + if ($allNum > 0) { + if ($doneNum >= $allNum) { + $quoNum = 100; + } else { + $quoNum = $doneNum / $allNum * 100; + $quoNum = round($quoNum); + } + } else { + echo "omcProgressBar() Error:allNum cannot < 0!"; + exit(); + } + $big_width = 320; + $border = 10; + $lit_width = $big_width - 2 * $border; + $height = 10; + echo "
      "; + echo "\n"; + echo "
      "; + echo "$strProgressIsShowedAsFollowing"; + echo "
      "; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n

      "; + echo "\n$quoNum%"; + echo "\n

      "; + $lineNum = $quoNum * 3; + echo "\n"; + echo "\n
      "; + //echo "\n
      "; +} + + +//**************************************************************** +//鍑� 鏁� 鍚�: sysCommSend($sysId,$commType,$objIdStr,$selectedSysId=-1) +//鍔熻兘璇存槑: 绯荤粺鍙傛暟缁存姢鍙戦�佸懡浠� +//鍙橀噺璇存槑: 鐣� +//杩� 鍥� 鍊�: +// 鎴愬姛: 鍛戒护缂栧彿瀛楃涓� +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛歝uiticun +//鏃堕棿锛�2005-7-13 +//淇敼璇存槑锛歝heck the exist command num in the buffer +//---------------------------------------------------------- +function sysCommSend($sysId, $commType, $objIdStr, $selectedSysId = -1, $selectedDPC = 0) +{ + global $OMC_server,$pubConn; + $DEBUG = 0; + $pubDb = 'OMC_PUB'; + $commTable = 'parameterComm'; + $nGetComm = 0; + $nSetComm = 3; + + $nSubSysParam = 0; + $nGlobalSubSysParam = 1; + $nGlobalSysParam = 2; + + $sysIdArr = explode('_', $sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + $objConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], 'OBJ_'.$sysTypeNo); + + //insert the operation log into the database + $logStr = ""; + if ($commType == 0) + $logStr .= "Get "; + else if ($commType == 3) + $logStr .= "Set "; + //=====get the LevelWhere + $levelArr = explode('.', $objIdStr); + for ($j = 0; $j < sizeof($levelArr); $j++) { + $levelNo = $j + 1; + ${"level_$levelNo"} = $levelArr[$j]; + if ($DEBUG) echo "
      levelArr[$j]={$levelArr[$j]}"; + if ($j == 0) { + $levelWhere = "level_$levelNo='${"level_$levelNo"}'"; + } else { + $levelWhere .= " AND level_$levelNo='${"level_$levelNo"}'"; + } + } + $temp = $levelWhere; + + $database = "OBJ_" . $sysTypeNo; + $ssql = "select name_2 from paramConf where $temp "; + $resultt = @mysqli_query($objConn, $ssql); + $rowss = @mysqli_fetch_array($resultt); + //==get the parameter name + $p_name = $rowss[name_2]; + + $p_name = str_replace("Entry", "", $p_name); + $sysName = getSystemNameBySysTypeNo($sysTypeNo); + $logStr .= "$sysName $p_name's parameter"; + + $logStr .= $p_name; + + insertLog($logStr); + //end insert operation log + + if ($sysNo == '99') { + $paramType = $nGlobalSysParam; + } else if ($subSysNo == '99') { + $paramType = $nGlobalSubSysParam; + } else { + $paramType = $nSubSysParam; + } + + if ($selectedSysId != -1) { + $selectedSysIdArr = explode('_', $selectedSysId); + $selectedSysTypeNo = $selectedSysIdArr[0]; + $selectedSysNo = $selectedSysIdArr[1]; + $selectedSubSysNo = $selectedSysIdArr[2]; + } + if ($DEBUG) echo "
      selectedSysId=$selectedSysId"; + if ($DEBUG) echo "
      selectedSysNo=$selectedSysNo"; + if ($DEBUG) echo "
      selectedSubSysNo=$selectedSubSysNo"; + + //step 1: delete overtime and imcompetent command , check the exist command num + $overTime = date("Y-m-d H:i:s", mktime(date("H"), date("i") - 1, date("s"), date("m"), date("d"), date("Y"))); + $delSql = "DELETE FROM $commTable + WHERE commState ='0' OR commState ='3' OR sendTime < '$overTime' + "; + if ($DEBUG) echo "
      delete command sql = $delSql"; + mysqli_query($pubConn, $delSql); + echo mysqli_error($pubConn); + + //check the exist command num + $chkSql = "SELECT commId FROM $commTable"; + if ($DEBUG) echo "
      check exist commands sql = $chkSql"; + $chkResult = mysqli_query($pubConn, $chkSql); + echo mysqli_error($pubConn); + $existNum = @mysqli_num_rows($chkResult); + + //step 2: check the command(涓嶈兘鍚屾椂鎿嶄綔鍚屼竴涓瓙绯荤粺锛屼篃涓嶈兘鍚屾椂璇诲悓涓�涓郴缁熺殑涓嶅悓瀛愮郴缁熺殑鍏叡鍙傛暟) + if (($paramType != $nSubSysParam) && ($commType == $nGetComm)) { //0=Get,2=response,3=Set + if ($selectedSysId == -1) { + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND commType ='$nGetComm' + "; + } else { + //閫夋嫨鎸囧畾瀛愮郴缁� + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$selectedSysTypeNo' AND sysNo='$selectedSysNo' + AND subSysNo='$selectedSubSysNo' AND commType ='$nGetComm' + "; + } + } else { + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + } + if ($DEBUG) echo "
      check command sql = $chkSql"; + $chkResult = mysqli_query($pubConn, $chkSql); + echo mysqli_error($pubConn); + $rowsNum = @mysqli_num_rows($chkResult); + if ($rowsNum > 0) { + echo ""; + return (-1); + } + + //step 3:insert commands into command table + if (($paramType != $nSubSysParam) && ($commType == $nSetComm)) { //鍐欏叕鍏卞弬鏁� + //get maxSubSysNum + //$selSql="SELECT maxSysNum, maxSubSysNum FROM sysConf WHERE sysTypeNo = '$sysTypeNo'"; + //$selResult=mysqli_query($pubConn,$selSql); + //$selRows=mysqli_fetch_array($selResult); + //echo mysqli_error($pubConn); + //$maxSysNum = $selRows[maxSysNum]; + //$maxSubSysNum = $selRows[maxSubSysNum]; + if ($selectedSysId == -1) { + if ($paramType == $nGlobalSysParam) { + if ($sysTypeNo[0] == '2') { + if ($sysTypeNo == '222' || $sysTypeNo == '223') {//MTP3,SCCP + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo!='8' AND sysNo!='11' + AND DPC = '$selectedDPC' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + AND DPC = '$selectedDPC' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + } else { + //閫夋嫨鎸囧畾瀛愮郴缁� + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$selectedSysTypeNo' + AND sysNo ='$selectedSysNo' + AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC + "; + } + if ($DEBUG) { + echo "
      selSql=$selSql"; + exit(); + } + $selResult = mysqli_query($pubConn, $selSql); + $selRowsNum = mysqli_num_rows($selResult); + + if ($selRowsNum + $existNum > 64) { + echo ""; + return (-1); + } + + if ($selRowsNum > 0) { + while ($selRows = mysqli_fetch_array($selResult)) { + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + $sendSql = "INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','','1',CURRENT_TIMESTAMP) + "; + if ($DEBUG) echo "
      send command sql = $sendSql"; + $sendResult = mysqli_query($pubConn, $sendSql); + echo mysqli_error($pubConn); + } + } else { + echo "
      Error:This canot get this system's IP"; + return (-1); + } + //鍐橵PS 鎴朠CR 鍙傛暟 + /* + }elseif(($sysTypeNo == 120 || $sysTypeNo == 130 || $sysTypeNo == 140) && ($commType == $nSetComm)){ + $tmpLevelOne = $sysNo + 1; + $tmpLevelTwo = $subSysNo + 1; + switch($sysTypeNo){ + case 120: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.7.2.1'; + break; + case 130: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.6.2.1'; + break; + case 140: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.8.2.1'; + break; + default: echo "error sysTypeNo"; + exit(); + } + if($DEBUG) echo"
      strstr($objIdStr, $sysParamOidPrefix)"; + + if(strstr($objIdStr, $sysParamOidPrefix)){//鍐橵PS 鎴朠CR鐨勫叕鍏卞弬鏁� + //get maxSubSysNum + $selSql="SELECT maxSubSysNum FROM sysConf WHERE sysTypeNo = '$sysTypeNo'"; + $selResult=mysqli_query($pubConn,$selSql); + $selRows=mysqli_fetch_array($selResult); + echo mysqli_error($pubConn); + $maxSubSysNum = $selRows[maxSubSysNum]; + //get alive system + $selSql="SELECT DISTINCT subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + $selResult = mysqli_query($pubConn,$selSql); + $selRowsNum = mysqli_num_rows($selResult); + if($selRowsNum > 0){ + while($selRows = mysqli_fetch_array($selResult)){ + $subSysNo = $selRows[subSysNo]; + $tmpLevelOne = $sysNo + 1; + $tmpLevelTwo = $subSysNo + 1; + $tmpOidLen = strlen($objIdStr); + $tmpSubfixOid = substr($objIdStr,3,$tmpOidLen); + $objIdStr = $tmpLevelOne.'.'.$tmpLevelTwo.$tmpSubfixOid; + if($DEBUG) echo"
      VPS OR PCR'S system parameter Oid:$objIdStr"; + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','0','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + }else{ + echo "
      Error:This canot get this system's IP"; + return(-1); + } + }else{//鍐橵PS锛孭CR瀛愮郴缁熷弬鏁� + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','0','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + */ + } else {//璇荤郴缁�/瀛愮郴缁熷弬鏁版垨鍐欏瓙绯荤粺鍙傛暟 + if ($paramType != $nSubSysParam) {//璇诲叕鍏卞弬鏁� + if ($selectedSysId == -1) { + //get baseStat 0=uninstalled, 1=nomal, 2=warning, 3=error + //鍏堟寜鐘舵�佹帓搴忥紝鍐嶆寜绯荤粺缂栧彿,瀛愮郴缁熺紪鍙锋帓搴忥紝鍚岀鐘舵�佷紭鍏堥�夋嫨缂栧彿灏忕殑 + if ($paramType == $nGlobalSysParam) { + /*if($sysTypeNo == '222' || $sysTypeNo == '223'){//MTP3,SCCP + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + AND DPC = '$selectedDPC' + ORDER BY baseStat DESC,updateTime DESC,sysNo DESC,subSysNo + "; + }else{ + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + }*/ + + if ($sysTypeNo[0] == '2') {//Platform + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + ORDER BY baseStat DESC,sysNo DESC,subSysNo,updateTime DESC + "; + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + } else { + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$sysNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + } else { + //閫夋嫨鎸囧畾瀛愮郴缁� + $selSql = "SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$selectedSysNo' AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC,updateTime DESC + "; + } + + $selResult = mysqli_query($pubConn, $selSql); + if ($DEBUG) { + echo "
      get system info sql = $selSql"; + } + echo mysqli_error($pubConn); + if (@mysqli_num_rows($selResult) > 0) { + $selRows = @mysqli_fetch_array($selResult); + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + } else { + echo ""; + return (-1); + } + } + // special for sccp and mtp3 add by lilong 2004-6-11 + if ($selectedSysId == -1) { + $DEBUG = 0; + if ($DEBUG) echo "sysTypeNo = $sysTypeNo, sysNo = $sysNo
      "; + if (($sysTypeNo == '222' || $sysTypeNo == '223') && ('8' != $sysNo) && ('11' != $sysNo)) {//MTP3,SCCP + $selSql_1 = "SELECT sysNo,subsysNo FROM sysInfo + WHERE baseStat=1 AND sysTypeNo=320"; + if ($DEBUG) echo "selSql_1 = $selSql_1
      "; + $selRes_1 = mysqli_query($pubConn, $selSql_1); + if (mysqli_num_rows($selRes_1) > 0) { + $selRows_1 = @mysqli_fetch_array($selRes_1); + $sysNo = 9; + $subSysNo = $selRows_1[sysNo]; + } else { + $selSql_2 = "SELECT sysNo,subsysNo FROM sysInfo + WHERE baseStat=1 AND sysTypeNo=0"; + if ($DEBUG) echo "selSql_2 = $selSql_2
      "; + $selRes_2 = mysqli_query($pubConn, $selSql_2); + if (mysqli_num_rows($selRes_2) > 0) { + $selRows_2 = @mysqli_fetch_array($selRes_2); + $sysNo = 0; + $subSysNo = $selRows_2[subsysNo]; + } + } + } + if ($DEBUG) { + echo "sysNo=$sysNo, subSysNo=$subSysNo
      "; + exit(); + } + $DEBUG = 0; + //add end by lilong 2004-6-11 + } + + if (1 + $existNum > 64) { + echo ""; + return (-1); + } + + $sendSql = "INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','','1',CURRENT_TIMESTAMP) + "; + if ($DEBUG) echo "
      send command sql = $sendSql"; + $sendResult = mysqli_query($pubConn, $sendSql); + echo mysqli_error($pubConn); + } + + //step 4:Return commIdStr + if ($DEBUG) echo "
      if(($paramType != $nSubSysParam) && ($commType == $nSetComm))"; + if (($paramType != $nSubSysParam) && ($commType == $nSetComm)) { + if ($paramType == $nGlobalSysParam) { + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + } else { + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + } + /* + //鍐橵PS 鎴朠CR 鍙傛暟 + }elseif(($sysTypeNo == 120 || $sysTypeNo == 130 || $sysTypeNo == 140) && ($commType == $nSetComm)){ + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + */ + } else { + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo'"; + } + if ($DEBUG) echo "
      get command id sql = $selSql"; + $selResult = mysqli_query($pubConn, $selSql); + echo mysqli_error($pubConn); + $commIdStr = ''; + while ($selRows = mysqli_fetch_array($selResult)) { + $commIdStr .= $selRows[commId] . '-'; + } + if ($DEBUG) echo "
      commIdStr = $commIdStr"; + if ($DEBUG) exit(); + return ($commIdStr); +}//end of function sysSendComm() + +//**************************************************************** +//鍑� 鏁� 鍚�: setSysParamValue($sysId,$objIdStr,$instanceNo,$newValue) +//鍔熻兘璇存槑: 淇敼璁惧鍙傛暟鐨刬nitValue,涓哄彂閫佸懡浠ゅ仛鍑嗗 +//鍙橀噺璇存槑: 鐣� +//杩� 鍥� 鍊�: +// 鎴愬姛: 鍛戒护缂栧彿瀛楃涓� +// 澶辫触: -1 +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function setSysParamValue($sysId, $objIdStr, $instanceNo, $newValue) +{ + global $paramConf_table; + $DEBUG = 0; + + if ($DEBUG) echo "
      sysId=$sysId"; + $tmpSysIdArr = explode('_', $sysId); + $sysTypeNo = $tmpSysIdArr[0]; + $sysNo = $tmpSysIdArr[1]; + $subSysNo = $tmpSysIdArr[2]; + + $paramDb = 'OBJ_' . $sysTypeNo; + if ($DEBUG) echo "
      paramDb=$paramDb"; + //鑾峰彇鍙傛暟瀹氫箟琛ㄧ殑琛ㄥ悕锛屾牴鎹畂id鍙栧嚭鍙傛暟瀹氫箟 + $tmpObjArr = explode('.', $objIdStr); + $objWhereStr = ''; + for ($i = 0; $i < sizeof($tmpObjArr); $i++) { + $j = $i + 1; + $objWhereStr .= ' level_' . $j . "='{$tmpObjArr[$i]}' AND "; + } + $objWhereStr = substr($objWhereStr, 0, -5); //鏈�鍚庡浜嗕竴涓�' AND ',灏嗗叾鍘绘帀 + $getParamDefSql = "SELECT paramType FROM $paramConf_table WHERE $objWhereStr"; + if ($DEBUG) echo "
      $getParamDefSql"; + $getParamDefResult = mysqli_query($pubConn, $getParamDefSql); + echo mysqli_error($pubConn); + if (mysqli_num_rows($getParamDefResult) <= 0) { + echo "Cannot find this objId from paramConf"; + return (-1); + } + $getParamDefRows = mysqli_fetch_array($getParamDefResult); + $paramType = $getParamDefRows[paramType]; + + //鏍规嵁鍙傛暟绫诲瀷锛屾帹鍑哄弬鏁拌〃鐨勮〃鍚� + if ($paramType == 2) { + $paramTable = 'param_99'; + } else { + $paramTable = 'param_' . $sysNo; + } + if ($paramType != 0) { + $subSysNo = '99'; + } + + //淇敼瀵瑰簲鐨勫弬鏁板�� + $setParamValueSql = "UPDATE $paramTable + SET initValue='$newValue',readValue='' + WHERE subSysNo = '$subSysNo' AND instanceNo = '$instanceNo' + AND $objWhereStr + "; + if ($DEBUG) echo "
      $setParamValueSql
      "; + $setResult = mysqli_query($pubConn, $setParamValueSql); + echo mysqli_error($pubConn); + if ($setResult) { + return (1); + } else { + return (-1); + } +}//end of function setSysParamValue + +//**************************************************************** +//鍑� 鏁� 鍚�: getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName) +//鍔熻兘璇存槑: 鑾峰彇鎸囧畾鐨勮澶囧弬鏁� +//鍙橀噺璇存槑: 鐣� +//杩� 鍥� 鍊�: +// 鎴愬姛: 鍙傛暟鍊� +// 澶辫触: exit()閫�鍑� +// +// +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function getSysParamValue($sysId, $objIdStr, $instanceNo, $valueName) +{ + global $paramConf_table; + $DEBUG = 0; + + $tmpSysIdArr = explode('_', $sysId); + $sysTypeNo = $tmpSysIdArr[0]; + $sysNo = $tmpSysIdArr[1]; + $subSysNo = $tmpSysIdArr[2]; + + $paramDb = 'OBJ_' . $sysTypeNo; + //鑾峰彇鍙傛暟瀹氫箟琛ㄧ殑琛ㄥ悕锛屾牴鎹畂id鍙栧嚭鍙傛暟瀹氫箟 + $tmpObjArr = explode('.', $objIdStr); + $objWhereStr = ''; + for ($i = 0; $i < sizeof($tmpObjArr); $i++) { + $j = $i + 1; + $objWhereStr .= ' level_' . $j . "='{$tmpObjArr[$i]}' AND "; + } + $objWhereStr = substr($objWhereStr, 0, -5); //鏈�鍚庡浜嗕竴涓�' AND ',灏嗗叾鍘绘帀 + $getParamDefSql = "SELECT paramType FROM $paramConf_table WHERE $objWhereStr"; + if ($DEBUG) echo "
      $getParamDefSql"; + $getParamDefResult = mysqli_query($pubConn, $getParamDefSql); + echo mysqli_error($pubConn); + if (@mysqli_num_rows($getParamDefResult) <= 0) { + echo "Cannot find this objId from paramConf"; + return (-1); + } + $getParamDefRows = mysqli_fetch_array($getParamDefResult); + $paramType = $getParamDefRows[paramType]; + + //鏍规嵁鍙傛暟绫诲瀷锛屾帹鍑哄弬鏁拌〃鐨勮〃鍚� + if ($paramType == 2) { + $paramTable = 'param_99'; + } else { + $paramTable = 'param_' . $sysNo; + } + if ($paramType != 0) { + $subSysNo = '99'; + } + + //淇敼瀵瑰簲鐨勫弬鏁板�� + $getParamValueSql = "SELECT $valueName FROM $paramTable + WHERE subSysNo = '$subSysNo' AND instanceNo = '$instanceNo' + AND $objWhereStr + "; + if ($DEBUG) echo "
      $getParamValueSql
      "; + $getResult = mysqli_query($pubConn, $getParamValueSql); + echo mysqli_error($pubConn); + if (mysqli_num_rows($getResult) > 0) { + $paramRows = mysqli_fetch_array($getResult); + $paramValue = $paramRows[0]; + return ($paramValue); + } else { + return (-1); + } +}//end of function getSysParamValue + +//**************************************************************** +//鍑芥暟8 +// getMoneyPara() +//鍑芥暟璇存槑: +// 璇ュ嚱鏁伴�氳繃鏌ヨPPS绯荤粺閰嶇疆寰楀埌鏄剧ず鐨勮揣甯佸崟浣嶆槸鏈�灏忚揣甯佸崟浣嶇殑鍊嶆暟 +// +// +// +// +//鍙橀噺璇存槑: +// 鏃� +// +// +//杩斿洖鍊硷細 +// 鏄剧ず鐨勮揣甯佸崟浣嶆槸鏈�灏忚揣甯佸崟浣嶇殑鍊嶆暟 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function getMoneyPara() +{ + global $pubConn; + $getSql = " SELECT pubVarValue FROM omcPubVarConf WHERE pubVarName='pssCardMinCount'"; + $getRes = @mysqli_query($pubConn, $getSql); + $getRow = @mysqli_fetch_array($getRes); + echo mysqli_error($pubConn); + $multiple = $getRow[pubVarValue]; + /* + if($multiple < 0.1) + { + $multiple = 100; + } + elseif($multiple < 1) + { + $multiple = 10; + } + */ + return ($multiple); +} + +function getMoneyPara_forPpsReport() +{ + global $omc_db; + $getSql = " SELECT pubVarValue FROM omcPubVarConf WHERE pubVarName='currency_decimal'"; + $getRes = @mysqli_query($pubConn, $getSql); + $getRow = @mysqli_fetch_array($getRes); + echo mysqli_error($pubConn); + $multiple = $getRow[pubVarValue]; + /* + if($multiple < 0.1) + { + $multiple = 100; + } + elseif($multiple < 1) + { + $multiple = 10; + } + */ + return ($multiple); +} + +//**************************************************************** +//鍑芥暟: +// getBitValue($hexStr,$offset) +//鍔熻兘璇存槑: +//浠庝竴涓崄鍏繘鍒跺瓧绗︿覆$hexStr涓彇鍑烘寚瀹氫綅缃�$offset鐨勪簩杩涘埗瀛楃 +//渚�: getBitValue('F1','0.1')=1 +// getBitValue('F1','1.0')=1 +// getBitValue('F1','1.1')=0 +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鍙栧嚭鐨勪簩杩涘埗瀛楃 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function getBitValue($hexStr, $offset) +{ + $DEBUG = 0; + if ($DEBUG) echo "
      hexStr=$hexStr"; + if ($DEBUG) echo "
      offset=$offset"; + $tmpArr = explode('-', $offset); + $tmpBgnArr = explode('.', $tmpArr[0]); + $bgnByteOffset = $tmpBgnArr[0]; + $bgnBitOffset = $tmpBgnArr[1]; + if ($DEBUG) echo "
      bgnByteOffset=$bgnByteOffset"; + if ($DEBUG) echo "
      bgnBitOffset=$bgnBitOffset"; + if (sizeof($tmpArr) > 1 && $tmpArr[0] != $tmpArr[1]) { + $tmpEndArr = explode('.', $tmpArr[1]); + $endByteOffset = $tmpEndArr[0]; + $endBitOffset = $tmpEndArr[1]; + if ($bgnBitOffset == 0 && $endBitOffset == 7) { + $byteOffset = $endByteOffset - $bgnByteOffset + 1; + $selByte = substr($hexStr, $bgnByteOffset * 2, $byteOffset * 2); + return ($selByte); + } else { + $tmpByte_1 = substr($hexStr, 0, $bgnByteOffset * 2); + $tmpByte_2 = substr($hexStr, ($endByteOffset + 1) * 2); + $selByte = substr($hexStr, $bgnByteOffset * 2, ($endByteOffset - $bgnByteOffset + 1) * 2); + if (strlen($selByte) > 2) {//涓嶈兘璺╞yte + return (-1); + } + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpDec = HexDec($selByte); + $binStr = DecBin($tmpDec); + for ($i = strlen($binStr); $i < strlen($selByte) * 4; $i++) { + $binStr = '0' . $binStr; + } + if ($DEBUG) echo "
      binStr=$binStr"; + if ($bgnBitOffset == 0) { + $selBit = substr($binStr, -($endBitOffset + 1)); + } else { + $selBit = substr($binStr, -($endBitOffset + 1), ($endBitOffset - $bgnBitOffset + 1)); + } + + return ($selBit); + } + } else { + if ($bgnByteOffset >= ceil(strlen($hexStr) / 2)) { + return (0); + } else { + $selByte = substr($hexStr, $bgnByteOffset * 2, 2); + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpDec = HexDec($selByte); + $binStr = DecBin($tmpDec); + if ($DEBUG) echo "
      binStr=$binStr"; + $binStrLen = strlen($binStr); + if ($bgnBitOffset >= $binStrLen) { + return (0); + } else { + $tmpLen = 0 - $bgnBitOffset - 1; + $selBit = substr($binStr, $tmpLen, 1); + if ($DEBUG) echo "
      selBit=$selBit=substr($binStr,$tmpLen,1)"; + return ($selBit); + } + } + } +} + +//**************************************************************** +//鍑芥暟: +// setBitValue($hexStr,$offset,$bitValue) +//鍔熻兘璇存槑: +//灏嗕竴涓崄鍏繘鍒跺瓧绗︿覆$hexStr涓寚瀹氫綅缃�$offset鐨勪簩杩涘埗瀛楃锛岃鎴愭寚瀹氱殑鍊�$bitValue +//渚�: setBitValue('F1','1.1','1')=F3 +// setBitValue('F1','0.1','0')=E1 +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 琚敼杩囩殑鍗佸叚杩涘埗瀛楃涓�$hexStr +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function setBitValue($hexStr, $offset, $bitValue) +{ + $DEBUG = 0; + if ($DEBUG) echo "
      ===================="; + if ($DEBUG) echo "
      hexStr=$hexStr"; + if ($DEBUG) echo "
      offset=$offset"; + $tmpArr = explode('-', $offset); + $tmpBgnArr = explode('.', $tmpArr[0]); + $bgnByteOffset = $tmpBgnArr[0]; + $bgnBitOffset = $tmpBgnArr[1]; + if ($DEBUG) echo "
      bgnByteOffset=$bgnByteOffset"; + if ($DEBUG) echo "
      bgnBitOffset=$bgnBitOffset"; + if (sizeof($tmpArr) > 1) { + $tmpEndArr = explode('.', $tmpArr[1]); + $endByteOffset = $tmpEndArr[0]; + $endBitOffset = $tmpEndArr[1]; + if ($DEBUG) echo "
      endByteOffset=$endByteOffset"; + if ($DEBUG) echo "
      endBitOffset=$endBitOffset"; + if ($bgnBitOffset == 0 && $endBitOffset == 7) { + //杩欐椂锛�$bitValue鏄�16杩涘�煎瓧绗︿覆锛屽叾浠栨儏鍐典笅锛岄兘鏄簩杩涘埗瀛楃涓� + $tmpByte_1 = substr($hexStr, 0, $bgnByteOffset * 2); + if ($DEBUG) echo "
      tmpByte_1=$tmpByte_1"; + $tmpByte_2 = substr($hexStr, ($endByteOffset + 1) * 2); + if ($DEBUG) echo "
      tmpByte_2=$tmpByte_2"; + $tmpHexStr = $tmpByte_1 . $bitValue . $tmpByte_2; + if ($DEBUG) echo "
      tmpHexStr=$tmpHexStr"; + return ($tmpHexStr); + } else { + $tmpByte_1 = substr($hexStr, 0, $bgnByteOffset * 2); + $tmpByte_2 = substr($hexStr, ($endByteOffset + 1) * 2); + $selByte = substr($hexStr, $bgnByteOffset * 2, ($endByteOffset - $bgnByteOffset + 1) * 2); + if (strlen($selByte) > 2) {//涓嶈兘璺╞yte + return (-1); + } + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpDec = HexDec($selByte); + $binStr = DecBin($tmpDec); + for ($i = strlen($binStr); $i < strlen($selByte) * 4; $i++) { + $binStr = '0' . $binStr; + } + if ($DEBUG) echo "
      binStr=$binStr"; + + $tmpBit_1 = substr($binStr, 0, 8 - $endBitOffset - 1); + if ($DEBUG) echo "
      tmpBit_1=$tmpBit_1"; + if ($bgnBitOffset == 0) { + $tmpBit_2 = ''; + } else { + $tmpBit_2 = substr($binStr, -($bgnBitOffset)); + } + if ($DEBUG) echo "
      tmpBit_2=$tmpBit_2"; + $tmpBit = $tmpBit_1 . $bitValue . $tmpBit_2; + if ($DEBUG) echo "
      tmpBit=$tmpBit"; + $tmpByte = dechex(BinDec($tmpBit)); + if ($DEBUG) echo "
      tmpByte=$tmpByte"; + for ($i = strlen($tmpByte); $i < strlen($selByte); $i++) { + $tmpByte = '0' . $tmpByte; + } + $tmpHexStr = $tmpByte_1 . $tmpByte . $tmpByte_2; + return ($tmpHexStr); + } + } else { + if ($bgnByteOffset >= ceil(strlen($hexStr) / 2)) { + return (-1); + } else { + $selByte = substr($hexStr, $bgnByteOffset * 2, 2); + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpDec = HexDec($selByte); + $binStr = DecBin($tmpDec); + $binStr = omc_keep_length($binStr, '0', '8', '1'); + if ($DEBUG) echo "
      binStr=$binStr"; + $tmpLen = 7 - $bgnBitOffset; + $tmpBit_1 = substr($binStr, 0, $tmpLen); + if ($DEBUG) echo "
      tmpBit_1=$tmpBit_1=substr($binStr,0,$tmpLen)"; + $tmpLen = 8 - $bgnBitOffset; + $tmpBit_2 = substr($binStr, $tmpLen); + if ($DEBUG) echo "
      tmpBit_2=$tmpBit_2=substr($binStr,$tmpLen) "; + $newBitStr = $tmpBit_1 . $bitValue . $tmpBit_2; + if ($DEBUG) echo "
      newBitStr=$newBitStr"; + $tmpDec = BinDec($newBitStr); + $selByte = DecHex($tmpDec); + $selByte = omc_keep_length($selByte, '0', '2', '1'); + if ($DEBUG) echo "
      selByte=$selByte"; + $tmpHexStr_1 = substr($hexStr, 0, $bgnByteOffset * 2); + $tmpHexStr_2 = substr($hexStr, $bgnByteOffset * 2 + 2); + if ($DEBUG) echo "
      tmpHexStr_1=$tmpHexStr_1 / tmpHexStr_2=$tmpHexStr_2 "; + $tmpHexStr = $tmpHexStr_1 . $selByte . $tmpHexStr_2; + if ($DEBUG) echo "
      tmpHexStr=$tmpHexStr"; + return ($tmpHexStr); + } + } +} + +//**************************************************************** +//鍑芥暟: +// getPubVar($pubVarName) +//鍔熻兘璇存槑: +//浠庤〃OMC_PUB.omcPubVarConf涓彇鍑哄搴斿彉閲忓悕鐨勫�� +//渚�: getPubVar('pssCardMinCount')=100 +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛氬彇鍑哄彉閲忓悕鐨勫�硷紝澶辫触锛�-1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function getPubVar($pubVarName) +{ + $DEBUG = 0; + global $pubConn; + $db = 'OMC_PUB'; + $tableName = 'omcPubVarConf'; + $sql = " SELECT pubVarValue + FROM $tableName + WHERE pubVarName='$pubVarName' + "; + if ($DEBUG) echo "
      sql=$sql"; + //$res = @mysqli_query($pubConn,$sql); + $res = mysqli_query($pubConn, $sql); + if (NULL == $res) return (-1); + if (mysqli_num_rows($res) > 0) { + $row = mysqli_fetch_array($res); + return ($row['pubVarValue']); + } else { + return (-1); + } +} + + +//**************************************************************** +//鍑芥暟: +// showComma($value) +//鍔熻兘璇存槑:濡傛灉鍊煎ぇ浜�3浣�,鍔犻�楀彿鏄剧ず +// +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛氳浆鎹㈢殑鍊硷紝澶辫触锛�-1 +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function showComma($value) +{ + $sValue = explode("-", $value); + if (isset($sValue[1])) + $pValue = explode(".", $sValue[1]); + else + $pValue = explode(".", $sValue[0]); + + $intValue = $pValue[0]; + $len = strlen($intValue); + $temValue = ''; + while ($len > 3) { + $value_1 = substr($intValue, -3); + $intValue = substr($intValue, 0, -3); + $temValue = "," . $value_1 . $temValue; + $len = strlen($intValue); + } + $temValue = $intValue . $temValue; + if (isset($pValue[1])) { + $temValue = $temValue . "." . $pValue[1]; + } + if (isset($sValue[1])) + $temValue = "-" . $temValue; + + return $temValue; +} + +//**************************************************************** +//鍑芥暟: +// showHelp($helpId) +//鍔熻兘璇存槑:鏄剧ず甯粍鏂囦欢 +// +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛� +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function showHelp($helpId) +{ + echo " "; + echo ""; + //echo "
      "; +} + + +//**************************************************************** +//鍑芥暟: +// getSerial() +//鍔熻兘璇存槑:寰楀埌鍚勬ā鍧楃殑绯诲垪鍙�,浠ュ強鎬荤殑绯诲垪鍙�. +// +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛� +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +function getSerial() +{ + $DEBUG = 0; + $dbName = 'OMC_PUB'; + $tbName = 'sysStat'; + global $ttlSerial; + global $srlArr; + global $noSrlStt, $ttlSrlClr; + global $pubConn; + + $selSql = " SELECT * FROM $tbName WHERE sysTypeNo = 0"; + if ($DEBUG) echo "
      selSql=$selSql"; + $selRes = mysqli_query($pubConn, $selSql); + $selRow = mysqli_fetch_array($selRes); + $detailStat = $selRow['detailStat']; + $ttlSerial = substr($detailStat, 39 * 2, 8); + $ttlSrlClr = "#000000"; + if ($DEBUG) echo "
      ttlSerial=$ttlSerial
      "; + + $selSql = " SELECT * FROM $tbName WHERE sysTypeNo=320 OR sysTypeNo = 330 OR sysTypeNo = 340 OR sysTypeNo = 360 OR sysTypeNo = 380 OR sysTypeNo = 390 OR sysTypeNo = 350 "; + + if ($DEBUG) echo "
      selSql=$selSql"; + $selRes = mysqli_query($pubConn, $selSql); + $selRow = mysqli_fetch_array($selRes); + + do { + if (!$selRow) + break; + $sysTypeNo = $selRow['sysTypeNo']; + $sysNo = $selRow['sysNo']; + if ($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + if ($DEBUG) echo "
      sysNo=$sysNo"; + $detailStat = $selRow['detailStat']; + if ($DEBUG) echo "
      detailStat=$detailStat"; + switch ($sysTypeNo) { + case '320': //MSC + $arrNum = 0; + $subBgn = 39; + break; + case '330': //HLR + $arrNum = 1; + $subBgn = 39; + break; + case '340': //AUC + $arrNum = 2; + $subBgn = 39; + break; + case '360': //PPS + $arrNum = 3; + $subBgn = 39; + break; + case '380': //EIR + $arrNum = 4; + $subBgn = 39; + break; + case '390': //VSS + $arrNum = 5; + $subBgn = 39; + break; + case '350': //SMSC + $arrNum = 6; + $subBgn = 39; + break; + default: + break; + } + + $srlArr[$arrNum][$sysNo]['number'] = substr($detailStat, $subBgn * 2, 8); + $srlArr[$arrNum][$sysNo]['color'] = "#000000"; + + if ($DEBUG) echo "
      srlArr[$arrNum][$sysNo] = {$srlArr[$arrNum][$sysNo]}
      "; + if ($srlArr[$arrNum][$sysNo]['number'] != $ttlSerial) { + $srlArr[$arrNum][$sysNo]['color'] = "#FF0000"; + $noSrlStt = 1; + } + if ($DEBUG) echo "
      noSrlStt=$noSrlStt"; + + } while ($selRow = mysqli_fetch_array($selRes)); + + + if ($DEBUG) echo "
      ttlSerial=$ttlSerial"; + if ($noSrlStt) + $ttlSrlClr = "#FF0000"; + else + $ttlSrlClr = "#000000"; + if ($DEBUG) echo "
      ttlSrlClr=$ttlSrlClr
      "; + + + return 1; +} + +function byte2ip($byteStr) +{ + for ($i = 0; $i < 4; $i++) { + $unitIp = substr($byteStr, $i * 2, 2); + $unitIp = hexdec($unitIp); + if ($i == 0) { + $ipStr = $unitIp; + } else { + $ipStr .= ".$unitIp"; + } + } + return ($ipStr); +} + +function changeByteOrder($hex_byte) +{ + while (strlen($hex_byte) % 2 == 1) + $hex_byte = "0" . $hex_byte; + $byte_len = strlen($hex_byte) / 2; + + $res = ""; + for ($i = 0; $i < $byte_len; $i++) { + $tmpstr = substr($hex_byte, $i * 2, 2); + $res = $tmpstr . $res; + } + return $res; +} + +function getSystemNameBySysTypeNo($sysTypeNo) +{ + global $pubConn; + + $sqlstr = "select sysTypeName from OMC_PUB.sysConf where sysTypeNo = $sysTypeNo "; + $res = @mysqli_query($pubConn, $sqlstr); + $row = @mysqli_fetch_array($res); + return $row['sysTypeName']; +} + +function getSystemState($sysTypeNo, $byteStart, $length) +{ + global $pubConn; + $sql = "select detailStat from OMC_PUB.sysStat where sysTypeNo=$sysTypeNo order by updateTime DESC "; + if ($DEBUG) echo "$sql
      "; + $result = @mysqli_query($pubConn, $sql); + $record_num = 0; + $record_num = @mysqli_num_rows($result); + + if ($record_num == 0) + return ""; + + $rows = @mysqli_fetch_array($result); + $allbin = $rows['detailStat']; + + if (strlen($allbin) < $length) + return ""; + + $resbin = substr($allbin, $byteStart, $length); + + return $resbin; +} + +//**************************************************************** +//鍑芥暟: +// getParamOptionArray +//鍔熻兘璇存槑:杩斿洖鍙傛暟閫夐」鍊肩殑鏁扮粍 +// +//鍙傛暟璇存槑: +// sysTypeNo: sysTypeNo +// value: parameter oid or name +// mode: PARAM_OID PARAM_NAME +//杩斿洖鍊硷細 +// 鎴愬姛锛� +// +//浣滆�咃細zhengjianhui +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- +define("PARAM_OID", 0); +define("PARAM_NAME", 1); +function getParamOptionArray($sysTypeNo, $value, $mode) +{ + $db = "OBJ_" . $sysTypeNo; + global $objDbConn; + if ($mode == PARAM_NAME) { + $sql = "select * from OBJ_$sysTypeNo.paramConf where name_2 like '%$value%' "; + } else { + $levelArr = explode('.', $value); + for ($j = 0; $j < sizeof($levelArr); $j++) { + $levelNo = $j + 1; + ${"level_$levelNo"} = $levelArr[$j]; + if ($DEBUG) echo "
      levelArr[$j]={$levelArr[$j]}"; + if ($j == 0) { + $levelWhere = "level_$levelNo='${"level_$levelNo"}'"; + } else { + $levelWhere .= " AND level_$levelNo='${"level_$levelNo"}'"; + } + } + + $sql = "select * from OBJ_$sysTypeNo.paramConf where $levelWhere "; + } + + $res = @mysqli_query($objDbConn, $sql); + $row = @mysqli_fetch_array($res); + $template = $row['setTemplate_2']; + $options = explode(";", $template); + for ($i = 0; $i < sizeof($options); $i++) { + $tmp = explode("=", $options[$i]); + $n = $tmp[0]; + $v = $tmp[1] + 0; + //echo "value=$v,name=$n
      "; + $arr[$v] = $n; + + } + return $arr; +} + + +function getMSSFtpAccount() +{ + global $pubConn; + + $default_user_name = "subsManager"; + $default_password = "iammanager"; + + $sql = "select * from OMC_PUB.omcPubVarConf where pubVarName='globalFTPUserName' "; +// $res=@mysqli_query($pubConn,$sql); +// $num=@mysqli_num_rows($res); + $res = @mysqli_query($pubConn, $sql); + $num = @mysqli_fetch_array($res); + if ($num == 0) { + $isql = "insert into OMC_PUB.omcPubVarConf(instance,pubVarName,pubVarValue,remark)values(18,'globalFTPUserName','subsManager','For Import subscriber, download PPS Tarriff, backup MSS subs data and MSS Configuration Synchronization');"; + @mysqli_query($pubConn, $isql); + $isql = "insert into OMC_PUB.omcPubVarConf(instance,pubVarName,pubVarValue,remark)values(18,'globalFTPPassword','iammanager','For Import subscriber, download PPS Tarriff, backup MSS subs data and MSS Configuration Synchronization');"; + @mysqli_query($pubConn, $isql); + } + + $row = @mysqli_fetch_array($res); + if (strlen(trim($row['pubVarValue'])) > 0) + $ftpInfo['UserName'] = $row['pubVarValue']; + else + $ftpInfo['UserName'] = $default_user_name; + + $sql = "select * from OMC_PUB.omcPubVarConf where pubVarName='globalFTPPassword' "; + $res = @mysqli_query($pubConn, $sql); + $row = @mysqli_fetch_array($res); + if (strlen(trim($row['pubVarValue'])) > 0) + $ftpInfo['Password'] = $row['pubVarValue']; + else + $ftpInfo['Password'] = $default_password; + + return $ftpInfo; +} + +//**************************************************************** +//鍑芥暟: +// alertMsgAndGoLastl() +//鍔熻兘璇存槑:浣跨敤JS鎻愮ず涓�浜涗俊鎭�. +// +//鍙傛暟璇存槑: +// +//杩斿洖鍊硷細 +// 鎴愬姛锛� +// +//浣滆�咃細 +// +//淇敼娉ㄩ噴锛� +//NO.1 +//濮撳悕锛� +//鏃堕棿锛� +//淇敼璇存槑锛� +//---------------------------------------------------------- + +function alertMsgAndGoLast($msg) +{ + echo ""; + exit(); +} + +//娉ㄦ剰锛氫笅闈㈢殑"? >"鍚庨潰涓嶈兘鏈夌┖琛岋紝鍚﹀垯cvs鏁版嵁涓嬭浇鏃讹紝浼氬嚭閿欍�� +?> + diff --git a/wxc2_omc/inc/mysqlpw.inc b/wxc2_omc/inc/mysqlpw.inc new file mode 100755 index 0000000..d3d99b5 --- /dev/null +++ b/wxc2_omc/inc/mysqlpw.inc @@ -0,0 +1,2 @@ +nqzvavfgengbe +*86#EBgnegfvavz diff --git a/wxc2_omc/inc/ua.js b/wxc2_omc/inc/ua.js new file mode 100755 index 0000000..699a02b --- /dev/null +++ b/wxc2_omc/inc/ua.js @@ -0,0 +1,150 @@ +/* + * $Log: ua.js,v $ + * Revision 1.1.1.1 2003/08/27 12:32:00 cvsroot + * omcWeb_v5 project + * + * Revision 1.9 2002/07/22 14:06:21 bc6ix + * fix license path, change version reporting to use 2 digits for each level + * + * Revision 1.8 2002/07/07 08:23:07 bc6ix + * fix line endings + * + * Revision 1.7 2002/05/14 16:52:52 bc6ix + * use CVS Log for revision history + * + * + */ + +/* ***** BEGIN LICENSE BLOCK ***** + * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * Full Terms at http://bclary.com/lib/js/license/mpl-tri-license.txt + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Netscape code. + * + * The Initial Developer of the Original Code is + * Netscape Corporation. + * Portions created by the Initial Developer are Copyright (C) 2001 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Bob Clary + * + * ***** END LICENSE BLOCK ***** */ + +function xbDetectBrowser() +{ + var oldOnError = window.onerror; + var element = null; + + window.onerror = null; + + // work around bug in xpcdom Mozilla 0.9.1 + window.saveNavigator = window.navigator; + + navigator.OS = ''; + navigator.version = parseFloat(navigator.appVersion); + navigator.org = ''; + navigator.family = ''; + + var platform; + if (typeof(window.navigator.platform) != 'undefined') + { + platform = window.navigator.platform.toLowerCase(); + if (platform.indexOf('win') != -1) + navigator.OS = 'win'; + else if (platform.indexOf('mac') != -1) + navigator.OS = 'mac'; + else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1) + navigator.OS = 'nix'; + } + + var i = 0; + var ua = window.navigator.userAgent.toLowerCase(); + + if (ua.indexOf('safari') != -1) + { + i = ua.indexOf('safari'); + navigator.family = 'safari'; + navigator.org = 'safari'; + navigator.version = parseFloat('0' + ua.substr(i+7), 10); + } + else if (ua.indexOf('opera') != -1) + { + i = ua.indexOf('opera'); + navigator.family = 'opera'; + navigator.org = 'opera'; + navigator.version = parseFloat('0' + ua.substr(i+6), 10); + } + else if ((i = ua.indexOf('msie')) != -1) + { + navigator.org = 'microsoft'; + navigator.version = parseFloat('0' + ua.substr(i+5), 10); + + if (navigator.version < 4) + navigator.family = 'ie3'; + else + navigator.family = 'ie4' + } + else if (ua.indexOf('gecko') != -1) + { + navigator.family = 'gecko'; + var rvStart = ua.indexOf('rv:'); + var rvEnd = ua.indexOf(')', rvStart); + var rv = ua.substring(rvStart+3, rvEnd); + var rvParts = rv.split('.'); + var rvValue = 0; + var exp = 1; + + for (var i = 0; i < rvParts.length; i++) + { + var val = parseInt(rvParts[i]); + rvValue += val / exp; + exp *= 100; + } + navigator.version = rvValue; + + if (ua.indexOf('netscape') != -1) + navigator.org = 'netscape'; + else if (ua.indexOf('compuserve') != -1) + navigator.org = 'compuserve'; + else + navigator.org = 'mozilla'; + } + else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1)) + { + var is_major = parseFloat(navigator.appVersion); + + if (is_major < 4) + navigator.version = is_major; + else + { + i = ua.lastIndexOf('/') + navigator.version = parseFloat('0' + ua.substr(i+1), 10); + } + navigator.org = 'netscape'; + navigator.family = 'nn' + parseInt(navigator.appVersion); + } + else if ((i = ua.indexOf('aol')) != -1 ) + { + // aol + navigator.family = 'aol'; + navigator.org = 'aol'; + navigator.version = parseFloat('0' + ua.substr(i+4), 10); + } + else if ((i = ua.indexOf('hotjava')) != -1 ) + { + // hotjava + navigator.family = 'hotjava'; + navigator.org = 'sun'; + navigator.version = parseFloat(navigator.appVersion); + } + + window.onerror = oldOnError; +} + +xbDetectBrowser(); + diff --git a/wxc2_omc/index.php b/wxc2_omc/index.php new file mode 100755 index 0000000..0794877 --- /dev/null +++ b/wxc2_omc/index.php @@ -0,0 +1,45 @@ + + + + +WXC2 EMS + +index.php begin"; + echo "
      selectedOmcPath:$selectedOmcPath"; + echo "
      inde.php end"; + } + echo " "; + exit(); + +} + +?> + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/omcHelp/.idea/encodings.xml b/wxc2_omc/omcHelp/.idea/encodings.xml new file mode 100755 index 0000000..7751dd2 --- /dev/null +++ b/wxc2_omc/omcHelp/.idea/encodings.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/wxc2_omc/omcHelp/0_0.htm b/wxc2_omc/omcHelp/0_0.htm new file mode 100755 index 0000000..69b647d --- /dev/null +++ b/wxc2_omc/omcHelp/0_0.htm @@ -0,0 +1,105 @@ +锘� + + + Preface + + + + + + + + + + + + + + + + + + + + +
      +

      Preface

      + +
      + Top  + + Next +
      + + + +
      +

       

      +

      EMS User Manual introduces users to the UltraWAVE EMS Graphical User Interface and helps the users use the UltraWAVE EMS. Users can get information about how to maintain the UltraWAVE system and advanced issues, such as configuring and managing system entities. Users can also find the answers to frequently asked questions in the FAQ chapter.

      +

       

      +

      This user manual can be navigated in several ways:

      +

      •Click 0_010 at the EMS GUI upper-right corner to get related topics of the current page

      •Complete the chapters sequentially

      •Use the navigation tree to find a certain topic

      •Look up key words in the index to go directly to the information

      •Search a certain word in the Search tab

       

      +

      The following table is a guide to using this user manual:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      New to UltraWAVE EMS

      +

      Chapter 1, "EMS GUI Introduction"

      +

      Monitoring UltraWAVE System Status

      +

      Chapter 2, "Status"

      +

      Analyzing System Traffic Profiles

      +

      Chapter 3, "Performance"

      +

      Viewing System Logs

      +

      Chapter 4, "Log"

      +

      Configuring System Entities

      +

      Chapter 5, "Configuration"

      +

      Managing Subscribers

      +

      Chapter 6, "Account"

      +

      Backing up System Data

      +

      Chapter 7, "Maintenance"

      +
      +
      +

       

      +

      Because UltraWAVE EMS GUI is customizable, what appears on the screen may vary slightly from illustrations in this user manual.

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      0.0

      + +
      + + + diff --git a/wxc2_omc/omcHelp/0_010.gif b/wxc2_omc/omcHelp/0_010.gif new file mode 100755 index 0000000..23f5c01 Binary files /dev/null and b/wxc2_omc/omcHelp/0_010.gif differ diff --git a/wxc2_omc/omcHelp/0_011.gif b/wxc2_omc/omcHelp/0_011.gif new file mode 100755 index 0000000..df76d09 Binary files /dev/null and b/wxc2_omc/omcHelp/0_011.gif differ diff --git a/wxc2_omc/omcHelp/0_012.gif b/wxc2_omc/omcHelp/0_012.gif new file mode 100755 index 0000000..f84ef50 Binary files /dev/null and b/wxc2_omc/omcHelp/0_012.gif differ diff --git a/wxc2_omc/omcHelp/0_1.htm b/wxc2_omc/omcHelp/0_1.htm new file mode 100755 index 0000000..d2bdd8a --- /dev/null +++ b/wxc2_omc/omcHelp/0_1.htm @@ -0,0 +1,245 @@ +锘� + + + EMS GUI Introduction + + + + + + + + + + + + + + + + + + + + +
      +

      EMS GUI Introduction

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      A typical UltraWAVE EMS GUI screen is divided into 5 windows as below:

      +

       

      +

      0_1_02

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Windows Name

      +

      Components

      +

      1

      +

      Main Menu

      +

      Company Logo, Main Menu, Alarm Indicators

      +

      2

      +

      System Info

      +

      System Time, Network Name, System Serial Number, Current Login Account

      +

      3

      +

      Submenu

      +

      Navigation Tree, Online Help Hyperlink, Site Map Hyperlink, Exit Button

      +

      4

      +

      Operation Bar

      +

      Operation Buttons, Online Help Hyperlink

      +

      5

      +

      Operation Window

      +

      Operation Window

      +
      +
      +

       

      +

       

      +

      Main Menus and Sub-menus

      +

       

      +

      The main menu lies on the top of the screen. The following table shows the function categories of the main menu.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Function Button

      +

      Features

      +

      Status

      +

      Status details for entities

      +

      Alarms

      +

      Performance

      +

      Service and call statistics

      +

      Graphical statistics reports

      +

      Log

      +

      Call Detailed Record (CDR)

      +

      CDR and CSTA backup

      +

      Used recharge cards record

      +

      Operation event and alarm logs

      +

      Configuration

      +

      Configure NSS and BSS parameters

      +

      Account

      +

      Subscriber query, modification and import

      +

      Maintenance

      +

      Parameter files backup

      +

      Account files backup

      +

      Event and alarms logs backup

      +

      System public parameters configuration

      +

      Advanced

      +

      Configure system parameters

      +

      For high privilege to maintain system

      +
      +
      +

       

      +

      Each function of the main menu contains a submenu which is displaying in a vertical navigation tree in the left-hand column of the screen. The system time and current login account displays at the top of the screen.

      +

       

      +

      Choose a category:

      +

       

      +

      1_010_011_014_011_016_011_012_011_024_011_018_011_020_01

      +

       

      +

       

      +

      Operation Windows

      +

       

      +

      The operation windows provide user operational data and results.

      +

       

      +

       

      +

      Alarm Status Indicators

      +

       

      +

      The alarm status indicator displays the following information:

      +

      •Five alarm status areas, one area for each alarm severity. The alarm severities are color coded, for example, the color red  indicates a critical alarm, orange indicates a major alarm etc.

      •Move the cursor on the flashing alarm indicator to display the number of alarms.

      •Click on the flashing alarm indicator to display the alarm descriptions.

       

      +

      The following table lists the alarm severities and their corresponding color-codes:

      +

       

      +

      0_012

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Color Code

      +

      Alarm Severity

      +

      Descriptions

      +

       

      +

      Critical

      +

      Severely broken and no workaround.

      +

       

      +

      Major

      +

      A defect that needs to be fixed but there is a workaround.

      +

       

      +

      Minor

      +

      A defect that causes small impact.  Easy to recover or workaround.

      +

       

      +

      Warning

      +

      Trivial defect.

      +

       

      +

      Indeterminate

      +

      Undefined problems.

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      0.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/0_1_02.gif b/wxc2_omc/omcHelp/0_1_02.gif new file mode 100755 index 0000000..692361e Binary files /dev/null and b/wxc2_omc/omcHelp/0_1_02.gif differ diff --git a/wxc2_omc/omcHelp/1.htm b/wxc2_omc/omcHelp/1.htm new file mode 100755 index 0000000..5b365fc --- /dev/null +++ b/wxc2_omc/omcHelp/1.htm @@ -0,0 +1,68 @@ +锘� + + + Status + + + + + + + + + + + + + + + + + + + + +
      +

      Status

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      1_010_021_014_011_016_011_012_011_024_011_018_011_020_01

      +

       

      +

      1_105_01

      +

      1_105_03

      +

      1_105_04

      +

      1_105_05

      +

      1_105_11

      +

      1_105_06

      +

      1_105_07

      +

      1_105_08

      +

      1_105_09

      +

      1_105_10

      +

       

      +

      The UltraWAVE EMS provides real time status information of all UltraWAVE entities. The basic running status of each entity is displayed in interactive graphics based on HTML. The detailed status information of each entity is displayed in tabular profiles. The EMS status pages refreshes every ten seconds.

      +

       

      +

      The Status comprises:

      +

      •Application: Detailed status information of EMS and licensed NSS application entities

      •Platform: Status information of the server hardware platform

      •Link and Linkset

      •Trunk Group and Media Gateway

      •BSC: Status information of connected BSC

      •BTS: Status information of connected BTS

       

      +

       

      +

       

      +

       

      +

       

      +

      1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/11.htm b/wxc2_omc/omcHelp/11.htm new file mode 100755 index 0000000..38aaf9d --- /dev/null +++ b/wxc2_omc/omcHelp/11.htm @@ -0,0 +1,371 @@ +锘� + + + Revise History + + + + + + + + + + + + + + + + + + + + +
      +

      Revise History

      + +
      + Top  + Previous  + +
      + + + +
      +

      •Revision History

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Date

      +

      Topic ID

      +

      Entity

      +

      Description

      +

      20090709

      +

      2_68

      +

      iPALIM

      +

      Correct parameter configuration.

      +

      2_69

      +

      iRLS

      +

      Correct VIM description.

      +

      2_2_1_8

      +

      OPPS Subs

      +

      Add parameter. Correct wrong figure.

      +

      20090916

      +

      2_66

      +

      MRFC

      +

      Add parameters: Conf User Number & Trans User Number

      +

      20090921

      +

      2_1_0

      +

      MTP

      +

      Add descriptions: Flexible Point Codes Function

      +

      1_2_2_2

      +

      MHC

      +

      Add descriptions of MHC

      +

      2_1

      +

      MHC

      +

      Add hyperlink of MHC

      +

      2_1_1_14

      +

      MHC

      +

      Add new topic

      +

      3

      +

      MHC CSTA

      +

      Add hyperlink of MHC

      +

      3_14

      +

      MHC CSTA

      +

      Add new topic

      +

      4

      +

      MHC CDR

      +

      Add hyperlink of MHC

      +

      4_12

      +

      MHC CDR

      +

      Add new topic

      +

      20091029

      +

      0_1

      +

      GUI

      +

      Renew GUI introduction

      +

      1_2_2_1

      +

      EMS Processes

      +

      Add new processes: NRTRDE & sftpSend

      +

      20100610

      +

      2_1

      +

      All

      +

      Update all parameter dictionary to R9.1.9

      +

      20100625

      +

      2_2_1_3

      +

      PPS Subs

      +

      Update PPS subs parameter table to R9.1.9

      +

      20120514

      +

      2_70

      +

      PPS

      +

      Add configuration procedures for balance transfer.

      +

      2_48

      +

      PPS

      +

      Update configuration procedures for prepaid service.

      +

      2_48

      +

      PPS

      +

      Move all prepaid service configuration pages under enabling prepaid service topic

      +

      20120517

      +

      2_48

      +

      PPS

      +

      Revise the configuration procedures for prepaid service

      +

      20120518

      +

      2_48_2

      +

      PPS

      +

      Add a separate chapter for PPS interactive SMS configuration

      +

      20120521

      +

      2_48_1

      +

      PPS

      +

      Add a separate chapter for PPS audio prompt configuration

      +

      20120522

      +

      2_48_3

      +

      PPS

      +

      Revise the USSD applications for prepaid

      +

      20120523

      +

      2_48_4

      +

      PPS

      +

      Revise the configuration procedures for Cap Call

      +

      20120524

      +

      2_48_5

      +

      PPS

      +

      Revise the configuration procedures for Balance Transfer

      +

      20120525

      +

      2_48_6

      +

      PPS

      +

      Add a separate chapter for F&F Number service

      +

      20120528

      +

      2_48_7

      +

      PPS

      +

      Add a separate chapter for P&C Number service

      +

      20120529

      +

      2_48_8

      +

      PPS

      +

      Add a separate chapter for Call Me Back

      +

      20120530

      +

      2_48_9

      +

      PPS

      +

      Add a separate chapter for Tier Rating

      +

      20120531

      +

      2_46

      +

      OSB

      +

      Update configuration procedures for Called Number Prefix Barring

      +

      20120601

      +

      2_48_10

      +

      PPS

      +

      Add a separate chapter for Free SMS

      +

      20120605

      +

      2_53

      +

      ACN

      +

      Update configuration procedures for ACN

      +

      20120612

      +

      All

      +

      All

      +

      Revise text style and release version 1.0

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      11

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_010_01.gif b/wxc2_omc/omcHelp/1_010_01.gif new file mode 100755 index 0000000..506250c Binary files /dev/null and b/wxc2_omc/omcHelp/1_010_01.gif differ diff --git a/wxc2_omc/omcHelp/1_010_02.gif b/wxc2_omc/omcHelp/1_010_02.gif new file mode 100755 index 0000000..b88e73a Binary files /dev/null and b/wxc2_omc/omcHelp/1_010_02.gif differ diff --git a/wxc2_omc/omcHelp/1_012_01.gif b/wxc2_omc/omcHelp/1_012_01.gif new file mode 100755 index 0000000..c0aa0a9 Binary files /dev/null and b/wxc2_omc/omcHelp/1_012_01.gif differ diff --git a/wxc2_omc/omcHelp/1_012_02.gif b/wxc2_omc/omcHelp/1_012_02.gif new file mode 100755 index 0000000..732dfd0 Binary files /dev/null and b/wxc2_omc/omcHelp/1_012_02.gif differ diff --git a/wxc2_omc/omcHelp/1_014_01.gif b/wxc2_omc/omcHelp/1_014_01.gif new file mode 100755 index 0000000..f720f0b Binary files /dev/null and b/wxc2_omc/omcHelp/1_014_01.gif differ diff --git a/wxc2_omc/omcHelp/1_014_02.gif b/wxc2_omc/omcHelp/1_014_02.gif new file mode 100755 index 0000000..a564f5d Binary files /dev/null and b/wxc2_omc/omcHelp/1_014_02.gif differ diff --git a/wxc2_omc/omcHelp/1_016_01.gif b/wxc2_omc/omcHelp/1_016_01.gif new file mode 100755 index 0000000..e620b89 Binary files /dev/null and b/wxc2_omc/omcHelp/1_016_01.gif differ diff --git a/wxc2_omc/omcHelp/1_016_02.gif b/wxc2_omc/omcHelp/1_016_02.gif new file mode 100755 index 0000000..927a687 Binary files /dev/null and b/wxc2_omc/omcHelp/1_016_02.gif differ diff --git a/wxc2_omc/omcHelp/1_018_01.gif b/wxc2_omc/omcHelp/1_018_01.gif new file mode 100755 index 0000000..e09f9c8 Binary files /dev/null and b/wxc2_omc/omcHelp/1_018_01.gif differ diff --git a/wxc2_omc/omcHelp/1_018_02.gif b/wxc2_omc/omcHelp/1_018_02.gif new file mode 100755 index 0000000..119f357 Binary files /dev/null and b/wxc2_omc/omcHelp/1_018_02.gif differ diff --git a/wxc2_omc/omcHelp/1_020_01.gif b/wxc2_omc/omcHelp/1_020_01.gif new file mode 100755 index 0000000..d606274 Binary files /dev/null and b/wxc2_omc/omcHelp/1_020_01.gif differ diff --git a/wxc2_omc/omcHelp/1_020_02.gif b/wxc2_omc/omcHelp/1_020_02.gif new file mode 100755 index 0000000..1996deb Binary files /dev/null and b/wxc2_omc/omcHelp/1_020_02.gif differ diff --git a/wxc2_omc/omcHelp/1_024_01.gif b/wxc2_omc/omcHelp/1_024_01.gif new file mode 100755 index 0000000..f58f1bd Binary files /dev/null and b/wxc2_omc/omcHelp/1_024_01.gif differ diff --git a/wxc2_omc/omcHelp/1_024_02.gif b/wxc2_omc/omcHelp/1_024_02.gif new file mode 100755 index 0000000..a1fc412 Binary files /dev/null and b/wxc2_omc/omcHelp/1_024_02.gif differ diff --git a/wxc2_omc/omcHelp/1_105_01.gif b/wxc2_omc/omcHelp/1_105_01.gif new file mode 100755 index 0000000..acb52fd Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_01.gif differ diff --git a/wxc2_omc/omcHelp/1_105_03.gif b/wxc2_omc/omcHelp/1_105_03.gif new file mode 100755 index 0000000..c5b8461 Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_03.gif differ diff --git a/wxc2_omc/omcHelp/1_105_04.gif b/wxc2_omc/omcHelp/1_105_04.gif new file mode 100755 index 0000000..9beeca4 Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_04.gif differ diff --git a/wxc2_omc/omcHelp/1_105_05.gif b/wxc2_omc/omcHelp/1_105_05.gif new file mode 100755 index 0000000..5f4d3aa Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_05.gif differ diff --git a/wxc2_omc/omcHelp/1_105_06.gif b/wxc2_omc/omcHelp/1_105_06.gif new file mode 100755 index 0000000..c9ecdea Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_06.gif differ diff --git a/wxc2_omc/omcHelp/1_105_07.gif b/wxc2_omc/omcHelp/1_105_07.gif new file mode 100755 index 0000000..05f696a Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_07.gif differ diff --git a/wxc2_omc/omcHelp/1_105_08.gif b/wxc2_omc/omcHelp/1_105_08.gif new file mode 100755 index 0000000..47a470f Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_08.gif differ diff --git a/wxc2_omc/omcHelp/1_105_09.gif b/wxc2_omc/omcHelp/1_105_09.gif new file mode 100755 index 0000000..599088c Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_09.gif differ diff --git a/wxc2_omc/omcHelp/1_105_10.gif b/wxc2_omc/omcHelp/1_105_10.gif new file mode 100755 index 0000000..85ea966 Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_10.gif differ diff --git a/wxc2_omc/omcHelp/1_105_11.gif b/wxc2_omc/omcHelp/1_105_11.gif new file mode 100755 index 0000000..b09cc37 Binary files /dev/null and b/wxc2_omc/omcHelp/1_105_11.gif differ diff --git a/wxc2_omc/omcHelp/1_107_01.gif b/wxc2_omc/omcHelp/1_107_01.gif new file mode 100755 index 0000000..acd6958 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_01.gif differ diff --git a/wxc2_omc/omcHelp/1_107_02.gif b/wxc2_omc/omcHelp/1_107_02.gif new file mode 100755 index 0000000..d4539c3 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_02.gif differ diff --git a/wxc2_omc/omcHelp/1_107_03.gif b/wxc2_omc/omcHelp/1_107_03.gif new file mode 100755 index 0000000..585f963 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_03.gif differ diff --git a/wxc2_omc/omcHelp/1_107_04.gif b/wxc2_omc/omcHelp/1_107_04.gif new file mode 100755 index 0000000..3ee2d9f Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_04.gif differ diff --git a/wxc2_omc/omcHelp/1_107_05.gif b/wxc2_omc/omcHelp/1_107_05.gif new file mode 100755 index 0000000..cd490bf Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_05.gif differ diff --git a/wxc2_omc/omcHelp/1_107_06.gif b/wxc2_omc/omcHelp/1_107_06.gif new file mode 100755 index 0000000..2e3ef25 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_06.gif differ diff --git a/wxc2_omc/omcHelp/1_107_07.gif b/wxc2_omc/omcHelp/1_107_07.gif new file mode 100755 index 0000000..3041a85 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_07.gif differ diff --git a/wxc2_omc/omcHelp/1_107_08.gif b/wxc2_omc/omcHelp/1_107_08.gif new file mode 100755 index 0000000..75e7768 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_08.gif differ diff --git a/wxc2_omc/omcHelp/1_107_09.gif b/wxc2_omc/omcHelp/1_107_09.gif new file mode 100755 index 0000000..4896b39 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_09.gif differ diff --git a/wxc2_omc/omcHelp/1_107_10.gif b/wxc2_omc/omcHelp/1_107_10.gif new file mode 100755 index 0000000..6745641 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_10.gif differ diff --git a/wxc2_omc/omcHelp/1_107_11.gif b/wxc2_omc/omcHelp/1_107_11.gif new file mode 100755 index 0000000..1d78b3b Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_11.gif differ diff --git a/wxc2_omc/omcHelp/1_107_12.gif b/wxc2_omc/omcHelp/1_107_12.gif new file mode 100755 index 0000000..1cd447d Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_12.gif differ diff --git a/wxc2_omc/omcHelp/1_107_13.gif b/wxc2_omc/omcHelp/1_107_13.gif new file mode 100755 index 0000000..9be46bd Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_13.gif differ diff --git a/wxc2_omc/omcHelp/1_107_14.gif b/wxc2_omc/omcHelp/1_107_14.gif new file mode 100755 index 0000000..0337cc7 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_14.gif differ diff --git a/wxc2_omc/omcHelp/1_107_15.gif b/wxc2_omc/omcHelp/1_107_15.gif new file mode 100755 index 0000000..826fb57 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_15.gif differ diff --git a/wxc2_omc/omcHelp/1_107_16.gif b/wxc2_omc/omcHelp/1_107_16.gif new file mode 100755 index 0000000..f374009 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_16.gif differ diff --git a/wxc2_omc/omcHelp/1_107_17.gif b/wxc2_omc/omcHelp/1_107_17.gif new file mode 100755 index 0000000..6267935 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_17.gif differ diff --git a/wxc2_omc/omcHelp/1_107_18.gif b/wxc2_omc/omcHelp/1_107_18.gif new file mode 100755 index 0000000..4df8cd1 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_18.gif differ diff --git a/wxc2_omc/omcHelp/1_107_19.gif b/wxc2_omc/omcHelp/1_107_19.gif new file mode 100755 index 0000000..32a8e0f Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_19.gif differ diff --git a/wxc2_omc/omcHelp/1_107_20.gif b/wxc2_omc/omcHelp/1_107_20.gif new file mode 100755 index 0000000..0143e2e Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_20.gif differ diff --git a/wxc2_omc/omcHelp/1_107_21.gif b/wxc2_omc/omcHelp/1_107_21.gif new file mode 100755 index 0000000..60e4c8b Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_21.gif differ diff --git a/wxc2_omc/omcHelp/1_107_22.gif b/wxc2_omc/omcHelp/1_107_22.gif new file mode 100755 index 0000000..6545b83 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_22.gif differ diff --git a/wxc2_omc/omcHelp/1_107_23.gif b/wxc2_omc/omcHelp/1_107_23.gif new file mode 100755 index 0000000..696b1b6 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_23.gif differ diff --git a/wxc2_omc/omcHelp/1_107_24.gif b/wxc2_omc/omcHelp/1_107_24.gif new file mode 100755 index 0000000..b906ab2 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_24.gif differ diff --git a/wxc2_omc/omcHelp/1_107_25.gif b/wxc2_omc/omcHelp/1_107_25.gif new file mode 100755 index 0000000..b34bbc5 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_25.gif differ diff --git a/wxc2_omc/omcHelp/1_107_26.gif b/wxc2_omc/omcHelp/1_107_26.gif new file mode 100755 index 0000000..a111228 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_26.gif differ diff --git a/wxc2_omc/omcHelp/1_107_27.gif b/wxc2_omc/omcHelp/1_107_27.gif new file mode 100755 index 0000000..8966990 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_27.gif differ diff --git a/wxc2_omc/omcHelp/1_107_28.gif b/wxc2_omc/omcHelp/1_107_28.gif new file mode 100755 index 0000000..b97787c Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_28.gif differ diff --git a/wxc2_omc/omcHelp/1_107_29.gif b/wxc2_omc/omcHelp/1_107_29.gif new file mode 100755 index 0000000..af80e05 Binary files /dev/null and b/wxc2_omc/omcHelp/1_107_29.gif differ diff --git a/wxc2_omc/omcHelp/1_108_01.gif b/wxc2_omc/omcHelp/1_108_01.gif new file mode 100755 index 0000000..294dcdf Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_01.gif differ diff --git a/wxc2_omc/omcHelp/1_108_02.gif b/wxc2_omc/omcHelp/1_108_02.gif new file mode 100755 index 0000000..eae1ac5 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_02.gif differ diff --git a/wxc2_omc/omcHelp/1_108_03.gif b/wxc2_omc/omcHelp/1_108_03.gif new file mode 100755 index 0000000..0143e2e Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_03.gif differ diff --git a/wxc2_omc/omcHelp/1_108_04.gif b/wxc2_omc/omcHelp/1_108_04.gif new file mode 100755 index 0000000..2e3ef25 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_04.gif differ diff --git a/wxc2_omc/omcHelp/1_108_05.gif b/wxc2_omc/omcHelp/1_108_05.gif new file mode 100755 index 0000000..826fb57 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_05.gif differ diff --git a/wxc2_omc/omcHelp/1_108_06.gif b/wxc2_omc/omcHelp/1_108_06.gif new file mode 100755 index 0000000..3ee2d9f Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_06.gif differ diff --git a/wxc2_omc/omcHelp/1_108_07.gif b/wxc2_omc/omcHelp/1_108_07.gif new file mode 100755 index 0000000..cd490bf Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_07.gif differ diff --git a/wxc2_omc/omcHelp/1_108_08.gif b/wxc2_omc/omcHelp/1_108_08.gif new file mode 100755 index 0000000..aaff4b1 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_08.gif differ diff --git a/wxc2_omc/omcHelp/1_108_09.gif b/wxc2_omc/omcHelp/1_108_09.gif new file mode 100755 index 0000000..6745641 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_09.gif differ diff --git a/wxc2_omc/omcHelp/1_108_10.gif b/wxc2_omc/omcHelp/1_108_10.gif new file mode 100755 index 0000000..fa7edfe Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_10.gif differ diff --git a/wxc2_omc/omcHelp/1_108_11.gif b/wxc2_omc/omcHelp/1_108_11.gif new file mode 100755 index 0000000..6a0daae Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_11.gif differ diff --git a/wxc2_omc/omcHelp/1_108_12.gif b/wxc2_omc/omcHelp/1_108_12.gif new file mode 100755 index 0000000..6f51d37 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_12.gif differ diff --git a/wxc2_omc/omcHelp/1_108_14.gif b/wxc2_omc/omcHelp/1_108_14.gif new file mode 100755 index 0000000..425a192 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_14.gif differ diff --git a/wxc2_omc/omcHelp/1_108_15.gif b/wxc2_omc/omcHelp/1_108_15.gif new file mode 100755 index 0000000..074fd39 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_15.gif differ diff --git a/wxc2_omc/omcHelp/1_108_16.gif b/wxc2_omc/omcHelp/1_108_16.gif new file mode 100755 index 0000000..08f3a84 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_16.gif differ diff --git a/wxc2_omc/omcHelp/1_108_17.gif b/wxc2_omc/omcHelp/1_108_17.gif new file mode 100755 index 0000000..b5c80cb Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_17.gif differ diff --git a/wxc2_omc/omcHelp/1_108_18.gif b/wxc2_omc/omcHelp/1_108_18.gif new file mode 100755 index 0000000..7224911 Binary files /dev/null and b/wxc2_omc/omcHelp/1_108_18.gif differ diff --git a/wxc2_omc/omcHelp/1_109_01.gif b/wxc2_omc/omcHelp/1_109_01.gif new file mode 100755 index 0000000..45f6331 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_01.gif differ diff --git a/wxc2_omc/omcHelp/1_109_02.gif b/wxc2_omc/omcHelp/1_109_02.gif new file mode 100755 index 0000000..d65edf7 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_02.gif differ diff --git a/wxc2_omc/omcHelp/1_109_03.gif b/wxc2_omc/omcHelp/1_109_03.gif new file mode 100755 index 0000000..49bedcc Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_03.gif differ diff --git a/wxc2_omc/omcHelp/1_109_04.gif b/wxc2_omc/omcHelp/1_109_04.gif new file mode 100755 index 0000000..7d10e00 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_04.gif differ diff --git a/wxc2_omc/omcHelp/1_109_05.gif b/wxc2_omc/omcHelp/1_109_05.gif new file mode 100755 index 0000000..13b6b3d Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_05.gif differ diff --git a/wxc2_omc/omcHelp/1_109_06.gif b/wxc2_omc/omcHelp/1_109_06.gif new file mode 100755 index 0000000..03cf27c Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_06.gif differ diff --git a/wxc2_omc/omcHelp/1_109_07.gif b/wxc2_omc/omcHelp/1_109_07.gif new file mode 100755 index 0000000..8bd099c Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_07.gif differ diff --git a/wxc2_omc/omcHelp/1_109_08.gif b/wxc2_omc/omcHelp/1_109_08.gif new file mode 100755 index 0000000..af56352 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_08.gif differ diff --git a/wxc2_omc/omcHelp/1_109_09.gif b/wxc2_omc/omcHelp/1_109_09.gif new file mode 100755 index 0000000..e69e42d Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_09.gif differ diff --git a/wxc2_omc/omcHelp/1_109_10.gif b/wxc2_omc/omcHelp/1_109_10.gif new file mode 100755 index 0000000..db1d450 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_10.gif differ diff --git a/wxc2_omc/omcHelp/1_109_11.gif b/wxc2_omc/omcHelp/1_109_11.gif new file mode 100755 index 0000000..6776f4c Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_11.gif differ diff --git a/wxc2_omc/omcHelp/1_109_12.gif b/wxc2_omc/omcHelp/1_109_12.gif new file mode 100755 index 0000000..8e7a4b8 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_12.gif differ diff --git a/wxc2_omc/omcHelp/1_109_13.gif b/wxc2_omc/omcHelp/1_109_13.gif new file mode 100755 index 0000000..282e29e Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_13.gif differ diff --git a/wxc2_omc/omcHelp/1_109_14.gif b/wxc2_omc/omcHelp/1_109_14.gif new file mode 100755 index 0000000..001bbce Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_14.gif differ diff --git a/wxc2_omc/omcHelp/1_109_15.gif b/wxc2_omc/omcHelp/1_109_15.gif new file mode 100755 index 0000000..97fc6fc Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_15.gif differ diff --git a/wxc2_omc/omcHelp/1_109_16.gif b/wxc2_omc/omcHelp/1_109_16.gif new file mode 100755 index 0000000..170dab6 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_16.gif differ diff --git a/wxc2_omc/omcHelp/1_109_17.gif b/wxc2_omc/omcHelp/1_109_17.gif new file mode 100755 index 0000000..8e0444b Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_17.gif differ diff --git a/wxc2_omc/omcHelp/1_109_18.gif b/wxc2_omc/omcHelp/1_109_18.gif new file mode 100755 index 0000000..aeca150 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_18.gif differ diff --git a/wxc2_omc/omcHelp/1_109_19.gif b/wxc2_omc/omcHelp/1_109_19.gif new file mode 100755 index 0000000..2702703 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_19.gif differ diff --git a/wxc2_omc/omcHelp/1_109_20.gif b/wxc2_omc/omcHelp/1_109_20.gif new file mode 100755 index 0000000..a3f4baf Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_20.gif differ diff --git a/wxc2_omc/omcHelp/1_109_21.gif b/wxc2_omc/omcHelp/1_109_21.gif new file mode 100755 index 0000000..566d8b6 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_21.gif differ diff --git a/wxc2_omc/omcHelp/1_109_22.gif b/wxc2_omc/omcHelp/1_109_22.gif new file mode 100755 index 0000000..6e93c0c Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_22.gif differ diff --git a/wxc2_omc/omcHelp/1_109_23.gif b/wxc2_omc/omcHelp/1_109_23.gif new file mode 100755 index 0000000..ec5d881 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_23.gif differ diff --git a/wxc2_omc/omcHelp/1_109_24.gif b/wxc2_omc/omcHelp/1_109_24.gif new file mode 100755 index 0000000..9add4f8 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_24.gif differ diff --git a/wxc2_omc/omcHelp/1_109_25.gif b/wxc2_omc/omcHelp/1_109_25.gif new file mode 100755 index 0000000..46b6304 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_25.gif differ diff --git a/wxc2_omc/omcHelp/1_109_26.gif b/wxc2_omc/omcHelp/1_109_26.gif new file mode 100755 index 0000000..c2b49cb Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_26.gif differ diff --git a/wxc2_omc/omcHelp/1_109_27.gif b/wxc2_omc/omcHelp/1_109_27.gif new file mode 100755 index 0000000..1a09d21 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_27.gif differ diff --git a/wxc2_omc/omcHelp/1_109_28.gif b/wxc2_omc/omcHelp/1_109_28.gif new file mode 100755 index 0000000..1a9d942 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_28.gif differ diff --git a/wxc2_omc/omcHelp/1_109_29.gif b/wxc2_omc/omcHelp/1_109_29.gif new file mode 100755 index 0000000..143cb1e Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_29.gif differ diff --git a/wxc2_omc/omcHelp/1_109_30.gif b/wxc2_omc/omcHelp/1_109_30.gif new file mode 100755 index 0000000..1efa156 Binary files /dev/null and b/wxc2_omc/omcHelp/1_109_30.gif differ diff --git a/wxc2_omc/omcHelp/1_111_01.gif b/wxc2_omc/omcHelp/1_111_01.gif new file mode 100755 index 0000000..db16e10 Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_01.gif differ diff --git a/wxc2_omc/omcHelp/1_111_02.gif b/wxc2_omc/omcHelp/1_111_02.gif new file mode 100755 index 0000000..9f8f6c7 Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_02.gif differ diff --git a/wxc2_omc/omcHelp/1_111_03.gif b/wxc2_omc/omcHelp/1_111_03.gif new file mode 100755 index 0000000..3df77ca Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_03.gif differ diff --git a/wxc2_omc/omcHelp/1_111_04.gif b/wxc2_omc/omcHelp/1_111_04.gif new file mode 100755 index 0000000..eddde4c Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_04.gif differ diff --git a/wxc2_omc/omcHelp/1_111_05.gif b/wxc2_omc/omcHelp/1_111_05.gif new file mode 100755 index 0000000..cddfee2 Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_05.gif differ diff --git a/wxc2_omc/omcHelp/1_111_06.gif b/wxc2_omc/omcHelp/1_111_06.gif new file mode 100755 index 0000000..fb4b216 Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_06.gif differ diff --git a/wxc2_omc/omcHelp/1_111_07.gif b/wxc2_omc/omcHelp/1_111_07.gif new file mode 100755 index 0000000..3c13168 Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_07.gif differ diff --git a/wxc2_omc/omcHelp/1_111_08.gif b/wxc2_omc/omcHelp/1_111_08.gif new file mode 100755 index 0000000..594a0e0 Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_08.gif differ diff --git a/wxc2_omc/omcHelp/1_111_09.gif b/wxc2_omc/omcHelp/1_111_09.gif new file mode 100755 index 0000000..0d85e36 Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_09.gif differ diff --git a/wxc2_omc/omcHelp/1_111_10.gif b/wxc2_omc/omcHelp/1_111_10.gif new file mode 100755 index 0000000..d431706 Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_10.gif differ diff --git a/wxc2_omc/omcHelp/1_111_11.gif b/wxc2_omc/omcHelp/1_111_11.gif new file mode 100755 index 0000000..489a49f Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_11.gif differ diff --git a/wxc2_omc/omcHelp/1_111_12.gif b/wxc2_omc/omcHelp/1_111_12.gif new file mode 100755 index 0000000..5bcb9aa Binary files /dev/null and b/wxc2_omc/omcHelp/1_111_12.gif differ diff --git a/wxc2_omc/omcHelp/1_113_01.gif b/wxc2_omc/omcHelp/1_113_01.gif new file mode 100755 index 0000000..68eb946 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_01.gif differ diff --git a/wxc2_omc/omcHelp/1_113_02.gif b/wxc2_omc/omcHelp/1_113_02.gif new file mode 100755 index 0000000..b9326dc Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_02.gif differ diff --git a/wxc2_omc/omcHelp/1_113_03.gif b/wxc2_omc/omcHelp/1_113_03.gif new file mode 100755 index 0000000..bce831f Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_03.gif differ diff --git a/wxc2_omc/omcHelp/1_113_04.gif b/wxc2_omc/omcHelp/1_113_04.gif new file mode 100755 index 0000000..33aa1e5 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_04.gif differ diff --git a/wxc2_omc/omcHelp/1_113_05.gif b/wxc2_omc/omcHelp/1_113_05.gif new file mode 100755 index 0000000..4ff678c Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_05.gif differ diff --git a/wxc2_omc/omcHelp/1_113_06.gif b/wxc2_omc/omcHelp/1_113_06.gif new file mode 100755 index 0000000..d4a9670 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_06.gif differ diff --git a/wxc2_omc/omcHelp/1_113_07.gif b/wxc2_omc/omcHelp/1_113_07.gif new file mode 100755 index 0000000..f36b5c8 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_07.gif differ diff --git a/wxc2_omc/omcHelp/1_113_08.gif b/wxc2_omc/omcHelp/1_113_08.gif new file mode 100755 index 0000000..35b0f06 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_08.gif differ diff --git a/wxc2_omc/omcHelp/1_113_09.gif b/wxc2_omc/omcHelp/1_113_09.gif new file mode 100755 index 0000000..be69953 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_09.gif differ diff --git a/wxc2_omc/omcHelp/1_113_10.gif b/wxc2_omc/omcHelp/1_113_10.gif new file mode 100755 index 0000000..da15933 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_10.gif differ diff --git a/wxc2_omc/omcHelp/1_113_11.gif b/wxc2_omc/omcHelp/1_113_11.gif new file mode 100755 index 0000000..a7caba6 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_11.gif differ diff --git a/wxc2_omc/omcHelp/1_113_12.gif b/wxc2_omc/omcHelp/1_113_12.gif new file mode 100755 index 0000000..9539b01 Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_12.gif differ diff --git a/wxc2_omc/omcHelp/1_113_13.gif b/wxc2_omc/omcHelp/1_113_13.gif new file mode 100755 index 0000000..f44d60a Binary files /dev/null and b/wxc2_omc/omcHelp/1_113_13.gif differ diff --git a/wxc2_omc/omcHelp/1_2_2.htm b/wxc2_omc/omcHelp/1_2_2.htm new file mode 100755 index 0000000..790f09c --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_2.htm @@ -0,0 +1,65 @@ +锘� + + + Application + + + + + + + + + + + + + + + + + + + + +
      +

      Application

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      1.Click the Status main menu.

       

      +

      2.Select Application under the NSS submenu. The Application status screen is displayed.

       

      +

      3.Click the Y or N under the Application Status field of one of the system servers to view its detail screen: Y indicates normal status; N indicates alarms.

       

      +

       

      +

      See Also

      +

       

      +

      •EMS

       

      +

      •Application Servers

       

      +

       

      +

      Functionalities

      +

       

      +

      •Display status of all application entities

       

      +

      •Link to the status page of each application entities

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_2_2_1.htm b/wxc2_omc/omcHelp/1_2_2_1.htm new file mode 100755 index 0000000..bda9a4b --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_2_1.htm @@ -0,0 +1,199 @@ +锘� + + + EMS + + + + + + + + + + + + + + + + + + + + +
      +

      EMS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      The dual EMS servers work in master-slave mode. Normally, the EMS 0 is the master server, while the EMS 1 is slave one. The master server takes all the tasks while the slave one is only responsible for synchronizing its database with the master. The slave EMS server becomes to the master when the master fails. The basic status of the EMS server is described in the following table.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Basic Status

      +

      Descriptions

      +

      Alarm Conditions

      +

      Basic status

      +

      Overall status

      +

      Any failure

      +

      Refresh time

      +

      Time of the last refreshment

      +

      Main process stops running

      +

      Dual server mode

      +

      The dual server integration status (master or slave)

      +

      --

      +

      Log information

      +

      For identification purpose only

      +

      --

      +
      +
      +

       

      +

      The EMS processes are described below:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Process

      +

      Definition

      +

      mysqld

      +

      Database service

      +

      httpd

      +

      HTTP (web page) service

      +

      omcMain

      +

      omcMain comprises the following modules:

      +

      •beatProc: Real time receive heartbeat (status report and alarm log) from all system devices, write to the EMS database, and update to the EMS share memory to display the real time status for customer.

      •beatSend: Broadcast EMS's heartbeat.

      iptrans

      +

      IP package transceiver

      +

      paraComm

      +

      System parameter maintenance module based on the SNMP module, used to process command, repack and send message, and process response from application servers.

      +

      subsComm

      +

      Subscriber parameter maintenance module based on the SNMP module, used to process command, repack and send message, and process response from application servers.

      +

      logCollector

      +

      Check and collect the statistics from system devices, process the original statistics into organized statistics, write to the database and update to the share memory.

      +

      omcCleaner

      +

      Regularly check network connectivity, clear database and log files.

      +

      smcli

      +

      SMCLI process, provide Subscriber Management Command Line Interface

      +

      cdrCollector

      +

      Check and collect the CDR of system devices, write to the database and update to the share memory.

      +

      subsDataBackup

      +

      Daily synchronize subscriber data with application servers.

      +

      ftpSend

      +

      Regularly transfer CDR data to customizing server and directory by FTP.

      +

      alarmAgent

      +

      Convert external alarm into internal message.

      +

      NRTRDE

      +

      Daemon process for Near Real Time Roaming Data Exchange.

      +

      sftpSend

      +

      Regularly transfer NRTRDE data to customizing server and directory by secure FTP.

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.2.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_2_2_2.htm b/wxc2_omc/omcHelp/1_2_2_2.htm new file mode 100755 index 0000000..3ba6687 --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_2_2.htm @@ -0,0 +1,298 @@ +锘� + + + MSS + + + + + + + + + + + + + + + + + + + + +
      +

      MSS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      The MSS application entities include MSC, VLR, HLR, AUC, PPS, SMSC, EIR, VSS, AAS, SMEG, OPPS, MRFC, iPALIM, iRLS and MHC. Any alarm will be displayed in red text. The basic status of application entity is listed in the following table.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Basic Status

      +

      Descriptions

      +

      Basic status

      +

      Basic status of the application entity. Any failure will bring alarm.

      +

      Dual server mode

      +

      Status of SYNC main server which is responsible for performing automatically data sync every 30 minutes via multicasting the sync data to the slave server. The 0 server is default main server

      +

      Refresh time

      +

      The status page refreshes itself every 10 seconds

      +

      License

      +

      Certified maximum subscriber capacity of this application server.

      +

      Users

      +

      The number of subscribers registered in this application server.

      +

      Serial number

      +

      The read-only UltraWAVE system serial number of Altobridge controls.

      +
      +
      +

       

      +

       

      +

       

      +
      + + + +

      The MSC entity is integrated in the MSS. This server is responsible for call control, processing and PSTN access for the UltraWAVE system.

      +

       

      +
      +
      +

       

      +
      + + + +

      The VLR entity is integrated in the MSS. The VLR stores information for all subscribers who enter the present coverage area. It also registers mobile subscriber identity, location identity and service parameters for the subscribers. It allocates Mobile Subscriber Roaming Numbers (MSRN) for terminating calls to subscribers located in its area.

      +

       

      +
      +
      +

       

      +
      + + + +

      The HLR entity is integrated in the MSS. The HLR is a database used for storage and management of subscriber information. The HLR stores permanent subscriber data including a subscriber's service profile, location information and activity status. When a mobile user buys a subscription from the service provider, the user is registered in the HLR.

      +

       

      +

      The basic functions of the HLR includes:

      +

      •Storage of the subscriber database

      •Provisioning of data for the VLR

      •Subscriber data query and modification via EMS GUI

      •Periodic database update queries for VLR update

       

      +

      The information stored in the HLR includes the following:

      +

      •Subscription information

      •Location information enabling the charging and routing of calls towards the MSC where the Mobile Station (MS) is registered, for example the MS Roaming Number, the VLR Number, the MSC Number and the Local MS Identity.

      •Telecommunication and bearer services subscription information

      •Service restrictions - roaming limitations

      •Parameters attached to supplementary services

       

      +
      +
      +

       

      +
      + + + +

      The optional AUC entity is integrated in the MSS. The AUC server provides authentication and encryption parameters that verify the MS user's identity and guarantee the confidentiality of each call.

      +

       

      +

      The basic functions of the AUC include:

      +

      •Authentication service provisioning management

      •Data encryption, security and access protection

      •Generation of security triplets for the MS

      •Cooperation with the HLR

      •Subscriber data query and modification via EMS GUI

       

      +
      +
      +

       

      +
      + + + +

      The optional PPS entity provides a solution for the mobile prepaid service. The PPS contains three operational modules: Accounting, Prepaid and Tariff.

      +

       

      +

      The Accounting module is responsible for storing subscriber information. The information stored includes:

      +

      •Account balance

      •Validity

      •Service status

      •Tariff ID and tariff area ID

      •Real-time charge calculation

      •Tariff query

      •Call duration calculation

      •Recharging subscriber accounts

       

      +

      The Prepaid module stores the information of the recharge cards and processes account recharge. The Tariff module stores the tariff sheets and processes tariff queries for each call.

      +

       

      +

      The PPS is also capable of performing the following functions:

      +

      •Subscriber authentication

      •Real time call debiting

      •Dual server load sharing redundancy

      •User data storage, searching and modification

      •Dual server data synchronization, backup and restoration

      •Web page-based provisioning interface

      •User data and recharge card import

      •Tariff table and multiple rate schedules

      •Multi-lingual audio announcements

       

      +
      +
      +

       

      +
      + + + +

      The optional SMSC entity provides the mechanism of delivering short messages over mobile networks. It is a store and forward way of transmitting messages to and from mobiles. The text message from the sending mobile is stored in a SMSC which then forwards it to the destination mobile. In the case that the recipient is not available the short message is stored and can be sent at a later time.

      +

       

      +

      Each short message is less than 160 characters (Latin alphabets) or 70 characters (Chinese or Arabic). The SMS is sent using signaling channels only. The messages can be transferred simultaneously with the voice/data/fax service over a GSM network.

      +

       

      +

      The SMSC performs the following basic functions:

      +

      •MS originated SMS to MS

      •Prepaid account balance query

      •Short Messages

      •Storage, query and statistics of SMS

      •Support Short Message Peer-to-Peer (SMPP)

       

      +
      +
      +

       

      +
      + + + +

      The optional EIR entity is a database that contains information on the identity of mobile equipment to prevent calls from stolen, unauthorized or defective mobile stations. Each mobile station is uniquely identified by its IMEI (International Mobile Equipment Identity), and it is this identity which may be checked against the EIR to check the validity of the handset. A white list number is a legal IMEI that can pass the EIR verification.

      +

       

      +
      +
      +

       

      +
      + + + +

      The optional IP VMS entity is a value added peripheral of the UltraWAVE system. The VMS provides voice mail service to the calling party when the called party is busy, no answer, not reachable or switched off. When a new voice message is received, the VMS notifies the host by a short message. Subscribers can receive and retrieve their messages and maintain their mailboxes (set greetings, language and password) at any time from anywhere. The VMS functions along with the SMSC to provide message indication.

      +

       

      +

      A single high-capacity VMS can support up to 100K subscribers. The VMS stores voices and syntax of 5 languages to support different countries without modifying software or recording new voice. The subscriber may select one of the five languages as the greeting language.

      +

       

      +
      +
      +

       

      +
      + + + +

      The AAS entity provides multi-lingual audio announcements for unattainable call and prepaid service. This can be done over 60 channels to notify subscribers their call status or prepaid account information. The announcement can be recorded and the playback can be flexibly configured to meet the specific requirements. The AAS is connected to the MSC using BICC interfaces over virtual connections.

      +

       

      +
      +
      +

       

      +
      + + + +

      The SMS Email Gateway (SMEG) entity is a software application that provides bi-directional SMS to email support, allowing email messages to be sent to SMS recipients, and vice versa. The SMEG software may reside in the UltraWAVE EMS server or run on a standalone server.

      +

       

      +

      The UltraWAVE Gateway relays short messages and internet email messages between the UltraWAVE Short Message Center (SMSC) and the host email server. It links to the host email server and short message center via SMTP and SMPP respectively. UltraWAVE Gateway routes email messages and short messages between them with appropriate format conversion.

      +

       

      +
      +
      +

       

      +
      + + + +

      The UltraWAVE Open-Prepaid-Roaming Public-Private System (OPPS) entity is a combination of two systems: the Open-to-all Prepaid Roaming System (OPR) and the Intelligent MAP-D Multiplexer System (IMDX).

      +

       

      +

      •The OPR System enables the existing UltraWAVE Prepaid System to provide temporary services to any visiting GSM users; even they are from PLMN without local roaming agreement in place. The OPR doesn鈥檛 require GSM visitors to change their SIM cards. OPR provides prepaid services to the visitors with their home SIM cards.

       

      +

      •The IMDX System enables the R9 System to provide 鈥減rivate鈥� communication services. The IMDX provides private, hybrid and public user services to the GSM subscribers. Operator may restrict private users to make/receive calls to/from private users only and public users to make/receive calls to/from public users only; while Hybrid users can make/receive calls from both private and public users. IMDX allows the operator to use the existing R9 System to provide GSM services to employee users as a private communication tool for their daily works.

       

      +
      +
      +

       

      +
      + + + +

      The Multimedia Resource Function Controller (MRFC) and the Multimedia Resource Function Processor (MRFP) handle the bearer-related services. The MRFC and the MRFP are deployed in logical pairs and provide bearer functions for sessions. The MRFC acts as an interpreter in the user plane while the MRFP performs the actual operations.

      +

       

      +

      The MRFC controls such things as conferencing, announcements to a user, or bearer transcoding. As an aside, transcoding is the term that defines the conversion from one form of codec to another. The MRFC receives the SIP signaling from the SIP server and uses the Media Gateway Control Protocol instructions to control the MRFP.

      +

       

      +

      The MRFP does all of the work on the user-plane and provides the resources that are requested by the MGCP instructions, which were issued by the MRFC. Some of these functions are listed below:

      +

      •Mixing of the incoming media streams that multiple parties would have created as part of a conferencing service.

      •Sourcing of the media stream that would be used as an announcement message for a user. The tone that sounds at the start of an instant message is an example of an announcement message that could come from the MRFP. The MRFP also sends along the stream if some processing is required.

       

      +
      +
      +

       

      +
      + + + +

      IP Private A-link Intelligent Multiplexer (iPALIM) is an application server of the UltraWAVE soft switch system to connect the local Inter-Reach Office (IRO) network to Public Mobile Network (PLMN) via A-interface. It allows the IRO to perform as a self-contained GSM system or a virtual BSC of the PLMN, depending on the desired service and user type. iPALIM monitors the messages originated by a subscriber to determine his user type, and selects the optimal way to route the call.

      +

       

      +

      iPALIM provides two types of services - private service and public service.

      +

      •iPALIM routes calls of private users to the local MSC for local switching within the IRO network. The private users may also make calls to local PSTN or PBX if it is attainable.

      •For public users, iPALIM routes calls to the PLMN MSC, bypassing the IRO soft-switch. iPALIM makes IRO appears as a BSC to the PLMN MSC. iPALIM is transparent to the user and to the IRO MSC. Moving into and out of the IRO is seamless to the public user.

       

      +
      +
      +

       

      +
      + + + +

      Intelligent RTP Local Switching (iRLS) function is a software application for helping the operators achieves significant saving in the transmission bandwidth between the core network and the rural/remote areas.

      +

       

      +

      In standard GSM architecture, calls are routing to the MSC even if the calling and the called parties are in the same BSC zone. iRLS enables the system to route calls locally whenever the calling and called parties are in the same BSS zone; hence saving the backhaul transmission bandwidth. iRLS only controls the routing of the call traffic, the call signaling is still under the control of the host MSC.

      +

       

      +
      +
      +

       

      +
      + + + +

      Multisite HLR Coordinator (MHC) supports distributed HLR across UltraWAVE R4S nodes of a mesh network through HLR data replication and synchronization. Automatic replication and synchronization of HLR data across multiple UltraWAVE R4S node sites enable subscribers to register to the Mesh UltraWAVE R4S GSM network at any nodes 鈥榣ocally鈥�. MHC must attaches to a UltraWAVE R4S HLR - the 鈥榟ost鈥� HLR of the coordinator. The principal duty of MHC is to cooperate with other meshed MHC to synchronize the HLR data among the UltraWAVE R4S nodes in a mesh network. In order to synchronize the HLR among the nodes of a Mesh UltraWAVE R4S network, a MHC will broadcast the alterations of its host HLR to other MHC and will update its host HLR according to the alterations received from other MHC. MHC supports dual system architecture of UltraWAVE R4S HLR. Each HLR of a dual HLR system will has one MHC attached.

      +

       

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.2.2

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/1_2_3.htm b/wxc2_omc/omcHelp/1_2_3.htm new file mode 100755 index 0000000..ff71852 --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_3.htm @@ -0,0 +1,113 @@ +锘� + + + Platform + + + + + + + + + + + + + + + + + + + + +
      +

      Platform

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      The basic status of the server is described in the following table:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Basic Status

      +

      Descriptions

      +

      Alarm Conditions

      +

      Basic status

      +

      Overall status

      +

      Any failure

      +

      Refresh time

      +

      Time of the last refreshment

      +

      Main process stops running

      +

      Start time

      +

      The time of the server started

      +

      --

      +

      CPU usage

      +

      CPU loading proportion

      +

      Exceed 90 percent

      +

      Physical memory (KB)

      +

      Size (KB) of free physical memory / total physical memory

      +

      Size of free memory is less than 10 percent of total memory

      +

      Hard disk space (KB)

      +

      Size (KB) of free hard disk space / total hard disk space

      +

      Size of free hard disk is less than 10 percent of total hard disk

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_2_4.htm b/wxc2_omc/omcHelp/1_2_4.htm new file mode 100755 index 0000000..f3ae853 --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_4.htm @@ -0,0 +1,81 @@ +锘� + + + Linkset + + + + + + + + + + + + + + + + + + + + +
      +

      Linkset

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      The UltraWAVE system supports 128 linksets. Each linkset consists of a maximum 16 links. The linkset status page displays the basic status of each configured linkset and its consisting links as described in the following tables:

      +

       

      +
      + + + + + + + + + + + + + + + + +

      Status

      +

      Descriptions

      +

      Name

      +

      The linkset name which assigned in Configuration >Network.

      +

      Status

      +

      The current status of the linkset. The following options may appear:

      +

      •Y = The linkset is available. At least one link in this linkset is working normally.

      •N = The linkset is down.

      •I = The linkset is currently inhibited.

      Link Status

      +

      The current status of each link in  this linkset. Point to the link number to view the pop-up descriptions which indicate the port information of this link.

      +

      •Blue = Normal

      •Red = Unavailable

      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.4

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_2_5.htm b/wxc2_omc/omcHelp/1_2_5.htm new file mode 100755 index 0000000..ed73137 --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_5.htm @@ -0,0 +1,81 @@ +锘� + + + TG & MG + + + + + + + + + + + + + + + + + + + + +
      +

      TG & MG

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      This page displays the basic status of each configured Trunk Group and its linked Media Gateway as described in the following tables:

      +

       

      +
      + + + + + + + + + + + + + + + + +

      Status

      +

      Descriptions

      +

      Name

      +

      The Trunk Group name which assigned in MSC parameters.

      +

      Status

      +

      The current status of the Trunk and Trunk Group. The following options may appear:

      +

      •Online = The Trunk or Trunk Group is available. At least one link in this linkset is working normally.

      •Offline = The Trunk or Trunk Group is down.

      •Disable = The Trunk or Trunk Group is currently inhibited.

      Channel In Use

      +

      Quantity of occupied traffic channels.

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.5

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_2_6.htm b/wxc2_omc/omcHelp/1_2_6.htm new file mode 100755 index 0000000..76a1edc --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_6.htm @@ -0,0 +1,57 @@ +锘� + + + BSS + + + + + + + + + + + + + + + + + + + + +
      +

      BSS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      The Base Station Subsystem (BSS) is composed of two parts:

      +

      •The Base Transceiver Station (BTS)

      •The Base Station Controller (BSC)

       

      +

      The BTS and the BSC communicate across the specified Abis interface, enabling operations between components that are made by different suppliers. The radio components of a BSS may consist of multiple cells. A BSS may have one or more base stations.

      +

       

      +

      The BTS uses the Abis interface to connect to BSC, and BSC uses A interface to connect to the MSC.

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.6

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_2_6_1.htm b/wxc2_omc/omcHelp/1_2_6_1.htm new file mode 100755 index 0000000..aadd76e --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_6_1.htm @@ -0,0 +1,98 @@ +锘� + + + BSC + + + + + + + + + + + + + + + + + + + + +
      +

      BSC

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      This page displays the basic status of all configured BSC and its A interface links as described in the following tables:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Status

      +

      Descriptions

      +

      Name

      +

      The BSC name which assigned in BSC parameters.

      +

      ID

      +

      The assigned ID of BSC.

      +

      Alink status

      +

      The status of A interface links connecting to MSC.

      +

      BSC status

      +

      The current status of BSC.

      +

      Clock operation mode

      +

      The state of clock sync state machine.

      +

      •Internal = Use the BSC internal clock as master.

      •External = Sync the clock to an external source.

      •Manual = Sync the clock to an internal reference or set the clock manually.

      Clock reference

      +

      This is the external reference (E1/T1) or connector.

      +

      •EXTREF

      •CONNREF

      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.6.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_2_6_2.htm b/wxc2_omc/omcHelp/1_2_6_2.htm new file mode 100755 index 0000000..8be90d6 --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_6_2.htm @@ -0,0 +1,98 @@ +锘� + + + BTS + + + + + + + + + + + + + + + + + + + + +
      +

      BTS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      This page displays the basic status of all configured BTS and its Abis interface links as described in the following tables:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Status

      +

      Descriptions

      +

      Name

      +

      The BTS name which assigned in BTS parameters.

      +

      ID

      +

      The assigned ID of BTS and its host BSC.

      +

      Abis status

      +

      The status of Abis interface links connecting to BSC.

      +

      BTS status

      +

      The current status of BTS.

      +

      Clock operation mode

      +

      The state of clock sync state machine.

      +

      •Internal = Use the BSC internal clock as master.

      •External = Sync the clock to an external source.

      •Manual = Sync the clock to an internal reference or set the clock manually.

      Clock reference

      +

      This is the external reference (E1/T1) or connector.

      +

      •EXTREF

      •CONNREF

      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.6.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/1_2_7.htm b/wxc2_omc/omcHelp/1_2_7.htm new file mode 100755 index 0000000..8cc0f0d --- /dev/null +++ b/wxc2_omc/omcHelp/1_2_7.htm @@ -0,0 +1,55 @@ +锘� + + + RAID + + + + + + + + + + + + + + + + + + + + +
      +

      RAID

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      RAID (Redundant Array of Independent Disks) combines two or more physical hard disks into a single logical unit. Hardware solutions are designed to present themselves to the attached system as a single hard drive, so that the operating system would be unaware of the technical workings.

      +

       

      +

      The UltraWAVE R4S system adopts RAID 1 to mirror the contents of the disks, making a form of 1:1 ratio realtime backup. The contents of each disk in the array are identical to that of every other disk in the array. The RAID status displays the information and current status of each disks in the RAID array.

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      1.2.7

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2.htm b/wxc2_omc/omcHelp/2.htm new file mode 100755 index 0000000..5f50b6c --- /dev/null +++ b/wxc2_omc/omcHelp/2.htm @@ -0,0 +1,89 @@ +锘� + + + Configuration + + + + + + + + + + + + + + + + + + + + +
      +

      Configuration

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      1_010_011_014_011_016_011_012_021_024_011_018_011_020_01

      +

       

      +

      1_107_01

      +

      1_107_02

      +

      1_107_03

      +

      1_107_27

      +

      1_107_04

      +

      1_107_05

      +

      1_107_25

      +

      1_107_06

      +

      1_107_28

      +

      1_107_07

      +

      1_107_08

      +

      1_107_29

      +

      1_107_09

      +

      1_107_10

      +

      1_107_11

      +

      1_107_12

      +

      1_107_13

      +

      1_107_14

      +

      1_107_15

      +

      1_107_16

      +

      1_107_19

      +

      1_107_17

      +

      1_107_18

      +

      1_107_26

      +

      1_107_20

      +

      1_107_21

      +

      1_107_22

      +

      1_107_24

      +

      1_107_23

      +

       

      +

      The configuration section describes how to do some routine operation and maintenance for the UltraWAVE Network Subsystem.

      +

       

      +

      Choose resources from the list to start:

      +

       

      +

      •Listed by Elements

       

      +

      •Listed by Tasks

       

      +

       

      +

       

      +

       

      +

       

      +

      2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_002.gif b/wxc2_omc/omcHelp/2_002.gif new file mode 100755 index 0000000..99b0541 Binary files /dev/null and b/wxc2_omc/omcHelp/2_002.gif differ diff --git a/wxc2_omc/omcHelp/2_007.gif b/wxc2_omc/omcHelp/2_007.gif new file mode 100755 index 0000000..d402f4f Binary files /dev/null and b/wxc2_omc/omcHelp/2_007.gif differ diff --git a/wxc2_omc/omcHelp/2_012.gif b/wxc2_omc/omcHelp/2_012.gif new file mode 100755 index 0000000..6bd7c2c Binary files /dev/null and b/wxc2_omc/omcHelp/2_012.gif differ diff --git a/wxc2_omc/omcHelp/2_014.gif b/wxc2_omc/omcHelp/2_014.gif new file mode 100755 index 0000000..1daad09 Binary files /dev/null and b/wxc2_omc/omcHelp/2_014.gif differ diff --git a/wxc2_omc/omcHelp/2_015.gif b/wxc2_omc/omcHelp/2_015.gif new file mode 100755 index 0000000..0bcc372 Binary files /dev/null and b/wxc2_omc/omcHelp/2_015.gif differ diff --git a/wxc2_omc/omcHelp/2_016.gif b/wxc2_omc/omcHelp/2_016.gif new file mode 100755 index 0000000..8cb7ebd Binary files /dev/null and b/wxc2_omc/omcHelp/2_016.gif differ diff --git a/wxc2_omc/omcHelp/2_017.gif b/wxc2_omc/omcHelp/2_017.gif new file mode 100755 index 0000000..9f1d3ff Binary files /dev/null and b/wxc2_omc/omcHelp/2_017.gif differ diff --git a/wxc2_omc/omcHelp/2_018.gif b/wxc2_omc/omcHelp/2_018.gif new file mode 100755 index 0000000..3c5d572 Binary files /dev/null and b/wxc2_omc/omcHelp/2_018.gif differ diff --git a/wxc2_omc/omcHelp/2_019.gif b/wxc2_omc/omcHelp/2_019.gif new file mode 100755 index 0000000..30c4c0b Binary files /dev/null and b/wxc2_omc/omcHelp/2_019.gif differ diff --git a/wxc2_omc/omcHelp/2_020.gif b/wxc2_omc/omcHelp/2_020.gif new file mode 100755 index 0000000..96e78e9 Binary files /dev/null and b/wxc2_omc/omcHelp/2_020.gif differ diff --git a/wxc2_omc/omcHelp/2_021.gif b/wxc2_omc/omcHelp/2_021.gif new file mode 100755 index 0000000..c7d1ad0 Binary files /dev/null and b/wxc2_omc/omcHelp/2_021.gif differ diff --git a/wxc2_omc/omcHelp/2_022.gif b/wxc2_omc/omcHelp/2_022.gif new file mode 100755 index 0000000..1c313c3 Binary files /dev/null and b/wxc2_omc/omcHelp/2_022.gif differ diff --git a/wxc2_omc/omcHelp/2_023.gif b/wxc2_omc/omcHelp/2_023.gif new file mode 100755 index 0000000..1eab44a Binary files /dev/null and b/wxc2_omc/omcHelp/2_023.gif differ diff --git a/wxc2_omc/omcHelp/2_024.gif b/wxc2_omc/omcHelp/2_024.gif new file mode 100755 index 0000000..d65e81a Binary files /dev/null and b/wxc2_omc/omcHelp/2_024.gif differ diff --git a/wxc2_omc/omcHelp/2_025.gif b/wxc2_omc/omcHelp/2_025.gif new file mode 100755 index 0000000..c384462 Binary files /dev/null and b/wxc2_omc/omcHelp/2_025.gif differ diff --git a/wxc2_omc/omcHelp/2_026.gif b/wxc2_omc/omcHelp/2_026.gif new file mode 100755 index 0000000..26ecb2f Binary files /dev/null and b/wxc2_omc/omcHelp/2_026.gif differ diff --git a/wxc2_omc/omcHelp/2_027.gif b/wxc2_omc/omcHelp/2_027.gif new file mode 100755 index 0000000..2eea573 Binary files /dev/null and b/wxc2_omc/omcHelp/2_027.gif differ diff --git a/wxc2_omc/omcHelp/2_029.gif b/wxc2_omc/omcHelp/2_029.gif new file mode 100755 index 0000000..4e4d2a7 Binary files /dev/null and b/wxc2_omc/omcHelp/2_029.gif differ diff --git a/wxc2_omc/omcHelp/2_030.gif b/wxc2_omc/omcHelp/2_030.gif new file mode 100755 index 0000000..f9cd1e7 Binary files /dev/null and b/wxc2_omc/omcHelp/2_030.gif differ diff --git a/wxc2_omc/omcHelp/2_031.gif b/wxc2_omc/omcHelp/2_031.gif new file mode 100755 index 0000000..3acabce Binary files /dev/null and b/wxc2_omc/omcHelp/2_031.gif differ diff --git a/wxc2_omc/omcHelp/2_032.gif b/wxc2_omc/omcHelp/2_032.gif new file mode 100755 index 0000000..ce5cae6 Binary files /dev/null and b/wxc2_omc/omcHelp/2_032.gif differ diff --git a/wxc2_omc/omcHelp/2_033.gif b/wxc2_omc/omcHelp/2_033.gif new file mode 100755 index 0000000..af86275 Binary files /dev/null and b/wxc2_omc/omcHelp/2_033.gif differ diff --git a/wxc2_omc/omcHelp/2_035.gif b/wxc2_omc/omcHelp/2_035.gif new file mode 100755 index 0000000..071ef36 Binary files /dev/null and b/wxc2_omc/omcHelp/2_035.gif differ diff --git a/wxc2_omc/omcHelp/2_036.gif b/wxc2_omc/omcHelp/2_036.gif new file mode 100755 index 0000000..87f10d1 Binary files /dev/null and b/wxc2_omc/omcHelp/2_036.gif differ diff --git a/wxc2_omc/omcHelp/2_040.gif b/wxc2_omc/omcHelp/2_040.gif new file mode 100755 index 0000000..69147da Binary files /dev/null and b/wxc2_omc/omcHelp/2_040.gif differ diff --git a/wxc2_omc/omcHelp/2_041.gif b/wxc2_omc/omcHelp/2_041.gif new file mode 100755 index 0000000..aa9e871 Binary files /dev/null and b/wxc2_omc/omcHelp/2_041.gif differ diff --git a/wxc2_omc/omcHelp/2_044.gif b/wxc2_omc/omcHelp/2_044.gif new file mode 100755 index 0000000..b4b2ffe Binary files /dev/null and b/wxc2_omc/omcHelp/2_044.gif differ diff --git a/wxc2_omc/omcHelp/2_045.gif b/wxc2_omc/omcHelp/2_045.gif new file mode 100755 index 0000000..32da595 Binary files /dev/null and b/wxc2_omc/omcHelp/2_045.gif differ diff --git a/wxc2_omc/omcHelp/2_1.htm b/wxc2_omc/omcHelp/2_1.htm new file mode 100755 index 0000000..684d335 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1.htm @@ -0,0 +1,200 @@ +锘� + + + Elements List + + + + + + + + + + + + + + + + + + + + +
      +

      Elements List

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Pick an Element

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      SS7

      +

      Signaling System No. 7

      +

      AAS

      +

      Audio Announcement System

      +

      AMRMG

      +

      AMR Media Gateway

      +

      AUC

      +

      Authentication Center

      +

      EIR

      +

      Equipment Identity Register

      +

      GbC

      +

      Gb Converter

      +

      HLR

      +

      Home Location Register

      +

      iGRS

      +

      intelligent GPRS Routing System

      +

      iPALIM

      +

      IP Private A-link Intelligent Multiplexer

      +

      iRLS

      +

      intelligent RTP Local Switching

      +

      MCA

      +

      MMS Charging Agent

      +

      MHC

      +

      Multisite HLR Coordinator

      +

      MNP

      +

      Mobile Number Portability System

      +

      MSC

      +

      Mobile Switching Center

      +

      OPPS

      +

      Open-Prepaid-Roaming Public-Private System

      +

      PPS

      +

      Prepaid System

      +

      SMEG

      +

      SMS Email Gateway

      +

      SMPP

      +

      Short Message Peer-to-Peer

      +

      SMSC

      +

      Short Message Service Center

      +

      TMG

      +

      Trunk Media Gateway

      +

      UES

      +

      User Equipment Simulator

      +

      VLR

      +

      Visitor Location Register

      +

      VIM

      +

      Voice Insertion Monitor

      +

      VSS

      +

      Voice Service System

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_0.htm b/wxc2_omc/omcHelp/2_1_0.htm new file mode 100755 index 0000000..fd10806 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_0.htm @@ -0,0 +1,217 @@ +锘� + + + SS7 + + + + + + + + + + + + + + + + + + + + +
      +

      Signaling System No.7

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Signaling System Number 7 (SS7) is a sophisticated, integrated signaling protocol designed to increase the efficiency of telephone service delivery. It has become the central nervous system for the delivery of wireline and wireless, and more recently IP services, the latest step in the convergence of communication networks. All networks need signaling to create connections, activate service, and deliver traffic.

      +

       

      +

      SS7 basic functions are as follows:

      +

       

      +

       

      +
      + + + +

      The Message Transfer Part provides a reliable transfer and delivery of signaling information across signaling networks. It is divided into three levels:

      +

      •MTP Level 1 defines the physical, electrical, and functional characteristics for the signaling data link.

      •MTP Level 2 provides the reliability aspects of MTP including error monitoring and recovery.

      •MTP Level 3 provides the link, route, and traffic management aspects of MTP.

      The MTP software and boards support ITU-T, ANSI, and Chinese variants of the protocol, enabling applications to be widely deployed.

      +

      MTP provides the means to:

      +

      •Interface with the SS7 network

      •Detect and correct errors to messages sent on signaling links

      •Manage links and routes, thus mitigating failures and congestion within the network should they occur

      MTP provides routing services for SCCP and ISUP on a point-to-point basis. In addition, MTP supports TCAP, which depends upon SCCP, as well as the protocols such CAP and GSM MAP that are supported by TCAP.

      +

      The UltraWAVE MTP modules support the relevant addressing (point code) scheme required by ITU-T, ANSI, and China. In addition, it supports:

      +

      •4 network: National, National Spare, International, International Spare

      •14-bit / 24-bit originating point code

      •1024 signaling links

      •512 linksets

      •1024 routing sets (destination point code) per network

      •16 links per linkset

       

      +
      +
      +

       

      +
      + + + +

      Signaling Point Code (SPC) in the SS7 network is uniquely identified by a numeric point code. Point codes are carried in signaling messages exchanged between signaling points to identify the origination (Originating Point Code) and destination (Destination Point Code) of each message.

      +

      Each signaling point in a signaling network is allocated to a code plan that is unambiguous within a domain (International, International Spare, National, National Spare), in accordance with the Network Indicator (NI).

      +

      Signaling points in the same domain are specified to a fixed length, either 14-bit or 24-bit.

      +

      Message routing is the process of selecting, for each signaling message to be sent, the signaling linkset to be used. It is based on analysis of the predetermined routing data at the signalling point concerned.

      +

      •ACN: The Application Context Name enables the version negotiation for the MAP messages, which make the system more compatible with the other networks by means of flexible message version adjustment. The adjustable version includes Version 1, Version 2 and Version 3.

       

      +
      +
      +

       

      +
      + + + +

      Telecommunication network served by a common channel signaling is composed of a number of switching and processing nodes interconnected by transmission links. To communicate using SS7, each of these nodes must act as a signalling point within the SS7 network. In addition, there will be a need to interconnect these signalling points by means of signalling data links, such that SS7 information may be conveyed between them.

      +

      •SLC: The selection of outgoing link is based on information in the DPC and Signaling Link Code field. The Signaling Link Code is used to:

      -Ensure message sequencing. Any two messages sent with the same SLC will always arrive at the destination in the same order in which they were originally sent.

      -Allow equal load sharing of traffic among all available links. In theory, if a user part sends messages at regular intervals and assigns the SLC values in a round-robin fashion, the traffic level should be equal among all links (within the combined linkset) to that destination.

      •Sigtran: The Sigtran protocol deliveries traditional switched circuit signaling on IP network, with an emphasis on SS7 over IP.

      •M2UA: The M2UA protocol is the layer between SCTP and MTP3 that separates the physical SS7 termination from the actual signaling point within the network. M2UA serves several purposes. The first purpose is to provide a mechanism for the transport of SS7 MTP2 user signaling (e.g., MTP3 messages) over IP using SCTP. The second purpose is to allow remote placement of SS7 link terminations and back haul SS7 traffic to a centralized point in the network.

       

      +
      +
      +

       

      +
      + + + +

      A number of parallel signaling links constitute a linkset.

      +

       

      +
      +
      +

       

      +
      + + + +

      The Signaling Gateway provides interworking between the UltraWAVE MSC and the IP-based network elements. It  is implemented as an embedded component of MTP3.

      +

       

      +
      +
      +

       

      +
      + + + +

      Each signaling point in the SS7 network is identified with a unique address called a point code. Point codes are carried in signaling messages exchanged between signaling points to identify the source and destination of each message. The point code is a hierarchical address that consists of a network identification which identifies a signaling network. In the ITU definition, there are four signaling networks and each signaling network can have a unique Originating Point Code.

      +

      The Flexible Point Codes Function of the UltraWAVE system is an extension of the upper definition; it allows each signaling network to have multiple point codes. That means several Originating Point Codes may exist in the same signaling network. This function is based on the achievement of binding OPCs on linksets and routes.

      +

      The UltraWAVE system supports up to 512 linkset, each linkset should be assigned to a signaling network and have an individual OPC. When the OPC of the linkset is ignored, the linkset will take the OPC of its signaling network as an alternative. The OPC of the linkset takes priority over the OPC of its signaling network.

      +

      Each linkset has its own route to define a particular destination and its accompany alternate linkset. Just like the linkset, a route should be assigned to a signaling network and have an individual OPC. When the OPC of the route is ignored, the route will take the OPC of its signaling network as an alternative. The OPC of the route takes priority over the OPC of its signaling network.

      +

       

      +
      +
      +

       

      +
      + + + +

      Signaling Connection Control Point provides additional routing capabilities via Sub-System Numbers (SSNs). It also offers the capability of routing based on dialed digits or global title translation. UltraWAVE SCCP module supports ITU-T, ETSI, ANSI, Chinese variants of the protocol, enabling applications to be widely deployed.

      +

      The UltraWAVE SCCP module provides the means to:

      +

      •Route TCAP messages from end-to-end

      •Translate from Global Title numbers to point code and subsystem numbers

      •Establish and release connections

      SCCP provides routing services for TCAP on an end-to-end basis, which supplements the point-to-point routing of MTP. In addition, SCCP translates Global Titles to point codes and subsystem numbers, simplifying routing table maintenance within a network.

      +

       

      +
      +
      +

       

      +
      + + + +

      Local Node provides subsystem numbers to allow messages to be addressed to specific applications.

      +

       

      +
      +
      +

       

      +
      + + + +

      Global Title Translation is the SS7 equivalent to IP routing. Translation examines the destination address (e.g. the number being called) and deciding how to identify it over the telephone network. This process can include global title analysis, which is the act of looking up the number and finding a result address, and global title modification.

      +

       

      +
      +
      +

       

      +
      + + + +

      The Network Code table contains the information necessary to identify the intended endpoint for the telephone call.

      +

      •CC: The Country Code is a one, two, or three digits number used to identify the country's network.

      •NDC: The National Destination Code defines the national calling area or national network to which the subscriber belongs.

      •MCC: The Mobile Country Code is a three digit number uniquely identifying a given country. It is utilized within the IMSI (International Mobile Subscriber Identity) and LAI (Location Area Identity).

      •MNC: The Mobile Network Code is either a two or three digit number used to uniquely identify a given network from within a specified country. The MNC is used as part of the IMSI and LAI.

      •International Prefix: It is a digit or combination of digits used by a subscriber when making an international call. The international prefix is used to indicate that the following digits represent an international number and should be routed to an international gateway.

      •National Prefix: It is a digit or combination of digits used by a subscriber when calling a national destination (within the country) other than that of the local area network.

       

      +
      +
      +

       

      +
      + + + +

      The Transaction Capabilities Application Part (TCAP) uses the transport services of MTP and SCCP to support transaction based services associated with wireline, wireless, and IP networks. TCAP is used to support Intelligent Network services, mobility services, supplemental services, and short message services (SMS).

      +

      TCAP provides the means to:

      +

      •Establish end-to-end connections between TCAP user parts

      •Handle message dialogs between end-points

      TCAP information is embedded in the message service units that flow on the SS7 network. TCAP messages contain both transaction information and component information. It is ideal for applications such as switching and mobility services in which switching elements need to query remote databases in order to authenticate (or locate) a roaming subscriber or to translate a destination number to an actual physical number for intelligent routing.

      +

      The UltraWAVE TCAP module offers the following features:

      +

      •State machine based on ITU-T model

      •Dialogue handling, state event processing, and timing capabilities

      •2048 simultaneous transactions per process

      •Message parameter validation

      •Round-robin routing of inbound dialogs

      •Application linkage of multiple SS7 variants to provide gateway functionality

      •Load distribution across multiple applications

      •Abort/reject message generation

       

      +
      +
      +

       

      +
      + + + +

      The Telephone User Part (TUP) provides the signaling backbone between switching elements for basic call establishment, supervision, and release of circuit switched network connections for telecommunications services. TUP supports analog and digital circuits, and limited call management signaling. Since TUP lacks the support for ISDN services, it is found primarily in older networks that support strictly narrowband voice services.

      +

      The UltraWAVE TUP module provides the means to:

      +

      •Establish, maintain, and release calls and connections

      •Supervise and manage the circuit infrastructure

      TUP controls the circuits used to carry voice traffic. In addition, the state of circuits can be verified and managed using TUP. The management of the circuit infrastructure can occur both at the individual circuit level and for groups of circuits.

      +

       

      +
      +
      +

       

      +
      + + + +

      The ISDN User Part (ISUP) provides the signaling backbone between switching elements for basic and supplementary services for the call establishment, supervision, and release of circuit switched network connections for telecommunications services. ISUP supports analog and digital circuits, as well as call management signaling for data transmission. The UltraWAVE ISUP module supports ITU-T, ANSI, and Chinese variants of the protocol, enabling applications to be widely deployed.

      +

      The ISUP module provides the means to:

      +

      •Establish, maintain, and release calls and connections

      •Supervise and manage the circuit infrastructure

      ISUP controls the circuits used to carry either voice or data traffic. In addition, the state of circuits can be verified and managed using ISUP. The management of the circuit infrastructure can occur both at the individual circuit level and for groups of circuits.

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.0

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_1_1.htm b/wxc2_omc/omcHelp/2_1_1.htm new file mode 100755 index 0000000..2c3e71f --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1.htm @@ -0,0 +1,69 @@ +锘� + + + BSS + + + + + + + + + + + + + + + + + + + + +
      +

      BSS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The BSS is composed of two parts:

      +

      •The Base Transceiver Station (BTS)

      •The Base Station Controller (BSC)

       

      +

      The Base Station Controller (BSC) manages the radio resources for one or more BTSs. It handles radio channel setup, frequency hopping, and handovers. The BSC is the connection between the mobile and the MSC. The BSC also translates the 13 Kbps voice channel used over the radio link to the standard 64 Kbps channel used by the Public Switched Telephone Network.

      +

       

      +

      It assigns and releases frequencies and time slots for the MS. The BSC also handles intercell handover. It controls the power transmission of the BSS and MS in its area. The function of the BSC is to allocate the necessary time slots between the BTS and the MSC. It is a switching device that handles the radio resources. Additional functions include:

      +

      •Control of frequency hopping

      •Performing traffic concentration to reduce the number of lines from the MSC

      •Providing an interface to the Operations and Maintenance Center for the BSS

      •Reallocation of frequencies among BTSs

      •Time and frequency synchronization

      •Power management

      •Time-delay measurements of received signals from the MS

       

      +

      The Base Transceiver Station (BTS) houses the radio transceivers that define a cell and handles the radio link protocols with the MS. In a large urban area, a large number of BTSs may be deployed.

      +

       

      +

      The BTS corresponds to the transceivers and antennas used in each cell of the network. A BTS is usually placed in the center of a cell. Its transmitting power defines the size of a cell. Each BTS has between 1 and 16 transceivers, depending on the density of users in the cell. Each BTS serves a single cell. It also includes the following functions:

      +

      •Encoding, encrypting, multiplexing, modulating, and feeding the RF signals to the antenna.

      •Transcoding and rate adaptation

      •Time and frequency synchronizing

      •Voice through full- or half-rate services

      •Decoding, decrypting, and equalizing received signals

      •Random access detection

      •Timing advances

      •Uplink channel measurements

       

      +

      Please note that before you can create a BSC object, you must have a physical BSC installed and connected to the MSC. The BSC to EMS connection is over ethernet. The MSC to BSC connection, which is called the A interface, is over one or more E1 or T1 links. To install the BSC hardware, please refer to the BSC Installation and Commissioning Guide.

      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_1.htm b/wxc2_omc/omcHelp/2_1_1_1.htm new file mode 100755 index 0000000..d91dc35 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_1.htm @@ -0,0 +1,1222 @@ +锘� + + + MSC + + + + + + + + + + + + + + + + + + + + +
      +

      Mobile Switching Center

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MSC entity is integrated in the MSS. This server is responsible for call control, processing and PSTN access for the UltraWAVE system.

      +

       

      +

       

      +

      MSC Parameter Dictionary

      +

       

      +

      •System

       

      +

      •Dialing Plan Set >> Dialing Plan

       

      +

      •Routing Zone Set >> Routing Selection

       

      +

      •Trunk Group >> Trunk >> CIC Table

       

      +

      •Location Area >> Cell

       

      +

      •Media Gateway

       

      +

       

      +

      See Also

      +

       

      +

      •Enable Mobile Call

       

      +

      •Enable PSTN Call

       

      +

      •Enable Supplementary Service

       

      +

      •Enable Emergency Call

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      Traffic (BHCA):

      +

      •Erlang: 2.5k

      •Local call: 60k

      •Outgoing call: 70k

      •Incoming call: 70k

      •Location update: 200k

      •CAMEL handling: 200k

      •Outgoing SM: 100k

      •Incoming SM: 100k

      Trunk:

      +

      •1023 trunks (1 to 127 trunk/trunks can be assigned to one trunk group)

      •1023 MG connections

      Interface

      +

      SCCP (ANSI T1.112, ITU-T Q)

      +

      TCAP (ANSI T1.114, ITU-T Q)

      +

      ISUP:

      +

      •ITU ISUP (ITU 92/97)

      •ETSI ISUP (ETSI V2)

      •ANSI ISUP (ANSI T1.113-1995)

      •UK ISUP (NICC ND1007)

      ISDN:

      +

      •ITU ISDN (Q.931 05/98)

      •ETSI ISDN (QSIG ECMA-143)

      •ANSI ISDN (NIS-A233-1)

      A interface (ETSI, ANSI, IPA BSC):

      +

      •BSSMAP: Manage the AIF circuit between MSC and BSC

      •DTAP: Implement mobility management, call control, supplementary service and SMS to mobile station

      SSF (GSM 03.78, 03.18):

      +

      •CAMEL interface on switch side

      MAP 1,2,3 (ETSI, ANSI):

      +

      •MAP B (to VLR)

      •MAP C (to HLR)

      •MAP D (VLR to HLR, for inter-PLMN roaming)

      •MAP F (to EIR)

      •MAP E (to SMSC)

      CAMEL I, II, III (ETSI, GSM 09.78)

      +

      SMPP: Short Message Peer to Peer protocol

      +

      SNMP V2: Heartbeat report, parameters maintenance, CDR, statistics

      +

      Soft switch:

      +

      •SIGTRAN:

      •SCTP (RFC 2960): Provide efficient signaling transport over IP network between SG and MGC (MSC)

      •M2UA (RFC 3331): Adaptation layer for transport of MTP2

      •IUA (RFC 3057): Adaptation layer for transport of ISDN Q.921

      •M3UA (RFC 3332): Adaptation layer for transport of MTP3

      •MTP3 (ANSI, ITU, SCCP-Lite): Messages between the SG and the MGC

      •MGCP (RFC 2705): Provide media gateway control function between the MG and MGC (MSC)

      •BICC (ITU-T Q): Provide call service between soft switches

      •RTP (RFC 3550): Real time transport of audio packets

      •SIP (RFC 3261)

      Signaling

      +

      14-bit/24-bit point code

      +

      4 SS7 networks: International, International-spare, National, National-spare

      +

      512 linksets, 1024 links

      +

      •1 to 16 links per linkset (The total number of links should be less than or equal to 1024)

      •Flexible point code: OPC and DPC per linkset

      •Network Indicator per linkset

      STP (point code and GTT E.164, E.212 and E.214)

      +

      Switching and numbering

      +

      Uniform numbering plan (NDC dialing plan in HPLMN)

      +

      Registered exchange numbering plan (No NDC dialing plan in HPLMN)

      +

      Normal routing:

      +

      •1023 trunk groups, 1023 trunks

      •1 to 127 trunks per trunk group (the total number of trunks should be less than or equal to 1023)

      •Support E.164 鈥�+鈥�

      •Longest-prefix match routing

      •Called number group routing

      •Intelligent routing

      •Number length dependent routing

      •Alternative trunk group routing

      Routing by caller location:

      +

      •15 dialing plans, each plan defines:

      •1023 16-digit dialing prefixes or groups

      •16-digit prefix manipulation for up to 32-digit called number

      •Calling number manipulation

      •E.164 international number manipulation

      •MNP flag

      •Premium call flag

      •Support up to 31 routing zones, each routing zone has:

      •1 dialing plan

      •Up to 63 routing plans (trunk group)

      •1 announcement plan

      •1 AAS/SRF address

      Mobility

      +

      Location update

      +

      IMSI attach/detach

      +

      VLR purge

      +

      Intra-MSC handover

      +

      Inter-PLMN roaming

      +

      1023 location areas

      +

      Restoration in VLR

      +

      Basic services

      +

      Telephony full rate speech (TS11)

      +

      Emergency call setup (TS12)

      +

      DTMF support

      +

      Short message service

      +

      CDR

      +

      Call details records (GSM 12.05)

      +

      Call measurement

      +

      Call service, origination, destination or trunk based statistics

      +

      •Mobile originating call

      •Mobile terminated call

      •Incoming trunk call

      •Outgoing trunk call

      •Mobile to mobile call

      •Trunk to mobile call

      •Mobile to IP (Intelligent Peripheral) call

      •Trunk to IP call

      •IP terminated call

      •Mobile to trunk call

      •Trunk to trunk call

      •Inter-connection call

      Statistics on network traffic basis

      +

      Security

      +

      Authentication messages and procedures

      +

      Enhanced security (Ki encrypted in AUC)

      +

      Multiple concurrent A3&A8 algorithms

      +

      EIR inter-working, IMEI checking

      +

      Ciphering (A5)

      +

      TMSI allocation

      +

      IN services

      +

      Integrated MSC/SSP

      +

      Support for CAMEL flags

      +

      Billing records for MO, MT, CF calls

      +

      Billing records for transit calls

      +

      Billing records for SMS

      +

      Diagnostic field stored in billing record

      +

      CDR generation

      +

      SCP directed activation of call limit timing

      +

      Supplementary services

      +

      Call forwarding

      +

      •Call forwarding unconditional (CFU)

      •Call forwarding on subscriber busy (CFB)

      •Call forwarding on no reply (CFNRy)

      •Call forwarding on subscriber not reachable (CFNRc)

      Call hold

      +

      Call waiting

      +

      Call barring / Operator determined barring

      +

      Premium call

      +

      Notification of call barring

      +

      Password control

      +

      Calling Line Identification Presentation (CLIP)

      +

      Calling Line Identification Restriction (CLIR)

      +

      Connected line identification presentation (COLP)

      +

      Connected line identification restriction (COLR)

      +

      Notification of call forwarding

      +

      Explicit call transfer

      +

      Operator specific barring (OSB)

      +

      Three-party call (3PTY)

      +

      Unstructured Supplementary Service Data (USSD)

      +

      enhanced Multi-Level Precedence and Preemption Service (eMLPP)

      +

      Voice codec

      +

      Support the negotiation for G.711, G.729, FR, EFR and AMR

      +

      Codec negotiation and transcoding

      +

      Enhanced codec support for dynamic payloads

      +

      Location services

      +

      Cell ID based location query

      +

      Standard MAP-interface Lg to gateway mobile location center

      +

      Support up to 1023 LAC+Cell ID

      +

      Call interception

      +

      Support lawful call interception

      +

      Enhanced service

      +

      Support SMS

      +

      •MO/MT SMS

      •Short Message Service to and from Application (SMPP)

      •Short Message Service to other SMSC

      Voice mail service

      +

      Support SRF

      +

      Programmable announcement for unattainable call setup and PPS

      +

      Call teardown announcement

      +

      Call duration control

      +

      Echo canceling (Media Gateway)

      +

      Redundancy

      +

      Dual switches load sharing and active redundancy

      +

      Signaling link redundancy

      +

      RTP stream routing redundancy

      +

      License control

      +

      MSC application flag

      +

      8 to 1023 at multiples of 8 trunks

      +
      +
      +

       

      +

       

      +

      MSC Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •CDR Option

      Control the Call Detail Record generation for different call types.

      +

      •ON

      •OFF

      •MO Max Call Duration

      Define the permitted maximum call duration for MO call.

      +

      Any ongoing call reaching this threshold will be compulsively cut off.

      +

      Set 0 to disable this function.

      +

      0 - 255 minutes

      +

      0 = No restriction

      +

      •MT Max Call Duration

      Define the permitted maximum call duration for MT call.

      +

      Any incoming call reaching this threshold will be compulsively cut off.

      +

      Set 0 to disable this function.

      +

      •Location Number

      Specify the location routing number for MNP service.

      +

      Numeric max 16 digits

      +

      •Suspend Timer

      If receives ISUP SUSPEND message in an ISUP call, then start the suspend timer to wait for the ISUP RESUME message.

      +

      If time out, then send RELEASE to ISUP.

      +

      0 - 65535 seconds

      +

      •eMLPP PCI Option

      The enhanced multilevel precedence and  preemption (eMLPP) service provides the capability to classify the mobile subscribers according to a subscriber specific priority.

      +

      •The preemption capability indicator (PCI) is set when the traffic channel to be assigned may preempt (forced release) an existing connection with a lower priority level (active preemption).

      •The preemption vulnerability indicator (PVI) is set when the traffic channel to be assigned can be preempted by another connection that might be established later with a higher priority level (passive preemption).

      Level A / B:

      +

      •Enable

      •Disable

      Level 0 - 4:

      +

      •Enable

      •Disable

      •eMLPP PVI Option

      •Assignment Timer

      Specify the maximum waiting time for receiving Assignment Complete message after the Assignment Request message has been sent. Unit is 100 ms.

      +

      0 - 255

      +

      •Paging Timer

      Specify the maximum waiting time for receiving Paging Response message after the Paging message has been sent. Unit is second.

      +

      •Split ETC Number

      Allow or forbid splitting the Correlation ID and SCF ID in Establish Temporary Connection message.

      +

      •Enable

      •Disable

      Dialing Prefix Set

      +

      --

      +

      Max 15 items

      +

      •CC

      The code that identifies the country's network.

      +

      Numeric max 8 digits

      +

      •NDC

      Define the national calling area or national network to which the subscriber belongs.

      +

      •International Prefix

      A digit or combination of digits used by a subscriber when making an international call. The international prefix is used to indicate that the following digits represent an international number and should be routed to an international gateway.

      +

      •National Prefix

      A digit or combination of digits used by a subscriber when calling a national destination (within the country) other than that of the local area network.

      +

      •HPLMN CC 0~7

      Assign up to 8 Country Code to the home PLMN.

      +

      Numeric max 16 digits

      +

      •Number Plan Area

      Specify number plan area number for MNP outbound.

      +

      Numeric max 8 digits

      +

      > Dialing Prefix

      +

      --

      +

      Max 1023 items

      +

      •Lookup Method

      Select a dialing plan lookup method.

      +

      Group Lookup Method has a higher priority than Prefix Lookup Method.

      +

      •Prefix

      •Group

      •Prefix

      A combination digits that dial to originate a call. It's only valid when the lookup method selected Prefix.

      +

      Numeric max 32 digits

      +

      •Group Prefix Start

      The beginning of the group prefix range. It's only valid when the lookup method selected Group.

      +

      •Group Prefix End

      The end of the group prefix range.

      +

      Start prefix and end prefix must have the same length.

      +

      •Number Attribute

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      •Unknown

      •MSISDN

      •NDD

      •IDD

      •Administration State

      (Read Only) The state of the current setting entry.

      +

      •Locked

      •Unlocked

      •Number Length

      The length of the dialed number.

      +

      •0 = Length is uncertain

      0 - 32

      +

      •Service Type

      Service type of the outgoing call:

      +

      •Normal = No verification for MT

      •Emergency Call = No verification for MO (free call)

      •Intelligent Call = Calls to intelligent peripheral

      •Emergency Call

      •Normal Call

      •Intelligent Call

      •Emergency Type

      Specify index number which associated with the 8 emergency call numbers in Location Area or Cell setting.

      +

      0 - 7

      +

      •Service Key

      Specify service hot key which associated with the service key configured in PPS SRF parameters.

      +

      0 - 9

      +

      •Number Type

      It determines how the numbers are sent out.

      +

      •PSTN

      •MSISDN

      •MSRN

      •CLI Type

      It determines the format of the Caller Line ID (CLI).

      +

      •Sub = Unknown(Sub) = "SN"

      •NDD = "NDC+SN"

      •Unknown(NDD) = "Nat Prefix+NDC+SN"

      •IDD = "+CC+NDC+SN"

      •Unknown(IDD) = "Int Prefix+CC+NDC+SN"

      •Sub

      •NDD

      •IDD

      •Unknown (Sub)

      •Unknown (NDD)

      •Unknown (IDD)

      •Routing Selection ID

      Specify the Routing Selection ID to this Dialing Plan.

      +

      1 - 31

      +

      •CDR Flag

      Enable or disable the Call Detail Record generation of this prefix.

      +

      •Enable

      •Disable

      •SRF-MNP Flag

      Enable if this prefix relating to SRF MNP service.

      +

      •IN-MNP Flag (MSC)

      Enable or disable IN MNP service when the system performs as MSC.

      +

      •IN-MNP Flag (GMSC)

      Enable or disable IN MNP service when the system performs as GMSC.

      +

      •Premium Call Flag

      Enable if this prefix relating to Premium Call service.

      +

      •OSB 1 Flag

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      •OSB 2 Flag

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      •NAI for Outgoing Call

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      •Unknown

      •MSISDN

      •NDD

      •IDD

      •PSTN Deletion Count

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0 - 16

      +

      •PSTN Inserted Digits

      Digits of the number to be added to the front of the dialed number.

      +

      Numeric max 16 digits

      +

      •E.164 Deletion Count

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      0 -16

      +

      •E.164 Inserted Digits

      Digits of the number to be added to the front of the incoming number to convert it to an international E.164 format.

      +

      Numeric max 16 digits

      +

      Routing Zone Set

      +

      --

      +

      Max 31 items

      +

      •Dialing Prefix Set ID

      Specify the Dialing Prefix Set to this Routing Zone.

      +

      1 - 15

      +

      •Announcement Set ID

      Specify the Call Unattainable Announcement Set to this Routing Zone.

      +

      •MSRN Start

      The beginning of the MSRN range for this Routing Zone.

      +

      Valid E.164 number

      +

      •MSRN End

      The end of the MSRN range for this Routing Zone.

      +

      •Warning Tone Timer

      Specify the time based trigger to play indicating tone for an ongoing prepaid call before the account balance is used up. Unit is second.

      +

      0 - 255 seconds

      +

      •SRF 0 Number

      The E.164 node address of the SRF connecting to MSS platform 0.

      +

      Valid E.164 number

      +

      •SRF 1 Number

      The E.164 node address of the SRF connecting to MSS platform 1.

      +

      > Routing Selection

      +

      --

      +

      Max 31 items

      +

      •Trunk Group

      Select the Trunk Group for the outgoing routing.

      +

      1 - 255

      +

      •Alternative TG Flag

      Enable or disable alternative Trunk Group when the primary Trunk Group is unavailable.

      +

      •Enable

      •Disable

      •Alternative TG

      Specify the alternative Trunk Group. It's available only when the previous Alternative TG Flag is enabled.

      +

      0 - 255

      +

      •NAI for Outgoing Call

      Select the required Network Address Identifier (NAI). The NAI option enables the MSC to perform call routing.

      +

      •Unknown

      •MSISDN

      •NDD

      •IDD

      •Deletion Count

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0 - 16

      +

      •Inserted Digits

      The digits to be inserted to the front of the dialed number.

      +

      Numeric max 16 digits

      +

      Trunk Group

      +

      --

      +

      Max 1023 items

      +

      •Administration State

      (Read Only) Control the operation of the managed Trunk Group.

      +

      •Locked

      •Unlocked

      •Operation State

      (Read Only) Indicate the current Trunk Group operation is qualified by Availability State.

      +

      •Enabled

      •Disabled

      •Availability State

      (Read Only) Qualify Operation State providing details about the current operational state.

      +

      •Failed

      •Off Line

      •On Line

      •Dependency

      •Degraded

      •OPC

      The Originating Point Code of the current TG.

      +

      ITU = 1 - 16383

      +

      ANSI = 1 - 16777215

      +

      •DPC

      The Destination Point Code of the current TG.

      +

      •NI

      Network Indicator specifies the Trunk Group to a network.

      +

      •National

      •National Spare

      •International

      •International Spare

      •Protocol Type

      Select the protocol type for this Trunk Group.

      +

      •AIF

      •ISUP

      •BICC

      •ISDN

      •SIP

      •Static Connection

      •Protocol Variant

      Select the protocol variant for this Trunk Group.

      +

      •ITU

      •ETSI

      •ANSI

      •UK

      •Q.Sig

      •Local Domain

      (For SIP) Define the local domain name for a SIP TG.

      +

      --

      +

      •Destination Domain

      (For SIP) Specify the destination domain name for a SIP TG.

      +

      --

      +

      •Destination IP 0 - 1

      (For SIP) Specify the destination IP address for a SIP TG.

      +

      Dotted decimal format

      +

      •Destination Port

      (For SIP) Specify the destination port for a SIP TG.

      +

      --

      +

      •Remote Process ISUP

      (For SIP) Indicate whether the remote SIP UA is able to process ISUP in SIP-ISUP interworking.

      +

      •Support

      •Not Support

      •Incoming SIP Calls TON

      (For SIP) Manipulate the type of calling number for a SIP TG. It doesn't take effect when the calling number's attribute is International.

      +

      It is used for Calling Line Identification Presentation (CLIP) of incoming SIP calls.

      +

      •CLIR

      •Subscriber

      •Unknown

      •NDD

      •IDD

      •Circuit Selection

      Circuit selection mode of the traffic channel connections.

      +

      •Clockwise

      •Anti-clockwise

      •Odd

      •Even

      •Back Off Flag

      Enable or disable Back Off when simultaneously select the same channel with the opposite side.

      +

      •Enable

      •Disable

      •Tandem Restriction

      Enable or disable Tandem to allow or prohibit transit calls from PSTN to PSTN via this trunk group.

      +

      •CDR Flag

      Enable or disable the Call Detail Record generation of this trunk group.

      +

      •TG Type

      Application type of this Trunk Group.

      +

      •Normal

      •Inter-connection of MSS0

      •Inter-connection of MSS1

      •RZS ID

      Specify the Trunk Group to a Routing Zone Set.

      +

      255 = Apply to all Routing Zone Sets

      +

      1 - 31, 255

      +

      •Alternative RZS Trigger

      Specify the Trunk Group to an alternative Routing Zone Set for backup purpose.

      +

      0 = Disable Alternative Routing Zone

      +

      0 - 31

      +

      •Ignore MNP Info

      (For MNP) In the MNP port-in processing, enable to ignore the optional parameters in the incoming IAM message.

      +

      •Enable

      •Disable

      •Signal Ported Number

      (For MNP) In the MNP port-out processing, enable to ignore the optional parameters in the outgoing IAM message.

      +

      •NFAS Flag

      (For ISDN) Enable or disable Non-Facility Associated Signaling with D Channel Backup feature.

      +

      •Primary Link

      (For ISDN) Specify the primary D channel to control multiple trunks.

      +

      One of trunk ID listed in the trunk entries.

      +

      •Backup Link

      (For ISDN) Specify a backup D channel for use when the primary NFAS D channel fails.

      +

      •BSC Codec

      Specify the codec type of the BSC. It is available only for circuit BSC.

      +

      Entry 0 is the highest priority, entry 13 is the lowest.

      +

      FR, EFR, AMR

      +

      •Echo Control Device Indicator

      Indicate including echo control device in outbound IAM message or not.

      +

      •Enable

      •Disable

      •Satellite Indicator

      Specify the bearing value of the Satellite Indicator in the outgoing ISUP IAM message.

      +

      •Transit = Use the same value from the incoming ISUP IAM message.

      •No Satellite Circuit

      •One Satellite Circuit

      •Two Satellite Circuits

      •Transit

      > Trunk

      +

      --

      +

      Max 1023 items

      +

      •Administration State

      (Read Only) Control the operation of the managed Trunk.

      +

      •Locked

      •Unlocked

      •Operation State

      (Read Only) Indicate the current Trunk operation is qualified by Availability Status.

      +

      •Enabled

      •Disabled

      •Availability State

      (Read Only) Qualify Operation State providing details about the current operational state.

      +

      •Failed

      •Off Line

      •On Line

      •Dependency

      •Degraded

      •MG ID

      Specify the Trunk to a Media Gateway. Not applicable to virtual MG.

      +

      1 - 255

      +

      •Port ID

      Specify the Trunk to a physical port of the selected Media Gateway. Not applicable to virtual MG.

      +

      0 - 31

      +

      •Port Type

      Specify the type of MG physical ports.

      +

      E1, T1, Analogue

      +

      •Group ID

      Select the application group for the Trunk.

      +

      •Group0 = Master is MSC0

      •Group1 = Master is MSC1

      •Group0

      •Group1

      •Supervision Method

      Specify the type of block request indication delivered in the ISUP trunk initialization process.

      +

      •Circuit Group

      •Circuit

      •Link ID

      (For ISDN) Specify the corresponding IUA link ID which is configured in the MTP3 setting.

      +

      0 - 1023

      +

      •User Network Interface

      (For ISDN) Select Q.931 switch type for ISDN call processing.

      +

      •Network Side

      •User Side

      •CIC Assignment

      Specify the start CIC to the Trunk for typical mode.

      +

      •E1 = 0, 32, 64 ...

      •T1 = 0, 24, 48 ...

      0, 32, 64 ...

      +

      0, 24, 48 ...

      +

      •Channel in Use

      (Read Only) Display the quantity of occupied channels of this trunk in real-time.

      +

      0 - 32

      +

      > > CIC Table

      +

      --

      +

      Max 32 items

      +

      •Channel Type

      Specify the type of the channel.

      +

      •Disable

      •Incoming

      •Outgoing

      •Bi-directional

      •Lease line

      •D-channel

      •X-channel

      •Channel CIC

      Assign a Circuit Identity Code to the channel.

      +

      0 - 65535

      +

      •Channel Status

      (Read Only) The current status of the serving channel.

      +

      •Out of Service

      •Idle

      •Busy

      •iPALIM Used

      •Local Block

      (Read Only) Display the block error if the channel is out of service.

      +

      •Blocked

      •Unblocked

      •Remote Block

      Location Area

      +

      --

      +

      Max 1023 items

      +

      •LAC

      Specify the Location Area Code of this location area.

      +

      1 - 65535

      +

      •Trunk Group

      Specify the serving Trunk Group of this location area.

      +

      1 - 1023

      +

      •Paging Mode

      Paging messages broadcast in the specified location area or in the whole network.

      +

      •By LAC

      •By Cells

      •Repeat Paging Times

      Specify the subsequent paging times if the initial paging fails.

      +

      0 - 3

      +

      •NITZ

      Network Identity and Time Zone.

      +

      --

      +

      •Coding Scheme

      Indicate that 7-bit or UCS2 coding scheme is used.

      +

      •7-bit

      •UCS2

      •Add CI

      Indicate whether the MS should add the letters for the Country's Initials to the text string.

      +

      •ON

      •OFF

      •Network Name

      A text string is to pass to the MS via NITZ.

      +

      --

      +

      •Time Update Option

      Determine whether time and time zone info is transferred to MS via NITZ.

      +

      •None

      •Time Zone

      •Time Zone and Time

      •Time Zone

      Specify the local time zone.

      +

      GMT-12:00 - GMT+13:00

      +

      •Daylight Saving Time

      Enable or disable the daylight saving time adjustment.

      +

      •No Adjustment

      •+ 1 Hour

      •+ 2 Hours

      •Emergency Number 0~7

      The emergency number, which subscriber dialed in the specific Location Area, will be transformed to this number and route to the emergency center.

      +

      3 - 16 digits

      +

      > Cell

      +

      --

      +

      Max 15 items

      +

      •RZS ID

      Specify the Routing Zone Set ID to this Cell.

      +

      1 - 31

      +

      •RSZC

      Assign a Regional Subscription Zone Code to the LAC.

      +

      Regional Subscription Zone Code = CC+NDC+Zone Code

      +

      0 - 65535

      +

      •Cell ID

      Global Cell Identity defined in GSM 03.03

      +

      0 - 65535

      +

      •Latitude

      Specify the latitude of this cell for a location service use.

      +

      -90.00 to 90.00

      +

      •Longitude

      Specify the longitude of this cell for a location service use.

      +

      -180.00 to 180.00

      +

      •Emergency Number 0~7

      The emergency number, which subscriber dialed in the specific Cell, will be transformed to this number and route to the emergency center.

      +

      3 - 16 digits

      +

      Media Gateway

      +

      --

      +

      Max 255 items

      +

      •Administration State

      (Read Only) Control the operation of the managed MG.

      +

      •Locked

      •Unlocked

      •IP

      IP address of the MG.

      +

      Dotted decimal format

      +

      •Domain Name

      Specify a domain name to the Media Gateway.

      +

      --

      +

      •Switching Mode

      Select the switching mode of the specified MG.

      +

      •8ECP = Circuit Switch (8KE1)

      •MGCP = Soft Switch (MG)

      •8ECP

      •MGCP

      •Endpoint

      Specify the method of MGCP endpoint description.

      +

      •Structured

      •Unstructured

      •Unstructured Hex

      •Tone Generation Capacity

      Enable if the Media Gateway has tone generation capability.

      +

      •Enable

      •Disable

      •MG Type

      Select the type of MG endpoint.

      +

      •IP BSS

      •VIM

      •Digital Channel

      •AudioCodes

      •Announcement Server

      •IVR

      •Conference Bridge

      •Packet Relay

      •Wiretap

      •ATM

      •Max Ports

      The total physical port number of the MG. Not applicable to virtual MG.

      +

      0 - 31

      +

      •Max Channels

      The total channel number of the virtual MG. Applicable to virtual MG only.

      +

      0 -1023

      +

      •Packetization Period

      The period over which encoded voice bits are collected for encapsulation in.

      +

      •20ms

      •40ms

      •60ms

      •80ms

      •Priority Level

      Set the priority level of the MG codec table:

      +

      •0 = Lowest priority level

      •255 = Highest priority level

      0 - 255

      +

      •Codec Type

      Specify the preferred codec type using between MG and MSC. Entry 0 is the highest priority, entry 15 is the lowest.

      +

      •A-Law

      •Mu-Law

      •FR

      •EFR

      •AMR

      •G729

      •Audit Timer

      The time interval between sending AUEP message from MGC to MGW to check the trunk status. Unit is second. Set 0 to disable.

      +

      0 - 255

      +

      > Port

      +

      --

      +

      Max 32 items

      +

      •Used Flag

      (Read Only) The status of the MG port.

      +

      •Idle

      •In Use

      •Status

      (Read Only) The status of the serving channel.

      +

      •Ready

      •Not Ready

      •Seizure Trunk

      (Read Only) The hyperlink of the bound Trunk for the in use MG port.

      +

      •Format = Trunk <TG ID>-<Trunk ID>

      --

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_11.htm b/wxc2_omc/omcHelp/2_1_1_11.htm new file mode 100755 index 0000000..b7c32ef --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_11.htm @@ -0,0 +1,222 @@ +锘� + + + MNP + + + + + + + + + + + + + + + + + + + + +
      +

      Mobile Number Portability

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Mobile Number Portability (MNP) system is a software application that provides ability for mobile subscribers to change the GSM subscription network within a portability domain whilst retaining their original MSISDNs. Number portability is a key aspect of deregulation in telecommunications. To ensure that there is competition in the marketplace for telecommunications services, the formerly fixed association between the service provider and the directory number has been broken. Numbers now are seen as the property of the service subscriber, who should be able to make an independent decision about which service provider to use.

      +

       

      +

      In GSM networks, a new SIM card and a new IMSI are supplied to the subscriber during porting. However, the original MSISDN is retained.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •MNP Parameter Dictionary

       

      +

      •Enable Mobile Number Portability

       

      +

      •Manage MNP Subscriber

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      20k MNP subscribers, capable of expansion

      +

      Solution

      +

      MNP-SRF

      +

      ANSI IN-Query (support in phase 2)

      +

      MNP

      +

      Mobile Number Portability, ability allowing customers change service provider while retaining an existing mobile phone number

      +

      MNP to different networks (with different CC or NDC)

      +

      Independent software module deployed with MSS server

      +

      Support telephony and SMS for MNP MT

      +

      NPDB

      +

      Number Portability DB, stores all ported subscribers

      +

      Network (operator) independent

      +

      Synchronized between networks

      +

      RN

      +

      Routing Number, identify each PLMN in the portability domain

      +

      Used by ported MSISDN for addressing subscription (port-to) network

      +

      Load sharing

      +

      Dual servers load sharing and active redundancy

      +

      License control

      +

      Application flag

      +

      10 to 20k MNP subscribers at multiples of 100

      +
      +
      +

       

      +

       

      +

      MNP Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •MNP Flag

      Enable or disable Mobile Number Portability function.

      +

      •Enable

      •Disable

      •NPLR Number

      The E.164 node address of the Number Portability Location Register.

      +

      Valid E.164 number

      +

      •Routing Number

      A specific number which is part of the routing information, used by the network to route the call and the non-call related signaling messages.

      +

      Numeric max 16 digits

      +

      •Routing Method

      For every call or non-call related transaction initiated from local network, the MSC can select one of the two following routing conventions:

      +

      •Direct: route the calls directly from the PLMN to the ported subscriber's network.

      •Indirect: route the calls from the PLMN to the ported subscriber鈥檚 subscription network via the number range holder.

      •Direct

      •Indirect

      •RN Position

      The routing number will be attached to the called number in the portability database. This parameter specifies the digit position of the called number to append the routing number.

      +

      1 - 16

      +

      •MNP Solution

      Select a solution for call related signaling in the ETSI MNP-standard.

      +

      •IN-based

      •MNP-SRF

      Local Prefix

      +

      --

      +

      Max 32 items

      +

      •Prefix

      Specify prefixes of E.164 numbers using in the local network.

      +

      Numeric max 16 digits

      +

      Portable Prefix

      +

      --

      +

      Max 128 items

      +

      •Prefix

      Specify prefixes of E.164 numbers that can be ported among networks.

      +

      Numeric max 16 digits

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.11

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_12.htm b/wxc2_omc/omcHelp/2_1_1_12.htm new file mode 100755 index 0000000..24dbdb4 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_12.htm @@ -0,0 +1,585 @@ +锘� + + + iPALIM + + + + + + + + + + + + + + + + + + + + +
      +

      IP Private A-link Intelligent Multiplexer

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      IP Private A-link Intelligent Multiplexer (iPALIM) is an application server of the UltraWAVE soft switch system to connect the local Inter-Reach Office (IRO) network to Public Mobile Network (PLMN) via A-interface. It allows the IRO to perform as a self-contained GSM system or a virtual BSC of the PLMN, depending on the desired service and user type. iPALIM monitors the messages originated by a subscriber to determine his user type, and selects the optimal way to route the call.

      +

       

      +

      iPALIM provides two types of services - private service and public service.

      +

      •iPALIM routes calls of private users to the local MSC for local switching within the IRO network. The private users may also make calls to local PSTN or PBX if it is attainable.

      •For public users, iPALIM routes calls to the PLMN MSC, bypassing the IRO soft-switch. iPALIM makes IRO appears as a BSC to the PLMN MSC. iPALIM is transparent to the user and to the IRO MSC. Moving into and out of the IRO is seamless to the public user.

       

      +

       

      +

      See Also

      +

       

      +

      •iPALIM Parameter Dictionary

       

      +

      •Enable iPALIM Service

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      Up to 100k subscribers (Private users + Hybrid/Public users)

      +

      Interface

      +

      A interface to public PLMN MSC

      +

      SNMP interface to EMS

      +

      Voice Services

      +

      Telephony:

      +

      •Private to private call

      •Private to hybrid call

      •Hybrid to private cal

      •Hybrid to public call

      •Public to public call

      Emergency call

      +

      DTMF

      +

      Data Services

      +

      Data and Fax

      +

      Supplementary Services

      +

      Call forwarding:

      +

      •Call forward unconditional (CFU)

      •Call forward on busy (CFB)

      •Call forward on not reply (CFNRy)

      •Call forward on not reachable (CFNRc)

      Call barring / Operator determined barring

      +

      •Barring of All Outgoing Calls (BAOC)

      •Barring of Outgoing International Calls (BOIC)

      •Barring of All Incoming Calls (BAIC)

      Calling line identification presentation (CLIP)

      +

      Calling line identification restriction (CLIR)

      +

      Connected line identification presentation (COLP)

      +

      Connected line identification restriction (COLR)

      +

      Call hold (all the call parties are in the same user type)

      +

      Call waiting (all the call parties are in the same user type)

      +

      Explicit call transfer (ECT) (all the call parties are in the same user type)

      +

      3-party call (all the call parties are in the same user type)

      +

      Premium call (private user only)

      +

      Password control (private user only)

      +

      Operator specific barring (OSB) (private user only)

      +

      Barring of Outgoing International Calls except those directed towards the Home PLMN Country (BOIC-exHC) (public user only)

      +

      Barring of Incoming Calls when Roaming outside the home PLMN country (BIC-Roam) (public user only)

      +

      NOTE: Hybrid users鈥� supplementary services are set up by the operator, they aren鈥檛 user alterable.

      +

      Enhanced Services

      +

      Short message service

      +

      Voice mail service

      +

      USSD service

      +

      Prepaid services

      +

      Network Identity and Time Zone (NITZ) service

      +

      Virtual calling card service

      +

      Featured Services

      +

      Hybrid user auto-registration

      +

      Exclusive access:

      +

      •Public exclusive: Allow or forbid Public users to login the local IRO

      •Hybrid exclusive: Allow or forbid Hybrid users to login the local IRO

      •Private exclusive: Allow or forbid Private users to login the local IRO

      Registration control (256 IMSI prefixes):

      +

      •Set the 鈥淚MSI Prefix List鈥� as Registration Control White List or Black List

      •White list: Allow IMSI prefixes in the white list to register to the local IRO

      •Black list: Forbid IMSI prefixes in the black list from registering to the local IRO

      iPALIM A interface gateway

      +

      Accurate paging

      +

      Inter BSC handover

      +

      Intelligent RTP local switching

      +

      Intelligent Gb Routing

      +

      Redundancy

      +

      Dual servers load sharing and active redundancy

      +

      License Control

      +

      Application flag

      +

      10 to 100k iPALIM subscribers at multiples of 100

      +

      Operation and Maintenance

      +

      SNMP network management

      +

      IE browser client console

      +

      Web page based graphic user interface

      +

      Real time status display

      +

      System parameter maintenance

      +

      Subscriber profile maintenance (import, modify, add and delete)

      +

      Organized call measurements and operation logs

      +

      SMCLI interface to read, create, modify, and delete subscribers

      +
      +
      +

       

      +

       

      +

      iPALIM Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •PSTN Routing

      Select the outgoing route for Hybrid user PSTN calls.

      +

      •Local = Route PSTN calls to the MSC trunk group pointing towards PBX.

      •Remote = Route PSTN calls to the iPALIM trunk group pointing towards remote PLMN.

      •Local

      •Remote

      •Emergency Routing

      Select the outgoing route for Hybrid and Private user emergency calls.

      +

      •Local = Route emergency calls to the MSC trunk group pointing towards PBX.

      •Remote = Route emergency calls to the iPALIM trunk group pointing towards remote PLMN.

      •UES Flag

      Enable or disable User Equipment Simulator function.

      +

      It should be enabled to support iRLS function.

      +

      •Enable

      •Disable

      •SMSC Address

      E.164 local node of Short Message Center.

      +

      Valid E.164 number

      +

      •Idle Period to Purge

      System purges Public users from iPALIM database when they have been idle for the amount of time. Unit = Hour.

      +

      0 - 240

      +

      •Public Exclusive

      Allow or forbid Public users to login the local IRO.

      +

      •OFF = Allow

      •ON = Forbid

      •Private Exclusive

      Allow or forbid Private users to login the local IRO.

      +

      •Hybrid Exclusive

      Allow or forbid Hybrid users to login the local IRO.

      +

      •Hybrid Priority

      Allow or forbid the Hybrid users to use private service when iPALIM A-interface link is failed.

      +

      •Public = Forbid

      •Private = Allow

      •Max License

      (Read Only) The maximum subscriber capacity of iPALIM determined by License Control.

      +

      0 - 100,000

      +

      Hotline Number

      +

      --

      +

      --

      +

      •Language 0 - 7

      Registration hotline number for Public user to self-create Hybrid user account in the IRO network coverage.

      +

      --

      +

      UES MT MSISDN

      +

      --

      +

      Max 8 items

      +

      •MSISDN

      When the UES Flag is enabled, assign virtual number for User Equipment Simulator to create IMSI - MSISDN table.

      +

      Valid E.164 number

      +

      Trunk Group

      +

      --

      +

      Max 8 items

      +

      •Administration State

      (Read Only) Control the operation of the managed Trunk Group.

      +

      •Locked

      •Unlocked

      •Operation State

      (Read Only) Indicate the current Trunk Group operation is qualified by Availability State.

      +

      •Enabled

      •Disabled

      •Availability State

      (Read Only) Qualify Operation State providing details about the current operational state.

      +

      •Off Line

      •On Line

      •OPC

      Originating Point Code. Point Code of the local IRO network.

      +

      ITU = 1 - 16383

      +

      ANSI = 1 - 16777215

      +

      •DPC

      Destination Point Code. Point Code of the remote PLMN network.

      +

      •Network Indicator

      Specify the Trunk Group to one of the four networks.

      +

      •International

      •International Spare

      •National

      •National Spare

      •Protocol Type

      (Read Only) The protocol type for this Trunk Group.

      +

      AIF

      +

      •Application Type

      (Read Only) Application type of this Trunk Group.

      +

      Out

      +

      > Trunk

      +

      --

      +

      Max 32 items

      +

      •Administration State

      (Read Only) Control the operation of the managed Trunk.

      +

      •Locked

      •Unlocked

      •Operation State

      (Read Only) Indicate the current Trunk operation is qualified by Availability State.

      +

      •Enabled

      •Disabled

      •Availability State

      (Read Only) Qualify Operation State providing details about the current operational state.

      +

      •Off Line

      •On Line

      •MG ID

      Specify the Trunk to the Media Gateway which has been configured in the following MG setting table.

      +

      0 - 255

      +

      •Port ID

      Specify the Trunk to one of the physical ports on the selected Media Gateway.

      +

      0 - 255

      +

      •Port Type

      Specify the type of MG physical ports.

      +

      •E1

      •T1

      •Group ID

      Select the application group for the Trunk.

      +

      •Group0 = Master is MSS0

      •Group1 = Master is MSS1

      •Group0

      •Group1

      •CIC Assignment

      Specify the start CIC to the Trunk for typical mode.

      +

      •E1 = 0, 32, 64 ...

      •T1 = 0, 24, 48 ...

      0, 32, 64 ...

      +

      0, 24, 48 ...

      +

      Media Gateway

      +

      --

      +

      Max 8 items

      +

      •Administration State

      (Read Only) Control the operation of the managed MG.

      +

      •Locked

      •Unlocked

      •IP

      IP address of this Media Gateway.

      +

      Dotted decimal format

      +

      •Domain Name

      Specify a domain name to the Media Gateway.

      +

      --

      +

      •Switching Mode

      (Read Only) Switching mode of the specified Media Gateway.

      +

      MGCP

      +

      •Endpoint

      (Read Only) The method of MGCP endpoint description.

      +

      Structured

      +

      •Type

      Select the type of MG endpoint.

      +

      •AudioCodes = E1 connection via AudioCodes

      •PALIM = IP connection to PLMN

      •AudioCodes

      •PALIM

      •Max Physical Ports

      The total physical port number of the Media Gateway.

      +

      --

      +

      •Max Channels

      The total channel number of the virtual MG. Applicable to virtual MG only.

      +

      --

      +

      •Packetization Period

      The period over which encoded voice bits are collected for encapsulation in.

      +

      •x20ms

      •x40ms

      •x60ms

      •x80ms

      •Codec Type

      Specify the codec type of the Media Gateway.

      +

      --

      +

      •Audit Timer

      The time interval between sending AUEP message from MGC to MGW to check the trunk status. Unit is second.

      +

      1 - 255

      +

      Location Area

      +

      --

      +

      Max 256 items

      +

      •Type

      (Read Only) Application type of this Location Area.

      +

      Out

      +

      •LAC

      Location Area Code. Assigned by PLMN operator.

      +

      --

      +

      •MCC

      Mobile Country Code. Assigned by PLMN operator.

      +

      --

      +

      •MNC

      Mobile Network Code. Assigned by PLMN operator.

      +

      --

      +

      •Cell ID

      Global Cell Identity defined in GSM 03.03. Assigned by PLMN operator.

      +

      --

      +

      •Trunk Group

      Combine the routing Trunk Group with the specified cell.

      +

      --

      +

      Registration

      +

      Specify the user range to register to the iPALIM network.

      +

      --

      +

      > Registration Control

      +

      --

      +

      --

      +

      •Status

      Enable or disable operator to control what mobile users are allowed (white-list) or disallowed (black-list) to register to the iPALIM network.

      +

      •Disabled

      •White-list

      •Black-list

      •LU Reject Cause

      Specify the rejection cause in Location Area Updating Reject message sending to forbidden visitors.

      +

      •PLMN not allowed

      •LA not allowed

      •Roaming not allowed in this LA

      > IMSI Prefix List

      +

      --

      +

      Max 256 items

      +

      •IMSI Prefix

      If an IMSI prefix is a 15-digit number then it is a single IMSI number. If it is shorter than 15 digits then all the numbers begin with this prefix are under control.

      +

      Numeric max 15 digits

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.12

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_13.htm b/wxc2_omc/omcHelp/2_1_1_13.htm new file mode 100755 index 0000000..20d054a --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_13.htm @@ -0,0 +1,294 @@ +锘� + + + iRLS + + + + + + + + + + + + + + + + + + + + +
      +

      intelligent RTP Local Switching

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Intelligent RTP Local Switching (iRLS) function is a software application for helping the operators achieves significant saving in the transmission bandwidth between the core network and the rural/remote areas.

      +

       

      +

      In standard GSM architecture, calls are routing to the MSC even if the calling and the called parties are in the same BSC zone. iRLS enables the system to route calls locally whenever the calling and called parties are in the same BSS zone; hence saving the backhaul transmission bandwidth. iRLS only controls the routing of the call traffic, the call signaling is still under the control of the host MSC.

      +

       

      +

      2_1_1_13_01

      +

       

      +

       

      +

      In UltraWAVE system, the RLS, UES and VIM modules combine to provide the RTP local switching function. The RLS and UES modules are integrated in the MSS software. The installation doesn鈥檛 require extra hardware. The VIM is an independent software module. It should be installed in a separate Linux server. The UltraWAVE system can deploy up to ten VIMs to monitor up to 10240 local switching calls simultaneously. UltraWAVE system can spread local switching calls across two or more VIMs to reduce traffic congestion. Refer to the following introduction for more information of the VIM and UES modules.

      +

       

      +

       

      +
      + + + +

      Under certain circumstances the host MSC may insert voice announcement in a conversation. In this situation, iRLS must truncate the local switching on the conversation call to revert the payload switching back to normal so that the callers in the conversation can listen to the announcement. The function of Voice Insertion Monitor is monitoring the media payload activities from the host MSC. Once voice announcement is detected then the VIM will inform the iRLS to revert the 鈥榣ocal switching鈥� back to 鈥榥ormal switching鈥� immediately.

      +

       

      +
      +
      +

       

      +
      + + + +

      If UltraWAVE system is connected to the PLMN via iPALIM then this function requires the PLMN MSC A-interface to support the UUI function. If the PLMN MSC A-interface doesn鈥檛 support UUI, then iRLS will use the User Equipment Simulator (UES) to create an IMSI - MSISDN table of all the online users to help the Dial Peers Pairing function to identify the originating and terminating parties of a call. When a new user location update to the IRO network the UES will use the IMSI of the new user to send a short message to capture his MSISDN. UES will then pass the IMSI - MSISDN information to the iPALIM. iPALIM manages the IMSI - MSISDN table and provides the information to the Dial Peers Pairing module for identifying the originating and terminating parties of a call.

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •iRLS Parameter Dictionary

       

      +

      •Enable Local Switching

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      iRLS:

      +

      •Up to 31 routing zones

      •Up to 100k BHCA

      VIM:

      +

      •Monitor up to 1024 local switching calls per VIM system

      Voice Services

      +

      Telephony

      +

      Emergency call

      +

      Data Services

      +

      Data and Fax

      +

      Supplementary Services

      +

      Call forwarding:

      +

      •Call forward unconditional (CFU)

      •Call forward on busy (CFB)

      •Call forward on not reply (CFNRy)

      •Call forward on not reachable (CFNRc)

      Call barring / Operator determined barring

      +

      Notification of call barring

      +

      Notification of call forwarding

      +

      Password control

      +

      Calling line identification presentation (CLIP)

      +

      Calling line identification restriction (CLIR)

      +

      Connected line identification presentation (COLP)

      +

      Connected line identification restriction (COLR)

      +

      Operator specific barring (OSB)

      +

      Enhanced Services

      +

      Prepaid Services

      +

      Unique Services

      +

      Intelligent RTP local switching

      +

      Voice Insertion Monitoring (VIM)

      +

      Dial peers pairing

      +

      User Equipment Simulator (UES) function

      +

      Invocation of local switching

      +

      Redundancy

      +

      Dual servers load sharing and active redundancy

      +

      License Control

      +

      Application flag:

      +

      •Turn on/off iRLS

      •Turn on/off VIM

      +
      +

       

      +

       

      +

      iRLS Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •RLS Flag

      Enable or disable RTP Local Switching function.

      +

      •Enable

      •Disable

      VIM Media Gateway

      +

      --

      +

      Max 10 items

      +

      •Administration State

      (Read Only) Control the operation of the managed MG.

      +

      •Locked

      •Unlocked

      •IP

      IP address of VIM server.

      +

      Dotted decimal format

      +

      •Domain Name

      The domain name of the connected VIM.

      +

      •vim-1234

      •Switching Mode

      Switching mode of the VIM Media Gateway. Select MGCP as default.

      +

      •MGCP

      •8ECP

      •Endpoint

      Method of MGCP endpoint description. Select Unstructured as default.

      +

      •Structured

      •Unstructured

      •Unstructured Hex

      •Type

      (Read Only) Type of MG endpoint.

      +

      VIM

      +

      •Max Ports

      The total physical port number of the Media Gateway.

      +

      --

      +

      •Max Channels

      The total channel number of the virtual MG. Applicable to virtual MG only.

      +

      --

      +

      •Packetization Period

      The period over which encoded voice bits are collected for encapsulation in.

      +

      •x20ms

      •x40ms

      •x60ms

      •x80ms

      •Codec Type

      (Read Only) Codec type of the Media Gateway.

      +

      •AMR-12-2

      •Audit Timer

      The time interval between sending AUEP message from MGC to MGW to check the trunk status. Unit is second.

      +

      1 - 255

      +

      Routing Zone

      +

      --

      +

      31 items

      +

      •Site

      Determine each Routing Zone which configured in MSC Routing Zone table to Local or Remote. Refer to upper figure, the Routing Zone A and B are remote, while C is local.

      +

      iRLS will not be invocated by the calls within local Routing Zone.

      +

      •Remote

      •Local

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.13

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_1_1_13_01.gif b/wxc2_omc/omcHelp/2_1_1_13_01.gif new file mode 100755 index 0000000..45c5efa Binary files /dev/null and b/wxc2_omc/omcHelp/2_1_1_13_01.gif differ diff --git a/wxc2_omc/omcHelp/2_1_1_14.htm b/wxc2_omc/omcHelp/2_1_1_14.htm new file mode 100755 index 0000000..9e99095 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_14.htm @@ -0,0 +1,262 @@ +锘� + + + MHC + + + + + + + + + + + + + + + + + + + + +
      +

      Multisite HLR Coordinator

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Multisite HLR Coordinator (MHC) supports distributed HLR across UW R4S nodes of a mesh network through HLR data replication and synchronization. Automatic replication and synchronization of HLR data across multiple UW R4S node sites enable subscribers to register to the Mesh UW R4S GSM network at any nodes 鈥榣ocally鈥�. MHC must attaches to a UW R4S HLR - the 鈥榟ost鈥� HLR of the coordinator. The principal duty of MHC is to cooperate with other meshed MHC to synchronize the HLR data among the UW R4S nodes in a mesh network. In order to synchronize the HLR among the nodes of a Mesh UW R4S network, a MHC will broadcast the alterations of its host HLR to other MHC and will update its host HLR according to the alterations received from other MHC. MHC supports dual system architecture of UW R4S HLR. Each HLR of a dual HLR system will has one MHC attached.

      +

       

      +

      Each node of a Mesh UW R4S Network requires MHC to provide the Multisite HLR functions. MHC provides multisite HLR networking, data replication, data synchronization and periodic data verification functions. MHC function is transparent to other GSM applications. It doesn鈥檛 affect the GSM functions of the UW R4S system.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •MHC Parameter Dictionary

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      Up to 100K postpaid subscribers per node

      +

      Up to 16 nodes per segment

      +

      Support 2 hierarchical segment structure

      +

      Interface

      +

      SNMP among MHCs

      +

      Basic Services

      +

      MO/MT call

      +

      Emergency call

      +

      Supplementary Services

      +

      Call forwarding:

      +

      •Call forward unconditional (CFU)

      •Call forward on busy (CFB)

      •Call forward on not reply (CFNRy)

      •Call forward on not reachable (CFNRc)

      Call barring / Operator determined barring

      +

      •Barring of All Outgoing Calls (BAOC)

      •Barring of Outgoing International Calls (BOIC)

      •Barring of All Incoming Calls (BAIC)

      Calling line identification presentation (CLIP)

      +

      Calling line identification restriction (CLIR)

      +

      Connected line identification presentation (COLP)

      +

      Connected line identification restriction (COLR)

      +

      Call hold

      +

      Call waiting

      +

      Explicit call transfer (ECT)

      +

      3-party call

      +

      Premium call

      +

      Password control

      +

      Operator specific barring (OSB)

      +

      Barring of Outgoing International Calls except those directed towards the Home PLMN Country (BOIC-exHC)

      +

      Barring of Incoming Calls when Roaming outside the home PLMN country (BIC-Roam)

      +

      Enhanced Services

      +

      Short message service

      +

      Voice mail service

      +

      USSD service

      +

      Featured Services

      +

      Multisite HLR Data replication

      +

      Multisite HLR Data synchronization

      +

      Multisite HLR Periodic data verification

      +

      Multisite HLR Dual system networking

      +

      License Control

      +

      MHC application flag

      +

      Operation and Maintenance

      +

      SNMP network management

      +

      IE browser client console

      +

      Web page based graphic user interface

      +

      Real time status display

      +

      System parameter maintenance

      +

      Organized call measurements and operation logs

      +
      +
      +

       

      +

       

      +

      MHC Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •MHC State

      (Read Only) The current status of local MHC. It is read-only and controlled by License.

      +

      •ON

      •OFF

      •CDR Flag

      Enable or disable MHC CDR generation.

      +

      •Synchronization Interval

      The time interval between sending successive SYN commands to the destination nodes.

      +

      1 - 255 seconds

      +

      •Verification Interval

      The time interval between sending successive verification commands to the destination nodes.

      +

      •Download Interval

      The time interval between sending successive download commands to the destination nodes.

      +

      •Replication Interval

      The time interval between sending successive replication commands to the destination nodes.

      +

      •Verification Start Time

      The start time of daily HLR data verification procedure.

      +

      01AM - 12PM

      +

      •HLR Checksum Field

      Enable or disable HLR subscriber checksum for each data fields.

      +

      •ON

      •OFF

      •Replication Rate

      The limited number of replicating subscribers per 50ms.

      +

      1 - 255

      +

      MHC Node

      +

      --

      +

      Max 16 items

      +

      •Name

      Specify an identifiable name for the MHC node.

      +

      --

      +

      •IP 0

      The IP address of the MHC in the first platform.

      +

      Dotted decimal format

      +

      •IP 1

      The IP address of the MHC in the second platform. It is available for the dual system node.

      +

      •Administration State

      Control the operation of the managed MHC node.

      +

      •Unblock = Enable blocked MHC node.

      •Block = Disable MHC node manually.

      •Unblock

      •Block

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.14

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_15.htm b/wxc2_omc/omcHelp/2_1_1_15.htm new file mode 100755 index 0000000..2c0f66c --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_15.htm @@ -0,0 +1,201 @@ +锘� + + + AMRMG + + + + + + + + + + + + + + + + + + + + +
      +

      AMR Media Gateway

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      In order to expand the UltraWAVE R4S network capacity to provide services to more subscribers, Altobridge developed the cost-effective media gateway solution for supporting the AMR/HR features in BSS to triple the UBSC capacity without scrapping the BSS hardware. The AMR MG provides DS0 circuit to RTP conversion and EFR (16K) and AMR (8K) grooming functions to enable the circuit UBSC to work directly with the UltraWAVE softswitch with triple radio capacity. The AMR MG allows UBSC to bypass the BSS TRAU to bring the ATer interface to core network directly. The AMR MG bridges the ATer/TDM to/from BSS and ATer/IP from/to the TRAU in the AudioCodes trunking gateway.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •AMR MG Parameter Dictionary

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      Up to 90 simultaneously voice channels

      +

      Interface

      +

      ATer/TDM interface to/from BSS

      +

      ATer/IP interface to/from the TRAU in the AudioCodes trunking gateway

      +

      SNMP for management

      +

      MGCP for control

      +

      MTP2 on TDM interface

      +

      Sigtran on IP interface

      +

      Basic Services

      +

      Configurable TDM interface type E1/T1

      +

      8Kbps/16Kbps sub channel encoding/decoding

      +

      AMR/HR (8Kbps) multiplexing

      +

      FR/EFR (16Kbps) multiplexing

      +

      40ms jitter buffer

      +

      Ater conversion between RTP packets and TRAU frames

      +

      20/40/60ms configurable RTP interval

      +

      RTCP XR QoS Report

      +

      Support EFR DTX on the uplink direction

      +

      Processing delay less than 10 ms

      +

      Idle/Bad frame handling

      +

      Operation and Maintenance

      +

      SNMP network management

      +

      IE browser client console

      +

      Web page based graphic user interface

      +

      Real time status display

      +

      System parameter maintenance

      +

      Remote software upgrade via TFTP

      +

      Debugging via serial port

      +
      +
      +

       

      +

       

      +

      AMR MG Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •Local IP

      Specify the IP address of the MG.

      +

      Dotted decimal format

      +

      •Netmask

      A netmask is a 32-bit mask used to divide an IP address into subnets and specify the networks available hosts.

      +

      •Gateway

      Specify the IP address of the gateway used to pass traffic from MG to other subnets.

      +

      •System ID

      Specify the system ID of the media gateway.

      +

      0 - 31

      +

      •Sub System ID

      Specify the subsystem ID of the media gateway.

      +

      0 - 1

      +

      •Proxy IP

      Specify the IP address of the RTP proxy.

      +

      Dotted decimal format

      +

      •Port Type

      Specify the type of MG physical interface.

      +

      •E1

      •T1

      •Interface ID

      Specify the interface identifier to the MG physical interface.

      +

      0 - 65535

      +

      •CRC4 Flag

      Enable or disable Cyclic Redundancy Check on the MG physical interface.

      +

      •Enable

      •Disable

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.15

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_16.htm b/wxc2_omc/omcHelp/2_1_1_16.htm new file mode 100755 index 0000000..b32a0e6 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_16.htm @@ -0,0 +1,208 @@ +锘� + + + GbC + + + + + + + + + + + + + + + + + + + + +
      +

      Gb Converter

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The UltraWAVE iGRS (intelligent GPRS Routing System) supports up to 8 SGSNs. There鈥檙e two types of SGSNs:

      +

      •the new SGSN with a standard IP based Gb interface

      •the traditional SGSN with a Frame Relay based Gb interface

       

      +

      iGRS supports the standard R5 Gb/IP network service and the proprietary R98/R99 Gb/IP network service. In order to support the traditional Gb/FR based SGSN, UltraWAVE introduces a Gb converter to converse the protocols between the proprietary Gb/IP and the standard Gb/FR. The Gb converter provides Gb over Frame Relay with E1 or T1 interface from a Gb / IP source.

      +

       

      +

      The principle benefits of the Gb Converter include:

      +

      •Enable the iGRS system to connect to the traditional Gb/FR SGSN, so that the iGRS can be used in both the latest IP based GPRS access system and the traditional FR based GPRS access system.

      •IPBSS can be used in the RAN, while the RAN is actually connected to a traditional Gb/FR based SGSN.

       

      +

       

      +

      See Also

      +

       

      +

      •Gb Converter Parameter Dictionary

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      Up to 512 NSVCs (Network Service Virtual Connection)

      +

      31 channels (excluded one synchronization channel) per E1 link

      +

      24 channels per T1 link

      +

      64 Kbps bandwidth per channel

      +

      Interface

      +

      Standard R5 Gb/IP

      +

      Proprietary R98/R99 Gb/IP

      +

      TDM E1/T1 circuit based Gb/FR

      +

      SNMP interface to EMS (Element Management System)

      +

      Basic Services

      +

      Gb Protocol Conversion:

      +

      •IP to Frame Relay

      •Frame Relay to IP

      Multiplexing of NSVCs (Network Service Virtual Connection)

      +

      •TDM circuit side: differentiate NSVCs with different DLCIs

      •IP network side: differentiate NSVCs with different UDP ports

      PVC (Private Virtual Circuit) Status Management:

      +

      •Notification of the addition of a PVC

      •Detection of the deletion of a PVC

      •Notification of the state (active or inactive) of a PVC

      •Link integrity verification

      Operation and Maintenance

      +

      SNMP network management

      +

      IE browser client console

      +

      Web page based graphic user interface

      +

      Real time status display

      +

      System parameter maintenance

      +

      Remote software upgrade via TFTP

      +

      Debugging via serial port

      +
      +
      +

       

      +

       

      +

      Gb Converter Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •Local IP

      Specify the IP address of the Gb converter.

      +

      Dotted decimal format

      +

      •Netmask

      A netmask is a 32-bit mask used to divide an IP address into subnets and specify the networks available hosts.

      +

      •Gateway

      Specify the IP address of the gateway used to pass traffic from Gb converter to other subnets.

      +

      •System ID

      Specify the system ID of the Gb converter.

      +

      0 - 31

      +

      •Sub System ID

      Specify the subsystem ID of the Gb converter.

      +

      0

      +

      •Peer IP

      Specify the IP address of the SGSN.

      +

      Dotted decimal format

      +

      •Peer Port

      Specify the port of the SGSN.

      +

      0 - 65535

      +

      •Receive Channel Select

      Select up to 31 channels for receiving or transmitting packets. The four dotted decimal numbers can be transferred into 32-digit binary number, each of the right-to-left 31 bits represents a physical channel.

      +

      •0 = Disable

      •1 = Enable

      Dotted decimal format

      +

      •Transmit Channel Select

      •Port Type

      Specify the type of converter physical interface.

      +

      •E1

      •T1

      •CRC4 Flag

      Enable or disable Cyclic Redundancy Check on the converter physical interface.

      +

      •Enable

      •Disable

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.16

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_17.htm b/wxc2_omc/omcHelp/2_1_1_17.htm new file mode 100755 index 0000000..d4253b0 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_17.htm @@ -0,0 +1,470 @@ +锘� + + + iGRS + + + + + + + + + + + + + + + + + + + + +
      +

      intelligent Gb Routing System

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      iGRS (intelligent Gb Routing System) is an intelligent Gb router. iGRS is inserted between the BSC and the SGSN to monitor and to route the Gb traffic. iGRS extracts the IMSI from the attach request message of a GPRS user to check his user type from the iPALIM. iGRS inquires the user type of an IMSI from the iPALIM through the iPi (iPALIM inquiry) interface. After knowing the iPALIM user type, iGRS will route the attach request to the corresponding SGSN according to the user type and location (Routing Area Identity). iGRS is transparent to the BSC and the SGSN.

      +

       

      +

      The principle benefits of the iGRS include:

      +

      •Enable iPALIM to support GPRS.

      •Aggregation of BSC Gb to enable sharing one SGSN Gb by multiple BSC.

      •Redirect Hybrid Users to a particular GGSN by APN replacement. APN replacement function also enables Hybrid User to use the local GPRS service without changing the internet setting in his mobile device.

      •Allow operator to apply the Captive Portal technique to redirect iPALIM users to special web page for local service promotion or GPRS service billing by payment gateway or curbing internet traffic.

       

      +

       

      +

      See Also

      +

       

      +

      •iGRS Parameter Dictionary

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      Gb interface:

      +

      •256 BSCs

      •8 SGSNs

      Subscriber:

      +

      •100k online GPRS users

      Traffic:

      +

      •200k attach per hour

      •200k RAU per hour

      •200k PDP context activation/deactivation per hour

      Interface

      +

      Gb interface to BSC and SGSN

      +

      SNMP interface to EMS (Element Management System)

      +

      Basic Services

      +

      Gb routing

      +

      •Mobile to GSN

      •GSN to Mobile

      •ID request

      APN (Access Point Name) replacement

      +

      License Control

      +

      Application flag

      +

      1 to 256 BSC Gb in the increment of 1

      +

      1 to 8 SGSN Gb in the increment of 1

      +

      100 to 100k GPRS subscribers at multiples of 100

      +

      Operation and Maintenance

      +

      SNMP network management

      +

      IE browser client console

      +

      Web page based graphic user interface

      +

      Real time status display

      +

      System parameter maintenance

      +

      Organized call measurements and operation logs

      +
      +
      +

       

      +

       

      +

      iGRS Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •System ID

      Specify the System ID of the iGRS.

      +

      0 - 255

      +

      •Primary PALIM IP

      IP address of the master iPALIM connecting to iGRS.

      +

      Dotted decimal format

      +

      •Secondary PALIM IP

      IP address of the slave iPALIM connecting to iGRS.

      +

      BSS

      +

      Create virtual connections between iGRS and BSS.

      +

      Max 256 items

      +

      •Administration State

      (Read Only) Control the operation of the managed interface.

      +

      •Locked

      •Unlocked

      •SNS Type

      Specify the type of subnetwork service sub-layer.

      +

      •IP

      •Frame Relay

      > NSE

      +

      Network Service Entity

      +

      1 item

      +

      •Administration State

      (Read Only) The state of the current setting entry.

      +

      •Locked

      •Unlocked

      •NSEI

      Specify network service entity identifier (NSEI) to identify the NSE.

      +

      0 - 65535

      +

      >> NSVC

      +

      Network Service Virtual Connection

      +

      Max 2 items

      +

      •Administration State

      (Read Only) The state of the current setting entry.

      +

      •Locked

      •Unlocked

      •Blocking Status

      (Read Only) The block status of the current setting entry.

      +

      •Blocked

      •Unblocked

      •Alive Status

      (Read Only) The running status of the current setting entry.

      +

      •Alive

      •Dead

      •NSVCI

      Specify network service virtual connection identifier (NSVCI) to identify the NSVC.

      +

      0 - 65535

      +

      •Local IP

      IP address of the iGRS.

      +

      Dotted decimal format

      +

      •Local Port

      iGRS transmission port for the virtual connection.

      +

      0 - 65535

      +

      •Peer IP

      IP address of the BSS.

      +

      Dotted decimal format

      +

      •Peer Port

      BSS transmission port for the virtual connection.

      +

      0 - 65535

      +

      SGSN

      +

      Create virtual connections between iGRS and SGSN.

      +

      Max 8 items

      +

      •Administration State

      (Read Only) Control the operation of the managed interface.

      +

      •Locked

      •Unlocked

      •SNS Type

      Type of subnetwork service.

      +

      •IP

      •Frame Relay

      > NSE

      +

      Network Service Entity

      +

      Max 255 items

      +

      •Administration State

      (Read Only) The state of the current setting entry.

      +

      •Locked

      •Unlocked

      •NSEI

      Specify network service entity identifier (NSEI) to identify the NSE.

      +

      0 - 65535

      +

      >> NSVC

      +

      Network Service Virtual Connection

      +

      Max 2 items

      +

      •Administration State

      (Read Only) The state of the current setting entry.

      +

      •Locked

      •Unlocked

      •Blocking Status

      (Read Only) The block status of the current setting entry.

      +

      •Blocked

      •Unblocked

      •Alive Status

      (Read Only) The running status of the current setting entry.

      +

      •Alive

      •Dead

      •NSVCI

      Specify network service virtual connection identifier (NSVCI) to identify the NSVC.

      +

      0 - 65535

      +

      •Local IP

      IP address of the iGRS.

      +

      Dotted decimal format

      +

      •Local Port

      iGRS transmission port for the virtual connection.

      +

      0 - 65535

      +

      •Peer IP

      IP address of the SGSN.

      +

      Dotted decimal format

      +

      •Peer Port

      SGSN transmission port for the virtual connection.

      +

      0 - 65535

      +

      Routing Area

      +

      --

      +

      Max 1024 items

      +

      •MCC

      Mobile Country Code.

      +

      Numeric max 4 digits

      +

      •MNC

      Mobile Network Code.

      +

      •LAC

      Location Area Code.

      +

      0 - 65535

      +

      •RAC

      The Routing Area Code identifies a routing area within the specific location area.

      +

      •Administration State

      (Read Only) Control the operation of the managed routing area.

      +

      •Locked

      •Unlocked

      > Routing Table

      +

      --

      +

      --

      +

      •User Type

      (Read Only) iPALIM user type.

      +

      •Private

      •Public

      •Hybrid

      •Administration State

      (Read Only) The state of the current setting entry.

      +

      •Locked

      •Unlocked

      •SGSN ID

      Specify ID of the serving SGSN virtual connection.

      +

      0 - 7

      +

      •APN Replace Flag

      Enable or disable replace the current access point name.

      +

      •Enable

      •Disable

      •APN

      Specify the modified APN if the replace flag is enabled.

      +

      --

      +

      > BVC Mapping

      +

      BSSGP Virtual Connection

      +

      Max 16 items

      +

      •NSEI

      Specify the value of Network Service Entity Identifier.

      +

      0 - 65535

      +

      •BVCI

      Specify the value of BSSGP Virtual Connection Identifier.

      +

      •Administration State

      (Read Only) The state of the current setting entry.

      +

      •Locked

      •Unlocked

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.17

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_19.htm b/wxc2_omc/omcHelp/2_1_1_19.htm new file mode 100755 index 0000000..c35dd38 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_19.htm @@ -0,0 +1,146 @@ +锘� + + + TMG + + + + + + + + + + + + + + + + + + + + +
      +

      Trunk Media Gateway

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Trunk MG Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •Local IP

      Specify the IP address of the MG.

      +

      Dotted decimal format

      +

      •Netmask

      A netmask is a 32-bit mask used to divide an IP address into subnets and specify the networks available hosts.

      +

      •Gateway

      Specify the IP address of the gateway connected to MG.

      +

      •System ID

      Specify the system ID of the media gateway.

      +

      0 - 31

      +

      •Sub System ID

      Specify the subsystem ID of the media gateway.

      +

      0 - 1

      +

      •Proxy IP

      Specify the IP address of the RTP proxy.

      +

      Dotted decimal format

      +

      •Port Type

      Specify the type of MG physical interface.

      +

      •E1

      •T1

      •Interface ID

      Specify the interface identifier to the physical interface.

      +

      0 - 65535

      +

      •Signaling Type

      Specify the signaling type of the MG physical interface.

      +

      •M2UA

      •IUA (For ISDN)

      •CRC4 Flag

      Enable or disable Cyclic Redundancy Check on the MG physical interface.

      +

      •Enable

      •Disable

      •ISDN Type

      Specify termination type of MG for ISDN connection.

      +

      •NT

      •LT

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.19

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_2.htm b/wxc2_omc/omcHelp/2_1_1_2.htm new file mode 100755 index 0000000..691a25d --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_2.htm @@ -0,0 +1,375 @@ +锘� + + + VLR + + + + + + + + + + + + + + + + + + + + +
      +

      Visitor Location Register

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The VLR entity is integrated in the MSS. The VLR stores information of all subscribers who enter the present service area. It also registers mobile subscriber identity, location identity and service parameters for the subscribers. It allocates Mobile Subscriber Roaming Numbers (MSRN) for terminating calls to subscribers located in its area.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •VLR Parameter Dictionary

       

      +

      •Enable Supplementary Service

       

      +

      •Enable VLR Purge

       

      +

      •Enable Ciphering

       

      +

      •Enable TMSI Reallocation

       

      +

      •Enable Non-registered or No SIM Emergency Call

       

      +

      •Enable Location Based Emergency Call

       

      +

      •Enable Authentication

       

      +

      •Enable Equipment Identity Register

       

      +

      •VLR Subscriber Management

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      100k subscribers

      +

      Data management

      +

      Authentication

      +

      Location update

      +

      TMSI allocation

      +

      MSRN

      +

      Ciphering

      +

      Purge

      +

      Data restoration

      +

      IMSI detach/attach

      +

      MAP/CAP version negotiation

      +

      Basic services

      +

      MO/MT call

      +

      Emergency call

      +

      Short message service

      +

      Supplementary services

      +

      Call forwarding:

      +

      •Call forwarding unconditional (CFU)

      •Call forwarding on subscriber busy (CFB)

      •Call forwarding on no reply (CFNRy)

      •Call forwarding on subscriber not reachable (CFNRc)

      Call hold

      +

      Call waiting

      +

      Call barring

      +

      Premium call

      +

      Password control

      +

      Calling Line Identification Presentation (CLIP)

      +

      Calling Line Identification Restriction (CLIR)

      +

      Connected line identification presentation (COLP)

      +

      Connected line identification restriction (COLR)

      +

      Explicit call transfer

      +

      Operator determined barring (ODB)

      +

      Operator specific barring (OSB)

      +

      Three-party call (3PTY)

      +

      Unstructured Supplementary Service Data (USSD)

      +

      enhanced Multi-Level Precedence and Preemption Service (eMLPP)

      +

      Support of encryption

      +

      Encryption provisioning (Kc)

      +

      Load sharing

      +

      Dual servers load sharing and redundancy

      +

      License control

      +

      VLR application flag

      +

      10 to 100k VLR subscribers at multiples of 100

      +
      +
      +

       

      +

       

      +

      VLR Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •Authentication

      Enable or disable authentication of the SIM in the mobile. Need AUC support.

      +

      --

      +

      •Location Update

      •Power On means only the initial Location Update will be authenticated.

      •All Location Update Authentication means all location update processes will be authenticated.

      •Disable

      •Power On

      •All LU

      •MO Call

      MO Authentication ON means authentication is necessary when making a Mobile Originating call.

      +

      •Enable

      •Disable

      •MT Call

      MT Authentication ON means authentication is necessary when making a Mobile Terminating call.

      +

      •Reuse Triplets

      --

      +

      --

      +

      •Reuse Triplets

      Setting this parameter permits a mobile to reuse triplets previously assigned to it by the system.

      +

      •Enable

      •Disable

      •Double Authentication

      Enable this parameter to force the system to perform a second authentication processes when the initial authentication fails.

      +

      •Ciphering

      Setting this parameter forces the mobile to use ciphering over the air interface.

      +

      •Enable

      •Disable

      •Ciphering Algorithm

      Select a ciphering algorithm from the drop-down menu.

      +

      •None

      •A5_1 to A5_7

      •TMSI Allocation

      •Allocate TMSI forces the system to allocate a TMSI only the first time a call management service is requested.

      •Reallocate TMSI forces the system to allocate a new TMSI every time a call management service is requested.

      •Disable

      •Allocate TMSI

      •Reallocate TMSI

      •OSB Definition

      These options allow the operator to set whether a call is allowed or barred:

      +

      •If this option is set to call allow, the call with the called number matched the dialing prefix with the OSB attribute enabled will be allowed to pass through, all other calls will be barred.

      •If it is set to call bar, the call with the destination number matching the dialing prefix defined with the OSB attribute enabled will be barred while all other calls will be allowed.

      •Disable

      •Allow

      •Bar

      •EC Setup Allowed

      Setting this parameter allows a non-registered mobile or a mobile with no SIM to make emergency calls.

      +

      •Enable

      •Disable

      •IMEI Verification

      Enable or disable equipment identity. Need EIR support.

      +

      --

      +

      •Location Update

      Setting this parameter forces the system to validate mobile equipment identity in Location Update processes.

      +

      •Enable

      •Disable

      •MO Call

      Setting this parameter forces the system to validate mobile equipment identity when making a Mobile Originating call.

      +

      •MT Call

      Setting this parameter forces the system to validate mobile equipment identity when making a Mobile Terminating call.

      +

      •VLR Purge

      Enable or disable the VLR Purging feature. When this feature is on, the system purges numbers from the VLR when they have been idle for the amount of time specified in the Idle Period to Purge fields.

      +

      •Enable

      •Disable

      •Idle Period to Purge

      This field determines how long a VLR entry can remain idle before the system purges it.

      +

      1 - 65535 mins

      +

      •CDR Flag

      Enable or disable Call Detail Record generation of VLR.

      +

      •Enable

      •Disable

      •Update HLR Option

      --

      +

      --

      +

      •Normal LU

      Setting this parameter forces VLR to update subscriber data from HLR in normal location update processes.

      +

      •Request

      •No request

      •Periodic LU

      Setting this parameter forces VLR to update subscriber data from HLR in periodic location update processes.

      +

      •IMSI Attach

      Setting this parameter forces VLR to update subscriber data from HLR in IMSI attach processes.

      +

      •MSRN Start

      The start of the MSRN range.

      +

      Valid E.164 number

      +

      •MSRN End

      The end of the MSRN range.

      +

      •OPR Flag

      Enable or disable OPR service.

      +

      •Enable

      •Disable

      •IMDX Flag

      Enable or disable IMDX service.

      +

      •IMSI Prefix for OPPS

      OPPS substitutes the IMSI prefix (MCC+MNC) of the inbound OPPS users by the predefined pseudo IMSI prefix for HLR routing purpose. It should be different from the IMSI prefix of the local network or any other roaming partners' networks.

      +

      MCC+MNC

      +

      •Default Priority

      Specify a default priority to subscribers. It cooperates with the eMLPP option in the MSC setting.

      +

      •Normal

      •Level 0 - 4

      •Level A - B

      •ODB BOIC SMS Barring

      Enable or disable barring International SMS (or International SMS except to HPLMN) when ODB BOIC (or ODB BOIC-exHPLMN) is enabled.

      +

      •Enable

      •Disable

      Management

      +

      --

      +

      --

      +

      •Version

      (Read Only) VLR software version.

      +

      x.y.z

      +

      •Status

      (Read Only) The current status of VLR.

      +

      --

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_20.htm b/wxc2_omc/omcHelp/2_1_1_20.htm new file mode 100755 index 0000000..3002c45 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_20.htm @@ -0,0 +1,199 @@ +锘� + + + SMPP + + + + + + + + + + + + + + + + + + + + +
      +

      SMPP

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The short message peer-to-peer protocol (SMPP) is a telecommunications industry protocol for exchanging SMS messages between SMS peer entities such as short message service centres. It is often used to allow third parties (e.g. value-added service providers like news organizations) to submit messages, often in bulk.

      +

       

      +

      The protocol is based on pairs of request/response packets exchanged over TCP/IP or UDP connections. Packets are binary encoded for efficiency.

      +

       

      +

      The most commonly used versions of SMPP are v3.3, the most widely supported standard, and v3.4, which adds transceiver support (single connections that can send and receive messages). Data exchange may be synchronous, where each peer must wait for a response for each packet being sent, and asynchronous, where receiving and transmitting go in independent threads with the use of buffers and timers. The latest version of SMPP is v5.0. UltraWAVE system currently supports v3.4.

      +

       

      +

       

      +

      SMPP Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      SMPP Link

      +

      --

      +

      Max 32 items

      +

      •Link Alias

      Name of the SMPP connection. Generally use the name of the remote SMPP entity.

      +

      Text string

      +

      •Link Type

      Transport protocol of the SMPP connection.

      +

      •UDP

      •TCP

      •Server Type

      Specify the application type of the local SMPP entity.

      +

      •Client: Work as External Short Message Entity (ESME)

      •Server: Work as Short Message Center (SMSC)

      •Client

      •Server

      •Session Type

      Specify how the local SMPP entity shall bind to the remote SMPP entity.

      +

      •TX: Work as Transmitter

      •RX: Work as Receiver

      •TRX: Work as Transceiver

      •Bind TX

      •Bind RX

      •Bind TRX

      •System ID

      Specify the user name for the gateway to use when connecting to the remote SMPP entity.

      +

      Text string

      +

      •Password

      Specify the password for the gateway to use when connecting to the remote SMPP entity.

      +

      Numeric max 8 digits

      +

      •System Type

      An optional login parameter that should be set only if required by the remote SMPP entity. The remote SMPP administrator will provide this value, which when required, is usually a short text string.

      +

      Text string

      +

      •Local GTT

      Specify the GTT of local SMPP entity.

      +

      Valid E.164 number

      +

      •Remote GTT

      Specify the GTT of remote SMPP entity.

      +

      •Local IP

      Specify the IP address of local SMPP entity.

      +

      Dotted decimal format

      +

      •Remote IP

      Specify the IP address of remote SMPP entity.

      +

      •Session Init Timer

      Specify the maximum time-out value for the time period between an application's network connection setup request and BIND request.

      +

      If the time-out value is reached, the connection is terminated.

      +

      0 - 65535 seconds

      +

      •Enquire Link Timer

      Specify the minimum time-out period between the SMPP service's sending of ENQUIRE LINK requests to an application.

      +

      •Inactivity Timer

      Specify the maximum time-out period allowed for inactivity between an application鈥檚 request towards the SMPP service.

      +

      If the time-out value is reached, the connection is terminated.

      +

      •Response Timer

      Specify the maximum time-out period allowed between the SMPP service sends a request to an application and a response to the request is received.

      +

      If the time-out value is reached, the connection is terminated.

      +

      •Local SSN

      Specify the subsystem number of local SMPP entity.

      +

      0 - 255

      +

      •Remote SSN

      Specify the subsystem number of remote SMPP entity.

      +

      •Flag

      Enable or disable this SMPP connection.

      +

      •Enable

      •Disable

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.20

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_21.htm b/wxc2_omc/omcHelp/2_1_1_21.htm new file mode 100755 index 0000000..1e3b501 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_21.htm @@ -0,0 +1,146 @@ +锘� + + + MCA + + + + + + + + + + + + + + + + + + + + +
      +

      MMS Charging Agent

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MMS Charging Agent works between PPS and Multimedia Messaging Service center to provide prepaid function for multimedia messaging service. The MCA converts between the PPS RADIUS messages and the HTTP commands adopted by MMS center.

      +

       

      +

       

      +

      MCA Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      These parameters are associated with the relevant setting in PPS >Service Control >RADIUS GGSN.

      +

      --

      +

      •Local IP

      IP address of the MMS Charging Agent.

      +

      Dotted decimal format

      +

      •NAS 0 IP

      IP address of PPS-0.

      +

      •NAS 0 Key

      Specify the cryptographic key used between MCA and PPS-0.

      +

      Text string

      +

      •NAS 0 Password

      Specify the password used between MCA and PPS-0.

      +

      •NAS 1 IP

      IP address of PPS-1.

      +

      Dotted decimal format

      +

      •NAS 1 Key

      Specify the cryptographic key used between MCA and PPS-1.

      +

      Text string

      +

      •NAS 1 Password

      Specify the password used between MCA and PPS-1.

      +

      MMS Center

      +

      --

      +

      Max 8 items

      +

      •Flag

      Enable or disable the connection to the specific MMS center.

      +

      •Enable

      •Disable

      •IP

      IP address of the specific MMS center.

      +

      Dotted decimal format

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.21

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_22.htm b/wxc2_omc/omcHelp/2_1_1_22.htm new file mode 100755 index 0000000..6d1922b --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_22.htm @@ -0,0 +1,441 @@ +锘� + + + MTP3 + + + + + + + + + + + + + + + + + + + + +
      +

      MTP3

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Message Transfer Part provides a reliable transfer and delivery of signaling information across signaling networks. It is divided into three levels:

      +

      •MTP Level 1 defines the physical, electrical, and functional characteristics for the signaling data link.

      •MTP Level 2 provides the reliability aspects of MTP including error monitoring and recovery.

      •MTP Level 3 provides the link, route, and traffic management aspects of MTP.

       

      +

      The MTP software and boards support ITU-T, ANSI, and Chinese variants of the protocol, enabling applications to be widely deployed.

      +

       

      +

      MTP provides the means to:

      +

      •Interface with the SS7 network

      •Detect and correct errors to messages sent on signaling links

      •Manage links and routes, thus mitigating failures and congestion within the network should they occur

       

      +

      MTP provides routing services for SCCP and ISUP on a point-to-point basis. In addition, MTP supports TCAP, which depends upon SCCP, as well as the protocols such CAP and GSM MAP that are supported by TCAP.

      +

       

      +

      The UltraWAVE MTP modules support the relevant addressing (point code) scheme required by ITU-T, ANSI, and China. In addition, it supports:

      +

      •4 networks: National, National Spare, International, International Spare

      •14-bit / 24-bit originating point code

      •1024 signaling links

      •512 linksets

      •1024 routing sets (destination point code) per network

      •16 links per linkset

       

      +

       

      +
      + + + +

      Signaling Point Code (SPC) in the SS7 network is uniquely identified by a numeric point code. Point codes are carried in signaling messages exchanged between signaling points to identify the origination (Originating Point Code) and destination (Destination Point Code) of each message.

      +

      Each signaling point in a signaling network is allocated to a code plan that is unambiguous within a domain (International, International Spare, National, National Spare), in accordance with the Network Indicator (NI).

      +

      Signaling points in the same domain are specified to a fixed length, either 14-bit or 24-bit.

      +

      Message routing is the process of selecting, for each signaling message to be sent, the signaling linkset to be used. It is based on analysis of the predetermined routing data at the signalling point concerned.

      +

      •ACN: The Application Context Name enables the version negotiation for the MAP messages, which make the system more compatible with the other networks by means of flexible message version adjustment. The adjustable version includes Version 1, Version 2 and Version 3.

       

      +
      +
      +

       

      +
      + + + +

      Telecommunication network served by a common channel signaling is composed of a number of switching and processing nodes interconnected by transmission links. To communicate using SS7, each of these nodes must act as a signalling point within the SS7 network. In addition, there will be a need to interconnect these signalling points by means of signalling data links, such that SS7 information may be conveyed between them.

      +

      •SLC: The selection of outgoing link is based on information in the DPC and Signaling Link Code field. The Signaling Link Code is used to:

      -Ensure message sequencing. Any two messages sent with the same SLC will always arrive at the destination in the same order in which they were originally sent.

      -Allow equal load sharing of traffic among all available links. In theory, if a user part sends messages at regular intervals and assigns the SLC values in a round-robin fashion, the traffic level should be equal among all links (within the combined linkset) to that destination.

      •Sigtran: The Sigtran protocol deliveries traditional switched circuit signaling on IP network, with an emphasis on SS7 over IP.

      •M2UA: The M2UA protocol is the layer between SCTP and MTP3 that separates the physical SS7 termination from the actual signaling point within the network. M2UA serves several purposes. The first purpose is to provide a mechanism for the transport of SS7 MTP2 user signaling (e.g., MTP3 messages) over IP using SCTP. The second purpose is to allow remote placement of SS7 link terminations and back haul SS7 traffic to a centralized point in the network.

       

      +
      +
      +

       

      +
      + + + +

      A number of parallel signaling links constitute a linkset.

      +

       

      +
      +
      +

       

      +
      + + + +

      The Signaling Gateway provides interworking between the UltraWAVE MSC and the IP-based network elements. It is implemented as an embedded component of MTP3.

      +

       

      +
      +
      +

       

      +
      + + + +

      Each signaling point in the SS7 network is identified with a unique address called a point code. Point codes are carried in signaling messages exchanged between signaling points to identify the source and destination of each message. The point code is a hierarchical address that consists of a network identification which identifies a signaling network. In the ITU definition, there are four signaling networks and each signaling network can have a unique Originating Point Code.

      +

      The Flexible Point Codes Function of the UltraWAVE system is an extension of the upper definition; it allows each signaling network to have multiple point codes. That means several Originating Point Codes may exist in the same signaling network. This function is based on the achievement of binding OPCs on linksets and routes.

      +

      The UltraWAVE system supports up to 512 linkset, each linkset should be assigned to a signaling network and have an individual OPC. When the OPC of the linkset is ignored, the linkset will take the OPC of its signaling network as an alternative. The OPC of the linkset takes priority over the OPC of its signaling network.

      +

      Each linkset has its own route to define a particular destination and its accompany alternate linkset. Just like the linkset, a route should be assigned to a signaling network and have an individual OPC. When the OPC of the route is ignored, the route will take the OPC of its signaling network as an alternative. The OPC of the route takes priority over the OPC of its signaling network.

      +

       

      +
      +
      +

       

      +

      MTP3 Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •TCP Port

      Specify a TCP port for the SCCP-Lite protocol.

      +

      •Default = 5000

      --

      +

      Int Network

      +

      Int S Network

      +

      Nat Network

      +

      Nat S Network

      +

      Parameter configuration for the International network.

      +

      The other three networks have the same parameter structure.

      +

      International

      +

      International Spare

      +

      National

      +

      National Spare

      +

      •OPC

      Assign a default Point Code to the local MSC. This OPC is applicable only to the specific signaling network.

      +

      ITU = 1 - 16383

      +

      ANSI = 1 - 16777215

      +

      •Point Code Length

      Specify the length of Point Code using in the international signaling network.

      +

      •14-bit

      •24-bit

      •Point Code Type

      Specify the protocol stack using in the international signaling network. It can be ITU or ANSI.

      +

      •ITU

      •ANSI

      > Routing

      +

      --

      +

      Max 1024 items

      +

      •Title

      Routing destination name for identification purpose only.

      +

      --

      +

      •DPC

      Decimal Point Code of the routing destination node.

      +

      ITU = 1 - 16383

      +

      ANSI = 1 - 16777215

      +

      •OPC

      Specify a virtual Point Code to the local MSC. This OPC will be transmitted between the local MSC and the destination node.

      +

      From the destination node's perspective, it's the unique Point Code of the local MSC.

      +

      The compulsory OPC makes the system more compatible with other networks by means of supporting multiple point codes.

      +

      Set 0 to use the default OPC for this routing entry.

      +

      •Normal Linkset

      Specify the primary linkset to the routing entry for signaling addressing.

      +

      0 - 511

      +

      •Alternative Linkset

      Specify a secondary linkset to the routing entry for signaling addressing when the primary linkset is unavailable.

      +

      •M3UA Routing Context

      Define routing context to identify M3UA traffic transmitted between the local MSC and the destination node.

      +

      The routing context must be unique for each M3UA application defined.

      +

      0 - 16777215

      +

      Linkset

      +

      --

      +

      Max 512 items

      +

      •Title

      Linkset destination name for identification purpose only.

      +

      --

      +

      •Admin State

      (Read Only) Control the operation of the managed linkset by lock and unlock commands.

      +

      •Locked

      •Unlocked

      •Status

      (Read Only) The current status of the serving linkset.

      +

      •Online

      •Offline

      •Network Indicator

      Identify the Network Indicator of this linkset.

      +

      •National

      •National Spare

      •International

      •International Spare

      •DPC

      Decimal Point Code of the linkset destination node.

      +

      ITU = 1 - 16383

      +

      ANSI = 1 - 16777215

      +

      •OPC

      Specify a virtual Point Code to the local MSC. This OPC will be transmitted between the local MSC and the destination node.

      +

      From the destination node's perspective, it's the unique Point Code of the local MSC.

      +

      The compulsory OPC makes the system more compatible with other networks by means of supporting multiple point codes.

      +

      Set 0 to use the default OPC of the specific signaling network.

      +

      •Loopback Option

      Enable to loop all data on this linkset from transmit side back to receive side.

      +

      Enable it on the linksets connected between two MSS platforms.

      +

      •Enable

      •Disable

      Link

      +

      --

      +

      Max 1024 items

      +

      •Title

      Link destination name for identification purpose only.

      +

      --

      +

      •Admin State

      (Read Only) Control the operation of the managed link by lock and unlock commands.

      +

      •Locked

      •Unlocked

      •Status

      (Read Only) The current status of the serving link.

      +

      •Online

      •Offline

      •Signaling Type

      Specify the signaling type of this link.

      +

      •ECP = 8KE1 Control Protocol defined for circuit switch applications.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      •MTP3-Lite = Protocol defined for IPA BSS or AMG connections.

      •ECP

      •M2UA

      •M3UA

      •IUA

      •MTP3-Lite

      •Linkset ID

      Specify the index number of the associated linkset to this link.

      +

      0 - 511

      +

      •SLC

      Signaling Link Code ranges from 0 to 15. The SLC must be unique for each link within the same linkset.

      +

      0 - 15

      +

      •Host IP

      Specify the primary management server of this link. Enter the IP address of MSC-0 or MSC-1.

      +

      Dotted decimal format

      +

      •Alternative Host IP

      Specify a secondary management server of this link just in case the primary server is unavailable. Enter the IP address of MSC-1 or MSC-0.

      +

      •SG ID

      Specify the index number of the relevant signaling gateway to this link.

      +

      0 - 255

      +

      •M2UA IID

      Specify M2UA Interface Identifier (IID) to this link. The IID must be unique for each link connected to the same signaling gateway.

      +

      0 - 15

      +

      •Application Mode

      (For MTP3-Lite) Specify the application mode of the local MSC when connecting to the IPA BSS or AMG.

      +

      •Server

      •Client

      •Remote IP

      (For MTP3-Lite) IP address of the connected IPA BSS or AMG.

      +

      Dotted decimal format

      +

      •Inactivity Timeout

      (For MTP3-Lite) Specify the allowable interval of time without receiving a heartbeat from IPA BSS or AMG. Unit is second.

      +

      0 - 255 seconds

      +

      •Allowed Timeout Times

      (For MTP3-Lite) Define the maximum number of allowed inactivity timeout.

      +

      0 - 255

      +

      SG

      +

      --

      +

      Max 256 items

      +

      •Admin State

      (Read Only) Control the operation of the managed SG entry by lock and unlock commands.

      +

      •Locked

      •Unlocked

      •Application Mode

      Specify the application mode of the connected signaling gateway.

      +

      •Server

      •Client

      •ACK Option

      Enable or disable ACK message delivery on this SG entry.

      +

      •Allow

      •Forbid

      •Signaling Type

      Specify the signaling type of this signaling gateway.

      +

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.<

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      •M2UA

      •M2UA

      •IUA

      •Remote IP

      IP address of the signaling gateway destination.

      +

      Dotted decimal format

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.22

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_1_1_23.htm b/wxc2_omc/omcHelp/2_1_1_23.htm new file mode 100755 index 0000000..1835bfd --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_23.htm @@ -0,0 +1,318 @@ +锘� + + + SCCP + + + + + + + + + + + + + + + + + + + + +
      +

      SCCP

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      SCCP (Signaling Connection Control Point) provides additional routing capabilities via Sub-System Numbers (SSNs). It also offers the capability of routing based on dialed digits or global title translation. UltraWAVE SCCP module supports ITU-T, ETSI, ANSI, Chinese variants of the protocol, enabling applications to be widely deployed.

      +

       

      +

      The UltraWAVE SCCP module provides the means to:

      +

      •Route TCAP messages from end-to-end

      •Translate from Global Title numbers to point code and subsystem numbers

      •Establish and release connections

       

      +

      SCCP provides routing services for TCAP on an end-to-end basis, which supplements the point-to-point routing of MTP. In addition, SCCP translates Global Titles to point codes and subsystem numbers, simplifying routing table maintenance within a network.

      +

       

      +

       

      +
      + + + +

      Local Node provides subsystem numbers to allow messages to be addressed to specific applications.

      +

       

      +
      +
      +

       

      +
      + + + +

      Global Title Translation is the SS7 equivalent to IP routing. Translation examines the destination address (e.g. the number being called) and deciding how to identify it over the telephone network. This process can include global title analysis, which is the act of looking up the number and finding a result address, and global title modification.

      +

       

      +
      +
      +

       

      +
      + + + +

      The Network Code table contains the information necessary to identify the intended endpoint for the telephone call.

      +

      •CC: The Country Code is a one, two, or three digits number used to identify the country's network.

      •NDC: The National Destination Code defines the national calling area or national network to which the subscriber belongs.

      •MCC: The Mobile Country Code is a three digit number uniquely identifying a given country. It is utilized within the IMSI (International Mobile Subscriber Identity) and LAI (Location Area Identity).

      •MNC: The Mobile Network Code is either a two or three digit number used to uniquely identify a given network from within a specified country. The MNC is used as part of the IMSI and LAI.

      •International Prefix: It is a digit or combination of digits used by a subscriber when making an international call. The international prefix is used to indicate that the following digits represent an international number and should be routed to an international gateway.

      •National Prefix: It is a digit or combination of digits used by a subscriber when calling a national destination (within the country) other than that of the local area network.

       

      +
      +
      +

       

      +

      SCCP Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •Version

      (Read Only) Version of SCCP software.

      +

      --

      +

      Local Node

      +

      --

      +

      --

      +

      •Index

      The Sub-System Number (SSN) of this local node.

      +

      1 - 255

      +

      •Title

      Local Node name for identification.

      +

      --

      +

      •Network Indicator

      Network Indicator identifies the type of network.

      +

      •National

      •National Spare

      •International

      •International Spare

      •MSISDN

      The E.164 node address of this local node.

      +

      Valid E.164 number

      +

      •IP 0

      IP address of the local node server 0.

      +

      Dotted decimal format

      +

      •IP 1

      IP address of the local node server 1.

      +

      •ACN Version ID

      (Read Only) The ACN version index 0 is reserved for local ACN use.

      +

      0

      +

      GTT

      +

      Global Title Translation

      +

      Max 1024 items

      +

      •Admin State

      Control the operation of this Global Title Translation (GTT) entry.

      +

      •Enable

      •Disable

      •Input Numbering Plan

      Type of the input number.

      +

      •ANSI IMSI (MSISDN)

      •MSISDN

      •IMSI

      •GT

      •Translation Type

      Translation examines the destination address and decides how to identify it over the network.

      +

      0 - 255

      +

      •Number Start

      The beginning of the number range for this GTT entry.

      +

      Valid E.164 / E.212 / E.214 number

      +

      •Number End

      The end of the number range for this GTT entry.

      +

      •Network Indicator

      Network Indicator identifies the type of network.

      +

      •National

      •National Spare

      •International

      •International Spare

      •DPC

      Destination Point Code in decimal format.

      +

      ITU = 1 - 16383

      +

      ANSI = 1 - 16777215

      +

      •SSN

      Sub-System Number in decimal format.

      +

      0 - 255

      +

      •Routing Indicator

      SSN for subsystem, GT for global title.

      +

      •For IMSI and MSISDN, select Route on SSN.

      •For the connected network, select Route on GT.

      •On GT

      •On SSN

      •Address Indicator

      Contribution of SCCP address.

      +

      •DPC+SSN

      •GT+SSN

      •GT+DPC+SSN

      •Replace Digits Start

      If the number is going to replace digits, start with this digit (position from left to right).

      +

      0 means void.

      +

      0 - 16

      +

      •Replace Digits End

      If the number is going to replace digits, end on this digit (position from left to right).

      +

      0 means void.

      +

      0 - 16

      +

      •Output Numbering Plan

      Type of the output number.

      +

      •MSISDN

      •IMSI

      •GT

      •Replace Digits

      If the number is going to replace digits, replace them with this string.

      +

      Numeric max 16 digits

      +

      •ACN Version ID

      Specify an Application Context Version entry for this Global Title Translation (GTT).

      +

      0 - 1023

      +

      ACN Version

      +

      Application Context Version

      +

      The compulsory application context version makes the system more compatible with other networks by means of flexible MAP version adjustment.

      +

      Max 1024 items

      +

      •Version State

      Enable or disable this ACN version entry.

      +

      •Enable

      •Disable

      •MAP Applications

      Define specific application context version for each MAP operation which is applying between the local MSC and the destination node.

      +

      Index 0 is defined the default application context version for each MAP operation which is supported by the local MSC in the international signaling network.

      +

      •Version 1

      •Version 2

      •Version 3

      •VLR Supported CAMEL

      Specify the VLR supported phase of CAMEL.

      +

      •Phase 1

      •Phase 1&2

      •Phase 1&2&3

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.23

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_1_1_24.htm b/wxc2_omc/omcHelp/2_1_1_24.htm new file mode 100755 index 0000000..f0ea4eb --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_24.htm @@ -0,0 +1,301 @@ +锘� + + + XAPP + + + + + + + + + + + + + + + + + + + + +
      +

      XAPP

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The XAPP entity is a Composite Application Platform of the MSS system. It is used to:

      +

      •Define the network number of the system;

      •Customize the presented caller number format for receiving short message;

      •Convert service number format for MAP applications;

      •Define allowable MSISDN range for Call Me Back service.

       

      +

       

      +

      XAPP Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •MCC

      Mobile Country Code

      +

      Numeric max 4 digits

      +

      •MNC

      Mobile Network Code

      +

      •CC

      Country Code

      +

      •NDC

      National Destination Code

      +

      Numeric max 6 digits

      +

      •International Prefix

      A digit or combination of digits used by a subscriber when making an international call. The international prefix is used to indicate that the following digits represent an international number and should be routed to an international gateway.

      +

      Numeric max 4 digits

      +

      •National Prefix

      A digit or combination of digits used by a subscriber when calling a national destination (within the country) other than that of the local area network.

      +

      Prefix Manipulation

      +

      Convert service number format for MAP applications. Such as prepaid charging, querying and voice mail routing.

      +

      Max 128 items

      +

      •Title

      Name for identification purpose only.

      +

      Max 16 characters

      +

      •Prefix

      A combination digits that dial to the MAP service.

      +

      Numeric max 16 digits

      +

      •Deletion Count

      The amount of digits to be deleted from the beginning of the incoming number.

      +

      0 - 16

      +

      •Insertion Count

      The amount of digits to be inserted to the front of the dialed number.

      +

      •Inserted Digits

      The digits to be added to the front of the dialed number.

      +

      Numeric max 16 digits

      +

      •Number Length

      The length of the incoming service number.

      +

      •0 = Length is uncertain

      0 - 16

      +

      Number Group

      +

      Convert a group of service number format for MAP applications.

      +

      Max 128 items

      +

      •Title

      Name for identification purpose only.

      +

      Max 16 characters

      +

      •Start Number

      The first number in the group range.

      +

      Numeric max 16 digits

      +

      •End Number

      The last number in the group range.

      +

      •Replace Digits from

      The first digit to be replaced from left to right.

      +

      0 - 16

      +

      •Replace Digits to

      The last digit to be replaced from left to right.

      +

      •Replace Digits with

      Replace the upper preset digit range with these digits.

      +

      Numeric max 16 digits

      +

      CLI Manipulation

      +

      Customize the presented caller number format for receiving short message.

      +

      Max 64 items

      +

      •Title

      Name for identification purpose only.

      +

      Max 16 characters

      +

      •Original NAI

      Original Number Attribute Identity of the caller numbers beginning with this prefix.

      +

      •IDD

      •NDD

      •Unknown

      •Prefix

      The initial digits of the caller number.

      +

      Numeric max 16 digits

      +

      •Deletion Count

      The amount of digits to be deleted from the beginning of the calling number.

      +

      0 - 16

      +

      •Modified NAI

      Number Attribute Identity of the caller number after manipulation.

      +

      •IDD

      •NDD

      •Unknown

      •Insertion Count

      The amount of digits to be inserted to the front of the calling number.

      +

      0 - 16

      +

      •Inserted Digits

      The digits to be added to the front of the calling number.

      +

      Numeric max 16 digits

      +

      •Number Length

      The length of the caller number.

      +

      •0 = Length is uncertain

      0 - 16

      +

      Local MSISDN

      +

      Specify the allowable local MSISDN range for Call Me Back service.

      +

      Max 128 items

      +

      •Title

      Name for identification purpose only.

      +

      Max 16 characters

      +

      •Start Number

      The first number in the local MSISDN range.

      +

      Numeric max 16 digits

      +

      •End Number

      The last number in the local MSISDN range.

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.24

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_3.htm b/wxc2_omc/omcHelp/2_1_1_3.htm new file mode 100755 index 0000000..5b53672 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_3.htm @@ -0,0 +1,425 @@ +锘� + + + HLR + + + + + + + + + + + + + + + + + + + + +
      +

      Home Location Register

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The HLR entity is integrated in the MSS. The HLR database is for storage and management of subscriber information. The HLR stores permanent subscriber data including a subscriber's service profile, location information and activity status. When a mobile user buys a subscription from the service provider, the user is registered in the HLR.

      +

       

      +

      The basic functions of the HLR includes:

      +

      •Storage of the subscriber database

      •Provisioning of data for the VLR

      •Subscriber data query and modification via EMS GUI

      •Periodic database update queries for VLR update

       

      +

      The information stored in the HLR includes the following:

      +

      •Subscription information

      •Location information enabling the charging and routing of calls towards the MSC where the Mobile Station (MS) is registered, for example the MS Roaming Number, the VLR Number, the MSC Number and the Local MS Identity.

      •Telecommunication and bearer services subscription information

      •Service restrictions - roaming limitations

      •Parameters attached to supplementary services

       

      +

       

      +

      See Also

      +

       

      +

      •HLR Parameter Dictionary

       

      +

      •Enable Supplementary Service

       

      +

      •Configure USSD

       

      +

      •HLR Subscriber Management

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      100k subscribers

      +

      Interface

      +

      MAP-C (HLR-MSC, SMSC)

      +

      MAP-D (HLR-VLR)

      +

      MAP-H (HLR-AUC)

      +

      CAMEL phase I, II, III

      +

      SNMP (HLR-EMS)

      +

      CAMEL (GSM 02.78, GSM 03.78, GSM 09 .78)

      +

      O-CSI

      +

      T-CSI

      +

      SS-CSI

      +

      SMS-CSI

      +

      GPRS-CSI

      +

      Management

      +

      Location management

      +

      Authentication management

      +

      Country specific roaming restriction

      +

      Roaming restrictions on VLR basis in VPLMN (GSM 09.02)

      +

      Supplementary service

      +

      Call forwarding:

      +

      •Call forwarding unconditional (CFU)

      •Call forwarding on subscriber busy (CFB)

      •Call forwarding on no reply (CFNRy)

      •Call forwarding on subscriber not reachable (CFNRc)

      Call hold

      +

      Call waiting

      +

      Call barring

      +

      Premium call

      +

      Line identity

      +

      Password control

      +

      Explicit call transfer

      +

      Operator determined barring (ODB)

      +

      Operator specific barring (OSB)

      +

      Three-party call (3PTY)

      +

      Unstructured Supplementary Service Data (USSD)

      +

      enhanced Multi-Level Precedence and Preemption Service (eMLPP)

      +

      Location services

      +

      Standard MAP-interface Lh to Gateway Mobile Location Center

      +

      Routing service

      +

      PRN (provisional roaming number)

      +

      Short message

      +

      Support short message service

      +

      GPRS

      +

      Support GPRS (Gr)

      +

      Mesh HLR

      +

      Cooperate with Multisite HLR Coordinator (MHC) to support mesh HLR function

      +

      Redundancy

      +

      Dual servers load sharing and active redundancy

      +

      License control

      +

      HLR application flag

      +

      10 to 100k HLR subscribers at multiples of 100

      +
      +
      +

       

      +

       

      +

      HLR Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •CC

      Define the SN range of the VLRs in the Home PLMN. MSISDN=CC+NDC+SN. All VLRs within the HPLMN have the same CC and NDC but different SN.

      +

      •CC = Country Code

      •NDC = National Destination Code

      •Start SN = The start of the VLR SN range.

      •End SN = The end of the VLR SN range.

      Numeric max 4 digits

      +

      •NDC

      Numeric max 6 digits

      +

      •Start SN

      Numeric max 12 digits

      +

      •End SN

      Numeric max 12 digits

      +

      •Max License

      (Read Only) The maximum subscriber capacity of HLR determined by License Control.

      +

      0 - 100,000

      +

      •Used License

      (Read Only) The number of registered HLR subscribers.

      +

      •Provisioned Users

      (Read Only) The number of service enabled HLR subscribers.

      +

      •Registered Users

      (Read Only) The number of registered (both service enabled and disabled) HLR subscribers.

      +

      •Roaming Users

      (Read Only) The number of provisioned HLR subscribers currently roaming to VPLMNs.

      +

      •Software Version

      (Read Only) HLR software version.

      +

      x.y.z

      +

      •Data Version

      (Read Only) Version of HLR subscriber data structure.

      +

      •CDR Flag

      Enable or disable CDR generation of HLR.

      +

      •Enable

      •Disable

      •Reload State

      Select Reload to load backup HLR subscriber data from HLR server hard disk.

      +

      •Idle

      •Reload

      VPLMN

      +

      Define connected VPLMNs by specifying VLR zones.

      +

      Max 256 items

      +

      •CC

      The Country Code of the VPLMN.

      +

      Numeric max 4 digits

      +

      •NDC

      The National Destination Code of the VPLMN.

      +

      Numeric max 6 digits

      +

      •Start SN

      The beginning of the VLR range in the VPLMN.

      +

      Numeric max 12 digits

      +

      •End SN

      The end of the VLR range in the VPLMN.

      +

      CSRR List

      +

      Define Country Specific Roaming Restriction lists to confine the roaming range of a subscriber.

      +

      Max 8 items

      +

      •VPLMN0 - 255

      Each CSRR entry defines the roaming restriction for 256 VPLMN ranges.

      +

      •Allow

      •Forbid

      RSZI List

      +

      The regional subscription zone code list.

      +

      Regional Subscription Code = CC+NDC+Zone Code

      +

      Max 256 items

      +

      •CC

      The Country Code of the regional subscription zone.

      +

      Numeric max 4 digits

      +

      •NDC

      The National Destination Code of the regional subscription zone.

      +

      Numeric max 6 digits

      +

      •Zone Code

      The regional subscription zone code.

      +

      0 - 65535

      +

      Fax GSM BC

      +

      Define the GSM Bearer Capability for fax service.

      +

      •Default = A3B88120156380

      Max 16 items

      +

      Data GSM BC

      +

      Define the GSM Bearer Capability for data service.

      +

      •Default = A28881211563A8

      Max 16 items

      +

      USSD

      +

      Unstructured Supplementary Services Data service.

      +

      --

      +

      •USSD Format

      The access code of USSD service. Start with 2-3 digits of '*' or '#' . End with '#'. Separate sections by '*' . Contents can be added:

      +

      •C/c = Service Code

      •R/r = Router Indicator

      •B = Blank

      •S = Supplement Info

      e.g. **C3B*S#

      +

      •UG CSI Service Code

      USSD SCF CAMEL subscription information. Prepaid subscribers dial this code to activate Inquire and Recharge services.

      +

      e.g. Service Code = 111, dial **1215111*# to access USSD services.

      +

      Numeric max 4 digits

      +

      •UG CSI SCF Address

      USSD SCF CAMEL subscription information. SCF E.164 number.

      +

      •Format = 91+CC+NDC+SN

      Valid E.164 number

      +

      USSD EAE

      +

      USSD Extended Application Entity

      +

      Max 128 Items

      +

      •USSD Service Code

      The service code dials to access different USSD services.

      +

      Numeric max 4 digits

      +

      •SMPP Service Number

      Enter the identical Service Number as that set in SMPP configuration to connect with the third party USSD server. Enter 0 for local prepaid service (inquiry and recharge).

      +

      Numeric max 9 digits

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_4.htm b/wxc2_omc/omcHelp/2_1_1_4.htm new file mode 100755 index 0000000..17f6518 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_4.htm @@ -0,0 +1,175 @@ +锘� + + + AUC + + + + + + + + + + + + + + + + + + + + +
      +

      Authentication Center

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The optional AUC entity is integrated in the MSS. The AUC server provides authentication and encryption parameters that verify the MS user's identity and guarantee the confidentiality of each call.

      +

       

      +

      The basic functions of the AUC include:

      +

      •Authentication service provisioning management

      •Data encryption, security and access protection

      •Generation of security triplets for the MS

      •Cooperation with the HLR

      •Subscriber data query and modification via EMS GUI

       

      +

       

      +

      See Also

      +

       

      +

      •AUC Parameter Dictionary

       

      +

      •Enable Authentication

       

      +

      •AUC Subscriber Management

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      100k subscribers

      +

      Triplet generation: 500/s

      +

      Provisioning

      +

      Automatic provisioning from SIM file

      +

      Authentication

      +

      Generation of security triplets

      +

      Generation of random number

      +

      A3/A8 (v1, v2 and v3), XOR.

      +

      Maximum 256 algorithms. The 255th algorithm is reserved for pseudo authenticated.

      +

      Security and Confidentiality

      +

      Encryption of security sensitive data

      +

      Access Administration

      +

      Operation log

      +

      Redundancy

      +

      Dual servers load sharing and redundancy

      +

      License Control

      +

      AUC application flag

      +

      10 to 100k AUC subscribers at multiples of 100

      +
      +
      +

       

      +

       

      +

      AUC Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •Max License

      (Read Only) The maximum subscriber capacity of AUC determined by License Control.

      +

      0 - 100,000

      +

      •Used License

      (Read Only) The number of registered AUC subscribers.

      +

      •Provisioned Users

      (Read Only) The number of service enabled AUC subscribers.

      +

      •Software Version

      (Read Only) Version of AUC software.

      +

      x.y.z

      +

      •Data Version

      (Read Only) Version of AUC subscriber data structure.

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.4

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_5.htm b/wxc2_omc/omcHelp/2_1_1_5.htm new file mode 100755 index 0000000..4bbdb7c --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_5.htm @@ -0,0 +1,291 @@ +锘� + + + SMSC + + + + + + + + + + + + + + + + + + + + +
      +

      Short Message Service Center

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      As a value added entity of the UltraWAVE system, the SMSC is integrated in the MSS (Multiple System Server) along with the MSC, AAS, HLR, AUC and PPS servers and implemented in the UltraWAVE network. It supports delivery of mobile originated (MO) and mobile terminated (MT) short messages, stores undelivered messages for later delivery when subscriber phone is temporary unavailable, and provides short message notification to prepaid subscribers and voicemail subscribers.

      +

       

      +

      The SMSC supports both ITU SS7 and IS-41 protocols. It can be deployed along with the UltraWAVE system or standalone to connect third party device. In a UltraWAVE network, the SMSC is deployed in dual server load sharing mode to assure high efficiency and stability.

      +

       

      +

      Each short message supports up to 160 characters (Latin alphabets) or 70 characters (Chinese or Arabic). The SMS uses signaling channels only. The messages transmit simultaneously with the voice/data/fax service over a GSM network.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •SMSC Parameter Dictionary

       

      +

      •Enable Short Message Service

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      100k subscribers

      +

      200k BHCA

      +

      SM length: 160 English characters or 80 Chinese characters

      +

      SMS

      +

      MO, MT point to point short message

      +

      MO/MT verification

      +

      SMS notification, polling

      +

      Delivery acknowledgement

      +

      Store max. 100k pending short messages (8 per subscriber)

      +

      SMS polling

      +

      Default alphabet (English) and UCS-2 character (Chinese)

      +

      SM notification:

      +

      •Report account balance

      •Notification for new voice mail

      •Notification for low balance or expiry

      •Notification of prepaid services

      SMPP

      +

      Support SMPP v3.4

      +

      32 SMPP links over UDP or TCP

      +

      Number type and number plan manipulation for up to 64 service numbers

      +

      Transmit messages between ESME and SME

      +

      Support Tx, Rx, TRx for each SMPP link

      +

      Support 7 and 8 bit DCS coding for each SMPP link

      +

      Redundancy

      +

      Dual servers load sharing and active redundancy

      +

      License control

      +

      SMSC application flag

      +

      10 to 100k SMSC subscribers at multiples of 100

      +
      +
      +

       

      +

       

      +

      SMSC Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •SM Validity

      Define the maximum duration of a pending message which should be kept in sending array till reaches the called subscriber.  Messages can't send out in the validity period will be deleted. The minimum unit is 1 second.

      +

      1 - 604800 seconds

      +

      •CDR Flag

      Enable or disable the Call Detail Record generation of short messages.

      +

      •ON

      •OFF

      •Log Flag

      Enable or disable the log generation of the short message service.

      +

      •Local Polling Flag

      Enable or disable resend pending SMS to unattainable local subscribers.

      +

      •Enable

      •Disable

      •Local Roaming Out Polling Flag

      Enable or disable resend pending SMS to unattainable outbound roaming subscribers.

      +

      •Local Roaming In Polling Flag

      Enable or disable resend pending SMS to unattainable inbound roaming subscribers.

      +

      •Other Polling Flag

      Enable or disable resend pending SMS to other unattainable subscribers.

      +

      •Polling Number

      Define the maximum port numbers for the pending SMS queue.

      +

      0 - 64

      +

      •SM_RP_PRI Flag

      Specify the priority of the SM_RP_PRI message.

      +

      •Enable = High

      •Disable = Low

      •Enable

      •Disable

      •TP Reply Path Flag

      Specify the TP Reply Path parameter in the SMS-DELIVER data unit.

      +

      •Enable = Reply path is available

      •Disable = Reply path is unavailable

      MSISDN Segment

      +

      The MSISDN range of subscribers that are allowed to use the short message service.

      +

      Max 16 items

      +

      •MSISDN Start

      The start of the MSISDN range.

      +

      Valid E.164 number

      +

      •MSISDN End

      The end of the MSISDN range.

      +

      SMPP

      +

      Specifies the SMPP connections over UDP or TCP.

      +

      Max 32 items

      +

      •Link Alias

      Alias of the SMPP link which corresponds to the link configured in EMS >Configuration >NSS >SMPP.

      +

      --

      +

      •Session Type

      Specify how the local SMPP entity shall bind to the remote SMPP entity.

      +

      •Tx: Work as Transmitter

      •Rx: Work as Receiver

      •TRx: Work as Transceiver

      •Bind_Tx

      •Bind_Rx

      •Bind_TRx

      •Service Number

      Service Center Number, which will display on the terminating mobile.

      +

      Numeric max 16 digits

      +

      •DCS

      Data Coding Scheme.

      +

      •7bit Default 7bit

      •7bit Default 8bit

      •8bit DCS0 Default 7bit

      •8bit DCS4 Default 7bit

      •8bit DCS0 Default 8bit

      •8bit DCS4 Default 8bit

      •Platform ID

      The served MSC platform.

      +

      •Platform 0

      •Platform 1

      •Ignore

      •Time to Live

      Define the maximum duration of a pending message which should be kept in sending array till reaches the called subscriber.  Messages can't send out in the validity period will be deleted.

      +

      1 - 604800 seconds

      +

      •Manipulation Flag

      Enable or disable CLI Manipulation in XAPP setting.

      +

      •Enable

      •Disable

      •TON

      Indicate Type of Number for destination. If not known set to Unknown.

      +

      •Unknown

      •International

      •National

      •Network Specific

      •Subscriber Number

      •Alphanumeric

      •Abbreviated

      •NPI

      Indicate Numbering Plan Indicator for destination. If not known set to Unknown.

      +

      •Unknown

      •ISDN

      •Data

      •Telex

      •Land Mobile

      •National

      •Private

      •ERMES

      •Internet

      •WAP Client ID

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.5

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_6.htm b/wxc2_omc/omcHelp/2_1_1_6.htm new file mode 100755 index 0000000..c9470e0 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_6.htm @@ -0,0 +1,1656 @@ +锘� + + + PPS + + + + + + + + + + + + + + + + + + + + +
      +

      Prepaid System

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      UltraWAVE prepaid system provides solution for the mobile prepaid service. The PPS contains three operational modules: Accounting, Prepaid and Tariff.

      +

       

      +

      The Accounting module is responsible for storing subscriber information. The information stored includes:

      +

      •Service status

      •Account balance and validity

      •Promotion bonus and validity

      •Tariff ID and tariff area ID

      •Charge calculation

      •Tariff query

      •Call duration calculation

      •Recharging subscriber accounts

       

      +

      The Prepaid module stores the information of the recharge cards and processes account recharge. The Tariff module stores the tariff tables and processes tariff queries for each call.

      +

       

      +

      The PPS is also capable of performing the following functions:

      +

      •Subscriber authentication

      •Real time call debiting

      •Dual server load sharing redundancy

      •User data storage, searching and modification

      •Dual server data synchronization, backup and restoration

      •Web page-based provisioning interface

      •User data and recharge card data import

      •Tariff table and multiple rate schedules

      •Multi-lingual audio announcements

       

      +

       

      +

      See Also

      +

       

      +

      •PPS Parameter Dictionary

       

      +

      •Enable Prepaid Service

       

      +

      •Configure USSD

       

      +

      •Configure Tariff

       

      +

      •PPS Subscriber Management

       

      +

      •Enable Cap Call

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      100k subscribers

      +

      200k BHCA

      +

      CAMEL I, II, III

      +

      CAMEL interface (GSM 03.78, GSM 09.78, GSM 129.78)

      +

      Basic Service

      +

      Recharge card management

      +

      Flexible validity resolution

      +

      Respective recharge promotion

      +

      Application scope control on promotion balance        

      +

      Notification SMS for:

      +

      •Recharge

      •Inquiry

      •Transfer balance

      •Credit overdraft

      •Validity expiry

      •Parent and children number management

      •Insufficient balance

      •CAP plan changes

      •GPRS charging

      Customize notification SMS contents

      +

      Call measurements

      +

      PPS CDR

      +

      PPS daily report

      +

      Recharge balance

      +

      •by dialing service number

      •by short message

      •by USSD

      •by credit card (along with credit card service center)

      •from PSTN

      Inquire balance

      +

      •by dialing service number

      •by short message

      •by USSD

      Transfer balance

      +

      •by dialing service number

      •by short message

      •by USSD

      Virtual calling card service

      +

      GPRS charging via RADIUS interface

      +

      •Billing by amount of transferred data (KB)

      Close user group service

      +

      Family and friends number service

      +

      Parent and children number service

      +

      Switchover COS (Free SMS)

      +

      Call me back service

      +

      Tariff

      +

      64 MO tariff tables, per table includes:

      +

      •300 dialing prefix based basic tariffs with tier rating

      •8 rent tariffs

      •50 SMS MO tariffs

      •Supplementary tariffs

      64 MT basic tariff tables

      +

      32 discount tables

      +

      64 billing zones

      +

      Tariff query

      +

      Tariff plan setup

      +

      Tier rating tariff

      +

      Class of service (COS)

      +

      64 COS, each COS contains:

      +

      Tariff plan selection:

      +

      •MO tariff

      •MT tariff

      Tariff subscription:

      +

      •Charge subscriber according to COS ID

      •Charge subscriber according to location

      Service control:

      +

      •Minimum balance to initiate MO call

      •Credit vault control

      •MT call free or not, minimum balance to receive MT call

      •Close user group control

      •Recharge via credit card control

      •Family and friend number control

      •Parent and children number control

      •Free SMS service control

      Account validity control:

      +

      •Maximum account validity

      •Keep or delete balance when account expires

      •How long to keep an expired account

      •Keep or delete the balance of a withdrawn expired account

      •How to adjust the account validity after recharge (overwrite or accumulative)

      •If change account validity when balance is depleted and change to how long

      Notification SMS control:

      +

      •Recharge

      •Inquiry

      •Validity expiry

      •Insufficient balance

      •CAP plan changes

      Call CAP plan:

      +

      •4 CAP plans

      •Each plan has 4 segments

      •Each plan can be configured as SMS/MO call

      Recharge card validity:

      +

      •Set the MO call validity and MT call validity for six types of recharge cards

      Recharge promotion control:

      +

      •Promotion period

      •Promotion bonus of six types of recharge cards

      •Promotion bonus validity

      •Promotion bonus application scope control

      GPRS control:

      +

      •Charge by amount of transferred data

      GPRS CAP plan:

      +

      •4 CAP plans

      •Each plan has 4 segments

      Enhanced Services

      +

      Exclusive service number:

      +

      •Hotline

      •Recharge

      •Inquiry balance

      •Virtual calling card

      •Parent and children number service

      •Transfer balance

      •Call me back

      •Switchover COS (Free SMS)

      SRF interactive voice announcement

      +

      Programmable announcement syntax supporting multi-language

      +

      Flexible currency resolution support multi-currency

      +

      Support high capacity VMS

      +

      Redundancy

      +

      Dual servers load sharing and active redundancy

      +

      License control

      +

      PPS application flag

      +

      10 to 100k PPS subscribers at multiples of 100

      +
      +
      +

       

      +

       

      +

      PPS Parameter Dictionary (Service Control | COS | SRF Services | VMS Routing)

      +

       

      +

      •Service Control

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      Service Control

      +

      --

      +

      --

      +

      •Max License

      (Read Only) The maximum subscriber capacity of PPS determined by License Control.

      +

      --

      +

      •CDR Flag

      Enable or disable the Call Detail Record generation of the prepaid calls.

      +

      •Enable

      •Disable

      •Black-list Threshold

      Mark subscriber in black list and suspend service when the recharge fail times cross this threshold.

      +

      1 - 10

      +

      •Max Balance

      Specify the permitted maximum balance for the prepaid accounts. This value is for overflow prevention. Unit the minimum currency unit.

      +

      100 - 1,000,000

      +

      •Currency Symbol

      Symbol of local currency for short message display, such as $.

      +

      --

      +

      •COS Option

      Select the maximum quantity of COSs supported by PPS.

      +

      •4

      •64

      •MNP Charge Flag

      Enable or disable charging for MNP calls.

      +

      •Enable

      •Disable

      •OPR Account Validity

      Specify the retention period of a fresh OPR account without recharging balance.

      +

      0 - 127 days

      +

      •Language 0-4 SMS Encoding Type

      Specify coding scheme of PPS notification short message for different prompt languages.

      +

      •7-bit

      •8-bit

      •Unicode

      •External RCMS

      Enable or disable external Recharge Card Management System (RCMS) support.

      +

      •Enable

      •Disable

      •Charge By Cell Flag

      It's only available when the prepaid subscribers are charged by location.

      +

      •Enable = Only Cell ID is used to determine Tariff ID.

      •Disable = LAC+Cell ID is used to determine Tariff ID.

      Prompt Resolution

      +

      --

      +

      --

      +

      •Currency Resolution

      Specify the number of decimal place in the PPS notification short message balance display and audio prompt.

      +

      For example, balance=1234:

      +

      1=1234, 10=123.4, 100=12.34

      +

      •1

      •10

      •100

      •Date Format

      Specify date format in PPS notification short message and audio prompt.

      +

      •YYYY-MM-DD

      •MM-DD-YYYY

      •DD-MM-YYYY

      •Currency Symbol Position

      Specify the position of the currency symbol in PPS notification short message.

      +

      •At the front of the balance: $5

      •At the rear of the balance: 5$

      •Front

      •Rear

      MNP Prefix

      +

      --

      +

      Max 32 items

      +

      •Prefix

      Add the MNP related prefixes in this list if the MNP charging is enabled.

      +

      Numeric max 16 digits

      +

      SMS Sentence

      +

      --

      +

      0 - 78

      +

      •Content

      Customize the notification short message contents according to local language manner.

      +

      --

      +

      Third Party Info

      +

      This parameter is a verification for the billing request from a third party device. The billing request contains a service ID and password to pass the verification.

      +

      Max 8 items

      +

      •Service ID

      Service ID in the third party billing request.

      +

      Numeric max 8 digits

      +

      •Service Password

      Service Password in the third party billing request.

      +

      Basic Tariff Zone

      +

      Assign basic tariff to billing zone. The billing zone may be set as a cell, a location area, or whole network.

      +

      Max 64 items

      +

      •MCC

      Mobile Country Code.

      +

      Numeric max 4 digits

      +

      •MNC

      Mobile Network Code.

      +

      •LAC

      Location Area Code.

      +

      LAC = 65535: All location areas in the network use the same basic tariff.

      +

      0 - 65535

      +

      •Cell ID

      Global Cell Identity defined in GSM03.03.

      +

      Cell ID = 65535: All cells in the LAC use the same basic tariff.

      +

      •MO Tariff ID

      Assign MO Tariff ID to the billing zone.

      +

      0 - 63

      +

      •MT Tariff ID

      Assign MT Tariff ID to the billing zone.

      +

      Radius GGSN

      +

      Charging for GPRS or multimedia messaging service.

      +

      Max 64 items

      +

      •NAS IP

      Specify IP address to identify the Network Access Server, which can be gateway GPRS support node or MMS Charging Agent (MCA).

      +

      Dotted decimal format

      +

      •NAS Key

      Specify the cryptographic key used between PPS and the Network Access Server.

      +

      Text string

      +

      •NAS Password

      Specify the password used between PPS and the Network Access Server.

      +

      Radius SGSN

      +

      Parameters take effect when charge type is set to SGSN Location.

      +

      Max 64 items

      +

      •SGSN IP

      Specify IP address to identify the service GPRS support node.

      +

      Dotted decimal format

      +

      •Tariff ID

      Specify a tariff ID to this SGSN.

      +

      0 - 63

      +
      +
      +

       

      +

       

      +

      •Class of Service

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Description

      +

      Range

      +

      Tariff

      +

      --

      +

      --

      +

      •MO Tariff ID

      Select a MO tariff for this COS.

      +

      0 - 63

      +

      •MT Tariff ID

      Select a MT tariff for this COS.

      +

      Tariff Subscription

      +

      --

      +

      --

      +

      •Charge By

      PPS basic tariff may be applied on either area (parameter Basic tariff zone) or subscriber (Tariff ID in subscriber profile) basis. This parameter defines which one is preference when debiting a subscriber.

      +

      •Subscriber Profile

      •Basic Tariff Zone

      Service Control

      +

      --

      +

      --

      +

      > MO Call

      +

      --

      +

      --

      +

      •Threshold

      Enable or disable minimum balance validation for the MO call.

      +

      •Set

      •Not set

      •Minimum Balance

      Specify a minimum balance for MO call. The subscriber whose balance is below this threshold can't make MO call. Unit is the smallest currency unit.

      +

      0 - 65535

      +

      > MT Call

      +

      --

      +

      --

      +

      •Charged Flag

      Enable or disable MT call charge for prepaid subscriber.

      +

      •Charge

      •Not Charge

      •Balance Control

      Enable or disable MT call when balance reaches the following threshold.

      +

      •No Limitation

      •Threshold Used

      •Balance Threshold

      Set threshold for balance control, can be positive or negative. Unit is the smallest currency unit.

      +

      -1,000,000 - 1,000,000

      +

      •MT SMS Charge

      Define the charge for each MT SMS. Unit is the smallest currency unit.

      +

      •0 = Disable MT SMS charge

      0 - 255

      +

      > P&C Number

      +

      Parent and Children number

      +

      --

      +

      •Pool Account Flag

      Enable or disable the parent and children number service.

      +

      •Enable

      •Disable

      •Role

      Specify the pool account status and role of this COS.

      +

      •Normal = the pool account parameters are inactive in this COS.

      •Parent = the parameters for parent are active.

      •Child = the parameters for child are active.

      •Normal

      •Parent

      •Child

      •Charge for Change

      Enable or disable charge for changing child number.

      +

      •Charge

      •Not Charge

      •Free Changes

      Define the free change times of child number if charge is enabled.

      +

      0 - 127

      +

      •Parent Chosen COS A

      Specify two COS for child accounts with different authority levels when the upper Role is set to Parent.

      +

      Choose one of the COSs when add child number.

      +

      0 - 63

      +

      •Parent Chosen COS B

      •Child Transfer Flag

      The following parameters are for child account. They come into effect when the upper Role is set to Child.

      +

      Enable or disable the child account transfer balance privately.

      +

      •Enable

      •Disable

      •Child Credit From

      Specify the mode that the parent account replenishes child accounts.

      +

      •Auto Replenish = Parent account automatically replenishes the child accounts to the Child Max Consumed Credit on a daily basis.

      •Manually Transfer = When the credit in the child account reaches the Child Max Consumed Credit, a short message will be sent to notify his parent to transfer credit manually.

      •Auto Replenish

      •Manually Transfer

      •Child Max Calls per Day

      Specify the limit of calls that the child account can make on a daily basis.

      +

      0 - 1000

      +

      •Child Max SMS per Day

      Specify the limit of short messages that the child account can send on a daily basis.

      +

      •Child Max Consumption

      This parameter is affiliated with the Child Credit From parameter. Unit is the minimum currency unit.

      +

      •For Auto Replenish, it's the ceiling credit.

      •For Manually Transfer, it's the lower credit limit to trigger notification short message.

      0 - 100000

      +

      > Free SMS

      +

      Switchover COS

      +

      --

      +

      •Switch COS

      Specify the index number of the relevant COS which configured particular rent and SMS tariff. The new COS will take effect when the Free SMS service is activated by customer.

      +

      0 - 63

      +

      •Active Days

      Specify the period of validity for the activated free SMS service. At the expiration of this service, the COS will be automatically switched back to the customer original COS. Unit is day.

      +

      Set 255 to prolong validity period indefinitely till the customer deactivates it manually.

      +

      1 - 255

      +

      •Rent Type

      Specify the Rent ID (1-8) in the relevant MO tariff rent table.

      +

      •0 = Rent free

      0 - 8

      +

      > Others

      +

      --

      +

      --

      +

      •CUG Service Flag

      Enable or disable Closed User Group service of this COS.

      +

      •Enable

      •Disable

      •Recharge via Credit Card

      Enable or disable recharge balance by credit card.

      +

      •Support

      •Not Support

      •Credit Vault

      Enable or disable overdraft and define its quota when a COS subscriber makes call with insufficient balance. The system will deduct the overdraft by debiting his account balance at the next recharge.

      +

      •Enable

      •Disable

      •Credit Vault Amount

      The amount of the credit vault. Unit is the minimum currency unit.

      +

      0 - 65535

      +

      •Call Me Back Threshold

      Subscriber is not allowed to apply call me back service when his remaining balance is more than this value. Unit is minimum currency unit.

      +

      •0 = No limitation

      0 - 255

      +

      •Call Me Back Max Times

      The maximum allowable times of call me back service.

      +

      •0 = No limitation

      Account Validity

      +

      --

      +

      --

      +

      > Account Expiration

      +

      --

      +

      --

      +

      •Max Account Validity

      Specify the maximum account validity for prepaid subscriber. Unit is day. The account validity can't be extended by recharging once it reaches this threshold.

      +

      1 - 65535

      +

      •When account expires

      Enable this option to clear balance off an expired account. The balance can't be reused after cleared.

      +

      •Clear Balance

      •Not Clear Balance

      •Expired at

      Account will be expired when reaches the MO or MT expiration date.

      +

      •MO

      •MT

      •Keep expired account for

      Number of days to reserve an expired prepaid account in the system. The expired account will be released if the subscriber doesn't recharge it in this period. After released, the MSISDN of the released account can be reused by other subscribers.

      +

      0 - 65535

      +

      •After that

      Enable this option to clear balance off a released account. The balance can't be reused after cleared.

      +

      •Clear Balance

      •Not Clear Balance

      > Validity Adjustment

      +

      --

      +

      --

      +

      •After recharge, account validity

      Select the period of account validity increment mode after a successful recharge.

      +

      •Accumulate = the period of validity will be accumulated to the recharged account.

      •Replace = If the validity of the recharged money is more than the current account validity, the account validity will be replaced by the validity of recharged money. If the validity of the recharged money is less than the current account validity, the account validity will not be changed after a successful recharge.

      •Accumulate

      •Replace

      •When balance is depleted, account validity

      Enable or disable account validity adjustment when balance reaches zero.

      +

      •Change = Change the validity to the preset period.

      •Not Change = No change on validity.

      •Change

      •Not Change

      •Change validity to

      Preset a validity adjustment period for a zero balance account.

      +

      0 - 128

      +

      •Activation by inquiring

      Enable or disable activate a fresh account by dialing the balance inquiring number.

      +

      •Enable

      •Disable

      •Initial validity of activated account

      Define an initial validity for an account who is activated from fresh status by dialing the inquiry number.

      +

      0 - 1100

      +

      SM Notification & Inquiry

      +

      --

      +

      --

      +

      > SM Notification

      +

      --

      +

      --

      +

      •Successful Recharge

      Enable or disable feedback short message of recharge result.

      +

      •Enable

      •Disable

      •Account Inquiry

      Enable or disable feedback short message of balance inquiry.

      +

      •Expiration

      Enable or disable notification short message sending when an account is going to expire.

      +

      •Days before expiration

      Define the sending days before account expires.

      +

      0-32

      +

      •Insufficient Balance

      Enable or disable notification short message sending when the account's balance is too low.

      +

      •Enable

      •Disable

      •When balance reaches

      Define the low balance level to send notification short message. Unit is the minimum currency unit.

      +

      0 - 65535

      +

      •Clear Balance

      Enable or disable notification short message sending when the balance is cleared from an expired account.

      +

      •Enable

      •Disable

      •CAP Plan Upgrade

      Enable or disable notification short message sending when the predefined CAP threshold is about to grade up.

      +

      •Overdraft Balance

      Enable or disable notification short message sending when the account takes out an overdraft to pay for the charge.

      +

      •Rent Charge

      Enable or disable notification short message sending when rent is charged.

      +

      •F&F Registration

      Enable or disable notification short message sending when Friends and Family Number plan is registered.

      +

      •F&F Suspended

      Enable or disable notification short message sending when Friends and Family Number plan is suspended.

      +

      •F&F Exceed Threshold

      Enable or disable notification short message sending when Friends and Family Number plan exceeded the free voice call duration or free SMS threshold.

      +

      •F&F Removed

      Enable or disable notification short message sending when Friends and Family Number plan is removed.

      +

      > Inquiry by SM

      +

      --

      +

      --

      +

      •Charge Flag

      Enable or disable charge for inquiry short message.

      +

      •Charge

      •Not Charge

      •Free Inquiry per Day

      Define the quantity of free inquiry short messages on a daily basis if charge flag is enabled.

      +

      0 - 128

      +

      Recharge Card Validity

      +

      Set validity of MO and MT calls for 6 face value recharge cards.

      +

      Max 6 items

      +

      •Face Value

      Recharge card face value. Unit is the basic currency unit.

      +

      0 - 65535

      +

      •MO Validity

      Account validity. This validity will be added to the account validity after a successful recharge.

      +

      0 - 65535

      +

      •MT Validity

      Legal MT period. Subscriber can make MT call in this period. Normally the legal MT period is longer than the account validity.

      +

      Recharge Promotion

      +

      Promotion bonus is the extra credit that a subscriber will get when he recharges his account in the promotion period. The amount of the bonus is determined by the recharge card credit. Operator may set the bonus for six types of recharge card of each COS. Generally the recharge card with higher credit is awarded more bonus.

      +

      Please note that the promotion bonus is only applicable for paying call charging. It can't be used to pay the rental fee. (e.g. monthly rental). In addition, the bonus will always be deducted prior to the recharge card credit.

      +

      Max 6 items

      +

      •Start Date

      The promotion period is the period of time in which the recharge promotion is valid. Operator defines the promotion period by specifying the start and end date. Each COS may have its own promotion period. Subscriber recharges his account within the promotion period of his COS will receive a promotion bonus.

      +

      yyyymmdd

      +

      •End Date

      •Face Value

      The face value of the chosen recharge card. Unit is the basic currency unit.

      +

      0 - 65535

      +

      •Promotion Bonus

      The amount of the bonus binding with the specific recharge card.

      +

      •Bonus Validity

      Promotion bonus validity is the period of time that the bonus is valid. Bonus over the validity period will be obsolete and deleted from account. That means the subscriber must consume his entire promotion bonus within the time frame set by the operator.

      +

      0 - 65535

      +

      Promotion Application Scopes

      +

      --

      +

      --

      +

      •IDD MO Call

      Specify whether the promotion bonus can be used to pay for international MO call.

      +

      •Allowed

      •Not Allowed

      •IDD MO SMS

      Specify whether the promotion bonus can be used to pay for international MO short message.

      +

      •NDD MO Call

      Specify whether the promotion bonus can be used to pay for national MO call.

      +

      •NDD MO SMS

      Specify whether the promotion bonus can be used to pay for national MO short message.

      +

      •Local MO Call

      Specify whether the promotion bonus can be used to pay for local MO call.

      +

      •Local MO SMS

      Specify whether the promotion bonus can be used to pay for local MO short message.

      +

      •GPRS

      Specify whether the promotion bonus can be used to pay for GPRS applications.

      +

      •Transfer

      Specify whether the promotion bonus can be transferred to other accounts.

      +

      •Transfer Priority

      If the promotion bonus can be transferred to other accounts, specify which has priority between bonus and balance.

      +

      •Inferior to Balance

      •Superior to Balance

      Call CAP Plan

      +

      --

      +

      Max 4 items

      +

      •Reset Date

      All PPS subscribers' capped call and GPRS accumulation data will be cleared on the monthly date.

      +

      1 - 28

      +

      •Flag

      Disable or select the cap call function mode for the specified CAP Plan.

      +

      •Disable

      •Call Only

      •SM Only

      •Call and SM

      •Type

      There are two types of CAP Call measurements adopted in the market:

      +

      •By amount = Accumulated call duration or accumulated number of SM.

      •By charge = Accumulated call charge or accumulated SM charge.

      •By Amount

      •By Charge

      •Threshold

      Define the three triggers to activate the tariff for the next CAP segment. Definition in the basic count unit of time or balance.

      +

      --

      +

      •Tariff ID

      Specify the four tariff IDs to the CAP segments.

      +

      0 - 63

      +

      GPRS Service Control

      +

      --

      +

      --

      +

      •Charge Flag

      Enable or disable charge for GPRS service.

      +

      •Enable

      •Disable

      •Minimum Balance

      Specify a minimum balance for GPRS service. The subscriber whose balance is below this threshold can't apply GPRS service. Unit is the minimum currency unit.

      +

      0 means no balance limitation.

      +

      0 - 65535

      +

      •Inactive Session Limit

      Specify a timer to avoid seizing GPRS link in inactivity state for a long time. When the timer reaches 0, the system will disconnect the GPRS session.

      +

      0 means no limitation.

      +

      0 - 36,000 seconds

      +

      •Notification SMS Flag

      Enable or disable send notification SMS after a GPRS session to inform user the data amount and charge.

      +

      •Enable

      •Disable

      •Max Notification SMS per Day

      Set the maximum number of GPRS notification SMS allowed per day.

      +

      1 - 1,000

      +

      •Max Volume Quota Each Time

      Specify data quota allocation for GPRS session per each GGSN request. Unit is KB.

      +

      1 - 1,024,000

      +

      •Volume Threshold Diff

      When the remaining data amount reaches to this value, the GGSN will initiate a new request to ask for another data quota allocation. Unit is KB.

      +

      1 - 102,400

      +

      •Max Duration Quota Each Time

      Specify duration quota allocation for GPRS session per each GGSN request. Unit is Second.

      +

      60 - 6,000

      +

      •Duration Threshold Diff

      When the remaining duration reaches to this value, the GGSN will initiate a new request to ask for another data quota allocation. Unit is Second.

      +

      30 - 90

      +

      •Charge By

      Specify the way to charge GPRS service.

      +

      •By COS = Charge by the tariff set in this COS.

      •By SGSN Location = Charge by the tariff set in the RADIUS SGSN table.

      •By COS

      •By SGSN Location

      GPRS CAP Plan

      +

      --

      +

      --

      +

      •Type

      There are two types of CAP GPRS measurements adopted in the market:

      +

      •By volume = Accumulated data amount (KB)

      •By charge = Accumulated service charge.

      •Volume

      •Charge

      •Threshold

      Define the three CAP trigger points to activate the new tariff of the next CAP segment.

      +

      The CAP counting unit is in data amount (KB) if the tariff charging unit is volume and the CAP counting unit is minimum currency unit if the charge type is charge.

      +

      --

      +

      •Tariff ID

      Specify the four tariff IDs to the CAP segments.

      +

      0 - 63

      +

      F&F Number

      +

      Friends and Family Number

      +

      --

      +

      •Flag

      Enable or disable Friends and Family number service of this COS.

      +

      •Enable

      •Disable

      •Charge for Change

      Enable or disable charge for changing friends and family number.

      +

      •Charge

      •Not Charge

      •Free Changes

      Define the free change times of F&F number if charge is enabled.

      +

      0 - 36,000

      +

      •Local Number

      Enable or disable F&F number register to local number.

      +

      •Enable

      •Disable

      •NDD Number

      Enable or disable F&F number register to national number.

      +

      •IDD Number

      Enable or disable F&F number register to international number.

      +

      •Min Balance to Call F&F Number

      Define the minimum balance threshold to call F&F number.

      +

      0 - 65535

      +

      •F&F Number Reservation Flag

      Keep or remove registered F&F number list of prepaid accounts on a monthly basis.

      +

      •Keep

      •Remove

      •Min Balance for F&F Number Reservation

      It is associated with the upper parameter. Define the minimum balance threshold which allows to keep F&F number list.

      +

      0 - 65535

      +

      > F&F Number Plan 1 - 6

      +

      Define up to 6 F&F Number Plan

      +

      Max 6 items

      +

      •Registration Fee

      Registration fee for the first time F&F Number Plan activation.

      +

      0 - 65535

      +

      •Max Members

      Specify the allowable maximum F&F members per prepaid account.

      +

      0 - 5

      +

      •Free Call Duration

      Define free call duration for F&F Number service on a monthly basis. Unit is Minute.

      +

      0 - 20,000

      +

      •Free SMS

      Define quantity of free SMS for F&F Number service on a monthly basis.

      +

      0 - 60,000

      +

      •Rent ID

      Specify the Rent ID for the F&F Number service registration fee.

      +

      0 - 8

      +
      +
      +

       

      +

       

      +

      •SRF Service

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Description

      +

      Range

      +

      IVR Source

      +

      --

      +

      --

      +

      •Inquiry

      Specify the Interactive Voice Response source for inquiry prompt.

      +

      •Local SRF

      •External IVR

      •Recharge

      Specify the Interactive Voice Response source for recharge prompt.

      +

      SRF Number

      +

      --

      +

      --

      +

      •SRF 0 Number

      The E.164 node address of the SRF 0.

      +

      Valid E.164 number

      +

      •SRF 1 Number

      The E.164 node address of the SRF 1.

      +

      Service Number

      +

      Define dedicated shortcut number for prepaid services.

      +

      --

      +

      •Hotline

      PPS service center number. Subscribers dial this number to recharge, inquire their account and modify favorite numbers.

      +

      Numeric max 16 digits

      +

      •Inquiry

      Dedicated shortcut number for account (balance and validity) inquiry.

      +

      •Recharge via Recharge Card

      Dedicated shortcut number for recharge via scratch card.

      +

       

      +

      •Recharge via Credit Card

      Dedicated shortcut number for recharge via credit card.

      +

      •Third Party Recharge

      Dedicated shortcut number for recharging subscriber's account from other MS or PSTN.

      +

      •Customer Care Center

      Dedicated shortcut number to contact customer care center.

      +

      •Recharge Number

      Dedicated shortcut number for recharge via scratch card or credit card.

      +

      •OPR Register Number

      Dedicated shortcut number for OPR service registration.

      +

      •Virtual Calling Card Number

      Dedicated shortcut number to use virtual calling card service.

      +

      •iPALIM Register Number

      Dedicated shortcut number for iPALIM service registration.

      +

      •Pool Account

      Dedicated shortcut number for Parent and Children number service register and inquiry.

      +

      •Balance Transfer

      Dedicated shortcut number to transfer balance to other prepaid account.

      +

      •Free SMS

      Dedicated shortcut number to activate or deactivate free SMS service.

      +

      •Call Me Back

      Dedicated shortcut number to activate call me back service.

      +

      •GPRS Notification

      This number will displayed in GPRS notification short message as the caller number.

      +

      •Tell Me My Number

      Dedicated shortcut number to inquire the MSISDN of the current prepaid account.

      +

      Service Key

      +

      Define dedicated function key to select service after dialing in the hotline. It should be in accordance with the recorded announcement.

      +

      --

      +

      •Help

      Define dedicated key to play help prompt.

      +

      0 - 9

      +

      •Inquiry

      Define dedicated key to inquire account balance and validity.

      +

      •Recharge via Recharge Card

      Define dedicated key to recharge account via scratch card.

      +

      •Recharge via Credit Card

      Define dedicated key to recharge account via credit card.

      +

      •Set Favorite Number

      Define dedicated key to set favorite number.

      +

      •Select Language

      Define dedicated key to select prompt language.

      +

      •Set Password

      Define the key to set account password. When recharging account, selecting language, modifying favorite number or changing password, subscriber is asked to enter the password.

      +

      USSD Service Number

      +

      Define dedicated USSD service code for prepaid service.

      +

      --

      +

      •Hotline

      Subscribers dial this USSD service code to access main menu to recharge, inquire their account and modify favorite numbers.

      +

      Numeric max 4 digits

      +

      •Inquiry

      Dedicated USSD service code for account balance and validity inquiry.

      +

      •Recharge

      Dedicated USSD service code for account recharge.

      +

      •Balance Transfer

      Dedicated USSD service code for balance transfer.

      +

      •Call Me Back

      Dedicated USSD service code for call me back service registration.

      +

      •Tell Me My Number

      Dedicated USSD service code for current MSISDN inquiry.

      +

      •F&F Number Plan Inquiry

      Dedicated USSD service code for current F&F number plan inquiry.

      +

      USSD Service Key

      +

      Define dedicated key to select service after accessed USSD hotline menu.

      +

      --

      +

      •Exit

      Define dedicated key to exit the USSD hotline menu.

      +

      0 - 9

      +

      •Inquiry

      Define dedicated key to inquire account balance and validity.

      +

      •Recharge

      Define dedicated key to recharge account.

      +

      •Balance Transfer

      Define dedicated key to transfer balance to other accounts.

      +

      •Call Me Back

      Define dedicated key to apply call me back service.

      +

      •Tell Me My Number

      Define dedicated key to inquire the current MSISDN.

      +

      •F&F Number Plan Inquiry

      Define dedicated key to inquire the current F&F number plan.

      +
      +
      +

       

      +

       

      +

      •VMS Routing

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Description

      +

      Range

      +

      Call Routing to VMS

      +

      --

      +

      Max 10 items

      +

      •Service Number (PLMN)

      Subscriber dials this service number by handset to enter and maintain his mailbox or leave message to other subscribers.

      +

      Numeric max 16 digits

      +

      •Service Number (PSTN)

      Subscriber dials this service number from PSTN to enter and maintain his mailbox or leave message to other subscribers following the system prompt.

      +

      •Leave Message Number

      Dedicated service number for leaving message. User uses either handset or PSTN telephone to call this number to leave message to system subscribers.

      +

      •Route Method

      Define the routing type for the above VMS service number.

      +

      •Default = Dialling Number.

      •Dialling Number Prefix

      •Dialling Number

      •Route Number

      Define which number to route for the following VMS User Segments.

      +

      •Default = Caller Number

      •Caller Number

      •Called Number

      •Postpaid Flag

      Enable or disable voice mail service for postpaid subscribers.

      +

       

      +

      •Ringback Service Key

      Define a dedicated hot key to ring back the caller.

      +

       

      +

      VMS User Segments

      +

      The MSISDN range of subscribers that are allowed to use the voice mail service.

      +

      Max 128 items

      +

      •Start MSISDN

      The start of the MSISDN range.

      +

      Valid E.164 number

      +

      •End MSISDN

      The end of the MSISDN range.

      +

      •Service Number (PLMN)

      Specify internal service numbers to route the caller to host VMS.

      +

      Numeric max 16 digits

      +

      •Service Number (PSTN)

      •Leave Message Number

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.6

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_7.htm b/wxc2_omc/omcHelp/2_1_1_7.htm new file mode 100755 index 0000000..61a02bb --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_7.htm @@ -0,0 +1,174 @@ +锘� + + + EIR + + + + + + + + + + + + + + + + + + + + +
      +

      Equipment Identity Register

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The optional EIR is a database that contains information on the identity of mobile equipment to prevent calls from stolen, unauthorized or defective mobile stations. Each mobile station is uniquely identified by its IMEI (International Mobile  Equipment Identity), and it is this identity which may be checked against the EIR to check the validity of the handset. A white list number is a legal IMEI that can pass the EIR verification.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •Enable Equipment Identity Register

       

      +

      •EIR Subscriber Management

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      100k grey/black list

      +

      1024 15-digit number segments of white list

      +

      Provisioning

      +

      Automatic provisioning from IMEI file

      +

      IMEI verification

      +

      IMEI verification for register and call request

      +

      Load sharing

      +

      Dual servers load sharing and active redundancy

      +

      License control

      +

      EIR application flag

      +

      10 to 100k EIR subscribers at multiples of 100

      +
      +
      +

       

      +

       

      +

      EIR Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •Max License

      (Read Only) The maximum subscriber capacity of EIR determined by License Control.

      +

      0 - 100,000

      +

      •Used License

      (Read Only) The number of registered EIR subscribers.

      +

      •Software Version

      (Read Only) EIR software version.

      +

      x.y.x

      +

      •Data Version

      (Read Only) Version of EIR subscriber data structure.

      +

      White-list Segments

      +

      A white-list number is a legal IMEI that can pass the EIR verification. This parameter is used to specify up to 1024 groups of consecutive white-list IMEIs.

      +

      Max 1024 items

      +

      •Start IMEI

      A 16-digit IMEI comprises four parts:

      +

      •TAC = 6 digits (Type Approval Code)

      •FAC = 2 digits (Final Assembly Code)

      •SNR = 6 digits (Serial Number)

      •SVN = 2 digits (Software Version Number)

      Numeric 16 digits

      +

      •End IMEI

      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.7

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_8.htm b/wxc2_omc/omcHelp/2_1_1_8.htm new file mode 100755 index 0000000..b491f23 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_8.htm @@ -0,0 +1,439 @@ +锘� + + + SMEG + + + + + + + + + + + + + + + + + + + + +
      +

      SMS Email Gateway

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The UltraWAVE SMS Email Gateway (SMEG) is a software application that provides bi-directional SMS to email support, allowing email messages to be sent to SMS recipients, and vice versa. The SMEG software may reside in the UW EMS Server or run on a standalone server.

      +

       

      +

      The SMEG relays short messages and internet email messages between the UltraWAVE Short Message Center (SMSC) and the host email server. It links to the host email server and short message center via SMTP and SMPP respectively. UW Gateway routes email messages and short messages between them with appropriate format conversion.

      +

       

      +

      The basic functions of the SMEG include:

      +

       

      +

       

      +
      + + + +

      To send an SMS message to an email recipient, the user includes the email address of the intended recipient as the beginning text of the MO SMS message in the following format:

      +

       

      +
      + + + + + + + + + + +

      1

      +

      Without subject:

      +

      [<to-address><space>]<Message>

      +

      2

      +

      With subject:

      +

      [<to-address><space>](subject)<message>

      +
      +
      +

       

      +

      * The [ ] denote optional fields and < > delimit fields

      +

       

      +

      Examples:

      +

       

      +
      + + + + + + + + + + +

      1

      +

      Without subject:

      +

      Short message "john@gateway.com This is a test message." will be sent to email recipient john@gateway.com with empty email subject and text contents "This is a test message."

      +

      2

      +

      With subject:

      +

      Short message "john@gateway.com (Test the UW Gateway)This is a test message." will be sent to email recipient john@gateway.com with the email subject "Test the UW Gateway" and text contents "This is a test message."

      +
      +
      +

       

      +
      +
      +

       

      +
      + + + +

      To send an SMS message to multiple email recipients, the user may include multiple email addresses beginning address field of the MO SMS message. Multiple addresses may be identified in MO SMS message by separating each address by a comma in the following format:

      +

       

      +
      + + + + + + + + + + +

      1

      +

      Without subject:

      +

      [<address1,address2,address3><space>]<Message>

      +

      2

      +

      With subject:

      +

      [<address1,address2,address3><space>](subject)<message>

      +
      +
      +

       

      +
      +
      +

       

      +
      + + + +

      When an SMS recipient receives an e-mail message via SMS, the received short message will appear in the following format:

      +

       

      +
      + + + + + + + + + + +

      1

      +

      Without subject:

      +

      [<from-address><space>]<Message>

      +

      2

      +

      With subject:

      +

      [<from-address><space>](subject)<message>

      +
      +
      +

       

      +

      Examples:

      +
      + + + + + + + + + + + + + + + + + +

      Email

      +

      Sender:

      +

      john@gateway.com

      +

      Subject:

      +

      Test the UW Gateway

      +

      Contents:

      +

      This is a test message.

      +

      SMS received

      +

      john@gateway.com (Test the UW Gateway)This is a test message.

      +
      +
      +

       

      +
      +
      +

       

      +
      + + + +

      To reply to an email message, the SMS recipient must include the email sender鈥檚 address in the reply message to inform the UW Gateway where the message should be replied to for the UW Gateway to direct the message to the correct email recipient.

      +

       

      +
      +
      +

       

      +
      + + + +

      In order to avoid the SMS or email messages losing when the Gateway is down, the SMEG is designed to work in a master-slave mode. A critical alarm will be sent to the UW EMS to notify the operator when the master server is suspending. Then the slave server can be manually shifted to master to take over the SMPP and SMTP links.

      +

       

      +

      Telnet the slave server and follow the procedures described as below to do the shift:

      +

       

      +
      + + + +

      login: www

      +

      Password for www: 123456

      +

      [www@omc-0 ~]$ su -

      +

      Password:

      +

      //Enter the root password

      +

      [root@omc-0 ~]# cd /usr/local/omc/bin/

      +

      [root@omc-0 bin]# ./setRunMode

      +

      //Run the Mode Selection script

      +

      This is Slave server!!

      +

      +-------------------------+

      +

      | 1.Single OMC            |

      +

      | 2.Dual OMC              |

      +

      +-------------------------+

      +

      Please select OMC run mode:1

      +

      //Enter 1 to activate the SMEG process

      +

      [root@omc-0 ~]#

      +
      +
      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •SMEG Parameter Dictionary

       

      +

      •Configure SMS Email Gateway

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      50k BHSM

      +

      Interfaces

      +

      SMPP over TCP to SMSC

      +

      SMTP to host email server

      +

      SNMP to EMS

      +

      SMS to Email Service

      +

      Convert text messages received from SMSC in pre-defined format into email format and then forwards it to the email recipients through the host email server.

      +

      Email to SMS Service

      +

      Convert emails from the email server into text message and then forward it to the SMS recipients through the SMSC.

      +

      License Control

      +

      Application flag

      +

      0 to 50k at 1k BHSM

      +
      +
      +

       

      +

       

      +

      SMEG Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •License

      (Read Only) The maximum BHSM capacity of SMEG determined by License Control. SMEG will stop transiting SMS once the traffic reaches the maximum BHSM.

      +

      0 - 50K

      +

      •CC

      Country Code identifies the country's network.

      +

      Numeric max 4 digits

      +

      •NDC

      National Destination Code defines the national calling area or national network to which the subscriber belongs.

      +

      Numeric max 6 digits

      +

      •Max SMS per Email

      Define the maximum number of SMS can be concatenated per long email.

      +

      0 - 10

      +

      •Local Domain Name

      This name is the domain-part after the @ sign in the email address. This email address is used to transfer emails from email server to SMEG. Normally, it is the SMEG's host name.

      +

      --

      +

      •Domain Name for Email

      The domain name of email server is the domain-part after the @ sign in the email address. This email address is used to communicate emails between external email servers and the email server which connected with SMEG. It is the domain name which can be looked up in the public Domain Name System.

      +

      --

      +

      •Flag

      Enable or disable SMEG service.

      +

      •Enable

      •Disable

      Protocol

      +

      --

      +

      --

      +

      •SMPP Link Alias

      Alias of the SMPP link which corresponds to the link configured in EMS >Configuration >NSS >SMPP.

      +

      --

      +

      •SMTP Email Server IP

      The IP address of the email server.

      +

      Dotted decimal format

      +

      •SMTP Authentication Flag

      SMTP Authentication provides an access control mechanism. It is used to allow legitimate users to relay mail while denying relay service to unauthorized users, such as spammers. Configure the authentication parameters when it is enabled on the email server side.

      +

      •Enable

      •Disable

      •SMTP Authentication User

      User name for SMTP Authentication.

      +

      --

      +

      •SMTP Authentication Password

      Password for SMTP Authentication.

      +

      Numeric max 16 digits

      +

      Allowed User Prefix

      +

      --

      +

      Max 16 items

      +

      •Prefix

      Support up to 16 prefixes which determine the ranges of subscribers allowed to receive email messages.

      +

      Numeric max 16 digits

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.8

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_1_1_9.htm b/wxc2_omc/omcHelp/2_1_1_9.htm new file mode 100755 index 0000000..3652848 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_9.htm @@ -0,0 +1,372 @@ +锘� + + + OPPS + + + + + + + + + + + + + + + + + + + + +
      +

      Open-Prepaid-Roaming Public-Private System

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The UltraWAVE Open-Prepaid-Roaming Public-Private System (OPPS) is a combination of two systems:

      +

       

      +

      •Intelligent MAP-D Multiplexer System (IMDX)

       

      +

      The IMDX System enables the R9 System to provide 鈥減rivate鈥� communication services. The IMDX provides private, hybrid and public user services to the GSM subscribers. Operator may restrict private users to make/receive calls to/from private users only and public users to make/receive calls to/from public users only; while Hybrid users can make/receive calls from both private and public users. IMDX allows the operator to use the existing R9 System to provide GSM services to employee users as a private communication tool for their daily works.

      +

       

      +

      •Open-to-all Prepaid Roaming System (OPR)

       

      +

      The OPR System enables the existing UltraWAVE Prepaid System to provide temporary services to any visiting GSM users; even they are from PLMN without local roaming agreement in place. The OPR doesn鈥檛 require GSM visitors to change their SIM cards. OPR provides prepaid services to the visitors with their home SIM cards.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •OPPS Parameter Dictionary

       

      +

      •Enable Intelligent MAP-D Multiplexer (IMDX) Service

       

      +

      •Enable Open-to-all Prepaid Roaming (OPR) Service

       

      +

      •OPPS Subscriber Management

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Basic Feature

      +

      Descriptions

      +

      Capacity

      +

      100k subscribers (OPR+IMDX)

      +

      OPPS shares HLR capacity. Non-OPPS subscribers + OPPS subscribers must be less than or equal to 100k.

      +

      Interface

      +

      SNMP to EMS

      +

      Redundancy

      +

      Dual servers load sharing and active redundancy

      +

      License Control

      +

      IMDX license - turn on IMDX service

      +

      OPR license - turn on OPR service

      +

      10 to 100k OPPS subscribers at multiples of 100

      +

      IMDX Feature

      +

      Descriptions

      +

      User Type

      +

      Private, Public, Hybrid

      +

      Call Control

      +

      Private to Private call

      +

      Hybrid to Private call

      +

      Hybrid to Public call

      +

      Public to Public call

      +

      Supplementary Service

      +

      Call forwarding:

      +

      •Call forward unconditional (CFU)

      •Call forward on busy (CFB)

      •Call forward on not reply (CFNRy)

      •Call forward on not reachable (CFNRc)

      Call hold

      +

      Call waiting

      +

      Call barring / Operator determined barring

      +

      Premium call (private user only)

      +

      Notification of call barring

      +

      Password control (private user only)

      +

      Calling line identification presentation (CLIP)

      +

      Calling line identification restriction (CLIR)

      +

      Connected line identification presentation (COLP)

      +

      Connected line identification restriction (COLR)

      +

      Explicit call transfer

      +

      Operator specific barring (OSB) (private user only)

      +

      NOTE: Hybrid users鈥� supplementary services are set up by the operator and aren鈥檛 user alterable.

      +

      Enhanced Service

      +

      Short message

      +

      Exclusive access option

      +

      OPR Feature

      +

      Descriptions

      +

      Registration Management

      +

      Automatic registration

      +

      Manual registration

      +

      Welcome short message with customized contents

      +

      Auto-cleanup subscriber database

      +

      Call Control

      +

      Prepaid calls

      +

      Prepaid recharge, inquiry

      +

      Supplementary Service

      +

      Call forwarding:

      +

      •Call forward unconditional (CFU)

      •Call forward on busy (CFB)

      •Call forward on not reply (CFNRy)

      •Call forward on not reachable (CFNRc)

      Call hold

      +

      Call waiting

      +

      Call barring / Operator determined barring

      +

      Premium call

      +

      Notification of call barring

      +

      Password control

      +

      Calling line identification presentation (CLIP)

      +

      Calling line identification restriction (CLIR)

      +

      Connected line identification presentation (COLP)

      +

      Connected line identification restriction (COLR)

      +

      Explicit call transfer

      +

      Operator specific barring (OSB)

      +

      Enhanced Service

      +

      Short message

      +

      Virtual calling card

      +
      +
      +

       

      +

       

      +

      OPPS Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •License

      (Read Only) The maximum subscriber capacity of OPPS determined by License Control.

      +

      0 - 100,000

      +

      •OPR Status

      (Read Only) The current status of OPR service which determined by License Control.

      +

      •Enable

      •Disable

      •IMDX Status

      (Read Only) The current status of IMDX service which determined by License Control.

      +

      •CDR Flag

      Enable or disable OPPS CDR generation.

      +

      •Enable

      •Disable

      •Replace Option

      Enable or disable overwrite the existing subscriber data when create a subscriber with the same MSISDN.

      +

      OPR

      +

      --

      +

      --

      +

      > OPR

      +

      --

      +

      --

      +

      •COS ID

      Specify a COS to the OPR applications for charging purpose.

      +

      0 - 63

      +

      •Auto-Registration Option

      Enable or disable auto-registration function to the OPR subscribers from the PLMN without roaming agreement.

      +

      •Enable

      •Disable

      •Auto-Cleanup Threshold

      The OPPS will send a warning alarm and clean up database by deleting the trial accounts when the OPR license utilization level reaches this threshold.

      +

      0.50 - 0.99

      +

      •Welcome SMS

      Customize the text format in a welcome short message. It is sent to the user when he successfully registered to the OPR service and informs him his local phone number and PIN.

      +

      --

      +

      •PLMN List Option

      Allow or reject the mobile subscribers from the specific PLMNs to register to the local network.

      +

      •Allow = The following PLMN list is a white-list.

      •Bar = The following PLMN list is a black-list.

      •Allow

      •Bar

      > PLMN List

      +

      Registration administration of roaming subscribers.

      +

      Max 32 items

      +

      •MCC + MNC

      Specify up to 32 PLMNs by entering its MCC and MNC.

      +

      MCC+MNC

      +

      IMDX

      +

      --

      +

      --

      +

      > IMDX

      +

      --

      +

      --

      +

      •Exclusive Level

      Exclusive access provides solutions to restrict the IMDX registration from a predefined range of users:

      +

      •Normal: Full IMDX functions.

      •Exclusive Half: Prohibit the public (roaming) users from registration.

      •Exclusive Full: Prohibit both public (roaming) and hybrid users from registration.

      •Shutdown: Shutdown IMDX. Forbid all users from registration.

      •Normal

      •Exclusive Half

      •Exclusive Full

      •Shutdown

      •Exclusive Rejection Cause

      In the exclusive access mode, the network sends a Location Area Updating Reject message to MS to indicate the cause of rejection:

      +

      •PLMN not allowed = The PLMN is added to a "Forbidden PLMN list" stored in the SIM card to prevent MS from any further attempt to register in the PLMN.

      •LA not allowed = The MS does not attempt registering in the PLMN, unless the user changes location area.

      •Roaming not allowed in this LA = The selected location area does not accept visitors from another PLMN.

      •PLMN not allowed

      •LA not allowed

      •Roaming not allowed in this LA

      > Private Dialing Prefix

      +

      Reserve the number range for IMDX users by specifying the number prefix and attribute. Originating call with such dialing prefixes will be treated as private calls.

      +

      Max 16 items

      +

      •Attribution

      Specify number plan of the the incoming private calls.

      +

      •80 = Unknown

      •81 = National number

      •91 = International number

      Numeric 2 digits

      +

      •Prefix

      Specify prefixes of the incoming private calls.

      +

      Numeric max 16 digits

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.9

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_1_9_1.htm b/wxc2_omc/omcHelp/2_1_1_9_1.htm new file mode 100755 index 0000000..0e96b30 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_9_1.htm @@ -0,0 +1,184 @@ +锘� + + + IMDX + + + + + + + + + + + + + + + + + + + + +
      +

      Intelligent MAP-D Multiplexer System

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      When network operators extend their GSM networks to remote spots with satellite back haul, the data bandwidth between the local network and the public network is narrow and costly. The data link between the remote network and the public network becomes precious. Hence, the cost of local calls that don鈥檛 need to go through the expensive back haul is much cheaper than the public network calls. If the network operators can control the public network access privilege of the users then they may reduce the constraint of the traffic on the back haul bottleneck for a better utilization of their networks鈥� capacity.

      +

       

      +

      Intelligent MAP-D Multiplexer enables GSM network operators to categorize their subscribers into three different groups with different network accessibility: 鈥淧ublic Users鈥�, 鈥淧rivate Users鈥� and 鈥淗ybrid Users鈥�.

      +

       

      +

       

      +
      + + + +

      User with subscription profile presents in HLR but do not have IMDX account in OPPS. Public user鈥檚 subscription profile may be present in public network鈥檚 HLR or local network鈥檚 HLR. Public user registers to the local network as a local GSM subscriber (with subscription profile in local HLR) or a roaming GSM subscriber (with subscription profile in public HLR). Public user can only call public users.

      +

       

      +
      +
      +

       

      +
      + + + +

      User with subscription profile present in local network鈥檚 HLR and is being classified as 鈥減rivate user鈥� in IMDX. Private users have two classes of privilege: ordinary and premium. Ordinary privilege can make calls among private users, but it is not allowed to make calls to public users (local or roaming GSM subscribers); Premium privilege is allowed to make calls to both private and public users. Please note that the private users are not accessible by public users.

      +

      There is an exception to this rule. If a private called party set call forward to a public user, then the private calling party can reach the forwarded public user.

      +

       

      +
      +
      +

       

      +
      + + + +

      User with two subscription profiles: one in the public network鈥檚 HLR and another in the local network鈥檚 HLR. Hybrid user has dual identities: public user and private user; and two MSISDNs: public phone number and private phone number. Hybrid user owns both the privileges of the public user and private user. He can access to and be accessible from both the public network and the local network. Hybrid user acts as a public user when being called by his public MSISDN or is calling a public MSISDN. He will act as a private user if he is being called by his local private MSISDN or calling the other private MSISDN.

      +

       

      +
      +
      +

       

      +
      + + + +

      When a user tries to location update (register) to the local network, the VLR will check the user type of the user through the OPPS and then choose the proper registration process according to his user type.

      +

      Public users鈥� registration process is same as the standard GSM registration. If the public user is a local subscriber then the VLR collects his subscription profile from the local HLR. If the public user is a roaming subscriber then the VLR will collect his subscription profile from the HLR of his Home PLMN. VLR will store the profiles collected from the HLR in its database.

      +

      When private users try to register to the local network, VLR will replace the IMSI prefix (MCC+MNC) of the private user with the IMDX Pseudo Prefix to route the location update request to the local HLR. VLR then collect the subscription profile of the private user from the local HLR and save the profile in the VLR to complete the registration. Private user will get a private phone number (MSISDN), which is set by the network operator in the subscription profile in the local HLR.

      +

      Hybrid user has two subscription profiles, one in the public HLR and one in the local HLR. When a hybrid user registers to local network, VLR will perform twice Location Updates: one to the public HLR as a public user and the other to local HLR as a private user. The registration process is same as the public user and the private user respectively. VLR keeps the two subscription profiles for each hybrid user.

      +

       

      +
      +
      +

       

      +
      + + + +

      IMDX control the call traffic among the Private, Hybrid and Public users.

      +

      Private ordinary users can only call the private numbers defined in the Private Dialing Prefix table. The private number can be configured as short number format. Hence private ordinary users can only make calls among private users. They鈥檙e not allowed to make calls to public network and public users. Private numbers are not accessible by the public network; hence public users can鈥檛 call private users.

      +

      Private premium users have the premium privilege to make outgoing calls to both private and public users. Since private premium users are allowed to call public numbers, the operator may need to control the public call time of a private premium user. In this case the operator may set the private premium user as prepaid user. Then the private premium user鈥檚 public call time will be restricted by the tariff of the public calls and his budget.

      +

      Hybrid users have dual identities. They have the privileges of the private users and the public users. Hybrid users are allowed to call both the private users and the public users and they鈥檙e also reachable by the private users and the public users. When a hybrid user is being called or calling a private user then he is treated as a private user. If he is being called or calling a public user then he will be treated as a public user.

      +

       

      +
      +
      +

       

      +
      + + + +

      The fundamental criterion of deploying the IMDX service is that the local network is not overlapping with the public network; a spot without overlapping radio coverage. Whenever a spot is covered by the public network then the roaming users and the hybrid users must register to their home network (public network). Hence IMDX must prohibit the roaming users and hybrid users from registering to the local network once the service spot is entering the public network regions, such as a cruise ship docking to a terminal. This requires the local network to prevent all the roaming users and public identity of hybrid users from roaming to the local network. The local network has to reject any location updates or MO attempts from roaming and hybrid users.

      +

      Sometimes due to the license issues, cruise ships operators are restricted to provide GSM service in marine areas. They must shut down their GSM services completely after the cruise ship has entered a port in order to prevent infringing the privileges of the terrestrial operators.

      +

      IMDX provides an 鈥淓xclusive Access鈥� operation command line for the operator to alter the IMDX system status, which can be divided into four levels:

      +
      + + + + + + + + + + + + + + + + +

      •Normal

      Full IMDX functions.

      +

      •Exclusive Half

      Prohibit the public (roaming) users from registration.

      +

      •Exclusive Full

      Prohibit both public (roaming) and hybrid users from registration.

      +

      •Shutdown

      Shutdown IMDX. Forbid all users from registration.

      +
      +
      +

      In the exclusive access mode, the network sends a "Location Area Updating Reject" message to user鈥檚 mobile to indicate the cause of rejection. The cause of rejection is configurable in the system. The operator may choose one of the following rejection cause value per his network requirement:

      +
      + + + + + + + + + + + + +

      •PLMN not allowed

      The PLMN is added to a "Forbidden PLMN List" stored in the SIM card to prevent mobile from any further attempt to register in the PLMN.

      +

      •LA not allowed

      The mobile does not attempt registering in the PLMN, unless the user changes location area.

      +

      •Roaming not allowed in this LA

      The selected location area does not accept visitors from another PLMN.

      +
      +
      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Manage OPPS Subscriber

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.9.1

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_1_1_9_2.htm b/wxc2_omc/omcHelp/2_1_1_9_2.htm new file mode 100755 index 0000000..dc48726 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_1_9_2.htm @@ -0,0 +1,174 @@ +锘� + + + OPR + + + + + + + + + + + + + + + + + + + + +
      +

      Open-to-all Prepaid Roaming System

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Open-to-all Prepaid Roaming (OPR) allows the network operator to use existing UltraWAVE Prepaid System and prepay cards to deliver open-to-all prepaid services to all visiting GSM users. GSM users from any networks may subscribe the Open-to-all Prepaid Roaming service without changing their SIM cards. OPPS is introduced into UltraWAVE system to manage OPR user account: creates account, deletes account and inter-acts with other application entities of the system to implement OPR function. OPPS has the account database to store OPR subscriber information.

      +

       

      +

       

      +
      + + + +

      OPR uses IMEI of the mobile phone and home IMSI of the SIM card of the visitor as the user identifiers. If the registration is through auto-registration then OPR will collect the identifiers automatically. No user intervention is required. If the visitor registers the OPR service manually then he has to provide the IMEI as his identifier in the manual registration. The OPR will collect his home IMSI from his SIM card when he registers (location update) to the local GSM network.

      +

      OPR uses both IMEI and IMSI to identify an OPR subscriber. After the first successful registration to the local GSM network the OPR will record his IMEI and IMSI to his OPR account. That means the OPR user must keeps using the same mobile phone and SIM card to register to his OPR account and get the OPR services.

      +

       

      +
      +
      +

       

      +
      + + + +

      When a visiting GSM user registers to the OPR system, either through 鈥淎uto-Registration鈥� or 鈥淢anual-Registration鈥�, the OPR will create a user account and assign a local phone number (MSISDN) to him. The OPR will also notify the UltraWAVE PPS and HLR to create a user account for the new OPR subscriber. An OPR welcome short message will be sent to the user to inform him his local phone number (MSISDN) and PIN number (using for Virtual Calling Card service), and make him aware that he is currently in the OPR mode. Then the OPR user will enjoy the prepaid services in the same way as a normal prepaid user after adding prepay credits to his OPR account.

      +

      This is the UltraWAVE PPS to manage the lifespan of the OPR accounts. When an OPR account expires, the PPS will notify HLR and OPPS to delete the OPR account from their databases.

      +

       

      +

       

      +
      + + + +

      Auto-Registration is for attracting more GSM visitors to use the OPR service. This function allows any visitors from other PLMNs that have no roaming agreements be registered to the local network immediately once it is being selected. Auto-Registration will create an OPR account for the visitor automatically and will send an OPR welcome short message to notify the visitor that an OPR account with a local phone number (MSISDN) is being created for him. The OPR welcome short message will also instruct the visitor how to add credit to activate the full services of his account.

      +

      The OPR account is on 鈥渢rial鈥� status when it is created in the Auto-Registration process. Subscriber has to add credit (recharge) to activate the account to 鈥渘ormal鈥� status. When the OPR account is on 鈥渢rial鈥� status the subscriber may registers (location update) to the local network but is 鈥渞estricted鈥� to use partial prepaid services that are permitted by the operator. For example, the operator might allow the trial user to receive incoming calls but not making outgoing calls. In order to use the full prepaid services, the subscriber has to add credits to his account with prepay card. Normally, the trial subscriber will be given a few days to keep his account. If he doesn鈥檛 recharge his account within the operator defined period of time then the account will be expired and obsolete from the database.

      +

      Auto-Registration is only applicable to GSM visitors from PLMNs that have no roaming agreement with the local operator. OPR will not auto register GSM visitors who are coming from PLMNs with roaming agreements. Those users must open OPR account via voice call or internet manually.

      +

      Registration methods for visitors from PLMN without roaming agreement:

      +
      + + + + + + + + + + + + + + + + + + +

      Auto-registration: visitor is inside the OPR network coverage

      +

      Auto-registration

      +

      •Just select the local OPR network, then done.

      Manual-registration: visitor is outside the OPR network coverage

      +

      Manual-registration

      +

      by voice call

      +

      •Buy a prepay card.

      •Jot down the IMEI of his mobile phone.

      •Call the OPR IVR center to register with the IMEI and the prepay card password.

      Manual-registration

      +

      by internet

      +

      •Buy a prepay card.

      •Jot down the IMEI of his mobile phone.

      •Visit the OPR web site to register with the IMEI and the prepay card password.

      +
      +

       

      +
      +
      +

       

      +
      + + + +

      In following description we call GSM visitors who are from operators that have local roaming agreements in place as GSM roaming user.

      +

      A roaming welcome short message will be sent to an inbound GSM roaming user when he is roaming to the local network. The short message may also advertise to the roaming users the OPR service plan.

      +

      If the GSM roaming user wants to subscribe to the Open-to-all Prepaid Roaming service, then he has to buy a prepay card and then call the OPR IVR center to create an OPR account. The OPR IVR system will prompt the GSM roaming user to enter the prepay card password and the IMEI of his mobile phone to validate the subscription. After the roaming user successfully registers to the OPR service, he will be location update to both his home PLMN and the local network, and he鈥檒l have two phone numbers: the home MSISDN and the local MSISDN. His home MSISDN is for receiving calls from his home PLMN only. That means a roamer OPR subscriber has two phone numbers. His friends may call him by his home phone number or the local phone number. Usually, his friends at his home town will call his home phone number and his local friends will call his local phone number to reach him. All the going calls are handling by the local network.

      +

      Registration methods for GSM roaming users:

      +
      + + + + + + + + + + + +

      Manual-registration: visitor is inside or outside the OPR network coverage

      +

      by voice call

      +

      •Buy a prepay card.

      •Jot down the IMEI of his mobile phone.

      •Call the OPR IVR center to register with the IMEI and the prepay card password.

      by internet

      +

      •Buy a prepay card.

      •Jot down the IMEI of his mobile phone.

      •Visit the OPR web site to register with the IMEI and the prepay card password.

      +
      +

       

      +
      +
      +

       

      +
      + + + +

      A registered roamer OPR user can switch his service mode between 鈥渞oaming鈥� and OPR through the OPR IVR center. He can call the OPR IVR center and follow the instructions to select the service mode. It will then inform the OPR system to change his service mode selection accordingly. The selected mode, 鈥渞oaming鈥� or OPR, will become effective immediately. A welcome short message will be sent to the user each time he is switching his service mode telling him his current service mode.

      +

       

      +
      +
      +
      +
      +

       

      +

       

      +

      See Also

      +

       

      +

      •Manage OPPS Subscriber

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.1.9.2

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_1_3_1.htm b/wxc2_omc/omcHelp/2_1_3_1.htm new file mode 100755 index 0000000..779c045 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_3_1.htm @@ -0,0 +1,260 @@ +锘� + + + AAS + + + + + + + + + + + + + + + + + + + + +
      +

      IP Audio Announcement System

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The IP AAS provides multi-lingual audio announcements for unattainable call and prepaid service. This can be done over 60 channels to notify subscribers their call status or prepaid account information. The announcement can be recorded and the playback can be flexibly configured to meet the specific requirements. The AAS is connected to the MSC using BICC interfaces over virtual connections.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •AAS Parameter Dictionary

       

      +

      •Enable Audio Announcement

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Interface

      +

      BICC to MSC, MGCP to MSC (Tone), CAP to PPS

      +

      RTP voice streams to media gateway

      +

      Audio Announcement

      +

      Support 5 languages

      +

      60-channel announcement playback per AAS

      +

      1000 announcements per language

      +

      Max. 300 seconds in length per announcement

      +

      Programmable voice group

      +

      Programmable syntax

      +

      Support voice format: PCM a-law and Mu-law

      +

      Configurable cause mapping to announcements

      +

      Support for AMR & EFR & FR codecs

      +

      IP Tone Generator

      +

      512 ports tone (ring and busy tone) playback (controlled by MGCP)

      +

      Prerecorded common tone with configurable frequency and cadence

      +

      Prepaid Service Announcement (SRF)

      +

      Interactive announcement for prepaid service:

      +

      •Recharge

      •Inquiry

      •Transfer balance

      •Virtual calling card

      •Friends & Family number management

      •Parent & Children number management

      •PPS account management

      PPS Call Teardown Prompts

      +

      Prompt when a subscriber's balance is below the threshold

      +

      Call reject when the balance can鈥檛 afford the call

      +

      Call disconnection prompt when the balance is going to exhausted

      +

      Call disconnection notification at the call disconnection

      +

      Call Unattainable Announcement

      +

      Called number is invalid

      +

      Subscriber is offline

      +

      Subscriber is busy

      +

      Line is busy

      +

      Caller is invalid

      +

      Called number is not in use

      +

      Caller has not applied this service

      +

      Called number is temporarily unreachable

      +

      Call hold

      +

      Call waiting

      +

      Dual Homing

      +

      Support dual homing to MSC

      +

      License Control

      +

      AAS application flag

      +
      +
      +

       

      +

       

      +

      AAS Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •System Number

      (Read Only) ID to identify the target AAS.

      +

      0 - 1

      +

      •AAS Prefix

      Define an internal prefix used  to route to AAS and play audio announcement.

      +

      •Default = BB

      Numeric max 16 digits

      +

      •Play Times

      Define the audio announcement play times.

      +

      1 - 5

      +

      Link Management

      +

      Manage link relevant parameters to connect the target AAS to MSC. One AAS can set two links.

      +

      --

      +

      •Network Indicator

      Select the type of network used to establish connection between AAS and MSS.

      +

      •National

      •National Spare

      •International

      •International Spare

      •SRF E.164 Number

      (Read Only) The E.164 node address of the SRF.

      +

      Valid E.164 number

      +

      •CC

      The code that identifies the country's network.

      +

      Numeric max 4 digits

      +

      •NDC

      Define the national calling area or national network to which the subscriber belongs.

      +

      Numeric max 6 digits

      +

      •AAS0 OPC

      Originating Point Code of AAS0.

      +

      ITU = 1 - 16383

      +

      ANSI = 1 - 16777215

      +

      •AAS0 DPC

      Destination Point Code of AAS0.

      +

      •AAS1 OPC

      Originating Point Code of AAS1.

      +

      •AAS1 DPC

      Destination Point Code of AAS1.

      +

      •Link0 Flag

      Enable or disable link 0 of the target AAS.

      +

      •Enable

      •Disable

      •Link1 Flag

      Enable or disable link 1 of the target AAS.

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.3.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_1_3_2.htm b/wxc2_omc/omcHelp/2_1_3_2.htm new file mode 100755 index 0000000..63faa12 --- /dev/null +++ b/wxc2_omc/omcHelp/2_1_3_2.htm @@ -0,0 +1,434 @@ +锘� + + + VSS + + + + + + + + + + + + + + + + + + + + +
      +

      IP Voice Service System

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Voice Mail System (VMS) is one of the value added peripheral of UltraWAVE system. It provides voice mail to the calling party when the called party is busy, no answer, not reachable or switched off. When a new voice message reaches, the VMS notifies the host by a short message. Subscribers can receive and retrieve their messages and maintain their mailboxes (set greetings, language and password) at any time from anywhere.

      +

       

      +

      The VMS can be either deployed as part of the UltraWAVE system, or used as a standalone system. In an UltraWAVE system the VMS connects to the MSC. It also functions along with SMSC to provide message indications. Each VMS can also be configured to provide a multi-language announcement service. A single VMS supports 10k subscribers. The UltraWAVE system may deploy up to ten VMS to support 100k voice mail subscribers.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •VSS Parameter Dictionary

       

      +

      •Enable Voice Mail Service

       

      +

      •VMS Subscriber Management

       

      +

       

      +

      Feature List

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Feature

      +

      Descriptions

      +

      Capacity

      +

      100k mail boxes

      +

      15 voice mails per box

      +

      120-second per voice mail

      +

      Maximum 256 calls at the same time

      +

      Offered in conjunction with PPS and SMSC

      +

      Interface

      +

      BICC to MSC

      +

      RTP voice streams to media gateway

      +

      SMPP over TCP to SMSC

      +

      SNMP to EMS

      +

      Voice mail service

      +

      Mailbox activation

      +

      Mailbox preferences

      +

      •Set greetings

      •Set password

      •Set language

      Short message notification for new voice mail

      +

      Message record and retrieval

      +

      Message replay, save, delete, forward and reply

      +

      Capture of CLI if no message is left by caller

      +

      Ring back to caller who dropped the message

      +

      Language

      +

      Support 5 languages

      +

      Programmable voice group

      +

      Programmable syntax

      +

      Voice group variables

      +

      Enhanced

      +

      Support for AMR & EFR & FR codecs

      +

      Codec static / dynamic payloads

      +

      Codec negotiation and transcoding

      +

      License control

      +

      VMS application flag

      +
      +
      +

       

      +

       

      +

      VSS Parameter Dictionary

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Definition

      +

      Range

      +

      System

      +

      --

      +

      --

      +

      •CC

      The code that identifies the country's network.

      +

      Numeric max 4 digits

      +

      •NDC

      Define the national calling area or national network to which the subscriber belongs.

      +

      Numeric max 6 digits

      +

      •VMS Number

      Define the MSISDN and service numbers for voicemail server. This number will be used to route notification short message.

      +

      Numeric max 16 digits

      +

      •PLMN Service Number

      Define the service numbers for voicemail server. All numbers must include CC and NDC. Multiple VMS servers may use the same VMS MSISDN but different Service Numbers.

      +

      This service number is for the requests from local network. Subscriber dials this dedicated number to enter his mailbox or leave message to other subscribers.

      +

      •PSTN Service Number

      This service number is for the requests from PSTN. Subscriber dials this dedicated number from PSTN to access voicemail system. Inputs the mailbox number (MSISDN) and password (if password enabled) according to the system prompt to . After the verification the subscriber may enter his mailbox or leave message to other subscribers.

      +

      •Leave Message Number

      Dedicated service number for directly leaving message. Subscriber dials this number from either PSTN or local network to leave message to system subscribers.

      +

      •Check Message Number

      Dedicated service number for directly checking inbox message. Subscriber dials this number from either PSTN or local network to check his inbox message.

      +

      •International Prefix

      A digit or combination of digits used by a subscriber when making an international call. The international prefix is used to indicate that the following digits represent an international number and should be routed to an international gateway.

      +

      Numeric max 2 digits

      +

      •National Prefix

      A digit or combination of digits used by a subscriber when calling a national destination (within the country) other than that of the local area network.

      +

      Numeric max 2 digits

      +

      •Greeting Number Modification

      It determines the Number Attribute Identity of the host number which will be announced to the visitors in the greeting announcement.

      +

      •Sub = Unknown(Sub) = "SN"

      •NDD = "NDC+SN"

      •IDD = "+CC+NDC+SN"

      •Unknown(NDD) = "Nat Prefix+NDC+SN"

      •Unknown(IDD) = "Int Prefix+CC+NDC+SN"

      •Sub

      •NDD

      •IDD

      •Unknown (Sub)

      •Unknown (NDD)

      •Unknown (IDD)

      •Ringback Number Modification

      It determines the Number Attribute Identity of the host number which will be sent as the calling number in the direct ringback ISUP messages.

      +

      •Link Type

      Type of the VMS links.

      +

      •E1

      •T1

      •Codec Type

      Codec(compression/decompression) algorithm of the VMS.

      +

      •A-law

      •Mu-law

      •AMR

      •EFR

      •FR

      •G.729

      Trunk

      +

      --

      +

      --

      +

      •Network Indicator

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      •National

      •National Spare

      •International

      •International Spare

      •DPC

      Point Code of MSC.

      +

      ITU = 1 - 16383

      +

      ANSI = 1 - 16777215

      +

      •OPC

      Assign the unique decimal Point Code to VMS.

      +

      •CIC

      Specify the beginning Circuit ID Code of each trunk. Support up to 8 BICC trunks.

      +

      32 x n + 1 (n = 0~7)

      +

      •Circuit Selection

      Circuit selection mode of the traffic channel connections.

      +

      •Clockwise

      •Anti-clockwise

      •Odd

      •Even

      •Circuit Delay

      Define the interval between sending ACM and ANM messages.

      +

      0 - 5 seconds

      +

      Mailbox

      +

      --

      +

      --

      +

      •Min Message Length

      Define the minimum length of a voicemail message. Any voicemail less than preset minimum length will not be recorded and sent to mailbox host.

      +

      •Unlimited

      •1 - 5 seconds

      •Max Message Length

      Define the maximum length of a voicemail message. The surplus part of the voicemail will be ignored.

      +

      •20 seconds

      •30 seconds

      •40 seconds

      •60 seconds

      •80 seconds

      •100 seconds

      •120 seconds

      •New Message Validity

      Specify the storage period of an inbox new(unread) message. The message will be deleted after this period. Unit is day.

      +

      1 - 255 days

      +

      •Saved Message Validity

      Specify the storage period of an inbox saved message. The message will be deleted after this period.

      +

      •Message Play Order

      Define the play sequence of the inbox messages.

      +

      •New message first

      •Old message first

      •Password Retry Times

      VMS will refuse the access request after the password attempt times reaches this preset value.

      +

      1 - 5

      +

      •Key-press Timeout

      Timeout for the interval between two continuous key-press. If the interval is longer than the preset timer, the system will regard that the digit collection (key-press) is completed. Unit is second.

      +

      5 - 30 seconds

      +

      CLI Modification

      +

      --

      +

      Max 32 items

      +

      •Prefix

      The initial digits of the caller number. This number can be any number (from PSTN or PLMN).

      +

      Numeric max 16 digits

      +

      •Original NAI

      Original Number Attribute Identity of the caller numbers beginning with this prefix.

      +

      •Unknown

      •Subscriber

      •National

      •International

      •Deletion Count

      The amount of digits to be deleted from the beginning of the calling number.

      +

      0 - 16

      +

      •Inserted Digits

      The digits to be added to the front of the calling number.

      +

      Numeric max 16 digits

      +

      •Modified NAI

      Number Attribute Identity of the caller number after manipulation.

      +

      •Unknown

      •Subscriber

      •National

      •International

      SMS Notification

      +

      Specify coding scheme and customize notification SMS contents for supported languages. The message is separated into two parts by the caller number.

      +

      Max 5 items

      +

      •New Message

      Define the notification short message contents for a new voicemail message.

      +

      •1=You got a new voice mail from <MSISDN>

      •2=. Please dial xxx to check.

      --

      +

      •Unanswered Call - CLI

      Define the notification short message contents for an unanswered incoming call with caller number.

      +

      •1=You got a missed call from <MSISDN>

      •2=.

      --

      +

      •Full Mailbox

      Define the notification short message contents for an overload mailbox. The notification will be sent to the host when receiving a new message but the mailbox is full.

      +

      •1=Your mailbox is full. <MSISDN>

      •2= tried to call you.

      --

      +

      •Unanswered Call - No CLI

      Define the notification short message contents for an unanswered incoming call without caller number.

      +

      •1=You got a missed call.

      --

      +

      Voice Group

      +

      Refer to UltraWAVE Voice Group Table for more details.

      +

      --

      +

      •Public Voice Group

      Public voice groups are used to array up to 32 voice units in a sequence to provide different voicemail audio prompts. Each voice group determines a kind of prompt.

      +

      --

      +

      •Voice Group for Language 0 - 4

      These 256 voice groups are used to array up to 32 voice units in a sequence to provide voicemail audio prompts in the specific language. Each voice group determines a kind of prompt.

      +

      --

      +
      +
      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.1.3.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_2_1.htm b/wxc2_omc/omcHelp/2_2_1.htm new file mode 100755 index 0000000..92ac30c --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1.htm @@ -0,0 +1,96 @@ +锘� + + + Account + + + + + + + + + + + + + + + + + + + + +
      +

      Account

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      1_010_011_014_011_016_011_012_011_024_021_018_011_020_01

      +

       

      +

      1_108_01

      +

      1_108_02

      +

      1_108_03

      +

      1_108_04

      +

      1_108_05

      +

      1_108_06

      +

      1_108_07

      +

      1_108_08

      +

      1_108_09

      +

      1_108_10

      +

      1_108_11

      +

      1_108_12

      +

      1_108_14

      +

      1_108_15

      +

      1_108_16

      +

      1_108_17

      +

      1_108_18

      +

       

      +

       

      +

      Subscriber Management

      +

       

      +

      •VLR Subscriber

       

      +

      •HLR Subscriber

       

      +

      •PPS Subscriber

       

      +

      •AUC Subscriber

       

      +

      •EIR Subscriber

       

      +

      •VMS Subscriber

       

      +

      •MNP Subscriber

       

      +

      •OPPS Subscriber

       

      +

      •iPALIM Subscriber

       

      +

       

      +

      Replace MSISDN

      +

       

      +

       

      +

      Recharge Card

      +

       

      +

       

      +

      Current Tariff

      +

       

      +

      •MO

       

      +

      •MT

       

      +

      •Discount

       

      +

      •Holiday

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_2_1_1.htm b/wxc2_omc/omcHelp/2_2_1_1.htm new file mode 100755 index 0000000..ada1473 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_1.htm @@ -0,0 +1,468 @@ +锘� + + + VLR Subscriber + + + + + + + + + + + + + + + + + + + + +
      +

      VLR Subscriber

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      A Visitor Location Register (VLR) is a database which contains temporary information concerning the mobile subscribers that are currently located in the MSC serving area. The temporary information includes the subscriber basic status, supplementary services status, location information and service subscription information.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      Select VLR subscriber in the navigate tree, it displays the VLR subscriber List window. When it first comes up, the contents are cited from EMS database, but maybe not the latest information in the VLR database. Click 2_014 to update VLR subscriber information from VLR server. The VLR subscriber is read-only, can't be maintained on the UltraWAVE EMS GUI.

      +

       

      +

      2_2_1_1_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select VLR under the Subscriber submenu.

       

      +

      3.Select IMSI or MSISDN from the drop-down menu of the search bar, enter the proper subscriber number which want to search.

       

      +

      4.Click 2_015, or click 2_016 after the previous Get All operation was performed.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0

      +

      IMSI

      +

      International mobile subscriber identity, IMSI=MCC+MNC+MSIN

      +

      1

      +

      MSISDN

      +

      Mobile station international ISDN number

      +

      2

      +

      Calling Category

      +

      Calling party defined in ISUP for operator

      +

      3

      +

      ODB Status

      +

      Operator Determined Barring status

      +

      4

      +

      ODB General Data

      +

      5*

      +

      Bearer Service

      +

      Supported bearer services.

      +

      6

      +

      Telephony Service

      +

      Provision of telephony services

      +

      7

      +

      TMSI

      +

      Temporary Mobile Subscriber Identity

      +

      8*

      +

      LMSI

      +

      Local Mobile Station Identity

      +

      9

      +

      LAI

      +

      Location Area Identity which is sent to VLR by MS after a location update. LAI contains MCC, MNC and LAC that identity the basic location of an MS.

      +

      10

      +

      Cell ID

      +

      Decimal Cell ID

      +

      11

      +

      Location Confirm

      +

       

      +

      12

      +

      Data Confirm

      +

       

      +

      13

      +

      Radio Confirm

      +

       

      +

      14

      +

      IMSI Detach

      +

      IMSI Detach Flag:

      +

      •Attach = MS logged on to the network

      •Detach = MS logged off from the network

      15

      +

      MNRF

      +

      Mobile no reachable flag

      +

      16

      +

      LA Not Allow Flag

      +

       

      +

      17

      +

      Roam Restrict Flag

      +

       

      +

      18

      +

      CFU Status

      +

      The current status of call forwarding unconditional

      +

      19

      +

      CFU Number

      +

      CFU destination number

      +

      20

      +

      CFB Status

      +

      The current status of call forwarding on mobile subscriber busy

      +

      21

      +

      CFB Number

      +

      CFB destination number

      +

      22

      +

      CFNRy Status

      +

      The current status of call forwarding on no reply

      +

      23

      +

      CFNRy Number

      +

      CFNRy destination number

      +

      24

      +

      CFNRc Status

      +

      The current status of call forwarding on mobile subscriber not reachable

      +

      25

      +

      CFNRc Number

      +

      CF destination number.

      +

      26

      +

      Barring All

      +

      The current status of barring of all calls

      +

      27

      +

      BAOC

      +

      The current status of barring of all outgoing calls

      +

      28

      +

      BOIC

      +

      The current status of barring of all outgoing international calls

      +

      29

      +

      BOIC-exHC

      +

      The current status of BOIC except those directed to home PLMN

      +

      30

      +

      BAIC

      +

      The current status of barring of all incoming calls

      +

      31

      +

      BIC-Roam

      +

      The current status of  BAIC when roaming outside home PLMN

      +

      32

      +

      CLIP

      +

      The current status of calling line identification presentation

      +

      33

      +

      CLIR

      +

      The current status of calling line identification restriction

      +

      34

      +

      COLP

      +

      The current status of connected line identification presentation

      +

      35

      +

      COLR

      +

      The current status of connected line identification restriction

      +

      36

      +

      AOCI

      +

      The current status of advice of charge information

      +

      37

      +

      AOCC

      +

      The current status of advice of charge charging

      +

      38

      +

      Call Hold

      +

      The current status of call hold

      +

      39

      +

      Call Waiting

      +

      The current status of call waiting

      +

      40

      +

      ECT

      +

      The current status of explicit call transfer

      +

      41

      +

      MPTY

      +

      The current status of multi-party call

      +

      42

      +

      O-CSI

      +

      The originating CAMEL service status and number

      +

      •Y = Enable, MO call will be verified via PPS, for PPS subscribers

      •N = Disable, MO call will not be processed by PPS, for post paid subscribers

      43*

      +

      SS-CSI

      +

      The supplementary service notification CAMEL subscription status and number

      +

      44

      +

      SMS-CSI

      +

      The short message service notification CAMEL subscription status and number

      +

      45

      +

      MSISDN_OPT

      +

       

      +

      46

      +

      OPPS Flag

      +

      The current status of OPPS service:

      +

      •OPR Not Registered = Initial status of a new created or imported OPR account. The associated MSISDN will be allocated to an auto-registered subscriber.

      •OPR without roaming agreement = OPR subscriber is from PLMN without roaming agreement.

      •OPR with roaming agreement (OPR) = OPR subscriber is from PLMN with roaming agreement. Its current application status is switched to OPR mode.

      •OPR in roaming = OPR subscriber is from PLMN with roaming agreement. Its current application status is switched to roaming mode.

      •IMDX Private Ordinary = IMDX private subscriber with privileges to make private outgoing calls only

      •IMDX Private Premium = IMDX private subscriber with higher privilege to make both private and public outgoing calls

      •IMDX Hybrid = IMDX hybrid subscriber

      +
      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.1

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_10.htm b/wxc2_omc/omcHelp/2_2_1_10.htm new file mode 100755 index 0000000..a363055 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_10.htm @@ -0,0 +1,73 @@ +锘� + + + Replace MSISDN + + + + + + + + + + + + + + + + + + + + +
      +

      Replace MSISDN

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Operator should allocate a segment of MSISDN number for auto-registration Hybrid users. UltraWAVE Prepaid System then picks MSISDN from the MSISDN segment sequentially to assign to auto-registration Hybrid User. Hybrid user can鈥檛 select MSISDN by himself.

      +

       

      +

      When the operator uploads the MSISDN segment to the system, he may set the MSISDN attribute to preserve some MSISDN for future important customers. The system subdivides the MSISDN attribute into three classes - Ordinary, Premium and VIP. Auto-registration will only use Ordinary MSISDN. Operator may mark the lucky MSISDN numbers as Premium or VIP to reserve these numbers for important customers. If a Hybrid user dislikes the automatically assigned MSISDN after the auto-registration then he may request the operator to change for a better MSISDN.

      +

       

      +

       

      +

      Implementation

      +

       

      +

      2_2_1_10_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select Replace MSISDN under the Subscriber submenu.

       

      +

      3.Input the old MSISDN in the Replace MSISDN input-box.

       

      +

      4.Select Class drop-down menu to display all MSISDN in a specified class.

       

      +

      5.Click to pick up an available MSISDN from the MSISDN selection table.

       

      +

      6.Click the upper Replace button.

       

      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.10

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_2_1_10_01.gif b/wxc2_omc/omcHelp/2_2_1_10_01.gif new file mode 100755 index 0000000..5386935 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_10_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_1_01.gif b/wxc2_omc/omcHelp/2_2_1_1_01.gif new file mode 100755 index 0000000..1439874 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_1_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_2.htm b/wxc2_omc/omcHelp/2_2_1_2.htm new file mode 100755 index 0000000..a9aa83e --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_2.htm @@ -0,0 +1,733 @@ +锘� + + + HLR Subscriber + + + + + + + + + + + + + + + + + + + + +
      +

      HLR Subscriber

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The HLR stores mobile subscriber information in the local switch. The HLR subscriber information includes the International Mobile Subscriber Identity (IMSI) and service subscription information. It also maintains service restrictions, supplementary services information and location information.

      +

       

      +

      There are three distinct subscriber types in HLR:

      +

      •GSM subscribers

      •GPRS subscribers

      •Dual subscribers (GSM and GPRS subscribers)

       

      +

      GSM subscribers have access to the standard GSM network infrastructure. These subscribers require the following configuration. general details, GSM setup details, GSM supplementary services and routing MSISDNs.

      +

       

      +

      GPRS subscribers have access to the GPRS network infrastructure. GPRS has been designed as an extension to the existing GSM network infrastructure and supports end-to-end transport of IP based packet data. These subscribers require the following configuration; general details and PDP contexts.

      +

       

      +

      Dual subscribers have access to both the standard GSM network infrastructure and the GPRS network infrastructure. Dual subscribers require the following configuration; general details, GSM setup details, GSM supplementary services, routing MSISDNs and PDP contexts.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_2_1_2_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select HLR under the Subscriber submenu.

       

      +

      3.Click 2_017 at the upper-right corner.

       

      +

      4.Fill in the parameter details for this subscriber.

       

      +

      5.Click 2_018 at the top of the parameter table to create this subscriber in HLR servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0

      +

      IMSI

      +

      International mobile subscriber identity, IMSI=MCC+MNC+MSIN

      +

      1

      +

      IMSI Flag

      +

      A flag used to disable or enable a provisioned IMSI

      +

      2

      +

      Network Access Mode

      +

      NAM, defines the attribute of the subscriber registered network:

      +

      •Both = both GSM and GPRS network

      •Non-GPRS = GSM network

      •Only GPRS = GPRS network

      3

      +

      MSISDN

      +

      Mobile station international ISDN number, MSISDN=CC+NDC+SN

      +

      4

      +

      Fax Number

      +

      Assign a number to support fax service for this subscriber.

      +

      5

      +

      Data Number

      +

      Assign a number to support data service for this subscriber.

      +

      6

      +

      Calling Category

      +

      Calling party defined in ISUP for operator.

      +

      7

      +

      ODB Flag

      +

      A flag indicates whether a subscriber is subject to operator determined barring.

      +

      •Service Granted = no ODB

      •Operator Determined Barring

      8

      +

      ODB General Data

      +

      Set the flag of general operator determine barring services.

      +

      •BAOC (Barring of all outgoing calls)

      •BOIC (Barring of all outgoing international calls)

      •BOIC-exHC (ODB BOIC except those directed to home PLMN)

      •Bar of premium rate (information) call

      •Bar of premium rate (entertainment) call

      •BAIC (Barring of all incoming calls)

      •BAIC-ROAM (ODB BAIC when roaming outside home PLMN)

      •Roaming (Barring of roaming outside home PLMN)

      •Roaming CT (Barring of roaming outside home PLMN country)

      9

      +

      ODB Specific Data

      +

      Set the flag of OSB service.

      +

      10*

      +

      Bearer Service

      +

      Select supported bearer services.

      +

      11

      +

      Telephony Service

      +

      Select the toggle button to enable telephony services.

      +

      12

      +

      RSZI List

      +

      Regional subscription zone identities lists

      +

      A PLMN specific regional subscription defines unambiguously for the entire PLMN the regions in which the roaming is allowed.

      +

      RSZI = CC + NDC + Zone code, total 10 RSZIs

      +

      13

      +

      CSRR Type

      +

      Define 8 CSRR (county specific roaming restrictions) types' attribute to confine the international roaming range of a subscriber. Each CSRR defines roaming restrictions for 256 VPLMNs. There are 8 CSRR combination types

      +

      14

      +

      Bearer Capability Type

      +

      Define Bearer Capability information element for fax and data service.

      +

      15

      +

      CLIP State

      +

      Calling line identification presentation state, set on called party

      +

      •Provisioned=Called party displays caller number (given caller party set CLIR as Not provisioned)

      •Not provisioned=Called party does not display caller number

      16

      +

      CLIR State

      +

      Calling line identification restriction state, set on caller party

      +

      •Provisioned=called party does not display caller number

      •Not provisioned=caller party displays caller number (given called party set CLIP as Provisioned)

      17

      +

      COLP State

      +

      Connected line identification presentation state, set on caller party

      +

      •Provisioned=caller party displays called number including forwarded number (given called party set COLR as Not provisioned)

      •Not provisioned=caller party does not display called number

      18

      +

      COLR State

      +

      Connected line identification restriction state, set on called party

      +

      •Provisioned=caller party does not display called number

      •Not provisioned=caller party displays called number (given caller party set COLP as provisioned)

      19

      +

      Call Barring Subscription

      +

      Define call barring service subscription mode for all call barring

      +

      20

      +

      Call Barring Password

      +

      For barring service controlled by subscriber, used for all call barring. Only use digit '0'-'9'

      +

      21*

      +

      Wrong Password Attempt

      +

      Define the allowable wrong password attempt times.

      +

      22

      +

      BAOC State

      +

      Barring of all outgoing calls

      +

      23

      +

      BOIC State

      +

      Barring of all outgoing international calls

      +

      24

      +

      BOIC-exHPLMN State

      +

      BOIC except directed to home HPLMN

      +

      25

      +

      BAIC State

      +

      Barring of all incoming calls

      +

      26

      +

      BIC-Roam State

      +

      BIC when roaming outside home PLMN

      +

      27

      +

      CFU State

      +

      State of call forwarding unconditional

      +

      28

      +

      CFU Number

      +

      CFU forwarded MSISDN

      +

      29

      +

      CFB State

      +

      State of call forwarding on mobile subscriber busy

      +

      30

      +

      CFB Number

      +

      CFB forwarded MSISDN

      +

      31

      +

      CFNRy State

      +

      State of call forwarding on no reply

      +

      32

      +

      CFNRy Timer

      +

      Indicates "no reply condition timer", ranges from 5 to 30 seconds on a steps of 5-second

      +

      33

      +

      CFNRy Number

      +

      CFNRy forward MSISDN

      +

      34

      +

      CFNRc State

      +

      State of call forwarding on mobile subscriber not reachable

      +

      35

      +

      CFNRc Number

      +

      CFNRc forwarded MSISDN

      +

      36

      +

      Call Waiting State

      +

      Call Waiting State

      +

      37

      +

      Call Hold State

      +

      Call Hold State

      +

      38

      +

      ECT State

      +

      Explicit call transfer state

      +

      39

      +

      Multi Party Call

      +

      Multi-party call state

      +

      40

      +

      eMLPP State

      +

      enhanced Multi-Level Precedence and Preemption Service state

      +

      41

      +

      eMLPP Max Priority

      +

      The maximal priority of eMLPP

      +

      42

      +

      eMLPP Default Priority

      +

      The default priority of eMLPP

      +

      43

      +

      Camel Flag

      +

      CAMEL service enable or disable.

      +

      Support CAMEL is a total flag of CAMEL provisioning. To enable any CAMEL service, select toggle button:

      +

      •O-CSI = Originating CAMEL subscription information

      •T-CSI = Terminating CAMEL subscription information

      •SS-CSI = Supplementary service notification CAMEL subscription information

      •SMS-CSI = Short message service notification CAMEL subscription information

      •GPRS-CSI = GPRS notification CAMEL subscription information

      44*

      +

      O-CSI

      +

      Define the originating CAMEL subscription information

      +

      45*

      +

      T-CSI

      +

      Define the terminating CAMEL subscription information

      +

      46*

      +

      SS-CSI

      +

      Define the supplementary service notification CAMEL subscription information

      +

      47*

      +

      SMS-CSI

      +

      Define the short message service notification CAMEL subscription information

      +

      48*

      +

      GPRS-CSI

      +

      Define the GPRS notification CAMEL subscription information

      +

      49

      +

      GPRS Flag

      +

      Enable or disable GPRS service

      +

      50

      +

      PDP Contest (Group1)

      +

      Define the Packet Data Protocol context for subscriber.

      +

      Each subscriber supports up to three PDP contexts.

      +

      51

      +

      PDP Contest (Group2)

      +

      52

      +

      PDP Contest (Group3)

      +

      53

      +

      User Name

      +

      User real name for identification purpose only.

      +

      54

      +

      User Certificate

      +

      User ID for identification purpose only.

      +

      55*

      +

      User Number

      +

      User emergency contact number for identification purpose only.

      +

      56*

      +

      User Remark

      +

      User info for identification purpose only.

      +

      57*

      +

      LMSI

      +

      Read Only. Local Mobile Station Identity

      +

      58

      +

      VLR Number

      +

      Read Only. VLR E.164 number.

      +

      59

      +

      MSC Number

      +

      Read Only. MSC E.164 number.

      +

      60

      +

      Purge Flag

      +

      Read Only. Status of MS purge:

      +

      •Online = Not purge

      •Offline = Purged

      61*

      +

      SGSN Number

      +

      Read Only. SGSN E.164 number.

      +

      62*

      +

      GGSN Number

      +

      Read Only. GGSN E.164 number.

      +

      63*

      +

      GGSN Address

      +

      Read Only. GGSN address type.

      +

      64*

      +

      MSC Area Restricted

      +

      Read Only. The current status of MSC area restriction.

      +

      65*

      +

      Roaming Restriction

      +

      Read Only. The current status of roaming restriction.

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_2_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select HLR under the Subscriber submenu.

       

      +

      3.Click the IMSI of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.Under the Value heading, modify the values of the subscriber parameters as required.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload the new values to HLR servers.

       

      +

      6.Click the 2_019 button at the top of the parameter table to update values from HLR servers.

       

      +

      7.Verify that the new values have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_2_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select HLR under the Subscriber submenu.

       

      +

      3.Click the IMSI of the subscriber want to delete, this displays the subscriber parameter window.

       

      +

      4.Switch the IMSI Flag from Enable to Disable.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload the IMSI Flag to HLR servers.

       

      +

      6.Click the 2_021 button at the top of the parameter table to delete this subscriber from HLR servers.

       

      +

      7.Click 2_014 to upload HLR subscribers from HLR to EMS database.

       

      +

      8.Verify the subscriber has been deleted from HLR.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_2_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select HLR under the Subscriber submenu.

       

      +

      3.Click 2_022 at the upper-right corner.

       

      +

      4.Enter the number of subscribers want to be created in the Batch Amount box, a maximum of 100 subscribers in a batch.

       

      +

      5.Fill in the start IMSI, MSISDN, Fax and Data numbers.

       

      +

      6.Fill in the required initialization parameters for the batch of subscribers.

       

      +

      7.Click 2_018 at the top of the parameter table to create these subscribers in HLR.

       

      +

      8.Click 2_014 to upload HLR subscribers from HLR to EMS database.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_2_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select HLR under the Subscriber submenu.

       

      +

      3.Click 2_014 to upload HLR subscribers from HLR to EMS database.

       

      +

      2_2_1_2_02

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu.

       

      +

      3.In the right Account Data window, click Download following HLRSubscriber to download subscriber file.

       

      +

      4.In the windows pop-up window, click the Save button.

       

      +

      5.Select a location on the local PC to save the csv file and click the Save button.

       

      +

      6.Find and verify the downloaded file on the local PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Create a HLR Subscriber with the required initialization parameters according to the previous section.

       

      +

      2.Click 2_030 instead of 2_018 at the last step.

       

      +

      3.Export HLR Subscribers according to the previous section.

       

      +

      4.Open the downloaded csv file by a text editor (UltraEdit is recommended).

       

      +

      5.Find the line of the new created subscriber in the file, replicate it to a new file.

       

      +

      6.Replicate this line to reach the numbers of subscribers want to import, a maximum of 5000 lines (subscribers) in a single file.

       

      +

      7.Find the IMSI and MSISDN columns, modify all of them as required, save the file in a local directory.

       

      +

      2_2_1_2_01

      +

       

      +

      1.Click the Account main menu, select HLR under the Subscriber submenu.

       

      +

      2.Click 2_023 at the upper-right corner, select the saved file in the local directory, click 2_024 to upload the subscribers to HLR servers.

       

      +

      3.Click 2_014 to upload HLR subscribers from HLR to EMS database.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.2

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_2_01.gif b/wxc2_omc/omcHelp/2_2_1_2_01.gif new file mode 100755 index 0000000..73dc4f1 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_2_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_2_02.gif b/wxc2_omc/omcHelp/2_2_1_2_02.gif new file mode 100755 index 0000000..952c3ec Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_2_02.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_3.htm b/wxc2_omc/omcHelp/2_2_1_3.htm new file mode 100755 index 0000000..81d5b67 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_3.htm @@ -0,0 +1,685 @@ +锘� + + + PPS Subscriber + + + + + + + + + + + + + + + + + +
      +

      Descriptions

      +

       

      +

      Subscriber profile includes all the personal information that relates to individual subscribers. It comprises a large number of subscriber records, each of them describing a single subscriber. Subscriber records include information such as the subscriber's MSISDN, balance, and account state. They may also include personal data such as name and address. A subscriber record also includes history information that describes recent significant events pertaining to that subscriber, such as calls, recharge attempts, and account state changes.

      +

       

      +

      Compared to service parameter, subscriber profile is very simple and is used by many more operators. Notably, subscriber profile is used by Customer Care representatives that take and handle subscriber calls and questions.

      +

       

      +

      Subscriber profile changes often. In fact, it changes with every call the subscriber makes. For every call, a new balance is written to the database and a recent call history is generated.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_2_1_3_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select PPS under the Subscriber submenu.

       

      +

      3.Click 2_017 at the upper-right corner.

       

      +

      4.Fill in the parameter details for this subscriber.

       

      +

      5.Click 2_025 at the top of the parameter table to create this subscriber in VLR servers.

       

      +

      2_2_1_3_02

      +

       

      +

      The same operation can be done in EMS >Advanced >Subscriber >PPS to maintain credit related parameters.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0

      +

      MSISDN

      +

      MSISDN = Mobile number of local subscriber. It includes CC and NDC.

      +

      1

      +

      Password

      +

      6-digit account password of PPS account. The password verification is necessary for recharging account from PSTN.

      +

      2

      +

      Status

      +

      Account status.

      +

      •Fresh = not activated

      •Normal = activated and normal in use

      •Suspended = service suspended requested by subscriber himself

      •Blacklist = blacklisted and service suspended

      •Released = account released and retrieved by operator

      3*

      +

      Balance

      +

      Balance of a PPS account, unit is the minimum currency unit.

      +

      PPS generates CDR for any changes of this value.

      +

      4*

      +

      Promotion Bonus

      +

      The awarded promotional balance after recharge within promotion period. The promotion bonus has its own validity and application scopes, which are different from the account balance.

      +

      5*

      +

      Overdraft

      +

      Set credit amount of an account, can be positive or negative.

      +

      If this value is set to positive then subscriber can use PPS service until his account balance turn to negative with an absolute value is same as the preset overdraft.

      +

      If this value is set to negative then subscriber can not use PPS service when account balance is less then the absolute value of preset overdraft.

      +

      6

      +

      Access Date

      +

      For fresh account, this is the creation date of the account;

      +

      For activated accounts, this is the date of the first recharge.

      +

      7*

      +

      MO Expiry Date

      +

      Expiry date of account to make MO call. The expiration date will be extended by every successful recharge.

      +

      Format: yyyymmdd, e.g. 20101211 is Dec. 11 of 2010.

      +

      8*

      +

      MT Expiry Date

      +

      Expiry date of an account to take MO call. The expiration date will be extended by every successful recharge. Normally is MT expiry date is longer than the MO expiry date. Format: yyyymmdd.

      +

      9*

      +

      Bonus Validity

      +

      The validity of promotion bonus. The bonus validity of each type of recharge cards may be different. Generally the bonus validity is set shorter than the recharge card credit MO/MT validity. The expired bonus can't be used any more and will be deleted from the account balance.

      +

      PPS supports up to 64 COS. Each COS can set unique promotion period, bonus (even for the same face value recharge card) and bonus validity.

      +

      10*

      +

      COS ID

      +

      ID of class of service. PPS supports up to 64 COS. Each COS contains complete PPS service packages including tariff, recharge promotion, service and validity control, MT call control and short message notification configuration, etc. The system has 64 COSs to shape the different service packages. Each subscriber is assigned a COS that determines his service grade.

      +

      11

      +

      Rent Type

      +

      Each MO tariff can set 8 rent types (0=VMS rental). Rent type can be defined to monthly rental or daily rental.

      +

      12

      +

      Home Location0

      +

      The home location defines home area of a subscriber. All calls taking place out of home area will be subject to the roaming fee. Each subscriber may define up to four home areas. The home location is basic tariff zone.

      +

      13

      +

      Home Location1

      +

      14

      +

      Home Location2

      +

      15

      +

      Home Location3

      +

      16

      +

      CUG ID

      +

      Define a close user group to which the subscriber belongs. Any call within a single user group is charged by the CUG tariff. PPS supports up to 10k close user groups. 0=the subscriber is not a CUG user.

      +

      17

      +

      Language Type

      +

      Subscriber may select one of the five available languages as his greeting language. All PPS prompt messages are played in the selected language. The five language candidates are set by SRF system parameter.

      +

      18

      +

      Recharge Failure

      +

      Quantity of recharge attempt failure. This number will be reset to zero after a successful recharge. If this number crosses the preset Blacklist threshold, it will be blacklisted by the system and inhibited to recharge or make any call. Operator can clear this number to resume the services to this account.

      +

      19

      +

      SM Inquiry Counter

      +

      Quantity of inquiry short messages on a daily basis. Operator can preset allowable number of free inquires per day. This counter will be reset to 0 as soon as the PPS daily report is generated (at midnight).

      +

      20*

      +

      Latch Flag (Read Only)

      +

      Indicator of promotion news. 1=promotion news has been sent.

      +

      21*

      +

      F&F Number Counter

      +

      Quantity of set friend and family number. 0=no friends and family number is set.

      +

      22

      +

      F&F Number Edit Counter

      +

      Display how many times the family number has been changed. The counter is accumulative and the maximum value is 255. Operator can preset allowable number of free changes per day.

      +

      23

      +

      F&F Number 0

      +

      Set up to five friends and family numbers for an account. Subscriber may set friends and family number by dialing to service center. Calls to these numbers are charged by the Friends and Family Number tariff.

      +

      24

      +

      F&F Number 1

      +

      25

      +

      F&F Number 2

      +

      26

      +

      F&F Number 3

      +

      27

      +

      F&F Number 4

      +

      28

      +

      Last Call Type

      +

      Call type of the last call made by the subscriber.

      +

      29

      +

      Last Call Time

      +

      The time of last call.

      +

      30

      +

      Last Call Number

      +

      Last call number.

      +

      For MO call, it is the called number.

      +

      For MT call, it is the calling number.

      +

      For MO SM, it is the called number.

      +

      For Call forwarding, it is the called number not the forwarded number.

      +

      31

      +

      CAP SMS Balance 0

      +

      It is available only when the SMS CAP plan is enabled.

      +

      The accumulative total charged balance for MO SMS on a monthly basis. Unit is the minimum currency unit.

      +

      32

      +

      CAP SMS Counter 0

      +

      It is available only when the SMS CAP plan is enabled.

      +

      The accumulative total number of MO SMS on a monthly basis.

      +

      33

      +

      CAP SMS Balance 1

      +

      It is available only when the SMS CAP plan is enabled.

      +

      The accumulative total charged balance for MO SMS on a monthly basis. Unit is the minimum currency unit.

      +

      34

      +

      CAP SMS Counter 1

      +

      It is available only when the SMS CAP plan is enabled.

      +

      The accumulative total number of MO SMS on a monthly basis.

      +

      35

      +

      CAP Call Balance 0

      +

      It is available only when the call CAP plan is enabled.

      +

      The accumulative total charged balance for MO calls on a monthly basis. Unit is the minimum currency unit.

      +

      36

      +

      CAP Call Duration 0

      +

      It is available only when the call CAP plan is enabled.

      +

      The accumulative total duration of MO calls on a monthly basis. Unit is second.

      +

      37

      +

      CAP Call Balance 1

      +

      It is available only when the call CAP plan is enabled.

      +

      The accumulative total charged balance for MO calls on a monthly basis. Unit is the minimum currency unit.

      +

      38

      +

      CAP Call Duration 1

      +

      It is available only when the call CAP plan is enabled.

      +

      The accumulative total duration of MO calls on a monthly basis. Unit is second.

      +

      39*

      +

      Free SMS Remaining Days

      +

      The remaining effective days for activated free SMS service.

      +

      40

      +

      Pool Account Type

      +

      Indicate the status and role of pool account service.

      +

      •Normal = This account has not applied for pool account service.

      •Parent = This account has applied for pool account service, and he performs as parent account.

      •Child = This account has been registered to pool account service, and he performs as child account.

      41*

      +

      Child Account Counter

      +

      It is applicable only to parent account. Quantity of set child accounts.

      +

      •0=No child account is set

      42*

      +

      Child Number Edit Counter

      +

      (Read Only) It is applicable only to parent account.

      +

      Indicate the total number of changes to his child account numbers. The counter is accumulative and the maximum value is 255. Operator can preset allowable number of free changes per day.

      +

      43

      +

      Child Number 1

      +

      It is applicable only to parent account.

      +

      Set up to five child account numbers. Parent account user may set child number by dialing to service number. Calls made between parent account and  his child accounts are charged by the Pool Account tariff.

      +

      44

      +

      Child Number 2

      +

      45

      +

      Child Number 3

      +

      46

      +

      Child Number 4

      +

      47

      +

      Child Number 5

      +

      48

      +

      Parent Number

      +

      It is applicable only to child account. Indicate his parent account number.

      +

      49

      +

      Intraday Calls

      +

      The accumulative total duration of today's MO calls.

      +

      50

      +

      Intraday SMS

      +

      The accumulative total number of today's MO SMS.

      +

      51

      +

      Intraday Charged Balance

      +

      The accumulative total charged balance for today's services.

      +

      52

      +

      CAP GPRS Volume

      +

      It is available only when the GPRS CAP plan is enabled.

      +

      The accumulative data volume of GPRS service on a monthly basis. Unit is KB.

      +

      53

      +

      CAP GPRS Balance

      +

      The accumulative total charged balance for GPRS service on a monthly basis. Unit is minimum currency unit.

      +

      54

      +

      GPRS Volume of This Month

      +

      The accumulative total data volume of GPRS service of this month. Unit is KB.

      +

      55

      +

      Intraday GPRS Notification Counter

      +

      The accumulative number of GPRS notification short messages on a daily basis.

      +

      56

      +

      Call Me Back Request Counter

      +

      Indicate the total number of happened call me back service requests. The counter is accumulative and the maximum value is 255. Operator can preset allowable number of call me back request.

      +

      57

      +

      F&F Number Plan ID

      +

      Specify a F&F Number plan to this account.

      +

      •0 = No F&F Number Plan applied

      58

      +

      F&F Number Free Call Duration

      +

      The accumulative total duration of F&F Number free calls on a monthly basis.

      +

      59

      +

      F&F Number Free SMS

      +

      The accumulative total number of F&F Number free SMS on a monthly basis.

      +

      60

      +

      F&F Number Plan State

      +

      The current status of the F&F Number plan.

      +

      Note:

      +

      The * marked parameters are read-only in EMS >Account, which can be maintained in EMS >Advanced > Subscriber >PPS.

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_3_02

      +

       

      +

      1.Click the Advanced main menu.

       

      +

      2.Select PPS under the Subscriber submenu.

       

      +

      3.Click the MSISDN of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.Under the Value heading, modify the values of the subscriber parameters as required, select the 2_026 button at the front.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload the new values to PPS servers.

       

      +

      6.Click the 2_019 button at the top of the parameter table to update values from PPS servers.

       

      +

      7.Verify that the new values have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_3_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select PPS under the Subscriber submenu.

       

      +

      3.Click the MSISDN of the subscriber want to delete, this displays the subscriber parameter window.

       

      +

      4.Click the 2_021 button at the top of the parameter table to delete this subscriber from PPS servers.

       

      +

      5.Click 2_014 to upload PPS subscribers from PPS to EMS database.

       

      +

      6.Verify the subscriber has been deleted from PPS.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_3_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select PPS under the Subscriber submenu.

       

      +

      3.Click 2_022 at the upper-right corner.

       

      +

      4.Enter the number of subscribers want to create in the Batch Amount box, a maximum of 100 subscribers in a batch.

       

      +

      5.Fill in the start MSISDN.

       

      +

      6.Fill in the required initialization parameters for the batch of subscribers.

       

      +

      7.Click 2_025 at the top of the parameter table to create these subscribers in PPS.

       

      +

      8.Click 2_014 to upload PPS subscribers from PPS to EMS database.

       

      +

      2_2_1_3_02

      +

       

      +

      The same operation can be done in EMS >Advanced >Subscriber >PPS to maintain credit related parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_3_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select PPS under the Subscriber submenu.

       

      +

      3.Click 2_014 to upload PPS subscribers from PPS to EMS database.

       

      +

      2_2_1_3_03

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu.

       

      +

      3.In the right Account Data window, click Download following PPSSubscriber to download subscriber file.

       

      +

      4.In the windows pop-up window, click the Save button.

       

      +

      5.Select a location on the local PC to save the csv file and click the Save button.

       

      +

      6.Find and verify the downloaded file on the local PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Create a PPS Subscriber with the required initialization parameters according to the previous section.

       

      +

      2.Click 2_030 instead of 2_025 at the last step.

       

      +

      3.Export PPS Subscribers according to the previous section.

       

      +

      4.Open the downloaded csv file by a text editor (UltraEdit is recommended).

       

      +

      5.Find the line of the new created subscriber in the file, replicate it to a new file.

       

      +

      6.Replicate this line to reach the numbers of subscribers want to import, a maximum of 5000 lines (subscribers) in a single file.

       

      +

      7.Find the MSISDN column, modify all of them as required, save the file in a local directory.

       

      +

      2_2_1_3_01

      +

       

      +

      1.Click the Account main menu, select PPS under the Subscriber submenu.

       

      +

      2.Click 2_023 at the upper-right corner, select the saved file in the local directory, click 2_024 to upload the subscribers to  PPS servers.

       

      +

      3.Click 2_014 to upload PPS subscribers from PPS to EMS database.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.3

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_3_01.gif b/wxc2_omc/omcHelp/2_2_1_3_01.gif new file mode 100755 index 0000000..3f4eb89 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_3_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_3_02.gif b/wxc2_omc/omcHelp/2_2_1_3_02.gif new file mode 100755 index 0000000..dd51b53 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_3_02.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_3_03.gif b/wxc2_omc/omcHelp/2_2_1_3_03.gif new file mode 100755 index 0000000..a8c4d28 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_3_03.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_4.htm b/wxc2_omc/omcHelp/2_2_1_4.htm new file mode 100755 index 0000000..56eab26 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_4.htm @@ -0,0 +1,162 @@ +锘� + + + AUC Subscriber + + + + + + + + + + + + + + + + + + + + +
      +

      AUC Subscriber

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The AUC stores authentication subscriber information in the local switch. The authentication subscriber information includes the International Mobile Subscriber Identity (IMSI), A3A8 version and Ki of the SIMs.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Create a new text file by a text editor (UltraEdit is recommended).

       

      +

      2.Fill the file with three columns: IMSI (15-digit), Ki (32-digit), A3A8 Version (1-digit).

       

      +

      For example:

      +

      460029000000042,AAA63731CA7ECABC2DB55EDB9B586690,2

      +

      460029000000043,E9F11B422E718C8FC73C84327FA72237,2

      +

      ......

      +

       

      +

      3.Save the file in a local directory.

       

      +

      2_2_1_4_01

      +

       

      +

      1.Click the Advanced main menu, select AUC under the Subscriber submenu.

       

      +

      2.Click 2_023 at the upper-right corner, select the saved file in the local directory.

       

      +

      3.Enable K4 Flag, enter K4 value in the lower K4 box. or set K4 Flag to disable.

       

      +

      4.click 2_024 to upload the subscribers to  AUC servers.

       

      +

      5.Click 2_014 to upload AUC subscribers from AUC to EMS database.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_4_02

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select AUC under the Subscriber submenu.

       

      +

      3.Click the IMSI of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.Select A3A8 version from the drop-down menu.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload the new A3A8 version to AUC servers.

       

      +

      6.Click the 2_019 button at the top of the parameter table to update values from AUC servers.

       

      +

      7.Verify that the new A3A8 version has been saved for the AUC subscriber.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0

      +

      IMSI

      +

      International mobile subscriber identity, IMSI=MCC+MNC+MSIN

      +

      1

      +

      A3A8 Version

      +

      Version of used A3A8 algorithm

      +

      2

      +

      Service State

      +

      The current status of this AUC subscriber:

      +

      •Inactive = Waiting for authentication

      •Active = Authentication passed

      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_4_02

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select AUC under the Subscriber submenu.

       

      +

      3.Click the IMSI of the subscriber want to delete, this displays the parameter window.

       

      +

      4.Click the 2_021 button at the top of the parameter table to delete this subscriber from AUC servers.

       

      +

      5.Click 2_014 to upload AUC subscribers from AUC to EMS database.

       

      +

      6.Verify the subscriber has been deleted from AUC.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.4

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_4_01.gif b/wxc2_omc/omcHelp/2_2_1_4_01.gif new file mode 100755 index 0000000..912495c Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_4_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_4_02.gif b/wxc2_omc/omcHelp/2_2_1_4_02.gif new file mode 100755 index 0000000..93ce602 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_4_02.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_5.htm b/wxc2_omc/omcHelp/2_2_1_5.htm new file mode 100755 index 0000000..4dca9dc --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_5.htm @@ -0,0 +1,197 @@ +锘� + + + EIR Subscriber + + + + + + + + + + + + + + + + + + + + +
      +

      EIR Subscriber

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Equipment Identity Register stores the International Mobile Equipment Identity (IMEI) in the local switch. The EIR subscriber information includes the IMEI and service status.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_2_1_5_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select EIR under the Subscriber submenu.

       

      +

      3.Click 2_017 at the upper-right corner.

       

      +

      4.Fill in the IMEI (inquire by dialing the sequence *#06# into the phone) and service status for this subscriber.

       

      +

      5.Click 2_027 at the top of the parameter table to create this subscriber in EIR servers.

       

      +
      + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0

      +

      IMEI

      +

      International mobile station equipment identity and software version Number (IMEISV), as defined in TS GSM 03.03, is a 16-digit decimal number composed of four distinct elements:

      +

      •6-digit Type Approval Code (TAC)

      •2-digit Final Assembly Code (FAC)

      •6-digit Serial Number (SNR)

      •2-digit Software Version Number (SVN)

      1

      +

      Service Status

      +

      The ME has the following three states:

      +

      •Black-listed = It contains all equipment identities that belong to equipment that need to be barred

      •Grey-listed = Equipment on the grey list is not barred (unless on the black list or not on the white list), but are tracked by the network (for evaluation or other purposes)

      Note:

      +

      The EIR only stores the MEs that have the Blacklisted or Grey-listed state, the White-listed MEs is defined by the system parameter.

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_5_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select EIR under the Subscriber submenu.

       

      +

      3.Click the IMEI of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.Choose the service status of this subscriber as required.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload parameters to EIR servers.

       

      +

      6.Click the 2_019 button at the top of the parameter table to update parameters from EIR servers.

       

      +

      7.Verify that the service status have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_5_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select EIR under the Subscriber submenu.

       

      +

      3.Click the IMEI of the subscriber want to delete, this displays the parameter window.

       

      +

      4.Click the 2_021 button at the top of the parameter table to delete this subscriber from EIR servers.

       

      +

      5.Click 2_014 to upload HLR subscribers from EIR to EMS database.

       

      +

      6.Verify the subscriber has been deleted from EIR.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_5_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select EIR under the Subscriber submenu.

       

      +

      3.Click 2_014 to upload EIR subscribers from EIR to EMS database.

       

      +

      2_2_1_5_02

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu.

       

      +

      3.In the right Account Data window, click Download following EIRSubscriber to download subscriber file.

       

      +

      4.In the windows pop-up window, click the Save button.

       

      +

      5.Select a location on the local PC to save the csv file and click the Save button.

       

      +

      6.Find and verify the downloaded file on the local PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Create a new text file by a text editor (UltraEdit is recommended).

       

      +

      2.Fill the file with two columns: IMEI (16-digit), Service Status (1=Blacklisted, 2=Greylisted).

       

      +

      For example:

      +

      3572670000771190,2

      +

      4492428163411400,1

      +

      ......

      +

       

      +

      3.Save the file in a local directory.

       

      +

      2_2_1_5_01

      +

       

      +

      1.Click the Account main menu, select EIR under the Subscriber submenu.

       

      +

      2.Click 2_023 at the upper-right corner, select the saved file in the local directory.

       

      +

      3.Click 2_024 to upload the subscribers to EIR servers.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.5

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_5_01.gif b/wxc2_omc/omcHelp/2_2_1_5_01.gif new file mode 100755 index 0000000..118ff1a Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_5_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_5_02.gif b/wxc2_omc/omcHelp/2_2_1_5_02.gif new file mode 100755 index 0000000..8d88d6a Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_5_02.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_6.htm b/wxc2_omc/omcHelp/2_2_1_6.htm new file mode 100755 index 0000000..f257f42 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_6.htm @@ -0,0 +1,293 @@ +锘� + + + VMS Subscriber + + + + + + + + + + + + + + + + + + + + +
      +

      VMS Subscriber

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Voice Mail Servers store voice mail subscriber information, including MSISDN, subscriber status and mailbox setting.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_2_1_6_01

      +

       

      +

      1.Click the Configuration main menu.

       

      +

      2.Select VSS under the Subscriber submenu.

       

      +

      3.Select the proper VSS from the upper Select System drop-down menu.

       

      +

      4.Click 2_017 at the upper-right corner.

       

      +

      5.Fill in the parameter details for this subscriber, select Register Flag box under Status.

       

      +

      6.Click 2_029 at the top of the parameter table to create this subscriber in VSS.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0*

      +

      System ID

      +

      Read Only

      +

      1

      +

      Mailbox Index

      +

      Read Only. Mail box number of this subscriber

      +

      2

      +

      MSISDN

      +

      VMS subscriber telephone number

      +

      3

      +

      Status

      +

      •Register = Service provisioned

      •Active = Service provisioned and activated

      •Locked = Temporarily service suspended (Read-only)

      4

      +

      Language

      +

      Select a language from five active language for greetings.

      +

      5

      +

      Greeting

      +

      Select a kind of greeting to play for dial-in call, selective greeting includes system, host name, personal and temporary greetings

      +

      6*

      +

      Option Flag

      +

      •Password Flag = To validate access password or not.

      •CLI Flag = A caller is forwarded to the mailbox but leave no message, the VMS sends a short message to the mailbox host indicating the caller number or not.

      7

      +

      Password

      +

      4-digit password, default is 0000

      +

      8*

      +

      Callback Timeout

      +

      --

      +

      9*

      +

      Message 0

      +

      Read Only

      +

      ...

      +

      ...

      +

      ...

      +

      23*

      +

      Message 14

      +

      Read Only

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_6_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select VSS under the Subscriber submenu.

       

      +

      3.Select the proper VSS from the upper Select System drop-down menu.

       

      +

      4.Click the MSISDN of the subscriber want to edit, this displays the editable parameter window.

       

      +

      5.Under the Value heading, modify the values of the subscriber parameters as required.

       

      +

      6.Click 2_020 button at the top of the parameter table to upload the new values to the VSS.

       

      +

      7.Click 2_019 button at the top of the parameter table to update values from the VSS.

       

      +

      8.Verify that the new values have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_6_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select VSS under the Subscriber submenu.

       

      +

      3.Select the proper VSS from the upper Select System drop-down menu.

       

      +

      4.Click the MSISDN of the subscriber want to delete, this displays the parameter window.

       

      +

      5.Click the 2_021 button at the top of the parameter table to delete this subscriber from the VSS.

       

      +

      6.Click 2_014 to upload VMS subscribers from this VSS to EMS database.

       

      +

      7.Verify the subscriber has been deleted from the VSS.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_6_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select VSS under the Subscriber submenu.

       

      +

      3.Select the proper VSS from the upper Select System drop-down menu.

       

      +

      4.Click 2_022 at the upper-right corner.

       

      +

      5.Enter the number of subscribers want to create in the Batch Amount box, a maximum of 100 subscribers in a batch.

       

      +

      6.Fill in the start MSISDN and the required initialization parameters for the batch of subscribers.

       

      +

      7.Click 2_029 at the top of the parameter table to create these subscribers in VSS.

       

      +

      8.Click 2_014 to upload VMS subscribers from VSS to EMS database.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_6_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select VSS under the Subscriber submenu.

       

      +

      3.Select the proper VSS from the upper Select System drop-down menu.

       

      +

      4.Click 2_014 to upload VMS subscribers from VSS to EMS database.

       

      +

      2_2_1_6_02

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu.

       

      +

      3.In the right Account Data window, click Download following VSS_xSubscriber (x is the VSS index number) to download subscriber file.

       

      +

      4.In the windows pop-up window, click the Save button.

       

      +

      5.Select a location on the local PC to save the csv file and click the Save button.

       

      +

      6.Find and verify the downloaded file on the local PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Create a VMS Subscriber with the required initialization parameters according to the previous section, click 2_030 instead of 2_029 at the last step.

       

      +

      2.Export VMS Subscribers according to the previous section.

       

      +

      3.Open the downloaded csv file by a text editor (UltraEdit is recommended).

       

      +

      4.Find the line of the new created subscriber in the file, replicate it to a new file.

       

      +

      5.Replicate this line to reach the numbers of subscribers want to import, a maximum of 5000 lines (subscribers) in a single file.

       

      +

      6.Find the MSISDN columns, modify all of them as required, save the file in a local directory.

       

      +

      2_2_1_6_03

      +

       

      +

      1.Click the Advanced main menu, select VSS under the Subscriber submenu.

       

      +

      2.Select the proper VSS from the upper Select System drop-down menu.

       

      +

      3.Click 2_023 at the upper-right corner, select the saved file in the local directory, click 2_024 to upload the subscribers to the VSS.

       

      +

      4.Click 2_014 to upload VMS subscribers from the VSS to EMS database.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.6

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_6_01.gif b/wxc2_omc/omcHelp/2_2_1_6_01.gif new file mode 100755 index 0000000..3284e18 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_6_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_6_02.gif b/wxc2_omc/omcHelp/2_2_1_6_02.gif new file mode 100755 index 0000000..a2854e8 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_6_02.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_6_03.gif b/wxc2_omc/omcHelp/2_2_1_6_03.gif new file mode 100755 index 0000000..9326a9a Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_6_03.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_7.htm b/wxc2_omc/omcHelp/2_2_1_7.htm new file mode 100755 index 0000000..bc84bae --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_7.htm @@ -0,0 +1,222 @@ +锘� + + + MNP Subscriber + + + + + + + + + + + + + + + + + + + + +
      +

      MNP Subscriber

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Mobile Number Portability (MNP) is the ability for a mobile subscriber to change the GSM subscription network within a portability domain whilst retaining his original MSISDN. The Number Portability Database stores mobile subscriber information in the local switch. The subscriber information includes the MSISDN, routing number, subscriber status, donor and recipient network information.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_2_1_7_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select MNP under the Subscriber submenu.

       

      +

      3.Click 2_017 at the upper-right corner.

       

      +

      4.Fill in the parameter details for this subscriber.

       

      +

      5.Click 2_031 at the top of the parameter table to create this subscriber in MNP database.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0

      +

      MSISDN

      +

      Enter the MSISDN of the new subscriber

      +

      1

      +

      Routing Number

      +

      1 to 8 digits routing number.

      +

      2

      +

      Status

      +

      Subscriber status:

      +

      •Own ported out = The donor network is local network.

      •Foreign ported in = The recipient network is local network.

      •Foreign ported to the third = Neither donor nor recipient network are local network.

      3

      +

      Donor

      +

      The number of the donor network.

      +

      4

      +

      Recipient

      +

      The number of the recipient network.

      +

      5

      +

      Date

      +

      Ported date, the format is yyyymmdd.

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_7_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select MNP under the Subscriber submenu.

       

      +

      3.Click the MSISDN of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.Under the Value heading, modify the values of the subscriber parameters as required.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload the new values to MNP databases.

       

      +

      6.Click the 2_019 button at the top of the parameter table to update values from MNP database.

       

      +

      7.Verify that the new values have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_7_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select MNP under the Subscriber submenu.

       

      +

      3.Click the MSISDN of the subscriber want to delete, this displays the subscriber parameter window.

       

      +

      4.Click the 2_021 button at the top of the parameter table to delete this subscriber from MNP databases.

       

      +

      5.Click 2_014 to upload MNP subscribers from MNP database to EMS.

       

      +

      6.Verify the subscriber has been deleted from the database.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_7_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select MNP under the Subscriber submenu.

       

      +

      3.Click 2_014 to upload MNP subscribers from MNP to EMS database.

       

      +

      2_2_1_7_02

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu.

       

      +

      3.In the right Account Data window, click Download following MNPSubscriber to download subscriber file.

       

      +

      4.In the windows pop-up window, click the Save button.

       

      +

      5.Select a location on the local PC to save the csv file and click the Save button.

       

      +

      6.Find and verify the downloaded file on the local PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Create a MNP Subscriber with the required initialization parameters according to the previous section, click 2_030 instead of 2_031 at the last step.

       

      +

      2.Export MNP Subscribers according to the previous section.

       

      +

      3.Open the downloaded csv file by a text editor (UltraEdit is recommended).

       

      +

      4.Find the line of the new created subscriber in the file, replicate it to a new file.

       

      +

      5.Replicate this line to reach the numbers of subscribers want to import, a maximum of 5000 lines (subscribers) in a single file.

       

      +

      6.Find the MSISDN columns, modify all of them as required, save the file in a local directory.

       

      +

      2_2_1_7_01

      +

       

      +

      1.Click the Account main menu, select MNP under the Subscriber submenu.

       

      +

      2.Click 2_023 at the upper-right corner, select the saved file in the local directory, click 2_024 to upload the subscribers to the MNP databases.

       

      +

      3.Click 2_014 to upload MNP subscribers from the MNP to EMS database.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.7

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_7_01.gif b/wxc2_omc/omcHelp/2_2_1_7_01.gif new file mode 100755 index 0000000..01e410a Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_7_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_7_02.gif b/wxc2_omc/omcHelp/2_2_1_7_02.gif new file mode 100755 index 0000000..f199c40 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_7_02.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_8.htm b/wxc2_omc/omcHelp/2_2_1_8.htm new file mode 100755 index 0000000..54a8c36 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_8.htm @@ -0,0 +1,232 @@ +锘� + + + OPPS Subscriber + + + + + + + + + + + + + + + + + + + + +
      +

      OPPS Subscriber

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The IMDX and OPR share the same OPPS subscriber database. The IMDX and OPR user are mutual exclusive: a user can either be an IMDX subscriber or an OPR subscriber. Users without account in the OPPS subscriber database are public users. they can鈥檛 achieve the IMDX and OPR services.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_2_1_8_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select OPPS under the Subscriber submenu.

       

      +

      3.Click 2_017 at the upper-right corner.

       

      +

      4.Fill in the parameters listed in the following table.

       

      +

      5.Click 2_044 at the top of the parameter table to create this subscriber in OPPS.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0

      +

      MSISDN

      +

      The local phone number of OPPS subscriber: It consists of three parts:

      +

      •CC = Country Code

      •NDC = National Destination Code

      •SN = Subscriber Number

      This parameter is unchangeable after account created.

      +

      1

      +

      IMSI

      +

      An IMSI consists of 15 digits in the format: MCC+MNC+MSIN, where:

      +

      •MCC = mobile country code (3 digits)

      •MNC = mobile network code (2 digits)

      •MSIN = mobile subscriber identification number

      When creating fresh OPR subscribers, this field can be left as idle.

      +

      2

      +

      IMEI

      +

      The international mobile station equipment identity (IMEI) uniquely identifies a mobile station internationally. It is a kind of serial number allocated by the equipment manufacturer.

      +

      This field is for OPR user only. When creating fresh OPR subscribers, this field can be left as idle.

      +

      3

      +

      User Status

      +

      This field indicates the type of the OPPS subscriber:

      +

      •OPR Not in Use (Fresh) = Initial status of a new created or imported OPR account. Only the Fresh MSISDN can be allocated to an auto-registered subscriber.

      •OPR in Use: without roaming agreement = OPR subscriber is from PLMN without roaming agreement.

      •OPR in Use: with roaming agreement (OPR) = OPR subscriber is from PLMN with roaming agreement. Its current application status is switched to OPR mode.

      •OPR in Use: with roaming agreement (roaming) = OPR subscriber is from PLMN with roaming agreement. Its current application status is switched to roaming mode.

      •IMDX Private Ordinary = IMDX private subscriber with default privileges to make private calls only

      •IMDX Private Premium = IMDX private subscriber with higher privilege to make both private and public calls

      •IMDX Hybrid = IMDX hybrid subscriber

      4

      +

      Class

      +

      This field indicates the class of MSISDN for auto-registration. Only the Ordinary MSISDN is applicable for auto-registration.

      +

      •Ordinary = MSISDN is ready for auto-registration.

      •Premium = MSISDN is reserved for manual-registration.

      •VIP = MSISDN is reserved for manual-registration.

      5

      +

      User Type

      +

      This field indicates the user type of the subscriber.

      +

      •OPPS = OPPS subscriber

      •iPALIM = iPALIM subscriber

      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_8_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select OPPS under the Subscriber submenu.

       

      +

      3.Click the MSISDN of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.Under the Value heading, modify the values of the subscriber parameters as required.

       

      +

      5.Click 2_020 button at the top of the parameter table to upload the new values to the OPPS.

       

      +

      6.Click 2_019 button at the top of the parameter table to update values from the OPPS.

       

      +

      7.Verify that the new values have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_8_01

      +

       

      +

      1.Click the Configuration main menu.

       

      +

      2.Select OPPS under the Subscriber submenu.

       

      +

      3.Click the MSISDN of the subscriber want to delete, this displays the parameter window.

       

      +

      4.Click the 2_021 button at the top of the parameter table to delete this subscriber from the OPPS.

       

      +

      5.Click 2_014 to upload OPPS subscribers from OPPS to EMS database.

       

      +

      6.Verify the subscriber has been deleted.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_8_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select OPPS under the Subscriber submenu.

       

      +

      3.Click 2_014 to upload OPPS subscribers from OPPS to EMS database.

       

      +

      2_2_1_8_02

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu.

       

      +

      3.In the right Account Data window, click Download following OPPSSubscriber to download subscriber file.

       

      +

      4.In the windows pop-up window, click the Save button.

       

      +

      5.Select a location on the local PC to save the csv file and click the Save button.

       

      +

      6.Find and verify the downloaded file on the local PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Create a new text file by a text editor (UltraEdit is recommended).

       

      +

      2.Fill the file with three columns: MSISDN (6-16 digits), IMSI (15 digits), IMEI (15 digits), User Type (1 digit).

       

      +

      For example:

      +

      86755900042,460029000000042,,5,0

      +

      86755900043,,,0,2

      +

      86755900044,,,0,0

      +

      ......

      +

      # When creating IMDX subscriber, the IMEI field should be left as Idle.

      +

      # When creating fresh OPR subscriber, the IMSI and IMEI fields should be left as Idle.

      +

      # The 3rd subscriber is a sample for auto-registration: User Type = Fresh, Class = Ordinary.

      +

       

      +

      3.Save the file in a local directory.

       

      +

      2_2_1_8_01

      +

       

      +

      1.Click the Configuration main menu, select OPPS under the Subscriber submenu.

       

      +

      2.Click 2_023 at the upper-right corner, select the saved file in the local directory.

       

      +

      3.click 2_024 to upload the subscribers to  OPPS servers.

       

      +

      4.Click 2_014 to upload OPPS subscribers from OPPS to EMS database.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.8

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_8_01.gif b/wxc2_omc/omcHelp/2_2_1_8_01.gif new file mode 100755 index 0000000..b348093 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_8_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_8_02.gif b/wxc2_omc/omcHelp/2_2_1_8_02.gif new file mode 100755 index 0000000..5a602d2 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_8_02.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_9.htm b/wxc2_omc/omcHelp/2_2_1_9.htm new file mode 100755 index 0000000..d62963f --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_1_9.htm @@ -0,0 +1,261 @@ +锘� + + + iPALIM Subscriber + + + + + + + + + + + + + + + + + + + + +
      +

      iPALIM Subscriber

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      There are three types of users defined for the iPALIM. They fall into the categories of 鈥減rivate鈥�, 鈥減ublic鈥�, and 鈥渉ybrid鈥� users. Each user is served by either the IRO or by the PLMN, depending on the nature of call and user classification. The 鈥渟erving鈥� entity provides basic GSM services: originating and terminating calls, mobility management, subscriber authentication, supplementary services, etc. On top of the basic GSM services, IRO also provides iPALIM advance functions designed specifically for iPALIM users.

      +

       

      +

      iPALIM holds an iPALIM User List. The iPALIM user list is a list of IMSI and iPALIM user type. If a user with his IMSI in the iPALIM list then he is an iPALIM user, either Private or Hybrid, or else he is a Public user. Any users with their IMSI not in the iPALIM User List are Public users.

      +

       

      +

       

      +
      + + + +

      Public user is serviced by the PLMN MSC only, and the IRO behaves like a BSC for all transactions. Subscription data of Public users are in the PLMN HLR. Public user鈥檚 MSISDN is given by the PLMN operator. Public User only registers to the PLMN HLR, and his subscription data is inserted into PLMN VLR.

      +

       

      +
      +
      +

       

      +
      + + + +

      Private user is known to a single IRO and is not recognized by the PLMN. They are served by a single IRO only. Subscription data of Private user is in the HLR of the IRO where the Private user will get service. Private user only registers to the IRO HLR and his MSISDN is given by the IRO.

      +

       

      +
      +
      +

       

      +
      + + + +

      Hybrid user is a user type between the Public and Private user. They can be served by the PLMN and the IRO. Hybrid user has two sets of subscription data, one is in the PLMN HLR and another one is in the IRO HLR where he will get service. Hybrid user has dual MSISDN, one from PLMN (public) and another one from IRO (private). Hybrid user registers to both the PLMN and IRO. In case the A-interface connection between the IRO iPALIM and the PLMN was broken then the Hybrid User will only get local IRO service.

      +

       

      +

      2_2_1_9_01

      +

       

      +
      +
      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_2_1_9_02

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select iPALIM under the Subscriber submenu.

       

      +

      3.Click 2_017 at the upper-right corner.

       

      +

      4.Fill in the parameter details for this subscriber.

       

      +

      5.Click 2_045 at the top of the parameter table to create this subscriber in iPALIM servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      0

      +

      IMSI

      +

      An IMSI consists of 15 digits in the format: MCC+MNC+MSIN, where:

      +

      •MCC = Mobile Country Code (3 digits)

      •MNC = Mobile Network Code (2 digits)

      •MSIN = Mobile Subscriber Identification Number

      1

      +

      MSISDN Public

      +

      The PLMN phone number of public iPALIM subscriber:

      +

      The PLMN phone number of iPALIM subscriber consists of three parts:

      +

      •CC = Country Code

      •NDC = National Destination Code

      •SN = Subscriber Number

      This number is unchangeable after account created.

      +

      2

      +

      MSISDN Private

      +

      The local phone number of private iPALIM subscriber:

      +

      •CC = Country Code

      •NDC = National Destination Code

      •SN = Subscriber Number

      3

      +

      TMSI

      +

      (Read only) Temporary Mobile Station Identity of the iPALIM subscriber.

      +

      4

      +

      LAI (MCC+MNC+LAC+CI)

      +

      (Read only) Location info of the iPALIM subscriber:

      +

      •MCC = Mobile Country Code

      •MNC = Mobile Network Code

      •LAC = Location Area Code

      •CI = Cell ID

      5

      +

      User Type

      +

      This field indicates the type of the iPALIM subscriber:

      +

      •Private = Subscriber with privileges to apply private services only.

      •Public = Subscriber with privileges to apply public services only.

      •Hybrid = Subscriber with privileges to apply both private and public services.

      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_9_02

      +

       

      +

      1.Click the Configuration main menu.

       

      +

      2.Select iPALIM under the Subscriber submenu.

       

      +

      3.Click the IMSI of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.Under the Value heading, modify the values of the subscriber parameters as required.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload the new values to iPALIM servers.

       

      +

      6.Click the 2_019 button at the top of the parameter table to update values from iPALIM servers.

       

      +

      7.Verify that the new values have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_9_02

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select iPALIM under the Subscriber submenu.

       

      +

      3.Click the IMSI of the subscriber want to delete, this displays the subscriber parameter window.

       

      +

      4.Click the 2_021 button at the top of the parameter table to delete this subscriber from iPALIM servers.

       

      +

      5.Click 2_014 to upload iPALIM subscribers from iPALIM to EMS database.

       

      +

      6.Verify the subscriber has been deleted from iPALIM.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_9_02

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select iPALIM under the Subscriber submenu.

       

      +

      3.Click 2_014 to upload iPALIM subscribers from iPALIM to EMS database.

       

      +

      2_2_1_9_03

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu.

       

      +

      3.In the right Account Data window, click Download following iPALIMSubscriber to download subscriber file.

       

      +

      4.In the windows pop-up window, click the Save button.

       

      +

      5.Select a location on the local PC to save the csv file and click the Save button.

       

      +

      6.Find and verify the downloaded file on the local PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Create an iPALIM Subscriber with the required initialization parameters according to the previous section, click 2_030 instead of 2_045 at the last step.

       

      +

      2.Export iPALIM Subscribers according to the previous section.

       

      +

      3.Open the downloaded csv file by a text editor (UltraEdit is recommended).

       

      +

      4.Find the line of the new created subscriber in the file, replicate it to a new file.

       

      +

      5.Replicate this line to reach the numbers of subscribers want to import, a maximum of 5000 lines (subscribers) in a single file.

       

      +

      6.Find the IMSI and MSISDN columns, modify all of them as required, save the file in a local directory.

       

      +

      2_2_1_9_02

      +

       

      +

      1.Click the Account main menu, select iPALIM under the Subscriber submenu.

       

      +

      2.Click 2_023 at the upper-right corner, select the saved file in the local directory, click 2_024 to upload the subscribers to iPALIM servers.

       

      +

      3.Click 2_014 to upload iPALIM subscribers from iPALIM to EMS database.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.1.9

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_1_9_01_zoom70.png b/wxc2_omc/omcHelp/2_2_1_9_01_zoom70.png new file mode 100755 index 0000000..01b3482 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_9_01_zoom70.png differ diff --git a/wxc2_omc/omcHelp/2_2_1_9_02.gif b/wxc2_omc/omcHelp/2_2_1_9_02.gif new file mode 100755 index 0000000..ac68d2d Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_9_02.gif differ diff --git a/wxc2_omc/omcHelp/2_2_1_9_03.gif b/wxc2_omc/omcHelp/2_2_1_9_03.gif new file mode 100755 index 0000000..3318f91 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_1_9_03.gif differ diff --git a/wxc2_omc/omcHelp/2_2_2.htm b/wxc2_omc/omcHelp/2_2_2.htm new file mode 100755 index 0000000..79e9f71 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_2.htm @@ -0,0 +1,137 @@ +锘� + + + Rechange Card + + + + + + + + + + + + + + + + + + + + +
      +

      Rechange Card

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Recharge cards, also known as recharge vouchers, scratch cards, and coupons, are used to recharge prepaid accounts. They are not related to any individual subscriber, and are not in any way suitable to be classified as part of the service data. Recharge card data records are simple and numerous.

      +

       

      +

      This recharge card page provides six fields of information for each recharge card: card number (key field), status, face value, expiry date, valid days, update time and charged telephone number. Each kind of information can be sorted in ascending or descending order by clicking its field name in the table head. The searching tool provides recharge card searching facility for a single card or a group of consecutive cards.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Recharge Card Info

      +

      Explanation

      +

      Card No.

      +

      The number of the recharge cards.

      +

      Status

      +

      After a card is used, the status of this card will turns to be charged.

      +

      •Fresh = Not charged

      •Used = Charged

      Face Value

      +

      Face value of the recharge card. System supports up to four kinds of face value.

      +

      Expiry Date

      +

      Fresh recharge card will be invalid after the expiration date.

      +

      Valid Days

      +

      The valid days for recharged amount of money after the recharge. After the valid day the recharged money will be overdue and can't be used any more.

      +

      Update Time

      +

      Generation date of the fresh card or recharge date of a recharged card.

      +

      MSISDN

      +

      The telephone number to which the recharge card is recharged.

      +
      +
      +

       

      +

      A total value statistics of the recharge card is provided on top of this page. Contained statistics information includes Total value, Not charged value, Charged value and Overdue value. Total value = Not charged value + Charged value + Overdue value.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_2_2_01

      +

       

      +

      1.Click the Account main menu.

       

      +

      2.Select Recharge Card under the submenu.

       

      +

      3.Click 2_023 at the upper-right corner.

       

      +

      4.Click the 2_032 button to select the recharge card file in the local PC.

       

      +

      5.Click 2_024 to upload the recharge card data to PPS database.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.2

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_2_01.gif b/wxc2_omc/omcHelp/2_2_2_01.gif new file mode 100755 index 0000000..f59ae59 Binary files /dev/null and b/wxc2_omc/omcHelp/2_2_2_01.gif differ diff --git a/wxc2_omc/omcHelp/2_2_3_1.htm b/wxc2_omc/omcHelp/2_2_3_1.htm new file mode 100755 index 0000000..012cb5f --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_3_1.htm @@ -0,0 +1,542 @@ +锘� + + + Current Tariff - MO + + + + + + + + + + + + + + + + + + + + +
      +

      Current Tariff - MO

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Calls are charged using tariffs. A tariff defines how much a call costs, in terms of money per time unit (seconds). For example, a simple tariff may be specified as 1 cent per second. Then, if a call lasts 120.00 seconds, it will be charged at $1.20.

      +

       

      +

      Tariffs are used to implement special promotional features as well, such as the Friends and Family and Close User Group feature.

      +

       

      +

      Within each tariff, it is possible to define the first billable unit (minimum charge unit, both in terms of length and cost) and basic billable units, which take place after the initial unit. Often, the first unit is longer (e.g. 60 seconds) and the basic units are shorter (e.g. 6 seconds). That way, a higher minimum charge can be guaranteed, even for very short calls (the first unit is always applied in full).

      +

       

      +

      The values for the initial and basic unit durations are recorded in seconds, and can be recorded to one decimal place (tenths). This allows for more accurate calculations. however, for billing purposes, durations are rounded up to the nearest second. For example, a call that lasts 118.2 seconds will also be charged at $1.19 even though it lasted less than 119 full units.

      +

       

      +

      The system supports multiple currency units. With the UltraWAVE prepaid service, a tariff is more than just a single rate of X currency units per Y seconds. Each tariff is defined with the following parameters:

      +

      •The currency of the tariff (for example, Dollars, Francs) - the system can use tariffs defined in multiple currency types.

      •The length of the first billable unit in seconds. This length must be at least 1 second.

      •The charge for the first billable unit (initial call period) in minor currency units.

      •The length of any basic billable units (basic call period) in seconds. This length must be at least 1 second.

      •The charge for any basic billable unit in minor currency units.

      •A no-charge length (grace period), which means that nothing is charged for a call that lasts less than or equal to that time length. For example, if the grace period is set to three seconds, then very short calls of two or three seconds will not be charged at all. Note that the call timer does not reset after the grace period.

      •A tariff modifier (promotion type, such as Friends and Family), which indicates how the tariff is used in conjunction with some of the more advanced billing features.

       

      +

       

      +

      •MO Basic Tariff

       

      +

      The MO basic tariff is destination sensitive billing rate applied for each dialed number prefix. It charges MO call according to different destination prefixes. The PPS supports 64 MO basic tariffs belonging to 64 MO tariffs. Each MO basic tariff may define billing rate for up to 300 dialing prefixes.

      +

       

      +

      There are ten basic fields included in a destination prefix based MO basic tariff. Each destination prefix has a MO basic tariff record.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      MO Basic Tariff

      +

      Explanation

      +

      1

      +

      Tariff ID

      +

      The PPS supports 64 basic tariffs. These 64 basic tariffs can be used for 256 tariff areas or 64 nodes which have different NDC. Each basic tariff is identified by a tariff ID ranging from 0 to 63.

      +

      2

      +

      Prefix

      +

      Charging prefix of destination.

      +

      3

      +

      Country/District

      +

      The country or district name of the charging prefix, only for reference.

      +

      4

      +

      Call Type

      +

      Call type for reference. It is also one field in the PPS CDR.

      +

      Total three call types: Local, NDD and IDD.

      +

      5

      +

      Discount ID

      +

      Set a discount table (0-31) for this prefix.

      +

      6

      +

      Charge Unit (s)

      +

      Time unit for debiting, unit is second. The minimum charge unit is 1 second.

      +

      For example: "6" indicates charging every six seconds.

      +

      7

      +

      Free Charge Unit

      +

      Set a free time period (grace period) for outgoing call. Unit is multiple of the charge-unit.

      +

      For example: if the charge-unit is 2 seconds, set free-charge-unit to 3, the PPS will begin to charge an outgoing call 6 (2x3) seconds after call connects.

      +

      8

      +

      Min Charge Unit

      +

      Define the minimum call period charging. This is for adjusting the minimum charge of a call at the initial period. Unit is multiple of the charge-unit.

      +

      For example: if the charge-unit is 2 seconds, set min-charge-unit is to 3, a less than 6 (2X3) seconds long call will be charged for 6 seconds.

      +

      Min-charge-unit = 1 means no minimum charge adjustment.

      +

      9

      +

      Initial Charge Adjustment

      +

      Amount value in the smallest currency unit. This amount will be added to the total call fee as an initial add-on charge adjustment of an outgoing call.

      +

      The value can be negative, zero, or positive.

      +

      10

      +

      CAP Flag

      +

      Enable or disable CAP call function on this prefix.

      +

      11

      +

      Tier Level

      +

      Define the operative tier cycle on this prefix.

      +

      •0 = Tier 0 cycle will be repeated till the end of call.

      •1 = Tier 0 and Tier 1 cycles will be repeated till the end of call.

      •2 = All three tier cycles will be repeated till the end of call.

      12

      +

      Tier 0 Units

      +

      Define the period of tier 0. Unit is multiple of the charge-unit.

      +

      For example: if the charge-unit is 6 seconds, and the Tier-0-Units is 10, the period of tier 1 is 60 (6x10) seconds. When this period ends, the next operative tier cycle will start.

      +

      13

      +

      Tier 0 Basic Fee

      +

      The tariff used to charge a call except the initial call period (basic call period), unit is minimum currency unit.

      +

      14

      +

      Tier 0 Long Distance

      +

      The extra charge for a national or international call. The unit is minimum currency unit.

      +

      15

      +

      Tier 1 Units

      +

      Define the period of tier 1. Unit is multiple of the charge-unit. When this period ends, the next operative tier cycle will start.

      +

      16

      +

      Tier 1 Basic Fee

      +

      The tariff used to charge a call except the initial call period (basic call period), unit is minimum currency unit.

      +

      17

      +

      Tier 1 Long Distance

      +

      The extra charge for a national or international call. The unit is minimum currency unit.

      +

      18

      +

      Tier 2 Units

      +

      Define the period of tier 2. Unit is multiple of the charge-unit. When this period ends, the next operative tier cycle will start.

      +

      19

      +

      Tier 2 Basic Fee

      +

      The tariff used to charge a call except the initial call period (basic call period), unit is minimum currency unit.

      +

      20

      +

      Tier 2 Long Distance

      +

      The extra charge for a national or international call. The unit is minimum currency unit.

      +
      +
      +

       

      +

      Each call period can be divided into three parts:

      +

       

      +

       

      +
      + + + +

      The free time period after the call is connected. Sometimes PSTN switch can't send out correct connection status, for example, it sends an answer message when the call begins ringing but not really answered. As soon as receive the answer message the system begins to charge the call. To compensate subscriber for the over payment, operator may set some free time.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      The initial call period is the minimum call duration of a call. The charge for the initial call period is also the minimum charge for a call.

      +

      •Charge for initial call period = [Minimum charging unit x (Basic fee + Long distance) + Initial charge adjustment] x discount

       

      +

       

      +
      +
      +

       

      +
      + + + +

      The basic call period is the call duration except the initial call period.

      +

      •Charge for basic call period = (Basic fee + Long distance) x ceil{[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)} x discount

       

      +

       

      +
      +
      +

      Call Charge = Charge for Initial Call Period + Charge for Basic Call Period

      +

       

      +

       

      +

      •Rent Tariff

       

      +

      The rent tariff is a rental charged on a fixed date or every period in a month. The PPS supports two basic kinds of rent: charge by date and charge by time. There are 64 rent tariffs belonging to 64 MO tariffs. Each rent tariff comprises 8 billing rates. Each billing rate can be charged on a daily basis or monthly basis, and the charge date can be selected for a monthly rent.

      +

       

      +

      The rent tariff is also used to charge the user who is registered to use the supplementary or value-added service such as short message, call forwarding, roaming and conference call, etc. The subscriber who requests service suspended because of temporary absent may be set as rental free.

      +

       

      +

       

      +

      •Short Message Tariff

       

      +

      The short message tariff charges MO short message according to the dialed number prefix. There are 64 short message tariffs in the 64 MO tariffs. Each short message tariff comprises 50 prefixes' setup. These flexible 50 prefixes may be prefixes of other operators' network, intra-network different service zone and service subscription such as weather forecast, financing report and so on. Operator may define different billing rates for different destination and service subscription. The prefix 1 is the default prefix. All calling prefixes not found in this table will be charged as the default prefix.

      +

       

      +

      For SMS cap call, select the destination from the drop-down menu. Otherwise keep Disable as default.

      +

       

      +

       

      +

      •GPRS Tariff

       

      +

      The GPRS tariff charges GPRS data volume according to the destination IP. There are 64 GPRS tariffs in the 64 MO tariffs. Total 8 fields are included in a destination IP based tariff:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      GPRS Tariff

      +

      Explanation

      +

      1

      +

      ID

      +

      Reserved as 1.

      +

      2

      +

      Destination IP

      +

      IP address of visited web. Reserved as 255.255.255.255.

      +

      3

      +

      Charge Unit (KB)

      +

      Time unit for debiting, unit is KB. The minimum charge unit is 1 KB.

      +

      For example: "10" indicates charging every 10 KB.

      +

      4

      +

      Basic Fee

      +

      This tariff is used to charge GPRS data volume except the initial period on a per charge unit basis. Unit is minimum currency unit.

      +

      5

      +

      Min Charge Unit

      +

      Define the minimum data volume charging. This is for adjusting the minimum charge at the initial period. Unit is multiple of the charge-unit.

      +

      For example: if the charge-unit is 10 KB, set min-charge-unit is to 100, a less than 1000 (10X100) KB data volume will be charged for 1000 KB.

      +

      Min-charge-unit = 1 means no minimum charge adjustment.

      +

      6

      +

      Initial Charge Adjustment

      +

      Amount value in the smallest currency unit. This amount will be added to the total charge fee as an initial add-on charge adjustment of GPRS service.

      +

      The value can be negative, zero, or positive.

      +

      7

      +

      CAP Flag

      +

      Enable or disable CAP service on this GPRS charging entry.

      +

      8

      +

      Discount ID

      +

      Set a discount table (0-31) for this GPRS charging entry.

      +
      +
      +

       

      +

       

      +

      •Supplementary Tariff

       

      +

      The supplementary features comprise:

      +

       

      +

       

      +
      + + + +

      Call forwarding allows subscribers to have their calls forwarded to another telephone number based on a variety of different circumstances. The prepaid service supports four basic types of call forwarding: unconditional, busy, unattainable and no answer. The billing for all types of call forwarding is defined based on COS at the same time; therefore, a subscriber cannot choose to set billing for a single call forwarding type.

      +

       

      +

      The MO call party is charged by the MO basic tariff.

      +

       

      +

      The MT call party is charged by the call forwarding tariff:

      +

      •Charge for initial call duration = Minimum charging unit x (Long distance + Call forward tariff) + Initial charge adjustment

      •Charge for call duration = (Long distance + Call forward tariff) x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)}

      •Forwarded call charge = (Charge for initial call duration + Charge for call duration) x discount

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Roaming calls are MO/MT calls outside the home location. The Roaming call tariff format is:

      +

      •MO roaming call charge = (Basic fee + Long distance + Roaming tariff) x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)} x discount

      •MT roaming call charge = Normal MT call charge + {[Long distance (home location) + Roaming tariff] x [Call duration (s) - free time (s)] / charging unit (s)} x discount

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Billing rate for conference call is used to charge conference applicant. Please note that as soon as the conference is reserved, the conference applicant will be charged at the scheduled conference beginning time.

      +

       

      +

      For conference participants, call charge is normal call charge (see MO basic tariff).

      +

       

      +

      For conference applicant, the call charge format is:

      +

      •Call charge = [normal call charge + conference call tariff x call duration (s) / charging unit (s)] x discount

       

      +

       

      +
      +
      +

       

      +
      + + + +

      The UltraWAVE supports the establishment of Closed User Groups (CUGs) within the carrier network. A CUG might represent members of a company or company department, a business or recreational organization, an affinity group who share a common interest, etc. The system supports 10,000 CUGs. There is no limit to the number of members who can belong to a Closed User Group. Calls among the same CUG members are charged by the CUG tariff:

      +

      •Charge for initial call duration = Minimum charging unit x CUG tariff+ Initial charge adjustment

      •Charge for call duration = CUG tariff x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)}

      •CUG call charge = (Charge for initial call duration + Charge for call duration) x discount

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Friends and Family (F&F) number service is a subscriber-incentive billing package that is provisioned in the supplementary tariff through the Class of Service. This feature allows subscribers to define up to five telephone numbers as their Friends and Family numbers. Then, when subscribers call any of their Friends and Family numbers, they are charged at the Friends and family tariff. Please note that the Friends and family tariff is not applicable for the MO-SMS transactions.

      +

       

      +

      The Friends and family call charge format is:

      +

      •Charge for initial call duration = Minimum charging unit x F&F tariff+ Initial charge adjustment

      •Charge for call duration = F&F tariff x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)}

      •F&F call charge = (Charge for initial call duration + Charge for call duration) x discount

       

      +

      Changing F&F number is charged according to the Changing Friends and Family Number tariff. Subscriber may have some preset free times to change his/her F&F number every day.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      The CF+CUG tariff charges the subscriber who forwards the call to a CUG subscriber. For example, if A calls B, and B forwards the call to the C. B and C belong to the same CUG. B will be charged according to the following formula:

      +

      •Charge for initial call period = Minimum charging unit x (CF+CUG tariff) + Initial charge adjustment

      •Charge for call duration = (CF+CUG tariff) x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)}

      •CF+CUG call charge = Charge for initial call period + Charge for call duration

       

      +

       

      +
      +
      +

       

      +
      + + + +

      The CF+F&F tariff charges the subscriber who forwards the incoming call to his F&F number. For A calls B, and B forwards the call to C. C is the F&F number of B. B will be charged according to the following formula:

      +

      •Charge for initial call period = Minimum charging unit x (CF+F&F tariff) + Initial charge adjustment

      •Charge for call duration = (CF+F&F tariff) x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)}

      •CF+F&F call charge = Charge for initial call period + Charge for call duration

       

      +

       

      +
      +
      +

       

      +
      + + + +

      When a subscriber calls his F&F number which belongs the same CUG as him, the subscriber will be charged by the CUG+F&F tariff:

      +

      •Charge for initial call period = Minimum charging unit x (CUG+F&F tariff) + Initial charge adjustment

      •Charge for call duration = (CUG+F&F tariff) x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)}

      •CUG+F&F call charge = Charge for initial call period + Charge for call duration

       

      +

       

      +
      +
      +

       

      +
      + + + +

      The CF+CUG+F&F tariff charges the subscriber who forwards the incoming call to his F&F number. And his F&F number belongs to the same CUG as him. For this circumstance, the subscriber will be charged according to:

      +

      •Charge for initial call period = Minimum charging unit x (CF+CUG+F&F tariff) + Initial charge adjustment

      •Charge for call duration = (CF+CUG+F&F tariff) x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)}

      •CF+CUG+F&F call charge = Charge for initial call period + Charge for call duration

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Parent and Children (P&C) number service is a subscriber-incentive billing package that is provisioned in the supplementary tariff through the Class of Service. This feature allows the parent account to define up to five prepaid user numbers as his/her child numbers. Then, when a call made between parent and child, it will be charged at the Parent and Children tariff. Please note that the Parent and Children tariff is not applicable for the MO-SMS transactions.

      +

       

      +

      The Parent and Children call charge format is:

      +

      •Charge for initial call duration = Minimum charging unit x P&C tariff+ Initial charge adjustment

      •Charge for call duration = P&C tariff x ceil {[Call duration (s) - free time (s) - Min. charging unit x Charging unit (s)] / Charging unit (s)}

      •P&C call charge = (Charge for initial call duration + Charge for call duration) x discount

       

      +

      Changing P&C number is charged according to the Changing Parent and Children Number tariff. Subscriber may have some preset free times to change his/her P&C number every day.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      User manually activates or deactivates free SMS service can be charged according to the Activate/Deactivate Free SMS Fee. The system cancellation of free SMS when service expires won't be charged.

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.3.1

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_2_3_2.htm b/wxc2_omc/omcHelp/2_2_3_2.htm new file mode 100755 index 0000000..8233e18 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_3_2.htm @@ -0,0 +1,64 @@ +锘� + + + Current Tariff - MT + + + + + + + + + + + + + + + + + + + + +
      +

      Current Tariff - MT

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The PPS supports up to 64 MT call tariffs which are based on calling number prefix. The MT call tariff only functions when the MT call is set charged (not free). The MT basic tariff is same as the MO basic tariff. Please refer to the previous section for details.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Query the MT tariff.

       

      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.3.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_2_3_3.htm b/wxc2_omc/omcHelp/2_2_3_3.htm new file mode 100755 index 0000000..29f92f9 --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_3_3.htm @@ -0,0 +1,71 @@ +锘� + + + Current Tariff - Discount + + + + + + + + + + + + + + + + + + + + +
      +

      Current Tariff - Discount

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The PPS supports 32 discount tables. The discount table is applied for each prefix of SM tariff and MO/MT basic tariff. The discount table provides discount charge on both prefix and time period basis.

      +

       

      +

      •Discount Table

       

      +

      The discount table defines discount rate for seven week days and holidays. Each day is divided into 24 one-hour sessions. Each session can set different discount rate. Generally the discount rate is less than 1, e.g. 0.7 indicates 30 percent off. The discount rate may also be more than 1, e.g. 1.2 indicates 120 percent.

      +

      The discount table has a separate discount rate for the holidays. Calls made in the holiday days are subject to the discount rates defined in the "holiday" column of the discount table.

      +

       

      +

      •Holiday Table

       

      +

      Operator defines the holiday days in the Holiday Table. Calls taking place on all operator specified holidays are subject to the holiday discount rates defines in the holiday column in the discount table.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Query the Discount tariff

       

      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.3.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_2_3_4.htm b/wxc2_omc/omcHelp/2_2_3_4.htm new file mode 100755 index 0000000..be90a5c --- /dev/null +++ b/wxc2_omc/omcHelp/2_2_3_4.htm @@ -0,0 +1,60 @@ +锘� + + + Current Tariff - Holiday + + + + + + + + + + + + + + + + + + + + +
      +

      Current Tariff - Holiday

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Subscribers may customize holidays that are charged by discount tariff. Calls taking place on all defined holidays are subject to a same holiday sensitive discount tariff.

      +

       

      +

       

      +

      Return to

      +

       

      +

      •Database Administration

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.2.3.4

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_3.htm b/wxc2_omc/omcHelp/2_3.htm new file mode 100755 index 0000000..9178e67 --- /dev/null +++ b/wxc2_omc/omcHelp/2_3.htm @@ -0,0 +1,1736 @@ +锘� + + + Tasks List + + + + + + + + + + + + + + + + + + + + +
      +

      Tasks List

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Pick Task by a Click

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Required Parameters

      +

      MTP3

      +

      SCCP

      +

      XAPP

      +

      MSC

      +

      VLR

      +

      HLR

      +

      SMSC

      +

      SMPP

      +

      AAS

      +

      VMS

      +

      PPS

      +

      SMEG

      +

      OPPS

      +

      PALIM

      +

      iRLS

      +

      MRFC

      +

      Subs

      +

      Tariff

      +

      Enable Local Call

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      Connect to External Switch

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Supplementary Service

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Audio Announcement

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Voice Mail Service

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable VLR Purge

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Ciphering

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable TMSI Reallocation

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Emergency Call

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Short Message Service

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Premium Call

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable OSB

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Authentication

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable IMEI Checking

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Roaming

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable CSRR

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Configure SMEG

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Modify Application Context Name

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Operator Access Administration

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Update MSS Licenses

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable IMDX

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable OPR

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Use Debug Tool

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Cap Call

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Connect to IP Media Server

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Configure iPALIM

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Configure Local Switching

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Configure Balance Transfer

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Enable Prepaid Service

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Enable Audio Prompt

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Enable Notification SMS

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Enable Interactive USSD

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Configure Tariff

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Configure Cap Call

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Configure Balance Transfer

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Configure F&F Number

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Configure P&C Number

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Enable Call Me Back

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Enable Tier Rating

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      >> Enable Free SMS Service

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      +

      Required Parameters

      +

      MTP3

      +

      SCCP

      +

      XAPP

      +

      MSC

      +

      VLR

      +

      HLR

      +

      SMSC

      +

      SMPP

      +

      AAS

      +

      VMS

      +

      PPS

      +

      SMEG

      +

      OPPS

      +

      PALIM

      +

      iRLS

      +

      MRFC

      +

      Subs

      +

      Tariff

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      2.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_30.htm b/wxc2_omc/omcHelp/2_30.htm new file mode 100755 index 0000000..2ed12ac --- /dev/null +++ b/wxc2_omc/omcHelp/2_30.htm @@ -0,0 +1,1404 @@ +锘� + + + Enabling Mobile Call + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Mobile Call

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      A mobile-to-mobile call (MMC) is a call between two mobile subscribers. The MMC may be considered an MOC followed by an MTC. The MOC initiation and completion procedures are then handled by the originating MSC/VLR and the MTC initiation and completion procedures are handled by the destination-MSC/VLR. The originating MSC/VLR may also be responsible for the interrogation procedure.

      +

       

      +

      In addition, when the two mobile subscribers are registered in the same MSC/VLR area and the traffic channels are switched entirely within this one MSC/VLR, we speak about a local call. In this case the servicing MSC/VLR performs both the MOC and MTC initiation/completion procedures.

      +

       

      +

      To enable local mobile call, XAPP, MTP3, SCCP and MSC parameters need to be configured on NSS side.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >XAPP.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_30_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Mobile Country Code

      +

      Mobile Country Code of the installed network.

      +

      --

      +

      Mobile Network Code

      +

      Mobile Network Code of the installed network.

      +

      --

      +

      Country Code

      +

      The code that identifies the country's network.

      +

      --

      +

      National Destination Code

      +

      Defines the national calling area or national network to which the subscriber belongs.

      +

      --

      +

      International Prefix

      +

      A digit or combination of digits used by a subscriber when making an international call. The international prefix is used to indicate that the following digits represent an international number and should be routed to an international gateway.

      +

      00

      +

      National Prefix

      +

      A digit or combination of digits used by a subscriber when calling a national destination (within the country) other than that of the local area network.

      +

      0

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MTP3.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_30_02

      +

       

      +

      1.Click the Nat Network tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Nat OPC

      +

      Assign a unique decimal Originating Point Code to the National network.

      +

      Each UltraWAVE R4S system supports four networks:

      +

      •National

      •National Spare

      •International

      •International Spare

      Each network has its own Point Code, which can be set to the same value.

      +

      --

      +

      Nat PC Length

      +

      Specify Point Code Length to the National network.

      +

      Depending on the network design, the length can be set to:

      +

      •24 bits (North America, China)

      •14 bits (ITU standard, International SS7 network and most countries)

      14-bit

      +

      Nat PC Type

      +

      Specify Point Code Type to the National network.

      +

      Depending on the connection mode, the type can be set to:

      +

      •ITU (E1 connection)

      •ANSI (T1 connection)

      ITU

      +
      +
      +

       

      +

      2_30_03

      +

       

      +

      1.Click the Link Set tab, and then click New at the bottom of the Linkset table.

       

      +

      2.In the Linkset ID box, select an available number for the new linkset, and then click the 2_002 button.

       

      +

      3.In the Linkset Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created linkset.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the connected BSC.

      +

      BSC Point Code

      +

      Network Indicator

      +

      Specify network type of the BSC.

      +

      National

      +

      Loopback Flag

      +

      Enable or disable loopback function on this linkset.

      +

      Enabled only for the MSC loopback linksets.

      +

      Disable

      +
      +
      +

       

      +

      2_30_04

      +

       

      +

      1.Click the SG tab, and then click New at the bottom of the Signaling Gateway table.

       

      +

      2.In the SG ID box, select an available number for the new SG, and then click the 2_002 button.

       

      +

      3.In the Signaling Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created signaling gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Application Mode

      +

      Select the application mode of the signaling gateway.

      +

      Client

      +

      Signaling Type

      +

      Specify the type of the signaling gateway:

      +

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      ACK Option

      +

      The ACK message must be sent if there is request from the peer. Otherwise, the ACK message should not be sent.

      +

      Forbid

      +

      Remote IP

      +

      IP address of the signaling gateway's destination.

      +

      IP of MG

      +
      +
      +

       

      +

      2_30_05

      +

       

      +

      1.Click the Link tab, and then click New at the bottom of the Link table.

       

      +

      2.In the Link ID box, select an available number for the new link, and then click the 2_002 button.

       

      +

      3.In the Link Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created link.

       

      +

      6.Repeat Step 2 to 5 to add more BSC links.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      0 ~ 15

      +

      Host IP

      +

      Management server's IP of this link.

      +

      MSC0 = 172.18.98.1

      +

      MSC1 = 172.18.99.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      --

      +
      +
      +

       

      +

      2_30_06

      +

       

      +

      1.Click the Nat Network tab, and then click New at the bottom of the Nat Routing table.

       

      +

      2.In the Nat Routing ID box, select an available number for the new routing, and then click the 2_002 button.

       

      +

      3.In the Routing Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the connected BSC.

      +

      BSC Point Code

      +

      Normal Linkset

      +

      Enter the Linkset index number configured previously.

      +

      Linkset ID

      +

      Alternative Linkset

      +

      Assign an Alternative Linkset to the BSC. It will be activated when the Normal Linkset is unavailable.

      +

      Set 128 to disable alternative linkset.

      +

      128

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button.

       

      +

      2_30_07

      +

       

      +

      1.Click the Local Node tab.

       

      +

      2.Click the hyperlinked index number of OMC to open the OMC Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Repeat Step 2 to 4 to configure HLR, VLR and MSC.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      MSISDN

      +

      The E.164 node address of the local node.

      +

      This parameter is no need for OMC.

      +

      CC+NDC+SN

      +

      IP 0

      +

      IP address of the local node server 0.

      +

      OMC0 = 172.18.128.1

      +

      MSS0 = 172.18.98.1

      +

      IP 1

      +

      IP address of the local node server 1.

      +

      OMC1 = 172.18.129.1

      +

      MSS1 = 172.18.99.1

      +
      +
      +

       

      +

      2_30_08

      +

       

      +

      1.Click the GTT tab, and then click New at the bottom of the Globe Title Translate table.

       

      +

      2.In the GTT ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the GTT Option window, configure the following parameters to add MSISDN range of local subscribers.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Repeat step 1 to 4 to add IMSI range of local subscribers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Flag

      +

      Enable or disable this GTT item.

      +

      Enable

      +

      Number Plan

      +

      Describe which numbering plan will be used for the global title. The numbering plan chosen will aid the routing system in determining the correct network system to direct the message.

      +

      MSISDN

      +

      IMSI

      +

      Translation Type

      +

      Translation examines the destination address and deciding how to identify it over the telephone network.

      +

      0

      +

      Start GT Number

      +

      The start of the MSISDN and IMSI range of local subscribers.

      +

      Start MSISDN/IMSI

      +

      End GT Number

      +

      The end of the MSISDN and IMSI range of local subscribers.

      +

      End MSISDN/IMSI

      +

      Network Indicator

      +

      Nature of Address Indicator. It indicates the scope of the address value. Choose the same network as MTP3 setting.

      +

      National

      +

      DPC

      +

      Point Code of BSC.

      +

      --

      +

      SSN

      +

      Subsystem Number. For IMSI and MSISDN, specify SSN to 6.

      +

      6

      +

      Route Indicator

      +

      For IMSI and MSISDN, select Route on SSN. For the connected network, select Route on GT.

      +

      Route on SSN

      +

      Address Indicator

      +

      Contribution of SCCP Address.

      +

      GT+DPC+SSN

      +

      Replace Start Digit

      +

      The start digit of the GT number to be replaced.

      +

      0

      +

      Replace End Digit

      +

      The end digit of the GT number to be replaced.

      +

      0

      +

      Replacing Number Plan

      +

      The type of the number to be output.

      +

      N/A

      +

      Replacing Digits

      +

      Replace the selected GT number range with these digits.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MSC.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_30_09

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update basic MSC parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      CDR Option

      +

      Control the Call Detail Record generation for different call types.

      +

      --

      +

      MO Max Call Duration

      +

      Define the permitted maximum call duration for MO call. Any ongoing call reaching this threshold will be compulsively cut off.

      +

      Set 0 to disable this function.

      +

      60

      +

      MT Max Call Duration

      +

      Define the permitted maximum call duration for MT call. Any incoming call reaching this threshold will be compulsively cut off.

      +

      Set 0 to disable this function.

      +

      60

      +

      eMLPP PCI Option

      +

      The enhanced multilevel precedence and  preemption (eMLPP) service provides the capability to classify the mobile subscribers according to a subscriber specific priority.

      +

      Disable

      +

      eMLPP PVI Option

      +
      +
      +

       

      +

      2_30_10

      +

       

      +

      1.Click the Dialing Prefix Set tab, and then click New at the bottom of the Prefix Set table.

       

      +

      2.In the DPS ID box, select an available number for the new Prefix Set, and then click the 2_002 button.

       

      +

      3.In the Prefix Set Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Prefix Set parameters to application servers.

       

      +

      5.Click the hyperlinked number in the Dialing Prefix Entries to open the Prefix table.

       

      +

      6.Click New at the bottom of the Prefix table to add prefix for MSRN.

       

      +

      7.In the Prefix ID box, click the 2_002 button.

       

      +

      8.In the Prefix Option window, configure the relevant parameters given in the following table.

       

      +

      9.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      10.Click the 2_036 button to activate the new created prefix.

       

      +

      11.Repeat Step 6 to 10 to add more prefixes for local call.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Dialing Prefix Set

      +

      CC

      +

      The code that identifies the country's network.

      +

      --

      +

      NDC

      +

      Defines the national calling area or national network to which the subscriber belongs.

      +

      --

      +

      International Prefix

      +

      A digit or combination of digits used by a subscriber when making an international call. The international prefix is used to indicate that the following digits represent an international number and should be routed to an international gateway.

      +

      00

      +

      National Prefix

      +

      A digit or combination of digits used by a subscriber when calling a national destination (within the country) other than that of the local area network.

      +

      0

      +

      HPLMN CC 0~7

      +

      Assign up to 8 Country Code to the home PLMN.

      +

      --

      +

      Dialing Prefix Entries

      +

      The total number of configured prefix in this dialing prefix set.

      +

      Hyperlinked Number

      +

      > Dialing Prefix

      +

      Prefix

      +

      A combination digits that dial to originate a call.

      +

      --

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      IDD (MSRN)

      +

      Unknown

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      --

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Normal

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      RS ID

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Disable (MSRN)

      +

      Enable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable if this prefix relating to Premium Call service.

      +

      Disable

      +

      OSB1 Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      Disable

      +

      OSB2 Flag

      +

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      Disable

      +

      NAI Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      IDD

      +

      PSTN Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      PSTN Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      N/A

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      --

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number to convert it to an international E.164 format (CC and NDC included).

      +

      --

      +
      +
      +

       

      +

      2_30_11

      +

       

      +

      1.Click the Routing Zone Set tab, and then click New at the bottom of the Routing Zone Set table.

       

      +

      2.In the RSZ ID box, select an available number for the new Routing Zone Set, and then click the 2_002 button.

       

      +

      3.In the Routing Zone Set Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Routing Zone Set parameters to application servers.

       

      +

      5.Click the hyperlinked number in the Routing Selection Entries to open the Routing Selection table.

       

      +

      6.Click New at the bottom of the Routing Selection table to add a Routing Selection for BSC trunk group.

       

      +

      7.In the RS ID box, select an available number for the new Routing Selection, click the 2_002 button.

       

      +

      8.In the Routing Selection Option window, configure the relevant parameters given in the following table.

       

      +

      9.Click the 2_041 button to update Routing Selection parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Routing Zone Set

      +

      Dialing Prefix Set ID

      +

      Specify the proper Dialing Prefix Set index number to this Routing Zone Set.

      +

      DPS ID

      +

      Announcement Set ID

      +

      Specify the proper Call Unattainable Announcement Set index number to this Routing Zone.

      +

      1 (Default)

      +

      MSRN Start

      +

      The start of the MSRN range for this Routing Zone.

      +

      N/A

      +

      MSRN End

      +

      The end of the MSRN range for this Routing Zone.

      +

      N/A

      +

      SRF0 E.164 Number

      +

      The E.164 node address of the SRF connecting to MSS platform 0.

      +

      N/A

      +

      SRF1 E.164 Number

      +

      The E.164 node address of the SRF connecting to MSS platform 1.

      +

      N/A

      +

      Routing Selection Entries

      +

      (Read Only) The total number of configured routing selection in this routing zone set.

      +

      Hyperlinked Number

      +

      > Routing Selection

      +

      Trunk Group

      +

      Specify the BSC Trunk Group for the outgoing routing.

      +

      TG ID

      +

      Alternative TG Flag

      +

      Enable or disable alternative Trunk Group when the primary Trunk

      +

      Group is unavailable.

      +

      Enable

      +

      Alternative TG

      +

      Specify the alternative Trunk Group. It's available only when the previous Alternative TG Flag is enabled.

      +

      Inter-MSC TG

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      IDD

      +

      Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Inserted Digits

      +

      The digits to be inserted to the front of the dialed number.

      +

      N/A

      +
      +
      +

       

      +

      2_30_12

      +

       

      +

      1.Click the Trunk Group tab, and then click New at the bottom of the Trunk Group table.

       

      +

      2.In the TG ID box, select an available number for the new Trunk Group, and then click the 2_002 button.

       

      +

      3.In the Trunk Group Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Trunk Group parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created Trunk Group.

       

      +

      6.Click the hyperlinked number in the Trunk Entries to open the Trunk table.

       

      +

      7.Click New at the bottom of the Trunk table to add a Trunk.

       

      +

      8.In the Trunk ID box, click the 2_002 button.

       

      +

      9.In the Trunk Option window, configure the relevant parameters given in the following table.

       

      +

      10.Click the 2_041 button to update Trunk parameters to application servers.

       

      +

      11.Click the 2_036 button to activate the new created Trunk.

       

      +

      12.Repeat Step 7 to 11 to add more BSC trunks.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Trunk Group

      +

      OPC

      +

      The Point Code of MSC

      +

      MSC Point Code

      +

      DPC

      +

      The Point Code of BSC.

      +

      BSC Point Code

      +

      Network Indicator

      +

      Specify the trunk group to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      Protocol Type

      +

      Select the protocol type for this Trunk Group.

      +

      AIF

      +

      Protocol Variant

      +

      Select the protocol variant for this Trunk Group.

      +

      ITU

      +

      Circuit Selection Mode

      +

      Circuit selection mode of the traffic channel connections.

      +

      Odd

      +

      Back Off Flag

      +

      Enable or disable Back Off when simultaneously select the same channel with the opposite side.

      +

      Enable

      +

      Tandem Restriction

      +

      Enable or disable Tandem to allow or prohibit transit calls from PSTN to PSTN via this trunk group.

      +

      Disable

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this trunk group

      +

      Enable

      +

      TG Type

      +

      Application type of this Trunk Group.

      +

      Normal

      +

      Routing Zone ID

      +

      Specify the Trunk Group to a Routing Zone Set.

      +

      255 = Apply to all Routing Zone

      +

      255

      +

      Alternative Routing Trigger

      +

      Specify the ID of the alternative Routing for backup purpose.

      +

      N/A

      +

      BSC Codec

      +

      Specify the codec type of the BSC. It's available only for circuit BSC.

      +

      Entry 0 is the highest priority, entry 15 is the least.

      +

      --

      +

      > Trunk

      +

      MG ID

      +

      Specify the Trunk to a Media Gateway. Not applicable to virtual MG.

      +

      MG ID

      +

      Port ID

      +

      Specify the Trunk to a physical port of the selected Media Gateway. Not applicable to virtual MG.

      +

      --

      +

      Port Type

      +

      Specify the type of MG physical ports.

      +

      E1

      +

      Group ID

      +

      Select the application group for the Trunk.

      +

      Group 0

      +

      CIC Assignment

      +

      Specify the start CIC to the Trunk for Circuit Identity Code selection.

      +

      0, 32, 64 ...

      +
      +
      +

       

      +

      2_30_13

      +

       

      +

      1.Click the Location Area tab, and then click New at the bottom of the Location Area table.

       

      +

      2.In the Location Area ID box, click the 2_002 button.

       

      +

      3.In the Location Area Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Location Area parameters to application servers.

       

      +

      5.Click the hyperlinked number in the Cell Entries to open the Cell table.

       

      +

      6.Click New at the bottom of the Cell table to add a Cell for BTS.

       

      +

      7.In the Cell ID box, click the 2_002 button.

       

      +

      8.In the Cell Option window, configure the relevant parameters given in the following table.

       

      +

      9.Click the 2_041 button to update Cell parameters to application servers.

       

      +

      10.Repeat Step 6 to 9 to add more BTS cells.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Location Area

      +

      LAC

      +

      Assign a Location Area Code to this location area.

      +

      --

      +

      Trunk Group

      +

      Specify the proper Trunk Group index number to this location area.

      +

      --

      +

      Paging Mode

      +

      Specify the paging mode in this location area.

      +

      Paging in all Cells

      +

      Repeat Paging Times

      +

      The subsequent paging times if the initial paging fails.

      +

      1

      +

      Emergency Number 0~7

      +

      Subscriber dials this number to make emergency call in the specified location area.

      +

      N/A

      +

      > Cell

      +

      Routing Zone ID

      +

      Specify the Routing Zone Set ID to this cell.

      +

      RZS ID

      +

      RSZC

      +

      Assign a Regional Subscription Zone Code to the LAC.

      +

      Regional Subscription Code = CC+NDC+Zone Code

      +

      N/A

      +

      Cell ID

      +

      Global Cell Identity defined in GSM 03.03

      +

      --

      +
      +
      +

       

      +

      2_30_14

      +

       

      +

      1.Click the Media Gateway tab, and then click New at the bottom of the Media Gateway table.

       

      +

      2.In the MG ID box, select an available number for the new Media Gateway, and then click the 2_002 button.

       

      +

      3.In the Media Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Media Gateway parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created Media Gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      IP

      +

      IP address of the Media Gateway or 8KE1 Card.

      +

      --

      +

      Domain Name

      +

      Specify a domain name to the Media Gateway.

      +

      --

      +

      Switching Mode

      +

      Select the switching mode of the specified MG.

      +

      •8ECP = Circuit Switch (8KE1)

      •MGCP = Soft Switch (MG)

      MGCP

      +

      Endpoint

      +

      Specify the method of MGCP Endpoint description.

      +

      Structured

      +

      Tone Generation Capacity

      +

      Enable if the Media Gateway has tone generation capability.

      +

      Enable

      +

      MG Type

      +

      Select the type of MG endpoint.

      +

      AudioCodes

      +

      Max Ports

      +

      The total physical port number of the MG. Not applicable to virtual MG.

      +

      --

      +

      Max Channels

      +

      The total channel number of the virtual MG. Applicable to virtual MG only.

      +

      --

      +

      Packetization Period

      +

      The period over which encoded voice bits are collected for encapsulation in.

      +

      20ms

      +

      Codec Type

      +

      Specify the codec type of the MG. Entry 0 is the highest priority, entry 15 is the least.

      +

      A-Law

      +

      Port Type

      +

      Specify the type of MG physical ports.

      +

      E1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable PSTN Call

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.30

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_30_01.gif b/wxc2_omc/omcHelp/2_30_01.gif new file mode 100755 index 0000000..4d05573 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_01.gif differ diff --git a/wxc2_omc/omcHelp/2_30_02.gif b/wxc2_omc/omcHelp/2_30_02.gif new file mode 100755 index 0000000..b3b8e56 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_02.gif differ diff --git a/wxc2_omc/omcHelp/2_30_03.gif b/wxc2_omc/omcHelp/2_30_03.gif new file mode 100755 index 0000000..24cd078 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_03.gif differ diff --git a/wxc2_omc/omcHelp/2_30_04.gif b/wxc2_omc/omcHelp/2_30_04.gif new file mode 100755 index 0000000..280a8d2 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_04.gif differ diff --git a/wxc2_omc/omcHelp/2_30_05.gif b/wxc2_omc/omcHelp/2_30_05.gif new file mode 100755 index 0000000..309e82d Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_05.gif differ diff --git a/wxc2_omc/omcHelp/2_30_06.gif b/wxc2_omc/omcHelp/2_30_06.gif new file mode 100755 index 0000000..216028a Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_06.gif differ diff --git a/wxc2_omc/omcHelp/2_30_07.gif b/wxc2_omc/omcHelp/2_30_07.gif new file mode 100755 index 0000000..c000b24 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_07.gif differ diff --git a/wxc2_omc/omcHelp/2_30_08.gif b/wxc2_omc/omcHelp/2_30_08.gif new file mode 100755 index 0000000..f215c07 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_08.gif differ diff --git a/wxc2_omc/omcHelp/2_30_09.gif b/wxc2_omc/omcHelp/2_30_09.gif new file mode 100755 index 0000000..d648a99 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_09.gif differ diff --git a/wxc2_omc/omcHelp/2_30_10.gif b/wxc2_omc/omcHelp/2_30_10.gif new file mode 100755 index 0000000..6f46c3d Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_10.gif differ diff --git a/wxc2_omc/omcHelp/2_30_11.gif b/wxc2_omc/omcHelp/2_30_11.gif new file mode 100755 index 0000000..9238e70 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_11.gif differ diff --git a/wxc2_omc/omcHelp/2_30_12.gif b/wxc2_omc/omcHelp/2_30_12.gif new file mode 100755 index 0000000..8e95e47 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_12.gif differ diff --git a/wxc2_omc/omcHelp/2_30_13.gif b/wxc2_omc/omcHelp/2_30_13.gif new file mode 100755 index 0000000..b8bd597 Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_13.gif differ diff --git a/wxc2_omc/omcHelp/2_30_14.gif b/wxc2_omc/omcHelp/2_30_14.gif new file mode 100755 index 0000000..c427a9b Binary files /dev/null and b/wxc2_omc/omcHelp/2_30_14.gif differ diff --git a/wxc2_omc/omcHelp/2_32.htm b/wxc2_omc/omcHelp/2_32.htm new file mode 100755 index 0000000..18bdaa2 --- /dev/null +++ b/wxc2_omc/omcHelp/2_32.htm @@ -0,0 +1,1045 @@ +锘� + + + Enabling PSTN Call + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling PSTN Call

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      To enable calls to external switch, MTP3 and MSC parameters need to be configured on NSS side.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MTP3.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_30_02

      +

       

      +

      1.Click the Nat Network tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Note: Please ignore this step if it's already done in the preceding task configuration.

      +

      Nat OPC

      +

      Assign a unique decimal Originating Point Code to the National network.

      +

      Each UltraWAVE R4S system supports four networks:

      +

      •National

      •National Spare

      •International

      •International Spare

      Each network has its own Point Code, which can be set to the same value.

      +

      --

      +

      Nat PC Length

      +

      Specify Point Code Length to the National network.

      +

      Depending on the network design, the length can be set to:

      +

      •24 bits (North America, China)

      •14 bits (ITU standard, International SS7 network and most countries)

      14-bit

      +

      Nat PC Type

      +

      Specify Point Code Type to the National network.

      +

      Depending on the connection mode, the type can be set to:

      +

      •ITU (E1 connection)

      •ANSI (T1 connection)

      ITU

      +
      +
      +

       

      +

      2_30_03

      +

       

      +

      1.Click the Link Set tab, and then click New at the bottom of the Linkset table.

       

      +

      2.In the Linkset ID box, select an available number for the new linkset, and then click the 2_002 button.

       

      +

      3.In the Linkset Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created linkset.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the connected PSTN.

      +

      PSTN Point Code

      +

      Network Indicator

      +

      Specify network type of the PSTN.

      +

      National

      +

      Loopback Flag

      +

      Enable or disable loopback function on this linkset.

      +

      Enabled only for the MSC loopback linksets.

      +

      Disable

      +
      +
      +

       

      +

      2_30_04

      +

       

      +

      1.Click the SG tab, and then click New at the bottom of the Signaling Gateway table.

       

      +

      2.In the SG ID box, select an available number for the new SG, and then click the 2_002 button.

       

      +

      3.In the Signaling Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created signaling gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Application Mode

      +

      Select the application mode of the signaling gateway.

      +

      Client

      +

      Signaling Type

      +

      Specify the type of the signaling gateway:

      +

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      ACK Option

      +

      The ACK message must be sent if there is request from the peer. Otherwise, the ACK message should not be sent.

      +

      Forbid

      +

      Remote IP

      +

      IP address of the signaling gateway's destination.

      +

      IP of MG

      +
      +
      +

       

      +

      2_30_05

      +

       

      +

      1.Click the Link tab, and then click New at the bottom of the Link table.

       

      +

      2.In the Link ID box, select an available number for the new link, and then click the 2_002 button.

       

      +

      3.In the Link Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created link.

       

      +

      6.Repeat Step 2 to 5 to add more PSTN links.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      0 ~ 15

      +

      Host IP

      +

      Management server's IP of this link.

      +

      MSC0 = 172.18.98.1

      +

      MSC1 = 172.18.99.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      --

      +
      +
      +

       

      +

      2_30_06

      +

       

      +

      1.Click the Nat Network tab, and then click New at the bottom of the Nat Routing table.

       

      +

      2.In the Nat Routing ID box, select an available number for the new routing, and then click the 2_002 button.

       

      +

      3.In the Routing Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the connected PSTN.

      +

      PSTN Point Code

      +

      Normal Linkset

      +

      Enter the Linkset index number configured previously.

      +

      Linkset ID

      +

      Alternative Linkset

      +

      Assign an Alternative Linkset to the PSTN. It will be activated when the Normal Linkset is unavailable.

      +

      Set 128 to disable alternative linkset.

      +

      128

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MSC.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_30_09

      +

       

      +

      1.In the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update basic MSC parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Note: Please ignore this step if it's already done in the preceding task configuration.

      +

      CDR Option

      +

      Control the Call Detail Record generation for different call types.

      +

      --

      +

      MO Max Call Duration

      +

      Define the permitted maximum call duration for MO call. Any ongoing call reaching this threshold will be compulsively cut off.

      +

      Set 0 to disable this function.

      +

      60

      +

      MT Max Call Duration

      +

      Define the permitted maximum call duration for MT call. Any incoming call reaching this threshold will be compulsively cut off.

      +

      Set 0 to disable this function.

      +

      60

      +

      eMLPP PCI Option

      +

      The enhanced multilevel precedence and  preemption (eMLPP) service provides the capability to classify the mobile subscribers according to a subscriber specific priority.

      +

      Disable

      +

      eMLPP PVI Option

      +
      +
      +

       

      +

      2_30_10

      +

       

      +

      1.Click the Dialing Prefix Set tab, and then click New at the bottom of the Prefix Set table.

       

      +

      2.In the DPS ID box, select an available number for the new Prefix Set, and then click the 2_002 button.

       

      +

      3.In the Prefix Set Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Prefix Set parameters to application servers.

       

      +

      5.Click the hyperlinked number in the Dialing Prefix Entries to open the Prefix table.

       

      +

      6.Click New at the bottom of the Prefix table to add prefix for PSTN.

       

      +

      7.In the Prefix ID box, click the 2_002 button.

       

      +

      8.In the Prefix Option window, configure the relevant parameters given in the following table.

       

      +

      9.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      10.Click the 2_036 button to activate the new created prefix.

       

      +

      11.Repeat Step 6 to 10 to add more prefixes for PSTN call.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Dialing Prefix Set

      +

      Note: Please ignore the Dialing Prefix Set if it's already done in the preceding task configuration.

      +

      CC

      +

      The code that identifies the country's network.

      +

      --

      +

      NDC

      +

      Defines the national calling area or national network to which the subscriber belongs.

      +

      --

      +

      International Prefix

      +

      A digit or combination of digits used by a subscriber when making an international call. The international prefix is used to indicate that the following digits represent an international number and should be routed to an international gateway.

      +

      00

      +

      National Prefix

      +

      A digit or combination of digits used by a subscriber when calling a national destination (within the country) other than that of the local area network.

      +

      0

      +

      HPLMN CC 0~7

      +

      Assign up to 8 Country Code to the home PLMN.

      +

      --

      +

      Dialing Prefix Entries

      +

      The total number of configured prefix in this dialing prefix set.

      +

      Hyperlinked Number

      +

      > Dialing Prefix

      +

      Prefix

      +

      A combination digits that dial to originate a call.

      +

      --

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      IDD

      +

      Unknown

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      --

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Normal

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      RS ID

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Enable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable if this prefix relating to Premium Call service.

      +

      Disable

      +

      OSB1 Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      Disable

      +

      OSB2 Flag

      +

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      Disable

      +

      NAI Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      --

      +

      PSTN Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      --

      +

      PSTN Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      --

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      0

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number to convert it to an international E.164 format (CC and NDC included).

      +

      N/A

      +
      +
      +

       

      +

      2_30_11

      +

       

      +

      1.Click the Routing Zone Set tab, and then click New at the bottom of the Routing Zone Set table.

       

      +

      2.In the RSZ ID box, select an available number for the new Routing Zone Set, and then click the 2_002 button.

       

      +

      3.In the Routing Zone Set Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Routing Zone Set parameters to application servers.

       

      +

      5.Click the hyperlinked number in the Routing Selection Entries to open the Routing Selection table.

       

      +

      6.Click New at the bottom of the Routing Selection table to add a Routing Selection for PSTN trunk group.

       

      +

      7.In the RS ID box, select an available number for the new Routing Selection, click the 2_002 button.

       

      +

      8.In the Routing Selection Option window, configure the relevant parameters given in the following table.

       

      +

      9.Click the 2_041 button to update Routing Selection parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Routing Zone Set

      +

      Note: Please ignore the Routing Zone Set if it's already done in the preceding task configuration.

      +

      Dialing Prefix Set ID

      +

      Specify the proper Dialing Prefix Set index number to this Routing Zone Set.

      +

      DPS ID

      +

      Announcement Set ID

      +

      Specify the proper Call Unattainable Announcement Set index number to this Routing Zone.

      +

      1 (Default)

      +

      MSRN Start

      +

      The start of the MSRN range for this Routing Zone.

      +

      N/A

      +

      MSRN End

      +

      The end of the MSRN range for this Routing Zone.

      +

      N/A

      +

      SRF0 E.164 Number

      +

      The E.164 node address of the SRF connecting to MSS platform 0.

      +

      N/A

      +

      SRF1 E.164 Number

      +

      The E.164 node address of the SRF connecting to MSS platform 1.

      +

      N/A

      +

      Routing Selection Entries

      +

      (Read Only) The total number of configured routing selection in this routing zone set.

      +

      Hyperlinked Number

      +

      > Routing Selection

      +

      Trunk Group

      +

      Specify the PSTN Trunk Group for the outgoing routing.

      +

      TG ID

      +

      Alternative TG Flag

      +

      Enable or disable alternative Trunk Group when the primary Trunk

      +

      Group is unavailable.

      +

      Enable

      +

      Alternative TG

      +

      Specify the alternative Trunk Group. It's available only when the previous Alternative TG Flag is enabled.

      +

      Inter-MSC TG

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      --

      +

      Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      --

      +

      Inserted Digits

      +

      The digits to be inserted to the front of the dialed number.

      +

      --

      +
      +
      +

       

      +

      2_30_12

      +

       

      +

      1.Click the Trunk Group tab, and then click New at the bottom of the Trunk Group table.

       

      +

      2.In the TG ID box, select an available number for the new Trunk Group, and then click the 2_002 button.

       

      +

      3.In the Trunk Group Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Trunk Group parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created Trunk Group.

       

      +

      6.Click the hyperlinked number in the Trunk Entries to open the Trunk table.

       

      +

      7.Click New at the bottom of the Trunk table to add a Trunk.

       

      +

      8.In the Trunk ID box, click the 2_002 button.

       

      +

      9.In the Trunk Option window, configure the relevant parameters given in the following table.

       

      +

      10.Click the 2_041 button to update Trunk parameters to application servers.

       

      +

      11.Click the 2_036 button to activate the new created Trunk.

       

      +

      12.Repeat Step 7 to 11 to add more PSTN trunks.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Trunk Group

      +

      OPC

      +

      The Point Code of MSC

      +

      MSC Point Code

      +

      DPC

      +

      The Point Code of PSTN.

      +

      PSTN Point Code

      +

      Network Indicator

      +

      Specify the trunk group to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      Protocol Type

      +

      Select the protocol type for this Trunk Group.

      +

      ISUP or ISDN

      +

      Protocol Variant

      +

      Select the protocol variant for this Trunk Group.

      +

      ITU

      +

      Circuit Selection Mode

      +

      Circuit selection mode of the traffic channel connections.

      +

      Odd

      +

      Back Off Flag

      +

      Enable or disable Back Off when simultaneously select the same channel with the opposite side.

      +

      Enable

      +

      Tandem Restriction

      +

      Enable or disable Tandem to allow or prohibit transit calls from PSTN to PSTN via this trunk group.

      +

      Disable

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this trunk group

      +

      Enable

      +

      TG Type

      +

      Application type of this Trunk Group.

      +

      Normal

      +

      Routing Zone ID

      +

      Specify the Trunk Group to a Routing Zone Set.

      +

      255 = Apply to all Routing Zone

      +

      255

      +

      Alternative Routing Trigger

      +

      Specify the ID of the alternative Routing for backup purpose.

      +

      N/A

      +

      BSC Codec

      +

      Specify the codec type of the BSC. It's available only for circuit BSC.

      +

      Entry 0 is the highest priority, entry 15 is the least.

      +

      N/A

      +

      > Trunk

      +

      MG ID

      +

      Specify the Trunk to a Media Gateway. Not applicable to virtual MG.

      +

      MG ID

      +

      Port ID

      +

      Specify the Trunk to a physical port of the selected Media Gateway. Not applicable to virtual MG.

      +

      --

      +

      Port Type

      +

      Specify the type of MG physical ports.

      +

      E1

      +

      Group ID

      +

      Select the application group for the Trunk.

      +

      Group 0

      +

      CIC Assignment

      +

      Specify the start CIC to the Trunk for Circuit Identity Code selection.

      +

      0, 32, 64 ...

      +
      +
      +

       

      +

      2_32_01

      +

       

      +

      1.Click the Media Gateway tab, and then click New at the bottom of the Media Gateway table.

       

      +

      2.In the MG ID box, select an available number for the new Media Gateway, and then click the 2_002 button.

       

      +

      3.In the Media Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Media Gateway parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created Media Gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      IP

      +

      IP address of the Media Gateway or 8KE1 Card.

      +

      --

      +

      Domain Name

      +

      Specify a domain name to the Media Gateway.

      +

      --

      +

      Switching Mode

      +

      Select the switching mode of the specified MG.

      +

      •8ECP = Circuit Switch (8KE1)

      •MGCP = Soft Switch (MG)

      MGCP

      +

      Endpoint

      +

      Specify the method of MGCP Endpoint description.

      +

      Structured

      +

      Tone Generation Capacity

      +

      Enable if the Media Gateway has tone generation capability.

      +

      Enable

      +

      MG Type

      +

      Select the type of MG endpoint.

      +

      AudioCodes

      +

      Max Ports

      +

      The total physical port number of the MG. Not applicable to virtual MG.

      +

      --

      +

      Max Channels

      +

      The total channel number of the virtual MG. Applicable to virtual MG only.

      +

      --

      +

      Packetization Period

      +

      The period over which encoded voice bits are collected for encapsulation in.

      +

      20ms

      +

      Codec Type

      +

      Specify the codec type of the MG. Entry 0 is the highest priority, entry 15 is the least.

      +

      A-Law

      +

      Port Type

      +

      Specify the type of MG physical ports.

      +

      E1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable Mobile Call

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      2.32

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_32_01.gif b/wxc2_omc/omcHelp/2_32_01.gif new file mode 100755 index 0000000..3026af8 Binary files /dev/null and b/wxc2_omc/omcHelp/2_32_01.gif differ diff --git a/wxc2_omc/omcHelp/2_34.htm b/wxc2_omc/omcHelp/2_34.htm new file mode 100755 index 0000000..8604ba4 --- /dev/null +++ b/wxc2_omc/omcHelp/2_34.htm @@ -0,0 +1,463 @@ +锘� + + + Enabling Supplementary Service + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Supplementary Service

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The UltraWAVE system supports a comprehensive set of supplementary services defined in GSM standards. A listing of supplementary services follows:

      +

       

      +

       

      +
      + + + +

      According to GSM Recommendation 02.81, the calling line identification presentation (CLIP) feature is a line identification supplementary service. This service enables a called mobile subscriber provided with this feature to receive the calling line identity. The latter includes the required address information, i.e. the (mobile) subscriber's (MS)ISDN number, to identify the calling party.

      +

       

      +

      CLIP is often used together with the calling line identification restriction (CLIR) feature. CLIR is another line identification supplementary service and enables a mobile subscriber provided with this feature to prevent his calling line identity to be presented to the called party.

      +

       

      +

      Compatibility with other Features

      +

       

      +

      •Calling line identification restriction

      The calling line identification restriction (CLIR) supplementary service takes precedence over the calling line identification presentation (CLIP) supplementary service. This means that a mobile subscriber provided with CLIP does not receive the calling line identity from a subscriber provided with CLIR, except when the called mobile subscriber has an override category.

      +

       

      +

      •Call waiting

      A busy mobile subscriber having subscription to call waiting is informed about a new incoming call. When this subscriber is provided with CLIP also, he additionally receives the calling line identity of the calling party originating this new incoming call.

      +

       

      +

      •Call forwarding

      The interaction between CLIP and call forwarding concerns the following call forwarding conditions:

      +

      •Call forwarding unconditional

      •Call forwarding on mobile subscriber busy

      •Call forwarding on no reply

      •Call forwarding on mobile subscriber not reachable

      In each case, the call forwarded to the subscriber who is provided with CLIP receives the calling line identity of the calling party originating the call.

      +

       

      +
      +
      +

       

      +
      + + + +

      According to the GSM Recommendation 02.81, the calling line identification restriction (CLIR) feature is a line identification supplementary service. When this service is invoked, the originating network informs the destination network that the calling line identity is not allowed to be presented. The calling line identity is the calling (mobile) subscriber's (MS)ISDN number.

      +

       

      +

      The feature "calling line identification presentation" (CLIP) is another line identification supplementary service which enables a mobile subscriber provided with this service to receive the calling line identity at his mobile station or terminal. If the calling party has subscription to CLIR, the called party receives an appropriate indication instead.

      +

       

      +

      Compatibility with other Features

      +

       

      +

      •CLIP

      The calling line identification restriction (CLIR) supplementary service takes precedence over the calling line identification presentation (CLIP) supplementary service. This means that a mobile subscriber provided with CLIP does not receive the calling line identity from a subscriber provided with CLIR, except when the called mobile subscriber has an override category.

      +

       

      +
      +
      +

       

      +
      + + + +

      According to GSM Recommendations 02.81, 03.81 and 04.81, the connected line identification presentation (COLP) is line identification supplementary services.

      +

       

      +

      The COLP supplementary service provides the calling mobile subscriber with the possibility to receive the connected party's line identity. The connected line identity includes all the necessary address information, i.e. the (mobile) subscriber's (MS)ISDN number, to unambiguously identify the connected party.

      +

       

      +

      COLP is often used together with the connected line identification restriction (COLR) feature.

      +

       

      +

      Compatibility with other Features

      +

       

      +

      •Call forwarding

      When a served (forwarding) subscriber selects the option that the calling subscriber is not notified of all call forwarding, the calling subscriber, which has COLP, does not receive the connected line identity when the call is answered, unless the calling subscriber has the override capability.

      +

       

      +
      +
      +

       

      +
      + + + +

      According to GSM Recommendations 02.81, 03.81 and 04.81, the connected line identification restriction(COLR) features are line identification supplementary services.

      +

       

      +

      The COLR supplementary service enables the connected party to prevent the presentation of its line identity to the calling party. When the connected party has COLR applied, the calling party receives an indication that the connected line identity is not available due to restriction. However, as an operator option, it is possible to define categories of subscribers that have the ability to override the presentation restriction and have the connected party's identification presented.

      +

       

      +

      Compatibility with other Features

      +

       

      +

      •Call forwarding

      When a forwarded-to subscriber has the COLR supplementary service, the forwarded to subscriber's line identity is not provided with the notification that the call has been forwarded.

      +

       

      +
      +
      +

       

      +
      + + + +

      The Public Land Mobile Network (PLMN) offers a mobile subscriber the possibility to bar certain incoming and outgoing calls. This can be useful when lending one's mobile station to somebody else. In such cases, the usage can be restricted to, for instance, the reception of calls, or to low cost calls. The activation and deactivation of such a barring can be password protected, allowing the control to be kept by the mobile subscriber himself.

      +

       

      +

      This "call barring" feature is part of the supplementary service group as defined in GSM Recommendations 02.88, 03.88 and 04.88.

      +

       

      +

      Compatibility with other Features

      +

       

      +

      •Interaction between different call barring supplementary services

      Call barring can be divided into two groups:

      +

      •Barring of incoming calls

      •Barring of outgoing calls

      Within each group, only one barring service can be activated. This means that when a barring service is activated while another bar is already active within the same group, the new activation is accepted and the previous bar is deactivated.

      +

       

      +

      •Interaction with Operator Determined Barring (ODB)

      The feature operator determined barring (ODB) also belongs to the call restriction services. ODB services are applied separately and independently from the call barring services. Whereas the mobile subscriber can have control of the call barring services, the ODB services can only be regulated by the PLMN operator. The ODB services take precedence over the call barring services. This means that in the case of a call request, the ODB barring services are checked first.

      +

       

      +

      •Interaction with emergency calls

      An emergency call can always be set up, irrespective of whether an outgoing call barring service is active or not.

      +

       

      +

      •Interaction with call waiting

      The activation of an outgoing barring service at the calling mobile subscriber's side does not affect any currently waiting calls originated by the calling mobile subscriber.

      +

       

      +

      •Interaction with call hold

      If an outgoing barring service is activated after a call hold is invoked on an outgoing call, the held call can still be retrieved. Any new outgoing call to a non-allowed number by the barring service is barred.

      +

       

      +

      •Interaction with call forwarding

      It is possible that the restrictions imposed by a call barring service are in conflict with the destination imposed by call forwarding.

      +

      For instance, a mobile subscriber which is not allowed to make an outgoing call (BAOC) cannot activate a call forwarding service. Therefore, incompatibility checks are provided to determine these conflicts during the activation. So, in the example, the call forwarding activation is denied. The mobile subscriber requesting this call forwarding service shall be informed of the supplementary service incompatibility.

      +

      The incompatibilities between call barring and call forwarding are described in detail in GSM 02.82.

      +

       

      +
      +
      +

       

      +
      + + + +

      The Public Land Mobile Network (PLMN) offers a mobile subscriber the possibility of redirecting incoming calls to another directory number. This can be useful when a mobile subscriber is not able to answer the incoming call himself because, for instance, his station is busy or he cannot be reached. Calls can be forwarded in such cases.

      +

       

      +

      Four call forwarding services are available depending on the condition to be fulfilled first. These services are part of the supplementary service group call offering, as defined in GSM Recommendation 02.82.

      +

       

      +

      •Unconditional call forwarding is invoked upon calling the appropriate subscriber.

      •Conditional call forwarding consists of:

      •Call forwarding on mobile subscriber busy

      •Call forwarding on no reply

      •Call forwarding on mobile subscriber not reachable

       

      +
      +
      +

       

      +
      + + + +

      According to GSM Recommendation 02.83, call waiting is a multi-channel supplementary service and informs a busy mobile subscriber (i.e. already involved in an active call), provided with this service, of a new incoming call. When the active call is released, the waiting call becomes the active call after the traffic channel has been established.

      +

       

      +

      Call waiting is often used together with the call hold feature. Call hold is another multi-channel supplementary service which enables the mobile subscriber to temporarily interrupt the traffic channel of the active call. When the active call is put on hold, the subscriber is able to set up a new call, or to accept a waiting call.

      +

       

      +

      Compatibility with other Features

      +

       

      +

      •Call hold

      Both features "call waiting" and "call hold" are multi-channel services and may be used together as a result of a parallel transaction. They do not affect each other from a functional point of view.

      +

       

      +
      +
      +

       

      +
      + + + +

      According to GSM Recommendation 02.83, call hold is a multi-channel supplementary service which allows a mobile subscriber, when provided with the call hold feature, to temporarily interrupt an existing speech call. The traffic channel from the active call is released but remains assigned to the mobile subscriber in order to retrieve the held call later on. The served mobile subscriber can only have one call on hold at a time.

      +

       

      +

      When the call hold has been set up, the served mobile subscriber (call hold initiator) can:

      +

       

      +

      •alternate between both subscribers as many times as required, which means that he can retrieve the held call and put the active call on hold (if it is a speech call), and vice versa.

      •accept a waiting call. The consequence of accepting a waiting call is that either the call on hold or the active call has to be released. This has to be done because the served subscriber is able to handle only one active, one held and one waiting call.

      •disconnect the call to each separate subscriber or to both subscribers together.

       

      +

      Compatibility with other Features

      +

       

      +

      •Call waiting

      Both features "call hold" and "call waiting" are multi-channel services and may be used together as a result of a parallel transaction. They do not affect each other from a functional point of view.

      +

       

      +

      •Call transfer

      The call transfer service can only be invoked provided the served subscriber has one active call and one call on hold. The served mobile subscriber leaves both calls, the two remote parties are interconnected.

      +

       

      +
      +
      +

       

      +
      + + + +

      The supplementary service "Call Transfer" is a national service and allows a mobile subscriber involved in an existing voice connection to transfer this call to another subscriber.

      +

       

      +

      Compatibility with other Features

      +

       

      +

      •Mobile Terminated Call/Mobile Originated Call

      The call transfer invocation is not allowed if both calls are MTCs. The call transfer invocation is only allowed if either the active call is MTC and the held call an MOC or if the active call is an MOC and the held call MTC.

      +

       

      +

      •Call waiting

      Any involved subscriber (A, B or C) may receive a call waiting indication before or during the call transfer. However, the served subscriber A cannot invoke a call transfer as long as there is a call waiting for him.

      +

       

      +

      •Call hold

      If subscriber B puts his call to the served mobile subscriber A on hold before or during the transfer by the latter, the resulting call from C to B will remain held by subscriber B until he has retrieved it.

      +

      A similar effect occurs when subscriber B and C are interchanged.

      +

       

      +
      +
      +

       

      +
      + + + +

      The multi-party service allows a served mobile subscriber (i.e. having subscribed to the service) to manage a speech conference (teleservice 11) in which up to three parties are involved, the served mobile subscriber included.

      +

       

      +

      Using the multi-party service requires the mobile subscriber to have subscription to call hold. Only when the subscriber controls an active call and a call on hold can he invoke a multi-party call. Furthermore, a Media Resource Function server (MRF), which is composed of Media Resource Function Controller (MRFC) and Media Resource Function Processor (MRFP), is needed to perform multi-party call control.

      +

       

      +

      To connect an external MRF server (AudioCodes IPmedia Media Server), please refer to the following section:

      +

      •Connecting to IP media sever

       

      +

      Compatibility with other Features

      +

       

      +

      •Call waiting

      A busy subscriber is informed of a new incoming call (mobile terminated call) with a call waiting indication when the subscriber has subscription to the service. Even when the subscriber is busy due to a multi-party call he has invoked, he will receive a call waiting indication. He then also is allowed to answer the mobile terminated call.

      +

       

      +
      +
      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_34_01

      +

       

      +

      1.Go to EMS >Account >Subscriber >HLR.

       

      +

      2.Click the hyperlinked IMSI of the subscriber to open its Option window.

       

      +

      3.Check the Provision checkbox to provide the following supplementary services.

       

      +

      4.Ensure the Register checkbox is enabled for the Call Forwarding services, enter the forwarding number.

       

      +

      5.Provided supplementary service can be activated either by the subscriber or the service provider.

       

      +

      6.Click the 2_041 button to update modified attributes to HLR database.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Explanation

      +

      CLIP

      +

      Calling Line Identification Presentation:

      +

      It enables a called mobile subscriber provided with this feature to receive the calling line identity.

      +

      CLIR

      +

      Calling Line Identification Restriction:

      +

      When this service is invoked, the originating network informs the destination network that the calling line identity is not allowed to be presented.

      +

      COLP

      +

      Connected Line Identification Presentation

      +

      It provides the calling mobile subscriber with the possibility to receive the connected party's line identity.

      +

      COLR

      +

      Connected Line Identification Restriction

      +

      It enables the connected party to prevent the presentation of its line identity to the calling party.

      +

      BAOC

      +

      Barring of All Outgoing Calls:

      +

      This barring service prevents all outgoing setup possibilities, except for emergency calls.

      +

      BOIC

      +

      Barring of Outgoing International Calls:

      +

      This barring service allows the mobile subscriber to bar calls toward a country other than the one the user is currently located in.

      +

      BOIC-exHC

      +

      Barring of Outgoing International Calls except those directed towards the Home PLMN Country:

      +

      This barring service will only allow calls towards a party in the country of subscription.

      +

      BAIC

      +

      Barring of All Incoming Calls:

      +

      This barring service enables a mobile subscriber to prevent all incoming calls, independently of the subscriber's current location.

      +

      BIC-Roam

      +

      Barring of Incoming Calls when Roaming outside the home PLMN country:

      +

      This barring service allows a mobile subscriber to bar all incoming calls when roaming in another area than the home PLMN country.

      +

      CFU

      +

      Call Forwarding Unconditional:

      +

      Call forwarding unconditional allows a mobile subscriber to forward each incoming call to another directory number, whatever his condition may be.

      +

      CFB

      +

      Call Forwarding on mobile subscriber Busy:

      +

      Call forwarding on mobile subscriber busy allows a mobile subscriber to forward incoming calls due to a busy situation depending on either the mobile station or the network.

      +

      CFNRy

      +

      Call Forwarding on No Reply:

      +

      Call forwarding on no reply allows the subscriber to forward incoming calls if he does not reply within a specific time.

      +

      CFNRc

      +

      Call Forwarding on mobile subscriber Not Reachable:

      +

      Call forwarding on mobile subscriber not reachable enables a mobile subscriber to forward incoming calls when he is not reachable due to one of the following reasons:

      +

      •No paging response is received

      •Radio congestion between base station and mobile station

      CW

      +

      Call Waiting:

      +

      call waiting is a multi-channel supplementary service and informs a busy mobile subscriber, provided with this service, of a new incoming call.

      +

      CH

      +

      Call Hold:

      +

      Call hold is a multi-channel supplementary service which allows a mobile subscriber, when provided with the call hold feature, to temporarily interrupt an existing speech call.

      +

      ECT

      +

      Call Transfer:

      +

      Call transfer is a national service and allows a mobile subscriber involved in an existing voice connection to transfer this call to another subscriber.

      +

      Multi-party Call

      +

      The multi-party service allows a served mobile subscriber to manage a speech conference in which up to three parties are involved, the served mobile subscriber included.

      +

      However, using the multi-party service requires the mobile subscriber to have subscription to call hold. Only when the subscriber controls an active call and a call on hold can he invoke a multi-party call.

      +
      +
      +

       

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Administration

      +

      Explanation

      +

      Provision

      +

      The service provider offers the supplementary service to specific mobile subscribers as a result of a personal agreement. Giving a mobile subscriber subscription to a supplementary service is called provision.

      +

      Withdrawal

      +

      Operator controlled procedures are also provided to remove the subscriber's subscription to supplementary. This action is called withdrawal. Supplementary service can be withdrawn at the  subscriber's request or for administrative reasons.

      +

      Activation

      +

      The activation of a supplementary service implies that, when a call is set up by the served mobile subscriber, the applicability of an activated supplementary service will be checked.

      +

      Deactivation

      +

      The deactivation of a supplementary service is performed by means of an appropriate control procedure performed by the subscriber or by the service provider. A supplementary service can also be deactivated when another supplementary service is activated.

      +

      Registration

      +

      Register information of a specific basic service in the network.

      +

      Erasure

      +

      Erase the previous registration. A previous registration can be erased in one of three ways:

      +

      •The subscriber can specifically erase a previous registration with an appropriate control procedure.

      •The subscriber can register new information for the specific basic service, the previous registration will be overridden.

      •All information is erased as a result of withdrawal of the supplementary service (administrative handling).

      Interrogation

      +

      The interrogation procedure enables the served mobile subscriber to obtain information about the data stored in the PLMN. The mobile subscriber can request a list of all basic services to which a supplementary service is active. In addition, the subscriber is able to receive supplementary service information concerning one particular service. The interrogation of a supplementary service does not require a password.

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Manage HLR Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.34

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_34_01.gif b/wxc2_omc/omcHelp/2_34_01.gif new file mode 100755 index 0000000..73dc4f1 Binary files /dev/null and b/wxc2_omc/omcHelp/2_34_01.gif differ diff --git a/wxc2_omc/omcHelp/2_36.htm b/wxc2_omc/omcHelp/2_36.htm new file mode 100755 index 0000000..c7fb9cb --- /dev/null +++ b/wxc2_omc/omcHelp/2_36.htm @@ -0,0 +1,1241 @@ +锘� + + + Enabling Audio Announcement + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Audio Announcement

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Tones, indications and announcements inform the calling subscriber in the PLMN (mobile subscriber) as well as in the ISDN/PSTN (fixed network subscriber) of defined call setup statuses. Of central importance here are the call statuses which result in the disconnection (release) of a call when the dialed destination cannot be reached. Apart from this, however, additional information such as proceeding tones, supplementary service indications or non-terminating announcements may accompany call setup. In the UltraWAVE system tones and announcements or indications are determined by the service provider on a project-specific basis, whereas in the mobile stations, they are determined by their individual manufacturers. The network provides the stations with inband information (e.g. causes). Then the station's type determines whether they will be able to connect a tone or whether they can display an indication.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >AAS.

       

      +

      2.Make sure the System ID at the upper right corner displays AAS_0, click the 2_035 button.

       

      +

      2_36_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      System No.

      +

      Read only. The system number of AAS server, either 0 or 1.

      +

      --

      +

      AAS Prefix

      +

      Prefix for MSC announcement service.

      +

      BB

      +

      Play Times

      +

      Number of times to repeat a voice prompt.

      +

      3

      +
      +
      +

       

      +

      2_36_02

      +

       

      +

      1.Click the Link Management tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National Spare

      +

      MSISDN

      +

      Read only. The E.164 local node of SRF for prepaid service.

      +

      --

      +

      CC

      +

      The code that identifies the country's network.

      +

      --

      +

      NDC

      +

      Defines the national calling area or national network to which the subscriber belongs.

      +

      --

      +

      AAS 0 OPC

      +

      The unique decimal Point Code of AAS0.

      +

      7

      +

      AAS 0 DPC

      +

      The virtual Point Code of MSS for AAS0.

      +

      8

      +

      AAS 1 OPC

      +

      The unique decimal Point Code of AAS1.

      +

      17

      +

      AAS 1 DPC

      +

      The virtual Point Code of MSS for AAS1.

      +

      18

      +

      Flag Link 0

      +

      Enable or disable AAS link 0 to MSS.

      +

      Enable

      +

      Flag Link 1

      +

      Enable or disable AAS link 1 to MSS.

      +
      +
      +

       

      +

      1.Select AAS_1 from System ID drop-down menu.

       

      +

      2.Repeat the same operation and fill in the same parameters as the upper steps.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MTP3.

       

      +

      2.Make sure the System ID at the upper right corner displays MTP3(MSS_Pub), click the 2_035 button.

       

      +

      2_36_03 (MSS to AAS-0)

      +

       

      +

      1.Click the Link Set tab, and then click New at the bottom of the Linkset table.

       

      +

      2.In the Linkset ID box, select an available number for the new linkset, and then click the 2_002 button.

       

      +

      3.In the Linkset Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created linkset.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description  (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify network type of the AAS.

      +

      National Spare

      +

      DPC

      +

      Enter the Originating Point Code of AAS-0.

      +

      7

      +

      Loopback Option

      +

      Enable or disable loopback function on this linkset.

      +

      Enabled only for the MSC loopback linksets.

      +

      Disable

      +

      OPC Multiple

      +

      Enter the virtual Point Code of MSS for AAS-0.

      +

      8

      +
      +
      +

       

      +

      2_36_04 (AAS-0 to MSS)

      +

       

      +

      1.Click New at the bottom of the Linkset table.

       

      +

      2.In the Linkset ID box, select an available number for the new linkset, and then click the 2_002 button.

       

      +

      3.In the Linkset Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created linkset.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description  (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify network type of the AAS.

      +

      National Spare

      +

      DPC

      +

      Enter the virtual Point Code of MSS for AAS-0.

      +

      8

      +

      Loopback Option

      +

      Enable or disable loopback function on this linkset.

      +

      Enabled only for the MSC loopback linksets.

      +

      Disable

      +

      OPC Multiple

      +

      Enter the Originating Point Code of AAS-0.

      +

      7

      +
      +
      +

       

      +

      2_36_05 (MSS to AAS-0)

      +

       

      +

      1.Click the SG tab, and then click New at the bottom of the Signaling Gateway table.

       

      +

      2.In the SG ID box, select an available number for the new SG, and then click the 2_002 button.

       

      +

      3.In the Signaling Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created signaling gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Application Mode

      +

      Select the application mode of the signaling gateway.

      +

      Server

      +

      Signaling Type

      +

      Specify the type of the signaling gateway:

      +

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      ACK Option

      +

      The ACK message must be sent if there is request from the peer. Otherwise, the ACK message should not be sent.

      +

      Forbid

      +

      Remote IP

      +

      IP address of the AAS.

      +

      IP of AAS-0

      +
      +
      +

       

      +

      2_36_06 (AAS-0 to MSS)

      +

       

      +

      1.Click New at the bottom of the Signaling Gateway table.

       

      +

      2.In the SG ID box, select an available number for the new SG, and then click the 2_002 button.

       

      +

      3.In the Signaling Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created signaling gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Application Mode

      +

      Select the application mode of the signaling gateway.

      +

      Client

      +

      Signaling Type

      +

      Specify the type of the signaling gateway:

      +

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      ACK Option

      +

      The ACK message must be sent if there is request from the peer. Otherwise, the ACK message should not be sent.

      +

      Forbid

      +

      Remote IP

      +

      IP address of the MSS.

      +

      IP of MSS

      +
      +
      +

       

      +

      2_36_07 (MSS to AAS-0: Link0 and Link1)

      +

       

      +

      1.Click the Link tab, and then click New at the bottom of the Link table.

       

      +

      2.In the Link ID box, select an available number for the new link, and then click the 2_002 button.

       

      +

      3.In the Link Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created link.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      0

      +

      Host IP

      +

      Management server's IP of this link.

      +

      MSC0 = 172.18.98.1

      +

      MSC1 = 172.18.99.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      0

      +
      +
      +

       

      +

      6.Repeat Step 2 to 5 to add link 1.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      1

      +

      Host IP

      +

      Management server's IP of this link.

      +

      MSC1 = 172.18.99.1

      +

      MSC0 = 172.18.98.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      1

      +
      +
      +

       

      +

      2_36_08 (AAS-0 to MSS: Link0 and Link1)

      +

       

      +

      1.Click New at the bottom of the Link table.

       

      +

      2.In the Link ID box, select an available number for the new link, and then click the 2_002 button.

       

      +

      3.In the Link Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created link.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      0

      +

      Host IP

      +

      Management server's IP of this link.

      +

      AAS-0 = 172.18.98.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      255.255.255.255

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      0

      +
      +
      +

       

      +

      6.Repeat Step 2 to 5 to add link 1.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      1

      +

      Host IP

      +

      Management server's IP of this link.

      +

      AAS-0 = 172.18.98.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      255.255.255.255

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      1

      +
      +
      +

       

      +

      2_36_09 (MSS to AAS-0)

      +

       

      +

      1.Click the Nat S Network tab, and then click New at the bottom of the Nat S Routing table.

       

      +

      2.In the Nat S Routing ID box, select an available number for the new routing, and then click the 2_002 button.

       

      +

      3.In the Routing Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the connected AAS-0.

      +

      7

      +

      Normal Linkset

      +

      Enter the Linkset index number configured previously.

      +

      Linkset ID

      +

      Alternative Linkset

      +

      Assign an Alternative Linkset to the AAS. It will be activated when the Normal Linkset is unavailable.

      +

      Set 128 to disable alternative linkset.

      +

      128

      +
      +
      +

       

      +

      2_36_10 (AAS-0 to MSS)

      +

       

      +

      1.Click the Nat S Network tab, and then click New at the bottom of the Nat S Routing table.

       

      +

      2.In the Nat S Routing ID box, select an available number for the new routing, and then click the 2_002 button.

       

      +

      3.In the Routing Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the connected AAS-0.

      +

      8

      +

      Normal Linkset

      +

      Enter the Linkset index number configured previously.

      +

      Linkset ID

      +

      Alternative Linkset

      +

      Assign an Alternative Linkset to the MSC. It will be activated when the Normal Linkset is unavailable.

      +

      Set 128 to disable alternative linkset.

      +

      128

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Repeat the same procedures to configure MTP3 parameters for AAS-1. Just change the point code from 7 to 17, from 8 to 18.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MSC.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_36_11

      +

       

      +

      1.Click the Dialing Prefix Set tab.

       

      +

      2.Pick up the serving Dialing Prefix Set, and then click the hyperlinked number in the Dialing Prefix Entries to open the Prefix table.

       

      +

      3.Click New at the bottom of the Prefix table to add prefix for AAS.

       

      +

      4.In the Prefix ID box, click the 2_002 button.

       

      +

      5.In the Prefix Option window, configure the relevant parameters given in the following table.

       

      +

      6.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      7.Click the 2_036 button to activate the new created prefix.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Lookup Method

      +

      Select a dialing plan lookup method.

      +

      Prefix

      +

      Prefix

      +

      A combination digits that dial to originate a call.

      +

      **

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      Unknown

      +

      Flag

      +

      Enable or disable this prefix.

      +

      Enable

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      --

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Normal

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      --

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Disable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable if this prefix relating to Premium Call service.

      +

      Disable

      +

      Call Allow Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      Disable

      +

      Call Bar Flag

      +

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      Disable

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      Out Trunk Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Out Trunk Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      N/A

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      0

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number to convert it to an international E.164 format (CC and NDC included).

      +

      N/A

      +
      +
      +

       

      +

      2_36_12

      +

       

      +

      1.Click the Routing Zone Set tab.

       

      +

      2.Pick up the serving Routing Zone Set, and then click the hyperlinked number in the Routing Selection Entries to open the Routing Selection table.

       

      +

      3.Click New at the bottom of the Routing Selection table to add a Routing Selection for AAS-0.

       

      +

      4.In the RS ID box, select an available number for the new Routing Selection, click the 2_002 button.

       

      +

      5.In the Routing Selection Option window, configure the relevant parameters given in the following table.

       

      +

      6.Click the 2_041 button to update Routing Selection parameters to application servers.

       

      +

      7.Repeat step 3 to 6 to create a routing selection for AAS-1.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Trunk Group

      +

      Specify the Trunk Group to AAS.

      +

      --

      +

      Alternative TG Flag

      +

      Enable or disable alternative Trunk Group when the primary Trunk

      +

      Group is unavailable.

      +

      Disable

      +

      Alternative TG

      +

      Specify the alternative Trunk Group. It's available only when the previous Alternative TG Flag is enabled.

      +

      N/A

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Inserted Digits

      +

      The digits to be inserted to the front of the dialed number.

      +

      N/A

      +
      +
      +

       

      +

      2_36_13

      +

       

      +

      1.Click the Trunk Group tab, and then click New at the bottom of the Trunk Group table.

       

      +

      2.In the TG ID box, select an available number for the new Trunk Group, and then click the 2_002 button.

       

      +

      3.In the Trunk Group Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Trunk Group parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created Trunk Group.

       

      +

      6.Click the hyperlinked number in the Trunk Entries to open the Trunk table.

       

      +

      7.Click New at the bottom of the Trunk table to add the first AAS-0 trunk.

       

      +

      8.In the Trunk ID box, click the 2_002 button.

       

      +

      9.In the Trunk Option window, configure the relevant parameters given in the following table.

       

      +

      10.Click the 2_041 button to update Trunk parameters to application servers.

       

      +

      11.Click the 2_036 button to activate the new created Trunk.

       

      +

      12.Repeat Step 7 to 11 to add the second AAS-0 trunk.

       

      +

      13.Repeat Step 1 to 12 to add Trunk Group and Trunks for AAS-1.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Trunk Group

      +

      Administration State

      +

      Control the operation of the managed Trunk Group.

      +

      Unlocked

      +

      DPC

      +

      The Point Code of AAS0 and AAS1.

      +

      --

      +

      Network Indicator

      +

      Specify the trunk group to a network. Choose the same network as MTP3 setting.

      +

      National Spare

      +

      Protocol Type

      +

      Select the protocol type for this Trunk Group.

      +

      ISUP

      +

      Protocol Variant

      +

      Select the protocol variant for this Trunk Group.

      +

      ITU

      +

      Circuit Selection Mode

      +

      Circuit selection mode of the traffic channel connections.

      +

      Odd

      +

      Back Off Flag

      +

      Enable or disable Back Off when simultaneously select the same channel with the opposite side.

      +

      Disable

      +

      Tandem Restriction

      +

      Enable or disable Tandem to allow or prohibit transit calls from PSTN to PSTN via this trunk group.

      +

      Disable

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this trunk group

      +

      Disable

      +

      TG Type

      +

      Application type of this Trunk Group.

      +

      Normal

      +

      Routing Zone ID

      +

      Specify the Trunk Group to a Routing Zone Set.

      +

      255 = Apply to all Routing Zone

      +

      255

      +

      Alternative Routing Trigger

      +

      Specify the ID of the alternative Routing for backup purpose.

      +

      N/A

      +

      > Trunk

      +

      Administration State

      +

      Control the operation of the managed Trunk.

      +

      Unlocked

      +

      MG ID

      +

      Specify the Trunk to a Media Gateway. Not applicable to virtual MG.

      +

      --

      +

      Port ID

      +

      Specify the Trunk to a physical port of the selected Media Gateway. Not applicable to virtual MG.

      +

      --

      +

      Port Type

      +

      Specify the type of MG physical ports.

      +

      E1

      +

      Group ID

      +

      Select the application group for the Trunk.

      +

      Group 0

      +

      CIC Assignment Plan

      +

      Select a mode for the Circuit Identity Code assignment of this Trunk.

      +

      Typical

      +

      CIC Assignment

      +

      Specify the start CIC to the Trunk for typical mode.

      +

      0

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.36

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_36_01.gif b/wxc2_omc/omcHelp/2_36_01.gif new file mode 100755 index 0000000..3584f3c Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_01.gif differ diff --git a/wxc2_omc/omcHelp/2_36_02.gif b/wxc2_omc/omcHelp/2_36_02.gif new file mode 100755 index 0000000..792c047 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_02.gif differ diff --git a/wxc2_omc/omcHelp/2_36_03.gif b/wxc2_omc/omcHelp/2_36_03.gif new file mode 100755 index 0000000..3ac7d06 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_03.gif differ diff --git a/wxc2_omc/omcHelp/2_36_04.gif b/wxc2_omc/omcHelp/2_36_04.gif new file mode 100755 index 0000000..1608092 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_04.gif differ diff --git a/wxc2_omc/omcHelp/2_36_05.gif b/wxc2_omc/omcHelp/2_36_05.gif new file mode 100755 index 0000000..0c173e7 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_05.gif differ diff --git a/wxc2_omc/omcHelp/2_36_06.gif b/wxc2_omc/omcHelp/2_36_06.gif new file mode 100755 index 0000000..a6548f5 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_06.gif differ diff --git a/wxc2_omc/omcHelp/2_36_07.gif b/wxc2_omc/omcHelp/2_36_07.gif new file mode 100755 index 0000000..616332c Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_07.gif differ diff --git a/wxc2_omc/omcHelp/2_36_08.gif b/wxc2_omc/omcHelp/2_36_08.gif new file mode 100755 index 0000000..5970e19 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_08.gif differ diff --git a/wxc2_omc/omcHelp/2_36_09.gif b/wxc2_omc/omcHelp/2_36_09.gif new file mode 100755 index 0000000..e4a45c0 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_09.gif differ diff --git a/wxc2_omc/omcHelp/2_36_10.gif b/wxc2_omc/omcHelp/2_36_10.gif new file mode 100755 index 0000000..d54fd38 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_10.gif differ diff --git a/wxc2_omc/omcHelp/2_36_11.gif b/wxc2_omc/omcHelp/2_36_11.gif new file mode 100755 index 0000000..c5830ff Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_11.gif differ diff --git a/wxc2_omc/omcHelp/2_36_12.gif b/wxc2_omc/omcHelp/2_36_12.gif new file mode 100755 index 0000000..b3f1a48 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_12.gif differ diff --git a/wxc2_omc/omcHelp/2_36_13.gif b/wxc2_omc/omcHelp/2_36_13.gif new file mode 100755 index 0000000..150d940 Binary files /dev/null and b/wxc2_omc/omcHelp/2_36_13.gif differ diff --git a/wxc2_omc/omcHelp/2_37.htm b/wxc2_omc/omcHelp/2_37.htm new file mode 100755 index 0000000..52bcc1d --- /dev/null +++ b/wxc2_omc/omcHelp/2_37.htm @@ -0,0 +1,118 @@ +锘� + + + Enabling VLR Purge + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling VLR Purge

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      To purge the subscriber record if a subscriber becomes inactive whilst in the area of UltraWAVE VLR. The VLR deletes the subscriber's data after a fixed time period of inactivity and informs the HLR (e.g. when the phone has been switched off and left off or when the subscriber has moved to an area with no coverage for a long time).

      +

       

      +

       

      +

      Implementation

      +

       

      +

      2_37_06

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      VLR Purge

      +

      Enable or disable the VLR Purging feature.

      +

      When this feature is enabled, the system will purge subscribers from VLR once they reach the threshold specified in the Idle Period to Purge field.

      +

      Enable

      +

      Idle Period to Purge

      +

      This field determines how long a VLR entry can remain idle before the VLR purges it.

      +

      The minimum unit is 1 minute. The maximum is 65535 minutes.

      +

      360

      +
      +
      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable Ciphering

       

      +

      •Enable TMSI Reallocate

       

      +

      •Enable Equipment Identity Register

       

      +

      •Manage VLR Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.37

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_37_01.gif b/wxc2_omc/omcHelp/2_37_01.gif new file mode 100755 index 0000000..23c5f4c Binary files /dev/null and b/wxc2_omc/omcHelp/2_37_01.gif differ diff --git a/wxc2_omc/omcHelp/2_37_06.gif b/wxc2_omc/omcHelp/2_37_06.gif new file mode 100755 index 0000000..77e7427 Binary files /dev/null and b/wxc2_omc/omcHelp/2_37_06.gif differ diff --git a/wxc2_omc/omcHelp/2_38.htm b/wxc2_omc/omcHelp/2_38.htm new file mode 100755 index 0000000..af0c349 --- /dev/null +++ b/wxc2_omc/omcHelp/2_38.htm @@ -0,0 +1,119 @@ +锘� + + + Enabling Ciphering + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Ciphering

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Ciphering is a mechanism to ensure the subscriber's privacy on the radio path by confidentially transmitting both user information and associated signaling data. To this end, the data transmitted via the radio path is not the proper user data, but a binary combination of this user data and a ciphering bit stream. Ciphering is achieved by performing an operation between a variable pseudo-random sequence and the useful data.

      +

       

      +

      Encrypted voice and data communications between the MS and the network is accomplished through use of the ciphering algorithm A5. Encrypted communication is initiated by a ciphering mode request command from the GSM network. Upon receipt of this command, the mobile station begins encryption and decryption of data using the ciphering algorithm (A5) and the ciphering key (Kc).

      +

       

      +

       

      +

      Implementation

      +

       

      +

      2_38_06

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Ciphering

      +

      Enabling this parameter forces the mobile to use ciphering over the air interface.

      +

      Enable

      +

      Ciphering Algorithm

      +

      Select a ciphering algorithm from the drop-down menu. These algorithms encrypt voice between the mobile station and the base station.

      +

      A5_1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable VLR Purge

       

      +

      •Enable TMSI Reallocate

       

      +

      •Enabling Equipment Identity Register

       

      +

      •Manage VLR Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.38

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_38_06.gif b/wxc2_omc/omcHelp/2_38_06.gif new file mode 100755 index 0000000..d54bcbe Binary files /dev/null and b/wxc2_omc/omcHelp/2_38_06.gif differ diff --git a/wxc2_omc/omcHelp/2_39.htm b/wxc2_omc/omcHelp/2_39.htm new file mode 100755 index 0000000..3c6083f --- /dev/null +++ b/wxc2_omc/omcHelp/2_39.htm @@ -0,0 +1,113 @@ +锘� + + + Enabling TMSI Reallocation + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling TMSI Reallocation

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The TMSI (Temporary Mobile Subscriber Identity) reallocation function periodically assigns a new TMSI to a mobile subscriber. The purpose of this function is to prevent an intruder from identifying a mobile subscriber by listening to the signaling on the radio path. To increase confidentiality, the TMSI is reallocated at particular moments in time.

      +

       

      +

      TMSI reallocation is performed in the following way:

      +

      •The mobile subscriber sends the TMSI together with the location area identity (LAI) to the VLR when accessing the network,  e.g. during a location update.

      •The VLR allocates a new TMSI to the mobile subscriber and sends it in a coded form (ciphering) to the mobile subscriber.

      •The mobile subscriber stores the new TMSI and sends an acknowledgment to the MSC/VLR to release the old TMSI in the subscriber database and within the TMSI/IMSI correlation table.

       

      +

      To enable TMSI Reallocation, VLR parameters need to be configured on NSS side.

      +

       

      +

       

      +

      Implementation

      +

       

      +

      2_39_05

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      TMSI Allocation

      +

      TMSI allocation control flag:

      +

      •Disable:  TMSI allocation is forbidden for all system subscribers.

      •Allocation: To allocate the exclusive TMSI  to the same subscriber every time a call management service is requested.

      •Reallocation: To allocate a new TMSI every time a call management service is requested.

      Reallocation

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable Ciphering

       

      +

      •Enable VLR Purge

       

      +

      •Enabling Equipment Identity Register

       

      +

      •Manage VLR Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.39

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_39_05.gif b/wxc2_omc/omcHelp/2_39_05.gif new file mode 100755 index 0000000..f0b0047 Binary files /dev/null and b/wxc2_omc/omcHelp/2_39_05.gif differ diff --git a/wxc2_omc/omcHelp/2_41.htm b/wxc2_omc/omcHelp/2_41.htm new file mode 100755 index 0000000..31e0041 --- /dev/null +++ b/wxc2_omc/omcHelp/2_41.htm @@ -0,0 +1,796 @@ +锘� + + + Enabling Emergency Call + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Emergency Call

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      According to the GSM official terminology (GSM Recommendations 02.03 and 02.30), an emergency call is a mobile originating call to a nearby emergency call center (e.g. the police). Emergency calling is a teleservice derived from telephony, but it provides a simple and unified procedure to set up an emergency call. The emergency call will be connected at no charge.

      +

       

      +

      GSM prescribes a standard emergency number (i.e. dialing 112) which is accepted throughout the world. In addition, the mobile equipment manufacturer can provide an SOS key which initiates this internationally accepted emergency number when pressed. The PLMN operator can install some abbreviated (emergency) numbers for certain country-dependent or area-dependent emergency service centers. Calls are then routed to a nearby service point, based on the cell-oriented routing feature.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, configure the necessary parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      EC Setup Allowed

      +

      Enabling this parameter allows a non-registered mobile or a mobile with no SIM to make emergency calls.

      +

      Enable

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      For example: Subscriber dials 112, MSC transforms 112 to 623157 and routes it to emergency center.

      +

       

      +

      1.Refer to previous section to Enable Local Call.

       

      +

      2.Go to EMS >Configuration >NSS >MSC.

       

      +

      3.Click the 2_035 button at the upper right corner.

       

      +

      2_41_01

      +

       

      +

      1.Click on the proper hyperlinked number to open the Location Area configuration window.

       

      +

      2.Choose an idle item from the 0 to 7 Emergency Number list and record its index number.

       

      +

      3.Add the Emergency Number which will be routed to emergency center.

       

      +

      4.Click the 2_041 button to update Location Area parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Emergency Number 0~7

      +

      The emergency number, which subscriber dialed in the specific Location Area, will be transformed to this number and route to the emergency center.

      +

      623157

      +
      +
      +

       

      +

      2_41_02

      +

       

      +

      1.Click on the proper hyperlinked number to open the Dialing Prefix Set configuration window.

       

      +

      2.Click the hyperlinked number in the Dialing Prefix Entries to open the Dialing Prefix table.

       

      +

      3.Click New at the bottom of the Prefix table to create Emergency Number (112) prefix.

       

      +

      4.Configure the necessary parameters given in the following table.

       

      +

      5.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      6.Repeat step 3 to 5 to add the transformed Emergency Number (623157) prefix.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Prefix

      +

      A combination digits that dial to originate a call.

      +

      112

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      Unknown

      +

      Flag

      +

      Enable or disable this prefix.

      +

      Enable

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      3

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Emergency

      +

      Emergency Type

      +

      It's correlated with the index of emergency number selected in  Location Area.

      +

      --

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      --

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Enable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable if this prefix relating to Premium Call service.

      +

      Disable

      +

      Call Allow Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      Disable

      +

      Call Bar Flag

      +

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      Disable

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      Out Trunk Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Out Trunk Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      N/A

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      0

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Prefix

      +

      A combination digits that dial to originate a call.

      +

      623157

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      Unknown

      +

      Flag

      +

      Enable or disable this prefix.

      +

      Enable

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      6

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Normal

      +

      Emergency Type

      +

      It's correlated with the index of emergency number selected in  Location Area.

      +

      N/A

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      --

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Enable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable if this prefix relating to Premium Call service.

      +

      Disable

      +

      Call Allow Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      Disable

      +

      Call Bar Flag

      +

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      Disable

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      Out Trunk Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Out Trunk Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      N/A

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      0

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      For example: Subscriber dials 112, MSC transforms 112 to 623157 and routes it to emergency center.

      +

       

      +

      1.Refer to previous section to Enable Local Call.

       

      +

      2.Go to EMS >Configuration >NSS >MSC.

       

      +

      3.Click the 2_035 button at the upper right corner.

       

      +

      2_41_01

      +

       

      +

      1.Click on the proper hyperlinked number to open the Location Area configuration window.

       

      +

      2.Click the hyperlinked number in the Cell Entries to open the Cell table.

       

      +

      3.Click on the proper hyperlinked number to open the Cell configuration window.

       

      +

      4.Choose an idle item from the 0 to 7 Emergency Number list and record its index number.

       

      +

      5.Configure the Emergency Number which will be routed to emergency center.

       

      +

      6.Click the 2_041 button to update Cell parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Emergency Number 0~7

      +

      The emergency number, which subscriber dialed in the specific Location Area, will be transformed to this number and route to the emergency center.

      +

      623157

      +
      +
      +

       

      +

      2_41_02

      +

       

      +

      1.Click on the proper hyperlinked number to open the Dialing Prefix Set configuration window.

       

      +

      2.Click the hyperlinked number in the Dialing Prefix Entries to open the Dialing Prefix table.

       

      +

      3.Click New at the bottom of the Prefix table to create Emergency Number (112) prefix.

       

      +

      4.Configure the necessary parameters given in the following table.

       

      +

      5.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      6.Repeat step 3 to 5 to add the transformed Emergency Number (623157) prefix.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Prefix

      +

      A combination digits that dial to originate a call.

      +

      112

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      Unknown

      +

      Flag

      +

      Enable or disable this prefix.

      +

      Enable

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      3

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Emergency

      +

      Emergency Type

      +

      It's correlated with the index of emergency number selected in  Location Area.

      +

      --

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      --

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Enable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable if this prefix relating to Premium Call service.

      +

      Disable

      +

      Call Allow Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      Disable

      +

      Call Bar Flag

      +

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      Disable

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      Out Trunk Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Out Trunk Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      N/A

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      0

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Prefix

      +

      A combination digits that dial to originate a call.

      +

      623157

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      Unknown

      +

      Flag

      +

      Enable or disable this prefix.

      +

      Enable

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      6

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Normal

      +

      Emergency Type

      +

      It's correlated with the index of emergency number selected in  Location Area.

      +

      N/A

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      --

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Enable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable if this prefix relating to Premium Call service.

      +

      Disable

      +

      Call Allow Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      Disable

      +

      Call Bar Flag

      +

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      Disable

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      Out Trunk Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Out Trunk Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      N/A

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      0

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.41

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_41_01.gif b/wxc2_omc/omcHelp/2_41_01.gif new file mode 100755 index 0000000..179891d Binary files /dev/null and b/wxc2_omc/omcHelp/2_41_01.gif differ diff --git a/wxc2_omc/omcHelp/2_41_02.gif b/wxc2_omc/omcHelp/2_41_02.gif new file mode 100755 index 0000000..f84dca1 Binary files /dev/null and b/wxc2_omc/omcHelp/2_41_02.gif differ diff --git a/wxc2_omc/omcHelp/2_42.htm b/wxc2_omc/omcHelp/2_42.htm new file mode 100755 index 0000000..9060cb8 --- /dev/null +++ b/wxc2_omc/omcHelp/2_42.htm @@ -0,0 +1,302 @@ +锘� + + + Enabling SM Service + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling SM Service

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Short message service is a mechanism of delivery of text messages over the mobile networks. It is a store and forward way of transmitting messages to and from mobiles. The message from the sending mobile is stored in a central short message center (SMS) which then forwards it to the destination mobile. This means that in the case that the recipient is not available, the short message is stored and can be sent later. Each short message can be up to 160 characters. These characters can be text (alphanumeric) or binary Non-Text Short messages. An interesting feature of SMS is return receipts. This means that the sender, if  he wishes, can get a small message notifying if the short message was delivered to the intended recipient. Since the SMS uses signaling channel as opposed to dedicated channels, these messages can be sent/received simultaneously with the voice/data/fax service over the GSM network.

      +

       

      +

      To enable short message service, SCCP, XAPP and SMSC parameters need to be configured on NSS side.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button.

       

      +

      2_30_07

      +

       

      +

      1.Click the Local Node tab.

       

      +

      2.Click the hyperlinked index number of SMSC to open the SMSC Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      MSISDN

      +

      The E.164 node address of SMSC.

      +

      CC+NDC+SN

      +

      IP 0

      +

      IP address of the SMSC 0.

      +

      SMSC0 = 172.18.98.1

      +

      IP 1

      +

      IP address of the SMSC 1.

      +

      SMSC1 = 172.18.99.1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMSC.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_42_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of short messages.

      +

      Enable

      +

      SM Validity Period

      +

      Define the maximum duration of a pending message which should be kept in sending array till reaches the called subscriber. Messages can't send out in the validity period will be deleted. The minimum unit is 1 Second.

      +

      43200

      +

      Log Flag

      +

      Enable or disable the log generation of the short message service.

      +

      Enable

      +
      +
      +

       

      +

      2_42_02

      +

       

      +

      1.Click the MSISDN Segment tab to display the MSISDN Segment table.

       

      +

      2.Click the hyperlinked index of an unoccupied line to open its Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      MSISDN Start

      +

      The MSISDN range of subscribers that are allowed to use the short message services. Specify the beginning of MSISDN range.

      +

      --

      +

      MSISDN End

      +

      The MSISDN range of subscribers that are allowed to use the short message services. Specify the end of MSISDN range.

      +

      --

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      This setting allows to customize the Calling Line Identification from one format to another format, which will be displayed to the called subscriber.

      +

       

      +

      1.Go to EMS >Configuration >NSS >XAPP.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_42_03

      +

       

      +

      1.Click the CLI Manipulation tab, and then click New at the bottom of the CLI Manipulation table.

       

      +

      2.In the CLI Manipulation ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the CLI Manipulation Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Original NAI

      +

      Original Number Attribute Identity of the caller numbers beginning with this prefix.

      +

      IDD

      +

      Prefix

      +

      The prefix of caller number.

      +

      --

      +

      Deletion Count

      +

      Determines how many digits of the incoming caller number should be deleted.

      +

      --

      +

      Modified NAI

      +

      Number Attribute Identity of the caller number after manipulation.

      +

      Unknown

      +

      Insertion Count

      +

      Determines how many digits will be inserted to the front.

      +

      0

      +

      Inserted Digits

      +

      Determines which digits should be inserted to the beginning.

      +

      N/A

      +

      Length of Number

      +

      The length of incoming caller number.

      +

      --

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.42

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_42_01.gif b/wxc2_omc/omcHelp/2_42_01.gif new file mode 100755 index 0000000..2fb1ed4 Binary files /dev/null and b/wxc2_omc/omcHelp/2_42_01.gif differ diff --git a/wxc2_omc/omcHelp/2_42_02.gif b/wxc2_omc/omcHelp/2_42_02.gif new file mode 100755 index 0000000..a103248 Binary files /dev/null and b/wxc2_omc/omcHelp/2_42_02.gif differ diff --git a/wxc2_omc/omcHelp/2_42_03.gif b/wxc2_omc/omcHelp/2_42_03.gif new file mode 100755 index 0000000..d5219a3 Binary files /dev/null and b/wxc2_omc/omcHelp/2_42_03.gif differ diff --git a/wxc2_omc/omcHelp/2_43.htm b/wxc2_omc/omcHelp/2_43.htm new file mode 100755 index 0000000..eac59c7 --- /dev/null +++ b/wxc2_omc/omcHelp/2_43.htm @@ -0,0 +1,270 @@ +锘� + + + Enabling Premium Call + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Premium Call

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Premium Call is a call during which certain services are provided, and for which prices higher or lower than normal are charged. Unlike a normal call, part of the call charge is paid to the service provider, thus enabling businesses to be funded via the calls. While the tariff is different, calls are usually routed the same way they are for a toll-free telephone number, being anywhere despite the area code used.

      +

       

      +

      The issuing of the premium call numbers to service providers is typically regulated by a national body to ensure certain community standards are adhered to both in terms of content and price. Charges are presented as part of the normal telephone bill.

      +

       

      +

      Chat lines and tech support are a very common use of premium-rate numbers. Other services include directory inquiries, weather forecasts, competitions and voting (especially relating to television shows). Diplomatic services, such as the US embassy in London or the UK Embassy in Washington, have also been seen to charge premium rates for calls from the general public.

      +

       

      +

       

      +

      Implementation

      +

       

      +

      2_43_04

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MSC.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_43_01

      +

       

      +

      1.Click the Dialing Prefix Set tab to display the Dialing Prefix Set table.

       

      +

      2.Click the proper hyperlinked index of an existing Dialing Prefix Set to open its Option window.

       

      +

      3.Click the hyperlinked number in the Dialing Prefix Entries field to open the Prefix table.

       

      +

      4.Click New at the bottom of the Prefix table to add premium prefix.

       

      +

      5.In the Prefix ID box, click the 2_002 button.

       

      +

      6.In the Prefix Option window, configure the relevant parameters given in the following table.

       

      +

      7.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      8.Click the 2_036 button to activate the new created premium prefix.

       

      +

      9.Repeat Step 4 to 8 to add more premium prefixes.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Dialing Prefix

      +

      Prefix

      +

      A combination digits that dial to originate the premium call.

      +

      --

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      Unknown

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      --

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Normal

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      --

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Enable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable Premium Call service and select a category.

      +

      Enable

      +

      OSB 1 Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with the Flag enabled.

      +

      Disable

      +

      OSB 2 Flag

      +

      Subscribers with OSB type 2 can only make calls to this dialing prefix with the Flag enabled.

      +

      Disable

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      --

      +

      Out Trunk Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      --

      +

      Out Trunk Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      --

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      --

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number to convert it to an international E.164 format (CC and NDC included).

      +

      --

      +
      +
      +

       

      +

      2_43_02

      +

       

      +

      1.Go to EMS >Account >Subscriber >HLR.

       

      +

      2.Click the hyperlinked IMSI of the subscriber to open its Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update modified attributes to HLR database.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      ODB Status

      +

      A flag indicates whether a subscriber is subject to operator determined barring.

      +

      Operator Determined Barring

      +

      ODB General Data

      +

      Set the flag of premium call services:

      +

      •BPRIC: Bar of Premium Rate Information Call

      •BPREC: Bar of Premium Rate Entertainment Call

      Check to enable

      +
      +
      +

       

      +

      2_43_03

      +

       

      +

      Refer to the hyperlinked section to Create and Activate Tariff for premium call prefixes.

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable OSB Call

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.43

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_43_01.gif b/wxc2_omc/omcHelp/2_43_01.gif new file mode 100755 index 0000000..6e29db8 Binary files /dev/null and b/wxc2_omc/omcHelp/2_43_01.gif differ diff --git a/wxc2_omc/omcHelp/2_43_02.gif b/wxc2_omc/omcHelp/2_43_02.gif new file mode 100755 index 0000000..140d0de Binary files /dev/null and b/wxc2_omc/omcHelp/2_43_02.gif differ diff --git a/wxc2_omc/omcHelp/2_43_03.gif b/wxc2_omc/omcHelp/2_43_03.gif new file mode 100755 index 0000000..45c67a6 Binary files /dev/null and b/wxc2_omc/omcHelp/2_43_03.gif differ diff --git a/wxc2_omc/omcHelp/2_43_04.gif b/wxc2_omc/omcHelp/2_43_04.gif new file mode 100755 index 0000000..cb13747 Binary files /dev/null and b/wxc2_omc/omcHelp/2_43_04.gif differ diff --git a/wxc2_omc/omcHelp/2_44.htm b/wxc2_omc/omcHelp/2_44.htm new file mode 100755 index 0000000..fa14b0a --- /dev/null +++ b/wxc2_omc/omcHelp/2_44.htm @@ -0,0 +1,236 @@ +锘� + + + Enabling Authentication + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Authentication

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Authentication Center or AUC is a function to authenticate each SIM card that attempts to connect to the GSM network. Once the authentication is successful, the HLR is allowed to manage the SIM and services. If the authentication fails, then no services are possible from that particular combination of SIM card and mobile phone operator attempted. There is an additional form of identification check performed on the serial number of the mobile phone described in the EIR section below, but this is not relevant to the AUC processing.

      +

       

      +

      In the authentication process, each MS sends a registration request and receives a unique challenge from the network. The MS calculates the response to its challenge and sends a message back to the network. The VLR, which contains a list of triplets (unique challenge, response to the challenge, and private key), compares the triplets with the response it received from the MS. If the response matches, the MS is registered with the network and the used triplet discarded. After all triplets are used, the VLR queries HLR for a new set. Each query typically results in three triplets. The UltraWAVE system can optionally give permission to reuse triplets to reduce the communications load.

      +

       

      +

      To enable Authentication, SCCP and VLR parameters need to be configured on NSS side.

      +

       

      +

       

      +

      Implementation

      +

       

      +

      2_44_12

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button .

       

      +

      2_30_07

      +

       

      +

      1.Click the Local Node tab.

       

      +

      2.Click the hyperlinked index number of AUC to open the AUC Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      MSISDN

      +

      The E.164 node address of AUC.

      +

      CC+NDC+SN format

      +

      IP 0

      +

      IP address of AUC 0.

      +

      172.18.98.1

      +

      IP 1

      +

      IP address of AUC 1.

      +

      172.18.99.1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, click parameter value in Authentication field to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table, click the 2_041 button to return.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Location Update

      +

      Enabling this parameter forces the system to verify the authentication info of the mobile subscriber while performing a Location Update.

      +

      Enable

      +

      MO

      +

      Enabling this parameter forces the system to verify the authentication info of the mobile subscriber while making a Mobile Originating call.

      +

      Disable

      +

      MT

      +

      Enabling this parameter forces the system to verify the authentication info of the mobile subscriber while making a Mobile Terminating call.

      +

      Disable

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, click parameter value in Reuse Triplets field to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table, click the 2_041 button to return.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Reuse Triplets

      +

      Enabling this parameter permits a mobile to reuse triplets previously assigned to it by the system.

      +

      Enable

      +

      Double Authentication

      +

      Enable this parameter to force the system to perform a second authentication processes when the initial authentication fails.

      +

      --

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable Ciphering

       

      +

      •Enable Equipment Identity Register

       

      +

      •Manage AUC Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.44

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_44_12.gif b/wxc2_omc/omcHelp/2_44_12.gif new file mode 100755 index 0000000..93883c7 Binary files /dev/null and b/wxc2_omc/omcHelp/2_44_12.gif differ diff --git a/wxc2_omc/omcHelp/2_45.htm b/wxc2_omc/omcHelp/2_45.htm new file mode 100755 index 0000000..4dd4196 --- /dev/null +++ b/wxc2_omc/omcHelp/2_45.htm @@ -0,0 +1,193 @@ +锘� + + + Enabling IMEI Checking + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling IMEI Checking

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The International Mobile Equipment Identity (IMEI) is a number unique to every GSM mobile phone. It is usually found printed on or underneath the phone's battery and can also be found by dialing the sequence *#06# into the phone.

      +

       

      +

      The purpose of a mobile equipment's IMEI is to provide a means to identify, trace, track or deny service to the mobile station when it is used by a subscriber to access the network. When an event requiring an IMEI check occurs (e.g. MOC, location update), the MSC requests the IMEI from the mobile station. The events requiring an IMEI check can be administered within the MSC.

      +

       

      +

      The Equipment Identity Register (EIR) is a function to identify valid IMEIs and therefore can be used to stop a stolen phone from accessing the network. For example, if a mobile phone is stolen, the owner can call his or her network provider and instruct them to "ban" the phone using its IMEI number. This renders the phone useless, regardless of whether the phone's SIM is changed.

      +

       

      +

      To enable IMEI checking, SCCP and VLR parameters need to be configured on NSS side.

      +

       

      +

       

      +

      Implementation

      +

       

      +

      2_45_09

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button .

       

      +

      2_30_07

      +

       

      +

      1.Click the Local Node tab.

       

      +

      2.Click the hyperlinked index number of EIR to open the EIR Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      MSISDN

      +

      The E.164 node address of EIR.

      +

      CC+NDC+SN format

      +

      IP 0

      +

      IP address of EIR 0.

      +

      172.18.98.1

      +

      IP 1

      +

      IP address of EIR 1.

      +

      172.18.99.1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, click parameter value in IMSI Verification field to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table, click the 2_041 button to return.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Location Update

      +

      Enabling this parameter forces the system to check the validation of the International Mobile Equipment Identity while performing a Location Update.

      +

      Enable

      +

      MO

      +

      Enabling this parameter forces the system to check the validation of the International Mobile Equipment Identity while  making a Mobile Originating call.

      +

      Disable

      +

      MT

      +

      Enabling this parameter forces the system to check the validation of the International Mobile Equipment Identity while  making a Mobile Terminating call.

      +

      Disable

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable Ciphering

       

      +

      •Enable Authentication Service

       

      +

      •Manage EIR Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.45

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_45_09.gif b/wxc2_omc/omcHelp/2_45_09.gif new file mode 100755 index 0000000..e0afbe8 Binary files /dev/null and b/wxc2_omc/omcHelp/2_45_09.gif differ diff --git a/wxc2_omc/omcHelp/2_46.htm b/wxc2_omc/omcHelp/2_46.htm new file mode 100755 index 0000000..b25353a --- /dev/null +++ b/wxc2_omc/omcHelp/2_46.htm @@ -0,0 +1,311 @@ +锘� + + + Enabling OSB Call + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling OSB Call

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Called Number Prefix Barring feature allows an operator or service provider to bar subscriber within his home PLMN from making an outgoing call with certain destination prefix. There can be multiple destination prefixes to be barred and they are configurable. There are two different profiles allowed to be set. Each profile contains a different set of number prefixes subject to barring. Operator can then assign different profiles to different subscribers according to the services they have subscribed.

      +

       

      +

      This feature provides operators a truly flexible call barring tool for a variety of destinations to be restricted. Since the restriction is dialing prefix based, this feature gives the operator full flexibility to bar some subscribers from calling any call destinations. no matter it is local or domestic or international. This is in addition to the already implemented standard international call barring and the Operator Determined Call Barring features. The operators may want to enable the barring for those who have difficulty paying the bills while putting not barring for their premium subscribers.

      +

       

      +

      There are two OSB attributes, OSB-1 & OSB-2 flags, defined in each Dialing Prefix鈥檚 propriety. If a Dialing prefix鈥檚 OSB flag is enabled then this Dialing Prefix is subject to that OSB call restriction. The operator constructs the two OSB profiles by setting the OSB flags of the Dialing Prefixes. The operator could apply one or two OSB profile(s) to the subscribers. When a subscriber with OSB applied tries to make an outgoing call with the number which Dialing Prefix OSB is enabled, the call will be barred. This feature has no impact on the mobile terminated calls.

      +

       

      +

      A voice notification will be produced when a call is barred. The voice announcement is to inform the subscriber why call is barred so that the subscriber is not mistaken in thinking that the system is not connecting a particular call.

      +

       

      +

       

      +

      Implementation

      +

       

      +

      2_46_05

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MSC.

       

      +

      2.Make sure the System ID at the upper right corner displays MSC_pub, click the 2_035 button.

       

      +

      2_43_01

      +

       

      +

      1.Click the Dialing Prefix Set tab to display the Dialing Prefix Set table.

       

      +

      2.Click the proper hyperlinked index of an existing Dialing Prefix Set to open its Option window.

       

      +

      3.Click the hyperlinked number in the Dialing Prefix Entries field to open the Prefix table.

       

      +

      4.Click New at the bottom of the Prefix table to add OSB prefix.

       

      +

      5.In the Prefix ID box, click the 2_002 button.

       

      +

      6.In the Prefix Option window, configure the relevant parameters given in the following table.

       

      +

      7.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      8.Click the 2_036 button to activate the new created premium prefix.

       

      +

      9.Repeat Step 4 to 8 to add more OSB prefixes.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Dialing Prefix

      +

      Prefix

      +

      A combination digits that dial to originate the premium call.

      +

      --

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      Unknown

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      --

      +

      Call Type

      +

      Service type of the outgoing call.

      +

      Normal

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      --

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Enable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable Premium Call service and select a category.

      +

      Disable

      +

      OSB 1 Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with the Flag enabled.

      +

      •Enable

      •Disable

      OSB 2 Flag

      +

      Subscribers with OSB type 2 can only make calls to this dialing prefix with the Flag enabled.

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      --

      +

      Out Trunk Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      --

      +

      Out Trunk Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      --

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      --

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number to convert it to an international E.164 format (CC and NDC included).

      +

      --

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Make sure the System ID at the upper right corner displays VLR_pub, click the 2_035 button.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      OSB Definition

      +

      These options allow the operator to set whether a call is allowed or barred:

      +

      •If this option is set to call allow, the call with the called number matched the dialing prefix with the OSB attribute enabled will be allowed to pass through, all other calls will be barred.

      •If it is set to call bar, the call with the destination number matching the dialing prefix defined with the OSB attribute enabled will be barred while all other calls will be allowed.

      •OSB1=Disable, OSB2=Allowed

      •OSB1=Allowed, OSB2=Disable

      •OSB1=Disable, OSB2=Barred

      •OSB1=Barred, OSB2=Disable

      •OSB1=Allowed, OSB2=Allowed

      •OSB1=Allowed, OSB2=Barred

      •OSB1=Barred, OSB2=Allowed

      •OSB1=Barred, OSB2=Barred

      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_2_01

      +

       

      +

      1.Go to EMS >Account >Subscriber >HLR.

       

      +

      2.Click the hyperlinked IMSI of the subscriber to open its Option window.

       

      +

      3.Click the 2_040 button at the top of the parameter table to update values from HLR servers.

       

      +

      4.Configure the relevant parameters given in the following table.

       

      +

      5.Click the 2_041 button to update modified attributes to HLR database.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      ODB Status

      +

      A flag indicates whether a subscriber is subject to operator determined barring.

      +

      Operator Determined Barring

      +

      ODB Specific Data

      +

      Set the flag of Called Number Prefix Barring:

      +

      •OSB1

      •OSB2

      Check to Enable

      +
      +
      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable Premium Call

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.46

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_46_05.gif b/wxc2_omc/omcHelp/2_46_05.gif new file mode 100755 index 0000000..ab8f6bb Binary files /dev/null and b/wxc2_omc/omcHelp/2_46_05.gif differ diff --git a/wxc2_omc/omcHelp/2_47.htm b/wxc2_omc/omcHelp/2_47.htm new file mode 100755 index 0000000..93e3d72 --- /dev/null +++ b/wxc2_omc/omcHelp/2_47.htm @@ -0,0 +1,80 @@ +锘� + + + Routing by Location + + + + + + + + + + + + + + + + + + + + +
      +

      Routing by Location

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      This function enables certain outgoing call to be routed to different destination directory numbers depending to its incoming routing zone. A routing zone is associated with a set of radio cells or trunk groups. Each routing zone can have its own dialing prefix set, routing plan, announcement plan, and call control options. Routing zone offers the possibility to route a call to the nearest service point depending on the location of the mobile subscriber or incoming PSTN trunk group.

      +

      A uniform service number can therefore be assigned to different service points which defined in the independent routing zones. A subscriber who dials this service number will be connected to the specific service point assigned to his current location. An example of a service point is the vehicle recovery service.

      +

       

      +

      With this function it is possible to establish a number of service points and assign the associated local directory numbers to the service number. A small number of the total service numbers possible can be defined as emergency numbers.

      +

       

      +

       

      +

      Application

      +

       

      +

      For example, the system route all of the MO calls to a third party prepaid system to implement realtime wireless IMSI based account control and monitoring. The callers' account balances will be audited. After that, the call request will be route back to the system transparently.

      +

       

      +

      The local MSISDN is 9xxxxx, the PSTN number is 8xxxxx. Two Routing Zones need to be configured in this scenario, refer to the figures below:

      +

      2_47_01

      +

       

      +

      2_47_02

      +

       

      +

      2_47_03

      +

       

      +

       

      +

      The call processes are showed as below:

      +

       

      +

      2_47_04 2_47_05 2_47_06

      +

       

      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.47

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_47_01.gif b/wxc2_omc/omcHelp/2_47_01.gif new file mode 100755 index 0000000..a345592 Binary files /dev/null and b/wxc2_omc/omcHelp/2_47_01.gif differ diff --git a/wxc2_omc/omcHelp/2_47_02.gif b/wxc2_omc/omcHelp/2_47_02.gif new file mode 100755 index 0000000..bfc16bd Binary files /dev/null and b/wxc2_omc/omcHelp/2_47_02.gif differ diff --git a/wxc2_omc/omcHelp/2_47_03.gif b/wxc2_omc/omcHelp/2_47_03.gif new file mode 100755 index 0000000..31ec204 Binary files /dev/null and b/wxc2_omc/omcHelp/2_47_03.gif differ diff --git a/wxc2_omc/omcHelp/2_47_04.gif b/wxc2_omc/omcHelp/2_47_04.gif new file mode 100755 index 0000000..d4ea84f Binary files /dev/null and b/wxc2_omc/omcHelp/2_47_04.gif differ diff --git a/wxc2_omc/omcHelp/2_47_05.gif b/wxc2_omc/omcHelp/2_47_05.gif new file mode 100755 index 0000000..c65c413 Binary files /dev/null and b/wxc2_omc/omcHelp/2_47_05.gif differ diff --git a/wxc2_omc/omcHelp/2_47_06.gif b/wxc2_omc/omcHelp/2_47_06.gif new file mode 100755 index 0000000..11dbd68 Binary files /dev/null and b/wxc2_omc/omcHelp/2_47_06.gif differ diff --git a/wxc2_omc/omcHelp/2_48.htm b/wxc2_omc/omcHelp/2_48.htm new file mode 100755 index 0000000..b69d9d0 --- /dev/null +++ b/wxc2_omc/omcHelp/2_48.htm @@ -0,0 +1,714 @@ +锘� + + + Enabling Prepaid Service + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Prepaid Service

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The UltraWAVE Prepaid System (PPS) is a full featured Intelligent Network (IN) prepaid system. As an IN Service Control Point (SCP), the PPS functions with the UltraWAVE system to provide a turnkey and complete solution for mobile prepaid service. With prepaid telephony, subscribers pay before they use the service. Subscribers buy a certain amount of service by prepaying a certain amount of money, and can use the service up to the amount purchased. Once that amount is used, subscribers have to prepay again to continue using the service. Refer to PPS User Manual for more information.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_48_01

      +

       

      +

      1.Click the Advanced main menu.

       

      +

      2.Select HLR under the Subscriber submenu.

       

      +

      3.Find the IMSI of the subscriber want to activate prepaid service, click it to display the subscriber parameter window.

       

      +

      4.Check the required toggle boxes of the following parameters and enter the proper values.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload the new values to HLR servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      No.

      +

      Parameter

      +

      Explanation

      +

      43

      +

      CAMEL Flag

      +

      Check CAMEL toggle boxes to activate prepaid service.

      +

      Support CAMEL is a total flag of CAMEL provisioning. To enable any CAMEL service, select the toggle boxes:

      +

      •O-CSI: Originating CAMEL subscription information

      •T-CSI: Terminating CAMEL subscription information

      •SS-CSI: Supplementary service notification CAMEL subscription information

      •SMS-CSI: Short message service notification CAMEL subscription information

      •GPRS-CSI: GPRS notification CAMEL subscription information

      44*

      +

      O-CSI

      +

      Define the originating CAMEL Subscription Information

      +

      45*

      +

      T-CSI

      +

      Define the terminating CAMEL Subscription Information

      +

      46*

      +

      SS-CSI

      +

      Define the supplementary service notification CAMEL Subscription Information

      +

      47*

      +

      SMS-CSI

      +

      Define the short message service notification CAMEL Subscription Information

      +

      48*

      +

      GPRS-CSI

      +

      Define the GPRS notification CAMEL Subscription Information

      +
      +
      +

       

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      O-CSI Parameter

      +

      Descriptions

      +

      Detect Point Value

      +

      Trigger detection point. The DP List indicates on which detection point triggering shall take place. CAMEL Phase2: DP2. CAMEL Phase 3: DP2, DP4.

      +

      •Default =2

      Service Key

      +

      The service key identifies to the SCF the service logic that should apply.

      +

      •Default = 0

      SCF Number

      +

      SCF E.164 number.

      +

      •Format = 91+CC+NDC+SN

      Default Call Handling

      +

      Indicate whether the call shall be released or continued as requested in case of error in the SSF to SCF dialogue.

      +

      •Default = Continue Call

      Match Type Flag

      +

      These parameters should be left at their default values.

      +

      Match Type

      +

      Destination Number List Flag

      +

      Destination Number x

      +

      Destination Number Length Flag

      +

      Destination Number Length x

      +

      Call Type Flag

      +

      Call Type

      +

      Default Capability Handling

      +

      CAMEL Capability Handling indicates the phase of CAMEL which is asked by the SCF for the service.

      +

      •Default = 2

      +
      +

       

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      T/SMS/GPRS-CSI Parameter

      +

      Descriptions

      +

      Detect Point Value

      +

      Trigger detection point. The TDP List indicates on which detection point triggering shall take place. CAMEL Phase2: DP2; CAMEL Phase 3: DP2, DP4.

      +

      •Default =2

      Service Key

      +

      The service key identifies to the SCF the service logic that should apply.

      +

      •Default = 0

      SCF Number

      +

      SCF E.164 number.

      +

      •Format = 91+CC+NDC+SN

      Default Call Handling

      +

      Indicate whether the call shall be released or continued as requested in case of error in the SSF to SCF dialogue.

      +

      •Default = Continue Call

      Default Capability Handling

      +

      CAMEL Capability Handling indicates the phase of CAMEL which is asked by the SCF for the service.

      +

      •Default = 2

      +
      +

       

      +

       

      +
      + + + + + + + + + + + + +

      SS-CSI Parameter

      +

      Descriptions

      +

      Event x

      +

      This parameter should be left at their default value.

      +

      SCF Number

      +

      SCF E.164 number.

      +

      •Format = 91+CC+NDC+SN

      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button.

       

      +

      3.Click the Local Node tab.

       

      +

      2_48_13

      +

       

      +

      The SRF local node is used for the prepaid services related with announcement prompt.

      +

       

      +

      1.Click the hyperlinked index number of SRF-0 to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +

      4.Click the upper Local Node hyperlink to go back to the previous window.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      E.164 Number

      +

      The E.164 node address of SRF-0.

      +

      SRF-0 E.164 Number

      +

      IP 0

      +

      IP address of MSS 0.

      +

      IP of MSS-0

      +

      IP 1

      +

      Reserved as 255.255.255.255.

      +

      255.255.255.255

      +
      +
      +

       

      +

      2_48_14

      +

       

      +

      The SRF local node is used for the prepaid services related with announcement prompt.

      +

       

      +

      1.Click the hyperlinked index number of SRF-1 to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +

      4.Click the upper Local Node hyperlink to go back to the previous window.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      E.164 Number

      +

      The E.164 node address of SRF-1.

      +

      SRF-1 E1.64 Number

      +

      IP 0

      +

      IP address of MSS 1.

      +

      IP of MSS-1

      +

      IP 1

      +

      Reserved as 255.255.255.255.

      +

      255.255.255.255

      +
      +
      +

       

      +

      2_48_15

      +

       

      +

      1.Click the hyperlinked index number of SSF to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +

      4.Click the upper Local Node hyperlink to go back to the previous window.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      E.164 Number

      +

      The E.164 node address of SSF.

      +

      SSF E.164 Number

      +

      IP 0

      +

      IP address of MSS 0.

      +

      IP of MSS-0

      +

      IP 1

      +

      IP address of MSS 1.

      +

      IP of MSS-1

      +
      +
      +

       

      +

      2_48_16

      +

       

      +

      1.Click the hyperlinked index number of SCF-CAP to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +

      4.Click the upper Local Node hyperlink to go back to the previous window.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      E.164 Number

      +

      The E.164 node address of SCF-CAP.

      +

      SCF-CAP E.164 Number

      +

      IP 0

      +

      IP address of MSS 0.

      +

      IP of MSS-0

      +

      IP 1

      +

      IP address of MSS 1.

      +

      IP of MSS-1

      +
      +
      +

       

      +

      2_48_17

      +

       

      +

      The SCP-MAP local node is used for the prepaid services related with USSD.

      +

       

      +

      1.Click the hyperlinked index number of SCF-MAP to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +

      4.Click the upper Local Node hyperlink to go back to the previous window.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      E.164 Number

      +

      The E.164 node address of SCF-MAP.

      +

      SCF-MAP E.164 Number

      +

      IP 0

      +

      IP address of MSS 0.

      +

      IP of MSS-0

      +

      IP 1

      +

      IP address of MSS 1.

      +

      IP of MSS-1

      +
      +
      +

       

      +

      2_48_18

      +

       

      +

      The SMPP-EMSE local node is used for the prepaid services related with notification short message.

      +

       

      +

      1.Click the hyperlinked index number of SMPP-EMSE to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +

      4.Click the upper Local Node hyperlink to go back to the previous window.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      E.164 Number

      +

      The E.164 node address of SMPP-EMSE.

      +

      SMPP-EMSE E.164 Number

      +

      IP 0

      +

      IP address of MSS 0.

      +

      IP of MSS-0

      +

      IP 1

      +

      IP address of MSS 1.

      +

      IP of MSS-1

      +
      +
      +

       

      +

      2_48_19

      +

       

      +

      The SMPP-SMSC local node is used for the prepaid services related with notification short message.

      +

       

      +

      1.Click the hyperlinked index number of SMPP-SMSC to open its Option window.

       

      +

      2.Configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +

      4.Click the upper Local Node hyperlink to go back to the previous window.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      E.164 Number

      +

      The E.164 node address of SMPP-SMSC.

      +

      SMPP-SMSC E.164 Number

      +

      IP 0

      +

      IP address of MSS 0.

      +

      IP of MSS-0

      +

      IP 1

      +

      IP address of MSS 1.

      +

      IP of MSS-1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_48_05

      +

       

      +

      1.On the System Control tab, refer to the PPS parameters dictionary to configure the relevant parameters.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_48_07

      +

       

      +

      1.Click the SRF Parameters tab, refer to the PPS parameters dictionary to configure the relevant parameters.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      A Class of Service (COS) is the basic entity used to define prepaid service packages, and constitutes a major part of the service data. Most of the service behavior, including the tariff structure, allowed dialed numbers, the number of phone book entries allowed for a subscriber in the Friends and Family feature and many other service characteristics such as the switch of Close User Group and Friend and Family, are defined as part of the COS.

      +

       

      +

      Each subscriber is assigned to only one COS. The subscriber COS name is listed in the subscriber record and is read whenever the service processes the subscriber.

      +

       

      +

      Overall, the behavior of the service for a given subscriber is determined by the subscriber's COS. Only a few personal configuration attributes (such as the subscriber's default language) are kept in the subscriber records; the rest are defined in the subscriber COS and are shared by all the subscribers assigned to that COS.

      +

       

      +

      A total of 64 COS can be defined in the system, allowing the prepaid service to offer multiple service packages to subscribers.

      +

       

      +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_48_09

      +

       

      +

      1.Click the COS tab, refer to the PPS parameters dictionary to configure the relevant parameters.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Configure Tariff

      •

      •Manage PPS Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_01.gif b/wxc2_omc/omcHelp/2_48_01.gif new file mode 100755 index 0000000..35e8be0 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_01.gif differ diff --git a/wxc2_omc/omcHelp/2_48_05.gif b/wxc2_omc/omcHelp/2_48_05.gif new file mode 100755 index 0000000..a187650 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_05.gif differ diff --git a/wxc2_omc/omcHelp/2_48_07.gif b/wxc2_omc/omcHelp/2_48_07.gif new file mode 100755 index 0000000..9d239ae Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_07.gif differ diff --git a/wxc2_omc/omcHelp/2_48_09.gif b/wxc2_omc/omcHelp/2_48_09.gif new file mode 100755 index 0000000..897c527 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_09.gif differ diff --git a/wxc2_omc/omcHelp/2_48_1.htm b/wxc2_omc/omcHelp/2_48_1.htm new file mode 100755 index 0000000..acd1fcb --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_1.htm @@ -0,0 +1,328 @@ +锘� + + + Enabling Audio Prompt + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Audio Prompt

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Implementation

      +

       

      +

       

      +
      + + + +

      Refer to Enabling Audio Announcement to configure AAS links and relevant parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_22

      +

       

      +

      1.Click to open the SRF Parameter >IVR Source tab.

       

      +

      2.Click the hyperlinked index number 0 to open its option window.

       

      +

      3.Configure the necessary parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Inquiry

      +

      Select local SRF as the Interactive Voice Response source for inquiry prompt.

      +

      Local SRF

      +

      Recharge

      +

      Select local SRF as the Interactive Voice Response source for recharge prompt.

      +

      Local SRF

      +
      +
      +

       

      +

      2_48_23

      +

       

      +

      1.Click to open the SRF Parameters >SRF Number tab.

       

      +

      2.Click the hyperlinked index number of SRF-0 to open its option window.

       

      +

      3.Configure the E.164 Number of SRF-0 which has been configure in the SCCP Local Node table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the upper SRF Number hyperlink to go back to the previous window.

       

      +

      6.Click the hyperlinked index number of SRF-1 to open its option window.

       

      +

      7.Configure the E.164 Number of SRF-1 which has been configure in the SCCP Local Node table.

       

      +

      8.Click the 2_041 button to update parameters to application servers.

       

      +

      2_48_24

      +

       

      +

      1.Click to open the SRF Parameters >Service Number tab.

       

      +

      2.Click the hyperlinked index number of the service number to open its option window.

       

      +

      3.Configure the service number and click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update it to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Hotline Number

      +

      It is a dial-in number to a prompt menu with available prepaid services. User clicks certain button to select wanted service according to the audio prompt. The customer recorded voice prompt should be used in concert with the setting in PPS >SRF Parameters >Service Key.

      +

      Inquiry Number

      +

      It is a dedicated number for balance inquiry.

      +

      Scratch Card Recharge Number

      +

      It is a dedicated number for balance recharge by scratch card.

      +

      Credit Card Recharge Number

      +

      It is a dedicated number for balance recharge by credit card. This function need connect to a third party recharge center.

      +

      Third Party Recharge Number

      +

      It is a dedicated number for balance recharge by third party recharge center. This function need connect to a third party recharge center.

      +

      Customer Care Center Number

      +

      It is a dedicated number to dial in the customer care center.

      +

      Recharge Number

      +

      It is a dial-in number to a prompt menu with available recharge modes in the upper list. User clicks certain button to select wanted recharge mode according to the audio prompt.

      +
      +
      +

       

      +

      2_48_25

      +

       

      +

      The service key must be in accordance with the recorded announcement.

      +

       

      +

      1.Click to open the SRF Parameters >Service Key tab.

       

      +

      2.Click the hyperlinked index number of the service key to open its option window.

       

      +

      3.Configure the service key and click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update it to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MSC.

       

      +

      2.Make sure the System ID at the upper right corner displays MSC_pub, click the 2_035 button.

       

      +

      2_36_11

      +

       

      +

      1.Click the Dialing Prefix Set tab.

       

      +

      2.Pick up the serving Dialing Prefix Set, and then click the hyperlinked number in the Dialing Prefix Entries to open the Prefix table.

       

      +

      3.Click New at the bottom of the Prefix table to add prefix for PPS service number.

       

      +

      4.In the Prefix ID box, click the 2_002 button.

       

      +

      5.In the Prefix option window, configure the relevant parameters given in the following table.

       

      +

      6.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      7.Click the 2_036 button to activate the new created prefix.

       

      +

      8.Repeat step 3 to 7 to add more PPS service numbers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description  (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Lookup Method

      +

      Select a dialing plan lookup method.

      +

      Prefix

      +

      Prefix

      +

      PPS service number which has been configured in PPS >SRF Parameters >Service Number.

      +

      PPS Service Number

      +

      Number Attribute

      +

      Set to Unknown.

      +

      Unknown

      +

      Number Length

      +

      Enter 0 for indeterminate number length.

      +

      0

      +

      Service Type

      +

      Select Intelligent Call for prepaid relevant services.

      +

      Intelligent Call

      +

      Number Type

      +

      Set to PSTN.

      +

      PSTN

      +

      CLI Type

      +

      Set to Sub.

      +

      Sub

      +

      Routing Selection ID

      +

      Enter the the routing selection ID pointing to the AAS-0 trunk group.

      +

      AAS-0 Routing Selection

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Disable

      +

      NAI for Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      PSTN Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      PSTN Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      --

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enabling Audio Announcement

       

      +

      •Manage PPS Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.1

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_10.htm b/wxc2_omc/omcHelp/2_48_10.htm new file mode 100755 index 0000000..7dacd2b --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_10.htm @@ -0,0 +1,399 @@ +锘� + + + Enabling Free SMS Service + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Free SMS Service

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The free short message feature allows customer to independently subscribe/unsubscribe to free short message service package with a period of validity by sending a short message. When the validity expires, the new service package will cease automatically, and a notification short message will be sent to inform the customer that the service expired. The operator can customize the following characteristics to deploy the free short message service:

      +

      •Validity period of the service package (1 day to 254 days, or without limit)

      •Different service package for specific user group

      •Allowable MO short messages defined by prefixes

      •Short message tariff based on prefix

      •Whether or not charge for service activation and deactivation

      •Whether or not charge daily or monthly rent

       

      +

      Operator may easily promote free short message service package to customers by applying this feature, such as pay 10$ for sending free short messages in 15 days. If customer is interested in this service package, he can send activate command by a short message to the switchover COS service number. After a successful activation, a notification short message will be sent back to customer about his current service status.

      +

       

      +

      The mechanism of the free short message feature is to switchover the subscriber's COS. The subscriber sends command by short message to switch his original COS to a new COS with an operator predefined validity period. When the validity expires, the operative COS will be switched back to the original COS automatically, and a notification short message will be sent to inform the subscriber that the service expired. In addition, the subscriber can send commands by short message to cancel or inquire the service at any time.

      +

       

      +

      The switchover COS supported commands are listed as below:

      +

      •activate: Switch the original COS to the preset switchover COS.

      •deactivate: Switch back to the original COS.

      •inquire: Check the current COS is original or switchover COS.

       

      +

      For example, subscriber sends short message with "activate" to the switchover COS service number. After the successful switchover, the subscriber receives a notification short message.

      +

       

      +

      There is no limit to the number of times the subscriber can switch his COS. Switchover COS can be either free or charged. The charge fee is preset in the supplementary tariff table.

      +

       

      +

      Please note in the current stage, the switchover COS function is customized for free SMS service. That means the properties of new COS don't take over the properties of old COS except for the SMS tariff and rent setting. After new COS activated, the COS relevant attributes, such as service control, account validity, etc, are still using the setting of the old COS. The SMS tariff and rent setting of the new COS take effect in the operator predefined period. When it expires, the new setting will cease automatically, and COS will switch back to the original COS. In addition, the subscriber can send "deactivate" command by short message to cancel this service at any time.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_30

      +

       

      +

      1.Click to open the SRF Parameters >Service Number tab.

       

      +

      2.Click the hyperlinked index number of Free SMS Service Number to open its option window.

       

      +

      3.Configure the service number for Free SMS service.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      2_48_47

      +

       

      +

      1.Click to open the Service Control >SMS Sentence tab.

       

      +

      2.Click the hyperlinked index number of the Free SMS relevant sentence to open the configuration window.

       

      +

      3.Edit the sentence in the Language x Content line, click highlighted SAVE when it's done.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      SMS Sentence

      +

      Free Service Active

      +

      activate (Send this character string to Free Service service number to activate Free SMS service.)

      +

      Free Service Deactive

      +

      deactivate (Send this character string to Free Service service number to deactivate Free SMS service.)

      +

      Free Service Inquiry

      +

      enquire (Send this character string to Free Service service number to inquire Free SMS service.)

      +

      Free Service Active Notify

      +

      You have activated free SMS.

      +

      Free Service Deactive Notify

      +

      You have deactivated free SMS.

      +

      Free Service Active State

      +

      Your free SMS service is active.

      +

      Free Service Deactive State

      +

      Your free SMS service is inactive.

      +

      Free Service Expired

      +

      Your free SMS service is expired and deactivated by the system.

      +

      Valid Days

      +

      Days of validity:

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_50

      +

       

      +

      1.Click to open the Service Control >COS tab.

       

      +

      2.Click the hyperlinked index number to open an existing COS table, or click New to create a new COS table.

       

      +

      3.In the Service Control table, configure the Free SMS relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Optional Values

      +

      Switch COS

      +

      Specify the index number of the relevant COS which configured particular rent and SMS tariff. The new COS will take effect when the Free SMS service is activated by customer.

      +

      0 - 63

      +

      Active Days

      +

      Specify the period of validity for the activated free SMS service. At the expiration of this service, the COS will be automatically switched back to the customer original COS. Unit is day.

      +

      •Set 255 to prolong validity period indefinitely till the customer deactivates it manually.

      1 - 255

      +

      Rent Type

      +

      Specify the Rent ID (1-8) in the relevant MO tariff rent table.

      +

      •0 = Rent Free

      0 - 8

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Refer to Enabling Interactive SMS to configure SMPP parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMSC.

       

      +

      2.Make sure the System ID at the upper right corner displays SMSC_pub, click the 2_035 button.

       

      +

      2_70_04

      +

       

      +

      1.Click to open the SMPP tab.

       

      +

      2.Click the hyperlinked index number of New to open an Option window.

       

      +

      3.Configure the necessary parameters given in the following table to bind the balance transfer service number with the configured SMPP connection.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Alias

      +

      It is the same Link Alias as that in the previous SMPP configuration. Use the PPS inquiry number by default.

      +

      PPS Inquiry Number

      +

      Session Type

      +

      Specify how the local SMPP entity shall bind to the remote SMPP entity. Select bindTRX as a transceiver.

      +

      bindTRX

      +

      Service Number

      +

      Enter the PPS balance transfer service number which configured in PPS >SRF Parameters >SRF Number >Credit Transfer Service Number.

      +

      Free SMS Service Number

      +

      DCS

      +

      Data Coding Scheme. Reserved as smpp7def8.

      +

      smpp7def8

      +

      Platform ID

      +

      The served MSC platform. Reserved as Ignore.

      +

      Ignore

      +

      Time to Live

      +

      Define the maximum duration of a pending message which should be kept in sending array till reaches the called subscriber.  Messages can't send out in the validity period will be deleted. Unit is second. Reserved as 18 hours.

      +

      64800

      +

      Manipulation Flag

      +

      Enable or disable CLI Manipulation in XAPP setting. Reserved as Disable.

      +

      Disable

      +

      TON

      +

      Indicate Type of Number for destination. Reserved as Unknown.

      +

      Unknown

      +

      NPI

      +

      Indicate Numbering Plan Indicator for destination. Reserved as Unknown.

      +

      Unknown

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_34

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >Refresh.

       

      +

      2.Click the second Download button to update the current Tariff Plan from PPS to OMC GUI.

       

      +

      2_48_35

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >MO.

       

      +

      2.Select a Tariff ID from the upper right corner Tariff ID drop-down list.

       

      +

      3.In the Rent table, click the hyperlinked ID of an idle entry to open its option window.

       

      +

      4.Configure relevant parameters to decide if need to charge daily or monthly rent for Free SMS.

       

      +

      5.Click the 2_041 button to update parameters to Tariff Plan.

       

      +

      6.In the SMS table, click the hyperlinked ID of an idle entry to open its option window.

       

      +

      7.Configure relevant parameters to set the SMS tariff based on prefix. (Please note all prefixes of allowable SMS have to be configured in the SMS table.)

       

      +

      8.Click the 2_041 button to update parameters to Tariff Plan.

       

      +

      9.In the Supplementary Tariff table, click the hyperlinked Activate/Deactive Free SMS Charge to open its option window.

       

      +

      10.Configure charge amount parameter to decide if need to charge for Free SMS activation and deactivation.

       

      +

      11.Click the 2_041 button to update parameters to Tariff Plan.

       

      +

      2_48_36

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >Startup.

       

      +

      2.Enter the new tariff activation time and click Submit button to submit.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Activate Free SMS

      +

       

      +

      1.Subscriber A edits the Free SMS Active pattern and sends it to Free SMS service number.

       

      +

      activate

      +

       

      +

      Please note the Free SMS Active pattern is pre-configured in the PPS >Service Control >SMS Sentence.

      +

       

      +

      2.A notification short message is replied:

       

      +

      You have activated free SMS. Days of validity: x

      +

       

      +

      Deactivate Free SMS

      +

       

      +

      1.Subscriber A edits the Free SMS Deactive pattern and sends it to Free SMS service number.

       

      +

      deactivate

      +

       

      +

      2.A notification short message is replied:

       

      +

      You have deactivated free SMS.

      +

       

      +

      Inquire Free SMS

      +

       

      +

      1.Subscriber A edits the Free SMS Inquiry pattern and sends it to Free SMS service number.

       

      +

      deactivate

      +

       

      +

      2.A notification short message is replied:

       

      +

      Your free SMS service is active. Days of validity: x or

      +

       

      +

      Your free SMS service is inactive.

      +

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.10

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_13.gif b/wxc2_omc/omcHelp/2_48_13.gif new file mode 100755 index 0000000..e15f1b7 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_13.gif differ diff --git a/wxc2_omc/omcHelp/2_48_14.gif b/wxc2_omc/omcHelp/2_48_14.gif new file mode 100755 index 0000000..d087e59 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_14.gif differ diff --git a/wxc2_omc/omcHelp/2_48_15.gif b/wxc2_omc/omcHelp/2_48_15.gif new file mode 100755 index 0000000..2fff782 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_15.gif differ diff --git a/wxc2_omc/omcHelp/2_48_16.gif b/wxc2_omc/omcHelp/2_48_16.gif new file mode 100755 index 0000000..3b83ed8 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_16.gif differ diff --git a/wxc2_omc/omcHelp/2_48_17.gif b/wxc2_omc/omcHelp/2_48_17.gif new file mode 100755 index 0000000..d6377ec Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_17.gif differ diff --git a/wxc2_omc/omcHelp/2_48_18.gif b/wxc2_omc/omcHelp/2_48_18.gif new file mode 100755 index 0000000..c2f0085 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_18.gif differ diff --git a/wxc2_omc/omcHelp/2_48_19.gif b/wxc2_omc/omcHelp/2_48_19.gif new file mode 100755 index 0000000..cf4a1a3 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_19.gif differ diff --git a/wxc2_omc/omcHelp/2_48_2.htm b/wxc2_omc/omcHelp/2_48_2.htm new file mode 100755 index 0000000..742800c --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_2.htm @@ -0,0 +1,591 @@ +锘� + + + Enabling Notification SMS + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Notification Short Message

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_70_03

      +

       

      +

      1.Go to EMS >Configuration >NSS >SMPP.

       

      +

      2.Make sure the System ID at the upper right corner displays SMPP(MSS_Pub), click the 2_035 button.

       

      +

      3.Click the hyperlinked index number of New to open an Option window.

       

      +

      4.Configure the necessary parameters given in the following table to setup the SMPP connection for the forward direction.

       

      +

      5.Click the 2_041 button to update parameters to application servers.

       

      +

      6.Repeat steps 3 to 5 to add another SMPP connection for the opposite direction.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Forward Connection

      +

      Reverse Connection

      +

      Link Alias

      +

      Name of the SMPP connection. Enter the PPS inquiry number which configured in PPS >SRF Parameters >SRF Number >Inquiry Number.

      +

      PPS Inquiry Number

      +

      PPS Inquiry Number

      +

      Link Type

      +

      Transport protocol of the SMPP connection.

      +

      UDP

      +

      UDP

      +

      Server Type

      +

      Specify the application type of the local SMPP entity.

      +

      Server

      +

      Client

      +

      Session Type

      +

      Specify how the local SMPP entity shall bind to the remote SMPP entity. Select bindTRX as a transceiver.

      +

      bindTRX

      +

      bindTRX

      +

      System ID

      +

      Specify the user name for the gateway to use when connecting to the remote SMPP entity. Enter PPS by default.

      +

      PPS

      +

      PPS

      +

      Password

      +

      Specify the password for the gateway to use when connecting to the remote SMPP entity. Enter 123456 by default.

      +

      123456

      +

      123456

      +

      System Type

      +

      An optional login parameter that should be set only if required by the remote SMPP entity. Enter GSM by default.

      +

      GSM

      +

      GSM

      +

      Local GTT

      +

      Specify the GTT of local SMPP entity. Enter the SMPP-SMSC and SMPP-EMSE E.164 number which configured in SCCP >Local Node.

      +

      SMPP-SMSC

      +

      SMPP-EMSE

      +

      Remote GTT

      +

      Specify the GTT of remote SMPP entity. Enter the SMPP-EMSE and SMPP-SMSC E.164 number which configured in SCCP >Local Node.

      +

      SMPP-EMSE

      +

      SMPP-SMSC

      +

      Local IP

      +

      Specify the IP address of local SMPP entity. It's not applicable here. Reserved as 0.0.0.0.

      +

      0.0.0.0

      +

      0.0.0.0

      +

      Remote IP

      +

      Specify the IP address of remote SMPP entity. It's not applicable here. Reserved as 0.0.0.0.

      +

      0.0.0.0

      +

      0.0.0.0

      +

      Session Init Timer

      +

      Specify the maximum time-out value for the time period between an application's network connection setup request and BIND request.

      +

      If the time-out value is reached, the connection is terminated. Reserved as 5.

      +

      5

      +

      5

      +

      Enquire Link Timer

      +

      Specify the minimum time-out period between the SMPP service's sending of ENQUIRE LINK requests to an application. Reserved as 10.

      +

      10

      +

      10

      +

      Inactivity Timer

      +

      Specify the maximum time-out period allowed for inactivity between an application鈥檚 request towards the SMPP service. If the time-out value is reached, the connection is terminated. Reserved as 5.

      +

      5

      +

      5

      +

      Response Timer

      +

      Specify the maximum time-out period allowed between the SMPP service sends a request to an application and a response to the request is received.

      +

      If the time-out value is reached, the connection is terminated. Reserved as 5.

      +

      5

      +

      5

      +

      Local SSN

      +

      Specify the subsystem number of local SMPP entity. Reserved as 0.

      +

      0

      +

      0

      +

      Remote SSN

      +

      Specify the subsystem number of remote SMPP entity. Reserved as 0.

      +

      0

      +

      0

      +

      Flag

      +

      Enable or disable this SMPP connection.

      +

      Enable

      +

      Enable

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMSC.

       

      +

      2.Make sure the System ID at the upper right corner displays SMSC_pub, click the 2_035 button.

       

      +

      2_70_04

      +

       

      +

      1.Click to open the SMPP tab.

       

      +

      2.Click the hyperlinked index number of New to open an Option window.

       

      +

      3.Configure the necessary parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Alias

      +

      It is the same Link Alias as that in the previous SMPP configuration. Use the PPS inquiry number by default.

      +

      PPS Inquiry Number

      +

      Session Type

      +

      Specify how the local SMPP entity shall bind to the remote SMPP entity. Select bindTRX as a transceiver.

      +

      bindTRX

      +

      Service Number

      +

      Enter the PPS balance transfer service number which configured in PPS >SRF Parameters >SRF Number >Inquiry Number.

      +

      PPS Inquiry Number

      +

      DCS

      +

      Data Coding Scheme. Reserved as smpp7def8.

      +

      smpp7def8

      +

      Platform ID

      +

      The served MSC platform. Reserved as Ignore.

      +

      Ignore

      +

      Time to Live

      +

      Define the maximum duration of a pending message which should be kept in sending array till reaches the called subscriber.  Messages can't send out in the validity period will be deleted. Unit is second. Reserved as 18 hours.

      +

      64800

      +

      Manipulation Flag

      +

      Enable or disable CLI Manipulation in XAPP setting. Reserved as Disable.

      +

      Disable

      +

      TON

      +

      Indicate Type of Number for destination. Reserved as Unknown.

      +

      Unknown

      +

      NPI

      +

      Indicate Numbering Plan Indicator for destination. Reserved as Unknown.

      +

      Unknown

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_20

      +

       

      +

      1.Click to open the Service Control >Prompt Resolution tab.

       

      +

      2.Click the hyperlinked index number 0 to open the configuration window.

       

      +

      3.Configure the necessary parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Optional Values

      +

      Currency Resolution

      +

      Specify the number of decimal place in the PPS notification short message balance display and audio prompt.

      +

      For example, balance=1234:

      +

      n1=1234, n10=123.4, n100=12.34

      +

      •n1

      •n10

      •n100

      Date Format

      +

      Specify date format in PPS notification short message and audio prompt.

      +

      •YYYYMMDD

      •DDMMYYYY

      •MMDDYYYY

      Currency Symbol Position

      +

      Specify the position of the currency symbol in PPS notification short message.

      +

      •At the front of the balance: $5

      •At the rear of the balance: 5$

      •Front

      •Rear

      +
      +

       

      +

      2_48_21

      +

       

      +

      1.Click to open the Service Control >SMS Sentence tab.

       

      +

      2.Click the hyperlinked index number of the sentence wanted to change to open the configuration window.

       

      +

      3.Edit the sentence in the Language x Content line, click highlighted SAVE when it's done.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_31

      +

       

      +

      1.Click to open the Service Control >COS tab.

       

      +

      2.Click the hyperlinked index number to open an existing COS table, or click New to create a new COS table.

       

      +

      3.In the Short Message Notification & Inquiry table, configure the necessary parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Optional Values

      +

      Short Message Notification

      +

      Attributes of notification short message

      +

      --

      +

      Successful Recharge

      +

      Enable or disable feedback short message of recharge result.

      +

      •Enable

      •Disable

      Account Inquiry

      +

      Enable or disable feedback short message of balance inquiry.

      +

      Expiration

      +

      Enable or disable notification short message sending when an account is going to expire.

      +

      (Days) Before Expiration

      +

      Define the sending days before account expires.

      +

      0 - 32 days

      +

      Insufficient Balance

      +

      Enable or disable notification short message sending when the account's balance is too low.

      +

      •Enable

      •Disable

      When Balance Reaches

      +

      Define the low balance level to send notification short message. Unit is the minimum currency unit.

      +

      0 - 65535

      +

      Clear Balance

      +

      Enable or disable notification short message sending when the balance is cleared from an expired account.

      +

      •Enable

      •Disable

      CAP Plan Upgrade

      +

      Enable or disable notification short message sending when the predefined CAP threshold is about to grade up.

      +

      Overdraw Balance

      +

      Enable or disable notification short message sending when the account takes out an overdraft to pay for the charge.

      +

      Rent Charge

      +

      Enable or disable notification short message sending when rent is charged.

      +

      F&F Registration

      +

      Enable or disable notification short message sending when Friends and Family Number plan is registered.

      +

      F&F Suspended

      +

      Enable or disable notification short message sending when Friends and Family Number plan is suspended.

      +

      F&F Exceed Threshold

      +

      Enable or disable notification short message sending when Friends and Family Number plan exceeded the free voice call duration or free SMS threshold.

      +

      F&F Removed

      +

      Enable or disable notification short message sending when Friends and Family Number plan is removed.

      +

      Inquiry by Short Message

      +

      Attributes of inquiry short message

      +

      --

      +

      Charge Flag

      +

      Enable or disable charge for inquiry short message.

      +

      •Charge

      •Free

      Free Inquiry per Day

      +

      Define the quantity of free inquiry short messages on a daily basis if charge flag is enabled.

      +

      0 - 128

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Configure Tariff

       

      +

      •Manage PPS Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.2

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_20.gif b/wxc2_omc/omcHelp/2_48_20.gif new file mode 100755 index 0000000..6f58660 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_20.gif differ diff --git a/wxc2_omc/omcHelp/2_48_21.gif b/wxc2_omc/omcHelp/2_48_21.gif new file mode 100755 index 0000000..0af0740 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_21.gif differ diff --git a/wxc2_omc/omcHelp/2_48_22.gif b/wxc2_omc/omcHelp/2_48_22.gif new file mode 100755 index 0000000..001913b Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_22.gif differ diff --git a/wxc2_omc/omcHelp/2_48_23.gif b/wxc2_omc/omcHelp/2_48_23.gif new file mode 100755 index 0000000..842613a Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_23.gif differ diff --git a/wxc2_omc/omcHelp/2_48_24.gif b/wxc2_omc/omcHelp/2_48_24.gif new file mode 100755 index 0000000..8164740 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_24.gif differ diff --git a/wxc2_omc/omcHelp/2_48_25.gif b/wxc2_omc/omcHelp/2_48_25.gif new file mode 100755 index 0000000..d24c742 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_25.gif differ diff --git a/wxc2_omc/omcHelp/2_48_26.gif b/wxc2_omc/omcHelp/2_48_26.gif new file mode 100755 index 0000000..9f260fb Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_26.gif differ diff --git a/wxc2_omc/omcHelp/2_48_27.gif b/wxc2_omc/omcHelp/2_48_27.gif new file mode 100755 index 0000000..1c68323 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_27.gif differ diff --git a/wxc2_omc/omcHelp/2_48_28.gif b/wxc2_omc/omcHelp/2_48_28.gif new file mode 100755 index 0000000..6d9b89e Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_28.gif differ diff --git a/wxc2_omc/omcHelp/2_48_29.gif b/wxc2_omc/omcHelp/2_48_29.gif new file mode 100755 index 0000000..d7306ba Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_29.gif differ diff --git a/wxc2_omc/omcHelp/2_48_3.htm b/wxc2_omc/omcHelp/2_48_3.htm new file mode 100755 index 0000000..124182b --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_3.htm @@ -0,0 +1,286 @@ +锘� + + + Enabling Interactive USSD + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Interactive USSD

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_27

      +

       

      +

      1.Click to open the SRF Parameters >USSD Service Number tab.

       

      +

      2.Click the hyperlinked index number of the USSD service number to open its option window.

       

      +

      3.Configure the USSD access code and click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update it to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Hotline

      +

      It is a USSD access code to an interactive menu with available prepaid services.

      +

      Inquiry

      +

      It is a dedicated USSD access code for balance inquiry.

      +

      Recharge

      +

      It is a dedicated USSD access code for balance recharge.

      +

      Balance Transfer

      +

      It is a dedicated USSD access code for balance transfer.

      +

      Call Me Back

      +

      It is a dedicated USSD access code for Call Me Back service.

      +

      Tell Me My Number

      +

      It is a dedicated USSD access code for Tell Me My Number service.

      +

      F&F Number Plan Inquiry

      +

      It is a dedicated USSD access code for F&F Number Plan inquiry.

      +
      +
      +

       

      +

      2_48_28

      +

       

      +

      Please note the USSD hotline menu order is based on the key's sequence. For unsupported service, just leave its key as idle.

      +

       

      +

      1.Click to open the SRF Parameters >USSD Service Key tab.

       

      +

      2.Click the hyperlinked index number of the USSD service key to open its option window.

       

      +

      3.Configure the service key and click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update it to application servers.

       

      +

      2_48_29

      +

       

      +

      Please note the SMS Sentence #40 to #45 are dedicated for USSD operation, USSD prompts for other prepaid services are same as relevant SMS prompts.

      +

       

      +

      1.Click to open the Service Control >SMS Sentence tab.

       

      +

      2.Click the hyperlinked index number of the sentence wanted to change to open the configuration window.

       

      +

      3.Edit the sentence in the Language x Content line, click highlighted SAVE when it's done.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >HLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_48_26

      +

       

      +

      1.Click the USSD tab, pick up an idle UG-CSI object from 0 to 3, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      USSD Format String

      +

      The access code of Unstructured Supplementary Services Data service. Start with 1-2 digits of '*' or '#' . End with '#'. Separate sections by '*' . Contents can be added:

      +

      •C = Service code

      •B = Blank

      •S = Supplement info

      **C3B*S#

      +

      UG-CSI Service Code x

      +

      Prepaid subscribers dial this code to activate certain USSD service, such as Hotline or  Inquiry.

      +

      For example (**C3B*S#):

      +

      Service Code = 124, dial **124*0# to access USSD service.

      +

      Please note that the **124*# and **124# formats are also accepted by the service.

      +

      USSD Service Number

      +

      UG-CSI SCF Address x

      +

      The E.164 node address of SCF-MAP.

      +

      SCF-MAP E.164 Number

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

       

      +
      + + + +

      Prepaid subscribers dial the USSD service number to initiate hotline service.

      +

      For example, set 11 as the USSD hotline service number. Dial **11# to initiate a USSD dialog. The screen displays prompt as the following figure. Enter the index number of selection to continue.

      +

      2_55_14

      +

       

      +
      +
      +

       

      +
      + + + +

      Prepaid subscribers dial the USSD service number to initiate inquiry service.

      +

      For example, set 22 as the USSD inquiry number. Dial **22# to initiate a USSD dialog. The screen displays reply as the following figure.

      +

      2_55_10

      +

       

      +
      +
      +

       

      +
      + + + +

      Prepaid subscribers dial the USSD service number to initiate recharge service.

      +

      For example, set 33 as the USSD recharge number:

      +

      Dial **33# to initiate a USSD dialog. The screen displays prompt as the following figure. Reply the recharge card password to continue.

      +

      2_55_11

      +

      Another recharge way is to dial **33*PIN# to initiate a USSD dialog. The PIN is the valid recharge card password. The screen displays prompt as the following figure.

      +

      2_55_10

      +

      When recharge fail, the screen displays prompt as the following figure. Reply the recharge card password to continue.

      +

      2_55_13

      +

       

      +
      +
      +

       

      +
      + + + +

      Prepaid subscribers dial the USSD service number to initiate transfer balance service.

      +

      For example, set 44 as transfer balance service number. Dial **44# to initiate a USSD dialog. The screen displays prompt as the following figure.

      +

      2_55_15

      +

      Reply the prompt in the following format: <Number B>#<Credit X>

      +

      -<Number B> is the whole number with CC and NDC.

      -<Credit X> is in the currency unit as displayed when inquire balance, but replace decimal point "." with asterisk "*". The 0 at the end can be ignored.

      For example:

      +

      -Transfer 10.50$ to 965001, the reply content is "86755965001#10*5".

      -Transfer 10.00$ to 965001, the reply content is "86755965001#10".

      -Transfer 0.05$ to 965001, the reply content is "86755965001#0*05".

      When transfer succeeds, then a notification USSD message and short message in the following format will be sent to the transmitter. And a notification short message will be sent to the receiver.

      +

      2_55_16

      +

      The credit receiver will get a notification short message in the following format.

      +

      2_55_17

      +

       

      +
      +
      +

       

      +
      + + + +

      Prepaid subscribers dial the USSD service number to initiate call me service.

      +

      For example, set 55 as call me back service number. Dial **55# to initiate a USSD dialog. The screen displays prompt as the following figure. Reply the destination number, e.g. "86755965001".

      +

      2_55_18

      +

      A short message will be sent to the destination subscriber with a preset Call Me message (i.e. 鈥淧lease call me back.鈥�).

      +

       

      +
      +
      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.3

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_30.gif b/wxc2_omc/omcHelp/2_48_30.gif new file mode 100755 index 0000000..95e15cf Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_30.gif differ diff --git a/wxc2_omc/omcHelp/2_48_31.gif b/wxc2_omc/omcHelp/2_48_31.gif new file mode 100755 index 0000000..cd9e1ae Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_31.gif differ diff --git a/wxc2_omc/omcHelp/2_48_32.gif b/wxc2_omc/omcHelp/2_48_32.gif new file mode 100755 index 0000000..0a620c5 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_32.gif differ diff --git a/wxc2_omc/omcHelp/2_48_33.gif b/wxc2_omc/omcHelp/2_48_33.gif new file mode 100755 index 0000000..22ee3b1 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_33.gif differ diff --git a/wxc2_omc/omcHelp/2_48_34.gif b/wxc2_omc/omcHelp/2_48_34.gif new file mode 100755 index 0000000..057a3dd Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_34.gif differ diff --git a/wxc2_omc/omcHelp/2_48_35.gif b/wxc2_omc/omcHelp/2_48_35.gif new file mode 100755 index 0000000..d2e768c Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_35.gif differ diff --git a/wxc2_omc/omcHelp/2_48_36.gif b/wxc2_omc/omcHelp/2_48_36.gif new file mode 100755 index 0000000..8931be5 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_36.gif differ diff --git a/wxc2_omc/omcHelp/2_48_37.gif b/wxc2_omc/omcHelp/2_48_37.gif new file mode 100755 index 0000000..ed9de9b Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_37.gif differ diff --git a/wxc2_omc/omcHelp/2_48_38.gif b/wxc2_omc/omcHelp/2_48_38.gif new file mode 100755 index 0000000..dd51b53 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_38.gif differ diff --git a/wxc2_omc/omcHelp/2_48_39.gif b/wxc2_omc/omcHelp/2_48_39.gif new file mode 100755 index 0000000..5c6482b Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_39.gif differ diff --git a/wxc2_omc/omcHelp/2_48_4.htm b/wxc2_omc/omcHelp/2_48_4.htm new file mode 100755 index 0000000..153805d --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_4.htm @@ -0,0 +1,203 @@ +锘� + + + Enabling CAP Call + + + + + + + + + + + + + + + + + + + + +
      +

      Configuring Cap Call

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      This feature allows operators to design flexible incentive service plans to attract customers of different market sectors. UltraWAVE PPS Cap Call function sets the tariff rates according to the accumulative usage, in terms of traffic time or call charge, of a subscriber.

      +

       

      +

      The Prepaid Cap Call function allows the operator to design prepaid tariff profiles with different tariff rates in different segments. The tariff profile may composite of up to four segments. Each segment may use different tariff plans. The boundaries of a segment may be defined by accumulated amount of traffic time or accumulated call charge balance of the subscriber in a monthly period. The Start and End day of the monthly period is set by the operator.

      +

       

      +

      2_65_01

      +

       

      +

      In above figure, C1, C2, C3 are called caps (or threshold). This plan supports up to 3 caps, 4 different zones. The tariff can be different for each cap zone, and it also can be set to 0.

      +

       

      +

      Cap Call function consists two parts - the Voice cap call and the SMS cap call. SMS cap call will be implemented in phase one and Voice cap call will be developed in phase two.

      +

       

      +

      There are two types of Cap Call measurements adopted in the market: measure by accumulated service volume or service (charge) amount. UltraWAVE Prepaid Cap Call supports both. Voice call and SM call have their own Cap Call accumulators.

      +

      •Service volume: Accumulated Call duration or accumulated number of SM.

      •Service amount: Accumulated Call charge or accumulated SM charge.

       

      +

      Cap calls can be further subdivided into two types by their destinations: within home PLMN and outside home PLMN. Operators may differentiate the cap calls made within the home PLMN or to other PLMN. They may set different cap values to calls within the home PLMN calls from calls to other PLMN. This feature gives the operators more flexibilities in designing their service plan.

      +

      •Cap calls to home PLMN

      •Cap calls to other PLMN

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      Operator designs the prepaid tariff profiles with different tariff rates in different segments. The tariff profile may composite of up to four segments. Each segment may use different tariff plans. The boundaries of a segment may be defined by accumulated amount of traffic time or accumulated call charges of the subscriber of the monthly period.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_37

      +

       

      +

      1.Click to open the Service Control >COS tab.

       

      +

      2.Click the hyperlinked index number to open an existing COS table, or click New to create a new COS table.

       

      +

      3.In the Call CAP Plan table, configure the necessary parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Reset Date

      +

      All PPS subscribers鈥� capped call statistic info will be cleared on the specified monthly date.

      +

      1 - 28

      +

      Flag

      +

      Disable or select the cap call function mode for the specified Cap Plan.

      +

      •Disable

      •Call Only

      •SM Only

      •Call and SM

      Type

      +

      Specify the type of cap call measurements adopted in the market.

      +

      •By Amount

      •By Charge

      Threshold

      +

      Define the three triggers (corresponding to C1, C2, C3 in above Figure) to activate the tariff for the next cap segment.

      +

      Definition in the basic count unit of time or balance.

      +

      --

      +

      Tariff

      +

      Specify the four tariff IDs to the cap segments (corresponding to Tariff 0, Tariff 1, Tariff 2 and Tariff 3 in above Figure).

      +

      0 - 63

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_49_01

      +

       

      +

      1.Click on the Advanced main menu.

       

      +

      2.Select MO under the Tariff Plan submenu, this displays the MO tariff configuration window.

       

      +

      3.Select the Tariff ID at the upper-right corner.

       

      +

      4.Add the prefix for cap voice call in MO Basic Tariff table.

       

      +

      5.Set Cap Flag to specify the call destination (home PLMN or other PLMN).

       

      +

      6.Add the prefix for cap SM in SMS Tariff table.

       

      +

      7.Set Cap Flag to specify the call destination (home PLMN or other PLMN).

       

      +

      8.Complete all Cap Call prefixes and set configuration to PPS servers.

       

      +

      9.Repeat the procedures to configure other Tariff IDs.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_49_02

      +

       

      +

      1.Select Startup under the Tariff Plan submenu, this display the Tariff Startup window.

       

      +

      2.On the operation page, set the start time for the new tariff plan, and enter the description for the tariff plan in the Remarks field.

       

      +

      3.Click the 2_024 button to set the start time.

       

      +

      4.The Cap tariff will be activated at the preset startup time.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Operator assigns the proper COS ID to PPS subscriber profile when the customer applies the prepaid Cap Call service. Customer can get more value than he actually pays for after the new tariff plan is activated.

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.4

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_40.gif b/wxc2_omc/omcHelp/2_48_40.gif new file mode 100755 index 0000000..d0536f5 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_40.gif differ diff --git a/wxc2_omc/omcHelp/2_48_41.gif b/wxc2_omc/omcHelp/2_48_41.gif new file mode 100755 index 0000000..d37855c Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_41.gif differ diff --git a/wxc2_omc/omcHelp/2_48_42.gif b/wxc2_omc/omcHelp/2_48_42.gif new file mode 100755 index 0000000..8d07699 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_42.gif differ diff --git a/wxc2_omc/omcHelp/2_48_43.gif b/wxc2_omc/omcHelp/2_48_43.gif new file mode 100755 index 0000000..12386a8 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_43.gif differ diff --git a/wxc2_omc/omcHelp/2_48_44.gif b/wxc2_omc/omcHelp/2_48_44.gif new file mode 100755 index 0000000..b622741 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_44.gif differ diff --git a/wxc2_omc/omcHelp/2_48_45.gif b/wxc2_omc/omcHelp/2_48_45.gif new file mode 100755 index 0000000..b859ec1 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_45.gif differ diff --git a/wxc2_omc/omcHelp/2_48_46.gif b/wxc2_omc/omcHelp/2_48_46.gif new file mode 100755 index 0000000..93d7887 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_46.gif differ diff --git a/wxc2_omc/omcHelp/2_48_47.gif b/wxc2_omc/omcHelp/2_48_47.gif new file mode 100755 index 0000000..343f2c2 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_47.gif differ diff --git a/wxc2_omc/omcHelp/2_48_48.gif b/wxc2_omc/omcHelp/2_48_48.gif new file mode 100755 index 0000000..f79e7f8 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_48.gif differ diff --git a/wxc2_omc/omcHelp/2_48_49.gif b/wxc2_omc/omcHelp/2_48_49.gif new file mode 100755 index 0000000..9ad5c17 Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_49.gif differ diff --git a/wxc2_omc/omcHelp/2_48_5.htm b/wxc2_omc/omcHelp/2_48_5.htm new file mode 100755 index 0000000..80adff7 --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_5.htm @@ -0,0 +1,403 @@ +锘� + + + Configuring Balance Transfer + + + + + + + + + + + + + + + + + + + + +
      +

      Configuring Balance Transfer

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      This feature allows the prepaid customer to transfer all or part of his account balance to other prepaid account. After a successful transfer, a notification short message will be sent to both the transmitter and receiver. The expiry date of transmitter won't change after transfer. For the expiry date of receiver, divided into the following two conditions:

      +

      •If the expiry date of receiver is longer than the transmitter's, leave it as unchanged.

      •If the expiry date of receiver is shorter than the transmitter's, replace it with the expiry date of transmitter.

       

      +

      There are three ways to transfer balance from one prepaid account to another:

      +

       

      +

       

      +
      + + + +

      Subscriber may dial the toll-free Balance Transfer service number to transfer his account balance to another account by following the IVR instructions.

      +

       

      +
      +
      +

       

      +
      + + + +

      Subscriber may edit a short message in an appropriate format (<Receiver Number>#<Credit>) and send it to the Balance Transfer service number.

      +

      Please note that the balance transfer by short message service is dependent on the reliability of Short Message Service Center (SMSC), and it doesn't initiate real-time session between customer and system. For the security reason, the balance transfer by short message service is not recommended.

      +

       

      +
      +
      +

       

      +
      + + + +

      Subscriber may dial the USSD service number to activate transfer balance service. Follow the prompt to enter string in an appropriate format (<Receiver Number>#<Credit>).

      +

      •The <Receiver Number> is the whole number with CC and NDC.

      •The <Credit> is in the same currency format as balance inquiry. Use asterisk as the decimal point and ignore the 0 at the end.

       

      +
      +
      +

       

      +

      Implementation (by Dialing Service Number)

      +

       

      +

       

      +
      + + + +

      Refer to Enabling Prepaid Service to configure SCCP parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_30

      +

       

      +

      1.Click to open the SRF Parameters >Service Number tab.

       

      +

      2.Click the hyperlinked index number of Credit Transfer Service Number to open its Option window.

       

      +

      3.Configure the service number for balance transfer.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Refer to Enabling Interactive SMS to configure SMPP parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMSC.

       

      +

      2.Make sure the System ID at the upper right corner displays SMSC_pub, click the 2_035 button.

       

      +

      2_70_04

      +

       

      +

      1.Click to open the SMPP tab.

       

      +

      2.Click the hyperlinked index number of New to open an Option window.

       

      +

      3.Configure the necessary parameters given in the following table to bind the balance transfer service number with the configured SMPP connection.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Alias

      +

      It is the same Link Alias as that in the previous SMPP configuration. Use the PPS inquiry number by default.

      +

      PPS Inquiry Number

      +

      Session Type

      +

      Specify how the local SMPP entity shall bind to the remote SMPP entity. Select bindTRX as a transceiver.

      +

      bindTRX

      +

      Service Number

      +

      Enter the PPS balance transfer service number which configured in PPS >SRF Parameters >SRF Number >Credit Transfer Service Number.

      +

      Credit Transfer Service Number

      +

      DCS

      +

      Data Coding Scheme. Reserved as smpp7def8.

      +

      smpp7def8

      +

      Platform ID

      +

      The served MSC platform. Reserved as Ignore.

      +

      Ignore

      +

      Time to Live

      +

      Define the maximum duration of a pending message which should be kept in sending array till reaches the called subscriber.  Messages can't send out in the validity period will be deleted. Unit is second. Reserved as 18 hours.

      +

      64800

      +

      Manipulation Flag

      +

      Enable or disable CLI Manipulation in XAPP setting. Reserved as Disable.

      +

      Disable

      +

      TON

      +

      Indicate Type of Number for destination. Reserved as Unknown.

      +

      Unknown

      +

      NPI

      +

      Indicate Numbering Plan Indicator for destination. Reserved as Unknown.

      +

      Unknown

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Subscriber A dials the Balance Transfer service number. SRF plays announcement:

       

      +

      Please input the account number of receiver. Press # to end.

      +

       

      +

      2.Subscriber A inputs the number of subscriber B #. SRF asks A to repeat the number of subscriber B #.

       

      +

      Please repeat the account number of receiver. Press # to end.

      +

       

      +

      3.If not matching, SRF repeats announcement in step 1. If matching, SRF plays announcement:

       

      +

      Press 0 to transfer all of your credit. Press 1 to transfer part of your credit.

      +

       

      +

      4.If press 0, jump to step 7. If press 1, SRF plays announcement:

       

      +

      Please input the credit to transfer. Use asterisk as the decimal point. Ignore the 0 at the end. Press # to end.

      +

       

      +

      5.Subscriber A inputs the credit to transfer.

       

      +

      Replace decimal point with asterisk and ignore the 0 at the end. Press # to end. For example:

      +

       

      +

      •Transfer 10.50$, enter: 10*5#

       

      +

      •Transfer 10.00$, enter: 10#

       

      +

      •Transfer 0.05$, enter: 0*05#

       

      +

      6.If the input credit exceeds subscriber A's remaining balance, SRF plays error prompt and repeats announcement in step 4.

       

      +

      7.If the input credit is valid, SRF asks subscriber A to confirm:

       

      +

      You will transfer X$ to number B. Press 0 to cancel. Press 1 to confirm. Press 2 to re-enter.

      +

       

      +

      8.Press 1 to transfer credit X from A to B. SRF plays announcement:

       

      +

      You鈥檝e transferred X$ to number B. Your current balance is Y$, expire on YYYY-MM-DD.

      +

       

      +

      The expiry date of subscriber A is unchanged. The expiry date of subscriber B compares with that of subscriber A and chooses the longer one.

      +

       

      +

      9.A notification short message is sent to subscriber A:

       

      +

      You鈥檝e transferred X$ to number B. Your current balance is Y$. Expire on YYYY-MM-DD.

      +

       

      +

      10.A notification short message is sent to subscriber B:

       

      +

      You've received X$ from number A. Your current balance is Z$, expire on YYYY-MM-DD.

      +

       

      +

      11.A PPS CDR is generated for transmitter, charge type is transfer out. A PPS CDR is generated for receiver, charge type is transfer in.

       

      +

       

      +
      +
      +

      Implementation (by Sending Short Message)

      +

       

      +

       

      +
      + + + +

      1.Subscriber A edits a short message in an appropriate format and sends to Balance Transfer service number.

       

      +

      <Number B>#<Credit X>

      +

       

      +

      Please note:

      +

       

      +

      •The <Number B> is the whole number with CC and NDC.

       

      +

      •The <Credit X> is in the currency unit as displayed in inquiry balance reply.

       

      +

      •Asterisk key can be used to replace decimal point and the 0 at the end can be ignored. For example:

       

      +

      •Transfer 10.50$ to 965001, the short message content is: 86755965001#10.5 or 86755965001#10*5

       

      +

      •Transfer 10.00$ to 965001, the short message content is: 86755965001#10

       

      +

      •Transfer 0.05$ to 965001, the short message content is: 86755965001#0.05 or 86755965001#0*05

       

      +

      2.If the input credit exceeds subscriber A's remaining balance or number B is invalid, system replies a notification short message.

       

      +

      3.If the short message is correct, credit X is transferred from A to B.

       

      +

      The expiry date of subscriber A is unchanged. The expiry date of subscriber B compares with that of subscriber A and chooses the longer one.

      +

       

      +

      4.A notification short message is sent to subscriber A:

       

      +

      You鈥檝e transferred X$ to number B. Your current balance is Y$, expiry on YYYY-MM-DD.

      +

       

      +

      5.A notification short message is sent to subscriber B:

       

      +

      You've received X$ from number A. Your current balance is Z$, expiry on YYYY-MM-DD.

      +

       

      +

      6.A PPS CDR is generated for transmitter, charge type is transfer out. A PPS CDR is generated for receiver, charge type is transfer in.

       

      +

       

      +
      +
      +

      Implementation (by Initiating USSD)

      +

       

      +

       

      +
      + + + +

      Refer to Enabling Interactive USSD to configure USSD service relevant parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_27

      +

       

      +

      1.Click to open the SRF Parameters >USSD Service Number tab.

       

      +

      2.Click the hyperlinked index number of Balance Transfer service number to open its option window.

       

      +

      3.Configure the USSD access code for Balance Transfer service and click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update it to application servers.

       

      +

      2_48_28

      +

       

      +

      1.Click to open the SRF Parameters >USSD Service Key tab.

       

      +

      2.Click the hyperlinked index number of Balance Transfer service key to open its option window.

       

      +

      3.Configure the Balance Transfer service key and click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update it to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Subscriber A dials the USSD Transfer Balance service code to initiate transfer balance dialog.

       

      +

      For example:

      +

       

      +

      •Set 124 as transfer balance service code, dial *124# to initiate a USSD dialog.

       

      +

      2.The system replies USSD response:

       

      +

      Please enter the receiver's number and credit to transfer. User # as the separator and * as the decimal point. Press Send to end.

      +

       

      +

      3.Subscriber A responds by entering appropriate content:

       

      +

      <Number B>#<Credit X>

      +

       

      +

      Please note:

      +

       

      +

      •The <Number B> is the whole number with CC and NDC.

       

      +

      •The <Credit X> is in the currency unit as displayed in inquiry balance reply. Use asterisk as decimal point and ignore the 0 at the end.

       

      +

      •Transfer 10.50$ to 965001, the USSD content is: 86755965001#10*5

       

      +

      •Transfer 10.00$ to 965001, the USSD content is: 86755965001#10

       

      +

      •Transfer 0.05$ to 965001, the USSD content is: 86755965001#0*05

       

      +

      4.If the input credit exceeds subscriber A's remaining balance or number B is invalid, system replies a notification message.

       

      +

      5.If the reply content is correct, system replies USSD response for confirmation:

       

      +

      You will transfer X$ to number B. Press 0 to cancel. Press 1 to confirm. Press 2 to re-enter.

      +

       

      +

      6.Press 1 to transfer credit X from A to B. System replies USSD response:

       

      +

      You鈥檝e transferred X$ to number B. Your current balance is Y$, expiry on YYYY-MM-DD.

      +

       

      +

      The expiry date of subscriber A is unchanged. The expiry date of subscriber B compares with that of subscriber A and chooses the longer one.

      +

       

      +

      7.A notification short message is sent to subscriber A:

       

      +

      You鈥檝e transferred X$ to number B. Your current balance is Y$, expiry on YYYY-MM-DD.

      +

       

      +

      8.A notification short message is sent to subscriber B:

       

      +

      You've received X$ from number A. Your current balance is Z$, expiry on YYYY-MM-DD.

      +

       

      +

      9.A PPS CDR is generated for transmitter, charge type is transfer out. A PPS CDR is generated for receiver, charge type is transfer in.

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.5

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_50.gif b/wxc2_omc/omcHelp/2_48_50.gif new file mode 100755 index 0000000..e975e7b Binary files /dev/null and b/wxc2_omc/omcHelp/2_48_50.gif differ diff --git a/wxc2_omc/omcHelp/2_48_6.htm b/wxc2_omc/omcHelp/2_48_6.htm new file mode 100755 index 0000000..7bcf09a --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_6.htm @@ -0,0 +1,369 @@ +锘� + + + Configuring F&F Number + + + + + + + + + + + + + + + + + + + + +
      +

      Configuring Friends and Family Number

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Family and Friends Number feature adds rating flexibility to the prepaid billing solution. This additional feature allows for discounted calling rate to be made to calls up to 5 pre-elected local network numbers. Prepaid subscribers should simply dial the service number to register and activate Family and Friends on their accounts by following the IVR instructions.

      +

       

      +

      There are total 6 Family and Friends Plan can be configured in each COS and assigned to different customer groups. Each plan defines Family and Friends Number attributes, such as registration fee, free call duration and free short message on a monthly basis. Please note only service provider has privilege to add subscriber to a FF Plan, whether this registration operation is free or charged depend on the Registration Fee parameter of the FF plan. The subscriber calls the PPS service center to apply a FF service. After the applied FF Plan takes effect, the subscriber can maintain his own favorite numbers by the self-service PPS hotline. The subscriber can inquire his applied FF Plan by dialing the USSD F&F Inquiry access code.

      +

       

      +

      The number of times聽the customers can change registered numbers in聽their聽Family and Friends profiles is under the service provider's control. The free charged number of change times can be pre-configured by service provider on a daily basis. The exceeding changes will be charged in a preset tariff.

      +

       

      +

      The following diagram demonstrates the operation procedures and relevant audio prompts when a subscriber dials to the prepaid hotline number to maintain F&F number:

      +

       

      +

      picture_icon

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      Refer to Enabling Prepaid Service to configure SCCP parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Refer to Enabling Audio Prompt to configure the PPS hotline number.

      +

       

      +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_32

      +

       

      +

      1.Click to open the SRF Parameters >Service Key tab.

       

      +

      2.Click the hyperlinked index number of Favorite Number Service to open its Option window.

       

      +

      3.Configure the dedicated service key for Family and Friends Number service.

       

      +

      4.Click highlight SAVE after change.

       

      +

      5.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_33

      +

       

      +

      1.Click to open the Service Control >COS tab.

       

      +

      2.Click the hyperlinked index number to open an existing COS table, or click New to create a new COS table.

       

      +

      3.In the Friends and Family Number table, configure the necessary parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Optional Values

      +

      Flag

      +

      Enable or disable Friends and Family number service of this COS.

      +

      •Enable

      •Disable

      Charge for Change

      +

      Enable or disable charge for changing friends and family number.

      +

      •Charge

      •Free

      Free Changes

      +

      Define the free change times of F&F number if charge is enabled.

      +

      0 - 36000

      +

      Local Number

      +

      Enable or disable F&F number register to local number.

      +

      •Enable

      •Disable

      NDD Number

      +

      Enable or disable F&F number register to national number.

      +

      IDD Number

      +

      Enable or disable F&F number register to international number.

      +

      Balance Threshold to Call FF Number

      +

      Define the minimum balance threshold allowed to apply the F&F plan. Unit is the minimum currency unit.

      +

      0 - 65535

      +

      Keep or Remove FF Number

      +

      Keep or remove registered F&F number list of prepaid accounts on a monthly basis. Set to remove will change the F&F service status to suspend on the rent charge date.

      +

      •Keep

      •Remove

      Balance Threshold to Keep FF Number

      +

      It is associated with the upper parameter. Define the minimum balance threshold which allows to keep F&F number list when the upper parameter set to Keep. Unit is the minimum currency unit.

      +

      0 - 65535

      +

      FF Plan 1 - 6

      +

      Attributes of F&F Number Plan

      +

      --

      +

      Registration Fee

      +

      Registration fee for the first time F&F Number Plan activation.

      +

      0 - 65535

      +

      Max Numbers

      +

      Specify the allowable maximum F&F members per prepaid account.

      +

      0 - 5

      +

      Free Call Duration

      +

      Define free call duration for F&F Number service on a monthly basis. Unit is Minute.

      +

      0 - 20000

      +

      Free SMS

      +

      Define quantity of free SMS for F&F Number service on a monthly basis.

      +

      0 - 60000

      +

      Rent ID

      +

      Specify the Rent ID for the F&F Number service registration fee. 0 means no rent.

      +

      0 - 8

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_34

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >Refresh.

       

      +

      2.Click the second Download button to update the current Tariff Plan from PPS to OMC GUI.

       

      +

      2_48_35

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >MO.

       

      +

      2.Select a Tariff ID from the upper right corner Tariff ID drop-down list.

       

      +

      3.In the Rent table, click the hyperlinked index number of an idle item to open its option window.

       

      +

      4.Configure the necessary parameters given in the following table to configure monthly rent for F&F service.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Description

      +

      Enter a name for the rent entry. It is identification purpose only.

      +

      FF Number

      +

      Charge Type

      +

      Specify the rent is on a daily basis or on a monthly basis.

      +

      Monthly

      +

      Charge Date

      +

      It is associated with the upper parameter. For monthly rent, specify the charge date in each month.

      +

      1 - 28

      +

      Charge Amount

      +

      Specify the monthly charge fee for F&F service. Unit is the minimum currency unit.

      +

      0 - 65535

      +
      +
      +

       

      +

      5.Click the 2_041 button to update parameters to Tariff Plan.

       

      +

      6.In the Supplementary Tariff table, click the hyperlinked Friends and Family Number Call to open its option window.

       

      +

      7.Configure the Charge Amount in minimum currency and Charge Unit in second for F&F number call.

       

      +

      8.Click the 2_041 button to update parameters to Tariff Plan.

       

      +

      9.Click the hyperlinked Friends and Family Number Change Fee to open its option window.

       

      +

      10.Configure the Charge Amount in minimum currency for F&F number change.

       

      +

      11.Click the 2_041 button to update parameters to Tariff Plan.

       

      +

      2_48_36

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >Startup.

       

      +

      2.Enter the new tariff activate time and click Submit button to submit.

       

      +

      The Friends and Family Number call charge format is:

      +

      F&F Number Call Charge = Charge for Initial Call Period + Charge for Call Duration.

      +

      •Charge for Initial Call Period = Minimum Charging Unit (defined in MO Basic Tariff table) x F&F Number Tariff (defined in Supplementary Tariff table) + Initial Charge Adjustment (defined in MO Basic Tariff table)

      •Charge for Call Duration = F&F Number Tariff (defined in Supplementary Tariff table) x ceil {[Call Duration - Free Time (defined in MO Basic Tariff table) - Min. Charging Unit (defined in MO Basic Tariff table) x Charging Unit (defined in Supplementary Tariff table)] / Charging Unit (defined in Supplementary Tariff table)}

       

      +
      +
      +

       

      +
      + + + +

      Subscriber should dial to the prepaid service center to subscribe for the F&F Number service, and then operator updates the PPS account to activate this service:

      +

       

      +

      2_48_38

      +

       

      +

      1.Go to EMS >Advanced >Subscriber >PPS.

       

      +

      2.Click the 2_014 button on the up right corner to upload PPS subscribers from PPS database.

       

      +

      3.Click the MSISDN of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.In the #10 line, enter the ID of the configured COS, select the 2_026 button at the front.

       

      +

      5.In the #57 line, enter the ID of the configured FF Plan in the specific COS, select the 2_026 button at the front.

       

      +

      6.Click the 2_020 button at the top of the parameter table to upload the new values to PPS servers.

       

      +

      7.Click the 2_019 button at the top of the parameter table to update values from PPS servers.

       

      +

      8.Verify that the new values have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Subscriber A dials hotline number and selects the F&F menu. SRF plays announcement:

       

      +

      Press 1 to add F&F number. Press 2 to delete an existing F&F number. Press 3 to inquiry existing F&F number. Press 4 to exit.

      +

       

      +

      2.Subscriber A presses 1. SRF plays announcement:

       

      +

      Please enter your F&F number. Press # to end.

      +

       

      +

      3.Subscriber A inputs the number of subscriber B #. SRF repeats the number of B and asks A press # to confirm. SRF plays announcement:

       

      +

      You have added F&F number B. Press 1 to add F&F number. Press 2 to delete an existing F&F number. Press 3 to inquiry existing F&F number. Press 4 to exit.

      +

       

      +

      4.Subscriber A presses 3. SRF plays announcement:

       

      +

      Please enter the F&F index number. The number range is from 1 to 5.

      +

       

      +

      5.Subscriber A presses 1. SRF plays announcement:

       

      +

      The F&F number is number B. Press 1 to add F&F number. Press 2 to delete an existing F&F number. Press 3 to inquiry existing F&F number. Press 4 to exit.

      +

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.6

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_7.htm b/wxc2_omc/omcHelp/2_48_7.htm new file mode 100755 index 0000000..aa9a0ba --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_7.htm @@ -0,0 +1,340 @@ +锘� + + + Configuring P&C Number + + + + + + + + + + + + + + + + + + + + +
      +

      Configuring Parent and Children Number

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Parent and Children feature allows parents to put spending limits on their children's mobile phone usage. The calls made between parent and child can be charged in a discounted calling rate. Moreover, the numbers of charged calls the child can make are predefined on a daily basis. It is controlled by COS parameter.

      +

       

      +

      The parent account is principal account while the children accounts are its supplementary accounts. The operator can restrict the following supplementary accounts characteristics for a specific principal account group (COS):

      +

      •The max calls can be made on a daily basis.

      •The max SMS can be sent on a daily basis.

      •Enable or disable child to transfer balance.

      •The ceiling credit can be complemented on a daily basis, or the lower credit limit to inform parent to transfer balance manually.

       

      +

      There are two ways to add supplementary accounts to principal account:

      +

      •Dial to the service center, and ask operator to add the main account number in the supplementary account profiles.

      •Dial to the service number to register and activate supplementary accounts by following the IVR instructions. After a successful binding, a notification short message will be sent to both the parent and child mobiles.

       

      +

      Each main account can own up to five supplement accounts. The PPS will automatically transfer credit from the main account to its supplementary accounts on a daily basis to top-up it to a preset ceiling credit. The supplement accounts can be set into senior rank and junior rank. Each rank of supplementary accounts can have its own ceiling credit. Since the credit will be transferred immediately when the supplementary account is created, the main account is not allowed to add supplementary account when his balance is lower than a preset minimal balance limit.

      +

       

      +

      For example, the ceiling credit of senior account is 10$ and the ceiling credit of junior account is 5$. At the beginning of a day, there are 10$ in the senior account and 5$ in the junior account. At the end of the day, there remains 4$ in the senior account and 4$ in the junior account. The next day, the PPS will transfer 6$ from the parent account to its senior account to top-up it to 10$, and transfer 1$ to its junior account.

      +

       

      +

      The following diagrams demonstrate the operation procedures and relevant audio prompts when a subscriber dials to the P&C service number with different privileges (parent and child):

      +

       

      +

      picture_icon        picture_icon

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      Refer to Enabling Prepaid Service to configure SCCP parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Refer to Enabling Audio Prompt to configure the PPS hotline number.

      +

       

      +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_30

      +

       

      +

      1.Click to open the SRF Parameters >Service Number tab.

       

      +

      2.Click the hyperlinked index number of Pool Account Service Number to open its option window.

       

      +

      3.Configure the dedicated service number for Parent and Children Number service.

       

      +

      4.Click highlight SAVE after change.

       

      +

      5.Click the 2_041 button to update parameters to application servers.

       

      +

      2_48_47

      +

       

      +

      1.Click to open the Service Control >SMS Sentence tab.

       

      +

      2.Click the hyperlinked index number of the Pool Account relevant sentences to open the configuration window.

       

      +

      3.Edit the sentence in the Language x Content line, click highlighted SAVE when it's done.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      SMS Sentence

      +

      Pool Account

      +

      Child balance is too low, please recharge it on time.

      +

      Pool Account

      +

      You have added a child number:

      +

      Pool Account

      +

      You have deleted a child number:

      +

      Pool Account

      +

      You have been added as a child number by:

      +

      Pool Account

      +

      Your child role have been deleted by:

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_39

      +

       

      +

      1.Click to open the Service Control >COS tab.

       

      +

      2.Click the hyperlinked index number to open an existing COS table, or click New to create a new COS table.

       

      +

      3.In the Service Control >Parent & Children Number table, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Optional Values

      +

      Role

      +

      Specify the pool account status and role of this COS.

      +

      •Normal = the pool account parameters are inactive in this COS.

      •Parent = the parameters for parent are active.

      •Child = the parameters for child are active.

      •Normal

      •Parent

      •Child

      Parent Chosen COS A

      +

      Specify two COS for child accounts with different authority levels when the upper Flag is set to Parent. To conform with IVR prompt, the COS A should set to a higher authority.

      +

      0 - 63

      +

      Parent Chosen COS B

      +

      Child Transfer Flag

      +

      The following parameters are for child account. They come into effect when the upper Flay is set to Child. Enable or disable the child account transfer balance privately.

      +

      •Enable

      •Disable

      Child Credit From

      +

      Specify the mode that the parent account replenishes child accounts.

      +

      •Auto Replenish = Parent account automatically replenishes the child accounts to the Child Max Consumed Credit on a daily basis.

      •Manual Transfer = When the credit in the child account reaches the Child Max Consumed Credit, a short message will be sent to notify his parent to transfer credit manually.

      •Auto Replenish

      •Manual Transfer

      Child Max Calls per Day

      +

      Specify the limit of calls and short messages that the child account can make and send per day.

      +

      0 - 65535

      +

      Child Max SMS per Day

      +

      Child Max Consumption

      +

      This parameter refers to the Child Credit From parameter. Unit is the minimum currency unit.

      +

      •For Auto Replenish, it's the ceiling credit.

      •For Manual Transfer, it's the lower credit limit to trigger notification short message.

      Pool Account Flag

      +

      Enable or disable Parent & Children Number service in the specific COS.

      +

      0 - 65535

      +

      Charge for Change

      +

      Enable or disable charge for changing child number.

      +

      •Enable

      •Disable

      Free Changes

      +

      Specify the free change times of child number if charge is enabled.

      +

      0 - 127

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_34

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >Refresh.

       

      +

      2.Click the second Download button to update the current Tariff Plan from PPS to OMC GUI.

       

      +

      2_48_35

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >MO.

       

      +

      2.Select a Tariff ID from the upper right corner Tariff ID drop-down list.

       

      +

      3.In the Supplementary Tariff table, click the hyperlinked Pool Call to open its option window.

       

      +

      4.Configure the Charge Amount in minimum currency and Charge Unit in second for F&F number call.

       

      +

      5.Click the 2_041 button to update parameters to Tariff Plan.

       

      +

      6.Click the hyperlinked Pool Account Change Fee to open its option window.

       

      +

      7.Configure the Charge Amount in minimum currency for Child Number change.

       

      +

      8.Click the 2_041 button to update parameters to Tariff Plan.

       

      +

      2_48_36

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >Startup.

       

      +

      2.Enter the new tariff activate time and click Submit button to submit.

       

      +

      The Parent and Children Number call charge format is:

      +

      P&C Number Call Charge = Charge for Initial Call Period + Charge for Call Duration.

      +

      •Charge for Initial Call Period = Minimum Charging Unit (defined in MO Basic Tariff table) x Pool Call Tariff (defined in Supplementary Tariff table) + Initial Charge Adjustment (defined in MO Basic Tariff table)

      •Charge for Call Duration = Pool Call Tariff (defined in Supplementary Tariff table) x ceil {[Call Duration - Free Time (defined in MO Basic Tariff table) - Min. Charging Unit (defined in MO Basic Tariff table) x Charging Unit (defined in Supplementary Tariff table)] / Charging Unit (defined in Supplementary Tariff table)}

       

      +
      +
      +

       

      +
      + + + +

      Subscriber should dial to the prepaid service center to subscribe for the P&C Number service, and then operator updates the PPS account to activate this service:

      +

       

      +

      2_48_38

      +

       

      +

      1.Go to EMS >Advanced >Subscriber >PPS.

       

      +

      2.Click the 2_014 button on the up right corner to upload PPS subscribers from PPS database.

       

      +

      3.Click the MSISDN of the subscriber want to edit, this displays the editable parameter window.

       

      +

      4.In the #40 line, modify the Pool Account Type from Normal to Parent to activate the P&C Number service, select the 2_026 button at the front.

       

      +

      5.Click the 2_020 button at the top of the parameter table to upload the new values to PPS servers.

       

      +

      6.Click the 2_019 button at the top of the parameter table to update values from PPS servers.

       

      +

      7.Verify that the new values have been saved for the subscriber.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Subscriber A (parent) dials P&C service number. SRF plays announcement:

       

      +

      Press 1 to inquire existing child numbers; Press 2 to add a child number; Press 3 to delete an existing child number; Press 0 to cancel.

      +

       

      +

      2.Subscriber A presses 2. SRF plays announcement:

       

      +

      Please enter the child number. Press # to end.

      +

       

      +

      3.Subscriber A inputs the number of subscriber B #. SRF plays announcement:

       

      +

      Please specify the child number to an authority level. Press 1 to senior rank. Press 2 to junior rank.

      +

       

      +

      4.Subscriber A presses 1. SRF plays announcement:

       

      +

      The child number to add is number B. The authority level is senior rank. Press 1 to confirm; Press 2 to re-enter; Press 0 to cancel.

      +

       

      +

      5.Subscriber A presses 1. SRF plays announcement:

       

      +

      Added number successfully.

      +

       

      +

      6.A notification short message is sent to subscriber A:

       

      +

      You have added a child number: <Number B>

      +

       

      +

      6.A notification short message is sent to subscriber B:

       

      +

      You have been added as a child number by: <Number A>

      +

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.7

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_8.htm b/wxc2_omc/omcHelp/2_48_8.htm new file mode 100755 index 0000000..914f447 --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_8.htm @@ -0,0 +1,348 @@ +锘� + + + Enabling Call Me Back + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Call Me Back

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Call Me Back feature is a free of charge service that allows out-of-credit customers to request from another local network prepaid or postpaid user to call them. Customer can initiate Call Me Back notification by either USSD or short message:

      +

      •Dial the USSD service number to activate call me service. Follow the prompt to reply destination number.

      •Edit a short message contains destination number and send it to the toll-free Call Me service number.

       

      +

      After receives the request, the UltraWAVE system will send a short message to the destination number with the preset Call Me Back message. Please note that the destination number must belong to local network.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      Refer to Enabling Prepaid Service to configure SCCP parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Make sure the System ID at the upper right corner displays PPS_pub, click the 2_035 button.

       

      +

      2_48_30

      +

       

      +

      1.Click to open the SRF Parameters >Service Number tab.

       

      +

      2.Click the hyperlinked index number of Call Me Back Service Number to open its option window.

       

      +

      3.Configure the service number for Call Me Back service.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      2_48_43

      +

       

      +

      1.Click to open the SRF Parameters >USSD Service Number tab.

       

      +

      2.Click the hyperlinked index number of the Call Me Back service to open its option window.

       

      +

      3.Configure the Call Me Back access code and click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update it to application servers.

       

      +

      2_48_44

      +

       

      +

      1.Click to open the SRF Parameters >USSD Service Key tab.

       

      +

      2.Click the hyperlinked index number of the Call Me Back service to open its option window.

       

      +

      3.Configure the Call Me Back service key and click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update it to application servers.

       

      +

      2_48_45

      +

       

      +

      1.Click to open the Service Control >SMS Sentence tab.

       

      +

      2.Click the hyperlinked index number of the Call Me Back relevant sentences to open the configuration window.

       

      +

      3.Edit the sentence in the Language x Content line, click highlighted SAVE when it's done.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      SMS/USSD Sentence

      +

      Call Me Back Prompt (USSD)

      +

      Please enter the destination number with Country Code and National Destination Code:

      +

      Call Me Back Notification

      +

      asked for your call

      +

      Call Me Back Limited

      +

      Your call me back requests reached the max allowed times.

      +

      Call Me Back Advertisement

      +

      Please return the call. Welcome to use the call me back service.

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_46

      +

       

      +

      1.Click to open the Service Control >COS tab.

       

      +

      2.Click the hyperlinked index number to open an existing COS table, or click New to create a new COS table.

       

      +

      3.In the Service Control table, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Optional Values

      +

      Call Me Back Threshold

      +

      Subscriber is not allowed to apply call me back service when his remaining balance is more than this value. Unit is minimum currency unit.

      +

      •0 = No limitation

      0 - 255

      +

      Call Me Back Max Times

      +

      The maximum allowable times of call me back service per month.

      +

      •0 = No limitation

      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Refer to Enabling Interactive SMS to configure SMPP parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMSC.

       

      +

      2.Make sure the System ID at the upper right corner displays SMSC_pub, click the 2_035 button.

       

      +

      2_70_04

      +

       

      +

      1.Click to open the SMPP tab.

       

      +

      2.Click the hyperlinked index number of New to open an Option window.

       

      +

      3.Configure the necessary parameters given in the following table to bind the balance transfer service number with the configured SMPP connection.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Alias

      +

      It is the same Link Alias as that in the previous SMPP configuration. Use the PPS inquiry number by default.

      +

      PPS Inquiry Number

      +

      Session Type

      +

      Specify how the local SMPP entity shall bind to the remote SMPP entity. Select bindTRX as a transceiver.

      +

      bindTRX

      +

      Service Number

      +

      Enter the PPS balance transfer service number which configured in PPS >SRF Parameters >SRF Number >Credit Transfer Service Number.

      +

      Call Me Back Service Number

      +

      DCS

      +

      Data Coding Scheme. Reserved as smpp7def8.

      +

      smpp7def8

      +

      Platform ID

      +

      The served MSC platform. Reserved as Ignore.

      +

      Ignore

      +

      Time to Live

      +

      Define the maximum duration of a pending message which should be kept in sending array till reaches the called subscriber.  Messages can't send out in the validity period will be deleted. Unit is second. Reserved as 18 hours.

      +

      64800

      +

      Manipulation Flag

      +

      Enable or disable CLI Manipulation in XAPP setting. Reserved as Disable.

      +

      Disable

      +

      TON

      +

      Indicate Type of Number for destination. Reserved as Unknown.

      +

      Unknown

      +

      NPI

      +

      Indicate Numbering Plan Indicator for destination. Reserved as Unknown.

      +

      Unknown

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Subscriber A edits the called subscriber number B and sends it to Call Me Back service number.

       

      +

      <Number B>

      +

       

      +

      Please note the <Number B> is the whole number with CC and NDC.

      +

       

      +

      2.A notification short message is sent to subscriber B (the sender's number is <Number A>):

       

      +

      <Number A> asks for your call at <Time>. Please return the call.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Subscriber A dials the Call Me Back USSD service code to initiate Call Me Back dialog.

       

      +

      For example:

      +

       

      +

      •Set 124 as Call Me Back USSD service code, dial *124# to initiate a USSD dialog.

       

      +

      2.If the subscriber A's call me back requests reached the maximum allowed times, system responds:

       

      +

      Your call me back requests reached the max allowed times.

      +

       

      +

      3.The system replies USSD response:

       

      +

      Please enter the destination number with Country Code and National Destination Code:

      +

       

      +

      4.Subscriber A responds by entering appropriate content:

       

      +

      <Number B>

      +

       

      +

      5.A notification short message is sent to subscriber B (the sender's number is <Number A>):

       

      +

      <Number A> asks for your call at <Time>. Please return the call.

      +

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.8

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_48_9.htm b/wxc2_omc/omcHelp/2_48_9.htm new file mode 100755 index 0000000..e9a97cc --- /dev/null +++ b/wxc2_omc/omcHelp/2_48_9.htm @@ -0,0 +1,196 @@ +锘� + + + Enabling Tier Rating + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Tier Rating

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The tier rating feature allows each prepaid call to be charged in different tariffs, based on the call duration. The PPS supports up to three tiers for one call, each tier can set its own period, basic fee and long distance fee.

      +

       

      +

      Depending on the setting of tier period, the operation can decide whether continue adopting the last tier tariff or repeat the tier cycle after reaching the deadline of the last configured tier:

      +

      •Cyclical Tier Rating: Set the Tier Units parameter to rational value to demarcate each of the tier periods.

      •Noncyclical Tier Rating: Set the last Tier's Units parameter to an enormous value to extend the last tier period.

       

      +

      2_48_48        2_48_49

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      Operator designs the prepaid tariff profiles with different tariff rates for different tiers in a call. The tariff profile may composite of up to three tiers in a cycle. Each tier may use different tariff. The boundary of a tier is defined by accumulated duration in a call.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_48_34

      +

       

      +

      1.Go to EMS >Advanced >Tariff Plan >Refresh.

       

      +

      2.Click the second Download button to update the current Tariff Plan from PPS to OMC GUI.

       

      +

      2_48_35

      +

       

      +

      1.Click on the Advanced main menu.

       

      +

      2.Select MO under the Tariff Plan submenu, this displays the MO tariff configuration window.

       

      +

      3.Select the Tariff ID at the upper-right corner.

       

      +

      4.Click the hyperlink of an existing prefix, or click +Add button to add a new prefix.

       

      +

      5.Configure the relevant parameters given in the following table.

       

      +

      6.Click the 2_041 button to update parameters to application servers.

       

      +

      7.Repeat the procedures to configure other prefixes or Tariff IDs.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Tier Level

      +

      Define the operative tier cycle on this prefix.

      +

      •0 = Tier 0 cycle will be repeated till the end of call.

      •1 = Tier 0 and Tier 1 cycles will be repeated till the end of call.

      •2 = All three tier cycles will be repeated till the end of call.

      0 - 2

      +

      Tier 0 Units

      +

      Define the period of tier 0. Unit is multiple of the charge-unit.

      +

      For example: if the upper Charge Unit is 6 seconds, and the Tier 0 Units is 10, the period of tier 0 is 60 (6x10) seconds. When this period ends, the next operative tier cycle will start.

      +

      0 - 65535

      +

      Tier 0 Basic Fee

      +

      The tariff used to charge a call except the initial call period. Unit is minimum currency unit.

      +

      Tier 0 Long Distance

      +

      The extra charge for a national or international call. The unit is minimum currency unit.

      +

      Tier 1 Units

      +

      Define the period of tier 1. Unit is multiple of the charge-unit. When this period ends, the next operative tier cycle will start.

      +

      Tier 1 Basic Fee

      +

      The tariff used to charge a call except the initial call period. Unit is minimum currency unit.

      +

      Tier 1 Long Distance

      +

      The extra charge for a national or international call. The unit is minimum currency unit.

      +

      Tier 2 Units

      +

      Define the period of tier 2. Unit is multiple of the charge-unit. When this period ends, the next operative tier cycle will start.

      +

      For Noncyclical Tier Rating, just set this value to maximums (65535) .

      +

      Tier 2 Basic Fee

      +

      The tariff used to charge a call except the initial call period. Unit is minimum currency unit.

      +

      Tier 2 Long Distance

      +

      The extra charge for a national or international call. The unit is minimum currency unit.

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_49_02

      +

       

      +

      1.Select Startup under the Tariff Plan submenu, this display the Tariff Startup window.

       

      +

      2.On the operation page, set the start time for the new tariff plan, and enter the description for the tariff plan in the Remarks field.

       

      +

      3.Click the 2_024 button to set the start time.

       

      +

      4.The Tier Rating tariff will be activated at the preset startup time.

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.48.9

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_49.htm b/wxc2_omc/omcHelp/2_49.htm new file mode 100755 index 0000000..0e00f7c --- /dev/null +++ b/wxc2_omc/omcHelp/2_49.htm @@ -0,0 +1,136 @@ +锘� + + + Configuring Tariff + + + + + + + + + + + + + + + + + + + + +
      +

      Configuring Tariff

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The tariff (billing rates) is the logic and data that determines how much a subscriber pays for a call. It also defines other charges and features, such as periodic charges, Close User Group and the Friends and Family feature. The billing rates also cover payment for additional non-call transactions, such as Short Message Service (SMS).

      +

       

      +

      The billing rate contains several tables and object types, and is very flexible and highly configurable. Complex billing schemes can be built where the charge for a call depends on multiple factors including the day, the time, and the originating and terminating locations of the call.

      +

       

      +

      The billing rate for a given subscriber is fully determined by the subscriber's COS. There are no individual billing options. All the subscribers in a given COS pay the same for any call, providing all call attributes are the same.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_49_01

      +

       

      +

      1.Click on the Advanced main menu.

       

      +

      2.Select MO under the Tariff Plan submenu, this displays the MO tariff configuration window.

       

      +

      3.Select the Tariff ID at the upper-right corner.

       

      +

      4.Modify the Tariff contents as required.

       

      +

      5.Modify MT, Discount and Holiday tariff in the same way.

       

      +

      2_49_02

      +

       

      +

      1.Select Startup under the Tariff Plan submenu, this display the Tariff Startup window.

       

      +

      2.On the operation page, set the start time for the new tariff plan, and enter the description for the tariff plan in the Remarks field.

       

      +

      3.Click the 2_024 button to set the start time.

       

      +

      4.The modified MO tariff will be activated at the preset startup time.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_49_03

      +

       

      +

      1.Click the Advanced main menu.

       

      +

      2.Select Refresh under the Tariff Plan submenu, this displays the operation window.

       

      +

      3.Click the 2_033 button to download current tariff from prepaid server to EMS database.

       

      +

      2_49_04

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu to display the account maintenance window.

       

      +

      3.Under Current Tariff submenu, click on the download links to save all seven files to local directory.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_49_05

      +

       

      +

      1.Click the Maintenance main menu.

       

      +

      2.Select Account Data under the Backup&Restore submenu to display the account maintenance window.

       

      +

      3.Under the Tariff  Plan submenu, click the upload links to upload the backup tariff files to the prepaid servers.

       

      +

      4.Click the Advanced main menu.

       

      +

      5.Select Startup under the Tariff Plan submenu, this display the Tariff Startup window.

       

      +

      6.On the operation page, set the start time for the tariff plan, and enter the description for the tariff plan in the Remarks field.

       

      +

      7.Click the 2_024 button to set the start time.

       

      +

      8.The backup tariff will be activated at the preset startup time.

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Enable Prepaid Service

       

      +

      •Manage PPS Subscribers

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.49

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_49_01.gif b/wxc2_omc/omcHelp/2_49_01.gif new file mode 100755 index 0000000..968a354 Binary files /dev/null and b/wxc2_omc/omcHelp/2_49_01.gif differ diff --git a/wxc2_omc/omcHelp/2_49_02.gif b/wxc2_omc/omcHelp/2_49_02.gif new file mode 100755 index 0000000..1431649 Binary files /dev/null and b/wxc2_omc/omcHelp/2_49_02.gif differ diff --git a/wxc2_omc/omcHelp/2_49_03.gif b/wxc2_omc/omcHelp/2_49_03.gif new file mode 100755 index 0000000..6f589e0 Binary files /dev/null and b/wxc2_omc/omcHelp/2_49_03.gif differ diff --git a/wxc2_omc/omcHelp/2_49_04.gif b/wxc2_omc/omcHelp/2_49_04.gif new file mode 100755 index 0000000..14f355a Binary files /dev/null and b/wxc2_omc/omcHelp/2_49_04.gif differ diff --git a/wxc2_omc/omcHelp/2_49_05.gif b/wxc2_omc/omcHelp/2_49_05.gif new file mode 100755 index 0000000..8122d9b Binary files /dev/null and b/wxc2_omc/omcHelp/2_49_05.gif differ diff --git a/wxc2_omc/omcHelp/2_51.htm b/wxc2_omc/omcHelp/2_51.htm new file mode 100755 index 0000000..bcbb546 --- /dev/null +++ b/wxc2_omc/omcHelp/2_51.htm @@ -0,0 +1,253 @@ +锘� + + + Enabling CSRR + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Country Specific Roaming Restriction (CSRR)

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Country Specific Roaming Restriction (CSRR) feature provides for additional fraud protection within the HLR by enabling allowed roaming areas to be specifically defined for each subscriber. The CSRR defines 8 portfolios with up to 256 VPLMN ranges.

      +

       

      +

      The service provider establishes the actual definition of each VPLMN range. The subscriber chooses the areas in which service should be allowed or not allowed through updates through Customer Services. If a subscriber enters an area where service is prohibited or not authorized, the HLR will deny the subscriber's registration.

      +

       

      +

      The HLR maintains a list of 8 CSRR portfolios in which the subscriber is either allowed or denied service. The CSRR is positive (service is allowed only in the areas listed). A subscriber may choose one of CSRR portfolios or just select "No Restriction" to disable this function.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >HLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_51_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      CC

      +

      The Country Code identifies the country in which the Home PLMN is located.

      +

      --

      +

      NDC

      +

      The National Destination Code identifies the home PLMN.

      +

      --

      +

      Start SN

      +

      Identifies the beginning of local MSISDN number range.

      +

      --

      +

      End SN

      +

      Identifies the end of local MSISDN number range.

      +

      --

      +

      CDR Flag

      +

      Enable or disable HLR CDR generation.

      +

      Disable

      +
      +
      +

       

      +

      2_51_02

      +

       

      +

      1.Click the VPLMN tab, and then click New at the bottom of the VPLMN table.

       

      +

      2.In the VPLMN ID box, select an available number for the new VPLMN, and then click the 2_002 button.

       

      +

      3.In the VPLMN Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      CC

      +

      The Country Code (CC) which identifies the country in which the GSM VPLMN  is located.

      +

      --

      +

      NDC

      +

      The National Destination Code (NDC) which identifies the GSM VPLMN in that country.

      +

      --

      +

      Start SN

      +

      This parameter identifies the beginning of a VLR number range.

      +

      --

      +

      End SN

      +

      This parameter identifies the end of a VLR number range.

      +

      --

      +
      +
      +

       

      +

      2_51_03

      +

       

      +

      1.Click the CSRR List tab to display the CSRR List table.

       

      +

      2.Click the hyperlinked parameter value of an available entry to open its Option window.

       

      +

      3.Configure the relevant parameters given in the following table, click the 2_041 button to return.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      VPLMN ID

      +

      The CSRR list defines the roaming restriction for 256 VPLMN which corresponds to the VPLMN configured previously.

      +

      Enable

      +

       

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_34_01

      +

       

      +

      1.Go to EMS >Account >Subscriber >HLR.

       

      +

      2.Click the hyperlinked IMSI of the subscriber to open its Option window.

       

      +

      3.In the CSRR Type drop-down menu, select the corresponding index number of the eight CSRR portfolios.

       

      +

      4.Click the 2_041 button to update modified attributes to HLR database.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      CSRR Type

      +

      Select the corresponding index number of the eight CSRR portfolios.

      +

      •00 - 07 = CSRR Portfolio Index Number ->Allowed VPLMN Combinations

      •No restriction

      --

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Manage HLR Subscriber

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.51

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_51_01.gif b/wxc2_omc/omcHelp/2_51_01.gif new file mode 100755 index 0000000..52e0e75 Binary files /dev/null and b/wxc2_omc/omcHelp/2_51_01.gif differ diff --git a/wxc2_omc/omcHelp/2_51_02.gif b/wxc2_omc/omcHelp/2_51_02.gif new file mode 100755 index 0000000..1d75b4e Binary files /dev/null and b/wxc2_omc/omcHelp/2_51_02.gif differ diff --git a/wxc2_omc/omcHelp/2_51_03.gif b/wxc2_omc/omcHelp/2_51_03.gif new file mode 100755 index 0000000..c1805c2 Binary files /dev/null and b/wxc2_omc/omcHelp/2_51_03.gif differ diff --git a/wxc2_omc/omcHelp/2_52.htm b/wxc2_omc/omcHelp/2_52.htm new file mode 100755 index 0000000..0e22e50 --- /dev/null +++ b/wxc2_omc/omcHelp/2_52.htm @@ -0,0 +1,361 @@ +锘� + + + Enabling Roaming + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Roaming

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Roaming is a general term in wireless telecommunications that refers to the extending of connectivity service in a location that is different from the home location where the service was registered. Roaming occurs when a subscriber of one wireless service provider uses the facilities of another wireless service provider. This second provider has no direct pre-existing financial or service agreement with this subscriber to send or receive information. A device will usually indicate when it is roaming.

      +

       

      +

      The quintessential example of "roaming" is the case of cellular phones when a phone is in a location where its wireless service provider does not provide coverage (for example, another country). In some cases, roaming occurs in a phone's designated home area when it transmits via a different provider's tower (sometimes at a higher price). This is likely to occur when the service provider's signal is too weak or if the volume of callers is too high. In order for a mobile device to use a different carrier's service, the phone's service provider must have a roaming agreement with that carrier.

      +

       

      +

      The functions of a location updating procedure are described below:

      +

       

      +

      2_52_01

      +

       

      +

      1.A mobile subscriber from the home PLMN1 activates his MS in PLMN2.

      2.The MS requests the location updating procedure by sending the IMSI, the old LAI stored and the new LAI received, to the new VLR via its MSC.

      3.The new VLR determines that the old LAI does not belong to its own area and therefore creates a database entry for the new mobile subscriber who is assigned the LMSI as an address.

      4.By means of a global title translation on the IMSI, the new VLR obtains the signaling point code of GMSC2 and modifies the IMSI as described above. This GMSC2 in turn performs a global title translation which results in the addressing of GMSC1 in the home PLMN1.

      5.By means of another global title translation on the modified IMSI, GMSC1 obtains the signaling point code of the subscriber's HLR. This allows the new VLR to establish a signaling path.

      6.A successful subscription check at the HLR results in the mobile subscriber's registration in the new VLR of PLMN2. The HLR then supplies this VLR with all mobile subscriber data, including the zone code list belonging to the new VLR.

      7.The HLR also requests the old VLR to cancel the mobile subscriber's data record by sending his IMSI.

      8.The new VLR checks that the new location area belongs to a zone code from that list and informs the HLR on allowed roaming in the MSC area.

      9.At this point, the regional subscription has been completely checked, and the new VLR carries out the authentication procedure using the received triple of the corresponding IMSI from the HLR.

      10.Then, the new VLR initiates ciphering by sending the cipher-key to the MSC. The latter being requested to set the ciphering mode, passes it on to the BSS. The BSS starts the ciphering and deciphering process with the MS.

      11.The MSC terminates the location update upon receiving a confirmation that the MS has stored the new LAI.

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button.

       

      +

      2_52_02

      +

       

      +

      1.Click the GTT tab, and then click New at the bottom of the Globe Title Translate table.

       

      +

      2.In the GTT ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the GTT Option window, configure the following parameters to add GTT for remote HLR.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Repeat step 1 to 4 to add remote MSC and VLR.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Flag

      +

      Enable or disable this GTT item.

      +

      Enable

      +

      Number Plan

      +

      Describe which numbering plan will be used for the global title. The numbering plan chosen will aid the routing system in determining the correct network system to direct the message.

      +

      GT

      +

      Translation Type

      +

      Translation examines the destination address and deciding how to identify it over the telephone network.

      +

      0

      +

      Start GT Number

      +

      E.164 node number of remote MSC/VLR/HLR.

      +

      E.164 Number

      +

      End GT Number

      +

      E.164 node number of remote MSC/VLR/HLR.

      +

      E.164 Number

      +

      Network Indicator

      +

      Nature of Address Indicator. It indicates the scope of the address value.

      +

      --

      +

      DPC

      +

      Point Code of remote network.

      +

      --

      +

      SSN

      +

      Subsystem Number of MSC/VLR/HLR.

      +

      6(HLR)

      +

      7(VLR)

      +

      8(MSC)

      +

      Route Indicator

      +

      For the connected network, select Route on GT.

      +

      Route on GT

      +

      Address Indicator

      +

      Contribution of SCCP Address.

      +

      GT+DPC+SSN

      +

      Replace Start Digit

      +

      The start digit of the GT number to be replaced.

      +

      0

      +

      Replace End Digit

      +

      The end digit of the GT number to be replaced.

      +

      0

      +

      Replacing Number Plan

      +

      The type of the number to be output.

      +

      N/A

      +

      Replacing Digits

      +

      Replace the selected GT number range with these digits.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_52_02

      +

       

      +

      1.On the GTT tab, click New at the bottom of the Globe Title Translate table.

       

      +

      2.In the GTT ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the GTT Option window, configure the following parameters to add GTT for inbound subscribers.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Flag

      +

      Enable or disable this GTT item.

      +

      Enable

      +

      Number Plan

      +

      Describe which numbering plan will be used for the global title. The numbering plan chosen will aid the routing system in determining the correct network system to direct the message.

      +

      GT

      +

      Translation Type

      +

      Translation examines the destination address and deciding how to identify it over the telephone network.

      +

      0

      +

      Start GT Number

      +

      Specify the beginning IMSI of inbound roaming subscribers.

      +

      Start IMSI

      +

      End GT Number

      +

      Specify the end IMSI of inbound roaming subscribers.

      +

      End IMSI

      +

      Network Indicator

      +

      Nature of Address Indicator. It indicates the scope of the address value.

      +

      --

      +

      DPC

      +

      Point Code of remote network.

      +

      --

      +

      SSN

      +

      Subsystem Number. For IMSI and MSISDN, specify SSN to 6.

      +

      6

      +

      Route Indicator

      +

      For the connected network, select Route on GT.

      +

      Route on GT

      +

      Address Indicator

      +

      Contribution of SCCP Address.

      +

      GT+DPC+SSN

      +

      Replace Start Digit

      +

      The start digit of the GT number to be replaced.

      +

      0

      +

      Replace End Digit

      +

      The end digit of the GT number to be replaced.

      +

      0

      +

      Replacing Number Plan

      +

      The type of the number to be output.

      +

      N/A

      +

      Replacing Digits

      +

      Replace the selected GT number range with these digits.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Connect to External Switch

       

      +

      •Enable Country Specific Roaming Restriction (CSRR)

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.52

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_52_01.gif b/wxc2_omc/omcHelp/2_52_01.gif new file mode 100755 index 0000000..82320cf Binary files /dev/null and b/wxc2_omc/omcHelp/2_52_01.gif differ diff --git a/wxc2_omc/omcHelp/2_52_02.gif b/wxc2_omc/omcHelp/2_52_02.gif new file mode 100755 index 0000000..2ef359e Binary files /dev/null and b/wxc2_omc/omcHelp/2_52_02.gif differ diff --git a/wxc2_omc/omcHelp/2_53.htm b/wxc2_omc/omcHelp/2_53.htm new file mode 100755 index 0000000..c035f98 --- /dev/null +++ b/wxc2_omc/omcHelp/2_53.htm @@ -0,0 +1,141 @@ +锘� + + + Modifying ACN + + + + + + + + + + + + + + + + + + + + +
      +

      Modifying Application Context Name

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Service users are engaged with each other via a service-provider during a certain period of time. This common engagement is well known as association, or interaction. In ETSI, the term dialogue is used for this engagement.

      +

       

      +

      Two service users engaged in a dialogue, interact with a service-provider for the transfer of their messages. The point at which an interaction takes place is called service access point (SAP) located at the boundary of the service-provider, and the exchange of messages at the SAPs is accomplished by the performance of service primitives (SPs).

      +

       

      +

      The SPs of the common MAP service elements contain a parameter, called Application Context Name. The value of this parameter refers to an user-specific MAP service, e.g., handover control. It is used to indicate the purpose of a dialogue. Besides it could partly be used as an identifier for a certain dialogue, by which corresponding independent message flows (of parallel dialogues) can be distinguished. A version negotiation mechanism based on the use of an application-context-name is used to negotiate the protocol version used between two entities for supporting a MAP-user signalling procedure.

      +

       

      +

      The ACN facility enables the version negotiation for the following messages, which makes the UltraWAVE system more compatible with the other networks by means of flexible message version adjustment.

      +

       

      +

       

      +
      + + + +

      1.Network Location Update

       

      +

      2.Location Cancel

       

      +

      3.Roaming number enquiry

       

      +

      4.Location Info Retrieval

       

      +

      5.Reset Context

       

      +

      6.Handover Control

       

      +

      7.Equipment management

       

      +

      8.Info Retrieval

       

      +

      9.Inter VLR Info Retrieval

       

      +

      10.Subscriber Data Management

       

      +

      11.Tracing

       

      +

      12.Network Functional SS

       

      +

      13.Network Unstructured SS

       

      +

      14.Short Message Gateway

       

      +

      15.Short Message MO Relay

       

      +

      16.Short Message Alert

       

      +

      17.Short Message Waiting Data Management

       

      +

      18.Mobile Terminating Short Message Relay

       

      +

      19.IMSI Retrieval

       

      +

      20.MS purging

       

      +

      21.Subscriber Info Enquiry

       

      +

      22.Any Time Info Enquiry

       

      +

      23.Call Control Transfer

       

      +

      24.Invocation Notification

       

      +

      25.SIWFS Allocation

       

      +

      26.Group Call Control

       

      +

      27.GPRS Location Update

       

      +

      28.GPRS Location Info Retrieval

       

      +

      29.Failure Report

       

      +

      30.GPRS Notify

       

      +

      31.Reporting

       

      +

      32.Call Completion

       

      +

      33.Security Triplets

       

      +

      34.Subscriber Interrogate

       

      +

      35.HLR Subscriber Management

       

      +

      36.HLR Ping AUC

       

      +

      37.VLR Supported CAMEL Phases: Phase 1, Phases 1+2, Phases 1+2+3

       

      +

       

      +
      +
      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_pub), click the 2_035 button.

       

      +

      2_53_09

      +

       

      +

      1.Click to open the Network tab.

       

      +

      2.Click the hyperlinked index number to open an existing ACN entry, or click New to create a new ACN entry.

       

      +

      3.Select version for supported messages, click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      2_53_10

      +

       

      +

      1.Click to open the GTT tab.

       

      +

      2.Click the hyperlinked index number to open the targeted GTT entry.

       

      +

      3.Enter the index number of the pre-configured ACN Version entry, click highlight SAVE after change.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.53

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_53_09.gif b/wxc2_omc/omcHelp/2_53_09.gif new file mode 100755 index 0000000..b66832d Binary files /dev/null and b/wxc2_omc/omcHelp/2_53_09.gif differ diff --git a/wxc2_omc/omcHelp/2_53_10.gif b/wxc2_omc/omcHelp/2_53_10.gif new file mode 100755 index 0000000..e2febce Binary files /dev/null and b/wxc2_omc/omcHelp/2_53_10.gif differ diff --git a/wxc2_omc/omcHelp/2_54.htm b/wxc2_omc/omcHelp/2_54.htm new file mode 100755 index 0000000..ba9a7b0 --- /dev/null +++ b/wxc2_omc/omcHelp/2_54.htm @@ -0,0 +1,1267 @@ +锘� + + + Enabling Voice Mail + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Voice Mail

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Voice Mail System (VMS) is a value-added peripheral of the UltraWAVE system. For a registered subscriber, an incoming call will be forwarded to his voice mail box in the voice mail server when he is busy, no answer, switched off or not reachable. When there is a new voice message in the mail box, the SMSC will send a notification short message to the host. The VMS talks to MSC and PPS over ISUP and CAP.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VSS.

       

      +

      2.Make sure the System ID at the upper right corner displays VSS_0, click the 2_035 button.

       

      +

      2_54_01

      +

       

      +

      1.Click Trunk tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network.

      +

      National

      +

      DPC

      +

      Originating Point Code to MSS.

      +

      1

      +

      OPC

      +

      Assign the unique decimal Point Code to VSS_0.

      +

      48

      +

      CIC

      +

      Circuit ID Code. Support up to 8 BICC trunks.

      +

      32 x n + 1 (n = 0~7)

      +

      0, 33

      +

      Circuit Selection

      +

      Circuit selection mode of the traffic channel connections.

      +

      Clockwise

      +

      Circuit Delay

      +

      Define the interval between sending ACM and ANM messages.

      +

      1 second

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MTP3.

       

      +

      2.Make sure the System ID at the upper right corner displays MTP3(MSS_Pub), click the 2_035 button.

       

      +

      2_54_02

      +

       

      +

      1.Click the Link Set tab, and then click New at the bottom of the Linkset table.

       

      +

      2.In the Linkset ID box, select an available number for the new linkset, and then click the 2_002 button.

       

      +

      3.In the Linkset Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created linkset.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description  (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify network type of the MSS.

      +

      National

      +

      DPC

      +

      Enter the Originating Point Code of VSS-0.

      +

      48

      +

      Loopback Option

      +

      Enable or disable loopback function on this linkset.

      +

      Enabled only for the MSC loopback linksets.

      +

      Disable

      +

      OPC Multiple

      +

      Not in use.

      +

      0

      +
      +
      +

       

      +

      2_54_03

      +

       

      +

      1.Click the SG tab, and then click New at the bottom of the Signaling Gateway table.

       

      +

      2.In the SG ID box, select an available number for the new SG, and then click the 2_002 button.

       

      +

      3.In the Signaling Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created signaling gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Application Mode

      +

      Select the application mode of the signaling gateway.

      +

      Server

      +

      Signaling Type

      +

      Specify the type of the signaling gateway:

      +

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      ACK Option

      +

      The ACK message must be sent if there is request from the peer. Otherwise, the ACK message should not be sent.

      +

      Forbid

      +

      Remote IP

      +

      IP address of the VSS-0.

      +

      IP of VSS-0

      +
      +
      +

       

      +

      2_54_04

      +

       

      +

      1.Click the Link tab, and then click New at the bottom of the Link table.

       

      +

      2.In the Link ID box, select an available number for the new link, and then click the 2_002 button.

       

      +

      3.In the Link Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created link.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      0

      +

      Host IP

      +

      Management server's IP of this link.

      +

      MSC0 = 172.18.98.1

      +

      MSC1 = 172.18.99.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      0

      +
      +
      +

       

      +

      6.Repeat Step 2 to 5 to add link 1.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      1

      +

      Host IP

      +

      Management server's IP of this link.

      +

      MSC1 = 172.18.99.1

      +

      MSC0 = 172.18.98.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      1

      +
      +
      +

       

      +

      2_54_05

      +

       

      +

      1.Click the Nat Network tab.

       

      +

      2.In the upper table, configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Nat OPC

      +

      Originating Point Code of MSS.

      +

      1

      +

      Nat PC Length

      +

      Length of Point Code.

      +

      14-bit

      +

      Nat PC Type

      +

      Type of Point Code.

      +

      ITU

      +
      +
      +

       

      +

      4.Click New at the bottom of the Nat Routing table.

       

      +

      5.In the Nat Routing ID box, select an available number for the new routing, and then click the 2_002 button.

       

      +

      6.In the Routing Option window, configure the relevant parameters given in the following table.

       

      +

      7.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the connected VSS-0.

      +

      48

      +

      Normal Linkset

      +

      Enter the Linkset index number configured previously.

      +

      Linkset ID

      +

      Alternative Linkset

      +

      Assign an Alternative Linkset to the VSS. It will be activated when the Normal Linkset is unavailable.

      +

      Set 128 to disable alternative linkset.

      +

      128

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MTP3.

       

      +

      2.Make sure the System ID at the upper right corner displays MTP3(VSS_0), click the 2_035 button.

       

      +

      2_54_06

      +

       

      +

      1.Click the Link Set tab, and then click New at the bottom of the Linkset table.

       

      +

      2.In the Linkset ID box, select an available number for the new linkset, and then click the 2_002 button.

       

      +

      3.In the Linkset Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created linkset.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description  (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify network type of the VSS-0.

      +

      National

      +

      DPC

      +

      Enter the Originating Point Code of MSS.

      +

      1

      +

      Loopback Option

      +

      Enable or disable loopback function on this linkset.

      +

      Enabled only for the MSC loopback linksets.

      +

      Disable

      +

      OPC Multiple

      +

      Not in use.

      +

      0

      +
      +
      +

       

      +

      2_54_07

      +

       

      +

      1.Click the SG tab, and then click New at the bottom of the Signaling Gateway table.

       

      +

      2.In the SG ID box, select an available number for the new SG, and then click the 2_002 button.

       

      +

      3.In the Signaling Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created signaling gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Application Mode

      +

      Select the application mode of the signaling gateway.

      +

      Client

      +

      Signaling Type

      +

      Specify the type of the signaling gateway:

      +

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      ACK Option

      +

      The ACK message must be sent if there is request from the peer. Otherwise, the ACK message should not be sent.

      +

      Forbid

      +

      Remote IP

      +

      IP address of the MSS-0.

      +

      IP of MSS-0

      +
      +
      +

       

      +

      2_54_08

      +

       

      +

      1.Click the Link tab, and then click New at the bottom of the Link table.

       

      +

      2.In the Link ID box, select an available number for the new link, and then click the 2_002 button.

       

      +

      3.In the Link Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created link.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      0

      +

      Host IP

      +

      Management server's IP of this link.

      +

      VSS-0 IP

      +

      Alternative Host IP

      +

      Not in use.

      +

      255.255.255.255

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      0

      +
      +
      +

       

      +

      6.Repeat Step 2 to 5 to add link 1.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link:

      +

      •ECP = For circuit switch connection only.

      •M2UA = Signaling transport over MTP2 User Adaptation Layer.

      •M3UA = Signaling transport over MTP3 User Adaptation Layer.

      •IUA = Signaling transport over ISDN User Adaptation Layer.

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      1

      +

      Host IP

      +

      Management server's IP of this link.

      +

      VSS-0 IP

      +

      Alternative Host IP

      +

      Not in use.

      +

      255.255.255.255

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      1

      +
      +
      +

       

      +

      2_54_09

      +

       

      +

      1.Click the Nat Network tab.

       

      +

      2.In the upper table, configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Nat OPC

      +

      Originating Point Code of VSS-0.

      +

      48

      +

      Nat PC Length

      +

      Length of Point Code.

      +

      14-bit

      +

      Nat PC Type

      +

      Type of Point Code.

      +

      ITU

      +
      +
      +

       

      +

      4.Click New at the bottom of the Nat Routing table.

       

      +

      5.In the Nat Routing ID box, select an available number for the new routing, and then click the 2_002 button.

       

      +

      6.In the Routing Option window, configure the relevant parameters given in the following table.

       

      +

      7.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the connected MSS.

      +

      1

      +

      Normal Linkset

      +

      Enter the Linkset index number configured previously.

      +

      Linkset ID

      +

      Alternative Linkset

      +

      Assign an Alternative Linkset to the MSS. It will be activated when the Normal Linkset is unavailable.

      +

      Set 128 to disable alternative linkset.

      +

      128

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MSC.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_54_10

      +

       

      +

      1.Click the Dialing Prefix Set tab.

       

      +

      2.Pick up the serving Dialing Prefix Set, and then click the hyperlinked number in the Dialing Prefix Entries to open the Prefix table.

       

      +

      3.Click New at the bottom of the Prefix table to add prefix for VSS.

       

      +

      4.In the Prefix ID box, click the 2_002 button.

       

      +

      5.In the Prefix Option window, configure the relevant parameters given in the following table.

       

      +

      6.Click the 2_041 button to update Prefix parameters to application servers.

       

      +

      7.Click the 2_036 button to activate the new created prefix.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Prefix

      +

      A combination digits that dial to originate a call.

      +

      99

      +

      TON Incoming Call

      +

      The original type of the incoming number. It is specified by originating node for terminating node to route this call with proper dialed number manipulation.

      +

      Unknown

      +

      Flag

      +

      Enable or disable this prefix.

      +

      Enable

      +

      Length of Dialed Number

      +

      The length of the dialed number.

      +

      4

      +

      Service Type

      +

      Service type of the outgoing call.

      +

      Intelligent Call

      +

      Number Type

      +

      How the numbers are sent out.

      +

      PSTN

      +

      RSC

      +

      Routing Selection Code is a "route selection" index to select a trunk group in a routing zone pointing to the destination.

      +

      --

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this prefix.

      +

      Disable

      +

      MNP Flag

      +

      Enable if this prefix relating to Mobile Number Portability service.

      +

      Disable

      +

      Premium Call Flag

      +

      Enable if this prefix relating to Premium Call service.

      +

      Disable

      +

      Call Allow Flag

      +

      Subscribers with OSB type 1 can only make calls to this dialing prefix with Call Allow Flag enabled.

      +

      Disable

      +

      Call Bar Flag

      +

      Subscribers with OSB type 2 can't make calls to this dialing prefix with Call Bar Flag enabled.

      +

      Disable

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      Out Trunk Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Out Trunk Inserted Digits

      +

      Digits of the number to be added to the front of the dialed number.

      +

      N/A

      +

      E.164 International Deletion Count

      +

      Number of digits to be deleted from the beginning of the  incoming number.

      +

      0

      +

      E.164 International Inserted Digits

      +

      Digits of the number to be added to the front of the incoming number to convert it to an international E.164 format (CC and NDC included).

      +

      N/A

      +
      +
      +

       

      +

      2_54_11

      +

       

      +

      1.Click the Routing Zone Set tab.

       

      +

      2.Pick up the serving Routing Zone Set, and then click the hyperlinked number in the Routing Selection Entries to open the Routing Selection table.

       

      +

      3.Click New at the bottom of the Routing Selection table to add a Routing Selection for VSS-0.

       

      +

      4.In the RS ID box, select an available number for the new Routing Selection, click the 2_002 button.

       

      +

      5.In the Routing Selection Option window, configure the relevant parameters given in the following table.

       

      +

      6.Click the 2_041 button to update Routing Selection parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Trunk Group

      +

      Specify the Trunk Group to VSS-0.

      +

      --

      +

      Alternative TG Flag

      +

      Enable or disable alternative Trunk Group when the primary Trunk

      +

      Group is unavailable.

      +

      Disable

      +

      Alternative TG

      +

      Specify the alternative Trunk Group. It's available only when the previous Alternative TG Flag is enabled.

      +

      N/A

      +

      TON Outgoing Call

      +

      The transformed type of the incoming number, which will be routed to the associated trunk group.

      +

      Unknown

      +

      Deletion Count

      +

      Number of digits to be deleted from the beginning of the dialed number.

      +

      0

      +

      Inserted Digits

      +

      The digits to be inserted to the front of the dialed number.

      +

      N/A

      +
      +
      +

       

      +

      2_54_12

      +

       

      +

      1.Click the Trunk Group tab, and then click New at the bottom of the Trunk Group table.

       

      +

      2.In the TG ID box, select an available number for the new Trunk Group, and then click the 2_002 button.

       

      +

      3.In the Trunk Group Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Trunk Group parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created Trunk Group.

       

      +

      6.Click the hyperlinked number in the Trunk Entries to open the Trunk table.

       

      +

      7.Click New at the bottom of the Trunk table to add the first VSS-0 trunk.

       

      +

      8.In the Trunk ID box, click the 2_002 button.

       

      +

      9.In the Trunk Option window, configure the relevant parameters given in the following table.

       

      +

      10.Click the 2_041 button to update Trunk parameters to application servers.

       

      +

      11.Click the 2_036 button to activate the new created Trunk.

       

      +

      12.Repeat Step 7 to 11 to add the second VSS-0 trunk.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Trunk Group

      +

      Administration State

      +

      Control the operation of the managed Trunk Group.

      +

      Unlocked

      +

      DPC

      +

      The Point Code of VSS-0.

      +

      48

      +

      Network Indicator

      +

      Specify the trunk group to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      Protocol Type

      +

      Select the protocol type for this Trunk Group.

      +

      BICC

      +

      Protocol Variant

      +

      Select the protocol variant for this Trunk Group.

      +

      ITU

      +

      Circuit Selection Mode

      +

      Circuit selection mode of the traffic channel connections.

      +

      Anti-clockwise

      +

      Back Off Flag

      +

      Enable or disable Back Off when simultaneously select the same channel with the opposite side.

      +

      Disable

      +

      Tandem Restriction

      +

      Enable or disable Tandem to allow or prohibit transit calls from PSTN to PSTN via this trunk group.

      +

      Disable

      +

      CDR Flag

      +

      Enable or disable the Call Detail Record generation of this trunk group

      +

      Disable

      +

      TG Type

      +

      Application type of this Trunk Group.

      +

      Normal

      +

      Routing Zone ID

      +

      Specify the Trunk Group to a Routing Zone Set.

      +

      255 = Apply to all Routing Zone

      +

      255

      +

      Alternative Routing Trigger

      +

      Specify the ID of the alternative Routing for backup purpose.

      +

      N/A

      +

      > Trunk

      +

      Administration State

      +

      Control the operation of the managed Trunk.

      +

      Unlocked

      +

      MG ID

      +

      Specify the Trunk to a Media Gateway. Not applicable to virtual MG.

      +

      --

      +

      Port ID

      +

      Specify the Trunk to a physical port of the selected Media Gateway. Not applicable to virtual MG.

      +

      --

      +

      Port Type

      +

      Specify the type of MG physical ports.

      +

      E1

      +

      Group ID

      +

      Select the application group for the Trunk.

      +

      Group 0

      +

      Group 1

      +

      CIC Assignment Plan

      +

      Select a mode for the Circuit Identity Code assignment of this Trunk.

      +

      Disable

      +

      CIC Assignment

      +

      Specify the start CIC to the Trunk for typical mode.

      +

      0

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VSS.

       

      +

      2.Make sure the System ID at the upper right corner displays VSS_0, click the 2_035 button.

       

      +

      2_54_13

      +

       

      +

      1.Refer to the VSS parameters dictionary to configure the relevant parameters.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Manage VMS Subscriber

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.36

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_54_01.gif b/wxc2_omc/omcHelp/2_54_01.gif new file mode 100755 index 0000000..0ff0f9c Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_01.gif differ diff --git a/wxc2_omc/omcHelp/2_54_02.gif b/wxc2_omc/omcHelp/2_54_02.gif new file mode 100755 index 0000000..a319ac0 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_02.gif differ diff --git a/wxc2_omc/omcHelp/2_54_03.gif b/wxc2_omc/omcHelp/2_54_03.gif new file mode 100755 index 0000000..61e2950 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_03.gif differ diff --git a/wxc2_omc/omcHelp/2_54_04.gif b/wxc2_omc/omcHelp/2_54_04.gif new file mode 100755 index 0000000..35d73f9 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_04.gif differ diff --git a/wxc2_omc/omcHelp/2_54_05.gif b/wxc2_omc/omcHelp/2_54_05.gif new file mode 100755 index 0000000..04fec1a Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_05.gif differ diff --git a/wxc2_omc/omcHelp/2_54_06.gif b/wxc2_omc/omcHelp/2_54_06.gif new file mode 100755 index 0000000..64cfaa4 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_06.gif differ diff --git a/wxc2_omc/omcHelp/2_54_07.gif b/wxc2_omc/omcHelp/2_54_07.gif new file mode 100755 index 0000000..731e5cb Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_07.gif differ diff --git a/wxc2_omc/omcHelp/2_54_08.gif b/wxc2_omc/omcHelp/2_54_08.gif new file mode 100755 index 0000000..1a90b17 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_08.gif differ diff --git a/wxc2_omc/omcHelp/2_54_09.gif b/wxc2_omc/omcHelp/2_54_09.gif new file mode 100755 index 0000000..81c20fc Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_09.gif differ diff --git a/wxc2_omc/omcHelp/2_54_10.gif b/wxc2_omc/omcHelp/2_54_10.gif new file mode 100755 index 0000000..3e35bc7 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_10.gif differ diff --git a/wxc2_omc/omcHelp/2_54_11.gif b/wxc2_omc/omcHelp/2_54_11.gif new file mode 100755 index 0000000..1927292 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_11.gif differ diff --git a/wxc2_omc/omcHelp/2_54_12.gif b/wxc2_omc/omcHelp/2_54_12.gif new file mode 100755 index 0000000..6ffe3c4 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_12.gif differ diff --git a/wxc2_omc/omcHelp/2_54_13.gif b/wxc2_omc/omcHelp/2_54_13.gif new file mode 100755 index 0000000..199d208 Binary files /dev/null and b/wxc2_omc/omcHelp/2_54_13.gif differ diff --git a/wxc2_omc/omcHelp/2_55_10.gif b/wxc2_omc/omcHelp/2_55_10.gif new file mode 100755 index 0000000..0322639 Binary files /dev/null and b/wxc2_omc/omcHelp/2_55_10.gif differ diff --git a/wxc2_omc/omcHelp/2_55_11.gif b/wxc2_omc/omcHelp/2_55_11.gif new file mode 100755 index 0000000..ae50295 Binary files /dev/null and b/wxc2_omc/omcHelp/2_55_11.gif differ diff --git a/wxc2_omc/omcHelp/2_55_13.gif b/wxc2_omc/omcHelp/2_55_13.gif new file mode 100755 index 0000000..a5e5238 Binary files /dev/null and b/wxc2_omc/omcHelp/2_55_13.gif differ diff --git a/wxc2_omc/omcHelp/2_55_14.gif b/wxc2_omc/omcHelp/2_55_14.gif new file mode 100755 index 0000000..5fa5c20 Binary files /dev/null and b/wxc2_omc/omcHelp/2_55_14.gif differ diff --git a/wxc2_omc/omcHelp/2_55_15.gif b/wxc2_omc/omcHelp/2_55_15.gif new file mode 100755 index 0000000..8fe078e Binary files /dev/null and b/wxc2_omc/omcHelp/2_55_15.gif differ diff --git a/wxc2_omc/omcHelp/2_55_16.gif b/wxc2_omc/omcHelp/2_55_16.gif new file mode 100755 index 0000000..581f0ff Binary files /dev/null and b/wxc2_omc/omcHelp/2_55_16.gif differ diff --git a/wxc2_omc/omcHelp/2_55_17.gif b/wxc2_omc/omcHelp/2_55_17.gif new file mode 100755 index 0000000..3b13f61 Binary files /dev/null and b/wxc2_omc/omcHelp/2_55_17.gif differ diff --git a/wxc2_omc/omcHelp/2_55_18.gif b/wxc2_omc/omcHelp/2_55_18.gif new file mode 100755 index 0000000..355f673 Binary files /dev/null and b/wxc2_omc/omcHelp/2_55_18.gif differ diff --git a/wxc2_omc/omcHelp/2_56.htm b/wxc2_omc/omcHelp/2_56.htm new file mode 100755 index 0000000..e62feb5 --- /dev/null +++ b/wxc2_omc/omcHelp/2_56.htm @@ -0,0 +1,1338 @@ +锘� + + + Configuring SMEG + + + + + + + + + + + + + + + + + + + + +
      +

      Configuring SMEG

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      UltraWAVE Short Message-Email Gateway (SMEG) lies in between the SMSC and the email server. It acts as a short message/email transit center, which provides message format conversions between SMS and SMTP. The SMEG receives and sends messages from/to SMS via the SMPP connection and email messages from/to the host email server via the integrated SMTP server.

      +

       

      +

      The SMEG configuration structure is displayed as the figure quoted below.

      +

      6_002

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMEG.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_56_01

      +

       

      +

      1.Refer to the SMEG parameters dictionary to configure the relevant parameters.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >XAPP.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_56_02

      +

       

      +

      1.Click the Prefix Manipulation tab, and then click New at the bottom of the Prefix Manipulation table.

       

      +

      2.In the Prefix ID box, select an available number for the new Prefix, and then click the 2_002 button.

       

      +

      3.In the Prefix Manipulation Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Prefix Manipulation parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Prefix

      +

      SMPP service number preset in the SMEG parameter (SMPP Link Alias).

      +

      96666

      +

      Deletion Count

      +

      The amount of digits to be deleted from the beginning of the service number.

      +

      0

      +

      Insertion Count

      +

      The amount of digits to be inserted to the front of the service number.

      +

      0

      +

      Inserted Digits

      +

      The digits to be added to the front of the service number.

      +

      N/A

      +

      Number Length

      +

      The length of the incoming service number.

      +

      •0 = Length is uncertain

      0

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMPP.

       

      +

      2.Make sure the System ID at the upper right corner displays SMPP(MSS_Pub), click the 2_035 button.

       

      +

      2_56_03

      +

       

      +

      1.Click the SMPP Link tab, and then click New at the bottom of the SMPP Link table.

       

      +

      2.In the SMPP Link ID box, select an available number for link, and then click the 2_002 button.

       

      +

      3.In the SMPP Link Option window, configure the relevant parameters given in the following table to add Link#3.

       

      +

      4.Click the 2_041 button to update Prefix Manipulation parameters to application servers.

       

      +

      5.Repeat Step 2 to 4 to add Link#4, Link#7 and Link#8.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

       

      +

      SMPP(EMS_0)

      +

      SMPP(MSS_Pub)

      +

      SMPP(EMS_1)

      +

      SMPP(MSS_Pub)

      +

      Sub-parameter

      +

      Link#1

      +

      Link#2

      +

      Link#3

      +

      Link#4

      +

      Link#5

      +

      Link#6

      +

      Link#7

      +

      Link#8

      +

      Link Flag

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Assigned Flag

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Link Type

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      Server Type

      +

      Client

      +

      Client

      +

      Server

      +

      Server

      +

      Client

      +

      Client

      +

      Server

      +

      Server

      +

      Session Type

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      System ID

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      Password

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      System Type

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      Local GTT

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      Remote GTT

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      Local IP

      +

      SMEG0 IP

      +

      SMEG0 IP

      +

      SMSC0 IP

      +

      SMSC0 IP

      +

      SMEG1 IP

      +

      SMEG1 IP

      +

      SMSC1 IP

      +

      SMSC1 IP

      +

      Remote IP

      +

      SMSC0 IP

      +

      SMSC0 IP

      +

      SMEG0 IP

      +

      SMEG0 IP

      +

      SMSC1 IP

      +

      SMSC1 IP

      +

      SMEG1 IP

      +

      SMEG1 IP

      +

      Session Init Timer

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      Enquiry Link Timer

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      Inactivity Timer

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      Response Timer

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      Service Number

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMPP.

       

      +

      2.Make sure the System ID at the upper right corner displays SMPP(EMS_0), click the 2_035 button.

       

      +

      2_56_04

      +

       

      +

      1.Click the SMPP Link tab, and then click New at the bottom of the SMPP Link table.

       

      +

      2.In the SMPP Link ID box, select an available number for link, and then click the 2_002 button.

       

      +

      3.In the SMPP Link Option window, configure the relevant parameters given in the following table to add Link#1.

       

      +

      4.Click the 2_041 button to update Prefix Manipulation parameters to application servers.

       

      +

      5.Repeat Step 2 to 4 to add Link#2.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

       

      +

      SMPP(EMS_0)

      +

      SMPP(MSS_Pub)

      +

      SMPP(EMS_1)

      +

      SMPP(MSS_Pub)

      +

      Sub-parameter

      +

      Link#1

      +

      Link#2

      +

      Link#3

      +

      Link#4

      +

      Link#5

      +

      Link#6

      +

      Link#7

      +

      Link#8

      +

      Link Flag

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Assigned Flag

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Link Type

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      Server Type

      +

      Client

      +

      Client

      +

      Server

      +

      Server

      +

      Client

      +

      Client

      +

      Server

      +

      Server

      +

      Session Type

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      System ID

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      Password

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      System Type

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      Local GTT

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      Remote GTT

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      Local IP

      +

      SMEG0 IP

      +

      SMEG0 IP

      +

      SMSC0 IP

      +

      SMSC0 IP

      +

      SMEG1 IP

      +

      SMEG1 IP

      +

      SMSC1 IP

      +

      SMSC1 IP

      +

      Remote IP

      +

      SMSC0 IP

      +

      SMSC0 IP

      +

      SMEG0 IP

      +

      SMEG0 IP

      +

      SMSC1 IP

      +

      SMSC1 IP

      +

      SMEG1 IP

      +

      SMEG1 IP

      +

      Session Init Timer

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      Enquiry Link Timer

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      Inactivity Timer

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      Response Timer

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      Service Number

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SMPP.

       

      +

      2.Make sure the System ID at the upper right corner displays SMPP(EMS_1), click the 2_035 button.

       

      +

      2_56_05

      +

       

      +

      1.Click the SMPP Link tab, and then click New at the bottom of the SMPP Link table.

       

      +

      2.In the SMPP Link ID box, select an available number for link, and then click the 2_002 button.

       

      +

      3.In the SMPP Link Option window, configure the relevant parameters given in the following table to add Link#5.

       

      +

      4.Click the 2_041 button to update Prefix Manipulation parameters to application servers.

       

      +

      5.Repeat Step 2 to 4 to add Link#6.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

       

      +

      SMPP(EMS_0)

      +

      SMPP(MSS_Pub)

      +

      SMPP(EMS_1)

      +

      SMPP(MSS_Pub)

      +

      Sub-parameter

      +

      Link#1

      +

      Link#2

      +

      Link#3

      +

      Link#4

      +

      Link#5

      +

      Link#6

      +

      Link#7

      +

      Link#8

      +

      Link Flag

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Enable

      +

      Assigned Flag

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Assigned

      +

      Link Type

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      TCP

      +

      Server Type

      +

      Client

      +

      Client

      +

      Server

      +

      Server

      +

      Client

      +

      Client

      +

      Server

      +

      Server

      +

      Session Type

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      BIND_Tx

      +

      BIND_Rx

      +

      System ID

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      SMEG

      +

      Password

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      123456

      +

      System Type

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      GSM

      +

      Local GTT

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      Remote GTT

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      --

      +

      Local IP

      +

      SMEG0 IP

      +

      SMEG0 IP

      +

      SMSC0 IP

      +

      SMSC0 IP

      +

      SMEG1 IP

      +

      SMEG1 IP

      +

      SMSC1 IP

      +

      SMSC1 IP

      +

      Remote IP

      +

      SMSC0 IP

      +

      SMSC0 IP

      +

      SMEG0 IP

      +

      SMEG0 IP

      +

      SMSC1 IP

      +

      SMSC1 IP

      +

      SMEG1 IP

      +

      SMEG1 IP

      +

      Session Init Timer

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      Enquiry Link Timer

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      Inactivity Timer

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      5

      +

      Response Timer

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      10

      +

      Service Number

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +

      96666

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.56

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_56_01.gif b/wxc2_omc/omcHelp/2_56_01.gif new file mode 100755 index 0000000..52a5be2 Binary files /dev/null and b/wxc2_omc/omcHelp/2_56_01.gif differ diff --git a/wxc2_omc/omcHelp/2_56_02.gif b/wxc2_omc/omcHelp/2_56_02.gif new file mode 100755 index 0000000..5a32489 Binary files /dev/null and b/wxc2_omc/omcHelp/2_56_02.gif differ diff --git a/wxc2_omc/omcHelp/2_56_03.gif b/wxc2_omc/omcHelp/2_56_03.gif new file mode 100755 index 0000000..e05af0b Binary files /dev/null and b/wxc2_omc/omcHelp/2_56_03.gif differ diff --git a/wxc2_omc/omcHelp/2_56_04.gif b/wxc2_omc/omcHelp/2_56_04.gif new file mode 100755 index 0000000..fe6add2 Binary files /dev/null and b/wxc2_omc/omcHelp/2_56_04.gif differ diff --git a/wxc2_omc/omcHelp/2_56_05.gif b/wxc2_omc/omcHelp/2_56_05.gif new file mode 100755 index 0000000..73468e8 Binary files /dev/null and b/wxc2_omc/omcHelp/2_56_05.gif differ diff --git a/wxc2_omc/omcHelp/2_57.htm b/wxc2_omc/omcHelp/2_57.htm new file mode 100755 index 0000000..16e8f18 --- /dev/null +++ b/wxc2_omc/omcHelp/2_57.htm @@ -0,0 +1,65 @@ +锘� + + + Enabling Number Portability + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling Number Portability

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Number portability is a feature that allows operators to attract new customers from other mobile networks with as much transparency to the subscriber as possible.

      +

       

      +

      Number portability allows mobile subscribers to switch from one operator to another or relocate to another home location register of the same operator without changing their mobile subscriber ISDN number. Within the same local area, it allows subscribers to relocate to another provider (operator portability) or to another combined switching center of the same network provider (location portability) without changing their directory number.

      +

       

      +

       

      +

      See Also

      +

       

      +

      •Manage MNP Subscriber

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.57

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_58.htm b/wxc2_omc/omcHelp/2_58.htm new file mode 100755 index 0000000..af0ab95 --- /dev/null +++ b/wxc2_omc/omcHelp/2_58.htm @@ -0,0 +1,64 @@ +锘� + + + Synchronizing MSS Configurations + + + + + + + + + + + + + + + + + + + + +
      +

      Synchronizing MSS Configurations

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Although the EMS can maintain the two MSSs' parameters simultaneously, the synchronizing operation needs to be performed when one of the MSS servers accidentally losing connection in the management process. You have to manually perform immediate synchronization if such a situation occurs. To copy the configuration data files from one MSS server to the other is both tedious and error prone. For this reason, an One-click MSS Sync feature has been introduced to EMS that make it easy to keep MSS configuration data synchronized.

      +

       

      +

      Please note, this operation will overwrite the MSS configuration data files on the target server.

      +

       

      +

       

      +

      2_58_01

      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.58

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_58_01.gif b/wxc2_omc/omcHelp/2_58_01.gif new file mode 100755 index 0000000..16464d6 Binary files /dev/null and b/wxc2_omc/omcHelp/2_58_01.gif differ diff --git a/wxc2_omc/omcHelp/2_60.htm b/wxc2_omc/omcHelp/2_60.htm new file mode 100755 index 0000000..5bc8b41 --- /dev/null +++ b/wxc2_omc/omcHelp/2_60.htm @@ -0,0 +1,161 @@ +锘� + + + Access Administration + + + + + + + + + + + + + + + + + + + + +
      +

      Access Administration

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      This chapter describes how to control who can log into the UltraWAVE EMS GUI and what they can do.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_60_01

      +

       

      +

      1.Go to EMS >Advanced >Administration.

       

      +

      2.Click on Add at the upper-left corner, this displays the new account Option window.

       

      +

      3.Click the 2_007 button, click OK to return.

       

      +

      4.Verify the new created operator is displayed on the current account list.

       

      +

      5.Login EMS GUI using the new created account name and password, verify the visible menu and navigation tree is correct.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Details

      +

      Explanation

      +

      Real Name

      +

      Name of operator

      +

      Account Name

      +

      The account name of the operator.

      +

      Login Password

      +

      The password for logging into the EMS GUI.

      +

      Confirm Password

      +

      Repeat the login password for confirmation.

      +

      Access Restriction

      +

      Select the user's privilege level. The privileges include:

      +

      •Operation - allows access to the Map and the list of subscribers in the HLR.

      •Configuration - allows access to Status, Configuration, Performance, Log and Maintenance screens, access to the Advanced screens is denied with this restriction.

      •Management - allows access to all screens.

      Time of last account update

      +

      The last time this operators account was changed.

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_60_01

      +

       

      +

      1.Go to EMS >Advanced >Administration.

       

      +

      2.Click Delete next to the operator want to delete.

       

      +

      3.Click Yes to confirm.

       

      +

      4.Verify the operator doesn't appear in the current operator list.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_60_01

      +

       

      +

      1.Go to EMS >Advanced >Administration.

       

      +

      2.Click Edit next to the operator want to modify.

       

      +

      3.Enter a new password in the New Password box.

       

      +

      4.Repeat the new password in the Repeat Input box.

       

      +

      5.Click the 2_012 button, click OK to close the pop-up window.

       

      +

      6.Verify the password is changed successfully by logging into EMS GUI using the new password.

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.60

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_60_01.gif b/wxc2_omc/omcHelp/2_60_01.gif new file mode 100755 index 0000000..df5db23 Binary files /dev/null and b/wxc2_omc/omcHelp/2_60_01.gif differ diff --git a/wxc2_omc/omcHelp/2_61.htm b/wxc2_omc/omcHelp/2_61.htm new file mode 100755 index 0000000..795fd75 --- /dev/null +++ b/wxc2_omc/omcHelp/2_61.htm @@ -0,0 +1,206 @@ +锘� + + + MSS License Control + + + + + + + + + + + + + + + + + + + + +
      +

      MSS License Control

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MSS License Control provides a software means of service provisioning and capacity control on the application software products. It allows Altobridge to deliver the product with different provisioned services and capacity according to the order from the operator.

      +

       

      +

      UltraWAVE system and its component servers are subject to license control. A license file named system.ini is involved in license control. The system.ini file is a binary config file that determines which service to provision and how many subscribers or trunk ports the system supports. The system.ini file is stored in the physical application servers, e.g. MSS, EMS and each of VMS servers. The dual MSS servers of a system use the same system.ini file. Generally each UltraWAVE system needs one license file for MSS servers, one license file for EMS servers, and multiple license files for VMS servers.

      +

       

      +

      The information in MSS system.ini includes:

      +

      •Applications to provision: MSC, VLR, HLR, PPS, AUC, EIR, SMSC, MNP, OPPS and iPALIM

      •Subscriber capacity of provisioned applications (Maximum=100K, Unit=100)

      •Features to provision: AIF, ISUP, ISDN, CAP, BICC, SIP, USSD, GPRS, MGC, iRLS, OPR and IMDX

      •Port capacity of MSC (Maximum=256, Unit=8)

      •Copyright protection based on physical information of CPU, LAN adapter and RAM

       

      +

      It is Altobridge that implements the system.ini file before deliver the system to customer. Operators should provide their system services and capacity request to Altobridge for system.ini implementation.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Services

      +

      Mandatory Licenses

      +

      Optional Licenses

      +

      Basic calls and supplementary services

      +

      MSC, VLR, HLR, AIF

      +

      BICC, MGC

      +

      Short message service

      +

      SMSC

      +

       

      +

      Authentication and IMEI checking

      +

      AUC, EIR

      +

       

      +

      Connect to other networks (PLMN or PSTN)

      +

      ISUP

      +

      ISDN

      +

      Prepaid services

      +

      PPS, CAP, SMSC

      +

      USSD

      +

      USSD service

      +

      USSD

      +

       

      +

      Mobile number portability service

      +

      MNP

      +

       

      +

      GPRS service

      +

      GPRS

      +

       

      +

      Open-to-all prepaid roaming service

      +

      OPPS, OPR, PPS, SMSC

      +

      USSD

      +

      Intelligent MAP-D multiplexer service

      +

      OPPS, IMDX

      +

      PPS

      +

      Intelligent RTP local switching service

      +

      iRLS, SIP, MGC

      +

       

      +

      iPALIM service

      +

      iPALIM, iRLS

      +

      PPS, OPPS, OPR, SMSC, USSD

      +

      Voice mail service

      +

      Separate system.ini files for each VMS servers. SMSC

      +

      PPS is mandatory for multiple VMS deployment.

      +
      +
      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_61_01

      +

       

      +

      1.Go to EMS >Configuration >MSS License Control.

       

      +

      2.Click the 2_032 button to select the system.ini file on local PC.

       

      +

      3.Click 2_024 to import system.ini to MSS servers.

       

      +

      2_61_02

      +

       

      +

      1.Go to EMS >Status >NSS >Application.

       

      +

      2.Click the hyperlinked indicator in the Application Status field to display the status window.

       

      +

      3.Check the License displayed in application status window, ensure the licenses have been updated successfully.

       

      +

       

      +
      +
      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.61

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_61_01.gif b/wxc2_omc/omcHelp/2_61_01.gif new file mode 100755 index 0000000..f43acc7 Binary files /dev/null and b/wxc2_omc/omcHelp/2_61_01.gif differ diff --git a/wxc2_omc/omcHelp/2_61_02.gif b/wxc2_omc/omcHelp/2_61_02.gif new file mode 100755 index 0000000..6973654 Binary files /dev/null and b/wxc2_omc/omcHelp/2_61_02.gif differ diff --git a/wxc2_omc/omcHelp/2_62.htm b/wxc2_omc/omcHelp/2_62.htm new file mode 100755 index 0000000..e1f7a7e --- /dev/null +++ b/wxc2_omc/omcHelp/2_62.htm @@ -0,0 +1,668 @@ +锘� + + + Enabling IMDX + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling IMDX

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The IMDX System enables the R9 System to provide 鈥減rivate鈥� communication services. The IMDX provides private, hybrid and public user services to the GSM subscribers. Operator may restrict private users to make/receive calls to/from private users only and public users to make/receive calls to/from public users only. while Hybrid users can make/receive calls from both private and public users. IMDX allows the operator to use the existing R9 System to provide GSM services to employee users as a private communication tool for their daily works.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button .

       

      +

      2_30_07

      +

       

      +

      1.Click the Local Node tab.

       

      +

      2.Click the hyperlinked index number of OPPS to open the OPPS Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      MSISDN

      +

      The E.164 node address of OPPS.

      +

      CC+NDC+SN format

      +

      IP 0

      +

      IP address of OPPS server 0.

      +

      172.18.98.1

      +

      IP 1

      +

      IP address of OPPS server 1.

      +

      172.18.99.1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_52_02

      +

       

      +

      1.Click the GTT tab, and then click New at the bottom of the Globe Title Translate table.

       

      +

      2.In the GTT ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the GTT Option window, configure the following parameters to add GTT for remote HLR.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Repeat step 1 to 4 to add remote MSC and VLR.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Flag

      +

      Enable or disable this GTT item.

      +

      Enable

      +

      Number Plan

      +

      Describe which numbering plan will be used for the global title. The numbering plan chosen will aid the routing system in determining the correct network system to direct the message.

      +

      GT

      +

      Translation Type

      +

      Translation examines the destination address and deciding how to identify it over the telephone network.

      +

      0

      +

      Start GT Number

      +

      E.164 node number of remote MSC/VLR/HLR.

      +

      E.164 Number

      +

      End GT Number

      +

      E.164 node number of remote MSC/VLR/HLR.

      +

      E.164 Number

      +

      Network Indicator

      +

      Nature of Address Indicator. It indicates the scope of the address value. Choose the same network as MTP3 setting.

      +

      National

      +

      DPC

      +

      Point Code of remote network.

      +

      --

      +

      SSN

      +

      Subsystem Number of MSC/VLR/HLR.

      +

      6(HLR)

      +

      7(VLR)

      +

      8(MSC)

      +

      Route Indicator

      +

      For the connected network, select Route on GT.

      +

      Route on GT

      +

      Address Indicator

      +

      Contribution of SCCP Address.

      +

      GT+DPC+SSN

      +

      Replace Start Digit

      +

      The start digit of the GT number to be replaced.

      +

      0

      +

      Replace End Digit

      +

      The end digit of the GT number to be replaced.

      +

      0

      +

      Replacing Number Plan

      +

      The type of the number to be output.

      +

      N/A

      +

      Replacing Digits

      +

      Replace the selected GT number range with these digits.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_52_02

      +

       

      +

      1.On the GTT tab, click New at the bottom of the Globe Title Translate table.

       

      +

      2.In the GTT ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the GTT Option window, configure the following parameters to add GTT for inbound subscribers.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Flag

      +

      Enable or disable this GTT item.

      +

      Enable

      +

      Number Plan

      +

      Describe which numbering plan will be used for the global title. The numbering plan chosen will aid the routing system in determining the correct network system to direct the message.

      +

      GT

      +

      Translation Type

      +

      Translation examines the destination address and deciding how to identify it over the telephone network.

      +

      0

      +

      Start GT Number

      +

      Specify the beginning IMSI of roaming subscribers.

      +

      Start IMSI

      +

      End GT Number

      +

      Specify the end IMSI of roaming subscribers.

      +

      End IMSI

      +

      Network Indicator

      +

      Nature of Address Indicator. It indicates the scope of the address value.

      +

      --

      +

      DPC

      +

      Point Code of remote network.

      +

      --

      +

      SSN

      +

      Subsystem Number. For IMSI and MSISDN, specify SSN to 6.

      +

      6

      +

      Route Indicator

      +

      For the connected network, select Route on GT.

      +

      Route on GT

      +

      Address Indicator

      +

      Contribution of SCCP Address.

      +

      GT+DPC+SSN

      +

      Replace Start Digit

      +

      The start digit of the GT number to be replaced.

      +

      0

      +

      Replace End Digit

      +

      The end digit of the GT number to be replaced.

      +

      0

      +

      Replacing Number Plan

      +

      The type of the number to be output.

      +

      N/A

      +

      Replacing Digits

      +

      Replace the selected GT number range with these digits.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_52_02

      +

       

      +

      1.On the GTT tab, click New at the bottom of the Globe Title Translate table.

       

      +

      2.In the GTT ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the GTT Option window, configure the following parameters to add GTT for the MSISDN range of IMDX subscribers.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Repeat Step 1 to 4 to add GTT for the IMSI range of IMDX subscribers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Flag

      +

      Enable or disable this GTT item.

      +

      Enable

      +

      Number Plan

      +

      Describe which numbering plan will be used for the global title. The numbering plan chosen will aid the routing system in determining the correct network system to direct the message.

      +

      GT

      +

      Translation Type

      +

      Translation examines the destination address and deciding how to identify it over the telephone network.

      +

      0

      +

      Start GT Number

      +

      Specify the beginning MSISDN/IMSI of IMDX subscribers.

      +

      Start MSISDN/IMSI

      +

      End GT Number

      +

      Specify the end MSISDN/IMSI of IMDX subscribers.

      +

      End MSISDN/IMSI

      +

      Network Indicator

      +

      Nature of Address Indicator. It indicates the scope of the address value. Choose the same network as MTP3 setting.

      +

      National

      +

      DPC

      +

      Point Code of local system.

      +

      --

      +

      SSN

      +

      Subsystem Number. For IMSI and MSISDN, specify SSN to 6.

      +

      6

      +

      Route Indicator

      +

      For the connected network, select Route on GT.

      +

      Route on GT

      +

      Address Indicator

      +

      Contribution of SCCP Address.

      +

      GT+DPC+SSN

      +

      Replace Start Digit

      +

      The start digit of the GT number to be replaced.

      +

      0

      +

      Replace End Digit

      +

      The end digit of the GT number to be replaced.

      +

      0

      +

      Replacing Number Plan

      +

      The type of the number to be output.

      +

      N/A

      +

      Replacing Digits

      +

      Replace the selected GT number range with these digits.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      IMDX Flag

      +

      Enable or disable IMDX service.

      +

      Enable

      +

      IMSI Prefix for OPPS

      +

      OPPS substitutes the IMSI prefix of the inbound IMDX users by the predefined pseudo IMSI prefix for HLR routing purpose.

      +

      It should be different from the IMSI prefix of the local network or any other roaming partners' networks.

      +

      --

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >OPPS.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_62_02

      +

       

      +

      1.Click the IMDX tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Exclusive Access

      +

      Exclusive access control command.

      +

      --

      +

      •Level

      Exclusive access provides solutions to restrict the IMDX registration from a predefined range of users:

      +

      •Normal: Full IMDX functions.

      •Exclusive Half: Prohibit the public (roaming) users from registration.

      •Exclusive Full: Prohibit both public (roaming) and hybrid users from registration.

      •Shutdown: Shutdown IMDX. Forbid all users from registration.

      Normal

      +

      •Cause

      In the exclusive access mode, the network sends a Location Area Updating Reject message to MS to indicate the cause of rejection:

      +

      N/A

      +

      Private Dialing Prefix

      +

      Reserve the number range for IMDX users by specifying the number prefix and attribute. Originating call with such dialing prefixes will be treated as private calls.

      +

      --

      +
      +
      +

       

      +

       

      +
      +
      +
      + + + +

      Refer Enabling Mobile Call to configure IMDX Private Dialing Prefix in MSC parameters.

      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Manage OPPS Subscriber

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.62

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_62_02.gif b/wxc2_omc/omcHelp/2_62_02.gif new file mode 100755 index 0000000..2b22c91 Binary files /dev/null and b/wxc2_omc/omcHelp/2_62_02.gif differ diff --git a/wxc2_omc/omcHelp/2_63.htm b/wxc2_omc/omcHelp/2_63.htm new file mode 100755 index 0000000..703a8cf --- /dev/null +++ b/wxc2_omc/omcHelp/2_63.htm @@ -0,0 +1,406 @@ +锘� + + + Enabling OPR + + + + + + + + + + + + + + + + + + + + +
      +

      Enabling OPR

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The OPR System enables the existing UltraWAVE Prepaid System to provide temporary services to any visiting GSM users. even they are from PLMN without local roaming agreement in place. The OPR doesn鈥檛 require GSM visitors to change their SIM cards. OPR provides prepaid services to the visitors with their home SIM cards.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button .

       

      +

      2_30_07

      +

       

      +

      1.Click the Local Node tab.

       

      +

      2.Click the hyperlinked index number of OPPS to open the OPPS Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Note: Please ignore this step if it's already done in the preceding task configuration.

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      MSISDN

      +

      The E.164 node address of OPPS.

      +

      CC+NDC+SN format

      +

      IP 0

      +

      IP address of OPPS server 0.

      +

      172.18.98.1

      +

      IP 1

      +

      IP address of OPPS server 1.

      +

      172.18.99.1

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_52_02

      +

       

      +

      1.On the GTT tab, click New at the bottom of the Globe Title Translate table.

       

      +

      2.In the GTT ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the GTT Option window, configure the following parameters to add GTT for the MSISDN range of  OPR subscribers.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Repeat Step 1 to 4 to add GTT for the IMSI range of OPR subscribers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Flag

      +

      Enable or disable this GTT item.

      +

      Enable

      +

      Number Plan

      +

      Describe which numbering plan will be used for the global title. The numbering plan chosen will aid the routing system in determining the correct network system to direct the message.

      +

      GT

      +

      Translation Type

      +

      Translation examines the destination address and deciding how to identify it over the telephone network.

      +

      0

      +

      Start GT Number

      +

      Specify the beginning MSISDN/IMSI of OPR subscribers.

      +

      Start MSISDN/IMSI

      +

      End GT Number

      +

      Specify the end MSISDN/IMSI of OPR subscribers.

      +

      End MSISDN/IMSI

      +

      Network Indicator

      +

      Nature of Address Indicator. It indicates the scope of the address value. Choose the same network as MTP3 setting.

      +

      National

      +

      DPC

      +

      Point Code of local system.

      +

      --

      +

      SSN

      +

      Subsystem Number. For IMSI and MSISDN, specify SSN to 6.

      +

      6

      +

      Route Indicator

      +

      For the connected network, select Route on GT.

      +

      Route on GT

      +

      Address Indicator

      +

      Contribution of SCCP Address.

      +

      GT+DPC+SSN

      +

      Replace Start Digit

      +

      The start digit of the GT number to be replaced.

      +

      0

      +

      Replace End Digit

      +

      The end digit of the GT number to be replaced.

      +

      0

      +

      Replacing Number Plan

      +

      The type of the number to be output.

      +

      N/A

      +

      Replacing Digits

      +

      Replace the selected GT number range with these digits.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      OPR Flag

      +

      Enable or disable OPR service.

      +

      Enable

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >OPPS.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_63_01

      +

       

      +

      1.Click the OPR tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Note: The local MCC+MNC can not be added in the PLMN List when the Registration Option is set to Allow, but it has to be added in when the Option is set to Bar.

      +

      Auto-Registration Flag

      +

      Enable or disable auto-registration function to the OPR subscribers from the PLMN without roaming agreement.

      +

      Enable

      +

      Regional Subscription

      +

      Registration administration of roaming subscribers.

      +

       

      +

      •Registration Option

      Allow or reject the mobile subscribers from the specific PLMNs to register to the local network.

      +

      •Allow

      •Bar

      •PLMN List

      Specify up to 32 PLMNs by entering its MCC and MNC.

      +

      MCC+MNC

      +

      COS ID

      +

      Specify a COS to the OPR applications for charging purpose.

      +

      Class of Service (COS) is the basic entity used to define prepaid packages, and constitutes a major part of the prepaid service data.

      +

      ---

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Refer Enabling Mobile Call to configure OPR Dialing Prefix in MSC parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Refer Enabling Prepaid Service to define a COS for OPR service.

      +

       

      +

      Refer Configuring Tariff to define a Tariff for OPR service.

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Manage OPPS Subscriber

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.63

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_63_01.gif b/wxc2_omc/omcHelp/2_63_01.gif new file mode 100755 index 0000000..d3befbf Binary files /dev/null and b/wxc2_omc/omcHelp/2_63_01.gif differ diff --git a/wxc2_omc/omcHelp/2_64.htm b/wxc2_omc/omcHelp/2_64.htm new file mode 100755 index 0000000..78b480a --- /dev/null +++ b/wxc2_omc/omcHelp/2_64.htm @@ -0,0 +1,65 @@ +锘� + + + Using Debug Tool + + + + + + + + + + + + + + + + + + + + +
      +

      Using Debug Tool

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Debug is a troubleshooting tool that is available from the privileged exec mode. This debug can be used to display information about various application operations and the related traffic generated or received by the application entity, as well as any error messages. This tool is very useful and informative, but you must be aware of the following facts regarding its use:

      +

      •Debug is treated as a very high priority task. It can consume a significant amount of resources, and the entity is forced to process-switch the packets being debugged.

      •Debug must not be used as a monitoring tool - it is meant to be used for a short period of time and as a troubleshooting tool. By using it you discover significant facts about the working and faulty application components.

       

      +

      The following is a list of recommendations on proper usage of the debug tool:

      +

      •You need a Telnet tool to monitor debug output from within a Telnet session.

      •The debug command is used to diagnose a specific facility, task, or protocol.

      •Turning debugging on for everything (using the log all command) is seriously discouraged in production networks. You get a tremendous amount of information, very fast, but it can severely diminish the system's performance or even render it unusable. The log all command is also quite useless since it presents overlapping information that is difficult if not impossible to interpret.

      •If possible, use the debug command during periods when network traffic is not at its peak and fewer critical business applications are active. The debug command has a higher priority (with respect to CPU cycles) than network traffic.

      •Always remember to undo debug as soon as possible. You can use the log none command to turn off all types of debugging that may be on.

      •For troubleshooting, also consider using protocol analyzers to capture and display network traffic. These have little or no impact on your network performance, yet they provide valuable information.

       

      +

      Download Debug User Manual in HTML Help format for more information about the debug usage.

      +

       

      +

      Please note registration for HTML Help (.chm) files is required since Microsoft issued a security patch for Microsoft Internet Explorer, disabling in general all HTML Help files that are viewed from a network drive. HHReg is a utility to remove this limitation by explicitly registering HTML Help files in the Windows registry to make them available for viewing.

      +

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.64

      + +
      + + + diff --git a/wxc2_omc/omcHelp/2_65_01.gif b/wxc2_omc/omcHelp/2_65_01.gif new file mode 100755 index 0000000..2641e9b Binary files /dev/null and b/wxc2_omc/omcHelp/2_65_01.gif differ diff --git a/wxc2_omc/omcHelp/2_66.htm b/wxc2_omc/omcHelp/2_66.htm new file mode 100755 index 0000000..2bd779e --- /dev/null +++ b/wxc2_omc/omcHelp/2_66.htm @@ -0,0 +1,349 @@ +锘� + + + Connecting to IP Media Server + + + + + + + + + + + + + + + + + + + + +
      +

      Connecting to IP Media Server

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      IP media server is the name given to the computing component that processes the audio streams associated with telephone calls or connections. Multi-party call and conference services are particular examples of how IP media servers can be used, as a special 'engine' is needed to mix audio streams together so that conference participants can hear all of the other participants.

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MRFC.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_66_01

      +

       

      +

      1.On the MRFP tab, and then click New at the bottom of the MRFP table.

       

      +

      2.In the MRFP ID box, select an available number for the new MRFP, and then click the 2_002 button.

       

      +

      3.In the MRFP Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created MRFP.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Title

      +

      Assign a catchy alias to this new created entity.

      +

      --

      +

      MRFC Domain

      +

      Specify a domain name for local server.

      +

      172.18.98.1

      +

      MRFP Domain

      +

      Enter the domain name of the IPmedia media server.

      +

      172.18.230.1

      +

      MRFP IP

      +

      Enter the IP address of the IPmedia media server.

      +

      172.18.230.1

      +

      MRFP Port

      +

      Enter the SIP UDP Local Port set on the IPmedia media server.

      +

      5060

      +

      Conf Prefix

      +

      Enter the conference ID set on the IP media server.

      +

      conf

      +

      Max Conf Channels

      +

      Assign the maximum number of channels reserved for conference use. It cooperates with the next parameter to distribute licensed channels between conference and transcoding.

      +

      --

      +

      Max Trans Channels

      +

      Assign the maximum number of channels reserved for transcoding use. It cooperates with the upper parameter to distribute licensed channels between conference and transcoding.

      +

      --

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to IPmedia >Protocol Management >IPmedia Parameters.

       

      +

      2.Configure the necessary parameters given in the following table.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Conference ID

      +

      Identification of conference call (to be used by SIP INVITE)

      +

      conf

      +

      Bip On Conference

      +

      Beep when a new participant joins a conference

      +

      Enable

      +

      Enable DTMF Clamping

      +

      Enable or disable remove detected DTMF digits from the audio stream on simple conference participant

      +

      Enable

      +

      Enable Conference DTMF Reporting

      +

      Enable or disable report in out of band format about detected DTMF digits

      +

      Disable

      +
      +
      +

       

      +

      3.Go to IPmedia >Protocol Management >Advanced Parameters >General Parameters.

       

      +

      4.Configure the necessary parameter given in the following table.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Disconnect on Broken Connection

      +

      Disconnect calls on receiving RTP broken notification

      +

      No

      +
      +
      +

       

      +

      5.Go to IPmedia >Protocol Management >Protocol Definition >General Parameters.

       

      +

      6.Configure the necessary parameters given in the following table.

       

      +
      + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      SIP Transport Type

      +

      Specify SIP transport type

      +

      UDP

      +

      SIP UDP Local Port

      +

      Specify local SIP port used for signaling

      +

      5060

      +
      +
      +

       

      +

      7.Go to IPmedia >Protocol Management >Protocol Definition >Coders.

       

      +

      8.Configure the necessary parameters given in the following table.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Coder Name

      +

      Packetization Time

      +

      Rate

      +

      Payload Type

      +

      Silence Suppression

      +

      G.729

      +

      20

      +

      8

      +

      --

      +

      Disabled

      +

      G.711A-law

      +

      20

      +

      64

      +

      --

      +

      Disabled

      +

      G.711U-law

      +

      20

      +

      64

      +

      --

      +

      Disabled

      +

      GSM EFR

      +

      20

      +

      12.2

      +

      84

      +

      Disabled

      +

      AMR

      +

      20

      +

      12.2

      +

      64

      +

      Disabled

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Multi-party Call

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.66

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_66_01.gif b/wxc2_omc/omcHelp/2_66_01.gif new file mode 100755 index 0000000..810f88f Binary files /dev/null and b/wxc2_omc/omcHelp/2_66_01.gif differ diff --git a/wxc2_omc/omcHelp/2_68.htm b/wxc2_omc/omcHelp/2_68.htm new file mode 100755 index 0000000..45eb241 --- /dev/null +++ b/wxc2_omc/omcHelp/2_68.htm @@ -0,0 +1,1452 @@ +锘� + + + Configuring iPALIM + + + + + + + + + + + + + + + + + + + + +
      +

      Configuring iPALIM

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      iPALIM stands for 鈥渋ntelligent Private A-Link Intelligent Multiplexer鈥�. This multiplexer functionally resides at the A-interface of the UltraWAVE Softswitch to enable the system to work as an Inter-Reach Office (IRO) Softswitch System to perform as a switch or as a BSC, depending on desired service and user type.

      +

       

      +

      From the point of view of the iPALIM, private service and public service are provided by the IRO Softswitch:

      +

      •The private A-Link multiplexer recognizes the users that are eligible for private services and routes their calls to the IRO for local switching within the local UltraWAVE community.

      •For the non-private (public) GSM mobile user, iPALIM routes calls to the PLMN MSC, bypassing the IRO. iPALIM allows the UltraWAVE IRO network to appear as a BSC to the PLMN MSC. The intelligent private A-link multiplexer is transparent to the user and the MSC. Moving into and out of the IRO is seamless to the public user.

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Item

      +

      Requirement

      +

      Business Model

      +

      PLMN operator offers IRO to an enterprise to improve the in-building coverage and provide PBX services.

      +

      User Type

      +

      Hybrid users only. All the enterprise staffs are customers of the PLMN (using PLMN鈥檚 SIM card).

      +

      Registration

      +

      Auto-registration. Company provides 鈥榬echarge card numbers鈥� to employees for self activation.

      +

      Service Control

      +

      Free of charge (zero tariffs). Use COS to control the service privilege. Senior and Junior use different COS to get different services.

      +

      PSTN

      +

      Connect to local PSTN through the office PBX in ISDN.

      +

      Numbering Plan

      +

      Each employee gets a short number as his extension number.

      +

      Emergency Call

      +

      No local emergency center. Route all emergency calls to the PLMN.

      +
      +
      +

       

      +

      Parameter Datafill (Example)

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameters from Public Network

      +

      PLMN MSC Point Code

      +

      National 14bit PC =100

      +

      PLMN MCC + MNC

      +

      240 + 02

      +

      IRO Point Code

      +

      National 14bit PC = 101

      +

      IRO LAC + Cell ID

      +

      100 + 1

      +

      Parameters for Enterprise Network

      +

      CC + NDC

      +

      66 + 755

      +

      OPPS E.164 Number

      +

      66755900012

      +

      SMSC E.164 Number

      +

      66755900004

      +

      IMSI Prefix for OPPS

      +

      46003

      +

      Registration Hotline

      +

      800

      +

      iPALIM User Number

      +

      66755910000 - 66755919999

      +

      User Extension Number

      +

      10000 - 19999

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >MTP3.

       

      +

      2.Make sure the System ID at the upper right corner displays MTP3(MSS_Pub), click the 2_035 button.

       

      +

      2_68_01

      +

       

      +

      1.Click the Link Set tab, and then click New at the bottom of the Linkset table.

       

      +

      2.In the Linkset ID box, select an available number for the new linkset, and then click the 2_002 button.

       

      +

      3.In the Linkset Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created linkset.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description  (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify network type of the MSS.

      +

      National

      +

      DPC

      +

      Enter the Originating Point Code of PLMN MSC.

      +

      100

      +

      Loopback Option

      +

      Enable or disable loopback function on this linkset.

      +

      Enabled only for the MSC loopback linksets.

      +

      Disable

      +

      OPC Multiple

      +

      Not in use.

      +

      0

      +
      +
      +

       

      +

      2_68_02

      +

       

      +

      1.Click the SG tab, and then click New at the bottom of the Signaling Gateway table.

       

      +

      2.In the SG ID box, select an available number for the new SG, and then click the 2_002 button.

       

      +

      3.In the Signaling Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created signaling gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Application Mode

      +

      Select the application mode of the signaling gateway.

      +

      Server

      +

      Signaling Type

      +

      Specify the type of the signaling gateway.

      +

      M2UA

      +

      ACK Option

      +

      The ACK message must be sent if there is request from the peer. Otherwise, the ACK message should not be sent.

      +

      Allow

      +

      Remote IP

      +

      IP address of media gateway.

      +

      MG IP

      +
      +
      +

       

      +

      2_68_03

      +

       

      +

      1.Click the Link tab, and then click New at the bottom of the Link table.

       

      +

      2.In the Link ID box, select an available number for the new link, and then click the 2_002 button.

       

      +

      3.In the Link Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created link.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link.

      +

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      0

      +

      Host IP

      +

      Management server's IP of this link.

      +

      MSC0 = 172.18.98.1

      +

      MSC1 = 172.18.99.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      0

      +
      +
      +

       

      +

      6.Repeat Step 2 to 5 to add link 1.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Link Type

      +

      Specify the signaling type of the link.

      +

      M2UA

      +

      Linkset ID

      +

      Enter the Linkset index number to assign this link to a linkset.

      +

      Linkset ID

      +

      SLC

      +

      Assign a Signaling Link Code to this link for identification.

      +

      1

      +

      Host IP

      +

      Management server's IP of this link.

      +

      MSC1 = 172.18.99.1

      +

      MSC0 = 172.18.98.1

      +

      Alternative Host IP

      +

      Alternative management server's IP of this link for backup purpose.

      +

      SG ID

      +

      Enter the SG index number to assign this link to a signaling gateway.

      +

      SG ID

      +

      M2UA IID

      +

      Assign a M2UA Interface ID to this link for identification.

      +

      1

      +
      +
      +

       

      +

      2_68_04

      +

       

      +

      1.Click the Nat Network tab.

       

      +

      2.In the upper table, configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Nat OPC

      +

      Originating Point Code of MSS.

      +

      101

      +

      Nat PC Length

      +

      Length of Point Code.

      +

      14-bit

      +

      Nat PC Type

      +

      Type of Point Code.

      +

      ITU

      +
      +
      +

       

      +

      4.Click New at the bottom of the Nat Routing table.

       

      +

      5.In the Nat Routing ID box, select an available number for the new routing, and then click the 2_002 button.

       

      +

      6.In the Routing Option window, configure the relevant parameters given in the following table.

       

      +

      7.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      DPC

      +

      Enter the unique point code of the PLMN MSC.

      +

      101

      +

      Normal Linkset

      +

      Enter the Linkset index number configured previously.

      +

      Linkset ID

      +

      Alternative Linkset

      +

      Assign an Alternative Linkset to the PLMN. It will be activated when the Normal Linkset is unavailable.

      +

      Set 128 to disable alternative linkset.

      +

      128

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >SCCP.

       

      +

      2.Make sure the System ID at the upper right corner displays SCCP(MSS_Pub), click the 2_035 button.

       

      +

      2_68_05

      +

       

      +

      1.Click the Local Node tab.

       

      +

      2.Click the hyperlinked index number of OPPS to open the OPPS Option window.

       

      +

      3.Configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Network Indicator

      +

      Specify the local node to a network. Choose the same network as MTP3 setting.

      +

      National

      +

      MSISDN

      +

      The E.164 node address of OPPS.

      +

      66755900012

      +

      IP 0

      +

      IP address of the local node server 0.

      +

      OPPS0 = 172.18.98.1

      +

      IP 1

      +

      IP address of the local node server 1.

      +

      OPPS1 = 172.18.99.1

      +
      +
      +

       

      +

      2_68_06

      +

       

      +

      1.Click the GTT tab, and then click New at the bottom of the Globe Title Translate table.

       

      +

      2.In the GTT ID box, select an available number for the new entry, and then click the 2_002 button.

       

      +

      3.In the GTT Option window, configure the following parameters to add IMSI range of OPPS subscribers.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +

      5.Repeat step 1 to 4 to add MSISDN range of iPALIM subscribers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Flag

      +

      Enable or disable this GTT item.

      +

      Enable

      +

      Number Plan

      +

      Describe which numbering plan will be used for the global title. The numbering plan chosen will aid the routing system in determining the correct network system to direct the message.

      +

      IMSI

      +

      MSISDN

      +

       

      +

      Translation Type

      +

      Translation examines the destination address and deciding how to identify it over the telephone network.

      +

      0

      +

      80

      +

      Start GT Number

      +

      The start of the IMSI and MSISDN range of OPPS subscribers.

      +

      460030000000000

      +

      66755910000

      +

      End GT Number

      +

      The end of the IMSI and MSISDN range of OPPS subscribers.

      +

      460039999999999

      +

      66755919999

      +

      Network Indicator

      +

      Nature of Address Indicator. It indicates the scope of the address value. Choose the same network as MTP3 setting.

      +

      National

      +

      DPC

      +

      Point Code of IRO.

      +

      101

      +

      SSN

      +

      Subsystem Number. For IMSI and MSISDN, specify SSN to 6.

      +

      6

      +

      Route Indicator

      +

      For the connected network, select Route on GT.

      +

      Route on GT

      +

      Address Indicator

      +

      Contribution of SCCP Address.

      +

      GT+DPC+SSN

      +

      Replace Start Digit

      +

      The start digit of the GT number to be replaced.

      +

      0

      +

      Replace End Digit

      +

      The end digit of the GT number to be replaced.

      +

      0

      +

      Replacing Number Plan

      +

      The type of the number to be output.

      +

      N/A

      +

      Replacing Digits

      +

      Replace the selected GT number range with these digits.

      +

      N/A

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >iPALIM.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_68_07

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      System Parameters

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      PSTN Routing

      +

      Select the outgoing route for Hybrid user PSTN calls.

      +

      •Local = Route PSTN calls to the MSC trunk group pointing towards PBX.

      •Remote = Route PSTN calls to the iPALIM trunk group pointing towards remote PLMN.

      Local

      +

      Emergency Routing

      +

      Select the outgoing route for Hybrid and Private user emergency calls.

      +

      •Local = Route emergency calls to the MSC trunk group pointing towards PBX.

      •Remote = Route emergency calls to the iPALIM trunk group pointing towards remote PLMN.

      Remote

      +

      UES Flag

      +

      Enable or disable User Equipment Simulator function. It should be enabled to support iRLS function.

      +

      Disable

      +

      SMSC Address

      +

      E.164 local node of Short Message Center.

      +

      66755900004

      +

      Idle Period to Purge

      +

      System purges Public users from iPALIM database when they have been idle for the amount of time. Unit = Hour.

      +

      1

      +

      Public Exclusive

      +

      Allow or forbid Public users to login the local IRO.

      +

      •Off = Allow

      •On = Forbid

      Off

      +

      Private Exclusive

      +

      Allow or forbid Private users to login the local IRO.

      +

      •Off = Allow

      •On = Forbid

      Off

      +

      Hybrid Exclusive

      +

      Allow or forbid Hybrid users to login the local IRO.

      +

      •Off = Allow

      •On = Forbid

      Off

      +

      Hybrid Priority

      +

      Allow or forbid the Hybrid users to use private service when iPALIM A-interface link is failed.

      +

      •Public = Forbid

      •Private = Allow

      Private

      +
      +
      +

       

      +

      2_68_08

      +

       

      +

      1.Click Hotline Number tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + +

      Hotline Number

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Language 1 - 8

      +

      Registration hotline number for Public user to self-create Hybrid user account in the IRO network coverage.

      +

      800

      +
      +
      +

       

      +

      2_68_09

      +

       

      +

      1.Click the Media Gateway tab, and then click New at the bottom of the Media Gateway table.

       

      +

      2.In the MG ID box, select an available number for the new Media Gateway, and then click the 2_002 button.

       

      +

      3.In the Media Gateway Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Media Gateway parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created Media Gateway.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      MG Parameters

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Title

      +

      Specify an identifiable name to the Media Gateway.

      +

      PLMN-1

      +

      IP

      +

      IP address of this Media Gateway.

      +

      172.18.98.1

      +

      Domain Name

      +

      Specify a domain name to the Media Gateway.

      +

      172.18.98.1

      +

      Switching Mode

      +

      Select the switching mode of the specified Media Gateway.

      +

      MGCP

      +

      Endpoint

      +

      Specify the method of MGCP endpoint description.

      +

      Structured

      +

      Type

      +

      Select the type of MG endpoint.

      +

      •AudioCodes = E1 connection via AudioCodes

      •iPALIM = IP connection to PLMN

      iPALIM

      +

      Max Physical Ports

      +

      The total physical port number of the Media Gateway.

      +

      1

      +

      Max Channels

      +

      The total channel number of the virtual MG. Applicable to virtual MG only.

      +

      32

      +

      Packetization Period

      +

      The period over which encoded voice bits are collected for encapsulation in.

      +

      x20ms

      +

      Codec Type

      +

      Specify the codec type of the Media Gateway.

      +

      EFR

      +

      Audit Timer

      +

      The time interval between sending AUEP message from MGC to MGW to check the trunk status.

      +

      --

      +
      +
      +

       

      +

      2_68_10

      +

       

      +

      1.Click the Trunk Group tab, and then click New at the bottom of the Trunk Group table.

       

      +

      2.In the TG ID box, select an available number for the new Trunk Group, and then click the 2_002 button.

       

      +

      3.In the Trunk Group Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Trunk Group parameters to application servers.

       

      +

      5.Click the 2_036 button to activate the new created Trunk Group.

       

      +

      6.Click the hyperlinked number in the Trunk Entries to open the Trunk table.

       

      +

      7.Click New at the bottom of the Trunk table to add a Trunk.

       

      +

      8.In the Trunk ID box, click the 2_002 button.

       

      +

      9.In the Trunk Option window, configure the relevant parameters given in the following table.

       

      +

      10.Click the 2_041 button to update Trunk parameters to application servers.

       

      +

      11.Click the 2_036 button to activate the new created Trunk.

       

      +

      12.Repeat Step 7 to 11 to add more trunks.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      TG Parameters

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Title

      +

      Specify an identifiable name to the Trunk Group.

      +

      TG-1

      +

      OPC

      +

      Originating Point Code. Point Code of the local IRO network.

      +

      101

      +

      DPC

      +

      Destination Point Code. Point Code of the remote PLMN network.

      +

      100

      +

      Network Indicator

      +

      Specify the Trunk Group to one of the four networks.

      +

      Nat

      +

      Protocol Type

      +

      Select the protocol type for this Trunk Group. The default is AIF.

      +

      AIF

      +

      Circuit Selection Mode

      +

      Circuit selection mode of the traffic channel connections. The mode should be the same at each end of the Trunk Group.

      +

      Clockwise

      +
      +
      +

       

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Trunk Parameters

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Title

      +

      Specify an identifiable name to the Trunk.

      +

      Trunk-1

      +

      MG ID

      +

      Specify the Trunk to the Media Gateway which has been created in the preceding section.

      +

      MG ID

      +

      Port ID

      +

      Specify the Trunk to the physical port on the selected Media Gateway.

      +

      0

      +

      Port Type

      +

      Specify the type of MG physical ports.

      +

      E1

      +

      Group ID

      +

      Select the application group for the Trunk.

      +

      Group 0

      +

      CIC Value Assignment

      +

      Specify the start CIC to the Trunk.

      +

      0

      +
      +
      +

       

      +

      2_68_11

      +

       

      +

      1.Click the Location Area tab, and then click New at the bottom of the Location Area table.

       

      +

      2.In the Location Area ID box, click the 2_002 button.

       

      +

      3.In the Location Area Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Location Area parameters to application servers.

       

      +

      5.Click the hyperlinked number in the Cell Entries to open the Cell table.

       

      +

      6.Click New at the bottom of the Cell table to add a Cell of IRO.

       

      +

      7.In the Cell ID box, click the 2_002 button.

       

      +

      8.In the Cell Option window, configure the relevant parameters given in the following table.

       

      +

      9.Click the 2_041 button to update Cell parameters to application servers.

       

      +

      10.Repeat Step 6 to 9 to add more cells.

       

      +

      Please note all LAC and Cell ID configured in the IRO MSC Location Area list must be created here.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      LA Parameters

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      LAC

      +

      Location Area Code. Assigned by PLMN operator.

      +

      100

      +

      MCC

      +

      Mobile Country Code. Assigned by PLMN operator.

      +

      240

      +

      MNC

      +

      Mobile Network Code. Assigned by PLMN operator.

      +

      2

      +
      +
      +

       

      +

       

      +
      + + + + + + + + + + + + + + + +

      Cell Parameters

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Cell ID

      +

      Global Cell Identity defined in GSM 03.03. Assigned by PLMN operator.

      +

      1

      +

      TG ID

      +

      Combine the routing Trunk Group with the specified cell. This TG was created in the preceding section.

      +

      TG ID

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >VLR.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_37_01

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      VLR Parameters

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      OPR Flag

      +

      Enable or disable OPR function. It should be enabled to support auto-registration service.

      +

      Enable

      +

      IMDX Flag

      +

      The IMDX function must be disabled to deploy iPALIM service.

      +

      Disable

      +

      IMSI Prefix for OPPS

      +

      Substitute the IMSI prefix (MCC+MNC) of the inbound Public users by the predefined pseudo IMSI prefix for HLR routing purpose. It should be different from the IMSI prefix of the local network or any other roaming partners' networks.

      +

      46003

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >OPPS.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_68_12

      +

       

      +

      1.Click the OPR tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      OPPS Parameters

      +

      Description

      +

      Recommended Value

      +

      COS ID

      +

      Specify a COS to the iPALIM users for private calls charging purpose.

      +

      Class of Service (COS) is the basic entity used to define prepaid packages, and constitutes a major part of the prepaid service data.

      +

      COS ID

      +

      Auto-registration Flag

      +

      Enable or disable auto-registration service.

      +

      Enable

      +

      Auto-cleanup Threshold

      +

      The OPPS will send a warning alarm and clean up database by deleting the trial accounts when the OPR license utilization level reaches this threshold.

      +

      0.50 - 0.99

      +

      Welcome SMS

      +

      Customize the text format in a welcome short message. It is sent to the user when he successfully registered to the iPALIM service and informs him his local phone number.

      +

      --

      +

      PLMN List Option

      +

      Allow or reject the mobile subscribers from the specific PLMNs to register to the local network.

      +

      Allow

      +

      PLMN List

      +

      List the allowed PLMN.

      +

      24002

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_68_13

      +

       

      +

      Refer to Connecting to PSTN to complete the following configuration:

      +

       

      +

      1.Relevant configuration of PBX.

       

      +

      2.Relevant configuration of iPALIM private call routing:

       

      +

      •Convert 鈥榰nknown鈥� prefix 1 to 鈥業DD鈥� prefix 鈥�6675591鈥�, and point it to local BSC trunk group.

       

      +

      •Assign LAC and Cell ID to local BSC and BTS.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      Complete the following steps to configure XAPP related parameters. After this configuration, the Hybrid users can send local short message by entering the shortened extension number (1xxxx) of the receiver, instead of entering his or her whole MSISDN number (6675591xxxx).

      +

       

      +

      1.Go to EMS >Configuration >NSS >XAPP.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_68_14

      +

       

      +

      1.Click the Prefix Manipulation tab, and then click New at the bottom of the Prefix Manipulation table.

       

      +

      2.In the Prefix ID box, select an available number for the new Prefix, and then click the 2_002 button.

       

      +

      3.In the Prefix Manipulation Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update Prefix Manipulation parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Sub-parameter

      +

      Description

      +

      Recommended Value

      +

      Prefix

      +

      Hybrid users can send local short message by entering the shortened extension number (1xxxx) of the receiver.

      +

      1

      +

      Deletion Count

      +

      The amount of digits to be deleted from the beginning of the service number.

      +

      0

      +

      Insertion Count

      +

      The amount of digits to be inserted to the front of the service number.

      +

      6

      +

      Inserted Digits

      +

      The digits to be added to the front of the service number.

      +

      667559

      +

      Number Length

      +

      The length of the incoming service number.

      +

      5

      +
      +
      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >PPS.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_68_15

      +

       

      +

      1.Click the SRF Parameters tab, and then click the Service Number sub-tab.

       

      +

      2.Enter 800 in PALIM Register Number field.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +

      2_68_17

      +

       

      +

      Refer to Configuring Tariff to configure and activate the tariff for iPALIM users.

      +

       

      +

      2_68_16

      +

       

      +

      Refer to PPS parameter dictionary to configure the COS relevant parameters.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_2_1_8_01

      +

       

      +

      Refer to OPPS Subscriber to import a batch of OPPS subscribers for auto-registration

      +

       

      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Configure Local Switching

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.68

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_68_01.gif b/wxc2_omc/omcHelp/2_68_01.gif new file mode 100755 index 0000000..205d66b Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_01.gif differ diff --git a/wxc2_omc/omcHelp/2_68_02.gif b/wxc2_omc/omcHelp/2_68_02.gif new file mode 100755 index 0000000..3259442 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_02.gif differ diff --git a/wxc2_omc/omcHelp/2_68_03.gif b/wxc2_omc/omcHelp/2_68_03.gif new file mode 100755 index 0000000..53ecd9a Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_03.gif differ diff --git a/wxc2_omc/omcHelp/2_68_04.gif b/wxc2_omc/omcHelp/2_68_04.gif new file mode 100755 index 0000000..e8fe8fd Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_04.gif differ diff --git a/wxc2_omc/omcHelp/2_68_05.gif b/wxc2_omc/omcHelp/2_68_05.gif new file mode 100755 index 0000000..925971b Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_05.gif differ diff --git a/wxc2_omc/omcHelp/2_68_06.gif b/wxc2_omc/omcHelp/2_68_06.gif new file mode 100755 index 0000000..cf2ef06 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_06.gif differ diff --git a/wxc2_omc/omcHelp/2_68_07.gif b/wxc2_omc/omcHelp/2_68_07.gif new file mode 100755 index 0000000..ad53c43 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_07.gif differ diff --git a/wxc2_omc/omcHelp/2_68_08.gif b/wxc2_omc/omcHelp/2_68_08.gif new file mode 100755 index 0000000..ebcdc3b Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_08.gif differ diff --git a/wxc2_omc/omcHelp/2_68_09.gif b/wxc2_omc/omcHelp/2_68_09.gif new file mode 100755 index 0000000..4c4b770 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_09.gif differ diff --git a/wxc2_omc/omcHelp/2_68_10.gif b/wxc2_omc/omcHelp/2_68_10.gif new file mode 100755 index 0000000..f8df57e Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_10.gif differ diff --git a/wxc2_omc/omcHelp/2_68_11.gif b/wxc2_omc/omcHelp/2_68_11.gif new file mode 100755 index 0000000..2f2c3f5 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_11.gif differ diff --git a/wxc2_omc/omcHelp/2_68_12.gif b/wxc2_omc/omcHelp/2_68_12.gif new file mode 100755 index 0000000..4b6279e Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_12.gif differ diff --git a/wxc2_omc/omcHelp/2_68_13.gif b/wxc2_omc/omcHelp/2_68_13.gif new file mode 100755 index 0000000..c334e19 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_13.gif differ diff --git a/wxc2_omc/omcHelp/2_68_14.gif b/wxc2_omc/omcHelp/2_68_14.gif new file mode 100755 index 0000000..9840330 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_14.gif differ diff --git a/wxc2_omc/omcHelp/2_68_15.gif b/wxc2_omc/omcHelp/2_68_15.gif new file mode 100755 index 0000000..faa30b0 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_15.gif differ diff --git a/wxc2_omc/omcHelp/2_68_16.gif b/wxc2_omc/omcHelp/2_68_16.gif new file mode 100755 index 0000000..4f47541 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_16.gif differ diff --git a/wxc2_omc/omcHelp/2_68_17.gif b/wxc2_omc/omcHelp/2_68_17.gif new file mode 100755 index 0000000..ce0ce54 Binary files /dev/null and b/wxc2_omc/omcHelp/2_68_17.gif differ diff --git a/wxc2_omc/omcHelp/2_69.htm b/wxc2_omc/omcHelp/2_69.htm new file mode 100755 index 0000000..e8edc6e --- /dev/null +++ b/wxc2_omc/omcHelp/2_69.htm @@ -0,0 +1,326 @@ +锘� + + + Configuring Local Switching + + + + + + + + + + + + + + + + + + + + +
      +

      Configuring Local Switching

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      GSM subscriber numbers continue to grow around the world. Most of the new GSM subscribers are coming from low income populations of the under-developed countries and a lot of them are living in rural/remote areas without infrastructure and radio coverage. The most popular ways to connect the rural/remote areas to the core telecommunication network in the under-developed countries are microwave and satellite links. In quite a lot of areas, satellite is the only available solution. But the backhaul satellite link is expensive and the transmission bandwidth is a bottleneck. For operators, the transmission cost of the backhaul is a significant factor of the total operation expenses. The cost of the transmission is one of the largest barriers in bringing the mobile services to the under-developed countries.

      +

       

      +

      Intelligent RTP Local Switching (iRLS) function is a solution for helping the operators achieves significant saving in the transmission bandwidth between the core network and the rural/remote areas to overcome the barrier.

      +

       

      +

      In standard GSM architecture, calls are routing to the MSC even if the calling and the called parties are in the same BSC zone. iRLS function enable the GSM system to route calls locally whenever the calling and called parties are in the same BSS zone; hence saving the backhaul transmission bandwidth. iRLS only controls the routing of the call traffic, the call signaling is still under the control of the host MSC. iRLS is integrated in UltraWAVE MSS and works with iPALIM function.

      +

       

      +

      picture_icon

      +

       

      +

       

      +

      Implementation

      +

       

      +

       

      +
      + + + +

      2_69_02

      +

       

      +

      Refer to Configuring iPALIM to complete the iPALIM configuration.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      2_69_06

      +

       

      +

      Refer to Enabling Local Call and Routing by Location to complete the MSC Routing Zone configuration.

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.FTP VIM software (rtp_proxyInstall_Rx.x.xx.tgz) to VIM server as www account.

       

      +

      //The default FTP directory is /home/www//

      +

       

      +

      2.Telnet to the VIM server and switch to the super user:

       

      +

      login: www

      +

       

      +

      Password:

      +

       

      +

      [www@vim-1 www]$ su -

      +

       

      +

      Password:

      +

       

      +

      3.[root@vim-1 root]# mv /home/www/rtp_proxyInstall_Rx.x.xx.tgz /usr/local/src

       

      +

      4.[root@vim-1 root]# cd /usr/local/src

       

      +

      5.[root@vim-1 src]# tar xvfz rtp_proxyInstall_Rx.x.xx.tgz

       

      +

      6.[root@vim-1 src]# ./rtp_proxyInstall/install

       

      +

      //Run script to install VIM software as prompt//

      +

       

      +

      7.[root@vim-1 src]# cd /usr/local/rtp_proxy/conf/

       

      +

      //The rtpproxy.conf is stored under this path//

      +

       

      +

      8.[root@vim-1 conf]# vi rtpproxy.conf

       

      +

      RTPPROXYID=1234

      +

       

      +

      //Specify the index number in the VIM domain name. e.g. the full VIM domain name is "VIM-1234".//

      +

       

      +

      RTPPROXYIP=192.168.0.1

      +

       

      +

      //Specify the IP address of the VIM server.//

      +

       

      +

      RTPPROXYPEERIP=0.0.0.0

      +

       

      +

      //It is an optional parameter for IP restriction, fill the IP of related MSS.//

      +

       

      +

      //Reserved as 0.0.0.0 if no IP restriction required.//

      +

       

      +

      SERIALNUM=00000250

      +

       

      +

      //It is the SN displayed on EMS GUI.//

      +

       

      +

      9.Save file and exit editor by type:

       

      +

      :wq

      +

       

      +

      10.Start the VIM process by the following command:

       

      +

      [root@vim-1 conf]# rtpproxyd start

      +

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Configuration >NSS >iRLS.

       

      +

      2.Click the 2_035 button at the upper right corner.

       

      +

      2_69_03

      +

       

      +

      1.On the System tab, configure the relevant parameters given in the following table.

       

      +

      2.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      RLS Flag

      +

      Enable or disable the RTP Local Switching feature.

      +

      Enable

      +
      +
      +

       

      +

      2_69_04

      +

       

      +

      1.Click the VIM MG tab, and then click New at the bottom of the VIM MG table.

       

      +

      2.In the VIM MG ID box, select an available number for the new MG, and then click the 2_002 button.

       

      +

      3.In the VIM MG Option window, configure the relevant parameters given in the following table.

       

      +

      4.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      MG Parameters

      +

      Description

      +

      Recommended Value

      +

      Title

      +

      Specify an identifiable name to the VIM Media Gateway.

      +

      VIM MG-1

      +

      IP

      +

      IP address of this VIM server.

      +

      VIM IP

      +

      Domain Name

      +

      The domain name of the connected VIM. Format as:

      +

      Key word 鈥渧im-鈥� followed by the RTPPROXYID which configured in the rtpproxy.conf.

      +

      vim-1234

      +

      Switching Mode

      +

      Select the switching mode of the specified Media Gateway. Select MGCP as default.

      +

      MGCP

      +

      Endpoint

      +

      Method of MGCP endpoint description. Select Unstructured as default.

      +

      Unstructured

      +

      Type

      +

      Type of MG endpoint. Read only.

      +

      VIM

      +

      Max Physical Ports

      +

      The total physical port number of the Media Gateway. Enter 2 as default.

      +

      2

      +

      Max Channels

      +

      The total channel number of the virtual MG. Enter 64 as default.

      +

      64

      +

      Packetization Period

      +

      The period over which encoded voice bits are collected for encapsulation in. Select x20ms as default.

      +

      x20ms

      +

      Codec Type

      +

      Specify the codec type of the Media Gateway. Read only.

      +

      AMR-12-2

      +

      Audit Timer

      +

      The time interval between sending AUEP message from MGC to MGW to check the trunk status.

      +

      0

      +
      +
      +

       

      +

      2_69_05

      +

       

      +

      1.Click the Routing Zone tab.

       

      +

      2.In the Routing Zone List window, configure the relevant parameters given in the following table.

       

      +

      3.Click the 2_041 button to update parameters to application servers.

       

      +
      + + + + + + + + + + +

      Sub-parameter

      +

      Description (Click highlight SAVE after change)

      +

      Recommended Value

      +

      Site Type

      +

      Specify the type of relevant routing zones which configured in the MSC routing zone table.  The traffic among "local" routing zones will be local switched.

      +

      Local

      +
      +
      +

       

      +
      +
      +

       

      +

      See Also

      +

       

      +

      •Configure iPALIM

       

      +

       

      +

      Return to

      +

       

      +

      •Tasks List

       

      +

      •Elements List

       

      +

       

      +

       

      +

       

      +

       

      +

      2.69

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/2_69_01.gif b/wxc2_omc/omcHelp/2_69_01.gif new file mode 100755 index 0000000..193562c Binary files /dev/null and b/wxc2_omc/omcHelp/2_69_01.gif differ diff --git a/wxc2_omc/omcHelp/2_69_02.gif b/wxc2_omc/omcHelp/2_69_02.gif new file mode 100755 index 0000000..e10fc8a Binary files /dev/null and b/wxc2_omc/omcHelp/2_69_02.gif differ diff --git a/wxc2_omc/omcHelp/2_69_03.gif b/wxc2_omc/omcHelp/2_69_03.gif new file mode 100755 index 0000000..665996e Binary files /dev/null and b/wxc2_omc/omcHelp/2_69_03.gif differ diff --git a/wxc2_omc/omcHelp/2_69_04.gif b/wxc2_omc/omcHelp/2_69_04.gif new file mode 100755 index 0000000..b136b2e Binary files /dev/null and b/wxc2_omc/omcHelp/2_69_04.gif differ diff --git a/wxc2_omc/omcHelp/2_69_05.gif b/wxc2_omc/omcHelp/2_69_05.gif new file mode 100755 index 0000000..eae61c1 Binary files /dev/null and b/wxc2_omc/omcHelp/2_69_05.gif differ diff --git a/wxc2_omc/omcHelp/2_69_06.gif b/wxc2_omc/omcHelp/2_69_06.gif new file mode 100755 index 0000000..65fbf94 Binary files /dev/null and b/wxc2_omc/omcHelp/2_69_06.gif differ diff --git a/wxc2_omc/omcHelp/2_70_03.gif b/wxc2_omc/omcHelp/2_70_03.gif new file mode 100755 index 0000000..0c799be Binary files /dev/null and b/wxc2_omc/omcHelp/2_70_03.gif differ diff --git a/wxc2_omc/omcHelp/2_70_04.gif b/wxc2_omc/omcHelp/2_70_04.gif new file mode 100755 index 0000000..b3311ff Binary files /dev/null and b/wxc2_omc/omcHelp/2_70_04.gif differ diff --git a/wxc2_omc/omcHelp/3.htm b/wxc2_omc/omcHelp/3.htm new file mode 100755 index 0000000..6b0f30a --- /dev/null +++ b/wxc2_omc/omcHelp/3.htm @@ -0,0 +1,105 @@ +锘� + + + Performance + + + + + + + + + + + + + + + + + + + + +
      +

      Performance

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      1_010_011_014_021_016_011_012_011_024_011_018_011_020_01

      +

       

      +

      1_109_01

      +

      1_109_02

      +

      1_109_03

      +

      1_109_04

      +

      1_109_05

      +

      1_109_06

      +

      1_109_07

      +

      1_109_08

      +

      1_109_09

      +

      1_109_10

      +

      1_109_11

      +

      1_109_12

      +

      1_109_13

      +

      1_109_14

      +

      1_109_15

      +

      1_109_16

      +

      1_109_17

      +

      1_109_18

      +

      1_109_19

      +

      1_109_20

      +

      1_109_21

      +

      1_109_22

      +

      1_109_23

      +

      1_109_24

      +

      1_109_25

      +

      1_109_26

      +

      1_109_27

      +

      1_109_28

      +

      1_109_29

      +

      1_109_30

      +

       

      +

       

      +

      Optimum traffic conditions can be achieved in the Public Land Mobile Network (PLMN) thanks to an increasingly sophisticated range of variations in network design and traffic routing. This involves the increased intermeshing of the network nodes and thus a greater planning effort. Careful, future-oriented planning makes it possible, in the majority of cases, to avoid traffic bottlenecks and overload situations, even in the face of major traffic fluctuations.

      +

       

      +

      Traffic data acquisition is therefore of decisive importance for the telecommunications carriers with respect to:

      +

      •Traffic Handling

       

      +

      Traffic bottlenecks can be detected as early as possible.

      +

      A consistently high quality of service can be ensured, resulting from the grade of service, call processing performance and transmission quality.

      +

       

      +

      •Traffic Forecasting

       

      +

      Network nodes can be composed for the long-term, demand-oriented expansion of the networks.

      +

       

      +

      Contrary to the systems of older technology, the UltraWAVE system does not require any special equipment for traffic data acquisition. A broad range of intra-system functions is available for the tasks at hand. These functions collect and process traffic data from all parts of the network nodes and trunk groups. For instance, the call processing programs include traffic data registration and specific programs record traffic measurement data.

      +

       

      +

      This chapter describes how to use the statistics archive to monitor and analyze the system traffic profiles. The organized statistics can be displayed in both tables and graphics, and are available for call records, service provisioning and network loading. The EMS server collects the statistics data from all system entities and refreshes the statistics report every 15 minutes. The EMS database stores seven day's statistics profiles.

      +

       

      +

      The PPS daily report provides a daily report about the PPS service including organized statistics information of account, recharge card and call.

      +

       

      +

      The MSC statistics provides call measurement on five bases: Service, Trunk Group, Erlang and BHCA.

      +

       

      +

      The AAS provides recharge and announcement measurements.

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_10.htm b/wxc2_omc/omcHelp/3_10.htm new file mode 100755 index 0000000..4037293 --- /dev/null +++ b/wxc2_omc/omcHelp/3_10.htm @@ -0,0 +1,249 @@ +锘� + + + OPPS + + + + + + + + + + + + + + + + + + + + +
      +

      OPPS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The OPPS statistics include IMDX and OPR information statistics.

      +

       

      +

      •IMDX Service Statistics:

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      OPR Service

      +

      Descriptions

      +

      Manual Registration

      +

      Success

      +

      Quantity of successful manual-registration

      +

      Fail

      +

      Quantity of unsuccessful manual-registration

      +

      Auto Registration

      +

      Success

      +

      Quantity of successful auto-registration

      +

      Fail

      +

      Quantity of unsuccessful auto-registration

      +

      Location Update

      +

      Success

      +

      Quantity of successful location update of OPR users

      +

      Fail

      +

      Quantity of unsuccessful location update of OPR users

      +

      Recycle Account

      +

      Success

      +

      Successful times of reassign expired OPR accounts

      +

      Fail

      +

      Unsuccessful times of reassign expired OPR accounts

      +

      Switch to Roaming

      +

      Success

      +

      Successful times of service mode switch from OPR to Roaming

      +

      Fail

      +

      Unsuccessful times of service mode switch from OPR to Roaming

      +

      Switch to OPR

      +

      Success

      +

      Successful times of service mode switch from Roaming to OPR

      +

      Fail

      +

      Unsuccessful times of service mode switch from Roaming to OPR

      +
      +
      +

       

      +

      •OPR Service Statistics:

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      IMDX Service

      +

      Descriptions

      +

      MO Call

      +

      Private to Private

      +

      Quantity of call attempts from private users to private users.

      +

      Hybrid to Private

      +

      Quantity of call attempts from hybrid users to private users.

      +

      Hybrid to Public

      +

      Quantity of call attempts from hybrid users to public users.

      +

      Ordinary to Public

      +

      Quantity of call attempts from private ordinary users to public users.

      +

      Premium to Public

      +

      Quantity of call attempts from private premium users to public users.

      +

      Public to Private

      +

      Quantity of unsuccessful originating calls from public to private.

      +

      LU

      +

      Private Success

      +

      Quantity of successful location update of private users.

      +

      Private Excluded

      +

      Quantity of unsuccessful location update of private users.

      +

      Hybrid Success

      +

      Quantity of successful location update of hybrid users.

      +

      Hybrid Excluded

      +

      Quantity of unsuccessful location update of hybrid users.

      +

      Public Success

      +

      Quantity of successful location update of public users.

      +

      Public Exclude

      +

      Quantity of unsuccessful location update of public users.

      +
      +
      +

       

      +

      There are two searching tools on the navigator bar: type and date range. Operator can select the following types for the chart generation:

      +

       

      +

      •OPR Registration

       

      +

      •OPR Location Update

       

      +

      •OPR Mode Switch

       

      +

      •IMDX MO Call

       

      +

      •IMDX Location Update

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •IMDX and OPR services daily statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.10

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_11_1.htm b/wxc2_omc/omcHelp/3_11_1.htm new file mode 100755 index 0000000..a200e79 --- /dev/null +++ b/wxc2_omc/omcHelp/3_11_1.htm @@ -0,0 +1,183 @@ +锘� + + + iPALIM - Service + + + + + + + + + + + + + + + + + + + + +
      +

      iPALIM - Service

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The iPALIM statistics provide call measurement on two bases: service and served Trunk Group. The iPALIM service gives an overall statistics report from the iPALIM on the five types of services as detailed in the following table:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      Service Type

      +

      Descriptions

      +

      Location Update

      +

      Location updates originated by Private users.

      +

      Mobile Originated Call

      +

      Calls originated by Private users to Private or Public users.

      +

      Mobile Terminated Call

      +

      Calls originated by Private or Public users to Private users.

      +

      Mobile Originated SM

      +

      SMS originated by Private users to Private or Public users.

      +

      Mobile Terminated SM

      +

      SMS originated by Private or Public users to Private users.

      +
      +
      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Call Failure

      +

      Descriptions

      +

      Caller clear

      +

      This cause indicates that the call is being cleared because the calling subscriber involved in the call has requested that the call be cleared.

      +

      No answer

      +

      This cause is counted when a subscriber has provided an alerting indication but has not provided a connect indication within a prescribed period of time.

      +

      Called Subscriber busy

      +

      This cause is counted when the called subscriber has indicated the inability to accept another call.

      +

      It is noted that the subscriber equipment is compatible with the call.

      +

      Network busy

      +

      This cause indicates that there is no appropriate circuit/channel presently available to handle the call.

      +

      Call deny

      +

      This cause indicates that the MS has tried to access a service that the MS's network operator or service provider is not prepared to allow.

      +

      Signaling error

      +

      This cause is counted when a subscriber does not respond to a call establishment message with either an alerting or connect indication within the prescribed period of time allocated.

      +

      No resource

      +

      This cause is used to report a resource unavailable event only when no other cause in the resource unavailable class applies.

      +

      No service

      +

      This cause is used to report a service or option not available event only when no other cause in the service or option not available class applies.

      +

      Invalid service

      +

      This cause is used to report an invalid service event only when no other cause in the invalid message class applies.

      +

      Invalid message

      +

      This cause is used to report an invalid message event only when no other cause in the invalid message class applies.

      +

      Subscriber error

      +

      This cause is counted when the destination is out of service.

      +

      Message error

      +

      This cause is counted when the origination is out of service or other general data problems.

      +
      +
      +

       

      +

      A statistics histogram about service proportion is provided on this page. The Print logo is for printing out this statistics page. The Date navigator is used to select statistics profile in a time period of the last 30 days for browsing.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •iPALIM overall statistics for different type of services

       

      +

       

      +

       

      +

       

      +

       

      +

      3.11.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_11_2.htm b/wxc2_omc/omcHelp/3_11_2.htm new file mode 100755 index 0000000..d8d7a24 --- /dev/null +++ b/wxc2_omc/omcHelp/3_11_2.htm @@ -0,0 +1,96 @@ +锘� + + + iPALIM - Trunk Group + + + + + + + + + + + + + + + + + + + + +
      +

      iPALIM - Trunk Group

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Trunk Group statistics provides service statistics for each iPALIM Trunk Group. There are statistics table and chart of stacked line or column on this page, as described below:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Item

      +

      Function

      +

      Trunk group statistics

      +

      Services attempt, success, failure, total and average call duration for each trunk group

      +

      Success / Failure

      +

      Percentage of successful services and categories of service failure.

      +

      Attempt diagram

      +

      Histogram for incoming and outgoing call attempt percentage

      +

      Success / Failure diagram

      +

      Histogram of successful services and categories of service failure.

      +
      +
      +

       

      +

      There are two searching tools on the navigator bar: service type and date period. Operator can select a service type (LU, MO Call, MT Call, MO SMS, MT SMS), select the start and end dates of the last seven days to sort out the specific statistics profile. The Print logo is for printing out this statistics page.

      +

       

      +

      Click on the Trunk Group hyperlinked ID can display a more detailed statistics on this specific Trunk Group.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Service statistics for each trunk group of iPALIM

       

      +

       

      +

       

      +

       

      +

       

      +

      3.11.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_12.htm b/wxc2_omc/omcHelp/3_12.htm new file mode 100755 index 0000000..20565d5 --- /dev/null +++ b/wxc2_omc/omcHelp/3_12.htm @@ -0,0 +1,118 @@ +锘� + + + iRLS + + + + + + + + + + + + + + + + + + + + +
      +

      iRLS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The iRLS statistics include:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      iRLS Service

      +

      Descriptions

      +

      Type

      +

      MO, MT or VIM

      +

      Attempt

      +

      Total local switching request attempts

      +

      Success

      +

      Successful local switching attempts

      +

      Operation Fail

      +

      Unsuccessful local switching operation

      +

      Create Channel Fail

      +

      Unsuccessful channel creation attempts

      +

      Connect Channel Fail

      +

      Unsuccessful local channel connection attempts

      +

      Retrieve Fail

      +

      Unsuccessful retrieved exception requests

      +

      Notification Request Fail

      +

      Unsuccessful notification requests

      +
      +
      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •iRLS service statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.12

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_13.htm b/wxc2_omc/omcHelp/3_13.htm new file mode 100755 index 0000000..734a723 --- /dev/null +++ b/wxc2_omc/omcHelp/3_13.htm @@ -0,0 +1,130 @@ +锘� + + + MRFC + + + + + + + + + + + + + + + + + + + + +
      +

      MRFC

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MRFC statistics include:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      MRFC Service

      +

      Descriptions

      +

      Type

      +

      Conferencing or Media Transcoding

      +

      Attempt

      +

      Total media resources processing attempts

      +

      Success

      +

      Successful media resources processing attempts

      +

      No Resource

      +

      Unsuccessful media resources processing caused by no resources from MRFP

      +

      Negotiation Fail

      +

      Unsuccessful transcoding attempts caused by negotiation fail

      +

      Media Error

      +

      Unsuccessful media resources processing caused by media error

      +

      No Response

      +

      Unsuccessful media resources processing attempts caused by no response from the application server

      +

      General Error

      +

      Unsuccessful media resources processing attempts caused by undefined errors

      +

      Total Call Duration (s)

      +

      Total duration of the conference calls

      +

      Average Call Duration (s)

      +

      Average duration of per conference call

      +
      +
      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •MRFC service statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.13

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_14.htm b/wxc2_omc/omcHelp/3_14.htm new file mode 100755 index 0000000..10a39af --- /dev/null +++ b/wxc2_omc/omcHelp/3_14.htm @@ -0,0 +1,202 @@ +锘� + + + MHC + + + + + + + + + + + + + + + + + + + + +
      +

      MHC

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MHC gives an overall statistics report on the types of services as detailed in the following table:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      MHC Service

      +

      Descriptions

      +

      HLR Notify MHC

      +

      Number of notification messages sent from local HLR to MHC.

      +

      MHC Notify HLR

      +

      Number of notification messages sent from local MHC to HLR.

      +

      Replication Attempt

      +

      Number of attempted HLR data replication occurred on this node.

      +

      Replication Success

      +

      Number of successful HLR data replication occurred on this node.

      +

      Replication Fail

      +

      Number of unsuccessful HLR data replication occurred on this node.

      +

      Verification Attempt

      +

      Number of attempted HLR data verification occurred on this node.

      +

      Verification Success

      +

      Number of successful HLR data verification occurred on this node.

      +

      Verification Fail

      +

      Number of unsuccessful HLR data verification occurred on this node.

      +

      Verification Deleted Attempt

      +

      Number of HLR subscriber deletion attempts occurred on this node according to the verification results.

      +

      Verification Deleted Success

      +

      Number of HLR subscriber deleted from this node according to the verification results.

      +

      Verification Deleted Fail

      +

      Number of unsuccessful HLR subscriber deletion occurred on this node.

      +

      Verification Download Attempt

      +

      Number of HLR subscriber creation attempts occurred on this node according to the verification results.

      +

      Verification Download Success

      +

      Number of HLR subscriber created in this node according to the verification results.

      +

      Verification Download Fail

      +

      Number of unsuccessful HLR subscriber creation occurred on this node.

      +

      MHC Message Sent

      +

      Total number of messages sent from this MHC to other nodes.

      +

      MHC Message Received

      +

      Total number of messages received by this MHC.

      +

      Synch Outgoing Attempt

      +

      Total number of synch messages sent from the specific node to the local node.

      +

      Synch Outgoing Success

      +

      Number of synch messages received by the local node.

      +

      Synch Outgoing Fail

      +

      Number of synch messages lost in the transmission.

      +

      Synch Incoming Attempt

      +

      Total number of synch messages sent from the local node to the specific node.

      +

      Synch Incoming Success

      +

      Number of synch messages received by the specific node.

      +

      Synch Incoming Fail

      +

      Number of synch messages lost in the transmission.

      +
      +
      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •MHC service statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.14

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_15.htm b/wxc2_omc/omcHelp/3_15.htm new file mode 100755 index 0000000..2d3a976 --- /dev/null +++ b/wxc2_omc/omcHelp/3_15.htm @@ -0,0 +1,178 @@ +锘� + + + iGRS + + + + + + + + + + + + + + + + + + + + +
      +

      iGRS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The iGRS statistics include BSS and SGSN two parts:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      iGRS Service

      +

      Descriptions

      +

      BSS

      +

      Signaling

      +

      Sent Messages

      +

      Number of outbound signaling messages to BSS.

      +

      Recv Messages

      +

      Number of inbound signaling messages from BSS.

      +

      Sent Bytes

      +

      Data volume of outbound signaling messages to BSS.

      +

      Recv Bytes

      +

      Data volume of inbound signaling messages from BSS.

      +

      Data

      +

      Sent Packets

      +

      Number of transmitted data packets to BSS.

      +

      Recv Packets

      +

      Number of received data packets from BSS.

      +

      Sent Bytes

      +

      Data volume of transmitted data packets to BSS.

      +

      Recv Bytes

      +

      Data volume of received data packets from BSS.

      +

      SGSN

      +

      Signaling

      +

      Sent Messages

      +

      Number of outbound signaling messages to SGSN.

      +

      Recv Messages

      +

      Number of inbound signaling messages from SGSN.

      +

      Sent Bytes

      +

      Data volume of outbound signaling messages to SGSN.

      +

      Recv Bytes

      +

      Data volume of inbound signaling messages from SGSN.

      +

      Data

      +

      Sent Packets

      +

      Number of transmitted data packets to SGSN.

      +

      Recv Packets

      +

      Number of received data packets from SGSN.

      +

      Sent Bytes

      +

      Data volume of transmitted data packets to SGSN.

      +

      Recv Bytes

      +

      Data volume of received data packets from SGSN.

      +
      +
      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •iGRS service statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.15

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_16.htm b/wxc2_omc/omcHelp/3_16.htm new file mode 100755 index 0000000..239291f --- /dev/null +++ b/wxc2_omc/omcHelp/3_16.htm @@ -0,0 +1,88 @@ +锘� + + + TMG + + + + + + + + + + + + + + + + + + + + +
      +

      Trunk Media Gateway

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Trunk Media Gateway statistics include RTP data volume on E1 basis:

      +

       

      +
      + + + + + + + + + + + + + + + + +

      TMG Service

      +

      Descriptions

      +

      RTP Packets Lost

      +

      The loss of inbound RTP packets.

      +

      RTP Packets Received

      +

      Number of received RTP packets

      +

      RTP Packets Sent

      +

      Number of sent RTP packets

      +
      +
      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Trunk Media Gateway service statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.16

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_17.htm b/wxc2_omc/omcHelp/3_17.htm new file mode 100755 index 0000000..d789424 --- /dev/null +++ b/wxc2_omc/omcHelp/3_17.htm @@ -0,0 +1,88 @@ +锘� + + + AMRMG + + + + + + + + + + + + + + + + + + + + +
      +

      AMR Media Gateway

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The AMR Media Gateway statistics include RTP data volume on E1 basis:

      +

       

      +
      + + + + + + + + + + + + + + + + +

      AMR MG Service

      +

      Descriptions

      +

      RTP Packets Lost

      +

      The loss of inbound RTP packets

      +

      RTP Packets Received

      +

      Number of received RTP packets

      +

      RTP Packets Sent

      +

      Number of sent RTP packets

      +
      +
      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •AMR Media Gateway service statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.17

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_1_1.htm b/wxc2_omc/omcHelp/3_1_1.htm new file mode 100755 index 0000000..1ed9f69 --- /dev/null +++ b/wxc2_omc/omcHelp/3_1_1.htm @@ -0,0 +1,189 @@ +锘� + + + PPS Report - Daily + + + + + + + + + + + + + + + + + + + + +
      +

      PPS Report - Daily

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The PPS daily report provides organized daily statistics reports based on prepaid account, recharge card, call charge, GPRS charge, and account summary in five dedicated tables.

      +

       

      +

      PPS daily report - Account report

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Account Statistics

      +

      Descriptions

      +

      Fresh

      +

      Quantity of fresh account which exists in the PPS but is not used. Fresh account can be automatically changed to In use account after the first recharge

      +

      In use

      +

      Quantity of normally used account

      +

      Suspended

      +

      Quantity of account suspended from service provisioning

      +

      Black list

      +

      Quantity of black list account which is prohibited from service provisioning because of crossing the recharge failure threshold. The black list account can recover In use account by operator

      +

      Released

      +

      Quantity of the released account

      +

      Total

      +

      Total = Fresh + In use + Suspended + Black list + Released

      +
      +
      +

       

      +

       

      +

      PPS daily report - Recharge card

      +

       

      +

      The recharge card statistics includes the statistics of all recharge cards with different face value.

      +

       

      +
      + + + + + + + + + + + + +

      Recharge Card Statistics

      +

      Descriptions

      +

      Today Used

      +

      Total number of recharge cards have been used today

      +

      Unused

      +

      Total number of the fresh recharge cards that are not used

      +
      +
      +

       

      +

       

      +

      PPS daily report - Call statistics

      +

       

      +

      The call statistics provides charge statistics including Quantity, Duration and Charge statistics for the following categories of call: Incoming, IDD, NDD, Local call, Short message via MS and web, Conference call, rent and operator charge.

      +

       

      +

      Total charge = Incoming + IDD + NDD + Local call + Short message + Short message via web + Conference call + Rent + Operator charge

      +

       

      +

       

      +

      PPS daily report - GPRS statistics

      +

       

      +

      The GPRS statistics provides statistics of GPRS service volume (KB) and total online duration (s).

      +

       

      +

       

      +

      PPS daily report - Account summary

      +

       

      +

      The account summary summarizes the balance and recharge for all accounts.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Account Overview

      +

      Descriptions

      +

      Yesterday balance

      +

      Total balance of all accounts yesterday

      +

      Today recharge

      +

      Total amount of money recharged to all accounts today

      +

      Today charge

      +

      Total charge for all calls today

      +

      Total balance

      +

      Total balance of all accounts today

      +
      +
      +

       

      +

      The account overview statistics complies with the following formulas:

      +

       

      +

      •Yesterday balance + Today recharge = Today charge + Total balance

       

      +

      •Today recharge (Account summary) = Used today (Recharge card)

       

      +

      •Today charge (Account summary) = Total charge (Call statistics)

       

      +

       

      +

      Functionalities

      +

       

      +

      •Organized daily statistics overview based on prepaid account, recharge card, charge and account.

       

      +

       

      +

       

      +

       

      +

       

      +

      3.1.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_1_2.htm b/wxc2_omc/omcHelp/3_1_2.htm new file mode 100755 index 0000000..24ac4a7 --- /dev/null +++ b/wxc2_omc/omcHelp/3_1_2.htm @@ -0,0 +1,56 @@ +锘� + + + PPS Report - Weekly  + + + + + + + + + + + + + + + + + + + + +
      +

      PPS Report - Weekly

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The five statistics tables (Account report, Recharge card, Call statistics, GPRS statistics and Account summary) of the weekly report are same as those of the Daily report except that the statistics basis is a week instead of a day. One year has 52 weeks. The week number ranges between 1 and 52.

      +

       

      +

      The PPS weekly report presents four statistics diagrams:

      +

      •Call charge statistics of each day (from Sunday to Saturday) of a week.

      •Used recharge card (all face value recharge card) statistics of each day (from Sunday to Saturday) of a week.

      •Call charge statistics of latest five weeks.

      •Used recharge card (all face value recharge card) statistics of latest five weeks.

       

      +

       

      +

       

      +

       

      +

       

      +

      3.1.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_1_3.htm b/wxc2_omc/omcHelp/3_1_3.htm new file mode 100755 index 0000000..9dd4673 --- /dev/null +++ b/wxc2_omc/omcHelp/3_1_3.htm @@ -0,0 +1,56 @@ +锘� + + + PPS Report - Monthly + + + + + + + + + + + + + + + + + + + + +
      +

      PPS Report - Monthly

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The five statistics tables (Account report, Recharge card, Call statistics, GPRS statistics and Account summary) of the monthly report are same as those of the Daily report except that the statistics basis is a month instead of a day.

      +

       

      +

      The PPS weekly report presents four statistics diagrams:

      +

      •Call charge statistics of each day of a month.

      •Used recharge card (all face value recharge card) statistics of each day of a month.

      •Call charge statistics of each month (from January to December) of a year.

      •Used recharge card (all face value recharge card) statistics of each month (from January to December) of a year.

       

      +

       

      +

       

      +

       

      +

       

      +

      3.1.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_2_1.htm b/wxc2_omc/omcHelp/3_2_1.htm new file mode 100755 index 0000000..471e74f --- /dev/null +++ b/wxc2_omc/omcHelp/3_2_1.htm @@ -0,0 +1,210 @@ +锘� + + + MSC - Service + + + + + + + + + + + + + + + + + + + + +
      +

      MSC - Service

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MSC measurement gives overall call statistics reports from MSC on traffic service, traffic based on trunk and trunk group, Erlang, and BHCA.

      +

       

      +

      The granularity period, which is the time between the successive gatherings of measurement data, is 15 minutes. That means the statistics reports on the EMS GUI will be updated in every 15 minutes. There are up to 30 days' statistics reports can be checked via the EMS, and the searching interval is on a daily basis. Each statistics on a daily basis can be specified by 24 hours which lie between 00:00 and 24:00.

      +

       

      +

      All statistics reports generated by EMS have the same layout, including cross tabulation and charts of stacked line or column:

      +

       

      +

      •Cross tabulation:

       

      +

      The vertical section classifies the measure objects or time intervals.

      +

      The horizontal section defines the results or time intervals.

      +

       

      +

      •Stacked Line:

       

      +

      Displays the trend of the percentage each value contributes over time and categories.

      +

       

      +

      •Stacked Column:

       

      +

      Compares the percentage each value contributes to a total across categories.

      +

       

      +

      The MSC service gives an overall call statistics report from MSC on the 12 types of call described below.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Call Type

      +

      Descriptions

      +

      Subs to Subs

      +

      Mobile originating traffics to mobile.

      +

      Subs to Trunk

      +

      Mobile originating traffics to PSTN.

      +

      Trunk to Subs

      +

      PSTN originating traffics to mobile.

      +

      Trunk to Trunk

      +

      Transit and intra-connected traffics.

      +

      Intra Connection

      +

      Traffics on the intra-connected trunks.

      +

      Subs to IP

      +

      Mobile originating traffics to Intelligent Peripheral.

      +

      Trunk to IP

      +

      PSTN originating traffics to Intelligent Peripheral.

      +

      Mobile Originated

      +

      Mobile originating traffics to mobile, PSTN, Intelligent Peripheral, or intra-connected trunks.

      +

      Mobile Terminated

      +

      Mobile terminating traffics from mobile or PSTN.

      +

      In Trunk

      +

      Incoming PSTN traffics.

      +

      Out Trunk

      +

      Outgoing PSTN traffics.

      +

      IP Terminated

      +

      Intelligent Peripheral terminating traffics from mobile or PSTN.

      +
      +
      +

       

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Call Failure

      +

      Descriptions

      +

      Call Deny

      +

      This cause indicates that the MS has tried to access a service that the MS's network operator or service provider is not prepared to allow. It may be caused by the following reasons:

      +

      •Unassigned (unallocated) number

      •No route to destination

      •Channel unacceptable

      •Operator determined barring

      •Number changed

      •Non-selected user clearing

      •Invalid number format (incomplete number)

      •Facility rejected

      •Response to STATUS ENQUIRY

      •Normal, unspecified

      •Quality of service unavailable

      •Requested facility not subscribed

      •Incoming calls barred within the CUG

      •Bearer capability not authorized

      •Bearer capability not presently available

      •Service or option not available, unspecified

      •ACM equal to or greater than ACMmax

      •Bearer service not implemented

      •Requested facility not implemented

      •Only restricted digital information bearer capability is available

      •Service or option not implemented, unspecified

      Net Busy

      +

      Network Busy indicates that there is no appropriate circuit/channel presently available to handle the call. It may be caused by the following reasons:

      +

      •Destination out of order

      •No circuit/channel available

      •Network out of order

      •Temporary failure

      •Switching equipment congestion

      •Access information discarded

      •Requested circuit/channel not available

      •Resource unavailable, unspecified

      Caller Clear

      +

      This cause indicates that the call is being cleared because the calling subscriber involved in the call has requested that the call be cleared.

      +

      Sub Busy

      +

      Subscriber Busy is counted when the called subscriber has indicated the inability to accept another call. It may be caused by the following reasons:

      +

      •User busy

      •Call rejected

      •Pre-emption

      No Answer

      +

      This cause is counted when a subscriber has provided an alerting indication but has not provided a connect indication within a prescribed period of time. It may be caused by the following reasons:

      +

      •No user responding

      •User alerting, no answer

      Signal Error

      +

      This cause is counted by the following reasons:

      +

      •Invalid transaction identifier value

      •User not member of CUG

      •Incompatible destination

      •Invalid transit network selection

      •Semantically incorrect message

      •Invalid mandatory information

      •Message type non-existent or not implemented

      •message type not compatible with protocol state

      •Information element non-existent or not implemented

      •Conditional IE error

      •Message not compatible with protocol state

      •Recovery on timer expiry

      •Protocol error, unspecified

      •Interworking, unspecified

      +
      +

       

      +

       

      +

      There are ten statistics items for each type of call: call attempt, call answer, six categories of call failure, total and average call duration. The statistics is collected on both quantity and percentage basis, and concluded by the following formula:

      +

      •Total Call = Sum of Call Attempt

      •Attempt = Success + Call Deny + Net Busy + Caller Clear + Sub Busy + No Answer + Signal Error

      •Average Call Duration = Total Call Duration / Success

       

      +

      Two statistics histograms about call attempt and call answer / failure are provided on this page.

      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •MSC overall call statistics for different type of calls

       

      +

       

      +

       

      +

       

      +

       

      +

      3.2.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_2_2.htm b/wxc2_omc/omcHelp/3_2_2.htm new file mode 100755 index 0000000..79b464a --- /dev/null +++ b/wxc2_omc/omcHelp/3_2_2.htm @@ -0,0 +1,107 @@ +锘� + + + MSC - Trunk Group + + + + + + + + + + + + + + + + + + + + +
      +

      MSC - Trunk Group

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MSC Trunk Group statistics provides outgoing and incoming call statistics for each Trunk Group. There are two statistics tables and two charts of stacked line or column on this page, as described below:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +

      Item

      +

      Function

      +

      Formula

      +

      Trunk group statistics

      +

      Call attempt, call successful, call failure, total and average call duration for each trunk group

      +

      Attempt = incoming call attempt + outgoing call attempt

      +

      Attempt = Success + Call deny + Net busy + Caller clear + Sub busy + No Answer + Signal error

      +

      Answer / Failure

      +

      Percentage of call answer and six categories of call failure for incoming and outgoing call

      +

      Attempt = Success + Call deny + Net busy + Caller clear + Sub busy + No Answer + Signal error

      +

      Attempt diagram

      +

      Histogram for incoming and outgoing call attempt percentage

      +

      Attempt = incoming call attempt + outgoing call attempt

      +

      Answer / Failure diagram

      +

      Histogram for call answer and call failure for incoming and outgoing call

      +

      Attempt = Success + Call deny + Net busy + Caller clear + Sub busy + No Answer + Signal error

      +
      +
      +

       

      +

      There are two searching tools on the navigator bar: call type and date range. Operator can select a call type (incoming, outgoing, both incoming and outgoing), select up to the last 30 days to sort out the specific statistics profile. The Print logo is for printing out this statistics page.

      +

       

      +

      Click on the Trunk Group hyperlinked ID can display a more detailed statistics on this specific Trunk Group based on per hour.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Outgoing and incoming call statistics for each trunk group of MSC

       

      +

       

      +

       

      +

       

      +

       

      +

      3.2.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_2_4.htm b/wxc2_omc/omcHelp/3_2_4.htm new file mode 100755 index 0000000..67f73f4 --- /dev/null +++ b/wxc2_omc/omcHelp/3_2_4.htm @@ -0,0 +1,102 @@ +锘� + + + MSC - Erlang + + + + + + + + + + + + + + + + + + + + +
      +

      MSC - Erlang

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Erlang statistics of MSC is collected on two bases: Service or Trunk Group.

      +

       

      +

      •Service Erlang: The total duration (unit is hour) of a certain type of call that took place in the system on an hour basis.

       

      +

      •Trunk Group Erlang: The total duration (unit is hour) of all calls that routed out (in) from each trunk group on an hour basis.

       

      +

      There is a chart of stacked line for each Erlang statistics as described below:

      +

       

      +
      + + + + + + + + + + + + + + + +

      Erlang

      +

      X-coordinate

      +

      Y-coordinate (unit=hour)

      +

      Service

      +

      No. of the time period

      +

      Duration of trunk to mobile calls

      +

      Duration of trunk to trunk calls

      +

      Duration of mobile to mobile calls

      +

      Duration of mobile to trunk calls

      +

      Duration of mobile originated calls

      +

      Duration of mobile terminated calls

      +

      Duration of incoming trunk calls

      +

      Duration of outgoing trunk calls

      +

      Duration of mobile to intelligent peripheral calls

      +

      Duration of trunk to intelligent peripheral calls

      +

      Duration of intelligent peripheral terminated calls

      +

      Trunk group

      +

      No. of the time period

      +

      Duration of all calls on the specified trunk group

      +
      +
      +

       

      +

      There are two searching tools on the navigator bar: bases type and date range. Operator can select bases type (Service or Trunk Group), select up to the last 30 days to sort out the specific statistics profile. When Trunk Group is selected, a text box will be displayed for entering one or multiple TG number (separated by ",") for the following chart generation. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •MSC Erlang statistics on service and trunk group basis.

       

      +

       

      +

       

      +

       

      +

       

      +

      3.2.4

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_2_5.htm b/wxc2_omc/omcHelp/3_2_5.htm new file mode 100755 index 0000000..3440425 --- /dev/null +++ b/wxc2_omc/omcHelp/3_2_5.htm @@ -0,0 +1,103 @@ +锘� + + + MSC - BHCA + + + + + + + + + + + + + + + + + + + + +
      +

      MSC - BHCA

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The BHCA statistics of MSC is collected on two bases: Service or Trunk Group.

      +

       

      +

      •Service BHCA: The total quantity of a certain type of call that took place in the system on an hour basis.

       

      +

      •Trunk Group BHCA: The total quantity of all calls that routed out (in) from each trunk group on an hour basis.

       

      +

      There is a chart of stacked line for each BHCA statistics as described below:

      +

       

      +
      + + + + + + + + + + + + + + + +

      BHCA

      +

      X-coordinate

      +

      Y-coordinate (unit=hour)

      +

      Service

      +

      No. of the time period

      +

      Quantity of trunk to mobile calls

      +

      Quantity of trunk to trunk calls

      +

      Quantity of mobile to mobile calls

      +

      Quantity of mobile to trunk calls

      +

      Quantity of mobile originated calls

      +

      Quantity of mobile terminated calls

      +

      Quantity of incoming trunk calls

      +

      Quantity of outgoing trunk calls

      +

      Quantity of mobile to intelligent peripheral calls

      +

      Quantity of trunk to intelligent peripheral calls

      +

      Quantity of intelligent peripheral terminated calls

      +

      Trunk group

      +

      No. of the time period

      +

      Quantity of all calls from one trunk group

      +
      +
      +

       

      +

       

      +

      There are two searching tools on the navigator bar: bases type and date range. Operator can select bases type (Service or Trunk Group), select up to the last 30 days to sort out the specific statistics profile. When Trunk Group is selected, a text box will be displayed for entering one or multiple TG number (separated by ",") for the following chart generation. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •MSC BHCA statistics on daily basis

       

      +

       

      +

       

      +

       

      +

       

      +

      3.2.5

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_3.htm b/wxc2_omc/omcHelp/3_3.htm new file mode 100755 index 0000000..52ab863 --- /dev/null +++ b/wxc2_omc/omcHelp/3_3.htm @@ -0,0 +1,165 @@ +锘� + + + SMSC + + + + + + + + + + + + + + + + + + + + +
      +

      SMSC

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The SMSC service statistics include a cross tabulation and charts of stacked column:

      +

       

      +

      •The vertical section classifies the direction and destination of the short messages:

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      SMSC Traffic

      +

      Descriptions

      +

      MS to SMSC

      +

      MO SMS, from originating MS to SMSC

      +

      SMSC to MS

      +

      MT SMS, from SMSC to terminating MS

      +

      VSS to SMSC

      +

      SMS request (for notification of new voice message) from VSS

      +

      SMSC to VSS

      +

      SMS transferred from SMSC to VSS

      +

      PPS to SMSC

      +

      SMS request (for notification after recharge or inquiry) from PPS

      +

      SMSC to PPS

      +

      SMS transferred from SMSC to PPS

      +

      SMPP to SMSC

      +

      SMS request from other devices using SMPP connection

      +

      SMSC to SMPP

      +

      SMS transferred from SMSC to other devices using SMPP connection

      +
      +
      +

       

      +

      •The horizontal section defines the statistic types of the short messages.

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      SMSC Statistics

      +

      Descriptions

      +

      Attempt

      +

      Total SMS or SMS request attempts

      +

      Success

      +

      Successful SMS or SMS request

      +

      Failed

      +

      Unsuccessful SMS or SMS request caused by the following reasons:

      +

      •Unassigned (unallocated) number

      •Unidentified subscriber

      •Unknown subscriber

      •Requested facility not subscribed

      •Requested facility not implemented

      •Network failure

      •Congestion

      •Invalid short message transfer reference value

      •Semantically incorrect message

      •Invalid mandatory information

      •Message type non-existent or not implemented

      •Message not compatible with short message protocol state

      •Information element non-existent or not implemented

      •Protocol error, unspecified

      •Interworking, unspecified

      •Destination out of order

      •Network out of order

      •Temporary failure

      •Congestion

      •Resources unavailable, unspecified

      Total Bytes

      +

      Total transferred data of SMS.

      +

      Success Percentage

      +

      Success rate of SMS or SMS request, Success Percentage = Success / Attempt

      +
      +
      +

       

      +

       

      +

      The Pending SM when beginning statistics means the quantity of pending short message at midnight (begin time of a statistics day). The Pending SM when ending statistics means the quantity of pending short message when the latest statistics is generated (every 15 minutes).

      +

       

      +

      SMSC received = SMSC sent + (Pending SM when ending statistics - Pending SM when beginning statistics)

      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •SMSC service daily statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_4_1.htm b/wxc2_omc/omcHelp/3_4_1.htm new file mode 100755 index 0000000..3518976 --- /dev/null +++ b/wxc2_omc/omcHelp/3_4_1.htm @@ -0,0 +1,122 @@ +锘� + + + BSS - TCH + + + + + + + + + + + + + + + + + + + + +
      +

      BSS - TCH

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The TCH (Traffic Channel) statistics include:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Items

      +

      Descriptions

      +

      BTS ID

      +

      BTS identifier

      +

      Cell ID

      +

      Cell identifier

      +

      MO Call

      +

      This measurement provides the total number of Channel Request procedures used for Mobile Originating Call.

      +

      MT Call

      +

      This measurement provides the total number of Channel Request procedures used for Response to Paging.

      +

      Location Update

      +

      This counter provides the total number of Location Update procedure accepted by the MSC.

      +

      Supplementary Service

      +

      This counter provides the total number of Supplementary Service procedure accepted by the MSC.

      +

      TCH Attempt

      +

      This measurement provides the number of attempted TCH seizures.

      +

      TCH Success

      +

      This measurement provides the number of successful TCH seizures.

      +

      RF Failure

      +

      This counter provides the total number of call blocking because of a failure to get a TCH channel.

      +
      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •TCH daily statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.4.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_4_2.htm b/wxc2_omc/omcHelp/3_4_2.htm new file mode 100755 index 0000000..0c497b6 --- /dev/null +++ b/wxc2_omc/omcHelp/3_4_2.htm @@ -0,0 +1,104 @@ +锘� + + + BSS - SDCCH + + + + + + + + + + + + + + + + + + + + +
      +

      BSS - SDCCH

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The SDCCH (Signaling Channel) statistics include:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Items

      +

      Descriptions

      +

      BTS ID

      +

      BTS identifier

      +

      Cell ID

      +

      Cell identifier

      +

      SDCCH Attempt

      +

      This measurement provides the number of attempted immediate assignment procedures.

      +

      SDCCH Failure

      +

      This measurement provides the number of attempted SDCCH seizures that result in the MS being refused access to the channel.

      +

      RF Failure

      +

      This measurement provides the number of RF failure while using the SDCCH.

      +

      Abis Failure

      +

      This measurement provides the number of SDCCH Abis link problems.

      +
      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •SDCCH daily statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.4.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_4_3.htm b/wxc2_omc/omcHelp/3_4_3.htm new file mode 100755 index 0000000..4ba152d --- /dev/null +++ b/wxc2_omc/omcHelp/3_4_3.htm @@ -0,0 +1,64 @@ +锘� + + + BSS - Erlang + + + + + + + + + + + + + + + + + + + + +
      +

      BSS - Erlang

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Traffic in Erlangs Erlangs = meanTCHBusyTime * nbrOfAvailableTCHs * 0.01 / (60*60)

      +

       

      +

      •Mean TCH Busy Time

       

      +

      This statistic provides the arithmetic mean of the busy time for TCHs in a cell, i.e. the time the channels have been occupied. This statistic is obtained by accumulating each TCHs busy time. Time stamp will be stored at the time BSC allocates a TCH. When the channel is released the TCH busy time is the difference of the current time and the stored time. This time will be added to a total maintained in the BTS object. At the time of reporting the mean will be calculated as total TCH busy time / number of available TCHs.

      +

       

      +

      •Number of Available Traffic (TCH) Channels

       

      +

      This measurement provides the number of TCHs which are available for use (including those which are actually in use). This measurement reflects the value at the last sampling interval. This gauge will be incremented when the TCH becomes available and decremented when it becomes unavailable. The TCH is available when the administrative state is unlocked, enabled, online or shutting down, and is unavailable when its administrative state changes to locked. The gauge value equals the number of TCHs with an administrative state of unlocked or shutting down.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •BSS Erlang statistics on Cell basis.

       

      +

       

      +

       

      +

       

      +

       

      +

      3.4.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_4_4.htm b/wxc2_omc/omcHelp/3_4_4.htm new file mode 100755 index 0000000..c60c1ab --- /dev/null +++ b/wxc2_omc/omcHelp/3_4_4.htm @@ -0,0 +1,94 @@ +锘� + + + BSS - Quality + + + + + + + + + + + + + + + + + + + + +
      +

      BSS - Quality

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The quality of the radio network mainly indicates the network's ability to meet the coverage and capacity targets. The quality of the radio network can be evaluated by examining the received signal level and signal quality.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + +

      Radio Quality

      +

      Descriptions

      +

      BTS ID

      +

      BTS identifier

      +

      Cell ID

      +

      Cell identifier

      +

      UL / DL Rx Level

      +

      Rx Level is a indicator on how good the signal reception is for the moment.

      +

      The values displayed is from 0 to 63:

      +

      •0 is a signal strength of -110dBm.

      •63 is approx -45 to -50dBm.

      UL / DL Rx Quality

      +

      Rx Quality is a measurement of how much error correction is required to the speech.

      +

      The values displayed is from 0 to 7:

      +

      •0 indicates none.

      •If the value is more than 5, it is on good way to loose call.

      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Radio quality statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.4.4

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_4_5.htm b/wxc2_omc/omcHelp/3_4_5.htm new file mode 100755 index 0000000..fca4017 --- /dev/null +++ b/wxc2_omc/omcHelp/3_4_5.htm @@ -0,0 +1,85 @@ +锘� + + + BSS - Handover + + + + + + + + + + + + + + + + + + + + +
      +

      BSS - Handover

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      This BSS handover statistics provide the statistic of internal Handover on a per BSC basis. It includes intra-CELL as well as inter-CELL Handover:

      +

       

      +

      Inter-Cell Handover

      +

       

      +

       

      +

      •Attempted Outgoing Internal Inter-Cell Handover

       

      +

      This measurement provides the number of attempted Intra BSS Handover on a per cell basis. This measurement is incremented when the BSC generates an internal handover request for intra BSS (Inter Cell only) handover. This is equal to the number of handover commands sent to the MS for inter cell handover.

      +

       

      +

      •Unsuccessful Outgoing Internal Inter-Cell Handover, With Re-Establishment on the Serving Cell

       

      +

      This measurement provides the number of unsuccessful handover (with successful reestablishment on the old channel), for the observed CELL. It counts only inter-CELL Handover. Receipt of 鈥淗ANDOVER FAILURE鈥� message followed by successful reestablishment (GSM 04.08)

      +

       

      +

      •Unsuccessful Outgoing Internal Inter-Cell Handover, Without Re-Establishment on the Serving Cell

       

      +

      This measurement provides the number of unsuccessful outgoing internal inter-cell handover (WITHOUT reestablishment on the serving cell). Expiry of timer T3103 for inter CELL handover (GSM 04.08)

      +

       

      +

      •Successful Incoming Internal Inter CELL Handover

       

      +

      This measurement provides the number of successful incoming handover into the observed CELL from the related adjacent CELLs controlled by the same BSC. Receipt of a 鈥淗ANDOVER COMPLETE鈥� message from the MS in the new (OBSERVED) cell.

      +

       

      +

      •Unsuccessful Incoming Internal Inter-Cell Handover

       

      +

      This statistic provides the number of failed handover attempts from the observed cell to the related adjacent cells controlled by the same BSC. This statistic is incremented by one for each failed incoming handover in the destination cell.

      +

       

      +

       

      +

      Intra-Cell Handover

      +

       

      +

      •Successful Internal Handover, Intra-CELL, Per BSC

       

      +

      This measurement provides the number of times a call moves from the occupied channel of the CELL to another free channel of the same CELL, on a per BSC basis. Transmission of a HANDOVER PERFORMED message to the MSC (GSM 08.08)

      +

       

      +

      •Unsuccessful Internal Handover, Intra-CELL, Per BSC

       

      +

      This measurement provides the number of unsuccessful intra CELL Handover i.e. an attempt was made to move a call from the occupied channel of the CELL to another free channel of the same CELL, on per BSC basis. Receipt of ASSIGNMENT FAILURE during internal handover.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •BSS Handover statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.4.5

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_5.htm b/wxc2_omc/omcHelp/3_5.htm new file mode 100755 index 0000000..8dc37d2 --- /dev/null +++ b/wxc2_omc/omcHelp/3_5.htm @@ -0,0 +1,138 @@ +锘� + + + VSS + + + + + + + + + + + + + + + + + + + + +
      +

      VSS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The VSS statistics include Voice Mail service and ISUP traffic statistics information.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Service Statistics

      +

      Descriptions

      +

      VSS

      +

      Leave Message

      +

      Attempt

      +

      Times of leaving message attempt

      +

      Success

      +

      Times of leaving message successfully

      +

      Maintain Message

      +

      Attempt

      +

      Times of maintaining message attempt

      +

      Success

      +

      Times of maintaining message successfully

      +

      Access

      +

      Fail

      +

      Times of failed to access voice mailbox

      +

      ISUP

      +

      Original

      +

      Attempt

      +

      Number of VSS originating call attempt

      +

      Success

      +

      Number of successful VSS originating call

      +

      Terminal

      +

      Attempt

      +

      Number of VSS terminating call attempt

      +

      Success

      +

      Number of successful VSS terminating call

      +
      +
      +

       

      +

      The System ID navigator is used to select a VSS from the drop-down list. The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •VSS service daily statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.5

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_8.htm b/wxc2_omc/omcHelp/3_8.htm new file mode 100755 index 0000000..c7d6e2c --- /dev/null +++ b/wxc2_omc/omcHelp/3_8.htm @@ -0,0 +1,104 @@ +锘� + + + AAS + + + + + + + + + + + + + + + + + + + + +
      +

      AAS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The AAS statistics include PPS and MSC service calls statistics information.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Service Statistics

      +

      Descriptions

      +

      PPS Service

      +

      Attempt

      +

      Quantity of total call attempts from PPS for balance querying and recharging.

      +

      Success

      +

      Quantity of success calls from PPS.

      +

      MSC Service

      +

      Attempt

      +

      Quantity of total call attempts from MSC for unattainable call announcement.

      +

      Success

      +

      Quantity of success calls from MSC.

      +

      Invalid Call

      +

      Number of invalid announcement request

      +
      +
      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •AAS service daily statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.8

      + +
      + + + diff --git a/wxc2_omc/omcHelp/3_9.htm b/wxc2_omc/omcHelp/3_9.htm new file mode 100755 index 0000000..93d7336 --- /dev/null +++ b/wxc2_omc/omcHelp/3_9.htm @@ -0,0 +1,136 @@ +锘� + + + SMEG + + + + + + + + + + + + + + + + + + + + +
      +

      SMEG

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The SMEG statistics include Email service and SMS service statistics information.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Service Statistics

      +

      Descriptions

      +

      Email

      +

      Incoming

      +

      Attempt

      +

      Number of incoming Email attempt from Email Server to SMEG

      +

      Success

      +

      Number of accepted incoming Email

      +

      Outgoing

      +

      Attempt

      +

      Number of outgoing Email attempt from SMEG to Email Server

      +

      Success

      +

      Number of Email sent successfully

      +

      SMS

      +

      Incoming

      +

      Attempt

      +

      Number of incoming SMS attempt from SMSC to SMEG

      +

      Success

      +

      Number of accepted incoming SMS

      +

      Outgoing

      +

      Attempt

      +

      Number of outgoing SMS attempt from SMEG to SMSC

      +

      Success

      +

      Number of SMS sent successfully

      +

      Total Message Length

      +

      Total transferred data of Email and SMS

      +
      +
      +

       

      +

      The Date navigator is used to select up to the last 30 days' statistics for browsing and printing. The Print logo is for printing out this statistics page.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •SMEG service daily statistics

       

      +

       

      +

       

      +

       

      +

       

      +

      3.9

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4.htm b/wxc2_omc/omcHelp/4.htm new file mode 100755 index 0000000..898b72d --- /dev/null +++ b/wxc2_omc/omcHelp/4.htm @@ -0,0 +1,74 @@ +锘� + + + Log + + + + + + + + + + + + + + + + + + + + +
      +

      Log

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      1_010_011_014_011_016_021_012_011_024_011_018_011_020_01

      +

       

      +

      1_111_01

      +

      1_111_02

      +

      1_111_03

      +

      1_111_04

      +

      1_111_05

      +

      1_111_06

      +

      1_111_07

      +

      1_111_08

      +

      1_111_09

      +

      1_111_10

      +

      1_111_11

      +

      1_111_12

      +

       

      +

      The UltraWAVE system provides preview, download and printout for real time log files: Alarm Log, Operation Log, MSC CDR, PPS CDR, SMSC CDR, etc.

      +

       

      +

      The Alarm Log provides five categories of real time alarms from all system entities.

      +

       

      +

      The Operation Log provides the real time log files of all operation events.

      +

       

      +

      The MSC, PPS and SMSC CDR provides real time standard CDR.

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      4

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_002.gif b/wxc2_omc/omcHelp/4_002.gif new file mode 100755 index 0000000..3a44038 Binary files /dev/null and b/wxc2_omc/omcHelp/4_002.gif differ diff --git a/wxc2_omc/omcHelp/4_1.htm b/wxc2_omc/omcHelp/4_1.htm new file mode 100755 index 0000000..06d256a --- /dev/null +++ b/wxc2_omc/omcHelp/4_1.htm @@ -0,0 +1,100 @@ +锘� + + + Alarm Log + + + + + + + + + + + + + + + + + + + + +
      +

      Alarm Log

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The UltraWAVE system has five categories of alarms, which can be sorted out from both alarm bar and alarm page.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      Alarm Severity

      +

      Descriptions

      +

      Critical

      +

      Severely broken and no workaround.

      +

      Major

      +

      A defect that needs to be fixed but there is a workaround.

      +

      Minor

      +

      A defect that causes small impact.  Easy to recover or workaround.

      +

      Warning

      +

      Trivial defect.

      +

      Indeterminate

      +

      Undefined problems.

      +
      +
      +

       

      +

      To delete an alarm, click 4_002 button.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Display organized system alarms

       

      +

       

      +

       

      +

       

      +

       

      +

      4.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_10.htm b/wxc2_omc/omcHelp/4_10.htm new file mode 100755 index 0000000..68af8eb --- /dev/null +++ b/wxc2_omc/omcHelp/4_10.htm @@ -0,0 +1,110 @@ +锘� + + + OPR CDR + + + + + + + + + + + + + + + + + + + + +
      +

      OPR CDR

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The OPR CDR contains the following details.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      OPR CDR

      +

      Explanation

      +

      Operation Type

      +

      A string representing the type of the rule that caused the event.

      +

      IMEI

      +

      International Mobile Equipment Identity is a unique number of the registering mobile phone.

      +

      MSISDN

      +

      The assigned local phone number for private services.

      +

      IMSI

      +

      International Mobile Subscriber Identity is a unique number of the registering mobile phone user.

      +

      User Type

      +

      The status of the assigned local phone number.

      +

      Seizure

      +

      Time of CDR generation.

      +

      Result

      +

      Y = Successful, N = Unsuccessful

      +
      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •OPR CDR query

       

      +

       

      +

       

      +

       

      +

       

      +

      4.10

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_11.htm b/wxc2_omc/omcHelp/4_11.htm new file mode 100755 index 0000000..723f58d --- /dev/null +++ b/wxc2_omc/omcHelp/4_11.htm @@ -0,0 +1,103 @@ +锘� + + + EIR CDR + + + + + + + + + + + + + + + + + + + + +
      +

      EIR CDR

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The EIR CDR contains the following details.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      EIR CDR

      +

      Explanation

      +

      Event Type

      +

      A string representing the type of the rule that caused the event.

      +

      Status

      +

      •White List = White mobiles are those that conform to requirements set down by the network operator.

      •Grey List = Grey mobiles are classed as non-conforming, but may be used on the network.

      •Black List = Black mobiles are those reported stolen or whose operation on the network will adversely affect network operation. These mobiles will not be allowed to access the network.

      IMEI

      +

      International Mobile Equipment Identity is a unique number of the registering mobile phone.

      +

      IMSI

      +

      International Mobile Subscriber Identity is a unique number of the registering mobile phone user.

      +

      Location

      +

      The current location of the registering mobile phone. Display as LAC + Cell ID.

      +

      Event Time

      +

      Time of CDR generation.

      +
      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •EIR CDR query

       

      +

       

      +

       

      +

       

      +

       

      +

      4.11

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_12.htm b/wxc2_omc/omcHelp/4_12.htm new file mode 100755 index 0000000..94503e4 --- /dev/null +++ b/wxc2_omc/omcHelp/4_12.htm @@ -0,0 +1,137 @@ +锘� + + + MHC CDR + + + + + + + + + + + + + + + + + + + + +
      +

      MHC CDR

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MHC CDR contains the following details.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      MHC CDR

      +

      Explanation

      +

      Call Type

      +

      MHC CDR

      +

      Node Name

      +

      The name of the involved MHC node.

      +

      HLR Number

      +

      The E.164 number of the involved HLR. Display 0 for inappropriate events.

      +

      IMSI Number

      +

      The IMSI of the involved HLR subscriber. Display 0 for inappropriate events.

      +

      Event

      +

      MHC start up and shut down

      +

      Verification - Time to start verification

      +

      Verification - Start verification invoked by node xx

      +

      Verification - Node xx detected

      +

      Verification - Node xx is unreachable

      +

      Verification - Interrupted by operator (add, delete operation)

      +

      Verification - Success

      +

      Verification - Fail by waiting for verification trap packet timeout

      +

      Verification - Finish collecting user and checksum for verification

      +

      Verification - Find out that some user and checksum are missed when check sequence legality, Delete operation is disallowed.

      +

      Verification - User XXX need to be downloaded

      +

      Verification - User XXX need to be deleted from local HLR

      +

      Verification - User XXX, checksum discrepancy found

      +

      Verification - Downloading XXX

      +

      Verification - Deleting XXX

      +

      Replication - Start when boot up

      +

      Replication - Operator initiate

      +

      Replication - Try to replicate HLR user data from xx

      +

      Replication - Replicate HLR user data form xx failed

      +

      Replication - Replicating HLR user data from xx

      +

      Replication - Require xx to resend at sequence xxxx

      +

      Replication - Replicate HLR user data from xx successfully

      +

      Replication - Failed

      +

      Replication - Success

      +

      Replication - Receive replication request from xx, expected sequence is xxxx

      +

      Replication - Start downloading user to xx, total user xxxx

      +

      Replication - Replication to node xx finished

      +

      Connection - Change the destination IP of adjacent node xx from x.x.x.x to x.x.x.x

      +

      Connection - Node xx is unreachable

      +

      Connection - Node xx is detected

      +

      Synchronization - Node xx failed to ACK User xxxx, maybe conflict occurred in HLR

      +

      Synchronization - User xxx is not exist in local Node (SYN come from node xxx ), but SYN field is not complete

      +

      Synchronization - User xxx added from HLR

      +

      Synchronization - User xxx deleted from HLR

      +

      Event Time

      +

      Time of CDR generation.

      +
      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •MHC CDR query

       

      +

       

      +

       

      +

       

      +

       

      +

      4.12

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_2.htm b/wxc2_omc/omcHelp/4_2.htm new file mode 100755 index 0000000..8dce9f3 --- /dev/null +++ b/wxc2_omc/omcHelp/4_2.htm @@ -0,0 +1,58 @@ +锘� + + + Operation Log + + + + + + + + + + + + + + + + + + + + +
      +

      Operation Log

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The operation log provides the log files of all events. The log file includes event details, operator name, time and event result.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •System event logs audit

       

      +

       

      +

       

      +

       

      +

       

      +

      4.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_3.htm b/wxc2_omc/omcHelp/4_3.htm new file mode 100755 index 0000000..5a2178b --- /dev/null +++ b/wxc2_omc/omcHelp/4_3.htm @@ -0,0 +1,151 @@ +锘� + + + MSC CDR + + + + + + + + + + + + + + + + + + + + +
      +

      MSC CDR

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      This page provide CDR query of the current day. All CDR are divided into 24 intervals with each interval lasts one hour. Operator may click the period number to check the CDR of that period.

      +

       

      +

      The real time MSC CDR contains the following details:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      MSC CDR

      +

      Explanation

      +

      Call Type

      +

      MO = Mobile Originating Call

      +

      MT = Mobile Terminating Call

      +

      IncGateway = incoming call from PSTN or other MSC

      +

      OutGateway = outgoing call to PSTN or other MSC

      +

      Transit = transit call

      +

      MO SMS = Originating SMS

      +

      MT SMS = Terminating SMS

      +

      IMSI

      +

      For MO call, it is the IMSI of the caller

      +

      For MT call, it is the IMSI of the receiver

      +

      For IncGateway call, no IMSI displayed

      +

      For OutGateway call, it is the IMSI of the caller

      +

      For transit call, no IMSI displayed

      +

      For MO SMS, it is the IMSI of the sender

      +

      For MT SMS, it is the IMSI of the receiver

      +

      Caller Number

      +

      Caller number

      +

      Called Number

      +

      Called number

      +

      Seizure

      +

      Time of CDR request

      +

      Answer

      +

      Time of call connected

      +

      Duration (s)

      +

      Call duration, unit = second

      +

      Incoming TG

      +

      Incoming trunk group

      +

      Outgoing TG

      +

      Outgoing trunk group

      +

      SS Code

      +

      Supplementary service code, include Call Forwarding, Call Waiting, and Call Barring

      +

      Result

      +

      Y=success, N=failure

      +
      +
      +

       

      +

      The MSC CDR provides searching (by caller or called number), download and print facilities.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •MSC CDR querying and searching

       

      +

      •MSC CDR printing and downloading

       

      +

       

      +

       

      +

       

      +

       

      +

      4.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_4.htm b/wxc2_omc/omcHelp/4_4.htm new file mode 100755 index 0000000..2459177 --- /dev/null +++ b/wxc2_omc/omcHelp/4_4.htm @@ -0,0 +1,156 @@ +锘� + + + PPS CDR + + + + + + + + + + + + + + + + + + + + +
      +

      PPS CDR

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The real time PPS CDR contains the following details:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      PPS CDR

      +

      Explanation

      +

      Call Type

      +

      MO = Mobile Originating Call

      +

      MT = Mobile Terminating Call

      +

      MSISDN

      +

      For MO, it is the MSISDN of the originator

      +

      For MT, it is the MSISDN of the receiver

      +

      Type

      +

      Local call out = Originating call to local mobile

      +

      Trunk call out = Originating call to local PSTN

      +

      NDD call out = Originating call to national direct dialing prefixes

      +

      IDD call out = Originating call to international direct dialing prefixes

      +

      Local call in = Terminating call from local mobile

      +

      Trunk call in = Terminating call from local PSTN

      +

      Periodic charge = Rental charged

      +

      Increment = Assisted manual recharge by operator

      +

      Decrease = Assisted manual charge by operator

      +

      Recharge success = Successful recharge by subscriber

      +

      Recharge failure = Unsuccessful recharge by subscriber

      +

      MO short message = Originating short message

      +

      MT short message = Terminating short message

      +

      Conference call = MO conference call

      +

      Third party charge = Charge by third party (ESME) via SNMP

      +

      Transfer out = Balance transferred out

      +

      Transfer in = Balance transferred in

      +

      GPRS = GPRS server related charge

      +

      Caller Number

      +

      Number of originator

      +

      Called Number

      +

      Number of receiver

      +

      GPRS SGSN IP

      +

      IP address of serving SGSN

      +

      Answer

      +

      Time of call connected

      +

      Duration (s)

      +

      Call duration, unit = second

      +

      GPRS volume (KB)

      +

      Data volume of the GPRS session, unit = KB

      +

      Charge

      +

      Charged balance (Call, SMS, GPRS) or handled balance (Transfer)

      +

      Balance

      +

      Remaining balance of the serving account

      +
      +
      +

       

      +

      The PPS CDR provides searching, download and print facilities.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •PPS CDR query and searching

       

      +

      •PPS CDR print and download

       

      +

       

      +

       

      +

       

      +

       

      +

      4.4

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_5.htm b/wxc2_omc/omcHelp/4_5.htm new file mode 100755 index 0000000..19afb75 --- /dev/null +++ b/wxc2_omc/omcHelp/4_5.htm @@ -0,0 +1,99 @@ +锘� + + + SMSC CDR + + + + + + + + + + + + + + + + + + + + +
      +

      SMSC CDR

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The SMSC CDR contains the following details.

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + +

      SMSC CDR

      +

      Explanation

      +

      Call Type

      +

      MO or MT

      +

      IMSI

      +

      For SMS-MT, it is the IMSI of the receiver

      +

      MSISDN

      +

      For SMS-MO, it is the MSISDN of the sender

      +

      For SMS-MT, it is the MSISDN of the receiver

      +

      Result

      +

      Y = Successful, N = Unsuccessful

      +

      Update Time

      +

      Time of CDR request

      +
      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •SMSC CDR query

       

      +

       

      +

       

      +

       

      +

       

      +

      4.5

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_6.htm b/wxc2_omc/omcHelp/4_6.htm new file mode 100755 index 0000000..9ca6a7d --- /dev/null +++ b/wxc2_omc/omcHelp/4_6.htm @@ -0,0 +1,85 @@ +锘� + + + CDR Download + + + + + + + + + + + + + + + + + + + + +
      +

      CDR Download

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The CDR Download is for downloading backup CDR files of three types (MSC, PPS and SMSC). To download a backup file, right-click on the file name to save it to the client station. The name of the CDR CSV file is defined by its type and generation time.

      +

       

      +
      + + + +

      For example:

      +

      cdrFromMSC_2007_12_09_07.csv (MSC CDR CSV file of AM6:00-7:00 9 Dec 2007)

      +
      +
      +

       

      +

      The CDR generation is on an hourly basis. There are total 24 CDR CSV files for each call type in one day. The CDR data fields are separated by Tab.

      +

       

      +

      EMS can automatically FTP the CDR files to a specified data collecting system on an hourly basis once the FTP login info and directory path configured. The configuration is described as below:

      +

       

      +

      EMS ->Maintenance ->Control Panel ->System ->CDR Collecting System

      +

      FTP Configuration Format:

      +

      User:Password@IP>Directory (Please make sure the FTP login info is correct and the directory path exists.)

      +

       

      +
      + + + +

      For example:

      +

      www:123456@172.18.160.160>/home/www/dataBackup/CDR

      +
      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Log file download facility

       

      +

      •CDR file download facility

       

      +

       

      +

       

      +

       

      +

       

      +

      4.6

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_7.htm b/wxc2_omc/omcHelp/4_7.htm new file mode 100755 index 0000000..5efd067 --- /dev/null +++ b/wxc2_omc/omcHelp/4_7.htm @@ -0,0 +1,54 @@ +锘� + + + Used Recharge Card + + + + + + + + + + + + + + + + + + + + +
      +

      Used Recharge Card

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      This page lists all used recharge cards. The used card information will be reserved in EMS database till the following two situations happen:

      +

      •Manually delete them from EMS database.

      •Install EMS software in initialization mode (It is very important to backup these data before reinstall EMS).

       

      +

       

      +

       

      +

       

      +

       

      +

      4.7

      + +
      + + + diff --git a/wxc2_omc/omcHelp/4_9.htm b/wxc2_omc/omcHelp/4_9.htm new file mode 100755 index 0000000..4218625 --- /dev/null +++ b/wxc2_omc/omcHelp/4_9.htm @@ -0,0 +1,84 @@ +锘� + + + CSTA Download + + + + + + + + + + + + + + + + + + + + +
      +

      CSTA Download

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The CSTA Download is for downloading backup files of CSTA (MSC, HLR, AUC, EIR, AAS, VMS, SMSC, SMEG, PPS, MTP3 and AIF). To download a backup file, right-click on the file name to save it. The name of the CSTA CSV file is defined by its type and generation date.

      +

       

      +
      + + + +

      For example:

      +

      vlrDetail_07.csv (VLR CSTA CSV file generated on the 7th of the current month)

      +
      +
      +

       

      +

      EMS reserves Call Statistic CSV files for one month, after that the old files will be overwritten by new files with the same file name. The CSTA generation is on a daily basis. In each CSTA file, the data is divided into 15-minute intervals. The CSTA data fields are separated by comma ",".

      +

       

      +

      EMS can automatically FTP the CSTA files to a specified data collecting system on a daily basis (AM3:00) once the FTP login info and directory path configured. The configuration is described as below:

      +

       

      +

      EMS ->Maintenance ->Control Panel ->System ->CSTA Collecting System

      +

      FTP Configuration Format:

      +

      User:Password@IP>Directory (Please make sure the FTP login info is correct and the directory path exists.)

      +

       

      +
      + + + +

      For example:

      +

      www:123456@172.18.160.160>/home/www/dataBackup/CSTA

      +
      +
      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •CSTA file download facility

       

      +

       

      +

       

      +

       

      +

       

      +

      4.8

      + +
      + + + diff --git a/wxc2_omc/omcHelp/5.htm b/wxc2_omc/omcHelp/5.htm new file mode 100755 index 0000000..0c2f99a --- /dev/null +++ b/wxc2_omc/omcHelp/5.htm @@ -0,0 +1,75 @@ +锘� + + + Maintenance + + + + + + + + + + + + + + + + + + + + +
      +

      Maintenance

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      1_010_011_014_011_016_011_012_011_024_011_018_021_020_01

      +

       

      +

      1_113_01

      +

      1_113_02

      +

      1_113_03

      +

      1_113_04

      +

      1_113_05

      +

      1_113_06

      +

      1_113_13

      +

      1_113_07

      +

      1_113_08

      +

      1_113_09

      +

      1_113_10

      +

      1_113_11

      +

      1_113_12

      +

       

      +

      The maintenance facilitates backup function for all parameters, subscriber data and performance data. Operator can also make use of this facility to upload parameter backup files to restore the whole or part setup for a network entity.

      +

       

      +

      The network data contains the backup files for all UltraWAVE parameters including the public parameters of all devices and the private parameters of each subsystem.

      +

       

      +

      The account data contains the backup files for all UltraWAVE subscriber profiles including HLR, VLR, AUC, EIR, PPS, VMS subscriber profiles and billing data.

      +

       

      +

      The performance data contains the backup for prepaid daily report, operation and alarm logs.

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      5

      + +
      + + + diff --git a/wxc2_omc/omcHelp/5_1_1.htm b/wxc2_omc/omcHelp/5_1_1.htm new file mode 100755 index 0000000..828747e --- /dev/null +++ b/wxc2_omc/omcHelp/5_1_1.htm @@ -0,0 +1,110 @@ +锘� + + + Network Data + + + + + + + + + + + + + + + + + + + + +
      +

      Network Data

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The network data backup facilitates the backup for all UltraWAVE parameters including the public parameters of all devices and the private parameters of each subsystem. The backup files are produced by EMS server according to the parameters stored in the EMS server. Consequently before downloading the backup files, make sure the parameters stored in the EMS server are completely same as those in the devices.

      +

       

      +

      All parameter backup files are CSV files which can be opened and edited by any text editor including MS Office Excel. The backup files cover the parameters of MSC, HLR, VLR, PPS, AUC, EIR, SMSC, VMS, and platforms (MTP3 and SCCP).

      +

       

      +

      To download the backup files from the EMS server to the client PC, click the correspondent Download. In the opened prompt window, specify the path in the client PC to store the backup files. To restore the parameter setup for a device or one of its subsystems, please follow the procedures below:

      +

      1.Click the Upload on this page.

      2.On the open page, click on Browse button to browse out the parameter backup file from the client PC.

      3.Click the Submit button to upload the parameter backup file to the EMS server from client PC.

      4.On the EMS configuration page, click Set to set these parameters to the device.

       

      +

       

      +

      Functionalities

      +

       

      +

      •Backup files of organized parameters

       

      +

      •Download organized parameter backup files to client PC for backup

       

      +

      •Upload the parameter backup files from client PC to EMS server

       

      +

       

      +

      Operations

      +

       

      +

       

      +
      + + + +

      For example, to create a backup file of current SCCP configuration and store it to client PC, follow these steps:

      +

       

      +

      1.Log on to the EMS using the account manager.

       

      +

      2.Select Advanced -> Network -> Parameters.

       

      +

      3.On the operation page, select SCCP at the Entity navigator. Keep the ID navigator as default SCCP_pub.

       

      +

      4.Click 2.Configuration to open the operation page on the right frame.

       

      +

      5.Click GET button to read the current SCCP configuration from MSS to EMS read buffer.

       

      +

      6.Select Maintenance -> Backup&Restore -> Network data.

       

      +

      7.To download the backup files of SCCP configuration, select Parameter -> SCCP, and click Download to download the backup files to client PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      For example, to upload a parameter backup file of SCCP platform and activate it on the current SCCP platform, follow these steps.

      +

       

      +

      1.Log on to the EMS using the account manager.

       

      +

      2.Select Maintenance -> Backup&Restore -> Network data.

       

      +

      3.On the operation page, select Parameter -> SCCP -> Upload.

       

      +

      4.Click Browse button to select the SCCP backup file in client PC, and then click Submit button to upload this file to the EMS database.

       

      +

      5.Select Advanced -> Network -> Parameters.

       

      +

      6.At the Entity navigator, select SCCP, and keep the ID as default SCCP_pub. At the Select bar, use the default ----.

       

      +

      7.Click Configuration to open the operation page on the right frame. On the operation page, click SET button to download this backup file to all SCCP platforms on EMS and MSS.

       

      +

      8.Select 3. Management - > 2. Command ->. Click on set.. to open the set window. Select Save parameter from the drop-down menu and click on Set button to confirm and withdraw.

       

      +

      9.On the operation page, click on SET to perform this command.

       

      +

       

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      5.1.1

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/5_1_2.htm b/wxc2_omc/omcHelp/5_1_2.htm new file mode 100755 index 0000000..2c2789d --- /dev/null +++ b/wxc2_omc/omcHelp/5_1_2.htm @@ -0,0 +1,81 @@ +锘� + + + Account Data + + + + + + + + + + + + + + + + + + + + +
      +

      Account Data

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The account backup facilitates the backup for all UltraWAVE subscriber profiles including HLR, VLR, AUC, EIR, PPS, VMS subscriber profiles and billing data. All subscriber backup files are CSV files which can be opened and edited by any text editor including MS Office Excel.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Backup files of all subscriber profiles and billing data

       

      +

      •Download subscriber backup files to client PC for backup

       

      +

      •Upload the subscriber backup files from client PC to EMS server

       

      +

       

      +

      Operations

      +

       

      +

       

      +
      + + + +

      For example, follow these steps to make and download HLR subscriber backup file.

      +

       

      +

      1.Log on to the EMS as builder.

       

      +

      2.Select Configuration -> Subscriber -> HLR. Click Get all button on the opened operation page to read all subscriber data from HLR server and save to EMS database.

       

      +

      3.Select Maintenance -> Backup&Restore -> Account.

       

      +

      4.Click Download of HLRSubscriber and select a local path to download and store the HLR subscriber file (csv file).

       

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      5.1.2

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/5_1_3.htm b/wxc2_omc/omcHelp/5_1_3.htm new file mode 100755 index 0000000..b0cdc7f --- /dev/null +++ b/wxc2_omc/omcHelp/5_1_3.htm @@ -0,0 +1,59 @@ +锘� + + + Performance Data + + + + + + + + + + + + + + + + + + + + +
      +

      Performance Data

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The call data backup facilitates the backup for prepaid daily reports, operation and alarm logs. The EMS stores seven day's call data for backup, therefore operators should manually back up the data on a weekly basis to avoid any data loss.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Backup files for operation and alarm logs

       

      +

      •Download data files to client PC for backup

       

      +

       

      +

       

      +

       

      +

       

      +

      5.1.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/5_1_4.htm b/wxc2_omc/omcHelp/5_1_4.htm new file mode 100755 index 0000000..49c22d4 --- /dev/null +++ b/wxc2_omc/omcHelp/5_1_4.htm @@ -0,0 +1,60 @@ +锘� + + + Template + + + + + + + + + + + + + + + + + + + + +
      +

      Template

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The template window is responsible for backing up and restoring parameters' configuration template of the EMS. It includes the structure and the contents of the parameter menus.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Backup the templates of all system parameters

       

      +

      •Download templates to client PC for backup

       

      +

      •Upload the templates from client PC to EMS server

       

      +

       

      +

       

      +

       

      +

       

      +

      5.1.4

      + +
      + + + diff --git a/wxc2_omc/omcHelp/5_1_5.htm b/wxc2_omc/omcHelp/5_1_5.htm new file mode 100755 index 0000000..432388c --- /dev/null +++ b/wxc2_omc/omcHelp/5_1_5.htm @@ -0,0 +1,60 @@ +锘� + + + MSS Backup + + + + + + + + + + + + + + + + + + + + +
      +

      MSS Backup

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The MSS backup facilitates the backup for UltraWAVE subscriber profiles and billing data, including HLR, AUC, EIR, PPS, OPR and iPALIM subscriber profiles, recharge card and tariff data. All backup files are dat files which can be uploaded direct to the folder in MSS server.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Backup files of subscriber profiles and billing data

       

      +

      •Download files to client PC for backup

       

      +

      •Upload the subscriber and billing backup files from client PC to MSS server

       

      +

       

      +

       

      +

       

      +

       

      +

      5.1.5

      + +
      + + + diff --git a/wxc2_omc/omcHelp/5_1_6.htm b/wxc2_omc/omcHelp/5_1_6.htm new file mode 100755 index 0000000..ae38299 --- /dev/null +++ b/wxc2_omc/omcHelp/5_1_6.htm @@ -0,0 +1,98 @@ +锘� + + + Configuration + + + + + + + + + + + + + + + + + + + + +
      +

      Configuration

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The Configuration data backup facilitates the backup for MSS config files including parameters of all application subsystems. The backup files are produced by EMS server according to the config files stored in the MSS server.

      +

      The Configuration data restore facilitates the recover for MSS configuration including every application subsystems.

      +

       

      +

      Since the MSS application processes will be automatically restarted, the restore command has to be used carefully especially when working on a live network. The process of restart will take at least 10 minutes to initialize the MSS running environment. Perform GET ALL operation on each subsystem to update parameters from MSS to EMS GUI after MSS configuration restored.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      •Backup the config files of MSS server

       

      +

      •Download backup config files to client PC

       

      +

      •Restore backup config files to recover MSS configuration

       

      +

       

      +

      Operations

      +

       

      +

       

      +
      + + + +

      1.Go to EMS >Maintenance >Backup&Restore >Configuration.

       

      +

      2.Click the upper Backup button to back up the current MSS configuration into an archive.

       

      +

      3.The backup archive is displayed in the backup file list, click its download hyperlink to download it to client PC.

       

      +

       

      +
      +
      +

       

      +
      + + + +

      1.Go to EMS >Maintenance >Backup&Restore >Configuration.

       

      +

      2.Select and click the proper backup file in the backup file list to display it in the upper Restore File box.

       

      +

      3.Click the Restore button to recover the selected MSS configuration.

       

      +

      4.The MSS application processes are restarted automatically, wait for 10 minutes.

       

      +

      5.Go to EMS >Configuration >Parameter.

       

      +

      6.Perform Get All operation to update parameters from MSS to EMS GUI.

       

      +

       

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      5.1.6

      + +
      + + + + diff --git a/wxc2_omc/omcHelp/5_2_1.htm b/wxc2_omc/omcHelp/5_2_1.htm new file mode 100755 index 0000000..fb0f9e1 --- /dev/null +++ b/wxc2_omc/omcHelp/5_2_1.htm @@ -0,0 +1,112 @@ +锘� + + + System + + + + + + + + + + + + + + + + + + + + +
      +

      System

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      The system window helps to customize the basic configuration of the EMS. It includes the parameters as below:

      +

       

      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

      Parameter

      +

      Explanation

      +

      Field Name

      +

      Define the name of the UltraWAVE system. It will be displayed at the upper left corner of the EMS GUI.

      +

      •Example = Altobridge-1

      Minimum Currency Unit

      +

      Enter the name of the minimum currency unit for prepaid service. It will be displayed in PPS  daily report.

      +

      •Example = dollars

      Decimal Number of Currency

      +

      Number of decimals for the balance statistic in PPS daily report.

      +

      •Example = 100

      AUC Subscriber Management Password

      +

      Define the password used to access EMS->Configuration->Subscriber->AUC.

      +

      EIR Subscriber Management Password

      +

      Define the password used to access EMS->Configuration->Subscriber->EIR.

      +

      CDR Collecting System

      +

      Enter the FTP command to access the data collecting system. The EMS will automatically upload the CDR CSV files to the collecting system on an hourly basis.

      +

      CSTA Collecting System

      +

      Enter the FTP command to access the data collecting system. The EMS will automatically upload the Call Statistic CSV files to the collecting system on a daily basis.

      +

      Time out of SMCLI Client

      +

      Timeout for SMCLI connection activation delay in 1 minute steps.

      +
      +
      +

       

      +

       

      +

       

      +

       

      +

       

      +

      5.2.1

      + +
      + + + diff --git a/wxc2_omc/omcHelp/5_2_2.htm b/wxc2_omc/omcHelp/5_2_2.htm new file mode 100755 index 0000000..0f5c9df --- /dev/null +++ b/wxc2_omc/omcHelp/5_2_2.htm @@ -0,0 +1,61 @@ +锘� + + + NRTRDE HPMN + + + + + + + + + + + + + + + + + + + + +
      +

      NRTRDE HPMN

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      NRTRDE (Near Real Time Roaming Data Exchange) provides a new method for monitoring the subscribers鈥� activities in the VPMN (Visited Public Mobile Network) networks, and enables the HPMN (Home Public Mobile Network) to detect unauthorized network usage and other fraud issues near real time.

      +

       

      +

      One of the main purposes of NRTRDE is to reduce roaming data delivery time from the VPMN to the HPMN from up to 36 hours to 4 hours (or less), for fraud management purposes. In this solution, roaming call records will be sent independently of TAP (Transfer Account Procedure) procedures. Although a 4 hour maximum timeframe has been set as the contractual NRTRDE obligation for the VPMN to deliver roaming CDR information to the respective HPMN, it is recommended that operators set a goal to achieve NRTRDE record exchange delays of less than one hour.

      +

       

      +

       

      +

      Functionalities

      +

       

      +

      NRTRDE is for GSM mobile operators to fight roaming fraud.

      +

      •Replacing the existing High Usage Report (HUR) process with an industry-wide interoperable Near Real-Time Roaming Data Exchange (NRTRDE) procedure that is mandatory for all GSMA members to implement. The NRTRDE solution will have two essential functions:

      •Reduce the required timeframe for delivery of fraud related roaming information from the VPMN to the HPMN from 36 hours to a maximum of 4 hours.

      •Provide individual CDR information in sufficient form to allow operators to cost effectively manage roaming fraud

      •Shortening the deadline from 36 hours to 4 hours for fraud loss liability from the HPMN to VPMN for any roaming fraud losses that accrue after expiration of a 4 hour deadline by which the VPMN is required to deliver roaming call records to the HPMN. At present, the VPMN is required to notify the HPMN of subscriber usage above an agreed threshold within 36 hours.

       

      +

       

      +

       

      +

       

      +

       

      +

      5.2.2

      + +
      + + + diff --git a/wxc2_omc/omcHelp/5_2_3.htm b/wxc2_omc/omcHelp/5_2_3.htm new file mode 100755 index 0000000..228a056 --- /dev/null +++ b/wxc2_omc/omcHelp/5_2_3.htm @@ -0,0 +1,58 @@ +锘� + + + Welcome SMS + + + + + + + + + + + + + + + + + + + + +
      +

      Welcome SMS

      + +
      + Top  + Previous  + Next +
      + + + +
      +

      Descriptions

      +

       

      +

      Welcome Short Message Service (WSMS) is a value added service offered to roaming subscribers. This system sends predefined welcome and advertisement message(s) via SMS.

      +

       

      +

      The WSMS supports two kinds of messages namely welcome and advertisement. Welcome message is intended to welcome the roamers to the network. It also notifies them of the other services and information of the GSM network operator. It will be done immediately as soon as the system detects the roamer鈥檚 log into its network. Advertisement message allows hotels, restaurants, and other establishments to promote their business to roamers. Contents of all these kinds of WSMS messages depend on the operator. The contents of messages may be altered/ programmed to the system per country and carrier. In addition, default messages for the system are available in case the carriers were not able to define in the message table.

      +

       

      +

      There is a time interval setting designed to avoid the roamer to be disturbed by the same messages each time he tries the location update operation. The roamer won't receive repetitious messages within the preset time interval.

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      5.2.3

      + +
      + + + diff --git a/wxc2_omc/omcHelp/6.htm b/wxc2_omc/omcHelp/6.htm new file mode 100755 index 0000000..cd31012 --- /dev/null +++ b/wxc2_omc/omcHelp/6.htm @@ -0,0 +1,57 @@ +锘� + + + Advanced + + + + + + + + + + + + + + + + + + + + +
      +

      Advanced

      + +
      + Top  + Previous  + Next +
      + + + +
      +

       

      +

      1_010_011_014_011_016_011_012_011_024_011_018_011_020_02

      +

       

      +

      The Advanced window is the interface from which the network manager or system expert monitors and controls the UltraWAVE system. The purpose of Advanced is to offer the authorized members a higher privileged operation on the sensitive data and parameter, such as the prepaid account balance, tariff, and access control.

      +

       

      +

      The Advanced window centralizes all of system operations and maintenance with complete parameters and data. It can be divided into 6 parts by function:

      +

      •System Configuration

      •Prepaid Data

      •Subscriber Management

      •Performance Statistics

      •Call Detail Records

      •Server Status

       

      +

       

      +

       

      +

       

      +

       

      +

      6

      + +
      + + + diff --git a/wxc2_omc/omcHelp/6_002.gif b/wxc2_omc/omcHelp/6_002.gif new file mode 100755 index 0000000..5659997 Binary files /dev/null and b/wxc2_omc/omcHelp/6_002.gif differ diff --git a/wxc2_omc/omcHelp/9.htm b/wxc2_omc/omcHelp/9.htm new file mode 100755 index 0000000..02483cf --- /dev/null +++ b/wxc2_omc/omcHelp/9.htm @@ -0,0 +1,1646 @@ +锘� + + + Abbreviations + + + + + + + + + + + + + + + + + + + + +
      +

      Altobridge Abbreviations

      + +
      + Top  + Previous  + +
      + + + +
      +

       

      +

      A   B   C   D   E   F   G   H   I   J   K   L   M   N   O   P   Q   R   S   T   U   V   W   X   Y   Z

      +

       

      +

       

      +

       

      +

      •A

       

      +

      •A interface

      This is the interface within the GSM network architecture between the BSS (Base Station Subsystem) and an MSC (Mobile Switching Center). The interface supports standard 64Kbps channels for signaling and traffic.

      +

       

      +

      •A3

      Authentication algorithm that produces SRES using RAND and Ki. This variable is used by the network to authenticate a MS (Mobile Station) requesting network resources.

      +

       

      +

      •A5

      Stream cipher algorithm residing on an MS that produces ciphertext out of plaintext using Kc.

      +

       

      +

      •A8

      Ciphering key generating algorithm that produces Kc using RAND and Ki. This is used with A5/X to cipher the data stream between the MS (Mobile Station) and the GSM network.

      +

       

      +

      •AAL

      ATM Adaptation Layer. A protocol that translates data into a format that can be interpreted by the ATM Cell.

      +

       

      +

      •AAS

      Audio Announcement Server (also known as Voice Announcement System).

      +

       

      +

      •AB

      Access Burst. Also referred to as a Random Access Burst in GSM. It has a 68.25bit guard period, to ensure that the burst does not collide with other data in the TDMA (Time Division Multiple Access) frame structure when a GSM mobile is attempting to access the network.

      +

       

      +

      •Abis (Abis interface)

      The interface within the GSM architecture, between the BTS (Base Transceiver Station) and BSC (Base Station Controller). This interface is usually configured using a 16Kbps slot structure.

      +

       

      +

      •AC

      Alternating Current. In electricity, AC occurs when charge carriers in conductor or semiconductor periodically reverse their direction in movement.

      +

       

      +

      •ACCH

      Associated Control Channel. The GSM signaling channels associated with a user's traffic channel or dedicated signaling channel. Two ACCH are defined for GSM Circuit Switched operation. These are SACCH (Slow Associated Control Channel) and FACCH (Fast Associated Control Channel). In GPRS packet operation, a ACCH is allocated in conjunction with a PDTCH (Packet Data Traffic Channel) and is termed a PACCH (Packet Associated Control Channel).

      +

       

      +

      •ACM

      Accumulated Call Meter. The accumulated charge for both the current call and all preceding calls as computed by the MS, expressed in terms of Home Units.

      +

       

      +

      •ACN

      Application Context Name

      +

       

      +

      •A/D

      Analog to Digital converter. An A/D is a device for converting analogue signals into digital signals.

      +

       

      +

      •ADMIN, Admin

      ADMINistration.

      +

       

      +

      •ADN

      Abbreviated Dialing Number. ADN is another term for 鈥渟peed dial number鈥� that can be programmed into the mobile.

      +

       

      +

      •ADPCM

      Adaptive Differential Pulse Coded Modulation. A form of PCM (Pulse Code Modulation) that produces a digital signal with a lower bit rate than standard PCM. ADPCM produces a lower bit rate by recording only the difference between samples and adjusting the coding scale dynamically to accommodate large and small differences.

      +

       

      +

      •AGC

      Automatic Gain Control. Receiver function that generates constant power output under varying power input.

      +

       

      +

      •AGCH

      Access Grant CHannel. A GSM common control used to assign MS to a SDCCH or a TCH.

      +

       

      +

      •AIF

      Interface carrying the signal between the BSC and MSC.

      +

       

      +

      •Air interface

      The radio link between the BTS and the MS.

      +

       

      +

      •AIS

      Alarm Indication Signal. The AIS is a signal transmitted in lieu of the normal signal to maintain transmission continuity and to indicate to the receiving equipment that there is a transmission interruption located either at the equipment originating the AIS signal or upstream of that equipment.

      +

       

      +

      •AM

      Access Manager. The AM controls who can log on to the EMS. It allows administrators to send messages to users, to see what users are logged on, and to log them off.

      +

       

      +

      •ANI

      Automatic Number Identification. ANI is a service feature in which the directory number or equipment number of a calling station is automatically obtained.

      +

       

      +

      •ANSI

      American National Standards Institute. This is a US organization chartered to accredit standards developed by a wide variety of industry groups while avoiding improper influence from any one company or organization. ANSI does not develop standards, but reviews and implements those developed by other organizations.

      +

       

      +

      •ANT

      Antenna. An ANT is a specialized transducer that converts RF (radio frequency) fields into AC (alternating current) or vice-versa.

      +

       

      +

      •APN

      Access Point Name. APN is a reference to the GGSN to be used.

      +

       

      +

      •ARIB

      Association of Radio, Industry and Business. ARIB is a Japanese standards organization.

      +

       

      +

      •ARFCN

      Absolute Radio Frequency Channel Number. An integer that defines the absolute RF channel number.

      +

       

      +

      •ARQ

      Automatic ReQuest for retransmission. ARQ is a communications feature in which the receiver asks the transmitter to resend a block or frame, generally because of errors detected by the receiver.

      +

       

      +

      •ASCII

      American Standard Code for Information Exchange. ASCII is a code for representing English characters as numbers, with each letter assigned a number from 0 to 127.

      +

       

      +

      •ASE

      Application Service Element. This function allows applications to communicate with one another in a SS7 system. Examples of an ASE include TCAP (Transaction Capabilities Application Part) and MAP (Mobile Application Part).

      +

       

      +

      •ASIC

      Application Specific Integrated Circuit. These are circuit designs used by manufacturers to consolidate many chips into a single package, reducing board size and power consumption.

      +

       

      +

      •ASN

      Abstract Syntax Notation. ASN is a representation of data which is independent of machine-oriented structures and encodings and also of the physical representation of the data.

      +

       

      +

      •ATM

      Asynchronous Transfer Mode. A multiplexed information transfer and switching method in which the data is organized into fixed length 53-octet cells and transmitted according to each application's instantaneous need.

      +

       

      +

      •ATT (flag)

      Attach.

      +

       

      +

      •AUC

      Authentication Center. A GSM network entity that provides the functionality for verifying the identity of an MS when requested by the system. It is often a part of the HLR.

      +

       

      +

      •Austel

      Australian Telecommunications.

      +

       

      +

      •AUT (H)

      Authentication. AUT is the process of identifying / validating a subscriber. AUT in GSM is performed by the A3 algorithm.

      +

       

      +

      •AUTO

      AUTOmatic mode.

      +

       

      +

      •AWG

      American Wire Gauge. AWG is a U.S. standard set of non-ferrous wire conductor sizes. The 鈥済auge鈥� means the diameter.

      +

       

      +

      0_011 TOP

      +

       

      +

      •B

       

      +

      •b

      Bit. The smallest unit of information a computer can hold. The value of a bit is 1 or 0.

      +

       

      +

      •B

      Byte (8 bits). The smallest addressable unit of storage; the amount of memory space used to store one character, which is usually 8 bits.

      +

       

      +

      •B8ZS

      Bipolar with 8-Zero Substitution. A line code used for T1 which converts any string of 8 zeros of a DS-1 signal into a code which at the far end is converted back to eight zeros.

      +

       

      +

      •BA

      BCCH Allocation. The radio frequency channels allocated in a cell for BCCH transmission.

      +

       

      +

      •BAIC

      Barring of All Incoming Calls supplementary service. A cellular supplementary service, that when invoked sets flags in the network databases to stop a subscriber receiving incoming calls.

      +

       

      +

      •BAOC

      Barring of All Outgoing Calls supplementary service. A cellular supplementary service, that when invoked sets flags in the network databases to stop a subscriber making outgoing calls.

      +

       

      +

      •BAOIC

      Barring of All Outgoing and Incoming Calls supplementary service. A cellular supplementary service, that when invoked sets flags in the network databases to stop a subscriber receiving incoming calls and making outgoing calls.

      +

       

      +

      •BBH

      Base Band Hopping. It means that the call will be switched between the different transmitters in a cell; the transmitters stay on the same frequency. This limits the number of frequencies to hop on to the number of transmitters in a cell.

      +

       

      +

      •BBU

      Battery Backup Unit.

      +

       

      +

      •BCC

      BTS Color Code. This code is transmitted in the SB (Synchronization Burst) and is used in the MS (Mobile Station) to discriminate between cells using the same frequencies during the cell selection and camping on process. The BCC is also used to identify the TSC (Training Sequence Code) to be used when reading the BCCH (Broadcast Control Channel).

      +

       

      +

      •BCCH

      Broadcast Control CHannel. This downlink channel contains specific parameters needed by a mobile in order that it can identify the network and gain access to it. Typical information includes the LAC (Location Area Code) and RAC (Routing Area Code), the MNC (Mobile Network Code) and BA (BCCH Allocation) list.

      +

       

      +

      •BCD

      Binary Coded Decimal. BCD uses four bits to represent each decimal digit.

      +

       

      +

      •BCF

      Base station Control Function. The GSM term for the digital control circuitry that controls the BTS. In Altobridge cell sites, this is typically an ICP card located in the BTS.

      +

       

      +

      •BCIE

      Bearer Capability Information Element. The BCIE is an ISDN information element used to describe the bearer services such as data rate and speech quality required by an individual user.

      +

       

      +

      •BDIO

      Board Input/Output.

      +

       

      +

      •BER

      Bit Error Ratio or Bit Error Rate. A measure of signal quality in the GSM system.

      +

       

      +

      •BFI

      Bad Frame Indication. The BFI is a message used to indicate that a frame has been corrupted, or received in error.

      +

       

      +

      •BHCA

      Busy Hour Call Attempt. BHCA is the number of call attempts during the busiest hour of the day.

      +

       

      +

      •BI

      Barring of Incoming call supplementary services.

      +

       

      +

      •BIC-Roam service

      Barring of Incoming Calls when Roaming outside the home PLMN country supplementary service.

      +

       

      +

      •bit/s

      Bits per Second. bit/s is equal to the number of bits transmitted or received each second.

      +

       

      +

      •BLER

      BLock Error Rate. BLER is the rate of occurrence of blocks with errors, calculated as the ratio of erroneous blocks received over total blocks.

      +

       

      +

      •Bm

      Full-rate traffic channel.

      +

       

      +

      •BN

      Bit Number. Number that identifies the position of a particular bit period within a timeslot.

      +

       

      +

      •BNC

      Bayonet Node Connector. BNC is a connector for coaxial cables that locks when one connector is inserted in another and rotated 90 degrees.

      +

       

      +

      •BO

      Barring of Outgoing call supplementary service. A cellular supplementary service, that when invoked sets flags in the network databases to stop a subscriber making all calls.

      +

       

      +

      •BOIC

      Barring of Outgoing International Calls supplementary service. A cellular supplementary service, that when invoked sets flags in the network databases to stop a subscriber making International calls.

      +

       

      +

      •BOIC-exHC

      Barring of Outgoing International Calls except those directed to the Home PLMN Country supplementary service. A cellular supplementary service, that when invoked sets flags in the network databases to stop a subscriber making International calls apart from those to their HPLMN (Home Public Land Mobile Network).

      +

       

      +

      •BPF

      Bandpass Filter. A BPF is a device that allows signals between two specific frequencies to pass, but that discriminates against signals at other frequencies.

      +

       

      +

      •bps

      Bits per Second. bps is equal to the number of bits transmitted or received each second.

      +

       

      +

      •BPV

      Bipolar Violation. BPV occurs when the next successive in transmission is of the same polarity as the previous pulse.

      +

       

      +

      •BRAN

      Broadband Radio Access Network. BRAN is a radio access network providing users with access at high bit rates.

      +

       

      +

      •BS

      Basic Service (group).

      +

       

      +

      •BS

      Bearer Service. A type of telecommunication service that provides the capability for the transmission of signals between user-network interfaces. The PLMN connection type used to support a bearer service may be identical to that used to support other types of telecommunication service.

      +

       

      +

      •BS Plus

      Altobridge chassis containing BTS and BSC functionality.

      +

       

      +

      •BSC

      Base Station Controller. A network component in the GSM PLMN that has the digital function of controlling all PBTSs. The PBSC can be located within a single PBTS cabinet (forming a BSS) but is more often located remotely and controls several PBTSs.

      +

       

      +

      •BSG

      Basic Group Service.

      +

       

      +

      •BSIC

      Base Transceiver Station Identity Code. The BSIC is broadcast on the SCH (Synchronization Channel) in order to identify the NCC (Network Color Code) and the BCC (Base Station Color Code).

      +

       

      +

      •BSIC-NCELL

      BSIC of an adjacent cell. BSIC (Base Station Identity Code) is a color code used in GSM to ensure that the source of a frequency transmission can be identified, in areas where multiple cells transmitting on the same frequency can be received.

      +

       

      +

      •BSS

      Base Station Subsystem. The subsystem of base station equipment that is viewed by the MSC through a single interface. The BSS is defined by the GSM 08 series of recommendations as being the entity responsible for communicating with Mobile Stations in a certain area. The radio equipment of a BSS may cover one or more cells. A BSS may consist of one or more base stations. If an internal interface is implemented according to the GSM 08.5x series of recommendations, then the BSS consists of one BSC and several BTSs.

      +

       

      +

      •BSSAP

      Base Station System Application Part. BSSAP is the protocol employed across the A interface.

      +

       

      +

      •BSSGP

      Base Station System GPRS Protocol. BSSGP is supported across the Gb interface. It conveys QoS information but does not carry out any form of error correction. Its primary function is to provide radio-related information for use by Radio Link Control (RLC) and Medium Access Control (MAC) on air interface.

      +

       

      +

      •BSSMAP

      Base Station Subsystem Management Application Part. BSSMAP is used to convey general BSS (Base Station System) control information between the MSC (Mobile Switching Center) and the BSS. An example is the allocation of traffic channels between the MSC and the BSS.

      +

       

      +

      •BSSOMAP

      Base Station Subsystem Operation and Maintenance Application Part. BSSOMAP is used to convey general BSS O&M (Operation and Maintenance) information between the MSC (Mobile Switching Center) and the BSS).

      +

       

      +

      •BSX

      See BSS.

      +

       

      +

      •BTA

      Basic Trading Area.

      +

       

      +

      •BTS

      Base Transceiver Station. A network component in the GSM PLMN that serves one cell and is controlled by a BSC. The BTS contains one or more Transceivers (TRXs).

      +

       

      +

      •BTSM

      BTS Management. BTSM is the Base Station Controller to the Base Transceiver Station (BSC - BTS) interface protocol (the A-bis interface).

      +

       

      +

      •Burst

      A period of modulated carrier less than one timeslot. The physical content of a timeslot.

      +

       

      +

      •BVC

      BSSGP Virtual Connection. The BVC identifies an end to end virtual communication path between remote NS (Network Service) user entities.

      +

       

      +

      •BVCI

      BSSGP Virtural Connection Identifier. The BVCI is sent to the network services layer for routing signaling and data information to the correct peer functional entities. Each BVCI between two peers must be unique.

      +

       

      +

      0_011 TOP

      +

       

      +

      •C

       

      +

      •C7

      CCITT Signaling System No. 7 (SS7). This protocol suite is used to initiate call related and non call related circuits on ISDN (Integrated Services Digital Network) based networks.

      +

       

      +

      •CA

      Cell Allocation. The radio frequency channels allocated to a particular cell.

      +

       

      +

      •CAI

      Charge Advice Information. A charging tariff that is sent from the MSC (Mobile SWitching Center) and held on the mobile; this is used to calculate billing information on the mobile and present it to the user as charging advice.

      +

       

      +

      •CALEA

      Communication Assistance for Law Enforcement Act. CALEA is a voluntary accreditation for law enforcement agencies based on a body of standards internationally accepted by the law enforcement community.

      +

       

      +

      •CAMEL

      Customized Applications for Mobile network Enhanced Logic. CAMEL is a 3GPP (Third Generation Partnership Project) initiative to extend traditional IN (Intelligent Network) services found in fixed networks into mobile networks.

      +

       

      +

      •CAP

      CAMEL Application Part. CAP is a real time protocol used to specify that the user can roam into a foreign PLMN and control the way that its is also.

      +

       

      +

      •CAT

      Central Address Table.

      +

       

      +

      •CB

      Circuit Breaker. A CB is a device that under abnormal conditions, such as a short circuit, stops the flow of current in an electrical circuit.

      +

       

      +

      •CBC

      Cell Broadcast Center. The CBC is the functional entity within the mobile network that is responsible for the generation of cell broadcast information.

      +

       

      +

      •CBCH

      Cell Broadcast CHannel. The CBCH supports part of the SMS (Short Message Service) group known as point to multipoint.

      +

       

      +

      •CC

      Country Code. A one, two or three digit number used to specify the destination country for international calls.

      +

       

      +

      •CCBS

      Completion of Calls to Busy Subscriber supplementary service. CCBS is a supplementary service that will notify the caller when a called telephone becomes free and automates reconnection.

      +

       

      +

      •CCC

      Clear Channel Capability or Call Content Channel.

      +

       

      +

      •CCCH

      Common Control CHannels. A class of GSM control channels used to control paging and grant access. Includes AGCH, PCH and RACH.

      +

       

      +

      •CCCH-GROUP

      Group of Mobile Stations in idle mode.

      +

       

      +

      •CCF

      Call Control Function. CCF is a telephony industry term used to describe the setting up, monitoring, control and tearing down of calls.

      +

       

      +

      •CCF

      Conditional Call Forwarding. A supplementary service in which calls are forwarded based on the current situation. For example if the user is not reachable or busy.

      +

       

      +

      •CCH

      Control CHannel. Control channels are channels that carry system management messages.

      +

       

      +

      •CCITT

      Comitte Consultatif International Telegraphique et Telephonique. (Now also known as ITU Telecommunications Standardization sector.)

      +

       

      +

      •CCPE

      Control Channel Protocol Entity.

      +

       

      +

      •CCS

      Hundred call-seconds. The unit in which the volume of telephone traffic is measured. A single call lasting one hundred seconds is one CCS. 36 CCS per hour = 1 call-hour = 1 erlang = 1 traffic unit. See Also erlang.

      +

       

      +

      •Cct

      Circuit. Cct is the complete path between two terminals over which one-way or two-way communications may be provided.

      +

       

      +

      •CCU

      Circuit Control Unit.

      +

       

      +

      •CCU

      Channel Codec Unit. CCU is the functional element in BSS that handles low level GPRS control in radio.

      +

       

      +

      •CD

      Compact Disk Read Only Memory. Also known as CD-ROM.

      +

       

      +

      •CDA

      Circuit Duplex Asynchronous.

      +

       

      +

      •CDC

      Call Data Channel.

      +

       

      +

      •CDMA

      Code Division Multiple Access. CDMA is a method for describing physical radio channels. Data intended for a specific channel is modulated with that channels code.

      +

       

      +

      •CDR

      Call Detail Records. A CDR contains details such as the called and calling parties, originating switch, terminating switch, call length and time of day.

      +

       

      +

      •CD-ROM

      Compact Disk Read Only Memory. Also known as CD.

      +

       

      +

      •CD-R

      Compact Disk Recordable. Refers to either the CD media or CD drive which allows you to record data.

      +

       

      +

      •CD-RW

      Compact Disk Rewritable. Refers to either the CD media or CD drive which allows you to record data and then rewrite data at a later time. See CD-R.

      +

       

      +

      •CDS

      Circuit Duplex Synchronous.

      +

       

      +

      •CED

      Called station identifier.

      +

       

      +

      •Cell

      By GSM definition, a cell is an RF coverage area. At an omni-site, cell is synonymous with site; at a sectored site, cell is synonymous with sector. This differs from analogue systems where cell is taken to mean the same thing as site.

      +

       

      +

      •CEPT

      Conference des administrations European des Postes et Telecommunications. CEPT is the organization, that has been superseded by ETSI (European Telecommunications Standards Institute).

      +

       

      +

      •CF

      Call Forward. CF is a service in which the call intended for an intended recipient is forwarded onto a designated number.

      +

       

      +

      •CFB

      Call Forwarding on mobile subscriber Busy. CFB is a supplementary service in which the incoming call is forwarded to a third party when the intended recipient is busy.

      +

       

      +

      •CFC

      Conditional Call Forward.

      +

       

      +

      •CFNRC

      Call Forwarding on mobile subscriber Not Reachable. CFNRC is a supplementary service in which the incoming call is forwarded to a third party when the intended recipient is not reachable.

      +

       

      +

      •CFNRY

      Call Forwarding on No Reply supplementary service. CFNRY is a supplementary service in which the incoming call is forwarded to a third party when there is no reply from the intended party.

      +

       

      +

      •CFU, CFUC

      Call Forwarding UnConditional. CFU and CFUC are supplementary services in which a call is forwarded irrespective of the situation.

      +

       

      +

      •CFW

      Call Forward.

      +

       

      +

      •CGI

      Common Gateway Interface.

      +

       

      +

      •CGF

      Charging Gateway Function.

      +

       

      +

      •CH

      Channel. A CH is a separate path through which signals can flow.

      +

       

      +

      •Channel

      A means of one-way transmission. A defined sequence of periods (for example, timeslots) in a TDMA system; a defined frequency band in an FDMA system; a defined sequence of periods and frequency bands in a frequency hopped system.

      +

       

      +

      •CHV

      Card Holder Verification information.

      +

       

      +

      •CIC

      Circuit Identity Code. The CIC is used to identify the trunk circuit to be connected. This variable is also used to associate the ISUP (ISDN User Part) messaging with a particular circuit. The CIC is an 8bit field within the SIF (Service Information Field) of the ISUP message. The coding of the CIC differs slightly between European and North American standards.

      +

       

      +

      •C/I

      Carrier to Interference ratio. C/I is a comparison of C (carrier signal) to the I (interference) in dB.

      +

       

      +

      •CI

      Cell Identity. A block of code which identifies a cell within a location area.

      +

       

      +

      •CIR

      Carrier to Interference Ratio. This is a comparison of C (carrier signal) to the I (Interference) expressed as a ratio C/I.

      +

       

      +

      •CKSN

      Ciphering Key Sequence Number. The CKSN is used in key management in a GSM system. Since the Kc (cipher key) is dynamically generated through the authentication process some mechanism to ensure key consistency is required. The CKSN is employed to do this.

      +

       

      +

      •Class B

      Class B mobiles can be attached to both GPRS and GSM services, using one service at a time. Class B mobiles enable receiving and making a voice call or SMS during GPRS connection. During a voice call or SMS, GPRS service is suspended and resumes automatically after call or SMS session has ended.

      +

       

      +

      •Class C

      Class C mobile is attached to either GPRS or GSM voice service. You need to switch manually between services.

      +

       

      +

      •CLI

      Calling Line Identity. CLI is an ISDN function to provide information to the user regarding the calling party address.

      +

       

      +

      •CLI

      Command Line Interface. CLI is a user interface in which you type commands instead of choosing them from a menu or selecting an icon.

      +

       

      +

      •CLIP

      Calling Line Identification Presentation. CLIP is a supplementary service enabling the called party to receive the line identity of the calling party.

      +

       

      +

      •CLIR

      Calling Line Identification Restriction. CLIR is a supplementary service enabling the calling party to restrict the identity of the line on which they are calling.

      +

       

      +

      •CLK

      Clock. The CLK is used to define the timing in the network.

      +

       

      +

      •CLM

      Connection-less Manager.

      +

       

      +

      •CLR

      CLeaR.

      +

       

      +

      •CM

      Configuration Management. A PEMS application.

      +

       

      +

      •CMA

      Cable Management Assembly. Top-mounted assembly that routes cables in and out of the Altobridge Wireless chassis.

      +

       

      +

      •CMD

      Command.

      +

       

      +

      •CMM

      Channel Mode Modify. CMM is a message sent to modify the characteristics of the current channel.

      +

       

      +

      •CMIP

      Common Management Information Protocol. CMIP is a protocol used by an application process to exchange information and commands for the purpose of managing remote computer and communications resources.

      +

       

      +

      •CMTom

      Configuration Management TCSI Corporation Object Manager.

      +

       

      +

      •CNF

      Conference Center.

      +

       

      +

      •COLP

      Connected Line Identification Presentation. The COLP Supplementary Service provides the calling party with the possibility to receive the line identity of the connected party.

      +

       

      +

      •COLR

      Connected Line Identification Restriction. The COLR supplementary service is used in conjunction with the COLP service. The COLR supplementary service blocks called party address information from being presented to the calling user.

      +

       

      +

      •Combo

      See NIB.

      +

       

      +

      •CP

      Call Processing. CP is the sequence of operations performed by a switching system from the acceptance of an incoming call through the final disposition of the call.

      +

       

      +

      •CPC

      Call Processing Center.

      +

       

      +

      •CPM

      Communications Processor Module.

      +

       

      +

      •CPU

      Central Processing Unit. The CPU is the part of a computer which controls all other parts. The CPU fetches instructions from memory and decodes them.

      +

       

      +

      •C/R

      Command/Response field bit.

      +

       

      +

      •CR

      Call Reference. A CR is used to identify calls.

      +

       

      +

      •CR

      Carriage Return (RETURN).

      +

       

      +

      •CRC

      Cyclic Redundancy Check (3 bit). CRC is a linear error code that is generated using a polynomial function on the data to be sent, the remainder from the process being the CRC. This is sent along with data so that a parity check of the received data can be conducted.

      +

       

      +

      •CS

      Controlled Slip.

      +

       

      +

      •CSC

      Call Switching Center. The CSC which is part of the UltraWAVE MSC, provides high-capacity E1 transport and switching capability for the MSC.

      +

       

      +

      •CSD

      Circuit Switched Data. CSD requires the establishment of a circuit-switched connection before data can be transferred to its destination.

      +

       

      +

      •CSER

      Change State Event Report.

      +

       

      +

      •CSN

      Combined System Node. See PCSN.

      +

       

      +

      •CSPDN

      Circuit Switched Public Data Network. CSPDN is a general wide area network used to provide circuit switched data services for commercial users.

      +

       

      +

      •CSTA

      Call STAtistics.

      +

       

      +

      •CSU

      Central Switching Unit. See MSC.

      +

       

      +

      •CSU

      Channel Service Unit.

      +

       

      +

      •CTAU

      Continuous Timing Advance Update.

      +

       

      +

      •CTIA

      Cellular Telephone Industry Association. The CTIA is an association, located in Washington, D.C., that represents the interests of the wireless telecommunications industry.

      +

       

      +

      •CV

      Code Violations.

      +

       

      +

      •CW

      Call Waiting. CW is a supplementary service indicating to a user currently in call that another call is waiting.

      +

       

      +

      0_011 TOP

      +

       

      +

      •D

       

      +

      •D/A

      Digital to Analog (converter). A D/A is a device for converting digital signals into analogue signals.

      +

       

      +

      •dB

      Decibel. A unit of power ratio measurement (10-1).

      +

       

      +

      •DB

      DataBase. A DB is a collection of information that is organized so that it can be easily accessed, managed, and updated.

      +

       

      +

      •DB

      Dummy Burst (see Dummy burst).

      +

       

      +

      •DC

      Direct Current. In DC, the electric charges flow always in the same direction, which distinguishes it from AC (alternating current).

      +

       

      +

      •DCCH

      Dedicated Control Channels. A class of GSM control channels used to set up calls and report measurements. Includes SDCCH, FACCH, and SACCH.

      +

       

      +

      •DCE

      Data Circuit terminating Equipment. DCE is a terminal device that interfaces between the DTE (Data Terminal Equipment) and a transmission circuit.

      +

       

      +

      •DCF

      Data Communications Function.

      +

       

      +

      •DCS 1800

      Digital Communication System. A cellular phone network using digital techniques similar to those used in GSM 900, but operating on frequencies of 1710 - 1785 MHz and 1805 - 1880 MHz.

      +

       

      +

      •DD

      Definition documents for project realization.

      +

       

      +

      •DET

      Detach.

      +

       

      +

      •DHCP

      Dynamic Host Configuration Protocol. DHCP is a TCP/IP protocol that enables a personal computer or workstation to get temporary or permanent IP addresses from a pool on a centrally-administered server. DHCP is also used in the GSN to assign temporary IP addresses to GPRS enabled mobiles upon activation of a PDP context.

      +

       

      +

      •DIP

      Dual Inline Package.

      +

       

      +

      •DISC

      DISConnect.

      +

       

      +

      •DL

      Data Link (layer). The data link layer is level two of the seven-level OSI model. It responds to service requests from the network layer and issues service requests to the physical layer.The data link layer is the layer of the model which ensures that data is transferred correctly between adjacent network nodes in a wide area network. The data link layer provides the functional and procedural means to transfer data between network entities and to detect and possibly correct errors that may occur in the Physical layer.

      +

       

      +

      •DLCI

      Data Link Connection Identifier. The DLCI identifies an individual users information stream as well as identifying the connections between terminal equipment and the user equipment.

      +

       

      +

      •Dm

      Control Channel (ISDN terminology applied to mobile service).

      +

       

      +

      •DNS

      Domain Name Server. A DNS maintains a database for resolving host names and IP addresses. Network devices query the DNS server by specifying a remote computers host name and receive in return, the hosts IP addresses.

      +

       

      +

      •Downlink

      Physical link from the BTS towards the MS (BTS transmits, MS receives).

      +

       

      +

      •DPC

      Destination Point Code. A part of the label in a signaling message that uniquely identifies, in a signaling network, the (signaling) destination point of the message.

      +

       

      +

      •DRAM

      Dynamic Random Access Memory. DRAM is dynamic, unlike static RAM, it needs to have its storage cells refreshed or given a new electronic charge every few milliseconds.

      +

       

      +

      •DRX, DRx

      Discontinuous Reception. A means of saving battery power (for example in hand-portable units) by periodically and automatically switching the MS receiver on and off.

      +

       

      +

      •DS0

      Digital Signal level 0.

      +

       

      +

      •DS1

      Digital Signal level 1.

      +

       

      +

      •DS3

      Digital Signal level 3.

      +

       

      +

      •DSP

      Digital Signal Processor. A DSP is a specialized computer chip designed to perform speedy and complex operations on digitized waveforms.

      +

       

      +

      •DSUB

      D-SUBminiature Connector.

      +

       

      +

      •DSX

      Digital Signal Cross-connect frame.

      +

       

      +

      •DTAP

      Direct Transfer Application Part. DTAP is an application protocol that is employed to pass signaling information between the MS (Mobile Station) and the MSC (Mobile Switching Center).

      +

       

      +

      •DTE

      Data Terminal Equipment. DTE is the terminal device and may be a voice or data terminal. The DTE interfaces through a DCE (Data Communications Equipment).

      +

       

      +

      •DTMF

      Dual Tone Multi-Frequency. DTMF is a system used by touch tone telephones where one high and one low frequency, or tone, is assigned to each touch tone button on the phone.

      +

       

      +

      •DTX, DTx

      Discontinuous Transmission. A means of saving battery power (for example, in hand-portable units) and reducing interference by automatically switching the transmitter off when no speech or data are to be sent.

      +

       

      +

      •Dummy burst

      A period of carrier less than one timeslot, whose modulation is a defined sequence that carries no useful information. A dummy burst fills a timeslot with an RF signal when no information is to be delivered to a channel.

      +

       

      +

      0_011 TOP

      +

       

      +

      •E

       

      +

      •E

      See Erlang.

      +

       

      +

      •E1

      2 Mbit/s communication system. As used in this user document set, the term applies to the European 4-wire 2.048 Mbit/s digital line or link which can carry 30 A-law PCM channels or 120 16 kbit/s GSM channels.

      +

       

      +

      •EA

      External Alarms.

      +

       

      +

      •EAE

      Extended Application Entity.

      +

       

      +

      •Eb/No

      Energy per Bit/Noise floor. Eb/No is a measure of the ratio of the energy in a signal to additive noise and interference.

      +

       

      +

      •EBSG

      Elementary Basic Service Group.

      +

       

      +

      •EC

      Echo Canceller. EC is a device that reduces or eliminates echoes in voice transmission systems.

      +

       

      +

      •ECM

      Error Correction Mode (facsimile). ECM detects errors during fax transmission and resends the page(s) of the document that had an error.

      +

       

      +

      •ECT

      Explicit Call Transfer supplementary service. ECT is a supplementary service which enables a user to connect two other parties with which he is engaged in a telephone call while leaving the connection himself.

      +

       

      +

      •Ec/No

      Ratio of energy per modulating bit to the noise spectral density.

      +

       

      +

      •EEL

      Electric Echo Loss.

      +

       

      +

      •EEPROM

      Electrically Erasable Programmable Read Only Memory. EEPROM is user-modifiable ROM (read-only memory) that can be erased and reprogrammed repeatedly through the application of higher than normal electrical voltage.

      +

       

      +

      •EFR

      Enhanced Full Rate. Voice coding system designed to improve voice quality on mobiles. To take advantage of this technology, EFR has to be used by handset and supplied by network.

      +

       

      +

      •EIR

      Equipment Identity Register. The EIR is a database which may be used to check whether an MS (Mobile Station) is stolen or not.

      +

       

      +

      •EIRP

      Effective Isotropic Radiated Power. EIRP is the unit of measurement of the strength of a radiated field. Typically that from a radio antenna.

      +

       

      +

      •EMC

      Electromagnetic Compatibility. EMC is the ability of a device to operate without electromagnetically interfering with the operation of nearby equipment and without suffering disturbances from the electromagnetic fields in its designated environment.

      +

       

      +

      •EMI

      Electromagnetic Interference. EMI is any electromagnetic disturbance that limits the effective performance of electronics/electrical equipment.

      +

       

      +

      •EMS

      Element Management System. EMS controls of the PLMN nodes operating via a graphical user interface.

      +

       

      +

      •EPROM

      Erasable Programmable Read Only Memory. EPROMs are nonvolatile memory chips that are programmed after they are manufactured, and, if necessary, can be erased by some means and reprogrammed.

      +

       

      +

      •Erlang

      International (dimensionless) unit of traffic intensity defined as the ratio of time a facility is occupied to the time it is available for occupancy. One Erlang is equal to 36 CCS. In the US this is also known as a traffic unit (TU).

      +

       

      +

      •ERP

      Effective Radiated Power. ERP is the product of the power supplied to the antenna and its gain relative to a half wave diplole in a given direction.

      +

       

      +

      •ETR

      ETSI Technical Report.

      +

       

      +

      •ETS

      European Telecommunication Standard.

      +

       

      +

      •ETSI

      European Telecommunications Standards Institute. ETSI is the standards body established to coordinate the development of telecommunications systems within Europe. These systems relate to fixed, wireless and cellular systems.

      +

       

      +

      •ETX

      End of Transmission. ETX is ASCII character 4, indicating a transmission is over.

      +

       

      +

      •ES

      Error Second.

      +

       

      +

      •ESF

      Extended Super Frame. ETS is a T1 framing format that utilizes the 193rd bit as a framing bit, but whose Superframe is made up of 24 frames instead of 12 as in D4 format.

      +

       

      +

      •EVRC

      Enhanced Variable Rate Codec. EVRC is a codec which is widely used in CDMA networks. It is a Relaxation Code Excited Linear prediction (RCELP) based codec for variable rates of operation in CDMA base systems.

      +

       

      +

      •EXZ

      Excessive Zeros. EXZ for a B8ZS coded signal occurs when more than seven contiguous zeroes are detected.

      +

       

      +

      0_011 TOP

      +

       

      +

      •F

       

      +

      •FA

      Full Allocation.

      +

       

      +

      •FA

      Fax Adaptor.

      +

       

      +

      •FACCH

      Fast Associated Control Channel. The FACCH appears in place of the traffic channel when lengthy signaling is required between a GSM mobile and the network while the mobile is in a call. The channel is indicated by use of the stealing flags in the normal burst. Typical signaling where this may be employed is during cell handover.

      +

       

      +

      •FACCH/F

      Full rate Fast Associated Control Channel. The FACCH is associated with a full rate traffic channel.

      +

       

      +

      •FACCH/H

      Half rate Fast Associated Control Channel. The FACCH is associated with a half rate traffic channel.

      +

       

      +

      •FB

      Frequency correction Burst.

      +

       

      +

      •FCB

      (Frequency Correction Burst) Period of RF carrier less than one timeslot whose modulation bit stream correction allows frequency to be performed easily within an MS.

      +

       

      +

      •FCC

      Federal Communications Commission. The FCC is a U.S. government agency that supervises, licenses, and controls electronic and electromagnetic transmission standards.

      +

       

      +

      •FCCH

      Frequency Correction Channel. A GSM broadcast control channel which carries information for frequency correction of the mobile (MS).

      +

       

      +

      •FCS

      Frame Check Sequence. FCS is a HDLC scheme used for error detection where 16 bits are added to both LAPD and MTP 2.

      +

       

      +

      •FDMA

      Frequency Division Multiple Access. FDMA is a technique in which multiple users of a radio system are separated in the frequency domain.

      +

       

      +

      •FDN

      Fixed Dialing Number. FDN allows calls only to predefined numbers.

      +

       

      +

      •FE

      Frame bit Error.

      +

       

      +

      •FEC

      Forward Error Correction. FEC techniques pass additional information along with the user data to the receiver. Any corruption of the user data can be repaired by the use of the additional data.

      +

       

      +

      •FER

      Frame Erasure Ratio. FER is the fraction of lost erroneous frames.

      +

       

      +

      •FH

      Frequency Hopping. FH is the repeated switching of frequencies during radio transmission according to a specified algorithm, to minimize unauthorized interception or jamming of telecommunications.

      +

       

      +

      •FIFO

      First-In First-Out. FIFO is a term used to describe routing buffers where no QoS (Quality of Service) is applied to packets entering the router. Packets are treated in the order that they are received by the router.

      +

       

      +

      •FIR

      Finite Impulse Response (filter type). A FIR is a filter whose response to a single point, or impulse, has finite extent. A FIR can be implemented using convolution.

      +

       

      +

      •FL

      Fault. A FL is anything that fails, that is wanting, or that impairs excellence.

      +

       

      +

      •FM

      Fault Management (at EMS).

      +

       

      +

      •FM

      Frequency Modulation. FM is a technique in which the frequency of the carrier is shifted by an amount proportional to the amplitude of the modulated signal.

      +

       

      +

      •FN

      Frame Number. Identifies the position of a particular TDMA frame within a hyperframe.

      +

       

      +

      •FR

      Full Rate. Refers to the current capacity of a data channel on the GSM air interface, that is, eight simultaneous calls per carrier (See Also HR - Half Rate).

      +

       

      +

      •FR

      Frame Relay. FR services are based on Broadband ISDN. The system supports very basic frames consisting of a logical channel address known as a DLCI (Data Link Connection Identifier). Frame handlers switch the logical channels based on switching tables populated through signaling or network management functions. Frames are variable in length with the maximum payload of 4,096 octets.

      +

       

      +

      •FRAD

      Frame Relay Access Device. A FRAD (also sometimes referred to as a frame relay assembler/disassembler) is a piece of networking equipment that assembles and disassembles data frames.

      +

       

      +

      •FPGA

      Field Programmable Gate Array. A FPGA is a an IC (integrated circuit) that can be programmed in the field after manufacture.

      +

       

      +

      •FS

      Frequency Synchronization.

      +

       

      +

      •FSE

      Field Service Engineer.

      +

       

      +

      •FSL

      Free Space Loss. The decrease in the strength of a radio signal as it travels between a transmitter and receiver. The FSL is a function of the frequency of the radio signal and the distance the radio signal has traveled from the point source.

      +

       

      +

      •FT1

      Fractional T1. FT1 is a portion of the 1.544 Mb/s (T1-aggregate) bit stream; the available fractions being determined by the type of multiplexer to achieve the T1 aggregate bit stream.

      +

       

      +

      •ft.

      Foot.

      +

       

      +

      •Ftn

      Forwarded-to number. Ftn is the number to which a call has been forwarded.

      +

       

      +

      •FTP

      File Transfer Protocol. A client server application protocol using well known ports 20 and 21. it uses the services of TCP (Transmission Control Protocol) to provide reliability in the transfer of data files between network nodes.

      +

       

      +

      0_011 TOP

      +

       

      +

      •G

       

      +

      •Gateway MSC

      An MSC that provides an entry point into the GSM PLMN from another network or service. A gateway MSC is also an interrogating node for incoming PLMN calls.

      +

       

      +

      •GB

      GigaByte (109). A GB is a measure of computer data storage capacity and is equal to one thousand million bytes.

      +

       

      +

      •Gb Interface

      The interface between the SGSN (Serving GPRS Support Node) and BSS (Base Station System).

      +

       

      +

      •GHz

      GigaHertz (109). Hertz is the number of cycles per second in an event (such as an electromagnetic wave); one Hz is equal to one cycle per second. GHz is equal to one thousand million hertz (1,000,000,000 Hz).

      +

       

      +

      •GGSN

      Gateway GPRS Support Node. The GGSN is a wireless gateway that allows mobile phone users to access the PDN (public data network) or specified private IP networks.

      +

       

      +

      •GMM

      GPRS Mobility Management. GMM is the protocol stack between the MS (Mobile Station) and the SGSN (Service GPRS Support Node) that handles GPRS attach/detach, PDP context activation/deactivation, etc.

      +

       

      +

      •GMSC

      Gateway Mobile Switching Center (see Gateway MSC).

      +

       

      +

      •GMSK

      Gaussian Minimum Shift Keying. The modulation technique used in GSM.

      +

       

      +

      •GND

      GrouND. In electrical engineering, something that is connected to the earth or at the voltage defined as zero.

      +

       

      +

      •GoS

      Grade of Service. GoS defines the quality of a telephone service in terms of a user receiving a network busy signal.

      +

       

      +

      •GPA

      GSM PLMN Area.

      +

       

      +

      •GPRS

      General Packet Radio Service. GPRS is a packet-based wireless communication service that promises data rates from 56 up to 114Kbps and continuous connection to the Internet for mobile phone and computer users. GPRS is based on GSM (Global System for Mobile communication) and complements existing standards.

      +

       

      +

      •GPS

      Global Positioning System. GPS comprises of multiple satellites all of which orbit the earth twice a day. Users with a GPS receiver use timing information from the satellites in order to triangulate their position on the earth surface.

      +

       

      +

      •GRX

      GPRS Roaming Exchange (GRX). Acts as a backbone between the individual PLMN/GPRS networks.

      +

       

      +

      •GSA

      GSM Service Area. The area in which an MS can be reached by a fixed subscriber, without the subscriber's knowledge of the location of the MS. A GSA may include the areas served by several GSM PLMNs.

      +

       

      +

      •GSA

      GSM System Area. The group of GSM PLMN areas accessible by GSM mobile stations.

      +

       

      +

      •GSC

      GPRS Subscriber Control.

      +

       

      +

      •GSD

      GPRS Subscriber Data.

      +

       

      +

      •GSM

      Group Special Mobile (the committee). The group of people in France that started the specification work for GSM.

      +

       

      +

      •GSM

      Global System for Mobile Communications (the system). Also, a term generically used to refer to GSM network (900 MHz), DCS network (1800 MHz), and PCS network (1900 MHz) systems.

      +

       

      +

      •GSM 900

      A cellular phone network using digital techniques conforming to the GSM standard, operating on frequencies of 890 - 915 MHz and 935 - 960 MHz. Also known as GSM.

      +

       

      +

      •GSN

      GPRS Support Node (see GPRS). GSN is a term which is used to include both GGSN (Gateway GPRS Support Node) and SGSN (Serving GPRS Support Node).

      +

       

      +

      •GT

      Global Title. The GT is an address used for routing in an SS7 network.

      +

       

      +

      •GTL

      GPRS Transport Layer.

      +

       

      +

      •GTP

      GPRS Tunnelling Protocol. GPRS Tunneling Protocol responsible for mobile initiated/network initiated PDP context activation/deactivation and tunneling of user data between SGSN and GGSN.

      +

       

      +

      •GTT

      Global Title Translation. The function of the GTT tables is to map titles to point codes and belongs to SCCP of SS7.

      +

       

      +

      •Guard Period

      Period at the beginning and end of timeslot during which MS transmission is attenuated.

      +

       

      +

      •GUI

      Graphical User Interface. GUI was the term coined when windows based operating systems were integrated with mouse operations. The concept of buttons, scroll bars and point and click operations have enhanced the interface.

      +

       

      +

      0_011 TOP

      +

       

      +

      •H

       

      +

      •Handover

      The action of switching a call in progress from one radio channel to another radio channel. Handover allows established calls to continue by switching them to another radio resource, as when an MS moves from one BTS area to another. Handovers may take place between the following GSM entities: timeslot, RF carrier, cell, BTS, BSS and MSC.

      +

       

      +

      •HDLC

      High-level Data Link Control. HDLC is a Layer 2 protocol for point to point and multipoint delivery of data. The frame consists of flags to delimit the frame, along with addressing information and control information which is used when the protocol is employed in the acknowledged mode. Also included in the frame is a payload area and a CRC (Cyclic Redundancy Code).

      +

       

      +

      •HLR

      Home Location Register. The VLR where the current location and all subscriber parameters of an MS are permanently stored.

      +

       

      +

      •HLRID

      Home Location Register IDentifier.

      +

       

      +

      •HO

      HandOver. The action of switching a call in progress from one radio channel to another radio channel. Handover allows established calls to continue by switching them to another radio resource, for example, when MSs move from one base station area to another.

      +

       

      +

      •HOLD

      Call hold supplementary service. HOLD is a supplementary service which allows you to hold a current conversation, receive an incoming call or make a new call.

      +

       

      +

      •HPLMN

      Home Public Land Mobile Network. The HPLMN identifies the PLMN (Public Land Mobile Network) in which the subscribers profile is held. Users roaming to other networks will receive subscription information from the HPLMN.

      +

       

      +

      •HR

      Half Rate. Refers to a type of data channel that will double the current GSM air interface capacity to 16 simultaneous calls per carrier (See Also FR - Full Rate).

      +

       

      +

      •HS

      HandSet.

      +

       

      +

      •HSCSD

      High Speed Circuit Switched Data. HSCSD enhances the data rates of the GSM network by combining timeslots over the radio interface. Data rates of 14.4Kbps, using one timeslot, 28.8Kbps using two time slots, or 57.6Kbps using four time slots can be achieved.

      +

       

      +

      •HSN

      Hopping Sequence Number. HSN is the parameter that determines the type of hopping pattern to be used in frequency hopping.

      +

       

      +

      •HTML

      Hyper Text Markup Language. HLML is an authoring language in which tags are used to format data and pictures on the HTML page. In addition, commands to download applications, generate hyperlinks and provide dynamic user interaction may also be included.

      +

       

      +

      •HTTP

      Hyper Text Transfer Protocol. HTTP is the standard protocol for the carriage of data around the internet.

      +

       

      +

      •HW

      Hardware.

      +

       

      +

      •Hyperframe

      2048 superframes. The longest recurrent time period of the frame structure.

      +

       

      +

      •Hz

      Hertz, cycles per second.

      +

       

      +

      •HZ

      Home Zone. Altobridge's HZ application uses GSM cellular technology to provide Wireless Local Loop services, and enable mobility within a neighborhood.

      +

       

      +

      0_011 TOP

      +

       

      +

      •I

       

      +

      •iPALIM

      IP Private A-link Intelligent Multiplexer

      +

       

      +

      •iRLS

      Intelligent RTP Local Switching

      +

       

      +

      •I

      Information (frames).

      +

       

      +

      •IAM

      Initial Address Message. The IAM is used to seize a circuit and transfer addressing and call handling/routing information in SS7 signaling networks.

      +

       

      +

      •IAP

      Internet Access Point.

      +

       

      +

      •IC

      Integrated Circuit. An IC is an electronic circuit that consists of many individual circuit elements, such as transistors, diodes, resistors, capacitors and other active and passive semiconductor devices, formed on a single chip of semiconducting material and mounted on a piece of substrate material.

      +

       

      +

      •ICB

      Incoming Calls Barred.

      +

       

      +

      •ICMP

      Internet Control Message Protocol. The ICMP is a Layer 2 protocol that reports errors and provides other information relevant to IP packet processing.

      +

       

      +

      •ICP

      Call Processor card.

      +

       

      +

      •IDD

      International Direct Dial. IDD is an international number which can be dialled directly by the user. As such, it will include the international prefix for the country.

      +

       

      +

      •IDIAP

      Call identifying internet access point.

      +

       

      +

      •ID, id

      Identification/Identity. A generic term used to identify such things as a user, network, channel, area, etc.

      +

       

      +

      •IE

      Information Element. An IE is a group of information which may be included within a signaling message or data flow which is sent across an interface.

      +

       

      +

      •IEC

      International Electrotechnical Commission. The IEC is an organization in Geneva that sets international standards for the electrical and electronic fields.

      +

       

      +

      •IEEE

      Institute of Electrical and Electronic Engineers. The IEEE is a professional organization whose activities include the development of communications and network standards.

      +

       

      +

      •IF

      Intermediate Frequency.

      +

       

      +

      •IM

      InterModulation. IM is the production, in a nonlinear element of a system, of frequencies corresponding to the sum and difference frequencies of the fundamentals and harmonics thereof that are transmitted through the element.

      +

       

      +

      •IMDX

      Intelligent MAP-D Multiplexer

      +

       

      +

      •IMEI

      International Mobile station Equipment Identity. Electronic serial number that uniquely identifies the MS as a piece or assembly of equipment. The IMEI is sent by the MS along with request for service.

      +

       

      +

      •IMSI

      International Mobile Subscriber Identity. Published mobile number (prior to ISDN) (See Also MSISDN) that uniquely identifies the subscription. It can serve as a key to derive subscriber information such as directory number(s) from the HLR.

      +

       

      +

      •IMP

      Management protocol enabling communication between the GSM network elements, Breeze2000 MSC and the EMS.

      +

       

      +

      •IMT

      International Mobile Telephony.

      +

       

      +

      •IN

      Intelligent Network. An IN is a network in which the intelligence is centralized and separated from the switching function. IN systems provide enhanced services.

      +

       

      +

      •INAP

      Intelligent Network Application Part. IN is the protocol offering real time communication between IN (Intelligent Network) elements.

      +

       

      +

      •in. lbs.

      Inch pounds (torque).

      +

       

      +

      •INP

      Network Processor.

      +

       

      +

      •INS

      IN Service.

      +

       

      +

      •Interworking

      The general term used to describe the inter-operation of networks, services, supplementary services and so on. See Also IWF.

      +

       

      +

      •I/0

      Input/Output. I/O describes any operation, program, or device that transfers data to or from a computer.

      +

       

      +

      •IP

      Internet Protocol. The IP provides a connectionless service between networks. The protocol provides features for addressing, type-of-service specification, fragmentation and reassembly, and security.

      +

       

      +

      •IRP

      Altobridge radio processor located on the two slot TRXs which enable GPRS functionality over the air (Um) interface.

      +

       

      +

      •ISDN

      Integrated Services Digital Network. An integrated services network that provides digital connections between user-network interfaces.

      +

       

      +

      •ISI

      Inter Symbol Interference. ISI is the interference between adjacent pulses of a transmitted code.

      +

       

      +

      •ISO

      International Standards Organization. The ISO is responsible for a wide range of standards, including those relevant to networking. The ISO developed the OSI (Open System Interconnection) reference model which is a popular networking reference tool.

      +

       

      +

      •ISP

      Internet Service Provider. An ISP is a company that provides Internet access to other companies and individuals.

      +

       

      +

      •ISR

      Altobridge single slot radio (TRX) card which enables greater functionality, such as GPRS and frequency hopping on the UltraWAVE platforms.

      +

       

      +

      •ISUP

      ISDN User Part. ISUP is part of the SS7 (Signaling System No.7) protocol layer and used in the setting up, management, and release of trunks that carry voice and data between calling and called parties.

      +

       

      +

      •ITU

      International Telecommunications Union. The ITU was established by the United Nations in order to determine a set of international telecommunications standards and to allocate radio frequencies for specific uses.

      +

       

      +

      •IWF

      Interworking Function. A network functional entity which provides network interworking, service interworking, supplementary service interworking or signaling interworking. It may be a part of one or more logical or physical entities in a GSM PLMN.

      +

       

      +

      •IWP

      First generation processor card for Altobridge GSM network elements.

      +

       

      +

      0_011 TOP

      +

       

      +

      •J

       

      +

      •JRE

      Java Runtime Environment. The JRE is part of the JDK (Java Development Kit), a set of programming tools for developing Java applications. The JRE provides the minimum requirements for executing a Java application.

      +

       

      +

      •JS

      Jump Start.

      +

       

      +

      •JTC

      Joint Technical Committee.

      +

       

      +

      0_011 TOP

      +

       

      +

      •K

       

      +

      •k

      kilo (1000). A combining form used to signify thousand in forming the names of units of measurement.

      +

       

      +

      •K

      Constraint length of the convolutional code.

      +

       

      +

      •kb

      kilobit (1000).

      +

       

      +

      •kbit/s, kbps

      kilobit per second (1000). kbit/s or kbps is a measurement of 鈥渄ata rate鈥� and is equal to 1000 bits every second.

      +

       

      +

      •Kc

      Ciphering key. A sequence of symbols that controls the operation of encipherment and decipherment.

      +

       

      +

      •kg

      kilogram (1000).

      +

       

      +

      •KHz

      kiloHertz (1000). KHz is a measure of frequency equal to 1000 cycles per second.

      +

       

      +

      •Ki

      Individual subscriber authentication Key (part of authentication process of AUC).

      +

       

      +

      •kW

      kiloWatt (1000). KW is a unit of power equal to 1000 watts.

      +

       

      +

      0_011 TOP

      +

       

      +

      •L

       

      +

      •L1

      Layer 1. L1 provides the functions for the transparent transmission of a bit stream between data link entities.

      +

       

      +

      •L2ML

      Layer 2 Management Link. The L2ML controls the TEI (Terminal Endpoint Identifier) management and addressing procedures (allocation, de-allocation of BTS internal transceiver addresses)

      +

       

      +

      •L3

      Layer 3. L3 provides the paths for the transfer of data between systems and across networks.

      +

       

      +

      •LA

      Location Area. An area in which an MS (Mobile Station) may move freely without updating the location register. An LA may comprise one or several base station areas. It is also the area that is used to page the MS (Mobile Station).

      +

       

      +

      •LAC

      Location Area Code. This code uniquely identifies a (LA) Location Area within a PLMN (Public Land Mobile Network). It may range from 0 to 65,535.

      +

       

      +

      •LAI

      Location Area Identification (identity). The information indicating the location area in which a cell is located.

      +

       

      +

      •LAN

      Local Area Network. A LAN is a network shared by communicating devices, usually on a small geographical area.

      +

       

      +

      •LAPD

      Link Access Protocol on the D channel. LAPD is a Layer 2 protocol used on the ISDN D channel.

      +

       

      +

      •LAPDm

      Link Access Protocol on the Dm channel. LAPDm is a modified version of LAPD and is used to support the transport of information between the mobile and the network.

      +

       

      +

      •lbs.

      Pounds (force).

      +

       

      +

      •LE

      Local Exchange. A LE is the first telephone exchange or switch into which the lines connecting subscribers terminate.

      +

       

      +

      •LEA

      Law Enforcement Agency. LEA is an agency responsible for insuring obedience to the laws.

      +

       

      +

      •LED

      Light Emitting Diode. A LED is a device which converts electrical energy into light.

      +

       

      +

      •LI

      Length Indicator. The LI is used to specify the number of octets which make up a given IE (Information Element).

      +

       

      +

      •LIU

      Line Interface Unit.

      +

       

      +

      •LLC

      Logical Link Control is responsible for acknowledged / unacknowledged data transfer. It provides a reliable logical link between the MS and the SGSN.

      +

       

      +

      •LNA

      Low Noise Amplifier. A LNA is a device that receives and amplifies weak signals, whilst contributing as little noise as possible.

      +

       

      +

      •Location Area

      An area in which a mobile station may move freely without updating the location register. A location area may comprise one or several base station areas.

      +

       

      +

      •LOF

      Loss of Frame. LOF is a type of transmission error that may occur in wide-area carrier lines.

      +

       

      +

      •LOS

      Loss of Signal.

      +

       

      +

      •LPC

      Linear Predictive Coding. LPC is an encoding technique used to aid in the prediction of the next sample.

      +

       

      +

      •LR

      Location Register. An LR is a database function storing information typically used in the routing of signaling information. Examples include the HLR (Home Location Register) and the VLR (Visitor Location Register).

      +

       

      +

      •LTE

      Local Terminal Emulator.

      +

       

      +

      •LTP

      Long Term Predictive.

      +

       

      +

      0_011 TOP

      +

       

      +

      •M

       

      +

      •M3UA

      MTP3 User Adaptation Layer. The M3UA provides the equivalent set of primitives at its upper layer to the MTP3 users as provided by the MTP Level 3. In effect, the M3UA extends access to the MTP3 layer services to a remote IP based application.

      +

       

      +

      •M

      Mega. M means million.

      +

       

      +

      •m

      Meters.

      +

       

      +

      •M

      Mandatory.

      +

       

      +

      •MA

      Mobile Allocation. The radio frequency channels allocated to an MS for use in its frequency hopping sequence.

      +

       

      +

      •MAC

      Medium Access Control. MAC is the lower of the two sublayers of the Data Link Layer and handles access to a shared medium.

      +

       

      +

      •MACN

      Mobile Allocation Channel Number.

      +

       

      +

      •MAH

      Mobile Access Hunting supplementary service.

      +

       

      +

      •MAI

      Mobile Allocation Index.

      +

       

      +

      •MAINT

      MAINTenance.

      +

       

      +

      •MAIO

      Mobile Allocation Index Offset.

      +

       

      +

      •MAP

      Mobile Application Part (of Signaling System No. 7). The inter-networking signaling between MSCs and LRs and EIRs.

      +

       

      +

      •MB

      MegaBytes. A MB is a unit of measurement for computer storage, memory and information. It is approximately equal to one million bytes.

      +

       

      +

      •Mbps, Mb/s

      Megabits per Second. Mbps describes a unit of data transfer to and from a computer storage device.

      +

       

      +

      •MCC

      Mobile Country Code. The MCC is a three digit number uniquely identifying a given country. It is utilized within the IMSI (International Mobile Subscriber Identity) and LAI (Location Area Identity).

      +

       

      +

      •MCC

      Multi-Channel Controller.

      +

       

      +

      •MCI

      Malicious Call Identification supplementary service.

      +

       

      +

      •MCL

      Minimum Coupling Loss.

      +

       

      +

      •MDM

      Mobile Directory Number.

      +

       

      +

      •ME

      Mobile Equipment. Equipment intended to access a set of GSM PLMN services, but which does not contain subscriber related information. Services may be accessed while the equipment, capable of surface movement within the GSM system area, is in motion or during halts at unspecified points.

      +

       

      +

      •MF

      MultiFrame.

      +

       

      +

      •MF

      Multi-Frequency (tone signaling type).

      +

       

      +

      •MFCR2

      Signaling and control protocol used in South America.

      +

       

      +

      •MGCP

      Media Gateway Control Protocol. A voice protocol that runs in conjunction with SS7 and an IP protocol to bridge circuit switched and packet networks. MGCP separates the signalling and call control from the media gateway.

      +

       

      +

      •MGMT

      Management.

      +

       

      +

      •MGR

      Manager.

      +

       

      +

      •MHC

      Multisite HLR Coordinator

      +

       

      +

      •MHS

      Message Handling System.

      +

       

      +

      •MHz

      MegaHertz. MHz is a measure of frequency equal to one million cycles per second.

      +

       

      +

      •MIB

      Management Information Base. EMS representation of object database.

      +

       

      +

      •Microcell

      A cell in which the base station antenna is generally mounted below rooftop level. Radio wave propagation is by diffraction and scattering around buildings, the main propagation is within street canyons.

      +

       

      +

      •min

      Minute.

      +

       

      +

      •MM

      Mobility Management. MM is a generic term representing the specific mobility functions provided by a mobile network.

      +

       

      +

      •MMI

      Man Machine Interface. MMI is the interface between the user and the equipment or machine.

      +

       

      +

      •MNC

      Mobile Network Code. The MNC is either a two or a three digit number used to uniquely identify a given network within a specified country. The MNC is used as part of the IMSI (International Mobile Subscriber Identity) and LAI (Location Area Identity).

      +

       

      +

      •MNRG

      Mobile station Not Reachable for GPRS Flag. This flag is found at the HLR (Home Location Register) and indicates that the mobile is not reachable through a SGSN (Serving GPRS Support Node). The presence of the flag will prevent any unnecessary GPRS signaling.

      +

       

      +

      •MO

      Mobile Originated. This is the term given to all communication initiated at the mobile.

      +

       

      +

      •MOM

      Manager of Managers.

      +

       

      +

      •MoU

      Memorandum of Understanding.

      +

       

      +

      •MPT

      Ministry of Post & Telecommunications.

      +

       

      +

      •MPTY

      Multi ParTY supplementary service.

      +

       

      +

      •MRFC

      Media Resource Function Controller

      +

       

      +

      •MRFP

      Media Resource Function Processor

      +

       

      +

      •MRN

      Mobile Roaming Number.

      +

       

      +

      •MS

      Mobile Station. The GSM subscriber unit. It is comprised of two distinct elements, the ME (Mobile Equipment) and the SIM (Subscriber Identity Module).

      +

       

      +

      •MSC

      Mobile Switching Center.

      +

       

      +

      •MSC-CCF

      Mobile Switching Center-Call Control Function. The MSC-CCF server is integrated in the MSS. This server is responsible for call control, processing and PSTN access for the UltraWAVE system.

      +

       

      +

      •MSCM

      Mobile Station Class Mark.

      +

       

      +

      •msec

      millisecond (.001 second).

      +

       

      +

      •MSI

      Mobile Subscriber Identity.

      +

       

      +

      •MSIN

      Mobile Station Identification Number. The MSIN forms part of the IMSI (International Mobile Subscriber Identity) to uniquely identify a mobile or subscription from within a given network.

      +

       

      +

      •MSISDN

      Mobile Station Integrated Services Digital Network. Published mobile number (See Also IMSI). Uniquely defines the mobile station as an ISDN terminal. It consists of three parts: the Country Code (CC), the National Destination Code (NDC) and the Subscriber Number (SN).

      +

       

      +

      •MSRN

      Mobile Station Roaming Number. A number assigned by the MSC to service and track a visiting subscriber.

      +

       

      +

      •MSS

      Multi-Service Server. The MSS is part of the UltraWAVE system and is running the VLR and MSC-CCF. It may also include the HLR, AUC, PPS, SMSC and VPS as optional servers.

      +

       

      +

      •MT

      Mobile Terminated. This is the term given to all communication which terminates at the mobile.

      +

       

      +

      •MT(0,1,2)

      Mobile Termination. The part of the MS which terminates the radio transmission to and from the network and adapts terminal equipment (TE) capabilities to those of the radio transmission. MT0 is mobile termination for voice with no support for terminal equipment. MT1 is mobile termination with support for an ISDN S-type interface. MT2 is mobile termination with support for a modem (R-type) interface.

      +

       

      +

      •MTA

      Metropolitan Trading Area.

      +

       

      +

      •MTBF

      Mean Time Between Failures. The average time a component works with out failure.

      +

       

      +

      •MTM

      Mobile-To-Mobile (call).

      +

       

      +

      •MTP

      Message Transfer Part. The MTP forms part of the SS7 protocol stack and provides reliable routing usually within a network.

      +

       

      +

      •MTP3

      Message Transfer Part level 3 provides message routing between signaling points in the SS7 network. It re-routes traffic away from failed links and signaling points and controls traffic when congestion occurs.

      +

       

      +

      •MTTR

      Mean Time To Repair. The average time to repair a failed system or device.

      +

       

      +

      •Multiframe

      Two types of multiframes are defined in the system: a 26-frame multiframe with a period of 120 ms and a 51-frame multiframe with a period of 3060/13 ms.

      +

       

      +

      •MUX

      Multiplexer. This is the term given to a device which multiplexes several signals onto a common transmission channel.

      +

       

      +

       

      +

      0_011 TOP

      +

       

      +

      •N

       

      +

      •N.cm

      Newton-centimeters (torque).

      +

       

      +

      •NAIG

      North American Interest Group.

      +

       

      +

      •NAM

      Network Access Mode.

      +

       

      +

      •NB

      Normal Burst (see Normal burst).

      +

       

      +

      •NCC

      Network (PLMN) Color Code. The NCC is broadcasted as part of the BSIC (Base Station Identity Code). It is used to differentiate between operators utilizing the same frequencies.

      +

       

      +

      •NCELL

      Neighboring (or current serving) Cell.

      +

       

      +

      •NDC

      National Destination Code.

      +

       

      +

      •NE

      Network Element (Network Entity). A generic term used to describe equipment operating as part of a communication network.

      +

       

      +

      •NGR

      New Generation Radio.

      +

       

      +

      •NIB

      GSM Network in a Box. The Altobridge chassis containing UltraWAVE, BSC and BTS functionality.

      +

       

      +

      •NIC

      Network Interface Card. A NIC allows a device to communicate across a network.

      +

       

      +

      •NM

      Network Management (manager). NM is all activities which control, monitor and record the use and the performance of resources of a telecommunications network in order to provide telecommunication services to customers/users at a certain level of quality.

      +

       

      +

      •NMC

      Network Management Center. The NMC node of the GSM TMN provides global and centralized GSM PLMN monitoring and control, by being at the top of the TMN hierarchy and linked to subordinate EMS nodes.

      +

       

      +

      •NMI

      Network Management Interface. NMI is used from the Craft PC or the EMS to verify and change equipment parameters.

      +

       

      +

      •NMS

      Network Management System.

      +

       

      +

      •Normal burst

      A period of modulated carrier less than a timeslot.

      +

       

      +

      •NPI

      Number Plan Identifier.

      +

       

      +

      •NR

      Not Required.

      +

       

      +

      •NRZ

      Non Return to Zero.

      +

       

      +

      •NS

      Network Service (sub-network independent portions) protocol between the SGSN and the BSS. This protocol manages NSVCs associated with NSEIs and performs load sharing among them.

      +

       

      +

      •NSEI

      Network Service Element Identifier. The NSEI together with the BVCI uniquely identifies a BSSGP virtual connection.

      +

       

      +

      •NSS

      Network Switch Subsystem.

      +

       

      +

      •NSVC

      Network Service Virtual Connection. Each physical link in Frame Relay can accommodate multiple permanent virtual circuits (PVCs) that are mapped to the NS virtual circuit.

      +

       

      +

      •NSVCI

      Network Service Virtual Connection Identifier. NSVCI identifies the circuit used in Gb interface carrying data over the frame relay link between BSS and SGSN

      +

       

      +

      •NT

      Non Transparent. NT utilizes the RLP (Radio Link Protocol) to ensure error free data by adopting a retransmission mechanism.

      +

       

      +

      0_011 TOP

      +

       

      +

      •O

       

      +

      •O&M, OAM

      Operations and Maintenance. This term refers to the processes and functions used in managing a network or an element within a network.

      +

       

      +

      •OACSU

      Off-Air Call SetUp. The procedure in which a telecommunication connection is being established while the RF link between the MS and the BTS is not occupied.

      +

       

      +

      •OCB

      Outgoing Calls Barred within the closed user group.

      +

       

      +

      •ODB

      Operator Determined Barring.

      +

       

      +

      •OEM

      Original Equipment Manufacturer.

      +

       

      +

      •OFL

      OverFlow (in percentage terms).

      +

       

      +

      •OMAP

      Operations and Maintenance Application Part (of Signaling System No. 7).

      +

       

      +

      •OMC

      Operations and Maintenance Center. The OMC node of the GSM TMN (Telecommunications Management Network) provides dynamic OAM monitoring and control of the PLMN nodes operating in the geographical area controlled by the specific OMC.

      +

       

      +

      •OMC-D

      Operations and Maintenance Center - Data Part.

      +

       

      +

      •OMC-R

      Operations and Maintenance Center - Radio Part.

      +

       

      +

      •OMC-S

      Operations and Maintenance Center - Switch Part.

      +

       

      +

      •OML

      Operations and Maintenance Link.

      +

       

      +

      •OOF

      Out Of Frame.

      +

       

      +

      •OOS

      Out Of Service.

      +

       

      +

      •OPC

      Originating Point Code. A part of the label in a signaling message that uniquely identifies, in a signaling network, the (signaling) origination point of the message.

      +

       

      +

      •OPPS

      Open-Prepaid-Roaming Public-Private System

      +

       

      +

      •OPR

      Open-to-all Prepaid Roaming

      +

       

      +

      •OS

      Operating System. This can be described as the software within a computer which controls basic functions.

      +

       

      +

      •OSI

      Open Systems Interconnection. The OSI is a 7 layer reference model developed by the International Standards Organization (ISO).

      +

       

      +

      •OSP

      Object Service Packages.

      +

       

      +

      •OSS

      Operating Support System.

      +

       

      +

      0_011 TOP

      +

       

      +

      •P

       

      +

      •PA

      Power Amplifier.

      +

       

      +

      •PABX

      Private Automatic Branch eXchange. The PABX is a private switch often found within a company. The PABX will perform switching of local calls within the company as well as setting up external connections with the local carrier.

      +

       

      +

      •PACCH

      Packet Associated Control Channel. The PACCH coveys signaling information related to a given GPRS mobile such as acknowledgements and power control information. The PACCH also carries resource assignment and reassignment messages.

      +

       

      +

      •PACS

      Personal Access Communication System.

      +

       

      +

      •PAD

      Packet Assembly / Disassembly. A PAD is a device used to assemble and disassemble packets enabling simple devices to connect to a packet switched network.

      +

       

      +

      •PAGCH

      Paging and Access Grant Channel. The PAGCH is used in the GPRS packet transfer establishment phase to send resource assignment to a MS (Mobile Station) prior to packet transfer.

      +

       

      +

      •Paging

      The procedure by which a GSM PLMN fixed infrastructure attempts to reach an MS within its location area, before any other network-initiated procedure can take place.

      +

       

      +

      •PALIM

      Private A-Link Intelligent Multiplexer interface.

      +

       

      +

      •PBX

      Private Branch exchange. An exchange system used in companies and organizations to handle internal and external calls.

      +

       

      +

      •PC

      Personal Computer.

      +

       

      +

      •PCCCH

      Packet Common Control CHannel. The PCCCH comprises of logical channels for GPRS common control signaling.

      +

       

      +

      •PCF

      Packet Control Function. The PCF is the entity in the BS Plus that manages the relay of packets between the BS Plus and the WAVE2000 PDSN.

      +

       

      +

      •PCH

      Paging CHannel. A GSM common control channel used to send paging messages to the MSs.

      +

       

      +

      •PCM

      Pulse Code Modulation. PCM is a process in which an analogue signal is encoded into a digital bit stream. The analogue is first sampled, then quantized and finally encoded into a bit stream.

      +

       

      +

      •PCMCIA

      Personal Computer Memory Card International Association. PCMCIA is a technical standard for small cards which are able to plug into notebooks to provide enhanced functions. Common examples are network cards, modem cards and security cards.

      +

       

      +

      •PCR

      Protocol Converter. A PCR translates between two protocols to facilitate communications between different systems.

      +

       

      +

      •PCS 1900

      Personal Communications Services. A cellular phone network using digital techniques similar to those used in GSM 900, but operating on frequencies of 1865 - 1910 MHz and 1945 - 1990 MHz.

      +

       

      +

      •PCU

      Packet Control Unit. The PCU is responsible for the radio related aspects of GPRS when connected to a GSM network and lies between the BTS (Base Transceiver Station) and the SGSN (Serving GPRS Support Node).

      +

       

      +

      •PDCH

      Packet Data Channel. The PDCH is a general term for a timeslot in GPRS which may carry either signaling or user data.

      +

       

      +

      •PDP

      Packet Data Protocol. Any protocol that transmits data as discrete units known as packets, such as IP or X.25.

      +

       

      +

      •PDS

      Packet Duplex Synchronous.

      +

       

      +

      •PDSN

      Packet Data Service Node. A PDSN provides access to the internet, intranets and applications servers for mobile stations utilizing a cdma2000 Radio Access Network (RAN).

      +

       

      +

      •PDTCH

      Packet Data Transmission CHannel. A PDTCH is a channel allocated for data transfer.

      +

       

      +

      •PDU

      Packet Data Unit. A unit of data specified in an (N)-protocol layer and consisting of (N)-protocol control information and possibly (N)-user data.

      +

       

      +

      •PH

      PHysical (layer).

      +

       

      +

      •PID

      Path ID.

      +

       

      +

      •PIN

      Personal Identification Number.

      +

       

      +

      •Plaintext

      Unciphered data.

      +

       

      +

      •PLL

      Phase Lock Loop (refers to phase locking the GCLK in the BTS).

      +

       

      +

      •PLMN

      Public Land Mobile Network. The PLMN is a generic name for all mobile wireless networks that use land based radio transmitters or base stations.

      +

       

      +

      •PM

      Performance Management. An EMS application.

      +

       

      +

      •P/N

      Part Number.

      +

       

      +

      •POST

      Power-On Self Test.

      +

       

      +

      •POTS

      Plain Old Telephone Service (basic telephone services). A term used to describe an ordinary voice telephone service.

      +

       

      +

      •PP

      Peak-to-Peak.

      +

       

      +

      •PPM

      Parts Per Million.

      +

       

      +

      •PPP

      Point-to-Point Protocol. The PPP was designed to provide router to router and host to network connections over synchronous and asynchronous circuits.

      +

       

      +

      •PPS

      Prepaid System.

      +

       

      +

      •PRI/R2

      Primary Rate Interface/R2 Trunk Signaling. A PRI is an ISDN term describing either an E1 circuit in Europe or a T1 circuit in North America.

      +

       

      +

      •PRM

      Performance Report Message.

      +

       

      +

      •PSAP

      Public Safety Answering Point.

      +

       

      +

      •PSPDN

      Public Switched Packet Data Network. Public data communications network. X.25 links required for NE to EMS communications will probably be carried by PSPDN.

      +

       

      +

      •PSTN

      Public Switched Telephone Network. The landline telephone network.

      +

       

      +

      •PTCCH

      Packet Timing Advance Control Channel. The PTCCH is used in GPRS to ensure that the correct timing advance is maintained for each MS (Mobile Station).

      +

       

      +

      •PUCT

      The value of the Home Unit in a currency chosen by the subscriber.

      +

       

      +

      •PVC

      Permanent Virtual Circuit. A connection to a network that allows connection and disconnection to various points is a switched virtual circuit. Circuits that are routed through software switching devices like X.25 pads and frame relay networks are virtual. A hard wired connected in a plain old circuit, not a virtual circuit.

      +

       

      +

      •PW

      Password.

      +

       

      +

      •PWR

      Power.

      +

       

      +

      0_011 TOP

      +

       

      +

      •Q

       

      +

      •QA

      Q (Interface) - Adapter.

      +

       

      +

      •QAF

      Q - Adapter Function.

      +

       

      +

      •QoS

      Quality Of Service. The performance of a communications channel or system is usually expressed in terms of QoS.

      +

       

      +

      •QCELP

      QualComm Code Excited Linear Predictive Coding. A vector quantizer-based speech codec that changes compression ratios for segments of speech.

      +

       

      +

      0_011 TOP

      +

       

      +

      •R

       

      +

      •R2

      R2 Trunk Signaling. R2 is a CCS (Common Channel Signaling) system that allows the equipment units at the exchanges to send and receive digits.

      +

       

      +

      •RA

      Routing Area. The SGSN (Serving GPRS Support Node) will control one or more RA (Routing Area). It is the responsibility of the mobile to keep the SGSN informed as to its current RA. Routing Areas can be made up of one or more cells.

      +

       

      +

      •RAB

      Random Access Burst.

      +

       

      +

      •RAC

      Routing Area Code. RAC is a fixed length of 1 octet and identifies a routing area within a location area.

      +

       

      +

      •RACCH

      Random Access Control Channel. A GSM common control channel used to originate a call or respond to a page.

      +

       

      +

      •RACH

      Random Access Channel. The channel used for initial access into a system. The RACH function is different depending on the technology of the system.

      +

       

      +

      •RADIUS

      Remote Authentication Dial-In User Service. RADIUS is a system of distributed security that secures remote access to networks and network services against unauthorized access. RADIUS is designed to simplify the security process by separating the security technology from the communications technology.

      +

       

      +

      •RAI

      Remote Alarm Indication.

      +

       

      +

      •RAM

      Random Access Memory. RAM is the place in a computer where the operating system, application programs, and data currently in use are kept so that they can be quickly reached by the computer's processor. Turning off the computer looses the data in the RAM.

      +

       

      +

      •RAND

      RANDom number. A number selected from a known set of numbers in such a way that each number has the same probability of occurrence. This is typically used in the authentication and ciphering process.

      +

       

      +

      •RAU

      Routing Area Update. A GPRS mobile will perform a RAU in the Ready and Standby state. The RAU is triggered when the mobile crosses a RA (Routing Area) boundary, or periodically. A RAU is also performed when the mobile moves from the Idle to the Standby state. This will typically happen when the mobile is powered on.

      +

       

      +

      •RBER

      Residual Bit Error Ratio.

      +

       

      +

      •REC

      RECommendation.

      +

       

      +

      •REJ

      REJect(ion).

      +

       

      +

      •REL

      RELease.

      +

       

      +

      •RELP

      Residual Excited Linear Predictive.

      +

       

      +

      •RELP-LTP

      RELP Long Term Prediction. A name for GSM full rate.

      +

       

      +

      •REQ

      REQuest.

      +

       

      +

      •RF

      Radio Frequency. Any frequency within the electromagnetic spectrum normally associated with radio wave propagation.

      +

       

      +

      •RFC, RFCH

      Radio Frequency Channel. A partition of the system RF spectrum allocation with a defined bandwidth and center frequency.

      +

       

      +

      •RFD

      RF Distribution card.

      +

       

      +

      •RFI

      Radio Frequency Interference.

      +

       

      +

      •RLC

      Radio Link Control. A sublayer of the radio interface that provides reliability. RLC varies depending on the communication system employed.

      +

       

      +

      •RLP

      Radio Link Protocol. An ARQ protocol used to transfer user data between an MT and IWF (see GSM 04.22).

      +

       

      +

      •RMC

      Rate Metering and Congestion.

      +

       

      +

      •RMS

      Root Mean Square (value).

      +

       

      +

      •ROM

      Read Only Memory. ROM is built in computer memory containing data that normally can only be read but not written to. ROM is not lost when the computer is turned off.

      +

       

      +

      •RPE -Regular Pulse Excited. RPE-LTP

      Regular Pulse Excitation - Long Term Prediction. The GSM digital speech coding scheme.

      +

       

      +

      •RR

      Radio Resource management. RR is used to control the radio resources over an air interface.

      +

       

      +

      •RSL

      Radio Signaling Link.

      +

       

      +

      •RSSI

      Received Signal Strength Indication. RSSI is the measured power of a received signal.

      +

       

      +

      •RSZI

      Regional Subscription Zone Identity.

      +

       

      +

      •RTE

      Remote Terminal Emulator.

      +

       

      +

      •Rx

      Receive(r). Rx is the terminator of any signal on a transmission medium.

      +

       

      +

      •RXLEV_D

      Received signal level downlink. RXLEV_D indicates the average signal strength received downlink.

      +

       

      +

      •RXLEV_U

      Received signal level uplink. RXLEV_U indicates the average signal strength received uplink.

      +

       

      +

      •RXQUAL_D

      Received signal quality downlink. RXQUAL_D indicates the average signal quality received downlink.

      +

       

      +

      •RXQUAL_U

      Received signal quality uplink. RXQUAL_U indicates the average signal quality received uplink.

      +

       

      +

      0_011 TOP

      +

       

      +

      •S

       

      +

      •SABM

      Set Asynchronous Balanced Mode. A message which establishes the signaling link over the air interface.

      +

       

      +

      •SACCH

      Slow Associated Control CHannel. A GSM control channel used by the MS for reporting RSSI and signal quality measurements.

      +

       

      +

      •SACCH/C4

      Slow Associated Control CHannel/SDCCH/4. A GSM signaling channel that provides a relatively low signaling connection. The SAACH is associated with either a traffic or dedicated channel. The SAACH can also be used to transfer SMS (Short Message Service) messages if associated with a traffic channel.

      +

       

      +

      •SACCH/C8

      Slow Associated Control CHannel/SDCCH/8.

      +

       

      +

      •SACCHFT

      Slow Associated Control CHannel/Traffic channel.

      +

       

      +

      •SACCHFTF

      Slow Associated Control CHannel/Traffic channel Full rate.

      +

       

      +

      •SACCHFTH

      Slow Associated Control CHannel/Traffic channel Half rate.

      +

       

      +

      •SAP

      Service Access Point. In the reference model for OSI, SAPs of a layer are defined as gates through which services are offered to an adjacent higher layer.

      +

       

      +

      •SAPI

      Service Access Point Indicator (identifier). SAPI is used to identify a SAP and may identify what is required by the upper layer.

      +

       

      +

      •SB

      Synchronization Burst (see Synchronization). SB is information used by the receiver to get synchronized to an incoming signal.

      +

       

      +

      •SCCP

      Signaling Connection Control Part provides connection-less and connection-oriented services and extended functions including specialized routing (GTT- Global Title Translation) and sub-system management capabilities above MTP3.

      +

       

      +

      •SCF

      Service Control Function. SCF is used in IN (Intelligent Network) to control functional entities in providing Intelligent Network services.

      +

       

      +

      •SCH

      Synchronization CHannel. A GSM broadcast control channel used to carry information for frame synchronization of MSs and identification of base stations.

      +

       

      +

      •SCP

      Service Control Point (an intelligent network entity). SCP is a physical entity in the IN (Intelligent Network) that implements a SCF (Service Control Function).

      +

       

      +

      •SCSI

      Small Computer Serial Interface. SCSI is a standard for computer system communication.

      +

       

      +

      •SCTP

      Streaming Control Transmission Protocol. SCTP is a reliable transport protocol operating on top of IP.

      +

       

      +

      •SDCCH

      Standalone Dedicated Control CHannel. A GSM control channel where the majority of call setup occurs. Used for MS to BTS communications before MS assigned to TCH.

      +

       

      +

      •SDF

      Service Data Function. SDF is the set of functions in a IN (Intelligent Network) that provides for the management of service data in accordance with a service data template.

      +

       

      +

      •SDH

      Synchronous Digital Hierarchy. SDH is a method of transmitting digital information where the data is packed in containers which are synchronized in time enabling relatively simple modulation and demodulation at the transmitting and receiving ends. This technique is used to carry high capacity information over long distances.

      +

       

      +

      •SDU

      Selection and Distribution Unit. In CDMA networks, the SDU combines the signals from multiple BTSs and converts the low-rate compressed data to and from 64 kb/s traffic used by the public switched telephone network (PSTN).

      +

       

      +

      •SEF

      Severely Errored Frame.

      +

       

      +

      •SELV

      Safety Extra Low Voltage. Being specified as a SELV system includes a protective measure against direct and indirect contact with hazardous voltages through "safe separation" implemented in the device.

      +

       

      +

      •SES

      Severely Errored Second. A one-second period that contains >30% errored blocks or at least one severely disturbed period.

      +

       

      +

      •SF

      Superframe. Each SF consists of 12 frames.

      +

       

      +

      •SFH

      Slow Frequency Hopping. SFH is a technique in which the carrier frequency changes using a predetermined hopping pattern. The hopping pattern is slower than the bit rate.

      +

       

      +

      •SG

      Signaling Gateway. An SG is used to support the transport of signaling traffic received from one network and passed into another network.

      +

       

      +

      •SGSN

      Serving GPRS Support Node. The SGSN keeps track of the location of an individual MS (Mobile Station) and performs security functions and access control.

      +

       

      +

      •SID

      Silence Descriptor. SID is a frame that conveys information on the background noise.

      +

       

      +

      •SIF

      Signal Information Field. The bits of a message signal unit that carry information for a certain user transaction; the SIF always contains a label.

      +

       

      +

      •SIM

      Subscriber Identity Module. Removable module which is inserted into a mobile equipment; it is considered as part of the MS. It contains security related information (IMSI, Ki, PIN), other subscriber related information and the algorithms A3 and A8.

      +

       

      +

      •SITE

      BSC, BTS or collocated BSC-BTS site.

      +

       

      +

      •SLC

      Signaling Link Code. The SLC is the number of the SL (Signaling Link) to which SS7 MTP management messages are related.

      +

       

      +

      •SM

      Session Management. The SM function exists in the mobile and in the SGSN (Serving GPRS Support Node) and handles PDP (Packet Data Protocol) Context Activation, Modification, Deactivation, and Preservation Functions.

      +

       

      +

      •SMA

      Sub-Miniature type A connector.

      +

       

      +

      •SMCLI

      Subscriber Management Command Line Interface.

      +

       

      +

      •SMEG

      SMS Email Gateway.

      +

       

      +

      •SMG

      Special Mobile Group. The ETSI (European Telecommunications Standards Institute) technical committee SMG has the primary function of coordinating some aspects of GSM.

      +

       

      +

      •SMGUI

      Subscriber Management Graphical User Interface.

      +

       

      +

      •SMPP

      Support Short Message Peer-to-Peer.

      +

       

      +

      •SMS

      Short Message Service. The SMS that allows a SME (Short Message Entity) to send text messages to other SME.

      +

       

      +

      •SMSCB

      Short Message Service Cell Broadcast.

      +

       

      +

      •SMS-SC

      Short Message Service - Service Center. The SMS-SC is a store and forward center for SMS.

      +

       

      +

      •SMS/PP

      Short Message Service/Point-to-Point.

      +

       

      +

      •SMTP

      Simple Mail Transfer Protocol. SMTP is the TCP/IP protocol which facilitates the transfer of electronic-mail messages, specifies how two systems are to interact, and the format of messages used to control the transfer of electronic mail.

      +

       

      +

      •SN

      Subscriber Number. SN is the number dialled to reach a customer in a telecoms network.

      +

       

      +

      •S/N

      Serial Number.

      +

       

      +

      •SND

      SEND.

      +

       

      +

      •SNDCP

      Sub-Network Dependent Convergence Protocol. SNDCP provides services to the higher layers which may include connectionless and connection-oriented mode, compression, multiplexing and segmentation.

      +

       

      +

      •SNMP

      Simple Network Management Protocol. SNMP is part of the TCP/IP suite and is used to control and manage IP gateways and other network functions.

      +

       

      +

      •SONET

      Synchronous Optical Network. SONET is an interface standard for synchronous optical fiber transmission, applicable to the physical layer of the OSI (Open Systems Interconnection) reference model

      +

       

      +

      •SP

      Signaling Point. A SP is a node in the SS7 network. it is either the originating or terminating point.

      +

       

      +

      •SPC

      Signaling Point Code. SPC is a code used by the SS7 network for routing purposes.

      +

       

      +

      •SQL

      Structured Query Language.

      +

       

      +

      •SRES

      Signed RESponse (authentication). SRES is the variable generated in the AUC (Authentication Center) and the MS (Mobile Station). A successful authentication occurs if the SRES value received from the AUC by the VLR (Visitor Location Register) matches that sent by the MS.

      +

       

      +

      •SRF

      Specialized Resource Function. SRF is the set of functions for the control and access to resources used in providing services.

      +

       

      +

      •SS7, SS#7

      CCITT Signaling System No. 7 (alias C7). A CCS (Common Channel Signaling) system defined by the ITU-T (International Telecommunications Union-Telecommunications Standardization Sector).

      +

       

      +

      •SSF

      Service Switch Function. SSF is the set of processes in an IN (Intelligent Network) that provides the communication path for interaction between a CCF (Call Control Function) and a SSF (Service Switching Function).

      +

       

      +

      •SSN

      Sub System Number. The SCCP (Signaling Connection Control Part) function uses the SSN to determine the local subsystem.

      +

       

      +

      •SSP

      Service Switching Point (an intelligent network element). SSP is the physical entity in an IN (Intelligent Network) that implements the service switching function.

      +

       

      +

      •SSP

      SCCP messages, Subsystem-prohibited.

      +

       

      +

      •STP

      Signaling Transfer Point. In a common channel signaling network, a STP provides for the transfer of signaling messages from one SL (Signaling Link) to another.

      +

       

      +

      •SUBM

      Subscriber Management.

      +

       

      +

      •Superframe

      51 traffic/associated control multiframes or 26 broadcast/common control multiframes (period 6.12 s).

      +

       

      +

      •SW

      Software.

      +

       

      +

      •Synchronization

      Period of RF carrier less than one timeslot whose modulation bit stream burst carries information for the MS to synchronize its frame to that of the received signal.

      +

       

      +

      •SYS

      SYStem.

      +

       

      +

      0_011 TOP

      +

       

      +

      •T

       

      +

      •T1

      24-channel 1.544 Mbps communication system.

      +

       

      +

      •TA

      Terminal Adaptor. A physical entity in the MS (Mobile Station) providing terminal adaptation functions (see GSM 04.02).

      +

       

      +

      •TA

      Timing Advance. In order to get TDMA (Time Division Multiple Access) schemes to work, the time-frames from each mobile must be synchronized when received by a base station. This synchronization is achieved by using the concept of TA. The TA value can be computed only by the BTS, and is then provided to the mobile through signaling.

      +

       

      +

      •TAF

      Terminal Adaptation Function. The functional part of the MS (Mobile Station) which performs the adaptation between a specific terminal equipment (TE) and the generic radio transmission part is called the TAF.

      +

       

      +

      •TAP

      Telelocator Alphanumeric Protocol. TAP defines the wireless standard for sending alphanumeric messages to pagers.

      +

       

      +

      •TBF

      Time Between Failures. TBF is that average time that a component works without failure. It is calculated by dividing the total number of failures into the total number of operating hours.

      +

       

      +

      •TBF

      Temporary Block Flow. A TBF is a physical connection used by the two RR (Radio Resource) entities to support the unidirectional transfer of LLC (logical Link Control) PDU (Protocol Data Unit) on packet data physical levels. A TBF is temporary and only remains for the duration of the data flow.

      +

       

      +

      •TC

      Transaction Capabilities.

      +

       

      +

      •TCAP

      Transaction Capabilities Application Part (of Signaling System No. 7). TCAP enables the deployment of advanced intelligence in the network by supporting non circuit related information exchange between SP (Signaling Point) using the SCCP (Signaling Connection Control Part) connectionless service.

      +

       

      +

      •TCH

      Traffic CHannel. GSM logical channels which carry either encoded speech or user data. A Traffic channel can be one of the following: TCH/F (full rate TCH), TCH/F2.4 (full rate TCH at < 2.4 kbit/s), TCH/F4.8 (full rate TCH at 4.8 kbit/s), TCH/F9.6 (full rate TCH at 9.6 kbit/s), TCH/FS (full rate speech TCH), TCH/H (half rate TCH), TCH/H2.4 (half rate TCH at 2.4 kbit/s), TCH/H4.8 (half rate TCH at 4.8 kbit/s) or TCH/HS (half rate speech TCH).

      +

       

      +

      •TCP/IP

      Transmission Control Protocol/Internet Protocol. The TCP/IP suite includes, but is not limited to, protocols such as TCP (Transmission Control Protocol), IP (Internet Protocol), UDP (User Datagram Protocol), ICMP (Internet Control Message Protocol), FTP (File Transfer Protocol), and SMTP (Simple Mail Transfer Protocol).

      +

       

      +

      •TDM

      Time Division Multiplexing. TDM is a digital multiplexing technique in which two or more apparently simultaneous channels can be combined to form a bit stream by interleaving bits or bit words from different channels.

      +

       

      +

      •TDMA

      Time Division Multiple Access. TDMA is a communication technique that uses a common channel for communications among multiple users by allocating each a unique time slot.

      +

       

      +

      •TE

      Terminal Equipment. Equipment that provides the functions necessary for the operation of the access protocols by the user.

      +

       

      +

      •Tei

      Terminal endpoint identifier. Tei is a unique identifier given to each device or terminal on an ISDN S or T interface.

      +

       

      +

      •TEI

      Terminal Equipment Identity. Each TRX (Transceiver) in a BTS (Base Transceiver Station) corresponds to one or several links and these links are distinguished by TEIs.

      +

       

      +

      •Test SIM

      SIM used for handset and network testing.

      +

       

      +

      •TFA

      TransFer Allowed. TFA is a procedure included in the signaling route management functionality that is used to inform a signaling point that a signaling route to a specific destination has become available.

      +

       

      +

      •TFP

      TransFer Prohibited. TFA is a procedure included in the signaling route management functionality that is used to inform a signaling point of the unavailability of a signaling route.

      +

       

      +

      •Timeslot

      The multiplex subdivision in which voice and signaling bits are sent over the air. Each RF carrier is divided into eight timeslots.

      +

       

      +

      •Timing advance

      A signal sent by the BTS to the MS. It enables the MS to advance the timing of its transmission to the BTS so as to compensate for propagation delay.

      +

       

      +

      •TLLI

      Temporary Logical Link Identity. The TLLI provides a signaling address for communication between the MS (Mobile Station) and the SGSN (Serving GPRS Support Node).

      +

       

      +

      •TMN

      Telecommunications Management Network. The implementation of the Network Management functionality required for the PLMN is in terms of physical entities which together constitute the TMN.

      +

       

      +

      •TMSI

      Temporary Mobile Subscriber Identity. A unique identity temporarily allocated by the MSC to a visiting mobile subscriber to process a call. May be changed between calls and even during a call, to preserve subscriber confidentiality.

      +

       

      +

      •TN

      Timeslot Number. The radio interface of GSM uses a combination of FDMA (Frequency Division Multiple Access) and TDMA (Time Division Multiple Access) along with Frequency Hopping to create channels. The information is sent in time and frequency windows which we call slots. Each frequency is divided into 8 timeslots, numbering 0 to 7.

      +

       

      +

      •TON

      Type Of Number.

      +

       

      +

      •Traffic channels

      Channels which carry users' speech or data.

      +

       

      +

      •Traffic unit

      Equivalent to an Erlang.

      +

       

      +

      •Training sequence

      Sequence of modulating bits employed to facilitate timing recovery and channel equalization in the receiver.

      +

       

      +

      •Transceiver

      A device that transmits and receives. In IEEE 802.3 networks, the attachment hardware that connects the controller interface to the transmission cable.

      +

       

      +

      •TRAU

      Transcoder Rate Adaption Unit. The TRAU performs a transcoding (encoding/decoding) function for speech channels and rate adaptation for data channels.

      +

       

      +

      •TRFD

      TurboWAVE Radio Frequency Distribution card.

      +

       

      +

      •TRX

      TRansceiver(s). A network component which can serve full duplex communication on eight full-rate traffic channels according to specification GSM 05.02. If Slow Frequency Hopping (SFH) is not used, then the TRX serves the communication on one RF carrier.

      +

       

      +

      •TS

      Timeslot (see Timeslot). In a TDMA (Time Division Multiple Access) system the carrier is split into multiple timeslots, the duration being dependant on the technology.

      +

       

      +

      •TS

      Technical Specification.

      +

       

      +

      •TS

      TeleService. A TS is a complete end-to-end service, including terminal capabilities used by the end parties.

      +

       

      +

      •TSC

      Training Sequence Code. The TSC is used to maintain timing and equalize the channel.

      +

       

      +

      •TSDI

      Transceiver Speech & Data Interface.

      +

       

      +

      •TSP

      Telecommunications Service Provider.

      +

       

      +

      •TU

      Traffic Unit. 1 TU = 1 Erlang.

      +

       

      +

      •TUP

      Telephone User Part (of Signaling System No. 7). TUP was an earlier implementation of SS7 that did not allow for data type applications.

      +

       

      +

      •Tx

      Transmit(ter). The source or generator of any signal on a transmission medium.

      +

       

      +

      •TXPWR

      Transmit PoWeR; Tx power level in the MS-TXPWR_REQUEST and MS-TXPWR-CONF parameters.

      +

       

      +

      0_011 TOP

      +

       

      +

      •U

       

      +

      •UA

      Unnumbered Acknowledgment. A message sent from the MS to the BSS to acknowledge release of radio resources when a call is being cleared.

      +

       

      +

      •UDI

      Unrestricted Digital Information. This is an ISDN (Integrated Services Digital Network) term to describe the ability to transfer any bit pattern over a digital channel.

      +

       

      +

      •UDUB

      User Determined User Busy.

      +

       

      +

      •UI

      Unnumbered Information frame.

      +

       

      +

      •Um

      Air interface.

      +

       

      +

      •UMTS

      Universal Mobile Telecommunication System.

      +

       

      +

      •UP

      User Parts.

      +

       

      +

      •UPD

      Up to date.

      +

       

      +

      •Uplink

      Physical link from the MS towards the BTS (MS transmits, BTS receives).

      +

       

      +

      •UPS

      Uninterruptable Power Supply.

      +

       

      +

      •US

      United States of America.

      +

       

      +

      •USSD

      Unstructured Supplementary Services Data.

      +

       

      +

      •UTRA

      Universal Terrestrial Radio Access.

      +

       

      +

      •UUS

      User-to-User Signaling supplementary service.

      +

       

      +

      0_011 TOP

      +

       

      +

      •V

       

      +

      •VA

      Vitirbi Algorithm (used in channel equalizers).

      +

       

      +

      •VAC

      Volts AC.

      +

       

      +

      •VAD

      Voice Activity Detection. A process used to identify presence or absence of speech data bits. VAD is used with DTX.

      +

       

      +

      •VAS

      Value Added Services.

      +

       

      +

      •VCO

      Voltage Controlled Oscillator.

      +

       

      +

      •VDC

      Volts DC.

      +

       

      +

      •VLR

      Visitor Location Register. A GSM network element which provides a temporary register for subscriber information for a visiting subscriber. Often a part of the MSC.

      +

       

      +

      •VME

      VersaModule-Eurocard bus.

      +

       

      +

      •VMS

      Voice Mail System. The VMS provides voice mail service to the calling party when the called party is busy, no answer, not reachable or turned off.

      +

       

      +

      •VPLMN

      Visited Public Land Mobile Network. A VPLMN is that PLMN on which the mobile subscriber has roamed when leaving their HPLMN (Home Public Land Mobile Network).

      +

       

      +

      •VPS

      Voice Prompt System (also known as Audio Announcement Server).

      +

       

      +

      •VSWR

      Voltage Standing Wave Ratio. The VSWR is the ratio between the sum and difference of the incident and the reflection voltage waves.

      +

       

      +

      •VSS

      Voice Service System. It integrates the Audio Announcement System (AAS) and Voice Mail System (VMS) to provide both multi-lingual announcement and voice mail service.

      +

       

      +

      0_011 TOP

      +

       

      +

      •W

       

      +

      •WAN

      Wide Area Network. A network that provides data communications over a large geographical area.

      +

       

      +

      •WAP

      Wireless Access Protocol. WAP is a standard that allows the content of the Internet to be viewed on the screen of mobile devices such as a mobile phone.

      +

       

      +

      •WLL

      Wireless Local Loop. WLL is a system that connects subscribers to the PSTN (Public Switched Telephone Network) using radio signals.

      +

       

      +

      •WOS

      Wireless Office System.

      +

       

      +

      •UltraWAVE

      WAVEXchange II Switch. The UltraWAVE is a large capacity Altobridge digital wireless switch which can support GMSC, MSC, VLR and HLR switch configurations and is equipped with multiple A-Interface and PSTN trunks. The UltraWAVE integrates value-added IN prepaid, short message, voice mail and multi-party conference services. The UltraWAVE can support up to 100,000 subscribers.

      +

       

      +

      0_011 TOP

      +

       

      +

      •X

       

      +

      •X.25

      CCITT specification and protocols for public packet-switched networks.

      +

       

      +

      •X.25 link

      A communications link which conforms to X.25 specifications and uses X.25 protocol (NE to EMS links).

      +

       

      +

      •X/MOTIF

      X windows Motif. The basis of the GUI used for the Altobridge EMS.

      +

       

      +

      0_011 TOP

      +

       

      +

      •Y

       

      +

      •YP

      yellow pages

      +

       

      +

      0_011 TOP

      +

       

      +

      •Z

       

      +

      •ZF

      intermediate frequency

      +

       

      +

      0_011 TOP

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

       

      +

      9

      + +
      + + + diff --git a/wxc2_omc/omcHelp/D-500027-0-20-E.chm b/wxc2_omc/omcHelp/D-500027-0-20-E.chm new file mode 100755 index 0000000..92408e3 Binary files /dev/null and b/wxc2_omc/omcHelp/D-500027-0-20-E.chm differ diff --git a/wxc2_omc/omcHelp/HHReg.exe b/wxc2_omc/omcHelp/HHReg.exe new file mode 100755 index 0000000..32c7f6f Binary files /dev/null and b/wxc2_omc/omcHelp/HHReg.exe differ diff --git a/wxc2_omc/omcHelp/altobridge_logo.gif b/wxc2_omc/omcHelp/altobridge_logo.gif new file mode 100755 index 0000000..6de9cc9 Binary files /dev/null and b/wxc2_omc/omcHelp/altobridge_logo.gif differ diff --git a/wxc2_omc/omcHelp/cicon1.gif b/wxc2_omc/omcHelp/cicon1.gif new file mode 100755 index 0000000..3ceb30b Binary files /dev/null and b/wxc2_omc/omcHelp/cicon1.gif differ diff --git a/wxc2_omc/omcHelp/cicon2.gif b/wxc2_omc/omcHelp/cicon2.gif new file mode 100755 index 0000000..9b70d75 Binary files /dev/null and b/wxc2_omc/omcHelp/cicon2.gif differ diff --git a/wxc2_omc/omcHelp/cicon9.gif b/wxc2_omc/omcHelp/cicon9.gif new file mode 100755 index 0000000..1ba854d Binary files /dev/null and b/wxc2_omc/omcHelp/cicon9.gif differ diff --git a/wxc2_omc/omcHelp/ciconidx.gif b/wxc2_omc/omcHelp/ciconidx.gif new file mode 100755 index 0000000..1072837 Binary files /dev/null and b/wxc2_omc/omcHelp/ciconidx.gif differ diff --git a/wxc2_omc/omcHelp/default.css b/wxc2_omc/omcHelp/default.css new file mode 100755 index 0000000..fd5d70e --- /dev/null +++ b/wxc2_omc/omcHelp/default.css @@ -0,0 +1,122 @@ +/* Text Styles */ +hr { color: #000000} +body, table, tr, th /* Normal */ +{ + font-size: 10pt; + font-family: Arial; + font-style: normal; + font-weight: normal; + color: #000000; + text-decoration: none; +} +span.f_CodeExample /* Code Example */ +{ + font-size: 8pt; + font-family: 'Courier New'; +} +span.f_Comment /* Comment */ +{ +} +span.f_CourierFixed /* Courier Fixed */ +{ + font-size: 9pt; + font-family: 'Courier New'; +} +span.f_Heading1 /* Heading1 */ +{ + font-size: 14pt; + font-weight: bold; + color: #ffffff; +} +span.f_ImageCaption /* Image Caption */ +{ + font-size: 8pt; + font-weight: bold; +} +span.f_NewStyle /* New Style */ +{ +} +span.f_NoramlTest /* Noraml Test */ +{ +} +span.f_NormalTest2 /* Normal Test2 */ +{ +} +span.f_Notes /* Notes */ +{ +} +span.f_Table /* Table */ +{ + color: #ffffff; + background-color: #ff0000; +} +/* Paragraph styles */ +p /* Normal */ +{ + text-align: left; + text-indent: 0px; + padding: 0px 0px 0px 0px; + margin: 0px 0px 0px 0px; +} +.p_CodeExample /* Code Example */ +{ + white-space: nowrap; +} +.p_Comment /* Comment */ +{ +} +.p_Heading1 /* Heading1 */ +{ + font-size: 100%; + font-weight: normal; + text-align: left; + text-indent: 0px; + padding: 0px 0px 0px 0px; + margin: 0px 0px 0px 0px; +} +.p_ImageCaption /* Image Caption */ +{ +} +.p_NewStyle /* New Style */ +{ + margin: 0px 12px 0px 12px; +} +.p_NoramlTest /* Noraml Test */ +{ + margin: 0px 12px 0px 12px; +} +.p_NormalTest2 /* Normal Test2 */ +{ + margin: 0px 12px 0px 25px; +} +.p_Notes /* Notes */ +{ +} +.p_Table /* Table */ +{ + margin: 0px 12px 0px 12px; +} + + +#hmpopupdiv /* used for javascript text popups */ +{ + display: none; + position: absolute; + z-index: 1000; + background-color: #FFFFFF; + padding: 6px; + border:1px solid #000000; + border-radius: 5px; + box-shadow: 5px 5px 5px #888; +} + +#hmlightbox /* image lightbox */ +{ + border: none; + padding: 8px; + background: #FFF; + font-size: 110%; + font-weight: bold; + color: #777; + box-shadow: 5px 5px 5px #888; +} diff --git a/wxc2_omc/omcHelp/ems_online_help_content.htm b/wxc2_omc/omcHelp/ems_online_help_content.htm new file mode 100755 index 0000000..e9a45c6 --- /dev/null +++ b/wxc2_omc/omcHelp/ems_online_help_content.htm @@ -0,0 +1,403 @@ +锘� + + EMS R9.1.9 Online Help + + + + + + + + + + + + + +

      Altobridge_Logo

      +
      + +
      + + + + + +

      Copyright 漏 2012 Altobridge

      + + \ No newline at end of file diff --git a/wxc2_omc/omcHelp/ems_online_help_kwindex.htm b/wxc2_omc/omcHelp/ems_online_help_kwindex.htm new file mode 100755 index 0000000..272de1f --- /dev/null +++ b/wxc2_omc/omcHelp/ems_online_help_kwindex.htm @@ -0,0 +1,242 @@ + + + EMS R9.1.9 Online Help v1.0 + + + + + + + + + + + +

      Altobridge_Logo

      +
      + +
      + + +
      +

      - A -

      +

      AAS

      +

      AAS Parameter Dictionary

      +

      Abbreviations

      +

      Access Administration

      +

      ACN

      +

      Alarm Log

      +

      AMR MG Parameter Dictionary

      +

      Application Context Name

      +

      AUC

      +

      AUC Parameter Dictionary

      +

      AUC Subscriber

      +

      - C -

      +

      Call Barring

      +

      Call Forwarding

      +

      Call Hold

      +

      Call Transfer

      + +

      Call Waiting

      +

      Cap Call

      +

      CDR Download

      +

      CDR MSC

      +

      CDR PPS

      +

      CDR SMSC

      +

      Cell

      +

      CIC Table

      +

      CLIP

      +

      CLIR

      +

      COLP

      +

      COLR

      +

      COS Parameter Dictionary

      +

      CSRR

      +

      CSTA Download

      +

      - D -

      +

      Debug

      +

      Dialing Prefix

      +

      Dialing Prefix Set

      +

      Dialing Prefix Set ID

      +

      - E -

      +

      ECT

      + +

      EIR

      +

      EIR Parameter Dictionary

      +

      EIR Subscriber

      +

      Emergency Call

      +

      - G -

      +

      Gb Converter Parameter Dictionary

      +

      - H -

      +

      HLR

      +

      HLR Parameter Dictionary

      +

      HLR Subscriber

      +

      - I -

      +

      iGRS Parameter Dictionary

      +

      IMDX

      + +

      IMEI

      +

      iPALIM

      +

      iPALIM Parameter Dictionary

      +

      iRLS

      +

      iRLS Parameter Dictionary

      +

      - L -

      +

      LAC

      +

      License Control

      +

      Linkset ID

      + +

      - M -

      +

      Media Gateway

      +

      MG ID

      + +

      MHC

      +

      MNP

      +

      MNP Parameter Dictionary

      +

      MNP Subscriber

      +

      MSC

      +

      MTP3

      +

      - N -

      +

      NRTRDE

      +

      - O -

      +

      OMC Status

      +

      Operation Log

      +

      OPPS

      +

      OPPS Parameter Dictionary

      +

      OPR

      + +

      OSB

      +

      - P -

      +

      PPS

      +

      PPS Daily Report

      +

      PPS Monthly Report

      +

      PPS Parameter Dictionary

      +

      PPS Subscriber

      +

      PPS Weekly Report

      +

      Premium Call

      +

      Prepaid

      +

      - R -

      +

      Recharge Card

      +

      Routing Selection

      +

      Routing Selection ID

      +

      Routing Zone Set

      +

      Routing Zone Set ID

      +

      - S -

      +

      SCCP

      +

      Scratch Card

      +

      SG ID

      + +

      SMEG

      +

      SMSC

      +

      SMSC Parameter Dictionary

      +

      SS7

      +

      Statistic AAS

      +

      Statistic BHCA

      +

      Statistic Erlang

      +

      Statistic OPPS

      +

      Statistic Service

      +

      Statistic SMEG

      +

      Statistic SMSC

      +

      Statistic TG

      +

      Statistic VMS

      +

      - T -

      +

      Tariff Discount

      +

      Tariff Holiday

      +

      Tariff MO

      +

      Tariff MT

      +

      Trunk

      +

      Trunk Group

      +

      Trunk Group ID

      + +

      - U -

      +

      UES

      +

      - V -

      +

      VIM

      +

      VLR

      +

      VLR Parameter Dictionary

      +

      VLR Subscriber

      +

      VMS

      +

      VMS Subscriber

      +

      VPLMN ID

      +

      VSS Parameter Dictionary

      +

      - W -

      +

      WSMS

      +

      - X -

      +

      XAPP

      +
      + + + + diff --git a/wxc2_omc/omcHelp/ems_online_help_popup_html.js b/wxc2_omc/omcHelp/ems_online_help_popup_html.js new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/omcHelp/helpman_navigation.js b/wxc2_omc/omcHelp/helpman_navigation.js new file mode 100755 index 0000000..79b1b34 --- /dev/null +++ b/wxc2_omc/omcHelp/helpman_navigation.js @@ -0,0 +1,397 @@ +/* ------------ Script copyright 2005-2012 EC Software ------------- + This script was created by Help & Manual and is part of the + Webhelp export format. This script is designed for use in + combination with the output of Help & Manual and must not + be used outside this context. http://www.helpandmanual.com + + Do not modify this file! It will be overwritten by Help & Manual. + ----------------------------------------------------------------- */ + +var usecookie = false; +var tocselecting = false; +var abspossupported = 0; +var currentselection = null; +var currenttocstate = ""; + +if (gaaccount != "") { + var _gaq = _gaq || []; + _gaq.push(["_setAccount", gaaccount]); + _gaq.push(["_trackPageview"]); + (function() { + var ga = document.createElement("script"); + ga.type = "text/javascript"; ga.async = true; + ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js"; + var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s); + })(); +} + +function hmAddCss(adoc, cssCode) { + var styleElement = adoc.createElement("style"); + styleElement.type = "text/css"; + if (styleElement.styleSheet) { + styleElement.styleSheet.cssText = cssCode; + } + else { + styleElement.appendChild(adoc.createTextNode(cssCode)); + } + adoc.getElementsByTagName("head")[0].appendChild(styleElement); +} + +function hmSupportsAbspos() { + if (abspossupported==0) { + tmp = $('
       
      ').appendTo('body'); + if (($(tmp).outerWidth()+30) > $(window).width()) abspossupported = 1; + else abspossupported = -1; + tmp.remove(); + } + if (abspossupported==1) return true; + return false; +} + +function hmNoAbsposResize(jdiv, w, h) { + var windowWidth, windowHeight; + if (self.innerHeight) { // all except Explorer + if(document.documentElement.clientWidth){ + windowWidth = document.documentElement.clientWidth; + } else { + windowWidth = self.innerWidth; + } + windowHeight = self.innerHeight; + } else if (document.documentElement && document.documentElement.clientHeight) { // Explorer 6 Strict Mode + windowWidth = document.documentElement.clientWidth; + windowHeight = document.documentElement.clientHeight; + } else if (document.body) { // other Explorers + windowWidth = document.body.clientWidth; + windowHeight = document.body.clientHeight; + } + if (w) jdiv.css('width', ( windowWidth - parseInt(jdiv.css('left')) - parseInt(jdiv.css('right')) )); + if (h) jdiv.css('height', ( windowHeight - parseInt(jdiv.css('top')) - parseInt(jdiv.css('bottom')) )); +} + +function hmNavigationFrame() { + for (var i=0;i-1), false); + } + } + if (hmContentFrame()) { + var topicID = hmContentFrame().location.href.substring(hmContentFrame().location.href.lastIndexOf("/")+1,hmContentFrame().location.href.length); + if (topicID.lastIndexOf("#") != -1) topicID = topicID.substring(0,topicID.lastIndexOf("#")); + if (topicID.lastIndexOf("?") != -1) topicID = topicID.substring(0,topicID.lastIndexOf("?")); + tocselecting = false; + lazysync(topicID); + } + hmAnimate = tmpAnimate; +} + +function savestate(toc) { + currenttocstate = ""; + var items = toc.getElementsByTagName("ul"); + for(var i = 0; i < items.length; i++) if (items[i].style.display!="none") currenttocstate = currenttocstate.concat(items[i].id + ","); + if (usecookie) document.cookie = currenttocstate; +} + +function toggle(nodeID) { + var thisUL = hmULfromID(nodeID); + if (thisUL) hmSwitchNode(thisUL, ((thisUL.style.display=="none")?true:false), true); +} + +function hmNodeClicked(node, event) { + if (event.stopPropagation) { event.stopPropagation(); } else { event.cancelBubble = true; } //MSIE + var scrOfX = $(hmNavigationFrame()).scrollLeft(); + var scrOfY = $(hmNavigationFrame()).scrollTop(); + var offset = parseInt( $(node).css('padding-left')); + var thisClicked = ( (event.clientY+scrOfY > $(node).offset().top) && (event.clientY+scrOfY < ($(node).offset().top+offset)) && + (event.clientX+scrOfX > $(node).offset().left) && (event.clientX+scrOfX < ($(node).offset().left+offset+$(node.firstChild).outerWidth())) ); + var iconClicked = (thisClicked && (event.clientX+scrOfX > $(node).offset().left) && (event.clientX+scrOfX < ($(node).offset().left+offset))); + var thisID = node.id; + if (iconClicked) { + toggle('ul'+thisID.substring(1,thisID.length)); + } + else if (thisClicked) { + if (hmTocSingleClick) { + hilightexpand('s'+thisID.substring(1,thisID.length)); + } + else { + hilight('s'+thisID.substring(1,thisID.length)); + } + } +} + +function hmNodeDblclicked(node) { + thisID = node.id; + toggle('ul'+thisID.substring(1,thisID.length)); +} + +function hmLIfromID(thisID) { + return hmNavigationFrame().document.getElementById('i'+thisID.replace(/[isaul]/g,'')); +} + +function hmULfromID(thisID) { + return hmNavigationFrame().document.getElementById('ul'+thisID.replace(/[isaul]/g,'')); +} + +function hmSwitchNode(thisUL, nodevisible, animate) { + if ((thisUL.style.display!='none')!=nodevisible) { + var thisLI = hmLIfromID(thisUL.id); + if (thisLI) { + var thisIcon = thisLI.getAttribute('data-bg'); + if (thisIcon!='') $(thisLI).css('background-image', 'url(' + (nodevisible ? thisIcon.substr(thisIcon.indexOf(';')+1, thisIcon.length) : thisIcon.substr(0, thisIcon.indexOf(';')) ) + ')'); + + if (nodevisible) { + if (animate && hmAnimate) $(thisUL).slideDown('fast'); + else thisUL.style.display = 'block'; + } + else { + if (animate && hmAnimate) $(thisUL).slideUp('fast'); + else thisUL.style.display = 'none'; + } + } + } +} + +function hilightexpand(spanID) { + if (hilight(spanID)) { + var thisUL = hmULfromID(spanID); + if (thisUL) hmSwitchNode(thisUL, true, true); + return true; + } + else return false; +} + +function hilight(spanID) { + tocselecting = true; + var thisnode = null; + var selectionchanged = false; + thisnode = hmNavigationFrame().document.getElementById(spanID); + if (thisnode) { + try { + if ((currentselection) && (currentselection != thisnode)) currentselection.className = "heading" + currentselection.className.substr(7,1); + } + catch(e){ + } + thisnode.className = "hilight"+thisnode.className.substr(7,1); + selectionchanged = (currentselection != thisnode); + currentselection = thisnode; + } + return selectionchanged; +} + +function intoview(thisnode, tree, selectionchanged) { + var thisparent = thisnode; + while (thisparent != tree) { + if ((selectionchanged) && (thisparent.nodeName.toLowerCase()=="ul")) hmSwitchNode(thisparent,true,true); + thisparent = thisparent.parentNode; + } + thisparent = thisnode; + for (var t=0; thisparent!=null; t+=thisparent.offsetTop, thisparent=thisparent.offsetParent); + var bt = (hmNavigationFrame().window.pageYOffset)?hmNavigationFrame().window.pageYOffset:hmNavigationFrame().document.body.scrollTop; + var bh = (hmNavigationFrame().window.innerHeight)?hmNavigationFrame().window.innerHeight:hmNavigationFrame().document.body.offsetHeight; + if ((t+thisnode.offsetHeight-bt) > bh) hmNavigationFrame().window.scrollTo(0,(t+24-bh)) + else if (t < bt) hmNavigationFrame().window.scrollTo(0,t); +} + +function collapseunfocused(toc, selectedID) { + if (toc) { + var nodepath = 'ul'+selectedID.replace(/[isaul]/g,''); + var items = toc.getElementsByTagName("ul"); + for (var i = 0; i < items.length; i++) { + if (nodepath.lastIndexOf(items[i].id)<0) { hmSwitchNode(items[i], false, false); } + } + } +} + +function quicksync(aID) { + if (aID != "") { + var toc = hmNavigationFrame().document.getElementById("toc"); + if (toc) { + if (!tocselecting) { + aID = "s"+aID.substring(1,aID.length); + var thisspan = hmNavigationFrame().document.getElementById(aID); + if (thisspan) { + var selectionchanged = hilight(aID); + intoview(thisspan, toc, selectionchanged); + } + } + if (autocollapse) { + if (currentselection) collapseunfocused(toc, currentselection.id); + else collapseunfocused(toc, ""); + } + } + } + tocselecting = false; +} + +function lazysync(topicID) { + if (topicID != "") { + var toc = hmNavigationFrame().document.getElementById("toc"); + if (toc) { + if (!tocselecting) { + var currentTopic = $("a[href^='"+topicID+"']",toc); + if (currentTopic.length > 0) { + var currentSpanID = $(currentTopic).children("span").attr("id"); + var selectionchanged = false; + if (hmTocSingleClick) { + selectionchanged = hilightexpand(currentSpanID); + } + else { + selectionchanged = hilight(currentSpanID); + } + intoview(currentTopic[0], toc, selectionchanged); + } + } + if (autocollapse) { + if (currentselection) collapseunfocused(toc, currentselection.id); + else collapseunfocused(toc, ""); + } + } + } + tocselecting = false; +} + +function hmPreloadIcons() { + var icons = new Array(); + for (i=0; i 
      '); + + var oldX; + var navWidth; + var minWidth; + var oldLeft; + var oldWidth; + var oldSplitL; + var split = $('#hmsplitter'); + + $(window).resize(function() { /* resize splitter when window changes */ + split.css('height', $(leftdiv).outerHeight()+'px'); + }); + + split.bind('mousedown', startDrag); + + function startDrag(e) { + oldX = (!document.all) ? e.clientX : event.clientX; + navWidth = parseInt($(leftdiv).css('width'),10); + minWidth = parseInt($(leftdiv).css('min-width')); + oldLeft = $(rightdiv).offset().left; + oldWidth = $(rightdiv).outerWidth(); + oldSplitL = split.offset().left; + + var bg = $('
      ').appendTo('body'); + bg.bind('mousemove', performDrag); + bg.bind('mouseup', endDrag); + split.bind('mousemove', performDrag); + split.bind('mouseup', endDrag); + + function endDrag() { + bg.unbind('mousemove').unbind('mouseup').remove(); + split.unbind('mousemove').unbind('mouseup'); + } + } + + function performDrag(e) { + //deselect: + if (window.getSelection) window.getSelection().removeAllRanges(); + else if (document.selection) document.selection.empty(); + + var moveX = (!document.all) ? e.clientX - oldX : event.clientX - oldX; + var newNavW = navWidth + moveX < minWidth ? minWidth : navWidth + moveX; + $(leftdiv).css('width', (newNavW) + 'px'); + //split.css('left', ($(leftdiv).offset().left+newNavW) + 'px'); + split.css('left', (oldSplitL + newNavW - navWidth) + 'px'); + + $(rightdiv).css('left', (oldLeft + newNavW - navWidth) + 'px'); + if (!hmSupportsAbspos()) $(rightdiv).css('width', (oldWidth - newNavW + navWidth) + 'px'); + } + +} diff --git a/wxc2_omc/omcHelp/helpman_settings.js b/wxc2_omc/omcHelp/helpman_settings.js new file mode 100755 index 0000000..8374822 --- /dev/null +++ b/wxc2_omc/omcHelp/helpman_settings.js @@ -0,0 +1,11 @@ +/* Project settings */ +var hmForceRedirect = true; +var hmAnimate = true; +var hmPopupSticky = true; +var hmImageLightbox = true; +var hmVideoLightbox = true; +var hmForceRedirect = true; +var hmTocSingleClick = false; +var autocollapse = false; +var gaaccount = ""; +var initialtocstate = "collapsed"; diff --git a/wxc2_omc/omcHelp/helpman_topicinit.js b/wxc2_omc/omcHelp/helpman_topicinit.js new file mode 100755 index 0000000..b8d04ca --- /dev/null +++ b/wxc2_omc/omcHelp/helpman_topicinit.js @@ -0,0 +1,422 @@ +锘�/* --------------- Script (c) 2006-2011 EC Software --------------- +This script was created by Help & Manual. It is designed for use +in combination with the output of Help & Manual and must not +be used outside this context. http://www.helpandmanual.com + +Do not modify this file! It will be overwritten by Help & Manual. +-----------------------------------------------------------------*/ + +var topicInitScriptAvailable = true; +var HMToggles = new Array(); +var HMGallery = new Array(); +var HMTogglesAllExpanded = false; + +function hmmin(v1, v2) { if (v1v2) return v1; return v2 } + +var HMSyncTOC = function(indexPageUrl, selfUrl) { + if (location.search.lastIndexOf("toc=0")<=0) { + if (parent.hmNavigationFrame) { parent.lazysync(selfUrl); } + else if ((hmForceRedirect) && (parent.location) && (parent.location.href)) { parent.location.href = indexPageUrl+'?'+selfUrl; } + } +} + +var HMToggleExpandAll = function(value) { + if (HMToggles.length != null){ + for (i=0; i
      ').insertBefore(obj); + else $(dummy).css('display', 'block'); + $(dummy).css('display', 'none'); + } + }); + } + } + else { + obj.style.display = (value ? "block" : "none"); + } +} + +var HMToggleExpandPicture = function(obj, value, animate) { + var newSrc = (value ? obj.getAttribute("hm.src1") : obj.getAttribute("hm.src0")); + var isToggleIcon = (obj.getAttribute("hm.type")=="dropdown"); + + if ((!isToggleIcon) && (animate)) { + $(obj).stop(); + + var newImg = new Image(); + newImg.onload = function() { + var newWidth = newImg.width; + var newHeight = newImg.height; + var oldWidth = obj.width; + var oldHeight = obj.height; + + if ((newWidth > 0) && (newHeight > 0)) { + if ((newWidth == oldWidth) && (newHeight == oldHeight)) { + obj.src = newSrc; + } + else { + $(obj).animate({ width: newWidth, height: newHeight }, 'fast', function() { + obj.src = newSrc; + }); + } + } + }; + newImg.src = newSrc; + } + else { + obj.src = newSrc; + $(obj).css('width', 'auto'); + $(obj).css('height', 'auto'); + } + var newTitle = (value ? obj.getAttribute("hm.title1") : obj.getAttribute("hm.title0")); + if (newTitle != null) { obj.title = newTitle; } + var newCaption = (value ? obj.getAttribute("hm.caption1") : obj.getAttribute("hm.caption0")); + if (newCaption != null) { obj.parentNode.parentNode.parentNode.nextSibling.firstChild.firstChild.innerHTML = newCaption; } +} + +var HMShowPictureLightbox = function(objID) { + var obj = document.getElementById(objID); /* our clicked */ + + var startL = $(obj).offset().left; + var startT = $(obj).offset().top; + var startW = $(obj).outerWidth(); + var startH = $(obj).outerHeight(); + + var newSrc = obj.getAttribute("hm.src1"); + var newTitle = obj.getAttribute("hm.title1"); + var newCaption = obj.getAttribute("hm.caption1"); + + var htmlCode = '' + newTitle + ''; + var imgPreloader = new Image(); + imgPreloader.onload = function() { + HMShowLightbox(htmlCode, startL, startT, startW, startH, imgPreloader.width, imgPreloader.height, newCaption, true, false); + }; + imgPreloader.src = newSrc; + +} + +var HMShowVideoLightbox = function(event, obj, htmlcode, vWidth, vHeight) { + var startL = $(obj).offset().left; + var startT = $(obj).offset().top; + var startW = $(obj).outerWidth(); + var startH = $(obj).outerHeight(); + + if (event.stopPropagation) { event.stopPropagation(); } else { event.cancelBubble = true; } //MSIE + + HMShowLightbox(htmlcode, startL, startT, startW, startH, vWidth, vHeight, '', false, true); +} + +var HMShowLightbox = function(htmlCode, startL, startT, startW, startH, endW, endH, newCaption, doAnimate, isVideo) { + /* Find our scope: + * 1) Is this an orphan window or part of a webhelp frame? + * 2) If it is a webhelp frame, is it an iframe or classic ? + * 3) Can we do cross-frame scripting? (not possible in Chrome locally) + */ + var parentScope = ((parent.hmNavigationFrame) && (parent.document.getElementById('hmnavigation')) && (parent.document.getElementById('hmnavigation').nodeName.toLowerCase()=='iframe')); + var lightboxWindow = $(window); + var lightboxDocument = $(document); + var lightboxBody = $('body'); + var lighboxScrollLayer = null; + if (parentScope) { /* use entire window for lightbox */ + lightboxBody = parent.$('body'); + lightboxDocument = parent.$(document); + lightboxWindow = parent.window; + } + + $(lightboxBody).append('
      '); + var lightboxBackground = parentScope ? parent.$('#hmlightboxbackground') : $('#hmlightboxbackground'); + lightboxBackground.css('opacity', '0.5'); + + if (parentScope) { + $(lightboxBody).append('
      '); + lighboxScrollLayer = parent.$('#hmlightboxscrolllayer'); + lightboxBody = lighboxScrollLayer; + } + + $(lightboxBody).append(''); + var lightbox = parentScope ? parent.$('#hmlightbox') : $('#hmlightbox'); + var lightboxObject = $(htmlCode).appendTo(lightbox); + var lightboxCaption = null; + if (newCaption != null) { + $(lightbox).append('

      ' +newCaption+ '

      '); + lightboxCaption = parentScope ? parent.$('#hmlightboxcaption') : $('#hmlightboxcaption'); + } + + var lightboxSpeed = 300; + var sizeStart; /* keep initial size for hide animation */ + + lightboxObject.css({'width': endW+'px', 'height': endH+'px'}); + if (lightboxCaption!=null) lightboxCaption.css('width', endW+'px'); + + if (hmAnimate&&doAnimate) { + var sizeEnd = lightboxGetsize(); + if (lightboxCaption!=null) lightboxCaption.css('display', 'none'); /* hide caption during animation */ + lightboxObject.css({'width': startW + 'px', 'height': startH + 'px'}); + sizeStart = lightboxGetsize(); + lightboxResize(); + + sizeStart[0] = startL; + sizeStart[1] = startT; + if (parentScope) { + sizeStart[0] = sizeStart[0] + parent.$('#hmcontent').offset().left - $(document).scrollLeft(); + sizeStart[1] = sizeStart[1] + parent.$('#hmcontent').offset().top - $(document).scrollTop(); + } + lightbox.css({'left': sizeStart[0]+'px', 'top': sizeStart[1]+'px'}); + lightbox.show(); + + lightbox.animate({ left: sizeEnd[0]-lightboxObject.position().left, top: sizeEnd[1]-lightboxObject.position().top }, + lightboxSpeed, + function() { + if (lightboxCaption!=null) lightboxCaption.css('display', 'block'); + } + ); + + lightboxObject.animate({ width: endW, height: endH }, lightboxSpeed); + } + else { + var sizeEnd = lightboxGetsize(); + lightboxResize(); + lightbox.show(); + } + + $(lightboxWindow).bind('resize.hmlightbox', lightboxResize); + $(lightboxWindow).bind('scroll.hmlightbox', lightboxScroll); + $(lightboxBody).bind('click.hmlightbox', lightboxClick); + $(lightboxBody).bind('keydown.hmlightbox', lightboxKeydown); + $(lightbox).focus(); + + function lightboxScroll() { + lightboxBackground.css('width', (($(lightboxDocument).scrollLeft() > 0) ? $(lightboxDocument).width() : $(lightboxWindow).width()) +'px'); + lightboxBackground.css('height', (($(lightboxDocument).scrollTop() > 0) ? $(lightboxDocument).height() : $(lightboxWindow).height()) +'px'); + } + + function lightboxResize() { + var size = lightboxGetsize(); + lightbox.css({left: size[0]+'px', top:size[1]+'px'}); + + if (lighboxScrollLayer!=null) { + lighboxScrollLayer.css({'width': $(lightboxWindow).width()+'px', 'height': $(lightboxWindow).height()+'px'}); + } + lightboxScroll(); + } + + function lightboxGetsize() { + var lbW = lightbox.width(); + var lbH = lightbox.height(); + + var newW = hmmax(lbW + 40, lightboxDocument.width()); + var newH = hmmax(lbH + 40, lightboxDocument.height()); + + var newL = hmmax(20, parseInt(($(lightboxWindow).width() - lbW)/2) + (parentScope ? 0 : lightboxDocument.scrollLeft())); + var newT = hmmax(20, parseInt(($(lightboxWindow).height() - lbH)/2) + (parentScope ? 0 : lightboxDocument.scrollTop())); + + var size = new Array(newL, newT, lbW, lbH); + return size; + } + + function lightboxKeydown(e) { + if (e.keyCode == 27) lightboxClose(); + } + + function lightboxClick(e) { + var canClose = (!isVideo) || + (e.pageX < lightbox.position().left) || (e.pageY < lightbox.position().top) || + (e.pageX > lightbox.position().left+lightbox.width()) || (e.pageY > lightbox.position().top+lightbox.height()); + if (canClose) lightboxClose(); + } + + function lightboxClose() { + if (hmAnimate&&doAnimate) { + if (lightboxCaption!=null) lightboxCaption.css('display', 'none'); /* hide caption during animation */ + lightboxObject.animate({ width: startW, height: startH }, lightboxSpeed); + lightbox.animate({ left: sizeStart[0]-lightboxObject.position().left, top: sizeStart[1]-lightboxObject.position().top }, + lightboxSpeed, + function() { + lightbox.remove(); + if (lighboxScrollLayer!=null) lighboxScrollLayer.remove(); + lightboxBackground.remove(); + } + ); + } + else { + lightbox.remove(); + if (lighboxScrollLayer!=null) lighboxScrollLayer.remove(); + lightboxBackground.remove(); + } + $(lightboxWindow).unbind('.hmlightbox'); + $(lightboxBody).unbind('.hmlightbox'); + } + +} + + + +var HMSearchCheck = function(obj) { + var foundHilite = window.location.search.lastIndexOf("zoom_highlight") > 0; + if (!foundHilite) { + var fontTags = obj.getElementsByTagName("FONT"); + if (fontTags.length > 0) { + var hStyle = ""; + for (var cCheck = 0; cCheck < fontTags.length; cCheck++) { + hStyle = fontTags[cCheck].style.cssText; + if (hStyle.indexOf("BACKGROUND-COLOR") == 0) { + foundHilite = true; + break; + } + } + } + } + return foundHilite; +} + +var HMInitToggle = function() { + if (document.getElementById) { + var node = document.getElementById(HMInitToggle.arguments[0]); + var isPicture = false; + for (i=1; i0) { + if (parent.gaaccount) { parent.track("exit", obj.href); } + } +} + +var hmshowPopup = function(event, txt, trigger) { + + $('#hmpopupdiv').stop().remove(); + + var pop = $('
      ').appendTo('body'); + if (hmPopupSticky) { + $('body').bind('mouseup.hmpopup', hmhidePopup); + $('body').bind('keydown.hmpopup', function(e) { if (e.keyCode == 27) hmhidePopup(); } ); + } + pop.html(txt); + var posLeft = event.clientX+$(document).scrollLeft(); + var posTop = event.clientY+$(document).scrollTop(); + + var maxW = $(window).width()/1.5; + var w = pop.width(); + if (w > maxW) pop.width(maxW); + var t = 20 + posTop; + var l = (posLeft + $(trigger).width()/2 - w/2); + if (l < 10) l = 10; + pop.css( { left: l+'px', top: t+'px'} ); + if (hmAnimate) pop.show('fast'); + else pop.show(); +} + +var hmhidePopup = function() { + if (hmPopupSticky) $("body").unbind(".hmpopup"); + var pop = $('#hmpopupdiv'); + if (pop.length>0) { //hide, don't remove + if (hmAnimate) pop.hide('fast'); + else $(hmpopupdiv).hide(); + } +} \ No newline at end of file diff --git a/wxc2_omc/omcHelp/hmtoggle_arrow0.gif b/wxc2_omc/omcHelp/hmtoggle_arrow0.gif new file mode 100755 index 0000000..8547f22 Binary files /dev/null and b/wxc2_omc/omcHelp/hmtoggle_arrow0.gif differ diff --git a/wxc2_omc/omcHelp/hmtoggle_arrow1.gif b/wxc2_omc/omcHelp/hmtoggle_arrow1.gif new file mode 100755 index 0000000..cf5e238 Binary files /dev/null and b/wxc2_omc/omcHelp/hmtoggle_arrow1.gif differ diff --git a/wxc2_omc/omcHelp/hmtoggle_plus0.gif b/wxc2_omc/omcHelp/hmtoggle_plus0.gif new file mode 100755 index 0000000..45ce013 Binary files /dev/null and b/wxc2_omc/omcHelp/hmtoggle_plus0.gif differ diff --git a/wxc2_omc/omcHelp/hmtoggle_plus1.gif b/wxc2_omc/omcHelp/hmtoggle_plus1.gif new file mode 100755 index 0000000..6fe0b66 Binary files /dev/null and b/wxc2_omc/omcHelp/hmtoggle_plus1.gif differ diff --git a/wxc2_omc/omcHelp/index.html b/wxc2_omc/omcHelp/index.html new file mode 100755 index 0000000..279dbfe --- /dev/null +++ b/wxc2_omc/omcHelp/index.html @@ -0,0 +1,34 @@ +锘� + + +EMS R9.1.9 Online Help v1.0 + + + + + + + + + diff --git a/wxc2_omc/omcHelp/index.php b/wxc2_omc/omcHelp/index.php new file mode 100755 index 0000000..8d70969 --- /dev/null +++ b/wxc2_omc/omcHelp/index.php @@ -0,0 +1,53 @@ + + + +EMS R9.0 Online Help + + + + + diff --git a/wxc2_omc/omcHelp/jquery.js b/wxc2_omc/omcHelp/jquery.js new file mode 100755 index 0000000..48590ec --- /dev/null +++ b/wxc2_omc/omcHelp/jquery.js @@ -0,0 +1,18 @@ +/*! + * jQuery JavaScript Library v1.6.2 + * http://jquery.com/ + * + * Copyright 2011, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2011, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Jun 30 14:16:56 2011 -0400 + */ +(function(a,b){function cv(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cs(a){if(!cg[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ch||(ch=c.createElement("iframe"),ch.frameBorder=ch.width=ch.height=0),b.appendChild(ch);if(!ci||!ch.createElement)ci=(ch.contentWindow||ch.contentDocument).document,ci.write((c.compatMode==="CSS1Compat"?"":"")+""),ci.close();d=ci.createElement(a),ci.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ch)}cg[a]=e}return cg[a]}function cr(a,b){var c={};f.each(cm.concat.apply([],cm.slice(0,b)),function(){c[this]=a});return c}function cq(){cn=b}function cp(){setTimeout(cq,0);return cn=f.now()}function cf(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ce(){try{return new a.XMLHttpRequest}catch(b){}}function b$(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){c!=="border"&&f.each(e,function(){c||(d-=parseFloat(f.css(a,"padding"+this))||0),c==="margin"?d+=parseFloat(f.css(a,c+this))||0:d-=parseFloat(f.css(a,"border"+this+"Width"))||0});return d+"px"}d=bx(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0,c&&f.each(e,function(){d+=parseFloat(f.css(a,"padding"+this))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+this+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+this))||0)});return d+"px"}function bm(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(be,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bl(a){f.nodeName(a,"input")?bk(a):"getElementsByTagName"in a&&f.grep(a.getElementsByTagName("input"),bk)}function bk(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bj(a){return"getElementsByTagName"in a?a.getElementsByTagName("*"):"querySelectorAll"in a?a.querySelectorAll("*"):[]}function bi(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bh(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c=f.expando,d=f.data(a),e=f.data(b,d);if(d=d[c]){var g=d.events;e=e[c]=f.extend({},d);if(g){delete e.handle,e.events={};for(var h in g)for(var i=0,j=g[h].length;i=0===c})}function V(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function N(a,b){return(a&&a!=="*"?a+".":"")+b.replace(z,"`").replace(A,"&")}function M(a){var b,c,d,e,g,h,i,j,k,l,m,n,o,p=[],q=[],r=f._data(this,"events");if(!(a.liveFired===this||!r||!r.live||a.target.disabled||a.button&&a.type==="click")){a.namespace&&(n=new RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)")),a.liveFired=this;var s=r.live.slice(0);for(i=0;ic)break;a.currentTarget=e.elem,a.data=e.handleObj.data,a.handleObj=e.handleObj,o=e.handleObj.origHandler.apply(e.elem,arguments);if(o===!1||a.isPropagationStopped()){c=e.level,o===!1&&(b=!1);if(a.isImmediatePropagationStopped())break}}return b}}function K(a,c,d){var e=f.extend({},d[0]);e.type=a,e.originalEvent={},e.liveFired=b,f.event.handle.call(c,e),e.isDefaultPrevented()&&d[0].preventDefault()}function E(){return!0}function D(){return!1}function m(a,c,d){var e=c+"defer",g=c+"queue",h=c+"mark",i=f.data(a,e,b,!0);i&&(d==="queue"||!f.data(a,g,b,!0))&&(d==="mark"||!f.data(a,h,b,!0))&&setTimeout(function(){!f.data(a,g,b,!0)&&!f.data(a,h,b,!0)&&(f.removeData(a,e,!0),i.resolve())},0)}function l(a){for(var b in a)if(b!=="toJSON")return!1;return!0}function k(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(j,"$1-$2").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNaN(d)?i.test(d)?f.parseJSON(d):d:parseFloat(d)}catch(g){}f.data(a,c,d)}else d=b}return d}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/\d/,n=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,o=/^[\],:{}\s]*$/,p=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,q=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,r=/(?:^|:|,)(?:\s*\[)+/g,s=/(webkit)[ \/]([\w.]+)/,t=/(opera)(?:.*version)?[ \/]([\w.]+)/,u=/(msie) ([\w.]+)/,v=/(mozilla)(?:.*? rv:([\w.]+))?/,w=/-([a-z])/ig,x=function(a,b){return b.toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=n.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.6.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.done(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.resolveWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").unbind("ready")}},bindReady:function(){if(!A){A=e._Deferred();if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNaN:function(a){return a==null||!m.test(a)||isNaN(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1;var c;for(c in a);return c===b||D.call(a,c)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw a},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(o.test(b.replace(p,"@").replace(q,"]").replace(r,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(b,c,d){a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b)),d=c.documentElement,(!d||!d.nodeName||d.nodeName==="parsererror")&&e.error("Invalid XML: "+b);return c},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?h.call(arguments,0):c,--e||g.resolveWith(g,h.call(b,0))}}var b=arguments,c=0,d=b.length,e=d,g=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred();if(d>1){for(;c
      a",d=a.getElementsByTagName("*"),e=a.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=a.getElementsByTagName("input")[0],k={leadingWhitespace:a.firstChild.nodeType===3,tbody:!a.getElementsByTagName("tbody").length,htmlSerialize:!!a.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55$/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:a.className!=="t",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,k.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,k.optDisabled=!h.disabled;try{delete a.test}catch(v){k.deleteExpando=!1}!a.addEventListener&&a.attachEvent&&a.fireEvent&&(a.attachEvent("onclick",function(){k.noCloneEvent=!1}),a.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),k.radioValue=i.value==="t",i.setAttribute("checked","checked"),a.appendChild(i),l=c.createDocumentFragment(),l.appendChild(a.firstChild),k.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,a.innerHTML="",a.style.width=a.style.paddingLeft="1px",m=c.getElementsByTagName("body")[0],o=c.createElement(m?"div":"body"),p={visibility:"hidden",width:0,height:0,border:0,margin:0},m&&f.extend(p,{position:"absolute",left:-1e3,top:-1e3});for(t in p)o.style[t]=p[t];o.appendChild(a),n=m||b,n.insertBefore(o,n.firstChild),k.appendChecked=i.checked,k.boxModel=a.offsetWidth===2,"zoom"in a.style&&(a.style.display="inline",a.style.zoom=1,k.inlineBlockNeedsLayout=a.offsetWidth===2,a.style.display="",a.innerHTML="
      ",k.shrinkWrapBlocks=a.offsetWidth!==2),a.innerHTML="
      t
      ",q=a.getElementsByTagName("td"),u=q[0].offsetHeight===0,q[0].style.display="",q[1].style.display="none",k.reliableHiddenOffsets=u&&q[0].offsetHeight===0,a.innerHTML="",c.defaultView&&c.defaultView.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",a.appendChild(j),k.reliableMarginRight=(parseInt((c.defaultView.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0),o.innerHTML="",n.removeChild(o);if(a.attachEvent)for(t in{submit:1,change:1,focusin:1})s="on"+t,u=s in a,u||(a.setAttribute(s,"return;"),u=typeof a[s]=="function"),k[t+"Bubbles"]=u;o=l=g=h=m=j=a=i=null;return k}(),f.boxModel=f.support.boxModel;var i=/^(?:\{.*\}|\[.*\])$/,j=/([a-z])([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!l(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g=f.expando,h=typeof c=="string",i,j=a.nodeType,k=j?f.cache:a,l=j?a[f.expando]:a[f.expando]&&f.expando;if((!l||e&&l&&!k[l][g])&&h&&d===b)return;l||(j?a[f.expando]=l=++f.uuid:l=f.expando),k[l]||(k[l]={},j||(k[l].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?k[l][g]=f.extend(k[l][g],c):k[l]=f.extend(k[l],c);i=k[l],e&&(i[g]||(i[g]={}),i=i[g]),d!==b&&(i[f.camelCase(c)]=d);if(c==="events"&&!i[c])return i[g]&&i[g].events;return h?i[f.camelCase(c)]||i[c]:i}},removeData:function(b,c,d){if(!!f.acceptData(b)){var e=f.expando,g=b.nodeType,h=g?f.cache:b,i=g?b[f.expando]:f.expando;if(!h[i])return;if(c){var j=d?h[i][e]:h[i];if(j){delete j[c];if(!l(j))return}}if(d){delete h[i][e];if(!l(h[i]))return}var k=h[i][e];f.support.deleteExpando||h!=a?delete h[i]:h[i]=null,k?(h[i]={},g||(h[i].toJSON=f.noop),h[i][e]=k):g&&(f.support.deleteExpando?delete b[f.expando]:b.removeAttribute?b.removeAttribute(f.expando):b[f.expando]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d=null;if(typeof a=="undefined"){if(this.length){d=f.data(this[0]);if(this[0].nodeType===1){var e=this[0].attributes,g;for(var h=0,i=e.length;h-1)return!0;return!1},val:function(a){var c,d,e=this[0];if(!arguments.length){if(e){c=f.valHooks[e.nodeName.toLowerCase()]||f.valHooks[e.type];if(c&&"get"in c&&(d=c.get(e,"value"))!==b)return d;d=e.value;return typeof d=="string"?d.replace(p,""):d==null?"":d}return b}var g=f.isFunction(a);return this.each(function(d){var e=f(this),h;if(this.nodeType===1){g?h=a.call(this,d,e.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c=a.selectedIndex,d=[],e=a.options,g=a.type==="select-one";if(c<0)return null;for(var h=g?c:0,i=g?c+1:e.length;h=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attrFix:{tabindex:"tabIndex"},attr:function(a,c,d,e){var g=a.nodeType;if(!a||g===3||g===8||g===2)return b;if(e&&c in f.attrFn)return f(a)[c](d);if(!("getAttribute"in a))return f.prop(a,c,d);var h,i,j=g!==1||!f.isXMLDoc(a);j&&(c=f.attrFix[c]||c,i=f.attrHooks[c],i||(t.test(c)?i=w:v&&c!=="className"&&(f.nodeName(a,"form")||u.test(c))&&(i=v)));if(d!==b){if(d===null){f.removeAttr(a,c);return b}if(i&&"set"in i&&j&&(h=i.set(a,d,c))!==b)return h;a.setAttribute(c,""+d);return d}if(i&&"get"in i&&j&&(h=i.get(a,c))!==null)return h;h=a.getAttribute(c);return h===null?b:h},removeAttr:function(a,b){var c;a.nodeType===1&&(b=f.attrFix[b]||b,f.support.getSetAttribute?a.removeAttribute(b):(f.attr(a,b,""),a.removeAttributeNode(a.getAttributeNode(b))),t.test(b)&&(c=f.propFix[b]||b)in a&&(a[c]=!1))},attrHooks:{type:{set:function(a,b){if(q.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},tabIndex:{get:function(a){var c=a.getAttributeNode("tabIndex");return c&&c.specified?parseInt(c.value,10):r.test(a.nodeName)||s.test(a.nodeName)&&a.href?0:b}},value:{get:function(a,b){if(v&&f.nodeName(a,"button"))return v.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(v&&f.nodeName(a,"button"))return v.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e=a.nodeType;if(!a||e===3||e===8||e===2)return b;var g,h,i=e!==1||!f.isXMLDoc(a);i&&(c=f.propFix[c]||c,h=f.propHooks[c]);return d!==b?h&&"set"in h&&(g=h.set(a,d,c))!==b?g:a[c]=d:h&&"get"in h&&(g=h.get(a,c))!==b?g:a[c]},propHooks:{}}),w={get:function(a,c){return f.prop(a,c)?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},f.support.getSetAttribute||(f.attrFix=f.propFix,v=f.attrHooks.name=f.attrHooks.title=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&d.nodeValue!==""?d.nodeValue:b},set:function(a,b,c){var d=a.getAttributeNode(c);if(d){d.nodeValue=b;return b}}},f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})})),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}})),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var x=/\.(.*)$/,y=/^(?:textarea|input|select)$/i,z=/\./g,A=/ /g,B=/[^\w\s.|`]/g,C=function(a){return a.replace(B,"\\$&")};f.event={add:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){if(d===!1)d=D;else if(!d)return;var g,h;d.handler&&(g=d,d=g.handler),d.guid||(d.guid=f.guid++);var i=f._data(a);if(!i)return;var j=i.events,k=i.handle;j||(i.events=j={}),k||(i.handle=k=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.handle.apply(k.elem,arguments):b}),k.elem=a,c=c.split(" ");var l,m=0,n;while(l=c[m++]){h=g?f.extend({},g):{handler:d,data:e},l.indexOf(".")>-1?(n=l.split("."),l=n.shift(),h.namespace=n.slice(0).sort().join(".")):(n=[],h.namespace=""),h.type=l,h.guid||(h.guid=d.guid);var o=j[l],p=f.event.special[l]||{};if(!o){o=j[l]=[];if(!p.setup||p.setup.call(a,e,n,k)===!1)a.addEventListener?a.addEventListener(l,k,!1):a.attachEvent&&a.attachEvent("on"+l,k)}p.add&&(p.add.call(a,h),h.handler.guid||(h.handler.guid=d.guid)),o.push(h),f.event.global[l]=!0}a=null}},global:{},remove:function(a,c,d,e){if(a.nodeType!==3&&a.nodeType!==8){d===!1&&(d=D);var g,h,i,j,k=0,l,m,n,o,p,q,r,s=f.hasData(a)&&f._data(a),t=s&&s.events;if(!s||!t)return;c&&c.type&&(d=c.handler,c=c.type);if(!c||typeof c=="string"&&c.charAt(0)==="."){c=c||"";for(h in t)f.event.remove(a,h+c);return}c=c.split(" ");while(h=c[k++]){r=h,q=null,l=h.indexOf(".")<0,m=[],l||(m=h.split("."),h=m.shift(),n=new RegExp("(^|\\.)"+f.map(m.slice(0).sort(),C).join("\\.(?:.*\\.)?")+"(\\.|$)")),p=t[h];if(!p)continue;if(!d){for(j=0;j=0&&(h=h.slice(0,-1),j=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i. +shift(),i.sort());if(!!e&&!f.event.customEvent[h]||!!f.event.global[h]){c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.exclusive=j,c.namespace=i.join("."),c.namespace_re=new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)");if(g||!e)c.preventDefault(),c.stopPropagation();if(!e){f.each(f.cache,function(){var a=f.expando,b=this[a];b&&b.events&&b.events[h]&&f.event.trigger(c,d,b.handle.elem)});return}if(e.nodeType===3||e.nodeType===8)return;c.result=b,c.target=e,d=d!=null?f.makeArray(d):[],d.unshift(c);var k=e,l=h.indexOf(":")<0?"on"+h:"";do{var m=f._data(k,"handle");c.currentTarget=k,m&&m.apply(k,d),l&&f.acceptData(k)&&k[l]&&k[l].apply(k,d)===!1&&(c.result=!1,c.preventDefault()),k=k.parentNode||k.ownerDocument||k===c.target.ownerDocument&&a}while(k&&!c.isPropagationStopped());if(!c.isDefaultPrevented()){var n,o=f.event.special[h]||{};if((!o._default||o._default.call(e.ownerDocument,c)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)){try{l&&e[h]&&(n=e[l],n&&(e[l]=null),f.event.triggered=h,e[h]())}catch(p){}n&&(e[l]=n),f.event.triggered=b}}return c.result}},handle:function(c){c=f.event.fix(c||a.event);var d=((f._data(this,"events")||{})[c.type]||[]).slice(0),e=!c.exclusive&&!c.namespace,g=Array.prototype.slice.call(arguments,0);g[0]=c,c.currentTarget=this;for(var h=0,i=d.length;h-1?f.map(a.options,function(a){return a.selected}).join("-"):"":f.nodeName(a,"select")&&(c=a.selectedIndex);return c},J=function(c){var d=c.target,e,g;if(!!y.test(d.nodeName)&&!d.readOnly){e=f._data(d,"_change_data"),g=I(d),(c.type!=="focusout"||d.type!=="radio")&&f._data(d,"_change_data",g);if(e===b||g===e)return;if(e!=null||g)c.type="change",c.liveFired=b,f.event.trigger(c,arguments[1],d)}};f.event.special.change={filters:{focusout:J,beforedeactivate:J,click:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(c==="radio"||c==="checkbox"||f.nodeName(b,"select"))&&J.call(this,a)},keydown:function(a){var b=a.target,c=f.nodeName(b,"input")?b.type:"";(a.keyCode===13&&!f.nodeName(b,"textarea")||a.keyCode===32&&(c==="checkbox"||c==="radio")||c==="select-multiple")&&J.call(this,a)},beforeactivate:function(a){var b=a.target;f._data(b,"_change_data",I(b))}},setup:function(a,b){if(this.type==="file")return!1;for(var c in H)f.event.add(this,c+".specialChange",H[c]);return y.test(this.nodeName)},teardown:function(a){f.event.remove(this,".specialChange");return y.test(this.nodeName)}},H=f.event.special.change.filters,H.focus=H.beforeactivate}f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){function e(a){var c=f.event.fix(a);c.type=b,c.originalEvent={},f.event.trigger(c,null,c.target),c.isDefaultPrevented()&&a.preventDefault()}var d=0;f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.each(["bind","one"],function(a,c){f.fn[c]=function(a,d,e){var g;if(typeof a=="object"){for(var h in a)this[c](h,d,a[h],e);return this}if(arguments.length===2||d===!1)e=d,d=b;c==="one"?(g=function(a){f(this).unbind(a,g);return e.apply(this,arguments)},g.guid=e.guid||f.guid++):g=e;if(a==="unload"&&c!=="one")this.one(a,d,e);else for(var i=0,j=this.length;i0?this.bind(b,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0)}),function(){function u(a,b,c,d,e,f){for(var g=0,h=d.length;g0){j=i;break}}i=i[a]}d[g]=j}}}function t(a,b,c,d,e,f){for(var g=0,h=d.length;g+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d=0,e=Object.prototype.toString,g=!1,h=!0,i=/\\/g,j=/\W/;[0,0].sort(function(){h=!1;return 0});var k=function(b,d,f,g){f=f||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return f;var i,j,n,o,q,r,s,t,u=!0,w=k.isXML(d),x=[],y=b;do{a.exec(""),i=a.exec(y);if(i){y=i[3],x.push(i[1]);if(i[2]){o=i[3];break}}}while(i);if(x.length>1&&m.exec(b))if(x.length===2&&l.relative[x[0]])j=v(x[0]+x[1],d);else{j=l.relative[x[0]]?[d]:k(x.shift(),d);while(x.length)b=x.shift(),l.relative[b]&&(b+=x.shift()),j=v(b,j)}else{!g&&x.length>1&&d.nodeType===9&&!w&&l.match.ID.test(x[0])&&!l.match.ID.test(x[x.length-1])&&(q=k.find(x.shift(),d,w),d=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]);if(d){q=g?{expr:x.pop(),set:p(g)}:k.find(x.pop(),x.length===1&&(x[0]==="~"||x[0]==="+")&&d.parentNode?d.parentNode:d,w),j=q.expr?k.filter(q.expr,q.set):q.set,x.length>0?n=p(j):u=!1;while(x.length)r=x.pop(),s=r,l.relative[r]?s=x.pop():r="",s==null&&(s=d),l.relative[r](n,s,w)}else n=x=[]}n||(n=j),n||k.error(r||b);if(e.call(n)==="[object Array]")if(!u)f.push.apply(f,n);else if(d&&d.nodeType===1)for(t=0;n[t]!=null;t++)n[t]&&(n[t]===!0||n[t].nodeType===1&&k.contains(d,n[t]))&&f.push(j[t]);else for(t=0;n[t]!=null;t++)n[t]&&n[t].nodeType===1&&f.push(j[t]);else p(n,f);o&&(k(o,h,f,g),k.uniqueSort(f));return f};k.uniqueSort=function(a){if(r){g=h,a.sort(r);if(g)for(var b=1;b0},k.find=function(a,b,c){var d;if(!a)return[];for(var e=0,f=l.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!j.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(i,"")},TAG:function(a,b){return a[1].replace(i,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||k.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&k.error(a[0]);a[0]=d++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(i,"");!f&&l.attrMap[g]&&(a[1]=l.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(i,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=k(b[3],null,null,c);else{var g=k.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(l.match.POS.test(b[0])||l.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!k(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=l.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||k.getText([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=l.attrHandle[c]?l.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=l.setFilters[e];if(f)return f(a,c,b,d)}}},m=l.match.POS,n=function(a,b){return"\\"+(b-0+1)};for(var o in l.match)l.match[o]=new RegExp(l.match[o].source+/(?![^\[]*\])(?![^\(]*\))/.source),l.leftMatch[o]=new RegExp(/(^(?:.|\r|\n)*?)/.source+l.match[o].source.replace(/\\(\d+)/g,n));var p=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(q){p=function(a,b){var c=0,d=b||[];if(e.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var f=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(l.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},l.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(l.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(l.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=k,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

      ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){k=function(b,e,f,g){e=e||c;if(!g&&!k.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return p(e.getElementsByTagName(b),f);if(h[2]&&l.find.CLASS&&e.getElementsByClassName)return p(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return p([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return p([],f);if(i.id===h[3])return p([i],f)}try{return p(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var m=e,n=e.getAttribute("id"),o=n||d,q=e.parentNode,r=/^\s*[+~]/.test(b);n?o=o.replace(/'/g,"\\$&"):e.setAttribute("id",o),r&&q&&(e=e.parentNode);try{if(!r||q)return p(e.querySelectorAll("[id='"+o+"'] "+b),f)}catch(s){}finally{n||m.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)k[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}k.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(a))try{if(e||!l.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return k(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
      ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;l.order.splice(1,0,"CLASS"),l.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?k.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?k.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:k.contains=function(){return!1},k.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var v=function(a,b){var c,d=[],e="",f=b.nodeType?[b]:b;while(c=l.match.PSEUDO.exec(a))e+=c[0],a=a.replace(l.match.PSEUDO,"");a=l.relative[a]?a+"*":a;for(var g=0,h=f.length;g0)for(h=g;h0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h,i,j={},k=1;if(g&&a.length){for(d=0,e=a.length;d-1:f(g).is(h))&&c.push({selector:i,elem:g,level:k});g=g.parentNode,k++}}return c}var l=T.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a||typeof a=="string")return f.inArray(this[0],a?f(a):this.parent().children());return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(V(c[0])||V(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c),g=S.call(arguments);O.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!U[a]?f.unique(e):e,(this.length>1||Q.test(d))&&P.test(a)&&(e=e.reverse());return this.pushStack(e,a,g.join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var X=/ jQuery\d+="(?:\d+|null)"/g,Y=/^\s+/,Z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,$=/<([\w:]+)/,_=/",""],legend:[1,"
      ","
      "],thead:[1,"","
      "],tr:[2,"","
      "],td:[3,"","
      "],col:[2,"","
      "],area:[1,"",""],_default:[0,"",""]};bf.optgroup=bf.option,bf.tbody=bf.tfoot=bf.colgroup=bf.caption=bf.thead,bf.th=bf.td,f.support.htmlSerialize||(bf._default=[1,"div
      ","
      "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){f(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f(arguments[0]).toArray());return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(X,""):null;if(typeof a=="string"&&!bb.test(a)&&(f.support.leadingWhitespace||!Y.test(a))&&!bf[($.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Z,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j +)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d=a.cloneNode(!0),e,g,h;if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bi(a,d),e=bj(a),g=bj(d);for(h=0;e[h];++h)bi(e[h],g[h])}if(b){bh(a,d);if(c){e=bj(a),g=bj(d);for(h=0;e[h];++h)bh(e[h],g[h])}}e=g=null;return d},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!ba.test(k))k=b.createTextNode(k);else{k=k.replace(Z,"<$1>");var l=($.exec(k)||["",""])[1].toLowerCase(),m=bf[l]||bf._default,n=m[0],o=b.createElement("div");o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=_.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&Y.test(k)&&o.insertBefore(b.createTextNode(Y.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bo.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle;c.zoom=1;var e=f.isNaN(b)?"":"alpha(opacity="+b*100+")",g=d&&d.filter||c.filter||"";c.filter=bn.test(g)?g.replace(bn,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bx(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(by=function(a,c){var d,e,g;c=c.replace(bp,"-$1").toLowerCase();if(!(e=a.ownerDocument.defaultView))return b;if(g=e.getComputedStyle(a,null))d=g.getPropertyValue(c),d===""&&!f.contains(a.ownerDocument.documentElement,a)&&(d=f.style(a,c));return d}),c.documentElement.currentStyle&&(bz=function(a,b){var c,d=a.currentStyle&&a.currentStyle[b],e=a.runtimeStyle&&a.runtimeStyle[b],f=a.style;!bq.test(d)&&br.test(d)&&(c=f.left,e&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":d||0,d=f.pixelLeft+"px",f.left=c,e&&(a.runtimeStyle.left=e));return d===""?"auto":d}),bx=by||bz,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bB=/%20/g,bC=/\[\]$/,bD=/\r?\n/g,bE=/#.*$/,bF=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bG=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bH=/^(?:about|app|app\-storage|.+\-extension|file|widget):$/,bI=/^(?:GET|HEAD)$/,bJ=/^\/\//,bK=/\?/,bL=/)<[^<]*)*<\/script>/gi,bM=/^(?:select|textarea)/i,bN=/\s+/,bO=/([?&])_=[^&]*/,bP=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bQ=f.fn.load,bR={},bS={},bT,bU;try{bT=e.href}catch(bV){bT=c.createElement("a"),bT.href="",bT=bT.href}bU=bP.exec(bT.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bQ)return bQ.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
      ").append(c.replace(bL,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bM.test(this.nodeName)||bG.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bD,"\r\n")}}):{name:b.name,value:c.replace(bD,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.bind(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?f.extend(!0,a,f.ajaxSettings,b):(b=a,a=f.extend(!0,f.ajaxSettings,b));for(var c in{context:1,url:1})c in b?a[c]=b[c]:c in f.ajaxSettings&&(a[c]=f.ajaxSettings[c]);return a},ajaxSettings:{url:bT,isLocal:bH.test(bU[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":"*/*"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML}},ajaxPrefilter:bW(bR),ajaxTransport:bW(bS),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a?4:0;var o,r,u,w=l?bZ(d,v,l):b,x,y;if(a>=200&&a<300||a===304){if(d.ifModified){if(x=v.getResponseHeader("Last-Modified"))f.lastModified[k]=x;if(y=v.getResponseHeader("Etag"))f.etag[k]=y}if(a===304)c="notmodified",o=!0;else try{r=b$(d,w),c="success",o=!0}catch(z){c="parsererror",u=z}}else{u=c;if(!c||a)c="error",a<0&&(a=0)}v.status=a,v.statusText=c,o?h.resolveWith(e,[r,c,v]):h.rejectWith(e,[v,c,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.resolveWith(e,[v,c]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f._Deferred(),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bF.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.done,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bE,"").replace(bJ,bU[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bN),d.crossDomain==null&&(r=bP.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bU[1]&&r[2]==bU[2]&&(r[3]||(r[1]==="http:"?80:443))==(bU[3]||(bU[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bX(bR,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bI.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bK.test(d.url)?"&":"?")+d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bO,"$1_="+x);d.url=y+(y===d.url?(bK.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", */*; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bX(bS,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){status<2?w(-1,z):f.error(z)}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)bY(g,a[g],c,e);return d.join("&").replace(bB,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var b_=f.now(),ca=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+b_++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ca.test(b.url)||e&&ca.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ca,l),b.url===j&&(e&&(k=k.replace(ca,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cb=a.ActiveXObject?function(){for(var a in cd)cd[a](0,1)}:!1,cc=0,cd;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ce()||cf()}:ce,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cb&&delete cd[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cc,cb&&(cd||(cd={},f(a).unload(cb)),cd[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cg={},ch,ci,cj=/^(?:toggle|show|hide)$/,ck=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cl,cm=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cn,co=a.webkitRequestAnimationFrame||a.mozRequestAnimationFrame||a.oRequestAnimationFrame;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cr("show",3),a,b,c);for(var g=0,h=this.length;g=e.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),e.animatedProperties[this.prop]=!0;for(g in e.animatedProperties)e.animatedProperties[g]!==!0&&(c=!1);if(c){e.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){d.style["overflow"+b]=e.overflow[a]}),e.hide&&f(d).hide();if(e.hide||e.show)for(var i in e.animatedProperties)f.style(d,i,e.orig[i]);e.complete.call(d)}return!1}e.duration==Infinity?this.now=b:(h=b-this.startTime,this.state=h/e.duration,this.pos=f.easing[e.animatedProperties[this.prop]](this.state,h,0,1,e.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){for(var a=f.timers,b=0;b
      ";f.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"}),b.innerHTML=j,a.insertBefore(b,a.firstChild),d=b.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,this.doesNotAddBorder=e.offsetTop!==5,this.doesAddBorderForTableAndCells=h.offsetTop===5,e.style.position="fixed",e.style.top="20px",this.supportsFixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",this.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i,a.removeChild(b),f.offset.initialize=f.noop},bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.offset.initialize(),f.offset.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cu.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cu.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cv(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cv(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a&&a.style?parseFloat(f.css(a,d,"padding")):null},f.fn["outer"+c]=function(a){var b=this[0];return b&&b.style?parseFloat(f.css(b,d,a?"margin":"border")):null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c];return e.document.compatMode==="CSS1Compat"&&g||e.document.body["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var h=f.css(e,d),i=parseFloat(h);return f.isNaN(i)?h:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f})(window); \ No newline at end of file diff --git a/wxc2_omc/omcHelp/picture_icon.gif b/wxc2_omc/omcHelp/picture_icon.gif new file mode 100755 index 0000000..b31854a Binary files /dev/null and b/wxc2_omc/omcHelp/picture_icon.gif differ diff --git a/wxc2_omc/performance/aasCsta/dataAnalysisDown.php b/wxc2_omc/performance/aasCsta/dataAnalysisDown.php new file mode 100755 index 0000000..e8c6e4e --- /dev/null +++ b/wxc2_omc/performance/aasCsta/dataAnalysisDown.php @@ -0,0 +1,159 @@ + + +"; + +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$db=$csta_db; +$time_column = "csta_datetime"; +$table_name='aasDetail'."_".$showDate; +$title_time=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));//表头显示时间 + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } +$strServerStatistics = "Server statistics"; +//-------确定日期范围----- +if($sel_date<0) +{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} +elseif($sel_date>0) +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } +} +else +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } +} + +/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ +$w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + +//合成where语句 +$where=" WHERE ".$w1; +$str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +if(!$number_of_records) +{ + echo "$strNotFindRecord"; + exit(); +} +$sum_sql=" + SELECT + SUM(pps_service_attempt) AS pps_service_attempt, + SUM(pps_service_success) AS pps_service_success, + SUM(msc_service_attempt) AS msc_service_attempt, + SUM(msc_service_success) AS msc_service_success, + SUM(invalid_call) AS invalid_call + FROM $table_name + "; +//echo "
      sum_sql=$sum_sql"; +$sum_res = mysqli_query($pubConn,$sum_sql); +$sum_row = @mysqli_fetch_array($sum_res); +echo mysqli_error($pubConn); + +?> + + +
      + + + + + + + +
      + +

        +Date: +

      +
      + +
      +
      + +"; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo ""; +echo "
       TypeNumber
      PPS ServiceAttempt $sum_row[pps_service_attempt]
      Success $sum_row[pps_service_success]
      MSC ServiceAttempt $sum_row[msc_service_attempt]
      Success $sum_row[msc_service_success]
      InvalidInvalid Calls $sum_row[invalid_call]
      "; +adjust_content_tail("down"); +?> +
      + + diff --git a/wxc2_omc/performance/aasCsta/dataAnalysisIndex.php b/wxc2_omc/performance/aasCsta/dataAnalysisIndex.php new file mode 100755 index 0000000..6537ac1 --- /dev/null +++ b/wxc2_omc/performance/aasCsta/dataAnalysisIndex.php @@ -0,0 +1,16 @@ + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/aasCsta/dataAnalysisUp.php b/wxc2_omc/performance/aasCsta/dataAnalysisUp.php new file mode 100755 index 0000000..86047da --- /dev/null +++ b/wxc2_omc/performance/aasCsta/dataAnalysisUp.php @@ -0,0 +1,86 @@ + + + + +
      +"; +echo ""; +echo ""; +echo "$strTitlePerformance > AAS"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +echo "$strDate:"; +?> + +"; +echo ""; + +echo ""; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +?> + + + + + diff --git a/wxc2_omc/performance/aasCsta/dataQueryDown.php b/wxc2_omc/performance/aasCsta/dataQueryDown.php new file mode 100755 index 0000000..233eda5 --- /dev/null +++ b/wxc2_omc/performance/aasCsta/dataQueryDown.php @@ -0,0 +1,115 @@ + + +"; + +$DEBUG=0; + +$db='CSTA_DB'; +$sort_field = 'csta_datetime DESC, key_sys_id ASC'; //排序所依赖的字段名 +$number_records_to_display = 200; //每页纪录数 +$time_column = "csta_datetime"; + +if(!isset($sel_date)){ + $sel_date = date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $timeItem = date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + if($DEBUG) echo "
      sel_date=$sel_date"; +} + +$tmpDay = explode('-',$sel_date); +$tmpDay = $tmpDay[2]; +$table_name='aasDetail'."_".$tmpDay; + +$sel_field_list= @mysql_list_fields($db,$table_name); +if(!$sel_field_list){ + echo "
      $strNotFindRecord."; + exit(); +} + +$sysTypeNo=311; +switch($sysTypeNo){ + case '311': + $helpId = "3.8"; + $callTypeDefArr=array('PPS','MSC','Invalid Calls'); + $fieldTypeDef='pps_service_attempt,pps_service_success,msc_service_attempt,msc_service_success,invalid_call'; + break; + default: + echo "Can not support this sysTypeNo($sysTypeNo)"; + exit(); +} + +?> + +csta_sql=$csta_sql"; +$csta_result = mysqli_query($pubConn,$csta_sql); +$csta_rows = @mysqli_fetch_array($csta_result); +echo mysqli_error($pubConn); + +//显示表头 +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +//显示表的记录 +$fieldArr=explode(',',$fieldTypeDef); +do{ + echo ""; + echo ""; + for($i=0;$i$csta_rows[$tmpFieldName]"; + } + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; +}while($csta_rows= mysqli_fetch_array($csta_result)); +?> +
      system IDPPS ServiceMSC ServiceInvalid callTime($timeItem)
      AttemptSuccessAttemptSuccess
      $csta_rows[key_sys_id]$tmpArray[1]
      + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/aasCsta/dataQueryIndex.php b/wxc2_omc/performance/aasCsta/dataQueryIndex.php new file mode 100755 index 0000000..1190c33 --- /dev/null +++ b/wxc2_omc/performance/aasCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/aasCsta/dataQueryUp.php b/wxc2_omc/performance/aasCsta/dataQueryUp.php new file mode 100755 index 0000000..504b34b --- /dev/null +++ b/wxc2_omc/performance/aasCsta/dataQueryUp.php @@ -0,0 +1,96 @@ + + +
      + + + + + + + + + +"; +echo ""; +echo ""; +echo "Performance > AAS > Query"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; + +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> +
      + + diff --git a/wxc2_omc/performance/aucCsta/dataAnalysisDown.php b/wxc2_omc/performance/aucCsta/dataAnalysisDown.php new file mode 100755 index 0000000..23ca02c --- /dev/null +++ b/wxc2_omc/performance/aucCsta/dataAnalysisDown.php @@ -0,0 +1,434 @@ + + + +"; + +$db=$csta_db; +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$time_column = "csta_datetime"; +$table_name='aucDetail'."_".$showDate; +$title_time=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));//表头显示时间 + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + +if($language == 'eng'){ + +}else{ + +} + +//-------确定日期范围----- +if($sel_date<0) +{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} +elseif($sel_date>0) +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } +} +else +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } +} + +/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ +$w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + +//合成where语句 +$where=" WHERE".$w1; +$str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +if(!$number_of_records) +{ + echo "$strNotFindRecord"; + exit(); +} +$sum_sql=" SELECT SUM(auc_auth_suc),SUM(auc_auth_fail),SUM(auc_created_sub_suc),SUM(auc_created_sub_fail),SUM(auc_del_sub_suc), SUM(auc_del_sub_fail),SUM(hlr_created_sub_suc),SUM(hlr_created_sub_fail),SUM(hlr_del_sub_suc),SUM(hlr_del_sub_fail),SUM(int_sub_suc),SUM(int_sub_fail) FROM $table_name ".$where; +//echo "
      sum_sql=$sum_sql"; +$sum_res=mysqli_query($pubConn,$sum_sql); +$sum_row=mysqli_fetch_array($sum_res); + +$auc_auth_suc=$sum_row[0]; +$auc_auth_fail=$sum_row[1]; + +$total_auc_auth=$auc_auth_suc+$auc_auth_fail; +if($total_auc_auth>0) +{ + $auc_auth_suc_point=$auc_auth_suc/$total_auc_auth; + $auc_auth_suc_scale=change_percent($auc_auth_suc/$total_auc_auth); + $auc_auth_fail_point=$auc_auth_fail/$total_auc_auth; + $auc_auth_fail_scale=change_percent($auc_auth_fail/$total_auc_auth); +} +else +{ + $auc_auth_suc_point=0; + $auc_auth_suc_scale="0%"; + $auc_auth_fail_point=0; + $auc_auth_fail_scale="0%"; +} + +$auc_created_sub_suc=$sum_row[2]; +$auc_created_sub_fail=$sum_row[3]; +$total_auc_created_sub=$auc_created_sub_suc+$auc_created_sub_fail; +if($total_auc_created_sub>0) +{ + $auc_created_sub_suc_point=$auc_created_sub_suc/$total_auc_created_sub; + $auc_created_sub_suc_scale=change_percent($auc_created_sub_suc/$total_auc_created_sub); + $auc_created_sub_fail_point=$auc_created_sub_fail/$total_auc_created_sub; + $auc_created_sub_fail_scale=change_percent($auc_created_sub_fail/$total_auc_created_sub); +} +else +{ + $auc_created_sub_suc_point=0; + $auc_created_sub_suc_scale="0%"; + $auc_created_sub_fail_point=0; + $auc_created_sub_fail_scale="0%"; +} + +$auc_del_sub_suc=$sum_row[4]; +$auc_del_sub_fail=$sum_row[5]; +$total_auc_del_sub=$auc_del_sub_suc+$auc_del_sub_fail; +if($total_auc_del_sub>0) +{ + $auc_del_sub_suc_point=$auc_del_sub_suc/$total_auc_del_sub; + $auc_del_sub_suc_scale=change_percent($auc_del_sub_suc/$total_auc_del_sub); + $auc_del_sub_fail_point=$auc_del_sub_fail/$total_auc_del_sub; + $auc_del_sub_fail_scale=change_percent($auc_del_sub_fail/$total_auc_del_sub); +} +else +{ + $auc_del_sub_suc_point=0; + $auc_del_sub_suc_scale="0%"; + $auc_del_sub_fail_point=0; + $auc_del_sub_fail_scale="0%"; +} + +$hlr_created_sub_suc=$sum_row[6]; +$hlr_created_sub_fail=$sum_row[7]; +$total_hlr_created_sub=$hlr_created_sub_suc+$hlr_created_sub_fail; +if($total_hlr_created_sub>0) +{ + $hlr_created_sub_suc_point=$hlr_created_sub_suc/$total_hlr_created_sub; + $hlr_created_sub_suc_scale=change_percent($hlr_created_sub_suc/$total_hlr_created_sub); + $hlr_created_sub_fail_point=$hlr_created_sub_fail/$total_hlr_created_sub; + $hlr_created_sub_fail_scale=change_percent($hlr_created_sub_fail/$total_hlr_created_sub); +} +else +{ + $hlr_created_sub_suc_point=0; + $hlr_created_sub_suc_scale="0%"; + $hlr_created_sub_fail_point=0; + $hlr_created_sub_fail_scale="0%"; +} + +$hlr_del_sub_suc=$sum_row[8]; +$hlr_del_sub_fail=$sum_row[9]; +$total_hlr_del_sub=$hlr_del_sub_suc+$hlr_del_sub_fail; +if($total_hlr_del_sub) +{ + $hlr_del_sub_suc_point=$hlr_del_sub_suc/$total_hlr_del_sub; + $hlr_del_sub_suc_scale=change_percent($hlr_del_sub_suc/$total_hlr_del_sub); + $hlr_del_sub_fail_point=$hlr_del_sub_fail/$total_hlr_del_sub; + $hlr_del_sub_fail_scale=change_percent($hlr_del_sub_fail/$total_hlr_del_sub); +} +else +{ + $hlr_del_sub_suc_point=0; + $hlr_del_sub_suc_scale="0%"; + $hlr_del_sub_fail_point=0; + $hlr_del_sub_fail_scale="0%"; +} + +$int_sub_suc=$sum_row[10]; +$int_sub_fail=$sum_row[11]; +$total_int_sub=$int_sub_suc+$int_sub_fail; +if($total_int_sub) +{ + $int_sub_suc_point=$int_sub_suc/$total_int_sub; + $int_sub_suc_scale=change_percent($int_sub_suc/$total_int_sub); + $int_sub_fail_point=$int_sub_fail/$total_int_sub; + $int_sub_fail_scale=change_percent($int_sub_fail/$total_int_sub); +} +else +{ + $int_sub_suc_point=0; + $int_sub_suc_scale="0%"; + $int_sub_fail_point=0; + $int_sub_fail_scale="0%"; +} + +?> + + +
      + + + + + + + + +
      + +

        +Date: +

      +
      + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      1.

      +

      +

      +

      +

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + 2. +
      + + + + + + + + + + + + + + + +
            
      +

      + + + + + + + + +
      :
      + + + \ No newline at end of file diff --git a/wxc2_omc/performance/aucCsta/dataAnalysisIndex.php b/wxc2_omc/performance/aucCsta/dataAnalysisIndex.php new file mode 100755 index 0000000..5ac0925 --- /dev/null +++ b/wxc2_omc/performance/aucCsta/dataAnalysisIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/aucCsta/dataAnalysisUp.php b/wxc2_omc/performance/aucCsta/dataAnalysisUp.php new file mode 100755 index 0000000..e0a1454 --- /dev/null +++ b/wxc2_omc/performance/aucCsta/dataAnalysisUp.php @@ -0,0 +1,84 @@ + + + + + + +"; + echo ""; + echo ""; + echo "Advanced > $strPerformance > AUC > Statistics"; + echo ""; + echo ""; +// showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; +?> + +"; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + +
      + + + diff --git a/wxc2_omc/performance/aucCsta/dataQueryDown.php b/wxc2_omc/performance/aucCsta/dataQueryDown.php new file mode 100755 index 0000000..39b14a9 --- /dev/null +++ b/wxc2_omc/performance/aucCsta/dataQueryDown.php @@ -0,0 +1,263 @@ + + + + +"; + + $sort_field = 'csta_datetime'; //排序所依赖的字段名 + $sort_direction = 'DESC'; //排序顺序 + $number_records_to_display = 200; //每页纪录数 + $time_column = "csta_datetime"; + $table_name='aucDetail'."_".$showDate; + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + + $where = isset($where) ? urldecode($where) : ''; //传回变量后解url码 + $where = isset($where) ? stripslashes($where) : ''; //解除一些'/' +//删除所查询的内容 +if($delete){ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//end of delete +?> + +0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + /* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ + $w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + + //合成where语句 + $where=" WHERE".$w1; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo "
      $strNotFindRecord"; + exit(); + } + +}//endif + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +if ($number_of_records >= 1){ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0){ + $prev_index = 0; + } +} +$show_initital_record=$initial_record+1; +?> + + + + +" +> + + +
       $show_initital_record - $next_index, ($strTotalRecords:$number_of_records )   "; ?>  +"; +//下面是控制分页显示,传递变量 +if ($initial_record != 0) +{ + $t1 = "initial_record=$prev_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 前一页  + 0 && $number_of_records > $number_records_to_display ) +{ + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 下一页 + +
      + +
      +"; +$csta_result = mysqli_query($pubConn,$csta_sql); +$csta_rows = mysqli_fetch_array($csta_result); +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + + + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/aucCsta/dataQueryIndex.php b/wxc2_omc/performance/aucCsta/dataQueryIndex.php new file mode 100755 index 0000000..1190c33 --- /dev/null +++ b/wxc2_omc/performance/aucCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/aucCsta/dataQueryUp.php b/wxc2_omc/performance/aucCsta/dataQueryUp.php new file mode 100755 index 0000000..810c157 --- /dev/null +++ b/wxc2_omc/performance/aucCsta/dataQueryUp.php @@ -0,0 +1,82 @@ + + + + +
      + +"; + echo ""; + echo ""; + echo "$strAdvanced > $strPerformance > AUC > Data"; + echo ""; + echo ""; +// showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; +?> + +"; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + +
      + + diff --git a/wxc2_omc/performance/bssCsta/1264682178.png b/wxc2_omc/performance/bssCsta/1264682178.png new file mode 100755 index 0000000..8ae18c0 Binary files /dev/null and b/wxc2_omc/performance/bssCsta/1264682178.png differ diff --git a/wxc2_omc/performance/bssCsta/DataList/data_list.php b/wxc2_omc/performance/bssCsta/DataList/data_list.php new file mode 100755 index 0000000..eb5b4b8 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/DataList/data_list.php @@ -0,0 +1,74 @@ + + + + +$selected_field_list"; +$select_sql_bgn = "SELECT "; +$select_sql_end = " FROM $table + WHERE CellIdentity = '$cell_id' + AND startTime >= '$date_bgn' + AND endTime <= '$date_end' + ORDER BY startTime,bssid + "; +$fields_arr = explode('>',$selected_field_list); +$field_num = sizeof($fields_arr); +for($i=1; $i<$field_num; $i++){ + if($i < $field_num-1){ + $select_sql_bgn = $select_sql_bgn ." $fields_arr[$i],"; + }else{ + $select_sql_bgn = $select_sql_bgn ." $fields_arr[$i] "; + } +} +$select_sql = $select_sql_bgn.$select_sql_end; +if($DEBUG) echo "
      $select_sql"; +?> +
      + +"; +for($i=1; $i<$field_num; $i++){ + echo ""; +} +echo ""; +$result = mysqli_query($pubConn,$select_sql); +$rows = mysqli_fetch_array($result); +echo mysqli_error($pubConn); +while($rows){ + echo ""; + for($i=1; $i<$field_num; $i++){ + echo ""; + } + echo ""; +} +?> +
      {$fields_arr[$i]}
      {$rows[$i]}
      +
      + + + + diff --git a/wxc2_omc/performance/bssCsta/DataList/data_select.php b/wxc2_omc/performance/bssCsta/DataList/data_select.php new file mode 100755 index 0000000..5f7dd99 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/DataList/data_select.php @@ -0,0 +1,86 @@ + + + + + + + +
      + + + + + + + + + + + + + + +
      请输入要显示数据的范围:
      小区编号:
      + 开始日期: +
      结束日期: +
      (日期格式:YYYY-MM-DD hh:mm:ss  例:2002-01-15 14:32:18) +
      请选择要显示的列:
      + + + + + + +
      + +

      +

      +
      + +
      + +
      +     +
      + + + + diff --git a/wxc2_omc/performance/bssCsta/Erlang_down.php b/wxc2_omc/performance/bssCsta/Erlang_down.php new file mode 100755 index 0000000..50c1775 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/Erlang_down.php @@ -0,0 +1,489 @@ +"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $isbsplus = $row[0]; + +if($isbsplus == 0) +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and ObjectId not like 'Bts.0%' and Presence=1 and bssid=$bss_id"; +else +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and Presence=1 and bssid=$bss_id"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($cell_object[]) =$row; +} +$no_of_cell = count($cell_object); + +$btsBgnNo=0; +$btsEndNo=$no_of_cell; + +//----------------------get BssId <--> CellIdentity---------------------- +//---init this bsc's bts array--- +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + //array(cellid,0,...,23); + $btsArray[$i]=array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);//25个元素 +} +/* +$sel_sql="SELECT ObjectId,CellIdentity FROM OMCR_Bts WHERE CellIdentity >='0' AND bssid='$bss_id'"; +$sel_result=mysqli_query($pubConn,$sel_sql); +$result_rows=mysqli_fetch_array($sel_result); +if($DEBUG) echo "
      db=$db
      sel_sql=$sel_sql"; +do{ + $temp_bts_id = $result_rows[ObjectId]; //like"Bts.1.0" + $temp_bts_id = explode('.',$temp_bts_id); + $temp_bts_id = $temp_bts_id[1]; + $temp_cell_id= $result_rows[CellIdentity]; + if($temp_cell_id > 0){ + $btsArray[$temp_bts_id][0]= $temp_cell_id; + } +}while($result_rows=mysqli_fetch_array($sel_result)); +*/ +//-----------get where--------------- + +$where=" bssid='$bss_id' "; +//data +if(isset($sel_date)){ + $bgn_date=$sel_date.' '.$hou_1.':'.$mid_1.':'.$sec_1; + $end_date=$sel_date.' '.$hou_2.':'.$mid_2.':'.$sec_2; +}else{ + $bgn_date =date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date =date("Y-m-d H:i:s",mktime()); +} +$where = $where." AND startTime >=UNIX_TIMESTAMP('$bgn_date') AND EndTime <=UNIX_TIMESTAMP('$end_date')"; + +?> + + + + + + + + +
      + BSS"."$bscNum $strErlang $strStatistics "; + ?> + + $bgn_date   $strTo   $end_date";?> +
      + + +"; +echo ""; +echo ""; +for($clock=0;$clock<24;$clock++){ + echo ""; +} +echo ""; +//$bss_id = (strlen($bss_id)<2)?'0'.$bss_id:$bss_id; +if($DEBUG) echo "
      btsBgnNo=$btsBgnNo,btsEndNo=$btsEndNo "; +for($i=$btsBgnNo; $i < $btsEndNo; $i++){ + //$bts_num=($i<10)?'0'.$i:$i; + $cellcont = explode(".",$cell_object[$i]); + + $sel_sql="SELECT CellIdentity FROM OMCR_Bts WHERE CellIdentity >=0 AND ObjectId like '$cell_object[$i]%' AND bssid=$bss_id"; + + $sel_result=mysqli_query($pubConn,$sel_sql); + //echo "
      sel_sql=$sel_sql
      "; + echo mysqli_error($pubConn); + $result_row=@mysqli_fetch_row($sel_result); + $temp_cell_id = $result_row[0]; + + if($temp_cell_id > 0){ + $btsArray[$i][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } + $sum_sql="SELECT + CellIdentity as CellIdentity, + hour(from_unixtime(StartTime)) as hours, + (meanTCHBusyTime * nbrOfAvailableTCHs)/(100 * (EndTime - StartTime)) as erlang + FROM $csta_table + WHERE $where AND CellIdentity = '$temp_cell_id' + Group By hours,CellIdentity + "; +$sel_result=mysqli_query($pubConn,$sum_sql); +if($DEBUG) echo "
      sel_sql=$sum_sql
      "; +echo mysqli_error($pubConn); +while($rows=mysqli_fetch_array($sel_result)){ + $btsArray[$i][0] == $rows[CellIdentity]; + $hourse=$rows[hours]+1; + $btsArray[$i][$hourse] += $rows[erlang]; + if($btsArray[$i][$hourse] > $maxNum) + $maxNum = $btsArray[$i][$hourse]; +} + + + if($btsArray[$i][0] > 0){ + echo ""; + echo ""; + echo ""; + for($clock=1;$clock<25;$clock++){ + echo ""; + } + echo ""; + } + else + { + echo ""; + echo ""; + echo ""; + for($clock=1;$clock<25;$clock++){ + echo ""; + } + echo ""; + } +} +$y_max = ceil($maxNum); +if($y_max < 1){ + $y_max = 1; +} + +?> +
      BTS ID$strCellID$clock
      Bts.$cellcont[1].$cellcont[2]{$btsArray[$i][0]}{$btsArray[$i][$clock]}
      Bts.$cellcont[1].$cellcont[2]----
      +

      +1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); +} + +//色块图标及说明 +$order = 0; + +for($i=$btsBgnNo; $i < $btsEndNo; $i++) +{ + + if($btsArray[$i][0] > 0) + { + $tmpName=$legendArr[$i][0]; + $tmpColor=$legendArr[$i][1]; + + $color = ImageColorAllocate ($im, hexdec(substr($tmpColor, 0, 2)), hexdec(substr($tmpColor, 2, 2)),hexdec(substr($tmpColor, 4, 2))); + $legendArr[$i][2]=$color; + ImageFilledRectangle($im,60 + $order* 60,$yEnd + 22,58 + $order* 60 + 10,$yEnd + 30,$legendArr[$i][2]); + Imagestring($im, 2, 73 + $order* 60,$yEnd + 20, "$tmpName", $text_color); + $order++; + } +} +function getNewXY(&$pointArr) +{ + global $xBgn,$yBgn,$xEnd,$yEnd,$maxYNum,$unitXPix; + $DEBUG=0; + for($i=0;$ipointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd - round(($yEnd - $yBgn) * ($pointArr[$i+1] / $maxYNum)); + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + } + $pointArr[$i] = $pointArr[$i-2]; + if($DEBUG) echo "
      pointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd-1; + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; +} +//get x,y points. +for($i=$btsBgnNo; $i <= $btsEndNo; $i++) +{ + if($btsArray[$i][0] > 0) + { + for($j=1;$j<26;$j++) + { + $pointArr[$i][$j*2] = $j-1; + $pointArr[$i][$j*2+1] = $btsArray[$i][$j]; + } + getNewXY($pointArr[$i]); + $pointNum[$i]= sizeof($pointArr[$i]) / 2; + $tmpColor[$i]=$legendArr[$i][2]; + } +} + +for($i=$btsBgnNo; $i <= $btsEndNo; $i++) +{ + if($btsArray[$i][0] > 0) + { + for($j=1;$j<26;$j++) + { + //画线条 + imageline($im,$pointArr[$i][$j*2],$pointArr[$i][$j*2+1],$pointArr[$i][$j*2+2],$pointArr[$i][$j*2+3],$tmpColor[$i]); + } + } +} + +//-----输出图形文件,请勿修改 +//delete *.png +$handle=opendir('.'); +while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); +} +$filename=time().".png"; +if(!$DEBUG){ + ImagePng ($im,"$filename"); + ImageDestroy($im); +} + +//-----显示图片 +echo ""; +echo ""; +echo ""; +exit; +}//end if. +//刻度线图片 +$dot_img=""; + +//求图像高度的基数 get the Division by number +$base_field=10; //$btsArray[bts_num][j]'s j +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + $max_number=($btsArray[$i][$base_field] > $max_number)?$btsArray[$i][$base_field]:$max_number; +} +$top_number =(round($max_number/100)+1)*100; //算出最大刻度,该值是个整数 +$base_number=round($top_number/100); +$base_number=($base_number <= 0)?1:$base_number; + +//需要显示成柱状图的$btsArray[bts_num][j]元素编号j +$show_field=array(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24); +//显示图例,需要和$show_field保持一致 +//$legend_def=array(''); //erlang只用一种颜色显示 + +//显示图例色彩,需要和$show_field保持一致 +//$legend_color=array('blue',.....,'blue');//erlang只用一种颜色显示 +//------------------------------显示图例-------------------------------------- +?> + +
      + +"; +echo "  "; +echo ""; +echo "
      "; +//-----------------------------显示柱状图------------------------------------- +$bts_num=$btsBgnNo; + +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + if($DEBUG) echo "
      btsBgnNo=$btsBgnNo,btsArray[$bts_num][$arrNum] ={$btsArray[$bts_num][$arrNum]}"; + ?> +
      + + + + + + + "; + showImg('blue',$width,$height,$imgName,$alt); + echo ""; + } + echo ""; + $bts_num++; + ?> + + + + + + +
      + + "; + echo ""; + echo "$strErlang $strStatistics"; + ?> + +
      + + + + $BTS_ID_1"; + ?> + +
       
      + + + diff --git a/wxc2_omc/performance/bssCsta/Erlang_index.php b/wxc2_omc/performance/bssCsta/Erlang_index.php new file mode 100755 index 0000000..60e1279 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/Erlang_index.php @@ -0,0 +1,15 @@ + + + + + + + <body> + + </body> + + + + diff --git a/wxc2_omc/performance/bssCsta/Erlang_up.php b/wxc2_omc/performance/bssCsta/Erlang_up.php new file mode 100755 index 0000000..e4e256d --- /dev/null +++ b/wxc2_omc/performance/bssCsta/Erlang_up.php @@ -0,0 +1,117 @@ + BSS > Erlang"; +$db=$ts_db; +if(!isset($device_name)){ + $device_name = 'LAN'; + } +?> + + + + +"; +echo ""; +echo ""; + echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> + +
      + + + + + + + +
      +: + + + +: + + + + +   + + + + + + +
      +
      + + diff --git a/wxc2_omc/performance/bssCsta/Handover_down.php b/wxc2_omc/performance/bssCsta/Handover_down.php new file mode 100755 index 0000000..b305309 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/Handover_down.php @@ -0,0 +1,473 @@ +"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $isbsplus = $row[0]; + +if($isbsplus == 0) +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and ObjectId not like 'Bts.0%' and Presence=1 and bssid=$bss_id"; +else +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and Presence=1 and bssid=$bss_id"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($cell_object[]) =$row; +} +$no_of_cell = count($cell_object); + +$btsBgnNo=0; +$btsEndNo=$no_of_cell; + +//----------------------get BssId <--> CellIdentity---------------------- +//---init this bsc's bts array--- +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + //array(cellid,MO,MT,LU,SS,AttTCH,SuccTCH,RFDorp0; + $btsArray[$i]=array(0,0,0,0,0,0,0,0,0,0,0,0); +} +/*$sel_sql="SELECT ObjectId,CellIdentity FROM OMCR_Bts WHERE CellIdentity >='0' AND bssid='$bss_id'"; +$sel_result=mysqli_query($pubConn,$sel_sql); +$result_rows=mysqli_fetch_array($sel_result); +do{ + $temp_bts_id = $result_rows[ObjectId]; //like"Bts.1.0" + $temp_bts_id = explode('.',$temp_bts_id); + $temp_bts_id = $temp_bts_id[1]; + $temp_cell_id= $result_rows[CellIdentity]; + if($temp_cell_id > 0){ + $btsArray[$temp_bts_id][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } +}while($result_rows=mysqli_fetch_array($sel_result)); +*/ + +//-----------get where--------------- + +$where=" bssid='$bss_id' "; +//data +if(isset($sel_date)){ + $bgn_date=$sel_date.' '.$hou_1.':'.$mid_1.':'.$sec_1; + $end_date=$sel_date.' '.$hou_2.':'.$mid_2.':'.$sec_2; +}else{ + $bgn_date =date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date =date("Y-m-d H:i:s",mktime()); +} +$where = $where." AND startTime >=UNIX_TIMESTAMP('$bgn_date') AND EndTime <=UNIX_TIMESTAMP('$end_date')"; + + +//-----inter BSS Handover------- +$sel_sql="SELECT + CellIdentity as CellIdentity, + SUM(HoInterBSCReqToMSC) AS sum_req, + SUM(HoInterBSCOutAtmpt) AS sum_att, + SUM(HoInterBSCOut) AS sum_outsucc, + SUM(HoInterBSCMSFail) AS sum_msfail, + SUM(HoInterBSCInAtmpt) AS sum_inatt, + SUM(HoInterBSCIn) AS sum_insucc + FROM $csta_table + WHERE $where + GROUP BY CellIdentity + "; +$sel_result=mysqli_query($pubConn,$sel_sql); +//echo "
      $sel_sql
      "; +echo mysqli_error($pubConn); +while($rows=mysqli_fetch_array($sel_result)){ + for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + if($btsArray[$i][0] == $rows[CellIdentity]){ + $btsArray[$i][1]=$rows[sum_req]; + $btsArray[$i][2]=$rows[sum_att]; + $btsArray[$i][3]=$rows[sum_outsucc]; + $btsArray[$i][4]=$rows[sum_msfail]; + $btsArray[$i][5]=$rows[sum_inatt]; + $btsArray[$i][6]=$rows[sum_insucc]; + break; + } + } +} +//-----intra BSS Handover------- + + + +?> + + + + + + + + + +
      + BSS"."$bscNum Handover $strStatistics "; + ?> + + $bgn_date   $strTo    $end_date";?> +
      + + +"; +echo ""; +echo ""; +//---inter--- +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//---intra--- +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//$bss_id = (strlen($bss_id)<2)?'0'.$bss_id:$bss_id; +for($i=$btsBgnNo; $i < $btsEndNo; $i++){ + //$bts_num=($i<10)?'0'.$i:$i; + $cellcont = explode(".",$cell_object[$i]); + + $sel_sql="SELECT CellIdentity FROM OMCR_Bts WHERE CellIdentity >=0 AND ObjectId like '$cell_object[$i]%' AND bssid=$bss_id"; + + $sel_result=mysqli_query($pubConn,$sel_sql); + //echo "
      sel_sql=$sel_sql
      "; + echo mysqli_error($pubConn); + $result_row=@mysqli_fetch_row($sel_result); + $temp_cell_id = $result_row[0]; + + if($temp_cell_id > 0){ + $btsArray[$i][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } + $sum_sql="SELECT + CellIdentity as CellIdentity, + SUM(HoIntraBSCAtmpt) AS sum_att, + SUM(succOutgoingInternalInterCellHDOs) AS sum_succ, + SUM(HoIntraBscLostMs) AS sum_drop, + SUM(HoIntraBSCIn) AS sum_insucc, + SUM(FailIncomingHDOs) AS sum_infail + FROM $csta_table + WHERE $where AND CellIdentity = '$temp_cell_id' + GROUP BY CellIdentity + "; +$sel_result=mysqli_query($pubConn,$sum_sql); +//echo "
      $sel_sql
      "; +echo mysqli_error($pubConn); +while($rows=mysqli_fetch_array($sel_result)){ + $btsArray[$i][0]=$rows[CellIdentity]; + $btsArray[$i][7]=$rows[sum_att]; + $btsArray[$i][8]=$rows[sum_succ]; + $btsArray[$i][9]=$rows[sum_drop]; + $btsArray[$i][10]=$rows[sum_insucc]; + $btsArray[$i][11]=$rows[sum_infail]; +} + + if($btsArray[$i][0] > 0){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $InterOutDrop=($btsArray[$i][2] - $btsArray[$i][3] - $btsArray[$i][4])*100; + echo ""; + if($btsArray[$i][2] > 0){ + $SuccRate = ($btsArray[$i][3] / $btsArray[$i][2])* 100; + $SuccRate = sprintf("%01.2f",$SuccRate); + echo ""; + }else{ + echo ""; + } + + echo ""; + echo ""; + if($btsArray[$i][5] > 0){ + $SuccRate = ($btsArray[$i][6] / $btsArray[$i][5]) * 100; + $SuccRate = sprintf("%01.2f",$SuccRate); + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + echo ""; + if($btsArray[$i][7] > 0){ + $SuccRate = ($btsArray[$i][8] / $btsArray[$i][7]) * 100; + $SuccRate = sprintf("%01.2f",$SuccRate); + echo ""; + }else{ + echo ""; + } + $IntraInAtt=$btsArray[$i][10]+$btsArray[$i][11]; + echo ""; + echo ""; + if($IntraInAtt > 0){ + $SuccRate=($btsArray[$i][10] / ($btsArray[$i][10]+$btsArray[$i][11])) * 100;; + $SuccRate = sprintf("%01.2f",$SuccRate); + echo ""; + }else{ + echo ""; + } + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +} +?> +
        $strInsterBSC $strInstraBSC
      BTS ID$strCellIDOutAttOutReqOutSuccOutFailOutSucc (%)InAttInSuccInSucc (%)OutAttOutSuccOutFailOutSucc (%)InAttInSuccInSucc (%)
      Bts.$cellcont[1].$cellcont[2] {$btsArray[$i][0]} {$btsArray[$i][2]} {$btsArray[$i][1]} {$btsArray[$i][3]} $InterOutDrop $SuccRate"."% -- {$btsArray[$i][5]} {$btsArray[$i][6]} $SuccRate"."% -- {$btsArray[$i][7]} {$btsArray[$i][8]} {$btsArray[$i][9]} $SuccRate"."% -- $IntraInAtt {$btsArray[$i][10]} $SuccRate"."% --
      Bts.$cellcont[1].$cellcont[2] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
      +

      +"; + +//求图像高度的基数 get the Division by number +$base_field=7; //$btsArray[bts_num][j]'s j +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + $max_number=($btsArray[$i][$base_field] > $max_number)?$btsArray[$i][$base_field]:$max_number; +} +$top_number =(round($max_number/100)+1)*100; //算出最大刻度,该值是个整数 +$base_number=round($top_number/100); +$base_number=($base_number <= 0)?1:$base_number; + +//需要显示成柱状图的$btsArray[bts_num][j]元素编号j +$show_field=array(2,3,5,6,7,8,10,11); + +//显示图例名称定义,需要和$show_field保持一致 +$legend_def=array('Inter_out Att','Inter_out succ','Inter_in Att','Inter_in succ','Intra_out Att','Intra_out succ','Intra_in Att','Intra_in succ',); + +//显示图例色彩,需要和$show_field保持一致 +$legend_color=array('blue','green','blue','green','blue','green','blue','green'); + +//------------------------------显示图例-------------------------------------- +?> + + + +"; + showImg($legend_color[$i],10,10); + echo ""; + echo ""; + if($i == 3){ + echo ""; + echo ""; + } +} +?> + + +
      :{$legend_def[$i]}
       
      +
      + +"; +//echo "  "; +//echo ""; +//echo "
      "; +//------------------------------显示柱状图---------------------------------- + +$bts_num=$btsBgnNo; +$bts_num=$btsBgnNo; +if($isbsplus == 0){ +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'BtsMgr.%' and ObjectId not like 'BtsMgr.0%' and Presence=1 and bssid=$bss_id"; +}else if($isbsplus == 1){ + $sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'BtsMgr.%' and Presence=1 and bssid=$bss_id"; +} +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($btsmgr_list[]) =$row; +} +$no_of_btsmgr = count($btsmgr_list); +echo "$strHandover:"; + +echo "  "; +echo ""; +echo "
      "; +for($i=0;$i<$no_of_btsmgr;$i++){ + ?> +
      + + + + + + + "; + showImg($legend_color[$k],$width,$height,$imgName,$alt); + echo ""; + } + echo ""; + $bts_num++; + } + ?> + + + + + + +
      + + "; + echo ""; + echo "$btsmgr_list[$i]:TCH($strHOExplain) $strStatistics"; + ?> + +
      + + + + Bts.$btsmgrcont[1].0"; + echo ""; + echo ""; + ?> + +
       Bts.$btsmgrcont[1].0Bts.$btsmgrcont[1].0
      + + + diff --git a/wxc2_omc/performance/bssCsta/Handover_index.php b/wxc2_omc/performance/bssCsta/Handover_index.php new file mode 100755 index 0000000..b87de86 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/Handover_index.php @@ -0,0 +1,15 @@ + + + + + + + <body> + + </body> + + + + diff --git a/wxc2_omc/performance/bssCsta/Handover_up.php b/wxc2_omc/performance/bssCsta/Handover_up.php new file mode 100755 index 0000000..5eb0953 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/Handover_up.php @@ -0,0 +1,118 @@ + BSS > $strHandover"; +$db=$ts_db; +if(!isset($device_name)){ + $device_name = 'LAN'; + } +?> + + + + +"; +echo ""; +echo ""; + echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> + +
      + + + + + + + + +
      +: + + + +: + + + + +   + + + + + + + +
      +
      + + diff --git a/wxc2_omc/performance/bssCsta/ReceLevAndQua_down.php b/wxc2_omc/performance/bssCsta/ReceLevAndQua_down.php new file mode 100755 index 0000000..7ef1d93 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/ReceLevAndQua_down.php @@ -0,0 +1,385 @@ +"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $isbsplus = $row[0]; + +if($isbsplus == 0) +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and ObjectId not like 'Bts.0%' and Presence=1 and bssid=$bss_id"; +else +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and Presence=1 and bssid=$bss_id"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($cell_object[]) =$row; +} +$no_of_cell = count($cell_object); + +$btsBgnNo=0; +$btsEndNo=$no_of_cell; + +//----------------------get BssId <--> CellIdentity---------------------- +//---init this bsc's bts array--- +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + //array(cellid,MO,MT,LU,SS,AttTCH,SuccTCH,RFDorp0; + $btsArray[$i]=array(0,0,0,0,0,0,0,0); +} +/*$sel_sql="SELECT ObjectId,CellIdentity FROM OMCR_Bts WHERE CellIdentity >='0' AND bssid='$bss_id'"; +$sel_result=mysqli_query($pubConn,$sel_sql); +$result_rows=mysqli_fetch_array($sel_result); +do{ + $temp_bts_id = $result_rows[ObjectId]; //like"Bts.1.0" + $temp_bts_id = explode('.',$temp_bts_id); + $temp_bts_id = $temp_bts_id[1]; + $temp_cell_id= $result_rows[CellIdentity]; + if($temp_cell_id > 0){ + $btsArray[$temp_bts_id][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } +}while($result_rows=mysqli_fetch_array($sel_result)); +*/ + +//-----------get where--------------- + +$where=" bssid='$bss_id' "; +//data +if(isset($sel_date)){ + $bgn_date=$sel_date.' '.$hou_1.':'.$mid_1.':'.$sec_1; + $end_date=$sel_date.' '.$hou_2.':'.$mid_2.':'.$sec_2; +}else{ + $bgn_date =date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date =date("Y-m-d H:i:s",mktime()); +} +$where = $where." AND startTime >=UNIX_TIMESTAMP('$bgn_date') AND EndTime <=UNIX_TIMESTAMP('$end_date')"; + + +?> + + + + + + + + + +
      + BSS"."$bscNum $strReceiveLevelAndQuality $strStatistics "; + ?> + + $bgn_date   $strTo    $end_date";?> +
      + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//echo "ddd = $btsEndNo"; +//$bss_id = (strlen($bss_id)<2)?'0'.$bss_id:$bss_id; +for($i=$btsBgnNo; $i < $btsEndNo; $i++){ + //$bts_num=($i<10)?'0'.$i:$i; + $cellcont = explode(".",$cell_object[$i]); + $sel_sql="SELECT CellIdentity FROM OMCR_Bts WHERE CellIdentity >=0 AND ObjectId like '$cell_object[$i]%' AND bssid=$bss_id"; + + $sel_result=mysqli_query($pubConn,$sel_sql); + //echo "
      sel_sql=$sel_sql
      "; + echo mysqli_error($pubConn); + $result_row=@mysqli_fetch_row($sel_result); + $temp_cell_id = $result_row[0]; + + if($temp_cell_id > 0){ + $btsArray[$i][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } + + $sum_sql="SELECT CellIdentity as CellIdentity, + 8*( + 0.5*SUM(UplinkAvgSignal_0)+1.5*SUM(UplinkAvgSignal_1)+2.5*SUM(UplinkAvgSignal_2)+3.5*SUM(UplinkAvgSignal_3) + +4.5*SUM(UplinkAvgSignal_4)+5.5*SUM(UplinkAvgSignal_5)+6.5*SUM(UplinkAvgSignal_6)+7.5*SUM(UplinkAvgSignal_7) + ) / (SUM(UplinkAvgSignal_0)+SUM(UplinkAvgSignal_1)+SUM(UplinkAvgSignal_2)+SUM(UplinkAvgSignal_3) + +SUM(UplinkAvgSignal_4)+SUM(UplinkAvgSignal_5)+SUM(UplinkAvgSignal_6)+SUM(UplinkAvgSignal_7) + ) as UL_level, + 8*( + 0.5*SUM(DownlinkAvgSignal_0)+1.5*SUM(DownlinkAvgSignal_1)+2.5*SUM(DownlinkAvgSignal_2)+3.5*SUM(DownlinkAvgSignal_3) + +4.5*SUM(DownlinkAvgSignal_4)+5.5*SUM(DownlinkAvgSignal_5)+6.5*SUM(DownlinkAvgSignal_6)+7.5*SUM(DownlinkAvgSignal_7)) + / (SUM(DownlinkAvgSignal_0)+SUM(DownlinkAvgSignal_1)+SUM(DownlinkAvgSignal_2)+SUM(DownlinkAvgSignal_3) + +SUM(DownlinkAvgSignal_4)+SUM(DownlinkAvgSignal_5)+SUM(DownlinkAvgSignal_6)+SUM(DownlinkAvgSignal_7) + ) as DL_level, + (SUM(TotalQualityDurationUL_0)*0+SUM(TotalQualityDurationUL_1)+SUM(TotalQualityDurationUL_2)*2+SUM(TotalQualityDurationUL_3)*3+SUM(TotalQualityDurationUL_4)*4 + +SUM(TotalQualityDurationUL_5)*5+SUM(TotalQualityDurationUL_6)*6+SUM(TotalQualityDurationUL_7)*7) + / SUM(TotalQualityDurationUL_0+TotalQualityDurationUL_1+TotalQualityDurationUL_2+TotalQualityDurationUL_3 + +TotalQualityDurationUL_4+TotalQualityDurationUL_5+TotalQualityDurationUL_6+TotalQualityDurationUL_7) as UL_quality, + (SUM(TotalQualityDurationDL_0)*0+SUM(TotalQualityDurationDL_1)+SUM(TotalQualityDurationDL_2)*2+SUM(TotalQualityDurationDL_3)*3+SUM(TotalQualityDurationDL_4)*4 + +SUM(TotalQualityDurationDL_5)*5+SUM(TotalQualityDurationDL_6)*6+SUM(TotalQualityDurationDL_7)*7) + / SUM(TotalQualityDurationDL_0+TotalQualityDurationDL_1+TotalQualityDurationDL_2+TotalQualityDurationDL_3 + +TotalQualityDurationDL_4+TotalQualityDurationDL_5+TotalQualityDurationDL_6+TotalQualityDurationDL_7) as DL_quality + FROM $csta_table + WHERE $where AND CellIdentity = '$temp_cell_id' GROUP BY CellIdentity"; +$sel_result=mysqli_query($pubConn,$sum_sql); +//echo "
      $sel_sql
      "; +echo mysqli_error($pubConn); +while($rows=mysqli_fetch_array($sel_result)){ + + $btsArray[$i][0]=$rows[CellIdentity]; + $btsArray[$i][1]=$rows[UL_level]; + $btsArray[$i][2]=$rows[DL_level]; + $btsArray[$i][3]=$rows[UL_quality]; + $btsArray[$i][4]=$rows[DL_quality]; + +} + + if($btsArray[$i][0] > 0){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + +} +?> +
      BTS ID$strCellIDUL Rx levelDL Rx levelUL Rx qualityDL Rx quality
      Bts.$cellcont[1].$cellcont[2] {$btsArray[$i][0]} ".round($btsArray[$i][1])." ".round($btsArray[$i][2])." {$btsArray[$i][3]} {$btsArray[$i][4]}
      Bts.$cellcont[1].$cellcont[2] -- -- -- -- --
      +

      +"; + +//求图像高度的基数 get the Division by number +//$base_field=1; //$btsArray[bts_num][j]'s j +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + $max_number=($btsArray[$i][$base_field] > $max_number)?$btsArray[$i][$base_field]:$max_number; +} +$top_number =(round($max_number/100)+1)*100; //算出最大刻度,该值是个整数 +$base_number=round($top_number/100); +$base_number=($base_number <= 0)?1:$base_number; + +//需要显示成柱状图的$btsArray[bts_num][j]元素编号j +//$show_field=array(1,2,3,4); +$show_field=array(1,2); + +//显示图例名称定义,需要和$show_field保持一致 +//$legend_def=array('UL Rx Level','DL Rx Level','UL Rx Quality','DL Rx Quality'); +$legend_def=array('UL Rx level','DL Rx level'); + +//显示图例色彩,需要和$show_field保持一致 +$legend_color=array('blue','orange'); + +//------------------------------显示图例-------------------------------------- +?> + + + +"; + showImg($legend_color[$i],10,10); + echo ""; + echo ""; +} +?> + + +
      :{$legend_def[$i]}
      +
      + +"; +//echo "  "; +//echo ""; +//echo "
      "; +//------------------------------显示柱状图---------------------------------- +$bts_num=$btsBgnNo; +if($isbsplus == 0){ +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'BtsMgr.%' and ObjectId not like 'BtsMgr.0%' and Presence=1 and bssid=$bss_id"; +}else if($isbsplus == 1){ + $sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'BtsMgr.%' and Presence=1 and bssid=$bss_id"; +} +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($btsmgr_list[]) =$row; +} +$no_of_btsmgr = count($btsmgr_list); +echo "Receive quality:"; + +echo "  "; +echo ""; +echo "
      "; +for($i=0;$i<$no_of_btsmgr;$i++){ + ?> +
      + + + + + + + "; + showImg($legend_color[$k],$width,$height,$imgName,$alt); + echo ""; + } + echo ""; + $bts_num++; + } + ?> + + + + + + +
      + + "; + echo ""; + echo "$btsmgr_list[$i]:TCH($strTCHExplain) $strStatistics"; + ?> + +
      + + + + Bts.$btsmgrcont[1].0"; + echo ""; + echo ""; + ?> + +
       Bts.$btsmgrcont[1].1Bts.$btsmgrcont[1].2
      + + + \ No newline at end of file diff --git a/wxc2_omc/performance/bssCsta/ReceLevAndQua_index.php b/wxc2_omc/performance/bssCsta/ReceLevAndQua_index.php new file mode 100755 index 0000000..25d2190 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/ReceLevAndQua_index.php @@ -0,0 +1,15 @@ + + + + + + + <body> + + </body> + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/bssCsta/ReceLevAndQua_up.php b/wxc2_omc/performance/bssCsta/ReceLevAndQua_up.php new file mode 100755 index 0000000..4098a22 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/ReceLevAndQua_up.php @@ -0,0 +1,117 @@ + BSS > $strReceiveLevelAndQuality"; +$db=$ts_db; +if(!isset($device_name)){ + $device_name = 'LAN'; + } +?> + + + + +"; +echo ""; +echo ""; + echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> + +
      + + + + + + + + +
      +: + + + +: + + + +   + + + + + + + +
      +
      + + diff --git a/wxc2_omc/performance/bssCsta/SDCCH_down.php b/wxc2_omc/performance/bssCsta/SDCCH_down.php new file mode 100755 index 0000000..e7f0112 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/SDCCH_down.php @@ -0,0 +1,394 @@ +"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $isbsplus = $row[0]; +//----------------------get BssId <--> CellIdentity---------------------- +//---init this bsc's bts array--- +if($isbsplus == 0) +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and ObjectId not like 'Bts.0%' and Presence=1 and bssid=$bss_id"; +else +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and Presence=1 and bssid=$bss_id"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($cell_object[]) =$row; +} +$no_of_cell = count($cell_object); + +$btsBgnNo=0; +$btsEndNo=$no_of_cell; + +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + //array(cellid,MO,MT,LU,SS,AttTCH,SuccTCH,RFDorp); + $btsArray[$i]=array(0,0,0,0,0,0,0,0); +} +/*$sel_sql="SELECT ObjectId,CellIdentity FROM OMCR_Bts WHERE CellIdentity >='0' AND bssid='$bss_id'"; +$sel_result=mysqli_query($pubConn,$sel_sql); +$result_rows=mysqli_fetch_array($sel_result); +do{ + $temp_bts_id = $result_rows[ObjectId]; //like"Bts.1.0" + $temp_bts_id = explode('.',$temp_bts_id); + $temp_bts_id = $temp_bts_id[1]; + $temp_cell_id= $result_rows[CellIdentity]; + if($temp_cell_id > 0){ + $btsArray[$temp_bts_id][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } +}while($result_rows=mysqli_fetch_array($sel_result)); +*/ + +//-----------get where--------------- + +$where=" bssid='$bss_id' "; +//data +if(isset($sel_date)){ + $bgn_date=$sel_date.' '.$hou_1.':'.$mid_1.':'.$sec_1; + $end_date=$sel_date.' '.$hou_2.':'.$mid_2.':'.$sec_2; +}else{ + $bgn_date =date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date =date("Y-m-d H:i:s",mktime()); +} +$where = $where." AND startTime >=UNIX_TIMESTAMP('$bgn_date') AND EndTime <=UNIX_TIMESTAMP('$end_date')"; + + +?> + + + + + + + + + +
      + BSS"."$bscNum SDCCH($strSDCCHExplain) $strStatistics "; + ?> + + $bgn_date   $strTo    $end_date";?> +
      + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//$bss_id = (strlen($bss_id)<2)?'0'.$bss_id:$bss_id; +for($i=$btsBgnNo; $i < $btsEndNo; $i++){ + //$bts_num=($i<10)?'0'.$i:$i; + $cellcont = explode(".",$cell_object[$i]); + + $sel_sql="SELECT CellIdentity FROM OMCR_Bts WHERE CellIdentity >='0' AND ObjectId like '$cell_object[$i]' AND bssid=$bss_id"; + $sel_result=mysqli_query($pubConn,$sel_sql); + //echo "
      sel_sql=$sel_sql"; + echo mysqli_error($pubConn); + $result_row=@mysqli_fetch_row($sel_result); + $temp_cell_id = $result_row[0]; + + if($temp_cell_id > 0){ + $btsArray[$i][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } + + $sum_sql="SELECT + CellIdentity as CellIdentity, + SUM(attSDCCHSeizures) as sum_attSDCCH, + SUM(attSDCCHSeizuresFailures) as sum_failSDCCH, + SUM(chanReqMSFail) as sum_CRMSfail, + SUM(SDCCHRadioFail) as sum_SDCCHRfail, + SUM(SDCCHBssDrop) as sum_SDCCHdrop + FROM $csta_table + WHERE $where AND CellIdentity = '$temp_cell_id' + GROUP BY CellIdentity + "; + $sel_result=mysqli_query($pubConn,$sum_sql); + //echo "
      $sel_sql
      "; + echo mysqli_error($pubConn); + while($rows=mysqli_fetch_array($sel_result)){ + + $btsArray[$i][0]=$rows[CellIdentity]; + $btsArray[$i][1]=$rows[sum_attSDCCH]; + $btsArray[$i][2]=$rows[sum_failSDCCH]; + $btsArray[$i][3]=$rows[sum_CRMSfail]; + $btsArray[$i][4]=$rows[sum_SDCCHRfail]; + $btsArray[$i][5]=$rows[sum_SDCCHdrop]; + } + + + if($btsArray[$i][0] > 0){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + if($btsArray[$i][1] <= 0){ + $SDCCHFailRate=0; + }else{ + $SDCCHFailRate = $btsArray[$i][2]/$btsArray[$i][1]*100; + $SDCCHFailRate = sprintf("%01.2f",$SDCCHFailRate); + } + echo ""; + echo ""; + $Drop=$btsArray[$i][4]+$btsArray[$i][5]; + echo ""; + if($btsArray[$i][1] <=0){ + $DropRate=0; + }else{ + $DropRate = $Drop/$btsArray[$i][1]*100; + $DropRate = sprintf("%01.2f",$DropRate); + } + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +} +?> +
      BTS ID$strCellID SDCCH attemptSDCCH failureSDCCH Failure (%)RF FailureFailureFailure (%)
      Bts.$cellcont[1].$cellcont[2] {$btsArray[$i][0]} {$btsArray[$i][1]} {$btsArray[$i][2]} $SDCCHFailRate"."% {$btsArray[$i][3]} $Drop $DropRate"."%
      Bts.$cellcont[1].$cellcont[2] -- -- -- -- -- -- --
      +

      +"; + +//求图像高度的基数 get the Division by number +//$base_field=1; //$btsArray[bts_num][j]'s j +for($base_field=1;$base_field<8;$base_field++){ + for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + $max_number=($btsArray[$i][$base_field] > $max_number)?$btsArray[$i][$base_field]:$max_number; + } +} +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + $max_number=($btsArray[$i][$base_field] > $max_number)?$btsArray[$i][$base_field]:$max_number; +} +$top_number =(round($max_number/100)+1)*100; //算出最大刻度,该值是个整数 +$base_number=round($top_number/100); +$base_number=($base_number <= 0)?1:$base_number; + +//需要显示成柱状图的$btsArray[bts_num][j]元素编号j +$show_field=array(1,2,4,5); + +//显示图例名称定义,需要和$show_field保持一致 +$legend_def=array('SDCCH attempt','SDCCH failure','RF failure','Failure'); + +//显示图例色彩,需要和$show_field保持一致 +$legend_color=array('blue','orange','yellow','red'); + +//------------------------------显示图例-------------------------------------- +?> + + + +"; + showImg($legend_color[$i],10,10); + echo ""; + echo ""; +} +?> + + +
      :{$legend_def[$i]}
      +
      + +"; +//echo "  "; +//echo ""; +//echo "
      "; +//------------------------------显示柱状图---------------------------------- +$bts_num=$btsBgnNo; +if($isbsplus == 0){ +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'BtsMgr.%' and ObjectId not like 'BtsMgr.0%' and Presence=1 and bssid=$bss_id"; +}else if($isbsplus == 1){ + $sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'BtsMgr.%' and Presence=1 and bssid=$bss_id"; +} +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($btsmgr_list[]) =$row; +} +$no_of_btsmgr = count($btsmgr_list); +echo "SDCCH:"; + +echo "  "; +echo ""; +echo "
      "; + +for($i=0;$i<$no_of_btsmgr;$i++){ + ?> +
      + + + + + + + "; + showImg($legend_color[$k],$width,$height,$imgName,$alt); + echo ""; + } + echo ""; + $bts_num++; + } + ?> + + + + + + +
      + + "; + echo ""; + echo "BtsMgr.$btsmgrcont[1]:SDCCH($strSDCCHExplain) $strStatistics"; + ?> + +
      + + + + Bts.$btsmgrcont[1].0"; + echo ""; + echo ""; + ?> + +
       Bts.$btsmgrcont[1].1Bts.$btsmgrcont[1].2
      + + + diff --git a/wxc2_omc/performance/bssCsta/SDCCH_index.php b/wxc2_omc/performance/bssCsta/SDCCH_index.php new file mode 100755 index 0000000..e5d7352 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/SDCCH_index.php @@ -0,0 +1,15 @@ + + + + + + + <body> + + </body> + + + + diff --git a/wxc2_omc/performance/bssCsta/SDCCH_up.php b/wxc2_omc/performance/bssCsta/SDCCH_up.php new file mode 100755 index 0000000..67b343a --- /dev/null +++ b/wxc2_omc/performance/bssCsta/SDCCH_up.php @@ -0,0 +1,117 @@ + BSS > SDCCH"; +$db=$ts_db; +if(!isset($device_name)){ + $device_name = 'LAN'; + } +?> + + + + +"; +echo ""; +echo ""; + echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> + +
      + + + + + + + + +
      +: + + + +: + + + +   + + + + + + + +
      +
      + + diff --git a/wxc2_omc/performance/bssCsta/TCH_down.php b/wxc2_omc/performance/bssCsta/TCH_down.php new file mode 100755 index 0000000..07c2d70 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/TCH_down.php @@ -0,0 +1,385 @@ +"; + $result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); + $row = mysqli_fetch_row($result); + $isbsplus = $row[0]; + +if($isbsplus == 0) +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and ObjectId not like 'Bts.0%' and Presence=1 and bssid=$bss_id"; +else +$sqlstring = "select ObjectId from OMCR_BSSTREE where ObjectId like 'Bts.%' and Presence=1 and bssid=$bss_id"; +//echo $sqlstring . "
      "; +$result = mysqli_query($pubConn,$sqlstring) or + die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); +while($row = mysqli_fetch_row($result)) +{ + list($cell_object[]) =$row; +} +$no_of_cell = count($cell_object); + +$btsBgnNo=0; +$btsEndNo=$no_of_cell; + +//----------------------get BssId <--> CellIdentity---------------------- +//---init this bsc's bts array--- +for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + //$btsArray[$i]=array(cellid,MO,MT,LU,SS,AttTCH,SuccTCH,RFDorp); + $btsArray[$i]=array(0,0,0,0,0,0,0,0); +} +/*$sel_sql="SELECT ObjectId,CellIdentity FROM OMCR_Bts WHERE CellIdentity >='0' AND bssid='$bss_id'"; +$sel_result=mysqli_query($pubConn,$sel_sql); +//echo "
      sel_sql=$sel_sql"; +echo mysqli_error($pubConn); +$result_rows=@mysqli_fetch_array($sel_result); +do{ + $temp_bts_id = $result_rows[ObjectId]; //like"Bts.1.0" + $temp_bts_id = explode('.',$temp_bts_id); + $temp_bts_id = $temp_bts_id[1]; //here Bts's ID =bts change by hewd 2003-02-27 + + $temp_cell_id= $result_rows[CellIdentity]; + if($temp_cell_id > 0){ + $btsArray[$temp_bts_id][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } +}while($result_rows=@mysqli_fetch_array($sel_result)); +*/ + +//-----------get where--------------- + +$where=" bssid='$bss_id' "; +//data +if(isset($sel_date)){ + $bgn_date=$sel_date.' '.$hou_1.':'.$mid_1.':'.$sec_1; + $end_date=$sel_date.' '.$hou_2.':'.$mid_2.':'.$sec_2; + $where = $where." AND startTime >=UNIX_TIMESTAMP('$bgn_date') AND EndTime <=UNIX_TIMESTAMP('$end_date')"; +}else{ + $bgn_date =date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date =date("Y-m-d H:i:s",mktime()); + $where = $where." AND startTime >=UNIX_TIMESTAMP('$bgn_date') AND EndTime <=UNIX_TIMESTAMP('$end_date')"; +} + + +?> + + + + + + + + + +
      + BSS"."$bscNum TCH($strTCHExplain) $strStatistics "; + ?> + + $bgn_date   $strTo    $end_date";?> +
      + + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//$bss_id = (strlen($bss_id)<2)?'0'.$bss_id:$bss_id; +for($i=$btsBgnNo; $i < $btsEndNo; $i++){ + //$bts_num=($i<10)?'0'.$i:$i; + $cellcont = explode(".",$cell_object[$i]); + + + $sel_sql="SELECT CellIdentity FROM OMCR_Bts WHERE CellIdentity >=0 AND ObjectId like '$cell_object[$i]%' AND bssid=$bss_id"; + + $sel_result=mysqli_query($pubConn,$sel_sql); + //echo "
      sel_sql=$sel_sql
      "; + echo mysqli_error($pubConn); + $result_row=@mysqli_fetch_row($sel_result); + $temp_cell_id = $result_row[0]; + + if($temp_cell_id > 0){ + $btsArray[$i][0]= $temp_cell_id; + //echo "
      btsArray[$temp_bts_id][0]= $temp_cell_id"; + } + $sum_sql="SELECT + bssid,CellIdentity, + SUM(succAccProcCMOrigCall) as sum_MO, + SUM(succAccProcPageRsp) as sum_MT, + SUM(succAccProcLocUpd) as sum_LU, + SUM(succAccProcCMSs) as sum_SS, + SUM(attTCHSeizures) as sum_AttTCH, + SUM(succTCHSeizures) as sum_SuccTCH, + SUM(TCHRadioFail) as sum_RFDorp + FROM $csta_table + WHERE $where AND CellIdentity = '$temp_cell_id' GROUP BY CellIdentity"; + + +//echo "
      $sum_sql
      "; +$sel_result=mysqli_query($pubConn,$sum_sql); +echo mysqli_error($pubConn); +while($rows=@mysqli_fetch_array($sel_result)){ + $btsArray[$i][0]=$rows[CellIdentity]; + $btsArray[$i][1]=$rows[sum_MO]; + echo "MO-{$btsArray[$i][1]}
      "; + $btsArray[$i][2]=$rows[sum_MT]; + $btsArray[$i][3]=$rows[sum_LU]; + $btsArray[$i][4]=$rows[sum_SS]; + $btsArray[$i][5]=$rows[sum_AttTCH]; + $btsArray[$i][6]=$rows[sum_SuccTCH]; + $btsArray[$i][7]=$rows[sum_RFDorp]; +} + + if($btsArray[$i][0] > 0){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } +} +?> +
      BTS ID $strCellID MO callMT callLUSSTCH attemptTCH successRF failure
      Bts.$cellcont[1].$cellcont[2] {$btsArray[$i][0]} {$btsArray[$i][1]} {$btsArray[$i][2]} {$btsArray[$i][3]} {$btsArray[$i][4]} {$btsArray[$i][5]} {$btsArray[$i][6]} {$btsArray[$i][7]}
      Bts.$cellcont[1].$cellcont[2] -- -- -- -- -- -- -- --
      +

      +"; + +//........ get the Division by number +//$base_field=5; //$btsArray[bts_num][j]'s j +for($base_field=1;$base_field<8;$base_field++){ + for($i=$btsBgnNo; $i <= $btsEndNo; $i++){ + $max_number=($btsArray[$i][$base_field] > $max_number)?$btsArray[$i][$base_field]:$max_number; + } +} +//echo "max_number=$max_number"; +$top_number =(round($max_number/100)+1)*100; //............. +$base_number=round($top_number/100); +$base_number=($base_number <= 0)?1:$base_number; + + +//.........$btsArray[bts_num][j]....j +$show_field=array(1,2,3,4,5,6,7); + +//............$show_field.... +$legend_def=array('MO call','MT call','LU','SS','TCH attempt','TCH success','RF failure'); + +//..........$show_field.... +$legend_color=array('blue','brown','orange','yellow','blue','green','red'); + +//------------------------------....-------------------------------------- +?> + + + +"; + showImg($legend_color[$i],10,10); + echo ""; + echo ""; +} +?> + + +
      :{$legend_def[$i]}
      +
      + +"; + +echo "  "; +echo ""; +echo "
      "; +for($i=0;$i<$no_of_btsmgr;$i++){ + ?> +
      + + + + + + + btsArray[$bts_num][$arrNum]={$btsArray[$bts_num][$arrNum]}"; + $width = 19; + $imgName = 'img'.$i.'_'.$j.'_'.$k; + echo ""; + } + echo ""; + $bts_num++; + } + ?> + + + + + + +
      + "; + echo ""; + echo "$btsmgr_list[$i]:TCH($strTCHExplain) $strStatistics"; + ?> +
      "; + showImg($legend_color[$k],$width,$height,$imgName,$alt); + echo "
      + + + + Bts.$btsmgrcont[1].0"; + echo ""; + echo ""; + ?> + +
       Bts.$btsmgrcont[1].1Bts.$btsmgrcont[1].2
      + + + diff --git a/wxc2_omc/performance/bssCsta/TCH_index.php b/wxc2_omc/performance/bssCsta/TCH_index.php new file mode 100755 index 0000000..c0e04a5 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/TCH_index.php @@ -0,0 +1,15 @@ + + + + + + + <body> + + </body> + + + + diff --git a/wxc2_omc/performance/bssCsta/TCH_up.php b/wxc2_omc/performance/bssCsta/TCH_up.php new file mode 100755 index 0000000..f242708 --- /dev/null +++ b/wxc2_omc/performance/bssCsta/TCH_up.php @@ -0,0 +1,117 @@ + BSS > TCH"; +$db=$ts_db; +if(!isset($device_name)){ + $device_name = 'LAN'; + } +?> + + + + +"; +echo ""; +echo ""; + echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> + +
      + + + + + + + + +
      +: + + + +: + + + +   + + + + + + + +
      +
      + + diff --git a/wxc2_omc/performance/cnfCsta/dataDown.php b/wxc2_omc/performance/cnfCsta/dataDown.php new file mode 100755 index 0000000..f2460d1 --- /dev/null +++ b/wxc2_omc/performance/cnfCsta/dataDown.php @@ -0,0 +1,339 @@ +$strNotFindRecord."; + exit(); +} + +//删除所查询的内容 +if($delete) +{ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//endif($delete) + +//跳转到指定页面 +if($go) +{ + $initial_record = $number_records_to_display * ( $gotopage - 1 ); + if($initial_record >= $number_of_records || $initial_record < 0) + { + echo ""; + $initial_record = 0; + } +}//endif($go) + +// 初始化变量 +if (!$number_of_records) +{ + //跳转页面不进行初始化 + //-------确定日期范围----- + if($sel_date<0){ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + }elseif($sel_date>0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + //where语句的类型限制组成部分$w0 + $w0=" key_type<10 "; + + //where语句的时间限制组成部分$w1 + $w1=" AND $time_column >= '$bgn_date' AND $time_column <= '$end_date'"; + + //where语句的系统id限制组成部分$w2 + if($sys_num!='-1' && $sys_num!=''){ + $w2=" AND $sysIdFiled=$sys_num"; + } + + //where语句的子系统id限制组成部分$w3 + if($subsys_num!='-1' && $subsys_num!=''){ + $w3=" AND $subsysIdFiled=$subsys_num"; + } + + //where语句的E1id限制组成部分$w4 + if($e1_num!='-1' && $e1_num!='' && $query_type<5 && $query_type>0){ + $w4=" AND key_e1_tg=$e1_num"; + } + + //where语句的呼叫类型限制组成部分$w5 + if($query_type>0) + { + $w5=" AND key_type=$query_type "; + } + + if($sysType == 'VPS'){ + $w6=" AND key_type=1 "; + }elseif($sysType == 'CNF'){ + $w6=" AND key_type=2 "; + + } + //合成查询语句$where + $where=" WHERE ".$w0.$w1.$w2.$w3.$w4.$w5.$w6; + //echo "$where
      "; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + //echo "
      str_sql_all=$str_sql_all"; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo $strNotFindRecord; + exit(); + } //endif(!$number_of_records) +}//endif(!$number_of_records) + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +//插入日志 +if($page_num <=1) +{ + insertLog("CSTA data query",2,1); +} +//下面是控制分页显示,传递变量 +if ($number_of_records >= 1) +{ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if($prev_index < 0) + { + $prev_index = 0; + } +} +$show_initial_record=$initial_record+1; +?> + + + + + + + + + +" > + + + +
      +  $show_initial_record - $next_index, ($strTotalRecords:$number_of_records )  "; + ?> +   + "; + echo "\"$strPreviousPage\" "; + } + + + // NEW: Display a link for the next set of records. + if ($next_index != $number_of_records && $number_of_records >0 && $number_of_records > $number_records_to_display ) + { + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&sys_id=$sys_id&sysType=$sysType&csta_type=$csta_type&query_type=$query_type"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + echo "\"$strNextPage\""; + } + ?> +
      + +
      + +"; + $csta_result = mysqli_query($pubConn,$csta_sql); + $csta_rows = mysqli_fetch_array($csta_result); + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +  
      E1
      + + + + + +
      + + \ No newline at end of file diff --git a/wxc2_omc/performance/cnfCsta/dataIndex.php b/wxc2_omc/performance/cnfCsta/dataIndex.php new file mode 100755 index 0000000..650e4e1 --- /dev/null +++ b/wxc2_omc/performance/cnfCsta/dataIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/cnfCsta/dataUp.php b/wxc2_omc/performance/cnfCsta/dataUp.php new file mode 100755 index 0000000..4e5fa4c --- /dev/null +++ b/wxc2_omc/performance/cnfCsta/dataUp.php @@ -0,0 +1,146 @@ + + + + + + + + +"; +echo ""; +echo ""; +echo "$strTitlePerformance > $sysType > $strData"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +echo "
      "; + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> +
      + + +"; +echo ""; +if($sysType == 'MSC'){ + echo ""; + echo " "; +} +echo "$strDate:"; +echo ""; +?> + + + + + + +
      +
      + +
      +
      + + + + +
      + +
      + + diff --git a/wxc2_omc/performance/cnfCsta/e1Down.php b/wxc2_omc/performance/cnfCsta/e1Down.php new file mode 100755 index 0000000..dedb0d8 --- /dev/null +++ b/wxc2_omc/performance/cnfCsta/e1Down.php @@ -0,0 +1,231 @@ + + + +$strNotFindRecord."; + exit(); +} + +$sysIdFiled="key_sys_id"; +$subsysIdFiled="key_subsys_id"; + + +//-------确定日期范围----- +if($sel_date<0){ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +}elseif($sel_date>0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } +}else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } +} +//统计时间的总秒数 +if($sel_time){ + $sum_time = ($hou_2*3600+$mid_2*60+$sec_2)-($hou_1*3600+$mid_1*60+$sec_1);//指定时间的总秒数 +}else{ + if($sel_date<0){ + $sum_time = 24*7*3600;//一星期拥有的总时间数 + }elseif($sel_date>0){ + $sum_time=24*3600;//一天拥有的总时间数 + }else{ + $hou=date("H"); + $mid=date("i"); + $sec=date("s"); + $sum_time=$hou*3600+$mid*60+$sec; + } +} + + +//where语句的时间限制组成部分$w1 +$w1=" $time_column >= '$bgn_date' AND $time_column <= '$end_date'"; + +//where语句的系统id限制组成部分$w2 +if($sys_num!='-1' && $sys_num!='') +{ + $w2=" AND $sysIdFiled=$sys_num"; +} + +//where语句的子系统id限制组成部分$w3 +if($subsys_num!='-1' && $subsys_num!='') +{ + $w3=" AND $subsysIdFiled=$subsys_num"; +} + +//where语句的E1id限制组成部分$w4 +if($e1_num!='-1' && $e1_num!='') +{ + $w4=" AND key_e1_tg=$e1_num"; +} + +//where语句的类型限制组成部分$w5 + $w5=" AND key_type=2 "; + + + +$sys_id=$sysType.$sys.$subsys.$e1; +//合成查询语句$where +$where=" WHERE ".$w0.$w1.$w2.$w3.$w4.$w5; +//echo "$where
      "; + +$str_sql_all=" SELECT count(*) as number_of_records FROM $table_name ".$where; +//echo "$str_sql_all
      "; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +if(!$number_of_records) +{ + echo $strNotFindRecord; + exit(); +} + +//insert log +insertLog('table',2,4); + +//合成子系统编号统计的sql语句 +$order_1=" ORDER BY $sysIdFiled,$subsysIdFiled"; +$group_1=" GROUP BY $sysIdFiled,$subsysIdFiled"; + +//合成sql语句 +$csta_sql_1="SELECT $sysIdFiled,$subsysIdFiled, SUM(att),SUM(ans),SUM(caller_clear),SUM(no_ans),SUM(subscriber_busy),SUM(network_busy), +SUM(call_barred),SUM(signaling_timer_expired),SUM(total_holding_time) FROM $table_name".$where.$group_1.$order_1; +//echo "$csta_sql_1
      "; +$result_1=mysqli_query($pubConn,$csta_sql_1); +$rows_1 = mysqli_fetch_array($result_1); +?> +
      + + + + + + +
      + +

        +Date: +

      +
      + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0) + { + $aht_1=round($rows_1[10]*6/$rows_1[3]); + } + else + { + $aht_1=0; + } + ?> + + + +
        +  + +
      + +
      +
      + + \ No newline at end of file diff --git a/wxc2_omc/performance/cnfCsta/e1Index.php b/wxc2_omc/performance/cnfCsta/e1Index.php new file mode 100755 index 0000000..5cb5c51 --- /dev/null +++ b/wxc2_omc/performance/cnfCsta/e1Index.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/cnfCsta/e1Up.php b/wxc2_omc/performance/cnfCsta/e1Up.php new file mode 100755 index 0000000..fca0a39 --- /dev/null +++ b/wxc2_omc/performance/cnfCsta/e1Up.php @@ -0,0 +1,148 @@ + E1"; +}else{ + $headName = $sysType; +} +?> + + + + + + +"; +echo ""; +echo ""; +echo "$strTitlePerformance > $headName"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> +
      + + + + + + + + +
      + +   + + + + +
      + +
      +
        + + + + + + +
      + +
      + + diff --git a/wxc2_omc/performance/detailCsta/csta_field.php b/wxc2_omc/performance/detailCsta/csta_field.php new file mode 100755 index 0000000..d9082c0 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/csta_field.php @@ -0,0 +1,76 @@ + + +"; +$generalConf=parse_ini_file("general.conf",true); +$csvFieldName=GetRowCsv("./fieldConf/{$sysTypeNo}_name.csv"); + +$sql="show fields from {$generalConf[$sysTypeNo][DataTable]} where Field <> 'key_sys_id' and Field <> 'key_subsys_id' and Field <> 'key_type' and Field <> 'key_e1_tg' and Field <> 'csta_datetime' "; +$res=mysqli_query($pubConn,$sql); +$num=mysqli_num_rows($res); + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + unlink("./fieldConf/{$sysTypeNo}_flag.csv"); + $content=""; + for($i=0;$i<$num;$i++) + { + $param="field_$i"; + $value=$$param; + //echo "$i={$value}
      "; + if(strcasecmp($value,"on")) + $content.="0"; + else + $content.="1"; + if($i != ($num-1)) + $content.=","; + } + $content.="\n"; + file_put_contents("./fieldConf/{$sysTypeNo}_flag.csv",$content); + + echo "\n"; +} + +echo "{$generalConf[$sysTypeNo][PageTitle]}

      "; +echo "Please select the fields to browse
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +$csvData=GetRowCsv("./fieldConf/{$sysTypeNo}_flag.csv"); +if(0) +{ + echo "
      ";
      +	print_r($csvData);
      +	echo "
      "; +} + +for($i=0;$i<$num;$i++) +{ + $row=@mysqli_fetch_array($res); + echo ""; + echo ""; + echo ""; + echo ""; +} + +echo "
      NameFlag
      {$csvFieldName[$i]}"; + if($csvData[$i] != 0) + echo ""; + else + echo ""; + echo "
      "; + +echo "
      "; +echo ""; +echo ""; + +echo ""; +?> diff --git a/wxc2_omc/performance/detailCsta/detail_csta_down.php b/wxc2_omc/performance/detailCsta/detail_csta_down.php new file mode 100755 index 0000000..4329e6e --- /dev/null +++ b/wxc2_omc/performance/detailCsta/detail_csta_down.php @@ -0,0 +1,309 @@ + 0){ + echo ""; +}else{ + echo ""; +} +?> + + +
      +"; + echo "sel_date_from=$sel_date_from
      "; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; + echo "page_id=$page_id
      "; +} + +$generalConf=parse_ini_file("general.conf",true); +$cstaConf=GetCstaConf($sysTypeNo); +if(0) +{ + echo "sysTypeNo=$sysTypeNo
      "; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + + +$sql="show fields from {$generalConf[$sysTypeNo][DataTable]} where Field <> 'key_sys_id' and Field <> 'key_subsys_id' and Field <> 'key_type' and Field <> 'key_e1_tg' and Field <> 'csta_datetime' "; +$res=mysqli_query($cstaDbConn,$sql); +$num=mysqli_num_rows($res); +$fieldnum=$num; +if(0) +{ + echo "sql:$sql
      "; + echo "num:$num
      "; +} +for($i=0;$i<$fieldnum;$i++) +{ + $row=@mysqli_fetch_array($res); + $csta_fields[]=$row[Field]; +} +$cstafieldstr=implode(",",$csta_fields); +$csvData=GetRowCsv("./fieldConf/{$sysTypeNo}_flag.csv"); +$csvFieldName=GetRowCsv("./fieldConf/{$sysTypeNo}_name.csv"); +if(0) +{ + echo "cstafieldstr=$cstafieldstr
      "; + echo "
      ";
      +	print_r($csta_fields);
      +	print_r($csvFieldName);
      +	echo "
      "; +} + + + +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_from,date("Y"))); +//echo "sel_date_from=$sel_date_from,startTime=$startTime,endTime=$endTime
      "; + +//echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +$condition=""; +if($keyOne != -1) +{ + $condition.=" and key_type=$keyOne "; +} +if($keyTwo != -1) +{ + $condition.=" and key_e1_tg=$keyTwo "; +} +// echo "
      ";
      +// echo print_r($generalConf);
      +// echo "
      "; + +$start_record=$generalConf[MaxRow]*$page_id; +$end_record=$generalConf[MaxRow]*($page_id+1); + +$sql="select * from {$generalConf[$sysTypeNo][DataTable]} where csta_datetime>='$startTime' and csta_datetime <= '$endTime' $condition order by csta_datetime desc "; +//echo "$sql
      "; +$res=mysqli_query($cstaDbConn,$sql); +$num=mysqli_num_rows($res); +echo mysqli_error($cstaDbConn); +$totalrecordnum=$num; +if(0) +{ + echo "sql2:$sql
      "; + echo "num2:$num
      "; +} + +$sql="select * from {$generalConf[$sysTypeNo][DataTable]} where csta_datetime>='$startTime' and csta_datetime <= '$endTime' $condition order by csta_datetime desc LIMIT $start_record, {$generalConf[MaxRow]} "; +//echo "$sql
      "; +$res=mysqli_query($cstaDbConn,$sql); +$num=mysqli_num_rows($res); +$recordnum=$num; +$pagenum=ceil($totalrecordnum/$generalConf[MaxRow]); +if(0) +{ + echo "recordnum=$recordnum,max={$generalConf[MaxRow]},pagenum=$pagenum
      "; +} + +$start_recordstr=$start_record++; +if($start_recordstr >= $totalrecordnum) + $start_recordstr=$totalrecordnum; +else + $start_recordstr=$start_record; + +if($end_record > $totalrecordnum) + $end_recordstr=$totalrecordnum; +else + $end_recordstr=$end_record; + +$prev_page_id=$page_id-1; +$next_page_id=$page_id+1; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "Record: $start_recordstr - $end_recordstr, Total: $totalrecordnum"; +echo ""; +if($page_id > 0) +{ + echo ""; + echo "Previous$strNextPage"; +} +else +{ + echo "Previous$strNextPage"; +} +echo ""; +if($page_id < ($pagenum-1)) +{ + echo ""; + echo "$strNextPageNext"; +} +else +{ + echo "$strNextPageNext"; +} +echo "
      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +for($i=0;$i<$fieldnum;$i++) +{ + //{$csta_fields[$i]} + if($csvData[$i] != 0) + echo ""; +} +echo ""; +echo ""; + +if($recordnum == 0) +{ + echo ""; + echo ""; + echo ""; + echo ""; + for($j=0;$j<$fieldnum;$j++) + { + if($csvData[$j] != 0) + echo ""; + } + echo ""; + echo ""; +} + + +for($i=0;$i<$cstaConf[DataObjectCount];$i++) +{ + $doConf=$cstaConf[DataObject][$i]; + for($keyIndex=$doConf[KeyOneStart];$keyIndex<=$doConf[KeyOneEnd];$keyIndex++) + { + $keyCountConf[$keyIndex]=$doConf[KeyFieldCount]; + } +} +if(0) +{ + echo "
      ";
      +	print_r($keyCountConf);
      +	echo "
      "; +} + +for($i=0;$i<$recordnum;$i++) +{ + $row=@mysqli_fetch_array($res); + echo ""; + $system_id="{$generalConf[$sysTypeNo][Module]}_".($row[key_sys_id]+0); + echo ""; + + $typestr=$generalConf[KeyOneName][$sysTypeNo][$row[key_type]]; + if($keyCountConf[$row[key_type]] > 0) + echo ""; + else + echo ""; + + if($keyCountConf[$row[key_type]] == 2) + echo ""; + else + echo ""; + + for($j=0;$j<$fieldnum;$j++) + { + if($csvData[$j] != 0) + echo ""; + } + + echo ""; + echo ""; +} + +echo "
      SystemTypeTG{$csvFieldName[$i]}Time
      ----------
      $system_id$typestr--{$row[key_e1_tg]}--{$row[$csta_fields[$j]]}{$row[csta_datetime]}
      "; +if($recordnum >= 25) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Record: $start_recordstr - $end_recordstr, Total: $totalrecordnum"; + echo ""; + if($page_id > 0) + { + echo ""; + echo "Previous$strNextPage"; + } + else + { + echo "Previous$strNextPage"; + } + echo ""; + if($page_id < ($pagenum-1)) + { + echo ""; + echo "$strNextPageNext"; + } + else + { + echo "$strNextPageNext"; + } + echo "
      "; +} +adjust_content_tail("down"); +echo "
      "; +?> diff --git a/wxc2_omc/performance/detailCsta/detail_csta_index.php b/wxc2_omc/performance/detailCsta/detail_csta_index.php new file mode 100755 index 0000000..29de65a --- /dev/null +++ b/wxc2_omc/performance/detailCsta/detail_csta_index.php @@ -0,0 +1,8 @@ + + "; + echo ""; + ?> + \ No newline at end of file diff --git a/wxc2_omc/performance/detailCsta/detail_csta_up.php b/wxc2_omc/performance/detailCsta/detail_csta_up.php new file mode 100755 index 0000000..f54d80e --- /dev/null +++ b/wxc2_omc/performance/detailCsta/detail_csta_up.php @@ -0,0 +1,178 @@ + + + + + + +
      + +"; + print_r($generalConf); + echo ""; +} + adjust_head_frame("up"); + adjust_title_head_frame("up"); + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "{$generalConf[$sysTypeNo][PageTitle]}"; + echo ""; + if(isset($generalConf[HelpID][$sysTypeNo][$page_id])) + showHelp($generalConf[HelpID][$sysTypeNo][$page_id]); + echo "
      "; + + //select day + for($i=0;$i<$generalConf[MaxDay];$i++) + { + $startDay[]=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + } + echo "Date  "; + + + //KeyOne selection + if(!isset($keyOne)) + $keyOne=-1; + $keyonenum=sizeof($generalConf[KeyOneName][$sysTypeNo]); + echo "Type  "; + + //KeyTwo selection + if(!isset($keyTwo)) + $keyTwo=-1; + $hideFlag=0; + if($keyOne == -1) + { + $hideFlag=0; + } + else + { + for($i=0;$i<$cstaConf[DataObjectCount];$i++) + { + $doConf=$cstaConf[DataObject][$i]; + if($keyOne >= $doConf[KeyOneStart] && $keyOne <= $doConf[KeyOneEnd]) + break; + } + } + if($i == $cstaConf[DataObjectCount]) + $hideFlag=1; + else + { + if($doConf[KeyFieldCount] == 2) + $hideFlag=0; + else + $hideFlag=1; + } + + echo ""; + echo "TG  "; + echo ""; + + if($hideFlag == 1) + echo ""; + + //search button + echo ""; + echo "$strSearch"; + echo ""; + + echo ""; + + //Config the field + echo ""; + echo ""; + echo "    "; + + ?> + + + + +"; + echo "
      "; + + echo ""; + + echo "
      "; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +echo ""; +?> diff --git a/wxc2_omc/performance/detailCsta/fieldConf/311_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/311_flag.csv new file mode 100755 index 0000000..d981249 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/311_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/311_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/311_name.csv new file mode 100755 index 0000000..0411e5c --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/311_name.csv @@ -0,0 +1 @@ +PPS service attempt,PPS service success,MSC service attempt,MSC service success,Invalid call diff --git a/wxc2_omc/performance/detailCsta/fieldConf/320_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/320_flag.csv new file mode 100755 index 0000000..e008c4d --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/320_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1,0,0,0,0,0 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/320_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/320_name.csv new file mode 100755 index 0000000..ee7de22 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/320_name.csv @@ -0,0 +1 @@ +Attempt,Success,Duration,Normal,Call Deny,Net Busy,Caller Clear,Sub Busy,No Answer,Signal Error diff --git a/wxc2_omc/performance/detailCsta/fieldConf/325_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/325_flag.csv new file mode 100755 index 0000000..d638d71 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/325_flag.csv @@ -0,0 +1 @@ +0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,0,0,0,1,1 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/325_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/325_name.csv new file mode 100755 index 0000000..3dd9147 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/325_name.csv @@ -0,0 +1 @@ +Attempted MS memory available notifications,Successful MS memory available notifications,Attempted Identification requests to PVLRs,Successful Identification requests to PVLRs,Attempted page requests,Successful page requests,Attempted page requests per Location Area,Successful page requests per Location Area,Attempted requests for Authentication sets sent to HLR by VLRs,Successful received Authentication sets from HLR to VLRs,Empty responses to request for Authentication sets from HLR to VLRs,Attempted authentication procedures in VLR,Successful authentication procedures in the VLR,Attempted intra-VLR Location Updates,Successful intra-VLR Location Updates,Attempted inter-VLR Location Updates,Successful inter-VLR Location Updates,Arrivals of Visitors from other PLMNs,Subscribers from other PLMNs registered in the VLR,Number of roamers in the VLR diff --git a/wxc2_omc/performance/detailCsta/fieldConf/330_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/330_flag.csv new file mode 100755 index 0000000..efd591b --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/330_flag.csv @@ -0,0 +1 @@ +0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/330_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/330_name.csv new file mode 100755 index 0000000..628d649 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/330_name.csv @@ -0,0 +1 @@ +Number of current MS's Roaming outside HPLMN,Attempted requests for Authentication sets,Successful returned Authentication sets,Empty responses to request for Authentication sets,Attempted insert subscriber data service,Successful insert subscriber data service,Attempted Location Updates,Successful Location Updates,Attempted SS related operations,Successful SS related operations,Attempted request for SM routing information,Successful request for SM routing information,Attempted SM delivery status report procedures,Successful SM delivery status report procedures,Attempted number of send alerts,Successful number of send alerts,Attempted request for MSRN,Successful request for MSRN,MS Initial USSD Attempt,MS Initial USSD Success,Relay USSD to SCF Attempt,Relay USSD to SCF Success \ No newline at end of file diff --git a/wxc2_omc/performance/detailCsta/fieldConf/340_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/340_flag.csv new file mode 100755 index 0000000..9971aac --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/340_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1,1,0,0,0,0,0,0 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/340_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/340_name.csv new file mode 100755 index 0000000..1ae7f24 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/340_name.csv @@ -0,0 +1 @@ +Triplets require success,HLR create subscriber success,HLR delete subscriber success,AUC create subscriber success,AUC delete subscriber success,Tripletes require fail,HLR create subscriber fail,HLR delete subscriber fail,AUC create subscriber fail,AUC delete subscriber fail,Interrogate subscriber success,Interrogate subscriber fail diff --git a/wxc2_omc/performance/detailCsta/fieldConf/350_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/350_flag.csv new file mode 100755 index 0000000..5aeab16 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/350_flag.csv @@ -0,0 +1 @@ +1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/350_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/350_name.csv new file mode 100755 index 0000000..1ab3643 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/350_name.csv @@ -0,0 +1 @@ +MS to SMSC attempt,MS to SMSC success,MS to SMSC sysfail,MS to SMSC userfail,MS to SMSC smfail,MS to SMSC byte,PPS to SMSC attempt,PPS to SMSC success,PPS to SMSC sysfail,PPS to SMSC userfail,PPS to SMSC smfail,PPS to SMSC byte,VMS to SMSC attempt,VMS to SMSC success,VMS to SMSC sysfail,VMS to SMSC userfail,VMS to SMSC smfail,VMS to SMSC byte,SMPP to SMSC attempt,SMPP to SMSC success,SMPP to SMSC sysfail,SMPP to SMSC userfail,SMPP to SMSC smfail,SMPP to SMSC byte,SMSC to MS attempt,SMSC to MS success,SMSC to MS sysfail,SMSC to MS userfail,SMSC to MS smfail,SMSC to MS byte,SMSC to PPS attempt,SMSC to PPS success,SMSC to PPS sysfail,SMSC to PPS userfail,SMSC to PPS smfail,SMSC to PPS byte,SMSC to VMS attempt,SMSC to VMS success,SMSC to VMS sysfail,SMSC to VMS userfail,SMSC to VMS smfail,SMSC to VMS byte,SMSC to SMPP attempt,SMSC to SMPP success,SMSC to SMPP sysfail,SMSC to SMPP userfail,SMSC to SMPP smfail,SMSC to SMPP byte,SM begin,SM end diff --git a/wxc2_omc/performance/detailCsta/fieldConf/360_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/360_flag.csv new file mode 100755 index 0000000..c5cf6b6 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/360_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/360_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/360_name.csv new file mode 100755 index 0000000..ac66d67 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/360_name.csv @@ -0,0 +1 @@ +Local call,Trunk out,NDD call,HMT call,IDD call,Local called,Call in,Periodic charge,Assisted recharge,Assisted withdraw,Recharge success,Recharge fail,SM,CNF,Third party,Emergency call number,Local calling cost,Trunk out cost,NDD call cost,HMT call cost,IDD call cost,Local called cost,Call in cost,Periodic charge cost,Assisted recharge cost,Assisted withdraw cost,Recharge success cost,Recharge fail cost,SM cost,CNF cost,Third party cost,Emergency call cost,Local calling duration,Trunk out duration,NDD call duration,HMT call duration,IDD call duration,Local called duration,Call in duration,Periodic charge duration,Assisted recharge duration,Assisted withdraw duration,Recharge success duration,Recharge fail duration,SM duration,CNF duration,Third party duration,Emergency call duration,GPRS attempt,GPRS total charged,GPRS duration,GPRS total volumn diff --git a/wxc2_omc/performance/detailCsta/fieldConf/361_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/361_flag.csv new file mode 100755 index 0000000..0d70725 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/361_flag.csv @@ -0,0 +1 @@ +1,1,1,1 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/361_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/361_name.csv new file mode 100755 index 0000000..93c8354 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/361_name.csv @@ -0,0 +1 @@ +num_of_online_enb,num_of_registered_ues,num_of_connected_ues,num_of_idle_ues diff --git a/wxc2_omc/performance/detailCsta/fieldConf/362_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/362_flag.csv new file mode 100755 index 0000000..4533e50 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/362_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/362_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/362_name.csv new file mode 100755 index 0000000..940d3d6 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/362_name.csv @@ -0,0 +1 @@ +attemp_sess_est_num,suc_sess_est_num,actived_user_num,max_actived_user_num,cur_ps_active_user_num,max_cur_ps_active_user_num,cur_ims_active_user_num,max_cur_ims_active_user_num,ps_ip_addr_allocated,ps_ip_addr_free,ims_ip_addr_allocated,ims_ip_addr_free,ps_pagin_num,fail_ps_paging_num,ims_paging_num,fail_ims_paging_num,ps_ccr_update_num,ps_ccr_update_time_interval,uplink_average_pack_num,downlink_average_pack_num,uplink_average_pack_size,downlink_average_pack_size,uplink_data_bit_rate,uplink_data_max_bit_rate,downlink_data_bit_rate,downlink_data_max_bit_rate,gtp_context_num,gtp_active_tunnrl_num,total_up_pktnum,total_down_pktnum diff --git a/wxc2_omc/performance/detailCsta/fieldConf/363_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/363_flag.csv new file mode 100755 index 0000000..f1e4de8 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/363_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1,1 \ No newline at end of file diff --git a/wxc2_omc/performance/detailCsta/fieldConf/363_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/363_name.csv new file mode 100755 index 0000000..44879e6 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/363_name.csv @@ -0,0 +1 @@ +num_of_register_success,num_of_register_failed,num_of_moc_setup,num_of_moc_ring,num_of_mtc_setup,num_of_mtc_ring \ No newline at end of file diff --git a/wxc2_omc/performance/detailCsta/fieldConf/364_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/364_flag.csv new file mode 100755 index 0000000..403f36b --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/364_flag.csv @@ -0,0 +1 @@ +1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/364_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/364_name.csv new file mode 100755 index 0000000..a1576a5 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/364_name.csv @@ -0,0 +1 @@ +numRtpBytesReceivedUplink,numRtpPacketsReceivedUplink,numRtpBytesSentUplink,numRtpPacketsSentUplink,numRtpBytesReceivedDnlink,numRtpPacketsReceivedDnlink,numRtpBytesSentDnlink,numRtpPacketsSentDnlink,numLsCall,numGtpKBytesReceivedUplink,numGtpPacketsReceivedUplink,numGtpKBytesSentUplink,numGtpPacketsSentUplink,numGtpKBytesReceivedDnlink,numGtpPacketsReceivedDnlink,numGtpKBytesSentDnlink,numGtpPacketsSentDnlink,numLuAttempt,numLuSuccess,numDetach,numMoAttempt,numMoSuccess,numMoNoAnswer,numMtAttempt,numMtSuccess,numMtNoAnswer,numEmoAttempt,numEmoSuccess,numEmoNoAnswer,numSmoAttempt,numSmoSuccess,numSmtAttempt,numSmtSuccess,numGprsAttachAttempt,numGprsAttachSuccess,numRauAttempt,numRauSuccess,numPdpActivateAttempt,numPdpActivateSuccess,numPdpDeactivate \ No newline at end of file diff --git a/wxc2_omc/performance/detailCsta/fieldConf/365_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/365_flag.csv new file mode 100755 index 0000000..e008c4d --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/365_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1,0,0,0,0,0 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/365_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/365_name.csv new file mode 100755 index 0000000..a802174 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/365_name.csv @@ -0,0 +1 @@ +n5GAKAAuthAttempt,n5GAKAAuthSuc,nEAPAKAAuthAttempt,nEAPAKAAuthSuc,nAMF3GPPAccessRegAttempt,nAMF3GPPAccessRegSuc,nAMFNON3GPPAccessRegAttempt,nAMFNON3GPPAccessRegSuc,nSMFRegAttempt,nAMFRegSuc diff --git a/wxc2_omc/performance/detailCsta/fieldConf/380_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/380_flag.csv new file mode 100755 index 0000000..e0c5b28 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/380_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1,1,0,0,1,1 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/380_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/380_name.csv new file mode 100755 index 0000000..c39cfc3 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/380_name.csv @@ -0,0 +1 @@ +MSs added to black-list success,MSs added black-list fail,MSs added to gray-list success,MSs added to gray-list fail,MSs deleted from black-list success,MSs deleted from black-list fail,MSs deleted from gray-list success,MSs deleted from gray-list fail,Times of checking IMEI success,Times of checking IMEI fail diff --git a/wxc2_omc/performance/detailCsta/fieldConf/390_flag.csv b/wxc2_omc/performance/detailCsta/fieldConf/390_flag.csv new file mode 100755 index 0000000..459947f --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/390_flag.csv @@ -0,0 +1 @@ +1,1,1,1,1,1,1,1,1 diff --git a/wxc2_omc/performance/detailCsta/fieldConf/390_name.csv b/wxc2_omc/performance/detailCsta/fieldConf/390_name.csv new file mode 100755 index 0000000..15decbf --- /dev/null +++ b/wxc2_omc/performance/detailCsta/fieldConf/390_name.csv @@ -0,0 +1 @@ +Original call attempt,Original call success,Terminal call attempt,Terminal call success,Leave message attempt,Leave message success,Maintain message attempt,Maintain message success,Access to fail diff --git a/wxc2_omc/performance/detailCsta/function.inc b/wxc2_omc/performance/detailCsta/function.inc new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/performance/detailCsta/general.conf b/wxc2_omc/performance/detailCsta/general.conf new file mode 100755 index 0000000..be920c1 --- /dev/null +++ b/wxc2_omc/performance/detailCsta/general.conf @@ -0,0 +1,102 @@ +; The day range to statistic the CSTA +MaxDay=30 +MaxRow=50 + +[320] +PageTitle="Advanced > Performance > MSC" +DataTable="mscSumData" +Module="MSC" + +[330] +PageTitle="Advanced > Performance > HLR" +DataTable="hlrDetailData" +Module="HLR" + +[325] +PageTitle="Advanced > Performance > VLR" +DataTable="vlrDetailData" +Module="VLR" + +[360] +PageTitle="Advanced > Performance > PPS" +DataTable="ppsDetailData" +Module="PPS" + +[361] +PageTitle="Advanced > Performance > MME" +DataTable="mmeDetailData" +Module="MME" + +[362] +PageTitle="Advanced > Performance > SPGW" +DataTable="spgwDetailData" +Module="SPGW" + +[363] +PageTitle="Advanced > Performance > IMS" +DataTable="imsDetailData" +Module="IMS" + +[364] +PageTitle="Advanced > Performance > RCS" +DataTable="rcsDetailData" +Module="RCS" + +[365] +PageTitle="Advanced > Performance > UDM" +DataTable="udmDetailData" +Module="UDM" + +[366] +PageTitle="Advanced > Performance > AUSF" +DataTable="ausfDetailData" +Module="AUSF" + +[350] +PageTitle="Advanced > Performance > SMSC" +DataTable="smscDetailData" +Module="SMSC" + +[340] +PageTitle="Advanced > Performance > AUC" +DataTable="aucDetailData" +Module="AUC" + +[380] +PageTitle="Advanced > Performance > EIR" +DataTable="eirDetailData" +Module="EIR" + +[390] +PageTitle="Advanced > Performance > VSS" +DataTable="vssDetailData" +Module="VSS" + +[311] +PageTitle="Advanced > Performance > AAS" +DataTable="aasDetailData" +Module="AAS" + +[KeyOneName] +320[]="none" +320[]="none" +320[]="none" +320[]="TG Incoming" +320[]="TG Outgoing" +320[]="Subs to Subs" +320[]="Subs to Trunk" +320[]="Trunk to Subs" +320[]="Trunk to Trunk" +320[]="Intraconnection" +320[]="Subs to IP" +320[]="Trunk to IP" +320[]="Mobile Originated" +320[]="Mobile Terminated" +320[]="In Trunk" +320[]="Out Trunk" +320[]="IP Termiginated" + +390[]="none" +390[]="ISUP" +390[]="VMS APP" + diff --git a/wxc2_omc/performance/eirCsta/dataAnalysisDown.php b/wxc2_omc/performance/eirCsta/dataAnalysisDown.php new file mode 100755 index 0000000..de00025 --- /dev/null +++ b/wxc2_omc/performance/eirCsta/dataAnalysisDown.php @@ -0,0 +1,385 @@ + + +"; + +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$db=$csta_db; +$time_column = "csta_datetime"; +$table_name='eirDetail'."_".$showDate; +$title_time=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));//表头显示时间 + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + +//-------确定日期范围----- +if($sel_date<0) +{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} +elseif($sel_date>0) +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } +} +else +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } +} + +/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ +$w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + +//合成where语句 +$where=" WHERE".$w1; +$str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +if(!$number_of_records) +{ + echo "$strNotFindRecord"; + exit(); +} +$sum_sql=" SELECT SUM(mabls),SUM(mablf),SUM(magls),SUM(maglf),SUM(mdbls), SUM(mdblf),SUM(mdgls),SUM(mdglf),SUM(tcis),SUM(tcif) FROM $table_name ".$where; +//echo "
      sum_sql=$sum_sql"; +$sum_res=mysqli_query($pubConn,$sum_sql); +$sum_row=mysqli_fetch_array($sum_res); + +$mabls=$sum_row[0]; +$mablf=$sum_row[1]; + +$total_mabl=$mabls+$mablf; +if($total_mabl>0) +{ + $mabls_point=$mabls/$total_mabl; + $mabls_scale=change_percent($mabls/$total_mabl); + $mablf_point=$mablf/$total_mabl; + $mablf_scale=change_percent($mablf/$total_mabl); +} +else +{ + $mabls_point=0; + $mabls_scale="0%"; + $mablf_point=0; + $mablf_scale="0%"; +} + +$magls=$sum_row[2]; +$maglf=$sum_row[3]; +$total_magl=$magls+$maglf; +if($total_magl>0) +{ + $magls_point=$magls/$total_magl; + $magls_scale=change_percent($magls/$total_magl); + $maglf_point=$maglf/$total_magl; + $maglf_scale=change_percent($maglf/$total_magl); +} +else +{ + $magls_point=0; + $magls_scale="0%"; + $maglf_point=0; + $maglf_scale="0%"; +} + +$mdbls=$sum_row[4]; +$mdblf=$sum_row[5]; +$total_mdbl=$mdbls+$mdblf; +if($total_mdbl>0) +{ + $mdbls_point=$mdbls/$total_mdbl; + $mdbls_scale=change_percent($mdbls/$total_mdbl); + $mdblf_point=$mdblf/$total_mdbl; + $mdblf_scale=change_percent($mdblf/$total_mdbl); +} +else +{ + $mdbls_point=0; + $mdbls_scale="0%"; + $mdblf_point=0; + $mdblf_scale="0%"; +} + +$mdgls=$sum_row[6]; +$mdglf=$sum_row[7]; +$total_mdgl=$mdgls+$mdglf; +if($total_mdgl>0) +{ + $mdgls_point=$mdgls/$total_mdgl; + $mdgls_scale=change_percent($mdgls/$total_mdgl); + $mdglf_point=$mdglf/$total_mdgl; + $mdglf_scale=change_percent($mdglf/$total_mdgl); +} +else +{ + $mdgls_point=0; + $mdgls_scale="0%"; + $mdglf_point=0; + $mdglf_scale="0%"; +} + +$tcis=$sum_row[8]; +$tcif=$sum_row[9]; +$total_tci=$tcis+$tcif; +if($total_tci) +{ + $tcis_point=$tcis/$total_tci; + $tcis_scale=change_percent($tcis/$total_tci); + $tcif_point=$tcif/$total_tci; + $tcif_scale=change_percent($tcif/$total_tci); +} +else +{ + $tcis_point=0; + $tcis_scale="0%"; + $tcif_point=0; + $tcif_scale="0%"; +} + +?> + +
      + + + + + + + + +
      + +

        +Date: +

      +
      + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      1.

      +

      +

      +

      +

      +

      $strMSsAddedBlackList";?>

      +

      +

       

      +

       

      +

      +

       

      +

       

      $strMSsAddedGrayList";?> +

      +

       

      +

       

      +

      +

       

      +

       

      +

      $strMSsDeletedBlackList";?>

      +

       

      +

       

      +

      +

       

      +

       

      +

      $strMSsDeletedGrayList";?>

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      $strTimesCheckingIMEI";?>

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + 2. +
      + + + + + + + + + + + + + + +
            
      +

      + + + + + + + + +
      :
      + + + \ No newline at end of file diff --git a/wxc2_omc/performance/eirCsta/dataAnalysisIndex.php b/wxc2_omc/performance/eirCsta/dataAnalysisIndex.php new file mode 100755 index 0000000..5ac0925 --- /dev/null +++ b/wxc2_omc/performance/eirCsta/dataAnalysisIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/eirCsta/dataAnalysisUp.php b/wxc2_omc/performance/eirCsta/dataAnalysisUp.php new file mode 100755 index 0000000..5ece58c --- /dev/null +++ b/wxc2_omc/performance/eirCsta/dataAnalysisUp.php @@ -0,0 +1,85 @@ + + + + + + +"; + echo ""; + echo ""; + echo "$strAdvanced > $strPerformance > EIR > Statistics"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; +?> + +"; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + +
      + + + diff --git a/wxc2_omc/performance/eirCsta/dataQueryDown.php b/wxc2_omc/performance/eirCsta/dataQueryDown.php new file mode 100755 index 0000000..f0aec8d --- /dev/null +++ b/wxc2_omc/performance/eirCsta/dataQueryDown.php @@ -0,0 +1,257 @@ + + + +"; + + $sort_field = 'csta_datetime'; //排序所依赖的字段名 + $sort_direction = 'DESC'; //排序顺序 + $number_records_to_display = 200; //每页纪录数 + $time_column = "csta_datetime"; + $table_name='eirDetail'."_".$showDate; + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + + $where = isset($where) ? urldecode($where) : ''; //传回变量后解url码 + $where = isset($where) ? stripslashes($where) : ''; //解除一些'/' +//删除所查询的内容 +if($delete){ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//end of delete +?> + +0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + /* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ + $w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + + //合成where语句 + $where=" WHERE".$w1; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo $strNotFindRecord; + exit(); + } + +}//endif + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +if ($number_of_records >= 1){ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0){ + $prev_index = 0; + } +} +$show_initital_record=$initial_record+1; +?> + + + + +" +> + + +
       $show_initital_record - $next_index, ($strTotalRecords:$number_of_records )   "; ?>  +"; +//下面是控制分页显示,传递变量 +if ($initial_record != 0) +{ + $t1 = "initial_record=$prev_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 前一页  + 0 && $number_of_records > $number_records_to_display ) +{ + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 下一页 + +
      + +
      +"; +$csta_result = mysqli_query($pubConn,$csta_sql); +$csta_rows = mysqli_fetch_array($csta_result); +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/eirCsta/dataQueryIndex.php b/wxc2_omc/performance/eirCsta/dataQueryIndex.php new file mode 100755 index 0000000..1190c33 --- /dev/null +++ b/wxc2_omc/performance/eirCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/eirCsta/dataQueryUp.php b/wxc2_omc/performance/eirCsta/dataQueryUp.php new file mode 100755 index 0000000..a15c480 --- /dev/null +++ b/wxc2_omc/performance/eirCsta/dataQueryUp.php @@ -0,0 +1,85 @@ + + + + + + +"; + echo ""; + echo ""; + echo "$strAdvanced > $strPerformance > EIR > Data"; + echo ""; + echo ""; +// showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; +?> + +"; + echo ""; + + echo ""; + echo ""; + echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + + + diff --git a/wxc2_omc/performance/erlangCsta.tgz b/wxc2_omc/performance/erlangCsta.tgz new file mode 100755 index 0000000..506edaa Binary files /dev/null and b/wxc2_omc/performance/erlangCsta.tgz differ diff --git a/wxc2_omc/performance/erlangCsta/1288327346.png b/wxc2_omc/performance/erlangCsta/1288327346.png new file mode 100755 index 0000000..d5ff9f0 Binary files /dev/null and b/wxc2_omc/performance/erlangCsta/1288327346.png differ diff --git a/wxc2_omc/performance/erlangCsta/erlang.php b/wxc2_omc/performance/erlangCsta/erlang.php new file mode 100755 index 0000000..f086ec0 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/erlang.php @@ -0,0 +1,404 @@ + + + + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Performance > MSC > Erlang"; + echo ""; + $helpId="1.2.2"; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + //echo "$strClear"; + echo ""; + echo ""; + echo ""; + echo "
      "; +echo ""; + +adjust_title_tail(); + +adjust_content_head(); +echo ""; + +/////////////////\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ + +echo ""; + +echo "
      "; +echo "Customize the condition for Erlang
      "; + +echo ""; +echo ""; + +echo ""; +///// +echo ""; + +echo ""; + +///// +echo ""; + +echo ""; + + + for($i=0;$i<30;$i++) + { + $startDay[$i]=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + } + + echo ""; + + echo ""; + +///////////////////////// + + echo ""; + + echo ""; + + +echo ""; + +/////////////////////////////// + +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; + + +echo ""; + echo ""; +echo ""; + + +echo "
      "; +echo "Type"; +echo ""; +echo ""; +echo ""; +echo "Direction"; +echo ""; +echo ""; +echo ""; +echo "Interval"; +echo ""; +echo ""; +echo ""; + echo "Start time"; + echo ""; + echo ""; + echo ""; + echo "End time"; + echo ""; + echo ""; + echo ""; +echo "Merge"; + +echo ""; + +echo ""; +echo ""; +echo "
      "; +echo ""; +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; +echo ""; + + + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; +echo ""; + +echo "
      "; +echo ""; +echo ""; +echo "SUB SUB"; +echo ""; +echo ""; +echo ""; +echo "SUB TRK"; +echo ""; +echo ""; +echo ""; +echo "TRK SUB"; +echo ""; +echo ""; +echo ""; +echo "TRK IP"; +echo "
      "; +echo ""; +echo ""; +echo "TRK TRK"; +echo ""; +echo ""; +echo ""; +echo "INTRA"; +echo ""; +echo ""; +echo ""; +echo "SUB IP"; +echo ""; +echo ""; +echo ""; +echo "IP"; +echo "
      "; +echo ""; +echo ""; +echo "MO"; +echo ""; +echo ""; +echo ""; +echo "MT"; +echo ""; +echo ""; +echo ""; +echo "IN TRK"; +echo ""; +echo ""; +echo ""; +echo "OUT TRK"; +echo "
      "; +echo "
      "; + echo ""; + + +for($i=0;$i<32;$i++) +{ + echo ""; + for($j=0;$j<8;$j++) + { + echo ""; + } + echo ""; +} + +echo "
      "; + $value="tg".($i*8+$j); + echo ""; + echo "TG ".($i*8+$j); + echo "
      "; +echo "
      "; +echo ""; + +adjust_content_tail(); +?> + diff --git a/wxc2_omc/performance/erlangCsta/erlang_day.php b/wxc2_omc/performance/erlangCsta/erlang_day.php new file mode 100755 index 0000000..8963f52 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/erlang_day.php @@ -0,0 +1,459 @@ + + + +"; + //echo "filelist[$j][type]={$filelist[$j][type]}
      "; + //echo "startTime={$startTime}
      "; + //echo "endTime={$endTime}"; + + $sql="select Duration,csta_datetime FROM CSTA_DB.mscDetailData where key_type={$filelist[$j][type]} and (csta_datetime >='{$startTime}' and csta_datetime <='{$endTime}')"; + + //echo "
      sql=$sql
      "; + + $res=@mysqli_query($pubConn,$sql); + + + if(!($res)) + { + $num=0; + } + else + { + $num=mysqli_num_rows($res); + //echo "num=$num
      "; + } + + + for($i=0;$i<$num;$i++) + { + $row=mysqli_fetch_array($res); + + //echo "::: $row
      "; + $start=strtotime($startTime); + + //echo "startTime=$startTime start=$start
      "; + $rowt=strtotime($row[1]); + + //echo "rowt=$rowt row[1]={$row[1]}
      "; + $dif=$rowt-$start; + + //echo "
      dif=$dif
      "; + + $instance=floor($dif/(60*60*24)); + + //echo "instance={$instance}"; + + //echo "
      row[0]={$row[0]}
      "; + + $data[$j][$instance] += $row[0]+0; + + //echo "
      data[$j][$instance]={$data[$j][$instance]}
      "; + } + + } + +} + return $data; + } +?> + + + + +1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + echo ""; + + echo ""; + echo ""; + + if($num !=0) + { + if($merge==1) + { + $num+=1; + } + } + + if($num==0) + { + if($merge==1) + { + $num=1; + } + } + + echo ""; + echo ""; + + echo ""; + echo ""; + + for($j=1;$j < 13;$j++) + { + //echo "filelist[$j][name]={$filelist[$j][name]}
      "; + + if(strcmp($filelist[$j][name]," ")) + { + //echo "55555555555555555555555555555555555
      "; + echo ""; + } + } + + + if($num1==0) + { + echo ""; + } + else if($num==1) + { + if($merge!=0) + { + echo ""; + } + } + else if($merge==1) + { + echo ""; + } + + + for($i=$sel_date_to,$k=($slot-1);$i <=($sel_date_to+($slot-1));$i++,$k--) + { + echo ""; + + $now=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + + echo ""; + + for($j=1;$j<13;$j++) + { + if(strcmp($filelist[$j][name]," ")) + { + echo ""; + $total+=$data1[$j][$k]; + } + } + + if($num==1) + { + if($merge==1) + { + echo ""; + } + + } + else + { + if($merge==1) + { + echo ""; + $total=0; + } + } + + if($num1==0) + { + if($merge==0) + { + echo ""; + } + } + + + echo ""; + } + +echo "
       Erlang
      Time{$filelist[$j][name]}----total
      {$now}{$data1[$j][$k]}--$total--
      "; +} + + + //时间间隔 + $day=$sel_date_from-$sel_date_to+1; + $day_num=720/($day+1); + + + +//画图 + +// + +//=======================================================================================| +//=========== Draw the Graphics =============| +//=======================================================================================| + + $sizex=800; + if($csta_type==0) + $sizey=430; + else + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + + + //===background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + + + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + + $unitXPix=30; + + + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + + //===draw the label block==== + $color[1]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[2]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[4]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[5]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[6]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[7]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[8]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[9]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[10]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[11]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[12]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + for($k=1;$k < 13;$k++) + { + if(strcmp($filelist[$k][name]," ")) + { + for($i=0,$j=($slot-1);$i<($slot);$i++,$j--) + { + $out_put[$k][$i][x]=(780-$i*($day_num)-$day_num); + $out_put[$k][$i][y]=(275-$data1[$k][$j]*25); + } + } + } + + for($i=$sel_date_to,$k=0;$i<($sel_date_from+1);$i++,$k++) + { + $datestr[$k]=date("m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + } + +//////纵轴 + for($i=0;$i<$day;$i++) + { + + $style = array($black_color, $black_color, $black_color, $black_color, $red, $w, $w, $w, $w, $w); + imagesetstyle($im, $style); + imageline($im, ($xEnd - $i*($day_num)-$day_num), $yBgn, ($xEnd - $i*($day_num)-$day_num), $yEnd, IMG_COLOR_STYLED); + + $xstr=$datestr[$i]; + Imagestringup($im, 2, ($xEnd - $i*($day_num)-$day_num) - 4, $yEnd+60, $xstr, $style); + + //if($i==29) + //Imagestringup($im, 2, $xBgn + $i*24 - 4, $yEnd+60, $datestr[29], $style); + } + + //横轴 + for($i=0,$k=10;$i<10;$i++,$k--) + { + $displayMaxData=$k; + imagesetstyle($im, $style); + + //imageline($im,$xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, IMG_COLOR_STYLED); + if($i!=0) + imageline($im,$xBgn , $yBgn+$i*25, $xEnd, $yBgn+$i*25, IMG_COLOR_STYLED); + + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $black_color); + } + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "0", $black_color); + /////////////////////////////////////////////////////////////////////// + + + //画线 + + for($k=1;$k < 13;$k++) + { + if(strcmp($filelist[$k][name]," ")) + { + for($i=0;$i<($slot);$i++) + { + if($i > 0) + { + imageline($im,$out_put[$k][$i-1][x],$out_put[$k][$i-1][y],$out_put[$k][$i][x],$out_put[$k][$i][y],$color[$k]); + } + } + } + } + + + + + + //====graphics title===== + //$graphics_title="Service erlang statistic graphic"; + //Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //===draw the label block==== + $color[1]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[2]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[4]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[5]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[6]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[7]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[8]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[9]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[10]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[11]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[12]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + imagefilledrectangle($im,90,350,100,360,$color[1]); + imagestring($im,2,105,350,"SUB SUB",$text_color); + + imagefilledrectangle($im,260,350,270,360,$color[2]); + imagestring($im,2,275,350,"SUB TRK",$text_color); + + imagefilledrectangle($im,430,350,440,360,$color[3]); + imagestring($im,2,445,350,"TRK SUB",$text_color); + + imagefilledrectangle($im,600,350,610,360,$color[5]); + imagestring($im,2,615,350,"TRK TRK",$text_color); + + imagefilledrectangle($im,90,370,100,380,$color[6]); + imagestring($im,2,105,370,"INTRA",$text_color); + + imagefilledrectangle($im,260,370,270,380,$color[7]); + imagestring($im,2,275,370,"SUB IP",$text_color); + + imagefilledrectangle($im,430,370,440,380,$color[4]); + imagestring($im,2,445,370,"TRK IP",$text_color); + + imagefilledrectangle($im,600,370,610,380,$color[9]); + imagestring($im,2,615,370,"MO",$text_color); + + imagefilledrectangle($im,90,390,100,400,$color[10]); + imagestring($im,2,105,390,"MT",$text_color); + + imagefilledrectangle($im,260,390,270,400,$color[11]); + imagestring($im,2,275,390,"IN TRK",$text_color); + + imagefilledrectangle($im,430,390,440,400,$color[12]); + imagestring($im,2,445,390,"OUT TRK",$text_color); + + imagefilledrectangle($im,600,390,610,400,$color[8]); + imagestring($im,2,615,390,"IP",$text_color); + + +////////////////////////////////////////////////////// +//////////////////////////////////////////////////////// + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)) + { + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + + $tt=time()-4000; + $filename=$tt.".png"; + + if(1) + { + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + flush(); + echo ""; + echo ""; + + adjust_content_tail(); +?> + + \ No newline at end of file diff --git a/wxc2_omc/performance/erlangCsta/erlang_hour.php b/wxc2_omc/performance/erlangCsta/erlang_hour.php new file mode 100755 index 0000000..aa64ef3 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/erlang_hour.php @@ -0,0 +1,382 @@ + +='{$startTime}' and csta_datetime <='{$endTime}'"; + $res=mysql_query($sql,$link); + + if(!($res)) + { + $num=0; + } + else + { + $num=mysqli_num_rows($res); + } + + $data[$j][count]=$num; + + + for($i=0;$i<$num;$i++) + { + $row=mysqli_fetch_array($res); + + $data[$j][time]=$row[1]; + + $start=strtotime($startTime); + $rowt=strtotime($row[1]); + $dif=$rowt-$start; + $instance=floor($dif/(60*60)); + + $data[$j][$instance] += $row[0]+0; + } + } + } + return $data; +} + +$data1=Getdata($filelist,$startTime,$endTime); + +//table + + + $table_title="Server Erlang Statistic  Date:"; + + if($slot>1) + { + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + } + else + { + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + } + + echo "
      $table_title
      "; + echo "
      "; + echo ""; + for($j=1;$j<13;$j++) + { + if(strcmp($filelist[$j][name]," ")) + { + //echo "
      "; + echo ""; + + for($i=0,$k=($slot-1);$i <=($slot-1);$i++,$k--) + { + $now=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + } + //echo "
      {$filelist[$j][name]} Erlang(hour)
      {$now}000102030405060708091011
      {$data1[$j][0+(24*$k)]}{$data1[$j][1+(24*$k)]}{$data1[$j][2+(24*$k)]}{$data1[$j][3+(24*$k)]}{$data1[$j][4+(24*$k)]}{$data1[$j][5+(24*$k)]}{$data1[$j][6+(24*$k)]}{$data1[$j][7+(24*$k)]}{$data1[$j][8+(24*$k)]}{$data1[$j][9+(24*$k)]}{$data1[$j][10+(24*$k)]}{$data1[$j][11+(24*$k)]}
      121314151617181920212223
      {$data1[$j][12+(24*$k)]}{$data1[$j][13+(24*$k)]}{$data1[$j][14+(24*$k)]}{$data1[$j][15+(24*$k)]}{$data1[$j][16+(24*$k)]}{$data1[$j][17+(24*$k)]}{$data1[$j][18+(24*$k)]}{$data1[$j][19+(24*$k)]}{$data1[$j][20+(24*$k)]}{$data1[$j][21+(24*$k)]}{$data1[$j][22+(24*$k)]}{$data1[$j][23+(24*$k)]}
      "; + } + } + echo ""; + + +//时间间隔 + $day=$sel_date_from-$sel_date_to+1; + $day_num=30; + + +//画图 + +// + +//=======================================================================================| +//=========== Draw the Graphics =============| +//=======================================================================================| + + $sizex=800; + if($csta_type==0) + $sizey=430; + else + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + + + //===background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + + + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + + $unitXPix=30; + + + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + + //===draw the label block==== + $color[1]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[2]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[4]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[5]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[6]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[7]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[8]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[9]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[10]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[11]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[11]=ImageColorAllocate($im,0xEE,0x00,0xff); + +///////////////////////表示 X,Y轴坐标 + + + for($k=1;$k < 13;$k++) + { + if(strcmp($filelist[$k][name]," ")) + { + for($i=0;$i<($slot)*24;$i++) + { + + $out_put[$k][$i][x]=(60+$i*(30/$slot)); + $out_put[$k][$i][y]=(275-$data1[$k][$i]*25); + } + } + } + + + for($i=$sel_date_to,$k=0;$i<($sel_date_from+1);$i++,$k++) + { + $datestr[$k]=date("m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + } + +//////纵轴 + for($i=0;$i<23;$i++) + { + + $style = array($black_color, $black_color, $black_color, $black_color, $red, $w, $w, $w, $w, $w); + imagesetstyle($im, $style); + imageline($im, ($xEnd - $i*($day_num)-$day_num), $yBgn, ($xEnd - $i*($day_num)-$day_num), $yEnd, IMG_COLOR_STYLED); + + //$xstr=$datestr[$i]; + //Imagestringup($im, 2, ($xEnd - $i*($day_num)-$day_num) - 4, $yEnd+60, $xstr, $style); + + //if($i==29) + //Imagestringup($im, 2, $xBgn + $i*24 - 4, $yEnd+60, $datestr[29], $style); + } + +////纵轴标记 + for($i=0;$i<$slot*24;$i++) + { + + if(($i%$slot) == 0) + { + $hour_day=$i/24; + + $hour_time=$i/$slot; + + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-($slot-$hour_day-1),date("Y"))); + + $hour_hour=$i%24; + + if($hour_hour<10) + { + $timearray[$i]="0".$hour_hour."h"; + } + else + { + $timearray[$i]=$hour_hour."h"; + } + + $xstr=$datestr[$i]." ".$timearray[$i]; + Imagestringup($im, 2, $xBgn + $hour_time*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + + //横轴 + for($i=0,$k=10;$i<10;$i++,$k--) + { + $displayMaxData=$k; + imagesetstyle($im, $style); + + //imageline($im,$xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, IMG_COLOR_STYLED); + if($i!=0) + imageline($im,$xBgn , $yBgn+$i*25, $xEnd, $yBgn+$i*25, IMG_COLOR_STYLED); + + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $black_color); + } + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "0", $black_color); + /////////////////////////////////////////////////////////////////////// + + + //画线 + + for($k=1;$k < 13;$k++) + { + if(strcmp($filelist[$k][name]," ")) + { + for($i=0;$i<$slot*24;$i++) + { + + if($i > 0) + { + imageline($im,$out_put[$k][$i-1][x],$out_put[$k][$i-1][y],$out_put[$k][$i][x],$out_put[$k][$i][y],$color[$k]); + } + } + } + } + + + //====graphics title===== + //$graphics_title="Service erlang statistic graphic"; + //Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //===draw the label block==== + $color[1]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[2]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[4]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[5]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[6]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[7]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[8]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[9]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[10]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[11]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[12]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + imagefilledrectangle($im,90,350,100,360,$color[1]); + imagestring($im,2,105,350,"SUB SUB",$text_color); + + imagefilledrectangle($im,260,350,270,360,$color[2]); + imagestring($im,2,275,350,"SUB TRK",$text_color); + + imagefilledrectangle($im,430,350,440,360,$color[3]); + imagestring($im,2,445,350,"TRK SUB",$text_color); + + imagefilledrectangle($im,600,350,610,360,$color[5]); + imagestring($im,2,615,350,"TRK TRK",$text_color); + + imagefilledrectangle($im,90,370,100,380,$color[6]); + imagestring($im,2,105,370,"INTRA",$text_color); + + imagefilledrectangle($im,260,370,270,380,$color[7]); + imagestring($im,2,275,370,"SUB IP",$text_color); + + imagefilledrectangle($im,430,370,440,380,$color[4]); + imagestring($im,2,445,370,"TRK IP",$text_color); + + imagefilledrectangle($im,600,370,610,380,$color[9]); + imagestring($im,2,615,370,"MO",$text_color); + + imagefilledrectangle($im,90,390,100,400,$color[10]); + imagestring($im,2,105,390,"MT",$text_color); + + imagefilledrectangle($im,260,390,270,400,$color[11]); + imagestring($im,2,275,390,"IN TRK",$text_color); + + imagefilledrectangle($im,430,390,440,400,$color[12]); + imagestring($im,2,445,390,"OUT TRK",$text_color); + + imagefilledrectangle($im,600,390,610,400,$color[8]); + imagestring($im,2,615,390,"IP",$text_color); + + + + + +////////////////////////////////////////////////////// +//////////////////////////////////////////////////////// + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)) + { + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + + $tt=time()-4000; + $filename=$tt.".png"; + + if(1) + { + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + flush(); + echo ""; + echo ""; + + adjust_content_tail(); + +?> diff --git a/wxc2_omc/performance/erlangCsta/erlang_trunk_day.php b/wxc2_omc/performance/erlangCsta/erlang_trunk_day.php new file mode 100755 index 0000000..79065bf --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/erlang_trunk_day.php @@ -0,0 +1,442 @@ + + +"; + + if($select_3 == 5) + { + $sql="select Duration csta_datetime FROM CSTA_DB.mscDetailData where key_type=3 and key_e1_tg={$tg[$j][type]} csta_datetime >='{$startTime}' and csta_datetime <='{$endTime}'"; + } + else if($select_3 == 6) + { + $sql="select Duration csta_datetime FROM CSTA_DB.mscDetailData where key_type=4 and key_e1_tg={$tg[$j][type]} csta_datetime >='{$startTime}' and csta_datetime <='{$endTime}'"; + } + else if($select_3 == 7) + { + $sql="select Duration csta_datetime FROM CSTA_DB.mscDetailData where key_e1_tg={$tg[$j][type]} (key_type=4 or key_type=3) (csta_datetime >='{$startTime}' and csta_datetime <='{$endTime}')"; + } + + + $res=mysql_query($sql,$link); + + if(!($res)) + { + $num=0; + } + else + { + $num=mysqli_num_rows($res); + } + + + for($i=0;$i<$num;$i++) + { + $row=mysqli_fetch_array($res); + + $start=strtotime($startTime); + $rowt=strtotime($row[1]); + + $dif=$rowt-$start; + + $instance=floor($dif/(60*60*24)); + + $data[$j][$instance] += $row[0]+0; + + } + + } + +} + return $data; + } +?> + + + + +1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + echo ""; + + echo ""; + echo ""; + if($num !=0) + { + if($merge==1) + { + $num+=1; + } + } + + if($num==1) + { + if($merge==0) + { + $num=1; + } + } + + echo ""; + echo ""; + + echo ""; + echo ""; + + for($j=0;$j < 256;$j++) + { + if(strcmp($tg[$j][name]," ")) + { + echo ""; + } + } + + if($num==0) + { + echo ""; + } + else if($num==1) + { + if($merge!=0) + { + echo ""; + } + } + else if($merge==1) + { + echo ""; + } + + + for($i=$sel_date_to,$k=$slot;$i <=($sel_date_to+($slot-1));$i++,$k--) + { + echo ""; + + $now=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + + echo ""; + + for($j=0;$j<256;$j++) + { + if(strcmp($tg[$j][name]," ")) + { + echo ""; + $total+=$data1[$j][$k]; + } + } + + if($num==1) + { + if($merge==1) + { + echo ""; + } + + } + else + { + if($merge==1) + { + echo ""; + } + } + if($num1==0) + { + if($merge==0) + { + echo ""; + } + } + + + echo ""; + } +echo "
       Erlang
      Time{$tg[$j][name]}----total
      {$now}{$data1[$j][$k]}--$total--
      "; +} + + + //时间间隔 + $day=$sel_date_from-$sel_date_to+1; + $day_num=720/($day+1); + + + +//画图 + +// + +//=======================================================================================| +//=========== Draw the Graphics =============| +//=======================================================================================| + + $sizex=800; + if($csta_type==0) + $sizey=430; + else + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + + + //===background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + + + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + + $unitXPix=30; + + + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + + //===draw the label block==== + $color[1]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[2]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[4]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[5]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[6]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[7]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[8]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[9]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[10]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[11]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[12]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + for($k=1;$k < 13;$k++) + { + if(strcmp($filelist[$k][name]," ")) + { + for($i=0,$j=($slot-1);$i<($slot);$i++,$j--) + { + $out_put[$k][$i][x]=(780-$i*($day_num)-$day_num); + $out_put[$k][$i][y]=(275-$data1[$k][$j]*25); + } + } + } + + for($i=$sel_date_to,$k=0;$i<($sel_date_from+1);$i++,$k++) + { + $datestr[$k]=date("m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + } + +//////纵轴 + for($i=0;$i<$day;$i++) + { + + $style = array($black_color, $black_color, $black_color, $black_color, $red, $w, $w, $w, $w, $w); + imagesetstyle($im, $style); + imageline($im, ($xEnd - $i*($day_num)-$day_num), $yBgn, ($xEnd - $i*($day_num)-$day_num), $yEnd, IMG_COLOR_STYLED); + + $xstr=$datestr[$i]; + Imagestringup($im, 2, ($xEnd - $i*($day_num)-$day_num) - 4, $yEnd+60, $xstr, $style); + + //if($i==29) + //Imagestringup($im, 2, $xBgn + $i*24 - 4, $yEnd+60, $datestr[29], $style); + } + + //横轴 + for($i=0,$k=10;$i<10;$i++,$k--) + { + $displayMaxData=$k; + imagesetstyle($im, $style); + + //imageline($im,$xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, IMG_COLOR_STYLED); + if($i!=0) + imageline($im,$xBgn , $yBgn+$i*25, $xEnd, $yBgn+$i*25, IMG_COLOR_STYLED); + + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $black_color); + } + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "0", $black_color); + /////////////////////////////////////////////////////////////////////// + + + //画线 + + for($k=1;$k < 13;$k++) + { + if(strcmp($filelist[$k][name]," ")) + { + for($i=0;$i<($slot);$i++) + { + if($i > 0) + { + imageline($im,$out_put[$k][$i-1][x],$out_put[$k][$i-1][y],$out_put[$k][$i][x],$out_put[$k][$i][y],$color[$k]); + } + } + } + } + + + + + + //====graphics title===== + //$graphics_title="Service erlang statistic graphic"; + //Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //===draw the label block==== + $color[1]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[2]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[4]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[5]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[6]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[7]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[8]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[9]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[10]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[11]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[12]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + imagefilledrectangle($im,90,350,100,360,$color[1]); + imagestring($im,2,105,350,"SUB SUB",$text_color); + + imagefilledrectangle($im,260,350,270,360,$color[2]); + imagestring($im,2,275,350,"SUB TRK",$text_color); + + imagefilledrectangle($im,430,350,440,360,$color[3]); + imagestring($im,2,445,350,"TRK SUB",$text_color); + + imagefilledrectangle($im,600,350,610,360,$color[5]); + imagestring($im,2,615,350,"TRK TRK",$text_color); + + imagefilledrectangle($im,90,370,100,380,$color[6]); + imagestring($im,2,105,370,"INTRA",$text_color); + + imagefilledrectangle($im,260,370,270,380,$color[7]); + imagestring($im,2,275,370,"SUB IP",$text_color); + + imagefilledrectangle($im,430,370,440,380,$color[4]); + imagestring($im,2,445,370,"TRK IP",$text_color); + + imagefilledrectangle($im,600,370,610,380,$color[9]); + imagestring($im,2,615,370,"MO",$text_color); + + imagefilledrectangle($im,90,390,100,400,$color[10]); + imagestring($im,2,105,390,"MT",$text_color); + + imagefilledrectangle($im,260,390,270,400,$color[11]); + imagestring($im,2,275,390,"IN TRK",$text_color); + + imagefilledrectangle($im,430,390,440,400,$color[12]); + imagestring($im,2,445,390,"OUT TRK",$text_color); + + imagefilledrectangle($im,600,390,610,400,$color[8]); + imagestring($im,2,615,390,"IP",$text_color); + + +////////////////////////////////////////////////////// +//////////////////////////////////////////////////////// + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)) + { + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + + $tt=time()-4000; + $filename=$tt.".png"; + + if(1) + { + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + flush(); + echo ""; + echo ""; + + adjust_content_tail(); +?> + + \ No newline at end of file diff --git a/wxc2_omc/performance/erlangCsta/erlang_trunk_hour.php b/wxc2_omc/performance/erlangCsta/erlang_trunk_hour.php new file mode 100755 index 0000000..4196164 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/erlang_trunk_hour.php @@ -0,0 +1,400 @@ + +"; + + if($select_3 == 5) + { + //echo "the select_3=$select_3 good
      "; + $sql="select Duration csta_datetime FROM CSTA_DB.mscDetailData where key_type=3 and key_e1_tg={$tg[$j][type]} csta_datetime >='{$startTime}' and csta_datetime <='{$endTime}'"; + } + else if($select_3 == 6) + { + //echo "the select_3=$select_3 good
      "; + $sql="select Duration csta_datetime FROM CSTA_DB.mscDetailData where key_type=4 and key_e1_tg={$tg[$j][type]} csta_datetime >='{$startTime}' and csta_datetime <='{$endTime}'"; + } + else if($select_3 == 7) + { + //echo "the select_3=$select_3 good
      "; + $sql="select Duration csta_datetime FROM CSTA_DB.mscDetailData where key_e1_tg={$tg[$j][type]} (key_type=4 or key_type=3) (csta_datetime >='{$startTime}' and csta_datetime <='{$endTime}')"; + } + + + $res=mysql_query($sql,$link); + + if(!($res)) + { + $num=0; + } + else + { + $num=mysqli_num_rows($res); + } + + $data[$j][count]=$num; + + + for($i=0;$i<$num;$i++) + { + $row=mysqli_fetch_array($res); + + $data[$j][time]=$row[1]; + + $start=strtotime($startTime); + $rowt=strtotime($row[1]); + $dif=$rowt-$start; + $instance=floor($dif/(60*60)); + + $data[$j][$instance] += $row[0]+0; + } + } + } + return $data; +} + +$data1=Getdata($tg,$startTime,$endTime,$select_3); + +//table + + + $table_title="Trunk Group Erlang Statistic  Date:"; + + if($slot>1) + { + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + } + else + { + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + } + + echo "
      $table_title
      "; + echo "
      "; + echo ""; + for($j=0;$j<256;$j++) + { + if(strcmp($tg[$j][name]," ")) + { + //echo "
      "; + echo ""; + + for($i=0,$k=($slot-1);$i <=($slot-1);$i++,$k--) + { + $now=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + } + //echo "
      {$tg[$j][name]} Erlang(hour)
      {$now}000102030405060708091011
      {$data1[$j][0+(24*$k)]}{$data1[$j][1+(24*$k)]}{$data1[$j][2+(24*$k)]}{$data1[$j][3+(24*$k)]}{$data1[$j][4+(24*$k)]}{$data1[$j][5+(24*$k)]}{$data1[$j][6+(24*$k)]}{$data1[$j][7+(24*$k)]}{$data1[$j][8+(24*$k)]}{$data1[$j][9+(24*$k)]}{$data1[$j][10+(24*$k)]}{$data1[$j][11+(24*$k)]}
      121314151617181920212223
      {$data1[$j][12+(24*$k)]}{$data1[$j][13+(24*$k)]}{$data1[$j][14+(24*$k)]}{$data1[$j][15+(24*$k)]}{$data1[$j][16+(24*$k)]}{$data1[$j][17+(24*$k)]}{$data1[$j][18+(24*$k)]}{$data1[$j][19+(24*$k)]}{$data1[$j][20+(24*$k)]}{$data1[$j][21+(24*$k)]}{$data1[$j][22+(24*$k)]}{$data1[$j][23+(24*$k)]}
      "; + } + } + echo ""; + + +//时间间隔 + $day=$sel_date_from-$sel_date_to+1; + $day_num=30; + + +//画图 + +// + +//=======================================================================================| +//=========== Draw the Graphics =============| +//=======================================================================================| + + $sizex=800; + if($csta_type==0) + $sizey=430; + else + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + + + //===background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + + + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + + $unitXPix=30; + + + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + + //===draw the label block==== + $color[1]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[2]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[4]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[5]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[6]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[7]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[8]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[9]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[10]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[11]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[11]=ImageColorAllocate($im,0xEE,0x00,0xff); + +///////////////////////表示 X,Y轴坐标 + + + for($k=1;$k < 13;$k++) + { + if(strcmp($filelist[$k][name]," ")) + { + for($i=0;$i<($slot)*24;$i++) + { + + $out_put[$k][$i][x]=(60+$i*(30/$slot)); + $out_put[$k][$i][y]=(275-$data1[$k][$i]*25); + } + } + } + + + for($i=$sel_date_to,$k=0;$i<($sel_date_from+1);$i++,$k++) + { + $datestr[$k]=date("m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + } + +//////纵轴 + for($i=0;$i<23;$i++) + { + + $style = array($black_color, $black_color, $black_color, $black_color, $red, $w, $w, $w, $w, $w); + imagesetstyle($im, $style); + imageline($im, ($xEnd - $i*($day_num)-$day_num), $yBgn, ($xEnd - $i*($day_num)-$day_num), $yEnd, IMG_COLOR_STYLED); + + //$xstr=$datestr[$i]; + //Imagestringup($im, 2, ($xEnd - $i*($day_num)-$day_num) - 4, $yEnd+60, $xstr, $style); + + //if($i==29) + //Imagestringup($im, 2, $xBgn + $i*24 - 4, $yEnd+60, $datestr[29], $style); + } + +////纵轴标记 + for($i=0;$i<$slot*24;$i++) + { + + if(($i%$slot) == 0) + { + $hour_day=$i/24; + + $hour_time=$i/$slot; + + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-($slot-$hour_day-1),date("Y"))); + + $hour_hour=$i%24; + + if($hour_hour<10) + { + $timearray[$i]="0".$hour_hour."h"; + } + else + { + $timearray[$i]=$hour_hour."h"; + } + + $xstr=$datestr[$i]." ".$timearray[$i]; + Imagestringup($im, 2, $xBgn + $hour_time*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + + //横轴 + for($i=0,$k=10;$i<10;$i++,$k--) + { + $displayMaxData=$k; + imagesetstyle($im, $style); + + //imageline($im,$xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, IMG_COLOR_STYLED); + if($i!=0) + imageline($im,$xBgn , $yBgn+$i*25, $xEnd, $yBgn+$i*25, IMG_COLOR_STYLED); + + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $black_color); + } + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "0", $black_color); + /////////////////////////////////////////////////////////////////////// + + + //画线 + + for($k=1;$k < 13;$k++) + { + if(strcmp($filelist[$k][name]," ")) + { + for($i=0;$i<$slot*24;$i++) + { + + if($i > 0) + { + imageline($im,$out_put[$k][$i-1][x],$out_put[$k][$i-1][y],$out_put[$k][$i][x],$out_put[$k][$i][y],$color[$k]); + } + } + } + } + + + //====graphics title===== + //$graphics_title="Service erlang statistic graphic"; + //Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //===draw the label block==== + $color[1]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[2]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[4]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[5]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[6]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[7]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[8]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[9]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[10]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[11]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[12]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + imagefilledrectangle($im,90,350,100,360,$color[1]); + imagestring($im,2,105,350,"SUB SUB",$text_color); + + imagefilledrectangle($im,260,350,270,360,$color[2]); + imagestring($im,2,275,350,"SUB TRK",$text_color); + + imagefilledrectangle($im,430,350,440,360,$color[3]); + imagestring($im,2,445,350,"TRK SUB",$text_color); + + imagefilledrectangle($im,600,350,610,360,$color[5]); + imagestring($im,2,615,350,"TRK TRK",$text_color); + + imagefilledrectangle($im,90,370,100,380,$color[6]); + imagestring($im,2,105,370,"INTRA",$text_color); + + imagefilledrectangle($im,260,370,270,380,$color[7]); + imagestring($im,2,275,370,"SUB IP",$text_color); + + imagefilledrectangle($im,430,370,440,380,$color[4]); + imagestring($im,2,445,370,"TRK IP",$text_color); + + imagefilledrectangle($im,600,370,610,380,$color[9]); + imagestring($im,2,615,370,"MO",$text_color); + + imagefilledrectangle($im,90,390,100,400,$color[10]); + imagestring($im,2,105,390,"MT",$text_color); + + imagefilledrectangle($im,260,390,270,400,$color[11]); + imagestring($im,2,275,390,"IN TRK",$text_color); + + imagefilledrectangle($im,430,390,440,400,$color[12]); + imagestring($im,2,445,390,"OUT TRK",$text_color); + + imagefilledrectangle($im,600,390,610,400,$color[8]); + imagestring($im,2,615,390,"IP",$text_color); + + + + + +////////////////////////////////////////////////////// +//////////////////////////////////////////////////////// + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)) + { + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + + $tt=time()-4000; + $filename=$tt.".png"; + + if(1) + { + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + flush(); + echo ""; + echo ""; + + adjust_content_tail(); + +?> + diff --git a/wxc2_omc/performance/erlangCsta/inc/D2H2B.inc b/wxc2_omc/performance/erlangCsta/inc/D2H2B.inc new file mode 100755 index 0000000..df91ce3 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/D2H2B.inc @@ -0,0 +1,319 @@ + +
      + + + + + + + + + + + + + + + +
        
      + +
      + + +
      +$strRemarks : $strCalculatorRemarks";?> +
      +
      + + + diff --git a/wxc2_omc/performance/erlangCsta/inc/chinese_gb.inc b/wxc2_omc/performance/erlangCsta/inc/chinese_gb.inc new file mode 100755 index 0000000..e59375f --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/chinese_gb.inc @@ -0,0 +1,477 @@ + "; +$strCurrentTariff ="当前费率"; +$strRent ="租金"; +$strTariffRentID ="对象"; +$strTariffRentChargeDate ="充值时间"; +$strTariffRentChargeAmount ="充值金额"; +$strTariffRentCapFlag ="Cap Flag"; +$strGet ="Get"; +$strSet ="Set"; +$strCompare ="比较"; +$strLoad ="Load"; +$strSave ="保存"; +$strLock ="锁定"; +$strUnlock ="解锁"; +$strDailingPrefix ="字头"; +$strTrunkGroup ="局向"; +$strCell ="小区"; +$strClockReference ="时钟模块"; +$strParameter ="参数"; +$strBHCA ="话务统计"; +$strData ="数据"; +$strFlow ="流量统计"; +$strAnalysis ="分析"; +$strTitlePerformance ="话务统计"; +$strTariffPlan ="费率计划"; +$strBasicTariff ="基本费率"; +$strHoliday ="节假日"; +$strMultiServices ="其它业务"; +$strPlanManage ="计划管理"; +$strMessageLength ="拆分包长"; +$strConfiguration ="系统配置"; + +//added by xiehua +$strTitleConfiguration ="系统配置"; +$strTitleAccount ="账户信息"; +$strTitlePerformance ="话务统计"; +$strSubscriberManage ="客户管理"; +$strRefreshCard ="充值卡"; +$strSubscriber ="用户"; +$strLog ="日志"; +$strMaintenance ="系统维护"; +$strLink ="链路"; +$strNetwork ="网络"; +$strBackupRestore ="数据备份和恢复"; +$strDualServerMode ="双机模式"; +$strCharge ="金额"; +$strAdvanced ="高级"; +$strPerformance ="性能"; +$strGetAll ="Get All"; + +//added by Cui Ticun +$strDiscountID ="折扣号"; +$strFreeChargeUnit ="免费计时单位"; +$strFav_call ="亲情呼叫"; +$strFav_listedtion ="亲情表编辑"; +$strUndo ="取消"; +$strLinkset ="链路组"; +$strLink ="链路"; +$strLocalNode ="本地服务地址"; +$strNetworkCode ="网络基本设定"; +$strMtTariff ="被叫费率"; +$strSMContent ="短信内容"; +$strPriority ="优先级"; +$strTimeToLive ="有效时间"; +$strSent ="发送成功"; +$strDiscarded ="丢弃"; +$strPending ="待发"; +$strCaller ="主叫号码"; +$strCalled ="被叫号码"; +$strUpdate ="刷新时间"; +$strLastAttempt ="最后试发"; + +$strGttObjects ="GTT Objects"; + +//add by Jianhui Zheng +$strE164Number="E164 号码"; +$strUndo="撤消"; +$strModule="模块"; +$strVMSOrVSS="VSS"; +$strSMSEG="SMEG"; + +/***********************错误和提示定义***************************/ +$STR_CONF_COMMAND_ERR_0000 ="命令操作成功"; + +//ERR_001*:should prompt the operator "Check the device's status" +$STR_CONF_PROMPT_001 ="请检查设备状态"; +$STR_CONF_COMMAND_ERR_0011 ="OMC找不到设备IP"; +$STR_CONF_COMMAND_ERR_0012 ="设备IP错误"; + +//ERR_002*:should prompt the operator "Check the software version of OMC and device" +$STR_CONF_PROMPT_002 ="检查OMC和设备的软件版本是否相符"; +$STR_CONF_COMMAND_ERR_0021 ="OMC找不到相应的目标的值"; +$STR_CONF_COMMAND_ERR_0022 ="OMC找不到相应的序列好的值"; + +//ERR_003*:should prompt the operator "Check the OMC's status or send command again" +$STR_CONF_PROMPT_003 ="检查OMC状态或重发命令"; +$STR_CONF_COMMAND_ERR_0031 ="OMC发送SNMP消息错误"; +$STR_CONF_COMMAND_ERR_0032 ="OMC命令缓存已满"; +$STR_CONF_COMMAND_ERR_0033 ="OMC发送命令太慢,或者没有发送命令"; + +//ERR_004*:should prompt the operator "Check the device's status or send command again" +$STR_CONF_PROMPT_004 ="检查设备的状态或重发命令.发送命令前,确保OMC和对端服务器在线"; +$STR_CONF_COMMAND_ERR_0041 ="回应消息无效"; +$STR_CONF_COMMAND_ERR_0042 ="回应消息错误"; +$STR_CONF_COMMAND_ERR_0043 ="回应超时"; + +$STR_CONF_COMMAND_ERR_9999 ="未定义错误"; +$strPleaseInputIndexNo ="请输入Index"; +$indexNoDefinedBy ="Index is defined by"; + +?> \ No newline at end of file diff --git a/wxc2_omc/performance/erlangCsta/inc/config.inc b/wxc2_omc/performance/erlangCsta/inc/config.inc new file mode 100755 index 0000000..8dc597c --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/config.inc @@ -0,0 +1,334 @@ +'0', name=>'WXC2 OMC', path=>'wxc2_omc'), + array(typeNo=>'1', name=>'GMSC OMC', path=>'gmsc_omc'), + array(typeNo=>'2', name=>'MSC OMC', path=>'msc_omc'), + array(typeNo=>'3', name=>'HLR OMC', path=>'hlr_omc'), + array(typeNo=>'4', name=>'AUC OMC', path=>'auc_omc'), + array(typeNo=>'5', name=>'PPS OMC', path=>'pps_omc'), + array(typeNo=>'6', name=>'SMSC OMC', path=>'smsc_omc'), + array(typeNo=>'7', name=>'BSS OMC', path=>'bss_omc'), + array(typeNo=>'8', name=>'EIR OMC', path=>'eir_omc'), + array(typeNo=>'9', name=>'HBSC OMC', path=>'hbsc_omc'), + array(typeNo=>'10', name=>'SN OMC', path=>'sn_omc') + ); +//echo "cofnig $PHP_SELF"; +if(strlen($selectedOmcPath) > 0){ + $thisOmcPath=$selectedOmcPath; +}else{ + $pathArr=explode('/',$PHP_SELF); + $thisOmcPath=$pathArr[1]; +} + +for($ii=0;$iiif($thisOmcPath == {$omcTypeArr[$ii][path]})"; + if($thisOmcPath == $omcTypeArr[$ii][path]){ + $thisOmcType= $omcTypeArr[$ii][typeNo]; + break; + } +} + + +//===============================OMC说明变量============================================================== +$COMPANY_NAME = "InterWave"; +$COMPANY_WEBSITE = "www.iwv.com"; +$COMPANY_E_MAIL = "Help@iwv.com"; + +$SYSTEM_VERSION = $omcTypeArr[$thisOmcType][name]."
      R3V3_09"; +$SYSTEM_VERSION_ISSUE_DATE = "2002-11-19"; + +$OMC_NAME = $omcTypeArr[$thisOmcType][name]; +$OMC_VERSION = "R6V5_10"; +$OMC_VERSION_ISSUE_DATE = "2002-10-21"; + +$WELCOME_WORDS = "WELCOME TO $OMC_NAME"; +$COPY_RIGHT_WORDS = "Copyright 2001-2002 iwv.com All rights reserved."; + + +//==============================各OMC的URL================================================================= +$host_ip = getenv("HTTP_HOST"); +//echo "
      host_ip=$host_ip"; + + +//用户选择的语言类型 +if($userInfo[language] == 'chn'){ + require("../../inc/chinese_gb.inc"); + $USER_GUIDE_DIR = "../../../guide/index_cn.htm"; + $language=chn; + $language_type = 1; +//}elseif ($language == 'eng'){ +}else{ + require("../../inc/english.inc"); + $USER_GUIDE_DIR = "../../../guide/index_en.htm"; + $language=eng; + $language_type = 0; +} + +//=============================数据下载设置============================================================== +$load_sys_type=0;//与HLR有关的CSV数据模版类型(msc-->0/hlr-->1/pps-->2); + +//=============================数据库设置================================================================= +//---------------服务器设置----------------- +//OMC-0 + +$handle=fopen("../../inc/mysqlpw.inc","r"); +$mysqluser=str_rot13(trim(fgets($handle))); +$mysqlpw=str_rot13(trim(fgets($handle))); +fclose($handle); + + +$OMC_server[0]['host'] = 'localhost'; // MySQL hostname,如果该主机名无法被解释,将出现无法打开页面的情况!! +$OMC_server[0]['user'] = $mysqluser; // MySQL user (only needed with basic auth) +$OMC_server[0]['password'] = $mysqlpw; // MySQL password (only needed with basic auth) +$OMC_server[0]['port'] = ''; // MySQL port - leave blank for default port +$OMC_server[0]['adv_auth'] = false; // Use advanced authentication? +$OMC_server[0]['adv_user'] = ''; // MySQL standard user (only needed with advanced auth) +$OMC_server[0]['adv_pass'] = ''; // MySQL standard password (only needed with advanced auth) +$OMC_server[0]['only_db'] = ''; // If set to a db-name, only this db is accessible +$OMC_server[0]['verbose'] = 'master server'; // Verbose name for this host - leave blank to show the hostname + +//OMC-1 +$OMC_server[1]['host'] = 'omc-1'; +$OMC_server[1]['user'] = $mysqluser; +$OMC_server[1]['password'] = $mysqlpw; +$OMC_server[1]['port'] = ''; +$OMC_server[1]['adv_auth'] = false; +$OMC_server[1]['adv_user'] = ''; +$OMC_server[1]['adv_pass'] = ''; +$OMC_server[1]['only_db'] = ''; +$OMC_server[1]['verbose'] = 'second server'; + +//数据库连接 +$link[0] = mysql_pconnect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password']); +if(!$link[0]){//可惜在该主机名无法被解释的条件下,这段程序无法执行 + echo "Connect databese error!! please check the server name or the user_id and password"; + exit(); +} +//$link[1]=mysql_pconnect($OMC_server[1]['host'],$OMC_server[1]['user'],$OMC_server[1]['password']); + +//-----------数据库数据表设置------------------- +//数据库列表 +$omc_db = 'OMC_PUB'; //omc公用数据库 +$cdr_db = 'CDR_DB'; //存放各种话单资料 +$csta_db = 'CSTA_DB'; //存放话务统计数据 +$auc_para = 'AUC_Para'; //存放AUC数据 +$eir_para = 'EIR_Para'; //存放EIR数据 +$account_db = 'account_db'; +$bill_db = 'tariff_db'; +$hlr_db = 'hlr_db'; +$bss_db = 'BssOmcDb'; +$refresh_card_db = 'refresh_card'; +$parameter_db = 'parameter_db'; +$sysconf_table = 'sysConf'; //设备定义表,是设备信息的基础 +$paramConf_table = 'paramConf'; //参数定义表 +$alarmconf_table = 'sysAlarmConf'; //告警定义 +$sysStat_table = 'sysStat'; //状态信息表 +$sysoperlog_table = 'sysOperLog'; //日志表 +$sysoperconf_table = 'sysOperConf'; //日志类型定义表 +$syscsvconf_table = 'sysCsvConf'; //CSV模板定义 +$cstadefine_table = 'cstaDefine'; //csta配置 +$cdrdefine_table = 'cdrSource'; //cdr配置 + +//==============================平台类型定义================================================ +$PlatTypeDefArr=array( + array('num'=> '0', 'remark' => 'EMS', sysTypeNo => '0', maxSysNum => '2', platAgent => '0'), + array('num'=> '1', 'remark' => 'GMSC', sysTypeNo => '310', maxSysNum => '2', platAgent => '1'), + array('num'=> '2', 'remark' => 'MSC', sysTypeNo => '320', maxSysNum => '2', platAgent => '2'), + array('num'=> '3', 'remark' => 'HLR', sysTypeNo => '330', maxSysNum => '2', platAgent => '2'), + array('num'=> '4', 'remark' => 'AUC', sysTypeNo => '340', maxSysNum => '2', platAgent => '4'), + array('num'=> '5', 'remark' => 'PPS', sysTypeNo => '360', maxSysNum => '2', platAgent => '5'), + array('num'=> '6', 'remark' => 'SMSC', sysTypeNo => '350', maxSysNum => '2', platAgent => '6'), + array('num'=> '7', 'remark' => 'EIR', sysTypeNo => '380', maxSysNum => '2', platAgent => '4'), + array('num'=> '8', 'remark' => 'VSS', sysTypeNo => '390', maxSysNum => '10', platAgent => '4'), + array('num'=> '9', 'remark' => 'MSS', sysTypeNo => '388', maxSysNum => '2', platAgent => '4'), + array('num'=> '10', 'remark' => 'MNP', sysTypeNo => '370', maxSysNum => '2', platAgent => '4'), + array('num'=> '11', 'remark' => 'AAS', sysTypeNo => '311', maxSysNum => '2', platAgent => '2'), + array('num'=> '12', 'remark' => 'SMEG', sysTypeNo => '355', maxSysNum => '2', platAgent => '1'), + array('num'=> '13', 'remark' => 'OPPS', sysTypeNo => '375', maxSysNum => '2', platAgent => '2'), + array('num'=> '14', 'remark' => 'MRFC', sysTypeNo => '385', maxSysNum => '2', platAgent => '2'), + array('num'=> '15', 'remark' => 'iPALIM', sysTypeNo => '378', maxSysNum => '2', platAgent => '2'), + array('num'=> '16', 'remark' => 'iRLS', sysTypeNo => '379', maxSysNum => '2', platAgent => '2'), + array('num'=> '17', 'remark' => 'MHC', sysTypeNo => '386', maxSysNum => '2', platAgent => '2'), + array('num'=> '18', 'remark' => 'RCM', sysTypeNo => '395', maxSysNum => '2', platAgent => '2'), +); + +//==============================告警等级设定================================================ +$alarmLevelDefArr=array( + array(value => '0', remark => $strClearedAlarm, color => '#0000FF'), + array(value => '1', remark => $strCriticalAlarm, color => '#FF0000'), + array(value => '2', remark => $strMajorAlarm, color => '#980030'), + array(value => '3', remark => $strMinorAlarm, color => '#980030'), + array(value => '4', remark => $strWarningAlarm, color => '#980030'), + //array(value => '5', remark => $strClearedAlarm, color => '#0000FF'), + +); + +//=============================系统配置参数================================== + +$separator =','; //csv数据的字段分割符 +$heatbeat_overtime = 48; //heartbeat的超时设置。单位为秒。 + +/*被注释掉的变量定义将删除 + +$def_sys_param_sign = 99; //系统参数在参数表中用一个特殊的子系统编号,该编号不等于其他的子系统编号。 + +$total_subsys_num = 8; //每个系统中子系统数,每个系统的子系统数相等 + +$len_of_sys_num = 2; //sys_id编号方式中系统编号的长度 + +$len_of_subsys_num = 2; //sys_id编号方式中子系统编号的长度 + +$def_len_of_record = 32; // 参数表中每条记录默认所含的Byte个数 +*/ + + +//服务器工作状态定义,这个需要放在子模块中 +$server_work_status=array( + array('num'=> '0','remark' => $strRestart, 'color' => '#FF0000'), + array('num'=> '1','remark' => $strInitialize, 'color' => '#FF0000'), + array('num'=> '2','remark' => $strNormal, 'color' => '#0000FF'), + array('num'=> '3','remark' => $strPause, 'color' => '#FF0000'), + array('num'=> '4','remark' => $strStop, 'color' => '#FF0000') + ); + +//================================操作权限设定====================================== +//---------------------操作种类权限定义------------------------------ +/* +$privilegeDefArr=array( + array('permit' => '0', 'remark' => 'any one', 'show'=>0), + array('permit' => '1', 'remark' => $strOprationRestriction, 'show'=>1), + array('permit' => '2', 'remark' => $strConfigurationRestriction, 'show'=>1), + array('permit' => '3', 'remark' => $strManagementRestriction, 'show'=>1), + array('permit' => '4', 'remark' => 'System management', 'show'=>1), + array('permit' => '5', 'remark' => 'Development', 'show'=>0) +); +*/ +$privilegeDefArr=array( + array('permit' => '0', 'remark' => 'any one', 'show'=>0), + array('permit' => '1', 'remark' => $strOprationRestriction, 'show'=>1), + array('permit' => '2', 'remark' => 'Technician', 'show'=>1), + array('permit' => '3', 'remark' => 'Engineer', 'show'=>1), + array('permit' => '4', 'remark' => $strManagementRestriction, 'show'=>1), + array('permit' => '5', 'remark' => 'Development', 'show'=>0) +); + +//-------------------------按操作种类划分页面----------------------- +//每个dir[$n][0]都是该类操作的操作权限等级值 +//具体的值对照oper_type的定义 + +$omcDir = '/'.$omcTypeArr[$thisOmcType][path]; +//$omcDir = '/omcWeb_v5'; +//echo "
      omcDir=$omcDir"; +//---------------every one (包括未登录用户)可访问的目录----------------- +$dirAccessDefArr[0][0] = $omcDir.'/security/login/'; +$dirAccessDefArr[0][1] = $omcDir.'/security/logout/'; + + +//---------------class one:operator 可访问的目录----------------- +$dirAccessDefArr[1][0] = $omcDir.'/security/'; +$dirAccessDefArr[1][1] = $omcDir.'/frame/'; +$dirAccessDefArr[1][2] = $omcDir.'/fault/'; + +//---------------class two:engineer 可访问的目录----------------- +$dirAccessDefArr[2][0] = $omcDir.'/security/'; +$dirAccessDefArr[2][1] = $omcDir.'/frame/'; +$dirAccessDefArr[2][2] = $omcDir.'/fault/'; +$dirAccessDefArr[2][3] = $omcDir.'/performance/'; +$dirAccessDefArr[2][4] = $omcDir.'/account/'; +$dirAccessDefArr[2][5] = $omcDir.'/element/'; + +//---------------class three:manager 可访问的目录----------------- +$dirAccessDefArr[3][0] = $omcDir.'/security/'; +$dirAccessDefArr[3][1] = $omcDir.'/frame/'; +$dirAccessDefArr[3][2] = $omcDir.'/fault/'; +$dirAccessDefArr[3][3] = $omcDir.'/account/'; +$dirAccessDefArr[3][4] = $omcDir.'/configuration/'; +$dirAccessDefArr[3][5] = $omcDir.'/element/'; +$dirAccessDefArr[3][6] = $omcDir.'/performance/'; + +//--------------class four:system manager 可访问的目录----------------- +$dirAccessDefArr[4][0] = $omcDir.'/security/'; +$dirAccessDefArr[4][1] = $omcDir.'/frame/'; +$dirAccessDefArr[4][2] = $omcDir.'/fault/'; +$dirAccessDefArr[4][3] = $omcDir.'/account/'; +$dirAccessDefArr[4][4] = $omcDir.'/configuration/'; +$dirAccessDefArr[4][5] = $omcDir.'/element/'; +$dirAccessDefArr[4][6] = $omcDir.'/performance/'; + +//--------------developer 可访问的目录----------------- +$dirAccessDefArr[5][0] = $omcDir.'/security/'; +$dirAccessDefArr[5][1] = $omcDir.'/frame/'; +$dirAccessDefArr[5][2] = $omcDir.'/fault/'; +$dirAccessDefArr[5][3] = $omcDir.'/account/'; +$dirAccessDefArr[5][4] = $omcDir.'/configuration/'; +$dirAccessDefArr[5][5] = $omcDir.'/element/'; +$dirAccessDefArr[5][6] = $omcDir.'/performance/'; +$dirAccessDefArr[5][7] = $omcDir.'/sysDefine/'; +?> + diff --git a/wxc2_omc/performance/erlangCsta/inc/english.inc b/wxc2_omc/performance/erlangCsta/inc/english.inc new file mode 100755 index 0000000..b324186 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/english.inc @@ -0,0 +1,506 @@ + "; +$strRent ="Rent"; +$strTariffRentID ="ID"; +$strTariffRentChargeDate ="Charge date"; +$strTariffRentChargeAmount ="Charge amount"; +$strTariffRentCapFlag ="Cap flag"; +$strGet ="Get"; +$strSet ="Set"; +$strCompare ="Compare"; +$strLoad ="Load"; +$strSave ="Save"; +$strLock ="Lock"; +$strUnlock ="Unlock"; +$strDailingPrefix ="Dailing prefix"; +$strTrunkGroup ="Trunk group"; +$strCell ="Cell"; +$strClockReference ="Clock reference"; +$strParameter ="Parameter"; +$strBHCA ="BHCA"; +$strData ="Data"; +$strFlow ="Flow"; +$strAnalysis ="Analysis"; +$strTariffPlan ="Tariff plan"; +$strBasicTariff ="Basic tariff"; +$strHoliday ="Holiday"; +$strMultiServices ="Multiple services"; +$strPlanManage ="Plan management"; +$strMessageLength ="Message length"; +$strConfiguration ="Configuration"; + +//added by xiehua +$strTitleConfiguration ="Configuration"; +$strTitleAccount ="Account"; +$strTitlePerformance ="Performance"; +$strSubscriberManage ="Subscriber"; +$strRefreshCard ="Referesh card"; +$strSubscriber ="Subscriber"; +$strLog ="Log"; +$strMaintenance ="Maintenance"; +$strNetwork ="Network"; +$strBackupRestore ="Backup&Restore"; +$strDualServerMode ="Dual server mode"; +$strCharge ="Charge"; +$strAdvanced ="Advanced"; +$strPerformance ="Performance"; +$strGetAll ="Get All"; + +//added by Cui Ticun +$strDiscountID ="Discount ID"; +$strFreeChargeUnit ="Free charge unit(s)"; +$strFav_call ="Friends and family number call"; +$strFav_listedtion ="Friends and family number list edition"; +$strCf_Cug_call ="Forward + CUG call"; +$strCf_Fav_call ="Forward + F&F call"; +$strCug_Fav_call ="CUG + F&F call"; +$strCf_Cug_Fav_call ="Forward + CUG + F&F call"; +$strUndo ="Undo"; +$strLinkset ="Linkset"; +$strLink ="Link"; +$strLocalNode ="Local node"; +$strNetworkCode ="Network code"; +$strMtTariff ="MT Tariff"; +$strSMContent ="Content"; +$strPriority ="Priority"; +$strTimeToLive ="Time to live"; +$strSent ="Sent"; +$strDiscarded ="Discarded"; +$strPending ="Pending"; +$strCaller ="Caller #"; +$strCalled ="Called #"; +$strUpdate ="Update"; +$strReceive ="Receive"; +$strLastAttempt ="Last attempt"; +$strGttObjects ="GTT Objects"; + +$strTitleGet="Get all Parameters from device"; +$strTitleSet="Set all Parameters to device"; +$flagColor = "#E6FFFF"; + +//add by Zheng Jianhui +$strE164Number="E164 Number"; +$strUndo="Undo"; +$strModule="Module"; +$strVMSOrVSS="VSS"; +$strSMSEG="SMEG"; + +/***********************Error and prompt display define***************************/ +$STR_CONF_COMMAND_ERR_0000 ="Command successful"; + +//ERR_001*:should prompt the operator "Check the device's status" +$STR_CONF_PROMPT_01 ="Please check the device status"; +$STR_CONF_COMMAND_ERR_0101 ="OMC cannot get the device IP"; +$STR_CONF_COMMAND_ERR_0102 ="The device IP is error"; + +//ERR_002*:should prompt the operator "Check the software version of OMC and device" +$STR_CONF_PROMPT_02 ="Please check the software version of OMC and device"; +$STR_CONF_COMMAND_ERR_0201 ="OMC cannot get the object value"; +$STR_CONF_COMMAND_ERR_0202 ="OMC cannot get the instance value"; + +//ERR_003*:should prompt the operator "Check the OMC's status or send command again" +$STR_CONF_PROMPT_03 ="Please check the OMC status or send command again"; +$STR_CONF_COMMAND_ERR_0301 ="OMC send snmp message failed"; +$STR_CONF_COMMAND_ERR_0302 ="OMC command buffer is full"; +$STR_CONF_COMMAND_ERR_0303 ="Network is busy or managed object response is too slow"; + +//ERR_04*:should prompt the operator "Check the device's status or send command again" +$STR_CONF_PROMPT_04 ="Please check the device status or send commands again.Before sending commands, please make sure OMC servers and managed servers are online."; +$STR_CONF_COMMAND_ERR_0401 ="Invailed response message"; +$STR_CONF_COMMAND_ERR_0402 ="Error Response message"; +$STR_CONF_COMMAND_ERR_0403 ="Response timeout"; + +//ERR_05*:Value Error +$STR_CONF_PROMPT_05 ="Please check the value range and syntax in the online help then try it again."; +$STR_CONF_COMMAND_ERR_0501 ="Too Big"; +$STR_CONF_COMMAND_ERR_0502 ="No Such Name"; +$STR_CONF_COMMAND_ERR_0503 ="Bad Value"; +$STR_CONF_COMMAND_ERR_0504 ="Read Only"; +$STR_CONF_COMMAND_ERR_0505 ="Generate Error"; +$STR_CONF_COMMAND_ERR_0506 ="No Access"; +$STR_CONF_COMMAND_ERR_0507 ="Wrong Type"; +$STR_CONF_COMMAND_ERR_0508 ="Wrong Length"; +$STR_CONF_COMMAND_ERR_0509 ="Wrong Encoding"; +$STR_CONF_COMMAND_ERR_0510 ="Wrong Value"; +$STR_CONF_COMMAND_ERR_0511 ="No Creation"; +$STR_CONF_COMMAND_ERR_0512 ="Inconsistent Value"; +$STR_CONF_COMMAND_ERR_0513 ="Resource Unavailabe"; +$STR_CONF_COMMAND_ERR_0514 ="Commit Failed"; +$STR_CONF_COMMAND_ERR_0515 ="Undo Failed"; +$STR_CONF_COMMAND_ERR_0516 ="Authorization Error"; +$STR_CONF_COMMAND_ERR_0517 ="No Writable"; +$STR_CONF_COMMAND_ERR_0518 ="InconsistentName"; + +$STR_CONF_COMMAND_ERR_9999 ="Unknown error"; +$strPleaseInputIndexNo ="Please input index No."; +$indexNoDefinedBy ="Index is defined by"; +?> diff --git a/wxc2_omc/performance/erlangCsta/inc/expand.js b/wxc2_omc/performance/erlangCsta/inc/expand.js new file mode 100755 index 0000000..6d27982 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/expand.js @@ -0,0 +1,134 @@ + \ No newline at end of file diff --git a/wxc2_omc/performance/erlangCsta/inc/ftiens4.js b/wxc2_omc/performance/erlangCsta/inc/ftiens4.js new file mode 100755 index 0000000..eca263a --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/ftiens4.js @@ -0,0 +1,1127 @@ +//**************************************************************** +// Keep this copyright notice: +// This copy of the script is the property of the owner of the +// particular web site you were visiting. +// Do not download the script's files from there. +// For a free download and full instructions go to: +// http://www.treeview.net +//**************************************************************** + + +// Log of changes: +// +// 12 May 03 - Support for Safari Beta 3 +// 01 Mar 03 - VERSION 4.3 - Support for checkboxes +// 21 Feb 03 - Added support for Opera 7 +// 22 Sep 02 - Added maySelect member for node-by-node control +// of selection and highlight +// 21 Sep 02 - Cookie values are now separated by cookieCutter +// 12 Sep 02 - VERSION 4.2 - Can highlight Selected Nodes and +// can preserve state through external (DB) IDs +// 29 Aug 02 - Fine tune 'supportDeferral' for IE4 and IE Mac +// 25 Aug 02 - Fixes: STARTALLOPEN, and multi-page frameless +// 09 Aug 02 - Fix repeated folder on Mozilla 1.x +// 31 Jul 02 - VERSION 4.1 - Dramatic speed increase for trees +// with hundreds or thousands of nodes; changes to the control +// flags of the gLnk function +// 18 Jul 02 - Changes in pre-load images function +// 13 Jun 02 - Add ICONPATH var to allow for gif subdir +// 20 Apr 02 - Improve support for frame-less layout +// 07 Apr 02 - Minor changes to support server-side dynamic feeding +// (example: FavoritesManagerASP) + + +// Definition of class Folder +// ***************************************************************** +function Folder(folderDescription, hreference) //constructor +{ + //constant data + this.desc = folderDescription; + this.hreference = hreference; + this.id = -1; + this.navObj = 0; + this.iconImg = 0; + this.nodeImg = 0; + this.isLastNode = 0; + this.iconSrc = ICONPATH + "ftv2folderopen.gif"; + this.iconSrcClosed = ICONPATH + "ftv2folderclosed.gif"; + this.children = new Array; + this.nChildren = 0; + this.level = 0; + this.leftSideCoded = ""; + this.isLastNode=false; + this.parentObj = null; + this.maySelect=true; + this.prependHTML = "" + + //dynamic data + this.isOpen = false + this.isLastOpenedFolder = false + this.isRendered = 0 + + //methods + this.initialize = initializeFolder + this.setState = setStateFolder + this.addChild = addChild + this.createIndex = createEntryIndex + this.escondeBlock = escondeBlock + this.esconde = escondeFolder + this.folderMstr = folderMstr + this.renderOb = drawFolder + this.totalHeight = totalHeight + this.subEntries = folderSubEntries + this.linkHTML = linkFolderHTML + this.blockStartHTML = blockStartHTML + this.blockEndHTML = blockEndHTML + this.nodeImageSrc = nodeImageSrc + this.iconImageSrc = iconImageSrc + this.getID = getID + this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders +} + +function initializeFolder(level, lastNode, leftSide) +{ + var j=0 + var i=0 + nc = this.nChildren + + this.createIndex() + this.level = level + this.leftSideCoded = leftSide + + if (browserVersion == 0 || STARTALLOPEN==1) + this.isOpen=true; + + if (level>0) + if (lastNode) //the last child in the children array + leftSide = leftSide + "0" + else + leftSide = leftSide + "1" + + this.isLastNode = lastNode + + if (nc > 0) + { + level = level + 1 + for (i=0 ; i < this.nChildren; i++) + { + if (i == this.nChildren-1) + this.children[i].initialize(level, 1, leftSide) + else + this.children[i].initialize(level, 0, leftSide) + } + } +} + +function drawFolder(insertAtObj) +{ + var nodeName = "" + var auxEv = "" + var docW = "" + + var leftSide = leftSideHTML(this.leftSideCoded) + + if (browserVersion > 0) + auxEv = "" + else + auxEv = "" + + nodeName = this.nodeImageSrc() + + if (this.level>0) + if (this.isLastNode) //the last child in the children array + leftSide = leftSide + "" + auxEv + "" + else + leftSide = leftSide + "" + auxEv + "" + + this.isRendered = 1 + + if (browserVersion == 2) { + if (!doc.yPos) + doc.yPos=20 + } + + docW = this.blockStartHTML("folder"); + + docW = docW + "" + leftSide + ""; + if (USEICONS) + { + docW = docW + this.linkHTML(false) + docW = docW + "" + } + else + { + if (this.prependHTML == "") + docW = docW + "" + } + if (WRAPTEXT) + docW = docW + ""+this.prependHTML+"" + else + docW = docW + ""+this.prependHTML+"" + if (USETEXTLINKS) + { + docW = docW + this.linkHTML(true) + docW = docW + this.desc + "" + } + else + docW = docW + this.desc + docW = docW + "" + + docW = docW + this.blockEndHTML() + + if (insertAtObj == null) + { + if (supportsDeferral) { + doc.write("
      ") //transition between regular flow HTML, and node-insert DOM DHTML + insertAtObj = getElById("domRoot") + insertAtObj.insertAdjacentHTML("beforeEnd", docW) + } + else + doc.write(docW) + } + else + { + insertAtObj.insertAdjacentHTML("afterEnd", docW) + } + + if (browserVersion == 2) + { + this.navObj = doc.layers["folder"+this.id] + if (USEICONS) + this.iconImg = this.navObj.document.images["folderIcon"+this.id] + this.nodeImg = this.navObj.document.images["nodeIcon"+this.id] + doc.yPos=doc.yPos+this.navObj.clip.height + } + else if (browserVersion != 0) + { + this.navObj = getElById("folder"+this.id) + if (USEICONS) + this.iconImg = getElById("folderIcon"+this.id) + this.nodeImg = getElById("nodeIcon"+this.id) + } +} + +function setStateFolder(isOpen) +{ + var subEntries + var totalHeight + var fIt = 0 + var i=0 + var currentOpen + + if (isOpen == this.isOpen) + return + + if (browserVersion == 2) + { + totalHeight = 0 + for (i=0; i < this.nChildren; i++) + totalHeight = totalHeight + this.children[i].navObj.clip.height + subEntries = this.subEntries() + if (this.isOpen) + totalHeight = 0 - totalHeight + for (fIt = this.id + subEntries + 1; fIt < nEntries; fIt++) + indexOfEntries[fIt].navObj.moveBy(0, totalHeight) + } + this.isOpen = isOpen; + + if (this.getID()!=foldersTree.getID() && PERSERVESTATE && !this.isOpen) //closing + { + currentOpen = GetCookie("clickedFolder") + if (currentOpen != null) { + currentOpen = currentOpen.replace(this.getID()+cookieCutter, "") + SetCookie("clickedFolder", currentOpen) + } + } + + if (!this.isOpen && this.isLastOpenedfolder) + { + lastOpenedFolder = null; + this.isLastOpenedfolder = false; + } + propagateChangesInState(this) +} + +function propagateChangesInState(folder) +{ + var i=0 + + //Change icon + if (folder.nChildren > 0 && folder.level>0) //otherwise the one given at render stays + folder.nodeImg.src = folder.nodeImageSrc() + + //Change node + if (USEICONS) + folder.iconImg.src = folder.iconImageSrc() + + //Propagate changes + for (i=folder.nChildren-1; i>=0; i--) + if (folder.isOpen) + folder.children[i].folderMstr(folder.navObj) + else + folder.children[i].esconde() +} + +function escondeFolder() +{ + this.escondeBlock() + + this.setState(0) +} + +function linkFolderHTML(isTextLink) +{ + var docW = ""; + + if (this.hreference) + { + if (USEFRAMES) + docW = docW + " 0) + docW = docW + "onClick='javascript:clickOnFolder(\""+this.getID()+"\")'" + + docW = docW + ">" + } + else + docW = docW + "" + + return docW; +} + +function addChild(childNode) +{ + this.children[this.nChildren] = childNode + childNode.parentObj = this + this.nChildren++ + return childNode +} + +function folderSubEntries() +{ + var i = 0 + var se = this.nChildren + + for (i=0; i < this.nChildren; i++){ + if (this.children[i].children) //is a folder + se = se + this.children[i].subEntries() + } + + return se +} + +function nodeImageSrc() { + var srcStr = ""; + + if (this.isLastNode) //the last child in the children array + { + if (this.nChildren == 0) + srcStr = ICONPATH + "ftv2lastnode.gif" + else + if (this.isOpen) + srcStr = ICONPATH + "ftv2mlastnode.gif" + else + srcStr = ICONPATH + "ftv2plastnode.gif" + } + else + { + if (this.nChildren == 0) + srcStr = ICONPATH + "ftv2node.gif" + else + if (this.isOpen) + srcStr = ICONPATH + "ftv2mnode.gif" + else + srcStr = ICONPATH + "ftv2pnode.gif" + } + return srcStr; +} + +function iconImageSrc() { + if (this.isOpen) + return(this.iconSrc) + else + return(this.iconSrcClosed) +} + +// Definition of class Item (a document or link inside a Folder) +// ************************************************************* + +function Item(itemDescription, itemLink, target) // Constructor +{ + // constant data + this.desc = itemDescription + this.link = itemLink + this.id = -1 //initialized in initalize() + this.navObj = 0 //initialized in render() + this.iconImg = 0 //initialized in render() + this.iconSrc = ICONPATH + "ftv2doc.gif" + this.isRendered = 0 + this.isLastNode = false + this.level = 0 + this.leftSideCoded = "" + this.nChildren = 0 + this.target = target + this.parentObj = null + this.maySelect=true + this.prependHTML = "" + + // methods + this.initialize = initializeItem + this.createIndex = createEntryIndex + this.escondeBlock = escondeBlock + this.esconde = escondeBlock + this.folderMstr = folderMstr + this.renderOb = drawItem + this.totalHeight = totalHeight + this.blockStartHTML = blockStartHTML + this.blockEndHTML = blockEndHTML + this.getID = getID + this.forceOpeningOfAncestorFolders = forceOpeningOfAncestorFolders +} + +function initializeItem(level, lastNode, leftSide) +{ + this.createIndex() + this.level = level + this.leftSideCoded = leftSide + this.isLastNode = lastNode +} + +function drawItem(insertAtObj) +{ + var leftSide = leftSideHTML(this.leftSideCoded) + var docW = "" + + var fullLink = "href=\""+this.link+"\" target=\""+this.target+"\" onClick=\"clickOnLink('"+this.getID()+"\', '"+this.link+"','"+this.target+"');return false;\""; + this.isRendered = 1 + + if (this.level>0) + if (this.isLastNode) //the last 'brother' in the children array + { + leftSide = leftSide + "" + } + else + { + leftSide = leftSide + "" + } + + docW = docW + this.blockStartHTML("item") + + docW = docW + "" + leftSide + "" + if (USEICONS) + docW = docW + "" + "" + "" + else + if (this.prependHTML == "") + docW = docW + "" + + if (WRAPTEXT) + docW = docW + ""+this.prependHTML+"" + else + docW = docW + ""+this.prependHTML+"" + + if (USETEXTLINKS) + docW = docW + "" + this.desc + "" + else + docW = docW + this.desc + + docW = docW + "" + + docW = docW + this.blockEndHTML() + + if (insertAtObj == null) + { + doc.write(docW) + } + else + { + insertAtObj.insertAdjacentHTML("afterEnd", docW) + } + + if (browserVersion == 2) { + this.navObj = doc.layers["item"+this.id] + if (USEICONS) + this.iconImg = this.navObj.document.images["itemIcon"+this.id] + doc.yPos=doc.yPos+this.navObj.clip.height + } else if (browserVersion != 0) { + this.navObj = getElById("item"+this.id) + if (USEICONS) + this.iconImg = getElById("itemIcon"+this.id) + } +} + + +// Methods common to both objects (pseudo-inheritance) +// ******************************************************** + +function forceOpeningOfAncestorFolders() { + if (this.parentObj == null || this.parentObj.isOpen) + return + else { + this.parentObj.forceOpeningOfAncestorFolders() + clickOnNodeObj(this.parentObj) + } +} + +function escondeBlock() +{ + if (browserVersion == 1 || browserVersion == 3) { + if (this.navObj.style.display == "none") + return + this.navObj.style.display = "none" + } else { + if (this.navObj.visibility == "hidden") + return + this.navObj.visibility = "hidden" + } +} + +function folderMstr(domObj) +{ + if (browserVersion == 1 || browserVersion == 3) { + if (t==-1) + return + var str = new String(doc.links[t]) + if (str.slice(14,16) != "em") + return + } + + if (!this.isRendered) + this.renderOb(domObj) + else + if (browserVersion == 1 || browserVersion == 3) + this.navObj.style.display = "block" + else + this.navObj.visibility = "show" +} + +function blockStartHTML(idprefix) { + var idParam = "id='" + idprefix + this.id + "'" + var docW = "" + + if (browserVersion == 2) + docW = "" + else if (browserVersion != 0) + docW = "
      " + + docW = docW + "" + + return docW +} + +function blockEndHTML() { + var docW = "" + + docW = "
      " + + if (browserVersion == 2) + docW = docW + "" + else if (browserVersion != 0) + docW = docW + "
      " + + return docW +} + +function createEntryIndex() +{ + this.id = nEntries + indexOfEntries[nEntries] = this + nEntries++ +} + +// total height of subEntries open +function totalHeight() //used with browserVersion == 2 +{ + var h = this.navObj.clip.height + var i = 0 + + if (this.isOpen) //is a folder and _is_ open + for (i=0 ; i < this.nChildren; i++) + h = h + this.children[i].totalHeight() + + return h +} + + +function leftSideHTML(leftSideCoded) { + var i; + var retStr = ""; + + for (i=0; i" + } + if (leftSideCoded.charAt(i) == "0") + { + retStr = retStr + "" + } + } + return retStr +} + +function getID() +{ + //define a .xID in all nodes (folders and items) if you want to PERVESTATE that + //work when the tree changes. The value eXternal value must be unique for each + //node and must node change when other nodes are added or removed + //The value may be numeric or string, but cannot have the same char used in cookieCutter + if (typeof this.xID != "undefined") + return this.xID + else + return this.id +} + + +// Events +// ********************************************************* + +function clickOnFolder(folderId) +{ + var clicked = findObj(folderId) + + if (!clicked.isOpen) { + clickOnNodeObj(clicked) + } + + if (lastOpenedFolder != null && lastOpenedFolder != folderId) + clickOnNode(lastOpenedFolder); //sets lastOpenedFolder to null + + if (clicked.nChildren==0) { + lastOpenedFolder = folderId; + clicked.isLastOpenedfolder = true + } + + if (isLinked(clicked.hreference)) { + highlightObjLink(clicked); + } +} + +function clickOnNode(folderId) +{ + clickOnNodeObj(findObj(folderId)) +} + +function clickOnNodeObj(folderObj) +{ + var state = 0 + var currentOpen + + state = folderObj.isOpen + folderObj.setState(!state) //open<->close + + if (folderObj.id!=foldersTree.id && PERSERVESTATE) + { + currentOpen = GetCookie("clickedFolder") + if (currentOpen == null) + currentOpen = "" + + if (!folderObj.isOpen) //closing + { + currentOpen = currentOpen.replace(folderObj.getID()+cookieCutter, "") + SetCookie("clickedFolder", currentOpen) + } + else + SetCookie("clickedFolder", currentOpen+folderObj.getID()+cookieCutter) + } +} + +function clickOnLink(clickedId, target, windowName) { + highlightObjLink(findObj(clickedId)); + if (isLinked(target)) { + window.open(target,windowName); + } +} + +function ld () +{ + return document.links.length-1 +} + + +// Auxiliary Functions +// ******************* + +function findObj(id) +{ + var i=0; + var nodeObj; + if (typeof foldersTree.xID != "undefined") { + nodeObj = indexOfEntries[i]; + for(i=0;i= nEntries) + return null; //example: node removed in DB + else + return indexOfEntries[id]; +} + +function isLinked(hrefText) { + var result = true; + result = (result && hrefText !=null); + result = (result && hrefText != ''); + result = (result && hrefText.indexOf('undefined') < 0); + result = (result && hrefText.indexOf('parent.op') < 0); + return result; +} + +// Do highlighting by changing background and foreg. colors of folder or doc text +function highlightObjLink(nodeObj) { + if (!HIGHLIGHT || nodeObj==null || nodeObj.maySelect==false) {//node deleted in DB + return; + } + + if (browserVersion == 1 || browserVersion == 3) { + var clickedDOMObj = getElById('itemTextLink'+nodeObj.id); + if (clickedDOMObj != null) { + if (lastClicked != null) { + var prevClickedDOMObj = getElById('itemTextLink'+lastClicked.id); + prevClickedDOMObj.style.color=lastClickedColor; + prevClickedDOMObj.style.backgroundColor=lastClickedBgColor; + } + + lastClickedColor = clickedDOMObj.style.color; + lastClickedBgColor = clickedDOMObj.style.backgroundColor; + clickedDOMObj.style.color=HIGHLIGHT_COLOR; + clickedDOMObj.style.backgroundColor=HIGHLIGHT_BG; + } + } + lastClicked = nodeObj; + if (PERSERVESTATE) + SetCookie('highlightedTreeviewLink', nodeObj.getID()); +} + +function gFld(description, hreference) +{ + folder = new Folder(description, hreference); + return folder; +} + +function gLnk(optionFlags, description, linkData) +{ + var fullLink = ""; + var targetFlag = ""; + var target = ""; + var protocolFlag = ""; + var protocol = ""; + + if (optionFlags>=0) //is numeric (old style) or empty (error) + { + return oldGLnk(optionFlags, description, linkData) + } + + targetFlag = optionFlags.charAt(0) + if (targetFlag=="B") + target = "_blank" + if (targetFlag=="P") + target = "_parent" + if (targetFlag=="R") + target = "basefrm" + if (targetFlag=="S") + target = "_self" + if (targetFlag=="T") + target = "_top" + + if (optionFlags.length > 1) { + protocolFlag = optionFlags.charAt(1) + if (protocolFlag=="h") + protocol = "http://" + if (protocolFlag=="s") + protocol = "https://" + if (protocolFlag=="f") + protocol = "ftp://" + if (protocolFlag=="m") + protocol = "mailto:" + } + + fullLink = "'" + protocol + linkData + "' target=" + target + + linkItem = new Item(description, protocol+linkData, target) + return linkItem +} + +//Function created Aug 1, 2002 for backwards compatibility purposes +function oldGLnk(target, description, linkData) +{ + var fullLink = ""; + //Backwards compatibility code + if (USEFRAMES) + { + if (target==0) + { + fullLink = "'"+linkData+"' target=\"basefrm\"" + } + else + { + if (target==1) + fullLink = "'http://"+linkData+"' target=_blank" + else + if (target==2) + fullLink = "'http://"+linkData+"' target=\"basefrm\"" + else + fullLink = linkData+" target=\"_top\"" + } + } + else + { + if (target==0) + { + fullLink = "'"+linkData+"' target=_top" + } + else + { + if (target==1) + fullLink = "'http://"+linkData+"' target=_blank" + else + fullLink = "'http://"+linkData+"' target=_top" + } + } + + linkItem = new Item(description, fullLink) + return linkItem +} + +function insFld(parentFolder, childFolder) +{ + return parentFolder.addChild(childFolder) +} + +function insDoc(parentFolder, document) +{ + return parentFolder.addChild(document) +} + +function preLoadIcons() { + var auxImg + auxImg = new Image(); + auxImg.src = ICONPATH + "ftv2vertline.gif"; + auxImg.src = ICONPATH + "ftv2mlastnode.gif"; + auxImg.src = ICONPATH + "ftv2mnode.gif"; + auxImg.src = ICONPATH + "ftv2plastnode.gif"; + auxImg.src = ICONPATH + "ftv2pnode.gif"; + auxImg.src = ICONPATH + "ftv2blank.gif"; + auxImg.src = ICONPATH + "ftv2lastnode.gif"; + auxImg.src = ICONPATH + "ftv2node.gif"; + auxImg.src = ICONPATH + "ftv2folderclosed.gif"; + auxImg.src = ICONPATH + "ftv2folderopen.gif"; + auxImg.src = ICONPATH + "ftv2doc.gif"; +} + +//Open some folders for initial layout, if necessary +function setInitialLayout() { + if (browserVersion > 0 && !STARTALLOPEN) + clickOnNodeObj(foldersTree); + + if (!STARTALLOPEN && (browserVersion > 0) && PERSERVESTATE) + PersistentFolderOpening(); +} + +//Used with NS4 and STARTALLOPEN +function renderAllTree(nodeObj, parent) { + var i=0; + nodeObj.renderOb(parent) + if (supportsDeferral) + for (i=nodeObj.nChildren-1; i>=0; i--) + renderAllTree(nodeObj.children[i], nodeObj.navObj) + else + for (i=0 ; i < nodeObj.nChildren; i++) + renderAllTree(nodeObj.children[i], null) +} + +function hideWholeTree(nodeObj, hideThisOne, nodeObjMove) { + var i=0; + var heightContained=0; + var childrenMove=nodeObjMove; + + if (hideThisOne) + nodeObj.escondeBlock() + + if (browserVersion == 2) + nodeObj.navObj.moveBy(0, 0-nodeObjMove) + + for (i=0 ; i < nodeObj.nChildren; i++) { + heightContainedInChild = hideWholeTree(nodeObj.children[i], true, childrenMove) + if (browserVersion == 2) { + heightContained = heightContained + heightContainedInChild + nodeObj.children[i].navObj.clip.height + childrenMove = childrenMove + heightContainedInChild + } + } + + return heightContained; +} + + +// Simulating inserAdjacentHTML on NS6 +// Code by thor@jscript.dk +// ****************************************** + +if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement){ + HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode) + { + switch (where){ + case 'beforeBegin': + this.parentNode.insertBefore(parsedNode,this) + break; + case 'afterBegin': + this.insertBefore(parsedNode,this.firstChild); + break; + case 'beforeEnd': + this.appendChild(parsedNode); + break; + case 'afterEnd': + if (this.nextSibling) + this.parentNode.insertBefore(parsedNode,this.nextSibling); + else this.parentNode.appendChild(parsedNode); + break; + } + } + + HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr) + { + var r = this.ownerDocument.createRange(); + r.setStartBefore(this); + var parsedHTML = r.createContextualFragment(htmlStr); + this.insertAdjacentElement(where,parsedHTML) + } +} + +function getElById(idVal) { + if (document.getElementById != null) + return document.getElementById(idVal) + if (document.all != null) + return document.all[idVal] + + alert("Problem getting element by id") + return null +} + + +// Functions for cookies +// Note: THESE FUNCTIONS ARE OPTIONAL. No cookies are used unless +// the PERSERVESTATE variable is set to 1 (default 0) +// The separator currently in use is ^ (chr 94) +// *********************************************************** + +function PersistentFolderOpening() +{ + var stateInCookie; + var fldStr="" + var fldArr + var fldPos=0 + var id + var nodeObj + stateInCookie = GetCookie("clickedFolder"); + SetCookie('clickedFolder', "") //at the end of function it will be back, minus null cases + + if(stateInCookie!=null) + { + fldArr = stateInCookie.split(cookieCutter) + for (fldPos=0; fldPos 2) ? argv[2] : null; + //var path = (argc > 3) ? argv[3] : null; + var domain = (argc > 4) ? argv[4] : null; + var secure = (argc > 5) ? argv[5] : false; + var path = "/"; //allows the tree to remain open across pages with diff names & paths + + name = CookieBranding(name) + + document.cookie = name + "=" + escape (value) + + ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) + + ((path == null) ? "" : ("; path=" + path)) + + ((domain == null) ? "" : ("; domain=" + domain)) + + ((secure == true) ? "; secure" : ""); +} + +function ExpireCookie (name) +{ + var exp = new Date(); + exp.setTime (exp.getTime() - 1); + var cval = GetCookie (name); + name = CookieBranding(name) + document.cookie = name + "=" + cval + "; expires=" + exp.toGMTString(); +} + + +//To customize the tree, overwrite these variables in the configuration file (demoFramesetNode.js, etc.) +var USETEXTLINKS = 0 +var STARTALLOPEN = 0 +var USEFRAMES = 1 +var USEICONS = 1 +var WRAPTEXT = 0 +var PERSERVESTATE = 0 +var ICONPATH = '' +var HIGHLIGHT = 0 +var HIGHLIGHT_COLOR = 'white'; +var HIGHLIGHT_BG = 'blue'; +var BUILDALL = 0 + + +//Other variables +var lastClicked = null; +var lastClickedColor; +var lastClickedBgColor; +var indexOfEntries = new Array +var nEntries = 0 +var browserVersion = 0 +var selectedFolder=0 +var lastOpenedFolder=null +var t=5 +var doc = document +var supportsDeferral = false +var cookieCutter = '^' //You can change this if you need to use ^ in your xID or treeID values + +doc.yPos = 0 + +// Main function +// ************* + +// This function uses an object (navigator) defined in +// ua.js, imported in the main html page (left frame). +function initializeDocument() +{ + preLoadIcons(); + switch(navigator.family) + { + case 'ie4': + browserVersion = 1 //Simply means IE > 3.x + break; + case 'opera': + browserVersion = (navigator.version > 6 ? 1 : 0); //opera7 has a good DOM + break; + case 'nn4': + browserVersion = 2 //NS4.x + break; + case 'gecko': + browserVersion = 3 //NS6.x + break; + case 'safari': + browserVersion = 1 //Safari Beta 3 seems to behave like IE in spite of being based on Konkeror + break; + default: + browserVersion = 0 //other, possibly without DHTML + break; + } + + supportsDeferral = ((navigator.family=='ie4' && navigator.version >= 5 && navigator.OS != "mac") || browserVersion == 3); + supportsDeferral = supportsDeferral & (!BUILDALL) + if (!USEFRAMES && browserVersion == 2) + browserVersion = 0; + eval(String.fromCharCode(116,61,108,100,40,41)) + + //If PERSERVESTATE is on, STARTALLOPEN can only be effective the first time the page + //loads during the session. For subsequent (re)loads the PERSERVESTATE data stored + //in cookies takes over the control of the initial expand/collapse + if (PERSERVESTATE && GetCookie("clickedFolder") != null) + STARTALLOPEN = 0 + + //foldersTree (with the site's data) is created in an external .js (demoFramesetNode.js, for example) + foldersTree.initialize(0, true, "") + if (supportsDeferral && !STARTALLOPEN) + foldersTree.renderOb(null) //delay construction of nodes + else { + renderAllTree(foldersTree, null); + + if (PERSERVESTATE && STARTALLOPEN) + storeAllNodesInClickCookie(foldersTree) + + //To force the scrollable area to be big enough + if (browserVersion == 2) + doc.write(" ") + + if (browserVersion != 0 && !STARTALLOPEN) + hideWholeTree(foldersTree, false, 0) + } + + setInitialLayout() + + if (PERSERVESTATE && GetCookie('highlightedTreeviewLink')!=null && GetCookie('highlightedTreeviewLink')!="") { + var nodeObj = findObj(GetCookie('highlightedTreeviewLink')) + if (nodeObj!=null){ + nodeObj.forceOpeningOfAncestorFolders() + highlightObjLink(nodeObj); + } + else + SetCookie('highlightedTreeviewLink', '') + } +} + \ No newline at end of file diff --git a/wxc2_omc/performance/erlangCsta/inc/header.inc b/wxc2_omc/performance/erlangCsta/inc/header.inc new file mode 100755 index 0000000..7f77e13 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/header.inc @@ -0,0 +1,380 @@ +"; + echo "var logon='Please Logon System';"; + echo "alert(logon);"; + echo "window.parent.parent.location.href=\"../../security/logout/logout.php\";"; + echo ""; + exit(); +} + +header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); +header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT"); +header("Cache-Control: no-cache, must-revalidate"); +header("Pragma: no-cache"); + +if($selectedLanguage == 'chn'){ +?> + + + + + + + + +"; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; +} + +function adjust_title_head() +{ + echo "
      "; +} + +function adjust_title_tail() +{ + echo "
      "; +} + +function adjust_content_head() +{ + global $userInfo,$session_timeout; + + echo "
      "; + + $now=time(); + if($now - $userInfo[refresh_time] > $session_timeout) + $userInfo[privilege]=0; + else + $userInfo[refresh_time]=$now; +} + +function adjust_content_tail() +{ + echo "
      "; +} + +//-----------------for frame window----------------------- +function adjust_head_frame($flag="up") +{ + if($flag == "up") + { + echo "
      "; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; + } + else + { + + echo "
      "; + echo ""; + echo "
      "; + //background-color:red; + echo "
      "; + echo ""; + echo "
      "; + } +} + +function adjust_head_small_frame($flag="up") +{ + if($flag == "up") + { + echo "
      "; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; + } + else + { + + echo "
      "; + echo ""; + echo "
      "; + //background-color:red; + echo "
      "; + echo ""; + echo "
      "; + } +} + +function adjust_head_middle_frame($flag="up") +{ + if($flag == "up") + { + echo "
      "; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; + } + else + { + + echo "
      "; + echo ""; + echo "
      "; + //background-color:red; + echo "
      "; + echo ""; + echo "
      "; + } +} + +function adjust_head_noleft_frame($flag="up") +{ + if($flag == "up") + { + echo "
      "; + echo ""; + echo "
      "; + + echo "
      "; + echo ""; + echo "
      "; + } + else + { + + echo "
      "; + echo ""; + echo "
      "; + //background-color:red; + echo "
      "; + echo ""; + echo "
      "; + } +} + +function adjust_title_head_frame($flag="up") +{ + echo "
      "; +} + +function adjust_title_tail_frame($flag="up") +{ + echo "
      "; +} + +function adjust_content_head_frame($flag="up") +{ + global $userInfo,$session_timeout; + + if($flag == "up") + echo "
      "; + else + echo "
      "; + + $now=time(); + if($now - $userInfo[refresh_time] > $session_timeout) + $userInfo[privilege]=0; + else + $userInfo[refresh_time]=$now; +} + +function adjust_content_tail_frame($flag="up") +{ + echo "
      "; +} + +?> diff --git a/wxc2_omc/performance/erlangCsta/inc/language.inc b/wxc2_omc/performance/erlangCsta/inc/language.inc new file mode 100755 index 0000000..6fa151d --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/language.inc @@ -0,0 +1,21 @@ + \ No newline at end of file diff --git a/wxc2_omc/performance/erlangCsta/inc/lib.inc b/wxc2_omc/performance/erlangCsta/inc/lib.inc new file mode 100755 index 0000000..2a8b68f --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/lib.inc @@ -0,0 +1,2309 @@ +"; + return $connection; +} + +function sftp_login($connection,$logName,$logPass) +{ + ssh2_auth_password($connection,$logName,$logPass); + $sftp_key = ssh2_sftp($connection); + return $sftp_key; +} + +define(SFTP_ASCII,0); +define(SFTP_BINARY,1); +function sftp_put($key,$remote_file,$local_file,$mode) +{ + $read_mode="r"; + $write_mode="w"; + if($mode == SFTP_BINARY) + { + $open_mode.="b"; + $write_mode.="b"; + } + $handle=fopen($local_file,$read_mode); + if(!$handle) + { + echo "sftp_put:Can not open $local_file
      "; + return FALSE; + } + + $stream=fopen("ssh2.sftp://{$key}{$remote_file}", $write_mode); + if(!$stream) + { + echo "sftp_put:Can not open $remote_file
      "; + return FALSE; + } + + $content=stream_get_contents($handle); + fwrite($stream,$content); + + fclose($handle); + fclose($stream); + + return TRUE; +} + +function sftp_get($key,$local_file,$remote_file,$mode) +{ + $read_mode="r"; + $write_mode="w"; + if($mode == SFTP_BINARY) + { + $open_mode.="b"; + $write_mode.="b"; + } + $handle=fopen($local_file,$write_mode); + if(!$handle) + { + echo "sftp_put:Can not open $local_file
      "; + return FALSE; + } + + $stream=fopen("ssh2.sftp://{$key}{$remote_file}", $read_mode); + if(!$stream) + { + echo "sftp_put:Can not open $remote_file
      "; + return FALSE; + } + + $content=stream_get_contents($stream); + fwrite($handle,$content); + + fclose($handle); + fclose($stream); + + return TRUE; +} + +function debug_log($file,$info) +{ + $handle=fopen($file,"a+"); + if($handle == false) + return; + fwrite($handle,$info); + fclose($handle); +} + +//**************************************************************** +//函数4 pageAccessChk($pageURL) +//函数说明: +// 检测用户是否可进入本页, +// 如果用户的权限包含$page_url所对应的权限,则可进入该页面。 +// +//变量说明: +// $page_url +// +//返回值: 1 = 可 -1 = 否 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间:2002-03-26 +//修改说明:修改了权限定义方式,该函数改变了大部分 +//NO.2 +//姓名: +//时间:2002-04-09 +//修改说明:修改了权限定义方式,该函数改变了大部分 +//---------------------------------------------------------- + +function pageAccessChk($pageURL) +{ + global $userInfo,$privilegeDefArr,$dirAccessDefArr; + $funcDebug = 0; + $privilege = $userInfo[privilege]; + if(strlen($privilege) > 0){ //判断已登录的用户 + //检查该权限编号是否存在 + $isPass=0; + for($k=0; $k < sizeof($privilegeDefArr); $k++){ + if($privilege == $privilegeDefArr[$k][permit]){ + $isPass=1; + break; + } + } + if($isPass == 0){ + if($funcDebug) echo"
      Invailed privilege"; + return(-1); + } + + + //对比判断该编号对应的权限能否访问该目录 + for($p=0; $p < sizeof($dirAccessDefArr[$privilege]);$p++){ + $tmpDir = $dirAccessDefArr[$privilege][$p]; + $tmpLen = strlen($tmpDir); + if($funcDebug) echo"
      $tmpDir == substr($pageURL,0,$tmpLen)"; + + if( $tmpDir == substr($pageURL,0,$tmpLen) && $tmpLen > 0){ + return(1); + } + } + //找不到,清掉这个无效权限代码 + $userInfo[privilege]=0; + }else{//判断未登录的用户 + for($p=0; $p < sizeof($dirAccessDefArr[0]);$p++){ + $tmpDir = $dirAccessDefArr[0][$p]; + $tmpLen = strlen($tmpDir); + $thisDir=substr($pageURL,0,$tmpLen); + + if($funcDebug) echo"
      $tmpDir == $thisDir"; + if( $tmpDir == $thisDir && $tmpLen > 0){ + return(1); + } + } + } + if($funcDebug) echo"
      ??"; + + return(-1); +} + +//**************************************************************** +//函数5 +// function insertLog($operDesc,$operTypeNo='0',$OperNo='0') +//函数说明: +// 该函数用于记录日志 +// +//变量说明: +// $operDesc ->操作说明 +// $operTypeNo ->操作类型编号 +// $OperNo ->操作代码 +// +//返回值: +// 无 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间:2003-04-09 +//修改说明:简化输入参数,缺省操作类型为unknown +//---------------------------------------------------------- + +function insertLog($operDesc,$operTypeNo='0',$OperNo='0') +{ + global $userInfo,$link,$omc_db; + $userName = $userInfo[ID]; + $operDesc = isset($operDesc) ? stripslashes($operDesc) : ''; //解码 + $operDesc = addslashes($operDesc); //解码 + + $insertLogSql="INSERT INTO sysOperLog + (operTypeNo,OperNo,remark,userName,datetime) + VALUES + ('$operTypeNo','$OperNo','$operDesc','$userName',CURRENT_TIMESTAMP) + "; + //echo "$insertLogSql"; + $result=mysqli_query($pubConn,$insertLogSql); + //echo mysqli_error($pubConn); + if($result < 0){ + echo "Error:Insert the log failed"; + } +} + + +//**************************************************************** +//函数6 +// change_percent($num) +//函数说明: +// 该函数用于把两个数相除后得到的小数变为精确到百分位的百分数 +// 如把0.91233456790变为91.23% +// +//变量说明: +// $num <= 1 +// +//返回值: +// 一个带百分号的字符 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function change_percent($num) + { + if($num >= 1){ + $num=100; + }else{ + $num=$num*1000000; + $num=round($num); + $num=$num/10000; + } + $string=$num.'%'; + return($string); + } + +//**************************************************************** +//函数7 +// omc_keep_length($value,$add_value='0',$length='2',$position='1') +//函数说明: +// 该函数用于在字符串$value左边添$add_value,直到补足所需位数$length +// 例如:omc_keep_length(2,0,2)变为02 +// 常用于获取系统编号。 +// +//变量说明: +// $value 需要补足位数的字符 +// $add_value 需要用什么去补足位数,默认为'0' +// $length 需要补足到多少位,默认为'2'系统编号的长度 +// +//返回值: +// 被补足位数的字符串 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function omc_keep_length($value,$add_value='0',$length='2',$position='1') + { + + while(strlen($value) < $length){ + if($position) + $value = $add_value.$value; + else + $value = $value.$add_value; + + } + //echo "
      value=$value"; + return ($value); + } + + +//**************************************************************** +//函数8 +// omc_table_name($sys_type,$table_type) +//函数说明: +// 该函数通过$sys_type,$table_type生成该系统的各种相关表名 +// 根据$sys_id确定系统编号 +// 根据$table_type确定要返回的表名: +// 1、csta-h -->(每小时)话务统计表 +// 2、csta-q -->(每15分钟)话务统计表 +// +// +// +//变量说明: +// $sys_type 需要获取表名的系统 +// $table_type 该表名的类型字符串 +// +//返回值: +// 所需的表名字符串 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function omc_table_name($sys_type,$table_type) + { + switch($table_type){ + case 'csta-h': + $sys_type=strtolower($sys_type); + $table_name=$sys_type.'Sum'; + break; + case 'csta-q': + $sys_type=strtolower($sys_type); + $table_name=$sys_type.'Detail'; + break; + default: + echo "
      database's table name can not be maked,please check table type"; + break; + } + if($table_name){ + return($table_name); + }else{ + exit(); + } + } + + +//**************************************************************** +//函数9 +// omc_sys_type2code($sys_type) +//函数说明: +// 由系统简写获取系统编号,通过查询系统定义表$sysconf_table获取 +// 例:omc_sys_type2code(TS) = '04' +// +//变量说明: +// $sys_type +// +//返回值: +// 成功: 系统编号 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function omc_sys_type2code($sysTypeName) +{ + global $omc_db,$sysconf_table; + $sel_sql = "SELECT sysTypeNo FROM $sysconf_table WHERE sysTypeName = '$sysTypeName'"; + //echo "
      $sel_sql"; + $result = mysqli_query($pubConn,$sel_sql); + if($result > 0){ + $result_rows = mysqli_fetch_array($result); + //echo "
      result_rows[sysTypeNo]=$result_rows[sysTypeNo]"; + return($result_rows[sysTypeNo]); + }else{ + echo mysqli_error($pubConn); + echo "
      Can not get this device's code by omc_sys_type2code($sysTypeName)"; + return(-1); + } + } + + + +//**************************************************************** +//函数10 +// omc_sys_code2type($sys_code) +//函数说明: +// 由系统编号获取系统简写,通过查询系统定义表$sysconf_table获取 +// +// +//变量说明: +// $sys_code +// +//返回值: +// 成功: 系统简写 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function omc_sys_code2type($sysTypeNo) +{ + global $omc_db,$sysconf_table; + $sel_sql = "SELECT sysTypeName FROM $sysconf_table WHERE sysTypeNo = '$sysTypeNo'"; + //echo "$sel_sql"; + $result = mysqli_query($pubConn,$sel_sql); + if($result > 0){ + $result_rows = mysqli_fetch_array($result); + return($result_rows[sysTypeName]); + }else{ + echo mysqli_error($pubConn); + echo "
      Can not get this device's code by omc_sys_code2type($sysTypeNo)"; + return(-1); + } + +} + + +//**************************************************************** +//函数11 +// get_subsys_total($sys_type) +//函数说明: +// 由系统类型获取系统每个系统的子系统总数,通过查询系统定义表$sysconf_table获取 +// +// +//变量说明: +// $sys_type:系统类型 +// +//返回值: +// 成功: 系统子系统个数 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function get_subsys_total($sys_type) +{ + global $omc_db,$sysconf_table; + $sel_sql = "SELECT maxSubsysNum FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + $result = mysqli_query($pubConn,$sel_sql); + if($result > 0){ + $result_rows = mysqli_fetch_array($result); + return($result_rows[maxSubsysNum]); + }else{ + echo mysqli_error($pubConn); + echo "
      Can not get this system's subsystem quantity by get_subsys_total($sys_type)"; + return(-1); + } +} + +//**************************************************************** +//函数12 +// get_e1_total($sys_type) +//函数说明: +// 由系统类型获取系统每个系统的e1总数,通过查询系统定义表$sysconf_table获取 +// +// +//变量说明: +// $sys_type:系统类型 +// +//返回值: +// 成功: 系统子系统个数 +// 失败: -1 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function get_e1_total($sys_type) +{ + global $omc_db,$sysconf_table; + $sel_sql = "SELECT maxE1Num FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + //echo "
      sel_sql=$sel_sql"; + $result = mysqli_query($pubConn,$sel_sql); + if($result > 0){ + $result_rows = mysqli_fetch_array($result); + return($result_rows[maxE1Num]); + }else{ + echo mysqli_error($pubConn); + echo "
      Can not get this system's e1 quantity by get_e1_total($sys_type)"; + return(-1); + } +} + +//**************************************************************** +//函数13 +// get_sys_total($sys_type) +//函数说明: +// 由系统类型获取系统系统总数,通过查询系统定义表$sysconf_table获取 +// +// +//变量说明: +// $sys_type:系统类型 +// +//返回值: +// 成功: 系统总数 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: 2002-5-14 +//修改说明: 表名、字段有变 +//---------------------------------------------------------- +function get_sys_total($sys_type) +{ + global $omc_db,$sysconf_table; + $sel_sql = "SELECT maxSysNum FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + //echo "
      sel_sql=$sel_sql"; + $result = mysqli_query($pubConn,$sel_sql); + if($result > 0){ + $result_rows = mysqli_fetch_array($result); + return($result_rows[maxSysNum]); + }else{ + echo mysqli_error($pubConn); + echo "
      Can not get this system's system quantity by get_sys_total($sys_type)"; + return(-1); + } +} + +//**************************************************************** +//函数14 +// get_sys_offset($sys_type) +//函数说明: +// 由系统类型获取该类系统的顺序编号offset,通过查询系统定义表$sysconf_table获取 +// +// +//变量说明: +// $sys_type :系统类型 +// +//返回值: +// 成功: 系统顺序编号 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function get_sys_offset($sys_type) +{ + global $omc_db,$sysconf_table; + $sel_sql = "SELECT ledOffset FROM $sysconf_table WHERE sysTypeName = '$sys_type'"; + $result = mysqli_query($pubConn,$sel_sql); + if($result > 0){ + $result_rows = mysqli_fetch_array($result); + return($result_rows[0]); + }else{ + echo mysqli_error($pubConn); + echo "
      Can not get this system's offset by get_sys_offset($sys_type)"; + return(-1); + } + +} + +//**************************************************************** +//函数15 +// omc_sys_id_info($sys_id,$info_type) +//函数说明: +// 该函数通过$sys_id的分析,取得相应信息 +// 例:由 "TS00_01" 可得系统编号为"00" +// +//变量说明: +// 参数$info_type对应要取得的信息 +// sys_type -->系统类型 +// sys_num -->系统编号 +// subsys_num -->子系统编号 +// led_num -->led offset +// +//返回值: +// 成功: 要取得的信息 +// 失败: -1 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function omc_sys_id_info($sys_id,$info_type) +{ + global $sysconf_table,$omc_db; + $db=$omc_db; + $pieces=explode('_',$sys_id); + $sys_type=$pieces[0]; + $sys_num=$pieces[1]; + $subsys_num=$pieces[2]; + //echo "
      sys_type=$sys_type"; + + switch($info_type){ + case 'sys_type': + $info=$sys_type; + break; + case 'sys_num': + $info=$sys_num; + break; + case 'subsys_num': + $info=$subsys_num; + break; + case 'led_num': + $sysTypeNo=omc_sys_type2code($sys_type); + $ledSql = " SELECT ledOffset FROM $sysconf_table WHERE sysTypeNo = '$sysTypeNo' "; + $ledRes = @mysqli_query($pubConn,$ledSql); + $ledRow = @mysqli_fetch_array($ledRes); + $info = $ledRow[0]; + break; + default: + echo "
      the $sys_id information can not be get,please check parameter: info_typ!"; + break; + } + if($info){ + return($info); + }else{ + return(0); + } +} + +//**************************************************************** +//函数16 +// omc_uninstall_device($sys_id) +//函数说明: +// 删除系统 +// +//变量说明: +// 删除系统的系统编号$sys_id +// +//返回值: +// 成功: 1 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间:2002-5-17 +//修改说明: +//---------------------------------------------------------------------------------- + +function omc_uninstall_device($sys_id) +{ + global $omc_db,$sysStat_table; + //echo "
      sys_id=$sys_id"; + $sysType=omc_sys_id_info($sys_id,sys_type); + $sysTypeNo=omc_sys_type2code($sysType); + $sysNo=omc_sys_id_info($sys_id,sys_num); + $subSysNo=omc_sys_id_info($sys_id,subsys_num); + $del_sql="DELETE FROM $sysStat_table WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo'"; + + if($sys_id='all') + { + $del_sql=" DELETE FROM $sysStat_table "; + } + //echo "
      del_sql=$del_sql"; + $result=mysqli_query($pubConn,$del_sql); + //echo "
      result=$result"; + if($result){ + return(1); + }else{ + return(-1); + } + +} + +//**************************************************************** +//函数17 +// omc_chk_load_in($file_info,$remark_style) +//函数说明: +// 导入文件检查函数 +// 根据需导入文件的信息(包括文件名,需导入的服务器,数据库,表),导入文件的注释信息(指出该文的字段名列表所在行) +// 方法:一一比较数据库中表的字段和注释中列出的字段,如果互相匹配,返回成功 +// +//变量说明: +// $file_info 所需导入文件的信息数组,包括: +// $file_info[db] 所需导入的数据库名 +// $file_info[table] 所需导入的数据库中的表名 +// $file_info[name] 所需导入数据库的文件名 +// $remark_style 数据文件注释风格 +// $remark_style[fields_seek] 文件开头,需要忽略的行数,一般为1 +// $remark_style[sign] 注释符,一般为'#' +// $remark_style[fields_by] 字段分割符,一般为';' + +// +//返回值: +// 成功: 1 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function omc_chk_load_in($file_info,$remark_style) +{ + //-------------1.get database's information--------------- + global $link; + $field_sql="SELECT * FROM {$file_info[table]} LIMIT 0,1"; + //echo "
      field_sql=$field_sql"; + $field_result=mysqli_query($pubConn,$field_sql); + + //-------------check the data file's fields------------- + //echo "
      name={$file_info[name]}"; + $fp=fopen($file_info[name],r); + for($i=1;$i <= $remark_style[fields_seek]; $i++){ + $field_line=fgets($fp,4096); //4096 is a constant + } + //echo "
      field_line=$field_line"; + if(substr($field_line,0,1) != $remark_style[sign]){ + echo "the remark sign not exist"; //注释符错误 + return(-1); + }else{ + //echo "
      field_line=$field_line"; + $file_fields_line=substr($field_line,1); + //echo "
      file_fields_line=$file_fields_line"; + $file_fields_rows=explode($remark_style[fields_by],$file_fields_line); + $fields_num=mysql_num_fields($field_result); + //echo "
      fields_num=$fields_num"; + for($i=0; $i < $fields_num; $i++){ + $this_field=mysql_field_name($field_result,$i); + //echo "
      $file_fields_rows[$i] -- $this_field"; + if($file_fields_rows[$i] != $this_field && $this_field !=''){ + echo "
      error: fields is not matching.";//字段名不匹配 + return(-1); + } + } + fclose($fp); + return(1); + } +} + + +//******************************************************************* +//函数18 +// Get the content of $table as a CSV output. +// $sep contains the separation string. +// After every row, a custom callback function $handler gets called. +// $handler must accept one parameter ($sql_insert); + +function get_table_csv($server_link,$db_name, $table, $where, $handler) +{ + global $separator; + + $sep=$separator; + if(strlen($where) > 1){ + $sel_sql="SELECT * FROM $table $where"; + $sel_sql=stripslashes($sel_sql); + }else{ + $sel_sql="SELECT * FROM $table "; + } + //echo "
      sel_sql=$sel_sql
      "; + $result = mysqli_query($pubConn, $sel_sql, $server_link); + if($result < 0){ + echo "$sel_sql /n"; + echo mysqli_error($pubConn); + exit(); + } + + /* + //输出字段名 + $schema_insert = "#"; + for($j=0; $jschema_insert=$schema_insert
      "; + } + $handler(trim($schema_insert));//按某种方式处理后,输出一行 + */ + + $i = 0; + while($row = mysqli_fetch_row($result)) + { + set_time_limit(60); // HaRa + $schema_insert = ""; + for($j=0; $j$warning_words"; + exit(); +} + + + + + +//**************************************************************** +//函数20 +// change2point($number) +//函数说明: +// 将该数字按保留小数点后两位的规则转换,常用于货币的统一标示 +// +//变量说明: +// $number ->所需转换的数字 +// +//返回值: +// 成功: 返回转换后的字符 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间:2003-07-10 +//修改说明:干了蠢事,一句话的事,用了一个函数。 +//---------------------------------------------------------- + +function change2point($number) +{ + /* + $num = explode(".",$number); + $num_1 = $num[0]; + $num_2 = substr($num[1],0,2); + if(strlen($num_2) < 2){ + if(strlen($num_2) == 0){ + $num_2 = '00'; + }else{ + $num_2 = $num_2.'0'; + } + } + if($num_1==0 && $num_2 == 0){ + $number = 0; + }else{ + $number = $num_1.'.'.$num_2; + } + */ + $number=sprintf ("%01.2f", $number); + return($number); +} + +//**************************************************************** +//函数21 +// Second2format($number) +//函数说明: +// 把秒数变成标准时间显示如:17秒->00:00:17 +// +//变量说明: +// $number 秒数 +// +//返回值: +// 成功: 返回标准时间 +// 失败: 返回0 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +// +function Second2format($number) +{ + if($number>0){ + $number_h=floor($number/3600); + if(strlen($number_h)<2){ + $number_h="0".$number_h; + } + $number_ms=$number%3600; + $number_m=floor($number_ms/60); + if(strlen($number_m)<2){ + $number_m="0".$number_m; + } + $number_s=$number_ms%60; + if(strlen($number_s)<2){ + $number_s="0".$number_s; + } + $format=$number_h.":".$number_m.":".$number_s; + return($format); + }else{ + return(0); + } +} + +//**************************************************************** +//函数22 +// getDetailedStatus($sysTypeNo,$sysNo,$subSysNo,$getType) +// 得到详细状态信息或刷新时间 +// +//变量说明: +// $sysTypeNo系统类型编号 +// $sysNo系统编号 +// $subSysNo子系统编号 +// $getType详细状态(status)或刷新时间(time) +// +//返回值: +// 成功: 返回状态或时间 +// 失败: 返回-1 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +// +function getDetailedStatus($sysTypeNo,$sysNo,$subSysNo,$getType='time') +{ + global $omc_db,$sysStat_table; + $db=$omc_db; + $DEBUG=0; + $sel_mes_sql="SELECT detailStat,updateTime FROM $sysStat_table + WHERE + sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + "; + if($DEBUG)echo "
      sel_mes_sql=$sel_mes_sql"; + $sel_mes_res = mysqli_query($pubConn,$sel_mes_sql); + $sel_mes_row = @mysqli_fetch_array($sel_mes_res); + if($getType=='Time'){ + $value=$sel_mes_row[detailStat]; + }else{ + $value=$sel_mes_row[updateTime]; + } + if($DEBUG)echo "
      value=$value"; + if(!$sel_mes_row){ + return(-1); + }else{ + return($value); + } +} + + +//**************************************************************** +//函数23 omc_get_sysAlias($sysTypeNo,$sysNo,$subSysNo) +// +//功能说明:根据指定系统编号获取系统别名 +// +//变量说明: +// +//返回值: +// 成功: 系统别名字符串 +// 失败:-1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function omc_get_sysAlias($sysTypeNo,$sysNo,$subSysNo) +{ + $sysAliasSql = "SELECT sysAlias + FROM sysInfo + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo'AND subSysNo='$subSysNo' + ORDER BY sysTypeNo,sysNo,subSysNo + "; + $sysAliasResult = mysqli_query($pubConn,$sysAliasSql); + echo mysqli_error($pubConn); + $sysAliasRows = @mysqli_fetch_array($sysAliasResult); + $sysAlias=$sysAliasRows[sysAlias]; + if(strlen($sysAlias) > 0){ + return($sysAlias); + }else{ + return(-1); + } +} + + +//**************************************************************** +//函 数 名: omcProgressBar($allNum,$doneNum) +//功能说明: 显示进度条 +//变量说明: $allNum总数,$doneNum已完成的数目 +//返 回 值: 无 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function omcProgressBar($allNum,$doneNum) +{ + if($allNum > 0){ + if($doneNum >= $allNum){ + $quoNum = 100; + }else{ + $quoNum = $doneNum / $allNum * 100; + $quoNum = round($quoNum); + } + }else{ + echo "omcProgressBar() Error:allNum cannot < 0!"; + exit(); + } + $big_width=320; + $border=10; + $lit_width=$big_width - 2 * $border; + $height=10; + echo "
      "; + echo "\n"; + echo "
      "; + echo "$strProgressIsShowedAsFollowing"; + echo "
      "; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n

      "; + echo "\n$quoNum%"; + echo "\n

      "; + $lineNum = $quoNum*3; + echo "\n"; + echo "\n
      "; + //echo "\n
      "; +} + + +//**************************************************************** +//函 数 名: sysCommSend($sysId,$commType,$objIdStr,$selectedSysId=-1) +//功能说明: 系统参数维护发送命令 +//变量说明: 略 +//返 回 值: +// 成功: 命令编号字符串 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名:cuiticun +//时间:2005-7-13 +//修改说明:check the exist command num in the buffer +//---------------------------------------------------------- +function sysCommSend($sysId,$commType,$objIdStr,$selectedSysId=-1,$selectedDPC=0) +{ + //global $pubDb,$commTable; + $DEBUG = 0; + $pubDb = 'OMC_PUB'; + $commTable = 'parameterComm'; + $nGetComm = 0; + $nSetComm = 3; + + $nSubSysParam = 0; + $nGlobalSubSysParam = 1; + $nGlobalSysParam = 2; + + $sysIdArr = explode('_',$sysId); + $sysTypeNo = $sysIdArr[0]; + $sysNo = $sysIdArr[1]; + $subSysNo = $sysIdArr[2]; + + //insert the operation log into the database + $logStr=""; + if($commType==0) + $logStr.="Get "; + else if($commType==3) + $logStr.="Set "; + //=====get the LevelWhere + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + $temp=$levelWhere; + + $database="OBJ_".$sysTypeNo; + $ssql="select name_2 from paramConf where $temp "; + $resultt=@mysqli_query($pubConn,$ssql); + $rowss=@mysqli_fetch_array($resultt); + //==get the parameter name + $p_name=$rowss[name_2]; + + $p_name=str_replace("Entry","",$p_name); + $sysName=getSystemNameBySysTypeNo($sysTypeNo); + $logStr.="$sysName $p_name's parameter"; + + $logStr.=$p_name; + + insertLog($logStr); + //end insert operation log + + if($sysNo == '99'){ + $paramType = $nGlobalSysParam; + }else if($subSysNo == '99'){ + $paramType = $nGlobalSubSysParam; + }else{ + $paramType = $nSubSysParam; + } + + if($selectedSysId != -1){ + $selectedSysIdArr = explode('_',$selectedSysId); + $selectedSysTypeNo = $selectedSysIdArr[0]; + $selectedSysNo = $selectedSysIdArr[1]; + $selectedSubSysNo = $selectedSysIdArr[2]; + } + if($DEBUG) echo"
      selectedSysId=$selectedSysId"; + if($DEBUG) echo"
      selectedSysNo=$selectedSysNo"; + if($DEBUG) echo"
      selectedSubSysNo=$selectedSubSysNo"; + + //step 1: delete overtime and imcompetent command , check the exist command num + $overTime = date("Y-m-d H:i:s", mktime(date("H"),date("i")-1,date("s"),date("m"),date("d"),date("Y"))); + $delSql = "DELETE FROM $commTable + WHERE commState ='0' OR commState ='3' OR sendTime < '$overTime' + "; + if($DEBUG) echo"
      delete command sql = $delSql"; + mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + + //check the exist command num + $chkSql = "SELECT commId FROM $commTable"; + if($DEBUG) echo"
      check exist commands sql = $chkSql"; + $chkResult = mysqli_query($pubConn,$chkSql); + echo mysqli_error($pubConn); + $existNum = @mysqli_num_rows($chkResult); + + //step 2: check the command(不能同时操作同一个子系统,也不能同时读同一个系统的不同子系统的公共参数) + if(($paramType != $nSubSysParam) && ($commType == $nGetComm)){ //0=Get,2=response,3=Set + if($selectedSysId == -1){ + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND commType ='$nGetComm' + "; + }else{ + //选择指定子系统 + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$selectedSysTypeNo' AND sysNo='$selectedSysNo' + AND subSysNo='$selectedSubSysNo' AND commType ='$nGetComm' + "; + } + }else{ + $chkSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo' + "; + } + if($DEBUG) echo"
      check command sql = $chkSql"; + $chkResult = mysqli_query($pubConn,$chkSql); + echo mysqli_error($pubConn); + $rowsNum = @mysqli_num_rows($chkResult); + if($rowsNum > 0){ + echo ""; + return(-1); + } + + //step 3:insert commands into command table + if(($paramType != $nSubSysParam) && ($commType == $nSetComm)){ //写公共参数 + //get maxSubSysNum + //$selSql="SELECT maxSysNum, maxSubSysNum FROM sysConf WHERE sysTypeNo = '$sysTypeNo'"; + //$selResult=mysqli_query($pubConn,$selSql); + //$selRows=mysqli_fetch_array($selResult); + //echo mysqli_error($pubConn); + //$maxSysNum = $selRows[maxSysNum]; + //$maxSubSysNum = $selRows[maxSubSysNum]; + if($selectedSysId == -1){ + if($paramType == $nGlobalSysParam){ + if($sysTypeNo[0] == '2'){ + if($sysTypeNo == '222' || $sysTypeNo == '223'){//MTP3,SCCP + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo!='8' AND sysNo!='11' + AND DPC = '$selectedDPC' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + }else{ + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + AND DPC = '$selectedDPC' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + + }else{ + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + }else{ + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + } + }else{ + //选择指定子系统 + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$selectedSysTypeNo' + AND sysNo ='$selectedSysNo' + AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC + "; + } + if($DEBUG) { + echo"
      selSql=$selSql"; + exit(); + } + $selResult = mysqli_query($pubConn,$selSql); + $selRowsNum = mysqli_num_rows($selResult); + + if($selRowsNum+$existNum>64){ + echo ""; + return(-1); + } + + if($selRowsNum > 0){ + while($selRows = mysqli_fetch_array($selResult)){ + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + }else{ + echo "
      Error:This canot get this system's IP"; + return(-1); + } + //写VPS 或PCR 参数 + /* + }elseif(($sysTypeNo == 120 || $sysTypeNo == 130 || $sysTypeNo == 140) && ($commType == $nSetComm)){ + $tmpLevelOne = $sysNo + 1; + $tmpLevelTwo = $subSysNo + 1; + switch($sysTypeNo){ + case 120: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.7.2.1'; + break; + case 130: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.6.2.1'; + break; + case 140: + $sysParamOidPrefix=$tmpLevelOne.'.'.$tmpLevelTwo.'.8.2.1'; + break; + default: echo "error sysTypeNo"; + exit(); + } + if($DEBUG) echo"
      strstr($objIdStr, $sysParamOidPrefix)"; + + if(strstr($objIdStr, $sysParamOidPrefix)){//写VPS 或PCR的公共参数 + //get maxSubSysNum + $selSql="SELECT maxSubSysNum FROM sysConf WHERE sysTypeNo = '$sysTypeNo'"; + $selResult=mysqli_query($pubConn,$selSql); + $selRows=mysqli_fetch_array($selResult); + echo mysqli_error($pubConn); + $maxSubSysNum = $selRows[maxSubSysNum]; + //get alive system + $selSql="SELECT DISTINCT subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysNo,subSysNo,baseStat DESC + "; + $selResult = mysqli_query($pubConn,$selSql); + $selRowsNum = mysqli_num_rows($selResult); + if($selRowsNum > 0){ + while($selRows = mysqli_fetch_array($selResult)){ + $subSysNo = $selRows[subSysNo]; + $tmpLevelOne = $sysNo + 1; + $tmpLevelTwo = $subSysNo + 1; + $tmpOidLen = strlen($objIdStr); + $tmpSubfixOid = substr($objIdStr,3,$tmpOidLen); + $objIdStr = $tmpLevelOne.'.'.$tmpLevelTwo.$tmpSubfixOid; + if($DEBUG) echo"
      VPS OR PCR'S system parameter Oid:$objIdStr"; + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','0','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + }else{ + echo "
      Error:This canot get this system's IP"; + return(-1); + } + }else{//写VPS,PCR子系统参数 + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','0','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + */ + }else{//读系统/子系统参数或写子系统参数 + if($paramType != $nSubSysParam){//读公共参数 + if($selectedSysId == -1){ + //get baseStat 0=uninstalled, 1=nomal, 2=warning, 3=error + //先按状态排序,再按系统编号,子系统编号排序,同种状态优先选择编号小的 + if($paramType == $nGlobalSysParam){ + /*if($sysTypeNo == '222' || $sysTypeNo == '223'){//MTP3,SCCP + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + AND DPC = '$selectedDPC' + ORDER BY baseStat DESC,updateTime DESC,sysNo DESC,subSysNo + "; + }else{ + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + }*/ + + if($sysTypeNo[0]=='2'){//Platform + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='9' + ORDER BY baseStat DESC,sysNo DESC,subSysNo,updateTime DESC + "; + }else{ + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + }else{ + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$sysNo' + ORDER BY baseStat DESC,updateTime DESC,sysNo,subSysNo + "; + } + }else{ + //选择指定子系统 + $selSql="SELECT sysNo,subSysNo FROM sysInfo + WHERE sysTypeNo = '$sysTypeNo' AND sysNo='$selectedSysNo' AND subSysNo='$selectedSubSysNo' + ORDER BY baseStat DESC,updateTime DESC + "; + } + + $selResult=mysqli_query($pubConn,$selSql); + if($DEBUG) { + echo"
      get system info sql = $selSql"; + } + echo mysqli_error($pubConn); + if(@mysqli_num_rows($selResult) > 0){ + $selRows = @mysqli_fetch_array($selResult); + $sysNo = $selRows[sysNo]; + $subSysNo = $selRows[subSysNo]; + }else{ + echo ""; + return(-1); + } + } + // special for sccp and mtp3 add by lilong 2004-6-11 + if($selectedSysId == -1){ + $DEBUG = 0; + if($DEBUG) echo "sysTypeNo = $sysTypeNo, sysNo = $sysNo
      "; + if ( ($sysTypeNo == '222' || $sysTypeNo == '223') && ('8' != $sysNo) && ('11'!=$sysNo) ){//MTP3,SCCP + $selSql_1 = "SELECT sysNo,subsysNo FROM sysInfo + WHERE baseStat=1 AND sysTypeNo=320"; + if($DEBUG) echo "selSql_1 = $selSql_1
      "; + $selRes_1 = mysqli_query($pubConn,$selSql_1); + if (mysqli_num_rows($selRes_1) > 0){ + $selRows_1 = @mysqli_fetch_array($selRes_1); + $sysNo = 9; + $subSysNo = $selRows_1[sysNo]; + }else{ + $selSql_2 = "SELECT sysNo,subsysNo FROM sysInfo + WHERE baseStat=1 AND sysTypeNo=0"; + if($DEBUG) echo "selSql_2 = $selSql_2
      "; + $selRes_2 = mysqli_query($pubConn,$selSql_2); + if (mysqli_num_rows($selRes_2) > 0){ + $selRows_2 = @mysqli_fetch_array($selRes_2); + $sysNo = 0; + $subSysNo = $selRows_2[subsysNo]; + } + } + } + if($DEBUG) { + echo "sysNo=$sysNo, subSysNo=$subSysNo
      "; + exit(); + } + $DEBUG = 0; + //add end by lilong 2004-6-11 + } + + if(1+$existNum>64){ + echo ""; + return(-1); + } + + $sendSql="INSERT INTO $commTable + (commType,sysTypeNo,sysNo,subSysNo,paramType,objId,InstanceNo,commState,sendTime) + VALUES + ('$commType','$sysTypeNo','$sysNo','$subSysNo','$paramType','$objIdStr','','1',CURRENT_TIMESTAMP) + "; + if($DEBUG) echo"
      send command sql = $sendSql"; + $sendResult=mysqli_query($pubConn,$sendSql); + echo mysqli_error($pubConn); + } + + //step 4:Return commIdStr + if($DEBUG) echo"
      if(($paramType != $nSubSysParam) && ($commType == $nSetComm))"; + if(($paramType != $nSubSysParam) && ($commType == $nSetComm)){ + if($paramType == $nGlobalSysParam){ + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + }else{ + $selSql = "SELECT commId FROM $commTable + WHERE paramType='$paramType' AND sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + } + /* + //写VPS 或PCR 参数 + }elseif(($sysTypeNo == 120 || $sysTypeNo == 130 || $sysTypeNo == 140) && ($commType == $nSetComm)){ + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' + ORDER BY sysTypeNo,sysNo,subSysNo"; + */ + }else{ + $selSql = "SELECT commId FROM $commTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND subSysNo='$subSysNo'" + ; + } + if($DEBUG) echo"
      get command id sql = $selSql"; + $selResult=mysqli_query($pubConn,$selSql); + echo mysqli_error($pubConn); + $commIdStr=''; + while($selRows = mysqli_fetch_array($selResult)){ + $commIdStr .= $selRows[commId].'-'; + } + if($DEBUG) echo "
      commIdStr = $commIdStr"; + if($DEBUG) exit(); + return($commIdStr); +}//end of function sysSendComm() + +//**************************************************************** +//函 数 名: setSysParamValue($sysId,$objIdStr,$instanceNo,$newValue) +//功能说明: 修改设备参数的initValue,为发送命令做准备 +//变量说明: 略 +//返 回 值: +// 成功: 命令编号字符串 +// 失败: -1 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function setSysParamValue($sysId,$objIdStr,$instanceNo,$newValue) +{ + global $paramConf_table; + $DEBUG=0; + + if($DEBUG) echo"
      sysId=$sysId"; + $tmpSysIdArr = explode('_',$sysId); + $sysTypeNo = $tmpSysIdArr[0]; + $sysNo = $tmpSysIdArr[1]; + $subSysNo = $tmpSysIdArr[2]; + + $paramDb = 'OBJ_'.$sysTypeNo; + if($DEBUG) echo"
      paramDb=$paramDb"; + //获取参数定义表的表名,根据oid取出参数定义 + $tmpObjArr = explode('.',$objIdStr); + $objWhereStr=''; + for($i=0;$i$getParamDefSql"; + $getParamDefResult=mysqli_query($pubConn,$getParamDefSql); + echo mysqli_error($pubConn); + if(mysqli_num_rows($getParamDefResult) <= 0){ + echo "Cannot find this objId from paramConf"; + return(-1); + } + $getParamDefRows=mysqli_fetch_array($getParamDefResult); + $paramType = $getParamDefRows[paramType]; + + //根据参数类型,推出参数表的表名 + if($paramType == 2){ + $paramTable = 'param_99'; + }else{ + $paramTable = 'param_'.$sysNo; + } + if($paramType != 0){ + $subSysNo = '99'; + } + + //修改对应的参数值 + $setParamValueSql="UPDATE $paramTable + SET initValue='$newValue',readValue='' + WHERE subSysNo = '$subSysNo' AND instanceNo = '$instanceNo' + AND $objWhereStr + "; + if($DEBUG) echo"
      $setParamValueSql
      "; + $setResult=mysqli_query($pubConn,$setParamValueSql); + echo mysqli_error($pubConn); + if($setResult){ + return(1); + }else{ + return(-1); + } +}//end of function setSysParamValue + +//**************************************************************** +//函 数 名: getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName) +//功能说明: 获取指定的设备参数 +//变量说明: 略 +//返 回 值: +// 成功: 参数值 +// 失败: exit()退出 +// +// +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function getSysParamValue($sysId,$objIdStr,$instanceNo,$valueName) +{ + global $paramConf_table; + $DEBUG=0; + + $tmpSysIdArr = explode('_',$sysId); + $sysTypeNo = $tmpSysIdArr[0]; + $sysNo = $tmpSysIdArr[1]; + $subSysNo = $tmpSysIdArr[2]; + + $paramDb = 'OBJ_'.$sysTypeNo; + //获取参数定义表的表名,根据oid取出参数定义 + $tmpObjArr = explode('.',$objIdStr); + $objWhereStr=''; + for($i=0;$i$getParamDefSql"; + $getParamDefResult=mysqli_query($pubConn,$getParamDefSql); + echo mysqli_error($pubConn); + if(@mysqli_num_rows($getParamDefResult) <= 0){ + echo "Cannot find this objId from paramConf"; + return(-1); + } + $getParamDefRows=mysqli_fetch_array($getParamDefResult); + $paramType = $getParamDefRows[paramType]; + + //根据参数类型,推出参数表的表名 + if($paramType == 2){ + $paramTable = 'param_99'; + }else{ + $paramTable = 'param_'.$sysNo; + } + if($paramType != 0){ + $subSysNo = '99'; + } + + //修改对应的参数值 + $getParamValueSql="SELECT $valueName FROM $paramTable + WHERE subSysNo = '$subSysNo' AND instanceNo = '$instanceNo' + AND $objWhereStr + "; + if($DEBUG) echo"
      $getParamValueSql
      "; + $getResult=mysqli_query($pubConn,$getParamValueSql); + echo mysqli_error($pubConn); + if(mysqli_num_rows($getResult) > 0){ + $paramRows = mysqli_fetch_array($getResult); + $paramValue = $paramRows[0]; + return($paramValue); + }else{ + return(-1); + } +}//end of function getSysParamValue + +//**************************************************************** +//函数8 +// getMoneyPara() +//函数说明: +// 该函数通过查询PPS系统配置得到显示的货币单位是最小货币单位的倍数 +// +// +// +// +//变量说明: +// 无 +// +// +//返回值: +// 显示的货币单位是最小货币单位的倍数 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function getMoneyPara() + { + global $omc_db; + $getSql = " SELECT pubVarValue FROM omcPubVarConf WHERE pubVarName='pssCardMinCount'"; + $getRes = @mysqli_query($pubConn,$getSql); + $getRow = @mysqli_fetch_array($getRes); + echo mysqli_error($pubConn); + $multiple = $getRow[pubVarValue]; + /* + if($multiple < 0.1) + { + $multiple = 100; + } + elseif($multiple < 1) + { + $multiple = 10; + } + */ + return($multiple); + } + + function getMoneyPara_forPpsReport() + { + global $omc_db; + $getSql = " SELECT pubVarValue FROM omcPubVarConf WHERE pubVarName='currency_decimal'"; + $getRes = @mysqli_query($pubConn,$getSql); + $getRow = @mysqli_fetch_array($getRes); + echo mysqli_error($pubConn); + $multiple = $getRow[pubVarValue]; + /* + if($multiple < 0.1) + { + $multiple = 100; + } + elseif($multiple < 1) + { + $multiple = 10; + } + */ + return($multiple); + } + +//**************************************************************** +//函数: +// getBitValue($hexStr,$offset) +//功能说明: +//从一个十六进制字符串$hexStr中取出指定位置$offset的二进制字符 +//例: getBitValue('F1','0.1')=1 +// getBitValue('F1','1.0')=1 +// getBitValue('F1','1.1')=0 +//参数说明: +// +//返回值: +// 取出的二进制字符 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function getBitValue($hexStr,$offset) +{ + $DEBUG=0; + if($DEBUG) echo "
      hexStr=$hexStr"; + if($DEBUG) echo "
      offset=$offset"; + $tmpArr =explode('-',$offset); + $tmpBgnArr =explode('.',$tmpArr[0]); + $bgnByteOffset =$tmpBgnArr[0]; + $bgnBitOffset =$tmpBgnArr[1]; + if($DEBUG) echo "
      bgnByteOffset=$bgnByteOffset"; + if($DEBUG) echo "
      bgnBitOffset=$bgnBitOffset"; + if(sizeof($tmpArr) > 1 && $tmpArr[0] != $tmpArr[1]){ + $tmpEndArr =explode('.',$tmpArr[1]); + $endByteOffset =$tmpEndArr[0]; + $endBitOffset =$tmpEndArr[1]; + if($bgnBitOffset == 0 && $endBitOffset == 7){ + $byteOffset = $endByteOffset - $bgnByteOffset + 1; + $selByte=substr($hexStr,$bgnByteOffset*2,$byteOffset*2); + return($selByte); + }else{ + $tmpByte_1=substr($hexStr,0,$bgnByteOffset*2); + $tmpByte_2=substr($hexStr,($endByteOffset+1)*2); + $selByte=substr($hexStr,$bgnByteOffset*2,($endByteOffset-$bgnByteOffset+1)*2); + if(strlen($selByte) > 2){//不能跨byte + return(-1); + } + if($DEBUG) echo "
      selByte=$selByte"; + $tmpDec=HexDec($selByte); + $binStr=DecBin($tmpDec); + for($i=strlen($binStr);$ibinStr=$binStr"; + if($bgnBitOffset == 0){ + $selBit=substr($binStr,-($endBitOffset+1)); + }else{ + $selBit=substr($binStr,-($endBitOffset+1),($endBitOffset-$bgnBitOffset+1)); + } + + return($selBit); + } + }else{ + if($bgnByteOffset >= ceil(strlen($hexStr)/2)){ + return(0); + }else{ + $selByte=substr($hexStr,$bgnByteOffset*2,2); + if($DEBUG) echo "
      selByte=$selByte"; + $tmpDec=HexDec($selByte); + $binStr=DecBin($tmpDec); + if($DEBUG) echo "
      binStr=$binStr"; + $binStrLen=strlen($binStr); + if($bgnBitOffset >= $binStrLen){ + return(0); + }else{ + $tmpLen=0 - $bgnBitOffset -1; + $selBit=substr($binStr,$tmpLen,1); + if($DEBUG) echo "
      selBit=$selBit=substr($binStr,$tmpLen,1)"; + return($selBit); + } + } + } +} + +//**************************************************************** +//函数: +// setBitValue($hexStr,$offset,$bitValue) +//功能说明: +//将一个十六进制字符串$hexStr中指定位置$offset的二进制字符,设成指定的值$bitValue +//例: setBitValue('F1','1.1','1')=F3 +// setBitValue('F1','0.1','0')=E1 +//参数说明: +// +//返回值: +// 被改过的十六进制字符串$hexStr +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function setBitValue($hexStr,$offset,$bitValue) +{ + $DEBUG=0; + if($DEBUG) echo "
      ===================="; + if($DEBUG) echo "
      hexStr=$hexStr"; + if($DEBUG) echo "
      offset=$offset"; + $tmpArr = explode('-',$offset); + $tmpBgnArr = explode('.',$tmpArr[0]); + $bgnByteOffset = $tmpBgnArr[0]; + $bgnBitOffset = $tmpBgnArr[1]; + if($DEBUG) echo "
      bgnByteOffset=$bgnByteOffset"; + if($DEBUG) echo "
      bgnBitOffset=$bgnBitOffset"; + if(sizeof($tmpArr) > 1){ + $tmpEndArr = explode('.',$tmpArr[1]); + $endByteOffset = $tmpEndArr[0]; + $endBitOffset =$tmpEndArr[1]; + if($DEBUG) echo "
      endByteOffset=$endByteOffset"; + if($DEBUG) echo "
      endBitOffset=$endBitOffset"; + if($bgnBitOffset == 0 && $endBitOffset == 7){ + //这时,$bitValue是16进值字符串,其他情况下,都是二进制字符串 + $tmpByte_1=substr($hexStr,0,$bgnByteOffset*2); + if($DEBUG) echo "
      tmpByte_1=$tmpByte_1"; + $tmpByte_2=substr($hexStr,($endByteOffset+1)*2); + if($DEBUG) echo "
      tmpByte_2=$tmpByte_2"; + $tmpHexStr=$tmpByte_1.$bitValue.$tmpByte_2; + if($DEBUG) echo "
      tmpHexStr=$tmpHexStr"; + return($tmpHexStr); + }else{ + $tmpByte_1=substr($hexStr,0,$bgnByteOffset*2); + $tmpByte_2=substr($hexStr,($endByteOffset+1)*2); + $selByte=substr($hexStr,$bgnByteOffset*2,($endByteOffset-$bgnByteOffset+1)*2); + if(strlen($selByte) > 2){//不能跨byte + return(-1); + } + if($DEBUG) echo "
      selByte=$selByte"; + $tmpDec=HexDec($selByte); + $binStr=DecBin($tmpDec); + for($i=strlen($binStr);$ibinStr=$binStr"; + + $tmpBit_1=substr($binStr,0,8-$endBitOffset-1); + if($DEBUG) echo "
      tmpBit_1=$tmpBit_1"; + if($bgnBitOffset == 0){ + $tmpBit_2=''; + }else{ + $tmpBit_2=substr($binStr,-($bgnBitOffset)); + } + if($DEBUG) echo "
      tmpBit_2=$tmpBit_2"; + $tmpBit=$tmpBit_1.$bitValue.$tmpBit_2; + if($DEBUG) echo "
      tmpBit=$tmpBit"; + $tmpByte=dechex(BinDec($tmpBit)); + if($DEBUG) echo "
      tmpByte=$tmpByte"; + for($i=strlen($tmpByte);$i= ceil(strlen($hexStr)/2)){ + return(-1); + }else{ + $selByte=substr($hexStr,$bgnByteOffset*2,2); + if($DEBUG) echo "
      selByte=$selByte"; + $tmpDec=HexDec($selByte); + $binStr=DecBin($tmpDec); + $binStr=omc_keep_length($binStr,'0','8','1'); + if($DEBUG) echo "
      binStr=$binStr"; + $tmpLen=7-$bgnBitOffset; + $tmpBit_1=substr($binStr,0,$tmpLen); + if($DEBUG) echo "
      tmpBit_1=$tmpBit_1=substr($binStr,0,$tmpLen)"; + $tmpLen=8-$bgnBitOffset; + $tmpBit_2=substr($binStr,$tmpLen); + if($DEBUG) echo "
      tmpBit_2=$tmpBit_2=substr($binStr,$tmpLen) "; + $newBitStr=$tmpBit_1.$bitValue.$tmpBit_2; + if($DEBUG) echo "
      newBitStr=$newBitStr"; + $tmpDec=BinDec($newBitStr); + $selByte=DecHex($tmpDec); + $selByte=omc_keep_length($selByte,'0','2','1'); + if($DEBUG) echo "
      selByte=$selByte"; + $tmpHexStr_1=substr($hexStr,0,$bgnByteOffset*2); + $tmpHexStr_2=substr($hexStr,$bgnByteOffset*2+2); + if($DEBUG) echo "
      tmpHexStr_1=$tmpHexStr_1 / tmpHexStr_2=$tmpHexStr_2 "; + $tmpHexStr=$tmpHexStr_1.$selByte.$tmpHexStr_2; + if($DEBUG) echo "
      tmpHexStr=$tmpHexStr"; + return($tmpHexStr); + } + } +} +//**************************************************************** +//函数: +// getPubVar($pubVarName) +//功能说明: +//从表OMC_PUB.omcPubVarConf中取出对应变量名的值 +//例: getPubVar('pssCardMinCount')=100 +//参数说明: +// +//返回值: +// 成功:取出变量名的值,失败:-1 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function getPubVar($pubVarName) +{ + $DEBUG=0; + + $db='OMC_PUB'; + $tableName='omcPubVarConf'; + $sql = " SELECT pubVarValue + FROM $tableName + WHERE pubVarName='$pubVarName' + "; + if($DEBUG) echo "
      sql=$sql"; + $res = @mysqli_query($pubConn,$sql); + + if(mysqli_num_rows($res) > 0){ + $row = @mysqli_fetch_array($res); + return($row[pubVarValue]); + }else{ + return(-1); + } +} + + +//**************************************************************** +//函数: +// showComma($value) +//功能说明:如果值大于3位,加逗号显示 +// +//参数说明: +// +//返回值: +// 成功:转换的值,失败:-1 +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function showComma($value) +{ + $sValue = explode("-",$value); + if(isset($sValue[1])) + $pValue = explode(".",$sValue[1]); + else + $pValue = explode(".",$sValue[0]); + + $intValue = $pValue[0]; + $len=strlen($intValue); + $temValue=''; + while($len > 3){ + $value_1=substr($intValue,-3); + $intValue=substr($intValue,0,-3); + $temValue=",".$value_1.$temValue; + $len=strlen($intValue); + } + $temValue = $intValue.$temValue; + if(isset($pValue[1])){ + $temValue = $temValue.".".$pValue[1]; + } + if(isset($sValue[1])) + $temValue = "-".$temValue; + + return $temValue; +} + +//**************************************************************** +//函数: +// showHelp($helpId) +//功能说明:显示帮组文件 +// +//参数说明: +// +//返回值: +// 成功: +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function showHelp($helpId) +{ + echo " "; + echo ""; + //echo "
      "; +} + + +//**************************************************************** +//函数: +// getSerial() +//功能说明:得到各模块的系列号,以及总的系列号. +// +//参数说明: +// +//返回值: +// 成功: +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +function getSerial() +{ + $DEBUG = 0; + $dbName='OMC_PUB'; + $tbName='sysStat'; + global $ttlSerial; + global $srlArr; + global $noSrlStt,$ttlSrlClr; + + $selSql = " SELECT * FROM $tbName WHERE sysTypeNo = 0"; + if($DEBUG) echo "
      selSql=$selSql"; + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + $detailStat= $selRow[detailStat]; + $ttlSerial = substr($detailStat,39*2,8); + $ttlSrlClr = "#000000"; + if($DEBUG) echo "
      ttlSerial=$ttlSerial
      "; + + $selSql = " SELECT * FROM $tbName WHERE sysTypeNo=320 OR sysTypeNo = 330 OR sysTypeNo = 340 OR sysTypeNo = 360 OR sysTypeNo = 380 OR sysTypeNo = 390 OR sysTypeNo = 350 "; + + if($DEBUG) echo "
      selSql=$selSql"; + $selRes = @mysqli_query($pubConn,$selSql); + $selRow = @mysqli_fetch_array($selRes); + + do{ + if(!$selRow) + break; + $sysTypeNo = $selRow[sysTypeNo]; + $sysNo = $selRow[sysNo]; + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + if($DEBUG) echo "
      sysNo=$sysNo"; + $detailStat= $selRow[detailStat]; + if($DEBUG) echo "
      detailStat=$detailStat"; + switch($sysTypeNo) + { + case '320': //MSC + $arrNum = 0; + $subBgn = 39; + break; + case '330': //HLR + $arrNum = 1; + $subBgn = 39; + break; + case '340': //AUC + $arrNum = 2; + $subBgn = 39; + break; + case '360': //PPS + $arrNum = 3; + $subBgn = 39; + break; + case '380': //EIR + $arrNum = 4; + $subBgn = 39; + break; + case '390': //VSS + $arrNum = 5; + $subBgn = 39; + break; + case '350': //SMSC + $arrNum = 6; + $subBgn = 39; + break; + default: + break; + } + + $srlArr[$arrNum][$sysNo][number] = substr($detailStat,$subBgn*2,8); + $srlArr[$arrNum][$sysNo][color] = "#000000"; + + if($DEBUG) echo "
      srlArr[$arrNum][$sysNo] = {$srlArr[$arrNum][$sysNo]}
      "; + if($srlArr[$arrNum][$sysNo][number] != $ttlSerial){ + $srlArr[$arrNum][$sysNo][color] = "#FF0000"; + $noSrlStt = 1; + } + if($DEBUG) echo "
      noSrlStt=$noSrlStt"; + + }while($selRow = @mysqli_fetch_array($selRes)); + + + if($DEBUG) echo "
      ttlSerial=$ttlSerial"; + if($noSrlStt) + $ttlSrlClr = "#FF0000"; + else + $ttlSrlClr = "#000000"; + if($DEBUG) echo "
      ttlSrlClr=$ttlSrlClr
      "; + + + return 1; +} + +function byte2ip($byteStr) +{ + for($i=0;$i<4;$i++){ + $unitIp=substr($byteStr,$i*2,2); + $unitIp=hexdec($unitIp); + if($i == 0){ + $ipStr =$unitIp; + }else{ + $ipStr .=".$unitIp"; + } + } + return($ipStr); +} + +function changeByteOrder($hex_byte) +{ + while(strlen($hex_byte) % 2 == 1) + $hex_byte="0".$hex_byte; + $byte_len=strlen($hex_byte)/2; + + $res=""; + for($i=0;$i<$byte_len;$i++) + { + $tmpstr=substr($hex_byte,$i*2,2); + $res=$tmpstr.$res; + } + return $res; +} + +function getSystemNameBySysTypeNo($sysTypeNo) +{ + $sqlstr="select sysTypeName from OMC_PUB.sysConf where sysTypeNo = $sysTypeNo "; + $res = @mysqli_query($pubConn,$sqlstr); + $row = @mysqli_fetch_array($res); + return $row[sysTypeName]; +} + +function getSystemState($sysTypeNo,$byteStart,$length) +{ + $db="OMC_PUB"; + $sql="select detailStat from OMC_PUB.sysStat where sysTypeNo=$sysTypeNo order by updateTime DESC "; + if($DEBUG)echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $record_num=0; + $record_num=@mysqli_num_rows($result); + + if($record_num == 0) + return ""; + + $rows=@mysqli_fetch_array($result); + $allbin=$rows[detailStat]; + + if(strlen($allbin) < $length) + return ""; + + $resbin=substr($allbin,$byteStart,$length); + + return $resbin; +} + +//**************************************************************** +//函数: +// getParamOptionArray +//功能说明:返回参数选项值的数组 +// +//参数说明: +// sysTypeNo: sysTypeNo +// value: parameter oid or name +// mode: PARAM_OID PARAM_NAME +//返回值: +// 成功: +// +//作者:zhengjianhui +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- +define(PARAM_OID,0); +define(PARAM_NAME,1); +function getParamOptionArray($sysTypeNo,$value,$mode) +{ + $db="OBJ_".$sysTypeNo; + if($mode == PARAM_NAME) + { + $sql = "select * from OBJ_$sysTypeNo.paramConf where name_2 like '%$value%' "; + } + else + { + $levelArr=explode('.',$value); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + + $sql = "select * from OBJ_$sysTypeNo.paramConf where $levelWhere "; + } + + $res = @mysqli_query($pubConn,$sql); + $row = @mysqli_fetch_array($res); + $template=$row[setTemplate_2]; + $options=explode(";",$template); + for($i=0;$i"; + $arr[$v]=$n; + + } + return $arr; +} + +function getMSSFtpAccount() +{ + $default_user_name="subsManager"; + $default_password="iammanager"; + + $sql="select * from OMC_PUB.omcPubVarConf where pubVarName='globalFTPUserName' "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + if($num == 0) + { + $isql="insert into OMC_PUB.omcPubVarConf(instance,pubVarName,pubVarValue,remark)values(18,'globalFTPUserName','subsManager','For Import subscriber, download PPS Tarriff, backup MSS subs data and MSS Configuration Synchronization');"; + @mysqli_query($pubConn,$isql); + $isql="insert into OMC_PUB.omcPubVarConf(instance,pubVarName,pubVarValue,remark)values(18,'globalFTPPassword','iammanager','For Import subscriber, download PPS Tarriff, backup MSS subs data and MSS Configuration Synchronization');"; + @mysqli_query($pubConn,$isql); + } + + $row=@mysqli_fetch_array($res); + if(strlen(trim($row[pubVarValue])) > 0) + $ftpInfo[UserName]=$row[pubVarValue]; + else + $ftpInfo[UserName]=$default_user_name; + + $sql="select * from OMC_PUB.omcPubVarConf where pubVarName='globalFTPPassword' "; + $res=@mysqli_query($pubConn,$sql); + $row=@mysqli_fetch_array($res); + if(strlen(trim($row[pubVarValue])) > 0) + $ftpInfo[Password]=$row[pubVarValue]; + else + $ftpInfo[Password]=$default_password; + + return $ftpInfo; +} + +//**************************************************************** +//函数: +// alertMsgAndGoLastl() +//功能说明:使用JS提示一些信息. +// +//参数说明: +// +//返回值: +// 成功: +// +//作者: +// +//修改注释: +//NO.1 +//姓名: +//时间: +//修改说明: +//---------------------------------------------------------- + +function alertMsgAndGoLast($msg) +{ + echo ""; + exit(); +} +//注意:下面的"? >"后面不能有空行,否则cvs数据下载时,会出错。 +?> diff --git a/wxc2_omc/performance/erlangCsta/inc/mysqlpw.inc b/wxc2_omc/performance/erlangCsta/inc/mysqlpw.inc new file mode 100755 index 0000000..888b47f --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/mysqlpw.inc @@ -0,0 +1,3 @@ +nccyvpngvba +abvgnpvycCN#68* + diff --git a/wxc2_omc/performance/erlangCsta/inc/ua.js b/wxc2_omc/performance/erlangCsta/inc/ua.js new file mode 100755 index 0000000..699a02b --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/inc/ua.js @@ -0,0 +1,150 @@ +/* + * $Log: ua.js,v $ + * Revision 1.1.1.1 2003/08/27 12:32:00 cvsroot + * omcWeb_v5 project + * + * Revision 1.9 2002/07/22 14:06:21 bc6ix + * fix license path, change version reporting to use 2 digits for each level + * + * Revision 1.8 2002/07/07 08:23:07 bc6ix + * fix line endings + * + * Revision 1.7 2002/05/14 16:52:52 bc6ix + * use CVS Log for revision history + * + * + */ + +/* ***** BEGIN LICENSE BLOCK ***** + * Licensed under Version: MPL 1.1/GPL 2.0/LGPL 2.1 + * Full Terms at http://bclary.com/lib/js/license/mpl-tri-license.txt + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Original Code is Netscape code. + * + * The Initial Developer of the Original Code is + * Netscape Corporation. + * Portions created by the Initial Developer are Copyright (C) 2001 + * the Initial Developer. All Rights Reserved. + * + * Contributor(s): Bob Clary + * + * ***** END LICENSE BLOCK ***** */ + +function xbDetectBrowser() +{ + var oldOnError = window.onerror; + var element = null; + + window.onerror = null; + + // work around bug in xpcdom Mozilla 0.9.1 + window.saveNavigator = window.navigator; + + navigator.OS = ''; + navigator.version = parseFloat(navigator.appVersion); + navigator.org = ''; + navigator.family = ''; + + var platform; + if (typeof(window.navigator.platform) != 'undefined') + { + platform = window.navigator.platform.toLowerCase(); + if (platform.indexOf('win') != -1) + navigator.OS = 'win'; + else if (platform.indexOf('mac') != -1) + navigator.OS = 'mac'; + else if (platform.indexOf('unix') != -1 || platform.indexOf('linux') != -1 || platform.indexOf('sun') != -1) + navigator.OS = 'nix'; + } + + var i = 0; + var ua = window.navigator.userAgent.toLowerCase(); + + if (ua.indexOf('safari') != -1) + { + i = ua.indexOf('safari'); + navigator.family = 'safari'; + navigator.org = 'safari'; + navigator.version = parseFloat('0' + ua.substr(i+7), 10); + } + else if (ua.indexOf('opera') != -1) + { + i = ua.indexOf('opera'); + navigator.family = 'opera'; + navigator.org = 'opera'; + navigator.version = parseFloat('0' + ua.substr(i+6), 10); + } + else if ((i = ua.indexOf('msie')) != -1) + { + navigator.org = 'microsoft'; + navigator.version = parseFloat('0' + ua.substr(i+5), 10); + + if (navigator.version < 4) + navigator.family = 'ie3'; + else + navigator.family = 'ie4' + } + else if (ua.indexOf('gecko') != -1) + { + navigator.family = 'gecko'; + var rvStart = ua.indexOf('rv:'); + var rvEnd = ua.indexOf(')', rvStart); + var rv = ua.substring(rvStart+3, rvEnd); + var rvParts = rv.split('.'); + var rvValue = 0; + var exp = 1; + + for (var i = 0; i < rvParts.length; i++) + { + var val = parseInt(rvParts[i]); + rvValue += val / exp; + exp *= 100; + } + navigator.version = rvValue; + + if (ua.indexOf('netscape') != -1) + navigator.org = 'netscape'; + else if (ua.indexOf('compuserve') != -1) + navigator.org = 'compuserve'; + else + navigator.org = 'mozilla'; + } + else if ((ua.indexOf('mozilla') !=-1) && (ua.indexOf('spoofer')==-1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera')==-1)&& (ua.indexOf('webtv')==-1) && (ua.indexOf('hotjava')==-1)) + { + var is_major = parseFloat(navigator.appVersion); + + if (is_major < 4) + navigator.version = is_major; + else + { + i = ua.lastIndexOf('/') + navigator.version = parseFloat('0' + ua.substr(i+1), 10); + } + navigator.org = 'netscape'; + navigator.family = 'nn' + parseInt(navigator.appVersion); + } + else if ((i = ua.indexOf('aol')) != -1 ) + { + // aol + navigator.family = 'aol'; + navigator.org = 'aol'; + navigator.version = parseFloat('0' + ua.substr(i+4), 10); + } + else if ((i = ua.indexOf('hotjava')) != -1 ) + { + // hotjava + navigator.family = 'hotjava'; + navigator.org = 'sun'; + navigator.version = parseFloat(navigator.appVersion); + } + + window.onerror = oldOnError; +} + +xbDetectBrowser(); + diff --git a/wxc2_omc/performance/erlangCsta/rect_erlang.php b/wxc2_omc/performance/erlangCsta/rect_erlang.php new file mode 100755 index 0000000..21438ff --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/rect_erlang.php @@ -0,0 +1,280 @@ + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Performance > MSC > Erlang"; + echo ""; + $helpId="1.2.2"; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + //echo "$strClear"; + echo ""; + echo ""; + echo ""; + echo "
      "; +echo "
      "; +adjust_title_tail(); + +adjust_content_head(); + +echo ""; + +//adjust_head_frame("down"); +//adjust_title_head_frame("down"); +//adjust_title_tail_frame("down"); +//adjust_content_head_frame("down","auto"); + + +if(strcmp($bxx_1,"on") == 0) +{ + $filelist[1][name]="SUB SUB"; + $filelist[1][type]=5; +} +else +{ + $filelist[1][name]=" "; +} + +//echo "filelist={$filelist[1][name]}"; +//echo "
      "; + +if(strcmp($bxx_2,"on") == 0) +{ + $filelist[2][name]="SUB TRK"; + $filelist[2][type]=6; +} +else +{ + $filelist[2][name]=" "; +} + +//echo "filelist={$filelist[2][name]}"; + +//echo "
      "; + +if(strcmp($bxx_3,"on") == 0) +{ + $filelist[3][name]="TRK SUB"; + $filelist[3][type]=7; +} +else +{ + $filelist[3][name]=" "; +} + +//echo "filelist={$filelist[3][name]}"; + +//echo "
      "; + +if(strcmp($bxx_4,"on") == 0) +{ + $filelist[4][name]="TRK IP"; + $filelist[4][type]=11; +} +else +{ + $filelist[4][name]=" "; +} + +//echo "filelist={$filelist[4][name]}"; + +//echo "
      "; + +if(strcmp($bxx_5,"on") == 0) +{ + $filelist[5][name]="TRK TRK"; + $filelist[5][type]=8; +} +else +{ + $filelist[5][name]=" "; +} + +//echo "filelist={$filelist[5][name]}"; + +//echo "
      "; + +if(strcmp($bxx_6,"on") == 0) +{ + $filelist[6][name]="INTRA"; + $filelist[6][type]=9; +} +else +{ + $filelist[6][name]=" "; +} + +//echo "filelist={$filelist[6][name]}"; + +//echo "
      "; + +if(strcmp($bxx_7,"on") == 0) +{ + $filelist[7][name]="SUB IP"; + $filelist[7][type]=10; +} +else +{ + $filelist[7][name]=" "; +} + +//echo "filelist={$filelist[7][name]}"; + +//echo "
      "; + +if(strcmp($bxx_8,"on") == 0) +{ + $filelist[8][name]="IP"; + $filelist[8][type]=16; +} +else +{ + $filelist[8][name]=" "; +} + +//echo "filelist={$filelist[8][name]}"; + +//echo "
      "; + +if(strcmp($bxx_9,"on") == 0) +{ + $filelist[9][name]="MO"; + $filelist[9][type]=12; +} +else +{ + $filelist[9][name]=" "; +} + +//echo "filelist={$filelist[9][name]}"; + +//echo "
      "; + +if(strcmp($bxx_10,"on") == 0) +{ + $filelist[10][name]="MT"; + $filelist[10][type]=13; +} +else +{ + $filelist[10][name]=" "; +} + +//echo "filelist={$filelist[10][name]}"; + +//echo "
      "; + +if(strcmp($bxx_11,"on") == 0) +{ + $filelist[11][name]="IN TRK"; + $filelist[11][type]=14; +} +else +{ + $filelist[11][name]=" "; +} + +//echo "filelist={$filelist[11][name]}"; + +//echo "
      "; + +if(strcmp($bxx_12,"on") == 0) +{ + $filelist[12][name]="OUT TRK"; + $filelist[12][type]=15; +} +else +{ + $filelist[12][name]=" "; +} + +//echo "filelist={$filelist[12][name]}"; + +//echo "::$select_1::$select_2::
      "; + +$merge=0; + +if(strcmp($bxx,"on") == 0) +{ + $merge=1; +} + +/////////tg + +for($i=0;$i<32;$i++) +{ + for($j=0;$j<8;$j++) + { + $value1=($i*8+$j); + $gg="tg".$value1; + if(strcmp(${$gg},"on") == 0) + { + $tg[($i*8+$j)][name]="TG ".($i*8+$j); + $tg[($i*8+$j)][type]=($i*8+$j); + //echo "1111111111111111111111111111111111111111111
      "; + //echo "tg[($i*8+$j)][name]={$tg[($i*8+$j)][name]} type={$tg[($i*8+$j)][type]}
      "; + } + else + { + $tg[($i*8+$j)][name]=" "; + $tg[($i*8+$j)][type]=0; + } + } +} + + + +////////tg + + + + + + +if($select_1 == 1) +{ + if($select_2 == 3) + { + include("erlang_day.php"); + } + else + { + include("erlang_hour.php"); + } +} +else +{ + if($select_2 == 3) + { + include("erlang_trunk_day.php"); + } + else + { + include("erlang_trunk_hour.php"); + } +} + + + + +adjust_content_tail(); +?> diff --git a/wxc2_omc/performance/erlangCsta/testerlang.tgz b/wxc2_omc/performance/erlangCsta/testerlang.tgz new file mode 100755 index 0000000..b3c5ae6 Binary files /dev/null and b/wxc2_omc/performance/erlangCsta/testerlang.tgz differ diff --git a/wxc2_omc/performance/erlangCsta/testerlang/11515710291287576819.png b/wxc2_omc/performance/erlangCsta/testerlang/11515710291287576819.png new file mode 100755 index 0000000..47198ab Binary files /dev/null and b/wxc2_omc/performance/erlangCsta/testerlang/11515710291287576819.png differ diff --git a/wxc2_omc/performance/erlangCsta/testerlang/erlang.php b/wxc2_omc/performance/erlangCsta/testerlang/erlang.php new file mode 100755 index 0000000..c6a0a8c --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/testerlang/erlang.php @@ -0,0 +1,500 @@ + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Performance > MSC > Erlang"; + echo ""; + $helpId="1.2.2"; + showHelp($helpId); + echo "
      "; + echo " "; + echo ""; + + echo " 
      "; +adjust_title_tail(); +adjust_content_head(); + +if($_SERVER['REQUEST_METHOD'] == "POST") +{ + echo "

      Mo,MT Erlang statistic 2010-10-19 to 2010-10-20

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       Erlang
      TimeSUB SUBSUB TRKTRK SUBTRK TRKINTRASUB IPTRK IPMOMTIN TRKOUT TRKIPTOTAL
      "; + echo "2010-10-19"; + echo ""; + echo "35.34"; + echo ""; + echo "35.34"; + echo ""; + echo "35.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo "
      "; + echo "2010-10-20"; + echo ""; + echo "25.34"; + echo ""; + echo "35.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo ""; + echo "25.34"; + echo "
      "; + + + + + + + //Graphics-1 +{ + + $tmpColor[]=array(0x66,0xff,0x33); + $tmpData[]=100; + + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=100; + + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$netbusy_value; + + $tmpColor[]=array(0x66,0,0xcc); + $tmpData[]=100; + + $tmpColor[]=array(0x66,0x33,0); + $tmpData[]=100; + + $tmpColor[]=array(0xcc,0,0x66); + $tmpData[]=100; + + $tmpColor[]=array(0xff,0,0); + $tmpData[]=100; + + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=100; + + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=100; + + $tmpColor[]=array(0x66,0,0xcc); + $tmpData[]=100; + + $tmpColor[]=array(0x66,0x33,0); + $tmpData[]=100; + + $tmpColor[]=array(0xcc,0,0x66); + $tmpData[]=100; + + $tmpColor[]=array(0xff,0,0); + $tmpData[]=100; + + echo "
      Erlang Statistic Chart
      "; + + + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*2), + 24, + array(50,20), + array(750,280), + 0,1,0,1 + ); + + $remarkBlock=array( + "SUB SUB", + "SUB TRK", + "TRK SUB", + "TRK TRK", + "INTRA", + "SUB IP", + "TOTAL", + "MO", + "MT", + "IN TRK", + "OUT TRK", + "IP" + ); + $pointArr=array( + array(60,367), + array(160,367), + array(260,367), + array(360,367), + array(460,367), + array(560,367), + array(660,367) + ); + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0x33); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + $tmpColor[]=array(0x66,0,0xcc); + $tmpColor[]=array(0x66,0x33,0); + $tmpColor[]=array(0xcc,0,0x66); + $tmpColor[]=array(0xff,0,0); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,360),750/24); + + + DrawImage($image); +} + + + + + + + +} +else +{ + + +echo "
      "; +echo "Customize the statistic condition for Erlang

      "; +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + + +echo "
      Type"; +echo ""; +echo "Interval"; +echo ""; +echo "Start Time"; +echo ""; +echo "End Time"; +echo ""; +echo "Merge"; +echo ""; +echo ""; +echo ""; +echo "
      "; + +echo ""; +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + + + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + + + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + +echo ""; + + + +echo "
      "; +echo ""; +echo ""; +echo "SUB SUB"; +echo ""; +echo ""; +echo ""; +echo "SUB TRK"; +echo ""; +echo ""; +echo ""; +echo "TRK SUB"; +echo ""; +echo ""; +echo ""; +echo "TRK IP"; +echo "
      "; +echo ""; +echo ""; +echo "TRK TRK"; +echo ""; +echo ""; +echo ""; +echo "INTRA"; +echo ""; +echo ""; +echo ""; +echo "SUB IP"; +echo ""; +echo ""; +echo ""; +echo "IP"; +echo "
      "; +echo ""; +echo ""; +echo "MO"; +echo ""; +echo ""; +echo ""; +echo "MT"; +echo ""; +echo ""; +echo ""; +echo "IN TRK"; +echo ""; +echo ""; +echo ""; +echo "OUT TRK"; +echo "
      "; + +echo "
      "; + + +echo ""; +for($i=0;$i<32;$i++) +{ + echo ""; + for($j=0;$j<8;$j++) + { + echo ""; + } + echo ""; +} +echo "
      "; + echo ""; + echo "TG ".($i*8+$j); + echo "
      "; + + +echo "
      "; +echo "
      "; + + + +} +adjust_content_tail(); + +?> + diff --git a/wxc2_omc/performance/erlangCsta/testerlang/function.inc b/wxc2_omc/performance/erlangCsta/testerlang/function.inc new file mode 100755 index 0000000..a772792 --- /dev/null +++ b/wxc2_omc/performance/erlangCsta/testerlang/function.inc @@ -0,0 +1,1016 @@ + 0) + { + $sqlm="select distinct sumFieldList from CSTA_DB.{$row[4]}"; + //echo "$sqlm
      "; + $resm=mysqli_query($pubConn,$sqlm); + $numm=mysqli_num_rows($resm); + $cstaConf[DataObject][$i][SumFieldList]=""; + $cstaConf[DataObject][$i][SumFieldCount]=$numm; + for($j=0;$j<$numm;$j++) + { + $rowm=@mysqli_fetch_array($resm); + $cstaConf[DataObject][$i][SumFieldList].=$rowm[0]; + if($j != ($numm-1)) + $cstaConf[DataObject][$i][SumFieldList].=","; + } + } + else + { + if($cstaConf[DataObject][$i][SumFlag]) + { + $cstaConf[DataObject][$i][SumFieldList]=$cstaConf[DataObject][$i][DetailFieldList]; + } + } + } + + return $cstaConf; +} + +/* +$cstaConf: Return by function GetCstaConf +$startTime: The time start to get the csta data +$endTime: The time end to get the csta data +$dataType: sum or detail +$keyOneCondition: specify the KeyOneValue +#condition: specil the other condition +return: [DataObjectIndex][KeyOneIndex][KeyTwoIndex] +*/ +function GetCstaDataByDay($cstaConf,$startTime,$endTime,$dataType,$keyOneCondition=-1,$condition="") +{ + for($i=0;$i<$cstaConf[DataObjectCount];$i++) + { + if($keyOneCondition != -1) + { + if(!($keyOneCondition >= $cstaConf[DataObject][$i][KeyOneStart] && $keyOneCondition <= $cstaConf[DataObject][$i][KeyOneEnd])) + continue; + } + //sum + if($dataType == "sum") + { + $dataTable=$cstaConf[DataObject][$i][SumDataTable]; + $fieldList=$cstaConf[DataObject][$i][SumFieldList]; + $fieldCount=$cstaConf[DataObject][$i][SumFieldCount]; + } + //detail + else + { + $dataTable=$cstaConf[DataObject][$i][DetailDataTable]; + $fieldList=$cstaConf[DataObject][$i][DetailFieldList]; + $fieldCount=$cstaConf[DataObject][$i][DetailFieldCount]; + } + + if($cstaConf[DataObject][$i][KeyFieldCount] == 1) + { + $fieldList.=",".$cstaConf[DataObject][$i][KeyOneName]; + } + else if($cstaConf[DataObject][$i][KeyFieldCount] == 2) + { + $fieldList.=",".$cstaConf[DataObject][$i][KeyOneName]; + $fieldList.=",".$cstaConf[DataObject][$i][KeyTwoName]; + } + + if($keyOneCondition != -1) + { + $keyCondition=" and {$cstaConf[DataObject][$i][KeyOneName]} = '$keyOneCondition'"; + } + else + { + if($cstaConf[DataObject][$i][KeyFieldCount] > 0) + $keyCondition="and {$cstaConf[DataObject][$i][KeyOneName]} >= '{$cstaConf[DataObject][$i][KeyOneStart]}' and {$cstaConf[DataObject][$i][KeyOneName]} <= '{$cstaConf[DataObject][$i][KeyOneEnd]}'"; + else + $keyCondition=""; + } + + $sql="select {$fieldList} from CSTA_DB.{$dataTable} where csta_datetime >= '{$startTime}' and csta_datetime <= '{$endTime}' {$keyCondition} "; + if(strcmp($condition,"")) + $sql.=" and $condition "; + //echo "$sql
      "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + $tmpfield=explode(",",$fieldList); + for($j=0;$j<$num;$j++) + { + $row=@mysqli_fetch_array($res); + + if($cstaConf[DataObject][$i][KeyFieldCount] == 2) + { + for($z=0;$z<$fieldCount;$z++) + { + $cstaData[$i][$row[$fieldCount]][$row[$fieldCount+1]][trim($tmpfield[$z])]+=$row[$z]+0; + } + } + else if($cstaConf[DataObject][$i][KeyFieldCount] == 1) + { + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][$row[$fieldCount]][trim($tmpfield[$z])]+=$row[$z]+0; + } + else + { + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][trim($tmpfield[$z])]+=$row[$z]+0; + } + } + } + + return $cstaData; +} + +function GetCstaDataByHour($cstaConf,$startTime,$endTime,$dataType,$keyOneCondition=-1,$keyTwoCondition=-1) +{ + for($i=0;$i<$cstaConf[DataObjectCount];$i++) + { + if($keyOneCondition != -1) + { + if(!($keyOneCondition >= $cstaConf[DataObject][$i][KeyOneStart] && $keyOneCondition <= $cstaConf[DataObject][$i][KeyOneEnd])) + continue; + } + //sum + if($dataType == "sum") + { + $dataTable=$cstaConf[DataObject][$i][SumDataTable]; + $fieldList=$cstaConf[DataObject][$i][SumFieldList]; + $fieldCount=$cstaConf[DataObject][$i][SumFieldCount]; + } + //detail + else + { + $dataTable=$cstaConf[DataObject][$i][DetailDataTable]; + $fieldList=$cstaConf[DataObject][$i][DetailFieldList]; + $fieldCount=$cstaConf[DataObject][$i][DetailFieldCount]; + } + + if($cstaConf[DataObject][$i][KeyFieldCount] == 1) + { + $fieldList.=",".$cstaConf[DataObject][$i][KeyOneName]; + } + else if($cstaConf[DataObject][$i][KeyFieldCount] == 2) + { + $fieldList.=",".$cstaConf[DataObject][$i][KeyOneName]; + $fieldList.=",".$cstaConf[DataObject][$i][KeyTwoName]; + } + + $fieldList.=",csta_datetime"; + + if($keyOneCondition != -1) + { + $keyCondition=" and {$cstaConf[DataObject][$i][KeyOneName]} = '$keyOneCondition'"; + } + else + { + if($cstaConf[DataObject][$i][KeyFieldCount] > 0) + $keyCondition="and {$cstaConf[DataObject][$i][KeyOneName]} >= '{$cstaConf[DataObject][$i][KeyOneStart]}' and {$cstaConf[DataObject][$i][KeyOneName]} <= '{$cstaConf[DataObject][$i][KeyOneEnd]}'"; + else + $keyCondition=""; + } + + $keyTCondition=""; + if($keyTwoCondition != -1) + { + $keyTCondition="and {$cstaConf[DataObject][$i][KeyTwoName]} = '$keyTwoCondition'"; + } + + $sql="select {$fieldList} from CSTA_DB.{$dataTable} where csta_datetime >= '{$startTime}' and csta_datetime <= '{$endTime}' {$keyCondition} {$keyTCondition} "; + //echo "$sql
      "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + $tmpfield=explode(",",$fieldList); + for($j=0;$j<$num;$j++) + { + $row=@mysqli_fetch_array($res); + + if($cstaConf[DataObject][$i][KeyFieldCount] == 2) + { + $rowtime=$row[$fieldCount+2]; + $start=strtotime($startTime); + $rowt=strtotime($rowtime); + $dif=$rowt-$start; + $instance=floor($dif/(60*60)); + + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][$row[$fieldCount]][$row[$fieldCount+1]][trim($tmpfield[$z])][$instance]+=$row[$z]+0; + } + else if($cstaConf[DataObject][$i][KeyFieldCount] == 1) + { + $rowtime=$row[$fieldCount+1]; + $start=strtotime($startTime); + $rowt=strtotime($rowtime); + $dif=$rowt-$start; + $instance=floor($dif/(60*60)); + + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][$row[$fieldCount]][trim($tmpfield[$z])][$instance]+=$row[$z]+0; + } + else + { + $rowtime=$row[$fieldCount]; + $start=strtotime($startTime); + $rowt=strtotime($rowtime); + $dif=$rowt-$start; + $instance=floor($dif/(60*60)); + + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][trim($tmpfield[$z])][$instance]+=$row[$z]+0; + } + } + } + + return $cstaData; +} + +define(X,0); +define(Y,1); +define(WIDTH,0); +define(HEIGHT,1); +define(R,0); +define(G,1); +define(B,2); +function CreateImage($width,$height) +{ + $image=imagecreate($width,$height); + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + ImageFilledRectangle($image,0,0,$width,$height,ImageColorAllocate($image,198,198,198)); + ImageFilledRectangle($image,2,2,$width,$height,ImageColorAllocate($image,130,130,130)); + $pointArr=array(0,$height-1,3,$height-4,4,$height-1); + Imagefilledpolygon($image,$pointArr,3,ImageColorAllocate($image,130,130,130)); + $pointArr=array($width-1,0,$width-4,3,$width,4); + Imagefilledpolygon($image,$pointArr,3,ImageColorAllocate($image, 130, 130, 130)); + ImageFilledRectangle($image,2,2,$width-3,$height-3,$background_color); + return $image; +} +/* +$image: The image resource id return from DrawPercentHistogram function +$valueArray:{50,140,200,220} +$colorArray:{{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff},{0xff,0xff,0x00}} +$startPoint:{20,20} +$chatSize: {800,600} +$leftPercent: 1 +$rightPercent:1 +*/ +function DrawPercentHistogram($image,$valueArray,$colorArray,$startPoint,$chatSize,$leftPercent=1,$rightPercent=1) +{ + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $black_color=ImageColorAllocate($image,0,0,0); + $gray_color=ImageColorAllocate($image,0xaa,0xaa,0xaa); + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + + $count=sizeof($valueArray); + $horiz_gap_count=2+$count+$count-1; + $horiz_gap_width=$chatSize[WIDTH]/$horiz_gap_count; + $virti_gap_count=10; + $virti_gap_height=$chatSize[HEIGHT]/$virti_gap_count; + + //Draw horizontal line + $style=array($gray_color,$gray_color,$gray_color,$gray_color,$gray_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++) + { + $x1=$startPoint[X]; + $y1=$startPoint[Y]+$virti_gap_height*$i; + $x2=$startPoint[X]+$chatSize[WIDTH]; + $y2=$y1; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + if($leftPercent) + imagestring($image,2,$x1-22,$y2-5,((10-$i)*10)."%",$black_color); + if($rightPercent) + imagestring($image,2,$x2+5,$y2-5,((10-$i)*10)."%",$black_color); + } + + //Create color + for($i=0;$i<$count;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + //Draw block + for($i=0;$i<$count;$i++) + $totalValue+=$valueArray[$i]; + if($totalValue==0) + { + for($i=0;$i<$count;$i++) + { + $block_height[$i]=1; + $block_percent[$i]="0%"; + } + } + else + { + for($i=0;$i<$count;$i++) + { + $block_height[$i]=floor($chatSize[HEIGHT]*$valueArray[$i]/$totalValue); + $block_percent[$i]=number_format($valueArray[$i]*100/$totalValue,1,'.','')."%"; + } + } + for($i=0;$i<$count;$i++) + { + $x1=$startPoint[X]+(2*$i+1)*$horiz_gap_width; + $y1=$startPoint[Y]+$chatSize[HEIGHT]-$block_height[$i]; + $x2=$x1+$horiz_gap_width; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$colorSet[$i]); + imagestring($image,2,$x1,$startPoint[Y]+$chatSize[HEIGHT]+2,$block_percent[$i],$black_color); + } + + //Draw virtical line + for($i=0;$i<$horiz_gap_count;$i++) + { + $x1=$startPoint[X]+$i*$horiz_gap_width; + $y1=$startPoint[Y]; + $x2=$x1; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } + + //Draw outline + imagerectangle($image,$startPoint[X],$startPoint[Y],$startPoint[X]+$chatSize[WIDTH],$startPoint[Y]+$chatSize[HEIGHT],$black_color); + + return $image; +} +/* +$image: The image resource id return from DrawPercentHistogram function +$valueArray:{{50,140,200},{220,40,80}} +$colorArray:{{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff}} +$startPoint:{20,20} +$chatSize: {800,600} +$leftPercent: 1 +$rightPercent:1 +*/ +function DrawStackPercentHistogram($image,$valueArray,$colorArray,$startPoint,$chatSize,$leftPercent,$rightPercent) +{ + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $black_color=ImageColorAllocate($image,0,0,0); + $gray_color=ImageColorAllocate($image,0xaa,0xaa,0xaa); + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + + $count=sizeof($valueArray); + $subcount=sizeof($valueArray[0]); + + $horiz_gap_count=2+$count+$count-1; + $horiz_gap_width=$chatSize[WIDTH]/$horiz_gap_count; + $virti_gap_count=10; + $virti_gap_height=$chatSize[HEIGHT]/$virti_gap_count; + + //Draw horizontal line + $style=array($gray_color,$gray_color,$gray_color,$gray_color,$gray_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++) + { + $x1=$startPoint[X]; + $y1=$startPoint[Y]+$virti_gap_height*$i; + $x2=$startPoint[X]+$chatSize[WIDTH]; + $y2=$y1; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + if($leftPercent) + imagestring($image,2,$x1-22,$y2-5,((10-$i)*10)."%",$black_color); + if($rightPercent) + imagestring($image,2,$x2+5,$y2-5,((10-$i)*10)."%",$black_color); + } + + //Create color + for($i=0;$i<$subcount;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + //Draw block + for($i=0;$i<$count;$i++) + { + for($j=0;$j<$subcount;$j++) + { + $totalValue+=$valueArray[$i][$j]; + } + } + + if($totalValue==0) + { + for($i=0;$i<$count;$i++) + { + for($j=0;$j<$subcount;$j++) + { + $block_height[$i][$j]=0; + } + } + } + else + { + for($i=0;$i<$count;$i++) + { + for($j=0;$j<$subcount;$j++) + { + $block_height[$i][$j]=floor($chatSize[HEIGHT]*$valueArray[$i][$j]/$totalValue); + } + } + } + for($i=0;$i<$count;$i++) + { + $tmpHeight=0; + for($j=0;$j<$subcount;$j++) + { + $x1=$startPoint[X]+(2*$i+1)*$horiz_gap_width; + $y1=$startPoint[Y]+$chatSize[HEIGHT]-$tmpHeight; + $x2=$x1+$horiz_gap_width; + $y2=$y1-$block_height[$i][$j]; + $tmpHeight+=$block_height[$i][$j]; + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$colorSet[$j]); + } + } + + //Draw virtical line + for($i=0;$i<$horiz_gap_count;$i++) + { + $x1=$startPoint[X]+$i*$horiz_gap_width; + $y1=$startPoint[Y]; + $x2=$x1; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } + + //Draw outline + imagerectangle($image,$startPoint[X],$startPoint[Y],$startPoint[X]+$chatSize[WIDTH],$startPoint[Y]+$chatSize[HEIGHT],$black_color); + + return $image; +} + +/* +$image: The image resource id return from CreateImage function + |section-1 |section-2 + |column-1 |column-2 + |blk-1|block-2 +$valueArray: {{0x11,0x22}{0x33}},{{0x22,0x33}{0x55}} +$colorArray: {{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff}} +$pointInterval: The distance of each point +$gapCount: The count of the gap +$startPoint: {30,30} +$chatSize: {400,300} +$leftPercent: 1 +$rightPercent: 1 +*/ +function DrawMuliStackPercentHistogram($image,$valueArray,$colorArray,$pointInterval,$gapCount,$startPoint,$chatSize,$leftPercent,$rightPercent) +{ + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $black_color=ImageColorAllocate($image,0,0,0); + $gray_color=ImageColorAllocate($image,0xaa,0xaa,0xaa); + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + + $type_count=count($valueArray); + $column_count=count($valueArray[0]); + for($i=0;$i<$column_count;$i++) + { + $block_count[$i]=count($valueArray[0][$i]); + } + + $horiz_gap_count=$type_count*2 + ($type_count+1)*$gapCount; + $horiz_gap_width=$chatSize[WIDTH]/$horiz_gap_count; + $virti_gap_count=10; + $virti_gap_height=$chatSize[HEIGHT]/$virti_gap_count; + + $maxValue=0; + for($i=0;$i<$type_count;$i++) + { + for($j=0;$j<$column_count;$j++) + { + $tmpValue=array_sum($valueArray[$i][$j]); + if($tmpValue > $maxValue) + $maxValue=$tmpValue; + } + } + + $len=strlen($maxValue); + $maxValue=pow(10,$len); + $unitValue=$maxValue/$virti_gap_count; + + + if($unitValue >= 1000000000) + { + $unit_devide=1000000000; + $unit_string=" x 10"; + $unit_up="9"; + } + else if($unitValue >= 1000000) + { + $unit_devide=1000000; + $unit_string=" M"; + } + else if($unitValue >= 1000) + { + $unit_devide=1000; + $unit_string=" K"; + } + else + { + $unit_devide=1; + $unit_string=""; + } + + //Draw horizontal line + $style=array($gray_color,$gray_color,$gray_color,$gray_color,$gray_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++) + { + $x1=$startPoint[X]; + $y1=$startPoint[Y]+$virti_gap_height*$i; + $x2=$startPoint[X]+$chatSize[WIDTH]; + $y2=$y1; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + if($leftPercent) + { + imagestring($image,2,$x1-22,$y2-5,(((10-$i)*$unitValue)/$unit_devide).$unit_string,$black_color); + } + if($rightPercent) + imagestring($image,2,$x2+5,$y2-5,(((10-$i)*$unitValue)/$unit_devide).$unit_string,$black_color); + } + + //Create color + $color_count=count($colorArray); + for($i=0;$i<$color_count;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + //Draw block + for($i=0;$i<$type_count;$i++) + { + $color_index=0; + for($j=0;$j<$column_count;$j++) + { + $tmpCount=count($valueArray[$i][$j]); + $current_height=0; + for($z=0;$z<$tmpCount;$z++) + { + $x1=$startPoint[X]+(2*$i+1)*$gapCount*$horiz_gap_width+$j*$horiz_gap_width; + $x2=$x1+$horiz_gap_width; + $y1=$startPoint[Y]+$chatSize[HEIGHT]-$current_height; + $y2=$y1-$valueArray[$i][$j][$z]/$maxValue*$chatSize[HEIGHT]; + $current_height+=$valueArray[$i][$j][$z]/$maxValue*$chatSize[HEIGHT]; + //if($color_index == 0) + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$colorSet[$color_index]); + $color_index++; + } + } + } + + + //Draw virtical line + for($i=0;$i<$horiz_gap_count;$i++) + { + $x1=$startPoint[X]+$i*$horiz_gap_width; + $y1=$startPoint[Y]; + $x2=$x1; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } + + //Draw outline + imagerectangle($image,$startPoint[X],$startPoint[Y],$startPoint[X]+$chatSize[WIDTH],$startPoint[Y]+$chatSize[HEIGHT],$black_color); + + + return $image; +} + +/* +$image: The image resource id return from CreateImage function +$valueArray: {50,60,20,70,100},{50,60,20,70,100} +$colorArray: {{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff}} +$pointInterval: The distance of each point +$gapCount: The count of the gap +$startPoint: {30,30} +$chatSize: {400,300} +$boldline: the line need to bold +$leftPercent: 1 +$rightPercent: 1 +$valuepoint: 0 +*/ +function DrawLineHistogram($image,$valueArray,$colorArray,$pointInterval,$gapCount,$startPoint,$chatSize,$boldline=0,$leftPercent=1,$rightPercent=1,$valuepoint=0) +{ + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $black_color=ImageColorAllocate($image,0,0,0); + $gray_color=ImageColorAllocate($image,0xaa,0xaa,0xaa); + $blue_color=ImageColorAllocate($image,0x00,0x00,0xff); + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + + $horiz_gap_count=$gapCount; + $horiz_gap_width=$chatSize[WIDTH]/$horiz_gap_count; + $virti_gap_count=10; + $virti_gap_height=$chatSize[HEIGHT]/$virti_gap_count; + + $line_count=sizeof($valueArray); + + //Create color + for($i=0;$i<$line_count;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + $maxValue=10; + for($l=0;$l<$line_count;$l++) + { + $count[$l]=sizeof($valueArray[$l]); + for($i=0;$i<$count[$l];$i++) + { + if($valueArray[$l][$i]>$maxValue) + { + $maxValue=$valueArray[$l][$i]; + } + } + } + //$maxValue+=ceil($maxValue/10); + $unitValue=$maxValue/10; + + //Draw horizontal line + $style=array($gray_color,$gray_color,$gray_color,$gray_color,$gray_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<11;$i++) + { + $x1=$startPoint[X]; + $y1=$startPoint[Y]+$virti_gap_height*$i; + $x2=$startPoint[X]+$chatSize[WIDTH]; + $y2=$y1; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + + if($unitValue*(10-$i) >= 1000) + $show=number_format($unitValue*(10-$i)/1000, 1, '.', '')."K"; + else if($unitValue*(10-$i) >= 1000000) + $show=number_format($unitValue*(10-$i)/1000000, 1, '.', '')."M"; + else + $show=$unitValue*(10-$i); + + if($leftPercent) + { + imagestring($image,2,$x1-30,$y2-5,$show,$black_color); + } + if($rightPercent) + { + imagestring($image,2,$x2+5,$y2-5,$show,$black_color); + } + } + + //Draw virtical line + for($i=0;$i<$horiz_gap_count;$i++) + { + $x1=$startPoint[X]+$i*$horiz_gap_width; + $y1=$startPoint[Y]; + $x2=$x1; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } + + //Draw outline + imagerectangle($image,$startPoint[X],$startPoint[Y],$startPoint[X]+$chatSize[WIDTH],$startPoint[Y]+$chatSize[HEIGHT],$black_color); + + //Draw line + for($l=0;$l<$line_count;$l++) + { + for($i=0;$i<$count[$l];$i++) + { + $block_height[$i]=floor($chatSize[HEIGHT]*$valueArray[$l][$i]/$maxValue); + $pointArray[$i][X]=$startPoint[X]+$i*$pointInterval; + $pointArray[$i][Y]=$startPoint[Y]+$chatSize[HEIGHT]-$block_height[$i]; + //echo "{$block_height[$i]},{$chatSize[HEIGHT]},{$valueArray[$i]},{$maxValue}
      "; + } + for($i=0;$i<$count[$l]-1;$i++) + { + imageline($image,$pointArray[$i][X],$pointArray[$i][Y],$pointArray[$i+1][X],$pointArray[$i+1][Y],$colorSet[$l]); + if($valuepoint && $valueArray[$l][$i+1]>0 && $count[$l] <= 24) + { + imagestring($image,1,$pointArray[$i+1][X]+4,$pointArray[$i+1][Y],$valueArray[$l][$i+1],$blue_color); + imagefilledrectangle($image,$pointArray[$i+1][X]-1,$pointArray[$i+1][Y]-1,$pointArray[$i+1][X]+1,$pointArray[$i+1][Y]+1,$black_color); + } + } + } + + if($boldline >= 0 && $boldline < $line_count) + { + $l=$boldline; + for($i=0;$i<$count[$l];$i++) + { + $block_height[$i]=floor($chatSize[HEIGHT]*$valueArray[$l][$i]/$maxValue); + $pointArray[$i][X]=$startPoint[X]+$i*$pointInterval; + $pointArray[$i][Y]=$startPoint[Y]+$chatSize[HEIGHT]-$block_height[$i]; + //echo "{$block_height[$i]},{$chatSize[HEIGHT]},{$valueArray[$i]},{$maxValue}
      "; + } + for($i=0;$i<$count[$l]-1;$i++) + { + imageline($image,$pointArray[$i][X],$pointArray[$i][Y],$pointArray[$i+1][X],$pointArray[$i+1][Y],$colorSet[$l]); + imageline($image,$pointArray[$i][X],$pointArray[$i][Y]+1,$pointArray[$i+1][X],$pointArray[$i+1][Y]+1,$colorSet[$l]); + imageline($image,$pointArray[$i][X],$pointArray[$i][Y]+2,$pointArray[$i+1][X],$pointArray[$i+1][Y]+2,$colorSet[$l]); + } + } + + + return $image; +} +/* +$image: The image resource id return from DrawPercentHistogram function +$sel_date_from: the date to start statistic +$sel_date_to: the date to end statistic +$startPoint: the position to draw the timestamp +$gapWidth: the width of the chart +*/ +function DrawTimeStamp($image,$sel_date_from,$sel_date_to,$startPoint,$gapWidth) +{ + $black_color=ImageColorAllocate($image,0,0,0); + $slot=$sel_date_from-$sel_date_to+1; + $total_hour=$slot*24; + $count=0; + for($hour=0;$hour<$total_hour;$hour++) + { + if($hour%$slot == 0) + { + $hour_title=date("Y-m-d",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + //echo "hour_title=$hour_title
      "; + imagestringup($image,2,$startPoint[X]+$count*$gapWidth-5,$startPoint[Y],$hour_title,$black_color); + $count++; + } + } +} +/* +$image: The image resource id return from DrawPercentHistogram function +$pointArr: {{40,80},{56,28}} +$remarkArray:{"SUB SUB","TRK TRK"} +$colorArray:0-not have color block,$colorArray:{{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff}} +$fontStyle: 0-horizontal 1-vertical +*/ +function AddRemarkToImage($image,$pointArray,$remarkArray,$colorArray,$fontStyle=0,$fontsize=2) +{ + $black_color=ImageColorAllocate($image,0,0,0); + $count=sizeof($pointArray); + //Create color + for($i=0;$i<$count;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + $blocksize=8; + + if(is_array($colorArray)) + { + for($i=0;$i<$count;$i++) + { + imagefilledrectangle($image,$pointArray[$i][X],$pointArray[$i][Y],$pointArray[$i][X]+$blocksize,$pointArray[$i][Y]+$blocksize+2,$colorSet[$i]); + if($fontStyle) + imagestringup($image,$fontsize,2+$blocksize+$pointArray[$i][X],$pointArray[$i][Y]-1,$remarkArray[$i],$black_color); + else + imagestring($image,$fontsize,2+$blocksize+$pointArray[$i][X],$pointArray[$i][Y]-1,$remarkArray[$i],$black_color); + } + } + else + { + for($i=0;$i<$count;$i++) + { + if($fontStyle) + imagestringup($image,$fontsize,$pointArray[$i][X],$pointArray[$i][Y],$remarkArray[$i],$black_color); + else + imagestring($image,$fontsize,$pointArray[$i][X],$pointArray[$i][Y],$remarkArray[$i],$black_color); + } + } + + return $image; +} +$global_delete_flag=0; +function DrawImage($image) +{ + global $global_delete_flag; + if($global_delete_flag==0) + { + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $global_delete_flag=1; + } + + //create image + $imagefile=mt_rand().time().".png"; + imagepng($image,$imagefile); + $tt=imagedestroy($image); + echo ""; +} + +?> + +$label"; + $global_checkbox_id++; +} +?> + + 0) + { + $hourValue=floor($second/3600); + $minuteValue=floor(($second%3600)/60); + $secondValue=$second%60; + if($hourValue > 0 || $minuteValue > 0 || $secondValue > 0) + return "$hourValue:$minuteValue:$secondValue"; + } + return ""; +} + +/* +Get the min or max, average value from a table +$type:_MIX, _MAX, _AVE +$refer_field: the field to compare or operator +$result_field:the field value to return +$tableName: the table name +$condition: condition of the sql sentence +*/ +define(_MIN,0); +define(_MAX,1); +define(_AVE,2); +function GetSpecialData($type,$refer_field,$result_field,$tableName,$condition="") +{ + if($type == _AVE) + { + $sql="select AVG($result_field) from $tableName "; + if(strcmp($condition,"")) + $sql.=$condition; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num != 1) + return 0; + $row=@mysqli_fetch_array($res); + return $row[0]; + } + else + { + $sql="select $result_field from $tableName where $condition order by $refer_field "; + if($type == _MAX) + $sql.="desc "; + else + $sql.="asc "; + //echo "$sql
      "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num <= 0) + return 0; + $row=@mysqli_fetch_array($res); + return $row[0]; + } +} + +function GetRowCsv($file) +{ + $row = 1; + $handle = fopen($file,"r"); + unset($returnData); + while ($data = fgetcsv($handle, 8192, ",")) + { + $num = count($data); + //echo "

      $num fields in line $row:
      \n"; + $row++; + for ($c=0; $c < $num; $c++) + { + $returnData[]=$data[$c]; + } + } + fclose($handle); + return $returnData; +} + +?> diff --git a/wxc2_omc/performance/generalCsta/13247485571711695927.png b/wxc2_omc/performance/generalCsta/13247485571711695927.png new file mode 100755 index 0000000..1452464 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/13247485571711695927.png differ diff --git a/wxc2_omc/performance/generalCsta/1442300551710123919.png b/wxc2_omc/performance/generalCsta/1442300551710123919.png new file mode 100755 index 0000000..2351ea3 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/1442300551710123919.png differ diff --git a/wxc2_omc/performance/generalCsta/15467151581711338652.png b/wxc2_omc/performance/generalCsta/15467151581711338652.png new file mode 100755 index 0000000..a6614a0 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/15467151581711338652.png differ diff --git a/wxc2_omc/performance/generalCsta/16060237561711527715.png b/wxc2_omc/performance/generalCsta/16060237561711527715.png new file mode 100755 index 0000000..c52207d Binary files /dev/null and b/wxc2_omc/performance/generalCsta/16060237561711527715.png differ diff --git a/wxc2_omc/performance/generalCsta/17673141071711695927.png b/wxc2_omc/performance/generalCsta/17673141071711695927.png new file mode 100755 index 0000000..3d3b452 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/17673141071711695927.png differ diff --git a/wxc2_omc/performance/generalCsta/19079449411710123919.png b/wxc2_omc/performance/generalCsta/19079449411710123919.png new file mode 100755 index 0000000..1452464 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/19079449411710123919.png differ diff --git a/wxc2_omc/performance/generalCsta/20489234641711695927.png b/wxc2_omc/performance/generalCsta/20489234641711695927.png new file mode 100755 index 0000000..6501d55 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/20489234641711695927.png differ diff --git a/wxc2_omc/performance/generalCsta/2374735961711338652.png b/wxc2_omc/performance/generalCsta/2374735961711338652.png new file mode 100755 index 0000000..d15445e Binary files /dev/null and b/wxc2_omc/performance/generalCsta/2374735961711338652.png differ diff --git a/wxc2_omc/performance/generalCsta/8313680161711695927.png b/wxc2_omc/performance/generalCsta/8313680161711695927.png new file mode 100755 index 0000000..2351ea3 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/8313680161711695927.png differ diff --git a/wxc2_omc/performance/generalCsta/9320437831710123919.png b/wxc2_omc/performance/generalCsta/9320437831710123919.png new file mode 100755 index 0000000..3d3b452 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/9320437831710123919.png differ diff --git a/wxc2_omc/performance/generalCsta/9643301261710123919.png b/wxc2_omc/performance/generalCsta/9643301261710123919.png new file mode 100755 index 0000000..6501d55 Binary files /dev/null and b/wxc2_omc/performance/generalCsta/9643301261710123919.png differ diff --git a/wxc2_omc/performance/generalCsta/aas_service_day.php b/wxc2_omc/performance/generalCsta/aas_service_day.php new file mode 100755 index 0000000..2169b1d --- /dev/null +++ b/wxc2_omc/performance/generalCsta/aas_service_day.php @@ -0,0 +1,76 @@ +"; + echo "

      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +$cstaData=$cstaDataTmp[0]; +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="AAS Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[pps_service_attempt]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[pps_service_success]+0; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + $value=$cstaData[msc_service_attempt]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[msc_service_success]+0; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + $value=$cstaData[invalid_call]+0; + echo ""; + echo ""; + echo "
       TypeValue
      PPS Service
      Attempt$value
      Success$value
      MSC Service
      Attempt$value
      Success$value
      InvalidInvalid Call$value
      "; +} +?> + diff --git a/wxc2_omc/performance/generalCsta/amrmg_service_day.php b/wxc2_omc/performance/generalCsta/amrmg_service_day.php new file mode 100755 index 0000000..f615929 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/amrmg_service_day.php @@ -0,0 +1,76 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaData=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $amrmgCstaData=$cstaData[0]; + $table_title="AMRMG Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $row_num=count($amrmgCstaData); + if($row_num > 0) + { + foreach($amrmgCstaData as $e1_id => $data) + { + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + } + else + { + echo ""; + echo ""; + echo ""; + } + echo "
      E1 No.RTP Packets LossRTP Packets ReceiveRTP Packets Send
      "; + echo ""; + echo "$e1_id"; + echo ""; + echo ""; + echo "{$data[rtp_pkg_miss]}"; + echo ""; + echo "{$data[rtp_pkg_recv]}"; + echo ""; + echo "{$data[rtp_pkg_sent]}"; + echo "
      --------
      "; +} +?> \ No newline at end of file diff --git a/wxc2_omc/performance/generalCsta/amrmg_service_hour.php b/wxc2_omc/performance/generalCsta/amrmg_service_hour.php new file mode 100755 index 0000000..1dd1e0b --- /dev/null +++ b/wxc2_omc/performance/generalCsta/amrmg_service_hour.php @@ -0,0 +1,88 @@ +"; + echo "show_type=$show_type
      "; + echo "page_id=$page_id
      "; + echo "sel_date_from=$sel_date_from
      "; + echo "sel_date_to=$sel_date_to
      "; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +} + +echo ""; +echo ""; + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail",$keyOne,-1); + + +if(0) +{ + echo "
      ";
      +	print_r($cstaDataTmp);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="E1-{$keyOne}"; + $cstaData=$cstaDataTmp[0][$keyOne]; + + if($slot > 1) + $table_title.=" Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=" Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $row_num=count($cstaData[rtp_pkg_miss]); + if($row_num > 0) + { + for($hour=0;$hour<$total_hour_num;$hour++) + { + if(isset($cstaData[rtp_pkg_miss][$hour])) + { + echo ""; + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + } + } + else + { + echo ""; + echo ""; + echo ""; + } + + echo "
      TimeRTP Packets LossRTP Packets ReceiveRTP Packets Send
      {$hour_title}H"; + echo "{$cstaData[rtp_pkg_miss][$hour]}"; + echo " "; + echo "{$cstaData[rtp_pkg_recv][$hour]}"; + echo " "; + echo "{$cstaData[rtp_pkg_sent][$hour]}"; + echo " 
      --------
      "; +} + +?> diff --git a/wxc2_omc/performance/generalCsta/downCDR.php b/wxc2_omc/performance/generalCsta/downCDR.php new file mode 100755 index 0000000..308821c --- /dev/null +++ b/wxc2_omc/performance/generalCsta/downCDR.php @@ -0,0 +1,591 @@ += '{$startTime}' + AND csta_datetime <= '{$endTime}'"; + // echo "sumSql=$sumSql"; + $res=mysqli_query($cstaDbConn,$sumSql); + echo mysqli_error($cstaDbConn); + $num=mysqli_num_rows($res); + $row=@mysqli_fetch_array($res,MYSQLI_ASSOC); + + $title=array('Type'); + $valueArr=array(); + + foreach ($row as $key => $value) { + ///echo "Key: $key, Value: $value\n
      "; + if(!$value) $value=0; + $parts = explode('_', $key); + $title[]= $parts[1].'_' .$parts[2]."\n".$parts[3]; + $hang=$parts[4]; + $lie=$parts[1].'_' .$parts[2].'_'.$parts[3]; + $valueArr[$hang][$lie]=$value; + } + + $uniqueTitle=array_unique($title); + + // var_dump($uniqueTitle); + + $file_name = 'SMSC-CDR.csv'; + $file = fopen($file_name, 'w'); + fputcsv($file, $uniqueTitle); + foreach ($valueArr as $one => $two) { + //濉炲叆姣忚鏁版嵁 + $nowData=array("$one"); + foreach ($two as $key => $value) { + $nowData[]=$value; + } + fputcsv($file, $nowData); + } + + + // 鍏抽棴鏂囦欢 + fclose($file); + // 妫�鏌ユ枃浠舵槸鍚﹀瓨鍦� + if (file_exists($file_name)) { + header("Content-type: application/csv"); + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + header("Content-Disposition: attachment; filename=$file_name"); + readfile($file_name); + } else { + // 鏂囦欢涓嶅瓨鍦ㄦ椂鐨勫鐞� + echo "Error: File does not exist."; + } + break; + case '320': + //Service + if($page_id == 0) + { + + $file_name = 'MSC-Service.csv'; + $file = fopen($file_name, 'w'); + + //娌℃湁hour 20240920 + $hang= [ + "Subs to sbus-GSM" => 5, + "Subs to trunk-GSM" => 6, + "Trunk to subs-GSM" => 7, + "Trunk to trunk" => 8, + "Intraconnection" => 9, + "Subs to IP-GSM" => 10, + "Trunk to IP" => 11, + "Mobile originated-GSM" => 12, + "Mobile terminated-GSM" => 13, + "In trunk" => 14, + "Out trunk" => 15, + "IP terminated"=>16, + "Subs to sbus-UMTS" => 17, + "Subs to trunk-UMTS" => 18, + "Trunk to subs-UMTS" => 19, + "Subs to IP-UMTS" => 20, + "Mobile originated-UMTS" => 21, + "Mobile terminated-UMTS" => 22, + ]; + $lie=array("Type","Attempt","Success","CallDeny","NetBusy","CallerClear","SubBusy","NoAnswer","SignalErr","Duration"); + fputcsv($file, $lie); + foreach ($hang as $key => $value) { + //echo "Key: $key, Value: $value\n
      "; + if($value<17){ + $database="mscSumData"; + }else{ + $database="mscSum3gData"; + } + $sql="SELECT + SUM( Attempt ) AS TotalAttempts, + SUM( Success ) AS TotalSuccess, + SUM( CallDeny ) AS TotalCallDeny, + SUM( NetBusy ) AS TotalNetBusy, + SUM( CallerClear ) AS TotalCallerClear, + SUM( SubBusy ) AS TotalSubBusy, + SUM( NoAnswer ) AS TotalNoAnswer, + SUM( SignalErr ) AS TotalSignalErr, + SUM( Duration ) AS TotalDuration + FROM + CSTA_DB.{$database} + WHERE csta_datetime >= '{$startTime}' + AND csta_datetime <= '{$endTime}' + AND key_type = '{$value}'"; + //echo "sql=$sql
      "; + $res=mysqli_query($cstaDbConn,$sql); + echo mysqli_error($cstaDbConn); + $num=mysqli_num_rows($res); + // if (!$num){ + // echo ""; + // fclose($file); + // return false; + // } + $row=@mysqli_fetch_array($res,MYSQLI_ASSOC); + // echo "
      ";
      +        //   print_r($row);
      +        //   echo "
      "; + $valueArr=array($key); + foreach ($row as $rowKey => $rowValue) { + if(!$rowValue) $rowValue=0; + // echo "Key: $rowKey, Value: $rowValue\n
      "; + $valueArr[]=$rowValue; + } + fputcsv($file, $valueArr); + } + // 鍏抽棴鏂囦欢 + fclose($file); + // 妫�鏌ユ枃浠舵槸鍚﹀瓨鍦� + if (file_exists($file_name)) { + header("Content-type: application/csv"); + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + header("Content-Disposition: attachment; filename=$file_name"); + readfile($file_name); + } else { + // 鏂囦欢涓嶅瓨鍦ㄦ椂鐨勫鐞� + echo "Error: File does not exist."; + } + + } + //Trunk Group + else if($page_id == 1) + { + $titleSql=" + SELECT + T1.* + FROM + OBJ_320.param_99 AS T1, + paramConf AS T2 + WHERE + T1.level_1 = T2.level_1 + AND T1.level_2 = T2.level_2 + AND T1.level_3 = T2.level_3 + AND T1.level_4 = T2.level_4 + AND T1.level_5 = T2.level_5 + AND T1.level_6 = T2.level_6 + AND T1.level_7 = T2.level_7 + AND T1.level_8 = T2.level_8 + AND T1.level_9 = T2.level_9 + AND T1.level_10 = T2.level_10 + AND T2.name_2 = 'tgTitle' + "; + + $result=@mysqli_query($objDbConn,$titleSql); + $TrunkGroupCount=mysqli_num_rows($result); + // $rows = @mysqli_fetch_array($result,MYSQLI_ASSOC); + if($TrunkGroupCount>0) + { + while($rows = @mysqli_fetch_array($result)) + { + //get the instanceNo of the tg + $trunk_no=$rows[instanceNo]+0; + $trunk_status[$trunk_no]=1; + $trunk_element_title[$trunk_no]=$rows[initValue]; + } + } + // echo "
      ";
      +        // echo print_r($trunk_element_title);
      +        // echo "
      "; + $dataSql=" + SELECT + key_e1_tg, + SUM(Attempt) AS Total_Attempt, + SUM(Success) AS Total_Success, + SUM(Duration) AS Total_Duration, + SUM(SignalErr) AS Total_SignalErr, + SUM(CallDeny) AS Total_CallDeny, + SUM(NetBusy) AS Total_NetBusy, + SUM(CallerClear) AS Total_CallerClear, + SUM(SubBusy) AS Total_SubBusy, + SUM(NoAnswer) AS Total_NoAnswer + FROM + ( + SELECT + Attempt, Success, Duration, SignalErr, CallDeny, NetBusy, CallerClear, SubBusy, NoAnswer, key_type, key_e1_tg + FROM + CSTA_DB.mscSumData + WHERE + csta_datetime >= '{$startTime}' + AND csta_datetime <= '{$endTime}' + AND key_type IN ('3', '4') + ) AS combined +GROUP BY + key_e1_tg; + "; + + + $data=@mysqli_query($cstaDbConn,$dataSql); + echo mysqli_error($cstaDbConn); + $dataNum=mysqli_num_rows($data); + if (!$dataNum){ + echo ""; + return false; + } + // $dataRow=@mysqli_fetch_array($data,MYSQLI_ASSOC); + $columnTitle=array( + "TG No.", + "Element Title", + "Attempt", + "Success", + "Call Deny", + "Net Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error", + "Total Call Duration", +); + $file_name = 'MSC-Trunk Group.csv'; + $file = fopen($file_name, 'w'); + fputcsv($file, $columnTitle); + if($dataNum>0) + { + while($dataRow = @mysqli_fetch_array($data,MYSQLI_ASSOC)) + { + // echo "
      ";
      +            // print_r($dataRow);
      +            // echo "
      "; + if($trunk_element_title[$dataRow['key_e1_tg']]) + { + fputcsv($file,[$dataRow['key_e1_tg'],$trunk_element_title[$dataRow['key_e1_tg']],$dataRow['Total_Attempt'], + $dataRow['Total_Success'],$dataRow['Total_CallDeny'],$dataRow['Total_NetBusy'],$dataRow['Total_CallerClear'], + $dataRow['Total_SubBusy'],$dataRow['Total_NoAnswer'],$dataRow['Total_SignalErr'],$dataRow['Total_Duration']]); + } + + } + } + // 鍏抽棴鏂囦欢 + fclose($file); + // 妫�鏌ユ枃浠舵槸鍚﹀瓨鍦� + if (file_exists($file_name)) { + header("Content-type: application/csv"); + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + header("Content-Disposition: attachment; filename=$file_name"); + readfile($file_name); + } else { + // 鏂囦欢涓嶅瓨鍦ㄦ椂鐨勫鐞� + echo "Error: File does not exist."; + } + } + else if($page_id == 2) + { + $service_label=array( + 1=>"SUB SUB", + 2=>"SUB TRK", + 3=>"TRK SUB", + 4=>"TRK TRK", + 5=>"INTRA", + 6=>"SUB IP", + 7=>"TRK IP", + 8=>"MO", + 9=>"MT", + 10=>"IN TRK", + 11=>"OUT TRK", + ); + $service_num=sizeof($service_label); + + $service_labelobj=array( + "SUB SUB"=>"5,17", + "SUB TRK"=>"6,18", + "TRK SUB"=>"7,19", + "TRK TRK"=>"8", + "INTRA"=>"9", + "SUB IP"=>"10,20", + "TRK IP"=>"11", + "MO"=>"12,21", + "MT"=>"13,22", + "IN TRK"=>"14", + "OUT TRK"=>"15", + ); + $file_name = 'MSC-Erlang.csv'; + $file = fopen($file_name, 'w'); + for($i=1;$i<=$service_num;$i++){ + fputcsv($file, [$service_label[$i].":"]); + $keyType= explode(",", $service_labelobj["".$service_label[$i]]); + $hourSql=" + SELECT + DATE_FORMAT(csta_datetime, '%m-%d %H:00:00') AS hour, + SUM(Duration) AS Total_Duration + FROM + CSTA_DB.mscSumData + WHERE + csta_datetime >= '{$startTime}' + AND csta_datetime <= '{$endTime}' + AND key_type = '".$keyType[0]."' + GROUP BY + hour + ORDER BY + hour; + "; + //echo "$=$hourSql
      "; + $hourData=@mysqli_query($cstaDbConn,$hourSql); + echo mysqli_error($cstaDbConn); + $hourDataNum=mysqli_num_rows($hourData); + //echo "hourDataNum=$hourDataNum"; + $timeArr=array('',''); + $valueArr=array('','GSM'); + //GSM + while($hourDataRow = @mysqli_fetch_array($hourData,MYSQLI_ASSOC)) + { + // echo "
      ";
      +                // print_r($hourDataRow);
      +                // echo "
      "; + $timeArr[]= str_replace(" ", "\r\n", $hourDataRow['hour']); + if($hourDataRow['Total_Duration']){ + $valueArr[]=change2point($hourDataRow['Total_Duration']/3600); + }else{ + $valueArr[]="0"; + } + } + + + fputcsv($file, $timeArr); + fputcsv($file, $valueArr); + if(count($keyType)==2){ + $hour3GSql=" + SELECT + DATE_FORMAT(csta_datetime, '%m-%d %H:00:00') AS hour, + SUM(Duration) AS Total_Duration + FROM + CSTA_DB.mscSum3gData + WHERE + csta_datetime >= '{$startTime}' + AND csta_datetime <= '{$endTime}' + AND key_type = '".$keyType[1]."' + GROUP BY + hour + ORDER BY + hour; + "; + + $hour3GData=@mysqli_query($cstaDbConn,$hour3GSql); + echo mysqli_error($cstaDbConn); + $hour3GDataNum=mysqli_num_rows($hour3GData); + if (!$hourDataNum &&!$hour3GDataNum){ + echo ""; + fclose($file); + return false; + } + $value3GArr=array('',"UMTS"); + //UMTS + while($hour3GDataRow = @mysqli_fetch_array($hour3GData,MYSQLI_ASSOC)) + { + $value3GArr[]=$hour3GDataRow['Total_Duration']; + } + fputcsv($file, $value3GArr); + } + + + // echo "
      ";
      +            // print_r($value3GArr);
      +            // echo "
      "; + //fputcsv($file, []); + //fputcsv($file, []); + } +// 鍏抽棴鏂囦欢 +fclose($file); +// 妫�鏌ユ枃浠舵槸鍚﹀瓨鍦� +if (file_exists($file_name)) { + header("Content-type: application/csv"); + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + header("Content-Disposition: attachment; filename=$file_name"); + readfile($file_name); +} else { + // 鏂囦欢涓嶅瓨鍦ㄦ椂鐨勫鐞� + echo "Error: File does not exist."; +} + } + else if($page_id == 3) + { + $service_label=array( + 1=>"SUB SUB", + 2=>"SUB TRK", + 3=>"TRK SUB", + 4=>"TRK TRK", + 5=>"INTRA", + 6=>"SUB IP", + 7=>"TRK IP", + 8=>"MO", + 9=>"MT", + 10=>"IN TRK", + 11=>"OUT TRK", + ); + $service_num=sizeof($service_label); + + $service_labelobj=array( + "SUB SUB"=>"5,17", + "SUB TRK"=>"6,18", + "TRK SUB"=>"7,19", + "TRK TRK"=>"8", + "INTRA"=>"9", + "SUB IP"=>"10,20", + "TRK IP"=>"11", + "MO"=>"12,21", + "MT"=>"13,22", + "IN TRK"=>"14", + "OUT TRK"=>"15", + ); + $file_name = 'MSC-BHCA.csv'; + $file = fopen($file_name, 'w'); + for($i=1;$i<=$service_num;$i++){ + fputcsv($file, [$service_label[$i].":"]); + $keyType= explode(",", $service_labelobj["".$service_label[$i]]); + $hourSql=" + SELECT + DATE_FORMAT(csta_datetime, '%m-%d %H:00:00') AS hour, + SUM(Success) AS Total_Success + FROM + CSTA_DB.mscSumData + WHERE + csta_datetime >= '{$startTime}' + AND csta_datetime <= '{$endTime}' + AND key_type = '".$keyType[0]."' + GROUP BY + hour + ORDER BY + hour; + "; + $hourData=@mysqli_query($cstaDbConn,$hourSql); + echo mysqli_error($cstaDbConn); + $hourDataNum=mysqli_num_rows($hourData); + $timeArr=array('',''); + $valueArr=array('','GSM'); + //GSM + while($hourDataRow = @mysqli_fetch_array($hourData,MYSQLI_ASSOC)) + { + // echo "
      ";
      +                // print_r($hourDataRow);
      +                // echo "
      "; + $timeArr[]= str_replace(" ", "\r\n", $hourDataRow['hour']); + $valueArr[]=$hourDataRow['Total_Success']; + } + + + fputcsv($file, $timeArr); + fputcsv($file, $valueArr); + if(count($keyType)==2){ + $hour3GSql=" + SELECT + DATE_FORMAT(csta_datetime, '%m-%d %H:00:00') AS hour, + SUM(Success) AS Total_Success + FROM + CSTA_DB.mscSum3gData + WHERE + csta_datetime >= '{$startTime}' + AND csta_datetime <= '{$endTime}' + AND key_type = '".$keyType[1]."' + GROUP BY + hour + ORDER BY + hour; + "; + + $hour3GData=@mysqli_query($cstaDbConn,$hour3GSql); + echo mysqli_error($cstaDbConn); + $hour3GDataNum=mysqli_num_rows($hour3GData); + if (!$hourDataNum &&!$hour3GDataNum){ + echo ""; + fclose($file); + return false; + } + $value3GArr=array('',"UMTS"); + //UMTS + while($hour3GDataRow = @mysqli_fetch_array($hour3GData,MYSQLI_ASSOC)) + { + $value3GArr[]=$hour3GDataRow['Total_Success']; + } + fputcsv($file, $value3GArr); + } + + + // echo "
      ";
      +            // print_r($value3GArr);
      +            // echo "
      "; + fputcsv($file, []); + fputcsv($file, []); + } +// 鍏抽棴鏂囦欢 +fclose($file); +// 妫�鏌ユ枃浠舵槸鍚﹀瓨鍦� +if (file_exists($file_name)) { + header("Content-type: application/csv"); + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + header("Content-Disposition: attachment; filename=$file_name"); + readfile($file_name); +} else { + // 鏂囦欢涓嶅瓨鍦ㄦ椂鐨勫鐞� + echo "Error: File does not exist."; +} + } + break; + default: + break; + } + +?> \ No newline at end of file diff --git a/wxc2_omc/performance/generalCsta/function.inc b/wxc2_omc/performance/generalCsta/function.inc new file mode 100755 index 0000000..16de162 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/function.inc @@ -0,0 +1,1040 @@ + 0) + { + $sqlm="select distinct sumFieldList from CSTA_DB.{$row[4]}"; + //echo "$sqlm
      "; + $resm=mysqli_query($cstaDbConn,$sqlm); + $numm=mysqli_num_rows($resm); + $cstaConf[DataObject][$i][SumFieldList]=""; + $cstaConf[DataObject][$i][SumFieldCount]=$numm; + for($j=0;$j<$numm;$j++) + { + $rowm=@mysqli_fetch_array($resm); + $cstaConf[DataObject][$i][SumFieldList].=$rowm[0]; + if($j != ($numm-1)) + $cstaConf[DataObject][$i][SumFieldList].=","; + } + } + else + { + if($cstaConf[DataObject][$i][SumFlag]) + { + $cstaConf[DataObject][$i][SumFieldList]=$cstaConf[DataObject][$i][DetailFieldList]; + } + } + /*debug_log("/tmp/debugperformance","cstaconf[$i]:{$cstaConf[DataObject][$i][DetailDataTable]},"); + debug_log("/tmp/debugperformance","{$cstaConf[DataObject][$i][SumDataTable]},{$cstaConf[DataObject][$i][KeyFieldCount]},"); + debug_log("/tmp/debugperformance","{$cstaConf[DataObject][$i][DetailFieldList]},{$cstaConf[DataObject][$i][DetailFieldCount]},"); + debug_log("/tmp/debugperformance","{$cstaConf[DataObject][$i][SumFlag]},{$cstaConf[DataObject][$i][KeyOneStart]},"); + debug_log("/tmp/debugperformance","{$cstaConf[DataObject][$i][KeyOneEnd]},{$cstaConf[DataObject][$i][KeyOneName]},"); + debug_log("/tmp/debugperformance","{$cstaConf[DataObject][$i][KeyTwoName]},{$cstaConf[DataObject][$i][KeyTwoStart]},"); + debug_log("/tmp/debugperformance","{$cstaConf[DataObject][$i][KeyTwoEnd]},{$cstaConf[DataObject][$i][SumFieldList]}"); + */ + } + + return $cstaConf; +} + +/* +$cstaConf: Return by function GetCstaConf +$startTime: The time start to get the csta data +$endTime: The time end to get the csta data +$dataType: sum or detail +$keyOneCondition: specify the KeyOneValue +#condition: specil the other condition +return: [DataObjectIndex][KeyOneIndex][KeyTwoIndex] +*/ +function GetCstaDataByDay($cstaConf,$startTime,$endTime,$dataType,$keyOneCondition=-1,$condition="") +{ + global $cstaDbConn; + + for($i=0;$i<$cstaConf[DataObjectCount];$i++) + { + if($keyOneCondition != -1) + { + if(!($keyOneCondition >= $cstaConf[DataObject][$i][KeyOneStart] && $keyOneCondition <= $cstaConf[DataObject][$i][KeyOneEnd])) + continue; + } + //sum + if($dataType == "sum") + { + $dataTable=$cstaConf[DataObject][$i][SumDataTable]; + $fieldList=$cstaConf[DataObject][$i][SumFieldList]; + $fieldCount=$cstaConf[DataObject][$i][SumFieldCount]; + } + //detail + else + { + $dataTable=$cstaConf[DataObject][$i][DetailDataTable]; + $fieldList=$cstaConf[DataObject][$i][DetailFieldList]; + $fieldCount=$cstaConf[DataObject][$i][DetailFieldCount]; + } + + if($cstaConf[DataObject][$i][KeyFieldCount] == 1) + { + $fieldList.=",".$cstaConf[DataObject][$i][KeyOneName]; + } + else if($cstaConf[DataObject][$i][KeyFieldCount] == 2) + { + $fieldList.=",".$cstaConf[DataObject][$i][KeyOneName]; + $fieldList.=",".$cstaConf[DataObject][$i][KeyTwoName]; + } + + if($keyOneCondition != -1) + { + $keyCondition=" and {$cstaConf[DataObject][$i][KeyOneName]} = '$keyOneCondition'"; + } + else + { + if($cstaConf[DataObject][$i][KeyFieldCount] > 0) + $keyCondition="and {$cstaConf[DataObject][$i][KeyOneName]} >= '{$cstaConf[DataObject][$i][KeyOneStart]}' and {$cstaConf[DataObject][$i][KeyOneName]} <= '{$cstaConf[DataObject][$i][KeyOneEnd]}'"; + else + $keyCondition=""; + } + + $sql="select {$fieldList} from CSTA_DB.{$dataTable} where csta_datetime >= '{$startTime}' and csta_datetime <= '{$endTime}' {$keyCondition} "; + if(strcmp($condition,"")) + $sql.=" and $condition "; + if(0) + echo "$sql
      "; + $res=mysqli_query($cstaDbConn,$sql); + $num=mysqli_num_rows($res); + $tmpfield=explode(",",$fieldList); + for($j=0;$j<$num;$j++) + { + $row=@mysqli_fetch_array($res); + + if($cstaConf[DataObject][$i][KeyFieldCount] == 2) + { + for($z=0;$z<$fieldCount;$z++) + { + $cstaData[$i][$row[$fieldCount]][$row[$fieldCount+1]][trim($tmpfield[$z])]+=$row[$z]+0; + } + } + else if($cstaConf[DataObject][$i][KeyFieldCount] == 1) + { + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][$row[$fieldCount]][trim($tmpfield[$z])]+=$row[$z]+0; + } + else + { + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][trim($tmpfield[$z])]+=$row[$z]+0; + } + } + // debug_log("/tmp/debugperformance","cstaData=$cstaData"); + } + + return $cstaData; +} + +function GetCstaDataByHour($cstaConf,$startTime,$endTime,$dataType,$keyOneCondition=-1,$keyTwoCondition=-1) +{ + global $cstaDbConn; + + for($i=0;$i<$cstaConf[DataObjectCount];$i++) + { + if($keyOneCondition != -1) + { + if(!($keyOneCondition >= $cstaConf[DataObject][$i][KeyOneStart] && $keyOneCondition <= $cstaConf[DataObject][$i][KeyOneEnd])) + continue; + } + //sum + if($dataType == "sum") + { + $dataTable=$cstaConf[DataObject][$i][SumDataTable]; + $fieldList=$cstaConf[DataObject][$i][SumFieldList]; + $fieldCount=$cstaConf[DataObject][$i][SumFieldCount]; + } + //detail + else + { + $dataTable=$cstaConf[DataObject][$i][DetailDataTable]; + $fieldList=$cstaConf[DataObject][$i][DetailFieldList]; + $fieldCount=$cstaConf[DataObject][$i][DetailFieldCount]; + } + + if($cstaConf[DataObject][$i][KeyFieldCount] == 1) + { + $fieldList.=",".$cstaConf[DataObject][$i][KeyOneName]; + } + else if($cstaConf[DataObject][$i][KeyFieldCount] == 2) + { + $fieldList.=",".$cstaConf[DataObject][$i][KeyOneName]; + $fieldList.=",".$cstaConf[DataObject][$i][KeyTwoName]; + } + + $fieldList.=",csta_datetime"; + + if($keyOneCondition != -1) + { + $keyCondition=" and {$cstaConf[DataObject][$i][KeyOneName]} = '$keyOneCondition'"; + } + else + { + if($cstaConf[DataObject][$i][KeyFieldCount] > 0) + $keyCondition="and {$cstaConf[DataObject][$i][KeyOneName]} >= '{$cstaConf[DataObject][$i][KeyOneStart]}' and {$cstaConf[DataObject][$i][KeyOneName]} <= '{$cstaConf[DataObject][$i][KeyOneEnd]}'"; + else + $keyCondition=""; + } + + $keyTCondition=""; + if($keyTwoCondition != -1) + { + $keyTCondition="and {$cstaConf[DataObject][$i][KeyTwoName]} = '$keyTwoCondition'"; + } + + $sql="select {$fieldList} from CSTA_DB.{$dataTable} where csta_datetime >= '{$startTime}' and csta_datetime <= '{$endTime}' {$keyCondition} {$keyTCondition} "; + //echo "$sql
      "; + $res=mysqli_query($cstaDbConn,$sql); + $num=mysqli_num_rows($res); + //echo "num=$num"; + $tmpfield=explode(",",$fieldList); + for($j=0;$j<$num;$j++) + { + $row=@mysqli_fetch_array($res); + + if($cstaConf[DataObject][$i][KeyFieldCount] == 2) + { + $rowtime=$row[$fieldCount+2]; + $start=strtotime($startTime); + $rowt=strtotime($rowtime); + $dif=$rowt-$start; + $instance=floor($dif/(60*60)); + + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][$row[$fieldCount]][$row[$fieldCount+1]][trim($tmpfield[$z])][$instance]+=$row[$z]+0; + } + else if($cstaConf[DataObject][$i][KeyFieldCount] == 1) + { + $rowtime=$row[$fieldCount+1]; + $start=strtotime($startTime); + $rowt=strtotime($rowtime); + $dif=$rowt-$start; + $instance=floor($dif/(60*60)); + + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][$row[$fieldCount]][trim($tmpfield[$z])][$instance]+=$row[$z]+0; + } + else + { + $rowtime=$row[$fieldCount]; + $start=strtotime($startTime); + $rowt=strtotime($rowtime); + $dif=$rowt-$start; + $instance=floor($dif/(60*60)); + + for($z=0;$z<$fieldCount;$z++) + $cstaData[$i][trim($tmpfield[$z])][$instance]+=$row[$z]+0; + } + } + } + + return $cstaData; +} + +define(X,0); +define(Y,1); +define(WIDTH,0); +define(HEIGHT,1); +define(R,0); +define(G,1); +define(B,2); +function CreateImage($width,$height) +{ + $image=imagecreate($width,$height); + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + ImageFilledRectangle($image,0,0,$width,$height,ImageColorAllocate($image,198,198,198)); + ImageFilledRectangle($image,2,2,$width,$height,ImageColorAllocate($image,130,130,130)); + $pointArr=array(0,$height-1,3,$height-4,4,$height-1); + Imagefilledpolygon($image,$pointArr,3,ImageColorAllocate($image,130,130,130)); + $pointArr=array($width-1,0,$width-4,3,$width,4); + Imagefilledpolygon($image,$pointArr,3,ImageColorAllocate($image, 130, 130, 130)); + ImageFilledRectangle($image,2,2,$width-3,$height-3,$background_color); + return $image; +} +/* +$image: The image resource id return from DrawPercentHistogram function +$valueArray:{50,140,200,220} +$colorArray:{{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff},{0xff,0xff,0x00}} +$startPoint:{20,20} +$chatSize: {800,600} +$leftPercent: 1 +$rightPercent:1 +*/ +function DrawPercentHistogram($image,$valueArray,$colorArray,$startPoint,$chatSize,$leftPercent=1,$rightPercent=1) +{ + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $black_color=ImageColorAllocate($image,0,0,0); + $gray_color=ImageColorAllocate($image,0xaa,0xaa,0xaa); + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + + $count=sizeof($valueArray); + $horiz_gap_count=2+$count+$count-1; + $horiz_gap_width=$chatSize[WIDTH]/$horiz_gap_count; + $virti_gap_count=10; + $virti_gap_height=$chatSize[HEIGHT]/$virti_gap_count; + + //Draw horizontal line + $style=array($gray_color,$gray_color,$gray_color,$gray_color,$gray_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++) + { + $x1=$startPoint[X]; + $y1=$startPoint[Y]+$virti_gap_height*$i; + $x2=$startPoint[X]+$chatSize[WIDTH]; + $y2=$y1; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + if($leftPercent) + imagestring($image,2,$x1-22,$y2-5,((10-$i)*10)."%",$black_color); + if($rightPercent) + imagestring($image,2,$x2+5,$y2-5,((10-$i)*10)."%",$black_color); + } + + //Create color + for($i=0;$i<$count;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + //Draw block + for($i=0;$i<$count;$i++) + $totalValue+=$valueArray[$i]; + if($totalValue==0) + { + for($i=0;$i<$count;$i++) + { + $block_height[$i]=1; + $block_percent[$i]="0%"; + } + } + else + { + for($i=0;$i<$count;$i++) + { + $block_height[$i]=floor($chatSize[HEIGHT]*$valueArray[$i]/$totalValue); + $block_percent[$i]=number_format($valueArray[$i]*100/$totalValue,1,'.','')."%"; + } + } + for($i=0;$i<$count;$i++) + { + $x1=$startPoint[X]+(2*$i+1)*$horiz_gap_width; + $y1=$startPoint[Y]+$chatSize[HEIGHT]-$block_height[$i]; + $x2=$x1+$horiz_gap_width; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$colorSet[$i]); + imagestring($image,2,$x1,$startPoint[Y]+$chatSize[HEIGHT]+2,$block_percent[$i],$black_color); + } + + //Draw virtical line + for($i=0;$i<$horiz_gap_count;$i++) + { + $x1=$startPoint[X]+$i*$horiz_gap_width; + $y1=$startPoint[Y]; + $x2=$x1; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } + + //Draw outline + imagerectangle($image,$startPoint[X],$startPoint[Y],$startPoint[X]+$chatSize[WIDTH],$startPoint[Y]+$chatSize[HEIGHT],$black_color); + + return $image; +} +/* +$image: The image resource id return from DrawPercentHistogram function +$valueArray:{{50,140,200},{220,40,80}} +$colorArray:{{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff}} +$startPoint:{20,20} +$chatSize: {800,600} +$leftPercent: 1 +$rightPercent:1 +*/ +function DrawStackPercentHistogram($image,$valueArray,$colorArray,$startPoint,$chatSize,$leftPercent,$rightPercent) +{ + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $black_color=ImageColorAllocate($image,0,0,0); + $gray_color=ImageColorAllocate($image,0xaa,0xaa,0xaa); + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + + $count=sizeof($valueArray); + $subcount=sizeof($valueArray[0]); + + $horiz_gap_count=2+$count+$count-1; + $horiz_gap_width=$chatSize[WIDTH]/$horiz_gap_count; + $virti_gap_count=10; + $virti_gap_height=$chatSize[HEIGHT]/$virti_gap_count; + + //Draw horizontal line + $style=array($gray_color,$gray_color,$gray_color,$gray_color,$gray_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++) + { + $x1=$startPoint[X]; + $y1=$startPoint[Y]+$virti_gap_height*$i; + $x2=$startPoint[X]+$chatSize[WIDTH]; + $y2=$y1; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + if($leftPercent) + imagestring($image,2,$x1-22,$y2-5,((10-$i)*10)."%",$black_color); + if($rightPercent) + imagestring($image,2,$x2+5,$y2-5,((10-$i)*10)."%",$black_color); + } + + //Create color + for($i=0;$i<$subcount;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + //Draw block + for($i=0;$i<$count;$i++) + { + for($j=0;$j<$subcount;$j++) + { + $totalValue+=$valueArray[$i][$j]; + } + } + + if($totalValue==0) + { + for($i=0;$i<$count;$i++) + { + for($j=0;$j<$subcount;$j++) + { + $block_height[$i][$j]=0; + } + } + } + else + { + for($i=0;$i<$count;$i++) + { + for($j=0;$j<$subcount;$j++) + { + $block_height[$i][$j]=floor($chatSize[HEIGHT]*$valueArray[$i][$j]/$totalValue); + } + } + } + for($i=0;$i<$count;$i++) + { + $tmpHeight=0; + for($j=0;$j<$subcount;$j++) + { + $x1=$startPoint[X]+(2*$i+1)*$horiz_gap_width; + $y1=$startPoint[Y]+$chatSize[HEIGHT]-$tmpHeight; + $x2=$x1+$horiz_gap_width; + $y2=$y1-$block_height[$i][$j]; + $tmpHeight+=$block_height[$i][$j]; + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$colorSet[$j]); + } + } + + //Draw virtical line + for($i=0;$i<$horiz_gap_count;$i++) + { + $x1=$startPoint[X]+$i*$horiz_gap_width; + $y1=$startPoint[Y]; + $x2=$x1; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } + + //Draw outline + imagerectangle($image,$startPoint[X],$startPoint[Y],$startPoint[X]+$chatSize[WIDTH],$startPoint[Y]+$chatSize[HEIGHT],$black_color); + + return $image; +} + +/* +$image: The image resource id return from CreateImage function + |section-1 |section-2 + |column-1 |column-2 + |blk-1|block-2 +$valueArray: {{0x11,0x22}{0x33}},{{0x22,0x33}{0x55}} +$colorArray: {{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff}} +$pointInterval: The distance of each point +$gapCount: The count of the gap +$startPoint: {30,30} +$chatSize: {400,300} +$leftPercent: 1 +$rightPercent: 1 +*/ +function DrawMuliStackPercentHistogram($image,$valueArray,$colorArray,$pointInterval,$gapCount,$startPoint,$chatSize,$leftPercent,$rightPercent) +{ + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $black_color=ImageColorAllocate($image,0,0,0); + $gray_color=ImageColorAllocate($image,0xaa,0xaa,0xaa); + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + + $type_count=count($valueArray); + $column_count=count($valueArray[0]); + for($i=0;$i<$column_count;$i++) + { + $block_count[$i]=count($valueArray[0][$i]); + } + + $horiz_gap_count=$type_count*2 + ($type_count+1)*$gapCount; + $horiz_gap_width=$chatSize[WIDTH]/$horiz_gap_count; + $virti_gap_count=10; + $virti_gap_height=$chatSize[HEIGHT]/$virti_gap_count; + + $maxValue=0; + for($i=0;$i<$type_count;$i++) + { + for($j=0;$j<$column_count;$j++) + { + $tmpValue=array_sum($valueArray[$i][$j]); + if($tmpValue > $maxValue) + $maxValue=$tmpValue; + } + } + + $len=strlen($maxValue); + $maxValue=pow(10,$len); + $unitValue=$maxValue/$virti_gap_count; + + + if($unitValue >= 1000000000) + { + $unit_devide=1000000000; + $unit_string=" x 10"; + $unit_up="9"; + } + else if($unitValue >= 1000000) + { + $unit_devide=1000000; + $unit_string=" M"; + } + else if($unitValue >= 1000) + { + $unit_devide=1000; + $unit_string=" K"; + } + else + { + $unit_devide=1; + $unit_string=""; + } + + //Draw horizontal line + $style=array($gray_color,$gray_color,$gray_color,$gray_color,$gray_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++) + { + $x1=$startPoint[X]; + $y1=$startPoint[Y]+$virti_gap_height*$i; + $x2=$startPoint[X]+$chatSize[WIDTH]; + $y2=$y1; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + if($leftPercent) + { + imagestring($image,2,$x1-22,$y2-5,(((10-$i)*$unitValue)/$unit_devide).$unit_string,$black_color); + } + if($rightPercent) + imagestring($image,2,$x2+5,$y2-5,(((10-$i)*$unitValue)/$unit_devide).$unit_string,$black_color); + } + + //Create color + $color_count=count($colorArray); + for($i=0;$i<$color_count;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + //Draw block + for($i=0;$i<$type_count;$i++) + { + $color_index=0; + for($j=0;$j<$column_count;$j++) + { + $tmpCount=count($valueArray[$i][$j]); + $current_height=0; + for($z=0;$z<$tmpCount;$z++) + { + $x1=$startPoint[X]+(2*$i+1)*$gapCount*$horiz_gap_width+$j*$horiz_gap_width; + $x2=$x1+$horiz_gap_width; + $y1=$startPoint[Y]+$chatSize[HEIGHT]-$current_height; + $y2=$y1-$valueArray[$i][$j][$z]/$maxValue*$chatSize[HEIGHT]; + $current_height+=$valueArray[$i][$j][$z]/$maxValue*$chatSize[HEIGHT]; + //if($color_index == 0) + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$colorSet[$color_index]); + $color_index++; + } + } + } + + + //Draw virtical line + for($i=0;$i<$horiz_gap_count;$i++) + { + $x1=$startPoint[X]+$i*$horiz_gap_width; + $y1=$startPoint[Y]; + $x2=$x1; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } + + //Draw outline + imagerectangle($image,$startPoint[X],$startPoint[Y],$startPoint[X]+$chatSize[WIDTH],$startPoint[Y]+$chatSize[HEIGHT],$black_color); + + + return $image; +} + +/* +$image: The image resource id return from CreateImage function +$valueArray: {50,60,20,70,100},{50,60,20,70,100} +$colorArray: {{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff}} +$pointInterval: The distance of each point +$gapCount: The count of the gap +$startPoint: {30,30} +$chatSize: {400,300} +$boldline: the line need to bold +$leftPercent: 1 +$rightPercent: 1 +$valuepoint: 0 +*/ +function DrawLineHistogram($image,$valueArray,$colorArray,$pointInterval,$gapCount,$startPoint,$chatSize,$boldline=0,$leftPercent=1,$rightPercent=1,$valuepoint=0) +{ + $bgcolor="F8F8F8"; + $fgcolor="000000"; + $black_color=ImageColorAllocate($image,0,0,0); + $gray_color=ImageColorAllocate($image,0xaa,0xaa,0xaa); + $blue_color=ImageColorAllocate($image,0x00,0x00,0xff); + $background_color=ImageColorAllocate($image,hexdec(substr($bgcolor,0,2)),hexdec(substr($bgcolor,2,2)),hexdec(substr($bgcolor,4,2))); + + $horiz_gap_count=$gapCount; + $horiz_gap_width=$chatSize[WIDTH]/$horiz_gap_count; + $virti_gap_count=10; + $virti_gap_height=$chatSize[HEIGHT]/$virti_gap_count; + + $line_count=sizeof($valueArray); + + //Create color + for($i=0;$i<$line_count;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + $maxValue=10; + for($l=0;$l<$line_count;$l++) + { + $count[$l]=sizeof($valueArray[$l]); + for($i=0;$i<$count[$l];$i++) + { + if($valueArray[$l][$i]>$maxValue) + { + $maxValue=$valueArray[$l][$i]; + } + } + } + //$maxValue+=ceil($maxValue/10); + $unitValue=$maxValue/10; + + //Draw horizontal line + $style=array($gray_color,$gray_color,$gray_color,$gray_color,$gray_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<11;$i++) + { + $x1=$startPoint[X]; + $y1=$startPoint[Y]+$virti_gap_height*$i; + $x2=$startPoint[X]+$chatSize[WIDTH]; + $y2=$y1; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + + if($unitValue*(10-$i) >= 1000) + $show=number_format($unitValue*(10-$i)/1000, 1, '.', '')."K"; + else if($unitValue*(10-$i) >= 1000000) + $show=number_format($unitValue*(10-$i)/1000000, 1, '.', '')."M"; + else + $show=$unitValue*(10-$i); + + if($leftPercent) + { + imagestring($image,2,$x1-30,$y2-5,$show,$black_color); + } + if($rightPercent) + { + imagestring($image,2,$x2+5,$y2-5,$show,$black_color); + } + } + + //Draw virtical line + for($i=0;$i<$horiz_gap_count;$i++) + { + $x1=$startPoint[X]+$i*$horiz_gap_width; + $y1=$startPoint[Y]; + $x2=$x1; + $y2=$startPoint[Y]+$chatSize[HEIGHT]; + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + } + + //Draw outline + imagerectangle($image,$startPoint[X],$startPoint[Y],$startPoint[X]+$chatSize[WIDTH],$startPoint[Y]+$chatSize[HEIGHT],$black_color); + + //Draw line + for($l=0;$l<$line_count;$l++) + { + for($i=0;$i<$count[$l];$i++) + { + $block_height[$i]=floor($chatSize[HEIGHT]*$valueArray[$l][$i]/$maxValue); + $pointArray[$i][X]=$startPoint[X]+$i*$pointInterval; + $pointArray[$i][Y]=$startPoint[Y]+$chatSize[HEIGHT]-$block_height[$i]; + //echo "{$block_height[$i]},{$chatSize[HEIGHT]},{$valueArray[$i]},{$maxValue}
      "; + } + for($i=0;$i<$count[$l]-1;$i++) + { + imageline($image,$pointArray[$i][X],$pointArray[$i][Y],$pointArray[$i+1][X],$pointArray[$i+1][Y],$colorSet[$l]); + if($valuepoint && $valueArray[$l][$i+1]>0 && $count[$l] <= 24) + { + imagestring($image,1,$pointArray[$i+1][X]+4,$pointArray[$i+1][Y],$valueArray[$l][$i+1],$blue_color); + imagefilledrectangle($image,$pointArray[$i+1][X]-1,$pointArray[$i+1][Y]-1,$pointArray[$i+1][X]+1,$pointArray[$i+1][Y]+1,$black_color); + } + } + } + + if($boldline >= 0 && $boldline < $line_count) + { + $l=$boldline; + for($i=0;$i<$count[$l];$i++) + { + $block_height[$i]=floor($chatSize[HEIGHT]*$valueArray[$l][$i]/$maxValue); + $pointArray[$i][X]=$startPoint[X]+$i*$pointInterval; + $pointArray[$i][Y]=$startPoint[Y]+$chatSize[HEIGHT]-$block_height[$i]; + //echo "{$block_height[$i]},{$chatSize[HEIGHT]},{$valueArray[$i]},{$maxValue}
      "; + } + for($i=0;$i<$count[$l]-1;$i++) + { + imageline($image,$pointArray[$i][X],$pointArray[$i][Y],$pointArray[$i+1][X],$pointArray[$i+1][Y],$colorSet[$l]); + imageline($image,$pointArray[$i][X],$pointArray[$i][Y]+1,$pointArray[$i+1][X],$pointArray[$i+1][Y]+1,$colorSet[$l]); + imageline($image,$pointArray[$i][X],$pointArray[$i][Y]+2,$pointArray[$i+1][X],$pointArray[$i+1][Y]+2,$colorSet[$l]); + } + } + + + return $image; +} +/* +$image: The image resource id return from DrawPercentHistogram function +$sel_date_from: the date to start statistic +$sel_date_to: the date to end statistic +$startPoint: the position to draw the timestamp +$gapWidth: the width of the chart +*/ +function DrawTimeStamp($image,$sel_date_from,$sel_date_to,$startPoint,$gapWidth) +{ + $black_color=ImageColorAllocate($image,0,0,0); + $slot=$sel_date_from-$sel_date_to+1; + $total_hour=$slot*24; + $count=0; + for($hour=0;$hour<$total_hour;$hour++) + { + if($hour%$slot == 0) + { + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + //echo "hour_title=$hour_title
      "; + imagestringup($image,2,$startPoint[X]+$count*$gapWidth-5,$startPoint[Y],$hour_title,$black_color); + $count++; + } + } +} +/* +$image: The image resource id return from DrawPercentHistogram function +$pointArr: {{40,80},{56,28}} +$remarkArray:{"SUB SUB","TRK TRK"} +$colorArray:0-not have color block,$colorArray:{{0xff,0x00,0x00},{0x00,0xff,0x00},{0x00,0x00,0xff}} +$fontStyle: 0-horizontal 1-vertical +*/ +function AddRemarkToImage($image,$pointArray,$remarkArray,$colorArray,$fontStyle=0,$fontsize=2) +{ + $black_color=ImageColorAllocate($image,0,0,0); + $count=sizeof($pointArray); + //Create color + for($i=0;$i<$count;$i++) + $colorSet[$i]=ImageColorAllocate($image,$colorArray[$i][R],$colorArray[$i][G],$colorArray[$i][B]); + + $blocksize=8; + + if(is_array($colorArray)) + { + for($i=0;$i<$count;$i++) + { + imagefilledrectangle($image,$pointArray[$i][X],$pointArray[$i][Y],$pointArray[$i][X]+$blocksize,$pointArray[$i][Y]+$blocksize+2,$colorSet[$i]); + if($fontStyle) + imagestringup($image,$fontsize,2+$blocksize+$pointArray[$i][X],$pointArray[$i][Y]-1,$remarkArray[$i],$black_color); + else + imagestring($image,$fontsize,2+$blocksize+$pointArray[$i][X],$pointArray[$i][Y]-1,$remarkArray[$i],$black_color); + } + } + else + { + for($i=0;$i<$count;$i++) + { + if($fontStyle) + imagestringup($image,$fontsize,$pointArray[$i][X],$pointArray[$i][Y],$remarkArray[$i],$black_color); + else + imagestring($image,$fontsize,$pointArray[$i][X],$pointArray[$i][Y],$remarkArray[$i],$black_color); + } + } + + return $image; +} +$global_delete_flag=0; +function DrawImage($image) +{ + global $global_delete_flag; + if($global_delete_flag==0) + { + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $global_delete_flag=1; + } + + //create image + $imagefile=mt_rand().time().".png"; + imagepng($image,$imagefile); + $tt=imagedestroy($image); + echo ""; +} + +?> + +$label"; + $global_checkbox_id++; +} +?> + + 0) + { + $hourValue=floor($second/3600); + $minuteValue=floor(($second%3600)/60); + $secondValue=$second%60; + if($hourValue > 0 || $minuteValue > 0 || $secondValue > 0) + return "$hourValue:$minuteValue:$secondValue"; + } + return ""; +} + +/* +Get the min or max, average value from a table +$type:_MIX, _MAX, _AVE +$refer_field: the field to compare or operator +$result_field:the field value to return +$tableName: the table name +$condition: condition of the sql sentence +*/ +define(_MIN,0); +define(_MAX,1); +define(_AVE,2); +function GetSpecialData($type,$refer_field,$result_field,$tableName,$condition="") +{ + if($type == _AVE) + { + $sql="select AVG($result_field) from $tableName "; + if(strcmp($condition,"")) + $sql.=$condition; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num != 1) + return 0; + $row=@mysqli_fetch_array($res); + return $row[0]; + } + else + { + $sql="select $result_field from $tableName where $condition order by $refer_field "; + if($type == _MAX) + $sql.="desc "; + else + $sql.="asc "; + //echo "$sql
      "; + $res=mysqli_query($pubConn,$sql); + $num=mysqli_num_rows($res); + if($num <= 0) + return 0; + $row=@mysqli_fetch_array($res); + return $row[0]; + } +} + +function GetRowCsv($file) +{ + $row = 1; + $handle = fopen($file,"r"); + unset($returnData); + while ($data = fgetcsv($handle, 8192, ",")) + { + $num = count($data); + //echo "

      $num fields in line $row:
      \n"; + $row++; + for ($c=0; $c < $num; $c++) + { + $returnData[]=$data[$c]; + } + } + fclose($handle); + return $returnData; +} + +?> diff --git a/wxc2_omc/performance/generalCsta/general.conf b/wxc2_omc/performance/generalCsta/general.conf new file mode 100755 index 0000000..130e250 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/general.conf @@ -0,0 +1,50 @@ +; This is conf file define the general variable of the CSTA page + +; The day range to statistic the CSTA +MaxDay=30 + +[HelpID] +; 0 -> Service +; 1 -> Trunk Group +; 2 -> Erlang +; 3 -> BHCA +320[]="3.2.1" +320[]="3.2.2" +320[]="3.2.4" +320[]="3.2.5" + +350[]="3.3" +390[]="3.5" +311[]="3.8" +355[]="3.9" +375[]="3.10" +378[]="3.11.1" +378[]="3.11.2" +379[]="3.12" +385[]="3.13" +386[]="3.14" +387[]="3.15" +391[]="3.16" +392[]="3.17" + +[PageTitle] +320[]="Performance > MSC > Service" +320[]="Performance > MSC > Trunk Group" +320[]="Performance > MSC > Erlang" +320[]="Performance > MSC > BHCA" + +350[]="Performance > SMSC" +390[]="Performance > VSS" +311[]="Performance > AAS" +355[]="Performance > SMEG" +375[]="Performance > OPPS" +378[]="Performance > iPALIM > Service" +378[]="Performance > iPALIM > Trunk Group" +379[]="Performance > iRLS" +385[]="Performance > MRFC" +386[]="Performance > MHC" +387[]="Performance > iGRS" +391[]="Performance > TMG" +392[]="Performance > AMRMG" +364[]="Performance > 3G_RCS > Service" +364[]="Performance > 3G_RCS > POD" diff --git a/wxc2_omc/performance/generalCsta/general_csta_down.php b/wxc2_omc/performance/generalCsta/general_csta_down.php new file mode 100755 index 0000000..73dc375 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/general_csta_down.php @@ -0,0 +1,268 @@ + + + + + 0){ + echo ""; +}else{ + echo ""; +} +?> + +

      +"; +global $OMC_server; +$sysTypeNo=$_REQUEST['sysTypeNo']; +$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], 'OBJ_'.$sysTypeNo); + +$page_id=$_REQUEST['page_id']; +$show_type=$_REQUEST['show_type']; +$sel_date_from=$_REQUEST['sel_date_from']; +$sel_date_to=$_REQUEST['sel_date_to']; +$keyOne=$_REQUEST['keyOne']; +$keyTwo=$_REQUEST['keyTwo']; +$sel_pod_id=$_REQUEST['sel_pod_id']; +if (!isset($sel_pod_id)|| $sel_pod_id == "") $sel_pod_id = 1; +if(!isset($sel_date_from) || $sel_date_from == "") + $sel_date_from=0; +if(!isset($sel_date_to) || $sel_date_to == "") + $sel_date_to=0; +if(!isset($keyOne) || trim($keyOne) == "") + $keyOne=0; +if(!isset($keyTwo) || trim($keyTwo) == "") + $keyTwo=0; +//echo "a=$sysTypeNo"; +switch($sysTypeNo) +{ +case MSC_SYSTYPENO: + //Service + if($page_id == 0) + { + if($show_type == "day") + { + include("./msc_service_day.php"); + } + else + { + include("./msc_service_hour.php"); + } + } + //Trunk Group + else if($page_id == 1) + { + if($show_type == "day") + { + include("./msc_tg_day.php"); + } + else + { + include("./msc_tg_hour.php"); + } + } + else if($page_id == 2) + { + include("./msc_erlang.php"); + } + else if($page_id == 3) + { + include("./msc_bhca.php"); + } + + break; +case SMSC_SYSTYPENO: + //Service + if($page_id == 0) + { + if($show_type == "day") + { + include("./smsc_service_day.php"); + } + } + break; +case VSS_SYSTYPENO: + //Service + if($page_id == 0) + { + if($show_type == "day") + { + include("./vss_service_day.php"); + } + } + break; +case AAS_SYSTYPENO: + //Service + if($page_id == 0) + { + if($show_type == "day") + { + include("./aas_service_day.php"); + } + } + break; +case SMEG_SYSTYPENO: + //Service + if($page_id == 0) + { + if($show_type == "day") + { + include("./smeg_service_day.php"); + } + } + break; +case OPPS_SYSTYPENO: + //Service + if($page_id == 0) + { + if($show_type == "day") + { + include("./opps_service_day.php"); + } + } + break; +case iGRS_SYSTYPENO: + if($page_id == 0) + { + if($show_type == "day") + { + include("./igrs_service_day.php"); + } + else + { + include("./igrs_service_hour.php"); + } + } + break; +case TMG_SYSTYPENO: + if($page_id == 0) + { + if($show_type == "day") + { + include("./tmg_service_day.php"); + } + else + { + include("./tmg_service_hour.php"); + } + } + break; +case AMRMG_SYSTYPENO: + if($page_id == 0) + { + if($show_type == "day") + { + include("./amrmg_service_day.php"); + } + else + { + include("./amrmg_service_hour.php"); + } + } + break; +case PALIM_SYSTYPENO: + //Service + if($page_id == 0) + { + if($show_type == "day") + { + include("./ipalim_service_day.php"); + } + else + { + include("./ipalim_service_hour.php"); + } + } + //Trunk Group + else if($page_id == 1) + { + if($show_type == "day") + { + include("./ipalim_tg_day.php"); + } + else + { + include("./ipalim_tg_hour.php"); + } + } + break; +case RLS_SYSTYPENO: + if($page_id == 0) + { + if($show_type == "day") + { + include("./irls_service_day.php"); + } + } + break; +case MRFC_SYSTYPENO: + //Service + if($page_id == 0) + { + if($show_type == "day") + { + include("./mrfc_service_day.php"); + } + else + { + include("./mrfc_service_hour.php"); + } + } + break; +case MHC_SYSTYPENO: + if($page_id == 0) + { + if($show_type == "day") + { + include("./mhc_service_day.php"); + } + } + break; +case RCS_SYSTYPENO: + if($page_id == 0) + { + if($show_type == "day") + { + include("./rcs_service_day.php"); + } + } + if($page_id == 1) + { + if($show_type == "day") + { + include("./rcs_service_pod_day.php"); + } + } + break; +default: + exit("can not find system({$pageConf[SysTypeNo]})"); + break; +} + + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +adjust_content_tail("down"); +?> +
      diff --git a/wxc2_omc/performance/generalCsta/general_csta_index.php b/wxc2_omc/performance/generalCsta/general_csta_index.php new file mode 100755 index 0000000..c65ecef --- /dev/null +++ b/wxc2_omc/performance/generalCsta/general_csta_index.php @@ -0,0 +1,13 @@ + + "; + echo ""; + ?> + \ No newline at end of file diff --git a/wxc2_omc/performance/generalCsta/general_csta_up.php b/wxc2_omc/performance/generalCsta/general_csta_up.php new file mode 100755 index 0000000..79f27a2 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/general_csta_up.php @@ -0,0 +1,321 @@ + + + + + +
      + +"; + print_r($generalConf); + echo ""; +} + +adjust_head_frame("up"); +adjust_title_head_frame("up"); +$sysTypeNo=$_REQUEST['sysTypeNo']; +$page_id=$_REQUEST['page_id']; +$show_type=$_REQUEST['show_type']; +$sel_date_from=$_REQUEST['sel_date_from']; +$sel_date_to=$_REQUEST['sel_date_to']; +$keyOne=$_REQUEST['keyOne']; +$keyTwo=$_REQUEST['keyTwo']; +$sel_pod_id=$_REQUEST['sel_pod_id']; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo ""; + echo "
      "; + echo "{$generalConf[PageTitle][$sysTypeNo][$page_id]}"; + echo ""; + if(isset($generalConf[HelpID][$sysTypeNo][$page_id])) + showHelp($generalConf[HelpID][$sysTypeNo][$page_id]); + echo "
      "; + +if($sysTypeNo == MSC_SYSTYPENO) +{ + if($page_id == 1) + { + $tmpLabel=array("In&Out","In","Out"); + echo " "; + } + else if($page_id == 2 || $page_id == 3) + { + $tmpLabel=array("Service","Trunk Group"); + echo " "; + } +} +else if($sysTypeNo == VSS_SYSTYPENO) +{ + if($page_id == 0) + { + echo "System ID  "; + } +} +else if($sysTypeNo == OPPS_SYSTYPENO) +{ + if($page_id == 0) + { + $serviceFlag=array( + "00"=>"BothClose", + "01"=>"IMDXOpen", + "10"=>"OPROpen", + "11"=>"BothOpen" + ); + $oppsServiceStatus=getSystemState(375,86,2); + if($serviceFlag[$oppsServiceStatus] == "OPROpen") + $tmpLabel=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch"); + else if($serviceFlag[$oppsServiceStatus] == "IMDXOpen") + $tmpLabel=array(0=>"IMDX MO",1=>"IMDX Location Update"); + else if($serviceFlag[$oppsServiceStatus] == "BothOpen") + $tmpLabel=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch",3=>"IMDX MO",4=>"IMDX Location Update"); + else + { + $tmpLabel=array(0=>"None"); + } + echo "Type  "; + } +} +else if($sysTypeNo == PALIM_SYSTYPENO) +{ + if($page_id == 1) + { + $tmpLabel=array("LU","Call MO","Call MT","SM MO","SM MT"); + echo " "; + } +} +else if($sysTypeNo == 364) +{ + if($page_id == 1) + { + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + + //===get the title of pod===== + $database="OBJ_364"; + $sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='podIdentity' "; + + if(0) + echo "sql= $sql"; + + $result=@mysqli_query($pubConn,$sql); + $podCount=mysqli_num_rows($result); + + if($podCount>0) + { + while($rows = @mysqli_fetch_array($result)) + { + $pod_no=$rows[instanceNo]+0; + $pod_status[$pod_no]=1; + $pod_element_title[$pod_no]=$rows[initValue]; + } + } + if(1) + { + echo "
      POD ID "; + echo " "; + } + + + }//if page==1 +} +else +{ + echo ""; +} + +for($i=0;$i<$generalConf[MaxDay];$i++) +{ + $startDay[]=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); +} +//select day from +echo " to "; +//select day to +echo " "; + +if($sysTypeNo == MSC_SYSTYPENO) +{ + if($page_id == 2 || $page_id == 3) + { + echo " "; + else + echo "style=\"display:none;\">"; + } +} + +//search button +echo ""; +echo "$strSearch"; +echo ""; +echo "
      "; +//export +if($sysTypeNo=="320"||$sysTypeNo=="350"){ +echo ""; +echo ""; +echo "    "; +} +if($show_type == "hour") +{ + echo "back"; +} + +?> + + + +"; + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
      "; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> diff --git a/wxc2_omc/performance/generalCsta/igrs_service_day.php b/wxc2_omc/performance/generalCsta/igrs_service_day.php new file mode 100755 index 0000000..80fad2d --- /dev/null +++ b/wxc2_omc/performance/generalCsta/igrs_service_day.php @@ -0,0 +1,191 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaData=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $bssCstaData=$cstaData[0][1]; + $table_title="BSS Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $row_num=count($bssCstaData); + if($row_num > 0) + { + foreach($bssCstaData as $bss_id => $data) + { + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + } + } + else + { + echo ""; + echo ""; + echo ""; + } + echo "
       SignalData
      BSS IDSend PackagesSend BytesRecv PackagesRecv BytesSend PackagesSend BytesRecv PackagesRecv Bytes
      "; + echo ""; + echo "$bss_id"; + echo ""; + echo ""; + echo "{$data[send_packet_signal]}"; + echo ""; + echo "{$data[send_byte_signal]}"; + echo ""; + echo "{$data[recv_packet_signal]}"; + echo ""; + echo "{$data[recv_byte_signal]}"; + echo ""; + echo "{$data[send_packet_data]}"; + echo ""; + echo "{$data[send_byte_data]}"; + echo ""; + echo "{$data[recv_packet_data]}"; + echo ""; + echo "{$data[recv_byte_data]}"; + echo "
      ------------------
      "; +} + +//Table-2 +{ + $sgsnCstaData=$cstaData[1][2]; + + $table_title="SGSN Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $row_num=count($sgsnCstaData); + if($row_num > 0) + { + foreach($sgsnCstaData as $sgsn_id => $data) + { + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + } + else + { + echo ""; + echo ""; + echo ""; + } + echo "
       SignalData
      SGSN IDSend PackagesSend BytesRecv PackagesRecv BytesSend PackagesSend BytesRecv PackagesRecv Bytes
      "; + echo ""; + echo "$sgsn_id"; + echo ""; + echo ""; + echo "{$data[send_packet_signal]}"; + echo ""; + echo "{$data[send_byte_signal]}"; + echo ""; + echo "{$data[recv_packet_signal]}"; + echo ""; + echo "{$data[recv_byte_signal]}"; + echo ""; + echo "{$data[send_packet_data]}"; + echo ""; + echo "{$data[send_byte_data]}"; + echo ""; + echo "{$data[recv_packet_data]}"; + echo ""; + echo "{$data[recv_byte_data]}"; + echo "
      ------------------
      "; +} +?> diff --git a/wxc2_omc/performance/generalCsta/igrs_service_hour.php b/wxc2_omc/performance/generalCsta/igrs_service_hour.php new file mode 100755 index 0000000..390807e --- /dev/null +++ b/wxc2_omc/performance/generalCsta/igrs_service_hour.php @@ -0,0 +1,132 @@ +"; + echo "show_type=$show_type
      "; + echo "page_id=$page_id
      "; + echo "sel_date_from=$sel_date_from
      "; + echo "sel_date_to=$sel_date_to
      "; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +} + +echo ""; +echo ""; + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail",$keyOne,$keyTwo); + +if(0) +{ + echo "
      ";
      +	print_r($cstaDataTmp);
      +	echo "
      "; +} + +//Table-1 +{ + + if($keyOne == 1) + { + $table_title="BSS-{$keyTwo}"; + $cstaData=$cstaDataTmp[0][$keyOne][$keyTwo]; + } + else + { + $table_title="SGSN-{$keyTwo}"; + $cstaData=$cstaDataTmp[1][$keyOne][$keyTwo]; + } +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + if($slot > 1) + $table_title.=" Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=" Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $row_num=count($cstaData[send_packet_signal]); + if($row_num > 0) + { + for($hour=0;$hour<$total_hour_num;$hour++) + { + if(isset($cstaData[send_packet_signal][$hour])) + { + echo ""; + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + + echo ""; + + echo ""; + + echo ""; + + echo ""; + echo ""; + } + } + } + else + { + echo ""; + echo ""; + echo ""; + } + + echo "
       SignalData
      TimeSend PackagesSend BytesRecv PackagesRecv BytesSend PackagesSend BytesRecv PackagesRecv Bytes
      {$hour_title}H"; + echo "{$cstaData[send_packet_signal][$hour]}"; + echo " "; + echo "{$cstaData[send_byte_signal][$hour]}"; + echo " "; + echo "{$cstaData[recv_packet_signal][$hour]}"; + echo " "; + echo "{$cstaData[recv_byte_signal][$hour]}"; + echo " "; + echo "{$cstaData[send_packet_data][$hour]}"; + echo " "; + echo "{$cstaData[send_byte_data][$hour]}"; + echo " "; + echo "{$cstaData[recv_packet_data][$hour]}"; + echo " "; + echo "{$cstaData[recv_byte_data][$hour]}"; + echo " 
      ------------------
      "; + +} +?> diff --git a/wxc2_omc/performance/generalCsta/ipalim_service_day.php b/wxc2_omc/performance/generalCsta/ipalim_service_day.php new file mode 100755 index 0000000..c4ad5d1 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/ipalim_service_day.php @@ -0,0 +1,443 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); + +$cstaData=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); + +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + unset($lu_data); + unset($callmo_data); + unset($callmt_data); + unset($smmo_data); + unset($smmt_data); + + for($i=1;$i<=256;$i++) + { + $lu_data[Attempt]+=$cstaData[0][1][$i][Attempt]+0; + $lu_data[Success]+=$cstaData[0][1][$i][Success]+0; + $lu_data[Duration]+=$cstaData[0][1][$i][Duration]+0; + $lu_data[Normal]+=$cstaData[0][1][$i][lu_normal]+0; + $lu_data[NoResource]+=$cstaData[0][1][$i][lu_res_not_ok]+0; + $lu_data[NoService]+=$cstaData[0][1][$i][lu_ser_not_ok]+0; + $lu_data[InvalidService]+=$cstaData[0][1][$i][lu_ser_no_imp]+0; + $lu_data[InvalidMessage]+=$cstaData[0][1][$i][lu_msg_error]+0; + $lu_data[SignalError]+=$cstaData[0][1][$i][lu_pro_error]+0; + + $callmo_data[Attempt]+=$cstaData[0][2][$i][Attempt]+0; + $callmo_data[Success]+=$cstaData[0][2][$i][Success]+0; + $callmo_data[Duration]+=$cstaData[0][2][$i][Duration]+0; + $callmo_data[Normal]+=$cstaData[0][2][$i][cc_normal]+0; + $callmo_data[CallDeny]+=$cstaData[0][2][$i][cc_call_deny]+0; + $callmo_data[NetBusy]+=$cstaData[0][2][$i][cc_net_busy]+0; + $callmo_data[CallerClear]+=$cstaData[0][2][$i][cc_caller_clear]+0; + $callmo_data[SubBusy]+=$cstaData[0][2][$i][cc_sub_busy]+0; + $callmo_data[NoAnswer]+=$cstaData[0][2][$i][cc_no_answer]+0; + $callmo_data[SignalError]+=$cstaData[0][2][$i][cc_sig_error]+0; + + $callmt_data[Attempt]+=$cstaData[0][3][$i][Attempt]+0; + $callmt_data[Success]+=$cstaData[0][3][$i][Success]+0; + $callmt_data[Duration]+=$cstaData[0][3][$i][Duration]+0; + $callmt_data[Normal]+=$cstaData[0][3][$i][cc_normal]+0; + $callmt_data[CallDeny]+=$cstaData[0][3][$i][cc_call_deny]+0; + $callmt_data[NetBusy]+=$cstaData[0][3][$i][cc_net_busy]+0; + $callmt_data[CallerClear]+=$cstaData[0][3][$i][cc_caller_clear]+0; + $callmt_data[SubBusy]+=$cstaData[0][3][$i][cc_sub_busy]+0; + $callmt_data[NoAnswer]+=$cstaData[0][3][$i][cc_no_answer]+0; + $callmt_data[SignalError]+=$cstaData[0][3][$i][cc_sig_error]+0; + + $smmo_data[Attempt]+=$cstaData[0][4][$i][Attempt]+0; + $smmo_data[Success]+=$cstaData[0][4][$i][Success]+0; + $smmo_data[Duration]+=$cstaData[0][4][$i][Duration]+0; + $smmo_data[Normal]+=$cstaData[0][4][$i][sm_normal]+0; + $smmo_data[SubError]+=$cstaData[0][4][$i][sm_error_sub]+0; + $smmo_data[NoService]+=$cstaData[0][4][$i][sm_ser_not_ok]+0; + $smmo_data[NetBusy]+=$cstaData[0][4][$i][sm_net_busy]+0; + $smmo_data[MessageError]+=$cstaData[0][4][$i][sm_msg_error]+0; + $smmo_data[SignalError]+=$cstaData[0][4][$i][sm_pro_error]+0; + $smmo_data[NoResource]+=$cstaData[0][4][$i][sm_res_not_ok]+0; + + $smmt_data[Attempt]+=$cstaData[0][5][$i][Attempt]+0; + $smmt_data[Success]+=$cstaData[0][5][$i][Success]+0; + $smmt_data[Duration]+=$cstaData[0][5][$i][Duration]+0; + $smmt_data[Normal]+=$cstaData[0][5][$i][sm_normal]+0; + $smmt_data[SubError]+=$cstaData[0][5][$i][sm_error_sub]+0; + $smmt_data[NoService]+=$cstaData[0][5][$i][sm_ser_not_ok]+0; + $smmt_data[NetBusy]+=$cstaData[0][5][$i][sm_net_busy]+0; + $smmt_data[MessageError]+=$cstaData[0][5][$i][sm_msg_error]+0; + $smmt_data[SignalError]+=$cstaData[0][5][$i][sm_pro_error]+0; + $smmt_data[NoResource]+=$cstaData[0][5][$i][sm_res_not_ok]+0; + } + + $table_title="Service Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + + $value=$lu_data[Attempt]; + echo ""; + + $value=$lu_data[Success]; + $percent=GetPercent($lu_data[Success],$lu_data[Attempt]); + echo ""; + + $value=$lu_data[Normal]; + $percent=GetPercent($lu_data[Normal],$lu_data[Attempt]); + echo ""; + + $value=$lu_data[NoResource]; + $percent=GetPercent($lu_data[NoResource],$lu_data[Attempt]); + echo ""; + + $value=$lu_data[NoService]; + $percent=GetPercent($lu_data[NoService],$lu_data[Attempt]); + echo ""; + + $value=$lu_data[InvalidService]; + $percent=GetPercent($lu_data[InvalidService],$lu_data[Attempt]); + echo ""; + + $value=$lu_data[InvalidMessage]; + $percent=GetPercent($lu_data[InvalidMessage],$lu_data[Attempt]); + echo ""; + + $value=$lu_data[SignalError]; + $percent=GetPercent($lu_data[SignalError],$lu_data[Attempt]); + echo ""; + + $value=$lu_data[Duration]; + $timestamp=SecondToTimeStamp($value); + echo ""; + + if($lu_data[Success] > 0) + $value=ceil($lu_data[Duration]/$lu_data[Success]); + else + $value=0; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + unset($tmpLabel); + unset($tmpdata); + $tmpLabel=array("Call MO","Call MT"); + $tmpdata[0]=$callmo_data; + $tmpdata[1]=$callmt_data; + for($i=0;$i<2;$i++) + { + echo ""; + echo ""; + $value=$tmpdata[$i][Attempt]; + echo ""; + + $value=$tmpdata[$i][Success]; + $percent=GetPercent($tmpdata[$i][Success],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][Normal]; + $percent=GetPercent($tmpdata[$i][Normal],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][CallDeny]; + $percent=GetPercent($tmpdata[$i][CallDeny],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][NetBusy]; + $percent=GetPercent($tmpdata[$i][NetBusy],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][CallerClear]; + $percent=GetPercent($tmpdata[$i][CallerClear],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][SubBusy]; + $percent=GetPercent($tmpdata[$i][SubBusy],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][NoAnswer]; + $percent=GetPercent($tmpdata[$i][NoAnswer],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][SignalError]; + $percent=GetPercent($tmpdata[$i][SignalError],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][Duration]; + $timestamp=SecondToTimeStamp($value); + echo ""; + + if($tmpdata[$i][Success] > 0) + $value=ceil($tmpdata[$i][Duration]/$tmpdata[$i][Success]); + else + $value=0; + echo ""; + echo ""; + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + unset($tmpLabel); + unset($tmpdata); + $tmpLabel=array("SM MO","SM MT"); + $tmpdata[0]=$smmo_data; + $tmpdata[1]=$smmt_data; + for($i=0;$i<2;$i++) + { + echo ""; + echo ""; + $value=$tmpdata[$i][Attempt]; + echo ""; + + $value=$tmpdata[$i][Success]; + $percent=GetPercent($tmpdata[$i][Success],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][Normal]; + $percent=GetPercent($tmpdata[$i][Normal],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][SubError]; + $percent=GetPercent($tmpdata[$i][SubError],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][NoService]; + $percent=GetPercent($tmpdata[$i][NoService],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][NetBusy]; + $percent=GetPercent($tmpdata[$i][NetBusy],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][MessageError]; + $percent=GetPercent($tmpdata[$i][MessageError],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][SignalError]; + $percent=GetPercent($tmpdata[$i][SignalError],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][NoResource]; + $percent=GetPercent($tmpdata[$i][NoResource],$tmpdata[$i][Attempt]); + echo ""; + + $value=$tmpdata[$i][Duration]; + $timestamp=SecondToTimeStamp($value); + echo ""; + + if($tmpdata[$i][Success] > 0) + $value=ceil($tmpdata[$i][Duration]/$tmpdata[$i][Success]); + else + $value=0; + echo ""; + echo ""; + } + echo "
      TypeAttemptSuccessNormalNo ResourceNo ServiceInvalid ServiceInvalid MessageSignal ErrorDurationAverage Duration
      "; + echo ""; + echo "LU"; + echo ""; + echo "$value"; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + //echo "$value
      "; + echo "--
      "; + echo "$timestamp"; + echo "
      "; + //echo "$value"; + echo "--
      "; + echo "
       AttemptSuccessNormalCall DenyNet BusyCaller ClearSub BusyNo AnswerSignal ErrorDurationAverage Duration
      "; + $tmp=$i+2; + echo ""; + echo "{$tmpLabel[$i]}"; + echo "$value"; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$timestamp"; + echo "
      "; + echo "$value"; + echo "
       AttemptSuccessNormalSub ErrorNo ServiceNet BusyMessage ErrorSignal ErrorNo ResourceDurationAverage Duration
      "; + $tmp=$i+4; + echo ""; + echo "{$tmpLabel[$i]}"; + echo ""; + echo "$value"; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + //echo "$value
      "; + //echo "$timestamp"; + echo "--
      "; + echo "
      "; + //echo "$value"; + echo "--
      "; + echo "
      "; +} + +//Graphics-1 +{ + unset($tmpData); + unset($tmpColor); + $tmpData[]=$lu_data[Attempt]; + $tmpData[]=$callmo_data[Attempt]; + $tmpData[]=$callmt_data[Attempt]; + $tmpData[]=$smmo_data[Attempt]; + $tmpData[]=$smmt_data[Attempt]; + + $tmpColor[]=array(0x99,0x00,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0x99,0xcc,0x99); + $tmpColor[]=array(0x99,0xff,0x33); + + echo "
      Service(Attempt)
      "; + $image=CreateImage(450,320); + $image=DrawPercentHistogram( + $image, + $tmpData, + $tmpColor, + array(30,20), + array(400,250),1,0 + ); + $remarkBlock=array( + "LU", + "Call MO", + "Call MT", + "SM MO", + "SM MT" + ); + $pointArr=array( + array(77,290), + array(137,290), + array(208,290), + array(285,290), + array(360,290) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + DrawImage($image); +} +?> diff --git a/wxc2_omc/performance/generalCsta/ipalim_service_hour.php b/wxc2_omc/performance/generalCsta/ipalim_service_hour.php new file mode 100755 index 0000000..21c0b85 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/ipalim_service_hour.php @@ -0,0 +1,423 @@ +"; + echo "sysTypeNo=$sysTypeNo,show_type=$show_type,page_id=$page_id,keyOne=$keyOne
      "; + echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to
      "; + echo "select_checkbox_id=$select_checkbox_id
      "; +} + +echo ""; +echo ""; + +$cstaConf=GetCstaConf($sysTypeNo); +if(0) +{ + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail",$keyOne); +$cstaData=$cstaDataTmp[0][$keyOne]; +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $datafield[]="Attempt"; + $datafield[]="Success"; + + $showfield[]="Attempt"; + $showfield[]="Success"; + $showfield[]="Normal"; + switch($keyOne) + { + case 1: + $datafield[]="lu_normal"; + $datafield[]="lu_res_not_ok"; + $datafield[]="lu_ser_not_ok"; + $datafield[]="lu_ser_no_imp"; + $datafield[]="lu_msg_error"; + $datafield[]="lu_pro_error"; + + $showfield[]="No Resource"; + $showfield[]="No Service"; + $showfield[]="Invalid Service"; + $showfield[]="Invalid Message"; + $showfield[]="Signal Error"; + break; + case 2: + case 3: + $datafield[]="cc_normal"; + $datafield[]="cc_call_deny"; + $datafield[]="cc_net_busy"; + $datafield[]="cc_caller_clear"; + $datafield[]="cc_sub_busy"; + $datafield[]="cc_no_answer"; + $datafield[]="cc_sig_error"; + + $showfield[]="Call Deny"; + $showfield[]="Net Busy"; + $showfield[]="Caller Clear"; + $showfield[]="Sub Busy"; + $showfield[]="No Answer"; + $showfield[]="Signal Error"; + break; + case 4: + case 5: + $datafield[]="sm_normal"; + $datafield[]="sm_error_sub"; + $datafield[]="sm_ser_not_ok"; + $datafield[]="sm_net_busy"; + $datafield[]="sm_msg_error"; + $datafield[]="sm_pro_error"; + $datafield[]="sm_res_not_ok"; + + $showfield[]="Sub Error"; + $showfield[]="No Service"; + $showfield[]="Net Busy"; + $showfield[]="Message Error"; + $showfield[]="Signal Error"; + $showfield[]="No Resource"; + break; + } + $datafield[]="Duration"; + $showfield[]="Duration"; + $showfield[]="Average Duration"; + + $datafieldnum=sizeof($datafield); + $showfieldnum=sizeof($showfield); + for($hour=0;$hour<$total_hour_num;$hour++) + { + for($i=0;$i<$datafieldnum;$i++) + { + for($j=1;$j<=256;$j++) + $hourData[$datafield[$i]][$hour]+=$cstaData[$j][$datafield[$i]][$hour]; + } + } + + if(0) + { + echo "
      ";
      +		print_r($hourData);
      +		echo "
      "; + } + + $typeLabel=array(1=>"LU",2=>"Call MO",3=>"Call MT",4=>"SM MO",5=>"SM MT"); + $table_title="{$typeLabel[$keyOne]} Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + $fieldwidth=90/($datafieldnum+2); + echo ""; + for($i=0;$i<$showfieldnum;$i++) + echo ""; + echo ""; + + + for($hour=0;$hour<$total_hour_num;$hour++) + { + echo ""; + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo ""; + + for($i=0;$i<$datafieldnum;$i++) + { + $value=$hourData[$datafield[$i]][$hour]; + if(($keyOne == 1 && $i == 8) || ($keyOne == 4 && $i == 9) || ($keyOne == 5 && $i == 9)) + echo ""; + } + + if($hourData[Success][$hour] > 0) + $value=ceil($hourData[Duration][$hour]/$hourData[Success][$hour]); + else + $value=0; + if($keyOne == 1 || $keyOne == 4 || $keyOne == 5) + echo ""; + else + echo ""; + + echo ""; + echo ""; + } + echo "
      Time{$showfield[$i]}
      {$hour_title}H"; + else + echo "$value"; + if($i>0 && $i< ($datafieldnum-1)) + { + $percent=GetPercent($value,$hourData[Attempt][$hour]); + echo "
      $percent"; + } + else if($i == ($datafieldnum-1)) + { + $timestamp=SecondToTimeStamp($value); + if($keyOne == 1 || $keyOne == 4 || $keyOne == 5) + echo "--"; + else + echo "
      $timestamp"; + } + echo "
      --$value
      "; +} + +//Graphics-1 +{ + unset($tmpColor); + unset($tmpData); + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + $tmpData[]=$hourData[$datafield[1]]; + } + + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$hourData[$datafield[2]]; + } + if($flag2 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$hourData[$datafield[3]]; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + $tmpData[]=$hourData[$datafield[4]]; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x66,0x33,0); + $tmpData[]=$hourData[$datafield[5]]; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xcc,0,0x66); + $tmpData[]=$hourData[$datafield[6]]; + } + if($flag6 == "on") + { + $tmpColor[]=array(0xcc,0xee,0x66); + $tmpData[]=$hourData[$datafield[7]]; + } + if($keyOne > 1) + { + if($flag7 == "on") + { + $tmpColor[]=array(0xff,0,0); + $tmpData[]=$hourData[$datafield[8]]; + } + } + + echo "
      Hourly Statistic Chart
      "; + + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + $boldline=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + if($keyOne == 1) + { + $remarkBlock=array( + "Success", + "Normal", + "No Resource", + "No Service", + "Invalid Service", + "Invalid Message", + "Signal Error" + ); + } + else if($keyOne == 2 || $keyOne == 3) + { + $remarkBlock=array( + "Success", + "Normal", + "Call Deny", + "Net Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error" + ); + } + else if($keyOne == 4 || $keyOne == 5) + { + $remarkBlock=array( + "Success", + "Normal", + "Sub Error", + "No Service", + "Net Busy", + "Message Error", + "Signal Error", + "No Resource" + ); + } + $pointArr=array( + array(60,367), + array(160,367), + array(260,367), + array(360,367), + array(460,367), + array(560,367), + array(660,367) + ); + + if($keyOne > 1) + $pointArr[]=array(760,367); + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0x33); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + $tmpColor[]=array(0x66,0,0xcc); + $tmpColor[]=array(0x66,0x33,0); + $tmpColor[]=array(0xcc,0,0x66); + $tmpColor[]=array(0xcc,0xee,0x66); + if($keyOne > 1) + $tmpColor[]=array(0xff,0,0); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} + +//Graphics-2 +if(!($keyOne == 1 || $keyOne == 4 || $keyOne == 5)) +{ + for($i=0;$i<$total_hour_num;$i++) + { + if($hourData[Success][$i] > 0) + $hourData[AveDuration][$i]=ceil($hourData[Duration][$i]/$hourData[Success][$i]); + else + $hourData[AveDuration][$i]=0; + } + + unset($tmpColor); + unset($tmpData); + + if($keyOne == 1) + { + if($flag7 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$hourData[Duration]; + } + if($flag8 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$hourData[AveDuration]; + } + $lineStart=7; + } + else + { + if($flag8 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$hourData[Duration]; + } + if($flag9 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$hourData[AveDuration]; + } + $lineStart=8; + } + + echo "

      Duration Statistic Chart
      "; + $image=CreateImage(820,390); + + $boldline=$select_checkbox_id-$lineStart; + for($i=$lineStart;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + + $remarkBlock=array( + "Total Call Duration", + "Average Call Duration" + ); + $pointArr=array( + array(60,367), + array(260,367) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} +?> diff --git a/wxc2_omc/performance/generalCsta/ipalim_tg_day.php b/wxc2_omc/performance/generalCsta/ipalim_tg_day.php new file mode 100755 index 0000000..d482369 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/ipalim_tg_day.php @@ -0,0 +1,367 @@ +"; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +} +if(!isset($keyTwo) || trim($keyTwo)=="") + $keyTwo=0; + +for($i=0;$i<=256;$i++) +{ + $trunk_element_title[$i]="--"; +} +$dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + +//===get the title of tg===== +$database="OBJ_378"; +$sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle'"; +$TrunkGroupCount=mysqli_num_rows($result); + +if($TrunkGroupCount>0) +{ + while($rows = @mysqli_fetch_array($result)) + { + //get the instanceNo of the tg + $trunk_no=$rows[instanceNo]+0; + $trunk_status[$trunk_no]=1; + $trunk_element_title[$trunk_no]=$rows[initValue]; + } +} +if(0) +{ + echo "
      ";
      +	print_r($trunk_status);
      +	print_r($trunk_element_title);
      +	echo "
      "; +} + +$cstaConf=GetCstaConf($sysTypeNo); +if(0) +{ + echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to
      "; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); + +$type_select=$keyTwo+1; +$cstaDataTmp=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail",$type_select); +$cstaData=$cstaDataTmp[0]; +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +$typeLabel=array( + 1=>"LU", + 2=>"Call MO", + 3=>"Call MT", + 4=>"SM MO", + 5=>"SM MT" +); + +//Table-1 +{ + $table_title="Trunk Group {$typeLabel[$type_select]} Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + + switch($type_select) + { + //LU + case 1: + $showfield=array( + "Attempt", + "Success", + "Normal", + "No Resource", + "No Service", + "Invalid Service", + "Invalid Message", + "Signal Error", + "Duration", + "Average Duration" + ); + $datafield=array( + "Attempt", + "Success", + "lu_normal", + "lu_res_not_ok", + "lu_ser_not_ok", + "lu_ser_no_imp", + "lu_msg_error", + "lu_pro_error", + "Duration" + ); + break; + case 2: + case 3: + $showfield=array( + "Attempt", + "Success", + "Normal", + "Call Deny", + "Net Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error", + "Duration", + "Average Duration" + ); + $datafield=array( + "Attempt", + "Success", + "cc_normal", + "cc_call_deny", + "cc_net_busy", + "cc_caller_clear", + "cc_sub_busy", + "cc_no_answer", + "cc_sig_error", + "Duration" + ); + break; + case 4: + case 5: + $showfield=array( + "Attempt", + "Success", + "Normal", + "Sub Error", + "No Service", + "Net Busy", + "Message Error", + "Signal Error", + "No Resource", + "Duration", + "Average Duration" + ); + $datafield=array( + "Attempt", + "Success", + "sm_normal", + "sm_error_sub", + "sm_ser_not_ok", + "sm_net_busy", + "sm_msg_error", + "sm_pro_error", + "sm_res_not_ok", + "Duration" + ); + break; + default: + echo "unknown type"; + break; + } + $showfieldnum=sizeof($showfield); + $datafieldnum=sizeof($datafield); + + echo ""; + echo ""; + echo ""; + echo ""; + $fieldwidth=(100-16)/$showfieldnum; + for($i=0;$i<$showfieldnum;$i++) + { + echo ""; + } + echo ""; + + for($i=0;$i<=256;$i++) + { + if($trunk_status[$i] != 1) + continue; + echo ""; + echo ""; + + echo ""; + + for($j=0;$j<$showfieldnum;$j++) + { + echo ""; + } + + echo ""; + } + echo "
      TG NO.Element Title{$showfield[$i]}
      "; + echo ""; + echo "$i"; + echo ""; + echo ""; + echo "{$trunk_element_title[$i]}"; + echo ""; + //Attempt + if($j == 0) + { + $value=$cstaData[$type_select][$i][Attempt]+0; + echo "$value"; + } + //Duration + else if($j == ($showfieldnum-2)) + { + $value=$cstaData[$type_select][$i][Duration]+0; + $timestamp=SecondToTimeStamp($value); + if($type_select == 1 || $type_select == 4 || $type_select == 5) + echo "--"; + else + { + echo "$value
      "; + echo "$timestamp"; + } + } + else if($j == ($showfieldnum-1)) + { + $tmp=$cstaData[$type_select][$i][Success]+0; + $value=$cstaData[$type_select][$i][Duration]+0; + if($tmp > 0) + $value=ceil($value/$tmp); + else + $value=0; + if($type_select == 1 || $type_select == 4 || $type_select == 5) + echo "--"; + else + echo "$value"; + } + else + { + $value=$cstaData[$type_select][$i][$datafield[$j]]+0; + $percent=GetPercent($value,$cstaData[$type_select][$i][Attempt]+0); + echo "$value
      "; + echo "$percent"; + } + echo "
      "; +} + +//Graphics-1 +{ + $colorSet=array( + 2=>array(0x66,0xff,0x33), + 3=>array(0x66,0xff,0xff), + 4=>array(0,0x66,0x66), + 5=>array(0x66,0,0xcc), + 6=>array(0x66,0x33,0), + 7=>array(0xcc,0,0x66), + 8=>array(0xff,0,0) + ); + + for($i=0;$i<=256;$i++) + { + for($j=2;$j<$datafieldnum-1;$j++) + { + $totalData[$datafield[$j]]+=$cstaData[$type_select][$i][$datafield[$j]]+0; + } + } + for($j=2;$j<$datafieldnum-1;$j++) + { + $tmpData[]=$totalData[$datafield[$j]]; + $tmpColor[]=$colorSet[$j]; + } + if(0) + { + echo "
      ";
      +		print_r($totalData);
      +		print_r($tmpData);
      +		print_r($tmpColor);
      +		echo "
      "; + } + echo "
      {$typeLabel[$type_select]} Cause Percentage Chart
      "; + $image=CreateImage(550,320); + + $image=DrawPercentHistogram( + $image, + $tmpData, + $tmpColor, + array(30,20), + array(500,250),1,0 + ); + + switch($type_select) + { + case 1: + $remarkBlock=array( + "Normal", + "No","Resource", + "No","Service", + "Invalid","Service", + "Invalid","Message", + "Signal","Error" + ); + $pointArr=array( + array(70,290), + array(160,285),array(140,295), + array(235,285),array(220,295), + array(297,285),array(297,295), + array(374,285),array(374,295), + array(454,285),array(456,295) + ); + break; + case 2: + case 3: + $remarkBlock=array( + "Normal", + "Call","Deny", + "Net","Busy", + "Caller","Clear", + "Sub","Busy", + "No","Answer", + "Signal","Error" + ); + $pointArr=array( + array(62,290), + array(136,285),array(136,295), + array(205,285),array(205,295), + array(265,285),array(265,295), + array(338,285),array(338,295), + array(408,285),array(398,295), + array(462,285),array(464,295) + ); + break; + case 4: + case 5: + $remarkBlock=array( + "Normal", + "Sub","Error", + "No","Service", + "Net","Busy", + "Message","Error", + "Signal","Error", + "No","Resource" + ); + $pointArr=array( + array(62,290), + array(136,285),array(136,295), + array(205,285),array(193,295), + array(265,285),array(265,295), + array(330,285),array(330,295), + array(398,285),array(398,295), + array(471,285),array(458,295) + ); + break; + } + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + + DrawImage($image); +} +?> diff --git a/wxc2_omc/performance/generalCsta/ipalim_tg_hour.php b/wxc2_omc/performance/generalCsta/ipalim_tg_hour.php new file mode 100755 index 0000000..fdb03a6 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/ipalim_tg_hour.php @@ -0,0 +1,528 @@ +"; + echo "sysTypeNo=$sysTypeNo,show_type=$show_type,page_id=$page_id,keyOne=$keyOne,keyTwo=$keyTwo
      "; + echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to
      "; + echo "select_checkbox_id=$select_checkbox_id
      "; +} + +echo ""; +echo ""; + + +$trunk_element_title="--"; +$dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + +//===get the title of tg===== +$instanceNo=omc_keep_length($keyOne,'0',4); +$database="OBJ_378"; +$sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle' and T1.instanceNo='$instanceNo' "; +$result=@mysqli_query($objDbConn,$sql); +$TrunkGroupCount=mysqli_num_rows($result); + +if($TrunkGroupCount>0) +{ + $rows = @mysqli_fetch_array($result); + $trunk_element_title=$rows[initValue]; +} + + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$tgno=$keyOne; +$type_select=$keyTwo+1; +$cstaDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail",$type_select,$tgno); +$cstaData=$cstaDataTmp[0][$type_select][$tgno]; +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +$typeLabel=array( + 1=>"LU", + 2=>"Call MO", + 3=>"Call MT", + 4=>"SM MO", + 5=>"SM MT" +); + +switch($type_select) +{ +//LU +case 1: + $showfield=array( + "Attempt", + "Success", + "Normal", + "No Resource", + "No Service", + "Invalid Service", + "Invalid Message", + "Signal Error", + "Duration", + "Average Duration" + ); + $datafield=array( + "Attempt", + "Success", + "lu_normal", + "lu_res_not_ok", + "lu_ser_not_ok", + "lu_ser_no_imp", + "lu_msg_error", + "lu_pro_error", + "Duration" + ); + break; +case 2: +case 3: + $showfield=array( + "Attempt", + "Success", + "Normal", + "Call Deny", + "Net Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error", + "Duration", + "Average Duration" + ); + $datafield=array( + "Attempt", + "Success", + "cc_normal", + "cc_call_deny", + "cc_net_busy", + "cc_caller_clear", + "cc_sub_busy", + "cc_no_answer", + "cc_sig_error", + "Duration" + ); + break; +case 4: +case 5: + $showfield=array( + "Attempt", + "Success", + "Normal", + "Sub Error", + "No Service", + "Net Busy", + "Message Error", + "Signal Error", + "No Resource", + "Duration", + "Average Duration" + ); + $datafield=array( + "Attempt", + "Success", + "sm_normal", + "sm_error_sub", + "sm_ser_not_ok", + "sm_net_busy", + "sm_msg_error", + "sm_pro_error", + "sm_res_not_ok", + "Duration" + ); + break; +default: + echo "unknown type"; + break; +} +$showfieldnum=sizeof($showfield); +$datafieldnum=sizeof($datafield); + +//Table-1 +{ + $table_title="TG $tgno [$trunk_element_title]"; + $table_title.=" $typeLabel[$type_select] "; + $table_title.="Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + $fieldwidth=90/$showfieldnum; + for($i=0;$i<$showfieldnum;$i++) + { + echo ""; + } + echo ""; + for($hour=0;$hour<$total_hour_num;$hour++) + { + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y")))."H"; + echo ""; + + echo ""; + + for($j=0;$j<$showfieldnum;$j++) + { + $cstaData[$datafield[$j]][$hour]+=0; + echo ""; + } + + echo ""; + } + + echo "
      Time$showfield[$i]
      "; + echo "$hour_title"; + echo ""; + //Attempt + if($j == 0) + { + $value=$cstaData[Attempt][$hour]+0; + echo "$value"; + } + //Duration + else if($j == ($showfieldnum-2)) + { + $value=$cstaData[Duration][$hour]+0; + $timestamp=SecondToTimeStamp($value); + if($type_select == 1 || $type_select == 4 || $type_select == 5) + echo "--"; + else + { + echo "$value
      "; + echo "$timestamp"; + } + } + else if($j == ($showfieldnum-1)) + { + $tmp=$cstaData[Success][$hour]+0; + $value=$cstaData[Duration][$hour]+0; + if($tmp > 0) + $value=ceil($value/$tmp); + else + $value=0; + if($type_select == 1 || $type_select == 4 || $type_select == 5) + echo "--"; + else + echo "$value"; + } + else + { + $value=$cstaData[$datafield[$j]][$hour]+0; + $percent=GetPercent($value,$cstaData[Attempt][$hour]+0); + echo "$value
      "; + echo "$percent"; + } + echo "
      "; +} + +//Graphics-1 +{ + unset($tmpColor); + unset($tmpData); + + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + $tmpData[]=$cstaData[$datafield[1]]; + } + + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$cstaData[$datafield[2]]; + } + if($flag2 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$cstaData[$datafield[3]]; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + $tmpData[]=$cstaData[$datafield[4]]; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x66,0x33,0); + $tmpData[]=$cstaData[$datafield[5]]; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xcc,0,0x66); + $tmpData[]=$cstaData[$datafield[6]]; + } + if($flag6 == "on") + { + $tmpColor[]=array(0xcc,0xee,0x66); + $tmpData[]=$cstaData[$datafield[7]]; + } + if($type_select > 1) + { + if($flag7 == "on") + { + $tmpColor[]=array(0xff,0xee,0); + $tmpData[]=$cstaData[$datafield[8]]; + } + } + + echo "
      Hourly Statistic Chart
      "; + + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + $boldline=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + unset($tmpColor); + unset($remarkBlock); + switch($type_select) + { + case 1: + $remarkBlock=array( + "Success", + "Normal", + "No Resource", + "No Service", + "Invalid Service", + "Invalid Message", + "Signal Error" + ); + $tmpColor=array( + array(0x66,0xff,0x33), + array(0x66,0xff,0xff), + array(0,0x66,0x66), + array(0x66,0,0xcc), + array(0x66,0x33,0), + array(0xcc,0,0x66), + array(0xcc,0xee,0x66) + ); + $pointArr=array( + array(60,367), + array(160,367), + array(260,367), + array(360,367), + array(460,367), + array(560,367), + array(660,367) + ); + break; + case 2: + case 3: + $remarkBlock=array( + "Success", + "Normal", + "Call Deny", + "Net Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error" + ); + $tmpColor=array( + array(0x66,0xff,0x33), + array(0x66,0xff,0xff), + array(0,0x66,0x66), + array(0x66,0,0xcc), + array(0x66,0x33,0), + array(0xcc,0,0x66), + array(0xcc,0xee,0x66), + array(0xff,0,0) + ); + $pointArr=array( + array(60,367), + array(160,367), + array(260,367), + array(360,367), + array(460,367), + array(560,367), + array(660,367), + array(760,367) + ); + break; + case 4: + case 5: + $remarkBlock=array( + "Success", + "Normal", + "Sub","Error", + "No","Service", + "Net","Busy", + "Message","Error", + "Signal","Error", + "No","Resource" + ); + $tmpColor=array( + array(0x66,0xff,0x33), + array(0x66,0xff,0xff), + array(0,0x66,0x66), + array(0x66,0,0xcc), + array(0x66,0x33,0), + array(0xcc,0,0x66), + array(0xcc,0xee,0x66), + array(0xff,0,0) + ); + $pointArr=array( + array(60,367), + array(160,367), + array(260,367), + array(360,367), + array(460,367), + array(560,367), + array(660,367), + array(760,367) + ); + break; + } + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} + +//Graphics-2 +if(!($type_select == 1 || $type_select == 4 || $type_select == 5)) +{ + for($i=0;$i<$total_hour_num;$i++) + { + if($cstaData[Success][$i] > 0) + $cstaData[AveDuration][$i]=ceil($cstaData[Duration][$i]/$cstaData[Success][$i]); + else + $cstaData[AveDuration][$i]=0; + } + + unset($tmpColor); + unset($tmpData); + + if($type_select == 1) + { + if($flag7 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$cstaData[Duration]; + } + if($flag8 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$cstaData[AveDuration]; + } + $lineStart=7; + } + else + { + if($flag8 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$cstaData[Duration]; + } + if($flag9 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$cstaData[AveDuration]; + } + $lineStart=8; + } + + echo "

      Duration Statistic Chart
      "; + $image=CreateImage(820,390); + + $boldline=$select_checkbox_id-$lineStart; + for($i=$lineStart;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + + $remarkBlock=array( + "Total Call Duration", + "Average Call Duration" + ); + $pointArr=array( + array(60,367), + array(260,367) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} +?> \ No newline at end of file diff --git a/wxc2_omc/performance/generalCsta/irls_service_day.php b/wxc2_omc/performance/generalCsta/irls_service_day.php new file mode 100755 index 0000000..0d122bb --- /dev/null +++ b/wxc2_omc/performance/generalCsta/irls_service_day.php @@ -0,0 +1,264 @@ +"; + echo "keyTwo=$keyTwo
      "; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaData=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="iRLS Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[0][1][Attempt]+0; + echo ""; + + $value=$cstaData[0][1][Success]+0; + echo ""; + + $value=$cstaData[0][1][oper_fail]+0; + echo ""; + + $value=$cstaData[0][1][cre_vim_fail]+0; + echo ""; + + $value=$cstaData[0][1][conn_local_fail]+0; + echo ""; + + //$value=$cstaData[0][1][conn_vim_fail]+0; + //echo ""; + + $value=$cstaData[0][1][excep_retr_fail]+0; + echo ""; + + $value=$cstaData[0][1][noti_req_fail]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[0][2][Attempt]+0; + echo ""; + + $value=$cstaData[0][2][Success]+0; + echo ""; + + $value=$cstaData[0][2][oper_fail]+0; + echo ""; + + $value=$cstaData[0][2][cre_vim_fail]+0; + echo ""; + + $value=$cstaData[0][2][conn_local_fail]+0; + echo ""; + + //$value=$cstaData[0][2][conn_vim_fail]+0; + //echo ""; + + $value=$cstaData[0][2][excep_retr_fail]+0; + echo ""; + + $value=$cstaData[0][2][noti_req_fail]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[0][3][Attempt]+0; + echo ""; + + $value=$cstaData[0][3][Success]+0; + echo ""; + + $value=$cstaData[0][3][oper_fail]+0; + echo ""; + + $value=$cstaData[0][3][cre_vim_fail]+0; + echo ""; + + $value=$cstaData[0][3][conn_vim_fail]+0; + echo ""; + + $value=$cstaData[0][3][excep_retr_fail]+0; + echo ""; + + $value=$cstaData[0][3][noti_req_fail]+0; + echo ""; + echo ""; + + echo "
      TypeAttemptSuccessOperation FailCreate
      Channel
      Fail
      Connect
      Channel
      Fail
      Retrieve FailNotification
      Request
      Fail
      MO$value$value$value$value$value$value$value--
      MT$value$value$value$value$value$value$value--
      VIM$value$value$value$value$value$value$value
      "; +} + +//Graphics-1 +{ + echo "
      Statistic Chart
      "; + + unset($tmpData); + $type_index=0; + $column_index=0; + $block_index=0; + + //Attempt + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][1][Attempt]+0; + $block_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][2][Attempt]+0; + $block_index=0; + $column_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][3][Attempt]+0; + + + //Success + $type_index++; + $column_index=0; + $block_index=0; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][1][Success]+0; + $block_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][2][Success]+0; + $block_index=0; + $column_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][3][Success]+0; + + + //Operation Fail + $type_index++; + $column_index=0; + $block_index=0; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][1][oper_fail]+0; + $block_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][2][oper_fail]+0; + $block_index=0; + $column_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][3][oper_fail]+0; + + //Create Vritual/VIM Fail + $type_index++; + $column_index=0; + $block_index=0; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][1][cre_vim_fail]+0; + $block_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][2][cre_vim_fail]+0; + $block_index=0; + $column_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][3][cre_vim_fail]+0; + + //Connect Local/VIM Fail + $type_index++; + $column_index=0; + $block_index=0; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][1][conn_local_fail]+0; + $block_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][2][conn_local_fail]+0; + $block_index=0; + $column_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][3][conn_vim_fail]+0; + + //Retrieve Fail + $type_index++; + $column_index=0; + $block_index=0; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][1][excep_retr_fail]+0; + $block_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][2][excep_retr_fail]+0; + $block_index=0; + $column_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][3][excep_retr_fail]+0; + + //Notification Request Fail + $type_index++; + $column_index=0; + $block_index=0; + $tmpData[$type_index][$column_index][$block_index]=0; + $block_index++; + $tmpData[$type_index][$column_index][$block_index]=0; + $block_index=0; + $column_index++; + $tmpData[$type_index][$column_index][$block_index]=$cstaData[0][3][noti_req_fail]+0; + + if(0) + { + echo "
      ";
      +		print_r($tmpData);
      +		echo "
      "; + } + + $tmpColor[]=array(0xaa,0x44,0x22); + $tmpColor[]=array(0x22,0xbb,0x22); + $tmpColor[]=array(0x22,0x22,0xbb); + + $image=CreateImage(840,420); + $image=DrawMuliStackPercentHistogram($image,$tmpData,$tmpColor,$pointInterval,2,array(30,20),array(780,340),1,0); + + + + $remarkBlock=array( + "MO", + "MT", + "VIM" + ); + $pointArr=array( + array(145,400), + array(400,400), + array(680,400) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array( + "Attempt", + "Success", + "Operation","Fail", + "Create","Channel","Fail", + "Connect","Channel","Fail", + "Retrieve","Fail", + "Notification","Request","Fail" + ); + $pointArr=array( + array(90,370), + array(192,370), + array(288,365),array(304,375), + array(405,360),array(402,370),array(411,380), + array(504,360),array(505,370),array(512,380), + array(607,365),array(615,375), + array(700,360),array(712,370),array(720,380) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + + DrawImage($image); +} +?> diff --git a/wxc2_omc/performance/generalCsta/mhc_service_day.php b/wxc2_omc/performance/generalCsta/mhc_service_day.php new file mode 100755 index 0000000..5a3e901 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/mhc_service_day.php @@ -0,0 +1,181 @@ +"; + echo "keyTwo=$keyTwo
      "; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +$cstaData=$cstaDataTmp[0][1]; +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="MHC Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[hlr_noti_mhc]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[mhc_noti_hlr]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[rep_att]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[rep_suc]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[rep_fail]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_att]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_suc]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_fail]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_del_att]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_del_suc]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_del_fail]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_dld_att]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_dld_suc]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[veri_dld_fail]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[mhc_msg_sent]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[mhc_msg_recv]+0; + echo ""; + echo ""; + echo "
      TypeValue
      HLR Notify MHC$value
      MHC Notify HLR$value
      Replication Attempt$value
      Replication Success$value
      Replication Fail$value
      Verification Attempt$value
      Verification Success$value
      Verification Fail$value
      Verification Deleted Attempt$value
      Verification Deleted Success$value
      Verification Deleted Fail$value
      Verification Download Attempt$value
      Verification Download Success$value
      Verification Download Fail$value
      MHC Message Sent$value
      MHC Message Received$value
      "; + +} + +//Table-2 +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $field_label=array( + "syn_o_a_", + "syn_o_s_", + "syn_o_f_", + "syn_i_a_", + "syn_i_s_", + "syn_i_f_" + ); + for($i=0;$i<16;$i++) + { + echo ""; + echo ""; + for($j=0;$j<6;$j++) + { + $field=$field_label[$j]."$i"; + $value=$cstaData[$field]+0; + echo ""; + } + echo ""; + } + + echo "
      Node IndexSynchronization OutgoingSynchronization Incoming
      AttemptSuccessFailAttemptSuccessFail
      $i$value
      "; + +} +?> diff --git a/wxc2_omc/performance/generalCsta/mrfc_service_day.php b/wxc2_omc/performance/generalCsta/mrfc_service_day.php new file mode 100755 index 0000000..8050ae9 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/mrfc_service_day.php @@ -0,0 +1,287 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaData=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="MRFC Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + //Attempt + $value=$cstaData[0][1][Attempt]+0; + echo ""; + + //Success + $value=$cstaData[0][1][Success]+0; + $percent=GetPercent($cstaData[0][1][Success],$cstaData[0][1][Attempt]); + echo ""; + + //No Resource + $value=$cstaData[0][1][Cau1]+0; + $percent=GetPercent($cstaData[0][1][Cau1],$cstaData[0][1][Attempt]); + echo ""; + + //Negotiation Fail + $value=$cstaData[0][1][Cau2]+0; + $percent=GetPercent($cstaData[0][1][Cau2],$cstaData[0][1][Attempt]); + echo ""; + + //Media Error + $value=$cstaData[0][1][Cau3]+0; + $percent=GetPercent($cstaData[0][1][Cau3],$cstaData[0][1][Attempt]); + echo ""; + + //No Response + $value=$cstaData[0][1][Cau4]+0; + $percent=GetPercent($cstaData[0][1][Cau4],$cstaData[0][1][Attempt]); + echo ""; + + //General Error + $value=$cstaData[0][1][Cau5]+0; + $percent=GetPercent($cstaData[0][1][Cau5],$cstaData[0][1][Attempt]); + echo ""; + + //Total Call Duration + $value=$cstaData[0][1][Duration]+0; + $timestamp=SecondToTimeStamp($value); + echo ""; + + //Average Call Duration + if($cstaData[0][1][Success] > 0) + $value=ceil($cstaData[0][1][Duration]/$cstaData[0][1][Success]); + else + $value=0; + echo ""; + echo ""; + + echo ""; + echo ""; + + //Attempt + $value=$cstaData[0][2][Attempt]+0; + echo ""; + + //Success + $value=$cstaData[0][2][Success]+0; + $percent=GetPercent($cstaData[0][2][Success],$cstaData[0][2][Attempt]); + echo ""; + + //No Resource + $value=$cstaData[0][2][Cau1]+0; + $percent=GetPercent($cstaData[0][2][Cau1],$cstaData[0][2][Attempt]); + echo ""; + + //Negotiation Fail + $value=$cstaData[0][2][Cau2]+0; + $percent=GetPercent($cstaData[0][2][Cau2],$cstaData[0][2][Attempt]); + echo ""; + + //Media Error + $value=$cstaData[0][2][Cau3]+0; + $percent=GetPercent($cstaData[0][2][Cau3],$cstaData[0][2][Attempt]); + echo ""; + + //No Response + $value=$cstaData[0][2][Cau4]+0; + $percent=GetPercent($cstaData[0][2][Cau4],$cstaData[0][2][Attempt]); + echo ""; + + //General Error + $value=$cstaData[0][2][Cau5]+0; + $percent=GetPercent($cstaData[0][2][Cau5],$cstaData[0][2][Attempt]); + echo ""; + + //Total Call Duration + $value=$cstaData[0][2][Duration]+0; + $timestamp=SecondToTimeStamp($value); + echo ""; + + //Average Call Duration + if($cstaData[0][2][Success] > 0) + $value=ceil($cstaData[0][2][Duration]/$cstaData[0][2][Success]); + else + $value=0; + echo ""; + echo ""; + + echo "
      TypeAttemptSuccessNo ResourceNegotiation FailMedia ErrorNo ResponseGeneral ErrorTotal Call DurationAverage Call Duration(s)
      "; + echo ""; + echo "Conference"; + echo ""; + echo "$value"; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$timestamp"; + echo "
      "; + echo "$value
      "; + echo "
      "; + echo ""; + echo "Transcoding"; + echo ""; + echo "$value"; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$percent"; + echo "
      "; + echo "$value
      "; + echo "$timestamp"; + echo "
      "; + echo "$value
      "; + echo "
      "; +} + +//Graphics-1 +{ + echo "
      Service(Attempt) & Success/Failure
      "; + unset($tmpData); + unset($tmpColor); + $tmpData[]=$cstaData[0][1][Attempt]+0; + $tmpData[]=$cstaData[0][2][Attempt]+0; + + $tmpColor[]=array(0x99,0x00,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + + $image=CreateImage(680,370); + $image=DrawPercentHistogram($image, + $tmpData, + $tmpColor, + array(30,20), + array(160,280),1,0 + ); + + unset($tmpData); + $data_index=0; + $tmpData[$data_index][0]=$cstaData[0][1][Success]+0; + $tmpData[$data_index][1]=$cstaData[0][2][Success]+0; + $data_index++; + $tmpData[$data_index][0]=$cstaData[0][1][Cau1]+0; + $tmpData[$data_index][1]=$cstaData[0][2][Cau1]+0; + $data_index++; + $tmpData[$data_index][0]=$cstaData[0][1][Cau2]+0; + $tmpData[$data_index][1]=$cstaData[0][2][Cau2]+0; + $data_index++; + $tmpData[$data_index][0]=$cstaData[0][1][Cau3]+0; + $tmpData[$data_index][1]=$cstaData[0][2][Cau3]+0; + $data_index++; + $tmpData[$data_index][0]=$cstaData[0][1][Cau4]+0; + $tmpData[$data_index][1]=$cstaData[0][2][Cau4]+0; + $data_index++; + $tmpData[$data_index][0]=$cstaData[0][1][Cau5]+0; + $tmpData[$data_index][1]=$cstaData[0][2][Cau5]+0; + $data_index++; + + $image=DrawStackPercentHistogram($image, + $tmpData, + $tmpColor, + array(220,20), + array(420,280),0,1 + ); + + $remarkBlock=array( + "Attempt", + "Success", + "No","Resource", + "Negotiation","Fail", + "Media","Error", + "No","Response", + "General","Error" + ); + + $pointArr=array( + array(90,320), + array(245,310), + array(330,305),array(315,315), + array(365,305),array(387,315), + array(448,305),array(447,315), + array(520,305),array(507,315), + array(572,305),array(577,315) + ); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array( + "Conference", + "Transcoding" + ); + + $pointArr=array( + array(50,340), + array(340,340), + ); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + + DrawImage($image); +} +?> diff --git a/wxc2_omc/performance/generalCsta/mrfc_service_hour.php b/wxc2_omc/performance/generalCsta/mrfc_service_hour.php new file mode 100755 index 0000000..a3d5846 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/mrfc_service_hour.php @@ -0,0 +1,319 @@ +"; + echo "sysTypeNo=$sysTypeNo,show_type=$show_type,page_id=$page_id,keyOne=$keyOne
      "; + echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to
      "; + echo "select_checkbox_id=$select_checkbox_id
      "; +} + +echo ""; +echo ""; + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaData=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail",$keyOne); +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + if($keyOne == 1) + $table_title="Conference"; + else + $table_title="Transcoding"; + if($slot > 1) + $table_title.=" Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=" Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($hour=0;$hour<$total_hour_num;$hour++) + { + echo ""; + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + echo "
      TimeAttemptSuccessNo ResourceNegotiation FailMedia ErrorNo ResponseGeneral ErrorTotal Call DurationAverage Call Duration(s)
      {$hour_title}H"; + $value=$cstaData[0][$keyOne][Attempt][$hour]+0; + echo "$value"; + echo ""; + $value=$cstaData[0][$keyOne][Success][$hour]+0; + $percent=GetPercent($cstaData[0][$keyOne][Success][$hour],$cstaData[0][$keyOne][Attempt][$hour]); + echo "$value
      "; + echo "$percent"; + echo "
      "; + $value=$cstaData[0][$keyOne][Cau1][$hour]+0; + $percent=GetPercent($cstaData[0][$keyOne][Cau1][$hour],$cstaData[0][$keyOne][Attempt][$hour]); + echo "$value
      "; + echo "$percent"; + echo "
      "; + $value=$cstaData[0][$keyOne][Cau2][$hour]+0; + $percent=GetPercent($cstaData[0][$keyOne][Cau2][$hour],$cstaData[0][$keyOne][Attempt][$hour]); + echo "$value
      "; + echo "$percent"; + echo "
      "; + $value=$cstaData[0][$keyOne][Cau3][$hour]+0; + $percent=GetPercent($cstaData[0][$keyOne][Cau3][$hour],$cstaData[0][$keyOne][Attempt][$hour]); + echo "$value
      "; + echo "$percent"; + echo "
      "; + $value=$cstaData[0][$keyOne][Cau4][$hour]+0; + $percent=GetPercent($cstaData[0][$keyOne][Cau4][$hour],$cstaData[0][$keyOne][Attempt][$hour]); + echo "$value
      "; + echo "$percent"; + echo "
      "; + $value=$cstaData[0][$keyOne][Cau5][$hour]+0; + $percent=GetPercent($cstaData[0][$keyOne][Cau5][$hour],$cstaData[0][$keyOne][Attempt][$hour]); + echo "$value
      "; + echo "$percent"; + echo "
      "; + $value=$cstaData[0][$keyOne][Duration][$hour]+0; + $timestamp=SecondToTimeStamp($value); + echo "$value
      "; + echo "$timestamp"; + echo "
      "; + $value=$cstaData[0][$keyOne][Success][$hour]+0; + if($value == 0) + $tmp=0; + else + $tmp=ceil($cstaData[0][$keyOne][Duration][$hour]/$value); + echo "$tmp"; + echo "
      "; +} + +//Graphics-1 +{ + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + for($i=0;$i<$total_hour_num;$i++) + $suc_data[$i]=$cstaData[0][$keyOne][Success][$i]+0; + $tmpData[]=$suc_data; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + for($i=0;$i<$total_hour_num;$i++) + $cau1_data[$i]=$cstaData[0][$keyOne][Cau1][$i]+0; + $tmpData[]=$cau1_data; + } + if($flag2 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + for($i=0;$i<$total_hour_num;$i++) + $cau2_data[$i]=$cstaData[0][$keyOne][Cau2][$i]+0; + $tmpData[]=$cau2_data; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + for($i=0;$i<$total_hour_num;$i++) + $cau3_data[$i]=$cstaData[0][$keyOne][Cau3][$i]+0; + $tmpData[]=$cau3_data; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x66,0x33,0); + for($i=0;$i<$total_hour_num;$i++) + $cau4_data[$i]=$cstaData[0][$keyOne][Cau4][$i]+0; + $tmpData[]=$cau4_data; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xcc,0,0x66); + for($i=0;$i<$total_hour_num;$i++) + $cau5_data[$i]=$cstaData[0][$keyOne][Cau5][$i]+0; + $tmpData[]=$cau5_data; + } + + echo "
      Hourly Statistic Chart
      "; + + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + $boldline=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "Success", + "No Resource", + "Negotiation Fail", + "Media Error", + "No Response", + "General Error" + ); + $pointArr=array( + array(60,367), + array(180,367), + array(300,367), + array(420,367), + array(540,367), + array(660,367) + ); + + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0x33); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + $tmpColor[]=array(0x66,0,0xcc); + $tmpColor[]=array(0x66,0x33,0); + $tmpColor[]=array(0xcc,0,0x66); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} + +//Graphics-2 +{ + for($i=0;$i<$total_hour_num;$i++) + { + $value=$cstaData[0][$keyOne][Success][$i]+0; + $duration_value[$i]=$cstaData[0][$keyOne][Duration][$i]+0; + if($value > 0) + $aveduration_value[$i]=ceil($duration_value[$i]/$value); + else + $aveduration_value[$i]=0; + } + unset($tmpColor); + unset($tmpData); + + if($flag6 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$duration_value; + } + if($flag7 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$aveduration_value; + } + if(0) + { + echo "
      ";
      +		print_r($tmpData);
      +		echo "
      "; + } + echo "

      Duration Statistic Chart
      "; + $image=CreateImage(820,390); + + $boldline=$select_checkbox_id-6; + for($i=6;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + + $remarkBlock=array( + "Total Call Duration", + "Average Call Duration" + ); + $pointArr=array( + array(60,367), + array(260,367) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} +?> diff --git a/wxc2_omc/performance/generalCsta/msc_bhca.php b/wxc2_omc/performance/generalCsta/msc_bhca.php new file mode 100755 index 0000000..fec0630 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/msc_bhca.php @@ -0,0 +1,667 @@ +"; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +} + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$total_hour_num=24*$slot; +echo ""; +echo ""; + +//Service +if($keyTwo == 0) +{ + $cstaData[5]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",5); + $cstaData[6]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",6); + $cstaData[7]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",7); + $cstaData[8]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",8); + $cstaData[9]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",9); + $cstaData[10]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",10); + $cstaData[11]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",11); + $cstaData[12]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",12); + $cstaData[13]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",13); + $cstaData[14]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",14); + $cstaData[15]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",15); + $cstaData[16]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",16); + $cstaData[17]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",17); + $cstaData[18]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",18); + $cstaData[19]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",19); + $cstaData[20]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",20); + $cstaData[21]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",21); + $cstaData[22]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",22); + + if(0) + { + echo "
      ";
      +		print_r($cstaData);
      +		echo "
      "; + } + + //Table-1 + { + $table_title="Service BHCA Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + echo ""; + + $service_label=array( + 1=>"SUB SUB", + 2=>"SUB TRK", + 3=>"TRK SUB", + 4=>"TRK TRK", + 5=>"INTRA", + 6=>"SUB IP", + 7=>"TRK IP", + 8=>"MO", + 9=>"MT", + 10=>"IN TRK", + 11=>"OUT TRK", + ); + $service_num=sizeof($service_label); + + $service_labelobj=array( + "SUB SUB"=>"5,17", + "SUB TRK"=>"6,18", + "TRK SUB"=>"7,19", + "TRK TRK"=>"8", + "INTRA"=>"9", + "SUB IP"=>"10,20", + "TRK IP"=>"11", + "MO"=>"12,21", + "MT"=>"13,22", + "IN TRK"=>"14", + "OUT TRK"=>"15", + "IP"=>"16" + ); + + $objInderRelation=array( + 5=>1,6=>1,7=>1,8=>1, + 9=>2, + 10=>3, + 11=>3, + 12=>4, + 13=>4, + 14=>5, + 15=>5, + 16=>6, + 17=>7,18=>7,19=>7,20=>7,21=>7,22=>7); + + for($i=1;$i<=$service_num;$i++) + { + $service_dataobj=explode(',',$service_labelobj[$service_label[$i]]); + echo ""; + for($day=0;$day<$slot;$day++) + { + $value=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + if(sizeof($service_dataobj)>1) + echo ""; + else + echo ""; + for($hour=0;$hour<24;$hour++) + { + if($hour==0) + echo ""; + if($hour==12) + echo ""; + $value=omc_keep_length($hour,'0',2); + echo ""; + if($hour == 11) + { + for($ii=0;$ii"; + for($iii=0;$iii<12;$iii++) + { + if($ii==0&&$iii==0) + echo ""; + else if($ii==1&&$iii==0) + echo ""; + $objindex=$objInderRelation[$service_dataobj[$ii]]; + $bhca=$cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Success][$day*24+$iii]+0; + $cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][BHCA][$day*24+$iii]=$bhca; + echo ""; + } + echo ""; + } + } + if($hour == 23) + { + for($ii=0;$ii"; + for($iii=12;$iii<24;$iii++) + { + if($ii==0&&$iii==12) + echo ""; + else if($ii==1&&$iii==12) + echo ""; + $objindex=$objInderRelation[$service_dataobj[$ii]]; + $bhca=$cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Success][$day*24+$iii]+0; + $cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][BHCA][$day*24+$iii]=$bhca; + echo ""; + } + echo ""; + } + } + } + } + } + echo "
      {$service_label[$i]}  BHCA
      $value
      $value  $valueGSMUMTS$bhca
      GSMUMTS$bhca
      "; + } + + //Graphics-1 + { + if($flag0 == "on") + { + $tmpColor[]=array(0x99,0x22,0x33); + $tmpData[]=$cstaData[5][1][5][BHCA]; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpData[]=$cstaData[6][1][6][BHCA]; + } + if($flag2 == "on") + { + $tmpColor[]=array(0x99,0x99,0x00); + $tmpData[]=$cstaData[7][1][7][BHCA]; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x99,0x99,0x99); + $tmpData[]=$cstaData[8][1][8][BHCA]; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x99,0xff,0x33); + $tmpData[]=$cstaData[9][2][9][BHCA]; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xff,0x99,0x66); + $tmpData[]=$cstaData[10][3][10][BHCA]; + } + if($flag6 == "on") + { + $tmpColor[]=array(0xff,0x00,0x00); + $tmpData[]=$cstaData[11][3][11][BHCA]; + } + if($flag7 == "on") + { + $tmpColor[]=array(0xff,0xff,0x00); + $tmpData[]=$cstaData[12][4][12][BHCA]; + } + if($flag8 == "on") + { + $tmpColor[]=array(0x33,0x3,0x33); + $tmpData[]=$cstaData[13][4][13][BHCA]; + } + if($flag9 == "on") + { + $tmpColor[]=array(0x00,0xcc,0xff); + $tmpData[]=$cstaData[14][5][14][BHCA]; + } + if($flag10 == "on") + { + $tmpColor[]=array(0x00,0x22,0xcc); + $tmpData[]=$cstaData[15][5][15][BHCA]; + } + if($flag11 == "on") + { + $tmpColor[]=array(0xEE,0x00,0xff); + $tmpData[]=$cstaData[16][6][16][BHCA]; + } + + echo "
      BHCA Statistic Chart(GSM)
      "; + + if($select_checkbox_id>=0&&$select_checkbox_id<12) + { + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + $boldline1=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline1--; + } + } + $image=CreateImage(820,420); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline1,1,0,1 + ); + + $remarkBlock=array( + "SUB SUB", + "SUB TRK", + "TRK SUB", + "TRK TRK", + "INTRA", + "SUB IP", + "TRK IP", + "MO", + "MT", + "IN TRK", + "OUT TRK", + "IP" + ); + + $pointArr=array( + array(90,365), + array(260,365), + array(430,365), + array(600,365), + array(90,385), + array(260,385), + array(430,385), + array(600,385), + array(90,405), + array(260,405), + array(430,405), + array(600,405) + ); + + unset($tmpColor); + $tmpColor[]=array(0x99,0x22,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0x99,0x99,0x99); + $tmpColor[]=array(0x99,0xff,0x33); + $tmpColor[]=array(0xff,0x99,0x66); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x3,0x33); + $tmpColor[]=array(0x00,0xcc,0xff); + $tmpColor[]=array(0x00,0x22,0xcc); + $tmpColor[]=array(0xEE,0x00,0xff); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + } + + + //Graphics-2 UMTS + { + unset($tmpData); + unset($tmpColor); + if($flag12 == "on") + { + $tmpColor[]=array(0x99,0x22,0x33); + $tmpData[]=$cstaData[17][7][17][BHCA]; + } + if($flag13 == "on") + { + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpData[]=$cstaData[18][7][18][BHCA]; + } + if($flag14 == "on") + { + $tmpColor[]=array(0x99,0x99,0x00); + $tmpData[]=$cstaData[19][7][19][BHCA]; + } + if($flag15 == "on") + { + $tmpColor[]=array(0xff,0x00,0x00); + $tmpData[]=$cstaData[20][7][20][BHCA]; + } + if($flag16 == "on") + { + $tmpColor[]=array(0xff,0xff,0x00); + $tmpData[]=$cstaData[21][7][21][BHCA]; + } + if($flag17 == "on") + { + $tmpColor[]=array(0x33,0x3,0x33); + $tmpData[]=$cstaData[22][7][22][BHCA]; + } + + + echo "
      BHCA Statistic Chart(UMTS)
      "; + + + if($select_checkbox_id>11) + { + if(0) + { + echo "flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16,flag17=$flag17,boldline=$select_checkbox_id
      "; + } + $boldline=$select_checkbox_id; + for($i=12;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + } + $image=CreateImage(820,420); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array( + "SUB SUB", + "SUB TRK", + "TRK SUB", + "TRK IP", + "MO", + "MT" + ); + + $pointArr=array( + array(90,365), + array(260,365), + array(430,365), + array(600,365), + array(90,385), + array(260,385) + ); + + unset($tmpColor); + $tmpColor[]=array(0x99,0x22,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x3,0x33); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + } + + +} +//Trunk Group +else if($keyTwo == 1) +{ + //Get the trunk title + for($i=0;$i<=256;$i++) + { + $trunk_element_title[$i]="--"; + } + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + + //===get the title of tg===== + $database="OBJ_320"; + $sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle'"; + $result=@mysqli_query($objDbConn,$sql); + $TrunkGroupCount=mysqli_num_rows($result); + + if($TrunkGroupCount>0) + { + while($rows = @mysqli_fetch_array($result)) + { + //get the instanceNo of the tg + $trunk_no=$rows[instanceNo]+0; + $trunk_status[$trunk_no]=1; + $trunk_element_title[$trunk_no]=$rows[initValue]; + } + } + if(0) + { + echo "
      ";
      +		print_r($trunk_status);
      +		print_r($trunk_element_title);
      +		echo "
      "; + } + + $cstaData[3]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",3); + $cstaData[4]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",4); + if(0) + { + echo "
      ";
      +		print_r($cstaData);
      +		echo "
      "; + } + + //Table-1 + { + $table_title="Trunk Group BHCA Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + echo ""; + for($tg_no=0;$tg_no<=256;$tg_no++) + { + if($trunk_status[$tg_no] != 1) + continue; + echo ""; + echo ""; + echo ""; + for($day=0;$day<$slot;$day++) + { + $value=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + echo ""; + for($hour=0;$hour<24;$hour++) + { + $value=omc_keep_length($hour,'0',2); + echo ""; + if($hour == 11) + { + echo ""; + for($i=0;$i<12;$i++) + { + $bhca=$cstaData[3][0][3][$tg_no][Success][$day*24+$i]+$cstaData[4][0][4][$tg_no][Success][$day*24+$i]; + $cstaData[2][0][2][$tg_no][BHCA][$day*24+$i]=$bhca; + echo ""; + } + echo ""; + } + if($hour == 23) + { + echo ""; + for($i=12;$i<24;$i++) + { + $bhca=$cstaData[3][0][3][$tg_no][Success][$day*24+$i]+$cstaData[4][0][4][$tg_no][Success][$day*24+$i]; + $cstaData[2][0][2][$tg_no][BHCA][$day*24+$i]=$bhca; + echo ""; + } + echo ""; + } + } + } + } + echo "
      TG {$tg_no}[{$trunk_element_title[$tg_no]}]  BHCA
      $value$value
      $bhca
      $bhca
      "; + } + + //Graphics-1 + { + + $tmp=explode(",",$trunk_text); + $trunk_no_0=$tmp[0]+0; + $trunk_no_1=$tmp[1]+0; + if(0) + { + echo "trunk_text=$trunk_text
      "; + echo "trunk_no_0=$trunk_no_0
      "; + echo "trunk_no_1=$trunk_no_1
      "; + } + unset($tmpColor); + unset($tmpData); + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + for($i=0;$i<$total_hour_num;$i++) + { + $bhca=$cstaData[3][0][3][$trunk_no_0][Success][$i]+$cstaData[4][0][4][$trunk_no_0][Success][$i]; + $tk_bhca_0[$i]=$bhca; + } + $tmpData[]=$tk_bhca_0; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + for($i=0;$i<$total_hour_num;$i++) + { + $bhca=$cstaData[3][0][3][$trunk_no_1][Success][$i]+$cstaData[4][0][4][$trunk_no_1][Success][$i]; + $tk_bhca_1[$i]=$bhca; + } + $tmpData[]=$tk_bhca_1; + } + + if(0) + { + echo "
      ";
      +			print_r($tmpData);
      +			echo "
      "; + } + echo "
      BHCA Statistic Chart
      "; + + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + $boldline=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "Trunk Group {$trunk_no_0}", + "Trunk Group {$trunk_no_1}" + ); + $pointArr=array( + array(60,367), + array(390,367), + ); + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0x33); + $tmpColor[]=array(0x66,0xff,0xff); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + echo ""; + } +} + + //=======show the remark label======== +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      SUB SUB-> Subscriber to subscriberTRK TRK-> Trunk to trunkMO-> Mobile originated
      SUB TRK-> Subscriber to trunkINTRA-> IntraconnectionMT-> Mobile terminated
      TRK SUB-> Trunk to subscriberSUB IP-> Subscriber to IPIN TRK-> In trunk
      TRK IP-> Trunk to IPOUT TRK-> Out trunk
      IP-> IP terminated
      "; +} +?> diff --git a/wxc2_omc/performance/generalCsta/msc_erlang.php b/wxc2_omc/performance/generalCsta/msc_erlang.php new file mode 100755 index 0000000..4f71c68 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/msc_erlang.php @@ -0,0 +1,677 @@ +"; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +} + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$total_hour_num=24*$slot; +echo ""; +echo ""; + +//Service +if($keyTwo == 0) +{ + $cstaData[5]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",5); + $cstaData[6]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",6); + $cstaData[7]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",7); + $cstaData[8]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",8); + $cstaData[9]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",9); + $cstaData[10]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",10); + $cstaData[11]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",11); + $cstaData[12]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",12); + $cstaData[13]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",13); + $cstaData[14]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",14); + $cstaData[15]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",15); + $cstaData[16]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",16); + $cstaData[17]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",17); + $cstaData[18]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",18); + $cstaData[19]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",19); + $cstaData[20]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",20); + $cstaData[21]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",21); + $cstaData[22]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",22); + + if(0) + { + echo "
      ";
      +		print_r($cstaData);
      +		echo "
      "; + } + + //Table-1 + { + $table_title="Service Erlang Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + echo ""; + + $service_label=array( + 1=>"SUB SUB", + 2=>"SUB TRK", + 3=>"TRK SUB", + 4=>"TRK TRK", + 5=>"INTRA", + 6=>"SUB IP", + 7=>"TRK IP", + 8=>"MO", + 9=>"MT", + 10=>"IN TRK", + 11=>"OUT TRK", + ); + $service_num=sizeof($service_label); + + $service_labelobj=array( + "SUB SUB"=>"5,17", + "SUB TRK"=>"6,18", + "TRK SUB"=>"7,19", + "TRK TRK"=>"8", + "INTRA"=>"9", + "SUB IP"=>"10,20", + "TRK IP"=>"11", + "MO"=>"12,21", + "MT"=>"13,22", + "IN TRK"=>"14", + "OUT TRK"=>"15", + "IP"=>"16" + ); + + + $objInderRelation=array( + 5=>1,6=>1,7=>1,8=>1, + 9=>2, + 10=>3, + 11=>3, + 12=>4, + 13=>4, + 14=>5, + 15=>5, + 16=>6, + 17=>7,18=>7,19=>7,20=>7,21=>7,22=>7); + + for($i=1;$i<=$service_num;$i++) + { + $service_dataobj=explode(',',$service_labelobj[$service_label[$i]]); + echo ""; + for($day=0;$day<$slot;$day++) + { + $value=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + if(sizeof($service_dataobj)>1) + echo ""; + else + echo ""; + for($hour=0;$hour<24;$hour++) + { + if($hour==0) + echo ""; + if($hour==12) + echo ""; + $value=omc_keep_length($hour,'0',2); + echo ""; + + if($hour == 11) + { + for($ii=0;$ii"; + for($iii=0;$iii<12;$iii++) + { + if($ii==0&&$iii==0) + echo ""; + else if($ii==1&&$iii==0) + echo ""; + $objindex=$objInderRelation[$service_dataobj[$ii]]; + $duration=$cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Duration][$day*24+$iii]+0; + $erlang=change2point($duration/3600); + $cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Erlang][$day*24+$iii]=$erlang; + echo ""; + } + echo ""; + } + } + if($hour == 23) + { + for($ii=0;$ii"; + for($iii=12;$iii<24;$iii++) + { + if($ii==0&&$iii==12) + echo ""; + else if($ii==1&&$iii==12) + echo ""; + $objindex=$objInderRelation[$service_dataobj[$ii]]; + $duration=$cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Duration][$day*24+$iii]+0; + $erlang=change2point($duration/3600); + $cstaData[$service_dataobj[$ii]][$objindex][$service_dataobj[$ii]][Erlang][$day*24+$iii]=$erlang; + echo ""; + } + echo ""; + } + } + } + } + } + echo "
      {$service_label[$i]}  Erlang(Hour)
      $value
      $value  $valueGSMUMTS$erlang
      GSMUMTS$erlang
      "; + } + + //Graphics-1 GSM + { + unset($tmpColor); + unset($tmpData); + if($flag0 == "on") + { + $tmpColor[]=array(0x99,0x22,0x33); + $tmpData[]=$cstaData[5][1][5][Erlang]; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpData[]=$cstaData[6][1][6][Erlang]; + } + if($flag2 == "on") + { + $tmpColor[]=array(0x99,0x99,0x00); + $tmpData[]=$cstaData[7][1][7][Erlang]; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x99,0x99,0x99); + $tmpData[]=$cstaData[8][1][8][Erlang]; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x99,0xff,0x33); + $tmpData[]=$cstaData[9][2][9][Erlang]; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xff,0x99,0x66); + $tmpData[]=$cstaData[10][3][10][Erlang]; + } + if($flag6 == "on") + { + $tmpColor[]=array(0xff,0x00,0x00); + $tmpData[]=$cstaData[11][3][11][Erlang]; + } + if($flag7 == "on") + { + $tmpColor[]=array(0xff,0xff,0x00); + $tmpData[]=$cstaData[12][4][12][Erlang]; + } + if($flag8 == "on") + { + $tmpColor[]=array(0x33,0x3,0x33); + $tmpData[]=$cstaData[13][4][13][Erlang]; + } + if($flag9 == "on") + { + $tmpColor[]=array(0x00,0xcc,0xff); + $tmpData[]=$cstaData[14][5][14][Erlang]; + } + if($flag10 == "on") + { + $tmpColor[]=array(0x00,0x22,0xcc); + $tmpData[]=$cstaData[15][5][15][Erlang]; + } + if($flag11 == "on") + { + $tmpColor[]=array(0xEE,0x00,0xff); + $tmpData[]=$cstaData[16][6][16][Erlang]; + } + + echo "
      Erlang Statistic Chart(GSM)
      "; + + + if($select_checkbox_id>=0&&$select_checkbox_id<12) + { + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,boldline1=$select_checkbox_id
      "; + } + $boldline1=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline1--; + } + } + $image=CreateImage(820,420); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline1,1,0,1 + ); + + $remarkBlock=array( + "SUB SUB", + "SUB TRK", + "TRK SUB", + "TRK TRK", + "INTRA", + "SUB IP", + "TRK IP", + "MO", + "MT", + "IN TRK", + "OUT TRK", + "IP" + ); + + $pointArr=array( + array(90,365), + array(260,365), + array(430,365), + array(600,365), + array(90,385), + array(260,385), + array(430,385), + array(600,385), + array(90,405), + array(260,405), + array(430,405), + array(600,405) + ); + + unset($tmpColor); + $tmpColor[]=array(0x99,0x22,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0x99,0x99,0x99); + $tmpColor[]=array(0x99,0xff,0x33); + $tmpColor[]=array(0xff,0x99,0x66); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x3,0x33); + $tmpColor[]=array(0x00,0xcc,0xff); + $tmpColor[]=array(0x00,0x22,0xcc); + $tmpColor[]=array(0xEE,0x00,0xff); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + } + + //Graphics-2 UMTS + { + unset($tmpData); + unset($tmpColor); + if($flag12 == "on") + { + $tmpColor[]=array(0x99,0x22,0x33); + $tmpData[]=$cstaData[17][7][17][Erlang]; + } + if($flag13 == "on") + { + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpData[]=$cstaData[18][7][18][Erlang]; + } + if($flag14 == "on") + { + $tmpColor[]=array(0x99,0x99,0x00); + $tmpData[]=$cstaData[19][7][19][Erlang]; + } + if($flag15 == "on") + { + $tmpColor[]=array(0xff,0x99,0x66); + $tmpData[]=$cstaData[20][7][20][Erlang]; + } + if($flag16 == "on") + { + $tmpColor[]=array(0xff,0xff,0x00); + $tmpData[]=$cstaData[21][7][21][Erlang]; + } + if($flag17 == "on") + { + $tmpColor[]=array(0x33,0x3,0x33); + $tmpData[]=$cstaData[22][7][22][Erlang]; + } + + + echo "
      Erlang Statistic Chart(UMTS)
      "; + + + if($select_checkbox_id>11) + { + if(0) + { + echo "flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16,flag17=$flag17,boldline=$select_checkbox_id
      "; + } + $boldline=$select_checkbox_id; + for($i=12;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + } + $image=CreateImage(820,420); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array( + "SUB SUB", + "SUB TRK", + "TRK SUB", + "SUB IP", + "MO", + "MT" + ); + + $pointArr=array( + array(90,365), + array(260,365), + array(430,365), + array(600,365), + array(90,385), + array(260,385) + ); + + unset($tmpColor); + $tmpColor[]=array(0x99,0x22,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x3,0x33); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + } + + +} +//Trunk Group +else if($keyTwo == 1) +{ + //Get the trunk title + for($i=0;$i<=256;$i++) + { + $trunk_element_title[$i]="--"; + } + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + + //===get the title of tg===== + $database="OBJ_320"; + $sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle'"; + $result=@mysqli_query($objDbConn,$sql); + $TrunkGroupCount=mysqli_num_rows($result); + + if($TrunkGroupCount>0) + { + while($rows = @mysqli_fetch_array($result)) + { + //get the instanceNo of the tg + $trunk_no=$rows[instanceNo]+0; + $trunk_status[$trunk_no]=1; + $trunk_element_title[$trunk_no]=$rows[initValue]; + } + } + if(0) + { + echo "
      ";
      +		print_r($trunk_status);
      +		print_r($trunk_element_title);
      +		echo "
      "; + } + + $cstaData[3]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",3); + $cstaData[4]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",4); + if(0) + { + echo "
      ";
      +		print_r($cstaData);
      +		echo "
      "; + } + + //Table-1 + { + $table_title="Trunk Group Erlang Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + echo ""; + for($tg_no=0;$tg_no<=256;$tg_no++) + { + if($trunk_status[$tg_no] != 1) + continue; + echo ""; + echo ""; + echo ""; + for($day=0;$day<$slot;$day++) + { + $value=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + echo ""; + for($hour=0;$hour<24;$hour++) + { + $value=omc_keep_length($hour,'0',2); + echo ""; + if($hour == 11) + { + echo ""; + for($i=0;$i<12;$i++) + { + $duration=$cstaData[3][0][3][$tg_no][Duration][$day*24+$i]+$cstaData[4][0][4][$tg_no][Duration][$day*24+$i]; + $erlang=change2point($duration/3600); + $cstaData[2][0][2][$tg_no][Erlang][$day*24+$i]=$erlang; + echo ""; + } + echo ""; + } + if($hour == 23) + { + echo ""; + for($i=12;$i<24;$i++) + { + $duration=$cstaData[3][0][3][$tg_no][Duration][$day*24+$i]+$cstaData[4][0][4][$tg_no][Duration][$day*24+$i]; + $erlang=change2point($duration/3600); + $cstaData[2][0][2][$tg_no][Erlang][$day*24+$i]=$erlang; + echo ""; + } + echo ""; + } + } + } + } + echo "
      TG {$tg_no}[{$trunk_element_title[$tg_no]}]  Erlang(Hour)
      $value$value
      $erlang
      $erlang
      "; + } + + //Graphics-1 + { + + $tmp=explode(",",$trunk_text); + $trunk_no_0=$tmp[0]+0; + $trunk_no_1=$tmp[1]+0; + if(0) + { + echo "trunk_text=$trunk_text
      "; + echo "trunk_no_0=$trunk_no_0
      "; + echo "trunk_no_1=$trunk_no_1
      "; + } + unset($tmpColor); + unset($tmpData); + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + for($i=0;$i<$total_hour_num;$i++) + { + $duration=$cstaData[3][0][3][$trunk_no_0][Duration][$i]+$cstaData[4][0][4][$trunk_no_0][Duration][$i]; + $erlang=change2point($duration/3600); + $tk_erl_0[$i]=$erlang; + } + $tmpData[]=$tk_erl_0; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + for($i=0;$i<$total_hour_num;$i++) + { + $duration=$cstaData[3][0][3][$trunk_no_1][Duration][$i]+$cstaData[4][0][4][$trunk_no_1][Duration][$i]; + $erlang=change2point($duration/3600); + $tk_erl_1[$i]=$erlang; + } + $tmpData[]=$tk_erl_1; + } + + if(0) + { + echo "
      ";
      +			print_r($tmpData);
      +			echo "
      "; + } + echo "
      Erlang Statistic Chart
      "; + + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + $boldline=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "Trunk Group {$trunk_no_0}", + "Trunk Group {$trunk_no_1}" + ); + $pointArr=array( + array(60,367), + array(390,367), + ); + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0x33); + $tmpColor[]=array(0x66,0xff,0xff); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + echo ""; + } +} + + //=======show the remark label======== +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      SUB SUB-> Subscriber to subscriberTRK TRK-> Trunk to trunkMO-> Mobile originated
      SUB TRK-> Subscriber to trunkINTRA-> IntraconnectionMT-> Mobile terminated
      TRK SUB-> Trunk to subscriberSUB IP-> Subscriber to IPIN TRK-> In trunk
      TRK IP-> Trunk to IPOUT TRK-> Out trunk
      IP-> IP terminated
      "; +} +?> diff --git a/wxc2_omc/performance/generalCsta/msc_service_day.php b/wxc2_omc/performance/generalCsta/msc_service_day.php new file mode 100755 index 0000000..8d2e8ad --- /dev/null +++ b/wxc2_omc/performance/generalCsta/msc_service_day.php @@ -0,0 +1,637 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +//KeyOne=1 +$cstaDataChip[5]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",5); +$cstaDataChip[6]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",6); +$cstaDataChip[7]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",7); +$cstaDataChip[8]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",8); +//KeyOne=2 +$cstaDataChip[9]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",9); +//KeyOne=3 +$cstaDataChip[10]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",10); +$cstaDataChip[11]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",11); +//KeyOne=4 +$cstaDataChip[12]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",12); +$cstaDataChip[13]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",13); +//KeyOne=5 +$cstaDataChip[14]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",14); +$cstaDataChip[15]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",15); +$cstaDataChip[16]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",16); +//KeyOne=6 +$cstaDataChip[17]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",17); +$cstaDataChip[18]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",18); +$cstaDataChip[19]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",19); +$cstaDataChip[20]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",20); +$cstaDataChip[21]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",21); +$cstaDataChip[22]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",22); + +if(0) +{ + echo "
      ";
      +	print_r($cstaDataChip);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="Service Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + $rowTitle=array( + "Subs to subs", + "Subs to trunk", + "Trunk to subs", + "Trunk to trunk", + "Intraconnection", + "--", + "Subs to IP", + "Trunk to IP", + "--", + "Mobile originated", + "Mobile terminated", + "GSM", + "UMTS", + "In trunk", + "Out trunk", + "IP terminated" + ); + $rowNum=sizeof($rowTitle); + + $rowSubTitle=array( + "GSM UMTS", + "GSM UMTS", + "GSM UMTS", + "--", + "--", + "--", + "GSM UMTS", + "--", + "--", + "GSM UMTS", + "GSM UMTS", + "--", + "--", + "--", + "--", + "--" + ); + $rowSubNum=sizeof($rowSubTitle); + + $columnTitle=array( + "Type", + "Attempt", + "Success", + "Call Deny", + "Net Busy", + "Caller
      Clear", + "Sub Busy", + "No
      Answer", + "Signal
      Error", + "Total Call
      Duration", + "Average Call
      Duration(s)" + ); + $columnNum=sizeof($columnTitle); + + $objInderRelation=array(1,1,1,1,2,-1,3,3,-1,4,4,-1,-1,5,5,6); + $keyOneRelation=array(5,6,7,8,9,-1,10,11,-1,12,13,-1,-1,14,15,16); + $objInderRelation3g=array(7,7,7,-1,-1,-1,7,-1,-1,7,7,-1,-1,-1,-1,-1); + $keyOneRelation3g=array(17,18,19,-1,-1,-1,20,-1,-1,21,22,-1,-1,-1,-1,-1); + $dataFiled=array("Attempt","Success","CallDeny","NetBusy","CallerClear","SubBusy","NoAnswer","SignalErr","Duration"); + + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + for($i=0;$i<$columnNum;$i++) + { + if($i==0) + echo ""; + else + echo ""; + } + echo ""; + + for($i=0;$i<$rowNum;$i++) + { + echo ""; + if($rowTitle[$i] == "--") + { + $columnNum1=$columnNum+1; + echo ""; + echo ""; + } + else + { + if($rowSubTitle[$i] !="--") + { + echo ""; + $obj=$objInderRelation[$i]; + $key=$keyOneRelation[$i]; + $rowSubTitleNum=explode(' ',$rowSubTitle[$i]); + for($iii=0;$iii$rowSubTitleNum[$iii]"; + else if($rowSubTitleNum[$iii] !="--" && $iii==1) + { + echo ""; + $obj=$objInderRelation3g[$i]; + $key=$keyOneRelation3g[$i]; + } + //debug_log("/tmp/debugperformance","i:$i,obj:$obj,key:$key"); + for($j=0;$j<$columnNum-1;$j++) + { + $field=$dataFiled[$j]; + $cstaDataChip[$key][$obj][$key][$field]+=0; + echo ""; + echo ""; + } + } + echo "
      {$columnTitle[$i]}{$columnTitle[$i]}
       
      "; + echo "{$rowTitle[$i]}"; + } + else + { + echo ""; + echo "{$rowTitle[$i]}"; + } + echo "
      $rowSubTitleNum[$iii]"; + if($i==9 && $rowSubTitleNum[$iii]=="GSM") + $gsmMO[$field]=$cstaDataChip[$key][$obj][$key][$field]; + if($i==10&&$rowSubTitleNum[$iii] =="GSM") + $gsmMT[$field]=$cstaDataChip[$key][$obj][$key][$field]; + if($i==9&&$rowSubTitleNum[$iii] =="UMTS") + $umtsMO[$field]=$cstaDataChip[$key][$obj][$key][$field]; + if($i==10&&$rowSubTitleNum[$iii] =="UMTS") + $umtsMT[$field]=$cstaDataChip[$key][$obj][$key][$field]; + $gsm[$field]=$gsmMO[$field]+$gsmMT[$field]; + $umts[$field]=$umtsMO[$field]+$umtsMT[$field]; + if($j == 0) + { + if($i==11) + echo "{$gsm[$field]}"; + else if($i==12) + echo "{$umts[$field]}"; + else + echo "{$cstaDataChip[$key][$obj][$key][$field]}"; + } + else if($j==$columnNum-3) + { + if($i==11) + { + echo "{$gsm[$field]}
      "; + $value=$gsm[$field]; + } + else if($i==12) + { + echo "{$umts[$field]}
      "; + $value=$umts[$field]; + } + else + { + echo "{$cstaDataChip[$key][$obj][$key][$field]}
      "; + $value=$cstaDataChip[$key][$obj][$key][$field]; + } + echo SecondToTimeStamp($value); + } + else if($j==$columnNum-2) + { + if($i==11) + { + if($gsm[Attempt]>0) + { + if($gsm[Success]>0) + $value=ceil($gsm[Duration]/$gsm[Success]); + else + $value=0; + } + else + $value=0; + } + else if($i==12) + { + if($umts[Attempt]>0) + { + if($umts[Success]>0) + $value=ceil($umts[Duration]/$umts[Success]); + else + $value=0; + } + else + $value=0; + } + else + { + if($cstaDataChip[$key][$obj][$key][Attempt] > 0) + { + if($cstaDataChip[$key][$obj][$key][Success] > 0) + $value=ceil($cstaDataChip[$key][$obj][$key][Duration]/$cstaDataChip[$key][$obj][$key][Success]); + else + $value=0; + } + else + $value=0; + } + echo "{$value}"; + } + else + { + if($i==11) + { + echo "$gsm[$field]
      "; + $percent=GetPercent($gsm[$field],$gsm[Attempt]); + } + else if($i==12) + { + echo "$umts[$field]
      "; + $percent=GetPercent($umts[$field],$umts[Attempt]); + } + else + { + echo "{$cstaDataChip[$key][$obj][$key][$field]}
      "; + $percent=GetPercent($cstaDataChip[$key][$obj][$key][$field],$cstaDataChip[$key][$obj][$key][Attempt]); + } + echo "{$percent}"; + } + } + } + echo "
      "; +} + +//Graphics-1, Part-1,GSM +{ + $tmpData[]=$cstaDataChip[5][1][5][Attempt]; + $tmpData[]=$cstaDataChip[6][1][6][Attempt]; + $tmpData[]=$cstaDataChip[7][1][7][Attempt]; + $tmpData[]=$cstaDataChip[8][1][8][Attempt]; + $tmpData[]=$cstaDataChip[9][2][9][Attempt]; + $tmpData[]=$cstaDataChip[10][3][10][Attempt]; + $tmpData[]=$cstaDataChip[11][3][11][Attempt]; + if(0) + { + echo "
      ";
      +		print_r($tmpData);
      +		echo "
      "; + } + $tmpColor[]=array(0x99,0x00,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0x99,0xcc,0x99); + $tmpColor[]=array(0x99,0xff,0x33); + $tmpColor[]=array(0xff,0x99,0x66); + $tmpColor[]=array(0xff,0x99,0xff); + + echo "
      Service(Attempt) GSM
      "; + $image=CreateImage(820,320); + $image=DrawPercentHistogram( + $image, + $tmpData, + $tmpColor, + array(30,20), + array(410,250),1,0 + ); + $remarkBlock=array("SUB SUB","SUB TRK","TRK SUB","TRK TRK","INTRA","SUB IP","TRK IP"); + $pointArr=array( + array(50,290), + array(103,290), + array(156,290), + array(210,290), + array(272,290), + array(322,290), + array(378,290) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + + //Graphics-1, Part-2 + unset($tmpData); + $tmpData[]=$cstaDataChip[12][4][12][Attempt]; + $tmpData[]=$cstaDataChip[13][4][13][Attempt]; + $tmpData[]=$cstaDataChip[14][5][14][Attempt]; + $tmpData[]=$cstaDataChip[15][5][15][Attempt]; + $tmpData[]=$cstaDataChip[16][6][16][Attempt]; + unset($tmpColor); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x03,0x33); + $tmpColor[]=array(0x00,0xcc,0xff); + $tmpColor[]=array(0x00,0x66,0xcc); + $tmpColor[]=array(0x33,0xff,0x99); + if(0) + { + echo "
      ";
      +		print_r($tmpData);
      +		echo "
      "; + } + $image=DrawPercentHistogram( + $image, + $tmpData, + $tmpColor, + array(450,20), + array(330,250),0,1 + ); + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array("MO","MT","IN TRK","OUT TRK","IP"); + $pointArr=array( + array(490,290), + array(550,290), + array(598,290), + array(656,290), + array(730,290) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + DrawImage($image); +} + + +//Graphics-2,UMTS +{ + unset($tmpData); + $tmpData[]=$cstaDataChip[17][7][17][Attempt]; + $tmpData[]=$cstaDataChip[18][7][18][Attempt]; + $tmpData[]=$cstaDataChip[19][7][19][Attempt]; + $tmpData[]=$cstaDataChip[20][7][20][Attempt]; + $tmpData[]=$cstaDataChip[21][7][21][Attempt]; + $tmpData[]=$cstaDataChip[22][7][22][Attempt]; + if(0) + { + echo "
      ";
      +		print_r($tmpData);
      +		echo "
      "; + } + unset($tmpColor); + $tmpColor[]=array(0x99,0x00,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0xff,0x99,0xff); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x03,0x33); + echo "
      Service(Attempt) UMTS
      "; + $image=CreateImage(820,320); + $image=DrawPercentHistogram( + $image, + $tmpData, + $tmpColor, + array(30,20), + array(400,250),1,0 + ); + $remarkBlock=array("SUB SUB","SUB TRK","TRK SUB","TRK IP","MO","MT"); + $pointArr=array( + array(52,290), + array(120,290), + array(180,290), + array(250,290), + array(315,290), + array(375,290) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + DrawImage($image); +} + + + //Graphics-3, Part-1,GSM +{ + echo "

      Success/Failure GSM
      "; + unset($tmpData); + $datafieldnum=sizeof($dataFiled)-1; + for($i=1;$i<$datafieldnum;$i++) + { + $tmpData[$i-1][]=$cstaDataChip[5][1][5][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[6][1][6][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[7][1][7][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[8][1][8][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[9][2][9][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[10][3][10][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[11][3][11][$dataFiled[$i]]; + } + unset($tmpColor); + $tmpColor[]=array(0x99,0x00,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0x99,0xcc,0x99); + $tmpColor[]=array(0x99,0xff,0x33); + $tmpColor[]=array(0xff,0x99,0x66); + $tmpColor[]=array(0xff,0x99,0xff); + + $image=CreateImage(820,350); + $image=DrawStackPercentHistogram($image, + $tmpData, + $tmpColor, + array(30,20), + array(380,280),1,0 + ); + + + //Graphics-3, Part-2 + unset($tmpData); + for($i=1;$i<$datafieldnum;$i++) + { + $tmpData[$i-1][]=$cstaDataChip[12][4][12][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[13][4][13][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[14][5][14][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[15][5][15][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[16][6][16][$dataFiled[$i]]; + } + unset($tmpColor); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x03,0x33); + $tmpColor[]=array(0x00,0xcc,0xff); + $tmpColor[]=array(0x00,0x66,0xcc); + $tmpColor[]=array(0x33,0xff,0x99); + + $image=DrawStackPercentHistogram($image, + $tmpData, + $tmpColor, + array(450,20), + array(330,280),1,0 + ); + + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array( + "Success", + "Call","Deny", + "Net","Busy", + "Caller","Clear", + "Sub","Busy", + "No","Answer", + "Signal","Error", + "Success", + "Call","Deny", + "Net","Busy", + "Caller","Clear", + "Sub","Busy", + "No","Answer", + "Signal","Error" + ); + $pointArr=array( + array(45,305), + array(105,300),array(105,310), + array(157,300),array(155,310), + array(200,300),array(202,310), + array(256,300),array(254,310), + array(308,300),array(300,310), + array(348,300),array(350,310), + array(445,305), + array(505,300),array(505,310), + array(557,300),array(555,310), + array(600,300),array(602,310), + array(656,300),array(654,310), + array(708,300),array(700,310), + array(748,300),array(750,310) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + DrawImage($image); +} + + //Graphics-4, UMTS +{ + echo "

      Success/Failure UMTS
      "; + unset($tmpData); + $datafieldnum=sizeof($dataFiled)-1; + for($i=1;$i<$datafieldnum;$i++) + { + $tmpData[$i-1][]=$cstaDataChip[17][7][17][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[18][7][18][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[19][7][19][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[20][7][20][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[21][7][21][$dataFiled[$i]]; + $tmpData[$i-1][]=$cstaDataChip[22][7][22][$dataFiled[$i]]; + } + unset($tmpColor); + $tmpColor[]=array(0x99,0x00,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0xff,0x99,0xff); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x03,0x33); + + $image=CreateImage(820,380); + $image=DrawStackPercentHistogram($image, + $tmpData, + $tmpColor, + array(30,20), + array(440,280),1,0 + ); +} + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array( + "Success", + "Call","Deny", + "Net","Busy", + "Caller","Clear", + "Sub","Busy", + "No","Answer", + "Signal","Error", + ); + $pointArr=array( + array(45,305), + array(120,300),array(120,310), + array(185,300),array(185,310), + array(240,300),array(240,310), + array(300,300),array(300,310), + array(350,300),array(350,310), + array(405,300),array(405,310), + + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + + + + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array( + "SUB SUB", + "SUB TRK", + "TRK SUB", + "MO", + "MT", + "IN TRK", + "TRK IP", + "TRK TRK", + "INTRA", + "OUT TRK", + "IP", + "SUB IP" + ); + $pointArr=array( + array(30,330), + array(175,330), + array(315,330), + array(460,330), + array(605,330), + array(750,330), + array(30,345), + array(175,345), + array(315,345), + array(460,345), + array(605,345), + array(30,360) + ); + unset($tmpColor); + $tmpColor[]=array(0x99,0x00,0x33); + $tmpColor[]=array(0x99,0x00,0xcc); + $tmpColor[]=array(0x99,0x99,0x00); + $tmpColor[]=array(0x99,0xcc,0x99); + $tmpColor[]=array(0x99,0xff,0x33); + $tmpColor[]=array(0xff,0x99,0x66); + $tmpColor[]=array(0xff,0x99,0xff); + $tmpColor[]=array(0xff,0xff,0x00); + $tmpColor[]=array(0x33,0x03,0x33); + $tmpColor[]=array(0x00,0xcc,0xff); + $tmpColor[]=array(0x00,0x66,0xcc); + $tmpColor[]=array(0x33,0xff,0x99); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + + DrawImage($image); + + + //=======show the remark label======== +{ + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      SUB SUB-> Subscriber to subscriberTRK TRK-> Trunk to trunkMO-> Mobile originated
      SUB TRK-> Subscriber to trunkINTRA-> IntraconnectionMT-> Mobile terminated
      TRK SUB-> Trunk to subscriberSUB IP-> Subscriber to IPIN TRK-> In trunk
      TRK IP-> Trunk to IPOUT TRK-> Out trunkIP-> IP terminated
      GSM-> Mob originated GSM+Mob terminated GSMUMTS-> Mob originated UMTS+Mob terminated UMTS
      "; +} + +?> \ No newline at end of file diff --git a/wxc2_omc/performance/generalCsta/msc_service_hour.php b/wxc2_omc/performance/generalCsta/msc_service_hour.php new file mode 100755 index 0000000..aefc985 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/msc_service_hour.php @@ -0,0 +1,682 @@ +"; + echo "sysTypeNo=$sysTypeNo,show_type=$show_type,page_id=$page_id,keyOne=$keyOne
      "; + echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to
      "; + echo "select_checkbox_id=$select_checkbox_id
      "; +} + +echo ""; +echo ""; +//echo "sysTypeNo=$sysTypeNo,keyOne=$keyOne"; +$cstaConf=GetCstaConf($sysTypeNo); + + $keyOneobj=array( + "Subs to subs"=>"5,17", + "Subs to trunk"=>"6,18", + "Trunk to subs"=>"7,19", + "Trunk to trunk"=>"8", + "Intraconnection"=>"9", + "Subs to IP"=>"10,20", + "Trunk to IP"=>"11", + "Mobile originated"=>"12,21", + "Mobile terminated"=>"13,22", + "In trunk"=>"14", + "Out trunk"=>"15", + "IP terminated"=>"16", + "GSM"=>"12+13", + "UMTS"=>"21+22" + ); + + $keyOne1=$keyOneobj[$keyOne]; + if($keyOne=="GSM" ||$keyOne=="UMTS") + { + $keyOne1=explode('+',$keyOne1); + $keyOneNum=1; + } + else + { + $keyOne1=explode(',',$keyOne1); + $keyOneNum=sizeof($keyOne1); + } +//echo "$keyOne1[0],$keyOne1[1]"; + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +//Table-1 +{ + $sub_title=array( + 5=>"Subs to subs", + 6=>"Subs to trunk", + 7=>"Trunk to subs", + 8=>"Trunk to trunk", + 9=>"Intraconnection", + 10=>"Subs to IP", + 11=>"Trunk to IP", + 12=>"Mobile originated", + 13=>"Mobile terminated", + 14=>"In trunk", + 15=>"Out trunk", + 16=>"IP terminated", + ); + + $columnTitle=array( + "Time", + "Attempt", + "Success", + "Call Deny", + "Net Busy", + "Caller
      Clear", + "Sub Busy", + "No
      Answer", + "Signal
      Error", + "Total Call
      Duration", + "Average Call
      Duration(s)" + ); + $columnNum=sizeof($columnTitle); + + if($keyOne=="GSM" ||$keyOne=="UMTS") + { + if($slot > 1) + $table_title=$keyOne." Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title=$keyOne." Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + } + else + { + if($slot > 1) + $table_title=$sub_title[$keyOne1[0]]." Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title=$sub_title[$keyOne1[0]]." Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + } + echo "
      $table_title
      "; + echo ""; + echo ""; + + for($i=0;$i<$columnNum;$i++) + { + if($keyOneNum>1&&$i==0) + echo ""; + else + echo ""; + } + echo ""; + + $objInderRelation=array(5=>1,6=>1,7=>1,8=>1,9=>2,10=>3,11=>3,12=>4,13=>4,14=>5,15=>5,16=>6,17=>7,18=>7,19=>7,20=>7,21=>7,22=>7); + + $total_hour=$slot*24; + $total_record_num=0; + //echo "total_hour=$total_hour
      "; + for($hour=0;$hour<$total_hour;$hour++) + { + for($ii=0;$ii<$keyOneNum;$ii++) + { + $keyOneName=$keyOne1[$ii]; + if($keyOne=="GSM" ||$keyOne=="UMTS") + { + $cstaData1=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",$keyOne1[0]); + $cstaData2=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",$keyOne1[1]); + $att_value=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][Attempt][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][Attempt][$hour]; + } + else + { + $cstaData=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",$keyOne1[$ii]); + $att_value=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][Attempt][$hour]; + } + + if(isset($att_value) && trim($att_value)!="") + { + if($ii==0) + echo ""; + if($keyOne=="GSM" ||$keyOne=="UMTS") + { + $success_value[$keyOneName][$hour]=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][Success][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][Success][$hour]+0; + $calldeny_value[$keyOneName][$hour]=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][CallDeny][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][CallDeny][$hour]+0; + $netbusy_value[$keyOneName][$hour]=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][NetBusy][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][NetBusy][$hour]+0; + $callerclear_value[$keyOneName][$hour]=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][CallerClear][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][CallerClear][$hour]; + $subbusy_value[$keyOneName][$hour]=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][SubBusy][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][SubBusy][$hour]; + $noanswer_value[$keyOneName][$hour]=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][NoAnswer][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][NoAnswer][$hour]; + $signalerr_value[$keyOneName][$hour]=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][SignalErr][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][SignalErr][$hour]; + $duration_value[$keyOneName][$hour]=$cstaData1[$objInderRelation[$keyOne1[0]]][$keyOne1[0]][Duration][$hour]+$cstaData2[$objInderRelation[$keyOne1[1]]][$keyOne1[1]][Duration][$hour]; + } + else + { + $success_value[$keyOneName][$hour]=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][Success][$hour]+0; + $calldeny_value[$keyOneName][$hour]=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][CallDeny][$hour]+0; + $netbusy_value[$keyOneName][$hour]=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][NetBusy][$hour]+0; + $callerclear_value[$keyOneName][$hour]=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][CallerClear][$hour]; + $subbusy_value[$keyOneName][$hour]=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][SubBusy][$hour]; + $noanswer_value[$keyOneName][$hour]=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][NoAnswer][$hour]; + $signalerr_value[$keyOneName][$hour]=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][SignalErr][$hour]; + $duration_value[$keyOneName][$hour]=$cstaData[$objInderRelation[$keyOne1[$ii]]][$keyOne1[$ii]][Duration][$hour]; + } + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + if($keyOneNum>1&&$ii==0) + { + echo ""; + echo ""; + } + else if($keyOneNum>1&&$ii==1) + echo ""; + else if($ii==0) + echo ""; + + //Attempt + echo ""; + + //Success + $value=$success_value[$keyOneName][$hour]; + $percent=GetPercent($value,$att_value); + echo ""; + + //CallDeny + $value=$calldeny_value[$keyOneName][$hour]; + $percent=GetPercent($value,$att_value); + echo ""; + + //NetBusy + $value=$netbusy_value[$keyOneName][$hour]; + $percent=GetPercent($value,$att_value); + echo ""; + + //CallerClear + $value=$callerclear_value[$keyOneName][$hour]+0; + $percent=GetPercent($value,$att_value); + echo ""; + + //SubBusy + $value=$subbusy_value[$keyOneName][$hour]+0; + $percent=GetPercent($value,$att_value); + echo ""; + + //NoAnswer + $value=$noanswer_value[$keyOneName][$hour]+0; + $percent=GetPercent($value,$att_value); + echo ""; + + //SignalErr + $value=$signalerr_value[$keyOneName][$hour]+0; + $percent=GetPercent($value,$att_value); + echo ""; + + //TotalCallDuration + $value=$duration_value[$keyOneName][$hour]+0; + echo ""; + + //AverageCallDuration + if($success_value[$keyOneName][$hour] > 0) + $value=ceil($duration_value[$keyOneName][$hour]/$success_value[$keyOneName][$hour]); + else + $value=0; + echo ""; + echo ""; + + $total_record_num++; + } + else + { + $success_value[$keyOneName][$hour]=0; + $calldeny_value[$keyOneName][$hour]=0; + $netbusy_value[$keyOneName][$hour]=0; + $callerclear_value[$keyOneName][$hour]=0; + $subbusy_value[$keyOneName][$hour]=0; + $noanswer_value[$keyOneName][$hour]=0; + $signalerr_value[$keyOneName][$hour]=0; + $duration_value[$keyOneName][$hour]=0; + } + } + } + if($total_record_num == 0 && $keyOneNum>1) + echo ""; + else if($total_record_num == 0) + echo ""; + + echo "
      {$columnTitle[$i]}{$columnTitle[$i]}
      {$hour_title}HGSM
      UMTS{$hour_title}H"; + echo "{$att_value}"; + echo "$value
      $percent
      $value
      $percent
      $value
      $percent
      $value
      $percent
      $value
      $percent
      $value
      $percent
      $value
      $percent
      "; + echo "{$value}
      "; + $timestamp=SecondToTimeStamp($cstaData[Duration][$hour]); + echo "{$timestamp}"; + echo "
      "; + echo "{$value}"; + echo "
      ------------------------
      ----------------------
      "; +} + +//Graphics-1 +{ + unset($tmpColor); + unset($tmpData); + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + $tmpData[]=$success_value[$keyOne1[0]]; + //print_r($tmpData); + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$calldeny_value[$keyOne1[0]]; + } + if($flag2 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$netbusy_value[$keyOne1[0]]; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + $tmpData[]=$callerclear_value[$keyOne1[0]]; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x66,0x33,0); + $tmpData[]=$subbusy_value[$keyOne1[0]]; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xcc,0,0x66); + $tmpData[]=$noanswer_value[$keyOne1[0]]; + } + if($flag6 == "on") + { + $tmpColor[]=array(0xff,0,0); + $tmpData[]=$signalerr_value[$keyOne1[0]]; + } + + echo "
      Hourly Statistic Chart(GSM)
      "; + if($select_checkbox_id>=0&&$select_checkbox_id<7) + { + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + $boldline1=$select_checkbox_id; + //echo "1boldline1=$boldline1"; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline1--; + } + } + //echo "2boldline1=$boldline1"; + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline1,1,0,1 + ); + + $remarkBlock=array( + "Success", + "Call Deny", + "Network Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error" + ); + $pointArr=array( + array(60,367), + array(160,367), + array(260,367), + array(360,367), + array(460,367), + array(560,367), + array(660,367) + ); + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0x33); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + $tmpColor[]=array(0x66,0,0xcc); + $tmpColor[]=array(0x66,0x33,0); + $tmpColor[]=array(0xcc,0,0x66); + $tmpColor[]=array(0xff,0,0); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} + + + +if($keyOneNum>1) +{ +//Graphics-2 + unset($tmpColor); + unset($tmpData); + if($flag7 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + $tmpData[]=$success_value[$keyOne1[1]]; + } + if($flag8 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$calldeny_value[$keyOne1[1]]; + } + if($flag9 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$netbusy_value[$keyOne1[1]]; + } + if($flag10 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + $tmpData[]=$callerclear_value[$keyOne1[1]]; + } + if($flag11 == "on") + { + $tmpColor[]=array(0x66,0x33,0); + $tmpData[]=$subbusy_value[$keyOne1[1]]; + } + if($flag12 == "on") + { + $tmpColor[]=array(0xcc,0,0x66); + $tmpData[]=$noanswer_value[$keyOne1[1]]; + } + if($flag13 == "on") + { + $tmpColor[]=array(0xff,0,0); + $tmpData[]=$signalerr_value[$keyOne1[1]]; + } + + echo "
      Hourly Statistic Chart(UMTS)
      "; + if($select_checkbox_id>6&&$select_checkbox_id<14) + { + if(0) + { + echo "flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,select_checkbox_id=$select_checkbox_id
      "; + } + $boldline=$select_checkbox_id-7; + for($i=7;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + } + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "Success", + "Call Deny", + "Network Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error" + ); + $pointArr=array( + array(60,367), + array(160,367), + array(260,367), + array(360,367), + array(460,367), + array(560,367), + array(660,367) + ); + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0x33); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + $tmpColor[]=array(0x66,0,0xcc); + $tmpColor[]=array(0x66,0x33,0); + $tmpColor[]=array(0xcc,0,0x66); + $tmpColor[]=array(0xff,0,0); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} + + + +//Graphics-3 GSM +{ + for($i=0;$i<$total_hour;$i++) + { + if($success_value[$keyOne1[0]][$i] > 0) + $aveduration_value[$keyOne1[0]][$i]=ceil($duration_value[$keyOne1[0]][$i]/$success_value[$keyOne1[0]][$i]); + else + $aveduration_value[$keyOne1[0]][$i]=0; + } + if(0) + { + echo "
      ";
      +		print_r($duration_value);
      +		print_r($success_value);
      +		print_r($aveduration_value);
      +		echo "
      "; + } + unset($tmpColor); + unset($tmpData); + + if($keyOneNum>1) + { + if($flag14 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$duration_value[$keyOne1[0]]; + } + if($flag15 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$aveduration_value[$keyOne1[0]]; + } + } + else + { + if($flag7 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$duration_value[$keyOne1[0]]; + } + if($flag8 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$aveduration_value[$keyOne1[0]]; + } + } + + echo "

      Duration Statistic Chart(GSM)
      "; + $image=CreateImage(820,390); + if($keyOneNum>1) + { + if($select_checkbox_id>13&&$select_checkbox_id<16) + { + $boldline2=$select_checkbox_id-14; + for($i=14;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline2--; + } + } + } + else + { + if($select_checkbox_id>6&&$select_checkbox_id<9) + { + $boldline2=$select_checkbox_id-7; + for($i=7;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline2--; + } + } + } + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline2,1,0,1 + ); + + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + + $remarkBlock=array( + "Total Call Duration", + "Average Call Duration" + ); + $pointArr=array( + array(60,367), + array(260,367) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} + + + +//Graphics-4 UMTS +if($keyOneNum>1) +{ + for($i=0;$i<$total_hour;$i++) + { + if($success_value[$keyOne1[1]][$i] > 0) + $aveduration_value[$keyOne1[1]][$i]=ceil($duration_value[$keyOne1[1]][$i]/$success_value[$keyOne1[1]][$i]); + else + $aveduration_value[$keyOne1[1]][$i]=0; + } + if(0) + { + echo "
      ";
      +		print_r($duration_value);
      +		print_r($success_value);
      +		print_r($aveduration_value);
      +		echo "
      "; + } + unset($tmpColor); + unset($tmpData); + + if($flag16 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$duration_value[$keyOne1[1]]; + } + if($flag17 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$aveduration_value[$keyOne1[1]]; + } + + echo "

      Duration Statistic Chart(UMTS)
      "; + $image=CreateImage(820,390); + if($select_checkbox_id>15) + { + $boldline3=$select_checkbox_id-16; + for($i=16;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline3--; + } + } + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline3,1,0,1 + ); + + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + + $remarkBlock=array( + "Total Call Duration", + "Average Call Duration" + ); + $pointArr=array( + array(60,367), + array(260,367) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} +?> diff --git a/wxc2_omc/performance/generalCsta/msc_tg_day.php b/wxc2_omc/performance/generalCsta/msc_tg_day.php new file mode 100755 index 0000000..9731a77 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/msc_tg_day.php @@ -0,0 +1,500 @@ +"; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +} +if(!isset($keyTwo) || trim($keyTwo)=="") + $keyTwo=0; + +//Get the trunk title +for($i=0;$i<=256;$i++) +{ + $trunk_element_title[$i]="--"; +} +$dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + +//===get the title of tg===== +$database="OBJ_320"; +$sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle'"; +$result=@mysqli_query($objDbConn,$sql); +$TrunkGroupCount=mysqli_num_rows($result); + +if($TrunkGroupCount>0) +{ + while($rows = @mysqli_fetch_array($result)) + { + //get the instanceNo of the tg + $trunk_no=$rows[instanceNo]+0; + $trunk_status[$trunk_no]=1; + $trunk_element_title[$trunk_no]=$rows[initValue]; + } +} +if(0) +{ + echo "
      ";
      +	print_r($trunk_status);
      +	print_r($trunk_element_title);
      +	echo "
      "; +} + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataChip[3]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",3); +$cstaDataChip[4]=GetCstaDataByDay($cstaConf,$startTime,$endTime,"sum",4); + +for($tg_no=0;$tg_no<=256;$tg_no++) +{ + $cstaDataChip[3][0][3][$tg_no][Attempt]+=0; + $cstaDataChip[3][0][3][$tg_no][Success]+=0; + $cstaDataChip[3][0][3][$tg_no][Duration]+=0; + $cstaDataChip[3][0][3][$tg_no][SignalErr]+=0; + $cstaDataChip[3][0][3][$tg_no][CallDeny]+=0; + $cstaDataChip[3][0][3][$tg_no][NetBusy]+=0; + $cstaDataChip[3][0][3][$tg_no][CallerClear]+=0; + $cstaDataChip[3][0][3][$tg_no][Normal]+=0; + $cstaDataChip[3][0][3][$tg_no][SubBusy]+=0; + $cstaDataChip[3][0][3][$tg_no][NoAnswer]+=0; + + $cstaDataChip[4][0][4][$tg_no][Attempt]+=0; + $cstaDataChip[4][0][4][$tg_no][Success]+=0; + $cstaDataChip[4][0][4][$tg_no][Duration]+=0; + $cstaDataChip[4][0][4][$tg_no][SignalErr]+=0; + $cstaDataChip[4][0][4][$tg_no][CallDeny]+=0; + $cstaDataChip[4][0][4][$tg_no][NetBusy]+0; + $cstaDataChip[4][0][4][$tg_no][CallerClear]+=0; + $cstaDataChip[4][0][4][$tg_no][Normal]+=0; + $cstaDataChip[4][0][4][$tg_no][SubBusy]+=0; + $cstaDataChip[4][0][4][$tg_no][NoAnswer]+=0; + + + $cstaDataChip[2][0][2][$tg_no][Attempt]=$cstaDataChip[3][0][3][$tg_no][Attempt]+$cstaDataChip[4][0][4][$tg_no][Attempt]; + $cstaDataChip[2][0][2][$tg_no][Success]=$cstaDataChip[3][0][3][$tg_no][Success]+$cstaDataChip[4][0][4][$tg_no][Success]; + $cstaDataChip[2][0][2][$tg_no][Duration]=$cstaDataChip[3][0][3][$tg_no][Duration]+$cstaDataChip[4][0][4][$tg_no][Duration]; + $cstaDataChip[2][0][2][$tg_no][SignalErr]=$cstaDataChip[3][0][3][$tg_no][SignalErr]+$cstaDataChip[4][0][4][$tg_no][SignalErr]; + $cstaDataChip[2][0][2][$tg_no][CallDeny]=$cstaDataChip[3][0][3][$tg_no][CallDeny]+$cstaDataChip[4][0][4][$tg_no][CallDeny]; + $cstaDataChip[2][0][2][$tg_no][NetBusy]=$cstaDataChip[3][0][3][$tg_no][NetBusy]+$cstaDataChip[4][0][4][$tg_no][NetBusy]; + $cstaDataChip[2][0][2][$tg_no][CallerClear]=$cstaDataChip[3][0][3][$tg_no][CallerClear]+$cstaDataChip[4][0][4][$tg_no][CallerClear]; + $cstaDataChip[2][0][2][$tg_no][Normal]=$cstaDataChip[3][0][3][$tg_no][Normal]+$cstaDataChip[4][0][4][$tg_no][Normal]; + $cstaDataChip[2][0][2][$tg_no][SubBusy]=$cstaDataChip[3][0][3][$tg_no][SubBusy]+$cstaDataChip[4][0][4][$tg_no][SubBusy]; + $cstaDataChip[2][0][2][$tg_no][NoAnswer]=$cstaDataChip[3][0][3][$tg_no][NoAnswer]+$cstaDataChip[4][0][4][$tg_no][NoAnswer]; + + $inData[Attempt]+=$cstaDataChip[3][0][3][$tg_no][Attempt]; + $inData[Success]+=$cstaDataChip[3][0][3][$tg_no][Success]; + $inData[Duration]+=$cstaDataChip[3][0][3][$tg_no][Duration]; + $inData[SignalErr]+=$cstaDataChip[3][0][3][$tg_no][SignalErr]; + $inData[CallDeny]+=$cstaDataChip[3][0][3][$tg_no][CallDeny]; + $inData[NetBusy]+=$cstaDataChip[3][0][3][$tg_no][NetBusy]; + $inData[CallerClear]+=$cstaDataChip[3][0][3][$tg_no][CallerClear]; + $inData[Normal]+=$cstaDataChip[3][0][3][$tg_no][Normal]; + $inData[SubBusy]+=$cstaDataChip[3][0][3][$tg_no][SubBusy]; + $inData[NoAnswer]+=$cstaDataChip[3][0][3][$tg_no][NoAnswer]; + + $outData[Attempt]+=$cstaDataChip[4][0][4][$tg_no][Attempt]; + $outData[Success]+=$cstaDataChip[4][0][4][$tg_no][Success]; + $outData[Duration]+=$cstaDataChip[4][0][4][$tg_no][Duration]; + $outData[SignalErr]+=$cstaDataChip[4][0][4][$tg_no][SignalErr]; + $outData[CallDeny]+=$cstaDataChip[4][0][4][$tg_no][CallDeny]; + $outData[NetBusy]+=$cstaDataChip[4][0][4][$tg_no][NetBusy]; + $outData[CallerClear]+=$cstaDataChip[4][0][4][$tg_no][CallerClear]; + $outData[Normal]+=$cstaDataChip[4][0][4][$tg_no][Normal]; + $outData[SubBusy]+=$cstaDataChip[4][0][4][$tg_no][SubBusy]; + $outData[NoAnswer]+=$cstaDataChip[4][0][4][$tg_no][NoAnswer]; + + $inoutData[Attempt]+=$cstaDataChip[2][0][2][$tg_no][Attempt]; + $inoutData[Success]+=$cstaDataChip[2][0][2][$tg_no][Success]; + $inoutData[Duration]+=$cstaDataChip[2][0][2][$tg_no][Duration]; + $inoutData[SignalErr]+=$cstaDataChip[2][0][2][$tg_no][SignalErr]; + $inoutData[CallDeny]+=$cstaDataChip[2][0][2][$tg_no][CallDeny]; + $inoutData[NetBusy]+=$cstaDataChip[2][0][2][$tg_no][NetBusy]; + $inoutData[CallerClear]+=$cstaDataChip[2][0][2][$tg_no][CallerClear]; + $inoutData[Normal]+=$cstaDataChip[2][0][2][$tg_no][Normal]; + $inoutData[SubBusy]+=$cstaDataChip[2][0][2][$tg_no][SubBusy]; + $inoutData[NoAnswer]+=$cstaDataChip[2][0][2][$tg_no][NoAnswer]; +} + + + +if($keyTwo == 0) +{ + $cstaData=$cstaDataChip[2][0][2]; +} +else if($keyTwo == 1) +{ + $cstaData=$cstaDataChip[3][0][3]; +} +else if($keyTwo == 2) +{ + $cstaData=$cstaDataChip[4][0][4]; +} +else +{ + $cstaData=$cstaDataChip[2][0][2]; +} + +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	print_r($cstaDataChip);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="Trunk Group"; + if($keyTwo == 0) + $table_title.=" Incoming&Outgoing "; + else if($keyTwo == 1) + $table_title.=" Incoming "; + else if($keyTwo == 2) + $table_title.=" Outgoing "; + + $table_title.="Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + $columnTitle=array( + "TG No.", + "Element Title", + "Attempt", + "Success", + "Call Deny", + "Net Busy", + "Caller
      Clear", + "Sub Busy", + "No
      Answer", + "Signal
      Error", + "Total Call
      Duration", + "Average Call
      Duration(s)" + ); + $columnNum=sizeof($columnTitle); + $keyTwoRelation=array(5,6,7,8,9,-1,10,11,-1,12,13,14,15,16); + + echo "
      $table_title
      "; + echo ""; + + //Table title + echo ""; + for($i=0;$i<$columnNum;$i++) + { + echo ""; + } + echo ""; + //if(sizeof($cstaData) > 0) + ksort($cstaData); + $total_record_num=0; + + foreach($cstaData as $tg_no => $tg_data) + { + if($trunk_status[$tg_no] != 1) + continue; + echo ""; + //Trunk Group No. + echo ""; + + //Trunk Group Title + echo ""; + + //Attempt + echo ""; + + //Success + echo ""; + + //CallDeny + echo ""; + + //NetBusy + echo ""; + + //CallerClear + echo ""; + + //SubBusy + echo ""; + + //NoAnswer + echo ""; + + //SignalErr + echo ""; + + //Total Call Duration + echo ""; + + //Average Call Duration + if($tg_data[Success] > 0) + $value=ceil($tg_data[Duration]/$tg_data[Success]); + else + $value=0; + echo ""; + + $total_record_num++; + echo ""; + } + + if($total_record_num == 0) + echo ""; + echo "
      {$columnTitle[$i]}
      "; + echo "$tg_no"; + echo "{$trunk_element_title[$tg_no]}"; + echo "{$tg_data[Attempt]}"; + echo ""; + echo "{$tg_data[Success]}
      "; + $percent=GetPercent($tg_data[Success],$tg_data[Attempt]); + echo "$percent"; + echo "
      "; + echo "{$tg_data[CallDeny]}
      "; + $percent=GetPercent($tg_data[CallDeny],$tg_data[Attempt]); + echo "$percent"; + echo "
      "; + echo "{$tg_data[NetBusy]}
      "; + $percent=GetPercent($tg_data[NetBusy],$tg_data[Attempt]); + echo "$percent"; + echo "
      "; + echo "{$tg_data[CallerClear]}
      "; + $percent=GetPercent($tg_data[CallerClear],$tg_data[Attempt]); + echo "$percent"; + echo "
      "; + echo "{$tg_data[SubBusy]}
      "; + $percent=GetPercent($tg_data[SubBusy],$tg_data[Attempt]); + echo "$percent"; + echo "
      "; + echo "{$tg_data[NoAnswer]}
      "; + $percent=GetPercent($tg_data[NoAnswer],$tg_data[Attempt]); + echo "$percent"; + echo "
      "; + echo "{$tg_data[SignalErr]}
      "; + $percent=GetPercent($tg_data[SignalErr],$tg_data[Attempt]); + echo "$percent"; + echo "
      "; + echo "{$tg_data[Duration]}
      "; + $timestamp=SecondToTimeStamp($tg_data[Duration]); + echo "{$timestamp}"; + echo "
      "; + echo "{$value}"; + echo "
      ------------------------
      "; +} + +//Table-2 +{ + $columnTitle=array( + "Type", + "Success", + "Call Deny", + "Net Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error", + ); + $columnNum=sizeof($columnTitle); + + $table_title="Trunk Group General Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + for($i=0;$i<$columnNum;$i++) + { + echo ""; + } + echo ""; + + //In + echo ""; + echo ""; + if($inData[Attempt] == 0) + { + for($i=0;$i<7;$i++) + echo ""; + } + else + { + $percent=GetPercent($inData[Success],$inData[Attempt]); + echo ""; + + $percent=GetPercent($inData[CallDeny],$inData[Attempt]); + echo ""; + + $percent=GetPercent($inData[NetBusy],$inData[Attempt]); + echo ""; + + $percent=GetPercent($inData[CallerClear],$inData[Attempt]); + echo ""; + + $percent=GetPercent($inData[SubBusy],$inData[Attempt]); + echo ""; + + $percent=GetPercent($inData[NoAnswer],$inData[Attempt]); + echo ""; + + $percent=GetPercent($inData[SignalErr],$inData[Attempt]); + echo ""; + } + echo ""; + + //Out + echo ""; + echo ""; + if($outData[Attempt] == 0) + { + for($i=0;$i<7;$i++) + echo ""; + } + else + { + $percent=GetPercent($outData[Success],$outData[Attempt]); + echo ""; + + $percent=GetPercent($outData[CallDeny],$outData[Attempt]); + echo ""; + + $percent=GetPercent($outData[NetBusy],$outData[Attempt]); + echo ""; + + $percent=GetPercent($outData[CallerClear],$outData[Attempt]); + echo ""; + + $percent=GetPercent($outData[SubBusy],$outData[Attempt]); + echo ""; + + $percent=GetPercent($outData[NoAnwser],$outData[Attempt]); + echo ""; + + $percent=GetPercent($outData[SignalErr],$outData[Attempt]); + echo ""; + } + echo ""; + + //In&Out + echo ""; + echo ""; + if($inoutData[Attempt] == 0) + { + for($i=0;$i<7;$i++) + echo ""; + } + else + { + $percent=GetPercent($inoutData[Success],$inoutData[Attempt]); + echo ""; + + $percent=GetPercent($inoutData[CallDeny],$inoutData[Attempt]); + echo ""; + + $percent=GetPercent($inoutData[NetBusy],$inoutData[Attempt]); + echo ""; + + $percent=GetPercent($inoutData[CallerClear],$inoutData[Attempt]); + echo ""; + + $percent=GetPercent($inoutData[SubBusy],$inoutData[Attempt]); + echo ""; + + $percent=GetPercent($inoutData[NoAnwser],$inoutData[Attempt]); + echo ""; + + $percent=GetPercent($inoutData[SignalErr],$inoutData[Attempt]); + echo ""; + } + echo ""; + echo "
      {$columnTitle[$i]}
      In0%$percent$percent$percent$percent$percent$percent$percent
      Out0%$percent$percent$percent$percent$percent$percent$percent
      In&Out0%$percent$percent$percent$percent$percent$percent$percent
      "; +} + +//Graphics-1 +{ + //Graphics-1, Part-1 + $tmpData[]=$inData[Attempt]+0; + $tmpData[]=$outData[Attempt]+0; + + $tmpColor[]=array(0x00,0xff,0x00); + $tmpColor[]=array(0x00,0x00,0xff); + + echo "
      In.Out Attempt Percentage Chart
      "; + $image=CreateImage(710,320); + + $image=DrawPercentHistogram( + $image, + $tmpData, + $tmpColor, + array(30,20), + array(150,250),1,0 + ); + + //Graphics-1, Part-2 + unset($tmpData); + $tmpData[]=array($inData[Success]+0,$outData[Success]+0); + $tmpData[]=array($inData[CallDeny]+0,$outData[CallDeny]+0); + $tmpData[]=array($inData[NetBusy]+0,$outData[NetBusy]+0); + $tmpData[]=array($inData[CallerClear]+0,$outData[CallerClear]+0); + $tmpData[]=array($inData[SubBusy]+0,$outData[SubBusy]+0); + $tmpData[]=array($inData[NoAnswer]+0,$outData[NoAnswer]+0); + $tmpData[]=array($inData[SignalErr]+0,$outData[SignalErr]+0); + + $image=DrawStackPercentHistogram($image, + $tmpData, + $tmpColor, + array(220,20), + array(470,250),1,0 + ); + + $remarkBlock=array( + "In", + "Out", + ); + $pointArr=array( + array(60,295), + array(370,295) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + + unset($remarkBlock); + unset($pointArr); + $remarkBlock=array( + "Success", + "Call","Deny", + "Net","Busy", + "Caller","Clear", + "Sub","Busy", + "No","Answer", + "Signal","Error" + ); + $pointArr=array( + array(245,275), + array(320,270),array(320,280), + array(385,270),array(380,280), + array(440,270),array(440,280), + array(507,270),array(505,280), + array(570,270),array(565,280), + array(625,270),array(627,280) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,0,0,2); + + DrawImage($image); +} +?> \ No newline at end of file diff --git a/wxc2_omc/performance/generalCsta/msc_tg_hour.php b/wxc2_omc/performance/generalCsta/msc_tg_hour.php new file mode 100755 index 0000000..8365dbc --- /dev/null +++ b/wxc2_omc/performance/generalCsta/msc_tg_hour.php @@ -0,0 +1,415 @@ +"; + echo "sysTypeNo=$sysTypeNo,show_type=$show_type,page_id=$page_id,keyOne=$keyOne,keyTwo=$keyTwo
      "; + echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to
      "; + echo "select_checkbox_id=$select_checkbox_id
      "; +} + +echo ""; +echo ""; + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataChip[3]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",3,$keyOne); +$cstaDataChip[4]=GetCstaDataByHour($cstaConf,$startTime,$endTime,"sum",4,$keyOne); + +$total_hour_num=$slot*24; +for($i=0;$i<$total_hour_num;$i++) +{ + $inData[Attempt][$i]=$cstaDataChip[3][0][3][$keyOne][Attempt][$i]+0; + $inData[Success][$i]=$cstaDataChip[3][0][3][$keyOne][Success][$i]+0; + $inData[Duration][$i]=$cstaDataChip[3][0][3][$keyOne][Duration][$i]+0; + $inData[SignalErr][$i]=$cstaDataChip[3][0][3][$keyOne][SignalErr][$i]+0; + $inData[CallDeny][$i]=$cstaDataChip[3][0][3][$keyOne][CallDeny][$i]+0; + $inData[NetBusy][$i]=$cstaDataChip[3][0][3][$keyOne][NetBusy][$i]+0; + $inData[CallerClear][$i]=$cstaDataChip[3][0][3][$keyOne][CallerClear][$i]+0; + $inData[Normal][$i]=$cstaDataChip[3][0][3][$keyOne][Normal][$i]+0; + $inData[SubBusy][$i]=$cstaDataChip[3][0][3][$keyOne][SubBusy][$i]+0; + $inData[NoAnswer][$i]=$cstaDataChip[3][0][3][$keyOne][NoAnswer][$i]+0; + + $outData[Attempt][$i]=$cstaDataChip[4][0][4][$keyOne][Attempt][$i]+0; + $outData[Success][$i]=$cstaDataChip[4][0][4][$keyOne][Success][$i]+0; + $outData[Duration][$i]=$cstaDataChip[4][0][4][$keyOne][Duration][$i]+0; + $outData[SignalErr][$i]=$cstaDataChip[4][0][4][$keyOne][SignalErr][$i]+0; + $outData[CallDeny][$i]=$cstaDataChip[4][0][4][$keyOne][CallDeny][$i]+0; + $outData[NetBusy][$i]=$cstaDataChip[4][0][4][$keyOne][NetBusy][$i]+0; + $outData[CallerClear][$i]=$cstaDataChip[4][0][4][$keyOne][CallerClear][$i]+0; + $outData[Normal][$i]=$cstaDataChip[4][0][4][$keyOne][Normal][$i]+0; + $outData[SubBusy][$i]=$cstaDataChip[4][0][4][$keyOne][SubBusy][$i]+0; + $outData[NoAnswer][$i]=$cstaDataChip[4][0][4][$keyOne][NoAnswer][$i]+0; + + $inoutData[Attempt][$i]=$inData[Attempt][$i]+$outData[Attempt][$i]; + $inoutData[Success][$i]=$inData[Success][$i]+$outData[Success][$i]; + $inoutData[Duration][$i]=$inData[Duration][$i]+$outData[Duration][$i]; + $inoutData[SignalErr][$i]=$inData[SignalErr][$i]+$outData[SignalErr][$i]; + $inoutData[CallDeny][$i]=$inData[CallDeny][$i]+$outData[CallDeny][$i]; + $inoutData[NetBusy][$i]=$inData[NetBusy][$i]+$outData[NetBusy][$i]; + $inoutData[CallerClear][$i]=$inData[CallerClear][$i]+$outData[CallerClear][$i]; + $inoutData[Normal][$i]=$inData[Normal][$i]+$outData[Normal][$i]; + $inoutData[SubBusy][$i]=$inData[SubBusy][$i]+$outData[SubBusy][$i]; + $inoutData[NoAnswer][$i]=$inData[NoAnswer][$i]+$outData[NoAnswer][$i]; +} + + +//In&Out +if($keyTwo == 0) +{ + $cstaData=$inoutData; +} +//In +else if($keyTwo == 1) +{ + $cstaData=$inData; +} +else if($keyTwo == 2) +{ + $cstaData=$outData; +} + +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Get the trunk title +$trunk_element_title="--"; + +$dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + +//===get the title of tg===== +$instanceNo=omc_keep_length($keyOne,'0',4); +$database="OBJ_320"; +$sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle' and T1.instanceNo='$instanceNo' "; +$result=@mysqli_query($objDbConn,$sql); +$TrunkGroupCount=mysqli_num_rows($result); + +if($TrunkGroupCount>0) +{ + $rows = @mysqli_fetch_array($result); + $trunk_element_title=$rows[initValue]; +} +//Table-1 +{ + $table_title="TG $keyOne [$trunk_element_title]"; + if($keyTwo == 0) + $table_title.=" Incoming&Outgoing "; + else if($keyTwo == 1) + $table_title.=" Incoming "; + else if($keyTwo == 2) + $table_title.=" Outgoing "; + + $table_title.="Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + $columnTitle=array( + "Time", + "Attempt", + "Success", + "Call Deny", + "Net Busy", + "Caller
      Clear", + "Sub Busy", + "No
      Answer", + "Signal
      Error", + "Total Call
      Duration", + "Average Call
      Duration(s)" + ); + $columnNum=sizeof($columnTitle); + + echo "
      $table_title
      "; + echo ""; + echo ""; + for($i=0;$i<$columnNum;$i++) + { + echo ""; + } + echo ""; + + for($hour=0;$hour<$total_hour_num;$hour++) + { + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y")))."H"; + echo ""; + + echo ""; + + //Attempt + echo ""; + + //Success + echo ""; + + //CallDeny + echo ""; + + //NetBusy + echo ""; + + //CallerClear + echo ""; + + //SubBusy + echo ""; + + //NoAnswer + echo ""; + + //SignalErr + echo ""; + + //TotalCallDuration + echo ""; + + //AverageCallDuration + if($cstaData[Success][$hour] > 0) + $value=ceil($cstaData[Duration][$hour]/$cstaData[Success][$hour]); + else + $value=0; + echo ""; + + echo ""; + } + echo "
      {$columnTitle[$i]}
      "; + echo "$hour_title"; + echo ""; + echo "{$cstaData[Attempt][$hour]}
      "; + echo "
      "; + echo "{$cstaData[Success][$hour]}
      "; + $percent=GetPercent($cstaData[Success][$hour],$cstaData[Attempt][$hour]); + echo "{$percent}"; + echo "
      "; + echo "{$cstaData[CallDeny][$hour]}
      "; + $percent=GetPercent($cstaData[CallDeny][$hour],$cstaData[Attempt][$hour]); + echo "{$percent}"; + echo "
      "; + echo "{$cstaData[NetBusy][$hour]}
      "; + $percent=GetPercent($cstaData[NetBusy][$hour],$cstaData[Attempt][$hour]); + echo "{$percent}"; + echo "
      "; + echo "{$cstaData[CallerClear][$hour]}
      "; + $percent=GetPercent($cstaData[CallerClear][$hour],$cstaData[Attempt][$hour]); + echo "{$percent}"; + echo "
      "; + echo "{$cstaData[SubBusy][$hour]}
      "; + $percent=GetPercent($cstaData[SubBusy][$hour],$cstaData[Attempt][$hour]); + echo "{$percent}"; + echo "
      "; + echo "{$cstaData[NoAnswer][$hour]}
      "; + $percent=GetPercent($cstaData[NoAnswer][$hour],$cstaData[Attempt][$hour]); + echo "{$percent}"; + echo "
      "; + echo "{$cstaData[SignalErr][$hour]}
      "; + $percent=GetPercent($cstaData[SignalErr][$hour],$cstaData[Attempt][$hour]); + echo "{$percent}"; + echo "
      "; + echo "{$cstaData[Duration][$hour]}
      "; + $timestamp=SecondToTimeStamp($cstaData[Duration][$hour]); + echo "{$timestamp}"; + echo "
      "; + echo "{$value}"; + echo "
      "; +} + +//Graphics-1 +{ + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + $tmpData[]=$cstaData[Success]; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$cstaData[CallDeny]; + } + if($flag2 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$cstaData[NetBusy]; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + $tmpData[]=$cstaData[CallerClear]; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x66,0x33,0); + $tmpData[]=$cstaData[SubBusy]; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xcc,0,0x66); + $tmpData[]=$cstaData[NoAnswer]; + } + if($flag6 == "on") + { + $tmpColor[]=array(0xff,0,0); + $tmpData[]=$cstaData[SignalErr]; + } + + echo "
      Hourly Statistic Chart
      "; + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + $boldline=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "Success", + "Call Deny", + "Network Busy", + "Caller Clear", + "Sub Busy", + "No Answer", + "Signal Error" + ); + $pointArr=array( + array(60,367), + array(160,367), + array(260,367), + array(360,367), + array(460,367), + array(560,367), + array(660,367) + ); + + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0x33); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + $tmpColor[]=array(0x66,0,0xcc); + $tmpColor[]=array(0x66,0x33,0); + $tmpColor[]=array(0xcc,0,0x66); + $tmpColor[]=array(0xff,0,0); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} + +//Graphics-2 +{ + for($i=0;$i<$total_hour_num;$i++) + { + if($cstaData[Success][$i] > 0) + $aveduration_value[$i]=ceil($cstaData[Duration][$i]/$cstaData[Success][$i]); + else + $aveduration_value[$i]=0; + } + + unset($tmpColor); + unset($tmpData); + + if($flag7 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + $tmpData[]=$cstaData[Duration]; + } + if($flag8 == "on") + { + $tmpColor[]=array(0,0x66,0x66); + $tmpData[]=$aveduration_value; + } + + echo "

      Duration Statistic Chart
      "; + $image=CreateImage(820,390); + + $boldline=$select_checkbox_id-7; + for($i=7;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + unset($tmpColor); + $tmpColor[]=array(0x66,0xff,0xff); + $tmpColor[]=array(0,0x66,0x66); + + $remarkBlock=array( + "Total Call Duration", + "Average Call Duration" + ); + $pointArr=array( + array(60,367), + array(260,367) + ); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} +?> diff --git a/wxc2_omc/performance/generalCsta/opps_service_day.php b/wxc2_omc/performance/generalCsta/opps_service_day.php new file mode 100755 index 0000000..5eed9fe --- /dev/null +++ b/wxc2_omc/performance/generalCsta/opps_service_day.php @@ -0,0 +1,549 @@ +"BothClose", + "01"=>"IMDXOpen", + "10"=>"OPROpen", + "11"=>"BothOpen" +); +$oppsServiceStatus=getSystemState(375,86,2); +//echo "oppsServiceStatus=$oppsServiceStatus
      "; +$enableFlag=1; +if($serviceFlag[$oppsServiceStatus] == "OPROpen") +{ + $tmpLabel=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch"); + $sel_type=$tmpLabel[$keyTwo]; +} +else if($serviceFlag[$oppsServiceStatus] == "IMDXOpen") +{ + $tmpLabel=array(0=>"IMDX MO",1=>"IMDX Location Update"); + $sel_type=$tmpLabel[$keyTwo]; +} +else if($serviceFlag[$oppsServiceStatus] == "BothOpen") +{ + $tmpLabel=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch",3=>"IMDX MO",4=>"IMDX Location Update"); + $sel_type=$tmpLabel[$keyTwo]; +} +else +{ + $tmpLabel=array(0=>"None"); + $enableFlag=0; +} + +if($enableFlag == 0) + exit("Can not receive the heartbeat of OPPS or the function is disable"); + +//********************************* +$cstaConf=GetCstaConf($sysTypeNo); +if(0) +{ + echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to
      "; + echo "keyTwo=$keyTwo,sel_type=$sel_type
      "; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +echo ""; +echo ""; + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaData=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +if($serviceFlag[$oppsServiceStatus] == "BothOpen" || $serviceFlag[$oppsServiceStatus] == "OPROpen") +{ + $table_title="OPR Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[0][1][man_reg_suc]+0; + echo ""; + $value=$cstaData[0][1][auto_reg_suc]+0; + echo ""; + $value=$cstaData[0][1][opr_lu_suc]+0; + echo ""; + $value=$cstaData[0][1][recy_sub_suc]+0; + echo ""; + $value=$cstaData[0][1][swi_roam_mode_suc]+0; + echo ""; + $value=$cstaData[0][1][swi_opr_mode_suc]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=$cstaData[0][1][man_reg_fail]+0; + echo ""; + $value=$cstaData[0][1][auto_reg_fail]+0; + echo ""; + $value=$cstaData[0][1][opr_lu_fail]+0; + echo ""; + $value=$cstaData[0][1][recy_sub_fail]+0; + echo ""; + $value=$cstaData[0][1][swi_roam_mode_fail]+0; + echo ""; + $value=$cstaData[0][1][swi_opr_mode_fail]+0; + echo ""; + echo ""; + echo "
       Manual RegisterAuto RegisterOPR LURecycle AccountSwitch to RoamSwitch to OPR
      Success$value$value$value$value$value$value
      Fail$value$value$value$value$value$value
      "; +} + +//Table-2 +if($serviceFlag[$oppsServiceStatus] == "BothOpen" || $serviceFlag[$oppsServiceStatus] == "IMDXOpen") +{ + $table_title="IMDX Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[1][2][pri_to_pri]+0; + echo ""; + $value=$cstaData[1][2][hyb_to_pri]+0; + echo ""; + $value=$cstaData[1][2][hyb_to_pub]+0; + echo ""; + $value=$cstaData[1][2][pre_to_pub]+0; + echo ""; + $value=$cstaData[1][2][ord_to_pub]+0; + echo ""; + $value=$cstaData[1][2][pub_to_pri]+0; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[1][2][pre_lu_suc]+$cstaData[1][2][ord_lu_suc]; + echo ""; + $value=$cstaData[1][2][pre_lu_exc]+$cstaData[1][2][ord_lu_exc]; + echo ""; + $value=$cstaData[1][2][hyb_lu_suc]+0; + echo ""; + $value=$cstaData[1][2][hyb_lu_exc]+0; + echo ""; + $value=$cstaData[1][2][pub_lu_suc]+0; + echo ""; + $value=$cstaData[1][2][pub_lu_exc]+0; + echo ""; + echo ""; + echo "
      MO Services
      Private to PrivateHybrid to PrivateHybrid to PublicPremium to PublicOrdinary to PublicPublic to Private
      $value$value$value$value$value$value
      LU
      Private SuccessPrivate ExcludedHybrid SuccessHybrid ExcludedPublic SuccessPublic Excluded
      $value$value$value$value$value$value
      "; +} + +//Graphics-1 +{ + unset($cstaData); + unset($tmpData); + unset($tmpColor); + $cstaData=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail"); + if(0) + { + echo "
      ";
      +		print_r($cstaData);
      +		echo "
      "; + echo "sel_type=$sel_type
      "; + } + if(strcmp($sel_type,"OPR Registration")==0) + { + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][man_reg_suc][$i]+0; + $tmpData[]=$data; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][man_reg_fail][$i]+0; + $tmpData[]=$data; + } + if($flag2 == "on") + { + $tmpColor[]=array(0x00,0x66,0x66); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][auto_reg_suc][$i]+0; + $tmpData[]=$data; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][auto_reg_fail][$i]+0; + $tmpData[]=$data; + } + + $remarkBlock=array( + "Manual-Registration Success", + "Manual-Registration Fail", + "Auto-Registration Success", + "Auto-Registration Fail" + ); + + $pointArr=array( + array(50,367), + array(240,367), + array(430,367), + array(620,367) + ); + unset($blockColor); + $blockColor[]=array(0x66,0xff,0x33); + $blockColor[]=array(0x66,0xff,0xff); + $blockColor[]=array(0x00,0x66,0x66); + $blockColor[]=array(0x66,0,0xcc); + } + else if(strcmp($sel_type,"OPR Location Update")==0) + { + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][opr_lu_suc][$i]+0; + $tmpData[]=$data; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][opr_lu_fail][$i]+0; + $tmpData[]=$data; + } + if($flag2 == "on") + { + $tmpColor[]=array(0x00,0x66,0x66); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][recy_sub_suc][$i]+0; + $tmpData[]=$data; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][recy_sub_fail][$i]+0; + $tmpData[]=$data; + } + + $remarkBlock=array( + "OPR LU Success", + "OPR LU Fail", + "Non-OPR Success", + "Non-OPR Fail" + ); + $pointArr=array( + array(50,367), + array(240,367), + array(430,367), + array(620,367) + ); + unset($blockColor); + $blockColor[]=array(0x66,0xff,0x33); + $blockColor[]=array(0x66,0xff,0xff); + $blockColor[]=array(0x00,0x66,0x66); + $blockColor[]=array(0x66,0,0xcc); + } + else if(strcmp($sel_type,"OPR Mode Switch")==0) + { + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][swi_roam_mode_suc][$i]+0; + $tmpData[]=$data; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][swi_roam_mode_fail][$i]+0; + $tmpData[]=$data; + } + if($flag2 == "on") + { + $tmpColor[]=array(0x00,0x66,0x66); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][swi_opr_mode_suc][$i]+0; + $tmpData[]=$data; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[0][1][swi_opr_mode_fail][$i]+0; + $tmpData[]=$data; + } + + $remarkBlock=array( + "OPR to Roam Success", + "OPR to Roam Fail", + "Roam to OPR Success", + "Roam to OPR Fail" + ); + $pointArr=array( + array(50,367), + array(240,367), + array(430,367), + array(620,367) + ); + unset($blockColor); + $blockColor[]=array(0x66,0xff,0x33); + $blockColor[]=array(0x66,0xff,0xff); + $blockColor[]=array(0x00,0x66,0x66); + $blockColor[]=array(0x66,0,0xcc); + } + else if(strcmp($sel_type,"IMDX MO")==0) + { + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][pri_to_pri][$i]+0; + $tmpData[]=$data; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][hyb_to_pri][$i]+0; + $tmpData[]=$data; + } + if($flag2 == "on") + { + $tmpColor[]=array(0x00,0x66,0x66); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][hyb_to_pub][$i]+0; + $tmpData[]=$data; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][pre_to_pub][$i]+0; + $tmpData[]=$data; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x66,0x33,0); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][ord_to_pub][$i]+0; + $tmpData[]=$data; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xcc,0,0x66); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][pub_to_pri][$i]+0; + $tmpData[]=$data; + } + + $remarkBlock=array( + "Private to Private", + "Hybrid to Private", + "Hybrid to Public", + "Premium to Public", + "Ordinary to Public", + "Public to Private" + ); + $pointArr=array( + array(50,367), + array(180,367), + array(310,367), + array(440,367), + array(570,367), + array(700,367) + ); + unset($blockColor); + $blockColor[]=array(0x66,0xff,0x33); + $blockColor[]=array(0x66,0xff,0xff); + $blockColor[]=array(0x00,0x66,0x66); + $blockColor[]=array(0x66,0,0xcc); + $blockColor[]=array(0x66,0x33,0); + $blockColor[]=array(0xcc,0,0x66); + } + else if(strcmp($sel_type,"IMDX Location Update")==0) + { + if($flag0 == "on") + { + $tmpColor[]=array(0x66,0xff,0x33); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][ord_lu_suc][$i]+$cstaData[1][2][pre_lu_suc][$i]; + $tmpData[]=$data; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x66,0xff,0xff); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][ord_lu_exc][$i]+$cstaData[1][2][pre_lu_exc][$i]; + $tmpData[]=$data; + } + if($flag2 == "on") + { + $tmpColor[]=array(0x00,0x66,0x66); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][hyb_lu_suc][$i]+0; + $tmpData[]=$data; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x66,0,0xcc); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][hyb_lu_exc][$i]+0; + $tmpData[]=$data; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x66,0x33,0); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][pub_lu_suc][$i]+0; + $tmpData[]=$data; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xcc,0,0x66); + unset($data); + for($i=0;$i<$total_hour_num;$i++) + $data[$i]=$cstaData[1][2][pub_lu_exc][$i]+0; + $tmpData[]=$data; + } + + $remarkBlock=array( + "Private Success", + "Private Excluded", + "Hybrid Success", + "Hybrid Excluded", + "Public Success", + "Public Excluded" + ); + $pointArr=array( + array(50,367), + array(180,367), + array(310,367), + array(440,367), + array(570,367), + array(700,367) + ); + unset($blockColor); + $blockColor[]=array(0x66,0xff,0x33); + $blockColor[]=array(0x66,0xff,0xff); + $blockColor[]=array(0x00,0x66,0x66); + $blockColor[]=array(0x66,0,0xcc); + $blockColor[]=array(0x66,0x33,0); + $blockColor[]=array(0xcc,0,0x66); + } + + echo "
      $sel_type Statistic Chart
      "; + + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + + $boldline=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$blockColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); +} +?> + diff --git a/wxc2_omc/performance/generalCsta/rcs_service_day.php b/wxc2_omc/performance/generalCsta/rcs_service_day.php new file mode 100755 index 0000000..8b44256 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/rcs_service_day.php @@ -0,0 +1,706 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +echo ""; +echo ""; + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +$cstaData=$cstaDataTmp[0]; + +$num_of_pods=count($cstaData); +$num_of_records=count($cstaData,1); +$num_of_col=$num_of_records/$num_of_pods; +if(0) +{ + echo "num=$num_of_col"; + echo "
      ";
      +	print_r($cstaData[2]);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="3G RCS Statistic Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + + $table_title="Signaling  "; + echo "
      $table_title
      "; + + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + //Attempt + echo ""; + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numLuAttempt]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numMoAttempt]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numMtAttempt]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numLsCall]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numSmoAttempt]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numSmtAttempt]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numGprsAttachAttempt]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numPdpActAttempt]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numPdpDeact]+0; + echo ""; + echo ""; + + //Success + echo ""; + echo ""; + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numLuSuccess]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numMoSuccess]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numMtSuccess]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numLsCall]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numSmoSuccess]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numSmtSuccess]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numGprsAttachSuccess]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numPdpActSuccess]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numPdpDeact]+0; + echo ""; + echo ""; + + + //Success Percentage + echo ""; + echo ""; + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numLuSuccess]; + $value2 += $cstaData[$i][numLuAttempt]; + } + $value=GetPercent($value1, $value2); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numMoSuccess]; + $value2 += $cstaData[$i][numMoAttempt]; + } + $value=GetPercent($value1, $value2); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numMtSuccess]; + $value2 += $cstaData[$i][numMtAttempt]; + } + $value=GetPercent($value1, $value2); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numLsCall]; + $value2 += $cstaData[$i][numMoAttempt]; + } + $value=GetPercent($value1, $value2); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numSmoSuccess]; + $value2 += $cstaData[$i][numSmoAttempt]; + } + $value=GetPercent($value1, $value2); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numSmtSuccess]; + $value2 += $cstaData[$i][numSmtAttempt]; + } + $value=GetPercent($value1, $value2); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numGprsAttachSuccess]; + $value2 += $cstaData[$i][numGprsAttachAttempt]; + } + $value=GetPercent($value1, $value2); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numPdpActSuccess]; + $value2 += $cstaData[$i][numPdpActAttempt]; + } + $value=GetPercent($value1, $value2); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numPdpDeact]; + $value2 += $cstaData[$i][numPdpDeact]; + } + $value=GetPercent($value1, $value2); + echo ""; + + echo ""; + echo "
       CS Service PS Service 
      LUMO CallMT CallLS CallMO SMSMT SMSAttachPDP ActPDP Deact
      Attempt$value$value$value$value$value$value$value$value$value
      Success$value$value$value$value$value$value$value$value$value
      Success %$value$value$value$value$value$value$value$value$value
      "; + + echo "

      "; + +} + +//Table-2 PS +{ + $table_title="PS Data  "; + echo "
      $table_title
      "; + + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + //Attempt + echo ""; + $value="--"; + echo ""; + $value="--"; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numGtpPRecvUplink]+0; + + echo ""; + $value1=number_format(($value+0)/1024,3); + echo ""; + + $value="--"; + echo ""; + $value="--"; + echo ""; + + echo ""; + + //Attempt + echo ""; + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numGtpPSentUplink]+0; + echo ""; + + $value1=number_format(($value+0)/1024,3); + echo ""; + + $value="--"; + echo ""; + $value="--"; + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numGtpPSentUplink]; + $value2 += $cstaData[$i][numGtpPRecvUplink]; + } + $value=GetPercent($value1-$value2,$value1); + echo ""; + + $value1=0; + $value2=0; + + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numGtpKBSentUplink]; + $value2 += $cstaData[$i][numGtpKBRecvUplink]; + } + $value=GetPercent($value1-$value2,$value1); + echo ""; + + echo ""; + echo ""; + $value=$cstaData[$i][numGtpPRecvDnlink]+0; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numGtpKBRecvDnlink]+0; + + $value1=number_format(($value+0)/1024,3); + echo ""; + + $value="--"; + echo ""; + $value="--"; + echo ""; + + $value="--"; + echo ""; + $value="--"; + echo ""; + + echo ""; + echo ""; + $value="--"; + echo ""; + $value="--"; + echo ""; + + $value=0; + for($i=1;$i<=$num_of_pods; $i++) + $value +=$cstaData[$i][numGtpPSentDnlink]+0; + echo ""; + + $value1=number_format(($value+0)/1024,3); + echo ""; + + $value1=0; + $value2=0; + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numGtpPRecvDnlink]; + $value2 += $cstaData[$i][numGtpPSentDnlink]; + } + $value=GetPercent($value1-$value2,$value1); + echo ""; + + $value1=0; + $value2=0; + for($i=1;$i<=$num_of_pods; $i++) + { + $value1 += $cstaData[$i][numGtpKBRecvDnlink]; + $value2 += $cstaData[$i][numGtpKBSentDnlink]; + } + $value=GetPercent($value1-$value2,$value1); + echo ""; + + echo ""; + echo "
       IuPS Iuh Offload 
      PacketsByte (M)PacketsByte (M)Packets %Volume %
      Uplink Rx$value$value$value$value1$value$value
      Uplink Tx$value$value1$value$value$value$value
      Downlink Rx$value$value1$value$value$value$value
      Downlink Tx$value$value$value$value1$value$value
      "; +} + +//Graphics-1 +{ + $cstaHourDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail"); + $cstaHourData=$cstaHourDataTmp[0]; + if(0) + { + echo "
      ";
      +		print_r($cstaHourData);
      +		echo "
      "; + } + + unset($tmpData); + unset($tmpColor); + if($flag0 == "on") + { + $tmpColor[]=array(0x00,0x00,0xff); + for($i=0;$i<$total_hour_num;$i++) + { + $lu_ok[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $lu_ok[$i] += $cstaHourData[$j][numLuSuccess][$i]+0; + } + } + $tmpData[]=$lu_ok; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x00,0xff,0x00); + for($i=0;$i<$total_hour_num;$i++) + { + $mo_call_ok[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $mo_call_ok[$i] += $cstaHourData[$j][numMoSuccess][$i]+0; + } + } + $tmpData[]=$mo_call_ok; + } + if($flag2 == "on") + { + $tmpColor[]=array(0xff,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + { + $mt_call_ok[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $mt_call_ok[$i] += $cstaHourData[$j][numMtSuccess][$i]+0; + } + } + $tmpData[]=$mt_call_ok; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x7d,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + { + $mo_sms_ok[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $mo_sms_ok[$i] += $cstaHourData[$j][numSmoSuccess][$i]+0; + } + } + $tmpData[]=$mo_sms_ok; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x00,0x7d,0x00); + for($i=0;$i<$total_hour_num;$i++) + { + $mt_sms_ok[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $mt_sms_ok[$i] += $cstaHourData[$j][numSmtSuccess][$i]+0; + } + } + $tmpData[]=$mt_sms_ok; + } + echo "
      CS Hour Traffic Chart
      "; + + $boldline=$select_checkbox_id; + if($select_checkbox_id<5) + { + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + } + //echo "boldline=$boldline,flag0/1/2/3/4/5/6/7/8/9=0$flag0,1$flag1,2$flag2,3$flag3,4$flag4,5$flag5,6$flag6,7$flag7,8$flag8"; + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "LU", + "MO Call", + "MT Call", + "MO SMS", + "MT SMS", + ); + $pointArr=array( + array(30,367), + array(130,367), + array(230,367), + array(330,367), + array(430,367), + ); + + unset($tmpColor); + $tmpColor[]=array(0x00,0x00,0xff); + $tmpColor[]=array(0x00,0xff,0x00); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0x7d,0x00,0x00); + $tmpColor[]=array(0x00,0x7d,0x00); + $tmpColor[]=array(0xff,0x00,0xff); + $tmpColor[]=array(0x66,0x22,0x66); + $tmpColor[]=array(0x88,0x88,0x88); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + +} + echo "

      "; + +//Graphics-2 +{ + $cstaHourDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail"); + $cstaHourData=$cstaHourDataTmp[0]; + if(0) + { + echo "
      ";
      +		print_r($cstaHourData);
      +		echo "
      "; + } + + unset($tmpData); + unset($tmpColor); + if($flag5 == "on") + { + $tmpColor[]=array(0x00,0x00,0xff); + + for($i=0;$i<$total_hour_num;$i++) + { + $iu_ps_ul[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $iu_ps_ul[$i] += number_format(($cstaHourData[$j][numGtpKBSentUplink][$i]+0)/1024,1); + } + } + $tmpData[]=$iu_ps_ul; + } + if($flag6 == "on") + { + $tmpColor[]=array(0x00,0xff,0x00); + for($i=0;$i<$total_hour_num;$i++) + { + $iu_ps_dl[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $iu_ps_dl[$i] +=number_format(($cstaHourData[$j][numGtpKBRecvDnlink][$i]+0)/1024,1); + } + } + $tmpData[]=$iu_ps_dl; + } + if($flag7 == "on") + { + $tmpColor[]=array(0xff,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + { + $iu_h_ul[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $iu_h_ul[$i] +=number_format(($cstaHourData[$j][numGtpKBRecvUplink][$i]+0)/1024,1); + } + } + $tmpData[]=$iu_h_ul; + } + if($flag8 == "on") + { + $tmpColor[]=array(0x7d,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + { + $iu_h_dl[$i] = 0; + for($j=1;$j<=$num_of_pods; $j++) + { + $iu_h_dl[$i] +=number_format(($cstaHourData[$j][numGtpKBSentDnlink][$i]+0)/1024,1); + } + } + $tmpData[]=$iu_h_dl; + } + + echo "
      PS Hour Traffic Chart
      "; + + if($select_checkbox_id>=5) + { + $boldline=$select_checkbox_id; + for($i=5;$i<=$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + } + //echo "boldline=$boldline,flag0/1/2/3/4/5/6/7/8/9=0$flag0,1$flag1,2$flag2,3$flag3,4$flag4,5$flag5,6$flag6,7$flag7,8$flag8"; + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "IuPS UL", + "IuPS DL", + "IuH UL", + "IuH DL", + ); + $pointArr=array( + array(30,367), + array(130,367), + array(230,367), + array(330,367), + ); + + unset($tmpColor); + + $tmpColor[]=array(0x00,0x00,0xff); + $tmpColor[]=array(0x00,0xff,0x00); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0x7d,0x00,0x00); + $tmpColor[]=array(0x00,0x7d,0x00); + $tmpColor[]=array(0xff,0x00,0xff); + $tmpColor[]=array(0x66,0x22,0x66); + $tmpColor[]=array(0x88,0x88,0x88); + $tmpColor[]=array(0x00,0x88,0x88); + + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + +} + echo "

      "; + +?> diff --git a/wxc2_omc/performance/generalCsta/rcs_service_pod_day.php b/wxc2_omc/performance/generalCsta/rcs_service_pod_day.php new file mode 100755 index 0000000..748ce10 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/rcs_service_pod_day.php @@ -0,0 +1,551 @@ +"; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +} +if(!isset($keyTwo) || trim($keyTwo)=="" || $keyTwo==0) + $keyTwo=1; + +if(1) +{ + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + + //===get the title of pod===== + $database="OBJ_364"; + $sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='podIdentity' "; + + if(0) + echo "sql= $sql"; + + $result=@mysqli_query($objDbConn,$sql); + $podCount=mysqli_num_rows($result); + + if($podCount>0) + { + while($rows = @mysqli_fetch_array($result)) + { + $index =$rows[instanceNo]+0; + $pod_element_title[$index]=$rows[initValue]; + } + } + + $database="OBJ_364"; + $sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='podPodId' "; + + if(0) + echo "sql= $sql"; + + $result=@mysqli_query($objDbConn,$sql); + $podCount=mysqli_num_rows($result); + + if($podCount>0) + { + $i=1; + while($rows = @mysqli_fetch_array($result)) + { + $pod_no[$i]=$rows[initValue]; + $i = $i + 1; + } + } + +} + +$cstaConf=GetCstaConf($sysTypeNo); +echo ""; +echo ""; + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +if(0) +echo "startTime=$startTime,endTime=$endTime
      "; +$pod_index=$pod_no[$keyTwo]; +$cstaDataTmp=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail",$pod_index); +$cstaData=$cstaDataTmp[0]; +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="POD <$pod_element_title[$keyTwo]> Statistic Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + + $table_title="Signaling  "; + echo "
      $table_title
      "; + + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + //Attempt + echo ""; + $value =$cstaData[$keyTwo][numLuAttempt]+0; + echo ""; + + $value=$cstaData[$keyTwo][numMoAttempt]+0; + echo ""; + + $value=$cstaData[$keyTwo][numMtAttempt]+0; + echo ""; + + $value=$cstaData[$keyTwo][numLsCall]+0; + echo ""; + + + $value=$cstaData[$keyTwo][numSmoAttempt]+0; + echo ""; + + $value=$cstaData[$keyTwo][numSmtAttempt]+0; + echo ""; + + $value=$cstaData[$keyTwo][numGprsAttachAttempt]+0; + echo ""; + + + $value=$cstaData[$keyTwo][numPdpActAttempt]+0; + echo ""; + + $value=$cstaData[$keyTwo][numPdpDeact]+0; + echo ""; + echo ""; + + //Success + echo ""; + echo ""; + $value=$cstaData[$keyTwo][numLuSuccess]+0; + echo ""; + + $value=$cstaData[$keyTwo][numMoSuccess]+0; + echo ""; + + $value=$cstaData[$keyTwo][numMtSuccess]+0; + echo ""; + + $value=$cstaData[$keyTwo][numLsCall]+0; + echo ""; + + $value=$cstaData[$keyTwo][numSmoSuccess]+0; + echo ""; + + $value=$cstaData[$keyTwo][numSmtSuccess]+0; + echo ""; + + $value=$cstaData[$keyTwo][numGprsAttachSuccess]+0; + echo ""; + + $value=$cstaData[$keyTwo][numPdpActSuccess]+0; + echo ""; + + $value=$cstaData[$keyTwo][numPdpDeact]+0; + echo ""; + echo ""; + + + //Success Percentage + echo ""; + echo ""; + $value=GetPercent($cstaData[$keyTwo][numLuSuccess],$cstaData[$keyTwo][numLuAttempt]); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numMoSuccess],$cstaData[$keyTwo][numMoAttempt]); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numMtSuccess],$cstaData[$keyTwo][numMtAttempt]); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numLsCall],$cstaData[$keyTwo][numLsCall]); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numSmoSuccess],$cstaData[$keyTwo][numSmoAttempt]); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numSmtSuccess],$cstaData[$keyTwo][numSmtAttempt]); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numGprsAttachSuccess],$cstaData[$keyTwo][numGprsAttachAttempt]); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numPdpActSuccess],$cstaData[$keyTwo][numPdpActAttempt]); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numPdpDeact],$cstaData[$keyTwo][numPdpDeact]); + echo ""; + + echo ""; + echo "
       CS Service PS Service 
      LUMO CallMT CallLS CallMO SMSMT SMSAttachPDP ActPDP Deact
      Attempt$value$value$value$value$value$value$value$value$value
      Success$value$value$value$value$value$value$value$value$value
      Success %$value$value$value$value$value$value$value$value$value
      "; + + echo "

      "; + +} + +//Table-2 PS +{ + $table_title="PS Data  "; + echo "
      $table_title
      "; + + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + //Attempt + echo ""; + $value="--"; + echo ""; + $value="--"; + echo ""; + + $value=$cstaData[$keyTwo][numGtpPRecvUplink]+0; + echo ""; + $value=number_format(($cstaData[$keyTwo][numGtpKBRecvUplink]+0)/1024,3); + echo ""; + + $value="--"; + echo ""; + $value="--"; + echo ""; + + echo ""; + + //Attempt + echo ""; + $value=$cstaData[$keyTwo][numGtpPSentUplink]+0; + echo ""; + $value=number_format(($cstaData[$keyTwo][numGtpKBSentUplink]+0)/1024,3); + echo ""; + + $value="--"; + echo ""; + $value="--"; + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numGtpPSentUplink]-$cstaData[$keyTwo][numGtpPRecvUplink],$cstaData[$keyTwo][numGtpPSentUplink]); + echo ""; + $value=GetPercent($cstaData[$keyTwo][numGtpKBSentUplink]-$cstaData[$keyTwo][numGtpKBRecvUplink],$cstaData[$keyTwo][numGtpKBSentUplink]); + echo ""; + + echo ""; + echo ""; + $value=$cstaData[$keyTwo][numGtpPRecvDnlink]+0; + echo ""; + $value=number_format(($cstaData[$keyTwo][numGtpKBRecvDnlink]+0)/1024,3); + echo ""; + + $value="--"; + echo ""; + $value="--"; + echo ""; + + $value="--"; + echo ""; + $value="--"; + echo ""; + + echo ""; + echo ""; + $value="--"; + echo ""; + $value="--"; + echo ""; + + $value=$cstaData[$keyTwo][numGtpPSentDnlink]+0; + echo ""; + $value=number_format(($cstaData[$keyTwo][numGtpKBSentDnlink]+0)/1024,3); + echo ""; + + $value=GetPercent($cstaData[$keyTwo][numGtpPRecvDnlink]-$cstaData[$keyTwo][numGtpPSentDnlink],$cstaData[$keyTwo][numGtpPRecvDnlink]); + echo ""; + $value=GetPercent($cstaData[$keyTwo][numGtpKBRecvDnlink]-$cstaData[$keyTwo][numGtpKBSentDnlink],$cstaData[$keyTwo][numGtpKBRecvDnlink]); + echo ""; + + echo ""; + echo "
       IuPS Iuh Offload 
      PacketsByte (M)PacketsByte (M)Packets %Volume %
      Uplink Rx$value$value$value$value$value$value
      Uplink Tx$value$value$value$value$value$value
      Downlink Rx$value$value$value$value$value$value
      Downlink Tx$value$value$value$value$value$value
      "; +} + +//Graphics-1 +{ + $cstaHourDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail"); + $cstaHourData=$cstaHourDataTmp[0]; + if(0) + { + echo "
      ";
      +		print_r($cstaHourData);
      +		echo "
      "; + } + + unset($tmpData); + unset($tmpColor); + if($flag0 == "on") + { + $tmpColor[]=array(0x00,0x00,0xff); + for($i=0;$i<$total_hour_num;$i++) + $lu_ok[$i]=$cstaHourData[$keyTwo][numLuSuccess][$i]+0; + $tmpData[]=$lu_ok; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x00,0xff,0x00); + for($i=0;$i<$total_hour_num;$i++) + $mo_call_ok[$i]=$cstaHourData[$keyTwo][numMoSuccess][$i]+0; + $tmpData[]=$mo_call_ok; + } + if($flag2 == "on") + { + $tmpColor[]=array(0xff,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + $mt_call_ok[$i]=$cstaHourData[$keyTwo][numMtSuccess][$i]+0; + $tmpData[]=$mt_call_ok; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x7d,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + $mo_sms_ok[$i]=$cstaHourData[$keyTwo][numSmoSuccess][$i]+0; + $tmpData[]=$mo_sms_ok; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x00,0x7d,0x00); + for($i=0;$i<$total_hour_num;$i++) + $mt_sms_ok[$i]=$cstaHourData[$keyTwo][numSmtSuccess][$i]+0; + $tmpData[]=$mt_sms_ok; + } + echo "
      CS Hour Traffic Chart
      "; + + $boldline=$select_checkbox_id; + if($select_checkbox_id<5) + { + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + } + //echo "boldline=$boldline,flag0/1/2/3/4/5/6/7/8/9=0$flag0,1$flag1,2$flag2,3$flag3,4$flag4,5$flag5,6$flag6,7$flag7,8$flag8"; + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "LU", + "MO Call", + "MT Call", + "MO SMS", + "MT SMS", + ); + $pointArr=array( + array(30,367), + array(130,367), + array(230,367), + array(330,367), + array(430,367), + ); + + unset($tmpColor); + $tmpColor[]=array(0x00,0x00,0xff); + $tmpColor[]=array(0x00,0xff,0x00); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0x7d,0x00,0x00); + $tmpColor[]=array(0x00,0x7d,0x00); + $tmpColor[]=array(0xff,0x00,0xff); + $tmpColor[]=array(0x66,0x22,0x66); + $tmpColor[]=array(0x88,0x88,0x88); + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + +} + echo "

      "; + +//Graphics-2 +{ + $cstaHourDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail"); + $cstaHourData=$cstaHourDataTmp[0]; + if(0) + { + echo "
      ";
      +		print_r($cstaHourData);
      +		echo "
      "; + } + + unset($tmpData); + unset($tmpColor); + if($flag5 == "on") + { + $tmpColor[]=array(0x00,0x00,0xff); + for($i=0;$i<$total_hour_num;$i++) + $iu_ps_ul[$i]=number_format(($cstaHourData[$keyTwo][numGtpKBSentUplink][$i]+0)/1024,1); + $tmpData[]=$iu_ps_ul; + } + if($flag6 == "on") + { + $tmpColor[]=array(0x00,0xff,0x00); + for($i=0;$i<$total_hour_num;$i++) + $iu_ps_dl[$i]=number_format(($cstaHourData[$keyTwo][numGtpKBRecvDnlink][$i]+0)/1024,1); + $tmpData[]=$iu_ps_dl; + } + if($flag7 == "on") + { + $tmpColor[]=array(0xff,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + $iu_h_ul[$i]=number_format(($cstaHourData[$keyTwo][numGtpKBRecvUplink][$i]+0)/1024,1); + $tmpData[]=$iu_h_ul; + } + if($flag8 == "on") + { + $tmpColor[]=array(0x7d,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + $iu_h_dl[$i]=number_format(($cstaHourData[$keyTwo][numGtpKBSentDnlink][$i]+0)/1024,1); + $tmpData[]=$iu_h_dl; + } + + echo "
      PS Hour Traffic Chart
      "; + + if($select_checkbox_id>=5) + { + $boldline=$select_checkbox_id; + for($i=5;$i<=$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + } + //echo "boldline=$boldline,flag0/1/2/3/4/5/6/7/8/9=0$flag0,1$flag1,2$flag2,3$flag3,4$flag4,5$flag5,6$flag6,7$flag7,8$flag8"; + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "IuPS UL", + "IuPS DL", + "IuH UL", + "IuH DL", + ); + $pointArr=array( + array(30,367), + array(130,367), + array(230,367), + array(330,367), + ); + + unset($tmpColor); + + $tmpColor[]=array(0x00,0x00,0xff); + $tmpColor[]=array(0x00,0xff,0x00); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0x7d,0x00,0x00); + $tmpColor[]=array(0x00,0x7d,0x00); + $tmpColor[]=array(0xff,0x00,0xff); + $tmpColor[]=array(0x66,0x22,0x66); + $tmpColor[]=array(0x88,0x88,0x88); + $tmpColor[]=array(0x00,0x88,0x88); + + + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + +} + echo "

      "; + +?> diff --git a/wxc2_omc/performance/generalCsta/smeg_service_day.php b/wxc2_omc/performance/generalCsta/smeg_service_day.php new file mode 100755 index 0000000..28bf344 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/smeg_service_day.php @@ -0,0 +1,103 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +$cstaData=$cstaDataTmp[0]; +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="SMEG Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[in_email_att]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[in_email_suc]+0; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[out_email_att]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[out_email_suc]+0; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[in_sms_att]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[in_sms_suc]+0; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[out_sms_att]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[out_sms_suc]+0; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + $value=0; + echo ""; + echo ""; +} +?> + diff --git a/wxc2_omc/performance/generalCsta/smsc_service_day.php b/wxc2_omc/performance/generalCsta/smsc_service_day.php new file mode 100755 index 0000000..1f81b9e --- /dev/null +++ b/wxc2_omc/performance/generalCsta/smsc_service_day.php @@ -0,0 +1,402 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +echo ""; +echo ""; + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +$cstaData=$cstaDataTmp[0]; +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="SMSC Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + + echo "
      $table_title
      "; + echo "
       TypeValue
      Incoming Email
      Attempt$value
      Success$value
      Outgoing Email
      Attempt$value
      Success$value
      Incoming SMS
      Attempt$value
      Success$value
      Outgoing SMS
      Attempt$value
      Success$value
      Total Message Length$value
      "; + //Table title + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //Attempt + echo ""; + $value=$cstaData[MS_to_SMSC_attempt]+0; + echo ""; + + $value=$cstaData[VMS_to_SMSC_attempt]+0; + echo ""; + + $value=$cstaData[PPS_to_SMSC_attempt]+0; + echo ""; + + $value=$cstaData[SMPP_to_SMSC_attempt]+0; + echo ""; + + $value=$cstaData[MS_to_SMSC_attempt]+$cstaData[VMS_to_SMSC_attempt]+$cstaData[PPS_to_SMSC_attempt]+$cstaData[SMPP_to_SMSC_attempt]; + echo ""; + + $value=$cstaData[SMSC_to_MS_attempt]+0; + echo ""; + + $value=$cstaData[SMSC_to_VMS_attempt]+0; + echo ""; + + $value=$cstaData[SMSC_to_PPS_attempt]+0; + echo ""; + + $value=$cstaData[SMSC_to_SMPP_attempt]+0; + echo ""; + + $value=$cstaData[SMSC_to_MS_attempt]+$cstaData[SMSC_to_VMS_attempt]+$cstaData[SMSC_to_PPS_attempt]+$cstaData[SMSC_to_SMPP_attempt]; + echo ""; + echo ""; + + //Success + echo ""; + echo ""; + $value=$cstaData[MS_to_SMSC_success]+0; + echo ""; + + $value=$cstaData[VMS_to_SMSC_success]+0; + echo ""; + + $value=$cstaData[PPS_to_SMSC_success]+0; + echo ""; + + $value=$cstaData[SMPP_to_SMSC_success]+0; + echo ""; + + $value=$cstaData[MS_to_SMSC_success]+$cstaData[VMS_to_SMSC_success]+$cstaData[PPS_to_SMSC_success]+$cstaData[SMPP_to_SMSC_success]; + echo ""; + + $value=$cstaData[SMSC_to_MS_success]+0; + echo ""; + + $value=$cstaData[SMSC_to_VMS_success]+0; + echo ""; + + $value=$cstaData[SMSC_to_PPS_success]+0; + echo ""; + + $value=$cstaData[SMSC_to_SMPP_success]+0; + echo ""; + + $value=$cstaData[SMSC_to_MS_success]+$cstaData[SMSC_to_VMS_success]+$cstaData[SMSC_to_PPS_success]+$cstaData[SMSC_to_SMPP_success]; + echo ""; + echo ""; + + //Failure + echo ""; + echo ""; + $value=$cstaData[MS_to_SMSC_sysfail]+$cstaData[MS_to_SMSC_userfail]+$cstaData[MS_to_SMSC_smfail]; + echo ""; + + $value=$cstaData[VMS_to_SMSC_sysfail]+$cstaData[VMS_to_SMSC_userfail]+$cstaData[VMS_to_SMSC_smfail]; + echo ""; + + $value=$cstaData[PPS_to_SMSC_sysfail]+$cstaData[PPS_to_SMSC_userfail]+$cstaData[PPS_to_SMSC_smfail]; + echo ""; + + $value=$cstaData[SMPP_to_SMSC_sysfail]+$cstaData[SMPP_to_SMSC_userfail]+$cstaData[SMPP_to_SMSC_smfail]; + echo ""; + + $value=$cstaData[MS_to_SMSC_sysfail]+$cstaData[MS_to_SMSC_userfail]+$cstaData[MS_to_SMSC_smfail]+ + $cstaData[VMS_to_SMSC_sysfail]+$cstaData[VMS_to_SMSC_userfail]+$cstaData[VMS_to_SMSC_smfail]+ + $cstaData[PPS_to_SMSC_sysfail]+$cstaData[PPS_to_SMSC_userfail]+$cstaData[PPS_to_SMSC_smfail]+ + $cstaData[SMPP_to_SMSC_sysfail]+$cstaData[SMPP_to_SMSC_userfail]+$cstaData[SMPP_to_SMSC_smfail]; + echo ""; + + $value=$cstaData[SMSC_to_MS_sysfail]+$cstaData[SMSC_to_MS_userfail]+$cstaData[SMSC_to_MS_smfail]; + echo ""; + + $value=$cstaData[SMSC_to_VMS_sysfail]+$cstaData[SMSC_to_VMS_userfail]+$cstaData[SMSC_to_VMS_smfail]; + echo ""; + + $value=$cstaData[SMSC_to_PPS_sysfail]+$cstaData[SMSC_to_PPS_userfail]+$cstaData[SMSC_to_PPS_smfail]; + echo ""; + + $value=$cstaData[SMSC_to_SMPP_sysfail]+$cstaData[SMSC_to_SMPP_userfail]+$cstaData[SMSC_to_SMPP_smfail]; + echo ""; + + $value=$cstaData[SMSC_to_MS_sysfail]+$cstaData[SMSC_to_MS_userfail]+$cstaData[SMSC_to_MS_smfail]+ + $cstaData[SMSC_to_VMS_sysfail]+$cstaData[SMSC_to_VMS_userfail]+$cstaData[SMSC_to_VMS_smfail]+ + $cstaData[SMSC_to_PPS_sysfail]+$cstaData[SMSC_to_PPS_userfail]+$cstaData[SMSC_to_PPS_smfail]+ + $cstaData[SMSC_to_SMPP_sysfail]+$cstaData[SMSC_to_SMPP_userfail]+$cstaData[SMSC_to_SMPP_smfail]; + echo ""; + echo ""; + + //Total bytes + echo ""; + echo ""; + $value=$cstaData[MS_to_SMSC_byte]+0; + echo ""; + + $value=$cstaData[VMS_to_SMSC_byte]+0; + echo ""; + + $value=$cstaData[PPS_to_SMSC_byte]+0; + echo ""; + + $value=$cstaData[SMPP_to_SMSC_byte]+0; + echo ""; + + $value=$cstaData[MS_to_SMSC_byte]+$cstaData[VMS_to_SMSC_byte]+$cstaData[PPS_to_SMSC_byte]+$cstaData[SMPP_to_SMSC_byte]; + echo ""; + + $value=$cstaData[SMSC_to_MS_byte]+0; + echo ""; + + $value=$cstaData[SMSC_to_VMS_byte]+0; + echo ""; + + $value=$cstaData[SMSC_to_PPS_byte]+0; + echo ""; + + $value=$cstaData[SMSC_to_SMPP_byte]+0; + echo ""; + + $value=$cstaData[SMSC_to_MS_byte]+$cstaData[SMSC_to_VMS_byte]+$cstaData[SMSC_to_PPS_byte]+$cstaData[SMSC_to_SMPP_byte]; + echo ""; + echo ""; + + //Success Percentage + echo ""; + echo ""; + $value=GetPercent($cstaData[MS_to_SMSC_success],$cstaData[MS_to_SMSC_attempt]); + echo ""; + + $value=GetPercent($cstaData[VMS_to_SMSC_success],$cstaData[VMS_to_SMSC_attempt]); + echo ""; + + $value=GetPercent($cstaData[PPS_to_SMSC_success],$cstaData[PPS_to_SMSC_attempt]); + echo ""; + + $value=GetPercent($cstaData[SMPP_to_SMSC_success],$cstaData[SMPP_to_SMSC_attempt]); + echo ""; + + $value=GetPercent($cstaData[MS_to_SMSC_success]+$cstaData[VMS_to_SMSC_success]+$cstaData[PPS_to_SMSC_success]+$cstaData[SMPP_to_SMSC_success], + $cstaData[MS_to_SMSC_attempt]+$cstaData[VMS_to_SMSC_attempt]+$cstaData[PPS_to_SMSC_attempt]+$cstaData[SMPP_to_SMSC_attempt]); + echo ""; + + $value=GetPercent($cstaData[SMSC_to_MS_success],$cstaData[SMSC_to_MS_attempt]); + echo ""; + + $value=GetPercent($cstaData[SMSC_to_VMS_success],$cstaData[SMSC_to_VMS_attempt]); + echo ""; + + $value=GetPercent($cstaData[SMSC_to_PPS_success],$cstaData[SMSC_to_PPS_attempt]); + echo ""; + + $value=GetPercent($cstaData[SMSC_to_SMPP_success],$cstaData[SMSC_to_SMPP_attempt]); + echo ""; + + $value=GetPercent($cstaData[SMSC_to_MS_success]+$cstaData[SMSC_to_VMS_success]+$cstaData[SMSC_to_PPS_success]+$cstaData[SMSC_to_SMPP_success], + $cstaData[SMSC_to_MS_attempt]+$cstaData[SMSC_to_VMS_attempt]+$cstaData[SMSC_to_PPS_attempt]+$cstaData[SMSC_to_SMPP_attempt]); + echo ""; + echo ""; + echo "
       
      To SMSCSMSC to
      MSVSSPPSSMPPTotalMSVSSPPSSMPPTotal
      Attempt$value$value$value$value$value$value$value$value$value$value
      Success$value$value$value$value$value$value$value$value$value$value
      Failure$value$value$value$value$value$value$value$value$value$value
      Total bytes$value$value$value$value$value$value$value$value$value$value
      Success Percentage$value$value$value$value$value$value$value$value$value$value
      "; + + + $sm_pending_begin=GetSpecialData(_MIN,"csta_datetime","SM_bgn","CSTA_DB.smscDetailData","csta_datetime>='$startTime' and csta_datetime<='$endTime'"); + $sm_pending_end=GetSpecialData(_MAX,"csta_datetime","SM_end","CSTA_DB.smscDetailData","csta_datetime>='$startTime' and csta_datetime<='$endTime'"); + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      Pending SM statistic at beginning:"; + echo "{$sm_pending_begin}
      Pending SM statistic at ending:"; + echo "{$sm_pending_end}
      "; +} + +//Graphics-1 +{ + $cstaHourDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail"); + $cstaHourData=$cstaHourDataTmp[0]; + if(0) + { + echo "
      ";
      +		print_r($cstaHourData);
      +		echo "
      "; + } + + unset($tmpData); + if($flag0 == "on") + { + $tmpColor[]=array(0x00,0x00,0xff); + for($i=0;$i<$total_hour_num;$i++) + $ms_smsc_data[$i]=$cstaHourData[MS_to_SMSC_success][$i]+0; + $tmpData[]=$ms_smsc_data; + } + if($flag1 == "on") + { + $tmpColor[]=array(0x00,0xff,0x00); + for($i=0;$i<$total_hour_num;$i++) + $vms_smsc_data[$i]=$cstaHourData[VMS_to_SMSC_success][$i]+0; + $tmpData[]=$vms_smsc_data; + } + if($flag2 == "on") + { + $tmpColor[]=array(0xff,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + $pps_smsc_data[$i]=$cstaHourData[PPS_to_SMSC_success][$i]+0; + $tmpData[]=$pps_smsc_data; + } + if($flag3 == "on") + { + $tmpColor[]=array(0x7d,0x00,0x00); + for($i=0;$i<$total_hour_num;$i++) + $smpp_smsc_data[$i]=$cstaHourData[SMPP_to_SMSC_success][$i]+0; + $tmpData[]=$smpp_smsc_data; + } + if($flag4 == "on") + { + $tmpColor[]=array(0x00,0x7d,0x00); + for($i=0;$i<$total_hour_num;$i++) + $smsc_ms_data[$i]=$cstaHourData[SMSC_to_MS_success][$i]+0; + $tmpData[]=$smsc_ms_data; + } + if($flag5 == "on") + { + $tmpColor[]=array(0xff,0x00,0xff); + for($i=0;$i<$total_hour_num;$i++) + $smsc_vms_data[$i]=$cstaHourData[SMSC_to_VMS_success][$i]+0; + $tmpData[]=$smsc_vms_data; + } + if($flag6 == "on") + { + $tmpColor[]=array(0x66,0x22,0x66); + for($i=0;$i<$total_hour_num;$i++) + $smsc_pps_data[$i]=$cstaHourData[SMSC_to_PPS_success][$i]+0; + $tmpData[]=$smsc_pps_data; + } + if($flag7 == "on") + { + $tmpColor[]=array(0x88,0x88,0x88); + for($i=0;$i<$total_hour_num;$i++) + $smsc_smpp_data[$i]=$cstaHourData[SMSC_to_SMPP_success][$i]+0; + $tmpData[]=$smsc_smpp_data; + } + if(0) + { + echo "flag0=$flag0,flag1=$flag1,flag2=$flag2,flag3=$flag3,flag4=$flag4,flag5=$flag5,flag6=$flag6,flag7=$flag7,flag8=$flag8,flag9=$flag9,flag10=$flag10,flag11=$flag11,flag12=$flag12,flag13=$flag13,flag14=$flag14,flag15=$flag15,flag16=$flag16
      "; + } + echo "
      SMSC Success Statistic Chart
      "; + + $boldline=$select_checkbox_id; + for($i=0;$i<$select_checkbox_id;$i++) + { + $param="flag$i"; + if($$param != "on") + $boldline--; + } + + $image=CreateImage(820,390); + $image=DrawLineHistogram( + $image, + $tmpData, + $tmpColor, + 750/(24*$slot), + 24, + array(50,20), + array(750,280), + $boldline,1,0,1 + ); + + $remarkBlock=array( + "MS to SMSC", + "VSS to SMSC", + "PPS to SMSC", + "SMPP to SMSC", + "SMSC to MS", + "SMSC to VSS", + "SMSC to PPS", + "SMSC to SMPP" + ); + $pointArr=array( + array(30,367), + array(130,367), + array(230,367), + array(330,367), + array(430,367), + array(530,367), + array(630,367), + array(730,367) + ); + + unset($tmpColor); + $tmpColor[]=array(0x00,0x00,0xff); + $tmpColor[]=array(0x00,0xff,0x00); + $tmpColor[]=array(0xff,0x00,0x00); + $tmpColor[]=array(0x7d,0x00,0x00); + $tmpColor[]=array(0x00,0x7d,0x00); + $tmpColor[]=array(0xff,0x00,0xff); + $tmpColor[]=array(0x66,0x22,0x66); + $tmpColor[]=array(0x88,0x88,0x88); + $image=AddRemarkToImage($image,$pointArr,$remarkBlock,$tmpColor,0,2); + DrawTimeStamp($image,$sel_date_from,$sel_date_to,array(50,355),750/24); + + echo ""; + echo ""; + for($i=0;$i"; + AddCheckbox($remarkBlock[$i]); + echo ""; + } + echo ""; + echo "
      "; + + DrawImage($image); + +} + +?> diff --git a/wxc2_omc/performance/generalCsta/tmg_service_day.php b/wxc2_omc/performance/generalCsta/tmg_service_day.php new file mode 100755 index 0000000..ccf6bba --- /dev/null +++ b/wxc2_omc/performance/generalCsta/tmg_service_day.php @@ -0,0 +1,76 @@ +"; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaData=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail"); +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $tmgCstaData=$cstaData[0]; + $table_title="TMG Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $row_num=count($tmgCstaData); + if($row_num > 0) + { + foreach($tmgCstaData as $e1_id => $data) + { + echo ""; + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + } + else + { + echo ""; + echo ""; + echo ""; + } + echo "
      E1 No.RTP Packets LossRTP Packets ReceiveRTP Packets Send
      "; + echo ""; + echo "$e1_id"; + echo ""; + echo ""; + echo "{$data[rtp_pkg_miss]}"; + echo ""; + echo "{$data[rtp_pkg_recv]}"; + echo ""; + echo "{$data[rtp_pkg_sent]}"; + echo "
      --------
      "; +} +?> \ No newline at end of file diff --git a/wxc2_omc/performance/generalCsta/tmg_service_hour.php b/wxc2_omc/performance/generalCsta/tmg_service_hour.php new file mode 100755 index 0000000..1dd1e0b --- /dev/null +++ b/wxc2_omc/performance/generalCsta/tmg_service_hour.php @@ -0,0 +1,88 @@ +"; + echo "show_type=$show_type
      "; + echo "page_id=$page_id
      "; + echo "sel_date_from=$sel_date_from
      "; + echo "sel_date_to=$sel_date_to
      "; + echo "keyOne=$keyOne,keyTwo=$keyTwo
      "; +} + +echo ""; +echo ""; + +$cstaConf=GetCstaConf($sysTypeNo); + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaDataTmp=GetCstaDataByHour($cstaConf,$startTime,$endTime,"detail",$keyOne,-1); + + +if(0) +{ + echo "
      ";
      +	print_r($cstaDataTmp);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="E1-{$keyOne}"; + $cstaData=$cstaDataTmp[0][$keyOne]; + + if($slot > 1) + $table_title.=" Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=" Statistic  Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $row_num=count($cstaData[rtp_pkg_miss]); + if($row_num > 0) + { + for($hour=0;$hour<$total_hour_num;$hour++) + { + if(isset($cstaData[rtp_pkg_miss][$hour])) + { + echo ""; + $hour_title=date("m-d H",mktime($hour,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + } + } + else + { + echo ""; + echo ""; + echo ""; + } + + echo "
      TimeRTP Packets LossRTP Packets ReceiveRTP Packets Send
      {$hour_title}H"; + echo "{$cstaData[rtp_pkg_miss][$hour]}"; + echo " "; + echo "{$cstaData[rtp_pkg_recv][$hour]}"; + echo " "; + echo "{$cstaData[rtp_pkg_sent][$hour]}"; + echo " 
      --------
      "; +} + +?> diff --git a/wxc2_omc/performance/generalCsta/vss_service_day.php b/wxc2_omc/performance/generalCsta/vss_service_day.php new file mode 100755 index 0000000..17f8042 --- /dev/null +++ b/wxc2_omc/performance/generalCsta/vss_service_day.php @@ -0,0 +1,96 @@ +"; + echo "keyTwo=$keyTwo
      "; + echo "
      ";
      +	print_r($cstaConf);
      +	echo "
      "; +} + +$slot=$sel_date_from-$sel_date_to+1; +$total_hour_num=$slot*24; +$startTime=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); +$endTime=date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-$sel_date_to,date("Y"))); +//echo "startTime=$startTime,endTime=$endTime
      "; + +$cstaData=GetCstaDataByDay($cstaConf,$startTime,$endTime,"detail",-1,"key_sys_id=$keyTwo"); +if(0) +{ + echo "
      ";
      +	print_r($cstaData);
      +	echo "
      "; +} + +//Table-1 +{ + $table_title="VSS Statistic  Date:"; + if($slot>1) + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")))." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + else + $table_title.=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + echo "
      $table_title
      "; + echo ""; + //Table title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[1][2][att_lev_msg]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[1][2][suc_lev_msg]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[1][2][att_mnt_msg]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[1][2][suc_mnt_msg]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[1][2][acc_fail]+0; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[0][1][att_org_call]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[0][1][suc_org_call]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[0][1][att_term_call]+0; + echo ""; + echo ""; + echo ""; + echo ""; + $value=$cstaData[0][1][suc_term_call]+0; + echo ""; + echo ""; + echo ""; + echo "
       Call TypeValue
      VSS
      Leave Message Attempt$value
      Leave Message Success$value
      Maintain Message Attempt$value
      Maintain Message Success$value
      Fail to Access$value
      ISUP
      Original Attempt$value
      Original Success$value
      Terminal Attempt$value
      Terminal Success$value
      "; +} +?> + diff --git a/wxc2_omc/performance/hlrCsta/dataAnalysisDown.php b/wxc2_omc/performance/hlrCsta/dataAnalysisDown.php new file mode 100755 index 0000000..f020cb5 --- /dev/null +++ b/wxc2_omc/performance/hlrCsta/dataAnalysisDown.php @@ -0,0 +1,568 @@ + + + +"; + +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$db=$csta_db; +$time_column = "csta_datetime"; +$table_name='hlrDetail'."_".$showDate; +$title_time=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));//表头显示时间 + + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + adjust_content_tail("down"); + exit(); + } + +if($language == 'eng') +{ + $strNcmroh="Number of current MS's Roaming outside HPLMN"; + $strArasrh="Authentication sets received"; + $strAisds="Insert subscriber data service"; + $strAlu="Location Updates"; + $strAsroh="SS related operations in HLR"; + $strArsri="Request for SM routing information"; + $strAsdssp="SM delivery status report procedures"; + $strAnsa="Number of send alerts"; + $strArm="Request for MSRN"; + $strHlrStatistic="HLR statistics"; +} +else +{ + $strNcmroh="Number of current MS's Roaming outside HPLMN"; + $strArasrh="Authentication sets received"; + $strAisds="Insert subscriber data service"; + $strAlu="Location Updates"; + $strAsroh="SS related operations"; + $strArsri="Request for SM routing information"; + $strAsdssp="SM delivery status report procedures"; + $strAnsa="Number of send alerts"; + $strArm="Request for MSRN"; + $strHlrStatistic="HLR statistics"; +} + +//-------确定日期范围----- +if($sel_date<0) +{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} +elseif($sel_date>0) +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } +} +else +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } +} + +/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ +$w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + +//合成where语句 +$where=" WHERE ".$w1; +$str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +if(!$number_of_records) +{ + echo "$strNotFindRecord"; + adjust_content_tail("down"); + exit(); +} +$sum_sql=" SELECT SUM(ncmroh) AS ncmroh,SUM(arasrh) AS arasrh,SUM(srasfh) AS srasfh,SUM(errash) AS errash,SUM(aisds) AS aisds, SUM(sisds) AS sisds,SUM(alu) AS alu,SUM(slu) AS slu,SUM(asroh) AS asroh,SUM(ssroh) AS ssroh,SUM(arsri) AS arsri,SUM(srsri) AS srsri,SUM(asdssp) AS asdssp,SUM(ssdsrp) AS ssdsrp,SUM(ansa) AS ansa,SUM(snsa) AS snsa,SUM(arm) AS arm,SUM(srm) AS srm FROM $table_name ".$where; +//echo "
      sum_sql=$sum_sql"; +$sum_res = mysqli_query($pubConn,$sum_sql); +$sum_row = @mysqli_fetch_array($sum_res); +echo mysqli_error($pubConn); + +$ncmroh=$sum_row[ncmroh]; +if($ncmroh>0) +{ + $ncmrohScale="100%"; +} +else +{ + $ncmrohScale="0%"; +} +$arasrh=$sum_row[arasrh]; +$srasfh=$sum_row[srasfh]; +$frrash=$arasrh-$srasfh; +if($arasrh>0) +{ + $arasrhScale="100%"; + $srasfhPoint=$srasfh/$arasrh; + $srasfhScale=change_percent($srasfh/$arasrh); + $frrashPoint=$frrash/$arasrh; + $frrashScale=change_percent($frrash/$arasrh); +} +else +{ + $arasrhScale="0%"; + $srasfhPoint="0%"; + $srasfhScale="0%"; + $frrashPoint="0%"; + $frrashScale="0%"; +} + +$aisds=$sum_row[aisds]; +$sisds=$sum_row[sisds]; +$fisds=$aisds-$sisds; +if($aisds>0) +{ + $aisdsScale="100%"; + $sisdsPoint=$sisds/$aisds; + $sisdsScale=change_percent($sisds/$aisds); + $fisdsPoint=$fisds/$aisds; + $fisdsScale=change_percent($fisds/$aisds); +} +else +{ + $aisdsScale="0%"; + $sisdsPoint="0%"; + $sisdsScale="0%"; + $fisdsPoint="0%"; + $fisdsScale="0%"; +} + +$alu=$sum_row[alu]; +$slu=$sum_row[slu]; +$flu=$alu-$slu; +if($alu>0) +{ + $aluScale="100%"; + $sluPoint=$slu/$alu; + $sluScale=change_percent($slu/$alu); + $fluPoint=$flu/$alu; + $fluScale=change_percent($flu/$alu); +} +else +{ + $aluScale="0%"; + $sluPoint="0%"; + $sluScale="0%"; + $fluPoint="0%"; + $fluScale="0%"; +} + +$asroh=$sum_row[asroh]; +$ssroh=$sum_row[ssroh]; +$fsroh=$asroh-$ssroh; +if($asroh>0) +{ + $asrohScale="100%"; + $ssrohPoint=$ssroh/$asroh; + $ssrohScale=change_percent($ssroh/$asroh); + $fsrohPoint=$fsroh/$asroh; + $fsrohScale=change_percent($fsroh/$asroh); +} +else +{ + $asrohScale="0%"; + $ssrohPoint="0%"; + $ssrohScale="0%"; + $fsrohPoint="0%"; + $fsrohScale="0%"; +} + +$arsri=$sum_row[arsri]; +$srsri=$sum_row[srsri]; +$frsri=$arsri-$srsri; +if($arsri>0) +{ + $arsriScale="100%"; + $srsriPoint=$srsri/$arsri; + $srsriScale=change_percent($srsri/$arsri); + $frsriPoint=$frsri/$arsri; + $frsriScale=change_percent($frsri/$arsri); +} +else +{ + $arsriScale="0%"; + $srsriPoint="0%"; + $srsriScale="0%"; + $frsriPoint="0%"; + $frsriScale="0%"; +} + +$asdssp=$sum_row[asdssp]; +$ssdsrp=$sum_row[ssdsrp]; +$fsdsrp=$asdssp-$ssdsrp; +if($asdssp>0) +{ + $asdsspScale="100%"; + $ssdsrpPoint=$ssdsrp/$asdssp; + $ssdsrpScale=change_percent($ssdsrp/$asdssp); + $fsdsrpPoint=$fsdsrp/$asdssp; + $fsdsrpScale=change_percent($fsdsrp/$asdssp); +} +else +{ + $asdsspScale="0%"; + $ssdsrpPoint="0%"; + $ssdsrpScale="0%"; + $fsdsrpPoint="0%"; + $fsdsrpScale="0%"; +} + +$ansa=$sum_row[ansa]; +$snsa=$sum_row[snsa]; +$fnsa=$ansa-$snsa; +if($ansa>0) +{ + $ansaScale="100%"; + $snsaPoint=$snsa/$ansa; + $snsaScale=change_percent($snsa/$ansa); + $fnsaPoint=$fnsa/$ansa; + $fnsaScale=change_percent($fnsa/$ansa); +} +else +{ + $ansaScale="0%"; + $snsaPoint="0%"; + $snsaScale="0%"; + $fnsaPoint="0%"; + $fnsaScale="0%"; +} + +$arm=$sum_row[arm]; +$srm=$sum_row[srm]; +$frm=$arm-$srm; +if($arm>0) +{ + $armScale="100%"; + $srmPoint=$srm/$arm; + $srmScale=change_percent($srm/$arm); + $frmPoint=$frm/$arm; + $frmScale=change_percent($frm/$arm); +} +else +{ + $armScale="0%"; + $srmPoint="0%"; + $srmScale="0%"; + $frmPoint="0%"; + $frmScale="0%"; +} + +?> + + +
      + + + + + + + + +
      + +

        +Date: +

      +  +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      1.

      +

      +

      +

      +

      +

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + 2. +
      + + + + + + + + + + + + + + + + + + + +
              
      +

      + + + + + + + + +
      :
      + + + \ No newline at end of file diff --git a/wxc2_omc/performance/hlrCsta/dataAnalysisIndex.php b/wxc2_omc/performance/hlrCsta/dataAnalysisIndex.php new file mode 100755 index 0000000..5ac0925 --- /dev/null +++ b/wxc2_omc/performance/hlrCsta/dataAnalysisIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/hlrCsta/dataAnalysisUp.php b/wxc2_omc/performance/hlrCsta/dataAnalysisUp.php new file mode 100755 index 0000000..38e2eae --- /dev/null +++ b/wxc2_omc/performance/hlrCsta/dataAnalysisUp.php @@ -0,0 +1,89 @@ + + + + + + +"; +echo ""; +echo ""; +echo "$strAdvanced > $strPerformance > HLR > Statistics"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; +?> + +"; +echo ""; +?> + + + +"; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + + +
      + + + diff --git a/wxc2_omc/performance/hlrCsta/dataQueryDown.php b/wxc2_omc/performance/hlrCsta/dataQueryDown.php new file mode 100755 index 0000000..ca1c2fe --- /dev/null +++ b/wxc2_omc/performance/hlrCsta/dataQueryDown.php @@ -0,0 +1,342 @@ + + +"; + +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$timeItem = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$db=$csta_db; +$sort_field = 'csta_datetime'; //排序所依赖的字段名 +$sort_direction = 'DESC'; //排序顺序 +$number_records_to_display = 200; //每页纪录数 +$time_column = "csta_datetime"; +$table_name='hlrDetail'."_".$showDate; + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + +if($language == 'eng') +{ + $strNcmroh="Number of current MS's Roaming outside HPLMN"; + $strArasrh="Attempted requests for Authentication sets"; + $strSrasfh="Successful returned Authentication sets"; + $strErrash="Empty responses to request for Authentication sets"; + $strAisds="Attempted insert subscriber data service"; + $strSisds="Successful insert subscriber data service"; + $strAlu="Attempted Location Updates"; + $strSlu="Successful Location Updates"; + $strAsroh="Attempted SS related operations"; + $strSsroh="Successful SS related operations"; + $strArsri="Attempted request for SM routing information"; + $strSrsri="Successful request for SM routing information"; + $strAsdssp="Attempted SM delivery status report procedures"; + $strSsdsrp="Successful SM delivery status report procedures"; + $strAnsa="Attempted number of send alerts"; + $strSnsa="Successful number of send alerts"; + $strArm="Attempted request for MSRN"; + $strSrm="Successful request for MSRN"; +} +else +{ + $strNcmroh="Number of current MS's Roaming outside HPLMN"; + $strArasrh="Attempted requests for Authentication sets"; + $strSrasfh="Successful returned Authentication sets"; + $strErrash="Empty responses to request for Authentication sets"; + $strAisds="Attempted insert subscriber data service"; + $strSisds="Successful insert subscriber data service"; + $strAlu="Attempted Location Updates"; + $strSlu="Successful Location Updates"; + $strAsroh="Attempted SS related operations"; + $strSsroh="Successful SS related operations"; + $strArsri="Attempted request for SM routing information"; + $strSrsri="Successful request for SM routing information"; + $strAsdssp="Attempted SM delivery status report procedures"; + $strSsdsrp="Successful SM delivery status report procedures"; + $strAnsa="Attempted number of send alerts"; + $strSnsa="Successful number of send alerts"; + $strArm="Attempted request for MSRN"; + $strSrm="Successful request for MSRN"; +} +$where = isset($where) ? urldecode($where) : ''; //传回变量后解url码 +$where = isset($where) ? stripslashes($where) : ''; //解除一些'/' +//删除所查询的内容 +if($delete){ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//end of delete +?> + + +0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + /* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ + $w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + + //合成where语句 + $where=" WHERE".$w1; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo $strNotFindRecord; + exit(); + } + +}//endif + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +if ($number_of_records >= 1){ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0){ + $prev_index = 0; + } +} +$show_initital_record=$initial_record+1; +?> + + + + +" +> + + +
       $show_initital_record - $next_index, ($strTotalRecords:$number_of_records )   "; ?>  +"; +//下面是控制分页显示,传递变量 +if ($initial_record != 0) +{ + $t1 = "initial_record=$prev_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 前一页  + 0 && $number_of_records > $number_records_to_display ) +{ + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 下一页 + +
      + +
      +"; +$csta_result = mysqli_query($pubConn,$csta_sql); +$csta_rows = @mysqli_fetch_array($csta_result); +echo mysqli_error($pubConn); + +echo ""; + +if($call_type==0)//local management +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + do + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} +elseif($call_type==1)//SM +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + do + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} +elseif($call_type==2) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + do + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} +?> +
      $strSystem$strArasrh$strSrasfh$strErrash$strAisds$strSisds$strAlu$strSlu$strTime($timeItem)
      "; + echo "HLR"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[arasrh]$csta_rows[srasfh]$csta_rows[errash]$csta_rows[aisds]$csta_rows[sisds]$csta_rows[alu]$csta_rows[slu]$tmpArray[1]
      $strSystem$strArsri$strSrsri$strAsdssp$strSsdsrp$strAnsa$strSnsa$strTime($timeItem)
      "; + echo "HLR"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[arsri]$csta_rows[srsri]$csta_rows[asdssp]$csta_rows[ssdsrp]$csta_rows[ansa]$csta_rows[snsa]$tmpArray[1]
      $strSystem$strNcmroh$strAsroh$strSsroh$strArm$strSrm$strTime
      "; + echo "HLR"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[ncmroh]$csta_rows[asroh]$csta_rows[ssroh]$csta_rows[arm]$csta_rows[srm]$tmpArray[1]
      + + + + + + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/hlrCsta/dataQueryIndex.php b/wxc2_omc/performance/hlrCsta/dataQueryIndex.php new file mode 100755 index 0000000..1190c33 --- /dev/null +++ b/wxc2_omc/performance/hlrCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/hlrCsta/dataQueryUp.php b/wxc2_omc/performance/hlrCsta/dataQueryUp.php new file mode 100755 index 0000000..daacb83 --- /dev/null +++ b/wxc2_omc/performance/hlrCsta/dataQueryUp.php @@ -0,0 +1,90 @@ + + + + + + +
      +"; + echo ""; + echo ""; + echo "$strAdvanced > $strPerformance > HLR > Data"; + echo ""; + echo ""; +// showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> + + +"; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + + +?> + +
      + + diff --git a/wxc2_omc/performance/improveCsta/conf/erlang.conf b/wxc2_omc/performance/improveCsta/conf/erlang.conf new file mode 100755 index 0000000..45b02d5 --- /dev/null +++ b/wxc2_omc/performance/improveCsta/conf/erlang.conf @@ -0,0 +1,9 @@ +[All] + +[ConditionCustomizePage] +Title="Performance > MSC > Erlang" +SubTitle="Customize the statistic condition for Erlang" +HelpID=1.2.2 +MaxInterval=30 +File=erlang_customize.php + diff --git a/wxc2_omc/performance/improveCsta/csta_customize.php b/wxc2_omc/performance/improveCsta/csta_customize.php new file mode 100755 index 0000000..26aa949 --- /dev/null +++ b/wxc2_omc/performance/improveCsta/csta_customize.php @@ -0,0 +1,56 @@ + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "{$configuration[ConditionCustomizePage][Title]}"; + echo ""; + showHelp($configuration[ConditionCustomizePage][HelpID]); + echo "
      "; + echo " "; + echo ""; + echo " "; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +echo "
      {$configuration[ConditionCustomizePage][SubTitle]}

      "; + +if(0) +{ + echo "
      ";
      +	print_r($configuration);
      +	echo "
      "; +} + +include($configuration[ConditionCustomizePage][File]); + + + +echo ""; + +echo ""; +adjust_content_tail(); +?> + diff --git a/wxc2_omc/performance/improveCsta/csta_result.php b/wxc2_omc/performance/improveCsta/csta_result.php new file mode 100755 index 0000000..5b62969 --- /dev/null +++ b/wxc2_omc/performance/improveCsta/csta_result.php @@ -0,0 +1,72 @@ + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "{$configuration[All][Title]}"; + echo ""; + showHelp($configuration[All][HelpID]); + echo "
      "; + echo " "; + echo ""; + echo " "; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +echo "
      {$configuration[All][SubTitle]}

      "; + +if(0) +{ + echo "
      ";
      +	print_r($configuration);
      +	echo "
      "; +} + +if(1) +{ + $maincondcount=$configuration[All][MainConditionCount]; + $maincondname=$configuration[All][MainConditionListName]; + for($i=0;$i<$maincondcount;$i++) + { + $name=$configuration[$maincondname][$i]; + $value=$$name; + echo "{$configuration[$maincondname][$i]}={$value}
      "; + } + + $maincondcount=$configuration[All][SubConditionCount]; + $maincondname=$configuration[All][SubConditionListName]; + for($i=0;$i<$maincondcount;$i++) + { + $name=$configuration[$maincondname][$i]; + $value=$$name; + echo "{$configuration[$maincondname][$i]}={$value}
      "; + } +} + + +echo ""; +adjust_content_tail(); +?> diff --git a/wxc2_omc/performance/improveCsta/erlang_customize.php b/wxc2_omc/performance/improveCsta/erlang_customize.php new file mode 100755 index 0000000..fead2c5 --- /dev/null +++ b/wxc2_omc/performance/improveCsta/erlang_customize.php @@ -0,0 +1,28 @@ + + + + + + + + +
      + Type + + + Interval + + + +
      diff --git a/wxc2_omc/performance/improveCsta/function.inc b/wxc2_omc/performance/improveCsta/function.inc new file mode 100755 index 0000000..b28b04f --- /dev/null +++ b/wxc2_omc/performance/improveCsta/function.inc @@ -0,0 +1,3 @@ + + + diff --git a/wxc2_omc/performance/improveCsta_bak/conf/erlang.conf b/wxc2_omc/performance/improveCsta_bak/conf/erlang.conf new file mode 100755 index 0000000..0a466cf --- /dev/null +++ b/wxc2_omc/performance/improveCsta_bak/conf/erlang.conf @@ -0,0 +1,172 @@ +[All] +Title="Performance > MSC > Erlang" +SubTitle="Customize the statistic condition for Erlang" +HelpID=1.2.2 +MaxInterval=30 + +MainConditionCount=3 +MainConditionListName=MainConditionList + +SubConditionCount=12 +SubConditionListName=SubConditionList + +[MainConditionList] +0=TypeCondition +1=IntervalCondition +2=MergeCondition + +[SubConditionList] +0=SubSubCondition +1=SubTrkCondition +2=TrkSubCondition +3=TrkIPCondition +4=TrkTrkCondition +5=IntraCondition +6=SubIPCondition +7=IPCondition +8=MOCondition +9=MTCondition +10=InTrkCondition +11=OutTrkCondition + +[TypeCondition] +Flag=enable +Type=select +ShowName=Type +Define=TypeConditionSelect + +[TypeConditionSelect] +DefaultValue=0 +ValueCount=2 +0=Service +1=Trunk Group + +[IntervalCondition] +Flag=enable +Type=select +ShowName=Interval +Define=IntervalConditionSelect + +[IntervalConditionSelect] +DefaultValue=0 +ValueCount=2 +0=Daily +1=Hourly + +[MergeCondition] +Flag=enable +Type=checkbox +ShowName=Merge +Define=MergeConditionCheckbox + +[MergeConditionCheckbox] +DefaultValue=1 + +[SubSubCondition] +Flag=enable +Type=checkbox +ShowName=SUB SUB +Define=SubSubConditionCheckbox + +[SubSubConditionCheckbox] +DefaultValue=0 + +[SubTrkCondition] +Flag=enable +Type=checkbox +ShowName=SUB TRK +Define=SubTrkConditionCheckbox + +[SubTrkConditionCheckbox] +DefaultValue=0 + +[TrkSubCondition] +Flag=enable +Type=checkbox +ShowName=TRK SUB +Define=TrkSubConditionCheckbox + +[TrkSubConditionCheckbox] +DefaultValue=0 + +[TrkIPCondition] +Flag=enable +Type=checkbox +ShowName=TRK IP +Define=TrkIPConditionCheckbox + +[TrkIPConditionCheckbox] +DefaultValue=0 + +[TrkTrkCondition] +Flag=enable +Type=checkbox +ShowName=TRK TRK +Define=TrkTrkConditionCheckbox + +[TrkTrkConditionCheckbox] +DefaultValue=0 + +[IntraCondition] +Flag=enable +Type=checkbox +ShowName=INTRA +Define=IntraConditionCheckbox + +[IntraConditionCheckbox] +DefaultValue=0 + +[SubIPCondition] +Flag=enable +Type=checkbox +ShowName=SUB IP +Define=SubIPConditionCheckbox + +[SubIPConditionCheckbox] +DefaultValue=0 + +[IPCondition] +Flag=enable +Type=checkbox +ShowName=IP +Define=IPConditionCheckbox + +[IPConditionCheckbox] +DefaultValue=0 + +[MOCondition] +Flag=enable +Type=checkbox +ShowName=MO +Define=MOConditionCheckbox + +[MOConditionCheckbox] +DefaultValue=1 + +[MTCondition] +Flag=enable +Type=checkbox +ShowName=MT +Define=MTConditionCheckbox + +[MTConditionCheckbox] +DefaultValue=1 + +[InTrkCondition] +Flag=enable +Type=checkbox +ShowName=IN TRK +Define=InTrkConditionCheckbox + +[InTrkConditionCheckbox] +DefaultValue=0 + +[OutTrkCondition] +Flag=enable +Type=checkbox +ShowName=OUT TRK +Define=OutTrkConditionCheckbox + +[OutTrkConditionCheckbox] +DefaultValue=0 + diff --git a/wxc2_omc/performance/improveCsta_bak/csta_condition.php b/wxc2_omc/performance/improveCsta_bak/csta_condition.php new file mode 100755 index 0000000..a1ac213 --- /dev/null +++ b/wxc2_omc/performance/improveCsta_bak/csta_condition.php @@ -0,0 +1,177 @@ + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "{$configuration[All][Title]}"; + echo ""; + showHelp($configuration[All][HelpID]); + echo "
      "; + echo " "; + echo ""; + echo " "; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +echo "
      {$configuration[All][SubTitle]}

      "; + +if(0) +{ + echo "
      ";
      +	print_r($configuration);
      +	echo "
      "; +} + + +echo ""; +echo ""; +for($i=0;$i<$configuration[All][MainConditionCount];$i++) +{ + echo ""; +} + + +echo ""; + + +echo ""; + + +echo ""; + +echo ""; + + +echo ""; +echo ""; +echo ""; + + +echo "
      "; + + $mainname=$configuration[All][MainConditionListName]; + $ctlname=$configuration[$mainname][$i]; + $definename=$configuration[$ctlname][Define]; + if(strcasecmp($configuration[$ctlname][Flag],"enable") == 0) + { + if(strcasecmp($configuration[$ctlname][Type],"select") == 0) + { + $default=$configuration[$definename][DefaultValue]; + $valuecount=$configuration[$definename][ValueCount]; + echo "{$configuration[$ctlname][ShowName]} "; + echo ""; + } + else if(strcasecmp($configuration[$ctlname][Type],"checkbox") == 0) + { + $default=$configuration[$definename][DefaultValue]; + echo ""; + echo "{$configuration[$ctlname][ShowName]}"; + } + } + echo ""; +echo "Start Time "; +echo ""; +echo ""; +echo "End Time "; +echo ""; +echo ""; +echo ""; +echo "
      "; + +echo ""; +for($i=0;$i<$configuration[All][SubConditionCount];$i++) +{ + if($i%4 == 0) + echo ""; + + + $mainname=$configuration[All][SubConditionListName]; + $ctlname=$configuration[$mainname][$i]; + $definename=$configuration[$ctlname][Define]; + if(strcasecmp($configuration[$ctlname][Flag],"enable") == 0) + { + echo ""; + } + +} + +echo "
      "; + if(strcasecmp($configuration[$ctlname][Type],"select") == 0) + { + $default=$configuration[$definename][DefaultValue]; + $valuecount=$configuration[$definename][ValueCount]; + echo "{$configuration[$ctlname][ShowName]} "; + echo ""; + } + else if(strcasecmp($configuration[$ctlname][Type],"checkbox") == 0) + { + $default=$configuration[$definename][DefaultValue]; + echo ""; + echo "{$configuration[$ctlname][ShowName]}"; + } + echo "
      "; + +echo "
      "; + +echo ""; + +echo ""; +adjust_content_tail(); +?> + diff --git a/wxc2_omc/performance/improveCsta_bak/csta_result.php b/wxc2_omc/performance/improveCsta_bak/csta_result.php new file mode 100755 index 0000000..5b62969 --- /dev/null +++ b/wxc2_omc/performance/improveCsta_bak/csta_result.php @@ -0,0 +1,72 @@ + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "{$configuration[All][Title]}"; + echo ""; + showHelp($configuration[All][HelpID]); + echo "
      "; + echo " "; + echo ""; + echo " "; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +echo "
      {$configuration[All][SubTitle]}

      "; + +if(0) +{ + echo "
      ";
      +	print_r($configuration);
      +	echo "
      "; +} + +if(1) +{ + $maincondcount=$configuration[All][MainConditionCount]; + $maincondname=$configuration[All][MainConditionListName]; + for($i=0;$i<$maincondcount;$i++) + { + $name=$configuration[$maincondname][$i]; + $value=$$name; + echo "{$configuration[$maincondname][$i]}={$value}
      "; + } + + $maincondcount=$configuration[All][SubConditionCount]; + $maincondname=$configuration[All][SubConditionListName]; + for($i=0;$i<$maincondcount;$i++) + { + $name=$configuration[$maincondname][$i]; + $value=$$name; + echo "{$configuration[$maincondname][$i]}={$value}
      "; + } +} + + +echo ""; +adjust_content_tail(); +?> diff --git a/wxc2_omc/performance/improveCsta_bak/function.inc b/wxc2_omc/performance/improveCsta_bak/function.inc new file mode 100755 index 0000000..b28b04f --- /dev/null +++ b/wxc2_omc/performance/improveCsta_bak/function.inc @@ -0,0 +1,3 @@ + + + diff --git a/wxc2_omc/performance/ipalimCsta/bhca.php b/wxc2_omc/performance/ipalimCsta/bhca.php new file mode 100755 index 0000000..6c4e946 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/bhca.php @@ -0,0 +1,1935 @@ + + + + + + + + + 0){ + echo ""; + }else{ + echo ""; + } +//=======================================================================================| +//======== Data Initial when run first ========================| +//=======================================================================================| +if(!isset($csta_type)) + $csta_type=0; +if(!isset($select_date)) + $select_date=0; +if(!isset($sel_date)) + $sel_date=0; +if(!isset($trunk_num)) + $trunk_num="1,2"; +if(!isset($on_top_index)) + $on_top_index=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sub_sub_flag)) +{ + $sub_sub_flag=0; + $sub_loc_flag=0; + $tru_tol_flag=0; + $tru_sub_flag=0; + $tru_tru_flag=0; + $tru_ip_flag=0; + $sub_ip_flag=0; + $inter_flag=0; + $mo_flag=0; + $mt_flag=0; + $in_tru_flag=0; + $out_tru_flag=0; + $ip_inter_flag=0; +} + +$DEBUG=0; + +$helpId="3.2.5"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strTitlePerformance > MSC > $strBHCA"; +echo ""; +//showHelp($helpId); +echo "
      "; + + +//======up csta_type selection======== +echo "
      "; +echo ""; +echo ""; +echo ""; + +//======date selection====== +echo ""; + +//===search button===== +echo ""; + +//====printer button=== +echo ""; + +echo ""; +echo "
      "; +$csta_type_label=array("Service","E1","Trunk group"); +echo ""; +echo ""; +echo ""; +echo ""; + echo "
      "; + echo "$strSearch"; + echo "
      "; +echo "
      "; + echo "
      "; + echo ""; + echo "
      "; +echo "
      "; +?> +"; + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + $select="select key_type,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime==23) + continue; + //echo "datetime=$datetime
      "; + $bhca_service_oneday[$index][$datetime+1]+=$rows[1]; + //echo "type:$index time:$datetime {$bhca_service_oneday[$index][$datetime]}
      "; + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + $select="select key_type,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + + //echo "datetime=$datetime
      "; + $bhca_service_oneday[$index][0]+=$rows[1]; + //echo "type:$index time:$datetime {$bhca_service_oneday[$index][$datetime]}
      "; + }while($rows=mysqli_fetch_array($result)); + } + + + //======Fake Data======= + if($DEBUG) + { + for($i=0;$i<13;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_service_oneday[$i][$j]=rand(10,100); + } + } + } + + //=====Test the Data===== + if(0) + { + $test_service_type_label=array("SUB SUB","SUB LOC","TRK TOLL","TRK SUB","TRK TRK","SUB IP", + "TRK IP","INTER","MO","MT","IN TRK","OUT TRK","IP"); + for($i=0;$i<12;$i++) + { + for($j=0;$j<24;$j++) + { + echo "{$test_service_type_label[$i]}--$j--{$bhca_service_oneday[$i][$j]}
      "; + } + } + } + + + //====show the table-1==== + $table_title="Service"." BHCA Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); //table title + $service_type_label=array("Subs to subs","Subs to trunk","Trunk to subs","Trunk to trunk","Intraconnection", + "Sub to IP","Trunk to IP", + "Mobile originated","Mobile terminated","In trunk","Out trunk","IP terminated"); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<12;$i++) + { + echo ""; + echo ""; + for($j=0;$j<12;$j++) + { + echo ""; + } + echo ""; + + echo ""; + echo ""; + + echo ""; + for($j=0;$j<12;$j++) + { + echo ""; + } + echo ""; + echo ""; + for($j=12;$j<24;$j++) + { + echo ""; + } + echo ""; + echo ""; + for($j=12;$j<24;$j++) + { + echo ""; + } + echo ""; + + echo ""; + } + echo "
      Type"; + echo "BHCA(calls)"; + echo "
       $j
      {$service_type_label[$i]}
      {$bhca_service_oneday[$i][$j]}
      $j
      {$bhca_service_oneday[$i][$j]}
      "; + + +} +//=======================================================================================| +//=========== csta_type==1,E1 Table ================| +//=======================================================================================| +else if($csta_type==1) +{ + //=====Data define======= + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_e1_oneday[$i][$j]=0; + } + } + + //=====Get Data from DB====== + $device_name=isset($device_name)?$device_name:$DEFAULT_SYS; //device name + $db="CSTA_DB"; + $sys_entries=get_sys_total($device_name); + $subsys_entries=1; + $e1_entries=get_e1_total($device_name); + + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + + for($i=0;$i<$sys_entries;$i++) + { + $select="select key_sys_id,key_subsys_id,key_e1_tg,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY key_e1_tg,csta_datetime"; + $e1_where="AND key_type>0 AND key_type<3 "; + $where=" WHERE key_sys_id=$i AND key_subsys_id=0 AND csta_datetime >'$from_time' AND csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + $msc_no=$rows[0]+0; + $e1_no=$rows[2]+0; + + $bhca_e1_oneday[$msc_no*128+$e1_no][$datetime]=$rows[3]+0; + //echo "e1_data[$msc_no][0][$e1_no][$datetime]:{$e1_data[$msc_no][0][$e1_no][$datetime]}
      "; + }while($rows=@mysqli_fetch_array($result)); + } + } + + + //====Fake Data============ + if($DEBUG) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_e1_oneday[$i][$j]=rand(10,100); + } + } + } + + //====Get the sys-0 and sys-1 data===== + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + if($i<128) + $e1_sys1_sum[$j]+=$bhca_e1_oneday[$i][$j]; + else + $e1_sys2_sum[$j]+=$bhca_e1_oneday[$i][$j]; + } + } + + //====Test the Data====== + if(0) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + echo "E1-$i--Hour-$j--{$bhca_e1_oneday[$i][$j]}
      "; + } + } + } + + //=====show the table-1===== + $table_title="E1"." BHCA Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); //table title + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<24;$i++) + { + echo ""; + } + + //msc-0 + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + + for($i=0;$i<128;$i++) + { + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + } + + //msc=1 + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + + for($i=128;$i<256;$i++) + { + echo ""; + $temp=$i-128; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + } + echo "
      Equipment"; + echo "BHCA(calls)"; + echo "
      SystemE1$i
      MSC-0sys{$e1_sys1_sum[$j]}
      MSC-0$i{$bhca_e1_oneday[$i][$j]}
      MSC-1sys{$e1_sys2_sum[$j]}
      MSC-1$temp{$bhca_e1_oneday[$i][$j]}
      "; + + +} +//=======================================================================================| +//=========== csta_type==2,trunk group Table ================| +//=======================================================================================| +else if($csta_type==2) +{ + //=====Data define====== + for($i=0;$i<=256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_trunk_oneday[$i][$j]=0; + } + } + + //=====Get the Data from DB====== + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + + + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5"; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==TRUE) + { + $select_rows=mysqli_fetch_array($select_result); + + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_oneday[$gro][$datetime+1]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$bhca_trunk_oneday[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + //get the 0-hour of the day + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + + + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5"; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==TRUE) + { + $select_rows=mysqli_fetch_array($select_result); + + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_oneday[$gro][0]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$bhca_trunk_oneday[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + + + //=====Fake Data======== + if($DEBUG) + { + for($i=0;$i<=256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_trunk_oneday[$i][$j]=rand(10,100); + } + } + } + + //======Test the Data===== + if(0) + { + for($i=0;$i<=256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_trunk_oneday[$i][$j]=rand(10,100); + } + } + } + + //=====Show the table-1===== + $table_title="Trunk group BHCA Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<24;$i++) + { + echo ""; + } + echo ""; + + for($i=1;$i<=256;$i++) + { + echo ""; + $t=$i; + echo ""; + for($j=0;$j<24;$j++) + { + //$bhca_trunk_oneday[$i][$j]=number_format($bhca_trunk_oneday[$i][$j], 2, '.', ''); + if($bhca_trunk_oneday[$i][$j]==0) + echo ""; + else + echo ""; + } + echo ""; + } + echo "
       "; + echo "BHCA(calls)"; + echo "
      TG$i
      $t{$bhca_trunk_oneday[$i][$j]}{$bhca_trunk_oneday[$i][$j]}
      "; + + +} + +//=======================================================================================| +//======== Down Selection ============| +//=======================================================================================| +//====date from selection===== +echo "

      "; +echo ""; +echo ""; + + echo ""; + echo ""; + //=====trunk number text for trunk===== + echo ""; + echo ""; + + //====search button===== + echo ""; + + + + + //====on top selection====== + if($csta_type==0) + { + echo "
      "; + echo ""; + echo "to"; + echo ""; + echo " "; + if($csta_type==2) + { + echo ""; + } + //hide the trunk_num selection + else + { + echo ""; + } + echo ""; + echo "
      "; + echo "$strSearch"; + echo "
      "; + echo "
      "; + echo ""; + echo ""; + + echo ""; + + /* delete tru to toll + echo ""; + */ + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + else if($csta_type==1) + { + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + else if($csta_type==2) + { + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo "
      "; + if($sub_sub_flag==1) + { + $line_select[0]=1; + echo ""; + } + else + { + $line_select[0]=0; + $lineOnTop=0; + echo ""; + } + echo "SUB SUB"; + if($sub_loc_flag==1) + { + $line_select[1]=1; + echo ""; + } + else + { + $line_select[1]=0; + $lineOnTop=1; + echo ""; + } + echo "SUB TRK"; + if($tru_tol_flag==1) + { + $line_select[2]=1; + echo ""; + } + else + { + $line_select[2]=0; + echo ""; + } + echo "TRK TOLL"; + if($tru_sub_flag==1) + { + $line_select[2]=1; + echo ""; + } + else + { + $line_select[2]=0; + $lineOnTop=2; + echo ""; + } + echo "TRK SUB"; + if($tru_tru_flag==1) + { + $line_select[3]=1; + echo ""; + } + else + { + $line_select[3]=0; + $lineOnTop=3; + echo ""; + } + echo "TRK TRK"; + if($inter_flag==1) + { + $line_select[4]=1; + echo ""; + } + else + { + $line_select[4]=0; + $lineOnTop=4; + echo ""; + } + echo "INTRA"; + if($sub_ip_flag==1) + { + $line_select[5]=1; + echo ""; + } + else + { + $line_select[5]=0; + $lineOnTop=5; + echo ""; + } + echo "SUB IP"; + if($tru_ip_flag==1) + { + $line_select[6]=1; + echo ""; + } + else + { + $line_select[6]=0; + $lineOnTop=6; + echo ""; + } + echo "TRK IP"; + if($mo_flag==1) + { + $line_select[7]=1; + echo ""; + } + else + { + $line_select[7]=0; + $lineOnTop=7; + echo ""; + } + echo "MO"; + if($mt_flag==1) + { + $line_select[8]=1; + echo ""; + } + else + { + $line_select[8]=0; + $lineOnTop=8; + echo ""; + } + echo "MT"; + if($in_tru_flag==1) + { + $line_select[9]=1; + echo ""; + } + else + { + $line_select[9]=0; + $lineOnTop=9; + echo ""; + } + echo "IN TRK"; + if($out_tru_flag==1) + { + $line_select[10]=1; + echo ""; + } + else + { + $line_select[10]=0; + $lineOnTop=10; + echo ""; + } + echo "OUT TRK"; + if($ip_inter_flag==1) + { + $line_select[11]=1; + echo ""; + } + else + { + $line_select[11]=0; + $lineOnTop=11; + echo ""; + } + echo "IP "; + echo "on top"; + echo " "; + echo "on top"; + echo "
      "; +//=======================================================================================| +//=========== Test before draw graphics ================| +//=======================================================================================| +if(0) +{ + $test_csta_type_label=array("Service","E1","Trunk"); + $slot=$sel_date_from-$sel_date_to+1; + echo "Type----{$test_csta_type_label[$csta_type]}
      "; + echo "Time----sigle $sel_date From $sel_date_from to $sel_date_to slot:$slot
      "; + echo "Service flag-----$sub_sub_flag $sub_loc_flag $tru_tol_flag $tru_sub_flag $tru_tru_flag $sub_ip_flag $tru_ip_flag $inter_flag $mo_flag $mt_flag $in_tru_flag $out_tru_flag $ip_inter_flag
      "; + echo "Trunk num----$trunk_num
      "; + echo "on top index----$on_top_index
      "; +} + + + +//=======================================================================================| +//=========== csta_type==0,service Graphics ================| +//=======================================================================================| +$slot=$sel_date_from-$sel_date_to+1; +if($csta_type==0) +{ + //====Data define==== + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $bhca_service_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql

      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime==23) + continue; + //echo "datetime:$datetime
      "; + $bhca_service_mangdays[$index][$datetime+1+24*$day]+=$rows[ans]; + + }while($rows=mysqli_fetch_array($result)); + } + } + + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql

      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + + //echo "datetime:$datetime
      "; + $bhca_service_mangdays[$index][24*$day]+=$rows[ans]; + + }while($rows=mysqli_fetch_array($result)); + } + } + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<13;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $bhca_service_mangdays[$i][$j]=rand(100,5000); + } + } + } + + //====Test Data====== + if(0) + { + $test_service_type_label=array("SUB SUB","SUB LOC","TRK TOLL","TRK SUB","TRK TRK","SUB IP", + "TRK IP","INTER","MO","MT","IN TRK","OUT TRK","IP"); + for($i=0;$i<13;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_service_type_label[$i]}--$j--{$bhca_service_mangdays[$i][$j]}
      "; + } + } + } + + +} +//=======================================================================================| +//=========== csta_type==1,E1 Graphics ================| +//=======================================================================================| +else if($csta_type==1) +{ + //====Data define==== + for($i=0;$i<3;$i++) + { + /* + 0 IN + 1 OUT + 2 IN&OUT + */ + for($j=0;$j<24*$slot;$j++) + { + $bhca_e1_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + $device_name=isset($device_name)?$device_name:$DEFAULT_SYS; //device name + $db="CSTA_DB"; + $sys_entries=get_sys_total($device_name); + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + //echo "on_top_select:$on_top_select
      "; + + //===incoming e1=== + $select="select sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="AND key_type=1 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $bhca_e1_mangdays[0][$datetime]=$rows[0]+0; + + }while($rows=@mysqli_fetch_array($result)); + } + + //====outgoing e1===== + $select="select sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="AND key_type=2 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $bhca_e1_mangdays[1][$datetime]=$rows[0]+0; + + }while($rows=@mysqli_fetch_array($result)); + } + + //===in-out e1 + $select="select sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="and key_type>0 and key_type<3 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $erlang_e1_mangdays[2][$datetime]=$rows[0]+0; + + }while($rows=@mysqli_fetch_array($result)); + } + } + + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<3;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $bhca_e1_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_e1_type_label=array("In","Out","In&Out"); + for($i=0;$i<3;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_e1_type_label[$i]}--$j--{$bhca_e1_mangdays[$i][$j]}
      "; + } + } + } +} +//=======================================================================================| +//=========== csta_type==2,trunk Graphics ================| +//=======================================================================================| +else if($csta_type==2) +{ + + $trunk_index=explode(",",$trunk_num); + $trunk_index[0]=$trunk_index[0]; + $trunk_index[1]=$trunk_index[1]; + //echo "trunk_num:$trunk_num
      "; + //echo "index_0:{$trunk_index[0]}---index_1:{$trunk_index[1]}
      "; + //====Data define==== + for($i=0;$i<2;$i++) + { + /* + 0 The first trunk select + 1 The second trunk select + */ + for($j=0;$j<24*$slot;$j++) + { + $bhca_trunk_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + //trunk_num_select + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //tg 1 + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[0]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_mangdays[0][$datetime+1+24*$day]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + + //tg 2 + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[1]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "

      $select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_mangdays[1][$datetime+1+24*$day]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //tg 1 + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[0]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_mangdays[0][24*$day]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + + //tg 2 + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[1]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "

      $select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_mangdays[1][24*$day]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $bhca_trunk_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_trunk_type_label=array("First","Second"); + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_trunk_type_label[$i]} {$trunk_index[$i]}--$j--{$bhca_trunk_mangdays[$i][$j]}
      "; + } + } + } +} + + +//=======================================================================================| +//=========== Draw the Graphics =============| +//=======================================================================================| + + $sizex=800; + if($csta_type==0) + $sizey=430; + else + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + //===background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + //====draw the horizonal line==== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + + if($csta_type==0) + { + //====graphics title===== + $graphics_title="Service BHCA statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //===draw the label block==== + $color[0]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[1]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[4]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[7]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[11]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"SUB SUB",$text_color); + + imagefilledrectangle($im,260,350,270,360,$color[1]); + imagestring($im,2,275,350,"SUB TRK",$text_color); + + imagefilledrectangle($im,430,350,440,360,$color[2]); + imagestring($im,2,445,350,"TRK SUB",$text_color); + + imagefilledrectangle($im,600,350,610,360,$color[3]); + imagestring($im,2,615,350,"TRK TRK",$text_color); + + imagefilledrectangle($im,90,370,100,380,$color[4]); + imagestring($im,2,105,370,"INTRA",$text_color); + + imagefilledrectangle($im,260,370,270,380,$color[5]); + imagestring($im,2,275,370,"SUB IP",$text_color); + + imagefilledrectangle($im,430,370,440,380,$color[6]); + imagestring($im,2,445,370,"TRK IP",$text_color); + + imagefilledrectangle($im,600,370,610,380,$color[7]); + imagestring($im,2,615,370,"MO",$text_color); + + imagefilledrectangle($im,90,390,100,400,$color[8]); + imagestring($im,2,105,390,"MT",$text_color); + + imagefilledrectangle($im,260,390,270,400,$color[9]); + imagestring($im,2,275,390,"IN TRK",$text_color); + + imagefilledrectangle($im,430,390,440,400,$color[10]); + imagestring($im,2,445,390,"OUT TRK",$text_color); + + imagefilledrectangle($im,600,390,610,400,$color[11]); + imagestring($im,2,615,390,"IP",$text_color); + + //get the biggest Y-scale value + $maxYNum=0; + for($i=0;$i<13;$i++) + { + for($j=0;$j<$slot*24;$j++) + { + if(!isset($bhca_service_mangdays[$i][$j])) + $bhca_service_mangdays[$i][$j]=0.0; + if($line_select[$i]==1) + { + if($maxYNum<$bhca_service_mangdays[$i][$j]) + $maxYNum=$bhca_service_mangdays[$i][$j]; + } + //echo "g-$i-h-$j:{$bhca_service_mangdays[$i][$j]}
      "; + } + } + + + + //====get the points scale==== + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + for($i=0;$i<13;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $pointscale[$i][$j]['x']=60+30*$j/$slot; + $pointscale[$i][$j]['y']=25+(250-$bhca_service_mangdays[$i][$j]*25/$unitValue); + } + } + + + for($type_index=0;$type_index<13;$type_index++) + { + if($line_select[$type_index]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$pointscale[$type_index][$i]['x'],$pointscale[$type_index][$i]['y'],$pointscale[$type_index][$i+1]['x'],$pointscale[$type_index][$i+1]['y'],$color[$type_index]); + } + } + } + + //echo "lineTop=$lineTop
      "; + if($line_select[$lineTop]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y'],$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y'],$color[$lineTop]); + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y']+1,$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y']+1,$color[$lineTop]); + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y']+2,$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y']+2,$color[$lineTop]); + + } + } + + + } + else if($csta_type==1) + { + $graphics_title="E1 BHCA statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //get the block of color + //blue + $blockcolor[0]=ImageColorAllocate($im,0,0,255); + //green + $blockcolor[1]=ImageColorAllocate($im,0,255,0); + //red + $blockcolor[2]=ImageColorAllocate($im,255,0,0); + imagefilledrectangle($im,90,350,100,360,$blockcolor[0]); + imagestring($im,2,105,350,$service_on_top_label[0],$text_color); + + imagefilledrectangle($im,260,350,270,360,$blockcolor[1]); + imagestring($im,2,275,350,$service_on_top_label[1],$text_color); + + imagefilledrectangle($im,430,350,440,360,$blockcolor[2]); + imagestring($im,2,445,350,$service_on_top_label[2],$text_color); + + //==get the max num of y scale===== + $maxYNum=0; + for($i=0;$i<$slot*24;$i++) + { + $bhca_e1_mangdays[2][$i]=$bhca_e1_mangdays[0][$i]+$bhca_e1_mangdays[1][$i]; + if($maxYNum<$bhca_e1_mangdays[2][$i]) + $maxYNum=$bhca_e1_mangdays[2][$i]; + } + + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + + //====draw the data line===== + for($type=0;$type<3;$type++) + { + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$bhca_e1_mangdays[$type][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$type]); + } + + //===draw the on top line again=== + $on_top_select=$on_top_select+0; + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$bhca_e1_mangdays[$on_top_select][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$on_top_select]); + + } + else if($csta_type==2) + { + $graphics_title="Trunk group ".$trunk_num." BHCA statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //get the block color + //blue + $blockcolor[0]=ImageColorAllocate($im,0,0,255); + //green + $blockcolor[1]=ImageColorAllocate($im,255,0,0); + imagefilledrectangle($im,90,350,100,360,$blockcolor[0]); + imagestring($im,2,105,350,$service_on_top_label[0],$text_color); + + imagefilledrectangle($im,220,350,230,360,$blockcolor[1]); + imagestring($im,2,235,350,$service_on_top_label[1],$text_color); + + $maxYNum=0; + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if(!isset($bhca_trunk_mangdays[$i][$j])) + $bhca_trunk_mangdays[$i][$j]=0.0; + if($maxYNum<$bhca_trunk_mangdays[$i][$j]) + $maxYNum=$bhca_trunk_mangdays[$i][$j]; + + //echo "g-$i-H-$j:{$bhca_trunk_mangdays[$i][$j]}
      "; + } + } + + //====draw the data line==== + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + + for($type=0;$type<2;$type++) + { + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$bhca_trunk_mangdays[$type][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$type]); + } + + //==draw the on top line again=== + $on_top_select=$on_top_select+0; + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$bhca_trunk_mangdays[$on_top_select][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$on_top_select]); + } + + //====the horizonal scale====== + + if($maxYNum<=10) + { + $maxYNum=20; + } + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $scale=$maxYNum / 10 * (10 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()-4000; + $filename=$tt.".png"; + if(1){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + flush(); + echo "

      "; + echo ""; + + +echo ""; +?> diff --git a/wxc2_omc/performance/ipalimCsta/dataDown.php b/wxc2_omc/performance/ipalimCsta/dataDown.php new file mode 100755 index 0000000..e87aa76 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/dataDown.php @@ -0,0 +1,340 @@ +"; +$sel_field_list= @mysql_list_fields($db,$table_name); +if(!$sel_field_list) +{ + echo "
      $strNotFindRecord."; + exit(); +} + +//删除所查询的内容 +if($delete) +{ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//endif($delete) + +//跳转到指定页面 +if($go) +{ + $initial_record = $number_records_to_display * ( $gotopage - 1 ); + if($initial_record >= $number_of_records || $initial_record < 0) + { + echo ""; + $initial_record = 0; + } +}//endif($go) + +// 初始化变量 +if (!$number_of_records) +{ + //跳转页面不进行初始化 + //-------确定日期范围----- + if($sel_date<0){ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + }elseif($sel_date>0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + //where语句的类型限制组成部分$w0 + $w0=" key_type<17 "; + + //where语句的时间限制组成部分$w1 + $w1=" AND $time_column > '$bgn_date' AND $time_column <= '$end_date'"; + + //where语句的系统id限制组成部分$w2 + if($sys_num!='-1' && $sys_num!=''){ + $w2=" AND $sysIdFiled=$sys_num"; + } + + //where语句的子系统id限制组成部分$w3 + if($subsys_num!='-1' && $subsys_num!=''){ + $w3=" AND $subsysIdFiled=$subsys_num"; + } + + //where语句的E1id限制组成部分$w4 + if($e1_num!='-1' && $e1_num!='' && $query_type<5 && $query_type>0){ + $w4=" AND key_e1_tg=$e1_num"; + } + + //where语句的呼叫类型限制组成部分$w5 + if($query_type>0) + { + $w5=" AND key_type=$query_type "; + } + + if($sysType == 'VPS'){ + $w6=" AND key_type=1 "; + }elseif($sysType == 'CNF'){ + $w6=" AND key_type=2 "; + + } + //合成查询语句$where + $where=" WHERE ".$w0.$w1.$w2.$w3.$w4.$w5.$w6; + //echo "$where
      "; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + if ($DEBUG) echo "
      str_sql_all=$str_sql_all"; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo $strNotFindRecord; + exit(); + } //endif(!$number_of_records) +}//endif(!$number_of_records) + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +//插入日志 +if($page_num <=1) +{ + insertLog("CSTA data query",2,1); +} +//下面是控制分页显示,传递变量 +if ($number_of_records >= 1) +{ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if($prev_index < 0) + { + $prev_index = 0; + } +} +$show_initial_record=$initial_record+1; +?> + + + + + + + + + +" > + + + +
      +  $show_initial_record - $next_index, ($strTotalRecords:$number_of_records )  "; + ?> +   + "; + echo "\"$strPreviousPage\" "; + } + + + // NEW: Display a link for the next set of records. + if ($next_index != $number_of_records && $number_of_records >0 && $number_of_records > $number_records_to_display ) + { + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&sys_id=$sys_id&sysType=$sysType&csta_type=$csta_type&query_type=$query_type"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + echo "\"$strNextPage\""; + } + ?> +
      + +
      + +"; + $csta_result = mysqli_query($pubConn,$csta_sql); + $csta_rows = mysqli_fetch_array($csta_result); + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +  
      TG
      + + + + + +
      + + \ No newline at end of file diff --git a/wxc2_omc/performance/ipalimCsta/dataIndex.php b/wxc2_omc/performance/ipalimCsta/dataIndex.php new file mode 100755 index 0000000..01cd274 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/dataIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/ipalimCsta/dataUp.php b/wxc2_omc/performance/ipalimCsta/dataUp.php new file mode 100755 index 0000000..186185b --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/dataUp.php @@ -0,0 +1,147 @@ + + + + + + + + +"; +echo ""; +echo ""; +echo "$strAdvanced > $strTitlePerformance > $sysType > $strData"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> +
      + + +"; +echo ""; +if($sysType == $DEFAULT_SYS){ + echo ""; + echo " "; +} +echo ""; +?> + + + + + + +
      +
      + +
      +
      + + + + +
      + +
      + + diff --git a/wxc2_omc/performance/ipalimCsta/erlang.php b/wxc2_omc/performance/ipalimCsta/erlang.php new file mode 100755 index 0000000..175bbd2 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/erlang.php @@ -0,0 +1,1395 @@ + + + + + + + + + 0){ + echo ""; + }else{ + echo ""; + } +//=======================================================================================| +//======== Data Initial when run first ========================| +//=======================================================================================| +if(!isset($csta_type)) + $csta_type=0; +if(!isset($select_date)) + $select_date=0; +if(!isset($sel_date)) + $sel_date=0; +if(!isset($trunk_num)) + $trunk_num="1,2"; +if(!isset($on_top_index)) + $on_top_index=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($lu_flag)) +{ + $lu_flag=0; + $mo_flag=0; + $mt_flag=0; + $smo_flag=0; + $smt_flag=0; +} + +$DEBUG=0; + +$helpId="3.2.4"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strTitlePerformance > iPALIM > $strErlang"; +echo ""; +//showHelp($helpId); +echo "
      "; + + +//======up csta_type selection======== +echo "
      "; +echo ""; +echo ""; +echo ""; + +//======date selection====== +echo ""; + +//===search button===== +echo ""; + +//====printer button=== +echo ""; + +echo ""; +echo "
      "; +$csta_type_label=array("Service","E1","Trunk group"); +echo ""; +echo ""; +echo ""; +echo ""; + echo "
      "; + echo "$strSearch"; + echo "
      "; +echo "
      "; + echo "
      "; + echo ""; + echo "
      "; +echo "
      "; +?> +"; + $db="CSTA_DB"; + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + $select="select key_type,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>0 and key_type<6 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type-1; + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime==23) + continue; + //echo "datetime=$datetime
      "; + $erlang_service_oneday[$index][$datetime+1]+=$rows[duration]; + //echo "{$erlang_service_oneday[$index][$datetime]}
      "; + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + $select="select key_type,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>0 and key_type<6 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]-1; + $index=$key_type-1; + $datetime=substr($rows[csta_datetime],11,2)+0; + + //echo "datetime=$datetime
      "; + $erlang_service_oneday[$index][0]+=$rows[duration]; + //echo "{$erlang_service_oneday[$index][$datetime]}
      "; + }while($rows=mysqli_fetch_array($result)); + } + + //======Fake Data======= + if($DEBUG) + { + for($i=0;$i<13;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_service_oneday[$i][$j]=rand(10,100); + } + } + } + + //=====Test the Data===== + if(0) + { + $test_service_type_label=array("LU","MO","MT","SMO","SMT"); + for($i=0;$i<5;$i++) + { + for($j=0;$j<24;$j++) + { + echo "{$test_service_type_label[$i]}--$j--{$erlang_service_oneday[$i][$j]}
      "; + } + } + } + + //=====Fix the Data===== + for($i=0;$i<5;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_service_oneday[$i][$j]=change2point($erlang_service_oneday[$i][$j]/3600); + } + } + + //====show the table-1==== + $table_title="Service"." Erlang Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); //table title + $service_type_label=array("LU","MO","MT","SMO","SMT"); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<5;$i++) + { + echo ""; + echo ""; + for($j=0;$j<12;$j++) + { + echo ""; + } + echo ""; + + echo ""; + echo ""; + + echo ""; + for($j=0;$j<12;$j++) + { + echo ""; + } + echo ""; + echo ""; + for($j=12;$j<24;$j++) + { + echo ""; + } + echo ""; + echo ""; + for($j=12;$j<24;$j++) + { + echo ""; + } + echo ""; + + echo ""; + } + echo "
      Type"; + echo "Erlang(hour)"; + echo "
       $j
      {$service_type_label[$i]}
      {$erlang_service_oneday[$i][$j]}
      $j
      {$erlang_service_oneday[$i][$j]}
      "; + + +} + +//=======================================================================================| +//=========== csta_type==2,trunk group Table ================| +//=======================================================================================| +else if($csta_type==2) +{ + //=====Data define====== + for($i=0;$i<=256;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_trunk_oneday[$i][$j]=0; + } + } + + //=====Get the Data from DB====== + $db="CSTA_DB"; + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + + + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>0 and key_type<6"; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==TRUE) + { + $select_rows=mysqli_fetch_array($select_result); + + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $erlang_trunk_oneday[$gro][$datetime+1]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_oneday[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + //get the 0-hour of the day + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + + + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>0 and key_type<6"; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==TRUE) + { + $select_rows=mysqli_fetch_array($select_result); + + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $erlang_trunk_oneday[$gro][0]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_oneday[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + + //=====Fake Data======== + if($DEBUG) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_trunk_oneday[$i][$j]=rand(10,100); + } + } + } + + //======Test the Data===== + if(0) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_trunk_oneday[$i][$j]=rand(10,100); + } + } + } + + //=====Show the table-1===== + $table_title="Trunk group Erlang Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<24;$i++) + { + echo ""; + } + echo ""; + + for($i=1;$i<256;$i++) + { + echo ""; + $t=$i; + echo ""; + for($j=0;$j<24;$j++) + { + $erlang_trunk_oneday[$i][$j]=number_format($erlang_trunk_oneday[$i][$j], 2, '.', ''); + if($erlang_trunk_oneday[$i][$j]==0) + echo ""; + else + echo ""; + } + echo ""; + } + echo "
       "; + echo "Erlang(hour)"; + echo "
      TG$i
      $t{$erlang_trunk_oneday[$i][$j]}{$erlang_trunk_oneday[$i][$j]}
      "; + + +} + +//=======================================================================================| +//======== Down Selection ============| +//=======================================================================================| +//====date from selection===== +//echo "sel_date_from:$sel_date_from--sel_date_to:$sel_date_to
      "; +echo "

      "; +echo ""; +echo ""; + + echo ""; + echo ""; + //=====trunk number text for trunk===== + echo ""; + echo ""; + + //====search button===== + echo ""; + + + + + //====on top selection====== + //echo "csta_type:$csta_type
      "; + if($csta_type==0) + { + echo "
      "; + echo ""; + echo "to"; + echo ""; + echo " "; + if($csta_type==2) + { + echo ""; + } + //hide the trunk_num selection + else + { + echo ""; + } + echo ""; + echo "
      "; + echo "$strSearch"; + echo "
      "; + echo "
      "; + echo ""; + echo ""; + + echo ""; + + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + else if($csta_type==2) + { + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo "
      "; + if($lu_flag==1) + { + $line_select[0]=1; + echo ""; + } + else + { + $line_select[0]=0; + $lineOnTop=0; + echo ""; + } + echo "LU"; + if($mo_flag==1) + { + $line_select[1]=1; + echo ""; + } + else + { + $line_select[1]=0; + $lineOnTop=1; + echo ""; + } + echo "Call MO"; + + if($mt_flag==1) + { + $line_select[2]=1; + echo ""; + } + else + { + $line_select[2]=0; + $lineOnTop=2; + echo ""; + } + echo "Call MT"; + if($smo_flag==1) + { + $line_select[3]=1; + echo ""; + } + else + { + $line_select[3]=0; + $lineOnTop=3; + echo ""; + } + echo "SM MO"; + if($smt_flag==1) + { + $line_select[4]=1; + echo ""; + } + else + { + $line_select[4]=0; + $lineOnTop=4; + echo ""; + } + echo "SM MT "; + echo "on top"; + echo "
      "; +//=======================================================================================| +//=========== Test before draw graphics ================| +//=======================================================================================| +if(0) +{ + $test_csta_type_label=array("Service","E1","Trunk"); + $slot=$sel_date_from-$sel_date_to+1; + echo "Type----{$test_csta_type_label[$csta_type]}
      "; + echo "Time----sigle $sel_date From $sel_date_from to $sel_date_to slot:$slot
      "; + echo "Service flag-----$sub_sub_flag $sub_loc_flag $tru_tol_flag $tru_sub_flag $tru_tru_flag $sub_ip_flag $tru_ip_flag $inter_flag $mo_flag $mt_flag $in_tru_flag $out_tru_flag $ip_inter_flag
      "; + echo "Trunk num----$trunk_num
      "; + echo "on top index----$on_top_index
      "; +} + + + +//=======================================================================================| +//=========== csta_type==0,service Graphics ================| +//=======================================================================================| +$slot=$sel_date_from-$sel_date_to+1; +if($csta_type==0) +{ + //====Data define==== + for($i=0;$i<5;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $erlang_service_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>0 and key_type<6 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql

      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]+0; + $index=$key_type-1; + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime == 23) + continue; + //echo "datetime:$datetime
      "; + $erlang_service_mangdays[$index][$datetime+1+24*$day]+=$rows[duration]; + + }while($rows=mysqli_fetch_array($result)); + } + + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>0 and key_type<6 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql

      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]+0; + $index=$key_type-1; + $datetime=substr($rows[csta_datetime],11,2)+0; + + //echo "datetime:$datetime
      "; + $erlang_service_mangdays[$index][24*$day]+=$rows[duration]; + + }while($rows=mysqli_fetch_array($result)); + } + + } + + //====Fix the data==== + for($i=0;$i<5;$i++) + { + for($day=0;$day<$slot*24;$day++) + { + $erlang_service_mangdays[$i][$day]=change2point($erlang_service_mangdays[$i][$day]/3600); + } + } + + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $erlang_service_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_service_type_label=array("SUB SUB","SUB LOC","TRK TOLL","TRK SUB","TRK TRK","SUB IP", + "TRK IP","INTER","MO","MT","IN TRK","OUT TRK","IP"); + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_service_type_label[$i]}--$j--{$erlang_service_mangdays[$i][$j]}
      "; + } + } + } + + +} +//=======================================================================================| +//=========== csta_type==2,trunk Graphics ================| +//=======================================================================================| +else if($csta_type==2) +{ + + $trunk_index=explode(",",$trunk_num); + $trunk_index[0]=$trunk_index[0]; + $trunk_index[1]=$trunk_index[1]; + + //====Data define==== + for($i=0;$i<2;$i++) + { + /* + 0 The first trunk select + 1 The second trunk select + */ + for($j=0;$j<24*$slot;$j++) + { + $erlang_trunk_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + //trunk_num_select + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //tg 1 + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>0 and key_type<6 and key_e1_tg={$trunk_index[0]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $erlang_trunk_mangdays[0][$datetime+1+24*$day]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + //tg 2 + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>0 and key_type<6 and key_e1_tg={$trunk_index[1]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "

      $select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "ddatetime:$datetime
      "; + $erlang_trunk_mangdays[1][$datetime+1+24*$day]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //tg 1 + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>0 and key_type<6 and key_e1_tg={$trunk_index[0]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $erlang_trunk_mangdays[0][24*$day]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + //tg 2 + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>0 and key_type<6 and key_e1_tg={$trunk_index[1]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "

      $select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "ddatetime:$datetime
      "; + $erlang_trunk_mangdays[1][24*$day]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + } + + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $erlang_trunk_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_trunk_type_label=array("First","Second"); + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_trunk_type_label[$i]} {$trunk_index[$i]}--$j--{$erlang_trunk_mangdays[$i][$j]}
      "; + } + } + } +} + + +//=======================================================================================| +//=========== Draw the Graphics =============| +//=======================================================================================| + + $sizex=800; + if($csta_type==0) + $sizey=430; + else + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + //===background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + //====draw the horizonal line==== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + + if($csta_type==0) + { + //====graphics title===== + $graphics_title="Service erlang statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //===draw the label block==== + $color[0]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[1]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[4]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[7]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[11]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"SUB SUB",$text_color); + + imagefilledrectangle($im,260,350,270,360,$color[1]); + imagestring($im,2,275,350,"SUB TRK",$text_color); + + imagefilledrectangle($im,430,350,440,360,$color[2]); + imagestring($im,2,445,350,"TRK SUB",$text_color); + + imagefilledrectangle($im,600,350,610,360,$color[3]); + imagestring($im,2,615,350,"TRK TRK",$text_color); + + imagefilledrectangle($im,90,370,100,380,$color[4]); + imagestring($im,2,105,370,"INTRA",$text_color); + + imagefilledrectangle($im,260,370,270,380,$color[5]); + imagestring($im,2,275,370,"SUB IP",$text_color); + + imagefilledrectangle($im,430,370,440,380,$color[6]); + imagestring($im,2,445,370,"TRK IP",$text_color); + + imagefilledrectangle($im,600,370,610,380,$color[7]); + imagestring($im,2,615,370,"MO",$text_color); + + imagefilledrectangle($im,90,390,100,400,$color[8]); + imagestring($im,2,105,390,"MT",$text_color); + + imagefilledrectangle($im,260,390,270,400,$color[9]); + imagestring($im,2,275,390,"IN TRK",$text_color); + + imagefilledrectangle($im,430,390,440,400,$color[10]); + imagestring($im,2,445,390,"OUT TRK",$text_color); + + imagefilledrectangle($im,600,390,610,400,$color[11]); + imagestring($im,2,615,390,"IP",$text_color); + + + //get the biggest Y-scale value + $maxYNum=0; + for($i=0;$i<12;$i++) + { + for($j=0;$j<$slot*24;$j++) + { + if(!isset($erlang_service_mangdays[$i][$j])) + $erlang_service_mangdays[$i][$j]=0.0; + if($line_select[$i]) + { + if($maxYNum<$erlang_service_mangdays[$i][$j]) + $maxYNum=$erlang_service_mangdays[$i][$j]; + } + //echo "g-$i-h-$j:{$erlang_service_mangdays[$i][$j]}
      "; + } + } + + + + //====get the points scale==== + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $pointscale[$i][$j]['x']=60+30*$j/$slot; + $pointscale[$i][$j]['y']=25+(250-$erlang_service_mangdays[$i][$j]*25/$unitValue); + } + } + + + for($type_index=0;$type_index<12;$type_index++) + { + if($line_select[$type_index]==1) + { + for($i=0;$i<24*$slot-1;$i++){ + imageline($im,$pointscale[$type_index][$i]['x'],$pointscale[$type_index][$i]['y'],$pointscale[$type_index][$i+1]['x'],$pointscale[$type_index][$i+1]['y'],$color[$type_index]); + } + } + } + + //echo "lineTop=$lineTop
      "; + if($line_select[$lineTop]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y'],$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y'],$color[$lineTop]); + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y']+1,$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y']+1,$color[$lineTop]); + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y']+2,$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y']+2,$color[$lineTop]); + + } + } + + + } + else if($csta_type==2) + { + $graphics_title="Trunk group ".$trunk_num." erlang statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //get the block color + //blue + $blockcolor[0]=ImageColorAllocate($im,0,0,255); + //green + $blockcolor[1]=ImageColorAllocate($im,255,0,0); + imagefilledrectangle($im,90,350,100,360,$blockcolor[0]); + imagestring($im,2,105,350,$service_on_top_label[0],$text_color); + + imagefilledrectangle($im,220,350,230,360,$blockcolor[1]); + imagestring($im,2,235,350,$service_on_top_label[1],$text_color); + + $maxYNum=0; + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if(!isset($erlang_trunk_mangdays[$i][$j])) + $erlang_trunk_mangdays[$i][$j]=0.0; + if($maxYNum<$erlang_trunk_mangdays[$i][$j]) + $maxYNum=$erlang_trunk_mangdays[$i][$j]; + + //echo "g-$i-H-$j:{$erlang_trunk_mangdays[$i][$j]}
      "; + } + } + + //====draw the data line==== + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + + for($type=0;$type<2;$type++) + { + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$erlang_trunk_mangdays[$type][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$type]); + } + + //==draw the on top line again=== + $on_top_select=$on_top_select+0; + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$erlang_trunk_mangdays[$on_top_select][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$on_top_select]); + } + + //====the horizonal scale====== + + if($maxYNum<=10) + { + $maxYNum=20; + } + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $scale=$maxYNum / 10 * (10 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()-4000; + $filename=$tt.".png"; + if(1){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + flush(); + echo "

      "; + echo ""; + + +echo ""; +?> diff --git a/wxc2_omc/performance/ipalimCsta/service_detail_down.php b/wxc2_omc/performance/ipalimCsta/service_detail_down.php new file mode 100755 index 0000000..39f9008 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/service_detail_down.php @@ -0,0 +1,1724 @@ + + + + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } +?> +
      +"; + +//LU +if($service_type == 1) +{ + if(!isset($lu_normal_check)) + $lu_normal_check=0; + if(!isset($lu_nores_check)) + $lu_nores_check=0; + if(!isset($lu_noser_check)) + $lu_noser_check=0; + if(!isset($lu_invser_check)) + $lu_invser_check=0; + if(!isset($lu_invmsg_check)) + $lu_invmsg_check=0; + if(!isset($lu_sigerr_check)) + $lu_sigerr_check=0; +} +//mo mt +else if($service_type == 2 || $service_type == 3) +{ + if(!isset($cc_normal_check)) + $cc_normal_check=0; + if(!isset($cc_calldeny_check)) + $cc_calldeny_check=0; + if(!isset($cc_netbusy_check)) + $cc_netbusy_check=0; + if(!isset($cc_callerclear_check)) + $cc_callerclear_check=0; + if(!isset($cc_subbusy_check)) + $cc_subbusy_check=0; + if(!isset($cc_noanswer_check)) + $cc_noanswer_check=0; + if(!isset($cc_sigerr_check)) + $cc_sigerr_check=0; +} +//smo smt +else if($service_type == 4 || $service_type == 5) +{ + if(!isset($sm_normal_check)) + $sm_normal_check=0; + if(!isset($sm_suberr_check)) + $sm_suberr_check=0; + if(!isset($sm_noser_check)) + $sm_noser_check=0; + if(!isset($sm_netbusy_check)) + $sm_netbusy_check=0; + if(!isset($sm_msgerr_check)) + $sm_msgerr_check=0; + if(!isset($sm_sigerr_check)) + $sm_sigerr_check=0; + if(!isset($sm_nores_check)) + $sm_nores_check=0; + +} +$slot=$sel_date_from-$sel_date_to+1; +$DEBUG=0; + +//========================================================================================| +//========================Data From General Page==========================================| +//========================================================================================| +/* +service_type +value type +1 lu +2 mo +3 mt +4 smo +5 smt +*/ +if(0) +{ + echo "sel_date_from:$sel_date_from
      "; + echo "sel_date_to:$sel_date_to
      "; + echo "service_type:$service_type
      "; +} +//========================================================================================| +//==========================Define the Data===============================================| +//========================================================================================| +for($i=0;$i<23;$i++) +{ + for($j=0;$j<24*$slot;$j++) + { + $csta_data[$i][$j]=0; + } +} + +//========================================================================================| +//===========================Get The Data From DB=========================================| +//========================================================================================| + $detailTableFields=array("Attempt", + "Success", + "Duration", + "lu_normal", + "lu_res_not_ok", + "lu_ser_not_ok", + "lu_ser_no_imp", + "lu_msg_error", + "lu_pro_error", + "cc_normal", + "cc_call_deny", + "cc_net_busy", + "cc_caller_clear", + "cc_sub_busy", + "cc_no_answer", + "cc_sig_error", + "sm_normal", + "sm_error_sub", + "sm_ser_not_ok", + "sm_net_busy", + "sm_msg_error", + "sm_pro_error", + "sm_res_not_ok" + ); + $detailTableFieldsSql=""; + for($i=0;$i"; + + $db=$csta_db; + + for($day=0;$day<$slot;$day++) + { + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day+1,date("Y"))); + + $select="select $detailTableFieldsSql,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type=$service_type "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + + do{ + + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime==23) + continue; + //echo "datetime=$datetime
      "; + + for($tt=0;$tt<23;$tt++) + { + $csta_data[$tt][$datetime+1+$day*24]+=$rows[$tt]; + } + }while($rows=mysqli_fetch_array($result)); + } + + //Get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + + //echo "from_time=$from_time,to_time=$to_time
      "; + $select="select $detailTableFieldsSql,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type=$service_type "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + + do{ + + $datetime=substr($rows[csta_datetime],11,2); + //echo "this datetime=$datetime
      "; + + for($tt=0;$tt<23;$tt++) + { + $csta_data[$tt][$day*24]+=$rows[$tt]; + //echo "csta_data[$tt][$day*24]+=rows[$tt]({$rows[$tt]})
      "; + } + }while($rows=mysqli_fetch_array($result)); + + } + +//=======================================================================================| +//=============================Test the Data=============================================| +//=======================================================================================| +$test_label=array("Attempt", + "Success", + "Duration", + "lu_normal", + "lu_res_not_ok", + "lu_ser_not_ok", + "lu_ser_no_imp", + "lu_msg_error", + "lu_pro_error", + "cc_normal", + "cc_call_deny", + "cc_net_busy", + "cc_caller_clear", + "cc_sub_busy", + "cc_no_answer", + "cc_sig_error", + "sm_normal", + "sm_error_sub", + "sm_ser_not_ok", + "sm_net_busy", + "sm_msg_error", + "sm_pro_error", + "sm_res_not_ok"); + +if(0) +{ + for($i=0;$i<23;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_label[$i]}--Hour-$j--{$csta_data[$i][$j]}
      "; + } + } +} + +//=======================================================================================| +//==========================Draw The Table-1=============================================| +//=======================================================================================| + + //=====table title====== + $table_name_label=array( + 1=>"LU", + "Call MO", + "Call MT", + "SM MO", + "SM MT" + ); + if($slot==1) + { + $title_date=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $table_title=$table_name_label[$service_type]." statistic Date:".$title_date; + } + else + { + $title_date_from=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $title_date_to=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + $table_title=$table_name_label[$service_type]." statistic Date:".$title_date_from." to ".$title_date_to; + } + + echo "
      $table_title
      "; + $LU_TableTitleName=array("Time","Attempt","Success","Normal","No Resource","No Service","Invalid Service","Invalid Message","Signal Error","Duration","Average Duration"); + $CC_TableTitleName=array("Time","Attempt","Success","Normal","Call Deny","Net Busy","Caller Clear","Sub Busy","No Answer","Signal Error","Duration","Average Duration"); + $SM_TableTitleName=array("Time","Attempt","Success","Normal","Sub Error","No Service","Net Busy","Message Error","Signal Error","No Resource","Duration","Average Duration"); + $LU_DataRelation=array(0,1,3,4,5,6,7,8,2); + $CC_DataRelation=array(0,1,9,10,11,12,13,14,15,2); + $SM_DataRelation=array(0,1,16,17,18,19,20,21,22,2); + echo ""; + echo ""; + //LU + if($service_type == 1) + { + for($i=0;$i{$LU_TableTitleName[$i]}"; + } + } + //Call + else if($service_type == 2 || $service_type == 3) + { + for($i=0;$i{$CC_TableTitleName[$i]}"; + } + } + else if($service_type == 4 || $service_type == 5) + { + for($i=0;$i{$SM_TableTitleName[$i]}"; + } + } + echo ""; + + for($i=0;$i<24*$slot;$i++) + { + echo ""; + //=========time column============== + echo ""; + + //LU + if($service_type == 1) + { + for($di=0;$di"; + echo "{$csta_data[0][$i]}"; + echo ""; + } + else + { + //Duration + if($LU_DataRelation[$di] == 2) + { + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + } + else + { + echo ""; + } + } + } + + } + //Call + else if($service_type == 2 || $service_type == 3) + { + for($di=0;$di"; + echo "{$csta_data[0][$i]}"; + echo ""; + } + else + { + //Duration + if($CC_DataRelation[$di] == 2) + { + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + } + else + { + echo ""; + } + } + } + + } + //SM + else if($service_type == 4 || $service_type == 5) + { + for($di=0;$di"; + echo "{$csta_data[0][$i]}"; + echo ""; + } + else + { + //Duration + if($SM_DataRelation[$di] == 2) + { + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + } + else + { + echo ""; + } + } + } + + } + + + echo ""; + } + echo "
      "; + $hour_label=$i%24; + if($hour_label<10) + $hour_label="0".$hour_label."H"; + else + $hour_label=$hour_label."H"; + $day_label=floor($i/24); + $day_label=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day_label,date("Y"))); + echo "$day_label $hour_label"; + echo ""; + echo "{$csta_data[2][$i]}(s)"; + $hour=floor($csta_data[2][$i]/3600); + $minute=floor($csta_data[2][$i]%3600/60); + $second=$csta_data[2][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_data[1][$i]!=0) + $ave=round($csta_data[2][$i]/$csta_data[1][$i]); + else + $ave=0; + echo "$ave"; + echo ""; + echo "{$csta_data[$LU_DataRelation[$di]][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[$LU_DataRelation[$di]][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[2][$i]}(s)"; + $hour=floor($csta_data[2][$i]/3600); + $minute=floor($csta_data[2][$i]%3600/60); + $second=$csta_data[2][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_data[1][$i]!=0) + $ave=round($csta_data[2][$i]/$csta_data[1][$i]); + else + $ave=0; + echo "$ave"; + echo ""; + echo "{$csta_data[$CC_DataRelation[$di]][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[$CC_DataRelation[$di]][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[2][$i]}(s)"; + $hour=floor($csta_data[2][$i]/3600); + $minute=floor($csta_data[2][$i]%3600/60); + $second=$csta_data[2][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_data[1][$i]!=0) + $ave=round($csta_data[2][$i]/$csta_data[1][$i]); + else + $ave=0; + echo "$ave"; + echo ""; + echo "{$csta_data[$CC_DataRelation[$di]][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[$SM_DataRelation[$di]][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; +?> + +

      + +

      + +"; +echo ""; + +if($service_type == 1) +{ + //----------Normal + $index=0; + if($lu_normal_check == 1) + { + echo " Normal"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Normal"; + $draw_line_flag[$index]=0; + } + + //----------No Resource + $index++; + if($lu_nores_check==1) + { + echo " No Resource"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Resource"; + $draw_line_flag[$index]=0; + } + //----------No Service + $index++; + if($lu_noser_check==1) + { + echo " No Service"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Service"; + $draw_line_flag[$index]=0; + } + //----------Invalid Service + $index++; + if($lu_invser_check==1) + { + echo " Invalid Service"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Invalid Service"; + $draw_line_flag[$index]=0; + } + //----------Invalid Message + $index++; + if($lu_invmsg_check==1) + { + echo " Invalid Message"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Invalid Message"; + $draw_line_flag[$index]=0; + } + //---------Signal Error + $index++; + if($lu_sigerr_check==1) + { + echo " Signal Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Signal Error"; + $draw_line_flag[$index]=0; + } + +} +else if($service_type == 2 || $service_type == 3) +{ + //----------Normal + $index=0; + if($cc_normal_check == 1) + { + echo " Normal"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Normal"; + $draw_line_flag[$index]=0; + } + + //----------Call Deny + $index++; + if($cc_calldeny_check==1) + { + echo " Call Deny"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Call Deny"; + $draw_line_flag[$index]=0; + } + //----------Net Busy + $index++; + if($cc_netbusy_check==1) + { + echo " Net Busy"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Net Busy"; + $draw_line_flag[$index]=0; + } + //----------Caller Clear + $index++; + if($cc_callerclear_check==1) + { + echo " Caller Clear"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Caller Clear"; + $draw_line_flag[$index]=0; + } + //----------Sub Busy + $index++; + if($cc_subbusy_check==1) + { + echo " Sub Busy"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Sub Busy"; + $draw_line_flag[$index]=0; + } + //---------No Answer + $index++; + if($cc_noanswer_check==1) + { + echo " No Answer"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Answer"; + $draw_line_flag[$index]=0; + } + //---------Signal Error + $index++; + if($cc_sigerr_check==1) + { + echo " Signal Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Signal Error"; + $draw_line_flag[$index]=0; + } +} +else if($service_type == 4 || $service_type == 5) +{ + //----------Normal + $index=0; + if($sm_normal_check == 1) + { + echo " Normal"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Normal"; + $draw_line_flag[$index]=0; + } + //----------Sub Error + $index++; + if($sm_suberr_check==1) + { + echo " Sub Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Sub Error"; + $draw_line_flag[$index]=0; + } + //----------No Service + $index++; + if($sm_noser_check==1) + { + echo " No Service"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Service"; + $draw_line_flag[$index]=0; + } + //----------Net Busy + $index++; + if($sm_netbusy_check==1) + { + echo " Net Busy"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Net Busy"; + $draw_line_flag[$index]=0; + } + //----------Message Error + $index++; + if($sm_msgerr_check==1) + { + echo " Message Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Message Error"; + $draw_line_flag[$index]=0; + } + //---------Signal Error + $index++; + if($sm_sigerr_check==1) + { + echo " Signal Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Signal Error"; + $draw_line_flag[$index]=0; + } + //---------No Resource + $index++; + if($sm_nores_check==1) + { + echo " No Resource"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Resource"; + $draw_line_flag[$index]=0; + } +} + +echo ""; +echo ""; + + +//========================================================================================| +//=============================Draw The Graphics-1========================================| +//========================================================================================| + $sizex=835; + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //======get the block legend color====== + $black_color=ImageColorAllocate($im,06,0,0); + $white_color=ImageColorAllocate($im,0xff,0xff,0xff); + $color[0]=ImageColorAllocate($im,0x66,0xff,0x33); + $color[1]=ImageColorAllocate($im,0x66,0xff,0xff); + $color[2]=ImageColorAllocate($im,0,0x66,0x66); + $color[3]=ImageColorAllocate($im,0x66,0,0xcc); + $color[4]=ImageColorAllocate($im,0x66,0x33,0); + $color[5]=ImageColorAllocate($im,0xcc,0,0x66); + $color[6]=ImageColorAllocate($im,0xff,0,0); + //======background======== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //=======border======== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + //======draw the vertical dash line====== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //=======draw the horizonal dash line====== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $tempstr=(10-$i)*10; + $tempstr=$tempstr."%"; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, $tempstr, $text_color); + } + + //=======draw the block legend======== +//LU +if($service_type == 1) +{ + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Normal",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"No Resource",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"No Service",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Invalid Service",$text_color); + + imagefilledrectangle($im,470,350,480,360,$color[4]); + imagestring($im,2,485,350,"Invalid Message",$text_color); + + imagefilledrectangle($im,580,350,590,360,$color[5]); + imagestring($im,2,595,350,"Signal Error",$text_color); +} +else if($service_type == 2 || $service_type == 3) +{ + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Normal",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"Call Deny",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"Net Busy",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Caller Clear",$text_color); + + imagefilledrectangle($im,450,350,460,360,$color[4]); + imagestring($im,2,465,350,"Sub Busy",$text_color); + + imagefilledrectangle($im,540,350,550,360,$color[5]); + imagestring($im,2,555,350,"No Answer",$text_color); + + imagefilledrectangle($im,630,350,640,360,$color[6]); + imagestring($im,2,645,350,"Signal Error",$text_color); +} +else if($service_type == 4 || $service_type == 5) +{ + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Normal",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"Sub Error",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"No Service",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Net Busy",$text_color); + + imagefilledrectangle($im,450,350,460,360,$color[4]); + imagestring($im,2,465,350,"Message Error",$text_color); + + imagefilledrectangle($im,545,350,555,360,$color[5]); + imagestring($im,2,560,350,"Signal Error",$text_color); + + imagefilledrectangle($im,635,350,645,360,$color[6]); + imagestring($im,2,650,350,"No Resource",$text_color); +} + + //========get the data line scale======== + $LU_DataRelation=array(0,1,3,4,5,6,7,8,2); + $CC_DataRelation=array(0,1,9,10,11,12,13,14,15,2); + $SM_DataRelation=array(0,1,16,17,18,19,20,21,22,2); + + if($service_type == 1) + $DataReleation=array(3,4,5,6,7,8); + else if($service_type == 2 || $service_type == 3) + $DataReleation=array(9,10,11,12,13,14,15); + else if($service_type == 4 || $service_type == 5) + $DataReleation=array(16,17,18,19,20,21,22); + + $csta_count=sizeof($DataReleation); + + for($j=0;$j<$csta_count;$j++) + { + $m_j=$DataReleation[$j]; + for($i=0;$i<24*$slot;$i++) + { + if($csta_data[0][$i]!=0) + $points_scale[$j][$i]['y']=floor(250*$csta_data[$m_j][$i]/$csta_data[0][$i]); + else + $points_scale[$j][$i]['y']=0; + $points_scale[$j][$i]['y']=25+250-$points_scale[$j][$i]['y']; + $points_scale[$j][$i]['x']=60+30*$i/$slot; + //echo "line-$j-point-$i-x:{$points_scale[$j][$i]['x']}
      "; + //echo "line-$j-point-$i-y:{$points_scale[$j][$i]['y']}
      "; + } + } + + //======draw the data line======= + //echo "on_top_index:$on_top_index
      "; + for($i=0;$i<$csta_count;$i++) + { + if($draw_line_flag[$i]!=0) + { + for($j=0;$j<24*$slot-1;$j++) + { + imageline($im,$points_scale[$i][$j]['x'],$points_scale[$i][$j]['y'],$points_scale[$i][$j+1]['x'],$points_scale[$i][$j+1]['y'],$color[$i]); + } + } + } + + //=====draw the on top line againg========= + //echo "lineTop=$lineTop
      "; + if($draw_line_flag[$lineTop]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y'],$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y'],$color[$lineTop]); + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y']+1,$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y']+1,$color[$lineTop]); + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y']+2,$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y']+2,$color[$lineTop]); + + } + } + + + //======draw the graphics======== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()-5500; + $filename="ser1_".$tt.".png"; + if(1){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + echo ""; +?> + + + +

      +on top + +1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //=====draw the block legend======= + imagefilledrectangle($image,90,350,100,360,$color[0]); + imagestring($image,2,105,350,"Total call duration",$text_color); + + imagefilledrectangle($image,280,350,290,360,$color[1]); + imagestring($image,2,295,350,"Average call duration",$text_color); + + imagestring($image,2,10,5,"Total call duration",$text_color); + imagestring($image,2,700,5,"Average call duration",$text_color); + + + //======get the biggest y scale of left====== + for($i=0;$i<$slot*24;$i++) + { + if($maxYNum_left<$csta_data[2][$i]) + $maxYNum_left=$csta_data[2][$i]; + if($csta_data[1][$i]==0) + $average[$i]=0; + else + $average[$i]=round($csta_data[2][$i]/$csta_data[1][$i]); + if($maxYNum_right<$average[$i]) + $maxYNum_right=$average[$i]; + } + if($maxYNum_left==0) + $maxYNum_left=100; + if($maxYNum_right==0) + $maxYNum_right=10; + + + //===draw the horizonal dash line==== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + $res=imagesetstyle($image, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($image, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + } + + + //=====get the data line scale====== + for($i=0;$i<$slot*24;$i++) + { + //get the total call duration scale + $total_call_duration_scale[$i]['x']=60+30*$i/$slot; + $total_call_duration_scale[$i]['y']=floor(250*$csta_data[2][$i]/$maxYNum_left); + $total_call_duration_scale[$i]['y']=25+250-$total_call_duration_scale[$i]['y']; + //get the average call duraiton scale + $average_call_duration_scale[$i]['x']=60+30*$i/$slot; + $average_call_duration_scale[$i]['y']=floor(250*$average[$i]/$maxYNum_right); + $average_call_duration_scale[$i]['y']=25+250-$average_call_duration_scale[$i]['y']; + //echo "hour-$i:{$total_call_duration_scale[$i]['y']}
      "; + } + for($j=0;$j<24*$slot-1;$j++) + { + //draw the total duration call data line + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + //draw the average duration call data line + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + + //======draw the on top data line again======= + if(!isset($on_top_index_down)) + $on_top_index_down=0; + + for($j=0;$j<24*$slot-1;$j++) + { + if($on_top_index_down==0) + { + //draw the total duration call data line + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + } + else + { + //draw the average duration call data line + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + } + + //=======the left y scale label=========== + $unit=$maxYNum_left/10; + + for($i=0;$i<10;$i++){ + + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." min"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 54, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //=======the right y scale label========= + $unit=$maxYNum_right/10; + for($i=0;$i<10;$i++){ + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." m"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 50+780, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + + //=====draw the graphics====== + //-----输出图形文件,请勿修改 + $tt=time()+4500; + $filename="ser2_".$tt.".png"; + if(1){ + ImagePng ($image,"$filename"); + ImageDestroy($image); + } + echo "

      "; +adjust_content_tail("down"); +?> +

      diff --git a/wxc2_omc/performance/ipalimCsta/service_detail_index.php b/wxc2_omc/performance/ipalimCsta/service_detail_index.php new file mode 100755 index 0000000..84e4e5e --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/service_detail_index.php @@ -0,0 +1,27 @@ + + + + + "; + echo ""; + ?> + + diff --git a/wxc2_omc/performance/ipalimCsta/service_detail_up.php b/wxc2_omc/performance/ipalimCsta/service_detail_up.php new file mode 100755 index 0000000..d0d05aa --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/service_detail_up.php @@ -0,0 +1,125 @@ + + + + +
      +"; + echo ""; + echo ""; + echo "$strTitlePerformance > iPALIM > $strService"; + echo ""; + echo ""; + $helpId="3.11.1"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + + //=======================data initial========================================== + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($service_type)) + $service_type=0; + if(!isset($on_top_index)) + $on_top_index=0; + + //selection date define + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + + echo ""; +?> + +to + + + + + + +"; + echo ""; + + //===================the back link button====================================== + echo ""; + echo "back"; + echo ""; +?> + + + +"; + echo ""; + echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +?> + + + diff --git a/wxc2_omc/performance/ipalimCsta/service_general_down.php b/wxc2_omc/performance/ipalimCsta/service_general_down.php new file mode 100755 index 0000000..f278d40 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/service_general_down.php @@ -0,0 +1,735 @@ + + + + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } +adjust_head_frame("down"); +adjust_title_head_frame("down"); +adjust_title_tail_frame("down"); + +adjust_content_head_frame("down"); +echo "
      "; +//=====================================================================================| +//============================Function Flag============================================| +//=====================================================================================| +$Hide_Show_Function_On=0; +$DEBUG=0; +//=====================================================================================| +//============================Data From Index Page=====================================| +//=====================================================================================| +if(0) +{ + + $url_temp=$_SERVER["REQUEST_URI"]; + echo "This page URL:$url_temp
      "; + + echo "sel_date_from:$sel_date_from
      "; + echo "sel_date_to:$sel_date_to
      "; +} +//=====================================================================================| +//============================Define The Data==========================================| +//=====================================================================================| + //data define + for($i=0;$i<6;$i++) + { + for($j=0;$j<22;$j++) + { + /* 0 attempt + 0 call mo 1 success + 1 call mt 2 duration + 2 sm mo 3 lu_normal + 3 sm mt 4 lu_resNotOk + 4 lu 5 lu_serNotOk + 6 lu_serNoImp + 7 lu_msgError + 8 lu_proError + 9 cc_normal + 10 cc_callDeny + 11 cc_netBusy + 12 cc_callerClear + 13 cc_subBusy + 14 cc_noAnswer + 15 cc_sigError + 16 sm_normal + 17 sm_errSub + 18 sm_serNotOk + 19 sm_netBusy + 20 sm_msgError + 21 sm_proError + 22 sm_resNotOk + + */ + + + + + $service_csta[$i][$j]=0; + } + } + +//===================================================================================| +//========================Get The Data From DB=======================================| +//===================================================================================| + $db=$csta_db; + $bgn_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $end_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + //get the numbers of days that selected + $slot=$sel_date_from-$sel_date_to+1; + if(0) + { + echo "bgn_time:$bgn_time
      "; + echo "end_time:$end_time
      "; + echo "slot:$slot
      "; + echo "db:$csta_db
      "; + } + + $detailTableFields=array("Attempt", + "Success", + "Duration", + "lu_normal", + "lu_res_not_ok", + "lu_ser_not_ok", + "lu_ser_no_imp", + "lu_msg_error", + "lu_pro_error", + "cc_normal", + "cc_call_deny", + "cc_net_busy", + "cc_caller_clear", + "cc_sub_busy", + "cc_no_answer", + "cc_sig_error", + "sm_normal", + "sm_error_sub", + "sm_ser_not_ok", + "sm_net_busy", + "sm_msg_error", + "sm_pro_error", + "sm_res_not_ok" + ); + $detailTableFieldsSql=""; + for($i=0;$i"; + + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + for($day=0;$day<$slot;$day++) + { + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,".$detailTableFieldsSql." "; + + $from="from $table_name "; + $service_where="and key_type>0 and key_type<6 "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where; + $group="group by key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + continue; + + do{ + $key_type=$rows[key_type]+0; + + for($tt=0;$tt<23;$tt++) + { + $service_csta[$key_type][$tt]+=$rows[$tt+1]; + //echo "type-$key_type-$tt:{$service_csta[$key_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,".$detailTableFieldsSql." "; + $from="from $table_name "; + $service_where="and key_type>0 and key_type<6 "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where; + $group="group by key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + continue; + + do{ + $key_type=$rows[key_type]+0; + + for($tt=0;$tt<22;$tt++) + { + $service_csta[$key_type][$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + +//===================================================================================| +//=======================Show The Table-1============================================| +//===================================================================================| + //===table lu + if($slot==1) + $table_title="Service statistic Date:".$bgn_time; + else + $table_title="Service statistic Date:".$bgn_time." to ".$end_time; + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $service_type_label=array(1=>"LU"); + $type_map=array(0=>0,1=>1,2=>3,3=>4,4=>5,5=>6,6=>7,7=>8,8=>2); + //========show subs to subs,subs to local,subs to toll,trunk to subs,trunk to trunk========== + for($i=1;$i<2;$i++) + { + echo ""; + + echo ""; + for($j=0;$j"; + if($j==8) + { + echo "{$service_csta[$i][$m_j]}(s)"; + $hour=floor($service_csta[$i][$m_j]/3600); + $minute=floor($service_csta[$i][$m_j]%3600/60); + $second=$service_csta[$i][$m_j]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + } + else + { + echo "{$service_csta[$i][$m_j]}"; + } + + if($j != 0&&$j != 8) + { + if($service_csta[$i][0]==0) + $rate=0; + else + { + $rate=$service_csta[$i][$m_j]/$service_csta[$i][0]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + } + echo ""; + } + + echo "
      "; + + echo ""; + + } + echo "
      TypeAttemptSuccessNormalNo ResourceNo ServiceInvalid ServiceInvalid MessageSignal ErrorDurationAverage Duration
      $service_type_label[$i]"; + if($service_csta[$i][1]!=0) + $ave=round($service_csta[$i][2]/$service_csta[$i][1]); + else + $ave=0; + echo "$ave"; + echo "
      "; + + //mo mt + if($slot==1) + $table_title="Service statistic Date:".$bgn_time; + else + $table_title="Service statistic Date:".$bgn_time." to ".$end_time; + //echo "
      $table_title
      "; + echo "

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $service_type_label=array(2=>"Call MO",3=>"Call MT"); + $type_map=array(0=>0,1=>1,2=>9,3=>10,4=>11,5=>12,6=>13,7=>14,8=>15,9=>2); + //========show subs to subs,subs to local,subs to toll,trunk to subs,trunk to trunk========== + for($i=2;$i<4;$i++) + { + echo ""; + + echo ""; + for($j=0;$j"; + if($j==9) + { + echo "{$service_csta[$i][$m_j]}(s)"; + $hour=floor($service_csta[$i][$m_j]/3600); + $minute=floor($service_csta[$i][$m_j]%3600/60); + $second=$service_csta[$i][$m_j]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + } + else + { + echo "{$service_csta[$i][$m_j]}"; + } + + if($j != 0&&$j != 9) + { + if($service_csta[$i][0]==0) + $rate=0; + else + { + $rate=$service_csta[$i][$m_j]/$service_csta[$i][0]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + } + echo ""; + } + + echo "
      "; + + echo ""; + + } + echo "
      TypeAttemptSuccessNormalCall DenyNet BusyCaller ClearSub BusyNo AnswerSignal ErrorDurationAverage Duration
      $service_type_label[$i]"; + if($service_csta[$i][1]!=0) + $ave=round($service_csta[$i][2]/$service_csta[$i][1]); + else + $ave=0; + echo "$ave"; + echo "
      "; + + //smo smt + if($slot==1) + $table_title="Service statistic Date:".$bgn_time; + else + $table_title="Service statistic Date:".$bgn_time." to ".$end_time; + //echo "

      $table_title
      "; + echo "

      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + $service_type_label=array(4=>"SM MO",5=>"SM MT"); + $type_map=array(0=>0,1=>1,2=>16,3=>17,4=>18,5=>19,6=>20,7=>21,8=>22,9=>2); + //========show subs to subs,subs to local,subs to toll,trunk to subs,trunk to trunk========== + for($i=4;$i<6;$i++) + { + echo ""; + + echo ""; + for($j=0;$j"; + if($j==9) + { + echo "{$service_csta[$i][$m_j]}(s)"; + $hour=floor($service_csta[$i][$m_j]/3600); + $minute=floor($service_csta[$i][$m_j]%3600/60); + $second=$service_csta[$i][$m_j]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + } + else + { + echo "{$service_csta[$i][$m_j]}"; + } + + if($j != 0&&$j != 9) + { + if($service_csta[$i][0]==0) + $rate=0; + else + { + $rate=$service_csta[$i][$m_j]/$service_csta[$i][0]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + } + echo ""; + } + + echo "
      "; + + echo ""; + + } + echo "
      TypeAttemptSuccessNormalSub ErrorNo ServiceNet BusyMessage ErrorSignal ErrorNo ResourceDurationAverage Duration
      $service_type_label[$i]"; + if($service_csta[$i][1]!=0) + $ave=round($service_csta[$i][2]/$service_csta[$i][1]); + else + $ave=0; + echo "$ave"; + echo "
      "; + +//=====================================================================================| +//=======================Draw The Graphics-1===========================================| +//=====================================================================================| +echo "

      2.Service(Attempt)
      "; + //=====graphics size======= + $sizex=500; + $sizey=250; + + $im = ImageCreate ($sizex, $sizey); + $background_color=ImageColorAllocate($im,255,255,255); + $black_color=ImageColorAllocate($im,0,0,0); + $white_color= imagecolorallocate($im, 255, 255, 255); + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //====graphics background======= + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + imagedashedline($im,30,30,100,100,$black_color); + + //======draw the horizonal line======== + + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=447; + $y2=$y1; + + if($i!=10) + { + imageline($im, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED); + } + + imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + + //=======draw the vitical line======= + + $u=floor(750/20); + for($i=0;$i<12;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color); + } + + //=======get colors============ + $color[0]=ImageColorAllocate($im,0x99,0x00,0x33); + $color[1]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($im,0x99,0xcc,0x99); + $color[4]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($im,0xff,0x99,0xff); + $color[7]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($im,0x00,0x66,0xcc); + $color[11]=ImageColorAllocate($im,0x33,0xff,0x99); + + //=====get the precent and block height(Part-1)====== + $attempt_sum_one=0; + for($i=0;$i<6;$i++) + { + $attempt_sum_one+=$service_csta[$i][0]; + } + if($attempt_sum_one==0) + { + //lu precent + $lu_attempt_precent="0%"; + //mo precent + $mo_attempt_precent="0%"; + //mt precent + $mt_attempt_precent="0%"; + //smo precent + $smo_attempt_precent="0%"; + //smt precent + $smt_attempt_precent="0%"; + + for($t=0;$t<5;$t++) + $height[$t]=0; + } + else + { + //lu precent + $lu_attempt_precent=number_format($service_csta[1][0]*100/$attempt_sum_one,2,'.','')."%"; + //mo precent + $mo_attempt_precent=number_format($service_csta[2][0]*100/$attempt_sum_one,2,'.','')."%"; + //mt precent + $mt_attempt_precent=number_format($service_csta[3][0]*100/$attempt_sum_one,2,'.','')."%"; + //smo precent + $smo_attempt_precent=number_format($service_csta[4][0]*100/$attempt_sum_one,2,'.','')."%"; + //interconnection precent + $smt_attempt_precent=number_format($service_csta[5][0]*100/$attempt_sum_one,2,'.','')."%"; + + for($t=1;$t<6;$t++) + { + $height[$t-1]=floor(180*$service_csta[$t][0]/$attempt_sum_one); + } + } + + + //======draw the data block====== + for($i=0;$i<5;$i++) + { + $x1=40+(2*$i+1)*$u; + if($height[$i]==0) + $height[$i]=1; + $y1=200-$height[$i]; + $x2=40+(2*$i+2)*$u; + $y2=199; + imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]); + } + + //======draw the legend string======= + imagestring($im,2,90,205,"LU",$black_color); + imagestring($im,2,70,220,"(".$lu_attempt_precent.")",$black_color); + imagestring($im,2,150,205,"Call MO",$black_color); + imagestring($im,2,148,220,"(".$mo_attempt_precent.")",$black_color); + imagestring($im,2,225,205,"Call MT",$black_color); + imagestring($im,2,225,220,"(".$mt_attempt_precent.")",$black_color); + imagestring($im,2,305,205,"SM MO",$black_color); + imagestring($im,2,300,221,"(".$smo_attempt_precent.")",$black_color); + imagestring($im,2,380,205,"SM MT",$black_color); + imagestring($im,2,375,221,"(".$smt_attempt_precent.")",$black_color); + + + //draw the outline + imageLine($im,40,20,40,200,$black_color); + imageLine($im,40,20,447,20,$black_color); + imageLine($im,447,200,447,20,$black_color); + imageLine($im,40,200,447,200,$black_color); + + //======show the service attempt graphics========== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $filename="ser3_".time().".png"; + if(1){ + ImagePng ($im,"$filename"); + + ImageDestroy($im); + } + //-----显示图片 + echo ""; + + + +//=====================================================================================| +//========================Draw The Graphics-2==========================================| +//=====================================================================================| +//=======draw the Success failure graphics========== + /* + echo "

      3.Success/Failure
      "; + $sizex=500; + $sizey=250; + $image=imagecreate($sizex,$sizey); + $bgcolor=imagecolorallocate($image,255,255,255); + $black_color=ImageColorAllocate($image,0,0,0); + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($image, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($image, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + + + //=====background======== + ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198)); + ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color); + + //first + imageLine($image,40,20,40,200,$black_color); + imageLine($image,40,20,450,20,$black_color); + imageLine($image,450,200,450,20,$black_color); + imageLine($image,40,200,450,200,$black_color); + + + + //======show the answer failure graphics===== + $tt=time()-2500; + $file_name="ser4_".$tt.".png"; + imagepng($image,$file_name); + imagedestroy($image); + echo ""; + */ +adjust_content_tail("down"); +?> + + + diff --git a/wxc2_omc/performance/ipalimCsta/service_general_index.php b/wxc2_omc/performance/ipalimCsta/service_general_index.php new file mode 100755 index 0000000..6fd1253 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/service_general_index.php @@ -0,0 +1,23 @@ + + + + + "; + echo ""; + ?> + + diff --git a/wxc2_omc/performance/ipalimCsta/service_general_up.php b/wxc2_omc/performance/ipalimCsta/service_general_up.php new file mode 100755 index 0000000..e3af5c5 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/service_general_up.php @@ -0,0 +1,95 @@ + + + + + + +"; + echo ""; + echo ""; + echo "$strTitlePerformance > iPALIM > $strService"; + echo ""; + echo ""; + $helpId="3.11.1"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +//selection date define +$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); +$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); +$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); +$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); +$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> +to + + + + +"; + echo ""; +?> + + + +"; + echo ""; + echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + diff --git a/wxc2_omc/performance/ipalimCsta/tg1_1254337192.png b/wxc2_omc/performance/ipalimCsta/tg1_1254337192.png new file mode 100755 index 0000000..c840880 Binary files /dev/null and b/wxc2_omc/performance/ipalimCsta/tg1_1254337192.png differ diff --git a/wxc2_omc/performance/ipalimCsta/trunk_detail_down.php b/wxc2_omc/performance/ipalimCsta/trunk_detail_down.php new file mode 100755 index 0000000..54a0b2b --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/trunk_detail_down.php @@ -0,0 +1,1565 @@ + + + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } +?> + +"; +//========================================================================================| +//========================Initial The Data From Index Page================================| +//========================================================================================| + + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($trunk_no)) + $trunk_no=0; + if(!isset($sel_in_out)) + $sel_in_out=0; + if(!isset($on_top_index)) + $on_top_index=0; + +$service_type=$sel_in_out+1; +//LU +if($service_type == 1) +{ + if(!isset($lu_normal_check)) + $lu_normal_check=0; + if(!isset($lu_nores_check)) + $lu_nores_check=0; + if(!isset($lu_noser_check)) + $lu_noser_check=0; + if(!isset($lu_invser_check)) + $lu_invser_check=0; + if(!isset($lu_invmsg_check)) + $lu_invmsg_check=0; + if(!isset($lu_sigerr_check)) + $lu_sigerr_check=0; +} +//mo mt +else if($service_type == 2 || $service_type == 3) +{ + if(!isset($cc_normal_check)) + $cc_normal_check=0; + if(!isset($cc_calldeny_check)) + $cc_calldeny_check=0; + if(!isset($cc_netbusy_check)) + $cc_netbusy_check=0; + if(!isset($cc_callerclear_check)) + $cc_callerclear_check=0; + if(!isset($cc_subbusy_check)) + $cc_subbusy_check=0; + if(!isset($cc_noanswer_check)) + $cc_noanswer_check=0; + if(!isset($cc_sigerr_check)) + $cc_sigerr_check=0; +} +//smo smt +else if($service_type == 4 || $service_type == 5) +{ + if(!isset($sm_normal_check)) + $sm_normal_check=0; + if(!isset($sm_suberr_check)) + $sm_suberr_check=0; + if(!isset($sm_noser_check)) + $sm_noser_check=0; + if(!isset($sm_netbusy_check)) + $sm_netbusy_check=0; + if(!isset($sm_msgerr_check)) + $sm_msgerr_check=0; + if(!isset($sm_sigerr_check)) + $sm_sigerr_check=0; + if(!isset($sm_nores_check)) + $sm_nores_check=0; + +} + +?> + +

      + +"; +//echo ""; +//========================================================================================| +//============================Define The Data=============================================| +//========================================================================================| + $slot=$sel_date_from-$sel_date_to+1; + + for($i=0;$i<23;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $csta_trunk[$i][$j]=0; + } + } +//========================================================================================| +//==========================Get the data from DB==========================================| +//========================================================================================| + $detailTableFields=array("Attempt", + "Success", + "Duration", + "lu_normal", + "lu_res_not_ok", + "lu_ser_not_ok", + "lu_ser_no_imp", + "lu_msg_error", + "lu_pro_error", + "cc_normal", + "cc_call_deny", + "cc_net_busy", + "cc_caller_clear", + "cc_sub_busy", + "cc_no_answer", + "cc_sig_error", + "sm_normal", + "sm_error_sub", + "sm_ser_not_ok", + "sm_net_busy", + "sm_msg_error", + "sm_pro_error", + "sm_res_not_ok" + ); + $detailTableFieldsSql=""; + for($i=0;$i"; + + + $slot=$sel_date_from-$sel_date_to+1; + $db=$csta_db; + $time_column="csta_datetime"; + //echo "trunk_no:$trunk_no
      "; + + for($day=0;$day<$slot;$day++) + { + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day+1,date("Y"))); + + //echo "sel_in_out:$sel_in_out
      "; + $select="select key_e1_tg,$detailTableFieldsSql,csta_datetime "; + $from="from $table_name "; + $trunk_where="and key_type=$service_type "; + $where="where $time_column >'$from_time' and $time_column <='$to_time' and key_e1_tg=$trunk_no ".$trunk_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime=$datetime
      "; + if($datetime==23) + continue; + + for($tt=0;$tt<23;$tt++) + { + $csta_trunk[$tt][$datetime+1+$day*24]+=$rows[$tt+1]; + } + }while($rows=mysqli_fetch_array($result)); + + } + + //get the 0-hour + for($day=0;$day<$slot;$day++) + { + $table_name="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + + //echo "sel_in_out:$sel_in_out
      "; + $select="select key_e1_tg,$detailTableFieldsSql,csta_datetime "; + $from="from $table_name "; + $trunk_where="and key_type=$service_type "; + + + $where="where $time_column >'$from_time' and $time_column <='$to_time' and key_e1_tg=$trunk_no ".$trunk_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + + for($tt=0;$tt<23;$tt++) + { + $csta_trunk[$tt][$day*24]+=$rows[$tt+1]; + } + }while($rows=mysqli_fetch_array($result)); + + } + + +//========================================================================================| +//==========================Fake data for test============================================| +//========================================================================================| +if(0) +{ + $slot=$sel_date_from-$sel_date_to+1; + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if($i==0) + $csta_trunk[$i][$j]=rand(200,300); + else + $csta_trunk[$i][$j]=rand(10,100); + } + } +} +//========================================================================================| +//==========================Test the Data=================================================| +//========================================================================================| + +if(0) +{ + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "type-$i-hour-$j:{$csta_trunk[$i][$j]}
      "; + } + } +} +//=======================================================================================| +//==========================Draw the table-1=============================================| +//=======================================================================================| + if($slot==1) + { + $title_date=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $temp=$trunk_no; + if($service_type==1) + $table_title="TG #".$temp." ".$element_title." (LU) statistic Date:".$title_date; + else if($service_type==2) + $table_title="TG #".$temp." ".$element_title." (Call MO) statistic Date:".$title_date; + else if($service_type==3) + $table_title="TG #".$temp." ".$element_title." (Call MT) statistic Date:".$title_date; + else if($service_type==4) + $table_title="TG #".$temp." ".$element_title." (SM MO) statistic Date:".$title_date; + else if($service_type==5) + $table_title="TG #".$temp." ".$element_title." (SM MT) statistic Date:".$title_date; + } + else + { + $title_date_from=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $title_date_to=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + $temp=$trunk_no; + if($service_type==1) + $table_title="TG #".$temp." ".$element_title." (LU) statistic Date:".$title_date_from." to ".$title_date_to; + else if($service_type==2) + $table_title="TG #".$temp." ".$element_title." (Call MO) statistic Date:".$title_date_from." to ".$title_date_to; + else if($service_type==3) + $table_title="TG #".$temp." ".$element_title." (Call MT) statistic Date:".$title_date_from." to ".$title_date_to; + else if($service_type==4) + $table_title="TG #".$temp." ".$element_title." (SM MO) statistic Date:".$title_date_from." to ".$title_date_to; + else if($service_type==5) + $table_title="TG #".$temp." ".$element_title." (SM MT) statistic Date:".$title_date_from." to ".$title_date_to; + } + + echo "
      $table_title
      "; + echo ""; + echo ""; + $LU_TableTitleName=array("Time","Attempt","Success","Normal","No Resource","No Service","Invalid Service","Invalid Message","Signal Error","Duration","Average Duration"); + $CC_TableTitleName=array("Time","Attempt","Success","Normal","Call Deny","Net Busy","Caller Clear","Sub Busy","No Answer","Signal Error","Duration","Average Duration"); + $SM_TableTitleName=array("Time","Attempt","Success","Normal","Sub Error","No Service","Net Busy","Message Error","Signal Error","No Resource","Duration","Average Duration"); + $LU_DataRelation=array(0,1,3,4,5,6,7,8,2); + $CC_DataRelation=array(0,1,9,10,11,12,13,14,15,2); + $SM_DataRelation=array(0,1,16,17,18,19,20,21,22,2); + + //LU + if($service_type == 1) + { + for($i=0;$i{$LU_TableTitleName[$i]}"; + } + } + //Call + else if($service_type == 2 || $service_type == 3) + { + for($i=0;$i{$CC_TableTitleName[$i]}"; + } + } + else if($service_type == 4 || $service_type == 5) + { + for($i=0;$i{$SM_TableTitleName[$i]}"; + } + } + + echo ""; + + + for($i=0;$i<24*$slot;$i++) + { + echo ""; + //=========time column============== + echo ""; + + //LU + if($service_type == 1) + { + for($di=0;$di"; + echo "{$csta_trunk[0][$i]}"; + echo ""; + } + else + { + //Duration + if($LU_DataRelation[$di] == 2) + { + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + } + else + { + echo ""; + } + } + } + + } + //Call + else if($service_type == 2 || $service_type == 3) + { + for($di=0;$di"; + echo "{$csta_trunk[0][$i]}"; + echo ""; + } + else + { + //Duration + if($CC_DataRelation[$di] == 2) + { + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + } + else + { + echo ""; + } + } + } + + } + //SM + else if($service_type == 4 || $service_type == 5) + { + for($di=0;$di"; + echo "{$csta_trunk[0][$i]}"; + echo ""; + } + else + { + //Duration + if($SM_DataRelation[$di] == 2) + { + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + } + else + { + echo ""; + } + } + } + + } + + + echo ""; + } + echo "
      "; + $hour_label=$i%24; + if($hour_label<10) + $hour_label="0".$hour_label."H"; + else + $hour_label=$hour_label."H"; + $day_label=floor($i/24); + $day_label=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day_label,date("Y"))); + echo "$day_label $hour_label"; + echo ""; + echo "{$csta_trunk[2][$i]}(s)"; + $hour=floor($csta_trunk[2][$i]/3600); + $minute=floor($csta_trunk[2][$i]%3600/60); + $second=$csta_trunk[2][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_trunk[1][$i]!=0) + $ave=round($csta_trunk[2][$i]/$csta_trunk[1][$i]); + else + $ave=0; + echo "$ave"; + echo ""; + echo "{$csta_trunk[$LU_DataRelation[$di]][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[$LU_DataRelation[$di]][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[2][$i]}(s)"; + $hour=floor($csta_trunk[2][$i]/3600); + $minute=floor($csta_trunk[2][$i]%3600/60); + $second=$csta_trunk[2][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_trunk[1][$i]!=0) + $ave=round($csta_trunk[2][$i]/$csta_trunk[1][$i]); + else + $ave=0; + echo "$ave"; + echo ""; + echo "{$csta_trunk[$CC_DataRelation[$di]][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[$CC_DataRelation[$di]][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[2][$i]}(s)"; + $hour=floor($csta_trunk[2][$i]/3600); + $minute=floor($csta_trunk[2][$i]%3600/60); + $second=$csta_trunk[2][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_trunk[1][$i]!=0) + $ave=round($csta_trunk[2][$i]/$csta_trunk[1][$i]); + else + $ave=0; + echo "$ave"; + echo ""; + echo "{$csta_trunk[$CC_DataRelation[$di]][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[$SM_DataRelation[$di]][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; +?> + +

      + +

      + +"; +echo ""; + +if($service_type == 1) +{ + //----------Normal + $index=0; + if($lu_normal_check == 1) + { + echo " Normal"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Normal"; + $draw_line_flag[$index]=0; + } + + //----------No Resource + $index++; + if($lu_nores_check==1) + { + echo " No Resource"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Resource"; + $draw_line_flag[$index]=0; + } + //----------No Service + $index++; + if($lu_noser_check==1) + { + echo " No Service"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Service"; + $draw_line_flag[$index]=0; + } + //----------Invalid Service + $index++; + if($lu_invser_check==1) + { + echo " Invalid Service"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Invalid Service"; + $draw_line_flag[$index]=0; + } + //----------Invalid Message + $index++; + if($lu_invmsg_check==1) + { + echo " Invalid Message"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Invalid Message"; + $draw_line_flag[$index]=0; + } + //---------Signal Error + $index++; + if($lu_sigerr_check==1) + { + echo " Signal Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Signal Error"; + $draw_line_flag[$index]=0; + } + +} +else if($service_type == 2 || $service_type == 3) +{ + //----------Normal + $index=0; + if($cc_normal_check == 1) + { + echo " Normal"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Normal"; + $draw_line_flag[$index]=0; + } + + //----------Call Deny + $index++; + if($cc_calldeny_check==1) + { + echo " Call Deny"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Call Deny"; + $draw_line_flag[$index]=0; + } + //----------Net Busy + $index++; + if($cc_netbusy_check==1) + { + echo " Net Busy"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Net Busy"; + $draw_line_flag[$index]=0; + } + //----------Caller Clear + $index++; + if($cc_callerclear_check==1) + { + echo " Caller Clear"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Caller Clear"; + $draw_line_flag[$index]=0; + } + //----------Sub Busy + $index++; + if($cc_subbusy_check==1) + { + echo " Sub Busy"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Sub Busy"; + $draw_line_flag[$index]=0; + } + //---------No Answer + $index++; + if($cc_noanswer_check==1) + { + echo " No Answer"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Answer"; + $draw_line_flag[$index]=0; + } + //---------Signal Error + $index++; + if($cc_sigerr_check==1) + { + echo " Signal Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Signal Error"; + $draw_line_flag[$index]=0; + } +} +else if($service_type == 4 || $service_type == 5) +{ + //----------Normal + $index=0; + if($sm_normal_check == 1) + { + echo " Normal"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Normal"; + $draw_line_flag[$index]=0; + } + //----------Sub Error + $index++; + if($sm_suberr_check==1) + { + echo " Sub Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Sub Error"; + $draw_line_flag[$index]=0; + } + //----------No Service + $index++; + if($sm_noser_check==1) + { + echo " No Service"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Service"; + $draw_line_flag[$index]=0; + } + //----------Net Busy + $index++; + if($sm_netbusy_check==1) + { + echo " Net Busy"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Net Busy"; + $draw_line_flag[$index]=0; + } + //----------Message Error + $index++; + if($sm_msgerr_check==1) + { + echo " Message Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Message Error"; + $draw_line_flag[$index]=0; + } + //---------Signal Error + $index++; + if($sm_sigerr_check==1) + { + echo " Signal Error"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " Signal Error"; + $draw_line_flag[$index]=0; + } + //---------No Resource + $index++; + if($sm_nores_check==1) + { + echo " No Resource"; + $draw_line_flag[$index]=1; + } + else + { + $lineOnTop=$index; + echo " No Resource"; + $draw_line_flag[$index]=0; + } +} + +echo ""; +echo ""; + +//========================================================================================| +//=========================Draw the Graphics-1============================================| +//========================================================================================| + + $sizex=835; + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //====get the block legend color======= + $color[0]=ImageColorAllocate($im,0x66,0xff,0x33); + $color[1]=ImageColorAllocate($im,0x66,0xff,0xff); + $color[2]=ImageColorAllocate($im,0,0x66,0x66); + $color[3]=ImageColorAllocate($im,0x66,0,0xcc); + $color[4]=ImageColorAllocate($im,0x66,0x33,0); + $color[5]=ImageColorAllocate($im,0xcc,0,0x66); + $color[6]=ImageColorAllocate($im,0xff,0,0); + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + //====background===== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //====border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + //=====draw the vertical line======== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //=====draw the horizonal line====== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $tempstr=(10-$i)*10; + $tempstr=$tempstr."%"; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, $tempstr, $text_color); + } + + //=====draw the block legend====== +//LU +if($service_type == 1) +{ + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Normal",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"No Resource",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"No Service",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Invalid Service",$text_color); + + imagefilledrectangle($im,470,350,480,360,$color[4]); + imagestring($im,2,485,350,"Invalid Message",$text_color); + + imagefilledrectangle($im,580,350,590,360,$color[5]); + imagestring($im,2,595,350,"Signal Error",$text_color); +} +else if($service_type == 2 || $service_type == 3) +{ + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Normal",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"Call Deny",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"Net Busy",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Caller Clear",$text_color); + + imagefilledrectangle($im,450,350,460,360,$color[4]); + imagestring($im,2,465,350,"Sub Busy",$text_color); + + imagefilledrectangle($im,540,350,550,360,$color[5]); + imagestring($im,2,555,350,"No Answer",$text_color); + + imagefilledrectangle($im,630,350,640,360,$color[6]); + imagestring($im,2,645,350,"Signal Error",$text_color); +} +else if($service_type == 4 || $service_type == 5) +{ + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Normal",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"Sub Error",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"No Service",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Net Busy",$text_color); + + imagefilledrectangle($im,450,350,460,360,$color[4]); + imagestring($im,2,465,350,"Message Error",$text_color); + + imagefilledrectangle($im,545,350,555,360,$color[5]); + imagestring($im,2,560,350,"Signal Error",$text_color); + + imagefilledrectangle($im,635,350,645,360,$color[6]); + imagestring($im,2,650,350,"No Resource",$text_color); +} + + //======get the data line scale======== + $LU_DataRelation=array(0,1,3,4,5,6,7,8,2); + $CC_DataRelation=array(0,1,9,10,11,12,13,14,15,2); + $SM_DataRelation=array(0,1,16,17,18,19,20,21,22,2); + + if($service_type == 1) + $DataReleation=array(3,4,5,6,7,8); + else if($service_type == 2 || $service_type == 3) + $DataReleation=array(9,10,11,12,13,14,15); + else if($service_type == 4 || $service_type == 5) + $DataReleation=array(16,17,18,19,20,21,22); + + $csta_count=sizeof($DataReleation); + + for($j=0;$j<$csta_count;$j++) + { + $m_j=$DataReleation[$j]; + for($i=0;$i<24*$slot;$i++) + { + if($csta_trunk[0][$i]!=0) + $points_scale[$j][$i]['y']=floor(250*$csta_trunk[$m_j][$i]/$csta_trunk[0][$i]); + else + $points_scale[$j][$i]['y']=0; + $points_scale[$j][$i]['y']=25+250-$points_scale[$j][$i]['y']; + $points_scale[$j][$i]['x']=60+30*$i/$slot; + //echo "line-$j-point-$i-x:{$points_scale[$j][$i]['x']}
      "; + //echo "line-$j-point-$i-y:{$points_scale[$j][$i]['y']}
      "; + } + } + + //====draw the data line===== + for($i=0;$i<$csta_count;$i++) + { + if($draw_line_flag[$i]!=0) + { + for($j=0;$j<24*$slot-1;$j++) + { + imageline($im,$points_scale[$i][$j]['x'],$points_scale[$i][$j]['y'],$points_scale[$i][$j+1]['x'],$points_scale[$i][$j+1]['y'],$color[$i]); + } + } + } + //====draw the on top line again==== + //echo "lineTop=$lineTop
      "; + if($draw_line_flag[$lineTop]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y'],$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y'],$color[$lineTop]); + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y']+1,$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y']+1,$color[$lineTop]); + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y']+2,$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y']+2,$color[$lineTop]); + + } + } + + //====show the Graphics==== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()-3500; + $filename="tg3_".$tt.".png"; + if(!$DEBUG){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + echo ""; + +?> +

      +on top +

      + +1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //============================draw the block legend================================ + imagefilledrectangle($image,90,350,100,360,$color[0]); + imagestring($image,2,105,350,"Total call duration",$text_color); + + imagefilledrectangle($image,280,350,290,360,$color[1]); + imagestring($image,2,295,350,"Average call duration",$text_color); + + imagestring($image,2,10,5,"Total call duration",$text_color); + imagestring($image,2,700,5,"Average call duration",$text_color); + + //====get the biggest y scale of left==== + for($i=0;$i<$slot*24;$i++) + { + if($maxYNum_left<$csta_trunk[2][$i]) + $maxYNum_left=$csta_trunk[2][$i]; + if($csta_trunk[1][$i]==0) + $average[$i]=0; + else + $average[$i]=round($csta_trunk[2][$i]/$csta_trunk[1][$i]); + if($maxYNum_right<$average[$i]) + $maxYNum_right=$average[$i]; + } + if($maxYNum_left==0) + $maxYNum_left=100; + if($maxYNum_right==0) + $maxYNum_right=10; + + //=====get the data line scale===== + for($i=0;$i<$slot*24;$i++) + { + //get the total call duration scale + $total_call_duration_scale[$i]['x']=60+30*$i/$slot; + $total_call_duration_scale[$i]['y']=floor(250*$csta_trunk[2][$i]/$maxYNum_left); + $total_call_duration_scale[$i]['y']=25+250-$total_call_duration_scale[$i]['y']; + //get the average call duraiton scale + $average_call_duration_scale[$i]['x']=60+30*$i/$slot; + $average_call_duration_scale[$i]['y']=floor(250*$average[$i]/$maxYNum_right); + $average_call_duration_scale[$i]['y']=25+250-$average_call_duration_scale[$i]['y']; + //echo "hour-$i:{$total_call_duration_scale[$i]['y']}
      "; + + } + for($j=0;$j<24*$slot-1;$j++) + { + //draw the total duration call data line + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + //draw the average duration call data line + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + + //===================================draw the on top data line again==================== + if(!isset($on_top_index_down)) + $on_top_index_down=0; + for($j=0;$j<24*$slot-1;$j++) + { + if($on_top_index_down==0) + { + //====================draw the total duration call data line========================== + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + } + else + { + //=========================draw the average duration call data line=========================== + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + } + + //====draw the horizonal line===== + //the left y scale label + $unit=$maxYNum_left/10; + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($image, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." min"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 54, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //the right y scale label + $unit=$maxYNum_right/10; + for($i=0;$i<10;$i++){ + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." m"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 50+780, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //=====draw the graphics===== + //-----输出图形文件,请勿修改 + $tt=time()+2500; + $filename="tg4_".$tt.".png"; + if(!$DEBUG){ + ImagePng ($image,"$filename"); + ImageDestroy($image); + } + echo "

      "; +adjust_content_tail("down"); +?> \ No newline at end of file diff --git a/wxc2_omc/performance/ipalimCsta/trunk_detail_index.php b/wxc2_omc/performance/ipalimCsta/trunk_detail_index.php new file mode 100755 index 0000000..e447a99 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/trunk_detail_index.php @@ -0,0 +1,32 @@ + + + "; + echo ""; + ?> + + diff --git a/wxc2_omc/performance/ipalimCsta/trunk_detail_up.php b/wxc2_omc/performance/ipalimCsta/trunk_detail_up.php new file mode 100755 index 0000000..04c4047 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/trunk_detail_up.php @@ -0,0 +1,141 @@ + + + + + +"; + //echo "sel_date_from:$sel_date_from
      "; + //echo "sel_date_to:$sel_date_to
      "; + //echo "in_out:$sel_in_out
      "; + //==================get the parameter the previous transfer==================== + $old_sel_date_from=$sel_date_from; + $old_sel_date_to=$sel_date_to; + $old_sel_in_out=$sel_in_out; + //===========================page title======================================== + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strTitlePerformance > iPALIM > Trunk group"; + echo ""; + $helpId = "3.11.2"; + showHelp($helpId); + echo "
      "; + + //=======================data initial========================================== + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($trunk_no)) + $trunk_no=0; + if(!isset($sel_in_out)) + $sel_in_out=0; + if(!isset($on_top_index)) + $on_top_index=0; + //selection date define + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + + echo ""; +?> + +to + + + + +"; + echo ""; + + //===================the back link button====================================== + echo ""; + echo "back"; + echo ""; +?> + + + + +"; + echo "
      "; + + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + + +?> + diff --git a/wxc2_omc/performance/ipalimCsta/trunk_general_down.php b/wxc2_omc/performance/ipalimCsta/trunk_general_down.php new file mode 100755 index 0000000..3ba8422 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/trunk_general_down.php @@ -0,0 +1,1232 @@ + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } +?> + +"; +//========================================================================================| +//========================Initial The Data From Index Page================================| +//========================================================================================| + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($sel_in_out)) + $sel_in_out=0; + if(!isset($from_hour)) + $from_hour="00"; + if(!isset($from_minute)) + $from_minute="00"; + if(!isset($from_second)) + $from_second="00"; + if(!isset($to_hour)) + $to_hour="23"; + if(!isset($to_minute)) + $to_minute="59"; + if(!isset($to_second)) + $to_second="59"; + $DEBUG=0; +//========================================================================================| +//============================Define The Data=============================================| +//========================================================================================| + $detailTableFields=array("Attempt", + "Success", + "Duration", + "lu_normal", + "lu_res_not_ok", + "lu_ser_not_ok", + "lu_ser_no_imp", + "lu_msg_error", + "lu_pro_error", + "cc_normal", + "cc_call_deny", + "cc_net_busy", + "cc_caller_clear", + "cc_sub_busy", + "cc_no_answer", + "cc_sig_error", + "sm_normal", + "sm_error_sub", + "sm_ser_not_ok", + "sm_net_busy", + "sm_msg_error", + "sm_pro_error", + "sm_res_not_ok" + ); + $detailTableFieldsSql=""; + for($i=0;$i0) + { + while($rows = @mysqli_fetch_array($result)) + { + //get the instanceNo of the tg + $trunk_no=$rows[instanceNo]+0; + $trunk_status[$trunk_no]=1; + $trunk_element_title[$trunk_no]=$rows[initValue]; + } + } + + +//========================================================================================| +//=============================Get The Data From DB=======================================| +//========================================================================================| + //=====data for per trunk======= + $db=$csta_db; + $slot=$sel_date_from-$sel_date_to+1; + $time_column="csta_datetime"; + //echo "sel_in_out=$sel_in_out
      "; + $service_type=$sel_in_out+1; + for($day=0;$day<$slot;$day++) + { + + $table_name ="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "table_name:$table_name
      "; + //echo "from_time:$from_time
      "; + //echo "to_time:$to_time
      "; + //echo "in_out:$sel_in_out
      "; + + if($service_type < 6) + $trunk_where="and key_type=".$service_type." "; + else + $trunk_where=""; + + + + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "sql:$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + + do + { + $gro=$rows[0]; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of this day + for($day=0;$day<$slot;$day++) + { + + $table_name ="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "table_name:$table_name
      "; + //echo "from_time:$from_time
      "; + //echo "to_time:$to_time
      "; + //echo "in_out:$sel_in_out
      "; + + if($service_type < 6) + $trunk_where="and key_type=".$service_type." "; + else + $trunk_where=""; + + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "sql:$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + + do + { + $gro=$rows[0]; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + } + + //=====data for lu_trunk,mo_trunk,mt_trunk,smo_trunk,smt_trunk=== + for($day=0;$day<$slot;$day++) + { + $table_name ="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + + //===lu-trunk data===== + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=1 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + //if the trunk group is disable + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + //===mo-trunk======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=2 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + //===mt-trunk======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=3 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + //===smo-trunk======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=4 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + //===smt-trunk======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=5 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + + //=====total_trunk data======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type>0 and key_type<6 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $table_name ="ipalimSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + + //===lu-trunk data===== + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=1 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + //if the trunk group is disable + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + //===mo-trunk======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=2 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + //===mt-trunk======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=3 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + //===smo-trunk======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=4 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + //===smt-trunk======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type=5 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + + //=====total_trunk data======= + $select="select key_e1_tg,$detailTableFieldsSql "; + $from="from $table_name "; + $trunk_where="and key_type>0 and key_type<6 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt"; + } + }while($rows=mysqli_fetch_array($result)); + + } + + +if(0) +{ + for($i=0;$i"; + } + } +} +//====test the title of trunk group=== +if(0) +{ + for($i=0;$i<=256;$i++) + { + echo "group:$i {$trunk_element_title[$i]}
      "; + + } +} + +//====test the status of trunk group=== +if(0) +{ + for($i=0;$i<=256;$i++) + { + echo "group:$i {$trunk_status[$i]}
      "; + } +} + +//=====test the in_trunk,out_trunk,total_trunk== +if(0) +{ + for($i=0;$i"; + echo "mo-type-$i:{$mo_trunk[$i]}
      "; + echo "mt-type-$i:{$mt_trunk[$i]}
      "; + echo "smo-type-$i:{$smo_trunk[$i]}
      "; + echo "smt-type-$i:{$smt_trunk[$i]}
      "; + //echo "total-type-$i:{$total_trunk[$i]}
      "; + } +} +//========================================================================================| +//===========================Show the table-1=============================================| +//========================================================================================| + + //===get the numbers of days that selected=== + $slot=$sel_date_from-$sel_date_to+1; + + //====get the table title==== + $title_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + if($slot==1) + $table_title="Trunk statistic Date:".$title_time; + else + $table_title="Trunk statistic Date:".$title_time." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + + echo "

      $table_title
      "; + echo ""; + if($service_type==1) + { + $temp="LU"; + $tempi=11; + } + else if($service_type==2) + { + $temp="Call MO"; + $tempi=12; + } + else if($service_type==3) + { + $temp="Call MT"; + $tempi=12; + } + else if($service_type==4) + { + $temp="SM MO"; + $tempi=12; + } + else if($service_type==5) + { + $temp="SM MT"; + $tempi=12; + } + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //LU + if($service_type == 1) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //call + else if($service_type == 2 || $service_type == 3) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + //SM + else if($service_type == 4 || $service_type == 5) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo ""; + + if($service_type == 1) + $DataRelation=array(0,1,3,4,5,6,7,8,2); + else if($service_type == 2 || $service_type == 3) + $DataRelation=array(0,1,9,10,11,12,13,14,15,2); + else if($service_type == 4 || $service_type == 5) + $DataRelation=array(0,1,16,17,18,19,20,21,22,2); + + + for($i=0;$i<=256;$i++) + { + if($trunk_status[$i]!=1) + continue; + echo ""; + + $t=$i; + echo ""; + echo ""; + for($j=0;$j"; + if($m_j==0) + { + echo "{$trunk_csta[$i][$m_j]}"; + } + else if($m_j==2) + { + echo "{$trunk_csta[$i][$m_j]}(s)"; + $hour=floor($trunk_csta[$i][$m_j]/3600); + $minute=floor($trunk_csta[$i][$m_j]%3600/60); + $second=$trunk_csta[$i][$m_j]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + } + else + { + echo "{$trunk_csta[$i][$m_j]}"; + echo "
      "; + if($trunk_csta[$i][0]==0) + $rate=0; + else + { + $rate=$trunk_csta[$i][$m_j]/$trunk_csta[$i][0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + if($rate==0) + $rate=0; + echo "$rate%"; + } + + echo ""; + } + //==average call duration===== + echo "
      "; + echo ""; + } + echo "
       $temp
      TG No.Element TitleAttemptSuccessNormalNo ResourceNo ServiceInvalid ServiceInvalid MessageSignal ErrorDurationAverage Duration(s)AttemptSuccessNormalCall DenyNet BusyCaller ClearSub BusyNo AnswerSignal ErrorDurationAverage Duration(s)AttemptSuccessNormalSub ErrorNo ServiceNet BusyMessage ErrorSignal ErrorNo ResourceDurationAverage Duration(s)
      $t{$trunk_element_title[$i]}"; + if($trunk_csta[$i][1]!=0) + $ave=round($trunk_csta[$i][2]/$trunk_csta[$i][1]); + else + $ave=0; + echo "$ave"; + echo "
      "; + + +//========================================================================================| +//=========================Show the table-2 LU===============================================| +//========================================================================================| + echo "
      $table_title
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //LU + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + echo ""; + + //====LU trunk data===== + $DataRelation=array(3,4,5,6,7,8); + echo ""; + echo ""; + for($i=0;$i"; + if($lu_trunk[0]!=0) + { + $rate=$lu_trunk[$m_i]/$lu_trunk[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo ""; + } + echo ""; + echo "
      Success/failure
      TypeNormalNo ResourceNo ServiceInvalid ServiceInvalid MessageSignal Error
      LU
      "; + +//========================================================================================| +//=========================Show the table-3 Call===============================================| +//========================================================================================| + //echo "
      $table_title
      "; + echo "
      "; + echo ""; + //echo ""; + //echo ""; + //echo ""; + echo ""; + + //Call + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + //====mo trunk data===== + $DataRelation=array(9,10,11,12,13,14,15); + echo ""; + echo ""; + for($i=0;$i"; + if($mo_trunk[0]!=0) + { + $rate=$mo_trunk[$m_i]/$mo_trunk[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo ""; + } + echo ""; + + + echo ""; + echo ""; + for($i=0;$i"; + if($mt_trunk[0]!=0) + { + $rate=$mt_trunk[$m_i]/$mt_trunk[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo ""; + } + echo ""; + echo "
      Success/failure
      TypeNormalCall DenyNet BusyCaller ClearSub BusyNo AnswerSignal Error
      Call MO
      Call MT
      "; + + //========================================================================================| +//=========================Show the table-4 SM===============================================| +//========================================================================================| + //echo "
      $table_title
      "; + echo "
      "; + echo ""; + //echo ""; + //echo ""; + //echo ""; + echo ""; + + //Call + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + + //====mo trunk data===== + $DataRelation=array(16,17,18,19,20,21,22); + echo ""; + echo ""; + for($i=0;$i"; + if($smo_trunk[0]!=0) + { + $rate=$smo_trunk[$m_i]/$smo_trunk[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo ""; + } + echo ""; + + + echo ""; + echo ""; + for($i=0;$i"; + if($smt_trunk[0]!=0) + { + $rate=$smt_trunk[$m_i]/$smt_trunk[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo ""; + } + echo ""; + echo "
      Success/failure
      TypeNormalSub ErrorNo ServiceNet BusyMessage ErrorSignal ErrorNo Resource
      SM MO
      SM MT
      "; + + + + + +//========================================================================================| +//=======================Draw the Graphics-1==============================================| +//========================================================================================| + + echo "

      LU/Call MO/Call MT/SM MO/SM MT(Attempt Call)
      "; + $sizex=510; + $sizey=240; + $im = ImageCreate ($sizex, $sizey); + $background_color=ImageColorAllocate($im,255,255,255); + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + $color[0]=ImageColorAllocate($im,0x33,0x33,0xff); + $color[1]=ImageColorAllocate($im,0x66,0xaa,0); + $color[2]=ImageColorAllocate($im,0x66,0xff,0x33); + $color[3]=ImageColorAllocate($im,0x66,0xff,0xff); + $color[4]=ImageColorAllocate($im,0,0x66,0x66); + + + //=====background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + imageLine($im,40,20,40,200,$black_color); + imageLine($im,40,20,490,20,$black_color); + imageLine($im,490,200,490,20,$black_color); + imageLine($im,40,200,490,200,$black_color); + + //=====draw the horizonal line====== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=490; + $y2=$y1; + if($i!=10) + imageline($im,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + + //====draw the vitical line====== + $u=floor(450/10); + for($i=0;$i<10;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color); + } + + //=====get the five block height======= + if($total_trunk[0]==0) + { + $lu_trunk_percent="0%"; + $mo_trunk_percent="0%"; + $mt_trunk_percent="0%"; + $smo_trunk_percent="0%"; + $smt_trunk_percent="0%"; + $height[0]=0; + $heighr[1]=0; + $height[2]=0; + $height[3]=0; + $height[4]=0; + } + else + { + $lu_trunk_percent=change_percent($lu_trunk[0]/$total_trunk[0]); + $mo_trunk_percent=change_percent($mo_trunk[0]/$total_trunk[0]); + $mt_trunk_percent=change_percent($mt_trunk[0]/$total_trunk[0]); + $smo_trunk_percent=change_percent($smo_trunk[0]/$total_trunk[0]); + $smt_trunk_percent=change_percent($smt_trunk[0]/$total_trunk[0]); + $height[0]=floor(180*$lu_trunk[0]/$total_trunk[0]); + $height[1]=floor(180*$mo_trunk[0]/$total_trunk[0]); + $height[2]=floor(180*$mt_trunk[0]/$total_trunk[0]); + $height[3]=floor(180*$smo_trunk[0]/$total_trunk[0]); + $height[4]=floor(180*$smt_trunk[0]/$total_trunk[0]); + } + + //======draw the data block======= + for($i=0;$i<5;$i++) + { + $x1=85+(2*$i)*45; + if($height[$i]==0) + $height[$i]=1; + $y1=200-$height[$i]; + $x2=85+(2*$i+1)*45; + $y2=199; + imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]); + } + + //=====draw the legend string======= + imagestring($im,2,105,205,"LU",$black_color); + imagestring($im,2,88,220,"(".$lu_trunk_percent.")",$black_color); + imagestring($im,2,175,205,"Call MO",$black_color); + imagestring($im,2,180,220,"(".$mo_trunk_percent.")",$black_color); + imagestring($im,2,265,205,"Call MT",$black_color); + imagestring($im,2,270,220,"(".$mt_trunk_percent.")",$black_color); + imagestring($im,2,363,205,"SM MT",$black_color); + imagestring($im,2,365,220,"(".$smo_trunk_percent.")",$black_color); + imagestring($im,2,450,205,"SM MO",$black_color); + imagestring($im,2,455,220,"(".$smt_trunk_percent.")",$black_color); + + //====show the graphics===== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $filename="tg1_".time().".png"; + if(1){ + ImagePng ($im,"$filename"); + + ImageDestroy($im); + } + //-----显示图片 + echo ""; +/* +//========================================================================================| +//==========================Draw the Graphics-2===========================================| +//========================================================================================| + + echo "

      Success/Failure
      "; + $sizex=600; + $sizey=250; + $image=imagecreate($sizex,$sizey); + $bgcolor=imagecolorallocate($image,255,255,255); + $black_color=ImageColorAllocate($image,0,0,0); + $white_color=ImageColorAllocate($image,255,255,255); + $bgcolor=F8F8F8; + $fgcolor=000000; + $color[0]=ImageColorAllocate($image,0x33,0x33,0xff); + $color[1]=ImageColorAllocate($image,0x66,0xaa,0); + $background_color = ImageColorAllocate ($image, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($image, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //====background==== + ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198)); + ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color); + + imageLine($image,40,20,40,200,$black_color); + imageLine($image,40,20,580,20,$black_color); + imageLine($image,580,200,580,20,$black_color); + imageLine($image,40,200,580,200,$black_color); + + //====draw the horizonal line=== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=580; + $y2=$y1; + if($i!=10) + imageline($image, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED); + + imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + + //====draw the vitical line===== + $u=floor(540/15); + for($i=0;$i<16;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color); + } + + //=====get the block height====== + for($j=0;$j<7;$j++) + { + if($total_trunk[0]==0) + $total_height[$j][0]=1; + else + $total_height[$j][0]=floor(180*$in_trunk[$j+1]/$total_trunk[0]); + } + for($j=0;$j<7;$j++) + { + if($total_trunk[0]==0) + $total_height[$j][1]=1; + else + $total_height[$j][1]=floor(180*$out_trunk[$j+1]/$total_trunk[0]); + } + + //======draw the data block===== + for($i=0;$i<7;$i++) + { + for($j=0;$j<2;$j++) + { + if($total_height[$i][$j]<1) + $total_height[$i][$j]=1; + //echo "lie-$i-hang-$j-{$total_height[$i][$j]}
      "; + $x1=40+(2*$i+1)*36; + $y1=199; + for($z=0;$z<$j+1;$z++) + { + $y1=$y1-$total_height[$i][$z]; + } + $x2=40+(2*$i+2)*36; + $y2=199; + for($z=0;$z<$j;$z++) + { + $y2=$y2-$total_height[$i][$z]; + } + + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]); + } + } + + //=====draw the legend string===== + imagefilledrectangle($image,150,230,165,245,$color[0]); + imagestring($image,2,170,230,"In",$black_color); + imagefilledrectangle($image,320,230,335,245,$color[1]); + imagestring($image,2,340,230,"Out",$black_color); + + imagestring($image,2,77,205,"Success",$black_color); + imagestring($image,2,135,205,"Call deny",$black_color); + imagestring($image,2,215,205,"Net busy",$black_color); + imagestring($image,2,293,200,"Caller",$black_color); + imagestring($image,2,298,212,"clear",$black_color); + imagestring($image,2,360,205,"Sub busy",$black_color); + imagestring($image,2,430,205,"No answer",$black_color); + imagestring($image,2,508,200,"Signal",$black_color); + imagestring($image,2,512,212,"error",$black_color); + + //=====show the success failure graphics==== + $tt=time()-1505; + $file_name="tg2_".$tt.".png"; + imagepng($image,$file_name); + imagedestroy($image); + echo ""; + +*/ +adjust_content_tail("down"); +?> + + + diff --git a/wxc2_omc/performance/ipalimCsta/trunk_general_index.php b/wxc2_omc/performance/ipalimCsta/trunk_general_index.php new file mode 100755 index 0000000..c9bff77 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/trunk_general_index.php @@ -0,0 +1,28 @@ + + + "; + echo ""; + ?> + \ No newline at end of file diff --git a/wxc2_omc/performance/ipalimCsta/trunk_general_up.php b/wxc2_omc/performance/ipalimCsta/trunk_general_up.php new file mode 100755 index 0000000..8de4684 --- /dev/null +++ b/wxc2_omc/performance/ipalimCsta/trunk_general_up.php @@ -0,0 +1,177 @@ + + + + + + +"; +echo ""; +echo ""; +echo "$strTitlePerformance > iPALIM > Trunk group"; +echo ""; +echo ""; +$helpId = "3.11.2"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +if(!isset($scroll_y)) + $scroll_y=0; +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +if(!isset($sel_in_out)) + $sel_in_out=0; +if(!isset($from_hour)) + $from_hour="00"; +if(!isset($from_minute)) + $from_minute="00"; +if(!isset($from_second)) + $from_second="00"; +if(!isset($to_hour)) + $to_hour="24"; +if(!isset($to_minute)) + $to_minute="00"; +if(!isset($to_second)) + $to_second="00"; +//selection date define +$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); +$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); +$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); +$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); +$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> + +to + + + Search + +"; + if($slot==1) + { + + //===============================from_hour text================================= + echo ""; + //===============================from_minute text================================ + echo ""; + //===============================from_second text================================ + echo ""; + //===============================to_hour text===================================== + echo ""; + //===============================to_minute text=================================== + echo ""; + //==============================to_second text==================================== + echo ""; + } + else + { + //===============================from_hour hidden================================= + echo ""; + //===============================from_minute hidden================================ + echo ""; + //===============================from_second hidden================================ + echo ""; + //===============================to_hour hidden===================================== + echo ""; + //===============================to_minute hidden=================================== + echo ""; + //==============================to_second hidden==================================== + echo ""; + } + +echo ""; +echo ""; +?> +

      + +
      +"; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + + + +?> + + + diff --git a/wxc2_omc/performance/irlsCsta/irlsCstaDown.php b/wxc2_omc/performance/irlsCsta/irlsCstaDown.php new file mode 100755 index 0000000..cfb7311 --- /dev/null +++ b/wxc2_omc/performance/irlsCsta/irlsCstaDown.php @@ -0,0 +1,519 @@ + + + +"; + $DEBUG=0; + + + if(!isset($sel_date_from)) + $sel_date_from=0; + + if(!isset($sel_date_to)) + $sel_date_to=0; + + if($DEBUG) + echo "sel_date_from=$sel_date_from,sel_date_to=$sel_date_to
      "; + + $fieldNameAttr=array("Attempt", + "Success", + "Operation fail", + "Create
      VIM fail", + "Connect
      local fail", + "Connect
      VIM fail", + "Notification
      request fail", + "Exception
      retrieve fail", + "Notify retrieve fail"); + + $fieldAttr=array("Attempt", + "Success", + "oper_fail", + "cre_vim_fail", + "conn_local_fail", + "conn_vim_fail", + "noti_req_fail", + "excep_retr_fail", + "noti_retr_fail"); + for($fi=0;$fi"; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //get data from database + $select="select key_type,sum(Attempt) as Attempt, + sum(Success) as Success, + sum(oper_fail) as oper_fail, + sum(cre_vim_fail) as cre_vim_fail, + sum(conn_local_fail) as conn_local_fail, + sum(conn_vim_fail) as conn_vim_fail, + sum(noti_req_fail) as noti_req_fail, + sum(excep_retr_fail) as excep_retr_fail, + sum(noti_retr_fail) as noti_retr_fail "; + $from="from $table_name "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' "; + $group="group by key_type "; + $sql=$select.$from.$where.$group; + if($DEBUG)echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + + for($fi=0;$fi"; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $from="from $table_name "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' "; + $group="group by key_type "; + $sql=$select.$from.$where.$group; + if($DEBUG)echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + + for($fi=0;$fi"; + print_r($csta_data); + echo ""; + } + + //table title + $bgn_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $end_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + if($slot==1) + $table_title="iRLS Statistic Date:".$bgn_time; + else + $table_title="iRLS Statistic Date:".$bgn_time." to ".$end_time; + echo "
      $table_title
      "; + + //show the data + echo ""; + echo ""; + + for($fi=0;$fi{$fieldNameAttr[$fi]}"; + } + echo ""; + + echo ""; + for($fi=0;$fi{$csta_data[1][$tmpVar]}"; + } + echo ""; + + echo ""; + for($fi=0;$fi{$csta_data[2][$tmpVar]}"; + } + echo ""; + echo "
      Type
      MO
      MT
      "; +?> + +2.Attempt(Success/Failure)
      "; + //=====graphics size======= + $sizex=550; + $sizey=300; + + $im = ImageCreate ($sizex, $sizey); + $background_color=ImageColorAllocate($im,255,255,255); + $black_color=ImageColorAllocate($im,0,0,0); + $white_color= imagecolorallocate($im, 255, 255, 255); + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //====graphics background======= + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + imagedashedline($im,30,30,100,100,$black_color); + + //draw the outline + imageLine($im,40,20,40,200,$black_color); + imageLine($im,40,20,480,20,$black_color); + imageLine($im,480,200,480,20,$black_color); + imageLine($im,40,200,480,200,$black_color); + + + //get the max value + $maxY=100; + for($i=1;$i<3;$i++) + { + for($j=0;$j"; + if($csta_data[$i][$tmpVar]>$maxY) + { + + $maxY=$csta_data[$i][$tmpVar]; + } + } + } + //echo "maxY=$maxY
      "; + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=480; + $y2=$y1; + + if($i!=10) + { + imageline($im, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED); + } + + $tmpV=$maxY/10*$i; + $tmpV=floor($tmpV); + if($tmpV > 10000) + { + $tmpV=floor($tmpV/100); + $tmpV=$tmpV/10; + $tmpV.="K"; + } + imagestring($im,2,$x1-30,$y2-5,"$tmpV",$black_color); + } + + //=======draw the vitical line======= + $u=floor(450/9); + for($i=0;$i<9;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color); + } + + //=======get colors============ + $color[0]=ImageColorAllocate($im,0x99,0x00,0x33); + $color[1]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($im,0x99,0xcc,0x99); + $color[4]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($im,0xff,0x99,0xff); + $color[7]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($im,0x00,0x66,0xcc); + $color[11]=ImageColorAllocate($im,0x33,0xff,0x99); + + //======draw the legend string======= + imagestring($im,2,160,205,"MO",$black_color); + imagestring($im,2,360,205,"MT",$black_color); + + + imagefilledrectangle($im,30,230,40,240,$color[0]); + imagestring($im,2,50,230,"Attempt",$black_color); + + imagefilledrectangle($im,200,230,210,240,$color[1]); + imagestring($im,2,220,230,"Success",$black_color); + + imagefilledrectangle($im,360,230,370,240,$color[2]); + imagestring($im,2,380,230,"Operation fail",$black_color); + + imagefilledrectangle($im,30,250,40,260,$color[3]); + imagestring($im,2,50,250,"Create VIM fail",$black_color); + + imagefilledrectangle($im,200,250,210,260,$color[4]); + imagestring($im,2,220,250,"Connect local fail",$black_color); + + imagefilledrectangle($im,360,250,370,260,$color[5]); + imagestring($im,2,380,250,"Connect VIM fail",$black_color); + + imagefilledrectangle($im,30,270,40,280,$color[6]); + imagestring($im,2,50,270,"Notification request fail",$black_color); + + imagefilledrectangle($im,200,270,210,280,$color[7]); + imagestring($im,2,220,270,"Exception retrieve fail",$black_color); + + imagefilledrectangle($im,360,270,370,280,$color[8]); + imagestring($im,2,380,270,"Notify retrieve fail",$black_color); + + //==============draw the block================= + $start_x=40; + $end_x=480; + $start_y=20; + $end_y=200; + + $rect_index=0; + //mo Attempt + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+$u), + 'y1'=>($end_y-$csta_data[1]['Attempt']/$maxY*($end_y-$start_y)), + 'x2'=>($start_x+2*$u), + 'y2'=>($end_y) + ); + + $previous=0; + //mo Success + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+3*$u), + 'y1'=>($end_y-$csta_data[1]['Success']/$maxY*($end_y-$start_y)), + 'x2'=>($start_x+4*$u), + 'y2'=>($end_y) + ); + $previous+=$csta_data[1]['Success']/$maxY*($end_y-$start_y); + + //mo oper_fail + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+3*$u), + 'y1'=>($end_y-$csta_data[1]['oper_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+4*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[1]['oper_fail']/$maxY*($end_y-$start_y); + + //mo cre_vim_fail + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+3*$u), + 'y1'=>($end_y-$csta_data[1]['cre_vim_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+4*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[1]['cre_vim_fail']/$maxY*($end_y-$start_y); + + //mo conn_local_fail + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+3*$u), + 'y1'=>($end_y-$csta_data[1]['conn_local_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+4*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[1]['conn_local_fail']/$maxY*($end_y-$start_y); + + //mo conn_vim_fail + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+3*$u), + 'y1'=>($end_y-$csta_data[1]['conn_vim_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+4*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[1]['conn_vim_fail']/$maxY*($end_y-$start_y); + + //mo noti_req_fail + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+3*$u), + 'y1'=>($end_y-$csta_data[1]['noti_req_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+4*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[1]['noti_req_fail']/$maxY*($end_y-$start_y); + + //mo excep_retr_fail + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+3*$u), + 'y1'=>($end_y-$csta_data[1]['excep_retr_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+4*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[1]['excep_retr_fail']/$maxY*($end_y-$start_y); + + //mo noti_retr_fail + $mo_rect[$rect_index++]=array( + 'x1'=>($start_x+3*$u), + 'y1'=>($end_y-$csta_data[1]['noti_retr_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+4*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[1]['noti_retr_fail']/$maxY*($end_y-$start_y); + + for($i=0;$i<$rect_index;$i++) + { + imagefilledrectangle($im, + $mo_rect[$i]['x1'], + $mo_rect[$i]['y1'], + $mo_rect[$i]['x2'], + $mo_rect[$i]['y2'], + $color[$i]); + } + + //mt Attempt + $rect_index=0; + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+5*$u), + 'y1'=>($end_y-$csta_data[2]['Attempt']/$maxY*($end_y-$start_y)), + 'x2'=>($start_x+6*$u), + 'y2'=>($end_y) + ); + + $previous=0; + //mt Success + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+7*$u), + 'y1'=>($end_y-$csta_data[2]['Success']/$maxY*($end_y-$start_y)), + 'x2'=>($start_x+8*$u), + 'y2'=>($end_y) + ); + $previous+=$csta_data[2]['Success']/$maxY*($end_y-$start_y); + + //mt oper_fail + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+7*$u), + 'y1'=>($end_y-$csta_data[2]['oper_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+8*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[2]['oper_fail']/$maxY*($end_y-$start_y); + + //mt cre_vim_fail + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+7*$u), + 'y1'=>($end_y-$csta_data[2]['cre_vim_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+8*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[2]['cre_vim_fail']/$maxY*($end_y-$start_y); + + //mt conn_local_fail + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+7*$u), + 'y1'=>($end_y-$csta_data[2]['conn_local_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+8*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[2]['conn_local_fail']/$maxY*($end_y-$start_y); + + //mt conn_vim_fail + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+7*$u), + 'y1'=>($end_y-$csta_data[2]['conn_vim_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+8*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[2]['conn_vim_fail']/$maxY*($end_y-$start_y); + + //mt noti_req_fail + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+7*$u), + 'y1'=>($end_y-$csta_data[2]['noti_req_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+8*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[2]['noti_req_fail']/$maxY*($end_y-$start_y); + + //mt excep_retr_fail + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+7*$u), + 'y1'=>($end_y-$csta_data[2]['excep_retr_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+8*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[2]['excep_retr_fail']/$maxY*($end_y-$start_y); + + //mt noti_retr_fail + $mt_rect[$rect_index++]=array( + 'x1'=>($start_x+7*$u), + 'y1'=>($end_y-$csta_data[2]['noti_retr_fail']/$maxY*($end_y-$start_y)-$previous), + 'x2'=>($start_x+8*$u), + 'y2'=>($end_y-$previous) + ); + $previous+=$csta_data[2]['noti_retr_fail']/$maxY*($end_y-$start_y); + + for($i=0;$i<$rect_index;$i++) + { + imagefilledrectangle($im, + $mt_rect[$i]['x1'], + $mt_rect[$i]['y1'], + $mt_rect[$i]['x2'], + $mt_rect[$i]['y2'], + $color[$i]); + } + + //======show the service attempt graphics========== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $filename="irls_".time().".png"; + if(1){ + ImagePng ($im,"$filename"); + + ImageDestroy($im); + } + //-----显示图片 + echo ""; +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/performance/irlsCsta/irlsCstaFrame.php b/wxc2_omc/performance/irlsCsta/irlsCstaFrame.php new file mode 100755 index 0000000..e4a1959 --- /dev/null +++ b/wxc2_omc/performance/irlsCsta/irlsCstaFrame.php @@ -0,0 +1,20 @@ + + + + + "; + echo ""; + ?> + + + <body> + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + </body> + + + + + diff --git a/wxc2_omc/performance/irlsCsta/irlsCstaUp.php b/wxc2_omc/performance/irlsCsta/irlsCstaUp.php new file mode 100755 index 0000000..72b77cd --- /dev/null +++ b/wxc2_omc/performance/irlsCsta/irlsCstaUp.php @@ -0,0 +1,97 @@ + + + + + +
      +"; + echo ""; + echo ""; + echo "$strTitlePerformance > iRLS"; + echo ""; + echo ""; + $helpId="3.12"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +//selection date define +$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); +$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); +$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); +$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); +$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> + +to + + + + + + +"; + echo ""; +?> + + + + +"; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + +
      diff --git a/wxc2_omc/performance/irlsCsta/irls_1253780631.png b/wxc2_omc/performance/irlsCsta/irls_1253780631.png new file mode 100755 index 0000000..c0c6183 Binary files /dev/null and b/wxc2_omc/performance/irlsCsta/irls_1253780631.png differ diff --git a/wxc2_omc/performance/iwfCsta/dataAnalysisDown.php b/wxc2_omc/performance/iwfCsta/dataAnalysisDown.php new file mode 100755 index 0000000..9b88a01 --- /dev/null +++ b/wxc2_omc/performance/iwfCsta/dataAnalysisDown.php @@ -0,0 +1,420 @@ +$strNotFindRecord."; + exit(); + } + +if($language == 'eng'){ + +}else{ + +} + +//-------确定日期范围----- +if($sel_date<0) +{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} +elseif($sel_date>0) +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } +} +else +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } +} + +/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ +$w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + +//合成where语句 +$where=" WHERE".$w1; +$str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +if(!$number_of_records) +{ + echo "$strNotFindRecord"; + exit(); +} +$sum_sql=" SELECT SUM(auc_auth_suc),SUM(auc_auth_fail),SUM(auc_created_sub_suc),SUM(auc_created_sub_fail),SUM(auc_del_sub_suc), SUM(auc_del_sub_fail),SUM(hlr_created_sub_suc),SUM(hlr_created_sub_fail),SUM(hlr_del_sub_suc),SUM(hlr_del_sub_fail),SUM(int_sub_suc),SUM(int_sub_fail) FROM $table_name ".$where; +//echo "
      sum_sql=$sum_sql"; +$sum_res=mysqli_query($pubConn,$sum_sql); +$sum_row=mysqli_fetch_array($sum_res); + +$auc_auth_suc=$sum_row[0]; +$auc_auth_fail=$sum_row[1]; + +$total_auc_auth=$auc_auth_suc+$auc_auth_fail; +if($total_auc_auth>0) +{ + $auc_auth_suc_point=$auc_auth_suc/$total_auc_auth; + $auc_auth_suc_scale=change_percent($auc_auth_suc/$total_auc_auth); + $auc_auth_fail_point=$auc_auth_fail/$total_auc_auth; + $auc_auth_fail_scale=change_percent($auc_auth_fail/$total_auc_auth); +} +else +{ + $auc_auth_suc_point=0; + $auc_auth_suc_scale="0%"; + $auc_auth_fail_point=0; + $auc_auth_fail_scale="0%"; +} + +$auc_created_sub_suc=$sum_row[2]; +$auc_created_sub_fail=$sum_row[3]; +$total_auc_created_sub=$auc_created_sub_suc+$auc_created_sub_fail; +if($total_auc_created_sub>0) +{ + $auc_created_sub_suc_point=$auc_created_sub_suc/$total_auc_created_sub; + $auc_created_sub_suc_scale=change_percent($auc_created_sub_suc/$total_auc_created_sub); + $auc_created_sub_fail_point=$auc_created_sub_fail/$total_auc_created_sub; + $auc_created_sub_fail_scale=change_percent($auc_created_sub_fail/$total_auc_created_sub); +} +else +{ + $auc_created_sub_suc_point=0; + $auc_created_sub_suc_scale="0%"; + $auc_created_sub_fail_point=0; + $auc_created_sub_fail_scale="0%"; +} + +$auc_del_sub_suc=$sum_row[4]; +$auc_del_sub_fail=$sum_row[5]; +$total_auc_del_sub=$auc_del_sub_suc+$auc_del_sub_fail; +if($total_auc_del_sub>0) +{ + $auc_del_sub_suc_point=$auc_del_sub_suc/$total_auc_del_sub; + $auc_del_sub_suc_scale=change_percent($auc_del_sub_suc/$total_auc_del_sub); + $auc_del_sub_fail_point=$auc_del_sub_fail/$total_auc_del_sub; + $auc_del_sub_fail_scale=change_percent($auc_del_sub_fail/$total_auc_del_sub); +} +else +{ + $auc_del_sub_suc_point=0; + $auc_del_sub_suc_scale="0%"; + $auc_del_sub_fail_point=0; + $auc_del_sub_fail_scale="0%"; +} + +$hlr_created_sub_suc=$sum_row[6]; +$hlr_created_sub_fail=$sum_row[7]; +$total_hlr_created_sub=$hlr_created_sub_suc+$hlr_created_sub_fail; +if($total_hlr_created_sub>0) +{ + $hlr_created_sub_suc_point=$hlr_created_sub_suc/$total_hlr_created_sub; + $hlr_created_sub_suc_scale=change_percent($hlr_created_sub_suc/$total_hlr_created_sub); + $hlr_created_sub_fail_point=$hlr_created_sub_fail/$total_hlr_created_sub; + $hlr_created_sub_fail_scale=change_percent($hlr_created_sub_fail/$total_hlr_created_sub); +} +else +{ + $hlr_created_sub_suc_point=0; + $hlr_created_sub_suc_scale="0%"; + $hlr_created_sub_fail_point=0; + $hlr_created_sub_fail_scale="0%"; +} + +$hlr_del_sub_suc=$sum_row[8]; +$hlr_del_sub_fail=$sum_row[9]; +$total_hlr_del_sub=$hlr_del_sub_suc+$hlr_del_sub_fail; +if($total_hlr_del_sub) +{ + $hlr_del_sub_suc_point=$hlr_del_sub_suc/$total_hlr_del_sub; + $hlr_del_sub_suc_scale=change_percent($hlr_del_sub_suc/$total_hlr_del_sub); + $hlr_del_sub_fail_point=$hlr_del_sub_fail/$total_hlr_del_sub; + $hlr_del_sub_fail_scale=change_percent($hlr_del_sub_fail/$total_hlr_del_sub); +} +else +{ + $hlr_del_sub_suc_point=0; + $hlr_del_sub_suc_scale="0%"; + $hlr_del_sub_fail_point=0; + $hlr_del_sub_fail_scale="0%"; +} + +$int_sub_suc=$sum_row[10]; +$int_sub_fail=$sum_row[11]; +$total_int_sub=$int_sub_suc+$int_sub_fail; +if($total_int_sub) +{ + $int_sub_suc_point=$int_sub_suc/$total_int_sub; + $int_sub_suc_scale=change_percent($int_sub_suc/$total_int_sub); + $int_sub_fail_point=$int_sub_fail/$total_int_sub; + $int_sub_fail_scale=change_percent($int_sub_fail/$total_int_sub); +} +else +{ + $int_sub_suc_point=0; + $int_sub_suc_scale="0%"; + $int_sub_fail_point=0; + $int_sub_fail_scale="0%"; +} + +?> + + +
      + + + + + + + + +
      + +

        +Date: +

      +
      + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      1.

      +

      +

      +

      +

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + 2. +
      + + + + + + + + + + + + + + + +
            
      +

      + + + + + + + + +
      :
      + + \ No newline at end of file diff --git a/wxc2_omc/performance/iwfCsta/dataAnalysisIndex.php b/wxc2_omc/performance/iwfCsta/dataAnalysisIndex.php new file mode 100755 index 0000000..6ea4d90 --- /dev/null +++ b/wxc2_omc/performance/iwfCsta/dataAnalysisIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/iwfCsta/dataAnalysisUp.php b/wxc2_omc/performance/iwfCsta/dataAnalysisUp.php new file mode 100755 index 0000000..6ac624b --- /dev/null +++ b/wxc2_omc/performance/iwfCsta/dataAnalysisUp.php @@ -0,0 +1,63 @@ + + + + + AUC > $strAnalysis"; +?> + + + + + +
      + +
      +
      + + + diff --git a/wxc2_omc/performance/iwfCsta/dataQueryDown.php b/wxc2_omc/performance/iwfCsta/dataQueryDown.php new file mode 100755 index 0000000..36bc544 --- /dev/null +++ b/wxc2_omc/performance/iwfCsta/dataQueryDown.php @@ -0,0 +1,246 @@ + + + +$strNotFindRecord."; + exit(); + } + + $where = isset($where) ? urldecode($where) : ''; //传回变量后解url码 + $where = isset($where) ? stripslashes($where) : ''; //解除一些'/' +//删除所查询的内容 +if($delete){ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//end of delete +?> + +0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + /* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ + $w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + + //合成where语句 + $where=" WHERE".$w1; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo "
      $strNotFindRecord"; + exit(); + } + +}//endif + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +if ($number_of_records >= 1){ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0){ + $prev_index = 0; + } +} +$show_initital_record=$initial_record+1; +?> + + + + +" +> + + +
       $show_initital_record - $next_index, ($strTotalRecords:$number_of_records )   "; ?>  +"; +//下面是控制分页显示,传递变量 +if ($initial_record != 0) +{ + $t1 = "initial_record=$prev_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 前一页  + 0 && $number_of_records > $number_records_to_display ) +{ + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 下一页 + +
      + +
      +"; +$csta_result = mysqli_query($pubConn,$csta_sql); +$csta_rows = mysqli_fetch_array($csta_result); +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + + + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/iwfCsta/dataQueryIndex.php b/wxc2_omc/performance/iwfCsta/dataQueryIndex.php new file mode 100755 index 0000000..013db88 --- /dev/null +++ b/wxc2_omc/performance/iwfCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/iwfCsta/dataQueryUp.php b/wxc2_omc/performance/iwfCsta/dataQueryUp.php new file mode 100755 index 0000000..260d132 --- /dev/null +++ b/wxc2_omc/performance/iwfCsta/dataQueryUp.php @@ -0,0 +1,60 @@ + + + + +Performance > AUC > Query +
      + + + + +
      + +
      +
      + + diff --git a/wxc2_omc/performance/mhcCsta/csta_down.php b/wxc2_omc/performance/mhcCsta/csta_down.php new file mode 100755 index 0000000..230c1ba --- /dev/null +++ b/wxc2_omc/performance/mhcCsta/csta_down.php @@ -0,0 +1,289 @@ + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } + +adjust_head_frame("down"); +adjust_title_head_frame("down"); +adjust_title_tail_frame("down"); + +adjust_content_head_frame("down"); +echo "
      "; +//=====================================================================================| +//============================Function Flag============================================| +//=====================================================================================| +$Hide_Show_Function_On=0; +$DEBUG=0; +//=====================================================================================| +//============================Data From Index Page=====================================| +//=====================================================================================| +if(0) +{ + + $url_temp=$_SERVER["REQUEST_URI"]; + echo "This page URL:$url_temp
      "; + + echo "sel_date_from:$sel_date_from
      "; + echo "sel_date_to:$sel_date_to
      "; +} +//=====================================================================================| +//============================Define The Data==========================================| +//=====================================================================================| +$csta_field=array( + 0=>"hlr_noti_mhc", + 1=>"mhc_noti_hlr", + 2=>"rep_att", + 3=>"rep_suc", + 4=>"rep_fail", + 5=>"veri_att", + 6=>"veri_suc", + 7=>"veri_fail", + 8=>"veri_del_att", + 9=>"veri_del_suc", + 10=>"veri_del_fail", + 11=>"veri_dld_att", + 12=>"veri_dld_suc", + 13=>"veri_dld_fail", + 14=>"mhc_msg_sent", + 15=>"mhc_msg_recv", +); + +$csta_show_field=array( + 0=>"HLR Notify MHC", + 1=>"MHC Notify HLR", + 2=>"Replication Attempt", + 3=>"Replication Success", + 4=>"Replication Fail", + 5=>"Verification Attempt", + 6=>"Verification Success", + 7=>"Verification Fail", + 8=>"Verification Deleted Attempt", + 9=>"Verification Deleted Success", + 10=>"Verification Deleted Fail", + 11=>"Verification Download Attempt", + 12=>"Verification Download Success", + 13=>"Verification Download Fail", + 14=>"MHC Message Sent", + 15=>"MHC Message Received", +); + + //data define + for($i=0;$i"; + echo "end_time:$end_time
      "; + echo "slot:$slot
      "; + echo "db:$csta_db
      "; + } + + $sql_sum=""; + for($i=0;$i0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + for($day=0;$day<$slot;$day++) + { + $table_name="mhcDetail"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select $sql_sum "; + $from="from $table_name "; + $service_where="and key_type=1 "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where; + $group="group by key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + continue; + + do{ + $field_num=sizeof($csta_field); + for($tt=0;$tt<$field_num;$tt++) + { + $service_csta[$tt]+=$rows[$tt]; + } + for($tt=0;$tt<16;$tt++) + { + for($i=0;$i<6;$i++) + { + $sync_csta[$tt][$i]+=$rows[$field_num+$tt*6+$i]+0; + } + } + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $table_name="mhcDetail"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select $sql_sum "; + $from="from $table_name "; + $service_where="and key_type=1 "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where; + $group="group by key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + continue; + + do{ + $field_num=sizeof($csta_field); + for($tt=0;$tt<$field_num;$tt++) + { + $service_csta[$tt]+=$rows[$tt]; + } + for($tt=0;$tt<16;$tt++) + { + for($i=0;$i<6;$i++) + { + $sync_csta[$tt][$i]+=$rows[$field_num+$tt*6+$i]+0; + } + } + }while($rows=mysqli_fetch_array($result)); + } + + +//===================================================================================| +//=======================Show The Table-1============================================| +//===================================================================================| + //===table title + if($slot==1) + $table_title="Statistic Date:".$bgn_time; + else + $table_title="Statistic Date:".$bgn_time." to ".$end_time; + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i"; + echo ""; + echo ""; + echo ""; + } + + echo "
      TypeValue
      {$csta_show_field[$i]}{$service_csta[$i]}
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<16;$i++) + { + echo ""; + echo ""; + for($j=0;$j<6;$j++) + { + echo ""; + } + echo ""; + } + + echo "
      Node IndexSynchronization OutgoingSynchronization Incoming
      AttemptSuccessFailAttemptSuccessFail
      $i{$sync_csta[$i][$j]}
      "; + + +adjust_content_tail("down"); +?> + + + diff --git a/wxc2_omc/performance/mhcCsta/csta_frame.php b/wxc2_omc/performance/mhcCsta/csta_frame.php new file mode 100755 index 0000000..f332da1 --- /dev/null +++ b/wxc2_omc/performance/mhcCsta/csta_frame.php @@ -0,0 +1,21 @@ + + + + + "; + echo ""; + ?> + + + <body> + <p>Frame isn't supported!</p> + </body> + + + + + + diff --git a/wxc2_omc/performance/mhcCsta/csta_up.php b/wxc2_omc/performance/mhcCsta/csta_up.php new file mode 100755 index 0000000..e8613a7 --- /dev/null +++ b/wxc2_omc/performance/mhcCsta/csta_up.php @@ -0,0 +1,100 @@ + + + + + +
      +"; + echo ""; + echo ""; + echo "$strTitlePerformance > MHC"; + echo ""; + echo ""; + $helpId="3.14"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +//selection date define +$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); +$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); +$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); +$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); +$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> +to + + + + + + +"; + echo ""; +?> + + + + +"; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +?> + + + +
      diff --git a/wxc2_omc/performance/mrfcCsta/csta_down.php b/wxc2_omc/performance/mrfcCsta/csta_down.php new file mode 100755 index 0000000..3bdd68b --- /dev/null +++ b/wxc2_omc/performance/mrfcCsta/csta_down.php @@ -0,0 +1,492 @@ + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } + +adjust_head_frame("down"); +adjust_title_head_frame("down"); +adjust_title_tail_frame("down"); + +adjust_content_head_frame("down"); +echo "
      "; +//=====================================================================================| +//============================Function Flag============================================| +//=====================================================================================| +$Hide_Show_Function_On=0; +$DEBUG=0; +//=====================================================================================| +//============================Data From Index Page=====================================| +//=====================================================================================| +if(0) +{ + + $url_temp=$_SERVER["REQUEST_URI"]; + echo "This page URL:$url_temp
      "; + + echo "sel_date_from:$sel_date_from
      "; + echo "sel_date_to:$sel_date_to
      "; +} +//=====================================================================================| +//============================Define The Data==========================================| +//=====================================================================================| + //data define + for($i=0;$i<3;$i++) + { + for($j=0;$j<8;$j++) + { + /* + 1 conference 0 attempt + 2 transcoding 1 success + 2 duration + 3 no resource + 4 negotiation fail + 5 media error + 6 no response + 7 general error + */ + $service_csta[$i][$j]=0; + } + } + +//===================================================================================| +//========================Get The Data From DB=======================================| +//===================================================================================| + $db="CSTA_DB"; + $bgn_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $end_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + //get the numbers of days that selected + $slot=$sel_date_from-$sel_date_to+1; + if(0) + { + echo "bgn_time:$bgn_time
      "; + echo "end_time:$end_time
      "; + echo "slot:$slot
      "; + echo "db:$csta_db
      "; + } + + //$key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + for($day=0;$day<$slot;$day++) + { + $table_name="mrfcDetail"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Attempt) as attempt,sum(Success) as success,sum(Cau1) as cau1,sum(Cau2) as cau2,sum(Cau3) as cau3,sum(Cau4) as cau4,sum(Cau5) as cau5,sum(Duration) as Duration "; + $from="from $table_name "; + $service_where="and key_type>0 and key_type<3 "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where; + $group="group by key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + continue; + + do{ + $key_type=$rows[key_type]+0; + + for($tt=0;$tt<8;$tt++) + { + $service_csta[$key_type][$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $table_name="mrfcDetail"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Attempt) as attempt,sum(Success) as success,sum(Cau1) as cau1,sum(Cau2) as cau2,sum(Cau3) as cau3,sum(Cau4) as cau4,sum(Cau5) as cau5,sum(Duration) as duration "; + $from="from $table_name "; + $service_where="and key_type>0 and key_type<3 "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where; + $group="group by key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + continue; + + do{ + $key_type=$rows[key_type]+0; + + for($tt=0;$tt<8;$tt++) + { + $service_csta[$key_type][$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + +//===================================================================================| +//=========================Test The Data=============================================| +//===================================================================================| +if(0) +{ + for($i=1;$i<3;$i++) + { + for($j=0;$j<8;$j++) + { + echo "type-$i-$j:{$service_csta[$i][$j]}
      "; + } + } +} + +//===================================================================================| +//=======================Show The Table-1============================================| +//===================================================================================| + //===table title + if($slot==1) + $table_title="Service statistic Date:".$bgn_time; + else + $table_title="Service statistic Date:".$bgn_time." to ".$end_time; + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $service_type_label=array(1=>"Conference",2=>"Transcoding"); + + //========show subs to subs,subs to local,subs to toll,trunk to subs,trunk to trunk========== + for($i=1;$i<3;$i++) + { + + echo ""; + echo ""; + for($j=0;$j<9;$j++) + { + echo ""; + } + echo ""; + + } + echo "
      TypeAttemptSuccessNo ResourceNegotiation FailMedia ErrorNo ResponseGeneral ErrorTotal call durationAverage call duration(s)
      $service_type_label[$i]"; + switch($j) + { + //Attempt + case 0: + echo "{$service_csta[$i][0]}"; + break; + //Success + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + echo "{$service_csta[$i][$j]}"; + if($service_csta[$i][0]==0) + $rate=0; + else + { + $rate=$service_csta[$i][$j]/$service_csta[$i][0]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + break; + case 7: + echo "{$service_csta[$i][$j]}(s)"; + $hour=floor($service_csta[$i][$j]/3600); + $minute=floor($service_csta[$i][$j]%3600/60); + $second=$service_csta[$i][$j]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + break; + case 8: + if($service_csta[$i][1] == 0) + $ave=0; + else + $ave=$service_csta[$i][7]/$service_csta[$i][1]; + $ave=number_format($ave, 0, '.', ''); + echo "$ave"; + break; + } + + echo "
      "; + +//=====================================================================================| +//=======================Draw The Graphics-1===========================================| +//=====================================================================================| +echo "

      2.Service(Attempt) & Success/Failure
      "; + //=====graphics size======= + $sizex=650; + $sizey=250; + + $im = ImageCreate ($sizex, $sizey); + $background_color=ImageColorAllocate($im,255,255,255); + $black_color=ImageColorAllocate($im,0,0,0); + $white_color= imagecolorallocate($im, 255, 255, 255); + + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + + //====graphics background======= + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + + + imagedashedline($im,30,30,100,100,$black_color); + + //======draw the horizonal line======== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=610; + $y2=$y1; + + if($i!=10) + { + imageline($im, $x1,$y1,190,$y2, IMG_COLOR_STYLED); + imageline($im, 220,$y1,$x2,$y2, IMG_COLOR_STYLED); + } + + imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color); + imagestring($im,2,$x2+5,$y2-5,($i*10)."%",$black_color); + + } + + //=======draw the vitical line======= + $u=floor(750/25); + for($i=0;$i<25;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + if($i < 20) + ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color); + } + + //=======get colors============ + $color[0]=ImageColorAllocate($im,0x99,0x00,0x33); + $color[1]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($im,0x99,0xcc,0x99); + $color[4]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($im,0xff,0x99,0xff); + $color[7]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($im,0x00,0x66,0xcc); + $color[11]=ImageColorAllocate($im,0x33,0xff,0x99); + + + //=====get the precent and block height(Part-1)====== + $attempt_sum_one=0; + for($i=1;$i<3;$i++) + { + $attempt_sum_one+=$service_csta[$i][0]; + } + if($attempt_sum_one==0) + { + //conference precent + $conference_attempt_precent="0%"; + //transcoding precent + $transcoding_attempt_precent="0%"; + + for($t=0;$t<2;$t++) + $height[$t]=0; + } + else + { + //sub to sub precent + $conference_attempt_precent=number_format($service_csta[1][0]*100/$attempt_sum_one,2,'.','')."%"; + //sub to trunk precent + $transcoding_attempt_precent=number_format($service_csta[2][0]*100/$attempt_sum_one,2,'.','')."%"; + + for($t=0;$t<2;$t++) + $height[$t]=floor(180*$service_csta[$t+1][0]/$attempt_sum_one); + + } + + //======draw the data block====== + for($i=0;$i<2;$i++) + { + $x1=40+(2*$i+1)*$u; + if($height[$i]==0) + $height[$i]=1; + $y1=200-$height[$i]; + $x2=40+(2*$i+2)*$u; + $y2=199; + imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]); + } + + //=====get the data height (part-2) + //imagefilledrectangle($im,220,20,250,200,$color[$i]); + + $field_index=array(1,2,3,4,5,6); + + for($j=0;$j<6;$j++) + { + $x1_1=220+($j*2+1)*30; + $y1_1=200; + $x1_2=$x1_1+30; + if($attempt_sum_one==0) + $y1_2=200; + else + $y1_2=200-floor(180*$service_csta[1][$field_index[$j]]/$attempt_sum_one); + + $x2_1=$x1_1; + $y2_1=$y1_2; + $x2_2=$x1_2; + if($attempt_sum_one==0) + $y2_2=$y1_2-0; + else + $y2_2=$y1_2-floor(180*$service_csta[2][$field_index[$j]]/$attempt_sum_one); + //echo "{$x1_1},{$y1_1},{$x1_2},{$y1_2}
      "; + imagefilledrectangle($im,$x1_1,$y1_1,$x1_2,$y1_2,$color[0]); + imagefilledrectangle($im,$x2_1,$y2_1,$x2_2,$y2_2,$color[1]); + } + + + + + //======draw the legend string======= + imagestring($im,2,72,205,"CONF",$black_color); + imagestring($im,2,60,220,"(".$conference_attempt_precent.")",$black_color); + imagestring($im,2,131,205,"TRAN",$black_color); + imagestring($im,2,123,220,"(".$transcoding_attempt_precent.")",$black_color); + imagestring($im,2,245,205,"Success",$black_color); + //imagestring($im,2,243,221,"(".$trunk_to_trunk_attempt_precent.")",$black_color); + imagestring($im,2,320,205,"No",$black_color); + imagestring($im,2,305,221,"Resource",$black_color); + imagestring($im,2,355,205,"Negotiation",$black_color); + imagestring($im,2,375,221,"Fail",$black_color); + imagestring($im,2,431,205,"Media",$black_color); + imagestring($im,2,430,221,"Error",$black_color); + imagestring($im,2,500,205,"No",$black_color); + imagestring($im,2,485,221,"Response",$black_color); + imagestring($im,2,548,205,"General",$black_color); + imagestring($im,2,552,221,"Error",$black_color); + + //draw the outline + imageLine($im,40,20,40,200,$black_color); + imageLine($im,40,20,190,20,$black_color); + imageLine($im,190,200,190,20,$black_color); + imageLine($im,40,200,190,200,$black_color); + + imageLine($im,220,200,220,20,$black_color); + imageLine($im,220,20,610,20,$black_color); + imageLine($im,610,200,610,20,$black_color); + imageLine($im,220,200,610,200,$black_color); + + + //======show the service attempt graphics========== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $filename="ser3_".time().".png"; + if(1){ + ImagePng ($im,"$filename"); + + ImageDestroy($im); + } + //-----显示图片 + echo ""; + + //=======show the remark label======== + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      CONF-> ConferenceTRAN-> Transcoding
      "; + +adjust_content_tail("down"); +?> + + + diff --git a/wxc2_omc/performance/mrfcCsta/csta_frame.php b/wxc2_omc/performance/mrfcCsta/csta_frame.php new file mode 100755 index 0000000..f332da1 --- /dev/null +++ b/wxc2_omc/performance/mrfcCsta/csta_frame.php @@ -0,0 +1,21 @@ + + + + + "; + echo ""; + ?> + + + <body> + <p>Frame isn't supported!</p> + </body> + + + + + + diff --git a/wxc2_omc/performance/mrfcCsta/csta_up.php b/wxc2_omc/performance/mrfcCsta/csta_up.php new file mode 100755 index 0000000..8c6367a --- /dev/null +++ b/wxc2_omc/performance/mrfcCsta/csta_up.php @@ -0,0 +1,100 @@ + + + + + +

      +"; + echo ""; + echo ""; + echo "$strTitlePerformance > MRFC"; + echo ""; + echo ""; + $helpId="3.13"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +//selection date define +$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); +$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); +$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); +$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); +$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> +to + + + + + + +"; + echo ""; +?> + + + + +"; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +?> + + + +
      diff --git a/wxc2_omc/performance/mrfcCsta/ser3_1253888899.png b/wxc2_omc/performance/mrfcCsta/ser3_1253888899.png new file mode 100755 index 0000000..c0c7057 Binary files /dev/null and b/wxc2_omc/performance/mrfcCsta/ser3_1253888899.png differ diff --git a/wxc2_omc/performance/mscCsta.tgz b/wxc2_omc/performance/mscCsta.tgz new file mode 100755 index 0000000..9eb3364 Binary files /dev/null and b/wxc2_omc/performance/mscCsta.tgz differ diff --git a/wxc2_omc/performance/mscCsta/bhca.php b/wxc2_omc/performance/mscCsta/bhca.php new file mode 100755 index 0000000..4bd70b5 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/bhca.php @@ -0,0 +1,1935 @@ + + + + + + + + + 0){ + echo ""; + }else{ + echo ""; + } +echo "
      "; +//=======================================================================================| +//======== Data Initial when run first ========================| +//=======================================================================================| +if(!isset($csta_type)) + $csta_type=0; +if(!isset($select_date)) + $select_date=0; +if(!isset($sel_date)) + $sel_date=0; +if(!isset($trunk_num)) + $trunk_num="1,2"; +if(!isset($on_top_index)) + $on_top_index=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sub_sub_flag)) +{ + $sub_sub_flag=0; + $sub_loc_flag=0; + $tru_tol_flag=0; + $tru_sub_flag=0; + $tru_tru_flag=0; + $tru_ip_flag=0; + $sub_ip_flag=0; + $inter_flag=0; + $mo_flag=0; + $mt_flag=0; + $in_tru_flag=0; + $out_tru_flag=0; + $ip_inter_flag=0; +} + +$DEBUG=0; + +adjust_head(); +adjust_title_head(); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strTitlePerformance > MSC > $strBHCA"; +echo ""; +$helpId="3.2.5"; +showHelp($helpId); +echo "
      "; + +//======up csta_type selection======== +$csta_type_label=array("Service","E1","Trunk group"); +echo ""; + +//======date selection====== +echo ""; + +//===search button===== +echo ""; + echo "$strSearch"; +echo ""; + +echo ""; + +//====printer button=== +echo ""; + echo ""; +echo ""; + +echo "
      "; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> +"; + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + $select="select key_type,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime==23) + continue; + //echo "datetime=$datetime
      "; + $bhca_service_oneday[$index][$datetime+1]+=$rows[1]; + //echo "type:$index time:$datetime {$bhca_service_oneday[$index][$datetime]}
      "; + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + $select="select key_type,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + + //echo "datetime=$datetime
      "; + $bhca_service_oneday[$index][0]+=$rows[1]; + //echo "type:$index time:$datetime {$bhca_service_oneday[$index][$datetime]}
      "; + }while($rows=mysqli_fetch_array($result)); + } + + + //======Fake Data======= + if($DEBUG) + { + for($i=0;$i<13;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_service_oneday[$i][$j]=rand(10,100); + } + } + } + + //=====Test the Data===== + if(0) + { + $test_service_type_label=array("SUB SUB","SUB LOC","TRK TOLL","TRK SUB","TRK TRK","SUB IP", + "TRK IP","INTER","MO","MT","IN TRK","OUT TRK","IP"); + for($i=0;$i<12;$i++) + { + for($j=0;$j<24;$j++) + { + echo "{$test_service_type_label[$i]}--$j--{$bhca_service_oneday[$i][$j]}
      "; + } + } + } + + + //====show the table-1==== + $table_title="Service"." BHCA Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); //table title + $service_type_label=array("Subs to subs","Subs to trunk","Trunk to subs","Trunk to trunk","Intraconnection", + "Sub to IP","Trunk to IP", + "Mobile originated","Mobile terminated","In trunk","Out trunk","IP terminated"); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<12;$i++) + { + echo ""; + echo ""; + for($j=0;$j<12;$j++) + { + echo ""; + } + echo ""; + + echo ""; + echo ""; + + echo ""; + for($j=0;$j<12;$j++) + { + echo ""; + } + echo ""; + echo ""; + for($j=12;$j<24;$j++) + { + echo ""; + } + echo ""; + echo ""; + for($j=12;$j<24;$j++) + { + echo ""; + } + echo ""; + + echo ""; + } + echo "
      Type"; + echo "BHCA(calls)"; + echo "
       $j
      {$service_type_label[$i]}
      {$bhca_service_oneday[$i][$j]}
      $j
      {$bhca_service_oneday[$i][$j]}
      "; + + +} +//=======================================================================================| +//=========== csta_type==1,E1 Table ================| +//=======================================================================================| +else if($csta_type==1) +{ + //=====Data define======= + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_e1_oneday[$i][$j]=0; + } + } + + //=====Get Data from DB====== + $device_name=isset($device_name)?$device_name:$DEFAULT_SYS; //device name + $db="CSTA_DB"; + $sys_entries=get_sys_total($device_name); + $subsys_entries=1; + $e1_entries=get_e1_total($device_name); + + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + + for($i=0;$i<$sys_entries;$i++) + { + $select="select key_sys_id,key_subsys_id,key_e1_tg,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY key_e1_tg,csta_datetime"; + $e1_where="AND key_type>0 AND key_type<3 "; + $where=" WHERE key_sys_id=$i AND key_subsys_id=0 AND csta_datetime >'$from_time' AND csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + $msc_no=$rows[0]+0; + $e1_no=$rows[2]+0; + + $bhca_e1_oneday[$msc_no*128+$e1_no][$datetime]=$rows[3]+0; + //echo "e1_data[$msc_no][0][$e1_no][$datetime]:{$e1_data[$msc_no][0][$e1_no][$datetime]}
      "; + }while($rows=@mysqli_fetch_array($result)); + } + } + + + //====Fake Data============ + if($DEBUG) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_e1_oneday[$i][$j]=rand(10,100); + } + } + } + + //====Get the sys-0 and sys-1 data===== + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + if($i<128) + $e1_sys1_sum[$j]+=$bhca_e1_oneday[$i][$j]; + else + $e1_sys2_sum[$j]+=$bhca_e1_oneday[$i][$j]; + } + } + + //====Test the Data====== + if(0) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + echo "E1-$i--Hour-$j--{$bhca_e1_oneday[$i][$j]}
      "; + } + } + } + + //=====show the table-1===== + $table_title="E1"." BHCA Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); //table title + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<24;$i++) + { + echo ""; + } + + //msc-0 + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + + for($i=0;$i<128;$i++) + { + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + } + + //msc=1 + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + + for($i=128;$i<256;$i++) + { + echo ""; + $temp=$i-128; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + } + echo "
      Equipment"; + echo "BHCA(calls)"; + echo "
      SystemE1$i
      MSC-0sys{$e1_sys1_sum[$j]}
      MSC-0$i{$bhca_e1_oneday[$i][$j]}
      MSC-1sys{$e1_sys2_sum[$j]}
      MSC-1$temp{$bhca_e1_oneday[$i][$j]}
      "; + + +} +//=======================================================================================| +//=========== csta_type==2,trunk group Table ================| +//=======================================================================================| +else if($csta_type==2) +{ + //=====Data define====== + for($i=0;$i<=256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_trunk_oneday[$i][$j]=0; + } + } + + //=====Get the Data from DB====== + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + + + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5"; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==TRUE) + { + $select_rows=mysqli_fetch_array($select_result); + + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_oneday[$gro][$datetime+1]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$bhca_trunk_oneday[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + //get the 0-hour of the day + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + + + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5"; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==TRUE) + { + $select_rows=mysqli_fetch_array($select_result); + + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_oneday[$gro][0]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$bhca_trunk_oneday[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + + + //=====Fake Data======== + if($DEBUG) + { + for($i=0;$i<=256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_trunk_oneday[$i][$j]=rand(10,100); + } + } + } + + //======Test the Data===== + if(0) + { + for($i=0;$i<=256;$i++) + { + for($j=0;$j<24;$j++) + { + $bhca_trunk_oneday[$i][$j]=rand(10,100); + } + } + } + + //=====Show the table-1===== + $table_title="Trunk group BHCA Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<24;$i++) + { + echo ""; + } + echo ""; + + for($i=1;$i<=256;$i++) + { + echo ""; + $t=$i; + echo ""; + for($j=0;$j<24;$j++) + { + //$bhca_trunk_oneday[$i][$j]=number_format($bhca_trunk_oneday[$i][$j], 2, '.', ''); + if($bhca_trunk_oneday[$i][$j]==0) + echo ""; + else + echo ""; + } + echo ""; + } + echo "
       "; + echo "BHCA(calls)"; + echo "
      TG$i
      $t{$bhca_trunk_oneday[$i][$j]}{$bhca_trunk_oneday[$i][$j]}
      "; + + +} + +//=======================================================================================| +//======== Down Selection ============| +//=======================================================================================| +//====date from selection===== +echo "

      "; +echo ""; +echo ""; + + echo ""; + echo ""; + //=====trunk number text for trunk===== + echo ""; + echo ""; + + //====search button===== + echo ""; + + + + + //====on top selection====== + if($csta_type==0) + { + echo "
      "; + echo ""; + echo "to"; + echo ""; + echo " "; + if($csta_type==2) + { + echo ""; + } + //hide the trunk_num selection + else + { + echo ""; + } + echo ""; + echo "
      "; + echo "$strSearch"; + echo "
      "; + echo "
      "; + echo ""; + echo ""; + + echo ""; + + /* delete tru to toll + echo ""; + */ + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + else if($csta_type==1) + { + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + else if($csta_type==2) + { + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo "
      "; + if($sub_sub_flag==1) + { + $line_select[0]=1; + echo ""; + } + else + { + $line_select[0]=0; + $lineOnTop=0; + echo ""; + } + echo "SUB SUB"; + if($sub_loc_flag==1) + { + $line_select[1]=1; + echo ""; + } + else + { + $line_select[1]=0; + $lineOnTop=1; + echo ""; + } + echo "SUB TRK"; + if($tru_tol_flag==1) + { + $line_select[2]=1; + echo ""; + } + else + { + $line_select[2]=0; + echo ""; + } + echo "TRK TOLL"; + if($tru_sub_flag==1) + { + $line_select[2]=1; + echo ""; + } + else + { + $line_select[2]=0; + $lineOnTop=2; + echo ""; + } + echo "TRK SUB"; + if($tru_tru_flag==1) + { + $line_select[3]=1; + echo ""; + } + else + { + $line_select[3]=0; + $lineOnTop=3; + echo ""; + } + echo "TRK TRK"; + if($inter_flag==1) + { + $line_select[4]=1; + echo ""; + } + else + { + $line_select[4]=0; + $lineOnTop=4; + echo ""; + } + echo "INTRA"; + if($sub_ip_flag==1) + { + $line_select[5]=1; + echo ""; + } + else + { + $line_select[5]=0; + $lineOnTop=5; + echo ""; + } + echo "SUB IP"; + if($tru_ip_flag==1) + { + $line_select[6]=1; + echo ""; + } + else + { + $line_select[6]=0; + $lineOnTop=6; + echo ""; + } + echo "TRK IP"; + if($mo_flag==1) + { + $line_select[7]=1; + echo ""; + } + else + { + $line_select[7]=0; + $lineOnTop=7; + echo ""; + } + echo "MO"; + if($mt_flag==1) + { + $line_select[8]=1; + echo ""; + } + else + { + $line_select[8]=0; + $lineOnTop=8; + echo ""; + } + echo "MT"; + if($in_tru_flag==1) + { + $line_select[9]=1; + echo ""; + } + else + { + $line_select[9]=0; + $lineOnTop=9; + echo ""; + } + echo "IN TRK"; + if($out_tru_flag==1) + { + $line_select[10]=1; + echo ""; + } + else + { + $line_select[10]=0; + $lineOnTop=10; + echo ""; + } + echo "OUT TRK"; + if($ip_inter_flag==1) + { + $line_select[11]=1; + echo ""; + } + else + { + $line_select[11]=0; + $lineOnTop=11; + echo ""; + } + echo "IP "; + echo "on top"; + echo " "; + echo "on top"; + echo "
      "; +//=======================================================================================| +//=========== Test before draw graphics ================| +//=======================================================================================| +if(0) +{ + $test_csta_type_label=array("Service","E1","Trunk"); + $slot=$sel_date_from-$sel_date_to+1; + echo "Type----{$test_csta_type_label[$csta_type]}
      "; + echo "Time----sigle $sel_date From $sel_date_from to $sel_date_to slot:$slot
      "; + echo "Service flag-----$sub_sub_flag $sub_loc_flag $tru_tol_flag $tru_sub_flag $tru_tru_flag $sub_ip_flag $tru_ip_flag $inter_flag $mo_flag $mt_flag $in_tru_flag $out_tru_flag $ip_inter_flag
      "; + echo "Trunk num----$trunk_num
      "; + echo "on top index----$on_top_index
      "; +} + + + +//=======================================================================================| +//=========== csta_type==0,service Graphics ================| +//=======================================================================================| +$slot=$sel_date_from-$sel_date_to+1; +if($csta_type==0) +{ + //====Data define==== + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $bhca_service_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql

      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime==23) + continue; + //echo "datetime:$datetime
      "; + $bhca_service_mangdays[$index][$datetime+1+24*$day]+=$rows[ans]; + + }while($rows=mysqli_fetch_array($result)); + } + } + + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql

      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + + //echo "datetime:$datetime
      "; + $bhca_service_mangdays[$index][24*$day]+=$rows[ans]; + + }while($rows=mysqli_fetch_array($result)); + } + } + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<13;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $bhca_service_mangdays[$i][$j]=rand(100,5000); + } + } + } + + //====Test Data====== + if(0) + { + $test_service_type_label=array("SUB SUB","SUB LOC","TRK TOLL","TRK SUB","TRK TRK","SUB IP", + "TRK IP","INTER","MO","MT","IN TRK","OUT TRK","IP"); + for($i=0;$i<13;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_service_type_label[$i]}--$j--{$bhca_service_mangdays[$i][$j]}
      "; + } + } + } + + +} +//=======================================================================================| +//=========== csta_type==1,E1 Graphics ================| +//=======================================================================================| +else if($csta_type==1) +{ + //====Data define==== + for($i=0;$i<3;$i++) + { + /* + 0 IN + 1 OUT + 2 IN&OUT + */ + for($j=0;$j<24*$slot;$j++) + { + $bhca_e1_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + $device_name=isset($device_name)?$device_name:$DEFAULT_SYS; //device name + $db="CSTA_DB"; + $sys_entries=get_sys_total($device_name); + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + //echo "on_top_select:$on_top_select
      "; + + //===incoming e1=== + $select="select sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="AND key_type=1 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $bhca_e1_mangdays[0][$datetime]=$rows[0]+0; + + }while($rows=@mysqli_fetch_array($result)); + } + + //====outgoing e1===== + $select="select sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="AND key_type=2 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $bhca_e1_mangdays[1][$datetime]=$rows[0]+0; + + }while($rows=@mysqli_fetch_array($result)); + } + + //===in-out e1 + $select="select sum(Success) as ans,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="and key_type>0 and key_type<3 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $erlang_e1_mangdays[2][$datetime]=$rows[0]+0; + + }while($rows=@mysqli_fetch_array($result)); + } + } + + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<3;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $bhca_e1_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_e1_type_label=array("In","Out","In&Out"); + for($i=0;$i<3;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_e1_type_label[$i]}--$j--{$bhca_e1_mangdays[$i][$j]}
      "; + } + } + } +} +//=======================================================================================| +//=========== csta_type==2,trunk Graphics ================| +//=======================================================================================| +else if($csta_type==2) +{ + + $trunk_index=explode(",",$trunk_num); + $trunk_index[0]=$trunk_index[0]; + $trunk_index[1]=$trunk_index[1]; + //echo "trunk_num:$trunk_num
      "; + //echo "index_0:{$trunk_index[0]}---index_1:{$trunk_index[1]}
      "; + //====Data define==== + for($i=0;$i<2;$i++) + { + /* + 0 The first trunk select + 1 The second trunk select + */ + for($j=0;$j<24*$slot;$j++) + { + $bhca_trunk_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + //trunk_num_select + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //tg 1 + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[0]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_mangdays[0][$datetime+1+24*$day]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + + //tg 2 + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[1]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "

      $select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_mangdays[1][$datetime+1+24*$day]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //tg 1 + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[0]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_mangdays[0][24*$day]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + + //tg 2 + $select="select key_e1_tg,csta_datetime,sum(Success) as ans "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[1]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "

      $select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $bhca_trunk_mangdays[1][24*$day]+=$select_rows[ans]+0; + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $bhca_trunk_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_trunk_type_label=array("First","Second"); + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_trunk_type_label[$i]} {$trunk_index[$i]}--$j--{$bhca_trunk_mangdays[$i][$j]}
      "; + } + } + } +} + + +//=======================================================================================| +//=========== Draw the Graphics =============| +//=======================================================================================| + + $sizex=800; + if($csta_type==0) + $sizey=430; + else + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + //===background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + //====draw the horizonal line==== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + + if($csta_type==0) + { + //====graphics title===== + $graphics_title="Service BHCA statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //===draw the label block==== + $color[0]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[1]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[4]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[7]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[11]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"SUB SUB",$text_color); + + imagefilledrectangle($im,260,350,270,360,$color[1]); + imagestring($im,2,275,350,"SUB TRK",$text_color); + + imagefilledrectangle($im,430,350,440,360,$color[2]); + imagestring($im,2,445,350,"TRK SUB",$text_color); + + imagefilledrectangle($im,600,350,610,360,$color[3]); + imagestring($im,2,615,350,"TRK TRK",$text_color); + + imagefilledrectangle($im,90,370,100,380,$color[4]); + imagestring($im,2,105,370,"INTRA",$text_color); + + imagefilledrectangle($im,260,370,270,380,$color[5]); + imagestring($im,2,275,370,"SUB IP",$text_color); + + imagefilledrectangle($im,430,370,440,380,$color[6]); + imagestring($im,2,445,370,"TRK IP",$text_color); + + imagefilledrectangle($im,600,370,610,380,$color[7]); + imagestring($im,2,615,370,"MO",$text_color); + + imagefilledrectangle($im,90,390,100,400,$color[8]); + imagestring($im,2,105,390,"MT",$text_color); + + imagefilledrectangle($im,260,390,270,400,$color[9]); + imagestring($im,2,275,390,"IN TRK",$text_color); + + imagefilledrectangle($im,430,390,440,400,$color[10]); + imagestring($im,2,445,390,"OUT TRK",$text_color); + + imagefilledrectangle($im,600,390,610,400,$color[11]); + imagestring($im,2,615,390,"IP",$text_color); + + //get the biggest Y-scale value + $maxYNum=0; + for($i=0;$i<13;$i++) + { + for($j=0;$j<$slot*24;$j++) + { + if(!isset($bhca_service_mangdays[$i][$j])) + $bhca_service_mangdays[$i][$j]=0.0; + if($line_select[$i]==1) + { + if($maxYNum<$bhca_service_mangdays[$i][$j]) + $maxYNum=$bhca_service_mangdays[$i][$j]; + } + //echo "g-$i-h-$j:{$bhca_service_mangdays[$i][$j]}
      "; + } + } + + + + //====get the points scale==== + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + for($i=0;$i<13;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $pointscale[$i][$j]['x']=60+30*$j/$slot; + $pointscale[$i][$j]['y']=25+(250-$bhca_service_mangdays[$i][$j]*25/$unitValue); + } + } + + + for($type_index=0;$type_index<13;$type_index++) + { + if($line_select[$type_index]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$pointscale[$type_index][$i]['x'],$pointscale[$type_index][$i]['y'],$pointscale[$type_index][$i+1]['x'],$pointscale[$type_index][$i+1]['y'],$color[$type_index]); + } + } + } + + //echo "lineTop=$lineTop
      "; + if($line_select[$lineTop]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y'],$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y'],$color[$lineTop]); + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y']+1,$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y']+1,$color[$lineTop]); + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y']+2,$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y']+2,$color[$lineTop]); + + } + } + + + } + else if($csta_type==1) + { + $graphics_title="E1 BHCA statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //get the block of color + //blue + $blockcolor[0]=ImageColorAllocate($im,0,0,255); + //green + $blockcolor[1]=ImageColorAllocate($im,0,255,0); + //red + $blockcolor[2]=ImageColorAllocate($im,255,0,0); + imagefilledrectangle($im,90,350,100,360,$blockcolor[0]); + imagestring($im,2,105,350,$service_on_top_label[0],$text_color); + + imagefilledrectangle($im,260,350,270,360,$blockcolor[1]); + imagestring($im,2,275,350,$service_on_top_label[1],$text_color); + + imagefilledrectangle($im,430,350,440,360,$blockcolor[2]); + imagestring($im,2,445,350,$service_on_top_label[2],$text_color); + + //==get the max num of y scale===== + $maxYNum=0; + for($i=0;$i<$slot*24;$i++) + { + $bhca_e1_mangdays[2][$i]=$bhca_e1_mangdays[0][$i]+$bhca_e1_mangdays[1][$i]; + if($maxYNum<$bhca_e1_mangdays[2][$i]) + $maxYNum=$bhca_e1_mangdays[2][$i]; + } + + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + + //====draw the data line===== + for($type=0;$type<3;$type++) + { + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$bhca_e1_mangdays[$type][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$type]); + } + + //===draw the on top line again=== + $on_top_select=$on_top_select+0; + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$bhca_e1_mangdays[$on_top_select][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$on_top_select]); + + } + else if($csta_type==2) + { + $graphics_title="Trunk group ".$trunk_num." BHCA statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //get the block color + //blue + $blockcolor[0]=ImageColorAllocate($im,0,0,255); + //green + $blockcolor[1]=ImageColorAllocate($im,255,0,0); + imagefilledrectangle($im,90,350,100,360,$blockcolor[0]); + imagestring($im,2,105,350,$service_on_top_label[0],$text_color); + + imagefilledrectangle($im,220,350,230,360,$blockcolor[1]); + imagestring($im,2,235,350,$service_on_top_label[1],$text_color); + + $maxYNum=0; + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if(!isset($bhca_trunk_mangdays[$i][$j])) + $bhca_trunk_mangdays[$i][$j]=0.0; + if($maxYNum<$bhca_trunk_mangdays[$i][$j]) + $maxYNum=$bhca_trunk_mangdays[$i][$j]; + + //echo "g-$i-H-$j:{$bhca_trunk_mangdays[$i][$j]}
      "; + } + } + + //====draw the data line==== + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + + for($type=0;$type<2;$type++) + { + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$bhca_trunk_mangdays[$type][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$type]); + } + + //==draw the on top line again=== + $on_top_select=$on_top_select+0; + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$bhca_trunk_mangdays[$on_top_select][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$on_top_select]); + } + + //====the horizonal scale====== + + if($maxYNum<=10) + { + $maxYNum=20; + } + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $scale=$maxYNum / 10 * (10 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()-4000; + $filename=$tt.".png"; + if(1){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + flush(); + echo "

      "; + echo ""; + +adjust_content_tail(); +echo ""; +?> \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/dataDown.php b/wxc2_omc/performance/mscCsta/dataDown.php new file mode 100755 index 0000000..8fe4a12 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/dataDown.php @@ -0,0 +1,354 @@ + + + + +"; + +$DEBUG=0; + +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$timeItem = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$db = $csta_db; +$sort_field = 'csta_datetime'; //排序所依赖的字段名 +$sort_direction = 'DESC'; //排序顺序 +$number_records_to_display = 200; //每页纪录数 +$time_column = "csta_datetime"; //时间列名 +$sysType = isset($sysType)?$sysType:$DEFAULT_SYS; //设备名 +$csta_type = isset($csta_type)?$csta_type:'csta-h'; +$table_name = omc_table_name($sysType,$csta_type); //取得数据库名 +if($sysType == 'CNF' || $sysType == 'VPS'){ + $table_name="vpsDetail"; +} +$table_name = $table_name."_".$showDate; +$query_type = isset($query_type)?$query_type:'0'; //取得查询类型 +$where = isset($where) ? urldecode($where) : ''; //传回变量后解url码 +$where = isset($where) ? stripslashes($where) : ''; //解除一些'/' + +$sysIdFiled="key_sys_id"; +$subsysIdFiled="key_subsys_id"; +//echo "$table_name
      "; +$sel_field_list= @mysql_list_fields($db,$table_name); +if(!$sel_field_list) +{ + echo "
      $strNotFindRecord."; + exit(); +} + +//删除所查询的内容 +if($delete) +{ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//endif($delete) + +//跳转到指定页面 +if($go) +{ + $initial_record = $number_records_to_display * ( $gotopage - 1 ); + if($initial_record >= $number_of_records || $initial_record < 0) + { + echo ""; + $initial_record = 0; + } +}//endif($go) + +// 初始化变量 +if (!$number_of_records) +{ + //跳转页面不进行初始化 + //-------确定日期范围----- + if($sel_date<0){ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + }elseif($sel_date>0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + //where语句的类型限制组成部分$w0 + $w0=" key_type<17 "; + + //where语句的时间限制组成部分$w1 + $w1=" AND $time_column > '$bgn_date' AND $time_column <= '$end_date'"; + + //where语句的系统id限制组成部分$w2 + if($sys_num!='-1' && $sys_num!=''){ + $w2=" AND $sysIdFiled=$sys_num"; + } + + //where语句的子系统id限制组成部分$w3 + if($subsys_num!='-1' && $subsys_num!=''){ + $w3=" AND $subsysIdFiled=$subsys_num"; + } + + //where语句的E1id限制组成部分$w4 + if($e1_num!='-1' && $e1_num!='' && $query_type<5 && $query_type>0){ + $w4=" AND key_e1_tg=$e1_num"; + } + + //where语句的呼叫类型限制组成部分$w5 + if($query_type>0) + { + $w5=" AND key_type=$query_type "; + } + + if($sysType == 'VPS'){ + $w6=" AND key_type=1 "; + }elseif($sysType == 'CNF'){ + $w6=" AND key_type=2 "; + + } + //合成查询语句$where + $where=" WHERE ".$w0.$w1.$w2.$w3.$w4.$w5.$w6; + //echo "$where
      "; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + if ($DEBUG) echo "
      str_sql_all=$str_sql_all"; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo $strNotFindRecord; + exit(); + } //endif(!$number_of_records) +}//endif(!$number_of_records) + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +//插入日志 +if($page_num <=1) +{ + insertLog("CSTA data query",2,1); +} +//下面是控制分页显示,传递变量 +if ($number_of_records >= 1) +{ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if($prev_index < 0) + { + $prev_index = 0; + } +} +$show_initial_record=$initial_record+1; +?> + + + + + + + + +" > + + + +
      +  $show_initial_record - $next_index, ($strTotalRecords:$number_of_records )  "; + ?> +   + "; + echo "\"$strPreviousPage\" "; + } + + + // NEW: Display a link for the next set of records. + if ($next_index != $number_of_records && $number_of_records >0 && $number_of_records > $number_records_to_display ) + { + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&sys_id=$sys_id&sysType=$sysType&csta_type=$csta_type&query_type=$query_type"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + echo "\"$strNextPage\""; + } + ?> +
      + +
      + +"; + $csta_result = mysqli_query($pubConn,$csta_sql); + $csta_rows = mysqli_fetch_array($csta_result); + +?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + + +  
      TG
      + + + + + +
      + + + \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/dataIndex.php b/wxc2_omc/performance/mscCsta/dataIndex.php new file mode 100755 index 0000000..a9f8f05 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/dataIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/mscCsta/dataUp.php b/wxc2_omc/performance/mscCsta/dataUp.php new file mode 100755 index 0000000..13e5789 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/dataUp.php @@ -0,0 +1,147 @@ + + + + + + + + +
      +"; +echo ""; +echo ""; +echo "$strAdvanced > $strTitlePerformance > $sysType > $strData"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + +$sys_num= get_sys_total($device_name); +$subsys_num= get_subsys_total($device_name); +$e1_num= get_e1_total($device_name); +if($sysType == $DEFAULT_SYS){ + echo ""; + echo " "; +} +echo ""; +?> + + + + +"; +echo ""; +?> + + +"; +echo ""; +echo ""; + +?> + + + +
      + + + diff --git a/wxc2_omc/performance/mscCsta/e1_detail_down.php b/wxc2_omc/performance/mscCsta/e1_detail_down.php new file mode 100755 index 0000000..a301d3a --- /dev/null +++ b/wxc2_omc/performance/mscCsta/e1_detail_down.php @@ -0,0 +1,1042 @@ + + + + + + 0){ + echo ""; + }else{ + echo ""; + } +?> +
      + +"; + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as net_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,csta_datetime,key_sys_id,key_subsys_id "; + $from="from $table_name "; + + //=====in-e1 data====== + if($sel_in_out==0) + { + $e1_where="and key_type=1 "; + } + //====out-e1 data======= + else if($sel_in_out==1) + { + $e1_where="and key_type=2 "; + } + //===total-e1 data===== + else if($sel_in_out==2) + { + $e1_where="and key_type>0 and key_type<3 "; + } + + //echo "e1_no:$e1_no
      "; + if($e1_no>127) + { + $msc_no=1; + $e1_no_tmp=$e1_no-128; + } + else + { + $msc_no=0; + $e1_no_tmp=$e1_no; + } + + $where="where $time_column >'$from_time' and $time_column <='$to_time' and key_sys_id=$msc_no and key_e1_tg=$e1_no_tmp ".$e1_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + + for($tt=0;$tt<9;$tt++) + { + $csta_e1[$tt][$datetime+$day*24]+=$rows[$tt+1]; + } + }while($rows=mysqli_fetch_array($result)); + } + +//========================================================================================| +//==============================Fake Data for Test========================================| +//========================================================================================| +if(0) +{ + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if($i==0) + $csta_e1[$i][$j]=rand(200,300); + else + $csta_e1[$i][$j]=rand(10,100); + } + } +} +//========================================================================================| +//====================================Test Data===========================================| +//========================================================================================| +if(0) +{ + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if(!isset($csta_e1[$i][$j])) + $csta_e1[$i][$j]=0; + //echo "type-$i-hour-$j:{$csta_e1[$i][$j]}
      "; + } + } +} + +//========================================================================================| +//================================Draw the table-1========================================| +//========================================================================================| + //==table title=== + if($slot==1) + { + $title_date=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + if($sel_in_out==0) + { + $table_title="E1 #".$e1_no." (In) statistic Date:".$title_date; + } + else if($sel_in_out==1) + { + $table_title="E1 #".$e1_no." (Out) statistic Date:".$title_date; + } + else if($sel_in_out==2) + { + $table_title="E1 #".$e1_no." (In&Out) statistic Date:".$title_date; + } + } + else + { + $title_date_from=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $title_date_to=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + if($sel_in_out==0) + { + $table_title="E1 #".$e1_no." (In) statistic Date:".$title_date_from." to ".$title_date_to; + } + else if($sel_in_out==1) + { + $table_title="E1 #".$e1_no." (Out) statistic Date:".$title_date_from." to ".$title_date_to; + } + else if($sel_in_out==2) + { + $table_title="E1 #".$e1_no." (In&Out) statistic Date:".$title_date_from." to ".$title_date_to; + } + } + + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<24*$slot;$i++) + { + echo ""; + //===time column=== + echo ""; + //======attempt column====== + echo ""; + //========Success(answer) column====== + echo ""; + //=====call deny(barred) column========== + echo ""; + //=====Net busy column======= + echo ""; + //===caller clear column====== + echo ""; + //====sub busy column======= + echo ""; + //=====no answer column====== + echo ""; + //====signal error column====== + echo ""; + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + echo ""; + } + echo "
      TimeAttemptSuccessCall denyNet busyCaller clearSub busyNo answerSignal errorTotal call durationAverage call
      duration(s)
      "; + $hour_label=$i%24; + if($hour_label<10) + $hour_label="0".$hour_label."H"; + else + $hour_label=$hour_label."H"; + $day_label=floor($i/24); + $day_label=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day_label,date("Y"))); + echo "$day_label $hour_label"; + echo ""; + echo "{$csta_e1[0][$i]}"; + echo ""; + echo "{$csta_e1[1][$i]}"; + if($csta_e1[0][$i]==0) + $rate=0; + else + { + $rate=$csta_e1[1][$i]/$csta_e1[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_e1[2][$i]}"; + if($csta_e1[0][$i]==0) + $rate=0; + else + { + $rate=$csta_e1[2][$i]/$csta_e1[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_e1[3][$i]}"; + if($csta_e1[0][$i]==0) + $rate=0; + else + { + $rate=$csta_e1[3][$i]/$csta_e1[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_e1[4][$i]}"; + if($csta_e1[0][$i]==0) + $rate=0; + else + { + $rate=$csta_e1[4][$i]/$csta_e1[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_e1[5][$i]}"; + if($csta_e1[0][$i]==0) + $rate=0; + else + { + $rate=$csta_e1[5][$i]/$csta_e1[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_e1[6][$i]}"; + if($csta_e1[0][$i]==0) + $rate=0; + else + { + $rate=$csta_e1[6][$i]/$csta_e1[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_e1[7][$i]}"; + if($csta_e1[0][$i]==0) + $rate=0; + else + { + $rate=$csta_e1[7][$i]/$csta_e1[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_e1[8][$i]}(s)"; + $hour=floor($csta_e1[8][$i]/3600); + $minute=floor($csta_e1[8][$i]%3600/60); + $second=$csta_e1[8][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_e1[1][$i]!=0) + $ave=round($csta_e1[8][$i]/$csta_e1[1][$i]); + else + $ave=0; + echo "$ave"; + echo "
      "; +?> + +

      + +

      + +"; +echo ""; + if($answer_check==1) + { + echo "  Answer"; + $draw_line_flag[0]=1; + } + else + { + echo "  Answer"; + $draw_line_flag[0]=0; + } + if($call_barred_check==1) + { + echo "  Call barred"; + $draw_line_flag[1]=1; + } + else + { + echo "  Call barred"; + $draw_line_flag[1]=0; + } + if($network_busy_check==1) + { + echo "  Network busy"; + $draw_line_flag[2]=1; + } + else + { + echo "  Network busy"; + $draw_line_flag[2]=0; + } + if($call_clear_check==1) + { + echo "  Call clear"; + $draw_line_flag[3]=1; + } + else + { + echo "  Call clear"; + $draw_line_flag[3]=0; + } + if($sub_busy_check==1) + { + echo "  Sub busy"; + $draw_line_flag[4]=1; + } + else + { + echo "  Sub busy"; + $draw_line_flag[4]=0; + } + if($no_answer_check==1) + { + echo "  No answer"; + $draw_line_flag[5]=1; + } + else + { + echo "  No answer"; + $draw_line_flag[5]=0; + } + + if($signalling_timeout_check==1) + { + echo "  Signalling timeout"; + $draw_line_flag[6]=1; + } + else + { + echo "  Signalling timeout"; + $draw_line_flag[6]=0; + } +echo ""; +echo ""; +//========================================================================================| +//==============================Draw the Graphics-1=======================================| +//========================================================================================| + $sizex=835; + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //=====get the block legend color===== + $color[0]=ImageColorAllocate($im,0x66,0xff,0x33); + $color[1]=ImageColorAllocate($im,0x66,0xff,0xff); + $color[2]=ImageColorAllocate($im,0,0x66,0x66); + $color[3]=ImageColorAllocate($im,0x66,0,0xcc); + $color[4]=ImageColorAllocate($im,0x66,0x33,0); + $color[5]=ImageColorAllocate($im,0xcc,0,0x66); + $color[6]=ImageColorAllocate($im,0xff,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + $black_color=ImageColorAllocate($im,0,0,0); + + //====background===== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border=== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + //====draw the vertical line====== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //===draw the horizonal line====== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + + $tempstr=(10-$i)*10; + $tempstr=$tempstr."%"; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, $tempstr, $text_color); + } + + //=======draw the block legend====== + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Success",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"Call deny",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"Net busy",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Caller clear",$text_color); + + imagefilledrectangle($im,450,350,460,360,$color[4]); + imagestring($im,2,465,350,"Sub busy",$text_color); + + imagefilledrectangle($im,540,350,550,360,$color[5]); + imagestring($im,2,555,350,"No answer",$text_color); + + imagefilledrectangle($im,630,350,640,360,$color[6]); + imagestring($im,2,645,350,"Signal error",$text_color); + + //======get the data line scale====== + for($j=0;$j<7;$j++) + { + for($i=0;$i<24*$slot;$i++) + { + if($csta_e1[0][$i]!=0) + $points_scale[$j][$i]['y']=floor(250*$csta_e1[$j+1][$i]/$csta_e1[0][$i]); + else + $points_scale[$j][$i]['y']=0; + $points_scale[$j][$i]['y']=25+250-$points_scale[$j][$i]['y']; + $points_scale[$j][$i]['x']=60+30*$i/$slot; + //echo "line-$j-point-$i-x:{$points_scale[$j][$i]['x']}
      "; + //echo "line-$j-point-$i-y:{$points_scale[$j][$i]['y']}
      "; + } + } + + //=====draw the data line====== + for($i=0;$i<7;$i++) + { + if($draw_line_flag[$i]!=0) + { + for($j=0;$j<24*$slot-1;$j++) + { + imageline($im,$points_scale[$i][$j]['x'],$points_scale[$i][$j]['y'],$points_scale[$i][$j+1]['x'],$points_scale[$i][$j+1]['y'],$color[$i]); + } + } + } + + /* + //====draw the on top line againg===== + for($j=0;$j<24*$slot-1;$j++) + { + imageline($im,$points_scale[$on_top_index][$j]['x'],$points_scale[$on_top_index][$j]['y'],$points_scale[$on_top_index][$j+1]['x'],$points_scale[$on_top_index][$j+1]['y'],$color[$on_top_index]); + } + */ + + //====show the graphics===== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()+515; + $filename="e13_".$tt.".png"; + if(!$DEBUG){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + echo ""; +?> + +

      +on top +

      + +1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //=======draw the block legend======= + imagefilledrectangle($image,90,350,100,360,$color[0]); + imagestring($image,2,105,350,"Total call duration",$text_color); + + imagefilledrectangle($image,280,350,290,360,$color[1]); + imagestring($image,2,295,350,"Average call duration",$text_color); + + imagestring($image,2,10,5,"Total call duration",$text_color); + imagestring($image,2,700,5,"Average call duration",$text_color); + + //======get the biggest y scale of left====== + for($i=0;$i<$slot*24;$i++) + { + if($maxYNum_left<$csta_e1[8][$i]) + $maxYNum_left=$csta_e1[8][$i]; + if($csta_e1[1][$i]==0) + $average[$i]=0; + else + $average[$i]=round($csta_e1[8][$i]/$csta_e1[1][$i]); + if($maxYNum_right<$average[$i]) + $maxYNum_right=$average[$i]; + } + if($maxYNum_left==0) + $maxYNum_left=100; + if($maxYNum_right==0) + $maxYNum_right=10; + + //======get the data line scale===== + for($i=0;$i<$slot*24;$i++) + { + //get the total call duration scale + $total_call_duration_scale[$i]['x']=60+30*$i/$slot; + $total_call_duration_scale[$i]['y']=floor(250*$csta_e1[8][$i]/$maxYNum_left); + $total_call_duration_scale[$i]['y']=25+250-$total_call_duration_scale[$i]['y']; + //get the average call duraiton scale + $average_call_duration_scale[$i]['x']=60+30*$i/$slot; + $average_call_duration_scale[$i]['y']=floor(250*$average[$i]/$maxYNum_right); + $average_call_duration_scale[$i]['y']=25+250-$average_call_duration_scale[$i]['y']; + //echo "hour-$i:{$total_call_duration_scale[$i]['y']}
      "; + } + for($j=0;$j<24*$slot-1;$j++) + { + //draw the total duration call data line + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + //draw the average duration call data line + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + + //======draw the on top data line again====== + if(!isset($on_top_index_down)) + $on_top_index_down=0; + for($j=0;$j<24*$slot-1;$j++) + { + if($on_top_index_down==0) + { + //draw the total duration call data line + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + } + else + { + //draw the average duration call data line + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + } + + + + //====draw the horizonal line=== + //the left y scale label + $unit=$maxYNum_left/10; + $style=array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($image, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." min"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 54, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //=====the right y scale label=== + $unit=$maxYNum_right/10; + for($i=0;$i<10;$i++){ + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." m"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 50+780, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //===show the graphics==== + //-----输出图形文件,请勿修改 + $tt=time()+1500; + $filename="e14_".$tt.".png"; + if(!$DEBUG){ + ImagePng ($image,"$filename"); + ImageDestroy($image); + } + echo "

      "; +?> \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/e1_detail_index.php b/wxc2_omc/performance/mscCsta/e1_detail_index.php new file mode 100755 index 0000000..7d50c43 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/e1_detail_index.php @@ -0,0 +1,31 @@ + + + "; + echo ""; + ?> + + diff --git a/wxc2_omc/performance/mscCsta/e1_detail_up.php b/wxc2_omc/performance/mscCsta/e1_detail_up.php new file mode 100755 index 0000000..26034eb --- /dev/null +++ b/wxc2_omc/performance/mscCsta/e1_detail_up.php @@ -0,0 +1,141 @@ + + + + +"; + $helpId="3.2.3"; + showHelp($helpId); + echo "

      "; + //=================================test======================================= + //echo "e1_no:$e1_no
      "; + //echo "sel_date_from:$sel_date_from
      "; + //echo "sel_date_to:$sel_date_to
      "; + //echo "in_out:$sel_in_out
      "; + //==================get the parameter the previous transfer==================== + $old_sel_date_from=$sel_date_from; + $old_sel_date_to=$sel_date_to; + $old_sel_in_out=$sel_in_out; + //===========================page title======================================== + echo ""; + echo "
      "; + echo "$strTitlePerformance > MSC > E1"; + echo "
      "; + //=======================data initial========================================== + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($e1_no)) + $e1_no=0; + if(!isset($sel_in_out)) + $sel_in_out=0; + if(!isset($on_top_index)) + $on_top_index=0; + //selection date define + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + + //===================the back link button====================================== + echo "
      "; + echo "back"; + echo "
      "; +?> + + + + + + + + + +  "; + } + ?> +
      + "; + ?> + + + + + + to + + + + + +
      + +
      +
      + +
      + +
      \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/e1_general_down.php b/wxc2_omc/performance/mscCsta/e1_general_down.php new file mode 100755 index 0000000..ffcacf7 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/e1_general_down.php @@ -0,0 +1,817 @@ + + + 0){ + echo ""; + }else{ + echo ""; + } +?> + +"; + if($default_initValue==$rows[initValue]) + continue; + + $trunk_no=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0; + //echo "$trunk_no
      "; + $value=$rows['initValue']; + $value=substr($value,28,20); + //echo "trunk_no:$trunk_no $value
      "; + //=====change the hex to ansi char====== + $temp=""; + for($num=0;$num<10;$num++) + { + $str=substr($value,$num*2,2); + $str=hexdec($str); + $str=chr($str); + $temp.=$str; + } + //echo "$temp
      "; + $trunk_element_title[$trunk_no]=$temp; + }while($rows=mysqli_fetch_array($result)); + } + + //====Fix the title==== + for($i=0;$i<256;$i++) + { + $trunk_element_title[$i]=trim($trunk_element_title[$i]); + if($trunk_element_title[$i]=="") + $trunk_element_title[$i]="--"; + if($i==253||$i==254) + { + $trunk_element_title[$i]="LoopBack$i"; + } + } + + if(!$DEBUG) + { + //=======get the e1 belong trunk no====== + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=2 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + exit("No record"); + do{ + $e1_no=$rows['instanceNo']; + //echo "$e1_no
      "; + $value=$rows['initValue']; + $value=trim($value); + //echo "$value
      "; + $t_g=hexdec($value); + $e1_element_title[$e1_no]=$trunk_element_title[$t_g]; + //echo "e1_no:$e1_no {$e1_element_title[$e1_no]}
      "; + }while($rows=mysqli_fetch_array($result)); + //======get the e1 status====== + $database="OBJ_322"; + $sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=4 "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + exit("No record"); + do{ + $e1_no=$rows['instanceNo']; + //echo "$e1_no
      "; + $value=$rows['initValue']; + $value=trim($value); + $value=substr($value,1,1); + //echo "$value
      "; + switch($value) + { + //lock + case '0': + case '1': + case '4': + case '5': + case '8': + case '9': + case 'C': + case 'D': $e1_status[$e1_no]=0;break; + //unlock + case '2': + case '3': + case '6': + case '7': + case 'A': + case 'B': + case 'E': + case 'F': $e1_status[$e1_no]=1;break; + } + + //echo "e1_no:$e1_no {$e1_element_title[$e1_no]} e1_status:{$e1_status[$e1_no]}
      "; + }while($rows=mysqli_fetch_array($result)); + } +//========Fake data================ +if(1) +{ + //====title====== + for($i=0;$i<256;$i++) + { + $trunk_element_title[$i]="TG ".$i; + $e1_element_title[$i]="TG ".$i; + $e1_status[$i]=1;//rand(0,2); + } +} +//========================================================================================| +//===========================Get Data from DB=============================================| +//========================================================================================| + $db=$csta_db; + $slot=$sel_date_from-$sel_date_to+1; + $time_column="csta_datetime"; + + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day+1,date("Y"))); + + //echo "table_name:$table_name
      "; + //echo "from_time:$from_time
      "; + //echo "to_time:$to_time
      "; + //echo "in_out:$sel_in_out
      "; + if($sel_in_out==0) + $e1_where="and key_type=1 "; + else if($sel_in_out==1) + $e1_where="and key_type=2 "; + else + $e1_where="and key_type>0 and key_type<3 "; + + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,key_sys_id,key_subsys_id "; + $from="from $table_name "; + $where="where $time_column >'$from_time' and $time_column <='$to_time' ".$e1_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "sql:$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(1) + { + if($rows) + { + do{ + $msc_no=$rows[key_sys_id]+0; + $e1_no=$rows[0]+0; + + for($tt=0;$tt<9;$tt++) + { + $e1_csta[$msc_no*128+$e1_no][$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + } + } + + //====get the in_e1,out_e1,total_e1==== + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day+1,date("Y"))); + + //====in-e1 data====== + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,key_sys_id,key_subsys_id "; + $from="from $table_name "; + $e1_where="and key_type=1 "; + $where="where $time_column >'$from_time' and $time_column <='$to_time' ".$e1_where; + $group="group by key_e1_tg,key_sys_id "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "sql=$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(1) + { + if($rows) + { + do{ + $e1_no=$rows[0]+0; + $msc_no=$rows['key_sys_id']+0; + if($e1_status[$e1_no+$msc_no*128]==0) + continue; + for($tt=0;$tt<9;$tt++) + { + $in_e1[$tt]+=$rows[$tt+1]; + } + }while($rows=mysqli_fetch_array($result)); + } + } + //====out_e1 data====== + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,key_sys_id,key_subsys_id "; + $from="from $table_name "; + $e1_where="and key_type=2 "; + $where="where $time_column >'$from_time' and $time_column <='$to_time' ".$e1_where; + $group="group by key_e1_tg,key_sys_id "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "sql=$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(1) + { + if($rows) + { + do{ + $e1_no=$rows[0]+0; + $msc_no=$rows['key_sys_id']+0; + //echo "msc-$msc_no
      "; + if($e1_status[$e1_no+$msc_no*128]==0) + continue; + for($tt=0;$tt<9;$tt++) + { + $out_e1[$tt]+=$rows[$tt+1]; + } + }while($rows=mysqli_fetch_array($result)); + } + } + //====total_e1 data===== + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,key_sys_id,key_subsys_id "; + $from="from $table_name "; + $e1_where="and key_type>0 and key_type<3 "; + $where="where $time_column >'$from_time' and $time_column <='$to_time' ".$e1_where; + $group="group by key_e1_tg,key_sys_id "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + + //echo "sql=$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(1) + { + if($rows) + { + do{ + $e1_no=$rows[0]+0; + $msc_no=$rows['key_sys_id']+0; + //echo "msc-$msc_no
      "; + if($e1_status[$e1_no+$msc_no*128]==0) + { + //$e1_no=$e1_no+$msc_no*128; + //echo "$e1_no
      "; + continue; + } + for($tt=0;$tt<9;$tt++) + { + $total_e1[$tt]+=$rows[$tt+1]; + } + }while($rows=mysqli_fetch_array($result)); + } + } + } + + + +//========================================================================================| +//============================Fake Data===================================================| +//========================================================================================| +if(0) +{ + for($i=0;$i<256;$i++) + { + for($j=0;$j<9;$j++) + { + if($i==0) + $e1_csta[$i][$j]=rand(200,300); + else + $e1_csta[$i][$j]=rand(10,100); + } + } +} + +if(0) +{ + for($i=0;$i<9;$i++) + { + $in_e1[$i]=rand(10,100); + $out_e1[$i]=rand(10,100); + $total_e1[$i]=$in_e1[$i]+$out_e1[$i]; + } +} + +//========================================================================================| +//===========================Test the data================================================| +//========================================================================================| +if(0) +{ + for($i=0;$i<9;$i++) + { + echo "in-type-$i:
      {$in_e1[$i]}
      "; + echo "out-type-$i:
      {$out_e1[$i]}
      "; + echo "total-type-$i:
      {$total_e1[$i]}
      "; + } +} +//========================================================================================| +//========================Draw the table-1================================================| +//========================================================================================| + $title_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + if($slot==1) + $table_title="E1 statistic Date:".$title_time; + else + $table_title="E1 statistic Date:".$title_time." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + echo "
      $table_title
      "; + echo ""; + if($sel_in_out==0) + $temp="In"; + else if($sel_in_out==1) + $temp="Out"; + else if($sel_in_out==2) + $temp="In&Out"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<256;$i++) + { + if($e1_status[$i]==0) + continue; + echo ""; + echo ""; + echo ""; + for($j=0;$j<9;$j++) + { + echo ""; + } + //=====average call duration========= + echo ""; + echo ""; + } + echo "
       $temp
      E1 No.Element TitleAttemptSuccessCall denyNet busyCaller clearSub busyNo answerSignal errorTotal call durationAverage call
      duration(s)
      $i{$e1_element_title[$i]}"; + if($j==0) + echo "{$e1_csta[$i][$j]}"; + if($j>0&&$j<8) + { + echo "{$e1_csta[$i][$j]}"; + echo "
      "; + if($e1_csta[$i][0]==0) + $rate=0; + else + { + $rate=$e1_csta[$i][$j]/$e1_csta[$i][0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + if($rate==0) + $rate=0; + echo "$rate%"; + } + if($j==8) + { + echo "{$e1_csta[$i][$j]}(s)"; + $hour=floor($e1_csta[$i][$j]/3600); + $minute=floor($e1_csta[$i][$j]%3600/60); + $second=$e1_csta[$i][$j]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + } + echo "
      "; + if($e1_csta[$i][1]!=0) + $ave=round($e1_csta[$i][8]/$e1_csta[$i][1]); + else + $ave=0; + echo "$ave"; + echo "
      "; + +//========================================================================================| +//===========================Draw the table-2=============================================| +//========================================================================================| + echo "
      $table_title
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //=====in e1 data====== + echo ""; + echo ""; + for($i=0;$i<7;$i++) + { + echo ""; + } + echo ""; + + //=====out e1 data======= + echo ""; + echo ""; + for($i=0;$i<7;$i++) + { + echo ""; + } + echo ""; + + //====total e1 data======= + echo ""; + echo ""; + for($i=0;$i<7;$i++) + { + echo ""; + } + echo "
      2.Success/failure
      TypeSuccessCall denyNet busyCaller clearSub busyNo answerSignal error
      In"; + if($in_e1[0]!=0) + { + $rate=$in_e1[$i+1]/$in_e1[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo "
      Out"; + if($out_e1[0]!=0) + { + $rate=$out_e1[$i+1]/$out_e1[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo "
      In&Out"; + if($total_e1[0]!=0) + { + $rate=$total_e1[$i+1]/$total_e1[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo "
      "; + +//========================================================================================| +//============================Draw the graphics-1=========================================| +//========================================================================================| + echo "

      3.In/Out(Attempt Call)
      "; + $sizex=510; + $sizey=240; + $im = ImageCreate ($sizex, $sizey); + $background_color=ImageColorAllocate($im,255,255,255); + imageLine($im,0,0,0,200,$black_color); + imageLine($im,0,200,600,200,$black_color); + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + $white_color=ImageColorAllocate($im,255,255,255); + $black_color=ImageColorAllocate($im,0,0,0); + $color[0]=ImageColorAllocate($im,0x33,0x33,0xff); + $color[1]=ImageColorAllocate($im,0x66,0xaa,0); + + //====background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + imageLine($im,40,20,40,200,$black_color); + imageLine($im,40,20,490,20,$black_color); + imageLine($im,490,200,490,20,$black_color); + imageLine($im,40,200,490,200,$black_color); + + //====draw the horizonal line======= + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=490; + $y2=$y1; + if($i!=10) + imageline($im,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + + imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + + //======draw the vitical line==== + $u=floor(450/9); + for($i=0;$i<10;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color); + } + + //=====get the two block height==== + if($total_e1[0]==0) + { + $in_e1_percent="0%"; + $out_e1_percent="0%"; + $height[0]=0; + $heighr[1]=0; + } + else + { + $in_e1_percent=change_percent($in_e1[0]/$total_e1[0]); + $out_e1_percent=change_percent($out_e1[0]/$total_e1[0]); + $height[0]=floor(180*$in_e1[0]/$total_e1[0]); + $height[1]=floor(180*$out_e1[0]/$total_e1[0]); + } + + //======draw the data block===== + for($i=0;$i<2;$i++) + { + $x1=90+(4*$i+1)*50; + if($height[$i]==0) + $height[$i]=1; + $y1=200-$height[$i]; + $x2=90+(4*$i+2)*50; + $y2=199; + imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]); + } + + //=====draw the legend string===== + imagestring($im,2,160,205,"In",$black_color); + imagestring($im,2,138,220,"(".$in_e1_percent.")",$black_color); + imagestring($im,2,355,205,"Out",$black_color); + imagestring($im,2,335,220,"(".$out_e1_percent.")",$black_color); + + //====show the service attempt graphics===== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()+34; + $filename="e11_".$tt.".png"; + if(1) + { + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + echo ""; + +//========================================================================================| +//===========================Draw the Graphics-2==========================================| +//========================================================================================| + echo "

      4.Success/Failure
      "; + $sizex=600; + $sizey=250; + $image=imagecreate($sizex,$sizey); + $bgcolor=imagecolorallocate($image,255,255,255); + $black_color=ImageColorAllocate($image,0,0,0); + $white_color=imagecolorallocate($image,255,255,255); + $bgcolor=F8F8F8; + $fgcolor=000000; + $color[0]=ImageColorAllocate($image,0x33,0x33,0xff); + $color[1]=ImageColorAllocate($image,0x66,0xaa,0); + $background_color = ImageColorAllocate ($image, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($image, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //===background==== + ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198)); + ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color); + + imageLine($image,40,20,40,200,$black_color); + imageLine($image,40,20,580,20,$black_color); + imageLine($image,580,200,580,20,$black_color); + imageLine($image,40,200,580,200,$black_color); + + //======draw the horizonal line===== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=580; + $y2=$y1; + if($i!=10) + imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + + imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + + //=====draw the vitical line====== + $u=floor(540/15); + for($i=0;$i<16;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color); + } + + //======get the block height====== + for($j=0;$j<7;$j++) + { + if($total_e1[0]==0) + $total_height[$j][0]=1; + else + { + $total_height[$j][0]=floor(180*$in_e1[$j+1]/$total_e1[0]); + } + } + for($j=0;$j<7;$j++) + { + if($total_e1[0]==0) + $total_height[$j][1]=1; + else + { + $total_height[$j][1]=floor(180*$out_e1[$j+1]/$total_e1[0]); + } + } + + //=======draw the data block===== + for($i=0;$i<7;$i++) + { + for($j=0;$j<2;$j++) + { + if($total_height[$i][$j]<1) + $total_height[$i][$j]=1; + //echo "lie-$i-hang-$j-{$total_height[$i][$j]}
      "; + $x1=40+(2*$i+1)*36; + $y1=199; + for($z=0;$z<$j+1;$z++) + { + $y1=$y1-$total_height[$i][$z]; + } + $x2=40+(2*$i+2)*36; + $y2=199; + for($z=0;$z<$j;$z++) + { + $y2=$y2-$total_height[$i][$z]; + } + + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]); + } + } + + //======draw the legend string====== + imagefilledrectangle($image,170,230,185,245,$color[0]); + imagestring($image,2,190,230,"In",$black_color); + imagefilledrectangle($image,360,230,375,245,$color[1]); + imagestring($image,2,380,230,"Out",$black_color); + + imagestring($image,2,75,205,"Success",$black_color); + imagestring($image,2,138,205,"Call deny",$black_color); + imagestring($image,2,215,205,"Net busy",$black_color); + imagestring($image,2,294,200,"Caller",$black_color); + imagestring($image,2,297,212,"clear",$black_color); + imagestring($image,2,363,205,"SubBusy",$black_color); + imagestring($image,2,433,205,"No answer",$black_color); + imagestring($image,2,508,200,"Signal",$black_color); + imagestring($image,2,510,212,"error",$black_color); + //=====show the answer failure graphics======= + $tt=time()-525; + $file_name="e12_".$tt.".png"; + imagepng($image,$file_name); + imagedestroy($image); + echo ""; +?> + + diff --git a/wxc2_omc/performance/mscCsta/e1_general_index.php b/wxc2_omc/performance/mscCsta/e1_general_index.php new file mode 100755 index 0000000..378ec01 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/e1_general_index.php @@ -0,0 +1,28 @@ + + + "; + echo ""; + ?> + \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/e1_general_up.php b/wxc2_omc/performance/mscCsta/e1_general_up.php new file mode 100755 index 0000000..1a8343f --- /dev/null +++ b/wxc2_omc/performance/mscCsta/e1_general_up.php @@ -0,0 +1,188 @@ + + + + +"; +echo "$strTitlePerformance > MSC > E1"; +echo ""; +echo "

      "; +$helpId="3.2.3"; +showHelp($helpId); +echo "
      "; +?> + + + + + + + + + + + + + + +  "; + } + //========================wether the select time slot is one day================== + $slot=$sel_date_from-$sel_date_to+1; + //echo "slot:$slot
      "; + if($slot==1) + { + //===============================from_hour text================================= + echo ""; + //===============================from_minute text================================ + echo ""; + //===============================from_second text================================ + echo ""; + //===============================to_hour text===================================== + echo ""; + //===============================to_minute text=================================== + echo ""; + //==============================to_second text==================================== + echo ""; + } + else + { + //===============================from_hour hidden================================= + echo ""; + //===============================from_minute hidden================================ + echo ""; + //===============================from_second hidden================================ + echo ""; + //===============================to_hour hidden===================================== + echo ""; + //===============================to_minute hidden=================================== + echo ""; + //==============================to_second hidden==================================== + echo ""; + } + ?> + +
      + + + to + + + + +
      + + Search +
      +
      + + + + + +
      + +
      + +
      +
      + \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/erlang.php b/wxc2_omc/performance/mscCsta/erlang.php new file mode 100755 index 0000000..bc1e873 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/erlang.php @@ -0,0 +1,1959 @@ + + + + + + + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + + } +echo "
      "; +//=======================================================================================| +//======== Data Initial when run first ========================| +//=======================================================================================| +if(!isset($csta_type)) + $csta_type=0; +if(!isset($select_date)) + $select_date=0; +if(!isset($sel_date)) + $sel_date=0; +if(!isset($trunk_num)) + $trunk_num="1,2"; +if(!isset($on_top_index)) + $on_top_index=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sub_sub_flag)) +{ + $sub_sub_flag=0; + $sub_loc_flag=0; + $tru_tol_flag=0; + $tru_sub_flag=0; + $tru_tru_flag=0; + $tru_ip_flag=0; + $sub_ip_flag=0; + $inter_flag=0; + $mo_flag=0; + $mt_flag=0; + $in_tru_flag=0; + $out_tru_flag=0; + $ip_inter_flag=0; +} + +$DEBUG=0; +adjust_head(); +adjust_title_head(); +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "$strTitlePerformance > MSC > $strErlang"; +echo ""; +$helpId="3.2.4"; +showHelp($helpId); +echo "
      "; + +//======up csta_type selection======== +$csta_type_label=array("Service","E1","Trunk group"); +echo ""; + +//======date selection====== +echo ""; + +//===search button===== +echo ""; + echo "$strSearch"; +echo ""; + +echo ""; + +//====printer button=== +echo ""; + echo ""; +echo ""; + +echo "
      "; + +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> +"; + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + $select="select key_type,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime==23) + continue; + //echo "datetime=$datetime
      "; + $erlang_service_oneday[$index][$datetime+1]+=$rows[duration]; + //echo "{$erlang_service_oneday[$index][$datetime]}
      "; + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + $select="select key_type,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + + //echo "datetime=$datetime
      "; + $erlang_service_oneday[$index][0]+=$rows[duration]; + //echo "{$erlang_service_oneday[$index][$datetime]}
      "; + }while($rows=mysqli_fetch_array($result)); + } + + //======Fake Data======= + if($DEBUG) + { + for($i=0;$i<13;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_service_oneday[$i][$j]=rand(10,100); + } + } + } + + //=====Test the Data===== + if(0) + { + $test_service_type_label=array("SUB SUB","SUB LOC","TRK TOLL","TRK SUB","TRK TRK","SUB IP", + "TRK IP","INTER","MO","MT","IN TRK","OUT TRK","IP"); + for($i=0;$i<13;$i++) + { + for($j=0;$j<24;$j++) + { + echo "{$test_service_type_label[$i]}--$j--{$erlang_service_oneday[$i][$j]}
      "; + } + } + } + + //=====Fix the Data===== + for($i=0;$i<12;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_service_oneday[$i][$j]=change2point($erlang_service_oneday[$i][$j]/3600); + } + } + + //====show the table-1==== + $table_title="Service"." Erlang Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); //table title + $service_type_label=array("Subs to subs","Subs to trunk","Trunk to subs","Trunk to trunk","Intraconnection", + "Sub to IP","Trunk to IP", + "Mobile originated","Mobile terminated","In trunk","Out trunk","IP terminated"); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<12;$i++) + { + echo ""; + echo ""; + for($j=0;$j<12;$j++) + { + echo ""; + } + echo ""; + + echo ""; + echo ""; + + echo ""; + for($j=0;$j<12;$j++) + { + echo ""; + } + echo ""; + echo ""; + for($j=12;$j<24;$j++) + { + echo ""; + } + echo ""; + echo ""; + for($j=12;$j<24;$j++) + { + echo ""; + } + echo ""; + + echo ""; + } + echo "
      Type"; + echo "Erlang(hour)"; + echo "
       $j
      {$service_type_label[$i]}
      {$erlang_service_oneday[$i][$j]}
      $j
      {$erlang_service_oneday[$i][$j]}
      "; + + +} +//=======================================================================================| +//=========== csta_type==1,E1 Table ================| +//=======================================================================================| +else if($csta_type==1) +{ + //=====Data define======= + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_e1_oneday[$i][$j]=0; + } + } + + //=====Get Data from DB====== + $device_name=isset($device_name)?$device_name:$DEFAULT_SYS; //device name + $db="CSTA_DB"; + $sys_entries=get_sys_total($device_name); + $subsys_entries=1; + $e1_entries=get_e1_total($device_name); + + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + + for($i=0;$i<$sys_entries;$i++) + { + $select="select key_sys_id,key_subsys_id,key_e1_tg,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY key_e1_tg,csta_datetime"; + $e1_where="AND key_type>0 AND key_type<3 "; + $where=" WHERE key_sys_id=$i AND key_subsys_id=0 AND csta_datetime >'$from_time' AND csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + $msc_no=$rows[0]+0; + $e1_no=$rows[2]+0; + + $erlang_e1_oneday[$msc_no*128+$e1_no][$datetime]=change2point(($rows[3]+0)/3600); + //echo "e1_data[$msc_no][0][$e1_no][$datetime]:{$e1_data[$msc_no][0][$e1_no][$datetime]}
      "; + }while($rows=@mysqli_fetch_array($result)); + } + } + + + //====Fake Data============ + if($DEBUG) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_e1_oneday[$i][$j]=rand(10,100); + } + } + } + + //====Get the sys-0 and sys-1 data===== + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + if($i<128) + $e1_sys1_sum[$j]+=$erlang_e1_oneday[$i][$j]; + else + $e1_sys2_sum[$j]+=$erlang_e1_oneday[$i][$j]; + } + } + + //====Test the Data====== + if(0) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + echo "E1-$i--Hour-$j--{$erlang_e1_oneday[$i][$j]}
      "; + } + } + } + + //=====show the table-1===== + $table_title="E1"." Erlang Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); //table title + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<24;$i++) + { + echo ""; + } + + //msc-0 + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + + for($i=0;$i<128;$i++) + { + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + } + + //msc=1 + echo ""; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + + for($i=128;$i<256;$i++) + { + echo ""; + $temp=$i-128; + echo ""; + for($j=0;$j<24;$j++) + { + echo ""; + } + echo ""; + } + echo "
      Equipment"; + echo "Erlang(hour)"; + echo "
      SystemE1$i
      MSC-0sys{$e1_sys1_sum[$j]}
      MSC-0$i{$erlang_e1_oneday[$i][$j]}
      MSC-1sys{$e1_sys2_sum[$j]}
      MSC-1$temp{$erlang_e1_oneday[$i][$j]}
      "; + + +} +//=======================================================================================| +//=========== csta_type==2,trunk group Table ================| +//=======================================================================================| +else if($csta_type==2) +{ + //=====Data define====== + for($i=0;$i<=256;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_trunk_oneday[$i][$j]=0; + } + } + + //=====Get the Data from DB====== + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date+1,date("Y"))); + + + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5"; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==TRUE) + { + $select_rows=mysqli_fetch_array($select_result); + + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $erlang_trunk_oneday[$gro][$datetime+1]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_oneday[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + //get the 0-hour of the day + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$select_date-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + + + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5"; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==TRUE) + { + $select_rows=mysqli_fetch_array($select_result); + + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $erlang_trunk_oneday[$gro][0]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_oneday[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + } + + + //=====Fake Data======== + if($DEBUG) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_trunk_oneday[$i][$j]=rand(10,100); + } + } + } + + //======Test the Data===== + if(0) + { + for($i=0;$i<256;$i++) + { + for($j=0;$j<24;$j++) + { + $erlang_trunk_oneday[$i][$j]=rand(10,100); + } + } + } + + //=====Show the table-1===== + $table_title="Trunk group Erlang Date:".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$select_date,date("Y"))); + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0;$i<24;$i++) + { + echo ""; + } + echo ""; + + for($i=1;$i<256;$i++) + { + echo ""; + $t=$i; + echo ""; + for($j=0;$j<24;$j++) + { + $erlang_trunk_oneday[$i][$j]=number_format($erlang_trunk_oneday[$i][$j], 2, '.', ''); + if($erlang_trunk_oneday[$i][$j]==0) + echo ""; + else + echo ""; + } + echo ""; + } + echo "
       "; + echo "Erlang(hour)"; + echo "
      TG$i
      $t{$erlang_trunk_oneday[$i][$j]}{$erlang_trunk_oneday[$i][$j]}
      "; + + +} + +//=======================================================================================| +//======== Down Selection ============| +//=======================================================================================| +//====date from selection===== +//echo "sel_date_from:$sel_date_from--sel_date_to:$sel_date_to
      "; +echo "

      "; +echo ""; +echo ""; + + echo ""; + echo ""; + //=====trunk number text for trunk===== + echo ""; + echo ""; + + //====search button===== + echo ""; + + + + + //====on top selection====== + //echo "csta_type:$csta_type
      "; + if($csta_type==0) + { + echo "
      "; + echo ""; + echo "to"; + echo ""; + echo " "; + if($csta_type==2) + { + echo ""; + } + //hide the trunk_num selection + else + { + echo ""; + } + echo ""; + echo "
      "; + echo "$strSearch"; + echo "
      "; + echo "
      "; + echo ""; + echo ""; + + echo ""; + + echo ""; + */ + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + } + else if($csta_type==1) + { + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + else if($csta_type==2) + { + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + } + + echo "
      "; + if($sub_sub_flag==1) + { + $line_select[0]=1; + echo ""; + } + else + { + $line_select[0]=0; + $lineOnTop=0; + echo ""; + } + echo "SUB SUB"; + if($sub_loc_flag==1) + { + $line_select[1]=1; + echo ""; + } + else + { + $line_select[1]=0; + $lineOnTop=1; + echo ""; + } + echo "SUB TRK"; + /* delete the sub to tol + if($tru_tol_flag==1) + { + $line_select[2]=1; + echo ""; + } + else + { + $line_select[2]=0; + echo ""; + } + echo "TRK TOLL"; + + if($tru_sub_flag==1) + { + $line_select[2]=1; + echo ""; + } + else + { + $line_select[2]=0; + $lineOnTop=2; + echo ""; + } + echo "TRK SUB"; + if($tru_tru_flag==1) + { + $line_select[3]=1; + echo ""; + } + else + { + $line_select[3]=0; + $lineOnTop=3; + echo ""; + } + echo "TRK TRK"; + if($inter_flag==1) + { + $line_select[4]=1; + echo ""; + } + else + { + $line_select[4]=0; + $lineOnTop=4; + echo ""; + } + echo "INTRA"; + if($sub_ip_flag==1) + { + $line_select[5]=1; + echo ""; + } + else + { + $line_select[5]=0; + $lineOnTop=5; + echo ""; + } + echo "SUB IP"; + if($tru_ip_flag==1) + { + $line_select[6]=1; + echo ""; + } + else + { + $line_select[6]=0; + $lineOnTop=6; + echo ""; + } + echo "TRK IP"; + if($mo_flag==1) + { + $line_select[7]=1; + echo ""; + } + else + { + $line_select[7]=0; + $lineOnTop=7; + echo ""; + } + echo "MO"; + if($mt_flag==1) + { + $line_select[8]=1; + echo ""; + } + else + { + $line_select[8]=0; + $lineOnTop=8; + echo ""; + } + echo "MT"; + if($in_tru_flag==1) + { + $line_select[9]=1; + echo ""; + } + else + { + $line_select[9]=0; + $lineOnTop=9; + echo ""; + } + echo "IN TRK"; + if($out_tru_flag==1) + { + $line_select[10]=1; + echo ""; + } + else + { + $line_select[10]=0; + $lineOnTop=10; + echo ""; + } + echo "OUT TRK"; + if($ip_inter_flag==1) + { + $line_select[11]=1; + echo ""; + } + else + { + $line_select[11]=0; + $lineOnTop=11; + echo ""; + } + echo "IP "; + echo "on top"; + echo " "; + echo "on top"; + echo "
      "; +//=======================================================================================| +//=========== Test before draw graphics ================| +//=======================================================================================| +if(0) +{ + $test_csta_type_label=array("Service","E1","Trunk"); + $slot=$sel_date_from-$sel_date_to+1; + echo "Type----{$test_csta_type_label[$csta_type]}
      "; + echo "Time----sigle $sel_date From $sel_date_from to $sel_date_to slot:$slot
      "; + echo "Service flag-----$sub_sub_flag $sub_loc_flag $tru_tol_flag $tru_sub_flag $tru_tru_flag $sub_ip_flag $tru_ip_flag $inter_flag $mo_flag $mt_flag $in_tru_flag $out_tru_flag $ip_inter_flag
      "; + echo "Trunk num----$trunk_num
      "; + echo "on top index----$on_top_index
      "; +} + + + +//=======================================================================================| +//=========== csta_type==0,service Graphics ================| +//=======================================================================================| +$slot=$sel_date_from-$sel_date_to+1; +if($csta_type==0) +{ + //====Data define==== + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $erlang_service_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql

      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime == 23) + continue; + //echo "datetime:$datetime
      "; + $erlang_service_mangdays[$index][$datetime+1+24*$day]+=$rows[duration]; + + }while($rows=mysqli_fetch_array($result)); + } + + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime,key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql

      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if($rows) + { + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + $datetime=substr($rows[csta_datetime],11,2)+0; + + //echo "datetime:$datetime
      "; + $erlang_service_mangdays[$index][24*$day]+=$rows[duration]; + + }while($rows=mysqli_fetch_array($result)); + } + + } + + //====Fix the data==== + for($i=0;$i<12;$i++) + { + for($day=0;$day<$slot*24;$day++) + { + $erlang_service_mangdays[$i][$day]=change2point($erlang_service_mangdays[$i][$day]/3600); + } + } + + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $erlang_service_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_service_type_label=array("SUB SUB","SUB LOC","TRK TOLL","TRK SUB","TRK TRK","SUB IP", + "TRK IP","INTER","MO","MT","IN TRK","OUT TRK","IP"); + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_service_type_label[$i]}--$j--{$erlang_service_mangdays[$i][$j]}
      "; + } + } + } + + +} +//=======================================================================================| +//=========== csta_type==1,E1 Graphics ================| +//=======================================================================================| +else if($csta_type==1) +{ + //====Data define==== + for($i=0;$i<3;$i++) + { + /* + 0 IN + 1 OUT + 2 IN&OUT + */ + for($j=0;$j<24*$slot;$j++) + { + $erlang_e1_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + $device_name=isset($device_name)?$device_name:$DEFAULT_SYS; //device name + $db="CSTA_DB"; + $sys_entries=get_sys_total($device_name); + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + //echo "on_top_select:$on_top_select
      "; + + //===incoming e1=== + $select="select sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="AND key_type=1 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $erlang_e1_mangdays[0][$datetime]=change2point(($rows[0]+0)/3600); + + }while($rows=@mysqli_fetch_array($result)); + } + + //====outgoing e1===== + $select="select sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="AND key_type=2 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $erlang_e1_mangdays[1][$datetime]=change2point(($rows[0]+0)/3600); + + }while($rows=@mysqli_fetch_array($result)); + } + + //===in-out e1 + $select="select sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $group=" GROUP BY csta_datetime "; + $e1_where="and key_type>0 and key_type<3 "; + $where=" WHERE key_subsys_id=0 and csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$e1_where; + $erl_sql=$select.$from.$where.$group; + //echo "$erl_sql
      "; + $result=@mysqli_query($pubConn,$erl_sql); + $rows=@mysqli_fetch_array($result); + if($rows) + { + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime:$datetime
      "; + + $erlang_e1_mangdays[2][$datetime]=change2point(($rows[0]+0)/3600); + + }while($rows=@mysqli_fetch_array($result)); + } + } + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<3;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $erlang_e1_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_e1_type_label=array("In","Out","In&Out"); + for($i=0;$i<3;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_e1_type_label[$i]}--$j--{$erlang_e1_mangdays[$i][$j]}
      "; + } + } + } +} +//=======================================================================================| +//=========== csta_type==2,trunk Graphics ================| +//=======================================================================================| +else if($csta_type==2) +{ + + $trunk_index=explode(",",$trunk_num); + $trunk_index[0]=$trunk_index[0]; + $trunk_index[1]=$trunk_index[1]; + + //====Data define==== + for($i=0;$i<2;$i++) + { + /* + 0 The first trunk select + 1 The second trunk select + */ + for($j=0;$j<24*$slot;$j++) + { + $erlang_trunk_mangdays[$i][$j]=0; + } + } + + //====Get the Data from DB===== + //echo "slot:$slot
      "; + //trunk_num_select + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //tg 1 + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[0]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $erlang_trunk_mangdays[0][$datetime+1+24*$day]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + //tg 2 + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[1]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "

      $select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + if($datetime==23) + continue; + //echo "gro:$gro
      "; + //echo "ddatetime:$datetime
      "; + $erlang_trunk_mangdays[1][$datetime+1+24*$day]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $db="CSTA_DB"; + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + //tg 1 + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[0]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "$select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "datetime:$datetime
      "; + $erlang_trunk_mangdays[0][24*$day]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + //tg 2 + $select="select key_e1_tg,csta_datetime,sum(Duration) as duration "; + $from="from $table_name "; + $where=" where csta_datetime>='$from_time' and csta_datetime<'$to_time' and key_type>2 and key_type<5 and key_e1_tg={$trunk_index[1]} "; + $group=" group by key_e1_tg, csta_datetime "; + $order=" order by csta_datetime,key_e1_tg "; + $select_sql=$select.$from.$where.$group.$order; + //echo "

      $select_sql
      "; + $select_result=mysqli_query($pubConn,$select_sql); + if($select_result==FALSE) + exit("There is no data between ".$from_time." to ".$to_time.""); + $select_rows=mysqli_fetch_array($select_result); + if($select_rows) + { + do + { + //Get the hour + $datetime=substr($select_rows[csta_datetime],11,2)+0; + $gro=$select_rows[0]; + + //echo "gro:$gro
      "; + //echo "ddatetime:$datetime
      "; + $erlang_trunk_mangdays[1][24*$day]+=change2point($select_rows[duration]/3600); + //echo "group:$gro--time:$datetime=={$erlang_trunk_mangdays[$gro][$datetime]}
      "; + }while($select_rows=mysqli_fetch_array($select_result)); + } + + } + + //====Fake Data======= + if($DEBUG) + { + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $erlang_trunk_mangdays[$i][$j]=rand(10,100); + } + } + } + + //====Test Data====== + if(0) + { + $test_trunk_type_label=array("First","Second"); + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_trunk_type_label[$i]} {$trunk_index[$i]}--$j--{$erlang_trunk_mangdays[$i][$j]}
      "; + } + } + } +} + + +//=======================================================================================| +//=========== Draw the Graphics =============| +//=======================================================================================| + + $sizex=800; + if($csta_type==0) + $sizey=430; + else + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + //===background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //===border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + //====draw the horizonal line==== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + + if($csta_type==0) + { + //====graphics title===== + $graphics_title="Service erlang statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //===draw the label block==== + $color[0]=ImageColorAllocate($im,0x99,0x22,0x33); + $color[1]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($im,0x99,0x99,0x99); + $color[4]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($im,0xff,0x00,0x00); + $color[7]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($im,0x00,0x22,0xcc); + $color[11]=ImageColorAllocate($im,0xEE,0x00,0xff); + + + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"SUB SUB",$text_color); + + imagefilledrectangle($im,260,350,270,360,$color[1]); + imagestring($im,2,275,350,"SUB TRK",$text_color); + + imagefilledrectangle($im,430,350,440,360,$color[2]); + imagestring($im,2,445,350,"TRK SUB",$text_color); + + imagefilledrectangle($im,600,350,610,360,$color[3]); + imagestring($im,2,615,350,"TRK TRK",$text_color); + + imagefilledrectangle($im,90,370,100,380,$color[4]); + imagestring($im,2,105,370,"INTRA",$text_color); + + imagefilledrectangle($im,260,370,270,380,$color[5]); + imagestring($im,2,275,370,"SUB IP",$text_color); + + imagefilledrectangle($im,430,370,440,380,$color[6]); + imagestring($im,2,445,370,"TRK IP",$text_color); + + imagefilledrectangle($im,600,370,610,380,$color[7]); + imagestring($im,2,615,370,"MO",$text_color); + + imagefilledrectangle($im,90,390,100,400,$color[8]); + imagestring($im,2,105,390,"MT",$text_color); + + imagefilledrectangle($im,260,390,270,400,$color[9]); + imagestring($im,2,275,390,"IN TRK",$text_color); + + imagefilledrectangle($im,430,390,440,400,$color[10]); + imagestring($im,2,445,390,"OUT TRK",$text_color); + + imagefilledrectangle($im,600,390,610,400,$color[11]); + imagestring($im,2,615,390,"IP",$text_color); + + + //get the biggest Y-scale value + $maxYNum=0; + for($i=0;$i<12;$i++) + { + for($j=0;$j<$slot*24;$j++) + { + if(!isset($erlang_service_mangdays[$i][$j])) + $erlang_service_mangdays[$i][$j]=0.0; + if($line_select[$i]) + { + if($maxYNum<$erlang_service_mangdays[$i][$j]) + $maxYNum=$erlang_service_mangdays[$i][$j]; + } + //echo "g-$i-h-$j:{$erlang_service_mangdays[$i][$j]}
      "; + } + } + + + + //====get the points scale==== + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + for($i=0;$i<12;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $pointscale[$i][$j]['x']=60+30*$j/$slot; + $pointscale[$i][$j]['y']=25+(250-$erlang_service_mangdays[$i][$j]*25/$unitValue); + } + } + + + for($type_index=0;$type_index<12;$type_index++) + { + if($line_select[$type_index]==1) + { + for($i=0;$i<24*$slot-1;$i++){ + imageline($im,$pointscale[$type_index][$i]['x'],$pointscale[$type_index][$i]['y'],$pointscale[$type_index][$i+1]['x'],$pointscale[$type_index][$i+1]['y'],$color[$type_index]); + } + } + } + + //echo "lineTop=$lineTop
      "; + if($line_select[$lineTop]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y'],$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y'],$color[$lineTop]); + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y']+1,$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y']+1,$color[$lineTop]); + imageline($im,$pointscale[$lineTop][$i]['x'],$pointscale[$lineTop][$i]['y']+2,$pointscale[$lineTop][$i+1]['x'],$pointscale[$lineTop][$i+1]['y']+2,$color[$lineTop]); + + } + } + + + } + else if($csta_type==1) + { + $graphics_title="E1 erlang statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //get the block of color + //blue + $blockcolor[0]=ImageColorAllocate($im,0,0,255); + //green + $blockcolor[1]=ImageColorAllocate($im,0,255,0); + //red + $blockcolor[2]=ImageColorAllocate($im,255,0,0); + imagefilledrectangle($im,90,350,100,360,$blockcolor[0]); + imagestring($im,2,105,350,$service_on_top_label[0],$text_color); + + imagefilledrectangle($im,260,350,270,360,$blockcolor[1]); + imagestring($im,2,275,350,$service_on_top_label[1],$text_color); + + imagefilledrectangle($im,430,350,440,360,$blockcolor[2]); + imagestring($im,2,445,350,$service_on_top_label[2],$text_color); + + //==get the max num of y scale===== + $maxYNum=0; + for($i=0;$i<$slot*24;$i++) + { + $erlang_e1_mangdays[2][$i]=$erlang_e1_mangdays[0][$i]+$erlang_e1_mangdays[1][$i]; + //echo "in:{$in_data[$i]} out:{$out_data[$i]} total:{$total_data[$i]}
      "; + if($maxYNum<$erlang_e1_mangdays[2][$i]) + $maxYNum=$erlang_e1_mangdays[2][$i]; + } + + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + + //====draw the data line===== + for($type=0;$type<3;$type++) + { + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$erlang_e1_mangdays[$type][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$type]); + } + + //===draw the on top line again=== + $on_top_select=$on_top_select+0; + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$erlang_e1_mangdays[$on_top_select][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$on_top_select]); + + } + else if($csta_type==2) + { + $graphics_title="Trunk group ".$trunk_num." erlang statistic graphic"; + Imagestring($im, 2, 300,5, $graphics_title, $text_color); + + //get the block color + //blue + $blockcolor[0]=ImageColorAllocate($im,0,0,255); + //green + $blockcolor[1]=ImageColorAllocate($im,255,0,0); + imagefilledrectangle($im,90,350,100,360,$blockcolor[0]); + imagestring($im,2,105,350,$service_on_top_label[0],$text_color); + + imagefilledrectangle($im,220,350,230,360,$blockcolor[1]); + imagestring($im,2,235,350,$service_on_top_label[1],$text_color); + + $maxYNum=0; + for($i=0;$i<2;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if(!isset($erlang_trunk_mangdays[$i][$j])) + $erlang_trunk_mangdays[$i][$j]=0.0; + if($maxYNum<$erlang_trunk_mangdays[$i][$j]) + $maxYNum=$erlang_trunk_mangdays[$i][$j]; + + //echo "g-$i-H-$j:{$erlang_trunk_mangdays[$i][$j]}
      "; + } + } + + //====draw the data line==== + if($maxYNum<10) + $maxYNum=20; + $unitValue=$maxYNum/10; + + for($type=0;$type<2;$type++) + { + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$erlang_trunk_mangdays[$type][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$type]); + } + + //==draw the on top line again=== + $on_top_select=$on_top_select+0; + for($i=0;$i<24*$slot;$i++) + { + $pointscale[$i]['x']=60+30*$i/$slot; + $pointscale[$i]['y']=25+(250-$erlang_trunk_mangdays[$on_top_select][$i]*25/$unitValue); + } + for($i=0;$i<24*$slot-1;$i++) + imageline($im,$pointscale[$i]['x'],$pointscale[$i]['y'],$pointscale[$i+1]['x'],$pointscale[$i+1]['y'],$blockcolor[$on_top_select]); + } + + //====the horizonal scale====== + + if($maxYNum<=10) + { + $maxYNum=20; + } + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $scale=$maxYNum / 10 * (10 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()-4000; + $filename=$tt.".png"; + if(1){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + flush(); + echo "

      "; + echo ""; + + +adjust_content_tail(); + +echo ""; +?> \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/ser3_1253897512.png b/wxc2_omc/performance/mscCsta/ser3_1253897512.png new file mode 100755 index 0000000..d41ade4 Binary files /dev/null and b/wxc2_omc/performance/mscCsta/ser3_1253897512.png differ diff --git a/wxc2_omc/performance/mscCsta/ser4_1253895012.png b/wxc2_omc/performance/mscCsta/ser4_1253895012.png new file mode 100755 index 0000000..ab8ffd9 Binary files /dev/null and b/wxc2_omc/performance/mscCsta/ser4_1253895012.png differ diff --git a/wxc2_omc/performance/mscCsta/service_detail_down.php b/wxc2_omc/performance/mscCsta/service_detail_down.php new file mode 100755 index 0000000..8e8c81a --- /dev/null +++ b/wxc2_omc/performance/mscCsta/service_detail_down.php @@ -0,0 +1,1152 @@ + + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } +?> +
      +"; +if(!isset($success_check)) + $success_check=0; +if(!isset($call_clear_check)) + $call_clear_check=0; +if(!isset($no_answer_check)) + $no_answer_check=0; +if(!isset($sub_busy_check)) + $sub_busy_check=0; +if(!isset($network_busy_check)) + $network_busy_check=0; +if(!isset($call_deny_check)) + $call_deny_check=0; +if(!isset($signalling_timeout_check)) + $signalling_timeout_check=0; + +$slot=$sel_date_from-$sel_date_to+1; +$DEBUG=0; +//========================================================================================| +//========================Data From General Page==========================================| +//========================================================================================| +/* +service_type +value type +0 subs to subs +1 subs to trunk +2 trunk to subs +3 trunk to trunk +4 interconnection +5 subs to IP +6 trunk to IP +7 mobile originated +8 mobile terminated +9 in trunk +10 out trunk +11 IP terminated +*/ +if(0) +{ + echo "sel_date_from:$sel_date_from
      "; + echo "sel_date_to:$sel_date_to
      "; + echo "service_type:$service_type
      "; +} +//========================================================================================| +//==========================Define the Data===============================================| +//========================================================================================| +for($i=0;$i<9;$i++) +{ + for($j=0;$j<24*$slot;$j++) + { + $csta_data[$i][$j]=0; + } +} + +//========================================================================================| +//===========================Get The Data From DB=========================================| +//========================================================================================| + $key_type_relation=array(0=>5,1=>6,2=>7,3=>8,4=>9,5=>10,6=>11,7=>12,8=>13,9=>14,10=>15,11=>16); + $db=$csta_db; + $key_type=$key_type_relation[$service_type]+0; + + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day+1,date("Y"))); + + $select="select sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as subscriber_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type=$key_type "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + + do{ + + $datetime=substr($rows[csta_datetime],11,2)+0; + if($datetime==23) + continue; + //echo "datetime=$datetime
      "; + + for($tt=0;$tt<9;$tt++) + { + $csta_data[$tt][$datetime+1+$day*24]+=$rows[$tt]; + } + }while($rows=mysqli_fetch_array($result)); + } + + //Get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + + //echo "from_time=$from_time,to_time=$to_time
      "; + $select="select sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as subscriber_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + $service_where="and key_type=$key_type "; + $where="where csta_datetime >'$from_time' and csta_datetime <='$to_time' ".$service_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + + do{ + + $datetime=substr($rows[csta_datetime],11,2); + //echo "this datetime=$datetime
      "; + + for($tt=0;$tt<9;$tt++) + { + $csta_data[$tt][$day*24]+=$rows[$tt]; + //echo "csta_data[$tt][$day*24]+=rows[$tt]({$rows[$tt]})
      "; + } + }while($rows=mysqli_fetch_array($result)); + + } + + + +//=======================================================================================| +//==========================Fake Data For Test===========================================| +//=======================================================================================| +if($DEBUG) +{ + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if($i==0) + $csta_data[$i][$j]=rand(210,300); + else + $csta_data[$i][$j]=rand(10,100); + } + } +} +//=======================================================================================| +//=============================Test the Data=============================================| +//=======================================================================================| +$test_label=array("Attempt","Success","Call clear","No Answer","Sub busy","Network busy", + "Call barred","signaling timeout","Duration"); + +if(0) +{ + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "{$test_label[$i]}--Hour-$j--{$csta_data[$i][$j]}
      "; + } + } +} +//=======================================================================================| +//==========================Draw The Table-1=============================================| +//=======================================================================================| + + //=====table title====== + $table_name_label=array("Sub to sub", + "Sub to trunk", + "Trunk to sub", + "Trunk to trunk", + "Intraconnection", + "Sub to IP", + "Trunk to IP", + "Mobile originated", + "Mobile terminated", + "In trunk", + "Out trunk", + "IP terminated"); + if($slot==1) + { + $title_date=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $table_title=$table_name_label[$service_type]." statistic Date:".$title_date; + } + else + { + $title_date_from=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $title_date_to=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + $table_title=$table_name_label[$service_type]." statistic Date:".$title_date_from." to ".$title_date_to; + } + + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<24*$slot;$i++) + { + echo ""; + //=========time column============== + echo ""; + //===========attempt column========== + echo ""; + //========Success column============== + echo ""; + //========call deny column========== + echo ""; + //=============Net busy column======= + echo ""; + //===Caller clear column=========== + echo ""; + //====Sub busy column============= + echo ""; + //=====No answer column============= + echo ""; + //====signal error column====== + echo ""; + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + echo ""; + } + echo "
      TimeAttemptSuccessCall denyNet busyCaller clearSub busyNo AnswerSignal ErrorTotal call durationAverage call
      duration(s)
      "; + $hour_label=$i%24; + if($hour_label<10) + $hour_label="0".$hour_label."H"; + else + $hour_label=$hour_label."H"; + $day_label=floor($i/24); + $day_label=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day_label,date("Y"))); + echo "$day_label $hour_label"; + echo ""; + echo "{$csta_data[0][$i]}"; + echo ""; + echo "{$csta_data[1][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[1][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[2][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[2][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[3][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[3][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[4][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[4][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[5][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[5][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[6][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[6][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[7][$i]}"; + if($csta_data[0][$i]==0) + $rate=0; + else + { + $rate=$csta_data[7][$i]/$csta_data[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_data[8][$i]}(s)"; + $hour=floor($csta_data[8][$i]/3600); + $minute=floor($csta_data[8][$i]%3600/60); + $second=$csta_data[8][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_data[1][$i]!=0) + $ave=round($csta_data[8][$i]/$csta_data[1][$i]); + else + $ave=0; + echo "$ave"; + echo "
      "; + +?> + + +

      + +

      + +"; +echo ""; + if($success_check==1) + { + echo "  Success"; + $draw_line_flag[0]=1; + } + else + { + $lineOnTop=0; + echo "  Success"; + $draw_line_flag[0]=0; + } + if($call_deny_check==1) + { + echo "  Call deny"; + $draw_line_flag[1]=1; + } + else + { + $lineOnTop=1; + echo "  Call deny"; + $draw_line_flag[1]=0; + } + if($network_busy_check==1) + { + echo "  Network busy"; + $draw_line_flag[2]=1; + } + else + { + $lineOnTop=2; + echo "  Network busy"; + $draw_line_flag[2]=0; + } + if($call_clear_check==1) + { + echo "  Caller clear"; + $draw_line_flag[3]=1; + } + else + { + $lineOnTop=3; + echo "  Caller clear"; + $draw_line_flag[3]=0; + } + if($sub_busy_check==1) + { + echo "  Sub busy"; + $draw_line_flag[4]=1; + } + else + { + $lineOnTop=4; + echo "  Sub busy"; + $draw_line_flag[4]=0; + } + if($no_answer_check==1) + { + echo "  No answer"; + $draw_line_flag[5]=1; + } + else + { + $lineOnTop=5; + echo "  No answer"; + $draw_line_flag[5]=0; + } + if($signalling_timeout_check==1) + { + echo "  Signal error"; + $draw_line_flag[6]=1; + } + else + { + $lineOnTop=6; + echo "  Signal error"; + $draw_line_flag[6]=0; + } +echo ""; +echo ""; +//========================================================================================| +//=============================Draw The Graphics-1========================================| +//========================================================================================| + $sizex=835; + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //======get the block legend color====== + $black_color=ImageColorAllocate($im,06,0,0); + $white_color=ImageColorAllocate($im,0xff,0xff,0xff); + $color[0]=ImageColorAllocate($im,0x66,0xff,0x33); + $color[1]=ImageColorAllocate($im,0x66,0xff,0xff); + $color[2]=ImageColorAllocate($im,0,0x66,0x66); + $color[3]=ImageColorAllocate($im,0x66,0,0xcc); + $color[4]=ImageColorAllocate($im,0x66,0x33,0); + $color[5]=ImageColorAllocate($im,0xcc,0,0x66); + $color[6]=ImageColorAllocate($im,0xff,0,0); + //======background======== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + //=======border======== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + //======draw the vertical dash line====== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //=======draw the horizonal dash line====== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $tempstr=(10-$i)*10; + $tempstr=$tempstr."%"; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, $tempstr, $text_color); + } + + //=======draw the block legend======== + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Success",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"Call deny",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"Network busy",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Caller clear",$text_color); + + imagefilledrectangle($im,450,350,460,360,$color[4]); + imagestring($im,2,465,350,"Sub busy",$text_color); + + imagefilledrectangle($im,540,350,550,360,$color[5]); + imagestring($im,2,555,350,"No answer",$text_color); + + imagefilledrectangle($im,630,350,640,360,$color[6]); + imagestring($im,2,645,350,"Signal error",$text_color); + + //========get the data line scale======== + for($j=0;$j<7;$j++) + { + for($i=0;$i<24*$slot;$i++) + { + if($csta_data[0][$i]!=0) + $points_scale[$j][$i]['y']=floor(250*$csta_data[$j+1][$i]/$csta_data[0][$i]); + else + $points_scale[$j][$i]['y']=0; + $points_scale[$j][$i]['y']=25+250-$points_scale[$j][$i]['y']; + $points_scale[$j][$i]['x']=60+30*$i/$slot; + //echo "line-$j-point-$i-x:{$points_scale[$j][$i]['x']}
      "; + //echo "line-$j-point-$i-y:{$points_scale[$j][$i]['y']}
      "; + } + } + + //======draw the data line======= + //echo "on_top_index:$on_top_index
      "; + for($i=0;$i<7;$i++) + { + if($draw_line_flag[$i]!=0) + { + for($j=0;$j<24*$slot-1;$j++) + { + imageline($im,$points_scale[$i][$j]['x'],$points_scale[$i][$j]['y'],$points_scale[$i][$j+1]['x'],$points_scale[$i][$j+1]['y'],$color[$i]); + } + } + } + + //=====draw the on top line againg========= + //echo "lineTop=$lineTop
      "; + if($draw_line_flag[$lineTop]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y'],$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y'],$color[$lineTop]); + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y']+1,$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y']+1,$color[$lineTop]); + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y']+2,$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y']+2,$color[$lineTop]); + + } + } + + //======draw the graphics======== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()-5500; + $filename="ser1_".$tt.".png"; + if(1){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + echo ""; +?> + + + +

      +on top + +1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //=====draw the block legend======= + imagefilledrectangle($image,90,350,100,360,$color[0]); + imagestring($image,2,105,350,"Total call duration",$text_color); + + imagefilledrectangle($image,280,350,290,360,$color[1]); + imagestring($image,2,295,350,"Average call duration",$text_color); + + imagestring($image,2,10,5,"Total call duration",$text_color); + imagestring($image,2,700,5,"Average call duration",$text_color); + + //======get the biggest y scale of left====== + for($i=0;$i<$slot*24;$i++) + { + if($maxYNum_left<$csta_data[8][$i]) + $maxYNum_left=$csta_data[8][$i]; + if($csta_data[1][$i]==0) + $average[$i]=0; + else + $average[$i]=round($csta_data[8][$i]/$csta_data[1][$i]); + if($maxYNum_right<$average[$i]) + $maxYNum_right=$average[$i]; + } + if($maxYNum_left==0) + $maxYNum_left=100; + if($maxYNum_right==0) + $maxYNum_right=10; + + //===draw the horizonal dash line==== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + $res=imagesetstyle($image, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($image, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + } + + //=====get the data line scale====== + for($i=0;$i<$slot*24;$i++) + { + //get the total call duration scale + $total_call_duration_scale[$i]['x']=60+30*$i/$slot; + $total_call_duration_scale[$i]['y']=floor(250*$csta_data[8][$i]/$maxYNum_left); + $total_call_duration_scale[$i]['y']=25+250-$total_call_duration_scale[$i]['y']; + //get the average call duraiton scale + $average_call_duration_scale[$i]['x']=60+30*$i/$slot; + $average_call_duration_scale[$i]['y']=floor(250*$average[$i]/$maxYNum_right); + $average_call_duration_scale[$i]['y']=25+250-$average_call_duration_scale[$i]['y']; + //echo "hour-$i:{$total_call_duration_scale[$i]['y']}
      "; + } + for($j=0;$j<24*$slot-1;$j++) + { + //draw the total duration call data line + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + //draw the average duration call data line + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + + //======draw the on top data line again======= + if(!isset($on_top_index_down)) + $on_top_index_down=0; + + for($j=0;$j<24*$slot-1;$j++) + { + if($on_top_index_down==0) + { + //draw the total duration call data line + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + } + else + { + //draw the average duration call data line + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + } + + + //=======the left y scale label=========== + $unit=$maxYNum_left/10; + + for($i=0;$i<10;$i++){ + + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." min"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 54, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //=======the right y scale label========= + $unit=$maxYNum_right/10; + for($i=0;$i<10;$i++){ + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." m"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 50+780, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //=====draw the graphics====== + //-----输出图形文件,请勿修改 + $tt=time()+4500; + $filename="ser2_".$tt.".png"; + if(1){ + ImagePng ($image,"$filename"); + ImageDestroy($image); + } + echo "

      "; +adjust_content_tail("down"); +?> +

      + + \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/service_detail_index.php b/wxc2_omc/performance/mscCsta/service_detail_index.php new file mode 100755 index 0000000..84e4e5e --- /dev/null +++ b/wxc2_omc/performance/mscCsta/service_detail_index.php @@ -0,0 +1,27 @@ + + + + + "; + echo ""; + ?> + + diff --git a/wxc2_omc/performance/mscCsta/service_detail_up.php b/wxc2_omc/performance/mscCsta/service_detail_up.php new file mode 100755 index 0000000..227e927 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/service_detail_up.php @@ -0,0 +1,117 @@ + + + + +
      +"; + echo ""; + echo ""; + echo "$strTitlePerformance > MSC > $strService"; + echo ""; + echo ""; + $helpId="3.2.1"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + + //=======================data initial========================================== + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($service_type)) + $service_type=0; + if(!isset($on_top_index)) + $on_top_index=0; + + //selection date define + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + + echo ""; +?> + to  + + + + +"; + echo ""; + + //===================the back link button====================================== + echo "back"; +?> +  + + + +"; + echo ""; + echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + + +?> + + + \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/service_general_down.php b/wxc2_omc/performance/mscCsta/service_general_down.php new file mode 100755 index 0000000..c31f826 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/service_general_down.php @@ -0,0 +1,898 @@ + + + + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } +adjust_head_frame("down"); +adjust_title_head_frame("down"); +adjust_title_tail_frame("down"); + +adjust_content_head_frame("down"); +echo "
      "; +//=====================================================================================| +//============================Function Flag============================================| +//=====================================================================================| +$Hide_Show_Function_On=0; +$DEBUG=0; +//=====================================================================================| +//============================Data From Index Page=====================================| +//=====================================================================================| +if(0) +{ + + $url_temp=$_SERVER["REQUEST_URI"]; + echo "This page URL:$url_temp
      "; + + echo "sel_date_from:$sel_date_from
      "; + echo "sel_date_to:$sel_date_to
      "; +} +//=====================================================================================| +//============================Define The Data==========================================| +//=====================================================================================| + //data define + for($i=0;$i<12;$i++) + { + for($j=0;$j<9;$j++) + { + /* + 0 sub to sub 0 attempt + 1 sub to trunk 1 success + 2 trunk to sub 2 call deny + 3 trunk to trunk 3 network busy + 4 interconnection 4 caller clear + 5 sub to IP 5 subscriber busy + 6 trunk to IP 6 no answer + 7 mobile originated 7 signal error + 8 mobile terminated 8 duration + 9 in trunk + 10 out trunk + 11 IP terminated + */ + $service_csta[$i][$j]=0; + } + } + +//===================================================================================| +//========================Get The Data From DB=======================================| +//===================================================================================| + $db=$csta_db; + $bgn_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $end_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + //get the numbers of days that selected + $slot=$sel_date_from-$sel_date_to+1; + if(0) + { + echo "bgn_time:$bgn_time
      "; + echo "end_time:$end_time
      "; + echo "slot:$slot
      "; + echo "db:$csta_db
      "; + } + + $key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11); + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as subscriber_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where; + $group="group by key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + continue; + + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + + for($tt=0;$tt<9;$tt++) + { + $service_csta[$index][$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + + //echo "table_name:$table_name
      "; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as subscriber_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $service_where="and key_type>4 and key_type<17 "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where; + $group="group by key_type "; + $order="order by key_type "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + if(!$rows) + continue; + + do{ + $key_type=$rows[key_type]; + $index=$key_type_relation[$key_type]+0; + + for($tt=0;$tt<9;$tt++) + { + $service_csta[$index][$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + +//===================================================================================| +//==========================Fake Data for Test=======================================| +//===================================================================================| +if($DEBUG) +{ + for($i=0;$i<12;$i++) + { + for($j=0;$j<9;$j++) + { + if($j==0) + $service_csta[$i][$j]=rand(200,400); + else if($j==1) + $service_csta[$i][$j]=rand(100,200); + else + $service_csta[$i][$j]=rand(0,100); + } + } +} +//===================================================================================| +//=========================Test The Data=============================================| +//===================================================================================| +if(0) +{ + for($i=0;$i<12;$i++) + { + for($j=0;$j<9;$j++) + { + echo "type-$i-$j:{$service_csta[$i][$j]}
      "; + } + } +} + +//===================================================================================| +//=======================Show The Table-1============================================| +//===================================================================================| + //===table title + if($slot==1) + $table_title="Service statistic Date:".$bgn_time; + else + $table_title="Service statistic Date:".$bgn_time." to ".$end_time; + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $service_type_label=array("Subs to subs","Subs to trunk","Trunk to subs","Trunk to trunk","Intraconnection","Subs to IP","Trunk to IP","Mobile originated","Mobile terminated","In trunk","Out trunk","IP terminated"); + + //========show subs to subs,subs to local,subs to toll,trunk to subs,trunk to trunk========== + for($i=0;$i<12;$i++) + { + if($i==5||$i==7) + { + echo ""; + echo ""; + echo ""; + } + + echo ""; + + echo ""; + for($j=0;$j<9;$j++) + { + echo ""; + } + echo ""; + + echo ""; + + } + echo "
      TypeAttemptSuccessCall DenyNet BusyCaller clearSub BusyNo AnswerSignal ErrorTotal call durationAverage call duration(s)
       
      $service_type_label[$i]"; + if($j==8) + { + echo "{$service_csta[$i][$j]}(s)"; + $hour=floor($service_csta[$i][$j]/3600); + $minute=floor($service_csta[$i][$j]%3600/60); + $second=$service_csta[$i][$j]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + } + else + echo "{$service_csta[$i][$j]}"; + if($j>0&&$j<8) + { + if($service_csta[$i][0]==0) + $rate=0; + else + { + $rate=$service_csta[$i][$j]/$service_csta[$i][0]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 2, '.', ''); + } + echo "
      $rate%"; + } + echo "
      "; + if($service_csta[$i][1]!=0) + $ave=round($service_csta[$i][8]/$service_csta[$i][1]); + else + $ave=0; + echo "$ave"; + echo "
      "; + + if($Hide_Show_Function_On==1) + echo ""; + + + if($Hide_Show_Function_On==1) + echo ""; + + if($Hide_Show_Function_On==1) + echo ""; + +//=====================================================================================| +//=======================Draw The Graphics-1===========================================| +//=====================================================================================| +echo "

      2.Service(Attempt)
      "; + //=====graphics size======= + $sizex=830; + $sizey=250; + + $im = ImageCreate ($sizex, $sizey); + $background_color=ImageColorAllocate($im,255,255,255); + $black_color=ImageColorAllocate($im,0,0,0); + $white_color= imagecolorallocate($im, 255, 255, 255); + + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + + //====graphics background======= + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + + + imagedashedline($im,30,30,100,100,$black_color); + + //======draw the horizonal line======== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=790; + $y2=$y1; + + if($i!=10) + { + imageline($im, $x1,$y1,460,$y2, IMG_COLOR_STYLED); + imageline($im, 490,$y1,$x2,$y2, IMG_COLOR_STYLED); + } + + imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color); + imagestring($im,2,$x2+5,$y2-5,($i*10)."%",$black_color); + + } + + //=======draw the vitical line======= + $u=floor(750/25); + for($i=0;$i<25;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color); + } + + //=======get colors============ + $color[0]=ImageColorAllocate($im,0x99,0x00,0x33); + $color[1]=ImageColorAllocate($im,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($im,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($im,0x99,0xcc,0x99); + $color[4]=ImageColorAllocate($im,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($im,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($im,0xff,0x99,0xff); + $color[7]=ImageColorAllocate($im,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($im,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($im,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($im,0x00,0x66,0xcc); + $color[11]=ImageColorAllocate($im,0x33,0xff,0x99); + + + //=====get the precent and block height(Part-1)====== + $attempt_sum_one=0; + for($i=0;$i<7;$i++) + { + $attempt_sum_one+=$service_csta[$i][0]; + } + if($attempt_sum_one==0) + { + //sub to sub precent + $subs_to_subs_attempt_precent="0%"; + //sub to trunk precent + $subs_to_trunk_attempt_precent="0%"; + //trunk to sub precent + $trunk_to_subs_attempt_precent="0%"; + //trunk to trunk precent + $trunk_to_trunk_attempt_precent="0%"; + //interconnection precent + $interconnection_attempt_precent="0%"; + + //subs to IP precent + $subs_to_ip_attempt_precent="0%"; + //trunk to IP precent + $trunk_to_ip_attempt_precent="0%"; + + + for($t=0;$t<7;$t++) + $height[$t]=0; + } + else + { + //sub to sub precent + $subs_to_subs_attempt_precent=number_format($service_csta[0][0]*100/$attempt_sum_one,2,'.','')."%"; + //sub to trunk precent + $subs_to_trunk_attempt_precent=number_format($service_csta[1][0]*100/$attempt_sum_one,2,'.','')."%"; + //trunk to sub precent + $trunk_to_subs_attempt_precent=number_format($service_csta[2][0]*100/$attempt_sum_one,2,'.','')."%"; + //trunk to trunk precent + $trunk_to_trunk_attempt_precent=number_format($service_csta[3][0]*100/$attempt_sum_one,2,'.','')."%"; + //interconnection precent + $interconnection_attempt_precent=number_format($service_csta[4][0]*100/$attempt_sum_one,2,'.','')."%"; + + //subs to IP precent + $subs_to_ip_attempt_precent=number_format($service_csta[5][0]*100/$attempt_sum_one,2,'.','')."%"; + //trunk to IP precent + $trunk_to_ip_attempt_precent=number_format($service_csta[6][0]*100/$attempt_sum_one,2,'.','')."%"; + + + for($t=0;$t<7;$t++) + $height[$t]=floor(180*$service_csta[$t][0]/$attempt_sum_one); + + } + //=====get the precent and block height(Part-2)====== + $attempt_sum_tow=0; + for($i=7;$i<12;$i++) + { + $attempt_sum_tow+=$service_csta[$i][0]; + } + if($attempt_sum_tow==0) + { + //mobile originated precent + $mobile_originated_attempt_precent="0%"; + //mobile terminated precent + $mobile_terminated_attempt_precent="0%"; + //in trunk precent + $in_trunk_attempt_precent="0%"; + //out_trunk precent + $out_trunk_attempt_precent="0%"; + //IP terminated precent + $ip_terminated_attempt_precent="0%"; + + + for($t=7;$t<12;$t++) + $height[$t]=0; + } + else + { + //mobile originated precent + $mobile_originated_attempt_precent=number_format($service_csta[7][0]*100/$attempt_sum_tow,2,'.','')."%"; + //mobile terminated precent + $mobile_terminated_attempt_precent=number_format($service_csta[8][0]*100/$attempt_sum_tow,2,'.','')."%"; + //in trunk precent + $in_trunk_attempt_precent=number_format($service_csta[9][0]*100/$attempt_sum_tow,2,'.','')."%"; + //out_trunk precent + $out_trunk_attempt_precent=number_format($service_csta[10][0]*100/$attempt_sum_tow,2,'.','')."%"; + //IP terminated precent + $ip_terminated_attempt_precent=number_format($service_csta[11][0]*100/$attempt_sum_tow,2,'.','')."%"; + + + for($t=7;$t<12;$t++) + $height[$t]=floor(180*$service_csta[$t][0]/$attempt_sum_tow); + + } + + //======draw the data block====== + for($i=0;$i<12;$i++) + { + $x1=40+(2*$i+1)*$u; + if($height[$i]==0) + $height[$i]=1; + $y1=200-$height[$i]; + $x2=40+(2*$i+2)*$u; + $y2=199; + imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]); + } + + //======draw the legend string======= + imagestring($im,2,65,205,"SUB SUB",$black_color); + imagestring($im,2,60,220,"(".$subs_to_subs_attempt_precent.")",$black_color); + imagestring($im,2,125,205,"SUB TRK",$black_color); + imagestring($im,2,123,220,"(".$subs_to_trunk_attempt_precent.")",$black_color); + imagestring($im,2,185,205,"TRK SUB",$black_color); + imagestring($im,2,185,220,"(".$trunk_to_subs_attempt_precent.")",$black_color); + imagestring($im,2,245,205,"TRK TRK",$black_color); + imagestring($im,2,243,221,"(".$trunk_to_trunk_attempt_precent.")",$black_color); + imagestring($im,2,310,205,"INTRA",$black_color); + imagestring($im,2,308,221,"(".$interconnection_attempt_precent.")",$black_color); + imagestring($im,2,368,205,"SUB IP",$black_color); + imagestring($im,2,366,221,"(".$subs_to_ip_attempt_precent.")",$black_color); + imagestring($im,2,428,205,"TRK IP",$black_color); + imagestring($im,2,425,221,"(".$trunk_to_ip_attempt_precent.")",$black_color); + imagestring($im,2,500,205,"MO",$black_color); + imagestring($im,2,487,221,"(".$mobile_originated_attempt_precent.")",$black_color); + imagestring($im,2,560,205,"MT",$black_color); + imagestring($im,2,547,221,"(".$mobile_terminated_attempt_precent.")",$black_color); + imagestring($im,2,608,205,"IN TRK",$black_color); + imagestring($im,2,605,221,"(".$in_trunk_attempt_precent.")",$black_color); + imagestring($im,2,668,205,"OUT TRK",$black_color); + imagestring($im,2,667,221,"(".$out_trunk_attempt_precent.")",$black_color); + imagestring($im,2,742,205,"IP",$black_color); + imagestring($im,2,727,221,"(".$ip_terminated_attempt_precent.")",$black_color); + + //draw the outline + imageLine($im,40,20,40,200,$black_color); + imageLine($im,40,20,460,20,$black_color); + imageLine($im,460,200,460,20,$black_color); + imageLine($im,40,200,460,200,$black_color); + + imageLine($im,490,200,490,20,$black_color); + imageLine($im,490,20,790,20,$black_color); + imageLine($im,790,200,790,20,$black_color); + imageLine($im,490,200,790,200,$black_color); + + + //======show the service attempt graphics========== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $filename="ser3_".time().".png"; + if(1){ + ImagePng ($im,"$filename"); + + ImageDestroy($im); + } + //-----显示图片 + echo ""; + + //=======show the remark label======== + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      SUB SUB-> Subscriber to subscriberTRK TRK-> Trunk to trunkMO-> Mobile originated
      SUB TRK-> Subscriber to trunkINTRA-> IntraconnectionMT-> Mobile terminated
      TRK SUB-> Trunk to subscriberSUB IP-> Subscriber to IPIN TRK-> In trunk
      TRK IP-> Trunk to IPOUT TRK-> Out trunk
      IP-> IP terminated
      "; + +//=====================================================================================| +//========================Draw The Graphics-2==========================================| +//=====================================================================================| +//=======draw the Success failure graphics========== + echo "

      3.Success/Failure
      "; + $sizex=830; + $sizey=310; + $image=imagecreate($sizex,$sizey); + $bgcolor=imagecolorallocate($image,255,255,255); + $black_color=ImageColorAllocate($image,0,0,0); + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($image, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($image, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //=====background======== + ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198)); + ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color); + + //first + imageLine($image,40,20,40,200,$black_color); + imageLine($image,40,20,400,20,$black_color); + imageLine($image,400,200,400,20,$black_color); + imageLine($image,40,200,400,200,$black_color); + + //second + imageLine($image,430,20,430,200,$black_color); + imageLine($image,430,20,790,20,$black_color); + imageLine($image,790,200,790,20,$black_color); + imageLine($image,430,200,790,200,$black_color); + + //========draw the horizonal line(part-1)======= + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=400; + $y2=$y1; + + if($i!=10) + imageline($image, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED); + + imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + //========draw the horizonal line(part-2)======= + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=10;$i>0;$i--) + { + $x1=430; + $y1=20+(10-$i)*18; + $x2=790; + $y2=$y1; + + if($i!=10) + imageline($image, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED); + + imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + + //========draw the vitical line(part-1)========= + $u=floor(360/15); + for($i=0;$i<16;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color); + } + //========draw the vitical line(part-2)========= + for($i=0;$i<16;$i++) + { + $x1=430+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color); + } + + //=======get colors============ + $color[0]=ImageColorAllocate($image,0x99,0x00,0x33); + $color[1]=ImageColorAllocate($image,0x99,0x00,0xcc); + $color[2]=ImageColorAllocate($image,0x99,0x99,0x00); + $color[3]=ImageColorAllocate($image,0x99,0xcc,0x99); + $color[4]=ImageColorAllocate($image,0x99,0xff,0x33); + $color[5]=ImageColorAllocate($image,0xff,0x99,0x66); + $color[6]=ImageColorAllocate($image,0xff,0x99,0xff); + $color[7]=ImageColorAllocate($image,0xff,0xff,0x00); + $color[8]=ImageColorAllocate($image,0x33,0x3,0x33); + $color[9]=ImageColorAllocate($image,0x00,0xcc,0xff); + $color[10]=ImageColorAllocate($image,0x00,0x66,0xcc); + $color[11]=ImageColorAllocate($image,0x33,0xff,0x99); + + + //======get the block height(part-1)=========== + $sum_one=0; + for($i=0;$i<7;$i++) + $sum_one+=$service_csta[$i][0]; + + for($i=0;$i<7;$i++) + { + + for($j=0;$j<7;$j++) + { + if($sum_one==0) + $total_height[$j][$i]=0; + else + $total_height[$j][$i]=floor(180*$service_csta[$i][$j+1]/$sum_one); + } + } + //======get the block height(part-2)=========== + $sum_two=0; + for($i=7;$i<12;$i++) + $sum_two+=$service_csta[$i][0]; + for($i=7;$i<12;$i++) + { + + for($j=0;$j<7;$j++) + { + if($sum_two==0) + $total_height[$j][$i]=0; + else + $total_height[$j][$i]=floor(180*$service_csta[$i][$j+1]/$sum_two); + } + + } + + //========draw the data block(part-1)========== + for($i=0;$i<7;$i++) + { + for($j=0;$j<7;$j++) + { + if($total_height[$i][$j]<1) + $total_height[$i][$j]=0; + //echo "lie-$i-hang-$j-{$total_height[$i][$j]}
      "; + $x1=40+(2*$i+1)*24; + $y1=199; + for($z=0;$z<$j+1;$z++) + { + $y1=$y1-$total_height[$i][$z]; + } + $x2=40+(2*$i+2)*24; + $y2=199; + for($z=0;$z<$j;$z++) + { + $y2=$y2-$total_height[$i][$z]; + } + + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]); + } + } + + //========draw the data block(part-2)========== + for($i=0;$i<7;$i++) + { + for($j=7;$j<12;$j++) + { + if($total_height[$i][$j]<1) + $total_height[$i][$j]=0; + //echo "lie-$i-hang-$j-{$total_height[$i][$j]}
      "; + $x1=430+(2*$i+1)*24; + $y1=199; + for($z=7;$z<$j+1;$z++) + { + $y1=$y1-$total_height[$i][$z]; + } + $x2=430+(2*$i+2)*24; + $y2=199; + for($z=7;$z<$j;$z++) + { + $y2=$y2-$total_height[$i][$z]; + } + + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]); + } + } + + //=====draw the legend string(part-1)============ + imagefilledrectangle($image,30,230,40,240,$color[0]); + imagestring($image,2,50,230,"SUB SUB",$black_color); + + imagefilledrectangle($image,170,230,180,240,$color[1]); + imagestring($image,2,190,230,"SUB TRK",$black_color); + + imagefilledrectangle($image,320,230,330,240,$color[2]); + imagestring($image,2,340,230,"TRK SUB",$black_color); + + imagefilledrectangle($image,470,230,480,240,$color[7]); + imagestring($image,2,490,230,"MO",$black_color); + + imagefilledrectangle($image,620,230,630,240,$color[8]); + imagestring($image,2,640,230,"MT",$black_color); + + imagefilledrectangle($image,760,230,770,240,$color[9]); + imagestring($image,2,780,230,"IN TRK",$black_color); + + imagefilledrectangle($image,30,250,40,260,$color[6]); + imagestring($image,2,50,250,"TRK IP",$black_color); + + imagefilledrectangle($image,170,250,180,260,$color[3]); + imagestring($image,2,190,250,"TRK TRK",$black_color); + + imagefilledrectangle($image,320,250,330,260,$color[4]); + imagestring($image,2,340,250,"INTRA",$black_color); + + imagefilledrectangle($image,470,250,480,260,$color[10]); + imagestring($image,2,490,250,"OUT TRK",$black_color); + + imagefilledrectangle($image,620,250,630,260,$color[11]); + imagestring($image,2,640,250,"IP",$black_color); + + imagefilledrectangle($image,30,270,40,280,$color[5]); + imagestring($image,2,50,270,"SUB IP",$black_color); + + + + + + + imagestring($image,2,55,205,"Success",$black_color); + imagestring($image,2,113,200,"Call",$black_color); + imagestring($image,2,113,212,"Deny",$black_color); + imagestring($image,2,165,200,"Net",$black_color); + imagestring($image,2,163,212,"Busy",$black_color); + imagestring($image,2,202,200,"Caller",$black_color); + imagestring($image,2,204,212,"Clear",$black_color); + imagestring($image,2,260,200,"Sub",$black_color); + imagestring($image,2,258,212,"Busy",$black_color); + imagestring($image,2,310,200,"No",$black_color); + imagestring($image,2,303,212,"Answer",$black_color); + imagestring($image,2,348,200,"Signal",$black_color); + imagestring($image,2,349,212,"Error",$black_color); + + imagestring($image,2,445,205,"Success",$black_color); + imagestring($image,2,113+390,200,"Call",$black_color); + imagestring($image,2,113+390,212,"Deny",$black_color); + imagestring($image,2,165+390,200,"Net",$black_color); + imagestring($image,2,163+390,212,"Busy",$black_color); + imagestring($image,2,202+390,200,"Caller",$black_color); + imagestring($image,2,204+390,212,"Clear",$black_color); + imagestring($image,2,260+390,200,"Sub",$black_color); + imagestring($image,2,258+390,212,"Busy",$black_color); + imagestring($image,2,310+390,200,"No",$black_color); + imagestring($image,2,303+390,212,"Answer",$black_color); + imagestring($image,2,348+390,200,"Signal",$black_color); + imagestring($image,2,349+390,212,"Error",$black_color); + + //======show the answer failure graphics===== + $tt=time()-2500; + $file_name="ser4_".$tt.".png"; + imagepng($image,$file_name); + imagedestroy($image); + echo ""; +adjust_content_tail("down"); +?> + + + diff --git a/wxc2_omc/performance/mscCsta/service_general_index.php b/wxc2_omc/performance/mscCsta/service_general_index.php new file mode 100755 index 0000000..6fd1253 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/service_general_index.php @@ -0,0 +1,23 @@ + + + + + "; + echo ""; + ?> + + diff --git a/wxc2_omc/performance/mscCsta/service_general_up.php b/wxc2_omc/performance/mscCsta/service_general_up.php new file mode 100755 index 0000000..9db8e5a --- /dev/null +++ b/wxc2_omc/performance/mscCsta/service_general_up.php @@ -0,0 +1,98 @@ + + + + + + +"; + echo ""; + echo ""; + echo "$strTitlePerformance > MSC > $strService"; + echo ""; + echo ""; + $helpId="3.2.1"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + +// +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +//selection date define +$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); +$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); +$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); +$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); +$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + +?> + to  + + + + +"; + echo ""; + +?> + + + +"; + echo ""; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + diff --git a/wxc2_omc/performance/mscCsta/test/aa b/wxc2_omc/performance/mscCsta/test/aa new file mode 100755 index 0000000..c7add1d Binary files /dev/null and b/wxc2_omc/performance/mscCsta/test/aa differ diff --git a/wxc2_omc/performance/mscCsta/test/test.php b/wxc2_omc/performance/mscCsta/test/test.php new file mode 100755 index 0000000..dc84bd8 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/test/test.php @@ -0,0 +1,11 @@ + + +

      + name:
      + + +"b"); + print_r($a); +?> \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/test/test1.php b/wxc2_omc/performance/mscCsta/test/test1.php new file mode 100755 index 0000000..541b12c --- /dev/null +++ b/wxc2_omc/performance/mscCsta/test/test1.php @@ -0,0 +1,27 @@ + + + \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/test/test2.php b/wxc2_omc/performance/mscCsta/test/test2.php new file mode 100755 index 0000000..343b272 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/test/test2.php @@ -0,0 +1,10 @@ + + Solution + + + + + diff --git a/wxc2_omc/performance/mscCsta/trunk_detail_down.php b/wxc2_omc/performance/mscCsta/trunk_detail_down.php new file mode 100755 index 0000000..2ce05fa --- /dev/null +++ b/wxc2_omc/performance/mscCsta/trunk_detail_down.php @@ -0,0 +1,1117 @@ + + + + + + 0){ + echo ""; +}else{ + echo ""; +} +?> +
      + +"; + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($trunk_no)) + $trunk_no=0; + if(!isset($sel_in_out)) + $sel_in_out=0; + if(!isset($on_top_index)) + $on_top_index=0; + + if(!isset($answer_check)) + $answer_check=0; + if(!isset($call_clear_check)) + $call_clear_check=0; + if(!isset($no_answer_check)) + $no_answer_check=0; + if(!isset($sub_busy_check)) + $sub_busy_check=0; + if(!isset($network_busy_check)) + $network_busy_check=0; + if(!isset($call_barred_check)) + $call_barred_check=0; + if(!isset($signalling_timeout_check)) + $signalling_timeout_check=0; +?> + + +"; +//echo ""; +//========================================================================================| +//============================Define The Data=============================================| +//========================================================================================| + $slot=$sel_date_from-$sel_date_to+1; + + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + $csta_trunk[$i][$j]=0; + } + } +//========================================================================================| +//==========================Get the data from DB==========================================| +//========================================================================================| + + $slot=$sel_date_from-$sel_date_to+1; + $db=$csta_db; + $time_column="csta_datetime"; + //echo "trunk_no:$trunk_no
      "; + + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day+1,date("Y"))); + + //echo "sel_in_out:$sel_in_out
      "; + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + //===in-trunk==== + if($sel_in_out==0) + { + $trunk_where="and key_type=3 "; + } + //===out-trunk==== + else if($sel_in_out==1) + { + $trunk_where="and key_type=4 "; + } + //===total_trunk=== + else if($sel_in_out==2) + { + $trunk_where="and key_type>2 and key_type<5 "; + } + + $where="where $time_column >'$from_time' and $time_column <='$to_time' and key_e1_tg=$trunk_no ".$trunk_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + //echo "datetime=$datetime
      "; + if($datetime==23) + continue; + + for($tt=0;$tt<9;$tt++) + { + $csta_trunk[$tt][$datetime+1+$day*24]+=$rows[$tt+1]; + } + }while($rows=mysqli_fetch_array($result)); + + } + + //get the 0-hour + for($day=0;$day<$slot;$day++) + { + $table_name="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + + //echo "sel_in_out:$sel_in_out
      "; + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,csta_datetime "; + $from="from $table_name "; + //===in-trunk==== + if($sel_in_out==0) + { + $trunk_where="and key_type=3 "; + } + //===out-trunk==== + else if($sel_in_out==1) + { + $trunk_where="and key_type=4 "; + } + //===total_trunk=== + else if($sel_in_out==2) + { + $trunk_where="and key_type>2 and key_type<5 "; + } + + $where="where $time_column >'$from_time' and $time_column <='$to_time' and key_e1_tg=$trunk_no ".$trunk_where; + $group="group by csta_datetime "; + $order="order by csta_datetime "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $datetime=substr($rows[csta_datetime],11,2)+0; + + + for($tt=0;$tt<9;$tt++) + { + $csta_trunk[$tt][$day*24]+=$rows[$tt+1]; + } + }while($rows=mysqli_fetch_array($result)); + + } + + +//========================================================================================| +//==========================Fake data for test============================================| +//========================================================================================| +if(0) +{ + $slot=$sel_date_from-$sel_date_to+1; + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + if($i==0) + $csta_trunk[$i][$j]=rand(200,300); + else + $csta_trunk[$i][$j]=rand(10,100); + } + } +} +//========================================================================================| +//==========================Test the Data=================================================| +//========================================================================================| + +if(0) +{ + for($i=0;$i<9;$i++) + { + for($j=0;$j<24*$slot;$j++) + { + echo "type-$i-hour-$j:{$csta_trunk[$i][$j]}
      "; + } + } +} +//=======================================================================================| +//==========================Draw the table-1=============================================| +//=======================================================================================| + if($slot==1) + { + $title_date=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $temp=$trunk_no; + if($sel_in_out==0) + { + $table_title="TG #".$temp." ".$element_title." (In) statistic Date:".$title_date; + } + else if($sel_in_out==1) + { + $table_title="TG #".$temp." ".$element_title." (Out) statistic Date:".$title_date; + } + else if($sel_in_out==2) + { + $table_title="TG #".$temp." ".$element_title." (In&Out) statistic Date:".$title_date; + } + } + else + { + $title_date_from=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $title_date_to=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + $temp=$trunk_no; + if($sel_in_out==0) + { + $table_title="TG #".$temp." ".$element_title." (In) statistic Date:".$title_date_from." to ".$title_date_to; + } + else if($sel_in_out==1) + { + $table_title="TG #".$temp." ".$element_title." (Out) statistic Date:".$title_date_from." to ".$title_date_to; + } + else if($sel_in_out==2) + { + $table_title="TG #".$temp." ".$element_title." (In&Out) statistic Date:".$title_date_from." to ".$title_date_to; + } + } + + echo "
      $table_title
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<24*$slot;$i++) + { + echo ""; + //=========time column============== + echo ""; + //===========attempt column========== + echo ""; + //========success column============== + echo ""; + //========call deny column========== + echo ""; + //=============net busy column======= + echo ""; + //===caller clear column=========== + echo ""; + //====sub busy column============= + echo ""; + //=====no answer column============= + echo ""; + //====signal error column====== + echo ""; + //======total call duration column===== + echo ""; + //======average call duration column==== + echo ""; + echo ""; + } + echo "
      TimeAttemptSuccessCall denyNet busyCaller clearSub busyNo answerSignal errorTotal call durationAverage call
      duration(s)
      "; + $hour_label=$i%24; + if($hour_label<10) + $hour_label="0".$hour_label."H"; + else + $hour_label=$hour_label."H"; + $day_label=floor($i/24); + $day_label=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day_label,date("Y"))); + echo "$day_label $hour_label"; + echo ""; + echo "{$csta_trunk[0][$i]}"; + echo ""; + echo "{$csta_trunk[1][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[1][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 4, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[2][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[2][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 4, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[3][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[3][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 4, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[4][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[4][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 4, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[5][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[5][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 4, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[6][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[6][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 4, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[7][$i]}"; + if($csta_trunk[0][$i]==0) + $rate=0; + else + { + $rate=$csta_trunk[7][$i]/$csta_trunk[0][$i]; + $rate=$rate*100; + if($rate!=0&&$rate!=100) + $rate=number_format($rate, 4, '.', ''); + } + echo "
      $rate%"; + echo "
      "; + echo "{$csta_trunk[8][$i]}(s)"; + $hour=floor($csta_trunk[8][$i]/3600); + $minute=floor($csta_trunk[8][$i]%3600/60); + $second=$csta_trunk[8][$i]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + echo "
      "; + if($csta_trunk[1][$i]!=0) + $ave=round($csta_trunk[8][$i]/$csta_trunk[1][$i]); + else + $ave=0; + echo "$ave"; + echo "
      "; +?> + +

      + +

      + +"; +echo ""; + if($answer_check==1) + { + echo "  Success"; + $draw_line_flag[0]=1; + } + else + { + $lineOnTop=0; + echo "  Success"; + $draw_line_flag[0]=0; + } + if($call_barred_check==1) + { + echo "  Call deny"; + $draw_line_flag[1]=1; + } + else + { + $lineOnTop=1; + echo "  Call deny"; + $draw_line_flag[1]=0; + } + if($network_busy_check==1) + { + echo "  Net busy"; + $draw_line_flag[2]=1; + } + else + { + $lineOnTop=2; + echo "  Net busy"; + $draw_line_flag[2]=0; + } + if($call_clear_check==1) + { + echo "  Caller clear"; + $draw_line_flag[3]=1; + } + else + { + $lineOnTop=3; + echo "  Caller clear"; + $draw_line_flag[3]=0; + } + if($sub_busy_check==1) + { + echo "  Sub busy"; + $draw_line_flag[4]=1; + } + else + { + $lineOnTop=4; + echo "  Sub busy"; + $draw_line_flag[4]=0; + } + if($no_answer_check==1) + { + echo "  No answer"; + $draw_line_flag[5]=1; + } + else + { + $lineOnTop=5; + echo "  No answer"; + $draw_line_flag[5]=0; + } + if($signalling_timeout_check==1) + { + echo "  Signal error"; + $draw_line_flag[6]=1; + } + else + { + $lineOnTop=6; + echo "  Signal error"; + $draw_line_flag[6]=0; + } +echo ""; +echo ""; + +//========================================================================================| +//=========================Draw the Graphics-1============================================| +//========================================================================================| + + $sizex=835; + $sizey=380; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //====get the block legend color======= + $color[0]=ImageColorAllocate($im,0x66,0xff,0x33); + $color[1]=ImageColorAllocate($im,0x66,0xff,0xff); + $color[2]=ImageColorAllocate($im,0,0x66,0x66); + $color[3]=ImageColorAllocate($im,0x66,0,0xcc); + $color[4]=ImageColorAllocate($im,0x66,0x33,0); + $color[5]=ImageColorAllocate($im,0xcc,0,0x66); + $color[6]=ImageColorAllocate($im,0xff,0,0); + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + //====background===== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + //====border===== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=275; + $unitXPix=30; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + + //=====draw the vertical line======== + for($i=0;$i<$slot;$i++) + { + $datestr[$i]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$i,date("Y"))); + } + for($i=0;$i<24;$i++) + { + if($i<10) + $timearray[$i]="0".$i."h"; + else + $timearray[$i]=$i."h"; + } + + if($slot==5) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($im, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //=====draw the horizonal line====== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $tempstr=(10-$i)*10; + $tempstr=$tempstr."%"; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, $tempstr, $text_color); + } + + //=====draw the block legend====== + imagefilledrectangle($im,90,350,100,360,$color[0]); + imagestring($im,2,105,350,"Success",$text_color); + + imagefilledrectangle($im,180,350,190,360,$color[1]); + imagestring($im,2,195,350,"Call deny",$text_color); + + imagefilledrectangle($im,270,350,280,360,$color[2]); + imagestring($im,2,285,350,"Net busy",$text_color); + + imagefilledrectangle($im,360,350,370,360,$color[3]); + imagestring($im,2,375,350,"Caller clear",$text_color); + + imagefilledrectangle($im,450,350,460,360,$color[4]); + imagestring($im,2,465,350,"Sub busy",$text_color); + + imagefilledrectangle($im,540,350,550,360,$color[5]); + imagestring($im,2,555,350,"No answer",$text_color); + + imagefilledrectangle($im,630,350,640,360,$color[6]); + imagestring($im,2,645,350,"Signal error",$text_color); + + //======get the data line scale======== + for($j=0;$j<7;$j++) + { + for($i=0;$i<24*$slot;$i++) + { + if($csta_trunk[0][$i]!=0) + $points_scale[$j][$i]['y']=floor(250*$csta_trunk[$j+1][$i]/$csta_trunk[0][$i]); + else + $points_scale[$j][$i]['y']=0; + $points_scale[$j][$i]['y']=25+250-$points_scale[$j][$i]['y']; + $points_scale[$j][$i]['x']=60+30*$i/$slot; + //echo "line-$j-point-$i-x:{$points_scale[$j][$i]['x']}
      "; + //echo "line-$j-point-$i-y:{$points_scale[$j][$i]['y']}
      "; + } + } + + //====draw the data line===== + for($i=0;$i<7;$i++) + { + if($draw_line_flag[$i]!=0) + { + for($j=0;$j<24*$slot-1;$j++) + { + imageline($im,$points_scale[$i][$j]['x'],$points_scale[$i][$j]['y'],$points_scale[$i][$j+1]['x'],$points_scale[$i][$j+1]['y'],$color[$i]); + } + } + } + //====draw the on top line again==== + //echo "lineTop=$lineTop
      "; + if($draw_line_flag[$lineTop]==1) + { + for($i=0;$i<24*$slot-1;$i++) + { + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y'],$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y'],$color[$lineTop]); + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y']+1,$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y']+1,$color[$lineTop]); + imageline($im,$points_scale[$lineTop][$i]['x'],$points_scale[$lineTop][$i]['y']+2,$points_scale[$lineTop][$i+1]['x'],$points_scale[$lineTop][$i+1]['y']+2,$color[$lineTop]); + + } + } + + //====show the Graphics==== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $tt=time()-3500; + $filename="tg3_".$tt.".png"; + if(!$DEBUG){ + ImagePng ($im,"$filename"); + ImageDestroy($im); + } + //-----显示图片 + echo ""; + +?> +

      +on top +

      + +1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else if($slot==7) + { + if(3>1) + { + $tempd[0]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[1]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[2]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[3]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + $tempd[4]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[5]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[6]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+1,date("Y"))); + $tempd[7]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[8]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[9]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[10]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+2,date("Y"))); + $tempd[11]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[12]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[13]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+3,date("Y"))); + $tempd[14]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[15]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[16]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[17]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+4,date("Y"))); + $tempd[18]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[19]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[20]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+5,date("Y"))); + $tempd[21]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[22]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + $tempd[23]=date("m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+6,date("Y"))); + } + for($i=0;$i<24;$i++){ + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + $xstr=$tempd[$i]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + else + { + $tempi=0; + + for($i=0;$i<24;$i++){ + + ImageDashedLine($image, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$datestr[$tempi]." ".$timearray[($i*$slot)%24]; + Imagestringup($image, 2, $xBgn + $i*30 - 4, $yEnd+60, $xstr, $text_color); + } + } + + //============================draw the block legend================================ + imagefilledrectangle($image,90,350,100,360,$color[0]); + imagestring($image,2,105,350,"Total call duration",$text_color); + + imagefilledrectangle($image,280,350,290,360,$color[1]); + imagestring($image,2,295,350,"Average call duration",$text_color); + + imagestring($image,2,10,5,"Total call duration",$text_color); + imagestring($image,2,700,5,"Average call duration",$text_color); + + //====get the biggest y scale of left==== + for($i=0;$i<$slot*24;$i++) + { + if($maxYNum_left<$csta_trunk[8][$i]) + $maxYNum_left=$csta_trunk[8][$i]; + if($csta_trunk[1][$i]==0) + $average[$i]=0; + else + $average[$i]=round($csta_trunk[8][$i]/$csta_trunk[1][$i]); + if($maxYNum_right<$average[$i]) + $maxYNum_right=$average[$i]; + } + if($maxYNum_left==0) + $maxYNum_left=100; + if($maxYNum_right==0) + $maxYNum_right=10; + + //=====get the data line scale===== + for($i=0;$i<$slot*24;$i++) + { + //get the total call duration scale + $total_call_duration_scale[$i]['x']=60+30*$i/$slot; + $total_call_duration_scale[$i]['y']=floor(250*$csta_trunk[8][$i]/$maxYNum_left); + $total_call_duration_scale[$i]['y']=25+250-$total_call_duration_scale[$i]['y']; + //get the average call duraiton scale + $average_call_duration_scale[$i]['x']=60+30*$i/$slot; + $average_call_duration_scale[$i]['y']=floor(250*$average[$i]/$maxYNum_right); + $average_call_duration_scale[$i]['y']=25+250-$average_call_duration_scale[$i]['y']; + //echo "hour-$i:{$total_call_duration_scale[$i]['y']}
      "; + + } + for($j=0;$j<24*$slot-1;$j++) + { + //draw the total duration call data line + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + //draw the average duration call data line + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + + //===================================draw the on top data line again==================== + if(!isset($on_top_index_down)) + $on_top_index_down=0; + for($j=0;$j<24*$slot-1;$j++) + { + if($on_top_index_down==0) + { + //====================draw the total duration call data line========================== + imageline($image,$total_call_duration_scale[$j]['x'],$total_call_duration_scale[$j]['y'],$total_call_duration_scale[$j+1]['x'],$total_call_duration_scale[$j+1]['y'],$color[0]); + } + else + { + //=========================draw the average duration call data line=========================== + imageline($image,$average_call_duration_scale[$j]['x'],$average_call_duration_scale[$j]['y'],$average_call_duration_scale[$j+1]['x'],$average_call_duration_scale[$j+1]['y'],$color[1]); + } + } + + //====draw the horizonal line===== + //the left y scale label + $unit=$maxYNum_left/10; + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($image, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, IMG_COLOR_STYLED); + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." min"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 54, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //the right y scale label + $unit=$maxYNum_right/10; + for($i=0;$i<10;$i++){ + $over_minute=floor($unit/60); + $over_hour=floor($unit/3600); + //Y轴每格的度值小于一分钟 + if($over_minute==0) + { + $displayMaxData=(10-$i)*$unit; + $displayMaxData=number_format($displayMaxData,0,"."," "); + $displayMaxData=$displayMaxData." s"; + } + else + { + //Y轴每格的度值大于一分钟但小于一个小时 + if($over_hour==0) + { + $displayMaxData=(10-$i)*$unit/60; + $displayMaxData=number_format($displayMaxData,1,"."," "); + $displayMaxData=$displayMaxData." m"; + } + //Y轴每格的度值大于一个小时 + else + { + $displayMaxData=(10-$i)*$unit/3600; + $displayMaxData=number_format($displayMaxData,2,"."," "); + $displayMaxData=$displayMaxData." h"; + } + } + Imagestring($image, 2, $xBgn - 50+780, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); + } + + //=====draw the graphics===== + //-----输出图形文件,请勿修改 + $tt=time()+2500; + $filename="tg4_".$tt.".png"; + if(!$DEBUG){ + ImagePng ($image,"$filename"); + ImageDestroy($image); + } + echo "

      "; +adjust_content_tail("down"); +?> \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/trunk_detail_index.php b/wxc2_omc/performance/mscCsta/trunk_detail_index.php new file mode 100755 index 0000000..e447a99 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/trunk_detail_index.php @@ -0,0 +1,32 @@ + + + "; + echo ""; + ?> + + diff --git a/wxc2_omc/performance/mscCsta/trunk_detail_up.php b/wxc2_omc/performance/mscCsta/trunk_detail_up.php new file mode 100755 index 0000000..dc30711 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/trunk_detail_up.php @@ -0,0 +1,142 @@ + + + + + +"; + //echo "sel_date_from:$sel_date_from
      "; + //echo "sel_date_to:$sel_date_to
      "; + //echo "in_out:$sel_in_out
      "; + //==================get the parameter the previous transfer==================== + $old_sel_date_from=$sel_date_from; + $old_sel_date_to=$sel_date_to; + $old_sel_in_out=$sel_in_out; + //===========================page title======================================== + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strTitlePerformance > MSC > Trunk group"; + echo ""; + $helpId="3.2.2"; + showHelp($helpId); + echo "
      "; + + //=======================data initial========================================== + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($trunk_no)) + $trunk_no=0; + if(!isset($sel_in_out)) + $sel_in_out=0; + if(!isset($on_top_index)) + $on_top_index=0; + //selection date define + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + + echo ""; +?> +  + + to  + + + + + +"; + echo ""; + //===================the back link button====================================== + echo "back"; +?> + + + + +"; + echo "
      "; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + + +?> + + + \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/trunk_general_down.php b/wxc2_omc/performance/mscCsta/trunk_general_down.php new file mode 100755 index 0000000..043c761 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/trunk_general_down.php @@ -0,0 +1,861 @@ + + + 0){ + //echo ""; + echo ""; + }else{ + echo ""; + } +?> + +"; +//========================================================================================| +//========================Initial The Data From Index Page================================| +//========================================================================================| + if(!isset($sel_date_from)) + $sel_date_from=0; + if(!isset($sel_date_to)) + $sel_date_to=0; + if(!isset($sel_in_out)) + $sel_in_out=0; + if(!isset($from_hour)) + $from_hour="00"; + if(!isset($from_minute)) + $from_minute="00"; + if(!isset($from_second)) + $from_second="00"; + if(!isset($to_hour)) + $to_hour="23"; + if(!isset($to_minute)) + $to_minute="59"; + if(!isset($to_second)) + $to_second="59"; + $DEBUG=1; +//========================================================================================| +//============================Define The Data=============================================| +//========================================================================================| + for($i=0;$i<=256;$i++) + { + for($j=0;$j<9;$j++) + { + /* + 0 trunk-no 0 attempt + 1 trunk no 1 success + ... 2 call deny + 3 network busy + 4 caller clear + 5 sub busy + 6 no answer + 7 signal error + 8 total call duration + */ + $trunk_csta[$i][$j]=0; + } + } + + //===in going,out going,in-out-going data from DB=== + for($i=0;$i<9;$i++) + { + $in_trunk[$i]=0; + $out_trunk[$i]=0; + $total_trunk[$i]=0; + } +//========================================================================================| +//============================Get The Trunk Group Element Title===========================| +//========================================================================================| + //====initial===== + for($i=0;$i<=256;$i++) + { + $trunk_element_title[$i]=""; + } + $dualTableLevelWhere="T1.level_1=T2.level_1 AND + T1.level_2=T2.level_2 AND + T1.level_3=T2.level_3 AND + T1.level_4=T2.level_4 AND + T1.level_5=T2.level_5 AND + T1.level_6=T2.level_6 AND + T1.level_7=T2.level_7 AND + T1.level_8=T2.level_8 AND + T1.level_9=T2.level_9 AND + T1.level_10=T2.level_10"; + + + //===get the title of tg===== + $database="OBJ_320"; + $sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle'"; + $result=@mysqli_query($pubConn,$sql); + $TrunkGroupCount=mysqli_num_rows($result); + + if($TrunkGroupCount>0) + { + while($rows = @mysqli_fetch_array($result)) + { + //get the instanceNo of the tg + $trunk_no=$rows[instanceNo]+0; + $trunk_status[$trunk_no]=1; + $trunk_element_title[$trunk_no]=$rows[initValue]; + } + } + + +//========================================================================================| +//=============================Get The Data From DB=======================================| +//========================================================================================| + //=====data for per trunk======= + $db=$csta_db; + $slot=$sel_date_from-$sel_date_to+1; + $time_column="csta_datetime"; + + for($day=0;$day<$slot;$day++) + { + + $table_name ="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "table_name:$table_name
      "; + //echo "from_time:$from_time
      "; + //echo "to_time:$to_time
      "; + //echo "in_out:$sel_in_out
      "; + + if($sel_in_out==0) + $trunk_where="and key_type=3 "; + else if($sel_in_out==1) + $trunk_where="and key_type=4 "; + else + $trunk_where="and key_type>2 and key_type<5 "; + + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "sql:$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + + do + { + $gro=$rows[0]; + for($tt=0;$tt<9;$tt++) + { + $trunk_csta[$gro][$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of this day + for($day=0;$day<$slot;$day++) + { + + $table_name ="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + //echo "table_name:$table_name
      "; + //echo "from_time:$from_time
      "; + //echo "to_time:$to_time
      "; + //echo "in_out:$sel_in_out
      "; + + if($sel_in_out==0) + $trunk_where="and key_type=3 "; + else if($sel_in_out==1) + $trunk_where="and key_type=4 "; + else + $trunk_where="and key_type>2 and key_type<5 "; + + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "sql:$sql
      "; + + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + + do + { + $gro=$rows[0]; + for($tt=0;$tt<9;$tt++) + { + $trunk_csta[$gro][$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + + } + + //=====data for in_trunk,out_trunk,total_trunk=== + for($day=0;$day<$slot;$day++) + { + $table_name ="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + + //===in-trunk data===== + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as call_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $trunk_where="and key_type=3 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + //if the trunk group is disable + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + + for($tt=0;$tt<9;$tt++) + { + $in_trunk[$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + + //===out-trunk======= + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $trunk_where="and key_type=4 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt<9;$tt++) + { + $out_trunk[$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + + //=====total_trunk data======= + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $trunk_where="and key_type>2 and key_type<5 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt<9;$tt++) + { + $total_trunk[$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + //get the 0-hour of the day + for($day=0;$day<$slot;$day++) + { + $table_name ="mscSum"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $table_name=$table_name."_".$temp; + $from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y"))); + + //===in-trunk data===== + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as call_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $trunk_where="and key_type=3 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + //if the trunk group is disable + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + + for($tt=0;$tt<9;$tt++) + { + $in_trunk[$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + + //===out-trunk======= + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $trunk_where="and key_type=4 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt<9;$tt++) + { + $out_trunk[$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + + //=====total_trunk data======= + $select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration "; + $from="from $table_name "; + $trunk_where="and key_type>2 and key_type<5 "; + $where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where; + $group="group by key_e1_tg "; + $order="order by key_e1_tg "; + $sql=$select.$from.$where.$group.$order; + //echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + if(!$rows) + continue; + do{ + $trunk_no=$rows[0]; + if($trunk_status[$trunk_no]==0) + continue; + for($tt=0;$tt<9;$tt++) + { + $total_trunk[$tt]+=$rows[$tt+1]; + //echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}
      "; + } + }while($rows=mysqli_fetch_array($result)); + } + + +if(0) +{ + for($i=0;$i<9;$i++) + { + $in_trunk[$i]=rand(100,300); + $out_trunk[$i]=rand(100,300); + $total_trunk[$i]=$in_trunk[$i]+$out_trunk[$i]; + } +} + +//========================================================================================| +//==============================Test The Data=============================================| +//========================================================================================| +//====test the csta data==== +if(0) +{ + $test_type_label=array("attempt","success","call clear","no answer","subs busy","network busy","call barred","signalling timeout","total call duration"); + for($i=0;$i<=256;$i++) + { + for($j=0;$j<9;$j++) + { + echo "group-$i-{$test_type_label[$j]}-$j:{$trunk_csta[$i][$j]}
      "; + } + } +} +//====test the title of trunk group=== +if(0) +{ + for($i=0;$i<=256;$i++) + { + echo "group:$i {$trunk_element_title[$i]}
      "; + + } +} + +//====test the status of trunk group=== +if(0) +{ + for($i=0;$i<=256;$i++) + { + echo "group:$i {$trunk_status[$i]}
      "; + } +} + +//=====test the in_trunk,out_trunk,total_trunk== +if(0) +{ + for($i=0;$i<9;$i++) + { + echo "in-type-$i:{$in_trunk[$i]}
      "; + echo "out-type-$i:{$out_trunk[$i]}
      "; + echo "total-type-$i:{$total_trunk[$i]}
      "; + } +} +//========================================================================================| +//===========================Show the table-1=============================================| +//========================================================================================| + + //===get the numbers of days that selected=== + $slot=$sel_date_from-$sel_date_to+1; + + //====get the table title==== + $title_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y"))); + if($slot==1) + $table_title="Trunk statistic Date:".$title_time; + else + $table_title="Trunk statistic Date:".$title_time." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y"))); + + echo "

      $table_title
      "; + echo ""; + if($sel_in_out==0) + $temp="In"; + else if($sel_in_out==1) + $temp="Out"; + else if($sel_in_out==2) + $temp="In&Out"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + for($i=0;$i<=256;$i++) + { + if($trunk_status[$i]!=1) + continue; + echo ""; + + $t=$i; + echo ""; + echo ""; + for($j=0;$j<9;$j++) + { + echo ""; + } + //==average call duration===== + echo ""; + echo ""; + } + echo "
       $temp
      TG No.Element TitleAttemptSuccessCall denyNet busyCaller clearSub busyNo answerSignal errorTotal call durationAverage call
      duration(s)
      $t{$trunk_element_title[$i]}"; + if($j==0) + echo "{$trunk_csta[$i][$j]}"; + if($j>0&&$j<8) + { + echo "{$trunk_csta[$i][$j]}"; + echo "
      "; + if($trunk_csta[$i][0]==0) + $rate=0; + else + { + $rate=$trunk_csta[$i][$j]/$trunk_csta[$i][0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + if($rate==0) + $rate=0; + echo "$rate%"; + } + if($j==8) + { + echo "{$trunk_csta[$i][$j]}(s)"; + $hour=floor($trunk_csta[$i][$j]/3600); + $minute=floor($trunk_csta[$i][$j]%3600/60); + $second=$trunk_csta[$i][$j]%60; + if($hour==0&&$minute==0&&$second==0) + echo "
      "; + else + echo "
      $hour:$minute:$second"; + } + echo "
      "; + if($trunk_csta[$i][1]!=0) + $ave=round($trunk_csta[$i][8]/$trunk_csta[$i][1]); + else + $ave=0; + echo "$ave"; + echo "
      "; + + +//========================================================================================| +//=========================Show the table-2===============================================| +//========================================================================================| + + echo "
      $table_title
      "; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + //====in trunk data===== + echo ""; + echo ""; + for($i=0;$i<7;$i++) + { + echo ""; + } + echo ""; + + //===out trunk data======= + echo ""; + echo ""; + for($i=0;$i<7;$i++) + { + echo ""; + } + echo ""; + + //====total trunk data==== + echo ""; + echo ""; + for($i=0;$i<7;$i++) + { + echo ""; + } + echo "
      2.Success/failure
      TypeSuccessCall denyNet busyCaller clearSub busyNo answerSignal error
      In"; + if($in_trunk[0]!=0) + { + $rate=$in_trunk[$i+1]/$in_trunk[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo "
      Out"; + if($out_trunk[0]!=0) + { + $rate=$out_trunk[$i+1]/$out_trunk[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo "
      In&Out"; + if($total_trunk[0]!=0) + { + $rate=$total_trunk[$i+1]/$total_trunk[0]; + $rate=$rate*100; + $rate=number_format($rate,2,"."," "); + } + else + $rate=0; + if($rate==0) + $rate=0; + echo "$rate%"; + echo "
      "; + + +//========================================================================================| +//=======================Draw the Graphics-1==============================================| +//========================================================================================| + + echo "

      3.In/Out(Attempt Call)
      "; + $sizex=510; + $sizey=240; + $im = ImageCreate ($sizex, $sizey); + $background_color=ImageColorAllocate($im,255,255,255); + $black_color=ImageColorAllocate($im,0,0,0); + $white_color=ImageColorAllocate($im,255,255,255); + + $bgcolor=F8F8F8; + $fgcolor=000000; + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + $color[0]=ImageColorAllocate($im,0x33,0x33,0xff); + $color[1]=ImageColorAllocate($im,0x66,0xaa,0); + + //=====background==== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + + imageLine($im,40,20,40,200,$black_color); + imageLine($im,40,20,490,20,$black_color); + imageLine($im,490,200,490,20,$black_color); + imageLine($im,40,200,490,200,$black_color); + + //=====draw the horizonal line====== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=490; + $y2=$y1; + if($i!=10) + imageline($im,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED); + imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + + //====draw the vitical line====== + $u=floor(450/9); + for($i=0;$i<10;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color); + } + + //=====get the two block height======= + if($total_trunk[0]==0) + { + $in_trunk_percent="0%"; + $out_trunk_percent="0%"; + $height[0]=0; + $heighr[1]=0; + } + else + { + $in_trunk_percent=change_percent($in_trunk[0]/$total_trunk[0]); + $out_trunk_percent=change_percent($out_trunk[0]/$total_trunk[0]); + $height[0]=floor(180*$in_trunk[0]/$total_trunk[0]); + $height[1]=floor(180*$out_trunk[0]/$total_trunk[0]); + } + + //======draw the data block======= + for($i=0;$i<2;$i++) + { + $x1=90+(4*$i+1)*50; + if($height[$i]==0) + $height[$i]=1; + $y1=200-$height[$i]; + $x2=90+(4*$i+2)*50; + $y2=199; + imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]); + } + + //=====draw the legend string======= + imagestring($im,2,155,205,"In",$black_color); + imagestring($im,2,138,220,"(".$in_trunk_percent.")",$black_color); + imagestring($im,2,355,205,"Out",$black_color); + imagestring($im,2,340,220,"(".$out_trunk_percent.")",$black_color); + + //====show the graphics===== + //-----输出图形文件,请勿修改 + //delete *.png + $handle=opendir('.'); + while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); + } + $filename="tg1_".time().".png"; + if(1){ + ImagePng ($im,"$filename"); + + ImageDestroy($im); + } + //-----显示图片 + echo ""; + +//========================================================================================| +//==========================Draw the Graphics-2===========================================| +//========================================================================================| + + echo "

      4.Success/Failure
      "; + $sizex=600; + $sizey=250; + $image=imagecreate($sizex,$sizey); + $bgcolor=imagecolorallocate($image,255,255,255); + $black_color=ImageColorAllocate($image,0,0,0); + $white_color=ImageColorAllocate($image,255,255,255); + $bgcolor=F8F8F8; + $fgcolor=000000; + $color[0]=ImageColorAllocate($image,0x33,0x33,0xff); + $color[1]=ImageColorAllocate($image,0x66,0xaa,0); + $background_color = ImageColorAllocate ($image, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($image, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //====background==== + ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198)); + ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130)); + ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color); + + imageLine($image,40,20,40,200,$black_color); + imageLine($image,40,20,580,20,$black_color); + imageLine($image,580,200,580,20,$black_color); + imageLine($image,40,200,580,200,$black_color); + + //====draw the horizonal line=== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($image, $style); + for($i=10;$i>0;$i--) + { + $x1=40; + $y1=20+(10-$i)*18; + $x2=580; + $y2=$y1; + if($i!=10) + imageline($image, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED); + + imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color); + } + + //====draw the vitical line===== + $u=floor(540/15); + for($i=0;$i<16;$i++) + { + $x1=40+$i*$u; + $y1=20; + $x2=$x1; + $y2=200; + ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color); + } + + //=====get the block height====== + for($j=0;$j<7;$j++) + { + if($total_trunk[0]==0) + $total_height[$j][0]=1; + else + $total_height[$j][0]=floor(180*$in_trunk[$j+1]/$total_trunk[0]); + } + for($j=0;$j<7;$j++) + { + if($total_trunk[0]==0) + $total_height[$j][1]=1; + else + $total_height[$j][1]=floor(180*$out_trunk[$j+1]/$total_trunk[0]); + } + + //======draw the data block===== + for($i=0;$i<7;$i++) + { + for($j=0;$j<2;$j++) + { + if($total_height[$i][$j]<1) + $total_height[$i][$j]=1; + //echo "lie-$i-hang-$j-{$total_height[$i][$j]}
      "; + $x1=40+(2*$i+1)*36; + $y1=199; + for($z=0;$z<$j+1;$z++) + { + $y1=$y1-$total_height[$i][$z]; + } + $x2=40+(2*$i+2)*36; + $y2=199; + for($z=0;$z<$j;$z++) + { + $y2=$y2-$total_height[$i][$z]; + } + + imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]); + } + } + + //=====draw the legend string===== + imagefilledrectangle($image,150,230,165,245,$color[0]); + imagestring($image,2,170,230,"In",$black_color); + imagefilledrectangle($image,320,230,335,245,$color[1]); + imagestring($image,2,340,230,"Out",$black_color); + + imagestring($image,2,77,205,"Success",$black_color); + imagestring($image,2,135,205,"Call deny",$black_color); + imagestring($image,2,215,205,"Net busy",$black_color); + imagestring($image,2,293,200,"Caller",$black_color); + imagestring($image,2,298,212,"clear",$black_color); + imagestring($image,2,360,205,"Sub busy",$black_color); + imagestring($image,2,430,205,"No answer",$black_color); + imagestring($image,2,508,200,"Signal",$black_color); + imagestring($image,2,512,212,"error",$black_color); + + //=====show the success failure graphics==== + $tt=time()-1505; + $file_name="tg2_".$tt.".png"; + imagepng($image,$file_name); + imagedestroy($image); + echo ""; +adjust_content_tail("down"); +?> + + + diff --git a/wxc2_omc/performance/mscCsta/trunk_general_index.php b/wxc2_omc/performance/mscCsta/trunk_general_index.php new file mode 100755 index 0000000..ad1e476 --- /dev/null +++ b/wxc2_omc/performance/mscCsta/trunk_general_index.php @@ -0,0 +1,28 @@ + + + "; + echo ""; + ?> + \ No newline at end of file diff --git a/wxc2_omc/performance/mscCsta/trunk_general_up.php b/wxc2_omc/performance/mscCsta/trunk_general_up.php new file mode 100755 index 0000000..e79ee1c --- /dev/null +++ b/wxc2_omc/performance/mscCsta/trunk_general_up.php @@ -0,0 +1,178 @@ + + + + + + +"; +echo ""; +echo ""; +echo "$strTitlePerformance > MSC > Trunk group"; +echo ""; +echo ""; +$helpId = "3.2.2"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +if(!isset($scroll_y)) + $scroll_y=0; +if(!isset($sel_date_from)) + $sel_date_from=0; +if(!isset($sel_date_to)) + $sel_date_to=0; +if(!isset($sel_in_out)) + $sel_in_out=2; +if(!isset($from_hour)) + $from_hour="00"; +if(!isset($from_minute)) + $from_minute="00"; +if(!isset($from_second)) + $from_second="00"; +if(!isset($to_hour)) + $to_hour="24"; +if(!isset($to_minute)) + $to_minute="00"; +if(!isset($to_second)) + $to_second="00"; +//selection date define +$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); +$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); +$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); +$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); +$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> + +  + to  + + +Search + +"; + if($slot==1) + { + + //===============================from_hour text================================= + echo ""; + //===============================from_minute text================================ + echo ""; + //===============================from_second text================================ + echo ""; + //===============================to_hour text===================================== + echo ""; + //===============================to_minute text=================================== + echo ""; + //==============================to_second text==================================== + echo ""; + } + else + { + //===============================from_hour hidden================================= + echo ""; + //===============================from_minute hidden================================ + echo ""; + //===============================from_second hidden================================ + echo ""; + //===============================to_hour hidden===================================== + echo ""; + //===============================to_minute hidden=================================== + echo ""; + //==============================to_second hidden==================================== + echo ""; + } + + +echo ""; +echo ""; +?> + + + + +"; +echo ""; +echo ""; +echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + +?> + + diff --git a/wxc2_omc/performance/oprCsta/opps_1253802931.png b/wxc2_omc/performance/oprCsta/opps_1253802931.png new file mode 100755 index 0000000..f798755 Binary files /dev/null and b/wxc2_omc/performance/oprCsta/opps_1253802931.png differ diff --git a/wxc2_omc/performance/oprCsta/oprCstaDown.php b/wxc2_omc/performance/oprCsta/oprCstaDown.php new file mode 100755 index 0000000..c0396cf --- /dev/null +++ b/wxc2_omc/performance/oprCsta/oprCstaDown.php @@ -0,0 +1,721 @@ + + + +"; + + //global variables + $serviceFlag=array("00"=>"BothClose", + "01"=>"IMDXOpen", + "10"=>"OPROpen", + "11"=>"BothOpen"); + + + $oppsServiceStatus=getSystemState(375,94,2); + if($DEBUG)echo "oppsServiceStatus=+$oppsServiceStatus+
      "; + if($oppsServiceStatus=="") + { + exit("

      Can't receive the heartbeat of OPPS!
      "); + } + + if($serviceFlag[$oppsServiceStatus] == "OPROpen") + $type_label=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch"); + else if($serviceFlag[$oppsServiceStatus] == "IMDXOpen") + $type_label=array(0=>"IMDX MO",1=>"IMDX Location Update"); + else if($serviceFlag[$oppsServiceStatus] == "BothOpen") + $type_label=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch",3=>"IMDX MO",4=>"IMDX Location Update"); + else + { + echo "

      OPPS function disabled
      "; + adjust_content_tail("down"); + exit(" "); + } + + + //============================================================================ + //global variables + $DEBUG=0; + if(!isset($sel_date)) + $sel_date=0; + if(!isset($sel_type)) + $sel_type=0; + if($DEBUG) + { + echo "sel_type=$sel_type
      "; + echo "sel_date=$sel_date
      "; + } + //============================================================================ + + //============================================================================ + //configurable variables + $serviceFlag=array("00"=>"BothClose", + "01"=>"IMDXOpen", + "10"=>"OPROpen", + "11"=>"BothOpen"); + $oprTableTitle="OPR Statistic Date: "; + $oprTableRowHead=array("Manual Register", + "Auto Register", + "OPR LU", + "Recycle Account", + "Switch to Roam", + "Switch to OPR"); + $oprTableColHead=array("Success","Fail"); + $imdxTableTitle="IMDX Statistic Date: "; + $imdxTableRowHeadA=array("Private to Private", + "Hybrid to Private", + "Hybrid to Public", + "Premium to Public", + "Ordinary to Public", + "Public to Private"); + $imdxTableRowHeadB=array("Private Success", + "Private Excluded", + "Hybrid Success", + "Hybrid Excluded", + "Public Success", + "Public Excluded"); + $imdxTableColHead=array("MO Services","LU"); + $oprTableFieldCount=14; + $imdxTableFieldCount=15; + $oppsFieldNameInDB=array(0=>"man_reg_suc", + 1=>"man_reg_fail", + 2=>"auto_reg_suc", + 3=>"auto_reg_fail", + 4=>"opr_lu_suc", + 5=>"opr_lu_fail", + 6=>"oth_lu_suc", + 7=>"oth_lu_fail", + 8=>"recy_sub_suc", + 9=>"recy_sub_fail", + 10=>"swi_roam_mode_suc", + 11=>"swi_roam_mode_fail", + 12=>"swi_opr_mode_suc", + 13=>"swi_opr_mode_fail", + + 14=>"pri_to_pri", + 15=>"hyb_to_pri", + 16=>"hyb_to_pub", + 17=>"pub_to_pub", + 18=>"ord_to_pub", + 19=>"pub_to_pri", + 20=>"ord_lu_suc", + 21=>"hyb_lu_suc", + 22=>"pub_lu_suc", + 23=>"ord_lu_exc", + 24=>"hyb_lu_exc", + 25=>"pub_lu_exc", + 26=>"pre_lu_suc", + 27=>"pre_lu_exc", + 28=>"pre_to_pub"); + + + + + //============================================================================ + //get service status + $oppsServiceStatus=getSystemState(375,94,2); + if($DEBUG)echo "oppsServiceStatus=+$oppsServiceStatus+
      "; + if($oppsServiceStatus=="") + { + exit(""); + } + + if($serviceFlag[$oppsServiceStatus] == "OPROpen") + $type_label=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch"); + else if($serviceFlag[$oppsServiceStatus] == "IMDXOpen") + $type_label=array(0=>"IMDX MO",1=>"IMDX Location Update"); + else if($serviceFlag[$oppsServiceStatus] == "BothOpen") + $type_label=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch",3=>"IMDX MO",4=>"IMDX Location Update"); + else + exit(); + + //get whole day data from database + $db="CSTA_DB"; + $table_name="oppsDetail"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $table_name=$table_name."_".$temp; + if($DEBUG)echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + if($DEBUG)echo "from:$from_time--to:$to_time
      "; + + $select="select key_type,"; + for($i=0;$i"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + for($i=0;$i"; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + for($i=0;$i"; + $sel_date_title=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + echo "$oprTableTitle$sel_date_title
      "; + echo "
      "; + + //opr table + echo ""; + echo ""; + echo ""; + for($i=0;$i{$oprTableRowHead[$i]}"; + echo ""; + //row-1 + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //row-2 + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
       
      {$oprTableColHead[0]}{$$oppsFieldNameInDB[0]}{$$oppsFieldNameInDB[2]}{$$oppsFieldNameInDB[4]}{$$oppsFieldNameInDB[8]}{$$oppsFieldNameInDB[10]}{$$oppsFieldNameInDB[12]}
      {$oprTableColHead[1]}{$$oppsFieldNameInDB[1]}{$$oppsFieldNameInDB[3]}{$$oppsFieldNameInDB[5]}{$$oppsFieldNameInDB[9]}{$$oppsFieldNameInDB[11]}{$$oppsFieldNameInDB[13]}

      "; + } + + if($serviceFlag[$oppsServiceStatus] == "IMDXOpen" || $serviceFlag[$oppsServiceStatus] == "BothOpen") + { + //imdx table + echo "

      "; + echo "$imdxTableTitle$sel_date_title
      "; + echo "
      "; + echo ""; + echo ""; + //row-1 + echo ""; + for($i=0;$i{$imdxTableRowHeadA[$i]}"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + //row-2 + echo ""; + echo ""; + for($i=0;$i{$imdxTableRowHeadB[$i]}"; + echo ""; + $tmpdata=$$oppsFieldNameInDB[20]+$$oppsFieldNameInDB[26]; + echo ""; + $tmpdata=$$oppsFieldNameInDB[23]+$$oppsFieldNameInDB[27]; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      {$imdxTableColHead[0]}
      {$$oppsFieldNameInDB[14]}{$$oppsFieldNameInDB[15]}{$$oppsFieldNameInDB[16]}{$$oppsFieldNameInDB[28]}{$$oppsFieldNameInDB[18]}{$$oppsFieldNameInDB[19]}
      {$imdxTableColHead[1]}
      $tmpdata$tmpdata{$$oppsFieldNameInDB[21]}{$$oppsFieldNameInDB[24]}{$$oppsFieldNameInDB[22]}{$$oppsFieldNameInDB[25]}

      "; + } + //graphics + echo "

      {$type_label[$sel_type]} Chart
      "; + + $sizex=820; + $sizey=300; + $bgcolor=F8F8F8; + $fgcolor=000000; + + $im = ImageCreate ($sizex, $sizey); + + $background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + + $text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + + //======get the block legend color====== + $black_color=ImageColorAllocate($im,06,0,0); + $white_color=ImageColorAllocate($im,0xff,0xff,0xff); + $color[0]=ImageColorAllocate($im,0x66,0xff,0x33); + $color[1]=ImageColorAllocate($im,0x66,0xff,0xff); + $color[2]=ImageColorAllocate($im,0,0x66,0x66); + $color[3]=ImageColorAllocate($im,0x66,0,0xcc); + $color[4]=ImageColorAllocate($im,0x66,0x33,0); + $color[5]=ImageColorAllocate($im,0xcc,0,0x66); + //======background======== + ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); + ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + $pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); + Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); + ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + //=======border======== + $xBgn=60; + $yBgn=25; + $xEnd=780; + $yEnd=255; + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + //=======get the biggest Y-scale value============== + $maxYNum=4; + for($i=0;$i<($oprTableFieldCount+$imdxTableFieldCount);$i++) + { + for($j=0;$j<24;$j++) + { + if(!isset($dataHourly[$i][$j])) + $dataHourly[$i][$j]=0; + + if($maxYNum<$dataHourly[$i][$j]) + $maxYNum=$dataHourly[$i][$j]; + + //echo "g-$i-h-$j:{$dataHourly[$i][$j]}
      "; + } + } + + //======draw the vertical dash line====== + $tempi=0; + for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + if(($i*$slot)%24==0&&$i!=0) + $tempi++; + $xstr=$i."H"; + Imagestring($im, 2, $xBgn + $i*30 - 4, $yEnd+5, $xstr, $text_color); + } + //=======draw the horizonal dash line====== + $style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color); + imagesetstyle($im, $style); + $unitY=($yEnd-$yBgn)/10; + $unitV=$maxYNum/10; + for($i=0;$i<10;$i++){ + if($i!=0) + imageline($im, $xBgn, $yBgn + $i*$unitY, $xEnd, $yBgn + $i*$unitY, IMG_COLOR_STYLED); + $tempstr=round((10-$i)*$unitV); + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*$unitY - 5, $tempstr, $text_color); + } + //=======draw the block legend======== + if($serviceFlag[$oppsServiceStatus] == "OPROpen") + { + if($sel_type == 0) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,"Manual-Registration Success",$text_color); + + $posX=250; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,"Manual-Registration Fail",$text_color); + + $posX=440; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,"Auto-Registration Success",$text_color); + + $posX=630; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,"Auto-Registration Fail",$text_color); + $lineIndexArr=array(0=>"0",1=>"1",2=>"2",3=>"3"); + } + else if($sel_type == 1) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,"OPR LU Success",$text_color); + + $posX=250; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,"OPR LU Fail",$text_color); + + $posX=440; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,"Non-OPR LU Success",$text_color); + + $posX=630; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,"Non-OPR LU Fail",$text_color); + + $lineIndexArr=array(0=>"4",1=>"5",2=>"6",3=>"7"); + } + else if($sel_type == 2) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,"OPR to Roam Success",$text_color); + + $posX=250; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,"OPR to Roam Fail",$text_color); + + $posX=440; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,"Roam to OPR Success",$text_color); + + $posX=630; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,"Roam to OPR Fail",$text_color); + + $lineIndexArr=array(0=>"10",1=>"11",2=>"12",3=>"13"); + } + } + else if($serviceFlag[$oppsServiceStatus] == "IMDXOpen") + { + if($sel_type == 0) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[0],$text_color); + + $posX=190; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[1],$text_color); + + $posX=320; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[2],$text_color); + + $posX=450; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[3],$text_color); + + $posX=580; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[4]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[4],$text_color); + + $posX=710; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[5]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[5],$text_color); + + $lineIndexArr=array(0=>"14",1=>"15",2=>"16",3=>"28",4=>"18",5=>"19"); + } + else if($sel_type == 1) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[0],$text_color); + + $posX=190; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[1],$text_color); + + $posX=320; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[2],$text_color); + + $posX=450; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[3],$text_color); + + $posX=580; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[4]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[4],$text_color); + + $posX=710; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[5]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[5],$text_color); + + $lineIndexArr=array(0=>"20",1=>"23",2=>"21",3=>"24",4=>"22",5=>"25"); + } + } + else if($serviceFlag[$oppsServiceStatus] == "BothOpen") + { + if($sel_type == 0) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,"Manual-Registration Success",$text_color); + + $posX=250; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,"Manual-Registration Fail",$text_color); + + $posX=440; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,"Auto-Registration Success",$text_color); + + $posX=630; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,"Auto-Registration Fail",$text_color); + + $lineIndexArr=array(0=>"0",1=>"1",2=>"2",3=>"3"); + } + else if($sel_type == 1) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,"OPR LU Success",$text_color); + + $posX=250; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,"OPR LU Fail",$text_color); + + $posX=440; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,"Non-OPR LU Success",$text_color); + + $posX=630; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,"Non-OPR LU Fail",$text_color); + + $lineIndexArr=array(0=>"4",1=>"5",2=>"6",3=>"7"); + } + else if($sel_type == 2) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,"OPR to Roam Success",$text_color); + + $posX=250; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,"OPR to Roam Fail",$text_color); + + $posX=440; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,"Roam to OPR Success",$text_color); + + $posX=630; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,"Roam to OPR Fail",$text_color); + + $lineIndexArr=array(0=>"10",1=>"11",2=>"12",3=>"13"); + } + else if($sel_type == 3) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[0],$text_color); + + $posX=190; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[1],$text_color); + + $posX=320; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[2],$text_color); + + $posX=450; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[3],$text_color); + + $posX=580; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[4]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[4],$text_color); + + $posX=710; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[5]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadA[5],$text_color); + + $lineIndexArr=array(0=>"14",1=>"15",2=>"16",3=>"28",4=>"18",5=>"19"); + } + else if($sel_type == 4) + { + $posX=60; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[0]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[0],$text_color); + + $posX=190; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[1]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[1],$text_color); + + $posX=320; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[2]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[2],$text_color); + + $posX=450; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[3]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[3],$text_color); + + $posX=580; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[4]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[4],$text_color); + + $posX=710; + $posY=280; + imagefilledrectangle($im,$posX,$posY,$posX+10,$posY+10,$color[5]); + imagestring($im,2,$posX+15,$posY,$imdxTableRowHeadB[5],$text_color); + + $lineIndexArr=array(0=>"20",1=>"23",2=>"21",3=>"24",4=>"22",5=>"25"); + } + } + else + exit(); + + //draw the line + //imageline + $unitHori=($xEnd-$xBgn)/24; + $imgHeight=$yEnd-$yBgn; + for($i=0;$i"; + +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/performance/oprCsta/oprCstaFrame.php b/wxc2_omc/performance/oprCsta/oprCstaFrame.php new file mode 100755 index 0000000..56130d3 --- /dev/null +++ b/wxc2_omc/performance/oprCsta/oprCstaFrame.php @@ -0,0 +1,21 @@ + + + + + "; + echo ""; + ?> + + + <body> + <p>Frame isn't supported!</p> + </body> + + + + + + diff --git a/wxc2_omc/performance/oprCsta/oprCstaUp.php b/wxc2_omc/performance/oprCsta/oprCstaUp.php new file mode 100755 index 0000000..43baa8e --- /dev/null +++ b/wxc2_omc/performance/oprCsta/oprCstaUp.php @@ -0,0 +1,108 @@ + + + + + + + +"BothClose", + "01"=>"IMDXOpen", + "10"=>"OPROpen", + "11"=>"BothOpen"); + + + $oppsServiceStatus=getSystemState(375,94,2); + if($DEBUG)echo "oppsServiceStatus=+$oppsServiceStatus+
      "; + if($oppsServiceStatus=="") + { + //exit("

      Can't receive the heartbeat of OPPS!
      "); + } + + if($serviceFlag[$oppsServiceStatus] == "OPROpen") + $type_label=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch"); + else if($serviceFlag[$oppsServiceStatus] == "IMDXOpen") + $type_label=array(0=>"IMDX MO",1=>"IMDX Location Update"); + else if($serviceFlag[$oppsServiceStatus] == "BothOpen") + $type_label=array(0=>"OPR Registration",1=>"OPR Location Update",2=>"OPR Mode Switch",3=>"IMDX MO",4=>"IMDX Location Update"); + else + { + $type_label=array(0=>"None"); + //echo "



      "; + //exit("

      No record!
      "); + } + //title + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strTitlePerformance > OPPS"; + echo ""; + $helpId="3.10"; + showHelp($helpId); + echo "
      "; + + echo "
      "; + //type selection + echo "Type "; + //date selection + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + echo " Date "; + //search + echo " "; + echo ""; + echo "$strSearch"; + echo ""; + + echo "
       "; + echo "
      "; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + + + echo ""; +?> diff --git a/wxc2_omc/performance/ppsCsta/dataQueryDown.php b/wxc2_omc/performance/ppsCsta/dataQueryDown.php new file mode 100755 index 0000000..875397f --- /dev/null +++ b/wxc2_omc/performance/ppsCsta/dataQueryDown.php @@ -0,0 +1,398 @@ + + + +"; + +$moneyPara = getMoneyPara(); //显示的货币单位是最小货币单位的倍数 +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$timeItem = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$db=$csta_db; +$table_name='ppsDetail'."_".$showDate; + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } +$time_column = "csta_datetime"; +if(!$sort_field ) +{ + $sort_field='csta_datetime'; //排序所依赖的字段名 +} +if(!$sort_direction) +{ + $sort_direction = 'ASC '; //排序顺序 +} +$sort_direction=isset($sort_direction)?$sort_direction:'DESC'; //排序顺序 +$number_records_to_display = 200; //每页纪录数 +$sta_type=isset($sta_type)?$sta_type:'unit'; +?> + + + + "; + exit(); +}//endif($delete) + +if(!isset($number_of_records)) +{ + //-------确定日期范围----- + if($sel_date<0){ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + }elseif($sel_date>0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + /* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ + $w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + + //合成where语句 + $where=" WHERE ".$w1; + + $initial_record=0; + $str_sql=" SELECT count(*) FROM $table_name ".$where; + //echo "
      str_sql=$str_sql"; + $result = mysqli_query($pubConn,$str_sql); + $record = @mysqli_fetch_array($result); + echo mysqli_error($pubConn); + $number_of_records = $record[0]; + if(!$number_of_records) + { + echo "
      $strNotFindRecord!"; + exit(); + } +} + +if($sta_type=='unit') +{ + $sel_sql=" key_sys_id,local_calling_nums,local_called_nums,trunk_out_nums,NDD_call_nums,HMT_call_nums,IDD_call_nums,call_in_nums,periodic_charge_nums,assisted_recharge_nums,assisted_withdraw_nums,recharge_success_nums,recharge_fail_nums,sm_nums,cnf_sums,csta_datetime "; +} +elseif($sta_type=='fee') +{ + $sel_sql=" key_sys_id,local_calling_cost,local_called_cost,trunk_out_cost,NDD_call_cost,HMT_call_cost,IDD_call_cost,call_in_cost,periodic_charge_cost,assisted_recharge_cost,assisted_withdraw_cost,recharge_success_cost,recharge_fail_cost,sm_cost,cnf_cost,csta_datetime "; +} +else +{ + $sel_sql=" key_sys_id,local_calling_duration,local_called_duration,trunk_out_duration,NDD_call_duration,HMT_call_duration,IDD_call_duration,call_in_duration,periodic_charge_duration,assisted_recharge_duration,assisted_withdraw_duration,recharge_success_duration,recharge_fail_duration,sm_duration,cnf_duration,csta_datetime "; +} +$str_sql=" SELECT $sel_sql FROM $table_name ".$where. + " ORDER BY $sort_field $sort_direction + LIMIT $initial_record, $number_records_to_display + "; +//echo "
      str_sql=$str_sql"; +$result=mysqli_query($pubConn,$str_sql); +$rows = @mysqli_fetch_array($result); +echo mysqli_error($pubConn); +if(!$rows) +{ + echo "
      $strNotFindRecord"; + exit(); +} + +if($number_of_records >= 1) { + //下面是控制分页显示,传递变量 + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records){ + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0) { + $prev_index = 0; + } +} +?> + +

      "> + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +$sum_all_rows_2[0]=$sum_all_rows_2[0];//$moneyPara; +$sum_all_rows_2[1]=$sum_all_rows_2[1];//$moneyPara; +$sum_all_rows_2[2]=$sum_all_rows_2[2];//$moneyPara; +$sum_all_rows_2[3]=$sum_all_rows_2[3];//$moneyPara; +$sum_all_rows_2[4]=$sum_all_rows_2[4];//$moneyPara; +$sum_all_rows_2[5]=$sum_all_rows_2[5];//$moneyPara; +$sum_all_rows_2[6]=$sum_all_rows_2[6];//$moneyPara; +$sum_all_rows_2[7]=$sum_all_rows_2[7];//$moneyPara; +$sum_all_rows_2[8]=$sum_all_rows_2[8];//$moneyPara; +$sum_all_rows_2[9]=$sum_all_rows_2[9];//$moneyPara; +$sum_all_rows_2[10]=$sum_all_rows_2[10];//$moneyPara; +$sum_all_rows_2[11]=$sum_all_rows_2[11];//$moneyPara; +$sum_all_rows_2[12]=$sum_all_rows_2[12];//$moneyPara; +$sum_all_rows_2[13]=$sum_all_rows_2[13];//$moneyPara; + +echo ""; +echo ""; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +//echo ""; +echo ""; +echo ""; +echo ""; + +$show_initial_record=$initial_record+1; +?> +
      $strTotal$strLocalCallOut$strLocalCallIn$strTrunkCallOut$strNDDCallOut$strHMTCallOut$strIDDCallOut$strTrunkCallIn$strPeriodicCharge$strIncrementValue$strDecreaseValue$strRechargeSuccess$strRechargeFailureSMCNF
      $strCallTimes$sum_all_rows_1[0]$sum_all_rows_1[1]$sum_all_rows_1[2]$sum_all_rows_1[3]$sum_all_rows_1[4]$sum_all_rows_1[5]$sum_all_rows_1[6]$sum_all_rows_1[7]$sum_all_rows_1[8]$sum_all_rows_1[9]$sum_all_rows_1[10]$sum_all_rows_1[11]$sum_all_rows_1[12]$sum_all_rows_1[13]
      $strFeeYuan$sum_all_rows_2[0]$sum_all_rows_2[1]$sum_all_rows_2[2]$sum_all_rows_2[3]$sum_all_rows_2[4]$sum_all_rows_2[5]$sum_all_rows_2[6]$sum_all_rows_2[7]$sum_all_rows_2[8]$sum_all_rows_2[9]$sum_all_rows_2[10]$sum_all_rows_2[11]$sum_all_rows_2[12]$sum_all_rows_2[13]
      $strDurationSecond$sum_all_rows_3[0]$sum_all_rows_3[1]$sum_all_rows_3[2]$sum_all_rows_3[3]$sum_all_rows_3[4]$sum_all_rows_3[5]$sum_all_rows_3[6]$sum_all_rows_3[7]$sum_all_rows_3[8]$sum_all_rows_3[9]$sum_all_rows_3[10]$sum_all_rows_3[11]$sum_all_rows_3[12]$sum_all_rows_3[13]
      +

      + + + + + + + +
       $show_initial_record - $next_index, ($strTotal:$number_of_records)";?>  + "; + echo "\"$strPreviousPage\" "; + } + + // NEW: Display a link for the next set of records. + if ($next_index != $number_of_records && $number_of_records >0) { + $t1 = "initial_record=$next_index&number_of_records=$number_of_records"; + $t2 = "sel_date=$sel_date&sort_direction=$sort_direction&sta_type=$sta_type"; + echo ""; + echo "\" "; + } + if($number_of_records > 0){ + $this_page = $initial_record / $number_records_to_display + 1; + $all_page = round($number_of_records / $number_records_to_display ); + if($number_of_records % $number_records_to_display > 0){ + $all_page = $all_page + 1; + } + } + + + ?> + + +
      + + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + do{ + if($sta_type=='fee'){ + $rows[1]=$rows[1];//$moneyPara; + $rows[2]=$rows[2];//$moneyPara; + $rows[3]=$rows[3];//$moneyPara; + $rows[4]=$rows[4];//$moneyPara; + $rows[5]=$rows[5];//$moneyPara; + $rows[6]=$rows[6];//$moneyPara; + $rows[7]=$rows[7];//$moneyPara; + $rows[8]=$rows[8];//$moneyPara; + $rows[9]=$rows[9];//$moneyPara; + $rows[10]=$rows[10];//$moneyPara; + $rows[11]=$rows[11];//$moneyPara; + $rows[12]=$rows[12];//$moneyPara; + $rows[13]=$rows[13];//$moneyPara; + $rows[14]=$rows[14];//$moneyPara; + } + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + $tmpArray = explode(" ",$rows[csta_datetime]); + echo ""; + echo ""; + }while($rows = mysqli_fetch_array($result)); + ?> +
      $strSystem$strLocalCallOut$strLocalCallIn$strTrunkCallOut$strNDDCallOut$strHMTCallOut$strIDDCallOut$strTrunkCallIn$strPeriodicCharge$strIncrementValue$strDecreaseValue$strRechargeSuccess$strRechargeFailureSMCNF$strTime($timeItem)
      $rows[0]$rows[1]$rows[2]$rows[3]$rows[4]$rows[5]$rows[6]$rows[7]$rows[8]$rows[9]$rows[10]$rows[11]$rows[12]$rows[13]$rows[14]$tmpArray[1]
      + + + + + +
      + + + diff --git a/wxc2_omc/performance/ppsCsta/dataQueryIndex.php b/wxc2_omc/performance/ppsCsta/dataQueryIndex.php new file mode 100755 index 0000000..1190c33 --- /dev/null +++ b/wxc2_omc/performance/ppsCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/ppsCsta/dataQueryUp.php b/wxc2_omc/performance/ppsCsta/dataQueryUp.php new file mode 100755 index 0000000..03c8de4 --- /dev/null +++ b/wxc2_omc/performance/ppsCsta/dataQueryUp.php @@ -0,0 +1,93 @@ + + + + + + +
      + +"; + echo ""; + echo ""; + echo "$strAdvanced > $strPerformance > PPS > Query"; + echo ""; + echo ""; +// showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> + + +"; + echo ""; + + echo ""; + echo ""; + echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + +
      + + diff --git a/wxc2_omc/performance/ppsDailyReport/1305466077.png b/wxc2_omc/performance/ppsDailyReport/1305466077.png new file mode 100755 index 0000000..23d5db7 Binary files /dev/null and b/wxc2_omc/performance/ppsDailyReport/1305466077.png differ diff --git a/wxc2_omc/performance/ppsDailyReport/13054660771.png b/wxc2_omc/performance/ppsDailyReport/13054660771.png new file mode 100755 index 0000000..b2b0d34 Binary files /dev/null and b/wxc2_omc/performance/ppsDailyReport/13054660771.png differ diff --git a/wxc2_omc/performance/ppsDailyReport/13054660772.png b/wxc2_omc/performance/ppsDailyReport/13054660772.png new file mode 100755 index 0000000..99ce92a Binary files /dev/null and b/wxc2_omc/performance/ppsDailyReport/13054660772.png differ diff --git a/wxc2_omc/performance/ppsDailyReport/13054660773.png b/wxc2_omc/performance/ppsDailyReport/13054660773.png new file mode 100755 index 0000000..d5c6922 Binary files /dev/null and b/wxc2_omc/performance/ppsDailyReport/13054660773.png differ diff --git a/wxc2_omc/performance/ppsDailyReport/dailyReportDown.php b/wxc2_omc/performance/ppsDailyReport/dailyReportDown.php new file mode 100755 index 0000000..ed5ae1e --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/dailyReportDown.php @@ -0,0 +1,564 @@ +\n"; + echo "parent.window.location.href=\"../../element/bssSpecific/alarm_show.php?info=$info&backurl=$backurl\";\n"; + echo "\n"; + +} + + +$db='PPS_DB'; + +global $OMC_server; +$ppsDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $db); + +$face_value_type = 6; +$moneyPara = getMoneyPara_forPpsReport(); //显示的货币单位是最小货币单位的倍数 +$moneyPara=$moneyPara+0; + +if(!isset($moneyPara)||$moneyPara==0||trim($moneyPara)=="") +{ + $info="The parameter (currency_decimal)
      has no value,please set it!"; + $backurl="../../sysDefine/pubVarDef/paramList.php"; + show_alarm($info,$backurl); +} + + +$dotLen = strLen($moneyPara) - 1; +//echo "
      dotLen=$dotLen"; +$fmtBit = "%01.".$dotLen."f"; +?> + + + + + +"; + +$query_year=$_REQUEST['query_year']; +$query_month=$_REQUEST['query_month']; +$query_day=$_REQUEST['query_day']; + + +if(!$query_year){ + $query_year=date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $query_month=date("m",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $query_day=date("d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +} + +$defaultDate="$query_year-$query_month-$query_day"; +if ($keep_date == 1){ + $selectedDate = $selectedDate; +} +else { + $selectedDate=isset($selectedDate)?$selectedDate:$defaultDate; +} +$strQuery="SELECT * + FROM daily_report + WHERE date='$selectedDate'"; +//echo "
      strQuery=$strQuery"; +$query=mysqli_query($ppsDbConn,$strQuery); +echo mysqli_error($ppsDbConn); +$array=mysqli_fetch_array($query); +if(!$array){ + echo "$strDailyNoRecord($query_year-$query_month-$query_day)!"; + exit(); +} +?> + + + + + + + + + + +
      + +   + +
      + +
      +
      +
      + +"; +echo "$strPPSDailyReport  "; +echo"$strDate:$selectedDate"; +echo ""; +//----------------------------------全局统计-------------------------------------------------------- +?> + + +  "; + echo " "; + echo " "; + ?> + + "; + echo ""; + $fresh_user_num = showComma($array[fresh_user_num]); + echo ""; + echo ""; + echo ""; + + echo ""; + $normal_user_num = showComma($array[normal_user_num]); + echo ""; + echo ""; + echo ""; + + echo ""; + $suspend_user_num = showComma($array[suspend_user_num]); + echo ""; + echo ""; + echo ""; + + echo ""; + $blacklist_user_num = showComma($array[blacklist_user_num]); + echo ""; + echo ""; + echo ""; + + echo ""; + $released_user_num = showComma($array[released_user_num]); + echo ""; + echo ""; + echo ""; + + echo ""; + $opr_trial_user_num = showComma($array[opr_trial_user_num]); + echo ""; + echo ""; + echo ""; + + echo ""; + $total_user_num = showComma($array[total_user_num]); + echo ""; + echo ""; + echo ""; +?> +
      $strDailyUserState$strDailyUserNum
      $strDailyUserTitle$strDailyFresh$fresh_user_num
      $strDailyUsing$normal_user_num
      $strDailySuspend$suspend_user_num
      $strBlackList$blacklist_user_num
      $strReleased$released_user_num
      OPR Trial$opr_trial_user_num
      $strTotal$total_user_num
      + + +

      + + +  "; + echo " "; + + + for($i=1;$i<=$face_value_type;$i++) + { + $ValueList="precard_facevalue".$i; + $showValue=$array[$ValueList]/$moneyPara; + if($showValue == 0){ + echo ""; + $arr_FaceValueList[$i] = 0; + }else{ + echo ""; + $arr_FaceValueList[$i] = 1; + } + } + ?> + + "; + echo ""; + echo ""; + for($i=1;$i<=$face_value_type;$i++) + { + $precard_used_today="precard_used_today".$i; + $precardUsed=showComma($array[$precard_used_today]); + if($arr_FaceValueList[$i] == 1){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + + echo ""; + echo ""; + for($i=1;$i<$face_value_type+1;$i++) + { + $precard_unused="precard_unused".$i; + $precardUnused=showComma($array[$precard_unused]); + if($arr_FaceValueList[$i] == 1){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + ?> + +
      $strDailyCardFace-- ($strValueCurrency"; + echo "$showValue)"; + echo "
      $strPrepaidCard$strTodayCharged$precardUsed--
      $strNotCharged$precardUnused--
      + + +

      + + +  "; + echo " "; + echo " "; + echo " "; + echo " "; + ?> + + + + + $strDailyCallIncoming"; + $incoming_call_nums = showComma($array[incoming_call_num]); + $incoming_call_duration = showComma($array[incoming_call_duration]); + + $incoming_call_charge = showComma(sprintf("$fmtBit",$array[incoming_call_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallIDD"; + $IDD_call_nums = showComma($array[IDD_call_num]); + $IDD_call_duration = showComma($array[IDD_call_duration]); + $IDD_call_charge = showComma(sprintf("$fmtBit",$array[IDD_call_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallNDD"; + $NDD_call_nums = showComma($array[NDD_call_num]); + $NDD_call_duration = showComma($array[NDD_call_duration]); + $NDD_call_charge = showComma(sprintf("$fmtBit",$array[NDD_call_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallLocalOut"; + $local_callout_nums = showComma($array[local_callout_num]); + $local_callout_duration = showComma($array[local_callout_duration]); + $local_callout_charge = showComma(sprintf("$fmtBit",$array[local_callout_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallSMS"; + $short_message_nums = showComma($array[short_message_num]); + $short_message_duration = showComma($array[short_message_duration]); + $short_message_charge = showComma(sprintf("$fmtBit",$array[short_message_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + Short message via web"; + $short_message_via_web_nums = showComma($array[short_message_via_web_num]); + $short_message_via_web_duration = showComma($array[short_message_via_web_duration]); + $short_message_via_web_charge = showComma(sprintf("$fmtBit",$array[short_message_via_web_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallConferenceCall"; + $conference_call_nums = showComma($array[conference_call_num]); + $conference_call_duration = showComma($array[conference_call_duration]); + $conference_call_charge = showComma(sprintf("$fmtBit",$array[conference_call_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallRent"; + $rent_charging_nums = showComma($array[rent_charging_num]); + $rent_charging_duration = showComma($array[rent_charging_duration]); + $rent_charge = showComma(sprintf("$fmtBit",$array[rent_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + + + $strOperatorRecharge"; + $ast_recharge_nums = showComma($array[ast_recharge_num]); + $ast_recharge_duration = showComma($array[ast_recharge_duration]); + $ast_recharge = showComma(sprintf("$fmtBit",$array[ast_recharge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strOperatorCharge"; + $ast_charge_nums = showComma($array[ast_charge_num]); + $ast_charge_duration = showComma($array[ast_charge_duration]); + $ast_charge = showComma(sprintf("$fmtBit",$array[ast_charge]/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strTotal"; + $total_call_num = showComma($array[total_call_num]); + $total_call_charge = showComma(sprintf("$fmtBit",$array[total_call_charge]/$moneyPara)); + $total_call_duration = showComma($array[total_call_duration]); + echo ""; + echo ""; + echo ""; + ?> + +
      $strDailyCallType$strDailyCallTimes$strDailyCallDuration$strDailyCallCharge
      $incoming_call_nums$incoming_call_duration$incoming_call_charge
      $IDD_call_nums$IDD_call_duration$IDD_call_charge
      $NDD_call_nums$NDD_call_duration$NDD_call_charge
      $local_callout_nums$local_callout_duration$local_callout_charge
      $short_message_nums$short_message_duration$short_message_charge
      $short_message_via_web_nums$short_message_via_web_duration$short_message_via_web_charge
      $conference_call_nums$conference_call_duration$conference_call_charge
      $rent_charging_nums$rent_charging_duration$rent_charge
      $ast_recharge_nums$ast_recharge_duration$ast_recharge
      $ast_charge_nums$ast_charge_duration$ast_charge
      $total_call_num$total_call_duration$total_call_charge
      + +

      + +"; + echo ""; + echo " "; + echo "GPRS volume(KB)"; + echo "GPRS duration(s)"; + echo "GPRS charged"; + echo ""; + + echo ""; + echo "GPRS statistic"; + echo " $total_gprs_volume"; + echo " $total_gprs_duration"; + echo " $total_gprs_charged"; + echo ""; + + echo "
      "; + + + $total_sms_number=$array[sms_number]; + $total_sms_charged=$array[sms_charged]; + $total_mms_send_number=$array[mms_send_number]; + $total_mms_send_charged=$array[mms_send_charged]; + $total_mms_retrieve_number=$array[mms_retrieve_number]; + $total_mms_retrieve_charged=$array[mms_retrieve_charged]; + $total_mms_email_number=$array[mms_email_number]; + $total_mms_email_charged=$array[mms_email_charged]; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
       SMS numberSMS chargedMMS send numberMMS send chargedMMS retrieve numberMMS retrieve chargedMMS email numberMMS email charged
      MMS statistic $total_sms_number $total_sms_charged $total_mms_send_number $total_mms_send_charged $total_mms_retrieve_number $total_mms_retrieve_charged $total_mms_email_number $total_mms_email_charged
      "; + +?> + + +

      + +  "; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + + + $strAccountSummary"; + $yesterday_balance = showComma(sprintf("$fmtBit",$array[yesterday_balance]/$moneyPara)); + $today_recharge = showComma(sprintf("$fmtBit",$array[today_recharge]/$moneyPara)); + $today_charge = showComma(sprintf("$fmtBit",$array[today_charge]/$moneyPara)); + $today_balance = showComma(sprintf("$fmtBit",$array[today_balance]/$moneyPara)); + echo ""; + echo ""; + echo ""; + echo ""; + ?> + +
      $strAccountYestodayBalance$strAccountTodayRecharge$strAccountTodayBalance$strAccountTotalCharge
      $yesterday_balance$today_recharge$today_balance$today_charge
      + + + +

       

      +
      + +$strDailyOperator: "; + echo "$userInfo[ID]"; + echo "              "; + echo "$strDailyPrintTime"; +?> + + +
      + + + + diff --git a/wxc2_omc/performance/ppsDailyReport/dailyReportIndex.php b/wxc2_omc/performance/ppsDailyReport/dailyReportIndex.php new file mode 100755 index 0000000..033c8b5 --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/dailyReportIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/ppsDailyReport/dailyReportUp.php b/wxc2_omc/performance/ppsDailyReport/dailyReportUp.php new file mode 100755 index 0000000..c525900 --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/dailyReportUp.php @@ -0,0 +1,103 @@ + + + +
      +"; +echo ""; +echo ""; +echo "$strTitlePerformance $strTitleSpace $strPPSDailyReport"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +$newyear =date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$newmon =date("m",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$newday =date("d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$oldyear =date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y")-1)); +//--年-- + echo "$strYear  "; + + //--月-- + echo "$strMonth  "; + + //--日-- + echo "$strDay  "; + +?> + + + +"; +echo ""; +echo " "; +echo ""; +echo ""; +echo ""; +echo "
      "; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + + + + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/ppsDailyReport/monthlyReportDown.php b/wxc2_omc/performance/ppsDailyReport/monthlyReportDown.php new file mode 100755 index 0000000..9729845 --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/monthlyReportDown.php @@ -0,0 +1,1624 @@ + + + + +\n"; + echo "parent.window.location.href=\"../../element/bssSpecific/alarm_show.php?info=$info&backurl=$backurl\";\n"; + echo "\n"; + +} + +adjust_head_frame("down"); +adjust_title_head_frame("down"); +adjust_title_tail_frame("down"); + +adjust_content_head_frame("down"); +echo "
      "; + +$DEBUG=0; +$db='PPS_DB'; +global $OMC_server; +$ppsDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $db); +$face_value_type = 6; +$moneyPara = getMoneyPara_forPpsReport(); //显示的货币单位是最小货币单位的倍数 + +$moneyPara=$moneyPara+0; + +if(!isset($moneyPara)||$moneyPara==0||trim($moneyPara)=="") +{ + $info="The parameter (currency_decimal)
      has no value,please set it!"; + $backurl="../../sysDefine/pubVarDef/paramList.php"; + show_alarm($info,$backurl); +} + + +$dotLen = strLen($moneyPara) - 1; +//echo "
      dotLen=$dotLen"; +$fmtBit = "%01.".$dotLen."f"; +?> + + +"; + +$year=date("Y")."-".date("m")."-".date("d").",".date("D"); +if($DEBUG) echo "$year
      "; + +$thisFebDays=date("t",mktime(0,0,0,2,1,date("Y"))); +$lastFebDays=date("t",mktime(0,0,0,2,1,(date("Y")-1))); +if($DEBUG) echo "thisFebDays=$thisFebDays, lastFebDays=$lastFebDays
      "; + +$monDays = array( + "0" => "31", + "1" => "$thisFebDays", + "2" => "31", + "3" => "30", + "4" => "31", + "5" => "30", + "6" => "31", + "7" => "31", + "8" => "30", + "9" => "31", + "10" => "30", + "11" => "31", +); +/* +$i=0; +for($i=0;$i<12;$i++){ + echo "$monDays[$i],"; +} +*/ +$bgnMonth = $query_month; +$bgnDay = "01"; +$bgnDay = $query_year."-".$bgnMonth."-".$bgnDay; +if($DEBUG) echo "bgnDay=$bgnDay
      "; + +$endMonth = $query_month; +$endDay = $monDays[$endMonth-1]; +$endDay = $query_year."-".$endMonth."-".$endDay; +if($DEBUG) echo "endDay=$endDay
      "; + +if($DEBUG) echo "
      "; + +$selSQL ="SELECT * FROM daily_report WHERE date>='$bgnDay' and date<='$endDay' order by date ASC"; +if($DEBUG) echo "selSQL=$selSQL
      "; +$selRes = mysqli_query($ppsDbConn,$selSQL); +echo mysqli_error($ppsDbConn); +$selRow = @mysqli_fetch_array($selRes); +if(!$selRow){ + echo "No record found!($query_year-$query_month)!"; + exit(); +} +//Account summary +$lastMonthBalance=0; +$thisMonthRecharge=0; +$thisMonthBalance=0; +$thisMonthCharge=0; + +//Account report +$thisMonthFresh=0; +$thisMonthInuse=0; +$thisMonthSuspended=0; +$thisMonthBlacklist=0; +$thisMonthReleased=0; +$thisMonthOprTrial=0; +$thisMonthTotal=0; + +//Recharge card +$faceValue1=0; +$thisMonthFaceValue1Used=0; +$thisMonthFaceValue1Unused=0; +$faceValue2=0; +$thisMonthFaceValue2Used=0; +$thisMonthFaceValue2Unused=0; +$faceValue3=0; +$thisMonthFaceValue3Used=0; +$thisMonthFaceValue3Unused=0; +$faceValue4=0; +$thisMonthFaceValue4Used=0; +$thisMonthFaceValue4Unused=0; +$faceValue5=0; +$thisMonthFaceValue5Used=0; +$thisMonthFaceValue5Unused=0; +$faceValue6=0; +$thisMonthFaceValue6Used=0; +$thisMonthFaceValue6Unused=0; + +//Call statistics +$thisMonthIncomingCallNumber=0; +$thisMonthIncomingCallDuration=0; +$thisMonthIncomingCallCharge=0; + +$thisMonthLocalCallNumber=0; +$thisMonthLocalCallDuration=0; +$thisMonthLocalCallCharge=0; + +$thisMonthIDDCallNumber=0; +$thisMonthIDDCallDuration=0; +$thisMonthIDDCallCharge=0; + +$thisMonthNDDCallNumber=0; +$thisMonthNDDCallDuration=0; +$thisMonthNDDCallCharge=0; + +$thisMonthShortMessageNumber=0; +$thisMonthShortMessageDuration=0; +$thisMonthShortMessageCharge=0; + +$thisMonthShortMessageViaWebNumber=0; +$thisMonthShortMessageViaWebDuration=0; +$thisMonthShortMessageViaWebCharge=0; + +$thisMonthConferenceCallNumber=0; +$thisMonthConferenceCallDuration=0; +$thisMonthConferenceCallCharge=0; + +$thisMonthRentNumber=0; +$thisMonthRentDuration=0; +$thisMonthRentCharge=0; + +$thisMonthRechargeSuccNumber=0; +$thisMonthRechargeSuccDuration=0; +$thisMonthRechargeSuccCharge=0; + +$thisMonthRechargeFailNumber=0; +$thisMonthRechargeFailDuration=0; +$thisMonthRechargeFailCharge=0; + +$thisMonthOperatorRechargeNumber=0; +$thisMonthOperatorRechargeDuration=0; +$thisMonthOperatorRechargeCharge=0; + +$thisMonthChargeNumber=0; +$thisMonthChargeDuration=0; +$thisMonthChargeCharge=0; + +$thisMonthTotalNumber=0; +$thisMonthTotalDuration=0; +$thisMonthTotalCharge=0; + + +$thisMonthTotalGPRSVolume=0; +$thisMonthTotalGPRSDuration=0; +$thisMonthTotalGPRSCharged=0; + +$thisMonthTotalSMSNumber=0; +$thisMonthTotalSMSCharged=0; +$thisMonthTotalMMSSendNumber=0; +$thisMonthTotalMMSSendCharged=0; +$thisMonthTotalMMSRetrieveNumber=0; +$thisMonthTotalMMSRetrieveCharged=0; +$thisMonthTotalMMSEmailNumber=0; +$thisMonthTotalMMSEmailCharged=0; + +do{ + //Account summary + if ($lastMonthBalance==0) + $lastMonthBalance = $selRow[yesterday_balance]; + $thisMonthRecharge += $selRow[today_recharge]; + $thisMonthBalance = $selRow[today_balance]; + $thisMonthCharge += $selRow[today_charge]; + $pieces = explode("-",$selRow[date]); + $dayCharge[$pieces[2]] = $selRow[today_charge]; + //echo "dayCharge[$pieces[2]]={$dayCharge[$pieces[2]]}
      "; + + //Account report + $thisMonthFresh = $selRow[fresh_user_num]; + $thisMonthInuse = $selRow[normal_user_num]; + $thisMonthSuspended = $selRow[suspend_user_num]; + $thisMonthBlacklist = $selRow[blacklist_user_num]; + $thisMonthReleased = $selRow[released_user_num]; + $thisMonthOprTrial = $selRow[opr_trial_user_num]; + $thisMonthTotal = $selRow[total_user_num]; + + //Recharge card + $faceValue1 = ($selRow[precard_facevalue1]>0)?$selRow[precard_facevalue1]:$faceValue1; + $thisMonthFaceValue1Used += $selRow[precard_used_today1]; + $dayFaceValue1Used[$pieces[2]] = $selRow[precard_used_today1]; + $thisMonthFaceValue1Unused = $selRow[precard_unused1]; + + $faceValue2 = ($selRow[precard_facevalue2]>0)?$selRow[precard_facevalue2]:$faceValue2; + $thisMonthFaceValue2Used += $selRow[precard_used_today2]; + $dayFaceValue2Used[$pieces[2]] = $selRow[precard_used_today2]; + $thisMonthFaceValue2Unused = $selRow[precard_unused2]; + + $faceValue3 = ($selRow[precard_facevalue3]>0)?$selRow[precard_facevalue3]:$faceValue3; + $thisMonthFaceValue3Used += $selRow[precard_used_today3]; + $dayFaceValue3Used[$pieces[2]] = $selRow[precard_used_today3]; + $thisMonthFaceValue3Unused = $selRow[precard_unused3]; + + $faceValue4 = ($selRow[precard_facevalue4]>0)?$selRow[precard_facevalue4]:$faceValue4; + $thisMonthFaceValue4Used += $selRow[precard_used_today4]; + $dayFaceValue4Used[$pieces[2]] = $selRow[precard_used_today4]; + $thisMonthFaceValue4Unused = $selRow[precard_unused4]; + + $faceValue5 = ($selRow[precard_facevalue5]>0)?$selRow[precard_facevalue5]:$faceValue5; + $thisMonthFaceValue5Used += $selRow[precard_used_today5]; + $dayFaceValue5Used[$pieces[2]] = $selRow[precard_used_today5]; + $thisMonthFaceValue5Unused = $selRow[precard_unused5]; + + $faceValue6 = ($selRow[precard_facevalue6]>0)?$selRow[precard_facevalue6]:$faceValue6; + $thisMonthFaceValue6Used += $selRow[precard_used_today6]; + $dayFaceValue6Used[$pieces[2]] = $selRow[precard_used_today6]; + $thisMonthFaceValue6Unused = $selRow[precard_unused6]; + + //Call statistics + $thisMonthIncomingCallNumber += $selRow[incoming_call_num ]; + $thisMonthIncomingCallDuration += $selRow[incoming_call_duration]; + $thisMonthIncomingCallCharge += $selRow[incoming_call_charge]; + + $thisMonthLocalCallNumber += $selRow[local_callout_num]; + $thisMonthLocalCallDuration += $selRow[local_callout_duration]; + $thisMonthLocalCallCharge += $selRow[local_callout_charge]; + + $thisMonthIDDCallNumber += $selRow[IDD_call_num]; + $thisMonthIDDCallDuration += $selRow[IDD_call_duration]; + $thisMonthIDDCallCharge += $selRow[IDD_call_charge]; + + $thisMonthNDDCallNumber += $selRow[NDD_call_num]; + $thisMonthNDDCallDuration += $selRow[NDD_call_duration]; + $thisMonthNDDCallCharge += $selRow[NDD_call_charge]; + + $thisMonthShortMessageNumber += $selRow[short_message_num]; + $thisMonthShortMessageDuration += $selRow[short_message_duration]; + $thisMonthShortMessageCharge += $selRow[short_message_charge]; + + $thisMonthShortMessageViaWebNumber += $selRow[short_message_via_web_num]; + $thisMonthShortMessageViaWebDuration += $selRow[short_message_via_web_duration]; + $thisMonthShortMessageViaWebCharge += $selRow[short_message_via_web_charge]; + + $thisMonthConferenceCallNumber += $selRow[conference_call_num]; + $thisMonthConferenceCallDuration += $selRow[conference_call_duration]; + $thisMonthConferenceCallCharge += $selRow[conference_call_charge]; + + $thisMonthRentNumber += $selRow[rent_charging_num]; + $thisMonthRentDuration += $selRow[rent_charging_duration]; + $thisMonthRentCharge += $selRow[rent_charge]; + + $thisMonthRechargeSuccNumber += $selRow[recharge_suc_num]; + $thisMonthRechargeSuccDuration += $selRow[recharge_suc_duration]; + $thisMonthRechargeSuccCharge += $selRow[recharge_suc]; + + $thisMonthRechargeFailNumber += $selRow[recharge_fail_num]; + $thisMonthRechargeFailDuration += $selRow[recharge_fail_duration]; + $thisMonthRechargeFailCharge += $selRow[recharge_fail]; + + $thisMonthOperatorRechargeNumber += $selRow[ast_recharge_num]; + $thisMonthOperatorRechargeDuration += $selRow[ast_recharge_duration]; + $thisMonthOperatorRechargeCharge += $selRow[ast_recharge]; + + $thisMonthChargeNumber += $selRow[ast_charge_num]; + $thisMonthChargeDuration += $selRow[ast_charge_duration]; + $thisMonthChargeCharge += $selRow[ast_charge]; + + $thisMonthTotalNumber += $selRow[total_call_num]; + $thisMonthTotalDuration += $selRow[total_call_duration]; + $thisMonthTotalCharge += $selRow[total_call_charge]; + + $thisMonthTotalGPRSVolume+=($selRow[gprs_volume]-0)/1024; + $thisMonthTotalGPRSDuration+=($selRow[gprs_duration]-0)/3600; + $thisMonthTotalGPRSCharged+=$selRow[gprs_charged]-0; + + $thisMonthTotalSMSNumber+=$selRow[sms_number]; + $thisMonthTotalSMSCharged+=$selRow[sms_charged]; + $thisMonthTotalMMSSendNumber+=$selRow[mms_send_number]; + $thisMonthTotalMMSSendCharged+=$selRow[mms_send_charged]; + $thisMonthTotalMMSRetrieveNumber+=$selRow[mms_retrieve_number]; + $thisMonthTotalMMSRetrieveCharged+=$selRow[mms_retrieve_charged]; + $thisMonthTotalMMSEmailNumber+=$selRow[mms_email_number]; + $thisMonthTotalMMSEmailCharged+=$selRow[mms_email_charged]; + +}while($selRow=mysqli_fetch_array($selRes)); + +$thisMonthTotalGPRSVolume=number_format($thisMonthTotalGPRSVolume,3,'.',''); +$thisMonthTotalGPRSDuration=number_format($thisMonthTotalGPRSDuration,3,'.',''); + +if($DEBUG){ + echo "lastMonthBalance=$lastMonthBalance, "; + echo "thisMonthRecharge=$thisMonthRecharge, "; + echo "thisMonthBalance=$thisMonthBalance, "; + echo "thisMonthCharge=$thisMonthCharge, "; + echo "
      "; + echo "thisMonthFresh=$thisMonthFresh, "; + echo "thisMonthInuse=$thisMonthInuse, "; + echo "thisMonthSuspended=$thisMonthSuspended, "; + echo "thisMonthBlacklist=$thisMonthBlacklist, "; + echo "thisMonthReleased=$thisMonthReleased, "; + echo "thisMonthTotal=$thisMonthTotal, "; + echo "
      "; + echo "faceValue1=$faceValue1, "; + echo "thisMonthFaceValue1Used=$thisMonthFaceValue1Used, "; + echo "thisMonthFaceValue1Unused=$thisMonthFaceValue1Unused, "; + echo "
      "; + echo "thisMonthFaceValue2Used=$thisMonthFaceValue2Used, "; + echo "thisMonthFaceValue2Unused=$thisMonthFaceValue2Unused, "; + echo "
      "; + echo "thisMonthFaceValue3Used=$thisMonthFaceValue3Used, "; + echo "thisMonthFaceValue3Unused=$thisMonthFaceValue3Unused, "; + echo "
      "; + echo "thisMonthFaceValue4Used=$thisMonthFaceValue4Used, "; + echo "thisMonthFaceValue4Unused=$thisMonthFaceValue4Unused, "; + echo "
      "; +} + +/************* 统计前几个月的收费情况 ***************/ +for($i=1;$i<=12;$i++){ + $monCharge[$i]=0; + $selBgnDay = $query_year."-".($i<10?"0":"").$i."-01"; + $selEndDay = $query_year."-".($i<10?"0":"").$i."-".$monDays[$i-1]; + if($DEBUG) echo "selBgnDay=$selBgnDay, selEndDay=$selEndDay
      "; + $selSQL = "SELECT * FROM daily_report WHERE date>='$selBgnDay' and date<='$selEndDay'"; + if($DEBUG) echo "selSQL=$selSQL
      "; + $selRes = mysqli_query($ppsDbConn,$selSQL); + echo mysqli_error($ppsDbConn); + $selRow = @mysqli_fetch_array($selRes); + do{ + $monCharge[$i] += $selRow[today_charge]; + $monFaceValue1Used[$i] += $selRow[precard_used_today1]; + $monFaceValue2Used[$i] += $selRow[precard_used_today2]; + $monFaceValue3Used[$i] += $selRow[precard_used_today3]; + $monFaceValue4Used[$i] += $selRow[precard_used_today4]; + $monFaceValue5Used[$i] += $selRow[precard_used_today5]; + $monFaceValue6Used[$i] += $selRow[precard_used_today6]; + }while($selRow = @mysqli_fetch_array($selRes)); + if($DEBUG) echo "monCharge[$i]=$monCharge[$i]
      "; +} +?> + + + + + + + + + + +
      + + + + + +
      + +
      +
      +
      + + + + + +  "; + echo " "; + echo " "; + ?> + + "; + echo ""; + $fresh_user_num = showComma($thisMonthFresh); + echo ""; + echo ""; + echo ""; + + echo ""; + $normal_user_num = showComma($thisMonthInuse); + echo ""; + echo ""; + echo ""; + + echo ""; + $suspend_user_num = showComma($thisMonthSuspended); + echo ""; + echo ""; + echo ""; + + echo ""; + $blacklist_user_num = showComma($thisMonthBlacklist); + echo ""; + echo ""; + echo ""; + + echo ""; + $released_user_num = showComma($thisMonthReleased); + echo ""; + echo ""; + echo ""; + + echo ""; + $opr_trial_user_num = showComma($thisMonthOprTrial); + echo ""; + echo ""; + echo ""; + + echo ""; + $total_user_num = showComma($thisMonthTotal); + echo ""; + echo ""; + echo ""; +?> +
      $strDailyUserState$strDailyUserNum
      $strDailyUserTitle$strDailyFresh$fresh_user_num
      $strDailyUsing$normal_user_num
      $strDailySuspend$suspend_user_num
      $strBlackList$blacklist_user_num
      $strReleased$released_user_num
      OPR Trial$opr_trial_user_num
      $strTotal$total_user_num
      + + +

      + + +  "; + echo " "; + for($i=1;$i<=$face_value_type;$i++) + { + $showValue=${"faceValue".$i}/$moneyPara; + if($showValue == 0){ + echo ""; + $arr_FaceValueList[$i] = 0; + }else{ + echo ""; + $arr_FaceValueList[$i] = 1; + } + } + ?> + + "; + echo ""; +// echo ""; + echo ""; + for($i=1;$i<=$face_value_type;$i++) + { + $precardUsed=showComma(${"thisMonthFaceValue".$i."Used"}); + if($arr_FaceValueList[$i] == 1){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + + echo ""; + echo ""; + for($i=1;$i<$face_value_type+1;$i++) + { + $precardUnused=showComma(${"thisMonthFaceValue".$i."Unused"}); + if($arr_FaceValueList[$i] == 1){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + ?> + +
      $strDailyCardFace-- ($strValueCurrency"; + echo "$showValue)"; + echo "
      $strPrepaidCard$strThisMonthChargedUsed$precardUsed--
      $strNotCharged$precardUnused--
      + + +

      + + +  "; + echo " "; + echo " "; + echo " "; + echo " "; + ?> + + + + + $strDailyCallIncoming"; + $incoming_call_nums = showComma($thisMonthIncomingCallNumber); + $incoming_call_duration = showComma($thisMonthIncomingCallDuration); + $incoming_call_charge = showComma(sprintf("$fmtBit",$thisMonthIncomingCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallIDD"; + $IDD_call_nums = showComma($thisMonthIDDCallNumber); + $IDD_call_duration = showComma($thisMonthIDDCallDuration); + $IDD_call_charge = showComma(sprintf("$fmtBit",$thisMonthIDDCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallNDD"; + $NDD_call_nums = showComma($thisMonthNDDCallNumber); + $NDD_call_duration = showComma($thisMonthNDDCallDuration); + $NDD_call_charge = showComma(sprintf("$fmtBit",$thisMonthNDDCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallLocalOut"; + $local_callout_nums = showComma($thisMonthLocalCallNumber); + $local_callout_duration = showComma($thisMonthLocalCallDuration); + $local_callout_charge = showComma(sprintf("$fmtBit",$thisMonthLocalCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallSMS"; + $short_message_nums = showComma($thisMonthShortMessageNumber); + $short_message_duration = showComma($thisMonthShortMessageDuration); + $short_message_charge = showComma(sprintf("$fmtBit",$thisMonthShortMessageCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + + $strDailyCallSMSViaWeb"; + $short_message_nums = showComma($thisMonthShortMessageViaWebNumber); + $short_message_duration = showComma($thisMonthShortMessageViaWebDuration); + $short_message_charge = showComma(sprintf("$fmtBit",$thisMonthShortMessageViaWebCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallConferenceCall"; + $conference_call_nums = showComma($thisMonthConferenceCallNumber); + $conference_call_duration = showComma($thisMonthConferenceCallDuration); + $conference_call_charge = showComma(sprintf("$fmtBit",$thisMonthConferenceCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallRent"; + $rent_charging_nums = showComma($thisMonthRentNumber); + $rent_charging_duration = showComma($thisMonthRentDuration); + $rent_charge = showComma(sprintf("$fmtBit",$thisMonthRentCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strOperatorRecharge"; + $ast_recharge_nums = showComma($thisMonthOperatorRechargeNumber); + $ast_recharge_duration = showComma($thisMonthOperatorRechargeDuration); + $ast_recharge = showComma(sprintf("$fmtBit",$thisMonthOperatorRechargeCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strOperatorCharge"; + $ast_charge_nums = showComma($thisMonthChargeNumber); + $ast_charge_duration = showComma($thisMonthChargeDuration); + $ast_charge = showComma(sprintf("$fmtBit",$thisMonthChargeCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strTotal"; + $total_call_num = showComma($thisMonthTotalNumber); + $total_call_charge = showComma(sprintf("$fmtBit",$thisMonthTotalCharge/$moneyPara)); + $total_call_duration = showComma($thisMonthTotalDuration); + echo ""; + echo ""; + echo ""; + ?> + +
      $strDailyCallType$strDailyCallTimes$strDailyCallDuration$strDailyCallCharge
      $incoming_call_nums$incoming_call_duration$incoming_call_charge
      $IDD_call_nums$IDD_call_duration$IDD_call_charge
      $NDD_call_nums$NDD_call_duration$NDD_call_charge
      $local_callout_nums$local_callout_duration$local_callout_charge
      $short_message_nums$short_message_duration$short_message_charge
      $short_message_nums$short_message_duration$short_message_charge
      $conference_call_nums$conference_call_duration$conference_call_charge
      $rent_charging_nums$rent_charging_duration$rent_charge
      $ast_recharge_nums$ast_recharge_duration$ast_recharge
      $ast_charge_nums$ast_charge_duration$ast_charge
      $total_call_num$total_call_duration$total_call_charge
      + +

      +"; + echo ""; + echo " "; + echo "GPRS volume(MB)"; + echo "GPRS duration(H)"; + echo "GPRS charged"; + echo ""; + + echo ""; + echo "GPRS statistic"; + echo " $thisMonthTotalGPRSVolume"; + echo " $thisMonthTotalGPRSDuration"; + echo " $thisMonthTotalGPRSCharged"; + echo ""; + + echo "
      "; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
       SMS numberSMS chargedMMS send numberMMS send chargedMMS retrieve numberMMS retrieve chargedMMS email numberMMS email number
      MMS statistic $thisMonthTotalSMSNumber $thisMonthTotalSMSCharged $thisMonthTotalMMSSendNumber $thisMonthTotalMMSSendCharged $thisMonthTotalMMSRetrieveNumber $thisMonthTotalMMSRetrieveCharged $thisMonthTotalMMSEmailNumber $thisMonthTotalMMSEmailCharged
      "; + +?> + +

      + + + +  "; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + + + $strAccountSummary"; + $yesterday_balance = showComma(sprintf("$fmtBit",$lastMonthBalance/$moneyPara)); + $today_recharge = showComma(sprintf("$fmtBit",$thisMonthRecharge/$moneyPara)); + $today_charge = showComma(sprintf("$fmtBit",$thisMonthCharge/$moneyPara)); + $today_balance = showComma(sprintf("$fmtBit",$thisMonthBalance/$moneyPara)); + echo ""; + echo ""; + echo ""; + echo ""; + ?> + +
      $strAccountLastMonthBalance$strAccountThisMonthRecharge$strAccountThisMonthBalance$strAccountThisMonthCharge
      $yesterday_balance$today_recharge$today_balance$today_charge
      +
      + + + +"; + $maxYNum = ($dayCharge[$i]>$maxYNum)?$dayCharge[$i]:$maxYNum; +} +$maxYNum = (floor($maxYNum/80)+1)*80; +//echo "maxYNum=$maxYNum
      "; +$legendArr=array( + array('Charge','7D0000',0) + ); +$title=$strMonth." call charge statistic."; + + +//-----图片背景和坐标,标示等基本元素,请勿修改这部分 +$DEBUG=0; +$sizex=550; +$sizey=270; +$bgcolor=F8F8F8; +$fgcolor=000000; +$dayStr=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + +$im = ImageCreate ($sizex, $sizey); + +$background_color = ImageColorAllocate ($im, hexdec(substr($bgcolor, 0, 2)), hexdec(substr($bgcolor, 2, 2)),hexdec(substr($bgcolor, 4, 2))); + +$text_color = ImageColorAllocate ($im, hexdec(substr($fgcolor, 0, 2)), hexdec(substr($fgcolor, 2, 2)),hexdec(substr($fgcolor, 4, 2))); + +//背景 +ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); +ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + +//边框 +$xBgn=75; +$yBgn=15; +$xEnd=540; +$yEnd=215; +$unitXPix=15; +ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); +ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); +ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); +ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + +//竖网格及标注 +for($i=0;$i<=$monDays[$query_month-1];$i++){ + ImageDashedLine($im, $xBgn + $i*15, $yBgn, $xBgn + $i*15, $yEnd, $text_color); + if($i % 2 == 0){ + Imagestring($im, 2, $xBgn + $i*15 - 4, $yEnd, "$i", $text_color); + } +} + +//横网格及标注 +for($i=0;$i<8;$i++){ + ImageDashedLine($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, $text_color); +/* + $yRemark=$maxYNum / 8 * (8 - $i); + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$yRemark", $text_color); +*/ + $scale=$maxYNum / 8 * (8 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData = $scale; + + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); +} + +//色块图标及说明 +for($i=0;$ipointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd - round(($yEnd - $yBgn) * ($pointArr[$i+1] / $maxYNum)); + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + } + $pointArr[$i] = $pointArr[$i-2]; + if($DEBUG) echo "
      pointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd-1; + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + return($pointArr); +} + +for($i=0;$i<=$monDays[$query_month-1];$i++){ + $pointArr[$i*2] = $i; + $pointArr[$i*2+1] = $dayCharge[$i]; +} +//-----开始画图(线或色块),需要修改 +//色块 +/* +$pointArr=getNewXY($pointArr); +$pointNum= sizeof($pointArr) / 2; +$tmpColor=$legendArr[0][2]; +imagefilledpolygon($im, $pointArr, $pointNum, $tmpColor); +*/ +//线条 +$pointArr=getNewXY($pointArr); +$pointNum= sizeof($pointArr) / 2; +$tmpColor=$legendArr[0][2]; +imagepolygon($im, $pointArr, $pointNum, $tmpColor); +?> + + + + + + +
      + + + +
      + +"; +echo ""; +echo ""; +?> +

      + + +$maxYNum)?${"dayFaceValue".$k."Used"}[$i]:$maxYNum; + } +} +$maxYNum = (floor($maxYNum/8)+1)*8; +if($DEBUG) echo "maxYNum=$maxYNum
      "; +for($i=0;$i<6;$i++){ + $faceValue[$i] = "Face value(".${"faceValue".($i+1)}/$moneyPara.")"; + $moneyPara; +} +$legendArr=array( + array($faceValue[0],'0000FF',0), + array($faceValue[1],'00FF00',0), + array($faceValue[2],'FF0000',0), + array($faceValue[3],'7D0000',0), + array($faceValue[4],'FF00FF',0), + array($faceValue[5],'eeaa22',0) + ); +/* +for($i=0;$i<4;$i++){ + $legendArr[$i*3] = "Face value(".${"faceValue".$i}.")"; + $legendArr[$i*3+1] = "7D7D00"; + $legendArr[$i*3+2] = 0; +} +*/ +$title=$strMonth." recharge card statistic."; + + +//-----图片背景和坐标,标示等基本元素,请勿修改这部分 +$sizex=700; +$sizey=270; +$bgcolor=F8F8F8; +$fgcolor=000000; +$dayStr=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + +$im = ImageCreate ($sizex, $sizey); + +$background_color = ImageColorAllocate ($im, hexdec(substr($bgcolor, 0, 2)), hexdec(substr($bgcolor, 2, 2)),hexdec(substr($bgcolor, 4, 2))); + +$text_color = ImageColorAllocate ($im, hexdec(substr($fgcolor, 0, 2)), hexdec(substr($fgcolor, 2, 2)),hexdec(substr($fgcolor, 4, 2))); + +//背景 +ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); +ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + +//边框 +$xBgn=75; +$yBgn=15; +$xEnd=540; +$yEnd=215; +$unitXPix=15; +ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); +ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); +ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); +ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + +//竖网格及标注 +for($i=0;$i<=$monDays[$query_month-1];$i++){ + ImageDashedLine($im, $xBgn + $i*15, $yBgn, $xBgn + $i*15, $yEnd, $text_color); + if($i % 2 == 0){ + Imagestring($im, 2, $xBgn + $i*15 - 4, $yEnd, "$i", $text_color); + } +} + +//横网格及标注 +for($i=0;$i<8;$i++){ + ImageDashedLine($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, $text_color); +/* + $yRemark=$maxYNum / 8 * (8 - $i); + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$yRemark", $text_color); +*/ + $scale=$maxYNum / 8 * (8 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData = $scale; + + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); +} + +//色块图标及说明 +for($i=0;$i"; +} +//线条 +$pointArr1=getNewXY($pointArr1); +$pointNum1= sizeof($pointArr1) / 2; +$tmpColor1=$legendArr[0][2]; +imagepolygon($im, $pointArr1, $pointNum1, $tmpColor1); + +//face value 2 +for($i=0;$i<=$monDays[$query_month-1];$i++){ + $pointArr2[$i*2] = $i; + $pointArr2[$i*2+1] = $dayFaceValue2Used[$i]; + //echo "dayFaceValue2Used[$i]=$dayFaceValue2Used[$i]
      "; +} +//线条 +$pointArr2=getNewXY($pointArr2); +$pointNum2= sizeof($pointArr2) / 2; +$tmpColor2=$legendArr[1][2]; +imagepolygon($im, $pointArr2, $pointNum2, $tmpColor2); + +//face value 3 +for($i=0;$i<=$monDays[$query_month-1];$i++){ + $pointArr3[$i*2] = $i; + $pointArr3[$i*2+1] = $dayFaceValue3Used[$i]; + //echo "dayFaceValue3Used[$i]=$dayFaceValue3Used[$i]
      "; +} +//线条 +$pointArr3=getNewXY($pointArr3); +$pointNum3= sizeof($pointArr3) / 2; +$tmpColor3=$legendArr[2][2]; +imagepolygon($im, $pointArr3, $pointNum3, $tmpColor3); + +//face value 4 +for($i=0;$i<=$monDays[$query_month-1];$i++){ + $pointArr4[$i*2] = $i; + $pointArr4[$i*2+1] = $dayFaceValue4Used[$i]; + //echo "dayFaceValue4Used[$i]=$dayFaceValue4Used[$i]
      "; +} +//线条 +$pointArr4=getNewXY($pointArr4); +$pointNum4= sizeof($pointArr4) / 2; +$tmpColor4=$legendArr[3][2]; +imagepolygon($im, $pointArr4, $pointNum4, $tmpColor4); + +//face value 5 +for($i=0;$i<=$monDays[$query_month-1];$i++){ + $pointArr5[$i*2] = $i; + $pointArr5[$i*2+1] = $dayFaceValue5Used[$i]; + //echo "dayFaceValue4Used[$i]=$dayFaceValue4Used[$i]
      "; +} +//线条 +$pointArr5=getNewXY($pointArr5); +$pointNum5= sizeof($pointArr5) / 2; +$tmpColor5=$legendArr[4][2]; +imagepolygon($im, $pointArr5, $pointNum5, $tmpColor5); + +//face value 6 +for($i=0;$i<=$monDays[$query_month-1];$i++){ + $pointArr6[$i*2] = $i; + $pointArr6[$i*2+1] = $dayFaceValue6Used[$i]; + //echo "dayFaceValue6Used[$i]=$dayFaceValue6Used[$i]
      "; +} +//线条 +$pointArr6=getNewXY($pointArr6); +$pointNum6= sizeof($pointArr6) / 2; +$tmpColor6=$legendArr[5][2]; +imagepolygon($im, $pointArr6, $pointNum6, $tmpColor6); +?> + + + + + + +
      + + + +
      + +"; +echo ""; +echo ""; +?> +

      + + + + + + + +
      + + + +
      +
      +$maxData)?$data[$i-1]:$maxData; + $label[$i-1] = date("M",mktime(0,0,0,$i,1,$query_year)); + if($DEBUG) echo "maxData=$maxData
      "; + if($DEBUG) echo "data[$i-1]=${data[$i-1]}, label[$i-1]=${label[$i-1]}
      "; +} +$maxData = (floor($maxData/1000)+1)*1000; +$image= imagecreate ($width,$height+20); +$bg=imagecolorallocate($image,0xff,0xff,0xff); +#$point= imagecolorallocate($image,0xff,0xff,0xff); +$line=imagecolorallocate($image,0x7d,0x00,0x00); +$lineFrame=imagecolorallocate($image,0xbb,0xbb,0xbb); +$text=imagecolorallocate($image,0x00,0x00,0x00); +$dotcolor=imagecolorallocate($image,0x7d,0x00,0x00); +imageline ($image,50,0,50,$height,$lineFrame); +imageline($image,50,$height,$width,$height,$lineFrame); +for ($i=1;$i<11;$i++) +{ + imagedashedline($image,50,$height - $jc*$i*10 ,$width ,$height -$jc*$i*10 ,$lineFrame ); +// imagestring ($image,$font,0,$height-$jc*$i*10,$maxData/10*$i,$text); + + $scale = $maxData/10*$i; + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData = $scale; + + imagestring ($image,$font,0,$height-$jc*$i*10,$displayMaxData,$text); +} +for ($i=0;$i"; + $x1=(($width-50)/count($data))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; +// imagestring($image,$font,$x1,$y1-2*$fontheight,$tmp."%(".$data[$i].")",$text); + if($data[$i]>1000*1000){ + $displayData[$i] = round($data[$i]/100000)/10; + $displayData[$i] = $displayData[$i]."M"; + }elseif($data[$i]>1000){ + $displayData[$i] = round($data[$i]/100)/10; + $displayData[$i] = $displayData[$i]."K"; + } + else + $displayData[$i] = $data[$i]; + + imagestring($image,$font,$x1+$dot,$y1-2*$dot,$displayData[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor); + imagefilltoborder ($image,$x1,$y1,$dotcolor,$dotcolor); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line); + } + $tmpx1=$x1;$tmpy1=$y1; +} +$filename2=time()."2.png"; +ImagePng ($image,$filename2); +ImageDestroy($image); + +//display the picture +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> + +

      + + + + + + + +
      + + + +
      +
      +$maxData)?$data1[$i-1]:$maxData; + $maxData = ($data2[$i-1]>$maxData)?$data2[$i-1]:$maxData; + $maxData = ($data3[$i-1]>$maxData)?$data3[$i-1]:$maxData; + $maxData = ($data4[$i-1]>$maxData)?$data4[$i-1]:$maxData; + $maxData = ($data5[$i-1]>$maxData)?$data5[$i-1]:$maxData; + $maxData = ($data6[$i-1]>$maxData)?$data6[$i-1]:$maxData; + $label[$i-1] = date("M",mktime(0,0,0,$i,1,$query_year)); + if($DEBUG) echo "maxData=$maxData
      "; + if($DEBUG) echo "data1[$i-1]=${data1[$i-1]}, label[$i-1]=${label[$i-1]}
      "; +} +$maxData = (floor($maxData/10)+1)*10; +$image= imagecreate ($width,$height+20); +$bg=imagecolorallocate($image,0xff,0xff,0xff); +#$point= imagecolorallocate($image,0xff,0xff,0xff); +$line1=imagecolorallocate($image,0x00,0x00,0xFF); +$line2=imagecolorallocate($image,0x00,0xFF,0x00); +$line3=imagecolorallocate($image,0xFF,0x00,0x00); +$line4=imagecolorallocate($image,0x7d,0x00,0x00); +$line5=imagecolorallocate($image,0xFF,0x00,0xFF); +$line6=imagecolorallocate($image,0xee,0xaa,0x22); + +$lineFrame=imagecolorallocate($image,0xbb,0xbb,0xbb); +$text=imagecolorallocate($image,0x00,0x00,0x00); +$dotcolor1=imagecolorallocate($image,0x00,0x00,0xFF); +$dotcolor2=imagecolorallocate($image,0x00,0xFF,0x00); +$dotcolor3=imagecolorallocate($image,0xFF,0x00,0x00); +$dotcolor4=imagecolorallocate($image,0x7d,0x00,0x00); +$dotcolor5=imagecolorallocate($image,0xFF,0x00,0xFF); +$dotcolor6=imagecolorallocate($image,0xee,0xaa,0x22); +imageline ($image,50,0,50,$height,$lineFrame); +imageline($image,50,$height,$width,$height,$lineFrame); +for ($i=1;$i<11;$i++) +{ + imagedashedline($image,50,$height - $jc*$i*10 ,$width ,$height -$jc*$i*10 ,$lineFrame ); +// imagestring ($image,$font,0,$height-$jc*$i*10,$maxData/10*$i,$text); + + $scale = $maxData/10*$i; + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData = $scale; + + imagestring ($image,$font,0,$height-$jc*$i*10,$displayMaxData,$text); +} +//face value 1 +for ($i=0;$i"; + $x1=(($width-50)/count($data1))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data1[$i]>1000*1000){ + $displayData1[$i] = round($data1[$i]/100000); + $displayData1[$i] = $displayData1[$i]/10; + $displayData1[$i] = $displayData1[$i]."M"; + }elseif($data1[$i]>1000){ + $displayData1[$i] = round($data1[$i]/100); + $displayData1[$i] = $displayData1[$i]/10; + $displayData1[$i] = $displayData1[$i]."K"; + } + else + $displayData1[$i] = $data1[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data1[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData1[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor1); + imagefilltoborder ($image,$x1,$y1,$dotcolor1,$dotcolor1); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line1); + } + $tmpx1=$x1;$tmpy1=$y1; +} +//face value 2 +for ($i=0;$i"; + $x1=(($width-50)/count($data2))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data2[$i]>1000*1000){ + $displayData2[$i] = round($data2[$i]/100000); + $displayData2[$i] = $displayData2[$i]/10; + $displayData2[$i] = $displayData2[$i]."M"; + }elseif($data2[$i]>1000){ + $displayData2[$i] = round($data2[$i]/100); + $displayData2[$i] = $displayData2[$i]/10; + $displayData2[$i] = $displayData2[$i]."K"; + } + else + $displayData2[$i] = $data2[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data2[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData2[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor2); + imagefilltoborder ($image,$x1,$y1,$dotcolor2,$dotcolor2); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line2); + } + $tmpx1=$x1;$tmpy1=$y1; +} +//face value 3 +for ($i=0;$i"; + $x1=(($width-50)/count($data3))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data3[$i]>1000*1000){ + $displayData3[$i] = round($data3[$i]/100000); + $displayData3[$i] = $displayData3[$i]/10; + $displayData3[$i] = $displayData3[$i]."M"; + }elseif($data3[$i]>1000){ + $displayData3[$i] = round($data3[$i]/100); + $displayData3[$i] = $displayData3[$i]/10; + $displayData3[$i] = $displayData3[$i]."K"; + } + else + $displayData3[$i] = $data3[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data3[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData3[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor3); + imagefilltoborder ($image,$x1,$y1,$dotcolor3,$dotcolor3); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line3); + } + $tmpx1=$x1;$tmpy1=$y1; +} +//face value 4 +for ($i=0;$i"; + $x1=(($width-50)/count($data4))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data4[$i]>1000*1000){ + $displayData4[$i] = round($data4[$i]/100000); + $displayData4[$i] = $displayData4[$i]/10; + $displayData4[$i] = $displayData4[$i]."M"; + }elseif($data4[$i]>1000){ + $displayData4[$i] = round($data4[$i]/100); + $displayData4[$i] = $displayData4[$i]/10; + $displayData4[$i] = $displayData4[$i]."K"; + } + else + $displayData4[$i] = $data4[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data4[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData4[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor4); + imagefilltoborder ($image,$x1,$y1,$dotcolor4,$dotcolor4); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line4); + } + $tmpx1=$x1;$tmpy1=$y1; +} + +//face value 5 +for ($i=0;$i"; + $x1=(($width-50)/count($data5))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data5[$i]>1000*1000){ + $displayData5[$i] = round($data5[$i]/100000); + $displayData5[$i] = $displayData5[$i]/10; + $displayData5[$i] = $displayData5[$i]."M"; + }elseif($data5[$i]>1000){ + $displayData5[$i] = round($data5[$i]/100); + $displayData5[$i] = $displayData5[$i]/10; + $displayData5[$i] = $displayData5[$i]."K"; + } + else + $displayData5[$i] = $data5[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data4[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData5[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor5); + imagefilltoborder ($image,$x1,$y1,$dotcolor5,$dotcolor5); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line5); + } + $tmpx1=$x1;$tmpy1=$y1; +} + +//face value 6 +for ($i=0;$i"; + $x1=(($width-50)/count($data6))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data6[$i]>1000*1000){ + $displayData6[$i] = round($data6[$i]/100000); + $displayData6[$i] = $displayData6[$i]/10; + $displayData6[$i] = $displayData6[$i]."M"; + }elseif($data6[$i]>1000){ + $displayData6[$i] = round($data6[$i]/100); + $displayData6[$i] = $displayData6[$i]/10; + $displayData6[$i] = $displayData6[$i]."K"; + } + else + $displayData6[$i] = $data6[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data4[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData6[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor6); + imagefilltoborder ($image,$x1,$y1,$dotcolor6,$dotcolor6); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line6); + } + $tmpx1=$x1;$tmpy1=$y1; +} + +//色块图标及说明 +for($i=0;$i"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> + +

       

      + + + +$strDailyOperator: "; + echo "$userInfo[ID]"; + echo "              "; + echo "$strDailyPrintTime"; +?> + + +
      + + + diff --git a/wxc2_omc/performance/ppsDailyReport/monthlyReportIndex.php b/wxc2_omc/performance/ppsDailyReport/monthlyReportIndex.php new file mode 100755 index 0000000..6746996 --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/monthlyReportIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/ppsDailyReport/monthlyReportUp.php b/wxc2_omc/performance/ppsDailyReport/monthlyReportUp.php new file mode 100755 index 0000000..0b1c3f5 --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/monthlyReportUp.php @@ -0,0 +1,89 @@ + + + +
      +"; +echo ""; +echo ""; +echo "$strTitlePerformance $strTitleSpace PPS report > Monthly report"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +$thisYear =date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$lastMonth =date("m",mktime(0,0,0,date("m")-1,date("d"),date("Y"))); +$lastYear =date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y")-1)); +$lastLastYear =date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y")-2)); +if($DEBUG){ + echo "thisYear=$thisYear, lastMonth=$lastMonth, lastYear=$lastYear
      "; +} +/* +$year=date("Y")."-".date("m")."-".date("d"); +if($DEBUG) echo "$year
      "; +*/ +//--Year-- + echo "$strYear  "; + + //--Month-- + echo "$strMonth  "; +?> + + + + +"; +echo " "; +echo ""; +echo ""; +echo ""; +echo "
      "; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + + diff --git a/wxc2_omc/performance/ppsDailyReport/weeklyReportDown.php b/wxc2_omc/performance/ppsDailyReport/weeklyReportDown.php new file mode 100755 index 0000000..255a1ff --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/weeklyReportDown.php @@ -0,0 +1,1782 @@ + + + + +\n"; + echo "parent.window.location.href=\"../../element/bssSpecific/alarm_show.php?info=$info&backurl=$backurl\";\n"; + echo "\n"; + +} +adjust_head_frame("down"); +adjust_title_head_frame("down"); +adjust_title_tail_frame("down"); + +adjust_content_head_frame("down"); +echo "
      "; + +$DEBUG=0; +$db='PPS_DB'; +global $OMC_server; +$ppsDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $db); + +$face_value_type = 6; +$moneyPara = getMoneyPara_forPpsReport(); //显示的货币单位是最小货币单位的倍数 + +$moneyPara=$moneyPara+0; + +if(!isset($moneyPara)||$moneyPara==0||trim($moneyPara)=="") +{ + $info="The parameter (currency_decimal)
      has no value,please set it!"; + $backurl="../../sysDefine/pubVarDef/paramList.php"; + show_alarm($info,$backurl); +} + + +$dotLen = strLen($moneyPara) - 1; +//echo "
      dotLen=$dotLen"; + +$query_year=$_REQUEST['query_year']; +$query_week=$_REQUEST['query_week']; + + +if ($DEBUG) echo "query_year = $query_year,query_week = $query_week
      "; +$fmtBit = "%01.".$dotLen."f"; +?> + + +"; + return ($weekNum); +} + +if(!$query_year) +{ + $query_year=date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +} + +$firstw = date("w",mktime(0,1,0,1,1,date($query_year))); +$lastDayNumber = date("z",mktime(0,0,0,date("m"),date("d")-1,date("Y")))+1; +$lastWeekNumber = floor(($lastDayNumber-(7-$firstw)) / 7)+1; +if ($DEBUG) echo "firstw = $firstw,"; +if ($DEBUG) echo "lastDayNumber=$lastDayNumber,"; +if ($DEBUG) echo "lastWeekNumber=$lastWeekNumber
      "; + +if(!$query_week) +{ + $query_week=$lastWeekNumber; +} + +$defaultWeek="$query_year-$query_week"; +if($DEBUG) echo "defaultWeek=$defaultWeek
      "; +$year=date("Y")."-".date("m")."-".date("d").",".date("w"); +if($DEBUG) echo "Today is $year
      "; + +$thisFebDays=date("t",mktime(0,0,0,2,1,date("Y"))); +if($DEBUG) echo "thisFebDays=$thisFebDays
      "; + +$strWeek = array( + "0" => "Sun", + "1" => "Mon", + "2" => "Tue", + "3" => "Wed", + "4" => "Thu", + "5" => "Fri", + "6" => "Sat", +); + +$monDays = array( + "0" => "31", + "1" => "$thisFebDays", + "2" => "31", + "3" => "30", + "4" => "31", + "5" => "30", + "6" => "31", + "7" => "31", + "8" => "30", + "9" => "31", + "10" => "30", + "11" => "31", +); +/* +$i=0; +for($i=0;$i<12;$i++){ + echo "$monDays[$i],"; +} +*/ +$selWeekFirstDayNumber = 7-$firstw+($query_week-2)*7+1; +if($DEBUG) echo "selWeekFirstDayNumber=$selWeekFirstDayNumber,"; + +$i=0; +while($selWeekFirstDayNumber>=$monDays[$i]){ + $selWeekFirstDayNumber = $selWeekFirstDayNumber-$monDays[$i]; + $i++; +}; +$bgnMonth = $i+1; +$bgnDay = $selWeekFirstDayNumber; + +$bgnDay = (($bgnDay<10&&$bgnDay>0)?"0":"").$bgnDay; +if($bgnDay>0) + $bgnDay = $query_year."-".$bgnMonth."-".$bgnDay; +elseif($bgnDay<=0){ + if($bgnMonth<=1) + { + $bgnYear=$query_year-1; + $bgnDay =31+$bgnDay; + $bgnDay = $bgnYear."-12"."-".$bgnDay; + } + else + { + $bgnMonth = $bgnMonth - 1; + $bgnDay =$monDays[$bgnMonth-1]; + $bgnDay = $query_year."-".$bgnMonth."-".$bgnDay; + } +} + + +if($DEBUG) echo "bgnMonth=$bgnMonth,"; +if($DEBUG) echo "bgnDay=$bgnDay
      "; + + +$selWeekLastDayNumber = 7-$firstw+($query_week-1)*7; +if($DEBUG) echo "selWeekLastDayNumber=$selWeekLastDayNumber,"; + +$i=0; +while($selWeekLastDayNumber>=$monDays[$i]){ + $selWeekLastDayNumber = $selWeekLastDayNumber-$monDays[$i]; + $i++; +}; +$endMonth = $i+1; +$endDay = $selWeekLastDayNumber; +$endDay = ($endDay<10?"0":"").$endDay; +$endDay = $query_year."-".$endMonth."-".$endDay; +if($DEBUG) echo "endDay=$endDay
      "; + +echo "
      "; + +$selSQL ="SELECT * FROM daily_report WHERE date>='$bgnDay' and date<='$endDay' order by date ASC"; +if($DEBUG) echo "selSQL=$selSQL
      "; +$selRes = mysqli_query($ppsDbConn,$selSQL); +echo mysqli_error($ppsDbConn); +$selRow = @mysqli_fetch_array($selRes); +if(!$selRow){ + echo "No record found!($query_year-$query_week)!"; + exit(); +} +//Account summary +$lastWeekBalance=0; +$thisWeekRecharge=0; +$thisWeekBalance=0; +$thisWeekCharge=0; + +//Account report +$thisWeekFresh=0; +$thisWeekInuse=0; +$thisWeekSuspended=0; +$thisWeekBlacklist=0; +$thisWeekReleased=0; +$thisWeekOprTrial=0; +$thisWeekTotal=0; + +//Recharge card +$faceValue1=0; +$thisWeekFaceValue1Used=0; +$thisWeekFaceValue1Unused=0; +$faceValue2=0; +$thisWeekFaceValue2Used=0; +$thisWeekFaceValue2Unused=0; +$faceValue3=0; +$thisWeekFaceValue3Used=0; +$thisWeekFaceValue3Unused=0; +$faceValue4=0; +$thisWeekFaceValue4Used=0; +$thisWeekFaceValue4Unused=0; +$faceValue5=0; +$thisWeekFaceValue5Used=0; +$thisWeekFaceValue5Unused=0; +$faceValue6=0; +$thisWeekFaceValue6Used=0; +$thisWeekFaceValue6Unused=0; + +//Call statistics +$thisWeekIncomingCallNumber=0; +$thisWeekIncomingCallDuration=0; +$thisWeekIncomingCallCharge=0; + +$thisWeekLocalCallNumber=0; +$thisWeekLocalCallDuration=0; +$thisWeekLocalCallCharge=0; + +$thisWeekIDDCallNumber=0; +$thisWeekIDDCallDuration=0; +$thisWeekIDDCallCharge=0; + +$thisWeekNDDCallNumber=0; +$thisWeekNDDCallDuration=0; +$thisWeekNDDCallCharge=0; + +$thisWeekShortMessageNumber=0; +$thisWeekShortMessageDuration=0; +$thisWeekShortMessageCharge=0; + +$thisWeekShortMessageViaWebNumber=0; +$thisWeekShortMessageViaWebDuration=0; +$thisWeekShortMessageViaWebCharge=0; + +$thisWeekConferenceCallNumber=0; +$thisWeekConferenceCallDuration=0; +$thisWeekConferenceCallCharge=0; + +$thisWeekRentNumber=0; +$thisWeekRentDuration=0; +$thisWeekRentCharge=0; + +$thisWeekRechargeSuccNumber=0; +$thisWeekRechargeSuccDuration=0; +$thisWeekRechargeSuccCharge=0; + +$thisWeekRechargeFailNumber=0; +$thisWeekRechargeFailDuration=0; +$thisWeekRechargeFailCharge=0; + +$thisWeekOperatorRechargeNumber=0; +$thisWeekOperatorRechargeDuration=0; +$thisWeekOperatorRechargeCharge=0; + +$thisWeekChargeNumber=0; +$thisWeekChargeDuration=0; +$thisWeekChargeCharge=0; + +$thisWeekTotalNumber=0; +$thisWeekTotalDuration=0; +$thisWeekTotalCharge=0; + +$thisWeekTotalGPRSVolume=0; +$thisWeekTotalGPRSDuration=0; +$thisWeekTotalGPRSCharged=0; + +$thisWeekTotalSMSNumber=0; +$thisWeekTotalSMSCharged=0; +$thisWeekTotalMMSSendNumber=0; +$thisWeekTotalMMSSendCharged=0; +$thisWeekTotalMMSRetrieveNumber=0; +$thisWeekTotalMMSRetrieveCharged=0; +$thisWeekTotalMMSEmailNumber=0; +$thisWeekTotalMMSEmailCharged=0; + +do{ + //Account summary + if($lastWeekBalance == 0){ + $lastWeekBalance = $selRow[yesterday_balance]; + } + $thisWeekRecharge += $selRow[today_recharge]; + $thisWeekBalance = $selRow[today_balance]; + $thisWeekCharge += $selRow[today_charge]; + $weekNum = getWeekNumFromDay("$selRow[date]"); + $dayCharge[$weekNum] = $selRow[today_charge]; + + //Account report + $thisWeekFresh = $selRow[fresh_user_num]; + $thisWeekInuse = $selRow[normal_user_num]; + $thisWeekSuspended = $selRow[suspend_user_num]; + $thisWeekBlacklist = $selRow[blacklist_user_num]; + $thisWeekReleased = $selRow[released_user_num]; + $thisWeekOprTrial = $selRow[opr_trial_user_num]; + $thisWeekTotal = $selRow[total_user_num]; + + //Recharge card + $faceValue1 = ($selRow[precard_facevalue1]>0)?$selRow[precard_facevalue1]:$faceValue1; + $thisWeekFaceValue1Used += $selRow[precard_used_today1]; + $dayFaceValue1Used[$weekNum] = $selRow[precard_used_today1]; + $thisWeekFaceValue1Unused = $selRow[precard_unused1]; + + $faceValue2 = ($selRow[precard_facevalue2]>0)?$selRow[precard_facevalue2]:$faceValue2; + $thisWeekFaceValue2Used += $selRow[precard_used_today2]; + $dayFaceValue2Used[$weekNum] = $selRow[precard_used_today2]; + $thisWeekFaceValue2Unused = $selRow[precard_unused2]; + + $faceValue3 = ($selRow[precard_facevalue3]>0)?$selRow[precard_facevalue3]:$faceValue3; + $thisWeekFaceValue3Used += $selRow[precard_used_today3]; + $dayFaceValue3Used[$weekNum] = $selRow[precard_used_today3]; + $thisWeekFaceValue3Unused = $selRow[precard_unused3]; + + $faceValue4 = ($selRow[precard_facevalue4]>0)?$selRow[precard_facevalue4]:$faceValue4; + $thisWeekFaceValue4Used += $selRow[precard_used_today4]; + $dayFaceValue4Used[$weekNum] = $selRow[precard_used_today4]; + $thisWeekFaceValue4Unused = $selRow[precard_unused4]; + + $faceValue5 = ($selRow[precard_facevalue5]>0)?$selRow[precard_facevalue5]:$faceValue5; + $thisWeekFaceValue5Used += $selRow[precard_used_today5]; + $dayFaceValue5Used[$weekNum] = $selRow[precard_used_today5]; + $thisWeekFaceValue5Unused = $selRow[precard_unused5]; + + $faceValue6 = ($selRow[precard_facevalue6]>0)?$selRow[precard_facevalue6]:$faceValue6; + $thisWeekFaceValue6Used += $selRow[precard_used_today6]; + $dayFaceValue6Used[$weekNum] = $selRow[precard_used_today6]; + $thisWeekFaceValue6Unused = $selRow[precard_unused6]; + + //Call statistics + $thisWeekIncomingCallNumber += $selRow[incoming_call_num ]; + $thisWeekIncomingCallDuration += $selRow[incoming_call_duration]; + $thisWeekIncomingCallCharge += $selRow[incoming_call_charge]; + + $thisWeekLocalCallNumber += $selRow[local_callout_num]; + $thisWeekLocalCallDuration += $selRow[local_callout_duration]; + $thisWeekLocalCallCharge += $selRow[local_callout_charge]; + + $thisWeekIDDCallNumber += $selRow[IDD_call_num]; + $thisWeekIDDCallDuration += $selRow[IDD_call_duration]; + $thisWeekIDDCallCharge += $selRow[IDD_call_charge]; + + $thisWeekNDDCallNumber += $selRow[NDD_call_num]; + $thisWeekNDDCallDuration += $selRow[NDD_call_duration]; + $thisWeekNDDCallCharge += $selRow[NDD_call_charge]; + + $thisWeekShortMessageNumber += $selRow[short_message_num]; + $thisWeekShortMessageDuration += $selRow[short_message_duration]; + $thisWeekShortMessageCharge += $selRow[short_message_charge]; + + $thisWeekShortMessageViaWebNumber += $selRow[short_message_via_web_num]; + $thisWeekShortMessageViaWebDuration += $selRow[short_message_via_web_duration]; + $thisWeekShortMessageViaWebCharge += $selRow[short_message_via_web_charge]; + + $thisWeekConferenceCallNumber += $selRow[conference_call_num]; + $thisWeekConferenceCallDuration += $selRow[conference_call_duration]; + $thisWeekConferenceCallCharge += $selRow[conference_call_charge]; + + $thisWeekRentNumber += $selRow[rent_charging_num]; + $thisWeekRentDuration += $selRow[rent_charging_duration]; + $thisWeekRentCharge += $selRow[rent_charge]; + + $thisWeekRechargeSuccNumber += $selRow[recharge_suc_num]; + $thisWeekRechargeSuccDuration += $selRow[recharge_suc_duration]; + $thisWeekRechargeSuccCharge += $selRow[recharge_suc]; + + $thisWeekRechargeFailNumber += $selRow[recharge_fail_num]; + $thisWeekRechargeFailDuration += $selRow[recharge_fail_duration]; + $thisWeekRechargeFailCharge += $selRow[recharge_fail]; + + $thisWeekOperatorRechargeNumber += $selRow[ast_recharge_num]; + $thisWeekOperatorRechargeDuration += $selRow[ast_recharge_duration]; + $thisWeekOperatorRechargeCharge += $selRow[ast_recharge]; + + $thisWeekChargeNumber += $selRow[ast_charge_num]; + $thisWeekChargeDuration += $selRow[ast_charge_duration]; + $thisWeekChargeCharge += $selRow[ast_charge]; + + $thisWeekTotalNumber += $selRow[total_call_num]; + $thisWeekTotalDuration += $selRow[total_call_duration]; + + $thisWeekTotalCharge += $selRow[total_call_charge]; + + $thisWeekTotalGPRSVolume+=($selRow[gprs_volume]-0)/1024; + $thisWeekTotalGPRSDuration+=($selRow[gprs_duration]-0)/3600; + $thisWeekTotalGPRSCharged+=$selRow[gprs_charged]-0; + + $thisWeekTotalSMSNumber+=$selRow[sms_number]; + $thisWeekTotalSMSCharged+=$selRow[sms_charged]; + $thisWeekTotalMMSSendNumber+=$selRow[mms_send_number]; + $thisWeekTotalMMSSendCharged+=$selRow[mms_send_charged]; + $thisWeekTotalMMSRetrieveNumber+=$selRow[mms_retrieve_number]; + $thisWeekTotalMMSRetrieveCharged+=$selRow[mms_retrieve_charged]; + $thisWeekTotalMMSEmailNumber+=$selRow[mms_email_number]; + $thisWeekTotalMMSEmailCharged+=$selRow[mms_email_charged]; + +}while($selRow=mysqli_fetch_array($selRes)); + +$thisWeekTotalGPRSVolume=number_format($thisWeekTotalGPRSVolume,3,'.',''); +$thisWeekTotalGPRSDuration=number_format($thisWeekTotalGPRSDuration,3,'.',''); + +if($DEBUG){ + echo "lastWeekBalance=$lastWeekBalance, "; + echo "thisWeekRecharge=$thisWeekRecharge, "; + echo "thisWeekBalance=$thisWeekBalance, "; + echo "thisWeekCharge=$thisWeekCharge, "; + echo "
      "; + echo "thisWeekFresh=$thisWeekFresh, "; + echo "thisWeekInuse=$thisWeekInuse, "; + echo "thisWeekSuspended=$thisWeekSuspended, "; + echo "thisWeekBlacklist=$thisWeekBlacklist, "; + echo "thisWeekReleased=$thisWeekReleased, "; + echo "thisWeekTotal=$thisWeekTotal, "; + echo "
      "; + echo "faceValue1=$faceValue1, "; + echo "thisWeekFaceValue1Used=$thisWeekFaceValue1Used, "; + echo "thisWeekFaceValue1Unused=$thisWeekFaceValue1Unused, "; + echo "
      "; + echo "thisWeekFaceValue2Used=$thisWeekFaceValue2Used, "; + echo "thisWeekFaceValue2Unused=$thisWeekFaceValue2Unused, "; + echo "thisWeekFaceValue3Used=$thisWeekFaceValue3Used, "; + echo "thisWeekFaceValue3Unused=$thisWeekFaceValue3Unused, "; + echo "thisWeekFaceValue4Used=$thisWeekFaceValue4Used, "; + echo "thisWeekFaceValue4Unused=$thisWeekFaceValue4Unused, "; + echo "
      "; +} + +/********************* 统计该月几周的收费情况及充值卡 *************************/ +/* +echo "bgnDay=$bgnDay, endDay=$endDay
      "; +$pieces = explode("-",$endDay); +$query_month = $pieces[1]; +$tmp = date("w",mktime(0,0,0,$query_month,1,$query_year)); +echo "query_month=$query_month, tmp=$tmp
      "; +$week1FirstDay = date("Y",mktime(0,0,0,$query_month,1-$tmp,$query_year))."-". + date("m",mktime(0,0,0,$query_month,1-$tmp,$query_year))."-". + date("d",mktime(0,0,0,$query_month,1-$tmp,$query_year)); +echo "week1FirstDay=$week1FirstDay
      "; +*/ + +/********************* 统计该周前5周的收费情况及充值卡情况 ********************/ +if($DEBUG) echo "bgnDay=$bgnDay, endDay=$endDay
      "; +for($i=4;$i>0;$i--){ + //start day + $pieces = explode("-",$bgnDay); + $query_month = $pieces[1]; + $query_day = $pieces[2]; + + $weekStart[4-$i] = date("Y",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0]))."-". + date("m",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0]))."-". + date("d",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0])); + + //end day + $pieces = explode("-",$endDay); + $query_month = $pieces[1]; + $query_day = $pieces[2]; + $weekEnd[4-$i] = date("Y",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0]))."-". + date("m",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0]))."-". + date("d",mktime(0,0,0,$pieces[1],$pieces[2]-$i*7,$pieces[0])); +} +$weekStart[4] = $bgnDay; +$weekEnd[4] = $endDay; +if($DEBUG){ + echo "$weekStart[0], $weekEnd[0]
      "; + echo "$weekStart[1], $weekEnd[1]
      "; + echo "$weekStart[2], $weekEnd[2]
      "; + echo "$weekStart[3], $weekEnd[3]
      "; + echo "$weekStart[4], $weekEnd[4]
      "; +} + +for($i=0;$i<5;$i++){ + $weekCharge[$i]=0; + $selBgnDay = $weekStart[$i]; + $selEndDay = $weekEnd[$i]; + if($DEBUG) echo "selBgnDay=$selBgnDay, selEndDay=$selEndDay
      "; + $selSQL = "SELECT * FROM daily_report WHERE date>='$selBgnDay' and date<='$selEndDay'"; + if($DEBUG) echo "selSQL=$selSQL
      "; + $selRes = mysqli_query($ppsDbConn,$selSQL); + echo mysqli_error($ppsDbConn); + $selRow = @mysqli_fetch_array($selRes); + do{ + $weekCharge[$i] += $selRow[today_charge]; + $weekFaceValue1Used[$i] += $selRow[precard_used_today1]; + $weekFaceValue2Used[$i] += $selRow[precard_used_today2]; + $weekFaceValue3Used[$i] += $selRow[precard_used_today3]; + $weekFaceValue4Used[$i] += $selRow[precard_used_today4]; + $weekFaceValue5Used[$i] += $selRow[precard_used_today5]; + $weekFaceValue6Used[$i] += $selRow[precard_used_today6]; + }while($selRow = @mysqli_fetch_array($selRes)); + if($DEBUG){ + echo "weekCharge[$i]=$weekCharge[$i]
      "; + echo "weekFaceValue1Used[$i]=$weekFaceValue1Used[$i]
      "; + echo "weekFaceValue2Used[$i]=$weekFaceValue2Used[$i]
      "; + echo "weekFaceValue3Used[$i]=$weekFaceValue3Used[$i]
      "; + echo "weekFaceValue4Used[$i]=$weekFaceValue4Used[$i]
      "; + } + + $thisWeek = $query_week-4+$i; + if($thisWeek<1) + $thisWeek=$thisWeek+52; + $label[$i] = "W".$thisWeek; + if($DEBUG) echo "label[$i]=$label[$i]
      "; + if($DEBUG) echo "
      "; +} +$firstWeek = $label[0]; +$lastWeek = $label[4]; + +?> + + + + + + + + +
      + +   + +
      + +
      +
      +
      + + +"; +echo "PPS report W$query_week($bgnDay ~ $endDay)"; +echo ""; +//----------------------------------全局统计-------------------------------------------------------- +?> + + +  "; + echo " "; + echo " "; + ?> + + "; + echo ""; + $fresh_user_num = showComma($thisWeekFresh); + echo ""; + echo ""; + echo ""; + + echo ""; + $normal_user_num = showComma($thisWeekInuse); + echo ""; + echo ""; + echo ""; + + echo ""; + $suspend_user_num = showComma($thisWeekSuspended); + echo ""; + echo ""; + echo ""; + + echo ""; + $blacklist_user_num = showComma($thisWeekBlacklist); + echo ""; + echo ""; + echo ""; + + echo ""; + $released_user_num = showComma($thisWeekReleased); + echo ""; + echo ""; + echo ""; + + echo ""; + $opr_trial_user_num = showComma($thisWeekOprTrial); + echo ""; + echo ""; + echo ""; + + $selRow[released_user_num]; + + echo ""; + $total_user_num = showComma($thisWeekTotal); + echo ""; + echo ""; + echo ""; +?> +
      $strDailyUserState$strDailyUserNum
      $strDailyUserTitle$strDailyFresh$fresh_user_num
      $strDailyUsing$normal_user_num
      $strDailySuspend$suspend_user_num
      $strBlackList$blacklist_user_num
      $strReleased$released_user_num
      OPR Trial$opr_trial_user_num
      $strTotal$total_user_num
      + + +

      + + +  "; + echo " "; + for($i=1;$i<=$face_value_type;$i++) + { + $ValueList="precard_facevalue".$i; + $showValue=${"faceValue".$i}/$moneyPara; + if($showValue == 0){ + echo ""; + $arr_FaceValueList[$i] = 0; + }else{ + echo ""; + $arr_FaceValueList[$i] = 1; + } + } + ?> + + "; + echo ""; + echo ""; + for($i=1;$i<=$face_value_type;$i++) + { + $precard_used_today="precard_used_today".$i; + $precardUsed=showComma(${"thisWeekFaceValue".$i."Used"}); + if($arr_FaceValueList[$i] == 1){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + + echo ""; + echo ""; + for($i=1;$i<$face_value_type+1;$i++) + { + $precard_unused="precard_unused".$i; + $precardUnused=showComma(${"thisWeekFaceValue".$i."Unused"}); + if($arr_FaceValueList[$i] == 1){ + echo ""; + }else{ + echo ""; + } + } + echo ""; + ?> + +
      $strDailyCardFace-- ($strValueCurrency"; + echo "$showValue)"; + echo "
      $strPrepaidCardUsed$precardUsed--
      $strNotCharged$precardUnused--
      + + +

      + + +  "; + echo " "; + echo " "; + echo " "; + echo " "; + ?> + + + + + $strDailyCallIncoming"; + $incoming_call_nums = showComma($thisWeekIncomingCallNumber); + $incoming_call_duration = showComma($thisWeekIncomingCallDuration); + $incoming_call_charge = showComma(sprintf("$fmtBit",$thisWeekIncomingCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallIDD"; + $IDD_call_nums = showComma($thisWeekIDDCallNumber); + $IDD_call_duration = showComma($thisWeekIDDCallDuration); + $IDD_call_charge = showComma(sprintf("$fmtBit",$thisWeekIDDCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallNDD"; + $NDD_call_nums = showComma($thisWeekNDDCallNumber); + $NDD_call_duration = showComma($thisWeekNDDCallDuration); + $NDD_call_charge = showComma(sprintf("$fmtBit",$thisWeekNDDCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallLocalOut"; + $local_callout_nums = showComma($thisWeekLocalCallNumber); + $local_callout_duration = showComma($thisWeekLocalCallDuration); + $local_callout_charge = showComma(sprintf("$fmtBit",$thisWeekLocalCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + + $strDailyCallSMS"; + $short_message_nums = showComma($thisWeekShortMessageNumber); + $short_message_duration = showComma($thisWeekShortMessageDuration); + $short_message_charge = showComma(sprintf("$fmtBit",$thisWeekShortMessageCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + + $strDailyCallSMSViaWeb"; + $short_message_nums = showComma($thisWeekShortMessageViaWebNumber); + $short_message_duration = showComma($thisWeekShortMessageViaWebDuration); + $short_message_charge = showComma(sprintf("$fmtBit",$thisWeekShortMessageViaWebCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallConferenceCall"; + $conference_call_nums = showComma($thisWeekConferenceCallNumber); + $conference_call_duration = showComma($thisWeekConferenceCallDuration); + $conference_call_charge = showComma(sprintf("$fmtBit",$thisWeekConferenceCallCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strDailyCallRent"; + $rent_charging_nums = showComma($thisWeekRentNumber); + $rent_charging_duration = showComma($thisWeekRentDuration); + $rent_charge = showComma(sprintf("$fmtBit",$thisWeekRentCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strOperatorRecharge"; + $ast_recharge_nums = showComma($thisWeekOperatorRechargeNumber); + $ast_recharge_duration = showComma($thisWeekOperatorRechargeDuration); + $ast_recharge = showComma(sprintf("$fmtBit",$thisWeekOperatorRechargeCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strOperatorCharge"; + $ast_charge_nums = showComma($thisWeekChargeNumber); + $ast_charge_duration = showComma($thisWeekChargeDuration); + $ast_charge = showComma(sprintf("$fmtBit",$thisWeekChargeCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + ?> + + + + $strTotal"; + $total_call_num = showComma($thisWeekTotalNumber); + $total_call_charge = showComma(sprintf("$fmtBit",$thisWeekTotalCharge/$moneyPara)); + $total_call_duration = showComma($thisWeekTotalDuration); + echo ""; + echo ""; + echo ""; + ?> + +
      $strDailyCallType$strDailyCallTimes$strDailyCallDuration$strDailyCallCharge
      $incoming_call_nums$incoming_call_duration$incoming_call_charge
      $IDD_call_nums$IDD_call_duration$IDD_call_charge
      $NDD_call_nums$NDD_call_duration$NDD_call_charge
      $local_callout_nums$local_callout_duration$local_callout_charge
      $short_message_nums$short_message_duration$short_message_charge
      $short_message_nums$short_message_duration$short_message_charge
      $conference_call_nums$conference_call_duration$conference_call_charge
      $rent_charging_nums$rent_charging_duration$rent_charge
      $ast_recharge_nums$ast_recharge_duration$ast_recharge
      $ast_charge_nums$ast_charge_duration$ast_charge
      $total_call_num$total_call_duration$total_call_charge
      +

      +"; + echo ""; + echo " "; + echo "GPRS volume(MB)"; + echo "GPRS duration(H)"; + echo "GPRS charged"; + echo ""; + + echo ""; + echo "GPRS statistic"; + echo " $thisWeekTotalGPRSVolume"; + echo " $thisWeekTotalGPRSDuration"; + echo " $thisWeekTotalGPRSCharged"; + echo ""; + + echo "
      "; + + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo "
       SMS numberSMS chargedMMS send numberMMS send chargedMMS retrieve numberMMS retrieve chargedMMS email numberMMS email number
      MMS statistic $thisWeekTotalSMSNumber $thisWeekTotalSMSCharged $thisWeekTotalMMSSendNumber $thisWeekTotalMMSSendCharged $thisWeekTotalMMSRetrieveNumber $thisWeekTotalMMSRetrieveCharged $thisWeekTotalMMSEmailNumber $thisWeekTotalMMSEmailCharged
      "; + +?> + + +

      + + + +  "; + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + + + $strAccountSummary"; + $yesterday_balance = showComma(sprintf("$fmtBit",$lastWeekBalance/$moneyPara)); + $today_recharge = showComma(sprintf("$fmtBit",$thisWeekRecharge/$moneyPara)); + $today_balance = showComma(sprintf("$fmtBit",$thisWeekBalance/$moneyPara)); + $today_charge = showComma(sprintf("$fmtBit",$thisWeekCharge/$moneyPara)); + echo ""; + echo ""; + echo ""; + echo ""; + ?> + +
      $strAccountLastWeekBalance$strAccountThisWeekRecharge$strAccountThisWeekBalance$strAccountThisWeekCharge
      $yesterday_balance$today_recharge$today_balance$today_charge
      +
      + + + +"; + $maxYNum = ($dayCharge[$i]>$maxYNum)?$dayCharge[$i]:$maxYNum; +} +$maxYNum = (ceil($maxYNum/80)+1)*80; +if($DEBGU) echo "maxYNum=$maxYNum
      "; +$legendArr=array( + array('Charge','7D0000',0) + ); +$title="W".$query_week." call charge statistic."; + + +//-----图片背景和坐标,标示等基本元素,请勿修改这部分 +$DEBUG=0; +$sizex=550; +$sizey=270; +$bgcolor=F8F8F8; +$fgcolor=000000; +$dayStr=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + +$im = ImageCreate ($sizex, $sizey); + +$background_color = ImageColorAllocate ($im, hexdec(substr($bgcolor, 0, 2)), hexdec(substr($bgcolor, 2, 2)),hexdec(substr($bgcolor, 4, 2))); + +$text_color = ImageColorAllocate ($im, hexdec(substr($fgcolor, 0, 2)), hexdec(substr($fgcolor, 2, 2)),hexdec(substr($fgcolor, 4, 2))); + +//背景 +ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); +ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + +//边框 +$xBgn=75; +$yBgn=15; +$xEnd=500; +$yEnd=215; +$unitXPix=60; +ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); +ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); +ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); +ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + +//竖网格及标注 +for($i=0;$i<7;$i++){ + ImageDashedLine($im, $xBgn + $i*60, $yBgn, $xBgn + $i*60, $yEnd, $text_color); + $strThisWeek = $strWeek[$i]; + Imagestring($im, 2, $xBgn + $i*60 - 4, $yEnd, "$strThisWeek", $text_color); +} + +//横网格及标注 +for($i=0;$i<8;$i++){ + ImageDashedLine($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, $text_color); +/* + $yRemark=$maxYNum / 8 * (8 - $i); + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$yRemark", $text_color); +*/ + + $scale=$maxYNum / 8 * (8 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); +} + +//色块图标及说明 +for($i=0;$ipointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd - round(($yEnd - $yBgn) * ($pointArr[$i+1] / $maxYNum)); + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + } + $pointArr[$i] = $pointArr[$i-2]; + if($DEBUG) echo "
      pointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd-1; + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + return($pointArr); +} + +for($i=0;$i<7;$i++){ + $pointArr[$i*2] = $i; + $pointArr[$i*2+1] = $dayCharge[$i]; +} +//-----开始画图(线或色块),需要修改 +//色块 +/* +$pointArr=getNewXY($pointArr); +$pointNum= sizeof($pointArr) / 2; +$tmpColor=$legendArr[0][2]; +imagefilledpolygon($im, $pointArr, $pointNum, $tmpColor); +*/ +//线条 +$pointArr=getNewXY($pointArr); +$pointNum= sizeof($pointArr) / 2; +$tmpColor=$legendArr[0][2]; +//imagepolygon($im, $pointArr, $pointNum, $tmpColor); +for($i=0;$i<6;$i++){ + imageline($im,$pointArr[$i*2],$pointArr[$i*2+1],$pointArr[$i*2+2],$pointArr[$i*2+3],$tmpColor); +} + +?> + +
      + + + + +
      + + + +
      + +"; +echo ""; +echo ""; +?> +

      + + + +$maxYNum)?${"dayFaceValue".$k."Used"}[$i]:$maxYNum; + } +} +$maxYNum = (ceil($maxYNum/8)+1)*8; +if($DEBUG) echo "maxYNum=$maxYNum
      "; +for($i=0;$i<6;$i++){ + $faceValue[$i] = "Face value(".${"faceValue".($i+1)}/$moneyPara.")"; + $moneyPara; +} + +$legendArr=array( + array($faceValue[0],'0000FF',0), + array($faceValue[1],'00FF00',0), + array($faceValue[2],'FF0000',0), + array($faceValue[3],'7D0000',0), + array($faceValue[4],'FF00FF',0), + array($faceValue[5],'eeaa22',0) + ); +/* +for($i=0;$i<4;$i++){ + $legendArr[$i*3] = "Face value(".${"faceValue".$i}.")"; + $legendArr[$i*3+1] = "7D7D00"; + $legendArr[$i*3+2] = 0; +} +*/ +$title="Week".$query_week." recharge card statistic."; + + +//-----图片背景和坐标,标示等基本元素,请勿修改这部分 +$sizex=700; +$sizey=270; +$bgcolor=F8F8F8; +$fgcolor=000000; +$dayStr=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + +$im = ImageCreate ($sizex, $sizey); + +$background_color = ImageColorAllocate ($im, hexdec(substr($bgcolor, 0, 2)), hexdec(substr($bgcolor, 2, 2)),hexdec(substr($bgcolor, 4, 2))); + +$text_color = ImageColorAllocate ($im, hexdec(substr($fgcolor, 0, 2)), hexdec(substr($fgcolor, 2, 2)),hexdec(substr($fgcolor, 4, 2))); + +//背景 +ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); +ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + +//边框 +$xBgn=75; +$yBgn=15; +$xEnd=500; +$yEnd=215; +$unitXPix=60; +ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); +ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); +ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); +ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + +//竖网格及标注 +for($i=0;$i<7;$i++){ + ImageDashedLine($im, $xBgn + $i*60, $yBgn, $xBgn + $i*60, $yEnd, $text_color); + $strThisWeek = $strWeek[$i]; + Imagestring($im, 2, $xBgn + $i*60 - 4, $yEnd, "$strThisWeek", $text_color); +} + +//横网格及标注 +for($i=0;$i<8;$i++){ + ImageDashedLine($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, $text_color); +/* + $yRemark=$maxYNum / 8 * (8 - $i); + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$yRemark", $text_color); +*/ + $scale=$maxYNum / 8 * (8 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); +} + + +//色块图标及说明 +for($i=0;$i"; +} +//线条 +$pointArr1=getNewXY($pointArr1); +$pointNum1= sizeof($pointArr1) / 2; +$tmpColor1=$legendArr[0][2]; +if($DEBUG){ + for($i=0;$i<14;){ + echo "pointArr1[$i]=$pointArr1[$i], "; + $i++; + echo "pointArr1[$i]=$pointArr1[$i]
      "; + $i++; + } +} +for($i=0;$i<6;$i++){ + imageline($im,$pointArr1[$i*2],$pointArr1[$i*2+1],$pointArr1[$i*2+2],$pointArr1[$i*2+3],$tmpColor1); +} + +//face value 2 +for($i=0;$i<7;$i++){ + $pointArr2[$i*2] = $i; + $pointArr2[$i*2+1] = $dayFaceValue2Used[$i]; + //echo "dayFaceValue2Used[$i]=$dayFaceValue2Used[$i]
      "; +} +//线条 +$pointArr2=getNewXY($pointArr2); +$pointNum2= sizeof($pointArr2) / 2; +$tmpColor2=$legendArr[1][2]; +for($i=0;$i<6;$i++){ + imageline($im,$pointArr2[$i*2],$pointArr2[$i*2+1],$pointArr2[$i*2+2],$pointArr2[$i*2+3],$tmpColor2); +} + +//face value 3 +for($i=0;$i<7;$i++){ + $pointArr3[$i*2] = $i; + $pointArr3[$i*2+1] = $dayFaceValue3Used[$i]; + //echo "dayFaceValue3Used[$i]=$dayFaceValue3Used[$i]
      "; +} +//线条 +$pointArr3=getNewXY($pointArr3); +$pointNum3= sizeof($pointArr3) / 2; +$tmpColor3=$legendArr[2][2]; +for($i=0;$i<6;$i++){ + imageline($im,$pointArr3[$i*2],$pointArr3[$i*2+1],$pointArr3[$i*2+2],$pointArr3[$i*2+3],$tmpColor3); +} + +//face value 4 +for($i=0;$i<7;$i++){ + $pointArr4[$i*2] = $i; + $pointArr4[$i*2+1] = $dayFaceValue4Used[$i]; + //echo "dayFaceValue4Used[$i]=$dayFaceValue4Used[$i]
      "; +} +//线条 +$pointArr4=getNewXY($pointArr4); +$pointNum4= sizeof($pointArr4) / 2; +$tmpColor4=$legendArr[3][2]; +for($i=0;$i<6;$i++){ + imageline($im,$pointArr4[$i*2],$pointArr4[$i*2+1],$pointArr4[$i*2+2],$pointArr4[$i*2+3],$tmpColor4); +} + +//face value 5 +for($i=0;$i<7;$i++){ + $pointArr5[$i*2] = $i; + $pointArr5[$i*2+1] = $dayFaceValue5Used[$i]; + //echo "dayFaceValue5Used[$i]=$dayFaceValue5Used[$i]
      "; +} +//线条 +$pointArr5=getNewXY($pointArr5); +$pointNum5= sizeof($pointArr5) / 2; +$tmpColor5=$legendArr[4][2]; +for($i=0;$i<6;$i++){ + imageline($im,$pointArr5[$i*2],$pointArr5[$i*2+1],$pointArr5[$i*2+2],$pointArr5[$i*2+3],$tmpColor5); +} + +//face value 6 +for($i=0;$i<7;$i++){ + $pointArr6[$i*2] = $i; + $pointArr6[$i*2+1] = $dayFaceValue6Used[$i]; + //echo "dayFaceValue6Used[$i]=$dayFaceValue6Used[$i]
      "; +} +//线条 +$pointArr6=getNewXY($pointArr6); +$pointNum6= sizeof($pointArr6) / 2; +$tmpColor6=$legendArr[5][2]; +for($i=0;$i<6;$i++){ + imageline($im,$pointArr6[$i*2],$pointArr6[$i*2+1],$pointArr6[$i*2+2],$pointArr6[$i*2+3],$tmpColor6); +} + +?> + + + + + + +
      + + + +
      + +"; +echo ""; +echo ""; +?> +

      + + + + + + + +
      + + + +
      +
      +$maxData)?$data[$i]:$maxData; + if($DEBUG) echo "maxData=$maxData
      "; + if($DEBUG) echo "data[$i-1]=${data[$i-1]}, label[$i-1]=${label[$i-1]}
      "; +} +$maxData = (ceil($maxData/1000)+1)*1000; +$image= imagecreate ($width,$height+20); +$bg=imagecolorallocate($image,0xff,0xff,0xff); +#$point= imagecolorallocate($image,0xff,0xff,0xff); +$line=imagecolorallocate($image,0x7d,0x00,0x00); +$lineFrame=imagecolorallocate($image,0xbb,0xbb,0xbb); +$text=imagecolorallocate($image,0x00,0x00,0x00); +$dotcolor=imagecolorallocate($image,0x7d,0x00,0x00); +imageline ($image,50,0,50,$height,$lineFrame); +imageline($image,50,$height,$width,$height,$lineFrame); + +for ($i=1;$i<11;$i++) +{ + imagedashedline($image,50,$height - $jc*$i*10 ,$width ,$height -$jc*$i*10 ,$lineFrame ); +// imagestring ($image,$font,0,$height-$jc*$i*10,$maxData/10*$i,$text); + + $scale = $maxData/10*$i; + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + imagestring ($image,$font,0,$height-$jc*$i*10,$displayMaxData,$text); +} +for ($i=0;$i"; + $x1=(($width-50)/count($data))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; +// imagestring($image,$font,$x1,$y1-2*$fontheight,$tmp."%(".$data[$i].")",$text); + + if($data[$i]>1000*1000){ + $displayData[$i] = round($data[$i]/100000)/10; + $displayData[$i] = $displayData[$i]."M"; + }elseif($data[$i]>1000){ + $displayData[$i] = round($data[$i]/100)/10; + $displayData[$i] = $displayData[$i]."K"; + } + else + $displayData[$i] = $data[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor); + imagefilltoborder ($image,$x1,$y1,$dotcolor,$dotcolor); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line); + } + $tmpx1=$x1;$tmpy1=$y1; +} +$filename2=time()."2.png"; +ImagePng ($image,$filename2); +ImageDestroy($image); + +//display the picture +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> + +

      + + + + + + + +
      + + + +
      +
      +$maxData)?$data1[$i]:$maxData; + $maxData = ($data2[$i]>$maxData)?$data2[$i]:$maxData; + $maxData = ($data3[$i]>$maxData)?$data3[$i]:$maxData; + $maxData = ($data4[$i]>$maxData)?$data4[$i]:$maxData; + $maxData = ($data5[$i]>$maxData)?$data5[$i]:$maxData; + $maxData = ($data6[$i]>$maxData)?$data6[$i]:$maxData; + if($DEBUG) echo "maxData=$maxData
      "; + if($DEBUG) echo "data1[$i-1]=${data1[$i-1]}, label[$i-1]=${label[$i-1]}
      "; +} +$maxData = (ceil($maxData/10)+1)*10; +$image= imagecreate ($width,$height+20); +$bg=imagecolorallocate($image,0xff,0xff,0xff); +#$point= imagecolorallocate($image,0xff,0xff,0xff); +$line1=imagecolorallocate($image,0x00,0x00,0xFF); +$line2=imagecolorallocate($image,0x00,0xFF,0x00); +$line3=imagecolorallocate($image,0xFF,0x00,0x00); +$line4=imagecolorallocate($image,0x7d,0x00,0x00); +$line5=imagecolorallocate($image,0xFF,0x00,0xFF); +$line6=imagecolorallocate($image,0xee,0xaa,0x22); + +$lineFrame=imagecolorallocate($image,0xbb,0xbb,0xbb); +$text=imagecolorallocate($image,0x00,0x00,0x00); +$dotcolor1=imagecolorallocate($image,0x00,0x00,0xFF); +$dotcolor2=imagecolorallocate($image,0x00,0xFF,0x00); +$dotcolor3=imagecolorallocate($image,0xFF,0x00,0x00); +$dotcolor4=imagecolorallocate($image,0x7d,0x00,0x00); +$dotcolor5=imagecolorallocate($image,0xFF,0x00,0xFF); +$dotcolor6=imagecolorallocate($image,0xee,0xaa,0x22); +imageline ($image,50,0,50,$height,$lineFrame); +imageline($image,50,$height,$width,$height,$lineFrame); +for ($i=1;$i<11;$i++) +{ + imagedashedline($image,50,$height - $jc*$i*10 ,$width ,$height -$jc*$i*10 ,$lineFrame ); +// imagestring ($image,$font,0,$height-$jc*$i*10,$maxData/10*$i,$text); + + $scale = $maxData/10*$i; + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData = $scale; + imagestring ($image,$font,0,$height-$jc*$i*10,$displayMaxData,$text); +} + +//face value 1 +for ($i=0;$i"; + $x1=(($width-50)/count($data1))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data1[$i]>1000*1000){ + $displayData1[$i] = round($data1[$i]/100000); + $displayData1[$i] = $displayData1[$i]/10; + $displayData1[$i] = $displayData1[$i]."M"; + }elseif($data1[$i]>1000){ + $displayData1[$i] = round($data1[$i]/100); + $displayData1[$i] = $displayData1[$i]/10; + $displayData1[$i] = $displayData1[$i]."K"; + } + else + $displayData1[$i] = $data1[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data1[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData1[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor1); + imagefilltoborder ($image,$x1,$y1,$dotcolor1,$dotcolor1); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line1); + } + $tmpx1=$x1;$tmpy1=$y1; +} +//face value 2 +for ($i=0;$i"; + $x1=(($width-50)/count($data2))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data2[$i]>1000*1000){ + $displayData2[$i] = round($data2[$i]/100000); + $displayData2[$i] = $displayData2[$i]/10; + $displayData2[$i] = $displayData2[$i]."M"; + }elseif($data2[$i]>1000){ + $displayData2[$i] = round($data2[$i]/100); + $displayData2[$i] = $displayData2[$i]/10; + $displayData2[$i] = $displayData2[$i]."K"; + } + else + $displayData2[$i] = $data2[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data2[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData2[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor2); + imagefilltoborder ($image,$x1,$y1,$dotcolor2,$dotcolor2); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line2); + } + $tmpx1=$x1;$tmpy1=$y1; +} +//face value 3 +for ($i=0;$i"; + $x1=(($width-50)/count($data3))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data3[$i]>1000*1000){ + $displayData3[$i] = round($data3[$i]/100000); + $displayData3[$i] = $displayData3[$i]/10; + $displayData3[$i] = $displayData3[$i]."M"; + }elseif($data3[$i]>1000){ + $displayData3[$i] = round($data3[$i]/100); + $displayData3[$i] = $displayData3[$i]/10; + $displayData3[$i] = $displayData3[$i]."K"; + } + else + $displayData3[$i] = $data3[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data3[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData3[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor3); + imagefilltoborder ($image,$x1,$y1,$dotcolor3,$dotcolor3); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line3); + } + $tmpx1=$x1;$tmpy1=$y1; +} +//face value 4 +for ($i=0;$i"; + $x1=(($width-50)/count($data4))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data4[$i]>1000*1000){ + $displayData4[$i] = round($data4[$i]/100000); + $displayData4[$i] = $displayData4[$i]/10; + $displayData4[$i] = $displayData4[$i]."M"; + }elseif($data4[$i]>1000){ + $displayData4[$i] = round($data4[$i]/100); + $displayData4[$i] = $displayData4[$i]/10; + $displayData4[$i] = $displayData4[$i]."K"; + } + else + $displayData4[$i] = $data4[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data4[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData4[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor4); + imagefilltoborder ($image,$x1,$y1,$dotcolor4,$dotcolor4); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line4); + } + $tmpx1=$x1;$tmpy1=$y1; +} + +//face value 5 +for ($i=0;$i"; + $x1=(($width-50)/count($data5))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data5[$i]>1000*1000){ + $displayData5[$i] = round($data5[$i]/100000); + $displayData5[$i] = $displayData5[$i]/10; + $displayData5[$i] = $displayData5[$i]."M"; + }elseif($data5[$i]>1000){ + $displayData5[$i] = round($data5[$i]/100); + $displayData5[$i] = $displayData5[$i]/10; + $displayData5[$i] = $displayData5[$i]."K"; + } + else + $displayData5[$i] = $data5[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data5[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData5[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor5); + imagefilltoborder ($image,$x1,$y1,$dotcolor5,$dotcolor5); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line5); + } + $tmpx1=$x1;$tmpy1=$y1; +} + +//face value 6 +for ($i=0;$i"; + $x1=(($width-50)/count($data6))*($i)+40+10; + #echo $x1 ."
      "; + $y1=$height-$tmp*$jc; + $x2=$x1; + $y2=$y1+$tmp*$jc; + #echo $y1."
      "; + + if($data6[$i]>1000*1000){ + $displayData6[$i] = round($data6[$i]/100000); + $displayData6[$i] = $displayData6[$i]/10; + $displayData6[$i] = $displayData6[$i]."M"; + }elseif($data6[$i]>1000){ + $displayData6[$i] = round($data6[$i]/100); + $displayData6[$i] = $displayData6[$i]/10; + $displayData6[$i] = $displayData6[$i]."K"; + } + else + $displayData6[$i] = $data6[$i]; + //imagestring($image,$font,$x1,$y1-2*$fontheight,$data6[$i],$text); + imagestring($image,$font,$x1+$dot,$y1-$dot,$displayData6[$i],$text); + imagearc ($image,$x1 ,$y1,$dot,$dot,0,360,$dotcolor6); + imagefilltoborder ($image,$x1,$y1,$dotcolor6,$dotcolor6); + imagestring ($image,$font,$x1,$y2,$label[$i],$text); + if ($i>0) + { + imageline($image,$tmpx1,$tmpy1,$x1,$y1,$line6); + } + $tmpx1=$x1;$tmpy1=$y1; +} + +//色块图标及说明 +for($i=0;$i"; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +?> + +

       

      + + +$strDailyOperator: "; + echo "$userInfo[ID]"; + echo "              "; + echo "$strDailyPrintTime"; +?> + + +
      + + + + diff --git a/wxc2_omc/performance/ppsDailyReport/weeklyReportIndex.php b/wxc2_omc/performance/ppsDailyReport/weeklyReportIndex.php new file mode 100755 index 0000000..fa0b4c4 --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/weeklyReportIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/ppsDailyReport/weeklyReportUp.php b/wxc2_omc/performance/ppsDailyReport/weeklyReportUp.php new file mode 100755 index 0000000..1befb2a --- /dev/null +++ b/wxc2_omc/performance/ppsDailyReport/weeklyReportUp.php @@ -0,0 +1,100 @@ + + + +
      +"; +echo ""; +echo ""; +echo "$strTitlePerformance $strTitleSpace PPS report > Weekly report"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +$newyear =date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$newmon =date("m",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$newday =date("d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$oldyear =date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y")-1)); +/* +$year=date("Y")."-".date("m")."-".date("d"); +if($DEBUG) echo "$year
      "; + +$thisFebDays=date("t",mktime(0,0,0,2,1,date("Y"))); +if ($thisFebDays == 28) + $thisYearDays = 365; +else + $thisYearDays = 366; +if($DEBUG) echo "thisYearDays=$thisYearDays,thisFebDays=$thisFebDays
      "; +*/ +$firstw =date("w",mktime(0,1,0,1,1,date("Y"))); +$lastDayNumber = date("z",mktime(0,0,0,date("m"),date("d")-1,date("Y")))+1; +$lastWeekNumber = floor(($lastDayNumber-(7-$firstw)) / 7)+1; +if ($DEBUG) echo "firstw = $firstw,"; +if ($DEBUG) echo "lastDayNumber=$lastDayNumber,"; +if ($DEBUG) echo "lastWeekNumber=$lastWeekNumber
      "; +//--Year-- + echo "$strYear  "; + + //--Week-- + echo "$strWeek  "; + +?> + + + + + +"; +echo " "; +echo ""; +echo ""; +echo ""; +echo "
      "; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + + \ No newline at end of file diff --git a/wxc2_omc/performance/pubCsta/cstaImgDownload.php b/wxc2_omc/performance/pubCsta/cstaImgDownload.php new file mode 100755 index 0000000..b1b2c34 --- /dev/null +++ b/wxc2_omc/performance/pubCsta/cstaImgDownload.php @@ -0,0 +1,137 @@ +pointArr[$i]={$pointArr[$i]}"; + } +} +$pointNum= sizeof($pointArr) / 2; + +$tmpColor=$legendArr[0][2]; +//线条 +imagepolygon($im, $pointArr, $pointNum, $tmpColor); + +$pointArr=getNewXY($pointArr_2); +if($DEBUG){ + for($i=0;$ipointArr[$i]={$pointArr[$i]}"; + } +} +$pointNum= sizeof($pointArr) / 2; + +$tmpColor=$legendArr[1][2]; +//色块 +imagefilledpolygon($im, $pointArr, $pointNum, $tmpColor); + +//-----输出图形文件,请勿修改 +//再画一次边框 +ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); +ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); +ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); +ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); +//输出图形文件 +ImagePng ($im,"$imgFileName"); +ImageDestroy($im); + +/* +//-----显示图片 +echo ""; +echo ""; +echo "

      "; +echo ""; +*/ +?> + + + + + + diff --git a/wxc2_omc/performance/pubCsta/cstaImgUpload.php b/wxc2_omc/performance/pubCsta/cstaImgUpload.php new file mode 100755 index 0000000..62daf2b --- /dev/null +++ b/wxc2_omc/performance/pubCsta/cstaImgUpload.php @@ -0,0 +1,138 @@ +pointArr[$i]={$pointArr[$i]}"; + } +} +$pointNum= sizeof($pointArr) / 2; + +$tmpColor=$legendArr[0][2]; +//线条 +imagepolygon($im, $pointArr, $pointNum, $tmpColor); + +$pointArr=getNewXY($pointArr_2); +if($DEBUG){ + for($i=0;$ipointArr[$i]={$pointArr[$i]}"; + } +} +$pointNum= sizeof($pointArr) / 2; + +$tmpColor=$legendArr[1][2]; +//色块 +imagefilledpolygon($im, $pointArr, $pointNum, $tmpColor); + +//-----输出图形文件,请勿修改 +if(!$DEBUG){ + //再画一次边框 + ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); + ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); + ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); + ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + //输出图形文件 + ImagePng ($im,"$imgFileName"); + ImageDestroy($im); +} +/* +//-----显示图片 +echo ""; +echo ""; +echo "

      "; +echo ""; +*/ +?> + + + + + + diff --git a/wxc2_omc/performance/pubCsta/cstaListDown.php b/wxc2_omc/performance/pubCsta/cstaListDown.php new file mode 100755 index 0000000..a83bffc --- /dev/null +++ b/wxc2_omc/performance/pubCsta/cstaListDown.php @@ -0,0 +1,101 @@ +date=$date"; +$dateArr = explode('-',$date); + +$tableName="95dbCsta_{$dateArr[0]}_{$dateArr[1]}_{$dateArr[2]}"; +$sql = "SELECT * FROM $tableName"; +if($DEBUG) echo "
      sql=$sql"; +$result = @mysqli_query($pubConn,$sql); +if($DEBUG) echo '
      '.mysqli_error($pubConn); + +echo "\n "; + +?> + +
      + + + + + + + + + + + + + + + + + + + + + + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +// echo ""; +// echo ""; +// echo ""; +// echo ""; +// echo ""; + echo ""; + echo ""; +// echo ""; +// echo ""; +// echo ""; +// echo ""; + echo ""; + echo ""; +} +?> +
      No.HB NumberActive UserPage VisitDownloadUploadDate
      requestsuccessrequestsuccess
      $rowsNo $rows[hb_per_min] $rows[active] $rows[webVisit]$rows[dnRequ]$rows[dnSucc]$rows[dnFailNoCredit]$rows[dnFailNetfail]$rows[dnFailFileExists]$rows[dnFailAuthFail]$rows[dnFailOther]$rows[upRequ]$rows[upSucc]$rows[upFailDataError]$rows[upFailNetFail]$rows[upFailAuthFail]$rows[upFailOther]$rows[recordTime]
      + + + diff --git a/wxc2_omc/performance/pubCsta/cstaListIndex.php b/wxc2_omc/performance/pubCsta/cstaListIndex.php new file mode 100755 index 0000000..57d260b --- /dev/null +++ b/wxc2_omc/performance/pubCsta/cstaListIndex.php @@ -0,0 +1,15 @@ +"; +echo ""; +echo ""; + +echo ""; +echo "<body>"; +echo "<p>此网页使用了框架,但您的浏览器不支持框架。</p>"; +echo "</body>"; +echo ""; +echo ""; +echo ""; +?> diff --git a/wxc2_omc/performance/pubCsta/cstaListUp.php b/wxc2_omc/performance/pubCsta/cstaListUp.php new file mode 100755 index 0000000..582aec9 --- /dev/null +++ b/wxc2_omc/performance/pubCsta/cstaListUp.php @@ -0,0 +1,66 @@ + + + + +
      + + + "; +?> +
      Date: + "; + echo "   "; + +// echo ""; +// echo "   "; +// echo ""; + echo "
      +
      + + \ No newline at end of file diff --git a/wxc2_omc/performance/pubCsta/dailyReport.php b/wxc2_omc/performance/pubCsta/dailyReport.php new file mode 100755 index 0000000..481ff59 --- /dev/null +++ b/wxc2_omc/performance/pubCsta/dailyReport.php @@ -0,0 +1,383 @@ + + + +
      +
      + + + + + +
      Date: + + + +
      +   Print   +
      +
      +
      +
      +read()){ + //echo "
      $file "; + //echo filectime($file); + if(strstr($file,'.png') + && filectime($file) < $delTimestamp){ + if($DEBUG) echo "
      DELETE : $file"; + @unlink($file); + } +} +$mydir->close(); + +//产生随机熟用于做文件名 +mt_srand((double)microtime()*1000000); +$randval = mt_rand(); + +if(!isset($date)){ + if($DEBUG) echo "
      Default is Today"; + $date=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +} +if($DEBUG) echo "
      date=$date"; +$dateArr = explode('-',$date); + +//======================================================================== +// CDR Daily Report +//======================================================================== +$db='95DB_CDR'; +$tableName = "95dbCdr_{$dateArr[0]}_{$dateArr[1]}_{$dateArr[2]}"; +$sumSql = "SELECT operation,count(charge) as conCharge,sum(charge) as sumCharge + FROM $tableName GROUP BY operation ORDER BY operation"; +if($DEBUG) echo "
      sumSql=$sumSql"; +$sumResult = @mysqli_query($pubConn,$sumSql); + +$errorStr = mysqli_error($pubConn); +if(strstr($errorStr,"doesn't exist")){ + echo "
      This day's record doesn't exist"; + exit(0); +} + +$sumChargeArr=array(0,0,0); +$conChargeArr=array(0,0,0); +while($sumRows = @mysqli_fetch_array($sumResult)){ + $i=$sumRows[operation]; + $sumChargeArr[$i]=$sumRows[sumCharge]; + $conChargeArr[$i]=$sumRows[conCharge]; +} +echo ""; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +for($i=0;$i"; + echo " "; + echo " "; + echo " "; + echo " "; +} +echo "
      Charge
      Operation TypeTotal TimesTotal Charge
      $subsOperDefArr[$i] $conChargeArr[$i] $sumChargeArr[$i] 
      "; + + +//======================================================================== +// CSTA Daily Report +//======================================================================== +$db='95DB_CSTA'; + +$tableName = "95dbCsta_{$dateArr[0]}_{$dateArr[1]}_{$dateArr[2]}"; +$sumSql = "SELECT sum(active) as sumActive,sum(webVisit) as sumWebVisit, + sum(dnRequ) as sumDnRequ, + sum(dnSucc) as sumDnSucc, + sum(dnFailNoCharge) as sumDnFailNoCharge, + sum(dnFailNetFail) as sumDnFailNetFail, + sum(dnFailFileExists) as sumDnFailFileExists, + sum(dnFailAuthFail) as sumDnFailAuthFail, + sum(dnFailOther) as sumDnFailOther, + sum(upRequ) as sumUpRequ, + sum(upSucc) as sumUpSucc, + sum(upFailDataError) as sumUpFailDataError, + sum(upFailNetFail) as sumUpFailNetFail, + sum(upFailAuthFail) as sumUpFailAuthFail, + sum(upFailOther) as sumUpFailOther + FROM $tableName "; +if($DEBUG) echo "
      sumSql=$sumSql"; +$sumResult = @mysqli_query($pubConn,$sumSql); +$sumRows = @mysqli_fetch_array($sumResult); +$errorStr = mysqli_error($pubConn); +if(strstr($errorStr,"doesn't exist")){ + echo "
      This day's record doesn't exist"; + exit(0); +} +//坐标转换函数,将数值转换成坐标 +function getNewXY($pointArr) +{ + global $xBgn,$yBgn,$xEnd,$yEnd,$maxYNum,$unitXPix; + $DEBUG=0; + for($i=0;$ipointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd - round(($yEnd - $yBgn) * ($pointArr[$i+1] / $maxYNum)) - 1; + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + } + $pointArr[$i] = $pointArr[$i-2]; + if($DEBUG) echo "
      pointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd-1; + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + $pointArr[$i+2] = $pointArr[0] * $unitXPix; + $pointArr[$i+3] = $yEnd; + return($pointArr); +} + +echo "

      "; +$sql = "SELECT * FROM $tableName ORDER BY timeNo"; +if($DEBUG) echo "
      sql=$sql"; + +//=============================User======================================= +$result = @mysqli_query($pubConn,$sql); +require("./cstaImgUser.php"); + +echo ""; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo "
      User
       Total%
      Web Visit $sumRows[sumWebVisit] 100%
         
         
         
         
         
         
         
         
      "; +echo "

      "; + +//=============================Download===================================== +$result = @mysqli_query($pubConn,$sql); +require("./cstaImgDownload.php"); + +echo ""; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumDnRequ],$sumRows[sumDnSucc]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumDnRequ],$sumRows[sumDnFailNoCharge]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumDnRequ],$sumRows[sumDnFailNetFail]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumDnRequ],$sumRows[sumDnFailFileExists]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumDnRequ],$sumRows[sumDnFailAuthFail]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumDnRequ],$sumRows[sumDnFailOther]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo "
      Download
       Total%
      Request $sumRows[sumDnRequ] 100%
      Success $sumRows[sumDnSucc] $tmpPercent%
      No Charge $sumRows[sumDnFailNoCharge] $tmpPercent%
      Net Failure $sumRows[sumDnFailNetFail] $tmpPercent%
      File Exist $sumRows[sumDnFailFileExists] $tmpPercent%
      Auth. Failure $sumRows[sumDnFailAuthFail] $tmpPercent%
      Other Failure $sumRows[sumDnFailOther] $tmpPercent%
         
         
      "; + +echo "

      "; + +//=============================Upload======================================= +$result = @mysqli_query($pubConn,$sql); +require("./cstaImgUpload.php"); + +echo ""; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumUpRequ],$sumRows[sumUpRequ]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumUpRequ],$sumRows[sumUpSucc]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumUpRequ],$sumRows[sumUpFailDataError]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumUpRequ],$sumRows[sumUpFailNetFail]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumUpRequ],$sumRows[sumUpFailAuthFail]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +$tmpPercent = getPercent($sumRows[sumUpRequ],$sumRows[sumUpFailOther]); +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo "
      Upload
       Total%
      Request $sumRows[sumUpRequ] $tmpPercent%
      Success $sumRows[sumUpSucc] $tmpPercent%
      Data Error $sumRows[sumUpFailDataError] $tmpPercent%
      Net Failure $sumRows[sumUpFailNetFail] $tmpPercent%
      Auth. Failure $sumRows[sumUpFailAuthFail] $tmpPercent%
      Other Failure $sumRows[sumUpFailOther] $tmpPercent%
         
         
         
      "; +//========================================================================== +$dayStr=date("Y-m-d H:i:s",mktime()); +echo "
          Print Time: $dayStr "; +echo "    Print User: $userInfo[ID]

      "; +echo ""; +?> \ No newline at end of file diff --git a/wxc2_omc/performance/rcsCsta/rcsCstaDown.php b/wxc2_omc/performance/rcsCsta/rcsCstaDown.php new file mode 100755 index 0000000..b125e03 --- /dev/null +++ b/wxc2_omc/performance/rcsCsta/rcsCstaDown.php @@ -0,0 +1,145 @@ + + + +"; + + $DEBUG=0; + + if(!isset($sel_date)) + $sel_date=0; + + if($DEBUG) + echo "sel_date=$sel_date
      "; + + $fieldNameAttr=array("Incoming email attempt", + "Incoming email success", + "Outgoing email attempt", + "Outgoing email success", + "Incoming sms attempt", + "Incoming sms success", + "Outgoing sms attempt", + "Outgoing sms success", + "Total message length", + "Reserved data1", + "Reserved data2"); + + //get data from database + $db="CSTA_DB"; + $table_name="rcsDetail"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $table_name=$table_name."_".$temp; + + if($DEBUG)echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + if($DEBUG)echo "from:$from_time--to:$to_time
      "; + + $select="select key_sys_id,sum(in_email_att) as in_email_att,sum(in_email_suc) as in_email_suc,sum(out_email_att) as out_email_att,sum(out_email_suc) as out_email_suc,sum(in_sms_att) as in_sms_att,sum(in_sms_suc) as in_sms_suc,sum(out_sms_att) as out_sms_att,sum(out_sms_suc) as out_sms_suc "; + $from="from $table_name "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' "; + $group="group by key_sys_id "; + $sql=$select.$from.$where.$group; + if($DEBUG)echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + + //init + $in_email_att_sum=0; + $in_email_suc_sum=0; + $out_email_att_sum=0; + $out_email_suc_sum=0; + $in_sms_att_sum=0; + $in_sms_suc_sum=0; + $out_sms_att_sum=0; + $out_sms_suca_sum=0; + + if($rows) + { + + + do{ + $key_sys_id=$rows[key_sys_id]; + $in_email_att_sum=$rows[in_email_att]; + $in_email_suc_sum=$rows[in_email_suc]; + $out_email_att_sum=$rows[out_email_att]; + $out_email_suc_sum=$rows[out_email_suc]; + $in_sms_att_sum=$rows[in_sms_att]; + $in_sms_suc_sum=$rows[in_sms_suc]; + $out_sms_att_sum=$rows[out_sms_att]; + $out_sms_suca_sum=$rows[out_sms_suc]; + }while($rows=mysqli_fetch_array($result)); + } + + + //table title + echo "
      "; + $sel_date_title=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + echo "$strSMSEG Statistic Date: $sel_date_title
      "; + echo "
      "; + + //show the data + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //Incoming email attempt + echo ""; + echo ""; + //Incoming email success + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //Outgoing email attempt + echo ""; + echo ""; + //Outgoing email success + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //Incoming sms attempt + echo ""; + echo ""; + //Incoming sms success + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //Outgoing sms attempt + echo ""; + echo ""; + //Outgoing sms success + echo ""; + + echo ""; + //Total message length + echo ""; + echo ""; + + echo "

      TypeValue
      Incoming emailAttempt$in_email_att_sum
      Success$in_email_suc_sum
      Outgoing emailAttempt$out_email_att_sum
      Success$out_email_suc_sum
      Incoming smsAttempt$in_sms_att_sum
      Success$in_sms_suc_sum
      Outgoing smsAttempt$out_sms_att_sum
      Success$out_sms_suca_sum
      Total message length0
      "; + +adjust_content_tail("down"); +?> diff --git a/wxc2_omc/performance/rcsCsta/rcsCstaFrame.php b/wxc2_omc/performance/rcsCsta/rcsCstaFrame.php new file mode 100755 index 0000000..8b4ea59 --- /dev/null +++ b/wxc2_omc/performance/rcsCsta/rcsCstaFrame.php @@ -0,0 +1,20 @@ + + + + + "; + echo ""; + ?> + + + <body> + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + </body> + + + + + diff --git a/wxc2_omc/performance/rcsCsta/rcsCstaUp.php b/wxc2_omc/performance/rcsCsta/rcsCstaUp.php new file mode 100755 index 0000000..4c05147 --- /dev/null +++ b/wxc2_omc/performance/rcsCsta/rcsCstaUp.php @@ -0,0 +1,65 @@ + + + + + + +"; + echo ""; + echo ""; + echo "$strTitlePerformance > $strSMSEG"; + echo ""; + echo ""; + $helpId="3.9"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + + //date selection + echo ""; + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + echo "Date: "; + echo ""; + + echo ""; + echo " "; + + echo ""; + echo ""; + echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + + + +?> diff --git a/wxc2_omc/performance/smegCsta/smegCstaDown.php b/wxc2_omc/performance/smegCsta/smegCstaDown.php new file mode 100755 index 0000000..eec2362 --- /dev/null +++ b/wxc2_omc/performance/smegCsta/smegCstaDown.php @@ -0,0 +1,145 @@ + + + +"; + + $DEBUG=0; + + if(!isset($sel_date)) + $sel_date=0; + + if($DEBUG) + echo "sel_date=$sel_date
      "; + + $fieldNameAttr=array("Incoming email attempt", + "Incoming email success", + "Outgoing email attempt", + "Outgoing email success", + "Incoming sms attempt", + "Incoming sms success", + "Outgoing sms attempt", + "Outgoing sms success", + "Total message length", + "Reserved data1", + "Reserved data2"); + + //get data from database + $db="CSTA_DB"; + $table_name="smegDetail"; + $temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $table_name=$table_name."_".$temp; + + if($DEBUG)echo "table_name:$table_name
      "; + + $from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + if($DEBUG)echo "from:$from_time--to:$to_time
      "; + + $select="select key_sys_id,sum(in_email_att) as in_email_att,sum(in_email_suc) as in_email_suc,sum(out_email_att) as out_email_att,sum(out_email_suc) as out_email_suc,sum(in_sms_att) as in_sms_att,sum(in_sms_suc) as in_sms_suc,sum(out_sms_att) as out_sms_att,sum(out_sms_suc) as out_sms_suc "; + $from="from $table_name "; + $where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' "; + $group="group by key_sys_id "; + $sql=$select.$from.$where.$group; + if($DEBUG)echo "$sql
      "; + $result=@mysqli_query($pubConn,$sql); + $rows=@mysqli_fetch_array($result); + + + //init + $in_email_att_sum=0; + $in_email_suc_sum=0; + $out_email_att_sum=0; + $out_email_suc_sum=0; + $in_sms_att_sum=0; + $in_sms_suc_sum=0; + $out_sms_att_sum=0; + $out_sms_suca_sum=0; + + if($rows) + { + + + do{ + $key_sys_id=$rows[key_sys_id]; + $in_email_att_sum=$rows[in_email_att]; + $in_email_suc_sum=$rows[in_email_suc]; + $out_email_att_sum=$rows[out_email_att]; + $out_email_suc_sum=$rows[out_email_suc]; + $in_sms_att_sum=$rows[in_sms_att]; + $in_sms_suc_sum=$rows[in_sms_suc]; + $out_sms_att_sum=$rows[out_sms_att]; + $out_sms_suca_sum=$rows[out_sms_suc]; + }while($rows=mysqli_fetch_array($result)); + } + + + //table title + echo "
      "; + $sel_date_title=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + echo "$strSMSEG Statistic Date: $sel_date_title
      "; + echo "
      "; + + //show the data + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //Incoming email attempt + echo ""; + echo ""; + //Incoming email success + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //Outgoing email attempt + echo ""; + echo ""; + //Outgoing email success + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //Incoming sms attempt + echo ""; + echo ""; + //Incoming sms success + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + //Outgoing sms attempt + echo ""; + echo ""; + //Outgoing sms success + echo ""; + + echo ""; + //Total message length + echo ""; + echo ""; + + echo "

      TypeValue
      Incoming emailAttempt$in_email_att_sum
      Success$in_email_suc_sum
      Outgoing emailAttempt$out_email_att_sum
      Success$out_email_suc_sum
      Incoming smsAttempt$in_sms_att_sum
      Success$in_sms_suc_sum
      Outgoing smsAttempt$out_sms_att_sum
      Success$out_sms_suca_sum
      Total message length0
      "; + +adjust_content_tail("down"); +?> \ No newline at end of file diff --git a/wxc2_omc/performance/smegCsta/smegCstaFrame.php b/wxc2_omc/performance/smegCsta/smegCstaFrame.php new file mode 100755 index 0000000..2ff7d34 --- /dev/null +++ b/wxc2_omc/performance/smegCsta/smegCstaFrame.php @@ -0,0 +1,20 @@ + + + + + "; + echo ""; + ?> + + + <body> + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + </body> + + + + + diff --git a/wxc2_omc/performance/smegCsta/smegCstaUp.php b/wxc2_omc/performance/smegCsta/smegCstaUp.php new file mode 100755 index 0000000..209be3f --- /dev/null +++ b/wxc2_omc/performance/smegCsta/smegCstaUp.php @@ -0,0 +1,65 @@ + + + + + + +"; + echo ""; + echo ""; + echo "$strTitlePerformance > $strSMSEG"; + echo ""; + echo ""; + $helpId="3.9"; + showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + + //date selection + echo "
      "; + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + echo "Date: "; + echo "
      "; + + echo ""; + echo " "; + + echo ""; + echo ""; + echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); + + + +?> diff --git a/wxc2_omc/performance/smscCsta/1254214837.png b/wxc2_omc/performance/smscCsta/1254214837.png new file mode 100755 index 0000000..2e3d158 Binary files /dev/null and b/wxc2_omc/performance/smscCsta/1254214837.png differ diff --git a/wxc2_omc/performance/smscCsta/dataAnalysisDown.php b/wxc2_omc/performance/smscCsta/dataAnalysisDown.php new file mode 100755 index 0000000..585e576 --- /dev/null +++ b/wxc2_omc/performance/smscCsta/dataAnalysisDown.php @@ -0,0 +1,464 @@ + + + +"; + +$DEBUG = 0; + +$db=$csta_db; +$time_column = "csta_datetime"; + +// +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$table_name='smscDetail'."_".$showDate; +$title_time=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));//表头显示时间 +if($DEBUG) echo "table_name=$table_name, db=$db
      "; +$sel_field_list= @mysql_list_fields($db,$table_name); +if($DEBUG) echo "sel_field_list = $sel_field_list
      "; + +// +$showDate1 = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); +$showDate1 = omc_keep_length($showDate1,0,2); +$table_name1 = "smscDetail_".$showDate1; +if($DEBUG) echo "table_name1 = $table_name1
      "; +$sel_field_list1= @mysql_list_fields($db,$table_name1); +if($DEBUG) echo "sel_field_list1 = $sel_field_list1
      "; + +if ( (!$sel_field_list)&&(!$sel_field_list1) ) +{ + echo "
      $strNotFindRecord."; + exit(); +} + +if($language == 'eng'){ + $strSmscStatistic = "SMSC statistics"; +}else{ + $strSmscStatistic = "SMSC 话务统计"; +} + +// +//-------确定日期范围----- +if($sel_date<0){ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} +elseif($sel_date>0){ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); +}else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} + +/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ +$w1=" $time_column >'$bgn_date' AND $time_column <= '$end_date'"; + +//合成where语句 +$where=" WHERE ".$w1; +$str_sql_all=" SELECT count(*) as number_of_records FROM $table_name ".$where; +if($DEBUG) echo "str_sql_all=$str_sql_all
      "; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = @mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +//echo "number_of_records = $number_of_records
      "; +if(!$number_of_records) +{ + echo "$strNotFindRecord"; + exit(); +} + +if($sel_field_list){ + $sum_sql=" SELECT + SUM(MS_to_SMSC_attempt) AS MS_to_SMSC_attempt, + SUM(MS_to_SMSC_success) AS MS_to_SMSC_success, + SUM(MS_to_SMSC_sysfail) AS MS_to_SMSC_sysfail, + SUM(MS_to_SMSC_userfail) AS MS_to_SMSC_userfail, + SUM(MS_to_SMSC_smfail) AS MS_to_SMSC_smfail, + SUM(MS_to_SMSC_byte) AS MS_to_SMSC_byte, + + SUM(SMSC_to_MS_attempt) AS SMSC_to_MS_attempt, + SUM(SMSC_to_MS_success) AS SMSC_to_MS_success, + SUM(SMSC_to_MS_sysfail) AS SMSC_to_MS_sysfail, + SUM(SMSC_to_MS_userfail) AS SMSC_to_MS_userfail, + SUM(SMSC_to_MS_smfail) AS SMSC_to_MS_smfail, + SUM(SMSC_to_MS_byte) AS SMSC_to_MS_byte, + + SUM(VMS_to_SMSC_attempt) AS VMS_to_SMSC_attempt, + SUM(VMS_to_SMSC_success) AS VMS_to_SMSC_success, + SUM(VMS_to_SMSC_sysfail) AS VMS_to_SMSC_sysfail, + SUM(VMS_to_SMSC_userfail) AS VMS_to_SMSC_userfail, + SUM(VMS_to_SMSC_smfail) AS VMS_to_SMSC_smfail, + SUM(VMS_to_SMSC_byte) AS VMS_to_SMSC_byte, + + SUM(SMSC_to_VMS_attempt) AS SMSC_to_VMS_attempt, + SUM(SMSC_to_VMS_success) AS SMSC_to_VMS_success, + SUM(SMSC_to_VMS_sysfail) AS SMSC_to_VMS_sysfail, + SUM(SMSC_to_VMS_userfail) AS SMSC_to_VMS_userfail, + SUM(SMSC_to_VMS_smfail) AS SMSC_to_VMS_smfail, + SUM(SMSC_to_VMS_byte) AS SMSC_to_VMS_byte, + + SUM(PPS_to_SMSC_attempt) AS PPS_to_SMSC_attempt, + SUM(PPS_to_SMSC_success) AS PPS_to_SMSC_success, + SUM(PPS_to_SMSC_sysfail) AS PPS_to_SMSC_sysfail, + SUM(PPS_to_SMSC_userfail) AS PPS_to_SMSC_userfail, + SUM(PPS_to_SMSC_smfail) AS PPS_to_SMSC_smfail, + SUM(PPS_to_SMSC_byte) AS PPS_to_SMSC_byte, + + SUM(SMSC_to_PPS_attempt) AS SMSC_to_PPS_attempt, + SUM(SMSC_to_PPS_success) AS SMSC_to_PPS_success, + SUM(SMSC_to_PPS_sysfail) AS SMSC_to_PPS_sysfail, + SUM(SMSC_to_PPS_userfail) AS SMSC_to_PPS_userfail, + SUM(SMSC_to_PPS_smfail) AS SMSC_to_PPS_smfail, + SUM(SMSC_to_PPS_byte) AS SMSC_to_PPS_byte, + + SUM(SMPP_to_SMSC_attempt) AS SMPP_to_SMSC_attempt, + SUM(SMPP_to_SMSC_success) AS SMPP_to_SMSC_success, + SUM(SMPP_to_SMSC_sysfail) AS SMPP_to_SMSC_sysfail, + SUM(SMPP_to_SMSC_userfail) AS SMPP_to_SMSC_userfail, + SUM(SMPP_to_SMSC_smfail) AS SMPP_to_SMSC_smfail, + SUM(SMPP_to_SMSC_byte) AS SMPP_to_SMSC_byte, + + SUM(SMSC_to_SMPP_attempt) AS SMSC_to_SMPP_attempt, + SUM(SMSC_to_SMPP_success) AS SMSC_to_SMPP_success, + SUM(SMSC_to_SMPP_sysfail) AS SMSC_to_SMPP_sysfail, + SUM(SMSC_to_SMPP_userfail) AS SMSC_to_SMPP_userfail, + SUM(SMSC_to_SMPP_smfail) AS SMSC_to_SMPP_smfail, + SUM(SMSC_to_SMPP_byte) AS SMSC_to_SMPP_byte, + + SUM(SM_bgn) AS SM_bgn, + SUM(SM_end) AS SM_end + + FROM $table_name ".$where; + //echo "
      sum_sql=$sum_sql"; + $sum_res = mysqli_query($pubConn,$sum_sql); + $sum_row = @mysqli_fetch_array($sum_res); + echo mysqli_error($pubConn); +} + +// + + +"; +echo ""; +echo " "; +echo "To SMSC"; +echo "SMSC to"; +echo ""; +echo ""; +echo "MS"; +echo "VMS"; +echo "PPS"; +echo "SMPP"; +echo "Total"; +echo "MS"; +echo "VMS"; +echo "PPS"; +echo "SMPP"; +echo "Total"; +echo ""; + +for($i=0;$i<7;$i++) +{ + if ((3==$i)||(4==$i)) continue; + echo ""; + for($j=0;$j<11;$j++) + { + echo "{$arrSMSCSevice[$j][$i]}"; + } + echo ""; +} +echo ""; +echo "

      "; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +/* +echo ""; +echo ""; +echo ""; +echo ""; +*/ +echo "
      Pending SM statistic at beginning:$SM_bgn
      Pending SM statistic at ending:$SM_end
      SM cleared during statistic perio:$SM_clr
      "; +echo "
      "; +?> + + + diff --git a/wxc2_omc/performance/smscCsta/dataAnalysisIndex.php b/wxc2_omc/performance/smscCsta/dataAnalysisIndex.php new file mode 100755 index 0000000..2c18c4d --- /dev/null +++ b/wxc2_omc/performance/smscCsta/dataAnalysisIndex.php @@ -0,0 +1,18 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/smscCsta/dataAnalysisUp.php b/wxc2_omc/performance/smscCsta/dataAnalysisUp.php new file mode 100755 index 0000000..3d7ec5c --- /dev/null +++ b/wxc2_omc/performance/smscCsta/dataAnalysisUp.php @@ -0,0 +1,87 @@ + + + + +
      +"; +echo ""; +echo ""; +echo "$strTitlePerformance > SMSC > $strAnalysis" ; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; +?> + +"; +echo ""; +echo " "; +echo ""; +echo ""; +echo ""; + +?> + + +
      + + + + diff --git a/wxc2_omc/performance/smscCsta/dataQueryDown.php b/wxc2_omc/performance/smscCsta/dataQueryDown.php new file mode 100755 index 0000000..38015dd --- /dev/null +++ b/wxc2_omc/performance/smscCsta/dataQueryDown.php @@ -0,0 +1,364 @@ + + + +"; + +$DEBUG = 0; + +$db=$csta_db; +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$timeItem = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$sort_field = 'csta_datetime'; //排序所依赖的字段名 +$sort_direction = 'DESC'; //排序顺序 +$number_records_to_display = 200; //每页纪录数 +$time_column = "csta_datetime"; +$table_name='smscDetail'."_".$showDate; + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + +if($call_type==0)//MS && SMSC +{ + $headName_1 = "MS->SMSC"; + $headName_2 = "SMSC->MS"; +} +elseif($call_type==1)//VMS && SMSC +{ + $headName_1 = "VMS->SMSC"; + $headName_2 = "SMSC->VMS"; + +} +elseif($call_type==2)//PPS && SMSC +{ + $headName_1 = "PPS->SMSC"; + $headName_2 = "SMSC->PPS"; + +} +elseif($call_type==3)//SMPP && SMSC +{ + $headName_1 = "SMPP->SMSC"; + $headName_2 = "SMSC->SMPP"; +} + +$where = isset($where) ? urldecode($where) : ''; //传回变量后解url码 +$where = isset($where) ? stripslashes($where) : ''; //解除一些'/' +//删除所查询的内容 +if($delete){ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//end of delete +?> + + +0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + /* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ + $w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + + //合成where语句 + $where=" WHERE".$w1; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo "
      $strNotFindRecord"; + exit(); + } + +}//endif + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +if ($number_of_records >= 1){ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0){ + $prev_index = 0; + } +} +$show_initital_record=$initial_record+1; +?> + + + + +" +> + + +
       $show_initital_record - $next_index, ($strTotalRecords:$number_of_records )   "; ?>  +"; +//下面是控制分页显示,传递变量 +if ($initial_record != 0) +{ + $t1 = "initial_record=$prev_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 前一页  + 0 && $number_of_records > $number_records_to_display ) +{ + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 下一页 + +
      + +
      +"; +$csta_result = mysqli_query($pubConn,$csta_sql); +$csta_rows = @mysqli_fetch_array($csta_result); +echo mysqli_error($pubConn); + +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +if($call_type==0)//MS && SMSC +{ + do + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} +elseif($call_type==1)//VMS && SMSC +{ + do + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} +elseif($call_type==2)//PPS && SMSC +{ + do + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} +elseif($call_type==3)//SMPP && SMSC +{ + do + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} + + +?> +
       $headName_1$headName_2 
      $strSystemAttemptSuccessUnsuccessSubFailSMFailTotalBytesAttemptSuccessUnsuccessSubFailSMFailTotalBytes$strTime($timeItem)
      "; + echo "SMSC"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[MS_to_SMSC_attempt]$csta_rows[MS_to_SMSC_success]$csta_rows[MS_to_SMSC_sysfail]$csta_rows[MS_to_SMSC_userfail]$csta_rows[MS_to_SMSC_smfail]$csta_rows[MS_to_SMSC_byte]$csta_rows[SMSC_to_MS_attempt]$csta_rows[SMSC_to_MS_success]$csta_rows[SMSC_to_MS_sysfail]$csta_rows[SMSC_to_MS_userfail]$csta_rows[SMSC_to_MS_smfail]$csta_rows[SMSC_to_MS_byte]$tmpArray[1]
      "; + echo "SMSC"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[VMS_to_SMSC_attempt]$csta_rows[VMS_to_SMSC_success]$csta_rows[VMS_to_SMSC_sysfail]$csta_rows[VMS_to_SMSC_userfail]$csta_rows[VMS_to_SMSC_smfail]$csta_rows[VMS_to_SMSC_byte]$csta_rows[SMSC_to_VMS_attempt]$csta_rows[SMSC_to_VMS_success]$csta_rows[SMSC_to_VMS_sysfail]$csta_rows[SMSC_to_VMS_userfail]$csta_rows[SMSC_to_VMS_smfail]$csta_rows[SMSC_to_VMS_byte]$tmpArray[1]
      "; + echo "SMSC"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[PPS_to_SMSC_attempt]$csta_rows[PPS_to_SMSC_success]$csta_rows[PPS_to_SMSC_sysfail]$csta_rows[PPS_to_SMSC_userfail]$csta_rows[PPS_to_SMSC_smfail]$csta_rows[PPS_to_SMSC_byte]$csta_rows[SMSC_to_PPS_attempt]$csta_rows[SMSC_to_PPS_success]$csta_rows[SMSC_to_PPS_sysfail]$csta_rows[SMSC_to_PPS_userfail]$csta_rows[SMSC_to_PPS_smfail]$csta_rows[SMSC_to_PPS_byte]$tmpArray[1]
      "; + echo "SMSC"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[SMPP_to_SMSC_attempt]$csta_rows[SMPP_to_SMSC_success]$csta_rows[SMPP_to_SMSC_sysfail]$csta_rows[SMPP_to_SMSC_userfail]$csta_rows[SMPP_to_SMSC_smfail]$csta_rows[SMPP_to_SMSC_byte]$csta_rows[SMSC_to_SMPP_attempt]$csta_rows[SMSC_to_SMPP_success]$csta_rows[SMSC_to_SMPP_sysfail]$csta_rows[SMSC_to_SMPP_userfail]$csta_rows[SMSC_to_SMPP_smfail]$csta_rows[SMSC_to_SMPP_byte]$tmpArray[1]
      + + + + + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/smscCsta/dataQueryIndex.php b/wxc2_omc/performance/smscCsta/dataQueryIndex.php new file mode 100755 index 0000000..1190c33 --- /dev/null +++ b/wxc2_omc/performance/smscCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/smscCsta/dataQueryUp.php b/wxc2_omc/performance/smscCsta/dataQueryUp.php new file mode 100755 index 0000000..fec51f2 --- /dev/null +++ b/wxc2_omc/performance/smscCsta/dataQueryUp.php @@ -0,0 +1,96 @@ + + + + + + + +
      + +"; +echo ""; +echo ""; +echo "$strAdvanced > $strTitlePerformance > SMSC > Query"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> + + +"; +echo ""; + +echo ""; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + +
      + + diff --git a/wxc2_omc/performance/smscCsta/drawGraphic.php b/wxc2_omc/performance/smscCsta/drawGraphic.php new file mode 100755 index 0000000..434fbeb --- /dev/null +++ b/wxc2_omc/performance/smscCsta/drawGraphic.php @@ -0,0 +1,537 @@ + + + + +
      + + + + +
      + +on top +
      + + +"; +$time_column = "csta_datetime"; //时间列名 + +$showDate1 = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); +$showDate1 = omc_keep_length($showDate1,0,2); +$table_name1 = "smscDetail_".$showDate1; +if($DEBUG) echo "table_name1 = $table_name1
      "; +$bgn_time1=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); +$end_time1=date("Y-m-d H:i:s",mktime(1,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + +$sel_field_list= @mysql_list_fields($db,$table_name); +$sel_field_list1= @mysql_list_fields($db,$table_name1); +if($DEBUG) echo "sel_field_list = $sel_field_list, sel_field_list1 = $sel_field_list1
      "; + +if((!$sel_field_list)&&(!$sel_field_list1)){ + echo " "; + exit(); +} + +//$date = date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +//$time="Time:".$date;//显示的时间 + +//where语句的时间限制组成部分$w1 +//$w1 = " $time_column > '$bgn_time' AND $time_column <= '$end_time' "; + +//统计每小时 +//$group = " GROUP BY key_type, csta_datetime "; +//$order = " ORDER BY key_type "; + +//合成查询语句$where +//$where=" WHERE".$w1.$group.$order; +//echo "$where
      "; + +if($sel_field_list){ + for ($i=1; $i<=24; $i++){ + $select = " SELECT + sum(MS_to_SMSC_success) as MS_to_SMSC_success, + sum(VMS_to_SMSC_success) as VMS_to_SMSC_success, + sum(PPS_to_SMSC_success) as PPS_to_SMSC_success, + sum(SMPP_to_SMSC_success) as SMPP_to_SMSC_success, + sum(SMSC_to_MS_success) as SMSC_to_MS_success, + sum(SMSC_to_SMPP_success) as SMSC_to_SMPP_success + FROM $table_name "; + + if($sel_date==-1){ + $bgn_time = date("Y-m-d H:i:s", mktime($i-1,0,0,date("m"),date("d")-6,date("Y"))); + $end_time=date("Y-m-d H:i:s", mktime()); + }else{ + $bgn_time=date("Y-m-d H:i:s",mktime($i-1,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_time=date("Y-m-d H:i:s",mktime($i,0,0,date("m"),date("d")-$sel_date,date("Y"))); + } + + $where = " WHERE $time_column>'$bgn_time' AND $time_column<='$end_time' "; + + $select_sql=$select.$where;//查询语句 + if($DEBUG) echo "
      select_sql=$select_sql"; + $select_result=@mysqli_query($pubConn,$select_sql); + $select_rows=@mysqli_fetch_array($select_result); + + if($DEBUG) echo "timeslot = $i
      "; + $smscStat[0][$i] = $select_rows[MS_to_SMSC_success]; + $tValue = $smscStat[0][$i]; + if($DEBUG) echo "MS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[1][$i] = $select_rows[VMS_to_SMSC_success]; + $tValue = $smscStat[1][$i]; + if($DEBUG) echo "VMS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[2][$i] = $select_rows[PPS_to_SMSC_success]; + $tValue = $smscStat[2][$i]; + if($DEBUG) echo "PPS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[3][$i] = $select_rows[SMPP_to_SMSC_success]; + $tValue = $smscStat[3][$i]; + if($DEBUG) echo "SMPP to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[4][$i] = $select_rows[SMSC_to_MS_success]; + $tValue = $smscStat[4][$i]; + if($DEBUG) echo "SMSC to MS=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[5][$i] = $select_rows[SMSC_to_SMPP_success]; + $tValue = $smscStat[5][$i]; + if($DEBUG) echo "SMSC to SMPP=$tValue

      "; + if($tValue > $maxNum) $maxNum = $tValue; + } +} + +//当天最后一个点的坐标.24:00=NEXT 0:00 +//先取23:00~23:45的统计,在smscDetail_(thatDay)表中, +//再取23:45~24:00的统计,在smscDetail_(thatDay+1)表中。 +//两者相加 +if($sel_field_list1){ + $select = " SELECT + sum(MS_to_SMSC_success) as MS_to_SMSC_success, + sum(VMS_to_SMSC_success) as VMS_to_SMSC_success, + sum(PPS_to_SMSC_success) as PPS_to_SMSC_success, + sum(SMPP_to_SMSC_success) as SMPP_to_SMSC_success, + sum(SMSC_to_MS_success) as SMSC_to_MS_success, + sum(SMSC_to_SMPP_success) as SMSC_to_SMPP_success + FROM $table_name1 "; + + if($sel_date==-1){ + $bgn_time = date("Y-m-d H:i:s", mktime($i-1,0,0,date("m"),date("d")-6,date("Y"))); + $end_time=date("Y-m-d H:i:s", mktime()); + }else{ + $bgn_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + + $where = " WHERE $time_column>'$bgn_time' AND $time_column<='$end_time' "; + + $select_sql=$select.$where;//查询语句 + if($DEBUG) echo "
      select_sql=$select_sql"; + $select_result=@mysqli_query($pubConn,$select_sql); + $select_rows=@mysqli_fetch_array($select_result); + do{ + $number=explode(" ",$select_rows[csta_datetime]); + $number_1=explode(":",$number[1]); + $datetime=$number_1[0]; + if($datetime<10){ + $datetime=substr($datetime,1); + } + if(0 == $datetime) $datetime = 24; + if($DEBUG) echo "
      datetime=$datetime
      "; + + $smscStat[0][$datetime] += $select_rows[MS_to_SMSC_success]; + $tValue = $smscStat[0][$datetime]; + if($DEBUG) echo "MS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[1][$datetime] += $select_rows[VMS_to_SMSC_success]; + $tValue = $smscStat[1][$datetime]; + if($DEBUG) echo "VMS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[2][$datetime] += $select_rows[PPS_to_SMSC_success]; + $tValue = $smscStat[2][$datetime]; + if($DEBUG) echo "PPS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[3][$datetime] += $select_rows[SMPP_to_SMSC_success]; + $tValue = $smscStat[3][$datetime]; + if($DEBUG) echo "SMPP to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[4][$datetime] += $select_rows[SMSC_to_MS_success]; + $tValue = $smscStat[4][$datetime]; + if($DEBUG) echo "SMSC to MS=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[5][$datetime] += $select_rows[SMSC_to_SMPP_success]; + $tValue = $smscStat[5][$datetime]; + if($DEBUG) echo "SMSC to SMPP=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + }while($select_rows=@mysqli_fetch_array($select_result)); +} + +//第二天第一个点的坐标. +if($sel_field_list1){ + $select = " SELECT + sum(MS_to_SMSC_success) as MS_to_SMSC_success, + sum(VMS_to_SMSC_success) as VMS_to_SMSC_success, + sum(PPS_to_SMSC_success) as PPS_to_SMSC_success, + sum(SMPP_to_SMSC_success) as SMPP_to_SMSC_success, + sum(SMSC_to_MS_success) as SMSC_to_MS_success, + sum(SMSC_to_SMPP_success) as SMSC_to_SMPP_success + FROM $table_name1 "; + + $where = " WHERE $time_column>'$bgn_time1' AND $time_column<='$end_time1' "; + + $select_sql=$select.$where;//查询语句 + if($DEBUG) echo "
      select_sql=$select_sql"; + $select_result=@mysqli_query($pubConn,$select_sql); + $select_rows=@mysqli_fetch_array($select_result); + do{ + $datetime = 25; + if($DEBUG) echo "
      datetime=$datetime
      "; + + $smscStat[0][$datetime] = $select_rows[MS_to_SMSC_success]; + $tValue = $smscStat[0][$datetime]; + if($DEBUG) echo "MS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[1][$datetime] = $select_rows[VMS_to_SMSC_success]; + $tValue = $smscStat[1][$datetime]; + if($DEBUG) echo "VMS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[2][$datetime] = $select_rows[PPS_to_SMSC_success]; + $tValue = $smscStat[2][$datetime]; + if($DEBUG) echo "PPS to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[3][$datetime] = $select_rows[SMPP_to_SMSC_success]; + $tValue = $smscStat[3][$datetime]; + if($DEBUG) echo "SMPP to SMSC=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[4][$datetime] = $select_rows[SMSC_to_MS_success]; + $tValue = $smscStat[4][$datetime]; + if($DEBUG) echo "SMSC to MS=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + + $smscStat[5][$datetime] = $select_rows[SMSC_to_SMPP_success]; + $tValue = $smscStat[5][$datetime]; + if($DEBUG) echo "SMSC to SMPP=$tValue
      "; + if($tValue > $maxNum) $maxNum = $tValue; + }while($select_rows=@mysqli_fetch_array($select_result)); +} + +$y_max = ceil($maxNum/10)*10; +if($y_max < 10) $y_max = 10; + +//insert log +insertLog('BHCA service graphics',2,5); +?> + +
      + + +"; +$title = ucfirst("smsc successful statistic graphic"); +if($DEBUG) echo "title=$title
      "; + +//-----图片背景和坐标,标示等基本元素,请勿修改这部分 +$sizex=800; +$sizey=320; +$bgcolor=F8F8F8; +$fgcolor=000000; +$dayStr=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$i,date("Y"))); + +$im = ImageCreate ($sizex, $sizey); + +$background_color = ImageColorAllocate ($im, + hexdec(substr($bgcolor, 0, 2)), + hexdec(substr($bgcolor, 2, 2)), + hexdec(substr($bgcolor, 4, 2))); + +$text_color = ImageColorAllocate ($im, + hexdec(substr($fgcolor, 0, 2)), + hexdec(substr($fgcolor, 2, 2)), + hexdec(substr($fgcolor, 4, 2))); + +//背景 +ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198)); +ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4); +Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130)); +ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color); + +//图表名称 +Imagestring($im, 2, 300,5, $title, $text_color); + +//边框 +$xBgn=60; +$yBgn=25; +$xEnd=780; +$yEnd=275; +$unitXPix=30; +ImageLine($im, $xBgn, $yBgn, $xBgn, $yEnd, $text_color); +ImageLine($im, $xBgn, $yBgn, $xEnd, $yBgn, $text_color); +ImageLine($im, $xBgn, $yEnd, $xEnd, $yEnd, $text_color); +ImageLine($im, $xEnd, $yBgn, $xEnd, $yEnd, $text_color); + +//竖网格及标注 + +for($i=0;$i<24;$i++){ + ImageDashedLine($im, $xBgn + $i*30, $yBgn, $xBgn + $i*30, $yEnd, $text_color); + Imagestring($im, 2, $xBgn + $i*30 - 4, $yEnd, "$i", $text_color); +} + +//横网格及标注 +for($i=0;$i<10;$i++){ + ImageDashedLine($im, $xBgn, $yBgn + $i*25, $xEnd, $yBgn + $i*25, $text_color); + $scale=$maxYNum / 10 * (10 - $i); + if($scale>1000*1000){ + $displayMaxData = round($scale/100000)/10; + $displayMaxData = $displayMaxData."M"; + }elseif($scale>1000){ + $displayMaxData = round($scale/100)/10; + $displayMaxData = $displayMaxData."K"; + }else + $displayMaxData=$scale; + Imagestring($im, 2, $xBgn - 50, $yBgn + $i*25 - 5, "$displayMaxData", $text_color); +} + +//色块图标及说明 +for($i=0;$ixBgn=$xBgn, yBgn=$yBgn, xEnd=$xEnd, yEnd=$yEnd, maxYNum=$maxYNum, unixXPix=$unitXPix
      "; + for($i=0;$ipointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd - round(($yEnd - $yBgn) * ($pointArr[$i+1] / $maxYNum)); + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + } + $pointArr[$i] = $pointArr[$i-2]; + if($DEBUG) echo "
      pointArr[$i]={$pointArr[$i]}"; + $pointArr[$i+1] = $yEnd-1; + if($DEBUG) echo "
      pointArr[$i+1]={$pointArr[$i+1]}"; + return($pointArr); +} + +//MS->SMSC +for($i=1;$i<=25;$i++){ + $pointArr0[$i*2] = $i-1; + $pointArr0[$i*2+1] = $smscStat[0][$i]; +} +//线条 +$pointArr0=getNewXY($pointArr0); +$pointNum0= sizeof($pointArr0) / 2; +$tmpColor0=$legendArr[0][2]; +if($DEBUG){ + for($i=0;$i<14;){ + echo "pointArr0[$i]=$pointArr0[$i], "; + $i++; + echo "pointArr0[$i]=$pointArr0[$i]
      "; + $i++; + } +} + +//VMS -> SMSC +for($i=1;$i<=25;$i++){ + $pointArr1[$i*2] = $i-1; + $pointArr1[$i*2+1] = $smscStat[1][$i]; +} +//线条 +$pointArr1=getNewXY($pointArr1); +$pointNum1= sizeof($pointArr1) / 2; +$tmpColor1=$legendArr[1][2]; +if($DEBUG){ + for($i=0;$i<14;){ + echo "pointArr1[$i]=$pointArr1[$i], "; + $i++; + echo "pointArr1[$i]=$pointArr1[$i]
      "; + $i++; + } +} + +//PPS->SMSC +for($i=1;$i<=25;$i++){ + $pointArr2[$i*2] = $i-1; + $pointArr2[$i*2+1] = $smscStat[2][$i]; +} +//线条 +$pointArr2=getNewXY($pointArr2); +$pointNum2= sizeof($pointArr2) / 2; +$tmpColor2=$legendArr[2][2]; +if($DEBUG){ + for($i=0;$i<14;){ + echo "pointArr2[$i]=$pointArr2[$i], "; + $i++; + echo "pointArr2[$i]=$pointArr2[$i]
      "; + $i++; + } +} + +//SMPP -> SMSC +for($i=1;$i<=25;$i++){ + $pointArr3[$i*2] = $i-1; + $pointArr3[$i*2+1] = $smscStat[3][$i]; + if($DEBUG) echo "smscStat[3][$i]={$smscStat[3][$i]}
      "; +} +//线条 +$pointArr3=getNewXY($pointArr3); +$pointNum3= sizeof($pointArr3) / 2; +$tmpColor3=$legendArr[3][2]; +if($DEBUG){ + for($i=0;$i<14;){ + echo "pointArr3[$i]=$pointArr3[$i], "; + $i++; + echo "pointArr3[$i]=$pointArr3[$i]
      "; + $i++; + } +} + +//SMSC -> MS +for($i=1;$i<=25;$i++){ + $pointArr4[$i*2] = $i-1; + $pointArr4[$i*2+1] = $smscStat[4][$i]; + if($DEBUG) echo "smscStat[4][$i]={$smscStat[4][$i]}
      "; +} +//线条 +$pointArr4=getNewXY($pointArr4); +$pointNum4= sizeof($pointArr4) / 2; +$tmpColor4=$legendArr[4][2]; +if($DEBUG){ + for($i=0;$i<14;){ + echo "pointArr4[$i]=$pointArr4[$i], "; + $i++; + echo "pointArr4[$i]=$pointArr4[$i]
      "; + $i++; + } +} + +//SMSC -> SMPP +for($i=1;$i<=25;$i++){ + $pointArr5[$i*2] = $i-1; + $pointArr5[$i*2+1] = $smscStat[5][$i]; +} +//线条 +$pointArr5=getNewXY($pointArr5); +$pointNum5= sizeof($pointArr5) / 2; +$tmpColor5=$legendArr[5][2]; +if($DEBUG){ + for($i=0;$i<14;){ + echo "pointArr5[$i]=$pointArr5[$i], "; + $i++; + echo "pointArr5[$i]=$pointArr5[$i]
      "; + $i++; + } +} + +//画线条 +for($i=1;$i<25;$i++){ + for($j=0;$j<6;$j++){ + if ($j == $selTopVal) continue; + $pointDef = "pointArr".$j; + $colorDef = "tmpColor".$j; + imageline($im,${$pointDef}[$i*2],${$pointDef}[$i*2+1],${$pointDef}[$i*2+2],${$pointDef}[$i*2+3],${$colorDef}); + } +} +//selTopVal最后画,让它在最前面 +for($i=1;$i<25;$i++){ + $pointDef = "pointArr".$selTopVal; + $colorDef = "tmpColor".$selTopVal; + imageline($im,${$pointDef}[$i*2],${$pointDef}[$i*2+1],${$pointDef}[$i*2+2],${$pointDef}[$i*2+3],${$colorDef}); +} + +//-----输出图形文件,请勿修改 +//delete *.png +$handle=opendir('.'); +while($file=readdir($handle)){ + $retval=""; + $pt=strrpos($file,"."); + if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt); + if($retval=='png') unlink($file); +} +$filename=time().".png"; +if(!$DEBUG){ + ImagePng ($im,"$filename"); + ImageDestroy($im); +} + +//-----显示图片 +echo ""; +echo ""; +echo ""; + +?> diff --git a/wxc2_omc/performance/sub_inc/sub_chinese_gb.inc b/wxc2_omc/performance/sub_inc/sub_chinese_gb.inc new file mode 100755 index 0000000..1c6d44e --- /dev/null +++ b/wxc2_omc/performance/sub_inc/sub_chinese_gb.inc @@ -0,0 +1,211 @@ + \ No newline at end of file diff --git a/wxc2_omc/performance/sub_inc/sub_config.inc b/wxc2_omc/performance/sub_inc/sub_config.inc new file mode 100755 index 0000000..46e8544 --- /dev/null +++ b/wxc2_omc/performance/sub_inc/sub_config.inc @@ -0,0 +1,49 @@ + '0', 'name' => 'All'), + array('num'=> '1', 'name' => $strIncomingCallPerE1), + array('num'=> '2', 'name' => $strOutgoingCallPerE1), + array('num'=> '3', 'name' => $strIncomingCallPerTrunkGroup), + array('num'=> '4', 'name' => $strOutgoingCallPerTrunkGroup), + array('num'=> '5', 'name' => $strTrunkToSubscriberCall), + array('num'=> '6', 'name' => $strTrunkToTrunkCall), + array('num'=> '7', 'name' => $strTotalSubscriberToSubscriberCall), + array('num'=> '8', 'name' => $strTotalSubscriberToTrunkLocalCall), + array('num'=> '9', 'name' => $strTotalSubscriberToTrunkTollCall), + array('num'=> '10', 'name' => $strGMSCSMSMeasurementFunction) + ); + +if($thisOmcType==1){ + $DEFAULT_SYS="GMSC"; +}elseif($thisOmcType==9){ + $DEFAULT_SYS="HBSC"; +}elseif($thisOmcType==10){ + $DEFAULT_SYS="SN"; +}else{ + $DEFAULT_SYS="MSC"; +} + +//按指定的宽和高显示色块图片 +//$colorNum 大于零的整数 +//1:蓝色,2: +function showImg($colorName,$width,$height,$name='noName',$alt='') +{ + $img_src=''; + + $imgName='icon_'.$colorName.'.gif'; + $img_src ="\"$alt\""; + $img_src .= ""; + echo "$img_src"; +}//end of function + +?> \ No newline at end of file diff --git a/wxc2_omc/performance/sub_inc/sub_english.inc b/wxc2_omc/performance/sub_inc/sub_english.inc new file mode 100755 index 0000000..51412fc --- /dev/null +++ b/wxc2_omc/performance/sub_inc/sub_english.inc @@ -0,0 +1,213 @@ + diff --git a/wxc2_omc/performance/sub_inc/sub_english.inc_old b/wxc2_omc/performance/sub_inc/sub_english.inc_old new file mode 100755 index 0000000..13ca808 --- /dev/null +++ b/wxc2_omc/performance/sub_inc/sub_english.inc_old @@ -0,0 +1,76 @@ + diff --git a/wxc2_omc/performance/sub_inc/xiehua_english.inc b/wxc2_omc/performance/sub_inc/xiehua_english.inc new file mode 100755 index 0000000..8de69e8 --- /dev/null +++ b/wxc2_omc/performance/sub_inc/xiehua_english.inc @@ -0,0 +1,236 @@ + \ No newline at end of file diff --git a/wxc2_omc/performance/vlrCsta/dataAnalysisDown.php b/wxc2_omc/performance/vlrCsta/dataAnalysisDown.php new file mode 100755 index 0000000..8b54fda --- /dev/null +++ b/wxc2_omc/performance/vlrCsta/dataAnalysisDown.php @@ -0,0 +1,630 @@ + + + +"; + +$db=$csta_db; +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$time_column = "csta_datetime"; +$table_name='vlrDetail'."_".$showDate; +$title_time=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));//表头显示时间 + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + +if($language == 'eng') +{ + $strAmma="MS memory available notifications"; + $strAirp="Identification requests to PVLRs"; + $strApr="Page requests"; + $strAprpla="Page requests per Location Area"; + $strArassv="Authentication sets sent to HLR by VLRs"; + $strAapv="Authentication procedures in VLR"; + $strAavlu="Intra-VLR Location Updates"; + $strArvlu="Inter-VLR Location Updates"; + $strAvop="Arrivals of Visitors from other PLMNs"; + $strSoprv="Subscribers from other PLMNs registered in the VLR"; + $strNrv="Number of roamers in the VLR"; + $strVlrStatistic="VLR Statistic"; +} +else +{ + $strAmma="MS memory available notifications"; + $strAirp="Identification requests to PVLRs"; + $strApr="Page requests"; + $strAprpla="Page requests per Location Area"; + $strArassv="Authentication sets sent to HLR by VLRs"; + $strAapv="Authentication procedures in VLR"; + $strAavlu="Intra-VLR Location Updates"; + $strArvlu="Inter-VLR Location Updates"; + $strAvop="Arrivals of Visitors from other PLMNs"; + $strSoprv="Subscribers from other PLMNs registered in the VLR"; + $strNrv="Number of roamers in the VLR"; + $strVlrStatistic="VLR Statistic"; +} + +//-------确定日期范围----- +if($sel_date<0) +{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} +elseif($sel_date>0) +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } +} +else +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } +} + +/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ +$w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + +//合成where语句 +$where=" WHERE ".$w1; +$str_sql_all=" SELECT count(*) as number_of_records FROM $table_name ".$where; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +if(!$number_of_records) +{ + echo "$strNotFindRecord"; + exit(); +} +$sum_sql=" SELECT SUM(amma) AS amma,SUM(smma) AS smma,SUM(airp) AS airp,SUM(sirp) AS sirp,SUM(apr) AS apr, SUM(spr) AS spr,SUM(aprpla) AS aprpla,SUM(sprpla) AS sprpla,SUM(arassv) AS arassv,SUM(srashv) AS srashv,SUM(errash) AS errash,SUM(aapv) AS aapv,SUM(sapv) AS sapv,SUM(aavlu) AS aavlu,SUM(savlu) AS savlu,SUM(arvlu) AS arvlu,SUM(srvlu) AS srvlu,SUM(avop) AS avop,SUM(soprv) AS soprv,SUM(nrv) AS nrv FROM $table_name ".$where; +//echo "
      sum_sql=$sum_sql"; +$sum_res = mysqli_query($pubConn,$sum_sql); +$sum_row = @mysqli_fetch_array($sum_res); +echo mysqli_error($pubConn); + +$amma=$sum_row[amma]; +$smma=$sum_row[smma]; +$fmma=$amma-$smma; +if($amma>0) +{ + $ammaScale="100%"; + $smmaPoint=$smma/$amma; + $smmaScale=change_percent($smma/$amma); + $fmmaPoint=$fmma/$amma; + $fmmaScale=change_percent($fmma/$amma); +} +else +{ + $ammaScale="0%"; + $smmaPoint="0%"; + $smmaScale="0%"; + $fmmaPoint="0%"; + $fmmaScale="0%"; +} + +$airp=$sum_row[airp]; +$sirp=$sum_row[sirp]; +$firp=$airp-$sirp; +if($airp>0) +{ + $airpScale="100%"; + $sirpPoint=$sirp/$airp; + $sirpScale=change_percent($sirp/$airp); + $firpPoint=$firp/$airp; + $firpScale=change_percent($firp/$airp); +} +else +{ + $airpScale="0%"; + $sirpPoint="0%"; + $sirpScale="0%"; + $firpPoint="0%"; + $firpScale="0%"; +} + +$apr=$sum_row[apr]; +$spr=$sum_row[spr]; +$fpr=$apr-$spr; +if($apr>0) +{ + $aprScale="100%"; + $sprPoint=$spr/$apr; + $sprScale=change_percent($spr/$apr); + $fprPoint=$fpr/$apr; + $fprScale=change_percent($fpr/$apr); +} +else +{ + $aprScale="0%"; + $sprPoint="0%"; + $sprScale="0%"; + $fprPoint="0%"; + $fprScale="0%"; +} + +$aprpla=$sum_row[aprpla]; +$sprpla=$sum_row[sprpla]; +$fprpla=$aprpla-$sprpla; +if($aprpla>0) +{ + $aprplaScale="100%"; + $sprplaPoint=$sprpla/$aprpla; + $sprplaScale=change_percent($sprpla/$aprpla); + $fprplaPoint=$fprpla/$aprpla; + $fprplaScale=change_percent($fprpla/$aprpla); +} +else +{ + $aprplaScale="0%"; + $sprplaPoint="0%"; + $sprplaScale="0%"; + $fprplaPoint="0%"; + $fprplaScale="0%"; +} + +$arassv=$sum_row[arassv]; +$srashv=$sum_row[srashv]; +$frrash=$arassv-$srashv; +if($arassv>0) +{ + $arassvScale="100%"; + $srashvPoint=$srashv/$arassv; + $srashvScale=change_percent($srashv/$arassv); + $frrashPoint=$frrash/$arassv; + $frrashScale=change_percent($frrash/$arassv); +} +else +{ + $arassvScale="0%"; + $srashvPoint="0%"; + $srashvScale="0%"; + $frrashPoint="0%"; + $frrashScale="0%"; +} + +$aapv=$sum_row[aapv]; +$sapv=$sum_row[sapv]; +$fapv=$aapv-$sapv; +if($aapv>0) +{ + $aapvScale="100%"; + $sapvPoint=$sapv/$aapv; + $sapvScale=change_percent($sapv/$aapv); + $fapvPoint=$fapv/$aapv; + $fapvScale=change_percent($fapv/$aapv); +} +else +{ + $aapvScale="0%"; + $sapvPoint="0%"; + $sapvScale="0%"; + $fapvPoint="0%"; + $fapvScale="0%"; +} + +$aavlu=$sum_row[aavlu]; +$savlu=$sum_row[savlu]; +$favlu=$aavlu-$savlu; +if($aavlu>0) +{ + $aavluScale="100%"; + $savluPoint=$savlu/$aavlu; + $savluScale=change_percent($savlu/$aavlu); + $favluPoint=$favlu/$aavlu; + $favluScale=change_percent($favlu/$aavlu); +} +else +{ + $aavluScale="0%"; + $savluPoint="0%"; + $savluScale="0%"; + $favluPoint="0%"; + $favluScale="0%"; +} + +$arvlu=$sum_row[arvlu]; +$srvlu=$sum_row[srvlu]; +$frvlu=$arvlu-$srvlu; +if($arvlu>0) +{ + $arvluScale="100%"; + $srvluPoint=$srvlu/$arvlu; + $srvluScale=change_percent($srvlu/$arvlu); + $frvluPoint=$frvlu/$arvlu; + $frvluScale=change_percent($frvlu/$arvlu); +} +else +{ + $arvluScale="0%"; + $srvluPoint="0%"; + $srvluScale="0%"; + $frvluPoint="0%"; + $frvluScale="0%"; +} + +$avop=$sum_row[avop]; +if($avop>0) +{ + $avopScale="100%"; +} +else +{ + $avopScale="0%"; +} + +$soprv=$sum_row[soprv]; +if($soprv>0) +{ + $soprvScale="100%"; +} +else +{ + $soprvScale="0%"; +} + +$nrv=$sum_row[nrv]; +if($nrv>0) +{ + $nrvScale="100%"; +} +else +{ + $nrvScale="0%"; +} + +?> + + + + + + + + + + + +
      + +

        +Date: +

      +
      + +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      1.

      +

      +

      +

      +

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

       

      +

       

      +

      +

       

      +

       

      +

      +

      +

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + 2. +
      + + + + + + + + + + + + + + + + +
           
      +

      + + + + + + + + +
      :
      + + + \ No newline at end of file diff --git a/wxc2_omc/performance/vlrCsta/dataAnalysisIndex.php b/wxc2_omc/performance/vlrCsta/dataAnalysisIndex.php new file mode 100755 index 0000000..5ac0925 --- /dev/null +++ b/wxc2_omc/performance/vlrCsta/dataAnalysisIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/vlrCsta/dataAnalysisUp.php b/wxc2_omc/performance/vlrCsta/dataAnalysisUp.php new file mode 100755 index 0000000..48ef0b0 --- /dev/null +++ b/wxc2_omc/performance/vlrCsta/dataAnalysisUp.php @@ -0,0 +1,84 @@ + + + + + +"; + echo ""; + echo ""; + echo "$strAdvanced > $strPerformance > VLR > Statistics"; + echo ""; + echo ""; +// showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; +?> + +"; + echo ""; + + echo ""; + echo ""; + echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + + + + + diff --git a/wxc2_omc/performance/vlrCsta/dataQueryDown.php b/wxc2_omc/performance/vlrCsta/dataQueryDown.php new file mode 100755 index 0000000..2253933 --- /dev/null +++ b/wxc2_omc/performance/vlrCsta/dataQueryDown.php @@ -0,0 +1,344 @@ + + +"; + +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$timeItem = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$db=$csta_db; +$sort_field = 'csta_datetime'; //排序所依赖的字段名 +$sort_direction = 'DESC'; //排序顺序 +$number_records_to_display = 200; //每页纪录数 +$time_column = "csta_datetime"; +$table_name='vlrDetail'."_".$showDate; + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + + +if($language == 'eng') +{ + $strAmma="Attempted MS memory available notifications"; + $strSmma="Successful MS memory available notifications"; + $strAirp="Attempted Identification requests to PVLRs"; + $strSirp="Successful Identification requests to PVLRs"; + $strApr="Attempted page requests"; + $strSpr="Successful page requests"; + $strAprpla="Attempted page requests per Location Area"; + $strSprpla="Successful page requests per Location Area"; + $strArassv="Attempted requests for Authentication sets sent to HLR by VLRs"; + $strSrashv="Successful received Authentication sets from HLR to VLRs"; + $strErrash="Empty responses to request for Authentication sets from HLR to VLRs"; + $strAapv="Attempted authentication procedures in VLR"; + $strSapv="Successful authentication procedures in the VLR"; + $strAavlu="Attempted intra-VLR Location Updates"; + $strSavlu="Successful intra-VLR Location Updates"; + $strArvlu="Attempted inter-VLR Location Updates"; + $strSrvlu="Successful inter-VLR Location Updates"; + $strAvop="Arrivals of Visitors from other PLMNs"; + $strSoprv="Subscribers from other PLMNs registered in the VLR"; + $strNrv="Number of roamers in the VLR"; +} +else +{ + $strAmma="Attempted MS memory available notifications"; + $strSmma="Successful MS memory available notifications"; + $strAirp="Attempted Identification requests to PVLRs"; + $strSirp="Successful Identification requests to PVLRs"; + $strApr="Attempted page requests"; + $strSpr="Successful page requests"; + $strAprpla="Attempted page requests per Location Area"; + $strSprpla="Successful page requests per Location Area"; + $strArassv="Attempted requests for Authentication sets sent to HLR by VLRs"; + $strSrashv="Successful received Authentication sets from HLR to VLRs"; + $strErrash="Empty responses to request for Authentication sets from HLR to VLRs"; + $strAapv="Attempted authentication procedures in VLR"; + $strSapv="Successful authentication procedures in the VLR"; + $strAavlu="Attempted intra-VLR Location Updates"; + $strSavlu="Successful intra-VLR Location Updates"; + $strArvlu="Attempted inter-VLR Location Updates"; + $strSrvlu="Successful inter-VLR Location Updates"; + $strAvop="Arrivals of Visitors from other PLMNs"; + $strSoprv="Subscribers from other PLMNs registered in the VLR"; + $strNrv="Number of roamers in the VLR"; +} +$where = isset($where) ? urldecode($where) : ''; //传回变量后解url码 +$where = isset($where) ? stripslashes($where) : ''; //解除一些'/' +//删除所查询的内容 +if($delete){ + $sql_query="DELETE FROM $table_name ".$where; + $sql_query=urlencode($sql_query); //将该字符串编码,适合传递 + echo " "; +}//end of delete +?> + + +0){ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } + }else{ + if($sel_time){ + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + }else{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } + } + + /* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ + $w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + + //合成where语句 + $where=" WHERE".$w1; + + $initial_record = 0;//初始纪录号 + + $str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; + //echo "
      str_sql_all=$str_sql_all"; + $csta_result= mysqli_query($pubConn,$str_sql_all); + $record = mysql_fetch_object($csta_result); + $number_of_records = $record->number_of_records; + if(!$number_of_records) + { + echo "
      $strNotFindRecord"; + exit(); + } + +}//endif + +$page_num= ($initial_record / $number_records_to_display) +1; //该页页码 +$all_page_num= ceil($number_of_records / $number_records_to_display); //总页码 +if ($number_of_records >= 1){ + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0){ + $prev_index = 0; + } +} +$show_initital_record=$initial_record+1; +?> + + + + +" +> + + +
       $show_initital_record - $next_index, ($strTotalRecords:$number_of_records )   "; ?>  +"; +//下面是控制分页显示,传递变量 +if ($initial_record != 0) +{ + $t1 = "initial_record=$prev_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 前一页  + 0 && $number_of_records > $number_records_to_display ) +{ + $t1 = "initial_record=$next_index&number_of_records=$number_of_records&table_name=$table_name&sel_date=$sel_date"; + $where=urlencode($where); //将该字符串编码,适合传递 + echo ""; + ?> + 下一页 + +
      + +
      +"; +$csta_result = mysqli_query($pubConn,$csta_sql); +$csta_rows = @mysqli_fetch_array($csta_result); +echo mysqli_error($pubConn); + +echo ""; + +if($call_type==0)//call handling +{ + echo ""; + echo ""; + echo ""; + echo ""; + /* + echo ""; + echo ""; + */ + echo ""; + echo ""; + /* + echo ""; + echo ""; + echo ""; + */ + //echo ""; + //echo ""; + echo ""; + echo ""; + do + { + echo ""; + echo ""; + echo ""; + echo ""; + /* + echo ""; + echo ""; + */ + echo ""; + echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + //echo ""; + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} +elseif($call_type==1)//location management +{ + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + /* + echo ""; + echo ""; + */ + echo ""; + echo ""; + do + { + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + /* + echo ""; + echo ""; + */ + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; + }while($csta_rows= mysqli_fetch_array($csta_result)); +} +?> +
      $strSystem$strAmma$strSmma$strAirp$strSirp$strApr$strSpr$strAprpla$strSprpla$strAvop$strSoprv$strNrv$strTime($timeItem)
      "; + echo "VLR"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[amma]$csta_rows[smma]$csta_rows[airp]$csta_rows[sirp]$csta_rows[apr]$csta_rows[spr]$csta_rows[aprpla]$csta_rows[sprpla]$csta_rows[avop]$csta_rows[soprv]$csta_rows[nrv]$tmpArray[1]
      $strSystem$strArassv$strSrashv$strErrash$strAapv$strSapv$strAavlu$strSavlu$strArvlu$strSrvlu$strTime($timeItem)
      "; + echo "VLR"."_"."$csta_rows[key_sys_id]"; + echo "$csta_rows[arassv]$csta_rows[srashv]$csta_rows[errash]$csta_rows[aapv]$csta_rows[sapv]$csta_rows[aavlu]$csta_rows[savlu]$csta_rows[arvlu]$csta_rows[srvlu]$tmpArray[1]
      + + + + + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/vlrCsta/dataQueryIndex.php b/wxc2_omc/performance/vlrCsta/dataQueryIndex.php new file mode 100755 index 0000000..1190c33 --- /dev/null +++ b/wxc2_omc/performance/vlrCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/vlrCsta/dataQueryUp.php b/wxc2_omc/performance/vlrCsta/dataQueryUp.php new file mode 100755 index 0000000..2551d32 --- /dev/null +++ b/wxc2_omc/performance/vlrCsta/dataQueryUp.php @@ -0,0 +1,92 @@ + + + + + + +
      + +"; + echo ""; + echo ""; + echo "$strAdvanced > $strPerformance > VLR > Data"; + echo ""; + echo ""; +// showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + + $day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); + $day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); + $day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); + $day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); + $day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); + $day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> + + +"; + echo ""; + + echo ""; + echo ""; + echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + +
      + + diff --git a/wxc2_omc/performance/vmsCsta/dataAnalysisDown.php b/wxc2_omc/performance/vmsCsta/dataAnalysisDown.php new file mode 100755 index 0000000..e41660f --- /dev/null +++ b/wxc2_omc/performance/vmsCsta/dataAnalysisDown.php @@ -0,0 +1,254 @@ + + +"; + + +$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); +$showDate = omc_keep_length($showDate,0,2); +$db=$csta_db; +$time_column = "csta_datetime"; +$table_name='vssDetail'."_".$showDate; +$title_time=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));//表头显示时间 + + $sel_field_list= @mysql_list_fields($db,$table_name); + if(!$sel_field_list) + { + echo "
      $strNotFindRecord."; + exit(); + } + +if($language == 'eng') +{ + $showArr[0][0] = $stratt_term_call = "Total call"; + $showArr[1][0] = $stratt_snd_call = "Leave message"; + $showArr[2][0] = $stratt_rcv_call = "Pickup message"; + $showArr[3][0] = $stratt_get_call = "Help prompt"; + $showArr[4][0] = $stratt_own_call = "Record host name"; + $showArr[5][0] = $stratt_grt_call = "Record greetings"; + $showArr[6][0] = $stratt_vce_call = "Record announcement"; + $showArr[7][0] = $stratt_frm_msc = "Call status announcement"; + $showArr[8][0] = $stratt_frm_pps = "PPS announcement"; + $strServerStatistics = "Server statistics"; + $strVmsStatistic = "VSS statistic"; +} +else +{ + $showArr[0][0] = $stratt_term_call = "Termination calls"; + $showArr[1][0] = $stratt_snd_call = "Send voice mail"; + $showArr[2][0] = $stratt_rcv_call = "Receive voice mail"; + $showArr[3][0] = $stratt_get_call = "Help prompt"; + $showArr[4][0] = $stratt_own_call = "Record owner's name"; + $showArr[5][0] = $stratt_grt_call = "Record persional greeting"; + $showArr[6][0] = $stratt_vce_call = "Record voice announcement"; + $showArr[7][0] = $stratt_frm_msc = "MSC VPS calls"; + $showArr[8][0] = $stratt_frm_pps = "PPS VPS calls"; + $strServerStatistics = "Server statistics"; + $strVmsStatistic = "VSS statistic"; +} + +//-------确定日期范围----- +if($sel_date<0) +{ + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); +} +elseif($sel_date>0) +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); + } +} +else +{ + if($sel_time) + { + $bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y"))); + } + else + { + $bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y"))); + $end_date=date("Y-m-d H:i:s", mktime()); + } +} + +/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */ +$w1=" $time_column >='$bgn_date' AND $time_column <= '$end_date'"; + +//合成where语句 +$where=" WHERE ".$w1; +$str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where; +$csta_result= mysqli_query($pubConn,$str_sql_all); +$record = mysql_fetch_object($csta_result); +$number_of_records = $record->number_of_records; +if(!$number_of_records) +{ + echo "$strNotFindRecord"; + exit(); +} +if($key_sys_id>9) + $sum_sql=" + SELECT + SUM(att_org_call) AS att_org_call_sum, + SUM(suc_org_call) AS suc_org_call_sum, + SUM(att_term_call) AS att_term_call_sum, + SUM(suc_term_call) AS suc_term_call_sum, + + SUM(att_lev_msg) AS att_lev_msg_sum, + SUM(suc_lev_msg) AS suc_lev_msg_sum, + SUM(att_mnt_msg) AS att_mnt_msg_sum, + SUM(suc_mnt_msg) AS suc_mnt_msg_sum, + SUM(acc_fail) AS acc_fail_sum, + + FROM $table_name + "; +else + $sum_sql=" + SELECT + SUM(att_org_call) AS att_org_call_sum, + SUM(suc_org_call) AS suc_org_call_sum, + SUM(att_term_call) AS att_term_call_sum, + SUM(suc_term_call) AS suc_term_call_sum, + + SUM(att_lev_msg) AS att_lev_msg_sum, + SUM(suc_lev_msg) AS suc_lev_msg_sum, + SUM(att_mnt_msg) AS att_mnt_msg_sum, + SUM(suc_mnt_msg) AS suc_mnt_msg_sum, + SUM(acc_fail) AS acc_fail_sum + + FROM $table_name WHERE key_sys_id='$key_sys_id' GROUP BY key_sys_id + "; + +//echo "
      sum_sql=$sum_sql"; +$sum_res = mysqli_query($pubConn,$sum_sql); +$sum_row = @mysqli_fetch_array($sum_res); +echo mysqli_error($pubConn); + +?> + + + +
      + + + + + + + +
      + +

        +Date: +

      +
      + +
      +
      + +"; +echo " "; +echo " "; +echo " "; +echo " "; +/*echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +*/echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +echo " "; +/*echo " "; +echo " "; +echo " "; +echo " "; +echo ""; +*/echo "
       Call TypeNumber
      VASMSC Announcement Attempt $sum_row[att_msc_sum]
      MSC Announcement Success $sum_row[suc_msc_sum]
      PPS Announcement Attempt $sum_row[att_pps_sum]
      PPS Announcement Success $sum_row[suc_pps_sum]
      VSSleave message attempt $sum_row[att_lev_msg_sum]
      leave message success $sum_row[suc_lev_msg_sum]
      maintain message attempt $sum_row[att_mnt_msg_sum]
      maintain message success $sum_row[suc_mnt_msg_sum]
      fail to access $sum_row[acc_fail_sum]
      ISUPoriginal attempt $sum_row[att_org_call_sum]
      original success $sum_row[suc_org_call_sum]
      terminal attempt $sum_row[att_term_call_sum]
      terminal success $sum_row[suc_term_call_sum]
      InvalidInvalid Calls $sum_row[att_invalid_call_sum]
      "; + +adjust_content_tail("down"); +?> +
      + + diff --git a/wxc2_omc/performance/vmsCsta/dataAnalysisIndex.php b/wxc2_omc/performance/vmsCsta/dataAnalysisIndex.php new file mode 100755 index 0000000..6537ac1 --- /dev/null +++ b/wxc2_omc/performance/vmsCsta/dataAnalysisIndex.php @@ -0,0 +1,16 @@ + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/vmsCsta/dataAnalysisUp.php b/wxc2_omc/performance/vmsCsta/dataAnalysisUp.php new file mode 100755 index 0000000..7be14dc --- /dev/null +++ b/wxc2_omc/performance/vmsCsta/dataAnalysisUp.php @@ -0,0 +1,115 @@ + + + + +
      +"; +echo ""; +echo ""; +echo "$strTitlePerformance > VSS"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +echo ""; + +echo "$strSystemID:"; +?> + + + + + + +"; +echo ""; + +echo ""; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + +
      + + + diff --git a/wxc2_omc/performance/vmsCsta/dataQueryDown.php b/wxc2_omc/performance/vmsCsta/dataQueryDown.php new file mode 100755 index 0000000..e0e617e --- /dev/null +++ b/wxc2_omc/performance/vmsCsta/dataQueryDown.php @@ -0,0 +1,185 @@ + + + +"; + +$DEBUG=0; + +$db='CSTA_DB'; +$call_type = isset($call_type)?$call_type:'2'; +$sort_field = 'csta_datetime DESC, key_sys_id ASC'; //排序所依赖的字段名 +$number_records_to_display = 200; //每页纪录数 +$time_column = "csta_datetime"; + +if(!isset($sel_date)){ + $sel_date = date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + $timeItem = date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); + if($DEBUG) echo "
      sel_date=$sel_date"; + $call_type=1; +} + +$tmpDay = explode('-',$sel_date); +$tmpDay = $tmpDay[2]; +$table_name='vssDetail'."_".$tmpDay; + +$sel_field_list= @mysql_list_fields($db,$table_name); +if(!$sel_field_list){ + echo "
      $strNotFindRecord."; + exit(); +} + +$sysTypeNo=390; +switch($sysTypeNo){ + case '390': + $helpId = "3.5"; + $callTypeDefArr=array('ISUP','VMS APP','VPS APP','Invalid Calls'); + $fieldTypeDefArr=array( + '', + 'att_org_call,suc_org_call,att_term_call,suc_term_call', + 'att_lev_msg,suc_lev_msg,att_mnt_msg,suc_mnt_msg,acc_fail', + 'att_msc,suc_msc,att_pps,suc_pps', + 'att_invalid_call' + ); + // $tableTitleDefArr=array( + // '', + // 'sysIdattemptsuccessanswered (call directly)answered (forward)Time' + // ); + break; + default: + echo "Can not support this sysTypeNo($sysTypeNo)"; + exit(); +} + +?> + +csta_sql=$csta_sql"; +$csta_result = mysqli_query($pubConn,$csta_sql); +$csta_rows = @mysqli_fetch_array($csta_result); +echo mysqli_error($pubConn); + + +//显示表头 +echo ""; +switch($call_type){ + case 1: + echo ""; + echo ""; + //echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + //echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + break; + case 2: + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + /*echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + */echo ""; + break; + case 3: + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + break; + case 4: + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + break; +} +//显示表的记录 +$fieldArr=explode(',',$fieldTypeDefArr[$call_type]); +do{ + echo ""; + echo ""; + for($i=0;$i$csta_rows[$tmpFieldName]"; + } + $tmpArray = explode(" ",$csta_rows[csta_datetime]); + echo ""; + echo ""; +}while($csta_rows= mysqli_fetch_array($csta_result)); +?> +
      system IDAttemptSuccessoriginalterminalTime($timeItem)
      AttemptSuccess
      AttemptSuccess
      system IDLeave messageMaintain messageMaintenanceAccess to failTime($timeItem)
      AttemptSuccessAttemptSuccessAttemptselect greeting typehost name personal greetingselect languageactive passwordinactive passwordchange passwordattempt
      system IDMSC announcementPPS serviceTime($timeItem)
      AttemptSuccessAttemptSuccess
      system IDInvalid CallsTime($timeItem)
      $csta_rows[key_sys_id]$tmpArray[1]
      + + + + \ No newline at end of file diff --git a/wxc2_omc/performance/vmsCsta/dataQueryIndex.php b/wxc2_omc/performance/vmsCsta/dataQueryIndex.php new file mode 100755 index 0000000..1190c33 --- /dev/null +++ b/wxc2_omc/performance/vmsCsta/dataQueryIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/performance/vmsCsta/dataQueryUp.php b/wxc2_omc/performance/vmsCsta/dataQueryUp.php new file mode 100755 index 0000000..943ff4e --- /dev/null +++ b/wxc2_omc/performance/vmsCsta/dataQueryUp.php @@ -0,0 +1,142 @@ + + +
      + + + + + + + + +"; +echo ""; +echo ""; +echo "Performance > VSS > Query"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; + +//select options +/* +$pubDb='OMC_PUB'; +$sqlStr="SELECT sysTypeName,maxSysNum,maxSubSysNum FROM sysConf WHERE sysTypeNo='390'"; +$result=mysqli_query($pubConn,$sqlStr); +$rows=mysqli_fetch_array($result); +echo "System "; +//echo "{$rows[maxSysNum]},{$rows[maxSubSysNum]}"; +echo ""; +echo "  "; +*/ +echo "$strSystemID:"; +echo ""; +echo "Call Type "; +echo ""; +echo "   Date "; +echo ""; +echo "   "; +echo ""; +//echo "   "; +//echo ""; + +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; + +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> +
      + + diff --git a/wxc2_omc/security/backupRestore/bssReboot b/wxc2_omc/security/backupRestore/bssReboot new file mode 100755 index 0000000..d51dfa5 --- /dev/null +++ b/wxc2_omc/security/backupRestore/bssReboot @@ -0,0 +1,30 @@ +#!/bin/bash + +tmptty=`tty` +tmptty=`basename $tmptty` +tmpname=`whoami` +ip="$1" + +inputfile="inabc" +outputfile="out.log" + +rm -fr $inputfile +rm -fr $outputfile +mknod $inputfile p +touch $outputfile + +exec 7<>$outputfile +exec 8<>$inputfile + +telnet $ip <&8 >&7 & + +#tail -f $outputfile & + +sleep 2; echo "reboot" >>$inputfile +sleep 2; echo "logout" >>$inputfile + +rm -fr $inputfile +rm -fr $outputfile + +#ps -ef | grep telnet | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh +#ps -ef | grep tail | grep -v grep | grep -v telnetd | grep $tmptty | grep $tmpname | awk '{print " kill -9", }' | sh diff --git a/wxc2_omc/security/backupRestore/compressFile.php b/wxc2_omc/security/backupRestore/compressFile.php new file mode 100755 index 0000000..82947e0 --- /dev/null +++ b/wxc2_omc/security/backupRestore/compressFile.php @@ -0,0 +1,31 @@ + diff --git a/wxc2_omc/security/backupRestore/csta_list.php b/wxc2_omc/security/backupRestore/csta_list.php new file mode 100755 index 0000000..05752cc --- /dev/null +++ b/wxc2_omc/security/backupRestore/csta_list.php @@ -0,0 +1,205 @@ + + + + CSTA download"; +$blank4 .="    "; + +//select module name from sysInfo. +$selSql = "SELECT sysTypeName FROM sysConf WHERE needCSTA=1 OR needFlow=1 ORDER BY sysTypeNo"; +$selRes = @mysqli_query($pubConn,$selSql); +$num = @mysqli_num_rows($selRes); +for($i=0; $i<$num; $i++){ + $rows = @mysqli_fetch_array($selRes); + $name[$i] = $rows[sysTypeName]; + if($DEBUG){ + echo "name[$i] = {$name[$i]}"; + echo "
      "; + } +} + +/********** FUNCTION START::TREEOLD *************/ +function treeOld($directory,$blank,$sys_name) +{ + $DEBUG=0; + $mydir=@dir($directory); + if(!$mydir){ + echo "

      Error: can't open this directory: \"$directory\" .It's not exist!"; + exit(); + } + $blank .=""; //用一个空白图片表示每层目录间的间隔 + $k=0; + while($file=$mydir->read()){ + if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){ + continue; + }elseif($file =="." || $file ==".."){ + continue; + }else{ + if (strstr($file,"Detail") == NULL) continue; + if (strstr($file,$sys_name) == NULL) continue; + if ($sys_name == "pps" && $file[0]=="o") continue; + if (strstr($file,"csv") == NULL) continue; + if (($sys_name=="msc")AND(strstr($file,"smsc") != NULL)) + continue; + if(substr("$directory/$file",-2) == 'gz'){ + $type_image=""; + }elseif(substr("$directory/$file",-3) == 'csv'){ + $type_image=""; + }else{ + $type_image=""; + } + + //$fileList[$k] ="$blank $type_image $file"; + //target=\"_blank\" + $fileList[$k] ="$blank $type_image $file"; + $k++; + } + + }//end of while + + $mydir->close(); + for($h=0;$h"; + }*/ + + echo ""; + echo $blank4; + echo $blank4; + echo ""; + //echo $strYD['$strDay']; + echo $tbName[$i]; + /* + $tgzName = $directory."/".$strYD['$strDay'].".tgz"; + //echo $tgzName; + if ( true == file_exists($tgzName) ) { + echo "  "; + echo "tgz"; + } + */ + echo ""; + + echo ""; + echo $blank4; + echo $blank4; + echo $blank4; + for($j=0;$j<24;$j++){ + $strHour = date("H",mktime($j,0,0,date("m"),date("j")-$i,date("Y"))); + $strYDH["$strDay"]["$strHour"] = strtolower($sys_name)."Detail_".$strYear."_".$strMon."_".$strDay."_".$strHour; + if($DEBUG){ + echo "strYDH[$strDay][$strHour]="; + echo $strYDH["$strDay"]["$strHour"]; + echo "
      "; + + echo "exsitFlag[$strDay][$strHour]="; + echo $exsitFlag["$strDay"]["$strHour"]; + echo "
      "; + } + if(1==$exsitFlag["$strDay"]["$strHour"]){ + $fileName = $strYDH["$strDay"]["$strHour"].".csv"; + echo "$j "; + }else{ + echo "$j "; + } + } + echo ""; + } + /**** END::define last 7 days hours timestamp ******/ +} +/********** FUNCTION END:: TREE *************/ + +?> + + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); + +/**************** TABLE START:: DISPLAY DETAILS ************************/ +echo ""; +echo "
      "; +$blank=''; + +for($i=0; $i<$num; $i++){ + $tmpSql = " SELECT * FROM elementExistConf WHERE elementName='$name[$i]' AND existFlag='1'"; + if($DEBUG) + echo "
      tmpSql=$tmpSql"; + $tmpRes = mysqli_query($pubConn,$tmpSql); + if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + treeold("../../../db_backup/csta",$blank,strtolower($name[$i])); + } +} + +//just template user can see the follow files +$highest=sizeof($oper_type) - 1; +echo "
      $blank  $name[$i] CSTA
      "; +adjust_content_tail(); +/**************** TABLE END:: DISPLAY DETAILS ************************/ +?> + + diff --git a/wxc2_omc/security/backupRestore/db_zip_list.php b/wxc2_omc/security/backupRestore/db_zip_list.php new file mode 100755 index 0000000..4c08dc3 --- /dev/null +++ b/wxc2_omc/security/backupRestore/db_zip_list.php @@ -0,0 +1,278 @@ + $strCdrDdownload"; +$blank4 .="    "; + +$db = 'OMC_PUB'; +$elementTable='elementExistConf'; + +/********** FUNCTION START::TREEOLD *************/ +function treeOld($directory,$blank,$sys_name) +{ + $DEBUG=0; + global $strDownload,$strDelete; + $dateList=array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0); + $mydir=@dir($directory); + if(!$mydir){ + echo "

      Error: can't open this directory: \"$directory\" .It's not exist!"; + exit(); + } + $blank .=""; //用一个空白图片表示每层目录间的间隔 + $k=0; + while($file=$mydir->read()){ + if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){ + continue; + //echo "$blank  $file\n"; + //tree("$directory/$file",$blank); + }elseif($file =="." || $file ==".."){ + continue; + }else{ + if ($sys_name == 'MSC'){ + if (strstr($file,'SMSC')!=NULL) continue; + } + if (strstr($file,$sys_name) == NULL) continue; + if (strstr($file,"csv") == NULL) continue; + if(substr("$directory/$file",-2) == 'gz'){ + $type_image=""; + }elseif(substr("$directory/$file",-3) == 'csv'){ + $type_image=""; + }else{ + $type_image=""; + } + //$fileList[$k] ="$blank $type_image $file"; + $fileList[$k] ="$blank $type_image $file"; + $k++; + //if($k == sizeof($dateList)) break; + } + + }//end of while + + $mydir->close(); + for($h=0;$h
      Error: can't open this directory: \"$directory\" .It's not exist!"; + exit(); + } + $k=0; + while($file=$mydir->read()){ + if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){ + continue; + }elseif($file =="." || $file ==".."){ + continue; + }else{ + if ($sys_name == 'MSC'){ + if (strstr($file,'SMSC')!=NULL) continue; + } + if (strstr($file,$sys_name) == NULL) continue; + if (strstr($file,"csv") == NULL) continue; + $piecesArray1 = explode(".",$file); + if($piecesArray1[1] != 'csv') continue; + $piecesArray2 = explode("_",$piecesArray1[0]); + $exsitFlag["$piecesArray2[3]"]["$piecesArray2[4]"] = 1; + if($DEBUG){ + echo "exsitFlag[$piecesArray2[3]][$piecesArray2[4]]="; + echo $exsitFlag["$piecesArray2[3]"]["$piecesArray2[4]"]; + echo "
      "; + } + $k++; + } + }//end of while + $mydir->close(); + + /**** START::define last 7 days hours timestamp ******/ + for($i=0;$i<7;$i++){ + $strYear = date("Y",mktime(0,0,0,date("m"),date("j")-$i,date("Y"))); + $strMon = date("m",mktime(0,0,0,date("m"),date("j")-$i,date("Y"))); + $strDay = date("d",mktime(0,0,0,date("m"),date("j")-$i,date("Y"))); + $strYD['$strDay'] = "cdrFrom".$sys_name."_".$strYear."_".$strMon."_".$strDay; + + echo ""; + echo $blank4; + echo $blank4; + echo ""; + echo $strYD['$strDay']; + $tgzName = $directory."/".$strYD['$strDay'].".tgz"; + //echo $tgzName; + if ( true == file_exists($tgzName) ) { + echo "  "; + echo "tgz"; + } + echo ""; + echo ""; + echo $blank4; + echo $blank4; + echo $blank4; + for($j=0;$j<24;$j++){ + $strHour = date("H",mktime($j,0,0,date("m"),date("j")-$i,date("Y"))); + $strYDH["$strDay"]["$strHour"] = "cdrFrom".$sys_name."_".$strYear."_".$strMon."_".$strDay."_".$strHour; + if($DEBUG){ + echo "strYDH[$strDay][$strHour]="; + echo $strYDH["$strDay"]["$strHour"]; + echo "
      "; + + echo "exsitFlag[$strDay][$strHour]="; + echo $exsitFlag["$strDay"]["$strHour"]; + echo "
      "; + } + if(1==$exsitFlag["$strDay"]["$strHour"]){ + $fileName = $strYDH["$strDay"]["$strHour"].".csv"; + //echo "$j "; + echo "$j "; + }else{ + echo "$j "; + } + } + echo ""; + } + /**** END::define last 7 days hours timestamp ******/ +} +/********** FUNCTION END:: TREE *************/ + +function listCDRFile($directory,$sys_name) +{ + $mydir=@dir($directory); + if(!$mydir) + { + echo "

      Error: can't open this directory: \"$directory\" .It's not exist!"; + exit(); + } + + while($file=$mydir->read()) + { + $condition="cdrFrom{$sys_name}_"; + if(strstr($file,$condition)) + { + echo "           "; + echo "$file "; + echo ""; + } + } + $mydir->close(); +} +?> + + + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); + +/**************** TABLE START:: DISPLAY DETAILS ************************/ +echo ""; +echo "
      "; +$blank=''; + +$GenerateCDRFileInterval=getPubVar("GenerateCDRFileInterval"); +if ($thisOmcType == 10){ + $blank=""; + echo "\n"; + if($GenerateCDRFileInterval == 60) + tree("../../../db_backup/cdr",$blank,"SN"); + else + listCDRFile("../../../db_backup/cdr","SN"); +} +else{ +/* //display operation log + $blank=""; + echo "\n"; + treeOld("../../../db_backup/operLog",$blank,"operLog"); + + //display alarm log + $blank=""; + echo "\n"; + treeOld("../../../db_backup/alarmLog",$blank,"alarmLog"); +*/ +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='MSC' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + if($GenerateCDRFileInterval == 60) + tree("../../../db_backup/cdr",$blank,"MSC"); + else + listCDRFile("../../../db_backup/cdr","MSC"); +} + +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='PPS' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + if($GenerateCDRFileInterval == 60) + tree("../../../db_backup/cdr",$blank,"PPS"); + else + listCDRFile("../../../db_backup/cdr","PPS"); +} +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='SMSC' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + if($GenerateCDRFileInterval == 60) + tree("../../../db_backup/cdr",$blank,"SMSC"); + else + listCDRFile("../../../db_backup/cdr","SMSC"); + $blank=""; + echo "\n"; + if($GenerateCDRFileInterval == 60) + tree("../../../db_backup/cdr",$blank,"SMLOG"); + else + listCDRFile("../../../db_backup/cdr","SMLOG"); +} +} +//just template user can see the follow files +$highest=sizeof($oper_type) - 1; +echo "
      $blank  SN CDR
      $blank  Operation log
      $blank  Alarm log
      $blank  MSC CDR
      $blank  PPS CDR
      $blank  SMSC CDR
      $blank  SMLOG
      "; +adjust_content_tail(); +/**************** TABLE END:: DISPLAY DETAILS ************************/ +?> + + diff --git a/wxc2_omc/security/backupRestore/del_file.php b/wxc2_omc/security/backupRestore/del_file.php new file mode 100755 index 0000000..dd81dfc --- /dev/null +++ b/wxc2_omc/security/backupRestore/del_file.php @@ -0,0 +1,54 @@ +del_target=$del_target"; +if($sure_del){ + $result = unlink($del_target); + if($result > 0){ + //------插入日志------ + $log_name = $user_info["account"]." delete file ".$del_target." successful"; + insertLog("$log_name"); + echo " "; + }else{ + //------插入日志------ + $log_name = $user_info["account"]." delete file ".$del_target." fail"; + insertLog("log_name"); + echo ""; + } +}elseif($no_del){ + echo " "; +}else{ + echo "
      "; + echo "
      "; + echo "$strAreYouSureToDelete $del_target?"; + echo "
      "; + echo ""; + echo ""; + echo "
      "; +} +?> \ No newline at end of file diff --git a/wxc2_omc/security/backupRestore/doDownload.php b/wxc2_omc/security/backupRestore/doDownload.php new file mode 100755 index 0000000..1a15009 --- /dev/null +++ b/wxc2_omc/security/backupRestore/doDownload.php @@ -0,0 +1,88 @@ + + + 322,), + array('typeNo' => 325,), + array('typeNo' => 330,), + array('typeNo' => 340,), + array('typeNo' => 350,), + array('typeNo' => 360,), + array('typeNo' => 370,), + array('typeNo' => 380,), + + array('typeNo' => 111), + array('typeNo' => 222), + array('typeNo' => 223) +); +for($i=0; $i'2', 'sysid'=> $sysId, 'selectsysid'=>'-1')//MSC +// ); +// //GetParam($oidsysarr,0,0,0); + echo "OK"; +} +if($flag=="createTable") +{ + //getTableFile($curSys); + echo "OK"; +} +//echo "deal with $sysTemNo"; + +?> diff --git a/wxc2_omc/security/backupRestore/downAndUploadAll.php b/wxc2_omc/security/backupRestore/downAndUploadAll.php new file mode 100755 index 0000000..fe3129a --- /dev/null +++ b/wxc2_omc/security/backupRestore/downAndUploadAll.php @@ -0,0 +1,162 @@ + $strBackupRestore > "."Download&Upload"; +$DEBUG = 0; +$pubDb=$omc_db; +?> + + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +$serverip = getenv("HTTP_HOST"); +$download=$_REQUEST['download']; +if( $serverip == "" ){ + $serverip = getenv("SERVER_ADDR"); +} +$downLinkStr = ''; +$tgzName = "allBackup.tgz"; +$downurl = "http://$serverip/db_backup/archive/tgzFile/$tgzName"; +$downFileName = "/usr/local/apache/htdocs/db_backup/archive/tgzFile/$tgzName"; +if (file_exists($downFileName)) +{ + $lastModifiedTime = date("Y-m-d H:i:s", filemtime($downFileName)); + $downLinkStr = "Download tgz File [$lastModifiedTime]"; +} + +?> +"; + echo ""; + echo ""; + echo "Download"; + echo ""; + echo ""; + echo "Upload"; + echo ""; + echo ""; +?> + 325, 'name' => 'VLR'); + } + $name = $exitRows[elementName]; + $allSysArr[] = array('typeNo' => $typeNo, 'name' => $name); +} + +for($i=0; $i$pubDb,$selSql"; +// $allSysArr[$i][name] = $Rows[name]; + $allSysArr[$i][ip] = $Rows[ip]; +} + +if($download==1) +{ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + for($i=0; $i"; + echo ""; + echo ""; + echo ""; + } + echo ""; + echo ""; + echo ""; + echo "
      System Summary
      System NameIp Address
      {$allSysArr[$i][name]}$ip
      Create Tgz File"; + echo "$downLinkStr
      "; +}//end download + +if($upload==1) +{ +?> +
      +
      " enctype="multipart/form-data"> + +File to upload: + + + +
      + + +"; + +?> + + diff --git a/wxc2_omc/security/backupRestore/download.html b/wxc2_omc/security/backupRestore/download.html new file mode 100755 index 0000000..77b97e3 --- /dev/null +++ b/wxc2_omc/security/backupRestore/download.html @@ -0,0 +1,4 @@ + +download +downloading template....... + diff --git a/wxc2_omc/security/backupRestore/downloadFile.php b/wxc2_omc/security/backupRestore/downloadFile.php new file mode 100755 index 0000000..007e77a --- /dev/null +++ b/wxc2_omc/security/backupRestore/downloadFile.php @@ -0,0 +1,674 @@ + + + + $strBackupRestore > "."Download&Upload"; +$DEBUG = 0; +$pubDb = "OMC_PUB"; +set_time_limit(3600); +$strNoInput = "No file input!"; + +function MsgBox($str) +{ + echo ""; +}//end MsgBox + +function createParamCVS($path,$tbNameArr) +{ + $pubDb = "OMC_PUB"; + global $pubConn; + for($i=0; $i(isFinish != 0) || (waitTime >= maxWaitTime) || (stopTime > maxStopTime)"; + while(1) { + echo ""; + flush(); + //echo "
      ($isFinish != 0) || ($waitTime >= $maxWaitTime) || ($stopTime > $maxStopTime)"; + if(($isFinish != 0) || ($waitTime >= $maxWaitTime) || ($stopTime > $maxStopTime)){ + if($commId >= $maxOfCommId){ //初始化命令表 + //先删除表 + $dropSql = "DROP TABLE $commTable "; + mysqli_query($pubConn,$dropSql); + //再建一个结构相同的新表 + $createSql="CREATE TABLE subscriberComm ( + commId smallint(5) unsigned NOT NULL auto_increment, + commType tinyint(1) DEFAULT '0' NOT NULL, + dataTypeNo tinyint(4) DEFAULT '0' NOT NULL, + sysTypeNo smallint(5) unsigned DEFAULT '0' NOT NULL, + sysNo smallint(5) unsigned DEFAULT '0' NOT NULL, + subSysNo smallint(5) unsigned DEFAULT '0' NOT NULL, + indexValueList varchar(255) NOT NULL, + fieldNameList tinytext NOT NULL, + paramType tinyint(4) DEFAULT '0' NOT NULL, + commState tinyint(3) unsigned DEFAULT '0' NOT NULL, + totalNum smallint(5) unsigned DEFAULT '0' NOT NULL, + finishNum smallint(5) unsigned DEFAULT '0' NOT NULL, + sendTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + bgnTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + endTime datetime DEFAULT '0000-00-00 00:00:00' NOT NULL, + remark varchar(200) binary NOT NULL, + PRIMARY KEY (commId), + KEY sysTypeNo (sysTypeNo), + KEY sysNo (sysNo), + KEY subSysNo (subSysNo), + KEY bufferKey (indexValueList) + ) + "; + mysqli_query($pubConn,$createSql); + }else{ + //删除命令表的相关命令 + $commArr = explode('-',$commIdStr); + for($i=0;$ideleteSql = $deleteSql"; + mysqli_query($pubConn,$deleteSql); + echo mysqli_error($pubConn); + } + } + + // 重定向返回指定页 + if($isFinish != 0){ + if($isFinish > 0){ + echo "Finished!!"; + if($commType == $nLoadIndexComm){ + sleep(8);//等8秒,这样数据库插入才能完全完成 + } + return 1; + }elseif($isFinish == -1){ + echo "Failed in some system!!"; + flush(); + return 0; + }else{ + echo "Failed!!"; + flush(); + return 0; + } + }elseif($usedTime >= $maxOverTime && $stopTime == 1){ + echo "Stoped!!"; + flush(); + return 0; + }else{ //$usedTime >= $maxOverTime + echo "Timeout!!"; + flush(); + return 0; + } + }//end of if($isFinish....) + + //显示命令执行状态 + //----------------------------- + $okNum = 0; + $failNum = 0; + $commNum = 0; + $commArr = explode('-',$commIdStr); + $thisTimeFinishNumStr = ''; + $lastTimeFinishNumArr = explode('-',$lastTimeFinishNumStr); + for($i=0;$iget command = $commSql"; + $commResult = mysqli_query($pubConn,$commSql); + if(mysqli_num_rows($commResult) <= 0){ + echo "
      Can not find this command's info in datebase"; + exit(); + } + $commRows = @mysqli_fetch_array($commResult); + $sysTypeNo = $commRows[sysTypeNo]; + $sysNo = $commRows[sysNo]; + $subSysNo = $commRows[subSysNo]; + $commType = $commRows[commType]; + $paramType = $commRows[paramType]; + $objId = $commRows[objId]; + $commState = $commRows[commState]; + $indexValueList = $commRows[indexValueList]; + $fieldNameList = $commRows[fieldNameList]; + $remark = $commRows[remark]; + + switch($commState){ + case 0: //process failed + $failNum++; + echo " $commRows[remark] "; + flush(); + return 0; + //break; + case 1: //wait process + $waitTime++; + break; + case 2: //in process + $waitTime = 0; + //只要有一个命令的完成数在增长,就认为该组命令在运行,否则认为命令处理超时 + if($DEBUG) echo "====> {$commRows[finishNum]} > {$lastTimeFinishNumArr[$i]}"; + if($commRows[finishNum] > $lastTimeFinishNumArr[$i]){ + $stopTime = 0; + }else{ + $stopTime++; + } + $thisTimeFinishNumStr .=$commRows[finishNum].'-'; + break; + case 3: //process finished + $okNum++; + break; + default: + echo "Unknown Command State"; + flush(); + exit(); + } + }//end of for($i=0;$i$commNum =?= $finishNum"; + if($commNum == $okNum){ + $isFinish = 1; + }elseif($failNum > 0 && $okNum > 0){ + $isFinish = -1; + }elseif($commNum == $failNum){ + $isFinish = -2; + }else{ + $isFinish = 0; + } + + if($DEBUG) echo"
      lastTimeFinishNumStr=$lastTimeFinishNumStr"; + if($DEBUG) echo"
      thisTimeFinishNumStr=$thisTimeFinishNumStr"; + $lastTimeFinishNumStr = $thisTimeFinishNumStr; + //刷新返回 + //-------------- + $usedTime++; //总时间 + sleep(5); + }//end while +} +function createSubsCVS($path,$subsTlbName,$sysId) +{ + $pubDb = "OMC_PUB"; + $filePath = $path . "$subsTlbName.$sysId.csv"; + if (is_file($filePath)) + unlink($filePath); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '{$filePath}' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $subsTlbName limit 0,5000 + "; + //echo "
      csvFileUpdateSql= $csvFileUpdateSql"; + $csvFileUpdateResult = mysqli_query($pubConn ,$csvFileUpdateSql); + echo mysqli_error($pubConn); +}//end createSubsCVS + +function getBssIp (&$bssIpArr) +{ + $bssDb = "BssOmcDb"; + $bssTable = "OMCR_BSSTABLE"; + $selSql = "select ip,bssid from $bssTable"; + $bssResult = mysqli_query($pubConn,$selSql); + while($bssRow = mysqli_fetch_array($bssResult)) + { + $ip = $bssRow[ip]; + if(strlen($ip)< 7) continue; + $bssIpArr[] = $ip; + } +}//end getBssIp + +function getBssDb($bssDbPath,$bssIpAddr) +{ + $fileArr = array('abis.db', 'bscadmin.db', 'calltrc.db', 'sysmon.db', + 'aifadmin.db', 'BssGb.db', 'frmgr.db', 'trkadmin.db'); + $remoteDir = "/hd0/iw07_00.010/compile/cfg/"; + $ftpCon=@ftp_connect($bssIpAddr); + if($ftpCon < 0){ + echo "BSS's ip is error or connect $bssIpAddr Failed!"; + flush(); + return 0; + } + if(!@ftp_login($ftpCon,'','')){ + echo "BSS's ip is error or login $bssIpAddr Failed!"; + @ftp_close($ftpCon); + flush(); + return 0; + } + if(!@ftp_chdir($ftpCon, $remoteDir)){ + echo "Change dir error!"; + @ftp_close($ftpCon); + flush(); + return 0; + } + $localDir = $bssDbPath . $bssIpAddr . '/'; + mkdir($localDir, 0777); + for($i=0; $i< sizeof($fileArr); $i++) { + $file = $fileArr[$i]; + $remoteFile=$remoteDir.$file; + $localFile=$localDir.$file; + if (!@ftp_get($ftpCon, $localFile, $remoteFile, FTP_BINARY)) { + flush(); + echo "Get file error!"; + @ftp_close($ftpCon); + return 0; + } + }//end for + + @ftp_close($ftpCon); + return 1; +}//end get BssDb +?> + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> + + 111, 'name' => 'PLAT'), + array('typeNo' => 222, 'name' => 'PLAT'), + array('typeNo' => 223, 'name' => 'PLAT'), + array('typeNo' => 225, 'name' => 'PLAT') + ); + + $selSql = " select * from OMC_PUB.elementExistConf where existFlag=1 and elementTypeNo!=0 order by elementNo"; + $exitRes = mysqli_query($pubConn,$selSql); + while($exitRows = mysqli_fetch_array($exitRes)) + { + $typeNo = $exitRows[elementTypeNo]; + if($typeNo==320) + { + $typeNo=322; + $tmpAllSysArr[] = array('typeNo' => 325, 'name' => 'VLR'); + } + $name = $exitRows[elementName]; + $tmpAllSysArr[] = array('typeNo' => $typeNo, 'name' => $name); + } + for($i=0; $i 200 && $sysNo==0) continue; + + $sysId = $curSys."_".$sysNo."_99"; + $slcsysId=-1; + $tlbNo = $sysNo; + if($curSys==222 || $curSys==223) { + if(($sysNo==8 || $sysNo==11)) { + $sysId = $curSys . '_' . $sysNo . '_' . $subSysNo; + } + else if($sysNo==9) { + $sysId = $curSys . '_99_99'; + $slcsysId = $curSys . '_' . $sysNo . '_' . $subSysNo; + $tlbNo = 99; + } + } + if($curSys==111) + { + $slcsysId = $curSys."_".$sysNo."_".$subSysNo; + } + $oidsysArr[]= array('oid'=>'2', 'sysid'=> $sysId, 'selectsysid'=> $slcsysId); + if($sysNo != $lastSysNo) + $tbNameArr[] = "OBJ_".$curSys.".param_".$tlbNo; + $lastSysNo=$sysNo; + } + } + if($curSys > 300 || $curSys==225) + { + $slcsysId = -1; + $sysId = $curSys."_99_99"; + $oidsysArr[]= array('oid'=>'2', 'sysid'=> $sysId, 'selectsysid'=> $slcsysId); + $tbNameArr[] = "OBJ_".$curSys.".param_99"; + } + $allSysArr[$j] = $tmpAllSysArr[$i]; + $allSysArr[$j][oidsysArr]=$oidsysArr; + $allSysArr[$j][tbNameArr]=$tbNameArr; + $j++; + unset($oidsysArr); + unset($tbNameArr); + } +}//end get allSysArr. + +{//get subsDbArr. + $tmpdbArr = array( + array('typeNo' => '330'), //HLR + //array('typeNo' => '325'), //VLR + //array('typeNo' => '360'), //PPS + array('typeNo' => '340'), //AUC + //array('typeNo' => '380'), //EIR + array('typeNo' => '370'), //MNP + array('typeNo' => '390')//must be the last one. + ); + for($i=0; $i< sizeof($tmpdbArr); $i++) + { + $tmpTypeNo = $tmpdbArr[$i][typeNo]; + if($tmpTypeNo==325)$tmpTypeNo=320; + $selSql = " select * from OMC_PUB.elementExistConf where existFlag=1 and elementTypeNo=$tmpTypeNo"; + $exitRes = mysqli_query($pubConn,$selSql); + if($exitRow=mysqli_fetch_array($exitRes)) + { + $tmpsubsDbArr[] = $tmpdbArr[$i]; + } + } + for($i=0; $i 0){ + if($sysTypeNo==390){ + $j=$i; + while($infoRows = mysqli_fetch_array($infoResult)) + { + $sysNo = $infoRows[sysNo]; + $subSysNo = $infoRows[subSysNo]; + $sysId = $sysTypeNo.'_'.$sysNo.'_'.$subSysNo; + $subsTlb = "VMS_DB.subscriberData_" . $sysNo; + $subsDbArr[$j][typeNo] = $sysTypeNo; + $subsDbArr[$j][sysId] = $sysId; + $subsDbArr[$j][name] = 'VMS'; + $subsDbArr[$j][subsTlb] = $subsTlb; + $j++; + } + } else { + $sysSubsConfTable ='OMC_PUB.sysSubsConf'; + $systemConfTable = 'OMC_PUB.sysConf'; + $getConfSql="SELECT sysTypeName,dataTypeNo,indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable,$systemConfTable + WHERE $sysSubsConfTable.sysTypeNo='$sysTypeNo' + AND $systemConfTable.sysTypeNo='$sysTypeNo' + AND $sysSubsConfTable.dataTypeNo='$dataTypeNo' + "; + $getConfResult=mysqli_query($pubConn,$getConfSql); + echo mysqli_error($pubConn); + $getConfRows=mysqli_fetch_array($getConfResult); + $sysTypeName =$getConfRows[sysTypeName]; + //$indexFieldName =$getConfRows[indexFieldName]; + $subsTlb =$getConfRows[subsDataTable]; + //$tmpDataTable =$getConfRows[tmpDataTable]; + + $infoRows = mysqli_fetch_array($infoResult); + + $sysNo = $infoRows[sysNo]; + $subSysNo = $infoRows[subSysNo]; + $sysId = $sysTypeNo.'_'.$sysNo.'_'.$subSysNo; + + $subsDbArr[$i][typeNo] = $sysTypeNo; + $subsDbArr[$i][sysId] = $sysId; + $subsDbArr[$i][name] = $sysTypeName; + $subsDbArr[$i][subsTlb] = $subsTlb; + } + } + + } +}//end get subsDbArr. + +if(1)//get parameters from devices +{ + echo "
      Getting parameter data from devices ...
      "; + flush(); + for($i=0; $i    [ $sysName ]  "; + flush(); + } + GetParam($oidsysArr,0,0); + $oldName = $sysName; + } +}//end get parameters from devices + +if(file_exists($archivePath)) + exec("rm -rf $archivePath"); + +if(1)//create parameters' cvs files +{ + echo "
      "; + echo "
      Creating parameter tables ...
      "; + exec("mkdir $paremerPath -p"); + exec("chmod -R 777 $paremerPath"); + for($i=0; $i    [ $sysName ]  ...  "; + flush(); + } + $tbNameArr = $allSysArr[$i][tbNameArr]; + createParamCVS($paremerPath,$tbNameArr); + if($sysName !== $oldName) { + echo "Finished."; + flush(); + } + $oldName = $sysName; + } +}//end create parameters' cvs files + +if(1) //get Subscriber data from devices +{ + echo "
      "; + echo "
      Getting subscribers data from devices ...
      "; + flush(); + for($i=0; $i    [ $sysName ]  "; + flush(); + } + getSubsData($sysId,$dataTypeNo); + $oldName = $sysName; + } +}//end get subscriber data from devices. +//exit; +if(1)//create subscribers' cvs files +{ + exec("mkdir $subsPath -p"); + exec("chmod -R 777 $subsPath"); + echo "
      Creating subscriber tables ...
      "; + for($i=0; $i< sizeof($subsDbArr); $i++) + { + $subsTlbName = $subsDbArr[$i][subsTlb]; + $sysId = $subsDbArr[$i][sysId]; + $sysName = $subsDbArr[$i][name]; + if($sysName !== $oldName) { + echo "
          [ $sysName ]  ...  "; + flush(); + } + + createSubsCVS($subsPath,$subsTlbName,$sysId); + if($sysName !== $oldName) { + echo "Finished."; + flush(); + } + $oldName = $sysName; + }//end subscribers table. +}//end create subscribers cvs files. + +$selSql = " select * from OMC_PUB.elementExistConf where existFlag=1 and elementTypeNo=500"; +$exitRes = mysqli_query($pubConn,$selSql); +if($exitRows = mysqli_fetch_array($exitRes))//get bss data +{ + echo "
      "; + echo "
      Getting BSS data ...
      "; + flush(); + + exec("mkdir $bssOmcTlbPath -p"); + exec("chmod -R 777 $bssOmcTlbPath"); + $tbNameArr = array('BssOmcDb.OMCR_BSSTABLE'); + echo "
          Creating parameter tables ... "; + createParamCVS($bssOmcTlbPath,$tbNameArr); + echo "Finished."; + + //get bss db. + exec("mkdir $bssDbPath -p"); + exec("chmod -R 777 $bssDbPath"); + chdir($bssDbPath); + getBssIp ($bssIpArr); + for($i=0; $i    Getting $bssIpArr[$i] dbs ... "; + flush(); + if(getBssDb($bssDbPath,$bssIpArr[$i])){ + echo "Finished."; + flush(); + } + } +}//end get bss database. + +if(1)//compress files +{ + echo "
      "; + echo "
      Compressing files ...
      "; + flush(); + + if (is_dir($tgzPath)) + { + exec("rm -rf $tgzPath"); + } + chdir($archivePath); + exec("tar zcvf $tgzName *"); + + exec("mkdir $tgzPath -p"); + exec("chmod -R 777 $tgzPath"); + + exec("mv $tgzName $tgzPath"); + exec("rm -rf $subsDir $paramDir $bssDir"); + echo "Finished."; + flush(); +}//end compress files. + +//exit; +echo ""; +?> + + diff --git a/wxc2_omc/security/backupRestore/load_csv_list.php b/wxc2_omc/security/backupRestore/load_csv_list.php new file mode 100755 index 0000000..e08627b --- /dev/null +++ b/wxc2_omc/security/backupRestore/load_csv_list.php @@ -0,0 +1,301 @@ + $strBackupRestore > "."${$data_type}"; +$DEBUG = 0; +$db=$omc_db; +?> + + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); +?> +
        + +"; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      $strCSVDataFile $strLastDownloadTime $strDownload $strLastUploadTime $strUpload
      "; +echo ""; +echo ""; + +/************************从数据库取出菜单结构的数据,并按顺序导入到数组中**************************/ + +//----------------------选择语言版本---------------------- +if($selectedLanguage == 'eng'){ + $show_menu_name=menu_name_2; //语种2 +}elseif($selectedLanguage == 'chn'){ + $show_menu_name=menu_name; //语种1 +} + +$level_num=4; +$menu_list = "level_0,level_1,level_2,level_3"; +if ($DEBUG) echo "
      sel_name=$sel_name
      "; +if ($sel_name == "network"){ + $sel_db_name = "'%OBJ%'"; + $where = "WHERE db_name LIKE $sel_db_name AND table_name LIKE 'param\_%' AND if_enable=1 "; +}elseif($sel_name == "account"){ + $sel_db_name = "('HLR_DB','VLR_DB','PPS_DB','AUC_DB','EIR_DB','VMS_DB','MNP_DB','OPR_DB','iPALIM_DB')"; + $exclude_db_name = "('CSTA_DB')"; + $table_name = "('daily_report')"; + $where = "WHERE db_name IN $sel_db_name AND table_name NOT IN $table_name AND if_enable=1 "; +}elseif ($sel_name == "performance"){ + //$sel_db_name = "('CSTA_DB')"; + $exclude_db_name = "''"; + $table_name = "('daily_report','sysOperLog','sysAlarmLog')"; + //$where = "WHERE db_name IN $sel_db_name OR table_name IN $table_name"; + $where = "WHERE table_name IN $table_name AND if_enable=1 "; +}elseif ($sel_name == "define"){ + $sel_db_name = "'%OBJ%'"; + $where = "WHERE (db_name LIKE $sel_db_name AND if_enable=1 AND(table_name LIKE 'paramC%' OR table_name LIKE 'subsParamConf%' OR table_name LIKE 'logAttrDef%')) OR (table_name LIKE 'sysInfo') OR (table_name LIKE 'sysMenuConf')"; +} +else + $where = "where(1)"; +/* +elseif ($sel_name == "cdr"){ + $sel_db_name = "'%CDR%'"; + $where = "WHERE db_name LIKE $sel_db_name"; +} +*/ +//AND if_enable!='0' +$menu_sql = "SELECT * FROM $syscsvconf_table $where ORDER BY ".$menu_list; +//echo "
      menu_sql=$menu_sql
      "; +$menu_result = @mysqli_query($pubConn,$menu_sql); +$menu_rows = @mysqli_fetch_array($menu_result); +echo mysqli_error($pubConn); +$n=0; +do{ + //从第i层开始划分层次,第i层之前不参与显示算法 + for($i=0; $i < $level_num; $i++){ + $menu_num = 'level_'.$i; + $menu_arr[$n][$i]=$menu_rows[$menu_num]; + } + $menu_arr[$n][show_name] =$menu_rows[$show_menu_name]; + $menu_arr[$n][can_download] =$menu_rows[can_download]; + $menu_arr[$n][can_upload] =$menu_rows[can_upload]; + $menu_arr[$n][last_download]=$menu_rows[last_download]; + $menu_arr[$n][last_upload] =$menu_rows[last_upload]; + $menu_arr[$n][key_menu_id] =$menu_rows[key_menu_id]; + $menu_arr[$n][db_name] =$menu_rows[db_name]; + $menu_arr[$n][table_name] =$menu_rows[table_name]; + //echo "
      {$menu_arr[$n][show_name]}"; + //echo "$show_menu_name
      "; + //echo "n = $n, db_name = $menu_arr[$n][6] , table name = $menu_rows[table_name]
      "; + if((($menu_arr[$n][table_name]=='sysOperLog')||($menu_arr[$n][table_name]=='sysAlarmLog'))&&($menu_arr[$n][can_download]=='1')){ + $tmpMenuArr=explode('_',$menu_arr[$n][show_name]); + $day=date("m-d",mktime(0,0,0,date("m"),date("d")-($tmpMenuArr[1]),date("Y"))); + $menu_arr[$n][show_name]=$tmpMenuArr[0].'_'.$day; + } + $n++; +}while($menu_rows = mysqli_fetch_array($menu_result)); +//exit(); +/*************************************下面是顺序显示菜单程序***************************************/ + + for($i=0 ; $i < sizeof($menu_arr); $i++) //从上到下 ---> 级 + { + $show_name = $menu_arr[$i][show_name]; + $can_download =$menu_arr[$i][can_download]; + $can_upload =$menu_arr[$i][can_upload]; + $key_menu_id=$menu_arr[$i][key_menu_id]; + $db_name = $menu_arr[$i][db_name]; + $table_name = $menu_arr[$i][table_name]; + $show_value = "key_menu_id=$key_menu_id"; + + $show = " $show_name"; + $show_1 = "\n$show"; + $show_2 = "\n $show"; + $show_4 = "\n $show"; + $show_3 = "\n"; + $show_5 = "\n"; + //$bgcolor=$i%2?'#ffffff':'#f4f4f4'; + $bgcolor=''; + echo""; + + if($can_download > 0){ + echo ""; + echo ""; + }else{ + echo ""; + echo ""; + } + + if($can_upload > 0){ + echo ""; + //echo "db_name=$db_name,tabel_name=$table_name
      "; + if (($db_name == 'HLR_DB')&&($table_name=='subscriberData')){ + echo ""; + } + elseif (($db_name == 'VLR_DB')&&($table_name=='subscriberData')){ + echo ""; + } + elseif (($db_name == 'PPS_DB')&&($table_name=='user_info')){ + echo ""; + } + elseif (($db_name == 'AUC_DB')&&($table_name=='AUC_Dyn_data')){ + echo ""; + } + elseif (($db_name == 'EIR_DB')&&($table_name=='BlackGrayIMEI')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_0')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_1')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_2')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_3')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_4')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_5')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_6')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_7')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_8')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_9')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_10')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_11')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_12')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_13')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_14')){ + echo ""; + } + elseif (($db_name == 'VMS_DB')&&($table_name=='subscriberData_15')){ + echo ""; + } + elseif ($db_name == 'SN_DB'){ + echo ""; + } + elseif (($db_name == 'MNP_DB')&&($table_name=='subscriberData')){ + echo ""; + } + else{ + echo ""; + } + }else{ + echo ""; + echo ""; + } + echo ""; +} //end for($i=0 ; $i < $n ; $i++) + +?> +
      "; + echo ""; + for($j=0;$j < $level_num;$j++) //从左到右 ---> 层 + { + if($menu_arr[$i][$j] > 0) //如果该节点大于零 + { + if($menu_arr[$i+1][$j] > $menu_arr[$i][$j] ) //如果下面有树枝或页子与本节点(树枝或叶子)相连,即下面有兄弟节点 + { + if($menu_arr[$i][$j+1] > 0) //如果是树枝 + { + echo "$show_3"; //show_3 + } + else //叶子 + { + echo "$show_2"; //show_2 + } + } + else //如果下面的节点号不大于本节点号 + { + if($menu_arr[$i][$j+1] > 0) //如果本节点不是叶子 + { + $is_line =0; //标志位,用于标志同一树枝下面是否还有分支,或是直接连在本枝上的叶子。 + for($p=$i+1;$p < sizeof($menu_arr) && $menu_arr[$p][$j-1] == $menu_arr[$i][$j-1];$p++) //顺着上一层目录,向下查找 + { + if($menu_arr[$p][$j] > $menu_arr[$i][$j]) //找到了!!! + { + $is_line = 1; + break; + } + } + + if($is_line == 1) //下面还有分支,或是直接连在本枝上的叶子 + { + echo "$show_3"; //show_3 + } + else //同一树枝下没有分支,或是连在本枝上的叶子 + { + echo "$show_5"; //show_5 + } + + } + else //本节点是叶子 + { + if($menu_arr[$i+1][$j+1] > 0 ) //本节点有分叉,即有起点在本节点的子树 + { + echo "$show_1"; //show_1 + } + else //本节点是该树枝上最末一片页子 + { + echo "$show_4"; //show_4 + } + } + } //end else of if($menu_arr[$i+1][$j] > $menu_arr[$i][$j] ) + } //end if($menu_arr[$i][$j] > 0) + } //end for($j=0;$j < $level_num;$j++) + echo " {$menu_arr[$i][last_download]}$strDownload --- --- {$menu_arr[$i][last_upload]} $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload $strUpload --- ---
      + + + diff --git a/wxc2_omc/security/backupRestore/load_in_csv.php b/wxc2_omc/security/backupRestore/load_in_csv.php new file mode 100755 index 0000000..1140c06 --- /dev/null +++ b/wxc2_omc/security/backupRestore/load_in_csv.php @@ -0,0 +1,410 @@ +sel_name = $sel_name
      "; +/* +LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE] + INTO TABLE tbl_name + [FIELDS + [TERMINATED BY '\t'] + [OPTIONALLY] ENCLOSED BY ''] + [ESCAPED BY '\\' ]] + [LINES TERMINATED BY '\n'] + [IGNORE number LINES] + [(col_name,...)] + +例: +LOAD DATA LOCAL INFILE '/tmp/phpBGhA33' +INTO TABLE OMC_Def_test +FIELDS + TERMINATED BY ',' + ENCLOSED BY '\"' + ESCAPED BY '\\'(可省略) +LINES + TERMINATED BY '\n' +IGNORE 1 LINES +*/ + + +$remark_style=array( + 'sign' =>'#', + 'fields_by' =>',', + 'lines_by' =>'\n', + 'fields_seek' =>'1' + ); + +$data_style=array( + 'fields_by' =>',', + 'enclosed_by'=>'\"', + 'escaped_by' =>'\\', + 'lines_by' =>'\n', + 'ignore_lines' =>'0', + 'mode' =>'REPLACE' + ); +echo "test
      "; +//get load out information +$info_sql = "SELECT * FROM $syscsvconf_table WHERE key_menu_id='$key_menu_id'"; +if($DEBUG) echo "
      info_sql = $info_sql";//调试用 +$result = mysqli_query($pubConn,$info_sql); +$info_rows = mysqli_fetch_array($result); +$server_name = $info_rows[server_name]; +$db_name = $info_rows[db_name]; +$table_name = $info_rows[table_name]; +$where_find = $info_rows[where_find]; +$sys_id = $info_rows[sys_id]; +$obj_id = $info_rows[obj_id]; +$if_enable = $info_rows[if_enable]; +$if_enable =0; +$if_subsys = $info_rows[if_subsys]; +$menu_name = $info_rows[menu_name]; +$menu_name_2 = $info_rows[menu_name_2]; +$log_name = "Upload--"."'$server_name' '$db_name' '$table_name'"; +/* +$sel_field_list= mysql_list_fields($db_name,$table_name); +$sel_field_num = mysql_num_fields($sel_field_list); +if($DEBUG) echo "
      sel_field_num=$sel_field_num"; +for($i=0;$i<$sel_field_num;$i++){ + $sel_field_name = mysql_field_name($sel_field_list, $i); + if($sel_field_name=='mflag'){ + $if_enable=1; + break; + } +} +*/ + +if($DEBUG) echo "
      if_enable=$if_enable"; + +if($DEBUG) echo "
      if_subsys=$if_subsys"; +if($if_subsys>0){ + $subsys_num = omc_sys_id_info($sys_id,subsys_num); + echo "
      subsys_num=$subsys_num"; +} +$load_file_info=array( + 'name' =>$textfile, + 'server'=>$server_name, + 'db' =>$db_name, + 'table' =>$table_name + ); + +if(isset($textfile) && $textfile != "none"){ + if($DEBUG) echo "
      LOAD DATA file -> $textfile
      "; + if (($table_name == 'paramConf') ||($table_name == 'subsParamConf_0')||($table_name == 'subsParamConf_1')||($table_name == 'logAttrDef_0')||($table_name == 'logAttrDef_1')){ + $del_sql = "DELETE FROM $table_name"; + if($DEBUG) echo "
      del_sql = $del_sql"; + $del_result = mysqli_query($pubConn,$del_sql); + if($DEBUG) echo "
      del_result=$del_result"; + + $insert_sql = "LOAD DATA LOCAL INFILE '$textfile' + INTO TABLE $table_name + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + "; + if($DEBUG) echo "
      insert_sql=$insert_sql"; + $insert_result=mysqli_query($pubConn,$insert_sql); + $log_name="UPLOAD $db_name-$table_name"; + if($DEBUG) echo "
      insert_result=$insert_result"; + if ($insert_result){ + $log_name=$log_name." successful."; + $update_sql="UPDATE $syscsvconf_table SET last_upload = CURRENT_TIMESTAMP WHERE key_menu_id='$key_menu_id'"; + mysqli_query($pubConn,$update_sql); + } + else + $log_name=$log_name." fail."; + insertLog("$log_name"); + } + //elseif (omc_chk_load_in($load_file_info,$remark_style) > 0){ + else{ + //empty existed table + if($DEBUG) $drop_sql="DROP TABLE IF EXISTS load_temp"; + $drop_result=mysqli_query($pubConn,$drop_sql); + + $create_sql="CREATE TABLE IF NOT EXISTS load_temp SELECT * FROM $table_name LIMIT 0,0"; + if($DEBUG) echo "
      create_sql=$create_sql"; + $create_result=mysqli_query($pubConn,$create_sql); + + //如果建表成功,把文件数据导入临时表 + if($create_result>0){ + $load_sql="LOAD DATA LOCAL INFILE '$textfile' $data_style[mode] + INTO TABLE load_temp + FIELDS + TERMINATED BY '$data_style[fields_by]' + ENCLOSED BY '$data_style[enclosed_by]' + LINES + TERMINATED BY '$data_style[lines_by]' + IGNORE $data_style[ignore_lines] LINES + "; + if($DEBUG) echo "
      load_sql=$load_sql"; + if(0) + { + $link = mysqli_init(); + mysqli_options($link, MYSQLI_OPT_LOCAL_INFILE, true); + mysqli_real_connect($link, 'localhost', root, rootaa, PPS_DB); + $load_result=mysqli_query($load_sql); + } + if(1) + { + $hostname="localhost"; + $username="root"; + $password="rootaa"; + $db = mysql_connect($hostname, $username, $password, false, 128); // 128 enables LOCAL INFILE + mysql_select_db($db_name, $db); + + $load_result = mysql_query($load_sql,$db) or + die("Invalid query: $load_sql\n" . mysqli_error($pubConn)); + } + else + { + $load_result=mysqli_query($pubConn,$load_sql); + } + + //$load_result=mysqli_query($pubConn,$load_sql); + if($DEBUG) echo "load_resul[$load_result]
      "; + if(0) + { + echo mysqli_error($pubConn); + echo "load_sql[$load_sql] load_resul[$load_result]
      "; + exit(); + } + //如果导入成功,把临时表作相应改变 + if($load_result > 0){ + //删除空记录 + $sel_field_list= mysql_list_fields($db_name,$table_name); + $sel_field_num = mysql_num_fields($sel_field_list); + $sel_all_field=''; + for($i=0;$i<$sel_field_num;$i++){ + $sel_field_name = mysql_field_name($sel_field_list, $i); + if($i==$sel_field_num-1) + { + $sel_all_field.=$sel_field_name."=''"; + } + else + { + $sel_all_field.=$sel_field_name."='' AND "; + } + } + $del_sql = " DELETE FROM load_temp WHERE ".$sel_all_field; + if ($DEBUG) echo "
      del_sql=$del_sql"; + $del_result = mysqli_query($pubConn,$del_sql); + + //如果是参数表 + if($if_subsys > 0){ + $update_sql="UPDATE load_temp SET key_subsys_id=$subsys_num"; + }elseif($if_enable > 0){ + $sel_field_list= mysql_list_fields($db_name,$table_name); + $sel_field_num = mysql_num_fields($sel_field_list); + if($DEBUG) echo "
      sel_field_num=$sel_field_num"; + $set_all_field=''; + for($i=0;$i<$sel_field_num;$i++){ + $sel_field_name = mysql_field_name($sel_field_list, $i); + if(substr($sel_field_name,0,1)=='E'){ + $set_field=substr($sel_field_name,2); + $set_all_field=$set_all_field.",".$sel_field_name."=".$set_field; + } + } + $set_total_field="mflag='1'".$set_all_field; + $update_sql="UPDATE load_temp SET ".$set_total_field; + if($DEBUG) echo "
      update_sql=$update_sql"; + } + if($if_subsys > 0 || $if_enable > 0){ + $update_result=mysqli_query($pubConn,$update_sql); + }else{ + $update_result=1; + } + if(0) echo "update_result[$update_result]
      "; + //echo "
      update_sql=$update_sql"; + //如果修改成功,把临时表数据一条条插入相应表 + if($update_result > 0){ + $select_sql="SELECT * FROM load_temp"; + $select_result=mysqli_query($pubConn,$select_sql); + $sel_field_num = mysql_num_fields($select_result); + $select_rows=mysqli_fetch_array($select_result); + + do{ + $sel_val=''; + for($i=0;$i<$sel_field_num;$i++){ + $select_rows[$i]=str_replace("'","\'",$select_rows[$i]); + if($i==$sel_field_num-1){ + if($i==0){ + $sel_val="'".$select_rows[$i]."'"; + }else{ + $sel_val=$sel_val."'".$select_rows[$i]."'"; + } + }else{ + if($i==0){ + $sel_val="'".$select_rows[$i]."'".","; + }else{ + $sel_val=$sel_val."'".$select_rows[$i]."'".","; + } + } + //echo "
      sel_val=$sel_val"; + } + $replace_sql="REPLACE $table_name VALUES($sel_val)"; + if ($DEBUG) echo "
      replace_sql=$replace_sql"; + $replace_result=mysqli_query($pubConn,$replace_sql); + }while($select_rows=mysqli_fetch_array($select_result)); + + if($table_name=='pre_mo_tariff'||$table_name=='pre_mt_tariff'){ + $tmpSql=" SELECT bill_id,tariff_id FROM $table_name"; + if($DEBUG)echo "
      tmpSql=$tmpSql"; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + echo mysqli_error($pubConn); + + do + { + $tmp_bill_id = $tmpRow[bill_id]; + $tmp_tariff_id = $tmpRow[tariff_id]; + + for($count=0;$count'9'){ + if($tmp_bill_id[$count]!='B'&&$tmp_bill_id[$count]!='b'&&$tmp_bill_id[$count]!='C'&&$tmp_bill_id[$count]!='c'){ + $failFlag='1'; + $delSql=" DELETE FROM $table_name WHERE tariff_id='$tmp_tariff_id' AND bill_id='$tmp_bill_id'"; + //echo "
      $delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + echo ""; + break; + } + } + } + }while($tmpRow = @mysqli_fetch_array($tmpRes)); + if($failFlag=='1'){ + echo ""; + } + } + + //如果导入成功,给出成功上载标志 + if($replace_result>0){ + echo "
      $strOperateDatabaseSuccess"; + $input_success=1; + //如果需要通知底层 + if($if_enable>0){ + $command_type='1'; + $send_result=send_shm_module($obj_id,$command_type);//设置共享内存 + if($send_result<0){ + $update_sql = "UPDATE $table_name set mflag = '0'"; + //echo "
      update_sql=$update_sql"; + $result=mysqli_query($pubConn,$update_sql); + }//end if($send_result<0) + + }//end ifif($if_enable>0) + + }//end if($replace_result>0) + else{ + echo "replace err
      "; + echo mysqli_error($pubConn); + } + + }//end if($update_result>0) + + }//end if($load_result>0) + }//end if($create_result>0) + + if($input_success==0){ + echo "
      $strOperateDatabaseFailure"; + echo mysqli_error($pubConn); + exit(); + } + $drop_sql="DROP TABLE IF EXISTS load_temp"; + $drop_result=mysqli_query($pubConn,$drop_sql); + if($input_success>0){ + //edit log_name + $log_name=$log_name." successful."; + //update last download time + $update_sql="UPDATE $syscsvconf_table SET last_upload = CURRENT_TIMESTAMP WHERE key_menu_id='$key_menu_id'"; + mysqli_query($pubConn,$update_sql); + }else{ + $log_name=$log_name." fail."; + echo "
      $strOperateDatabaseFailure"; + echo mysqli_error($pubConn); + } + insertLog("$log_name"); + //@unlink($textfile); + //}else{ + // echo "$strDataUploadError"; + // $log_name=$log_name." $strDataUploadError."; + // insertLog("$log_name"); + } +}elseif(isset($textfile)){ + echo "
      Upload csv file failed, File isn't exist or file is empty!"; +} + +?> + + +

      +

      "; +/* +if($load_sys_type==0){//如果是TS_OMC + echo "
      $strNoteUploadParameter
      "; +} +*/ +if ($insert_result == 1){ + echo "
      $strUploadSucc
      "; +} +elseif ($insert_result == 0){ + echo "
      $strUploadUnSucc
      "; +} +?> +

      " enctype="multipart/form-data"> + + + + + +
      + + + "> + + " name="input" class="button"> + " name="back" onclick=javascript:location.href="./load_csv_list.php?" class="button"> +
      + "> + "> + + + + + + + diff --git a/wxc2_omc/security/backupRestore/load_in_csv.php.fj b/wxc2_omc/security/backupRestore/load_in_csv.php.fj new file mode 100755 index 0000000..f45e1cc --- /dev/null +++ b/wxc2_omc/security/backupRestore/load_in_csv.php.fj @@ -0,0 +1,387 @@ +sel_name = $sel_name
      "; +/* +LOAD DATA [LOW_PRIORITY] [LOCAL] INFILE 'file_name.txt' [REPLACE | IGNORE] + INTO TABLE tbl_name + [FIELDS + [TERMINATED BY '\t'] + [OPTIONALLY] ENCLOSED BY ''] + [ESCAPED BY '\\' ]] + [LINES TERMINATED BY '\n'] + [IGNORE number LINES] + [(col_name,...)] + +例: +LOAD DATA LOCAL INFILE '/tmp/phpBGhA33' +INTO TABLE OMC_Def_test +FIELDS + TERMINATED BY ',' + ENCLOSED BY '\"' + ESCAPED BY '\\'(可省略) +LINES + TERMINATED BY '\n' +IGNORE 1 LINES +*/ + + +$remark_style=array( + 'sign' =>'#', + 'fields_by' =>',', + 'lines_by' =>'\n', + 'fields_seek' =>'1' + ); + +$data_style=array( + 'fields_by' =>',', + 'enclosed_by'=>'\"', + 'escaped_by' =>'\\', + 'lines_by' =>'\n', + 'ignore_lines' =>'0', + 'mode' =>'REPLACE' + ); +echo "test
      "; +//get load out information +$info_sql = "SELECT * FROM $syscsvconf_table WHERE key_menu_id='$key_menu_id'"; +if($DEBUG) echo "
      info_sql = $info_sql";//调试用 +$result = mysqli_query($pubConn,$info_sql); +$info_rows = mysqli_fetch_array($result); +$server_name = $info_rows[server_name]; +$db_name = $info_rows[db_name]; +$table_name = $info_rows[table_name]; +$where_find = $info_rows[where_find]; +$sys_id = $info_rows[sys_id]; +$obj_id = $info_rows[obj_id]; +$if_enable = $info_rows[if_enable]; +$if_enable =0; +$if_subsys = $info_rows[if_subsys]; +$menu_name = $info_rows[menu_name]; +$menu_name_2 = $info_rows[menu_name_2]; +$log_name = "Upload--"."'$server_name' '$db_name' '$table_name'"; +/* +$sel_field_list= mysql_list_fields($db_name,$table_name); +$sel_field_num = mysql_num_fields($sel_field_list); +if($DEBUG) echo "
      sel_field_num=$sel_field_num"; +for($i=0;$i<$sel_field_num;$i++){ + $sel_field_name = mysql_field_name($sel_field_list, $i); + if($sel_field_name=='mflag'){ + $if_enable=1; + break; + } +} +*/ + +if($DEBUG) echo "
      if_enable=$if_enable"; + +if($DEBUG) echo "
      if_subsys=$if_subsys"; +if($if_subsys>0){ + $subsys_num = omc_sys_id_info($sys_id,subsys_num); + echo "
      subsys_num=$subsys_num"; +} +$load_file_info=array( + 'name' =>$textfile, + 'server'=>$server_name, + 'db' =>$db_name, + 'table' =>$table_name + ); + +if(isset($textfile) && $textfile != "none"){ + if($DEBUG) echo "
      LOAD DATA file -> $textfile
      "; + if (($table_name == 'paramConf') ||($table_name == 'subsParamConf_0')||($table_name == 'subsParamConf_1')||($table_name == 'logAttrDef_0')||($table_name == 'logAttrDef_1')){ + $del_sql = "DELETE FROM $table_name"; + if($DEBUG) echo "
      del_sql = $del_sql"; + $del_result = mysqli_query($pubConn,$del_sql); + if($DEBUG) echo "
      del_result=$del_result"; + + $insert_sql = "LOAD DATA INFILE '$textfile' + INTO TABLE $table_name + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + "; + if($DEBUG) echo "
      insert_sql=$insert_sql"; + $insert_result=mysqli_query($pubConn,$insert_sql); + $log_name="UPLOAD $db_name-$table_name"; + if($DEBUG) echo "
      insert_result=$insert_result"; + if ($insert_result){ + $log_name=$log_name." successful."; + $update_sql="UPDATE $syscsvconf_table SET last_upload = CURRENT_TIMESTAMP WHERE key_menu_id='$key_menu_id'"; + mysqli_query($pubConn,$update_sql); + } + else + $log_name=$log_name." fail."; + insertLog("$log_name"); + } + //elseif (omc_chk_load_in($load_file_info,$remark_style) > 0){ + else{ + //empty existed table + if($DEBUG) $drop_sql="DROP TABLE IF EXISTS load_temp"; + $drop_result=mysqli_query($pubConn,$drop_sql); + + $create_sql="CREATE TABLE IF NOT EXISTS load_temp SELECT * FROM $table_name LIMIT 0,0"; + if($DEBUG) echo "
      create_sql=$create_sql"; + $create_result=mysqli_query($pubConn,$create_sql); + + //如果建表成功,把文件数据导入临时表 + if($create_result>0){ + $load_sql="LOAD DATA LOCAL INFILE '$textfile' $data_style[mode] + INTO TABLE load_temp + FIELDS + TERMINATED BY '$data_style[fields_by]' + ENCLOSED BY '$data_style[enclosed_by]' + LINES + TERMINATED BY '$data_style[lines_by]' + IGNORE $data_style[ignore_lines] LINES + "; + if($DEBUG) echo "
      load_sql=$load_sql"; + $load_result=mysqli_query($pubConn,$load_sql); + if($DEBUG) echo "load_resul[$load_result]
      "; + if(0) + { + echo mysqli_error($pubConn); + echo "load_sql[$load_sql] load_resul[$load_result]
      "; + exit(); + } + //如果导入成功,把临时表作相应改变 + if($load_result > 0){ + //删除空记录 + $sel_field_list= mysql_list_fields($db_name,$table_name); + $sel_field_num = mysql_num_fields($sel_field_list); + $sel_all_field=''; + for($i=0;$i<$sel_field_num;$i++){ + $sel_field_name = mysql_field_name($sel_field_list, $i); + if($i==$sel_field_num-1) + { + $sel_all_field.=$sel_field_name."=''"; + } + else + { + $sel_all_field.=$sel_field_name."='' AND "; + } + } + $del_sql = " DELETE FROM load_temp WHERE ".$sel_all_field; + if ($DEBUG) echo "
      del_sql=$del_sql"; + $del_result = mysqli_query($pubConn,$del_sql); + + //如果是参数表 + if($if_subsys > 0){ + $update_sql="UPDATE load_temp SET key_subsys_id=$subsys_num"; + }elseif($if_enable > 0){ + $sel_field_list= mysql_list_fields($db_name,$table_name); + $sel_field_num = mysql_num_fields($sel_field_list); + if($DEBUG) echo "
      sel_field_num=$sel_field_num"; + $set_all_field=''; + for($i=0;$i<$sel_field_num;$i++){ + $sel_field_name = mysql_field_name($sel_field_list, $i); + if(substr($sel_field_name,0,1)=='E'){ + $set_field=substr($sel_field_name,2); + $set_all_field=$set_all_field.",".$sel_field_name."=".$set_field; + } + } + $set_total_field="mflag='1'".$set_all_field; + $update_sql="UPDATE load_temp SET ".$set_total_field; + if($DEBUG) echo "
      update_sql=$update_sql"; + } + if($if_subsys > 0 || $if_enable > 0){ + $update_result=mysqli_query($pubConn,$update_sql); + }else{ + $update_result=1; + } + if(0) echo "update_result[$update_result]
      "; + //echo "
      update_sql=$update_sql"; + //如果修改成功,把临时表数据一条条插入相应表 + if($update_result > 0){ + $select_sql="SELECT * FROM load_temp"; + $select_result=mysqli_query($pubConn,$select_sql); + $sel_field_num = mysql_num_fields($select_result); + $select_rows=mysqli_fetch_array($select_result); + + do{ + $sel_val=''; + for($i=0;$i<$sel_field_num;$i++){ + $select_rows[$i]=str_replace("'","\'",$select_rows[$i]); + if($i==$sel_field_num-1){ + if($i==0){ + $sel_val="'".$select_rows[$i]."'"; + }else{ + $sel_val=$sel_val."'".$select_rows[$i]."'"; + } + }else{ + if($i==0){ + $sel_val="'".$select_rows[$i]."'".","; + }else{ + $sel_val=$sel_val."'".$select_rows[$i]."'".","; + } + } + //echo "
      sel_val=$sel_val"; + } + $replace_sql="REPLACE $table_name VALUES($sel_val)"; + if ($DEBUG) echo "
      replace_sql=$replace_sql"; + $replace_result=mysqli_query($pubConn,$replace_sql); + }while($select_rows=mysqli_fetch_array($select_result)); + + if($table_name=='pre_mo_tariff'||$table_name=='pre_mt_tariff'){ + $tmpSql=" SELECT bill_id,tariff_id FROM $table_name"; + if($DEBUG)echo "
      tmpSql=$tmpSql"; + $tmpRes = @mysqli_query($pubConn,$tmpSql); + $tmpRow = @mysqli_fetch_array($tmpRes); + echo mysqli_error($pubConn); + + do + { + $tmp_bill_id = $tmpRow[bill_id]; + $tmp_tariff_id = $tmpRow[tariff_id]; + + for($count=0;$count'9'){ + if($tmp_bill_id[$count]!='B'&&$tmp_bill_id[$count]!='b'&&$tmp_bill_id[$count]!='C'&&$tmp_bill_id[$count]!='c'){ + $failFlag='1'; + $delSql=" DELETE FROM $table_name WHERE tariff_id='$tmp_tariff_id' AND bill_id='$tmp_bill_id'"; + //echo "
      $delSql"; + $delRes = @mysqli_query($pubConn,$delSql); + echo mysqli_error($pubConn); + echo ""; + break; + } + } + } + }while($tmpRow = @mysqli_fetch_array($tmpRes)); + if($failFlag=='1'){ + echo ""; + } + } + + //如果导入成功,给出成功上载标志 + if($replace_result>0){ + echo "
      $strOperateDatabaseSuccess"; + $input_success=1; + //如果需要通知底层 + if($if_enable>0){ + $command_type='1'; + $send_result=send_shm_module($obj_id,$command_type);//设置共享内存 + if($send_result<0){ + $update_sql = "UPDATE $table_name set mflag = '0'"; + //echo "
      update_sql=$update_sql"; + $result=mysqli_query($pubConn,$update_sql); + }//end if($send_result<0) + + }//end ifif($if_enable>0) + + }//end if($replace_result>0) + else{ + echo "replace err
      "; + echo mysqli_error($pubConn); + } + + }//end if($update_result>0) + + }//end if($load_result>0) + }//end if($create_result>0) + + if($input_success==0){ + echo "
      $strOperateDatabaseFailure"; + echo mysqli_error($pubConn); + exit(); + } + $drop_sql="DROP TABLE IF EXISTS load_temp"; + $drop_result=mysqli_query($pubConn,$drop_sql); + if($input_success>0){ + //edit log_name + $log_name=$log_name." successful."; + //update last download time + $update_sql="UPDATE $syscsvconf_table SET last_upload = CURRENT_TIMESTAMP WHERE key_menu_id='$key_menu_id'"; + mysqli_query($pubConn,$update_sql); + }else{ + $log_name=$log_name." fail."; + echo "
      $strOperateDatabaseFailure"; + echo mysqli_error($pubConn); + } + insertLog("$log_name"); + //@unlink($textfile); + //}else{ + // echo "$strDataUploadError"; + // $log_name=$log_name." $strDataUploadError."; + // insertLog("$log_name"); + } +}elseif(isset($textfile)){ + echo "
      Upload csv file failed, File isn't exist or file is empty!"; +} + +?> + + +

      +

      "; +/* +if($load_sys_type==0){//如果是TS_OMC + echo "
      $strNoteUploadParameter
      "; +} +*/ +if ($insert_result == 1){ + echo "
      $strUploadSucc
      "; +} +elseif ($insert_result == 0){ + echo "
      $strUploadUnSucc
      "; +} +?> +

      " enctype="multipart/form-data"> + + + + + +
      + + + "> + + " name="input" class="button"> + " name="back" onclick=javascript:location.href="./load_csv_list.php?" class="button"> +
      + "> + "> + + + + + + + diff --git a/wxc2_omc/security/backupRestore/load_out_csv.php b/wxc2_omc/security/backupRestore/load_out_csv.php new file mode 100755 index 0000000..129075d --- /dev/null +++ b/wxc2_omc/security/backupRestore/load_out_csv.php @@ -0,0 +1,274 @@ +csvFileNameArr[$k_no] $csvFileNameArr[$k_no]"; + $file_full_name = $path . "{$csvFileNameArr[$k_no]}.csv"; + $objDb=$db_name; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$objDb); + if (is_file($file_full_name)) + unlink($file_full_name); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '{$file_full_name}' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $table_name + "; + $csvFileUpdateResult = mysqli_query($objDbConn ,$csvFileUpdateSql); + echo mysqli_error($objDbConn); + } + + $allone_filename = "all-" . $sel_name . "-" . $date_num . ".csv"; + $allone_fullName = $path . $allone_filename; + if(is_file($allone_fullName)) + { + unlink($allone_fullName); + } + $fd=fopen($allone_fullName, "wa"); + for($i=0; $i< sizeof($csvFileNameArr); $i++) + { + $tmpfile = $path . "{$csvFileNameArr[$i]}.csv"; + $nameline = $csvFileNameArr[$i]; + $nameline_start = $start_flag . $nameline . ".csv and keyMenuId=".$keyMenuIdArr[$i]."\n"; + fputs($fd,$nameline_start); + $tmpfd=fopen($tmpfile, "r"); + while(!feof($tmpfd)) + { + $line=fgets($tmpfd,4096); + fputs($fd,$line); + } + $nameline_end = $end_flag . $nameline . "\n"; + fputs($fd,$nameline_end); + fclose($tmpfd); + unlink($tmpfile); + } + fclose($fd); + + header("Content-type: application/csv"); + header("Content-Disposition: attachment; filename=$allone_filename"); + $file_path = $path . $allone_filename; + readfile($file_path); + + if($file_clean && is_file($file_path)) + unlink($file_path); + + $where = "description=\"sel_name is $sel_name\""; + $update_sql="UPDATE $syscsvconf_table SET last_download = CURRENT_TIMESTAMP WHERE $where"; + mysqli_query($pubConn,$update_sql); + + //echo " "; + //echo " "; +} +else//download respectively +{ + //update last download time + $update_sql="UPDATE $syscsvconf_table SET last_download = CURRENT_TIMESTAMP WHERE key_menu_id='$key_menu_id'"; + mysqli_query($pubConn,$update_sql); + + //get load out information + $info_sql="SELECT * FROM $syscsvconf_table WHERE key_menu_id='$key_menu_id'"; + $result=mysqli_query($pubConn,$info_sql); + $info_rows=mysqli_fetch_array($result); + $server_name = $info_rows[server_name]; + $db_name = $info_rows[db_name]; + $table_name = $info_rows[table_name]; + $where_find = $info_rows[where_find]; + $menu_name_2 = $info_rows[menu_name_2]; + $menu_name = $info_rows[menu_name]; + + if(($table_name=='sysOperLog')||($table_name=='sysAlarmLog')) + { + $tmpMenuArr=explode('_',$menu_name_2); + $day=date("md",mktime(0,0,0,date("m"),date("d")-($tmpMenuArr[1]),date("Y"))); + $date_num=date("YmdHis", mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))); + $file_name=$tmpMenuArr[0].$day.'-'.$date_num; + $bgn_time=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$tmpMenuArr[1],date("Y"))); + $end_time=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$tmpMenuArr[1]+1,date("Y"))); + if($table_name=='sysAlarmLog') + $where_find=" WHERE alarmTime>='$bgn_time' AND alarmTime<='$end_time'"; + else + $where_find=" WHERE datetime>='$bgn_time' AND datetime<='$end_time'"; + + } + else + { + //echo "$where
      "; + $date_num=date("YmdHis", mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))); + if($sel_name == "network") + { + $file_name = "param-"; + $file_name=$file_name.$menu_name_2.'-'.$date_num; + } + else + { + $file_name=$menu_name_2.'-'.$date_num; + } + } + $ext = "csv"; + /* + header("Content-disposition: filename=$file_name.$ext"); + header("Content-type: application/octetstream"); + header("Pragma: no-cache"); + header("Expires: 0"); + */ + + // doing some DOS-CRLF magic... + $client=getenv("HTTP_USER_AGENT"); + //if(ereg('[^(]*\((.*)\)[^)]*',$client,$regs)){ + if(preg_match("/[^(]*\((.*)\)[^)]*/",$client,$regs)){ + $os = $regs[1]; + + // this looks better under WinX + // if (eregi("Win",$os)) + if (preg_match("/Win/i",$os)) + $crlf="\r\n"; + } + + //---------insert log------- + //$log_name = "Download-- '$db_name' '$table_name'"; + //$selectedLanguage=$userInfo[language]; + //if($selectedLanguage == 'eng') + $log_name = "Download--"."'$menu_name_2'"; + //else + // $log_name = "Download--"."'$menu_name'"; + insertLog("$log_name"); + //-------- + + function my_csvhandler($sql_insert) { + global $crlf, $asfile; //$crlf=="\n" + if(empty($asfile)) + echo htmlspecialchars("$sql_insert$crlf"); + else + echo "$sql_insert $crlf"; + } + + //get_table_csv($link[0],$db_name, $table_name, $where_find, "my_csvhandler") + if(0) + { + echo "
      db_name:$db_name.$table_name"; + //echo " SELECT * INTO OUTFILE '$csvFileName' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' FROM $table_name "; + // exit; + } + if ( 1|| ($table_name == 'paramConf') + ||($table_name == 'subsParamConf_0') + ||($table_name == 'subsParamConf_1') + ||($table_name == 'logAttrDef_0') + ||($table_name == 'logAttrDef_1')) + { + $file_name = $menu_name_2.'-'.$date_num.'.csv'; + $csvFileName = '/usr/local/apache/htdocs/db_backup/paramConf/'.$file_name; + if (is_file($csvFileName)) + unlink("$csvFileName"); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '$csvFileName' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $table_name + "; + // echo $csvFileUpdateSql; + $objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$db_name); + + if(stristr($table_name,"sysAlarmLog")) + { + $csvFileUpdateSql="SELECT sysConf.sysTypeName, + $table_name.sysNo, + $table_name.subSysNo, + sysAlarmLevelDesc.desc_2, + sysAlarmConf.alarmDesc_2, + $table_name.alarmTime, + $table_name.clearTime, + $table_name.clearBy + INTO OUTFILE '$csvFileName' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' + FROM + ((($table_name INNER JOIN sysConf ON sysConf.sysTypeNo=$table_name.sysTypeNo) INNER JOIN sysAlarmConf ON $table_name.compCode=sysAlarmConf.compCode AND $table_name.alarmCode=sysAlarmConf.alarmCode AND $table_name.sysTypeNo=sysAlarmConf.sysTypeNo) INNER JOIN sysAlarmLevelDesc ON sysAlarmConf.alarmLevel=sysAlarmLevelDesc.level) + "; + + + } + + //echo "table_name = $table_name
      "; + //echo "
      $csvFileUpdateSql"; + $csvFileUpdateResult = mysqli_query($objDbConn ,$csvFileUpdateSql); + echo mysqli_error($objDbConn); + + //echo " "; + //echo " "; + header("Content-type: application/csv"); + header("Content-Disposition: attachment; filename=$file_name"); + + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + + readfile($csvFileName); + //if($file_clean) + // unlink($csvFileName); + //echo " "; + } + else + { + header("Content-disposition: filename=$file_name.$ext"); + header("Content-type: application/octetstream"); + header("Pragma: no-cache"); + header("Expires: 0"); + get_table_csv($link[0],$db_name, $table_name, $where_find, "my_csvhandler"); + } +} +?> \ No newline at end of file diff --git a/wxc2_omc/security/backupRestore/mssBak_list.php b/wxc2_omc/security/backupRestore/mssBak_list.php new file mode 100755 index 0000000..abd6820 --- /dev/null +++ b/wxc2_omc/security/backupRestore/mssBak_list.php @@ -0,0 +1,174 @@ + MSS Backup Download"; +$blank4 .="    "; +$db = 'OMC_PUB'; +$elementTable='elementExistConf'; + +/********** FUNCTION START::TREEOLD *************/ +function treeOld($directory,$blank,$sys_name) +{ + $DEBUG=0; + + $mydir=@dir($directory); + if(!$mydir){ + echo "

      Error: can't open this directory: \"$directory\" .It's not exist!"; + exit(); + } + $blank .=""; //用一个空白图片表示每层目录间的间隔 + $k=0; + while($file=$mydir->read()){ + if((is_dir("$directory/$file")) AND ($file!=".") AND ($file!="..")){ + continue; + }elseif($file =="." || $file ==".."){ + continue; + }else{ + if (strstr($file,$sys_name) == NULL) continue; + if (strstr($file,"tgz") == NULL) continue; + if(substr("$directory/$file",-2) == 'gz'){ + $type_image=""; + }elseif(substr("$directory/$file",-3) == 'csv'){ + $type_image=""; + }else{ + $type_image=""; + } + $fileList[$k] ="$blank $type_image $file"; + $filemod = filemtime("$directory/$file"); + $filemodtime = date("Y-m-d h:i:s ", $filemod); + $fileTimeList[$k] ="$filemodtime"; + $k++; + } + + }//end of while + + $mydir->close(); + for($h=0;$h + + + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +adjust_title_tail(); +adjust_content_head(); + +/**************** TABLE START:: DISPLAY DETAILS ************************/ +echo ""; +echo "
      "; +$blank=''; +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='AUC' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + treeold("../../../mssBakData/auc",$blank,"Auc"); +} +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='EIR' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + + $blank=""; + echo "\n"; + treeold("../../../mssBakData/eir",$blank,"Eir"); +} +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='HLR' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + treeold("../../../mssBakData/hlr",$blank,"Hlr"); +} +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='PPS' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + treeold("../../../mssBakData/pps",$blank,"ppsSubs"); + + + $blank=""; + echo "\n"; + treeold("../../../mssBakData/pps",$blank,"ppsRechargeCard"); + + $blank=""; + echo "\n"; + treeold("../../../mssBakData/pps",$blank,"ppsTariff"); +} + +//MNP +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='MNP' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + treeold("../../../mssBakData/mnp",$blank,"npdbMem"); +} + +//opr +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='OPPS' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + treeold("../../../mssBakData/opr",$blank,"Opr"); +} + +//iPALIM +$tmpSql = " SELECT * FROM elementExistConf WHERE elementName='iPALIM' AND existFlag='1'"; +if($DEBUG) echo "
      tmpSql=$tmpSql"; +$tmpRes = mysqli_query($pubConn,$tmpSql); +if(mysqli_num_rows($tmpRes)>0){ + $blank=""; + echo "\n"; + treeold("../../../mssBakData/palim",$blank,"palim"); +} + +echo "
      $blank  AUC
      $blank  EIR
      $blank  HLR
      $blank  PPS Subscriber
      $blank  PPS Recharge Card
      $blank  PPS Tariff
      $blank  MNP
      $blank  OPR
      $blank  iPALIM
      "; +adjust_content_tail(); +/**************** TABLE END:: DISPLAY DETAILS ************************/ +?> + + diff --git a/wxc2_omc/security/backupRestore/mss_backup_restore.php b/wxc2_omc/security/backupRestore/mss_backup_restore.php new file mode 100755 index 0000000..1054832 --- /dev/null +++ b/wxc2_omc/security/backupRestore/mss_backup_restore.php @@ -0,0 +1,339 @@ + + + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Maintenance > Backup & Restore > Configuration"; + echo ""; + $helpId="5.1.6"; + showHelp($helpId); + echo "
      "; + echo "
      "; + + echo "    "; + //echo ""; + //echo "From file"; + //echo ""; + + echo "
      "; + echo ""; + echo " "; + echo "
      "; +adjust_title_tail(); +adjust_content_head(); + +$ftpinfo=getMSSFtpAccount(); +$selSql = "SELECT ip FROM sysInfo where sysTypeNo=388 order by updateTime desc "; +$selRes = @mysqli_query($pubConn,$selSql); +$num=mysqli_num_rows($selRes); +$selRow = @mysqli_fetch_array($selRes); +$mss_ip=$selRow[ip]; + +if($backup_file_flag == 1) +{ + echo "\n"; + + if($num == 0) + { + echo "Can not get IP of MSS
      "; + } + else + { + //oid 1.3.6.1.4.1.1373.2.3.3.99.2.1.1, value=6 + $sql="replace into OBJ_388.param_99(subSysNo,paramType,level_1,level_2,level_3,instanceNo,sortNo,valueType,operType,length,initValue)values(99,0,2,1,1,0,0,4,0,1,'06') "; + mysqli_query($pubConn,$sql); + + $commIdStr=oidSysCommSend("388_99_99",3,"2.1.1",-1,0); + //checkState($commIdStr,"./mss_backup_restore.php"); + flush(); + + for($t=0;$t<4;$t++) + { + flush(); + echo ""; + ob_flush(); + flush(); + sleep(1); + } + /* close ftp + $conn_id=ftp_connect($mss_ip); + if($conn_id == FALSE) + { + echo "FTP:connect to $mss_ip failed.
      "; + exit(); + } + */ + + $connection=sftp_connect($mss_ip); + if(!$connection) + { + echo "SFTP:connect to $mss_ip failed.
      "; + exit(); + } + + /* close ftp + if(FALSE == ftp_login($conn_id,$ftpinfo[UserName],$ftpinfo[Password])) + { + echo "FTP:login to $mss_ip failed.
      "; + exit(); + } + */ + + $key=sftp_login($connection,$ftpinfo[UserName],$ftpinfo[Password]); + if(!$key) + { + echo "SFTP:login to $mss_ip failed.
      "; + exit(); + } + + $local_file="/usr/local/apache/htdocs/ftpFile/mssConf".date("YmdHis").".tar"; + $remote_file="/usr/local/subsManage/conf.bk.tar"; + /* close ftp + if(FALSE == ftp_get($conn_id,$local_file,$remote_file,FTP_BINARY)) + { + echo "FTP:Get file $remote_file failed.
      "; + exit(); + } + ftp_close($conn_id); + */ + + //if(!sftp_get($key,$local_file,$remote_file,SFTP_ASCII)) + if(!sftp_get($connection,$local_file,$remote_file,SFTP_ASCII)) + { + echo "SFTP:Get file $remote_file failed.
      "; + exit(); + } + + insertLog("Backup mss configuration file conf.bk.tar"); + } +} +else if($restore_file_flag == 1) +{ + echo "\n"; + if($num == 0) + { + echo "Can not get IP of MSS
      "; + } + else + { + $original_file="/usr/local/apache/htdocs/ftpFile/$backup_filename"; + $ftp_file="/usr/local/apache/htdocs/ftpFile/conf.bk.tar"; + system("cp -f $original_file $ftp_file"); + system("chmod 777 $ftp_file"); + + /* close ftp + $conn_id=ftp_connect($mss_ip); + if($conn_id == FALSE) + { + echo "FTP:connect to $mss_ip failed.
      "; + exit(); + } + */ + + $connection=sftp_connect($mss_ip); + if(!$connection) + { + echo "SFTP:connect to $mss_ip failed.
      "; + exit(); + } + + /* close ftp + if(FALSE == ftp_login($conn_id,$ftpinfo[UserName],$ftpinfo[Password])) + { + echo "FTP:login to $mss_ip failed.
      "; + exit(); + } + */ + + $key=sftp_login($connection,$ftpinfo[UserName],$ftpinfo[Password]); + if(!$key) + { + echo "SFTP:login to $mss_ip failed.
      "; + exit(); + } + + $local_file=$ftp_file; + $remote_file="/usr/local/subsManage/conf.bk.tar"; + + /* close ftp + if(FALSE == ftp_put($conn_id,$remote_file,$local_file,FTP_BINARY)) + { + echo "FTP:Put file $original_file failed.
      "; + exit(); + } + ftp_close($conn_id); + */ + + if(!sftp_put($key,$remote_file,$local_file,SFTP_ASCII)) + { + echo "FTP:Put file $original_file failed.
      "; + exit(); + } + + unlink($ftp_file); + + //oid 1.3.6.1.4.1.1373.2.3.3.99.2.1.1, value=7 + $sql="replace into OBJ_388.param_99(subSysNo,paramType,level_1,level_2,level_3,instanceNo,sortNo,valueType,operType,length,initValue)values(99,0,2,1,1,0,0,4,0,1,'07') "; + mysqli_query($pubConn,$sql); + + $commIdStr=oidSysCommSend("388_99_99",3,"2.1.1",-1,0); + //checkState($commIdStr,"./mss_backup_restore.php"); + + insertLog("Restore mss configuration file from $local_file"); + } +} +else if($download_file_flag == 1) +{ + header("Content-type: application/csv"); + header("Content-Disposition: attachment; filename=\"{$backup_filename}\""); + + //use for download csv in https + header('Expires: 0'); + header('Pragma: public'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Cache-Control: public'); + + readfile("/usr/local/apache/htdocs/ftpFile/{$backup_filename}"); +} + +//Get the backup file list +$dir="/usr/local/apache/htdocs/ftpFile/"; +$handle=opendir($dir); +if($handle == FALSE) +{ + echo "Can not open dir $dir
      "; + exit(); +} + +$filecount=0; +while (($file = readdir($handle)) !== false) +{ + if(strstr($file,"mssConf")) + { + $fileList[FullName][$filecount]=$dir.$file; + $fileList[FileName][$filecount]=$file; + $fileList[FileSize][$filecount]=filesize($dir.$file); + $fileList[FileMTime][$filecount]=date("Y-m-d H:i:s",filemtime($dir.$file)); + $filecount++; + } +} + +if($filecount > 0) + arsort($fileList[FileMTime]); + +if(0) +{ +echo "
      ";
      +print_r($fileList);
      +echo "
      "; +} + +closedir($handle); + + + +echo "

      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      MSS Configuration Backup FileFile SizeBackup TimeDownloadUpload
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; + + +if($filecount > 0) +{ + $i=0; + foreach($fileList[FileMTime] as $key => $value) + { + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + $i++; + } +} + +echo "
          
          
      "; + if($i == $filecount - 1) + echo ""; + else + echo ""; + echo ""; + echo "{$fileList[FileName][$key]} "; + echo ""; + echo "{$fileList[FileSize][$key]} {$fileList[FileMTime][$key]} DownloadUpload
      "; + + +adjust_content_tail(); + +?> diff --git a/wxc2_omc/security/backupRestore/output_file.php b/wxc2_omc/security/backupRestore/output_file.php new file mode 100755 index 0000000..e3677a0 --- /dev/null +++ b/wxc2_omc/security/backupRestore/output_file.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/wxc2_omc/security/backupRestore/pubPath.inc b/wxc2_omc/security/backupRestore/pubPath.inc new file mode 100755 index 0000000..f21453c --- /dev/null +++ b/wxc2_omc/security/backupRestore/pubPath.inc @@ -0,0 +1,24 @@ + \ No newline at end of file diff --git a/wxc2_omc/security/backupRestore/uploadFile.php b/wxc2_omc/security/backupRestore/uploadFile.php new file mode 100755 index 0000000..3b03207 --- /dev/null +++ b/wxc2_omc/security/backupRestore/uploadFile.php @@ -0,0 +1,592 @@ + + + $strBackupRestore > "."Download&Upload"; +$DEBUG = 0; +$db=$omc_db; +set_time_limit(3600); +$strNoInput = "No file input!"; +$needReboot = 0; +function MsgBox($str) +{ + echo ""; +} +function getNameByTypeNo($sysTypeNo) +{ + $pubDb = "OMC_PUB"; + $selSql = "select sysTypeName from OMC_PUB.sysConf where sysTypeNo=$sysTypeNo"; + $result = mysqli_query($pubConn,$selSql); + $row = mysqli_fetch_array($result); + $name = $row[sysTypeName]; + return $name; +} +function getFileList($dir,&$fileListArr) +{ + if ($handle = opendir($dir)) { + while (false !== ($file = readdir($handle))) { + if ($file != "." && $file != "..") { + $fileListArr[] = $file; + } + } + closedir($handle); + } +} +function updateParamer($db_name,$table_name,$csvFileName) +{ + $del_sql = "DELETE FROM $table_name"; + if($DEBUG) echo "
      del_sql = $del_sql"; + $del_result = mysqli_query($pubConn,$del_sql); + if($DEBUG) echo "
      del_result=$del_result"; + + $insert_sql = "LOAD DATA LOCAL INFILE '$csvFileName' + INTO TABLE $table_name + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + "; + if(0) echo "
      insert_sql=$insert_sql"; + $insert_result=mysqli_query($pubConn,$insert_sql); + if($DEBUG) echo "
      insert_result=$insert_result"; + if ($insert_result) + return 1; + else + return 0; +}//end updateParamer + +function updateSubs($sysId,$dataTypeNo,$impFile) +{ + $nSetComm = 3; + $pubDb = 'OMC_PUB'; + $sysSubsConfTable = 'OMC_PUB.sysSubsConf'; + $sysInfoTable = 'OMC_PUB.sysInfo'; + + $sysIdArr=explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; + + if($sysTypeNo==390) + $getConfSql="SELECT subsDataTable,impObjId,impFileName,ftpDir,ftpLoginName,ftpLoginPwd, + logFileName,maxSegmentNum,maxIndexNumPerSeg + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' AND dataTypeNo='$dataTypeNo' AND sysNo='$sysNo' + "; + else + $getConfSql="SELECT subsDataTable,impObjId,impFileName,ftpDir,ftpLoginName,ftpLoginPwd, + logFileName,maxSegmentNum,maxIndexNumPerSeg + FROM $sysSubsConfTable + WHERE sysTypeNo='$sysTypeNo' AND dataTypeNo='$dataTypeNo' + "; + if($DEBUG) echo "
      getConfSql=$getConfSql"; + $getConfResult=mysqli_query($pubConn,$getConfSql); + echo mysqli_error($pubConn); + $getConfRows=mysqli_fetch_array($getConfResult); + + $subsDataTable = $getConfRows[subsDataTable]; + $impObjId = $getConfRows[impObjId]; + $impFileName = $getConfRows[impFileName]; + $logFileName = $getConfRows[logFileName]; + $ftpDir = $getConfRows[ftpDir]; + $ftpLoginName = $getConfRows[ftpLoginName]; + $ftpLoginPwd = $getConfRows[ftpLoginPwd]; + $maxSegmentNum = $getConfRows[maxSegmentNum]; + $maxIndexNumPerSeg = $getConfRows[maxIndexNumPerSeg]; + $maxTotalNum = $maxSegmentNum * $maxIndexNumPerSeg; + $maxImpFileSize = 5*1024*1024; + $maxImpRecordNum = 5000; + + //Get the system name; + $selSql = "SELECT sysTypeName FROM sysConf WHERE sysTypeNo='$sysTypeNo'"; + if ($DEBUG) echo "selSql = $selSql
      "; + $selRes = @mysqli_query($pubConn, $selSql); + echo mysqli_error($pubConn); + $selRow = @mysqli_fetch_array($selRes); + $sysName = $selRow[sysTypeName]; + + if($sysTypeNo==390) + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' AND sysNo='$sysNo' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; + else + $getSysIdSql = "SELECT sysNo,subSysNo,ip + FROM $sysInfoTable + WHERE sysTypeNo='$sysTypeNo' AND baseStat > '0' + ORDER BY sysNo,subSysNo + "; + if($DEBUG) echo "
      getSysIdSql=$getSysIdSql"; + $getSysIdResult= mysqli_query($pubConn,$getSysIdSql); + echo mysqli_error($pubConn); + $runningServerNum = mysqli_num_rows($getSysIdResult); + if($runningServerNum <= 0){ + echo "No system running normally"; + return 0; + } + if($DEBUG) echo "running server number = $runningServerNum
      "; + //找出已有的记录个数 + $getTotalSql = "SELECT count(*) FROM $subsDataTable"; + if($DEBUG) echo "
      getTotalSql=$getTotalSql"; + $getTotalRes = mysqli_query($pubConn,$getTotalSql); + $getTotalRow = @mysqli_fetch_array($getTotalRes); + $existNum = $getTotalRow[0]; + + if($DEBUG) echo "
      existNum=$existNum"; + + //检查导入的文件大小,记录条数 + $impFileSize = filesize($impFile); + if($DEBUG) { + echo "
      impFile=$impFile"; + echo "
      impFileSize=$impFileSize"; + } + if($impFileSize > $maxImpFileSize){ + $impFileSizeM=ceil($impFileSize/1024/1024); + echo "File size is too large!(Must <= 5M)
      "; + @unlink ($impFile); + return 0; + } + + if($impFileSize <=0){ + echo "subscriber data is null."; + @unlink ($impFile); + return 0; + } + + $impRecordNum = count(file($impFile)); + if($DEBUG) echo "
      impRecordNum=$impRecordNum"; + if($impRecordNum > $maxImpRecordNum){ + echo "Records are too much!(Must <= $maxImpRecordNum)"; + @unlink ($impFile); + return 0; + } + + if($impRecordNum > $maxTotalNum-$existNum){ + echo "User number is too much!"; + @unlink ($impFile); + return 0; + } + for ($k=0; $k<$runningServerNum; $k++) { + $getSysIdRow=mysqli_fetch_array($getSysIdResult); + $sysId=$sysTypeNo.'_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo]; + $dstSeverIp = $getSysIdRow[ip]; + if($sysTypeNo==360) + $sysIdCyc[$k] = '360_99_99'; + else if($sysTypeNo==390) + $sysIdCyc[$k]='390_'.$getSysIdRow[sysNo].'_99'; + else + $sysIdCyc[$k] = $sysId; + if($DEBUG) echo "
      sysId = $sysId"; + if($DEBUG) echo "
      dstSeverIp = $dstSeverIp"; + + /* close ftp + $ftpCon=ftp_connect($dstSeverIp); + if($ftpCon < 0){ + echo "Connect Failed!"; + @unlink ($impFile); + return 0; + } + */ + + $connection=sftp_connect($dstSeverIp); + if(!$connection) + { + echo "Connect Failed!"; + @unlink ($impFile); + return 0; + } + + /* fclose ftp + if(!ftp_login($ftpCon,$ftpLoginName,$ftpLoginPwd)){ + echo "Login Failed!"; + @unlink ($impFile); + return 0; + } + */ + + $key=sftp_login($connection,$ftpLoginName,$ftpLoginPwd); + if(!$key) + { + echo "Login Failed!"; + @unlink ($impFile); + return 0; + } + + $remoteFileName=$ftpDir.$impFileName; + /* close ftp + if(!ftp_put($ftpCon,$remoteFileName,$impFile,FTP_ASCII)){ + echo "Put file Failed"; + @unlink ($impFile); + return 0; + } + ftp_quit($ftpCon); + */ + + if(!sftp_put($ftpCon,$remoteFileName,$impFile,SFTP_ASCII)){ + echo "Put file Failed"; + @unlink ($impFile); + return 0; + } + + $logFile="/usr/local/apache/htdocs/ftpFile/$logFileName"; + @unlink ($logFile); + } + @unlink ($impFile); + + //修改设备参数 + if($sysTypeNo==340){ + $k4_flag = 0; //should be 0 or 8. + $instanceNo = 0; + $commState = $k4_flag.'1'; + $totalNum = DecHex($impRecordNum); + $totalNum = omc_keep_length($totalNum,'0',6); + if($k4_flag!=8) + $k4 = '0000000000000000'; + else{ + if(strlen($k4)<16){ + echo "K4 is incorrect!"; + return 0; + } + } + $newValue = $commState.$totalNum.$k4; + }else{ + $instanceNo = 0; + $commState = '01'; + $totalNum = DecHex($impRecordNum); + $totalNum = omc_keep_length($totalNum,'0',6); + $finishNum = '000000'; + $newValue = $commState.$totalNum.$finishNum; + } + if($DEBUG)echo "
      newValue=$newValue"; + + //send set command + + for ($k=0; $k< $runningServerNum; $k++) { + $chgResult = setSysParamValue($sysIdCyc[$k],$impObjId,$instanceNo,$newValue); + $commStr = sysCommSend($sysIdCyc[$k],$nSetComm,$impObjId); + + chkCommStat($sysId,$impObjId,$impRecordNum,$commStr); + } +}//end updateSubs + +function chkCommStat($sysId,$impObjId,$impRecordNum,$commStr) +{ + $nProcFail =0; + $nWaitProc =1; + $nInProc =2; + $nOutProc =3; + $sysIdArr=explode('_',$sysId); + $sysTypeNo =$sysIdArr[0]; + $sysNo =$sysIdArr[1]; + $subSysNo =$sysIdArr[2]; + $maxSeconds = 20; + while(1) { + $paramValue = getSysParamValue($sysId,$impObjId,0,'readValue'); + $impCommState = substr($paramValue,0,2); + $runSeconds += 2; + if($sysTypeNo==340){ + $allNum=$impRecordNum; + $doneNum = substr($paramValue,2,6); + $doneNum = HexDec($doneNum); + }else{ + $allNum = substr($paramValue,2,6); + $allNum = HexDec($allNum); + $doneNum = substr($paramValue,8,6); + $doneNum = HexDec($doneNum); + } + if($doneNum > $oldDoneNum){ + $runSeconds = 0; + } + $oldDoneNum = $doneNum; + sleep(2); + if($runSeconds > $maxSeconds || $doneNum >= $allNum || $impCommState == '03' || $impCommState == '04') + { + if($impCommState == '04'){ + echo "Failed!"; + }elseif($runSeconds > $maxSeconds){ + echo "Response Time Out!"; + }else{ + echo "Finished!"; + } + break; + } + + + $commIdArr = explode('-',$commStr); + $commId = $commIdArr[0]; + + $commSql = " SELECT commState FROM parameterComm WHERE commId = '$commId' "; + $commRes = mysqli_query($pubConn,$commSql); + $commRow = @mysqli_fetch_array($commRes); + $commStat = $commRow[commState]; + if($commStat == $nOutProc || !isset($commStat)){ + $commStr = sysCommSend($sysId,0,$impObjId); + } + }//end while +}//end chkCommStat +function updateBssDb($bssIpAddr,$localDir) +{ + $remoteDir = "/hd0/iw07_00.010/compile/cfg/"; + $ftpCon=@ftp_connect($bssIpAddr); + if($ftpCon < 0){ + echo "BSS's ip is error or connect $bssIpAddr Failed!"; + flush(); + return 0; + } + if(!@ftp_login($ftpCon,'','')){ + echo "BSS's ip is error or login $bssIpAddr Failed!"; + @ftp_close($ftpCon); + flush(); + return 0; + } + if(!@ftp_chdir($ftpCon, $remoteDir)){ + echo "Change dir error!"; + @ftp_close($ftpCon); + flush(); + return 0; + } + $dir = @dir($localDir); + while(false !== ($entry=$dir->read())) { + if(is_file("$localDir$entry") && $entry!='.' && $entry!='..') + $fileArr[] = $entry; + } + for($i=0; $i< sizeof($fileArr); $i++) { + $file = $fileArr[$i]; + $remoteFile=$remoteDir.$file; + $localFile=$localDir.$file; + if (!@ftp_put($ftpCon, $remoteFile, $localFile, FTP_BINARY)) { + flush(); + echo "Put file error!"; + @ftp_close($ftpCon); + return 0; + } + }//end for + + @ftp_close($ftpCon); + return 1; +}//end get BssDb +?> + +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +showHelp($helpId); +echo ""; +echo ""; +echo ""; +if(isset($inputFile)&&$inputFile!='') +{ + $upload_file = $_FILES['inputFile']['tmp_name']; + $upload_file_name = $_FILES['inputFile']['name']; + $upload_file_size = $_FILES['inputFile']['size']; + $file_size_max = 20*1000*1000;// 20M限制文件上传最大容量(bytes) + $uploadPath = "/usr/local/apache/htdocs/db_backup/archive/uploaded/";// 上传文件的储存位置 + exec("mkdir $uploadPath -p"); + //exec("chmod -R 777 $uploadPath"); + chmod($uploadPath,0777); + $accept_overwrite = 1;//是否允许覆盖相同文件 + // 检查文件大小 + if ($upload_file_size > $file_size_max) + { + MsgBox("The file size is too large!"); + } + + // 检查读写文件 + if (file_exists($uploadPath . $upload_file_name) && !$accept_overwrite) + { + MsgBox("The file is already existed!"); + } + + //复制文件到指定目录 + if (!copy($upload_file,$uploadPath.$upload_file_name)) + { + MsgBox("File copy error!"); + } + + //解压缩文件 + chdir($uploadPath); + exec("tar zxvf $upload_file_name"); + system("rm -f $upload_file_name"); + sleep(2); +} +else +{ + MsgBox($strNoInput); +} +//exit; +////////////////////////////////////////// +if(1) +{//update parameters + $paramDir = 'params'; + $paramPath = $uploadPath . $paramDir . '/'; + if(is_dir($paramPath)) {//if there is exist paramPath. + echo "
      Updating system parameters ... "; + flush(); + getFileList($paramPath,$fileListArr); + + // print_r($fileListArr); + // exit; + $allSuccess = 1; + for($i=0; $i    Updating [ $sysTypeName ] ... "; + flush(); + } + $rtn = updateParamer($db_name,$table_name,$csvFileName); + if($oldName !== $sysTypeName){ + if($rtn==1) + echo "-- SUCCESS"; + else + echo "-- FAIL"; + flush(); + } + $oldName = $sysTypeName; + $allSuccess &= $rtn; + } + } + + system("rm -rf $paramDir"); + }//end if + +}//end update parameters. + +if(1) +{//update subscribers' data + $subsDir = 'subs'; + $subsPath = $uploadPath . $subsDir . '/'; + + if(is_dir($subsPath)) {//if there is exist subsPath + echo "

      Updating system subscribers ... "; + flush(); + unset($fileListArr); + getFileList($subsPath,$fileListArr); + + for($i=0; $i 0) { + echo "
          Updating [ $sysTypeName ] ... "; + flush(); + $allSuccess &= updateSubs($sysId,0,$csvFileName); + } + } + } + system("rm -rf $subsDir"); + } +}//end update subscribers' data + +if(1) +{//update bss. + $bssDir = "bssDir"; + $bssPath = $uploadPath . $bssDir . '/'; + $bssOmcTlbDir = "omcTlb"; + $bssOmcTlbPath = $bssPath . $bssOmcTlbDir . '/'; + $bssDbDir = "dbs"; + $bssDbPath = $bssPath . $bssDbDir . '/'; + if(is_dir($bssPath)){//if there exist this bssDir + echo "

      Updating BSS ... "; + flush(); + //1. update bssomctable. + { + unset($fileListArr); + getFileList($bssOmcTlbPath,$fileListArr); + for($i=0; $i    Updating BSS' parameters ... "; + $rtn = updateParamer($db_name,$table_name,$csvFileName); + if($rtn==1) + echo "-- SUCCESS"; + else + echo "-- FAIL"; + flush(); + $allSuccess &= $rtn; + } + } + }//end update bssomctable. + + //2. update bss db. + { + $dir = dir($bssDbPath); + while(false !== ($entry = $dir->read())) { + if(is_dir("$bssDbPath/$entry") && $entry != "." && $entry != "..") + $bssIpArr[] = $entry; + } + for($i=0; $i< sizeof($bssIpArr); $i++) { + $ip = $bssIpArr[$i]; + echo "
          Updating BSS' Database [ $ip ] ... "; + flush(); + if(updateBssDb($ip,"$bssDbPath/$ip/")) + echo "-- SUCCESS
      "; + } + }//end update bss db. + if($needReboot)//3. reboot bss. + { + chdir("/usr/local/apache/htdocs/wxc2_omc/security/backupRestore"); + for($i=0; $i< sizeof($bssIpArr); $i++) { + $ip = $bssIpArr[$i]; + echo "
          Rebooting BSS [ $ip ] ... "; + flush(); + $tmpCmd ="./bssReboot".' '.$ip; + system($tmpCmd); + //$lastLine = system($tmpCmd, $rtn); + //echo "
      $tmpCmd
      $lastLine
      $rtn"; + } + //var_dump($bssIpArr); + }//end reboot bss. + } +}//end update bss. + +//exit; + +if($allSuccess) { + MsgBox("All needed success"); +} +else { + echo "

      Back"; +} +?> diff --git a/wxc2_omc/security/ems_1.pcap b/wxc2_omc/security/ems_1.pcap new file mode 100755 index 0000000..e738ff4 Binary files /dev/null and b/wxc2_omc/security/ems_1.pcap differ diff --git a/wxc2_omc/security/login/alter_password.php b/wxc2_omc/security/login/alter_password.php new file mode 100755 index 0000000..aac34f6 --- /dev/null +++ b/wxc2_omc/security/login/alter_password.php @@ -0,0 +1,644 @@ + + + "; +echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strAdvanced > $strOmcUser"; + echo "
      ";*/ +//adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG =0; +$pubDb ='OMC_PUB'; +$table_name ='sysUser'; +$history_name='sysPwdHistory'; + +if (!isset($privilegeFlag)) { + $privilegeFlag = 0; +} + +//lyj to get pwdStrength +$strength_name ='sysPwdStrength'; +$strengthSql = "SELECT * + FROM $strength_name + "; + if($DEBUG)echo "$strengthSql
      "; + $strengthResult = mysqli_query($pubConn,$strengthSql ); + echo mysqli_error($pubConn); + $pwdStrengSult= mysqli_fetch_array($strengthResult); + $ucCategory=$pwdStrengSult['ucCategory']; + $maxLength=$pwdStrengSult['maxLength']; + + + +$patrn=$_REQUEST['patrn']; + + +if($DEBUG) echo "userInfo[ID] = $userInfo[ID]
      "; + +$confMode=$_REQUEST['confMode']; +$userName=$_REQUEST['userName']; +$selectedLanguage=$_REQUEST['selectedLanguage']; +if($DEBUG) echo "confMode=$confMode, userName=$userName
      "; +$old_userName=$_REQUEST['old_userName']; +?> + + + + + + +

      " method="POST" onsubmit="return question_Validator(this) && Check('',this,'','')" name="operForm"> + + + + + + + + + + + + "; + echo ""; + $userName = $myrows['userName']; + if ( $confMode == 'edit' ) { + echo ""; + } else { + echo ""; + } + echo ""; + echo ""; + + //淇敼鐢ㄦ埛璧勬枡 + if($userName != ''){ + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      " class="text" >
      $strAccountName$myrows[userName]$strMoreThanSixAndLessThanSixteencharacters;
      () + : +
          + +
      " class="text">
      +
      + + +  

      +   "; + }else{ + echo "  "; + echo ""; + echo ""; + } + ?> + +

      +
      + + +realName=$realName,userName=$userName,password=$password,privilege=$privilege,updateTime=$updateTime"; +$uadd=$_POST['uadd']; +$change=$_POST['change']; +if($uadd){ + $user_permit = 0; + $userName=$_POST['userName']; + $realName=$_POST['realName']; + $password=$_POST['password']; + + //---lyj + $salt = mcrypt_create_iv(16); + $password= $password.$salt; + //---lyj + + $selected_permit=$_POST['selected_permit']; + + + + + for($i=1; $i < sizeof($privilegeDefArr);$i++){ + if($selected_permit == $i){ + $user_permit=$privilegeDefArr[$i]['permit']; + break; + } + } + $privilege=$user_permit; + $select_sql ="SELECT count(*) as number_of_records + FROM $table_name + WHERE userName='$userName' "; + $result = mysqli_query($pubConn,$select_sql); + $record = @mysqli_fetch_object($result); + $number_of_records = $record->number_of_records; + //echo "
      number_of_records=$number_of_records"; + //echo "
      select_sql=$select_sql"; + + if($number_of_records){ + echo ""; + $userName=$old_userNamer; + echo " "; + adjust_content_tail(); + exit(); + }else{ //娌℃敞鍐岃繃鐨勮瘽 鍒欏鍔犳柊鐢ㄦ埛 + // $str_sql="REPLACE INTO $table_name + // ( realName,userName,password,privilege,updateTime) + // VALUES + // ('$realName','$userName',md5('$password'),'$privilege',CURRENT_TIMESTAMP) + // "; + + + $str_sql="REPLACE INTO $table_name + ( realName,userName,password,privilege,updateTime,salt) + VALUES + ('$realName','$userName',md5('$password'),'$privilege',CURRENT_TIMESTAMP,$salt) + "; + + $log_name=$strAddUser."\'$userName\'"; + $result=mysqli_query($pubConn,$str_sql); + echo mysqli_error($pubConn); + if ($result) + $log_name=$log_name.$strSuccessful; + else + $log_name=$log_name.$strFail; + insertLog("$log_name"); + + if(!$result){ + echo ""; + $userName=$old_userNamer; + echo " "; + adjust_content_tail(); + exit(); + }else{ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + } + } +}elseif($change){ //淇敼鐢ㄦ埛璧勬枡 + //淇敼璁板綍鏃朵笉鑳戒慨鏀箄serName + $userName=$_POST['userName']; + $realName=$_POST['realName']; + $new_password_1=$_POST['new_password_1']; + +if($DEBUG)echo "userName=$userName"; +if($DEBUG)echo "realName=$realName"; + +//to get ConfigNum + +$configNumSql="SELECT configNum + FROM $table_name + WHERE userName='$userName' + "; + + $configResult=mysqli_query($pubConn,$configNumSql); + echo mysqli_error($pubConn); +$configRow=mysqli_fetch_array($configResult); +$configNum=$configRow['configNum']; +if($DEBUG) echo "configNum=$configNum
      "; + +if($new_password_1) +{ +$selectHis_sql="SELECT password + FROM $history_name + WHERE userName='$userName' + ORDER BY insertTime DESC LIMIT $configNum"; +if($DEBUG) echo $selectHis_sql; + $hisResult=mysqli_query($pubConn,$selectHis_sql); + + echo mysqli_error($pubConn); + $allRow=array(); + while($hisRow=mysqli_fetch_array($hisResult)){ + $allRow[]=$hisRow; + } + if ($DEBUG) + { + echo "
      ";
      +                        print_r($allRow);   //鏀捐灞曠ず鐨勬暟缁勫彉閲�
      +                        echo "
      "; + } + for($i=0;$i + var configInfo='$Info'; + alert(configInfo); + history.go(-1); + "; + + exit(); + } + + + } + +} + + + + +//鏍¢獙鏄惁涓洪粦鍚嶅崟瀵嗙爜 + if(isset($new_password_1)){ + $blackTable='sysBlackPwd'; + $blackSQL="SELECT blackPwd + FROM $blackTable + "; + $blackResult = mysqli_query($pubConn,$blackSQL); + if($DEBUG) echo "blacksql=$blackSQL"; + $blackRow=array(); + while($allBlackRow=mysqli_fetch_array($blackResult)){ + $blackRow[]=$allBlackRow; + } + for($i=0;$i + + "; + echo "alert('"; + echo "$strAddFails,$strCannotChangeUserName,$strIfYouWangToChangeItPleaseUseAddFunction"; + echo "'); "; + echo ""; + $userName=$old_userName; + }else{ + if($new_password_1 != ''){ //淇敼瀵嗙爜 + $saltSql="SELECT salt + FROM $table_name + WHERE userName='$userName' + "; + if($DEBUG) echo "
      saltSql=$saltSql
      "; + $saltResult= mysqli_query($pubConn,$saltSql); + echo mysqli_error($pubConn); + $Saltrow =mysqli_fetch_array($saltResult); + $salt=$Saltrow['salt']; + $password=$new_password_1.$salt; + $chkSQL="SELECT privilege + FROM $table_name + WHERE userName='$userName' AND password=md5('$password') + "; + if($DEBUG) echo "
      chkSQL=$chkSQL
      "; + $chkResult = mysqli_query($pubConn,$chkSQL); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($chkResult); + if ($language=='eng') $samePassAlert="new password is the same with the old password!"; + // echo "$samePassAlert"; + if(mysqli_num_rows($chkResult) > 0){ + echo ""; + exit; + } + if ( 1 == $privilegeFlag ) { + $str_sql= "UPDATE $table_name + SET realName = '$realName',password = md5('$password'),privilege = '$privilege',updateTime=CURRENT_TIMESTAMP,alterPwd = '0',loginNum='1' + WHERE userName ='$userName' + "; + + + $pwdHistory_sql="REPLACE INTO $history_name + (realName,userName,password,configNum,insertTime) + VALUES + ('$realName','$userName','$new_password_1','$configNum',CURRENT_TIMESTAMP) + "; + $result1=mysqli_query($pubConn,$pwdHistory_sql); + + + } else{ + $str_sql= "UPDATE $table_name + SET realName = '$realName',password = md5('$password'),updateTime=CURRENT_TIMESTAMP,alterPwd = '0',loginNum='1' + WHERE userName ='$userName' + "; + + + $pwdHistory_sql="REPLACE INTO $history_name + (realName,userName,password,configNum,insertTime) + VALUES + ('$realName','$userName','$new_password_1','$configNum',CURRENT_TIMESTAMP) + "; + $result1=mysqli_query($pubConn,$pwdHistory_sql); + + + } + }else{ //涓嶄慨鏀瑰瘑鐮� + if ( 1 == $privilegeFlag ) { + $str_sql= "UPDATE $table_name + SET realName = '$realName',privilege = '$privilege',updateTime=CURRENT_TIMESTAMP + WHERE userName ='$userName' + "; + } else { + $str_sql= "UPDATE $table_name + SET realName = '$realName',updateTime=CURRENT_TIMESTAMP + WHERE userName ='$userName' + "; + } + } + //echo "
      str_sql=$str_sql"; + $log_name=$strEditUser."\'$userName\'"; + $result = mysqli_query($pubConn,$str_sql); + if ($result) + $log_name = $log_name.$strSuccessful; + else + $log_name = $log_name.$strFail; + insertLog("$log_name"); + + if(!$result){ //鎻掑叆鏃ュ織涓殑$result + echo ""; + $userName=$old_userNamer; + }else{ + echo ""; + } + echo " "; + } +} + +//鍒犻櫎鐢ㄦ埛 + +//if($delete) +if ($confMode == 'del') + { + //echo "
      userName=$userName"; + $sureDel = $_POST['sureDel']; + //$userName=$_REQUEST['userName']; + echo "$sureDel
      "; + if (($sureDel == 'Yes')||($sureDel=='鏄�')){ + $delSql="DELETE FROM $table_name WHERE userName='$userName'"; + if($DEBUG) echo "
      delSql = $delSql"; + $del_result = mysqli_query($pubConn,$delSql); + //echo "
      del_result=$del_result"; + if ($del_result==1){ + echo "
      $strDelete $strSuccessful"; + $log_name=$strDelUser."\'$userName\'".$strSuccessful; + insertLog("$log_name"); + } + echo " "; + } + elseif (($sureDel == 'No')||($sureDel=='鍚�')){ + echo "
      $strDelCancel"; + echo " "; + //$confMode='edit'; + } + else{ + echo "$strSureDel$userName ?"; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + adjust_content_tail(); + exit(); + } + } + +adjust_content_tail(); + + ?> + + + diff --git a/wxc2_omc/security/login/captcha.php b/wxc2_omc/security/login/captcha.php new file mode 100755 index 0000000..2fda657 --- /dev/null +++ b/wxc2_omc/security/login/captcha.php @@ -0,0 +1,49 @@ + diff --git a/wxc2_omc/security/login/login.php b/wxc2_omc/security/login/login.php new file mode 100755 index 0000000..5a0d1a2 --- /dev/null +++ b/wxc2_omc/security/login/login.php @@ -0,0 +1,234 @@ +selectedLanguage=$selectedLanguage"; +if($DEBUG) echo "
      selectedOmcPath=$selectedOmcPath"; + + +global $userName, $userPwd; +if(isset($userName) && $userName != $_POST['userName']) $userName = $_POST['userName']; +if(!isset($userName)) $userName = $_POST['userName']; +if(isset($userPwd) && $userPwd != $_POST['userPwd']) $userPwd =$_POST['userPwd']; +if(!isset($userPwd)) $userPwd = $_POST['userPwd']; + + + +$login = $_REQUEST['login']; + +if(strlen($login) > 0){ + if($DEBUG) echo "
      selectedLanguage=$selectedLanguage"; + if($DEBUG) echo "
      userName=".$_POST['userName']; + if($DEBUG) echo "
      userPwd=".$_POST['userPwd']; + $isChkPass = 0; + //检查用户是否存在,密码是否正确 + $chkSQL="SELECT privilege + FROM $userTable + WHERE userName='$userName' AND password=md5('$userPwd') + "; + if($DEBUG) echo "
      chkSQL=$chkSQL
      "; +// $chkResult = mysqli_query($pubConn,$chkSQL); + $chkResult = mysqli_query($pubConn,$chkSQL); + echo mysqli_error($pubConn); +// $row = mysqli_fetch_array($chkResult); + $row = mysqli_fetch_array($chkResult); + if(mysqli_num_rows($chkResult) > 0){ + $isChkPass = 1; + } + //通过检查 + if($isChkPass == 1){ + //将用户资料导入session + $_SESSION['userInfo'] = null; + $userInfo = array("ID","privilege","IP","language","refresh_time","PWD"); + $userInfo['ID'] =$userName; + $userInfo['privilege']=$row['privilege']; + $userInfo['IP'] =$userIP; + $userInfo['language'] =$selectedLanguage; + $userInfo['refresh_time'] =time(); + $userInfo['PWD'] = $userPwd; + $_SESSION['userInfo'] = $userInfo; + insertLog("Log in"); + if($DEBUG) echo "
      userInfo[ID]=$userInfo[ID]"; + if($DEBUG) echo "
      userInfo[privilege]=$userInfo[privilege]"; + if($DEBUG) echo "
      userInfo[IP]=$userInfo[IP]"; + if($DEBUG) echo "
      userInfo[language]=$userInfo[language]"; + //print_r( $userInfo); + ?> + + + + + + + +





      +
      " onsubmit="return Check(this)" > + + + + + + + + + +
      + +


      +
      + + + + + + + + + + + + + + + +
      + + + +
      + $strUserName"; + ?> + + +
      + $strPassword"; + ?> + + +
      + "; + echo "   "; + echo ""; + ?> +
      +
      + "; + }else{ + echo ""; + } + ?> +
      R2409.2
      +
      + + diff --git a/wxc2_omc/security/login/login.php_centos b/wxc2_omc/security/login/login.php_centos new file mode 100755 index 0000000..acf0589 --- /dev/null +++ b/wxc2_omc/security/login/login.php_centos @@ -0,0 +1,212 @@ +selectedLanguage=$selectedLanguage"; +if($DEBUG) echo "
      selectedOmcPath=$selectedOmcPath"; + +if(strlen($login) > 0){ + if($DEBUG) echo "
      selectedLanguage=$selectedLanguage"; + if($DEBUG) echo "
      userName=$userName"; + if($DEBUG) echo "
      userPwd=$userPwd"; + $isChkPass = 0; + //检查用户是否存在,密码是否正确 + $chkSQL="SELECT privilege + FROM $userTable + WHERE userName='$userName' AND password=password('$userPwd') + "; + if($DEBUG) echo "
      chkSQL=$chkSQL"; + $chkResult = mysqli_query($pubConn,$chkSQL); + echo mysqli_error($pubConn); + $row = mysqli_fetch_array($chkResult); + if(mysqli_num_rows($chkResult) > 0){ + $isChkPass = 1; + } + //通过检查 + if($isChkPass == 1){ + //将用户资料导入session + session_register("userInfo"); //保存用户帐号信息 + $userInfo = array(ID,privilege,IP,language); + $userInfo[ID] =$userName; + $userInfo[privilege]=$row[privilege]; + $userInfo[IP] =$userIP; + $userInfo[language] =$selectedLanguage; + $userInfo[refresh_time] =time(); + insertLog("Log in"); + if($DEBUG) echo "
      userInfo[ID]=$userInfo[ID]"; + if($DEBUG) echo "
      userInfo[privilege]=$userInfo[privilege]"; + if($DEBUG) echo "
      userInfo[IP]=$userInfo[IP]"; + if($DEBUG) echo "
      userInfo[language]=$userInfo[language]"; + ?> + + + + + + + +





      +
      " onsubmit="return Check(this)" > + + + + + + + + + +
      + +


      +
      + + + + + + + + + + + + + + + +
      + + + +
      + $strUserName"; + ?> + + +
      + $strPassword"; + ?> + + +
      + "; + echo "   "; + echo ""; + ?> +
      +
      + "; + }else{ + echo ""; + } + ?> +
      R9.2(V9.02.00.015)
      +
      + + diff --git a/wxc2_omc/security/login/logout.php b/wxc2_omc/security/login/logout.php new file mode 100755 index 0000000..a3070ea --- /dev/null +++ b/wxc2_omc/security/login/logout.php @@ -0,0 +1,44 @@ +"; +//echo "\n window.location.href='./login.php';"; +echo "\n window.close();"; +echo "\n "; +exit(); +?> diff --git a/wxc2_omc/security/login/select.php b/wxc2_omc/security/login/select.php new file mode 100755 index 0000000..e69de29 diff --git a/wxc2_omc/security/login/term_agreement.php b/wxc2_omc/security/login/term_agreement.php new file mode 100755 index 0000000..ae020b0 --- /dev/null +++ b/wxc2_omc/security/login/term_agreement.php @@ -0,0 +1,39 @@ + + + +Term

      +
      +You are accessing a U.S. Government (USG) Information System (IS) that is provided for USGauthorized use only. By using this IS (which includes any device attached to this IS), you consent to the following conditions:
      +
        +
      • +-The USG routinely intercepts and monitors communications on this IS for purposes including, but not limited to, penetration testing, COMSEC monitoring, network operations and defense, personnel misconduct (PM), law enforcement (LE), and counterintelligence (CI) investigations. +
      • +
      • +-At any time, the USG may inspect and seize data stored on this IS. +
      • +
      • +-Communications using, or data stored on, this IS are not private, are subject to routine monitoring, interception, and search, and may be disclosed or used for any USG-authorized purpose. +
      • +
      • +-This IS includes security measures (e.g., authentication and access controls) to protect USG interests-not for your personal benefit or privacy. +
      • +
      • +-Notwithstanding the above, using this IS does not constitute consent to PM, LE, or CI +investigative searching or monitoring of the content of privileged communications, or work +product, related to personal representation or services by attorneys, psychotherapists, or clergy, +and their assistants. +
      • +
      +Such communications and work product are private and confidential. See User Agreement for details.

      +

      + +       + +
      +
      + + + + diff --git a/wxc2_omc/security/logout/logout.php b/wxc2_omc/security/logout/logout.php new file mode 100755 index 0000000..cfae544 --- /dev/null +++ b/wxc2_omc/security/logout/logout.php @@ -0,0 +1,30 @@ + "; +echo "\n close();"; +echo "\n "; +exit(); +?> \ No newline at end of file diff --git a/wxc2_omc/security/operLog/operLogDel.php b/wxc2_omc/security/operLog/operLogDel.php new file mode 100755 index 0000000..466cecc --- /dev/null +++ b/wxc2_omc/security/operLog/operLogDel.php @@ -0,0 +1,59 @@ + "; + }else{ + echo ""; + } + +}if($no_del){ + echo " "; +}else{ + $del_sql = isset($del_sql) ? stripslashes($del_sql) : ''; + echo "
      "; + echo "
      "; + echo "$strAreYouSureToDelete?"; + echo ""; + echo "
           "; + echo "   "; + echo "
      "; +} + +?> + + + diff --git a/wxc2_omc/security/operLog/operLogExport.php b/wxc2_omc/security/operLog/operLogExport.php new file mode 100755 index 0000000..99db9d9 --- /dev/null +++ b/wxc2_omc/security/operLog/operLogExport.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/wxc2_omc/security/operLog/operLogList_down.php b/wxc2_omc/security/operLog/operLogList_down.php new file mode 100755 index 0000000..792ea67 --- /dev/null +++ b/wxc2_omc/security/operLog/operLogList_down.php @@ -0,0 +1,236 @@ + + + + + + +"; +if( isset($sel_date) && ($sel_date != -1) && ($sel_date != '') ){ + $bgn_time=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y"))); + $end_time=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y"))); +} +elseif($sel_date == -1 || $sel_date==''){ + $bgn_time=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y"))); + $end_time=date("Y-m-d H:i:s", mktime()); +} +$where=" WHERE datetime>='$bgn_time' AND datetime<='$end_time'"; +if($DEBUG) echo "where = $where
      "; +if (isset($number_of_records)!=1){ + $initial_record = 0; + $select_sql_all="SELECT count(*) as number_of_records FROM $sysoperlog_table ".$where; + if($DEBUG) echo "
      select_sql_all=$select_sql_all"; + $result = mysqli_query($pubConn,$select_sql_all); + $record = mysqli_fetch_object($result); + $number_of_records = $record->number_of_records; +} +$select = "SELECT $sysoperlog_table.userName as userName, + $sysoperlog_table.datetime as datetime, + $sysoperlog_table.remark as remark, + $sysoperconf_table.$show_log_def as logType + FROM $sysoperlog_table,$sysoperconf_table + "; +$order = " ORDER BY $sort_field $sort_direction "; +$initial_record = isset($initial_record)?$initial_record:'0'; +$limit = " LIMIT $initial_record, $number_records_to_display "; +//echo "a=$order"; +$log_sql= $select.$where.$order.$limit; +if($DEBUG) echo "
      log_sql=$log_sql"; +$log_result = @mysqli_query($pubConn,$log_sql); +$log_rows = @mysqli_fetch_array($log_result); +echo mysqli_error($pubConn); +if(!$log_rows){ + echo "$strNotFindRecord"; + exit(); +} +//锟斤拷锟斤拷页锟斤拷 +if (!$all_page_num){ + $page_num= ($initial_record / $number_records_to_display) +1; //锟斤拷页页锟斤拷 + $all_page_num= ceil($number_of_records / $number_records_to_display); //锟斤拷页锟斤拷 +} +?> + + += 1) { + //锟斤拷锟斤拷锟角匡拷锟狡凤拷页锟斤拷示锟斤拷锟斤拷锟捷憋拷锟斤拷 + $next_index = $initial_record + $number_records_to_display; //锟斤拷页锟侥斤拷锟斤拷锟斤拷目 + if ($next_index > $number_of_records){ + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0) { + $prev_index = 0; + } + } +$show_initital_record=$initial_record+1; +?> + +
      "> + + + + + +
      +  $show_initital_record - $next_index, ($strTotalRecords:$number_of_records )   "; ?> + + "; + } + else{ + echo ""; + } + echo "Previous $strPreviousPage "; + }else{ + echo "Previous $strPreviousPage "; + } + + echo ""; + + // NEW: Display a link for the next set of records. + if ($next_index != $number_of_records && $number_of_records >0) { + $t1 = "initial_record=$next_index&number_of_records=$number_of_records"; + $t2 = "userName=$userName&operTypeNo=$operTypeNo"; + $t3 = " bgn_time=$bgn_time&end_time=$end_time"; + if(isset($sel_date)==1){ + $t4="sel_date=$sel_date"; + echo ""; + }else{ + echo ""; + } + echo "$strNextPage Next"; + }else{ + echo "$strNextPage Next"; + } + ?> +
      + + + + + + + + + + + + + +
      $strOperator";?>$strTime";?>
         
      + + + + + + +
      + + + diff --git a/wxc2_omc/security/operLog/operLogList_index.php b/wxc2_omc/security/operLog/operLogList_index.php new file mode 100755 index 0000000..e0e11d6 --- /dev/null +++ b/wxc2_omc/security/operLog/operLogList_index.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/security/operLog/operLogList_up.php b/wxc2_omc/security/operLog/operLogList_up.php new file mode 100755 index 0000000..9b70e91 --- /dev/null +++ b/wxc2_omc/security/operLog/operLogList_up.php @@ -0,0 +1,88 @@ +$strLogOperation"; +$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y"))); +$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y"))); +$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y"))); +$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y"))); +$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y"))); +$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y"))); +$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y"))); +?> + + + +
      +"; +echo ""; +echo ""; +echo "$ThisPage"; +echo ""; +echo ""; +$helpId = "4.2"; +showHelp($helpId); +echo ""; +echo ""; +echo ""; + +echo "$strDate:"; +?> + +"; +echo ""; + +echo ""; +echo ""; +echo ""; +adjust_title_tail_frame("up"); +adjust_content_head_frame("up"); +adjust_content_tail_frame("up"); +?> + + +
      + + + diff --git a/wxc2_omc/security/sub_inc/.sub_chinese_gb.inc.swp b/wxc2_omc/security/sub_inc/.sub_chinese_gb.inc.swp new file mode 100755 index 0000000..6c3bc6b Binary files /dev/null and b/wxc2_omc/security/sub_inc/.sub_chinese_gb.inc.swp differ diff --git a/wxc2_omc/security/sub_inc/sub_chinese_gb.inc b/wxc2_omc/security/sub_inc/sub_chinese_gb.inc new file mode 100755 index 0000000..7ec20a4 --- /dev/null +++ b/wxc2_omc/security/sub_inc/sub_chinese_gb.inc @@ -0,0 +1,72 @@ + \ No newline at end of file diff --git a/wxc2_omc/security/sub_inc/sub_config.inc b/wxc2_omc/security/sub_inc/sub_config.inc new file mode 100755 index 0000000..eddcb4c --- /dev/null +++ b/wxc2_omc/security/sub_inc/sub_config.inc @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/wxc2_omc/security/sub_inc/sub_english.inc b/wxc2_omc/security/sub_inc/sub_english.inc new file mode 100755 index 0000000..5e88b95 --- /dev/null +++ b/wxc2_omc/security/sub_inc/sub_english.inc @@ -0,0 +1,74 @@ +=6 and <=16 digits"; +$strOperationAuthorityCode ="Operation authority code"; +$strRecoredsPage ="Records/page"; +$strSuggestedLengthEqualSixcharacters ="suggested length = 6"; +$strTimeOfLastAccountInfoUpdate ="Time of last account update"; +$strUserIp ="Operator IP"; +$strWrongOption ="Wrong option"; +$strPleaseReviewTheTableCarefully ="Review setup before add operator!"; + +//old sub_english.inc file +$strCSVDataFile = "CSV data file"; +$strCSVDataOperation = "CSV file"; +$strDataFile = "Data file"; +$strLastUploadTime = "Last upload time"; +$strLastDownloadTime = "Last download time"; +$strDataUploadOverTime = "Data upload over time"; +$strDataUploadError = "Data upload error"; +$strDataUploadOK = "Data upload OK"; +$strUploadTo = "Upload To"; +$strNoteUploadParameter = "Note: don't upload between global parameters and subsys parameters."; +$strUploadFileNote ="Please select a file to upload."; +$strClickHereToUploadFile="Click here to upload file"; +$strEnableDaemon = "Enable"; +$strSetMemoryFailure ="Set share memory failure"; +$strSelectFile ="Select file"; +$strIPAddress ="IP destination"; +$strMessageLength ="Package length"; +$strTFTPFileTransfer ="TFTP file transfer"; +$strFileUploadSuccessToServer ="Upload file success to server"; +$strDownloadSuccessToSwitch ="Download success to switch"; +$strDownloadFailureToSwitch ="Download failure to switch"; +$strFileName ="File name"; + +//added by lilong +$loginTitle ="Logon liteCore Management Console"; +$strUploadSucc ="Upload successful"; +$strUploadUnSucc ="Upload Unsuccessful"; +$strUserName ="User:"; +$strPassword ="Password:"; +$strLogin ="Login"; +$strCancel ="Cancel"; +$strEdit ="Edit"; +$strAdd ="Add"; +$strDelete ="Delete"; +$strYes ="Yes"; +$strNo ="No"; +$strSureDel ="Are you sure to delete user "; +$strDelCancel ="Delete canceled"; +$strList ="List"; +$strDelUser ="Delete user "; +$strAddUser ="Add user "; +$strEditUser ="Edit user"; +$strCDR ="CDR"; +$strOther ="Other"; +$strLogOperation ="Operation log"; +$strDescription ="Events"; +$strCdrDdownload ="CDR download"; +$strDATAnetwork ="Network data"; +$strDATAaccount ="Account data"; +$strDATAperformance ="Performance data"; +$strDATAdefine ="Define data"; +$strPrivilege ="Privilege"; +$strAccessMenu ="Access menu"; +?> \ No newline at end of file diff --git a/wxc2_omc/security/userManage/.userList.php.swp b/wxc2_omc/security/userManage/.userList.php.swp new file mode 100755 index 0000000..de29bfb Binary files /dev/null and b/wxc2_omc/security/userManage/.userList.php.swp differ diff --git a/wxc2_omc/security/userManage/batchAddConf.php b/wxc2_omc/security/userManage/batchAddConf.php new file mode 100755 index 0000000..1ca3222 --- /dev/null +++ b/wxc2_omc/security/userManage/batchAddConf.php @@ -0,0 +1,198 @@ + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strAdvanced > $strOmcUser"; + echo "
      ";*/ +//adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; +$pubDb ='OMC_PUB'; +$table_name ='sysUser'; /*密码强度表*/ + +if($DEBUG) echo "userInfo[ID] = $userInfo[ID]
      "; +$confMode=$_REQUEST['confMode']; +$timeOut=$_REQUEST['timeOut']; //字符Unicode类别 +if($DEBUG) echo "confMode=$confMode
      "; +$userName=$_REQUEST['userName']; +$sysUser="sysUser"; +?> + + + + + + +
      " enctype="multipart/form-data" method="POST" name="subsData" > + + + + + + + + + + + + + + + + + + +
      + + + +
      + +
      : + + + + +
      + +
      +
      + + $impRemark
      "; +} +/* $content = @file_get_contents($txt); + if ($content === false) { + echo '无法读取文件内容'; + } elseif (strlen($content) === 0) { + echo '文件没有内容'; + } else { + echo '不是空文件'; + }*/ + + if( $_FILES['impFile']['name']){ + + $test=file_get_contents($_FILES['impFile']['tmp_name']); + if($DEBUG){ + echo mb_detect_encoding($test, array('GB2312','GBK','UTF-16','UCS-2','UTF-8','BIG5','ASCII')); + print_r(explode(",",$test)); + } + $array=explode(",",$test); + $newArr=array_chunk($array,4); + // print_r($array); + // echo print_r($newArr[1][0]); + // echo sizeof($newArr); + // echo sizeof($array); + // foreach($newArr[0] as $value) + if(sizeof($array)%4==0){ + for($i=0;$i"; + echo mysqli_error($pubConn); + }else { + $j=$i+1; + } + } + }//end for + echo ""; + + echo " "; + + }else{ + echo ""; + + + } + } + + + + + +?> + + + + + + + diff --git a/wxc2_omc/security/userManage/blackPwdConf.php b/wxc2_omc/security/userManage/blackPwdConf.php new file mode 100755 index 0000000..f17d34f --- /dev/null +++ b/wxc2_omc/security/userManage/blackPwdConf.php @@ -0,0 +1,266 @@ + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strAdvanced > $strOmcUser"; + echo "
      ";*/ +//adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; +$pubDb ='OMC_PUB'; +$table_name ='sysBlackPwd'; + +if($DEBUG) echo "userInfo[ID] = $userInfo[ID]
      "; +$confMode=$_REQUEST['confMode']; +$userName=$_REQUEST['userName']; +$password=$_REQUEST['blackPwd']; +if($DEBUG) echo "confMode=$confMode
      "; +?> + + + + + +
      " method="POST" onsubmit="return Check('',this,'')" name="operForm"> + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      +

      +   "; + echo "  "; + echo "  "; + ?> + +

      +
      + + +realName=$realName,userName=$userName,password=$password,privilege=$privilege,updateTime=$updateTime"; +$uadd=$_POST['uadd']; +if($uadd){ + $password=$_POST['password']; + + + $select_sql ="SELECT count(*) as number_of_records + FROM $table_name + WHERE blackPwd='$password' "; //黑名单密码相同则不添加 + $result = mysqli_query($pubConn,$select_sql); + $record = @mysqli_fetch_object($result); + $number_of_records = $record->number_of_records; + //echo "
      number_of_records=$number_of_records"; + echo "
      select_sql=$select_sql"; + + if($number_of_records){ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + }else{ +// $str_sql="REPLACE INTO $table_name +// ( realName,userName,password,privilege,updateTime) +// VALUES +// ('$realName','$userName',md5('$password'),'$privilege',CURRENT_TIMESTAMP) +// "; + + + $str_sql="REPLACE INTO $table_name + ( blackPwd,write_time) + VALUES + ('$password',CURRENT_TIMESTAMP) + "; + + + + $result=mysqli_query($pubConn,$str_sql); + // echo "sql=$str_sql"; + echo mysqli_error($pubConn); + if(!$result){ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + }else{ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + } + } +} + + + +//if($delete) +if ($confMode == 'del') +{ + //echo "
      userName=$userName"; + $sureDel = $_POST['sureDel']; + //$userName=$_REQUEST['userName']; +if (($sureDel == 'Yes')||($sureDel =='是')){ + $delSql="DELETE FROM $table_name WHERE blackPwd='$password'"; + if(0) echo "
      delSql = $delSql"; + $del_result = mysqli_query($pubConn,$delSql); + //echo "
      del_result=$del_result"; + if ($del_result==1){ + echo "
      $strDelete $strSuccessful"; + + } + echo " "; + } + elseif (($sureDel == 'No')||($sureDel=='否')){ + echo "
      $strDelCancel"; + echo " "; + + //$confMode='edit'; + } + else{ + echo "$sureDel"; + echo "$strSureDelPwd$password ?"; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + adjust_content_tail(); + exit(); + } +} + + + + + + + + + +adjust_content_tail(); + +?> + + + diff --git a/wxc2_omc/security/userManage/blackPwdList.php b/wxc2_omc/security/userManage/blackPwdList.php new file mode 100755 index 0000000..6b26722 --- /dev/null +++ b/wxc2_omc/security/userManage/blackPwdList.php @@ -0,0 +1,178 @@ + + +"; +echo ""; +?> + + +
      + + + + + + + + + + + + + + +"; +echo ""; + +$userInfo = $_SESSION['userInfo']; +if($DEBUG) +{ + echo "userInfo[privilege] = $userInfo[privilege]
      "; + echo "userInfo[ID] = $userInfo[ID]
      "; +} +$table_name = 'sysBlackPwd'; +//$table_name_alluser = 'sysUser'; +$sort_field = 'write_time'; +$sort_direction = 'ASC'; +$number_records_to_display = 210; +//鏌ヨ榛戝悕鍗曟湁澶氬皯鏉¤褰� 浠ヤ究鍒嗛〉 + + + +/*$blackTable='sysBlackPwd'; + + $blackSQL="SELECT blackPwd + FROM $blackTable + "; + $blackResult = mysqli_query($pubConn,$blackSQL); + while($allBlackRow=mysqli_fetch_array($blackResult)){ + $blackRow[]=$allBlackRow; + } + + // print_r($blackRow); +echo $blackRow[0]['blackPwd']; + + + */ + + +if (!$initial_record) +{ + $initial_record = 0; + $str_sql_all ="SELECT count(*) as number_of_records FROM $table_name "; + $result = @mysqli_query($pubConn,$str_sql_all); + $record = @mysqli_fetch_object($result); + $number_of_records = $record->number_of_records; +} + +if ($number_of_records >= 1) +{ + //涓嬮潰鏄帶鍒跺垎椤垫樉绀猴紝浼犻�掑彉閲� + $next_index = $initial_record + $number_records_to_display; //鏈〉鐨勭粨鏉熸暟鐩� + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0) + { + $prev_index = 0; + } +} + +//鎶婅褰曟煡璇㈠嚭鏉� 涓斾互write_time涓烘帓搴忚鍒� +$str_sql="SELECT * + FROM $table_name + ORDER BY $sort_field $sort_direction + LIMIT $initial_record, $number_records_to_display"; + +// echo "
      str_sql=$str_sql"; +$result = mysqli_query($pubConn,$str_sql); +$myrows = @mysqli_fetch_array($result); +//鍊樿嫢娌℃湁鏁版嵁 +if(!$myrows) +{ + echo "$strNotFindRecord"; + exit(); +} +?> + +
      + + + + + +
      + +  $initial_record - $next_index, ($strTotalRecords: $number_of_records )   "; + ?> +
      + + + + + + + + + + + "; + + do{ + echo ""; + echo ""; //瀵嗙爜 + + echo ""; //娣诲姞榛戝悕鍗曞瘑鐮佺殑鏃堕棿 + echo ""; + + //echo "$str_sql_alluser
      "; + //echo "user prive = $myrows_pri[privilege]"; + /* if ( ($myrows_pri['privilege']<$userInfo['privilege']) && ($myrows['userName'] != $userInfo['ID']) ) + { + echo ""; + } + else + { + echo ""; + }*/ + echo ""; + }while($myrows=@mysqli_fetch_array($result)); + + ?> +
       
      $myrows[blackPwd]$myrows[write_time]$strDelete$strForceOff 
      + + + + + diff --git a/wxc2_omc/security/userManage/onlineUserlist.php b/wxc2_omc/security/userManage/onlineUserlist.php new file mode 100755 index 0000000..baf0d6e --- /dev/null +++ b/wxc2_omc/security/userManage/onlineUserlist.php @@ -0,0 +1,188 @@ + + +"; +echo ""; +echo ""; +echo "$strOnlineSysUser"; +echo ""; +echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +$userInfo = $_SESSION['userInfo']; +if($DEBUG) + { + echo "userInfo[privilege] = $userInfo[privilege]
      "; + echo "userInfo[ID] = $userInfo[ID]
      "; + } + $table_name = 'sysOnlineUser'; + $table_name_alluser = 'sysUser'; + $sort_field = 'userName,login_time'; + $sort_direction = 'ASC'; + $number_records_to_display = 210; + + + + +//超时自动登出 +if(!isset($userInfo)) $userInfo = $_SESSION['userInfo']; +$sessionName=$userInfo['ID']; +$outime_table='sysUser'; +$timeSql=" + SELECT timeOut + FROM $outime_table + WHERE userName='$sessionName' + "; + +if($DEBUG) echo "timesql=$timeSql,userName=$sessionName"; +$timeResult = mysqli_query($pubConn,$timeSql); +$timeRow= mysqli_fetch_array($timeResult); +echo mysqli_error($pubConn); +$outTime =$timeRow['timeOut']; +//echo $outTime; +if(!$outTime) { + $outTime=600; + ?> + var Timeout='$Timeout';alert(Timeout); + + window.top.location = \"../../security/login/login.php\"; + "; + + // echo retJson(401,'登录过期,请重新登录',''); + } else { + $_SESSION['expiretime'] = time() + $outTime; // 刷新时间戳 + } +}else{ + $_SESSION['expiretime'] = time() + $outTime; // 5小时后过期 +} +//end + + + + + + + + + if (!$initial_record) + { + $initial_record = 0; + $str_sql_all ="SELECT count(*) as number_of_records FROM $table_name "; + $result = @mysqli_query($pubConn,$str_sql_all); + $record = @mysqli_fetch_object($result); + $number_of_records = $record->number_of_records; + } + + if ($number_of_records >= 1) + { + //下面是控制分页显示,传递变量 + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0) + { + $prev_index = 0; + } + } + $due_time=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s")-20,date("m"),date("d"),date("Y"))); + $str_sql="SELECT * + FROM $table_name WHERE refresh_time > '$due_time' + ORDER BY $sort_field $sort_direction + LIMIT $initial_record, $number_records_to_display"; + + // echo "
      str_sql=$str_sql"; + $result = mysqli_query($pubConn,$str_sql); + $myrows = @mysqli_fetch_array($result); + if(!$myrows) + { + echo "$strNotFindRecord"; + exit(); + } +?> + + + + + + +
      + +  $initial_record - $next_index, ($strTotalRecords: $number_of_records )   "; + ?> +
      + + + + + + + + +"; + +do{ + echo ""; + echo ""; + echo ""; + echo ""; + $str_sql_alluser="SELECT privilege FROM $table_name_alluser WHERE userName='$myrows[username]'"; + $result_pri = mysqli_query($pubConn,$str_sql_alluser); + $myrows_pri = @mysqli_fetch_array($result_pri); + //echo "$str_sql_alluser
      "; + //echo "user prive = $myrows_pri[privilege]"; +/* if ( ($myrows_pri['privilege']<$userInfo['privilege']) && ($myrows['userName'] != $userInfo['ID']) ) + { + echo ""; + } + else + { + echo ""; + }*/ + echo ""; + }while($myrows=@mysqli_fetch_array($result)); + +?> +
      $myrows[username]$myrows[ip]$myrows[login_time]$strForceOff 
      + + + diff --git a/wxc2_omc/security/userManage/pwdOutTimeConf.php b/wxc2_omc/security/userManage/pwdOutTimeConf.php new file mode 100755 index 0000000..cab58e2 --- /dev/null +++ b/wxc2_omc/security/userManage/pwdOutTimeConf.php @@ -0,0 +1,203 @@ + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strAdvanced > $strOmcUser"; + echo "
      ";*/ +//adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; +$pubDb ='OMC_PUB'; +$table_name ='sysUser'; /*密码强度表*/ + +if($DEBUG) echo "userInfo[ID] = $userInfo[ID]
      "; +$confMode=$_REQUEST['confMode']; +$timeOut=$_REQUEST['timeOut']; //字符Unicode类别 +if($DEBUG) echo "confMode=$confMode
      "; +$userName=$_REQUEST['userName']; + +?> + + + + + " method="POST" onsubmit="return question_Validator(this)" name="operForm" > + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +

      +   "; //配置按钮 + echo "  "; + echo "  "; + ?> + +

      +
      + + +realName=$realName,userName=$userName,password=$password,privilege=$privilege,updateTime=$updateTime"; +$config=$_POST['config']; +if($config){ +//获取输入的数据, + + $select_sql ="SELECT count(*) as number_of_records + FROM $table_name + WHERE timeOut='$timeOut' and userName='$userName'"; //配置并没有改动,则不添????? + + + $result = mysqli_query($pubConn,$select_sql); + $record = @mysqli_fetch_object($result); + $number_of_records = $record->number_of_records; + //echo "
      number_of_records=$number_of_records"; + if($DEBUG) echo "
      select_sql=$select_sql"; + + if($number_of_records){ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + }else{ +// $str_sql="REPLACE INTO $table_name +// ( realName,userName,password,privilege,updateTime) +// VALUES +// ('$realName','$userName',md5('$password'),'$privilege',CURRENT_TIMESTAMP) +// "; + +//修改空闲超时时间 + $str_sql="UPDATE + $table_name + set timeout='$timeOut' WHERE userName='$userName' + "; + + + + $result=mysqli_query($pubConn,$str_sql); + // echo "sql=$str_sql"; + echo mysqli_error($pubConn); + if(!$result){ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + }else{ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + } + } +} + +adjust_content_tail(); + +?> + + + + + + + diff --git a/wxc2_omc/security/userManage/pwdStreng.php b/wxc2_omc/security/userManage/pwdStreng.php new file mode 100755 index 0000000..71c41d5 --- /dev/null +++ b/wxc2_omc/security/userManage/pwdStreng.php @@ -0,0 +1,294 @@ + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strAdvanced > $strOmcUser"; + echo "
      ";*/ +//adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; +$pubDb ='OMC_PUB'; +$table_name ='sysPwdStrength'; /*密码强度表*/ + +if($DEBUG) echo "userInfo[ID] = $userInfo[ID]
      "; +$confMode=$_REQUEST['confMode']; +$ucCategory=$_POST['ucCategory']; //字符Unicode类别 +$maxLength=$_REQUEST['maxLength']; +$maxLoginNum=$_POST['maxLoginNum']; +$delayedTime=$_POST['delayedTime']; + +if($DEBUG) echo "confMode=$confMode
      "; +if($DEBUG) echo "confMode=$ucCategory
      "; +if(!isset($ucCategory)){ +$ucCategory=3; +} +if(!isset($maxLength)){ +$maxLength=127; +} +if(!isset($maxLoginNum)){ +$maxLoginNum=5; +} +if(!isset($delayedTime)){ +$delayedTime=120; +} + +?> + + + + + +
      " method="POST" onsubmit="return question_Validator(this)" name="operForm" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      +
      +
      +
      +

      +   "; //配置按钮 + echo "  "; + echo "  "; + ?> + +

      +
      + + +number_of_records; + //echo "
      number_of_records=$number_of_records"; + if(1) echo "
      select_sql=$select_sql"; + + if($number_of_records){ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + }else{ +// $str_sql="REPLACE INTO $table_name +// ( realName,userName,password,privilege,updateTime) +// VALUES +// ('$realName','$userName',md5('$password'),'$privilege',CURRENT_TIMESTAMP) +// "; + +//修改系统强度表的强度 + $str_sql="UPDATE $table_name + SET ucCategory='$ucCategory',maxLength='$maxLength',write_time=CURRENT_TIMESTAMP,maxLoginNum='$maxLoginNum',delayedTime='$delayedTime',pwdOutTime='$pwdOutTime' +WHERE keyId=1 + "; + + + $result=mysqli_query($pubConn,$str_sql); + // echo "sql=$str_sql"; + echo mysqli_error($pubConn); + if(!$result){ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + }else{ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + } + } +} + +adjust_content_tail(); + +?> + + + + + diff --git a/wxc2_omc/security/userManage/timeConf.php b/wxc2_omc/security/userManage/timeConf.php new file mode 100755 index 0000000..d1d4b59 --- /dev/null +++ b/wxc2_omc/security/userManage/timeConf.php @@ -0,0 +1,202 @@ + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "$strAdvanced > $strOmcUser"; + echo "
      ";*/ +//adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; +$pubDb ='OMC_PUB'; +$table_name ='sysUser'; /*密码强度表*/ + +if($DEBUG) echo "userInfo[ID] = $userInfo[ID]
      "; +$confMode=$_REQUEST['confMode']; +$timeOut=$_REQUEST['timeOut']; //字符Unicode类别 +if($DEBUG) echo "confMode=$confMode
      "; +$userName=$_REQUEST['userName']; + +?> + + + + +
      " method="POST" onsubmit="return question_Validator(this)" name="operForm" > + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +

      +   "; //配置按钮 + echo "  "; + echo "  "; + ?> + +

      +
      + + +realName=$realName,userName=$userName,password=$password,privilege=$privilege,updateTime=$updateTime"; +$config=$_POST['config']; +if($config){ +//获取输入的数据, + + $select_sql ="SELECT count(*) as number_of_records + FROM $table_name + WHERE timeOut='$timeOut' and userName='$userName'"; //配置并没有改动,则不添�?? + + + $result = mysqli_query($pubConn,$select_sql); + $record = @mysqli_fetch_object($result); + $number_of_records = $record->number_of_records; + //echo "
      number_of_records=$number_of_records"; + if($DEBUG) echo "
      select_sql=$select_sql"; + + if($number_of_records){ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + }else{ +// $str_sql="REPLACE INTO $table_name +// ( realName,userName,password,privilege,updateTime) +// VALUES +// ('$realName','$userName',md5('$password'),'$privilege',CURRENT_TIMESTAMP) +// "; + +//修改空闲超时时间 + $str_sql="UPDATE + $table_name + set timeout='$timeOut' WHERE userName='$userName' + "; + + + + $result=mysqli_query($pubConn,$str_sql); + // echo "sql=$str_sql"; + echo mysqli_error($pubConn); + if(!$result){ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + }else{ + echo ""; + echo " "; + adjust_content_tail(); + exit(); + } + } +} + +adjust_content_tail(); + +?> + + + + + + diff --git a/wxc2_omc/security/userManage/userConf.php b/wxc2_omc/security/userManage/userConf.php new file mode 100755 index 0000000..f393997 --- /dev/null +++ b/wxc2_omc/security/userManage/userConf.php @@ -0,0 +1,456 @@ + + +"; + echo ""; + echo ""; + echo "Advanced > Administrator"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 1; +$pubDb ='OMC_PUB'; +$table_name ='sysUser'; +if (!isset($privilegeFlag)) { + $privilegeFlag = 0; +} +if($DEBUG) echo "userInfo[ID] = $userInfo[ID]
      "; +// echo "
      ";
      +// echo print_r($userInfo);
      +// echo "
      "; +$confMode=$_REQUEST['confMode']; +$userName=$_REQUEST['userName']; +if($DEBUG) echo "confMode=$confMode, userName=$userName
      "; +$old_userName=$_REQUEST['old_userName'];?> + + + + + +
      " method="POST" onsubmit="return question_Validator(this)" name="operForm"> + + + + + + + + + + "; + echo ""; + $userName = $myrows[userName]; + if ( $confMode == 'edit' ) { + echo ""; + } else { + echo ""; + } + echo ""; + echo ""; + + //修改用户资料 + if($userName != ''){ + ?> + + + + + + + + + + + + + + + + + + + + "; + echo ""; + echo ""; + echo ""; + echo ""; + $privilegeFlag = 1; + } else { + $privilegeFlag = 0; + } + ?> + + + + + + + + +
      + +
      " class="text">
      $strAccountName$myrows[userName]$strMoreThanSixAndLessThanSixteencharacters;
      () + : +
          + +
      " class="text">
      +
      $strOperationAuthority"; + //echo "$userInfo[privilege],$myrows[privilege]
      "; + if('accountManager' == $userInfo[ID]){ + $limitPrivilege = 4; + }else{ + $limitPrivilege = $userInfo[privilege]; + } + //echo "limitPrivilege = $limitPrivilege"; + echo ""; + echo "
      $strListedOption
      + + +  
      + + + + +

      +   "; + }else{ + echo "  "; + echo ""; + echo ""; + } + echo "  "; + echo "  "; + ?> + +

      +
      + + +number_of_records; + //echo "
      number_of_records=$number_of_records"; + //echo "
      select_sql=$select_sql"; + //echo "
      realName=$realName,userName=$userName,password=$password,privilege=$privilege,updateTime=$updateTime"; + if($number_of_records){ + echo ""; + $userName=$old_userNamer; + }else{ + $str_sql="REPLACE INTO $table_name + ( realName,userName,password,privilege,updateTime) + VALUES + ('$realName','$userName',md5('$password'),'$privilege',CURRENT_TIMESTAMP) + "; + $log_name=$strAddUser."\'$userName\'"; + $result=mysqli_query($pubConn,$str_sql); + if ($result) + $log_name=$log_name.$strSuccessful; + else + $log_name=$log_name.$strFail; + insertLog("$log_name"); + if(!$result){ + echo ""; + $userName=$old_userNamer; + }else{ + echo ""; + echo " "; + //echo " "; + adjust_content_tail(); + exit(); + } + } +}elseif($change){ //修改用户资料 + //修改记录时不能修改userName + $userName=$_POST['userName']; + $userName=$_POST['userName']; + $realName=$_POST['realName']; + $new_password_1=$_POST['new_password_1']; + $selected_permit=$_POST['selected_permit']; + $privilegeFlag=$_POST['privilegeFlag']; + if ( 1 == $privilegeFlag ) { + $user_permit = 0; + for($i=1; $i < sizeof($privilegeDefArr);$i++){ + if($selected_permit == $i){ + $user_permit=$privilegeDefArr[$i][permit]; + break; + } + } + $privilege=$user_permit; + } + if($userName != $old_userName){ + echo ""; + $userName=$old_userName; + }else{ + if($new_password_1 != ''){ //修改密码 + $password=$new_password_1; + if ( 1 == $privilegeFlag ) { + $str_sql= "UPDATE $table_name + SET realName = '$realName',password = md5('$password'),privilege = '$privilege',updateTime=CURRENT_TIMESTAMP + WHERE userName ='$userName' + "; + } else{ + $str_sql= "UPDATE $table_name + SET realName = '$realName',password = md5('$password'),updateTime=CURRENT_TIMESTAMP + WHERE userName ='$userName' + "; + } + }else{ //不修改密码 + if ( 1 == $privilegeFlag ) { + $str_sql= "UPDATE $table_name + SET realName = '$realName',privilege = '$privilege',updateTime=CURRENT_TIMESTAMP + WHERE userName ='$userName' + "; + } else { + $str_sql= "UPDATE $table_name + SET realName = '$realName',updateTime=CURRENT_TIMESTAMP + WHERE userName ='$userName' + "; + } + } + //echo "
      str_sql=$str_sql"; + $log_name=$strEditUser."\'$userName\'"; + $result = mysqli_query($pubConn,$str_sql); + if ($result) + $log_name = $log_name.$strSuccessful; + else + $log_name = $log_name.$strFail; + insertLog("$log_name"); + + if(!$result){ //插入日志中的$result + echo ""; + $userName=$old_userNamer; + }else{ + echo ""; + } + echo " "; + } +} + +//删除用户 + +//if($delete) +if ($confMode == 'del') + { + $sureDel = $_POST['sureDel']; + //echo "
      userName=$userName"; + if (($sureDel == 'Yes')||($sureDel=='是')){ + $delSql="DELETE FROM $table_name WHERE userName='$userName'"; + if($DEBUG) echo "
      delSql = $delSql"; + $del_result = mysqli_query($pubConn,$delSql); + //echo "
      del_result=$del_result"; + if ($del_result==1){ + echo "
      $strDelete $strSuccessful"; + $log_name=$strDelUser."\'$userName\'".$strSuccessful; + insertLog("$log_name"); + } + echo " "; + } + elseif (($sureDel == 'No')||($sureDel=='否')){ + echo "
      $strDelCancel"; + echo " "; + //$confMode='edit'; + } + else{ + echo "$strSureDel$userName ?"; + echo "
      "; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + adjust_content_tail(); + exit(); + } + } + +adjust_content_tail(); + + ?> + + diff --git a/wxc2_omc/security/userManage/userList.php b/wxc2_omc/security/userManage/userList.php new file mode 100755 index 0000000..8d7ba65 --- /dev/null +++ b/wxc2_omc/security/userManage/userList.php @@ -0,0 +1,193 @@ + + + + "Status", + "2" => "Status/Performance/Log", + "3" => "Status/Performance/Log/Configuration/Account/Maintenance", + "4" => "Status/Performance/Log/Configuration/Account/Maintenance/Advanced", + "5" => "Status/Performance/Log/Configuration/Account/Maintenance/Advanced/Template" +); +$userInfo = $_SESSION['userInfo']; + +if($DEBUG) + { + echo "userInfo[privilege] = $userInfo[privilege]
      "; + echo "userInfo[ID] = $userInfo[ID]
      "; + } + $table_name = 'sysUser'; + $sort_field = 'privilege,userName,updateTime'; + $sort_direction = 'ASC'; + $number_records_to_display = 200; + $pubConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "OMC_PUB"); + if (!$initial_record) + { + $initial_record = 0; + $str_sql_all ="SELECT count(*) as number_of_records FROM $table_name "; + $result = @mysqli_query($pubConn,$str_sql_all); + //$record = @mysqli_fetch_object($result); + $record = mysqli_fetch_assoc($result); + $number_of_records = $record['number_of_records']; + } + + if ($number_of_records >= 1) + { + //下面是控制分页显示,传递变量 + $next_index = $initial_record + $number_records_to_display; //本页的结束数目 + if ($next_index > $number_of_records) + { + $next_index = $number_of_records; + } + $t1 = $initial_record + 1; + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0) + { + $prev_index = 0; + } + } + + $str_sql="SELECT * + FROM $table_name + ORDER BY $sort_field $sort_direction + LIMIT $initial_record, $number_records_to_display"; + + //echo "
      str_sql=$str_sql"; + $result = mysqli_query($pubConn,$str_sql); + $myrows = mysqli_fetch_array($result); + if(!$myrows) + { + echo "$strNotFindRecord"; + exit(); + } + + ?> + +"; + echo ""; + echo ""; + echo "Advanced > Administrator"; + echo ""; + echo ""; + showHelp($helpId); + echo ""; + echo ""; + echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +?> + + + + + + + + + + + + + + + + + +
      + + + + +
      + +  $initial_record - $next_index, ($strTotalRecords: $number_of_records )   "; + ?> +
      +
      + + + + + + + + + + "; + } + else + { + echo " "; + } + //echo "$myrows[userName],$myrows[privilege],$userInfo[ID]
      "; + echo ""; + echo ""; + echo ""; + echo ""; + + //for accountManager + if('accountManager' == $userInfo[ID]) + { + $userInfo[privilege] = 4; + } + + if ( ($myrows[privilege]<$userInfo[privilege]) || ($myrows[userName] == $userInfo[ID]) ) + { + echo ""; + } + else + { + echo ""; + } + if ( ($myrows[privilege]<$userInfo[privilege]) && ($myrows[userName] != $userInfo[ID]) ) + { + echo ""; + } + else + { + echo ""; + } + echo ""; + }while($myrows=mysqli_fetch_array($result)); + +?> + +
        
      $myrows[userName]$myrows[realName]{$privilegeDefArr[$myrows[privilege]][remark]}{$privilegeRemark[$myrows[privilege]]}$strEdit $strDelete 
      + + + diff --git a/wxc2_omc/sysDefine/alarmDef/alarmConf.php b/wxc2_omc/sysDefine/alarmDef/alarmConf.php new file mode 100755 index 0000000..969d478 --- /dev/null +++ b/wxc2_omc/sysDefine/alarmDef/alarmConf.php @@ -0,0 +1,366 @@ +del_sql=$del_sql"; + //---------------- + //插入日志 + if ($del_result) + $log_name = $user_info["account"]." delete".$selAlarmCode." successful"; + else + $log_name = $user_info["account"]." delete".$selAlarmCode." fail"; + insertLog("$log_name"); + //------------ + if($del_result){ + echo "$strDeleteSuccess"; + }else{ + echo "$strDeleteFailure"; + } +} //end if($delete) + + +/*****************************添加,保存一个系统*****************************/ +if($save){ + if($selCompCode == 'new')//插入一个新组件 + { + //判断新添加的组件是否存在 + $judCompSql = " SELECT COUNT(*) FROM $alarmconf_table WHERE sysTypeNo='$sysTypeNo' AND compCode ='$compCode' AND alarmCode = '0' "; + $judCompRes = @mysqli_query($pubConn,$judCompSql); + $judCompRow = @mysqli_fetch_array($judCompRes); + echo mysqli_error($pubConn); + if(!$judCompRow[0]) + { + $saveSql = "REPLACE INTO $alarmconf_table + (sysTypeNo, compCode, alarmCode, alarmDesc_1, alarmDesc_2, alarmType, alarmLevel, alarmNote_1, alarmNote_2) + VALUES + ('$sysTypeNo', '$compCode', '0', '$alarmDesc_1', '$alarmDesc_2', '$alarmType', '$alarmLevel', '$alarmNote_1', '$alarmNote_2') + "; + $selCompCode=$compCode; + } + else + { + echo "
      Component always is existed!"; + } + } + elseif($selAlarmCode == 'new')//插入一个新告警类型 + { + $judCodeSql = " SELECT COUNT(*) FROM $alarmconf_table WHERE sysTypeNo='$sysTypeNo' AND compCode ='$selCompCode' AND alarmCode='$alarmCode' "; + $judCodeRes = @mysqli_query($pubConn,$judCodeSql); + $judCodeRow = @mysqli_fetch_array($judCodeRes); + echo mysqli_error($pubConn); + if(!$judCodeRow[0]) + { + $saveSql = "REPLACE INTO $alarmconf_table + (sysTypeNo, compCode, alarmCode, alarmDesc_1, alarmDesc_2, alarmType, alarmLevel, alarmNote_1, alarmNote_2) + VALUES + ('$sysTypeNo', '$selCompCode', '$alarmCode', '$alarmDesc_1', '$alarmDesc_2', '$alarmType', '$alarmLevel', '$alarmNote_1', '$alarmNote_2') + "; + $selAlarmCode=$alarmCode; + } + else + { + echo "
      Alarm code always is used!"; + } + } + else//修改已有组件或告警类型 + { + if($selAlarmCode==0){ + $chgCompCode=$compCode; + }else{ + $chgCompCode=$selCompCode; + } + $saveSql = " + UPDATE $alarmconf_table + SET + sysTypeNo='$sysTypeNo', + compCode='$chgCompCode', + alarmCode='$alarmCode', + alarmDesc_1='$alarmDesc_1', + alarmDesc_2='$alarmDesc_2', + alarmType='$alarmType', + alarmLevel='$alarmLevel', + alarmNote_1='$alarmNote_1', + alarmNote_2='$alarmNote_2' + WHERE sysTypeNo='$sysTypeNo' AND compCode='$selCompCode' AND alarmCode='$selAlarmCode' + "; + if($selAlarmCode==0){ + $selCompCode=$compCode; + } + $selAlarmCode=$alarmCode; + } + //echo "
      $save_sql"; + $saveRes = @mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + //------------插入日志------------ + //------------ + if($saveRes > 0){ + $log_name = $user_info["account"]." set".$selAlarmCode." successful."; + echo "
      $strSaveSuccess"; + }else{ + $log_name = $user_info["account"]." set".$selAlarmCode." fail."; + echo "
      $strSaveFailure"; + } + insertLog("$log_name"); +} //end if($save) +?> + + + +" > + +"; +echo ""; +echo ""; +echo ""; +echo ""; + + +//显示选择组件下拉菜单 +echo ""; +echo ""; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +elseif($selCompCode!='new') +{ + echo ""; + echo ""; + echo ""; + echo ""; +} +?> + + + + + + + + + + + + + + + + + + + + + + + + +
      "; +echo "

      $strAlarmConfiguration

      $strSystemType"; + + +$typeSql = " SELECT sysTypeNo,sysTypeName FROM $sysconf_table WHERE needHeartBeat = '1' + ORDER BY sysTypeNo "; +$typeRes = @mysqli_query($pubConn,$typeSql); +$typeRow = @mysqli_fetch_array($typeRes); +echo mysqli_error($pubConn); + +$compSql = " SELECT * FROM $alarmconf_table WHERE sysTypeNo = '$sysTypeNo' AND alarmCode = '0' + ORDER BY compCode "; +$compRes = @mysqli_query($pubConn,$compSql); +$compRow = @mysqli_fetch_array($compRes); +echo mysqli_error($pubConn); + +$codeSql = " SELECT * FROM $alarmconf_table WHERE sysTypeNo = '$sysTypeNo' AND compCode = '$selCompCode' ORDER BY alarmCode "; +$codeRes = @mysqli_query($pubConn,$codeSql); +$codeRow = @mysqli_fetch_array($codeRes); +echo mysqli_error($pubConn); + +if($selCompCode != 'new' && $selAlarmCode != 'new') +{ + $confSql = " SELECT * FROM $alarmconf_table WHERE sysTypeNo = '$sysTypeNo' AND compCode = '$selCompCode' AND alarmCode = '$selAlarmCode' "; + $confRes = @mysqli_query($pubConn,$confSql); + $confRow = @mysqli_fetch_array($confRes); + echo mysqli_error($pubConn); + $sysTypeNo = $confRow[sysTypeNo]; + $compCode = $confRow[compCode]; + $alarmCode = $confRow[alarmCode]; + $alarmDesc_1 = $confRow[alarmDesc_1]; + $alarmDesc_2 = $confRow[alarmDesc_2]; + $alarmType = $confRow[alarmType]; + $alarmLevel = $confRow[alarmLevel]; + $alarmNote_1 = $confRow[alarmNote_1]; + $alarmNote_2 = $confRow[alarmNote_2]; +} + + +echo "
      $strExistedComponent"; +echo "
      $strExistedAlarm"; + echo "
      $strComponentCode (0-255)"; + echo "
      $strAlarmCode (0-255)"; + echo "
      +
      + +
      + +
      + +
      +
      +
      +

      " name="save"> + " name="reset"> + " name="delete"> + " name="Init" onclick=alarmInit(0)> + +

      +
      + + + diff --git a/wxc2_omc/sysDefine/alarmDef/alarmDefConf.php b/wxc2_omc/sysDefine/alarmDef/alarmDefConf.php new file mode 100755 index 0000000..6a8c8fe --- /dev/null +++ b/wxc2_omc/sysDefine/alarmDef/alarmDefConf.php @@ -0,0 +1,509 @@ + + + +"; + echo ""; + echo ""; + echo "Template > Alarm Configuration"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; +$mode = $_REQUEST['mode']; +if($DEBUG) echo "
      mode=$mode"; +$sysTypeNo = $_REQUEST['sysTypeNo']; +$compCode = $_REQUEST['compCode']; +$alarmCode = $_REQUEST['alarmCode']; +$alarmDesc_1 = $_REQUEST['alarmDesc_1']; +$alarmDesc_2 = $_REQUEST['alarmDesc_2']; +$alarmType = $_REQUEST['alarmType']; +$alarmLevel = $_REQUEST['alarmLevel']; +$alarmNote_1 = $_REQUEST['alarmNote_1']; +$alarmNote_2 = $_REQUEST['alarmNote_2']; +$level_1 = $_REQUEST['level_1']; +$level_2 = $_REQUEST['level_2']; +$instanceNo = $_REQUEST['instanceNo']; +$EventCode = $_REQUEST['EventCode']; +$SendAlert = $_REQUEST['SendAlert']; + + + + +$sysConfTable = 'OMC_PUB.sysConf'; + +$alarmDefTable = 'OMC_PUB.sysAlarmConf'; + +$pubDb ='OMC_PUB'; + + + +if(isset($_POST['save']) && $_POST['save'] != '-1'){ + + if($mode=='add'){ + + $saveSql = "REPLACE INTO $alarmDefTable + + (sysTypeNo,compCode,alarmCode,alarmDesc_1,alarmDesc_2,alarmType,alarmLevel, + + alarmNote_1,alarmNote_2,level_1 ,level_2,instanceNo,EventCode,SendAlert ) + + VALUES + + ('$sysTypeNo','$compCode','$alarmCode','$alarmDesc_1','$alarmDesc_2','$alarmType','$alarmLevel', + + '$alarmNote_1','$alarmNote_2','$level_1','$level_2','$instanceNo' ,'$EventCode', '$SendAlert') + + "; + + }else{// $mode=='edit' + + $saveSql = "REPLACE INTO $alarmDefTable + + (sysTypeNo,compCode,alarmCode,alarmDesc_1,alarmDesc_2,alarmType,alarmLevel, + + alarmNote_1,alarmNote_2,level_1 ,level_2,instanceNo,EventCode, SendAlert ) + + VALUES + + ('$sysTypeNo','$compCode','$alarmCode','$alarmDesc_1','$alarmDesc_2','$alarmType','$alarmLevel', + + '$alarmNote_1','$alarmNote_2','$level_1','$level_2','$instanceNo' ,'$EventCode', '$SendAlert') + + "; + + } + + + + if($DEBUG) echo "
      saveSql = $saveSql"; + + $result = mysqli_query($pubConn,$saveSql); + + echo mysqli_error($pubConn); + + $mode = 'edit'; + + if($result > 0){ + + echo "
      OK!"; + + }else{ + + echo "
      Error!"; + + } + + echo " "; + + exit(); + +}elseif($mode =='delete'){ + + if($_POST['sureDel'] == 'Yes'){ + + $delSql = "DELETE FROM $alarmDefTable + + WHERE sysTypeNo='$sysTypeNo' AND compCode = '$compCode' + + AND alarmCode = '$alarmCode' + + "; + + if($DEBUG) echo "
      delSql = $delSql"; + + mysqli_query($pubConn,$delSql); + + echo "
      Delete ok"; + + echo " "; + + exit(); + + }elseif($_POST['sureDel'] == 'No'){ + + echo "
      Delete Canceled"; + + $mode='edit'; + + }else{ + + echo "Are you sure to delete this alarm?"; + + echo "
      compCode =$compCode"; + + echo "
      alarmCode =$alarmCode"; + + echo "
      "; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo ""; + + echo "
      "; + + exit(); + + } + +} + + + +if($mode == 'edit'){ + + $listSql = "SELECT sysTypeName,$alarmDefTable.sysTypeNo,compCode,alarmCode,alarmDesc_1,alarmDesc_2, + + alarmType,alarmLevel,alarmNote_1,alarmNote_2 ,level_1 ,level_2,instanceNo,EventCode, SendAlert + + FROM $sysConfTable,$alarmDefTable + + WHERE $sysConfTable.sysTypeNo = $alarmDefTable.sysTypeNo + + AND $alarmDefTable.sysTypeNo = '$sysTypeNo' + + AND $alarmDefTable.compCode = '$compCode' + + AND $alarmDefTable.alarmCode = '$alarmCode' + + "; + + if($DEBUG) echo "

      listSql = $listSql"; + + $listResult = mysqli_query($pubConn,$listSql); + + echo mysqli_error($pubConn); + + $listRows= @mysqli_fetch_array($listResult); + +} + + + +?> + + + +
      " > + + + + + + + + + +"; + + echo ""; + + echo ""; + + echo ""; + + + + //compCode + + echo ""; + + echo ""; + + echo ""; + + + + //alarmCode + + echo ""; + + echo ""; + + echo ""; + + + + //alarmLevel + + echo ""; + + echo ""; + + echo ""; + + + + //alarmType + + echo ""; + + echo ""; + + echo ""; + + + + //alarmDesc_1 + + echo ""; + + echo ""; + + echo ""; + + + + //alarmDesc_2 + + echo ""; + + echo ""; + + echo ""; + + + + + + //alarmNote_1 + + echo ""; + + echo ""; + + echo ""; + + + + //alarmNote_2 + + echo ""; + + echo ""; + + echo ""; + + + + + + //level_1 + + echo ""; + + echo ""; + + echo ""; + + + + //level_2 + + echo ""; + + echo ""; + + echo ""; + + + + //instanceNo + + echo ""; + + echo ""; + + echo ""; + + + + + + + + //EventCode + + echo ""; + + echo ""; + + echo ""; + + //alert + + echo ""; + + echo ""; + + echo ""; + + + + echo "
      + + + + + +
      sysTypeNo
      compCode"; + + echo ""; + + echo "
      alarmCode"; + + echo ""; + + echo "
      alarmLevel$alarmLevel"; + + $alarmLevel=$listRows[alarmLevel]; + + echo ""; + + echo "
      alarmType"; + + echo ""; + + echo "
      alarmDesc_1"; + + echo ""; + + echo "
      alarmDesc_2"; + + echo ""; + + echo "
      alarmNote_1"; + + echo ""; + + echo "
      alarmNote_2"; + + echo ""; + + echo "
      level_1"; + + echo ""; + + echo "
      level_2"; + + echo ""; + + echo "
      instanceNo"; + + echo ""; + + echo "
      EventCode"; + + echo ""; + + echo "
      SendAlert"; + + echo ""; + + echo "
      "; + +echo "  "; + +echo "  "; + +echo ""; + +echo ""; +adjust_content_tail(); +?> diff --git a/wxc2_omc/sysDefine/alarmDef/alarmDefConf.php.bak b/wxc2_omc/sysDefine/alarmDef/alarmDefConf.php.bak new file mode 100755 index 0000000..71bb733 --- /dev/null +++ b/wxc2_omc/sysDefine/alarmDef/alarmDefConf.php.bak @@ -0,0 +1,201 @@ +mode=$mode"; + +$sysConfTable = 'OMC_PUB.sysConf'; +$alarmDefTable = 'OMC_PUB.sysAlarmConf'; +$pubDb ='OMC_PUB'; + +if(isset($save) && $save != '-1'){ + if($mode=='add'){ + $saveSql = "REPLACE INTO $alarmDefTable + (sysTypeNo,compCode,alarmCode,alarmDesc_1,alarmDesc_2,alarmType,alarmLevel, + alarmNote_1,alarmNote_2) + VALUES + ('$sysTypeNo','$compCode','$alarmCode','$alarmDesc_1','$alarmDesc_2','$alarmType','$alarmLevel', + '$alarmNote_1','$alarmNote_2') + "; + }else{// $mode=='edit' + $saveSql = "REPLACE INTO $alarmDefTable + (sysTypeNo,compCode,alarmCode,alarmDesc_1,alarmDesc_2,alarmType,alarmLevel, + alarmNote_1,alarmNote_2) + VALUES + ('$sysTypeNo','$compCode','$alarmCode','$alarmDesc_1','$alarmDesc_2','$alarmType','$alarmLevel', + '$alarmNote_1','$alarmNote_2') + "; + } + + if($DEBUG) echo "
      saveSql = $saveSql"; + $result = mysqli_query($pubConn,$saveSql); + echo mysqli_error($pubConn); + $mode = 'edit'; + if($result > 0){ + echo "
      OK!"; + }else{ + echo "
      Error!"; + } + echo " "; + exit(); +}elseif($mode =='delete'){ + if($sureDel == 'Yes'){ + $delSql = "DELETE FROM $alarmDefTable + WHERE sysTypeNo='$sysTypeNo' AND compCode = '$compCode' + AND alarmCode = '$alarmCode' + "; + if($DEBUG) echo "
      delSql = $delSql"; + mysqli_query($pubConn,$delSql); + echo "
      Delete ok"; + echo " "; + exit(); + }elseif($sureDel == 'No'){ + echo "
      Delete Canceled"; + $mode='edit'; + }else{ + echo "Are you sure to delete this alarm?"; + echo "
      compCode =$compCode"; + echo "
      alarmCode =$alarmCode"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + exit(); + } +} + +if($mode == 'edit'){ + $listSql = "SELECT sysTypeName,$alarmDefTable.sysTypeNo,compCode,alarmCode,alarmDesc_1,alarmDesc_2, + alarmType,alarmLevel,alarmNote_1,alarmNote_2 + FROM $sysConfTable,$alarmDefTable + WHERE $sysConfTable.sysTypeNo = $alarmDefTable.sysTypeNo + AND $alarmDefTable.sysTypeNo = '$sysTypeNo' + AND $alarmDefTable.compCode = '$compCode' + AND $alarmDefTable.alarmCode = '$alarmCode' + "; + if($DEBUG) echo "

      listSql = $listSql"; + $listResult = mysqli_query($pubConn,$listSql); + echo mysqli_error($pubConn); + $listRows= @mysqli_fetch_array($listResult); +} + +?> + +
      " > + + + + +"; + echo ""; + echo ""; + echo ""; + + //compCode + echo ""; + echo ""; + echo ""; + + //alarmCode + echo ""; + echo ""; + echo ""; + + //alarmLevel + echo ""; + echo ""; + echo ""; + + //alarmType + //echo ""; + //echo ""; + //echo ""; + + //alarmDesc_1 + echo ""; + echo ""; + echo ""; + + //alarmDesc_2 + echo ""; + echo ""; + echo ""; + + + //alarmNote_1 + echo ""; + echo ""; + echo ""; + + //alarmNote_2 + echo ""; + echo ""; + echo ""; + + echo "
      + + +
      sysTypeNo
      compCode"; + echo ""; + echo "
      alarmCode"; + echo ""; + echo "
      alarmLevel$alarmLevel"; + $alarmLevel=$listRows[alarmLevel]; + echo ""; + echo "
      alarmType"; + //echo ""; + //echo "
      alarmDesc_1"; + echo ""; + echo "
      alarmDesc_2"; + echo ""; + echo "
      alarmNote_1"; + echo ""; + echo "
      alarmNote_2"; + echo ""; + echo "
      "; +echo "  "; +echo "  "; +echo ""; +echo ""; +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/alarmDef/alarmDefList.php b/wxc2_omc/sysDefine/alarmDef/alarmDefList.php new file mode 100755 index 0000000..6117a6d --- /dev/null +++ b/wxc2_omc/sysDefine/alarmDef/alarmDefList.php @@ -0,0 +1,207 @@ +sysTypeNo=$sysTypeNo"; +$sysTypeNo=isset($sysTypeNo)?$sysTypeNo:0; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + +//选择语言版本 +if($language == 'eng'){ + $descField=alarmDesc_2; //语种2 +}else{ + $descField=alarmDesc_1; //语种1(默认语种) +} +?> + + + + + + + +"; + echo ""; + echo ""; + echo "Template > Alarm Configuration"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; + echo ""; + echo ""; + +$listSql = "SELECT sysTypeName,sysTypeNo + FROM $sysConfTable + ORDER BY sysTypeNo + "; +if($DEBUG) echo "
      listSql = $listSql
      "; +$listResult = mysqli_query($pubConn,$listSql); +echo mysqli_error($pubConn); + +echo ""; +echo "    "; + +if($sysTypeNo != 999){ + echo ""; + echo ""; +} + + echo ""; + echo ""; + + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + + + + +?> + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +elseif ($selectedLanguage == 'chn'){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + +if($sysTypeNo == 999){ + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + $listSql = "SELECT sysTypeName,compCode,alarmCode,alarmLevel,$sysConfTable.sysTypeNo,$descField,level_1 ,level_2,instanceNo,EventCode + FROM $sysConfTable,$alarmDefTable + WHERE $sysConfTable.sysTypeNo = $alarmDefTable.sysTypeNo + ORDER BY $alarmDefTable.sysTypeNo,$alarmDefTable.compCode,$alarmDefTable.alarmCode"; +}else{ + $listSql = "SELECT sysTypeName,compCode,alarmCode,alarmLevel,$descField,level_1 ,level_2,instanceNo,EventCode,$sysConfTable.sysTypeNo + FROM $sysConfTable,$alarmDefTable + WHERE $sysConfTable.sysTypeNo = $alarmDefTable.sysTypeNo + AND $alarmDefTable.sysTypeNo = '$sysTypeNo' + ORDER BY $alarmDefTable.sysTypeNo,$alarmDefTable.compCode,$alarmDefTable.alarmCode"; +} +if($DEBUG) echo "
      listSql = $listSql
      "; +$listResult = mysqli_query($pubConn,$listSql); +echo mysqli_error($pubConn); + +$alarmLevelDef=array('cleared','Critical','Major','Minor','Warning','Indeterminate'); + +while($listRows=@mysqli_fetch_array($listResult)){ + if($oldSysTypeNo != $listRows[sysTypeNo]){ + $oldSysTypeNo = $listRows[sysTypeNo]; + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + echo ""; + if($listRows[alarmLevel] > 5){ + echo ""; + }else{ + echo ""; + } + + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; +// echo ""; +// echo ""; + echo ""; +} +echo "
      + +
      sysTypeNamecompCodealarmCodealarmLevelLevel_1Level_2instanceNoEventCodeDescript------
      系统类型compCode告警代码告警级别    描述  
      $listRows[sysTypeName]$listRows[compCode]$listRows[alarmCode]Unknown{$alarmLevelDef[$listRows[alarmLevel]]}$listRows[level_1] $listRows[level_2] $listRows[instanceNo] $listRows[EventCode]$listRows[$descField]$strEdit$strDelete
      "; +echo ""; +adjust_content_tail(); +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/alarmDef/alarmDefList.php.bak b/wxc2_omc/sysDefine/alarmDef/alarmDefList.php.bak new file mode 100755 index 0000000..480368b --- /dev/null +++ b/wxc2_omc/sysDefine/alarmDef/alarmDefList.php.bak @@ -0,0 +1,158 @@ +sysTypeNo=$sysTypeNo"; +$sysTypeNo=isset($sysTypeNo)?$sysTypeNo:0; +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + +//选择语言版本 +if($language == 'eng'){ + $descField=alarmDesc_2; //语种2 +}else{ + $descField=alarmDesc_1; //语种1(默认语种) +} +?> + + + + + +listSql = $listSql
      "; +$listResult = mysqli_query($pubConn,$listSql); +echo mysqli_error($pubConn); + +echo ""; +echo "    "; +if($sysTypeNo != 999){ + echo ""; + echo ""; +} +?> + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +elseif ($selectedLanguage == 'chn'){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} + +if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + +if($sysTypeNo == 999){ + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + $listSql = "SELECT sysTypeName,compCode,alarmCode,alarmLevel,$sysConfTable.sysTypeNo,$descField + FROM $sysConfTable,$alarmDefTable + WHERE $sysConfTable.sysTypeNo = $alarmDefTable.sysTypeNo + ORDER BY $alarmDefTable.sysTypeNo,$alarmDefTable.compCode,$alarmDefTable.alarmCode"; +}else{ + $listSql = "SELECT sysTypeName,compCode,alarmCode,alarmLevel,$descField + FROM $sysConfTable,$alarmDefTable + WHERE $sysConfTable.sysTypeNo = $alarmDefTable.sysTypeNo + AND $alarmDefTable.sysTypeNo = '$sysTypeNo' + ORDER BY $alarmDefTable.sysTypeNo,$alarmDefTable.compCode,$alarmDefTable.alarmCode"; +} +if($DEBUG) echo "
      listSql = $listSql
      "; +$listResult = mysqli_query($pubConn,$listSql); +echo mysqli_error($pubConn); + +$alarmLevelDef=array('cleared','Critical','Major','Minor','Warning','Indeterminate'); + +while($listRows=@mysqli_fetch_array($listResult)){ + if($oldSysTypeNo != $listRows[sysTypeNo]){ + $oldSysTypeNo = $listRows[sysTypeNo]; + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + echo ""; + if($listRows[alarmLevel] > 5){ + echo ""; + }else{ + echo ""; + } + echo ""; + echo ""; + echo ""; + echo ""; +} +echo "
      + +
      sysTypeNamecompCodealarmCodealarmLevelDescript------
      系统类型compCode告警代码告警级别描述  
      $listRows[sysTypeName]$listRows[compCode]$listRows[alarmCode]Unknown{$alarmLevelDef[$listRows[alarmLevel]]}$listRows[$descField]$strEdit$strDelete
      "; +echo ""; +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/alarmDef/alarmInit.php b/wxc2_omc/sysDefine/alarmDef/alarmInit.php new file mode 100755 index 0000000..6ee676a --- /dev/null +++ b/wxc2_omc/sysDefine/alarmDef/alarmInit.php @@ -0,0 +1,133 @@ +"; + echo "Are you sure to init $sysTypeName 's alarm?"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo "
      "; + exit(); +} +*/ + + +echo "
      It's need some minutes,Please wait...
      "; +if($initAll > 0){ + $clearSql = "DELETE FROM sysAlarmLog "; +}else{ + $clearSql = "DELETE FROM sysAlarmLog WHERE sysTypeNo = '$sysTypeNo'"; +} +if($DEBUG) echo "
      clearSql=$clearSql"; +mysqli_query($pubConn,$clearSql); +echo mysqli_error($pubConn); +if($initAll > 0){ + $getAlarmConfSql="SELECT sysTypeNo,compCode,alarmCode + FROM sysAlarmConf + WHERE alarmCode > '0' + "; +}else{ + $getAlarmConfSql="SELECT compCode,alarmCode + FROM sysAlarmConf + WHERE sysTypeNo= '$sysTypeNo' AND alarmCode > '0' + "; + $getSysConfSql = "SELECT maxSysNum,maxSubSysNum,sysTypeName FROM sysConf WHERE sysTypeNo= '$sysTypeNo'"; + if($DEBUG) echo "
      getSysConfSql=$getSysConfSql"; + $sysConfResult=mysqli_query($pubConn,$getSysConfSql); + echo mysqli_error($pubConn); + $sysConfRows = mysqli_fetch_array($sysConfResult); + $maxSysNum = $sysConfRows[maxSysNum]; + $maxSubSysNum= $sysConfRows[maxSubSysNum]; + $sysTypeName = $sysConfRows[sysTypeName]; + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + if($DEBUG) echo "
      maxSysNum=$maxSysNum"; + if($DEBUG) echo "
      maxSubSysNum=$maxSubSysNum"; + if($DEBUG) echo "
      sysTypeName=$sysTypeName"; +} + +if($DEBUG) echo "
      getAlarmConfSql=$getAlarmConfSql"; +$alarmConfResult=mysqli_query($pubConn,$getAlarmConfSql); +echo mysqli_error($pubConn); +$k=0; +while($alarmConfRows = mysqli_fetch_array($alarmConfResult)){ + if(($initAll > 0) && ($sysTypeNo != $alarmConfRows[sysTypeNo])){ + $sysTypeNo = $alarmConfRows[sysTypeNo]; + $getSysConfSql = "SELECT maxSysNum,maxSubSysNum FROM sysConf WHERE sysTypeNo= '$sysTypeNo'"; + if($DEBUG) echo "
      getSysConfSql=$getSysConfSql"; + $sysConfResult=mysqli_query($pubConn,$getSysConfSql); + echo mysqli_error($pubConn); + $sysConfRows = mysqli_fetch_array($sysConfResult); + $maxSysNum = $sysConfRows[maxSysNum]; + $maxSubSysNum= $sysConfRows[maxSubSysNum]; + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + if($DEBUG) echo "
      maxSysNum=$maxSysNum"; + if($DEBUG) echo "
      maxSubSysNum=$maxSubSysNum"; + if($DEBUG) echo "
      sysTypeName=$sysTypeName"; + } + $compCode = $alarmConfRows[compCode]; + $alarmCode = $alarmConfRows[alarmCode]; + for($i=0;$i<$maxSysNum;$i++){ + for($j=0;$j<$maxSubSysNum;$j++){ + $insertSql = "REPLACE sysAlarmLog + (sysTypeNo,sysNo,subSysNo,compCode,alarmCode,alarmCount,alarmTime,clearTime) + VALUES + ('$sysTypeNo','$i','$j','$compCode','$alarmCode','0','0','0') + "; + if($DEBUG) echo "
      insertSql=$insertSql"; + mysqli_query($pubConn,$insertSql); + echo mysqli_error($pubConn); + } + } + if($initAll > 0){ + if(($k % 10) == 0){ + print(">>"); + flush(); + } + }else{ + print(">>"); + flush(); + } + $k++; +} +if($initAll > 0){ + echo "
      All alarm initialized, number of alarm is $k!!
      "; +}else{ + echo "
      $sysTypeName 's alarm initialized, number of alarm is $k!!
      "; +} + +?> diff --git a/wxc2_omc/sysDefine/cdrMngDef/cdrConf.php b/wxc2_omc/sysDefine/cdrMngDef/cdrConf.php new file mode 100755 index 0000000..b651dc9 --- /dev/null +++ b/wxc2_omc/sysDefine/cdrMngDef/cdrConf.php @@ -0,0 +1,299 @@ + + + +"; + echo ""; + echo ""; + echo "Template > CDR Configuration"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +$max_menu = 4; +$db=$cdr_db; +$sysTypeNo=isset($sysTypeNo)?$sysTypeNo:'320'; +$sysType=omc_sys_code2type($sysTypeNo); +$recordTable = "cdrFrom".$sysType; +$defineTable = strtolower($sysType)."CdrDefine"; +$sysNum=get_sys_total($sysType); +$selkey_sys_id=isset($selkey_sys_id)?$selkey_sys_id:'new'; +$sysType=omc_sys_code2type($sysTypeNo); + +/**************************************删除一个系统类型***********************************************/ +if($delete){ + $delSql = "DELETE FROM $cdrdefine_table WHERE recordTable='$recordTable' AND key_sys_id='$selkey_sys_id'"; + $delRes = mysqli_query($pubConn,$delSql); + //---------------- + //插入日志 + if ($delRes) + $log_name = $user_info["account"]." delete ".$recordTable." from ".$cdrdefine_table." successful."; + else + $log_name = $user_info["account"]." delete ".$recordTable." from ".$cdrdefine_table." fail."; + insertLog("$log_name"); + //------------ + if($delRes){ + echo "$strDeleteSuccess"; + }else{ + echo "$strDeleteFailure"; + } +}//end if($delete) + + +/*****************************添加,保存一个类型*****************************/ +if($save){ + if($selkey_sys_id == 'new')//插入一个新配置 + { + //判断新添加的配置是否存在 + $judIndexSql = " SELECT COUNT(*) FROM $cdrdefine_table WHERE recordTable='$recordTable' AND key_sys_id ='$key_sys_id' "; + $judIndexRes = @mysqli_query($pubConn,$judIndexSql); + $judIndexRow = @mysqli_fetch_array($judIndexRes); + echo mysqli_error($pubConn); + if($judIndexRow[0]) + { + echo "
      Component always is existed!"; + $noReplate='1'; + } + } + + $replaceSql=" REPLACE INTO $cdrdefine_table VALUES('$isEnable','$oid','$bufSize','$headOid','$tailOid','$key_sys_id',$sysTypeNo,'$port','$recordTable','$defineTable','$csvPath','$backupMax','2') "; + echo "
      replaceSql=$replaceSql"; + if(!$noReplate) + { + $replaceRes = @mysqli_query($pubConn,$replaceSql); + echo mysqli_error($pubConn); + $selkey_sys_id=$key_sys_id; + } + //------------插入日志------------ + insertLog('CDR configuration',0,6); + //------------ + if($replaceRes > 0){ + echo "
      $strSaveSuccess"; + }else{ + echo "
      $strSaveFailure"; + } +} //end if($save) +?> + + + + "; +?> +
      " > + +"; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo "
      "; +echo "

      $strCDRConfiguration

      $strSystemType"; + + +$typeSql = " SELECT sysTypeNo,sysTypeName FROM $sysconf_table WHERE needCDR = '1' ORDER BY sysTypeNo "; +$typeRes = @mysqli_query($pubConn,$typeSql); +$typeRow = @mysqli_fetch_array($typeRes); +echo mysqli_error($pubConn); +//echo "
      typeSql=$typeSql"; + +$indexSql = " SELECT * FROM $cdrdefine_table WHERE recordTable = '$recordTable' ORDER BY key_sys_id "; +$indexRes = @mysqli_query($pubConn,$indexSql); +$indexRow = @mysqli_fetch_array($indexRes); +//echo "
      indexSql=$indexSql"; +echo mysqli_error($pubConn); + +if($selkey_sys_id!='new') +{ + $confSql = " SELECT * FROM $cdrdefine_table WHERE recordTable = '$recordTable' AND key_sys_id = '$selkey_sys_id'"; + $confRes = @mysqli_query($pubConn,$confSql); + $confRow = @mysqli_fetch_array($confRes); + echo mysqli_error($pubConn); + + $isEnable = $confRow[isEnable]; + $oid = $confRow[oid]; + $bufSize = $confRow[bufSize]; + $headOid = $confRow[headOid]; + $tailOid = $confRow[tailOid]; + $key_sys_id = $confRow[key_sys_id]; + $port = $confRow[port]; + $recordTable = $confRow[recordTable]; + $defineTable = $confRow[defineTable]; + $csvPath = $confRow[csvPath]; + $backupMax = $confRow[backupMax]; +} + +echo "
      Existed ID"; +echo "
      System ID"; +echo ""; +echo "
      OID"; +echo ""; +echo "
      Head OID"; +echo ""; +echo "
      Tail OID"; +echo ""; +echo "
      CSV path"; +echo ""; +echo "
      Buffer size"; +echo ""; +echo "
      Port"; +echo ""; +echo "
      Max backup days"; +echo ""; +echo "
      $strEnable "; +if($isEnable==1) +{ + echo "Yes "; + echo "No"; +} +else +{ + echo "Yes "; + echo "No"; +} +echo "
      "; +?> +

      " name="save"> +" name="reset"> +" name="delete"> +

      +
      + + + + diff --git a/wxc2_omc/sysDefine/cnsConf/cnsConf.php b/wxc2_omc/sysDefine/cnsConf/cnsConf.php new file mode 100755 index 0000000..14ac7c6 --- /dev/null +++ b/wxc2_omc/sysDefine/cnsConf/cnsConf.php @@ -0,0 +1,135 @@ +keyNo=$keyNo"; +if($DEBUG)echo "
      setFld=$setFld"; + +?> + +udpSql=$udpSql"; + $udpRes = @mysqli_query($pubConn,$udpSql); + echo mysqli_error($pubConn); + if(!$DEBUG){ + echo ""; + } +} +$showNodeFld = "keyNo, keyName, ip, status, objTypeNo, pointX, pointY, remark, updateTime"; +$showEdgeFld = "keyNo, keyName, ip, status, objTypeNo, fromNodeNo, fromNodeNo, remark, updateTime"; + +$nodeSql = "SELECT $showNodeFld FROM $tbName WHERE objTypeNo > 0 "; +echo "
      nodeSql=$nodeSql"; +$nodeRes = mysqli_query($pubConn,$nodeSql); +$nodeRow = mysqli_fetch_array($nodeRes); + +$edgeSql = "SELECT $showEdgeFld FROM $tbName WHERE objTypeNo < 1 "; +echo "
      edgeSql=$edgeSql"; +$edgeRes = mysqli_query($pubConn,$edgeSql); +$edgeRow = mysqli_fetch_array($edgeRes); + + +echo "
      "; +echo ""; +$fldArr=explode(',',$showNodeFld); +$fldNum = sizeof($fldArr); +echo ""; +echo ""; +echo ""; +echo ""; +for($i=0;$i<$fldNum;$i++){ + echo ""; +} +echo ""; +do{ + echo ""; + for($i=0;$i"; + echo "$nodeRow[keyNo]"; + echo ""; + }else{ + echo ""; + } + } + echo ""; +}while($nodeRow = mysqli_fetch_array($nodeRes)); +echo "
      "; +echo "Node list"; +echo "
      $fldArr[$i]
      $nodeRow[$i]
      "; + +echo "

      "; + +echo ""; +$fldArr=explode(',',$showEdgeFld); +$fldNum = sizeof($fldArr); +echo ""; +echo ""; +echo ""; +echo ""; +for($i=0;$i<$fldNum;$i++){ + echo ""; +} +echo ""; +do{ + echo ""; + for($i=0;$i"; + echo "$edgeRow[keyNo]"; + echo ""; + }else{ + echo ""; + } + } + echo ""; +}while($edgeRow = mysqli_fetch_array($edgeRes)); +echo "
      "; +echo "Edge list"; +echo "
      $fldArr[$i]
      $edgeRow[$i]
      "; + +echo "

      "; +echo ""; +echo "  "; +echo ""; +echo ""; +echo ""; +echo "
      "; +?> + + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/cnsConf/cnsConfEdit.php b/wxc2_omc/sysDefine/cnsConf/cnsConfEdit.php new file mode 100755 index 0000000..eaed07b --- /dev/null +++ b/wxc2_omc/sysDefine/cnsConf/cnsConfEdit.php @@ -0,0 +1,232 @@ +mode=$mode"; +$dbName = "OMC_PUB"; +$tbName = "centralMapInfo"; + +$objTypeArr=array( + array('num' => '0', 'remark' => 'Line', 'color' => '#FF0000'), + array('num' => '1', 'remark' => 'Level_1', 'color' => '#FF0000'), + array('num' => '2', 'remark' => 'Level_2', 'color' => '#0000FF'), + array('num' => '3', 'remark' => 'Level_3', 'color' => '#0000FF'), +); + +if($save){ + if($mode == 'addNode' || $mode == 'addEdge'){ + $udtSql = " REPLACE $tbName SET keyName = '$keyName', ip = '$ip', objTypeNo = '$objTypeNo', fromNodeNo = '$fromNodeNo', toNodeNo = '$toNodeNo', pointX = '$pointX', pointY = '$pointY', remark = '$remark', keyNo = '$keyNo'"; + }else{ + $udtSql = " UPDATE $tbName SET keyName = '$keyName', ip = '$ip', objTypeNo = '$objTypeNo', fromNodeNo = '$fromNodeNo', toNodeNo = '$toNodeNo', pointX = '$pointX', pointY = '$pointY', remark = '$remark' WHERE keyNo = '$keyNo'"; + } + //echo "
      udtSql=$udtSql"; + $udtRes = mysqli_query($pubConn, $udtSql); + if($udtRes){ + echo "
      Save ok."; + }else{ + echo "
      Save failure."; + } +}elseif($delete){ + $delSql = " DELETE FROM $tbName WHERE keyNo = '$keyNo' "; + $delRes = mysqli_query($pubConn, $delSql); + if($delRes){ + echo "
      Delete ok."; + }else{ + echo "
      Delete failure."; + } +} + +if($mode == 'addNode' || $mode == 'addEdge'){ + $allSql = "SELECT keyNo FROM $tbName "; + $allRes = @mysqli_query($pubConn, $allSql); + $allRow = @mysqli_fetch_array($allRes); + $keyNum = 0; + do{ + $keyArr[$keyNum] = $allRow[keyNo]; + $keyNum++; + }while($allRow = @mysqli_fetch_array($allRes)); +} + +if($mode == 'addEdge' || $mode == 'editEdge'){ + $nodeSql = "SELECT keyNo,keyName FROM $tbName WHERE objTypeNo > 0 "; + if($DEBUG) echo "
      nodeSql=$nodeSql"; + $nodeRes = mysqli_query($pubConn,$nodeSql); + $nodeRow = mysqli_fetch_array($nodeRes); + $nodeNum = 0; + do{ + $nodeArr[$nodeNum][0] = $nodeRow[keyNo]; + $nodeArr[$nodeNum][1] = $nodeRow[keyName]; + $nodeNum++; + }mysqli_fetch_array( +while($nodeRow = mysql_fetch_array($nodeRes)); +} + +if($mode == 'editNode' || $mode == 'editEdge'){ + $selSql = "SELECT keyName,ip,status,objTypeNo,fromNodeNo,toNodeNo,pointX,pointY,remark FROM $tbName WHERE keyNo = '$keyNo' "; + $selRes = mysqli_fetch_array(Name,$selSql); + $selRow = mysql_fetch_array($selRes); + if($DEBUG) echo "
      selSql=$selSql"; + $keyName = $selRow[keyName]; + $ip = $selRow[ip]; + $status = $selRow[status]; + $objTypeNo = $selRow[objTypeNo]; + $fromNodeNo = $selRow[fromNodeNo]; + $toNodeNo = $selRow[toNodeNo]; + $pointX = $selRow[pointX]; + $pointY = $selRow[pointY]; + $remark = $selRow[remark]; +} +?> +
      " > + "; +echo "$tableHeader"; +?> + + + + + + + +"; +echo "keyNo"; +if($mode == 'addNode' || $mode == 'addEdge'){ + echo ""; + echo ""; + echo ""; +}else{ + echo "$keyNo "; +} +echo ""; + +echo ""; +echo "keyName"; +echo ""; +echo ""; + +echo ""; +echo "IP"; +echo ""; +echo ""; + +if($mode == 'addNode' || $mode == 'editNode'){ + echo ""; + echo "objTypeNo"; + echo ""; + echo ""; + // + echo ""; + echo ""; +}else{ + //echo ""; +} + +if($mode == 'addNode' || $mode == 'editNode'){ + echo ""; + echo "pointX"; + echo ""; + echo ""; + + echo ""; + echo "pointY"; + echo ""; + echo ""; +}else{ + + echo ""; + echo "fromNodeNo"; + echo ""; + echo ""; + echo ""; + echo ""; + + echo ""; + echo "toNodeNo"; + echo ""; + echo ""; + echo ""; + echo ""; +} + +echo ""; +echo "Remark"; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo ""; +echo "  "; +echo ""; +if($mode == 'editNode' || $mode == 'editEdge'){ + echo "  "; + echo "  "; +} + +if($mode != 'addNode' && $mode != 'addEdge'){ + echo ""; +} + +echo ""; +echo "
      "; + + + +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/cnsConf/cnsConfIndex.php b/wxc2_omc/sysDefine/cnsConf/cnsConfIndex.php new file mode 100755 index 0000000..73191cb --- /dev/null +++ b/wxc2_omc/sysDefine/cnsConf/cnsConfIndex.php @@ -0,0 +1,17 @@ + + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/sysDefine/cnsConf/cnsConfList.php b/wxc2_omc/sysDefine/cnsConf/cnsConfList.php new file mode 100755 index 0000000..92452f5 --- /dev/null +++ b/wxc2_omc/sysDefine/cnsConf/cnsConfList.php @@ -0,0 +1,133 @@ +keyNo=$keyNo"; +if($DEBUG)echo "
      setFld=$setFld"; + +?> + +udpSql=$udpSql"; + $udpRes = @mysqli_query($pubConn,$udpSql); + echo mysqli_error($pubConn); + if(!$DEBUG){ + echo ""; + } +} +$showNodeFld = "keyNo, keyName, ip, status, objTypeNo, pointX, pointY, remark, updateTime"; +$showEdgeFld = "keyNo, keyName, ip, status, objTypeNo, fromNodeNo, toNodeNo, remark, updateTime"; + +$nodeSql = "SELECT $showNodeFld FROM $tbName WHERE objTypeNo > 0 "; +echo "
      nodeSql=$nodeSql db=$dbName"; +$nodeRes = mysqli_query($pubConn,$nodeSql); +$nodeRow = mysqli_fetch_array($nodeRes); + +$edgeSql = "SELECT $showEdgeFld FROM $tbName WHERE objTypeNo < 1 "; +//echo "
      edgeSql=$edgeSql"; +$edgeRes = mysqli_query($pubConn,$edgeSql); +$edgeRow = mysqli_fetch_array($edgeRes); + + +echo "
      "; +echo ""; +$fldArr=explode(',',$showNodeFld); +$fldNum = sizeof($fldArr); +echo ""; +echo ""; +echo ""; +echo ""; +for($i=0;$i<$fldNum;$i++){ + echo ""; +} +echo ""; +do{ + echo ""; + for($i=0;$i"; + echo " $nodeRow[keyNo]"; + echo ""; + }else{ + echo ""; + } + } + echo ""; +}while($nodeRow = mysqli_fetch_array($nodeRes)); +echo "
      "; +echo "Node list"; +echo "
      $fldArr[$i]
       $nodeRow[$i]
      "; + +echo "

      "; + +echo ""; +$fldArr=explode(',',$showEdgeFld); +$fldNum = sizeof($fldArr); +echo ""; +echo ""; +echo ""; +echo ""; +for($i=0;$i<$fldNum;$i++){ + echo ""; +} +echo ""; +do{ + echo ""; + for($i=0;$i"; + echo " $edgeRow[keyNo]"; + echo ""; + }else{ + echo ""; + } + } + echo ""; +}while($edgeRow = mysqli_fetch_array($edgeRes)); +echo "
      "; +echo "Edge list"; +echo "
      $fldArr[$i]
       $edgeRow[$i]
      "; + +echo "

      "; +echo "  "; +echo ""; +echo ""; +echo "
      "; +?> + + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/cnsConf/cnsConfUp.php b/wxc2_omc/sysDefine/cnsConf/cnsConfUp.php new file mode 100755 index 0000000..67f0af4 --- /dev/null +++ b/wxc2_omc/sysDefine/cnsConf/cnsConfUp.php @@ -0,0 +1,74 @@ + + + +
      +"; +echo ""; +echo ""; + +echo "Template > cnsConf"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; + +?> + + + + + + + + + +
      + + + + + + + + + + + + + + + + + +
      + +
      + + + diff --git a/wxc2_omc/sysDefine/cstaMngDef/appConf.php b/wxc2_omc/sysDefine/cstaMngDef/appConf.php new file mode 100755 index 0000000..63fc813 --- /dev/null +++ b/wxc2_omc/sysDefine/cstaMngDef/appConf.php @@ -0,0 +1 @@ +xxxx diff --git a/wxc2_omc/sysDefine/cstaMngDef/cstaConf.php b/wxc2_omc/sysDefine/cstaMngDef/cstaConf.php new file mode 100755 index 0000000..cdbe3a3 --- /dev/null +++ b/wxc2_omc/sysDefine/cstaMngDef/cstaConf.php @@ -0,0 +1,561 @@ + + + +"; + echo ""; + echo ""; + echo "Template > CSTA Configuration"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +$max_menu = 4; +$db=$csta_db; +$sysTypeNo=isset($sysTypeNo)?$sysTypeNo:'310'; +$selObjIndex=isset($selObjIndex)?$selObjIndex:'new'; +$sysType=omc_sys_code2type($sysTypeNo); +$detailTable=omc_table_name($sysType,'csta-q'); +$sumTable=omc_table_name($sysType,'csta-h'); + + +/**************************************删除一个系统类型***********************************************/ +if($delete){ + $delSql = "DELETE FROM $cstadefine_table WHERE sysTypeNo='$sysTypeNo' AND objIndex='$selObjIndex'"; + $delRes = mysqli_query($pubConn,$delSql); + //---------------- + //插入日志 + insertLog($delSql,0,6); + //------------ + if($delRes){ + echo "$strDeleteSuccess"; + }else{ + echo "$strDeleteFailure"; + } +}//end if($delete) + + +/*****************************添加,保存一个类型*****************************/ +if($save){ + if($selObjIndex == 'new')//插入一个新配置 + { + //判断新添加的配置是否存在 + $judIndexSql = " SELECT COUNT(*) FROM $cstadefine_table WHERE sysTypeNo='$sysTypeNo' AND objIndex ='$objIndex' "; + $judIndexRes = @mysqli_query($pubConn,$judIndexSql); + $judIndexRow = @mysqli_fetch_array($judIndexRes); + echo mysqli_error($pubConn); + if($judIndexRow[0]) + { + echo "
      Component always is existed!"; + $noReplate='1'; + } + } + + $replaceSql=" REPLACE INTO $cstadefine_table VALUES('$isEnable','$sysTypeNo','$objIndex','$oid','$useAgent','$detailTable','$sumTable','$hasSubSys','$sumUp','$checkTime','$isFullRow','$cstaType','$width','$id1Start','$id1End','$id1Offset','$id1Field','$id2Start','$id2End','$id2Offset','$id2Field','$mesField','$csvPath') "; + echo "
      replaceSql=$replaceSql"; + if(!$noReplate) + { + $errorstr=mysqli_error($pubConn); + $replaceRes = @mysqli_query($pubConn,$replaceSql); + echo "save failed, $errorstr"; //mysqli_error($pubConn); + $selObjIndex=$objIndex; + } + //------------插入日志------------ + insertLog($replaceSql,0,6); + //------------ + if($replaceRes > 0){ + echo "
      $strSaveSuccess"; + }else{ + echo "
      $strSaveFailure"; + } +} //end if($save) +?> + + + + "; +?> +
      " > + +"; +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + +echo ""; +echo ""; +echo ""; +echo ""; + + +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      "; +echo "

      $strCSTAConfiguration

      $strSystemType"; + + +$typeSql = " SELECT sysTypeNo,sysTypeName FROM $sysconf_table WHERE needCSTA = '1' OR needFlow = + '1' ORDER BY sysTypeNo "; +$typeRes = @mysqli_query($pubConn,$typeSql); +$typeRow = @mysqli_fetch_array($typeRes); +echo mysqli_error($pubConn); + +$indexSql = " SELECT * FROM $cstadefine_table WHERE sysTypeNo = '$sysTypeNo' ORDER BY objIndex "; +$indexRes = @mysqli_query($pubConn,$indexSql); +$indexRow = @mysqli_fetch_array($indexRes); +echo mysqli_error($pubConn); + +if($selObjIndex!='new') +{ + $confSql = " SELECT * FROM $cstadefine_table WHERE sysTypeNo = '$sysTypeNo' AND objIndex = '$selObjIndex'"; + $confRes = @mysqli_query($pubConn,$confSql); + $confRow = @mysqli_fetch_array($confRes); + echo mysqli_error($pubConn); + $objIndex = $confRow[objIndex]; + $oid = $confRow[oid]; + $csvPath = $confRow[csvPath]; + $isEnable = $confRow[isEnable]; + $useAgent = $confRow[useAgent]; + $hasSubSys = $confRow[hasSubSys]; + $sumUp = $confRow[sumUp]; + $checkTime = $confRow[checkTime]; + $isFullRow = $confRow[isFullRow]; + $cstaType = $confRow[cstaType]; + $width = $confRow[width]; + $id1Start = $confRow[id1Start]; + $id1End = $confRow[id1End]; + $id1Offset = $confRow[id1Offset]; + $id1Field = $confRow[id1Field]; + $id2Start = $confRow[id2Start]; + $id2End = $confRow[id2End]; + $id2Offset = $confRow[id2Offset]; + $id2Field = $confRow[id2Field]; + $mesField = $confRow[fieldList]; +} + +echo "
      $strExistedIndex"; +echo "
      Index"; +echo ""; +echo "
      OID"; +echo ""; +echo "
      CSV path"; +echo ""; +echo "
      $strEnable "; +if($isEnable==1) +{ + echo "Yes "; + echo "No"; +} +else +{ + echo "Yes "; + echo "No"; +} +echo "
      $strUseAgent "; +if($useAgent==1) +{ + echo "Yes "; + echo "No"; +} +else +{ + echo "Yes "; + echo "No"; +} +echo "
      $strHasSubSys"; +if($hasSubSys==1) +{ + echo "Yes "; + echo "No"; +} +else +{ + echo "Yes "; + echo "No"; +} +echo "
      $strNeedSumUp"; +if($sumUp==1) +{ + echo "Yes "; + echo "No"; +} +else +{ + echo "Yes "; + echo "No"; +} +echo "
      $strNeedCheckTime"; +if($checkTime==1) +{ + echo "Yes "; + echo "No"; +} +else +{ + echo "Yes "; + echo "No"; +} +echo "
      $strIsFullRow"; +if($isFullRow==1) +{ + echo "Yes "; + echo "No"; +} +else +{ + echo "Yes "; + echo "No"; +} +echo "
      $strCSTAType"; +echo ""; +echo "
      $strWidth"; +echo ""; +echo "
      $strID1StartNum"; +echo ""; +echo "
      $strID1EndNum"; +echo ""; +echo "
      $strID1Offset"; +echo ""; +echo "
      $strID1Field"; +echo ""; +echo "
      $strID2StartNum"; +echo ""; +echo "
      $strID2EndNum"; +echo ""; +echo "
      $strID2Offset"; +echo ""; +echo "
      $strID2Field"; +echo ""; +echo "
      $strMessageField"; +echo ""; +echo ""; +echo "$strFieldList"; +echo "
      "; + +echo "
      "; +echo ""; +echo ""; +echo ""; +echo ""; +echo ""; +echo "
      $strFieldList"; +echo ""; +echo "
      "; +echo "
      "; +?> +

      " name="save"> +" name="reset"> +" name="delete"> +

      +
      + + + + diff --git a/wxc2_omc/sysDefine/csvDataDef/csv_data_set.php b/wxc2_omc/sysDefine/csvDataDef/csv_data_set.php new file mode 100755 index 0000000..cc7eaf4 --- /dev/null +++ b/wxc2_omc/sysDefine/csvDataDef/csv_data_set.php @@ -0,0 +1,402 @@ + + + + + "; + echo ""; + echo ""; + echo "Template > CSV"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; + echo ""; + adjust_title_tail(); + adjust_content_head(); + echo "
      "; + + $max_menu = 4; + $db = $omc_db; + $db_name = isset($db_name) ? $db_name : $omc_db; + $elementTable = 'elementExistConf'; + + //---------------------- + //选择语言版本 + if ($language_type == 'eng') { + $show_menu_name = menu_name_2; //语种2 + } else { + $show_menu_name = menu_name; //语种1 + } + //----------------------- + + /**************************************删除一个类型说明***********************************************/ + if ($delete) { + $del_sql = "DELETE FROM $syscsvconf_table WHERE key_menu_id='$key_menu_id'"; + $del_result = mysqli_query($pubConn, $del_sql); + //---------------- + //插入日志 + //insertLog(0,3,$del_sql,$user_info["account"]); + insertLog($user_info["account"]); + //------------ + if ($del_result) { + echo "$strDeleteSuccess"; + } else { + echo "$strDeleteFailure"; + } + } //end if($delete) + + + /*****************************添加,保存一个新的参数类型或创建新的参数结构表*****************************/ + if ($save) { + $key_menu_id = $type_list; + if ($key_menu_id == 'new') { //插入一个新类型 + $save_sql = "REPLACE INTO $syscsvconf_table + (sys_type, sys_id, obj_id, if_enable, if_subsys, menu_name, menu_name_2, can_download, can_upload, server_name, db_name, table_name, where_find, description, description_2, level_0, level_1, level_2, level_3) + VALUES + ('$sys_type', '$sys_id', '$obj_id', '$if_enable', '$if_subsys', '$menu_name', '$menu_name_2', '$can_download', '$can_upload', '$server_name', '$db_name', '$table_name', '$where_find', '$description', '$description_2', '$level_0', '$level_1', '$level_2', '$level_3') + "; + } elseif (isset($key_menu_id)) { //修改已有类型 + $save_sql = " + UPDATE $syscsvconf_table + SET + sys_type = '$sys_type', + sys_id = '$sys_id', + obj_id = '$obj_id', + if_enable = '$if_enable', + if_subsys = '$if_subsys', + menu_name = '$menu_name', + menu_name_2 = '$menu_name_2', + can_download = '$can_download', + can_upload = '$can_upload', + server_name = '$server_name', + db_name = '$db_name', + table_name = '$table_name', + where_find = '$where_find', + description = '$description', + description_2 = '$description_2', + level_0 = '$level_0', + level_1 = '$level_1', + level_2 = '$level_2', + level_3 = '$level_3' + WHERE key_menu_id='$key_menu_id' + "; + } + //echo "
      $save_sql"; + $save_result = mysqli_query($pubConn, $save_sql); + echo mysqli_error($pubConn); + //------------插入日志------------ + //insertLog(0,3,$save_sql,$user_info["account"]); + insertLog($user_info["account"]); + //------------ + //echo "$save_sql"; + if ($save_result > 0) { + echo "$strSaveSuccess"; + } else { + echo mysqli_error($pubConn); + echo "$strSaveFailure"; + } + } //end if($save) + ?> + + + +
      "> + + + + + + + + + + + + + + + + + + + + + + + + "; + echo ""; + echo ""; + echo ""; + + + echo ""; + echo ""; + echo ""; + echo ""; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      +
      + + + + "; + echo ""; + do { + echo ""; + } while ($type_rows = @mysqli_fetch_array($type_result)); + ?> + +
      + +
      +
      + +
      $strEnableDaemon"; + if ($if_enable == 1) { + echo "Yes "; + echo "No"; + } else { + echo "Yes "; + echo "No"; + } + echo "
      Subsys parameter"; + if ($if_subsys == 1) { + echo "Yes "; + echo "No"; + } else { + echo "Yes "; + echo "No"; + } + echo "
      + (Only input when enable,:0506020102) +
      + (:MSC_0_0) +
      : ">
      : ">
      : + ">• + ">• + ">• + "> +
      :">
      : + 0 || !isset($can_download)) echo "checked"; + echo ">$strLoadOut"; ?> "> + + 0 || !isset($can_upload)) echo "checked"; + echo ">$strLoadIn"; ?> "> + +
      :">    +
      :">
      + + + +

      " name="save"> + " name="reset"> + " name="delete"> +

      + "> + "> +
      + + + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/ledDef/led_list_down.php b/wxc2_omc/sysDefine/ledDef/led_list_down.php new file mode 100755 index 0000000..1e53873 --- /dev/null +++ b/wxc2_omc/sysDefine/ledDef/led_list_down.php @@ -0,0 +1,219 @@ + + + + +
      + +
      + + + + + + + + + + + + + + +
      :-:  x: y::  x:y:
        " name="submit">" name="reset">
      + + + + + + + + + + + + + +
      :- + : + + + : + +
      + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //状态 + /* + $status_arr=array('blink gray','blink green','blink yellow','blink red','blink blue','blink umbra','blink white','not use','gray','green','yellow','red','blue','umbra','white','not use'); + echo "$strStatus : "; + echo ""; + */ + echo "$strInitLEDStatus"; + echo ""; + echo ""; + echo ""; + //偏移坐标 + echo "$strPointOfMove"; + ?> +   x:y: + " name="submit"> + " name="reset">
      + sel_sql = $sel_sql"; + $rows = mysqli_fetch_array($result); + $shape = $rows[shape]; + //$status = $rows[key_status]; + $src_page_type = $rows[key_src_page_type]; + $src_page_num = $rows[key_src_page_num]; + $dst_page_type = $rows[dst_page_type]; + $dst_page_num = $rows[dst_page_num]; + $point_x = $rows[point_x]; + $point_y = $rows[point_y]; + $sync_from_led = $rows[sync_from_led]; + $remark = $rows[remark]; + $mode = edit; + }else{ + /* + echo "$strAddLED:"; + echo "ID = "; + $mode = add; + */ + ?> + +
      + + + + + + + + + + + + + + + + + + + + +
      : "> :"> : "> :"> ">
      + "; + echo "$strShape"; + echo ""; + /* + $status_arr=array('blink gray','blink green','blink yellow','blink red','blink blue','blink umbra','blink white','not use','gray','green','yellow','red','blue','umbra','white','not use'); + echo "$strStatus"; + echo ""; + */ + ?> + + :  + x=">, + y="> +   " > + " name="submit">" name="reset"> + +
      + "; + } +} +?> + +"; +echo "\n "; +echo "\n "; +echo "\n "; +echo "\n "; +?> + + + + + + diff --git a/wxc2_omc/sysDefine/ledDef/led_list_index.php b/wxc2_omc/sysDefine/ledDef/led_list_index.php new file mode 100755 index 0000000..48059f9 --- /dev/null +++ b/wxc2_omc/sysDefine/ledDef/led_list_index.php @@ -0,0 +1,32 @@ + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/sysDefine/ledDef/led_list_up.php b/wxc2_omc/sysDefine/ledDef/led_list_up.php new file mode 100755 index 0000000..2b158bb --- /dev/null +++ b/wxc2_omc/sysDefine/ledDef/led_list_up.php @@ -0,0 +1,252 @@ +sel_src_page_type=$sel_src_page_type"; +if($DEBUG) echo "
      sel_src_page_num=$sel_src_page_num"; + +//---------------------------更新----------------------------- +if($mode == 'edit' && isset($selected_led_num)){ + $update_sql = "UPDATE $table_name + SET shape ='$shape', + key_src_page_type = '$src_page_type', + key_src_page_num = '$src_page_num', + dst_page_type = '$dst_page_type', + dst_page_num = '$dst_page_num', + point_x = '$point_x', + point_y = '$point_y', + remark = '$remark', + sync_from_led = '$sync_from_led' + WHERE key_led_num ='$selected_led_num' + "; + mysqli_query($pubConn,$update_sql); + if($DEBUG) echo "
      update_sql = $update_sql"; + echo mysqli_error($pubConn); +} + + +function get_page_id($page_type,$page_num,$offset){ + $offset = array(20480,20489,20577); + if($page_type < 50){ + $type_offset = $offset[$page_type]; + switch($page_type){ + case 0: + $page_type = "Map"; + break; + case 1: + $page_type = "Central_office"; + break; + case 2: + $page_type = "BSS"; + break; + default: + $page_type = "unkown"; + return($page_type); + } + $page_num = $page_num - $type_offset; + $page_id = $page_type.' - '.$page_num; + }else{ + $sys_code = $page_type - 50; + $sys_type = omc_sys_code2type($sys_code); + //echo "
      sys_type=$sys_type"; + $sys_num = substr($page_num,0,2); + $subsys_num = substr($page_num,2,2); + $sys_id = $sys_type.'_'.$sys_num.'_'.$subsys_num; + $page_id = $sys_id; + } + return($page_id); +} + +function get_status($status_num) +{ + $status=array('blink gray','blink green','blink yellow','blink red','blink blue','blink umbra','blink white','not use','gray','green','yellow','red','blue','umbra','white','not use'); + for($i=0;$i < sizeOf($status);$i++){ + if($i == $status_num){ + return($status[$i]); + }elseif($i == sizeOf($status)){ + return('unkown'); + }else{ + continue; + } + + } +} + +?> + + +"; + +$led_page_def = array( + array('Map', 0, 20480), + array('Central Office', 1, 20489), + array('BSS-0', 2 ,20577), + array('BSS-1', 2 ,20578), + array('BSS-2', 2 ,20579), + array('BSS-3', 2 ,20580), + array('BSS-4', 2 ,20581), + array('BSS-5', 2 ,20582), + array('BSS-6', 2 ,20583), + array('BSS-7', 2 ,20584), + array('BSS-8', 2 ,20585), + array('BSS-9', 2 ,20586), + array('BSS-10', 2 ,20587), + array('BSS-11', 2 ,20588) +); +echo ""; + + +if($scroll_y > 0){ + echo ""; +}else{ + echo ""; +} +$sel_sql = "SELECT * FROM $table_name + WHERE key_src_page_type = '$sel_src_page_type' + AND key_src_page_num = '$sel_src_page_num' + AND point_x != '999' + ORDER BY $sort_field $sort_direction + "; +$result = mysqli_query($pubConn,$sel_sql); +echo mysqli_error($pubConn); +if($DEBUG) +echo "
      sel_sql = $sel_sql"; +$rows = mysqli_fetch_array($result); +?> + + + + + + + + + + + +"; + //Echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + $k++; +}while($rows = mysqli_fetch_array($result)); +?> +
      LED_ID 
      $led_num$status$shape$src_page_id$dst_page_id($rows[point_x],$rows[point_y])$remark Edit
      + + + diff --git a/wxc2_omc/sysDefine/ledDef/led_set_down.php b/wxc2_omc/sysDefine/ledDef/led_set_down.php new file mode 100755 index 0000000..8f77e55 --- /dev/null +++ b/wxc2_omc/sysDefine/ledDef/led_set_down.php @@ -0,0 +1,220 @@ + + + + +
      + +
      + + + + + + + + + + + + + + +
      :-:  x: y::  x:y:
        " name="submit">" name="reset">
      + + + + + + + + + + + + + +
      :- + : + + + : + +
      + "; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //状态 + /* + $status_arr=array('blink gray','blink green','blink yellow','blink red','blink blue','blink umbra','blink white','not use','gray','green','yellow','red','blue','umbra','white','not use'); + echo "$strStatus : "; + echo ""; + */ + echo "$strInitLEDStatus"; + echo ""; + echo ""; + echo ""; + //偏移坐标 + echo "$strPointOfMove"; + ?> +   x:y: + " name="submit"> + " name="reset">
      + sel_sql = $sel_sql"; + $rows = mysqli_fetch_array($result); + $shape = $rows[shape]; + //$status = $rows[key_status]; + $src_page_type = $rows[key_src_page_type]; + $src_page_num = $rows[key_src_page_num]; + $dst_page_type = $rows[dst_page_type]; + $dst_page_num = $rows[dst_page_num]; + $point_x = $rows[point_x]; + $point_y = $rows[point_y]; + $src_led = $rows[sync_from_led]; + $remark = $rows[remark]; + $mode = edit; + }else{ + /* + echo "$strAddLED:"; + echo "ID = "; + $mode = add; + */ + ?> + +
      + + + + + + + + + + + + + + + + + + + + +
      : "> :"> : "> :"> ">
      + "; + echo "$strShape"; + echo ""; + /* + $status_arr=array('blink gray','blink green','blink yellow','blink red','blink blue','blink umbra','blink white','not use','gray','green','yellow','red','blue','umbra','white','not use'); + echo "$strStatus"; + echo ""; + */ + ?> + + :  + x=">, + y="> +   " > + " name="submit">" name="reset"> + +
      + "; + } +} +?> + +"; +echo "\n "; +echo "\n "; +echo "\n "; +echo "\n "; +echo "\n "; +?> + + + + + + diff --git a/wxc2_omc/sysDefine/ledDef/led_set_index.php b/wxc2_omc/sysDefine/ledDef/led_set_index.php new file mode 100755 index 0000000..a878c0a --- /dev/null +++ b/wxc2_omc/sysDefine/ledDef/led_set_index.php @@ -0,0 +1,32 @@ + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/sysDefine/ledDef/led_set_up.php b/wxc2_omc/sysDefine/ledDef/led_set_up.php new file mode 100755 index 0000000..e9677dd --- /dev/null +++ b/wxc2_omc/sysDefine/ledDef/led_set_up.php @@ -0,0 +1,391 @@ + mode = $mode, submode = $submode"; +//key_led_num shape key_status key_src_page_type key_src_page_num dst_page_type dst_page_num point_x point_y width height remark update_time + + +//===========================================单个LED更新或添加===================================================== +//---------------------------更新----------------------------- +if($mode == 'edit' && isset($selected_led_num)){ + $update_sql = "UPDATE $table_name + SET shape ='$shape', + key_src_page_type = '$src_page_type', + key_src_page_num = '$src_page_num', + dst_page_type = '$dst_page_type', + dst_page_num = '$dst_page_num', + point_x = '$point_x', + point_y = '$point_y', + remark = '$remark', + sync_from_led = '$src_led' + WHERE key_led_num ='$selected_led_num' + "; + mysqli_query($pubConn,$update_sql); + if($DEBUG) echo "
      update_sql = $update_sql"; + echo mysqli_error($pubConn); +//---------------------------添加----------------------------- +}elseif($mode == 'add'){ + $insert_sql = "INSERT INTO $table_name + (key_led_num,shape,key_status,key_src_page_type,key_src_page_num,dst_page_type,dst_page_num,point_x,point_y,width,height,remark) + VALUES + ('$add_led_num','$shape','15','$src_page_type','$src_page_num','$dst_page_type','$dst_page_num','$point_x','$point_y','1','1','$remark') + "; + if($DEBUG) echo "
      $insert_sql"; + mysqli_query($pubConn,$insert_sql); + echo mysqli_error($pubConn); +//==================================================批量LED更新============================================================ +//--------------------------设置批量更新------------------------------ +}elseif($mode == 'batch' && $submode == 'move'){ + $move_x = $move_x -0; + $move_y = $move_y -0; + if($DEBUG) echo "
      sel_src_page = $sel_src_page,sel_dst_page = $sel_dst_page,sel_shape = $sel_shape,sel_status = $sel_status"; + $src_page_sql = ($sel_src_page == 'on')?" key_src_page_type = '$src_page_type', key_src_page_num = '$src_page_num', ":''; + $dst_page_sql = ($sel_dst_page == 'on')?" dst_page_type = '$dst_page_type', dst_page_num = '$dst_page_num', ":''; + $shape_sql = ($sel_shape == 'on')?" shape ='$shape', ":''; + $status_sql = ($sel_status == 'on')?" key_status ='$status', ":''; + $point_sql = "point_x = (point_x + $move_x), point_y = (point_y + $move_y) "; + $where_sql = "WHERE key_led_num >='$bgn_led' AND key_led_num <='$end_led'"; + + //-------更新原始表的状态数据------- + $update_sql = "UPDATE $table_name SET ".$src_page_sql.$dst_page_sql.$shape_sql.$status_sql.$point_sql.$where_sql; + mysqli_query($pubConn,$update_sql); + if($DEBUG) echo "
      update_sql = $update_sql"; + echo mysqli_error($pubConn); + + //-----------更新内存表的LED状态---------- + if($sel_status == 'on'){ + //--更新内存表的状态数据--- + $update_status_sql = "UPDATE sysLedStat + SET key_status='15151515151515151515151515151515' + WHERE if(key_led_num < '$divide_number',key_led_num >= FLOOR($bgn_led/16),key_led_num >= '$bgn_led') + AND if(key_led_num < '$divide_number',key_led_num <= FLOOR($end_led/16),key_led_num <= '$end_led') + "; + mysqli_query($pubConn,$update_status_sql); + if($DEBUG) echo "
      update_status_sql = $update_status_sql"; + echo mysqli_error($pubConn); + //--标识共享内存--- + //删除LED状态命令,如果命令5秒钟无响应,作为超时处理 + //byte0:0/1/2/3=无命令/命令待处理/处理成功/处理失败 + //byte1-4:待清除LED起始编号 + //byte5-8:待清除LED结束编号 + //注:LED灯编号为16进制字符,如果只删除一个LED,LED起止编号一样即可 + //例如:“1000F000F”表示删除LED15 + + $shm_offset = 1; + $bgn_led_hex = dechex($bgn_led); + $bgn_led_hex = omc_keep_length($bgn_led_hex,0,4); + $end_led_hex = dechex($end_led); + $end_led_hex = omc_keep_length($end_led_hex,0,4); + $shm_value = '1'.$bgn_led_hex.$end_led_hex; + if($DEBUG) echo "
      set:$shm_value"; + $shm_result = omc_set_shm($shm_value,$shm_offset); + if($shm_result < 0){ + echo "
      Set LED(from $bgn_led to $end_led) fail,Please try again[can not write share memory]"; + }else{ + sleep(5); + $shm_count = 9; + $shm_result = omc_get_shm($shm_offset,$shm_count); + if($DEBUG) echo "
      get:$shm_result"; + $shm_result = substr($shm_result,0,1); + if($shm_result != '2'){ + echo "
      Set LED(from $bgn_led to $end_led) fail,Please try again[return error]"; + } + } + } + +//---------------------------间隔批量更新----------------------------- +}elseif($mode == 'batch' && $submode == 'mid'){ + for($i = $bgn_led; $i < $end_led; $i++){ + $update_sql = "UPDATE $table_name + SET point_x = '$bgn_x' , + point_y = '$bgn_y' + WHERE key_led_num ='$i' + "; + mysqli_query($pubConn,$update_sql); + if($DEBUG) echo "
      update_sql = $update_sql"; + echo mysqli_error($pubConn); + $bgn_x += $move_x; + $bgn_y += $move_y; + } +} + +//==================================================LED列表显示============================================================ +$offset = array(20480,20489,20577); +function get_page_id($page_type,$page_num,$offset){ + if($page_type < 50){ + $type_offset = $offset[$page_type]; + switch($page_type){ + case 0: + $page_type = "Map"; + break; + case 1: + $page_type = "Center"; + break; + case 2: + $page_type = "BSS"; + break; + default: + $page_type = "unkown"; + return($page_type); + } + $page_num = $page_num - $type_offset; + $page_id = $page_type.' - '.$page_num; + }else{ + $sys_code = $page_type - 50; + $sys_type = omc_sys_code2type($sys_code); + //echo "
      sys_type=$sys_type"; + $sys_num = substr($page_num,0,2); + $subsys_num = substr($page_num,2,2); + $sys_id = $sys_type.$sys_num.'_'.$subsys_num; + $page_id = $sys_id; + } + return($page_id); +} + +function get_status($status_num) +{ + $status=array('blink gray','blink green','blink yellow','blink red','blink blue','blink umbra','blink white','not use','gray','green','yellow','red','blue','umbra','white','not use'); + for($i=0;$i < sizeOf($status);$i++){ + if($i == $status_num){ + return($status[$i]); + }elseif($i == sizeOf($status)){ + return('unkown'); + }else{ + continue; + } + + } +} + +//--------------------------- 初始化页面显示变量----------------------------------------- +if (!$number_of_records){ + $initial_record = 0;//初始纪录号 + $str_sql_all = "SELECT count(*) as number_of_records FROM $table_name"; + if($DEBUG)echo "
      str_sql_all = $str_sql_all"; + $count_result = @mysqli_query($pubConn,$str_sql_all); + $count_record = @mysql_fetch_object($count_result); + $number_of_records = $count_record->number_of_records; + if(!$number_of_records){ + echo "
      $strNotFindRecord"; + exit(); + } + $all_page_num = ceil($number_of_records / $number_records_to_display); //总页码 +} + +$this_page_num = round($initial_record / $number_records_to_display)+1; //本页页码 + +//------------------------------下面是控制分页显示,传递变量------------------------------ + +if ($number_of_records >= 1) { + //下一页的开始编号 + $next_index = $initial_record + $number_records_to_display; + if($next_index > $number_of_records){ + $next_index = $number_of_records; + } + //上一页的开始编号 + $prev_index = $initial_record - $number_records_to_display; + if ($prev_index < 0) { + $prev_index = 0; + } +} + +//上一页连接图标 +if ($initial_record != 0) { + $t1 = "all_page_num=$all_page_num&initial_record=$prev_index&number_of_records=$number_of_records"; + $prev_img =""; + $prev_img .= "\"$strPreviousPage\" "; +} + +//下一页连接图标 +if ($next_index != $number_of_records && $number_of_records >0) { + $t2 = "all_page_num=$all_page_num&initial_record=$next_index&number_of_records=$number_of_records"; + $next_img =""; + $next_img .="\"$strNextPage\" "; +} +$last_num_this_page = $next_index -1; + +//--------------------------------列表显示----------------------------------------------- +echo ""; +echo "
      "; +echo "Records:$initial_record - $last_num_this_page of $number_of_records, Page: $this_page_num "; +echo ""; +echo "$prev_img $next_img"; +//echo ""; +//echo "$strAddLED"; +echo ""; +echo "$strBatchOfLEDDefineSetting"; +echo ""; +echo "$strBatchOfLEDClearanceSetting"; +echo "
      "; +?> + + + + 0){ + echo ""; +}else{ + echo ""; +} +$sel_sql = "SELECT * FROM $table_name + ORDER BY $sort_field $sort_direction + LIMIT $initial_record, $number_records_to_display + "; +$result = mysqli_query($pubConn,$sel_sql); +echo mysqli_error($pubConn); +if($DEBUG) echo "
      sel_sql = $sel_sql"; +$rows = mysqli_fetch_array($result); + +$sel_status_sql = "SELECT key_status + FROM sysLedStat + WHERE if(key_led_num < '$divide_number',key_led_num >= floor($initial_record/16),key_led_num >= $initial_record) + AND if(key_led_num < '$divide_number',key_led_num <= floor(($initial_record+$number_records_to_display)/16),key_led_num <= ($initial_record+$number_records_to_display)) + "; +$status_result = mysqli_query($pubConn,$sel_status_sql); +echo mysqli_error($pubConn); +if($DEBUG) echo "
      sel_status_sql = $sel_status_sql"; +$status_rows = mysqli_fetch_array($status_result); +?> +
      + + + + + + + + + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + //echo ""; + echo ""; + $k++; + if(($led_num+1) >= $divide_number){ + $status_rows = mysqli_fetch_array($status_result); + }else if((($led_num+1)%16) == 0){ + $status_rows = mysqli_fetch_array($status_result); + } +}while($rows = mysqli_fetch_array($result)); +?> +
      LED_ID + +
      $led_num$status$shape$src_page_id$dst_page_id($rows[point_x],$rows[point_y])$remarkeditdel
      +
      + + diff --git a/wxc2_omc/sysDefine/logMngDef/logAttrDef.php b/wxc2_omc/sysDefine/logMngDef/logAttrDef.php new file mode 100755 index 0000000..3e03c6e --- /dev/null +++ b/wxc2_omc/sysDefine/logMngDef/logAttrDef.php @@ -0,0 +1,650 @@ + + + + + "; + echo ""; + echo ""; + echo "Template > Log Management > Log Structure"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; + echo ""; + adjust_title_tail(); + adjust_content_head(); + echo "
      "; + + $DEBUG = 0; + + function omcGetObjDb($sysTypeNo) + { + $dbName = 'OBJ_' . $sysTypeNo; + return ($dbName); + } + + $pubDb = 'OMC_PUB'; + $sysConfTable = 'OMC_PUB.sysConf'; + $dataConfTable = 'OMC_PUB.sysLogSourceConf'; + + if (!isset($sysTypeNo)) { + $sysTypeSql = "SELECT sysTypeNo + FROM $dataConfTable + ORDER BY sysTypeNo LIMIT 0,1 + "; + if ($DEBUG) echo "
      $sysTypeSql"; + $sysTypeResult = mysqli_query($pubConn, $sysTypeSql); + $sysTypeRows = @mysqli_fetch_array($sysTypeResult); + $sysTypeNo = $sysTypeRows[sysTypeNo]; + if ($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + } + + $objDb = omcGetObjDb($sysTypeNo); + if ($DEBUG) echo "
      objDb=$objDb"; + $dataTypeNo = isset($dataTypeNo) ? $dataTypeNo : 0; + if ($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; + $dataAttrDefTable = 'logAttrDef_' . $dataTypeNo; + if ($DEBUG) echo "
      dataAttrDefTable=$dataAttrDefTable"; + $maxLevelNum = 5; + + //---------------------- + //选择语言版本 + if ($language == 'eng') { + $objNameField = name_2; //语种2 + } else { + $objNameField = name_1; //语种1(默认语种) + } + //----------------------- + + /**************************************删除一个类型说明***********************************************/ + if ($delete) { + $delSql = "DELETE FROM $dataAttrDefTable WHERE keyId='$keyId'"; + $delResult = mysqli_query($pubConn, $delSql); + echo mysqli_error($pubConn); + //---------------- + //插入日志 + + //------------ + if ($delResult) { + echo ""; + } else { + echo ""; + } + } //end if($delete) + + + /*****************************添加,保存一个新的参数类型或创建新的参数结构表*****************************/ + if ($save) { + if ($DEBUG) echo "
      keyId = $keyId"; + if ($keyId == 'new') { //插入一个新类型 + $saveSql = "REPLACE INTO $dataAttrDefTable (fieldName,name_1,name_2,desc_1,desc_2,dataTypeNo,number,length,valueType,operType,initValue,minValue,maxValue,setTemplate_1,setTemplate_2,needNote,note_1,note_2,level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10) VALUES('$fieldName','$name_1','$name_2','$desc_1','$desc_2','$dataTypeNo','$number','$length','$valueType','$operType','$initValue','$minValue','$maxValue','$setTemplate_1','$setTemplate_2','$needNote','$note_1','$note_2','$level_1','$level_2','$level_3','$level_4','$level_5','$level_6','$level_7','$level_8','$level_9','$level_10')"; + $saveResult = mysqli_query($pubConn, $saveSql); + if ($saveResult) { + $keyIdSel = "SELECT keyId FROM $dataAttrDefTable WHERE + level_1='$level_1' AND + level_2='$level_2' AND + level_3='$level_3' AND + level_4='$level_4' AND + level_5='$level_5' AND + level_6='$level_6' AND + level_7='$level_7' AND + level_8='$level_8' AND + level_9='$level_9' AND + level_10='$level_10' + "; + $keyIdResult = mysqli_query($pubConn, $keyIdSel); + $keyIdeRows = mysqli_fetch_array($keyIdResult); + $keyId = $keyIdeRows[keyId]; + } + } elseif ($keyId > 0) { //修改已有类型 + if ($needNote != 1) { + $needNote = 0; + } + $saveSql = "UPDATE $dataAttrDefTable + SET + fieldName='$fieldName', + name_1='$name_1', + name_2='$name_2', + desc_1='$desc_1', + desc_2='$desc_2', + dataTypeNo='$dataTypeNo', + number='$number', + length='$length', + valueType='$valueType', + operType='$operType', + initValue='$initValue', + minValue='$minValue', + maxValue='$maxValue', + needNote='$needNote', + note_1='$note_1', + note_2='$note_2', + level_1='$level_1', + level_2='$level_2', + level_3='$level_3', + level_4='$level_4', + level_5='$level_5', + level_6='$level_6', + level_7='$level_7', + level_8='$level_8', + level_9='$level_9', + level_10='$level_10' + WHERE keyId='$keyId' + "; + $saveResult = mysqli_query($pubConn, $saveSql); + } else { + echo "
      Error: keyId == NULL"; + } + if ($DEBUG) echo "
      $saveSql"; + echo mysqli_error($pubConn); + if ($saveResult > 0) { + //更新备份文件 + $csvFileName = '/usr/local/apache/htdocs/db_backup/other/' . $objDb . '.' . $dataAttrDefTable . '.csv'; + if ($DEBUG) echo "
      csvFileName=$csvFileName"; + @unlink($csvFileName); + $csvFileUpdateSql = " SELECT * + INTO OUTFILE '$csvFileName' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $dataAttrDefTable + "; + $csvFileUpdateResult = mysqli_query($pubConn, $csvFileUpdateSql); + if ($DEBUG) echo "
      csvFileUpdateSql = $csvFileUpdateSql
      "; + echo mysqli_error($pubConn); + echo ""; + } else { + echo ""; + } + } //end if($save) + + /*****************************创建参数库和参数配置表*****************************/ + //创建参数库 + $dbList = mysqli_query($link[0], "SHOW DATABASES"); + $dbNum = mysqli_num_rows($dbList); + $dbRows = mysqli_fetch_array($dbList); + for ($i = 0; $i < $dbNum; $i++) { + // $dbName = mysql_dbname($dbList, $i); + $dbName = $dbRows[0]; + + if ($dbName == $objDb) { + if ($DEBUG) echo "
      $objDb have be created"; + break; + } + if ($i == $dbNum - 1) { + if ($DEBUG) echo "
      $objDb have not be created"; + //step 1.create objDb + $sql = "CREATE DATABASE $objDb"; + mysqli_query($pubConn, $sql); + if ($DEBUG) echo "
      create $objDb sql =$sql"; + echo mysqli_error($pubConn); + } + } + //创建用户参数定义表 + if ($dbName) $dbConn=mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $dbName); + $tableList= mysqli_query($dbConn,"SHOW TABLES"); + $tableNum = mysqli_num_rows($tableList); + $tableRows = mysqli_fetch_array($tableList); + for ($i = 0; $i < $tableNum; $i++) { + //$tableName = mysql_tablename($tableList, $i); + $tableName = $tableRows[0]; + if ($tableName == $dataAttrDefTable) { + if ($DEBUG) echo "
      $dataAttrDefTable have be created"; + break; + } + if ($i == $tableNum - 1) { + //step 2.create paramConf table in objDb + $sql = "CREATE TABLE $dataAttrDefTable ( + keyId tinyint(4) NOT NULL auto_increment, + fieldName varchar(50) NOT NULL, + name_1 varchar(30) NOT NULL, + name_2 varchar(30) NOT NULL, + desc_1 varchar(255) NOT NULL, + desc_2 varchar(255) NOT NULL, + dataTypeNo tinyint(1) DEFAULT '0' NOT NULL, + operType tinyint(1) DEFAULT '0' NOT NULL, + number int(6) DEFAULT '0' NOT NULL, + length smallint(3) DEFAULT '0' NOT NULL, + valueType tinyint(1) DEFAULT '0' NOT NULL, + initValue varchar(255) NOT NULL, + minValue varchar(255) NOT NULL, + maxValue varchar(255) NOT NULL, + setTemplate_1 text NOT NULL, + setTemplate_2 text NOT NULL, + needNote tinyint(1) DEFAULT '0' NOT NULL, + note_1 varchar(200) NOT NULL, + note_2 varchar(200) NOT NULL, + level_1 int(5) DEFAULT '0' NOT NULL, + level_2 int(5) DEFAULT '0' NOT NULL, + level_3 int(5) DEFAULT '0' NOT NULL, + level_4 int(5) DEFAULT '0' NOT NULL, + level_5 int(5) DEFAULT '0' NOT NULL, + level_6 int(5) DEFAULT '0' NOT NULL, + level_7 int(5) DEFAULT '0' NOT NULL, + level_8 int(5) DEFAULT '0' NOT NULL, + level_9 int(5) DEFAULT '0' NOT NULL, + level_10 int(5) DEFAULT '0' NOT NULL, + PRIMARY KEY (keyId), + KEY level_1 (level_1), + KEY level_2 (level_2), + KEY level_3 (level_3), + KEY level_4 (level_4), + KEY level_5 (level_5), + KEY level_6 (level_6), + KEY level_7 (level_7), + KEY level_8 (level_8), + KEY level_9 (level_9), + KEY level_10 (level_10) + )"; + mysqli_query($pubConn, $sql); + if ($DEBUG) echo "
      create paramConf table sql =$sql"; + echo mysqli_error($pubConn); + break; + } + } + + /*****************************显示一个设备类型的参数定义*****************************/ + ?> + + + +
      "> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + "; + $objSql = "SELECT * FROM $dataAttrDefTable ORDER BY $orderBy"; + $objResult = mysqli_query($pubConn, $objSql); + $objNum = mysqli_num_rows($objResult); + echo ""; + while ($objRows = mysqli_fetch_array($objResult)) { + echo ""; + } + ?> + + selected Id = $keyId"; + if ($DEBUG) echo "
      objSql = $objSql"; + if ($DEBUG) echo mysqli_error($pubConn); + ?> +
      : + "; + if ($i < $maxLevelNum) { + echo "•"; //dot + } + } + ?> +
      + + + "; + echo ""; + $tmpArr = explode('.', $dataStoreTable); + $subscriberDB = $tmpArr[0]; + $dataStoreTable = $tmpArr[1]; + //$fieldResult = mysql_list_fields($subscriberDB, $dataStoreTable); + $fieldResult=mysqli_query($subscriberDbConn,"SHOW COLUMNS FROM $dataStoreTable"); + + $i = 0; + while ($tmpName =mysqli_fetch_array($fieldResult)) { + echo ""; + $i++; + } + echo ""; + ?> +
      : + ">(Chinese) +
      : + ">(English) +
      : + ">(Chinese) +
      : + ">(English) +
      Operation define: + +
      + (Needn't fill the follow fields if this object have sub-objects) + +
      Number of instance: + +
      Value Length(byte): + "> +
      : + +
      : + + min value = " onChange="javascript: chkValue(this);">    + max value = " onChange="javascript: chkValue(this);"> + +
      : + " onChange="javascript: chkValue(this);"> +
      Need Note: + > +
      Note Message 1: + ">(Chinese) +
      Note Message 2: + ">(English) +
      + +

      + + +

      + + +
      + + + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/logMngDef/logEditDef.php b/wxc2_omc/sysDefine/logMngDef/logEditDef.php new file mode 100755 index 0000000..38590d2 --- /dev/null +++ b/wxc2_omc/sysDefine/logMngDef/logEditDef.php @@ -0,0 +1,461 @@ +$sysTypeSql"; + $sysTypeResult = mysqli_query($pubConn,$sysTypeSql); + $sysTypeRows = @mysqli_fetch_array($sysTypeResult); + $sysTypeNo = $sysTypeRows[sysTypeNo]; + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +} + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +$objDb=omcGetObjDb($sysTypeNo); +if($DEBUG) echo "
      objDb=$objDb"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +$dataTypeNo=isset($dataTypeNo)?$dataTypeNo:0; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +$paramConfTable = 'subsParamConf_'.$dataTypeNo; +if($DEBUG) echo "
      paramConfTable=$paramConfTable"; +$maxLevelNum = 10; + +if($DEBUG) echo "
      $paramConfTable
      "; + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField = name_2; + $objSetField = setTemplate_2 ; //语种2 +}else{ + $objNameField = name_1; + $objSetField = setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + +/*****************************保存一个新的参数编辑模板*****************************/ +if($save){ + if($DEBUG) echo "
      keyId = $keyId"; + if($keyId > 0){ + $saveSql = "UPDATE $paramConfTable + SET $objSetField = '$codeArea' + WHERE keyId='$keyId' + "; + $saveResult = mysqli_query($pubConn,$saveSql); + }else{ + echo "
      Error: keyId == NULL"; + exit(); + } + if($DEBUG) echo "
      $saveSql"; + echo mysqli_error($pubConn); + if($saveResult){ + //更新备份文件 + $csvFileName = '/usr/local/apache/htdocs/db_backup/other/'.$objDb.'.'.$paramConfTable.'.csv'; + @unlink($csvFileName); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '$csvFileName' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $paramConfTable + "; + $csvFileUpdateResult = mysqli_query($pubConn ,$csvFileUpdateSql); + echo mysqli_error($pubConn); + echo ""; + }else{ + echo ""; + } +} +?> + + + + + "; +?> +
      " > + + + + + + + + + + + + + valueType=$valueType"; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + + + selected Id = $keyId"; + if($DEBUG) echo "
      objSql = $objSql"; + if($DEBUG) echo mysqli_error($pubConn); + ?> +
      + Design Area + objSql=$objSql
      ";?> + +
      Name">
      offset + From + byte + bit    + Tobyte + bit + +
      Unit Name + +
      Input Field mode: + +
      Put down MenuOption number: + + + Please change "decValue" and "menuName" +
      Created Code
      +
      +    +    + )"> + + +
      +
      +说明: +
      1.一个参数值由多个值组成,于是可分成多个编辑单元,以便用户编辑。 +
      2.每个编辑单元,可制定不同的编辑方式(输入框或下拉菜单)。 +
      3.当使用下拉菜单时,需要替换代码区中的"[v]DecValue[opt]MenuName"中的DecValue(十进制值)和MenuName(菜单名)。 +
      4.如果某段数值预留不用,请用"[unit]reserved[u]bgnOffset-endOffset[u]select"标示。 +
      5.请注意,不能删除语法标签[unit],[u],[v],[opt],[remark],同时也不要在说明中使用这些标签。 +
      6.生成的编辑代码保存后,可点击"Preview"来查看是否正确。 + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/logMngDef/logInit.php b/wxc2_omc/sysDefine/logMngDef/logInit.php new file mode 100755 index 0000000..77fe9e8 --- /dev/null +++ b/wxc2_omc/sysDefine/logMngDef/logInit.php @@ -0,0 +1,99 @@ +function omcGetObjTbl(): Unknown table Type:$tableType"; + exit(); + } + return($tableName); +} +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$getConfSql="SELECT sysTypeName,dataTypeNo,indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable,$systemConfTable + WHERE $sysSubsConfTable.sysTypeNo='$sysTypeNo' + AND $systemConfTable.sysTypeNo='$sysTypeNo' + AND $sysSubsConfTable.dataTypeNo='$dataTypeNo' + "; +if($DEBUG) echo "
      getConfSql=$getConfSql"; +$getConfResult=mysqli_query($pubConn,$getConfSql); +echo mysqli_error($pubConn); +$getConfRows=mysqli_fetch_array($getConfResult); +$keyFieldName =$getConfRows[indexFieldName]; +$srcDataTable =$getConfRows[subsDataTable]; +$tmpDataTable =$getConfRows[tmpDataTable]; + +//复制一个表并且增加一个字段:editFlag +$dropTmpTable="DROP TABLE $tmpDataTable"; +if($DEBUG) echo "
      dropTmpTable=$dropTmpTable"; +$dropRes=mysqli_query($pubConn,$dropTmpTable); +echo mysqli_error($pubConn); + +$getCreateSql="SHOW CREATE TABLE $srcDataTable"; +if($DEBUG) echo "
      getCreateSql=$getCreateSql"; +$getCreateRes=@mysqli_query($pubConn,$getCreateSql); +$row = mysqli_fetch_array($getCreateRes); +echo mysqli_error($pubConn); + +$srcNameArr=explode('.',$srcDataTable); +$srcTableName=$srcNameArr[1]; +$tmpNameArr=explode('.',$tmpDataTable); +$tmpTableName=$tmpNameArr[1]; + +if($DEBUG) echo "
      str_replace($srcTableName,$tmpTableName,$row[1])"; +$createTmpSql=str_replace($srcTableName,$tmpTableName,$row[1]); +if($DEBUG) echo "
      createTmpSql=$createTmpSql"; +$createTmpRes=mysqli_query($pubConn,$createTmpSql); +echo mysqli_error($pubConn); + +$alterSql="ALTER TABLE $tmpDataTable ADD editFlag TINYINT not null FIRST"; +if($DEBUG) echo "
      alterSql=$alterSql"; +$alterRes=mysqli_query($pubConn,$alterSql); +echo mysqli_error($pubConn); + +$alterSql="ALTER TABLE $tmpDataTable ADD INDEX (editFlag)"; +if($DEBUG) echo "
      alterSql=$alterSql"; +$alterRes=mysqli_query($pubConn,$alterSql); +echo mysqli_error($pubConn); +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/logMngDef/logMngDef.php b/wxc2_omc/sysDefine/logMngDef/logMngDef.php new file mode 100755 index 0000000..b2b067e --- /dev/null +++ b/wxc2_omc/sysDefine/logMngDef/logMngDef.php @@ -0,0 +1,267 @@ + + + +"; + echo ""; + echo ""; + echo "Template > Log Management > Log Source"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +$DEBUG = 0; + +$keyId = isset($keyId)?$keyId:1; +$dbName = 'OMC_PUB'; +$tableName = 'sysLogSourceConf'; +$maxLevelNum = 5; + +//选择语言版本 +if($selectedLanguage == 'eng'){ + $nameField=name_2; //语种2 +}else{ + $nameField=name_1; //语种1(默认语种) +} +//keyId sysTypeNo sysNo subSysNo dataTypeNo isEnable isIncremental preObjId maxRecNumOfBuf maxRecNumOfDay dataDefineTable dataStoreTable menuName + + + +/**************************************删除一条记录***********************************************/ +if($delete){ + $delSql = "DELETE FROM $tableName WHERE keyId = '$keyId'"; + $delResult = mysqli_query($pubConn ,$delSql); + echo mysqli_error($pubConn); + if($delResult){ + echo $strDeleteSuccess; + }else{ + echo $strDeleteFailure; + } + //插入日志 + //缺!! + +} //end if($delete) + +/*****************************添加,修改记录*******************************************/ +if($save){ + if($keyId == 'new'){//add + $addSql = "REPLACE INTO $tableName + (keyId,sysTypeNo,sysNo,subSysNo,dataTypeNo,isEnable,isIncremental, + preObjId,maxSizeOfRec,maxRecNumOfBuf,maxRecNumOfDay,dataStoreTable,menuName) + VALUES + ('$keyId','$sysTypeNo','$sysNo','$subSysNo','$dataTypeNo','$isEnable','$isIncremental', + '$preObjId','$maxSizeOfRec','$maxRecNumOfBuf','$maxRecNumOfDay','$dataStoreTable','$menuName') + "; + if($DEBUG) echo "
      $addSql"; + $result = mysqli_query($pubConn ,$addSql); + echo mysqli_error($pubConn); + if($result > 0){ + $getKeyIdSql =" SELECT keyId FROM $tableName + WHERE sysTypeNo = '$sysTypeNo' + AND sysNo = '$sysNo' AND subSysNo = '$subSysNo' + AND dataTypeNo='$dataTypeNo' + AND isEnable='$isEnable' + "; + if($DEBUG) echo "
      $getKeyIdSql"; + $result = mysqli_query($pubConn,$getKeyIdSql); + echo mysqli_error($pubConn); + $rows = mysqli_fetch_array($result); + $keyId = $rows[keyId]; + echo "
      ADD OK"; + }else{ + echo "
      ADD Failed"; + } + }else{//update + $updateSql = "UPDATE $tableName SET + sysTypeNo='$sysTypeNo',sysNo = '$sysNo',subSysNo = '$subSysNo', + dataTypeNo='$dataTypeNo',isEnable='$isEnable',preObjId='$preObjId', + maxSizeOfRec = '$maxSizeOfRec', + maxRecNumOfBuf='$maxRecNumOfBuf',maxRecNumOfDay='$maxRecNumOfDay', + dataStoreTable='$dataStoreTable',menuName='$menuName' + WHERE keyId = '$keyId'"; + if($DEBUG) echo "
      updateSql = $updateSql"; + $updateResult = mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + if($updateResult){ + echo "
      UPDATE OK"; + }else{ + echo "
      UPDATE Failed"; + } + } +} +/*****************************显示一个菜单的定义*****************************/ +?> + + + + +
      " > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + + + +
      : + " >
      : + " >
      : + " >
      : + " >
      : + " >
      : + " >
      : + " >
      : + " >
      : + " >
      : + " >
      : + " >
      +

      + + "; + echo " "; + echo " "; + +?> +

      + +
      + + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/menuConf/menuConf.php b/wxc2_omc/sysDefine/menuConf/menuConf.php new file mode 100755 index 0000000..a60c21b --- /dev/null +++ b/wxc2_omc/sysDefine/menuConf/menuConf.php @@ -0,0 +1,307 @@ + + + +"; + echo ""; + echo ""; + echo "Template > Menu Configuration"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + + +$DEBUG = 1; +$pubDb = 'OMC_PUB'; +$menuTable = 'sysMenuConf'; +$elementTable = 'elementExistConf'; +$maxLevelNum = 5; + +//选择语言版本 +if($selectedLanguage == 'eng'){ + $nameField="name_2"; //语种2 +}elseif ($selectedLanguage == 'chn'){ + $nameField="name_1"; //语种1(默认语种) +} + +/**************************************删除一个菜单***********************************************/ +if($_POST['delete']){ + $delSql = "DELETE FROM $menuTable WHERE keyId = '$keyId'"; + $delResult = mysqli_query($pubConn ,$delSql); + echo mysqli_error($pubConn); + + if($delResult){ + echo $strDeleteSuccess; + }else{ + echo $strDeleteFailure; + } +} //end if($delete) + +/*****************************添加,修改菜单*******************************************/ +if($_POST['save']){ + if($keyId == 'new'){//add + $addSql = "REPLACE INTO $menuTable + (menuTypeNo,level_1,level_2,level_3,level_4,level_5, + name_1,name_2,httpLink,privilege,remark_1,remark_2) + VALUES + ('0','$_POST[level_1]','$_POST[level_2]','$_POST[level_3]','$_POST[level_4]','$_POST[level_5]', + '$_POST[name_1]','$_POST[name_2]','$_POST[httpLink]','$_POST[privilege]','$_POST[remark_1]','$_POST[remark_2]') + "; + if($DEBUG) echo "
      $addSql"; + $result = mysqli_query($pubConn ,$addSql); + echo mysqli_error($pubConn); + + if($result > 0){ + $getKeyIdSql =" SELECT keyId FROM $menuTable + WHERE level_1='$_POST[level_1]' AND level_2='$_POST[level_2]' + AND level_3='$_POST[level_3]' AND level_4='$_POST[level_4]' AND level_5='$_POST[level_5]' AND privilege='$_POST[privilege]' + "; + if($DEBUG) echo "
      $getKeyIdSql"; + $result = mysqli_query($pubConn,$getKeyIdSql); + echo mysqli_error($pubConn); + $rows = mysqli_fetch_array($result); + $keyId = $rows[$keyId]; + echo "
      ADD OK"; + }else{ + echo "
      ADD Failed"; + } + }else{//update + $updateSql = "UPDATE $menuTable SET menuTypeNo='0', level_1='$_POST[level_1]', + level_2='$_POST[level_2]', level_3='$_POST[level_3]', level_4='$_POST[level_4]', + level_5='$_POST[level_5]', privilege='$_POST[privilege]', httpLink='$_POST[httpLink]', + name_1='$_POST[name_1]', name_2 = '$_POST[name_2]',remark_1 = '$_POST[remark_1]', remark_2 = '$_POST[remark_2]' + WHERE keyId = '$_POST[keyId]'"; + if($DEBUG) + echo "
      updateSql = $updateSql"; + $updateResult = mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + if($updateResult){ + echo "
      UPDATE OK"; + }else{ + echo "
      UPDATE Failed"; + } + } +} +/*****************************显示一个菜单的定义*****************************/ +?> + + + + +
      " > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + + +
      : + "; + if($i < $maxLevelNum){ + echo "•"; //dot + } + } + ?> +
      : + " >(Chinese)
      : + " >(English)
      : + " >
      : + " >(Chinese) +
      : + " >(English) +
      + + + +
      Operation define: + "; + + for($i=0; $i < sizeof($privilegeDefArr); $i++){ + //if($privilegeDefArr[$i][show] <= 0) continue; + echo ""; + } + if($menuRows['privilege'] == -1){ + echo ""; + $isDisableShowed=1; + }else{ + echo ""; + } + echo ""; + ?> + +
      +

      + + "; + echo " "; + echo " "; +?> +

      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/pubVarDef/paramList.php b/wxc2_omc/sysDefine/pubVarDef/paramList.php new file mode 100755 index 0000000..173e112 --- /dev/null +++ b/wxc2_omc/sysDefine/pubVarDef/paramList.php @@ -0,0 +1,170 @@ + + + +"; +echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +echo "
      "; + echo "Template > Pub parameters"; + echo ""; + //showHelp($helpId); + echo "
      "; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +//===================================== +//变量定义 +//===================================== +$db='OMC_PUB'; +$tableName='omcPubVarConf'; + +//===================================== +//输入变量 +//===================================== +//保存修改的参数 +if($_REQUEST['actMode']== 'save'){ + $sql = " SELECT * FROM $tableName"; + if($DEBUG) echo "
      sql=$sql"; + $res = @mysqli_query($pubConn,$sql); + + while($row = @mysqli_fetch_array($res)){ + $name=$row[pubVarName]; + $value=$_REQUEST[''.$name]; + $remark=$_REQUEST[$name.'_remark']; + + $sql = " UPDATE $tableName SET + pubVarValue='$value', + remark='$remark' + WHERE pubVarName='$name' + "; + if($DEBUG) echo "
      sql=$sql"; + mysqli_query($pubConn,$sql); + + if(strcmp($row[pubVarName],"globalFTPUserName") == 0) + { + $updatesql="update OMC_PUB.sysSubsConf set ftpLoginName='$value' "; + @mysqli_query($pubConn,$updatesql); + } + else if(strcmp($row[pubVarName],"globalFTPPassword") == 0) + { + $updatesql="update OMC_PUB.sysSubsConf set ftpLoginPwd='$value' "; + @mysqli_query($pubConn,$updatesql); + } + else if(strcmp($row[pubVarName],"ExternalRCM") == 0) + { + $updatesql="update OMC_PUB.sysSubsConf set ExternalRCM='$value' "; + @mysqli_query($pubConn,$updatesql); + + if($value == 0) + { + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=3 and level_2=21 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='2' where level_1=3 and level_2=20 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=5 and level_2=3 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='3' where level_1=5 and level_2=2 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=7 and level_2=4 and level_3=2; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='4' where level_1=7 and level_2=4 and level_3=1; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysCsvConf set db_name='PPS_DB' where menu_name_2='card_info'"; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysCsvConf set if_enable=1 where menu_name_2='used_card_info'"; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update SMCLI.sysCmdDef set serverStr='pps',sysTypeNo=360,tmpTable='OBJ_360.tmpSubsData_1',srcTable='PPS_DB.card_info' where objectStr='ppscard'"; + @mysqli_query($pubConn,$updatesql); + } + else + { + $updatesql="update OMC_PUB.sysMenuConf set privilege='2' where level_1=3 and level_2=21 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=3 and level_2=20 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysMenuConf set privilege='3' where level_1=5 and level_2=3 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=5 and level_2=2 and level_3=0; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysMenuConf set privilege='4' where level_1=7 and level_2=4 and level_3=2; "; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysMenuConf set privilege='-1' where level_1=7 and level_2=4 and level_3=1; "; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update OMC_PUB.sysCsvConf set db_name='RCM_RC_DB' where menu_name_2='card_info'"; + @mysqli_query($pubConn,$updatesql); + $updatesql="update OMC_PUB.sysCsvConf set if_enable=0 where menu_name_2='used_card_info'"; + @mysqli_query($pubConn,$updatesql); + + $updatesql="update SMCLI.sysCmdDef set serverStr='rcm',sysTypeNo=395,tmpTable='OBJ_395.tmpSubsData_1',srcTable='RCM_RC_DB.card_info' where objectStr='ppscard'"; + @mysqli_query($pubConn,$updatesql); + } + } + } + echo "
      Save OK!"; +} + +?> + +
      "> + +"; + +$sql = " SELECT * FROM $tableName ORDER BY instance asc"; +if($DEBUG) echo "
      sql=$sql"; +$res = @mysqli_query($pubConn,$sql); + +while($row = @mysqli_fetch_array($res)){ + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; +} +?> +
      "; +echo "Public Var Define"; +echo "
       {$row[pubVarName]} "; + echo ""; + echo " "; + echo "
      +
           + +     +
      + + + diff --git a/wxc2_omc/sysDefine/sub_inc/sub_chinese_gb.inc b/wxc2_omc/sysDefine/sub_inc/sub_chinese_gb.inc new file mode 100755 index 0000000..36ad3b7 --- /dev/null +++ b/wxc2_omc/sysDefine/sub_inc/sub_chinese_gb.inc @@ -0,0 +1,256 @@ +输入二进制,十进制,十六进制的数值,你可以将其转换成其他两种数制"; +$strTheParaSpecification ="该类型参数简要说明"; +$strThisValueCannotBeEmpty ="此值不能为空"; +$strTimeFieldName ="时间列名"; +$strTypeCode ="类型编号"; +$strValueRange ="取值范围"; +$strWithinFiveLayerDirectory ="不超过5级目录"; +$strWithinTwelveWords ="不超过12个字"; +$strParaTypeForTheTemplate ="该模版适用参数类型"; +$strSystemParaInitialization ="系统参数初始化"; +$strFillEachKindOfParaWithItsDefault ="注意:在数据库中的该系统各类参数将用其缺省值填充"; +$strParaInitializationComplete ="参数初始化完毕"; +$strClickHereForReturn ="点击此处返回"; +$strDefineNewParaType ="定义新参数类型"; +$strDefaultValue ="默认值"; +$strOnlyInputWhenParameter ="当类型是参数时才需要输入"; +$strEnableDaemon ="通知后台"; +$strDeleteGroup ="删除该组合"; + + + + + + +$strUnitName ="单元名称"; +$strUnitNum ="本单元数目"; +$strBeginBit ="开始位"; +$strUnitLength ="单位长度"; +$strConditionCode ="条件代码"; +$strConditionValue ="条件值"; +$strDescription ="描述"; +$strDisplayStatus ="显示状态"; +$strValueType ="取值类型"; +$strGroupName ="组合名称"; +$strGroupType ="组合类型"; +$strSubsystemNum ="子系统数目"; +$strSelectSubsystem ="选择子系统"; +$strOperationVarOne ="运算变量一"; +$strOperationSymbolOne ="运算符一"; +$strOperationValueOne ="运算值一"; +$strLogicSymbol ="逻辑符"; +$strOperationVarTwo ="运算变量二"; +$strOperationSymbolTwo ="运算符二"; +$strOperationValueTwo ="运算值二"; +$strSubConditionRelation ="各子条件关系"; +$strAccordValue ="成立值"; +$strAccordDesc ="成立描述"; +$strAccordDisplayStatus ="成立显示状态"; +$strNotAccordValue ="不成立值"; +$strNotAccordDesc ="不成立描述"; +$strNotAccordDisplayStatus ="不成立显示状态"; +$strSubsystemRelation ="各子系统关系"; +$strPayInvar ="赋常量"; +$strPayVar ="赋变量"; +$strLinkVar ="连接变量"; +$strLinkInvar ="连接常量"; +$strLinkSymbol ="连接符号"; +$strUseType ="使用类型"; +$strAnalysisType ="分析类型"; +$strUnitAnalysis ="单元分析"; +$strUnitGroup ="单元组合"; +$strSystemGroup ="系统组合"; +$strMessageUnitEditBinary ="消息单元编辑(二进制)"; +$strConditionAnalysisNotWrite ="条件分析(如果否的话无需填写下面各项)"; +$strCondition ="条件"; +$strCriticalAlarmRed ="一级告警(红色)"; +$strMajorAlarmSimple ="二级告警(浅红色)"; +$strThirdlyAlarmGreen ="三级告警(绿色)"; +$strNormalBlue ="正常(蓝色)"; +$strNormalBlack ="正常(黑色)"; +$strConditionNum ="条件数目"; +$strOperationValueNotWrite ="运算取值(如果否的话无需填写下面各项)"; +$strOperationTerm ="运算项"; +$strLink ="连接"; +$strToBinary ="转二进制"; +$strToHex ="转十六进制"; +$strMakeUpBit ="补足位"; +$strOperationNum ="运算数目"; +$strExistGroup ="已有组合"; +$strNewGroup ="新组合"; +$strAndOrGroup ="与或组合"; +$strHypotaxisGroup ="从属组合"; +$strLinkGroup ="连接组合"; +$strGroupCondition ="组合条件"; +$strSubCondition ="子条件"; +$strExistUnitAndGroup ="已定义单元和组合"; +$strOperationSymbol ="运算符"; +$strOperationValue ="运算值"; +$strNotInput ="不需输入"; +$strUnitCode ="单元代码"; +$strOperationSymbolCode ="运算符代码"; +$strLogicSymbolCode ="逻辑符代码"; +$strSubConditionNum ="子条件数目"; +$strAnd ="与"; +$strOr ="或"; +$strNotAnd ="不与"; +$strIfGroupConditionAccord ="组合条件若成立"; +$strPayValue ="赋值"; +$strIfNotGroupConditionAccord ="组合条件若成立"; +$strFirstlyCondition ="第一条件"; +$strSecondlyCondition ="第二条件"; +$strSecondlyConditionNum ="第二条件数目"; +$strTableName ="表名"; +$strTransferStatusTemplate ="调用模板类型"; +$strRowNum ="行数"; +$strFieldNum ="列数"; +$strTableHeadName ="表头名"; +$strAdditionExplain ="附加说明"; +$strAdditionValue ="附加值"; +$strCell ="单元格"; +$strFillInvar ="填充常量"; +$strFillVar ="填充变量"; +$strBackgroundColor ="背景色"; +$strExistTable ="已有表"; +$strNewTable ="新表"; +$strDefineTable ="表定义"; +$strDefineTableHeadCanNotWrite ="表头定义(可不填写)"; +$strUseInStatusDisplay ="状态显示用"; +$strFillTable ="填充表"; +$strRow ="行"; +$strField ="列"; +$strWhite ="白色"; +$strGray ="灰色"; +$strDeleteTable ="删除表"; +$strDeleteTempalte ="删除模板"; +$strNotInstalled ="未安装"; +$strSystemConfiguration ="系统配置"; +$strExistedSystem ="已有系统"; +$strSysTypeNo ="类型编号"; +$strTypeName ="类型名称"; +$strMaxSystemNum ="最大系统数"; +$strMaxSubsystemNum ="最大子系统数"; +$strMaxE1Num ="最大E1数"; +$strMaxMessageLength ="最大消息长度"; +$strSNMPHead ="SNMP头"; +$strLedOffset ="LED开始位"; +$strNeedInstall ="需要安装"; +$strNeedUninstall ="需要卸载"; +$strNeedParamConf ="需要设置参数"; +$strNeedMuliObj ="需要对象"; +$strNeedSystemParam ="需要系统参数"; +$strNeedHeartBeat ="需要heartBeat"; +$strNeedCDR ="需要CDR"; +$strNeedCSTA ="需要CSTA"; +$strNeedFlow ="需要流量统计"; +$strAlarmConfiguration ="告警配置"; +$strAlarmCode ="告警代码"; +$strExistedComponent ="存在组件"; +$strExistedAlarm ="已有告警"; +$strHasSubSys ="有子系统类型"; +$strNeedSumUp ="需要总和"; +$strCSTAType ="话务类型"; +$strIDFixedness ="ID固定"; +$strOneIDChange ="一个ID变"; +$strTwoIDChange ="两个ID变"; +$strID1StartNum ="ID1开始数"; +$strID1EndNum ="ID1结束数"; +$strID1Offset ="ID1偏移量"; +$strID1Field ="ID1字段"; +$strID2StartNum ="ID2开始数"; +$strID2EndNum ="ID2结束数"; +$strID2Offset ="ID2偏移量"; +$strID2Field ="ID2字段"; +$strFieldList ="字段列表"; +$strMessageField ="消息字段"; +$strCSTAConfiguration ="话务配置"; +$strCDRConfiguration ="CDR配置"; +$strIsFullRow ="是否整行"; +$strNeedCheckTime ="检测时间"; +$strNeedSubscriberConf ="需要用户参数"; +$strSubscriberTable ="用户数据表"; +$strUseAgent ="用代理"; +$strAddAlarm ="添加报警"; +$strMapSize ="地图大小"; +$strInitProgress ="初始化进度"; +$strShape ="形状"; +$strRound ="圆形"; +$strSquare ="正方形"; +$strTriangle ="三角形"; +$strRectangle ="矩形"; +$strLandscapeRectangle ="横长方形"; +$strPortraitRectangle ="竖长方形"; +$strBatchOfLEDClearanceSetting ="批量LED间隔设定"; +$strLEDIDRange ="LED ID 范围"; +$strPoint ="坐标"; +$strPointOfStart ="开始坐标"; +$strPointOfClearance ="间隔坐标"; +$strBatchOfLEDDefineSetting ="批量LED设定"; +$strSourcePage ="源页面"; +$strSourcePageType ="源页面类型"; +$strSourcePageNumber ="源页面号码"; +$strTargetPage ="目标页面"; +$strTargetPageType ="目标页面类型"; +$strTargetPageNumber ="目标页面号码"; +$strPointOfMove ="偏移坐标"; +$strStatus ="状态"; +$strAddLED ="添加LED"; +$strPageType ="页面类型"; +$strPageNumber ="页面编号"; +$strInitLEDStatus ="初始LED状态"; +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/sub_inc/sub_config.inc b/wxc2_omc/sysDefine/sub_inc/sub_config.inc new file mode 100755 index 0000000..96df0da --- /dev/null +++ b/wxc2_omc/sysDefine/sub_inc/sub_config.inc @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/sub_inc/sub_english.inc b/wxc2_omc/sysDefine/sub_inc/sub_english.inc new file mode 100755 index 0000000..b116604 --- /dev/null +++ b/wxc2_omc/sysDefine/sub_inc/sub_english.inc @@ -0,0 +1,256 @@ +Enter a value and press arrow keys to translate to another format."; +$strTheParaSpecification ="Parameter description"; +$strThisValueCannotBeEmpty ="The value cannot be empty"; +$strTimeFieldName ="Time field name"; +$strTypeCode ="Location code"; +$strValueRange ="Value range"; +$strWithinFiveLayerDirectory ="Within 5-Layer directory"; +$strWithinTwelveWords ="Within 12 words"; +$strParaTypeForTheTemplate ="Parameter type for the template"; +$strSystemParaInitialization ="System parameter initialization"; +$strFillEachKindOfParaWithItsDefault ="WARNING: all of this device's parameters which saved in database will be replaced with default values"; +$strParaInitializationComplete ="Parameter initialization complete"; +$strClickHereForReturn ="Click here for return"; +$strDefineNewParaType ="Define new parameter type"; +$strDefaultValue ="Default value"; +$strOnlyInputWhenParameter ="Only input when parameter"; +$strEnableDaemon ="Enable"; +$strDeleteGroup ="Delete"; + + + + + + +$strUnitName ="Unit name"; +$strUnitNum ="Unit num"; +$strBeginBit ="Begin bit"; +$strUnitLength ="Unit length"; +$strConditionCode ="Condition code"; +$strConditionValue ="Condition value"; +$strDescription ="Description"; +$strDisplayStatus ="Display status"; +$strValueType ="Value type"; +$strGroupName ="Group name"; +$strGroupType ="Group type"; +$strSubsystemNum ="Subsys num"; +$strSelectSubsystem ="Select subsys"; +$strOperationVarOne ="Operation var one"; +$strOperationSymbolOne ="Operation symbol one"; +$strOperationValueOne ="Operation value one"; +$strLogicSymbol ="Logic symbol"; +$strOperationVarTwo ="Operation var two"; +$strOperationSymbolTwo ="Operation symbol two"; +$strOperationValueTwo ="Operation value two"; +$strSubConditionRelation ="Condition relation"; +$strAccordValue ="Accord value"; +$strAccordDesc ="Accord desc"; +$strAccordDisplayStatus ="Accord display status"; +$strNotAccordValue ="Not accord value"; +$strNotAccordDesc ="Not accord desc"; +$strNotAccordDisplayStatus ="Not accord display status"; +$strSubsystemRelation ="Subsystem relation"; +$strPayInvar ="Pay invar"; +$strPayVar ="Pay var"; +$strLinkVar ="Link var"; +$strLinkInvar ="Link invar"; +$strLinkSymbol ="Link symbol"; +$strUseType ="Use type"; +$strAnalysisType ="Analysis type"; +$strUnitAnalysis ="Unit analysis"; +$strUnitGroup ="Unit group"; +$strSystemGroup ="System group"; +$strMessageUnitEditBinary ="Message unit edit(binary)"; +$strConditionAnalysisNotWrite ="Condition analysis"; +$strCondition ="Condition"; +$strCriticalAlarmRed ="Critical alarm(red)"; +$strMajorAlarmSimple ="Major alarm(simple red)"; +$strThirdlyAlarmGreen ="Thirdly alarm(green)"; +$strNormalBlue ="Normal(blue)"; +$strNormalBlack ="Normal(black)"; +$strConditionNum ="Condition num"; +$strOperationValueNotWrite ="Operation value"; +$strOperationTerm ="Operation term"; +$strLink ="Link"; +$strToBinary ="To binary"; +$strToHex ="To hex"; +$strMakeUpBit ="Make up bits"; +$strOperationNum ="Operation num"; +$strExistGroup ="Exist group"; +$strNewGroup ="New group"; +$strAndOrGroup ="And or group"; +$strHypotaxisGroup ="Hypotaxis group"; +$strLinkGroup ="Link group"; +$strGroupCondition ="Group condition"; +$strSubCondition ="Sub condition"; +$strExistUnitAndGroup ="Exist units and groups"; +$strOperationSymbol ="Operation symbol"; +$strOperationValue ="Operation value"; +$strNotInput ="Not input"; +$strUnitCode ="Unit code"; +$strOperationSymbolCode ="Operation symbol code"; +$strLogicSymbolCode ="Logic symbol code"; +$strSubConditionNum ="Sub condition num"; +$strAnd ="And"; +$strOr ="Or"; +$strNotAnd ="Not and"; +$strIfGroupConditionAccord ="If group condition accord"; +$strPayValue ="Pay value"; +$strIfNotGroupConditionAccord ="If not group condition accord"; +$strFirstlyCondition ="Firstly condition"; +$strSecondlyCondition ="Secondly condition"; +$strSecondlyConditionNum ="Secondly condition num"; +$strTableName ="Table name"; +$strTransferStatusTemplate ="Transfer status template"; +$strRowNum ="Row num"; +$strFieldNum ="Field num"; +$strTableHeadName ="Table head name"; +$strAdditionExplain ="Addition explain"; +$strAdditionValue ="Addition value"; +$strCell ="Cell"; +$strFillInvar ="Fill invar"; +$strFillVar ="Fill var"; +$strBackgroundColor ="Background color"; +$strExistTable ="Exist table"; +$strNewTable ="New table"; +$strDefineTable ="Define table"; +$strDefineTableHeadCanNotWrite ="Define table head(if no can not write)"; +$strUseInStatusDisplay ="Display"; +$strFillTable ="Fill table"; +$strRow ="Row"; +$strField ="Field"; +$strWhite ="White"; +$strGray ="Gray"; +$strDeleteTable ="Delete table"; +$strDeleteTempalte ="Delete template"; +$strNotInstalled ="Uninstalled"; +$strSystemConfiguration ="System configuration"; +$strExistedSystem ="Existed system"; +$strSysTypeNo ="Type no"; +$strTypeName ="Type name"; +$strMaxSystemNum ="Max system num"; +$strMaxSubsystemNum ="Max subsystem num"; +$strMaxE1Num ="Max E1 num"; +$strMaxMessageLength ="Max message length"; +$strSNMPHead ="SNMP head"; +$strLedOffset ="LED offset"; +$strNeedInstall ="Need install"; +$strNeedUninstall ="Need uninstall"; +$strNeedParamConf ="Need parameter configuration"; +$strNeedMuliObj ="Need muli object"; +$strNeedSystemParam ="Need system parmeter"; +$strNeedHeartBeat ="Need heartBeat"; +$strNeedCDR ="Need CDR"; +$strNeedCSTA ="Need CSTA"; +$strNeedFlow ="Need flow"; +$strAlarmConfiguration ="Alarm configuration"; +$strAlarmCode ="Alarm code"; +$strExistedComponent ="Existed component"; +$strExistedAlarm ="Existed alarm"; +$strHasSubSys ="Has subsystem"; +$strNeedSumUp ="Need sum up"; +$strCSTAType ="CSTA type"; +$strIDFixedness ="ID fixedness"; +$strOneIDChange ="One ID change"; +$strTwoIDChange ="Two ID change"; +$strID1StartNum ="ID1 start num"; +$strID1EndNum ="ID1 end num"; +$strID1Offset ="ID1 offset"; +$strID1Field ="ID1 field"; +$strID2StartNum ="ID2 start num"; +$strID2EndNum ="ID2 end num"; +$strID2Offset ="ID2 offset"; +$strID2Field ="ID2 field"; +$strFieldList ="Field list"; +$strMessageField ="Message field"; +$strCSTAConfiguration ="CSTA configuration"; +$strCDRConfiguration ="CDR configuration"; +$strIsFullRow ="Is full row"; +$strNeedCheckTime ="Check time"; +$strNeedSubscriberConf ="Need subscriber parameter"; +$strSubscriberTable ="Subscriber table"; +$strUseAgent ="Use agent"; +$strAddAlarm ="Add Alarm"; +$strMapSize ="Map size"; +$strInitProgress ="Initialization progress"; +$strShape ="Shape"; +$strRound ="Round"; +$strSquare ="Square"; +$strTriangle ="Triangle"; +$strRectangle ="Rectangle"; +$strLandscapeRectangle ="Landscape Rectangle"; +$strPortraitRectangle ="Portrait Rectangle"; +$strBatchOfLEDClearanceSetting ="Batch of LED's Clearance setting"; +$strLEDIDRange ="LED ID Range"; +$strPoint ="Point"; +$strPointOfStart ="Point of start "; +$strPointOfClearance ="Point of Clearance"; +$strBatchOfLEDDefineSetting ="Batch of LED's define setting"; +$strSourcePage ="Source Page"; +$strSourcePageType ="Source Page Type"; +$strSourcePageNumber ="Source Page Number"; +$strTargetPage ="Target Page"; +$strTargetPageType ="Target Page Type"; +$strTargetPageNumber ="Target Page Number"; +$strInitLEDStatus ="Init LED's Status"; +$strPointOfMove ="Point of Move"; +$strStatus ="Status"; +$strAddLED ="Add LED"; +$strPageType = "Page Type"; +$strPageNumber = "Page Number"; +?> diff --git a/wxc2_omc/sysDefine/subsMngDef/subsMngDef.php b/wxc2_omc/sysDefine/subsMngDef/subsMngDef.php new file mode 100755 index 0000000..507d45b --- /dev/null +++ b/wxc2_omc/sysDefine/subsMngDef/subsMngDef.php @@ -0,0 +1,313 @@ + + +"; + echo ""; + echo ""; + echo "Template > Subscriber > Manage Define"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; + +$keyId = isset($keyId)?$keyId:1; +$dbName = 'OMC_PUB'; +$tableName = 'sysSubsConf'; +$maxLevelNum = 5; + +//选择语言版本 +if($language == 'eng'){ + $nameField=name_2; //语种2 +}else{ + $nameField=name_1; //语种1(默认语种) +} + + +/**************************************删除一条记录***********************************************/ +if($delete){ + $delSql = "DELETE FROM $tableName WHERE keyId = '$keyId'"; + $delResult = mysqli_query($pubConn ,$delSql); + echo mysqli_error($pubConn); + if($delResult){ + echo $strDeleteSuccess; + }else{ + echo $strDeleteFailure; + } + //插入日志 + //缺!! + +} //end if($delete) + +/*****************************添加,修改记录*******************************************/ +if($save){ + if($keyId == 'new'){//add + $addSql = "REPLACE INTO $tableName + (keyId,sysTypeNo,dataTypeNo,isEnable,preObjId,indexObjId,indexFieldName, + maxSegmentNum,maxIndexNumPerSeg, subsDataTable,tmpDataTable,menuName, + ftpLoginName,ftpLoginPwd,ftpDir,impObjId,impFileName,logFileName) + VALUES + ('$keyId','$sysTypeNo','$dataTypeNo','$isEnable','$preObjId','$indexObjId','$indexFieldName', + '$maxSegmentNum','$maxIndexNumPerSeg','$subsDataTable','$tmpDataTable','$menuName', + '$ftpLoginName','$ftpLoginPwd','$ftpDir','$impObjId','$impFileName','$logFileName') + "; + if($DEBUG) echo "
      $addSql"; + $result = mysqli_query($pubConn ,$addSql); + echo mysqli_error($pubConn); + if($result > 0){ + $getKeyIdSql =" SELECT keyId FROM $tableName + WHERE sysTypeNo = '$sysTypeNo' + AND dataTypeNo='$dataTypeNo' + AND isEnable='$isEnable' + "; + if($DEBUG) echo "
      $getKeyIdSql"; + $result = mysqli_query($pubConn ,$getKeyIdSql); + echo mysqli_error($pubConn); + $rows = mysqli_fetch_array($result); + $keyId = $rows[$keyId]; + echo "
      ADD OK"; + }else{ + echo "
      ADD Failed"; + } + }else{//update + $updateSql = "UPDATE $tableName SET + sysTypeNo='$sysTypeNo',dataTypeNo='$dataTypeNo',isEnable='$isEnable',preObjId='$preObjId', + indexObjId='$indexObjId',indexFieldName='$indexFieldName',maxSegmentNum='$maxSegmentNum', + maxIndexNumPerSeg='$maxIndexNumPerSeg',subsDataTable='$subsDataTable', + tmpDataTable='$tmpDataTable',menuName='$menuName',ftpLoginName='$ftpLoginName', + ftpLoginPwd='$ftpLoginPwd',ftpDir='$ftpDir',impObjId='$impObjId',impFileName='$impFileName', + logFileName='$logFileName' + WHERE keyId = '$keyId'"; + if($DEBUG) echo "
      updateSql = $updateSql"; + $updateResult = mysqli_query($pubConn,$updateSql); + echo mysqli_error($pubConn); + if($updateResult){ + echo "
      UPDATE OK"; + }else{ + echo "
      UPDATE Failed"; + } + } +} +/*****************************显示一个菜单的定义*****************************/ +?> + + + +
      " > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + + + +
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      : + " class="text">
      +

      + + "; + echo " "; + echo " "; + +?> +

      + +
      + + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/subsMngDef/subsParamConf.php b/wxc2_omc/sysDefine/subsMngDef/subsParamConf.php new file mode 100755 index 0000000..2fb6d37 --- /dev/null +++ b/wxc2_omc/sysDefine/subsMngDef/subsParamConf.php @@ -0,0 +1,802 @@ + + + +"; + echo ""; + echo ""; + echo "Template > Subscriber > Structure"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +$DEBUG = 0; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +$pubDb = 'OMC_PUB'; +$sysConfTable = 'OMC_PUB.sysConf'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; +$sysTypeNo = $_REQUEST['sysTypeNo']; + +if(!isset($sysTypeNo)){ + $sysTypeSql ="SELECT sysTypeNo + FROM $sysConfTable + WHERE needSubscriberConf ='1' ORDER BY sysTypeNo LIMIT 0,1 + "; + if($DEBUG) echo "
      $sysTypeSql"; + $sysTypeResult = mysqli_query($pubConn,$sysTypeSql); + $sysTypeRows = @mysqli_fetch_array($sysTypeResult); + $sysTypeNo = $sysTypeRows[sysTypeNo]; + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +} +$dataTypeNo = $_REQUEST['dataTypeNo']; +$keyId = $_REQUEST['keyId']; + +$objDb=omcGetObjDb($sysTypeNo); +$paramType=isset($paramType)?$_POST['paramType']:0; +$subscriberTable=$_REQUEST['subscriberTable']; + +if($DEBUG) echo "
      objDb=$objDb"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +global $OMC_server; +$objDbConn=mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $objDb); + +$dataTypeNo=isset($dataTypeNo)?$dataTypeNo:0; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +$paramConfTable = 'subsParamConf_'.$dataTypeNo; +if($DEBUG) echo "
      paramConfTable=$paramConfTable"; +$maxLevelNum = 10; + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; //语种2 +}else{ + $objNameField=name_1; //语种1(默认语种) +} +//----------------------- + +/**************************************删除一个类型说明***********************************************/ +if($_REQUEST['delete']){ + $delSql = "DELETE FROM $paramConfTable WHERE keyId='$keyId'"; + $delResult = mysqli_query($objDbConn ,$delSql); + echo mysqli_error($objDbConn); + //---------------- + //插入日志 + + //------------ + if($delResult){ + echo ""; + }else{ + echo ""; + } +} //end if($delete) + + +/*****************************添加,保存一个新的参数类型或创建新的参数结构表*****************************/ +if($_POST['save']){ + $keyId = $_POST['keyId']; + if($DEBUG) echo "
      keyId = $keyId"; + if($keyId == 'new'){ //插入一个新类型 + $saveSql = "REPLACE INTO $paramConfTable (fieldName,name_1,name_2,desc_1,desc_2,paramType,number,length,valueType,operType,initValue,minValue,`maxValue`,setTemplate_1,setTemplate_2,needNote,note_1,note_2,level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10) VALUES('$fieldName','$name_1','$name_2','$desc_1','$desc_2','$paramType','$number','$length','$valueType','$operType','$initValue','$minValue','$maxValue','$setTemplate_1','$setTemplate_2','$needNote','$note_1','$note_2','$level_1','$level_2','$level_3','$level_4','$level_5','$level_6','$level_7','$level_8','$level_9','$level_10')"; + $saveResult = mysqli_query($objDbConn ,$saveSql); + if($saveResult){ + $keyIdSel = "SELECT keyId FROM $paramConfTable WHERE + level_1='$level_1' AND + level_2='$level_2' AND + level_3='$level_3' AND + level_4='$level_4' AND + level_5='$level_5' AND + level_6='$level_6' AND + level_7='$level_7' AND + level_8='$level_8' AND + level_9='$level_9' AND + level_10='$level_10' + "; + $keyIdResult = mysqli_query($objDbConn,$keyIdSel); + $keyIdeRows = mysqli_fetch_array($keyIdResult); + $keyId = $keyIdeRows[keyId]; + } + }elseif($keyId > 0){ //修改已有类型 + $needNote = $_POST['needNote']; + + if($needNote !=1){ + $needNote = 0; + } + $saveSql = "UPDATE $paramConfTable + SET + fieldName='$_POST[fieldName]', + name_1='$_POST[name_1]', + name_2='$_POST[name_2]', + desc_1='$_POST[desc_1]', + desc_2='$_POST[desc_2]', + paramType='$paramType', + number='$_POST[number]', + length='$_POST[length]', + valueType='$_POST[valueType]', + operType='$_POST[operType]', + initValue='$_POST[initValue]', + minValue='$_POST[minValue]', + `maxValue`='$_POST[maxValue]', + needNote='$needNote', + note_1='$_POST[note_1]', + note_2='$_POST[note_2]', + level_1='$_POST[level_1]', + level_2='$_POST[level_2]', + level_3='$_POST[level_3]', + level_4='$_POST[level_4]', + level_5='$_POST[level_5]', + level_6='$_POST[level_6]', + level_7='$_POST[level_7]', + level_8='$_POST[level_8]', + level_9='$_POST[level_9]', + level_10='$_POST[level_10]' + WHERE keyId='$keyId' + "; + $saveResult = mysqli_query($objDbConn ,$saveSql); + }else{ + echo "
      Error: keyId == NULL"; + } + if($DEBUG) echo "
      $saveSql"; + echo mysqli_error($objDbConn); + if($saveResult > 0){ + /* + //更新备份文件 + $csvFileName = '/usr/local/apache/htdocs/db_backup/other/'.$objDb.'.'.$paramConfTable.'.csv'; + if($DEBUG) echo "
      csvFileName=$csvFileName"; + @unlink($csvFileName); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '$csvFileName' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $paramConfTable + "; + $csvFileUpdateResult = mysqli_query($pubConn ,$csvFileUpdateSql); + if($DEBUG) echo "
      csvFileUpdateSql = $csvFileUpdateSql
      "; + echo mysqli_error($pubConn); + */ + echo ""; + }else{ + echo ""; + } +} //end if($save) + +/*****************************创建参数库和参数配置表*****************************/ +//创建参数库 +$dbList = mysqli_query($pubConn, "SHOW DATABASES"); +$dbNum = mysqli_num_rows($dbList); +$dbRows = mysqli_fetch_array($dbList); + +$objDbExists = false; +while ($dbRow = mysqli_fetch_array($dbList)) { + $dbName = $dbRow[0]; // 获取数据库名称 + if ($dbName == $objDb) { + $objDbExists = true; + break; + } +} + +if ($objDbExists) { + if($DEBUG) echo "
      $objDb have be created"; +} else { + if($DEBUG) echo "
      $objDb have not be created"; + // 步骤 1:创建 objDb + $sql = "CREATE DATABASE $objDb"; + mysqli_query($pubConn, $sql); + if ($DEBUG) { + echo "
      create $objDb sql =$sql"; + echo mysqli_error($pubConn); + } +} + + +// for($i=0; $i < $dbNum; $i++){ +// $dbName = $dbRows[$i][0]; +// if($dbName == $objDb){ +// if($DEBUG) echo "
      $objDb have be created"; +// break; +// } +// if($i == $dbNum-1){ +// if($DEBUG) echo "
      $objDb have not be created"; +// //step 1.create objDb +// $sql="CREATE DATABASE $objDb"; +// mysqli_query($pubConn,$sql); +// if($DEBUG) echo "
      create $objDb sql =$sql"; +// echo mysqli_error($pubConn); +// } +// } + +//创建用户参数定义表 +$tableList = mysqli_query($objDbConn, "SHOW TABLES"); +$tableNum = mysqli_num_rows($tableList); +$tableRows = mysqli_fetch_array($tableList); + +$paramConfTableExists = false; +while ($tableRow = mysqli_fetch_array($tableList)) { + $tableName = $tableRow[0]; + if($tableName == $paramConfTable){ + $paramConfTableExists = true; + //if($DEBUG) echo "
      $paramConfTable have be created"; + break; + } + // if($i == $tableNum -1){ + // //step 2.create paramConf table in objDb + // $sql="CREATE TABLE $paramConfTable ( + // keyId tinyint(4) NOT NULL auto_increment, + // fieldName varchar(50) NOT NULL, + // name_1 varchar(30) NOT NULL, + // name_2 varchar(30) NOT NULL, + // desc_1 varchar(255) NOT NULL, + // desc_2 varchar(255) NOT NULL, + // paramType tinyint(1) DEFAULT '0' NOT NULL, + // operType tinyint(1) DEFAULT '0' NOT NULL, + // number int(6) DEFAULT '0' NOT NULL, + // length smallint(3) DEFAULT '0' NOT NULL, + // valueType tinyint(1) DEFAULT '0' NOT NULL, + // initValue varchar(255) NOT NULL, + // minValue varchar(255) NOT NULL, + // `maxValue` varchar(255) NOT NULL, + // setTemplate_1 text NOT NULL, + // setTemplate_2 text NOT NULL, + // needNote tinyint(1) DEFAULT '0' NOT NULL, + // note_1 varchar(255) NOT NULL, + // note_2 varchar(255) NOT NULL, + // level_1 int(5) DEFAULT '0' NOT NULL, + // level_2 int(5) DEFAULT '0' NOT NULL, + // level_3 int(5) DEFAULT '0' NOT NULL, + // level_4 int(5) DEFAULT '0' NOT NULL, + // level_5 int(5) DEFAULT '0' NOT NULL, + // level_6 int(5) DEFAULT '0' NOT NULL, + // level_7 int(5) DEFAULT '0' NOT NULL, + // level_8 int(5) DEFAULT '0' NOT NULL, + // level_9 int(5) DEFAULT '0' NOT NULL, + // level_10 int(5) DEFAULT '0' NOT NULL, + // PRIMARY KEY (keyId), + // KEY level_1 (level_1), + // KEY level_2 (level_2), + // KEY level_3 (level_3), + // KEY level_4 (level_4), + // KEY level_5 (level_5), + // KEY level_6 (level_6), + // KEY level_7 (level_7), + // KEY level_8 (level_8), + // KEY level_9 (level_9), + // KEY level_10 (level_10) + // )"; + // mysqli_query($objDbConn,$sql); + // if($DEBUG) echo "
      create paramConf table sql =$sql"; + // echo mysqli_error($objDbConn); + // break; + // } +} +if ($paramConfTableExists) { + if($DEBUG) echo "
      $paramConfTable have be created"; +} else { + if($DEBUG) echo "
      $objDb have not be created"; + // 步骤 1:创建 objDb + $sql="CREATE TABLE $paramConfTable ( + keyId tinyint(4) NOT NULL auto_increment, + fieldName varchar(50) NOT NULL, + name_1 varchar(30) NOT NULL, + name_2 varchar(30) NOT NULL, + desc_1 varchar(255) NOT NULL, + desc_2 varchar(255) NOT NULL, + paramType tinyint(1) DEFAULT '0' NOT NULL, + operType tinyint(1) DEFAULT '0' NOT NULL, + number int(6) DEFAULT '0' NOT NULL, + length smallint(3) DEFAULT '0' NOT NULL, + valueType tinyint(1) DEFAULT '0' NOT NULL, + initValue varchar(255) NOT NULL, + minValue varchar(255) NOT NULL, + `maxValue` varchar(255) NOT NULL, + setTemplate_1 text NOT NULL, + setTemplate_2 text NOT NULL, + needNote tinyint(1) DEFAULT '0' NOT NULL, + note_1 varchar(255) NOT NULL, + note_2 varchar(255) NOT NULL, + level_1 int(5) DEFAULT '0' NOT NULL, + level_2 int(5) DEFAULT '0' NOT NULL, + level_3 int(5) DEFAULT '0' NOT NULL, + level_4 int(5) DEFAULT '0' NOT NULL, + level_5 int(5) DEFAULT '0' NOT NULL, + level_6 int(5) DEFAULT '0' NOT NULL, + level_7 int(5) DEFAULT '0' NOT NULL, + level_8 int(5) DEFAULT '0' NOT NULL, + level_9 int(5) DEFAULT '0' NOT NULL, + level_10 int(5) DEFAULT '0' NOT NULL, + PRIMARY KEY (keyId), + KEY level_1 (level_1), + KEY level_2 (level_2), + KEY level_3 (level_3), + KEY level_4 (level_4), + KEY level_5 (level_5), + KEY level_6 (level_6), + KEY level_7 (level_7), + KEY level_8 (level_8), + KEY level_9 (level_9), + KEY level_10 (level_10) + )"; + mysqli_query($pubConn, $sql); + if ($DEBUG) { + echo "
      create paramConf table sql =$sql"; + echo mysqli_error($pubConn); + } +} + + +/*****************************显示一个设备类型的参数定义*****************************/ +?> + + + +"; +?> +
      " onsubmit="return checkAllInput(this)"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + "; + $objSql = "SELECT * FROM $paramConfTable ORDER BY $orderBy"; + $objResult = mysqli_query($objDbConn ,$objSql); + $objNum = mysqli_num_rows($objResult); + echo""; + while($objRows = mysqli_fetch_array($objResult)){ + echo ""; + } + ?> + + selected Id = $keyId"; + if($DEBUG) echo "
      objSql = $objSql"; + if($DEBUG) echo mysqli_error($objDbConn); + ?> +
      : + "; + if($i < $maxLevelNum){ + echo "•"; //dot + } + } + ?> +
      + + + "; + echo ""; + $tmpArr=explode('.',$subscriberTable); + $subscriberDB=$tmpArr[0]; + //$subscriberTable=$tmpArr[1]; + $subscriberDbConn=mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$subscriberDB); + $fieldResult=mysqli_query($subscriberDbConn,"SHOW COLUMNS FROM $subscriberTable"); + $i=0; + while($tmpName=mysqli_fetch_array($fieldResult)){ + echo ""; + $i++; + } + echo "";*/ + echo ""; + + ?> +
      : + " >(Chinese)
      : + " >(English)
      : + " >(Chinese) +
      : + " >(English) +
      Operation define: + +
      (Needn't fill the follow fields if this object have sub-objects) +
      Number of instance: + +
      Value Length(byte): + " > +
      : + +
      : + + min value = " onChange="javascript: chkValue(this);">    + max value = " onChange="javascript: chkValue(this);"> + +
      : + " onChange="javascript: chkValue(this);"> +
      Need Note: + > +
      Note Message 1: + ">(Chinese) +
      Note Message 2: + ">(English) +
      + +

      + + +

      + + +
      + + + + + + +{$dbRows[Database]}"; + $dbName=$dbRows[Database]; + if(strstr($dbName,"OBJ_")){ + $alterSql=" ALTER TABLE subsParamConf_0 CHANGE desc_1 desc_1 VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + $alterSql=" ALTER TABLE subsParamConf_0 CHANGE desc_2 desc_2 VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + $alterSql=" ALTER TABLE subsParamConf_0 CHANGE initValue initValue VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + $alterSql=" ALTER TABLE subsParamConf_0 CHANGE minValue minValue VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + $alterSql=" ALTER TABLE subsParamConf_0 CHANGE maxValue maxValue VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + echo mysqli_error($pubConn); + $alterSql=" ALTER TABLE subsParamConf_1 CHANGE desc_1 desc_1 VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + $alterSql=" ALTER TABLE subsParamConf_1 CHANGE desc_2 desc_2 VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + $alterSql=" ALTER TABLE subsParamConf_1 CHANGE initValue initValue VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + $alterSql=" ALTER TABLE subsParamConf_1 CHANGE minValue minValue VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + $alterSql=" ALTER TABLE subsParamConf_1 CHANGE maxValue maxValue VARCHAR (255) not null"; + mysqli_query($pubConn,$alterSql); + echo mysqli_error($pubConn); + } +} +*/ +adjust_content_tail(); +?> + diff --git a/wxc2_omc/sysDefine/subsMngDef/subsParamEditConf.php b/wxc2_omc/sysDefine/subsMngDef/subsParamEditConf.php new file mode 100755 index 0000000..aa6d34e --- /dev/null +++ b/wxc2_omc/sysDefine/subsMngDef/subsParamEditConf.php @@ -0,0 +1,509 @@ + + + +"; + echo ""; + echo ""; + echo "Template > Subscriber > Edit"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; + +$pubDb = 'OMC_PUB'; +$sysConfTable = 'OMC_PUB.sysConf'; +$sysSubsConfTable = 'OMC_PUB.sysSubsConf'; + +if(!isset($sysTypeNo)){ + $sysTypeSql ="SELECT sysTypeNo + FROM $sysConfTable + WHERE needSubscriberConf ='1' ORDER BY sysTypeNo LIMIT 0,1 + "; + if($DEBUG) echo "
      $sysTypeSql"; + $sysTypeResult = mysqli_query($pubConn,$sysTypeSql); + $sysTypeRows = @mysqli_fetch_array($sysTypeResult); + $sysTypeNo = $sysTypeRows[sysTypeNo]; + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; +} + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +$objDb=omcGetObjDb($sysTypeNo); +if($DEBUG) echo "
      objDb=$objDb"; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +$dataTypeNo=isset($dataTypeNo)?$dataTypeNo:0; +if($DEBUG) echo "
      dataTypeNo=$dataTypeNo"; +$paramConfTable = 'subsParamConf_'.$dataTypeNo; +if($DEBUG) echo "
      paramConfTable=$paramConfTable"; +$maxLevelNum = 10; + +if($DEBUG) echo "
      $paramConfTable
      "; + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField = name_2; + $objSetField = setTemplate_2 ; //语种2 + $objSetField_2 = setTemplate_1 ; //语种1 +}else{ + $objNameField = name_1; + $objSetField = setTemplate_1 ; //语种1(默认语种) + $objSetField_2 = setTemplate_2 ; //语种2 +} +//----------------------- + +/*****************************保存一个新的参数编辑模板*****************************/ +if($save){ + if($DEBUG) echo "
      keyId = $keyId"; + if($keyId > 0){ + $saveSql = "UPDATE $paramConfTable + SET $objSetField = '$codeArea' + WHERE keyId='$keyId' + "; + $saveResult = mysqli_query($pubConn,$saveSql); + }else{ + echo "
      Error: keyId == NULL"; + exit(); + } + if($DEBUG) echo "
      $saveSql"; + echo mysqli_error($pubConn); + if($saveResult){ + //更新备份文件 + $csvFileName = '/usr/local/apache/htdocs/db_backup/other/'.$objDb.'.'.$paramConfTable.'.csv'; + $ret=@unlink($csvFileName); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '$csvFileName' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $paramConfTable + "; + $csvFileUpdateResult = mysqli_query($pubConn ,$csvFileUpdateSql); + echo mysqli_error($pubConn); + echo ""; + }else{ + echo ""; + } +} +?> + + + + + "; +?> +
      " > + + + + + + + + + + + + + valueType=$valueType"; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + + + selected Id = $keyId"; + if($DEBUG) echo "
      objSql = $objSql"; + if($DEBUG) echo mysqli_error($pubConn); + ?> +
      + Design Area + objSql=$objSql
      ";?> + +
      Name">
      offset + From + byte + bit    + Tobyte + bit + +
      Unit Name + +
      Input Field mode: + +
      Put down MenuOption number: + + + Please change "decValue" and "menuName" +
      Created Code
      + +
      +
      +    +    + )"> + + + +
      +说明: +
      1.一个参数值由多个值组成,于是可分成多个编辑单元,以便用户编辑。 +
      2.每个编辑单元,可制定不同的编辑方式(输入框或下拉菜单)。 +
      3.当使用下拉菜单时,需要替换代码区中的"[v]DecValue[opt]MenuName"中的DecValue(十进制值)和MenuName(菜单名)。 +
      4.如果某段数值预留不用,请用"[unit]reserved[u]bgnOffset-endOffset[u]select"标示。 +
      5.请注意,不能删除语法标签[unit],[u],[v],[opt],[remark],同时也不要在说明中使用这些标签。 +
      6.生成的编辑代码保存后,可点击"Preview"来查看是否正确。 +
      + + + + +
      + Another Language Code +
      + +
      + +
      + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/subsMngDef/subsParamInit.php b/wxc2_omc/sysDefine/subsMngDef/subsParamInit.php new file mode 100755 index 0000000..ce72500 --- /dev/null +++ b/wxc2_omc/sysDefine/subsMngDef/subsParamInit.php @@ -0,0 +1,115 @@ +"; + + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} +$objDb=omcGetObjDb($sysTypeNo); +global $OMC_server; +$objDbConn=mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $objDb); + +function omcGetObjTbl($tableType,$sysTypeNo,$sysNo=0,$subSysNo=0){ + $dbName = 'OBJ_'.$sysTypeNo; + switch($tableType){ + case 'paramConf': + $tableName = $dbName.'.paramConf'; + break; + case 'param': + $tableName = $dbName.'.tmpSubscriberParam_'.$sysNo; + break; + default: + echo "
      function omcGetObjTbl(): Unknown table Type:$tableType"; + exit(); + } + return($tableName); +} +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$getConfSql="SELECT sysTypeName,dataTypeNo,indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable,$systemConfTable + WHERE $sysSubsConfTable.sysTypeNo='$sysTypeNo' + AND $systemConfTable.sysTypeNo='$sysTypeNo' + AND $sysSubsConfTable.dataTypeNo='$dataTypeNo' + "; +if($DEBUG) echo "
      getConfSql=$getConfSql"; +$getConfResult=mysqli_query($pubConn,$getConfSql); +echo mysqli_error($pubConn); +$getConfRows=mysqli_fetch_array($getConfResult); +$sysTypeName =$getConfRows[sysTypeName]; +$keyFieldName =$getConfRows[indexFieldName]; +$srcDataTable =$getConfRows[subsDataTable]; +$tmpDataTable =$getConfRows[tmpDataTable]; + +$srcDataConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], $sysTypeName."_DB"); + + +//复制一个表并且增加一个字段:editFlag +$dropTmpTable="DROP TABLE $tmpDataTable"; +if($DEBUG) echo "
      dropTmpTable=$dropTmpTable"; +$dropRes=mysqli_query($objDbConn,$dropTmpTable); +echo mysqli_error($objDbConn); + +$getCreateSql="SHOW CREATE TABLE $srcDataTable"; +if($DEBUG) echo "
      getCreateSql=$getCreateSql"; +$getCreateRes=@mysqli_query($srcDataConn,$getCreateSql); +$row = mysqli_fetch_array($getCreateRes); +echo mysqli_error($srcDataConn); + +// echo "
      ";
      +// echo print_r($row);
      +// echo "
      "; + +$srcNameArr=explode('.',$srcDataTable); +$srcTableName=$srcNameArr[1]; +$tmpNameArr=explode('.',$tmpDataTable); +$tmpTableName=$tmpNameArr[1]; + +if($DEBUG) echo "
      str_replace($srcTableName,$tmpTableName,$row[1])"; +$createTmpSql=str_replace($srcTableName,$tmpTableName,$row[1]); +if($DEBUG) echo "
      createTmpSql=$createTmpSql"; +$createTmpRes=mysqli_query($objDbConn,$createTmpSql); +echo mysqli_error($pubConn); + +$alterSql="ALTER TABLE $tmpDataTable ADD editFlag TINYINT not null FIRST"; +if($DEBUG) echo "
      alterSql=$alterSql"; +$alterRes=mysqli_query($objDbConn,$alterSql); +echo mysqli_error($pubConn); + +$alterSql="ALTER TABLE $tmpDataTable ADD INDEX (editFlag)"; +if($DEBUG) echo "
      alterSql=$alterSql"; +$alterRes=mysqli_query($objDbConn,$alterSql); +echo mysqli_error($pubConn); +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/subsMngDef/subsParamInit.php_bak b/wxc2_omc/sysDefine/subsMngDef/subsParamInit.php_bak new file mode 100755 index 0000000..8149f4a --- /dev/null +++ b/wxc2_omc/sysDefine/subsMngDef/subsParamInit.php_bak @@ -0,0 +1,99 @@ +function omcGetObjTbl(): Unknown table Type:$tableType"; + exit(); + } + return($tableName); +} +$sysSubsConfTable ='OMC_PUB.sysSubsConf'; +$systemConfTable = 'OMC_PUB.sysConf'; + +$getConfSql="SELECT sysTypeName,dataTypeNo,indexFieldName,subsDataTable,tmpDataTable + FROM $sysSubsConfTable,$systemConfTable + WHERE $sysSubsConfTable.sysTypeNo='$sysTypeNo' + AND $systemConfTable.sysTypeNo='$sysTypeNo' + AND $sysSubsConfTable.dataTypeNo='$dataTypeNo' + "; +if($DEBUG) echo "
      getConfSql=$getConfSql"; +$getConfResult=mysqli_query($pubConn,$getConfSql); +echo mysqli_error($pubConn); +$getConfRows=mysqli_fetch_array($getConfResult); +$keyFieldName =$getConfRows[indexFieldName]; +$srcDataTable =$getConfRows[subsDataTable]; +$tmpDataTable =$getConfRows[tmpDataTable]; + +//复制一个表并且增加一个字段:editFlag +$dropTmpTable="DROP TABLE $tmpDataTable"; +if($DEBUG) echo "
      dropTmpTable=$dropTmpTable"; +$dropRes=mysqli_query($pubConn,$dropTmpTable); +echo mysqli_error($pubConn); + +$getCreateSql="SHOW CREATE TABLE $srcDataTable"; +if($DEBUG) echo "
      getCreateSql=$getCreateSql"; +$getCreateRes=@mysqli_query($pubConn,$getCreateSql); +$row = mysqli_fetch_array($getCreateRes); +echo mysqli_error($pubConn); + +$srcNameArr=explode('.',$srcDataTable); +$srcTableName=$srcNameArr[1]; +$tmpNameArr=explode('.',$tmpDataTable); +$tmpTableName=$tmpNameArr[1]; + +if($DEBUG) echo "
      str_replace($srcTableName,$tmpTableName,$row[1])"; +$createTmpSql=str_replace($srcTableName,$tmpTableName,$row[1]); +if($DEBUG) echo "
      createTmpSql=$createTmpSql"; +$createTmpRes=mysqli_query($pubConn,$createTmpSql); +echo mysqli_error($pubConn); + +$alterSql="ALTER TABLE $tmpDataTable ADD editFlag TINYINT not null FIRST"; +if($DEBUG) echo "
      alterSql=$alterSql"; +$alterRes=mysqli_query($pubConn,$alterSql); +echo mysqli_error($pubConn); + +$alterSql="ALTER TABLE $tmpDataTable ADD INDEX (editFlag)"; +if($DEBUG) echo "
      alterSql=$alterSql"; +$alterRes=mysqli_query($pubConn,$alterSql); +echo mysqli_error($pubConn); +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/sysMngDef/sysAliasInit.php b/wxc2_omc/sysDefine/sysMngDef/sysAliasInit.php new file mode 100755 index 0000000..77e4f66 --- /dev/null +++ b/wxc2_omc/sysDefine/sysMngDef/sysAliasInit.php @@ -0,0 +1,108 @@ +"; + echo "Are you sure to init $sysTypeName 's alarm?"; + echo ""; + echo ""; + echo ""; + + echo ""; + echo ""; + echo ""; + exit(); +} +*/ + + +echo "
      It's need some minutes,Please wait...
      "; +if($initAll > 0){ + $clearSql = "DELETE FROM sysInfoDef "; +}else{ + $clearSql = "DELETE FROM sysInfoDef WHERE sysTypeNo = '$sysTypeNo'"; +} +if($DEBUG) echo "
      clearSql=$clearSql"; +mysqli_query($pubConn,$clearSql); +echo mysqli_error($pubConn); +if($initAll > 0){ + $getSysConfSql = "SELECT sysTypeNo,maxSysNum,maxSubSysNum + FROM sysConf + "; +}else{ + $getSysConfSql = "SELECT sysTypeNo,maxSysNum,maxSubSysNum + FROM sysConf + WHERE sysTypeNo= '$sysTypeNo' + "; +} +if($DEBUG) echo "
      getSysConfSql=$getSysConfSql"; +$sysConfResult=mysqli_query($pubConn,$getSysConfSql); +echo mysqli_error($pubConn); + +$k=0; +while($sysConfRows = mysqli_fetch_array($sysConfResult)){ + $sysTypeNo = $sysConfRows[sysTypeNo]; + $maxSysNum = $sysConfRows[maxSysNum]; + $maxSubSysNum = $sysConfRows[maxSubSysNum]; + if($DEBUG) echo "
      sysTypeNo=$sysTypeNo"; + if($DEBUG) echo "
      maxSysNum=$maxSysNum"; + if($DEBUG) echo "
      maxSubSysNum=$maxSubSysNum"; + for($i=0;$i<$maxSysNum;$i++){ + for($j=0;$j<$maxSubSysNum;$j++){ + $insertSql = "REPLACE sysInfoDef + (sysTypeNo,sysNo,subSysNo,ip,sysAlias) + VALUES + ('$sysTypeNo','$i','$j','','') + "; + if($DEBUG) echo "
      insertSql=$insertSql"; + mysqli_query($pubConn,$insertSql); + echo mysqli_error($pubConn); + } + } + if($initAll > 0){ + if(($k % 10) == 0){ + print(">>"); + flush(); + } + }else{ + print(">>"); + flush(); + } + $k++; +} +if($initAll > 0){ + echo "
      All Alias initialized!
      "; +}else{ + echo "
      $sysTypeName 's Alias initialized!!
      "; +} + +?> diff --git a/wxc2_omc/sysDefine/sysMngDef/systemConf_index.php b/wxc2_omc/sysDefine/sysMngDef/systemConf_index.php new file mode 100755 index 0000000..325f7f6 --- /dev/null +++ b/wxc2_omc/sysDefine/sysMngDef/systemConf_index.php @@ -0,0 +1,16 @@ + + + + + + <body> + + <p>此网页使用了框架,但您的浏览器不支持框架。</p> + + </body> + + + + diff --git a/wxc2_omc/sysDefine/sysMngDef/systemConf_main.php b/wxc2_omc/sysDefine/sysMngDef/systemConf_main.php new file mode 100755 index 0000000..d320f69 --- /dev/null +++ b/wxc2_omc/sysDefine/sysMngDef/systemConf_main.php @@ -0,0 +1,713 @@ +old_sysTypeNo=$old_sysTypeNo"; +$type_no = $_POST['type_no']; + +//$sysTypeNo = $_REQUEST['sysTypeNo']; + +if(isset($sysTypeNo) && $type_no != 'new') +{ + $netModeSelect_sql = "select networkMode from OMC_PUB.sysConf where sysTypeNo=$sysTypeNo"; + echo "$netModeSelect_sql"; + $res=@mysqli_query($pubConn,$netModeSelect_sql); + $num=@mysqli_num_rows($res); + //echo "num=111$num"; + if($num == 0) + return "--"; + + $row_netMode=mysqli_fetch_array($res); + $netMode=$row_netMode[0]; +} + +/**************************************删除一个系统类型***********************************************/ +if($_POST['delete']){ + $del_sql = "DELETE FROM $sysconf_table WHERE sysTypeNo='$_POST[sysTypeNo]'"; + $del_result = mysqli_query($pubConn,$del_sql); + //---------------- + //插入日志 + insertLog("Delete the sysTypeNo=$sysTypeNo"); + //------------ + if($del_result){ + echo "$strDeleteSuccess"; + }else{ + echo "$strDeleteFailure"; + } +} //end if($delete) + + +/*****************************添加,保存一个系统*****************************/ +if($_POST['save']){ + $sysTypeNo = $_POST['sysTypeNo']; + $old_sysTypeNo=$_POST['old_sysTypeNo']; + $type_no = $_POST['type_no']; + if($type_no == 'new' )//插入一个新类型 + { + $jud_sql="SELECT COUNT(*) FROM $sysconf_table=sysConf WHERE sysTypeNo='$sysTypeNo'"; + $jud_res=mysqli_query($pubConn,$jud_sql); + $jud_row=mysqli_fetch_array($jud_res); + if(!$jud_row[0]) + { + $save_sql = "REPLACE INTO $sysconf_table + (sysTypeNo,maxSubSysNum, maxMsgLen, maxE1Num, snmpPort, snmpHead, snmpCommunity, snmpInstanceBgn, remark, sysTypeName , maxSysNum, ledOffset, needInstall, needUninstall, needParamConf, needMuliObj, needGlobalSysParam, needGlobalSubSysParam, needSubSysParam, needHeartBeat,needCDR,needCSTA,needFlow,needSubscriberConf,platHeart) + VALUES + ('$sysTypeNo','$_POST[maxSubSysNum]', '$_POST[maxMsgLen]', '$_POST[maxE1Num]','$_POST[snmpPort]', '$_POST[snmpHead]','$_POST[snmpCommunity]', '$_POST[snmpInstanceBgn]', '$_POST[remark]', '$_POST[sysTypeName]', '$_POST[maxSysNum]', '$_POST[ledOffset]', '$_POST[needInstall]', '$_POST[needUninstall]', '$_POST[needParamConf]', '$_POST[needMuliObj]', '$_POST[needGlobalSysParam]', '$_POST[needGlobalSubSysParam]', '$_POST[needSubSysParam]', '$_POST[needHeartBeat]','$_POST[needCDR]','$_POST[needCSTA]','$_POST[needFlow]','$_POST[needSubscriberConf]','$_POST[platHeart]') + "; + } + else + { + echo "
      Type no always is used!"; + } + } + elseif(isset($sysTypeNo))//修改已有类型 + { + if(isset($old_sysTypeNo) && $old_sysTypeNo!='new') + { + $chg_type=$old_sysTypeNo; + } + else + { + $chg_type=$sysTypeNo; + } + $save_sql = " + UPDATE $sysconf_table + SET + sysTypeNo = '$sysTypeNo', + sysTypeName = '$_POST[sysTypeName]', + maxSysNum = '$_POST[maxSysNum]', + maxSubSysNum = '$_POST[maxSubSysNum]', + maxE1Num = '$_POST[maxE1Num]', + maxMsgLen = '$_POST[maxMsgLen]', + snmpPort = '$_POST[snmpPort]', + snmpHead = '$_POST[snmpHead]', + snmpCommunity = '$_POST[snmpCommunity]', + snmpInstanceBgn = '$_POST[snmpInstanceBgn]', + remark = '$_POST[remark]', + ledOffset = '$_POST[ledOffset]', + needInstall = '$_POST[needInstall]', + needUninstall = '$_POST[needUninstall]', + needParamConf = '$_POST[needParamConf]', + needMuliObj = '$_POST[needMuliObj]', + needGlobalSysParam = '$_POST[needGlobalSysParam]', + needGlobalSubSysParam = '$_POST[needGlobalSubSysParam]', + needSubSysParam = '$_POST[needSubSysParam]', + needHeartBeat = '$_POST[needHeartBeat]', + needCDR = '$_POST[needCDR]', + needCSTA = '$_POST[needCSTA]', + needFlow = '$_POST[needFlow]', + needSubscriberConf = '$_POST[needSubscriberConf]', + platHeart = '$_POST[platHeart]', + otherModuleSendHeart = '$_POST[otherModuleSendHeart]' + + WHERE sysTypeNo='$chg_type' + "; + } + //echo "
      $save_sql"; + //echo "
      index: $otherModuleSendHeart"; + $save_result = mysqli_query($pubConn,$save_sql); + echo mysqli_error($pubConn); + //------------插入日志------------ + insertLog("Update sysTypeNo($sysTypeNo)'s define"); + //------------ + //echo "$save_sql"; + if($save_result > 0){ + echo "
      $strSaveSuccess"; + }else{ + echo mysqli_error($pubConn); + echo "
      $strSaveFailure"; + } + +} //end if($save) + +?> + + + +
      " > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      +

      +
      + + + +"; +echo ""; +$no=0; +do{ + $len=strlen($type_rows[sysTypeNo]); + $existSysTypeNoArr[$no++]=$type_rows[sysTypeNo];//arwean add 2006-8-14 12:23 + if($len==3) + { + $level_0=substr($type_rows[sysTypeNo],0,1); + $level_1=substr($type_rows[sysTypeNo],1,1); + $level_2=substr($type_rows[sysTypeNo],2,1); + } + elseif($len==2) + { + $level_0=0; + $level_1=substr($type_rows[sysTypeNo],0,1); + $level_2=substr($type_rows[sysTypeNo],1,1); + } + else + { + $level_0=0; + $level_1=0; + $level_2=substr($type_rows[sysTypeNo],0,1); + } + echo ""; +}while($type_rows = @mysqli_fetch_array($type_result)); +?> + +
      + +
      +
      + +
      + +
      + +
      + +
      + + +
      + +
      + +
      + +
      + +
      " >
      + " > +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + +
      + "; + echo ""; + for($i=0;$i<$len;$i++) + { + if($platHeart == $i) + { + echo ""; + } + else + { + echo ""; + } + } + ?> + +
      + "; + echo ""; + for($i=0;$i<$len;$i++) + { + $PlatTypeDefArr_sysTypeNo = $PlatTypeDefArr[$i][sysTypeNo]; + if($otherModuleSendHeart == $PlatTypeDefArr_sysTypeNo) + { + echo ""; + } + else + { + echo ""; + } + } + ?> + +
      + + " name="old_sysTypeNo"> +

      " name="save"> + " name="reset"> + " name="delete"> +

      +
      + + + + diff --git a/wxc2_omc/sysDefine/sysMngDef/systemConf_tree.php b/wxc2_omc/sysDefine/sysMngDef/systemConf_tree.php new file mode 100755 index 0000000..a4bcbd4 --- /dev/null +++ b/wxc2_omc/sysDefine/sysMngDef/systemConf_tree.php @@ -0,0 +1,108 @@ + '0' + ORDER BY ledOffset + "; +}else{ + $showFieldList = "snmpHead,sysTypeName,sysTypeNo,maxSysNum,maxSubSysNum,ledOffset,needHeartBeat"; + $showFieldList .= ",needParamConf"; + $treeMenuSql = "SELECT $showFieldList + FROM $sysConfTable + WHERE snmpHead like '%1373%' + ORDER BY sysTypeNo + "; + echo ""; +} + + +?> + + +"; + echo ""; + echo ""; + echo "Template > LED Definition > Offset"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; +*/ +?> +
      +$treeMenuSql"; +$treeMenuResult = mysqli_query($pubConn,$treeMenuSql); +echo mysqli_error($pubConn); + +//echo "LED"; +?> + + +"; +for($i=0;$i$fieldArr[$i]"; +} +echo ""; +while($treeMenuRows = @mysqli_fetch_array($treeMenuResult)){ + echo ""; + for($i=0;$i"; + echo "{$treeMenuRows[sysTypeName]}"; + }else{ + echo ""; + } + } + echo ""; +} +?> +
      {$treeMenuRows[$fieldArr[$i]]}
      +
      + + + \ No newline at end of file diff --git a/wxc2_omc/sysDefine/sysParamDef/paramConf.php b/wxc2_omc/sysDefine/sysParamDef/paramConf.php new file mode 100755 index 0000000..c04acc8 --- /dev/null +++ b/wxc2_omc/sysDefine/sysParamDef/paramConf.php @@ -0,0 +1,631 @@ + + + + + + +"; + echo ""; + echo ""; + echo "Template > Template > Parameter > Structure"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; + +$sysConfTable = 'OMC_PUB.sysConf'; +$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:322);//default is CCF-MSC + +$pubDb ='OMC_PUB'; +$objDb = omcGetObjDb($sysTypeNo); +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf); +$maxLevelNum = 10; + +if($DEBUG) echo "
      $paramConfTable
      "; + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField=name_2; //语种2 +}else{ + $objNameField=name_1; //语种1(默认语种) +} +//----------------------- + + +/**************************************删除一个类型说明***********************************************/ +if($delete){ + $delSql = "DELETE FROM $paramConfTable WHERE keyId='$keyId'"; + if($DEBUG) echo "delSql=$delSql
      "; + $delResult = mysqli_query($pubConn ,$delSql); + echo mysqli_error($pubConn); + //------------ + if($delResult){ + echo ""; + }else{ + echo ""; + } +} //end if($delete) + +/*****************************添加,保存一个新的参数类型或创建新的参数结构表*****************************/ +if($save){ + if($DEBUG) echo "
      keyId = $keyId"; + if($keyId == 'new'){ //插入一个新类型 + $saveSql = "REPLACE INTO $paramConfTable (name_1,name_2,desc_1,desc_2,paramType,number,length,valueType,operType,initValue,minValue,maxValue,setTemplate_1,setTemplate_2,needNote,note_1,note_2,level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10) VALUES('$name_1','$name_2','$desc_1','$desc_2','$paramType','$number','$length','$valueType','$operType','$initValue','$minValue','$maxValue','$setTemplate_1','$setTemplate_2','$needNote','$note_1','$note_2','$level_1','$level_2','$level_3','$level_4','$level_5','$level_6','$level_7','$level_8','$level_9','$level_10')"; + $saveResult = mysqli_query($pubConn ,$saveSql); + if($saveResult){ + $keyIdSel = "SELECT keyId FROM $paramConfTable WHERE + level_1='$level_1' AND + level_2='$level_2' AND + level_3='$level_3' AND + level_4='$level_4' AND + level_5='$level_5' AND + level_6='$level_6' AND + level_7='$level_7' AND + level_8='$level_8' AND + level_9='$level_9' AND + level_10='$level_10' + "; + $keyIdResult = mysqli_query($pubConn,$keyIdSel); + $keyIdeRows = mysqli_fetch_array($keyIdResult); + $keyId = $keyIdeRows[keyId]; + } + }elseif($keyId > 0){ //修改已有类型 + if($needNote !=1){ + $needNote = 0; + } + $saveSql = "UPDATE $paramConfTable + SET + name_1='$name_1', + name_2='$name_2', + desc_1='$desc_1', + desc_2='$desc_2', + paramType='$paramType', + number='$number', + length='$length', + valueType='$valueType', + operType='$operType', + initValue='$initValue', + minValue='$minValue', + maxValue='$maxValue', + needNote='$needNote', + note_1='$note_1', + note_2='$note_2', + level_1='$level_1', + level_2='$level_2', + level_3='$level_3', + level_4='$level_4', + level_5='$level_5', + level_6='$level_6', + level_7='$level_7', + level_8='$level_8', + level_9='$level_9', + level_10='$level_10' + WHERE keyId='$keyId' + "; + $saveResult = mysqli_query($pubConn ,$saveSql); + }else{ + echo "
      Error: keyId == NULL"; + } + if($DEBUG) echo "
      $saveSql"; + echo mysqli_error($pubConn); + if($saveResult){ + /* + //更新备份文件 + $csvFileName = '/usr/local/apache/htdocs/db_backup/other/'.$paramConfTable.'.csv'; + @unlink($csvFileName); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '$csvFileName' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $paramConfTable + "; + $csvFileUpdateResult = mysqli_query($pubConn ,$csvFileUpdateSql); + echo mysqli_error($pubConn); + */ + echo ""; + }else{ + echo ""; + } +} //end if($save) + +/*****************************创建参数库和参数配置表*****************************/ +$dblist = mysqli_query($pubConn, "SHOW DATABASES"); +$dbNum = @mysqli_num_rows($dbList); +for($i=0; $i < $dbNum; $i++){ + $dbName = mysqli_dbname($dbList, $i); + if($dbName == $objDb){ + if($DEBUG) echo "
      $objDb have be created"; + break; + } + if($i == $dbNum-1){ + if($DEBUG) echo "
      $objDb have not be created"; + //step 1.create objDb + $sql="CREATE DATABASE $objDb"; + mysqli_query($pubConn,$sql); + if($DEBUG) echo "
      create $objDb sql =$sql"; + echo mysqli_error($pubConn); + //step 2.create paramConf table in objDb + $sql="CREATE TABLE paramConf ( + keyId int(4) unsigned NOT NULL auto_increment, + name_1 varchar(30) NOT NULL, + name_2 varchar(30) NOT NULL, + desc_1 varchar(255) NOT NULL, + desc_2 varchar(255) NOT NULL, + paramType tinyint(1) DEFAULT '0' NOT NULL, + operType tinyint(1) DEFAULT '0' NOT NULL, + number int(6) DEFAULT '0' NOT NULL, + length smallint(3) DEFAULT '0' NOT NULL, + valueType tinyint(1) DEFAULT '0' NOT NULL, + initValue varchar(255) NOT NULL, + minValue varchar(255) NOT NULL, + maxValue varchar(255) NOT NULL, + setTemplate_1 text NOT NULL, + setTemplate_2 text NOT NULL, + needNote tinyint(1) DEFAULT '0' NOT NULL, + note_1 varchar(200) NOT NULL, + note_2 varchar(200) NOT NULL, + level_1 int(5) DEFAULT '0' NOT NULL, + level_2 int(5) DEFAULT '0' NOT NULL, + level_3 int(5) DEFAULT '0' NOT NULL, + level_4 int(5) DEFAULT '0' NOT NULL, + level_5 int(5) DEFAULT '0' NOT NULL, + level_6 int(5) DEFAULT '0' NOT NULL, + level_7 int(5) DEFAULT '0' NOT NULL, + level_8 int(5) DEFAULT '0' NOT NULL, + level_9 int(5) DEFAULT '0' NOT NULL, + level_10 int(5) DEFAULT '0' NOT NULL, + KEY level_1 (level_1), + KEY level_2 (level_2), + KEY level_3 (level_3), + KEY level_4 (level_4), + KEY level_5 (level_5), + KEY level_6 (level_6), + KEY level_7 (level_7), + KEY level_8 (level_8), + KEY level_9 (level_9), + KEY level_10 (level_10), + KEY id (keyId) + )"; + mysqli_query($pubConn,$sql); + if($DEBUG) echo "
      create paramConf table sql =$sql"; + echo mysqli_error($pubConn); + break; + } +} +?> +
      " > + + + + + + + + + + + + + + "; + $objResult = mysqli_query($pubConn ,$objSql); + $objRows = @mysqli_fetch_array($objResult); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + "; + echo " + selected Id = $keyId"; + if($DEBUG) echo "
      objSql = $objSql"; + if($DEBUG) echo mysqli_error($pubConn); + ?> +
      : + "; + if($i < $maxLevelNum){ + echo "•"; //dot + } + } + ?> +
      : + " >(Chinese)
      : + " >(English)
      : + " >(Chinese) +
      : + " >(English) +
      : + +
      Operation define: + +
      (Needn't fill the follow fields if this object have sub-objects) +
      : + " > +
      : + " > + In default Integer's length is 5 +
      : + +
      : + + min value = " onChange="javascript: chkValue(this);">    + max value = " onChange="javascript: chkValue(this);"> + +
      : + " onChange="javascript: chkValue(this);"> +
      Need Note: + > +
      Note Message 1: + ">(Chinese) +
      Note Message 2: + ">(English) +
      + + +
      + + +
      + +

      + + +

      +
      + +
      "> + + +
      +
      + + +
      "> + + +
      +
      + + + diff --git a/wxc2_omc/sysDefine/sysParamDef/paramEditConf.php b/wxc2_omc/sysDefine/sysParamDef/paramEditConf.php new file mode 100755 index 0000000..9c7350d --- /dev/null +++ b/wxc2_omc/sysDefine/sysParamDef/paramEditConf.php @@ -0,0 +1,462 @@ + + + +"; + echo ""; + echo ""; + echo "Template > Parameter > Edit"; + echo ""; + echo ""; + //showHelp($helpId); + echo ""; + echo ""; +echo ""; +adjust_title_tail(); +adjust_content_head(); +echo "
      "; + +$DEBUG = 0; + +function omcGetObjDb($sysTypeNo){ + $dbName = 'OBJ_'.$sysTypeNo; + return($dbName); +} + +function omcGetObjTbl($sysTypeNo,$tableType){ + $dbName = 'OBJ_'.$sysTypeNo; + $tableName = $dbName.'.paramConf'; + return($tableName); +} +$sysConfTable = 'OMC_PUB.sysConf'; +$sysTypeNo = (isset($sysTypeNo)?$sysTypeNo:322);//default is CCF-MSC + +$pubDb ='OMC_PUB'; +$objDb = omcGetObjDb($sysTypeNo); +$paramConfTable = omcGetObjTbl($sysTypeNo,paramConf); +$maxLevelNum = 10; + +if($DEBUG) echo "
      $paramConfTable
      "; + +//---------------------- +//选择语言版本 +if($language == 'eng'){ + $objNameField = name_2; + $objSetField = setTemplate_2 ; //语种2 +}else{ + $objNameField = name_1; + $objSetField = setTemplate_1 ; //语种1(默认语种) +} +//----------------------- + +/*****************************保存一个新的参数编辑模板*****************************/ +if($save){ + if($DEBUG) echo "
      keyId = $keyId"; + if($keyId > 0){ + $saveSql = "UPDATE $paramConfTable + SET $objSetField = '$codeArea' + WHERE keyId='$keyId' + "; + $saveResult = mysqli_query($pubConn,$saveSql); + }else{ + echo "
      Error: keyId == NULL"; + exit(); + } + if($DEBUG) echo "
      $saveSql"; + echo mysqli_error($pubConn); + if($saveResult){ + //更新备份文件 + $csvFileName = '/usr/local/apache/htdocs/db_backup/other/'.$paramConfTable.'.csv'; + @unlink($csvFileName); + $csvFileUpdateSql=" SELECT * + INTO OUTFILE '$csvFileName' + FIELDS TERMINATED BY ',' + LINES TERMINATED BY '\n' + FROM $paramConfTable + "; + $csvFileUpdateResult = mysqli_query($pubConn ,$csvFileUpdateSql); + echo mysqli_error($pubConn); + echo ""; + }else{ + echo ""; + } +} +?> + + + + + "; +?> +
      " > + + + + + + + + + + + + + valueType=$valueType"; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      + +
      + + + +
      + + + + + selected Id = $keyId"; + if($DEBUG) echo "
      objSql = $objSql"; + if($DEBUG) echo mysqli_error($pubConn); + ?> +
      + Design Area + objSql=$objSql
      ";?> + +
      Name">
      offset + From + byte + bit    + Tobyte + bit + +
      Unit Name + +
      Input Field mode: + +
      Put down MenuOption number: + + + Please change "decValue" and "menuName" +
      Created Code
      +
      +    +    + )"> +
      +
      +说明: +
      1.如果一个参数值由多个值组成,则可分成多个编辑单元,以便用户编辑。 +
      2.每个编辑单元,可制定不同的编辑方式(输入框或下拉菜单)。 +
      3.当使用下拉菜单时,需要替换代码区中的"[v]DecValue[opt]MenuName"中的DecValue(十进制值)和MenuName(菜单名)。 +
      4.如果某段数值预留不用,请用"[unit]reserved[u]bgnOffset-endOffset[u]select"标示。 +
      5.请注意,不能删除语法标签[unit],[u],[v],[opt],[remark],同时也不要在说明中使用这些标签。 +
      6.生成的编辑代码保存后,可点击"Preview"来查看是否正确。 + + + diff --git a/wxc2_omc/sysDefine/sysParamDef/paramInit.php b/wxc2_omc/sysDefine/sysParamDef/paramInit.php new file mode 100755 index 0000000..79a6378 --- /dev/null +++ b/wxc2_omc/sysDefine/sysParamDef/paramInit.php @@ -0,0 +1,436 @@ +function omcGetObjTbl(): Unknown table Type:$tableType"; + exit(); + } + return($tableName); +} +function initParbyConf($sysTypeNo) +{ + $DEBUG=0; + $pubDb = "OMC_PUB"; + global $PlatTypeDefArr; + $objDb = omcGetObjDb($sysTypeNo); + $paramConfTable = omcGetObjTbl('paramConf',$sysTypeNo); //得到参数定义表的名称 + + $nPubFlag = 99; + $nSubSysParam = 0; + $nGlobalSubSysParam = 1; + $nGlobalSysParam = 2; + + //********************************取出设备类型定义******************************* + $sysConfTable = 'OMC_PUB.sysConf'; + $confSql = "SELECT maxSysNum,maxSubSysNum,needGlobalSysParam,snmpInstanceBgn + FROM $sysConfTable + WHERE sysTypeNo='$sysTypeNo' + "; + $confResult = mysqli_query($pubConn ,$confSql); + $confRows = mysqli_fetch_array($confResult); + $maxSysNum = $confRows[maxSysNum]; + $maxSubSysNum = $confRows[maxSubSysNum]; + $needGlobalSysParam = $confRows[needGlobalSysParam]; + $snmpInstanceBgn = $confRows[snmpInstanceBgn]; + if($DEBUG) echo "
      confSql = $confSql"; + if($DEBUG) echo "
      sysTypeNo = $sysTypeNo"; + if($DEBUG) echo "
      maxSysNum = $maxSysNum"; + if($DEBUG) echo "
      maxSubSysNum = $maxSubSysNum"; + if($DEBUG) echo "
      needGlobalSysParam = $needGlobalSysParam"; + + //********************************取出参数类型定义********************************** + $getConfSql = "SELECT paramType,number,length,valueType,operType,initValue, + level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 + FROM $paramConfTable + WHERE number > '0' AND LENGTH(initValue) > 0 + ORDER BY level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 + "; + if($DEBUG) echo "
      getConfSql = $getConfSql"; + $getConfResult = mysqli_query($pubConn,$getConfSql); + echo mysqli_error($pubConn); + if(mysqli_num_rows($getConfResult) < 0){ + echo "Cannot get vailed record form paramConfTable:$paramConfTable"; + } + //********************************循环填充每一个参数类型**************************** + $confRowsNum = mysqli_num_rows($getConfResult); + while($confRows = mysqli_fetch_array($getConfResult)){ + //取出该类型参数信息 + $paramType = $confRows[paramType]; + $number = $confRows[number]; + $length = $confRows[length]; + $valueType = $confRows[valueType]; + $operType = $confRows[operType]; + $initValue = $confRows[initValue]; + + $levelWhereStr = ''; + for($i=1; $i<=10; $i++){ + $level_i = "level_$i"; + $levelWhereStr .= " $level_i=" . $confRows[$level_i] . " and"; + } + $levelWhereStr = rtrim($levelWhereStr,'and'); + + if($paramType == $nGlobalSysParam){ + $paramTable = omcGetObjTbl('param',$sysTypeNo,$nPubFlag); + $subSysNo = $nPubFlag; + + $updSql = "update $paramTable set initValue='$initValue', readValue='' where $levelWhereStr"; + if($DEBUG)echo "
      updSql = $updSql"; + mysqli_query($pubConn,$updSql); + + if($sysTypeNo==222||$sysTypeNo==223){//platform system + for($sysNo=0;$sysNo<$maxSysNum;$sysNo++){ //每个系统编号 + if($sysNo!=8&&$sysNo!=11)//目前只有VMS AAS用到了平台参数 + continue; + $paramTable = omcGetObjTbl('param',$sysTypeNo,$sysNo); + $updSql = "update $paramTable set initValue='$initValue', readValue='' where $levelWhereStr"; + if($DEBUG)echo "
      updSql = $updSql"; + mysqli_query($pubConn,$updSql); + } + } + }else if($paramType == $nGlobalSubSysParam){ + for($sysNo=0;$sysNo<$maxSysNum;$sysNo++){ //每个系统编号 + $paramTable = omcGetObjTbl('param',$sysTypeNo,$sysNo); + $subSysNo = $nPubFlag; + $updSql = "update $paramTable set initValue='$initValue', readValue='' where $levelWhereStr"; + if($DEBUG)echo "
      updSql = $updSql"; + mysqli_query($pubConn,$updSql); + } + }else{//子系统参数 + for($sysNo=0;$sysNo<$maxSysNum;$sysNo++){ //每个系统编号 + $paramTable = omcGetObjTbl('param',$sysTypeNo,$sysNo); + $updSql = "update $paramTable set initValue='$initValue', readValue='' where $levelWhereStr"; + if($DEBUG)echo "
      updSql = $updSql"; + mysqli_query($pubConn,$updSql); + } + }//end of ($paramType) + + if($confRowsNum > 20){ + print(">"); + }else{ + print(">>"); + } + flush(); + //if($DEBUG) exit(); + }//end of while +} + +function initParam($sysTypeNo) +{ + global $PlatTypeDefArr; + $objDb = omcGetObjDb($sysTypeNo); + $paramConfTable = omcGetObjTbl('paramConf',$sysTypeNo); //得到参数定义表的名称 + $maxFieldLen = 128; + + $nPubFlag = 99; + $nSubSysParam = 0; + $nGlobalSubSysParam = 1; + $nGlobalSysParam = 2; + + //********************************取出设备类型定义******************************* + $sysConfTable = 'OMC_PUB.sysConf'; + $confSql = "SELECT maxSysNum,maxSubSysNum,needGlobalSysParam,snmpInstanceBgn + FROM $sysConfTable + WHERE sysTypeNo='$sysTypeNo' + "; + $confResult = mysqli_query($pubConn ,$confSql); + $confRows = mysqli_fetch_array($confResult); + $maxSysNum = $confRows[maxSysNum]; + $maxSubSysNum = $confRows[maxSubSysNum]; + $needGlobalSysParam = $confRows[needGlobalSysParam]; + $snmpInstanceBgn = $confRows[snmpInstanceBgn]; + + if($DEBUG) echo "
      sysTypeNo = $sysTypeNo"; + if($DEBUG) echo "
      maxSysNum = $maxSysNum"; + if($DEBUG) echo "
      maxSubSysNum = $maxSubSysNum"; + if($DEBUG) echo "
      needGlobalSysParam = $needGlobalSysParam"; + + //************删去每个系统原有的参数表,并创建新的表************************************ + if($needGlobalSysParam > '0'){ + $GlobalSysParamTable = 'param_'.$nPubFlag; + $dropSql = " DROP TABLE $GlobalSysParamTable "; + if($DEBUG) echo "
      ---->dropSql = $dropSql"; + mysqli_query($pubConn,$dropSql); + //echo mysqli_error($pubConn); + sleep(1); + $createTableSql="CREATE TABLE $GlobalSysParamTable ( + subSysNo tinyint(3) unsigned DEFAULT '0' NOT NULL, + paramType tinyint(1) unsigned DEFAULT '0' NOT NULL, + level_1 int(5) unsigned DEFAULT '0' NOT NULL, + level_2 int(5) unsigned DEFAULT '0' NOT NULL, + level_3 int(5) unsigned DEFAULT '0' NOT NULL, + level_4 int(5) unsigned DEFAULT '0' NOT NULL, + level_5 int(5) unsigned DEFAULT '0' NOT NULL, + level_6 int(5) unsigned DEFAULT '0' NOT NULL, + level_7 int(5) unsigned DEFAULT '0' NOT NULL, + level_8 int(5) unsigned DEFAULT '0' NOT NULL, + level_9 int(5) unsigned DEFAULT '0' NOT NULL, + level_10 int(5) unsigned DEFAULT '0' NOT NULL, + instanceNo int(5) unsigned DEFAULT '0' NOT NULL, + sortNo tinyint(2) unsigned DEFAULT '0' NOT NULL, + valueType tinyint(1) unsigned DEFAULT '0' NOT NULL, + operType tinyint(1) unsigned DEFAULT '0' NOT NULL, + length smallint(3) unsigned DEFAULT '0' NOT NULL, + initValue varchar(255) binary NOT NULL, + readValue varchar(255) binary NOT NULL, + UNIQUE KEY keyList( subSysNo ,level_1,level_2,level_3,level_4,level_5, + level_6, level_7 ,level_8,level_9,level_10,instanceNo), + KEY subSysNo (subSysNo), + KEY level_1 (level_1), + KEY level_2 (level_2), + KEY level_3 (level_3), + KEY level_4 (level_4), + KEY level_5 (level_5), + KEY level_6 (level_6), + KEY level_7 (level_7), + KEY level_8 (level_8), + KEY level_9 (level_9), + KEY level_10 (level_10), + KEY instanceNo (instanceNo) + )"; + if($DEBUG) echo "
      ---->createTableSql = $createTableSql"; + mysqli_query($pubConn,$createTableSql); + echo mysqli_error($pubConn); + } + + for($sysNo=0;$sysNo<$maxSysNum;$sysNo++){ + $paramTable = omcGetObjTbl('param',$sysTypeNo,$sysNo); //得到参数定义表的名称 + if($DEBUG) echo "
      ---->paramTable = $paramTable"; + + $dropSql = " DROP TABLE $paramTable "; + if($DEBUG) echo "
      ---->dropSql = $dropSql"; + mysqli_query($pubConn,$dropSql); + echo mysqli_error($pubConn); + sleep(1); + $createTableSql="CREATE TABLE $paramTable ( + subSysNo tinyint(3) unsigned DEFAULT '0' NOT NULL, + paramType tinyint(1) unsigned DEFAULT '0' NOT NULL, + level_1 int(5) unsigned DEFAULT '0' NOT NULL, + level_2 int(5) unsigned DEFAULT '0' NOT NULL, + level_3 int(5) unsigned DEFAULT '0' NOT NULL, + level_4 int(5) unsigned DEFAULT '0' NOT NULL, + level_5 int(5) unsigned DEFAULT '0' NOT NULL, + level_6 int(5) unsigned DEFAULT '0' NOT NULL, + level_7 int(5) unsigned DEFAULT '0' NOT NULL, + level_8 int(5) unsigned DEFAULT '0' NOT NULL, + level_9 int(5) unsigned DEFAULT '0' NOT NULL, + level_10 int(5) unsigned DEFAULT '0' NOT NULL, + instanceNo int(5) unsigned DEFAULT '0' NOT NULL, + sortNo tinyint(2) unsigned DEFAULT '0' NOT NULL, + valueType tinyint(1) unsigned DEFAULT '0' NOT NULL, + operType tinyint(1) unsigned DEFAULT '0' NOT NULL, + length smallint(3) unsigned DEFAULT '0' NOT NULL, + initValue varchar(255) binary NOT NULL, + readValue varchar(255) binary NOT NULL, + UNIQUE KEY keyList( subSysNo ,level_1,level_2,level_3,level_4,level_5, + level_6, level_7 ,level_8,level_9,level_10,instanceNo), + KEY subSysNo (subSysNo), + KEY level_1 (level_1), + KEY level_2 (level_2), + KEY level_3 (level_3), + KEY level_4 (level_4), + KEY level_5 (level_5), + KEY level_6 (level_6), + KEY level_7 (level_7), + KEY level_8 (level_8), + KEY level_9 (level_9), + KEY level_10 (level_10), + KEY instanceNo (instanceNo) + )"; + if($DEBUG) echo "
      ---->createTableSql = $createTableSql"; + mysqli_query($pubConn,$createTableSql); + echo mysqli_error($pubConn); + }//end of for() + + //********************************取出参数类型定义********************************** + $getConfSql = "SELECT paramType,number,length,valueType,operType,initValue, + level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 + FROM $paramConfTable + WHERE number > '0' AND LENGTH(initValue) > 0 + ORDER BY level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 + "; + if($DEBUG) echo "
      getConfSql = $getConfSql"; + $getConfResult = mysqli_query($pubConn,$getConfSql); + echo mysqli_error($pubConn); + + if(mysqli_num_rows($getConfResult) < 0){ + echo "Cannot get vailed record form paramConfTable:$paramConfTable"; + } + //********************************循环填充每一个参数类型**************************** + $confRowsNum = mysqli_num_rows($getConfResult); + while($confRows = mysqli_fetch_array($getConfResult)){ + //取出该类型参数信息 + $paramType = $confRows[paramType]; + $number = $confRows[number]; + $length = $confRows[length]; + $valueType = $confRows[valueType]; + $operType = $confRows[operType]; + $initValue = $confRows[initValue]; + $sortNo = 0; + $level_1 = $confRows[level_1]; + $level_2 = $confRows[level_2]; + $level_3 = $confRows[level_3]; + $level_4 = $confRows[level_4]; + $level_5 = $confRows[level_5]; + $level_6 = $confRows[level_6]; + $level_7 = $confRows[level_7]; + $level_8 = $confRows[level_8]; + $level_9 = $confRows[level_9]; + $level_10 = $confRows[level_10]; + for($instanceNo=$snmpInstanceBgn;$instanceNo<$number+$snmpInstanceBgn;$instanceNo++){//每个实例编号 + if($paramType == $nGlobalSysParam){ + $paramTable = omcGetObjTbl('param',$sysTypeNo,$nPubFlag); + $subSysNo = $nPubFlag; + $insertSql="INSERT INTO $paramTable + (subSysNo,paramType,instanceNo,sortNo,valueType,operType,length,initValue, + level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,Level_10) + VALUES + ('$subSysNo','$paramType','$instanceNo','$sortNo','$valueType','$operType','$length', + '$initValue','$level_1','$level_2','$level_3','$level_4','$level_5', + '$level_6','$level_7','$level_8','$level_9','$level_10') + "; + if($DEBUG) echo "
      $insertSql"; + mysqli_query($pubConn,$insertSql); + echo mysqli_error($pubConn); + + if($sysTypeNo==222||$sysTypeNo==223){//platform system + for($sysNo=0;$sysNo<$maxSysNum;$sysNo++){ //每个系统编号 + if($sysNo!=8&&$sysNo!=11)//目前只有VMS AAS用到了平台参数 + continue; + $paramTable = omcGetObjTbl('param',$sysTypeNo,$sysNo); + + for($subSysNo=0; $subSysNo < $PlatTypeDefArr[$sysNo][maxSysNum]; $subSysNo++){//每个子系统 + $insertSql="INSERT INTO $paramTable + (subSysNo,paramType,instanceNo,sortNo,valueType,operType,length,initValue, + level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,Level_10) + VALUES + ('$subSysNo','$nSubSysParam','$instanceNo','$sortNo','$valueType','$operType','$length', + '$initValue','$level_1','$level_2','$level_3','$level_4','$level_5', + '$level_6','$level_7','$level_8','$level_9','$level_10') + "; + if($DEBUG) + echo "
      $insertSql"; + mysqli_query($pubConn,$insertSql); + echo mysqli_error($pubConn); + }//end for + } + } + }else if($paramType == $nGlobalSubSysParam){ + for($sysNo=0;$sysNo<$maxSysNum;$sysNo++){ //每个系统编号 + $paramTable = omcGetObjTbl('param',$sysTypeNo,$sysNo); + $subSysNo = $nPubFlag; + $insertSql="INSERT INTO $paramTable + (subSysNo,paramType,instanceNo,sortNo,valueType,operType,length,initValue, + level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,Level_10) + VALUES + ('$subSysNo','$paramType','$instanceNo','$sortNo','$valueType','$operType','$length', + '$initValue','$level_1','$level_2','$level_3','$level_4','$level_5', + '$level_6','$level_7','$level_8','$level_9','$level_10') + "; + if($DEBUG) echo "
      $insertSql"; + mysqli_query($pubConn,$insertSql); + echo mysqli_error($pubConn); + } + }else{//子系统参数 + for($sysNo=0;$sysNo<$maxSysNum;$sysNo++){ //每个系统编号 + $paramTable = omcGetObjTbl('param',$sysTypeNo,$sysNo); + for($subSysNo=0; $subSysNo < $maxSubSysNum; $subSysNo++){//每个子系统 + $insertSql="INSERT INTO $paramTable + (subSysNo,paramType,instanceNo,sortNo,valueType,operType,length,initValue, + level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,Level_10) + VALUES + ('$subSysNo','$paramType','$instanceNo','$sortNo','$valueType','$operType','$length', + '$initValue','$level_1','$level_2','$level_3','$level_4','$level_5', + '$level_6','$level_7','$level_8','$level_9','$level_10') + "; + if($DEBUG) echo "
      $insertSql"; + mysqli_query($pubConn,$insertSql); + echo mysqli_error($pubConn); + } + } + }//end of for($paramType) + }//end of for($instanceNo..) + if($confRowsNum > 20){ + print(">"); + }else{ + print(">>"); + } + flush(); + //if($DEBUG) exit(); + }//end of while +} +echo "
      "; +echo "
      Please wait a while for the operation to be finished...
      "; + +if(isset($initAll)) +{ + + //get all sysTypeNos that need to initial + $selSql = "select sysTypeNo,sysTypeName from OMC_PUB.sysConf where needParamConf='1' order by sysTypeNo"; + $Result = mysqli_query($pubConn,$selSql); + while($Rows = mysqli_fetch_array($Result)) + { + echo "
      Init {$Rows[sysTypeName]} ...
      "; + $sysTypeNo = $Rows[sysTypeNo]; + if($dropAndRecreate==1) + initParam($sysTypeNo); + else + initParbyConf($sysTypeNo); + } + + //init BssOmcDb OMCR_BssFunc + $updateSql = "UPDATE BssOmcDb.OMCR_BSSTABLE SET ip='',name='',remark='',connected='0',alarmed='0',uploaded='0'"; + mysqli_query($pubConn,$updateSql); +} +else +{ + if($dropAndRecreate==1) + initParam($sysTypeNo); + else + initParbyConf($sysTypeNo); +} +if($confirm==1){ + echo "\n"; +} +else + echo "


      $strParaInitializationComplete,$strClickHereForReturn"; +?> \ No newline at end of file diff --git a/wxc2_omc/sysDefine/sysParamDef/paramInitConfirm.php b/wxc2_omc/sysDefine/sysParamDef/paramInitConfirm.php new file mode 100755 index 0000000..554be37 --- /dev/null +++ b/wxc2_omc/sysDefine/sysParamDef/paramInitConfirm.php @@ -0,0 +1,30 @@ + + + +"; +echo ""; +echo ""; +echo "Advance > Network > Init Parameters"; +echo ""; +echo ""; +//showHelp($helpId); +echo ""; +echo ""; +echo ""; +?> +
      "> + + +
      + +
                      + "> + + + " name="initParameter"> +
      +
      + diff --git a/wxc2_omc/sysDefine/wizardParam.tgz b/wxc2_omc/sysDefine/wizardParam.tgz new file mode 100755 index 0000000..32e99ef Binary files /dev/null and b/wxc2_omc/sysDefine/wizardParam.tgz differ diff --git a/wxc2_omc/sysDefine/wizardParam/comm_func.php b/wxc2_omc/sysDefine/wizardParam/comm_func.php new file mode 100755 index 0000000..55d4410 --- /dev/null +++ b/wxc2_omc/sysDefine/wizardParam/comm_func.php @@ -0,0 +1,190 @@ +"; + $res=mysqli_query($pubConn,$sql); + $mibSystem[SystemCount]=mysqli_num_rows($res); + if($mibSystem[SystemCount] == 0) + return $mibSystem; + + for($i=0;$i<$mibSystem[SystemCount];$i++) + { + $row=@mysqli_fetch_array($res); + $mibSystem[$i][SysTypeNo]=$row[sysTypeNo]+0; + $mibSystem[$i][SysTypeName]=$row[sysTypeName]; + $mibSystem[$i][EntryOID]=$row[entryOid]; + $mibSystem[$i][MaxSysNum]=$row[maxSysNum]; + $mibSystem[$i][MaxSubSysNum]=$row[maxSubSysNum]; + } + return $mibSystem; +} + +function getLevelWhere($objIdStr) +{ + $levelArr=explode('.',$objIdStr); + for($j=0;$jlevelArr[$j]={$levelArr[$j]}"; + if($j == 0){ + $levelWhere ="level_$levelNo='${"level_$levelNo"}'"; + }else{ + $levelWhere .=" AND level_$levelNo='${"level_$levelNo"}'"; + } + } + return($levelWhere); +} + +function getOIDByRow($row) +{ + $oid=""; + for($i=1;$i<=10;$i++) + { + $level="level_".$i; + if($row[$level] == 0) + { + break; + } + else + { + $oid.=$row[$level]."."; + } + } + $oid=substr($oid,0,strlen($oid)-1); + return $oid; +} + +function adjustTableName($name) +{ + $len=strlen($name); + $result=""; + + if($name[0]>='a' && $name[0]<='z') + $result.=chr(ord($name[0])-32); + for($i=1;$i<$len;$i++) + { + if($i != 1) + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i-1]>='a' && $name[$i-1]<='z') + $result.=" "; + + if($name[$i]>='A' && $name[$i]<='Z' && $name[$i+1]>='a' && $name[$i+1]<='z' && $name[$i-1]>='A' && $name[$i-1]<='Z') + $result.=" "; + + $result.=$name[$i]; + + if(($name[$i]<'0' || $name[$i]>'9')&& ($name[$i+1]>='0' && $name[$i+1]<='9')) + $result.=" "; + if(($name[$i]>='0' && $name[$i]<='9')&& ($name[$i+1]<'0' || $name[$i+1]>'9')) + $result.=" "; + } + + $result=str_replace("Table","",$result); + $result=str_replace("Entry","",$result); + + return $result; +} + +function GetTabConf($sysTypeNo) +{ + $sql="select * from OBJ_{$sysTypeNo}.paramConf where maxAccess=0 and name_2 <> 'parameter' order by level_1,level_2,level_3,level_4,level_5,level_6,level_7,level_8,level_9,level_10 "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + //echo "$sql
      "; + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $tabConf[$i][Name]=adjustTableName($row[name_2]); + $tabConf[$i][OID]=getOIDByRow($row); + + $checkoid=$tabConf[$i][OID].".1.1.0"; + $checkwhere=getLevelWhere($checkoid); + $checksql="select desc_2 from OBJ_{$sysTypeNo}.paramConf where $checkwhere"; + $checkres=@mysqli_query($pubConn,$checksql); + $checknum=@mysqli_num_rows($checkres); + if($checknum == 1) + { + $checkrow=@mysqli_fetch_array($checkres); + $desc=$checkrow[desc_2]; + if(strstr($desc,"Name:")) + { + $new_name=explode("Name:",$desc); + $tabConf[$i][Name]=str_replace(";","",$new_name[sizeof($new_name)-1]); + } + } + + } + if($num == 0) + return 0; + return $tabConf; +} + +function GetWizardList() +{ + $sql="select * from WIZARD_DB.wizardList order by instance "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + $wizardList[WizardCount]=$num; + if($wizardList[WizardCount] == 0) + return $wizardList; + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $wizardList[$i][WizardTitle]=$row[func_title]; + $wizardList[$i][WizardInstance]=$row[instance]; + } + return $wizardList; +} + +function GetWizard($wizard_instance) +{ + $sql="select * from WIZARD_DB.wizardList where instance=$wizard_instance "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + if($num == 0) + return 0; + + $row=@mysqli_fetch_array($res); + $wizard[WizardTitle]=$row[func_title]; + $wizard[WizardDescription]=$row[func_desc]; + + return $wizard; +} + +function GetStepList($wizard_instance) +{ + $sql="select * from WIZARD_DB.stepList where wizard_instance={$wizard_instance} order by step_order "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + $stepList[StepCount]=$num; + if($stepList[StepCount] == 0) + return $stepList; + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $stepList[$i][StepIndex]=$row[step_order]+1; + $stepList[$i][StepTitle]=$row[step_title]; + $stepList[$i][StepDesc]=$row[step_desc]; + $stepList[$i][RelatedSystemTypeNo]=$row[related_system]+0; + $stepList[$i][RelatedTableOID]=$row[related_table]; + } + return $stepList; +} + +function discardReturn($content) +{ + $tmpstr=$content; + $tmplen=strlen($tmpstr); + $newstr=""; + for($j=0;$j< $tmplen;$j++) + { + if(ord($tmpstr[$j]) != 10 && ord($tmpstr[$j]) != 13) + $newstr.=$tmpstr[$j]; + } + return $newstr; +} + +?> + diff --git a/wxc2_omc/sysDefine/wizardParam/get_table_list.php b/wxc2_omc/sysDefine/wizardParam/get_table_list.php new file mode 100755 index 0000000..c49c410 --- /dev/null +++ b/wxc2_omc/sysDefine/wizardParam/get_table_list.php @@ -0,0 +1,17 @@ + + + diff --git a/wxc2_omc/sysDefine/wizardParam/wizard_param_add.php b/wxc2_omc/sysDefine/wizardParam/wizard_param_add.php new file mode 100755 index 0000000..860301a --- /dev/null +++ b/wxc2_omc/sysDefine/wizardParam/wizard_param_add.php @@ -0,0 +1,260 @@ + + + + + +"; + echo ""; + echo ""; + echo "Template > Function Wizard"; + echo ""; + echo ""; + echo " "; + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; + echo " "; + echo "$strBack"; + echo ""; + echo ""; + echo ""; + + adjust_title_tail(); + adjust_content_head(); + echo "
      "; + + $mibSystem=GetMibSystem(); + //echo "
      ";
      +	//print_r($mibSystem);
      +	//echo "
      "; + + $tabConf=GetTabConf($mibSystem[0][SysTypeNo]); + $tabCount=count($tabConf); + //echo "
      ";
      +	//print_r($tabConf);
      +	//echo "
      "; + + echo "
      "; + echo ""; + + //Wizard Title + echo ""; + echo ""; + echo ""; + echo ""; + + //Wizard Description + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Function Title:"; + echo ""; + echo ""; + echo "
      "; + echo "Function Description:"; + echo ""; + echo ""; + echo "
      "; + + echo ""; + + echo ""; + echo ""; + echo ""; + + for($i=0;$i<$MAX_STEP_COUNT;$i++) + { + echo "
      "; + echo "
      "; + + echo "Step ".($i+1)."
      "; + echo ""; + + //Step Title + echo ""; + echo ""; + echo ""; + echo ""; + + //Step Description + echo ""; + echo ""; + echo ""; + echo ""; + + //Related System + echo ""; + echo ""; + echo ""; + echo ""; + + //Related table + echo ""; + echo ""; + echo ""; + echo ""; + + + + echo "
      "; + echo "Title:"; + echo ""; + echo ""; + echo "
      "; + echo "Function Description:"; + echo ""; + echo ""; + echo "
      "; + echo "Related System:"; + echo ""; + echo ""; + echo "
      "; + echo "Related Table:"; + echo ""; + echo ""; + echo "
      "; + echo "
      "; + } + + //Button + echo "
      "; + echo ""; + echo " "; + echo ""; + echo " "; + echo ""; + + + + + echo "
      "; + adjust_content_tail(); +?> + diff --git a/wxc2_omc/sysDefine/wizardParam/wizard_param_edit.php b/wxc2_omc/sysDefine/wizardParam/wizard_param_edit.php new file mode 100755 index 0000000..cdd255d --- /dev/null +++ b/wxc2_omc/sysDefine/wizardParam/wizard_param_edit.php @@ -0,0 +1,324 @@ + + + + + + + +"; + echo ""; + echo ""; + echo "Template > Function Wizard"; + echo ""; + echo ""; + echo " "; + echo ""; + echo ""; + echo ""; + echo " "; + echo ""; + echo " "; + echo "$strBack"; + echo ""; + echo ""; + echo ""; + + adjust_title_tail(); + adjust_content_head(); + echo "
      "; + + if(0) + echo "wizard_instance=$wizard_instance
      "; + + $the_wizard=GetWizard($wizard_instance); + + $mibSystem=GetMibSystem(); + //echo "
      ";
      +	//print_r($mibSystem);
      +	//echo "
      "; + + $tabConf=GetTabConf($mibSystem[0][SysTypeNo]); + $tabCount=count($tabConf); + //echo "
      ";
      +	//print_r($tabConf);
      +	//echo "
      "; + + echo "
      "; + echo ""; + + //Wizard Title + echo ""; + echo ""; + echo ""; + echo ""; + + //Wizard Description + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Function Title:"; + echo ""; + echo ""; + echo "
      "; + echo "Function Description:"; + echo ""; + echo ""; + echo "
      "; + + echo ""; + //echo "StepCount={$stepList[StepCount]}
      "; + echo ""; + + echo ""; + echo ""; + echo ""; + + for($i=0;$i<$MAX_STEP_COUNT;$i++) + { + if($i < $stepList[StepCount]) + echo "
      "; + else + echo "
      "; + echo "
      "; + + echo "Step ".($i+1)."
      "; + echo ""; + + //Step Title + echo ""; + echo ""; + echo ""; + echo ""; + + //Step Description + echo ""; + echo ""; + echo ""; + echo ""; + + //Related System + echo ""; + echo ""; + echo ""; + echo ""; + + //Related table + echo ""; + echo ""; + echo ""; + echo ""; + + + + echo "
      "; + echo "Title:"; + echo ""; + if($i < $stepList[StepCount]) + echo ""; + else + echo ""; + echo "
      "; + echo "Function Description:"; + echo ""; + echo ""; + echo "
      "; + echo "Related System:"; + echo ""; + echo ""; + echo "
      "; + echo "Related Table:"; + echo ""; + echo ""; + echo "
      "; + echo "
      "; + } + + //Button + echo "
      "; + echo ""; + echo " "; + echo ""; + echo " "; + echo ""; + echo " "; + echo ""; + + + + echo ""; + adjust_content_tail(); +?> + + + diff --git a/wxc2_omc/sysDefine/wizardParam/wizard_param_mng.php b/wxc2_omc/sysDefine/wizardParam/wizard_param_mng.php new file mode 100755 index 0000000..cc51835 --- /dev/null +++ b/wxc2_omc/sysDefine/wizardParam/wizard_param_mng.php @@ -0,0 +1,149 @@ + + + +"; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + echo "
      "; + echo "Template > Function Wizard"; + echo ""; + echo " "; + echo "
       "; + echo " "; + echo "
      "; + + adjust_title_tail(); + adjust_content_head(); + + if($create_wizard_flag == 1) + { + $wizard_desc=discardReturn($wizard_desc); + $sql="insert into WIZARD_DB.wizardList(func_title,func_desc) values('$wizard_title','$wizard_desc') "; + @mysqli_query($pubConn,$sql); + + $sql="select instance from WIZARD_DB.wizardList where func_title='$wizard_title' "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + $row=@mysqli_fetch_array($res); + $wizard_instance=$row[instance]; + for($j=0;$j<$step_count;$j++) + { + $param="step_title_".$j; + $step_title=$$param; + $param="step_desc_".$j; + $step_desc=$$param; + $step_desc=discardReturn($step_desc); + $param="step_related_system_".$j; + $step_related_system=$$param; + $param="step_related_table_".$j; + $step_related_table=$$param; + $sql="insert into WIZARD_DB.stepList(step_order,step_title,step_desc,related_system,related_table,wizard_instance) values($j,'$step_title','$step_desc',$step_related_system,'$step_related_table',$wizard_instance) "; + @mysqli_query($pubConn,$sql); + } + + + if(0) + { + echo "wizard_title=$wizard_title
      "; + echo "wizard_desc=$wizard_desc
      "; + echo "step_count=$step_count
      "; + for($j=0;$j<$step_count;$j++) + { + $param="step_title_".$j; + echo "step_title_{$j}={$$param},"; + $param="step_desc_".$j; + echo "step_desc_{$j}={$$param},"; + $param="step_related_system_".$j; + echo "step_related_system_{$j}={$$param},"; + $param="step_related_table_".$j; + echo "step_related_table_{$j}={$$param}
      "; + } + } + } + + if($delete_wizard_flag == 1) + { + $sql="delete from WIZARD_DB.stepList where wizard_instance={$wizard_instance} "; + @mysqli_query($pubConn,$sql); + + $sql="delete from WIZARD_DB.wizardList where instance={$wizard_instance} "; + @mysqli_query($pubConn,$sql); + //echo "wizard_instance=$wizard_instance
      "; + + //delete the related wizard record + $sql="select instance from WIZARD_DB.wizardRecordList where wizard_instance={$wizard_instance} "; + $res=@mysqli_query($pubConn,$sql); + $num=@mysqli_num_rows($res); + if($num > 0) + { + for($i=0;$i<$num;$i++) + { + $row=@mysqli_fetch_array($res); + $tmpi=$row[instance]+0; + $delsql="delete from WIZARD_DB.stepRecordList where record_instance={$tmpi} "; + @mysqli_query($pubConn,$delsql); + } + } + $delsql="delete from WIZARD_DB.wizardRecordList where wizard_instance={$wizard_instance} "; + @mysqli_query($pubConn,$delsql); + + + } + + if($modify_wizard_flag == 1) + { + $wizard_desc=discardReturn($wizard_desc); + $sql="update WIZARD_DB.wizardList set func_title='$wizard_title',func_desc='$wizard_desc' where instance={$wizard_instance} "; + @mysqli_query($pubConn,$sql); + + $sql="delete from WIZARD_DB.stepList where wizard_instance=$wizard_instance "; + @mysqli_query($pubConn,$sql); + + for($j=0;$j<$step_count;$j++) + { + $param="step_title_".$j; + $step_title=$$param; + $param="step_desc_".$j; + $step_desc=$$param; + $step_desc=discardReturn($step_desc); + $param="step_related_system_".$j; + $step_related_system=$$param; + $param="step_related_table_".$j; + $step_related_table=$$param; + $sql="insert into WIZARD_DB.stepList(step_order,step_title,step_desc,related_system,related_table,wizard_instance) values($j,'$step_title','$step_desc',$step_related_system,'$step_related_table',$wizard_instance) "; + @mysqli_query($pubConn,$sql); + } + } + + echo "
      "; + echo "Create New Function Wizard"; + + $wizardList=GetWizardList(); + + echo ""; + + adjust_content_tail(); +?> +